//***********************************************************************************
// TMS WEB CORE framework code is copyright (c) 2018 - 2021 by tmssoftware.com bvba
// The code or parts of the code cannot be used in any way outside 
// a TMS WEB Core application generated by a licensed user or company.
//***********************************************************************************
var pas = { $libimports: {}};

var rtl = {

  version: 30301,

  quiet: false,
  debug_load_units: false,
  debug_rtti: false,

  $res : {},

  debug: function(){
    if (rtl.quiet || !console || !console.log) return;
    console.log(arguments);
  },

  error: function(s){
    rtl.debug('Error: ',s);
    throw s;
  },

  warn: function(s){
    rtl.debug('Warn: ',s);
  },

  checkVersion: function(v){
    if (rtl.version != v) throw "expected rtl version "+v+", but found "+rtl.version;
  },

  hiInt: Math.pow(2,53),

  hasString: function(s){
    return rtl.isString(s) && (s.length>0);
  },

  isArray: function(a) {
    return Array.isArray(a);
  },

  isFunction: function(f){
    return typeof(f)==="function";
  },

  isModule: function(m){
    return rtl.isObject(m) && rtl.hasString(m.$name) && (pas[m.$name]===m);
  },

  isImplementation: function(m){
    return rtl.isObject(m) && rtl.isModule(m.$module) && (m.$module.$impl===m);
  },

  isNumber: function(n){
    return typeof(n)==="number";
  },

  isObject: function(o){
    var s=typeof(o);
    return (typeof(o)==="object") && (o!=null);
  },

  isString: function(s){
    return typeof(s)==="string";
  },

  getNumber: function(n){
    return typeof(n)==="number"?n:NaN;
  },

  getChar: function(c){
    return ((typeof(c)==="string") && (c.length===1)) ? c : "";
  },

  getObject: function(o){
    return ((typeof(o)==="object") || (typeof(o)==='function')) ? o : null;
  },

  isTRecord: function(type){
    return (rtl.isObject(type) && type.hasOwnProperty('$new') && (typeof(type.$new)==='function'));
  },

  isPasClass: function(type){
    return (rtl.isObject(type) && type.hasOwnProperty('$classname') && rtl.isObject(type.$module));
  },

  isPasClassInstance: function(type){
    return (rtl.isObject(type) && rtl.isPasClass(type.$class));
  },

  hexStr: function(n,digits){
    return ("000000000000000"+n.toString(16).toUpperCase()).slice(-digits);
  },

  m_loading: 0,
  m_loading_intf: 1,
  m_intf_loaded: 2,
  m_loading_impl: 3, // loading all used unit
  m_initializing: 4, // running initialization
  m_initialized: 5,

  module: function(module_name, intfuseslist, intfcode, impluseslist){
    var lModule = pas[module_name];
    if (lModule) {
      lModule.$intfcode = intfcode;
    } 
    else {
      rtl.modulenew(module_name, intfuseslist, intfcode, impluseslist);
    }
  },

  modulenew: function(module_name, intfuseslist, intfcode, impluseslist){
    if (rtl.debug_load_units) rtl.debug('rtl.module name="'+module_name+'" intfuses='+intfuseslist+' impluses='+impluseslist);
    if (!rtl.hasString(module_name)) rtl.error('invalid module name "'+module_name+'"');
    if (!rtl.isArray(intfuseslist)) rtl.error('invalid interface useslist of "'+module_name+'"');
    if (!rtl.isFunction(intfcode)) rtl.error('invalid interface code of "'+module_name+'"');
    if (!(impluseslist==undefined) && !rtl.isArray(impluseslist)) rtl.error('invalid implementation useslist of "'+module_name+'"');

    if (pas[module_name])
      rtl.error('module "'+module_name+'" is already registered');

    var r = Object.create(rtl.tSectionRTTI);
    var module = r.$module = pas[module_name] = {
      $name: module_name,
      $intfuseslist: intfuseslist,
      $impluseslist: impluseslist,
      $state: rtl.m_loading,
      $intfcode: intfcode,
      $implcode: null,
      $impl: null,
      $rtti: r
    };
    if (impluseslist) module.$impl = {
          $module: module,
          $rtti: r
        };
  },

  exitcode: 0,

  run: function(module_name){
    try {
      if (!rtl.hasString(module_name)) module_name='program';
      if (rtl.debug_load_units) rtl.debug('rtl.run module="'+module_name+'"');
      rtl.initRTTI();
      var module = pas[module_name];
      if (!module) rtl.error('rtl.run module "'+module_name+'" missing');
      rtl.loadintf(module);
      rtl.loadimpl(module);
      if ((module_name=='program') || (module_name=='library')){
        if (rtl.debug_load_units) rtl.debug('running $main');
        var r = pas[module_name].$main();
        if (rtl.isNumber(r)) rtl.exitcode = r;
      }
    } catch(re) {
      if (!rtl.showUncaughtExceptions) {
        throw re
      } else {  
        if (!rtl.handleUncaughtException(re)) {
          rtl.showException(re);
          rtl.exitcode = 216;
        }  
      }
    } 
    return rtl.exitcode;
  },
  
  showException : function (re) {
    var errStack="";
    if (rtl.isObject(re) && re.hasOwnProperty('FJSError') && rtl.isObject(re.FJSError) && !(re.FJSError.stack==undefined)) // rtl Exception
      errStack=re.FJSError.stack
    else if (rtl.isObject(re) && re.hasOwnProperty('stack') && !(re.stack==undefined)) // native JS Error
      errStack=re.stack
    else
      errStack=re; // unknown object
    var errMsg = rtl.hasString(re.$classname) ? re.$classname : '';
    errMsg += ((errMsg) ? ': ' : '') + (re.hasOwnProperty('fMessage') ? re.fMessage : '');
    errMsg += ((errMsg) ? "\n" : '') + errStack;
    errMsg = "Uncaught Exception:\n" + errMsg;
    console.log(errMsg);
    alert(errMsg);
  },

  handleUncaughtException: function (e) {
    if (rtl.onUncaughtException) {
      try {
        rtl.onUncaughtException(e);
        return true;
      } catch (ee) {
        return false; 
      }
    } else {
      return false;
    }
  },

  loadintf: function(module){
    if (module.$state>rtl.m_loading_intf) return; // already finished
    if (rtl.debug_load_units) rtl.debug('loadintf: "'+module.$name+'"');
    if (module.$state===rtl.m_loading_intf)
      rtl.error('unit cycle detected "'+module.$name+'"');
    module.$state=rtl.m_loading_intf;
    // load interfaces of interface useslist
    rtl.loaduseslist(module,module.$intfuseslist,rtl.loadintf);
    // run interface
    if (rtl.debug_load_units) rtl.debug('loadintf: run intf of "'+module.$name+'"');
    module.$intfcode(module.$intfuseslist);
    // success
    module.$state=rtl.m_intf_loaded;
    // Note: units only used in implementations are not yet loaded (not even their interfaces)
  },

  loaduseslist: function(module,useslist,f){
    if (useslist==undefined) return;
    var len = useslist.length;
    for (var i = 0; i<len; i++) {
      var unitname=useslist[i];
      if (rtl.debug_load_units) rtl.debug('loaduseslist of "'+module.$name+'" uses="'+unitname+'"');
      if (pas[unitname]==undefined)
        rtl.error('module "'+module.$name+'" misses "'+unitname+'"');
      f(pas[unitname]);
    }
  },

  loadimpl: function(module){
    if (module.$state>=rtl.m_loading_impl) return; // already processing
    if (module.$state<rtl.m_intf_loaded) rtl.error('loadimpl: interface not loaded of "'+module.$name+'"');
    if (rtl.debug_load_units) rtl.debug('loadimpl: load uses of "'+module.$name+'"');
    module.$state=rtl.m_loading_impl;
    // load interfaces of implementation useslist
    rtl.loaduseslist(module,module.$impluseslist,rtl.loadintf);
    // load implementation of interfaces useslist
    rtl.loaduseslist(module,module.$intfuseslist,rtl.loadimpl);
    // load implementation of implementation useslist
    rtl.loaduseslist(module,module.$impluseslist,rtl.loadimpl);
    // Note: At this point all interfaces used by this unit are loaded. If
    //   there are implementation uses cycles some used units might not yet be
    //   initialized. This is by design.
    // run implementation
    if (rtl.debug_load_units) rtl.debug('loadimpl: run impl of "'+module.$name+'"');
    if (rtl.isFunction(module.$implcode)) module.$implcode(module.$impluseslist);
    // run initialization
    if (rtl.debug_load_units) rtl.debug('loadimpl: run init of "'+module.$name+'"');
    module.$state=rtl.m_initializing;
    if (rtl.isFunction(module.$init)) module.$init();
    // unit initialized
    module.$state=rtl.m_initialized;
  },

  createCallback: function(scope, fn){
    var cb;
    if (typeof(fn)==='string'){
      if (!scope.hasOwnProperty('$events')) scope.$events = {};
      cb = scope.$events[fn];
      if (cb) return cb;
      scope.$events[fn] = cb = function(){
        return scope[fn].apply(scope,arguments);
      };
    } else {
      cb = function(){
        return fn.apply(scope,arguments);
      };
    };
    cb.scope = scope;
    cb.fn = fn;
    return cb;
  },

  createSafeCallback: function(scope, fn){
    var cb;
    if (typeof(fn)==='string'){
      if (!scope[fn]) return null;
      if (!scope.hasOwnProperty('$events')) scope.$events = {};
      cb = scope.$events[fn];
      if (cb) return cb;
      scope.$events[fn] = cb = function(){
        try{
          return scope[fn].apply(scope,arguments);
        } catch (err) {
          if (!rtl.handleUncaughtException(err)) throw err;
        }
      };
    } else if(!fn) {
      return null;
    } else {
      cb = function(){
        try{
          return fn.apply(scope,arguments);
        } catch (err) {
          if (!rtl.handleUncaughtException(err)) throw err;
        }
      };
    };
    cb.scope = scope;
    cb.fn = fn;
    return cb;
  },

  eqCallback: function(a,b){
    // can be a function or a function wrapper
    if (a===b){
      return true;
    } else {
      return (a!=null) && (b!=null) && (a.fn) && (a.scope===b.scope) && (a.fn===b.fn);
    }
  },

  initStruct: function(c,parent,name){
    if ((parent.$module) && (parent.$module.$impl===parent)) parent=parent.$module;
    c.$parent = parent;
    if (rtl.isModule(parent)){
      c.$module = parent;
      c.$name = name;
    } else {
      c.$module = parent.$module;
      c.$name = parent.$name+'.'+name;
    };
    return parent;
  },

  initClass: function(c,parent,name,initfn,rttiname){
    parent[name] = c;
    c.$class = c; // Note: o.$class === Object.getPrototypeOf(o)
    c.$classname = rttiname?rttiname:name;
    parent = rtl.initStruct(c,parent,name);
    c.$fullname = parent.$name+'.'+name;
    // rtti
    if (rtl.debug_rtti) rtl.debug('initClass '+c.$fullname);
    var t = c.$module.$rtti.$Class(c.$classname,{ "class": c });
    c.$rtti = t;
    if (rtl.isObject(c.$ancestor)) t.ancestor = c.$ancestor.$rtti;
    if (!t.ancestor) t.ancestor = null;
    // init members
    initfn.call(c);
  },

  createClass: function(parent,name,ancestor,initfn,rttiname){
    // create a normal class,
    // ancestor must be null or a normal class,
    // the root ancestor can be an external class
    var lClass = parent[name];
    if (lClass) {
      rtl.initClass(lClass, parent, name, initfn, rttiname);
      return lClass; 
    }

    var c = null;
    if (ancestor != null){
      c = Object.create(ancestor);
      c.$ancestor = ancestor;
      // Note:
      // if root is an "object" then c.$ancestor === Object.getPrototypeOf(c)
      // if root is a "function" then c.$ancestor === c.__proto__, Object.getPrototypeOf(c) returns the root
    } else {
      c = { $ancestor: null };
      c.$create = function(fn,args){
        if (args == undefined) args = [];
        var o = Object.create(this);
        o.$init();
        try{
          if (typeof(fn)==="string"){
            o[fn].apply(o,args);
          } else {
            fn.apply(o,args);
          };
          o.AfterConstruction();
        } catch($e){
          // do not call BeforeDestruction
          if (o.Destroy) o.Destroy();
          o.$final();
          throw $e;
        }
        return o;
      };
      c.$destroy = function(fnname){
        this.BeforeDestruction();
        if (this[fnname]) this[fnname]();
        this.$final();
      };
    };
    rtl.initClass(c,parent,name,initfn,rttiname);
  },

  createClassExt: function(parent,name,ancestor,newinstancefnname,initfn,rttiname){
    // Create a class using an external ancestor.
    // If newinstancefnname is given, use that function to create the new object.
    // If exist call BeforeDestruction and AfterConstruction.
    var lClass = parent[name];
    if (lClass) {
      rtl.initClass(lClass, parent, name, initfn, rttiname);
      return lClass; 
    }

    var isFunc = rtl.isFunction(ancestor);
    var c = null;
    if (isFunc){
      // create pascal class descendent from JS function
      c = Object.create(ancestor.prototype);
      c.$ancestorfunc = ancestor;
      c.$ancestor = null; // no pascal ancestor
    } else if (ancestor.$func){
      // create pascal class descendent from a pascal class descendent of a JS function
      isFunc = true;
      c = Object.create(ancestor);
      c.$ancestor = ancestor;
    } else {
      c = Object.create(ancestor);
      c.$ancestor = null; // no pascal ancestor
    }
    c.$create = function(fn,args){
      if (args == undefined) args = [];
      var o = null;
      if (newinstancefnname.length>0){
        o = this[newinstancefnname](fn,args);
      } else if(isFunc) {
        o = new this.$func(args);
      } else {
        o = Object.create(c);
      }
      if (o.$init) o.$init();
      try{
        if (typeof(fn)==="string"){
          this[fn].apply(o,args);
        } else {
          fn.apply(o,args);
        };
        if (o.AfterConstruction) o.AfterConstruction();
      } catch($e){
        // do not call BeforeDestruction
        if (o.Destroy) o.Destroy();
        if (o.$final) o.$final();
        throw $e;
      }
      return o;
    };
    c.$destroy = function(fnname){
      if (this.BeforeDestruction) this.BeforeDestruction();
      if (this[fnname]) this[fnname]();
      if (this.$final) this.$final();
    };
    rtl.initClass(c,parent,name,initfn,rttiname);
    if (isFunc){
      function f(){}
      f.prototype = c;
      c.$func = f;
    }
  },

  createHelper: function(parent,name,ancestor,initfn,rttiname){
    // create a helper,
    // ancestor must be null or a helper,
    var lHelper = parent[name];
    if (lHelper) {
      initfn.call(lHelper);
      return lHelper; 
    }

    var c = null;
    if (ancestor != null){
      c = Object.create(ancestor);
      c.$ancestor = ancestor;
      // c.$ancestor === Object.getPrototypeOf(c)
    } else {
      c = { $ancestor: null };
    };
    parent[name] = c;
    c.$class = c; // Note: o.$class === Object.getPrototypeOf(o)
    c.$classname = rttiname?rttiname:name;
    parent = rtl.initStruct(c,parent,name);
    c.$fullname = parent.$name+'.'+name;
    // rtti
    var t = c.$module.$rtti.$Helper(c.$classname,{ "helper": c });
    c.$rtti = t;
    if (rtl.isObject(ancestor)) t.ancestor = ancestor.$rtti;
    if (!t.ancestor) t.ancestor = null;
    // init members
    initfn.call(c);
  },

  tObjectDestroy: "Destroy",

  free: function(obj,name){
    if (obj[name]==null) return null;
    obj[name].$destroy(rtl.tObjectDestroy);
    obj[name]=null;
  },

  freeLoc: function(obj){
    if (obj==null) return null;
    obj.$destroy(rtl.tObjectDestroy);
    return null;
  },

  hideProp: function(o,p,v){
    Object.defineProperty(o,p, {
      enumerable: false,
      configurable: true,
      writable: true
    });
    if(arguments.length>2){ o[p]=v; }
  },

  recNewT: function(parent,name,initfn,full){
    if (parent) {
      var lRec = parent[name];
      if (lRec) {
        initfn.call(lRec);
        return lRec;
      }
    } 

    // create new record type
    var t = {};
    if (parent) parent[name] = t;
    var h = rtl.hideProp;
    if (full){
      rtl.initStruct(t,parent,name);
      t.$record = t;
      h(t,'$record');
      h(t,'$name');
      h(t,'$parent');
      h(t,'$module');
      h(t,'$initSpec');
    }
    initfn.call(t);
    if (!t.$new){
      t.$new = function(){ return Object.create(t); };
    }
    t.$clone = function(r){ return t.$new().$assign(r); };
    h(t,'$new');
    h(t,'$clone');
    h(t,'$eq');
    h(t,'$assign');
    return t;
  },

  is: function(instance,type){
    return type.isPrototypeOf(instance) || (instance===type);
  },

  isExt: function(instance,type,mode){
    // mode===1 means instance must be a Pascal class instance
    // mode===2 means instance must be a Pascal class
    // Notes:
    // isPrototypeOf and instanceof return false on equal
    // isPrototypeOf does not work for Date.isPrototypeOf(new Date())
    //   so if isPrototypeOf is false test with instanceof
    // instanceof needs a function on right side
    if (instance == null) return false; // Note: ==null checks for undefined too
    if ((typeof(type) !== 'object') && (typeof(type) !== 'function')) return false;
    if (instance === type){
      if (mode===1) return false;
      if (mode===2) return rtl.isPasClass(instance);
      return true;
    }
    if (type.isPrototypeOf && type.isPrototypeOf(instance)){
      if (mode===1) return rtl.isPasClassInstance(instance);
      if (mode===2) return rtl.isPasClass(instance);
      return true;
    }
    if ((typeof type == 'function') && (instance instanceof type)) return true;
    return false;
  },

  Exception: null,
  EInvalidCast: null,
  EAbstractError: null,
  ERangeError: null,
  EIntOverflow: null,
  EPropWriteOnly: null,

  raiseE: function(typename){
    var t = rtl[typename];
    if (t==null){
      var mod = pas.SysUtils;
      if (!mod) mod = pas.sysutils;
      if (!mod) mod = pas["System.SysUtils"];
      if (mod){
        t = mod[typename];
        if (!t) t = mod[typename.toLowerCase()];
        if (!t) t = mod['Exception'];
        if (!t) t = mod['exception'];
      }
      if (t) rtl[typename]=t;
    }
    if (t) {
      
      if (t.Create){
        var e = t.$create("Create");
      } else if (t.create) {
        var e = t.$create("create");
      }
      if (e) {
        e.FJSError = new Error;
        throw e ;
      }
    }
    if (typename === "EInvalidCast") throw new Error("invalid type cast");
    if (typename === "EAbstractError") throw new Error("Abstract method called");
    if (typename === "ERangeError") throw new Error("range error");
    throw typename;
  },

  as: function(instance,type){
    if((instance === null) || rtl.is(instance,type)) return instance;
    rtl.raiseE("EInvalidCast");
  },

  asExt: function(instance,type,mode){
    if((instance === null) || rtl.isExt(instance,type,mode)) return instance;
    rtl.raiseE("EInvalidCast");
  },

  createInterface: function(module, name, guid, fnnames, ancestor, initfn, rttiname){
    //console.log('createInterface name="'+name+'" guid="'+guid+'" names='+fnnames);
    var lInterface = module[name];
    if (lInterface) {
      if (rtl.isFunction(initfn)) {
        initfn.call(lInterface);
      }
      return lInterface; 
    }

    var i = ancestor?Object.create(ancestor):{};
    module[name] = i;
    i.$module = module;
    i.$name = rttiname?rttiname:name;
    i.$fullname = module.$name+'.'+i.$name;
    i.$guid = guid;
    i.$guidr = null;
    i.$names = fnnames?fnnames:[];
    if (rtl.isFunction(initfn)){
      // rtti
      if (rtl.debug_rtti) rtl.debug('createInterface '+i.$fullname);
      var t = i.$module.$rtti.$Interface(i.$name,{ "interface": i, module: module });
      i.$rtti = t;
      if (ancestor) t.ancestor = ancestor.$rtti;
      if (!t.ancestor) t.ancestor = null;
      initfn.call(i);
    }
    return i;
  },

  strToGUIDR: function(s,g){
    var p = 0;
    function n(l){
      var h = s.substr(p,l);
      p+=l;
      return parseInt(h,16);
    }
    p+=1; // skip {
    g.D1 = n(8);
    p+=1; // skip -
    g.D2 = n(4);
    p+=1; // skip -
    g.D3 = n(4);
    p+=1; // skip -
    if (!g.D4) g.D4=[];
    g.D4[0] = n(2);
    g.D4[1] = n(2);
    p+=1; // skip -
    for(var i=2; i<8; i++) g.D4[i] = n(2);
    return g;
  },

  guidrToStr: function(g){
    if (g.$intf) return g.$intf.$guid;
    var h = rtl.hexStr;
    var s='{'+h(g.D1,8)+'-'+h(g.D2,4)+'-'+h(g.D3,4)+'-'+h(g.D4[0],2)+h(g.D4[1],2)+'-';
    for (var i=2; i<8; i++) s+=h(g.D4[i],2);
    s+='}';
    return s;
  },

  createTGUID: function(guid){
    var TGuid = (pas.System)?pas.System.TGuid:pas.system.tguid;
    var g = rtl.strToGUIDR(guid,TGuid.$new());
    return g;
  },

  getIntfGUIDR: function(intfTypeOrVar){
    if (!intfTypeOrVar) return null;
    if (!intfTypeOrVar.$guidr){
      var g = rtl.createTGUID(intfTypeOrVar.$guid);
      if (!intfTypeOrVar.hasOwnProperty('$guid')) intfTypeOrVar = Object.getPrototypeOf(intfTypeOrVar);
      g.$intf = intfTypeOrVar;
      intfTypeOrVar.$guidr = g;
    }
    return intfTypeOrVar.$guidr;
  },

  addIntf: function (aclass, intf, map){
    function jmp(fn){
      if (typeof(fn)==="function"){
        return function(){ return fn.apply(this.$o,arguments); };
      } else {
        return function(){ rtl.raiseE('EAbstractError'); };
      }
    }
    if(!map) map = {};
    var t = intf;
    var item = Object.create(t);
    if (!aclass.hasOwnProperty('$intfmaps')) aclass.$intfmaps = {};
    aclass.$intfmaps[intf.$guid] = item;
    do{
      var names = t.$names;
      if (!names) break;
      for (var i=0; i<names.length; i++){
        var intfname = names[i];
        var fnname = map[intfname];
        if (!fnname) fnname = intfname;
        //console.log('addIntf: intftype='+t.$name+' index='+i+' intfname="'+intfname+'" fnname="'+fnname+'" old='+typeof(item[intfname]));
        item[intfname] = jmp(aclass[fnname]);
      }
      t = Object.getPrototypeOf(t);
    }while(t!=null);
  },

  getIntfG: function (obj, guid, query){
    if (!obj) return null;
    //console.log('getIntfG: obj='+obj.$classname+' guid='+guid+' query='+query);
    // search
    var maps = obj.$intfmaps;
    if (!maps) return null;
    var item = maps[guid];
    if (!item) return null;
    // check delegation
    //console.log('getIntfG: obj='+obj.$classname+' guid='+guid+' query='+query+' item='+typeof(item));
    if (typeof item === 'function') return item.call(obj); // delegate. Note: COM contains _AddRef
    // check cache
    var intf = null;
    if (obj.$interfaces){
      intf = obj.$interfaces[guid];
      //console.log('getIntfG: obj='+obj.$classname+' guid='+guid+' cache='+typeof(intf));
    }
    if (!intf){ // intf can be undefined!
      intf = Object.create(item);
      intf.$o = obj;
      if (!obj.$interfaces) obj.$interfaces = {};
      obj.$interfaces[guid] = intf;
    }
    if (typeof(query)==='object'){
      // called by queryIntfT
      var o = null;
      if (intf.QueryInterface(rtl.getIntfGUIDR(query),
          {get:function(){ return o; }, set:function(v){ o=v; }}) === 0){
        return o;
      } else {
        return null;
      }
    } else if(query===2){
      // called by TObject.GetInterfaceByStr
      if (intf.$kind === 'com') intf._AddRef();
    }
    return intf;
  },

  getIntfT: function(obj,intftype){
    return rtl.getIntfG(obj,intftype.$guid);
  },

  queryIntfT: function(obj,intftype){
    return rtl.getIntfG(obj,intftype.$guid,intftype);
  },

  queryIntfIsT: function(obj,intftype){
    var i = rtl.getIntfG(obj,intftype.$guid);
    if (!i) return false;
    if (i.$kind === 'com') i._Release();
    return true;
  },

  asIntfT: function (obj,intftype){
    var i = rtl.getIntfG(obj,intftype.$guid);
    if (i!==null) return i;
    rtl.raiseEInvalidCast();
  },

  intfIsIntfT: function(intf,intftype){
    return (intf!==null) && rtl.queryIntfIsT(intf.$o,intftype);
  },

  intfAsIntfT: function (intf,intftype){
    if (!intf) return null;
    var i = rtl.getIntfG(intf.$o,intftype.$guid);
    if (i) return i;
    rtl.raiseEInvalidCast();
  },

  intfIsClass: function(intf,classtype){
    return (intf!=null) && (rtl.is(intf.$o,classtype));
  },

  intfAsClass: function(intf,classtype){
    if (intf==null) return null;
    return rtl.as(intf.$o,classtype);
  },

  intfToClass: function(intf,classtype){
    if ((intf!==null) && rtl.is(intf.$o,classtype)) return intf.$o;
    return null;
  },

  // interface reference counting
  intfRefs: { // base object for temporary interface variables
    ref: function(id,intf){
      // called for temporary interface references needing delayed release
      var old = this[id];
      //console.log('rtl.intfRefs.ref: id='+id+' old="'+(old?old.$name:'null')+'" intf="'+(intf?intf.$name:'null')+' $o='+(intf?intf.$o:'null'));
      if (old){
        // called again, e.g. in a loop
        delete this[id];
        old._Release(); // may fail
      }
      if(intf) {
        this[id]=intf;
      }
      return intf;
    },
    free: function(){
      //console.log('rtl.intfRefs.free...');
      for (var id in this){
        if (this.hasOwnProperty(id)){
          var intf = this[id];
          if (intf){
            //console.log('rtl.intfRefs.free: id='+id+' '+intf.$name+' $o='+intf.$o.$classname);
            intf._Release();
          }
        }
      }
    }
  },

  createIntfRefs: function(){
    //console.log('rtl.createIntfRefs');
    return Object.create(rtl.intfRefs);
  },

  setIntfP: function(path,name,value,skipAddRef){
    var old = path[name];
    //console.log('rtl.setIntfP path='+path+' name='+name+' old="'+(old?old.$name:'null')+'" value="'+(value?value.$name:'null')+'"');
    if (old === value) return;
    if (old !== null){
      path[name]=null;
      old._Release();
    }
    if (value !== null){
      if (!skipAddRef) value._AddRef();
      path[name]=value;
    }
  },

  setIntfL: function(old,value,skipAddRef){
    //console.log('rtl.setIntfL old="'+(old?old.$name:'null')+'" value="'+(value?value.$name:'null')+'"');
    if (old !== value){
      if (value!==null){
        if (!skipAddRef) value._AddRef();
      }
      if (old!==null){
        old._Release();  // Release after AddRef, to avoid double Release if Release creates an exception
      }
    } else if (skipAddRef){
      if (old!==null){
        old._Release();  // value has an AddRef
      }
    }
    return value;
  },

  _AddRef: function(intf){
    //if (intf) console.log('rtl._AddRef intf="'+(intf?intf.$name:'null')+'"');
    if (intf) intf._AddRef();
    return intf;
  },

  _Release: function(intf){
    //if (intf) console.log('rtl._Release intf="'+(intf?intf.$name:'null')+'"');
    if (intf) intf._Release();
    return intf;
  },

  trunc: function(a){
    return a<0 ? Math.ceil(a) : Math.floor(a);
  },

  checkMethodCall: function(obj,type){
    if (rtl.isObject(obj) && rtl.is(obj,type)) return;
    rtl.raiseE("EInvalidCast");
  },

  oc: function(i){
    // overflow check integer
    if ((Math.floor(i)===i) && (i>=-0x1fffffffffffff) && (i<=0x1fffffffffffff)) return i;
    rtl.raiseE('EIntOverflow');
  },

  rc: function(i,minval,maxval){
    // range check integer
    if ((Math.floor(i)===i) && (i>=minval) && (i<=maxval)) return i;
    rtl.raiseE('ERangeError');
  },

  rcc: function(c,minval,maxval){
    // range check char
    if ((typeof(c)==='string') && (c.length===1)){
      var i = c.charCodeAt(0);
      if ((i>=minval) && (i<=maxval)) return c;
    }
    rtl.raiseE('ERangeError');
  },

  rcSetCharAt: function(s,index,c){
    // range check setCharAt
    if ((typeof(s)!=='string') || (index<0) || (index>=s.length)) rtl.raiseE('ERangeError');
    return rtl.setCharAt(s,index,c);
  },

  rcCharAt: function(s,index){
    // range check charAt
    if ((typeof(s)!=='string') || (index<0) || (index>=s.length)) rtl.raiseE('ERangeError');
    return s.charAt(index);
  },

  rcArrR: function(arr,index){
    // range check read array
    if (Array.isArray(arr) && (typeof(index)==='number') && (index>=0) && (index<arr.length)){
      if (arguments.length>2){
        // arr,index1,index2,...
        arr=arr[index];
        for (var i=2; i<arguments.length; i++) arr=rtl.rcArrR(arr,arguments[i]);
        return arr;
      }
      return arr[index];
    }
    rtl.raiseE('ERangeError');
  },

  rcArrW: function(arr,index,value){
    // range check write array
    // arr,index1,index2,...,value
    for (var i=3; i<arguments.length; i++){
      arr=rtl.rcArrR(arr,index);
      index=arguments[i-1];
      value=arguments[i];
    }
    if (Array.isArray(arr) && (typeof(index)==='number') && (index>=0) && (index<arr.length)){
      return arr[index]=value;
    }
    rtl.raiseE('ERangeError');
  },

  length: function(arr){
    return (arr == null) ? 0 : arr.length;
  },

  arrayRef: function(a){
    if (a!=null) rtl.hideProp(a,'$pas2jsrefcnt',2);
    return a;
  },

  arrayManaged: function(refCnt,mode,a){
    // mode: 0: don't touch elements, 1: null elements, 2: _AddRef elements
    if(!a) a = [];
    a.$pas2jsrefcnt = refCnt?refCnt:0;
    a._AddRef = function(){
      this.$pas2jsrefcnt++;
    };
    a._Release = function(){
      this.$pas2jsrefcnt--;
      if (this.$pas2jsrefcnt==0){
        for (var i=0; i<this.length; i++){
          rtl.setIntfP(this,i,null);
        }
      }
    };
    if (mode>0){
      for (var i=0; i<a.length; i++){
        if (mode === 2){
          rtl._AddRef(a[i]);
        } else {
          a[i]=null;
        }
      }
    }
    return a;
  },

  arraySetLength: function(arr,defaultvalue,newlength){
    var stack = [];
    var s = 9999;
    for (var i=2; i<arguments.length; i++){
      var j = arguments[i];
      if (j==='s'){ s = i-2; }
      else {
        stack.push({ dim:j+0, a:null, i:0, src:null });
      }
    }
    var dimmax = stack.length-1;
    var depth = 0;
    var newlen = 0;
    var item = null;
    var a = null;
    var src = arr;
    var srclen = 0, oldlen = 0;
    var type = 0;
    var managed = false;
    if (rtl.isArray(defaultvalue)){
      // array of dyn array
      type = 1;
    } else if (rtl.isObject(defaultvalue)) {
      if (rtl.isTRecord(defaultvalue)){
        // array of record
        type = 2;
      } else {
        // array of set
        type = 3;
      }
    } else if (defaultvalue == 'R'){
      // array of COM interface
      type = 4;
      managed = true;
    }

    do{
      if (depth>0){
        item = stack[depth-1];
        src = (item.src && item.src.length>item.i) ? item.src[item.i] : null;
      }
      if (!src){
        // init array
        managed ? a=rtl.arrayManaged(1) : a=[];
        srclen = 0;
        oldlen = 0;
      } else if (src.$pas2jsrefcnt>1 || depth>=s){
        // clone
        if (managed){
          a = rtl.arrayManaged(1);
          src.$pas2jsrefcnt--;
        } else {
          a = [];
        }
        srclen = src.length;
        oldlen = srclen;
      } else {
        // keep old
        a = src;
        srclen = 0;
        oldlen = a.length;
      }
      newlen = stack[depth].dim;
      if (managed){
        if (a.length>=newlen){
          // shrink -> release elements
          for (var i=a.length-1; i>=newlen; i--){
            rtl.setIntfP(a,i,null);
          }
          a.length = newlen;
        } else {
          // enlarge -> null elements
          var l = a.length;
          a.length = newlen;
          for (var i=l; i<newlen; i++){
            a[i]=null;
          }
          oldlen = newlen;
        }
      } else {
        a.length = newlen;
      }
      if (depth>0){
        item.a[item.i]=a;
        item.i++;
        if ((newlen===0) && (item.i<item.a.length)) continue;
      }
      if (newlen>0){
        if (depth<dimmax){
          item = stack[depth];
          item.a = a;
          item.i = 0;
          item.src = src;
          depth++;
          continue;
        } else {
          if (srclen>newlen) srclen=newlen;
          if (type == 0){
            // array of simple value
            for (var i=0; i<srclen; i++) a[i]=src[i];
            for (var i=oldlen; i<newlen; i++) a[i]=defaultvalue;
          } else if (type == 1){
            // array of dyn array
            for (var i=0; i<srclen; i++) a[i]=src[i];
            for (var i=oldlen; i<newlen; i++) a[i]=[];
          } else if (type == 2) {
            // array of record
            for (var i=0; i<srclen; i++) a[i]=defaultvalue.$clone(src[i]);
            for (var i=oldlen; i<newlen; i++) a[i]=defaultvalue.$new();
          } else if (type == 3) {
            // array of set
            for (var i=0; i<srclen; i++) a[i]=rtl.refSet(src[i]);
            for (var i=oldlen; i<newlen; i++) a[i]={};
          } else if (type == 4){
            // array of interface
            for (var i=0; i<srclen; i++) rtl.setIntfP(a,i,src[i]);
            for (var i=oldlen; i<newlen; i++) a[i]=null;
          }
        }
      }
      // backtrack
      while ((depth>0) && (stack[depth-1].i>=stack[depth-1].dim)){
        depth--;
      };
      if (depth===0){
        return dimmax===0 ? a : stack[0].a;
      }
    }while (true);
  },

  arrayEq: function(a,b){
    if (a===null) return b===null;
    if (b===null) return false;
    if (a.length!==b.length) return false;
    for (var i=0; i<a.length; i++) if (a[i]!==b[i]) return false;
    return true;
  },

  arrayClone: function(type,src,srcpos,endpos,dst,dstpos){
    // type: 0 for references or simple values
    // src must not be null
    // dst at dstpos must not contain managed old values
    // This function does not range check.
    if(type === 'refSet') {
      for (; srcpos<endpos; srcpos++) dst[dstpos++] = rtl.refSet(src[srcpos]); // ref set
    } else if (type === 'slice'){
      for (; srcpos<endpos; srcpos++) dst[dstpos++] = src[srcpos].slice(0); // clone static array of simple types
    } else if (typeof(type)==='function'){
      for (; srcpos<endpos; srcpos++) dst[dstpos++] = type(src[srcpos]); // clone function
    } else if (rtl.isTRecord(type)){
      for (; srcpos<endpos; srcpos++) dst[dstpos++] = type.$clone(src[srcpos]); // clone record
    } else if (type === 'R'){
      // clone managed instance
      for (; srcpos<endpos; srcpos++){
        dst[dstpos++]=rtl._AddRef(src[srcpos]);
      }
    } else {
      for (; srcpos<endpos; srcpos++) dst[dstpos++] = src[srcpos]; // reference
    };
  },

  arrayConcat: function(type){
    // type: see rtl.arrayClone
    // returns refCnt=1
    var a = [];
    var l = 0;
    for (var i=1; i<arguments.length; i++){
      var src = arguments[i];
      if (src !== null) l+=src.length;
    };
    a.length = l;
    if (type === 'R'){
      rtl.arrayManaged(1,1,a);
    }
    l=0;
    for (var i=1; i<arguments.length; i++){
      var src = arguments[i];
      if (src === null) continue;
      rtl.arrayClone(type,src,0,src.length,a,l);
      l+=src.length;
    };
    return a;
  },

  arrayConcatN: function(){
    var a = null;
    for (var i=0; i<arguments.length; i++){
      var src = arguments[i];
      if (src === null) continue;
      if (a===null){
        a=rtl.arrayRef(src); // Note: concat(arr) does not clone
      } else if (a.$pas2jsrefcnt>1){
        a=a.concat(src); // clone a and append src
      } else {
        for (var i=0; i<src.length; i++){
          a.push(src[i]);
        }
      }
    };
    return a;
  },

  arrayPush: function(type,a){
    if(a===null){
      a=(type==='R') ? rtl.arrayManaged(1) : [];
    } else if (a.$pas2jsrefcnt>1){
      a=rtl.arrayCopy(type,a,0,a.length);
    }
    rtl.arrayClone(type,arguments,2,arguments.length,a,a.length);
    return a;
  },

  arrayPushN: function(a){
    if(a===null){
      a=[];
    } else if (a.$pas2jsrefcnt>1){
      a=a.concat();
    }
    for (var i=1; i<arguments.length; i++){
      a.push(arguments[i]);
    }
    return a;
  },

  arrayCopy: function(type, srcarray, index, count){
    // type: see rtl.arrayClone
    // if count is missing, use srcarray.length
    if (srcarray === null) return (type === 'R') ? null : [];
    if (count === undefined) count=srcarray.length;
    if (index < 0){
      count+=index;
      index = 0;
    }
    var end = index+count;
    if (end>srcarray.length) end = srcarray.length;
    if (index>=end) return (type === 'R') ? null : [];
    if (type===0){
      return srcarray.slice(index,end);
    } else {
      var a = [];
      a.length = end-index;
      if (type === 'R'){
        rtl.arrayManaged(1,1,a);
      }
      rtl.arrayClone(type,srcarray,index,end,a,0);
      return a;
    }
  },

  arrayInsert: function(item, a, index, type){
    var m = (type === 'R');
    if (m) rtl._AddRef(item);
    if (a){
      if (a.$pas2jsrefcnt>1){
        if (m){
          // clone
          a.$pas2jsrefcnt--;
          a=rtl.arrayManaged(1,2,a.concat());
        } else {
          a=a.concat();
        }
      }
      a.splice(index,0,item);
      return a;
    } else {
      a = [item];
      if (m) a=rtl.arrayManaged(1,0,a);
      return a;
    }
  },

  arrayDeleteR: function(a, index, count){
    if (a===null || index<0 || index>=a.length || count<=0) return a;
    if (index+count>a.length) count=a.length-index;
    if (a.$pas2jsrefcnt>1){
      // clone
      a.$pas2jsrefcnt--;
      a=rtl.arrayManaged(1,2,a.concat());
    }
    for (var i=0; i<count; i++) rtl.setIntfP(a,index+i,null);
    a.splice(index,count);
    return a;
  },

  setCharAt: function(s,index,c){
    return s.substr(0,index)+c+s.substr(index+1);
  },

  getResStr: function(mod,name){
    var rs = mod.$resourcestrings[name];
    return rs.current?rs.current:rs.org;
  },

  createSet: function(){
    var s = {};
    for (var i=0; i<arguments.length; i++){
      if (arguments[i]!=null){
        s[arguments[i]]=true;
      } else {
        var first=arguments[i+=1];
        var last=arguments[i+=1];
        for(var j=first; j<=last; j++) s[j]=true;
      }
    }
    return s;
  },

  cloneSet: function(s){
    var r = {};
    for (var key in s) r[key]=true;
    return r;
  },

  refSet: function(s){
    rtl.hideProp(s,'$shared',true);
    return s;
  },

  includeSet: function(s,enumvalue){
    if (s.$shared) s = rtl.cloneSet(s);
    s[enumvalue] = true;
    return s;
  },

  excludeSet: function(s,enumvalue){
    if (s.$shared) s = rtl.cloneSet(s);
    delete s[enumvalue];
    return s;
  },

  diffSet: function(s,t){
    var r = {};
    for (var key in s) if (!t[key]) r[key]=true;
    return r;
  },

  unionSet: function(s,t){
    var r = {};
    for (var key in s) r[key]=true;
    for (var key in t) r[key]=true;
    return r;
  },

  intersectSet: function(s,t){
    var r = {};
    for (var key in s) if (t[key]) r[key]=true;
    return r;
  },

  symDiffSet: function(s,t){
    var r = {};
    for (var key in s) if (!t[key]) r[key]=true;
    for (var key in t) if (!s[key]) r[key]=true;
    return r;
  },

  eqSet: function(s,t){
    for (var key in s) if (!t[key]) return false;
    for (var key in t) if (!s[key]) return false;
    return true;
  },

  neSet: function(s,t){
    return !rtl.eqSet(s,t);
  },

  leSet: function(s,t){
    for (var key in s) if (!t[key]) return false;
    return true;
  },

  geSet: function(s,t){
    for (var key in t) if (!s[key]) return false;
    return true;
  },

  strSetLength: function(s,newlen){
    var oldlen = s.length;
    if (oldlen > newlen){
      return s.substring(0,newlen);
    } else if (s.repeat){
      // Note: repeat needs ECMAScript6!
      return s+' '.repeat(newlen-oldlen);
    } else {
       while (oldlen<newlen){
         s+=' ';
         oldlen++;
       };
       return s;
    }
  },

  spaceLeft: function(s,width){
    var l=s.length;
    if (l>=width) return s;
    if (s.repeat){
      // Note: repeat needs ECMAScript6!
      return ' '.repeat(width-l) + s;
    } else {
      while (l<width){
        s=' '+s;
        l++;
      };
      return s;
    };
  },

  floatToStr: function(d,w,p){
    // input 1-3 arguments: double, width, precision
    if (arguments.length>2){
      return rtl.spaceLeft(d.toFixed(p),w);
    } else {
	  // exponent width
	  var pad = "";
	  var ad = Math.abs(d);
	  if (((ad>1) && (ad<1.0e+10)) ||  ((ad>1.e-10) && (ad<1))) {
		pad='00';
	  } else if ((ad>1) && (ad<1.0e+100) || (ad<1.e-10)) {
		pad='0';
      }  	
	  if (arguments.length<2) {
	    w=24;		
      } else if (w<9) {
		w=9;
      }		  
      var p = w-8;
      var s=(d>0 ? " " : "" ) + d.toExponential(p);
      s=s.replace(/e(.)/,'E$1'+pad);
      return rtl.spaceLeft(s,w);
    }
  },

  valEnum: function(s, enumType, setCodeFn){
    s = s.toLowerCase();
    for (var key in enumType){
      if((typeof(key)==='string') && (key.toLowerCase()===s)){
        setCodeFn(0);
        return enumType[key];
      }
    }
    setCodeFn(1);
    return 0;
  },

  lw: function(l){
    // fix longword bitwise operation
    return l<0?l+0x100000000:l;
  },

  and: function(a,b){
    var hi = 0x80000000;
    var low = 0x7fffffff;
    var h = (a / hi) & (b / hi);
    var l = (a & low) & (b & low);
    return h*hi + l;
  },

  or: function(a,b){
    var hi = 0x80000000;
    var low = 0x7fffffff;
    var h = (a / hi) | (b / hi);
    var l = (a & low) | (b & low);
    return h*hi + l;
  },

  xor: function(a,b){
    var hi = 0x80000000;
    var low = 0x7fffffff;
    var h = (a / hi) ^ (b / hi);
    var l = (a & low) ^ (b & low);
    return h*hi + l;
  },

  shr: function(a,b){
    if (a<0) a += rtl.hiInt;
    if (a<0x80000000) return a >> b;
    if (b<=0) return a;
    if (b>54) return 0;
    return Math.floor(a / Math.pow(2,b));
  },

  shl: function(a,b){
    if (a<0) a += rtl.hiInt;
    if (b<=0) return a;
    if (b>54) return 0;
    var r = a * Math.pow(2,b);
    if (r <= rtl.hiInt) return r;
    return r % rtl.hiInt;
  },

  initRTTI: function(){
    if (rtl.debug_rtti) rtl.debug('initRTTI');

    // base types
    rtl.tTypeInfo = { name: "tTypeInfo", kind: 0, $module: null, attr: null };
    function newBaseTI(name,kind,ancestor){
      if (!ancestor) ancestor = rtl.tTypeInfo;
      if (rtl.debug_rtti) rtl.debug('initRTTI.newBaseTI "'+name+'" '+kind+' ("'+ancestor.name+'")');
      var t = Object.create(ancestor);
      t.name = name;
      t.kind = kind;
      rtl[name] = t;
      return t;
    };
    function newBaseInt(name,minvalue,maxvalue,ordtype){
      var t = newBaseTI(name,1 /* tkInteger */,rtl.tTypeInfoInteger);
      t.minvalue = minvalue;
      t.maxvalue = maxvalue;
      t.ordtype = ordtype;
      return t;
    };
    newBaseTI("tTypeInfoInteger",1 /* tkInteger */);
    newBaseInt("shortint",-0x80,0x7f,0);
    newBaseInt("byte",0,0xff,1);
    newBaseInt("smallint",-0x8000,0x7fff,2);
    newBaseInt("word",0,0xffff,3);
    newBaseInt("longint",-0x80000000,0x7fffffff,4);
    newBaseInt("longword",0,0xffffffff,5);
    newBaseInt("nativeint",-0x10000000000000,0xfffffffffffff,6);
    newBaseInt("nativeuint",0,0xfffffffffffff,7);
    newBaseInt("char",0,65535,3 /* word */).kind=2 /* tkChar */;
    newBaseTI("string",3 /* tkString */);
    newBaseTI("tTypeInfoEnum",4 /* tkEnumeration */,rtl.tTypeInfoInteger);
    newBaseTI("tTypeInfoSet",5 /* tkSet */);
    newBaseTI("double",6 /* tkDouble */);
    newBaseTI("boolean",7 /* tkBool */);
    newBaseTI("tTypeInfoProcVar",8 /* tkProcVar */);
    newBaseTI("tTypeInfoMethodVar",9 /* tkMethod */,rtl.tTypeInfoProcVar);
    newBaseTI("tTypeInfoArray",10 /* tkArray */);
    newBaseTI("tTypeInfoDynArray",11 /* tkDynArray */);
    newBaseTI("tTypeInfoPointer",15 /* tkPointer */);
    var t = newBaseTI("pointer",15 /* tkPointer */,rtl.tTypeInfoPointer);
    t.reftype = null;
    newBaseTI("jsvalue",16 /* tkJSValue */);
    newBaseTI("tTypeInfoRefToProcVar",17 /* tkRefToProcVar */,rtl.tTypeInfoProcVar);

    // member kinds
    rtl.tTypeMember = { attr: null };
    function newMember(name,kind){
      var m = Object.create(rtl.tTypeMember);
      m.name = name;
      m.kind = kind;
      rtl[name] = m;
    };
    newMember("tTypeMemberField",1); // tmkField
    newMember("tTypeMemberMethod",2); // tmkMethod
    newMember("tTypeMemberProperty",3); // tmkProperty

    // base object for storing members: a simple object
    rtl.tTypeMembers = {};

    // tTypeInfoStruct - base object for tTypeInfoClass, tTypeInfoRecord, tTypeInfoInterface
    var tis = newBaseTI("tTypeInfoStruct",0);
    tis.$addMember = function(name,ancestor,vis,options){
      if (rtl.debug_rtti){
        if (!rtl.hasString(name) || (name.charAt()==='$')) throw 'invalid member "'+name+'", this="'+this.name+'"';
        if (!rtl.is(ancestor,rtl.tTypeMember)) throw 'invalid ancestor "'+ancestor+':'+ancestor.name+'", "'+this.name+'.'+name+'"';
        if ((options!=undefined) && (typeof(options)!='object')) throw 'invalid options "'+options+'", "'+this.name+'.'+name+'"';
      };
      var t = Object.create(ancestor);
      t.name = name;
      this.members[name] = t;
      this.names.push(name);
      t.visibility = vis;
      if (rtl.isObject(options)){
        for (var key in options) if (options.hasOwnProperty(key)) t[key] = options[key];
      };
      return t;
    };
    tis.addField = function(name,type,vis,options){
      var t = this.$addMember(name,rtl.tTypeMemberField,vis?vis:2,options);
      if (rtl.debug_rtti){
        if (!rtl.is(type,rtl.tTypeInfo)) throw 'invalid type "'+type+'", "'+this.name+'.'+name+'"';
      };
      t.typeinfo = type;
      this.fields.push(name);
      return t;
    };
    tis.addFields = function(){
      var i=0;
      while(i<arguments.length){
        var name = arguments[i++];
        var type = arguments[i++];
        if ((i<arguments.length) && (typeof(arguments[i])==='object')){
          this.addField(name,type,arguments[i++]);
        } else {
          this.addField(name,type);
        };
      };
    };
    tis.addMethod = function(name,methodkind,params,vis,result,flags,options){
      // optional: vis, result, flags, options
      var t = this.$addMember(name,rtl.tTypeMemberMethod,vis?vis:2,options);
      t.methodkind = methodkind;
      t.procsig = rtl.newTIProcSig(params,result,flags);
      this.methods.push(name);
      return t;
    };
    tis.addProperty = function(name,flags,result,getter,setter,vis,options){
      var t = this.$addMember(name,rtl.tTypeMemberProperty,vis?vis:4,options);
      t.flags = flags;
      t.typeinfo = result;
      t.getter = getter;
      t.setter = setter;
      // Note: in options: params, stored, defaultvalue
      t.params = rtl.isArray(t.params) ? rtl.newTIParams(t.params) : null;
      this.properties.push(name);
      if (!rtl.isString(t.stored)) t.stored = "";
      return t;
    };
    tis.getField = function(index){
      return this.members[this.fields[index]];
    };
    tis.getMethod = function(index){
      return this.members[this.methods[index]];
    };
    tis.getProperty = function(index){
      return this.members[this.properties[index]];
    };

    newBaseTI("tTypeInfoRecord",12 /* tkRecord */,rtl.tTypeInfoStruct);
    newBaseTI("tTypeInfoClass",13 /* tkClass */,rtl.tTypeInfoStruct);
    newBaseTI("tTypeInfoClassRef",14 /* tkClassRef */);
    newBaseTI("tTypeInfoInterface",18 /* tkInterface */,rtl.tTypeInfoStruct);
    newBaseTI("tTypeInfoHelper",19 /* tkHelper */,rtl.tTypeInfoStruct);
    newBaseTI("tTypeInfoExtClass",20 /* tkExtClass */,rtl.tTypeInfoClass);
  },

  tSectionRTTI: {
    $module: null,
    $inherited: function(name,ancestor,o){
      if (rtl.debug_rtti){
        rtl.debug('tSectionRTTI.newTI "'+(this.$module?this.$module.$name:"(no module)")
          +'"."'+name+'" ('+ancestor.name+') '+(o?'init':'forward'));
      };
      var t = this[name];
      if (t){
        if (!t.$forward) {
          return t;
        }
        if (!ancestor.isPrototypeOf(t)) throw 'typeinfo ancestor mismatch "'+name+'" ancestor="'+ancestor.name+'" t.name="'+t.name+'"';
      } else {
        t = Object.create(ancestor);
        t.name = name;
        t.$module = this.$module;
        this[name] = t;
      }
      if (o){
        delete t.$forward;
        for (var key in o) if (o.hasOwnProperty(key)) t[key]=o[key];
      } else {
        t.$forward = true;
      }
      return t;
    },
    $Scope: function(name,ancestor,o){
      var t=this.$inherited(name,ancestor,o);
      if (!t.members) {
        t.members = {};
      }
      if (!t.names) {
        t.names = [];
      }
      if (!t.fields) {
        t.fields = [];
      }  
      if (!t.methods) {
        t.methods = [];
      }  
      if (!t.properties) {
        t.properties = [];
      }  
      return t;
    },
    $TI: function(name,kind,o){ var t=this.$inherited(name,rtl.tTypeInfo,o); t.kind = kind; return t; },
    $Int: function(name,o){ return this.$inherited(name,rtl.tTypeInfoInteger,o); },
    $Enum: function(name,o){ return this.$inherited(name,rtl.tTypeInfoEnum,o); },
    $Set: function(name,o){ return this.$inherited(name,rtl.tTypeInfoSet,o); },
    $StaticArray: function(name,o){ return this.$inherited(name,rtl.tTypeInfoArray,o); },
    $DynArray: function(name,o){ return this.$inherited(name,rtl.tTypeInfoDynArray,o); },
    $ProcVar: function(name,o){ return this.$inherited(name,rtl.tTypeInfoProcVar,o); },
    $RefToProcVar: function(name,o){ return this.$inherited(name,rtl.tTypeInfoRefToProcVar,o); },
    $MethodVar: function(name,o){ return this.$inherited(name,rtl.tTypeInfoMethodVar,o); },
    $Record: function(name,o,typ){ if(typ) o.$record = typ; return this.$Scope(name,rtl.tTypeInfoRecord,o); },
    $Class: function(name,o){ return this.$Scope(name,rtl.tTypeInfoClass,o); },
    $ClassRef: function(name,o){ return this.$inherited(name,rtl.tTypeInfoClassRef,o); },
    $Pointer: function(name,o){ return this.$inherited(name,rtl.tTypeInfoPointer,o); },
    $Interface: function(name,o){ return this.$Scope(name,rtl.tTypeInfoInterface,o); },
    $Helper: function(name,o){ return this.$Scope(name,rtl.tTypeInfoHelper,o); },
    $ExtClass: function(name,o){ return this.$Scope(name,rtl.tTypeInfoExtClass,o); }
  },

  newTIParam: function(param){
    // param is an array, 0=name, 1=type, 2=optional flags
    var t = {
      name: param[0],
      typeinfo: param[1],
      flags: (rtl.isNumber(param[2]) ? param[2] : 0)
    };
    return t;
  },

  newTIParams: function(list){
    // list: optional array of [paramname,typeinfo,optional flags]
    var params = [];
    if (rtl.isArray(list)){
      for (var i=0; i<list.length; i++) params.push(rtl.newTIParam(list[i]));
    };
    return params;
  },

  newTIProcSig: function(params,result,flags){
    var s = {
      params: rtl.newTIParams(params),
      resulttype: result?result:null,
      flags: flags?flags:0
    };
    return s;
  },

  addResource: function(aRes){
    rtl.$res[aRes.name]=aRes;
  },

  getResource: function(aName){
    var res = rtl.$res[aName];
    if (res !== undefined) {
      return res;
    } else {
      return null;
    }
  },

  getResourceList: function(){
    return Object.keys(rtl.$res);
  }
}

rtl.module("System",[],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.LineEnding = "\n";
  this.sLineBreak = this.LineEnding;
  this.PathDelim = "/";
  this.$rtti.$Set("AllowDirectorySeparators$a",{comptype: rtl.char});
  this.AllowDirectorySeparators = rtl.createSet(47,92);
  this.$rtti.$Set("AllowDriveSeparators$a",{comptype: rtl.char});
  this.AllowDriveSeparators = rtl.createSet(58);
  this.ExtensionSeparator = ".";
  this.MaxSmallint = 32767;
  this.MinSmallint = -32768;
  this.MaxShortInt = 127;
  this.MinShortInt = -128;
  this.MaxByte = 0xFF;
  this.MaxWord = 0xFFFF;
  this.MaxLongint = 0x7fffffff;
  this.MaxCardinal = 0xffffffff;
  this.Maxint = 2147483647;
  this.IsMultiThread = false;
  this.$rtti.$inherited("Real",rtl.double,{});
  this.$rtti.$inherited("Extended",rtl.double,{});
  this.$rtti.$inherited("TDateTime",rtl.double,{});
  this.$rtti.$inherited("TTime",this.$rtti["TDateTime"],{});
  this.$rtti.$inherited("TDate",this.$rtti["TDateTime"],{});
  this.$rtti.$inherited("UInt64",rtl.nativeuint,{});
  this.$rtti.$inherited("QWord",rtl.nativeuint,{});
  this.$rtti.$inherited("Comp",rtl.nativeint,{});
  this.$rtti.$inherited("WideString",rtl.string,{});
  this.TTextLineBreakStyle = {"0": "tlbsLF", tlbsLF: 0, "1": "tlbsCRLF", tlbsCRLF: 1, "2": "tlbsCR", tlbsCR: 2};
  this.$rtti.$Enum("TTextLineBreakStyle",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTextLineBreakStyle});
  this.TCompareOption = {"0": "coIgnoreCase", coIgnoreCase: 0, "1": "coDigitAsNumbers", coDigitAsNumbers: 1};
  this.$rtti.$Enum("TCompareOption",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TCompareOption});
  this.$rtti.$Set("TCompareOptions",{comptype: this.$rtti["TCompareOption"]});
  rtl.recNewT(this,"TGuid",function () {
    this.D1 = 0;
    this.D2 = 0;
    this.D3 = 0;
    this.$new = function () {
      var r = Object.create(this);
      r.D4 = rtl.arraySetLength(null,0,8);
      return r;
    };
    this.$eq = function (b) {
      return (this.D1 === b.D1) && (this.D2 === b.D2) && (this.D3 === b.D3) && rtl.arrayEq(this.D4,b.D4);
    };
    this.$assign = function (s) {
      this.D1 = s.D1;
      this.D2 = s.D2;
      this.D3 = s.D3;
      this.D4 = s.D4.slice(0);
      return this;
    };
    var $r = $mod.$rtti.$Record("TGuid",{},this);
    $r.addField("D1",rtl.longword);
    $r.addField("D2",rtl.word);
    $r.addField("D3",rtl.word);
    $mod.$rtti.$StaticArray("TGuid.D4$a",{dims: [8], eltype: rtl.byte});
    $r.addField("D4",$mod.$rtti["TGuid.D4$a"]);
  });
  this.$rtti.$inherited("TGUIDString",rtl.string,{});
  this.$rtti.$Pointer("PMethod",{reftype: this.$rtti["TMethod"]});
  rtl.recNewT(this,"TMethod",function () {
    this.Code = null;
    this.Data = null;
    this.$eq = function (b) {
      return (this.Code === b.Code) && (this.Data === b.Data);
    };
    this.$assign = function (s) {
      this.Code = s.Code;
      this.Data = s.Data;
      return this;
    };
    var $r = $mod.$rtti.$Record("TMethod",{},this);
    $r.addField("Code",rtl.pointer);
    $r.addField("Data",rtl.pointer);
  });
  this.$rtti.$Class("TObject");
  this.$rtti.$ClassRef("TClass",{instancetype: this.$rtti["TObject"]});
  rtl.createClass(this,"TObject",null,function () {
    this.$init = function () {
    };
    this.$final = function () {
    };
    this.Create = function () {
      return this;
    };
    this.Destroy = function () {
    };
    this.Free = function () {
      this.$destroy("Destroy");
    };
    this.ClassType = function () {
      return this;
    };
    this.ClassNameIs = function (Name) {
      var Result = false;
      Result = $impl.SameText(Name,this.$classname);
      return Result;
    };
    this.InheritsFrom = function (aClass) {
      return (aClass!=null) && ((this==aClass) || aClass.isPrototypeOf(this));
    };
    this.MethodName = function (aCode) {
      var Result = "";
      Result = "";
      if (aCode === null) return Result;
      if (typeof(aCode)!=='function') return "";
      var i = 0;
      var TI = this.$rtti;
      if (rtl.isObject(aCode.scope)){
        // callback
        if (typeof aCode.fn === "string") return aCode.fn;
        aCode = aCode.fn;
      }
      // Not a callback, check rtti
      while ((Result === "") && (TI != null)) {
        i = 0;
        while ((Result === "") && (i < TI.methods.length)) {
          if (this[TI.getMethod(i).name] === aCode)
            Result=TI.getMethod(i).name;
          i += 1;
        };
        if (Result === "") TI = TI.ancestor;
      };
      // return Result;
      return Result;
    };
    this.MethodAddress = function (aName) {
      var Result = null;
      Result = null;
      if (aName === "") return Result;
      var i = 0;
        var TI = this.$rtti;
        var N = "";
        var MN = "";
        N = aName.toLowerCase();
        while ((MN === "") && (TI != null)) {
          i = 0;
          while ((MN === "") && (i < TI.methods.length)) {
            if (TI.getMethod(i).name.toLowerCase() === N) MN = TI.getMethod(i).name;
            i += 1;
          };
          if (MN === "") TI = TI.ancestor;
        };
        if (MN !== "") Result = this[MN];
      //  return Result;
      return Result;
    };
    this.FieldAddress = function (aName) {
      var Result = null;
      Result = null;
      if (aName === "") return Result;
      var aClass = this.$class;
      var ClassTI = null;
      var myName = aName.toLowerCase();
      var MemberTI = null;
      while (aClass !== null) {
        ClassTI = aClass.$rtti;
        for (var i = 0, $end2 = ClassTI.fields.length - 1; i <= $end2; i++) {
          MemberTI = ClassTI.getField(i);
          if (MemberTI.name.toLowerCase() === myName) {
             return MemberTI;
          };
        };
        aClass = aClass.$ancestor ? aClass.$ancestor : null;
      };
      return Result;
    };
    this.ClassInfo = function () {
      var Result = null;
      Result = this.$rtti;
      return Result;
    };
    this.QualifiedClassName = function () {
      var Result = "";
      Result = this.$module.$name + "." + this.$classname;
      return Result;
    };
    this.AfterConstruction = function () {
    };
    this.BeforeDestruction = function () {
    };
    this.Dispatch = function (aMessage) {
      var aClass = null;
      var Id = undefined;
      if (!rtl.isObject(aMessage)) return;
      Id = aMessage["Msg"];
      if (!rtl.isNumber(Id)) return;
      aClass = this.$class.ClassType();
      while (aClass !== null) {
        var Handlers = aClass.$msgint;
        if (rtl.isObject(Handlers) && Handlers.hasOwnProperty(Id)){
          this[Handlers[Id]](aMessage);
          return;
        };
        aClass = aClass.$ancestor;
      };
      this.DefaultHandler(aMessage);
    };
    this.DispatchStr = function (aMessage) {
      var aClass = null;
      var Id = undefined;
      if (!rtl.isObject(aMessage)) return;
      Id = aMessage["MsgStr"];
      if (!rtl.isString(Id)) return;
      aClass = this.$class.ClassType();
      while (aClass !== null) {
        var Handlers = aClass.$msgstr;
        if (rtl.isObject(Handlers) && Handlers.hasOwnProperty(Id)){
          this[Handlers[Id]](aMessage);
          return;
        };
        aClass = aClass.$ancestor;
      };
      this.DefaultHandlerStr(aMessage);
    };
    this.DefaultHandler = function (aMessage) {
      if (aMessage) ;
    };
    this.DefaultHandlerStr = function (aMessage) {
      if (aMessage) ;
    };
    this.GetInterface = function (iid, obj) {
      var Result = false;
      var i = iid.$intf;
      if (i){
        // iid is the private TGuid of an interface
        i = rtl.getIntfG(this,i.$guid,2);
        if (i){
          obj.set(i);
          return true;
        }
      };
      Result = this.GetInterfaceByStr(rtl.guidrToStr(iid),obj);
      return Result;
    };
    this.GetInterface$1 = function (iidstr, obj) {
      var Result = false;
      Result = this.GetInterfaceByStr(iidstr,obj);
      return Result;
    };
    this.GetInterfaceByStr = function (iidstr, obj) {
      var Result = false;
      Result = false;
      if (!$mod.IObjectInstance["$str"]) $mod.IObjectInstance["$str"] = rtl.guidrToStr($mod.IObjectInstance);
      if (iidstr == $mod.IObjectInstance["$str"]) {
        obj.set(this);
        return true;
      };
      var i = rtl.getIntfG(this,iidstr,2);
      obj.set(i);
      Result=(i!==null);
      return Result;
    };
    this.GetInterfaceWeak = function (iid, obj) {
      var Result = false;
      Result = this.GetInterface(iid,obj);
      if (Result){
        var o = obj.get();
        if (o.$kind==='com'){
          o._Release();
        }
      };
      return Result;
    };
    this.Equals = function (Obj) {
      var Result = false;
      Result = Obj === this;
      return Result;
    };
    this.ToString = function () {
      var Result = "";
      Result = this.$classname;
      return Result;
    };
  });
  rtl.createClass(this,"TCustomAttribute",this.TObject,function () {
  });
  this.$rtti.$DynArray("TCustomAttributeArray",{eltype: this.$rtti["TCustomAttribute"]});
  this.$rtti.$ClassRef("TCustomAttributeClass",{instancetype: this.$rtti["TCustomAttribute"]});
  this.S_OK = 0;
  this.S_FALSE = 1;
  this.E_NOINTERFACE = -2147467262;
  this.E_UNEXPECTED = -2147418113;
  this.E_NOTIMPL = -2147467263;
  rtl.createInterface(this,"IUnknown","{00000000-0000-0000-C000-000000000046}",["QueryInterface","_AddRef","_Release"],null,function () {
    this.$kind = "com";
    var $r = this.$rtti;
    $r.addMethod("QueryInterface",1,[["iid",$mod.$rtti["TGuid"],2],["obj",null,4]],2,rtl.longint);
    $r.addMethod("_AddRef",1,[],2,rtl.longint);
    $r.addMethod("_Release",1,[],2,rtl.longint);
  });
  rtl.createInterface(this,"IInvokable","{88387EF6-BCEE-3E17-9E85-5D491ED4FC10}",[],this.IUnknown,function () {
  });
  rtl.createInterface(this,"IEnumerator","{ECEC7568-4E50-30C9-A2F0-439342DE2ADB}",["GetCurrent","MoveNext","Reset"],this.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("GetCurrent",1,[],2,$mod.$rtti["TObject"]);
    $r.addMethod("MoveNext",1,[],2,rtl.boolean);
    $r.addMethod("Reset",0,[]);
    $r.addProperty("Current",1,$mod.$rtti["TObject"],"GetCurrent","",2);
  });
  rtl.createInterface(this,"IEnumerable","{9791C368-4E51-3424-A3CE-D4911D54F385}",["GetEnumerator"],this.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("GetEnumerator",1,[],2,$mod.$rtti["IEnumerator"]);
  });
  rtl.createClass(this,"TInterfacedObject",this.TObject,function () {
    this.$init = function () {
      $mod.TObject.$init.call(this);
      this.fRefCount = 0;
    };
    this.QueryInterface = function (iid, obj) {
      var Result = 0;
      if (this.GetInterface(iid,obj)) {
        Result = 0}
       else Result = -2147467262;
      return Result;
    };
    this._AddRef = function () {
      var Result = 0;
      this.fRefCount += 1;
      Result = this.fRefCount;
      return Result;
    };
    this._Release = function () {
      var Result = 0;
      this.fRefCount -= 1;
      Result = this.fRefCount;
      if (this.fRefCount === 0) this.$destroy("Destroy");
      return Result;
    };
    this.BeforeDestruction = function () {
      if (this.fRefCount !== 0) rtl.raiseE('EHeapMemoryError');
    };
    rtl.addIntf(this,$mod.IUnknown);
  });
  this.$rtti.$ClassRef("TInterfacedClass",{instancetype: this.$rtti["TInterfacedObject"]});
  rtl.createClass(this,"TAggregatedObject",this.TObject,function () {
    this.$init = function () {
      $mod.TObject.$init.call(this);
      this.fController = null;
    };
    this.GetController = function () {
      var Result = null;
      var $ok = false;
      try {
        Result = rtl.setIntfL(Result,this.fController);
        $ok = true;
      } finally {
        if (!$ok) rtl._Release(Result);
      };
      return Result;
    };
    this.QueryInterface = function (iid, obj) {
      var Result = 0;
      Result = this.fController.QueryInterface(iid,obj);
      return Result;
    };
    this._AddRef = function () {
      var Result = 0;
      Result = this.fController._AddRef();
      return Result;
    };
    this._Release = function () {
      var Result = 0;
      Result = this.fController._Release();
      return Result;
    };
    this.Create$1 = function (aController) {
      $mod.TObject.Create.call(this);
      this.fController = aController;
      return this;
    };
  });
  rtl.createClass(this,"TContainedObject",this.TAggregatedObject,function () {
    this.QueryInterface = function (iid, obj) {
      var Result = 0;
      if (this.GetInterface(iid,obj)) {
        Result = 0}
       else Result = -2147467262;
      return Result;
    };
    rtl.addIntf(this,$mod.IUnknown);
  });
  this.IObjectInstance = this.TGuid.$clone({D1: 0xD91C9AF4, D2: 0x3C93, D3: 0x420F, D4: [0xA3,0x03,0xBF,0x5B,0xA8,0x2B,0xFD,0x23]});
  this.TTypeKind = {"0": "tkUnknown", tkUnknown: 0, "1": "tkInteger", tkInteger: 1, "2": "tkChar", tkChar: 2, "3": "tkString", tkString: 3, "4": "tkEnumeration", tkEnumeration: 4, "5": "tkSet", tkSet: 5, "6": "tkDouble", tkDouble: 6, "7": "tkBool", tkBool: 7, "8": "tkProcVar", tkProcVar: 8, "9": "tkMethod", tkMethod: 9, "10": "tkArray", tkArray: 10, "11": "tkDynArray", tkDynArray: 11, "12": "tkRecord", tkRecord: 12, "13": "tkClass", tkClass: 13, "14": "tkClassRef", tkClassRef: 14, "15": "tkPointer", tkPointer: 15, "16": "tkJSValue", tkJSValue: 16, "17": "tkRefToProcVar", tkRefToProcVar: 17, "18": "tkInterface", tkInterface: 18, "19": "tkHelper", tkHelper: 19, "20": "tkExtClass", tkExtClass: 20};
  this.$rtti.$Enum("TTypeKind",{minvalue: 0, maxvalue: 20, ordtype: 1, enumtype: this.TTypeKind});
  this.$rtti.$Set("TTypeKinds",{comptype: this.$rtti["TTypeKind"]});
  this.tkFloat = this.TTypeKind.tkDouble;
  this.tkProcedure = this.TTypeKind.tkProcVar;
  this.tkAny = rtl.createSet(null,this.TTypeKind.tkUnknown,this.TTypeKind.tkExtClass);
  this.tkMethods = rtl.createSet(this.TTypeKind.tkMethod);
  this.tkProperties = rtl.diffSet(rtl.diffSet(this.tkAny,this.tkMethods),rtl.createSet(this.TTypeKind.tkUnknown));
  this.vtInteger = 0;
  this.vtBoolean = 1;
  this.vtExtended = 3;
  this.vtPointer = 5;
  this.vtObject = 7;
  this.vtClass = 8;
  this.vtWideChar = 9;
  this.vtCurrency = 12;
  this.vtInterface = 14;
  this.vtUnicodeString = 18;
  this.vtNativeInt = 19;
  this.vtJSValue = 20;
  this.$rtti.$Pointer("PVarRec",{reftype: this.$rtti["TVarRec"]});
  rtl.recNewT(this,"TVarRec",function () {
    this.VType = 0;
    this.VJSValue = undefined;
    this.$eq = function (b) {
      return (this.VType === b.VType) && (this.VJSValue === b.VJSValue) && (this.VJSValue === b.VJSValue) && (this.VJSValue === b.VJSValue) && (this.VJSValue === b.VJSValue) && (this.VJSValue === b.VJSValue) && (this.VJSValue === b.VJSValue) && (this.VJSValue === b.VJSValue) && (this.VJSValue === b.VJSValue) && (this.VJSValue === b.VJSValue) && (this.VJSValue === b.VJSValue) && (this.VJSValue === b.VJSValue) && (this.VJSValue === b.VJSValue);
    };
    this.$assign = function (s) {
      this.VType = s.VType;
      this.VJSValue = s.VJSValue;
      this.VJSValue = s.VJSValue;
      this.VJSValue = s.VJSValue;
      this.VJSValue = s.VJSValue;
      this.VJSValue = s.VJSValue;
      this.VJSValue = s.VJSValue;
      this.VJSValue = s.VJSValue;
      this.VJSValue = s.VJSValue;
      this.VJSValue = s.VJSValue;
      this.VJSValue = s.VJSValue;
      this.VJSValue = s.VJSValue;
      this.VJSValue = s.VJSValue;
      return this;
    };
    var $r = $mod.$rtti.$Record("TVarRec",{},this);
    $r.addField("VType",rtl.byte);
    $r.addField("VJSValue",rtl.jsvalue);
    $r.addField("VJSValue",rtl.longint);
    $r.addField("VJSValue",rtl.boolean);
    $r.addField("VJSValue",rtl.double);
    $r.addField("VJSValue",rtl.pointer);
    $r.addField("VJSValue",$mod.$rtti["TObject"]);
    $r.addField("VJSValue",$mod.$rtti["TClass"]);
    $r.addField("VJSValue",rtl.char);
    $r.addField("VJSValue",rtl.nativeint);
    $r.addField("VJSValue",rtl.pointer);
    $r.addField("VJSValue",rtl.string);
    $r.addField("VJSValue",rtl.nativeint);
  });
  this.$rtti.$DynArray("TVarRecArray",{eltype: this.$rtti["TVarRec"]});
  this.VarRecs = function () {
    var Result = [];
    var i = 0;
    var v = null;
    Result = [];
    while (i < arguments.length) {
      v = $mod.TVarRec.$new();
      v.VType = rtl.trunc(arguments[i]);
      i += 1;
      v.VJSValue = arguments[i];
      i += 1;
      Result.push($mod.TVarRec.$clone(v));
    };
    return Result;
  };
  this.IsConsole = false;
  this.FirstDotAtFileNameStartIsExtension = false;
  this.$rtti.$ProcVar("TOnParamCount",{procsig: rtl.newTIProcSig([],rtl.longint)});
  this.$rtti.$ProcVar("TOnParamStr",{procsig: rtl.newTIProcSig([["Index",rtl.longint]],rtl.string)});
  this.OnParamCount = null;
  this.OnParamStr = null;
  this.ParamCount = function () {
    var Result = 0;
    if ($mod.OnParamCount != null) {
      Result = $mod.OnParamCount()}
     else Result = 0;
    return Result;
  };
  this.ParamStr = function (Index) {
    var Result = "";
    if ($mod.OnParamStr != null) {
      Result = $mod.OnParamStr(Index)}
     else if (Index === 0) {
      Result = "js"}
     else Result = "";
    return Result;
  };
  this.Frac = function (A) {
    return A % 1;
  };
  this.Odd = function (A) {
    return A&1 != 0;
  };
  this.Random = function (Range) {
    return Math.floor(Math.random()*Range);
  };
  this.Sqr = function (A) {
    return A*A;
  };
  this.Sqr$1 = function (A) {
    return A*A;
  };
  this.Trunc = function (A) {
    if (!Math.trunc) {
      Math.trunc = function(v) {
        v = +v;
        if (!isFinite(v)) return v;
        return (v - v % 1) || (v < 0 ? -0 : v === 0 ? v : 0);
      };
    }
    $mod.Trunc = Math.trunc;
    return Math.trunc(A);
  };
  this.DefaultTextLineBreakStyle = this.TTextLineBreakStyle.tlbsLF;
  this.Int = function (A) {
    var Result = 0.0;
    Result = $mod.Trunc(A);
    return Result;
  };
  this.Copy = function (S, Index, Size) {
    if (Index<1) Index = 1;
    return (Size>0) ? S.substring(Index-1,Index+Size-1) : "";
  };
  this.Copy$1 = function (S, Index) {
    if (Index<1) Index = 1;
    return S.substr(Index-1);
  };
  this.Delete = function (S, Index, Size) {
    var h = "";
    if ((Index < 1) || (Index > S.get().length) || (Size <= 0)) return;
    h = S.get();
    S.set($mod.Copy(h,1,Index - 1) + $mod.Copy$1(h,Index + Size));
  };
  this.Pos = function (Search, InString) {
    return InString.indexOf(Search)+1;
  };
  this.Pos$1 = function (Search, InString, StartAt) {
    return InString.indexOf(Search,StartAt-1)+1;
  };
  this.Insert = function (Insertion, Target, Index) {
    var t = "";
    if (Insertion === "") return;
    t = Target.get();
    if (Index < 1) {
      Target.set(Insertion + t)}
     else if (Index > t.length) {
      Target.set(t + Insertion)}
     else Target.set($mod.Copy(t,1,Index - 1) + Insertion + $mod.Copy(t,Index,t.length));
  };
  this.upcase = function (c) {
    return c.toUpperCase();
  };
  this.binstr = function (val, cnt) {
    var Result = "";
    var i = 0;
    Result = rtl.strSetLength(Result,cnt);
    for (var $l = cnt; $l >= 1; $l--) {
      i = $l;
      Result = rtl.setCharAt(Result,i - 1,String.fromCharCode(48 + (val & 1)));
      val = Math.floor(val / 2);
    };
    return Result;
  };
  this.val = function (S, NI, Code) {
    NI.set($impl.valint(S,-9007199254740991,9007199254740991,Code));
  };
  this.val$1 = function (S, NI, Code) {
    var x = 0.0;
    if (S === "") {
      Code.set(1);
      return;
    };
    x = Number(S);
    if (isNaN(x) || (x !== $mod.Int(x)) || (x < 0)) {
      Code.set(1)}
     else {
      Code.set(0);
      NI.set($mod.Trunc(x));
    };
  };
  this.val$2 = function (S, SI, Code) {
    SI.set($impl.valint(S,-128,127,Code));
  };
  this.val$3 = function (S, B, Code) {
    B.set($impl.valint(S,0,255,Code));
  };
  this.val$4 = function (S, SI, Code) {
    SI.set($impl.valint(S,-32768,32767,Code));
  };
  this.val$5 = function (S, W, Code) {
    W.set($impl.valint(S,0,65535,Code));
  };
  this.val$6 = function (S, I, Code) {
    I.set($impl.valint(S,-2147483648,2147483647,Code));
  };
  this.val$7 = function (S, C, Code) {
    C.set($impl.valint(S,0,4294967295,Code));
  };
  this.val$8 = function (S, d, Code) {
    var x = 0.0;
    if (S === "") {
      Code.set(1);
      return;
    };
    x = Number(S);
    if (isNaN(x)) {
      Code.set(1)}
     else {
      Code.set(0);
      d.set(x);
    };
  };
  this.val$9 = function (S, b, Code) {
    if ($impl.SameText(S,"true")) {
      Code.set(0);
      b.set(true);
    } else if ($impl.SameText(S,"false")) {
      Code.set(0);
      b.set(false);
    } else Code.set(1);
  };
  this.StringOfChar = function (c, l) {
    var Result = "";
    var i = 0;
    if ((l>0) && c.repeat) return c.repeat(l);
    Result = "";
    for (var $l = 1, $end = l; $l <= $end; $l++) {
      i = $l;
      Result = Result + c;
    };
    return Result;
  };
  this.Write = function () {
    var i = 0;
    for (var $l = 0, $end = arguments.length - 1; $l <= $end; $l++) {
      i = $l;
      if ($impl.WriteCallBack != null) {
        $impl.WriteCallBack(arguments[i],false)}
       else $impl.WriteBuf = $impl.WriteBuf + ("" + arguments[i]);
    };
  };
  this.Writeln = function () {
    var i = 0;
    var l = 0;
    var s = "";
    l = arguments.length - 1;
    if ($impl.WriteCallBack != null) {
      for (var $l = 0, $end = l; $l <= $end; $l++) {
        i = $l;
        $impl.WriteCallBack(arguments[i],i === l);
      };
    } else {
      s = $impl.WriteBuf;
      for (var $l1 = 0, $end1 = l; $l1 <= $end1; $l1++) {
        i = $l1;
        s = s + ("" + arguments[i]);
      };
      console.log(s);
      $impl.WriteBuf = "";
    };
  };
  this.$rtti.$ProcVar("TConsoleHandler",{procsig: rtl.newTIProcSig([["S",rtl.jsvalue],["NewLine",rtl.boolean]])});
  this.SetWriteCallBack = function (H) {
    var Result = null;
    Result = $impl.WriteCallBack;
    $impl.WriteCallBack = H;
    return Result;
  };
  this.Assigned = function (V) {
    return (V!=undefined) && (V!=null) && (!rtl.isArray(V) || (V.length > 0));
  };
  this.StrictEqual = function (A, B) {
    return A === B;
  };
  this.StrictInequal = function (A, B) {
    return A !== B;
  };
  this.$rtti.$DynArray("TArray<RTTI.TValue>",{});
  this.$rtti.$DynArray("TArray<RTTI.TRttiType>",{});
  this.$rtti.$DynArray("TArray<RTTI.TRttiField>",{});
  this.$rtti.$DynArray("TArray<RTTI.TRttiParameter>",{});
  this.$rtti.$DynArray("TArray<RTTI.TRttiMethod>",{});
  this.$rtti.$DynArray("TArray<RTTI.TRttiProperty>",{});
  this.$rtti.$DynArray("TArray<Classes.TPersistentClass>",{});
  this.$rtti.$DynArray("TArray<Generics.Collections.TPair<Generics.Collections.TDictionary.TKey,Generics.Collections.TDictionary.TValue>>",{});
  this.$rtti.$DynArray("TArray<Generics.Collections.TPair<Generics.Collections.TObjectDictionary.TKey,Generics.Collections.TObjectDictionary.TValue>>",{});
  this.$rtti.$DynArray("TArray<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderColumn>",{});
  this.$rtti.$DynArray("TArray<System.JSValue>",{eltype: rtl.jsvalue});
  this.$rtti.$DynArray("TArray<System.TArray<System.JSValue>>",{eltype: this.$rtti["TArray<System.JSValue>"]});
  this.$rtti.$DynArray("TArray<System.Boolean>",{eltype: rtl.boolean});
  this.$rtti.$DynArray("TArray<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderExpression>",{});
  this.$rtti.$DynArray("TArray<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroup>",{});
  this.$rtti.$DynArray("TArray<Generics.Collections.TPair<System.Longint,Generics.Collections.TPair<System.Double,System.Double>>>",{});
  this.$rtti.$DynArray("TArray<Generics.Collections.TPair<System.Double,System.Double>>",{});
  this.$rtti.$DynArray("TArray<System.Longint>",{eltype: rtl.longint});
  this.$rtti.$DynArray("TArray<System.String>",{eltype: rtl.string});
  this.$rtti.$DynArray("TArray<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroupOperator>",{});
  this.$rtti.$DynArray("TArray<XData.Model.Types.TXDataPrimitiveType>",{});
  this.$rtti.$DynArray("TArray<Generics.Collections.TPair<System.String,System.TObject>>",{});
  this.$rtti.$DynArray("TArray<System.TObject>",{eltype: this.$rtti["TObject"]});
  this.$rtti.$DynArray("TArray<Generics.Collections.TPair<System.Longint,System.TObject>>",{});
  this.$rtti.$DynArray("TArray<Generics.Collections.TPair<System.Longint,System.Longint>>",{});
  this.$rtti.$DynArray("TArray<Generics.Collections.TPair<System.Longint,System.Boolean>>",{});
  this.$rtti.$DynArray("TArray<Generics.Collections.TPair<System.Longint,System.Double>>",{});
  this.$rtti.$DynArray("TArray<System.Double>",{eltype: rtl.double});
  this.$rtti.$DynArray("TArray<WEBLib.TMSFNCPersistence.TTMSFNCObjectReference>",{});
  this.$rtti.$DynArray("TArray<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>",{});
  this.$rtti.$DynArray("TArray<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassItem>",{});
  this.$rtti.$DynArray("TArray<Generics.Collections.TPair<System.String,WEBLib.DesignIntf.TIconData>>",{});
  this.$rtti.$DynArray("TArray<WEBLib.DesignIntf.TIconData>",{});
  this.$rtti.$DynArray("TArray<WEBLib.TMSFNCFilterDialog.TTMSFNCFilterDialogDrawItem>",{});
  this.$rtti.$DynArray("TArray<Generics.Collections.TPair<System.Longint,WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellItem>>",{});
  this.$rtti.$DynArray("TArray<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellItem>",{});
  this.$rtti.$DynArray("TArray<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellControlCache>",{});
  this.$rtti.$DynArray("TArray<Generics.Collections.TPair<System.Longint,WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridRowItem>>",{});
  this.$rtti.$DynArray("TArray<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridRowItem>",{});
  this.$rtti.$DynArray("TArray<Generics.Collections.TPair<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataGroup>>",{});
  this.$rtti.$DynArray("TArray<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataGroup>",{});
  this.$rtti.$DynArray("TArray<Generics.Collections.TPair<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>>",{});
  this.$rtti.$DynArray("TArray<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>",{});
  this.$rtti.$DynArray("TArray<Generics.Collections.TPair<System.Longint,Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>>>",{});
  this.$rtti.$DynArray("TArray<Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>>",{});
  this.$rtti.$DynArray("TArray<Generics.Collections.TPair<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>>",{});
  this.$rtti.$DynArray("TArray<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>",{});
  this.$rtti.$DynArray("TArray<Generics.Collections.TPair<System.Longint,Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>>>",{});
  this.$rtti.$DynArray("TArray<Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>>",{});
  this.$rtti.$DynArray("TArray<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataSortCellInfo>",{});
  this.$rtti.$DynArray("TArray<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataGroupInfo>",{});
  this.$rtti.$DynArray("TArray<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridSortDirection>",{});
  this.$rtti.$DynArray("TArray<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>",{});
  this.$rtti.$DynArray("TArray<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataTempData>",{});
  this.$rtti.$DynArray("TArray<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataAutoFillLaneModel>",{});
  this.$rtti.$DynArray("TArray<Generics.Collections.TPair<System.String,System.TArray<System.String>>>",{});
  this.$rtti.$DynArray("TArray<System.TArray<System.String>>",{eltype: this.$rtti["TArray<System.String>"]});
  this.$rtti.$DynArray("TArray<Generics.Collections.TPair<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataCustomListIndexEntry>>",{});
  this.$rtti.$DynArray("TArray<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataCustomListIndexEntry>",{});
  this.$rtti.$DynArray("TArray<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCell>",{});
  this.$rtti.$DynArray("TArray<Generics.Collections.TPair<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord,System.Boolean>>",{});
  this.$rtti.$DynArray("TArray<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord>",{});
  this.$rtti.$DynArray("TArray<WEBLib.TMSFNCDataGridRenderer.TTMSFNCDataGridCellControlWrapperListItem>",{});
  this.$rtti.$DynArray("TArray<WEBLib.TMSFNCDataGrid.TTMSFNCDataGridHeaderGroup>",{});
  this.$rtti.$DynArray("TArray<WEBLib.TMSFNCTypes.TRectF>",{});
  this.$rtti.$DynArray("TArray<Generics.Collections.TPair<System.Longint,Generics.Collections.TObjectList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>>>",{});
  this.$rtti.$DynArray("TArray<Generics.Collections.TObjectList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>>",{});
  this.$rtti.$DynArray("TArray<Generics.Collections.TPair<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord,System.Longint>>",{});
  this.$rtti.$DynArray("TArray<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataSortInfo>",{});
  this.$rtti.$DynArray("TArray<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataSortOptions>",{});
  $mod.$implcode = function () {
    $mod.$rtti.$ExtClass("TJSObj",{jsclass: "Object"});
    $mod.$rtti.$ExtClass("TJSArray",{jsclass: "Array"});
    $mod.$rtti.$ExtClass("TJSArguments",{jsclass: "arguments"});
    $impl.SameText = function (s1, s2) {
      return s1.toLowerCase() == s2.toLowerCase();
    };
    $impl.WriteBuf = "";
    $impl.WriteCallBack = null;
    $impl.valint = function (S, MinVal, MaxVal, Code) {
      var Result = 0;
      var x = 0.0;
      if (S === "") {
        Code.set(1);
        return Result;
      };
      x = Number(S);
      if (isNaN(x)) {
        var $tmp = $mod.Copy(S,1,1);
        if ($tmp === "$") {
          x = Number("0x" + $mod.Copy$1(S,2))}
         else if ($tmp === "&") {
          x = Number("0o" + $mod.Copy$1(S,2))}
         else if ($tmp === "%") {
          x = Number("0b" + $mod.Copy$1(S,2))}
         else {
          Code.set(1);
          return Result;
        };
      };
      if (isNaN(x) || (x !== $mod.Int(x))) {
        Code.set(1)}
       else if ((x < MinVal) || (x > MaxVal)) {
        Code.set(2)}
       else {
        Result = $mod.Trunc(x);
        Code.set(0);
      };
      return Result;
    };
  };
  $mod.$init = function () {
    rtl.exitcode = 0;
  };
},[]);
rtl.module("RTLConsts",["System"],function () {
  "use strict";
  var $mod = this;
  $mod.$resourcestrings = {SArgumentMissing: {org: 'Missing argument in format "%s"'}, SInvalidFormat: {org: 'Invalid format specifier : "%s"'}, SInvalidArgIndex: {org: 'Invalid argument index in format: "%s"'}, SListCapacityError: {org: "List capacity (%s) exceeded."}, SListCountError: {org: "List count (%s) out of bounds."}, SMapKeyError: {org: "Key not found : %s"}, SListIndexError: {org: "List index (%s) out of bounds"}, SSortedListError: {org: "Operation not allowed on sorted list"}, SDuplicateString: {org: "String list does not allow duplicates"}, SDuplicateItem: {org: "ThreadList does not allow duplicates"}, SErrFindNeedsSortedList: {org: "Cannot use find on unsorted list"}, SInvalidName: {org: 'Invalid component name: "%s"'}, SInvalidBoolean: {org: '"%s" is not a valid boolean.'}, SDuplicateName: {org: 'Duplicate component name: "%s"'}, SErrInvalidDate: {org: 'Invalid date: "%s"'}, SErrInvalidTimeFormat: {org: 'Invalid time format: "%s"'}, SInvalidDateFormat: {org: 'Invalid date format: "%s"'}, SCantReadPropertyS: {org: 'Cannot read property "%s"'}, SCantWritePropertyS: {org: 'Cannot write property "%s"'}, SErrPropertyNotFound: {org: 'Unknown property: "%s"'}, SIndexedPropertyNeedsParams: {org: 'Indexed property "%s" needs parameters'}, SErrInvalidTypecast: {org: "Invalid class typecast"}, SErrInvalidInteger: {org: 'Invalid integer value: "%s"'}, SErrInvalidFloat: {org: 'Invalid floating-point value: "%s"'}, SInvalidDateTime: {org: "Invalid date-time value: %s"}, SInvalidCurrency: {org: "Invalid currency value: %s"}, SErrInvalidDayOfWeek: {org: "%d is not a valid day of the week"}, SErrInvalidTimeStamp: {org: 'Invalid date/timestamp : "%s"'}, SErrInvalidDateWeek: {org: "%d %d %d is not a valid dateweek"}, SErrInvalidDayOfYear: {org: "Year %d does not have a day number %d"}, SErrInvalidDateMonthWeek: {org: "Year %d, month %d, Week %d and day %d is not a valid date."}, SErrInvalidDayOfWeekInMonth: {org: "Year %d Month %d NDow %d DOW %d is not a valid date"}, SInvalidJulianDate: {org: "%f Julian cannot be represented as a DateTime"}, SErrInvalidHourMinuteSecMsec: {org: "%d:%d:%d.%d is not a valid time specification"}, SInvalidGUID: {org: '"%s" is not a valid GUID value'}, SEmptyStreamIllegalReader: {org: "Illegal Nil stream for TReader constructor"}, SInvalidPropertyValue: {org: "Invalid value for property"}, SInvalidImage: {org: "Invalid stream format"}, SUnknownProperty: {org: 'Unknown property: "%s"'}, SUnknownPropertyType: {org: "Unknown property type %s"}, SAncestorNotFound: {org: 'Ancestor class for "%s" not found.'}, SUnsupportedPropertyVariantType: {org: "Unsupported property variant type %d"}, SPropertyException: {org: "Error reading %s%s%s: %s"}, SInvalidPropertyPath: {org: "Invalid property path"}, SReadOnlyProperty: {org: "Property is read-only"}, SClassNotFound: {org: 'Class "%s" not found'}, SEmptyStreamIllegalWriter: {org: "Illegal Nil stream for TWriter constructor"}, SErrInvalidPropertyType: {org: "Invalid property type from streamed property: %d"}, SParserExpected: {org: "Wrong token type: %s expected"}, SParserInvalidFloat: {org: "Invalid floating point number: %s"}, SParserInvalidInteger: {org: "Invalid integer number: %s"}, SParserUnterminatedString: {org: "Unterminated string"}, SParserWrongTokenType: {org: "Wrong token type: %s expected but %s found"}, SParserWrongTokenSymbol: {org: "Wrong token symbol: %s expected but %s found"}, SParserLocInfo: {org: " (at %d,%d, stream offset %.8x)"}, SParserUnterminatedBinValue: {org: "Unterminated byte value"}, SParserInvalidProperty: {org: "Invalid property"}, SRangeError: {org: "Range error"}, SParamIsNegative: {org: 'Parameter "%s" cannot be negative.'}, SErrNoStreaming: {org: 'Failed to initialize component class "%s": No streaming method available.'}, SResNotFound: {org: "Resource %s not found"}, SErrResourceStreamNoWrite: {org: "Cannot write to resource stream"}, SErrResourceNotBase64: {org: "Resource %s is not base64 encoded"}, SErrUnknownResourceEncoding: {org: 'Unknown encoding for resource: "%s"'}};
});
rtl.module("Types",["System"],function () {
  "use strict";
  var $mod = this;
  this.TDirection = {"0": "FromBeginning", FromBeginning: 0, "1": "FromEnd", FromEnd: 1};
  this.$rtti.$Enum("TDirection",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TDirection});
  this.$rtti.$DynArray("TBooleanDynArray",{eltype: rtl.boolean});
  this.$rtti.$DynArray("TWordDynArray",{eltype: rtl.word});
  this.$rtti.$DynArray("TIntegerDynArray",{eltype: rtl.longint});
  this.$rtti.$DynArray("TNativeIntDynArray",{eltype: rtl.nativeint});
  this.$rtti.$DynArray("TStringDynArray",{eltype: rtl.string});
  this.$rtti.$DynArray("TDoubleDynArray",{eltype: rtl.double});
  this.$rtti.$DynArray("TJSValueDynArray",{eltype: rtl.jsvalue});
  this.$rtti.$DynArray("TObjectDynArray",{eltype: pas.System.$rtti["TObject"]});
  this.$rtti.$DynArray("TByteDynArray",{eltype: rtl.byte});
  this.TDuplicates = {"0": "dupIgnore", dupIgnore: 0, "1": "dupAccept", dupAccept: 1, "2": "dupError", dupError: 2};
  this.$rtti.$Enum("TDuplicates",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TDuplicates});
  this.$rtti.$RefToProcVar("TProc",{procsig: rtl.newTIProcSig([])});
  this.$rtti.$RefToProcVar("TProcString",{procsig: rtl.newTIProcSig([["aString",rtl.string,2]])});
  this.$rtti.$MethodVar("TListCallback",{procsig: rtl.newTIProcSig([["data",rtl.jsvalue],["arg",rtl.jsvalue]]), methodkind: 0});
  this.$rtti.$ProcVar("TListStaticCallback",{procsig: rtl.newTIProcSig([["data",rtl.jsvalue],["arg",rtl.jsvalue]])});
  rtl.recNewT(this,"TSize",function () {
    this.cx = 0;
    this.cy = 0;
    this.$eq = function (b) {
      return (this.cx === b.cx) && (this.cy === b.cy);
    };
    this.$assign = function (s) {
      this.cx = s.cx;
      this.cy = s.cy;
      return this;
    };
    var $r = $mod.$rtti.$Record("TSize",{},this);
    $r.addField("cx",rtl.longint);
    $r.addField("cy",rtl.longint);
  });
  rtl.recNewT(this,"TPoint",function () {
    this.x = 0;
    this.y = 0;
    this.$eq = function (b) {
      return (this.x === b.x) && (this.y === b.y);
    };
    this.$assign = function (s) {
      this.x = s.x;
      this.y = s.y;
      return this;
    };
    var $r = $mod.$rtti.$Record("TPoint",{},this);
    $r.addField("x",rtl.longint);
    $r.addField("y",rtl.longint);
  });
  rtl.recNewT(this,"TRect",function () {
    this.Left = 0;
    this.Top = 0;
    this.Right = 0;
    this.Bottom = 0;
    this.$eq = function (b) {
      return (this.Left === b.Left) && (this.Top === b.Top) && (this.Right === b.Right) && (this.Bottom === b.Bottom);
    };
    this.$assign = function (s) {
      this.Left = s.Left;
      this.Top = s.Top;
      this.Right = s.Right;
      this.Bottom = s.Bottom;
      return this;
    };
    var $r = $mod.$rtti.$Record("TRect",{},this);
    $r.addField("Left",rtl.longint);
    $r.addField("Top",rtl.longint);
    $r.addField("Right",rtl.longint);
    $r.addField("Bottom",rtl.longint);
  });
  rtl.createHelper(this,"TRectHelper",null,function () {
    this.Width = function () {
      var Result = 0;
      Result = this.Right - this.Left;
      return Result;
    };
    this.Height = function () {
      var Result = 0;
      Result = this.Bottom - this.Top;
      return Result;
    };
  });
  this.EqualRect = function (r1, r2) {
    var Result = false;
    Result = (r1.Left === r2.Left) && (r1.Right === r2.Right) && (r1.Top === r2.Top) && (r1.Bottom === r2.Bottom);
    return Result;
  };
  this.Rect = function (Left, Top, Right, Bottom) {
    var Result = $mod.TRect.$new();
    Result.Left = Left;
    Result.Top = Top;
    Result.Right = Right;
    Result.Bottom = Bottom;
    return Result;
  };
  this.Bounds = function (ALeft, ATop, AWidth, AHeight) {
    var Result = $mod.TRect.$new();
    Result.Left = ALeft;
    Result.Top = ATop;
    Result.Right = ALeft + AWidth;
    Result.Bottom = ATop + AHeight;
    return Result;
  };
  this.Point = function (x, y) {
    var Result = $mod.TPoint.$new();
    Result.x = x;
    Result.y = y;
    return Result;
  };
  this.PtInRect = function (aRect, p) {
    var Result = false;
    Result = (p.y >= aRect.Top) && (p.y < aRect.Bottom) && (p.x >= aRect.Left) && (p.x < aRect.Right);
    return Result;
  };
  this.IntersectRect = function (aRect, R1, R2) {
    var Result = false;
    var lRect = $mod.TRect.$new();
    lRect.$assign(R1);
    if (R2.Left > R1.Left) lRect.Left = R2.Left;
    if (R2.Top > R1.Top) lRect.Top = R2.Top;
    if (R2.Right < R1.Right) lRect.Right = R2.Right;
    if (R2.Bottom < R1.Bottom) lRect.Bottom = R2.Bottom;
    if ($mod.IsRectEmpty(lRect)) {
      aRect.$assign($mod.Rect(0,0,0,0));
      Result = false;
    } else {
      Result = true;
      aRect.$assign(lRect);
    };
    return Result;
  };
  this.UnionRect = function (aRect, R1, R2) {
    var Result = false;
    var lRect = $mod.TRect.$new();
    lRect.$assign(R1);
    if (R2.Left < R1.Left) lRect.Left = R2.Left;
    if (R2.Top < R1.Top) lRect.Top = R2.Top;
    if (R2.Right > R1.Right) lRect.Right = R2.Right;
    if (R2.Bottom > R1.Bottom) lRect.Bottom = R2.Bottom;
    if ($mod.IsRectEmpty(lRect)) {
      aRect.$assign($mod.Rect(0,0,0,0));
      Result = false;
    } else {
      aRect.$assign(lRect);
      Result = true;
    };
    return Result;
  };
  this.IsRectEmpty = function (aRect) {
    var Result = false;
    Result = (aRect.Right <= aRect.Left) || (aRect.Bottom <= aRect.Top);
    return Result;
  };
  this.OffsetRect = function (aRect, DX, DY) {
    var Result = false;
    aRect.Left += DX;
    aRect.Top += DY;
    aRect.Right += DX;
    aRect.Bottom += DY;
    Result = true;
    return Result;
  };
  this.CenterPoint = function (aRect) {
    var Result = $mod.TPoint.$new();
    function Avg(a, b) {
      var Result = 0;
      if (a < b) {
        Result = a + ((b - a) >>> 1)}
       else Result = b + ((a - b) >>> 1);
      return Result;
    };
    Result.x = Avg(aRect.Left,aRect.Right);
    Result.y = Avg(aRect.Top,aRect.Bottom);
    return Result;
  };
  this.InflateRect = function (aRect, dx, dy) {
    var Result = false;
    aRect.Left -= dx;
    aRect.Top -= dy;
    aRect.Right += dx;
    aRect.Bottom += dy;
    Result = true;
    return Result;
  };
  this.Size = function (AWidth, AHeight) {
    var Result = $mod.TSize.$new();
    Result.cx = AWidth;
    Result.cy = AHeight;
    return Result;
  };
  this.Size$1 = function (aRect) {
    var Result = $mod.TSize.$new();
    Result.cx = aRect.Right - aRect.Left;
    Result.cy = aRect.Bottom - aRect.Top;
    return Result;
  };
});
rtl.module("JS",["System","Types"],function () {
  "use strict";
  var $mod = this;
  rtl.createClass(this,"AsyncAttribute",pas.System.TCustomAttribute,function () {
  });
  rtl.createClass(this,"ExternalJSAttribute",pas.System.TCustomAttribute,function () {
    this.$init = function () {
      pas.System.TCustomAttribute.$init.call(this);
      this.FName = "";
    };
    this.Create$1 = function (AName) {
      pas.System.TObject.Create.call(this);
      this.FName = AName;
      return this;
    };
  });
  rtl.createClass(this,"EJS",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FMessage = "";
    };
    this.Create$1 = function (Msg) {
      this.FMessage = Msg;
      return this;
    };
  });
  this.$rtti.$ExtClass("TJSObject",{jsclass: "Object"});
  this.$rtti.$DynArray("TJSObjectDynArray",{eltype: this.$rtti["TJSObject"]});
  this.$rtti.$DynArray("TJSObjectDynArrayArray",{eltype: this.$rtti["TJSObjectDynArray"]});
  this.$rtti.$DynArray("TJSStringDynArray",{eltype: rtl.string});
  this.$rtti.$ExtClass("TJSIteratorValue",{jsclass: "IteratorValue"});
  this.$rtti.$ExtClass("TJSIterator",{jsclass: "Iterator"});
  this.$rtti.$ExtClass("TJSSet");
  this.$rtti.$RefToProcVar("TJSSetEventProc",{procsig: rtl.newTIProcSig([["value",rtl.jsvalue],["key",rtl.nativeint],["set_",this.$rtti["TJSSet"]]])});
  this.$rtti.$RefToProcVar("TJSSetProcCallBack",{procsig: rtl.newTIProcSig([["value",rtl.jsvalue],["key",rtl.jsvalue]])});
  this.$rtti.$ExtClass("TJSSet",{jsclass: "Set"});
  this.$rtti.$RefToProcVar("TJSMapFunctionCallBack",{procsig: rtl.newTIProcSig([["arg",rtl.jsvalue]],rtl.jsvalue)});
  this.$rtti.$RefToProcVar("TJSMapProcCallBack",{procsig: rtl.newTIProcSig([["value",rtl.jsvalue],["key",rtl.jsvalue]])});
  this.$rtti.$ExtClass("TJSMap",{jsclass: "Map"});
  this.$rtti.$ExtClass("TJSFunction",{ancestor: this.$rtti["TJSObject"], jsclass: "Function"});
  this.$rtti.$ExtClass("TJSDate",{ancestor: this.$rtti["TJSFunction"], jsclass: "Date"});
  rtl.recNewT(this,"TLocaleCompareOptions",function () {
    this.$eq = function (b) {
      return (this.localeMatcher === b.localeMatcher) && (this.usage === b.usage) && (this.sensitivity === b.sensitivity) && (this.ignorePunctuation === b.ignorePunctuation) && (this.numeric === b.numeric) && (this.caseFirst === b.caseFirst);
    };
    this.$assign = function (s) {
      this.localeMatcher = s.localeMatcher;
      this.usage = s.usage;
      this.sensitivity = s.sensitivity;
      this.ignorePunctuation = s.ignorePunctuation;
      this.numeric = s.numeric;
      this.caseFirst = s.caseFirst;
      return this;
    };
    var $r = $mod.$rtti.$Record("TLocaleCompareOptions",{},this);
    $r.addField("localeMatcher",rtl.string);
    $r.addField("usage",rtl.string);
    $r.addField("sensitivity",rtl.string);
    $r.addField("ignorePunctuation",rtl.boolean);
    $r.addField("numeric",rtl.boolean);
    $r.addField("caseFirst",rtl.string);
  });
  this.$rtti.$ExtClass("TJSRegexp",{jsclass: "RegExp"});
  this.$rtti.$RefToProcVar("TReplaceCallBack",{procsig: rtl.newTIProcSig([["match",rtl.string,2]],rtl.string,2)});
  this.$rtti.$RefToProcVar("TReplaceCallBack0",{procsig: rtl.newTIProcSig([["match",rtl.string,2],["offset",rtl.longint],["AString",rtl.string]],rtl.string)});
  this.$rtti.$RefToProcVar("TReplaceCallBack1",{procsig: rtl.newTIProcSig([["match",rtl.string,2],["p1",rtl.string,2],["offset",rtl.longint],["AString",rtl.string]],rtl.string)});
  this.$rtti.$RefToProcVar("TReplaceCallBack2",{procsig: rtl.newTIProcSig([["match",rtl.string,2],["p1",rtl.string,2],["p2",rtl.string,2],["offset",rtl.longint],["AString",rtl.string]],rtl.string)});
  this.$rtti.$ExtClass("TJSString",{jsclass: "String"});
  this.$rtti.$ExtClass("TJSArray");
  this.$rtti.$RefToProcVar("TJSArrayEventProc",{procsig: rtl.newTIProcSig([["element",rtl.jsvalue],["index",rtl.nativeint],["anArray",this.$rtti["TJSArray"]]])});
  this.$rtti.$RefToProcVar("TJSArrayEvent",{procsig: rtl.newTIProcSig([["element",rtl.jsvalue],["index",rtl.nativeint],["anArray",this.$rtti["TJSArray"]]],rtl.boolean)});
  this.$rtti.$RefToProcVar("TJSArrayMapEvent",{procsig: rtl.newTIProcSig([["element",rtl.jsvalue],["index",rtl.nativeint],["anArray",this.$rtti["TJSArray"]]],rtl.jsvalue)});
  this.$rtti.$RefToProcVar("TJSArrayReduceEvent",{procsig: rtl.newTIProcSig([["accumulator",rtl.jsvalue],["currentValue",rtl.jsvalue],["currentIndex",rtl.nativeint],["anArray",this.$rtti["TJSArray"]]],rtl.jsvalue)});
  this.$rtti.$RefToProcVar("TJSArrayCompareEvent",{procsig: rtl.newTIProcSig([["a",rtl.jsvalue],["b",rtl.jsvalue]],rtl.nativeint)});
  this.$rtti.$ExtClass("TJSArray",{jsclass: "Array"});
  this.$rtti.$ExtClass("TJSArrayBuffer",{ancestor: this.$rtti["TJSObject"], jsclass: "ArrayBuffer"});
  this.$rtti.$ExtClass("TJSBufferSource",{jsclass: "BufferSource"});
  this.$rtti.$ExtClass("TJSTypedArray");
  this.$rtti.$ProcVar("TJSTypedArrayCallBack",{procsig: rtl.newTIProcSig([["element",rtl.jsvalue],["index",rtl.nativeint],["anArray",this.$rtti["TJSTypedArray"]]],rtl.boolean)});
  this.$rtti.$MethodVar("TJSTypedArrayEvent",{procsig: rtl.newTIProcSig([["element",rtl.jsvalue],["index",rtl.nativeint],["anArray",this.$rtti["TJSTypedArray"]]],rtl.boolean), methodkind: 1});
  this.$rtti.$ProcVar("TJSTypedArrayMapCallBack",{procsig: rtl.newTIProcSig([["element",rtl.jsvalue],["index",rtl.nativeint],["anArray",this.$rtti["TJSTypedArray"]]],rtl.jsvalue)});
  this.$rtti.$MethodVar("TJSTypedArrayMapEvent",{procsig: rtl.newTIProcSig([["element",rtl.jsvalue],["index",rtl.nativeint],["anArray",this.$rtti["TJSTypedArray"]]],rtl.jsvalue), methodkind: 1});
  this.$rtti.$ProcVar("TJSTypedArrayReduceCallBack",{procsig: rtl.newTIProcSig([["accumulator",rtl.jsvalue],["currentValue",rtl.jsvalue],["currentIndex",rtl.nativeint],["anArray",this.$rtti["TJSTypedArray"]]],rtl.jsvalue)});
  this.$rtti.$ProcVar("TJSTypedArrayCompareCallBack",{procsig: rtl.newTIProcSig([["a",rtl.jsvalue],["b",rtl.jsvalue]],rtl.nativeint)});
  this.$rtti.$ExtClass("TJSTypedArray",{ancestor: this.$rtti["TJSBufferSource"], jsclass: "TypedArray"});
  this.$rtti.$ExtClass("TJSInt8Array",{ancestor: this.$rtti["TJSTypedArray"], jsclass: "Int8Array"});
  this.$rtti.$ExtClass("TJSUint8Array",{ancestor: this.$rtti["TJSTypedArray"], jsclass: "Uint8Array"});
  this.$rtti.$ExtClass("TJSUint8ClampedArray",{ancestor: this.$rtti["TJSTypedArray"], jsclass: "Uint8ClampedArray"});
  this.$rtti.$ExtClass("TJSInt16Array",{ancestor: this.$rtti["TJSTypedArray"], jsclass: "Int16Array"});
  this.$rtti.$ExtClass("TJSUint16Array",{ancestor: this.$rtti["TJSTypedArray"], jsclass: "Uint16Array"});
  this.$rtti.$ExtClass("TJSInt32Array",{ancestor: this.$rtti["TJSTypedArray"], jsclass: "Int32Array"});
  this.$rtti.$ExtClass("TJSUint32Array",{ancestor: this.$rtti["TJSTypedArray"], jsclass: "Uint32Array"});
  this.$rtti.$ExtClass("TJSFloat32Array",{ancestor: this.$rtti["TJSTypedArray"], jsclass: "Float32Array"});
  this.$rtti.$ExtClass("TJSFloat64Array",{ancestor: this.$rtti["TJSTypedArray"], jsclass: "Float64Array"});
  this.$rtti.$ExtClass("TJSDataView",{ancestor: this.$rtti["TJSBufferSource"], jsclass: "DataView"});
  this.$rtti.$ExtClass("TJSJSON",{ancestor: this.$rtti["TJSObject"], jsclass: "JSON"});
  this.$rtti.$ExtClass("TJSError",{ancestor: this.$rtti["TJSObject"], jsclass: "Error"});
  this.$rtti.$RefToProcVar("TJSPromiseResolver",{procsig: rtl.newTIProcSig([["aValue",rtl.jsvalue]],rtl.jsvalue)});
  this.$rtti.$RefToProcVar("TJSPromiseExecutor",{procsig: rtl.newTIProcSig([["resolve",this.$rtti["TJSPromiseResolver"]],["reject",this.$rtti["TJSPromiseResolver"]]])});
  this.$rtti.$RefToProcVar("TJSPromiseFinallyHandler",{procsig: rtl.newTIProcSig([])});
  this.$rtti.$ExtClass("TJSPromise");
  this.$rtti.$DynArray("TJSPromiseArray",{eltype: this.$rtti["TJSPromise"]});
  this.$rtti.$ExtClass("TJSPromise",{jsclass: "Promise"});
  rtl.createHelper(this,"TJSPromiseHelper",null,function () {
    this.From = function (AValue) {
      var Result = null;
      Result = AValue;
      return Result;
    };
  });
  this.$rtti.$ExtClass("TJSFunctionArguments",{jsclass: "arguments"});
  this.$rtti.$ExtClass("TJSIteratorResult",{ancestor: this.$rtti["TJSObject"], jsclass: "IteratorResult"});
  this.$rtti.$ExtClass("TJSAsyncIterator",{ancestor: this.$rtti["TJSObject"], jsclass: "AsyncIterator"});
  this.$rtti.$ExtClass("TJSSyntaxError",{ancestor: this.$rtti["TJSError"], jsclass: "SyntaxError"});
  this.$rtti.$ExtClass("TJSTextDecoderOptions",{ancestor: this.$rtti["TJSObject"], jsclass: "Object"});
  this.$rtti.$ExtClass("TJSTextDecodeOptions",{ancestor: this.$rtti["TJSObject"], jsclass: "Object"});
  this.$rtti.$ExtClass("TJSTextDecoder",{ancestor: this.$rtti["TJSObject"], jsclass: "TextDecoder"});
  this.$rtti.$ExtClass("TJSTextEncoderEncodeIntoResult",{ancestor: this.$rtti["TJSObject"], jsclass: "Object"});
  this.$rtti.$ExtClass("TJSTextEncoder",{ancestor: this.$rtti["TJSObject"], jsclass: "TextEncoder"});
  this.New = function (aElements) {
    var Result = null;
    var L = 0;
    var I = 0;
    var S = "";
    L = rtl.length(aElements);
    if ((L % 2) === 1) throw $mod.EJS.$create("Create$1",["Number of arguments must be even"]);
    I = 0;
    while (I < L) {
      if (!rtl.isString(aElements[I])) {
        S = String(I);
        throw $mod.EJS.$create("Create$1",["Argument " + S + " must be a string."]);
      };
      I += 2;
    };
    I = 0;
    Result = new Object();
    while (I < L) {
      S = "" + aElements[I];
      Result[S] = aElements[I + 1];
      I += 2;
    };
    return Result;
  };
  this.JSDelete = function (Obj, PropName) {
    return delete Obj[PropName];
  };
  this.hasValue = function (v) {
    if(v){ return true; } else { return false; };
  };
  this.isBoolean = function (v) {
    return typeof(v) == 'boolean';
  };
  this.isDate = function (v) {
    return (v instanceof Date);
  };
  this.isCallback = function (v) {
    return rtl.isObject(v) && rtl.isObject(v.scope) && (rtl.isString(v.fn) || rtl.isFunction(v.fn));
  };
  this.isChar = function (v) {
    return (typeof(v)!="string") && (v.length==1);
  };
  this.isClass = function (v) {
    return (typeof(v)=="object") && (v!=null) && (v.$class == v);
  };
  this.isClassInstance = function (v) {
    return (typeof(v)=="object") && (v!=null) && (v.$class == Object.getPrototypeOf(v));
  };
  this.isInteger = function (v) {
    return Math.floor(v)===v;
  };
  this.isNull = function (v) {
    return v === null;
  };
  this.isRecord = function (v) {
    return (typeof(v)==="object")
    && (typeof(v.$new)==="function")
    && (typeof(v.$clone)==="function")
    && (typeof(v.$eq)==="function")
    && (typeof(v.$assign)==="function");
  };
  this.isUndefined = function (v) {
    return v == undefined;
  };
  this.isDefined = function (v) {
    return !(v == undefined);
  };
  this.isUTF16Char = function (v) {
    if (typeof(v)!="string") return false;
    if ((v.length==0) || (v.length>2)) return false;
    var code = v.charCodeAt(0);
    if (code < 0xD800){
      if (v.length == 1) return true;
    } else if (code <= 0xDBFF){
      if (v.length==2){
        code = v.charCodeAt(1);
        if (code >= 0xDC00 && code <= 0xDFFF) return true;
      };
    };
    return false;
  };
  this.jsInstanceOf = function (aFunction, aFunctionWithPrototype) {
    return aFunction instanceof aFunctionWithPrototype;
  };
  this.toNumber = function (v) {
    return v-0;
  };
  this.toInteger = function (v) {
    var Result = 0;
    if ($mod.isInteger(v)) {
      Result = rtl.trunc(v)}
     else Result = 0;
    return Result;
  };
  this.toObject = function (Value) {
    var Result = null;
    if (rtl.isObject(Value)) {
      Result = Value}
     else Result = null;
    return Result;
  };
  this.toArray = function (Value) {
    var Result = null;
    if (rtl.isArray(Value)) {
      Result = Value}
     else Result = null;
    return Result;
  };
  this.toBoolean = function (Value) {
    var Result = false;
    if ($mod.isBoolean(Value)) {
      Result = !(Value == false)}
     else Result = false;
    return Result;
  };
  this.ToString = function (Value) {
    var Result = "";
    if (rtl.isString(Value)) {
      Result = "" + Value}
     else Result = "";
    return Result;
  };
  this.TJSValueType = {"0": "jvtNull", jvtNull: 0, "1": "jvtBoolean", jvtBoolean: 1, "2": "jvtInteger", jvtInteger: 2, "3": "jvtFloat", jvtFloat: 3, "4": "jvtString", jvtString: 4, "5": "jvtObject", jvtObject: 5, "6": "jvtArray", jvtArray: 6};
  this.$rtti.$Enum("TJSValueType",{minvalue: 0, maxvalue: 6, ordtype: 1, enumtype: this.TJSValueType});
  this.GetValueType = function (JS) {
    var Result = 0;
    var t = "";
    if ($mod.isNull(JS)) {
      Result = $mod.TJSValueType.jvtNull}
     else {
      t = typeof(JS);
      if (t === "string") {
        Result = $mod.TJSValueType.jvtString}
       else if (t === "boolean") {
        Result = $mod.TJSValueType.jvtBoolean}
       else if (t === "object") {
        if (rtl.isArray(JS)) {
          Result = $mod.TJSValueType.jvtArray}
         else Result = $mod.TJSValueType.jvtObject;
      } else if (t === "number") if ($mod.isInteger(JS)) {
        Result = $mod.TJSValueType.jvtInteger}
       else Result = $mod.TJSValueType.jvtFloat;
    };
    return Result;
  };
});
rtl.module("SysUtils",["System","RTLConsts","JS"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.FreeAndNil = function (Obj) {
    var o = null;
    o = Obj.get();
    if (o === null) return;
    Obj.set(null);
    o.$destroy("Destroy");
  };
  this.$rtti.$ProcVar("TProcedure",{procsig: rtl.newTIProcSig([])});
  this.FloatRecDigits = 19;
  this.$rtti.$Set("TSysCharSet",{comptype: rtl.char});
  rtl.recNewT(this,"TFloatRec",function () {
    this.Exponent = 0;
    this.Negative = false;
    this.$new = function () {
      var r = Object.create(this);
      r.Digits = rtl.arraySetLength(null,"\x00",19);
      return r;
    };
    this.$eq = function (b) {
      return (this.Exponent === b.Exponent) && (this.Negative === b.Negative) && rtl.arrayEq(this.Digits,b.Digits);
    };
    this.$assign = function (s) {
      this.Exponent = s.Exponent;
      this.Negative = s.Negative;
      this.Digits = s.Digits.slice(0);
      return this;
    };
    var $r = $mod.$rtti.$Record("TFloatRec",{},this);
    $r.addField("Exponent",rtl.longint);
    $r.addField("Negative",rtl.boolean);
    $mod.$rtti.$StaticArray("TFloatRec.Digits$a",{dims: [19], eltype: rtl.char});
    $r.addField("Digits",$mod.$rtti["TFloatRec.Digits$a"]);
  });
  this.TEndian = {"0": "Little", Little: 0, "1": "Big", Big: 1};
  this.$rtti.$Enum("TEndian",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TEndian});
  this.$rtti.$StaticArray("TByteArray",{dims: [32768], eltype: rtl.byte});
  this.$rtti.$StaticArray("TWordArray",{dims: [16384], eltype: rtl.word});
  this.$rtti.$DynArray("TBytes",{eltype: rtl.byte});
  this.$rtti.$DynArray("TStringArray",{eltype: rtl.string});
  this.$rtti.$StaticArray("TMonthNameArray",{dims: [12], eltype: rtl.string});
  this.$rtti.$StaticArray("TDayTable",{dims: [12], eltype: rtl.word});
  this.$rtti.$StaticArray("TWeekNameArray",{dims: [7], eltype: rtl.string});
  this.$rtti.$StaticArray("TDayNames",{dims: [7], eltype: rtl.string});
  rtl.recNewT(this,"TFormatSettings",function () {
    this.CurrencyDecimals = 0;
    this.CurrencyFormat = 0;
    this.CurrencyString = "";
    this.DateSeparator = "\x00";
    this.DecimalSeparator = "";
    this.LongDateFormat = "";
    this.LongTimeFormat = "";
    this.NegCurrFormat = 0;
    this.ShortDateFormat = "";
    this.ShortTimeFormat = "";
    this.ThousandSeparator = "";
    this.TimeAMString = "";
    this.TimePMString = "";
    this.TimeSeparator = "\x00";
    this.TwoDigitYearCenturyWindow = 0;
    $mod.$rtti.$ProcVar("TFormatSettings.TLocaleInitCallback",{procsig: rtl.newTIProcSig([["aLocale",rtl.string,2],["aInstance",$r]])});
    this.InitLocaleHandler = null;
    this.$new = function () {
      var r = Object.create(this);
      r.DateTimeToStrFormat = rtl.arraySetLength(null,"",2);
      r.LongDayNames = rtl.arraySetLength(null,"",7);
      r.LongMonthNames = rtl.arraySetLength(null,"",12);
      r.ShortDayNames = rtl.arraySetLength(null,"",7);
      r.ShortMonthNames = rtl.arraySetLength(null,"",12);
      return r;
    };
    this.$eq = function (b) {
      return (this.CurrencyDecimals === b.CurrencyDecimals) && (this.CurrencyFormat === b.CurrencyFormat) && (this.CurrencyString === b.CurrencyString) && (this.DateSeparator === b.DateSeparator) && rtl.arrayEq(this.DateTimeToStrFormat,b.DateTimeToStrFormat) && (this.DecimalSeparator === b.DecimalSeparator) && (this.LongDateFormat === b.LongDateFormat) && rtl.arrayEq(this.LongDayNames,b.LongDayNames) && rtl.arrayEq(this.LongMonthNames,b.LongMonthNames) && (this.LongTimeFormat === b.LongTimeFormat) && (this.NegCurrFormat === b.NegCurrFormat) && (this.ShortDateFormat === b.ShortDateFormat) && rtl.arrayEq(this.ShortDayNames,b.ShortDayNames) && rtl.arrayEq(this.ShortMonthNames,b.ShortMonthNames) && (this.ShortTimeFormat === b.ShortTimeFormat) && (this.ThousandSeparator === b.ThousandSeparator) && (this.TimeAMString === b.TimeAMString) && (this.TimePMString === b.TimePMString) && (this.TimeSeparator === b.TimeSeparator) && (this.TwoDigitYearCenturyWindow === b.TwoDigitYearCenturyWindow);
    };
    this.$assign = function (s) {
      this.CurrencyDecimals = s.CurrencyDecimals;
      this.CurrencyFormat = s.CurrencyFormat;
      this.CurrencyString = s.CurrencyString;
      this.DateSeparator = s.DateSeparator;
      this.DateTimeToStrFormat = s.DateTimeToStrFormat.slice(0);
      this.DecimalSeparator = s.DecimalSeparator;
      this.LongDateFormat = s.LongDateFormat;
      this.LongDayNames = s.LongDayNames.slice(0);
      this.LongMonthNames = s.LongMonthNames.slice(0);
      this.LongTimeFormat = s.LongTimeFormat;
      this.NegCurrFormat = s.NegCurrFormat;
      this.ShortDateFormat = s.ShortDateFormat;
      this.ShortDayNames = s.ShortDayNames.slice(0);
      this.ShortMonthNames = s.ShortMonthNames.slice(0);
      this.ShortTimeFormat = s.ShortTimeFormat;
      this.ThousandSeparator = s.ThousandSeparator;
      this.TimeAMString = s.TimeAMString;
      this.TimePMString = s.TimePMString;
      this.TimeSeparator = s.TimeSeparator;
      this.TwoDigitYearCenturyWindow = s.TwoDigitYearCenturyWindow;
      return this;
    };
    this.GetBrowserLocale = function () {
      return navigator.language;
    };
    this.GetJSLocale = function () {
      return Intl.DateTimeFormat().resolvedOptions().locale;
    };
    this.GetLocaleDecimalSeparator = function (ALocale) {
      var lNumber = 1.1;
      lNumber = lNumber.toLocaleString(ALocale).substring(1, 2);
      return lNumber;
    };
    this.GetLocaleLongDayName = function (ADayOfWeek, ALocale) {
      var lBaseDate = new Date(2017, 0, 1); // Sunday
      lBaseDate.setDate(lBaseDate.getDate() + ADayOfWeek - 1);
      return lBaseDate.toLocaleDateString(ALocale, { weekday: 'long' });
    };
    this.GetLocaleLongMonthName = function (AMonth, ALocale) {
      var lBaseDate = new Date(2017, AMonth - 1, 1);
      return lBaseDate.toLocaleDateString(ALocale, { month: 'long' });
    };
    this.GetLocaleLongTimeFormat = function (ALocale) {
      var Result = "";
      Result = "hh:nn:ss";
      if ($mod.UpperCase(ALocale) === "EN-US") Result = "hh:nn:ss AMPM";
      return Result;
    };
    var cDeli = "-";
    var cShortLength = 2;
    this.GetLocaleShortDateFormat = function (ALocale) {
      var Result = "";
      var lIndex = 0;
      var res = "";
      res = $mod.TStringHelper.Empty;
      ALocale = $mod.TStringHelper.ToLower.call({get: function () {
          return ALocale;
        }, set: function (v) {
          ALocale = v;
        }});
      lIndex = $mod.TStringHelper.IndexOf.call({get: function () {
          return ALocale;
        }, set: function (v) {
          ALocale = v;
        }},cDeli);
      if (lIndex >= 0) {
        ALocale = $mod.TStringHelper.Substring$1.call({get: function () {
            return ALocale;
          }, set: function (v) {
            ALocale = v;
          }},0,lIndex) + $mod.TStringHelper.ToUpper.call({a: $mod.TStringHelper.Substring.call({get: function () {
              return ALocale;
            }, set: function (v) {
              ALocale = v;
            }},lIndex), get: function () {
            return this.a;
          }, set: function (v) {
            this.a = v;
          }})}
       else {
        if ($mod.TStringHelper.GetLength.call({get: function () {
            return ALocale;
          }, set: function (v) {
            ALocale = v;
          }}) === 2) ALocale = ALocale + cDeli + $mod.TStringHelper.ToUpper.call({get: function () {
            return ALocale;
          }, set: function (v) {
            ALocale = v;
          }});
      };
      var lFormats = {
        "ar-SA" : "dd/MM/yy",
        "bg-BG" : "dd.M.yyyy",
        "ca-ES" : "dd/MM/yyyy",
        "zh-TW" : "yyyy/M/d",
        "cs-CZ" : "d.M.yyyy",
        "da-DK" : "dd-MM-yyyy",
        "de-DE" : "dd.MM.yyyy",
        "el-GR" : "d/M/yyyy",
        "en-US" : "M/d/yyyy",
        "fi-FI" : "d.M.yyyy",
        "fr-FR" : "dd/MM/yyyy",
        "he-IL" : "dd/MM/yyyy",
        "hu-HU" : "yyyy. MM. dd.",
        "is-IS" : "d.M.yyyy",
        "it-IT" : "dd/MM/yyyy",
        "ja-JP" : "yyyy/MM/dd",
        "ko-KR" : "yyyy-MM-dd",
        "nl-NL" : "d-M-yyyy",
        "nb-NO" : "dd.MM.yyyy",
        "pl-PL" : "yyyy-MM-dd",
        "pt-BR" : "d/M/yyyy",
        "ro-RO" : "dd.MM.yyyy",
        "ru-RU" : "dd.MM.yyyy",
        "hr-HR" : "d.M.yyyy",
        "sk-SK" : "d. M. yyyy",
        "sq-AL" : "yyyy-MM-dd",
        "sv-SE" : "yyyy-MM-dd",
        "th-TH" : "d/M/yyyy",
        "tr-TR" : "dd.MM.yyyy",
        "ur-PK" : "dd/MM/yyyy",
        "id-ID" : "dd/MM/yyyy",
        "uk-UA" : "dd.MM.yyyy",
        "be-BY" : "dd.MM.yyyy",
        "sl-SI" : "d.M.yyyy",
        "et-EE" : "d.MM.yyyy",
        "lv-LV" : "yyyy.MM.dd.",
        "lt-LT" : "yyyy.MM.dd",
        "fa-IR" : "MM/dd/yyyy",
        "vi-VN" : "dd/MM/yyyy",
        "hy-AM" : "dd.MM.yyyy",
        "az-Latn-AZ" : "dd.MM.yyyy",
        "eu-ES" : "yyyy/MM/dd",
        "mk-MK" : "dd.MM.yyyy",
        "af-ZA" : "yyyy/MM/dd",
        "ka-GE" : "dd.MM.yyyy",
        "fo-FO" : "dd-MM-yyyy",
        "hi-IN" : "dd-MM-yyyy",
        "ms-MY" : "dd/MM/yyyy",
        "kk-KZ" : "dd.MM.yyyy",
        "ky-KG" : "dd.MM.yy",
        "sw-KE" : "M/d/yyyy",
        "uz-Latn-UZ" : "dd/MM yyyy",
        "tt-RU" : "dd.MM.yyyy",
        "pa-IN" : "dd-MM-yy",
        "gu-IN" : "dd-MM-yy",
        "ta-IN" : "dd-MM-yyyy",
        "te-IN" : "dd-MM-yy",
        "kn-IN" : "dd-MM-yy",
        "mr-IN" : "dd-MM-yyyy",
        "sa-IN" : "dd-MM-yyyy",
        "mn-MN" : "yy.MM.dd",
        "gl-ES" : "dd/MM/yy",
        "kok-IN" : "dd-MM-yyyy",
        "syr-SY" : "dd/MM/yyyy",
        "dv-MV" : "dd/MM/yy",
        "ar-IQ" : "dd/MM/yyyy",
        "zh-CN" : "yyyy/M/d",
        "de-CH" : "dd.MM.yyyy",
        "en-GB" : "dd/MM/yyyy",
        "es-MX" : "dd/MM/yyyy",
        "fr-BE" : "d/MM/yyyy",
        "it-CH" : "dd.MM.yyyy",
        "nl-BE" : "d/MM/yyyy",
        "nn-NO" : "dd.MM.yyyy",
        "pt-PT" : "dd-MM-yyyy",
        "sr-Latn-CS" : "d.M.yyyy",
        "sv-FI" : "d.M.yyyy",
        "az-Cyrl-AZ" : "dd.MM.yyyy",
        "ms-BN" : "dd/MM/yyyy",
        "uz-Cyrl-UZ" : "dd.MM.yyyy",
        "ar-EG" : "dd/MM/yyyy",
        "zh-HK" : "d/M/yyyy",
        "de-AT" : "dd.MM.yyyy",
        "en-AU" : "d/MM/yyyy",
        "es-ES" : "dd/MM/yyyy",
        "fr-CA" : "yyyy-MM-dd",
        "sr-Cyrl-CS" : "d.M.yyyy",
        "ar-LY" : "dd/MM/yyyy",
        "zh-SG" : "d/M/yyyy",
        "de-LU" : "dd.MM.yyyy",
        "en-CA" : "dd/MM/yyyy",
        "es-GT" : "dd/MM/yyyy",
        "fr-CH" : "dd.MM.yyyy",
        "ar-DZ" : "dd-MM-yyyy",
        "zh-MO" : "d/M/yyyy",
        "de-LI" : "dd.MM.yyyy",
        "en-NZ" : "d/MM/yyyy",
        "es-CR" : "dd/MM/yyyy",
        "fr-LU" : "dd/MM/yyyy",
        "ar-MA" : "dd-MM-yyyy",
        "en-IE" : "dd/MM/yyyy",
        "es-PA" : "MM/dd/yyyy",
        "fr-MC" : "dd/MM/yyyy",
        "ar-TN" : "dd-MM-yyyy",
        "en-ZA" : "yyyy/MM/dd",
        "es-DO" : "dd/MM/yyyy",
        "ar-OM" : "dd/MM/yyyy",
        "en-JM" : "dd/MM/yyyy",
        "es-VE" : "dd/MM/yyyy",
        "ar-YE" : "dd/MM/yyyy",
        "en-029" : "MM/dd/yyyy",
        "es-CO" : "dd/MM/yyyy",
        "ar-SY" : "dd/MM/yyyy",
        "en-BZ" : "dd/MM/yyyy",
        "es-PE" : "dd/MM/yyyy",
        "ar-JO" : "dd/MM/yyyy",
        "en-TT" : "dd/MM/yyyy",
        "es-AR" : "dd/MM/yyyy",
        "ar-LB" : "dd/MM/yyyy",
        "en-ZW" : "M/d/yyyy",
        "es-EC" : "dd/MM/yyyy",
        "ar-KW" : "dd/MM/yyyy",
        "en-PH" : "M/d/yyyy",
        "es-CL" : "dd-MM-yyyy",
        "ar-AE" : "dd/MM/yyyy",
        "es-UY" : "dd/MM/yyyy",
        "ar-BH" : "dd/MM/yyyy",
        "es-PY" : "dd/MM/yyyy",
        "ar-QA" : "dd/MM/yyyy",
        "es-BO" : "dd/MM/yyyy",
        "es-SV" : "dd/MM/yyyy",
        "es-HN" : "dd/MM/yyyy",
        "es-NI" : "dd/MM/yyyy",
        "es-PR" : "dd/MM/yyyy",
        "am-ET" : "d/M/yyyy",
        "tzm-Latn-DZ" : "dd-MM-yyyy",
        "iu-Latn-CA" : "d/MM/yyyy",
        "sma-NO" : "dd.MM.yyyy",
        "mn-Mong-CN" : "yyyy/M/d",
        "gd-GB" : "dd/MM/yyyy",
        "en-MY" : "d/M/yyyy",
        "prs-AF" : "dd/MM/yy",
        "bn-BD" : "dd-MM-yy",
        "wo-SN" : "dd/MM/yyyy",
        "rw-RW" : "M/d/yyyy",
        "qut-GT" : "dd/MM/yyyy",
        "sah-RU" : "MM.dd.yyyy",
        "gsw-FR" : "dd/MM/yyyy",
        "co-FR" : "dd/MM/yyyy",
        "oc-FR" : "dd/MM/yyyy",
        "mi-NZ" : "dd/MM/yyyy",
        "ga-IE" : "dd/MM/yyyy",
        "se-SE" : "yyyy-MM-dd",
        "br-FR" : "dd/MM/yyyy",
        "smn-FI" : "d.M.yyyy",
        "moh-CA" : "M/d/yyyy",
        "arn-CL" : "dd-MM-yyyy",
        "ii-CN" : "yyyy/M/d",
        "dsb-DE" : "d. M. yyyy",
        "ig-NG" : "d/M/yyyy",
        "kl-GL" : "dd-MM-yyyy",
        "lb-LU" : "dd/MM/yyyy",
        "ba-RU" : "dd.MM.yy",
        "nso-ZA" : "yyyy/MM/dd",
        "quz-BO" : "dd/MM/yyyy",
        "yo-NG" : "d/M/yyyy",
        "ha-Latn-NG" : "d/M/yyyy",
        "fil-PH" : "M/d/yyyy",
        "ps-AF" : "dd/MM/yy",
        "fy-NL" : "d-M-yyyy",
        "ne-NP" : "M/d/yyyy",
        "se-NO" : "dd.MM.yyyy",
        "iu-Cans-CA" : "d/M/yyyy",
        "sr-Latn-RS" : "d.M.yyyy",
        "si-LK" : "yyyy-MM-dd",
        "sr-Cyrl-RS" : "d.M.yyyy",
        "lo-LA" : "dd/MM/yyyy",
        "km-KH" : "yyyy-MM-dd",
        "cy-GB" : "dd/MM/yyyy",
        "bo-CN" : "yyyy/M/d",
        "sms-FI" : "d.M.yyyy",
        "as-IN" : "dd-MM-yyyy",
        "ml-IN" : "dd-MM-yy",
        "en-IN" : "dd-MM-yyyy",
        "or-IN" : "dd-MM-yy",
        "bn-IN" : "dd-MM-yy",
        "tk-TM" : "dd.MM.yy",
        "bs-Latn-BA" : "d.M.yyyy",
        "mt-MT" : "dd/MM/yyyy",
        "sr-Cyrl-ME" : "d.M.yyyy",
        "se-FI" : "d.M.yyyy",
        "zu-ZA" : "yyyy/MM/dd",
        "xh-ZA" : "yyyy/MM/dd",
        "tn-ZA" : "yyyy/MM/dd",
        "hsb-DE" : "d. M. yyyy",
        "bs-Cyrl-BA" : "d.M.yyyy",
        "tg-Cyrl-TJ" : "dd.MM.yy",
        "sr-Latn-BA" : "d.M.yyyy",
        "smj-NO" : "dd.MM.yyyy",
        "rm-CH" : "dd/MM/yyyy",
        "smj-SE" : "yyyy-MM-dd",
        "quz-EC" : "dd/MM/yyyy",
        "quz-PE" : "dd/MM/yyyy",
        "hr-BA" : "d.M.yyyy.",
        "sr-Latn-ME" : "d.M.yyyy",
        "sma-SE" : "yyyy-MM-dd",
        "en-SG" : "d/M/yyyy",
        "ug-CN" : "yyyy-M-d",
        "sr-Cyrl-BA" : "d.M.yyyy",
        "es-US" : "M/d/yyyy"};
      res = lFormats[ALocale] || 'dd/MM/yyyy';
      Result = res;
      return Result;
    };
    this.GetLocaleShortDayName = function (ADayOfWeek, ALocale) {
      var lBaseDate = new Date(2017, 0, 1); // Sunday
        lBaseDate.setDate(lBaseDate.getDate() + ADayOfWeek - 1);
      
        var lLoc = "";
        if (ALocale == '')
          lLoc = navigator.language
        else
          lLoc = ALocale;
      
        return lBaseDate.toLocaleDateString(lLoc, { weekday: 'short' });
    };
    this.GetLocaleShortMonthName = function (AMonth, ALocale) {
      var lBaseDate = new Date(2017, AMonth - 1, 1);
      var lLoc = "";
      if (ALocale == '')
        lLoc = navigator.language
      else
        lLoc = ALocale;
      return lBaseDate.toLocaleDateString(lLoc, { month: 'short' });
    };
    this.GetLocaleShortTimeFormat = function (ALocale) {
      var Result = "";
      Result = "hh:nn";
      if ($mod.UpperCase(ALocale) === "EN-US") Result = "h:nn AMPM";
      return Result;
    };
    this.Create = function () {
      var Result = $mod.TFormatSettings.$new();
      Result.$assign($mod.TFormatSettings.Create$1($mod.TFormatSettings.GetJSLocale()));
      return Result;
    };
    var cDateSeps = ["/",".","-"];
    var cTimeSeps = [":",".","-"];
    var cDecSeps = [",","."];
    var cThousandSeps = [".",","];
    this.Create$1 = function (ALocale) {
      var Result = $mod.TFormatSettings.$new();
      var lTimeStr = "";
      var lCount = 0;
      var lLoc = "";
      lLoc = $mod.UpperCase(ALocale);
      if (pas.System.Pos("DE",lLoc) === 1) {
        Result.LongDayNames[0] = "Sonntag";
        Result.LongDayNames[1] = "Montag";
        Result.LongDayNames[2] = "Dienstag";
        Result.LongDayNames[3] = "Mittwoch";
        Result.LongDayNames[4] = "Donnerstag";
        Result.LongDayNames[5] = "Freitag";
        Result.LongDayNames[6] = "Samstag";
        Result.ShortDayNames[0] = "Son";
        Result.ShortDayNames[1] = "Mon";
        Result.ShortDayNames[2] = "Die";
        Result.ShortDayNames[3] = "Mit";
        Result.ShortDayNames[4] = "Don";
        Result.ShortDayNames[5] = "Fre";
        Result.ShortDayNames[6] = "Sam";
        Result.ShortMonthNames[0] = "Jan";
        Result.ShortMonthNames[1] = "Feb";
        Result.ShortMonthNames[2] = "Mär";
        Result.ShortMonthNames[3] = "Apr";
        Result.ShortMonthNames[4] = "Mai";
        Result.ShortMonthNames[5] = "Jun";
        Result.ShortMonthNames[6] = "Jul";
        Result.ShortMonthNames[7] = "Aug";
        Result.ShortMonthNames[8] = "Sep";
        Result.ShortMonthNames[9] = "Okt";
        Result.ShortMonthNames[10] = "Nov";
        Result.ShortMonthNames[11] = "Dez";
        Result.LongMonthNames[0] = "Januar";
        Result.LongMonthNames[1] = "Februar";
        Result.LongMonthNames[2] = "März";
        Result.LongMonthNames[3] = "April";
        Result.LongMonthNames[4] = "Mai";
        Result.LongMonthNames[5] = "Juni";
        Result.LongMonthNames[6] = "Juli";
        Result.LongMonthNames[7] = "August";
        Result.LongMonthNames[8] = "September";
        Result.LongMonthNames[9] = "Oktober";
        Result.LongMonthNames[10] = "November";
        Result.LongMonthNames[11] = "Dezember";
      } else if (pas.System.Pos("FR",$mod.UpperCase(ALocale)) === 1) {
        Result.LongDayNames[0] = "Dimanche";
        Result.LongDayNames[1] = "Lundi";
        Result.LongDayNames[2] = "Mardi";
        Result.LongDayNames[3] = "Mecredi";
        Result.LongDayNames[4] = "Jeudi";
        Result.LongDayNames[5] = "Vendredi";
        Result.LongDayNames[6] = "Samedi";
        Result.ShortDayNames[0] = "Dim";
        Result.ShortDayNames[1] = "Lun";
        Result.ShortDayNames[2] = "Mar";
        Result.ShortDayNames[3] = "Mer";
        Result.ShortDayNames[4] = "Jeu";
        Result.ShortDayNames[5] = "Ven";
        Result.ShortDayNames[6] = "Sam";
        Result.ShortMonthNames[0] = "Jan";
        Result.ShortMonthNames[1] = "Fév";
        Result.ShortMonthNames[2] = "Mar";
        Result.ShortMonthNames[3] = "Avr";
        Result.ShortMonthNames[4] = "Mai";
        Result.ShortMonthNames[5] = "Jun";
        Result.ShortMonthNames[6] = "Jul";
        Result.ShortMonthNames[7] = "Aoû";
        Result.ShortMonthNames[8] = "Sep";
        Result.ShortMonthNames[9] = "Oct";
        Result.ShortMonthNames[10] = "Nov";
        Result.ShortMonthNames[11] = "Déc";
        Result.LongMonthNames[0] = "Janvier";
        Result.LongMonthNames[1] = "Février";
        Result.LongMonthNames[2] = "Mars";
        Result.LongMonthNames[3] = "Avril";
        Result.LongMonthNames[4] = "Mai";
        Result.LongMonthNames[5] = "Juin";
        Result.LongMonthNames[6] = "Juillet";
        Result.LongMonthNames[7] = "Août";
        Result.LongMonthNames[8] = "Septembre";
        Result.LongMonthNames[9] = "Octobre";
        Result.LongMonthNames[10] = "Novembre";
        Result.LongMonthNames[11] = "Décembre";
      } else if (pas.System.Pos("ES",$mod.UpperCase(ALocale)) === 1) {
        Result.LongDayNames[0] = "Domingo";
        Result.LongDayNames[1] = "Lunes";
        Result.LongDayNames[2] = "Martes";
        Result.LongDayNames[3] = "Miércoles";
        Result.LongDayNames[4] = "Jueves";
        Result.LongDayNames[5] = "Viernes";
        Result.LongDayNames[6] = "Sábado";
        Result.ShortDayNames[0] = "Dom";
        Result.ShortDayNames[1] = "Lun";
        Result.ShortDayNames[2] = "Mar";
        Result.ShortDayNames[3] = "Mié";
        Result.ShortDayNames[4] = "Jue";
        Result.ShortDayNames[5] = "Vie";
        Result.ShortDayNames[6] = "Sáb";
        Result.ShortMonthNames[0] = "Ene";
        Result.ShortMonthNames[1] = "Feb";
        Result.ShortMonthNames[2] = "Mar";
        Result.ShortMonthNames[3] = "Abr";
        Result.ShortMonthNames[4] = "May";
        Result.ShortMonthNames[5] = "Jun";
        Result.ShortMonthNames[6] = "Jul";
        Result.ShortMonthNames[7] = "Ago";
        Result.ShortMonthNames[8] = "Sep";
        Result.ShortMonthNames[9] = "Oct";
        Result.ShortMonthNames[10] = "Nov";
        Result.ShortMonthNames[11] = "Dic";
        Result.LongMonthNames[0] = "January";
        Result.LongMonthNames[1] = "Febrero";
        Result.LongMonthNames[2] = "Marzi";
        Result.LongMonthNames[3] = "Abril";
        Result.LongMonthNames[4] = "Mayo";
        Result.LongMonthNames[5] = "Junio";
        Result.LongMonthNames[6] = "Julio";
        Result.LongMonthNames[7] = "Agusto";
        Result.LongMonthNames[8] = "Septiembre";
        Result.LongMonthNames[9] = "Octubre";
        Result.LongMonthNames[10] = "Noviembre";
        Result.LongMonthNames[11] = "Diciembre";
      } else {
        Result.LongDayNames[0] = "Sunday";
        Result.LongDayNames[1] = "Monday";
        Result.LongDayNames[2] = "Tuesday";
        Result.LongDayNames[3] = "Wednesday";
        Result.LongDayNames[4] = "Thursday";
        Result.LongDayNames[5] = "Friday";
        Result.LongDayNames[6] = "Saturday";
        Result.ShortDayNames[0] = "Sun";
        Result.ShortDayNames[1] = "Mon";
        Result.ShortDayNames[2] = "Tue";
        Result.ShortDayNames[3] = "Wed";
        Result.ShortDayNames[4] = "Thu";
        Result.ShortDayNames[5] = "Fri";
        Result.ShortDayNames[6] = "Sat";
        Result.ShortMonthNames[0] = "Jan";
        Result.ShortMonthNames[1] = "Feb";
        Result.ShortMonthNames[2] = "Mar";
        Result.ShortMonthNames[3] = "Apr";
        Result.ShortMonthNames[4] = "May";
        Result.ShortMonthNames[5] = "Jun";
        Result.ShortMonthNames[6] = "Jul";
        Result.ShortMonthNames[7] = "Aug";
        Result.ShortMonthNames[8] = "Sep";
        Result.ShortMonthNames[9] = "Oct";
        Result.ShortMonthNames[10] = "Nov";
        Result.ShortMonthNames[11] = "Dec";
        Result.LongMonthNames[0] = "January";
        Result.LongMonthNames[1] = "February";
        Result.LongMonthNames[2] = "March";
        Result.LongMonthNames[3] = "April";
        Result.LongMonthNames[4] = "May";
        Result.LongMonthNames[5] = "June";
        Result.LongMonthNames[6] = "July";
        Result.LongMonthNames[7] = "August";
        Result.LongMonthNames[8] = "September";
        Result.LongMonthNames[9] = "October";
        Result.LongMonthNames[10] = "November";
        Result.LongMonthNames[11] = "December";
      };
      Result.DateTimeToStrFormat[0] = "c";
      Result.DateTimeToStrFormat[1] = "f";
      Result.DateSeparator = "-";
      Result.TimeSeparator = ":";
      Result.ShortDateFormat = "yyyy-mm-dd";
      Result.LongDateFormat = "ddd, yyyy-mm-dd";
      Result.DecimalSeparator = ".";
      Result.ThousandSeparator = ",";
      Result.TimeAMString = "AM";
      Result.TimePMString = "PM";
      Result.TwoDigitYearCenturyWindow = 50;
      Result.ShortTimeFormat = $mod.TFormatSettings.GetLocaleShortTimeFormat(ALocale);
      Result.LongTimeFormat = $mod.TFormatSettings.GetLocaleLongTimeFormat(ALocale);
      Result.ShortDateFormat = $mod.TFormatSettings.GetLocaleShortDateFormat(ALocale);
      for (var $l = 0, $end = rtl.length(cDateSeps) - 1; $l <= $end; $l++) {
        lCount = $l;
        if ($mod.TStringHelper.IndexOf.call({p: Result, get: function () {
            return this.p.ShortDateFormat;
          }, set: function (v) {
            this.p.ShortDateFormat = v;
          }},cDateSeps[lCount]) >= 0) Result.DateSeparator = cDateSeps[lCount];
      };
      var lEvent = new Date('Jan 1, 1980 06:07:08 GMT+00:00');
      var lLoc1 = "";
      if (ALocale == "")
        lLoc1 = navigator.language;
      else
        lLoc1 = ALocale;
      lTimeStr = lEvent.toLocaleTimeString(lLoc1);
      for (var $l1 = 0, $end1 = rtl.length(cTimeSeps) - 1; $l1 <= $end1; $l1++) {
        lCount = $l1;
        if ($mod.TStringHelper.IndexOf.call({get: function () {
            return lTimeStr;
          }, set: function (v) {
            lTimeStr = v;
          }},cTimeSeps[lCount]) >= 0) Result.TimeSeparator = cTimeSeps[lCount];
      };
      for (lCount = 1; lCount <= 7; lCount++) Result.ShortDayNames[lCount - 1] = $mod.TFormatSettings.GetLocaleShortDayName(lCount,ALocale);
      for (lCount = 1; lCount <= 7; lCount++) Result.LongDayNames[lCount - 1] = $mod.TFormatSettings.GetLocaleLongDayName(lCount,ALocale);
      for (lCount = 1; lCount <= 12; lCount++) Result.ShortMonthNames[lCount - 1] = $mod.TFormatSettings.GetLocaleShortMonthName(lCount,ALocale);
      for (lCount = 1; lCount <= 12; lCount++) Result.LongMonthNames[lCount - 1] = $mod.TFormatSettings.GetLocaleLongMonthName(lCount,ALocale);
      Result.DecimalSeparator = $mod.TFormatSettings.GetLocaleDecimalSeparator(ALocale);
      for (var $l2 = 0, $end2 = rtl.length(cDecSeps) - 1; $l2 <= $end2; $l2++) {
        lCount = $l2;
        if (Result.DecimalSeparator === cDecSeps[lCount]) {
          Result.ThousandSeparator = cThousandSeps[lCount];
          break;
        };
      };
      if ($mod.TFormatSettings.InitLocaleHandler != null) $mod.TFormatSettings.InitLocaleHandler($mod.UpperCase(ALocale),$mod.TFormatSettings.$clone(Result));
      return Result;
    };
    this.Invariant = function () {
      var Result = $mod.TFormatSettings.$new();
      if (!$impl.FInvariantCreated) {
        $impl.FInvariant.$assign($mod.TFormatSettings.Create$1("EN-US"));
        $impl.FInvariant.CurrencyString = "¤";
        $impl.FInvariant.CurrencyFormat = 0;
        $impl.FInvariant.CurrencyDecimals = 2;
        $impl.FInvariant.DateSeparator = "/";
        $impl.FInvariant.TimeSeparator = ":";
        $impl.FInvariant.ShortDateFormat = "MM/dd/yyyy";
        $impl.FInvariant.LongDateFormat = "dddd, dd MMMMM yyyy HH:mm:ss";
        $impl.FInvariant.TimeAMString = "AM";
        $impl.FInvariant.TimePMString = "PM";
        $impl.FInvariant.ShortTimeFormat = "HH:mm";
        $impl.FInvariant.LongTimeFormat = "HH:mm:ss";
        $impl.FInvariant.ShortMonthNames = $impl.DefaultShortMonthNames.slice(0);
        $impl.FInvariant.LongMonthNames = $impl.DefaultLongMonthNames.slice(0);
        $impl.FInvariant.ShortDayNames = $impl.DefaultShortDayNames.slice(0);
        $impl.FInvariant.LongDayNames = $impl.DefaultLongDayNames.slice(0);
        $impl.FInvariant.ThousandSeparator = ",";
        $impl.FInvariant.DecimalSeparator = ".";
        $impl.FInvariant.TwoDigitYearCenturyWindow = 50;
        $impl.FInvariant.NegCurrFormat = 0;
        $impl.FInvariantCreated = true;
      };
      Result.$assign($impl.FInvariant);
      return Result;
    };
    var $r = $mod.$rtti.$Record("TFormatSettings",{},this);
    $r.addField("CurrencyDecimals",rtl.byte);
    $r.addField("CurrencyFormat",rtl.byte);
    $r.addField("CurrencyString",rtl.string);
    $r.addField("DateSeparator",rtl.char);
    $mod.$rtti.$StaticArray("TFormatSettings.DateTimeToStrFormat$a",{dims: [2], eltype: rtl.string});
    $r.addField("DateTimeToStrFormat",$mod.$rtti["TFormatSettings.DateTimeToStrFormat$a"]);
    $r.addField("DecimalSeparator",rtl.string);
    $r.addField("LongDateFormat",rtl.string);
    $r.addField("LongDayNames",$mod.$rtti["TDayNames"]);
    $r.addField("LongMonthNames",$mod.$rtti["TMonthNameArray"]);
    $r.addField("LongTimeFormat",rtl.string);
    $r.addField("NegCurrFormat",rtl.byte);
    $r.addField("ShortDateFormat",rtl.string);
    $r.addField("ShortDayNames",$mod.$rtti["TDayNames"]);
    $r.addField("ShortMonthNames",$mod.$rtti["TMonthNameArray"]);
    $r.addField("ShortTimeFormat",rtl.string);
    $r.addField("ThousandSeparator",rtl.string);
    $r.addField("TimeAMString",rtl.string);
    $r.addField("TimePMString",rtl.string);
    $r.addField("TimeSeparator",rtl.char);
    $r.addField("TwoDigitYearCenturyWindow",rtl.word);
    $r.addField("InitLocaleHandler",$mod.$rtti["TFormatSettings.TLocaleInitCallback"]);
    $r.addMethod("Create",5,[],2,$r,1);
    $r.addMethod("Create$1",5,[["ALocale",rtl.string,2]],2,$r,1);
    $r.addMethod("Invariant",5,[],2,$r,1);
  },true);
  rtl.createClass(this,"Exception",pas.System.TObject,function () {
    this.LogMessageOnCreate = false;
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FMessage = "";
      this.FHelpContext = 0;
      this.FJSError = null;
      this.FStack = undefined;
    };
    this.$final = function () {
      this.FJSError = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function (Msg) {
      this.FMessage = Msg;
      this.FJSError = new Error(Msg);
      this.FStack = this.FJSError.stack;
      this.FHelpContext = 0;
      if (this.LogMessageOnCreate) pas.System.Writeln("Created exception ",this.$classname," with message: ",Msg);
      return this;
    };
    this.CreateFmt = function (Msg, Args) {
      this.Create$1($mod.Format(Msg,Args));
      return this;
    };
    this.CreateHelp = function (Msg, AHelpContext) {
      this.Create$1(Msg);
      this.FHelpContext = AHelpContext;
      return this;
    };
    this.CreateFmtHelp = function (Msg, Args, AHelpContext) {
      this.Create$1($mod.Format(Msg,Args));
      this.FHelpContext = AHelpContext;
      return this;
    };
    this.ToString = function () {
      var Result = "";
      Result = this.$classname + ": " + this.FMessage;
      return Result;
    };
  });
  this.$rtti.$ClassRef("ExceptClass",{instancetype: this.$rtti["Exception"]});
  rtl.createClass(this,"EExternal",this.Exception,function () {
  });
  rtl.createClass(this,"EMathError",this.EExternal,function () {
  });
  rtl.createClass(this,"EInvalidOp",this.EMathError,function () {
  });
  rtl.createClass(this,"EZeroDivide",this.EMathError,function () {
  });
  rtl.createClass(this,"EOverflow",this.EMathError,function () {
  });
  rtl.createClass(this,"EUnderflow",this.EMathError,function () {
  });
  rtl.createClass(this,"EAbort",this.Exception,function () {
  });
  rtl.createClass(this,"EInvalidCast",this.Exception,function () {
  });
  rtl.createClass(this,"EAssertionFailed",this.Exception,function () {
  });
  rtl.createClass(this,"EObjectCheck",this.Exception,function () {
  });
  rtl.createClass(this,"EConvertError",this.Exception,function () {
  });
  rtl.createClass(this,"EFormatError",this.Exception,function () {
  });
  rtl.createClass(this,"EIntError",this.EExternal,function () {
  });
  rtl.createClass(this,"EDivByZero",this.EIntError,function () {
  });
  rtl.createClass(this,"ERangeError",this.EIntError,function () {
  });
  rtl.createClass(this,"EIntOverflow",this.EIntError,function () {
  });
  rtl.createClass(this,"EInOutError",this.Exception,function () {
    this.$init = function () {
      $mod.Exception.$init.call(this);
      this.ErrorCode = 0;
    };
  });
  rtl.createClass(this,"EHeapMemoryError",this.Exception,function () {
  });
  rtl.createClass(this,"EExternalException",this.EExternal,function () {
  });
  rtl.createClass(this,"EInvalidPointer",this.EHeapMemoryError,function () {
  });
  rtl.createClass(this,"EOutOfMemory",this.EHeapMemoryError,function () {
  });
  rtl.createClass(this,"EVariantError",this.Exception,function () {
    this.$init = function () {
      $mod.Exception.$init.call(this);
      this.ErrCode = 0;
    };
    this.CreateCode = function (Code) {
      this.ErrCode = Code;
      return this;
    };
  });
  rtl.createClass(this,"EAccessViolation",this.EExternal,function () {
  });
  rtl.createClass(this,"EBusError",this.EAccessViolation,function () {
  });
  rtl.createClass(this,"EPrivilege",this.EExternal,function () {
  });
  rtl.createClass(this,"EStackOverflow",this.EExternal,function () {
  });
  rtl.createClass(this,"EControlC",this.EExternal,function () {
  });
  rtl.createClass(this,"EAbstractError",this.Exception,function () {
  });
  rtl.createClass(this,"EPropReadOnly",this.Exception,function () {
  });
  rtl.createClass(this,"EPropWriteOnly",this.Exception,function () {
  });
  rtl.createClass(this,"EIntfCastError",this.Exception,function () {
  });
  rtl.createClass(this,"EInvalidContainer",this.Exception,function () {
  });
  rtl.createClass(this,"EInvalidInsert",this.Exception,function () {
  });
  rtl.createClass(this,"EPackageError",this.Exception,function () {
  });
  rtl.createClass(this,"EOSError",this.Exception,function () {
    this.$init = function () {
      $mod.Exception.$init.call(this);
      this.ErrorCode = 0;
    };
  });
  rtl.createClass(this,"ESafecallException",this.Exception,function () {
  });
  rtl.createClass(this,"ENoThreadSupport",this.Exception,function () {
  });
  rtl.createClass(this,"ENoWideStringSupport",this.Exception,function () {
  });
  rtl.createClass(this,"ENotImplemented",this.Exception,function () {
  });
  rtl.createClass(this,"EArgumentException",this.Exception,function () {
  });
  rtl.createClass(this,"EArgumentOutOfRangeException",this.EArgumentException,function () {
  });
  rtl.createClass(this,"EArgumentNilException",this.EArgumentException,function () {
  });
  rtl.createClass(this,"EPathTooLongException",this.Exception,function () {
  });
  rtl.createClass(this,"ENotSupportedException",this.Exception,function () {
  });
  rtl.createClass(this,"EDirectoryNotFoundException",this.Exception,function () {
  });
  rtl.createClass(this,"EFileNotFoundException",this.Exception,function () {
  });
  rtl.createClass(this,"EPathNotFoundException",this.Exception,function () {
  });
  rtl.createClass(this,"ENoConstructException",this.Exception,function () {
  });
  this.EmptyStr = "";
  this.EmptyWideStr = "";
  this.HexDisplayPrefix = "$";
  this.LeadBytes = {};
  this.CharInSet = function (Ch, CSet) {
    var Result = false;
    var I = 0;
    Result = false;
    I = rtl.length(CSet) - 1;
    while (!Result && (I >= 0)) {
      Result = Ch === CSet[I];
      I -= 1;
    };
    return Result;
  };
  this.CharInSet$1 = function (Ch, CSet) {
    var Result = false;
    Result = Ch.charCodeAt() in CSet;
    return Result;
  };
  this.LeftStr = function (S, Count) {
    return (Count>0) ? S.substr(0,Count) : "";
  };
  this.RightStr = function (S, Count) {
    var l = S.length;
    return (Count<1) ? "" : ( Count>=l ? S : S.substr(l-Count));
  };
  this.Trim = function (S) {
    return S.replace(/^[\s\uFEFF\xA0\x00-\x1f]+/,'').replace(/[\s\uFEFF\xA0\x00-\x1f]+$/,'');
  };
  this.TrimLeft = function (S) {
    return S.replace(/^[\s\uFEFF\xA0\x00-\x1f]+/,'');
  };
  this.TrimRight = function (S) {
    return S.replace(/[\s\uFEFF\xA0\x00-\x1f]+$/,'');
  };
  this.UpperCase = function (s) {
    return s.toUpperCase();
  };
  this.LowerCase = function (s) {
    return s.toLowerCase();
  };
  this.CompareStr = function (s1, s2) {
    var l1 = s1.length;
    var l2 = s2.length;
    if (l1<=l2){
      var s = s2.substr(0,l1);
      if (s1<s){ return -1;
      } else if (s1>s){ return 1;
      } else { return l1<l2 ? -1 : 0; };
    } else {
      var s = s1.substr(0,l2);
      if (s<s2){ return -1;
      } else { return 1; };
    };
  };
  this.SameStr = function (s1, s2) {
    return s1 == s2;
  };
  this.CompareText = function (s1, s2) {
    var l1 = s1.toLowerCase();
    var l2 = s2.toLowerCase();
    if (l1>l2){ return 1;
    } else if (l1<l2){ return -1;
    } else { return 0; };
  };
  this.SameText = function (s1, s2) {
    return s1.toLowerCase() == s2.toLowerCase();
  };
  this.AnsiCompareText = function (s1, s2) {
    return s1.localeCompare(s2);
  };
  this.AnsiSameText = function (s1, s2) {
    return s1.toLowerCase() == s2.toLowerCase();
  };
  this.AnsiCompareStr = function (s1, s2) {
    var Result = 0;
    Result = $mod.CompareText(s1,s2);
    return Result;
  };
  this.AppendStr = function (Dest, S) {
    Dest.set(Dest.get() + S);
  };
  this.Format = function (Fmt, Args) {
    var Result = "";
    Result = $mod.Format$1(Fmt,Args,$mod.FormatSettings);
    return Result;
  };
  this.Format$1 = function (Fmt, Args, aSettings) {
    var Result = "";
    var ChPos = 0;
    var OldPos = 0;
    var ArgPos = 0;
    var DoArg = 0;
    var Len = 0;
    var Hs = "";
    var ToAdd = "";
    var Index = 0;
    var Width = 0;
    var Prec = 0;
    var Left = false;
    var Fchar = "\x00";
    var vq = 0;
    function ReadFormat() {
      var Result = "\x00";
      var Value = 0;
      function ReadInteger() {
        var Code = 0;
        var ArgN = 0;
        if (Value !== -1) return;
        OldPos = ChPos;
        while ((ChPos <= Len) && (Fmt.charAt(ChPos - 1) <= "9") && (Fmt.charAt(ChPos - 1) >= "0")) ChPos += 1;
        if (ChPos > Len) $impl.DoFormatError(1,Fmt);
        if (Fmt.charAt(ChPos - 1) === "*") {
          if (Index === 255) {
            ArgN = ArgPos}
           else {
            ArgN = Index;
            Index += 1;
          };
          if ((ChPos > OldPos) || (ArgN > (rtl.length(Args) - 1))) $impl.DoFormatError(1,Fmt);
          ArgPos = ArgN + 1;
          var $tmp = Args[ArgN].VType;
          if ($tmp === 0) {
            Value = Args[ArgN].VJSValue}
           else if ($tmp === 19) {
            Value = Args[ArgN].VJSValue}
           else {
            $impl.DoFormatError(1,Fmt);
          };
          ChPos += 1;
        } else {
          if (OldPos < ChPos) {
            pas.System.val(pas.System.Copy(Fmt,OldPos,ChPos - OldPos),{get: function () {
                return Value;
              }, set: function (v) {
                Value = v;
              }},{get: function () {
                return Code;
              }, set: function (v) {
                Code = v;
              }});
            if (Code > 0) $impl.DoFormatError(1,Fmt);
          } else Value = -1;
        };
      };
      function ReadIndex() {
        if (Fmt.charAt(ChPos - 1) !== ":") {
          ReadInteger()}
         else Value = 0;
        if (Fmt.charAt(ChPos - 1) === ":") {
          if (Value === -1) $impl.DoFormatError(2,Fmt);
          Index = Value;
          Value = -1;
          ChPos += 1;
        };
      };
      function ReadLeft() {
        if (Fmt.charAt(ChPos - 1) === "-") {
          Left = true;
          ChPos += 1;
        } else Left = false;
      };
      function ReadWidth() {
        ReadInteger();
        if (Value !== -1) {
          Width = Value;
          Value = -1;
        };
      };
      function ReadPrec() {
        if (Fmt.charAt(ChPos - 1) === ".") {
          ChPos += 1;
          ReadInteger();
          if (Value === -1) Value = 0;
          Prec = Value;
        };
      };
      Index = 255;
      Width = -1;
      Prec = -1;
      Value = -1;
      ChPos += 1;
      if (Fmt.charAt(ChPos - 1) === "%") {
        Result = "%";
        return Result;
      };
      ReadIndex();
      ReadLeft();
      ReadWidth();
      ReadPrec();
      Result = pas.System.upcase(Fmt.charAt(ChPos - 1));
      return Result;
    };
    function Checkarg(AT, err) {
      var Result = false;
      Result = false;
      if (Index === 255) {
        DoArg = ArgPos}
       else DoArg = Index;
      ArgPos = DoArg + 1;
      if ((DoArg > (rtl.length(Args) - 1)) || (Args[DoArg].VType !== AT)) {
        if (err) $impl.DoFormatError(3,Fmt);
        ArgPos -= 1;
        return Result;
      };
      Result = true;
      return Result;
    };
    Result = "";
    Len = Fmt.length;
    ChPos = 1;
    OldPos = 1;
    ArgPos = 0;
    while (ChPos <= Len) {
      while ((ChPos <= Len) && (Fmt.charAt(ChPos - 1) !== "%")) ChPos += 1;
      if (ChPos > OldPos) Result = Result + pas.System.Copy(Fmt,OldPos,ChPos - OldPos);
      if (ChPos < Len) {
        Fchar = ReadFormat();
        var $tmp = Fchar;
        if ($tmp === "D") {
          if (Checkarg(0,false)) {
            ToAdd = $mod.IntToStr(Args[DoArg].VJSValue)}
           else if (Checkarg(19,true)) ToAdd = $mod.IntToStr(Args[DoArg].VJSValue);
          Width = Math.abs(Width);
          Index = Prec - ToAdd.length;
          if (ToAdd.charAt(0) !== "-") {
            ToAdd = pas.System.StringOfChar("0",Index) + ToAdd}
           else pas.System.Insert(pas.System.StringOfChar("0",Index + 1),{get: function () {
              return ToAdd;
            }, set: function (v) {
              ToAdd = v;
            }},2);
        } else if ($tmp === "U") {
          if (Checkarg(0,false)) {
            ToAdd = $mod.IntToStr(Args[DoArg].VJSValue >>> 0)}
           else if (Checkarg(19,true)) ToAdd = $mod.IntToStr(Args[DoArg].VJSValue);
          Width = Math.abs(Width);
          Index = Prec - ToAdd.length;
          ToAdd = pas.System.StringOfChar("0",Index) + ToAdd;
        } else if ($tmp === "E") {
          if (Checkarg(12,false)) {
            ToAdd = $mod.FloatToStrF$1(Args[DoArg].VJSValue / 10000,$mod.TFloatFormat.ffExponent,3,Prec,aSettings)}
           else if (Checkarg(3,true)) ToAdd = $mod.FloatToStrF$1(Args[DoArg].VJSValue,$mod.TFloatFormat.ffExponent,3,Prec,aSettings);
        } else if ($tmp === "F") {
          if (Checkarg(12,false)) {
            ToAdd = $mod.FloatToStrF$1(Args[DoArg].VJSValue / 10000,$mod.TFloatFormat.ffFixed,9999,Prec,aSettings)}
           else if (Checkarg(0,false)) {
            ToAdd = $mod.FloatToStrF$1(Args[DoArg].VJSValue,$mod.TFloatFormat.ffFixed,9999,Prec,aSettings)}
           else if (Checkarg(3,true)) ToAdd = $mod.FloatToStrF$1(Args[DoArg].VJSValue,$mod.TFloatFormat.ffFixed,9999,Prec,aSettings);
        } else if ($tmp === "G") {
          if (Checkarg(12,false)) {
            ToAdd = $mod.FloatToStrF$1(Args[DoArg].VJSValue / 10000,$mod.TFloatFormat.ffGeneral,Prec,3,aSettings)}
           else if (Checkarg(3,true)) ToAdd = $mod.FloatToStrF$1(Args[DoArg].VJSValue,$mod.TFloatFormat.ffGeneral,Prec,3,aSettings);
        } else if ($tmp === "N") {
          if (Checkarg(12,false)) {
            ToAdd = $mod.FloatToStrF$1(Args[DoArg].VJSValue / 10000,$mod.TFloatFormat.ffNumber,9999,Prec,aSettings)}
           else if (Checkarg(3,true)) ToAdd = $mod.FloatToStrF$1(Args[DoArg].VJSValue,$mod.TFloatFormat.ffNumber,9999,Prec,aSettings);
        } else if ($tmp === "M") {
          if (Checkarg(12,false)) {
            ToAdd = $mod.FloatToStrF$1(Args[DoArg].VJSValue / 10000,$mod.TFloatFormat.ffCurrency,9999,Prec,aSettings)}
           else if (Checkarg(3,true)) ToAdd = $mod.FloatToStrF$1(Args[DoArg].VJSValue,$mod.TFloatFormat.ffCurrency,9999,Prec,aSettings);
        } else if ($tmp === "S") {
          if (Checkarg(18,false)) {
            Hs = Args[DoArg].VJSValue}
           else if (Checkarg(9,true)) Hs = Args[DoArg].VJSValue;
          Index = Hs.length;
          if ((Prec !== -1) && (Index > Prec)) Index = Prec;
          ToAdd = pas.System.Copy(Hs,1,Index);
        } else if ($tmp === "P") {
          if (Checkarg(0,false)) {
            ToAdd = $mod.IntToHex(Args[DoArg].VJSValue,8)}
           else if (Checkarg(0,true)) ToAdd = $mod.IntToHex(Args[DoArg].VJSValue,16);
        } else if ($tmp === "X") {
          if (Checkarg(0,false)) {
            vq = Args[DoArg].VJSValue;
            Index = 16;
          } else if (Checkarg(19,true)) {
            vq = Args[DoArg].VJSValue;
            Index = 31;
          };
          if (Prec > Index) {
            ToAdd = $mod.IntToHex(vq,Index)}
           else {
            Index = 1;
            while ((rtl.shl(1,Index * 4) <= vq) && (Index < 16)) Index += 1;
            if (Index > Prec) Prec = Index;
            ToAdd = $mod.IntToHex(vq,Prec);
          };
        } else if ($tmp === "%") ToAdd = "%";
        if (Width !== -1) if (ToAdd.length < Width) if (!Left) {
          ToAdd = pas.System.StringOfChar(" ",Width - ToAdd.length) + ToAdd}
         else ToAdd = ToAdd + pas.System.StringOfChar(" ",Width - ToAdd.length);
        Result = Result + ToAdd;
      };
      ChPos += 1;
      OldPos = ChPos;
    };
    return Result;
  };
  this.BytesOf = function (AVal) {
    var Result = [];
    var I = 0;
    Result = rtl.arraySetLength(Result,0,AVal.length);
    for (var $l = 0, $end = AVal.length - 1; $l <= $end; $l++) {
      I = $l;
      Result[I] = AVal.charCodeAt((I + 1) - 1);
    };
    return Result;
  };
  this.StringOf = function (ABytes) {
    var Result = "";
    var I = 0;
    Result = "";
    for (var $l = 0, $end = rtl.length(ABytes) - 1; $l <= $end; $l++) {
      I = $l;
      Result = Result + String.fromCharCode(ABytes[I]);
    };
    return Result;
  };
  this.LocaleCompare = function (s1, s2, locales) {
    return s1.localeCompare(s2,locales) == 0;
  };
  this.NormalizeStr = function (S, Norm) {
    return S.normalize(Norm);
  };
  var Alpha = rtl.createSet(null,65,90,null,97,122,95);
  var AlphaNum = rtl.unionSet(Alpha,rtl.createSet(null,48,57));
  var Dot = ".";
  this.IsValidIdent = function (Ident, AllowDots, StrictDots) {
    var Result = false;
    var First = false;
    var I = 0;
    var Len = 0;
    Len = Ident.length;
    if (Len < 1) return false;
    First = true;
    Result = false;
    I = 1;
    while (I <= Len) {
      if (First) {
        if (!(Ident.charCodeAt(I - 1) in Alpha)) return Result;
        First = false;
      } else if (AllowDots && (Ident.charAt(I - 1) === Dot)) {
        if (StrictDots) {
          if (I >= Len) return Result;
          First = true;
        };
      } else if (!(Ident.charCodeAt(I - 1) in AlphaNum)) return Result;
      I = I + 1;
    };
    Result = true;
    return Result;
  };
  this.TStringReplaceFlag = {"0": "rfReplaceAll", rfReplaceAll: 0, "1": "rfIgnoreCase", rfIgnoreCase: 1};
  this.$rtti.$Enum("TStringReplaceFlag",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TStringReplaceFlag});
  this.$rtti.$Set("TStringReplaceFlags",{comptype: this.$rtti["TStringReplaceFlag"]});
  this.Randomize = function () {
  };
  this.StringReplace = function (aOriginal, aSearch, aReplace, Flags) {
    var Result = "";
    var REFlags = "";
    var REString = "";
    REFlags = "";
    if ($mod.TStringReplaceFlag.rfReplaceAll in Flags) REFlags = "g";
    if ($mod.TStringReplaceFlag.rfIgnoreCase in Flags) REFlags = REFlags + "i";
    REString = aSearch.replace(new RegExp($impl.RESpecials,"g"),"\\$1");
    Result = aOriginal.replace(new RegExp(REString,REFlags),aReplace);
    return Result;
  };
  this.QuoteString = function (aOriginal, AQuote) {
    var Result = "";
    Result = AQuote + $mod.StringReplace(aOriginal,AQuote,AQuote + AQuote,rtl.createSet($mod.TStringReplaceFlag.rfReplaceAll)) + AQuote;
    return Result;
  };
  this.QuotedStr = function (s, QuoteChar) {
    var Result = "";
    Result = $mod.QuoteString(s,QuoteChar);
    return Result;
  };
  this.DeQuoteString = function (aQuoted, AQuote) {
    var Result = "";
    var i = 0;
    Result = aQuoted;
    if (Result.substr(0,1) !== AQuote) return Result;
    Result = Result.slice(1);
    i = 1;
    while (i <= Result.length) {
      if (Result.charAt(i - 1) === AQuote) {
        if ((i === Result.length) || (Result.charAt((i + 1) - 1) !== AQuote)) {
          Result = Result.slice(0,i - 1);
          return Result;
        } else Result = Result.slice(0,i - 1) + Result.slice(i);
      } else i += 1;
    };
    return Result;
  };
  this.LastDelimiter = function (Delimiters, S) {
    var Result = 0;
    Result = S.length;
    while ((Result > 0) && (pas.System.Pos(S.charAt(Result - 1),Delimiters) === 0)) Result -= 1;
    return Result;
  };
  this.IsDelimiter = function (Delimiters, S, Index) {
    var Result = false;
    Result = false;
    if ((Index > 0) && (Index <= S.length)) Result = pas.System.Pos(S.charAt(Index - 1),Delimiters) !== 0;
    return Result;
  };
  this.AdjustLineBreaks = function (S) {
    var Result = "";
    Result = $mod.AdjustLineBreaks$1(S,pas.System.DefaultTextLineBreakStyle);
    return Result;
  };
  this.AdjustLineBreaks$1 = function (S, Style) {
    var Result = "";
    var I = 0;
    var L = 0;
    var Res = "";
    function Add(C) {
      Res = Res + C;
    };
    I = 0;
    L = S.length;
    Result = "";
    while (I <= L) {
      var $tmp = S.charAt(I - 1);
      if ($tmp === "\n") {
        if (Style in rtl.createSet(pas.System.TTextLineBreakStyle.tlbsCRLF,pas.System.TTextLineBreakStyle.tlbsCR)) Add("\r");
        if (Style === pas.System.TTextLineBreakStyle.tlbsCRLF) Add("\n");
        I += 1;
      } else if ($tmp === "\r") {
        if (Style === pas.System.TTextLineBreakStyle.tlbsCRLF) Add("\r");
        Add("\n");
        I += 1;
        if (S.charAt(I - 1) === "\n") I += 1;
      } else {
        Add(S.charAt(I - 1));
        I += 1;
      };
    };
    Result = Res;
    return Result;
  };
  var Quotes = rtl.createSet(39,34);
  this.WrapText = function (Line, BreakStr, BreakChars, MaxCol) {
    var Result = "";
    var L = "";
    var C = "\x00";
    var LQ = "\x00";
    var BC = "\x00";
    var P = 0;
    var BLen = 0;
    var Len = 0;
    var HB = false;
    var IBC = false;
    Result = "";
    L = Line;
    BLen = BreakStr.length;
    if (BLen > 0) {
      BC = BreakStr.charAt(0)}
     else BC = "\x00";
    Len = L.length;
    while (Len > 0) {
      P = 1;
      LQ = "\x00";
      HB = false;
      IBC = false;
      while ((P <= Len) && ((P <= MaxCol) || !IBC) && ((LQ !== "\x00") || !HB)) {
        C = L.charAt(P - 1);
        if (C === LQ) {
          LQ = "\x00"}
         else if (C.charCodeAt() in Quotes) LQ = C;
        if (LQ !== "\x00") {
          P += 1}
         else {
          HB = (C === BC) && (BreakStr === pas.System.Copy(L,P,BLen));
          if (HB) {
            P += BLen}
           else {
            if (P >= MaxCol) IBC = $mod.CharInSet(C,BreakChars);
            P += 1;
          };
        };
      };
      Result = Result + pas.System.Copy(L,1,P - 1);
      pas.System.Delete({get: function () {
          return L;
        }, set: function (v) {
          L = v;
        }},1,P - 1);
      Len = L.length;
      if ((Len > 0) && !HB) Result = Result + BreakStr;
    };
    return Result;
  };
  this.WrapText$1 = function (Line, MaxCol) {
    var Result = "";
    Result = $mod.WrapText(Line,pas.System.sLineBreak,[" ","-","\t"],MaxCol);
    return Result;
  };
  this.SwapEndian = function (W) {
    var Result = 0;
    Result = ((W & 0xFF) << 8) | ((W >>> 8) & 0xFF);
    return Result;
  };
  this.SwapEndian$1 = function (C) {
    var Result = 0;
    Result = rtl.lw(rtl.lw(rtl.lw(rtl.lw((C & 0xFF) << 24) | rtl.lw((C & 0xFF00) << 8)) | (rtl.lw(C >>> 8) & 0xFF00)) | (rtl.lw(C >>> 24) & 0xFF));
    return Result;
  };
  this.IntToStr = function (Value) {
    var Result = "";
    Result = "" + Value;
    return Result;
  };
  this.TryStrToInt = function (S, res) {
    var Result = false;
    Result = $mod.TryStrToInt$1(S,res,$mod.FormatSettings);
    return Result;
  };
  this.TryStrToInt$1 = function (S, res, aSettings) {
    var Result = false;
    var NI = 0;
    Result = $mod.TryStrToInt$3(S,{get: function () {
        return NI;
      }, set: function (v) {
        NI = v;
      }},aSettings);
    Result = Result && (-2147483648 <= NI) && (NI <= 2147483647);
    if (Result) res.set(NI);
    return Result;
  };
  this.TryStrToInt$2 = function (S, res) {
    var Result = false;
    Result = $impl.IntTryStrToInt(S,res,$mod.FormatSettings.DecimalSeparator);
    return Result;
  };
  this.TryStrToInt$3 = function (S, res, aSettings) {
    var Result = false;
    Result = $impl.IntTryStrToInt(S,res,aSettings.DecimalSeparator);
    return Result;
  };
  this.StrToIntDef = function (S, aDef) {
    var Result = 0;
    var R = 0;
    if ($mod.TryStrToInt$2(S,{get: function () {
        return R;
      }, set: function (v) {
        R = v;
      }})) {
      Result = R}
     else Result = aDef;
    return Result;
  };
  this.StrToIntDef$1 = function (S, aDef) {
    var Result = 0;
    var R = 0;
    if ($mod.TryStrToInt$2(S,{get: function () {
        return R;
      }, set: function (v) {
        R = v;
      }})) {
      Result = R}
     else Result = aDef;
    return Result;
  };
  this.StrToInt = function (S) {
    var Result = 0;
    var R = 0;
    if (!$mod.TryStrToInt$2(S,{get: function () {
        return R;
      }, set: function (v) {
        R = v;
      }})) throw $mod.EConvertError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SErrInvalidInteger"),pas.System.VarRecs(18,S)]);
    Result = R;
    return Result;
  };
  this.StrToNativeInt = function (S) {
    var Result = 0;
    if (!$mod.TryStrToInt$2(S,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }})) throw $mod.EConvertError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SErrInvalidInteger"),pas.System.VarRecs(18,S)]);
    return Result;
  };
  this.StrToUInt = function (s) {
    var Result = 0;
    if (!$mod.TryStrToUInt(s,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }})) throw $mod.EConvertError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SErrInvalidInteger"),pas.System.VarRecs(18,s)]);
    return Result;
  };
  this.StrToUIntDef = function (s, aDef) {
    var Result = 0;
    if (!$mod.TryStrToUInt(s,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }})) Result = aDef;
    return Result;
  };
  this.UIntToStr = function (Value) {
    var Result = "";
    Result = $mod.IntToStr(Value);
    return Result;
  };
  this.TryStrToUInt = function (s, C) {
    var Result = false;
    var N = 0;
    Result = $mod.TryStrToInt$2(s,{get: function () {
        return N;
      }, set: function (v) {
        N = v;
      }});
    Result = (N >= 0) && (N <= 4294967295);
    if (Result) C.set(N);
    return Result;
  };
  this.StrToInt64 = function (S) {
    var Result = 0;
    var N = 0;
    if (!$mod.TryStrToInt$2(S,{get: function () {
        return N;
      }, set: function (v) {
        N = v;
      }})) throw $mod.EConvertError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SErrInvalidInteger"),pas.System.VarRecs(18,S)]);
    Result = N;
    return Result;
  };
  this.StrToInt64Def = function (S, ADefault) {
    var Result = 0;
    if (!$mod.TryStrToInt64(S,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }})) Result = ADefault;
    return Result;
  };
  this.TryStrToInt64 = function (S, res) {
    var Result = false;
    Result = $mod.TryStrToInt64$1(S,res,$mod.FormatSettings);
    return Result;
  };
  this.TryStrToInt64$1 = function (S, res, ASettings) {
    var Result = false;
    var R = 0;
    Result = $mod.TryStrToInt$3(S,{get: function () {
        return R;
      }, set: function (v) {
        R = v;
      }},ASettings);
    if (Result) res.set(R);
    return Result;
  };
  this.StrToQWord = function (S) {
    var Result = 0;
    var N = 0;
    if (!$mod.TryStrToInt$2(S,{get: function () {
        return N;
      }, set: function (v) {
        N = v;
      }}) || (N < 0)) throw $mod.EConvertError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SErrInvalidInteger"),pas.System.VarRecs(18,S)]);
    Result = N;
    return Result;
  };
  this.StrToQWordDef = function (S, ADefault) {
    var Result = 0;
    if (!$mod.TryStrToQWord(S,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }})) Result = ADefault;
    return Result;
  };
  this.TryStrToQWord = function (S, res) {
    var Result = false;
    var R = 0;
    Result = $mod.TryStrToInt$2(S,{get: function () {
        return R;
      }, set: function (v) {
        R = v;
      }}) && (R >= 0);
    if (Result) res.set(R);
    return Result;
  };
  this.TryStrToQWord$1 = function (S, res) {
    var Result = false;
    Result = $mod.TryStrToQWord(S,res);
    return Result;
  };
  this.StrToUInt64 = function (S) {
    var Result = 0;
    var N = 0;
    if (!$mod.TryStrToInt$2(S,{get: function () {
        return N;
      }, set: function (v) {
        N = v;
      }}) || (N < 0)) throw $mod.EConvertError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SErrInvalidInteger"),pas.System.VarRecs(18,S)]);
    Result = N;
    return Result;
  };
  this.StrToUInt64Def = function (S, ADefault) {
    var Result = 0;
    if (!$mod.TryStrToUInt64(S,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }})) Result = ADefault;
    return Result;
  };
  this.TryStrToUInt64 = function (S, res) {
    var Result = false;
    var R = 0;
    Result = $mod.TryStrToInt$2(S,{get: function () {
        return R;
      }, set: function (v) {
        R = v;
      }}) && (R >= 0);
    if (Result) res.set(R);
    return Result;
  };
  this.TryStrToUInt64$1 = function (S, res) {
    var Result = false;
    Result = $mod.TryStrToUInt64(S,res);
    return Result;
  };
  this.StrToDWord = function (S) {
    var Result = 0;
    if (!$mod.TryStrToDWord(S,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }})) throw $mod.EConvertError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SErrInvalidInteger"),pas.System.VarRecs(18,S)]);
    return Result;
  };
  this.StrToDWordDef = function (S, ADefault) {
    var Result = 0;
    if (!$mod.TryStrToDWord(S,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }})) Result = ADefault;
    return Result;
  };
  this.TryStrToDWord = function (S, res) {
    var Result = false;
    var R = 0;
    Result = $mod.TryStrToInt$2(S,{get: function () {
        return R;
      }, set: function (v) {
        R = v;
      }}) && (R >= 0) && (R <= 0xFFFFFFFF);
    if (Result) res.set(R);
    return Result;
  };
  this.IntToHex = function (Value, Digits) {
    var Result = "";
    Result = "";
    if (Value < 0) if (Value<0) Value = 0xFFFFFFFF + Value + 1;
    Result=Value.toString(16);
    Result = $mod.UpperCase(Result);
    while (Result.length < Digits) Result = "0" + Result;
    return Result;
  };
  this.MaxCurrency = 900719925474.0991;
  this.MinCurrency = -900719925474.0991;
  this.TFloatFormat = {"0": "ffFixed", ffFixed: 0, "1": "ffGeneral", ffGeneral: 1, "2": "ffExponent", ffExponent: 2, "3": "ffNumber", ffNumber: 3, "4": "ffCurrency", ffCurrency: 4};
  this.$rtti.$Enum("TFloatFormat",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TFloatFormat});
  var Rounds = "123456789:";
  this.FloatToDecimal = function (Value, Precision, Decimals) {
    var Result = $mod.TFloatRec.$new();
    var Buffer = "";
    var InfNan = "";
    var OutPos = 0;
    var error = 0;
    var N = 0;
    var L = 0;
    var C = 0;
    var GotNonZeroBeforeDot = false;
    var BeforeDot = false;
    Result.Negative = false;
    Result.Exponent = 0;
    for (C = 0; C <= 19; C++) Result.Digits[C] = "0";
    if (Value === 0) return Result;
    Buffer = rtl.floatToStr(Value,24);
    N = 1;
    L = Buffer.length;
    while (Buffer.charAt(N - 1) === " ") N += 1;
    Result.Negative = Buffer.charAt(N - 1) === "-";
    if (Result.Negative) {
      N += 1}
     else if (Buffer.charAt(N - 1) === "+") N += 1;
    if (L >= (N + 2)) {
      InfNan = pas.System.Copy(Buffer,N,3);
      if (InfNan === "Inf") {
        Result.Digits[0] = "\x00";
        Result.Exponent = 32767;
        return Result;
      };
      if (InfNan === "Nan") {
        Result.Digits[0] = "\x00";
        Result.Exponent = -32768;
        return Result;
      };
    };
    OutPos = 0;
    Result.Exponent = 0;
    BeforeDot = true;
    GotNonZeroBeforeDot = false;
    while ((L >= N) && (Buffer.charAt(N - 1) !== "E")) {
      if (Buffer.charAt(N - 1) === ".") {
        BeforeDot = false}
       else {
        if (BeforeDot) {
          Result.Exponent += 1;
          Result.Digits[OutPos] = Buffer.charAt(N - 1);
          if (Buffer.charAt(N - 1) !== "0") GotNonZeroBeforeDot = true;
        } else Result.Digits[OutPos] = Buffer.charAt(N - 1);
        OutPos += 1;
      };
      N += 1;
    };
    N += 1;
    if (N <= L) {
      pas.System.val$6(pas.System.Copy(Buffer,N,(L - N) + 1),{get: function () {
          return C;
        }, set: function (v) {
          C = v;
        }},{get: function () {
          return error;
        }, set: function (v) {
          error = v;
        }});
      Result.Exponent += C;
    };
    N = OutPos;
    L = 19;
    while (N < L) {
      Result.Digits[N] = "0";
      N += 1;
    };
    if ((Decimals + Result.Exponent) < Precision) {
      N = Decimals + Result.Exponent}
     else N = Precision;
    if (N >= L) N = L - 1;
    if (N === 0) {
      if (Result.Digits[0] >= "5") {
        Result.Digits[0] = "1";
        Result.Digits[1] = "\x00";
        Result.Exponent += 1;
      } else Result.Digits[0] = "\x00";
    } else if (N > 0) {
      if (Result.Digits[N] >= "5") {
        do {
          Result.Digits[N] = "\x00";
          N -= 1;
          Result.Digits[N] = Rounds.charAt(($mod.StrToInt(Result.Digits[N]) + 1) - 1);
        } while (!((N === 0) || (Result.Digits[N] < ":")));
        if (Result.Digits[0] === ":") {
          Result.Digits[0] = "1";
          Result.Exponent += 1;
        };
      } else {
        Result.Digits[N] = "0";
        while ((N > -1) && (Result.Digits[N] === "0")) {
          Result.Digits[N] = "\x00";
          N -= 1;
        };
      };
    } else Result.Digits[0] = "\x00";
    if ((Result.Digits[0] === "\x00") && !GotNonZeroBeforeDot) {
      Result.Exponent = 0;
      Result.Negative = false;
    };
    return Result;
  };
  this.FloatToStr = function (Value) {
    var Result = "";
    Result = $mod.FloatToStr$1(Value,$mod.FormatSettings);
    return Result;
  };
  this.FloatToStr$1 = function (Value, aSettings) {
    var Result = "";
    Result = $mod.FloatToStrF$1(Value,$mod.TFloatFormat.ffGeneral,15,0,aSettings);
    return Result;
  };
  this.FloatToStrF = function (Value, format, Precision, Digits) {
    var Result = "";
    Result = $mod.FloatToStrF$1(Value,format,Precision,Digits,$mod.FormatSettings);
    return Result;
  };
  this.FloatToStrF$1 = function (Value, format, Precision, Digits, aSettings) {
    var Result = "";
    var TS = "";
    var DS = "";
    DS = aSettings.DecimalSeparator;
    TS = aSettings.ThousandSeparator;
    var $tmp = format;
    if ($tmp === $mod.TFloatFormat.ffGeneral) {
      Result = $impl.FormatGeneralFloat(Value,Precision,DS)}
     else if ($tmp === $mod.TFloatFormat.ffExponent) {
      Result = $impl.FormatExponentFloat(Value,Precision,Digits,DS)}
     else if ($tmp === $mod.TFloatFormat.ffFixed) {
      Result = $impl.FormatFixedFloat(Value,Digits,DS)}
     else if ($tmp === $mod.TFloatFormat.ffNumber) {
      Result = $impl.FormatNumberFloat(Value,Digits,DS,TS)}
     else if ($tmp === $mod.TFloatFormat.ffCurrency) Result = $impl.FormatNumberCurrency(Value * 10000,Digits,aSettings);
    if ((format !== $mod.TFloatFormat.ffCurrency) && (Result.length > 1) && (Result.charAt(0) === "-")) $impl.RemoveLeadingNegativeSign({get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }},DS,TS);
    return Result;
  };
  this.TryStrToFloat = function (S, res) {
    var Result = false;
    Result = $mod.TryStrToFloat$2(S,res);
    return Result;
  };
  this.TryStrToFloat$1 = function (S, res, aSettings) {
    var Result = false;
    Result = $mod.TryStrToFloat$3(S,res,aSettings);
    return Result;
  };
  this.TryStrToFloat$2 = function (S, res) {
    var Result = false;
    Result = $mod.TryStrToFloat$3(S,res,$mod.FormatSettings);
    return Result;
  };
  var TDecimalPart = {"0": "dpDigit", dpDigit: 0, "1": "dpSignificand", dpSignificand: 1, "2": "dpExp", dpExp: 2};
  this.TryStrToFloat$3 = function (S, res, aSettings) {
    var Result = false;
    var J = undefined;
    var I = 0;
    var aStart = 0;
    var Len = 0;
    var N = "";
    var p = 0;
    Result = false;
    N = S;
    if (aSettings.ThousandSeparator !== "") N = $mod.StringReplace(N,aSettings.ThousandSeparator,"",rtl.createSet($mod.TStringReplaceFlag.rfReplaceAll));
    if (aSettings.DecimalSeparator !== ".") N = $mod.StringReplace(N,aSettings.DecimalSeparator,".",{});
    p = TDecimalPart.dpDigit;
    I = 1;
    aStart = 1;
    Len = N.length;
    while (I <= Len) {
      var $tmp = N.charAt(I - 1);
      if (($tmp === "+") || ($tmp === "-")) {
        var $tmp1 = p;
        if ($tmp1 === TDecimalPart.dpSignificand) {
          return Result}
         else if ($tmp1 === TDecimalPart.dpDigit) {
          if (I > aStart) return Result}
         else if ($tmp1 === TDecimalPart.dpExp) if (I > (aStart + 1)) return Result;
      } else if (($tmp >= "0") && ($tmp <= "9")) {}
      else if ($tmp === ".") {
        if (p !== TDecimalPart.dpDigit) return Result;
        p = TDecimalPart.dpSignificand;
        aStart = I;
      } else if (($tmp === "E") || ($tmp === "e")) {
        if (p === TDecimalPart.dpExp) {
          return Result}
         else {
          p = TDecimalPart.dpExp;
          aStart = I;
        };
      } else {
        return Result;
      };
      I += 1;
    };
    J = parseFloat(N);
    Result = !isNaN(J);
    if (Result) res.set(rtl.getNumber(J));
    return Result;
  };
  this.StrToFloatDef = function (S, aDef) {
    var Result = 0.0;
    if (!$mod.TryStrToFloat$3(S,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }},$mod.FormatSettings)) Result = aDef;
    return Result;
  };
  this.StrToFloatDef$1 = function (S, aDef, aSettings) {
    var Result = 0.0;
    if (!$mod.TryStrToFloat$3(S,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }},aSettings)) Result = aDef;
    return Result;
  };
  this.StrToFloat = function (S) {
    var Result = 0.0;
    Result = $mod.StrToFloat$1(S,$mod.FormatSettings);
    return Result;
  };
  this.StrToFloat$1 = function (S, aSettings) {
    var Result = 0.0;
    if (!$mod.TryStrToFloat$3(S,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }},aSettings)) throw $mod.EConvertError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SErrInvalidFloat"),pas.System.VarRecs(18,S)]);
    return Result;
  };
  this.FormatFloat = function (Fmt, aValue) {
    var Result = "";
    Result = $mod.FormatFloat$1(Fmt,aValue,$mod.TFormatSettings.$clone($mod.FormatSettings));
    return Result;
  };
  var MaxPrecision = 18;
  this.FormatFloat$1 = function (Fmt, aValue, aSettings) {
    var Result = "";
    var E = 0.0;
    var FV = $mod.TFloatRec.$new();
    var Section = "";
    var SectionLength = 0;
    var ThousandSep = false;
    var IsScientific = false;
    var DecimalPos = 0;
    var FirstDigit = 0;
    var LastDigit = 0;
    var RequestedDigits = 0;
    var ExpSize = 0;
    var Available = 0;
    var Current = 0;
    var PadZeroes = 0;
    var DistToDecimal = 0;
    function InitVars() {
      E = aValue;
      Section = "";
      SectionLength = 0;
      ThousandSep = false;
      IsScientific = false;
      DecimalPos = 0;
      FirstDigit = 2147483647;
      LastDigit = 0;
      RequestedDigits = 0;
      ExpSize = 0;
      Available = -1;
    };
    function ToResult(AChar) {
      Result = Result + AChar;
    };
    function AddToResult(AStr) {
      Result = Result + AStr;
    };
    function WriteDigit(ADigit) {
      if (ADigit === "\x00") return;
      DistToDecimal -= 1;
      if (DistToDecimal === -1) {
        AddToResult(aSettings.DecimalSeparator);
        ToResult(ADigit);
      } else {
        ToResult(ADigit);
        if (ThousandSep && ((DistToDecimal % 3) === 0) && (DistToDecimal > 1)) AddToResult(aSettings.ThousandSeparator);
      };
    };
    function GetDigit() {
      var Result = "\x00";
      Result = "\x00";
      if (Current <= Available) {
        Result = FV.Digits[Current];
        Current += 1;
      } else if (DistToDecimal <= LastDigit) {
        DistToDecimal -= 1}
       else Result = "0";
      return Result;
    };
    function CopyDigit() {
      if (PadZeroes === 0) {
        WriteDigit(GetDigit())}
       else if (PadZeroes < 0) {
        PadZeroes += 1;
        if (DistToDecimal <= FirstDigit) {
          WriteDigit("0")}
         else DistToDecimal -= 1;
      } else {
        while (PadZeroes > 0) {
          WriteDigit(GetDigit());
          PadZeroes -= 1;
        };
        WriteDigit(GetDigit());
      };
    };
    function GetSections(SP) {
      var Result = 0;
      var FL = 0;
      var i = 0;
      var C = "\x00";
      var Q = "\x00";
      var inQuote = false;
      Result = 1;
      SP.get()[1] = -1;
      SP.get()[2] = -1;
      SP.get()[3] = -1;
      inQuote = false;
      Q = "\x00";
      i = 1;
      FL = Fmt.length;
      while (i <= FL) {
        C = Fmt.charAt(i - 1);
        var $tmp = C;
        if ($tmp === ";") {
          if (!inQuote) {
            if (Result > 3) throw $mod.Exception.$create("Create$1",["Invalid float format"]);
            SP.get()[Result] = i;
            Result += 1;
          };
        } else if (($tmp === '"') || ($tmp === "'")) {
          if (inQuote) {
            inQuote = C !== Q}
           else {
            inQuote = true;
            Q = C;
          };
        };
        i += 1;
      };
      if (SP.get()[Result] === -1) SP.get()[Result] = FL + 1;
      return Result;
    };
    function AnalyzeFormat() {
      var I = 0;
      var Len = 0;
      var Q = "\x00";
      var C = "\x00";
      var InQuote = false;
      Len = Section.length;
      I = 1;
      InQuote = false;
      Q = "\x00";
      while (I <= Len) {
        C = Section.charAt(I - 1);
        if (C.charCodeAt() in rtl.createSet(34,39)) {
          if (InQuote) {
            InQuote = C !== Q}
           else {
            InQuote = true;
            Q = C;
          };
        } else if (!InQuote) {
          var $tmp = C;
          if ($tmp === ".") {
            if (DecimalPos === 0) DecimalPos = RequestedDigits + 1}
           else if ($tmp === ",") {
            ThousandSep = aSettings.ThousandSeparator !== "\x00"}
           else if (($tmp === "e") || ($tmp === "E")) {
            I += 1;
            if (I < Len) {
              C = Section.charAt(I - 1);
              IsScientific = C.charCodeAt() in rtl.createSet(45,43);
              if (IsScientific) while ((I < Len) && (Section.charAt((I + 1) - 1) === "0")) {
                ExpSize += 1;
                I += 1;
              };
              if (ExpSize > 4) ExpSize = 4;
            };
          } else if ($tmp === "#") {
            RequestedDigits += 1}
           else if ($tmp === "0") {
            if (RequestedDigits < FirstDigit) FirstDigit = RequestedDigits + 1;
            RequestedDigits += 1;
            LastDigit = RequestedDigits + 1;
          };
        };
        I += 1;
      };
      if (DecimalPos === 0) DecimalPos = RequestedDigits + 1;
      LastDigit = DecimalPos - LastDigit;
      if (LastDigit > 0) LastDigit = 0;
      FirstDigit = DecimalPos - FirstDigit;
      if (FirstDigit < 0) FirstDigit = 0;
    };
    function ValueOutSideScope() {
      var Result = false;
      Result = ((FV.Exponent >= 18) && !IsScientific) || (FV.Exponent === 0x7FF) || (FV.Exponent === 0x800);
      return Result;
    };
    function CalcRunVars() {
      var D = 0;
      var P = 0;
      if (IsScientific) {
        P = RequestedDigits;
        D = 9999;
      } else {
        P = 18;
        D = (RequestedDigits - DecimalPos) + 1;
      };
      FV.$assign($mod.FloatToDecimal(aValue,P,D));
      DistToDecimal = DecimalPos - 1;
      if (IsScientific) {
        PadZeroes = 0}
       else {
        PadZeroes = FV.Exponent - (DecimalPos - 1);
        if (PadZeroes >= 0) DistToDecimal = FV.Exponent;
      };
      Available = -1;
      while ((Available < 18) && (FV.Digits[Available + 1] !== "\x00")) Available += 1;
    };
    function FormatExponent(ASign, aExponent) {
      var Result = "";
      Result = $mod.IntToStr(aExponent);
      Result = pas.System.StringOfChar("0",ExpSize - Result.length) + Result;
      if (aExponent < 0) {
        Result = "-" + Result}
       else if ((aExponent > 0) && (ASign === "+")) Result = ASign + Result;
      return Result;
    };
    var I = 0;
    var S = 0;
    var C = "\x00";
    var Q = "\x00";
    var PA = [];
    var InLiteral = false;
    PA = rtl.arraySetLength(PA,0,4);
    Result = "";
    InitVars();
    if (E > 0) {
      S = 1}
     else if (E < 0) {
      S = 2}
     else S = 3;
    PA[0] = 0;
    I = GetSections({get: function () {
        return PA;
      }, set: function (v) {
        PA = v;
      }});
    if ((I < S) || ((PA[S] - PA[S - 1]) === 0)) S = 1;
    SectionLength = PA[S] - PA[S - 1] - 1;
    Section = pas.System.Copy(Fmt,PA[S - 1] + 1,SectionLength);
    Section = rtl.strSetLength(Section,SectionLength);
    AnalyzeFormat();
    CalcRunVars();
    if ((SectionLength === 0) || ValueOutSideScope()) {
      Section=E.toPrecision(15);
      Result = Section;
    };
    I = 1;
    Current = 0;
    Q = " ";
    InLiteral = false;
    if (FV.Negative && (S === 1)) ToResult("-");
    while (I <= SectionLength) {
      C = Section.charAt(I - 1);
      if (C.charCodeAt() in rtl.createSet(34,39)) {
        if (InLiteral) {
          InLiteral = C !== Q}
         else {
          InLiteral = true;
          Q = C;
        };
      } else if (InLiteral) {
        ToResult(C)}
       else {
        var $tmp = C;
        if (($tmp === "0") || ($tmp === "#")) {
          CopyDigit()}
         else if (($tmp === ".") || ($tmp === ",")) {}
        else if (($tmp === "e") || ($tmp === "E")) {
          ToResult(C);
          I += 1;
          if (I <= Section.length) {
            C = Section.charAt(I - 1);
            if (C.charCodeAt() in rtl.createSet(43,45)) {
              AddToResult(FormatExponent(C,(FV.Exponent - DecimalPos) + 1));
              while ((I < SectionLength) && (Section.charAt((I + 1) - 1) === "0")) I += 1;
            };
          };
        } else {
          ToResult(C);
        };
      };
      I += 1;
    };
    return Result;
  };
  this.$rtti.$DynArray("FalseBoolStrs$a",{eltype: rtl.string});
  this.TrueBoolStrs = [];
  this.FalseBoolStrs = [];
  this.StrToBool = function (S) {
    var Result = false;
    if (!$mod.TryStrToBool(S,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }})) throw $mod.EConvertError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SInvalidBoolean"),pas.System.VarRecs(18,S)]);
    return Result;
  };
  this.BoolToStr = function (B, UseBoolStrs) {
    var Result = "";
    if (UseBoolStrs) {
      $impl.CheckBoolStrs();
      if (B) {
        Result = $mod.TrueBoolStrs[0]}
       else Result = $mod.FalseBoolStrs[0];
    } else if (B) {
      Result = "-1"}
     else Result = "0";
    return Result;
  };
  this.BoolToStr$1 = function (B, TrueS, FalseS) {
    var Result = "";
    if (B) {
      Result = TrueS}
     else Result = FalseS;
    return Result;
  };
  this.StrToBoolDef = function (S, Default) {
    var Result = false;
    if (!$mod.TryStrToBool(S,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }})) Result = Default;
    return Result;
  };
  this.TryStrToBool = function (S, Value) {
    var Result = false;
    var Temp = "";
    var I = 0;
    var D = 0.0;
    var Code = 0;
    Temp = $mod.UpperCase(S);
    pas.System.val$8(Temp,{get: function () {
        return D;
      }, set: function (v) {
        D = v;
      }},{get: function () {
        return Code;
      }, set: function (v) {
        Code = v;
      }});
    Result = true;
    if (Code === 0) {
      Value.set(D !== 0.0)}
     else {
      $impl.CheckBoolStrs();
      for (var $l = 0, $end = rtl.length($mod.TrueBoolStrs) - 1; $l <= $end; $l++) {
        I = $l;
        if (Temp === $mod.UpperCase($mod.TrueBoolStrs[I])) {
          Value.set(true);
          return Result;
        };
      };
      for (var $l1 = 0, $end1 = rtl.length($mod.FalseBoolStrs) - 1; $l1 <= $end1; $l1++) {
        I = $l1;
        if (Temp === $mod.UpperCase($mod.FalseBoolStrs[I])) {
          Value.set(false);
          return Result;
        };
      };
      Result = false;
    };
    return Result;
  };
  this.ConfigExtension = ".cfg";
  this.SysConfigDir = "";
  this.$rtti.$ProcVar("TOnGetEnvironmentVariable",{procsig: rtl.newTIProcSig([["EnvVar",rtl.string,2]],rtl.string)});
  this.$rtti.$ProcVar("TOnGetEnvironmentString",{procsig: rtl.newTIProcSig([["Index",rtl.longint]],rtl.string)});
  this.$rtti.$ProcVar("TOnGetEnvironmentVariableCount",{procsig: rtl.newTIProcSig([],rtl.longint)});
  this.$rtti.$ProcVar("TShowExceptionHandler",{procsig: rtl.newTIProcSig([["Msg",rtl.string,2]])});
  this.$rtti.$RefToProcVar("TUncaughtPascalExceptionHandler",{procsig: rtl.newTIProcSig([["aObject",pas.System.$rtti["TObject"]]])});
  this.$rtti.$RefToProcVar("TUncaughtJSExceptionHandler",{procsig: rtl.newTIProcSig([["aObject",pas.JS.$rtti["TJSObject"]]])});
  this.OnGetEnvironmentVariable = null;
  this.OnGetEnvironmentString = null;
  this.OnGetEnvironmentVariableCount = null;
  this.OnShowException = null;
  this.SetOnUnCaughtExceptionHandler = function (aValue) {
    var Result = null;
    Result = $impl.OnPascalException;
    $impl.OnPascalException = aValue;
    $mod.HookUncaughtExceptions();
    return Result;
  };
  this.SetOnUnCaughtExceptionHandler$1 = function (aValue) {
    var Result = null;
    Result = $impl.OnJSException;
    $impl.OnJSException = aValue;
    $mod.HookUncaughtExceptions();
    return Result;
  };
  this.HookUncaughtExceptions = function () {
    rtl.onUncaughtException = $impl.RTLExceptionHook;
    rtl.showUncaughtExceptions = true;
  };
  this.GetEnvironmentVariable = function (EnvVar) {
    var Result = "";
    if ($mod.OnGetEnvironmentVariable != null) {
      Result = $mod.OnGetEnvironmentVariable(EnvVar)}
     else Result = "";
    return Result;
  };
  this.GetEnvironmentVariableCount = function () {
    var Result = 0;
    if ($mod.OnGetEnvironmentVariableCount != null) {
      Result = $mod.OnGetEnvironmentVariableCount()}
     else Result = 0;
    return Result;
  };
  this.GetEnvironmentString = function (Index) {
    var Result = "";
    if ($mod.OnGetEnvironmentString != null) {
      Result = $mod.OnGetEnvironmentString(Index)}
     else Result = "";
    return Result;
  };
  this.ShowException = function (ExceptObject, ExceptAddr) {
    var S = "";
    S = rtl.getResStr($mod,"SApplicationException") + ExceptObject.$classname;
    if ($mod.Exception.isPrototypeOf(ExceptObject)) S = S + " : " + ExceptObject.FMessage;
    $impl.DoShowException(S);
    if (ExceptAddr === null) ;
  };
  this.Abort = function () {
    throw $mod.EAbort.$create("Create$1",[rtl.getResStr($mod,"SAbortError")]);
  };
  this.TEventType = {"0": "etCustom", etCustom: 0, "1": "etInfo", etInfo: 1, "2": "etWarning", etWarning: 2, "3": "etError", etError: 3, "4": "etDebug", etDebug: 4};
  this.$rtti.$Enum("TEventType",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TEventType});
  this.$rtti.$Set("TEventTypes",{comptype: this.$rtti["TEventType"]});
  rtl.recNewT(this,"TSystemTime",function () {
    this.Year = 0;
    this.Month = 0;
    this.Day = 0;
    this.DayOfWeek = 0;
    this.Hour = 0;
    this.Minute = 0;
    this.Second = 0;
    this.MilliSecond = 0;
    this.$eq = function (b) {
      return (this.Year === b.Year) && (this.Month === b.Month) && (this.Day === b.Day) && (this.DayOfWeek === b.DayOfWeek) && (this.Hour === b.Hour) && (this.Minute === b.Minute) && (this.Second === b.Second) && (this.MilliSecond === b.MilliSecond);
    };
    this.$assign = function (s) {
      this.Year = s.Year;
      this.Month = s.Month;
      this.Day = s.Day;
      this.DayOfWeek = s.DayOfWeek;
      this.Hour = s.Hour;
      this.Minute = s.Minute;
      this.Second = s.Second;
      this.MilliSecond = s.MilliSecond;
      return this;
    };
    var $r = $mod.$rtti.$Record("TSystemTime",{},this);
    $r.addField("Year",rtl.word);
    $r.addField("Month",rtl.word);
    $r.addField("Day",rtl.word);
    $r.addField("DayOfWeek",rtl.word);
    $r.addField("Hour",rtl.word);
    $r.addField("Minute",rtl.word);
    $r.addField("Second",rtl.word);
    $r.addField("MilliSecond",rtl.word);
  });
  rtl.recNewT(this,"TTimeStamp",function () {
    this.Time = 0;
    this.Date = 0;
    this.$eq = function (b) {
      return (this.Time === b.Time) && (this.Date === b.Date);
    };
    this.$assign = function (s) {
      this.Time = s.Time;
      this.Date = s.Date;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTimeStamp",{},this);
    $r.addField("Time",rtl.longint);
    $r.addField("Date",rtl.longint);
  });
  this.TimeSeparator = "\x00";
  this.DateSeparator = "\x00";
  this.ShortDateFormat = "";
  this.LongDateFormat = "";
  this.ShortTimeFormat = "";
  this.LongTimeFormat = "";
  this.DecimalSeparator = "";
  this.ThousandSeparator = "";
  this.TimeAMString = "";
  this.TimePMString = "";
  this.HoursPerDay = 24;
  this.MinsPerHour = 60;
  this.SecsPerMin = 60;
  this.MSecsPerSec = 1000;
  this.MinsPerDay = 24 * 60;
  this.SecsPerHour = 60 * 60;
  this.SecsPerDay = 1440 * 60;
  this.MSecsPerDay = 86400 * 1000;
  this.MaxDateTime = 2958465.99999999;
  this.MinDateTime = -693593.99999999;
  this.JulianEpoch = -2415018.5;
  this.UnixEpoch = -2415018.5 + 2440587.5;
  this.DateDelta = 693594;
  this.UnixDateDelta = 25569;
  this.MonthDays$a$clone = function (a) {
    var b = [];
    b.length = 2;
    for (var c = 0; c < 2; c++) b[c] = a[c].slice(0);
    return b;
  };
  this.$rtti.$StaticArray("MonthDays$a",{dims: [2,12], eltype: rtl.word});
  this.MonthDays = [[31,28,31,30,31,30,31,31,30,31,30,31],[31,29,31,30,31,30,31,31,30,31,30,31]];
  this.ShortMonthNames = rtl.arraySetLength(null,"",12);
  this.LongMonthNames = rtl.arraySetLength(null,"",12);
  this.ShortDayNames = rtl.arraySetLength(null,"",7);
  this.LongDayNames = rtl.arraySetLength(null,"",7);
  this.FormatSettings = this.TFormatSettings.$new();
  this.TwoDigitYearCenturyWindow = 50;
  this.DateTimeToJSDate = function (aDateTime, asUTC) {
    var Result = null;
    var Y = 0;
    var M = 0;
    var D = 0;
    var h = 0;
    var n = 0;
    var s = 0;
    var z = 0;
    $mod.DecodeDate(pas.System.Trunc(aDateTime),{get: function () {
        return Y;
      }, set: function (v) {
        Y = v;
      }},{get: function () {
        return M;
      }, set: function (v) {
        M = v;
      }},{get: function () {
        return D;
      }, set: function (v) {
        D = v;
      }});
    $mod.DecodeTime(pas.System.Frac(aDateTime),{get: function () {
        return h;
      }, set: function (v) {
        h = v;
      }},{get: function () {
        return n;
      }, set: function (v) {
        n = v;
      }},{get: function () {
        return s;
      }, set: function (v) {
        s = v;
      }},{get: function () {
        return z;
      }, set: function (v) {
        z = v;
      }});
    if (asUTC) {
      Result = new Date(Date.UTC(Y,M - 1,D,h,n,s,z))}
     else Result = new Date(Y,M - 1,D,h,n,s,z);
    return Result;
  };
  this.JSDateToDateTime = function (aDate) {
    var Result = 0.0;
    Result = $mod.EncodeDate(aDate.getFullYear(),aDate.getMonth() + 1,aDate.getDate()) + $mod.EncodeTime(aDate.getHours(),aDate.getMinutes(),aDate.getSeconds(),aDate.getMilliseconds());
    return Result;
  };
  this.DateTimeToTimeStamp = function (DateTime) {
    var Result = $mod.TTimeStamp.$new();
    var D = 0.0;
    D = DateTime * 86400000;
    if (D < 0) {
      D = D - 0.5}
     else D = D + 0.5;
    Result.Time = pas.System.Trunc(Math.abs(pas.System.Trunc(D)) % 86400000);
    Result.Date = 693594 + rtl.trunc(pas.System.Trunc(D) / 86400000);
    return Result;
  };
  this.TimeStampToDateTime = function (TimeStamp) {
    var Result = 0.0;
    Result = $mod.ComposeDateTime(TimeStamp.Date - 693594,TimeStamp.Time / 86400000);
    return Result;
  };
  this.MSecsToTimeStamp = function (MSecs) {
    var Result = $mod.TTimeStamp.$new();
    Result.Date = pas.System.Trunc(MSecs / 86400000);
    MSecs = MSecs - (Result.Date * 86400000);
    Result.Time = Math.round(MSecs);
    return Result;
  };
  this.TimeStampToMSecs = function (TimeStamp) {
    var Result = 0;
    Result = TimeStamp.Time + (TimeStamp.Date * 86400000);
    return Result;
  };
  this.DateTimeToSystemTime = function (DateTime, SystemTime) {
    $mod.DecodeDateFully(DateTime,{p: SystemTime, get: function () {
        return this.p.Year;
      }, set: function (v) {
        this.p.Year = v;
      }},{p: SystemTime, get: function () {
        return this.p.Month;
      }, set: function (v) {
        this.p.Month = v;
      }},{p: SystemTime, get: function () {
        return this.p.Day;
      }, set: function (v) {
        this.p.Day = v;
      }},{p: SystemTime, get: function () {
        return this.p.DayOfWeek;
      }, set: function (v) {
        this.p.DayOfWeek = v;
      }});
    $mod.DecodeTime(DateTime,{p: SystemTime, get: function () {
        return this.p.Hour;
      }, set: function (v) {
        this.p.Hour = v;
      }},{p: SystemTime, get: function () {
        return this.p.Minute;
      }, set: function (v) {
        this.p.Minute = v;
      }},{p: SystemTime, get: function () {
        return this.p.Second;
      }, set: function (v) {
        this.p.Second = v;
      }},{p: SystemTime, get: function () {
        return this.p.MilliSecond;
      }, set: function (v) {
        this.p.MilliSecond = v;
      }});
    SystemTime.DayOfWeek -= 1;
  };
  this.SystemTimeToDateTime = function (SystemTime) {
    var Result = 0.0;
    Result = $mod.ComposeDateTime($impl.DoEncodeDate(SystemTime.Year,SystemTime.Month,SystemTime.Day),$impl.DoEncodeTime(SystemTime.Hour,SystemTime.Minute,SystemTime.Second,SystemTime.MilliSecond));
    return Result;
  };
  this.FloatToDateTime = function (Value) {
    var Result = 0.0;
    if ((Value < $mod.MinDateTime) || (Value > $mod.MaxDateTime)) throw $mod.EConvertError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SInvalidDateTime"),pas.System.VarRecs(18,$mod.FloatToStr(Value))]);
    Result = Value;
    return Result;
  };
  this.TryEncodeDate = function (Year, Month, Day, date) {
    var Result = false;
    var c = 0;
    var ya = 0;
    Result = (Year > 0) && (Year < 10000) && (Month >= 1) && (Month <= 12) && (Day > 0) && (Day <= $mod.MonthDays[+$mod.IsLeapYear(Year)][Month - 1]);
    if (Result) {
      if (Month > 2) {
        Month -= 3}
       else {
        Month += 9;
        Year -= 1;
      };
      c = rtl.trunc(Year / 100);
      ya = Year - (100 * c);
      date.set(((146097 * c) >>> 2) + ((1461 * ya) >>> 2) + rtl.trunc(((153 * Month) + 2) / 5) + Day);
      date.set(date.get() - 693900);
    };
    return Result;
  };
  this.TryEncodeTime = function (Hour, Min, Sec, MSec, Time) {
    var Result = false;
    Result = (Hour < 24) && (Min < 60) && (Sec < 60) && (MSec < 1000);
    if (Result) Time.set(((Hour * 3600000) + (Min * 60000) + (Sec * 1000) + MSec) / 86400000);
    return Result;
  };
  this.EncodeDate = function (Year, Month, Day) {
    var Result = 0.0;
    if (!$mod.TryEncodeDate(Year,Month,Day,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }})) throw $mod.EConvertError.$create("CreateFmt",["%s-%s-%s is not a valid date specification",pas.System.VarRecs(18,$mod.IntToStr(Year),18,$mod.IntToStr(Month),18,$mod.IntToStr(Day))]);
    return Result;
  };
  this.EncodeTime = function (Hour, Minute, Second, MilliSecond) {
    var Result = 0.0;
    if (!$mod.TryEncodeTime(Hour,Minute,Second,MilliSecond,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }})) throw $mod.EConvertError.$create("CreateFmt",["%s:%s:%s.%s is not a valid time specification",pas.System.VarRecs(18,$mod.IntToStr(Hour),18,$mod.IntToStr(Minute),18,$mod.IntToStr(Second),18,$mod.IntToStr(MilliSecond))]);
    return Result;
  };
  this.DecodeDate = function (date, Year, Month, Day) {
    var ly = 0;
    var ld = 0;
    var lm = 0;
    var j = 0;
    if (date <= -693594) {
      Year.set(0);
      Month.set(0);
      Day.set(0);
    } else {
      if (date > 0) {
        date = date + (1 / (86400000 * 2))}
       else date = date - (1 / (86400000 * 2));
      if (date > $mod.MaxDateTime) date = $mod.MaxDateTime;
      j = rtl.shl(pas.System.Trunc(date) + 693900,2) - 1;
      ly = rtl.trunc(j / 146097);
      j = j - (146097 * ly);
      ld = rtl.lw(j >>> 2);
      j = rtl.trunc((rtl.lw(ld << 2) + 3) / 1461);
      ld = rtl.lw(((rtl.lw(ld << 2) + 7) - (1461 * j)) >>> 2);
      lm = rtl.trunc(((5 * ld) - 3) / 153);
      ld = rtl.trunc((((5 * ld) + 2) - (153 * lm)) / 5);
      ly = (100 * ly) + j;
      if (lm < 10) {
        lm += 3}
       else {
        lm -= 9;
        ly += 1;
      };
      Year.set(ly);
      Month.set(lm);
      Day.set(ld);
    };
  };
  this.DecodeTime = function (Time, Hour, Minute, Second, MilliSecond) {
    var l = 0;
    l = $mod.DateTimeToTimeStamp(Time).Time;
    Hour.set(rtl.trunc(l / 3600000));
    l = l % 3600000;
    Minute.set(rtl.trunc(l / 60000));
    l = l % 60000;
    Second.set(rtl.trunc(l / 1000));
    l = l % 1000;
    MilliSecond.set(l);
  };
  this.DecodeDateFully = function (DateTime, Year, Month, Day, DOW) {
    var Result = false;
    $mod.DecodeDate(DateTime,Year,Month,Day);
    DOW.set($mod.DayOfWeek(DateTime));
    Result = $mod.IsLeapYear(Year.get());
    return Result;
  };
  this.ComposeDateTime = function (date, Time) {
    var Result = 0.0;
    if (date < 0) {
      Result = pas.System.Trunc(date) - Math.abs(pas.System.Frac(Time))}
     else Result = pas.System.Trunc(date) + Math.abs(pas.System.Frac(Time));
    return Result;
  };
  this.ReplaceTime = function (dati, NewTime) {
    dati.set($mod.ComposeDateTime(dati.get(),NewTime));
  };
  this.ReplaceDate = function (DateTime, NewDate) {
    var tmp = 0.0;
    tmp = NewDate;
    $mod.ReplaceTime({get: function () {
        return tmp;
      }, set: function (v) {
        tmp = v;
      }},DateTime.get());
    DateTime.set(tmp);
  };
  this.Date = function () {
    var Result = 0.0;
    Result = pas.System.Trunc($mod.Now());
    return Result;
  };
  this.Time = function () {
    var Result = 0.0;
    Result = $mod.Now() - $mod.Date();
    return Result;
  };
  this.Now = function () {
    var Result = 0.0;
    Result = $mod.JSDateToDateTime(new Date());
    return Result;
  };
  this.DayOfWeek = function (DateTime) {
    var Result = 0;
    Result = 1 + ((pas.System.Trunc(DateTime) - 1) % 7);
    if (Result <= 0) Result += 7;
    return Result;
  };
  this.IncMonth = function (DateTime, NumberOfMonths) {
    var Result = 0.0;
    var Year = 0;
    var Month = 0;
    var Day = 0;
    $mod.DecodeDate(DateTime,{get: function () {
        return Year;
      }, set: function (v) {
        Year = v;
      }},{get: function () {
        return Month;
      }, set: function (v) {
        Month = v;
      }},{get: function () {
        return Day;
      }, set: function (v) {
        Day = v;
      }});
    $mod.IncAMonth({get: function () {
        return Year;
      }, set: function (v) {
        Year = v;
      }},{get: function () {
        return Month;
      }, set: function (v) {
        Month = v;
      }},{get: function () {
        return Day;
      }, set: function (v) {
        Day = v;
      }},NumberOfMonths);
    Result = $mod.ComposeDateTime($impl.DoEncodeDate(Year,Month,Day),DateTime);
    return Result;
  };
  this.IncAMonth = function (Year, Month, Day, NumberOfMonths) {
    var TempMonth = 0;
    var S = 0;
    if (NumberOfMonths >= 0) {
      S = 1}
     else S = -1;
    Year.set(Year.get() + rtl.trunc(NumberOfMonths / 12));
    TempMonth = (Month.get() + (NumberOfMonths % 12)) - 1;
    if ((TempMonth > 11) || (TempMonth < 0)) {
      TempMonth -= S * 12;
      Year.set(Year.get() + S);
    };
    Month.set(TempMonth + 1);
    if (Day.get() > $mod.MonthDays[+$mod.IsLeapYear(Year.get())][Month.get() - 1]) Day.set($mod.MonthDays[+$mod.IsLeapYear(Year.get())][Month.get() - 1]);
  };
  this.IsLeapYear = function (Year) {
    var Result = false;
    Result = ((Year % 4) === 0) && (((Year % 100) !== 0) || ((Year % 400) === 0));
    return Result;
  };
  this.CurrentYear = function () {
    var Result = 0;
    Result = (new Date()).getFullYear();
    return Result;
  };
  this.DateTimeToString = function (Result, Format, DateTime) {
    $mod.DateTimeToString$1(Result,Format,DateTime,$mod.FormatSettings);
  };
  this.DateTimeToString$1 = function (Result, Format, DateTime, AFormatSettings) {
    Result.set($mod.FormatDateTime$1(Format,DateTime,AFormatSettings));
  };
  this.DateToStr = function (date) {
    var Result = "";
    Result = $mod.DateToStr$1(date,$mod.FormatSettings);
    return Result;
  };
  this.DateToStr$1 = function (date, aSettings) {
    var Result = "";
    Result = $mod.FormatDateTime$1("ddddd",date,aSettings);
    return Result;
  };
  this.StrToDate = function (S) {
    var Result = 0.0;
    Result = $mod.StrToDate$3(S,$mod.FormatSettings);
    return Result;
  };
  this.StrToDate$1 = function (S, separator) {
    var Result = 0.0;
    Result = $mod.StrToDate$2(S,$mod.FormatSettings.ShortDateFormat,separator);
    return Result;
  };
  this.StrToDate$2 = function (S, useformat, separator) {
    var Result = 0.0;
    var MSg = "";
    Result = $impl.IntStrToDate({get: function () {
        return MSg;
      }, set: function (v) {
        MSg = v;
      }},S,useformat,separator);
    if (MSg !== "") throw $mod.EConvertError.$create("Create$1",[MSg]);
    return Result;
  };
  this.StrToDate$3 = function (S, aSettings) {
    var Result = 0.0;
    Result = $mod.StrToDate$2(S,aSettings.ShortDateFormat,aSettings.DateSeparator);
    return Result;
  };
  this.TryStrToDate = function (S, Value) {
    var Result = false;
    Result = $mod.TryStrToDate$1(S,Value,$mod.FormatSettings);
    return Result;
  };
  this.TryStrToDate$1 = function (S, Value, aSettings) {
    var Result = false;
    Result = $mod.TryStrToDate$3(S,Value,aSettings.ShortDateFormat,aSettings.DateSeparator);
    return Result;
  };
  this.TryStrToDate$2 = function (S, Value, separator) {
    var Result = false;
    Result = $mod.TryStrToDate$3(S,Value,$mod.FormatSettings.ShortDateFormat,separator);
    return Result;
  };
  this.TryStrToDate$3 = function (S, Value, useformat, separator) {
    var Result = false;
    var Msg = "";
    Result = S.length !== 0;
    if (Result) {
      Value.set($impl.IntStrToDate({get: function () {
          return Msg;
        }, set: function (v) {
          Msg = v;
        }},S,useformat,separator));
      Result = Msg === "";
    };
    return Result;
  };
  this.StrToDateDef = function (S, Defvalue) {
    var Result = 0.0;
    Result = $mod.StrToDateDef$1(S,Defvalue,"\x00");
    return Result;
  };
  this.StrToDateDef$1 = function (S, Defvalue, separator) {
    var Result = 0.0;
    if (!$mod.TryStrToDate$2(S,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }},separator)) Result = Defvalue;
    return Result;
  };
  this.StrToDateDef$2 = function (S, Defvalue, aSettings) {
    var Result = 0.0;
    if (!$mod.TryStrToDate$1(S,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }},aSettings)) Result = Defvalue;
    return Result;
  };
  this.TimeToStr = function (Time) {
    var Result = "";
    Result = $mod.TimeToStr$1(Time,$mod.FormatSettings);
    return Result;
  };
  this.TimeToStr$1 = function (Time, aSettings) {
    var Result = "";
    Result = $mod.FormatDateTime$1("tt",Time,aSettings);
    return Result;
  };
  this.StrToTime = function (S) {
    var Result = 0.0;
    Result = $mod.StrToTime$2(S,$mod.FormatSettings);
    return Result;
  };
  this.StrToTime$1 = function (S, separator) {
    var Result = 0.0;
    var aSettings = $mod.TFormatSettings.$new();
    aSettings.$assign($mod.TFormatSettings.Create());
    aSettings.TimeSeparator = separator;
    Result = $mod.StrToTime$2(S,aSettings);
    return Result;
  };
  this.StrToTime$2 = function (S, aSettings) {
    var Result = 0.0;
    var Msg = "";
    Result = $impl.IntStrToTime({get: function () {
        return Msg;
      }, set: function (v) {
        Msg = v;
      }},S,S.length,aSettings);
    if (Msg !== "") throw $mod.EConvertError.$create("Create$1",[Msg]);
    return Result;
  };
  this.TryStrToTime = function (S, Value) {
    var Result = false;
    Result = $mod.TryStrToTime$1(S,Value,$mod.TFormatSettings.$clone($mod.FormatSettings));
    return Result;
  };
  this.TryStrToTime$1 = function (S, Value, aSettings) {
    var Result = false;
    var Msg = "";
    Result = S.length !== 0;
    if (Result) {
      Value.set($impl.IntStrToTime({get: function () {
          return Msg;
        }, set: function (v) {
          Msg = v;
        }},S,S.length,aSettings));
      Result = Msg === "";
    };
    return Result;
  };
  this.TryStrToTime$2 = function (S, Value, separator) {
    var Result = false;
    var Fmt = $mod.TFormatSettings.$new();
    Fmt.$assign($mod.TFormatSettings.Create());
    Fmt.TimeSeparator = separator;
    Result = $mod.TryStrToTime$1(S,Value,$mod.TFormatSettings.$clone(Fmt));
    return Result;
  };
  this.StrToTimeDef = function (S, Defvalue) {
    var Result = 0.0;
    Result = $mod.StrToTimeDef$1(S,Defvalue,"\x00");
    return Result;
  };
  this.StrToTimeDef$1 = function (S, Defvalue, separator) {
    var Result = 0.0;
    if (!$mod.TryStrToTime$2(S,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }},separator)) Result = Defvalue;
    return Result;
  };
  this.StrToTimeDef$2 = function (AString, ADefault, aSettings) {
    var Result = 0.0;
    if (!$mod.TryStrToTime$1(AString,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }},$mod.TFormatSettings.$clone(aSettings))) Result = ADefault;
    return Result;
  };
  this.DateTimeToStr = function (DateTime, ForceTimeIfZero) {
    var Result = "";
    Result = $mod.DateTimeToStr$1(DateTime,$mod.FormatSettings,ForceTimeIfZero);
    return Result;
  };
  this.DateTimeToStr$1 = function (DateTime, aSettings, ForceTimeIfZero) {
    var Result = "";
    Result = $mod.FormatDateTime$1($impl.DateTimeToStrFormat[+ForceTimeIfZero],DateTime,aSettings);
    return Result;
  };
  this.StrToDateTime = function (S) {
    var Result = 0.0;
    Result = $mod.StrToDateTime$1(S,$mod.FormatSettings);
    return Result;
  };
  this.StrToDateTime$1 = function (s, aSettings) {
    var Result = 0.0;
    var TimeStr = "";
    var DateStr = "";
    var PartsFound = 0;
    PartsFound = $impl.SplitDateTimeStr(s,{get: function () {
        return DateStr;
      }, set: function (v) {
        DateStr = v;
      }},{get: function () {
        return TimeStr;
      }, set: function (v) {
        TimeStr = v;
      }},aSettings);
    var $tmp = PartsFound;
    if ($tmp === 0) {
      Result = $mod.StrToDate("")}
     else if ($tmp === 1) {
      if (DateStr.length > 0) {
        Result = $mod.StrToDate$2(DateStr,aSettings.ShortDateFormat,aSettings.DateSeparator)}
       else Result = $mod.StrToTime(TimeStr)}
     else if ($tmp === 2) Result = $mod.ComposeDateTime($mod.StrToDate$2(DateStr,aSettings.ShortDateFormat,aSettings.DateSeparator),$mod.StrToTime(TimeStr));
    return Result;
  };
  this.TryStrToDateTime = function (S, Value) {
    var Result = false;
    Result = $mod.TryStrToDateTime$1(S,Value,$mod.FormatSettings);
    return Result;
  };
  this.TryStrToDateTime$1 = function (S, Value, aSettings) {
    var Result = false;
    var I = 0;
    var dtdate = 0.0;
    var dttime = 0.0;
    Result = false;
    I = pas.System.Pos(aSettings.TimeSeparator,S);
    if (I > 0) {
      while ((I > 0) && (S.charAt(I - 1) !== " ")) I -= 1;
      if (I > 0) {
        if (!$mod.TryStrToDate$1(pas.System.Copy(S,1,I - 1),{get: function () {
            return dtdate;
          }, set: function (v) {
            dtdate = v;
          }},aSettings)) return Result;
        if (!$mod.TryStrToTime$1(pas.System.Copy(S,I + 1,S.length - I),{get: function () {
            return dttime;
          }, set: function (v) {
            dttime = v;
          }},$mod.TFormatSettings.$clone(aSettings))) return Result;
        Value.set($mod.ComposeDateTime(dtdate,dttime));
        Result = true;
      } else Result = $mod.TryStrToTime$1(S,Value,$mod.TFormatSettings.$clone(aSettings));
    } else Result = $mod.TryStrToDate$1(S,Value,aSettings);
    return Result;
  };
  this.StrToDateTimeDef = function (S, Defvalue) {
    var Result = 0.0;
    Result = $mod.StrToDateTimeDef$1(S,Defvalue,$mod.TFormatSettings.$clone($mod.FormatSettings));
    return Result;
  };
  this.StrToDateTimeDef$1 = function (S, Defvalue, aSettings) {
    var Result = 0.0;
    if (!$mod.TryStrToDateTime$1(S,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }},aSettings)) Result = Defvalue;
    return Result;
  };
  this.FormatDateTime = function (FormatStr, DateTime) {
    var Result = "";
    Result = $mod.FormatDateTime$1(FormatStr,DateTime,$mod.FormatSettings);
    return Result;
  };
  this.FormatDateTime$1 = function (FormatStr, DateTime, aSettings) {
    var Result = "";
    function StoreStr(FormatStr, APos, Len) {
      Result = Result + pas.System.Copy(FormatStr,APos,Len);
    };
    function StoreString(AStr) {
      Result = Result + AStr;
    };
    function StoreInt(Value, Digits) {
      var S = "";
      S = $mod.IntToStr(Value);
      while (S.length < Digits) S = "0" + S;
      StoreString(S);
    };
    var Year = 0;
    var Month = 0;
    var Day = 0;
    var DayOfWeek = 0;
    var Hour = 0;
    var Minute = 0;
    var Second = 0;
    var MilliSecond = 0;
    function StoreFormat(FormatStr, Nesting, TimeFlag) {
      var Token = "\x00";
      var lastformattoken = "\x00";
      var prevlasttoken = "\x00";
      var Count = 0;
      var Clock12 = false;
      var tmp = 0;
      var isInterval = false;
      var P = 0;
      var FormatCurrent = 0;
      var FormatEnd = 0;
      if (Nesting > 1) return;
      FormatCurrent = 1;
      FormatEnd = FormatStr.length;
      Clock12 = false;
      isInterval = false;
      P = 1;
      while (P <= FormatEnd) {
        Token = FormatStr.charAt(P - 1);
        var $tmp = Token;
        if (($tmp === "'") || ($tmp === '"')) {
          P += 1;
          while ((P < FormatEnd) && (FormatStr.charAt(P - 1) !== Token)) P += 1;
        } else if (($tmp === "A") || ($tmp === "a")) {
          if (($mod.CompareText(pas.System.Copy(FormatStr,P,3),"A/P") === 0) || ($mod.CompareText(pas.System.Copy(FormatStr,P,4),"AMPM") === 0) || ($mod.CompareText(pas.System.Copy(FormatStr,P,5),"AM/PM") === 0)) {
            Clock12 = true;
            break;
          };
        };
        P += 1;
      };
      Token = "ÿ";
      lastformattoken = " ";
      prevlasttoken = "H";
      while (FormatCurrent <= FormatEnd) {
        Token = $mod.UpperCase(FormatStr.charAt(FormatCurrent - 1)).charAt(0);
        Count = 1;
        P = FormatCurrent + 1;
        var $tmp1 = Token;
        if (($tmp1 === "'") || ($tmp1 === '"')) {
          while ((P < FormatEnd) && (FormatStr.charAt(P - 1) !== Token)) P += 1;
          P += 1;
          Count = P - FormatCurrent;
          StoreStr(FormatStr,FormatCurrent + 1,Count - 2);
        } else if ($tmp1 === "A") {
          if ($mod.CompareText(pas.System.Copy(FormatStr,FormatCurrent,4),"AMPM") === 0) {
            Count = 4;
            if (Hour < 12) {
              StoreString(aSettings.TimeAMString)}
             else StoreString(aSettings.TimePMString);
          } else if ($mod.CompareText(pas.System.Copy(FormatStr,FormatCurrent,5),"AM/PM") === 0) {
            Count = 5;
            if (Hour < 12) {
              StoreStr(FormatStr,FormatCurrent,2)}
             else StoreStr(FormatStr,FormatCurrent + 3,2);
          } else if ($mod.CompareText(pas.System.Copy(FormatStr,FormatCurrent,3),"A/P") === 0) {
            Count = 3;
            if (Hour < 12) {
              StoreStr(FormatStr,FormatCurrent,1)}
             else StoreStr(FormatStr,FormatCurrent + 2,1);
          } else throw $mod.EConvertError.$create("Create$1",["Illegal character in format string"]);
        } else if ($tmp1 === "/") {
          StoreString(aSettings.DateSeparator);
        } else if ($tmp1 === ":") {
          StoreString(aSettings.TimeSeparator)}
         else if (($tmp1 === " ") || ($tmp1 === "C") || ($tmp1 === "D") || ($tmp1 === "H") || ($tmp1 === "M") || ($tmp1 === "N") || ($tmp1 === "S") || ($tmp1 === "T") || ($tmp1 === "Y") || ($tmp1 === "Z") || ($tmp1 === "F")) {
          while ((P <= FormatEnd) && ($mod.UpperCase(FormatStr.charAt(P - 1)) === Token)) P += 1;
          Count = P - FormatCurrent;
          var $tmp2 = Token;
          if ($tmp2 === " ") {
            StoreStr(FormatStr,FormatCurrent,Count)}
           else if ($tmp2 === "Y") {
            if (Count > 2) {
              StoreInt(Year,4)}
             else StoreInt(Year % 100,2);
          } else if ($tmp2 === "M") {
            if (isInterval && ((prevlasttoken === "H") || TimeFlag)) {
              StoreInt(Minute + ((Hour + (pas.System.Trunc(Math.abs(DateTime)) * 24)) * 60),0)}
             else if ((lastformattoken === "H") || TimeFlag) {
              if (Count === 1) {
                StoreInt(Minute,0)}
               else StoreInt(Minute,2);
            } else {
              var $tmp3 = Count;
              if ($tmp3 === 1) {
                StoreInt(Month,0)}
               else if ($tmp3 === 2) {
                StoreInt(Month,2)}
               else if ($tmp3 === 3) {
                StoreString(aSettings.ShortMonthNames[Month - 1])}
               else {
                StoreString(aSettings.LongMonthNames[Month - 1]);
              };
            };
          } else if ($tmp2 === "D") {
            var $tmp4 = Count;
            if ($tmp4 === 1) {
              StoreInt(Day,0)}
             else if ($tmp4 === 2) {
              StoreInt(Day,2)}
             else if ($tmp4 === 3) {
              StoreString(aSettings.ShortDayNames[DayOfWeek - 1])}
             else if ($tmp4 === 4) {
              StoreString(aSettings.LongDayNames[DayOfWeek - 1])}
             else if ($tmp4 === 5) {
              StoreFormat(aSettings.ShortDateFormat,Nesting + 1,false)}
             else {
              StoreFormat(aSettings.LongDateFormat,Nesting + 1,false);
            };
          } else if ($tmp2 === "H") {
            if (isInterval) {
              StoreInt(Hour + (pas.System.Trunc(Math.abs(DateTime)) * 24),0)}
             else if (Clock12) {
              tmp = Hour % 12;
              if (tmp === 0) tmp = 12;
              if (Count === 1) {
                StoreInt(tmp,0)}
               else StoreInt(tmp,2);
            } else {
              if (Count === 1) {
                StoreInt(Hour,0)}
               else StoreInt(Hour,2);
            }}
           else if ($tmp2 === "N") {
            if (isInterval) {
              StoreInt(Minute + ((Hour + (pas.System.Trunc(Math.abs(DateTime)) * 24)) * 60),0)}
             else if (Count === 1) {
              StoreInt(Minute,0)}
             else StoreInt(Minute,2)}
           else if ($tmp2 === "S") {
            if (isInterval) {
              StoreInt(Second + ((Minute + ((Hour + (pas.System.Trunc(Math.abs(DateTime)) * 24)) * 60)) * 60),0)}
             else if (Count === 1) {
              StoreInt(Second,0)}
             else StoreInt(Second,2)}
           else if ($tmp2 === "Z") {
            if (Count === 1) {
              StoreInt(MilliSecond,0)}
             else StoreInt(MilliSecond,3)}
           else if ($tmp2 === "T") {
            if (Count === 1) {
              StoreFormat(aSettings.ShortTimeFormat,Nesting + 1,true)}
             else StoreFormat(aSettings.LongTimeFormat,Nesting + 1,true)}
           else if ($tmp2 === "C") {
            StoreFormat(aSettings.ShortDateFormat,Nesting + 1,false);
            if ((Hour !== 0) || (Minute !== 0) || (Second !== 0)) {
              StoreString(" ");
              StoreFormat(aSettings.LongTimeFormat,Nesting + 1,true);
            };
          } else if ($tmp2 === "F") {
            StoreFormat(aSettings.ShortDateFormat,Nesting + 1,false);
            StoreString(" ");
            StoreFormat(aSettings.LongTimeFormat,Nesting + 1,true);
          };
          prevlasttoken = lastformattoken;
          lastformattoken = Token;
        } else {
          StoreString(Token);
        };
        FormatCurrent += Count;
      };
    };
    $mod.DecodeDateFully(DateTime,{get: function () {
        return Year;
      }, set: function (v) {
        Year = v;
      }},{get: function () {
        return Month;
      }, set: function (v) {
        Month = v;
      }},{get: function () {
        return Day;
      }, set: function (v) {
        Day = v;
      }},{get: function () {
        return DayOfWeek;
      }, set: function (v) {
        DayOfWeek = v;
      }});
    $mod.DecodeTime(DateTime,{get: function () {
        return Hour;
      }, set: function (v) {
        Hour = v;
      }},{get: function () {
        return Minute;
      }, set: function (v) {
        Minute = v;
      }},{get: function () {
        return Second;
      }, set: function (v) {
        Second = v;
      }},{get: function () {
        return MilliSecond;
      }, set: function (v) {
        MilliSecond = v;
      }});
    if (FormatStr !== "") {
      StoreFormat(FormatStr,0,false)}
     else StoreFormat("C",0,false);
    return Result;
  };
  this.CurrencyFormat = 0;
  this.NegCurrFormat = 0;
  this.CurrencyDecimals = 0;
  this.CurrencyString = "";
  this.FloattoCurr = function (Value) {
    var Result = 0;
    if (!$mod.TryFloatToCurr(Value,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }})) throw $mod.EConvertError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SInvalidCurrency"),pas.System.VarRecs(18,$mod.FloatToStr(Value))]);
    return Result;
  };
  this.TryFloatToCurr = function (Value, AResult) {
    var Result = false;
    Result = ((Value * 10000) >= $mod.MinCurrency) && ((Value * 10000) <= $mod.MaxCurrency);
    if (Result) AResult.set(rtl.trunc(Value * 10000));
    return Result;
  };
  this.TryFloatToDateTime = function (Value, AResult) {
    var Result = false;
    Result = !((Value < $mod.MinDateTime) || (Value >= (pas.System.Int($mod.MaxDateTime) + 1.0)));
    if (Result) AResult.set(Value);
    return Result;
  };
  this.CurrToStr = function (Value) {
    var Result = "";
    Result = $mod.FloatToStrF$1(Value / 10000,$mod.TFloatFormat.ffGeneral,-1,0,$mod.FormatSettings);
    return Result;
  };
  this.CurrToStr$1 = function (Value, aSettings) {
    var Result = "";
    Result = $mod.FloatToStrF$1(Value / 10000,$mod.TFloatFormat.ffGeneral,-1,0,aSettings);
    return Result;
  };
  this.StrToCurr = function (S) {
    var Result = 0;
    if (!$mod.TryStrToCurr(S,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }})) throw $mod.EConvertError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SInvalidCurrency"),pas.System.VarRecs(18,S)]);
    return Result;
  };
  this.StrToCurr$1 = function (S, aSettings) {
    var Result = 0;
    if (!$mod.TryStrToCurr$1(S,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }},aSettings)) throw $mod.EConvertError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SInvalidCurrency"),pas.System.VarRecs(18,S)]);
    return Result;
  };
  this.TryStrToCurr = function (S, Value) {
    var Result = false;
    var D = 0.0;
    Result = $mod.TryStrToFloat$3(S,{get: function () {
        return D;
      }, set: function (v) {
        D = v;
      }},$mod.FormatSettings);
    if (Result) Value.set(rtl.trunc(D * 10000));
    return Result;
  };
  this.TryStrToCurr$1 = function (S, Value, aSettings) {
    var Result = false;
    var D = 0.0;
    Result = $mod.TryStrToFloat$3(S,{get: function () {
        return D;
      }, set: function (v) {
        D = v;
      }},aSettings);
    if (Result) Value.set(rtl.trunc(D * 10000));
    return Result;
  };
  this.StrToCurrDef = function (S, Default) {
    var Result = 0;
    var R = 0;
    if ($mod.TryStrToCurr$1(S,{get: function () {
        return R;
      }, set: function (v) {
        R = v;
      }},$mod.FormatSettings)) {
      Result = R}
     else Result = Default;
    return Result;
  };
  this.StrToCurrDef$1 = function (S, Default, aSettings) {
    var Result = 0;
    var R = 0;
    if ($mod.TryStrToCurr$1(S,{get: function () {
        return R;
      }, set: function (v) {
        R = v;
      }},aSettings)) {
      Result = R}
     else Result = Default;
    return Result;
  };
  this.$rtti.$DynArray("TPathStrArray",{eltype: rtl.string});
  this.ChangeFileExt = function (FileName, Extension) {
    var Result = "";
    var i = 0;
    var EndSep = {};
    var SOF = false;
    i = FileName.length;
    EndSep = rtl.unionSet(rtl.unionSet(pas.System.AllowDirectorySeparators,pas.System.AllowDriveSeparators),rtl.createSet(pas.System.ExtensionSeparator.charCodeAt()));
    while ((i > 0) && !(FileName.charCodeAt(i - 1) in EndSep)) i -= 1;
    if ((i === 0) || (FileName.charAt(i - 1) !== pas.System.ExtensionSeparator)) {
      i = FileName.length + 1}
     else {
      SOF = (i === 1) || (FileName.charCodeAt(i - 1 - 1) in pas.System.AllowDirectorySeparators);
      if (SOF && !pas.System.FirstDotAtFileNameStartIsExtension) i = FileName.length + 1;
    };
    Result = pas.System.Copy(FileName,1,i - 1) + Extension;
    return Result;
  };
  this.ExtractFilePath = function (FileName) {
    var Result = "";
    var i = 0;
    var EndSep = {};
    i = FileName.length;
    EndSep = rtl.unionSet(pas.System.AllowDirectorySeparators,pas.System.AllowDriveSeparators);
    while ((i > 0) && !$mod.CharInSet$1(FileName.charAt(i - 1),EndSep)) i -= 1;
    if (i > 0) {
      Result = pas.System.Copy(FileName,1,i)}
     else Result = "";
    return Result;
  };
  this.ExtractFileDrive = function (FileName) {
    var Result = "";
    var i = 0;
    var l = 0;
    Result = "";
    l = FileName.length;
    if (l < 2) return Result;
    if ($mod.CharInSet$1(FileName.charAt(1),pas.System.AllowDriveSeparators)) {
      Result = pas.System.Copy(FileName,1,2)}
     else if ($mod.CharInSet$1(FileName.charAt(0),pas.System.AllowDirectorySeparators) && $mod.CharInSet$1(FileName.charAt(1),pas.System.AllowDirectorySeparators)) {
      i = 2;
      while ((i < l) && !$mod.CharInSet$1(FileName.charAt((i + 1) - 1),pas.System.AllowDirectorySeparators)) i += 1;
      i += 1;
      while ((i < l) && !$mod.CharInSet$1(FileName.charAt((i + 1) - 1),pas.System.AllowDirectorySeparators)) i += 1;
      Result = pas.System.Copy(FileName,1,i);
    };
    return Result;
  };
  this.ExtractFileName = function (FileName) {
    var Result = "";
    var i = 0;
    var EndSep = {};
    i = FileName.length;
    EndSep = rtl.unionSet(pas.System.AllowDirectorySeparators,pas.System.AllowDriveSeparators);
    while ((i > 0) && !$mod.CharInSet$1(FileName.charAt(i - 1),EndSep)) i -= 1;
    Result = pas.System.Copy(FileName,i + 1,2147483647);
    return Result;
  };
  this.ExtractFileExt = function (FileName) {
    var Result = "";
    var i = 0;
    var EndSep = {};
    var SOF = false;
    Result = "";
    i = FileName.length;
    EndSep = rtl.unionSet(rtl.unionSet(pas.System.AllowDirectorySeparators,pas.System.AllowDriveSeparators),rtl.createSet(pas.System.ExtensionSeparator.charCodeAt()));
    while ((i > 0) && !$mod.CharInSet$1(FileName.charAt(i - 1),EndSep)) i -= 1;
    if ((i > 0) && (FileName.charAt(i - 1) === pas.System.ExtensionSeparator)) {
      SOF = (i === 1) || (FileName.charCodeAt(i - 1 - 1) in pas.System.AllowDirectorySeparators);
      if (!SOF || pas.System.FirstDotAtFileNameStartIsExtension) Result = pas.System.Copy(FileName,i,2147483647);
    } else Result = "";
    return Result;
  };
  this.ExtractFileDir = function (FileName) {
    var Result = "";
    var i = 0;
    var EndSep = {};
    i = FileName.length;
    EndSep = rtl.unionSet(pas.System.AllowDirectorySeparators,pas.System.AllowDriveSeparators);
    while ((i > 0) && !$mod.CharInSet$1(FileName.charAt(i - 1),EndSep)) i -= 1;
    if ((i > 1) && $mod.CharInSet$1(FileName.charAt(i - 1),pas.System.AllowDirectorySeparators) && !$mod.CharInSet$1(FileName.charAt(i - 1 - 1),EndSep)) i -= 1;
    Result = pas.System.Copy(FileName,1,i);
    return Result;
  };
  this.ExtractRelativepath = function (BaseName, DestName) {
    var Result = "";
    var OneLevelBack = "";
    var Source = "";
    var Dest = "";
    var Sc = 0;
    var Dc = 0;
    var I = 0;
    var J = 0;
    var SD = [];
    var DD = [];
    OneLevelBack = ".." + pas.System.PathDelim;
    if ($mod.UpperCase($mod.ExtractFileDrive(BaseName)) !== $mod.UpperCase($mod.ExtractFileDrive(DestName))) {
      Result = DestName;
      return Result;
    };
    Source = $mod.ExcludeTrailingPathDelimiter($mod.ExtractFilePath(BaseName));
    Dest = $mod.ExcludeTrailingPathDelimiter($mod.ExtractFilePath(DestName));
    SD = $mod.GetDirs(Source);
    Sc = rtl.length(SD);
    DD = $mod.GetDirs(Dest);
    Dc = rtl.length(SD);
    I = 0;
    while ((I < Dc) && (I < Sc)) {
      if ($mod.SameText(DD[I],SD[I])) {
        I += 1}
       else break;
    };
    Result = "";
    for (var $l = I, $end = Sc; $l <= $end; $l++) {
      J = $l;
      Result = Result + OneLevelBack;
    };
    for (var $l1 = I, $end1 = Dc; $l1 <= $end1; $l1++) {
      J = $l1;
      Result = Result + DD[J] + pas.System.PathDelim;
    };
    Result = Result + $mod.ExtractFileName(DestName);
    return Result;
  };
  this.IncludeTrailingPathDelimiter = function (Path) {
    var Result = "";
    var l = 0;
    Result = Path;
    l = Result.length;
    if ((l === 0) || !$mod.CharInSet$1(Result.charAt(l - 1),pas.System.AllowDirectorySeparators)) Result = Result + pas.System.PathDelim;
    return Result;
  };
  this.ExcludeTrailingPathDelimiter = function (Path) {
    var Result = "";
    var L = 0;
    L = Path.length;
    if ((L > 0) && $mod.CharInSet$1(Path.charAt(L - 1),pas.System.AllowDirectorySeparators)) L -= 1;
    Result = pas.System.Copy(Path,1,L);
    return Result;
  };
  this.IncludeLeadingPathDelimiter = function (Path) {
    var Result = "";
    var l = 0;
    Result = Path;
    l = Result.length;
    if ((l === 0) || !$mod.CharInSet$1(Result.charAt(0),pas.System.AllowDirectorySeparators)) Result = pas.System.PathDelim + Result;
    return Result;
  };
  this.ExcludeLeadingPathDelimiter = function (Path) {
    var Result = "";
    var L = 0;
    Result = Path;
    L = Result.length;
    if ((L > 0) && $mod.CharInSet$1(Result.charAt(0),pas.System.AllowDirectorySeparators)) pas.System.Delete({get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }},1,1);
    return Result;
  };
  this.IsPathDelimiter = function (Path, Index) {
    var Result = false;
    Result = (Index > 0) && (Index <= Path.length) && $mod.CharInSet$1(Path.charAt(Index - 1),pas.System.AllowDirectorySeparators);
    return Result;
  };
  this.SetDirSeparators = function (FileName) {
    var Result = "";
    var I = 0;
    Result = FileName;
    for (var $l = 1, $end = Result.length; $l <= $end; $l++) {
      I = $l;
      if ($mod.CharInSet$1(Result.charAt(I - 1),pas.System.AllowDirectorySeparators)) Result = rtl.setCharAt(Result,I - 1,pas.System.PathDelim);
    };
    return Result;
  };
  this.GetDirs = function (DirName) {
    var Result = [];
    var I = 0;
    var J = 0;
    var L = 0;
    var D = "";
    I = 1;
    J = 0;
    L = 0;
    Result = rtl.arraySetLength(Result,"",DirName.length);
    while (I <= DirName.length) {
      if ($mod.CharInSet$1(DirName.charAt(I - 1),pas.System.AllowDirectorySeparators)) {
        D = pas.System.Copy(DirName,J + 1,J - I);
        if (D !== "") {
          Result[L] = D;
          L += 1;
        };
        J = I;
      };
      I += 1;
    };
    Result = rtl.arraySetLength(Result,"",L);
    return Result;
  };
  this.ConcatPaths = function (Paths) {
    var Result = "";
    var I = 0;
    if (rtl.length(Paths) > 0) {
      Result = Paths[0];
      for (var $l = 1, $end = rtl.length(Paths) - 1; $l <= $end; $l++) {
        I = $l;
        Result = $mod.IncludeTrailingPathDelimiter(Result) + $mod.ExcludeLeadingPathDelimiter(Paths[I]);
      };
    } else Result = "";
    return Result;
  };
  this.GUID_NULL = pas.System.TGuid.$clone({D1: 0x00000000, D2: 0x0000, D3: 0x0000, D4: [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]});
  this.Supports = function (Instance, AClass, Obj) {
    var Result = false;
    Result = (Instance !== null) && (Instance.QueryInterface(pas.System.IObjectInstance,Obj) === 0) && Obj.get().$class.InheritsFrom(AClass);
    return Result;
  };
  this.Supports$1 = function (Instance, IID, Intf) {
    var Result = false;
    Result = (Instance !== null) && (Instance.QueryInterface(IID,Intf) === 0);
    return Result;
  };
  this.Supports$2 = function (Instance, IID, Intf) {
    var Result = false;
    Result = (Instance !== null) && Instance.GetInterface(IID,Intf);
    return Result;
  };
  this.Supports$3 = function (Instance, IID, Intf) {
    var Result = false;
    Result = (Instance !== null) && Instance.GetInterfaceByStr(IID,Intf);
    return Result;
  };
  this.Supports$4 = function (Instance, AClass) {
    var Result = false;
    var Temp = null;
    Result = $mod.Supports(Instance,AClass,{get: function () {
        return Temp;
      }, set: function (v) {
        Temp = v;
      }});
    return Result;
  };
  this.Supports$5 = function (Instance, IID) {
    var Result = false;
    var Temp = null;
    try {
      Result = $mod.Supports$1(Instance,IID,{get: function () {
          return Temp;
        }, set: function (v) {
          Temp = v;
        }});
    } finally {
      rtl._Release(Temp);
    };
    return Result;
  };
  this.Supports$6 = function (Instance, IID) {
    var Result = false;
    var Temp = null;
    Result = $mod.Supports$2(Instance,IID,{get: function () {
        return Temp;
      }, set: function (v) {
        Temp = v;
      }});
    if (Temp && Temp.$kind==='com') Temp._Release();
    return Result;
  };
  this.Supports$7 = function (Instance, IID) {
    var Result = false;
    var Temp = null;
    Result = $mod.Supports$3(Instance,IID,{get: function () {
        return Temp;
      }, set: function (v) {
        Temp = v;
      }});
    if (Temp && Temp.$kind==='com') Temp._Release();
    return Result;
  };
  this.Supports$8 = function (AClass, IID) {
    var Result = false;
    var maps = undefined;
    if (AClass === null) return false;
    maps = AClass["$intfmaps"];
    if (!maps) return false;
    if (maps[$mod.GUIDToString(IID)]) return true;
    Result = false;
    return Result;
  };
  this.Supports$9 = function (AClass, IID) {
    var Result = false;
    var maps = undefined;
    if (AClass === null) return false;
    maps = AClass["$intfmaps"];
    if (!maps) return false;
    if (maps[$mod.UpperCase(IID)]) return true;
    Result = false;
    return Result;
  };
  this.TryStringToGUID = function (s, Guid) {
    var Result = false;
    var re = null;
    if (s.length !== 38) return false;
    re = new RegExp("^\\{[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\\}$");
    Result = re.test(s);
    if (!Result) {
      Guid.D1 = 0;
      return Result;
    };
    rtl.strToGUIDR(s,Guid);
    Result = true;
    return Result;
  };
  this.StringToGUID = function (S) {
    var Result = pas.System.TGuid.$new();
    if (!$mod.TryStringToGUID(S,Result)) throw $mod.EConvertError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SInvalidGUID"),pas.System.VarRecs(18,S)]);
    return Result;
  };
  this.GUIDToString = function (guid) {
    var Result = "";
    Result = rtl.guidrToStr(guid);
    return Result;
  };
  this.IsEqualGUID = function (guid1, guid2) {
    var Result = false;
    var i = 0;
    if ((guid1.D1 !== guid2.D1) || (guid1.D2 !== guid2.D2) || (guid1.D3 !== guid2.D3)) return false;
    for (i = 0; i <= 7; i++) if (guid1.D4[i] !== guid2.D4[i]) return false;
    Result = true;
    return Result;
  };
  this.GuidCase = function (guid, List) {
    var Result = 0;
    for (var $l = rtl.length(List) - 1; $l >= 0; $l--) {
      Result = $l;
      if ($mod.IsEqualGUID(guid,List[Result])) return Result;
    };
    Result = -1;
    return Result;
  };
  this.CreateGUID = function (GUID) {
    var Result = 0;
    function R(B) {
      var Result = 0;
      var v = 0;
      v = pas.System.Random(256);
      while (B > 1) {
        v = (v * 256) + pas.System.Random(256);
        B -= 1;
      };
      Result = v;
      return Result;
    };
    var I = 0;
    Result = 0;
    GUID.D1 = R(4);
    GUID.D2 = R(2);
    GUID.D3 = R(2);
    for (I = 0; I <= 7; I++) GUID.D4[I] = R(1);
    return Result;
  };
  this.EncodeHTMLEntities = function (S) {
    var Result = "";
    Result = "";
    if (S === "") return Result;
    return S.replace(/[\u00A0-\u9999<>\&]/gim, function(i) {
      return '&#'+i.charCodeAt(0)+';';
    });
    return Result;
  };
  this.$rtti.$DynArray("TCharArray",{eltype: rtl.char});
  this.$rtti.$Int("TByteBitIndex",{minvalue: 0, maxvalue: 7, ordtype: 1});
  this.$rtti.$Int("TShortIntBitIndex",{minvalue: 0, maxvalue: 7, ordtype: 1});
  this.$rtti.$Int("TWordBitIndex",{minvalue: 0, maxvalue: 15, ordtype: 1});
  this.$rtti.$Int("TSmallIntBitIndex",{minvalue: 0, maxvalue: 15, ordtype: 1});
  this.$rtti.$Int("TCardinalBitIndex",{minvalue: 0, maxvalue: 31, ordtype: 1});
  this.$rtti.$Int("TIntegerBitIndex",{minvalue: 0, maxvalue: 31, ordtype: 1});
  this.$rtti.$Int("TQwordBitIndex",{minvalue: 0, maxvalue: 52, ordtype: 1});
  this.$rtti.$Int("TInt64BitIndex",{minvalue: 0, maxvalue: 52, ordtype: 1});
  this.$rtti.$Int("TNativeIntBitIndex",{minvalue: 0, maxvalue: 52, ordtype: 1});
  this.$rtti.$Int("TNativeUIntBitIndex",{minvalue: 0, maxvalue: 52, ordtype: 1});
  this.CPUEndian = this.TEndian.Big;
  rtl.createHelper(this,"TGuidHelper",null,function () {
    this.Create = function (Src, BigEndian) {
      var Result = pas.System.TGuid.$new();
      Result.$assign(Src);
      if (!BigEndian) {
        Result.D1 = $mod.SwapEndian$1(Result.D1);
        Result.D2 = $mod.SwapEndian(Result.D2);
        Result.D3 = $mod.SwapEndian(Result.D3);
      };
      return Result;
    };
    this.Create$1 = function (Buf, AStartIndex, BigEndian) {
      var Result = pas.System.TGuid.$new();
      var A = 0;
      var B = 0;
      var C = 0;
      var V = null;
      V = new DataView(Buf);
      if (BigEndian) {
        A = V.getUint32(AStartIndex);
        B = V.getUint16(AStartIndex + 4);
        C = V.getUint16(AStartIndex + 6);
      } else {
        A = $mod.SwapEndian$1(V.getUint32(AStartIndex));
        B = $mod.SwapEndian(V.getUint16(AStartIndex + 4));
        C = $mod.SwapEndian(V.getUint16(AStartIndex + 6));
      };
      Result.$assign($mod.TGuidHelper.Create$7(A,B,C,V.getUint8(AStartIndex + 8),V.getUint8(AStartIndex + 9),V.getUint8(AStartIndex + 10),V.getUint8(AStartIndex + 11),V.getUint8(AStartIndex + 12),V.getUint8(AStartIndex + 13),V.getUint8(AStartIndex + 14),V.getUint8(AStartIndex + 15)));
      return Result;
    };
    this.Create$2 = function (Data, AStartIndex, BigEndian) {
      var Result = pas.System.TGuid.$new();
      var D = null;
      if ((rtl.length(Data) - AStartIndex) < 16) throw $mod.EArgumentException.$create("CreateFmt",["The length of a GUID array must be at least %d",[]]);
      D = Uint8Array.from(Data);
      Result.$assign($mod.TGuidHelper.Create$1(D.buffer,AStartIndex,BigEndian));
      return Result;
    };
    this.Create$3 = function (B, DataEndian) {
      var Result = pas.System.TGuid.$new();
      Result.$assign($mod.TGuidHelper.Create$4(B,0,DataEndian));
      return Result;
    };
    this.Create$4 = function (B, AStartIndex, DataEndian) {
      var Result = pas.System.TGuid.$new();
      if ((rtl.length(B) - AStartIndex) < 16) throw $mod.EArgumentException.$create("CreateFmt",["The length of a GUID array must be at least %d",[]]);
      Result.$assign($mod.TGuidHelper.Create$2(B,AStartIndex,DataEndian === $mod.TEndian.Big));
      return Result;
    };
    this.Create$5 = function (S) {
      var Result = pas.System.TGuid.$new();
      Result.$assign($mod.StringToGUID(S));
      return Result;
    };
    this.Create$6 = function (A, B, C, D) {
      var Result = pas.System.TGuid.$new();
      if (rtl.length(D) !== 8) throw $mod.EArgumentException.$create("CreateFmt",["The length of a GUID array must be %d",[]]);
      Result.$assign($mod.TGuidHelper.Create$7(A >>> 0,B & 65535,C & 65535,D[0],D[1],D[2],D[3],D[4],D[5],D[6],D[7]));
      return Result;
    };
    this.Create$7 = function (A, B, C, D, E, F, G, H, I, J, K) {
      var Result = pas.System.TGuid.$new();
      Result.D1 = A;
      Result.D2 = B;
      Result.D3 = C;
      Result.D4[0] = D;
      Result.D4[1] = E;
      Result.D4[2] = F;
      Result.D4[3] = G;
      Result.D4[4] = H;
      Result.D4[5] = I;
      Result.D4[6] = J;
      Result.D4[7] = K;
      return Result;
    };
    this.NewGuid = function () {
      var Result = pas.System.TGuid.$new();
      $mod.CreateGUID(Result);
      return Result;
    };
    this.Empty = function () {
      var Result = pas.System.TGuid.$new();
      Result.$assign(pas.System.TGuid.$new());
      return Result;
    };
    this.IsEmpty = function () {
      var Result = false;
      var lCount = 0;
      Result = (this.D1 === 0) && (this.D2 === 0) && (this.D3 === 0);
      if (!Result) return Result;
      for (lCount = 0; lCount <= 7; lCount++) Result = Result && (this.D4[lCount] === 0);
      return Result;
    };
    this.ToByteArray = function (DataEndian) {
      var Result = [];
      var D = null;
      var V = null;
      var I = 0;
      D = new Uint8Array(16);
      V = new DataView(D.buffer);
      V.setUint32(0,this.D1,DataEndian === $mod.TEndian.Little);
      V.setUint16(4,this.D2,DataEndian === $mod.TEndian.Little);
      V.setUint16(6,this.D3,DataEndian === $mod.TEndian.Little);
      for (I = 0; I <= 7; I++) V.setUint8(8 + I,this.D4[I]);
      Result = rtl.arraySetLength(Result,0,16);
      for (I = 0; I <= 15; I++) Result[I] = V.getUint8(I);
      return Result;
    };
    this.ToString = function (SkipBrackets) {
      var Result = "";
      Result = $mod.GUIDToString(this);
      if (SkipBrackets) Result = pas.System.Copy(Result,2,Result.length - 2);
      return Result;
    };
  });
  this.TStringSplitOptions = {"0": "None", None: 0, "1": "ExcludeEmpty", ExcludeEmpty: 1};
  this.$rtti.$Enum("TStringSplitOptions",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TStringSplitOptions});
  rtl.createHelper(this,"TStringHelper",null,function () {
    this.Empty = "";
    this.GetChar = function (AIndex) {
      var Result = "\x00";
      Result = this.get().charAt((AIndex + 1) - 1);
      return Result;
    };
    this.GetLength = function () {
      var Result = 0;
      Result = this.get().length;
      return Result;
    };
    this.Set_Length = function (AValue) {
      this.set(rtl.strSetLength(this.get(),AValue));
    };
    this.Compare = function (A, B) {
      var Result = 0;
      Result = $mod.TStringHelper.Compare$5(A,0,B,0,B.length,{});
      return Result;
    };
    this.Compare$1 = function (A, B, IgnoreCase) {
      var Result = 0;
      if (IgnoreCase) {
        Result = $mod.TStringHelper.Compare$2(A,B,rtl.createSet(pas.System.TCompareOption.coIgnoreCase))}
       else Result = $mod.TStringHelper.Compare$2(A,B,{});
      return Result;
    };
    this.Compare$2 = function (A, B, Options) {
      var Result = 0;
      Result = $mod.TStringHelper.Compare$5(A,0,B,0,B.length,rtl.refSet(Options));
      return Result;
    };
    this.Compare$3 = function (A, IndexA, B, IndexB, ALen) {
      var Result = 0;
      Result = $mod.TStringHelper.Compare$5(A,IndexA,B,IndexB,ALen,{});
      return Result;
    };
    this.Compare$4 = function (A, IndexA, B, IndexB, ALen, IgnoreCase) {
      var Result = 0;
      if (IgnoreCase) {
        Result = $mod.TStringHelper.Compare$5(A,IndexA,B,IndexB,ALen,rtl.createSet(pas.System.TCompareOption.coIgnoreCase))}
       else Result = $mod.TStringHelper.Compare$5(A,IndexA,B,IndexB,ALen,{});
      return Result;
    };
    this.Compare$5 = function (A, IndexA, B, IndexB, ALen, Options) {
      var Result = 0;
      var AL = "";
      var BL = "";
      var lOptions = pas.JS.TLocaleCompareOptions.$new();
      AL = pas.System.Copy(A,IndexA + 1,ALen);
      BL = pas.System.Copy(B,IndexB + 1,ALen);
      if (pas.System.TCompareOption.coDigitAsNumbers in Options) lOptions.numeric = true;
      if (pas.System.TCompareOption.coIgnoreCase in Options) {
        Result = $mod.TStringHelper.UpperCase(AL).localeCompare($mod.TStringHelper.UpperCase(BL),"default",pas.JS.TLocaleCompareOptions.$clone(lOptions))}
       else Result = AL.localeCompare(BL,"default",pas.JS.TLocaleCompareOptions.$clone(lOptions));
      return Result;
    };
    this.CompareOrdinal = function (A, B) {
      var Result = 0;
      var L = 0;
      L = B.length;
      if (L > A.length) L = A.length;
      Result = $mod.TStringHelper.CompareOrdinal$1(A,0,B,0,L);
      return Result;
    };
    this.CompareOrdinal$1 = function (A, IndexA, B, IndexB, ALen) {
      var Result = 0;
      var I = 0;
      var M = 0;
      M = A.length - IndexA;
      if (M > (B.length - IndexB)) M = B.length - IndexB;
      if (M > ALen) M = ALen;
      I = 0;
      Result = 0;
      while ((Result === 0) && (I < M)) {
        Result = A.charCodeAt(IndexA + I) - B.charCodeAt(IndexB + I);
        I += 1;
      };
      return Result;
    };
    this.CompareText = function (A, B) {
      var Result = 0;
      Result = $mod.CompareText(A,B);
      return Result;
    };
    this.Copy = function (Str) {
      var Result = "";
      Result = Str;
      return Result;
    };
    this.Create = function (AChar, ACount) {
      var Result = "";
      Result = pas.System.StringOfChar(AChar,ACount);
      return Result;
    };
    this.Create$1 = function (AValue) {
      var Result = "";
      Result = $mod.TStringHelper.Create$2(AValue,0,rtl.length(AValue));
      return Result;
    };
    this.Create$2 = function (AValue, StartIndex, ALen) {
      var Result = "";
      var I = 0;
      Result = rtl.strSetLength(Result,ALen);
      for (var $l = 1, $end = ALen; $l <= $end; $l++) {
        I = $l;
        Result = rtl.setCharAt(Result,I - 1,AValue[(StartIndex + I) - 1]);
      };
      return Result;
    };
    this.EndsText = function (ASubText, AText) {
      var Result = false;
      Result = (ASubText !== "") && ($mod.CompareText(pas.System.Copy(AText,(AText.length - ASubText.length) + 1,ASubText.length),ASubText) === 0);
      return Result;
    };
    this.Equals = function (a, b) {
      var Result = false;
      Result = a === b;
      return Result;
    };
    this.Format = function (AFormat, args) {
      var Result = "";
      Result = $mod.Format(AFormat,args);
      return Result;
    };
    this.IsNullOrEmpty = function (AValue) {
      var Result = false;
      Result = AValue.length === 0;
      return Result;
    };
    this.IsNullOrWhiteSpace = function (AValue) {
      var Result = false;
      Result = $mod.Trim(AValue).length === 0;
      return Result;
    };
    this.Join = function (Separator, Values) {
      var Result = "";
      Result = Values.join(Separator);
      return Result;
    };
    this.Join$1 = function (Separator, Values) {
      var Result = "";
      Result = Values.join(Separator);
      return Result;
    };
    this.Join$2 = function (Separator, Values, StartIndex, ACount) {
      var Result = "";
      var VLen = 0;
      VLen = rtl.length(Values) - 1;
      if ((ACount < 0) || ((StartIndex > 0) && (StartIndex > VLen))) throw $mod.ERangeError.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SRangeError")]);
      if ((ACount === 0) || (VLen < 0)) {
        Result = ""}
       else Result = Values.slice(StartIndex,StartIndex + ACount).join(Separator);
      return Result;
    };
    this.LowerCase = function (S) {
      var Result = "";
      Result = $mod.LowerCase(S);
      return Result;
    };
    this.Parse = function (AValue) {
      var Result = "";
      Result = $mod.BoolToStr(AValue,false);
      return Result;
    };
    this.Parse$1 = function (AValue) {
      var Result = "";
      Result = $mod.FloatToStr(AValue);
      return Result;
    };
    this.Parse$2 = function (AValue) {
      var Result = "";
      Result = $mod.IntToStr(AValue);
      return Result;
    };
    this.Parse$3 = function (AValue) {
      var Result = "";
      Result = $mod.IntToStr(AValue);
      return Result;
    };
    this.ToBoolean = function (S) {
      var Result = false;
      Result = $mod.StrToBool(S);
      return Result;
    };
    this.ToDouble = function (S) {
      var Result = 0.0;
      Result = $mod.StrToFloat(S);
      return Result;
    };
    this.ToExtended = function (S) {
      var Result = 0.0;
      Result = $mod.StrToFloat(S);
      return Result;
    };
    this.ToNativeInt = function (S) {
      var Result = 0;
      Result = $mod.StrToInt64(S);
      return Result;
    };
    this.ToInteger = function (S) {
      var Result = 0;
      Result = $mod.StrToInt(S);
      return Result;
    };
    this.UpperCase = function (S) {
      var Result = "";
      Result = $mod.UpperCase(S);
      return Result;
    };
    this.ToCharArray = function (S) {
      var Result = [];
      var I = 0;
      var Len = 0;
      Len = S.length;
      Result = rtl.arraySetLength(Result,"\x00",Len);
      for (var $l = 1, $end = Len; $l <= $end; $l++) {
        I = $l;
        Result[I - 1] = S.charAt(I - 1);
      };
      return Result;
    };
    this.CompareTo = function (B) {
      var Result = 0;
      Result = $mod.TStringHelper.Compare(this.get(),B);
      return Result;
    };
    this.Contains = function (AValue) {
      var Result = false;
      Result = (AValue !== "") && (pas.System.Pos(AValue,this.get()) > 0);
      return Result;
    };
    this.CountChar = function (C) {
      var Result = 0;
      var S = "\x00";
      Result = 0;
      for (var $in = this.get(), $l = 0, $end = $in.length - 1; $l <= $end; $l++) {
        S = $in.charAt($l);
        if (S === C) Result += 1;
      };
      return Result;
    };
    this.DeQuotedString = function () {
      var Result = "";
      Result = $mod.TStringHelper.DeQuotedString$1.call(this,"'");
      return Result;
    };
    this.DeQuotedString$1 = function (AQuoteChar) {
      var Result = "";
      var L = 0;
      var I = 0;
      var Res = [];
      var PS = 0;
      var PD = 0;
      var IsQuote = false;
      L = this.get().length;
      if ((L < 2) || !((this.get().charAt(0) === AQuoteChar) && (this.get().charAt(L - 1) === AQuoteChar))) return this.get();
      Res = rtl.arraySetLength(Res,"\x00",L);
      IsQuote = false;
      PS = 2;
      PD = 1;
      for (var $l = 2, $end = L - 1; $l <= $end; $l++) {
        I = $l;
        if (this.get().charAt(PS - 1) === AQuoteChar) {
          IsQuote = !IsQuote;
          if (!IsQuote) {
            Result = rtl.setCharAt(Result,PD - 1,this.get().charAt(PS - 1));
            PD += 1;
          };
        } else {
          if (IsQuote) IsQuote = false;
          Result = rtl.setCharAt(Result,PD - 1,this.get().charAt(PS - 1));
          PD += 1;
        };
        PS += 1;
      };
      Result = rtl.strSetLength(Result,PD - 1);
      return Result;
    };
    this.EndsWith = function (AValue) {
      var Result = false;
      Result = $mod.TStringHelper.EndsWith$1.call(this,AValue,false);
      return Result;
    };
    this.EndsWith$1 = function (AValue, IgnoreCase) {
      var Result = false;
      var L = 0;
      var S = "";
      L = AValue.length;
      Result = L === 0;
      if (!Result) {
        S = pas.System.Copy(this.get(),($mod.TStringHelper.GetLength.call(this) - L) + 1,L);
        Result = S.length === L;
        if (Result) if (IgnoreCase) {
          Result = $mod.TStringHelper.CompareText(S,AValue) === 0}
         else Result = S === AValue;
      };
      return Result;
    };
    this.Equals$1 = function (AValue) {
      var Result = false;
      Result = this.get() === AValue;
      return Result;
    };
    this.Format$1 = function (args) {
      var Result = "";
      Result = $mod.Format(this.get(),args);
      return Result;
    };
    this.GetHashCode = function () {
      var Result = 0;
      var P = 0;
      var pmax = 0;
      var L = null;
      L = this.get();
      Result = 0;
      P = 1;
      pmax = $mod.TStringHelper.GetLength.call(this) + 1;
      while (P < pmax) {
        Result = rtl.xor(((Result << 5) - Result) >>> 0,L.charCodeAt(P));
        P += 1;
      };
      return Result;
    };
    this.IndexOf = function (AValue) {
      var Result = 0;
      Result = $mod.TStringHelper.IndexOf$4.call(this,AValue,0,$mod.TStringHelper.GetLength.call(this));
      return Result;
    };
    this.IndexOf$1 = function (AValue) {
      var Result = 0;
      Result = $mod.TStringHelper.IndexOf$5.call(this,AValue,0,$mod.TStringHelper.GetLength.call(this));
      return Result;
    };
    this.IndexOf$2 = function (AValue, StartIndex) {
      var Result = 0;
      Result = $mod.TStringHelper.IndexOf$4.call(this,AValue,StartIndex,$mod.TStringHelper.GetLength.call(this));
      return Result;
    };
    this.IndexOf$3 = function (AValue, StartIndex) {
      var Result = 0;
      Result = $mod.TStringHelper.IndexOf$5.call(this,AValue,StartIndex,$mod.TStringHelper.GetLength.call(this));
      return Result;
    };
    this.IndexOf$4 = function (AValue, StartIndex, ACount) {
      var Result = 0;
      var S = "";
      S = pas.System.Copy(this.get(),StartIndex + 1,ACount);
      Result = pas.System.Pos(AValue,S) - 1;
      if (Result !== -1) Result = Result + StartIndex;
      return Result;
    };
    this.IndexOf$5 = function (AValue, StartIndex, ACount) {
      var Result = 0;
      var S = "";
      S = pas.System.Copy(this.get(),StartIndex + 1,ACount);
      Result = pas.System.Pos(AValue,S) - 1;
      if (Result !== -1) Result = Result + StartIndex;
      return Result;
    };
    this.IndexOfUnQuoted = function (AValue, StartQuote, EndQuote, StartIndex) {
      var $Self = this;
      var Result = 0;
      var LV = 0;
      var S = "";
      function MatchAt(I) {
        var Result = false;
        var J = 0;
        J = 1;
        do {
          Result = S.charAt((I + J) - 1 - 1) === AValue.charAt(J - 1);
          J += 1;
        } while (!(!Result || (J > LV)));
        return Result;
      };
      var I = 0;
      var L = 0;
      var Q = 0;
      S = $Self.get();
      Result = -1;
      LV = AValue.length;
      L = ($mod.TStringHelper.GetLength.call($Self) - LV) + 1;
      if (L < 0) L = 0;
      I = StartIndex + 1;
      Q = 0;
      if (StartQuote === EndQuote) {
        while ((Result === -1) && (I <= L)) {
          if (S.charAt(I - 1) === StartQuote) Q = 1 - Q;
          if ((Q === 0) && MatchAt(I)) Result = I - 1;
          I += 1;
        };
      } else {
        while ((Result === -1) && (I <= L)) {
          if (S.charAt(I - 1) === StartQuote) {
            Q += 1}
           else if ((S.charAt(I - 1) === EndQuote) && (Q > 0)) Q -= 1;
          if ((Q === 0) && MatchAt(I)) Result = I - 1;
          I += 1;
        };
      };
      return Result;
    };
    this.IndexOfAny = function (AnyOf) {
      var Result = 0;
      Result = $mod.TStringHelper.IndexOfAny$1.call(this,$mod.TStringHelper.ToCharArray$1.call({get: function () {
          return AnyOf;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }}));
      return Result;
    };
    this.IndexOfAny$1 = function (AnyOf) {
      var Result = 0;
      Result = $mod.TStringHelper.IndexOfAny$5.call(this,AnyOf,0,$mod.TStringHelper.GetLength.call(this));
      return Result;
    };
    this.IndexOfAny$2 = function (AnyOf, StartIndex) {
      var Result = 0;
      Result = $mod.TStringHelper.IndexOfAny$3.call(this,$mod.TStringHelper.ToCharArray$1.call({get: function () {
          return AnyOf;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }}),StartIndex);
      return Result;
    };
    this.IndexOfAny$3 = function (AnyOf, StartIndex) {
      var Result = 0;
      Result = $mod.TStringHelper.IndexOfAny$5.call(this,AnyOf,StartIndex,$mod.TStringHelper.GetLength.call(this));
      return Result;
    };
    this.IndexOfAny$4 = function (AnyOf, StartIndex, ACount) {
      var Result = 0;
      Result = $mod.TStringHelper.IndexOfAny$5.call(this,$mod.TStringHelper.ToCharArray$1.call({get: function () {
          return AnyOf;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }}),StartIndex,ACount);
      return Result;
    };
    this.IndexOfAny$5 = function (AnyOf, StartIndex, ACount) {
      var Result = 0;
      var i = 0;
      var L = 0;
      i = StartIndex + 1;
      L = (i + ACount) - 1;
      if (L > $mod.TStringHelper.GetLength.call(this)) L = $mod.TStringHelper.GetLength.call(this);
      Result = -1;
      while ((Result === -1) && (i <= L)) {
        if ($impl.HaveChar(this.get().charAt(i - 1),AnyOf)) Result = i - 1;
        i += 1;
      };
      return Result;
    };
    this.IndexOfAny$6 = function (AnyOf) {
      var Result = 0;
      Result = $mod.TStringHelper.IndexOfAny$8.call(this,AnyOf,0,$mod.TStringHelper.GetLength.call(this));
      return Result;
    };
    this.IndexOfAny$7 = function (AnyOf, StartIndex) {
      var Result = 0;
      Result = $mod.TStringHelper.IndexOfAny$8.call(this,AnyOf,StartIndex,$mod.TStringHelper.GetLength.call(this) - StartIndex);
      return Result;
    };
    this.IndexOfAny$8 = function (AnyOf, StartIndex, ACount) {
      var Result = 0;
      var M = 0;
      Result = $mod.TStringHelper.IndexOfAny$9.call(this,AnyOf,StartIndex,ACount,{get: function () {
          return M;
        }, set: function (v) {
          M = v;
        }});
      return Result;
    };
    this.IndexOfAny$9 = function (AnyOf, StartIndex, ACount, AMatch) {
      var Result = 0;
      var L = 0;
      var I = 0;
      Result = -1;
      for (var $l = 0, $end = rtl.length(AnyOf) - 1; $l <= $end; $l++) {
        I = $l;
        L = $mod.TStringHelper.IndexOf$5.call(this,AnyOf[I],StartIndex,ACount);
        if ((L >= 0) && ((Result === -1) || (L < Result))) {
          Result = L;
          AMatch.set(I);
        };
      };
      return Result;
    };
    this.IndexOfAnyUnquoted = function (AnyOf, StartQuote, EndQuote) {
      var Result = 0;
      Result = $mod.TStringHelper.IndexOfAnyUnquoted$2.call(this,AnyOf,StartQuote,EndQuote,0,$mod.TStringHelper.GetLength.call(this));
      return Result;
    };
    this.IndexOfAnyUnquoted$1 = function (AnyOf, StartQuote, EndQuote, StartIndex) {
      var Result = 0;
      Result = $mod.TStringHelper.IndexOfAnyUnquoted$2.call(this,AnyOf,StartQuote,EndQuote,StartIndex,$mod.TStringHelper.GetLength.call(this));
      return Result;
    };
    this.IndexOfAnyUnquoted$2 = function (AnyOf, StartQuote, EndQuote, StartIndex, ACount) {
      var Result = 0;
      var I = 0;
      var L = 0;
      var Q = 0;
      Result = -1;
      L = (StartIndex + ACount) - 1;
      if (L > $mod.TStringHelper.GetLength.call(this)) L = $mod.TStringHelper.GetLength.call(this);
      I = StartIndex + 1;
      Q = 0;
      if (StartQuote === EndQuote) {
        while ((Result === -1) && (I <= L)) {
          if (this.get().charAt(I - 1) === StartQuote) Q = 1 - Q;
          if ((Q === 0) && $impl.HaveChar(this.get().charAt(I - 1),AnyOf)) Result = I - 1;
          I += 1;
        };
      } else {
        while ((Result === -1) && (I <= L)) {
          if (this.get().charAt(I - 1) === StartQuote) {
            Q += 1}
           else if ((this.get().charAt(I - 1) === EndQuote) && (Q > 0)) Q -= 1;
          if ((Q === 0) && $impl.HaveChar(this.get().charAt(I - 1),AnyOf)) Result = I - 1;
          I += 1;
        };
      };
      return Result;
    };
    this.IndexOfAnyUnquoted$3 = function (AnyOf, StartQuote, EndQuote, StartIndex, Matched) {
      var Result = 0;
      var L = 0;
      var I = 0;
      Result = -1;
      for (var $l = 0, $end = rtl.length(AnyOf) - 1; $l <= $end; $l++) {
        I = $l;
        L = $mod.TStringHelper.IndexOfUnQuoted.call(this,AnyOf[I],StartQuote,EndQuote,StartIndex);
        if ((L >= 0) && ((Result === -1) || (L < Result))) {
          Result = L;
          Matched.set(I);
        };
      };
      return Result;
    };
    this.Insert = function (StartIndex, AValue) {
      var Result = "";
      pas.System.Insert(AValue,this,StartIndex + 1);
      Result = this.get();
      return Result;
    };
    this.IsDelimiter = function (Delimiters, Index) {
      var Result = false;
      Result = $mod.IsDelimiter(Delimiters,this.get(),Index + 1);
      return Result;
    };
    this.IsEmpty = function () {
      var Result = false;
      Result = $mod.TStringHelper.GetLength.call(this) === 0;
      return Result;
    };
    var cNumbers = rtl.createSet(null,48,57);
    this.IsNumber = function () {
      var Result = false;
      var lCount = 0;
      if ($mod.TStringHelper.IsEmpty.call(this)) return false;
      for (var $l = 0, $end = $mod.TStringHelper.GetLength.call(this) - 1; $l <= $end; $l++) {
        lCount = $l;
        if (!($mod.TStringHelper.GetChar.call(this,lCount).charCodeAt() in cNumbers)) return false;
      };
      Result = true;
      return Result;
    };
    this.LastDelimiter = function (Delims) {
      var Result = 0;
      Result = $mod.LastDelimiter(Delims,this.get()) - 1;
      return Result;
    };
    this.LastIndexOf = function (AValue) {
      var Result = 0;
      Result = $mod.TStringHelper.LastIndexOf$4.call(this,AValue,$mod.TStringHelper.GetLength.call(this) - 1,$mod.TStringHelper.GetLength.call(this));
      return Result;
    };
    this.LastIndexOf$1 = function (AValue) {
      var Result = 0;
      Result = $mod.TStringHelper.LastIndexOf$5.call(this,AValue,$mod.TStringHelper.GetLength.call(this) - 1,$mod.TStringHelper.GetLength.call(this));
      return Result;
    };
    this.LastIndexOf$2 = function (AValue, AStartIndex) {
      var Result = 0;
      Result = $mod.TStringHelper.LastIndexOf$4.call(this,AValue,AStartIndex,$mod.TStringHelper.GetLength.call(this));
      return Result;
    };
    this.LastIndexOf$3 = function (AValue, AStartIndex) {
      var Result = 0;
      Result = $mod.TStringHelper.LastIndexOf$5.call(this,AValue,AStartIndex,$mod.TStringHelper.GetLength.call(this));
      return Result;
    };
    this.LastIndexOf$4 = function (AValue, AStartIndex, ACount) {
      var Result = 0;
      var Min = 0;
      Result = AStartIndex + 1;
      Min = (Result - ACount) + 1;
      if (Min < 1) Min = 1;
      while ((Result >= Min) && (this.get().charAt(Result - 1) !== AValue)) Result -= 1;
      if (Result < Min) {
        Result = -1}
       else Result = Result - 1;
      return Result;
    };
    this.LastIndexOf$5 = function (AValue, AStartIndex, ACount) {
      var Result = 0;
      Result = this.get().lastIndexOf(AValue,AStartIndex);
      if ((AStartIndex - Result) > ACount) Result = -1;
      return Result;
    };
    this.LastIndexOfAny = function (AnyOf) {
      var Result = 0;
      Result = $mod.TStringHelper.LastIndexOfAny$2.call(this,AnyOf,$mod.TStringHelper.GetLength.call(this) - 1,$mod.TStringHelper.GetLength.call(this));
      return Result;
    };
    this.LastIndexOfAny$1 = function (AnyOf, AStartIndex) {
      var Result = 0;
      Result = $mod.TStringHelper.LastIndexOfAny$2.call(this,AnyOf,AStartIndex,$mod.TStringHelper.GetLength.call(this));
      return Result;
    };
    this.LastIndexOfAny$2 = function (AnyOf, AStartIndex, ACount) {
      var Result = 0;
      var Min = 0;
      Result = AStartIndex + 1;
      Min = (Result - ACount) + 1;
      if (Min < 1) Min = 1;
      while ((Result >= Min) && !$impl.HaveChar(this.get().charAt(Result - 1),AnyOf)) Result -= 1;
      if (Result < Min) {
        Result = -1}
       else Result = Result - 1;
      return Result;
    };
    this.PadLeft = function (ATotalWidth) {
      var Result = "";
      Result = $mod.TStringHelper.PadLeft$1.call(this,ATotalWidth," ");
      return Result;
    };
    this.PadLeft$1 = function (ATotalWidth, PaddingChar) {
      var Result = "";
      var L = 0;
      Result = this.get();
      L = ATotalWidth - $mod.TStringHelper.GetLength.call(this);
      if (L > 0) Result = pas.System.StringOfChar(PaddingChar,L) + Result;
      return Result;
    };
    this.PadRight = function (ATotalWidth) {
      var Result = "";
      Result = $mod.TStringHelper.PadRight$1.call(this,ATotalWidth," ");
      return Result;
    };
    this.PadRight$1 = function (ATotalWidth, PaddingChar) {
      var Result = "";
      var L = 0;
      Result = this.get();
      L = ATotalWidth - $mod.TStringHelper.GetLength.call(this);
      if (L > 0) Result = Result + pas.System.StringOfChar(PaddingChar,L);
      return Result;
    };
    this.QuotedString = function () {
      var Result = "";
      Result = $mod.QuotedStr(this.get(),"'");
      return Result;
    };
    this.QuotedString$1 = function (AQuoteChar) {
      var Result = "";
      Result = $mod.QuotedStr(this.get(),AQuoteChar);
      return Result;
    };
    this.Remove = function (StartIndex) {
      var Result = "";
      Result = $mod.TStringHelper.Remove$1.call(this,StartIndex,$mod.TStringHelper.GetLength.call(this) - StartIndex);
      return Result;
    };
    this.Remove$1 = function (StartIndex, ACount) {
      var Result = "";
      Result = this.get();
      pas.System.Delete({get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }},StartIndex + 1,ACount);
      return Result;
    };
    this.Replace = function (OldChar, NewChar) {
      var Result = "";
      Result = $mod.TStringHelper.Replace$1.call(this,OldChar,NewChar,rtl.createSet($mod.TStringReplaceFlag.rfReplaceAll));
      return Result;
    };
    this.Replace$1 = function (OldChar, NewChar, ReplaceFlags) {
      var Result = "";
      Result = $mod.StringReplace(this.get(),OldChar,NewChar,rtl.refSet(ReplaceFlags));
      return Result;
    };
    this.Replace$2 = function (OldValue, NewValue) {
      var Result = "";
      Result = $mod.TStringHelper.Replace$3.call(this,OldValue,NewValue,rtl.createSet($mod.TStringReplaceFlag.rfReplaceAll));
      return Result;
    };
    this.Replace$3 = function (OldValue, NewValue, ReplaceFlags) {
      var Result = "";
      Result = $mod.StringReplace(this.get(),OldValue,NewValue,rtl.refSet(ReplaceFlags));
      return Result;
    };
    this.Split = function (Separators) {
      var Result = [];
      Result = $mod.TStringHelper.Split$1.call(this,$mod.TStringHelper.ToCharArray$1.call({get: function () {
          return Separators;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }}));
      return Result;
    };
    this.Split$1 = function (Separators) {
      var Result = [];
      Result = $mod.TStringHelper.Split$21.call(this,Separators,"\x00","\x00",$mod.TStringHelper.GetLength.call(this) + 1,$mod.TStringSplitOptions.None);
      return Result;
    };
    this.Split$2 = function (Separators, ACount) {
      var Result = [];
      Result = $mod.TStringHelper.Split$3.call(this,$mod.TStringHelper.ToCharArray$1.call({get: function () {
          return Separators;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }}),ACount);
      return Result;
    };
    this.Split$3 = function (Separators, ACount) {
      var Result = [];
      Result = $mod.TStringHelper.Split$21.call(this,Separators,"\x00","\x00",ACount,$mod.TStringSplitOptions.None);
      return Result;
    };
    this.Split$4 = function (Separators, Options) {
      var Result = [];
      Result = $mod.TStringHelper.Split$5.call(this,$mod.TStringHelper.ToCharArray$1.call({get: function () {
          return Separators;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }}),Options);
      return Result;
    };
    this.Split$5 = function (Separators, Options) {
      var Result = [];
      Result = $mod.TStringHelper.Split$7.call(this,Separators,$mod.TStringHelper.GetLength.call(this) + 1,Options);
      return Result;
    };
    this.Split$6 = function (Separators, ACount, Options) {
      var Result = [];
      Result = $mod.TStringHelper.Split$7.call(this,$mod.TStringHelper.ToCharArray$1.call({get: function () {
          return Separators;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }}),ACount,Options);
      return Result;
    };
    this.Split$7 = function (Separators, ACount, Options) {
      var Result = [];
      Result = $mod.TStringHelper.Split$21.call(this,Separators,"\x00","\x00",ACount,Options);
      return Result;
    };
    this.Split$8 = function (Separators) {
      var Result = [];
      Result = $mod.TStringHelper.Split$9.call(this,Separators,$mod.TStringHelper.GetLength.call(this) + 1);
      return Result;
    };
    this.Split$9 = function (Separators, ACount) {
      var Result = [];
      Result = $mod.TStringHelper.Split$11.call(this,Separators,ACount,$mod.TStringSplitOptions.None);
      return Result;
    };
    this.Split$10 = function (Separators, Options) {
      var Result = [];
      Result = $mod.TStringHelper.Split$11.call(this,Separators,$mod.TStringHelper.GetLength.call(this) + 1,Options);
      return Result;
    };
    this.Split$11 = function (Separators, ACount, Options) {
      var Result = [];
      Result = $mod.TStringHelper.Split$26.call(this,Separators,"\x00","\x00",ACount,Options);
      return Result;
    };
    this.Split$12 = function (Separators, AQuote) {
      var Result = [];
      Result = $mod.TStringHelper.Split$13.call(this,$mod.TStringHelper.ToCharArray$1.call({get: function () {
          return Separators;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }}),AQuote);
      return Result;
    };
    this.Split$13 = function (Separators, AQuote) {
      var Result = [];
      Result = $mod.TStringHelper.Split$15.call(this,Separators,AQuote,AQuote);
      return Result;
    };
    this.Split$14 = function (Separators, AQuoteStart, AQuoteEnd) {
      var Result = [];
      Result = $mod.TStringHelper.Split$15.call(this,$mod.TStringHelper.ToCharArray$1.call({get: function () {
          return Separators;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }}),AQuoteStart,AQuoteEnd);
      return Result;
    };
    this.Split$15 = function (Separators, AQuoteStart, AQuoteEnd) {
      var Result = [];
      Result = $mod.TStringHelper.Split$17.call(this,Separators,AQuoteStart,AQuoteEnd,$mod.TStringSplitOptions.None);
      return Result;
    };
    this.Split$16 = function (Separators, AQuoteStart, AQuoteEnd, Options) {
      var Result = [];
      Result = $mod.TStringHelper.Split$17.call(this,$mod.TStringHelper.ToCharArray$1.call({get: function () {
          return Separators;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }}),AQuoteStart,AQuoteEnd,Options);
      return Result;
    };
    this.Split$17 = function (Separators, AQuoteStart, AQuoteEnd, Options) {
      var Result = [];
      Result = $mod.TStringHelper.Split$21.call(this,Separators,AQuoteStart,AQuoteEnd,$mod.TStringHelper.GetLength.call(this) + 1,Options);
      return Result;
    };
    this.Split$18 = function (Separators, AQuoteStart, AQuoteEnd, ACount) {
      var Result = [];
      Result = $mod.TStringHelper.Split$19.call(this,$mod.TStringHelper.ToCharArray$1.call({get: function () {
          return Separators;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }}),AQuoteStart,AQuoteEnd,ACount);
      return Result;
    };
    this.Split$19 = function (Separators, AQuoteStart, AQuoteEnd, ACount) {
      var Result = [];
      Result = $mod.TStringHelper.Split$21.call(this,Separators,AQuoteStart,AQuoteEnd,ACount,$mod.TStringSplitOptions.None);
      return Result;
    };
    this.Split$20 = function (Separators, AQuoteStart, AQuoteEnd, ACount, Options) {
      var Result = [];
      Result = $mod.TStringHelper.Split$21.call(this,$mod.TStringHelper.ToCharArray$1.call({get: function () {
          return Separators;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }}),AQuoteStart,AQuoteEnd,ACount,Options);
      return Result;
    };
    var BlockSize = 10;
    this.Split$21 = function (Separators, AQuoteStart, AQuoteEnd, ACount, Options) {
      var $Self = this;
      var Result = [];
      var S = "";
      function NextSep(StartIndex) {
        var Result = 0;
        if (AQuoteStart !== "\x00") {
          Result = $mod.TStringHelper.IndexOfAnyUnquoted$1.call({get: function () {
              return S;
            }, set: function (v) {
              S = v;
            }},Separators,AQuoteStart,AQuoteEnd,StartIndex)}
         else Result = $mod.TStringHelper.IndexOfAny$3.call({get: function () {
            return S;
          }, set: function (v) {
            S = v;
          }},Separators,StartIndex);
        return Result;
      };
      function MaybeGrow(Curlen) {
        if (rtl.length(Result) <= Curlen) Result = rtl.arraySetLength(Result,"",rtl.length(Result) + 10);
      };
      var Sep = 0;
      var LastSep = 0;
      var Len = 0;
      var T = "";
      S = $Self.get();
      Result = rtl.arraySetLength(Result,"",10);
      Len = 0;
      LastSep = 0;
      Sep = NextSep(0);
      while ((Sep !== -1) && ((ACount === 0) || (Len < ACount))) {
        T = $mod.TStringHelper.Substring$1.call($Self,LastSep,Sep - LastSep);
        if ((T !== "") || !($mod.TStringSplitOptions.ExcludeEmpty === Options)) {
          MaybeGrow(Len);
          Result[Len] = T;
          Len += 1;
        };
        LastSep = Sep + 1;
        Sep = NextSep(LastSep);
      };
      if ((LastSep <= $mod.TStringHelper.GetLength.call($Self)) && ((ACount === 0) || (Len < ACount))) {
        T = $mod.TStringHelper.Substring.call($Self,LastSep);
        if ((T !== "") || !($mod.TStringSplitOptions.ExcludeEmpty === Options)) {
          MaybeGrow(Len);
          Result[Len] = T;
          Len += 1;
        };
      };
      Result = rtl.arraySetLength(Result,"",Len);
      return Result;
    };
    this.Split$22 = function (Separators, AQuote) {
      var Result = [];
      Result = $mod.TStringHelper.Split$23.call(this,Separators,AQuote,AQuote);
      return Result;
    };
    this.Split$23 = function (Separators, AQuoteStart, AQuoteEnd) {
      var Result = [];
      Result = $mod.TStringHelper.Split$26.call(this,Separators,AQuoteStart,AQuoteEnd,$mod.TStringHelper.GetLength.call(this) + 1,$mod.TStringSplitOptions.None);
      return Result;
    };
    this.Split$24 = function (Separators, AQuoteStart, AQuoteEnd, Options) {
      var Result = [];
      Result = $mod.TStringHelper.Split$26.call(this,Separators,AQuoteStart,AQuoteEnd,$mod.TStringHelper.GetLength.call(this) + 1,Options);
      return Result;
    };
    this.Split$25 = function (Separators, AQuoteStart, AQuoteEnd, ACount) {
      var Result = [];
      Result = $mod.TStringHelper.Split$26.call(this,Separators,AQuoteStart,AQuoteEnd,ACount,$mod.TStringSplitOptions.None);
      return Result;
    };
    var BlockSize$1 = 10;
    this.Split$26 = function (Separators, AQuoteStart, AQuoteEnd, ACount, Options) {
      var $Self = this;
      var Result = [];
      var S = "";
      function NextSep(StartIndex, Match) {
        var Result = 0;
        if (AQuoteStart !== "\x00") {
          Result = $mod.TStringHelper.IndexOfAnyUnquoted$3.call({get: function () {
              return S;
            }, set: function (v) {
              S = v;
            }},Separators,AQuoteStart,AQuoteEnd,StartIndex,Match)}
         else Result = $mod.TStringHelper.IndexOfAny$9.call({get: function () {
            return S;
          }, set: function (v) {
            S = v;
          }},Separators,StartIndex,$mod.TStringHelper.GetLength.call($Self),Match);
        return Result;
      };
      function MaybeGrow(Curlen) {
        if (rtl.length(Result) <= Curlen) Result = rtl.arraySetLength(Result,"",rtl.length(Result) + 10);
      };
      var Sep = 0;
      var LastSep = 0;
      var Len = 0;
      var Match = 0;
      var T = "";
      S = $Self.get();
      Result = rtl.arraySetLength(Result,"",10);
      Len = 0;
      LastSep = 0;
      Sep = NextSep(0,{get: function () {
          return Match;
        }, set: function (v) {
          Match = v;
        }});
      while ((Sep !== -1) && ((ACount === 0) || (Len < ACount))) {
        T = $mod.TStringHelper.Substring$1.call($Self,LastSep,Sep - LastSep);
        if ((T !== "") || !($mod.TStringSplitOptions.ExcludeEmpty === Options)) {
          MaybeGrow(Len);
          Result[Len] = T;
          Len += 1;
        };
        LastSep = Sep + Separators[Match].length;
        Sep = NextSep(LastSep,{get: function () {
            return Match;
          }, set: function (v) {
            Match = v;
          }});
      };
      if ((LastSep <= $mod.TStringHelper.GetLength.call($Self)) && ((ACount === 0) || (Len < ACount))) {
        T = $mod.TStringHelper.Substring.call($Self,LastSep);
        if ((T !== "") || !($mod.TStringSplitOptions.ExcludeEmpty === Options)) {
          MaybeGrow(Len);
          Result[Len] = T;
          Len += 1;
        };
      };
      Result = rtl.arraySetLength(Result,"",Len);
      return Result;
    };
    this.StartsWith = function (AValue) {
      var Result = false;
      Result = $mod.TStringHelper.StartsWith$1.call(this,AValue,false);
      return Result;
    };
    this.StartsWith$1 = function (AValue, IgnoreCase) {
      var Result = false;
      var L = 0;
      var S = "";
      L = AValue.length;
      Result = L <= 0;
      if (!Result) {
        S = pas.System.Copy(this.get(),1,L);
        Result = S.length === L;
        if (Result) if (IgnoreCase) {
          Result = $mod.SameText(S,AValue)}
         else Result = $mod.SameStr(S,AValue);
      };
      return Result;
    };
    this.Substring = function (AStartIndex) {
      var Result = "";
      Result = $mod.TStringHelper.Substring$1.call(this,AStartIndex,$mod.TStringHelper.GetLength.call(this) - AStartIndex);
      return Result;
    };
    this.Substring$1 = function (AStartIndex, ALen) {
      var Result = "";
      Result = pas.System.Copy(this.get(),AStartIndex + 1,ALen);
      return Result;
    };
    this.ToBoolean$1 = function () {
      var Result = false;
      Result = $mod.StrToBool(this.get());
      return Result;
    };
    this.ToInteger$1 = function () {
      var Result = 0;
      Result = $mod.StrToInt(this.get());
      return Result;
    };
    this.ToNativeInt$1 = function () {
      var Result = 0;
      Result = $mod.StrToNativeInt(this.get());
      return Result;
    };
    this.ToDouble$1 = function () {
      var Result = 0.0;
      Result = $mod.StrToFloat(this.get());
      return Result;
    };
    this.ToExtended$1 = function () {
      var Result = 0.0;
      Result = $mod.StrToFloat(this.get());
      return Result;
    };
    this.ToCharArray$1 = function () {
      var Result = [];
      Result = $mod.TStringHelper.ToCharArray$2.call(this,0,$mod.TStringHelper.GetLength.call(this));
      return Result;
    };
    this.ToCharArray$2 = function (AStartIndex, ALen) {
      var Result = [];
      var I = 0;
      Result = rtl.arraySetLength(Result,"\x00",ALen);
      for (var $l = 0, $end = ALen - 1; $l <= $end; $l++) {
        I = $l;
        Result[I] = this.get().charAt((AStartIndex + I + 1) - 1);
      };
      return Result;
    };
    this.ToLower = function () {
      var Result = "";
      Result = $mod.TStringHelper.LowerCase(this.get());
      return Result;
    };
    this.ToLowerInvariant = function () {
      var Result = "";
      Result = $mod.TStringHelper.LowerCase(this.get());
      return Result;
    };
    this.ToUpper = function () {
      var Result = "";
      Result = $mod.TStringHelper.UpperCase(this.get());
      return Result;
    };
    this.ToUpperInvariant = function () {
      var Result = "";
      Result = $mod.TStringHelper.UpperCase(this.get());
      return Result;
    };
    this.Trim = function () {
      var Result = "";
      Result = $mod.Trim(this.get());
      return Result;
    };
    this.TrimLeft = function () {
      var Result = "";
      Result = $mod.TrimLeft(this.get());
      return Result;
    };
    this.TrimRight = function () {
      var Result = "";
      Result = $mod.TrimRight(this.get());
      return Result;
    };
    this.Trim$1 = function (ATrimChars) {
      var Result = "";
      Result = $mod.TStringHelper.TrimRight$1.call({a: $mod.TStringHelper.TrimLeft$1.call(this,ATrimChars), get: function () {
          return this.a;
        }, set: function (v) {
          this.a = v;
        }},ATrimChars);
      return Result;
    };
    this.TrimLeft$1 = function (ATrimChars) {
      var Result = "";
      var I = 0;
      var Len = 0;
      I = 1;
      Len = $mod.TStringHelper.GetLength.call(this);
      while ((I <= Len) && $impl.HaveChar(this.get().charAt(I - 1),ATrimChars)) I += 1;
      if (I === 1) {
        Result = this.get()}
       else if (I > Len) {
        Result = ""}
       else Result = pas.System.Copy(this.get(),I,(Len - I) + 1);
      return Result;
    };
    this.TrimRight$1 = function (ATrimChars) {
      var Result = "";
      var I = 0;
      var Len = 0;
      Len = $mod.TStringHelper.GetLength.call(this);
      I = Len;
      while ((I >= 1) && $impl.HaveChar(this.get().charAt(I - 1),ATrimChars)) I -= 1;
      if (I < 1) {
        Result = ""}
       else if (I === Len) {
        Result = this.get()}
       else Result = pas.System.Copy(this.get(),1,I);
      return Result;
    };
    this.TrimEnd = function (ATrimChars) {
      var Result = "";
      Result = $mod.TStringHelper.TrimRight$1.call(this,ATrimChars);
      return Result;
    };
    this.TrimStart = function (ATrimChars) {
      var Result = "";
      Result = $mod.TStringHelper.TrimLeft$1.call(this,ATrimChars);
      return Result;
    };
  });
  rtl.createHelper(this,"TDoubleHelper",null,function () {
    this.Epsilon = 4.9406564584124654418e-324;
    this.MaxValue = 1.7976931348623157081e+308;
    this.MinValue = -1.7976931348623157081e+308;
    this.GetB = function (AIndex) {
      var Result = 0;
      var F = null;
      var B = null;
      F = new Float64Array(1);
      B = new Uint8Array(F.buffer);
      F[0] = this.get();
      Result = B[AIndex];
      return Result;
    };
    this.GetW = function (AIndex) {
      var Result = 0;
      var F = null;
      var W = null;
      F = new Float64Array(1);
      W = new Uint16Array(F.buffer);
      F[0] = this.get();
      Result = W[AIndex];
      return Result;
    };
    this.GetE = function () {
      var Result = 0;
      Result = $impl.FloatToParts(this.get()).exp;
      return Result;
    };
    this.GetF = function () {
      var Result = 0;
      Result = 0;
      $impl.NotImplemented("GetF");
      return Result;
    };
    this.GetS = function () {
      var Result = false;
      Result = $impl.FloatToParts(this.get()).sign;
      return Result;
    };
    this.SetS = function (aValue) {
      var F = null;
      var B = null;
      F = new Float64Array(1);
      B = new Uint8Array(F.buffer);
      F[0] = this.get();
      if (aValue) {
        B[7] = B[7] | (1 >>> 7)}
       else B[7] = B[7] & ~(1 >>> 7);
      this.set(F[0]);
    };
    this.SetB = function (AIndex, AValue) {
      var F = null;
      var B = null;
      if (AIndex >= 8) throw $mod.ERangeError.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SRangeError")]);
      F = new Float64Array(1);
      B = new Uint8Array(F.buffer);
      F[0] = this.get();
      B[AIndex] = AValue;
      this.set(F[0]);
    };
    this.SetW = function (AIndex, AValue) {
      var F = null;
      var W = null;
      if (AIndex >= 4) throw $mod.ERangeError.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SRangeError")]);
      F = new Float64Array(1);
      W = new Uint16Array(F.buffer);
      F[0] = this.get();
      W[AIndex] = AValue;
      this.set(F[0]);
    };
    this.IsInfinity = function (AValue) {
      var Result = false;
      Result = !isFinite(AValue);
      return Result;
    };
    this.IsNan = function (AValue) {
      var Result = false;
      Result = isNaN(AValue);
      return Result;
    };
    this.IsNegativeInfinity = function (AValue) {
      var Result = false;
      return (AValue=Number.NEGATIVE_INFINITY);
      Result = AValue === 0;
      return Result;
    };
    this.IsPositiveInfinity = function (AValue) {
      var Result = false;
      return (AValue=Number.POSITIVE_INFINITY);
      Result = AValue === 0;
      return Result;
    };
    this.Parse = function (AString) {
      var Result = 0.0;
      Result = $mod.StrToFloat(AString);
      return Result;
    };
    this.ToString = function (AValue) {
      var Result = "";
      Result = $mod.FloatToStr(AValue);
      return Result;
    };
    this.ToString$1 = function (AValue, AFormat, APrecision, ADigits) {
      var Result = "";
      Result = $mod.FloatToStrF(AValue,AFormat,APrecision,ADigits);
      return Result;
    };
    this.TryParse = function (AString, AValue) {
      var Result = false;
      Result = $mod.TryStrToFloat$2(AString,AValue);
      return Result;
    };
    this.BuildUp = function (ASignFlag, AMantissa, AExponent) {
      $impl.NotImplemented("BuildUp");
      if (ASignFlag && (AMantissa > 0) && (AExponent < 0)) return;
    };
    this.Exponent = function () {
      var Result = 0;
      Result = $impl.FloatToParts(this.get()).exp;
      return Result;
    };
    this.Fraction = function () {
      var Result = 0.0;
      Result = pas.System.Frac(this.get());
      return Result;
    };
    this.IsInfinity$1 = function () {
      var Result = false;
      Result = $mod.TDoubleHelper.IsInfinity(this.get());
      return Result;
    };
    this.IsNan$1 = function () {
      var Result = false;
      Result = $mod.TDoubleHelper.IsNan(this.get());
      return Result;
    };
    this.IsNegativeInfinity$1 = function () {
      var Result = false;
      Result = $mod.TDoubleHelper.IsNegativeInfinity(this.get());
      return Result;
    };
    this.IsPositiveInfinity$1 = function () {
      var Result = false;
      Result = $mod.TDoubleHelper.IsPositiveInfinity(this.get());
      return Result;
    };
    this.Mantissa = function () {
      var Result = 0;
      Result = pas.System.Trunc($impl.FloatToParts(this.get()).mantissa);
      return Result;
    };
    this.ToString$2 = function (AFormat, APrecision, ADigits) {
      var Result = "";
      Result = $mod.FloatToStrF(this.get(),AFormat,APrecision,ADigits);
      return Result;
    };
    this.ToString$3 = function () {
      var Result = "";
      Result = $mod.FloatToStr(this.get());
      return Result;
    };
  });
  rtl.createHelper(this,"TByteHelper",null,function () {
    this.MaxValue = 255;
    this.MinValue = 0;
    this.Parse = function (AString) {
      var Result = 0;
      Result = $mod.StrToInt(AString);
      return Result;
    };
    this.Size = function () {
      var Result = 0;
      Result = 1;
      return Result;
    };
    this.ToString = function (AValue) {
      var Result = "";
      Result = $mod.IntToStr(AValue);
      return Result;
    };
    this.TryParse = function (AString, AValue) {
      var Result = false;
      var C = 0;
      pas.System.val$3(AString,AValue,{get: function () {
          return C;
        }, set: function (v) {
          C = v;
        }});
      Result = C === 0;
      return Result;
    };
    this.ToBoolean = function () {
      var Result = false;
      Result = this.get() !== 0;
      return Result;
    };
    this.ToDouble = function () {
      var Result = 0.0;
      Result = this.get();
      return Result;
    };
    this.ToExtended = function () {
      var Result = 0.0;
      Result = this.get();
      return Result;
    };
    this.ToBinString = function () {
      var Result = "";
      Result = pas.System.binstr(this.get(),$mod.TByteHelper.Size() * 8);
      return Result;
    };
    this.ToHexString = function (AMinDigits) {
      var Result = "";
      Result = $mod.IntToHex(this.get(),AMinDigits);
      return Result;
    };
    this.ToHexString$1 = function () {
      var Result = "";
      Result = $mod.IntToHex(this.get(),$mod.TByteHelper.Size() * 2);
      return Result;
    };
    this.ToString$1 = function () {
      var Result = "";
      Result = $mod.IntToStr(this.get());
      return Result;
    };
    this.SetBit = function (Index) {
      var Result = 0;
      this.set(this.get() | (1 << Index));
      Result = this.get();
      return Result;
    };
    this.ClearBit = function (Index) {
      var Result = 0;
      this.set(this.get() & ~(1 << Index));
      Result = this.get();
      return Result;
    };
    this.ToggleBit = function (Index) {
      var Result = 0;
      this.set(this.get() ^ (1 << Index));
      Result = this.get();
      return Result;
    };
    this.TestBit = function (Index) {
      var Result = false;
      Result = (this.get() & (1 << Index)) !== 0;
      return Result;
    };
  });
  rtl.createHelper(this,"TShortIntHelper",null,function () {
    this.MaxValue = 127;
    this.MinValue = -128;
    this.Parse = function (AString) {
      var Result = 0;
      Result = $mod.StrToInt(AString);
      return Result;
    };
    this.Size = function () {
      var Result = 0;
      Result = 1;
      return Result;
    };
    this.ToString = function (AValue) {
      var Result = "";
      Result = $mod.IntToStr(AValue);
      return Result;
    };
    this.TryParse = function (AString, AValue) {
      var Result = false;
      var C = 0;
      pas.System.val$2(AString,AValue,{get: function () {
          return C;
        }, set: function (v) {
          C = v;
        }});
      Result = C === 0;
      return Result;
    };
    this.ToBoolean = function () {
      var Result = false;
      Result = this.get() !== 0;
      return Result;
    };
    this.ToDouble = function () {
      var Result = 0.0;
      Result = this.get();
      return Result;
    };
    this.ToExtended = function () {
      var Result = 0.0;
      Result = this.get();
      return Result;
    };
    this.ToBinString = function () {
      var Result = "";
      Result = pas.System.binstr(this.get(),$mod.TShortIntHelper.Size() * 8);
      return Result;
    };
    this.ToHexString = function (AMinDigits) {
      var Result = "";
      var B = 0;
      var U = null;
      var S = null;
      if (this.get() >= 0) {
        B = this.get()}
       else {
        S = new Int8Array(1);
        S[0] = this.get();
        U = new Uint8Array(S);
        B = U[0];
        if (AMinDigits > 2) B = 0xFF00 + B;
      };
      Result = $mod.IntToHex(B,AMinDigits);
      return Result;
    };
    this.ToHexString$1 = function () {
      var Result = "";
      Result = $mod.TShortIntHelper.ToHexString.call(this,$mod.TShortIntHelper.Size() * 2);
      return Result;
    };
    this.ToString$1 = function () {
      var Result = "";
      Result = $mod.IntToStr(this.get());
      return Result;
    };
    this.SetBit = function (Index) {
      var Result = 0;
      this.set(this.get() | (1 << Index));
      Result = this.get();
      return Result;
    };
    this.ClearBit = function (Index) {
      var Result = 0;
      this.set(this.get() & ~(1 << Index));
      Result = this.get();
      return Result;
    };
    this.ToggleBit = function (Index) {
      var Result = 0;
      this.set(this.get() ^ (1 << Index));
      Result = this.get();
      return Result;
    };
    this.TestBit = function (Index) {
      var Result = false;
      Result = (this.get() & (1 << Index)) !== 0;
      return Result;
    };
  });
  rtl.createHelper(this,"TSmallIntHelper",null,function () {
    this.MaxValue = 32767;
    this.MinValue = -32768;
    this.Parse = function (AString) {
      var Result = 0;
      Result = $mod.StrToInt(AString);
      return Result;
    };
    this.Size = function () {
      var Result = 0;
      Result = 2;
      return Result;
    };
    this.ToString = function (AValue) {
      var Result = "";
      Result = $mod.IntToStr(AValue);
      return Result;
    };
    this.TryParse = function (AString, AValue) {
      var Result = false;
      var C = 0;
      pas.System.val$4(AString,AValue,{get: function () {
          return C;
        }, set: function (v) {
          C = v;
        }});
      Result = C === 0;
      return Result;
    };
    this.ToString$1 = function () {
      var Result = "";
      Result = $mod.IntToStr(this.get());
      return Result;
    };
    this.ToBoolean = function () {
      var Result = false;
      Result = this.get() !== 0;
      return Result;
    };
    this.ToBinString = function () {
      var Result = "";
      Result = pas.System.binstr(this.get(),$mod.TSmallIntHelper.Size() * 8);
      return Result;
    };
    this.ToHexString = function () {
      var Result = "";
      Result = $mod.TSmallIntHelper.ToHexString$1.call(this,$mod.TSmallIntHelper.Size() * 2);
      return Result;
    };
    this.ToHexString$1 = function (AMinDigits) {
      var Result = "";
      var B = 0;
      var U = null;
      var S = null;
      if (this.get() >= 0) {
        B = this.get()}
       else {
        S = new Int16Array(1);
        S[0] = this.get();
        U = new Uint16Array(S);
        B = U[0];
        if (AMinDigits > 6) {
          B = 0xFFFF0000 + B}
         else if (AMinDigits > 4) B = 0xFF0000 + B;
      };
      Result = $mod.IntToHex(B,AMinDigits);
      return Result;
    };
    this.ToDouble = function () {
      var Result = 0.0;
      Result = this.get();
      return Result;
    };
    this.ToExtended = function () {
      var Result = 0.0;
      Result = this.get();
      return Result;
    };
    this.SetBit = function (Index) {
      var Result = 0;
      this.set(this.get() | (1 << Index));
      Result = this.get();
      return Result;
    };
    this.ClearBit = function (Index) {
      var Result = 0;
      this.set(this.get() & ~(1 << Index));
      Result = this.get();
      return Result;
    };
    this.ToggleBit = function (Index) {
      var Result = 0;
      this.set(this.get() ^ (1 << Index));
      Result = this.get();
      return Result;
    };
    this.TestBit = function (Index) {
      var Result = false;
      Result = (this.get() & (1 << Index)) !== 0;
      return Result;
    };
  });
  rtl.createHelper(this,"TWordHelper",null,function () {
    this.MaxValue = 65535;
    this.MinValue = 0;
    var cBitPerByte = 8;
    this.FromBytes = function (ALow, AHigh) {
      var Result = 0;
      Result = ALow + (AHigh << 8);
      return Result;
    };
    this.Parse = function (AString) {
      var Result = 0;
      Result = $mod.StrToInt(AString);
      return Result;
    };
    this.Size = function () {
      var Result = 0;
      Result = 2;
      return Result;
    };
    var cMask = 0xFF;
    var cBitPerByte$1 = 8;
    this.ToBytes = function (ALow, AHigh) {
      ALow.set(this.get() & cMask);
      AHigh.set((this.get() & (cMask << 8)) >>> 8);
    };
    this.ToString = function (AValue) {
      var Result = "";
      Result = $mod.IntToStr(AValue);
      return Result;
    };
    this.TryParse = function (AString, AValue) {
      var Result = false;
      var C = 0;
      pas.System.val$5(AString,AValue,{get: function () {
          return C;
        }, set: function (v) {
          C = v;
        }});
      Result = C === 0;
      return Result;
    };
    this.ToBoolean = function () {
      var Result = false;
      Result = this.get() !== 0;
      return Result;
    };
    this.ToDouble = function () {
      var Result = 0.0;
      Result = this.get();
      return Result;
    };
    this.ToExtended = function () {
      var Result = 0.0;
      Result = this.get();
      return Result;
    };
    this.ToBinString = function () {
      var Result = "";
      Result = pas.System.binstr(this.get(),$mod.TWordHelper.Size() * 8);
      return Result;
    };
    this.ToHexString = function (AMinDigits) {
      var Result = "";
      Result = $mod.IntToHex(this.get(),AMinDigits);
      return Result;
    };
    this.ToHexString$1 = function () {
      var Result = "";
      Result = $mod.IntToHex(this.get(),$mod.TWordHelper.Size() * 2);
      return Result;
    };
    this.ToString$1 = function () {
      var Result = "";
      Result = $mod.IntToStr(this.get());
      return Result;
    };
    this.SetBit = function (Index) {
      var Result = 0;
      this.set(this.get() | (1 << Index));
      Result = this.get();
      return Result;
    };
    this.ClearBit = function (Index) {
      var Result = 0;
      this.set(this.get() & ~(1 << Index));
      Result = this.get();
      return Result;
    };
    this.ToggleBit = function (Index) {
      var Result = 0;
      this.set(this.get() ^ (1 << Index));
      Result = this.get();
      return Result;
    };
    this.TestBit = function (Index) {
      var Result = false;
      Result = (this.get() & (1 << Index)) !== 0;
      return Result;
    };
  });
  rtl.createHelper(this,"TCardinalHelper",null,function () {
    this.MaxValue = 4294967295;
    this.MinValue = 0;
    this.Parse = function (AString) {
      var Result = 0;
      Result = $mod.StrToInt(AString);
      return Result;
    };
    this.Size = function () {
      var Result = 0;
      Result = 4;
      return Result;
    };
    this.ToString = function (AValue) {
      var Result = "";
      Result = $mod.IntToStr(AValue);
      return Result;
    };
    this.TryParse = function (AString, AValue) {
      var Result = false;
      var C = 0;
      pas.System.val$7(AString,AValue,{get: function () {
          return C;
        }, set: function (v) {
          C = v;
        }});
      Result = C === 0;
      return Result;
    };
    this.ToBoolean = function () {
      var Result = false;
      Result = this.get() !== 0;
      return Result;
    };
    this.ToDouble = function () {
      var Result = 0.0;
      Result = this.get();
      return Result;
    };
    this.ToExtended = function () {
      var Result = 0.0;
      Result = this.get();
      return Result;
    };
    this.ToBinString = function () {
      var Result = "";
      Result = pas.System.binstr(this.get(),$mod.TCardinalHelper.Size() * 8);
      return Result;
    };
    this.ToHexString = function (AMinDigits) {
      var Result = "";
      Result = $mod.IntToHex(this.get(),AMinDigits);
      return Result;
    };
    this.ToHexString$1 = function () {
      var Result = "";
      Result = $mod.TCardinalHelper.ToHexString.call(this,$mod.TCardinalHelper.Size() * 2);
      return Result;
    };
    this.ToString$1 = function () {
      var Result = "";
      Result = $mod.IntToStr(this.get());
      return Result;
    };
    this.SetBit = function (Index) {
      var Result = 0;
      this.set(rtl.lw(this.get() | rtl.lw(1 << Index)));
      Result = this.get();
      return Result;
    };
    this.ClearBit = function (Index) {
      var Result = 0;
      this.set(rtl.lw(this.get() & rtl.lw(~rtl.lw(1 << Index))));
      Result = this.get();
      return Result;
    };
    this.ToggleBit = function (Index) {
      var Result = 0;
      this.set(rtl.lw(this.get() ^ rtl.lw(1 << Index)));
      Result = this.get();
      return Result;
    };
    this.TestBit = function (Index) {
      var Result = false;
      Result = rtl.lw(this.get() & rtl.lw(1 << Index)) !== 0;
      return Result;
    };
  });
  rtl.createHelper(this,"TIntegerHelper",null,function () {
    this.MaxValue = 2147483647;
    this.MinValue = -2147483648;
    this.Size = function () {
      var Result = 0;
      Result = 4;
      return Result;
    };
    this.ToString = function (AValue) {
      var Result = "";
      Result = $mod.IntToStr(AValue);
      return Result;
    };
    this.Parse = function (AString) {
      var Result = 0;
      Result = $mod.StrToInt(AString);
      return Result;
    };
    this.TryParse = function (AString, AValue) {
      var Result = false;
      var C = 0;
      pas.System.val$6(AString,AValue,{get: function () {
          return C;
        }, set: function (v) {
          C = v;
        }});
      Result = C === 0;
      return Result;
    };
    this.ToBoolean = function () {
      var Result = false;
      Result = this.get() !== 0;
      return Result;
    };
    this.ToDouble = function () {
      var Result = 0.0;
      Result = this.get();
      return Result;
    };
    this.ToExtended = function () {
      var Result = 0.0;
      Result = this.get();
      return Result;
    };
    this.ToBinString = function () {
      var Result = "";
      Result = pas.System.binstr(this.get(),$mod.TIntegerHelper.Size() * 8);
      return Result;
    };
    this.ToHexString = function (AMinDigits) {
      var Result = "";
      var B = 0;
      var U = null;
      var S = null;
      if (this.get() >= 0) {
        B = this.get()}
       else {
        S = new Int32Array(1);
        S[0] = this.get();
        U = new Uint32Array(S);
        B = U[0];
      };
      Result = $mod.IntToHex(B,AMinDigits);
      return Result;
    };
    this.ToHexString$1 = function () {
      var Result = "";
      Result = $mod.TIntegerHelper.ToHexString.call(this,$mod.TIntegerHelper.Size() * 2);
      return Result;
    };
    this.ToString$1 = function () {
      var Result = "";
      Result = $mod.IntToStr(this.get());
      return Result;
    };
    this.SetBit = function (Index) {
      var Result = 0;
      this.set(this.get() | (1 << Index));
      Result = this.get();
      return Result;
    };
    this.ClearBit = function (Index) {
      var Result = 0;
      this.set(this.get() & ~(1 << Index));
      Result = this.get();
      return Result;
    };
    this.ToggleBit = function (Index) {
      var Result = 0;
      this.set(this.get() ^ (1 << Index));
      Result = this.get();
      return Result;
    };
    this.TestBit = function (Index) {
      var Result = false;
      Result = (this.get() & (1 << Index)) !== 0;
      return Result;
    };
  });
  rtl.createHelper(this,"TUInt64Helper",null,function () {
    this.ToString = function (AValue) {
      var Result = "";
      Result = $mod.IntToStr(AValue);
      return Result;
    };
    this.ToString$1 = function () {
      var Result = "";
      Result = $mod.IntToStr(this.get());
      return Result;
    };
  });
  rtl.createHelper(this,"TNativeIntHelper",null,function () {
    this.MaxValue = 9007199254740991;
    this.MinValue = -9007199254740991;
    this.Parse = function (AString) {
      var Result = 0;
      Result = $mod.StrToInt(AString);
      return Result;
    };
    this.Size = function () {
      var Result = 0;
      Result = 7;
      return Result;
    };
    this.ToString = function (AValue) {
      var Result = "";
      Result = $mod.IntToStr(AValue);
      return Result;
    };
    this.TryParse = function (AString, AValue) {
      var Result = false;
      var C = 0;
      pas.System.val(AString,AValue,{get: function () {
          return C;
        }, set: function (v) {
          C = v;
        }});
      Result = C === 0;
      return Result;
    };
    this.ToBoolean = function () {
      var Result = false;
      Result = this.get() !== 0;
      return Result;
    };
    this.ToDouble = function () {
      var Result = 0.0;
      Result = this.get();
      return Result;
    };
    this.ToExtended = function () {
      var Result = 0.0;
      Result = this.get();
      return Result;
    };
    this.ToBinString = function () {
      var Result = "";
      Result = pas.System.binstr(this.get(),$mod.TNativeIntHelper.Size() * 8);
      return Result;
    };
    this.ToHexString = function (AMinDigits) {
      var Result = "";
      Result = $mod.IntToHex(this.get(),AMinDigits);
      return Result;
    };
    this.ToHexString$1 = function () {
      var Result = "";
      Result = $mod.IntToHex(this.get(),$mod.TNativeIntHelper.Size() * 2);
      return Result;
    };
    this.ToString$1 = function () {
      var Result = "";
      Result = $mod.IntToStr(this.get());
      return Result;
    };
    this.SetBit = function (Index) {
      var Result = 0;
      this.set(rtl.or(this.get(),rtl.shl(1,Index)));
      Result = this.get();
      return Result;
    };
    this.ClearBit = function (Index) {
      var Result = 0;
      this.set(rtl.and(this.get(),~rtl.shl(1,Index)));
      Result = this.get();
      return Result;
    };
    this.ToggleBit = function (Index) {
      var Result = 0;
      this.set(rtl.xor(this.get(),rtl.shl(1,Index)));
      Result = this.get();
      return Result;
    };
    this.TestBit = function (Index) {
      var Result = false;
      Result = rtl.and(this.get(),rtl.shl(1,Index)) !== 0;
      return Result;
    };
  });
  rtl.createHelper(this,"TNativeUIntHelper",null,function () {
    this.MaxValue = 9007199254740991;
    this.MinValue = 0;
    this.Parse = function (AString) {
      var Result = 0;
      Result = $mod.StrToInt(AString);
      return Result;
    };
    this.Size = function () {
      var Result = 0;
      Result = 7;
      return Result;
    };
    this.ToString = function (AValue) {
      var Result = "";
      Result = $mod.IntToStr(AValue);
      return Result;
    };
    this.TryParse = function (AString, AValue) {
      var Result = false;
      var C = 0;
      pas.System.val$1(AString,AValue,{get: function () {
          return C;
        }, set: function (v) {
          C = v;
        }});
      Result = C === 0;
      return Result;
    };
    this.ToBoolean = function () {
      var Result = false;
      Result = this.get() !== 0;
      return Result;
    };
    this.ToDouble = function () {
      var Result = 0.0;
      Result = this.get();
      return Result;
    };
    this.ToExtended = function () {
      var Result = 0.0;
      Result = this.get();
      return Result;
    };
    this.ToBinString = function () {
      var Result = "";
      Result = pas.System.binstr(this.get(),$mod.TNativeUIntHelper.Size() * 8);
      return Result;
    };
    this.ToHexString = function (AMinDigits) {
      var Result = "";
      Result = $mod.IntToHex(this.get(),AMinDigits);
      return Result;
    };
    this.ToHexString$1 = function () {
      var Result = "";
      Result = $mod.IntToHex(this.get(),$mod.TNativeUIntHelper.Size() * 2);
      return Result;
    };
    this.ToSingle = function () {
      var Result = 0.0;
      Result = this.get();
      return Result;
    };
    this.ToString$1 = function () {
      var Result = "";
      Result = $mod.IntToStr(this.get());
      return Result;
    };
    this.SetBit = function (Index) {
      var Result = 0;
      this.set(rtl.or(this.get(),rtl.shl(1,Index)));
      Result = this.get();
      return Result;
    };
    this.ClearBit = function (Index) {
      var Result = 0;
      this.set(rtl.and(this.get(),~rtl.shl(1,Index)));
      Result = this.get();
      return Result;
    };
    this.ToggleBit = function (Index) {
      var Result = 0;
      this.set(rtl.xor(this.get(),rtl.shl(1,Index)));
      Result = this.get();
      return Result;
    };
    this.TestBit = function (Index) {
      var Result = false;
      Result = rtl.and(this.get(),rtl.shl(1,Index)) !== 0;
      return Result;
    };
  });
  this.TUseBoolStrs = {"0": "False", False: 0, "1": "True", True: 1};
  this.$rtti.$Enum("TUseBoolStrs",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TUseBoolStrs});
  rtl.createHelper(this,"TBooleanHelper",null,function () {
    this.Parse = function (S) {
      var Result = false;
      Result = $mod.StrToBool(S);
      return Result;
    };
    this.Size = function () {
      var Result = 0;
      Result = 1;
      return Result;
    };
    this.ToString = function (AValue, UseBoolStrs) {
      var Result = "";
      Result = $mod.BoolToStr(AValue,UseBoolStrs === $mod.TUseBoolStrs.True);
      return Result;
    };
    this.TryToParse = function (S, AValue) {
      var Result = false;
      Result = $mod.TryStrToBool(S,AValue);
      return Result;
    };
    this.ToInteger = function () {
      var Result = 0;
      Result = (this.get() ? 1 : 0);
      return Result;
    };
    this.ToString$1 = function (UseBoolStrs) {
      var Result = "";
      Result = $mod.BoolToStr(this.get(),UseBoolStrs === $mod.TUseBoolStrs.True);
      return Result;
    };
  });
  rtl.createHelper(this,"TByteBoolHelper",null,function () {
    this.Parse = function (S) {
      var Result = false;
      Result = $mod.StrToBool(S);
      return Result;
    };
    this.Size = function () {
      var Result = 0;
      Result = 1;
      return Result;
    };
    this.ToString = function (AValue, UseBoolStrs) {
      var Result = "";
      Result = $mod.BoolToStr(AValue,UseBoolStrs);
      return Result;
    };
    this.TryToParse = function (S, AValue) {
      var Result = false;
      Result = $mod.TryStrToBool(S,AValue);
      return Result;
    };
    this.ToInteger = function () {
      var Result = 0;
      Result = (this.get() ? 1 : 0);
      return Result;
    };
    this.ToString$1 = function (UseBoolStrs) {
      var Result = "";
      Result = $mod.BoolToStr(this.get(),UseBoolStrs);
      return Result;
    };
  });
  rtl.createHelper(this,"TWordBoolHelper",null,function () {
    this.Parse = function (S) {
      var Result = false;
      Result = $mod.StrToBool(S);
      return Result;
    };
    this.Size = function () {
      var Result = 0;
      Result = 2;
      return Result;
    };
    this.ToString = function (AValue, UseBoolStrs) {
      var Result = "";
      Result = $mod.BoolToStr(AValue,UseBoolStrs);
      return Result;
    };
    this.TryToParse = function (S, AValue) {
      var Result = false;
      Result = $mod.TryStrToBool(S,AValue);
      return Result;
    };
    this.ToInteger = function () {
      var Result = 0;
      Result = (this.get() ? 1 : 0);
      return Result;
    };
    this.ToString$1 = function (UseBoolStrs) {
      var Result = "";
      Result = $mod.BoolToStr(this.get(),UseBoolStrs);
      return Result;
    };
  });
  rtl.createHelper(this,"TLongBoolHelper",null,function () {
    this.Parse = function (S) {
      var Result = false;
      Result = $mod.StrToBool(S);
      return Result;
    };
    this.Size = function () {
      var Result = 0;
      Result = 4;
      return Result;
    };
    this.ToString = function (AValue, UseBoolStrs) {
      var Result = "";
      Result = $mod.BoolToStr(AValue,UseBoolStrs);
      return Result;
    };
    this.TryToParse = function (S, AValue) {
      var Result = false;
      Result = $mod.TryStrToBool(S,AValue);
      return Result;
    };
    this.ToInteger = function () {
      var Result = 0;
      Result = (this.get() ? 1 : 0);
      return Result;
    };
    this.ToString$1 = function (UseBoolStrs) {
      var Result = "";
      Result = $mod.BoolToStr(this.get(),UseBoolStrs);
      return Result;
    };
  });
  rtl.createClass(this,"TStringBuilder",pas.System.TObject,function () {
    this.DefaultCapacity = 64;
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FData = "";
      this.FMaxCapacity = 0;
    };
    this.GetCapacity = function () {
      var Result = 0;
      Result = this.FData.length;
      return Result;
    };
    this.SetCapacity = function (AValue) {
      if (AValue > this.FMaxCapacity) throw $mod.ERangeError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SListCapacityError"),pas.System.VarRecs(0,AValue)]);
      if (AValue < this.GetLength()) throw $mod.ERangeError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SListCapacityError"),pas.System.VarRecs(0,AValue)]);
    };
    this.GetC = function (Index) {
      var Result = "\x00";
      this.CheckNegative(Index + 1,"Index");
      this.CheckRange(Index + 1,0,this.GetLength());
      Result = this.FData.charAt((Index + 1) - 1);
      return Result;
    };
    this.SetC = function (Index, AValue) {
      this.CheckNegative(Index + 1,"Index");
      this.CheckRange(Index + 1,0,this.GetLength());
      this.FData = rtl.setCharAt(this.FData,(Index + 1) - 1,AValue);
    };
    this.GetLength = function () {
      var Result = 0;
      Result = this.FData.length;
      return Result;
    };
    this.SetLength = function (AValue) {
      this.CheckNegative(AValue,"AValue");
      this.CheckRange(AValue,0,this.FMaxCapacity);
      this.FData = rtl.strSetLength(this.FData,AValue);
    };
    this.CheckRange = function (Idx, Count, MaxLen) {
      if ((Idx < 0) || ((Idx + Count) > MaxLen)) throw $mod.ERangeError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SListIndexError"),pas.System.VarRecs(0,Idx)]);
    };
    this.CheckNegative = function (AValue, AName) {
      if (AValue < 0) throw $mod.ERangeError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SParamIsNegative"),pas.System.VarRecs(18,AName)]);
    };
    this.DoAppend = function (S) {
      this.FData = this.FData + S;
    };
    this.DoAppend$1 = function (AValue, Idx, aCount) {
      var S = "";
      var I = 0;
      S = "";
      this.CheckRange(Idx,aCount,rtl.length(AValue));
      for (var $l = Idx, $end = (Idx + aCount) - 1; $l <= $end; $l++) {
        I = $l;
        S = S + AValue[I];
      };
      this.DoAppend(S);
    };
    this.DoInsert = function (Index, AValue) {
      this.CheckRange(Index,0,this.GetLength() - 1);
      pas.System.Insert(AValue,{p: this, get: function () {
          return this.p.FData;
        }, set: function (v) {
          this.p.FData = v;
        }},Index + 1);
    };
    this.DoInsert$1 = function (Index, AValue, StartIndex, aCharCount) {
      var I = 0;
      var S = "";
      this.CheckRange(Index,0,this.GetLength() - 1);
      this.CheckNegative(StartIndex,"StartIndex");
      this.CheckNegative(aCharCount,"SBCharCount");
      this.CheckRange(StartIndex,aCharCount,rtl.length(AValue));
      S = "";
      for (var $l = StartIndex, $end = (StartIndex + aCharCount) - 1; $l <= $end; $l++) {
        I = $l;
        S = S + AValue[I];
      };
      this.DoInsert(Index,S);
    };
    this.DoReplace = function (Index, Old, New) {
      var OVLen = 0;
      OVLen = Old.length;
      pas.System.Delete({p: this, get: function () {
          return this.p.FData;
        }, set: function (v) {
          this.p.FData = v;
        }},Index + 1,OVLen);
      pas.System.Insert(New,{p: this, get: function () {
          return this.p.FData;
        }, set: function (v) {
          this.p.FData = v;
        }},Index + 1);
    };
    this.Grow = function () {
      var NewCapacity = 0;
      NewCapacity = this.GetCapacity() * 2;
      if (NewCapacity > this.FMaxCapacity) NewCapacity = this.FMaxCapacity;
      this.SetCapacity(NewCapacity);
    };
    this.Shrink = function () {
      if (rtl.trunc(this.GetCapacity() / 4) >= this.GetLength()) this.SetCapacity(rtl.trunc(this.GetCapacity() / 2));
    };
    this.Create$1 = function () {
      this.Create$4(64,2147483647);
      return this;
    };
    this.Create$2 = function (aCapacity) {
      this.Create$4(aCapacity,2147483647);
      return this;
    };
    this.Create$3 = function (AValue) {
      this.Create$5(AValue,64);
      return this;
    };
    this.Create$4 = function (aCapacity, aMaxCapacity) {
      this.FMaxCapacity = aMaxCapacity;
      this.SetCapacity(aCapacity);
      return this;
    };
    this.Create$5 = function (AValue, aCapacity) {
      this.Create$4(aCapacity,2147483647);
      if (AValue.length > 0) this.Append$14(AValue);
      return this;
    };
    this.Create$6 = function (AValue, StartIndex, aLength, aCapacity) {
      this.Create$5(pas.System.Copy(AValue,StartIndex + 1,aLength),aCapacity);
      return this;
    };
    this.Append = function (AValue) {
      var Result = null;
      this.DoAppend($mod.BoolToStr(AValue,true));
      Result = this;
      return Result;
    };
    this.Append$1 = function (AValue) {
      var Result = null;
      this.DoAppend($mod.IntToStr(AValue));
      Result = this;
      return Result;
    };
    this.Append$2 = function (AValue) {
      var Result = null;
      this.DoAppend(AValue);
      Result = this;
      return Result;
    };
    this.Append$3 = function (AValue) {
      var Result = null;
      this.DoAppend($mod.CurrToStr(AValue));
      Result = this;
      return Result;
    };
    this.Append$4 = function (AValue) {
      var Result = null;
      this.DoAppend($mod.FloatToStr(AValue));
      Result = this;
      return Result;
    };
    this.Append$5 = function (AValue) {
      var Result = null;
      this.DoAppend($mod.IntToStr(AValue));
      Result = this;
      return Result;
    };
    this.Append$6 = function (AValue) {
      var Result = null;
      this.DoAppend($mod.IntToStr(AValue));
      Result = this;
      return Result;
    };
    this.Append$7 = function (AValue) {
      var Result = null;
      this.DoAppend($mod.IntToStr(AValue));
      Result = this;
      return Result;
    };
    this.Append$8 = function (AValue) {
      var Result = null;
      this.DoAppend(AValue.ToString());
      Result = this;
      return Result;
    };
    this.Append$9 = function (AValue) {
      var Result = null;
      this.DoAppend($mod.IntToStr(AValue));
      Result = this;
      return Result;
    };
    this.Append$10 = function (AValue) {
      var Result = null;
      this.DoAppend($mod.IntToStr(AValue));
      Result = this;
      return Result;
    };
    this.Append$11 = function (AValue) {
      var Result = null;
      var I = 0;
      var L = 0;
      I = -1;
      L = rtl.length(AValue);
      if (L === 0) return this;
      do {
        I += 1;
      } while (!((I >= L) || (AValue[I] === "\x00")));
      this.DoAppend$1(AValue,0,I);
      Result = this;
      return Result;
    };
    this.Append$12 = function (AValue) {
      var Result = null;
      this.Append$14($mod.IntToStr(AValue));
      Result = this;
      return Result;
    };
    this.Append$13 = function (AValue) {
      var Result = null;
      this.DoAppend($mod.IntToStr(AValue));
      Result = this;
      return Result;
    };
    this.Append$14 = function (AValue) {
      var Result = null;
      this.DoAppend(AValue);
      Result = this;
      return Result;
    };
    this.Append$15 = function (AValue, RepeatCount) {
      var Result = null;
      this.DoAppend(pas.System.StringOfChar(AValue,RepeatCount));
      Result = this;
      return Result;
    };
    this.Append$16 = function (AValue, StartIndex, SBCharCount) {
      var Result = null;
      this.DoAppend$1(AValue,StartIndex,SBCharCount);
      Result = this;
      return Result;
    };
    this.Append$17 = function (AValue, StartIndex, Count) {
      var Result = null;
      this.CheckRange(StartIndex,Count,AValue.length);
      this.DoAppend(pas.System.Copy(AValue,StartIndex + 1,Count));
      Result = this;
      return Result;
    };
    this.Append$18 = function (Fmt, Args) {
      var Result = null;
      this.DoAppend($mod.Format(Fmt,Args));
      Result = this;
      return Result;
    };
    this.AppendFormat = function (Fmt, Args) {
      var Result = null;
      this.DoAppend($mod.Format(Fmt,Args));
      Result = this;
      return Result;
    };
    this.AppendLine = function () {
      var Result = null;
      this.DoAppend(pas.System.sLineBreak);
      Result = this;
      return Result;
    };
    this.AppendLine$1 = function (AValue) {
      var Result = null;
      this.DoAppend(AValue);
      Result = this.AppendLine();
      return Result;
    };
    this.Clear = function () {
      this.SetLength(0);
      this.SetCapacity(64);
    };
    this.CopyTo = function (SourceIndex, Destination, DestinationIndex, Count) {
      var I = 0;
      this.CheckNegative(Count,"Count");
      this.CheckNegative(DestinationIndex,"DestinationIndex");
      this.CheckRange(DestinationIndex,Count,rtl.length(Destination.get()));
      if (Count > 0) {
        this.CheckRange(SourceIndex,Count,this.GetLength());
        for (var $l = SourceIndex + 1, $end = SourceIndex + Count; $l <= $end; $l++) {
          I = $l;
          Destination.get()[DestinationIndex] = this.FData.charAt(I - 1);
        };
      };
    };
    this.EnsureCapacity = function (aCapacity) {
      var Result = 0;
      this.CheckRange(aCapacity,0,this.FMaxCapacity);
      if (this.GetCapacity() < aCapacity) this.SetCapacity(aCapacity);
      Result = this.GetCapacity();
      return Result;
    };
    this.Equals$1 = function (StringBuilder) {
      var Result = false;
      Result = StringBuilder !== null;
      if (Result) Result = (this.GetLength() === StringBuilder.GetLength()) && (this.FMaxCapacity === StringBuilder.FMaxCapacity) && (this.FData === StringBuilder.FData.charAt(-1));
      return Result;
    };
    this.Insert = function (Index, AValue) {
      var Result = null;
      this.DoInsert(Index,$mod.BoolToStr(AValue,true));
      Result = this;
      return Result;
    };
    this.Insert$1 = function (Index, AValue) {
      var Result = null;
      this.DoInsert(Index,$mod.IntToStr(AValue));
      Result = this;
      return Result;
    };
    this.Insert$2 = function (Index, AValue) {
      var Result = null;
      this.DoInsert(Index,AValue);
      Result = this;
      return Result;
    };
    this.Insert$3 = function (Index, AValue) {
      var Result = null;
      this.DoInsert(Index,$mod.CurrToStr(AValue));
      Result = this;
      return Result;
    };
    this.Insert$4 = function (Index, AValue) {
      var Result = null;
      this.DoInsert(Index,$mod.FloatToStr(AValue));
      Result = this;
      return Result;
    };
    this.Insert$5 = function (Index, AValue) {
      var Result = null;
      this.DoInsert(Index,$mod.IntToStr(AValue));
      Result = this;
      return Result;
    };
    this.Insert$6 = function (Index, AValue) {
      var Result = null;
      this.DoInsert(Index,$mod.IntToStr(AValue));
      Result = this;
      return Result;
    };
    this.Insert$7 = function (Index, AValue) {
      var Result = null;
      this.DoInsert$1(Index,AValue,0,rtl.length(AValue));
      Result = this;
      return Result;
    };
    this.Insert$8 = function (Index, AValue) {
      var Result = null;
      this.DoInsert(Index,$mod.IntToStr(AValue));
      Result = this;
      return Result;
    };
    this.Insert$9 = function (Index, AValue) {
      var Result = null;
      this.DoInsert(Index,AValue.ToString());
      Result = this;
      return Result;
    };
    this.Insert$10 = function (Index, AValue) {
      var Result = null;
      this.DoInsert(Index,$mod.IntToStr(AValue));
      Result = this;
      return Result;
    };
    this.Insert$11 = function (Index, AValue) {
      var Result = null;
      this.DoInsert(Index,AValue);
      Result = this;
      return Result;
    };
    this.Insert$12 = function (Index, AValue) {
      var Result = null;
      this.DoInsert(Index,$mod.IntToStr(AValue));
      Result = this;
      return Result;
    };
    this.Insert$13 = function (Index, AValue) {
      var Result = null;
      this.DoInsert(Index,$mod.IntToStr(AValue));
      Result = this;
      return Result;
    };
    this.Insert$14 = function (Index, AValue) {
      var Result = null;
      this.DoInsert(Index,$mod.IntToStr(AValue));
      Result = this;
      return Result;
    };
    this.Insert$15 = function (Index, AValue, aRepeatCount) {
      var Result = null;
      var I = 0;
      for (var $l = 0, $end = aRepeatCount - 1; $l <= $end; $l++) {
        I = $l;
        this.DoInsert(Index,AValue);
      };
      Result = this;
      return Result;
    };
    this.Insert$16 = function (Index, AValue, startIndex, SBCharCount) {
      var Result = null;
      this.DoInsert$1(Index,AValue,startIndex,SBCharCount);
      Result = this;
      return Result;
    };
    this.Remove = function (StartIndex, RemLength) {
      var Result = null;
      var MoveIndex = 0;
      if (RemLength === 0) return this;
      this.CheckNegative(RemLength,"RemLength");
      this.CheckRange(StartIndex,0,this.GetLength());
      MoveIndex = StartIndex + RemLength;
      this.CheckRange(MoveIndex,0,this.GetLength());
      pas.System.Delete({p: this, get: function () {
          return this.p.FData;
        }, set: function (v) {
          this.p.FData = v;
        }},StartIndex + 1,RemLength);
      this.Shrink();
      Result = this;
      return Result;
    };
    this.Replace = function (OldValue, NewValue) {
      var Result = null;
      Result = this.Replace$1(OldValue,NewValue,0,this.GetLength());
      return Result;
    };
    this.Replace$1 = function (OldValue, NewValue, StartIndex, Count) {
      var Result = null;
      var I = 0;
      var Start = "";
      if (Count === 0) return this;
      this.CheckNegative(StartIndex,"StartIndex");
      this.CheckNegative(Count,"Count");
      this.CheckRange(StartIndex,Count,this.GetLength());
      Start = pas.System.Copy(this.FData,1,StartIndex);
      this.FData = pas.System.Copy$1(this.FData,StartIndex + 1);
      for (var $l = 1, $end = Count; $l <= $end; $l++) {
        I = $l;
        this.FData = $mod.StringReplace(this.FData,OldValue,NewValue,{});
      };
      this.FData = Start + this.FData;
      Result = this;
      return Result;
    };
    this.ToString = function () {
      var Result = "";
      Result = this.ToString$2(0,this.GetLength());
      return Result;
    };
    this.ToString$2 = function (aStartIndex, aLength) {
      var Result = "";
      this.CheckNegative(aStartIndex,"aStartIndex");
      this.CheckNegative(aLength,"aLength");
      this.CheckRange(aStartIndex,aLength,this.GetLength());
      Result = pas.System.Copy(this.FData,1 + aStartIndex,aStartIndex + aLength);
      return Result;
    };
  });
  rtl.createClass(this,"TEncoding",pas.System.TObject,function () {
    this.FANSI = null;
    this.FASCII = null;
    this.FUnicode = null;
    this.FUTF7 = null;
    this.FUTF8 = null;
    this.GetANSI = function () {
      var Result = null;
      if (!(this.FANSI != null)) $mod.TEncoding.FANSI = $mod.TANSIEncoding.$create("Create");
      Result = this.FANSI;
      return Result;
    };
    this.GetASCII = function () {
      var Result = null;
      if (!(this.FASCII != null)) $mod.TEncoding.FASCII = $mod.TASCIIEncoding.$create("Create");
      Result = this.FASCII;
      return Result;
    };
    this.GetDefault = function () {
      var Result = null;
      Result = this.GetANSI();
      return Result;
    };
    this.GetUnicode = function () {
      var Result = null;
      if (!(this.FUnicode != null)) $mod.TEncoding.FUnicode = $mod.TUnicodeEncoding.$create("Create");
      Result = this.FUnicode;
      return Result;
    };
    this.GetUTF7 = function () {
      var Result = null;
      if (!(this.FUTF7 != null)) $mod.TEncoding.FUTF7 = $mod.TUTF7Encoding.$create("Create");
      Result = this.FUTF7;
      return Result;
    };
    this.GetUTF8 = function () {
      var Result = null;
      if (!(this.FUTF8 != null)) $mod.TEncoding.FUTF8 = $mod.TUTF8Encoding.$create("Create");
      Result = this.FUTF8;
      return Result;
    };
    var cEncoding = "utf-8";
    this.GetEncoding = function () {
      var Result = "";
      Result = cEncoding;
      return Result;
    };
    this.IsStandardEncoding = function (AEncoding) {
      var Result = false;
      Result = (AEncoding !== null) && ((AEncoding === this.GetANSI()) || (AEncoding === this.GetUnicode()));
      return Result;
    };
    this.GetByteCount$1 = function (AChars, ACharCount) {
      var Result = 0;
      Result = this.GetByteCount($mod.TStringHelper.Substring$1.call({get: function () {
          return AChars;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }},0,ACharCount));
      return Result;
    };
    this.GetByteCount$2 = function (AChars, ACharIndex, ACharCount) {
      var Result = 0;
      Result = this.GetByteCount($mod.TStringHelper.Substring$1.call({get: function () {
          return AChars;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }},ACharIndex,ACharCount));
      return Result;
    };
    this.GetBytes$1 = function (AChars, ACharCount) {
      var Result = [];
      Result = this.GetBytes($mod.TStringHelper.Substring$1.call({get: function () {
          return AChars;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }},0,ACharCount));
      return Result;
    };
    this.GetBytes$2 = function (AChars, ACharIndex, ACharCount) {
      var Result = [];
      Result = this.GetBytes($mod.TStringHelper.Substring$1.call({get: function () {
          return AChars;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }},ACharIndex,ACharCount));
      return Result;
    };
    this.GetString$1 = function (ABytes, ACharCount) {
      var Result = "";
      Result = this.GetString($impl.TBytesHelper.SubBytes.call({get: function () {
          return ABytes;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }},0,ACharCount));
      return Result;
    };
    this.GetString$2 = function (ABytes, ACharIndex, ACharCount) {
      var Result = "";
      Result = this.GetString($impl.TBytesHelper.SubBytes.call({get: function () {
          return ABytes;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }},ACharIndex,ACharCount));
      return Result;
    };
  });
  rtl.createClass(this,"TANSIEncoding",this.TEncoding,function () {
    var cEncoding$1 = "windows-1252";
    this.GetEncoding = function () {
      var Result = "";
      Result = cEncoding$1;
      return Result;
    };
    this.GetByteCount = function (AChars) {
      var Result = 0;
      Result = $mod.TStringHelper.GetLength.call({get: function () {
          return AChars;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }});
      return Result;
    };
    this.GetBytes = function (AChars) {
      var Result = [];
      Result = $mod.BytesOf(AChars);
      return Result;
    };
    this.GetString = function (ABytes) {
      var Result = "";
      Result = $mod.StringOf(ABytes);
      return Result;
    };
  });
  rtl.createClass(this,"TASCIIEncoding",this.TANSIEncoding,function () {
    var cEncoding$2 = "ISO-8859-2";
    this.GetEncoding = function () {
      var Result = "";
      Result = cEncoding$2;
      return Result;
    };
  });
  rtl.createClass(this,"TUnicodeEncoding",this.TEncoding,function () {
    this.InternalGetBytes = function (AChars, ABytes) {
      var lWords = [];
      lWords = [];
      for (var lCount = 0; lCount < AChars.length; lCount++)
      lWords.push(AChars.charCodeAt(lCount));
      ABytes.set($impl.TWordsHelper.ToBytes.call({get: function () {
          return lWords;
        }, set: function (v) {
          lWords = v;
        }}));
    };
    var cEncoding$1 = "unicode";
    this.GetEncoding = function () {
      var Result = "";
      Result = cEncoding$1;
      return Result;
    };
    var cCharSize = 2;
    this.GetByteCount = function (AChars) {
      var Result = 0;
      Result = 2 * $mod.TStringHelper.GetLength.call({get: function () {
          return AChars;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }});
      return Result;
    };
    this.GetBytes = function (AChars) {
      var Result = [];
      this.InternalGetBytes(AChars,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.GetString = function (ABytes) {
      var Result = "";
      var lWords = [];
      var lBuffer = "";
      lBuffer = $mod.TStringHelper.Empty;
      lWords = $impl.TWordsHelper.FromBytes(ABytes);
      if (rtl.length(lWords) > 0) {
        for (var lCount = 0; lCount < lWords.length; lCount++)
        lBuffer += string.fromCharCode(lWords[lCount]);
      };
      Result = lBuffer;
      return Result;
    };
  });
  rtl.createClass(this,"TUTF8Encoding",this.TEncoding,function () {
    this.BytesToMemory = function (ABytes) {
      var Result = null;
      var lArray = null;
      Result = new ArrayBuffer($impl.TBytesHelper.GetLength.call({get: function () {
          return ABytes;
        }, set: function (v) {
          ABytes = v;
        }}));
      lArray = new Uint8Array(Result);
      lArray.set(ABytes);
      return Result;
    };
    this.MemoryToBytes = function (AMem) {
      var Result = [];
      var lCount = 0;
      for (var $l = 0, $end = AMem.length - 1; $l <= $end; $l++) {
        lCount = $l;
        Result[lCount] = AMem[lCount];
      };
      return Result;
    };
    var cEncoding$1 = "utf-8";
    this.GetEncoding = function () {
      var Result = "";
      Result = cEncoding$1;
      return Result;
    };
    this.GetByteCount = function (AChars) {
      var Result = 0;
      Result = $impl.TBytesHelper.GetLength.call({a: this.GetBytes(AChars), get: function () {
          return this.a;
        }, set: function (v) {
          this.a = v;
        }});
      return Result;
    };
    this.GetBytes = function (AChars) {
      var Result = [];
      var lArray = null;
      var lEncoder = null;
      lEncoder = new TextEncoder();
      lArray = lEncoder.encode(AChars);
      Result = this.$class.MemoryToBytes(lArray);
      return Result;
    };
    this.GetString = function (ABytes) {
      var Result = "";
      var lArray = null;
      var lDecoder = null;
      lDecoder = new TextDecoder();
      lArray = this.$class.BytesToMemory(rtl.arrayRef(ABytes));
      Result = lDecoder.decode(lArray);
      return Result;
    };
  });
  rtl.createClass(this,"TUTF7Encoding",this.TUTF8Encoding,function () {
    var cEncoding$2 = "utf-7";
    this.GetEncoding = function () {
      var Result = "";
      Result = cEncoding$2;
      return Result;
    };
  });
  this.TCmdLineSwitchType = {"0": "clstValueNextParam", clstValueNextParam: 0, "1": "clstValueAppended", clstValueAppended: 1, "2": "clstValueInternalUse", clstValueInternalUse: 2};
  this.$rtti.$Enum("TCmdLineSwitchType",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TCmdLineSwitchType});
  this.$rtti.$Set("TCmdLineSwitchTypes",{comptype: this.$rtti["TCmdLineSwitchType"]});
  this.clstValueNextParamForce = this.TCmdLineSwitchType.clstValueInternalUse;
  this.SwitchChars = rtl.createSet(45);
  this.FindCmdLineSwitch = function (ASwitch) {
    var Result = false;
    Result = $mod.FindCmdLineSwitch$2(ASwitch,$mod.SwitchChars,true);
    return Result;
  };
  this.FindCmdLineSwitch$1 = function (ASwitch, AIgnoreCase) {
    var Result = false;
    Result = $mod.FindCmdLineSwitch$2(ASwitch,$mod.SwitchChars,AIgnoreCase);
    return Result;
  };
  this.FindCmdLineSwitch$2 = function (ASwitch, AChars, AIgnoreCase) {
    var Result = false;
    var lSameSwitch = null;
    var lSwitch = "";
    var lSwitches = [];
    var lValue = "";
    if (AIgnoreCase) {
      lSameSwitch = $mod.AnsiSameText}
     else lSameSwitch = $impl.EqualsStr;
    lSwitches = $impl.ParseCmdLine();
    for (var $in = lSwitches, $l = 0, $end = rtl.length($in) - 1; $l <= $end; $l++) {
      lValue = $in[$l];
      if (rtl.eqSet(AChars,{}) || $mod.CharInSet$1(lValue.charAt(0),AChars)) {
        lSwitch = $mod.TStringHelper.Substring.call({get: function () {
            return lValue;
          }, set: function (v) {
            lValue = v;
          }},1);
        if (lSameSwitch(lSwitch,ASwitch)) return true;
      };
    };
    Result = false;
    return Result;
  };
  var cDeli$1 = ":";
  this.FindCmdLineSwitch$3 = function (ASwitch, AValue, AIgnoreCase, ASwitchTypes) {
    var Result = false;
    var lCompare = null;
    var lCount = 0;
    var lParam = "";
    var lSwitches = [];
    var lSwitchLen = 0;
    var lValueOfs = 0;
    Result = false;
    AValue.set($mod.TStringHelper.Empty);
    if (AIgnoreCase) {
      lCompare = $mod.SameText}
     else lCompare = $mod.SameStr;
    lSwitchLen = $mod.TStringHelper.GetLength.call({get: function () {
        return ASwitch;
      }, set: function (v) {
        rtl.raiseE("EPropReadOnly");
      }});
    lSwitches = $impl.ParseCmdLine();
    for (var $l = 0, $end = rtl.length(lSwitches) - 1; $l <= $end; $l++) {
      lCount = $l;
      lParam = lSwitches[lCount];
      if (!$mod.CharInSet$1($mod.TStringHelper.GetChar.call({get: function () {
          return lParam;
        }, set: function (v) {
          lParam = v;
        }},0),$mod.SwitchChars)) continue;
      if (!lCompare($mod.TStringHelper.Substring$1.call({get: function () {
          return lParam;
        }, set: function (v) {
          lParam = v;
        }},1,lSwitchLen),ASwitch)) continue;
      if ($mod.TStringHelper.GetLength.call({get: function () {
          return lParam;
        }, set: function (v) {
          lParam = v;
        }}) > (lSwitchLen + 1)) {
        if (!($mod.TCmdLineSwitchType.clstValueAppended in ASwitchTypes)) continue;
        lValueOfs = lSwitchLen + 1;
        if ($mod.TStringHelper.GetChar.call({get: function () {
            return lParam;
          }, set: function (v) {
            lParam = v;
          }},lValueOfs) === cDeli$1) lValueOfs += 1;
        AValue.set($mod.TStringHelper.Substring$1.call({get: function () {
            return lParam;
          }, set: function (v) {
            lParam = v;
          }},lValueOfs,2147483647));
      } else if (($mod.TCmdLineSwitchType.clstValueNextParam in ASwitchTypes) && (lCount < (rtl.length(lSwitches) - 1)) && !$mod.CharInSet$1($mod.TStringHelper.GetChar.call({a: lCount + 1, p: lSwitches, get: function () {
          return this.p[this.a];
        }, set: function (v) {
          this.p[this.a] = v;
        }},0),$mod.SwitchChars)) AValue.set(lSwitches[lCount + 1]);
      Result = true;
      break;
    };
    return Result;
  };
  this.$rtti.$RefToProcVar("TProc",{procsig: rtl.newTIProcSig([])});
  this.$rtti.$RefToProcVar("TProc<System.Boolean>",{procsig: rtl.newTIProcSig([["AArg1",rtl.boolean]])});
  this.$rtti.$RefToProcVar("TProc<System.Longint>",{procsig: rtl.newTIProcSig([["AArg1",rtl.longint]])});
  this.$rtti.$RefToProcVar("TProc<System.String,System.String,System.JSValue>",{procsig: rtl.newTIProcSig([["AArg1",rtl.string],["AArg2",rtl.string],["AArg3",rtl.jsvalue]])});
  this.$rtti.$RefToProcVar("TFunc<WEBLib.DataGrid.Options.TDGMultilevelHeaderParams,System.Boolean>",{init: function () {
      this.procsig = rtl.newTIProcSig([["AArg1",pas["WEBLib.DataGrid.Options"].$rtti["TDGMultilevelHeaderParams"]]],rtl.boolean);
    }});
  this.$rtti.$RefToProcVar("TProc<WEBLib.DataGrid.Options.TDGCollectionItem,JS.TJSArray>",{init: function () {
      this.procsig = rtl.newTIProcSig([["AArg1",pas["WEBLib.DataGrid.Options"].$rtti["TDGCollectionItem"]],["AArg2",pas.JS.$rtti["TJSArray"]]]);
    }});
  this.$rtti.$RefToProcVar("TFunc<WEBLib.Controls.TBiDiMode,System.JSValue>",{init: function () {
      this.procsig = rtl.newTIProcSig([["AArg1",pas["WEBLib.Controls"].$rtti["TBiDiMode"]]],rtl.jsvalue);
    }});
  this.$rtti.$RefToProcVar("TFunc<System.String,System.JSValue>",{procsig: rtl.newTIProcSig([["AArg1",rtl.string]],rtl.jsvalue)});
  this.$rtti.$RefToProcVar("TFunc<WEBLib.DataGrid.TDGRowSelectionType,System.JSValue>",{init: function () {
      this.procsig = rtl.newTIProcSig([["AArg1",pas["WEBLib.DataGrid"].$rtti["TDGRowSelectionType"]]],rtl.jsvalue);
    }});
  this.$rtti.$RefToProcVar("TFunc<WEBLib.DataGrid.TDGRowEditType,System.JSValue>",{init: function () {
      this.procsig = rtl.newTIProcSig([["AArg1",pas["WEBLib.DataGrid"].$rtti["TDGRowEditType"]]],rtl.jsvalue);
    }});
  this.$rtti.$RefToProcVar("TFunc<WEBLib.DataGrid.DataAdapter.Base.TDGServerDataAdapter,System.JSValue>",{init: function () {
      this.procsig = rtl.newTIProcSig([["AArg1",pas["WEBLib.DataGrid.DataAdapter.Base"].$rtti["TDGServerDataAdapter"]]],rtl.jsvalue);
    }});
  this.$rtti.$RefToProcVar("TFunc<WEBLib.DataGrid.Common.TDGCellDataType,System.JSValue>",{init: function () {
      this.procsig = rtl.newTIProcSig([["AArg1",pas["WEBLib.DataGrid.Common"].$rtti["TDGCellDataType"]]],rtl.jsvalue);
    }});
  this.$rtti.$RefToProcVar("TFunc<WEBLib.DataGrid.Options.TDGSelectCellEditorCollection,System.JSValue>",{init: function () {
      this.procsig = rtl.newTIProcSig([["AArg1",pas["WEBLib.DataGrid.Options"].$rtti["TDGSelectCellEditorCollection"]]],rtl.jsvalue);
    }});
  $mod.$implcode = function () {
    rtl.createHelper($impl,"TBytesHelper",null,function () {
      this.GetLength = function () {
        var Result = 0;
        Result = rtl.length(this.get());
        return Result;
      };
      this.SetLength = function (AValue) {
        this.set(rtl.arraySetLength(this.get(),0,AValue));
      };
      this.High = function () {
        var Result = 0;
        Result = rtl.length(this.get()) - 1;
        return Result;
      };
      this.Low = function () {
        var Result = 0;
        Result = 0;
        return Result;
      };
      this.SubBytes = function (AStartIndex, ALength) {
        var Result = [];
        Result = rtl.arrayCopy(0,this.get(),AStartIndex,ALength);
        return Result;
      };
    });
    $mod.$rtti.$DynArray("TWords",{eltype: rtl.word});
    rtl.createHelper($impl,"TWordsHelper",null,function () {
      this.GetLength = function () {
        var Result = 0;
        Result = rtl.length(this.get());
        return Result;
      };
      this.SetLength = function (AValue) {
        this.set(rtl.arraySetLength(this.get(),0,AValue));
      };
      var cBytesPerWord = 2;
      this.FromBytes = function (ABytes) {
        var Result = [];
        var lCount = 0;
        var lLow = 0;
        var lHigh = 0;
        lCount = $impl.TBytesHelper.GetLength.call({get: function () {
            return ABytes;
          }, set: function (v) {
            rtl.raiseE("EPropReadOnly");
          }});
        if (pas.System.Odd(lCount)) lCount += 1;
        $impl.TWordsHelper.SetLength.call({get: function () {
            return Result;
          }, set: function (v) {
            Result = v;
          }},rtl.trunc(lCount / 2));
        lCount = $impl.TBytesHelper.Low.call({get: function () {
            return ABytes;
          }, set: function (v) {
            rtl.raiseE("EPropReadOnly");
          }});
        while (lCount <= $impl.TBytesHelper.High.call({get: function () {
            return ABytes;
          }, set: function (v) {
            rtl.raiseE("EPropReadOnly");
          }})) {
          lLow = ABytes[lCount];
          if ((lCount + 1) <= $impl.TBytesHelper.High.call({get: function () {
              return ABytes;
            }, set: function (v) {
              rtl.raiseE("EPropReadOnly");
            }})) {
            lHigh = ABytes[lCount + 1]}
           else lHigh = 0;
          Result[rtl.trunc(lCount / 2)] = $mod.TWordHelper.FromBytes(lLow,lHigh);
          lCount += 2;
        };
        return Result;
      };
      this.High = function () {
        var Result = 0;
        Result = rtl.length(this.get()) - 1;
        return Result;
      };
      this.Low = function () {
        var Result = 0;
        Result = 0;
        return Result;
      };
      var cBytesPerWord$1 = 2;
      this.ToBytes = function () {
        var Result = [];
        var lLow = 0;
        var lHigh = 0;
        var lCount = 0;
        var lNewIndex = 0;
        $impl.TBytesHelper.SetLength.call({get: function () {
            return Result;
          }, set: function (v) {
            Result = v;
          }},$impl.TWordsHelper.GetLength.call(this) * 2);
        for (var $l = $impl.TWordsHelper.Low.call(this), $end = $impl.TWordsHelper.High.call(this); $l <= $end; $l++) {
          lCount = $l;
          $mod.TWordHelper.ToBytes.call({a: lCount, p: this.get(), get: function () {
              return this.p[this.a];
            }, set: function (v) {
              this.p[this.a] = v;
            }},{get: function () {
              return lLow;
            }, set: function (v) {
              lLow = v;
            }},{get: function () {
              return lHigh;
            }, set: function (v) {
              lHigh = v;
            }});
          lNewIndex = lCount * 2;
          Result[lNewIndex] = lLow;
          Result[lNewIndex + 1] = lHigh;
        };
        return Result;
      };
    });
    $impl.DefaultShortMonthNames = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
    $impl.DefaultLongMonthNames = ["January","February","March","April","May","June","July","August","September","October","November","December"];
    $impl.DefaultShortDayNames = ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];
    $impl.DefaultLongDayNames = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
    $impl.FInvariant = $mod.TFormatSettings.$new();
    $impl.FInvariantCreated = false;
    $impl.DoShowException = function (S) {
      if ($mod.OnShowException != null) {
        $mod.OnShowException(S)}
       else {
        window.alert(S);
      };
    };
    $mod.$rtti.$ProcVar("TRTLExceptionHandler",{procsig: rtl.newTIProcSig([["aError",rtl.jsvalue]])});
    $impl.OnPascalException = null;
    $impl.OnJSException = null;
    $impl.RTLExceptionHook = function (aError) {
      var S = "";
      if (pas.JS.isClassInstance(aError)) {
        if ($impl.OnPascalException != null) {
          $impl.OnPascalException(rtl.getObject(aError))}
         else $mod.ShowException(rtl.getObject(aError),null);
      } else if (rtl.isObject(aError)) {
        if ($impl.OnJSException != null) {
          $impl.OnJSException(aError)}
         else {
          if (aError.hasOwnProperty("message")) {
            S = rtl.getResStr($mod,"SErrUnknownExceptionType") + ("" + aError["message"])}
           else S = rtl.getResStr($mod,"SErrUnknownExceptionType") + aError.toString();
          $impl.DoShowException(S);
        };
      } else {
        S = rtl.getResStr($mod,"SErrUnknownExceptionType") + ("" + aError);
        $impl.DoShowException(S);
      };
    };
    $impl.CheckBoolStrs = function () {
      if (rtl.length($mod.TrueBoolStrs) === 0) {
        $mod.TrueBoolStrs = rtl.arraySetLength($mod.TrueBoolStrs,"",1);
        $mod.TrueBoolStrs[0] = "True";
      };
      if (rtl.length($mod.FalseBoolStrs) === 0) {
        $mod.FalseBoolStrs = rtl.arraySetLength($mod.FalseBoolStrs,"",1);
        $mod.FalseBoolStrs[0] = "False";
      };
    };
    $impl.feInvalidFormat = 1;
    $impl.feMissingArgument = 2;
    $impl.feInvalidArgIndex = 3;
    $impl.DoFormatError = function (ErrCode, fmt) {
      var $tmp = ErrCode;
      if ($tmp === 1) {
        throw $mod.EConvertError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SInvalidFormat"),pas.System.VarRecs(18,fmt)])}
       else if ($tmp === 2) {
        throw $mod.EConvertError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SArgumentMissing"),pas.System.VarRecs(18,fmt)])}
       else if ($tmp === 3) throw $mod.EConvertError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SInvalidArgIndex"),pas.System.VarRecs(18,fmt)]);
    };
    $impl.maxdigits = 15;
    $impl.ReplaceDecimalSep = function (S, DS) {
      var Result = "";
      var P = 0;
      P = pas.System.Pos(".",S);
      if (P > 0) {
        Result = pas.System.Copy(S,1,P - 1) + DS + pas.System.Copy(S,P + 1,S.length - P)}
       else Result = S;
      return Result;
    };
    $impl.FormatGeneralFloat = function (Value, Precision, DS) {
      var Result = "";
      var P = 0;
      var PE = 0;
      var Q = 0;
      var Exponent = 0;
      if ((Precision === -1) || (Precision > 15)) Precision = 15;
      Result = rtl.floatToStr(Value,Precision + 7);
      Result = $mod.TrimLeft(Result);
      P = pas.System.Pos(".",Result);
      if (P === 0) return Result;
      PE = pas.System.Pos("E",Result);
      if (PE === 0) {
        Result = $impl.ReplaceDecimalSep(Result,DS);
        return Result;
      };
      Q = PE + 2;
      Exponent = 0;
      while (Q <= Result.length) {
        Exponent = ((Exponent * 10) + Result.charCodeAt(Q - 1)) - 48;
        Q += 1;
      };
      if (Result.charAt((PE + 1) - 1) === "-") Exponent = -Exponent;
      if (((P + Exponent) < PE) && (Exponent > -6)) {
        Result = rtl.strSetLength(Result,PE - 1);
        if (Exponent >= 0) {
          for (var $l = 0, $end = Exponent - 1; $l <= $end; $l++) {
            Q = $l;
            Result = rtl.setCharAt(Result,P - 1,Result.charAt((P + 1) - 1));
            P += 1;
          };
          Result = rtl.setCharAt(Result,P - 1,".");
          P = 1;
          if (Result.charAt(P - 1) === "-") P += 1;
          while ((Result.charAt(P - 1) === "0") && (P < Result.length) && (pas.System.Copy(Result,P + 1,DS.length) !== DS)) pas.System.Delete({get: function () {
              return Result;
            }, set: function (v) {
              Result = v;
            }},P,1);
        } else {
          pas.System.Insert(pas.System.Copy("00000",1,-Exponent),{get: function () {
              return Result;
            }, set: function (v) {
              Result = v;
            }},P - 1);
          Result = rtl.setCharAt(Result,P - Exponent - 1,Result.charAt(P - Exponent - 1 - 1));
          Result = rtl.setCharAt(Result,P - 1,".");
          if (Exponent !== -1) Result = rtl.setCharAt(Result,P - Exponent - 1 - 1,"0");
        };
        Q = Result.length;
        while ((Q > 0) && (Result.charAt(Q - 1) === "0")) Q -= 1;
        if (Result.charAt(Q - 1) === ".") Q -= 1;
        if ((Q === 0) || ((Q === 1) && (Result.charAt(0) === "-"))) {
          Result = "0"}
         else Result = rtl.strSetLength(Result,Q);
      } else {
        while (Result.charAt(PE - 1 - 1) === "0") {
          pas.System.Delete({get: function () {
              return Result;
            }, set: function (v) {
              Result = v;
            }},PE - 1,1);
          PE -= 1;
        };
        if (Result.charAt(PE - 1 - 1) === DS) {
          pas.System.Delete({get: function () {
              return Result;
            }, set: function (v) {
              Result = v;
            }},PE - 1,1);
          PE -= 1;
        };
        if (Result.charAt((PE + 1) - 1) === "+") {
          pas.System.Delete({get: function () {
              return Result;
            }, set: function (v) {
              Result = v;
            }},PE + 1,1)}
         else PE += 1;
        while (Result.charAt((PE + 1) - 1) === "0") pas.System.Delete({get: function () {
            return Result;
          }, set: function (v) {
            Result = v;
          }},PE + 1,1);
      };
      Result = $impl.ReplaceDecimalSep(Result,DS);
      return Result;
    };
    $impl.FormatExponentFloat = function (Value, Precision, Digits, DS) {
      var Result = "";
      var P = 0;
      DS = $mod.FormatSettings.DecimalSeparator;
      if ((Precision === -1) || (Precision > 15)) Precision = 15;
      Result = rtl.floatToStr(Value,Precision + 7);
      while (Result.charAt(0) === " ") pas.System.Delete({get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }},1,1);
      P = pas.System.Pos("E",Result);
      if (P === 0) {
        Result = $impl.ReplaceDecimalSep(Result,DS);
        return Result;
      };
      P += 2;
      if (Digits > 4) Digits = 4;
      Digits = (Result.length - P - Digits) + 1;
      if (Digits < 0) {
        pas.System.Insert(pas.System.Copy("0000",1,-Digits),{get: function () {
            return Result;
          }, set: function (v) {
            Result = v;
          }},P)}
       else while ((Digits > 0) && (Result.charAt(P - 1) === "0")) {
        pas.System.Delete({get: function () {
            return Result;
          }, set: function (v) {
            Result = v;
          }},P,1);
        if (P > Result.length) {
          pas.System.Delete({get: function () {
              return Result;
            }, set: function (v) {
              Result = v;
            }},P - 2,2);
          break;
        };
        Digits -= 1;
      };
      Result = $impl.ReplaceDecimalSep(Result,DS);
      return Result;
    };
    $impl.FormatFixedFloat = function (Value, Digits, DS) {
      var Result = "";
      if (Digits === -1) {
        Digits = 2}
       else if (Digits > 18) Digits = 18;
      Result = rtl.floatToStr(Value,0,Digits);
      if ((Result !== "") && (Result.charAt(0) === " ")) pas.System.Delete({get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }},1,1);
      Result = $impl.ReplaceDecimalSep(Result,DS);
      return Result;
    };
    $impl.FormatNumberFloat = function (Value, Digits, DS, TS) {
      var Result = "";
      var P = 0;
      if (Digits === -1) {
        Digits = 2}
       else if (Digits > 15) Digits = 15;
      Result = rtl.floatToStr(Value,0,Digits);
      if ((Result !== "") && (Result.charAt(0) === " ")) pas.System.Delete({get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }},1,1);
      P = pas.System.Pos(".",Result);
      if (P <= 0) P = Result.length + 1;
      Result = $impl.ReplaceDecimalSep(Result,DS);
      P -= 3;
      if ((TS !== "") && (TS !== "\x00")) while (P > 1) {
        if (Result.charAt(P - 1 - 1) !== "-") pas.System.Insert(TS,{get: function () {
            return Result;
          }, set: function (v) {
            Result = v;
          }},P);
        P -= 3;
      };
      return Result;
    };
    $impl.RemoveLeadingNegativeSign = function (AValue, DS, aThousandSeparator) {
      var Result = false;
      var i = 0;
      var TS = "";
      var StartPos = 0;
      Result = false;
      StartPos = 2;
      TS = aThousandSeparator;
      for (var $l = StartPos, $end = AValue.get().length; $l <= $end; $l++) {
        i = $l;
        Result = (AValue.get().charCodeAt(i - 1) in rtl.createSet(48,DS.charCodeAt(),69,43)) || (AValue.get().charAt(i - 1) === TS);
        if (!Result) break;
      };
      if (Result && (AValue.get().charAt(0) === "-")) pas.System.Delete(AValue,1,1);
      return Result;
    };
    $impl.FormatNumberCurrency = function (Value, Digits, aSettings) {
      var Result = "";
      var Negative = false;
      var P = 0;
      var CS = "";
      var DS = "";
      var TS = "";
      DS = aSettings.DecimalSeparator;
      TS = aSettings.ThousandSeparator;
      CS = aSettings.CurrencyString;
      if (Digits === -1) {
        Digits = aSettings.CurrencyDecimals}
       else if (Digits > 18) Digits = 18;
      Result = rtl.floatToStr(Value / 10000,0,Digits);
      Negative = Result.charAt(0) === "-";
      if (Negative) pas.System.Delete({get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }},1,1);
      P = pas.System.Pos(".",Result);
      if (TS !== "") {
        if (P !== 0) {
          Result = $impl.ReplaceDecimalSep(Result,DS)}
         else P = Result.length + 1;
        P -= 3;
        while (P > 1) {
          pas.System.Insert(TS,{get: function () {
              return Result;
            }, set: function (v) {
              Result = v;
            }},P);
          P -= 3;
        };
      };
      if (Negative) $impl.RemoveLeadingNegativeSign({get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }},DS,TS);
      if (!Negative) {
        var $tmp = aSettings.CurrencyFormat;
        if ($tmp === 0) {
          Result = CS + Result}
         else if ($tmp === 1) {
          Result = Result + CS}
         else if ($tmp === 2) {
          Result = CS + " " + Result}
         else if ($tmp === 3) Result = Result + " " + CS;
      } else {
        var $tmp1 = aSettings.NegCurrFormat;
        if ($tmp1 === 0) {
          Result = "(" + CS + Result + ")"}
         else if ($tmp1 === 1) {
          Result = "-" + CS + Result}
         else if ($tmp1 === 2) {
          Result = CS + "-" + Result}
         else if ($tmp1 === 3) {
          Result = CS + Result + "-"}
         else if ($tmp1 === 4) {
          Result = "(" + Result + CS + ")"}
         else if ($tmp1 === 5) {
          Result = "-" + Result + CS}
         else if ($tmp1 === 6) {
          Result = Result + "-" + CS}
         else if ($tmp1 === 7) {
          Result = Result + CS + "-"}
         else if ($tmp1 === 8) {
          Result = "-" + Result + " " + CS}
         else if ($tmp1 === 9) {
          Result = "-" + CS + " " + Result}
         else if ($tmp1 === 10) {
          Result = Result + " " + CS + "-"}
         else if ($tmp1 === 11) {
          Result = CS + " " + Result + "-"}
         else if ($tmp1 === 12) {
          Result = CS + " " + "-" + Result}
         else if ($tmp1 === 13) {
          Result = Result + "-" + " " + CS}
         else if ($tmp1 === 14) {
          Result = "(" + CS + " " + Result + ")"}
         else if ($tmp1 === 15) Result = "(" + Result + " " + CS + ")";
      };
      return Result;
    };
    $impl.RESpecials = "([\\$\\+\\[\\]\\(\\)\\\\\\.\\*\\^\\?\\|])";
    $impl.DoEncodeDate = function (Year, Month, Day) {
      var Result = 0;
      var D = 0.0;
      if ($mod.TryEncodeDate(Year,Month,Day,{get: function () {
          return D;
        }, set: function (v) {
          D = v;
        }})) {
        Result = pas.System.Trunc(D)}
       else Result = 0;
      return Result;
    };
    $impl.DoEncodeTime = function (Hour, Minute, Second, MilliSecond) {
      var Result = 0.0;
      if (!$mod.TryEncodeTime(Hour,Minute,Second,MilliSecond,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }})) Result = 0;
      return Result;
    };
    $mod.$rtti.$StaticArray("DateTimeToStrFormat$a",{dims: [2], eltype: rtl.string});
    $impl.DateTimeToStrFormat = ["c","f"];
    var WhiteSpace = " \b\t\n\f\r";
    var Digits = "0123456789";
    $impl.IntStrToDate = function (ErrorMsg, S, useformat, separator) {
      var Result = 0.0;
      function FixErrorMsg(errmarg) {
        ErrorMsg.set($mod.Format(rtl.getResStr(pas.RTLConsts,"SInvalidDateFormat"),pas.System.VarRecs(18,errmarg)));
      };
      var df = "";
      var d = 0;
      var m = 0;
      var y = 0;
      var ly = 0;
      var ld = 0;
      var lm = 0;
      var n = 0;
      var i = 0;
      var len = 0;
      var c = 0;
      var dp = 0;
      var mp = 0;
      var yp = 0;
      var which = 0;
      var s1 = "";
      var values = [];
      var YearMoreThenTwoDigits = false;
      values = rtl.arraySetLength(values,0,4);
      Result = 0;
      len = S.length;
      ErrorMsg.set("");
      while ((len > 0) && (pas.System.Pos(S.charAt(len - 1),WhiteSpace) > 0)) len -= 1;
      if (len === 0) {
        FixErrorMsg(S);
        return Result;
      };
      YearMoreThenTwoDigits = false;
      if (separator === "\x00") if ($mod.FormatSettings.DateSeparator !== "\x00") {
        separator = $mod.FormatSettings.DateSeparator}
       else separator = "-";
      df = $mod.UpperCase(useformat);
      yp = 0;
      mp = 0;
      dp = 0;
      which = 0;
      i = 0;
      while ((i < df.length) && (which < 3)) {
        i += 1;
        var $tmp = df.charAt(i - 1);
        if ($tmp === "Y") {
          if (yp === 0) {
            which += 1;
            yp = which;
          }}
         else if ($tmp === "M") {
          if (mp === 0) {
            which += 1;
            mp = which;
          }}
         else if ($tmp === "D") if (dp === 0) {
          which += 1;
          dp = which;
        };
      };
      for (i = 1; i <= 3; i++) values[i] = 0;
      s1 = "";
      n = 0;
      for (var $l = 1, $end = len; $l <= $end; $l++) {
        i = $l;
        if (pas.System.Pos(S.charAt(i - 1),Digits) > 0) s1 = s1 + S.charAt(i - 1);
        if ((separator !== " ") && (S.charAt(i - 1) === " ")) continue;
        if ((S.charAt(i - 1) === separator) || ((i === len) && (pas.System.Pos(S.charAt(i - 1),Digits) > 0))) {
          n += 1;
          if (n > 3) {
            FixErrorMsg(S);
            return Result;
          };
          if ((n === yp) && (s1.length > 2)) YearMoreThenTwoDigits = true;
          pas.System.val$6(s1,{a: n, p: values, get: function () {
              return this.p[this.a];
            }, set: function (v) {
              this.p[this.a] = v;
            }},{get: function () {
              return c;
            }, set: function (v) {
              c = v;
            }});
          if (c !== 0) {
            FixErrorMsg(S);
            return Result;
          };
          s1 = "";
        } else if (pas.System.Pos(S.charAt(i - 1),Digits) === 0) {
          FixErrorMsg(S);
          return Result;
        };
      };
      if ((which < 3) && (n > which)) {
        FixErrorMsg(S);
        return Result;
      };
      $mod.DecodeDate($mod.Date(),{get: function () {
          return ly;
        }, set: function (v) {
          ly = v;
        }},{get: function () {
          return lm;
        }, set: function (v) {
          lm = v;
        }},{get: function () {
          return ld;
        }, set: function (v) {
          ld = v;
        }});
      if (n === 3) {
        y = values[yp];
        m = values[mp];
        d = values[dp];
      } else {
        y = ly;
        if (n < 2) {
          d = values[1];
          m = lm;
        } else if (dp < mp) {
          d = values[1];
          m = values[2];
        } else {
          d = values[2];
          m = values[1];
        };
      };
      if ((y >= 0) && (y < 100) && !YearMoreThenTwoDigits) {
        ly = ly - $mod.TwoDigitYearCenturyWindow;
        y += rtl.trunc(ly / 100) * 100;
        if (($mod.TwoDigitYearCenturyWindow > 0) && (y < ly)) y += 100;
      };
      if (!$mod.TryEncodeDate(y,m,d,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }})) ErrorMsg.set(rtl.getResStr(pas.RTLConsts,"SErrInvalidDate"));
      return Result;
    };
    var AMPM_None = 0;
    var AMPM_AM = 1;
    var AMPM_PM = 2;
    var tiHour = 0;
    var tiMin = 1;
    var tiSec = 2;
    var tiMSec = 3;
    var Digits$1 = "0123456789";
    $impl.IntStrToTime = function (ErrorMsg, S, Len, aSettings) {
      var Result = 0.0;
      var AmPm = 0;
      var TimeValues = [];
      function SplitElements(TimeValues, AmPm) {
        var Result = false;
        var Cur = 0;
        var Offset = 0;
        var ElemLen = 0;
        var Err = 0;
        var TimeIndex = 0;
        var FirstSignificantDigit = 0;
        var Value = 0;
        var DigitPending = false;
        var MSecPending = false;
        var AmPmStr = "";
        var CurChar = "\x00";
        var I = 0;
        var allowedchars = "";
        Result = false;
        AmPm.set(0);
        MSecPending = false;
        TimeIndex = 0;
        for (I = 0; I <= 3; I++) TimeValues.get()[I] = 0;
        Cur = 1;
        while ((Cur < Len) && (S.charAt(Cur - 1) === " ")) Cur += 1;
        Offset = Cur;
        if ((Cur > (Len - 1)) || (S.charAt(Cur - 1) === aSettings.TimeSeparator) || (S.charAt(Cur - 1) === aSettings.DecimalSeparator)) {
          return Result;
        };
        DigitPending = pas.System.Pos(S.charAt(Cur - 1),Digits$1) > 0;
        while (Cur <= Len) {
          CurChar = S.charAt(Cur - 1);
          if (pas.System.Pos(CurChar,Digits$1) > 0) {
            if (!DigitPending || (TimeIndex > 3)) {
              return Result;
            };
            Offset = Cur;
            if (CurChar !== "0") {
              FirstSignificantDigit = Offset}
             else FirstSignificantDigit = -1;
            while ((Cur < Len) && (pas.System.Pos(S.charAt((Cur + 1) - 1),Digits$1) > 0)) {
              if ((FirstSignificantDigit === -1) && (S.charAt(Cur - 1) !== "0")) FirstSignificantDigit = Cur;
              Cur += 1;
            };
            if (FirstSignificantDigit === -1) FirstSignificantDigit = Cur;
            ElemLen = (1 + Cur) - FirstSignificantDigit;
            if ((ElemLen <= 2) || ((ElemLen <= 3) && (TimeIndex === 3))) {
              pas.System.val$6(pas.System.Copy(S,FirstSignificantDigit,ElemLen),{get: function () {
                  return Value;
                }, set: function (v) {
                  Value = v;
                }},{get: function () {
                  return Err;
                }, set: function (v) {
                  Err = v;
                }});
              TimeValues.get()[TimeIndex] = Value;
              TimeIndex += 1;
              DigitPending = false;
            } else {
              return Result;
            };
          } else if (CurChar === " ") {}
          else if (CurChar === aSettings.TimeSeparator) {
            if (DigitPending || (TimeIndex > 2)) {
              return Result;
            };
            DigitPending = true;
            MSecPending = false;
          } else if (CurChar === aSettings.DecimalSeparator) {
            if (DigitPending || MSecPending || (TimeIndex !== 3)) {
              return Result;
            };
            DigitPending = true;
            MSecPending = true;
          } else {
            if ((AmPm.get() !== 0) || DigitPending) {
              return Result;
            };
            Offset = Cur;
            allowedchars = aSettings.DecimalSeparator + " ";
            if (aSettings.TimeSeparator !== "\x00") allowedchars = allowedchars + aSettings.TimeSeparator;
            while ((Cur < Len) && (pas.System.Pos(S.charAt((Cur + 1) - 1),allowedchars) === 0) && (pas.System.Pos(S.charAt((Cur + 1) - 1),Digits$1) === 0)) Cur += 1;
            ElemLen = (1 + Cur) - Offset;
            AmPmStr = pas.System.Copy(S,Offset,ElemLen);
            if ($mod.CompareText(AmPmStr,aSettings.TimeAMString) === 0) {
              AmPm.set(1)}
             else if ($mod.CompareText(AmPmStr,aSettings.TimePMString) === 0) {
              AmPm.set(2)}
             else if ($mod.CompareText(AmPmStr,"AM") === 0) {
              AmPm.set(1)}
             else if ($mod.CompareText(AmPmStr,"PM") === 0) {
              AmPm.set(2)}
             else {
              return Result;
            };
            if (TimeIndex === 0) {
              DigitPending = true;
            } else {
              TimeIndex = 3 + 1;
              DigitPending = false;
            };
          };
          Cur += 1;
        };
        if ((TimeIndex === 0) || ((AmPm.get() !== 0) && ((TimeValues.get()[0] > 12) || (TimeValues.get()[0] === 0))) || DigitPending) return Result;
        Result = true;
        return Result;
      };
      TimeValues = rtl.arraySetLength(TimeValues,0,4);
      AmPm = 0;
      if (!SplitElements({get: function () {
          return TimeValues;
        }, set: function (v) {
          TimeValues = v;
        }},{get: function () {
          return AmPm;
        }, set: function (v) {
          AmPm = v;
        }})) {
        ErrorMsg.set($mod.Format(rtl.getResStr(pas.RTLConsts,"SErrInvalidTimeFormat"),pas.System.VarRecs(18,S)));
        return Result;
      };
      if ((AmPm === 2) && (TimeValues[0] !== 12)) {
        TimeValues[0] += 12}
       else if ((AmPm === 1) && (TimeValues[0] === 12)) TimeValues[0] = 0;
      if (!$mod.TryEncodeTime(TimeValues[0],TimeValues[1],TimeValues[2],TimeValues[3],{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }})) ErrorMsg.set($mod.Format(rtl.getResStr(pas.RTLConsts,"SErrInvalidTimeFormat"),pas.System.VarRecs(18,S)));
      return Result;
    };
    var WhiteSpace$1 = "\t\n\r ";
    $impl.SplitDateTimeStr = function (DateTimeStr, DateStr, TimeStr, aSettings) {
      var Result = 0;
      var p = 0;
      var DummyDT = 0.0;
      Result = 0;
      DateStr.set("");
      TimeStr.set("");
      DateTimeStr = $mod.Trim(DateTimeStr);
      if (DateTimeStr.length === 0) return Result;
      if ((aSettings.DateSeparator === " ") && (aSettings.TimeSeparator === " ") && (pas.System.Pos(" ",DateTimeStr) > 0)) {
        DateStr.set(DateTimeStr);
        return 1;
      };
      p = 1;
      if (aSettings.DateSeparator !== " ") {
        while ((p < DateTimeStr.length) && !(pas.System.Pos(DateTimeStr.charAt((p + 1) - 1),WhiteSpace$1) > 0)) p += 1;
      } else {
        p = pas.System.Pos(aSettings.TimeSeparator,DateTimeStr);
        if (p !== 0) do {
          p -= 1;
        } while (!((p === 0) || (pas.System.Pos(DateTimeStr.charAt(p - 1),WhiteSpace$1) > 0)));
      };
      if (p === 0) p = DateTimeStr.length;
      DateStr.set(pas.System.Copy(DateTimeStr,1,p));
      TimeStr.set($mod.Trim(pas.System.Copy(DateTimeStr,p + 1,100)));
      if (TimeStr.get().length !== 0) {
        Result = 2}
       else {
        Result = 1;
        if (((aSettings.DateSeparator !== aSettings.TimeSeparator) && (pas.System.Pos(aSettings.TimeSeparator,DateStr.get()) > 0)) || ((aSettings.DateSeparator === aSettings.TimeSeparator) && !$mod.TryStrToDate(DateStr.get(),{get: function () {
            return DummyDT;
          }, set: function (v) {
            DummyDT = v;
          }}))) {
          TimeStr.set(DateStr.get());
          DateStr.set("");
        };
      };
      return Result;
    };
    $impl.IntTryStrToInt = function (S, res, aSep) {
      var Result = false;
      var Radix = 10;
      var N = "";
      var J = undefined;
      N = S;
      if ((pas.System.Pos(aSep,N) !== 0) || (pas.System.Pos(".",N) !== 0) || (pas.System.Pos(":",N) !== 0) || (pas.System.Pos("-",N) > 1)) return false;
      var $tmp = pas.System.Copy(N,1,1);
      if ($tmp === "$") {
        Radix = 16}
       else if ($tmp === "&") {
        Radix = 8}
       else if ($tmp === "%") Radix = 2;
      if ((Radix !== 16) && (pas.System.Pos("e",$mod.LowerCase(N)) !== 0)) return false;
      if (Radix !== 10) pas.System.Delete({get: function () {
          return N;
        }, set: function (v) {
          N = v;
        }},1,1);
      J = parseInt(N,Radix);
      Result = !isNaN(J);
      if (Result) res.set(rtl.trunc(J));
      return Result;
    };
    $impl.InitGlobalFormatSettings = function () {
      $mod.FormatSettings.$assign($mod.TFormatSettings.Create());
      $mod.TimeSeparator = $mod.FormatSettings.TimeSeparator;
      $mod.DateSeparator = $mod.FormatSettings.DateSeparator;
      $mod.ShortDateFormat = $mod.FormatSettings.ShortDateFormat;
      $mod.LongDateFormat = $mod.FormatSettings.LongDateFormat;
      $mod.ShortTimeFormat = $mod.FormatSettings.ShortTimeFormat;
      $mod.LongTimeFormat = $mod.FormatSettings.LongTimeFormat;
      $mod.DecimalSeparator = $mod.FormatSettings.DecimalSeparator;
      $mod.ThousandSeparator = $mod.FormatSettings.ThousandSeparator;
      $mod.TimeAMString = $mod.FormatSettings.TimeAMString;
      $mod.TimePMString = $mod.FormatSettings.TimePMString;
      $mod.CurrencyFormat = $mod.FormatSettings.CurrencyFormat;
      $mod.NegCurrFormat = $mod.FormatSettings.NegCurrFormat;
      $mod.CurrencyDecimals = $mod.FormatSettings.CurrencyDecimals;
      $mod.CurrencyString = $mod.FormatSettings.CurrencyString;
    };
    $impl.NotImplemented = function (S) {
      throw $mod.Exception.$create("Create$1",["Not yet implemented : " + S]);
    };
    $impl.HaveChar = function (AChar, AList) {
      var Result = false;
      var I = 0;
      I = 0;
      Result = false;
      while (!Result && (I < rtl.length(AList))) {
        Result = AList[I] === AChar;
        I += 1;
      };
      return Result;
    };
    rtl.recNewT($impl,"TFloatParts",function () {
      this.sign = false;
      this.exp = 0;
      this.mantissa = 0.0;
      this.$eq = function (b) {
        return (this.sign === b.sign) && (this.exp === b.exp) && (this.mantissa === b.mantissa);
      };
      this.$assign = function (s) {
        this.sign = s.sign;
        this.exp = s.exp;
        this.mantissa = s.mantissa;
        return this;
      };
      var $r = $mod.$rtti.$Record("TFloatParts",{},this);
      $r.addField("sign",rtl.boolean);
      $r.addField("exp",rtl.longint);
      $r.addField("mantissa",rtl.double);
    });
    $impl.FloatToParts = function (aValue) {
      var Result = $impl.TFloatParts.$new();
      var F = null;
      var B = null;
      F = new Float64Array(1);
      B = new Uint8Array(F.buffer);
      F[0] = aValue;
      Result.sign = (B[7] >>> 7) === 0;
      Result.exp = (((B[7] & 0x7f) << 4) | (B[6] >>> 4)) - 0x3ff;
      B[3] = 0x3F;
      B[6] = B[6] | 0xF0;
      Result.mantissa = F[0];
      return Result;
    };
    $impl.EqualsStr = function (AValue1, AValue2) {
      var Result = false;
      Result = AValue1 === AValue2;
      return Result;
    };
    var cBlank = " ";
    $impl.ParseCmdLine = function () {
      var Result = [];
      var lCount = 0;
      var lParam = "";
      var lExtraParam = "";
      var lBuffer = "";
      var lChar = "\x00";
      var lIndex = 0;
      Result = [];
      for (var $l = 1, $end = pas.System.ParamCount(); $l <= $end; $l++) {
        lCount = $l;
        lParam = pas.System.ParamStr(lCount);
        lBuffer = $mod.TStringHelper.Substring.call({get: function () {
            return lParam;
          }, set: function (v) {
            lParam = v;
          }},1);
        lExtraParam = $mod.TStringHelper.Empty;
        for (var $l1 in $mod.SwitchChars) {
          lChar = String.fromCharCode($l1);
          lIndex = $mod.TStringHelper.IndexOf$1.call({get: function () {
              return lBuffer;
            }, set: function (v) {
              lBuffer = v;
            }},cBlank + lChar);
          if (lIndex >= 0) {
            lExtraParam = $mod.TStringHelper.TrimLeft.call({a: $mod.TStringHelper.Substring.call({get: function () {
                  return lParam;
                }, set: function (v) {
                  lParam = v;
                }},lIndex + 1), get: function () {
                return this.a;
              }, set: function (v) {
                this.a = v;
              }});
            lParam = $mod.TStringHelper.TrimRight.call({a: $mod.TStringHelper.Substring$1.call({get: function () {
                  return lParam;
                }, set: function (v) {
                  lParam = v;
                }},0,lIndex + 1), get: function () {
                return this.a;
              }, set: function (v) {
                this.a = v;
              }});
            break;
          };
        };
        Result = rtl.arraySetLength(Result,"",rtl.length(Result) + 1);
        Result[rtl.length(Result) - 1] = lParam;
        if (!$mod.TStringHelper.IsEmpty.call({get: function () {
            return lExtraParam;
          }, set: function (v) {
            lExtraParam = v;
          }})) {
          Result = rtl.arraySetLength(Result,"",rtl.length(Result) + 1);
          Result[rtl.length(Result) - 1] = lExtraParam;
        };
      };
      return Result;
    };
    $mod.$resourcestrings = {SAbortError: {org: "Operation aborted"}, SApplicationException: {org: "Application raised an exception: "}, SErrUnknownExceptionType: {org: "Caught unknown exception type : "}};
  };
  $mod.$init = function () {
    (function () {
      $impl.InitGlobalFormatSettings();
    })();
    $mod.ShortMonthNames = $impl.DefaultShortMonthNames.slice(0);
    $mod.LongMonthNames = $impl.DefaultLongMonthNames.slice(0);
    $mod.ShortDayNames = $impl.DefaultShortDayNames.slice(0);
    $mod.LongDayNames = $impl.DefaultLongDayNames.slice(0);
  };
},[]);
rtl.module("TypInfo",["System","SysUtils","Types","RTLConsts","JS"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.TCallConv = {"0": "ccReg", ccReg: 0, "1": "ccCdecl", ccCdecl: 1, "2": "ccPascal", ccPascal: 2, "3": "ccStdCall", ccStdCall: 3, "4": "ccSafeCall", ccSafeCall: 4, "5": "ccCppdecl", ccCppdecl: 5, "6": "ccFar16", ccFar16: 6, "7": "ccOldFPCCall", ccOldFPCCall: 7, "8": "ccInternProc", ccInternProc: 8, "9": "ccSysCall", ccSysCall: 9, "10": "ccSoftFloat", ccSoftFloat: 10, "11": "ccMWPascal", ccMWPascal: 11};
  this.$rtti.$Enum("TCallConv",{minvalue: 0, maxvalue: 11, ordtype: 1, enumtype: this.TCallConv});
  this.$rtti.$ExtClass("TSectionRTTI",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "rtl.tSectionRTTI"});
  this.$rtti.$ExtClass("TTypeInfoModule",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "pasmodule"});
  this.$rtti.$inherited("TTypeInfoAttributes",pas.Types.$rtti["TJSValueDynArray"],{});
  this.$rtti.$ExtClass("TTypeInfo",{jsclass: "rtl.tTypeInfo"});
  this.$rtti.$ClassRef("TTypeInfoClassOf",{instancetype: this.$rtti["TTypeInfo"]});
  this.TOrdType = {"0": "otSByte", otSByte: 0, "1": "otUByte", otUByte: 1, "2": "otSWord", otSWord: 2, "3": "otUWord", otUWord: 3, "4": "otSLong", otSLong: 4, "5": "otULong", otULong: 5, "6": "otSIntDouble", otSIntDouble: 6, "7": "otUIntDouble", otUIntDouble: 7};
  this.$rtti.$Enum("TOrdType",{minvalue: 0, maxvalue: 7, ordtype: 1, enumtype: this.TOrdType});
  this.$rtti.$ExtClass("TTypeInfoInteger",{ancestor: this.$rtti["TTypeInfo"], jsclass: "rtl.tTypeInfoInteger"});
  this.$rtti.$ExtClass("TEnumType",{jsclass: "anonymous"});
  this.$rtti.$ExtClass("TTypeInfoEnum",{ancestor: this.$rtti["TTypeInfoInteger"], jsclass: "rtl.tTypeInfoEnum"});
  this.$rtti.$ExtClass("TTypeInfoSet",{ancestor: this.$rtti["TTypeInfo"], jsclass: "rtl.tTypeInfoSet"});
  this.$rtti.$ExtClass("TTypeInfoStaticArray",{ancestor: this.$rtti["TTypeInfo"], jsclass: "rtl.tTypeInfoStaticArray"});
  this.$rtti.$ExtClass("TTypeInfoDynArray",{ancestor: this.$rtti["TTypeInfo"], jsclass: "rtl.tTypeInfoDynArray"});
  this.TParamFlag = {"0": "pfVar", pfVar: 0, "1": "pfConst", pfConst: 1, "2": "pfOut", pfOut: 2, "3": "pfArray", pfArray: 3, "4": "pfAddress", pfAddress: 4, "5": "pfReference", pfReference: 5};
  this.$rtti.$Enum("TParamFlag",{minvalue: 0, maxvalue: 5, ordtype: 1, enumtype: this.TParamFlag});
  this.$rtti.$Set("TParamFlags",{comptype: this.$rtti["TParamFlag"]});
  this.$rtti.$ExtClass("TProcedureParam",{jsclass: "anonymous"});
  this.$rtti.$DynArray("TProcedureParams",{eltype: this.$rtti["TProcedureParam"]});
  this.TProcedureFlag = {"0": "pfStatic", pfStatic: 0, "1": "pfVarargs", pfVarargs: 1, "2": "pfExternal", pfExternal: 2, "3": "pfSafeCall", pfSafeCall: 3, "4": "pfAsync", pfAsync: 4};
  this.$rtti.$Enum("TProcedureFlag",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TProcedureFlag});
  this.$rtti.$Set("TProcedureFlags",{comptype: this.$rtti["TProcedureFlag"]});
  this.$rtti.$ExtClass("TProcedureSignature",{jsclass: "anonymous"});
  this.$rtti.$ExtClass("TTypeInfoProcVar",{ancestor: this.$rtti["TTypeInfo"], jsclass: "rtl.tTypeInfoProcVar"});
  this.$rtti.$ExtClass("TTypeInfoRefToProcVar",{ancestor: this.$rtti["TTypeInfoProcVar"], jsclass: "rtl.tTypeInfoRefToProcVar"});
  this.TMethodKind = {"0": "mkProcedure", mkProcedure: 0, "1": "mkFunction", mkFunction: 1, "2": "mkConstructor", mkConstructor: 2, "3": "mkDestructor", mkDestructor: 3, "4": "mkClassProcedure", mkClassProcedure: 4, "5": "mkClassFunction", mkClassFunction: 5};
  this.$rtti.$Enum("TMethodKind",{minvalue: 0, maxvalue: 5, ordtype: 1, enumtype: this.TMethodKind});
  this.$rtti.$Set("TMethodKinds",{comptype: this.$rtti["TMethodKind"]});
  this.$rtti.$ExtClass("TTypeInfoMethodVar",{ancestor: this.$rtti["TTypeInfoProcVar"], jsclass: "rtl.tTypeInfoMethodVar"});
  this.TTypeMemberKind = {"0": "tmkUnknown", tmkUnknown: 0, "1": "tmkField", tmkField: 1, "2": "tmkMethod", tmkMethod: 2, "3": "tmkProperty", tmkProperty: 3};
  this.$rtti.$Enum("TTypeMemberKind",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TTypeMemberKind});
  this.$rtti.$Set("TTypeMemberKinds",{comptype: this.$rtti["TTypeMemberKind"]});
  this.$rtti.$ExtClass("TTypeMember",{jsclass: "rtl.tTypeMember"});
  this.$rtti.$DynArray("TTypeMemberDynArray",{eltype: this.$rtti["TTypeMember"]});
  this.$rtti.$ExtClass("TTypeMemberField",{ancestor: this.$rtti["TTypeMember"], jsclass: "rtl.tTypeMemberField"});
  this.$rtti.$ExtClass("TTypeMemberMethod",{ancestor: this.$rtti["TTypeMember"], jsclass: "rtl.tTypeMemberMethod"});
  this.$rtti.$DynArray("TTypeMemberMethodDynArray",{eltype: this.$rtti["TTypeMemberMethod"]});
  this.pfGetFunction = 1;
  this.pfSetProcedure = 2;
  this.pfStoredFalse = 4;
  this.pfStoredField = 8;
  this.pfStoredFunction = 12;
  this.pfHasIndex = 16;
  this.$rtti.$ExtClass("TTypeMemberProperty",{ancestor: this.$rtti["TTypeMember"], jsclass: "rtl.tTypeMemberProperty"});
  this.$rtti.$DynArray("TTypeMemberPropertyDynArray",{eltype: this.$rtti["TTypeMemberProperty"]});
  this.$rtti.$ExtClass("TTypeMembers",{jsclass: "rtl.tTypeMembers"});
  this.$rtti.$ExtClass("TTypeInfoStruct",{ancestor: this.$rtti["TTypeInfo"], jsclass: "rtl.tTypeInfoStruct"});
  this.$rtti.$ExtClass("TTypeInfoRecord",{ancestor: this.$rtti["TTypeInfoStruct"], jsclass: "rtl.tTypeInfoRecord"});
  this.$rtti.$ExtClass("TTypeInfoClass",{ancestor: this.$rtti["TTypeInfoStruct"], jsclass: "rtl.tTypeInfoClass"});
  this.$rtti.$ExtClass("TTypeInfoExtClass",{ancestor: this.$rtti["TTypeInfo"], jsclass: "rtl.tTypeInfoExtClass"});
  this.$rtti.$ExtClass("TTypeInfoClassRef",{ancestor: this.$rtti["TTypeInfo"], jsclass: "rtl.tTypeInfoClassRef"});
  this.$rtti.$ExtClass("TTypeInfoPointer",{ancestor: this.$rtti["TTypeInfo"], jsclass: "rtl.tTypeInfoPointer"});
  this.$rtti.$ExtClass("TInterfaceInfo",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "Object"});
  this.$rtti.$ExtClass("TTypeInfoInterface",{ancestor: this.$rtti["TTypeInfoStruct"], jsclass: "rtl.tTypeInfoInterface"});
  this.$rtti.$ExtClass("TTypeInfoHelper",{ancestor: this.$rtti["TTypeInfoStruct"], jsclass: "rtl.tTypeInfoHelper"});
  this.$rtti.$ExtClass("TReferenceVariable",{jsclass: "Object"});
  this.$rtti.$ExtClass("TInterfaceObject",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "Object"});
  rtl.createClass(this,"EPropertyError",pas.SysUtils.Exception,function () {
  });
  this.GetTypeName = function (TypeInfo) {
    var Result = "";
    Result = TypeInfo.name;
    return Result;
  };
  this.GetClassMembers = function (aTIStruct) {
    var Result = [];
    var C = null;
    var i = 0;
    var PropName = "";
    var Names = null;
    Result = [];
    Names = new Object();
    C = aTIStruct;
    while (C !== null) {
      for (var $l = 0, $end = rtl.length(C.names) - 1; $l <= $end; $l++) {
        i = $l;
        PropName = C.names[i];
        if (Names.hasOwnProperty(PropName)) continue;
        Result.push(C.members[PropName]);
        Names[PropName] = true;
      };
      if (!rtl.isExt(C,rtl.tTypeInfoClass)) break;
      C = C.ancestor;
    };
    return Result;
  };
  this.GetClassMember = function (aTIStruct, aName) {
    var Result = null;
    var C = null;
    var i = 0;
    C = aTIStruct;
    while (C !== null) {
      if (C.members.hasOwnProperty(aName)) return C.members[aName];
      if (!rtl.isExt(C,rtl.tTypeInfoClass)) break;
      C = C.ancestor;
    };
    C = aTIStruct;
    while (C !== null) {
      for (var $l = 0, $end = rtl.length(C.names) - 1; $l <= $end; $l++) {
        i = $l;
        if (pas.SysUtils.CompareText(C.names[i],aName) === 0) return C.members[C.names[i]];
      };
      if (!rtl.isExt(C,rtl.tTypeInfoClass)) break;
      C = C.ancestor;
    };
    Result = null;
    return Result;
  };
  this.GetInstanceMethod = function (Instance, aName) {
    var Result = null;
    var TI = null;
    if (Instance === null) return null;
    TI = $mod.GetClassMember(Instance.$rtti,aName);
    if (!rtl.isExt(TI,rtl.tTypeMemberMethod)) return null;
    Result = rtl.createCallback(Instance,TI.name);
    return Result;
  };
  this.GetClassMethods = function (aTIStruct) {
    var Result = [];
    var C = null;
    var i = 0;
    var Cnt = 0;
    var j = 0;
    Cnt = 0;
    C = aTIStruct;
    while (C !== null) {
      Cnt += C.methods.length;
      if (!rtl.isExt(C,rtl.tTypeInfoClass)) break;
      C = C.ancestor;
    };
    Result = rtl.arraySetLength(Result,null,Cnt);
    C = aTIStruct;
    i = 0;
    while (C !== null) {
      for (var $l = 0, $end = C.methods.length - 1; $l <= $end; $l++) {
        j = $l;
        Result[i] = C.members[C.methods[j]];
        i += 1;
      };
      if (!rtl.isExt(C,rtl.tTypeInfoClass)) break;
      C = C.ancestor;
    };
    return Result;
  };
  this.GetInterfaceMembers = function (aTIInterface) {
    var Result = [];
    var Intf = null;
    var i = 0;
    var Cnt = 0;
    var j = 0;
    Cnt = 0;
    Intf = aTIInterface;
    while (Intf !== null) {
      Cnt += rtl.length(Intf.names);
      Intf = Intf.ancestor;
    };
    Result = rtl.arraySetLength(Result,null,Cnt);
    Intf = aTIInterface;
    i = 0;
    while (Intf !== null) {
      for (var $l = 0, $end = rtl.length(Intf.names) - 1; $l <= $end; $l++) {
        j = $l;
        Result[i] = Intf.members[Intf.names[j]];
        i += 1;
      };
      Intf = Intf.ancestor;
    };
    return Result;
  };
  this.GetInterfaceMember = function (aTIInterface, aName) {
    var Result = null;
    var Intf = null;
    var i = 0;
    Intf = aTIInterface;
    while (Intf !== null) {
      if (Intf.members.hasOwnProperty(aName)) return Intf.members[aName];
      Intf = Intf.ancestor;
    };
    Intf = aTIInterface;
    while (Intf !== null) {
      for (var $l = 0, $end = rtl.length(Intf.names) - 1; $l <= $end; $l++) {
        i = $l;
        if (pas.SysUtils.CompareText(Intf.names[i],aName) === 0) return Intf.members[Intf.names[i]];
      };
      Intf = Intf.ancestor;
    };
    Result = null;
    return Result;
  };
  this.GetInterfaceMethods = function (aTIInterface) {
    var Result = [];
    var Intf = null;
    var i = 0;
    var Cnt = 0;
    var j = 0;
    Cnt = 0;
    Intf = aTIInterface;
    while (Intf !== null) {
      Cnt += Intf.methods.length;
      Intf = Intf.ancestor;
    };
    Result = rtl.arraySetLength(Result,null,Cnt);
    Intf = aTIInterface;
    i = 0;
    while (Intf !== null) {
      for (var $l = 0, $end = Intf.methods.length - 1; $l <= $end; $l++) {
        j = $l;
        Result[i] = Intf.members[Intf.methods[j]];
        i += 1;
      };
      Intf = Intf.ancestor;
    };
    return Result;
  };
  this.GetRTTIAttributes = function (Attributes) {
    var Result = [];
    var i = 0;
    var len = 0;
    var AttrClass = null;
    var ProcName = "";
    var Attr = null;
    Result = [];
    if (Attributes == undefined) return Result;
    i = 0;
    len = rtl.length(Attributes);
    while (i < len) {
      AttrClass = rtl.getObject(Attributes[i]);
      i += 1;
      ProcName = "" + Attributes[i];
      i += 1;
      if ((i < len) && rtl.isArray(Attributes[i])) {
        Attr = AttrClass.$create(ProcName,Attributes[i]);
        i += 1;
      } else Attr = AttrClass.$create(ProcName);
      Result = rtl.arrayInsert(Attr,Result,rtl.length(Result));
    };
    return Result;
  };
  this.GetPropInfos = function (aTIStruct) {
    var Result = [];
    var C = null;
    var i = 0;
    var Names = null;
    var PropName = "";
    Result = [];
    C = aTIStruct;
    Names = new Object();
    while (C !== null) {
      for (var $l = 0, $end = C.properties.length - 1; $l <= $end; $l++) {
        i = $l;
        PropName = C.properties[i];
        if (Names.hasOwnProperty(PropName)) continue;
        Result.push(C.members[PropName]);
        Names[PropName] = true;
      };
      if (!rtl.isExt(C,rtl.tTypeInfoClass)) break;
      C = C.ancestor;
    };
    return Result;
  };
  this.GetPropList = function (aTIStruct, TypeKinds, Sorted) {
    var Result = [];
    function NameSort(a, b) {
      var Result = 0;
      if (a.name < b.name) {
        Result = -1}
       else if (a.name > b.name) {
        Result = 1}
       else Result = 0;
      return Result;
    };
    var C = null;
    var i = 0;
    var Names = null;
    var PropName = "";
    var Prop = null;
    Result = [];
    C = aTIStruct;
    Names = new Object();
    while (C !== null) {
      for (var $l = 0, $end = C.properties.length - 1; $l <= $end; $l++) {
        i = $l;
        PropName = C.properties[i];
        if (Names.hasOwnProperty(PropName)) continue;
        Prop = C.members[PropName];
        if (!(Prop.typeinfo.kind in TypeKinds)) continue;
        Result.push(Prop);
        Names[PropName] = true;
      };
      if (!rtl.isExt(C,rtl.tTypeInfoClass)) break;
      C = C.ancestor;
    };
    if (Sorted) Result.sort(NameSort);
    return Result;
  };
  this.GetPropList$1 = function (aTIStruct) {
    var Result = [];
    Result = $mod.GetPropInfos(aTIStruct);
    return Result;
  };
  this.GetPropList$2 = function (AClass) {
    var Result = [];
    Result = $mod.GetPropInfos(AClass.$rtti);
    return Result;
  };
  this.GetPropList$3 = function (Instance) {
    var Result = [];
    Result = $mod.GetPropList$2(Instance.$class.ClassType());
    return Result;
  };
  this.GetPropInfo = function (TI, PropName) {
    var Result = null;
    var m = null;
    var i = 0;
    var C = null;
    C = TI;
    while (C !== null) {
      m = C.members[PropName];
      if (rtl.isExt(m,rtl.tTypeMemberProperty)) return m;
      if (!rtl.isExt(C,rtl.tTypeInfoClass)) break;
      C = C.ancestor;
    };
    Result = null;
    do {
      for (var $l = 0, $end = TI.properties.length - 1; $l <= $end; $l++) {
        i = $l;
        if (pas.SysUtils.CompareText(PropName,TI.properties[i]) === 0) {
          m = TI.members[TI.properties[i]];
          if (rtl.isExt(m,rtl.tTypeMemberProperty)) Result = m;
          return Result;
        };
      };
      if (!rtl.isExt(TI,rtl.tTypeInfoClass)) break;
      TI = TI.ancestor;
    } while (!(TI === null));
    return Result;
  };
  this.GetPropInfo$1 = function (TI, PropName, Kinds) {
    var Result = null;
    Result = $mod.GetPropInfo(TI,PropName);
    if (rtl.neSet(Kinds,{}) && (Result !== null) && !(Result.typeinfo.kind in Kinds)) Result = null;
    return Result;
  };
  this.GetPropInfo$2 = function (Instance, PropName) {
    var Result = null;
    Result = $mod.GetPropInfo$1(Instance.$rtti,PropName,{});
    return Result;
  };
  this.GetPropInfo$3 = function (Instance, PropName, Kinds) {
    var Result = null;
    Result = $mod.GetPropInfo$1(Instance.$rtti,PropName,Kinds);
    return Result;
  };
  this.GetPropInfo$4 = function (aClass, PropName) {
    var Result = null;
    Result = $mod.GetPropInfo$1(aClass.$rtti,PropName,{});
    return Result;
  };
  this.GetPropInfo$5 = function (aClass, PropName, Kinds) {
    var Result = null;
    Result = $mod.GetPropInfo$1(aClass.$rtti,PropName,Kinds);
    return Result;
  };
  this.FindPropInfo = function (Instance, PropName) {
    var Result = null;
    Result = $mod.GetPropInfo(Instance.$rtti,PropName);
    if (Result === null) throw $mod.EPropertyError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SErrPropertyNotFound"),pas.System.VarRecs(18,PropName)]);
    return Result;
  };
  this.FindPropInfo$1 = function (Instance, PropName, Kinds) {
    var Result = null;
    Result = $mod.GetPropInfo$1(Instance.$rtti,PropName,Kinds);
    if (Result === null) throw $mod.EPropertyError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SErrPropertyNotFound"),pas.System.VarRecs(18,PropName)]);
    return Result;
  };
  this.FindPropInfo$2 = function (aClass, PropName) {
    var Result = null;
    Result = $mod.GetPropInfo(aClass.$rtti,PropName);
    if (Result === null) throw $mod.EPropertyError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SErrPropertyNotFound"),pas.System.VarRecs(18,PropName)]);
    return Result;
  };
  this.FindPropInfo$3 = function (aClass, PropName, Kinds) {
    var Result = null;
    Result = $mod.GetPropInfo$1(aClass.$rtti,PropName,Kinds);
    if (Result === null) throw $mod.EPropertyError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SErrPropertyNotFound"),pas.System.VarRecs(18,PropName)]);
    return Result;
  };
  this.IsStoredProp = function (Instance, PropInfo) {
    var Result = false;
    var $tmp = PropInfo.flags & 12;
    if ($tmp === 0) {
      Result = true}
     else if ($tmp === 4) {
      Result = false}
     else if ($tmp === 8) {
      Result = !(Instance[PropInfo.stored] == false)}
     else {
      Result = Instance[PropInfo.stored]();
    };
    return Result;
  };
  this.IsStoredProp$1 = function (Instance, PropName) {
    var Result = false;
    Result = $mod.IsStoredProp(Instance,$mod.FindPropInfo(Instance,PropName));
    return Result;
  };
  this.IsPublishedProp = function (Instance, PropName) {
    var Result = false;
    Result = $mod.GetPropInfo$2(Instance,PropName) !== null;
    return Result;
  };
  this.IsPublishedProp$1 = function (aClass, PropName) {
    var Result = false;
    Result = $mod.GetPropInfo$4(aClass,PropName) !== null;
    return Result;
  };
  this.PropType = function (Instance, PropName) {
    var Result = 0;
    Result = $mod.FindPropInfo(Instance,PropName).typeinfo.kind;
    return Result;
  };
  this.PropType$1 = function (aClass, PropName) {
    var Result = 0;
    Result = $mod.FindPropInfo$2(aClass,PropName).typeinfo.kind;
    return Result;
  };
  this.PropIsType = function (Instance, PropName, TypeKind) {
    var Result = false;
    Result = $mod.PropType(Instance,PropName) === TypeKind;
    return Result;
  };
  this.PropIsType$1 = function (aClass, PropName, TypeKind) {
    var Result = false;
    Result = $mod.PropType$1(aClass,PropName) === TypeKind;
    return Result;
  };
  this.GetJSValueProp = function (Instance, TI, PropName) {
    var Result = undefined;
    var PropInfo = null;
    PropInfo = $mod.GetPropInfo(TI,PropName);
    if (PropInfo === null) throw $mod.EPropertyError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SErrPropertyNotFound"),pas.System.VarRecs(18,PropName)]);
    Result = $mod.GetJSValueProp$1(Instance,PropInfo);
    return Result;
  };
  this.GetJSValueProp$1 = function (Instance, PropInfo) {
    var Result = undefined;
    var gk = 0;
    gk = $impl.GetPropGetterKind(PropInfo);
    var $tmp = gk;
    if ($tmp === $impl.TGetterKind.gkNone) {
      throw $mod.EPropertyError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SCantReadPropertyS"),pas.System.VarRecs(18,PropInfo.name)])}
     else if ($tmp === $impl.TGetterKind.gkField) {
      Result = Instance[PropInfo.getter]}
     else if ($tmp === $impl.TGetterKind.gkFunction) {
      if ((16 & PropInfo.flags) > 0) {
        Result = Instance[PropInfo.getter](PropInfo.index)}
       else Result = Instance[PropInfo.getter]()}
     else if ($tmp === $impl.TGetterKind.gkFunctionWithParams) throw $mod.EPropertyError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SIndexedPropertyNeedsParams"),pas.System.VarRecs(18,PropInfo.name)]);
    return Result;
  };
  this.GetJSValueProp$2 = function (Instance, PropName) {
    var Result = undefined;
    Result = $mod.GetJSValueProp$3(Instance,$mod.FindPropInfo(Instance,PropName));
    return Result;
  };
  this.GetJSValueProp$3 = function (Instance, PropInfo) {
    var Result = undefined;
    Result = $mod.GetJSValueProp$1(Instance,PropInfo);
    return Result;
  };
  this.SetJSValueProp = function (Instance, TI, PropName, Value) {
    var PropInfo = null;
    PropInfo = $mod.GetPropInfo(TI,PropName);
    if (PropInfo === null) throw $mod.EPropertyError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SErrPropertyNotFound"),pas.System.VarRecs(18,PropName)]);
    $mod.SetJSValueProp$1(Instance,PropInfo,Value);
  };
  this.SetJSValueProp$1 = function (Instance, PropInfo, Value) {
    var sk = 0;
    sk = $impl.GetPropSetterKind(PropInfo);
    var $tmp = sk;
    if ($tmp === $impl.TSetterKind.skNone) {
      throw $mod.EPropertyError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SCantWritePropertyS"),pas.System.VarRecs(18,PropInfo.name)])}
     else if ($tmp === $impl.TSetterKind.skField) {
      Instance[PropInfo.setter] = Value}
     else if ($tmp === $impl.TSetterKind.skProcedure) {
      if ((16 & PropInfo.flags) > 0) {
        Instance[PropInfo.setter](PropInfo.index,Value)}
       else Instance[PropInfo.setter](Value)}
     else if ($tmp === $impl.TSetterKind.skProcedureWithParams) throw $mod.EPropertyError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SIndexedPropertyNeedsParams"),pas.System.VarRecs(18,PropInfo.name)]);
  };
  this.SetJSValueProp$2 = function (Instance, PropName, Value) {
    $mod.SetJSValueProp$3(Instance,$mod.FindPropInfo(Instance,PropName),Value);
  };
  this.SetJSValueProp$3 = function (Instance, PropInfo, Value) {
    $mod.SetJSValueProp$1(Instance,PropInfo,Value);
  };
  this.GetNativeIntProp = function (Instance, PropName) {
    var Result = 0;
    Result = $mod.GetNativeIntProp$1(Instance,$mod.FindPropInfo(Instance,PropName));
    return Result;
  };
  this.GetNativeIntProp$1 = function (Instance, PropInfo) {
    var Result = 0;
    Result = rtl.trunc($mod.GetJSValueProp$3(Instance,PropInfo));
    return Result;
  };
  this.SetNativeIntProp = function (Instance, PropName, Value) {
    $mod.SetJSValueProp$3(Instance,$mod.FindPropInfo(Instance,PropName),Value);
  };
  this.SetNativeIntProp$1 = function (Instance, PropInfo, Value) {
    $mod.SetJSValueProp$3(Instance,PropInfo,Value);
  };
  this.GetOrdProp = function (Instance, PropName) {
    var Result = 0;
    Result = $mod.GetOrdProp$1(Instance,$mod.FindPropInfo(Instance,PropName));
    return Result;
  };
  this.GetOrdProp$1 = function (Instance, PropInfo) {
    var Result = 0;
    var o = null;
    var Key = "";
    var n = 0;
    var v = undefined;
    if (PropInfo.typeinfo.kind === pas.System.TTypeKind.tkSet) {
      o = $mod.GetJSValueProp$3(Instance,PropInfo);
      Result = 0;
      for (Key in o) {
        n = parseInt(Key,10);
        if (n < 32) Result = Result + (1 << n);
      };
    } else if (PropInfo.typeinfo.kind === pas.System.TTypeKind.tkChar) {
      v = $mod.GetJSValueProp$3(Instance,PropInfo);
      if (rtl.isNumber(v)) {
        Result = rtl.trunc(v)}
       else {
        Key = "" + v;
        if (Key === "") {
          Result = 0}
         else Result = Key.charCodeAt(0);
      };
    } else Result = rtl.trunc($mod.GetJSValueProp$3(Instance,PropInfo));
    return Result;
  };
  this.SetOrdProp = function (Instance, PropName, Value) {
    $mod.SetOrdProp$1(Instance,$mod.FindPropInfo(Instance,PropName),Value);
  };
  this.SetOrdProp$1 = function (Instance, PropInfo, Value) {
    var o = null;
    var i = 0;
    if (PropInfo.typeinfo.kind === pas.System.TTypeKind.tkSet) {
      o = new Object();
      for (i = 0; i <= 31; i++) if (((1 << i) & Value) > 0) o["" + i] = true;
      $mod.SetJSValueProp$3(Instance,PropInfo,o);
    } else if (PropInfo.typeinfo.kind === pas.System.TTypeKind.tkChar) {
      $mod.SetJSValueProp$3(Instance,PropInfo,String.fromCharCode(Value))}
     else $mod.SetJSValueProp$3(Instance,PropInfo,Value);
  };
  this.GetEnumProp = function (Instance, PropName) {
    var Result = "";
    Result = $mod.GetEnumProp$1(Instance,$mod.FindPropInfo(Instance,PropName));
    return Result;
  };
  this.GetEnumProp$1 = function (Instance, PropInfo) {
    var Result = "";
    var n = 0;
    var TIEnum = null;
    TIEnum = rtl.asExt(PropInfo.typeinfo,rtl.tTypeInfoEnum);
    n = rtl.trunc($mod.GetJSValueProp$3(Instance,PropInfo));
    if ((n >= TIEnum.minvalue) && (n <= TIEnum.maxvalue)) {
      Result = TIEnum.enumtype[n]}
     else Result = "" + n;
    return Result;
  };
  this.SetEnumProp = function (Instance, PropName, Value) {
    $mod.SetEnumProp$1(Instance,$mod.FindPropInfo(Instance,PropName),Value);
  };
  this.SetEnumProp$1 = function (Instance, PropInfo, Value) {
    var TIEnum = null;
    var n = 0;
    TIEnum = rtl.asExt(PropInfo.typeinfo,rtl.tTypeInfoEnum);
    n = TIEnum.enumtype[Value];
    if (!pas.JS.isUndefined(n)) $mod.SetJSValueProp$3(Instance,PropInfo,n);
  };
  this.GetEnumName = function (TypeInfo, Value) {
    var Result = "";
    Result = TypeInfo.enumtype[Value];
    return Result;
  };
  this.GetEnumValue = function (TypeInfo, Name) {
    var Result = 0;
    Result = TypeInfo.enumtype[Name];
    return Result;
  };
  this.GetEnumNameCount = function (TypeInfo) {
    var Result = 0;
    var o = null;
    var l = 0;
    var r = 0;
    o = TypeInfo.enumtype;
    Result = 1;
    while (o.hasOwnProperty("" + Result)) Result = Result * 2;
    l = rtl.trunc(Result / 2);
    r = Result;
    while (l <= r) {
      Result = rtl.trunc((l + r) / 2);
      if (o.hasOwnProperty("" + Result)) {
        l = Result + 1}
       else r = Result - 1;
    };
    if (o.hasOwnProperty("" + Result)) Result += 1;
    return Result;
  };
  this.GetSetProp = function (Instance, PropName) {
    var Result = "";
    Result = $mod.GetSetProp$1(Instance,$mod.FindPropInfo(Instance,PropName));
    return Result;
  };
  this.GetSetProp$1 = function (Instance, PropInfo) {
    var Result = "";
    var o = null;
    var key = "";
    var Value = "";
    var n = 0;
    var TIEnum = null;
    var TISet = null;
    Result = "";
    TISet = rtl.asExt(PropInfo.typeinfo,rtl.tTypeInfoSet);
    TIEnum = null;
    if (rtl.isExt(TISet.comptype,rtl.tTypeInfoEnum)) TIEnum = TISet.comptype;
    o = $mod.GetJSValueProp$3(Instance,PropInfo);
    for (key in o) {
      n = parseInt(key,10);
      if ((TIEnum !== null) && (n >= TIEnum.minvalue) && (n <= TIEnum.maxvalue)) {
        Value = TIEnum.enumtype[n]}
       else Value = "" + n;
      if (Result !== "") Result = Result + ",";
      Result = Result + Value;
    };
    Result = "[" + Result + "]";
    return Result;
  };
  this.GetSetPropArray = function (Instance, PropName) {
    var Result = [];
    Result = $mod.GetSetPropArray$1(Instance,$mod.FindPropInfo(Instance,PropName));
    return Result;
  };
  this.GetSetPropArray$1 = function (Instance, PropInfo) {
    var Result = [];
    var o = null;
    var Key = "";
    Result = [];
    o = $mod.GetJSValueProp$3(Instance,PropInfo);
    for (Key in o) Result.push(parseInt(Key,10));
    return Result;
  };
  this.SetSetPropArray = function (Instance, PropName, Arr) {
    $mod.SetSetPropArray$1(Instance,$mod.FindPropInfo(Instance,PropName),Arr);
  };
  this.SetSetPropArray$1 = function (Instance, PropInfo, Arr) {
    var o = null;
    var i = 0;
    o = new Object();
    for (var $in = Arr, $l = 0, $end = rtl.length($in) - 1; $l <= $end; $l++) {
      i = $in[$l];
      o["" + i] = true;
    };
    $mod.SetJSValueProp$3(Instance,PropInfo,o);
  };
  this.GetBoolProp = function (Instance, PropName) {
    var Result = false;
    Result = $mod.GetBoolProp$1(Instance,$mod.FindPropInfo(Instance,PropName));
    return Result;
  };
  this.GetBoolProp$1 = function (Instance, PropInfo) {
    var Result = false;
    Result = !($mod.GetJSValueProp$3(Instance,PropInfo) == false);
    return Result;
  };
  this.SetBoolProp = function (Instance, PropName, Value) {
    $mod.SetBoolProp$1(Instance,$mod.FindPropInfo(Instance,PropName),Value);
  };
  this.SetBoolProp$1 = function (Instance, PropInfo, Value) {
    $mod.SetJSValueProp$3(Instance,PropInfo,Value);
  };
  this.GetStrProp = function (Instance, PropName) {
    var Result = "";
    Result = $mod.GetStrProp$1(Instance,$mod.FindPropInfo(Instance,PropName));
    return Result;
  };
  this.GetStrProp$1 = function (Instance, PropInfo) {
    var Result = "";
    Result = "" + $mod.GetJSValueProp$3(Instance,PropInfo);
    return Result;
  };
  this.SetStrProp = function (Instance, PropName, Value) {
    $mod.SetStrProp$1(Instance,$mod.FindPropInfo(Instance,PropName),Value);
  };
  this.SetStrProp$1 = function (Instance, PropInfo, Value) {
    $mod.SetJSValueProp$3(Instance,PropInfo,Value);
  };
  this.GetStringProp = function (Instance, PropName) {
    var Result = "";
    Result = $mod.GetStrProp(Instance,PropName);
    return Result;
  };
  this.GetStringProp$1 = function (Instance, PropInfo) {
    var Result = "";
    Result = $mod.GetStrProp$1(Instance,PropInfo);
    return Result;
  };
  this.SetStringProp = function (Instance, PropName, Value) {
    $mod.SetStrProp(Instance,PropName,Value);
  };
  this.SetStringProp$1 = function (Instance, PropInfo, Value) {
    $mod.SetStrProp$1(Instance,PropInfo,Value);
  };
  this.GetFloatProp = function (Instance, PropName) {
    var Result = 0.0;
    Result = $mod.GetFloatProp$1(Instance,$mod.FindPropInfo(Instance,PropName));
    return Result;
  };
  this.GetFloatProp$1 = function (Instance, PropInfo) {
    var Result = 0.0;
    Result = rtl.getNumber($mod.GetJSValueProp$3(Instance,PropInfo));
    return Result;
  };
  this.SetFloatProp = function (Instance, PropName, Value) {
    $mod.SetFloatProp$1(Instance,$mod.FindPropInfo(Instance,PropName),Value);
  };
  this.SetFloatProp$1 = function (Instance, PropInfo, Value) {
    $mod.SetJSValueProp$3(Instance,PropInfo,Value);
  };
  this.GetObjectProp = function (Instance, PropName) {
    var Result = null;
    Result = $mod.GetObjectProp$2(Instance,$mod.FindPropInfo(Instance,PropName));
    return Result;
  };
  this.GetObjectProp$1 = function (Instance, PropName, MinClass) {
    var Result = null;
    Result = $mod.GetObjectProp$2(Instance,$mod.FindPropInfo(Instance,PropName));
    if ((MinClass !== null) && (Result !== null)) if (!Result.$class.InheritsFrom(MinClass)) Result = null;
    return Result;
  };
  this.GetObjectProp$2 = function (Instance, PropInfo) {
    var Result = null;
    Result = $mod.GetObjectProp$3(Instance,PropInfo,null);
    return Result;
  };
  this.GetObjectProp$3 = function (Instance, PropInfo, MinClass) {
    var Result = null;
    var O = null;
    O = rtl.getObject($mod.GetJSValueProp$3(Instance,PropInfo));
    if ((MinClass !== null) && !O.$class.InheritsFrom(MinClass)) {
      Result = null}
     else Result = O;
    return Result;
  };
  this.SetObjectProp = function (Instance, PropName, Value) {
    $mod.SetObjectProp$1(Instance,$mod.FindPropInfo(Instance,PropName),Value);
  };
  this.SetObjectProp$1 = function (Instance, PropInfo, Value) {
    $mod.SetJSValueProp$3(Instance,PropInfo,Value);
  };
  this.GetMethodProp = function (Instance, PropInfo) {
    var Result = pas.System.TMethod.$new();
    var v = undefined;
    var fn = undefined;
    Result.Code = null;
    Result.Data = null;
    v = $mod.GetJSValueProp$3(Instance,PropInfo);
    if (!rtl.isFunction(v)) return Result;
    Result.Data = v["scope"];
    fn = v["fn"];
    if (rtl.isString(fn)) {
      if (Result.Data !== null) {
        Result.Code = Result.Data["" + fn]}
       else Result.Code = v;
    } else Result.Code = fn;
    return Result;
  };
  this.GetMethodProp$1 = function (Instance, PropName) {
    var Result = pas.System.TMethod.$new();
    Result.$assign($mod.GetMethodProp(Instance,$mod.FindPropInfo(Instance,PropName)));
    return Result;
  };
  this.SetMethodProp = function (Instance, PropInfo, Value) {
    var cb = null;
    var Code = null;
    Code = Value.Code;
    if (Code === null) {
      cb = null}
     else if (rtl.isFunction(Code)) {
      if ((Code["scope"] === Value.Data) && (rtl.isFunction(Code["fn"]) || rtl.isString(Code["fn"]))) {
        cb = Code;
      } else if (rtl.isString(Code["fn"])) {
        cb = rtl.createCallback(Value.Data,"" + Code["fn"])}
       else cb = rtl.createCallback(Value.Data,Code);
    } else cb = rtl.createCallback(Value.Data,Code);
    $mod.SetJSValueProp$3(Instance,PropInfo,cb);
  };
  this.SetMethodProp$1 = function (Instance, PropName, Value) {
    $mod.SetMethodProp(Instance,$mod.FindPropInfo(Instance,PropName),Value);
  };
  this.GetInterfaceProp = function (Instance, PropName) {
    var Result = null;
    var $ok = false;
    try {
      Result = rtl.setIntfL(Result,$mod.GetInterfaceProp$1(Instance,$mod.FindPropInfo(Instance,PropName)),true);
      $ok = true;
    } finally {
      if (!$ok) rtl._Release(Result);
    };
    return Result;
  };
  this.GetInterfaceProp$1 = function (Instance, PropInfo) {
    var Result = null;
    var gk = 0;
    var $ok = false;
    try {
      if (PropInfo.typeinfo.kind !== pas.System.TTypeKind.tkInterface) throw pas.SysUtils.Exception.$create("Create$1",["Cannot get RAW interface from IInterface interface"]);
      gk = $impl.GetPropGetterKind(PropInfo);
      var $tmp = gk;
      if ($tmp === $impl.TGetterKind.gkNone) {
        throw $mod.EPropertyError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SCantReadPropertyS"),pas.System.VarRecs(18,PropInfo.name)])}
       else if ($tmp === $impl.TGetterKind.gkField) {
        Result = rtl.setIntfL(Result,rtl.getObject(Instance[PropInfo.getter]))}
       else if ($tmp === $impl.TGetterKind.gkFunction) {
        if ((16 & PropInfo.flags) > 0) {
          Result = rtl.setIntfL(Result,Instance[PropInfo.getter](PropInfo.index),true)}
         else Result = rtl.setIntfL(Result,Instance[PropInfo.getter](),true)}
       else if ($tmp === $impl.TGetterKind.gkFunctionWithParams) throw $mod.EPropertyError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SIndexedPropertyNeedsParams"),pas.System.VarRecs(18,PropInfo.name)]);
      $ok = true;
    } finally {
      if (!$ok) rtl._Release(Result);
    };
    return Result;
  };
  this.SetInterfaceProp = function (Instance, PropName, Value) {
    $mod.SetInterfaceProp$1(Instance,$mod.FindPropInfo(Instance,PropName),Value);
  };
  this.SetInterfaceProp$1 = function (Instance, PropInfo, Value) {
    var sk = 0;
    var Setter = "";
    if (PropInfo.typeinfo.kind !== pas.System.TTypeKind.tkInterface) throw pas.SysUtils.Exception.$create("Create$1",["Cannot set RAW interface from IInterface interface"]);
    sk = $impl.GetPropSetterKind(PropInfo);
    Setter = PropInfo.setter;
    var $tmp = sk;
    if ($tmp === $impl.TSetterKind.skNone) {
      throw $mod.EPropertyError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SCantWritePropertyS"),pas.System.VarRecs(18,PropInfo.name)])}
     else if ($tmp === $impl.TSetterKind.skField) {
      rtl.setIntfP(Instance,Setter,Value)}
     else if ($tmp === $impl.TSetterKind.skProcedure) {
      if ((16 & PropInfo.flags) > 0) {
        Instance[Setter](PropInfo.index,Value)}
       else Instance[Setter](Value)}
     else if ($tmp === $impl.TSetterKind.skProcedureWithParams) throw $mod.EPropertyError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SIndexedPropertyNeedsParams"),pas.System.VarRecs(18,PropInfo.name)]);
  };
  this.GetRawInterfaceProp = function (Instance, PropName) {
    var Result = null;
    Result = $mod.GetRawInterfaceProp$1(Instance,$mod.FindPropInfo(Instance,PropName));
    return Result;
  };
  this.GetRawInterfaceProp$1 = function (Instance, PropInfo) {
    var Result = null;
    Result = $mod.GetJSValueProp$3(Instance,PropInfo);
    return Result;
  };
  this.SetRawInterfaceProp = function (Instance, PropName, Value) {
    $mod.SetRawInterfaceProp$1(Instance,$mod.FindPropInfo(Instance,PropName),Value);
  };
  this.SetRawInterfaceProp$1 = function (Instance, PropInfo, Value) {
    $mod.SetJSValueProp$3(Instance,PropInfo,Value);
  };
  $mod.$implcode = function () {
    $mod.$rtti.$ExtClass("TCreatorAttribute",{jsclass: "attr"});
    $mod.$rtti.$ClassRef("TCreatorAttributeClass",{instancetype: $mod.$rtti["TCreatorAttribute"]});
    $impl.TGetterKind = {"0": "gkNone", gkNone: 0, "1": "gkField", gkField: 1, "2": "gkFunction", gkFunction: 2, "3": "gkFunctionWithParams", gkFunctionWithParams: 3};
    $mod.$rtti.$Enum("TGetterKind",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: $impl.TGetterKind});
    $impl.GetPropGetterKind = function (PropInfo) {
      var Result = 0;
      if (PropInfo.getter === "") {
        Result = $impl.TGetterKind.gkNone}
       else if ((1 & PropInfo.flags) > 0) {
        if (rtl.length(PropInfo.params) > 0) {
          Result = $impl.TGetterKind.gkFunctionWithParams}
         else Result = $impl.TGetterKind.gkFunction;
      } else Result = $impl.TGetterKind.gkField;
      return Result;
    };
    $impl.TSetterKind = {"0": "skNone", skNone: 0, "1": "skField", skField: 1, "2": "skProcedure", skProcedure: 2, "3": "skProcedureWithParams", skProcedureWithParams: 3};
    $mod.$rtti.$Enum("TSetterKind",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: $impl.TSetterKind});
    $impl.GetPropSetterKind = function (PropInfo) {
      var Result = 0;
      if (PropInfo.setter === "") {
        Result = $impl.TSetterKind.skNone}
       else if ((2 & PropInfo.flags) > 0) {
        if (rtl.length(PropInfo.params) > 0) {
          Result = $impl.TSetterKind.skProcedureWithParams}
         else Result = $impl.TSetterKind.skProcedure;
      } else Result = $impl.TSetterKind.skField;
      return Result;
    };
  };
},[]);
rtl.module("Web",["System","Types","JS"],function () {
  "use strict";
  var $mod = this;
  this.$rtti.$ExtClass("TJSEvent");
  this.$rtti.$ExtClass("TJSHTMLElement");
  this.$rtti.$ExtClass("TJSWindow");
  this.$rtti.$ExtClass("TJSDOMTokenList");
  this.$rtti.$ExtClass("TJSXPathResult");
  this.$rtti.$ExtClass("TJSNodeList");
  this.$rtti.$ExtClass("TJSDocument");
  this.$rtti.$ExtClass("TJSElement");
  this.$rtti.$ExtClass("TJSCSSStyleSheet");
  this.$rtti.$ExtClass("TJSNodeFilter");
  this.$rtti.$ExtClass("TJSIDBObjectStore");
  this.$rtti.$ExtClass("TIDBDatabase");
  this.$rtti.$ExtClass("TJSIDBRequest");
  this.$rtti.$ExtClass("TJSEventTarget");
  this.$rtti.$ExtClass("TJSMouseEvent");
  this.$rtti.$ExtClass("TJSWheelEvent");
  this.$rtti.$ExtClass("TJSKeyboardEvent");
  this.$rtti.$ExtClass("TJSPointerEvent");
  this.$rtti.$ExtClass("TJSUIEvent");
  this.$rtti.$ExtClass("TJSTouchEvent");
  this.$rtti.$ExtClass("TJSInputEvent");
  this.$rtti.$ExtClass("TJSBlob");
  this.$rtti.$ExtClass("TJSPermissions");
  this.$rtti.$ExtClass("TJSFileSystemFileHandle");
  this.$rtti.$DynArray("TJSFileSystemFileHandleArray",{eltype: this.$rtti["TJSFileSystemFileHandle"]});
  this.$rtti.$ExtClass("TJSFileSystemDirectoryHandle");
  this.$rtti.$DynArray("TJSFileSystemDirectoryHandleArray",{eltype: this.$rtti["TJSFileSystemDirectoryHandle"]});
  this.$rtti.$ExtClass("TJSShowOpenFilePickerOptions");
  this.$rtti.$ExtClass("TJSShowSaveFilePickerOptions");
  this.$rtti.$ExtClass("TJSServiceWorker");
  this.$rtti.$ExtClass("TJSClient");
  this.$rtti.$ExtClass("TJSRequest");
  this.$rtti.$ExtClass("TJSResponse");
  this.$rtti.$ExtClass("TJSServiceWorkerRegistration");
  this.$rtti.$ExtClass("TJSResizeObserver");
  this.$rtti.$RefToProcVar("TJSEventHandler",{procsig: rtl.newTIProcSig([["Event",this.$rtti["TJSEvent"]]],rtl.boolean,8)});
  this.$rtti.$RefToProcVar("TJSRawEventHandler",{procsig: rtl.newTIProcSig([["Event",this.$rtti["TJSEvent"]]],null,8)});
  this.$rtti.$RefToProcVar("TJSUIEventHandler",{procsig: rtl.newTIProcSig([["aEvent",this.$rtti["TJSUIEvent"]]],rtl.boolean,8)});
  this.$rtti.$RefToProcVar("TJSPointerEventHandler",{procsig: rtl.newTIProcSig([["aEvent",this.$rtti["TJSPointerEvent"]]],rtl.boolean,8)});
  this.$rtti.$RefToProcVar("THTMLClickEventHandler",{procsig: rtl.newTIProcSig([["aEvent",this.$rtti["TJSMouseEvent"]]],rtl.boolean,8)});
  this.$rtti.$ExtClass("TJSEventTarget",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "EventTarget"});
  this.$rtti.$ExtClass("TJSNode",{ancestor: this.$rtti["TJSEventTarget"], jsclass: "Node"});
  this.$rtti.$RefToProcVar("TJSNodeListCallBack",{procsig: rtl.newTIProcSig([["currentValue",this.$rtti["TJSNode"]],["currentIndex",rtl.nativeint],["list",this.$rtti["TJSNodeList"]]])});
  this.$rtti.$MethodVar("TJSNodeListEvent",{procsig: rtl.newTIProcSig([["currentValue",this.$rtti["TJSNode"]],["currentIndex",rtl.nativeint],["list",this.$rtti["TJSNodeList"]]]), methodkind: 0});
  this.$rtti.$ExtClass("TJSNodeList",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "NodeList"});
  this.$rtti.$ExtClass("TJSAttr",{ancestor: this.$rtti["TJSNode"], jsclass: "Attr"});
  this.$rtti.$ExtClass("TJSNamedNodeMap",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "NamedNodeMap"});
  this.$rtti.$ExtClass("TJSHTMLCollection",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "HTMLCollection"});
  this.$rtti.$ProcVar("TDOMTokenlistCallBack",{procsig: rtl.newTIProcSig([["Current",rtl.jsvalue],["currentIndex",rtl.nativeint],["list",this.$rtti["TJSDOMTokenList"]]])});
  this.$rtti.$ExtClass("TJSDOMTokenList",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "DOMTokenList"});
  this.$rtti.$ExtClass("TJSDOMRect",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "DOMRect"});
  rtl.recNewT(this,"TJSClientRect",function () {
    this.left = 0.0;
    this.top = 0.0;
    this.right = 0.0;
    this.bottom = 0.0;
    this.$eq = function (b) {
      return (this.left === b.left) && (this.top === b.top) && (this.right === b.right) && (this.bottom === b.bottom);
    };
    this.$assign = function (s) {
      this.left = s.left;
      this.top = s.top;
      this.right = s.right;
      this.bottom = s.bottom;
      return this;
    };
    var $r = $mod.$rtti.$Record("TJSClientRect",{},this);
    $r.addField("left",rtl.double);
    $r.addField("top",rtl.double);
    $r.addField("right",rtl.double);
    $r.addField("bottom",rtl.double);
  });
  this.$rtti.$DynArray("TJSClientRectArray",{eltype: this.$rtti["TJSClientRect"]});
  this.$rtti.$ExtClass("TJSElement",{ancestor: this.$rtti["TJSNode"], jsclass: "Element"});
  rtl.recNewT(this,"TJSElementCreationOptions",function () {
    this.named = "";
    this.$eq = function (b) {
      return this.named === b.named;
    };
    this.$assign = function (s) {
      this.named = s.named;
      return this;
    };
    var $r = $mod.$rtti.$Record("TJSElementCreationOptions",{},this);
    $r.addField("named",rtl.string);
  });
  this.$rtti.$ExtClass("TJSDocumentType",{ancestor: this.$rtti["TJSNode"], jsclass: "DocumentType"});
  this.$rtti.$ExtClass("TJSDOMImplementation",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "DocumentImplementation"});
  this.$rtti.$ExtClass("TJSLocation",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "Location"});
  this.$rtti.$ExtClass("TJSCSSStyleDeclaration");
  this.$rtti.$ExtClass("TJSStyleSheet",{ancestor: this.$rtti["TJSEventTarget"], jsclass: "StyleSheet"});
  this.$rtti.$ExtClass("TJSCSSRule",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "CSSRule"});
  this.$rtti.$ExtClass("TJSCSSStyleRule",{ancestor: this.$rtti["TJSCSSRule"], jsclass: "CSSStyleRule"});
  this.$rtti.$ExtClass("TJSCSSRuleList",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "CSSRuleList"});
  this.$rtti.$ExtClass("TJSCSSStyleSheet",{ancestor: this.$rtti["TJSStyleSheet"], jsclass: "CSSStyleSheet"});
  this.$rtti.$ExtClass("TJSStyleSheetList",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "StyleSheetList"});
  this.$rtti.$ExtClass("TJSDocumentFragment",{ancestor: this.$rtti["TJSNode"], jsclass: "DocumentFragment"});
  rtl.recNewT(this,"TJSEventInit",function () {
    this.bubbles = false;
    this.cancelable = false;
    this.scoped = false;
    this.composed = false;
    this.$eq = function (b) {
      return (this.bubbles === b.bubbles) && (this.cancelable === b.cancelable) && (this.scoped === b.scoped) && (this.composed === b.composed);
    };
    this.$assign = function (s) {
      this.bubbles = s.bubbles;
      this.cancelable = s.cancelable;
      this.scoped = s.scoped;
      this.composed = s.composed;
      return this;
    };
    var $r = $mod.$rtti.$Record("TJSEventInit",{},this);
    $r.addField("bubbles",rtl.boolean);
    $r.addField("cancelable",rtl.boolean);
    $r.addField("scoped",rtl.boolean);
    $r.addField("composed",rtl.boolean);
  });
  this.$rtti.$ExtClass("TJSEvent",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "Event"});
  this.$rtti.$ExtClass("TJSXPathExpression",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "XPathExpression"});
  this.$rtti.$ExtClass("TJSXPathNSResolver",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "XPathNSResolver"});
  this.$rtti.$ExtClass("TJSCharacterData",{ancestor: this.$rtti["TJSNode"], jsclass: "CharacterData"});
  this.$rtti.$ExtClass("TJSProcessingInstruction",{ancestor: this.$rtti["TJSCharacterData"], jsclass: "ProcessingInstruction"});
  this.$rtti.$ExtClass("TJSRange",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "Range"});
  this.$rtti.$ExtClass("TJSTreeWalker",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "TreeWalker"});
  this.$rtti.$ExtClass("TJSNodeFilter",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "NodeFilter"});
  this.$rtti.$ExtClass("TJSXPathResult",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "XPathResult"});
  this.$rtti.$ExtClass("TJSSelection",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "Selection"});
  this.$rtti.$ProcVar("TJSNameSpaceMapperCallback",{procsig: rtl.newTIProcSig([["aNameSpace",rtl.string]],rtl.string)});
  this.$rtti.$ExtClass("TJSHTMLFile");
  this.$rtti.$ExtClass("TJSHTMLFileList");
  this.$rtti.$RefToProcVar("TJSDataTransferItemCallBack",{procsig: rtl.newTIProcSig([["aData",rtl.string]],null,8)});
  this.$rtti.$ExtClass("TJSDataTransferItem",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "DataTransferItem"});
  this.$rtti.$ExtClass("TJSDataTransferItemList",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "DataTransferItemList"});
  this.$rtti.$ExtClass("TJSDataTransfer",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "DataTransfer"});
  this.$rtti.$ExtClass("TJSDragEvent",{ancestor: this.$rtti["TJSEvent"], jsclass: "DragEvent"});
  this.$rtti.$RefToProcVar("TJSDragDropEventHandler",{procsig: rtl.newTIProcSig([["aEvent",this.$rtti["TJSDragEvent"]]],rtl.boolean,8)});
  this.$rtti.$ExtClass("TJSClipBoardEvent",{ancestor: this.$rtti["TJSEvent"], jsclass: "ClipboardEvent"});
  rtl.createClassExt(this,"TJSFocusEvent",Event,"",function () {
    this.$init = function () {
    };
    this.$final = function () {
    };
  });
  rtl.createClassExt(this,"TJSAnimationEvent",Event,"",function () {
    this.$init = function () {
    };
    this.$final = function () {
    };
  });
  rtl.createClassExt(this,"TJSLoadEvent",Event,"",function () {
    this.$init = function () {
    };
    this.$final = function () {
    };
  });
  this.$rtti.$ExtClass("TJSErrorEvent",{ancestor: this.$rtti["TJSEvent"], jsclass: "ErrorEvent"});
  this.$rtti.$ExtClass("TJSPromiseRejectionEvent",{ancestor: this.$rtti["TJSEvent"], jsclass: "PromiseRejectionEvent"});
  rtl.createClassExt(this,"TJSPageTransitionEvent",Event,"",function () {
    this.$init = function () {
    };
    this.$final = function () {
    };
  });
  this.$rtti.$ExtClass("TJSHashChangeEvent",{ancestor: this.$rtti["TJSEvent"], jsclass: "HashChangeEvent"});
  this.$rtti.$ExtClass("TJSPopStateEvent",{ancestor: this.$rtti["TJSEvent"], jsclass: "PopStateEvent"});
  this.$rtti.$ExtClass("TJSStorageEvent",{ancestor: this.$rtti["TJSEvent"], jsclass: "StorageEvent"});
  this.$rtti.$ExtClass("TJSProgressEvent",{ancestor: this.$rtti["TJSEvent"], jsclass: "ProgressEvent"});
  this.$rtti.$ExtClass("TJSCloseEvent",{ancestor: this.$rtti["TJSEvent"], jsclass: "CloseEvent"});
  this.$rtti.$RefToProcVar("TJSPageTransitionEventHandler",{procsig: rtl.newTIProcSig([["aEvent",this.$rtti["TJSPageTransitionEvent"]]],rtl.boolean,8)});
  this.$rtti.$RefToProcVar("TJSHashChangeEventhandler",{procsig: rtl.newTIProcSig([["aEvent",this.$rtti["TJSHashChangeEvent"]]],rtl.boolean,8)});
  this.$rtti.$RefToProcVar("TJSMouseWheelEventHandler",{procsig: rtl.newTIProcSig([["aEvent",this.$rtti["TJSWheelEvent"]]],rtl.boolean,8)});
  this.$rtti.$RefToProcVar("TJSMouseEventHandler",{procsig: rtl.newTIProcSig([["aEvent",this.$rtti["TJSMouseEvent"]]],rtl.boolean,8)});
  this.$rtti.$RefToProcVar("THTMLAnimationEventHandler",{procsig: rtl.newTIProcSig([["aEvent",this.$rtti["TJSAnimationEvent"]]],rtl.boolean,8)});
  this.$rtti.$RefToProcVar("TJSErrorEventHandler",{procsig: rtl.newTIProcSig([["aEvent",this.$rtti["TJSErrorEvent"]]],rtl.boolean,8)});
  this.$rtti.$RefToProcVar("TJSPromiseRejectionEventHandler",{procsig: rtl.newTIProcSig([["aEvent",this.$rtti["TJSPromiseRejectionEvent"]]],rtl.boolean,8)});
  this.$rtti.$RefToProcVar("TJSFocusEventHandler",{procsig: rtl.newTIProcSig([["aEvent",this.$rtti["TJSFocusEvent"]]],rtl.boolean,8)});
  this.$rtti.$RefToProcVar("TJSKeyEventhandler",{procsig: rtl.newTIProcSig([["aEvent",this.$rtti["TJSKeyboardEvent"]]],rtl.boolean,8)});
  this.$rtti.$RefToProcVar("TJSLoadEventhandler",{procsig: rtl.newTIProcSig([["aEvent",this.$rtti["TJSLoadEvent"]]],rtl.boolean,8)});
  this.$rtti.$RefToProcVar("TJSPopStateEventHandler",{procsig: rtl.newTIProcSig([["aEvent",this.$rtti["TJSPopStateEvent"]]],rtl.boolean,8)});
  this.$rtti.$RefToProcVar("TJSStorageEventHandler",{procsig: rtl.newTIProcSig([["aEvent",this.$rtti["TJSStorageEvent"]]],rtl.boolean,8)});
  this.$rtti.$RefToProcVar("TJSProgressEventhandler",{procsig: rtl.newTIProcSig([["aEvent",this.$rtti["TJSProgressEvent"]]],rtl.boolean,8)});
  this.$rtti.$RefToProcVar("TJSTouchEventHandler",{procsig: rtl.newTIProcSig([["aEvent",this.$rtti["TJSTouchEvent"]]],rtl.boolean,8)});
  this.$rtti.$ExtClass("TJSDocument",{ancestor: this.$rtti["TJSNode"], jsclass: "Document"});
  this.$rtti.$ExtClass("TJSConsole",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "Console"});
  this.$rtti.$ExtClass("TJSCryptoKey");
  this.$rtti.$ExtClass("TJSSubtleCrypto");
  rtl.recNewT(this,"Algorithm",function () {
    this.name = "";
    this.$eq = function (b) {
      return this.name === b.name;
    };
    this.$assign = function (s) {
      this.name = s.name;
      return this;
    };
    var $r = $mod.$rtti.$Record("Algorithm",{},this);
    $r.addField("name",rtl.string);
  });
  rtl.recNewT(this,"AesCbcParams",function () {
    this.iv = null;
    this.$eq = function (b) {
      return this.iv === b.iv;
    };
    this.$assign = function (s) {
      this.iv = s.iv;
      return this;
    };
    var $r = $mod.$rtti.$Record("AesCbcParams",{},this);
    $r.addField("iv",pas.JS.$rtti["TJSBufferSource"]);
  });
  rtl.recNewT(this,"AesCtrParams",function () {
    this.counter = null;
    this.$eq = function (b) {
      return (this.counter === b.counter) && (this.length === b.length);
    };
    this.$assign = function (s) {
      this.counter = s.counter;
      this.length = s.length;
      return this;
    };
    var $r = $mod.$rtti.$Record("AesCtrParams",{},this);
    $r.addField("counter",pas.JS.$rtti["TJSBufferSource"]);
    $r.addField("length",rtl.byte);
  });
  rtl.recNewT(this,"AesGcmParams",function () {
    this.iv = null;
    this.additionalData = null;
    this.tagLength = 0;
    this.$eq = function (b) {
      return (this.iv === b.iv) && (this.additionalData === b.additionalData) && (this.tagLength === b.tagLength);
    };
    this.$assign = function (s) {
      this.iv = s.iv;
      this.additionalData = s.additionalData;
      this.tagLength = s.tagLength;
      return this;
    };
    var $r = $mod.$rtti.$Record("AesGcmParams",{},this);
    $r.addField("iv",pas.JS.$rtti["TJSBufferSource"]);
    $r.addField("additionalData",pas.JS.$rtti["TJSBufferSource"]);
    $r.addField("tagLength",rtl.byte);
  });
  rtl.recNewT(this,"HmacImportParams",function () {
    this.hash = undefined;
    this.$eq = function (b) {
      return this.hash === b.hash;
    };
    this.$assign = function (s) {
      this.hash = s.hash;
      return this;
    };
    var $r = $mod.$rtti.$Record("HmacImportParams",{},this);
    $r.addField("hash",rtl.jsvalue);
  });
  rtl.recNewT(this,"Pbkdf2Params",function () {
    this.salt = null;
    this.iterations = 0;
    this.hash = undefined;
    this.$eq = function (b) {
      return (this.salt === b.salt) && (this.iterations === b.iterations) && (this.hash === b.hash);
    };
    this.$assign = function (s) {
      this.salt = s.salt;
      this.iterations = s.iterations;
      this.hash = s.hash;
      return this;
    };
    var $r = $mod.$rtti.$Record("Pbkdf2Params",{},this);
    $r.addField("salt",pas.JS.$rtti["TJSBufferSource"]);
    $r.addField("iterations",rtl.nativeint);
    $r.addField("hash",rtl.jsvalue);
  });
  rtl.recNewT(this,"RsaHashedImportParams",function () {
    this.hash = undefined;
    this.$eq = function (b) {
      return this.hash === b.hash;
    };
    this.$assign = function (s) {
      this.hash = s.hash;
      return this;
    };
    var $r = $mod.$rtti.$Record("RsaHashedImportParams",{},this);
    $r.addField("hash",rtl.jsvalue);
  });
  rtl.recNewT(this,"AesKeyGenParams",function () {
    this.$eq = function (b) {
      return this.length === b.length;
    };
    this.$assign = function (s) {
      this.length = s.length;
      return this;
    };
    var $r = $mod.$rtti.$Record("AesKeyGenParams",{},this);
    $r.addField("length",rtl.longint);
  });
  rtl.recNewT(this,"HmacKeyGenParams",function () {
    this.hash = undefined;
    this.$eq = function (b) {
      return (this.hash === b.hash) && (this.length === b.length);
    };
    this.$assign = function (s) {
      this.hash = s.hash;
      this.length = s.length;
      return this;
    };
    var $r = $mod.$rtti.$Record("HmacKeyGenParams",{},this);
    $r.addField("hash",rtl.jsvalue);
    $r.addField("length",rtl.longint);
  });
  rtl.recNewT(this,"RsaHashedKeyGenParams",function () {
    this.modulusLength = 0;
    this.publicExponent = null;
    this.hash = undefined;
    this.$eq = function (b) {
      return (this.modulusLength === b.modulusLength) && (this.publicExponent === b.publicExponent) && (this.hash === b.hash);
    };
    this.$assign = function (s) {
      this.modulusLength = s.modulusLength;
      this.publicExponent = s.publicExponent;
      this.hash = s.hash;
      return this;
    };
    var $r = $mod.$rtti.$Record("RsaHashedKeyGenParams",{},this);
    $r.addField("modulusLength",rtl.longint);
    $r.addField("publicExponent",pas.JS.$rtti["TJSUint8Array"]);
    $r.addField("hash",rtl.jsvalue);
  });
  rtl.recNewT(this,"RsaOaepParams",function () {
    this.$eq = function (b) {
      return this.label === b.label;
    };
    this.$assign = function (s) {
      this.label = s.label;
      return this;
    };
    var $r = $mod.$rtti.$Record("RsaOaepParams",{},this);
    $r.addField("label",pas.JS.$rtti["TJSBufferSource"]);
  });
  rtl.recNewT(this,"RsaPssParams",function () {
    this.saltLength = 0;
    this.$eq = function (b) {
      return this.saltLength === b.saltLength;
    };
    this.$assign = function (s) {
      this.saltLength = s.saltLength;
      return this;
    };
    var $r = $mod.$rtti.$Record("RsaPssParams",{},this);
    $r.addField("saltLength",rtl.longint);
  });
  rtl.recNewT(this,"DhKeyGenParams",function () {
    this.prime = null;
    this.generator = null;
    this.$eq = function (b) {
      return (this.prime === b.prime) && (this.generator === b.generator);
    };
    this.$assign = function (s) {
      this.prime = s.prime;
      this.generator = s.generator;
      return this;
    };
    var $r = $mod.$rtti.$Record("DhKeyGenParams",{},this);
    $r.addField("prime",pas.JS.$rtti["TJSUint8Array"]);
    $r.addField("generator",pas.JS.$rtti["TJSUint8Array"]);
  });
  rtl.recNewT(this,"EcKeyGenParams",function () {
    this.$eq = function (b) {
      return this.namedCurve === b.namedCurve;
    };
    this.$assign = function (s) {
      this.namedCurve = s.namedCurve;
      return this;
    };
    var $r = $mod.$rtti.$Record("EcKeyGenParams",{},this);
    $r.addField("namedCurve",rtl.string);
  });
  rtl.recNewT(this,"AesDerivedKeyParams",function () {
    this.$eq = function (b) {
      return this.length === b.length;
    };
    this.$assign = function (s) {
      this.length = s.length;
      return this;
    };
    var $r = $mod.$rtti.$Record("AesDerivedKeyParams",{},this);
    $r.addField("length",rtl.longint);
  });
  rtl.recNewT(this,"HmacDerivedKeyParams",function () {
    this.$eq = function (b) {
      return this.length === b.length;
    };
    this.$assign = function (s) {
      this.length = s.length;
      return this;
    };
    var $r = $mod.$rtti.$Record("HmacDerivedKeyParams",{},this);
    $r.addField("length",rtl.longint);
  });
  rtl.recNewT(this,"EcdhKeyDeriveParams",function () {
    this.$eq = function (b) {
      return this.public === b.public;
    };
    this.$assign = function (s) {
      this.public = s.public;
      return this;
    };
    var $r = $mod.$rtti.$Record("EcdhKeyDeriveParams",{},this);
    $r.addField("public",$mod.$rtti["TJSCryptoKey"]);
  });
  rtl.recNewT(this,"DhKeyDeriveParams",function () {
    this.$eq = function (b) {
      return this.public === b.public;
    };
    this.$assign = function (s) {
      this.public = s.public;
      return this;
    };
    var $r = $mod.$rtti.$Record("DhKeyDeriveParams",{},this);
    $r.addField("public",$mod.$rtti["TJSCryptoKey"]);
  });
  rtl.recNewT(this,"DhImportKeyParams",function () {
    this.prime = null;
    this.generator = null;
    this.$eq = function (b) {
      return (this.prime === b.prime) && (this.generator === b.generator);
    };
    this.$assign = function (s) {
      this.prime = s.prime;
      this.generator = s.generator;
      return this;
    };
    var $r = $mod.$rtti.$Record("DhImportKeyParams",{},this);
    $r.addField("prime",pas.JS.$rtti["TJSUint8Array"]);
    $r.addField("generator",pas.JS.$rtti["TJSUint8Array"]);
  });
  rtl.recNewT(this,"EcdsaParams",function () {
    this.hash = undefined;
    this.$eq = function (b) {
      return this.hash === b.hash;
    };
    this.$assign = function (s) {
      this.hash = s.hash;
      return this;
    };
    var $r = $mod.$rtti.$Record("EcdsaParams",{},this);
    $r.addField("hash",rtl.jsvalue);
  });
  rtl.recNewT(this,"EcKeyImportParams",function () {
    this.$eq = function (b) {
      return this.namedCurve === b.namedCurve;
    };
    this.$assign = function (s) {
      this.namedCurve = s.namedCurve;
      return this;
    };
    var $r = $mod.$rtti.$Record("EcKeyImportParams",{},this);
    $r.addField("namedCurve",rtl.string);
  });
  rtl.recNewT(this,"HkdfParams",function () {
    this.hash = undefined;
    this.salt = null;
    this.info = null;
    this.$eq = function (b) {
      return (this.hash === b.hash) && (this.salt === b.salt) && (this.info === b.info);
    };
    this.$assign = function (s) {
      this.hash = s.hash;
      this.salt = s.salt;
      this.info = s.info;
      return this;
    };
    var $r = $mod.$rtti.$Record("HkdfParams",{},this);
    $r.addField("hash",rtl.jsvalue);
    $r.addField("salt",pas.JS.$rtti["TJSBufferSource"]);
    $r.addField("info",pas.JS.$rtti["TJSBufferSource"]);
  });
  rtl.recNewT(this,"RsaOtherPrimesInfo",function () {
    this.r = "";
    this.d = "";
    this.t = "";
    this.$eq = function (b) {
      return (this.r === b.r) && (this.d === b.d) && (this.t === b.t);
    };
    this.$assign = function (s) {
      this.r = s.r;
      this.d = s.d;
      this.t = s.t;
      return this;
    };
    var $r = $mod.$rtti.$Record("RsaOtherPrimesInfo",{},this);
    $r.addField("r",rtl.string);
    $r.addField("d",rtl.string);
    $r.addField("t",rtl.string);
  });
  this.$rtti.$DynArray("TRsaOtherPrimesInfoDynArray",{eltype: this.$rtti["RsaOtherPrimesInfo"]});
  rtl.recNewT(this,"JsonWebKey",function () {
    this.kty = "";
    this.use = "";
    this.alg = "";
    this.ext = false;
    this.crv = "";
    this.x = "";
    this.y = "";
    this.d = "";
    this.n = "";
    this.e = "";
    this.p = "";
    this.q = "";
    this.dp = "";
    this.dq = "";
    this.qi = "";
    this.k = "";
    this.$new = function () {
      var r = Object.create(this);
      r.key_ops = [];
      r.oth = [];
      return r;
    };
    this.$eq = function (b) {
      return (this.kty === b.kty) && (this.use === b.use) && (this.key_ops === b.key_ops) && (this.alg === b.alg) && (this.ext === b.ext) && (this.crv === b.crv) && (this.x === b.x) && (this.y === b.y) && (this.d === b.d) && (this.n === b.n) && (this.e === b.e) && (this.p === b.p) && (this.q === b.q) && (this.dp === b.dp) && (this.dq === b.dq) && (this.qi === b.qi) && (this.oth === b.oth) && (this.k === b.k);
    };
    this.$assign = function (s) {
      this.kty = s.kty;
      this.use = s.use;
      this.key_ops = rtl.arrayRef(s.key_ops);
      this.alg = s.alg;
      this.ext = s.ext;
      this.crv = s.crv;
      this.x = s.x;
      this.y = s.y;
      this.d = s.d;
      this.n = s.n;
      this.e = s.e;
      this.p = s.p;
      this.q = s.q;
      this.dp = s.dp;
      this.dq = s.dq;
      this.qi = s.qi;
      this.oth = rtl.arrayRef(s.oth);
      this.k = s.k;
      return this;
    };
    var $r = $mod.$rtti.$Record("JsonWebKey",{},this);
    $r.addField("kty",rtl.string);
    $r.addField("use",rtl.string);
    $r.addField("key_ops",pas.Types.$rtti["TStringDynArray"]);
    $r.addField("alg",rtl.string);
    $r.addField("ext",rtl.boolean);
    $r.addField("crv",rtl.string);
    $r.addField("x",rtl.string);
    $r.addField("y",rtl.string);
    $r.addField("d",rtl.string);
    $r.addField("n",rtl.string);
    $r.addField("e",rtl.string);
    $r.addField("p",rtl.string);
    $r.addField("q",rtl.string);
    $r.addField("dp",rtl.string);
    $r.addField("dq",rtl.string);
    $r.addField("qi",rtl.string);
    $r.addField("oth",$mod.$rtti["TRsaOtherPrimesInfoDynArray"]);
    $r.addField("k",rtl.string);
  });
  rtl.recNewT(this,"CryptoKeyPair",function () {
    this.publicKey = null;
    this.privateKey = null;
    this.$eq = function (b) {
      return (this.publicKey === b.publicKey) && (this.privateKey === b.privateKey);
    };
    this.$assign = function (s) {
      this.publicKey = s.publicKey;
      this.privateKey = s.privateKey;
      return this;
    };
    var $r = $mod.$rtti.$Record("CryptoKeyPair",{},this);
    $r.addField("publicKey",$mod.$rtti["TJSCryptoKey"]);
    $r.addField("privateKey",$mod.$rtti["TJSCryptoKey"]);
  });
  this.$rtti.$DynArray("TKeyUsageDynArray",{eltype: rtl.string});
  this.$rtti.$ExtClass("TJSCryptoKey",{jsclass: "CryptoKey"});
  this.$rtti.$ExtClass("TJSSubtleCrypto",{jsclass: "SubtleCrypto"});
  this.$rtti.$ExtClass("TJSCrypto",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "Crypto"});
  this.$rtti.$ExtClass("TJSHistory",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "History"});
  rtl.createClass(this,"TJSIDBTransactionMode",pas.System.TObject,function () {
    this.readonly = "readonly";
    this.readwrite = "readwrite";
    this.versionchange = "versionchange";
  });
  this.$rtti.$ExtClass("TJSIDBTransaction",{ancestor: this.$rtti["TJSEventTarget"], jsclass: "IDBTransaction"});
  this.$rtti.$ExtClass("TJSIDBKeyRange",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "IDBKeyRange"});
  rtl.recNewT(this,"TJSIDBIndexParameters",function () {
    this.unique = false;
    this.multiEntry = false;
    this.locale = "";
    this.$eq = function (b) {
      return (this.unique === b.unique) && (this.multiEntry === b.multiEntry) && (this.locale === b.locale);
    };
    this.$assign = function (s) {
      this.unique = s.unique;
      this.multiEntry = s.multiEntry;
      this.locale = s.locale;
      return this;
    };
    var $r = $mod.$rtti.$Record("TJSIDBIndexParameters",{},this);
    $r.addField("unique",rtl.boolean);
    $r.addField("multiEntry",rtl.boolean);
    $r.addField("locale",rtl.string);
  });
  this.$rtti.$ExtClass("TJSIDBIndex",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "IDBIndex"});
  this.$rtti.$ExtClass("TJSIDBCursorDirection",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "IDBCursorDirection"});
  this.$rtti.$ExtClass("TJSIDBCursor",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "IDBCursor"});
  this.$rtti.$ExtClass("TJSIDBObjectStore",{ancestor: this.$rtti["TJSEventTarget"], jsclass: "IDBObjectStore"});
  this.$rtti.$ExtClass("TJSIDBRequest",{ancestor: this.$rtti["TJSEventTarget"], jsclass: "IDBRequest"});
  this.$rtti.$ExtClass("TJSIDBOpenDBRequest",{ancestor: this.$rtti["TJSIDBRequest"], jsclass: "IDBOpenDBRequest"});
  rtl.recNewT(this,"TJSCreateObjectStoreOptions",function () {
    this.keyPath = undefined;
    this.autoIncrement = false;
    this.$eq = function (b) {
      return (this.keyPath === b.keyPath) && (this.autoIncrement === b.autoIncrement);
    };
    this.$assign = function (s) {
      this.keyPath = s.keyPath;
      this.autoIncrement = s.autoIncrement;
      return this;
    };
    var $r = $mod.$rtti.$Record("TJSCreateObjectStoreOptions",{},this);
    $r.addField("keyPath",rtl.jsvalue);
    $r.addField("autoIncrement",rtl.boolean);
  });
  this.$rtti.$ExtClass("TIDBDatabase",{ancestor: this.$rtti["TJSEventTarget"], jsclass: "IDBDatabase"});
  this.$rtti.$ExtClass("TJSIDBFactory",{ancestor: this.$rtti["TJSEventTarget"], jsclass: "IDBFactory"});
  this.$rtti.$ExtClass("TJSStorage",{ancestor: this.$rtti["TJSEventTarget"], jsclass: "Storage"});
  this.$rtti.$ExtClass("TJSVisibleItem",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "IVisible"});
  this.$rtti.$ExtClass("TJSLocationBar",{ancestor: this.$rtti["TJSVisibleItem"], jsclass: "LocationBar"});
  this.$rtti.$ExtClass("TJSMenuBar",{ancestor: this.$rtti["TJSVisibleItem"], jsclass: "MenuBar"});
  this.$rtti.$ExtClass("TJSToolBar",{ancestor: this.$rtti["TJSVisibleItem"], jsclass: "ToolBar"});
  this.$rtti.$ExtClass("TJSPersonalBar",{ancestor: this.$rtti["TJSVisibleItem"], jsclass: "PersonalBar"});
  this.$rtti.$ExtClass("TJSScrollBars",{ancestor: this.$rtti["TJSVisibleItem"], jsclass: "ScrollBars"});
  rtl.recNewT(this,"TJSPositionError",function () {
    this.code = 0;
    this.message = "";
    this.$eq = function (b) {
      return (this.code === b.code) && (this.message === b.message);
    };
    this.$assign = function (s) {
      this.code = s.code;
      this.message = s.message;
      return this;
    };
    var $r = $mod.$rtti.$Record("TJSPositionError",{},this);
    $r.addField("code",rtl.longint);
    $r.addField("message",rtl.string);
  });
  rtl.recNewT(this,"TJSPositionOptions",function () {
    this.enableHighAccuracy = false;
    this.timeout = 0;
    this.maximumAge = 0;
    this.$eq = function (b) {
      return (this.enableHighAccuracy === b.enableHighAccuracy) && (this.timeout === b.timeout) && (this.maximumAge === b.maximumAge);
    };
    this.$assign = function (s) {
      this.enableHighAccuracy = s.enableHighAccuracy;
      this.timeout = s.timeout;
      this.maximumAge = s.maximumAge;
      return this;
    };
    var $r = $mod.$rtti.$Record("TJSPositionOptions",{},this);
    $r.addField("enableHighAccuracy",rtl.boolean);
    $r.addField("timeout",rtl.longint);
    $r.addField("maximumAge",rtl.longint);
  });
  rtl.recNewT(this,"TJSCoordinates",function () {
    this.latitude = 0.0;
    this.longitude = 0.0;
    this.altitude = 0.0;
    this.accuracy = 0.0;
    this.altitudeAccuracy = 0.0;
    this.heading = 0.0;
    this.speed = 0.0;
    this.$eq = function (b) {
      return (this.latitude === b.latitude) && (this.longitude === b.longitude) && (this.altitude === b.altitude) && (this.accuracy === b.accuracy) && (this.altitudeAccuracy === b.altitudeAccuracy) && (this.heading === b.heading) && (this.speed === b.speed);
    };
    this.$assign = function (s) {
      this.latitude = s.latitude;
      this.longitude = s.longitude;
      this.altitude = s.altitude;
      this.accuracy = s.accuracy;
      this.altitudeAccuracy = s.altitudeAccuracy;
      this.heading = s.heading;
      this.speed = s.speed;
      return this;
    };
    var $r = $mod.$rtti.$Record("TJSCoordinates",{},this);
    $r.addField("latitude",rtl.double);
    $r.addField("longitude",rtl.double);
    $r.addField("altitude",rtl.double);
    $r.addField("accuracy",rtl.double);
    $r.addField("altitudeAccuracy",rtl.double);
    $r.addField("heading",rtl.double);
    $r.addField("speed",rtl.double);
  });
  rtl.recNewT(this,"TJSPosition",function () {
    this.timestamp = "";
    this.$new = function () {
      var r = Object.create(this);
      r.coords = $mod.TJSCoordinates.$new();
      return r;
    };
    this.$eq = function (b) {
      return this.coords.$eq(b.coords) && (this.timestamp === b.timestamp);
    };
    this.$assign = function (s) {
      this.coords.$assign(s.coords);
      this.timestamp = s.timestamp;
      return this;
    };
    var $r = $mod.$rtti.$Record("TJSPosition",{},this);
    $r.addField("coords",$mod.$rtti["TJSCoordinates"]);
    $r.addField("timestamp",rtl.string);
  });
  this.$rtti.$ProcVar("TJSGeoLocationCallback",{procsig: rtl.newTIProcSig([["aPosition",this.$rtti["TJSPosition"]]])});
  this.$rtti.$MethodVar("TJSGeoLocationEvent",{procsig: rtl.newTIProcSig([["aPosition",this.$rtti["TJSPosition"]]]), methodkind: 0});
  this.$rtti.$ProcVar("TJSGeoLocationErrorCallback",{procsig: rtl.newTIProcSig([["aValue",this.$rtti["TJSPositionError"]]])});
  this.$rtti.$MethodVar("TJSGeoLocationErrorEvent",{procsig: rtl.newTIProcSig([["aValue",this.$rtti["TJSPositionError"]]]), methodkind: 0});
  this.$rtti.$ExtClass("TJSGeoLocation",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "GeoLocation"});
  this.$rtti.$ExtClass("TJSMediaStreamTrack",{ancestor: this.$rtti["TJSEventTarget"], jsclass: "MediaStreamTrack"});
  this.$rtti.$ExtClass("TJSMediaDevices",{ancestor: this.$rtti["TJSEventTarget"], jsclass: "MediaDevices"});
  this.$rtti.$ExtClass("TJSWorker",{ancestor: this.$rtti["TJSEventTarget"], jsclass: "Worker"});
  this.$rtti.$ExtClass("TJSMessagePort",{ancestor: this.$rtti["TJSEventTarget"], jsclass: "MessagePort"});
  this.$rtti.$DynArray("TJSMessagePortDynArray",{eltype: this.$rtti["TJSMessagePort"]});
  this.$rtti.$ExtClass("TJSSharedWorker",{ancestor: this.$rtti["TJSEventTarget"], jsclass: "SharedWorker"});
  this.$rtti.$ExtClass("TJSExtendableEvent",{ancestor: this.$rtti["TJSEvent"], jsclass: "ExtendableEvent"});
  this.$rtti.$ExtClass("TJSExtendableMessageEvent",{ancestor: this.$rtti["TJSExtendableEvent"], jsclass: "ExtendableMessageEvent"});
  this.$rtti.$ExtClass("TJSFetchEvent",{ancestor: this.$rtti["TJSExtendableEvent"], jsclass: "FetchEvent"});
  this.$rtti.$ExtClass("TJSClient",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "Client"});
  this.$rtti.$ExtClass("TJSServiceWorker",{ancestor: this.$rtti["TJSWorker"], jsclass: "ServiceWorker"});
  this.$rtti.$ExtClass("TJSNavigationPreloadState",{jsclass: "navigationPreloadState"});
  this.$rtti.$ExtClass("TJSNavigationPreload",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "navigationPreload"});
  this.$rtti.$ExtClass("TJSServiceWorkerRegistration",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "ServiceWorkerRegistration"});
  rtl.recNewT(this,"TJSServiceWorkerContainerOptions",function () {
    this.scope = "";
    this.$eq = function (b) {
      return this.scope === b.scope;
    };
    this.$assign = function (s) {
      this.scope = s.scope;
      return this;
    };
    var $r = $mod.$rtti.$Record("TJSServiceWorkerContainerOptions",{},this);
    $r.addField("scope",rtl.string);
  });
  this.$rtti.$ExtClass("TJSServiceWorkerContainer",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "ServiceWorkerContainer"});
  this.$rtti.$ExtClass("TJSClipboardItemOptions",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "Object"});
  this.$rtti.$ExtClass("TJSClipBoardItem",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "ClipboardItem"});
  this.$rtti.$ExtClass("TJSClipBoard",{ancestor: this.$rtti["TJSEventTarget"], jsclass: "Clipboard"});
  this.$rtti.$ExtClass("TJSNavigator",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "Navigator"});
  this.$rtti.$ExtClass("TJSTouch",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "Touch"});
  this.$rtti.$ExtClass("TJSTouchList",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "TouchList"});
  this.$rtti.$ExtClass("TJSPerformance",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "Performance"});
  this.$rtti.$ExtClass("TJSScreen",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "Screen"});
  this.$rtti.$RefToProcVar("TJSParamEnumCallBack",{procsig: rtl.newTIProcSig([["aKey",rtl.string,2],["aValue",rtl.string,2]])});
  this.$rtti.$ExtClass("TJSURLSearchParams",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "URLSearchParams"});
  this.$rtti.$ExtClass("TJSURL",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "URL"});
  this.$rtti.$DynArray("TJSURLDynArray",{eltype: this.$rtti["TJSURL"]});
  this.$rtti.$RefToProcVar("TJSTimerCallBack",{procsig: rtl.newTIProcSig([],null,8)});
  this.$rtti.$StaticArray("Theader",{dims: [2], eltype: rtl.string});
  this.$rtti.$DynArray("THeaderArray",{eltype: this.$rtti["Theader"]});
  this.$rtti.$ExtClass("TJSHTMLHeaders",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "Headers"});
  this.$rtti.$ExtClass("TJSMediaQueryList",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "MediaQueryList"});
  this.$rtti.$ExtClass("TJSReadableStream",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "ReadableStream"});
  this.$rtti.$ExtClass("TJSWritableStream",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "WritableStream"});
  this.$rtti.$ExtClass("TJSBody",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "Body"});
  this.$rtti.$ExtClass("TJSResponse",{ancestor: this.$rtti["TJSBody"], jsclass: "Response"});
  this.$rtti.$RefToProcVar("TFrameRequestCallback",{procsig: rtl.newTIProcSig([["aTime",rtl.double]])});
  this.$rtti.$ExtClass("TJSPostMessageOptions",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "Object"});
  rtl.createClass(this,"TJSIdleCallbackOptions",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.timeout = 0;
    };
  });
  this.$rtti.$ExtClass("TJSIdleDeadline",{jsclass: "IdleDeadline"});
  this.$rtti.$ExtClass("TJSCacheDeleteOptions",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "Object"});
  this.$rtti.$ExtClass("TJSRequest",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "Request"});
  this.$rtti.$DynArray("TJSRequestDynArray",{eltype: this.$rtti["TJSRequest"]});
  this.$rtti.$ExtClass("TJSCache",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "Cache"});
  this.$rtti.$ExtClass("TJSCacheStorage",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "CacheStorage"});
  this.$rtti.$DynArray("TJSWindowArray",{eltype: this.$rtti["TJSWindow"]});
  this.$rtti.$RefToProcVar("TIdleCallbackProc",{procsig: rtl.newTIProcSig([["idleDeadline",this.$rtti["TJSIdleDeadline"]]])});
  this.$rtti.$ExtClass("TJSWindow",{ancestor: this.$rtti["TJSEventTarget"], jsclass: "Window"});
  this.$rtti.$ExtClass("TJSCSSStyleDeclaration",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "CSSStyleDeclaration"});
  this.$rtti.$ExtClass("TJSScrollIntoViewOptions",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "Object"});
  this.$rtti.$ExtClass("TJSHTMLElement",{ancestor: this.$rtti["TJSElement"], jsclass: "HTMLElement"});
  this.$rtti.$DynArray("TJSHTMLElementArray",{eltype: this.$rtti["TJSHTMLElement"]});
  this.$rtti.$ExtClass("TJSHTMLDivElement",{ancestor: this.$rtti["TJSHTMLElement"], jsclass: "HTMLDivElement"});
  this.$rtti.$ExtClass("TJSHTMLFormControlsCollection",{ancestor: this.$rtti["TJSHTMLCollection"], jsclass: "HTMLFormControlsCollection"});
  this.$rtti.$ExtClass("TJSHTMLFormElement",{ancestor: this.$rtti["TJSHTMLElement"], jsclass: "HTMLFormElement"});
  this.$rtti.$ExtClass("TJSValidityState",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "ValidityState"});
  rtl.createClassExt(this,"TJSBlobPropertyBag",Object,"",function () {
    this.$init = function () {
    };
    this.$final = function () {
    };
    this.Create$2 = function (aType) {
      this.type = aType;
      return this;
    };
    this.Create$3 = function (aType, aEndings) {
      this.type = aType;
      this.endings = aEndings;
      return this;
    };
  });
  this.$rtti.$ExtClass("TJSBlob",{ancestor: this.$rtti["TJSEventTarget"], jsclass: "Blob"});
  this.$rtti.$ExtClass("TJSHTMLFile",{ancestor: this.$rtti["TJSBlob"], jsclass: "File"});
  this.$rtti.$ExtClass("TJSHTMLFileList",{ancestor: this.$rtti["TJSEventTarget"], jsclass: "FileList"});
  this.$rtti.$ExtClass("TJSHTMLInputElement",{ancestor: this.$rtti["TJSHTMLElement"], jsclass: "HTMLInputElement"});
  this.$rtti.$ExtClass("TJSDOMSettableTokenList",{ancestor: this.$rtti["TJSDOMTokenList"], jsclass: "DOMSettableTokenList"});
  this.$rtti.$ExtClass("TJSHTMLOutputElement",{ancestor: this.$rtti["TJSHTMLElement"], jsclass: "HTMLOutputElement"});
  this.$rtti.$ExtClass("TJSHTMLImageElement",{ancestor: this.$rtti["TJSHTMLElement"], jsclass: "Image"});
  this.$rtti.$ExtClass("TJSHTMLLinkElement",{ancestor: this.$rtti["TJSHTMLElement"], jsclass: "HTMLLinkElement"});
  this.$rtti.$ExtClass("TJSHTMLAnchorElement",{ancestor: this.$rtti["TJSHTMLElement"], jsclass: "HTMLAnchorElement"});
  this.$rtti.$ExtClass("TJSHTMLMenuElement",{ancestor: this.$rtti["TJSHTMLElement"], jsclass: "HTMLMenuElement"});
  this.$rtti.$ExtClass("TJSHTMLButtonElement",{ancestor: this.$rtti["TJSHTMLElement"], jsclass: "HTMLButtonElement"});
  this.$rtti.$ExtClass("TJSHTMLLabelElement",{ancestor: this.$rtti["TJSHTMLElement"], jsclass: "HTMLLabelElement"});
  this.$rtti.$ExtClass("TJSHTMLTextAreaElement",{ancestor: this.$rtti["TJSHTMLElement"], jsclass: "HTMLTextAreaElement"});
  this.$rtti.$ExtClass("TJSHTMLEmbedElement",{ancestor: this.$rtti["TJSHTMLElement"], jsclass: "HTMLEmbedElement"});
  this.$rtti.$ExtClass("TJSHTMLOptionElement",{ancestor: this.$rtti["TJSHTMLElement"], jsclass: "Option"});
  this.$rtti.$ExtClass("TJSHTMLOptGroupElement",{ancestor: this.$rtti["TJSHTMLElement"], jsclass: "HTMLOptGroupElement"});
  this.$rtti.$ExtClass("TJSHTMLOptionsCollection",{ancestor: this.$rtti["TJSHTMLCollection"], jsclass: "HTMLOptionsCollection"});
  this.$rtti.$ExtClass("TJSHTMLSelectElement",{ancestor: this.$rtti["TJSHTMLElement"], jsclass: "HTMLSelectElement"});
  this.$rtti.$ExtClass("TJSHTMLTableSectionElement");
  this.$rtti.$ExtClass("TJSHTMLTableRowElement");
  this.$rtti.$ExtClass("TJSHTMLTableElement",{ancestor: this.$rtti["TJSHTMLElement"], jsclass: "HTMLTableElement"});
  this.$rtti.$ExtClass("TJSHTMLTableSectionElement",{ancestor: this.$rtti["TJSHTMLElement"], jsclass: "HTMLTableSectionElement"});
  this.$rtti.$ExtClass("TJSHTMLTableCellElement",{ancestor: this.$rtti["TJSHTMLElement"], jsclass: "HTMLTableCellElement"});
  this.$rtti.$ExtClass("TJSHTMLTableRowElement",{ancestor: this.$rtti["TJSHTMLElement"], jsclass: "HTMLTableRowElement"});
  this.$rtti.$ExtClass("TJSHTMLTableDataCellElement",{ancestor: this.$rtti["TJSHTMLElement"], jsclass: "HTMLTableDataCellElement"});
  this.$rtti.$ExtClass("TJSCanvasRenderingContext2D");
  this.$rtti.$RefToProcVar("THTMLCanvasToBlobCallback",{procsig: rtl.newTIProcSig([["aBlob",this.$rtti["TJSBlob"]]],rtl.boolean,8)});
  this.$rtti.$ExtClass("TJSHTMLCanvasElement",{ancestor: this.$rtti["TJSHTMLElement"], jsclass: "HTMLCanvasElement"});
  this.$rtti.$ExtClass("TJSHTMLProgressElement",{ancestor: this.$rtti["TJSHTMLElement"], jsclass: "HTMLProgressElement"});
  this.$rtti.$ExtClass("TJSDOMException",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "DOMException"});
  this.$rtti.$ExtClass("TJSFileReader",{ancestor: this.$rtti["TJSEventTarget"], jsclass: "FileReader"});
  this.$rtti.$ExtClass("TJSCanvasGradient",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "CanvasGradient"});
  this.$rtti.$ExtClass("TJSCanvasPattern",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "CanvasPattern"});
  this.$rtti.$ExtClass("TJSPath2D",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "Path2D"});
  this.$rtti.$ExtClass("TJSImageData",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "ImageData"});
  this.$rtti.$ExtClass("TJSTextMetrics",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "TextMetrics"});
  this.$rtti.$ExtClass("TJSCanvasRenderingContext2D",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "CanvasRenderingContext2D"});
  this.$rtti.$ExtClass("TJSHTMLIFrameElement",{ancestor: this.$rtti["TJSHTMLElement"], jsclass: "HTMLIFrameElement"});
  this.$rtti.$ExtClass("TJSHTMLScriptElement",{ancestor: this.$rtti["TJSHTMLElement"], jsclass: "HTMLScriptElement"});
  this.$rtti.$ExtClass("TJSXMLHttpRequestEventTarget",{ancestor: this.$rtti["TJSEventTarget"], jsclass: "XMLHttpRequestEventTarget"});
  this.$rtti.$ExtClass("TJSXMLHttpRequestUpload",{ancestor: this.$rtti["TJSXMLHttpRequestEventTarget"], jsclass: "XMLHttpRequestUpload"});
  this.$rtti.$RefToProcVar("TJSOnReadyStateChangeHandler",{procsig: rtl.newTIProcSig([],null,8)});
  this.$rtti.$ExtClass("TJSXMLHttpRequest",{ancestor: this.$rtti["TJSXMLHttpRequestEventTarget"], jsclass: "XMLHttpRequest"});
  this.$rtti.$ExtClass("TJSUIEvent",{ancestor: this.$rtti["TJSEvent"], jsclass: "UIEvent"});
  this.$rtti.$ExtClass("TJSMouseEvent",{ancestor: this.$rtti["TJSUIEvent"], jsclass: "MouseEvent"});
  rtl.recNewT(this,"TJSWheelEventInit",function () {
    this.deltaX = 0.0;
    this.deltaY = 0.0;
    this.deltaZ = 0.0;
    this.deltaMode = 0;
    this.$eq = function (b) {
      return (this.deltaX === b.deltaX) && (this.deltaY === b.deltaY) && (this.deltaZ === b.deltaZ) && (this.deltaMode === b.deltaMode);
    };
    this.$assign = function (s) {
      this.deltaX = s.deltaX;
      this.deltaY = s.deltaY;
      this.deltaZ = s.deltaZ;
      this.deltaMode = s.deltaMode;
      return this;
    };
    var $r = $mod.$rtti.$Record("TJSWheelEventInit",{},this);
    $r.addField("deltaX",rtl.double);
    $r.addField("deltaY",rtl.double);
    $r.addField("deltaZ",rtl.double);
    $r.addField("deltaMode",rtl.nativeint);
  });
  this.$rtti.$ExtClass("TJSWheelEvent",{ancestor: this.$rtti["TJSMouseEvent"], jsclass: "WheelEvent"});
  this.$rtti.$ExtClass("TJSPointerEvent",{ancestor: this.$rtti["TJSMouseEvent"], jsclass: "PointerEvent"});
  this.$rtti.$ExtClass("TJSTouchEvent",{ancestor: this.$rtti["TJSUIEvent"], jsclass: "TouchEvent"});
  rtl.createClass(this,"TJSKeyNames",pas.System.TObject,function () {
    this.Alt = "Alt";
    this.AltGraph = "AltGraph";
    this.CapsLock = "CapsLock";
    this.Control = "Control";
    this.Fn = "Fn";
    this.FnLock = "FnLock";
    this.Hyper = "Hyper";
    this.Meta = "Meta";
    this.NumLock = "NumLock";
    this.ScrollLock = "ScrollLock";
    this.Shift = "Shift";
    this.Super = "Super";
    this.Symbol = "Symbol";
    this.SymbolLock = "SymbolLock";
    this.Enter = "Enter";
    this.Tab = "Tab";
    this.Space = "Space";
    this.ArrowDown = "ArrowDown";
    this.ArrowLeft = "ArrowLeft";
    this.ArrowRight = "ArrowRight";
    this.ArrowUp = "ArrowUp";
    this._End = "End";
    this.Home = "Home";
    this.PageDown = "PageDown";
    this.PageUp = "PageUp";
    this.BackSpace = "Backspace";
    this.Clear = "Clear";
    this.Copy = "Copy";
    this.CrSel = "CrSel";
    this.Cut = "Cut";
    this.Delete = "Delete";
    this.EraseEof = "EraseEof";
    this.ExSel = "ExSel";
    this.Insert = "Insert";
    this.Paste = "Paste";
    this.Redo = "Redo";
    this.Undo = "Undo";
    this.Accept = "Accept";
    this.Again = "Again";
    this.Attn = "Attn";
    this.Cancel = "Cancel";
    this.ContextMenu = "Contextmenu";
    this.Escape = "Escape";
    this.Execute = "Execute";
    this.Find = "Find";
    this.Finish = "Finish";
    this.Help = "Help";
    this.Pause = "Pause";
    this.Play = "Play";
    this.Props = "Props";
    this.Select = "Select";
    this.ZoomIn = "ZoomIn";
    this.ZoomOut = "ZoomOut";
    this.BrightnessDown = "BrightnessDown";
    this.BrightnessUp = "BrightnessUp";
    this.Eject = "Eject";
    this.LogOff = "LogOff";
    this.Power = "Power";
    this.PowerOff = "PowerOff";
    this.PrintScreen = "PrintScreen";
    this.Hibernate = "Hibernate";
    this.Standby = "Standby";
    this.WakeUp = "WakeUp";
    this.AllCandidates = "AllCandidates";
    this.Alphanumeric = "Alphanumeric";
    this.CodeInput = "CodeInput";
    this.Compose = "Compose";
    this.Convert = "Convert";
    this.Dead = "Dead";
    this.FinalMode = "FinalMode";
    this.GroupFirst = "GroupFirst";
    this.GroupLast = "GroupLast";
    this.GroupNext = "GroupNext";
    this.GroupPrevious = "GroupPrevious";
    this.ModelChange = "ModelChange";
    this.NextCandidate = "NextCandidate";
    this.NonConvert = "NonConvert";
    this.PreviousCandidate = "PreviousCandidate";
    this.Process = "Process";
    this.SingleCandidate = "SingleCandidate";
    this.HangulMode = "HangulMode";
    this.HanjaMode = "HanjaMode";
    this.JunjaMode = "JunjaMode";
    this.Eisu = "Eisu";
    this.Hankaku = "Hankaku";
    this.Hiranga = "Hiranga";
    this.HirangaKatakana = "HirangaKatakana";
    this.KanaMode = "KanaMode";
    this.Katakana = "Katakana";
    this.Romaji = "Romaji";
    this.Zenkaku = "Zenkaku";
    this.ZenkakuHanaku = "ZenkakuHanaku";
    this.F1 = "F1";
    this.F2 = "F2";
    this.F3 = "F3";
    this.F4 = "F4";
    this.F5 = "F5";
    this.F6 = "F6";
    this.F7 = "F7";
    this.F8 = "F8";
    this.F9 = "F9";
    this.F10 = "F10";
    this.F11 = "F11";
    this.F12 = "F12";
    this.F13 = "F13";
    this.F14 = "F14";
    this.F15 = "F15";
    this.F16 = "F16";
    this.F17 = "F17";
    this.F18 = "F18";
    this.F19 = "F19";
    this.F20 = "F20";
    this.Soft1 = "Soft1";
    this.Soft2 = "Soft2";
    this.Soft3 = "Soft3";
    this.Soft4 = "Soft4";
    this.Decimal = "Decimal";
    this.Key11 = "Key11";
    this.Key12 = "Key12";
    this.Multiply = "Multiply";
    this.Add = "Add";
    this.NumClear = "Clear";
    this.Divide = "Divide";
    this.Subtract = "Subtract";
    this.Separator = "Separator";
    this.AppSwitch = "AppSwitch";
    this.Call = "Call";
    this.Camera = "Camera";
    this.CameraFocus = "CameraFocus";
    this.EndCall = "EndCall";
    this.GoBack = "GoBack";
    this.GoHome = "GoHome";
    this.HeadsetHook = "HeadsetHook";
    this.LastNumberRedial = "LastNumberRedial";
    this.Notification = "Notification";
    this.MannerMode = "MannerMode";
    this.VoiceDial = "VoiceDial";
  });
  this.$rtti.$ExtClass("TJSKeyboardEvent",{ancestor: this.$rtti["TJSUIEvent"], jsclass: "KeyboardEvent"});
  this.$rtti.$ExtClass("TJSMutationObserver");
  rtl.recNewT(this,"TJSMutationRecord",function () {
    this.type_ = "";
    this.target = null;
    this.addedNodes = null;
    this.removedNodes = null;
    this.previousSibling = null;
    this.nextSibling = null;
    this.attributeName = "";
    this.attributeNamespace = "";
    this.oldValue = "";
    this.$eq = function (b) {
      return (this.type_ === b.type_) && (this.target === b.target) && (this.addedNodes === b.addedNodes) && (this.removedNodes === b.removedNodes) && (this.previousSibling === b.previousSibling) && (this.nextSibling === b.nextSibling) && (this.attributeName === b.attributeName) && (this.attributeNamespace === b.attributeNamespace) && (this.oldValue === b.oldValue);
    };
    this.$assign = function (s) {
      this.type_ = s.type_;
      this.target = s.target;
      this.addedNodes = s.addedNodes;
      this.removedNodes = s.removedNodes;
      this.previousSibling = s.previousSibling;
      this.nextSibling = s.nextSibling;
      this.attributeName = s.attributeName;
      this.attributeNamespace = s.attributeNamespace;
      this.oldValue = s.oldValue;
      return this;
    };
    var $r = $mod.$rtti.$Record("TJSMutationRecord",{},this);
    $r.addField("type_",rtl.string);
    $r.addField("target",$mod.$rtti["TJSNode"]);
    $r.addField("addedNodes",$mod.$rtti["TJSNodeList"]);
    $r.addField("removedNodes",$mod.$rtti["TJSNodeList"]);
    $r.addField("previousSibling",$mod.$rtti["TJSNode"]);
    $r.addField("nextSibling",$mod.$rtti["TJSNode"]);
    $r.addField("attributeName",rtl.string);
    $r.addField("attributeNamespace",rtl.string);
    $r.addField("oldValue",rtl.string);
  });
  this.$rtti.$DynArray("TJSMutationRecordArray",{eltype: this.$rtti["TJSMutationRecord"]});
  this.$rtti.$RefToProcVar("TJSMutationCallback",{procsig: rtl.newTIProcSig([["mutations",this.$rtti["TJSMutationRecordArray"]],["observer",this.$rtti["TJSMutationObserver"]]],null,8)});
  rtl.recNewT(this,"TJSMutationObserverInit",function () {
    this.attributes = false;
    this.attributeOldValue = false;
    this.characterData = false;
    this.characterDataOldValue = false;
    this.childList = false;
    this.subTree = false;
    this.attributeFilter = null;
    this.$eq = function (b) {
      return (this.attributes === b.attributes) && (this.attributeOldValue === b.attributeOldValue) && (this.characterData === b.characterData) && (this.characterDataOldValue === b.characterDataOldValue) && (this.childList === b.childList) && (this.subTree === b.subTree) && (this.attributeFilter === b.attributeFilter);
    };
    this.$assign = function (s) {
      this.attributes = s.attributes;
      this.attributeOldValue = s.attributeOldValue;
      this.characterData = s.characterData;
      this.characterDataOldValue = s.characterDataOldValue;
      this.childList = s.childList;
      this.subTree = s.subTree;
      this.attributeFilter = s.attributeFilter;
      return this;
    };
    var $r = $mod.$rtti.$Record("TJSMutationObserverInit",{},this);
    $r.addField("attributes",rtl.boolean);
    $r.addField("attributeOldValue",rtl.boolean);
    $r.addField("characterData",rtl.boolean);
    $r.addField("characterDataOldValue",rtl.boolean);
    $r.addField("childList",rtl.boolean);
    $r.addField("subTree",rtl.boolean);
    $r.addField("attributeFilter",pas.JS.$rtti["TJSArray"]);
  });
  this.$rtti.$ExtClass("TJSMutationObserver",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "MutationObserver"});
  this.$rtti.$DynArray("TJSMessagePortArray",{eltype: this.$rtti["TJSMessagePort"]});
  this.$rtti.$ExtClass("TJSInputEvent",{ancestor: this.$rtti["TJSUIEvent"], jsclass: "InputEvent"});
  this.$rtti.$ExtClass("TJSMessageEvent",{ancestor: this.$rtti["TJSEvent"], jsclass: "MessageEvent"});
  this.$rtti.$ExtClass("TJSWebSocket",{ancestor: this.$rtti["TJSEventTarget"], jsclass: "WebSocket"});
  this.$rtti.$ExtClass("TJSHTMLAudioTrack",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "AudioTrack"});
  this.$rtti.$ExtClass("TJSHTMLAudioTrackList",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "AudioTrackList"});
  this.$rtti.$ExtClass("TJSHTMLVideoTrack",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "VideoTrack"});
  this.$rtti.$ExtClass("TJSHTMLVideoTrackList",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "VideoTrackList"});
  this.$rtti.$ExtClass("TJSHTMLTextTrack",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "TextTrack"});
  this.$rtti.$ExtClass("TJSHTMLTextTrackList",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "TextTrackList"});
  this.$rtti.$ExtClass("TJSMEdiaError",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "MediaError"});
  this.$rtti.$ExtClass("TJSHTMLMediaStream",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "MediaStream"});
  this.$rtti.$ExtClass("TJSHTMLMediaController",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "MediaController"});
  this.$rtti.$ExtClass("TJSHTMLMediaElement",{ancestor: this.$rtti["TJSHTMLElement"], jsclass: "HTMLMediaElement"});
  this.$rtti.$ExtClass("TJSHTMLAudioElement",{ancestor: this.$rtti["TJSHTMLMediaElement"], jsclass: "HTMLAudioElement"});
  this.$rtti.$ExtClass("TJSHTMLVideoElement",{ancestor: this.$rtti["TJSHTMLMediaElement"], jsclass: "HTMLVideoElement"});
  this.$rtti.$ExtClass("TJSHTMLStyleElement",{ancestor: this.$rtti["TJSHTMLElement"], jsclass: "HTMLStyleElement"});
  this.$rtti.$ExtClass("TJSHTMLDetailsElement",{ancestor: this.$rtti["TJSHTMLElement"], jsclass: "HTMLDetailsElement"});
  this.$rtti.$ExtClass("TJSResizeObserverEntry",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "ResizeObserverEntry"});
  this.$rtti.$DynArray("TJSResizeObserverEntries",{eltype: this.$rtti["TJSResizeObserverEntry"]});
  this.$rtti.$ProcVar("TJSResizeObserverCallback",{procsig: rtl.newTIProcSig([["AEntries",this.$rtti["TJSResizeObserverEntries"]],["AObserver",this.$rtti["TJSResizeObserver"]]])});
  this.$rtti.$MethodVar("TJSResizeObserverCallbackObj",{procsig: rtl.newTIProcSig([["AEntries",this.$rtti["TJSResizeObserverEntries"]],["AObserver",this.$rtti["TJSResizeObserver"]]]), methodkind: 0});
  this.$rtti.$ExtClass("TJSResizeObserver",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "ResizeObserver"});
  this.$rtti.$DynArray("TJSFormDataEntryValueArray",{eltype: rtl.string});
  this.$rtti.$ExtClass("TJSFormData",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "FormData"});
  this.$rtti.$ExtClass("TJSHTMLTemplateElement",{ancestor: this.$rtti["TJSHTMLElement"], jsclass: "HTMLTemplateElement"});
  this.$rtti.$ExtClass("TJSHTMLOrXMLDocument",{ancestor: this.$rtti["TJSDocument"], jsclass: "Document"});
  this.$rtti.$ExtClass("TJSHTMLDocument",{ancestor: this.$rtti["TJSHTMLOrXMLDocument"], jsclass: "HTMLDocument"});
  this.$rtti.$ExtClass("TJSXMLDocument",{ancestor: this.$rtti["TJSHTMLOrXMLDocument"], jsclass: "HTMLDocument"});
  this.$rtti.$ExtClass("TDOMParser",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "DOMParser"});
  this.$rtti.$RefToProcVar("TOnChangeProcedure",{procsig: rtl.newTIProcSig([])});
  this.$rtti.$ExtClass("TJSPermissionDescriptor",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "Object"});
  this.$rtti.$ExtClass("TJSPermissionStatus",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "PermissionStatus"});
  this.$rtti.$ExtClass("TJSPermissions",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "Permissions"});
  this.$rtti.$ExtClass("TJSFileSystemHandlePermissionDescriptor",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "Object"});
  this.$rtti.$ExtClass("TJSFileSystemCreateWritableOptions",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "Object"});
  this.$rtti.$ExtClass("TJSFileSystemWritableFileStream");
  this.$rtti.$ExtClass("TJSFileSystemHandle",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "FileSystemHandle"});
  this.$rtti.$ExtClass("TJSFileSystemFileHandle",{ancestor: this.$rtti["TJSFileSystemHandle"], jsclass: "FileSystemFileHandle"});
  this.$rtti.$ExtClass("TJSGetFileHandleOptions",{jsclass: "Object"});
  this.$rtti.$ExtClass("TJSRemoveEntryOptions",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "Object"});
  this.$rtti.$ExtClass("TJSFileSystemDirectoryHandle",{ancestor: this.$rtti["TJSFileSystemHandle"], jsclass: "FileSystemDirectoryHandle"});
  this.$rtti.$ExtClass("TJSFileSystemWritableFileStream",{ancestor: this.$rtti["TJSWritableStream"], jsclass: "FileSystemWritableFileStream"});
  this.$rtti.$ExtClass("TJSShowOpenFilePickerTypeOptions",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "Object"});
  this.$rtti.$ExtClass("TJSShowOpenFilePickerOptions",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "Object"});
  this.$rtti.$ExtClass("TJSShowSaveFilePickerOptionsAccept",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "Object"});
  this.$rtti.$ExtClass("TJSShowSaveFilePickerOptions",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "Object"});
  this.HasServiceWorker = function () {
    var Result = false;
    if (window.navigator.serviceWorker) {
      return true}
     else return false;
    return Result;
  };
});
rtl.module("p2jsres",["System","Types"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.TResourceSource = {"0": "rsJS", rsJS: 0, "1": "rsHTML", rsHTML: 1};
  this.$rtti.$Enum("TResourceSource",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TResourceSource});
  rtl.recNewT(this,"TResourceInfo",function () {
    this.name = "";
    this.encoding = "";
    this.resourceunit = "";
    this.format = "";
    this.data = "";
    this.$eq = function (b) {
      return (this.name === b.name) && (this.encoding === b.encoding) && (this.resourceunit === b.resourceunit) && (this.format === b.format) && (this.data === b.data);
    };
    this.$assign = function (s) {
      this.name = s.name;
      this.encoding = s.encoding;
      this.resourceunit = s.resourceunit;
      this.format = s.format;
      this.data = s.data;
      return this;
    };
    var $r = $mod.$rtti.$Record("TResourceInfo",{},this);
    $r.addField("name",rtl.string);
    $r.addField("encoding",rtl.string);
    $r.addField("resourceunit",rtl.string);
    $r.addField("format",rtl.string);
    $r.addField("data",rtl.string);
  });
  this.$rtti.$RefToProcVar("TResourceEnumCallBack",{procsig: rtl.newTIProcSig([["resName",rtl.string,2]],rtl.boolean)});
  this.$rtti.$RefToProcVar("TResourcesLoadedEnumCallBack",{procsig: rtl.newTIProcSig([["LoadedResources",rtl.string,10]])});
  this.$rtti.$RefToProcVar("TResourcesLoadErrorCallBack",{procsig: rtl.newTIProcSig([["aError",rtl.string,2]])});
  this.SetResourceSource = function (aSource) {
    var Result = 0;
    Result = $impl.gMode;
    $impl.gMode = aSource;
    return Result;
  };
  this.GetResourceNames = function () {
    var Result = [];
    Result = $mod.GetResourceNames$1($impl.gMode);
    return Result;
  };
  this.GetResourceNames$1 = function (aSource) {
    var Result = [];
    var $tmp = aSource;
    if ($tmp === $mod.TResourceSource.rsJS) {
      Result = rtl.getResourceList()}
     else if ($tmp === $mod.TResourceSource.rsHTML) Result = $impl.GetHTMLResources();
    return Result;
  };
  this.EnumResources = function (aCallback) {
    var Result = 0;
    Result = $mod.EnumResources$1($impl.gMode,aCallback);
    return Result;
  };
  this.EnumResources$1 = function (aSource, aCallback) {
    var Result = 0;
    var RL = [];
    var I = 0;
    var ContinueEnum = false;
    Result = 0;
    RL = $mod.GetResourceNames$1(aSource);
    I = 0;
    Result = rtl.length(RL);
    ContinueEnum = true;
    while ((I < Result) && ContinueEnum) {
      ContinueEnum = aCallback(RL[I]);
      I += 1;
    };
    return Result;
  };
  this.GetResourceInfo = function (aName, aInfo) {
    var Result = false;
    Result = $mod.GetResourceInfo$1($impl.gMode,aName,aInfo);
    return Result;
  };
  this.GetResourceInfo$1 = function (aSource, aName, aInfo) {
    var Result = false;
    var $tmp = aSource;
    if ($tmp === $mod.TResourceSource.rsJS) {
      Result = $impl.GetRTLResourceInfo(aName,aInfo)}
     else if ($tmp === $mod.TResourceSource.rsHTML) Result = $impl.GetHTMLResourceInfo(aName,aInfo);
    return Result;
  };
  this.LoadHTMLLinkResources = function (aURL, OnLoad, OnError) {
    function FetchOK(Res) {
      var Result = undefined;
      Result = null;
      if (!Res.ok) {
        if (OnError != null) throw new Error("HTTP Error for URL aURL, status = " + pas.SysUtils.IntToStr(Res.status) + " : " + Res.statusText);
      } else Result = Res.text();
      return Result;
    };
    function BlobOK(Res) {
      var Result = undefined;
      var ID = "";
      var Tmpl = null;
      var El = null;
      var Arr = [];
      var aParent = null;
      Result = null;
      aParent = document.head;
      if (aParent === null) aParent = document.body;
      Arr = rtl.arraySetLength(Arr,"",0);
      Tmpl = document.createElement("template");
      Tmpl.innerHTML = Res.trim();
      El = Tmpl.content.firstElementChild;
      while (El !== null) {
        if (pas.SysUtils.SameText(El.tagName,"link") && $impl.IsResourceLink(El)) {
          aParent.append(document.importNode(El,true));
          ID = El.id;
          pas.System.Delete({get: function () {
              return ID;
            }, set: function (v) {
              ID = v;
            }},1,$impl.IDPrefix.length);
          if (ID !== "") Arr.push(ID);
        };
        El = El.nextElementSibling;
      };
      if (OnLoad != null) OnLoad(Arr);
      return Result;
    };
    function DoError(aValue) {
      var Result = undefined;
      Result = null;
      if (OnError != null) if (aValue === null) OnError("Error: " + aValue.message);
      return Result;
    };
    if (!$impl.HasTemplate()) {
      if (OnError != null) OnError("No template support in this browser");
    } else window.fetch(aURL).then(FetchOK).then(BlobOK).catch(DoError);
  };
  $mod.$implcode = function () {
    $impl.gMode = 0;
    $mod.$rtti.$ExtClass("TRTLResourceInfo",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "Object"});
    $impl.GetRTLResourceInfo = function (aName, aInfo) {
      var Result = false;
      var RTLInfo = null;
      RTLInfo = rtl.getResource(pas.SysUtils.LowerCase(aName));
      Result = RTLInfo != null;
      if (Result) {
        aInfo.name = RTLInfo.name;
        aInfo.encoding = RTLInfo.encoding;
        aInfo.format = RTLInfo.format;
        aInfo.resourceunit = RTLInfo.unit;
        aInfo.data = RTLInfo.data;
      };
      return Result;
    };
    $impl.IDPrefix = "resource-";
    $impl.IsResourceLink = function (L) {
      var Result = false;
      Result = (pas.System.Copy(L.id,1,$impl.IDPrefix.length) === $impl.IDPrefix) && pas.JS.isDefined(L.dataset["unit"]) && (pas.System.Copy(L.href,1,4) === "data");
      return Result;
    };
    $impl.GetHTMLResources = function () {
      var Result = [];
      var LC = null;
      var L = null;
      var I = 0;
      var ID = "";
      Result = rtl.arraySetLength(Result,"",0);
      if (!pas.JS.isDefined(document)) return Result;
      LC = document.getElementsByTagName("link");
      for (var $l = 0, $end = LC.length - 1; $l <= $end; $l++) {
        I = $l;
        L = LC.item(I);
        ID = L.id;
        if ($impl.IsResourceLink(L)) {
          pas.System.Delete({get: function () {
              return ID;
            }, set: function (v) {
              ID = v;
            }},1,$impl.IDPrefix.length);
          if (ID !== "") Result.push(ID);
        };
      };
      return Result;
    };
    $impl.GetHTMLResourceInfo = function (aName, aInfo) {
      var Result = false;
      var el = null;
      var S = "";
      var I = 0;
      Result = false;
      if (!pas.JS.isDefined(document)) return Result;
      el = document.getElementById($impl.IDPrefix + pas.SysUtils.LowerCase(aName));
      Result = (el != null) && pas.SysUtils.SameText(el.tagName,"link");
      if (!Result) return Result;
      aInfo.name = pas.SysUtils.LowerCase(aName);
      aInfo.resourceunit = "" + el.dataset["unit"];
      S = el.href;
      S = pas.System.Copy(S,6,S.length - 5);
      I = pas.System.Pos(",",S);
      aInfo.data = pas.System.Copy(S,I + 1,S.length - 1);
      S = pas.System.Copy(S,1,I - 1);
      I = pas.System.Pos(";",S);
      if (I === 0) {
        aInfo.encoding = ""}
       else {
        aInfo.encoding = pas.System.Copy(S,I + 1,S.length - 1);
        S = pas.System.Copy(S,1,I - 1);
      };
      aInfo.format = S;
      return Result;
    };
    $impl.HasTemplate = function () {
      var Result = false;
      return ('content' in document.createElement('template'));
      Result = false;
      return Result;
    };
  };
},["SysUtils","JS","Web"]);
rtl.module("simplelinkedlist",["System"],function () {
  "use strict";
  var $mod = this;
  rtl.createClass(this,"TLinkedListItem",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.Next = null;
    };
    this.$final = function () {
      this.Next = undefined;
      pas.System.TObject.$final.call(this);
    };
  });
  this.$rtti.$ClassRef("TLinkedListItemClass",{instancetype: this.$rtti["TLinkedListItem"]});
  rtl.createClass(this,"TLinkedListVisitor",pas.System.TObject,function () {
  });
  rtl.createClass(this,"TLinkedList",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FItemClass = null;
      this.FRoot = null;
    };
    this.$final = function () {
      this.FItemClass = undefined;
      this.FRoot = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.GetCount = function () {
      var Result = 0;
      var I = null;
      I = this.FRoot;
      Result = 0;
      while (I !== null) {
        I = I.Next;
        Result += 1;
      };
      return Result;
    };
    this.Create$1 = function (AnItemClass) {
      this.FItemClass = AnItemClass;
      return this;
    };
    this.Destroy = function () {
      this.Clear();
      pas.System.TObject.Destroy.call(this);
    };
    this.Clear = function () {
      var I = null;
      I = this.FRoot;
      while (I !== null) {
        this.FRoot = I;
        I = I.Next;
        this.FRoot.Next = null;
        pas.SysUtils.FreeAndNil({p: this, get: function () {
            return this.p.FRoot;
          }, set: function (v) {
            this.p.FRoot = v;
          }});
      };
    };
    this.Add = function () {
      var Result = null;
      Result = this.FItemClass.$create("Create");
      Result.Next = this.FRoot;
      this.FRoot = Result;
      return Result;
    };
    this.ForEach = function (Visitor) {
      var I = null;
      I = this.FRoot;
      while ((I !== null) && Visitor.Visit(I)) I = I.Next;
    };
    this.RemoveItem = function (Item, FreeItem) {
      var I = null;
      if ((Item !== null) && (this.FRoot !== null)) {
        if (Item === this.FRoot) {
          this.FRoot = Item.Next}
         else {
          I = this.FRoot;
          while ((I.Next !== null) && (I.Next !== Item)) I = I.Next;
          if (I.Next === Item) I.Next = Item.Next;
        };
        if (FreeItem) Item = rtl.freeLoc(Item);
      };
    };
  });
},["SysUtils"]);
rtl.module("Classes",["System","RTLConsts","Types","SysUtils","JS","TypInfo","p2jsres"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.$rtti.$MethodVar("TNotifyEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]]]), methodkind: 0});
  this.$rtti.$RefToProcVar("TNotifyEventRef",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]]])});
  this.$rtti.$RefToProcVar("TStringNotifyEventRef",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["aString",rtl.string,2]])});
  this.TFPObservedOperation = {"0": "ooChange", ooChange: 0, "1": "ooFree", ooFree: 1, "2": "ooAddItem", ooAddItem: 2, "3": "ooDeleteItem", ooDeleteItem: 3, "4": "ooCustom", ooCustom: 4};
  this.$rtti.$Enum("TFPObservedOperation",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TFPObservedOperation});
  rtl.createClass(this,"EStreamError",pas.SysUtils.Exception,function () {
  });
  rtl.createClass(this,"EFCreateError",this.EStreamError,function () {
  });
  rtl.createClass(this,"EFOpenError",this.EStreamError,function () {
  });
  rtl.createClass(this,"EFilerError",this.EStreamError,function () {
  });
  rtl.createClass(this,"EReadError",this.EFilerError,function () {
  });
  rtl.createClass(this,"EWriteError",this.EFilerError,function () {
  });
  rtl.createClass(this,"EClassNotFound",this.EFilerError,function () {
  });
  rtl.createClass(this,"EMethodNotFound",this.EFilerError,function () {
  });
  rtl.createClass(this,"EInvalidImage",this.EFilerError,function () {
  });
  rtl.createClass(this,"EResNotFound",pas.SysUtils.Exception,function () {
  });
  rtl.createClass(this,"EListError",pas.SysUtils.Exception,function () {
  });
  rtl.createClass(this,"EBitsError",pas.SysUtils.Exception,function () {
  });
  rtl.createClass(this,"EStringListError",this.EListError,function () {
  });
  rtl.createClass(this,"EComponentError",pas.SysUtils.Exception,function () {
  });
  rtl.createClass(this,"EParserError",pas.SysUtils.Exception,function () {
  });
  rtl.createClass(this,"EOutOfResources",pas.SysUtils.EOutOfMemory,function () {
  });
  rtl.createClass(this,"EInvalidOperation",pas.SysUtils.Exception,function () {
  });
  this.TListAssignOp = {"0": "laCopy", laCopy: 0, "1": "laAnd", laAnd: 1, "2": "laOr", laOr: 2, "3": "laXor", laXor: 3, "4": "laSrcUnique", laSrcUnique: 4, "5": "laDestUnique", laDestUnique: 5};
  this.$rtti.$Enum("TListAssignOp",{minvalue: 0, maxvalue: 5, ordtype: 1, enumtype: this.TListAssignOp});
  this.$rtti.$ProcVar("TListSortCompare",{procsig: rtl.newTIProcSig([["Item1",rtl.jsvalue],["Item2",rtl.jsvalue]],rtl.longint)});
  this.$rtti.$RefToProcVar("TListSortCompareFunc",{procsig: rtl.newTIProcSig([["Item1",rtl.jsvalue],["Item2",rtl.jsvalue]],rtl.longint)});
  this.TAlignment = {"0": "taLeftJustify", taLeftJustify: 0, "1": "taRightJustify", taRightJustify: 1, "2": "taCenter", taCenter: 2};
  this.$rtti.$Enum("TAlignment",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TAlignment});
  this.$rtti.$Class("TFPList");
  this.$rtti.$Class("TReader");
  this.$rtti.$Class("TWriter");
  this.$rtti.$Class("TFiler");
  rtl.createClass(this,"TFPListEnumerator",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FList = null;
      this.FPosition = 0;
    };
    this.$final = function () {
      this.FList = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function (AList) {
      pas.System.TObject.Create.call(this);
      this.FList = AList;
      this.FPosition = -1;
      return this;
    };
    this.GetCurrent = function () {
      var Result = undefined;
      Result = this.FList.Get(this.FPosition);
      return Result;
    };
    this.MoveNext = function () {
      var Result = false;
      this.FPosition += 1;
      Result = this.FPosition < this.FList.FCount;
      return Result;
    };
  });
  rtl.createClass(this,"TFPList",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FList = [];
      this.FCount = 0;
      this.FCapacity = 0;
    };
    this.$final = function () {
      this.FList = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.CopyMove = function (aList) {
      var r = 0;
      this.Clear();
      for (var $l = 0, $end = aList.FCount - 1; $l <= $end; $l++) {
        r = $l;
        this.Add(aList.Get(r));
      };
    };
    this.MergeMove = function (aList) {
      var r = 0;
      for (var $l = 0, $end = aList.FCount - 1; $l <= $end; $l++) {
        r = $l;
        if (this.IndexOf(aList.Get(r)) < 0) this.Add(aList.Get(r));
      };
    };
    this.DoCopy = function (ListA, ListB) {
      if (ListB != null) {
        this.CopyMove(ListB)}
       else this.CopyMove(ListA);
    };
    this.DoSrcUnique = function (ListA, ListB) {
      var r = 0;
      if (ListB != null) {
        this.Clear();
        for (var $l = 0, $end = ListA.FCount - 1; $l <= $end; $l++) {
          r = $l;
          if (ListB.IndexOf(ListA.Get(r)) < 0) this.Add(ListA.Get(r));
        };
      } else {
        for (var $l1 = this.FCount - 1; $l1 >= 0; $l1--) {
          r = $l1;
          if (ListA.IndexOf(this.Get(r)) >= 0) this.Delete(r);
        };
      };
    };
    this.DoAnd = function (ListA, ListB) {
      var r = 0;
      if (ListB != null) {
        this.Clear();
        for (var $l = 0, $end = ListA.FCount - 1; $l <= $end; $l++) {
          r = $l;
          if (ListB.IndexOf(ListA.Get(r)) >= 0) this.Add(ListA.Get(r));
        };
      } else {
        for (var $l1 = this.FCount - 1; $l1 >= 0; $l1--) {
          r = $l1;
          if (ListA.IndexOf(this.Get(r)) < 0) this.Delete(r);
        };
      };
    };
    this.DoDestUnique = function (ListA, ListB) {
      var $Self = this;
      function MoveElements(Src, Dest) {
        var r = 0;
        $Self.Clear();
        for (var $l = 0, $end = Src.FCount - 1; $l <= $end; $l++) {
          r = $l;
          if (Dest.IndexOf(Src.Get(r)) < 0) $Self.Add(Src.Get(r));
        };
      };
      var Dest = null;
      if (ListB != null) {
        MoveElements(ListB,ListA)}
       else Dest = $mod.TFPList.$create("Create");
      try {
        Dest.CopyMove($Self);
        MoveElements(ListA,Dest);
      } finally {
        Dest.$destroy("Destroy");
      };
    };
    this.DoOr = function (ListA, ListB) {
      if (ListB != null) {
        this.CopyMove(ListA);
        this.MergeMove(ListB);
      } else this.MergeMove(ListA);
    };
    this.DoXOr = function (ListA, ListB) {
      var r = 0;
      var l = null;
      if (ListB != null) {
        this.Clear();
        for (var $l = 0, $end = ListA.FCount - 1; $l <= $end; $l++) {
          r = $l;
          if (ListB.IndexOf(ListA.Get(r)) < 0) this.Add(ListA.Get(r));
        };
        for (var $l1 = 0, $end1 = ListB.FCount - 1; $l1 <= $end1; $l1++) {
          r = $l1;
          if (ListA.IndexOf(ListB.Get(r)) < 0) this.Add(ListB.Get(r));
        };
      } else {
        l = $mod.TFPList.$create("Create");
        try {
          l.CopyMove(this);
          for (var $l2 = this.FCount - 1; $l2 >= 0; $l2--) {
            r = $l2;
            if (ListA.IndexOf(this.Get(r)) >= 0) this.Delete(r);
          };
          for (var $l3 = 0, $end2 = ListA.FCount - 1; $l3 <= $end2; $l3++) {
            r = $l3;
            if (l.IndexOf(ListA.Get(r)) < 0) this.Add(ListA.Get(r));
          };
        } finally {
          l.$destroy("Destroy");
        };
      };
    };
    this.Get = function (Index) {
      var Result = undefined;
      if ((Index < 0) || (Index >= this.FCount)) this.RaiseIndexError(Index);
      Result = this.FList[Index];
      return Result;
    };
    this.Put = function (Index, Item) {
      if ((Index < 0) || (Index >= this.FCount)) this.RaiseIndexError(Index);
      this.FList[Index] = Item;
    };
    this.SetCapacity = function (NewCapacity) {
      if (NewCapacity < this.FCount) this.$class.Error(rtl.getResStr(pas.RTLConsts,"SListCapacityError"),"" + NewCapacity);
      if (NewCapacity === this.FCapacity) return;
      this.FList = rtl.arraySetLength(this.FList,undefined,NewCapacity);
      this.FCapacity = NewCapacity;
    };
    this.SetCount = function (NewCount) {
      if (NewCount < 0) this.$class.Error(rtl.getResStr(pas.RTLConsts,"SListCountError"),"" + NewCount);
      if (NewCount > this.FCount) {
        if (NewCount > this.FCapacity) this.SetCapacity(NewCount);
      };
      this.FCount = NewCount;
    };
    this.RaiseIndexError = function (Index) {
      this.$class.Error(rtl.getResStr(pas.RTLConsts,"SListIndexError"),"" + Index);
    };
    this.Destroy = function () {
      this.Clear();
      pas.System.TObject.Destroy.call(this);
    };
    this.AddList = function (AList) {
      var I = 0;
      if (this.FCapacity < (this.FCount + AList.FCount)) this.SetCapacity(this.FCount + AList.FCount);
      for (var $l = 0, $end = AList.FCount - 1; $l <= $end; $l++) {
        I = $l;
        this.Add(AList.Get(I));
      };
    };
    this.Add = function (Item) {
      var Result = 0;
      if (this.FCount === this.FCapacity) this.Expand();
      this.FList[this.FCount] = Item;
      Result = this.FCount;
      this.FCount += 1;
      return Result;
    };
    this.Clear = function () {
      if (rtl.length(this.FList) > 0) {
        this.SetCount(0);
        this.SetCapacity(0);
      };
    };
    this.Delete = function (Index) {
      if ((Index < 0) || (Index >= this.FCount)) this.$class.Error(rtl.getResStr(pas.RTLConsts,"SListIndexError"),"" + Index);
      this.FCount = this.FCount - 1;
      this.FList.splice(Index,1);
      this.FCapacity -= 1;
    };
    this.Error = function (Msg, Data) {
      throw $mod.EListError.$create("CreateFmt",[Msg,pas.System.VarRecs(18,Data)]);
    };
    this.Exchange = function (Index1, Index2) {
      var Temp = undefined;
      if ((Index1 >= this.FCount) || (Index1 < 0)) this.$class.Error(rtl.getResStr(pas.RTLConsts,"SListIndexError"),"" + Index1);
      if ((Index2 >= this.FCount) || (Index2 < 0)) this.$class.Error(rtl.getResStr(pas.RTLConsts,"SListIndexError"),"" + Index2);
      Temp = this.FList[Index1];
      this.FList[Index1] = this.FList[Index2];
      this.FList[Index2] = Temp;
    };
    this.Expand = function () {
      var Result = null;
      var IncSize = 0;
      if (this.FCount < this.FCapacity) return this;
      IncSize = 4;
      if (this.FCapacity > 3) IncSize = IncSize + 4;
      if (this.FCapacity > 8) IncSize = IncSize + 8;
      if (this.FCapacity > 127) IncSize += this.FCapacity >>> 2;
      this.SetCapacity(this.FCapacity + IncSize);
      Result = this;
      return Result;
    };
    this.Extract = function (Item) {
      var Result = undefined;
      var i = 0;
      i = this.IndexOf(Item);
      if (i >= 0) {
        Result = Item;
        this.Delete(i);
      } else Result = null;
      return Result;
    };
    this.First = function () {
      var Result = undefined;
      if (this.FCount === 0) {
        Result = null}
       else Result = this.Get(0);
      return Result;
    };
    this.GetEnumerator = function () {
      var Result = null;
      Result = $mod.TFPListEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.IndexOf = function (Item) {
      var Result = 0;
      var C = 0;
      Result = 0;
      C = this.FCount;
      while ((Result < C) && (this.FList[Result] != Item)) Result += 1;
      if (Result >= C) Result = -1;
      return Result;
    };
    this.IndexOfItem = function (Item, Direction) {
      var Result = 0;
      if (Direction === pas.Types.TDirection.FromBeginning) {
        Result = this.IndexOf(Item)}
       else {
        Result = this.FCount - 1;
        while ((Result >= 0) && (this.FList[Result] != Item)) Result = Result - 1;
      };
      return Result;
    };
    this.Insert = function (Index, Item) {
      if ((Index < 0) || (Index > this.FCount)) this.$class.Error(rtl.getResStr(pas.RTLConsts,"SListIndexError"),"" + Index);
      this.FList.splice(Index,0,Item);
      this.FCapacity += 1;
      this.FCount += 1;
    };
    this.Last = function () {
      var Result = undefined;
      if (this.FCount === 0) {
        Result = null}
       else Result = this.Get(this.FCount - 1);
      return Result;
    };
    this.Move = function (CurIndex, NewIndex) {
      var Temp = undefined;
      if ((CurIndex < 0) || (CurIndex > (this.FCount - 1))) this.$class.Error(rtl.getResStr(pas.RTLConsts,"SListIndexError"),"" + CurIndex);
      if ((NewIndex < 0) || (NewIndex > (this.FCount - 1))) this.$class.Error(rtl.getResStr(pas.RTLConsts,"SListIndexError"),"" + NewIndex);
      if (CurIndex === NewIndex) return;
      Temp = this.FList[CurIndex];
      this.FList.splice(CurIndex,1);
      this.FList.splice(NewIndex,0,Temp);
    };
    this.Assign = function (ListA, AOperator, ListB) {
      var $tmp = AOperator;
      if ($tmp === $mod.TListAssignOp.laCopy) {
        this.DoCopy(ListA,ListB)}
       else if ($tmp === $mod.TListAssignOp.laSrcUnique) {
        this.DoSrcUnique(ListA,ListB)}
       else if ($tmp === $mod.TListAssignOp.laAnd) {
        this.DoAnd(ListA,ListB)}
       else if ($tmp === $mod.TListAssignOp.laDestUnique) {
        this.DoDestUnique(ListA,ListB)}
       else if ($tmp === $mod.TListAssignOp.laOr) {
        this.DoOr(ListA,ListB)}
       else if ($tmp === $mod.TListAssignOp.laXor) this.DoXOr(ListA,ListB);
    };
    this.Remove = function (Item) {
      var Result = 0;
      Result = this.IndexOf(Item);
      if (Result !== -1) this.Delete(Result);
      return Result;
    };
    this.Pack = function () {
      var Dst = 0;
      var i = 0;
      var V = undefined;
      Dst = 0;
      for (var $l = 0, $end = this.FCount - 1; $l <= $end; $l++) {
        i = $l;
        V = this.FList[i];
        if (!pas.System.Assigned(V)) continue;
        this.FList[Dst] = V;
        Dst += 1;
      };
    };
    this.Sort = function (Compare) {
      var $Self = this;
      if (!(rtl.length(this.FList) > 0) || (this.FCount < 2)) return;
      $impl.QuickSort(rtl.arrayRef(this.FList),0,this.FCount - 1,function (Item1, Item2) {
        var Result = 0;
        Result = Compare(Item1,Item2);
        return Result;
      });
    };
    this.SortList = function (Compare) {
      if (!(rtl.length(this.FList) > 0) || (this.FCount < 2)) return;
      $impl.QuickSort(rtl.arrayRef(this.FList),0,this.FCount - 1,Compare);
    };
    this.ForEachCall = function (proc2call, arg) {
      var i = 0;
      var v = undefined;
      for (var $l = 0, $end = this.FCount - 1; $l <= $end; $l++) {
        i = $l;
        v = this.FList[i];
        if (pas.System.Assigned(v)) proc2call(v,arg);
      };
    };
    this.ForEachCall$1 = function (proc2call, arg) {
      var i = 0;
      var v = undefined;
      for (var $l = 0, $end = this.FCount - 1; $l <= $end; $l++) {
        i = $l;
        v = this.FList[i];
        if (pas.System.Assigned(v)) proc2call(v,arg);
      };
    };
  });
  this.TListNotification = {"0": "lnAdded", lnAdded: 0, "1": "lnExtracted", lnExtracted: 1, "2": "lnDeleted", lnDeleted: 2};
  this.$rtti.$Enum("TListNotification",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TListNotification});
  this.$rtti.$Class("TList");
  rtl.createClass(this,"TListEnumerator",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FList = null;
      this.FPosition = 0;
    };
    this.$final = function () {
      this.FList = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function (AList) {
      pas.System.TObject.Create.call(this);
      this.FList = AList;
      this.FPosition = -1;
      return this;
    };
    this.GetCurrent = function () {
      var Result = undefined;
      Result = this.FList.Get(this.FPosition);
      return Result;
    };
    this.MoveNext = function () {
      var Result = false;
      this.FPosition += 1;
      Result = this.FPosition < this.FList.GetCount();
      return Result;
    };
  });
  rtl.createClass(this,"TList",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FList = null;
    };
    this.$final = function () {
      this.FList = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.CopyMove = function (aList) {
      var r = 0;
      this.Clear();
      for (var $l = 0, $end = aList.GetCount() - 1; $l <= $end; $l++) {
        r = $l;
        this.Add(aList.Get(r));
      };
    };
    this.MergeMove = function (aList) {
      var r = 0;
      for (var $l = 0, $end = aList.GetCount() - 1; $l <= $end; $l++) {
        r = $l;
        if (this.IndexOf(aList.Get(r)) < 0) this.Add(aList.Get(r));
      };
    };
    this.DoCopy = function (ListA, ListB) {
      if (ListB != null) {
        this.CopyMove(ListB)}
       else this.CopyMove(ListA);
    };
    this.DoSrcUnique = function (ListA, ListB) {
      var r = 0;
      if (ListB != null) {
        this.Clear();
        for (var $l = 0, $end = ListA.GetCount() - 1; $l <= $end; $l++) {
          r = $l;
          if (ListB.IndexOf(ListA.Get(r)) < 0) this.Add(ListA.Get(r));
        };
      } else {
        for (var $l1 = this.GetCount() - 1; $l1 >= 0; $l1--) {
          r = $l1;
          if (ListA.IndexOf(this.Get(r)) >= 0) this.Delete(r);
        };
      };
    };
    this.DoAnd = function (ListA, ListB) {
      var r = 0;
      if (ListB != null) {
        this.Clear();
        for (var $l = 0, $end = ListA.GetCount() - 1; $l <= $end; $l++) {
          r = $l;
          if (ListB.IndexOf(ListA.Get(r)) >= 0) this.Add(ListA.Get(r));
        };
      } else {
        for (var $l1 = this.GetCount() - 1; $l1 >= 0; $l1--) {
          r = $l1;
          if (ListA.IndexOf(this.Get(r)) < 0) this.Delete(r);
        };
      };
    };
    this.DoDestUnique = function (ListA, ListB) {
      var $Self = this;
      function MoveElements(Src, Dest) {
        var r = 0;
        $Self.Clear();
        for (var $l = 0, $end = Src.GetCount() - 1; $l <= $end; $l++) {
          r = $l;
          if (Dest.IndexOf(Src.Get(r)) < 0) $Self.Add(Src.Get(r));
        };
      };
      var Dest = null;
      if (ListB != null) {
        MoveElements(ListB,ListA)}
       else try {
        Dest = $mod.TList.$create("Create$1");
        Dest.CopyMove($Self);
        MoveElements(ListA,Dest);
      } finally {
        Dest.$destroy("Destroy");
      };
    };
    this.DoOr = function (ListA, ListB) {
      if (ListB != null) {
        this.CopyMove(ListA);
        this.MergeMove(ListB);
      } else this.MergeMove(ListA);
    };
    this.DoXOr = function (ListA, ListB) {
      var r = 0;
      var l = null;
      if (ListB != null) {
        this.Clear();
        for (var $l = 0, $end = ListA.GetCount() - 1; $l <= $end; $l++) {
          r = $l;
          if (ListB.IndexOf(ListA.Get(r)) < 0) this.Add(ListA.Get(r));
        };
        for (var $l1 = 0, $end1 = ListB.GetCount() - 1; $l1 <= $end1; $l1++) {
          r = $l1;
          if (ListA.IndexOf(ListB.Get(r)) < 0) this.Add(ListB.Get(r));
        };
      } else try {
        l = $mod.TList.$create("Create$1");
        l.CopyMove(this);
        for (var $l2 = this.GetCount() - 1; $l2 >= 0; $l2--) {
          r = $l2;
          if (ListA.IndexOf(this.Get(r)) >= 0) this.Delete(r);
        };
        for (var $l3 = 0, $end2 = ListA.GetCount() - 1; $l3 <= $end2; $l3++) {
          r = $l3;
          if (l.IndexOf(ListA.Get(r)) < 0) this.Add(ListA.Get(r));
        };
      } finally {
        l.$destroy("Destroy");
      };
    };
    this.Get = function (Index) {
      var Result = undefined;
      Result = this.FList.Get(Index);
      return Result;
    };
    this.Put = function (Index, Item) {
      var V = undefined;
      V = this.Get(Index);
      this.FList.Put(Index,Item);
      if (pas.System.Assigned(V)) this.Notify(V,$mod.TListNotification.lnDeleted);
      if (pas.System.Assigned(Item)) this.Notify(Item,$mod.TListNotification.lnAdded);
    };
    this.Notify = function (aValue, Action) {
      if (pas.System.Assigned(aValue)) ;
      if (Action === $mod.TListNotification.lnExtracted) ;
    };
    this.SetCapacity = function (NewCapacity) {
      this.FList.SetCapacity(NewCapacity);
    };
    this.GetCapacity = function () {
      var Result = 0;
      Result = this.FList.FCapacity;
      return Result;
    };
    this.SetCount = function (NewCount) {
      if (NewCount < this.FList.FCount) {
        while (this.FList.FCount > NewCount) this.Delete(this.FList.FCount - 1)}
       else this.FList.SetCount(NewCount);
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FList.FCount;
      return Result;
    };
    this.GetList = function () {
      var Result = [];
      Result = this.FList.FList;
      return Result;
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FList = $mod.TFPList.$create("Create");
      return this;
    };
    this.Destroy = function () {
      if (this.FList != null) this.Clear();
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FList;
        }, set: function (v) {
          this.p.FList = v;
        }});
    };
    this.AddList = function (AList) {
      var I = 0;
      this.FList.AddList(AList.FList);
      for (var $l = 0, $end = AList.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (pas.System.Assigned(AList.Get(I))) this.Notify(AList.Get(I),$mod.TListNotification.lnAdded);
      };
    };
    this.Add = function (Item) {
      var Result = 0;
      Result = this.FList.Add(Item);
      if (pas.System.Assigned(Item)) this.Notify(Item,$mod.TListNotification.lnAdded);
      return Result;
    };
    this.Clear = function () {
      while (this.FList.FCount > 0) this.Delete(this.GetCount() - 1);
    };
    this.Delete = function (Index) {
      var V = undefined;
      V = this.FList.Get(Index);
      this.FList.Delete(Index);
      if (pas.System.Assigned(V)) this.Notify(V,$mod.TListNotification.lnDeleted);
    };
    this.Error = function (Msg, Data) {
      throw $mod.EListError.$create("CreateFmt",[Msg,pas.System.VarRecs(18,Data)]);
    };
    this.Exchange = function (Index1, Index2) {
      this.FList.Exchange(Index1,Index2);
    };
    this.Expand = function () {
      var Result = null;
      this.FList.Expand();
      Result = this;
      return Result;
    };
    this.Extract = function (Item) {
      var Result = undefined;
      var c = 0;
      c = this.FList.FCount;
      Result = this.FList.Extract(Item);
      if (c !== this.FList.FCount) this.Notify(Result,$mod.TListNotification.lnExtracted);
      return Result;
    };
    this.First = function () {
      var Result = undefined;
      Result = this.FList.First();
      return Result;
    };
    this.GetEnumerator = function () {
      var Result = null;
      Result = $mod.TListEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.IndexOf = function (Item) {
      var Result = 0;
      Result = this.FList.IndexOf(Item);
      return Result;
    };
    this.Insert = function (Index, Item) {
      this.FList.Insert(Index,Item);
      if (pas.System.Assigned(Item)) this.Notify(Item,$mod.TListNotification.lnAdded);
    };
    this.Last = function () {
      var Result = undefined;
      Result = this.FList.Last();
      return Result;
    };
    this.Move = function (CurIndex, NewIndex) {
      this.FList.Move(CurIndex,NewIndex);
    };
    this.Assign = function (ListA, AOperator, ListB) {
      var $tmp = AOperator;
      if ($tmp === $mod.TListAssignOp.laCopy) {
        this.DoCopy(ListA,ListB)}
       else if ($tmp === $mod.TListAssignOp.laSrcUnique) {
        this.DoSrcUnique(ListA,ListB)}
       else if ($tmp === $mod.TListAssignOp.laAnd) {
        this.DoAnd(ListA,ListB)}
       else if ($tmp === $mod.TListAssignOp.laDestUnique) {
        this.DoDestUnique(ListA,ListB)}
       else if ($tmp === $mod.TListAssignOp.laOr) {
        this.DoOr(ListA,ListB)}
       else if ($tmp === $mod.TListAssignOp.laXor) this.DoXOr(ListA,ListB);
    };
    this.Remove = function (Item) {
      var Result = 0;
      Result = this.IndexOf(Item);
      if (Result !== -1) this.Delete(Result);
      return Result;
    };
    this.Pack = function () {
      this.FList.Pack();
    };
    this.Sort = function (Compare) {
      this.FList.Sort(Compare);
    };
    this.SortList = function (Compare) {
      this.FList.SortList(Compare);
    };
  });
  rtl.createClass(this,"TPersistent",pas.System.TObject,function () {
    this.AssignError = function (Source) {
      var SourceName = "";
      if (Source !== null) {
        SourceName = Source.$classname}
       else SourceName = "Nil";
      throw pas.SysUtils.EConvertError.$create("Create$1",["Cannot assign a " + SourceName + " to a " + this.$classname + "."]);
    };
    this.DefineProperties = function (Filer) {
      if (Filer === null) return;
    };
    this.AssignTo = function (Dest) {
      Dest.AssignError(this);
    };
    this.GetOwner = function () {
      var Result = null;
      Result = null;
      return Result;
    };
    this.Assign = function (Source) {
      if (Source !== null) {
        Source.AssignTo(this)}
       else this.AssignError(null);
    };
    this.GetNamePath = function () {
      var Result = "";
      var OwnerName = "";
      var TheOwner = null;
      Result = this.$classname;
      TheOwner = this.GetOwner();
      if (TheOwner !== null) {
        OwnerName = TheOwner.GetNamePath();
        if (OwnerName !== "") Result = OwnerName + "." + Result;
      };
      return Result;
    };
    this.SetEvent = function (ALookupRoot, APropName, AMethodName) {
      this.SetEvent$1(this,ALookupRoot,APropName,AMethodName);
    };
    this.SetEvent$1 = function (AInstance, ALookupRoot, APropName, AMethodName) {
      var lMethod = pas.System.TMethod.$new();
      lMethod.Code = ALookupRoot.$class.MethodAddress(AMethodName);
      if (lMethod.Code != null) {
        lMethod.Data = ALookupRoot;
        pas.TypInfo.SetMethodProp$1(AInstance,APropName,lMethod);
      };
    };
  });
  this.$rtti.$ClassRef("TPersistentClass",{instancetype: this.$rtti["TPersistent"]});
  rtl.createClass(this,"TInterfacedPersistent",this.TPersistent,function () {
    this.$init = function () {
      $mod.TPersistent.$init.call(this);
      this.FOwnerInterface = null;
    };
    this.$final = function () {
      rtl.setIntfP(this,"FOwnerInterface",null);
      $mod.TPersistent.$final.call(this);
    };
    this._AddRef = function () {
      var Result = 0;
      Result = -1;
      if (this.FOwnerInterface != null) Result = this.FOwnerInterface._AddRef();
      return Result;
    };
    this._Release = function () {
      var Result = 0;
      Result = -1;
      if (this.FOwnerInterface != null) Result = this.FOwnerInterface._Release();
      return Result;
    };
    this.QueryInterface = function (IID, Obj) {
      var Result = 0;
      Result = -2147467262;
      if (this.GetInterface(IID,Obj)) Result = 0;
      return Result;
    };
    this.AfterConstruction = function () {
      try {
        pas.System.TObject.AfterConstruction.call(this);
        if (this.GetOwner() !== null) this.GetOwner().GetInterface(rtl.getIntfGUIDR(pas.System.IUnknown),{p: this, get: function () {
            return this.p.FOwnerInterface;
          }, set: function (v) {
            this.p.FOwnerInterface = v;
          }});
      } finally {
        rtl._Release(this.FOwnerInterface);
      };
    };
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.$rtti.$Class("TStrings");
  rtl.createClass(this,"TStringsEnumerator",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FStrings = null;
      this.FPosition = 0;
    };
    this.$final = function () {
      this.FStrings = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function (AStrings) {
      pas.System.TObject.Create.call(this);
      this.FStrings = AStrings;
      this.FPosition = -1;
      return this;
    };
    this.GetCurrent = function () {
      var Result = "";
      Result = this.FStrings.Get(this.FPosition);
      return Result;
    };
    this.MoveNext = function () {
      var Result = false;
      this.FPosition += 1;
      Result = this.FPosition < this.FStrings.GetCount();
      return Result;
    };
  });
  rtl.createClass(this,"TStrings",this.TPersistent,function () {
    this.$init = function () {
      $mod.TPersistent.$init.call(this);
      this.FSpecialCharsInited = false;
      this.FAlwaysQuote = false;
      this.FQuoteChar = "\x00";
      this.FDelimiter = "\x00";
      this.FNameValueSeparator = "\x00";
      this.FUpdateCount = 0;
      this.FLBS = 0;
      this.FSkipLastLineBreak = false;
      this.FStrictDelimiter = false;
      this.FLineBreak = "";
    };
    this.GetCommaText = function () {
      var Result = "";
      var C1 = "\x00";
      var C2 = "\x00";
      var FSD = false;
      this.CheckSpecialChars();
      FSD = this.FStrictDelimiter;
      C1 = this.GetDelimiter();
      C2 = this.GetQuoteChar();
      this.SetDelimiter(",");
      this.SetQuoteChar('"');
      this.FStrictDelimiter = false;
      try {
        Result = this.GetDelimitedText();
      } finally {
        this.SetDelimiter(C1);
        this.SetQuoteChar(C2);
        this.FStrictDelimiter = FSD;
      };
      return Result;
    };
    this.GetName = function (Index) {
      var Result = "";
      var V = "";
      this.GetNameValue(Index,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }},{get: function () {
          return V;
        }, set: function (v) {
          V = v;
        }});
      return Result;
    };
    this.GetValue = function (Name) {
      var Result = "";
      var L = 0;
      var N = "";
      Result = "";
      L = this.IndexOfName(Name);
      if (L !== -1) this.GetNameValue(L,{get: function () {
          return N;
        }, set: function (v) {
          N = v;
        }},{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.GetLBS = function () {
      var Result = 0;
      this.CheckSpecialChars();
      Result = this.FLBS;
      return Result;
    };
    this.SetLBS = function (AValue) {
      this.CheckSpecialChars();
      this.FLBS = AValue;
    };
    this.SetCommaText = function (Value) {
      var C1 = "\x00";
      var C2 = "\x00";
      this.CheckSpecialChars();
      C1 = this.GetDelimiter();
      C2 = this.GetQuoteChar();
      this.SetDelimiter(",");
      this.SetQuoteChar('"');
      try {
        this.SetDelimitedText(Value);
      } finally {
        this.SetDelimiter(C1);
        this.SetQuoteChar(C2);
      };
    };
    this.SetValue = function (Name, Value) {
      var L = 0;
      this.CheckSpecialChars();
      L = this.IndexOfName(Name);
      if (L === -1) {
        this.Add(Name + this.FNameValueSeparator + Value)}
       else this.Put(L,Name + this.FNameValueSeparator + Value);
    };
    this.SetDelimiter = function (c) {
      this.CheckSpecialChars();
      this.FDelimiter = c;
    };
    this.SetQuoteChar = function (c) {
      this.CheckSpecialChars();
      this.FQuoteChar = c;
    };
    this.SetNameValueSeparator = function (c) {
      this.CheckSpecialChars();
      this.FNameValueSeparator = c;
    };
    this.DoSetTextStr = function (Value, DoClear) {
      var S = "";
      var P = 0;
      try {
        this.BeginUpdate();
        if (DoClear) this.Clear();
        P = 1;
        while (this.GetNextLinebreak(Value,{get: function () {
            return S;
          }, set: function (v) {
            S = v;
          }},{get: function () {
            return P;
          }, set: function (v) {
            P = v;
          }})) this.Add(S);
      } finally {
        this.EndUpdate();
      };
    };
    this.GetDelimiter = function () {
      var Result = "\x00";
      this.CheckSpecialChars();
      Result = this.FDelimiter;
      return Result;
    };
    this.GetNameValueSeparator = function () {
      var Result = "\x00";
      this.CheckSpecialChars();
      Result = this.FNameValueSeparator;
      return Result;
    };
    this.GetQuoteChar = function () {
      var Result = "\x00";
      this.CheckSpecialChars();
      Result = this.FQuoteChar;
      return Result;
    };
    this.GetLineBreak = function () {
      var Result = "";
      this.CheckSpecialChars();
      Result = this.FLineBreak;
      return Result;
    };
    this.SetLineBreak = function (S) {
      this.CheckSpecialChars();
      this.FLineBreak = S;
    };
    this.GetSkipLastLineBreak = function () {
      var Result = false;
      this.CheckSpecialChars();
      Result = this.FSkipLastLineBreak;
      return Result;
    };
    this.SetSkipLastLineBreak = function (AValue) {
      this.CheckSpecialChars();
      this.FSkipLastLineBreak = AValue;
    };
    this.ReadData = function (Reader) {
      Reader.ReadListBegin();
      this.BeginUpdate();
      try {
        this.Clear();
        while (!Reader.EndOfList()) this.Add(Reader.ReadString());
      } finally {
        this.EndUpdate();
      };
      Reader.ReadListEnd();
    };
    this.WriteData = function (Writer) {
      var i = 0;
      Writer.WriteListBegin();
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        Writer.WriteString(this.Get(i));
      };
      Writer.WriteListEnd();
    };
    this.DefineProperties = function (Filer) {
      var HasData = false;
      if (Filer.FAncestor != null) {
        if (Filer.FAncestor.$class.InheritsFrom($mod.TStrings)) {
          HasData = !this.Equals$2(Filer.FAncestor)}
         else HasData = true}
       else HasData = this.GetCount() > 0;
      Filer.DefineProperty("Strings",rtl.createCallback(this,"ReadData"),rtl.createCallback(this,"WriteData"),HasData);
    };
    this.Error = function (Msg, Data) {
      throw $mod.EStringListError.$create("CreateFmt",[Msg,pas.System.VarRecs(18,pas.SysUtils.IntToStr(Data))]);
    };
    this.GetCapacity = function () {
      var Result = 0;
      Result = this.GetCount();
      return Result;
    };
    this.GetObject = function (Index) {
      var Result = null;
      if (Index === 0) ;
      Result = null;
      return Result;
    };
    this.GetTextStr = function () {
      var Result = "";
      var I = 0;
      var S = "";
      var NL = "";
      this.CheckSpecialChars();
      if (this.FLineBreak !== pas.System.sLineBreak) {
        NL = this.FLineBreak}
       else {
        var $tmp = this.FLBS;
        if ($tmp === pas.System.TTextLineBreakStyle.tlbsLF) {
          NL = "\n"}
         else if ($tmp === pas.System.TTextLineBreakStyle.tlbsCRLF) {
          NL = "\r\n"}
         else if ($tmp === pas.System.TTextLineBreakStyle.tlbsCR) NL = "\r";
      };
      Result = "";
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        S = this.Get(I);
        Result = Result + S;
        if ((I < (this.GetCount() - 1)) || !this.GetSkipLastLineBreak()) Result = Result + NL;
      };
      return Result;
    };
    this.Put = function (Index, S) {
      var Obj = null;
      Obj = this.GetObject(Index);
      this.Delete(Index);
      this.InsertObject(Index,S,Obj);
    };
    this.PutObject = function (Index, AObject) {
      if (Index === 0) return;
      if (AObject === null) return;
    };
    this.SetCapacity = function (NewCapacity) {
      if (NewCapacity === 0) ;
    };
    this.SetTextStr = function (Value) {
      this.CheckSpecialChars();
      this.DoSetTextStr(Value,true);
    };
    this.SetUpdateState = function (Updating) {
      if (Updating) ;
    };
    this.DoCompareText = function (s1, s2) {
      var Result = 0;
      Result = pas.SysUtils.CompareText(s1,s2);
      return Result;
    };
    this.GetDelimitedText = function () {
      var Result = "";
      var I = 0;
      var RE = "";
      var S = "";
      var doQuote = false;
      this.CheckSpecialChars();
      Result = "";
      RE = this.GetQuoteChar() + "|" + this.GetDelimiter();
      if (!this.FStrictDelimiter) RE = " |" + RE;
      RE = "/" + RE + "/";
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        S = this.Get(I);
        doQuote = this.FAlwaysQuote || (S.search(RE) !== -1);
        if (doQuote) {
          Result = Result + pas.SysUtils.QuoteString(S,this.GetQuoteChar())}
         else Result = Result + S;
        if (I < (this.GetCount() - 1)) Result = Result + this.GetDelimiter();
      };
      if ((Result.length === 0) && (this.GetCount() === 1)) Result = this.GetQuoteChar() + this.GetQuoteChar();
      return Result;
    };
    this.SetDelimitedText = function (AValue) {
      var i = 0;
      var j = 0;
      var aNotFirst = false;
      this.CheckSpecialChars();
      this.BeginUpdate();
      i = 1;
      j = 1;
      aNotFirst = false;
      try {
        this.Clear();
        if (this.FStrictDelimiter) {
          while (i <= AValue.length) {
            if (aNotFirst && (i <= AValue.length) && (AValue.charAt(i - 1) === this.FDelimiter)) i += 1;
            if (i <= AValue.length) {
              if (AValue.charAt(i - 1) === this.FQuoteChar) {
                j = i + 1;
                while ((j <= AValue.length) && ((AValue.charAt(j - 1) !== this.FQuoteChar) || (((j + 1) <= AValue.length) && (AValue.charAt((j + 1) - 1) === this.FQuoteChar)))) {
                  if ((j <= AValue.length) && (AValue.charAt(j - 1) === this.FQuoteChar)) {
                    j += 2}
                   else j += 1;
                };
                this.Add(pas.SysUtils.StringReplace(pas.System.Copy(AValue,i + 1,j - i - 1),this.FQuoteChar + this.FQuoteChar,this.FQuoteChar,rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll)));
                i = j + 1;
              } else {
                j = i;
                while ((j <= AValue.length) && (AValue.charAt(j - 1) !== this.FDelimiter)) j += 1;
                this.Add(pas.System.Copy(AValue,i,j - i));
                i = j;
              };
            } else {
              if (aNotFirst) this.Add("");
            };
            aNotFirst = true;
          };
        } else {
          while (i <= AValue.length) {
            if (aNotFirst && (i <= AValue.length) && (AValue.charAt(i - 1) === this.FDelimiter)) i += 1;
            while ((i <= AValue.length) && (AValue.charCodeAt(i - 1) <= 32)) i += 1;
            if (i <= AValue.length) {
              if (AValue.charAt(i - 1) === this.FQuoteChar) {
                j = i + 1;
                while ((j <= AValue.length) && ((AValue.charAt(j - 1) !== this.FQuoteChar) || (((j + 1) <= AValue.length) && (AValue.charAt((j + 1) - 1) === this.FQuoteChar)))) {
                  if ((j <= AValue.length) && (AValue.charAt(j - 1) === this.FQuoteChar)) {
                    j += 2}
                   else j += 1;
                };
                this.Add(pas.SysUtils.StringReplace(pas.System.Copy(AValue,i + 1,j - i - 1),this.FQuoteChar + this.FQuoteChar,this.FQuoteChar,rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll)));
                i = j + 1;
              } else {
                j = i;
                while ((j <= AValue.length) && (AValue.charCodeAt(j - 1) > 32) && (AValue.charAt(j - 1) !== this.FDelimiter)) j += 1;
                this.Add(pas.System.Copy(AValue,i,j - i));
                i = j;
              };
            } else {
              if (aNotFirst) this.Add("");
            };
            while ((i <= AValue.length) && (AValue.charCodeAt(i - 1) <= 32)) i += 1;
            aNotFirst = true;
          };
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.GetValueFromIndex = function (Index) {
      var Result = "";
      var N = "";
      this.GetNameValue(Index,{get: function () {
          return N;
        }, set: function (v) {
          N = v;
        }},{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.SetValueFromIndex = function (Index, Value) {
      if (Value === "") {
        this.Delete(Index)}
       else {
        if (Index < 0) Index = this.Add("");
        this.CheckSpecialChars();
        this.Put(Index,this.GetName(Index) + this.FNameValueSeparator + Value);
      };
    };
    this.CheckSpecialChars = function () {
      if (!this.FSpecialCharsInited) {
        this.FQuoteChar = '"';
        this.FDelimiter = ",";
        this.FNameValueSeparator = "=";
        this.FLBS = pas.System.DefaultTextLineBreakStyle;
        this.FSpecialCharsInited = true;
        this.FLineBreak = pas.System.sLineBreak;
      };
    };
    this.GetNextLinebreak = function (Value, S, P) {
      var Result = false;
      var PPLF = 0;
      var PPCR = 0;
      var PP = 0;
      var PL = 0;
      S.set("");
      Result = false;
      if ((Value.length - P.get()) < 0) return Result;
      PPLF = Value.indexOf("\n",P.get() - 1) + 1;
      PPCR = Value.indexOf("\r",P.get() - 1) + 1;
      PL = 1;
      if ((PPLF > 0) && (PPCR > 0)) {
        if ((PPLF - PPCR) === 1) PL = 2;
        if (PPLF < PPCR) {
          PP = PPLF}
         else PP = PPCR;
      } else if ((PPLF > 0) && (PPCR < 1)) {
        PP = PPLF}
       else if ((PPCR > 0) && (PPLF < 1)) {
        PP = PPCR}
       else PP = Value.length + 1;
      S.set(pas.System.Copy(Value,P.get(),PP - P.get()));
      P.set(PP + PL);
      Result = true;
      return Result;
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FAlwaysQuote = false;
      return this;
    };
    this.Destroy = function () {
      pas.System.TObject.Destroy.call(this);
    };
    this.ToObjectArray = function () {
      var Result = [];
      Result = this.ToObjectArray$1(0,this.GetCount() - 1);
      return Result;
    };
    this.ToObjectArray$1 = function (aStart, aEnd) {
      var Result = [];
      var I = 0;
      Result = [];
      if (aStart > aEnd) return Result;
      Result = rtl.arraySetLength(Result,null,(aEnd - aStart) + 1);
      for (var $l = aStart, $end = aEnd; $l <= $end; $l++) {
        I = $l;
        Result[I - aStart] = this.GetObject(I);
      };
      return Result;
    };
    this.ToStringArray = function () {
      var Result = [];
      Result = this.ToStringArray$1(0,this.GetCount() - 1);
      return Result;
    };
    this.ToStringArray$1 = function (aStart, aEnd) {
      var Result = [];
      var I = 0;
      Result = [];
      if (aStart > aEnd) return Result;
      Result = rtl.arraySetLength(Result,"",(aEnd - aStart) + 1);
      for (var $l = aStart, $end = aEnd; $l <= $end; $l++) {
        I = $l;
        Result[I - aStart] = this.Get(I);
      };
      return Result;
    };
    this.Add = function (S) {
      var Result = 0;
      Result = this.GetCount();
      this.Insert(this.GetCount(),S);
      return Result;
    };
    this.Add$1 = function (Fmt, Args) {
      var Result = 0;
      Result = this.Add(pas.SysUtils.Format(Fmt,Args));
      return Result;
    };
    this.AddFmt = function (Fmt, Args) {
      var Result = 0;
      Result = this.Add(pas.SysUtils.Format(Fmt,Args));
      return Result;
    };
    this.AddObject = function (S, AObject) {
      var Result = 0;
      Result = this.Add(S);
      this.PutObject(Result,AObject);
      return Result;
    };
    this.AddObject$1 = function (Fmt, Args, AObject) {
      var Result = 0;
      Result = this.AddObject(pas.SysUtils.Format(Fmt,Args),AObject);
      return Result;
    };
    this.Append = function (S) {
      this.Add(S);
    };
    this.AddStrings = function (TheStrings) {
      var Runner = 0;
      for (var $l = 0, $end = TheStrings.GetCount() - 1; $l <= $end; $l++) {
        Runner = $l;
        this.AddObject(TheStrings.Get(Runner),TheStrings.GetObject(Runner));
      };
    };
    this.AddStrings$1 = function (TheStrings, ClearFirst) {
      this.BeginUpdate();
      try {
        if (ClearFirst) this.Clear();
        this.AddStrings(TheStrings);
      } finally {
        this.EndUpdate();
      };
    };
    this.AddStrings$2 = function (TheStrings) {
      var Runner = 0;
      if ((this.GetCount() + (rtl.length(TheStrings) - 1) + 1) > this.GetCapacity()) this.SetCapacity(this.GetCount() + (rtl.length(TheStrings) - 1) + 1);
      for (var $l = 0, $end = rtl.length(TheStrings) - 1; $l <= $end; $l++) {
        Runner = $l;
        this.Add(TheStrings[Runner]);
      };
    };
    this.AddStrings$3 = function (TheStrings, ClearFirst) {
      this.BeginUpdate();
      try {
        if (ClearFirst) this.Clear();
        this.AddStrings$2(TheStrings);
      } finally {
        this.EndUpdate();
      };
    };
    this.AddPair = function (AName, AValue) {
      var Result = null;
      Result = this.AddPair$1(AName,AValue,null);
      return Result;
    };
    this.AddPair$1 = function (AName, AValue, AObject) {
      var Result = null;
      Result = this;
      this.AddObject(AName + this.GetNameValueSeparator() + AValue,AObject);
      return Result;
    };
    this.AddText = function (S) {
      this.CheckSpecialChars();
      this.DoSetTextStr(S,false);
    };
    this.Assign = function (Source) {
      var S = null;
      if ($mod.TStrings.isPrototypeOf(Source)) {
        S = Source;
        this.BeginUpdate();
        try {
          this.Clear();
          this.FSpecialCharsInited = S.FSpecialCharsInited;
          this.FQuoteChar = S.FQuoteChar;
          this.FDelimiter = S.FDelimiter;
          this.FNameValueSeparator = S.FNameValueSeparator;
          this.FLBS = S.FLBS;
          this.FLineBreak = S.FLineBreak;
          this.AddStrings(S);
        } finally {
          this.EndUpdate();
        };
      } else $mod.TPersistent.Assign.call(this,Source);
    };
    this.BeginUpdate = function () {
      if (this.FUpdateCount === 0) this.SetUpdateState(true);
      this.FUpdateCount += 1;
    };
    this.EndUpdate = function () {
      if (this.FUpdateCount > 0) this.FUpdateCount -= 1;
      if (this.FUpdateCount === 0) this.SetUpdateState(false);
    };
    this.Equals = function (Obj) {
      var Result = false;
      if ($mod.TStrings.isPrototypeOf(Obj)) {
        Result = this.Equals$2(Obj)}
       else Result = pas.System.TObject.Equals.call(this,Obj);
      return Result;
    };
    this.Equals$2 = function (TheStrings) {
      var Result = false;
      var Runner = 0;
      var Nr = 0;
      Result = false;
      Nr = this.GetCount();
      if (Nr !== TheStrings.GetCount()) return Result;
      for (var $l = 0, $end = Nr - 1; $l <= $end; $l++) {
        Runner = $l;
        if (this.Get(Runner) !== TheStrings.Get(Runner)) return Result;
      };
      Result = true;
      return Result;
    };
    this.Exchange = function (Index1, Index2) {
      var Obj = null;
      var Str = "";
      this.BeginUpdate();
      try {
        Obj = this.GetObject(Index1);
        Str = this.Get(Index1);
        this.PutObject(Index1,this.GetObject(Index2));
        this.Put(Index1,this.Get(Index2));
        this.PutObject(Index2,Obj);
        this.Put(Index2,Str);
      } finally {
        this.EndUpdate();
      };
    };
    this.GetEnumerator = function () {
      var Result = null;
      Result = $mod.TStringsEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.IndexOf = function (S) {
      var Result = 0;
      Result = 0;
      while ((Result < this.GetCount()) && (this.DoCompareText(this.Get(Result),S) !== 0)) Result = Result + 1;
      if (Result === this.GetCount()) Result = -1;
      return Result;
    };
    this.IndexOfName = function (Name) {
      var Result = 0;
      var len = 0;
      var S = "";
      this.CheckSpecialChars();
      Result = 0;
      while (Result < this.GetCount()) {
        S = this.Get(Result);
        len = pas.System.Pos(this.FNameValueSeparator,S) - 1;
        if ((len >= 0) && (this.DoCompareText(Name,pas.System.Copy(S,1,len)) === 0)) return Result;
        Result += 1;
      };
      Result = -1;
      return Result;
    };
    this.IndexOfObject = function (AObject) {
      var Result = 0;
      Result = 0;
      while ((Result < this.GetCount()) && (this.GetObject(Result) !== AObject)) Result = Result + 1;
      if (Result === this.GetCount()) Result = -1;
      return Result;
    };
    this.InsertObject = function (Index, S, AObject) {
      this.Insert(Index,S);
      this.PutObject(Index,AObject);
    };
    this.Move = function (CurIndex, NewIndex) {
      var Obj = null;
      var Str = "";
      this.BeginUpdate();
      try {
        Obj = this.GetObject(CurIndex);
        Str = this.Get(CurIndex);
        this.PutObject(CurIndex,null);
        this.Delete(CurIndex);
        this.InsertObject(NewIndex,Str,Obj);
      } finally {
        this.EndUpdate();
      };
    };
    this.GetNameValue = function (Index, AName, AValue) {
      var L = 0;
      this.CheckSpecialChars();
      AValue.set(this.Get(Index));
      L = pas.System.Pos(this.FNameValueSeparator,AValue.get());
      if (L !== 0) {
        AName.set(pas.System.Copy(AValue.get(),1,L - 1));
        AValue.set(pas.System.Copy(AValue.get(),L + 1,AValue.get().length - L));
      } else AName.set("");
    };
    this.LoadFromURL = function (aURL, Async, OnLoaded, OnError) {
      var $Self = this;
      function DoLoaded(aString) {
        $Self.SetTextStr(aString);
        if (OnLoaded != null) OnLoaded($Self);
      };
      function DoError(AError) {
        if (OnError != null) {
          OnError($Self,AError)}
         else throw pas.SysUtils.EInOutError.$create("Create$1",["Failed to load from URL:" + AError]);
      };
      $impl.CheckLoadHelper();
      $impl.GlobalLoadHelper.LoadText(aURL,Async,DoLoaded,DoError);
    };
    this.LoadFromFile = function (aFileName) {
      var a = [];
      a = $impl.URLToArrayOfString(aFileName);
      this.AddStrings$3(a,true);
    };
    this.LoadFromFile$1 = function (aFileName, OnLoaded, AError) {
      var $Self = this;
      this.LoadFromURL(aFileName,false,function (Sender) {
        if (OnLoaded != null) OnLoaded();
      },function (Sender, ErrorMsg) {
        if (AError != null) AError(ErrorMsg);
      });
    };
    this.LoadFromFileAsync = function (aFileName) {
      var $Self = this;
      var Result = null;
      Result = new Promise(function (ASuccess, AFailed) {
        $impl.ReqAsync(aFileName,function (AResponse) {
          ASuccess(true);
          $Self.SetTextStr(AResponse);
        },function () {
          ASuccess(false);
        });
      });
      return Result;
    };
    this.ExtractName = function (S) {
      var Result = "";
      var L = 0;
      this.CheckSpecialChars();
      L = pas.System.Pos(this.FNameValueSeparator,S);
      if (L !== 0) {
        Result = pas.System.Copy(S,1,L - 1)}
       else Result = "";
      return Result;
    };
    this.SaveToFile = function (FileName) {
      var AText = "";
      AText = this.GetTextStr();
      var element = document.createElement('a');
      element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(AText));
      if (FileName != ''){
        element.setAttribute('download', FileName);
      }
      element.style.display = 'none';
      document.body.appendChild(element);
      element.click();
      document.body.removeChild(element);
    };
  });
  rtl.recNewT(this,"TStringItem",function () {
    this.FString = "";
    this.FObject = null;
    this.$eq = function (b) {
      return (this.FString === b.FString) && (this.FObject === b.FObject);
    };
    this.$assign = function (s) {
      this.FString = s.FString;
      this.FObject = s.FObject;
      return this;
    };
    var $r = $mod.$rtti.$Record("TStringItem",{},this);
    $r.addField("FString",rtl.string);
    $r.addField("FObject",pas.System.$rtti["TObject"]);
  });
  this.TStringsOption = {"0": "soStrictDelimiter", soStrictDelimiter: 0, "1": "soWriteBOM", soWriteBOM: 1, "2": "soTrailingLineBreak", soTrailingLineBreak: 2, "3": "soUseLocale", soUseLocale: 3};
  this.$rtti.$Enum("TStringsOption",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TStringsOption});
  this.$rtti.$Set("TStringsOptions",{comptype: this.$rtti["TStringsOption"]});
  this.$rtti.$DynArray("TStringItemArray",{eltype: this.$rtti["TStringItem"]});
  this.$rtti.$Class("TStringList");
  this.$rtti.$ProcVar("TStringListSortCompare",{procsig: rtl.newTIProcSig([["List",this.$rtti["TStringList"]],["Index1",rtl.longint],["Index2",rtl.longint]],rtl.longint)});
  this.TStringsSortStyle = {"0": "sslNone", sslNone: 0, "1": "sslUser", sslUser: 1, "2": "sslAuto", sslAuto: 2};
  this.$rtti.$Enum("TStringsSortStyle",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TStringsSortStyle});
  this.$rtti.$Set("TStringsSortStyles",{comptype: this.$rtti["TStringsSortStyle"]});
  rtl.createClass(this,"TStringList",this.TStrings,function () {
    this.$init = function () {
      $mod.TStrings.$init.call(this);
      this.FList = [];
      this.FCount = 0;
      this.FOnChange = null;
      this.FOnChanging = null;
      this.FDuplicates = 0;
      this.FCaseSensitive = false;
      this.FForceSort = false;
      this.FOwnsObjects = false;
      this.FSortStyle = 0;
    };
    this.$final = function () {
      this.FList = undefined;
      this.FOnChange = undefined;
      this.FOnChanging = undefined;
      $mod.TStrings.$final.call(this);
    };
    this.ExchangeItemsInt = function (Index1, Index2) {
      var S = "";
      var O = null;
      S = this.FList[Index1].FString;
      O = this.FList[Index1].FObject;
      this.FList[Index1].FString = this.FList[Index2].FString;
      this.FList[Index1].FObject = this.FList[Index2].FObject;
      this.FList[Index2].FString = S;
      this.FList[Index2].FObject = O;
    };
    this.GetSorted = function () {
      var Result = false;
      Result = this.FSortStyle in rtl.createSet($mod.TStringsSortStyle.sslUser,$mod.TStringsSortStyle.sslAuto);
      return Result;
    };
    this.Grow = function () {
      var NC = 0;
      NC = this.GetCapacity();
      if (NC >= 256) {
        NC = NC + rtl.trunc(NC / 4)}
       else if (NC === 0) {
        NC = 4}
       else NC = NC * 4;
      this.SetCapacity(NC);
    };
    this.InternalClear = function (FromIndex, ClearOnly) {
      var I = 0;
      if (FromIndex < this.FCount) {
        if (this.FOwnsObjects) {
          for (var $l = FromIndex, $end = this.FCount - 1; $l <= $end; $l++) {
            I = $l;
            this.FList[I].FString = "";
            pas.SysUtils.FreeAndNil({p: this.FList[I], get: function () {
                return this.p.FObject;
              }, set: function (v) {
                this.p.FObject = v;
              }});
          };
        } else {
          for (var $l1 = FromIndex, $end1 = this.FCount - 1; $l1 <= $end1; $l1++) {
            I = $l1;
            this.FList[I].FString = "";
          };
        };
        this.FCount = FromIndex;
      };
      if (!ClearOnly) this.SetCapacity(0);
    };
    this.QuickSort = function (L, R, CompareFn) {
      var Pivot = 0;
      var vL = 0;
      var vR = 0;
      if ((R - L) <= 1) {
        if (L < R) if (CompareFn(this,L,R) > 0) this.ExchangeItems(L,R);
        return;
      };
      vL = L;
      vR = R;
      Pivot = L + pas.System.Random(R - L);
      while (vL < vR) {
        while ((vL < Pivot) && (CompareFn(this,vL,Pivot) <= 0)) vL += 1;
        while ((vR > Pivot) && (CompareFn(this,vR,Pivot) > 0)) vR -= 1;
        this.ExchangeItems(vL,vR);
        if (Pivot === vL) {
          Pivot = vR}
         else if (Pivot === vR) Pivot = vL;
      };
      if ((Pivot - 1) >= L) this.QuickSort(L,Pivot - 1,CompareFn);
      if ((Pivot + 1) <= R) this.QuickSort(Pivot + 1,R,CompareFn);
    };
    this.SetSorted = function (Value) {
      if (Value) {
        this.SetSortStyle($mod.TStringsSortStyle.sslAuto)}
       else this.SetSortStyle($mod.TStringsSortStyle.sslNone);
    };
    this.SetCaseSensitive = function (b) {
      if (b === this.FCaseSensitive) return;
      this.FCaseSensitive = b;
      if (this.FSortStyle === $mod.TStringsSortStyle.sslAuto) {
        this.FForceSort = true;
        try {
          this.Sort();
        } finally {
          this.FForceSort = false;
        };
      };
    };
    this.SetSortStyle = function (AValue) {
      if (this.FSortStyle === AValue) return;
      if (AValue === $mod.TStringsSortStyle.sslAuto) this.Sort();
      this.FSortStyle = AValue;
    };
    this.GetTrailingLineBreak = function () {
      var Result = false;
      Result = !this.GetSkipLastLineBreak();
      return Result;
    };
    this.SetTrailingLineBreak = function (Value) {
      this.SetSkipLastLineBreak(!Value);
    };
    this.CheckIndex = function (AIndex) {
      if ((AIndex < 0) || (AIndex >= this.FCount)) this.Error(rtl.getResStr(pas.RTLConsts,"SListIndexError"),AIndex);
    };
    this.ExchangeItems = function (Index1, Index2) {
      this.ExchangeItemsInt(Index1,Index2);
    };
    this.Changed = function () {
      if (this.FUpdateCount === 0) {
        if (this.FOnChange != null) this.FOnChange(this);
      };
    };
    this.Changing = function () {
      if (this.FUpdateCount === 0) if (this.FOnChanging != null) this.FOnChanging(this);
    };
    this.Get = function (Index) {
      var Result = "";
      this.CheckIndex(Index);
      Result = this.FList[Index].FString;
      return Result;
    };
    this.GetCapacity = function () {
      var Result = 0;
      Result = rtl.length(this.FList);
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FCount;
      return Result;
    };
    this.GetObject = function (Index) {
      var Result = null;
      this.CheckIndex(Index);
      Result = this.FList[Index].FObject;
      return Result;
    };
    this.Put = function (Index, S) {
      if (this.GetSorted()) this.Error(rtl.getResStr(pas.RTLConsts,"SSortedListError"),0);
      this.CheckIndex(Index);
      this.Changing();
      this.FList[Index].FString = S;
      this.Changed();
    };
    this.PutObject = function (Index, AObject) {
      this.CheckIndex(Index);
      this.Changing();
      this.FList[Index].FObject = AObject;
      this.Changed();
    };
    this.SetCapacity = function (NewCapacity) {
      if (NewCapacity < 0) this.Error(rtl.getResStr(pas.RTLConsts,"SListCapacityError"),NewCapacity);
      if (NewCapacity !== this.GetCapacity()) this.FList = rtl.arraySetLength(this.FList,$mod.TStringItem,NewCapacity);
    };
    this.SetUpdateState = function (Updating) {
      if (Updating) {
        this.Changing()}
       else this.Changed();
    };
    this.InsertItem = function (Index, S) {
      this.InsertItem$1(Index,S,null);
    };
    this.InsertItem$1 = function (Index, S, O) {
      var It = $mod.TStringItem.$new();
      this.Changing();
      if (this.FCount === this.GetCapacity()) this.Grow();
      It.FString = S;
      It.FObject = O;
      this.FList.splice(Index,0,It);
      this.FCount += 1;
      this.Changed();
    };
    this.DoCompareText = function (s1, s2) {
      var Result = 0;
      Result = this.CompareStrings(s1,s2);
      return Result;
    };
    this.CompareStrings = function (s1, s2) {
      var Result = 0;
      if (this.FCaseSensitive) {
        Result = pas.SysUtils.CompareStr(s1,s2)}
       else Result = pas.SysUtils.CompareText(s1,s2);
      return Result;
    };
    this.Create$2 = function (AOwnsObjects) {
      $mod.TStrings.Create$1.call(this);
      this.FOwnsObjects = AOwnsObjects;
      return this;
    };
    this.Create$3 = function (AQuoteChar, ADelimiter) {
      $mod.TStrings.Create$1.call(this);
      this.SetQuoteChar(AQuoteChar);
      this.SetDelimiter(ADelimiter);
      return this;
    };
    this.Create$4 = function (AQuoteChar, ADelimiter, AOptions) {
      $mod.TStrings.Create$1.call(this);
      this.SetQuoteChar(AQuoteChar);
      this.SetDelimiter(ADelimiter);
      this.FStrictDelimiter = $mod.TStringsOption.soStrictDelimiter in AOptions;
      return this;
    };
    this.Create$5 = function (ADuplicates, ASorted, ACaseSensitive) {
      $mod.TStrings.Create$1.call(this);
      this.FDuplicates = ADuplicates;
      this.SetSorted(ASorted);
      this.SetCaseSensitive(ACaseSensitive);
      return this;
    };
    this.Destroy = function () {
      this.InternalClear(0,false);
      $mod.TStrings.Destroy.call(this);
    };
    this.Add = function (S) {
      var Result = 0;
      if (!(this.FSortStyle === $mod.TStringsSortStyle.sslAuto)) {
        Result = this.FCount}
       else if (this.Find(S,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }})) {
        var $tmp = this.FDuplicates;
        if ($tmp === pas.Types.TDuplicates.dupIgnore) {
          return Result}
         else if ($tmp === pas.Types.TDuplicates.dupError) this.Error(rtl.getResStr(pas.RTLConsts,"SDuplicateString"),0);
      };
      this.InsertItem(Result,S);
      return Result;
    };
    this.Clear = function () {
      if (this.FCount === 0) return;
      this.Changing();
      this.InternalClear(0,false);
      this.Changed();
    };
    this.Delete = function (Index) {
      this.CheckIndex(Index);
      this.Changing();
      if (this.FOwnsObjects) pas.SysUtils.FreeAndNil({p: this.FList[Index], get: function () {
          return this.p.FObject;
        }, set: function (v) {
          this.p.FObject = v;
        }});
      this.FList.splice(Index,1);
      this.FList[this.GetCount() - 1].FString = "";
      this.FList[this.GetCount() - 1].FObject = null;
      this.FCount -= 1;
      this.Changed();
    };
    this.Exchange = function (Index1, Index2) {
      this.CheckIndex(Index1);
      this.CheckIndex(Index2);
      this.Changing();
      this.ExchangeItemsInt(Index1,Index2);
      this.Changed();
    };
    this.Find = function (S, Index) {
      var Result = false;
      var L = 0;
      var R = 0;
      var I = 0;
      var CompareRes = 0;
      Result = false;
      Index.set(-1);
      if (!this.GetSorted()) throw $mod.EListError.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SErrFindNeedsSortedList")]);
      L = 0;
      R = this.GetCount() - 1;
      while (L <= R) {
        I = L + rtl.trunc((R - L) / 2);
        CompareRes = this.DoCompareText(S,this.FList[I].FString);
        if (CompareRes > 0) {
          L = I + 1}
         else {
          R = I - 1;
          if (CompareRes === 0) {
            Result = true;
            if (this.FDuplicates !== pas.Types.TDuplicates.dupAccept) L = I;
          };
        };
      };
      Index.set(L);
      return Result;
    };
    this.IndexOf = function (S) {
      var Result = 0;
      if (!this.GetSorted()) {
        Result = $mod.TStrings.IndexOf.call(this,S)}
       else if (!this.Find(S,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }})) Result = -1;
      return Result;
    };
    this.Insert = function (Index, S) {
      if (this.FSortStyle === $mod.TStringsSortStyle.sslAuto) {
        this.Error(rtl.getResStr(pas.RTLConsts,"SSortedListError"),0)}
       else {
        if ((Index < 0) || (Index > this.FCount)) this.Error(rtl.getResStr(pas.RTLConsts,"SListIndexError"),Index);
        this.InsertItem(Index,S);
      };
    };
    this.Sort = function () {
      this.CustomSort($impl.StringListAnsiCompare);
    };
    this.CustomSort = function (CompareFn) {
      if ((this.FForceSort || !(this.FSortStyle === $mod.TStringsSortStyle.sslAuto)) && (this.FCount > 1)) {
        this.Changing();
        this.QuickSort(0,this.FCount - 1,CompareFn);
        this.Changed();
      };
    };
  });
  this.$rtti.$Class("TCollection");
  rtl.createClass(this,"TCollectionItem",this.TPersistent,function () {
    this.$init = function () {
      $mod.TPersistent.$init.call(this);
      this.FCollection = null;
      this.FID = 0;
      this.FUpdateCount = 0;
    };
    this.$final = function () {
      this.FCollection = undefined;
      $mod.TPersistent.$final.call(this);
    };
    this.GetIndex = function () {
      var Result = 0;
      if (this.FCollection != null) {
        Result = this.FCollection.FItems.IndexOf(this)}
       else Result = -1;
      return Result;
    };
    this.SetCollection = function (Value) {
      if (Value !== this.FCollection) {
        if (this.FCollection != null) this.FCollection.RemoveItem(this);
        if (Value != null) Value.InsertItem(this);
      };
    };
    this.Changed = function (AllItems) {
      if ((this.FCollection !== null) && (this.FCollection.FUpdateCount === 0)) {
        if (AllItems) {
          this.FCollection.Update(null)}
         else this.FCollection.Update(this);
      };
    };
    this.GetOwner = function () {
      var Result = null;
      Result = this.FCollection;
      return Result;
    };
    this.GetDisplayName = function () {
      var Result = "";
      Result = this.$classname;
      return Result;
    };
    this.SetIndex = function (Value) {
      var Temp = 0;
      Temp = this.GetIndex();
      if ((Temp > -1) && (Temp !== Value)) {
        this.FCollection.FItems.Move(Temp,Value);
        this.Changed(true);
      };
    };
    this.SetDisplayName = function (Value) {
      this.Changed(false);
      if (Value === "") ;
    };
    this.Create$1 = function (ACollection) {
      pas.System.TObject.Create.call(this);
      this.SetCollection(ACollection);
      return this;
    };
    this.Destroy = function () {
      this.SetCollection(null);
      pas.System.TObject.Destroy.call(this);
    };
    this.GetNamePath = function () {
      var Result = "";
      if (this.FCollection !== null) {
        Result = this.FCollection.GetNamePath() + "[" + pas.SysUtils.IntToStr(this.GetIndex()) + "]"}
       else Result = this.$classname;
      return Result;
    };
  });
  rtl.createClass(this,"TCollectionEnumerator",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FCollection = null;
      this.FPosition = 0;
    };
    this.$final = function () {
      this.FCollection = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function (ACollection) {
      pas.System.TObject.Create.call(this);
      this.FCollection = ACollection;
      this.FPosition = -1;
      return this;
    };
    this.GetCurrent = function () {
      var Result = null;
      Result = this.FCollection.GetItem(this.FPosition);
      return Result;
    };
    this.MoveNext = function () {
      var Result = false;
      this.FPosition += 1;
      Result = this.FPosition < this.FCollection.GetCount();
      return Result;
    };
  });
  this.$rtti.$ClassRef("TCollectionItemClass",{instancetype: this.$rtti["TCollectionItem"]});
  this.TCollectionNotification = {"0": "cnAdded", cnAdded: 0, "1": "cnExtracting", cnExtracting: 1, "2": "cnDeleting", cnDeleting: 2};
  this.$rtti.$Enum("TCollectionNotification",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TCollectionNotification});
  this.$rtti.$ProcVar("TCollectionSortCompare",{procsig: rtl.newTIProcSig([["Item1",this.$rtti["TCollectionItem"]],["Item2",this.$rtti["TCollectionItem"]]],rtl.longint)});
  this.$rtti.$RefToProcVar("TCollectionSortCompareFunc",{procsig: rtl.newTIProcSig([["Item1",this.$rtti["TCollectionItem"]],["Item2",this.$rtti["TCollectionItem"]]],rtl.longint)});
  rtl.createClass(this,"TCollection",this.TPersistent,function () {
    this.$init = function () {
      $mod.TPersistent.$init.call(this);
      this.FItemClass = null;
      this.FItems = null;
      this.FUpdateCount = 0;
      this.FNextID = 0;
      this.FPropName = "";
    };
    this.$final = function () {
      this.FItemClass = undefined;
      this.FItems = undefined;
      $mod.TPersistent.$final.call(this);
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FItems.FCount;
      return Result;
    };
    this.GetPropName = function () {
      var Result = "";
      Result = this.FPropName;
      this.SetPropName();
      Result = this.FPropName;
      return Result;
    };
    this.InsertItem = function (Item) {
      if (!this.FItemClass.isPrototypeOf(Item)) return;
      this.FItems.Add(Item);
      Item.FCollection = this;
      Item.FID = this.FNextID;
      this.FNextID += 1;
      this.SetItemName(Item);
      this.Notify(Item,$mod.TCollectionNotification.cnAdded);
      this.Changed();
    };
    this.RemoveItem = function (Item) {
      var I = 0;
      this.Notify(Item,$mod.TCollectionNotification.cnExtracting);
      I = this.FItems.IndexOfItem(Item,pas.Types.TDirection.FromEnd);
      if (I !== -1) this.FItems.Delete(I);
      Item.FCollection = null;
      this.Changed();
    };
    this.DoClear = function () {
      var Item = null;
      while (this.FItems.FCount > 0) {
        Item = rtl.getObject(this.FItems.Last());
        if (Item != null) Item.$destroy("Destroy");
      };
    };
    this.GetAttrCount = function () {
      var Result = 0;
      Result = 0;
      return Result;
    };
    this.GetAttr = function (Index) {
      var Result = "";
      Result = "";
      if (Index === 0) ;
      return Result;
    };
    this.GetItemAttr = function (Index, ItemIndex) {
      var Result = "";
      Result = rtl.getObject(this.FItems.Get(ItemIndex)).GetDisplayName();
      if (Index === 0) ;
      return Result;
    };
    this.Changed = function () {
      if (this.FUpdateCount === 0) this.Update(null);
    };
    this.GetItem = function (Index) {
      var Result = null;
      Result = rtl.getObject(this.FItems.Get(Index));
      return Result;
    };
    this.SetItem = function (Index, Value) {
      rtl.getObject(this.FItems.Get(Index)).Assign(Value);
    };
    this.SetItemName = function (Item) {
      if (Item === null) ;
    };
    this.SetPropName = function () {
      this.FPropName = "";
    };
    this.Update = function (Item) {
      if (Item === null) ;
    };
    this.Notify = function (Item, Action) {
      if (Item === null) ;
      if (Action === $mod.TCollectionNotification.cnAdded) ;
    };
    this.Create$1 = function (AItemClass) {
      pas.System.TObject.Create.call(this);
      this.FItemClass = AItemClass;
      this.FItems = $mod.TFPList.$create("Create");
      return this;
    };
    this.Destroy = function () {
      this.FUpdateCount = 1;
      try {
        this.DoClear();
      } finally {
        this.FUpdateCount = 0;
      };
      if (this.FItems != null) this.FItems.$destroy("Destroy");
      pas.System.TObject.Destroy.call(this);
    };
    this.Owner = function () {
      var Result = null;
      Result = this.GetOwner();
      return Result;
    };
    this.Add = function () {
      var Result = null;
      Result = this.FItemClass.$create("Create$1",[this]);
      return Result;
    };
    this.Assign = function (Source) {
      var I = 0;
      if ($mod.TCollection.isPrototypeOf(Source)) {
        this.Clear();
        for (var $l = 0, $end = Source.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          this.Add().Assign(Source.GetItem(I));
        };
        return;
      } else $mod.TPersistent.Assign.call(this,Source);
    };
    this.BeginUpdate = function () {
      this.FUpdateCount += 1;
    };
    this.Clear = function () {
      if (this.FItems.FCount === 0) return;
      this.BeginUpdate();
      try {
        this.DoClear();
      } finally {
        this.EndUpdate();
      };
    };
    this.EndUpdate = function () {
      if (this.FUpdateCount > 0) this.FUpdateCount -= 1;
      if (this.FUpdateCount === 0) this.Changed();
    };
    this.Delete = function (Index) {
      var Item = null;
      Item = rtl.getObject(this.FItems.Get(Index));
      this.Notify(Item,$mod.TCollectionNotification.cnDeleting);
      if (Item != null) Item.$destroy("Destroy");
    };
    this.GetEnumerator = function () {
      var Result = null;
      Result = $mod.TCollectionEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.GetNamePath = function () {
      var Result = "";
      var o = null;
      o = this.GetOwner();
      if ((o != null) && (this.GetPropName() !== "")) {
        Result = o.GetNamePath() + "." + this.GetPropName()}
       else Result = this.$classname;
      return Result;
    };
    this.Insert = function (Index) {
      var Result = null;
      Result = this.Add();
      Result.SetIndex(Index);
      return Result;
    };
    this.FindItemID = function (ID) {
      var Result = null;
      var I = 0;
      for (var $l = 0, $end = this.FItems.FCount - 1; $l <= $end; $l++) {
        I = $l;
        Result = rtl.getObject(this.FItems.Get(I));
        if (Result.FID === ID) return Result;
      };
      Result = null;
      return Result;
    };
    this.Exchange = function (Index1, index2) {
      this.FItems.Exchange(Index1,index2);
    };
    this.Sort = function (Compare) {
      this.BeginUpdate();
      try {
        this.FItems.Sort(Compare);
      } finally {
        this.EndUpdate();
      };
    };
    this.SortList = function (Compare) {
      this.BeginUpdate();
      try {
        this.FItems.SortList(Compare);
      } finally {
        this.EndUpdate();
      };
    };
  });
  rtl.createClass(this,"TOwnedCollection",this.TCollection,function () {
    this.$init = function () {
      $mod.TCollection.$init.call(this);
      this.FOwner = null;
    };
    this.$final = function () {
      this.FOwner = undefined;
      $mod.TCollection.$final.call(this);
    };
    this.GetOwner = function () {
      var Result = null;
      Result = this.FOwner;
      return Result;
    };
    this.Create$2 = function (AOwner, AItemClass) {
      this.FOwner = AOwner;
      $mod.TCollection.Create$1.call(this,AItemClass);
      return this;
    };
  });
  this.$rtti.$Class("TComponent");
  this.TOperation = {"0": "opInsert", opInsert: 0, "1": "opRemove", opRemove: 1};
  this.$rtti.$Enum("TOperation",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TOperation});
  this.TComponentStateItem = {"0": "csLoading", csLoading: 0, "1": "csReading", csReading: 1, "2": "csWriting", csWriting: 2, "3": "csDestroying", csDestroying: 3, "4": "csDesigning", csDesigning: 4, "5": "csAncestor", csAncestor: 5, "6": "csUpdating", csUpdating: 6, "7": "csFixups", csFixups: 7, "8": "csFreeNotification", csFreeNotification: 8, "9": "csInline", csInline: 9, "10": "csDesignInstance", csDesignInstance: 10};
  this.$rtti.$Enum("TComponentStateItem",{minvalue: 0, maxvalue: 10, ordtype: 1, enumtype: this.TComponentStateItem});
  this.$rtti.$Set("TComponentState",{comptype: this.$rtti["TComponentStateItem"]});
  this.TComponentStyleItem = {"0": "csInheritable", csInheritable: 0, "1": "csCheckPropAvail", csCheckPropAvail: 1, "2": "csSubComponent", csSubComponent: 2, "3": "csTransient", csTransient: 3};
  this.$rtti.$Enum("TComponentStyleItem",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TComponentStyleItem});
  this.$rtti.$Set("TComponentStyle",{comptype: this.$rtti["TComponentStyleItem"]});
  this.$rtti.$MethodVar("TGetChildProc",{procsig: rtl.newTIProcSig([["Child",this.$rtti["TComponent"]]]), methodkind: 0});
  this.$rtti.$inherited("TComponentName",rtl.string,{});
  rtl.createClass(this,"TComponentEnumerator",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FComponent = null;
      this.FPosition = 0;
    };
    this.$final = function () {
      this.FComponent = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function (AComponent) {
      pas.System.TObject.Create.call(this);
      this.FComponent = AComponent;
      this.FPosition = -1;
      return this;
    };
    this.GetCurrent = function () {
      var Result = null;
      Result = this.FComponent.GetComponent(this.FPosition);
      return Result;
    };
    this.MoveNext = function () {
      var Result = false;
      this.FPosition += 1;
      Result = this.FPosition < this.FComponent.GetComponentCount();
      return Result;
    };
  });
  rtl.createClass(this,"TComponent",this.TPersistent,function () {
    this.$init = function () {
      $mod.TPersistent.$init.call(this);
      this.FOwner = null;
      this.FName = "";
      this.FTag = 0;
      this.FComponents = null;
      this.FFreeNotifies = null;
      this.FDesignInfo = 0;
      this.FComponentState = {};
      this.FComponentStyle = {};
      this.FLeft = 0;
      this.FTop = 0;
    };
    this.$final = function () {
      this.FOwner = undefined;
      this.FComponents = undefined;
      this.FFreeNotifies = undefined;
      this.FComponentState = undefined;
      this.FComponentStyle = undefined;
      $mod.TPersistent.$final.call(this);
    };
    this.GetComponent = function (AIndex) {
      var Result = null;
      if (!(this.FComponents != null)) {
        Result = null}
       else Result = rtl.getObject(this.FComponents.Get(AIndex));
      return Result;
    };
    this.GetComponentCount = function () {
      var Result = 0;
      if (!(this.FComponents != null)) {
        Result = 0}
       else Result = this.FComponents.FCount;
      return Result;
    };
    this.GetComponentIndex = function () {
      var Result = 0;
      if ((this.FOwner != null) && (this.FOwner.FComponents != null)) {
        Result = this.FOwner.FComponents.IndexOf(this)}
       else Result = -1;
      return Result;
    };
    this.Insert = function (AComponent) {
      if (!(this.FComponents != null)) this.FComponents = $mod.TFPList.$create("Create");
      this.FComponents.Add(AComponent);
      AComponent.FOwner = this;
    };
    this.ReadLeft = function (AReader) {
      this.FDesignInfo = (this.FDesignInfo & 0xffff0000) | (AReader.ReadInteger() & 0xffff);
    };
    this.ReadTop = function (AReader) {
      this.FDesignInfo = ((AReader.ReadInteger() & 0xffff) << 16) | (this.FDesignInfo & 0xffff);
    };
    this.Remove = function (AComponent) {
      AComponent.FOwner = null;
      if (this.FComponents != null) {
        this.FComponents.Remove(AComponent);
        if (this.FComponents.FCount === 0) {
          this.FComponents.$destroy("Destroy");
          this.FComponents = null;
        };
      };
    };
    this.RemoveNotification = function (AComponent) {
      if (this.FFreeNotifies !== null) {
        this.FFreeNotifies.Remove(AComponent);
        if (this.FFreeNotifies.FCount === 0) {
          this.FFreeNotifies.$destroy("Destroy");
          this.FFreeNotifies = null;
          this.FComponentState = rtl.excludeSet(this.FComponentState,$mod.TComponentStateItem.csFreeNotification);
        };
      };
    };
    this.SetComponentIndex = function (Value) {
      var Temp = 0;
      var Count = 0;
      if (!(this.FOwner != null)) return;
      Temp = this.GetComponentIndex();
      if (Temp < 0) return;
      if (Value < 0) Value = 0;
      Count = this.FOwner.FComponents.FCount;
      if (Value >= Count) Value = Count - 1;
      if (Value !== Temp) {
        this.FOwner.FComponents.Delete(Temp);
        this.FOwner.FComponents.Insert(Value,this);
      };
    };
    this.SetReference = function (Enable) {
      var aField = null;
      var aValue = null;
      var aOwner = null;
      if (this.FName === "") return;
      if (this.FOwner != null) {
        aOwner = this.FOwner;
        aField = this.FOwner.$class.FieldAddress(this.FName);
        if (aField != null) {
          if (Enable) {
            aValue = this}
           else aValue = null;
          aOwner["" + aField["name"]] = aValue;
        };
      };
    };
    this.WriteLeft = function (AWriter) {
      AWriter.WriteInteger(this.FDesignInfo & 0xffff);
    };
    this.WriteTop = function (AWriter) {
      AWriter.WriteInteger((this.FDesignInfo >>> 16) & 0xffff);
    };
    this.ChangeName = function (NewName) {
      this.FName = NewName;
    };
    this.DefineProperties = function (Filer) {
      var Temp = 0;
      var Ancestor = null;
      Ancestor = Filer.FAncestor;
      if (Ancestor != null) {
        Temp = Ancestor.FDesignInfo}
       else Temp = 0;
      Filer.DefineProperty("Left",rtl.createCallback(this,"ReadLeft"),rtl.createCallback(this,"WriteLeft"),(this.FDesignInfo & 0xffff) !== (Temp & 0xffff));
      Filer.DefineProperty("Top",rtl.createCallback(this,"ReadTop"),rtl.createCallback(this,"WriteTop"),(this.FDesignInfo & 0xffff0000) !== (Temp & 0xffff0000));
    };
    this.GetChildren = function (Proc, Root) {
      if (Proc === null) ;
      if (Root === null) ;
    };
    this.GetChildOwner = function () {
      var Result = null;
      Result = null;
      return Result;
    };
    this.GetChildParent = function () {
      var Result = null;
      Result = this;
      return Result;
    };
    this.GetOwner = function () {
      var Result = null;
      Result = this.FOwner;
      return Result;
    };
    this.Loaded = function () {
      this.FComponentState = rtl.excludeSet(this.FComponentState,$mod.TComponentStateItem.csLoading);
    };
    this.Loading = function () {
      this.FComponentState = rtl.includeSet(this.FComponentState,$mod.TComponentStateItem.csLoading);
    };
    this.SetWriting = function (Value) {
      if (Value) {
        this.FComponentState = rtl.includeSet(this.FComponentState,$mod.TComponentStateItem.csWriting)}
       else this.FComponentState = rtl.excludeSet(this.FComponentState,$mod.TComponentStateItem.csWriting);
    };
    this.SetReading = function (Value) {
      if (Value) {
        this.FComponentState = rtl.includeSet(this.FComponentState,$mod.TComponentStateItem.csReading)}
       else this.FComponentState = rtl.excludeSet(this.FComponentState,$mod.TComponentStateItem.csReading);
    };
    this.Notification = function (AComponent, Operation) {
      var C = 0;
      if (Operation === $mod.TOperation.opRemove) this.RemoveFreeNotification(AComponent);
      if (!(this.FComponents != null)) return;
      C = this.FComponents.FCount - 1;
      while (C >= 0) {
        rtl.getObject(this.FComponents.Get(C)).Notification(AComponent,Operation);
        C -= 1;
        if (C >= this.FComponents.FCount) C = this.FComponents.FCount - 1;
      };
    };
    this.PaletteCreated = function () {
    };
    this.ReadState = function (Reader) {
      Reader.ReadData(this);
    };
    this.SetAncestor = function (Value) {
      var Runner = 0;
      if (Value) {
        this.FComponentState = rtl.includeSet(this.FComponentState,$mod.TComponentStateItem.csAncestor)}
       else this.FComponentState = rtl.excludeSet(this.FComponentState,$mod.TComponentStateItem.csAncestor);
      if (this.FComponents != null) for (var $l = 0, $end = this.FComponents.FCount - 1; $l <= $end; $l++) {
        Runner = $l;
        rtl.getObject(this.FComponents.Get(Runner)).SetAncestor(Value);
      };
    };
    this.SetDesigning = function (Value, SetChildren) {
      var Runner = 0;
      if (Value) {
        this.FComponentState = rtl.includeSet(this.FComponentState,$mod.TComponentStateItem.csDesigning)}
       else this.FComponentState = rtl.excludeSet(this.FComponentState,$mod.TComponentStateItem.csDesigning);
      if ((this.FComponents != null) && SetChildren) for (var $l = 0, $end = this.FComponents.FCount - 1; $l <= $end; $l++) {
        Runner = $l;
        rtl.getObject(this.FComponents.Get(Runner)).SetDesigning(Value,true);
      };
    };
    this.SetDesignInstance = function (Value) {
      if (Value) {
        this.FComponentState = rtl.includeSet(this.FComponentState,$mod.TComponentStateItem.csDesignInstance)}
       else this.FComponentState = rtl.excludeSet(this.FComponentState,$mod.TComponentStateItem.csDesignInstance);
    };
    this.SetInline = function (Value) {
      if (Value) {
        this.FComponentState = rtl.includeSet(this.FComponentState,$mod.TComponentStateItem.csInline)}
       else this.FComponentState = rtl.excludeSet(this.FComponentState,$mod.TComponentStateItem.csInline);
    };
    this.SetName = function (NewName) {
      if (this.FName === NewName) return;
      if ((NewName !== "") && !pas.SysUtils.IsValidIdent(NewName,false,false)) throw $mod.EComponentError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SInvalidName"),pas.System.VarRecs(18,NewName)]);
      if (this.FOwner != null) {
        this.FOwner.ValidateRename(this,this.FName,NewName)}
       else this.ValidateRename(null,this.FName,NewName);
      this.SetReference(false);
      this.ChangeName(NewName);
      this.SetReference(true);
    };
    this.SetChildOrder = function (Child, Order) {
      if (Child === null) ;
      if (Order === 0) ;
    };
    this.SetParentComponent = function (Value) {
      if (Value === null) ;
    };
    this.Updating = function () {
      this.FComponentState = rtl.includeSet(this.FComponentState,$mod.TComponentStateItem.csUpdating);
    };
    this.Updated = function () {
      this.FComponentState = rtl.excludeSet(this.FComponentState,$mod.TComponentStateItem.csUpdating);
    };
    this.ValidateRename = function (AComponent, CurName, NewName) {
      if ((AComponent !== null) && (pas.SysUtils.CompareText(CurName,NewName) !== 0) && (AComponent.FOwner === this) && (this.FindComponent(NewName) !== null)) throw $mod.EComponentError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SDuplicateName"),pas.System.VarRecs(18,NewName)]);
      if (($mod.TComponentStateItem.csDesigning in this.FComponentState) && (this.FOwner !== null)) this.FOwner.ValidateRename(AComponent,CurName,NewName);
    };
    this.ValidateContainer = function (AComponent) {
      AComponent.ValidateInsert(this);
    };
    this.ValidateInsert = function (AComponent) {
      if (AComponent === null) ;
    };
    this._AddRef = function () {
      var Result = 0;
      Result = -1;
      return Result;
    };
    this.GetLeft = function () {
      var Result = 0;
      Result = this.FLeft;
      return Result;
    };
    this.GetTop = function () {
      var Result = 0;
      Result = this.FTop;
      return Result;
    };
    this.SetLeft = function (AValue) {
      this.FLeft = AValue;
    };
    this.SetTop = function (AValue) {
      this.FTop = AValue;
    };
    this._Release = function () {
      var Result = 0;
      Result = -1;
      return Result;
    };
    this.Create$1 = function (AOwner) {
      this.FComponentStyle = rtl.createSet($mod.TComponentStyleItem.csInheritable);
      if (AOwner != null) AOwner.InsertComponent(this);
      return this;
    };
    this.Destroy = function () {
      var I = 0;
      var C = null;
      this.Destroying();
      if (this.FFreeNotifies != null) {
        I = this.FFreeNotifies.FCount - 1;
        while (I >= 0) {
          C = rtl.getObject(this.FFreeNotifies.Get(I));
          this.FFreeNotifies.Delete(I);
          C.Notification(this,$mod.TOperation.opRemove);
          if (this.FFreeNotifies === null) {
            I = 0}
           else if (I > this.FFreeNotifies.FCount) I = this.FFreeNotifies.FCount;
          I -= 1;
        };
        pas.SysUtils.FreeAndNil({p: this, get: function () {
            return this.p.FFreeNotifies;
          }, set: function (v) {
            this.p.FFreeNotifies = v;
          }});
      };
      this.DestroyComponents();
      if (this.FOwner !== null) this.FOwner.RemoveComponent(this);
      pas.System.TObject.Destroy.call(this);
    };
    this.BeforeDestruction = function () {
      if (!($mod.TComponentStateItem.csDestroying in this.FComponentState)) this.Destroying();
    };
    this.DestroyComponents = function () {
      var acomponent = null;
      while (this.FComponents != null) {
        acomponent = rtl.getObject(this.FComponents.Last());
        this.Remove(acomponent);
        acomponent.$destroy("Destroy");
      };
    };
    this.Destroying = function () {
      var Runner = 0;
      if ($mod.TComponentStateItem.csDestroying in this.FComponentState) return;
      this.FComponentState = rtl.includeSet(this.FComponentState,$mod.TComponentStateItem.csDestroying);
      if (this.FComponents != null) for (var $l = 0, $end = this.FComponents.FCount - 1; $l <= $end; $l++) {
        Runner = $l;
        rtl.getObject(this.FComponents.Get(Runner)).Destroying();
      };
    };
    this.QueryInterface = function (IID, Obj) {
      var Result = 0;
      if (this.GetInterface(IID,Obj)) {
        Result = 0}
       else Result = -2147467262;
      return Result;
    };
    this.AfterLoadDFMValues = function () {
      this.EndUpdate();
      this.Loaded();
    };
    this.BeforeLoadDFMValues = function () {
      if (!($mod.TComponentStateItem.csDesigning in this.FComponentState)) this.Loading();
      this.BeginUpdate();
    };
    this.BeginUpdate = function () {
    };
    this.EndUpdate = function () {
    };
    this.WriteState = function (Writer) {
      Writer.WriteComponentData(this);
    };
    this.FindComponent = function (AName) {
      var Result = null;
      var I = 0;
      Result = null;
      if ((AName === "") || !(this.FComponents != null)) return Result;
      for (var $l = 0, $end = this.FComponents.FCount - 1; $l <= $end; $l++) {
        I = $l;
        if (pas.SysUtils.CompareText(rtl.getObject(this.FComponents.Get(I)).FName,AName) === 0) {
          Result = rtl.getObject(this.FComponents.Get(I));
          return Result;
        };
      };
      return Result;
    };
    this.FreeNotification = function (AComponent) {
      if ((this.FOwner !== null) && (AComponent === this.FOwner)) return;
      if (!(this.FFreeNotifies != null)) this.FFreeNotifies = $mod.TFPList.$create("Create");
      if (this.FFreeNotifies.IndexOf(AComponent) === -1) {
        this.FFreeNotifies.Add(AComponent);
        AComponent.FreeNotification(this);
      };
    };
    this.RemoveFreeNotification = function (AComponent) {
      this.RemoveNotification(AComponent);
      AComponent.RemoveNotification(this);
    };
    this.GetNamePath = function () {
      var Result = "";
      Result = this.FName;
      return Result;
    };
    this.GetParentComponent = function () {
      var Result = null;
      Result = null;
      return Result;
    };
    this.HasParent = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    this.InsertComponent = function (AComponent) {
      AComponent.ValidateContainer(this);
      this.ValidateRename(AComponent,"",AComponent.FName);
      if (AComponent.FOwner !== null) AComponent.FOwner.RemoveComponent(AComponent);
      this.Insert(AComponent);
      if ($mod.TComponentStateItem.csDesigning in this.FComponentState) AComponent.SetDesigning(true,true);
      this.Notification(AComponent,$mod.TOperation.opInsert);
    };
    this.RemoveComponent = function (AComponent) {
      this.Notification(AComponent,$mod.TOperation.opRemove);
      this.Remove(AComponent);
      AComponent.SetDesigning(false,true);
      this.ValidateRename(AComponent,AComponent.FName,"");
    };
    this.SetSubComponent = function (ASubComponent) {
      if (ASubComponent) {
        this.FComponentStyle = rtl.includeSet(this.FComponentStyle,$mod.TComponentStyleItem.csSubComponent)}
       else this.FComponentStyle = rtl.excludeSet(this.FComponentStyle,$mod.TComponentStyleItem.csSubComponent);
    };
    this.GetEnumerator = function () {
      var Result = null;
      Result = $mod.TComponentEnumerator.$create("Create$1",[this]);
      return Result;
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Name",6,$mod.$rtti["TComponentName"],"FName","SetName");
    $r.addProperty("Tag",0,rtl.nativeint,"FTag","FTag",4,{Default: 0});
  });
  this.$rtti.$ClassRef("TComponentClass",{instancetype: this.$rtti["TComponent"]});
  this.TSeekOrigin = {"0": "soBeginning", soBeginning: 0, "1": "soCurrent", soCurrent: 1, "2": "soEnd", soEnd: 2};
  this.$rtti.$Enum("TSeekOrigin",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TSeekOrigin});
  rtl.createClass(this,"TStream",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FEndian = 0;
    };
    this.MakeInt = function (B, aSize, Signed) {
      var Result = 0;
      var Mem = null;
      var A = null;
      var D = null;
      var isLittle = false;
      isLittle = this.FEndian === pas.SysUtils.TEndian.Little;
      Mem = new ArrayBuffer(rtl.length(B));
      A = new Uint8Array(Mem);
      A.set(B);
      D = new DataView(Mem);
      if (Signed) {
        var $tmp = aSize;
        if ($tmp === 1) {
          Result = D.getInt8(0)}
         else if ($tmp === 2) {
          Result = D.getInt16(0,isLittle)}
         else if ($tmp === 4) {
          Result = D.getInt32(0,isLittle)}
         else if ($tmp === 8) Result = Math.round(D.getFloat64(0,isLittle));
      } else {
        var $tmp1 = aSize;
        if ($tmp1 === 1) {
          Result = D.getUint8(0)}
         else if ($tmp1 === 2) {
          Result = D.getUint16(0,isLittle)}
         else if ($tmp1 === 4) {
          Result = D.getUint32(0,isLittle)}
         else if ($tmp1 === 8) Result = Math.round(D.getFloat64(0,isLittle));
      };
      return Result;
    };
    this.MakeBytes = function (B, aSize, Signed) {
      var Result = [];
      var Mem = null;
      var A = null;
      var D = null;
      var isLittle = false;
      isLittle = this.FEndian === pas.SysUtils.TEndian.Little;
      Mem = new ArrayBuffer(aSize);
      D = new DataView(Mem);
      if (Signed) {
        var $tmp = aSize;
        if ($tmp === 1) {
          D.setInt8(0,B)}
         else if ($tmp === 2) {
          D.setInt16(0,B,isLittle)}
         else if ($tmp === 4) {
          D.setInt32(0,B,isLittle)}
         else if ($tmp === 8) D.setFloat64(0,B,isLittle);
      } else {
        var $tmp1 = aSize;
        if ($tmp1 === 1) {
          D.setUint8(0,B)}
         else if ($tmp1 === 2) {
          D.setUint16(0,B,isLittle)}
         else if ($tmp1 === 4) {
          D.setUint32(0,B,isLittle)}
         else if ($tmp1 === 8) D.setFloat64(0,B,isLittle);
      };
      Result = rtl.arraySetLength(Result,0,aSize);
      A = new Uint8Array(Mem);
      Result = $mod.TMemoryStream.MemoryToBytes$1(A);
      return Result;
    };
    this.InvalidSeek = function () {
      throw $mod.EStreamError.$create("CreateFmt",[rtl.getResStr($mod,"SStreamInvalidSeek"),pas.System.VarRecs(18,this.$classname)]);
    };
    var CSmallSize = 255;
    var CLargeMaxBuffer = 32 * 1024;
    this.Discard = function (Count) {
      var Buffer = [];
      if (Count === 0) return;
      if (Count <= 255) {
        Buffer = rtl.arraySetLength(Buffer,0,255);
        this.ReadBuffer({get: function () {
            return Buffer;
          }, set: function (v) {
            Buffer = v;
          }},Count);
      } else this.DiscardLarge(Count,32768);
    };
    this.DiscardLarge = function (Count, MaxBufferSize) {
      var Buffer = [];
      if (Count === 0) return;
      if (Count > MaxBufferSize) {
        Buffer = rtl.arraySetLength(Buffer,0,MaxBufferSize)}
       else Buffer = rtl.arraySetLength(Buffer,0,Count);
      while (Count >= rtl.length(Buffer)) {
        this.ReadBuffer({get: function () {
            return Buffer;
          }, set: function (v) {
            Buffer = v;
          }},rtl.length(Buffer));
        Count -= rtl.length(Buffer);
      };
      if (Count > 0) this.ReadBuffer({get: function () {
          return Buffer;
        }, set: function (v) {
          Buffer = v;
        }},Count);
    };
    this.FakeSeekForward = function (Offset, Origin, Pos) {
      if (Origin === $mod.TSeekOrigin.soBeginning) Offset -= Pos;
      if ((Offset < 0) || (Origin === $mod.TSeekOrigin.soEnd)) this.InvalidSeek();
      if (Offset > 0) this.Discard(Offset);
    };
    this.GetPosition = function () {
      var Result = 0;
      Result = this.Seek(0,$mod.TSeekOrigin.soCurrent);
      return Result;
    };
    this.SetPosition = function (Pos) {
      this.Seek(Pos,$mod.TSeekOrigin.soBeginning);
    };
    this.GetSize = function () {
      var Result = 0;
      var p = 0;
      p = this.Seek(0,$mod.TSeekOrigin.soCurrent);
      Result = this.Seek(0,$mod.TSeekOrigin.soEnd);
      this.Seek(p,$mod.TSeekOrigin.soBeginning);
      return Result;
    };
    this.SetSize = function (NewSize) {
      if (NewSize < 0) throw $mod.EStreamError.$create("Create$1",[rtl.getResStr($mod,"SerrInvalidStreamSize")]);
    };
    this.SetSize64 = function (NewSize) {
      this.SetSize(NewSize);
    };
    this.ReadNotImplemented = function () {
      throw $mod.EStreamError.$create("CreateFmt",[rtl.getResStr($mod,"SStreamNoReading"),pas.System.VarRecs(18,this.$classname)]);
    };
    this.WriteNotImplemented = function () {
      throw $mod.EStreamError.$create("CreateFmt",[rtl.getResStr($mod,"SStreamNoWriting"),pas.System.VarRecs(18,this.$classname)]);
    };
    this.ReadMaxSizeData = function (Buffer, aSize, aCount) {
      var Result = 0;
      var CP = 0;
      if (aCount <= aSize) {
        Result = this.Read({get: function () {
            return Buffer;
          }, set: function (v) {
            Buffer = v;
          }},aCount)}
       else {
        Result = this.Read({get: function () {
            return Buffer;
          }, set: function (v) {
            Buffer = v;
          }},aSize);
        CP = this.GetPosition();
        Result = (Result + this.Seek(aCount - aSize,$mod.TSeekOrigin.soCurrent)) - CP;
      };
      return Result;
    };
    this.ReadExactSizeData = function (Buffer, aSize, aCount) {
      if (this.ReadMaxSizeData(rtl.arrayRef(Buffer),aSize,aCount) !== aCount) throw $mod.EReadError.$create("Create$1",[rtl.getResStr($mod,"SReadError")]);
    };
    this.WriteMaxSizeData = function (Buffer, aSize, aCount) {
      var Result = 0;
      var CP = 0;
      if (aCount <= aSize) {
        Result = this.Write(Buffer,aCount)}
       else {
        Result = this.Write(Buffer,aSize);
        CP = this.GetPosition();
        Result = (Result + this.Seek(aCount - aSize,$mod.TSeekOrigin.soCurrent)) - CP;
      };
      return Result;
    };
    this.WriteExactSizeData = function (Buffer, aSize, aCount) {
      this.WriteMaxSizeData(Buffer,aSize,aCount);
    };
    this.Read = function (Buffer, Count) {
      var Result = 0;
      Result = this.Read$1(rtl.arrayRef(Buffer.get()),0,Count);
      return Result;
    };
    this.Write = function (Buffer, Count) {
      var Result = 0;
      Result = this.Write$1(Buffer,0,Count);
      return Result;
    };
    this.ReadData = function (Buffer, Count) {
      var Result = 0;
      Result = this.Read$1(rtl.arrayRef(Buffer),0,Count);
      return Result;
    };
    this.ReadData$1 = function (Buffer) {
      var Result = 0;
      var B = 0;
      Result = this.ReadData$8({get: function () {
          return B;
        }, set: function (v) {
          B = v;
        }},1);
      if (Result === 1) Buffer.set(B !== 0);
      return Result;
    };
    this.ReadData$2 = function (Buffer, Count) {
      var Result = 0;
      var B = [];
      B = rtl.arraySetLength(B,0,Count);
      Result = this.ReadMaxSizeData(rtl.arrayRef(B),1,Count);
      if (Result > 0) Buffer.set(B[0] !== 0);
      return Result;
    };
    this.ReadData$3 = function (Buffer) {
      var Result = 0;
      Result = this.ReadData$4(Buffer,2);
      return Result;
    };
    this.ReadData$4 = function (Buffer, Count) {
      var Result = 0;
      var W = 0;
      Result = this.ReadData$12({get: function () {
          return W;
        }, set: function (v) {
          W = v;
        }},Count);
      if (Result === 2) Buffer.set(String.fromCharCode(W));
      return Result;
    };
    this.ReadData$5 = function (Buffer) {
      var Result = 0;
      Result = this.ReadData$6(Buffer,1);
      return Result;
    };
    this.ReadData$6 = function (Buffer, Count) {
      var Result = 0;
      var B = [];
      B = rtl.arraySetLength(B,0,Count);
      Result = this.ReadMaxSizeData(rtl.arrayRef(B),1,Count);
      if (Result >= 1) Buffer.set(this.MakeInt(rtl.arrayRef(B),1,true));
      return Result;
    };
    this.ReadData$7 = function (Buffer) {
      var Result = 0;
      Result = this.ReadData$8(Buffer,1);
      return Result;
    };
    this.ReadData$8 = function (Buffer, Count) {
      var Result = 0;
      var B = [];
      B = rtl.arraySetLength(B,0,Count);
      Result = this.ReadMaxSizeData(rtl.arrayRef(B),1,Count);
      if (Result >= 1) Buffer.set(this.MakeInt(rtl.arrayRef(B),1,false));
      return Result;
    };
    this.ReadData$9 = function (Buffer) {
      var Result = 0;
      Result = this.ReadData$10(Buffer,2);
      return Result;
    };
    this.ReadData$10 = function (Buffer, Count) {
      var Result = 0;
      var B = [];
      B = rtl.arraySetLength(B,0,Count);
      Result = this.ReadMaxSizeData(rtl.arrayRef(B),2,Count);
      if (Result >= 2) Buffer.set(this.MakeInt(rtl.arrayRef(B),2,true));
      return Result;
    };
    this.ReadData$11 = function (Buffer) {
      var Result = 0;
      Result = this.ReadData$12(Buffer,2);
      return Result;
    };
    this.ReadData$12 = function (Buffer, Count) {
      var Result = 0;
      var B = [];
      B = rtl.arraySetLength(B,0,Count);
      Result = this.ReadMaxSizeData(rtl.arrayRef(B),2,Count);
      if (Result >= 2) Buffer.set(this.MakeInt(rtl.arrayRef(B),2,false));
      return Result;
    };
    this.ReadData$13 = function (Buffer) {
      var Result = 0;
      Result = this.ReadData$14(Buffer,4);
      return Result;
    };
    this.ReadData$14 = function (Buffer, Count) {
      var Result = 0;
      var B = [];
      B = rtl.arraySetLength(B,0,Count);
      Result = this.ReadMaxSizeData(rtl.arrayRef(B),4,Count);
      if (Result >= 4) Buffer.set(this.MakeInt(rtl.arrayRef(B),4,true));
      return Result;
    };
    this.ReadData$15 = function (Buffer) {
      var Result = 0;
      Result = this.ReadData$16(Buffer,4);
      return Result;
    };
    this.ReadData$16 = function (Buffer, Count) {
      var Result = 0;
      var B = [];
      B = rtl.arraySetLength(B,0,Count);
      Result = this.ReadMaxSizeData(rtl.arrayRef(B),4,Count);
      if (Result >= 4) Buffer.set(this.MakeInt(rtl.arrayRef(B),4,false));
      return Result;
    };
    this.ReadData$17 = function (Buffer) {
      var Result = 0;
      Result = this.ReadData$18(Buffer,8);
      return Result;
    };
    this.ReadData$18 = function (Buffer, Count) {
      var Result = 0;
      var B = [];
      B = rtl.arraySetLength(B,0,Count);
      Result = this.ReadMaxSizeData(rtl.arrayRef(B),8,8);
      if (Result >= 8) Buffer.set(this.MakeInt(rtl.arrayRef(B),8,true));
      return Result;
    };
    this.ReadData$19 = function (Buffer) {
      var Result = 0;
      Result = this.ReadData$20(Buffer,8);
      return Result;
    };
    this.ReadData$20 = function (Buffer, Count) {
      var Result = 0;
      var B = [];
      var B1 = 0;
      B = rtl.arraySetLength(B,0,Count);
      Result = this.ReadMaxSizeData(rtl.arrayRef(B),4,4);
      if (Result >= 4) {
        B1 = this.MakeInt(rtl.arrayRef(B),4,false);
        Result = Result + this.ReadMaxSizeData(rtl.arrayRef(B),4,4);
        Buffer.set(this.MakeInt(rtl.arrayRef(B),4,false));
        Buffer.set(rtl.or(rtl.shl(Buffer.get(),32),B1));
      };
      return Result;
    };
    this.ReadData$21 = function (Buffer) {
      var Result = 0;
      Result = this.ReadData$22(Buffer,8);
      return Result;
    };
    this.ReadData$22 = function (Buffer, Count) {
      var Result = 0;
      var B = [];
      var Mem = null;
      var A = null;
      var D = null;
      B = rtl.arraySetLength(B,0,Count);
      Result = this.ReadMaxSizeData(rtl.arrayRef(B),8,Count);
      if (Result >= 8) {
        Mem = new ArrayBuffer(8);
        A = new Uint8Array(Mem);
        A.set(B);
        D = new DataView(Mem);
        Buffer.set(D.getFloat64(0));
      };
      return Result;
    };
    this.ReadBuffer = function (Buffer, Count) {
      this.ReadBuffer$1(Buffer,0,Count);
    };
    this.ReadBuffer$1 = function (Buffer, Offset, Count) {
      if (this.Read$1(rtl.arrayRef(Buffer.get()),Offset,Count) !== Count) throw $mod.EStreamError.$create("Create$1",[rtl.getResStr($mod,"SReadError")]);
    };
    this.ReadBufferData = function (Buffer) {
      this.ReadBufferData$1(Buffer,1);
    };
    this.ReadBufferData$1 = function (Buffer, Count) {
      if (this.ReadData$2(Buffer,Count) !== Count) throw $mod.EStreamError.$create("Create$1",[rtl.getResStr($mod,"SReadError")]);
    };
    this.ReadBufferData$2 = function (Buffer) {
      this.ReadBufferData$3(Buffer,2);
    };
    this.ReadBufferData$3 = function (Buffer, Count) {
      if (this.ReadData$4(Buffer,Count) !== Count) throw $mod.EStreamError.$create("Create$1",[rtl.getResStr($mod,"SReadError")]);
    };
    this.ReadBufferData$4 = function (Buffer) {
      this.ReadBufferData$5(Buffer,1);
    };
    this.ReadBufferData$5 = function (Buffer, Count) {
      if (this.ReadData$6(Buffer,Count) !== Count) throw $mod.EStreamError.$create("Create$1",[rtl.getResStr($mod,"SReadError")]);
    };
    this.ReadBufferData$6 = function (Buffer) {
      this.ReadBufferData$7(Buffer,1);
    };
    this.ReadBufferData$7 = function (Buffer, Count) {
      if (this.ReadData$8(Buffer,Count) !== Count) throw $mod.EStreamError.$create("Create$1",[rtl.getResStr($mod,"SReadError")]);
    };
    this.ReadBufferData$8 = function (Buffer) {
      this.ReadBufferData$9(Buffer,2);
    };
    this.ReadBufferData$9 = function (Buffer, Count) {
      if (this.ReadData$10(Buffer,Count) !== Count) throw $mod.EStreamError.$create("Create$1",[rtl.getResStr($mod,"SReadError")]);
    };
    this.ReadBufferData$10 = function (Buffer) {
      this.ReadBufferData$11(Buffer,2);
    };
    this.ReadBufferData$11 = function (Buffer, Count) {
      if (this.ReadData$12(Buffer,Count) !== Count) throw $mod.EStreamError.$create("Create$1",[rtl.getResStr($mod,"SReadError")]);
    };
    this.ReadBufferData$12 = function (Buffer) {
      this.ReadBufferData$13(Buffer,4);
    };
    this.ReadBufferData$13 = function (Buffer, Count) {
      if (this.ReadData$14(Buffer,Count) !== Count) throw $mod.EStreamError.$create("Create$1",[rtl.getResStr($mod,"SReadError")]);
    };
    this.ReadBufferData$14 = function (Buffer) {
      this.ReadBufferData$15(Buffer,4);
    };
    this.ReadBufferData$15 = function (Buffer, Count) {
      if (this.ReadData$16(Buffer,Count) !== Count) throw $mod.EStreamError.$create("Create$1",[rtl.getResStr($mod,"SReadError")]);
    };
    this.ReadBufferData$16 = function (Buffer) {
      this.ReadBufferData$17(Buffer,8);
    };
    this.ReadBufferData$17 = function (Buffer, Count) {
      if (this.ReadData$18(Buffer,Count) !== Count) throw $mod.EStreamError.$create("Create$1",[rtl.getResStr($mod,"SReadError")]);
    };
    this.ReadBufferData$18 = function (Buffer) {
      this.ReadBufferData$19(Buffer,8);
    };
    this.ReadBufferData$19 = function (Buffer, Count) {
      if (this.ReadData$20(Buffer,Count) !== Count) throw $mod.EStreamError.$create("Create$1",[rtl.getResStr($mod,"SReadError")]);
    };
    this.ReadBufferData$20 = function (Buffer) {
      this.ReadBufferData$21(Buffer,8);
    };
    this.ReadBufferData$21 = function (Buffer, Count) {
      if (this.ReadData$22(Buffer,Count) !== Count) throw $mod.EStreamError.$create("Create$1",[rtl.getResStr($mod,"SReadError")]);
    };
    this.WriteBuffer = function (Buffer, Count) {
      this.WriteBuffer$1(Buffer,0,Count);
    };
    this.WriteBuffer$1 = function (Buffer, Offset, Count) {
      if (this.Write$1(Buffer,Offset,Count) !== Count) throw $mod.EStreamError.$create("Create$1",[rtl.getResStr($mod,"SWriteError")]);
    };
    this.WriteData = function (Buffer, Count) {
      var Result = 0;
      Result = this.Write$1(Buffer,0,Count);
      return Result;
    };
    this.WriteData$1 = function (Buffer) {
      var Result = 0;
      Result = this.WriteData$2(Buffer,1);
      return Result;
    };
    this.WriteData$2 = function (Buffer, Count) {
      var Result = 0;
      var B = 0;
      B = Buffer + 0;
      Result = this.WriteData$6(B,Count);
      return Result;
    };
    this.WriteData$3 = function (Buffer) {
      var Result = 0;
      Result = this.WriteData$4(Buffer,2);
      return Result;
    };
    this.WriteData$4 = function (Buffer, Count) {
      var Result = 0;
      var U = 0;
      U = Buffer.charCodeAt();
      Result = this.WriteData$12(U,Count);
      return Result;
    };
    this.WriteData$5 = function (Buffer) {
      var Result = 0;
      Result = this.WriteData$6(Buffer,1);
      return Result;
    };
    this.WriteData$6 = function (Buffer, Count) {
      var Result = 0;
      Result = this.WriteMaxSizeData(this.MakeBytes(Buffer,1,true),1,Count);
      return Result;
    };
    this.WriteData$7 = function (Buffer) {
      var Result = 0;
      Result = this.WriteData$8(Buffer,1);
      return Result;
    };
    this.WriteData$8 = function (Buffer, Count) {
      var Result = 0;
      Result = this.WriteMaxSizeData(this.MakeBytes(Buffer,1,false),1,Count);
      return Result;
    };
    this.WriteData$9 = function (Buffer) {
      var Result = 0;
      Result = this.WriteData$10(Buffer,2);
      return Result;
    };
    this.WriteData$10 = function (Buffer, Count) {
      var Result = 0;
      Result = this.WriteMaxSizeData(this.MakeBytes(Buffer,2,true),2,Count);
      return Result;
    };
    this.WriteData$11 = function (Buffer) {
      var Result = 0;
      Result = this.WriteData$12(Buffer,2);
      return Result;
    };
    this.WriteData$12 = function (Buffer, Count) {
      var Result = 0;
      Result = this.WriteMaxSizeData(this.MakeBytes(Buffer,2,true),2,Count);
      return Result;
    };
    this.WriteData$13 = function (Buffer) {
      var Result = 0;
      Result = this.WriteData$14(Buffer,4);
      return Result;
    };
    this.WriteData$14 = function (Buffer, Count) {
      var Result = 0;
      Result = this.WriteMaxSizeData(this.MakeBytes(Buffer,4,true),4,Count);
      return Result;
    };
    this.WriteData$15 = function (Buffer) {
      var Result = 0;
      Result = this.WriteData$16(Buffer,4);
      return Result;
    };
    this.WriteData$16 = function (Buffer, Count) {
      var Result = 0;
      Result = this.WriteMaxSizeData(this.MakeBytes(Buffer,4,false),4,Count);
      return Result;
    };
    this.WriteData$17 = function (Buffer) {
      var Result = 0;
      Result = this.WriteData$18(Buffer,8);
      return Result;
    };
    this.WriteData$18 = function (Buffer, Count) {
      var Result = 0;
      Result = this.WriteMaxSizeData(this.MakeBytes(Buffer,8,true),8,Count);
      return Result;
    };
    this.WriteData$19 = function (Buffer) {
      var Result = 0;
      Result = this.WriteData$20(Buffer,8);
      return Result;
    };
    this.WriteData$20 = function (Buffer, Count) {
      var Result = 0;
      Result = this.WriteMaxSizeData(this.MakeBytes(Buffer,8,false),8,Count);
      return Result;
    };
    this.WriteData$21 = function (Buffer) {
      var Result = 0;
      Result = this.WriteData$22(Buffer,8);
      return Result;
    };
    this.WriteData$22 = function (Buffer, Count) {
      var Result = 0;
      var Mem = null;
      var A = null;
      var D = null;
      var B = [];
      var I = 0;
      Mem = new ArrayBuffer(8);
      D = new DataView(Mem);
      D.setFloat64(0,Buffer);
      B = rtl.arraySetLength(B,0,8);
      A = new Uint8Array(Mem);
      for (I = 0; I <= 7; I++) B[I] = A[I];
      Result = this.WriteMaxSizeData(B,8,Count);
      return Result;
    };
    this.WriteBufferData = function (Buffer) {
      this.WriteBufferData$1(Buffer,4);
    };
    this.WriteBufferData$1 = function (Buffer, Count) {
      if (this.WriteData$14(Buffer,Count) !== Count) throw $mod.EStreamError.$create("Create$1",[rtl.getResStr($mod,"SWriteError")]);
    };
    this.WriteBufferData$2 = function (Buffer) {
      this.WriteBufferData$3(Buffer,1);
    };
    this.WriteBufferData$3 = function (Buffer, Count) {
      if (this.WriteData$2(Buffer,Count) !== Count) throw $mod.EStreamError.$create("Create$1",[rtl.getResStr($mod,"SWriteError")]);
    };
    this.WriteBufferData$4 = function (Buffer) {
      this.WriteBufferData$5(Buffer,2);
    };
    this.WriteBufferData$5 = function (Buffer, Count) {
      if (this.WriteData$4(Buffer,Count) !== Count) throw $mod.EStreamError.$create("Create$1",[rtl.getResStr($mod,"SWriteError")]);
    };
    this.WriteBufferData$6 = function (Buffer) {
      this.WriteBufferData$7(Buffer,1);
    };
    this.WriteBufferData$7 = function (Buffer, Count) {
      if (this.WriteData$6(Buffer,Count) !== Count) throw $mod.EStreamError.$create("Create$1",[rtl.getResStr($mod,"SWriteError")]);
    };
    this.WriteBufferData$8 = function (Buffer) {
      this.WriteBufferData$9(Buffer,1);
    };
    this.WriteBufferData$9 = function (Buffer, Count) {
      if (this.WriteData$8(Buffer,Count) !== Count) throw $mod.EStreamError.$create("Create$1",[rtl.getResStr($mod,"SWriteError")]);
    };
    this.WriteBufferData$10 = function (Buffer) {
      this.WriteBufferData$11(Buffer,2);
    };
    this.WriteBufferData$11 = function (Buffer, Count) {
      if (this.WriteData$10(Buffer,Count) !== Count) throw $mod.EStreamError.$create("Create$1",[rtl.getResStr($mod,"SWriteError")]);
    };
    this.WriteBufferData$12 = function (Buffer) {
      this.WriteBufferData$13(Buffer,2);
    };
    this.WriteBufferData$13 = function (Buffer, Count) {
      if (this.WriteData$12(Buffer,Count) !== Count) throw $mod.EStreamError.$create("Create$1",[rtl.getResStr($mod,"SWriteError")]);
    };
    this.WriteBufferData$14 = function (Buffer) {
      this.WriteBufferData$15(Buffer,4);
    };
    this.WriteBufferData$15 = function (Buffer, Count) {
      if (this.WriteData$16(Buffer,Count) !== Count) throw $mod.EStreamError.$create("Create$1",[rtl.getResStr($mod,"SWriteError")]);
    };
    this.WriteBufferData$16 = function (Buffer) {
      this.WriteBufferData$17(Buffer,8);
    };
    this.WriteBufferData$17 = function (Buffer, Count) {
      if (this.WriteData$18(Buffer,Count) !== Count) throw $mod.EStreamError.$create("Create$1",[rtl.getResStr($mod,"SWriteError")]);
    };
    this.WriteBufferData$18 = function (Buffer) {
      this.WriteBufferData$19(Buffer,8);
    };
    this.WriteBufferData$19 = function (Buffer, Count) {
      if (this.WriteData$20(Buffer,Count) !== Count) throw $mod.EStreamError.$create("Create$1",[rtl.getResStr($mod,"SWriteError")]);
    };
    this.WriteBufferData$20 = function (Buffer) {
      this.WriteBufferData$21(Buffer,8);
    };
    this.WriteBufferData$21 = function (Buffer, Count) {
      if (this.WriteData$22(Buffer,Count) !== Count) throw $mod.EStreamError.$create("Create$1",[rtl.getResStr($mod,"SWriteError")]);
    };
    var MaxSize = 0x20000;
    this.CopyFrom = function (Source, Count) {
      var Result = 0;
      var Buffer = [];
      var BufferSize = 0;
      var i = 0;
      Result = 0;
      if (Count === 0) Source.SetPosition(0);
      BufferSize = 131072;
      if ((Count > 0) && (Count < BufferSize)) BufferSize = Count;
      Buffer = rtl.arraySetLength(Buffer,0,BufferSize);
      if (Count === 0) {
        do {
          i = Source.Read({get: function () {
              return Buffer;
            }, set: function (v) {
              Buffer = v;
            }},BufferSize);
          if (i > 0) this.WriteBuffer(Buffer,i);
          Result += i;
        } while (!(i < BufferSize))}
       else while (Count > 0) {
        if (Count > BufferSize) {
          i = BufferSize}
         else i = Count;
        Source.ReadBuffer({get: function () {
            return Buffer;
          }, set: function (v) {
            Buffer = v;
          }},i);
        this.WriteBuffer(Buffer,i);
        Count -= i;
        Result += i;
      };
      return Result;
    };
    this.ReadComponent = function (Instance) {
      var Result = null;
      var Reader = null;
      Reader = $mod.TReader.$create("Create$1",[this]);
      try {
        Result = Reader.ReadRootComponent(Instance);
      } finally {
        Reader = rtl.freeLoc(Reader);
      };
      return Result;
    };
    this.ReadComponentRes = function (Instance) {
      var Result = null;
      this.ReadResHeader();
      Result = this.ReadComponent(Instance);
      return Result;
    };
    this.WriteComponent = function (Instance) {
      this.WriteDescendent(Instance,null);
    };
    this.WriteComponentRes = function (ResName, Instance) {
      this.WriteDescendentRes(ResName,Instance,null);
    };
    this.WriteDescendent = function (Instance, Ancestor) {
      var Driver = null;
      var Writer = null;
      Driver = $mod.TBinaryObjectWriter.$create("Create$1",[this]);
      try {
        Writer = $mod.TWriter.$create("Create$1",[Driver]);
        try {
          Writer.WriteDescendent(Instance,Ancestor);
        } finally {
          Writer.$destroy("Destroy");
        };
      } finally {
        Driver = rtl.freeLoc(Driver);
      };
    };
    this.WriteDescendentRes = function (ResName, Instance, Ancestor) {
      var FixupInfo = 0;
      this.WriteResourceHeader(ResName,{get: function () {
          return FixupInfo;
        }, set: function (v) {
          FixupInfo = v;
        }});
      this.WriteDescendent(Instance,Ancestor);
      this.FixupResourceHeader(FixupInfo);
    };
    this.WriteResourceHeader = function (ResName, FixupInfo) {
      var ResType = 0;
      var Flags = 0;
      var B = 0;
      var I = 0;
      ResType = 0xA;
      Flags = 0x1030;
      this.WriteByte(0xff);
      this.WriteWord(ResType);
      for (var $l = 1, $end = ResName.length; $l <= $end; $l++) {
        I = $l;
        B = ResName.charCodeAt(I - 1);
        this.WriteByte(B);
      };
      this.WriteByte(0);
      this.WriteWord(Flags);
      this.WriteDWord(0);
      FixupInfo.set(this.GetPosition());
    };
    this.FixupResourceHeader = function (FixupInfo) {
      var ResSize = 0;
      var TmpResSize = 0;
      ResSize = this.GetPosition() - FixupInfo;
      TmpResSize = ResSize >>> 0;
      this.SetPosition(FixupInfo - 4);
      this.WriteDWord(TmpResSize);
      this.SetPosition(FixupInfo + ResSize);
    };
    this.ReadResHeader = function () {
      var ResType = 0;
      var Flags = 0;
      try {
        if (this.ReadByte() !== 0xff) throw $mod.EInvalidImage.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SInvalidImage")]);
        ResType = this.ReadWord();
        if (ResType !== 0xa) throw $mod.EInvalidImage.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SInvalidImage")]);
        while (this.ReadByte() !== 0) {
        };
        Flags = this.ReadWord();
        if (Flags !== 0x1030) throw $mod.EInvalidImage.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SInvalidImage")]);
        this.ReadDWord();
      } catch ($e) {
        if ($mod.EInvalidImage.isPrototypeOf($e)) {
          throw $e}
         else {
          throw $mod.EInvalidImage.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SInvalidImage")]);
        }
      };
    };
    this.ReadByte = function () {
      var Result = 0;
      this.ReadBufferData$7({get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }},1);
      return Result;
    };
    this.ReadWord = function () {
      var Result = 0;
      this.ReadBufferData$11({get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }},2);
      return Result;
    };
    this.ReadDWord = function () {
      var Result = 0;
      this.ReadBufferData$15({get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }},4);
      return Result;
    };
    this.ReadQWord = function () {
      var Result = 0;
      this.ReadBufferData$19({get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }},8);
      return Result;
    };
    this.WriteByte = function (b) {
      this.WriteBufferData$9(b,1);
    };
    this.WriteWord = function (w) {
      this.WriteBufferData$13(w,2);
    };
    this.WriteDWord = function (d) {
      this.WriteBufferData$15(d,4);
    };
    this.WriteQWord = function (q) {
      this.WriteBufferData$19(q,8);
    };
  });
  rtl.createClass(this,"TCustomMemoryStream",this.TStream,function () {
    this.$init = function () {
      $mod.TStream.$init.call(this);
      this.FMemory = null;
      this.FDataView = null;
      this.FDataArray = null;
      this.FSize = 0;
      this.FPosition = 0;
      this.FSizeBoundsSeek = false;
    };
    this.$final = function () {
      this.FMemory = undefined;
      this.FDataView = undefined;
      this.FDataArray = undefined;
      $mod.TStream.$final.call(this);
    };
    this.GetDataArray = function () {
      var Result = null;
      if (this.FDataArray === null) this.FDataArray = new Uint8Array(this.FMemory);
      Result = this.FDataArray;
      return Result;
    };
    this.GetDataView = function () {
      var Result = null;
      if (this.FDataView === null) this.FDataView = new DataView(this.FMemory);
      Result = this.FDataView;
      return Result;
    };
    this.GetSize = function () {
      var Result = 0;
      Result = this.FSize;
      return Result;
    };
    this.GetPosition = function () {
      var Result = 0;
      Result = this.FPosition;
      return Result;
    };
    this.SetPointer = function (Ptr, ASize) {
      this.FMemory = Ptr;
      this.FSize = ASize;
      this.FDataView = null;
      this.FDataArray = null;
    };
    this.MemoryToBytes = function (Mem) {
      var Result = [];
      Result = this.MemoryToBytes$1(new Uint8Array(Mem));
      return Result;
    };
    this.MemoryToBytes$1 = function (Mem) {
      var Result = [];
      var I = 0;
      for (var $l = 0, $end = Mem.length - 1; $l <= $end; $l++) {
        I = $l;
        Result[I] = Mem[I];
      };
      return Result;
    };
    this.BytesToMemory = function (aBytes) {
      var Result = null;
      var a = null;
      Result = new ArrayBuffer(rtl.length(aBytes));
      a = new Uint8Array(Result);
      a.set(aBytes);
      return Result;
    };
    this.Read$1 = function (Buffer, Offset, Count) {
      var Result = 0;
      var I = 0;
      var Src = 0;
      var Dest = 0;
      Result = 0;
      if ((this.FSize > 0) && (this.FPosition < this.FSize) && (this.FPosition >= 0)) {
        Result = Count;
        if (Result > (this.FSize - this.FPosition)) Result = this.FSize - this.FPosition;
        Src = this.FPosition;
        Dest = Offset;
        I = 0;
        while (I < Result) {
          Buffer[Dest] = this.GetDataView().getUint8(Src);
          Src += 1;
          Dest += 1;
          I += 1;
        };
        this.FPosition = this.FPosition + Result;
      };
      return Result;
    };
    this.Seek = function (Offset, Origin) {
      var Result = 0;
      var $tmp = Origin;
      if ($tmp === $mod.TSeekOrigin.soBeginning) {
        this.FPosition = Offset}
       else if ($tmp === $mod.TSeekOrigin.soEnd) {
        this.FPosition = this.FSize + Offset}
       else if ($tmp === $mod.TSeekOrigin.soCurrent) this.FPosition = this.FPosition + Offset;
      if (this.FSizeBoundsSeek && (this.FPosition > this.FSize)) this.FPosition = this.FSize;
      Result = this.FPosition;
      if (Result < 0) throw pas.SysUtils.Exception.$create("Create$1",["TCustomMemoryStream"]);
      return Result;
    };
    this.SaveToStream = function (Stream) {
      if (this.FSize > 0) Stream.WriteBuffer($mod.TMemoryStream.MemoryToBytes(this.FMemory),this.FSize);
    };
    this.LoadFromURL = function (aURL, Async, OnLoaded, OnError) {
      var $Self = this;
      function DoLoaded(abytes) {
        $Self.SetPointer(abytes,abytes.byteLength);
        if (OnLoaded != null) OnLoaded($Self);
      };
      function DoError(AError) {
        if (OnError != null) {
          OnError($Self,AError)}
         else throw pas.SysUtils.EInOutError.$create("Create$1",["Failed to load from URL:" + AError]);
      };
      $impl.CheckLoadHelper();
      $impl.GlobalLoadHelper.LoadBytes(aURL,Async,DoLoaded,DoError);
    };
    this.LoadFromFile = function (aFileName, OnLoaded, AError) {
      var $Self = this;
      this.LoadFromURL(aFileName,false,function (Sender) {
        if (OnLoaded != null) OnLoaded();
      },function (Sender, ErrorMsg) {
        if (AError != null) AError(ErrorMsg);
      });
    };
  });
  rtl.createClass(this,"TMemoryStream",this.TCustomMemoryStream,function () {
    this.$init = function () {
      $mod.TCustomMemoryStream.$init.call(this);
      this.FCapacity = 0;
    };
    this.SetCapacity = function (NewCapacity) {
      this.SetPointer(this.Realloc({get: function () {
          return NewCapacity;
        }, set: function (v) {
          NewCapacity = v;
        }}),this.FSize);
      this.FCapacity = NewCapacity;
    };
    this.Realloc = function (NewCapacity) {
      var Result = null;
      var GC = 0;
      var DestView = null;
      if (NewCapacity.get() < 0) {
        NewCapacity.set(0)}
       else {
        GC = this.FCapacity + rtl.trunc(this.FCapacity / 4);
        if ((NewCapacity.get() > this.FCapacity) && (NewCapacity.get() < GC)) NewCapacity.set(GC);
        NewCapacity.set((NewCapacity.get() + (4096 - 1)) & ~(4096 - 1));
      };
      if (NewCapacity.get() === this.FCapacity) {
        Result = this.FMemory}
       else if (NewCapacity.get() === 0) {
        Result = null}
       else {
        Result = new ArrayBuffer(NewCapacity.get());
        if (Result === null) throw $mod.EStreamError.$create("Create$1",[rtl.getResStr($mod,"SMemoryStreamError")]);
        DestView = new Uint8Array(Result);
        DestView.set(this.GetDataArray());
      };
      return Result;
    };
    this.Destroy = function () {
      this.Clear();
      pas.System.TObject.Destroy.call(this);
    };
    this.Clear = function () {
      this.FSize = 0;
      this.FPosition = 0;
      this.SetCapacity(0);
    };
    this.LoadFromStream = function (Stream) {
      this.SetPosition(0);
      Stream.SetPosition(0);
      this.SetSize(Stream.GetSize());
      if (this.GetSize() > 0) this.CopyFrom(Stream,0);
    };
    this.SetSize = function (NewSize) {
      this.SetCapacity(NewSize);
      this.FSize = NewSize;
      if (this.FPosition > this.FSize) this.FPosition = this.FSize;
    };
    this.Write$1 = function (Buffer, Offset, Count) {
      var Result = 0;
      var NewPos = 0;
      if ((Count === 0) || (this.FPosition < 0)) return 0;
      NewPos = this.FPosition + Count;
      if (NewPos > this.FSize) {
        if (NewPos > this.FCapacity) this.SetCapacity(NewPos);
        this.FSize = NewPos;
      };
      this.GetDataArray().set(rtl.arrayCopy(0,Buffer,Offset,Count),this.FPosition);
      this.FPosition = NewPos;
      Result = Count;
      return Result;
    };
    this.Write = function (Buffer, Count) {
      var Result = 0;
      Result = this.Write$1(Buffer,0,Count);
      return Result;
    };
  });
  rtl.createClass(this,"TBytesStream",this.TMemoryStream,function () {
    this.GetBytes = function () {
      var Result = [];
      Result = $mod.TMemoryStream.MemoryToBytes(this.FMemory);
      return Result;
    };
    this.Create$1 = function (ABytes) {
      pas.System.TObject.Create.call(this);
      this.SetPointer($mod.TMemoryStream.BytesToMemory(rtl.arrayRef(ABytes)),rtl.length(ABytes));
      this.FCapacity = rtl.length(ABytes);
      return this;
    };
  });
  rtl.createClass(this,"TStringStream",this.TMemoryStream,function () {
    this.$init = function () {
      $mod.TMemoryStream.$init.call(this);
      this.FEncoding = null;
      this.FOwnsEncoding = false;
    };
    this.$final = function () {
      this.FEncoding = undefined;
      $mod.TMemoryStream.$final.call(this);
    };
    var Chunk = 8 * 1024;
    this.GetDataString = function () {
      var Result = "";
      var ua16 = null;
      var ua8 = null;
      var Len = 0;
      var I = 0;
      Result = "";
      if (this.FEncoding === pas.SysUtils.TEncoding.GetUnicode()) {
        ua16 = new Uint16Array(this.FMemory.slice(0,this.GetSize()));
        if (ua16 !== null) {
          Len = rtl.trunc(ua16.length / 8192);
          for (var $l = 0, $end = Len; $l <= $end; $l++) {
            I = $l;
            Result+=String.fromCharCode.apply(null,ua16.slice(I * Chunk, (I + 1) * Chunk));
          };
        };
      } else {
        ua8 = new Uint8Array(this.FMemory.slice(0,this.GetSize()));
        if (ua8 !== null) {
          return ua8.reduce(function (data, byte) {
          return data + String.fromCharCode(byte);
          }, '');
        };
      };
      return Result;
    };
    this.Create$1 = function () {
      this.Create$3("",pas.SysUtils.TEncoding.GetUnicode(),true);
      return this;
    };
    this.Create$2 = function (aString) {
      this.Create$3(aString,pas.SysUtils.TEncoding.GetUnicode(),true);
      return this;
    };
    this.Create$3 = function (AString, AEncoding, AOwnsEncoding) {
      var Len = 0;
      pas.System.TObject.Create.call(this);
      this.FEncoding = AEncoding;
      Len = AString.length;
      if (this.FEncoding === pas.SysUtils.TEncoding.GetUnicode()) {
        this.SetPointer($mod.StringToBuffer$1(AString,Len,this.FEncoding),Len * 2);
        this.FCapacity = Len * 2;
      } else {
        this.SetPointer($mod.StringToBuffer$1(AString,Len,this.FEncoding),Len);
        this.FCapacity = Len;
      };
      return this;
    };
    this.Destroy = function () {
      if (this.FOwnsEncoding) rtl.free(this,"FEncoding");
      $mod.TMemoryStream.Destroy.call(this);
    };
    this.ReadString = function (Count) {
      var Result = "";
      var B = [];
      var Buf = null;
      var BytesLeft = 0;
      BytesLeft = this.GetSize() - this.GetPosition();
      if (this.FEncoding === pas.SysUtils.TEncoding.GetUnicode()) {
        if (BytesLeft < (Count * 2)) Count = BytesLeft;
        B = rtl.arraySetLength(B,0,Count * 2);
        this.ReadBuffer$1({get: function () {
            return B;
          }, set: function (v) {
            B = v;
          }},0,Count * 2);
        Buf = this.$class.BytesToMemory(rtl.arrayRef(B));
        Result = $mod.BufferToString$1(Buf,0,Count * 2,this.FEncoding);
      } else {
        if (BytesLeft < Count) Count = BytesLeft;
        B = rtl.arraySetLength(B,0,Count);
        this.ReadBuffer$1({get: function () {
            return B;
          }, set: function (v) {
            B = v;
          }},0,Count);
        Buf = this.$class.BytesToMemory(rtl.arrayRef(B));
        Result = $mod.BufferToString$1(Buf,0,Count,this.FEncoding);
      };
      return Result;
    };
    this.WriteString = function (AString) {
      var Buf = null;
      var B = [];
      Buf = $mod.StringToBuffer$1(AString,AString.length,this.FEncoding);
      B = this.$class.MemoryToBytes(Buf);
      this.WriteBuffer(B,rtl.length(B));
    };
  });
  rtl.createClass(this,"TResourceStream",this.TCustomMemoryStream,function () {
    this.Initialize = function (aInfo) {
      var Ptr = null;
      var S = "";
      if (aInfo.encoding === "base64") {
        S = atob(aInfo.data)}
       else if (aInfo.encoding === "text") {
        S = aInfo.data}
       else throw pas.SysUtils.ENotSupportedException.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SErrResourceNotBase64"),pas.System.VarRecs(18,aInfo.name)]);
      Ptr = $mod.StringToBuffer(S,S.length);
      this.SetPointer(Ptr,Ptr.byteLength);
    };
    this.Initialize$1 = function (Instance, Name, ResType) {
      var aInfo = pas.p2jsres.TResourceInfo.$new();
      if (!pas.p2jsres.GetResourceInfo(Name,aInfo)) throw $mod.EResNotFound.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SResNotFound"),pas.System.VarRecs(18,Name)]);
      this.Initialize(pas.p2jsres.TResourceInfo.$clone(aInfo));
    };
    this.Create$1 = function (aInfo) {
      pas.System.TObject.Create.call(this);
      this.Initialize(pas.p2jsres.TResourceInfo.$clone(aInfo));
      return this;
    };
    this.Create$2 = function (Instance, ResName, ResType) {
      pas.System.TObject.Create.call(this);
      this.Initialize$1(Instance,ResName,ResType);
      return this;
    };
    this.CreateFromID = function (Instance, ResID, ResType) {
      pas.System.TObject.Create.call(this);
      this.Initialize$1(Instance,pas.SysUtils.IntToStr(ResID),ResType);
      return this;
    };
    this.Write$1 = function (Buffer, Offset, Count) {
      var Result = 0;
      throw pas.SysUtils.ENotSupportedException.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SErrResourceStreamNoWrite")]);
      Result = 0;
      return Result;
    };
    this.Destroy = function () {
      pas.System.TObject.Destroy.call(this);
    };
  });
  this.TFilerFlag = {"0": "ffInherited", ffInherited: 0, "1": "ffChildPos", ffChildPos: 1, "2": "ffInline", ffInline: 2};
  this.$rtti.$Enum("TFilerFlag",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TFilerFlag});
  this.$rtti.$Set("TFilerFlags",{comptype: this.$rtti["TFilerFlag"]});
  this.$rtti.$MethodVar("TReaderProc",{procsig: rtl.newTIProcSig([["Reader",this.$rtti["TReader"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TWriterProc",{procsig: rtl.newTIProcSig([["Writer",this.$rtti["TWriter"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TStreamProc",{procsig: rtl.newTIProcSig([["Stream",this.$rtti["TStream"]]]), methodkind: 0});
  rtl.createClass(this,"TFiler",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FRoot = null;
      this.FLookupRoot = null;
      this.FAncestor = null;
      this.FIgnoreChildren = false;
    };
    this.$final = function () {
      this.FRoot = undefined;
      this.FLookupRoot = undefined;
      this.FAncestor = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.SetRoot = function (ARoot) {
      this.FRoot = ARoot;
    };
  });
  this.TValueType = {"0": "vaNull", vaNull: 0, "1": "vaList", vaList: 1, "2": "vaInt8", vaInt8: 2, "3": "vaInt16", vaInt16: 3, "4": "vaInt32", vaInt32: 4, "5": "vaDouble", vaDouble: 5, "6": "vaString", vaString: 6, "7": "vaIdent", vaIdent: 7, "8": "vaFalse", vaFalse: 8, "9": "vaTrue", vaTrue: 9, "10": "vaBinary", vaBinary: 10, "11": "vaSet", vaSet: 11, "12": "vaNil", vaNil: 12, "13": "vaCollection", vaCollection: 13, "14": "vaCurrency", vaCurrency: 14, "15": "vaDate", vaDate: 15, "16": "vaNativeInt", vaNativeInt: 16};
  this.$rtti.$Enum("TValueType",{minvalue: 0, maxvalue: 16, ordtype: 1, enumtype: this.TValueType});
  rtl.createClass(this,"TAbstractObjectReader",pas.System.TObject,function () {
    this.FlushBuffer = function () {
    };
  });
  rtl.createClass(this,"TBinaryObjectReader",this.TAbstractObjectReader,function () {
    this.$init = function () {
      $mod.TAbstractObjectReader.$init.call(this);
      this.FStream = null;
    };
    this.$final = function () {
      this.FStream = undefined;
      $mod.TAbstractObjectReader.$final.call(this);
    };
    this.ReadWord = function () {
      var Result = 0;
      this.FStream.ReadBufferData$10({get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.ReadDWord = function () {
      var Result = 0;
      this.FStream.ReadBufferData$14({get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.SkipProperty = function () {
      this.ReadStr();
      this.SkipValue();
    };
    this.SkipSetBody = function () {
      while (this.ReadStr().length > 0) ;
    };
    this.Create$1 = function (Stream) {
      pas.System.TObject.Create.call(this);
      if (Stream === null) throw $mod.EReadError.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SEmptyStreamIllegalReader")]);
      this.FStream = Stream;
      return this;
    };
    this.NextValue = function () {
      var Result = 0;
      Result = this.ReadValue();
      this.FStream.Seek(-1,$mod.TSeekOrigin.soCurrent);
      return Result;
    };
    this.ReadValue = function () {
      var Result = 0;
      var b = 0;
      this.FStream.ReadBufferData$6({get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }});
      Result = b;
      return Result;
    };
    this.BeginRootComponent = function () {
      this.ReadSignature();
    };
    this.BeginComponent = function (Flags, AChildPos, CompClassName, CompName) {
      var Prefix = 0;
      var ValueType = 0;
      Flags.set({});
      if ((this.NextValue() & 0xf0) === 0xf0) {
        Prefix = this.ReadValue();
        Flags.set({});
        if ((Prefix & 0x1) !== 0) Flags.set(rtl.includeSet(Flags.get(),$mod.TFilerFlag.ffInherited));
        if ((Prefix & 0x2) !== 0) Flags.set(rtl.includeSet(Flags.get(),$mod.TFilerFlag.ffChildPos));
        if ((Prefix & 0x4) !== 0) Flags.set(rtl.includeSet(Flags.get(),$mod.TFilerFlag.ffInline));
        if ($mod.TFilerFlag.ffChildPos in Flags.get()) {
          ValueType = this.ReadValue();
          var $tmp = ValueType;
          if ($tmp === $mod.TValueType.vaInt8) {
            AChildPos.set(this.ReadInt8())}
           else if ($tmp === $mod.TValueType.vaInt16) {
            AChildPos.set(this.ReadInt16())}
           else if ($tmp === $mod.TValueType.vaInt32) {
            AChildPos.set(this.ReadInt32())}
           else if ($tmp === $mod.TValueType.vaNativeInt) {
            AChildPos.set(this.ReadNativeInt())}
           else {
            throw $mod.EReadError.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SInvalidPropertyValue")]);
          };
        };
      };
      CompClassName.set(this.ReadStr());
      CompName.set(this.ReadStr());
    };
    this.BeginProperty = function () {
      var Result = "";
      Result = this.ReadStr();
      return Result;
    };
    this.Read = function (Buffer, Count) {
      this.FStream.Read(Buffer,Count);
    };
    this.ReadBinary = function (DestData) {
      var BinSize = 0;
      BinSize = this.ReadDWord() & 0xFFFFFFFF;
      DestData.SetSize64(BinSize);
      DestData.CopyFrom(this.FStream,BinSize);
    };
    this.ReadFloat = function () {
      var Result = 0.0;
      this.FStream.ReadBufferData$20({get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.ReadCurrency = function () {
      var Result = 0;
      Result = rtl.trunc(this.ReadFloat() * 10000);
      return Result;
    };
    this.ReadIdent = function (ValueType) {
      var Result = "";
      var i = 0;
      var c = "\x00";
      var $tmp = ValueType;
      if ($tmp === $mod.TValueType.vaIdent) {
        this.FStream.ReadBufferData$6({get: function () {
            return i;
          }, set: function (v) {
            i = v;
          }});
        Result = rtl.strSetLength(Result,i);
        for (var $l = 1, $end = Result.length; $l <= $end; $l++) {
          i = $l;
          this.FStream.ReadBufferData$2({get: function () {
              return c;
            }, set: function (v) {
              c = v;
            }});
          Result = rtl.setCharAt(Result,i - 1,c);
        };
      } else if ($tmp === $mod.TValueType.vaNil) {
        Result = "nil"}
       else if ($tmp === $mod.TValueType.vaFalse) {
        Result = "False"}
       else if ($tmp === $mod.TValueType.vaTrue) {
        Result = "True"}
       else if ($tmp === $mod.TValueType.vaNull) Result = "Null";
      return Result;
    };
    this.ReadInt8 = function () {
      var Result = 0;
      this.FStream.ReadBufferData$4({get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.ReadInt16 = function () {
      var Result = 0;
      this.FStream.ReadBufferData$8({get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.ReadInt32 = function () {
      var Result = 0;
      this.FStream.ReadBufferData$12({get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.ReadNativeInt = function () {
      var Result = 0;
      this.FStream.ReadBufferData$16({get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.ReadSet = function (EnumType) {
      var Result = 0;
      var Name = "";
      var Value = 0;
      try {
        Result = 0;
        while (true) {
          Name = this.ReadStr();
          if (Name.length === 0) break;
          Value = EnumType.enumtype[Name];
          if (Value === -1) throw $mod.EReadError.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SInvalidPropertyValue")]);
          Result = Result | (1 << Value);
        };
      } catch ($e) {
        this.SkipSetBody();
        throw $e;
      };
      return Result;
    };
    this.ReadSignature = function () {
      var Signature = 0;
      this.FStream.ReadBufferData$12({get: function () {
          return Signature;
        }, set: function (v) {
          Signature = v;
        }});
      if (Signature !== 809914452) throw $mod.EReadError.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SInvalidImage")]);
    };
    this.ReadStr = function () {
      var Result = "";
      var l = 0;
      var i = 0;
      var c = "\x00";
      this.FStream.ReadBufferData$6({get: function () {
          return l;
        }, set: function (v) {
          l = v;
        }});
      Result = rtl.strSetLength(Result,l);
      for (var $l = 1, $end = l; $l <= $end; $l++) {
        i = $l;
        this.FStream.ReadBufferData$2({get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }});
        Result = rtl.setCharAt(Result,i - 1,c);
      };
      return Result;
    };
    this.ReadString = function (StringType) {
      var Result = "";
      var i = 0;
      var C = "\x00";
      Result = "";
      if (StringType !== $mod.TValueType.vaString) throw $mod.EFilerError.$create("Create$1",["Invalid string type passed to ReadString"]);
      i = this.ReadDWord();
      Result = rtl.strSetLength(Result,i);
      for (var $l = 1, $end = Result.length; $l <= $end; $l++) {
        i = $l;
        this.FStream.ReadBufferData$2({get: function () {
            return C;
          }, set: function (v) {
            C = v;
          }});
        Result = rtl.setCharAt(Result,i - 1,C);
      };
      return Result;
    };
    this.ReadWideString = function () {
      var Result = "";
      Result = this.ReadString($mod.TValueType.vaString);
      return Result;
    };
    this.ReadUnicodeString = function () {
      var Result = "";
      Result = this.ReadString($mod.TValueType.vaString);
      return Result;
    };
    this.SkipComponent = function (SkipComponentInfos) {
      var Flags = {};
      var Dummy = 0;
      var CompClassName = "";
      var CompName = "";
      if (SkipComponentInfos) this.BeginComponent({get: function () {
          return Flags;
        }, set: function (v) {
          Flags = v;
        }},{get: function () {
          return Dummy;
        }, set: function (v) {
          Dummy = v;
        }},{get: function () {
          return CompClassName;
        }, set: function (v) {
          CompClassName = v;
        }},{get: function () {
          return CompName;
        }, set: function (v) {
          CompName = v;
        }});
      while (this.NextValue() !== $mod.TValueType.vaNull) this.SkipProperty();
      this.ReadValue();
      while (this.NextValue() !== $mod.TValueType.vaNull) this.SkipComponent(true);
      this.ReadValue();
    };
    this.SkipValue = function () {
      var $Self = this;
      function SkipBytes(Count) {
        var Dummy = [];
        var SkipNow = 0;
        while (Count > 0) {
          if (Count > 1024) {
            SkipNow = 1024}
           else SkipNow = Count;
          Dummy = rtl.arraySetLength(Dummy,0,SkipNow);
          $Self.Read({get: function () {
              return Dummy;
            }, set: function (v) {
              Dummy = v;
            }},SkipNow);
          Count -= SkipNow;
        };
      };
      var Count = 0;
      var $tmp = this.ReadValue();
      if (($tmp === $mod.TValueType.vaNull) || ($tmp === $mod.TValueType.vaFalse) || ($tmp === $mod.TValueType.vaTrue) || ($tmp === $mod.TValueType.vaNil)) {}
      else if ($tmp === $mod.TValueType.vaList) {
        while (this.NextValue() !== $mod.TValueType.vaNull) this.SkipValue();
        this.ReadValue();
      } else if ($tmp === $mod.TValueType.vaInt8) {
        SkipBytes(1)}
       else if ($tmp === $mod.TValueType.vaInt16) {
        SkipBytes(2)}
       else if ($tmp === $mod.TValueType.vaInt32) {
        SkipBytes(4)}
       else if (($tmp === $mod.TValueType.vaNativeInt) || ($tmp === $mod.TValueType.vaDouble)) {
        SkipBytes(8)}
       else if ($tmp === $mod.TValueType.vaIdent) {
        this.ReadStr()}
       else if ($tmp === $mod.TValueType.vaString) {
        this.ReadString($mod.TValueType.vaString)}
       else if ($tmp === $mod.TValueType.vaBinary) {
        Count = this.ReadDWord() & 0xFFFFFFFF;
        SkipBytes(Count);
      } else if ($tmp === $mod.TValueType.vaSet) {
        this.SkipSetBody()}
       else if ($tmp === $mod.TValueType.vaCollection) {
        while (this.NextValue() !== $mod.TValueType.vaNull) {
          if (this.NextValue() in rtl.createSet($mod.TValueType.vaInt8,$mod.TValueType.vaInt16,$mod.TValueType.vaInt32)) this.SkipValue();
          SkipBytes(1);
          while (this.NextValue() !== $mod.TValueType.vaNull) this.SkipProperty();
          this.ReadValue();
        };
        this.ReadValue();
      };
    };
  });
  this.$rtti.$MethodVar("TFindMethodEvent",{procsig: rtl.newTIProcSig([["Reader",this.$rtti["TReader"]],["MethodName",rtl.string,2],["Address",rtl.pointer,1],["error",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TSetNameEvent",{procsig: rtl.newTIProcSig([["Reader",this.$rtti["TReader"]],["Component",this.$rtti["TComponent"]],["Name",rtl.string,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TReferenceNameEvent",{procsig: rtl.newTIProcSig([["Reader",this.$rtti["TReader"]],["Name",rtl.string,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TAncestorNotFoundEvent",{procsig: rtl.newTIProcSig([["Reader",this.$rtti["TReader"]],["ComponentName",rtl.string,2],["ComponentClass",this.$rtti["TPersistentClass"]],["Component",this.$rtti["TComponent"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TReadComponentsProc",{procsig: rtl.newTIProcSig([["Component",this.$rtti["TComponent"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TReaderError",{procsig: rtl.newTIProcSig([["Reader",this.$rtti["TReader"]],["Message",rtl.string,2],["Handled",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TPropertyNotFoundEvent",{procsig: rtl.newTIProcSig([["Reader",this.$rtti["TReader"]],["Instance",this.$rtti["TPersistent"]],["PropName",rtl.string,1],["IsPath",rtl.boolean],["Handled",rtl.boolean,1],["Skip",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TFindComponentClassEvent",{procsig: rtl.newTIProcSig([["Reader",this.$rtti["TReader"]],["ClassName",rtl.string,2],["ComponentClass",this.$rtti["TComponentClass"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TCreateComponentEvent",{procsig: rtl.newTIProcSig([["Reader",this.$rtti["TReader"]],["ComponentClass",this.$rtti["TComponentClass"]],["Component",this.$rtti["TComponent"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TSetMethodPropertyEvent",{procsig: rtl.newTIProcSig([["Reader",this.$rtti["TReader"]],["Instance",this.$rtti["TPersistent"]],["PropInfo",pas.TypInfo.$rtti["TTypeMemberProperty"]],["TheMethodName",rtl.string,2],["Handled",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TReadWriteStringPropertyEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Instance",this.$rtti["TPersistent"],2],["PropInfo",pas.TypInfo.$rtti["TTypeMemberProperty"]],["Content",rtl.string,1]]), methodkind: 0});
  rtl.createClass(this,"TReader",this.TFiler,function () {
    this.$init = function () {
      $mod.TFiler.$init.call(this);
      this.FDriver = null;
      this.FOwner = null;
      this.FParent = null;
      this.FFixups = null;
      this.FLoaded = null;
      this.FOnFindMethod = null;
      this.FOnSetMethodProperty = null;
      this.FOnSetName = null;
      this.FOnReferenceName = null;
      this.FOnAncestorNotFound = null;
      this.FOnError = null;
      this.FOnPropertyNotFound = null;
      this.FOnFindComponentClass = null;
      this.FOnCreateComponent = null;
      this.FPropName = "";
      this.FCanHandleExcepts = false;
      this.FOnReadStringProperty = null;
    };
    this.$final = function () {
      this.FDriver = undefined;
      this.FOwner = undefined;
      this.FParent = undefined;
      this.FFixups = undefined;
      this.FLoaded = undefined;
      this.FOnFindMethod = undefined;
      this.FOnSetMethodProperty = undefined;
      this.FOnSetName = undefined;
      this.FOnReferenceName = undefined;
      this.FOnAncestorNotFound = undefined;
      this.FOnError = undefined;
      this.FOnPropertyNotFound = undefined;
      this.FOnFindComponentClass = undefined;
      this.FOnCreateComponent = undefined;
      this.FOnReadStringProperty = undefined;
      $mod.TFiler.$final.call(this);
    };
    this.DoFixupReferences = function () {
      var R = null;
      var RN = null;
      var G = null;
      var Ref = "";
      var C = null;
      var P = 0;
      var L = null;
      var $ir = rtl.createIntfRefs();
      try {
        if (this.FFixups != null) {
          L = this.FFixups;
          R = L.FRoot;
          while (R !== null) {
            RN = R.Next;
            Ref = R.FRelative;
            if (this.FOnReferenceName != null) this.FOnReferenceName(this,{get: function () {
                return Ref;
              }, set: function (v) {
                Ref = v;
              }});
            C = $mod.FindNestedComponent(R.FRoot,Ref,true);
            if (C != null) {
              if (R.FPropInfo.typeinfo.kind === pas.System.TTypeKind.tkInterface) {
                pas.TypInfo.SetInterfaceProp$1(R.Finstance,R.FPropInfo,$ir.ref(1,rtl.queryIntfT(C,pas.System.IUnknown)))}
               else pas.TypInfo.SetObjectProp$1(R.Finstance,R.FPropInfo,C)}
             else {
              P = pas.System.Pos(".",R.FRelative);
              if (P !== 0) {
                G = $impl.AddtoResolveList(R.Finstance);
                G.AddReference(R.FRoot,R.FPropInfo,pas.System.Copy(R.FRelative,1,P - 1),pas.System.Copy(R.FRelative,P + 1,R.FRelative.length - P));
              };
            };
            L.RemoveItem(R,true);
            R = RN;
          };
          pas.SysUtils.FreeAndNil({p: this, get: function () {
              return this.p.FFixups;
            }, set: function (v) {
              this.p.FFixups = v;
            }});
        };
      } finally {
        $ir.free();
      };
    };
    this.FindComponentClass = function (AClassName) {
      var $Self = this;
      var Result = null;
      var PersistentClass = null;
      function FindClassInFieldTable(Instance) {
        var Result = null;
        var aClass = null;
        var i = 0;
        var ClassTI = null;
        var MemberClassTI = null;
        var MemberTI = null;
        aClass = Instance.$class.ClassType();
        while (aClass !== null) {
          ClassTI = aClass.$rtti;
          for (var $l = 0, $end = ClassTI.fields.length - 1; $l <= $end; $l++) {
            i = $l;
            MemberTI = ClassTI.getField(i).typeinfo;
            if (MemberTI.kind === pas.System.TTypeKind.tkClass) {
              MemberClassTI = MemberTI;
              if (pas.SysUtils.SameText(MemberClassTI.name,AClassName) && rtl.is(MemberClassTI.class,$mod.TComponent)) return MemberClassTI.class;
            };
          };
          aClass = aClass.$ancestor;
        };
        return Result;
      };
      Result = null;
      Result = FindClassInFieldTable(this.FRoot);
      if ((Result === null) && (this.FLookupRoot != null) && (this.FLookupRoot !== this.FRoot)) Result = FindClassInFieldTable(this.FLookupRoot);
      if (Result === null) {
        PersistentClass = $mod.GetClass(AClassName);
        if ((PersistentClass != null) && PersistentClass.InheritsFrom($mod.TComponent)) Result = PersistentClass;
      };
      if ((Result === null) && (this.FOnFindComponentClass != null)) this.FOnFindComponentClass($Self,AClassName,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      if ((Result === null) || !Result.InheritsFrom($mod.TComponent)) throw $mod.EClassNotFound.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SClassNotFound"),pas.System.VarRecs(18,AClassName)]);
      return Result;
    };
    this.Error = function (Message) {
      var Result = false;
      Result = false;
      if (this.FOnError != null) this.FOnError(this,Message,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.FindMethod = function (ARoot, AMethodName) {
      var Result = null;
      var ErrorResult = false;
      Result = null;
      if ((ARoot === null) || (AMethodName === "")) return Result;
      Result = ARoot.$class.MethodAddress(AMethodName);
      ErrorResult = Result === null;
      if (this.FOnFindMethod != null) this.FOnFindMethod(this,AMethodName,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }},{get: function () {
          return ErrorResult;
        }, set: function (v) {
          ErrorResult = v;
        }});
      if (ErrorResult) throw $mod.EReadError.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SInvalidPropertyValue")]);
      return Result;
    };
    this.ReadProperty = function (AInstance) {
      var $Self = this;
      var Path = "";
      var Instance = null;
      var PropInfo = null;
      var Obj = null;
      var Name = "";
      var Skip = false;
      var Handled = false;
      var OldPropName = "";
      var DotPos = "";
      var NextPos = 0;
      function HandleMissingProperty(IsPath) {
        var Result = false;
        Result = true;
        if ($Self.FOnPropertyNotFound != null) {
          OldPropName = $Self.FPropName;
          Handled = false;
          Skip = false;
          $Self.FOnPropertyNotFound($Self,Instance,{p: $Self, get: function () {
              return this.p.FPropName;
            }, set: function (v) {
              this.p.FPropName = v;
            }},IsPath,{get: function () {
              return Handled;
            }, set: function (v) {
              Handled = v;
            }},{get: function () {
              return Skip;
            }, set: function (v) {
              Skip = v;
            }});
          if (Handled && !Skip && (OldPropName !== $Self.FPropName)) PropInfo = pas.TypInfo.GetPropInfo$4(Instance.$class.ClassType(),$Self.FPropName);
          if (Skip) {
            $Self.FDriver.SkipValue();
            Result = false;
            return Result;
          };
        };
        return Result;
      };
      try {
        Path = this.FDriver.BeginProperty();
        try {
          Instance = AInstance;
          this.FCanHandleExcepts = true;
          DotPos = Path;
          while (true) {
            NextPos = pas.System.Pos(".",DotPos);
            if (NextPos > 0) {
              this.FPropName = pas.System.Copy(DotPos,1,NextPos - 1)}
             else {
              this.FPropName = DotPos;
              break;
            };
            pas.System.Delete({get: function () {
                return DotPos;
              }, set: function (v) {
                DotPos = v;
              }},1,NextPos);
            PropInfo = pas.TypInfo.GetPropInfo$4(Instance.$class.ClassType(),this.FPropName);
            if (!(PropInfo != null)) {
              if (!HandleMissingProperty(true)) return;
              if (!(PropInfo != null)) this.PropertyError();
            };
            if (PropInfo.typeinfo.kind === pas.System.TTypeKind.tkClass) {
              Obj = pas.TypInfo.GetObjectProp$2(Instance,PropInfo)}
             else Obj = null;
            if (!$mod.TPersistent.isPrototypeOf(Obj)) {
              this.FDriver.SkipValue();
              throw $mod.EReadError.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SInvalidPropertyPath")]);
            };
            Instance = Obj;
          };
          PropInfo = pas.TypInfo.GetPropInfo$4(Instance.$class.ClassType(),this.FPropName);
          if (PropInfo != null) {
            this.ReadPropValue(Instance,PropInfo)}
           else {
            this.FCanHandleExcepts = false;
            Instance.DefineProperties($Self);
            this.FCanHandleExcepts = true;
            if (this.FPropName.length > 0) {
              if (!HandleMissingProperty(false)) return;
              if (!(PropInfo != null)) this.PropertyError();
            };
          };
        } catch ($e) {
          if (pas.SysUtils.Exception.isPrototypeOf($e)) {
            var e = $e;
            Name = rtl.strSetLength(Name,0);
            if (AInstance.$class.InheritsFrom($mod.TComponent)) Name = AInstance.FName;
            if (Name.length === 0) Name = AInstance.$classname;
            throw $mod.EReadError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SPropertyException"),pas.System.VarRecs(18,Name,9,".",18,Path,18,e.FMessage)]);
          } else throw $e
        };
      } catch ($e) {
        if (pas.SysUtils.Exception.isPrototypeOf($e)) {
          var e = $e;
          if (!this.FCanHandleExcepts || !this.Error(e.FMessage)) throw $e;
        } else throw $e
      };
    };
    var NullMethod = pas.System.TMethod.$clone({Code: null, Data: null});
    this.ReadPropValue = function (Instance, PropInfo) {
      var PropType = null;
      var Value = 0;
      var Ident = "";
      var Method = pas.System.TMethod.$new();
      var Handled = false;
      var TmpStr = "";
      if (PropInfo.setter === "") throw $mod.EReadError.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SReadOnlyProperty")]);
      PropType = PropInfo.typeinfo;
      var $tmp = PropType.kind;
      if ($tmp === pas.System.TTypeKind.tkInteger) {
        var $tmp1 = this.FDriver.NextValue();
        if ($tmp1 === $mod.TValueType.vaIdent) {
          Ident = this.ReadIdent();
          if ($impl.GlobalIdentToInt(Ident,{get: function () {
              return Value;
            }, set: function (v) {
              Value = v;
            }})) {
            pas.TypInfo.SetOrdProp$1(Instance,PropInfo,Value)}
           else throw $mod.EReadError.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SInvalidPropertyValue")]);
        } else if ($tmp1 === $mod.TValueType.vaNativeInt) {
          pas.TypInfo.SetOrdProp$1(Instance,PropInfo,this.ReadNativeInt())}
         else if ($tmp1 === $mod.TValueType.vaCurrency) {
          pas.TypInfo.SetFloatProp$1(Instance,PropInfo,this.ReadCurrency() / 10000)}
         else {
          pas.TypInfo.SetOrdProp$1(Instance,PropInfo,this.ReadInteger());
        };
      } else if ($tmp === pas.System.TTypeKind.tkBool) {
        pas.TypInfo.SetBoolProp$1(Instance,PropInfo,this.ReadBoolean())}
       else if ($tmp === pas.System.TTypeKind.tkChar) {
        pas.TypInfo.SetOrdProp$1(Instance,PropInfo,this.ReadChar().charCodeAt())}
       else if ($tmp === pas.System.TTypeKind.tkEnumeration) {
        Value = pas.TypInfo.GetEnumValue(PropType,this.ReadIdent());
        if (Value === -1) throw $mod.EReadError.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SInvalidPropertyValue")]);
        pas.TypInfo.SetOrdProp$1(Instance,PropInfo,Value);
      } else if ($tmp === pas.System.TTypeKind.tkDouble) {
        pas.TypInfo.SetFloatProp$1(Instance,PropInfo,this.ReadFloat())}
       else if ($tmp === pas.System.TTypeKind.tkSet) {
        this.CheckValue($mod.TValueType.vaSet);
        if (PropType.comptype.kind === pas.System.TTypeKind.tkEnumeration) pas.TypInfo.SetOrdProp$1(Instance,PropInfo,this.FDriver.ReadSet(PropType.comptype));
      } else if (($tmp === pas.System.TTypeKind.tkMethod) || ($tmp === pas.System.TTypeKind.tkRefToProcVar)) {
        if (this.FDriver.NextValue() === $mod.TValueType.vaNil) {
          this.FDriver.ReadValue();
          pas.TypInfo.SetMethodProp(Instance,PropInfo,NullMethod);
        } else {
          Handled = false;
          Ident = this.ReadIdent();
          if (this.FOnSetMethodProperty != null) this.FOnSetMethodProperty(this,Instance,PropInfo,Ident,{get: function () {
              return Handled;
            }, set: function (v) {
              Handled = v;
            }});
          if (!Handled) {
            Method.Code = this.FindMethod(this.FRoot,Ident);
            Method.Data = this.FRoot;
            if (Method.Code != null) pas.TypInfo.SetMethodProp(Instance,PropInfo,Method);
          };
        }}
       else if ($tmp === pas.System.TTypeKind.tkString) {
        TmpStr = this.ReadString();
        if (this.FOnReadStringProperty != null) this.FOnReadStringProperty(this,Instance,PropInfo,{get: function () {
            return TmpStr;
          }, set: function (v) {
            TmpStr = v;
          }});
        pas.TypInfo.SetStrProp$1(Instance,PropInfo,TmpStr);
      } else if ($tmp === pas.System.TTypeKind.tkJSValue) {
        pas.TypInfo.SetJSValueProp$3(Instance,PropInfo,this.ReadVariant());
      } else if (($tmp === pas.System.TTypeKind.tkClass) || ($tmp === pas.System.TTypeKind.tkInterface)) {
        var $tmp2 = this.FDriver.NextValue();
        if ($tmp2 === $mod.TValueType.vaNil) {
          this.FDriver.ReadValue();
          pas.TypInfo.SetOrdProp$1(Instance,PropInfo,0);
        } else if ($tmp2 === $mod.TValueType.vaCollection) {
          this.FDriver.ReadValue();
          this.ReadCollection(pas.TypInfo.GetObjectProp$2(Instance,PropInfo));
        } else {
          if (!(this.FFixups != null)) this.FFixups = pas.simplelinkedlist.TLinkedList.$create("Create$1",[$impl.TLocalUnResolvedReference]);
          var $with = this.FFixups.Add();
          $with.Finstance = Instance;
          $with.FRoot = this.FRoot;
          $with.FPropInfo = PropInfo;
          $with.FRelative = this.ReadIdent();
        };
      } else {
        throw $mod.EReadError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SUnknownPropertyType"),pas.System.VarRecs(18,pas.System.TTypeKind[PropType.kind])]);
      };
    };
    this.PropertyError = function () {
      this.FDriver.SkipValue();
      throw $mod.EReadError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SUnknownProperty"),pas.System.VarRecs(18,this.FPropName)]);
    };
    this.ReadData = function (Instance) {
      var SavedOwner = null;
      var SavedParent = null;
      while (!this.EndOfList()) this.ReadProperty(Instance);
      this.ReadListEnd();
      SavedOwner = this.FOwner;
      SavedParent = this.FParent;
      try {
        this.FOwner = Instance.GetChildOwner();
        if (!(this.FOwner != null)) this.FOwner = this.FRoot;
        this.FParent = Instance.GetChildParent();
        while (!this.EndOfList()) this.ReadComponent(null);
        this.ReadListEnd();
      } finally {
        this.FOwner = SavedOwner;
        this.FParent = SavedParent;
      };
      if (Instance === this.FRoot) this.DoFixupReferences();
    };
    this.CreateDriver = function (Stream) {
      var Result = null;
      Result = $mod.TBinaryObjectReader.$create("Create$1",[Stream]);
      return Result;
    };
    this.Create$1 = function (Stream) {
      pas.System.TObject.Create.call(this);
      if (Stream === null) throw $mod.EReadError.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SEmptyStreamIllegalReader")]);
      this.FDriver = this.CreateDriver(Stream);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FDriver");
      pas.System.TObject.Destroy.call(this);
    };
    this.FlushBuffer = function () {
      this.FDriver.FlushBuffer();
    };
    this.BeginReferences = function () {
      this.FLoaded = $mod.TFPList.$create("Create");
    };
    this.CheckValue = function (Value) {
      if (this.FDriver.NextValue() !== Value) {
        throw $mod.EReadError.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SInvalidPropertyValue")])}
       else this.FDriver.ReadValue();
    };
    this.DefineProperty = function (Name, AReadData, WriteData, HasData) {
      if ((AReadData != null) && pas.SysUtils.SameText(Name,this.FPropName)) {
        AReadData(this);
        this.FPropName = rtl.strSetLength(this.FPropName,0);
      } else if ((WriteData != null) && HasData) ;
    };
    this.DefineBinaryProperty = function (Name, AReadData, WriteData, HasData) {
      var MemBuffer = null;
      if ((AReadData != null) && pas.SysUtils.SameText(Name,this.FPropName)) {
        if (this.FDriver.NextValue() !== $mod.TValueType.vaBinary) {
          this.FDriver.SkipValue();
          this.FCanHandleExcepts = true;
          throw $mod.EReadError.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SInvalidPropertyValue")]);
        } else this.FDriver.ReadValue();
        MemBuffer = $mod.TMemoryStream.$create("Create");
        try {
          this.FDriver.ReadBinary(MemBuffer);
          this.FCanHandleExcepts = true;
          AReadData(MemBuffer);
        } finally {
          MemBuffer = rtl.freeLoc(MemBuffer);
        };
        this.FPropName = rtl.strSetLength(this.FPropName,0);
      } else if ((WriteData != null) && HasData) ;
    };
    this.EndOfList = function () {
      var Result = false;
      Result = this.FDriver.NextValue() === $mod.TValueType.vaNull;
      return Result;
    };
    this.EndReferences = function () {
      rtl.free(this,"FLoaded");
      this.FLoaded = null;
    };
    this.FixupReferences = function () {
      var i = 0;
      this.DoFixupReferences();
      $impl.GlobalFixupReferences();
      for (var $l = 0, $end = this.FLoaded.FCount - 1; $l <= $end; $l++) {
        i = $l;
        rtl.getObject(this.FLoaded.Get(i)).Loaded();
      };
    };
    this.NextValue = function () {
      var Result = 0;
      Result = this.FDriver.NextValue();
      return Result;
    };
    this.Read = function (Buffer, Count) {
      this.FDriver.Read(Buffer,Count);
    };
    this.ReadBoolean = function () {
      var Result = false;
      var ValueType = 0;
      ValueType = this.FDriver.ReadValue();
      if (ValueType === $mod.TValueType.vaTrue) {
        Result = true}
       else if (ValueType === $mod.TValueType.vaFalse) {
        Result = false}
       else throw $mod.EReadError.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SInvalidPropertyValue")]);
      return Result;
    };
    this.ReadChar = function () {
      var Result = "\x00";
      var s = "";
      s = this.ReadString();
      if (s.length === 1) {
        Result = s.charAt(0)}
       else throw $mod.EReadError.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SInvalidPropertyValue")]);
      return Result;
    };
    this.ReadWideChar = function () {
      var Result = "\x00";
      var W = "";
      W = this.ReadWideString();
      if (W.length === 1) {
        Result = W.charAt(0)}
       else throw $mod.EReadError.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SInvalidPropertyValue")]);
      return Result;
    };
    this.ReadUnicodeChar = function () {
      var Result = "\x00";
      var U = "";
      U = this.ReadUnicodeString();
      if (U.length === 1) {
        Result = U.charAt(0)}
       else throw $mod.EReadError.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SInvalidPropertyValue")]);
      return Result;
    };
    this.ReadCollection = function (Collection) {
      var Item = null;
      Collection.BeginUpdate();
      if (!this.EndOfList()) Collection.Clear();
      while (!this.EndOfList()) {
        this.ReadListBegin();
        Item = Collection.Add();
        while (this.NextValue() !== $mod.TValueType.vaNull) this.ReadProperty(Item);
        this.ReadListEnd();
      };
      Collection.EndUpdate();
      this.ReadListEnd();
    };
    this.ReadComponent = function (Component) {
      var $Self = this;
      var Result = null;
      var Flags = {};
      function Recover(E, aComponent) {
        var Result = false;
        Result = false;
        if (!(($mod.TFilerFlag.ffInherited in Flags) || (Component != null))) aComponent.set(rtl.freeLoc(aComponent.get()));
        aComponent.set(null);
        $Self.FDriver.SkipComponent(false);
        Result = $Self.Error(E.FMessage);
        return Result;
      };
      var CompClassName = "";
      var Name = "";
      var n = 0;
      var ChildPos = 0;
      var SavedParent = null;
      var SavedLookupRoot = null;
      var ComponentClass = null;
      var C = null;
      var NewComponent = null;
      var SubComponents = null;
      this.FDriver.BeginComponent({get: function () {
          return Flags;
        }, set: function (v) {
          Flags = v;
        }},{get: function () {
          return ChildPos;
        }, set: function (v) {
          ChildPos = v;
        }},{get: function () {
          return CompClassName;
        }, set: function (v) {
          CompClassName = v;
        }},{get: function () {
          return Name;
        }, set: function (v) {
          Name = v;
        }});
      SavedParent = this.FParent;
      SavedLookupRoot = this.FLookupRoot;
      SubComponents = null;
      try {
        Result = Component;
        if (!(Result != null)) try {
          if ($mod.TFilerFlag.ffInherited in Flags) {
            if (this.FLookupRoot != null) {
              Result = this.FLookupRoot.FindComponent(Name)}
             else Result = null;
            if (!(Result != null)) {
              if (this.FOnAncestorNotFound != null) this.FOnAncestorNotFound($Self,Name,this.FindComponentClass(CompClassName),{get: function () {
                  return Result;
                }, set: function (v) {
                  Result = v;
                }});
              if (!(Result != null)) throw $mod.EReadError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SAncestorNotFound"),pas.System.VarRecs(18,Name)]);
            };
            this.FParent = Result.GetParentComponent();
            if (!(this.FParent != null)) this.FParent = this.FRoot;
          } else {
            Result = null;
            ComponentClass = this.FindComponentClass(CompClassName);
            if (this.FOnCreateComponent != null) this.FOnCreateComponent($Self,ComponentClass,{get: function () {
                return Result;
              }, set: function (v) {
                Result = v;
              }});
            if (!(Result != null)) {
              NewComponent = Object.create(ComponentClass);
              NewComponent.$init();
              if ($mod.TFilerFlag.ffInline in Flags) NewComponent.FComponentState = rtl.unionSet(NewComponent.FComponentState,rtl.createSet($mod.TComponentStateItem.csLoading,$mod.TComponentStateItem.csInline));
              NewComponent.Create$1(this.FOwner);
              NewComponent.AfterConstruction();
              Result = NewComponent;
            };
            Result.FComponentState = rtl.includeSet(Result.FComponentState,$mod.TComponentStateItem.csLoading);
          };
        } catch ($e) {
          if (pas.SysUtils.Exception.isPrototypeOf($e)) {
            var E = $e;
            if (!Recover(E,{get: function () {
                return Result;
              }, set: function (v) {
                Result = v;
              }})) throw $e;
          } else throw $e
        };
        if (Result != null) try {
          Result.FComponentState = rtl.includeSet(Result.FComponentState,$mod.TComponentStateItem.csLoading);
          SubComponents = $mod.TList.$create("Create$1");
          for (var $l = 0, $end = Result.GetComponentCount() - 1; $l <= $end; $l++) {
            n = $l;
            C = Result.GetComponent(n);
            if ($mod.TComponentStyleItem.csSubComponent in C.FComponentStyle) {
              SubComponents.Add(C);
              C.FComponentState = rtl.includeSet(C.FComponentState,$mod.TComponentStateItem.csLoading);
            };
          };
          if (!($mod.TFilerFlag.ffInherited in Flags)) try {
            Result.SetParentComponent(this.FParent);
            if (this.FOnSetName != null) this.FOnSetName($Self,Result,{get: function () {
                return Name;
              }, set: function (v) {
                Name = v;
              }});
            Result.SetName(Name);
            if ($mod.FindGlobalComponent(Name) === Result) Result.FComponentState = rtl.includeSet(Result.FComponentState,$mod.TComponentStateItem.csInline);
          } catch ($e) {
            if (pas.SysUtils.Exception.isPrototypeOf($e)) {
              var E = $e;
              if (!Recover(E,{get: function () {
                  return Result;
                }, set: function (v) {
                  Result = v;
                }})) throw $e;
            } else throw $e
          };
          if (!(Result != null)) return Result;
          if ($mod.TComponentStateItem.csInline in Result.FComponentState) this.FLookupRoot = Result;
          Result.FComponentState = rtl.includeSet(Result.FComponentState,$mod.TComponentStateItem.csReading);
          for (var $l1 = 0, $end1 = SubComponents.GetCount() - 1; $l1 <= $end1; $l1++) {
            n = $l1;
            rtl.getObject(SubComponents.Get(n)).FComponentState = rtl.includeSet(rtl.getObject(SubComponents.Get(n)).FComponentState,$mod.TComponentStateItem.csReading);
          };
          Result.ReadState($Self);
          Result.FComponentState = rtl.excludeSet(Result.FComponentState,$mod.TComponentStateItem.csReading);
          for (var $l2 = 0, $end2 = SubComponents.GetCount() - 1; $l2 <= $end2; $l2++) {
            n = $l2;
            rtl.getObject(SubComponents.Get(n)).FComponentState = rtl.excludeSet(rtl.getObject(SubComponents.Get(n)).FComponentState,$mod.TComponentStateItem.csReading);
          };
          if ($mod.TFilerFlag.ffChildPos in Flags) this.FParent.SetChildOrder(Result,ChildPos);
          if (!(($mod.TFilerFlag.ffInherited in Flags) || ($mod.TComponentStateItem.csInline in Result.FComponentState)) || (this.FLoaded.IndexOf(Result) < 0)) {
            for (var $l3 = 0, $end3 = SubComponents.GetCount() - 1; $l3 <= $end3; $l3++) {
              n = $l3;
              this.FLoaded.Add(SubComponents.Get(n));
            };
            this.FLoaded.Add(Result);
          };
        } catch ($e) {
          if (($mod.TFilerFlag.ffInherited in Flags) || (Component != null)) Result = rtl.freeLoc(Result);
          throw $e;
        };
      } finally {
        this.FParent = SavedParent;
        this.FLookupRoot = SavedLookupRoot;
        SubComponents = rtl.freeLoc(SubComponents);
      };
      return Result;
    };
    this.ReadComponents = function (AOwner, AParent, Proc) {
      var Component = null;
      this.SetRoot(AOwner);
      this.FOwner = AOwner;
      this.FParent = AParent;
      this.BeginReferences();
      try {
        while (!this.EndOfList()) {
          this.FDriver.BeginRootComponent();
          Component = this.ReadComponent(null);
          if (Proc != null) Proc(Component);
        };
        this.ReadListEnd();
        this.FixupReferences();
      } finally {
        this.EndReferences();
      };
    };
    this.ReadFloat = function () {
      var Result = 0.0;
      if (this.FDriver.NextValue() === $mod.TValueType.vaDouble) {
        this.ReadValue();
        Result = this.FDriver.ReadFloat();
      } else Result = this.ReadNativeInt();
      return Result;
    };
    this.ReadCurrency = function () {
      var Result = 0;
      if (this.FDriver.NextValue() === $mod.TValueType.vaCurrency) {
        this.FDriver.ReadValue();
        Result = this.FDriver.ReadCurrency();
      } else Result = this.ReadInteger() * 10000;
      return Result;
    };
    this.ReadIdent = function () {
      var Result = "";
      var ValueType = 0;
      ValueType = this.FDriver.ReadValue();
      if (ValueType in rtl.createSet($mod.TValueType.vaIdent,$mod.TValueType.vaNil,$mod.TValueType.vaFalse,$mod.TValueType.vaTrue,$mod.TValueType.vaNull)) {
        Result = this.FDriver.ReadIdent(ValueType)}
       else throw $mod.EReadError.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SInvalidPropertyValue")]);
      return Result;
    };
    this.ReadInteger = function () {
      var Result = 0;
      var $tmp = this.FDriver.ReadValue();
      if ($tmp === $mod.TValueType.vaInt8) {
        Result = this.FDriver.ReadInt8()}
       else if ($tmp === $mod.TValueType.vaInt16) {
        Result = this.FDriver.ReadInt16()}
       else if ($tmp === $mod.TValueType.vaInt32) {
        Result = this.FDriver.ReadInt32()}
       else {
        throw $mod.EReadError.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SInvalidPropertyValue")]);
      };
      return Result;
    };
    this.ReadNativeInt = function () {
      var Result = 0;
      if (this.FDriver.NextValue() === $mod.TValueType.vaNativeInt) {
        this.FDriver.ReadValue();
        Result = this.FDriver.ReadNativeInt();
      } else Result = this.ReadInteger();
      return Result;
    };
    this.ReadSet = function (EnumType) {
      var Result = 0;
      if (this.FDriver.NextValue() === $mod.TValueType.vaSet) {
        this.FDriver.ReadValue();
        Result = this.FDriver.ReadSet(EnumType);
      } else Result = this.ReadInteger();
      return Result;
    };
    this.ReadListBegin = function () {
      this.CheckValue($mod.TValueType.vaList);
    };
    this.ReadListEnd = function () {
      this.CheckValue($mod.TValueType.vaNull);
    };
    this.ReadRootComponent = function (ARoot) {
      var Result = null;
      var Dummy = 0;
      var i = 0;
      var Flags = {};
      var CompClassName = "";
      var CompName = "";
      var ResultName = "";
      this.FDriver.BeginRootComponent();
      Result = null;
      try {
        this.FDriver.BeginComponent({get: function () {
            return Flags;
          }, set: function (v) {
            Flags = v;
          }},{get: function () {
            return Dummy;
          }, set: function (v) {
            Dummy = v;
          }},{get: function () {
            return CompClassName;
          }, set: function (v) {
            CompClassName = v;
          }},{get: function () {
            return CompName;
          }, set: function (v) {
            CompName = v;
          }});
        if (!(ARoot != null)) {
          Result = $mod.FindClass(CompClassName).$create("Create$1",[null]);
          Result.SetName(CompName);
        } else {
          Result = ARoot;
          if (!($mod.TComponentStateItem.csDesigning in Result.FComponentState)) {
            Result.FComponentState = rtl.unionSet(Result.FComponentState,rtl.createSet($mod.TComponentStateItem.csLoading,$mod.TComponentStateItem.csReading));
            i = 0;
            ResultName = CompName;
            while ($mod.FindGlobalComponent(ResultName) != null) {
              i += 1;
              ResultName = CompName + "_" + pas.SysUtils.IntToStr(i);
            };
            Result.SetName(ResultName);
          };
        };
        this.FRoot = Result;
        this.FLookupRoot = Result;
        if ($impl.GlobalLoaded != null) {
          this.FLoaded = $impl.GlobalLoaded}
         else this.FLoaded = $mod.TFPList.$create("Create");
        try {
          if (this.FLoaded.IndexOf(this.FRoot) < 0) this.FLoaded.Add(this.FRoot);
          this.FOwner = this.FRoot;
          this.FRoot.FComponentState = rtl.unionSet(this.FRoot.FComponentState,rtl.createSet($mod.TComponentStateItem.csLoading,$mod.TComponentStateItem.csReading));
          this.FRoot.ReadState(this);
          this.FRoot.FComponentState = rtl.excludeSet(this.FRoot.FComponentState,$mod.TComponentStateItem.csReading);
          if (!($impl.GlobalLoaded != null)) for (var $l = 0, $end = this.FLoaded.FCount - 1; $l <= $end; $l++) {
            i = $l;
            rtl.getObject(this.FLoaded.Get(i)).Loaded();
          };
        } finally {
          if (!($impl.GlobalLoaded != null)) rtl.free(this,"FLoaded");
          this.FLoaded = null;
        };
        $impl.GlobalFixupReferences();
      } catch ($e) {
        $mod.RemoveFixupReferences(ARoot,"");
        if (!(ARoot != null)) Result = rtl.freeLoc(Result);
        throw $e;
      };
      return Result;
    };
    this.ReadVariant = function () {
      var Result = undefined;
      var nv = 0;
      nv = this.NextValue();
      var $tmp = nv;
      if ($tmp === $mod.TValueType.vaNil) {
        Result = undefined;
        this.ReadValue();
      } else if ($tmp === $mod.TValueType.vaNull) {
        Result = null;
        this.ReadValue();
      } else if (($tmp === $mod.TValueType.vaInt8) || ($tmp === $mod.TValueType.vaInt16) || ($tmp === $mod.TValueType.vaInt32)) {
        Result = this.ReadInteger();
      } else if ($tmp === $mod.TValueType.vaNativeInt) {
        Result = this.ReadNativeInt();
      } else if (($tmp === $mod.TValueType.vaFalse) || ($tmp === $mod.TValueType.vaTrue)) {
        Result = nv !== $mod.TValueType.vaFalse;
        this.ReadValue();
      } else if ($tmp === $mod.TValueType.vaCurrency) {
        Result = this.ReadCurrency() / 10000;
      } else if ($tmp === $mod.TValueType.vaDouble) {
        Result = this.ReadFloat();
      } else if ($tmp === $mod.TValueType.vaString) {
        Result = this.ReadString();
      } else {
        throw $mod.EReadError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SUnsupportedPropertyVariantType"),pas.System.VarRecs(0,nv)]);
      };
      return Result;
    };
    this.ReadSignature = function () {
      this.FDriver.ReadSignature();
    };
    this.ReadString = function () {
      var Result = "";
      var StringType = 0;
      StringType = this.FDriver.ReadValue();
      if (StringType === $mod.TValueType.vaString) {
        Result = this.FDriver.ReadString(StringType)}
       else throw $mod.EReadError.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SInvalidPropertyValue")]);
      return Result;
    };
    this.ReadWideString = function () {
      var Result = "";
      Result = this.ReadString();
      return Result;
    };
    this.ReadUnicodeString = function () {
      var Result = "";
      Result = this.ReadString();
      return Result;
    };
    this.ReadValue = function () {
      var Result = 0;
      Result = this.FDriver.ReadValue();
      return Result;
    };
    this.CopyValue = function (Writer) {
      var $tmp = this.FDriver.NextValue();
      if ($tmp === $mod.TValueType.vaNull) {
        Writer.WriteIdent("NULL")}
       else if ($tmp === $mod.TValueType.vaFalse) {
        Writer.WriteIdent("FALSE")}
       else if ($tmp === $mod.TValueType.vaTrue) {
        Writer.WriteIdent("TRUE")}
       else if ($tmp === $mod.TValueType.vaNil) {
        Writer.WriteIdent("NIL")}
       else if (($tmp === $mod.TValueType.vaInt8) || ($tmp === $mod.TValueType.vaInt16) || ($tmp === $mod.TValueType.vaInt32)) {
        Writer.WriteInteger(this.ReadInteger())}
       else if ($tmp === $mod.TValueType.vaDouble) {
        Writer.WriteFloat(this.ReadFloat())}
       else if ($tmp === $mod.TValueType.vaString) {
        Writer.WriteString(this.ReadString())}
       else if ($tmp === $mod.TValueType.vaIdent) {
        Writer.WriteIdent(this.ReadIdent())}
       else if ($tmp === $mod.TValueType.vaNativeInt) Writer.WriteInteger$1(this.ReadNativeInt());
    };
  });
  rtl.createClass(this,"TAbstractObjectWriter",pas.System.TObject,function () {
  });
  rtl.createClass(this,"TBinaryObjectWriter",this.TAbstractObjectWriter,function () {
    this.$init = function () {
      $mod.TAbstractObjectWriter.$init.call(this);
      this.FStream = null;
      this.FBuffer = null;
      this.FBufSize = 0;
      this.FBufPos = 0;
      this.FBufEnd = 0;
    };
    this.$final = function () {
      this.FStream = undefined;
      $mod.TAbstractObjectWriter.$final.call(this);
    };
    this.WriteWord = function (w) {
      this.FStream.WriteBufferData$12(w);
    };
    this.WriteDWord = function (lw) {
      this.FStream.WriteBufferData$14(lw);
    };
    this.WriteValue = function (Value) {
      var b = 0;
      b = Value;
      this.FStream.WriteBufferData$8(b);
    };
    this.Create$1 = function (Stream) {
      pas.System.TObject.Create.call(this);
      if (Stream === null) throw $mod.EWriteError.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SEmptyStreamIllegalWriter")]);
      this.FStream = Stream;
      return this;
    };
    this.WriteSignature = function () {
      this.FStream.WriteBufferData$14(809914452);
    };
    this.BeginCollection = function () {
      this.WriteValue($mod.TValueType.vaCollection);
    };
    this.BeginComponent = function (Component, Flags, ChildPos) {
      var Prefix = 0;
      if (rtl.neSet(Flags,{})) {
        Prefix = 0;
        if ($mod.TFilerFlag.ffInherited in Flags) Prefix = Prefix | 0x1;
        if ($mod.TFilerFlag.ffChildPos in Flags) Prefix = Prefix | 0x2;
        if ($mod.TFilerFlag.ffInline in Flags) Prefix = Prefix | 0x4;
        Prefix = Prefix | 0xf0;
        this.FStream.WriteBufferData$8(Prefix);
        if ($mod.TFilerFlag.ffChildPos in Flags) this.WriteInteger(ChildPos);
      };
      this.WriteStr(Component.$classname);
      this.WriteStr(Component.FName);
    };
    this.BeginList = function () {
      this.WriteValue($mod.TValueType.vaList);
    };
    this.EndList = function () {
      this.WriteValue($mod.TValueType.vaNull);
    };
    this.BeginProperty = function (PropName) {
      this.WriteStr(PropName);
    };
    this.EndProperty = function () {
    };
    this.FlushBuffer = function () {
    };
    this.Write = function (Buffer, Count) {
      this.FStream.Write(Buffer,Count);
    };
    this.WriteBinary = function (Buffer, Count) {
      this.WriteValue($mod.TValueType.vaBinary);
      this.WriteDWord(Count >>> 0);
      this.FStream.Write(Buffer,Count);
    };
    this.WriteBoolean = function (Value) {
      if (Value) {
        this.WriteValue($mod.TValueType.vaTrue)}
       else this.WriteValue($mod.TValueType.vaFalse);
    };
    this.WriteFloat = function (Value) {
      this.WriteValue($mod.TValueType.vaDouble);
      this.FStream.WriteBufferData$20(Value);
    };
    this.WriteCurrency = function (Value) {
      var F = 0.0;
      this.WriteValue($mod.TValueType.vaCurrency);
      F = Value / 10000;
      this.FStream.WriteBufferData$20(F);
    };
    this.WriteIdent = function (Ident) {
      if (pas.SysUtils.UpperCase(Ident) === "NIL") {
        this.WriteValue($mod.TValueType.vaNil)}
       else if (pas.SysUtils.UpperCase(Ident) === "FALSE") {
        this.WriteValue($mod.TValueType.vaFalse)}
       else if (pas.SysUtils.UpperCase(Ident) === "TRUE") {
        this.WriteValue($mod.TValueType.vaTrue)}
       else if (pas.SysUtils.UpperCase(Ident) === "NULL") {
        this.WriteValue($mod.TValueType.vaNull)}
       else {
        this.WriteValue($mod.TValueType.vaIdent);
        this.WriteStr(Ident);
      };
    };
    this.WriteInteger = function (Value) {
      var s = 0;
      var i = 0;
      var l = 0;
      if ((Value >= -128) && (Value <= 127)) {
        this.WriteValue($mod.TValueType.vaInt8);
        s = Value;
        this.FStream.WriteBufferData$6(s);
      } else if ((Value >= -32768) && (Value <= 32767)) {
        this.WriteValue($mod.TValueType.vaInt16);
        i = Value;
        this.WriteWord(i & 65535);
      } else if ((Value >= -0x80000000) && (Value <= 0x7fffffff)) {
        this.WriteValue($mod.TValueType.vaInt32);
        l = Value;
        this.WriteDWord(l >>> 0);
      } else {
        this.WriteValue($mod.TValueType.vaNativeInt);
        this.FStream.WriteBufferData$16(Value);
      };
    };
    this.WriteNativeInt = function (Value) {
      var s = 0;
      var i = 0;
      var l = 0;
      if (Value <= 127) {
        this.WriteValue($mod.TValueType.vaInt8);
        s = Value;
        this.FStream.WriteBufferData$6(s);
      } else if (Value <= 32767) {
        this.WriteValue($mod.TValueType.vaInt16);
        i = Value;
        this.WriteWord(i & 65535);
      } else if (Value <= 0x7fffffff) {
        this.WriteValue($mod.TValueType.vaInt32);
        l = Value;
        this.WriteDWord(l >>> 0);
      } else {
        this.WriteValue($mod.TValueType.vaNativeInt);
        this.FStream.WriteBufferData$16(Value);
      };
    };
    this.WriteMethodName = function (Name) {
      if (Name.length > 0) {
        this.WriteValue($mod.TValueType.vaIdent);
        this.WriteStr(Name);
      } else this.WriteValue($mod.TValueType.vaNil);
    };
    this.WriteSet = function (Value, SetType) {
      var i = 0;
      var b = 0;
      this.WriteValue($mod.TValueType.vaSet);
      b = 1;
      for (i = 0; i <= 31; i++) {
        if ((Value & b) !== 0) {
          this.WriteStr(pas.TypInfo.GetEnumName(SetType,i));
        };
        b = b << 1;
      };
      this.WriteStr("");
    };
    this.WriteStr = function (Value) {
      var len = 0;
      var i = 0;
      var b = 0;
      len = Value.length;
      if (len > 255) len = 255;
      b = len;
      this.FStream.WriteBufferData$8(b);
      for (var $l = 1, $end = len; $l <= $end; $l++) {
        i = $l;
        this.FStream.WriteBufferData$4(Value.charAt(i - 1));
      };
    };
    this.WriteString = function (Value) {
      var i = 0;
      var len = 0;
      len = Value.length;
      this.WriteValue($mod.TValueType.vaString);
      this.WriteDWord(len);
      for (var $l = 1, $end = len; $l <= $end; $l++) {
        i = $l;
        this.FStream.WriteBufferData$4(Value.charAt(i - 1));
      };
    };
    this.WriteWideString = function (Value) {
      this.WriteString(Value);
    };
    this.WriteUnicodeString = function (Value) {
      this.WriteString(Value);
    };
    this.WriteVariant = function (VarValue) {
      if (pas.JS.isUndefined(VarValue)) {
        this.WriteValue($mod.TValueType.vaNil)}
       else if (pas.JS.isNull(VarValue)) {
        this.WriteValue($mod.TValueType.vaNull)}
       else if (rtl.isNumber(VarValue)) {
        if (pas.System.Frac(rtl.getNumber(VarValue)) === 0) {
          this.WriteInteger(rtl.trunc(VarValue))}
         else this.WriteFloat(rtl.getNumber(VarValue));
      } else if (pas.JS.isBoolean(VarValue)) {
        this.WriteBoolean(!(VarValue == false))}
       else if (rtl.isString(VarValue)) {
        this.WriteString("" + VarValue)}
       else throw $mod.EWriteError.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SUnsupportedPropertyVariantType")]);
    };
  });
  this.$rtti.$MethodVar("TFindAncestorEvent",{procsig: rtl.newTIProcSig([["Writer",this.$rtti["TWriter"]],["Component",this.$rtti["TComponent"]],["Name",rtl.string,2],["Ancestor",this.$rtti["TComponent"],1],["RootAncestor",this.$rtti["TComponent"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TWriteMethodPropertyEvent",{procsig: rtl.newTIProcSig([["Writer",this.$rtti["TWriter"]],["Instance",this.$rtti["TPersistent"]],["PropInfo",pas.TypInfo.$rtti["TTypeMemberProperty"]],["MethodValue",pas.System.$rtti["TMethod"],2],["DefMethodValue",pas.System.$rtti["TMethod"],2],["Handled",rtl.boolean,1]]), methodkind: 0});
  rtl.createClass(this,"TWriter",this.TFiler,function () {
    this.$init = function () {
      $mod.TFiler.$init.call(this);
      this.FDriver = null;
      this.FDestroyDriver = false;
      this.FRootAncestor = null;
      this.FPropPath = "";
      this.FAncestors = null;
      this.FAncestorPos = 0;
      this.FCurrentPos = 0;
      this.FOnFindAncestor = null;
      this.FOnWriteMethodProperty = null;
      this.FOnWriteStringProperty = null;
    };
    this.$final = function () {
      this.FDriver = undefined;
      this.FRootAncestor = undefined;
      this.FAncestors = undefined;
      this.FOnFindAncestor = undefined;
      this.FOnWriteMethodProperty = undefined;
      this.FOnWriteStringProperty = undefined;
      $mod.TFiler.$final.call(this);
    };
    this.AddToAncestorList = function (Component) {
      this.FAncestors.AddObject(Component.FName,$impl.TPosComponent.$create("Create$1",[this.FAncestors.GetCount(),Component]));
    };
    this.WriteComponentData = function (Instance) {
      var Flags = {};
      Flags = {};
      if ((this.FAncestor != null) && (!($mod.TComponentStateItem.csInline in Instance.FComponentState) || (($mod.TComponentStateItem.csAncestor in Instance.FComponentState) && (this.FAncestors !== null)))) {
        Flags = rtl.createSet($mod.TFilerFlag.ffInherited)}
       else if ($mod.TComponentStateItem.csInline in Instance.FComponentState) Flags = rtl.createSet($mod.TFilerFlag.ffInline);
      if ((this.FAncestors !== null) && ((this.FCurrentPos !== this.FAncestorPos) || (this.FAncestor === null))) Flags = rtl.includeSet(Flags,$mod.TFilerFlag.ffChildPos);
      this.FDriver.BeginComponent(Instance,rtl.refSet(Flags),this.FCurrentPos);
      if (this.FAncestors !== null) this.FCurrentPos += 1;
      this.WriteProperties(Instance);
      this.WriteListEnd();
      if (!this.FIgnoreChildren) this.WriteChildren(Instance);
    };
    this.DetermineAncestor = function (Component) {
      var I = 0;
      if (!(this.FAncestors != null)) return;
      I = this.FAncestors.IndexOf(Component.FName);
      if (I === -1) {
        this.FAncestor = null;
        this.FAncestorPos = -1;
      } else {
        this.FAncestor = this.FAncestors.GetObject(I).FComponent;
        this.FAncestorPos = this.FAncestors.GetObject(I).FPos;
      };
    };
    this.DoFindAncestor = function (Component) {
      var C = null;
      if (this.FOnFindAncestor != null) if ((this.FAncestor === null) || $mod.TComponent.isPrototypeOf(this.FAncestor)) {
        C = this.FAncestor;
        this.FOnFindAncestor(this,Component,Component.FName,{get: function () {
            return C;
          }, set: function (v) {
            C = v;
          }},{p: this, get: function () {
            return this.p.FRootAncestor;
          }, set: function (v) {
            this.p.FRootAncestor = v;
          }});
        this.FAncestor = C;
      };
    };
    this.SetRoot = function (ARoot) {
      $mod.TFiler.SetRoot.call(this,ARoot);
      this.FLookupRoot = ARoot;
    };
    this.WriteBinary = function (AWriteData) {
      var MemBuffer = null;
      MemBuffer = $mod.TBytesStream.$create("Create");
      try {
        AWriteData(MemBuffer);
        this.FDriver.WriteBinary(MemBuffer.GetBytes(),MemBuffer.GetSize());
      } finally {
        MemBuffer = rtl.freeLoc(MemBuffer);
      };
    };
    this.WriteProperty = function (Instance, PropInfo) {
      var HasAncestor = false;
      var PropType = null;
      var N = 0;
      var Value = 0;
      var DefValue = 0;
      var Ident = "";
      var IntToIdentFn = null;
      var FloatValue = 0.0;
      var DefFloatValue = 0.0;
      var MethodValue = pas.System.TMethod.$new();
      var DefMethodValue = pas.System.TMethod.$new();
      var StrValue = "";
      var DefStrValue = "";
      var AncestorObj = null;
      var C = null;
      var Component = null;
      var ObjValue = null;
      var SavedAncestor = null;
      var Key = "";
      var SavedPropPath = "";
      var Name = "";
      var lMethodName = "";
      var VarValue = undefined;
      var DefVarValue = undefined;
      var BoolValue = false;
      var DefBoolValue = false;
      var Handled = false;
      var O = null;
      if (PropInfo.getter === "") return;
      PropType = PropInfo.typeinfo;
      if (PropInfo.setter === "") {
        if (PropType.kind !== pas.System.TTypeKind.tkClass) return;
        ObjValue = pas.TypInfo.GetObjectProp$2(Instance,PropInfo);
        if (!ObjValue.$class.InheritsFrom($mod.TComponent) || !($mod.TComponentStyleItem.csSubComponent in ObjValue.FComponentStyle)) return;
      };
      HasAncestor = (this.FAncestor != null) && ((Instance === this.FRoot) || (Instance.$class.ClassType() === this.FAncestor.$class.ClassType()));
      var $tmp = PropType.kind;
      if (($tmp === pas.System.TTypeKind.tkInteger) || ($tmp === pas.System.TTypeKind.tkChar) || ($tmp === pas.System.TTypeKind.tkEnumeration) || ($tmp === pas.System.TTypeKind.tkSet)) {
        Value = pas.TypInfo.GetOrdProp$1(Instance,PropInfo);
        if (HasAncestor) {
          DefValue = pas.TypInfo.GetOrdProp$1(this.FAncestor,PropInfo)}
         else {
          if (PropType.kind !== pas.System.TTypeKind.tkSet) {
            DefValue = rtl.trunc(PropInfo.Default)}
           else {
            O = PropInfo.Default;
            DefValue = 0;
            for (Key in O) {
              N = parseInt(Key,10);
              if (N < 32) DefValue = DefValue + (1 << N);
            };
          };
        };
        if ((Value !== DefValue) || (DefValue === 0x80000000)) {
          this.FDriver.BeginProperty(this.FPropPath + PropInfo.name);
          var $tmp1 = PropType.kind;
          if ($tmp1 === pas.System.TTypeKind.tkInteger) {
            IntToIdentFn = $mod.FindIntToIdent(PropInfo.typeinfo);
            if ((IntToIdentFn != null) && IntToIdentFn(Value,{get: function () {
                return Ident;
              }, set: function (v) {
                Ident = v;
              }})) {
              this.WriteIdent(Ident)}
             else this.WriteInteger(Value);
          } else if ($tmp1 === pas.System.TTypeKind.tkChar) {
            this.WriteChar(String.fromCharCode(Value))}
           else if ($tmp1 === pas.System.TTypeKind.tkSet) {
            this.FDriver.WriteSet(Value,PropType.comptype);
          } else if ($tmp1 === pas.System.TTypeKind.tkEnumeration) this.WriteIdent(pas.TypInfo.GetEnumName(PropType,Value));
          this.FDriver.EndProperty();
        };
      } else if ($tmp === pas.System.TTypeKind.tkDouble) {
        FloatValue = pas.TypInfo.GetFloatProp$1(Instance,PropInfo);
        if (HasAncestor) {
          DefFloatValue = pas.TypInfo.GetFloatProp$1(this.FAncestor,PropInfo)}
         else {
          DefFloatValue = rtl.getNumber(PropInfo.Default);
        };
        if ((FloatValue !== DefFloatValue) || (!HasAncestor && (pas.System.Int(DefFloatValue) === 0x80000000))) {
          this.FDriver.BeginProperty(this.FPropPath + PropInfo.name);
          this.WriteFloat(FloatValue);
          this.FDriver.EndProperty();
        };
      } else if ($tmp === pas.System.TTypeKind.tkMethod) {
        MethodValue.$assign(pas.TypInfo.GetMethodProp(Instance,PropInfo));
        if (HasAncestor) {
          DefMethodValue.$assign(pas.TypInfo.GetMethodProp(this.FAncestor,PropInfo))}
         else {
          DefMethodValue.Data = null;
          DefMethodValue.Code = null;
        };
        Handled = false;
        if (this.FOnWriteMethodProperty != null) this.FOnWriteMethodProperty(this,Instance,PropInfo,MethodValue,DefMethodValue,{get: function () {
            return Handled;
          }, set: function (v) {
            Handled = v;
          }});
        if (rtl.isString(MethodValue.Code)) {
          lMethodName = MethodValue.Code}
         else lMethodName = this.FLookupRoot.$class.MethodName(MethodValue.Code);
        if (!Handled && (MethodValue.Code !== DefMethodValue.Code) && (!(MethodValue.Code != null) || (lMethodName.length > 0))) {
          this.FDriver.BeginProperty(this.FPropPath + PropInfo.name);
          if (MethodValue.Code != null) {
            this.FDriver.WriteMethodName(lMethodName)}
           else this.FDriver.WriteMethodName("");
          this.FDriver.EndProperty();
        };
      } else if ($tmp === pas.System.TTypeKind.tkString) {
        StrValue = pas.TypInfo.GetStrProp$1(Instance,PropInfo);
        if (HasAncestor) {
          DefStrValue = pas.TypInfo.GetStrProp$1(this.FAncestor,PropInfo)}
         else {
          DefValue = rtl.trunc(PropInfo.Default);
          DefStrValue = rtl.strSetLength(DefStrValue,0);
        };
        if ((StrValue !== DefStrValue) || (!HasAncestor && (DefValue === 0x80000000))) {
          this.FDriver.BeginProperty(this.FPropPath + PropInfo.name);
          if (this.FOnWriteStringProperty != null) this.FOnWriteStringProperty(this,Instance,PropInfo,{get: function () {
              return StrValue;
            }, set: function (v) {
              StrValue = v;
            }});
          this.WriteString(StrValue);
          this.FDriver.EndProperty();
        };
      } else if ($tmp === pas.System.TTypeKind.tkJSValue) {
        VarValue = pas.TypInfo.GetJSValueProp$3(Instance,PropInfo);
        if (HasAncestor) {
          DefVarValue = pas.TypInfo.GetJSValueProp$3(this.FAncestor,PropInfo)}
         else DefVarValue = null;
        if (VarValue != DefVarValue) {
          this.FDriver.BeginProperty(this.FPropPath + PropInfo.name);
          this.WriteVariant(VarValue);
          this.FDriver.EndProperty();
        };
      } else if ($tmp === pas.System.TTypeKind.tkClass) {
        ObjValue = pas.TypInfo.GetObjectProp$2(Instance,PropInfo);
        if (HasAncestor) {
          AncestorObj = pas.TypInfo.GetObjectProp$2(this.FAncestor,PropInfo);
          if ($mod.TComponent.isPrototypeOf(AncestorObj) && $mod.TComponent.isPrototypeOf(ObjValue)) {
            if ((AncestorObj !== ObjValue) && (AncestorObj.FOwner === this.FRootAncestor) && (ObjValue.FOwner === this.FRoot) && (pas.SysUtils.UpperCase(AncestorObj.FName) === pas.SysUtils.UpperCase(ObjValue.FName))) {
              AncestorObj = ObjValue;
            };
          };
        } else AncestorObj = null;
        if (!(ObjValue != null)) {
          if (ObjValue !== AncestorObj) {
            this.FDriver.BeginProperty(this.FPropPath + PropInfo.name);
            this.FDriver.WriteIdent("NIL");
            this.FDriver.EndProperty();
          };
        } else if (ObjValue.$class.InheritsFrom($mod.TPersistent)) {
          if (ObjValue.$class.InheritsFrom($mod.TComponent) && (!($mod.TComponentStyleItem.csSubComponent in ObjValue.FComponentStyle) || ((ObjValue.FOwner !== Instance) && (ObjValue.FOwner !== null)))) {
            Component = ObjValue;
            if ((ObjValue !== AncestorObj) && !($mod.TComponentStyleItem.csTransient in Component.FComponentStyle)) {
              Name = "";
              C = Component;
              while ((C !== null) && (C.FName !== "")) {
                if (Name !== "") Name = "." + Name;
                if (C.FOwner === this.FLookupRoot) {
                  Name = C.FName + Name;
                  break;
                } else if (C === this.FLookupRoot) {
                  Name = "Owner" + Name;
                  break;
                };
                Name = C.FName + Name;
                C = C.FOwner;
              };
              if ((C === null) && (Component.FOwner === null)) if (Name !== "") Name = Name + ".Owner";
              if (Name.length > 0) {
                this.FDriver.BeginProperty(this.FPropPath + PropInfo.name);
                this.WriteIdent(Name);
                this.FDriver.EndProperty();
              };
            };
          } else {
            SavedAncestor = this.FAncestor;
            SavedPropPath = this.FPropPath;
            try {
              this.FPropPath = this.FPropPath + PropInfo.name + ".";
              if (HasAncestor) this.FAncestor = pas.TypInfo.GetObjectProp$2(this.FAncestor,PropInfo);
              this.WriteProperties(ObjValue);
            } finally {
              this.FAncestor = SavedAncestor;
              this.FPropPath = SavedPropPath;
            };
            if (ObjValue.$class.InheritsFrom($mod.TCollection)) {
              if (!HasAncestor || !$mod.CollectionsEqual$1(ObjValue,pas.TypInfo.GetObjectProp$2(this.FAncestor,PropInfo),this.FRoot,this.FRootAncestor)) {
                this.FDriver.BeginProperty(this.FPropPath + PropInfo.name);
                SavedPropPath = this.FPropPath;
                try {
                  this.FPropPath = rtl.strSetLength(this.FPropPath,0);
                  this.WriteCollection(ObjValue);
                } finally {
                  this.FPropPath = SavedPropPath;
                  this.FDriver.EndProperty();
                };
              };
            };
          };
        };
      } else if ($tmp === pas.System.TTypeKind.tkBool) {
        BoolValue = pas.TypInfo.GetOrdProp$1(Instance,PropInfo) !== 0;
        if (HasAncestor) {
          DefBoolValue = pas.TypInfo.GetOrdProp$1(this.FAncestor,PropInfo) !== 0}
         else {
          DefBoolValue = PropInfo.Default != 0;
          DefValue = rtl.trunc(PropInfo.Default);
        };
        if ((BoolValue !== DefBoolValue) || (DefValue === 0x80000000)) {
          this.FDriver.BeginProperty(this.FPropPath + PropInfo.name);
          this.WriteBoolean(BoolValue);
          this.FDriver.EndProperty();
        };
      } else if ($tmp === pas.System.TTypeKind.tkInterface) ;
    };
    this.WriteProperties = function (Instance) {
      var PropCount = 0;
      var i = 0;
      var PropList = [];
      PropList = pas.TypInfo.GetPropList$3(Instance);
      PropCount = rtl.length(PropList);
      if (PropCount > 0) for (var $l = 0, $end = PropCount - 1; $l <= $end; $l++) {
        i = $l;
        if (pas.TypInfo.IsStoredProp(Instance,PropList[i])) this.WriteProperty(Instance,PropList[i]);
      };
      Instance.DefineProperties(this);
    };
    this.WriteChildren = function (Component) {
      var SRoot = null;
      var SRootA = null;
      var SList = null;
      var SPos = 0;
      var I = 0;
      var SAncestorPos = 0;
      var O = null;
      SRoot = this.FRoot;
      SRootA = this.FRootAncestor;
      SList = this.FAncestors;
      SPos = this.FCurrentPos;
      SAncestorPos = this.FAncestorPos;
      try {
        this.FAncestors = null;
        this.FCurrentPos = 0;
        this.FAncestorPos = -1;
        if ($mod.TComponentStateItem.csInline in Component.FComponentState) this.FRoot = Component;
        if ($mod.TComponent.isPrototypeOf(this.FAncestor)) {
          this.FAncestors = $mod.TStringList.$create("Create$1");
          if ($mod.TComponentStateItem.csInline in this.FAncestor.FComponentState) this.FRootAncestor = this.FAncestor;
          this.FAncestor.GetChildren(rtl.createCallback(this,"AddToAncestorList"),this.FRootAncestor);
          this.FAncestors.SetSorted(true);
        };
        try {
          Component.GetChildren(rtl.createCallback(this,"WriteComponent"),this.FRoot);
        } finally {
          if (this.FAncestors != null) for (var $l = 0, $end = this.FAncestors.GetCount() - 1; $l <= $end; $l++) {
            I = $l;
            O = this.FAncestors.GetObject(I);
            this.FAncestors.PutObject(I,null);
            O = rtl.freeLoc(O);
          };
          pas.SysUtils.FreeAndNil({p: this, get: function () {
              return this.p.FAncestors;
            }, set: function (v) {
              this.p.FAncestors = v;
            }});
        };
      } finally {
        this.FAncestors = SList;
        this.FRoot = SRoot;
        this.FRootAncestor = SRootA;
        this.FCurrentPos = SPos;
        this.FAncestorPos = SAncestorPos;
      };
    };
    this.CreateDriver = function (Stream) {
      var Result = null;
      Result = $mod.TBinaryObjectWriter.$create("Create$1",[Stream]);
      return Result;
    };
    this.Create$1 = function (ADriver) {
      pas.System.TObject.Create.call(this);
      this.FDriver = ADriver;
      return this;
    };
    this.Create$2 = function (Stream) {
      pas.System.TObject.Create.call(this);
      if (Stream === null) throw $mod.EWriteError.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SEmptyStreamIllegalWriter")]);
      this.FDriver = this.CreateDriver(Stream);
      this.FDestroyDriver = true;
      return this;
    };
    this.Destroy = function () {
      if (this.FDestroyDriver) rtl.free(this,"FDriver");
      pas.System.TObject.Destroy.call(this);
    };
    this.DefineProperty = function (Name, ReadData, AWriteData, HasData) {
      if (HasData && (AWriteData != null)) {
        this.FDriver.BeginProperty(this.FPropPath + Name);
        AWriteData(this);
        this.FDriver.EndProperty();
      } else if (ReadData != null) ;
    };
    this.DefineBinaryProperty = function (Name, ReadData, AWriteData, HasData) {
      if (HasData && (AWriteData != null)) {
        this.FDriver.BeginProperty(this.FPropPath + Name);
        this.WriteBinary(AWriteData);
        this.FDriver.EndProperty();
      } else if (ReadData != null) ;
    };
    this.FlushBuffer = function () {
      this.FDriver.FlushBuffer();
    };
    this.Write = function (Buffer, Count) {
      this.FDriver.Write(Buffer,Count);
    };
    this.WriteBoolean = function (Value) {
      this.FDriver.WriteBoolean(Value);
    };
    this.WriteCollection = function (Value) {
      var i = 0;
      this.FDriver.BeginCollection();
      if (Value != null) for (var $l = 0, $end = Value.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        this.WriteListBegin();
        this.WriteProperties(Value.GetItem(i));
        this.WriteListEnd();
      };
      this.WriteListEnd();
    };
    this.WriteComponent = function (Component) {
      var SA = null;
      var SR = null;
      var SRA = null;
      SR = this.FRoot;
      SA = this.FAncestor;
      SRA = this.FRootAncestor;
      try {
        Component.FComponentState = rtl.unionSet(Component.FComponentState,rtl.createSet($mod.TComponentStateItem.csWriting));
        try {
          this.DetermineAncestor(Component);
          this.DoFindAncestor(Component);
          Component.WriteState(this);
          this.FDriver.EndList();
        } finally {
          Component.FComponentState = rtl.diffSet(Component.FComponentState,rtl.createSet($mod.TComponentStateItem.csWriting));
        };
      } finally {
        this.FAncestor = SA;
        this.FRoot = SR;
        this.FRootAncestor = SRA;
      };
    };
    this.WriteChar = function (Value) {
      this.WriteString(Value);
    };
    this.WriteWideChar = function (Value) {
      this.WriteWideString(Value);
    };
    this.WriteDescendent = function (ARoot, AAncestor) {
      this.FRoot = ARoot;
      this.FAncestor = AAncestor;
      this.FRootAncestor = AAncestor;
      this.FLookupRoot = ARoot;
      this.WriteSignature();
      this.WriteComponent(ARoot);
    };
    this.WriteFloat = function (Value) {
      this.FDriver.WriteFloat(Value);
    };
    this.WriteCurrency = function (Value) {
      this.FDriver.WriteCurrency(Value);
    };
    this.WriteIdent = function (Ident) {
      this.FDriver.WriteIdent(Ident);
    };
    this.WriteInteger = function (Value) {
      this.FDriver.WriteInteger(Value);
    };
    this.WriteInteger$1 = function (Value) {
      this.FDriver.WriteInteger(Value);
    };
    this.WriteSet = function (Value, SetType) {
      this.FDriver.WriteSet(Value,SetType);
    };
    this.WriteListBegin = function () {
      this.FDriver.BeginList();
    };
    this.WriteListEnd = function () {
      this.FDriver.EndList();
    };
    this.WriteSignature = function () {
      this.FDriver.WriteSignature();
    };
    this.WriteRootComponent = function (ARoot) {
      this.WriteDescendent(ARoot,null);
    };
    this.WriteString = function (Value) {
      this.FDriver.WriteString(Value);
    };
    this.WriteWideString = function (Value) {
      this.FDriver.WriteWideString(Value);
    };
    this.WriteUnicodeString = function (Value) {
      this.FDriver.WriteUnicodeString(Value);
    };
    this.WriteVariant = function (VarValue) {
      this.FDriver.WriteVariant(VarValue);
    };
  });
  this.TParserToken = {"0": "toUnknown", toUnknown: 0, "1": "toEOF", toEOF: 1, "2": "toSymbol", toSymbol: 2, "3": "ToString", ToString: 3, "4": "toInteger", toInteger: 4, "5": "toFloat", toFloat: 5, "6": "toMinus", toMinus: 6, "7": "toSetStart", toSetStart: 7, "8": "toListStart", toListStart: 8, "9": "toCollectionStart", toCollectionStart: 9, "10": "toBinaryStart", toBinaryStart: 10, "11": "toSetEnd", toSetEnd: 11, "12": "toListEnd", toListEnd: 12, "13": "toCollectionEnd", toCollectionEnd: 13, "14": "toBinaryEnd", toBinaryEnd: 14, "15": "toComma", toComma: 15, "16": "toDot", toDot: 16, "17": "toEqual", toEqual: 17, "18": "toColon", toColon: 18, "19": "toPlus", toPlus: 19};
  this.$rtti.$Enum("TParserToken",{minvalue: 0, maxvalue: 19, ordtype: 1, enumtype: this.TParserToken});
  rtl.createClass(this,"TParser",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.fStream = null;
      this.fBuf = [];
      this.FBufLen = 0;
      this.fPos = 0;
      this.fDeltaPos = 0;
      this.fFloatType = "\x00";
      this.fSourceLine = 0;
      this.fToken = 0;
      this.fEofReached = false;
      this.fLastTokenStr = "";
    };
    this.$final = function () {
      this.fStream = undefined;
      this.fBuf = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.GetTokenName = function (aTok) {
      var Result = "";
      Result = $impl.TokNames[aTok];
      return Result;
    };
    this.LoadBuffer = function () {
      var CharsRead = 0;
      var i = 0;
      CharsRead = 0;
      for (i = 0; i <= 4095; i++) {
        if (this.fStream.ReadData$3({a: i, p: this.fBuf, get: function () {
            return this.p[this.a];
          }, set: function (v) {
            this.p[this.a] = v;
          }}) !== 2) break;
        CharsRead += 1;
      };
      this.fDeltaPos += CharsRead;
      this.fPos = 0;
      this.FBufLen = CharsRead;
      this.fEofReached = CharsRead === 0;
    };
    this.CheckLoadBuffer = function () {
      if (this.fPos >= this.FBufLen) this.LoadBuffer();
    };
    this.ProcessChar = function () {
      this.fLastTokenStr = this.fLastTokenStr + this.fBuf[this.fPos];
      this.GotoToNextChar();
    };
    this.IsNumber = function () {
      var Result = false;
      Result = this.fBuf[this.fPos].charCodeAt() in rtl.createSet(null,48,57);
      return Result;
    };
    this.IsHexNum = function () {
      var Result = false;
      Result = this.fBuf[this.fPos].charCodeAt() in rtl.createSet(null,48,57,null,65,70,null,97,102);
      return Result;
    };
    this.IsAlpha = function () {
      var Result = false;
      Result = this.fBuf[this.fPos].charCodeAt() in rtl.createSet(95,null,65,90,null,97,122);
      return Result;
    };
    this.IsAlphaNum = function () {
      var Result = false;
      Result = this.IsAlpha() || this.IsNumber();
      return Result;
    };
    this.GetHexValue = function (c) {
      var Result = 0;
      var $tmp = c;
      if (($tmp >= "0") && ($tmp <= "9")) {
        Result = c.charCodeAt() - 0x30}
       else if (($tmp >= "A") && ($tmp <= "F")) {
        Result = c.charCodeAt() - 0x37}
       else if (($tmp >= "a") && ($tmp <= "f")) Result = c.charCodeAt() - 0x57;
      return Result;
    };
    this.GetAlphaNum = function () {
      var Result = "";
      if (!this.IsAlpha()) this.ErrorFmt(rtl.getResStr(pas.RTLConsts,"SParserExpected"),pas.System.VarRecs(18,this.GetTokenName($mod.TParserToken.toSymbol)));
      Result = "";
      while (!this.fEofReached && this.IsAlphaNum()) {
        Result = Result + this.fBuf[this.fPos];
        this.GotoToNextChar();
      };
      return Result;
    };
    this.HandleNewLine = function () {
      if (this.fBuf[this.fPos] === "\r") this.GotoToNextChar();
      if (!this.fEofReached && (this.fBuf[this.fPos] === "\n")) this.GotoToNextChar();
      this.fSourceLine += 1;
      this.fDeltaPos = -(this.fPos - 1);
    };
    this.SkipBOM = function () {
    };
    this.SkipSpaces = function () {
      while (!this.fEofReached && (this.fBuf[this.fPos].charCodeAt() in rtl.createSet(32,9))) this.GotoToNextChar();
    };
    this.SkipWhitespace = function () {
      while (!this.fEofReached) {
        var $tmp = this.fBuf[this.fPos];
        if (($tmp === " ") || ($tmp === "\t")) {
          this.SkipSpaces()}
         else if (($tmp === "\n") || ($tmp === "\r")) {
          this.HandleNewLine()}
         else {
          break;
        };
      };
    };
    this.HandleEof = function () {
      this.fToken = $mod.TParserToken.toEOF;
      this.fLastTokenStr = "";
    };
    this.HandleAlphaNum = function () {
      this.fLastTokenStr = this.GetAlphaNum();
      this.fToken = $mod.TParserToken.toSymbol;
    };
    var floatPunct = {"0": "fpDot", fpDot: 0, "1": "fpE", fpE: 1};
    this.HandleNumber = function () {
      var allowed = {};
      this.fLastTokenStr = "";
      while (this.IsNumber()) this.ProcessChar();
      this.fToken = $mod.TParserToken.toInteger;
      if (this.fBuf[this.fPos].charCodeAt() in rtl.createSet(46,101,69)) {
        this.fToken = $mod.TParserToken.toFloat;
        allowed = rtl.createSet(floatPunct.fpDot,floatPunct.fpE);
        while (this.fBuf[this.fPos].charCodeAt() in rtl.createSet(46,101,69,null,48,57)) {
          var $tmp = this.fBuf[this.fPos];
          if ($tmp === ".") {
            if (floatPunct.fpDot in allowed) {
              allowed = rtl.excludeSet(allowed,floatPunct.fpDot)}
             else break}
           else if (($tmp === "E") || ($tmp === "e")) if (floatPunct.fpE in allowed) {
            allowed = {};
            this.ProcessChar();
            if (this.fBuf[this.fPos].charCodeAt() in rtl.createSet(43,45)) this.ProcessChar();
            if (!(this.fBuf[this.fPos].charCodeAt() in rtl.createSet(null,48,57))) this.ErrorFmt(rtl.getResStr(pas.RTLConsts,"SParserInvalidFloat"),pas.System.VarRecs(18,this.fLastTokenStr + this.fBuf[this.fPos]));
          } else break;
          this.ProcessChar();
        };
      };
      if (this.fBuf[this.fPos].charCodeAt() in rtl.createSet(115,83,100,68,99,67)) {
        this.fFloatType = this.fBuf[this.fPos];
        this.GotoToNextChar();
        this.fToken = $mod.TParserToken.toFloat;
      } else this.fFloatType = "\x00";
    };
    this.HandleHexNumber = function () {
      var valid = false;
      this.fLastTokenStr = "$";
      this.GotoToNextChar();
      valid = false;
      while (this.IsHexNum()) {
        valid = true;
        this.ProcessChar();
      };
      if (!valid) this.ErrorFmt(rtl.getResStr(pas.RTLConsts,"SParserInvalidInteger"),pas.System.VarRecs(18,this.fLastTokenStr));
      this.fToken = $mod.TParserToken.toInteger;
    };
    this.HandleQuotedString = function () {
      var Result = "";
      Result = "";
      this.GotoToNextChar();
      while (true) {
        var $tmp = this.fBuf[this.fPos];
        if ($tmp === "\x00") {
          this.ErrorStr(rtl.getResStr(pas.RTLConsts,"SParserUnterminatedString"))}
         else if (($tmp === "\r") || ($tmp === "\n")) {
          this.ErrorStr(rtl.getResStr(pas.RTLConsts,"SParserUnterminatedString"))}
         else if ($tmp === "'") {
          this.GotoToNextChar();
          if (this.fBuf[this.fPos] !== "'") return Result;
        };
        Result = Result + this.fBuf[this.fPos];
        this.GotoToNextChar();
      };
      return Result;
    };
    this.HandleDecimalCharacter = function () {
      var Result = "\x00";
      var i = 0;
      this.GotoToNextChar();
      i = 0;
      while (this.IsNumber() && (i < 65535)) {
        i = ((i * 10) + this.fBuf[this.fPos].charCodeAt()) - 48;
        this.GotoToNextChar();
      };
      if (i > 65535) i = 0;
      Result = String.fromCharCode(i);
      return Result;
    };
    this.HandleString = function () {
      var s = "";
      this.fLastTokenStr = "";
      while (true) {
        var $tmp = this.fBuf[this.fPos];
        if ($tmp === "'") {
          s = this.HandleQuotedString();
          this.fLastTokenStr = this.fLastTokenStr + s;
        } else if ($tmp === "#") {
          this.fLastTokenStr = this.fLastTokenStr + this.HandleDecimalCharacter();
        } else {
          break;
        };
      };
      this.fToken = $mod.TParserToken.ToString;
    };
    this.HandleMinus = function () {
      this.GotoToNextChar();
      if (this.IsNumber()) {
        this.HandleNumber();
        this.fLastTokenStr = "-" + this.fLastTokenStr;
      } else {
        this.fToken = $mod.TParserToken.toMinus;
        this.fLastTokenStr = "-";
      };
    };
    this.HandleUnknown = function () {
      this.fToken = $mod.TParserToken.toUnknown;
      this.fLastTokenStr = this.fBuf[this.fPos];
      this.GotoToNextChar();
    };
    this.GotoToNextChar = function () {
      this.fPos += 1;
      this.CheckLoadBuffer();
    };
    this.Create$1 = function (Stream) {
      this.fStream = Stream;
      this.fBuf = rtl.arraySetLength(this.fBuf,"\x00",4096);
      this.FBufLen = 0;
      this.fPos = 0;
      this.fDeltaPos = 1;
      this.fSourceLine = 1;
      this.fEofReached = false;
      this.fLastTokenStr = "";
      this.fFloatType = "\x00";
      this.fToken = $mod.TParserToken.toEOF;
      this.LoadBuffer();
      this.SkipBOM();
      this.NextToken();
      return this;
    };
    this.Destroy = function () {
      var aCount = 0;
      aCount = this.fLastTokenStr.length * 2;
      this.fStream.SetPosition(this.SourcePos() - aCount);
    };
    this.CheckToken = function (T) {
      if (this.fToken !== T) this.ErrorFmt(rtl.getResStr(pas.RTLConsts,"SParserWrongTokenType"),pas.System.VarRecs(18,this.GetTokenName(T),18,this.GetTokenName(this.fToken)));
    };
    this.CheckTokenSymbol = function (S) {
      this.CheckToken($mod.TParserToken.toSymbol);
      if (pas.SysUtils.CompareText(this.fLastTokenStr,S) !== 0) this.ErrorFmt(rtl.getResStr(pas.RTLConsts,"SParserWrongTokenSymbol"),pas.System.VarRecs(18,S,18,this.fLastTokenStr));
    };
    this.Error = function (Ident) {
      this.ErrorStr(Ident);
    };
    this.ErrorFmt = function (Ident, Args) {
      this.ErrorStr(pas.SysUtils.Format(Ident,Args));
    };
    this.ErrorStr = function (Message) {
      throw $mod.EParserError.$create("CreateFmt",[Message + rtl.getResStr(pas.RTLConsts,"SParserLocInfo"),pas.System.VarRecs(0,this.fSourceLine,0,this.fPos + this.fDeltaPos,0,this.SourcePos())]);
    };
    this.HexToBinary = function (Stream) {
      var outbuf = [];
      var b = 0;
      var i = 0;
      outbuf = rtl.arraySetLength(outbuf,0,4096);
      i = 0;
      this.SkipWhitespace();
      while (this.IsHexNum()) {
        b = this.GetHexValue(this.fBuf[this.fPos]) << 4;
        this.GotoToNextChar();
        if (!this.IsHexNum()) this.Error(rtl.getResStr(pas.RTLConsts,"SParserUnterminatedBinValue"));
        b = b | this.GetHexValue(this.fBuf[this.fPos]);
        this.GotoToNextChar();
        outbuf[i] = b;
        i += 1;
        if (i >= 4096) {
          Stream.WriteBuffer(outbuf,i);
          i = 0;
        };
        this.SkipWhitespace();
      };
      if (i > 0) Stream.WriteBuffer(outbuf,i);
      this.NextToken();
    };
    this.NextToken = function () {
      var $Self = this;
      var Result = 0;
      function SetToken(aToken) {
        $Self.fToken = aToken;
        $Self.GotoToNextChar();
      };
      this.SkipWhitespace();
      if (this.fEofReached) {
        this.HandleEof()}
       else {
        var $tmp = this.fBuf[this.fPos];
        if (($tmp === "_") || (($tmp >= "A") && ($tmp <= "Z")) || (($tmp >= "a") && ($tmp <= "z"))) {
          this.HandleAlphaNum()}
         else if ($tmp === "$") {
          this.HandleHexNumber()}
         else if ($tmp === "-") {
          this.HandleMinus()}
         else if (($tmp >= "0") && ($tmp <= "9")) {
          this.HandleNumber()}
         else if (($tmp === "'") || ($tmp === "#")) {
          this.HandleString()}
         else if ($tmp === "[") {
          SetToken($mod.TParserToken.toSetStart)}
         else if ($tmp === "(") {
          SetToken($mod.TParserToken.toListStart)}
         else if ($tmp === "<") {
          SetToken($mod.TParserToken.toCollectionStart)}
         else if ($tmp === "{") {
          SetToken($mod.TParserToken.toBinaryStart)}
         else if ($tmp === "]") {
          SetToken($mod.TParserToken.toSetEnd)}
         else if ($tmp === ")") {
          SetToken($mod.TParserToken.toListEnd)}
         else if ($tmp === ">") {
          SetToken($mod.TParserToken.toCollectionEnd)}
         else if ($tmp === "}") {
          SetToken($mod.TParserToken.toBinaryEnd)}
         else if ($tmp === ",") {
          SetToken($mod.TParserToken.toComma)}
         else if ($tmp === ".") {
          SetToken($mod.TParserToken.toDot)}
         else if ($tmp === "=") {
          SetToken($mod.TParserToken.toEqual)}
         else if ($tmp === ":") {
          SetToken($mod.TParserToken.toColon)}
         else if ($tmp === "+") {
          SetToken($mod.TParserToken.toPlus)}
         else {
          this.HandleUnknown();
        };
      };
      Result = this.fToken;
      return Result;
    };
    this.SourcePos = function () {
      var Result = 0;
      Result = (this.fStream.GetPosition() - this.FBufLen) + this.fPos;
      return Result;
    };
    this.TokenComponentIdent = function () {
      var Result = "";
      if (this.fToken !== $mod.TParserToken.toSymbol) this.ErrorFmt(rtl.getResStr(pas.RTLConsts,"SParserExpected"),pas.System.VarRecs(18,this.GetTokenName($mod.TParserToken.toSymbol)));
      this.CheckLoadBuffer();
      while (this.fBuf[this.fPos] === ".") {
        this.ProcessChar();
        this.fLastTokenStr = this.fLastTokenStr + this.GetAlphaNum();
      };
      Result = this.fLastTokenStr;
      return Result;
    };
    this.TokenFloat = function () {
      var Result = 0.0;
      var errcode = 0;
      pas.System.val$8(this.fLastTokenStr,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }},{get: function () {
          return errcode;
        }, set: function (v) {
          errcode = v;
        }});
      if (errcode !== 0) this.ErrorFmt(rtl.getResStr(pas.RTLConsts,"SParserInvalidFloat"),pas.System.VarRecs(18,this.fLastTokenStr));
      return Result;
    };
    this.TokenInt = function () {
      var Result = 0;
      if (!pas.SysUtils.TryStrToInt64(this.fLastTokenStr,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }})) Result = pas.SysUtils.StrToQWord(this.fLastTokenStr);
      return Result;
    };
    this.TokenString = function () {
      var Result = "";
      var $tmp = this.fToken;
      if ($tmp === $mod.TParserToken.toFloat) {
        if (this.fFloatType !== "\x00") {
          Result = this.fLastTokenStr + this.fFloatType}
         else Result = this.fLastTokenStr}
       else {
        Result = this.fLastTokenStr;
      };
      return Result;
    };
    this.TokenSymbolIs = function (S) {
      var Result = false;
      Result = (this.fToken === $mod.TParserToken.toSymbol) && (pas.SysUtils.CompareText(this.fLastTokenStr,S) === 0);
      return Result;
    };
    var $r = this.$rtti;
    $mod.$rtti.$DynArray("TParser.fBuf$a",{eltype: rtl.char});
  });
  this.TObjectTextEncoding = {"0": "oteDFM", oteDFM: 0, "1": "oteLFM", oteLFM: 1};
  this.$rtti.$Enum("TObjectTextEncoding",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TObjectTextEncoding});
  rtl.createClass(this,"TObjectStreamConverter",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FIndent = "";
      this.FInput = null;
      this.FOutput = null;
      this.FEncoding = 0;
      this.FPlainStrings = false;
    };
    this.$final = function () {
      this.FInput = undefined;
      this.FOutput = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Outchars = function (S) {
      var res = "";
      var NewStr = "";
      var i = 0;
      var len = 0;
      var w = 0;
      var InString = false;
      var NewInString = false;
      if (S === "") {
        res = "''"}
       else {
        res = "";
        InString = false;
        len = S.length;
        i = 0;
        while (i < len) {
          NewInString = InString;
          w = S.charCodeAt(i);
          if (w === 39) {
            if (!InString) NewInString = true;
            NewStr = "''";
          } else if ((w >= 32) && (w < 127)) {
            if (!InString) NewInString = true;
            NewStr = String.fromCharCode(w);
          } else {
            if (InString) NewInString = false;
            NewStr = "#" + pas.SysUtils.IntToStr(w);
          };
          if (NewInString !== InString) {
            NewStr = "'" + NewStr;
            InString = NewInString;
          };
          res = res + NewStr;
          i += 1;
        };
        if (InString) res = res + "'";
      };
      this.OutStr(res);
    };
    this.OutLn = function (s) {
      this.OutStr(s + pas.System.LineEnding);
    };
    this.OutStr = function (s) {
      var I = 0;
      for (var $l = 1, $end = s.length; $l <= $end; $l++) {
        I = $l;
        this.FOutput.WriteBufferData$4(s.charAt(I - 1));
      };
    };
    this.OutString = function (s) {
      this.Outchars(s);
    };
    this.ReadWord = function () {
      var Result = 0;
      this.FInput.ReadBufferData$10({get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.ReadDWord = function () {
      var Result = 0;
      this.FInput.ReadBufferData$14({get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.ReadDouble = function () {
      var Result = 0.0;
      this.FInput.ReadBufferData$20({get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.ReadInt = function (ValueType) {
      var Result = 0;
      var $tmp = ValueType;
      if ($tmp === $mod.TValueType.vaInt8) {
        Result = ((this.FInput.ReadByte() & 255) << 24) >> 24}
       else if ($tmp === $mod.TValueType.vaInt16) {
        Result = ((this.ReadWord() & 65535) << 16) >> 16}
       else if ($tmp === $mod.TValueType.vaInt32) {
        Result = this.ReadDWord() & 0xFFFFFFFF}
       else if ($tmp === $mod.TValueType.vaNativeInt) Result = this.ReadNativeInt();
      return Result;
    };
    this.ReadInt$1 = function () {
      var Result = 0;
      Result = this.ReadInt(this.FInput.ReadByte());
      return Result;
    };
    this.ReadNativeInt = function () {
      var Result = 0;
      this.FInput.ReadBufferData$16({get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.ReadStr = function () {
      var Result = "";
      var l = 0;
      var i = 0;
      var c = "\x00";
      this.FInput.ReadBufferData$6({get: function () {
          return l;
        }, set: function (v) {
          l = v;
        }});
      Result = rtl.strSetLength(Result,l);
      for (var $l = 1, $end = l; $l <= $end; $l++) {
        i = $l;
        this.FInput.ReadBufferData$2({get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }});
        Result = rtl.setCharAt(Result,i - 1,c);
      };
      return Result;
    };
    this.ReadString = function (StringType) {
      var Result = "";
      var i = 0;
      var C = "\x00";
      Result = "";
      if (StringType !== $mod.TValueType.vaString) throw $mod.EFilerError.$create("Create$1",["Invalid string type passed to ReadString"]);
      i = this.ReadDWord();
      Result = rtl.strSetLength(Result,i);
      for (var $l = 1, $end = Result.length; $l <= $end; $l++) {
        i = $l;
        this.FInput.ReadBufferData$2({get: function () {
            return C;
          }, set: function (v) {
            C = v;
          }});
        Result = rtl.setCharAt(Result,i - 1,C);
      };
      return Result;
    };
    this.ProcessBinary = function () {
      var ToDo = 0;
      var DoNow = 0;
      var i = 0;
      var lbuf = [];
      var s = "";
      ToDo = this.ReadDWord();
      lbuf = rtl.arraySetLength(lbuf,0,32);
      this.OutLn("{");
      while (ToDo > 0) {
        DoNow = ToDo;
        if (DoNow > 32) DoNow = 32;
        ToDo -= DoNow;
        s = this.FIndent + "  ";
        this.FInput.ReadBuffer({get: function () {
            return lbuf;
          }, set: function (v) {
            lbuf = v;
          }},DoNow);
        for (var $l = 0, $end = DoNow - 1; $l <= $end; $l++) {
          i = $l;
          s = s + pas.SysUtils.IntToHex(lbuf[i],2);
        };
        this.OutLn(s);
      };
      this.OutLn(this.FIndent + "}");
    };
    this.ProcessValue = function (ValueType, Indent) {
      var s = "";
      var IsFirst = false;
      var ext = 0.0;
      var $tmp = ValueType;
      if ($tmp === $mod.TValueType.vaList) {
        this.OutStr("(");
        IsFirst = true;
        while (true) {
          ValueType = this.FInput.ReadByte();
          if (ValueType === $mod.TValueType.vaNull) break;
          if (IsFirst) {
            this.OutLn("");
            IsFirst = false;
          };
          this.OutStr(Indent + "  ");
          this.ProcessValue(ValueType,Indent + "  ");
        };
        this.OutLn(Indent + ")");
      } else if ($tmp === $mod.TValueType.vaInt8) {
        this.OutLn(pas.SysUtils.IntToStr(((this.FInput.ReadByte() & 255) << 24) >> 24))}
       else if ($tmp === $mod.TValueType.vaInt16) {
        this.OutLn(pas.SysUtils.IntToStr(((this.ReadWord() & 65535) << 16) >> 16))}
       else if ($tmp === $mod.TValueType.vaInt32) {
        this.OutLn(pas.SysUtils.IntToStr(this.ReadDWord() & 0xFFFFFFFF))}
       else if ($tmp === $mod.TValueType.vaNativeInt) {
        this.OutLn(pas.SysUtils.IntToStr(this.ReadNativeInt()))}
       else if ($tmp === $mod.TValueType.vaDouble) {
        ext = this.ReadDouble();
        s = rtl.floatToStr(ext);
        this.OutLn(s);
      } else if ($tmp === $mod.TValueType.vaString) {
        if (this.FPlainStrings) {
          this.OutStr("'" + pas.SysUtils.StringReplace(this.ReadString($mod.TValueType.vaString),"'","''",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll)) + "'")}
         else this.OutString(this.ReadString($mod.TValueType.vaString));
        this.OutLn("");
      } else if ($tmp === $mod.TValueType.vaIdent) {
        this.OutLn(this.ReadStr())}
       else if ($tmp === $mod.TValueType.vaFalse) {
        this.OutLn("False")}
       else if ($tmp === $mod.TValueType.vaTrue) {
        this.OutLn("True")}
       else if ($tmp === $mod.TValueType.vaBinary) {
        this.ProcessBinary()}
       else if ($tmp === $mod.TValueType.vaSet) {
        this.OutStr("[");
        IsFirst = true;
        while (true) {
          s = this.ReadStr();
          if (s.length === 0) break;
          if (!IsFirst) this.OutStr(", ");
          IsFirst = false;
          this.OutStr(s);
        };
        this.OutLn("]");
      } else if ($tmp === $mod.TValueType.vaNil) {
        this.OutLn("nil")}
       else if ($tmp === $mod.TValueType.vaCollection) {
        this.OutStr("<");
        while (this.FInput.ReadByte() !== 0) {
          this.OutLn(Indent);
          this.FInput.Seek(-1,$mod.TSeekOrigin.soCurrent);
          this.OutStr(Indent + "  item");
          ValueType = this.FInput.ReadByte();
          if (ValueType !== $mod.TValueType.vaList) this.OutStr("[" + pas.SysUtils.IntToStr(this.ReadInt(ValueType)) + "]");
          this.OutLn("");
          this.ReadPropList(Indent + "    ");
          this.OutStr(Indent + "  end");
        };
        this.OutLn(">");
      } else {
        throw $mod.EReadError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SErrInvalidPropertyType"),pas.System.VarRecs(0,ValueType)]);
      };
    };
    this.ReadObject = function (indent) {
      var b = 0;
      var ObjClassName = "";
      var ObjName = "";
      var ChildPos = 0;
      b = this.FInput.ReadByte();
      if ((b & 0xf0) === 0xf0) {
        if ((b & 2) !== 0) ChildPos = this.ReadInt$1();
      } else {
        b = 0;
        this.FInput.Seek(-1,$mod.TSeekOrigin.soCurrent);
      };
      ObjClassName = this.ReadStr();
      ObjName = this.ReadStr();
      this.OutStr(indent);
      if ((b & 1) !== 0) {
        this.OutStr("inherited")}
       else if ((b & 4) !== 0) {
        this.OutStr("inline")}
       else this.OutStr("object");
      this.OutStr(" ");
      if (ObjName !== "") this.OutStr(ObjName + ": ");
      this.OutStr(ObjClassName);
      if ((b & 2) !== 0) this.OutStr("[" + pas.SysUtils.IntToStr(ChildPos) + "]");
      this.OutLn("");
      this.ReadPropList(indent + "  ");
      while (this.FInput.ReadByte() !== 0) {
        this.FInput.Seek(-1,$mod.TSeekOrigin.soCurrent);
        this.ReadObject(indent + "  ");
      };
      this.OutLn(indent + "end");
    };
    this.ReadPropList = function (indent) {
      while (this.FInput.ReadByte() !== 0) {
        this.FInput.Seek(-1,$mod.TSeekOrigin.soCurrent);
        this.OutStr(indent + this.ReadStr() + " = ");
        this.ProcessValue(this.FInput.ReadByte(),indent);
      };
    };
    this.ObjectBinaryToText = function (aInput, aOutput) {
      this.ObjectBinaryToText$1(aInput,aOutput,$mod.TObjectTextEncoding.oteDFM);
    };
    this.ObjectBinaryToText$1 = function (aInput, aOutput, aEncoding) {
      this.FInput = aInput;
      this.FOutput = aOutput;
      this.FEncoding = aEncoding;
      this.Execute();
    };
    this.Execute = function () {
      var Signature = 0;
      if (this.FIndent === "") this.FIndent = "  ";
      if (!(this.FInput != null)) throw $mod.EReadError.$create("Create$1",["Missing input stream"]);
      if (!(this.FOutput != null)) throw $mod.EReadError.$create("Create$1",["Missing output stream"]);
      this.FInput.ReadBufferData$12({get: function () {
          return Signature;
        }, set: function (v) {
          Signature = v;
        }});
      if (Signature !== 809914452) throw $mod.EReadError.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SInvalidImage")]);
      this.ReadObject("");
    };
  });
  rtl.createClass(this,"TObjectTextConverter",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FParser = null;
      this.FInput = null;
      this.Foutput = null;
    };
    this.$final = function () {
      this.FParser = undefined;
      this.FInput = undefined;
      this.Foutput = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.WriteDouble = function (e) {
      this.Foutput.WriteBufferData$20(e);
    };
    this.WriteDWord = function (lw) {
      this.Foutput.WriteBufferData$14(lw);
    };
    this.WriteInteger = function (value) {
      if ((value >= -128) && (value <= 127)) {
        this.Foutput.WriteByte($mod.TValueType.vaInt8);
        this.Foutput.WriteByte(value & 255);
      } else if ((value >= -32768) && (value <= 32767)) {
        this.Foutput.WriteByte($mod.TValueType.vaInt16);
        this.WriteWord(value & 65535);
      } else if ((value >= -2147483648) && (value <= 2147483647)) {
        this.Foutput.WriteByte($mod.TValueType.vaInt32);
        this.WriteDWord(value >>> 0);
      } else {
        this.Foutput.WriteByte($mod.TValueType.vaNativeInt);
        this.WriteQWord(value);
      };
    };
    this.WriteQWord = function (q) {
      this.Foutput.WriteBufferData$16(q);
    };
    this.WriteString = function (s) {
      var i = 0;
      var size = 0;
      if (s.length > 255) {
        size = 255}
       else size = s.length;
      this.Foutput.WriteByte(size);
      for (var $l = 1, $end = s.length; $l <= $end; $l++) {
        i = $l;
        this.Foutput.WriteBufferData$4(s.charAt(i - 1));
      };
    };
    this.WriteWord = function (w) {
      this.Foutput.WriteBufferData$12(w);
    };
    this.WriteWString = function (s) {
      var i = 0;
      this.WriteDWord(s.length);
      for (var $l = 1, $end = s.length; $l <= $end; $l++) {
        i = $l;
        this.Foutput.WriteBufferData$4(s.charAt(i - 1));
      };
    };
    this.ProcessObject = function () {
      var Flags = 0;
      var ObjectName = "";
      var ObjectType = "";
      var ChildPos = 0;
      if (this.FParser.TokenSymbolIs("OBJECT")) {
        Flags = 0}
       else {
        if (this.FParser.TokenSymbolIs("INHERITED")) {
          Flags = 1}
         else {
          this.FParser.CheckTokenSymbol("INLINE");
          Flags = 4;
        };
      };
      this.FParser.NextToken();
      this.FParser.CheckToken($mod.TParserToken.toSymbol);
      ObjectName = "";
      ObjectType = this.FParser.TokenString();
      this.FParser.NextToken();
      if (this.FParser.fToken === $mod.TParserToken.toColon) {
        this.FParser.NextToken();
        this.FParser.CheckToken($mod.TParserToken.toSymbol);
        ObjectName = ObjectType;
        ObjectType = this.FParser.TokenString();
        this.FParser.NextToken();
        if (this.FParser.fToken === $mod.TParserToken.toSetStart) {
          this.FParser.NextToken();
          ChildPos = this.FParser.TokenInt();
          this.FParser.NextToken();
          this.FParser.CheckToken($mod.TParserToken.toSetEnd);
          this.FParser.NextToken();
          Flags = Flags | 2;
        };
      };
      if (Flags !== 0) {
        this.Foutput.WriteByte(0xf0 | Flags);
        if ((Flags & 2) !== 0) this.WriteInteger(ChildPos);
      };
      this.WriteString(ObjectType);
      this.WriteString(ObjectName);
      while (!(this.FParser.TokenSymbolIs("END") || this.FParser.TokenSymbolIs("OBJECT") || this.FParser.TokenSymbolIs("INHERITED") || this.FParser.TokenSymbolIs("INLINE"))) this.ProcessProperty();
      this.Foutput.WriteByte(0);
      while (!this.FParser.TokenSymbolIs("END")) this.ProcessObject();
      this.FParser.NextToken();
      this.Foutput.WriteByte(0);
    };
    this.ProcessProperty = function () {
      var name = "";
      this.FParser.CheckToken($mod.TParserToken.toSymbol);
      name = this.FParser.TokenString();
      while (true) {
        this.FParser.NextToken();
        if (this.FParser.fToken !== $mod.TParserToken.toDot) break;
        this.FParser.NextToken();
        this.FParser.CheckToken($mod.TParserToken.toSymbol);
        name = name + "." + this.FParser.TokenString();
      };
      this.WriteString(name);
      this.FParser.CheckToken($mod.TParserToken.toEqual);
      this.FParser.NextToken();
      this.ProcessValue();
    };
    this.ProcessValue = function () {
      var flt = 0.0;
      var stream = null;
      var $tmp = this.FParser.fToken;
      if ($tmp === $mod.TParserToken.toInteger) {
        this.WriteInteger(this.FParser.TokenInt());
        this.FParser.NextToken();
      } else if ($tmp === $mod.TParserToken.toFloat) {
        this.Foutput.WriteByte($mod.TValueType.vaDouble);
        flt = this.FParser.TokenFloat();
        this.WriteDouble(flt);
        this.FParser.NextToken();
      } else if ($tmp === $mod.TParserToken.ToString) {
        this.ProcessWideString("")}
       else if ($tmp === $mod.TParserToken.toSymbol) {
        if (pas.SysUtils.CompareText(this.FParser.TokenString(),"True") === 0) {
          this.Foutput.WriteByte($mod.TValueType.vaTrue)}
         else if (pas.SysUtils.CompareText(this.FParser.TokenString(),"False") === 0) {
          this.Foutput.WriteByte($mod.TValueType.vaFalse)}
         else if (pas.SysUtils.CompareText(this.FParser.TokenString(),"nil") === 0) {
          this.Foutput.WriteByte($mod.TValueType.vaNil)}
         else {
          this.Foutput.WriteByte($mod.TValueType.vaIdent);
          this.WriteString(this.FParser.TokenComponentIdent());
        };
        this.FParser.NextToken();
      } else if ($tmp === $mod.TParserToken.toSetStart) {
        this.FParser.NextToken();
        this.Foutput.WriteByte($mod.TValueType.vaSet);
        if (this.FParser.fToken !== $mod.TParserToken.toSetEnd) while (true) {
          this.FParser.CheckToken($mod.TParserToken.toSymbol);
          this.WriteString(this.FParser.TokenString());
          this.FParser.NextToken();
          if (this.FParser.fToken === $mod.TParserToken.toSetEnd) break;
          this.FParser.CheckToken($mod.TParserToken.toComma);
          this.FParser.NextToken();
        };
        this.Foutput.WriteByte(0);
        this.FParser.NextToken();
      } else if ($tmp === $mod.TParserToken.toListStart) {
        this.FParser.NextToken();
        this.Foutput.WriteByte($mod.TValueType.vaList);
        while (this.FParser.fToken !== $mod.TParserToken.toListEnd) this.ProcessValue();
        this.Foutput.WriteByte(0);
        this.FParser.NextToken();
      } else if ($tmp === $mod.TParserToken.toCollectionStart) {
        this.FParser.NextToken();
        this.Foutput.WriteByte($mod.TValueType.vaCollection);
        while (this.FParser.fToken !== $mod.TParserToken.toCollectionEnd) {
          this.FParser.CheckTokenSymbol("item");
          this.FParser.NextToken();
          this.Foutput.WriteByte($mod.TValueType.vaList);
          while (!this.FParser.TokenSymbolIs("end")) this.ProcessProperty();
          this.FParser.NextToken();
          this.Foutput.WriteByte(0);
        };
        this.Foutput.WriteByte(0);
        this.FParser.NextToken();
      } else if ($tmp === $mod.TParserToken.toBinaryStart) {
        this.Foutput.WriteByte($mod.TValueType.vaBinary);
        stream = $mod.TBytesStream.$create("Create");
        try {
          this.FParser.HexToBinary(stream);
          this.WriteDWord(stream.GetSize());
          this.Foutput.WriteBuffer(stream.GetBytes(),stream.GetSize());
        } finally {
          stream = rtl.freeLoc(stream);
        };
        this.FParser.NextToken();
      } else {
        this.FParser.Error(rtl.getResStr(pas.RTLConsts,"SParserInvalidProperty"));
      };
    };
    this.ProcessWideString = function (left) {
      var ws = "";
      ws = left + this.FParser.TokenString();
      while (this.FParser.NextToken() === $mod.TParserToken.toPlus) {
        this.FParser.NextToken();
        if (!(this.FParser.fToken === $mod.TParserToken.ToString)) this.FParser.CheckToken($mod.TParserToken.ToString);
        ws = ws + this.FParser.TokenString();
      };
      this.Foutput.WriteByte($mod.TValueType.vaString);
      this.WriteWString(ws);
    };
    this.ObjectTextToBinary = function (aInput, aOutput) {
      this.FInput = aInput;
      this.Foutput = aOutput;
      this.Execute();
    };
    this.Execute = function () {
      if (!(this.FInput != null)) throw $mod.EReadError.$create("Create$1",["Missing input stream"]);
      if (!(this.Foutput != null)) throw $mod.EReadError.$create("Create$1",["Missing output stream"]);
      this.FParser = $mod.TParser.$create("Create$1",[this.FInput]);
      try {
        this.Foutput.WriteBufferData$14(809914452);
        this.ProcessObject();
      } finally {
        rtl.free(this,"FParser");
      };
    };
  });
  rtl.createClass(this,"TLoadHelper",pas.System.TObject,function () {
    $mod.$rtti.$RefToProcVar("TLoadHelper.TTextLoadedCallBack",{procsig: rtl.newTIProcSig([["aText",rtl.string,2]])});
    $mod.$rtti.$RefToProcVar("TLoadHelper.TBytesLoadedCallBack",{procsig: rtl.newTIProcSig([["aBuffer",pas.JS.$rtti["TJSArrayBuffer"],2]])});
    $mod.$rtti.$RefToProcVar("TLoadHelper.TErrorCallBack",{procsig: rtl.newTIProcSig([["aError",rtl.string,2]])});
  });
  this.$rtti.$ClassRef("TLoadHelperClass",{instancetype: this.$rtti["TLoadHelper"]});
  rtl.createClass(this,"TDataModule",this.TComponent,function () {
    this.$init = function () {
      $mod.TComponent.$init.call(this);
      this.FDPos = pas.Types.TPoint.$new();
      this.FDSize = pas.Types.TPoint.$new();
      this.FDPPI = 0;
      this.FOnCreate = null;
      this.FOnDestroy = null;
      this.FOldOrder = false;
    };
    this.$final = function () {
      this.FDPos = undefined;
      this.FDSize = undefined;
      this.FOnCreate = undefined;
      this.FOnDestroy = undefined;
      $mod.TComponent.$final.call(this);
    };
    this.ReadP = function (Reader) {
      this.FDPPI = Reader.ReadInteger();
    };
    this.WriteP = function (Writer) {
      Writer.WriteInteger(this.FDPPI);
    };
    this.ReadT = function (Reader) {
      this.FDPos.y = Reader.ReadInteger();
    };
    this.WriteT = function (Writer) {
      Writer.WriteInteger(this.FDPos.y);
    };
    this.ReadL = function (Reader) {
      this.FDPos.x = Reader.ReadInteger();
    };
    this.WriteL = function (Writer) {
      Writer.WriteInteger(this.FDPos.x);
    };
    this.ReadW = function (Reader) {
      this.FDSize.x = Reader.ReadInteger();
    };
    this.WriteW = function (Writer) {
      Writer.WriteInteger(this.FDSize.x);
    };
    this.ReadH = function (Reader) {
      this.FDSize.y = Reader.ReadInteger();
    };
    this.WriteH = function (Writer) {
      Writer.WriteInteger(this.FDSize.y);
    };
    this.DoCreate = function () {
      if (this.FOnCreate != null) try {
        this.FOnCreate(this);
      } catch ($e) {
        if (!this.HandleCreateException()) throw $e;
      };
    };
    this.DoDestroy = function () {
      if (this.FOnDestroy != null) try {
        this.FOnDestroy(this);
      } catch ($e) {
        if ($mod.ApplicationHandleException != null) $mod.ApplicationHandleException(this);
      };
    };
    this.DefineProperties = function (Filer) {
      var Ancestor = null;
      var HaveData = false;
      var HavePPIData = false;
      $mod.TComponent.DefineProperties.call(this,Filer);
      Ancestor = Filer.FAncestor;
      HaveData = (Ancestor === null) || (this.FDSize.x !== Ancestor.FDSize.x) || (this.FDSize.y !== Ancestor.FDSize.y) || (this.FDPos.y !== Ancestor.FDPos.y) || (this.FDPos.x !== Ancestor.FDPos.x);
      HavePPIData = ((Ancestor != null) && (this.FDPPI !== Ancestor.FDPPI)) || (!(Ancestor != null) && (this.FDPPI !== 96));
      Filer.DefineProperty("Height",rtl.createCallback(this,"ReadH"),rtl.createCallback(this,"WriteH"),HaveData);
      Filer.DefineProperty("HorizontalOffset",rtl.createCallback(this,"ReadL"),rtl.createCallback(this,"WriteL"),HaveData);
      Filer.DefineProperty("VerticalOffset",rtl.createCallback(this,"ReadT"),rtl.createCallback(this,"WriteT"),HaveData);
      Filer.DefineProperty("Width",rtl.createCallback(this,"ReadW"),rtl.createCallback(this,"WriteW"),HaveData);
      Filer.DefineProperty("PPI",rtl.createCallback(this,"ReadP"),rtl.createCallback(this,"WriteP"),HavePPIData);
    };
    this.GetChildren = function (Proc, Root) {
      var I = 0;
      $mod.TComponent.GetChildren.call(this,Proc,Root);
      if (Root === this) for (var $l = 0, $end = this.GetComponentCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (!this.GetComponent(I).HasParent()) Proc(this.GetComponent(I));
      };
    };
    this.HandleCreateException = function () {
      var Result = false;
      Result = $mod.ApplicationHandleException != null;
      if (Result) $mod.ApplicationHandleException(this);
      return Result;
    };
    this.ReadState = function (Reader) {
      this.FOldOrder = false;
      $mod.TComponent.ReadState.call(this,Reader);
    };
    this.Create$1 = function (AOwner) {
      this.CreateNew(AOwner);
      if ((this.$class.ClassType() !== $mod.TDataModule) && !($mod.TComponentStateItem.csDesigning in this.FComponentState)) {
        if (!$mod.InitInheritedComponent(this,$mod.TDataModule)) throw $mod.EStreamError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SErrNoStreaming"),pas.System.VarRecs(18,this.$classname)]);
        if (this.FOldOrder) this.DoCreate();
      };
      return this;
    };
    this.CreateNew = function (AOwner) {
      this.CreateNew$1(AOwner,0);
      return this;
    };
    this.CreateNew$1 = function (AOwner, CreateMode) {
      $mod.TComponent.Create$1.call(this,AOwner);
      this.FDPPI = 96;
      if (($mod.AddDataModule != null) && (CreateMode >= 0)) $mod.AddDataModule(this);
      return this;
    };
    this.Destroy = function () {
      if (this.FOldOrder) this.DoDestroy();
      if ($mod.RemoveDataModule != null) $mod.RemoveDataModule(this);
      $mod.TComponent.Destroy.call(this);
    };
    this.AfterConstruction = function () {
      if (!this.FOldOrder) this.DoCreate();
    };
    this.BeforeDestruction = function () {
      this.Destroying();
      $mod.RemoveFixupReferences(this,"");
      if (!this.FOldOrder) this.DoDestroy();
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("OnCreate",0,$mod.$rtti["TNotifyEvent"],"FOnCreate","FOnCreate");
    $r.addProperty("OnDestroy",0,$mod.$rtti["TNotifyEvent"],"FOnDestroy","FOnDestroy");
    $r.addProperty("OldCreateOrder",0,rtl.boolean,"FOldOrder","FOldOrder");
  });
  this.$rtti.$ClassRef("TDataModuleClass",{instancetype: this.$rtti["TDataModule"]});
  rtl.recNewT(this,"TIdentMapEntry",function () {
    this.Value = 0;
    this.Name = "";
    this.$eq = function (b) {
      return (this.Value === b.Value) && (this.Name === b.Name);
    };
    this.$assign = function (s) {
      this.Value = s.Value;
      this.Name = s.Name;
      return this;
    };
    var $r = $mod.$rtti.$Record("TIdentMapEntry",{},this);
    $r.addField("Value",rtl.longint);
    $r.addField("Name",rtl.string);
  });
  this.$rtti.$ProcVar("TIdentToInt",{procsig: rtl.newTIProcSig([["Ident",rtl.string,2],["Int",rtl.longint,1]],rtl.boolean)});
  this.$rtti.$ProcVar("TIntToIdent",{procsig: rtl.newTIProcSig([["Int",rtl.longint],["Ident",rtl.string,1]],rtl.boolean)});
  this.$rtti.$ProcVar("TFindGlobalComponent",{procsig: rtl.newTIProcSig([["Name",rtl.string,2]],this.$rtti["TComponent"])});
  this.$rtti.$ProcVar("TInitComponentHandler",{procsig: rtl.newTIProcSig([["Instance",this.$rtti["TComponent"]],["RootAncestor",pas.System.$rtti["TClass"]]],rtl.boolean)});
  rtl.createHelper(this,"TStringsHelper",null,function () {
    this.LoadFromStream = function (Stream) {
      $mod.TStringsHelper.LoadFromStream$1.call(this,Stream,pas.SysUtils.TEncoding.GetUTF8());
    };
    this.LoadFromStream$1 = function (Stream, Encoding) {
      var arr = null;
      var s = "";
      var buf = [];
      Stream.Read({get: function () {
          return buf;
        }, set: function (v) {
          buf = v;
        }},Stream.GetSize());
      arr = $mod.TMemoryStream.BytesToMemory(rtl.arrayRef(buf));
      if ((Encoding != null) && (Encoding !== Encoding.$class.GetUTF8())) {
        s = Encoding.GetEncoding();
        var enc = new TextDecoder(s);
        s = enc.decode(arr);
      } else {
        s =  String.fromCharCode.apply(null, new Uint16Array(arr));
      };
      this.SetTextStr(s);
    };
    this.SaveToStream = function (Stream) {
      $mod.TStringsHelper.SaveToStream$1.call(this,Stream,pas.SysUtils.TEncoding.GetUTF8());
    };
    this.SaveToStream$1 = function (Stream, Encoding) {
      var s = "";
      var txt = "";
      var arr = null;
      var b = [];
      var l = 0;
      s = "utf-8";
      if (Encoding != null) {
        s = Encoding.GetEncoding();
      };
      txt = this.GetTextStr();
      var enc = new TextEncoder(s);
      arr = enc.encode(txt);
      b = $mod.TMemoryStream.MemoryToBytes(arr);
      l = arr.byteLength;
      Stream.Write(b,l);
      Stream.SetPosition(0);
    };
    this.IndexOfValue = function (Value) {
      var Result = 0;
      var len = 0;
      var S = "";
      this.CheckSpecialChars();
      Result = 0;
      while (Result < this.GetCount()) {
        S = this.Get(Result);
        len = pas.System.Pos(this.FNameValueSeparator,S) + 1;
        if ((len >= 0) && (this.DoCompareText(Value,pas.System.Copy(S,len,S.length)) === 0)) return Result;
        Result += 1;
      };
      Result = -1;
      return Result;
    };
  });
  this.TMSPlatformsWeb = 1;
  rtl.createClass(this,"ComponentPlatformsAttribute",pas.System.TCustomAttribute,function () {
    this.$init = function () {
      pas.System.TCustomAttribute.$init.call(this);
      this.FPlatforms = 0;
    };
    this.Create$1 = function (Platforms) {
      this.FPlatforms = Platforms;
      return this;
    };
  });
  this.TShiftState$a = {"0": "ssShift", ssShift: 0, "1": "ssAlt", ssAlt: 1, "2": "ssCtrl", ssCtrl: 2, "3": "ssLeft", ssLeft: 3, "4": "ssRight", ssRight: 4, "5": "ssMIDdle", ssMIDdle: 5, "6": "ssDouble", ssDouble: 6, "7": "ssTouch", ssTouch: 7, "8": "ssPen", ssPen: 8, "9": "ssCommand", ssCommand: 9};
  this.$rtti.$Enum("TShiftState$a",{minvalue: 0, maxvalue: 9, ordtype: 1, enumtype: this.TShiftState$a});
  this.$rtti.$Set("TShiftState",{comptype: this.$rtti["TShiftState$a"]});
  this.RegisterInitComponentHandler = function (ComponentClass, Handler) {
    var I = 0;
    var H = null;
    if ($impl.InitHandlerList === null) $impl.InitHandlerList = $mod.TList.$create("Create$1");
    H = $impl.TInitHandler.$create("Create");
    H.AClass = ComponentClass;
    H.AHandler = Handler;
    try {
      var $with = $impl.InitHandlerList;
      I = 0;
      while ((I < $with.GetCount()) && !H.AClass.InheritsFrom(rtl.getObject($with.Get(I)).AClass)) I += 1;
      if ((I < $with.GetCount()) && (rtl.getObject($with.Get(I)).AClass === H.AClass)) {
        rtl.getObject($with.Get(I)).AHandler = Handler;
        H = rtl.freeLoc(H);
      } else $impl.InitHandlerList.Insert(I,H);
    } catch ($e) {
      H = rtl.freeLoc(H);
      throw $e;
    };
  };
  this.RegisterClass = function (AClass) {
    $impl.ClassList[AClass.$classname] = AClass;
  };
  this.RegisterClasses = function (AClasses) {
    var AClass = null;
    for (var $in = AClasses, $l = 0, $end = rtl.length($in) - 1; $l <= $end; $l++) {
      AClass = $in[$l];
      $mod.RegisterClass(AClass);
    };
  };
  this.GetClass = function (AClassName) {
    var Result = null;
    Result = null;
    if (AClassName === "") return Result;
    if (!$impl.ClassList.hasOwnProperty(AClassName)) return Result;
    Result = rtl.getObject($impl.ClassList[AClassName]);
    return Result;
  };
  this.RegisterFindGlobalComponentProc = function (AFindGlobalComponent) {
    if (!($impl.FindGlobalComponentList != null)) $impl.FindGlobalComponentList = $mod.TFPList.$create("Create");
    if ($impl.FindGlobalComponentList.IndexOf(AFindGlobalComponent) < 0) $impl.FindGlobalComponentList.Add(AFindGlobalComponent);
  };
  this.UnregisterFindGlobalComponentProc = function (AFindGlobalComponent) {
    if ($impl.FindGlobalComponentList != null) $impl.FindGlobalComponentList.Remove(AFindGlobalComponent);
  };
  this.FindGlobalComponent = function (Name) {
    var Result = null;
    var i = 0;
    Result = null;
    if ($impl.FindGlobalComponentList != null) {
      for (var $l = $impl.FindGlobalComponentList.FCount - 1; $l >= 0; $l--) {
        i = $l;
        Result = $impl.FindGlobalComponentList.Get(i)(Name);
        if (Result != null) break;
      };
    };
    return Result;
  };
  this.FindNestedComponent = function (Root, APath, CStyle) {
    var Result = null;
    function GetNextName() {
      var Result = "";
      var P = 0;
      var CM = false;
      P = pas.System.Pos(".",APath);
      CM = false;
      if (P === 0) {
        if (CStyle) {
          P = pas.System.Pos("->",APath);
          CM = P !== 0;
        };
        if (P === 0) P = APath.length + 1;
      };
      Result = pas.System.Copy(APath,1,P - 1);
      pas.System.Delete({get: function () {
          return APath;
        }, set: function (v) {
          APath = v;
        }},1,P + (CM + 0));
      return Result;
    };
    var C = null;
    var S = "";
    if (APath === "") {
      Result = null}
     else {
      Result = Root;
      while ((APath !== "") && (Result !== null)) {
        C = Result;
        S = pas.SysUtils.UpperCase(GetNextName());
        Result = C.FindComponent(S);
        if ((Result === null) && (S === "OWNER")) Result = C;
      };
    };
    return Result;
  };
  this.InitInheritedComponent = function (Instance, RootAncestor) {
    var Result = false;
    var I = 0;
    I = 0;
    if (!($impl.InitHandlerList != null)) {
      Result = true;
      return Result;
    };
    Result = false;
    var $with = $impl.InitHandlerList;
    I = 0;
    while (!Result && (I < $with.GetCount())) {
      if (Instance.$class.InheritsFrom(rtl.getObject($with.Get(I)).AClass)) Result = rtl.getObject($with.Get(I)).AHandler(Instance,RootAncestor);
      I += 1;
    };
    return Result;
  };
  this.RedirectFixupReferences = function (Root, OldRootName, NewRootName) {
    if ($impl.NeedResolving === null) return;
    $impl.VisitResolveList($impl.TRedirectReferenceVisitor.$create("Create$1",[Root,OldRootName,NewRootName]));
  };
  this.RemoveFixupReferences = function (Root, RootName) {
    if ($impl.NeedResolving === null) return;
    $impl.VisitResolveList($impl.TRemoveReferenceVisitor.$create("Create$1",[Root,RootName]));
  };
  this.RegisterIntegerConsts = function (IntegerType, IdentToIntFn, IntToIdentFn) {
    if (!($impl.IntConstList != null)) $impl.IntConstList = $mod.TFPList.$create("Create");
    $impl.IntConstList.Add($impl.TIntConst.$create("Create$1",[IntegerType,IdentToIntFn,IntToIdentFn]));
  };
  this.ExtractStrings = function (Separators, WhiteSpace, Content, Strings, AddEmptyStrings) {
    var Result = 0;
    var b = 0;
    var c = 0;
    function SkipWhitespace() {
      while (Content.charCodeAt(c - 1) in WhiteSpace) c += 1;
    };
    function AddString() {
      var l = 0;
      l = c - b;
      if ((l > 0) || AddEmptyStrings) {
        if (Strings != null) {
          if (l > 0) {
            Strings.Add(pas.System.Copy(Content,b,l))}
           else Strings.Add("");
        };
        Result += 1;
      };
    };
    var cc = "\x00";
    var quoted = "\x00";
    var aLen = 0;
    Result = 0;
    c = 1;
    quoted = "\x00";
    Separators = rtl.diffSet(rtl.unionSet(Separators,rtl.createSet(13,10)),rtl.createSet(39,34));
    SkipWhitespace();
    b = c;
    aLen = Content.length;
    while (c <= aLen) {
      cc = Content.charAt(c - 1);
      if (cc === quoted) {
        if ((c < aLen) && (Content.charAt((c + 1) - 1) === quoted)) {
          c += 1}
         else quoted = "\x00";
      } else if ((quoted === "\x00") && (cc.charCodeAt() in rtl.createSet(39,34))) quoted = cc;
      if ((quoted === "\x00") && (cc.charCodeAt() in Separators)) {
        AddString();
        c += 1;
        SkipWhitespace();
        b = c;
      } else c += 1;
    };
    if (c !== b) AddString();
    return Result;
  };
  this.IdentToInt = function (Ident, Int, map) {
    var Result = false;
    var i = 0;
    for (var $l = 0, $end = rtl.length(map) - 1; $l <= $end; $l++) {
      i = $l;
      if (pas.SysUtils.CompareText(map[i].Name,Ident) === 0) {
        Int.set(map[i].Value);
        return true;
      };
    };
    Result = false;
    return Result;
  };
  this.IntToIdent = function (Int, Ident, map) {
    var Result = false;
    var i = 0;
    for (var $l = 0, $end = rtl.length(map) - 1; $l <= $end; $l++) {
      i = $l;
      if (map[i].Value === Int) {
        Ident.set(map[i].Name);
        return true;
      };
    };
    Result = false;
    return Result;
  };
  this.FindIntToIdent = function (AIntegerType) {
    var Result = null;
    var i = 0;
    Result = null;
    if (!($impl.IntConstList != null)) return Result;
    var $with = $impl.IntConstList;
    for (var $l = 0, $end = $with.FCount - 1; $l <= $end; $l++) {
      i = $l;
      if (rtl.getObject($with.Get(i)).IntegerType === AIntegerType) return rtl.getObject($with.Get(i)).IntToIdentFn;
    };
    return Result;
  };
  this.FindIdentToInt = function (AIntegerType) {
    var Result = null;
    var i = 0;
    Result = null;
    if (!($impl.IntConstList != null)) return Result;
    var $with = $impl.IntConstList;
    for (var $l = 0, $end = $with.FCount - 1; $l <= $end; $l++) {
      i = $l;
      var $with1 = rtl.getObject($with.Get(i));
      if (rtl.getObject($with.Get(i)).IntegerType === AIntegerType) return $with1.IdentToIntFn;
    };
    return Result;
  };
  this.FindClass = function (AClassName) {
    var Result = null;
    Result = $mod.GetClass(AClassName);
    if (!(Result != null)) throw $mod.EClassNotFound.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SClassNotFound"),pas.System.VarRecs(18,AClassName)]);
    return Result;
  };
  this.CollectionsEqual = function (C1, C2) {
    var Result = false;
    var Comp1 = null;
    var Comp2 = null;
    Comp2 = null;
    Comp1 = $mod.TComponent.$create("Create");
    try {
      Result = $mod.CollectionsEqual$1(C1,C2,Comp1,Comp2);
    } finally {
      Comp1 = rtl.freeLoc(Comp1);
      Comp2 = rtl.freeLoc(Comp2);
    };
    return Result;
  };
  this.CollectionsEqual$1 = function (C1, C2, Owner1, Owner2) {
    var Result = false;
    function stream_collection(s, c, o) {
      var w = null;
      w = $mod.TWriter.$create("Create$2",[s]);
      try {
        w.SetRoot(o);
        w.FLookupRoot = o;
        w.WriteCollection(c);
      } finally {
        w = rtl.freeLoc(w);
      };
    };
    var s1 = null;
    var s2 = null;
    var b1 = [];
    var b2 = [];
    var I = 0;
    var Len = 0;
    Result = false;
    if ((C1.$class.ClassType() !== C2.$class.ClassType()) || (C1.GetCount() !== C2.GetCount())) return Result;
    if (C1.GetCount() === 0) {
      Result = true;
      return Result;
    };
    s2 = null;
    s1 = $mod.TBytesStream.$create("Create");
    try {
      s2 = $mod.TBytesStream.$create("Create");
      stream_collection(s1,C1,Owner1);
      stream_collection(s2,C2,Owner2);
      Result = s1.GetSize() === s2.GetSize();
      if (Result) {
        b1 = s1.GetBytes();
        b2 = s2.GetBytes();
        I = 0;
        Len = s1.GetSize();
        while (Result && (I < Len)) {
          Result = b1[I] === b2[I];
          I += 1;
        };
      };
    } finally {
      s2 = rtl.freeLoc(s2);
      s1 = rtl.freeLoc(s1);
    };
    return Result;
  };
  this.GetFixupReferenceNames = function (Root, Names) {
    if ($impl.NeedResolving === null) return;
    $impl.VisitResolveList($impl.TReferenceNamesVisitor.$create("Create$1",[Root,Names]));
  };
  this.GetFixupInstanceNames = function (Root, ReferenceRootName, Names) {
    if ($impl.NeedResolving === null) return;
    $impl.VisitResolveList($impl.TReferenceInstancesVisitor.$create("Create$1",[Root,ReferenceRootName,Names]));
  };
  this.ObjectBinaryToText = function (aInput, aOutput) {
    $mod.ObjectBinaryToText$1(aInput,aOutput,$mod.TObjectTextEncoding.oteLFM);
  };
  this.ObjectBinaryToText$1 = function (aInput, aOutput, aEncoding) {
    var Conv = null;
    Conv = $mod.TObjectStreamConverter.$create("Create");
    try {
      Conv.ObjectBinaryToText$1(aInput,aOutput,aEncoding);
    } finally {
      Conv = rtl.freeLoc(Conv);
    };
  };
  this.ObjectTextToBinary = function (aInput, aOutput) {
    var Conv = null;
    Conv = $mod.TObjectTextConverter.$create("Create");
    try {
      Conv.ObjectTextToBinary(aInput,aOutput);
    } finally {
      Conv = rtl.freeLoc(Conv);
    };
  };
  this.SetLoadHelperClass = function (aClass) {
    var Result = null;
    Result = $impl.GlobalLoadHelper;
    $impl.GlobalLoadHelper = aClass;
    return Result;
  };
  this.StringToBuffer = function (aString, aLen) {
    var Result = null;
    Result = $mod.StringToBuffer$1(aString,aLen,pas.SysUtils.TEncoding.GetUTF8());
    return Result;
  };
  this.StringToBuffer$1 = function (aString, aLen, AEncoding) {
    var Result = null;
    var I = 0;
    if (AEncoding === pas.SysUtils.TEncoding.GetUnicode()) {
      Result = new ArrayBuffer(aLen * 2);
      var $with = new Uint16Array(Result);
      for (var $l = 0, $end = aLen - 1; $l <= $end; $l++) {
        I = $l;
        $with[I] = aString.charCodeAt(I);
      };
    } else {
      Result = new ArrayBuffer(aLen);
      var $with1 = new Uint8Array(Result);
      for (var $l1 = 0, $end1 = aLen - 1; $l1 <= $end1; $l1++) {
        I = $l1;
        $with1[I] = aString.charCodeAt(I);
      };
    };
    return Result;
  };
  this.BufferToString = function (aBuffer, aPos, aLen) {
    var Result = "";
    Result = $mod.BufferToString$1(aBuffer,aPos,aLen,pas.SysUtils.TEncoding.GetUTF8());
    return Result;
  };
  this.BufferToString$1 = function (aBuffer, aPos, aLen, AEncoding) {
    var Result = "";
    var ua16 = null;
    var ua8 = null;
    Result = "";
    if (AEncoding === pas.SysUtils.TEncoding.GetUnicode()) {
      ua16 = new Uint16Array(aBuffer.slice(aPos,aLen));
      if (ua16 !== null) Result = "" + String.fromCharCode.apply(null,ua16);
    } else {
      ua8 = new Uint8Array(aBuffer.slice(aPos,aLen));
      if (ua8 !== null) Result = "" + String.fromCharCode.apply(null,ua8);
    };
    return Result;
  };
  this.BeginGlobalLoading = function () {
    $impl.GlobalLoaded = $mod.TFPList.$create("Create");
  };
  this.NotifyGlobalLoading = function () {
    var I = 0;
    var G = null;
    G = $impl.GlobalLoaded;
    for (var $l = 0, $end = G.FCount - 1; $l <= $end; $l++) {
      I = $l;
      rtl.getObject(G.Get(I)).Loaded();
    };
  };
  this.EndGlobalLoading = function () {
    rtl.free($impl,"GlobalLoaded");
  };
  this.$rtti.$MethodVar("TDataModuleNotifyEvent",{procsig: rtl.newTIProcSig([["DataModule",this.$rtti["TDataModule"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TExceptionNotifyEvent",{procsig: rtl.newTIProcSig([["E",pas.SysUtils.$rtti["Exception"]]]), methodkind: 0});
  this.AddDataModule = null;
  this.RemoveDataModule = null;
  this.ApplicationHandleException = null;
  this.ApplicationShowException = null;
  this.FormResourceIsText = true;
  this.vaSingle = this.TValueType.vaDouble;
  this.vaExtended = this.TValueType.vaDouble;
  this.vaLString = this.TValueType.vaString;
  this.vaUTF8String = this.TValueType.vaString;
  this.vaUString = this.TValueType.vaString;
  this.vaWString = this.TValueType.vaString;
  this.vaQWord = this.TValueType.vaNativeInt;
  this.vaInt64 = this.TValueType.vaNativeInt;
  this.toWString = this.TParserToken.ToString;
  $mod.$implcode = function () {
    $mod.$rtti.$RefToProcVar("TReqLoadProc",{procsig: rtl.newTIProcSig([["AResponse",rtl.string]])});
    $mod.$rtti.$RefToProcVar("TReqErrorProc",{procsig: rtl.newTIProcSig([])});
    $impl.GlobalLoaded = null;
    $impl.IntConstList = null;
    $impl.GlobalLoadHelper = null;
    $impl.CheckLoadHelper = function () {
      if ($impl.GlobalLoadHelper === null) throw pas.SysUtils.EInOutError.$create("Create$1",["No support for loading URLS. Include Rtl.BrowserLoadHelper in your project uses clause"]);
    };
    $impl.CreateComponentfromRes = function (res, Inst, Component) {
      var Result = false;
      var ResStream = null;
      var Src = null;
      var aInfo = pas.p2jsres.TResourceInfo.$new();
      if (Inst === 0) ;
      Result = pas.p2jsres.GetResourceInfo(res,aInfo);
      if (Result) {
        ResStream = $mod.TResourceStream.$create("Create$1",[pas.p2jsres.TResourceInfo.$clone(aInfo)]);
        try {
          if (!$mod.FormResourceIsText) {
            Src = ResStream}
           else {
            Src = $mod.TMemoryStream.$create("Create");
            $mod.ObjectTextToBinary(ResStream,Src);
            Src.SetPosition(0);
          };
          Component.set(Src.ReadComponent(Component.get()));
        } finally {
          if (Src !== ResStream) Src = rtl.freeLoc(Src);
          ResStream = rtl.freeLoc(ResStream);
        };
      };
      return Result;
    };
    $impl.DefaultInitHandler = function (Instance, RootAncestor) {
      var Result = false;
      function doinit(_class) {
        var Result = false;
        Result = false;
        if ((_class.ClassType() === $mod.TComponent) || (_class.ClassType() === RootAncestor)) return Result;
        Result = doinit(_class.$ancestor);
        Result = $impl.CreateComponentfromRes(_class.$module.$name,0,{get: function () {
            return Instance;
          }, set: function (v) {
            Instance = v;
          }}) || Result;
        return Result;
      };
      Result = doinit(Instance.$class.ClassType());
      return Result;
    };
    rtl.createClass($impl,"TIntConst",pas.System.TObject,function () {
      this.$init = function () {
        pas.System.TObject.$init.call(this);
        this.IntegerType = null;
        this.IdentToIntFn = null;
        this.IntToIdentFn = null;
      };
      this.$final = function () {
        this.IdentToIntFn = undefined;
        this.IntToIdentFn = undefined;
        pas.System.TObject.$final.call(this);
      };
      this.Create$1 = function (AIntegerType, AIdentToInt, AIntToIdent) {
        this.IntegerType = AIntegerType;
        this.IdentToIntFn = AIdentToInt;
        this.IntToIdentFn = AIntToIdent;
        return this;
      };
    });
    $impl.GlobalIdentToInt = function (Ident, Int) {
      var Result = false;
      var i = 0;
      Result = false;
      if (!($impl.IntConstList != null)) return Result;
      var $with = $impl.IntConstList;
      for (var $l = 0, $end = $with.FCount - 1; $l <= $end; $l++) {
        i = $l;
        if (rtl.getObject($with.Get(i)).IdentToIntFn(Ident,Int)) return true;
      };
      return Result;
    };
    $impl.QuickSort = function (aList, L, R, Compare) {
      var I = 0;
      var J = 0;
      var PivotIdx = 0;
      var P = undefined;
      var Q = undefined;
      do {
        I = L;
        J = R;
        PivotIdx = L + ((R - L) >>> 1);
        P = aList[PivotIdx];
        do {
          while ((I < PivotIdx) && (Compare(P,aList[I]) > 0)) I += 1;
          while ((J > PivotIdx) && (Compare(P,aList[J]) < 0)) J -= 1;
          if (I < J) {
            Q = aList[I];
            aList[I] = aList[J];
            aList[J] = Q;
            if (PivotIdx === I) {
              PivotIdx = J;
              I += 1;
            } else if (PivotIdx === J) {
              PivotIdx = I;
              J -= 1;
            } else {
              I += 1;
              J -= 1;
            };
          };
        } while (!(I >= J));
        if ((PivotIdx - L) < (R - PivotIdx)) {
          if ((L + 1) < PivotIdx) $impl.QuickSort(rtl.arrayRef(aList),L,PivotIdx - 1,Compare);
          L = PivotIdx + 1;
        } else {
          if ((PivotIdx + 1) < R) $impl.QuickSort(rtl.arrayRef(aList),PivotIdx + 1,R,Compare);
          if ((L + 1) < PivotIdx) {
            R = PivotIdx - 1}
           else return;
        };
      } while (!(L >= R));
    };
    $impl.URLToArrayOfString = function (URL) {
      var Result = [];
      var a = [];
      var cors_api_url = "";
      cors_api_url = "";
      var xhr = new XMLHttpRequest();
          xhr.open("GET", cors_api_url + URL, false);
          xhr.send();
      
          if (xhr.status==200)
          {
            var obj = xhr.responseText.split(/\r\n|\n/);
            for (var i = 0; i < obj.length; i++) {
              a.push(obj[i]);
            }
          };
      Result = rtl.arrayRef(a);
      return Result;
    };
    $impl.ReqAsync = function (AURL, LoadProc, ErrorProc) {
      var req = null;
      function HandleResponse(Event) {
        var Result = false;
        var s = "";
        var status = 0;
        status = Event.target.status;
        s = Event.target.responseText;
        if (rtl.trunc(status / 100) === 2) {
          LoadProc(s)}
         else ErrorProc();
        Result = true;
        return Result;
      };
      function HandleError(Event) {
        var Result = false;
        ErrorProc();
        Result = true;
        return Result;
      };
      req = new XMLHttpRequest();
      req.addEventListener("load",rtl.createSafeCallback(null,HandleResponse));
      req.addEventListener("abort",rtl.createSafeCallback(null,HandleError));
      req.addEventListener("timeout",rtl.createSafeCallback(null,HandleError));
      req.addEventListener("error",rtl.createSafeCallback(null,HandleError));
      req.open("GET",AURL);
      req.send();
    };
    $impl.StringListAnsiCompare = function (List, Index1, Index) {
      var Result = 0;
      Result = List.DoCompareText(List.FList[Index1].FString,List.FList[Index].FString);
      return Result;
    };
    $impl.TMSGrow = 4096;
    $impl.FilerSignatureInt = 809914452;
    rtl.createClass($impl,"TUnresolvedReference",pas.simplelinkedlist.TLinkedListItem,function () {
      this.$init = function () {
        pas.simplelinkedlist.TLinkedListItem.$init.call(this);
        this.FRoot = null;
        this.FPropInfo = null;
        this.FGlobal = "";
        this.FRelative = "";
      };
      this.$final = function () {
        this.FRoot = undefined;
        this.FPropInfo = undefined;
        pas.simplelinkedlist.TLinkedListItem.$final.call(this);
      };
      this.Resolve = function (Instance) {
        var Result = false;
        var C = null;
        C = $mod.FindGlobalComponent(this.FGlobal);
        Result = C !== null;
        if (Result) {
          C = $mod.FindNestedComponent(C,this.FRelative,true);
          Result = C !== null;
          if (Result) pas.TypInfo.SetObjectProp$1(Instance,this.FPropInfo,C);
        };
        return Result;
      };
      this.RootMatches = function (ARoot) {
        var Result = false;
        Result = (ARoot === null) || (ARoot === this.FRoot);
        return Result;
      };
      this.NextRef = function () {
        var Result = null;
        Result = this.Next;
        return Result;
      };
    });
    rtl.createClass($impl,"TLocalUnResolvedReference",$impl.TUnresolvedReference,function () {
      this.$init = function () {
        $impl.TUnresolvedReference.$init.call(this);
        this.Finstance = null;
      };
      this.$final = function () {
        this.Finstance = undefined;
        $impl.TUnresolvedReference.$final.call(this);
      };
      var $r = this.$rtti;
      $r.addField("Finstance",$mod.$rtti["TPersistent"],4);
    });
    rtl.createClass($impl,"TUnResolvedInstance",pas.simplelinkedlist.TLinkedListItem,function () {
      this.$init = function () {
        pas.simplelinkedlist.TLinkedListItem.$init.call(this);
        this.Instance = null;
        this.FUnresolved = null;
      };
      this.$final = function () {
        this.Instance = undefined;
        this.FUnresolved = undefined;
        pas.simplelinkedlist.TLinkedListItem.$final.call(this);
      };
      this.Destroy = function () {
        rtl.free(this,"FUnresolved");
        pas.System.TObject.Destroy.call(this);
      };
      this.AddReference = function (ARoot, APropInfo, AGlobal, ARelative) {
        var Result = null;
        if (this.FUnresolved === null) this.FUnresolved = pas.simplelinkedlist.TLinkedList.$create("Create$1",[$impl.TUnresolvedReference]);
        Result = rtl.as(this.FUnresolved.Add(),$impl.TUnresolvedReference);
        Result.FGlobal = AGlobal;
        Result.FRelative = ARelative;
        Result.FPropInfo = APropInfo;
        Result.FRoot = ARoot;
        return Result;
      };
      this.RootUnresolved = function () {
        var Result = null;
        Result = null;
        if (this.FUnresolved != null) Result = this.FUnresolved.FRoot;
        return Result;
      };
      this.ResolveReferences = function () {
        var Result = false;
        var R = null;
        var RN = null;
        R = this.RootUnresolved();
        while (R !== null) {
          RN = R.NextRef();
          if (R.Resolve(this.Instance)) this.FUnresolved.RemoveItem(R,true);
          R = RN;
        };
        Result = this.RootUnresolved() === null;
        return Result;
      };
    });
    rtl.createClass($impl,"TBuildListVisitor",pas.simplelinkedlist.TLinkedListVisitor,function () {
      this.$init = function () {
        pas.simplelinkedlist.TLinkedListVisitor.$init.call(this);
        this.List = null;
      };
      this.$final = function () {
        this.List = undefined;
        pas.simplelinkedlist.TLinkedListVisitor.$final.call(this);
      };
      this.Add = function (Item) {
        if (this.List === null) this.List = $mod.TFPList.$create("Create");
        this.List.Add(Item);
      };
      this.Destroy = function () {
        var I = 0;
        if (this.List != null) for (var $l = 0, $end = this.List.FCount - 1; $l <= $end; $l++) {
          I = $l;
          $impl.NeedResolving.RemoveItem(rtl.getObject(this.List.Get(I)),true);
        };
        pas.SysUtils.FreeAndNil({p: this, get: function () {
            return this.p.List;
          }, set: function (v) {
            this.p.List = v;
          }});
        pas.System.TObject.Destroy.call(this);
      };
    });
    rtl.createClass($impl,"TResolveReferenceVisitor",$impl.TBuildListVisitor,function () {
      this.Visit = function (Item) {
        var Result = false;
        if (Item.ResolveReferences()) this.Add(Item);
        Result = true;
        return Result;
      };
      var $r = this.$rtti;
      $r.addMethod("Visit",1,[["Item",pas.simplelinkedlist.$rtti["TLinkedListItem"]]],4,rtl.boolean);
    });
    rtl.createClass($impl,"TRemoveReferenceVisitor",$impl.TBuildListVisitor,function () {
      this.$init = function () {
        $impl.TBuildListVisitor.$init.call(this);
        this.FRef = "";
        this.FRoot = null;
      };
      this.$final = function () {
        this.FRoot = undefined;
        $impl.TBuildListVisitor.$final.call(this);
      };
      this.Create$1 = function (ARoot, ARef) {
        this.FRoot = ARoot;
        this.FRef = pas.SysUtils.UpperCase(ARef);
        return this;
      };
      this.Visit = function (Item) {
        var Result = false;
        var I = 0;
        var UI = null;
        var R = null;
        var L = null;
        UI = Item;
        R = UI.RootUnresolved();
        L = null;
        try {
          while (R !== null) {
            if (R.RootMatches(this.FRoot) && ((this.FRef === "") || (this.FRef === pas.SysUtils.UpperCase(R.FGlobal)))) {
              if (!(L != null)) L = $mod.TFPList.$create("Create");
              L.Add(R);
            };
            R = R.NextRef();
          };
          if (L != null) {
            for (var $l = 0, $end = L.FCount - 1; $l <= $end; $l++) {
              I = $l;
              UI.FUnresolved.RemoveItem(rtl.getObject(L.Get(I)),true);
            };
          };
          if (UI.FUnresolved.FRoot === null) {
            if (this.List === null) this.List = $mod.TFPList.$create("Create");
            this.List.Add(UI);
          };
        } finally {
          L = rtl.freeLoc(L);
        };
        Result = true;
        return Result;
      };
    });
    rtl.createClass($impl,"TReferenceNamesVisitor",pas.simplelinkedlist.TLinkedListVisitor,function () {
      this.$init = function () {
        pas.simplelinkedlist.TLinkedListVisitor.$init.call(this);
        this.FList = null;
        this.FRoot = null;
      };
      this.$final = function () {
        this.FList = undefined;
        this.FRoot = undefined;
        pas.simplelinkedlist.TLinkedListVisitor.$final.call(this);
      };
      this.Visit = function (Item) {
        var Result = false;
        var R = null;
        R = Item.RootUnresolved();
        while (R !== null) {
          if (R.RootMatches(this.FRoot)) if (this.FList.IndexOf(R.FGlobal) === -1) this.FList.Add(R.FGlobal);
          R = R.NextRef();
        };
        Result = true;
        return Result;
      };
      this.Create$1 = function (ARoot, AList) {
        this.FRoot = ARoot;
        this.FList = AList;
        return this;
      };
    });
    rtl.createClass($impl,"TReferenceInstancesVisitor",pas.simplelinkedlist.TLinkedListVisitor,function () {
      this.$init = function () {
        pas.simplelinkedlist.TLinkedListVisitor.$init.call(this);
        this.FList = null;
        this.FRef = "";
        this.FRoot = null;
      };
      this.$final = function () {
        this.FList = undefined;
        this.FRoot = undefined;
        pas.simplelinkedlist.TLinkedListVisitor.$final.call(this);
      };
      this.Visit = function (Item) {
        var Result = false;
        var R = null;
        R = Item.RootUnresolved();
        while (R !== null) {
          if ((this.FRoot === R.FRoot) && (this.FRef === pas.SysUtils.UpperCase(R.FGlobal))) if (this.FList.IndexOf(R.FRelative) === -1) this.FList.Add(R.FRelative);
          R = R.NextRef();
        };
        Result = true;
        return Result;
      };
      this.Create$1 = function (ARoot, ARef, AList) {
        this.FRoot = ARoot;
        this.FRef = pas.SysUtils.UpperCase(ARef);
        this.FList = AList;
        return this;
      };
    });
    rtl.createClass($impl,"TRedirectReferenceVisitor",pas.simplelinkedlist.TLinkedListVisitor,function () {
      this.$init = function () {
        pas.simplelinkedlist.TLinkedListVisitor.$init.call(this);
        this.FOld = "";
        this.FNew = "";
        this.FRoot = null;
      };
      this.$final = function () {
        this.FRoot = undefined;
        pas.simplelinkedlist.TLinkedListVisitor.$final.call(this);
      };
      this.Visit = function (Item) {
        var Result = false;
        var R = null;
        R = Item.RootUnresolved();
        while (R !== null) {
          if (R.RootMatches(this.FRoot) && (this.FOld === pas.SysUtils.UpperCase(R.FGlobal))) R.FGlobal = this.FNew;
          R = R.NextRef();
        };
        Result = true;
        return Result;
      };
      this.Create$1 = function (ARoot, AOld, ANew) {
        this.FRoot = ARoot;
        this.FOld = pas.SysUtils.UpperCase(AOld);
        this.FNew = ANew;
        return this;
      };
    });
    $impl.NeedResolving = null;
    $impl.FindUnresolvedInstance = function (AInstance) {
      var Result = null;
      Result = null;
      if ($impl.NeedResolving != null) {
        Result = $impl.NeedResolving.FRoot;
        while ((Result !== null) && (Result.Instance !== AInstance)) Result = Result.Next;
      };
      return Result;
    };
    $impl.AddtoResolveList = function (AInstance) {
      var Result = null;
      Result = $impl.FindUnresolvedInstance(AInstance);
      if (Result === null) {
        if (!($impl.NeedResolving != null)) $impl.NeedResolving = pas.simplelinkedlist.TLinkedList.$create("Create$1",[$impl.TUnResolvedInstance]);
        Result = rtl.as($impl.NeedResolving.Add(),$impl.TUnResolvedInstance);
        Result.Instance = AInstance;
      };
      return Result;
    };
    $impl.VisitResolveList = function (V) {
      try {
        $impl.NeedResolving.ForEach(V);
      } finally {
        pas.SysUtils.FreeAndNil({get: function () {
            return V;
          }, set: function (v) {
            V = v;
          }});
      };
    };
    $impl.GlobalFixupReferences = function () {
      if ($impl.NeedResolving === null) return;
      $impl.VisitResolveList($impl.TResolveReferenceVisitor.$create("Create"));
    };
    rtl.createClass($impl,"TPosComponent",pas.System.TObject,function () {
      this.$init = function () {
        pas.System.TObject.$init.call(this);
        this.FPos = 0;
        this.FComponent = null;
      };
      this.$final = function () {
        this.FComponent = undefined;
        pas.System.TObject.$final.call(this);
      };
      this.Create$1 = function (APos, AComponent) {
        this.FPos = APos;
        this.FComponent = AComponent;
        return this;
      };
    });
    rtl.createClass($impl,"TInitHandler",pas.System.TObject,function () {
      this.$init = function () {
        pas.System.TObject.$init.call(this);
        this.AHandler = null;
        this.AClass = null;
      };
      this.$final = function () {
        this.AHandler = undefined;
        this.AClass = undefined;
        pas.System.TObject.$final.call(this);
      };
      var $r = this.$rtti;
      $r.addField("AHandler",$mod.$rtti["TInitComponentHandler"],4);
      $r.addField("AClass",$mod.$rtti["TComponentClass"],4);
    });
    $impl.ClassList = null;
    $impl.InitHandlerList = null;
    $impl.FindGlobalComponentList = null;
    $impl.ParseBufSize = 4096;
    $mod.$rtti.$StaticArray("TokNames$a",{dims: [20], eltype: rtl.string});
    $impl.TokNames = ["?","EOF","Symbol","String","Integer","Float","-","[","(","<","{","]",")",">","}",",",".","=",":","+"];
    $mod.$resourcestrings = {SStreamInvalidSeek: {org: "Seek is not implemented for class %s"}, SStreamNoReading: {org: "Stream reading is not implemented for class %s"}, SStreamNoWriting: {org: "Stream writing is not implemented for class %s"}, SReadError: {org: "Could not read data from stream"}, SWriteError: {org: "Could not write data to stream"}, SMemoryStreamError: {org: "Could not allocate memory"}, SerrInvalidStreamSize: {org: "Invalid Stream size"}};
  };
  $mod.$init = function () {
    (function () {
      $mod.RegisterInitComponentHandler($mod.TDataModule,$impl.DefaultInitHandler);
    })();
    $impl.ClassList = new Object();
  };
},["Web","simplelinkedlist"]);
rtl.module("UITypes",["System"],function () {
  "use strict";
  var $mod = this;
  this.$rtti.$inherited("TFontName",rtl.string,{});
});
rtl.module("WEBLib.Consts",["System"],function () {
  "use strict";
  var $mod = this;
  $mod.$resourcestrings = {SWarning: {org: "Warning"}, SError: {org: "Error"}, SInformation: {org: "Information"}, SConfirm: {org: "Confirm"}, SOK: {org: "OK"}, SCancel: {org: "Cancel"}, SYes: {org: "Yes"}, SNo: {org: "No"}, SAbort: {org: "Abort"}, SRetry: {org: "Retry"}, SIgnore: {org: "Ignore"}, SHelp: {org: "Help"}, SClose: {org: "Close"}, SAll: {org: "All"}, SYesToAll: {org: "Yes to all"}, SNoToAll: {org: "No to all"}, SReadError: {org: "Stream read error"}, SWriteError: {org: "Stream write error"}, SCannotGetFile: {org: "Cannot get the file from the URL %s because of the error %d!"}, SErrorLoadFromFile: {org: "There was an error during the download of the file %s!"}, SLoadFromFileAborted: {org: "The download of the file %s was aborted!"}, SWarningFR: {org: "Avertissement"}, SErrorFR: {org: "Erreur"}, SInformationFR: {org: "Information"}, SConfirmFR: {org: "Confirmer"}, SOKFR: {org: "OK"}, SCancelFR: {org: "Annuler"}, SYesFR: {org: "Oui"}, SNoFR: {org: "Non"}, SAbortFR: {org: "Interrompre"}, SRetryFR: {org: "Réessayer"}, SIgnoreFR: {org: "Ignorer"}, SHelpFR: {org: "Aide"}, SCloseFR: {org: "Fermer"}, SAllFR: {org: "Tout"}, SYesToAllFR: {org: "Oui à tout"}, SNoToAllFR: {org: "Non à tout"}, SWarningDE: {org: "Warnung"}, SErrorDE: {org: "Fehler"}, SInformationDE: {org: "Information"}, SConfirmDE: {org: "Bestätigen"}, SOKDE: {org: "OK"}, SCancelDE: {org: "Abbrechen"}, SYesDE: {org: "Ja"}, SNoDE: {org: "Nein"}, SAbortDE: {org: "Abbrechen"}, SRetryDE: {org: "Wiederholen"}, SIgnoreDE: {org: "Ignorieren"}, SHelpDE: {org: "Hilfe"}, SCloseDE: {org: "Schließen"}, SAllDE: {org: "Alles"}, SYesToAllDE: {org: "Ja auf Alles"}, SNoToAllDE: {org: "Nein auf Alles"}, SWarningES: {org: "Advertencia"}, SErrorES: {org: "Error"}, SInformationES: {org: "Información"}, SConfirmES: {org: "Confirmado"}, SOKES: {org: "OK"}, SCancelES: {org: "Cancelar"}, SYesES: {org: "Sí"}, SNoES: {org: "No"}, SAbortES: {org: "Abortar"}, SRetryES: {org: "Rever"}, SIgnoreES: {org: "Ignorar"}, SHelpES: {org: "Ayudar"}, SCloseES: {org: "Cerrar"}, SAllES: {org: "Todos"}, SYesToAllES: {org: "Sí a todo"}, SNoToAllES: {org: "No a todo"}, SWarningNL: {org: "Waarschuwing"}, SErrorNL: {org: "Fout"}, SInformationNL: {org: "Informatie"}, SConfirmNL: {org: "Bevestiging"}, SOKNL: {org: "OK"}, SCancelNL: {org: "Afbreken"}, SYesNL: {org: "Ja"}, SNoNL: {org: "Nee"}, SAbortNL: {org: "Afbreken"}, SRetryNL: {org: "Opnieuw"}, SIgnoreNL: {org: "Negeren"}, SHelpNL: {org: "Hulp"}, SCloseNL: {org: "Sluiten"}, SAllNL: {org: "Alles"}, SYesToAllNL: {org: "Ja op alles"}, SNoToAllNL: {org: "Nee op alles"}};
});
rtl.module("WEBLib.Dialogs",["System","Classes","WEBLib.Controls","Web","JS","SysUtils","WEBLib.Graphics"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.TMsgDlgType = {"0": "mtWarning", mtWarning: 0, "1": "mtError", mtError: 1, "2": "mtInformation", mtInformation: 2, "3": "mtConfirmation", mtConfirmation: 3, "4": "mtCustom", mtCustom: 4};
  this.$rtti.$Enum("TMsgDlgType",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TMsgDlgType});
  this.TMsgDlgBtn = {"0": "mbYes", mbYes: 0, "1": "mbNo", mbNo: 1, "2": "mbOK", mbOK: 2, "3": "mbCancel", mbCancel: 3, "4": "mbAbort", mbAbort: 4, "5": "mbRetry", mbRetry: 5, "6": "mbIgnore", mbIgnore: 6, "7": "mbAll", mbAll: 7, "8": "mbNoToAll", mbNoToAll: 8, "9": "mbYesToAll", mbYesToAll: 9, "10": "mbHelp", mbHelp: 10, "11": "mbClose", mbClose: 11};
  this.$rtti.$Enum("TMsgDlgBtn",{minvalue: 0, maxvalue: 11, ordtype: 1, enumtype: this.TMsgDlgBtn});
  this.$rtti.$Set("TMsgDlgButtons",{comptype: this.$rtti["TMsgDlgBtn"]});
  this.$rtti.$RefToProcVar("TDialogResultProc",{procsig: rtl.newTIProcSig([["AValue",rtl.longint]])});
  rtl.createClass(this,"TCustomDialogButton",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FCaption = "";
      this.FTag = 0;
      this.FElementClassName = "";
    };
    var $r = this.$rtti;
    $r.addProperty("Caption",0,rtl.string,"FCaption","FCaption");
    $r.addProperty("ElementClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","FElementClassName");
    $r.addProperty("Tag",0,rtl.longint,"FTag","FTag",4,{Default: 0});
  });
  rtl.createClass(this,"TCustomDialogButtons",pas.Classes.TOwnedCollection,function () {
    this.GetItem$1 = function (AIndex) {
      var Result = null;
      Result = this.GetItem(AIndex);
      return Result;
    };
    this.SetItem$1 = function (AIndex, Value) {
      this.SetItem(AIndex,Value);
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (AIndex) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,AIndex);
      return Result;
    };
  });
  rtl.createClass(this,"TMessageDlg",pas["WEBLib.Controls"].TCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Controls"].TCustomControl.$init.call(this);
      this.FOpacity = 0.0;
      this.FLayer$1 = null;
      this.FDlg = null;
      this.FCancel = null;
      this.FMessage = "";
      this.FTitle = "";
      this.FMsgDlgType = 0;
      this.FOnButtonClick = null;
      this.FOnClose = null;
      this.FButtons = {};
      this.FDialogProc = null;
      this.FDialogResult = 0;
      this.FMdx = 0;
      this.FMdy = 0;
      this.FDlgX = 0;
      this.FDlgY = 0;
      this.FCaptured$1 = false;
      this.FDown = false;
      this.FElementTitleClassName = "";
      this.FElementButtonClassName = "";
      this.FElementContentClassName = "";
      this.FDialogText = null;
      this.FCustomButtons = null;
      this.FElementDialogClassName = "";
      this.FAutoLanguage = false;
      this.FUseMaterial = false;
    };
    this.$final = function () {
      this.FLayer$1 = undefined;
      this.FDlg = undefined;
      this.FCancel = undefined;
      this.FOnButtonClick = undefined;
      this.FOnClose = undefined;
      this.FButtons = undefined;
      this.FDialogProc = undefined;
      this.FDialogText = undefined;
      this.FCustomButtons = undefined;
      pas["WEBLib.Controls"].TCustomControl.$final.call(this);
    };
    this.SetDialogText = function (Value) {
      this.FDialogText.Assign(Value);
    };
    this.SetCustomButtons = function (Value) {
      this.FCustomButtons.Assign(Value);
    };
    this.CreateElement = function () {
      var Result = null;
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        Result = null}
       else pas["WEBLib.Controls"].TCustomControl.CreateElement.call(this);
      return Result;
    };
    var TLang = {"0": "lEN", lEN: 0, "1": "lFR", lFR: 1, "2": "lDE", lDE: 2, "3": "lES", lES: 3, "4": "lNL", lNL: 4};
    this.GetDialogText = function (Index) {
      var Result = "";
      var locl = "";
      var l = 0;
      Result = "Undefined";
      if (Index < this.FDialogText.GetCount()) Result = this.FDialogText.Get(Index);
      if (this.FAutoLanguage) {
        locl = pas["WEBLib.WebTools"].GetBrowserLocale();
        l = TLang.lEN;
        if (pas.System.Pos("es",locl) === 1) l = TLang.lES;
        if (pas.System.Pos("fr",locl) === 1) l = TLang.lFR;
        if (pas.System.Pos("de",locl) === 1) l = TLang.lDE;
        if (pas.System.Pos("nl",locl) === 1) l = TLang.lNL;
        var $tmp = l;
        if ($tmp === TLang.lES) {
          var $tmp1 = Index;
          if ($tmp1 === 0) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SWarningES")}
           else if ($tmp1 === 1) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SErrorES")}
           else if ($tmp1 === 2) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SInformationES")}
           else if ($tmp1 === 3) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SConfirmES")}
           else if ($tmp1 === 5) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SOKES")}
           else if ($tmp1 === 6) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SCancelES")}
           else if ($tmp1 === 7) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SYesES")}
           else if ($tmp1 === 8) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SNoES")}
           else if ($tmp1 === 9) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SAbortES")}
           else if ($tmp1 === 10) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SRetryES")}
           else if ($tmp1 === 11) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SIgnoreES")}
           else if ($tmp1 === 12) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SAllES")}
           else if ($tmp1 === 13) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SYesToAllES")}
           else if ($tmp1 === 14) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SNoToAllES")}
           else if ($tmp1 === 15) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SHelpES")}
           else if ($tmp1 === 16) Result = rtl.getResStr(pas["WEBLib.Consts"],"SCloseES");
        } else if ($tmp === TLang.lFR) {
          var $tmp2 = Index;
          if ($tmp2 === 0) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SWarningFR")}
           else if ($tmp2 === 1) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SErrorFR")}
           else if ($tmp2 === 2) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SInformationFR")}
           else if ($tmp2 === 3) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SConfirmFR")}
           else if ($tmp2 === 5) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SOKFR")}
           else if ($tmp2 === 6) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SCancelFR")}
           else if ($tmp2 === 7) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SYesFR")}
           else if ($tmp2 === 8) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SNoFR")}
           else if ($tmp2 === 9) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SAbortFR")}
           else if ($tmp2 === 10) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SRetryFR")}
           else if ($tmp2 === 11) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SIgnoreFR")}
           else if ($tmp2 === 12) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SAllFR")}
           else if ($tmp2 === 13) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SYesToAllFR")}
           else if ($tmp2 === 14) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SNoToAllFR")}
           else if ($tmp2 === 15) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SHelpFR")}
           else if ($tmp2 === 16) Result = rtl.getResStr(pas["WEBLib.Consts"],"SCloseFR");
        } else if ($tmp === TLang.lDE) {
          var $tmp3 = Index;
          if ($tmp3 === 0) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SWarningDE")}
           else if ($tmp3 === 1) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SErrorDE")}
           else if ($tmp3 === 2) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SInformationDE")}
           else if ($tmp3 === 3) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SConfirmDE")}
           else if ($tmp3 === 5) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SOKDE")}
           else if ($tmp3 === 6) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SCancelDE")}
           else if ($tmp3 === 7) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SYesDE")}
           else if ($tmp3 === 8) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SNoDE")}
           else if ($tmp3 === 9) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SAbortDE")}
           else if ($tmp3 === 10) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SRetryDE")}
           else if ($tmp3 === 11) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SIgnoreDE")}
           else if ($tmp3 === 12) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SAllDE")}
           else if ($tmp3 === 13) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SYesToAllDE")}
           else if ($tmp3 === 14) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SNoToAllDE")}
           else if ($tmp3 === 15) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SHelpDE")}
           else if ($tmp3 === 16) Result = rtl.getResStr(pas["WEBLib.Consts"],"SCloseDE");
        } else if ($tmp === TLang.lNL) {
          var $tmp4 = Index;
          if ($tmp4 === 0) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SWarningNL")}
           else if ($tmp4 === 1) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SErrorNL")}
           else if ($tmp4 === 2) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SInformationNL")}
           else if ($tmp4 === 3) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SConfirmNL")}
           else if ($tmp4 === 5) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SOKNL")}
           else if ($tmp4 === 6) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SCancelNL")}
           else if ($tmp4 === 7) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SYesNL")}
           else if ($tmp4 === 8) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SNoNL")}
           else if ($tmp4 === 9) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SAbortNL")}
           else if ($tmp4 === 10) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SRetryNL")}
           else if ($tmp4 === 11) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SIgnoreNL")}
           else if ($tmp4 === 12) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SAllNL")}
           else if ($tmp4 === 13) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SYesToAllNL")}
           else if ($tmp4 === 14) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SNoToAllNL")}
           else if ($tmp4 === 15) {
            Result = rtl.getResStr(pas["WEBLib.Consts"],"SHelpNL")}
           else if ($tmp4 === 16) Result = rtl.getResStr(pas["WEBLib.Consts"],"SCloseNL");
        };
      };
      return Result;
    };
    this.BindEvents = function () {
    };
    this.SetDialogResult = function (Value) {
      this.FDialogResult = Value;
      if (this.FDialogResult !== 0) this.Close();
    };
    this.CreateButton = function (Caption, DoFocus, AClass) {
      var Result = null;
      var BtnClass = "";
      Result = document.createElement("BUTTON");
      Result.innerHTML = Caption;
      if (pas["WEBLib.Forms"].Application.FMainForm.FCSSLibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap) {
        Result.setAttribute("type","BUTTON");
        Result.setAttribute("class","btn " + AClass);
        Result.setAttribute("data-dismiss","modal-dialog");
      } else {
        BtnClass = AClass;
        if (BtnClass !== "") BtnClass = " " + BtnClass;
        Result.style.setProperty("width","100px");
        Result.style.setProperty("margin-left","5px");
        if (this.FElementButtonClassName !== "") {
          Result.setAttribute("class",this.FElementButtonClassName + BtnClass)}
         else if (pas["WEBLib.Forms"].Application.FThemeButtonClassName !== "") Result.setAttribute("class",pas["WEBLib.Forms"].Application.FThemeButtonClassName + BtnClass);
      };
      Result.id = Caption;
      Result.addEventListener("click",rtl.createSafeCallback(this,"HandleButtonClick"));
      Result.addEventListener("keydown",rtl.createSafeCallback(this,"HandleKeyDown"));
      if (DoFocus.get()) {
        setTimeout(function() {Result.focus();}, 1);
        DoFocus.set(false);
      };
      return Result;
    };
    this.HandleDocMouseMove = function (Event) {
      var Result = false;
      var deltax = 0.0;
      var deltay = 0.0;
      var el = null;
      var AEvent = null;
      AEvent = Event;
      if (this.FDown) {
        deltax = AEvent.screenX - this.FMdx;
        deltay = AEvent.screenY - this.FMdy;
        el = this.FDlg;
        el.style.setProperty("transform","");
        el.style.setProperty("position","absolute");
        el.style.setProperty("left",pas.SysUtils.IntToStr(Math.round(this.FDlgX + deltax)) + "px");
        el.style.setProperty("top",pas.SysUtils.IntToStr(Math.round(this.FDlgY + deltay)) + "px");
        el = this.FCancel;
        el.style.setProperty("position","absolute");
        el.style.setProperty("top","0");
        el.style.setProperty("right","0");
      };
      Result = true;
      return Result;
    };
    this.HandleDocMouseUp = function (Event) {
      var Result = false;
      this.FDown = false;
      document.body.removeEventListener("mousemove",rtl.createSafeCallback(this,"HandleDocMouseMove"));
      document.body.removeEventListener("mouseup",rtl.createSafeCallback(this,"HandleDocMouseUp"));
      Result = true;
      return Result;
    };
    this.HandleMouseDown = function (Event) {
      var Result = false;
      var r = null;
      var AEvent = null;
      AEvent = Event;
      this.FMdx = Math.round(AEvent.screenX);
      this.FMdy = Math.round(AEvent.screenY);
      r = this.FDlg.getBoundingClientRect();
      this.FDlgX = Math.round(pas.System.Int(r.left));
      this.FDlgY = Math.round(pas.System.Int(r.top));
      this.FDown = true;
      if (!this.FCaptured$1) {
        this.FCaptured$1 = true;
        document.body.addEventListener("mousemove",rtl.createSafeCallback(this,"HandleDocMouseMove"));
        document.body.addEventListener("mouseup",rtl.createSafeCallback(this,"HandleDocMouseUp"));
      };
      Result = true;
      return Result;
    };
    this.HandleButtonClick = function (Event) {
      var Result = false;
      var id = "";
      var i = 0;
      this.SetDialogResult(0);
      id = Event.target.getAttribute("id");
      if (id === this.GetDialogText(7)) {
        this.SetDialogResult(6)}
       else if (id === this.GetDialogText(8)) {
        this.SetDialogResult(7)}
       else if (id === this.GetDialogText(5)) {
        this.SetDialogResult(1)}
       else if (id === this.GetDialogText(6)) {
        this.SetDialogResult(2)}
       else if (id === this.GetDialogText(9)) {
        this.SetDialogResult(3)}
       else if (id === this.GetDialogText(10)) {
        this.SetDialogResult(4)}
       else if (id === this.GetDialogText(11)) {
        this.SetDialogResult(5)}
       else if (id === this.GetDialogText(12)) {
        this.SetDialogResult(12)}
       else if (id === this.GetDialogText(13)) {
        this.SetDialogResult(13)}
       else if (id === this.GetDialogText(14)) {
        this.SetDialogResult(14)}
       else if (id === this.GetDialogText(15)) {
        this.SetDialogResult(9)}
       else if (id === this.GetDialogText(16)) this.SetDialogResult(8);
      if ((this.FDialogResult === 0) && (this.FCustomButtons.GetCount() > 0)) {
        for (var $l = 0, $end = this.FCustomButtons.GetCount() - 1; $l <= $end; $l++) {
          i = $l;
          if (id === this.FCustomButtons.GetItem$1(i).FCaption) {
            this.SetDialogResult(100 + i);
            break;
          };
        };
      };
      if (this.FOnButtonClick != null) this.FOnButtonClick(this);
      Result = true;
      return Result;
    };
    this.HandleKeyDown = function (Event) {
      var Result = false;
      var k = 0;
      var AEvent = null;
      AEvent = Event;
      k = this.GetKeyCode(AEvent.key,true);
      if (!pas.System.Assigned(k)) return Result;
      if (k === 27) this.SetDialogResult(2);
      Result = true;
      return Result;
    };
    this.InitBootstrapStyle = function () {
      this.FElementButtonClassName = "btn";
      this.FElementContentClassName = "text-body";
      this.FElementTitleClassName = "text-body";
      this.FElementDialogClassName = "shadow-lg p-3 mb-5 bg-body text-body rounded";
    };
    this.InsertInputElement = function (AElement, DoFocus) {
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.FOpacity = 0.2;
      this.FMessage = "";
      this.FAutoLanguage = true;
      this.FMsgDlgType = $mod.TMsgDlgType.mtInformation;
      this.FDialogText = pas.Classes.TStringList.$create("Create$1");
      this.FDialogText.SetSkipLastLineBreak(true);
      this.FDialogText.Add(rtl.getResStr(pas["WEBLib.Consts"],"SWarning"));
      this.FDialogText.Add(rtl.getResStr(pas["WEBLib.Consts"],"SError"));
      this.FDialogText.Add(rtl.getResStr(pas["WEBLib.Consts"],"SInformation"));
      this.FDialogText.Add(rtl.getResStr(pas["WEBLib.Consts"],"SConfirm"));
      this.FDialogText.Add("Custom");
      this.FDialogText.Add(rtl.getResStr(pas["WEBLib.Consts"],"SOK"));
      this.FDialogText.Add(rtl.getResStr(pas["WEBLib.Consts"],"SCancel"));
      this.FDialogText.Add(rtl.getResStr(pas["WEBLib.Consts"],"SYes"));
      this.FDialogText.Add(rtl.getResStr(pas["WEBLib.Consts"],"SNo"));
      this.FDialogText.Add(rtl.getResStr(pas["WEBLib.Consts"],"SAbort"));
      this.FDialogText.Add(rtl.getResStr(pas["WEBLib.Consts"],"SRetry"));
      this.FDialogText.Add(rtl.getResStr(pas["WEBLib.Consts"],"SIgnore"));
      this.FDialogText.Add(rtl.getResStr(pas["WEBLib.Consts"],"SAll"));
      this.FDialogText.Add(rtl.getResStr(pas["WEBLib.Consts"],"SYesToAll"));
      this.FDialogText.Add(rtl.getResStr(pas["WEBLib.Consts"],"SNoToAll"));
      this.FDialogText.Add(rtl.getResStr(pas["WEBLib.Consts"],"SHelp"));
      this.FDialogText.Add(rtl.getResStr(pas["WEBLib.Consts"],"SClose"));
      this.FMsgDlgType = $mod.TMsgDlgType.mtCustom;
      this.FUseMaterial = true;
      this.FCustomButtons = $mod.TCustomDialogButtons.$create("Create$2",[this,$mod.TCustomDialogButton]);
      this.FCustomButtons.FPropName = "CustomButtons";
    };
    this.Destroy = function () {
      rtl.free(this,"FDialogText");
      rtl.free(this,"FCustomButtons");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.Close = function () {
      pas["WEBLib.Forms"].Application.UnLockForm(pas["WEBLib.Forms"].Application.FMainForm);
      document.body.removeChild(this.FLayer$1);
      document.body.removeChild(this.FDlg);
      this.FDown = false;
      this.FCaptured$1 = false;
      if (this.FOnClose != null) this.FOnClose(this);
      if (this.FDialogProc != null) this.FDialogProc(this.FDialogResult);
    };
    this.Show$1 = function () {
      var title = null;
      var msg = null;
      var icon = null;
      var content = null;
      var contentdiv = null;
      var bar = null;
      var edlg = null;
      var eh = null;
      var cancel = null;
      var adiv = null;
      var ldiv = null;
      var cdiv = null;
      var MsgSymbol = "";
      var MsgColor = "";
      var MsgTitle = "";
      var BorderColor = "";
      var BarBGColor = "";
      var BarHeight = "";
      var Padding = "";
      var btnFocus = false;
      var i = 0;
      if ((pas["WEBLib.Forms"].Application === null) || (pas["WEBLib.Forms"].Application.FMainForm === null)) return;
      if (this.FUseMaterial && !pas["WEBLib.Forms"].Application.HasCSS($impl.lMaterial)) this.AddControlLink("material",$impl.lMaterial);
      pas["WEBLib.Forms"].Application.LockForm(pas["WEBLib.Forms"].Application.FMainForm);
      this.FLayer$1 = document.createElement("SPAN");
      document.body.appendChild(this.FLayer$1);
      this.FLayer$1.setAttribute("tabindex","0");
      this.FLayer$1.addEventListener("keydown",rtl.createSafeCallback(this,"HandleKeyDown"));
      btnFocus = true;
      this.FMessage = $impl.StringToHTML(this.FMessage);
      var $tmp = this.FMsgDlgType;
      if ($tmp === $mod.TMsgDlgType.mtWarning) {
        MsgSymbol = "warning";
        MsgColor = "orange";
        MsgTitle = this.GetDialogText(0);
      } else if ($tmp === $mod.TMsgDlgType.mtError) {
        MsgSymbol = "cancel";
        MsgColor = "red";
        MsgTitle = this.GetDialogText(1);
      } else if ($tmp === $mod.TMsgDlgType.mtInformation) {
        MsgSymbol = "info";
        MsgColor = "blue";
        MsgTitle = this.GetDialogText(2);
      } else if ($tmp === $mod.TMsgDlgType.mtConfirmation) {
        MsgSymbol = "help";
        MsgColor = "blue";
        MsgTitle = this.GetDialogText(3);
      } else if ($tmp === $mod.TMsgDlgType.mtCustom) {
        MsgSymbol = "";
        MsgColor = "";
        MsgTitle = this.GetDialogText(4);
      };
      if (this.FTitle !== "") MsgTitle = this.FTitle;
      if (pas["WEBLib.Forms"].Application.FMainForm.FCSSLibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap) {
        this.FDlg = document.createElement("DIV");
        this.FDlg.setAttribute("class","modal-dialog");
        this.FDlg.setAttribute("role","document");
        this.FDlg.style.setProperty("z-index","1999998");
        eh = document.createElement("DIV");
        eh.style.setProperty("top","0");
        eh.style.setProperty("left","0");
        eh.style.setProperty("right","0");
        eh.style.setProperty("bottom","0");
        eh.style.setProperty("z-index","1999997");
        eh.style.setProperty("display","block");
        eh.setAttribute("class","modal show fade");
        document.body.appendChild(eh);
        eh.appendChild(this.FDlg);
        ldiv = this.FDlg;
        adiv = document.createElement("DIV");
        adiv.setAttribute("class","modal-content " + this.FElementDialogClassName);
        ldiv.appendChild(adiv);
        cdiv = adiv;
        ldiv = adiv;
        adiv = document.createElement("DIV");
        adiv.setAttribute("class","modal-header");
        cdiv.appendChild(adiv);
        ldiv = adiv;
        adiv = document.createElement("H5");
        adiv.setAttribute("class","modal-title");
        adiv.innerHTML = MsgTitle;
        ldiv.appendChild(adiv);
        if ($mod.TMsgDlgBtn.mbCancel in this.FButtons) {
          adiv = document.createElement("BUTTON");
          adiv.setAttribute("type","button");
          adiv.setAttribute("class","close btn btn-danger");
          adiv.setAttribute("data-dismiss","modal-dialog");
          adiv.setAttribute("aria-label","Close");
          adiv.setAttribute("id",this.GetDialogText(6));
          adiv.addEventListener("click",rtl.createSafeCallback(this,"HandleButtonClick"));
          ldiv.appendChild(adiv);
          ldiv = adiv;
          adiv = document.createElement("SPAN");
          adiv.setAttribute("aria-hidden","true");
          adiv.setAttribute("id",this.GetDialogText(6));
          adiv.innerHTML = "&times;";
          ldiv.appendChild(adiv);
        };
        adiv = document.createElement("DIV");
        adiv.setAttribute("class","modal-body");
        cdiv.appendChild(adiv);
        ldiv = adiv;
        if (this.FMsgDlgType !== $mod.TMsgDlgType.mtCustom) {
          icon = document.createElement("SPAN");
          icon.innerHTML = '<i class="material-icons" style="color:' + MsgColor + '!important;font-size:48px!important">' + MsgSymbol + "</i>";
          icon.style.setProperty("display","inline-block");
          icon.style.setProperty("float","left");
          icon.style.setProperty("padding-right","15px");
          ldiv.appendChild(icon);
        };
        adiv = document.createElement("H6");
        adiv.innerHTML = this.FMessage;
        ldiv.appendChild(adiv);
        this.InsertInputElement(ldiv,{get: function () {
            return btnFocus;
          }, set: function (v) {
            btnFocus = v;
          }});
        adiv = document.createElement("DIV");
        adiv.setAttribute("class","modal-footer");
        cdiv.appendChild(adiv);
        ldiv = adiv;
        bar = ldiv;
        this.FDlg = eh;
      } else {
        Padding = "5";
        BarHeight = "26";
        BarBGColor = "#f1f1f1";
        BorderColor = "#ababab";
        this.FDlg = document.createElement("DIV");
        document.body.appendChild(this.FDlg);
        edlg = this.FDlg;
        if (this.FElementDialogClassName !== "") {
          edlg.setAttribute("class",this.FElementDialogClassName)}
         else {
          edlg.style.setProperty("background-color","white");
          edlg.style.setProperty("border","1px solid " + BorderColor);
          edlg.style.setProperty("font-family","Arial");
          edlg.style.setProperty("font-size","10pt");
        };
        edlg.style.setProperty("cursor","default");
        edlg.style.setProperty("position","fixed");
        edlg.style.setProperty("min-width","300px");
        edlg.style.setProperty("min-height","125px");
        edlg.style.setProperty("max-width","100%");
        edlg.style.setProperty("max-height","100%");
        edlg.style.setProperty("top","50%");
        edlg.style.setProperty("left","50%");
        edlg.style.setProperty("transform","translate(-50%, -50%)");
        edlg.style.setProperty("z-index","1999998");
        edlg.style.setProperty("box-shadow","5px 5px 5px gray");
        cancel = document.createElement("DIV");
        this.FCancel = cancel;
        cancel.innerHTML = '<i id="Cancel" class="material-icons" style="font-size:16px!important">clear</i>';
        cancel.id = "Cancel";
        cancel.style.setProperty("color",pas["WEBLib.Graphics"].ColorToHTML(pas["WEBLib.Forms"].Application.FThemeTextColor));
        cancel.style.setProperty("position","fixed");
        cancel.style.setProperty("top","0");
        cancel.style.setProperty("right","0");
        cancel.style.setProperty("padding",Padding + "px");
        cancel.style.setProperty("height",BarHeight + "px");
        cancel.style.setProperty("line-height",BarHeight + "px");
        cancel.addEventListener("click",rtl.createSafeCallback(this,"HandleButtonClick"));
        edlg.appendChild(cancel);
        title = document.createElement("DIV");
        title.innerHTML = MsgTitle;
        if (this.FElementTitleClassName !== "") {
          title.setAttribute("class",this.FElementTitleClassName);
        } else {
          title.style.setProperty("background-color",pas["WEBLib.Graphics"].ColorToHTML(pas["WEBLib.Forms"].Application.FThemeColor));
          title.style.setProperty("color",pas["WEBLib.Graphics"].ColorToHTML(pas["WEBLib.Forms"].Application.FThemeTextColor));
        };
        title.style.setProperty("cursor","move");
        title.style.setProperty("padding-left",Padding + "px");
        title.style.setProperty("height",BarHeight + "px");
        title.style.setProperty("vertical-align","middle");
        title.style.setProperty("line-height",BarHeight + "px");
        title.style.setProperty("border-bottom","1px solid " + BorderColor);
        title.style.setProperty("-moz-user-select","none");
        title.style.setProperty("-webkit-user-select","none");
        title.style.setProperty("-ms-user-select","none");
        title.style.setProperty("user-select","none");
        title.style.setProperty("-o-user-select","none");
        title.addEventListener("mousedown",rtl.createSafeCallback(this,"HandleMouseDown"));
        edlg.appendChild(title);
        msg = document.createElement("DIV");
        msg.style.setProperty("padding",Padding + "px");
        msg.style.setProperty("height","auto");
        msg.style.setProperty("min-height","50px");
        msg.style.setProperty("border-bottom","1px solid " + BorderColor);
        if (this.FMsgDlgType !== $mod.TMsgDlgType.mtCustom) {
          icon = document.createElement("DIV");
          icon.innerHTML = '<i class="material-icons" style="color:' + MsgColor + '!important;font-size:48px!important">' + MsgSymbol + "</i>";
          icon.style.setProperty("display","inline-block");
          icon.style.setProperty("float","left");
          icon.style.setProperty("padding-right","15px");
          msg.appendChild(icon);
        };
        this.FMessage = pas.SysUtils.StringReplace(this.FMessage,pas.System.sLineBreak,"<BR>",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
        contentdiv = document.createElement("DIV");
        contentdiv.innerHTML = this.FMessage;
        contentdiv.style.setProperty("height","auto");
        contentdiv.style.setProperty("min-height","50px");
        contentdiv.style.setProperty("white-space","pre-wrap");
        content = document.createElement("LABEL");
        content.innerHTML = this.FMessage;
        if (this.FElementTitleClassName !== "") {
          content.setAttribute("class",this.FElementContentClassName);
        };
        contentdiv.appendChild(content);
        msg.appendChild(content);
        this.InsertInputElement(msg,{get: function () {
            return btnFocus;
          }, set: function (v) {
            btnFocus = v;
          }});
        edlg.appendChild(msg);
        bar = document.createElement("DIV");
        bar.style.setProperty("background-color",BarBGColor);
        bar.style.setProperty("padding",Padding + "px");
        bar.style.setProperty("min-height",BarHeight + "px");
        bar.style.setProperty("height","auto");
        bar.style.setProperty("line-height",BarHeight + "px");
        bar.style.setProperty("text-align","right");
        edlg.appendChild(bar);
      };
      if (rtl.eqSet(this.FButtons,{}) && (this.FCustomButtons.GetCount() === 0)) {
        bar.appendChild(this.CreateButton(this.GetDialogText(5),{get: function () {
            return btnFocus;
          }, set: function (v) {
            btnFocus = v;
          }},""))}
       else {
        if ($mod.TMsgDlgBtn.mbYes in this.FButtons) bar.appendChild(this.CreateButton(this.GetDialogText(7),{get: function () {
            return btnFocus;
          }, set: function (v) {
            btnFocus = v;
          }},""));
        if ($mod.TMsgDlgBtn.mbNo in this.FButtons) bar.appendChild(this.CreateButton(this.GetDialogText(8),{get: function () {
            return btnFocus;
          }, set: function (v) {
            btnFocus = v;
          }},""));
        if ($mod.TMsgDlgBtn.mbOK in this.FButtons) bar.appendChild(this.CreateButton(this.GetDialogText(5),{get: function () {
            return btnFocus;
          }, set: function (v) {
            btnFocus = v;
          }},""));
        if ($mod.TMsgDlgBtn.mbCancel in this.FButtons) bar.appendChild(this.CreateButton(this.GetDialogText(6),{get: function () {
            return btnFocus;
          }, set: function (v) {
            btnFocus = v;
          }},""));
        if ($mod.TMsgDlgBtn.mbAbort in this.FButtons) bar.appendChild(this.CreateButton(this.GetDialogText(9),{get: function () {
            return btnFocus;
          }, set: function (v) {
            btnFocus = v;
          }},""));
        if ($mod.TMsgDlgBtn.mbRetry in this.FButtons) bar.appendChild(this.CreateButton(this.GetDialogText(10),{get: function () {
            return btnFocus;
          }, set: function (v) {
            btnFocus = v;
          }},""));
        if ($mod.TMsgDlgBtn.mbIgnore in this.FButtons) bar.appendChild(this.CreateButton(this.GetDialogText(11),{get: function () {
            return btnFocus;
          }, set: function (v) {
            btnFocus = v;
          }},""));
        if ($mod.TMsgDlgBtn.mbAll in this.FButtons) bar.appendChild(this.CreateButton(this.GetDialogText(12),{get: function () {
            return btnFocus;
          }, set: function (v) {
            btnFocus = v;
          }},""));
        if ($mod.TMsgDlgBtn.mbYesToAll in this.FButtons) bar.appendChild(this.CreateButton(this.GetDialogText(13),{get: function () {
            return btnFocus;
          }, set: function (v) {
            btnFocus = v;
          }},""));
        if ($mod.TMsgDlgBtn.mbNoToAll in this.FButtons) bar.appendChild(this.CreateButton(this.GetDialogText(14),{get: function () {
            return btnFocus;
          }, set: function (v) {
            btnFocus = v;
          }},""));
        if ($mod.TMsgDlgBtn.mbHelp in this.FButtons) bar.appendChild(this.CreateButton(this.GetDialogText(15),{get: function () {
            return btnFocus;
          }, set: function (v) {
            btnFocus = v;
          }},""));
        if ($mod.TMsgDlgBtn.mbClose in this.FButtons) bar.appendChild(this.CreateButton(this.GetDialogText(16),{get: function () {
            return btnFocus;
          }, set: function (v) {
            btnFocus = v;
          }},""));
      };
      for (var $l = 0, $end = this.FCustomButtons.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        bar.appendChild(this.CreateButton(this.FCustomButtons.GetItem$1(i).FCaption,{get: function () {
            return btnFocus;
          }, set: function (v) {
            btnFocus = v;
          }},this.FCustomButtons.GetItem$1(i).FElementClassName));
      };
      eh = this.FLayer$1;
      eh.style.setProperty("background-color","black");
      eh.style.setProperty("opacity",pas["WEBLib.WebTools"].DoubleToHTML(this.FOpacity));
      eh.style.setProperty("top","0");
      eh.style.setProperty("left","0");
      eh.style.setProperty("right","0");
      eh.style.setProperty("bottom","0");
      eh.style.setProperty("z-index",pas["WEBLib.Forms"].Application.MaxZIndexStr());
      eh.style.setProperty("webkit-user-select","none");
      eh.style.setProperty("moz-user-select","none");
      eh.style.setProperty("khtml-user-select","none");
      eh.style.setProperty("ms-user-select","none");
      eh.style.setProperty("user-select","none");
      eh.style.setProperty("position","fixed");
    };
    this.ShowDialog = function () {
      var Result = 0;
      Result = 0;
      this.Show$1();
      return Result;
    };
    this.ShowDialog$1 = function (Msg, DlgType, Buttons, AProc) {
      var Result = 0;
      Result = 0;
      this.FButtons = rtl.refSet(Buttons);
      this.FMessage = Msg;
      this.FMsgDlgType = DlgType;
      this.FDialogProc = AProc;
      this.SetDialogResult(0);
      this.Show$1();
      return Result;
    };
    this.ShowDialog$2 = function (Msg, DlgType, Buttons) {
      var $Self = this;
      var Result = null;
      Result = new Promise(function (ASuccess, AFailed) {
        $Self.ShowDialog$1(Msg,DlgType,rtl.refSet(Buttons),function (AResult) {
          ASuccess(AResult);
        });
      });
      return Result;
    };
    this.ShowAsync = function () {
      var $Self = this;
      var Result = null;
      Result = new Promise(function (ASuccess, AFailed) {
        $Self.ShowDialog$1($Self.FMessage,$Self.FMsgDlgType,rtl.refSet($Self.FButtons),function (AResult) {
          ASuccess(AResult);
        });
      });
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("AutoLanguage",0,rtl.boolean,"FAutoLanguage","FAutoLanguage",4,{Default: true});
    $r.addProperty("Buttons",0,$mod.$rtti["TMsgDlgButtons"],"FButtons","FButtons",4,{Default: {}});
    $r.addProperty("CustomButtons",2,$mod.$rtti["TCustomDialogButtons"],"FCustomButtons","SetCustomButtons");
    $r.addProperty("DialogText",2,pas.Classes.$rtti["TStringList"],"FDialogText","SetDialogText");
    $r.addProperty("DialogType",0,$mod.$rtti["TMsgDlgType"],"FMsgDlgType","FMsgDlgType",4,{Default: $mod.TMsgDlgType.mtCustom});
    $r.addProperty("Message",0,rtl.string,"FMessage","FMessage");
    $r.addProperty("Opacity",0,rtl.double,"FOpacity","FOpacity");
    $r.addProperty("ElementButtonClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementButtonClassName","FElementButtonClassName");
    $r.addProperty("ElementDialogClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementDialogClassName","FElementDialogClassName");
    $r.addProperty("ElementTitleClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementTitleClassName","FElementTitleClassName");
    $r.addProperty("ElementContentClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementContentClassName","FElementContentClassName");
    $r.addProperty("Title",0,rtl.string,"FTitle","FTitle");
    $r.addProperty("UseMaterial",0,rtl.boolean,"FUseMaterial","FUseMaterial",4,{Default: true});
    $r.addProperty("OnButtonClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnButtonClick","FOnButtonClick");
    $r.addProperty("OnClose",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClose","FOnClose");
  });
  rtl.createClass(this,"TWebMessageDlg",this.TMessageDlg,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TInputMessageDlg",this.TMessageDlg,function () {
    this.$init = function () {
      $mod.TMessageDlg.$init.call(this);
      this.FInputElement = null;
      this.FInputValue = "";
      this.FKeydownHandler = null;
      this.FKeypressHandler = null;
      this.FInputType = 0;
    };
    this.$final = function () {
      this.FInputElement = undefined;
      $mod.TMessageDlg.$final.call(this);
    };
    this.ShowAsync = function () {
      var $Self = this;
      var Result = null;
      Result = new Promise(function (ASuccess, AFailed) {
        $Self.ShowDialog$1($Self.FMessage,$Self.FMsgDlgType,rtl.refSet($Self.FButtons),function (AResult) {
          $Self.FInputValue = $Self.GetInputElementValue();
          ASuccess(AResult);
        });
      });
      return Result;
    };
    this.HandleInputKeydown = function (Event) {
      var Result = false;
      Result = true;
      if (Event.key === "Enter") {
        Event.preventDefault();
        Event.stopPropagation();
        this.SetDialogResult(1);
        Result = false;
      };
      if (Event.key === "Escape") {
        Event.preventDefault();
        Event.stopPropagation();
        this.SetDialogResult(2);
        Result = false;
      };
      return Result;
    };
    this.HandleInputKeypress = function (Event) {
      var Result = false;
      Result = true;
      Event.stopPropagation();
      return Result;
    };
    this.InsertInputElement = function (AElement, DoFocus) {
      var divel = null;
      var inputel = null;
      $mod.TMessageDlg.InsertInputElement.apply(this,arguments);
      if (this.FKeydownHandler === null) this.FKeydownHandler = rtl.createCallback(this,"HandleInputKeydown");
      if (this.FKeypressHandler === null) this.FKeypressHandler = rtl.createCallback(this,"HandleInputKeypress");
      divel = document.createElement("DIV");
      inputel = document.createElement("INPUT");
      inputel.addEventListener("keydown",this.FKeydownHandler);
      inputel.addEventListener("keypress",this.FKeypressHandler);
      divel.appendChild(inputel);
      AElement.appendChild(divel);
      this.FInputElement = inputel;
      this.FInputElement.setAttribute("type",pas["WEBLib.Controls"].InputTypeString(this.FInputType));
      divel.style.setProperty("margin-top","10px");
      this.FInputElement.style.setProperty("padding","4px");
      this.SetInputElementValue(this.FInputValue);
      this.FInputElement.style.setProperty("width","calc(100% - 80px)");
      if (DoFocus.get()) {
        setTimeout(function() {inputel.focus(); inputel.select()}, 1);
        DoFocus.set(false);
      };
    };
    this.GetInputElementValue = function () {
      var Result = "";
      Result = "";
      if (this.FInputElement != null) {
        this.FInputValue = this.FInputElement.value;
        Result = this.FInputValue;
      };
      return Result;
    };
    this.SetInputElementValue = function (AValue) {
      this.FInputElement.value = AValue;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addField("FInputElement",pas.Web.$rtti["TJSHTMLElement"],4);
    $r.addField("FInputValue",rtl.string,4);
    $r.addField("FKeydownHandler",rtl.pointer,4);
    $r.addField("FKeypressHandler",rtl.pointer,4);
    $r.addProperty("InputValue",1,rtl.string,"GetInputElementValue","FInputValue");
    $r.addProperty("InputType",0,pas["WEBLib.Controls"].$rtti["TInputType"],"FInputType","FInputType",4,{Default: pas["WEBLib.Controls"].TInputType.itText});
  });
  rtl.createClass(this,"TWebInputMessageDlg",this.TInputMessageDlg,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TWaitMessage",pas["WEBLib.Controls"].TCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Controls"].TCustomControl.$init.call(this);
      this.FLayer$1 = null;
      this.FPicture = null;
      this.FOpacity = 0.0;
      this.FOnShow = null;
      this.FOnHide = null;
      this.FIsWaiting = false;
      this.FPictureURL = "";
      this.FTimeOut = 0;
      this.FShowID = 0;
      this.FHideID = 0;
    };
    this.$final = function () {
      this.FLayer$1 = undefined;
      this.FPicture = undefined;
      this.FOnShow = undefined;
      this.FOnHide = undefined;
      pas["WEBLib.Controls"].TCustomControl.$final.call(this);
    };
    this.SetPicture = function (Value) {
      this.FPicture.Assign(Value);
    };
    this.SetPictureURL = function (Value) {
      this.FPictureURL = Value;
    };
    this.WaitDisplayed = function () {
      if (this.FOnShow != null) this.FOnShow(this);
    };
    this.WaitHide = function () {
      if (this.FOnHide != null) this.FOnHide(this);
      this.Hide$1();
    };
    this.CreateElement = function () {
      var Result = null;
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        Result = null}
       else pas["WEBLib.Controls"].TCustomControl.CreateElement.call(this);
      return Result;
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.FOpacity = 0.2;
      this.FPicture = pas["WEBLib.Graphics"].TURLPicture.$create("Create");
      this.FIsWaiting = false;
      this.FPicture.SetData($impl.lWaitCursor);
      this.FShowID = 0;
      this.FHideID = 0;
    };
    this.Destroy = function () {
      rtl.free(this,"FPicture");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.Show$1 = function () {
      var eh = null;
      var img = null;
      var dv = null;
      var el = null;
      this.FLayer$1 = document.createElement("SPAN");
      eh = this.FLayer$1;
      eh.style.setProperty("background-color","black");
      eh.style.setProperty("opacity",pas["WEBLib.WebTools"].DoubleToHTML(this.FOpacity));
      eh.style.setProperty("top","0");
      eh.style.setProperty("left","0");
      eh.style.setProperty("right","0");
      eh.style.setProperty("bottom","0");
      eh.style.setProperty("z-index","9999999");
      eh.style.setProperty("webkit-user-select","none");
      eh.style.setProperty("moz-user-select","none");
      eh.style.setProperty("khtml-user-select","none");
      eh.style.setProperty("ms-user-select","none");
      eh.style.setProperty("user-select","none");
      eh.style.setProperty("position","fixed");
      document.body.appendChild(this.FLayer$1);
      this.FLayer$1.setAttribute("tabindex","0");
      el = document.createElement("DIV");
      this.FContainer = el;
      this.FControlCreated = true;
      dv = el;
      this.FLayer$1.appendChild(el);
      dv.style.setProperty("position","relative");
      dv.style.setProperty("width","100%");
      dv.style.setProperty("height","100%");
      el = document.createElement("IMG");
      img = el;
      dv.appendChild(img);
      if (this.FPictureURL !== "") {
        img.setAttribute("src",this.FPictureURL)}
       else img.setAttribute("src",this.FPicture.FFilename);
      img.style.setProperty("position","absolute");
      img.style.setProperty("top","0");
      img.style.setProperty("left","0");
      img.style.setProperty("right","0");
      img.style.setProperty("bottom","0");
      img.style.setProperty("margin","auto");
      this.FIsWaiting = true;
      if (this.FOnShow != null) {
        this.FShowID = window.setTimeout(rtl.createSafeCallback(this,"WaitDisplayed"),100);
      };
      if (this.FTimeOut > 0) {
        this.FHideID = window.setTimeout(rtl.createSafeCallback(this,"WaitHide"),this.FTimeOut);
      };
    };
    this.Hide$1 = function () {
      if (this.FIsWaiting) document.body.removeChild(this.FLayer$1);
      this.FIsWaiting = false;
      if (this.FShowID > 0) window.clearTimeout(this.FShowID);
      if (this.FHideID > 0) window.clearTimeout(this.FHideID);
      this.FControlCreated = false;
      this.FContainer = null;
      this.FShowID = 0;
      this.FHideID = 0;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Opacity",0,rtl.double,"FOpacity","FOpacity");
    $r.addProperty("Picture",2,pas["WEBLib.Graphics"].$rtti["TURLPicture"],"FPicture","SetPicture");
    $r.addProperty("PictureURL",2,rtl.string,"FPictureURL","SetPictureURL");
    $r.addProperty("TimeOut",0,rtl.longint,"FTimeOut","FTimeOut");
    $r.addProperty("OnHide",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnHide","FOnHide");
    $r.addProperty("OnShow",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnShow","FOnShow");
  });
  rtl.createClass(this,"TWebWaitMessage",this.TWaitMessage,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.$rtti.$MethodVar("TFilesDroppedEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFileList",pas.Classes.$rtti["TStringList"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TFileAsTextEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFileIndex",rtl.longint],["AText",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TFileAsBase64Event",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFileIndex",rtl.longint],["ABase64",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TFileAsDataURLEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFileIndex",rtl.longint],["AURL",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TFileAsArrayBufferEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFileIndex",rtl.longint],["ABuffer",pas["WEBLib.Controls"].$rtti["TJSArrayBufferRecord"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TFileAsStreamEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFileIndex",rtl.longint],["AStream",pas.Classes.$rtti["TStream"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TFileUploadEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFileIndex",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TFileUploadResponseEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFileIndex",rtl.longint],["ARequest",pas["WEBLib.Controls"].$rtti["TJSXMLHttpRequestRecord"]],["AResponse",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TFileUploadErrorEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFileIndex",rtl.longint],["AError",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TFileUploadProgressEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFileIndex",rtl.longint],["APosition",rtl.longint],["ATotalSize",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TFileGetAsBase64",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ABase64",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TFileGetAsText",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AText",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TFileGetAsURL",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AURL",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TFileGetAsArrayBuffer",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ABuffer",pas["WEBLib.Controls"].$rtti["TJSArrayBufferRecord"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TFileGetAsStream",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AStream",pas.Classes.$rtti["TStream"]]]), methodkind: 0});
  this.$rtti.$RefToProcVar("TGetAsStringProc",{procsig: rtl.newTIProcSig([["AValue",rtl.string]])});
  this.$rtti.$RefToProcVar("TGetAsArrayBufferProc",{procsig: rtl.newTIProcSig([["AValue",pas.JS.$rtti["TJSArrayBuffer"]]])});
  this.$rtti.$RefToProcVar("TGetAsStreamProc",{procsig: rtl.newTIProcSig([["AStream",pas.Classes.$rtti["TStream"]]])});
  rtl.createClass(this,"TFile",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FReq = null;
      this.FModified = 0.0;
      this.FName = "";
      this.FMimeType = "";
      this.FSize = 0;
      this.FFileObject = null;
      this.FTag = 0;
      this.FObject = null;
      this.FOnGetFileAsBase64 = null;
      this.FOnGetFileAsArrayBuffer = null;
      this.FOnGetFileAsText = null;
      this.FOnGetFileAsURL = null;
      this.FOnGetFileAsStream = null;
      this.FGetAsString = null;
      this.FGetAsStream = null;
      this.FGetAsArrayBuffer = null;
    };
    this.$final = function () {
      this.FReq = undefined;
      this.FFileObject = undefined;
      this.FObject = undefined;
      this.FOnGetFileAsBase64 = undefined;
      this.FOnGetFileAsArrayBuffer = undefined;
      this.FOnGetFileAsText = undefined;
      this.FOnGetFileAsURL = undefined;
      this.FOnGetFileAsStream = undefined;
      this.FGetAsString = undefined;
      this.FGetAsStream = undefined;
      this.FGetAsArrayBuffer = undefined;
      pas.Classes.TCollectionItem.$final.call(this);
    };
    this.HandleFileLoadAsText = function (Event) {
      var Result = false;
      var s = "";
      var ctrl = null;
      Result = true;
      s = Event.target.result;
      if (this.FGetAsString != null) this.FGetAsString(s);
      this.FGetAsString = null;
      if (this.FOnGetFileAsText != null) this.FOnGetFileAsText(this,s);
      ctrl = this.GetControl();
      if (ctrl != null) {
        if ($mod.TFilePicker.isPrototypeOf(ctrl) && (rtl.as(ctrl,$mod.TFilePicker).FOnFileAsText != null)) rtl.as(ctrl,$mod.TFilePicker).FOnFileAsText(ctrl,this.GetIndex(),s);
        if ($mod.TFileUpload.isPrototypeOf(ctrl) && (rtl.as(ctrl,$mod.TFileUpload).FOnFileAsText != null)) rtl.as(ctrl,$mod.TFileUpload).FOnFileAsText(ctrl,this.GetIndex(),s);
        if ($mod.TOpenDialog.isPrototypeOf(ctrl) && (rtl.as(ctrl,$mod.TOpenDialog).FOnFileAsText != null)) rtl.as(ctrl,$mod.TOpenDialog).FOnFileAsText(ctrl,this.GetIndex(),s);
      };
      return Result;
    };
    this.HandleFileLoadAsBase64 = function (Event) {
      var Result = false;
      var s = "";
      var ctrl = null;
      Result = true;
      function _arrayBufferToBase64( buffer ) {
      var binary = '';
      var bytes = new Uint8Array( buffer );
      var len = bytes.byteLength;
      for (var i = 0; i < len; i++) {
          binary += String.fromCharCode( bytes[ i ] );
      }
      return window.btoa( binary );
      }
      s = _arrayBufferToBase64(Event.target.result);
      if (this.FGetAsString != null) this.FGetAsString(s);
      this.FGetAsString = null;
      if (this.FOnGetFileAsBase64 != null) this.FOnGetFileAsBase64(this,s);
      ctrl = this.GetControl();
      if (ctrl != null) {
        if ($mod.TFilePicker.isPrototypeOf(ctrl) && (rtl.as(ctrl,$mod.TFilePicker).FOnFileAsBase64 != null)) rtl.as(ctrl,$mod.TFilePicker).FOnFileAsBase64(ctrl,this.GetIndex(),s);
        if ($mod.TFileUpload.isPrototypeOf(ctrl) && (rtl.as(ctrl,$mod.TFileUpload).FOnFileAsBase64 != null)) rtl.as(ctrl,$mod.TFileUpload).FOnFileAsBase64(ctrl,this.GetIndex(),s);
        if ($mod.TOpenDialog.isPrototypeOf(ctrl) && (rtl.as(ctrl,$mod.TOpenDialog).FOnFileAsBase64 != null)) rtl.as(ctrl,$mod.TOpenDialog).FOnFileAsBase64(ctrl,this.GetIndex(),s);
      };
      return Result;
    };
    this.HandleFileLoadAsArrayBuffer = function (Event) {
      var Result = false;
      var ja = null;
      var LJARec = pas["WEBLib.Controls"].TJSArrayBufferRecord.$new();
      var ctrl = null;
      Result = true;
      ja = Event.target.result;
      if (this.FGetAsArrayBuffer != null) {
        this.FGetAsArrayBuffer(ja);
      };
      this.FGetAsArrayBuffer = null;
      if (this.FOnGetFileAsArrayBuffer != null) {
        LJARec.jsarraybuffer = ja;
        this.FOnGetFileAsArrayBuffer(this,pas["WEBLib.Controls"].TJSArrayBufferRecord.$clone(LJARec));
      };
      ctrl = this.GetControl();
      if (ctrl != null) {
        LJARec.jsarraybuffer = ja;
        if ($mod.TFilePicker.isPrototypeOf(ctrl) && (rtl.as(ctrl,$mod.TFilePicker).FOnGetFileAsArrayBuffer != null)) rtl.as(ctrl,$mod.TFilePicker).FOnGetFileAsArrayBuffer(ctrl,this.GetIndex(),pas["WEBLib.Controls"].TJSArrayBufferRecord.$clone(LJARec));
        if ($mod.TFileUpload.isPrototypeOf(ctrl) && (rtl.as(ctrl,$mod.TFileUpload).FOnGetFileAsArrayBuffer != null)) rtl.as(ctrl,$mod.TFileUpload).FOnGetFileAsArrayBuffer(ctrl,this.GetIndex(),pas["WEBLib.Controls"].TJSArrayBufferRecord.$clone(LJARec));
        if ($mod.TOpenDialog.isPrototypeOf(ctrl) && (rtl.as(ctrl,$mod.TOpenDialog).FOnGetFileAsArrayBuffer != null)) rtl.as(ctrl,$mod.TOpenDialog).FOnGetFileAsArrayBuffer(ctrl,this.GetIndex(),pas["WEBLib.Controls"].TJSArrayBufferRecord.$clone(LJARec));
      };
      return Result;
    };
    this.HandleFileLoadAsDataURL = function (Event) {
      var Result = false;
      var s = "";
      var ctrl = null;
      Result = true;
      s = Event.target.result;
      if (this.FGetAsString != null) this.FGetAsString(s);
      this.FGetAsString = null;
      if (this.FOnGetFileAsURL != null) this.FOnGetFileAsURL(this,s);
      ctrl = this.GetControl();
      if (ctrl != null) {
        if ($mod.TFilePicker.isPrototypeOf(ctrl) && (rtl.as(ctrl,$mod.TFilePicker).FOnFileAsDataURL != null)) rtl.as(ctrl,$mod.TFilePicker).FOnFileAsDataURL(ctrl,this.GetIndex(),s);
        if ($mod.TFileUpload.isPrototypeOf(ctrl) && (rtl.as(ctrl,$mod.TFileUpload).FOnFileAsDataURL != null)) rtl.as(ctrl,$mod.TFileUpload).FOnFileAsDataURL(ctrl,this.GetIndex(),s);
        if ($mod.TWebOpenDialog.isPrototypeOf(ctrl) && (rtl.as(ctrl,$mod.TWebOpenDialog).FOnFileAsDataURL != null)) rtl.as(ctrl,$mod.TWebOpenDialog).FOnFileAsDataURL(ctrl,this.GetIndex(),s);
      };
      return Result;
    };
    this.HandleFileLoadAsStream = function (Event) {
      var Result = false;
      var ctrl = null;
      var b = [];
      var l = 0;
      var ms = null;
      var ja = null;
      Result = true;
      ja = Event.target.result;
      b = pas.Classes.TMemoryStream.MemoryToBytes(ja);
      l = ja.byteLength;
      ms = pas.Classes.TMemoryStream.$create("Create");
      ms.Write$1(b,0,l);
      ms.SetPosition(0);
      if (this.FGetAsStream != null) {
        this.FGetAsStream(ms);
      };
      this.FGetAsStream = null;
      if (this.FOnGetFileAsStream != null) {
        this.FOnGetFileAsStream(this,ms);
      };
      ctrl = this.GetControl();
      if (ctrl != null) {
        if ($mod.TFilePicker.isPrototypeOf(ctrl) && (rtl.as(ctrl,$mod.TFilePicker).FOnGetFileAsStream != null)) rtl.as(ctrl,$mod.TFilePicker).FOnGetFileAsStream(ctrl,this.GetIndex(),ms);
        if ($mod.TFileUpload.isPrototypeOf(ctrl) && (rtl.as(ctrl,$mod.TFileUpload).FOnGetFileAsStream != null)) rtl.as(ctrl,$mod.TFileUpload).FOnGetFileAsStream(ctrl,this.GetIndex(),ms);
        if ($mod.TOpenDialog.isPrototypeOf(ctrl) && (rtl.as(ctrl,$mod.TOpenDialog).FOnGetFileAsStream != null)) rtl.as(ctrl,$mod.TOpenDialog).FOnGetFileAsStream(ctrl,this.GetIndex(),ms);
      };
      ms = rtl.freeLoc(ms);
      return Result;
    };
    this.HandleFileUploadProgress = function (Event) {
      var Result = false;
      var Lloaded = 0;
      var Ltotal = 0;
      var ctrl = null;
      Lloaded = 0;
      Ltotal = 0;
      if (Event.lengthComputable) {
         Lloaded = Event.loaded;
         Ltotal = Event.total;
         //console.log(Event.loaded + " bytes of " + Event.total); } else { console.log('no calc');
      };
      ctrl = this.GetControl();
      if (ctrl != null) {
        if ($mod.TFilePicker.isPrototypeOf(ctrl) && (rtl.as(this.GetControl(),$mod.TFilePicker).FOnUploadFileProgress != null)) rtl.as(ctrl,$mod.TFilePicker).FOnUploadFileProgress(ctrl,this.GetIndex(),Lloaded,Ltotal);
        if ($mod.TFileUpload.isPrototypeOf(ctrl) && (rtl.as(this.GetControl(),$mod.TFileUpload).FOnUploadFileProgress != null)) rtl.as(ctrl,$mod.TFileUpload).FOnUploadFileProgress(ctrl,this.GetIndex(),Lloaded,Ltotal);
      };
      Result = true;
      return Result;
    };
    this.HandleFileUploadComplete = function (Event) {
      var Result = false;
      var ctrl = null;
      var LRequestRec = pas["WEBLib.Controls"].TJSXMLHttpRequestRecord.$new();
      var AResponse = "";
      Result = true;
      ctrl = this.GetControl();
      if (ctrl != null) {
        if ($mod.TFilePicker.isPrototypeOf(ctrl) && (rtl.as(ctrl,$mod.TFilePicker).FOnUploadFileComplete != null)) rtl.as(ctrl,$mod.TFilePicker).FOnUploadFileComplete(ctrl,this.GetIndex());
        if ($mod.TFilePicker.isPrototypeOf(ctrl) && (rtl.as(ctrl,$mod.TFilePicker).FOnUploadFileResponseComplete != null)) {
          LRequestRec.req = Event.target;
          AResponse = Event.target.responseText;
          rtl.as(ctrl,$mod.TFilePicker).FOnUploadFileResponseComplete(ctrl,this.GetIndex(),pas["WEBLib.Controls"].TJSXMLHttpRequestRecord.$clone(LRequestRec),AResponse);
        };
        if ($mod.TFileUpload.isPrototypeOf(ctrl) && (rtl.as(ctrl,$mod.TFileUpload).FOnUploadFileComplete != null)) rtl.as(ctrl,$mod.TFileUpload).FOnUploadFileComplete(ctrl,this.GetIndex());
        if ($mod.TFileUpload.isPrototypeOf(ctrl) && (rtl.as(ctrl,$mod.TFileUpload).FOnUploadFileResponseComplete != null)) {
          LRequestRec.req = Event.target;
          AResponse = Event.target.responseText;
          rtl.as(ctrl,$mod.TFileUpload).FOnUploadFileResponseComplete(ctrl,this.GetIndex(),pas["WEBLib.Controls"].TJSXMLHttpRequestRecord.$clone(LRequestRec),AResponse);
        };
      };
      this.FReq = null;
      return Result;
    };
    this.HandleFileUploadError = function (Event) {
      var Result = false;
      var err = "";
      var ctrl = null;
      err = Event.target.status;
      Result = true;
      ctrl = this.GetControl();
      if (ctrl != null) {
        if ($mod.TFilePicker.isPrototypeOf(ctrl) && (rtl.as(ctrl,$mod.TFilePicker).FOnUploadFileError != null)) rtl.as(ctrl,$mod.TFilePicker).FOnUploadFileError(ctrl,this.GetIndex(),err);
        if ($mod.TFileUpload.isPrototypeOf(ctrl) && (rtl.as(ctrl,$mod.TFileUpload).FOnUploadFileError != null)) rtl.as(ctrl,$mod.TFileUpload).FOnUploadFileError(ctrl,this.GetIndex(),err);
      };
      return Result;
    };
    this.HandleFileUploadAbort = function (Event) {
      var Result = false;
      var ctrl = null;
      Result = true;
      ctrl = this.GetControl();
      if (ctrl != null) {
        if ($mod.TFilePicker.isPrototypeOf(ctrl) && (rtl.as(ctrl,$mod.TFilePicker).FOnUploadFileAbort != null)) rtl.as(ctrl,$mod.TFilePicker).FOnUploadFileAbort(ctrl,this.GetIndex());
        if ($mod.TFileUpload.isPrototypeOf(ctrl) && (rtl.as(ctrl,$mod.TFileUpload).FOnUploadFileAbort != null)) rtl.as(ctrl,$mod.TFileUpload).FOnUploadFileAbort(ctrl,this.GetIndex());
      };
      return Result;
    };
    this.GetControl = function () {
      var Result = null;
      Result = null;
      if ((this.FCollection != null) && (rtl.as(this.FCollection,$mod.TFiles).Owner$1() != null)) {
        if (pas.Classes.TComponent.isPrototypeOf(rtl.as(this.FCollection,$mod.TFiles).Owner$1())) Result = rtl.as(rtl.as(this.FCollection,$mod.TFiles).Owner$1(),pas.Classes.TComponent);
      };
      return Result;
    };
    this.FileAsText = function () {
      var Result = null;
      Result = this.FileAsText$1("utf-8");
      return Result;
    };
    this.FileAsText$1 = function (AEncoding) {
      var $Self = this;
      var Result = null;
      var reader = null;
      Result = new Promise(function (ASuccess, AFailed) {
        function Loader(Event) {
          var Result = false;
          ASuccess($impl.EventResult(Event));
          return Result;
        };
        reader = new FileReader();
        reader.onload = rtl.createSafeCallback(null,Loader);
        reader.readAsText($Self.FFileObject,AEncoding);
      });
      return Result;
    };
    this.FileAsBase64 = function () {
      var $Self = this;
      var Result = null;
      var reader = null;
      Result = new Promise(function (ASuccess, AFailed) {
        function Loader(Event) {
          var Result = false;
          var s = "";
          function _arrayBufferToBase64( buffer ) {
          var binary = '';
          var bytes = new Uint8Array( buffer );
          var len = bytes.byteLength;
          for (var i = 0; i < len; i++) {
              binary += String.fromCharCode( bytes[ i ] );
          }
          return window.btoa( binary );
          }
          s = _arrayBufferToBase64(Event.target.result);
          ASuccess(s);
          return Result;
        };
        reader = new FileReader();
        reader.onload = rtl.createSafeCallback(null,Loader);
        reader.readAsArrayBuffer($Self.FFileObject);
      });
      return Result;
    };
    this.FileAsStream = function () {
      var $Self = this;
      var Result = null;
      var reader = null;
      Result = new Promise(function (ASuccess, AFailed) {
        function Loader(Event) {
          var Result = false;
          var ms = null;
          var ja = null;
          var b = [];
          var l = 0;
          ja = Event.target.result;
          b = pas.Classes.TMemoryStream.MemoryToBytes(ja);
          l = ja.byteLength;
          ms = pas.Classes.TMemoryStream.$create("Create");
          ms.Write$1(b,0,l);
          ms.SetPosition(0);
          ASuccess(ms);
          return Result;
        };
        reader = new FileReader();
        reader.onload = rtl.createSafeCallback(null,Loader);
        reader.readAsArrayBuffer($Self.FFileObject);
      });
      return Result;
    };
    this.FileAsDataURL = function () {
      var $Self = this;
      var Result = null;
      var reader = null;
      Result = new Promise(function (ASuccess, AFailed) {
        function Loader(Event) {
          var Result = false;
          var s = "";
          s = Event.target.result;
          ASuccess(s);
          return Result;
        };
        reader = new FileReader();
        reader.onload = rtl.createSafeCallback(null,Loader);
        reader.readAsDataURL($Self.FFileObject);
      });
      return Result;
    };
    this.FileAsArrayBuffer = function () {
      var $Self = this;
      var Result = null;
      var reader = null;
      Result = new Promise(function (ASuccess, AFailed) {
        function Loader(Event) {
          var Result = false;
          var arr = null;
          arr = Event.target.result;
          ASuccess(arr);
          return Result;
        };
        reader = new FileReader();
        reader.onload = rtl.createSafeCallback(null,Loader);
        reader.readAsArrayBuffer($Self.FFileObject);
      });
      return Result;
    };
    this.GetFileAsText = function () {
      var ptr = null;
      var f = null;
      ptr = rtl.createCallback(this,"HandleFileLoadAsText");
      f = this.FFileObject;
      var reader = new FileReader();
      reader.addEventListener('load',ptr);
      reader.readAsText(f);
    };
    this.GetFileAsText$1 = function (GetAsString) {
      this.FGetAsString = GetAsString;
      this.GetFileAsText();
    };
    this.GetFileAsText$2 = function (AEncoding) {
      var ptr = null;
      var f = null;
      ptr = rtl.createCallback(this,"HandleFileLoadAsText");
      f = this.FFileObject;
      var reader = new FileReader();
      reader.addEventListener('load',ptr);
      reader.readAsText(f, AEncoding);
    };
    this.GetFileAsBase64 = function () {
      var ptr = null;
      var f = null;
      ptr = rtl.createCallback(this,"HandleFileLoadAsBase64");
      f = this.FFileObject;
      var reader = new FileReader();
      reader.addEventListener('load',ptr);
      reader.readAsArrayBuffer(f);
    };
    this.GetFileAsBase64$1 = function (GetAsString) {
      this.FGetAsString = GetAsString;
      this.GetFileAsBase64();
    };
    this.GetFileAsArrayBuffer = function () {
      var ptr = null;
      var f = null;
      ptr = rtl.createCallback(this,"HandleFileLoadAsArrayBuffer");
      f = this.FFileObject;
      var reader = new FileReader();
      reader.addEventListener('load',ptr);
      reader.readAsArrayBuffer(f);
    };
    this.GetFileAsArrayBuffer$1 = function (GetAsArrayBuffer) {
      this.FGetAsArrayBuffer = GetAsArrayBuffer;
      this.GetFileAsArrayBuffer();
    };
    this.GetFileAsStream = function () {
      var ptr = null;
      var f = null;
      ptr = rtl.createCallback(this,"HandleFileLoadAsStream");
      f = this.FFileObject;
      var reader = new FileReader();
      reader.addEventListener('load',ptr);
      reader.readAsArrayBuffer(f);
    };
    this.GetFileAsStream$1 = function (GetAsStream) {
      this.FGetAsStream = GetAsStream;
      this.GetFileAsStream();
    };
    this.GetFileAsDataURL = function () {
      var ptr = null;
      var f = null;
      ptr = rtl.createCallback(this,"HandleFileLoadAsDataURL");
      f = this.FFileObject;
      var reader = new FileReader();
      reader.addEventListener('load',ptr);
      reader.readAsDataURL(f);
    };
    this.GetFileAsDataURL$1 = function (GetAsString) {
      this.FGetAsString = GetAsString;
      this.GetFileAsDataURL();
    };
    this.Upload = function (AAction) {
      var f = null;
      var fd = null;
      var ptrProgress = null;
      var ptrComplete = null;
      var ptrError = null;
      var ptrAbort = null;
      f = this.FFileObject;
      fd = new FormData();
      fd.append("file1",f);
      this.FReq = new XMLHttpRequest();
      ptrProgress = rtl.createCallback(this,"HandleFileUploadProgress");
      ptrComplete = rtl.createCallback(this,"HandleFileUploadComplete");
      ptrError = rtl.createCallback(this,"HandleFileUploadError");
      ptrAbort = rtl.createCallback(this,"HandleFileUploadAbort");
      this.FReq.addEventListener("load",ptrComplete);
      this.FReq.addEventListener("error",ptrError);
      this.FReq.addEventListener("abort",ptrAbort);
      this.FReq.upload.addEventListener("progress",ptrProgress);
      this.FReq.open("POST",AAction,true);
      this.FReq.send(fd);
    };
    this.AbortUpload = function () {
      var Result = false;
      Result = false;
      if (this.FReq != null) {
        this.FReq.abort();
        Result = true;
      };
      return Result;
    };
  });
  this.$rtti.$Class("TFilePicker");
  rtl.createClass(this,"TFiles",pas.Classes.TCollection,function () {
    this.$init = function () {
      pas.Classes.TCollection.$init.call(this);
      this.FOwner = null;
    };
    this.$final = function () {
      this.FOwner = undefined;
      pas.Classes.TCollection.$final.call(this);
    };
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      this.SetItem(Index,Value);
    };
    this.Create$2 = function (AOwner) {
      pas.Classes.TCollection.Create$1.call(this,$mod.TFile);
      this.FOwner = AOwner;
      return this;
    };
    this.Owner$1 = function () {
      var Result = null;
      Result = this.FOwner;
      return Result;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      return Result;
    };
    this.Clear$1 = function () {
      var fc = 0;
      fc = this.GetCount();
      pas.Classes.TCollection.Clear.call(this);
      if (fc > 0) {
        if ($mod.TFilePicker.isPrototypeOf(this.FOwner)) rtl.as(this.FOwner,$mod.TFilePicker).Clear();
        if ($mod.TFileUpload.isPrototypeOf(this.FOwner)) rtl.as(this.FOwner,$mod.TFileUpload).Clear();
      };
    };
  });
  rtl.createClass(this,"TFileUpload",pas["WEBLib.Controls"].TCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Controls"].TCustomControl.$init.call(this);
      this.FAccept = "";
      this.FCreateRef = "";
      this.FEventInit = false;
      this.FFiles = null;
      this.FFileList = null;
      this.FOnDroppedFiles = null;
      this.FMultiFile = false;
      this.FShowFiles = false;
      this.FDragCaption = "";
      this.FOnGetFileAsArrayBuffer = null;
      this.FOnFileAsText = null;
      this.FOnFileAsBase64 = null;
      this.FOnFileAsDataURL = null;
      this.FOnUploadFileAbort = null;
      this.FOnUploadFileComplete = null;
      this.FOnUploadFileProgress = null;
      this.FOnUploadFileError = null;
      this.FOnUploadFileResponseComplete = null;
      this.FOnGetFileAsStream = null;
      this.FFontHoverColor = 0;
      this.FShowPicture = false;
      this.FDragColor = 0;
    };
    this.$final = function () {
      this.FFiles = undefined;
      this.FFileList = undefined;
      this.FOnDroppedFiles = undefined;
      this.FOnGetFileAsArrayBuffer = undefined;
      this.FOnFileAsText = undefined;
      this.FOnFileAsBase64 = undefined;
      this.FOnFileAsDataURL = undefined;
      this.FOnUploadFileAbort = undefined;
      this.FOnUploadFileComplete = undefined;
      this.FOnUploadFileProgress = undefined;
      this.FOnUploadFileError = undefined;
      this.FOnUploadFileResponseComplete = undefined;
      this.FOnGetFileAsStream = undefined;
      pas["WEBLib.Controls"].TCustomControl.$final.call(this);
    };
    this.SetDragCaption = function (Value) {
      this.FDragCaption = Value;
      this.UpdateElement();
    };
    this.SetAccept = function (Value) {
      if (this.FAccept !== Value) {
        this.FAccept = Value;
        this.UpdateElement();
      };
    };
    this.SetShowPicture = function (Value) {
      if (this.FShowPicture !== Value) {
        this.FShowPicture = Value;
        this.UpdateElement();
      };
    };
    this.SetCaption = function (AValue) {
      if (this.FCaption !== AValue) {
        pas["WEBLib.Controls"].TCustomControl.SetCaption.call(this,AValue);
        this.UpdateElement();
      };
    };
    this.HandleFiles = function (files) {
      var Result = "";
      var i = 0;
      var sz = 0;
      var afile = null;
      var szFiles = "";
      var m = "";
      var d = null;
      szFiles = "";
      while (this.FFiles.GetCount() > 0) this.FFiles.Delete(0);
      while (this.FFileList.GetCount() > 0) this.FFileList.Delete(0);
      for (var $l = 0, $end = files.length - 1; $l <= $end; $l++) {
        i = $l;
        afile = files.item(i);
        d = new Date(afile.lastModified);
        m = afile.type;
        sz = afile.size;
        var $with = this.FFiles.Add$1();
        $with.FFileObject = afile;
        $with.FName = afile.name;
        $with.FMimeType = m;
        $with.FSize = sz;
        $with.FModified = pas.SysUtils.EncodeDate(d.getYear() + 1900,d.getMonth() + 1,d.getDate()) + pas.SysUtils.EncodeTime(d.getHours(),d.getMinutes(),d.getSeconds(),d.getMilliseconds());
        if (this.FFileList != null) this.FFileList.Add(afile.name);
        if (this.FShowFiles) {
          if (i > 0) szFiles = szFiles + "<br>";
          szFiles = szFiles + afile.name;
        };
        if (!this.FMultiFile) break;
      };
      Result = szFiles;
      if (this.FOnDroppedFiles != null) this.FOnDroppedFiles(this,this.FFileList);
      return Result;
    };
    this.DoHandleChange = function (e) {
      var Result = false;
      var el = null;
      var span = null;
      var curfiles = null;
      var szfiles = "";
      Result = true;
      if (this.GetElementHandle() != null) {
        el = e.target;
        if (el != null) {
          curfiles = el.files;
          szfiles = this.HandleFiles(curfiles);
          if (this.FShowFiles) {
            span = document.getElementById(this.GetID() + "fileslist");
            span.innerHTML = szfiles;
          };
        };
      };
      return Result;
    };
    this.HandleDroppedFiles = function (Event) {
      var Result = false;
      var droppedfiles = null;
      var span = null;
      var szFiles = "";
      var AEvent = null;
      Result = true;
      AEvent = Event;
      AEvent.preventDefault();
      AEvent.stopPropagation();
      droppedfiles = AEvent.dataTransfer.files;
      szFiles = this.HandleFiles(droppedfiles);
      if (this.FShowFiles) {
        span = document.getElementById(this.GetID() + "fileslist");
        span.innerHTML = szFiles;
      };
      this.GetContainer().setAttribute("class","box has-advanced-upload");
      return Result;
    };
    this.HandleDragOver = function (Event) {
      var Result = false;
      Result = true;
      Event.preventDefault();
      Event.stopPropagation();
      if (this.GetContainer() != null) this.GetContainer().setAttribute("class","box has-advanced-upload is-dragover");
      if ((this.GetElementHandle() != null) && (this.FDragColor !== -1)) this.GetElementHandle().style.setProperty("background-color",pas["WEBLib.Graphics"].ColorToHTML(this.FDragColor));
      return Result;
    };
    this.HandleDragEnd = function (Event) {
      var Result = false;
      Result = true;
      Event.preventDefault();
      Event.stopPropagation();
      if (this.GetContainer() != null) this.GetContainer().setAttribute("class","box has-advanced-upload");
      if (this.GetElementHandle() != null) {
        if ((this.FColor !== -1) && (this.FDragColor !== -1)) {
          this.GetElementHandle().style.setProperty("background-color",pas["WEBLib.Graphics"].ColorToHTML(this.FColor))}
         else this.GetElementHandle().style.removeProperty("background-color");
      };
      return Result;
    };
    this.CreateElement = function () {
      var Result = null;
      this.CreateCSS();
      this.FCreateRef = this.FName;
      Result = document.createElement("FORM");
      Result.setAttribute("method","post");
      Result.setAttribute("class","box");
      Result.setAttribute("enctype","multipart/form-data");
      Result.style.setProperty("display","flex");
      Result.style.setProperty("justify-content","center");
      Result.style.setProperty("align-items","center");
      Result.innerHTML = '<div class="box__input" style="text-align: center">' + '<svg class="box__icon" xmlns="http://www.w3.org/2000/svg" width="50" height="43" viewBox="0 0 50 43">' + '<path d="M48.4 26.5c-.9 0-1.7.7-1.7 1.7v11.6h-43.3v-11.6c0-.9-.7-1.7-1.7-1.7s-1.7.7-1.7 1.7v13.2c0 .9.7 1.7 1.7 1.7h46.7c.9 0 1.7-.7 1.7-1.7v-13.2c0-1-.7-1.7-1.7-1.7zm-24.5 6.1c.3.3.8.5 1.2.5.4 0 .9-.2 1.2-.5l10-11.6c.7-.7.7-1.7 0-2.4s-1.7-.7-2.4 0l-7.1 8.3v-25.3c0-.9-.7-1.7-1.7-1.7s-1.7.7-1.7 1.7v25.3l-7.1-8.3c-.7-.7-1.7-.7-2.4 0s-.7 1.7 0 2.4l10 11.6z"/></svg>' + '<input class="box__file" type="file" name="files[]" id="FP' + this.FName + '" data-multiple-caption="{count} files selected" multiple/>' + '<label for="FP' + this.FName + '" style="outline:none"><strong id="' + this.FName + 'lbl">' + this.FCaption + '</strong>&nbsp;<span class="box__dragndrop" id="' + this.FName + 'drag">' + this.FDragCaption + "</span>.</label>" + '<button class="box__button" type="submit">Upload</button>' + '<br><span style="display:inline-block;" id="' + this.FName + 'fileslist"></span>' + '</div><div class="box__uploading">Uploading&hellip;</div>';
      Result.addEventListener("drop",rtl.createSafeCallback(this,"HandleDroppedFiles"));
      Result.addEventListener("dragenter",rtl.createSafeCallback(this,"HandleDragOver"));
      Result.addEventListener("dragover",rtl.createSafeCallback(this,"HandleDragOver"));
      Result.addEventListener("dragend",rtl.createSafeCallback(this,"HandleDragEnd"));
      Result.addEventListener("dragleave",rtl.createSafeCallback(this,"HandleDragEnd"));
      if ($impl.isAdvancedUpload()) Result.classList.add("has-advanced-upload");
      return Result;
    };
    this.UpdateElement = function () {
      var el = null;
      pas["WEBLib.Controls"].TControl.UpdateElement.call(this);
      this.CreateCSS();
      if (this.GetElementHandle() != null) {
        this.GetElementHandle().style.setProperty("display","flex");
        el = this.GetElementHandle().children.item(0);
        el = el.children.item(0);
        if (!this.FShowPicture) {
          el.style.setProperty("display","none")}
         else el.style.removeProperty("display");
        if (this.FElementFont !== pas["WEBLib.Controls"].TElementFont.efCSS) {
          el.style.setProperty("color",pas["WEBLib.Graphics"].ColorToHTML(this.FFont.FColor))}
         else el.style.removeProperty("color");
        el = document.getElementById("FP" + this.FCreateRef);
        if (el != null) {
          if (!this.FEventInit) {
            this.FEventInit = true;
            el.addEventListener("change",rtl.createSafeCallback(this,"DoHandleChange"));
          };
          if (this.FMultiFile) {
            el.setAttribute("multiple","")}
           else el.removeAttribute("multiple");
          if (this.FAccept !== "") {
            el.setAttribute("accept",this.FAccept)}
           else el.removeAttribute("accept");
        };
        el = document.getElementById(this.FCreateRef + "lbl");
        if (el != null) {
          el.innerHTML = this.FCaption;
        };
        el = document.getElementById(this.FCreateRef + "drag");
        if (el != null) {
          el.innerHTML = this.FDragCaption;
        };
      };
    };
    this.ColorChanging = function () {
      pas["WEBLib.Controls"].TControl.ColorChanging.call(this);
      this.UpdateElement();
    };
    this.CreateCSS = function () {
      this.AddControlStyle("  \t.box" + "\t\t\t{" + " \t\t\tposition: relative;" + "\t    \tpadding: 2px 2px;" + "\t\t}" + "\t\t.box.has-advanced-upload" + "\t\t{" + "\t\t\toutline: 2px dashed #92b0b3;" + "\t\t\toutline-offset: -10px;" + "\t\t\t-webkit-transition: outline-offset .15s ease-in-out, background-color .15s linear;" + "\t\t\ttransition: outline-offset .15s ease-in-out, background-color .15s linear;" + "\t\t}" + "\t\t.box.is-dragover" + "\t\t{" + "\t\t\toutline-offset: -20px;" + "\t\t\toutline-color: #c8dadf;" + "\t\t\tbackground-color: #fff;" + "\t\t}" + "\t\t\t.box__dragndrop," + "\t\t\t.box__icon" + "\t\t\t{" + "\t\t\t\tdisplay: none;" + "\t\t\t}" + "\t\t\t.box.has-advanced-upload .box__dragndrop" + "\t\t\t{" + "\t\t\t\tdisplay: inline;" + "\t\t\t}" + "\t\t\t.box.has-advanced-upload .box__icon" + "\t\t\t{" + "\t\t\t\twidth: 100%;" + "\t\t\t\theight: 80px;" + "\t\t\t\tfill: #92b0b3;" + "\t\t\t\tdisplay: block;" + "\t\t\t\tmargin-bottom: 40px;" + "\t\t\t}" + "\t\t\t.box.is-uploading .box__input," + "\t\t\t.box.is-success .box__input," + "\t\t\t.box.is-error .box__input" + "\t\t\t{" + "\t\t\t\tvisibility: hidden;" + "\t\t\t}" + "\t\t\t.box__uploading," + "\t\t\t.box__success," + "\t\t\t.box__error" + "\t\t\t{" + "\t\t\tdisplay: none;" + "\t\t\t}" + "\t\t\t.box.is-uploading .box__uploading," + "\t\t\t.box.is-success .box__success," + "\t\t\t.box.is-error .box__error" + "\t\t\t{" + "\t\t\t\tdisplay: block;" + "\t\t\t\tposition: absolute;" + "\t\t\t\ttop: 50%;" + "       right: 0;" + "\t\t\t\tleft: 0;" + "\t   \t\t-webkit-transform: translateY( -50% );" + "\t\t\t\t\ttransform: translateY( -50% );" + "\t\t\t\t}" + "\t\t\t\t.box__uploading" + "\t\t\t\t{" + "\t\t\t\t\tfont-style: italic;" + "\t\t\t\t}" + "\t\t\t\t.box__success" + "\t\t\t\t{" + "\t\t\t\t\t-webkit-animation: appear-from-inside .25s ease-in-out;" + "\t\t\t\t\tanimation: appear-from-inside .25s ease-in-out;" + "\t\t\t\t}" + "\t\t\t\t\t@-webkit-keyframes appear-from-inside" + "\t\t\t\t\t{" + "\t\t\t\t\t\tfrom\t{ -webkit-transform: translateY( -50% ) scale( 0 ); }" + "\t\t\t\t\t\t75%\t\t{ -webkit-transform: translateY( -50% ) scale( 1.1 ); }" + "\t\t\t\t\t\tto\t\t{ -webkit-transform: translateY( -50% ) scale( 1 ); }" + "\t\t\t\t\t}" + "\t\t\t\t\t@keyframes appear-from-inside" + "\t\t\t\t\t{" + "\t\t\t\t\t\tfrom\t{ transform: translateY( -50% ) scale( 0 ); }" + "\t\t\t\t\t\t75%\t\t{ transform: translateY( -50% ) scale( 1.1 ); }" + "\t\t\t\t\t\tto\t\t{ transform: translateY( -50% ) scale( 1 ); }" + "\t\t\t\t\t}" + "\t\t\t\t.box__restart" + "\t\t\t\t{" + "\t\t\t\t\tfont-weight: 700;" + "\t\t\t\t}" + "\t\t\t\t.box__restart:focus," + "\t\t\t\t.box__restart:hover" + "\t\t\t\t{" + "\t\t\t\t\tcolor: " + pas["WEBLib.Graphics"].ColorToHTML(this.FFontHoverColor) + ";" + "\t\t\t\t}" + "\t\t\t\t.box__file" + "\t\t\t\t{" + "\t\t\t\t\twidth: 0.1px;" + "\t\t\t\t\theight: 0.1px;" + "\t\t\t\t\topacity: 0;" + "\t\t\t\t\toverflow: hidden;" + "\t\t\t\t\tposition: absolute;" + "\t\t\t\t\tz-index: -1;" + "\t\t\t\t}" + "\t\t\t\t.box__file + label" + "\t\t\t\t{" + "\t\t\t\t\ttext-overflow: ellipsis;" + "\t\t\t\t\twhite-space: nowrap;" + "\t\t\t\t\tcursor: pointer;" + "\t\t\t\t\tdisplay: inline-block;" + "\t\t\t\t\toverflow: hidden;" + "\t\t\t\t}" + "\t\t\t\t.box__file + label:hover strong," + "\t\t\t\t.box__file:focus + label strong," + "\t\t\t\t.box__file.has-focus + label strong" + "\t\t\t\t{" + "\t\t\t\t\tcolor: " + pas["WEBLib.Graphics"].ColorToHTML(this.FFontHoverColor) + ";" + "\t\t\t\t}" + "\t\t\t\t.box__file:focus + label," + "\t\t\t\t.box__file.has-focus + label" + "\t\t\t\t{" + " \t\t\t\toutline: 1px dotted #000;" + "\t\t\t\t\toutline: -webkit-focus-ring-color auto 5px;" + "\t\t\t\t}" + "\t\t\t\t.box__button" + "\t\t\t\t{" + "\t\t\t\t\tfont-weight: 700;" + "\t\t\t\t\tcolor: #e5edf1;" + "\t\t\t\t\tbackground-color: #39bfd3;" + "\t\t\t\t\tdisplay: none;" + "\t\t\t\t\tpadding: 8px 16px;" + "\t\t\t\t\tmargin: 10px auto 0;" + "\t\t\t\t}" + "\t\t\t\t\t.box__button:hover," + "\t\t\t\t\t.box__button:focus" + "\t\t\t\t\t{" + "\t\t\t\t\t\tbackground-color: #0f3c4b;" + "\t\t\t\t\t}");
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.Controls"].TControl.Create$1.apply(this,arguments);
      this.SetColor(0xDFDAC8);
      this.FFontHoverColor = 0xd3bf39;
      this.SetCaption("Choose a file");
      this.FDragCaption = "or drag it here";
      this.FDragColor = -1;
      this.FShowPicture = true;
      this.FFiles = $mod.TFiles.$create("Create$2",[this]);
      this.FFileList = pas.Classes.TStringList.$create("Create$1");
      this.FFileList.SetSkipLastLineBreak(true);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FFiles");
      rtl.free(this,"FFileList");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.FMultiFile = false;
      this.FShowFiles = false;
      this.FEventInit = false;
      this.SetWidth(170);
      this.SetHeight(190);
    };
    this.Clear = function () {
      var el = null;
      el = document.getElementById("FP" + this.GetID());
      if (el != null) {
        el.setAttribute("type","");
        el.setAttribute("type","file");
      };
      el = document.getElementById(this.GetID() + "fileslist");
      if (el != null) {
        el.innerHTML = "";
      };
      while (this.FFiles.GetCount() > 0) this.FFiles.Delete(0);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Accept",2,rtl.string,"FAccept","SetAccept");
    $r.addProperty("Caption",2,rtl.string,"FCaption","SetCaption");
    $r.addProperty("ChildOrder",2,rtl.longint,"FChildOrder","SetChildOrderEx",4,{Default: 0});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor",4,{Default: 14670536});
    $r.addProperty("DragCaption",2,rtl.string,"FDragCaption","SetDragCaption");
    $r.addProperty("DragColor",0,pas["WEBLib.Graphics"].$rtti["TColor"],"FDragColor","FDragColor",4,{Default: -1});
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("FontHoverColor",0,pas["WEBLib.Graphics"].$rtti["TColor"],"FFontHoverColor","FFontHoverColor",4,{Default: 13877049});
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Multifile",0,rtl.boolean,"FMultiFile","FMultiFile",4,{Default: false});
    $r.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",4,{Default: true});
    $r.addProperty("ShowFiles",0,rtl.boolean,"FShowFiles","FShowFiles",4,{Default: false});
    $r.addProperty("ShowPicture",2,rtl.boolean,"FShowPicture","SetShowPicture",4,{Default: true});
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnDroppedFiles",0,$mod.$rtti["TFilesDroppedEvent"],"FOnDroppedFiles","FOnDroppedFiles");
    $r.addProperty("OnGetFileAsText",0,$mod.$rtti["TFileAsTextEvent"],"FOnFileAsText","FOnFileAsText");
    $r.addProperty("OnGetFileAsArrayBuffer",0,$mod.$rtti["TFileAsArrayBufferEvent"],"FOnGetFileAsArrayBuffer","FOnGetFileAsArrayBuffer");
    $r.addProperty("OnGetFileAsStream",0,$mod.$rtti["TFileAsStreamEvent"],"FOnGetFileAsStream","FOnGetFileAsStream");
    $r.addProperty("OnGetFileAsBase64",0,$mod.$rtti["TFileAsBase64Event"],"FOnFileAsBase64","FOnFileAsBase64");
    $r.addProperty("OnGetFileAsDataURL",0,$mod.$rtti["TFileAsDataURLEvent"],"FOnFileAsDataURL","FOnFileAsDataURL");
    $r.addProperty("OnUploadFileComplete",0,$mod.$rtti["TFileUploadEvent"],"FOnUploadFileComplete","FOnUploadFileComplete");
    $r.addProperty("OnUploadFileResponseComplete",0,$mod.$rtti["TFileUploadResponseEvent"],"FOnUploadFileResponseComplete","FOnUploadFileResponseComplete");
    $r.addProperty("OnUploadFileAbort",0,$mod.$rtti["TFileUploadEvent"],"FOnUploadFileAbort","FOnUploadFileAbort");
    $r.addProperty("OnUploadFileError",0,$mod.$rtti["TFileUploadErrorEvent"],"FOnUploadFileError","FOnUploadFileError");
    $r.addProperty("OnUploadFileProgress",0,$mod.$rtti["TFileUploadProgressEvent"],"FOnUploadFileProgress","FOnUploadFileProgress");
  });
  rtl.createClass(this,"TWebFileUpload",this.TFileUpload,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TFilePicker",pas["WEBLib.Controls"].TCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Controls"].TCustomControl.$init.call(this);
      this.FOnChange = null;
      this.FMultiFile = false;
      this.FFiles = null;
      this.FOnFileAsText = null;
      this.FOnGetFileAsArrayBuffer = null;
      this.FAccept = "";
      this.FOnFileAsBase64 = null;
      this.FChangePtr = null;
      this.FOnFileAsDataURL = null;
      this.FOnUploadFileAbort = null;
      this.FOnUploadFileComplete = null;
      this.FOnUploadFileProgress = null;
      this.FOnUploadFileError = null;
      this.FOnUploadFileResponseComplete = null;
      this.FOnGetFileAsStream = null;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      this.FFiles = undefined;
      this.FOnFileAsText = undefined;
      this.FOnGetFileAsArrayBuffer = undefined;
      this.FOnFileAsBase64 = undefined;
      this.FOnFileAsDataURL = undefined;
      this.FOnUploadFileAbort = undefined;
      this.FOnUploadFileComplete = undefined;
      this.FOnUploadFileProgress = undefined;
      this.FOnUploadFileError = undefined;
      this.FOnUploadFileResponseComplete = undefined;
      this.FOnGetFileAsStream = undefined;
      pas["WEBLib.Controls"].TCustomControl.$final.call(this);
    };
    this.SetMultiFile = function (Value) {
      if (this.FMultiFile !== Value) {
        this.FMultiFile = Value;
        this.UpdateElement();
      };
    };
    this.DoHandleChange = function (e) {
      var Result = false;
      var i = 0;
      var l = 0;
      var sz = 0;
      var eh = null;
      var s = "";
      var m = "";
      var f = null;
      var d = null;
      var jsfile = null;
      Result = true;
      while (this.FFiles.GetCount() > 0) this.FFiles.Delete(0);
      eh = this.GetElementHandle();
      var curFiles = eh.files;
      l = curFiles.length;
      for (var $l = 0, $end = l - 1; $l <= $end; $l++) {
        i = $l;
        f = this.FFiles.Add$1();
        jsfile = curFiles[i];
        s = curFiles[i].name;
        m = curFiles[i].type;
        sz = curFiles[i].size;
        d = new Date(curFiles[i].lastModified);
        f.FFileObject = jsfile;
        f.FName = s;
        f.FMimeType = m;
        f.FSize = sz;
        f.FModified = pas.SysUtils.EncodeDate(d.getFullYear(),d.getMonth() + 1,d.getDate()) + pas.SysUtils.EncodeTime(d.getHours(),d.getMinutes(),d.getSeconds(),d.getMilliseconds());
      };
      if (this.FOnChange != null) this.FOnChange(this);
      return Result;
    };
    this.SetAccept = function (Value) {
      if (this.FAccept !== Value) {
        this.FAccept = Value;
        this.UpdateElement();
      };
    };
    this.UpdateElement = function () {
      pas["WEBLib.Controls"].TControl.UpdateElement.call(this);
      if (this.GetElementHandle() != null) {
        if (this.FMultiFile) {
          this.GetElementHandle().setAttribute("multiple","")}
         else this.GetElementHandle().removeAttribute("multiple");
        if (this.FAccept !== "") {
          this.GetElementHandle().setAttribute("accept",this.FAccept)}
         else this.GetElementHandle().removeAttribute("accept");
      };
    };
    this.CreateElement = function () {
      var Result = null;
      Result = document.createElement("INPUT");
      Result.setAttribute("type","file");
      return Result;
    };
    this.GetMethodPointers = function () {
      if (this.FChangePtr === null) {
        this.FChangePtr = rtl.createCallback(this,"DoHandleChange");
        pas["WEBLib.Controls"].TControl.GetMethodPointers.call(this);
      };
    };
    this.BindEvents = function () {
      var eh = null;
      pas["WEBLib.Controls"].TCustomControl.BindEvents.call(this);
      if (this.GetElementBindHandle() != null) {
        eh = this.GetElementBindHandle();
        eh.addEventListener("change",rtl.createSafeCallback(this,"DoHandleChange"));
      };
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.FFiles = $mod.TFiles.$create("Create$2",[this]);
      this.SetWidth(160);
      this.SetHeight(40);
    };
    this.Destroy = function () {
      rtl.free(this,"FFiles");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.Clear = function () {
      this.GetElementHandle().setAttribute("type","");
      this.GetElementHandle().setAttribute("type","file");
      while (this.FFiles.GetCount() > 0) this.FFiles.Delete(0);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Accept",2,rtl.string,"FAccept","SetAccept");
    $r.addProperty("ChildOrder",2,rtl.longint,"FChildOrder","SetChildOrderEx",4,{Default: 0});
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Multifile",2,rtl.boolean,"FMultiFile","SetMultiFile");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChange","FOnChange");
    $r.addProperty("OnGetFileAsText",0,$mod.$rtti["TFileAsTextEvent"],"FOnFileAsText","FOnFileAsText");
    $r.addProperty("OnGetFileAsArrayBuffer",0,$mod.$rtti["TFileAsArrayBufferEvent"],"FOnGetFileAsArrayBuffer","FOnGetFileAsArrayBuffer");
    $r.addProperty("OnGetFileAsBase64",0,$mod.$rtti["TFileAsBase64Event"],"FOnFileAsBase64","FOnFileAsBase64");
    $r.addProperty("OnGetFileAsDataURL",0,$mod.$rtti["TFileAsDataURLEvent"],"FOnFileAsDataURL","FOnFileAsDataURL");
    $r.addProperty("OnGetFileAsStream",0,$mod.$rtti["TFileAsStreamEvent"],"FOnGetFileAsStream","FOnGetFileAsStream");
    $r.addProperty("OnUploadFileComplete",0,$mod.$rtti["TFileUploadEvent"],"FOnUploadFileComplete","FOnUploadFileComplete");
    $r.addProperty("OnUploadFileResponseComplete",0,$mod.$rtti["TFileUploadResponseEvent"],"FOnUploadFileResponseComplete","FOnUploadFileResponseComplete");
    $r.addProperty("OnUploadFileAbort",0,$mod.$rtti["TFileUploadEvent"],"FOnUploadFileAbort","FOnUploadFileAbort");
    $r.addProperty("OnUploadFileError",0,$mod.$rtti["TFileUploadErrorEvent"],"FOnUploadFileError","FOnUploadFileError");
    $r.addProperty("OnUploadFileProgress",0,$mod.$rtti["TFileUploadProgressEvent"],"FOnUploadFileProgress","FOnUploadFileProgress");
  });
  rtl.createClass(this,"TWebFilePicker",this.TFilePicker,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.$rtti.$RefToProcVar("TOpenDialogProc",{procsig: rtl.newTIProcSig([["AFileName",rtl.string]])});
  this.TOpenOption = {"0": "ofReadOnly", ofReadOnly: 0, "1": "ofOverwritePrompt", ofOverwritePrompt: 1, "2": "ofHideReadOnly", ofHideReadOnly: 2, "3": "ofNoChangeDir", ofNoChangeDir: 3, "4": "ofShowHelp", ofShowHelp: 4, "5": "ofNoValidate", ofNoValidate: 5, "6": "ofAllowMultiSelect", ofAllowMultiSelect: 6, "7": "ofExtensionDifferent", ofExtensionDifferent: 7, "8": "ofPathMustExist", ofPathMustExist: 8, "9": "ofFileMustExist", ofFileMustExist: 9, "10": "ofCreatePrompt", ofCreatePrompt: 10, "11": "ofShareAware", ofShareAware: 11, "12": "ofNoReadOnlyReturn", ofNoReadOnlyReturn: 12, "13": "ofNoTestFileCreate", ofNoTestFileCreate: 13, "14": "ofNoNetworkButton", ofNoNetworkButton: 14, "15": "ofNoLongNames", ofNoLongNames: 15, "16": "ofOldStyleDialog", ofOldStyleDialog: 16, "17": "ofNoDereferenceLinks", ofNoDereferenceLinks: 17, "18": "ofEnableIncludeNotify", ofEnableIncludeNotify: 18, "19": "ofEnableSizing", ofEnableSizing: 19, "20": "ofDontAddToRecent", ofDontAddToRecent: 20, "21": "ofForceShowHidden", ofForceShowHidden: 21};
  this.$rtti.$Enum("TOpenOption",{minvalue: 0, maxvalue: 21, ordtype: 1, enumtype: this.TOpenOption});
  this.$rtti.$Set("TOpenOptions",{comptype: this.$rtti["TOpenOption"]});
  rtl.createClass(this,"TOpenDialog",pas.Classes.TComponent,function () {
    this.$init = function () {
      pas.Classes.TComponent.$init.call(this);
      this.FFiles = null;
      this.FOnChange = null;
      this.FFileName = "";
      this.FMultiFile = false;
      this.FFilter = "";
      this.FAccept = "";
      this.FOpenDialogProc = null;
      this.FOptions = {};
      this.FFilterIndex = 0;
      this.FOnFileAsBase64 = null;
      this.FOnGetFileAsArrayBuffer = null;
      this.FOnFileAsDataURL = null;
      this.FOnFileAsText = null;
      this.FOnGetFileAsStream = null;
    };
    this.$final = function () {
      this.FFiles = undefined;
      this.FOnChange = undefined;
      this.FOpenDialogProc = undefined;
      this.FOptions = undefined;
      this.FOnFileAsBase64 = undefined;
      this.FOnGetFileAsArrayBuffer = undefined;
      this.FOnFileAsDataURL = undefined;
      this.FOnFileAsText = undefined;
      this.FOnGetFileAsStream = undefined;
      pas.Classes.TComponent.$final.call(this);
    };
    this.HandleInputChange = function (Event) {
      var i = 0;
      var l = 0;
      var sz = 0;
      var s = "";
      var m = "";
      var f = null;
      var d = null;
      var jsfile = null;
      while (this.FFiles.GetCount() > 0) this.FFiles.Delete(0);
      var curFiles = Event.target.files;
      l = curFiles.length;
      for (var $l = 0, $end = l - 1; $l <= $end; $l++) {
        i = $l;
        f = this.FFiles.Add$1();
        jsfile = curFiles[i];
        s = curFiles[i].name;
        m = curFiles[i].type;
        sz = curFiles[i].size;
        d = new Date(curFiles[i].lastModified);
        if (i === 0) this.FFileName = s;
        f.FFileObject = jsfile;
        f.FName = s;
        f.FMimeType = m;
        f.FSize = sz;
        f.FModified = pas.SysUtils.EncodeDate(d.getFullYear(),d.getMonth() + 1,d.getDate()) + pas.SysUtils.EncodeTime(d.getHours(),d.getMinutes(),d.getSeconds(),d.getMilliseconds());
      };
      if (this.FOpenDialogProc != null) this.FOpenDialogProc(this.FFileName);
      this.FOpenDialogProc = null;
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Create$1 = function (AOwner) {
      pas.Classes.TComponent.Create$1.call(this,AOwner);
      this.FFiles = $mod.TFiles.$create("Create$2",[this]);
      return this;
    };
    this.Create$3 = function () {
      pas.System.TObject.Create.call(this);
      this.FFiles = $mod.TFiles.$create("Create$2",[this]);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FFiles");
      pas.Classes.TComponent.Destroy.call(this);
    };
    this.Execute = function () {
      var ic = null;
      var fp = null;
      ic = rtl.createCallback(this,"HandleInputChange");
      fp = document.createElement("input");
      fp.setAttribute("type","file");
      if (this.FMultiFile || ($mod.TOpenOption.ofAllowMultiSelect in this.FOptions)) fp.setAttribute("multiple","");
      if (this.FAccept !== "") fp.setAttribute("accept",this.FAccept);
      fp.addEventListener("change",ic);
      fp.click();
    };
    this.Execute$1 = function (AProc) {
      this.FOpenDialogProc = AProc;
      this.Execute();
    };
    this.Perform = function () {
      var $Self = this;
      var Result = null;
      Result = new Promise(function (ASuccess, AFailed) {
        $Self.Execute$1(function (AFileName) {
          ASuccess(AFileName);
        });
      });
      return Result;
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Accept",0,rtl.string,"FAccept","FAccept");
    $r.addProperty("MultiFile",0,rtl.boolean,"FMultiFile","FMultiFile",4,{Default: false});
    $r.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChange","FOnChange");
    $r.addProperty("OnGetFileAsText",0,$mod.$rtti["TFileAsTextEvent"],"FOnFileAsText","FOnFileAsText");
    $r.addProperty("OnGetFileAsArrayBuffer",0,$mod.$rtti["TFileAsArrayBufferEvent"],"FOnGetFileAsArrayBuffer","FOnGetFileAsArrayBuffer");
    $r.addProperty("OnGetFileAsStream",0,$mod.$rtti["TFileAsStreamEvent"],"FOnGetFileAsStream","FOnGetFileAsStream");
    $r.addProperty("OnGetFileAsBase64",0,$mod.$rtti["TFileAsBase64Event"],"FOnFileAsBase64","FOnFileAsBase64");
    $r.addProperty("OnGetFileAsDataURL",0,$mod.$rtti["TFileAsDataURLEvent"],"FOnFileAsDataURL","FOnFileAsDataURL");
  });
  rtl.createClass(this,"TWebOpenDialog",this.TOpenDialog,function () {
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.MessageDlg = function (Msg, DlgType, Buttons, AResultProc) {
    if (!($impl.WebLibDlg != null)) {
      $impl.WebLibDlg = $mod.TMessageDlg.$create("Create$1",[null]);
      if (pas["WEBLib.Forms"].Application.FMainForm.FCSSLibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap) {
        $impl.WebLibDlg.InitBootstrapStyle();
      };
    };
    $impl.WebLibDlg.ShowDialog$1(Msg,DlgType,rtl.refSet(Buttons),AResultProc);
  };
  this.ShowMessage = function (AMsg) {
    if ((pas["WEBLib.Forms"].Application !== null) && (pas["WEBLib.Forms"].Application.FMainForm !== null) && (pas["WEBLib.Forms"].Application.FMainForm.FCSSLibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap)) {
      $mod.MessageDlg(AMsg,$mod.TMsgDlgType.mtInformation,rtl.createSet($mod.TMsgDlgBtn.mbOK),null);
    } else {
      alert(AMsg);
    };
  };
  this.MessageDlgAsync = async function (Msg, DlgType, Buttons) {
    var Result = 0;
    if (!($impl.WebLibDlg != null)) {
      $impl.WebLibDlg = $mod.TMessageDlg.$create("Create$1",[null]);
      if (pas["WEBLib.Forms"].Application.FMainForm.FCSSLibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap) {
        $impl.WebLibDlg.InitBootstrapStyle();
      };
    };
    Result = await $impl.WebLibDlg.ShowDialog$2(Msg,DlgType,rtl.refSet(Buttons));
    return Result;
  };
  this.InputBox = function (ACaption, APrompt, ADefault) {
    var Result = "";
    var retvalue = "";
    retvalue = prompt(APrompt, ADefault);
    if (retvalue == null) {
      retvalue = "";
    };
    Result = retvalue;
    return Result;
  };
  this.InputQuery = function (ACaption, APrompt, Value) {
    var Result = false;
    var retvalue = false;
    var s = "";
    retvalue = true;
    s = Value.get();
    var text = s;
    s = prompt(APrompt, text);
    if (s == null) {
      retvalue = false;
    };
    if (retvalue) Value.set(s);
    Result = retvalue;
    return Result;
  };
  this.Confirm = function (Value) {
    var Result = false;
    var res = false;
    res = confirm(Value);
    Result = res;
    return Result;
  };
  this.InputMessageDlg = function (Msg, DlgType, Buttons, AResult, AInputType, AResultProc) {
    function ResultHandler(AModalResult) {
      if (AModalResult !== 2) AResult.set($impl.WebLibInputDlg.GetInputElementValue());
      if (AResultProc != null) AResultProc(AModalResult);
    };
    if (!($impl.WebLibInputDlg != null)) {
      $impl.WebLibInputDlg = $mod.TInputMessageDlg.$create("Create$1",[null]);
      if (pas["WEBLib.Forms"].Application.FMainForm.FCSSLibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap) {
        $impl.WebLibInputDlg.InitBootstrapStyle();
      };
    };
    $impl.WebLibInputDlg.FInputValue = AResult.get();
    $impl.WebLibInputDlg.FInputType = AInputType;
    $impl.WebLibInputDlg.ShowDialog$1(Msg,DlgType,rtl.refSet(Buttons),ResultHandler);
  };
  this.InputMessageDlgAsync = async function (Msg, DlgType, Buttons, AResult, AInputType) {
    var Result = 0;
    if (!($impl.WebLibInputDlg != null)) {
      $impl.WebLibInputDlg = $mod.TInputMessageDlg.$create("Create$1",[null]);
      if (pas["WEBLib.Forms"].Application.FMainForm.FCSSLibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap) {
        $impl.WebLibInputDlg.InitBootstrapStyle();
      };
    };
    $impl.WebLibInputDlg.FInputValue = AResult.get();
    $impl.WebLibInputDlg.FInputType = AInputType;
    Result = await $impl.WebLibInputDlg.ShowDialog$2(Msg,DlgType,rtl.refSet(Buttons));
    AResult.set($impl.WebLibInputDlg.GetInputElementValue());
    return Result;
  };
  $mod.$implcode = function () {
    $impl.lMaterial = "https://fonts.googleapis.com/icon?family=Material+Icons";
    $impl.lWaitCursor = "0954474946496D61676547494638396190012C01A20000FFFFFFDDDDDDBBBBBB999999FFFFFFFFFFFFFFFFFFFFFFFF21FF0B4E45545343415045322E30030100000021F90405050004002C0000000090012C0182FFFFFFDDDDD" + "DBBBBBB999999FFFFFFFFFFFFFFFFFFFFFFFF03FF48BADCFE30CA49ABBD38EBCDBBFF60288E64699E68AAAE6CEBBE702CCF746DDF78AEEF7CEFFFC0A070482C1A8FC8A472C96C3A9FD0A8744AAD5AAFD8AC76CBED7ABFE0B078" + "4C2E9BCFE8B47ACD6EBBDFF0B87C4EAFDBEFF8BC7ECFEFFBFF808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC" + "0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF00030A1C48B0A0C18308132A5CC8B0A1C3871023861A407180C4" + "44152B5E349431FFE346421D357E141492E24892254F062A6951E51F962EC978F400D383809B02621E09493365079C387512A9B981A806A040850A319A812906A441950261D95283530B50A34AF541B52A86AB14B26ADDDA836" + "A519F19C4E6243B15AC04B711D4B20D62B629DA0B72E7B6BD5B01EE83BC7A7F74FDCA7782DAB58105FB6DB09801E0C45CEBF62D1CF731E4B28D15642660F93266CA0F3277F6CC43F204D162492F6DDC78B4EA1D834F8376ECFA" + "B50ED31016D7B69D237604BF8779AF9EBD80A7E1D4C24BCCFC803BB44809BB2F04981E20B9F19EC48F22F7409D3AEFE676AF87D8CEA1BB79DB5DBD86EF48827C06F3F0D1A7577F41BC08A8E5E1C77F3DDFE459FFFF2624B5817" + "EFA7DD71F7D4E1058A0700702D884820B26474083081601E17E1216D7A012179E97A103141AD161771FBEB56110237A57A26C070291E2742B5A70220F2FC6B81E78378C682307E9F970E18ED865370384408220240D111669E4" + "733F90A8E493504629E594545669E5955866A9A54014FA960400608629E698648EB955973D7E59E69A6C86A9149AF321D1E69C6C0A05679A46D0A9A7993ADDE925117B060A809D7E6E9683A07BBE59287B6A225AA7548B3229A" + "7A3656E69E9A59866AAE9A69C76EAE9A7A086AAC5728A39E8E99133A06AE59FBDE198259EB0B18A657F91C1BA6A8B9FC5596588A5D22A25AF7BF9AA24B04310BBA2B145206BDD8CFF4928CB1FB34C387B19B44F503BADB0EBA1" + "402A61BAAA862DB79286605F7DDD92662BB8DB32A72A88B226E6AA8CEB5260A873F1129AAE55F3B2382EBEF77AD6EF8DFF6A682ABDFBF25BE1AC8B15CCC0BBA2FEC6B05FED36ECB09009E71B6AC402336AA2C59F32ACD9911E4" + "B3C61662473CC69C8232BCC98C99AA29CB2C6F2B27C29C62BAB5C73BD2D1BAAB3CC5AD27C73C0ECF28C70BCF3BA9C73BDF91A8DA9D22F034D30CC0D33DD74B893E13C34CE16FBBC34C75C0B1DA5C9605B7DABCD1B438D2ED5A7" + "9A7DF6C0678BFC31DB6B1F0C2FDC6E77E075DDCA898D770A77EF2D42DF7E2F4976E02F004E7890741F9E2ADA8A37EEF8E390472EF9E494576EF9E5649867AEF9E69C77EEF9E7A0872EFAE8A4976EFAE9A8A7AEFAEAACB7EEFAE" + "BB0C72EFBECB4D76EFBEDB8E7AEFBEEBCF7EEFBEFC0072FFCF0C4176FFCF1C827AFFCF2CC37EFFCF3D0472FFDF4D4576FFDF5D867AFFDF6DC77EFFDF7E0872FFEF8E497DF7D020021F90405050007002CD60060003000570082" + "FFFFFFDDDDDDBBBBBB999999FFFFFFFFFFFFFFFFFFFFFFFF03EC78BABCF3A3C9492B85D0EA7D71E6E0E67D61298DA4A9A2A95AB291BBB2B20BD7E68D8770BC73BA9F2828B4108B1D1472A85C568E4E462F9A1C5127D36B037AE" + "5AA04608191B60B879FCD9A795DC5A8D7ECB6CF04AF8F1FB2BA9DAADF3BFB7E4880707C83665186877F8960858C8E865A895A0A83940B80970C819A95679DA0A1A2A3A4A5A6A7A8A9AA2A01ADAEAFB0B1B035B2B5B6AF2EB7BA" + "B6ACBBBEB826BFC201BDC3BBB9C6B7B4C9B2ABCECFD0D1D2D3D4D53200D800A5D9DCA2DCDFDA9DE0DFE2E3E494E6E3E8E9E05AECEDEEEFDDF1F2D8F4F5EBF5E157FAFBFCF8F9D8954B178AA0B773A3E65148000021F90405050" + "007002CD60075003000570082FFFFFFDDDDDDBBBBBB999999FFFFFFFFFFFFFFFFFFFFFFFF03E978BADCFE6EC801ABBD6D4ECCFBD1A0274660388E657A8AA9BA62ADFB56B13C93B576D3B9BEE33DCA2F13940C81BD2331A844B6" + "9A8F1C14529BF24CD6AB30CBED7ABFE0B0784C2E9BCF5C817ACD6EBBDBB3B77CCE5ED1EFF3137E0F1FF1FF027A807B76837471866F688B8C8D8E8F909192930A01960166979A639A9D98609E9DA0A1A25DA4A1A6A79E5CAAABA" + "CAD9BAFB096B2B3A9B39F59B8B91000BE002FB815BFBFC1B0BDC4C5C6A7C8C9C037CC0FCECAD0A5D2D3CF3BB1C3D862D8BEDEDD61DFD95FDF63E7E3E2EAD3E1EBE6EF5EE4EECEE8F15DE9ECF5FAFB60F9FEEDE81123D3CF1EB8" + "2909000021F90405050007002CC40092004200420082FFFFFFDDDDDDBBBBBB999999FFFFFFFFFFFFFFFFFFFFFFFF03F978BADCFE508D49ABBD36EA1DB1FF15277260F98DE863AE59EA4A6CFCBEB13CBBB579CFF9B9FFC0A0704" + "82C1A8FC8A472C96C3A9FD0A8747A105805D4D7759B1D6DBFD8AE06FC1547C860B3034D5633D86D77155E96CFE957FB1D1F76F3F3767F567A8246018701377F4488888A78438D8D3B74919287406C96978999751100A1001C9C" + "98415C1AA2A2A4A54FAAAA1BA5A64CAFABB1AD4DB5A1ACB84BBAA3BC97B9BA23B2B4C422C6BEC8C9BD48BF28B29DCFCCCD9C4AD0D1CA47D9DAD7D4B52FDB45DDDEC2DCD5E692E8E1E2E342E529EF41F1F2DF44F5EA8EE4E92EE" + "7FCED764C62F74A8F837C7610CA51E886A11A870F0B1A7C006B6283040021F90405050007002CA700A4005700300082FFFFFFDDDDDDBBBBBB999999FFFFFFFFFFFFFFFFFFFFFFFF03FF78BADCFE30CA37EA9838EBCD8FFD5D28" + "8ECD675E64AA4AA7B9BEB0D7BA711DCEADAD6B78BEFF90DE0948740869C5E411942C2E2D4DE51315054E35802CE027E80A464F8C56ABF37AC1C7C9785C339B4942F53ADB76775538C99C1CB39FF148107B7413018601187E772" + "B4C11835B858786898A518F90119292138A8B458F189A87947E4997A1A2889C9D9F8319A9AAABA540A0AFA91AAC3FB5A8A2B8953BBBBC9A1BB935A71AB0C4C530C1C29BCAB3CCCD91BDD0D12BD3D4C31CCB29D9DACFDCBF2ADF" + "12C91DDD22E5E6B721E91CC71DE7E8EF58AE22F3F4D71DF7F8ED22E342F40B914F9F1B6F6B521434E889041B85FF46BCA9E26C14C5280B2FFEC8A8511307C78E353E82842172E48B6A2689844BA920010021F90405050007002" + "C9200A4005700300082FFFFFFDDDDDDBBBBBB999999FFFFFFFFFFFFFFFFFFFFFFFF03FF78BADC0E10B849ABBD38B7C8B5FFE0C78D52689E2139A26C4BA9A42BB7B03ADF606DE33CA6C7BDE0E4B7121A17C4CE71998C2C8F4DC8" + "13DA9C5289A78036201C7807996476ABED7DBF3E1D8A4CC69DCF975A8BBD75BFBD69258B5EBFDDD1714E2E7C6517028702187F785607845C8688878A8B568F90159292178B8C4B8F189A88947F4F97A1A2899C9D9F8419A9AAA" + "BA546A0AFA91AAC42B5A8A2B89541BBBC9A1EB938A71AB0C4C533C1C29BCAB3CCCD91BDD0D183AE1FC91FCB7BD9DAB720DD637C21DBDCBFDEE5E6E1E2E926C720E7E8EF20D3C8EDEED7F6EB26F3FA6FD6F46357CD443D7E6D50" + "FC03E849602185F90C026A446D18452B0B2F0AC9A8B11207C78E383E829C2172A48C82268D3CE391000021F90405050007002C8A0092004200420082FFFFFFDDDDDDBBBBBB999999FFFFFFFFFFFFFFFFFFFFFFFF03F57807DCF" + "EF0A949ABBD98C6CD5DFEE0D58D5C6882642A9DACA5BE402B4FB03ADFF578EFF9B6FFC0A070482C1A8FC8A472C96C3A9FD0A8744A3D05AE81AA0CCBD59AB8E0AC3713068F2FE5F099922EAF0F6DF73AAE3ED3CDF63BF6ADDFE7" + "FB7C8081773B028602467A85878645743F8C8C446D4191878E784096979857439B8D2003A30352A088A2A4A350A7A819AAAA4FA721B0A44EADB4B5A54DB3B9B5BCA027BABB4BBDBEB04CC6C7B14AB8C2BAC5C12CC3CDCACBB64" + "9D6D7AB48DADBC446DEA9BF47E2E3C8E1E61FD4E99B3BEC45D237F044F233F4F59140F8F9A13FFC6F26000C78606040836F10AE5178866143740431304B000021F90405050007002C8A0075003000570082FFFFFFDDDDDDBBBB" + "BB999999FFFFFFFFFFFFFFFFFFFFFFFF03E778BA0C0E2CCA496B7BCEEA4DB1E7E0E68D61298DA8A9A2A95AB2ADCBC1B1ACD1A47DE3982EF20FDF0E0811768845E304A9AC009B161C340A9B0E7BD65F26CBED7ABFE0B0784C2E9" + "BCFA1807ACD6EBBDBB6B77CCE76D1EF73157E0F37F1FF017A807B76837471866F688B8C8D8E8F909192936802960266979A639A9D98609E9D5FA19E5DA4A159A7A856AAA553ADA2AFB097A9B396ACB69FB2B35CB63203C00316" + "BC2EC1C115AD36C6C614A73ECBC7CDB13AD0D1D2B742D5C062DAC261DDDE60DDDCE3DFDAE4D563E5E2E7E6EDECE9EEF1F0D0E8F5F6CBF8CCF2F7F4F9FADBD4CDD377669F86040021F90405050007002C8A0060003000570082F" + "FFFFFDDDDDDBBBBBB999999FFFFFFFFFFFFFFFFFFFFFFFF03EB78BADCFE0B4800ABBD6D4ECCBBD29A2756E0369E4C69A2A7BAB2A24BC1AD4B8FF28DDB7A27CF3D4C2E281C122DC62389A784249B8E2734229D1EAAD39F35CA84" + "04BE811EF60006EBB0E5F4ADCB48BB61EC857BCE2A55E67454C882CF4FFB7E50806F7F83655B8687568966858C888F90835B7280949578976D849A9B5F9DA0A1A2A3A4A5A6A7A8A93A02ACADAEAFB0AF30B1B4B5AE28B6B9B52" + "7BABDB223BEC102BCC2BDB8C5B6B3C8B1AACDCECFD0D1D2D3D4CF03D703A3D8DBA0DBDED997DFDE94E2DF56E5E250E8E94DEBE64AEEE3F0F1D8EAF4D7EDF7E0F3F453F75BFD00AED3842ED43B51DCAC24000021F90405050007" + "002C8A0058004200420082FFFFFFDDDDDDBBBBBB999999FFFFFFFFFFFFFFFFFFFFFFFF03FD78BADCFE30CA062A9838EB69EDFE20D77961698EA4A96E68B5BE597BC13424D738D5E64BE007AF1BEFF75B097144A2EA584B164FB" + "B9CF31962D2A6D48FF58A2D6DB9D36A74D8057DC14EF3985CD69CD149ED9A1D76CFE9713B8AE7C0026377784A807B7C0D7E842386878822858B3D6D116F528D93818696971D13029E027083129C129F9F309A2BA6AB2F92AAAB" + "AC26AE2AB0B5B27934B5B625A235BABB9020BFC0C11BC3B0C51FC7B1C91ACBA6CDC6CF9ED119D3D4D518D7D9D6CBDCCEC3DFE0BAE2D2CCE5E3A0E8EBECEDEEEFF0F1F2F3F4F5F68603F9FAFBFCFDFCD5FE020ADCD76CA04181C" + "90E2AFC576CA1C301091F2A2C287120C08AFEA225000021F90405050007002C920058005700300082FFFFFFDDDDDDBBBBBB999999FFFFFFFFFFFFFFFFFFFFFFFF03FF78BADCFE30BE4083BC38EB3D2BE560284A9E379E285756" + "69EB76EB2BBFEB37DF676DE13CA8F723815090FAA10048406B38441947C9248AC9CCD54ED1E889DA1C3D435969902BF45E4561B188DCF59D4169F59A2DFA6EE2CA149BE88EC1E32E7B217619782F822A6F1A8687881A8412787" + "98D64897E8B80337B7C19901092388E189E0F8CA1749D8A91993CA224AA11A6ADA817A40CB2B3B411B60AA0400AAE302518B83D9BB5B00DBEBFC0BA1097B1AC1003D40381CEC2C4D20FD5D54BD847DB0DDDE47A9532E2E3E4E5" + "635C33E90CEBF2ED6DE85918F2F373653C5A19F9FA9809041850E02F82EB0C3243C84E211086DD1C1E84484D620F8A152DF2C0A8F11322C38E0F09820C996FE4C48626495A4BA921010021F90401050007002CA700580057003" + "00082FFFFFFDDDDDDBBBBBB999999FFFFFFFFFFFFFFFFFFFFFFFF03FF78BADCFE4B4801ABBD38EB36E7FE60A8759D689E22E9A16C5BA9922BCF074CD1F869E77CB8F7A28170C0FA9D02C8406B38441945C9248AC9D4C18E51A9" + "89DA343D41596D902BF45EA161E489DC057D3569F1989C3A83E34BB6CFBE892BF3746E7C70782E6C441F6F177E33878823838B8C8D7A1B8A1593949519970F7E7F34879691988539A29CA49EA6A79B179D0D993CA8AFAAB1ACB" + "3B42FB60B9F400BBA10B00AB2408EB52A92B8C6AEC22418C5BF07C10F25CA612E00DA0018D428D121DBDBDD8132CB20E2E917CD2CE71AE9F0E45538D822F0F719F3395126F7F8D2D2FCFD03D843E04082380CC643C843A13A86" + "091D8E834843E2448A332C6AC358D11422C7880A3FE6082972A4C0920517A24CB9D14402003B";
    $impl.WebLibDlg = null;
    $impl.WebLibInputDlg = null;
    $impl.EventResult = function (Event) {
      var Result = "";
      Result = Event.target.result;
      return Result;
    };
    $impl.StringToHTML = function (AValue) {
      var Result = "";
      Result = pas.SysUtils.StringReplace(AValue,"\r","<BR>",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
      Result = pas.SysUtils.StringReplace(Result,"\n","",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
      return Result;
    };
    $impl.isAdvancedUpload = function () {
      var div = document.createElement('div');
      return (('draggable' in div) || ('ondragstart' in div && 'ondrop' in div)) && 'FormData' in window && 'FileReader' in window;
    };
  };
  $mod.$init = function () {
    $impl.WebLibDlg = null;
  };
},["WEBLib.Forms","WEBLib.Consts","WEBLib.WebTools"]);
rtl.module("Math",["System"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.MinInteger = -0xfffffffffffff - 1;
  this.MaxInteger = 0xfffffffffffff;
  this.MinDouble = 5.0e-324;
  this.MaxDouble = 1.7e+308;
  this.InRange = function (AValue, AMin, AMax) {
    return (AValue >= AMin) && (AValue <= AMax);
  };
  this.InRange$1 = function (AValue, AMin, AMax) {
    return (AValue >= AMin) && (AValue <= AMax);
  };
  this.EnsureRange = function (AValue, AMin, AMax) {
    if (AValue<AMin){ return AMin;
    } else if (AValue>AMax){ return AMax;
    } else return AValue;
  };
  this.EnsureRange$1 = function (AValue, AMin, AMax) {
    if (AValue<AMin){ return AMin;
    } else if (AValue>AMax){ return AMax;
    } else return AValue;
  };
  this.$rtti.$Int("TRoundToRange",{minvalue: -37, maxvalue: 37, ordtype: 0});
  this.RoundTo = function (AValue, Digits) {
    var Result = 0.0;
    var RV = 0.0;
    RV = $mod.IntPower(10,Digits);
    Result = Math.round(AValue / RV) * RV;
    return Result;
  };
  this.SimpleRoundTo = function (AValue, Digits) {
    var Result = 0.0;
    var RV = 0.0;
    RV = $mod.IntPower(10,-Digits);
    if (AValue < 0) {
      Result = pas.System.Int((AValue * RV) - 0.5) / RV}
     else Result = pas.System.Int((AValue * RV) + 0.5) / RV;
    return Result;
  };
  this.randg = function (mean, stddev) {
    var Result = 0.0;
    var U1 = 0.0;
    var S2 = 0.0;
    do {
      U1 = (2 * Math.random()) - 1;
      S2 = pas.System.Sqr$1(U1) + pas.System.Sqr$1((2 * Math.random()) - 1);
    } while (!(S2 < 1));
    Result = (Math.sqrt((-2 * Math.log(S2)) / S2) * U1 * stddev) + mean;
    return Result;
  };
  this.RandomRange = function (aFrom, aTo) {
    var Result = 0;
    Result = pas.System.Random(Math.abs(aFrom - aTo)) + Math.min(aTo,aFrom);
    return Result;
  };
  this.RandomRange$1 = function (aFrom, aTo) {
    var Result = 0;
    var m = 0;
    if (aFrom < aTo) {
      m = aFrom}
     else m = aTo;
    Result = pas.System.Random(Math.abs(aFrom - aTo)) + m;
    return Result;
  };
  this.$rtti.$Int("TValueSign",{minvalue: -1, maxvalue: 1, ordtype: 0});
  this.NegativeValue = -1;
  this.ZeroValue = 0;
  this.PositiveValue = 1;
  this.IsZero = function (d, Epsilon) {
    var Result = false;
    if (Epsilon === 0) Epsilon = 1E-12;
    Result = Math.abs(d) <= Epsilon;
    return Result;
  };
  this.IsZero$1 = function (d) {
    var Result = false;
    Result = Math.abs(d) <= 1E-12;
    return Result;
  };
  this.IsInfinite = function (d) {
    return (d==Infinity) || (d==-Infinity);
  };
  this.SameValue = function (A, B, Epsilon) {
    var Result = false;
    if (Epsilon === 0.0) Epsilon = Math.max(Math.min(Math.abs(A),Math.abs(B)) * 1E-12,1E-12);
    if (A > B) {
      Result = (A - B) <= Epsilon}
     else Result = (B - A) <= Epsilon;
    return Result;
  };
  this.SinCos = function (A, B, C) {
    B.set(Math.sin(A));
    C.set(Math.cos(A));
  };
  this.LogN = function (Base, A) {
    var Result = 0.0;
    Result = Math.log(A) / Math.log(Base);
    return Result;
  };
  this.Ceil = function (A) {
    var Result = 0;
    Result = pas.System.Trunc(Math.ceil(A));
    return Result;
  };
  this.Floor = function (A) {
    var Result = 0;
    Result = pas.System.Trunc(Math.floor(A));
    return Result;
  };
  this.Ceil64 = function (A) {
    var Result = 0;
    Result = pas.System.Trunc(Math.ceil(A));
    return Result;
  };
  this.Floor64 = function (A) {
    var Result = 0;
    Result = pas.System.Trunc(Math.ceil(A));
    return Result;
  };
  this.ldexp = function (x, p) {
    var Result = 0.0;
    Result = x * $mod.IntPower(2.0,p);
    return Result;
  };
  this.Frexp = function (X, Mantissa, Exponent) {
    Exponent.set(0);
    if (X !== 0) if (Math.abs(X) < 0.5) {
      do {
        X = X * 2;
        Exponent.set(Exponent.get() - 1);
      } while (!(Math.abs(X) >= 0.5))}
     else while (Math.abs(X) >= 1) {
      X = X / 2;
      Exponent.set(Exponent.get() + 1);
    };
    Mantissa.set(X);
  };
  this.lnxp1 = function (x) {
    var Result = 0.0;
    var y = 0.0;
    if (x >= 4.0) {
      Result = Math.log(1.0 + x)}
     else {
      y = 1.0 + x;
      if (y === 1.0) {
        Result = x}
       else {
        Result = Math.log(y);
        if (y > 0.0) Result = Result + ((x - (y - 1.0)) / y);
      };
    };
    return Result;
  };
  this.IntPower = function (base, exponent) {
    var Result = 0.0;
    var i = 0;
    if ((base === 0.0) && (exponent === 0)) {
      Result = 1}
     else {
      i = Math.abs(exponent);
      Result = 1.0;
      while (i > 0) {
        while ((i & 1) === 0) {
          i = i >>> 1;
          base = pas.System.Sqr$1(base);
        };
        i = i - 1;
        Result = Result * base;
      };
      if (exponent < 0) Result = 1.0 / Result;
    };
    return Result;
  };
  this.DivMod = function (Dividend, Divisor, Result, Remainder) {
    if (Dividend < 0) {
      Dividend = -Dividend;
      Result.set(-rtl.trunc(Dividend / Divisor));
      Remainder.set(-(Dividend + (Result.get() * Divisor)));
    } else {
      Result.set(rtl.trunc(Dividend / Divisor));
      Remainder.set(Dividend - (Result.get() * Divisor));
    };
  };
  this.DivMod$1 = function (Dividend, Divisor, Result, Remainder) {
    if (Dividend < 0) {
      Dividend = -Dividend;
      Result.set(-rtl.trunc(Dividend / Divisor));
      Remainder.set(-(Dividend + (Result.get() * Divisor)));
    } else {
      Result.set(rtl.trunc(Dividend / Divisor));
      Remainder.set(Dividend - (Result.get() * Divisor));
    };
  };
  this.DivMod$2 = function (Dividend, Divisor, Result, Remainder) {
    Result.set(rtl.trunc(Dividend / Divisor));
    Remainder.set(Dividend - (Result.get() * Divisor));
  };
  this.DivMod$3 = function (Dividend, Divisor, Result, Remainder) {
    if (Dividend < 0) {
      Dividend = -Dividend;
      Result.set(-rtl.trunc(Dividend / Divisor));
      Remainder.set(-(Dividend + (Result.get() * Divisor)));
    } else {
      Result.set(rtl.trunc(Dividend / Divisor));
      Remainder.set(Dividend - (Result.get() * Divisor));
    };
  };
  this.DegToRad = function (deg) {
    var Result = 0.0;
    Result = deg * (Math.PI / 180.0);
    return Result;
  };
  this.RadToDeg = function (rad) {
    var Result = 0.0;
    Result = rad * (180.0 / Math.PI);
    return Result;
  };
  this.GradToRad = function (grad) {
    var Result = 0.0;
    Result = grad * (Math.PI / 200.0);
    return Result;
  };
  this.RadToGrad = function (rad) {
    var Result = 0.0;
    Result = rad * (200.0 / Math.PI);
    return Result;
  };
  this.DegToGrad = function (deg) {
    var Result = 0.0;
    Result = deg * (200.0 / 180.0);
    return Result;
  };
  this.GradToDeg = function (grad) {
    var Result = 0.0;
    Result = grad * (180.0 / 200.0);
    return Result;
  };
  this.CycleToRad = function (cycle) {
    var Result = 0.0;
    Result = 2 * Math.PI * cycle;
    return Result;
  };
  this.RadToCycle = function (rad) {
    var Result = 0.0;
    Result = rad * (1 / (2 * Math.PI));
    return Result;
  };
  this.DegNormalize = function (deg) {
    var Result = 0.0;
    Result = deg - (pas.System.Int(deg / 360) * 360);
    if (Result < 0) Result = Result + 360;
    return Result;
  };
  this.Norm = function (data) {
    var Result = 0.0;
    Result = Math.sqrt($impl.sumofsquares(data));
    return Result;
  };
  this.Mean = function (data) {
    var Result = 0.0;
    var N = 0;
    N = rtl.length(data);
    if (N === 0) {
      Result = 0}
     else Result = $mod.Sum(data) / N;
    return Result;
  };
  this.Sum = function (data) {
    var Result = 0.0;
    var i = 0;
    var N = 0;
    N = rtl.length(data);
    Result = 0.0;
    for (var $l = 0, $end = N - 1; $l <= $end; $l++) {
      i = $l;
      Result = Result + data[i];
    };
    return Result;
  };
  this.SumsAndSquares = function (data, Sum, SumOfSquares) {
    var i = 0;
    var n = 0;
    var t = 0.0;
    var s = 0.0;
    var ss = 0.0;
    n = rtl.length(data);
    ss = 0.0;
    s = 0.0;
    for (var $l = 0, $end = n - 1; $l <= $end; $l++) {
      i = $l;
      t = data[i];
      ss = ss + pas.System.Sqr$1(t);
      s = s + t;
    };
    Sum.set(s);
    SumOfSquares.set(ss);
  };
  this.StdDev = function (data) {
    var Result = 0.0;
    Result = Math.sqrt($mod.Variance(data));
    return Result;
  };
  this.MeanAndStdDev = function (data, Mean, StdDev) {
    var I = 0;
    var N = 0;
    var M = 0.0;
    var S = 0.0;
    N = rtl.length(data);
    M = 0;
    S = 0;
    for (var $l = 0, $end = N - 1; $l <= $end; $l++) {
      I = $l;
      M = M + data[I];
      S = S + pas.System.Sqr$1(data[I]);
    };
    M = M / N;
    S = S - (N * pas.System.Sqr$1(M));
    if (N > 1) {
      S = Math.sqrt(S / (N - 1))}
     else S = 0;
    Mean.set(M);
    StdDev.set(S);
  };
  this.Variance = function (data) {
    var Result = 0.0;
    var n = 0;
    n = rtl.length(data);
    if (n === 1) {
      Result = 0}
     else Result = $mod.TotalVariance(data) / (n - 1);
    return Result;
  };
  this.TotalVariance = function (data) {
    var Result = 0.0;
    var S = 0.0;
    var SS = 0.0;
    var N = 0;
    N = rtl.length(data);
    if (rtl.length(data) === 1) {
      Result = 0}
     else {
      $mod.SumsAndSquares(data,{get: function () {
          return S;
        }, set: function (v) {
          S = v;
        }},{get: function () {
          return SS;
        }, set: function (v) {
          SS = v;
        }});
      Result = SS - (pas.System.Sqr$1(S) / N);
    };
    return Result;
  };
  this.PopNStdDev = function (data) {
    var Result = 0.0;
    Result = Math.sqrt($mod.PopNVariance(data));
    return Result;
  };
  this.PopNVariance = function (data) {
    var Result = 0.0;
    var N = 0;
    N = rtl.length(data);
    if (N === 0) {
      Result = 0}
     else Result = $mod.TotalVariance(data) / N;
    return Result;
  };
  this.MomentSkewKurtosis = function (data, m1, m2, m3, m4, skew, kurtosis) {
    var i = 0;
    var N = 0;
    var deviation = 0.0;
    var deviation2 = 0.0;
    var reciprocalN = 0.0;
    var lm1 = 0.0;
    var lm2 = 0.0;
    var lm3 = 0.0;
    var lm4 = 0.0;
    var lskew = 0.0;
    var lkurtosis = 0.0;
    N = rtl.length(data);
    lm1 = 0;
    reciprocalN = 1 / N;
    for (var $l = 0, $end = N - 1; $l <= $end; $l++) {
      i = $l;
      lm1 = lm1 + data[i];
    };
    lm1 = reciprocalN * lm1;
    lm2 = 0;
    lm3 = 0;
    lm4 = 0;
    for (var $l1 = 0, $end1 = N - 1; $l1 <= $end1; $l1++) {
      i = $l1;
      deviation = data[i] - lm1;
      deviation2 = deviation * deviation;
      lm2 = lm2 + deviation2;
      lm3 = lm3 + (deviation2 * deviation);
      lm4 = lm4 + (deviation2 * deviation2);
    };
    lm2 = reciprocalN * lm2;
    lm3 = reciprocalN * lm3;
    lm4 = reciprocalN * lm4;
    lskew = lm3 / (Math.sqrt(lm2) * lm2);
    lkurtosis = lm4 / (lm2 * lm2);
    m1.set(lm1);
    m2.set(lm2);
    m3.set(lm3);
    m4.set(lm4);
    skew.set(lskew);
    kurtosis.set(lkurtosis);
  };
  this.TPaymentTime = {"0": "ptEndOfPeriod", ptEndOfPeriod: 0, "1": "ptStartOfPeriod", ptStartOfPeriod: 1};
  this.$rtti.$Enum("TPaymentTime",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TPaymentTime});
  this.FutureValue = function (ARate, NPeriods, APayment, APresentValue, APaymentTime) {
    var Result = 0.0;
    var q = 0.0;
    var qn = 0.0;
    var factor = 0.0;
    if (ARate === 0) {
      Result = -APresentValue - (APayment * NPeriods)}
     else {
      q = 1.0 + ARate;
      qn = Math.pow(q,NPeriods);
      factor = (qn - 1) / (q - 1);
      if (APaymentTime === $mod.TPaymentTime.ptStartOfPeriod) factor = factor * q;
      Result = -((APresentValue * qn) + (APayment * factor));
    };
    return Result;
  };
  var DELTA = 0.001;
  var EPS = 1E-9;
  var MAXIT = 20;
  this.InterestRate = function (NPeriods, APayment, APresentValue, AFutureValue, APaymentTime) {
    var Result = 0.0;
    var r1 = 0.0;
    var r2 = 0.0;
    var dr = 0.0;
    var fv1 = 0.0;
    var fv2 = 0.0;
    var iteration = 0;
    iteration = 0;
    r1 = 0.05;
    do {
      r2 = r1 + 1E-3;
      fv1 = $mod.FutureValue(r1,NPeriods,APayment,APresentValue,APaymentTime);
      fv2 = $mod.FutureValue(r2,NPeriods,APayment,APresentValue,APaymentTime);
      dr = ((AFutureValue - fv1) / (fv2 - fv1)) * 1E-3;
      r1 = r1 + dr;
      iteration += 1;
    } while (!((Math.abs(dr) < 1E-9) || (iteration >= 20)));
    Result = r1;
    return Result;
  };
  this.NumberOfPeriods = function (ARate, APayment, APresentValue, AFutureValue, APaymentTime) {
    var Result = 0.0;
    var q = 0.0;
    var x1 = 0.0;
    var x2 = 0.0;
    if (ARate === 0) {
      Result = -(APresentValue + AFutureValue) / APayment}
     else {
      q = 1.0 + ARate;
      if (APaymentTime === $mod.TPaymentTime.ptStartOfPeriod) APayment = APayment * q;
      x1 = APayment - (AFutureValue * ARate);
      x2 = APayment + (APresentValue * ARate);
      if ((x2 === 0) || ((Math.sign(x1) * Math.sign(x2)) < 0)) {
        Result = Infinity}
       else {
        Result = Math.log(x1 / x2) / Math.log(q);
      };
    };
    return Result;
  };
  this.Payment = function (ARate, NPeriods, APresentValue, AFutureValue, APaymentTime) {
    var Result = 0.0;
    var q = 0.0;
    var qn = 0.0;
    var factor = 0.0;
    if (ARate === 0) {
      Result = -(AFutureValue + APresentValue) / NPeriods}
     else {
      q = 1.0 + ARate;
      qn = Math.pow(q,NPeriods);
      factor = (qn - 1) / (q - 1);
      if (APaymentTime === $mod.TPaymentTime.ptStartOfPeriod) factor = factor * q;
      Result = -(AFutureValue + (APresentValue * qn)) / factor;
    };
    return Result;
  };
  this.PresentValue = function (ARate, NPeriods, APayment, AFutureValue, APaymentTime) {
    var Result = 0.0;
    var q = 0.0;
    var qn = 0.0;
    var factor = 0.0;
    if (ARate === 0.0) {
      Result = -AFutureValue - (APayment * NPeriods)}
     else {
      q = 1.0 + ARate;
      qn = Math.pow(q,NPeriods);
      factor = (qn - 1) / (q - 1);
      if (APaymentTime === $mod.TPaymentTime.ptStartOfPeriod) factor = factor * q;
      Result = -(AFutureValue + (APayment * factor)) / qn;
    };
    return Result;
  };
  this.IfThen = function (val, ifTrue, ifFalse) {
    var Result = 0;
    if (val) {
      Result = ifTrue}
     else Result = ifFalse;
    return Result;
  };
  this.IfThen$1 = function (val, ifTrue, ifFalse) {
    var Result = 0.0;
    if (val) {
      Result = ifTrue}
     else Result = ifFalse;
    return Result;
  };
  this.$rtti.$Int("TValueRelationship",{minvalue: -1, maxvalue: 1, ordtype: 0});
  this.EqualsValue = 0;
  this.LessThanValue = -1;
  this.GreaterThanValue = 1;
  this.CompareValue = function (A, B) {
    var Result = 0;
    Result = 1;
    if (A === B) {
      Result = 0}
     else if (A < B) Result = -1;
    return Result;
  };
  this.CompareValue$1 = function (A, B) {
    var Result = 0;
    Result = 1;
    if (A === B) {
      Result = 0}
     else if (A < B) Result = -1;
    return Result;
  };
  this.CompareValue$2 = function (A, B) {
    var Result = 0;
    Result = 1;
    if (A === B) {
      Result = 0}
     else if (A < B) Result = -1;
    return Result;
  };
  this.CompareValue$3 = function (A, B, delta) {
    var Result = 0;
    Result = 1;
    if (Math.abs(A - B) <= delta) {
      Result = 0}
     else if (A < B) Result = -1;
    return Result;
  };
  this.MinValue = function (Data) {
    var Result = 0.0;
    var I = 0;
    Result = Data[0];
    for (var $l = 1, $end = rtl.length(Data) - 1; $l <= $end; $l++) {
      I = $l;
      if (Result > Data[I]) Result = Data[I];
    };
    return Result;
  };
  this.MaxValue = function (Data) {
    var Result = 0.0;
    var I = 0;
    Result = Data[0];
    for (var $l = 1, $end = rtl.length(Data) - 1; $l <= $end; $l++) {
      I = $l;
      if (Result < Data[I]) Result = Data[I];
    };
    return Result;
  };
  this.MaxIntValue = function (AData) {
    var Result = 0;
    var lCount = 0;
    Result = AData[0];
    for (var $l = 1, $end = rtl.length(AData) - 1; $l <= $end; $l++) {
      lCount = $l;
      if (Result < AData[lCount]) Result = AData[lCount];
    };
    return Result;
  };
  $mod.$implcode = function () {
    $impl.DZeroResolution = 1E-12;
    $impl.sumofsquares = function (data) {
      var Result = 0.0;
      var i = 0;
      var N = 0;
      N = rtl.length(data);
      Result = 0.0;
      for (var $l = 0, $end = N - 1; $l <= $end; $l++) {
        i = $l;
        Result = Result + pas.System.Sqr$1(data[i]);
      };
      return Result;
    };
  };
},[]);
rtl.module("RTTI",["System","JS","RTLConsts","Types","SysUtils","TypInfo"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  rtl.recNewT(this,"TValue",function () {
    this.FTypeInfo = null;
    this.FData = undefined;
    this.FReferenceVariableData = false;
    this.$eq = function (b) {
      return (this.FTypeInfo === b.FTypeInfo) && (this.FData === b.FData) && (this.FReferenceVariableData === b.FReferenceVariableData);
    };
    this.$assign = function (s) {
      this.FTypeInfo = s.FTypeInfo;
      this.FData = s.FData;
      this.FReferenceVariableData = s.FReferenceVariableData;
      return this;
    };
    this.GetData = function () {
      var Result = undefined;
      if (this.FReferenceVariableData) {
        Result = this.FData.get()}
       else Result = this.FData;
      return Result;
    };
    this.GetIsEmpty = function () {
      var Result = false;
      if ((this.FTypeInfo === null) || (this.GetData() == undefined) || (this.GetData() == null)) return true;
      var $tmp = this.FTypeInfo.kind;
      if ($tmp === pas.System.TTypeKind.tkDynArray) {
        Result = this.GetArrayLength() === 0}
       else {
        Result = false;
      };
      return Result;
    };
    this.GetTypeKind = function () {
      var Result = 0;
      if (this.FTypeInfo === null) {
        Result = pas.System.TTypeKind.tkUnknown}
       else Result = this.FTypeInfo.kind;
      return Result;
    };
    this.SetData = function (Value) {
      if (this.FReferenceVariableData) {
        this.FData.set(Value)}
       else this.FData = Value;
    };
    this.Empty = function () {
      var Result = $mod.TValue.$new();
      Result.SetData(null);
      Result.FTypeInfo = null;
      return Result;
    };
    this.FromArray = function (TypeInfo, Values) {
      var Result = $mod.TValue.$new();
      var A = 0;
      var NewArray = null;
      var ElementType = null;
      if (TypeInfo.kind !== pas.System.TTypeKind.tkDynArray) throw pas.SysUtils.EInvalidCast.$create("Create$1",["Type not an array in FromArray!"]);
      ElementType = TypeInfo.eltype;
      NewArray = new Array();
      NewArray.length = rtl.length(Values);
      for (var $l = 0, $end = rtl.length(Values) - 1; $l <= $end; $l++) {
        A = $l;
        NewArray[A] = Values[A].Cast(ElementType,true).AsJSValue();
      };
      Result.SetData(NewArray);
      Result.FTypeInfo = TypeInfo;
      return Result;
    };
    this.FromJSValue = function (v) {
      var Result = $mod.TValue.$new();
      var i = 0;
      var TypeOfValue = null;
      var $tmp = typeof(v);
      if ($tmp === "number") {
        if (pas.JS.isInteger(v)) {
          i = rtl.trunc(v);
          if ((i >= -2147483648) && (i <= 2147483647)) {
            TypeOfValue = rtl.longint}
           else TypeOfValue = rtl.nativeint;
        } else TypeOfValue = rtl.double}
       else if ($tmp === "string") {
        TypeOfValue = rtl.string}
       else if ($tmp === "boolean") {
        TypeOfValue = rtl.boolean}
       else if ($tmp === "object") {
        if (v == null) {
          return $mod.TValue.Empty()}
         else if (pas.JS.isClass(v) && rtl.isExt(v,pas.System.TObject)) {
          TypeOfValue = rtl.getObject(v).$rtti}
         else if (rtl.isObject(v) && rtl.isExt(v,pas.System.TObject)) {
          TypeOfValue = rtl.getObject(v).$rtti}
         else if (pas.JS.isRecord(v)) {
          TypeOfValue = rtl.getObject(v).$rtti}
         else if (Array.isArray(v)) {
          TypeOfValue = rtl.getObject(v).$rtti}
         else throw pas.SysUtils.EInvalidCast.$create("Create$1",["Type not recognized in FromJSValue!"])}
       else {
        TypeOfValue = rtl.jsvalue;
      };
      $mod.TValue.Make(v,TypeOfValue,Result);
      return Result;
    };
    this.FromOrdinal = function (ATypeInfo, AValue) {
      var Result = $mod.TValue.$new();
      if ((ATypeInfo === null) || !(ATypeInfo.kind in rtl.createSet(pas.System.TTypeKind.tkBool,pas.System.TTypeKind.tkEnumeration,pas.System.TTypeKind.tkInteger))) throw pas.SysUtils.EInvalidCast.$create("Create$1",["Invalid type in FromOrdinal"]);
      if (ATypeInfo.kind === pas.System.TTypeKind.tkBool) {
        $mod.TValue.Make(AValue == true,ATypeInfo,Result)}
       else $mod.TValue.Make(rtl.trunc(AValue),ATypeInfo,Result);
      return Result;
    };
    this.Make = function (ABuffer, ATypeInfo, Result) {
      Result.FData = ABuffer;
      Result.FTypeInfo = ATypeInfo;
    };
    this.AsBoolean = function () {
      var Result = false;
      if (this.GetTypeKind() === pas.System.TTypeKind.tkBool) {
        Result = !(this.GetData() == false)}
       else throw pas.SysUtils.EInvalidCast.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SErrInvalidTypecast")]);
      return Result;
    };
    this.AsClass = function () {
      var Result = null;
      if (this.IsClass()) {
        Result = rtl.getObject(this.GetData())}
       else throw pas.SysUtils.EInvalidCast.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SErrInvalidTypecast")]);
      return Result;
    };
    this.AsExtended = function () {
      var Result = 0.0;
      if (rtl.isNumber(this.GetData())) {
        Result = rtl.getNumber(this.GetData())}
       else throw pas.SysUtils.EInvalidCast.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SErrInvalidTypecast")]);
      return Result;
    };
    this.AsInteger = function () {
      var Result = 0;
      if (pas.JS.isInteger(this.GetData())) {
        Result = rtl.trunc(this.GetData())}
       else throw pas.SysUtils.EInvalidCast.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SErrInvalidTypecast")]);
      return Result;
    };
    this.AsInterface = function () {
      var Result = null;
      var k = 0;
      var $ok = false;
      try {
        k = this.GetTypeKind();
        if (k === pas.System.TTypeKind.tkInterface) {
          Result = rtl.setIntfL(Result,rtl.getObject(this.GetData()))}
         else if ((k in rtl.createSet(pas.System.TTypeKind.tkClass,pas.System.TTypeKind.tkClassRef,pas.System.TTypeKind.tkUnknown)) && !rtl.isObject(this.GetData())) {
          Result = rtl.setIntfL(Result,null)}
         else throw pas.SysUtils.EInvalidCast.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SErrInvalidTypecast")]);
        $ok = true;
      } finally {
        if (!$ok) rtl._Release(Result);
      };
      return Result;
    };
    this.AsJSValue = function () {
      var Result = undefined;
      Result = this.GetData();
      return Result;
    };
    this.AsNativeInt = function () {
      var Result = 0;
      if (pas.JS.isInteger(this.GetData())) {
        Result = rtl.trunc(this.GetData())}
       else throw pas.SysUtils.EInvalidCast.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SErrInvalidTypecast")]);
      return Result;
    };
    this.AsObject = function () {
      var Result = null;
      if (this.IsObject() || (this.IsClass() && !rtl.isObject(this.GetData()))) {
        Result = rtl.getObject(this.GetData())}
       else throw pas.SysUtils.EInvalidCast.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SErrInvalidTypecast")]);
      return Result;
    };
    this.AsOrdinal = function () {
      var Result = 0;
      if (this.IsOrdinal()) {
        Result = rtl.trunc(this.GetData())}
       else throw pas.SysUtils.EInvalidCast.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SErrInvalidTypecast")]);
      return Result;
    };
    this.AsString = function () {
      var Result = "";
      if (rtl.isString(this.GetData())) {
        Result = "" + this.GetData()}
       else throw pas.SysUtils.EInvalidCast.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SErrInvalidTypecast")]);
      return Result;
    };
    this.AsUnicodeString = function () {
      var Result = "";
      Result = this.AsString();
      return Result;
    };
    this.Cast = function (ATypeInfo, EmptyAsAnyType) {
      var Result = $mod.TValue.$new();
      if (!this.TryCast(ATypeInfo,Result,EmptyAsAnyType)) throw pas.SysUtils.EInvalidCast.$create("Create$1",[""]);
      return Result;
    };
    this.IsType = function (ATypeInfo, EmptyAsAnyType) {
      var Result = false;
      var AnyValue = $mod.TValue.$new();
      Result = this.TryCast(ATypeInfo,AnyValue,EmptyAsAnyType);
      return Result;
    };
    this.GetArrayElement = function (aIndex) {
      var Result = $mod.TValue.$new();
      if (this.IsArray()) {
        var $tmp = this.GetTypeKind();
        if ($tmp === pas.System.TTypeKind.tkArray) {
          Result.FTypeInfo = this.FTypeInfo.eltype}
         else if ($tmp === pas.System.TTypeKind.tkDynArray) Result.FTypeInfo = this.FTypeInfo.eltype;
        Result.SetData(this.GetData()[aIndex]);
      } else throw pas.SysUtils.EInvalidCast.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SErrInvalidTypecast")]);
      return Result;
    };
    this.GetArrayLength = function () {
      var Result = 0;
      if (this.IsArray()) return rtl.length(this.GetData());
      throw pas.SysUtils.EInvalidCast.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SErrInvalidTypecast")]);
      return Result;
    };
    this.IsArray = function () {
      var Result = false;
      var $tmp = this.GetTypeKind();
      if ($tmp === pas.System.TTypeKind.tkDynArray) {
        return true}
       else if ($tmp === pas.System.TTypeKind.tkArray) {
        return rtl.length(this.FTypeInfo.dims) === 1}
       else {
        Result = false;
      };
      return Result;
    };
    this.IsClass = function () {
      var Result = false;
      var k = 0;
      k = this.GetTypeKind();
      Result = (k === pas.System.TTypeKind.tkClassRef) || ((k in rtl.createSet(pas.System.TTypeKind.tkClass,pas.System.TTypeKind.tkUnknown)) && !rtl.isObject(this.GetData()));
      return Result;
    };
    this.IsObject = function () {
      var Result = false;
      Result = this.GetIsEmpty() || (this.FTypeInfo.kind === pas.System.TTypeKind.tkClass);
      return Result;
    };
    this.IsObjectInstance = function () {
      var Result = false;
      Result = (this.FTypeInfo !== null) && (this.FTypeInfo.kind === pas.System.TTypeKind.tkClass);
      return Result;
    };
    this.IsOrdinal = function () {
      var Result = false;
      Result = this.GetIsEmpty() || (this.GetTypeKind() in rtl.createSet(pas.System.TTypeKind.tkBool,pas.System.TTypeKind.tkInteger,pas.System.TTypeKind.tkChar,pas.System.TTypeKind.tkEnumeration));
      return Result;
    };
    this.IsType$2 = function (ATypeInfo) {
      var Result = false;
      Result = ATypeInfo === this.FTypeInfo;
      return Result;
    };
    this.ToString = function () {
      var Result = "";
      var $tmp = this.GetTypeKind();
      if ($tmp === pas.System.TTypeKind.tkString) {
        Result = this.AsString()}
       else if ($tmp === pas.System.TTypeKind.tkInteger) {
        Result = pas.SysUtils.IntToStr(this.AsNativeInt())}
       else if ($tmp === pas.System.TTypeKind.tkBool) {
        Result = pas.SysUtils.BoolToStr(this.AsBoolean(),true)}
       else if ($tmp === pas.System.TTypeKind.tkDouble) {
        Result = pas.SysUtils.FloatToStr(this.AsExtended())}
       else {
        Result = "";
      };
      return Result;
    };
    this.TryCast = function (ATypeInfo, AResult, EmptyAsAnyType) {
      var $Self = this;
      var Result = false;
      function ConversionAccepted() {
        var Result = {};
        var $tmp = ATypeInfo.kind;
        if ($tmp === pas.System.TTypeKind.tkString) {
          return rtl.createSet(pas.System.TTypeKind.tkChar,pas.System.TTypeKind.tkString)}
         else if ($tmp === pas.System.TTypeKind.tkDouble) {
          return rtl.createSet(pas.System.TTypeKind.tkInteger,pas.System.TTypeKind.tkDouble)}
         else if ($tmp === pas.System.TTypeKind.tkEnumeration) {
          return rtl.createSet(pas.System.TTypeKind.tkInteger,pas.System.TTypeKind.tkEnumeration)}
         else {
          return rtl.createSet(ATypeInfo.kind);
        };
        return Result;
      };
      if (EmptyAsAnyType && this.GetIsEmpty()) {
        AResult.$assign(this.Empty());
        if (ATypeInfo !== null) {
          AResult.FTypeInfo = ATypeInfo;
          var $tmp = ATypeInfo.kind;
          if ($tmp === pas.System.TTypeKind.tkBool) {
            AResult.SetData(false)}
           else if ($tmp === pas.System.TTypeKind.tkChar) {
            AResult.SetData("\x00")}
           else if ($tmp === pas.System.TTypeKind.tkString) {
            AResult.SetData(pas.SysUtils.EmptyStr)}
           else if (($tmp === pas.System.TTypeKind.tkDouble) || ($tmp === pas.System.TTypeKind.tkEnumeration) || ($tmp === pas.System.TTypeKind.tkInteger)) AResult.SetData(0);
          return true;
        };
      };
      if (!EmptyAsAnyType && (this.FTypeInfo === null)) return false;
      if (this.FTypeInfo === ATypeInfo) {
        AResult.$assign($Self);
        return true;
      };
      if (ATypeInfo === null) return false;
      if (ATypeInfo === $mod.$rtti["TValue"]) {
        this.Make($Self,$mod.$rtti["TValue"],AResult);
        return true;
      };
      Result = this.FTypeInfo.kind in ConversionAccepted();
      if (Result) {
        AResult.SetData(this.FData);
        AResult.FTypeInfo = ATypeInfo;
      };
      return Result;
    };
    this.SetArrayElement = function (aIndex, AValue) {
      if (this.IsArray()) {
        this.GetData()[aIndex] = AValue.AsJSValue()}
       else throw pas.SysUtils.EInvalidCast.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SErrInvalidTypecast")]);
    };
    this.SetArrayLength = function (Size) {
      var NewArray = [];
      NewArray = this.GetData();
      NewArray = rtl.arraySetLength(NewArray,undefined,Size);
      this.SetData(NewArray);
    };
    this.From$$$G$$rtti$$Longint = function (Value) {
      var Result = $mod.TValue.$new();
      $mod.TValue.Make(Value,rtl.longint,Result);
      return Result;
    };
    this.From$$$G$$rtti$$Double = function (Value) {
      var Result = $mod.TValue.$new();
      $mod.TValue.Make(Value,rtl.double,Result);
      return Result;
    };
    this.From$$$G$$rtti$$String = function (Value) {
      var Result = $mod.TValue.$new();
      $mod.TValue.Make(Value,rtl.string,Result);
      return Result;
    };
    this.From$$$G$$rtti$$Boolean = function (Value) {
      var Result = $mod.TValue.$new();
      $mod.TValue.Make(Value,rtl.boolean,Result);
      return Result;
    };
    this.TryAsType$$$G$$rtti$$Boolean = function (AResult, EmptyAsAnyType) {
      var Result = false;
      var val = $mod.TValue.$new();
      Result = this.TryCast(rtl.boolean,val,EmptyAsAnyType);
      if (Result) {
        if (val.GetIsEmpty()) {
          AResult.set(false)}
         else AResult.set(!(val.AsJSValue() == false));
      };
      return Result;
    };
    this.TryAsType$$$G$$rtti$$Longint = function (AResult, EmptyAsAnyType) {
      var Result = false;
      var val = $mod.TValue.$new();
      Result = this.TryCast(rtl.longint,val,EmptyAsAnyType);
      if (Result) {
        if (val.GetIsEmpty()) {
          AResult.set(-2147483648)}
         else AResult.set(rtl.trunc(val.AsJSValue()));
      };
      return Result;
    };
    this.TryAsType$$$G$$rtti$$Double = function (AResult, EmptyAsAnyType) {
      var Result = false;
      var val = $mod.TValue.$new();
      Result = this.TryCast(rtl.double,val,EmptyAsAnyType);
      if (Result) {
        if (val.GetIsEmpty()) {
          AResult.set(0.0)}
         else AResult.set(rtl.getNumber(val.AsJSValue()));
      };
      return Result;
    };
    this.TryAsType$$$G$$rtti$$TStrings = function (AResult, EmptyAsAnyType) {
      var Result = false;
      var val = $mod.TValue.$new();
      Result = this.TryCast(pas.Classes.$rtti["TStrings"],val,EmptyAsAnyType);
      if (Result) {
        if (val.GetIsEmpty()) {
          AResult.set(null)}
         else AResult.set(rtl.getObject(val.AsJSValue()));
      };
      return Result;
    };
    this.IsType$1$$$G$$rtti$$NativeInt = function (EmptyAsAnyType) {
      var Result = false;
      Result = this.IsType(rtl.nativeint,EmptyAsAnyType);
      return Result;
    };
    this.AsType$$$G$$rtti$$NativeInt = function () {
      var Result = 0;
      if (this.GetIsEmpty()) {
        Result = -9007199254740991}
       else Result = rtl.trunc(this.AsJSValue());
      return Result;
    };
    this.IsType$1$$$G$$rtti$$Longint = function (EmptyAsAnyType) {
      var Result = false;
      Result = this.IsType(rtl.longint,EmptyAsAnyType);
      return Result;
    };
    this.AsType$$$G$$rtti$$Longint = function () {
      var Result = 0;
      if (this.GetIsEmpty()) {
        Result = -2147483648}
       else Result = rtl.trunc(this.AsJSValue());
      return Result;
    };
    this.IsType$1$$$G$$rtti$$TStrings = function (EmptyAsAnyType) {
      var Result = false;
      Result = this.IsType(pas.Classes.$rtti["TStrings"],EmptyAsAnyType);
      return Result;
    };
    this.AsType$$$G$$rtti$$TStrings = function () {
      var Result = null;
      if (this.GetIsEmpty()) {
        Result = null}
       else Result = rtl.getObject(this.AsJSValue());
      return Result;
    };
    this.IsType$1$$$G$$rtti$$Double = function (EmptyAsAnyType) {
      var Result = false;
      Result = this.IsType(rtl.double,EmptyAsAnyType);
      return Result;
    };
    this.IsType$1$$$G$$rtti$$String = function (EmptyAsAnyType) {
      var Result = false;
      Result = this.IsType(rtl.string,EmptyAsAnyType);
      return Result;
    };
    var $r = $mod.$rtti.$Record("TValue",{},this);
    $r.addMethod("Empty",5,[],2,$r,1);
    $r.addMethod("FromArray",5,[["TypeInfo",pas.TypInfo.$rtti["TTypeInfo"]],["Values",pas.System.$rtti["TArray<RTTI.TValue>"],2]],2,$r,1);
    $r.addMethod("FromJSValue",5,[["v",rtl.jsvalue]],2,$r,1);
    $r.addMethod("FromOrdinal",5,[["ATypeInfo",pas.TypInfo.$rtti["TTypeInfo"]],["AValue",rtl.jsvalue]],2,$r,1);
    $r.addMethod("Make",4,[["ABuffer",rtl.jsvalue,2],["ATypeInfo",rtl.pointer,2],["Result",$r,1]],2,null,1);
    $r.addMethod("AsBoolean",1,[],2,rtl.boolean);
    $r.addMethod("AsClass",1,[],2,pas.System.$rtti["TClass"]);
    $r.addMethod("AsExtended",1,[],2,pas.System.$rtti["Extended"]);
    $r.addMethod("AsInteger",1,[],2,rtl.longint);
    $r.addMethod("AsInterface",1,[],2,pas.System.$rtti["IUnknown"]);
    $r.addMethod("AsJSValue",1,[],2,rtl.jsvalue);
    $r.addMethod("AsNativeInt",1,[],2,rtl.nativeint);
    $r.addMethod("AsObject",1,[],2,pas.System.$rtti["TObject"]);
    $r.addMethod("AsOrdinal",1,[],2,rtl.nativeint);
    $r.addMethod("AsString",1,[],2,rtl.string);
    $r.addMethod("AsUnicodeString",1,[],2,rtl.string);
    $r.addMethod("Cast",1,[["ATypeInfo",pas.TypInfo.$rtti["TTypeInfo"]],["EmptyAsAnyType",rtl.boolean,2]],2,$r);
    $r.addMethod("IsType",1,[["ATypeInfo",pas.TypInfo.$rtti["TTypeInfo"]],["EmptyAsAnyType",rtl.boolean,2]],2,rtl.boolean);
    $r.addMethod("GetArrayElement",1,[["aIndex",rtl.nativeint]],2,$r);
    $r.addMethod("GetArrayLength",1,[],2,rtl.nativeint);
    $r.addMethod("IsArray",1,[],2,rtl.boolean);
    $r.addMethod("IsClass",1,[],2,rtl.boolean);
    $r.addMethod("IsObject",1,[],2,rtl.boolean);
    $r.addMethod("IsObjectInstance",1,[],2,rtl.boolean);
    $r.addMethod("IsOrdinal",1,[],2,rtl.boolean);
    $r.addMethod("IsType$2",1,[["ATypeInfo",pas.TypInfo.$rtti["TTypeInfo"]]],2,rtl.boolean);
    $r.addMethod("ToString",1,[],2,rtl.string);
    $r.addMethod("TryCast",1,[["ATypeInfo",pas.TypInfo.$rtti["TTypeInfo"]],["AResult",$r,4],["EmptyAsAnyType",rtl.boolean,2]],2,rtl.boolean);
    $r.addMethod("SetArrayElement",0,[["aIndex",rtl.nativeint],["AValue",$r,2]]);
    $r.addMethod("SetArrayLength",0,[["Size",rtl.nativeint,2]]);
    $r.addProperty("IsEmpty",1,rtl.boolean,"GetIsEmpty","",2);
    $r.addProperty("Kind",1,pas.System.$rtti["TTypeKind"],"GetTypeKind","",2);
    $r.addProperty("TypeInfo",0,pas.TypInfo.$rtti["TTypeInfo"],"FTypeInfo","",2);
  });
  this.$rtti.$Class("TRttiType");
  this.$rtti.$Class("TRttiInstanceType");
  this.$rtti.$Class("TRttiInstanceExternalType");
  rtl.recNewT(this,"TRTTIContext",function () {
    this.$eq = function (b) {
      return true;
    };
    this.$assign = function (s) {
      return this;
    };
    this.Create = function () {
      var Result = $mod.TRTTIContext.$new();
      $impl.TRttiPoolTypes.AcquireContext();
      return Result;
    };
    this.Free = function () {
      $impl.TRttiPoolTypes.ReleaseContext();
    };
    this.FindType = function (AQualifiedName) {
      var Result = null;
      Result = $impl.Pool.FindType(AQualifiedName);
      return Result;
    };
    this.GetType = function (aTypeInfo) {
      var Result = null;
      Result = $impl.Pool.GetType(aTypeInfo);
      return Result;
    };
    this.GetType$1 = function (aClass) {
      var Result = null;
      Result = $impl.Pool.GetType$1(aClass);
      return Result;
    };
    this.GetTypes = function () {
      var Result = [];
      var ModuleName = "";
      var ClassName = "";
      var ModuleTypes = null;
      for (var $in = Object.keys(pas), $l = 0, $end = rtl.length($in) - 1; $l <= $end; $l++) {
        ModuleName = $in[$l];
        ModuleTypes = pas[ModuleName].$rtti;
        for (ClassName in ModuleTypes) if (ModuleTypes[ClassName].hasOwnProperty("name") && (ClassName.charAt(0) !== "$")) this.GetType(ModuleTypes[ClassName]);
      };
      Result = Object.values($impl.Pool.FTypes);
      return Result;
    };
    this.KeepContext = function () {
      $impl.TRttiPoolTypes.AcquireContext();
    };
    this.DropContext = function () {
      $impl.TRttiPoolTypes.ReleaseContext();
    };
    var $r = $mod.$rtti.$Record("TRTTIContext",{},this);
    $r.addMethod("Create",5,[],2,$r,1);
    $r.addMethod("Free",0,[]);
    $r.addMethod("FindType",1,[["AQualifiedName",rtl.string,2]],2,$mod.$rtti["TRttiType"]);
    $r.addMethod("GetType",1,[["aTypeInfo",rtl.pointer]],2,$mod.$rtti["TRttiType"]);
    $r.addMethod("GetType$1",1,[["aClass",pas.System.$rtti["TClass"]]],2,$mod.$rtti["TRttiType"]);
    $r.addMethod("GetTypes",1,[],2,pas.System.$rtti["TArray<RTTI.TRttiType>"]);
    $r.addMethod("KeepContext",4,[],2,null,1);
    $r.addMethod("DropContext",4,[],2,null,1);
  });
  rtl.createClass(this,"TRttiObject",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FAttributesLoaded = false;
      this.FAttributes = [];
      this.FParent = null;
      this.FHandle = null;
    };
    this.$final = function () {
      this.FAttributes = undefined;
      this.FParent = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.LoadCustomAttributes = function () {
      var Result = [];
      Result = [];
      return Result;
    };
    this.Create$1 = function (AParent, AHandle) {
      this.FParent = AParent;
      this.FHandle = AHandle;
      return this;
    };
    this.Destroy = function () {
      var Attribute = null;
      for (var $in = this.FAttributes, $l = 0, $end = rtl.length($in) - 1; $l <= $end; $l++) {
        Attribute = $in[$l];
        Attribute = rtl.freeLoc(Attribute);
      };
      this.FAttributes = [];
      pas.System.TObject.Destroy.call(this);
    };
    this.GetAttributes = function () {
      var Result = [];
      if (!this.FAttributesLoaded) {
        this.FAttributes = this.LoadCustomAttributes();
        this.FAttributesLoaded = true;
      };
      Result = rtl.arrayRef(this.FAttributes);
      return Result;
    };
    this.GetAttribute$1 = function (Attribute) {
      var Result = null;
      var CustomAttribute = null;
      Result = null;
      for (var $in = this.GetAttributes(), $l = 0, $end = rtl.length($in) - 1; $l <= $end; $l++) {
        CustomAttribute = $in[$l];
        if (Attribute.isPrototypeOf(CustomAttribute)) return CustomAttribute;
      };
      return Result;
    };
    this.HasAttribute$1 = function (Attribute) {
      var Result = false;
      Result = this.GetAttribute$1(Attribute) !== null;
      return Result;
    };
  });
  rtl.createClass(this,"TRttiNamedObject",this.TRttiObject,function () {
    this.GetName = function () {
      var Result = "";
      Result = "";
      return Result;
    };
  });
  this.TMemberVisibility = {"0": "mvPrivate", mvPrivate: 0, "1": "mvProtected", mvProtected: 1, "2": "mvPublic", mvPublic: 2, "3": "mvPublished", mvPublished: 3};
  this.$rtti.$Enum("TMemberVisibility",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TMemberVisibility});
  rtl.createClass(this,"TRttiMember",this.TRttiNamedObject,function () {
    this.GetMemberTypeInfo = function () {
      var Result = null;
      Result = this.FHandle;
      return Result;
    };
    this.GetName = function () {
      var Result = "";
      Result = this.GetMemberTypeInfo().name;
      return Result;
    };
    this.GetParent = function () {
      var Result = null;
      Result = this.FParent;
      return Result;
    };
    this.GetVisibility = function () {
      var Result = 0;
      Result = $mod.TMemberVisibility.mvPublished;
      return Result;
    };
    this.LoadCustomAttributes = function () {
      var Result = [];
      Result = pas.TypInfo.GetRTTIAttributes(this.GetMemberTypeInfo().attr);
      return Result;
    };
    this.Create$2 = function (AParent, ATypeInfo) {
      if (!rtl.isExt(ATypeInfo,rtl.tTypeMember)) throw pas.SysUtils.EInvalidCast.$create("Create$1",[""]);
      $mod.TRttiObject.Create$1.call(this,AParent,ATypeInfo);
      return this;
    };
  });
  rtl.createClass(this,"TRttiField",this.TRttiMember,function () {
    this.GetFieldType = function () {
      var Result = null;
      Result = $impl.Pool.GetType(this.GetFieldTypeInfo().typeinfo);
      return Result;
    };
    this.GetFieldTypeInfo = function () {
      var Result = null;
      Result = this.FHandle;
      return Result;
    };
    this.Create$3 = function (AParent, ATypeInfo) {
      if (!rtl.isExt(ATypeInfo,rtl.tTypeMemberField)) throw pas.SysUtils.EInvalidCast.$create("Create$1",[""]);
      $mod.TRttiMember.Create$2.apply(this,arguments);
      return this;
    };
    this.GetValue = function (Instance) {
      var Result = $mod.TValue.$new();
      Result.$assign($mod.TValue.FromJSValue(Instance[this.GetName()]));
      return Result;
    };
    this.SetValue = function (Instance, AValue) {
      Instance[this.GetName()] = AValue.Cast(this.GetFieldType().GetHandle(),true).AsJSValue();
    };
  });
  rtl.createClass(this,"TRttiParameter",this.TRttiNamedObject,function () {
    this.$init = function () {
      $mod.TRttiNamedObject.$init.call(this);
      this.FParamType = null;
      this.FFlags = {};
      this.FName = "";
    };
    this.$final = function () {
      this.FParamType = undefined;
      this.FFlags = undefined;
      $mod.TRttiNamedObject.$final.call(this);
    };
    this.GetName = function () {
      var Result = "";
      Result = this.FName;
      return Result;
    };
  });
  rtl.createClass(this,"TRttiMethod",this.TRttiMember,function () {
    this.$init = function () {
      $mod.TRttiMember.$init.call(this);
      this.FParameters = [];
      this.FParametersLoaded = false;
    };
    this.$final = function () {
      this.FParameters = undefined;
      $mod.TRttiMember.$final.call(this);
    };
    this.GetIsAsyncCall = function () {
      var Result = false;
      Result = (pas.TypInfo.TProcedureFlag.pfAsync in this.GetProcedureFlags()) || ((this.GetReturnType() != null) && this.GetReturnType().GetIsInstanceExternal() && (this.GetReturnType().GetAsInstanceExternal().GetExternalName() === "Promise"));
      return Result;
    };
    this.GetIsClassMethod = function () {
      var Result = false;
      Result = this.GetMethodTypeInfo().methodkind in rtl.createSet(pas.TypInfo.TMethodKind.mkClassFunction,pas.TypInfo.TMethodKind.mkClassProcedure);
      return Result;
    };
    this.GetIsConstructor = function () {
      var Result = false;
      Result = this.GetMethodTypeInfo().methodkind === pas.TypInfo.TMethodKind.mkConstructor;
      return Result;
    };
    this.GetIsDestructor = function () {
      var Result = false;
      Result = this.GetMethodTypeInfo().methodkind === pas.TypInfo.TMethodKind.mkDestructor;
      return Result;
    };
    this.GetIsExternal = function () {
      var Result = false;
      Result = pas.TypInfo.TProcedureFlag.pfExternal in this.GetProcedureFlags();
      return Result;
    };
    this.GetIsSafeCall = function () {
      var Result = false;
      Result = pas.TypInfo.TProcedureFlag.pfSafeCall in this.GetProcedureFlags();
      return Result;
    };
    this.GetIsStatic = function () {
      var Result = false;
      Result = pas.TypInfo.TProcedureFlag.pfStatic in this.GetProcedureFlags();
      return Result;
    };
    this.GetMethodKind = function () {
      var Result = 0;
      Result = this.GetMethodTypeInfo().methodkind;
      return Result;
    };
    this.GetMethodTypeInfo = function () {
      var Result = null;
      Result = this.FHandle;
      return Result;
    };
    var PROCEDURE_FLAGS = [1,2,4,8,16];
    this.GetProcedureFlags = function () {
      var Result = {};
      var Flag = 0;
      var ProcedureFlags = 0;
      ProcedureFlags = this.GetMethodTypeInfo().procsig.flags;
      Result = {};
      for (Flag = 0; Flag <= 4; Flag++) if (rtl.and(PROCEDURE_FLAGS[Flag],ProcedureFlags) > 0) Result = rtl.unionSet(Result,rtl.createSet(Flag));
      return Result;
    };
    this.GetReturnType = function () {
      var Result = null;
      Result = $impl.Pool.GetType(this.GetMethodTypeInfo().procsig.resulttype);
      return Result;
    };
    var FLAGS_CONVERSION = [1,2,4,8,16,32];
    this.LoadParameters = function () {
      var A = 0;
      var Flag = 0;
      var Param = null;
      var RttiParam = null;
      var MethodParams = [];
      this.FParametersLoaded = true;
      MethodParams = this.GetMethodTypeInfo().procsig.params;
      this.FParameters = rtl.arraySetLength(this.FParameters,null,rtl.length(MethodParams));
      for (var $l = 0, $end = rtl.length(this.FParameters) - 1; $l <= $end; $l++) {
        A = $l;
        Param = MethodParams[A];
        RttiParam = $mod.TRttiParameter.$create("Create$1",[this,Param]);
        RttiParam.FName = Param.name;
        RttiParam.FParamType = $impl.Pool.GetType(Param.typeinfo);
        for (Flag = 0; Flag <= 5; Flag++) if (rtl.and(FLAGS_CONVERSION[Flag],Param.flags) > 0) RttiParam.FFlags = rtl.unionSet(RttiParam.FFlags,rtl.createSet(Flag));
        this.FParameters[A] = RttiParam;
      };
    };
    this.GetIsVarArgs = function () {
      var Result = false;
      Result = pas.TypInfo.TProcedureFlag.pfVarargs in this.GetProcedureFlags();
      return Result;
    };
    this.GetParameters = function () {
      var Result = [];
      if (!this.FParametersLoaded) this.LoadParameters();
      Result = rtl.arrayRef(this.FParameters);
      return Result;
    };
    this.Invoke = function (Instance, Args) {
      var Result = $mod.TValue.$new();
      var A = 0;
      var AArgs = [];
      if (this.GetReturnType() != null) Result.FTypeInfo = this.GetReturnType().GetHandle();
      AArgs = rtl.arraySetLength(AArgs,undefined,rtl.length(Args));
      for (var $l = 0, $end = rtl.length(Args) - 1; $l <= $end; $l++) {
        A = $l;
        AArgs[A] = Args[A].AsJSValue();
      };
      Result.SetData(Instance.AsJSValue()[this.GetName()].apply(Instance.AsJSValue(),AArgs));
      return Result;
    };
    this.Invoke$1 = function (Instance, Args) {
      var Result = $mod.TValue.$new();
      var v = $mod.TValue.$new();
      $mod.TValue.Make(Instance,Instance.$class.ClassInfo(),v);
      Result.$assign(this.Invoke(v,Args));
      return Result;
    };
    this.Invoke$2 = function (aClass, Args) {
      var Result = $mod.TValue.$new();
      var v = $mod.TValue.$new();
      $mod.TValue.Make(aClass,aClass.ClassInfo(),v);
      Result.$assign(this.Invoke(v,Args));
      return Result;
    };
  });
  rtl.createClass(this,"TRttiProperty",this.TRttiMember,function () {
    this.GetPropertyTypeInfo = function () {
      var Result = null;
      Result = this.FHandle;
      return Result;
    };
    this.GetPropertyType = function () {
      var Result = null;
      Result = $impl.Pool.GetType(this.GetPropertyTypeInfo().typeinfo);
      return Result;
    };
    this.GetIsWritable = function () {
      var Result = false;
      Result = this.GetPropertyTypeInfo().setter !== "";
      return Result;
    };
    this.GetIsReadable = function () {
      var Result = false;
      Result = this.GetPropertyTypeInfo().getter !== "";
      return Result;
    };
    this.GetVisibility = function () {
      var Result = 0;
      Result = $mod.TMemberVisibility.mvPublished;
      return Result;
    };
    this.Create$3 = function (AParent, ATypeInfo) {
      if (!rtl.isExt(ATypeInfo,rtl.tTypeMemberProperty)) throw pas.SysUtils.EInvalidCast.$create("Create$1",[""]);
      $mod.TRttiMember.Create$2.apply(this,arguments);
      return this;
    };
    this.GetValue = function (Instance) {
      var Result = $mod.TValue.$new();
      $mod.TValue.Make(pas.TypInfo.GetJSValueProp$1(Instance,this.GetPropertyTypeInfo()),this.GetPropertyType().GetHandle(),Result);
      return Result;
    };
    this.SetValue = function (Instance, AValue) {
      pas.TypInfo.SetJSValueProp$1(Instance,this.GetPropertyTypeInfo(),AValue.Cast(this.GetPropertyType().GetHandle(),true).AsJSValue());
    };
  });
  rtl.createClass(this,"TRttiInstanceProperty",this.TRttiProperty,function () {
  });
  rtl.createClass(this,"TRttiType",this.TRttiNamedObject,function () {
    this.GetAsInstance = function () {
      var Result = null;
      Result = rtl.as(this,$mod.TRttiInstanceType);
      return Result;
    };
    this.GetAsInstanceExternal = function () {
      var Result = null;
      Result = rtl.as(this,$mod.TRttiInstanceExternalType);
      return Result;
    };
    this.GetHandle = function () {
      var Result = null;
      Result = this.FHandle;
      return Result;
    };
    this.GetQualifiedName = function () {
      var Result = "";
      Result = pas.SysUtils.Format("%s.%s",pas.System.VarRecs(18,this.GetHandle().$module.$name,18,this.GetName()));
      return Result;
    };
    this.GetName = function () {
      var Result = "";
      Result = this.GetHandle().name;
      return Result;
    };
    this.GetIsInstance = function () {
      var Result = false;
      Result = $mod.TRttiInstanceType.isPrototypeOf(this);
      return Result;
    };
    this.GetIsInstanceExternal = function () {
      var Result = false;
      Result = $mod.TRttiInstanceExternalType.isPrototypeOf(this);
      return Result;
    };
    this.GetIsOrdinal = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    this.GetIsRecord = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    this.GetIsSet = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    this.GetTypeKind = function () {
      var Result = 0;
      Result = this.GetHandle().kind;
      return Result;
    };
    this.GetBaseType = function () {
      var Result = null;
      Result = null;
      return Result;
    };
    this.LoadCustomAttributes = function () {
      var Result = [];
      Result = pas.TypInfo.GetRTTIAttributes(this.GetHandle().attr);
      return Result;
    };
    this.GetField = function (AName) {
      var Result = null;
      var AField = null;
      Result = null;
      for (var $in = this.GetFields(), $l = 0, $end = rtl.length($in) - 1; $l <= $end; $l++) {
        AField = $in[$l];
        if (AField.GetName() === AName) return AField;
      };
      return Result;
    };
    this.GetFields = function () {
      var Result = [];
      Result = [];
      return Result;
    };
    this.GetMethods = function () {
      var Result = [];
      Result = [];
      return Result;
    };
    this.GetMethods$1 = function (aName) {
      var Result = [];
      Result = [];
      return Result;
    };
    this.GetMethod = function (aName) {
      var Result = null;
      Result = null;
      if (aName === "") ;
      return Result;
    };
    this.GetProperty = function (AName) {
      var Result = null;
      Result = null;
      if (AName === "") ;
      return Result;
    };
    this.GetProperties = function () {
      var Result = [];
      Result = [];
      return Result;
    };
    this.GetDeclaredProperties = function () {
      var Result = [];
      Result = [];
      return Result;
    };
    this.GetDeclaredMethods = function () {
      var Result = [];
      Result = [];
      return Result;
    };
    this.GetDeclaredFields = function () {
      var Result = [];
      Result = [];
      return Result;
    };
  });
  this.$rtti.$ClassRef("TRttiTypeClass",{instancetype: this.$rtti["TRttiType"]});
  rtl.createClass(this,"TRttiStructuredType",this.TRttiType,function () {
    this.$init = function () {
      $mod.TRttiType.$init.call(this);
      this.FFields = [];
      this.FMethods = [];
      this.FProperties = [];
    };
    this.$final = function () {
      this.FFields = undefined;
      this.FMethods = undefined;
      this.FProperties = undefined;
      $mod.TRttiType.$final.call(this);
    };
    this.GetAncestor = function () {
      var Result = null;
      Result = null;
      return Result;
    };
    this.GetStructTypeInfo = function () {
      var Result = null;
      Result = this.GetHandle();
      return Result;
    };
    this.Create$1 = function (AParent, ATypeInfo) {
      if (!rtl.isExt(ATypeInfo,rtl.tTypeInfoStruct)) throw pas.SysUtils.EInvalidCast.$create("Create$1",[""]);
      $mod.TRttiObject.Create$1.apply(this,arguments);
      return this;
    };
    this.Destroy = function () {
      var Method = null;
      var Prop = null;
      for (var $in = this.FMethods, $l = 0, $end = rtl.length($in) - 1; $l <= $end; $l++) {
        Method = $in[$l];
        Method = rtl.freeLoc(Method);
      };
      for (var $in1 = this.FProperties, $l1 = 0, $end1 = rtl.length($in1) - 1; $l1 <= $end1; $l1++) {
        Prop = $in1[$l1];
        Prop = rtl.freeLoc(Prop);
      };
      $mod.TRttiObject.Destroy.call(this);
    };
    this.GetDeclaredFields = function () {
      var Result = [];
      var A = 0;
      var FieldCount = 0;
      if (!(rtl.length(this.FFields) > 0)) {
        FieldCount = this.GetStructTypeInfo().fields.length;
        this.FFields = rtl.arraySetLength(this.FFields,null,FieldCount);
        for (var $l = 0, $end = FieldCount - 1; $l <= $end; $l++) {
          A = $l;
          this.FFields[A] = $mod.TRttiField.$create("Create$3",[this,this.GetStructTypeInfo().getField(A)]);
        };
      };
      Result = rtl.arrayRef(this.FFields);
      return Result;
    };
    this.GetDeclaredMethods = function () {
      var Result = [];
      var A = 0;
      var MethodCount = 0;
      if (!(rtl.length(this.FMethods) > 0)) {
        MethodCount = this.GetStructTypeInfo().methods.length;
        this.FMethods = rtl.arraySetLength(this.FMethods,null,MethodCount);
        for (var $l = 0, $end = MethodCount - 1; $l <= $end; $l++) {
          A = $l;
          this.FMethods[A] = $mod.TRttiMethod.$create("Create$2",[this,this.GetStructTypeInfo().getMethod(A)]);
        };
      };
      Result = rtl.arrayRef(this.FMethods);
      return Result;
    };
    this.GetDeclaredProperties = function () {
      var Result = [];
      var A = 0;
      var PropCount = 0;
      if (!(rtl.length(this.FProperties) > 0)) {
        PropCount = this.GetStructTypeInfo().properties.length;
        this.FProperties = rtl.arraySetLength(this.FProperties,null,PropCount);
        for (var $l = 0, $end = PropCount - 1; $l <= $end; $l++) {
          A = $l;
          this.FProperties[A] = $mod.TRttiProperty.$create("Create$3",[this,this.GetStructTypeInfo().getProperty(A)]);
        };
      };
      Result = rtl.arrayRef(this.FProperties);
      return Result;
    };
    this.GetFields = function () {
      var Result = [];
      var A = 0;
      var Start = 0;
      var BaseClass = null;
      var Declared = [];
      BaseClass = this;
      Result = [];
      while (BaseClass != null) {
        Declared = BaseClass.GetDeclaredFields();
        Start = rtl.length(Result);
        Result = rtl.arraySetLength(Result,null,Start + rtl.length(Declared));
        for (var $l = 0, $end = rtl.length(Declared) - 1; $l <= $end; $l++) {
          A = $l;
          Result[Start + A] = Declared[A];
        };
        BaseClass = BaseClass.GetAncestor();
      };
      return Result;
    };
    this.GetMethod = function (aName) {
      var Result = null;
      var Method = null;
      for (var $in = this.GetMethods(), $l = 0, $end = rtl.length($in) - 1; $l <= $end; $l++) {
        Method = $in[$l];
        if (aName === Method.GetName()) return Method;
      };
      return Result;
    };
    this.GetMethods = function () {
      var Result = [];
      var A = 0;
      var Start = 0;
      var BaseClass = null;
      var Declared = [];
      BaseClass = this;
      Result = [];
      while (BaseClass != null) {
        Declared = BaseClass.GetDeclaredMethods();
        Start = rtl.length(Result);
        Result = rtl.arraySetLength(Result,null,Start + rtl.length(Declared));
        for (var $l = 0, $end = rtl.length(Declared) - 1; $l <= $end; $l++) {
          A = $l;
          Result[Start + A] = Declared[A];
        };
        BaseClass = BaseClass.GetAncestor();
      };
      return Result;
    };
    this.GetMethods$1 = function (aName) {
      var Result = [];
      var Method = null;
      var MethodCount = 0;
      MethodCount = 0;
      for (var $in = this.GetMethods(), $l = 0, $end = rtl.length($in) - 1; $l <= $end; $l++) {
        Method = $in[$l];
        if (aName === Method.GetName()) MethodCount += 1;
      };
      Result = rtl.arraySetLength(Result,null,MethodCount);
      for (var $in1 = this.GetMethods(), $l1 = 0, $end1 = rtl.length($in1) - 1; $l1 <= $end1; $l1++) {
        Method = $in1[$l1];
        if (aName === Method.GetName()) {
          MethodCount -= 1;
          Result[MethodCount] = Method;
        };
      };
      return Result;
    };
    this.GetProperties = function () {
      var Result = [];
      var A = 0;
      var Start = 0;
      var BaseClass = null;
      var Declared = [];
      BaseClass = this;
      Result = [];
      while (BaseClass != null) {
        Declared = BaseClass.GetDeclaredProperties();
        Start = rtl.length(Result);
        Result = rtl.arraySetLength(Result,null,Start + rtl.length(Declared));
        for (var $l = 0, $end = rtl.length(Declared) - 1; $l <= $end; $l++) {
          A = $l;
          Result[Start + A] = Declared[A];
        };
        BaseClass = BaseClass.GetAncestor();
      };
      return Result;
    };
    this.GetProperty = function (AName) {
      var Result = null;
      var Prop = null;
      var lName = "";
      lName = pas.SysUtils.LowerCase(AName);
      for (var $in = this.GetProperties(), $l = 0, $end = rtl.length($in) - 1; $l <= $end; $l++) {
        Prop = $in[$l];
        if (pas.SysUtils.LowerCase(Prop.GetName()) === lName) return Prop;
      };
      Result = null;
      return Result;
    };
  });
  rtl.createClass(this,"TRttiInstanceType",this.TRttiStructuredType,function () {
    this.GetAncestorType = function () {
      var Result = null;
      Result = rtl.as(this.FParent,$mod.TRttiInstanceType);
      return Result;
    };
    this.GetClassTypeInfo = function () {
      var Result = null;
      Result = this.GetHandle();
      return Result;
    };
    this.GetMetaClassType = function () {
      var Result = null;
      Result = this.GetClassTypeInfo().class;
      return Result;
    };
    this.GetAncestor = function () {
      var Result = null;
      Result = this.GetAncestorType();
      return Result;
    };
    this.GetBaseType = function () {
      var Result = null;
      Result = this.GetAncestorType();
      return Result;
    };
    this.Create$1 = function (AParent, ATypeInfo) {
      if (!rtl.isExt(ATypeInfo,rtl.tTypeInfoClass)) throw pas.SysUtils.EInvalidCast.$create("Create$1",[""]);
      $mod.TRttiStructuredType.Create$1.apply(this,arguments);
      return this;
    };
  });
  rtl.createClass(this,"TRttiInterfaceType",this.TRttiStructuredType,function () {
    this.GetAncestorType = function () {
      var Result = null;
      Result = rtl.as($impl.Pool.GetType(this.GetInterfaceTypeInfo().ancestor),$mod.TRttiInterfaceType);
      return Result;
    };
    this.GetGUID = function () {
      var Result = pas.System.TGuid.$new();
      var GUID = "";
      GUID = this.GetInterfaceTypeInfo().interface.$guid;
      pas.SysUtils.TryStringToGUID(GUID,Result);
      return Result;
    };
    this.GetInterfaceTypeInfo = function () {
      var Result = null;
      Result = this.GetHandle();
      return Result;
    };
    this.GetAncestor = function () {
      var Result = null;
      Result = this.GetAncestorType();
      return Result;
    };
    this.GetBaseType = function () {
      var Result = null;
      Result = this.GetAncestorType();
      return Result;
    };
    this.Create$1 = function (AParent, ATypeInfo) {
      if (!rtl.isExt(ATypeInfo,rtl.tTypeInfoInterface)) throw pas.SysUtils.EInvalidCast.$create("Create$1",[""]);
      $mod.TRttiStructuredType.Create$1.apply(this,arguments);
      return this;
    };
  });
  rtl.createClass(this,"TRttiRecordType",this.TRttiStructuredType,function () {
    this.GetRecordTypeInfo = function () {
      var Result = null;
      Result = this.GetHandle();
      return Result;
    };
    this.GetIsRecord = function () {
      var Result = false;
      Result = true;
      return Result;
    };
    this.Create$1 = function (AParent, ATypeInfo) {
      if (!rtl.isExt(ATypeInfo,rtl.tTypeInfoRecord)) throw pas.SysUtils.EInvalidCast.$create("Create$1",[""]);
      $mod.TRttiStructuredType.Create$1.apply(this,arguments);
      return this;
    };
  });
  rtl.createClass(this,"TRttiClassRefType",this.TRttiType,function () {
    this.GetClassRefTypeInfo = function () {
      var Result = null;
      Result = this.GetHandle();
      return Result;
    };
    this.GetInstanceType = function () {
      var Result = null;
      Result = rtl.as($impl.Pool.GetType(this.GetClassRefTypeInfo().instancetype),$mod.TRttiInstanceType);
      return Result;
    };
    this.GetMetaclassType = function () {
      var Result = null;
      Result = this.GetInstanceType().GetMetaClassType();
      return Result;
    };
    this.Create$1 = function (AParent, ATypeInfo) {
      if (!rtl.isExt(ATypeInfo,rtl.tTypeInfoClassRef)) throw pas.SysUtils.EInvalidCast.$create("Create$1",[""]);
      $mod.TRttiObject.Create$1.apply(this,arguments);
      return this;
    };
  });
  rtl.createClass(this,"TRttiInstanceExternalType",this.TRttiType,function () {
    this.GetAncestor = function () {
      var Result = null;
      Result = rtl.as($impl.Pool.GetType(this.GetExternalClassTypeInfo().ancestor),$mod.TRttiInstanceExternalType);
      return Result;
    };
    this.GetExternalName = function () {
      var Result = "";
      Result = this.GetExternalClassTypeInfo().jsclass;
      return Result;
    };
    this.GetExternalClassTypeInfo = function () {
      var Result = null;
      Result = this.GetHandle();
      return Result;
    };
    this.Create$1 = function (AParent, ATypeInfo) {
      if (!rtl.isExt(ATypeInfo,rtl.tTypeInfoExtClass)) throw pas.SysUtils.EInvalidCast.$create("Create$1",[""]);
      $mod.TRttiObject.Create$1.apply(this,arguments);
      return this;
    };
  });
  rtl.createClass(this,"TRttiOrdinalType",this.TRttiType,function () {
    this.GetMaxValue = function () {
      var Result = 0;
      Result = this.GetOrdinalTypeInfo().maxvalue;
      return Result;
    };
    this.GetMinValue = function () {
      var Result = 0;
      Result = this.GetOrdinalTypeInfo().minvalue;
      return Result;
    };
    this.GetOrdType = function () {
      var Result = 0;
      Result = this.GetOrdinalTypeInfo().ordtype;
      return Result;
    };
    this.GetOrdinalTypeInfo = function () {
      var Result = null;
      Result = this.GetHandle();
      return Result;
    };
    this.Create$1 = function (AParent, ATypeInfo) {
      if (!rtl.isExt(ATypeInfo,rtl.tTypeInfoInteger)) throw pas.SysUtils.EInvalidCast.$create("Create$1",[""]);
      $mod.TRttiObject.Create$1.apply(this,arguments);
      return this;
    };
  });
  rtl.createClass(this,"TRttiEnumerationType",this.TRttiOrdinalType,function () {
    this.GetEnumerationTypeInfo = function () {
      var Result = null;
      Result = this.GetHandle();
      return Result;
    };
    this.Create$1 = function (AParent, ATypeInfo) {
      if (!rtl.isExt(ATypeInfo,rtl.tTypeInfoEnum)) throw pas.SysUtils.EInvalidCast.$create("Create$1",[""]);
      $mod.TRttiOrdinalType.Create$1.apply(this,arguments);
      return this;
    };
    this.GetNames = function () {
      var Result = [];
      var A = 0;
      var NamesSize = 0;
      NamesSize = pas.TypInfo.GetEnumNameCount(this.GetEnumerationTypeInfo());
      Result = rtl.arraySetLength(Result,"",NamesSize);
      for (var $l = 0, $end = NamesSize - 1; $l <= $end; $l++) {
        A = $l;
        Result[A] = this.GetEnumerationTypeInfo().enumtype[A + this.GetMinValue()];
      };
      return Result;
    };
  });
  rtl.createClass(this,"TRttiDynamicArrayType",this.TRttiType,function () {
    this.GetDynArrayTypeInfo = function () {
      var Result = null;
      Result = this.GetHandle();
      return Result;
    };
    this.GetElementType = function () {
      var Result = null;
      Result = $impl.Pool.GetType(this.GetDynArrayTypeInfo().eltype);
      return Result;
    };
    this.Create$1 = function (AParent, ATypeInfo) {
      if (!rtl.isExt(ATypeInfo,rtl.tTypeInfoDynArray)) throw pas.SysUtils.EInvalidCast.$create("Create$1",[""]);
      $mod.TRttiObject.Create$1.apply(this,arguments);
      return this;
    };
  });
  this.$rtti.$RefToProcVar("TVirtualInterfaceInvokeEvent",{procsig: rtl.newTIProcSig([["Method",this.$rtti["TRttiMethod"]],["Args",pas.System.$rtti["TArray<RTTI.TValue>"],2],["Result",this.$rtti["TValue"],4]])});
  this.$rtti.$RefToProcVar("TVirtualInterfaceInvokeEventJS",{procsig: rtl.newTIProcSig([["aMethodName",rtl.string,2],["Args",pas.Types.$rtti["TJSValueDynArray"],2]],rtl.jsvalue)});
  rtl.createClass(this,"TVirtualInterface",pas.System.TInterfacedObject,function () {
    this.$init = function () {
      pas.System.TInterfacedObject.$init.call(this);
      this.FContext = $mod.TRTTIContext.$new();
      this.FInterfaceType = null;
      this.FOnInvoke = null;
      this.FOnInvokeJS = null;
    };
    this.$final = function () {
      this.FContext = undefined;
      this.FInterfaceType = undefined;
      this.FOnInvoke = undefined;
      this.FOnInvokeJS = undefined;
      pas.System.TInterfacedObject.$final.call(this);
    };
    this.Invoke = function (MethodName, Args) {
      var $Self = this;
      var Result = undefined;
      var Method = null;
      var Return = $mod.TValue.$new();
      function GenerateParams() {
        var Result = [];
        var A = 0;
        var Param = null;
        var Parameters = [];
        Parameters = Method.GetParameters();
        Result = rtl.arraySetLength(Result,$mod.TValue,rtl.length(Parameters));
        for (var $l = 0, $end = rtl.length(Parameters) - 1; $l <= $end; $l++) {
          A = $l;
          Param = Parameters[A];
          $mod.TValue.Make(Args[A],Param.FParamType.GetHandle(),Result[A]);
          Result[A].FReferenceVariableData = (pas.TypInfo.TParamFlag.pfVar in Param.FFlags) || (pas.TypInfo.TParamFlag.pfOut in Param.FFlags);
        };
        return Result;
      };
      if (this.FOnInvokeJS != null) {
        Result = this.FOnInvokeJS(MethodName,Args)}
       else {
        Method = this.FInterfaceType.GetMethod(MethodName);
        this.FOnInvoke(Method,GenerateParams(),Return);
        Result = Return.AsJSValue();
      };
      return Result;
    };
    this.Create$1 = function (InterfaceTypeInfo) {
      var $Self = this;
      var SelfInterfaceObject = null;
      var InterfaceObject = null;
      var Method = null;
      var MethodName = "";
      this.FContext.$assign($mod.TRTTIContext.Create());
      this.FInterfaceType = rtl.as(this.FContext.GetType(InterfaceTypeInfo),$mod.TRttiInterfaceType);
      if (this.FInterfaceType.GetInterfaceTypeInfo().interface.$kind !== "com") throw pas.SysUtils.EInvalidCast.$create("Create");
      InterfaceObject = Object.create(this.FInterfaceType.GetInterfaceTypeInfo().interface);
      InterfaceObject.$o = $Self;
      for (var $in = this.FInterfaceType.GetMethods(), $l = 0, $end = rtl.length($in) - 1; $l <= $end; $l++) {
        Method = $in[$l];
        let MethodName = Method.GetName();
        InterfaceObject[MethodName] = function () {
          var Result = undefined;
          Result = this.$o.Invoke(MethodName,arguments);
          return Result;
        };
      };
      InterfaceObject["_AddRef"] = rtl.createCallback($Self,"_AddRef");
      InterfaceObject["_Release"] = rtl.createCallback($Self,"_Release");
      InterfaceObject["QueryInterface"] = rtl.createCallback($Self,"QueryInterface");
      SelfInterfaceObject = $Self;
      SelfInterfaceObject.$intfmaps = new Object();
      SelfInterfaceObject.$intfmaps[pas.SysUtils.GUIDToString(rtl.getIntfGUIDR(pas.System.IUnknown))] = InterfaceObject;
      SelfInterfaceObject.$intfmaps[pas.SysUtils.TGuidHelper.ToString.call(this.FInterfaceType.GetGUID(),false)] = new Object();
      SelfInterfaceObject.$interfaces = new Object();
      SelfInterfaceObject.$interfaces[pas.SysUtils.TGuidHelper.ToString.call(this.FInterfaceType.GetGUID(),false)] = InterfaceObject;
      return this;
    };
    this.Create$2 = function (InterfaceTypeInfo, InvokeEvent) {
      this.Create$1(InterfaceTypeInfo);
      this.FOnInvoke = InvokeEvent;
      return this;
    };
    this.Create$3 = function (InterfaceTypeInfo, InvokeEvent) {
      this.Create$1(InterfaceTypeInfo);
      this.FOnInvokeJS = InvokeEvent;
      return this;
    };
    this.Destroy = function () {
      this.FContext.Free();
      pas.System.TObject.Destroy.call(this);
    };
    this.QueryInterface = function (iid, obj) {
      var Result = 0;
      Result = pas.System.TInterfacedObject.QueryInterface.call(this,iid,obj);
      return Result;
    };
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.CreateVirtualCorbaInterface = function (InterfaceTypeInfo, MethodImplementation, IntfVar) {
    var IntfType = InterfaceTypeInfo.interface;
    var i = Object.create(IntfType);
    var o = { $name: "virtual", $fullname: "virtual" };
    i.$o = o;
    do {
      var names = IntfType.$names;
      if (!names) break;
      for (var j=0; j<names.length; j++){
        let fnname = names[j];
        i[fnname] = function(){ return MethodImplementation(fnname,arguments); };
      }
      IntfType = Object.getPrototypeOf(IntfType);
    } while(IntfType!=null);
    IntfVar.set(i);
  };
  this.Invoke = function (ACodeAddress, AArgs, ACallConv, AResultType, AIsStatic, AIsConstructor) {
    var Result = $mod.TValue.$new();
    if (ACallConv === pas.TypInfo.TCallConv.ccReg) ;
    if (AIsStatic) ;
    if (AIsConstructor) throw pas.JS.EJS.$create("Create$1",["not supported"]);
    if (rtl.isFunction(ACodeAddress)) {
      Result.FData = ACodeAddress.apply(null,AArgs);
      if (AResultType !== null) {
        Result.FTypeInfo = AResultType}
       else Result.FTypeInfo = rtl.jsvalue;
    } else throw pas.JS.EJS.$create("Create$1",[rtl.getResStr($mod,"SErrInvokeInvalidCodeAddr")]);
    return Result;
  };
  $mod.$resourcestrings = {SErrInvokeInvalidCodeAddr: {org: "CodeAddress is not a function"}, SErrTypeIsNotEnumerated: {org: "Type %s is not an enumerated type"}};
  $mod.$implcode = function () {
    rtl.createClass($impl,"TRttiPoolTypes",pas.System.TObject,function () {
      this.$init = function () {
        pas.System.TObject.$init.call(this);
        this.FReferenceCount = 0;
        this.FTypes = null;
      };
      this.$final = function () {
        this.FTypes = undefined;
        pas.System.TObject.$final.call(this);
      };
      this.Create$1 = function () {
        pas.System.TObject.Create.call(this);
        this.FTypes = new Object();
        return this;
      };
      this.Destroy = function () {
        var Key = "";
        var RttiObject = null;
        for (Key in this.FTypes) if (this.FTypes.hasOwnProperty(Key)) {
          RttiObject = rtl.getObject(this.FTypes[Key]);
          RttiObject = rtl.freeLoc(RttiObject);
        };
      };
      this.FindType = function (AQualifiedName) {
        var Result = null;
        var ModuleName = "";
        var TypeName = "";
        var Module = null;
        var TypeFound = null;
        if (this.FTypes.hasOwnProperty(AQualifiedName)) {
          Result = rtl.getObject(this.FTypes[AQualifiedName])}
         else {
          Result = null;
          for (var $in = Object.keys(pas), $l = 0, $end = rtl.length($in) - 1; $l <= $end; $l++) {
            ModuleName = $in[$l];
            if (pas.SysUtils.TStringHelper.StartsWith.call({get: function () {
                return AQualifiedName;
              }, set: function (v) {
                rtl.raiseE("EPropReadOnly");
              }},ModuleName + ".")) {
              Module = pas[ModuleName];
              TypeName = pas.System.Copy(AQualifiedName,ModuleName.length + 2,AQualifiedName.length);
              if (Module.$rtti.hasOwnProperty(TypeName)) {
                TypeFound = Module.$rtti[TypeName];
                return this.GetType(TypeFound);
              };
            };
          };
        };
        return Result;
      };
      this.GetType = function (ATypeInfo) {
        var Result = null;
        var RttiTypeClass = [null,$mod.TRttiOrdinalType,$mod.TRttiOrdinalType,$mod.TRttiType,$mod.TRttiEnumerationType,$mod.TRttiType,$mod.TRttiType,$mod.TRttiType,$mod.TRttiType,$mod.TRttiType,$mod.TRttiType,$mod.TRttiDynamicArrayType,$mod.TRttiRecordType,$mod.TRttiInstanceType,$mod.TRttiClassRefType,$mod.TRttiType,$mod.TRttiType,$mod.TRttiType,$mod.TRttiInterfaceType,$mod.TRttiType,$mod.TRttiInstanceExternalType];
        var Name = "";
        var Parent = null;
        if (pas.JS.isNull(ATypeInfo) || pas.JS.isUndefined(ATypeInfo)) return null;
        Name = ATypeInfo.name;
        if (rtl.isModule(ATypeInfo.$module)) Name = ATypeInfo.$module.$name + "." + Name;
        if (this.FTypes.hasOwnProperty(Name)) {
          Result = rtl.getObject(this.FTypes[Name])}
         else {
          if ((ATypeInfo.kind in rtl.createSet(pas.System.TTypeKind.tkClass,pas.System.TTypeKind.tkInterface,pas.System.TTypeKind.tkHelper,pas.System.TTypeKind.tkExtClass)) && ATypeInfo.hasOwnProperty("ancestor")) {
            Parent = this.GetType(ATypeInfo["ancestor"])}
           else Parent = null;
          Result = RttiTypeClass[ATypeInfo.kind].$create("Create$1",[Parent,ATypeInfo]);
          this.FTypes[Name] = Result;
        };
        return Result;
      };
      this.GetType$1 = function (AClass) {
        var Result = null;
        if (AClass === null) return null;
        Result = this.GetType(AClass.$rtti);
        return Result;
      };
      this.AcquireContext = function () {
        var Result = null;
        if (!($impl.Pool != null)) $impl.Pool = $impl.TRttiPoolTypes.$create("Create$1");
        Result = $impl.Pool.FTypes;
        $impl.Pool.FReferenceCount += 1;
        return Result;
      };
      this.ReleaseContext = function () {
        $impl.Pool.FReferenceCount -= 1;
        if ($impl.Pool.FReferenceCount === 0) pas.SysUtils.FreeAndNil({p: $impl, get: function () {
            return this.p.Pool;
          }, set: function (v) {
            this.p.Pool = v;
          }});
      };
    });
    $impl.Pool = null;
  };
},[]);
rtl.module("WEBLib.JSON",["System","Classes","Web","JS","SysUtils","RTTI"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.$rtti.$Class("TJSONObject");
  this.$rtti.$Class("TJSONString");
  rtl.createClass(this,"TJSONAncestor",pas.System.TObject,function () {
    this.GetStrValue = function () {
      var Result = "";
      Result = "";
      return Result;
    };
    this.SetStrValue = function (Value) {
    };
  });
  rtl.createClass(this,"TJSONValue",this.TJSONAncestor,function () {
    this.$init = function () {
      $mod.TJSONAncestor.$init.call(this);
      this.fjv = undefined;
      this.fjo = undefined;
    };
    this.GetStrValue = function () {
      var Result = "";
      Result = "" + this.fjv;
      return Result;
    };
    this.JSONValueFromJS = function (AJSValue) {
      var Result = null;
      var d = 0.0;
      Result = null;
      if (rtl.isArray(AJSValue)) {
        Result = $mod.TJSONArray.$create("Create");
        rtl.as(Result,$mod.TJSONArray).fja = AJSValue;
      } else if (rtl.isObject(AJSValue)) {
        Result = $mod.TJSONObject.$create("Create$2");
        rtl.as(Result,$mod.TJSONObject).fjo$1 = AJSValue;
      } else if (rtl.isString(AJSValue)) {
        Result = $mod.TJSONString.$create("Create");
        rtl.as(Result,$mod.TJSONString).SetStrValue("" + AJSValue);
      } else if (rtl.isNumber(AJSValue)) {
        Result = $mod.TJSONNumber.$create("Create");
        rtl.as(Result,$mod.TJSONNumber).SetStrValue("" + AJSValue);
        d = rtl.getNumber(AJSValue);
        rtl.as(Result,$mod.TJSONNumber).FDouble = d;
        if (pas.System.Frac(d) === 0) rtl.as(Result,$mod.TJSONNumber).FInt = rtl.trunc(AJSValue);
      } else if (pas.JS.isNull(AJSValue)) {
        Result = $mod.TJSONNull.$create("Create")}
       else if (pas.JS.isBoolean(AJSValue)) {
        if (pas.JS.toBoolean(AJSValue)) {
          Result = $mod.TJSONTrue.$create("Create$3")}
         else Result = $mod.TJSONFalse.$create("Create$3");
      };
      if (!(Result != null)) Result = $mod.TJSONNull.$create("Create");
      Result.fjv = AJSValue;
      return Result;
    };
    this.Create$1 = function (AJSValue) {
      pas.System.TObject.Create.call(this);
      this.fjv = AJSValue;
      return this;
    };
    this.ToString = function () {
      var Result = "";
      Result = JSON.stringify(this.fjv);
      return Result;
    };
    this.GetJSValue = function () {
      var Result = undefined;
      Result = this.fjv;
      return Result;
    };
  });
  rtl.createClass(this,"TJSONPair",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.fjo = undefined;
      this.fjv = null;
      this.fjs = null;
    };
    this.$final = function () {
      this.fjv = undefined;
      this.fjs = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.fjs = $mod.TJSONString.$create("Create");
      return this;
    };
    this.Create$2 = function (Str, Value) {
      pas.System.TObject.Create.call(this);
      this.fjs = $mod.TJSONString.$create("Create$2",[Str]);
      this.fjv = Value;
      return this;
    };
    this.Create$3 = function (Str, Value) {
      pas.System.TObject.Create.call(this);
      this.fjs = $mod.TJSONString.$create("Create$2",[Str]);
      this.fjv = $mod.TJSONString.$create("Create$2",[Value]);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"fjs");
      pas.System.TObject.Destroy.call(this);
    };
    this.ToString = function () {
      var Result = "";
      if ($mod.TJSONObject.isPrototypeOf(this.fjv)) {
        Result = '"' + this.fjs.GetStrValue() + '":' + rtl.as(this.fjv,$mod.TJSONObject).ToJSON()}
       else {
        if ((this.fjs !== null) && (this.fjv !== null)) {
          Result = '"' + this.fjs.GetStrValue() + '":' + this.fjv.ToString()}
         else Result = "";
      };
      return Result;
    };
  });
  rtl.createClass(this,"TJSONPairList",pas.Classes.TList,function () {
  });
  rtl.createClass(this,"TJSONObject",this.TJSONValue,function () {
    this.$init = function () {
      $mod.TJSONValue.$init.call(this);
      this.fjo$1 = null;
      this.FMembers = null;
    };
    this.$final = function () {
      this.fjo$1 = undefined;
      this.FMembers = undefined;
      $mod.TJSONValue.$final.call(this);
    };
    this.GetPair = function (I) {
      var Result = null;
      var v = null;
      var l = 0;
      var s = "";
      var jv = undefined;
      if ((this.FMembers.GetCount() === 0) && (this.fjo$1 != null) && (rtl.length(Object.keys(this.fjo$1)) > 0)) {
        l = rtl.length(Object.keys(this.fjo$1));
        if (I < l) {
          jv = this.fjo$1[Object.keys(this.fjo$1)[I]];
          v = this.$class.JSONValueFromJS(jv);
          s = Object.keys(this.fjo$1)[I];
          Result = $mod.TJSONPair.$create("Create$2",[s,v]);
          return Result;
        };
      };
      if ((I >= 0) && (I < this.FMembers.GetCount())) {
        Result = rtl.getObject(this.FMembers.Get(I))}
       else Result = null;
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      if (this.fjo$1 != null) {
        Result = rtl.length(Object.keys(this.fjo$1))}
       else if (this.FMembers != null) {
        Result = this.FMembers.GetCount()}
       else Result = 0;
      return Result;
    };
    this.GetItem = function (Index) {
      var Result = null;
      var jv = undefined;
      jv = this.fjo$1[Object.keys(this.fjo$1)[Index]];
      Result = this.$class.JSONValueFromJS(jv);
      return Result;
    };
    this.SetValues = function (Name, Value) {
      var O = null;
      O = this.fjo$1;
      O[Name] = Value;
    };
    this.AddDescendant = function (Descendent) {
      this.FMembers.Add(Descendent);
    };
    this.Create$2 = function () {
      pas.System.TObject.Create.call(this);
      this.FMembers = $mod.TJSONPairList.$create("Create$1");
      this.fjo$1 = null;
      return this;
    };
    this.Create$3 = function (AObject) {
      pas.System.TObject.Create.call(this);
      this.FMembers = $mod.TJSONPairList.$create("Create$1");
      this.fjo$1 = AObject;
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FMembers");
      pas.System.TObject.Destroy.call(this);
    };
    this.ParseJSONValue = function (data) {
      var Result = null;
      var O = null;
      O = JSON.parse(data);
      Result = this.JSONValueFromJS(O);
      return Result;
    };
    this.GetJSONValue = function (Name) {
      var Result = "";
      var jv = undefined;
      jv = this.fjo$1[Name];
      Result = $impl.JSONObjectToString(jv);
      return Result;
    };
    this.Get = function (Name) {
      var Result = null;
      var jv = undefined;
      var jsv = null;
      var i = 0;
      var p = null;
      Result = null;
      if (this.fjo$1 != null) {
        jv = this.fjo$1[Name];
        if ((jv != undefined) || (jv === null)) {
          Result = $mod.TJSONPair.$create("Create$1");
          jsv = this.$class.JSONValueFromJS(jv);
          Result.fjo = this.fjo$1;
          Result.fjs.SetStrValue(Name);
          Result.fjv = jsv;
        };
      } else {
        for (var $l = 0, $end = this.FMembers.GetCount() - 1; $l <= $end; $l++) {
          i = $l;
          p = rtl.getObject(this.FMembers.Get(i));
          if (p.fjs.ToString() === ('"' + Name + '"')) Result = p;
        };
      };
      return Result;
    };
    this.Get$1 = function (Index) {
      var Result = null;
      Result = this.Get(Object.keys(this.fjo$1)[Index]);
      return Result;
    };
    this.GetValue$1 = function (Name) {
      var Result = null;
      var jp = null;
      Result = null;
      jp = this.Get(Name);
      if (jp != null) {
        Result = jp.fjv;
        Result.fjo = jp.fjo;
      };
      return Result;
    };
    this.GetObjectValue = function (APath) {
      var Result = null;
      Result = this.GetValue$1(APath);
      return Result;
    };
    this.SetValue = function (Name, AValue) {
      var O = null;
      O = this.fjo$1;
      O[Name] = AValue;
    };
    this.SetValue$1 = function (Name, AValue) {
      var O = null;
      O = this.fjo$1;
      O[Name] = AValue;
    };
    this.SetValue$2 = function (Name, AValue) {
      var O = null;
      O = this.fjo$1;
      O[Name] = AValue;
    };
    this.AddPair = function (Pair) {
      var Result = null;
      var o = null;
      if (Pair != null) {
        this.AddDescendant(Pair);
        if (this.fjo$1 != null) {
          o = this.fjo$1;
          if ($mod.TJSONArray.isPrototypeOf(Pair.fjv)) {
            o[Pair.fjs.FValue] = Pair.fjv.fja;
          } else {
            o[Pair.fjs.FValue] = Pair.fjv.fjv;
          };
        };
      };
      Result = this;
      return Result;
    };
    this.AddPair$1 = function (Str, Val) {
      var Result = null;
      this.AddPair($mod.TJSONPair.$create("Create$2",[Str,Val]));
      Result = this;
      return Result;
    };
    this.AddPair$2 = function (Str, Val) {
      var Result = null;
      this.AddPair($mod.TJSONPair.$create("Create$3",[Str,Val]));
      Result = this;
      return Result;
    };
    this.AddPair$3 = function (Str, Val) {
      var Result = null;
      this.AddPair($mod.TJSONPair.$create("Create$2",[Str,$mod.TJSONNumber.$create("Create$3",[Val])]));
      Result = this;
      return Result;
    };
    this.AddPair$4 = function (Str, Val) {
      var Result = null;
      this.AddPair($mod.TJSONPair.$create("Create$2",[Str,$mod.TJSONNumber.$create("Create$4",[Val])]));
      Result = this;
      return Result;
    };
    this.AddPair$5 = function (Str, Val) {
      var Result = null;
      this.AddPair($mod.TJSONPair.$create("Create$2",[Str,$mod.TJSONNumber.$create("Create$5",[Val])]));
      Result = this;
      return Result;
    };
    this.AddPair$6 = function (Str, Val) {
      var Result = null;
      this.AddPair($mod.TJSONPair.$create("Create$2",[Str,$mod.TJSONBool.$create("Create$2",[Val])]));
      Result = this;
      return Result;
    };
    this.RemovePair = function (PairName) {
      var Result = null;
      var o = null;
      var p = null;
      var i = 0;
      Result = null;
      if (this.fjo$1 != null) {
        o = this.fjo$1;
        delete o[PairName];
      } else {
        for (var $l = 0, $end = this.FMembers.GetCount() - 1; $l <= $end; $l++) {
          i = $l;
          p = rtl.getObject(this.FMembers.Get(i));
          if (p.fjs.ToString() === ('"' + PairName + '"')) {
            Result = p;
            this.FMembers.Delete(i);
            break;
          };
        };
      };
      return Result;
    };
    this.ToJSON = function () {
      var Result = "";
      var s = "";
      var Size = 0;
      var I = 0;
      var jp = null;
      if (this.fjo$1 != null) {
        Size = this.GetCount()}
       else Size = this.FMembers.GetCount();
      s = "{";
      if (Size > 0) {
        if (this.fjo$1 != null) {
          jp = this.Get$1(0);
          if (jp != null) {
            s = s + jp.ToString()}
           else s = s + '"' + Object.keys(this.fjo$1)[0] + '":null';
        } else s = s + rtl.getObject(this.FMembers.Get(0)).ToString();
      };
      for (var $l = 1, $end = Size - 1; $l <= $end; $l++) {
        I = $l;
        if (this.fjo$1 != null) {
          jp = this.Get$1(I);
          if (jp != null) {
            s = s + "," + jp.ToString()}
           else s = s + "," + '"' + Object.keys(this.fjo$1)[I] + '":null';
        } else s = s + "," + rtl.getObject(this.FMembers.Get(I)).ToString();
      };
      s = s + "}";
      Result = s;
      return Result;
    };
    this.ToString = function () {
      var Result = "";
      Result = this.ToJSON();
      return Result;
    };
  });
  rtl.createClass(this,"TJSONString",this.TJSONValue,function () {
    this.$init = function () {
      $mod.TJSONValue.$init.call(this);
      this.FValue = "";
    };
    this.GetStrValue = function () {
      var Result = "";
      Result = this.FValue;
      return Result;
    };
    this.SetStrValue = function (Value) {
      this.FValue = Value;
      this.fjv = Value;
      if (pas.System.Assigned(this.fjo)) {
        var s = Object.keys(this.fjo)[0];
        this.fjo[s] = Value;
      };
    };
    this.Create$2 = function (AString) {
      pas.System.TObject.Create.call(this);
      this.fjv = AString;
      this.FValue = AString;
      return this;
    };
  });
  rtl.createClass(this,"TJSONNumber",this.TJSONString,function () {
    this.$init = function () {
      $mod.TJSONString.$init.call(this);
      this.FInt = 0;
      this.FInt64 = 0;
      this.FDouble = 0.0;
    };
    this.GetStrValue = function () {
      var Result = "";
      Result = pas.SysUtils.FloatToStr$1(this.FDouble,pas.SysUtils.TFormatSettings.Invariant());
      return Result;
    };
    this.SetStrValue = function (Value) {
      this.FDouble = pas.SysUtils.StrToFloat$1(Value,pas.SysUtils.TFormatSettings.Invariant());
      if (pas.System.Frac(this.FDouble) === 0) {
        if (!pas.SysUtils.TryStrToInt64$1(Value,{p: this, get: function () {
            return this.p.FInt64;
          }, set: function (v) {
            this.p.FInt64 = v;
          }},pas.SysUtils.TFormatSettings.Invariant())) this.FInt64 = 0;
        this.FInt = this.FInt64;
        this.fjv = this.FInt64;
      } else this.fjv = this.FDouble;
    };
    this.Create$3 = function (ANumber) {
      pas.System.TObject.Create.call(this);
      this.fjv = ANumber;
      this.FInt = ANumber;
      this.FInt64 = ANumber;
      this.FDouble = ANumber;
      return this;
    };
    this.Create$4 = function (ANumber) {
      pas.System.TObject.Create.call(this);
      this.fjv = ANumber;
      this.FInt = ANumber & 0xFFFFFFFF;
      this.FInt64 = ANumber;
      this.FDouble = ANumber;
      return this;
    };
    this.Create$5 = function (ANumber) {
      pas.System.TObject.Create.call(this);
      this.fjv = ANumber;
      this.FInt = pas.System.Trunc(ANumber);
      this.FInt64 = pas.System.Trunc(ANumber);
      this.FDouble = ANumber;
      return this;
    };
  });
  rtl.createClass(this,"TJSONBool",this.TJSONValue,function () {
    this.$init = function () {
      $mod.TJSONValue.$init.call(this);
      this.FBool = false;
    };
    this.SetStrValue = function (Value) {
      var s = "";
      s = pas.SysUtils.UpperCase(Value);
      this.FBool = s === "TRUE";
    };
    this.Create$2 = function (AValue) {
      $mod.TJSONValue.Create$1.call(this,AValue);
      this.FBool = AValue;
      return this;
    };
  });
  rtl.createClass(this,"TJSONTrue",this.TJSONBool,function () {
    this.GetStrValue = function () {
      var Result = "";
      Result = "true";
      return Result;
    };
    this.Create$3 = function () {
      $mod.TJSONBool.Create$2.call(this,true);
      return this;
    };
    this.ToString = function () {
      var Result = "";
      Result = this.GetStrValue();
      return Result;
    };
  });
  rtl.createClass(this,"TJSONFalse",this.TJSONBool,function () {
    this.GetStrValue = function () {
      var Result = "";
      Result = "false";
      return Result;
    };
    this.Create$3 = function () {
      $mod.TJSONBool.Create$2.call(this,false);
      return this;
    };
    this.ToString = function () {
      var Result = "";
      Result = this.GetStrValue();
      return Result;
    };
  });
  rtl.createClass(this,"TJSONNull",this.TJSONValue,function () {
    this.GetStrValue = function () {
      var Result = "";
      Result = "null";
      return Result;
    };
    this.ToString = function () {
      var Result = "";
      Result = this.GetStrValue();
      return Result;
    };
  });
  this.$rtti.$Class("TJSONArray");
  rtl.createClass(this,"TJSONArrayEnumerator",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FJSONArray = null;
      this.FPosition = 0;
    };
    this.$final = function () {
      this.FJSONArray = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function (AJSONArray) {
      pas.System.TObject.Create.call(this);
      this.FJSONArray = AJSONArray;
      this.FPosition = -1;
      return this;
    };
    this.GetCurrent = function () {
      var Result = null;
      Result = this.FJSONArray.GetItem(this.FPosition);
      return Result;
    };
    this.MoveNext = function () {
      var Result = false;
      this.FPosition += 1;
      Result = this.FPosition < this.FJSONArray.GetCount();
      return Result;
    };
  });
  rtl.createClass(this,"TJSONArray",this.TJSONValue,function () {
    this.$init = function () {
      $mod.TJSONValue.$init.call(this);
      this.fja = null;
    };
    this.$final = function () {
      this.fja = undefined;
      $mod.TJSONValue.$final.call(this);
    };
    this.GetItem = function (index) {
      var Result = null;
      var jv = undefined;
      jv = this.GetJA()[index];
      if (rtl.isExt(jv,$mod.TJSONObject,1) || rtl.isExt(jv,$mod.TJSONArray,1)) {
        Result = rtl.getObject(jv)}
       else Result = this.$class.JSONValueFromJS(jv);
      return Result;
    };
    this.SetItem = function (index, Value) {
      if ($mod.TJSONObject.isPrototypeOf(Value)) this.GetJA()[index] = Value.fjo$1;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.GetJA().length;
      return Result;
    };
    this.GetJA = function () {
      var Result = null;
      if (!(this.fja != null)) this.fja = new Array();
      Result = this.fja;
      return Result;
    };
    this.Create$2 = function (AArray) {
      pas.System.TObject.Create.call(this);
      this.fja = AArray;
      return this;
    };
    this.GetEnumerator = function () {
      var Result = null;
      Result = $mod.TJSONArrayEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.Add = function (Element) {
      this.GetJA().push(Element);
    };
    this.Add$1 = function (Element) {
      this.GetJA().push(Element);
    };
    this.Add$2 = function (Element) {
      this.GetJA().push(Element);
    };
    this.Add$3 = function (Element) {
      this.GetJA().push(Element);
    };
    this.Add$4 = function (Element) {
      this.GetJA().push(Element);
    };
    this.Add$5 = function (Element) {
      this.GetJA().push(Element);
    };
    this.Add$6 = function (Element) {
      this.GetJA().push(Element);
    };
    this.AddElement = function (Element) {
      this.GetJA().push(Element);
    };
    this.ToJSON = function () {
      var Result = "";
      Result = this.ToString();
      return Result;
    };
    this.ToString = function () {
      var Result = "";
      var i = 0;
      var jv = null;
      var comma = "";
      Result = "[";
      comma = "";
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        jv = this.GetItem(i);
        if (jv != null) {
          if ($mod.TJSONObject.isPrototypeOf(jv)) {
            Result = Result + comma + rtl.as(jv,$mod.TJSONObject).ToString();
          } else Result = Result + comma + jv.ToString();
          comma = ",";
        };
      };
      Result = Result + "]";
      return Result;
    };
  });
  rtl.createClass(this,"TJSON",pas.System.TObject,function () {
    this.Parse = function (s) {
      var Result = null;
      var O = null;
      O = JSON.parse(s);
      if (rtl.isArray(O)) {
        Result = $mod.TJSONArray.$create("Create$2",[O]);
      } else {
        Result = $mod.TJSONObject.$create("Create$3",[O]);
      };
      return Result;
    };
  });
  $mod.$implcode = function () {
    $impl.JSONObjectToString = function (v) {
      return v+"";
    };
  };
},["TypInfo"]);
rtl.module("WEBLib.Storage",["System","Web","Classes"],function () {
  "use strict";
  var $mod = this;
  this.$rtti.$MethodVar("TStorageChangeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AKey",rtl.string],["AOldValue",rtl.string],["ANewValue",rtl.string],["AURL",rtl.string]]), methodkind: 0});
  rtl.createClass(this,"TLocalStorage",pas.Classes.TComponent,function () {
    this.$init = function () {
      pas.Classes.TComponent.$init.call(this);
      this.FChangePtr = null;
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      pas.Classes.TComponent.$final.call(this);
    };
    this.SetValues = function (AKey, AValue) {
      window.localStorage.setItem(AKey,AValue);
    };
    this.GetValues = function (AKey) {
      var Result = "";
      var s = "";
      s = window.localStorage.getItem(AKey);
      if (!pas.System.Assigned(s)) {
        Result = ""}
       else Result = s;
      return Result;
    };
    this.GetKey = function (AIndex) {
      var Result = "";
      Result = window.localStorage.key(AIndex);
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = window.localStorage.length;
      return Result;
    };
    this.StorageChanged = function (AEvent) {
      var s = "";
      s = AEvent.storageArea + " ";
      if ((this.FOnChange != null) && (pas.System.Pos("OBJECT",pas.SysUtils.UpperCase(s)) > 0)) this.FOnChange(this,AEvent.key,AEvent.oldValue,AEvent.newValue,AEvent.url);
    };
    this.Create$1 = function (AOwner) {
      this.FChangePtr = rtl.createCallback(this,"StorageChanged");
      pas.Classes.TComponent.Create$1.apply(this,arguments);
      window.addEventListener("storage",this.FChangePtr);
      return this;
    };
    this.Destroy = function () {
      window.removeEventListener("storage",this.FChangePtr);
      pas.Classes.TComponent.Destroy.call(this);
    };
    this.Clear = function () {
      window.localStorage.clear();
    };
    this.SetValue = function (AKey, AValue) {
      window.localStorage.setItem(AKey,AValue);
    };
    this.GetValue = function (AKey) {
      var Result = "";
      var s = "";
      s = window.localStorage.getItem(AKey);
      if (!pas.System.Assigned(s)) {
        Result = ""}
       else Result = s;
      return Result;
    };
    this.RemoveKey = function (AKey) {
      window.localStorage.removeItem(AKey);
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("OnChange",0,$mod.$rtti["TStorageChangeEvent"],"FOnChange","FOnChange");
  });
  rtl.createClass(this,"TWebLocalStorage",this.TLocalStorage,function () {
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TSessionStorage",pas.Classes.TComponent,function () {
    this.$init = function () {
      pas.Classes.TComponent.$init.call(this);
      this.FChangePtr = null;
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      pas.Classes.TComponent.$final.call(this);
    };
    this.SetValues = function (AKey, AValue) {
      window.sessionStorage.setItem(AKey,AValue);
    };
    this.GetValues = function (AKey) {
      var Result = "";
      var s = "";
      s = window.sessionStorage.getItem(AKey);
      if (!pas.System.Assigned(s)) {
        Result = ""}
       else Result = s;
      return Result;
    };
    this.GetKey = function (AIndex) {
      var Result = "";
      Result = window.sessionStorage.key(AIndex);
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = window.sessionStorage.length;
      return Result;
    };
    this.StorageChanged = function (AEvent) {
      var s = "";
      s = AEvent.storageArea + " ";
      if ((this.FOnChange != null) && (pas.System.Pos("OBJECT",pas.SysUtils.UpperCase(s)) === 0)) this.FOnChange(this,AEvent.key,AEvent.oldValue,AEvent.newValue,AEvent.url);
    };
    this.Create$1 = function (AOwner) {
      this.FChangePtr = rtl.createCallback(this,"StorageChanged");
      pas.Classes.TComponent.Create$1.apply(this,arguments);
      window.addEventListener("storage",this.FChangePtr);
      return this;
    };
    this.Destroy = function () {
      window.removeEventListener("storage",this.FChangePtr);
      pas.Classes.TComponent.Destroy.call(this);
    };
    this.Clear = function () {
      window.sessionStorage.clear();
    };
    this.SetValue = function (AKey, AValue) {
      window.sessionStorage.setItem(AKey,AValue);
    };
    this.GetValue = function (AKey) {
      var Result = "";
      var s = "";
      s = window.sessionStorage.getItem(AKey);
      if (!pas.System.Assigned(s)) {
        Result = ""}
       else Result = s;
      return Result;
    };
    this.RemoveKey = function (AKey) {
      window.sessionStorage.removeItem(AKey);
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("OnChange",0,$mod.$rtti["TStorageChangeEvent"],"FOnChange","FOnChange");
  });
  rtl.createClass(this,"TWebSessionStorage",this.TSessionStorage,function () {
    rtl.addIntf(this,pas.System.IUnknown);
  });
},["SysUtils"]);
rtl.module("WEBLib.REST",["System","Classes","Web","JS","SysUtils","WEBLib.Controls","WEBLib.JSON"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.ContentTypeJSON = "application/json;charset=UTF-8";
  this.ContentTypeForm = "application/x-www-form-urlencoded";
  this.THTTPCommand = {"0": "httpGET", httpGET: 0, "1": "httpPOST", httpPOST: 1, "2": "httpPUT", httpPUT: 2, "3": "httpDELETE", httpDELETE: 3, "4": "httpHEAD", httpHEAD: 4, "5": "httpPATCH", httpPATCH: 5, "6": "httpCUSTOM", httpCUSTOM: 6};
  this.$rtti.$Enum("THTTPCommand",{minvalue: 0, maxvalue: 6, ordtype: 1, enumtype: this.THTTPCommand});
  this.THTTPRequestResponseType = {"0": "rtDefault", rtDefault: 0, "1": "rtText", rtText: 1, "2": "rtBlob", rtBlob: 2, "3": "rtJSON", rtJSON: 3, "4": "rtDocument", rtDocument: 4, "5": "rtArrayBuffer", rtArrayBuffer: 5};
  this.$rtti.$Enum("THTTPRequestResponseType",{minvalue: 0, maxvalue: 5, ordtype: 1, enumtype: this.THTTPRequestResponseType});
  this.$rtti.$RefToProcVar("THTTPResponseProc",{procsig: rtl.newTIProcSig([["AResponse",rtl.string],["ARequest",pas.Web.$rtti["TJSXMLHttpRequest"]]])});
  this.$rtti.$RefToProcVar("THTTPErrorProc",{procsig: rtl.newTIProcSig([["ARequest",pas.Web.$rtti["TJSXMLHttpRequest"]]])});
  this.$rtti.$RefToProcVar("THTTPRequestHandler",{procsig: rtl.newTIProcSig([["Event",pas.Web.$rtti["TJSEvent"]]])});
  this.$rtti.$MethodVar("THTTPProgressEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Position",rtl.nativeint],["Total",rtl.nativeint]]), methodkind: 0});
  rtl.createClass(this,"THttpRequest",pas.Classes.TComponent,function () {
    this.$init = function () {
      pas.Classes.TComponent.$init.call(this);
      this.FURL = "";
      this.FOnResponse = null;
      this.FOnAbort = null;
      this.FHeaders = null;
      this.FCommand = 0;
      this.FCustomCommand = "";
      this.FWithCredentials = false;
      this.FPostData = "";
      this.FOnRequestResponse = null;
      this.FPassword = "";
      this.FUser = "";
      this.FTimeout = 0;
      this.FOnTimeout = null;
      this.FOnError = null;
      this.FResponse = null;
      this.FErrorProc = null;
      this.FTimeOutProc = null;
      this.FResponseType = 0;
      this.FOnProgress = null;
    };
    this.$final = function () {
      this.FOnResponse = undefined;
      this.FOnAbort = undefined;
      this.FHeaders = undefined;
      this.FOnRequestResponse = undefined;
      this.FOnTimeout = undefined;
      this.FOnError = undefined;
      this.FResponse = undefined;
      this.FErrorProc = undefined;
      this.FTimeOutProc = undefined;
      this.FOnProgress = undefined;
      pas.Classes.TComponent.$final.call(this);
    };
    this.HandleResponse = function (Event) {
      var Result = false;
      var s = "";
      var LRequestRec = pas["WEBLib.Controls"].TJSXMLHttpRequestRecord.$new();
      LRequestRec.req = Event.target;
      s = "";
      if (this.FResponseType in rtl.createSet($mod.THTTPRequestResponseType.rtText,$mod.THTTPRequestResponseType.rtDefault)) {
        s = Event.target.responseText;
      };
      if (this.FOnRequestResponse != null) {
        this.FOnRequestResponse(this,pas["WEBLib.Controls"].TJSXMLHttpRequestRecord.$clone(LRequestRec),s);
      };
      if (this.FOnResponse != null) this.FOnResponse(this,s);
      if (this.FResponse != null) {
        this.FResponse(s,LRequestRec.req);
      };
      Result = true;
      return Result;
    };
    this.HandleAbort = function (Event) {
      var Result = false;
      if (this.FOnAbort != null) this.FOnAbort(this);
      Result = true;
      return Result;
    };
    this.HandleTimeout = function (Event) {
      var Result = false;
      if (this.FOnTimeout != null) this.FOnTimeout(this);
      if (this.FTimeOutProc != null) this.FTimeOutProc(Event.target);
      Result = true;
      return Result;
    };
    this.HandleError = function (Event) {
      var Result = false;
      var Handled = false;
      var LEventRec = pas["WEBLib.Controls"].TJSEventRecord.$new();
      var LRequestRec = pas["WEBLib.Controls"].TJSXMLHttpRequestRecord.$new();
      Result = true;
      Handled = false;
      if (this.FOnError != null) {
        LEventRec.event = Event;
        LRequestRec.req = Event.target;
        this.FOnError(this,pas["WEBLib.Controls"].TJSXMLHttpRequestRecord.$clone(LRequestRec),pas["WEBLib.Controls"].TJSEventRecord.$clone(LEventRec),{get: function () {
            return Handled;
          }, set: function (v) {
            Handled = v;
          }});
      };
      if (this.FErrorProc != null) this.FErrorProc(LRequestRec.req);
      if (!Handled) throw pas.SysUtils.Exception.$create("Create$1",["HTTP request error @" + this.FURL]);
      return Result;
    };
    this.HandleProgress = function (Event) {
      var Result = false;
      var position = 0;
      var total = 0;
      Result = true;
      position = Event.loaded;
      total = Event.total;
      if (this.FOnProgress != null) this.FOnProgress(this,position,total);
      return Result;
    };
    this.HandleReadyStateChange = function (Event) {
      var Result = false;
      var LRequestRec = pas["WEBLib.Controls"].TJSXMLHttpRequestRecord.$new();
      var sz = "";
      Result = true;
      LRequestRec.req = Event.target;
      if (LRequestRec.req.readyState === 4) {
        if ((LRequestRec.req.status >= 200) && (LRequestRec.req.status < 300)) {
          sz = LRequestRec.req.getResponseHeader("Content-Length");
          if (this.FResponse != null) {
            this.FResponse(sz,LRequestRec.req);
          };
        } else if (this.FErrorProc != null) this.FErrorProc(LRequestRec.req);
      };
      return Result;
    };
    this.SetHeaders = function (AValue) {
      this.FHeaders.Assign(AValue);
    };
    this.Create$1 = function (AOwner) {
      pas.Classes.TComponent.Create$1.apply(this,arguments);
      this.FHeaders = pas.Classes.TStringList.$create("Create$1");
      this.FResponseType = $mod.THTTPRequestResponseType.rtDefault;
      this.FCommand = $mod.THTTPCommand.httpGET;
      this.FTimeout = 0;
      this.FResponse = null;
      this.FWithCredentials = false;
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FHeaders");
      pas.Classes.TComponent.Destroy.call(this);
    };
    this.Loaded = function () {
      var i = 0;
      var j = 0;
      var s = "";
      var flg = false;
      pas.Classes.TComponent.Loaded.call(this);
      for (var $l = 0, $end = this.FHeaders.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        s = this.FHeaders.Get(i);
        flg = false;
        for (var $l1 = 1, $end1 = s.length; $l1 <= $end1; $l1++) {
          j = $l1;
          if ((s.charAt(j - 1) === ":") && !flg) {
            s = rtl.setCharAt(s,j - 1,"=");
            flg = true;
          } else if ((s.charAt(j - 1) === "=") && flg) {
            s = rtl.setCharAt(s,j - 1,":");
          };
        };
        this.FHeaders.Put(i,s);
      };
    };
    this.GetResponseType = function (AResponseType) {
      var Result = "";
      Result = "";
      var $tmp = AResponseType;
      if ($tmp === $mod.THTTPRequestResponseType.rtText) {
        Result = "text"}
       else if ($tmp === $mod.THTTPRequestResponseType.rtBlob) {
        Result = "blob"}
       else if ($tmp === $mod.THTTPRequestResponseType.rtDocument) {
        Result = "document"}
       else if ($tmp === $mod.THTTPRequestResponseType.rtJSON) {
        Result = "json"}
       else if ($tmp === $mod.THTTPRequestResponseType.rtArrayBuffer) Result = "arraybuffer";
      return Result;
    };
    this.ExecuteSizeRequest = function (AResponse, AError, ATimeOut) {
      var i = 0;
      var req = null;
      var headname = "";
      var headvalue = "";
      this.FResponse = AResponse;
      this.FErrorProc = AError;
      this.FTimeOutProc = ATimeOut;
      req = new XMLHttpRequest();
      req.addEventListener("readystatechange",rtl.createSafeCallback(this,"HandleReadyStateChange"));
      req.addEventListener("timeout",rtl.createSafeCallback(this,"HandleTimeout"));
      req.addEventListener("error",rtl.createSafeCallback(this,"HandleError"));
      req.withCredentials = this.FWithCredentials;
      if (this.FTimeout !== 0) req.timeout = this.FTimeout;
      if (this.FUser !== "") {
        req.open("HEAD",this.FURL,true,this.FUser,this.FPassword);
        req.setRequestHeader("X-Requested-With","XMLHttpRequest");
      } else req.open("HEAD",this.FURL);
      for (var $l = 0, $end = this.FHeaders.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        this.FHeaders.GetNameValue(i,{get: function () {
            return headname;
          }, set: function (v) {
            headname = v;
          }},{get: function () {
            return headvalue;
          }, set: function (v) {
            headvalue = v;
          }});
        req.setRequestHeader(headname,headvalue);
      };
      if (this.FUser !== "") req.setRequestHeader("Authorization","Basic " + window.btoa(this.FUser + ":" + this.FPassword));
      req.send();
    };
    this.Execute = function (AResponse) {
      this.Execute$2(AResponse,null,null);
    };
    this.Execute$1 = function (AResponse, AError) {
      this.Execute$2(AResponse,AError,null);
    };
    this.Execute$2 = function (AResponse, AError, ATimeOut) {
      var i = 0;
      var cmd = "";
      var req = null;
      var headname = "";
      var headvalue = "";
      this.FResponse = AResponse;
      this.FErrorProc = AError;
      this.FTimeOutProc = ATimeOut;
      req = new XMLHttpRequest();
      req.addEventListener("load",rtl.createSafeCallback(this,"HandleResponse"));
      req.addEventListener("abort",rtl.createSafeCallback(this,"HandleAbort"));
      req.addEventListener("timeout",rtl.createSafeCallback(this,"HandleTimeout"));
      req.addEventListener("error",rtl.createSafeCallback(this,"HandleError"));
      req.addEventListener("progress",rtl.createSafeCallback(this,"HandleProgress"));
      req.responseType = $mod.THttpRequest.GetResponseType(this.FResponseType);
      req.withCredentials = this.FWithCredentials;
      cmd = $mod.HTTPCommand(this.FCommand,this.FCustomCommand);
      if (this.FTimeout !== 0) req.timeout = this.FTimeout;
      if (this.FUser !== "") {
        req.open(cmd,this.FURL,true);
        req.setRequestHeader("X-Requested-With","XMLHttpRequest");
      } else req.open(cmd,this.FURL);
      for (var $l = 0, $end = this.FHeaders.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        this.FHeaders.GetNameValue(i,{get: function () {
            return headname;
          }, set: function (v) {
            headname = v;
          }},{get: function () {
            return headvalue;
          }, set: function (v) {
            headvalue = v;
          }});
        req.setRequestHeader(headname,headvalue);
      };
      if (this.FUser !== "") req.setRequestHeader("Authorization","Basic " + window.btoa(this.FUser + ":" + this.FPassword));
      if (this.FPostData !== "") {
        req.send(this.FPostData)}
       else req.send();
    };
    this.GetSize = function () {
      var $Self = this;
      var Result = null;
      var sz = 0;
      var e = 0;
      Result = new Promise(function (ASuccess, AFailed) {
        $Self.ExecuteSizeRequest(function (AResponse, ARequest) {
          pas.System.val(AResponse,{get: function () {
              return sz;
            }, set: function (v) {
              sz = v;
            }},{get: function () {
              return e;
            }, set: function (v) {
              e = v;
            }});
          ASuccess(sz);
        },function (ARequest) {
          AFailed(0);
        },function (ARequest) {
          AFailed(ARequest);
        });
      });
      return Result;
    };
    this.Perform = function () {
      var $Self = this;
      var Result = null;
      Result = new Promise(function (ASuccess, AFailed) {
        $Self.Execute$2(function (AResponse, ARequest) {
          ASuccess(ARequest);
        },function (ARequest) {
          AFailed(ARequest);
        },function (ARequest) {
          AFailed(ARequest);
        });
      });
      return Result;
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Command",0,$mod.$rtti["THTTPCommand"],"FCommand","FCommand");
    $r.addProperty("CustomCommand",0,rtl.string,"FCustomCommand","FCustomCommand");
    $r.addProperty("Headers",2,pas.Classes.$rtti["TStringList"],"FHeaders","SetHeaders");
    $r.addProperty("Password",0,rtl.string,"FPassword","FPassword");
    $r.addProperty("PostData",0,rtl.string,"FPostData","FPostData");
    $r.addProperty("ResponseType",0,$mod.$rtti["THTTPRequestResponseType"],"FResponseType","FResponseType",4,{Default: $mod.THTTPRequestResponseType.rtDefault});
    $r.addProperty("Timeout",0,rtl.longint,"FTimeout","FTimeout",4,{Default: 0});
    $r.addProperty("URL",0,rtl.string,"FURL","FURL");
    $r.addProperty("User",0,rtl.string,"FUser","FUser");
    $r.addProperty("WithCredentials",0,rtl.boolean,"FWithCredentials","FWithCredentials",4,{Default: false});
    $r.addProperty("OnError",0,pas["WEBLib.Controls"].$rtti["THTTPErrorEvent"],"FOnError","FOnError");
    $r.addProperty("OnAbort",0,pas["WEBLib.Controls"].$rtti["THTTPAbortEvent"],"FOnAbort","FOnAbort");
    $r.addProperty("OnProgress",0,$mod.$rtti["THTTPProgressEvent"],"FOnProgress","FOnProgress");
    $r.addProperty("OnRequestResponse",0,pas["WEBLib.Controls"].$rtti["THTTPRequestResponseEvent"],"FOnRequestResponse","FOnRequestResponse");
    $r.addProperty("OnResponse",0,pas["WEBLib.Controls"].$rtti["THTTPResponseEvent"],"FOnResponse","FOnResponse");
    $r.addProperty("OnTimeout",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnTimeout","FOnTimeout");
  });
  rtl.createClass(this,"TWebHTTPRequest",this.THttpRequest,function () {
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.$rtti.$MethodVar("THttpResponse",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AResponse",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TInternalHttpResponse",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AResponse",rtl.string],["Handled",rtl.boolean,1]]), methodkind: 0});
  rtl.createClass(this,"TPersistTokens",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FKey = "";
      this.FEnabled = false;
    };
    this.Create$1 = function () {
      this.FEnabled = false;
      this.FKey = "";
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TPersistTokens.isPrototypeOf(Source)) {
        this.FKey = rtl.as(Source,$mod.TPersistTokens).FKey;
        this.FEnabled = rtl.as(Source,$mod.TPersistTokens).FEnabled;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Key",0,rtl.string,"FKey","FKey");
    $r.addProperty("Enabled",0,rtl.boolean,"FEnabled","FEnabled",4,{Default: false});
  });
  rtl.createClass(this,"TRESTApp",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FKey = "";
      this.FCallbackURL = "";
      this.FSecret = "";
      this.FAuthURL = "";
      this.FClientID = "";
    };
    this.GetKey = function () {
      var Result = "";
      if ((this.FKey !== "") && (this.FClientID === "")) {
        Result = this.FKey}
       else Result = this.FClientID;
      return Result;
    };
    this.Assign = function (Source) {
      if ($mod.TRESTApp.isPrototypeOf(Source)) {
        this.FKey = rtl.as(Source,$mod.TRESTApp).FKey;
        this.FClientID = rtl.as(Source,$mod.TRESTApp).FClientID;
        this.FCallbackURL = rtl.as(Source,$mod.TRESTApp).FCallbackURL;
        this.FSecret = rtl.as(Source,$mod.TRESTApp).FSecret;
        this.FAuthURL = rtl.as(Source,$mod.TRESTApp).FAuthURL;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("AuthURL",0,rtl.string,"FAuthURL","FAuthURL");
    $r.addProperty("ClientID",0,rtl.string,"FClientID","FClientID");
    $r.addProperty("Key",0,rtl.string,"FKey","FKey");
    $r.addProperty("CallbackURL",0,rtl.string,"FCallbackURL","FCallbackURL");
    $r.addProperty("Secret",0,rtl.string,"FSecret","FSecret");
  });
  this.TAuthLocale = {"0": "lcDefault", lcDefault: 0, "1": "lcEnglish", lcEnglish: 1, "2": "lcDutch", lcDutch: 2, "3": "lcGerman", lcGerman: 3, "4": "lcFrench", lcFrench: 4, "5": "lcSpanish", lcSpanish: 5, "6": "lcItalian", lcItalian: 6, "7": "lcPortuguese", lcPortuguese: 7, "8": "lcGreek", lcGreek: 8, "9": "lcDanish", lcDanish: 9, "10": "lcRussian", lcRussian: 10, "11": "lcRomanian", lcRomanian: 11, "12": "lcSwedish", lcSwedish: 12, "13": "lcFinnish", lcFinnish: 13, "14": "lcTurkish", lcTurkish: 14, "15": "lcJapanese", lcJapanese: 15};
  this.$rtti.$Enum("TAuthLocale",{minvalue: 0, maxvalue: 15, ordtype: 1, enumtype: this.TAuthLocale});
  rtl.recNewT(this,"TCoreCloudHeader",function () {
    this.header = "";
    this.value = "";
    this.$eq = function (b) {
      return (this.header === b.header) && (this.value === b.value);
    };
    this.$assign = function (s) {
      this.header = s.header;
      this.value = s.value;
      return this;
    };
    var $r = $mod.$rtti.$Record("TCoreCloudHeader",{},this);
    $r.addField("header",rtl.string);
    $r.addField("value",rtl.string);
  });
  this.$rtti.$DynArray("TCoreCloudHeaders",{eltype: this.$rtti["TCoreCloudHeader"]});
  rtl.createClass(this,"TRESTClient",pas.Classes.TComponent,function () {
    this.$init = function () {
      pas.Classes.TComponent.$init.call(this);
      this.FAPIBase = "";
      this.FAccessToken = "";
      this.FRefreshToken = "";
      this.FAccessExpiry = 0.0;
      this.FRefreshExpiry = 0.0;
      this.FOnAccessToken = null;
      this.FOnAuthFailed = null;
      this.FEventRegistered = false;
      this.FOnResponse = null;
      this.FPersistTokens = null;
      this.FOnHttpResponse = null;
      this.FApp = null;
      this.FScopes = null;
      this.FLocale = 0;
      this.FOnRequestResponse = null;
      this.FOnError = null;
      this.FResponseType = 0;
      this.FLoginWidth = 0;
      this.FLoginHeight = 0;
      this.FHandleAccessTokenPtr = null;
      this.FHandleAuthClosePtr = null;
      this.FOpenResolver = null;
      this.FWithCredentials = false;
    };
    this.$final = function () {
      this.FOnAccessToken = undefined;
      this.FOnAuthFailed = undefined;
      this.FOnResponse = undefined;
      this.FPersistTokens = undefined;
      this.FOnHttpResponse = undefined;
      this.FApp = undefined;
      this.FScopes = undefined;
      this.FOnRequestResponse = undefined;
      this.FOnError = undefined;
      this.FOpenResolver = undefined;
      pas.Classes.TComponent.$final.call(this);
    };
    this.SetPersistTokens = function (Value) {
      this.FPersistTokens.Assign(Value);
    };
    this.SetApp = function (Value) {
      this.FApp.Assign(Value);
    };
    this.SetScopes = function (Value) {
      this.FScopes.Assign(Value);
    };
    this.AuthWinClosed = function () {
      if (this.FEventRegistered) this.DoAuthFailed();
    };
    this.InstallCallback = function () {
      var Result = false;
      var scriptsrc = "";
      scriptsrc = " function processAuthData(access_token) {" + 'var event = new CustomEvent("oauthcallback", {\r' + "            detail: {\r" + "                 message: access_token\r" + "            },\r" + "  bubbles: true,\r" + "  cancelable: true});\r" + "  document.dispatchEvent(event);" + "}";
      var script = document.createElement("script");
          script.innerHTML = scriptsrc;
          document.head.appendChild(script);
      
          var scr = document.createElement('script');
          scr.async = true;
          scr.defer = true;
          scr.type = 'text/javascript';
          document.body.appendChild(scr);
      Result = true;
      return Result;
    };
    this.RemoveOAuthHandler = function () {
      document.removeEventListener("oauthcallback",this.FHandleAccessTokenPtr);
      this.FEventRegistered = false;
    };
    this.DoAuthFailed = function () {
      if (this.FOnAuthFailed != null) this.FOnAuthFailed(this);
      if (this.FOpenResolver != null) {
        this.FOpenResolver(false);
        this.FOpenResolver = null;
      };
    };
    this.DoAuthSuccess = function () {
      if (this.FOpenResolver != null) {
        this.FOpenResolver(true);
        this.FOpenResolver = null;
      };
    };
    this.HandleAccessToken = function (s) {
      var Result = false;
      var token = "";
      this.RemoveOAuthHandler();
      token = s.detail.message;
      this.FAccessToken = token;
      this.WriteTokens();
      if (this.FOnAccessToken != null) this.FOnAccessToken(this);
      if (this.FOpenResolver != null) {
        this.FOpenResolver(true);
        this.FOpenResolver = null;
      };
      Result = true;
      return Result;
    };
    this.HandleResponse = function (Event) {
      var Result = false;
      var Response = "";
      var Handled = false;
      var LRequestRec = pas["WEBLib.Controls"].TJSXMLHttpRequestRecord.$new();
      LRequestRec.req = Event.target;
      Response = "";
      if (this.FResponseType in rtl.createSet($mod.THTTPRequestResponseType.rtText,$mod.THTTPRequestResponseType.rtDefault)) {
        Response = Event.target.responseText;
      };
      Handled = false;
      if (this.FOnHttpResponse != null) this.FOnHttpResponse(this,Response,{get: function () {
          return Handled;
        }, set: function (v) {
          Handled = v;
        }});
      if ((this.FOnRequestResponse != null) && !Handled) this.FOnRequestResponse(this,pas["WEBLib.Controls"].TJSXMLHttpRequestRecord.$clone(LRequestRec),Response);
      if ((this.FOnResponse != null) && !Handled) this.FOnResponse(this,Response);
      Result = true;
      return Result;
    };
    this.GetAuthURL = function () {
      var Result = "";
      Result = this.FApp.FAuthURL;
      return Result;
    };
    this.ScopeParamText = function (Delimiter, Encode) {
      var Result = "";
      var i = 0;
      var scopestr = "";
      Result = "";
      for (var $l = 0, $end = this.FScopes.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (Encode) {
          scopestr = encodeURIComponent(this.FScopes.Get(i))}
         else scopestr = this.FScopes.Get(i);
        if (Result === "") {
          Result = scopestr}
         else Result = Result + Delimiter + scopestr;
      };
      return Result;
    };
    this.GetLocaleParam = function () {
      var Result = "";
      Result = "";
      return Result;
    };
    this.GetJSONValue = function (o, ID) {
      var Result = null;
      var js = undefined;
      var res = false;
      var jvb = false;
      Result = null;
      js = o.fjo$1[ID];
      res = false;
      res = (js != undefined);
      if (res) {
        if (pas.JS.isBoolean(js)) {
          jvb = js;
          if (jvb) {
            Result = pas["WEBLib.JSON"].TJSONTrue.$create("Create$3")}
           else Result = pas["WEBLib.JSON"].TJSONFalse.$create("Create$3");
        };
        Result = pas["WEBLib.JSON"].TJSONValue.$create("Create$1",[js]);
      };
      return Result;
    };
    this.GetJSONObject = function (o, ID) {
      var Result = null;
      var ro = null;
      var jv = undefined;
      jv = o.fjo$1[ID];
      ro = jv;
      if (rtl.isArray(ro)) {
        Result = pas["WEBLib.JSON"].TJSONArray.$create("Create$2",[ro]);
      } else {
        Result = pas["WEBLib.JSON"].TJSONObject.$create("Create$3",[ro]);
      };
      return Result;
    };
    this.TMSUTF8Encode = function (s) {
      var Result = "";
      Result = s;
      return Result;
    };
    this.HttpRequestEvent = function (Command, URL, Data, ContentType, headers, AResponse, AError, ATimeOut) {
      var i = 0;
      var req = null;
      req = new XMLHttpRequest();
      req.addEventListener("load",rtl.createSafeCallback(null,AResponse));
      req.addEventListener("error",rtl.createSafeCallback(null,AError));
      req.addEventListener("timeout",rtl.createSafeCallback(null,ATimeOut));
      req.withCredentials = this.FWithCredentials;
      req.responseType = $mod.THttpRequest.GetResponseType(this.FResponseType);
      req.open(Command,URL,true);
      if (ContentType !== "") req.setRequestHeader("Content-Type",ContentType);
      if (this.FAccessToken !== "") req.setRequestHeader("Authorization","Bearer " + this.FAccessToken);
      if (rtl.length(headers) > 0) {
        for (var $l = 0, $end = rtl.length(headers) - 1; $l <= $end; $l++) {
          i = $l;
          req.setRequestHeader(headers[i].header,headers[i].value);
        };
      };
      if (Data === "") {
        req.send(null)}
       else req.send(Data);
    };
    this.Create$1 = function (AOwner) {
      pas.Classes.TComponent.Create$1.apply(this,arguments);
      this.FPersistTokens = $mod.TPersistTokens.$create("Create$1");
      this.FApp = $mod.TRESTApp.$create("Create");
      this.FScopes = pas.Classes.TStringList.$create("Create$1");
      this.FLocale = $mod.TAuthLocale.lcDefault;
      this.FResponseType = $mod.THTTPRequestResponseType.rtDefault;
      this.FWithCredentials = false;
      this.FLoginWidth = 800;
      this.FLoginHeight = 600;
      this.FHandleAccessTokenPtr = rtl.createCallback(this,"HandleAccessToken");
      return this;
    };
    this.Destroy = function () {
      if (this.FHandleAuthClosePtr != null) this.FHandleAuthClosePtr = null;
      rtl.free(this,"FApp");
      rtl.free(this,"FScopes");
      rtl.free(this,"FPersistTokens");
      pas.Classes.TComponent.Destroy.call(this);
    };
    this.HttpsCommand = function (Command, URL, Data, ContentType, headers) {
      var $Self = this;
      var i = 0;
      var req = null;
      var FRequestResponse = null;
      var FResponse = null;
      var FHttpResponse = null;
      function ResponseHandler(Event) {
        var Result = false;
        var Response = "";
        var Handled = false;
        var LRequestRec = pas["WEBLib.Controls"].TJSXMLHttpRequestRecord.$new();
        LRequestRec.req = Event.target;
        Response = Event.target.responseText;
        Handled = false;
        if (FHttpResponse != null) FHttpResponse($Self,Response,{get: function () {
            return Handled;
          }, set: function (v) {
            Handled = v;
          }});
        if ((FRequestResponse != null) && !Handled) {
          FRequestResponse($Self,pas["WEBLib.Controls"].TJSXMLHttpRequestRecord.$clone(LRequestRec),Response);
        };
        if ((FResponse != null) && !Handled) {
          FResponse($Self,Response);
        };
        Result = true;
        return Result;
      };
      function ErrorHandler(Event) {
        var Result = false;
        var Handled = false;
        var LEventRec = pas["WEBLib.Controls"].TJSEventRecord.$new();
        var LRequestRec = pas["WEBLib.Controls"].TJSXMLHttpRequestRecord.$new();
        Handled = false;
        if ($Self.FOnError != null) {
          LRequestRec.req = Event.target;
          LEventRec.event = Event;
          $Self.FOnError($Self,pas["WEBLib.Controls"].TJSXMLHttpRequestRecord.$clone(LRequestRec),pas["WEBLib.Controls"].TJSEventRecord.$clone(LEventRec),{get: function () {
              return Handled;
            }, set: function (v) {
              Handled = v;
            }});
        };
        if (!Handled) throw pas.SysUtils.Exception.$create("Create$1",["HTTP request error @" + URL]);
        Result = true;
        return Result;
      };
      FRequestResponse = this.FOnRequestResponse;
      FResponse = this.FOnResponse;
      FHttpResponse = this.FOnHttpResponse;
      req = new XMLHttpRequest();
      req.addEventListener("load",rtl.createSafeCallback(null,ResponseHandler));
      req.addEventListener("error",rtl.createSafeCallback(null,ErrorHandler));
      req.responseType = $mod.THttpRequest.GetResponseType(this.FResponseType);
      req.open(Command,URL,true);
      if (ContentType !== "") req.setRequestHeader("Content-Type",ContentType);
      if (this.FAccessToken !== "") req.setRequestHeader("Authorization","Bearer " + this.FAccessToken);
      if (rtl.length(headers) > 0) {
        for (var $l = 0, $end = rtl.length(headers) - 1; $l <= $end; $l++) {
          i = $l;
          req.setRequestHeader(headers[i].header,headers[i].value);
        };
      };
      if (Data === "") {
        req.send(null)}
       else req.send(Data);
    };
    this.HttpsDelete = function (URL) {
      this.HttpsCommand("DELETE",URL,"","",[]);
    };
    this.HttpsDelete$1 = function (URL, headers) {
      this.HttpsCommand("DELETE",URL,"","",rtl.arrayRef(headers));
    };
    this.HttpsGet = function (URL) {
      this.HttpsCommand("GET",URL,"","",[]);
    };
    this.HttpsGet$1 = function (URL, headers) {
      this.HttpsCommand("GET",URL,"","",rtl.arrayRef(headers));
    };
    this.HttpsPost = function (URL, Data) {
      this.HttpsPost$1(URL,"",Data);
    };
    this.HttpsPost$1 = function (URL, ContentType, Data) {
      this.HttpsCommand("POST",URL,Data,ContentType,[]);
    };
    this.HttpsPost$2 = function (URL, ContentType, Data, headers) {
      this.HttpsCommand("POST",URL,Data,ContentType,rtl.arrayRef(headers));
    };
    this.HttpsPost$3 = function (URL, headers, Data) {
      this.HttpsCommand("POST",URL,Data,"",rtl.arrayRef(headers));
    };
    this.HttpsUpdate = function (URL, headers, Data) {
      this.HttpsCommand("PUT",URL,Data,"",rtl.arrayRef(headers));
    };
    this.HttpsPut = function (URL, ContentType, Data) {
      this.HttpsCommand("PUT",URL,Data,ContentType,[]);
    };
    this.HttpRequest = function (Command, URL, Data, ContentType, headers) {
      var $Self = this;
      var Result = null;
      Result = new Promise(function (ASuccess, AFailed) {
        var i = 0;
        var req = null;
        var FRequestResponse = null;
        var FResponse = null;
        var FHttpResponse = null;
        function ResponseHandler(Event) {
          var Result = false;
          ASuccess(Event.target);
          return Result;
        };
        function ErrorHandler(Event) {
          var Result = false;
          AFailed(Event.target);
          return Result;
        };
        req = new XMLHttpRequest();
        req.addEventListener("load",rtl.createSafeCallback(null,ResponseHandler));
        req.addEventListener("error",rtl.createSafeCallback(null,ErrorHandler));
        req.withCredentials = $Self.FWithCredentials;
        req.responseType = $mod.THttpRequest.GetResponseType($Self.FResponseType);
        req.open(Command,URL,true);
        if (ContentType !== "") req.setRequestHeader("Content-Type",ContentType);
        if ($Self.FAccessToken !== "") req.setRequestHeader("Authorization","Bearer " + $Self.FAccessToken);
        if (rtl.length(headers) > 0) {
          for (var $l = 0, $end = rtl.length(headers) - 1; $l <= $end; $l++) {
            i = $l;
            req.setRequestHeader(headers[i].header,headers[i].value);
          };
        };
        if (Data === "") {
          req.send(null)}
         else req.send(Data);
      });
      return Result;
    };
    this.URLEncode = function (URI) {
      var Result = "";
      Result = encodeURIComponent(URI);
      return Result;
    };
    this.JSONEscape = function (s) {
      var Result = "";
      Result = encodeURIComponent(s);
      return Result;
    };
    this.IsoToDateTime = function (s) {
      var Result = 0.0;
      var da = 0;
      var mo = 0;
      var ye = 0;
      var ho = 0;
      var mi = 0;
      var se = 0;
      var ms = 0;
      var err = 0;
      ms = 0;
      pas.System.val$5(pas.System.Copy(s,1,4),{get: function () {
          return ye;
        }, set: function (v) {
          ye = v;
        }},{get: function () {
          return err;
        }, set: function (v) {
          err = v;
        }});
      pas.System.val$5(pas.System.Copy(s,6,2),{get: function () {
          return mo;
        }, set: function (v) {
          mo = v;
        }},{get: function () {
          return err;
        }, set: function (v) {
          err = v;
        }});
      pas.System.val$5(pas.System.Copy(s,9,2),{get: function () {
          return da;
        }, set: function (v) {
          da = v;
        }},{get: function () {
          return err;
        }, set: function (v) {
          err = v;
        }});
      pas.System.val$5(pas.System.Copy(s,12,2),{get: function () {
          return ho;
        }, set: function (v) {
          ho = v;
        }},{get: function () {
          return err;
        }, set: function (v) {
          err = v;
        }});
      pas.System.val$5(pas.System.Copy(s,15,2),{get: function () {
          return mi;
        }, set: function (v) {
          mi = v;
        }},{get: function () {
          return err;
        }, set: function (v) {
          err = v;
        }});
      pas.System.val$5(pas.System.Copy(s,18,2),{get: function () {
          return se;
        }, set: function (v) {
          se = v;
        }},{get: function () {
          return err;
        }, set: function (v) {
          err = v;
        }});
      if ((s.length >= 20) && (s.charAt(19) === ".")) {
        pas.System.val$5(pas.System.Copy(s,21,3),{get: function () {
            return ms;
          }, set: function (v) {
            ms = v;
          }},{get: function () {
            return err;
          }, set: function (v) {
            err = v;
          }});
      };
      if (ye < 1) ye = 1;
      if (mo < 1) mo = 1;
      if (da < 1) da = 1;
      Result = pas.SysUtils.EncodeDate(ye,mo,da) + pas.SysUtils.EncodeTime(ho,mi,se,ms);
      return Result;
    };
    this.IsoToDateTime$1 = function (s, IsUTC) {
      var Result = 0.0;
      var da = 0;
      var mo = 0;
      var ye = 0;
      var ho = 0;
      var mi = 0;
      var se = 0;
      var ms = 0;
      var HourOffset = 0;
      var MinuteOffset = 0;
      var err = 0;
      var delta = 0;
      var sign = "";
      HourOffset = 0;
      MinuteOffset = 0;
      ms = 0;
      delta = 0;
      pas.System.val$5(pas.System.Copy(s,1,4),{get: function () {
          return ye;
        }, set: function (v) {
          ye = v;
        }},{get: function () {
          return err;
        }, set: function (v) {
          err = v;
        }});
      pas.System.val$5(pas.System.Copy(s,6,2),{get: function () {
          return mo;
        }, set: function (v) {
          mo = v;
        }},{get: function () {
          return err;
        }, set: function (v) {
          err = v;
        }});
      pas.System.val$5(pas.System.Copy(s,9,2),{get: function () {
          return da;
        }, set: function (v) {
          da = v;
        }},{get: function () {
          return err;
        }, set: function (v) {
          err = v;
        }});
      pas.System.val$5(pas.System.Copy(s,12,2),{get: function () {
          return ho;
        }, set: function (v) {
          ho = v;
        }},{get: function () {
          return err;
        }, set: function (v) {
          err = v;
        }});
      pas.System.val$5(pas.System.Copy(s,15,2),{get: function () {
          return mi;
        }, set: function (v) {
          mi = v;
        }},{get: function () {
          return err;
        }, set: function (v) {
          err = v;
        }});
      pas.System.val$5(pas.System.Copy(s,18,2),{get: function () {
          return se;
        }, set: function (v) {
          se = v;
        }},{get: function () {
          return err;
        }, set: function (v) {
          err = v;
        }});
      if ((s.length >= 20) && (s.charAt(19) === ".")) {
        pas.System.val$5(pas.System.Copy(s,21,3),{get: function () {
            return ms;
          }, set: function (v) {
            ms = v;
          }},{get: function () {
            return err;
          }, set: function (v) {
            err = v;
          }});
        delta = 4;
      };
      if (ye < 1) ye = 1;
      if (mo < 1) mo = 1;
      if (da < 1) da = 1;
      if (s.length > (20 + delta)) {
        sign = pas.System.Copy(s,20 + delta,1);
        pas.System.val$6(pas.System.Copy(s,22 + delta,2),{get: function () {
            return HourOffset;
          }, set: function (v) {
            HourOffset = v;
          }},{get: function () {
            return err;
          }, set: function (v) {
            err = v;
          }});
        pas.System.val$6(pas.System.Copy(s,25 + delta,2),{get: function () {
            return MinuteOffset;
          }, set: function (v) {
            MinuteOffset = v;
          }},{get: function () {
            return err;
          }, set: function (v) {
            err = v;
          }});
        if (sign === "-") {
          HourOffset = HourOffset * -1;
          MinuteOffset = MinuteOffset * -1;
        };
      };
      Result = pas.SysUtils.EncodeDate(ye,mo,da) + pas.SysUtils.EncodeTime(ho,mi,se,ms);
      return Result;
    };
    this.IsoToDate = function (s) {
      var Result = 0.0;
      var da = 0;
      var mo = 0;
      var ye = 0;
      var err = 0;
      pas.System.val$5(pas.System.Copy(s,1,4),{get: function () {
          return ye;
        }, set: function (v) {
          ye = v;
        }},{get: function () {
          return err;
        }, set: function (v) {
          err = v;
        }});
      pas.System.val$5(pas.System.Copy(s,6,2),{get: function () {
          return mo;
        }, set: function (v) {
          mo = v;
        }},{get: function () {
          return err;
        }, set: function (v) {
          err = v;
        }});
      pas.System.val$5(pas.System.Copy(s,9,2),{get: function () {
          return da;
        }, set: function (v) {
          da = v;
        }},{get: function () {
          return err;
        }, set: function (v) {
          err = v;
        }});
      if (ye < 1) ye = 1;
      if (mo < 1) mo = 1;
      if (da < 1) da = 1;
      Result = pas.SysUtils.EncodeDate(ye,mo,da) + pas.SysUtils.EncodeTime(0,0,0,0);
      return Result;
    };
    this.IsoToTime = function (s) {
      var Result = 0.0;
      var ho = 0;
      var mi = 0;
      var se = 0;
      var ms = 0;
      var err = 0;
      ms = 0;
      pas.System.val$5(pas.System.Copy(s,1,2),{get: function () {
          return ho;
        }, set: function (v) {
          ho = v;
        }},{get: function () {
          return err;
        }, set: function (v) {
          err = v;
        }});
      pas.System.val$5(pas.System.Copy(s,4,2),{get: function () {
          return mi;
        }, set: function (v) {
          mi = v;
        }},{get: function () {
          return err;
        }, set: function (v) {
          err = v;
        }});
      pas.System.val$5(pas.System.Copy(s,7,2),{get: function () {
          return se;
        }, set: function (v) {
          se = v;
        }},{get: function () {
          return err;
        }, set: function (v) {
          err = v;
        }});
      if (s.length > 10) pas.System.val$5(pas.System.Copy(s,10,4),{get: function () {
          return ms;
        }, set: function (v) {
          ms = v;
        }},{get: function () {
          return err;
        }, set: function (v) {
          err = v;
        }});
      if ((ho < 0) || (ho > 23)) ho = 0;
      if ((mi < 0) || (mi > 59)) mi = 0;
      if ((se < 0) || (se > 59)) se = 0;
      if (ms < 0) ms = 0;
      Result = pas.SysUtils.EncodeTime(ho,mi,se,ms);
      return Result;
    };
    this.IsIsoDateTime = function (s) {
      var Result = false;
      var da = 0;
      var mo = 0;
      var ye = 0;
      var ho = 0;
      var mi = 0;
      var se = 0;
      var err = 0;
      Result = true;
      pas.System.val$5(pas.System.Copy(s,1,4),{get: function () {
          return ye;
        }, set: function (v) {
          ye = v;
        }},{get: function () {
          return err;
        }, set: function (v) {
          err = v;
        }});
      if (err !== 0) return false;
      if (!(pas.System.Copy(s,5,1) === "-")) return false;
      pas.System.val$5(pas.System.Copy(s,6,2),{get: function () {
          return mo;
        }, set: function (v) {
          mo = v;
        }},{get: function () {
          return err;
        }, set: function (v) {
          err = v;
        }});
      if (err !== 0) return false;
      if (!(pas.System.Copy(s,8,1) === "-")) return false;
      pas.System.val$5(pas.System.Copy(s,9,2),{get: function () {
          return da;
        }, set: function (v) {
          da = v;
        }},{get: function () {
          return err;
        }, set: function (v) {
          err = v;
        }});
      if (err !== 0) return false;
      pas.System.val$5(pas.System.Copy(s,12,2),{get: function () {
          return ho;
        }, set: function (v) {
          ho = v;
        }},{get: function () {
          return err;
        }, set: function (v) {
          err = v;
        }});
      if (err === 0) {
        if (!(pas.System.Copy(s,14,1) === ":")) return false;
        pas.System.val$5(pas.System.Copy(s,15,2),{get: function () {
            return mi;
          }, set: function (v) {
            mi = v;
          }},{get: function () {
            return err;
          }, set: function (v) {
            err = v;
          }});
        if (err !== 0) return false;
        if (!(pas.System.Copy(s,17,1) === ":")) return false;
        pas.System.val$5(pas.System.Copy(s,18,2),{get: function () {
            return se;
          }, set: function (v) {
            se = v;
          }},{get: function () {
            return err;
          }, set: function (v) {
            err = v;
          }});
        if (err !== 0) return false;
      };
      return Result;
    };
    this.GetUTCDateTime = function () {
      var Result = 0.0;
      var s = "";
      const nowt = new Date();
      s = nowt.toISOString();
      Result = this.IsoToDateTime(s);
      return Result;
    };
    this.DateTimeToWL = function (dt) {
      var Result = "";
      var da = 0;
      var mo = 0;
      var ye = 0;
      var ho = 0;
      var mi = 0;
      var se = 0;
      var ms = 0;
      pas.SysUtils.DecodeDate(dt,{get: function () {
          return ye;
        }, set: function (v) {
          ye = v;
        }},{get: function () {
          return mo;
        }, set: function (v) {
          mo = v;
        }},{get: function () {
          return da;
        }, set: function (v) {
          da = v;
        }});
      pas.SysUtils.DecodeTime(dt,{get: function () {
          return ho;
        }, set: function (v) {
          ho = v;
        }},{get: function () {
          return mi;
        }, set: function (v) {
          mi = v;
        }},{get: function () {
          return se;
        }, set: function (v) {
          se = v;
        }},{get: function () {
          return ms;
        }, set: function (v) {
          ms = v;
        }});
      Result = pas.SysUtils.IntToStr(ye) + "-" + $impl.IntToZStr(mo,2) + "-" + $impl.IntToZStr(da,2) + "T" + $impl.IntToZStr(ho,2) + ":" + $impl.IntToZStr(mi,2) + ":" + $impl.IntToZStr(se,2);
      Result = Result + "+00:00";
      return Result;
    };
    this.DateToWL = function (dt) {
      var Result = "";
      var da = 0;
      var mo = 0;
      var ye = 0;
      pas.SysUtils.DecodeDate(dt,{get: function () {
          return ye;
        }, set: function (v) {
          ye = v;
        }},{get: function () {
          return mo;
        }, set: function (v) {
          mo = v;
        }},{get: function () {
          return da;
        }, set: function (v) {
          da = v;
        }});
      Result = pas.SysUtils.IntToStr(ye) + "-" + $impl.IntToZStr(mo,2) + "-" + $impl.IntToZStr(da,2);
      return Result;
    };
    this.TimeToWL = function (dt) {
      var Result = "";
      var ho = 0;
      var mi = 0;
      var se = 0;
      var ms = 0;
      pas.SysUtils.DecodeTime(dt,{get: function () {
          return ho;
        }, set: function (v) {
          ho = v;
        }},{get: function () {
          return mi;
        }, set: function (v) {
          mi = v;
        }},{get: function () {
          return se;
        }, set: function (v) {
          se = v;
        }},{get: function () {
          return ms;
        }, set: function (v) {
          ms = v;
        }});
      Result = $impl.IntToZStr(ho,2) + ":" + $impl.IntToZStr(mi,2) + ":" + $impl.IntToZStr(se,2) + "." + pas.SysUtils.IntToStr(ms);
      return Result;
    };
    this.DateTimeToDaylightSavings = function (dt) {
      var Result = 0.0;
      Result = dt;
      return Result;
    };
    this.GetJSONProp = function (O, ID) {
      var Result = "";
      Result = O.GetJSONValue(ID);
      return Result;
    };
    this.GetJSONInt = function (O, ID) {
      var Result = 0;
      var jv = undefined;
      jv = O.fjo$1[ID];
      if (rtl.isNumber(jv)) Result = rtl.trunc(jv);
      return Result;
    };
    this.DoAuth = function () {
      var URL = "";
      var param = "";
      if (!this.FEventRegistered) {
        document.addEventListener("oauthcallback",this.FHandleAccessTokenPtr);
        this.FEventRegistered = true;
      };
      URL = this.GetAuthURL();
      param = "width=" + pas["WEBLib.Utils"].TLongIntHelper.ToString.call({p: this, get: function () {
          return this.p.FLoginWidth;
        }, set: function (v) {
          this.p.FLoginWidth = v;
        }}) + ",height=" + pas["WEBLib.Utils"].TLongIntHelper.ToString.call({p: this, get: function () {
          return this.p.FLoginHeight;
        }, set: function (v) {
          this.p.FLoginHeight = v;
        }}) + ",location=no,toolbar=no,menubar=no";
      this.FHandleAuthClosePtr = rtl.createCallback(this,"AuthWinClosed");
      var authwinfunc = this.FHandleAuthClosePtr;
          var newwindow = window.open(URL, 'oauth', param);
          var timeoutid = 0;
      
          function onWindowClosed() {
            clearTimeout(timeoutid);
            authwinfunc();
          }
      
          function checkWindowClosed() {
           if (newwindow.closed) {
              onWindowClosed();
          } else {
              timeoutid = setTimeout(checkWindowClosed, 1000); // Check every second
          }
          }
      
          checkWindowClosed();
    };
    this.Connect = function () {
      if (this.FPersistTokens.FEnabled) {
        this.ReadTokens();
      };
      if (this.FAccessToken !== "") {
        this.TestTokens();
      } else {
        this.DoAuth();
      };
    };
    this.Open = function () {
      var $Self = this;
      var Result = null;
      Result = new Promise(function (ASuccess, AFailed) {
        $Self.FOpenResolver = ASuccess;
        $Self.Connect();
      });
      return Result;
    };
    this.Authenticate = async function () {
      var $Self = this;
      var Result = null;
      Result = new Promise(function (ASuccess, AFailed) {
        var ptr = null;
        function HandleOAuthCallBack(s) {
          var Result = false;
          var token = "";
          document.removeEventListener("oauthcallback",ptr);
          token = s.detail.message;
          $Self.FAccessToken = token;
          $Self.WriteTokens();
          ASuccess($Self.FAccessToken);
          return Result;
        };
        ptr = HandleOAuthCallBack;
        document.addEventListener("oauthcallback",ptr);
        $Self.DoAuth();
      });
      return Result;
    };
    this.ReadTokens = function () {
      var ls = null;
      if (this.FPersistTokens.FEnabled && (this.FPersistTokens.FKey !== "")) {
        ls = pas["WEBLib.Storage"].TLocalStorage.$create("Create");
        this.FAccessToken = ls.GetValues(this.FPersistTokens.FKey);
        this.FRefreshToken = ls.GetValues(this.FPersistTokens.FKey + "refresh");
        this.FAccessExpiry = this.$class.IsoToDateTime(ls.GetValues(this.FPersistTokens.FKey + "accessexpiry"));
        this.FRefreshExpiry = this.$class.IsoToDateTime(ls.GetValues(this.FPersistTokens.FKey + "refreshexpiry"));
        ls = rtl.freeLoc(ls);
      };
    };
    this.WriteTokens = function () {
      var ls = null;
      if (this.FPersistTokens.FEnabled && (this.FPersistTokens.FKey !== "")) {
        ls = pas["WEBLib.Storage"].TLocalStorage.$create("Create");
        ls.SetValues(this.FPersistTokens.FKey,this.FAccessToken);
        ls.SetValues(this.FPersistTokens.FKey + "refresh",this.FRefreshToken);
        ls.SetValues(this.FPersistTokens.FKey + "accessexpiry",pas["WEBLib.Utils"].TDateTimeHelper.ToIsoString.call({p: this, get: function () {
            return this.p.FAccessExpiry;
          }, set: function (v) {
            this.p.FAccessExpiry = v;
          }},true,false));
        ls.SetValues(this.FPersistTokens.FKey + "refreshexpiry",pas["WEBLib.Utils"].TDateTimeHelper.ToIsoString.call({p: this, get: function () {
            return this.p.FRefreshExpiry;
          }, set: function (v) {
            this.p.FRefreshExpiry = v;
          }},true,false));
        ls = rtl.freeLoc(ls);
      };
    };
    this.TestTokens = async function () {
      if (this.FOnAccessToken != null) this.FOnAccessToken(this);
    };
    this.ClearTokens = function () {
      this.FAccessToken = "";
      this.WriteTokens();
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("App",2,$mod.$rtti["TRESTApp"],"FApp","SetApp");
    $r.addProperty("LoginHeight",0,rtl.longint,"FLoginHeight","FLoginHeight",4,{Default: 600});
    $r.addProperty("LoginWidth",0,rtl.longint,"FLoginWidth","FLoginWidth",4,{Default: 800});
    $r.addProperty("PersistTokens",2,$mod.$rtti["TPersistTokens"],"FPersistTokens","SetPersistTokens");
    $r.addProperty("ResponseType",0,$mod.$rtti["THTTPRequestResponseType"],"FResponseType","FResponseType",4,{Default: $mod.THTTPRequestResponseType.rtDefault});
    $r.addProperty("Scopes",2,pas.Classes.$rtti["TStrings"],"FScopes","SetScopes");
    $r.addProperty("WithCredentials",0,rtl.boolean,"FWithCredentials","FWithCredentials",4,{Default: false});
    $r.addProperty("OnAccessToken",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnAccessToken","FOnAccessToken");
    $r.addProperty("OnAuthFailed",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnAuthFailed","FOnAuthFailed");
    $r.addProperty("OnRequestResponse",0,pas["WEBLib.Controls"].$rtti["THTTPRequestResponseEvent"],"FOnRequestResponse","FOnRequestResponse");
    $r.addProperty("OnResponse",0,$mod.$rtti["THttpResponse"],"FOnResponse","FOnResponse");
    $r.addProperty("OnError",0,pas["WEBLib.Controls"].$rtti["THTTPErrorEvent"],"FOnError","FOnError");
  });
  rtl.createClass(this,"TWebRESTClient",this.TRESTClient,function () {
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.AddHeader = function (AHeaders, Header, Value) {
    AHeaders.set(rtl.arraySetLength(AHeaders.get(),$mod.TCoreCloudHeader,rtl.length(AHeaders.get()) + 1));
    AHeaders.get()[rtl.length(AHeaders.get()) - 1].header = Header;
    AHeaders.get()[rtl.length(AHeaders.get()) - 1].value = Value;
  };
  this.GetArraySize = function (ja) {
    var Result = 0;
    Result = ja.GetCount();
    return Result;
  };
  this.GetArrayItem = function (ja, Index) {
    var Result = null;
    Result = ja.GetItem(Index);
    return Result;
  };
  this.HTTPCommand = function (ACommand, ACustomCommand) {
    var Result = "";
    var cmd = "";
    var $tmp = ACommand;
    if ($tmp === $mod.THTTPCommand.httpGET) {
      cmd = "GET"}
     else if ($tmp === $mod.THTTPCommand.httpPOST) {
      cmd = "POST"}
     else if ($tmp === $mod.THTTPCommand.httpPUT) {
      cmd = "PUT"}
     else if ($tmp === $mod.THTTPCommand.httpDELETE) {
      cmd = "DELETE"}
     else if ($tmp === $mod.THTTPCommand.httpHEAD) {
      cmd = "HEAD"}
     else if ($tmp === $mod.THTTPCommand.httpPATCH) {
      cmd = "PATCH"}
     else if ($tmp === $mod.THTTPCommand.httpCUSTOM) cmd = ACustomCommand;
    Result = cmd;
    return Result;
  };
  $mod.$implcode = function () {
    $impl.IntToZStr = function (i, l) {
      var Result = "";
      var Res = "";
      Res = pas.SysUtils.IntToStr(i);
      while (Res.length < l) Res = "0" + Res;
      Result = Res;
      return Result;
    };
  };
  $mod.$init = function () {
    $mod.TRESTClient.InstallCallback();
  };
},["WEBLib.Storage","WEBLib.Utils"]);
rtl.module("WEBLib.Utils",["System","Types","Web","SysUtils","Math","Classes","JS"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.DayMonday = 1;
  this.DayTuesday = 2;
  this.DayWednesday = 3;
  this.DayThursday = 4;
  this.DayFriday = 5;
  this.DaySaturday = 6;
  this.DaySunday = 7;
  this.MonthJanuary = 1;
  this.MonthFebruary = 2;
  this.MonthMarch = 3;
  this.MonthApril = 4;
  this.MonthMay = 5;
  this.MonthJune = 6;
  this.MonthJuly = 7;
  this.MonthAugust = 8;
  this.MonthSeptember = 9;
  this.MonthOctober = 10;
  this.MonthNovember = 11;
  this.MonthDecember = 12;
  this.$rtti.$Class("TInterfaceList");
  rtl.createClass(this,"EEncodingError",pas.SysUtils.Exception,function () {
  });
  rtl.createClass(this,"EStringStreamError",pas.Classes.EStreamError,function () {
  });
  rtl.createHelper(this,"TBytesHelper",null,function () {
    this.get_Length = function () {
      var Result = 0;
      Result = rtl.length(this.get());
      return Result;
    };
    this.set_Length = function (AValue) {
      this.set(rtl.arraySetLength(this.get(),0,AValue));
    };
    this.Compare = function (ARight) {
      var Result = 0;
      var lCount = 0;
      if ($mod.TBytesHelper.get_Length.call(this) > $mod.TBytesHelper.get_Length.call({get: function () {
          return ARight;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }})) return 1;
      if ($mod.TBytesHelper.get_Length.call(this) < $mod.TBytesHelper.get_Length.call({get: function () {
          return ARight;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }})) return -1;
      Result = 0;
      for (var $l = $mod.TBytesHelper.Low.call(this), $end = $mod.TBytesHelper.High.call(this); $l <= $end; $l++) {
        lCount = $l;
        if (this.get()[lCount] > ARight[lCount]) return 1;
        if (this.get()[lCount] < ARight[lCount]) return -1;
      };
      return Result;
    };
    this.High = function () {
      var Result = 0;
      Result = rtl.length(this.get()) - 1;
      return Result;
    };
    this.Low = function () {
      var Result = 0;
      Result = 0;
      return Result;
    };
    this.SubBytes = function (AStartIndex) {
      var Result = [];
      Result = rtl.arrayCopy(0,this.get(),AStartIndex,$mod.TBytesHelper.get_Length.call(this));
      return Result;
    };
    this.SubBytes$1 = function (AStartIndex, ALength) {
      var Result = [];
      Result = rtl.arrayCopy(0,this.get(),AStartIndex,ALength);
      return Result;
    };
  });
  this.$rtti.$DynArray("TWords",{eltype: rtl.word});
  rtl.createHelper(this,"TWordsHelper",null,function () {
    this.get_Length = function () {
      var Result = 0;
      Result = rtl.length(this.get());
      return Result;
    };
    this.set_Length = function (AValue) {
      this.set(rtl.arraySetLength(this.get(),0,AValue));
    };
    var cBytesPerWord = 2;
    this.FromBytes = function (ABytes) {
      var Result = [];
      var lCount = 0;
      var lLow = 0;
      var lHigh = 0;
      lCount = $mod.TBytesHelper.get_Length.call({get: function () {
          return ABytes;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }});
      if (pas.System.Odd(lCount)) lCount += 1;
      $mod.TWordsHelper.set_Length.call({get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }},rtl.trunc(lCount / 2));
      lCount = $mod.TBytesHelper.Low.call({get: function () {
          return ABytes;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }});
      while (lCount <= $mod.TBytesHelper.High.call({get: function () {
          return ABytes;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }})) {
        lLow = ABytes[lCount];
        if ((lCount + 1) <= $mod.TBytesHelper.High.call({get: function () {
            return ABytes;
          }, set: function (v) {
            rtl.raiseE("EPropReadOnly");
          }})) {
          lHigh = ABytes[lCount + 1]}
         else lHigh = 0;
        Result[rtl.trunc(lCount / 2)] = pas.SysUtils.TWordHelper.FromBytes(lLow,lHigh);
        lCount += 2;
      };
      return Result;
    };
    this.High = function () {
      var Result = 0;
      Result = rtl.length(this.get()) - 1;
      return Result;
    };
    this.Low = function () {
      var Result = 0;
      Result = 0;
      return Result;
    };
    var cBytesPerWord$1 = 2;
    this.ToBytes = function () {
      var Result = [];
      var lLow = 0;
      var lHigh = 0;
      var lCount = 0;
      var lNewIndex = 0;
      $mod.TBytesHelper.set_Length.call({get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }},$mod.TWordsHelper.get_Length.call(this) * 2);
      for (var $l = $mod.TWordsHelper.Low.call(this), $end = $mod.TWordsHelper.High.call(this); $l <= $end; $l++) {
        lCount = $l;
        pas.SysUtils.TWordHelper.ToBytes.call({a: lCount, p: this.get(), get: function () {
            return this.p[this.a];
          }, set: function (v) {
            this.p[this.a] = v;
          }},{get: function () {
            return lLow;
          }, set: function (v) {
            lLow = v;
          }},{get: function () {
            return lHigh;
          }, set: function (v) {
            lHigh = v;
          }});
        lNewIndex = lCount * 2;
        Result[lNewIndex] = lLow;
        Result[lNewIndex + 1] = lHigh;
      };
      return Result;
    };
  });
  rtl.createHelper(this,"TCharHelper",null,function () {
    this.Length = 1;
    this.Size = 2;
    var cNumChars = rtl.createSet(48,49,50,51,52,53,54,55,56,57);
    this.IsDigit = function () {
      var Result = false;
      Result = this.get().charCodeAt() in cNumChars;
      return Result;
    };
    this.ToOrd = function () {
      var Result = 0;
      Result = this.get().charCodeAt();
      return Result;
    };
    this.ToUpper = function () {
      var Result = "\x00";
      Result = $mod.TCharHelper.ToUpper$1(this.get());
      return Result;
    };
    this.ToUpper$1 = function (AValue) {
      return AValue.toUpperCase();
    };
  });
  rtl.createHelper(this,"TLongIntHelper",null,function () {
    this.Equals = function (AValue) {
      var Result = false;
      Result = this.get() === AValue;
      return Result;
    };
    this.NotEquals = function (AValue) {
      var Result = false;
      Result = !$mod.TLongIntHelper.Equals.call(this,AValue);
      return Result;
    };
    this.Parse = function (AValue) {
      var Result = 0;
      Result = pas.SysUtils.StrToInt(AValue);
      return Result;
    };
    this.ToString = function () {
      var Result = "";
      Result = $mod.TLongIntHelper.ToString$1(this.get());
      return Result;
    };
    this.ToString$1 = function (AValue) {
      return AValue.toString();
    };
    this.TryParse = function (AString, AValue) {
      var Result = false;
      Result = pas.SysUtils.TryStrToInt(AString,AValue);
      return Result;
    };
  });
  rtl.createHelper(this,"TDateTimeHelper",null,function () {
    this.Equals = function (AValue) {
      var Result = false;
      Result = pas.Math.SameValue(this.get(),AValue,0.0);
      return Result;
    };
    this.NotEquals = function (AValue) {
      var Result = false;
      Result = !pas.Math.SameValue(this.get(),AValue,0.0);
      return Result;
    };
    this.ToString = function () {
      var Result = "";
      Result = pas.SysUtils.DateTimeToStr$1(this.get(),pas.SysUtils.FormatSettings,false);
      return Result;
    };
    this.ToIsoString = function (AAddDelimiters, AAddMilliSeconds) {
      var $Self = this;
      var Result = "";
      var da = 0;
      var mo = 0;
      var ye = 0;
      var ho = 0;
      var mi = 0;
      var se = 0;
      var ms = 0;
      var dd = "";
      var td = "";
      var msec = "";
      function IntToZStr(i, l) {
        var Result = "";
        var Res = "";
        Res = pas.SysUtils.IntToStr(i);
        while (Res.length < l) Res = "0" + Res;
        Result = Res;
        return Result;
      };
      if (AAddDelimiters) {
        dd = "-";
        td = ":";
      };
      pas.SysUtils.DecodeDate($Self.get(),{get: function () {
          return ye;
        }, set: function (v) {
          ye = v;
        }},{get: function () {
          return mo;
        }, set: function (v) {
          mo = v;
        }},{get: function () {
          return da;
        }, set: function (v) {
          da = v;
        }});
      pas.SysUtils.DecodeTime($Self.get(),{get: function () {
          return ho;
        }, set: function (v) {
          ho = v;
        }},{get: function () {
          return mi;
        }, set: function (v) {
          mi = v;
        }},{get: function () {
          return se;
        }, set: function (v) {
          se = v;
        }},{get: function () {
          return ms;
        }, set: function (v) {
          ms = v;
        }});
      if (AAddMilliSeconds) msec = "." + IntToZStr(ms,3) + "Z";
      Result = IntToZStr(ye,4) + dd + IntToZStr(mo,2) + dd + IntToZStr(da,2) + "T" + IntToZStr(ho,2) + td + IntToZStr(mi,2) + td + IntToZStr(se,2) + msec;
      return Result;
    };
  });
  rtl.createHelper(this,"TStreamHelper",null,function () {
    var MaxBufSize = 0xF000;
    this.CopyFrom = function (ASource, ACount) {
      var Result = 0;
      var lBufSize = 0;
      var lCount = 0;
      var lBuffer = [];
      if (ACount <= 0) {
        ASource.SetPosition(0);
        ACount = ASource.GetSize();
      };
      Result = ACount;
      if (ACount > 61440) {
        lBufSize = 61440}
       else lBufSize = ACount;
      $mod.TBytesHelper.set_Length.call({get: function () {
          return lBuffer;
        }, set: function (v) {
          lBuffer = v;
        }},lBufSize);
      try {
        while (ACount !== 0) {
          if (ACount > lBufSize) {
            lCount = lBufSize}
           else lCount = ACount;
          ASource.ReadBuffer({get: function () {
              return lBuffer;
            }, set: function (v) {
              lBuffer = v;
            }},lCount);
          this.WriteBuffer(lBuffer,lCount);
          ACount -= lCount;
        };
      } finally {
        $mod.TBytesHelper.set_Length.call({get: function () {
            return lBuffer;
          }, set: function (v) {
            lBuffer = v;
          }},0);
      };
      return Result;
    };
  });
  rtl.createClass(this,"TTMSStringStream",pas.Classes.TBytesStream,function () {
    this.$init = function () {
      pas.Classes.TBytesStream.$init.call(this);
      this.FEncoding = null;
      this.FFileName = "";
      this.FOwnsEncoding = false;
      this.FError = null;
      this.FLoaded = null;
      this.FRequest = null;
    };
    this.$final = function () {
      this.FEncoding = undefined;
      this.FError = undefined;
      this.FLoaded = undefined;
      this.FRequest = undefined;
      pas.Classes.TBytesStream.$final.call(this);
    };
    this.GetDataString = function () {
      var Result = "";
      Result = this.FEncoding.GetString(rtl.arrayCopy(0,this.GetBytes(),0,this.GetSize()));
      return Result;
    };
    this.InternalLoadFromFileP = function (AFileName) {
      var $Self = this;
      var Result = null;
      Result = new Promise(function (AResolve, AReject) {
        $Self.LoadFromFile$3(AFileName,function () {
          AResolve(true);
        },function (AError) {
          AReject(AError);
        });
      });
      return Result;
    };
    this.OnAbort = function (AEvent) {
      var Result = false;
      Result = true;
      if (this.FError != null) this.FError(pas.SysUtils.Format(rtl.getResStr(pas["WEBLib.Consts"],"SLoadFromFileAborted"),pas.System.VarRecs(18,this.FFileName)));
      return Result;
    };
    this.OnError = function (AEvent) {
      var Result = false;
      Result = true;
      if (this.FError != null) this.FError(pas.SysUtils.Format(rtl.getResStr(pas["WEBLib.Consts"],"SErrorLoadFromFile"),pas.System.VarRecs(18,this.FFileName)));
      return Result;
    };
    var cStatusOK$1 = 200;
    var cStatusLastOK = 208;
    this.OnLoad = function (AEvent) {
      var Result = false;
      var lReq = null;
      lReq = AEvent.target;
      if ((lReq.status < 200) || (lReq.status > 208)) {
        if (this.FError != null) {
          this.FError(pas.SysUtils.Format(rtl.getResStr(pas["WEBLib.Consts"],"SCannotGetFile"),pas.System.VarRecs(18,this.FFileName,0,this.FRequest.status)));
          return Result;
        } else throw $mod.EStringStreamError.$create("CreateFmt",[rtl.getResStr(pas["WEBLib.Consts"],"SCannotGetFile"),pas.System.VarRecs(18,this.FFileName,0,lReq.status)]);
      };
      this.WriteString(lReq.responseText);
      Result = true;
      if (this.FLoaded != null) this.FLoaded();
      return Result;
    };
    this.Create$2 = function () {
      this.Create$4(pas.SysUtils.TStringHelper.Empty,pas.SysUtils.TEncoding.GetDefault(),false);
      return this;
    };
    this.Create$3 = function (AString) {
      this.Create$4(AString,pas.SysUtils.TEncoding.GetDefault(),false);
      return this;
    };
    this.Create$4 = function (AString, AEncoding, AOwnsEncoding) {
      var lBytes = [];
      pas.System.TObject.Create.call(this);
      this.FEncoding = AEncoding;
      this.FOwnsEncoding = AOwnsEncoding && !pas.SysUtils.TEncoding.IsStandardEncoding(AEncoding);
      lBytes = this.FEncoding.GetBytes(AString);
      this.SetPointer(this.$class.BytesToMemory(rtl.arrayRef(lBytes)),$mod.TBytesHelper.get_Length.call({get: function () {
          return lBytes;
        }, set: function (v) {
          lBytes = v;
        }}));
      return this;
    };
    this.Destroy = function () {
      if (this.FOwnsEncoding) rtl.free(this,"FEncoding");
      pas.Classes.TMemoryStream.Destroy.call(this);
    };
    var cStatusOK = 200;
    this.LoadFromFile$1 = function (AFileName) {
      var lStatus = 0;
      var lResponse = "";
      lResponse = pas.SysUtils.TStringHelper.Empty;
      lStatus = 200;
      var lRequest = new XMLHttpRequest();
          lRequest.open("GET", AFileName, false);
          lRequest.send();
      
          if (lRequest.status == cStatusOK)
            lResponse = lRequest.responseText
          else
            lStatus = lRequest.status;
      if (lStatus !== 200) throw $mod.EStringStreamError.$create("CreateFmt",[rtl.getResStr(pas["WEBLib.Consts"],"SCannotGetFile"),pas.System.VarRecs(18,AFileName,0,lStatus)]);
      this.WriteString(lResponse);
    };
    this.LoadFromFile$2 = function (AFileName, ALoaded) {
      this.LoadFromFile$3(AFileName,ALoaded,null);
    };
    var cAbortMethod = "abort";
    var cErrorMethod = "error";
    var cGetMethod = "GET";
    var cLoadMethod = "load";
    this.LoadFromFile$3 = function (AFileName, ALoaded, AError) {
      this.FLoaded = ALoaded;
      this.FError = AError;
      this.FFileName = AFileName;
      this.FRequest = new XMLHttpRequest();
      this.FRequest.addEventListener(cAbortMethod,rtl.createSafeCallback(this,"OnAbort"));
      this.FRequest.addEventListener(cErrorMethod,rtl.createSafeCallback(this,"OnError"));
      this.FRequest.addEventListener(cLoadMethod,rtl.createSafeCallback(this,"OnLoad"));
      try {
        this.FRequest.open(cGetMethod,AFileName,true);
        this.FRequest.send();
      } catch ($e) {
        if (pas.SysUtils.Exception.isPrototypeOf($e)) {
          var E = $e;
          if (AError != null) {
            AError(E.FMessage)}
           else throw $e;
        } else throw $e
      };
    };
    this.LoadFromFileP = async function (AFileName) {
      var Result = false;
      Result = await this.InternalLoadFromFileP(AFileName);
      return Result;
    };
    this.ReadString = function (ACount) {
      var Result = "";
      var lBytes = [];
      var lDest = [];
      var lCount = 0;
      if (ACount > (this.GetSize() - this.GetPosition())) ACount = this.GetSize() - this.GetPosition();
      $mod.TBytesHelper.set_Length.call({get: function () {
          return lDest;
        }, set: function (v) {
          lDest = v;
        }},ACount);
      lBytes = rtl.arrayRef(this.GetBytes());
      for (var $l = this.GetPosition(), $end = (ACount + this.GetPosition()) - 1; $l <= $end; $l++) {
        lCount = $l;
        lDest[lCount - this.GetPosition()] = lBytes[lCount];
      };
      Result = this.FEncoding.GetString(lDest);
      this.SetPosition(this.GetPosition() + ACount);
      return Result;
    };
    this.WriteString = function (AString) {
      var lBytes = [];
      var lData = "";
      lBytes = this.FEncoding.GetBytes(AString);
      this.Write$1(lBytes,0,$mod.TBytesHelper.get_Length.call({get: function () {
          return lBytes;
        }, set: function (v) {
          lBytes = v;
        }}));
      lData = this.GetDataString();
      if (lData !== AString) this.WriteString("");
    };
  });
  rtl.createInterface(this,"IInterfaceList","{285DEA8A-B865-11D1-AAA7-00C04FB17A72}",["Add","Clear","Delete","Exchange","Expand","First","get_Capacity","get_Count","get_Items","IndexOf","IndexOfItem","Insert","Last","Lock","Remove","RemoveItem","set_Capacity","set_Count","set_Items","Unlock"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("Add",1,[["AItem",pas.System.$rtti["IUnknown"],2]],2,rtl.longint);
    $r.addMethod("Clear",0,[]);
    $r.addMethod("Delete",0,[["AIndex",rtl.longint,2]]);
    $r.addMethod("Exchange",0,[["AIndex1",rtl.longint,2],["AIndex2",rtl.longint,2]]);
    $r.addMethod("Expand",1,[],2,$mod.$rtti["TInterfaceList"]);
    $r.addMethod("First",1,[],2,pas.System.$rtti["IUnknown"]);
    $r.addMethod("get_Capacity",1,[],2,rtl.longint);
    $r.addMethod("get_Count",1,[],2,rtl.longint);
    $r.addMethod("get_Items",1,[["AIndex",rtl.longint,2]],2,pas.System.$rtti["IUnknown"]);
    $r.addMethod("IndexOf",1,[["AItem",pas.System.$rtti["IUnknown"],2]],2,rtl.longint);
    $r.addMethod("IndexOfItem",1,[["AItem",pas.System.$rtti["IUnknown"],2],["ADirection",pas.Types.$rtti["TDirection"],2]],2,rtl.longint);
    $r.addMethod("Insert",0,[["AIndex",rtl.longint,2],["AItem",pas.System.$rtti["IUnknown"],2]]);
    $r.addMethod("Last",1,[],2,pas.System.$rtti["IUnknown"]);
    $r.addMethod("Lock",0,[]);
    $r.addMethod("Remove",1,[["AItem",pas.System.$rtti["IUnknown"],2]],2,rtl.longint);
    $r.addMethod("RemoveItem",1,[["AItem",pas.System.$rtti["IUnknown"],2],["ADirection",pas.Types.$rtti["TDirection"],2]],2,rtl.longint);
    $r.addMethod("set_Capacity",0,[["AValue",rtl.longint,2]]);
    $r.addMethod("set_Count",0,[["AValue",rtl.longint,2]]);
    $r.addMethod("set_Items",0,[["AIndex",rtl.longint,2],["AItem",pas.System.$rtti["IUnknown"],2]]);
    $r.addMethod("Unlock",0,[]);
    $r.addProperty("Count",3,rtl.longint,"get_Count","set_Count",2);
    $r.addProperty("Items",3,pas.System.$rtti["IUnknown"],"get_Items","set_Items",2);
  });
  rtl.createClass(this,"TInterfaceListEnumerator",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FIndex = 0;
      this.FInterfaceList = null;
    };
    this.$final = function () {
      this.FInterfaceList = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.get_Current = function () {
      var Result = null;
      var $ok = false;
      try {
        Result = rtl.setIntfL(Result,this.FInterfaceList.get_Items(this.FIndex),true);
        $ok = true;
      } finally {
        if (!$ok) rtl._Release(Result);
      };
      return Result;
    };
    this.Create$1 = function (AInterfaceList) {
      pas.System.TObject.Create.call(this);
      this.FIndex = -1;
      this.FInterfaceList = AInterfaceList;
      return this;
    };
    this.MoveNext = function () {
      var Result = false;
      Result = this.FIndex < (this.FInterfaceList.get_Count() - 1);
      if (Result) this.FIndex += 1;
      return Result;
    };
  });
  rtl.createInterface(this,"IInterfaceListEx","{FDB39D70-65B9-4995-9436-6084ACA05DB3}",["GetEnumerator"],this.IInterfaceList,function () {
    var $r = this.$rtti;
    $r.addMethod("GetEnumerator",1,[],2,$mod.$rtti["TInterfaceListEnumerator"]);
  });
  this.$rtti.$RefToProcVar("TCompareItems",{procsig: rtl.newTIProcSig([["ALeft",pas.System.$rtti["IUnknown"],2],["ARight",pas.System.$rtti["IUnknown"],2]],pas.Math.$rtti["TValueRelationship"])});
  rtl.createInterface(this,"IInterfaceListEx2","{4FE71218-0F8F-4027-B050-5E84E2202604}",["Sort"],this.IInterfaceList,function () {
    var $r = this.$rtti;
    $r.addMethod("Sort",0,[["ACompare",$mod.$rtti["TCompareItems"],2]]);
  });
  rtl.createClass(this,"TInterfaceList",pas.System.TInterfacedObject,function () {
    this.$init = function () {
      pas.System.TInterfacedObject.$init.call(this);
      this.FList = null;
    };
    this.$final = function () {
      this.FList = undefined;
      pas.System.TInterfacedObject.$final.call(this);
    };
    this.Add = function (AItem) {
      var Result = 0;
      Result = this.FList.Add(null);
      this.set_Items(Result,AItem);
      return Result;
    };
    this.Clear = function () {
      var lCount = 0;
      for (var $l = 0, $end = this.FList.FCount - 1; $l <= $end; $l++) {
        lCount = $l;
        this.set_Items(lCount,null);
      };
      this.FList.Clear();
    };
    this.Delete = function (AIndex) {
      this.set_Items(AIndex,null);
      this.FList.Delete(AIndex);
    };
    this.Exchange = function (AIndex1, AIndex2) {
      this.FList.Exchange(AIndex1,AIndex2);
    };
    this.Expand = function () {
      var Result = null;
      this.FList.Expand();
      Result = this;
      return Result;
    };
    this.First = function () {
      var Result = null;
      var $ok = false;
      try {
        if (this.get_Count() > 0) {
          Result = rtl.setIntfL(Result,this.get_Items(0),true)}
         else Result = rtl.setIntfL(Result,null);
        $ok = true;
      } finally {
        if (!$ok) rtl._Release(Result);
      };
      return Result;
    };
    this.GetEnumerator = function () {
      var Result = null;
      Result = $mod.TInterfaceListEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.get_Capacity = function () {
      var Result = 0;
      Result = this.FList.FCapacity;
      return Result;
    };
    this.get_Count = function () {
      var Result = 0;
      Result = this.FList.FCount;
      return Result;
    };
    this.get_Items = function (AIndex) {
      var Result = null;
      var $ok = false;
      try {
        Result = rtl.setIntfL(Result,rtl.getObject(this.FList.Get(AIndex)));
        $ok = true;
      } finally {
        if (!$ok) rtl._Release(Result);
      };
      return Result;
    };
    this.IndexOf = function (AItem) {
      var Result = 0;
      Result = this.IndexOfItem(AItem,pas.Types.TDirection.FromBeginning);
      return Result;
    };
    this.IndexOfItem = function (AItem, ADirection) {
      var Result = 0;
      Result = this.FList.IndexOfItem(AItem,ADirection);
      return Result;
    };
    this.Insert = function (AIndex, AItem) {
      this.FList.Insert(AIndex,null);
      this.set_Items(AIndex,AItem);
    };
    this.Last = function () {
      var Result = null;
      var $ok = false;
      try {
        Result = rtl.setIntfL(Result,this.get_Items(this.get_Count() - 1),true);
        $ok = true;
      } finally {
        if (!$ok) rtl._Release(Result);
      };
      return Result;
    };
    this.Lock = function () {
    };
    this.Remove = function (AItem) {
      var Result = 0;
      Result = this.RemoveItem(AItem,pas.Types.TDirection.FromBeginning);
      return Result;
    };
    this.RemoveItem = function (AItem, ADirection) {
      var Result = 0;
      Result = this.FList.IndexOfItem(AItem,ADirection);
      if (Result > -1) this.Delete(Result);
      return Result;
    };
    this.set_Capacity = function (AValue) {
      this.FList.SetCapacity(AValue);
    };
    this.set_Count = function (AValue) {
      this.FList.SetCount(AValue);
    };
    this.set_Items = function (AIndex, AItem) {
      if (this.FList.Get(AIndex) != null) rtl.getObject(this.FList.Get(AIndex))._Release();
      this.FList.Put(AIndex,AItem);
      if (AItem !== null) AItem._AddRef();
    };
    this.Sort = function (ACompare) {
      $impl.FCompare = ACompare;
      try {
        this.FList.Sort($impl.InternalCompare);
      } finally {
        $impl.FCompare = null;
      };
    };
    this.Unlock = function () {
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FList = pas.Classes.TFPList.$create("Create");
      return this;
    };
    this.Destroy = function () {
      this.Clear();
      rtl.free(this,"FList");
      pas.System.TObject.Destroy.call(this);
    };
    rtl.addIntf(this,$mod.IInterfaceList);
    rtl.addIntf(this,$mod.IInterfaceListEx);
    rtl.addIntf(this,$mod.IInterfaceListEx2);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TStringBuilder",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FData = "";
    };
    this.get_Length = function () {
      var Result = 0;
      Result = pas.SysUtils.TStringHelper.GetLength.call({p: this, get: function () {
          return this.p.FData;
        }, set: function (v) {
          this.p.FData = v;
        }});
      return Result;
    };
    this.set_Length = function (AValue) {
      pas.SysUtils.TStringHelper.Set_Length.call({p: this, get: function () {
          return this.p.FData;
        }, set: function (v) {
          this.p.FData = v;
        }},AValue);
    };
    this.Create$1 = function (AValue) {
      pas.System.TObject.Create.call(this);
      this.FData = AValue;
      return this;
    };
    this.Append = function (AValue) {
      var Result = null;
      Result = this.Append$1($mod.TLongIntHelper.ToString.call({get: function () {
          return AValue;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }}));
      return Result;
    };
    this.Append$1 = function (AValue) {
      var Result = null;
      this.FData = this.FData + AValue;
      Result = this;
      return Result;
    };
    this.Insert = function (AIndex, AValue) {
      var Result = null;
      Result = this.Insert$1(AIndex,$mod.TLongIntHelper.ToString.call({get: function () {
          return AValue;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }}));
      return Result;
    };
    this.Insert$1 = function (AIndex, AValue) {
      var Result = null;
      pas.SysUtils.TStringHelper.Insert.call({p: this, get: function () {
          return this.p.FData;
        }, set: function (v) {
          this.p.FData = v;
        }},AIndex,AValue);
      Result = this;
      return Result;
    };
    this.ToString = function () {
      var Result = "";
      Result = this.FData;
      return Result;
    };
  });
  rtl.recNewT(this,"TSysInfo",function () {
    this.screenSize = "";
    this.browser = "";
    this.browserversion = "";
    this.browsermajorVersion = "";
    this.mobile = false;
    this.os = "";
    this.osVersion = "";
    this.cookieEnabled = false;
    this.flashVersion = "";
    this.$eq = function (b) {
      return (this.screenSize === b.screenSize) && (this.browser === b.browser) && (this.browserversion === b.browserversion) && (this.browsermajorVersion === b.browsermajorVersion) && (this.mobile === b.mobile) && (this.os === b.os) && (this.osVersion === b.osVersion) && (this.cookieEnabled === b.cookieEnabled) && (this.flashVersion === b.flashVersion);
    };
    this.$assign = function (s) {
      this.screenSize = s.screenSize;
      this.browser = s.browser;
      this.browserversion = s.browserversion;
      this.browsermajorVersion = s.browsermajorVersion;
      this.mobile = s.mobile;
      this.os = s.os;
      this.osVersion = s.osVersion;
      this.cookieEnabled = s.cookieEnabled;
      this.flashVersion = s.flashVersion;
      return this;
    };
    var $r = $mod.$rtti.$Record("TSysInfo",{},this);
    $r.addField("screenSize",rtl.string);
    $r.addField("browser",rtl.string);
    $r.addField("browserversion",rtl.string);
    $r.addField("browsermajorVersion",rtl.string);
    $r.addField("mobile",rtl.boolean);
    $r.addField("os",rtl.string);
    $r.addField("osVersion",rtl.string);
    $r.addField("cookieEnabled",rtl.boolean);
    $r.addField("flashVersion",rtl.string);
  });
  rtl.createHelper(this,"TJsonToObjectHelper",null,function () {
    this.FromJSON = function (JSONValue) {
      var $Self = this;
      var Context = pas.RTTI.TRTTIContext.$new();
      var TypeInfo = null;
      var v = pas.RTTI.TValue.$new();
      function ListProperties(AObject, jsv) {
        for (var key in jsv) {
          if (jsv.hasOwnProperty(key)) {
            //console.log(key + " / " + jsv[key]);
            SetProperty(AObject, key, jsv[key]);
          }
        };
      };
      function SetProperty(AObject, Name, AValue) {
        var pn = "";
        var Prop = null;
        var PropTypeInfo = null;
        if (Name === "") return;
        TypeInfo = Context.GetType$1(AObject.$class.ClassType());
        Prop = TypeInfo.GetProperty(Name);
        if (Prop != null) {
          pn = Prop.GetPropertyType().GetName();
          PropTypeInfo = Prop.GetPropertyType();
          if ((PropTypeInfo.GetTypeKind() === pas.System.TTypeKind.tkClass) && Prop.GetValue(AObject).IsObject()) {
            ListProperties(Prop.GetValue(AObject).AsObject(),AValue);
          };
          if (pn === "string") {
            v.$assign(pas.RTTI.TValue.From$$$G$$rtti$$String("" + AValue));
            Prop.SetValue(AObject,v);
          };
          if (pn === "longint") {
            v.$assign(pas.RTTI.TValue.From$$$G$$rtti$$Longint(rtl.trunc(AValue)));
            Prop.SetValue(AObject,v);
          };
          if (pn === "boolean") {
            v.$assign(pas.RTTI.TValue.From$$$G$$rtti$$Boolean(("" + AValue) === "true"));
            Prop.SetValue(AObject,v);
          };
          if (pn === "double") {
            v.$assign(pas.RTTI.TValue.From$$$G$$rtti$$Double(rtl.getNumber(AValue)));
            Prop.SetValue(AObject,v);
          };
          if (pn === "TDateTime") {
            v.$assign(pas.RTTI.TValue.From$$$G$$rtti$$Double(pas["WEBLib.REST"].TRESTClient.IsoToDateTime$1("" + AValue,true)));
            Prop.SetValue(AObject,v);
          };
          if (pn === "TDate") {
            v.$assign(pas.RTTI.TValue.From$$$G$$rtti$$Double(pas["WEBLib.REST"].TRESTClient.IsoToDate("" + AValue)));
            Prop.SetValue(AObject,v);
          };
          if (pn === "TTime") {
            v.$assign(pas.RTTI.TValue.From$$$G$$rtti$$Double(pas["WEBLib.REST"].TRESTClient.IsoToTime("" + AValue)));
            Prop.SetValue(AObject,v);
          };
        };
      };
      Context.$assign(pas.RTTI.TRTTIContext.Create());
      SetProperty($Self,"",null);
      ListProperties($Self,JSONValue);
      Context.Free();
    };
    this.FromJSON$1 = function (JSONValue) {
      var jsv = undefined;
      jsv = null;
      jsv = JSON.parse(JSONValue);
      $mod.TJsonToObjectHelper.FromJSON.call(this,jsv);
    };
    this.ToJSON = function () {
      var $Self = this;
      var Result = undefined;
      var Context = pas.RTTI.TRTTIContext.$new();
      var TypeInfo = null;
      var Prop = null;
      var jsonstr = "";
      var pn = "";
      var res = undefined;
      var PropTypeInfo = null;
      function ListProperties(AObject, ATypeInfo, js) {
        var sub = "";
        var sep = "";
        var subn = "";
        for (var $in = ATypeInfo.GetProperties(), $l = 0, $end = rtl.length($in) - 1; $l <= $end; $l++) {
          Prop = $in[$l];
          PropTypeInfo = Prop.GetPropertyType();
          sep = "";
          if (js.get().length > 1) sep = ",";
          subn = Prop.GetName();
          pn = Prop.GetPropertyType().GetName();
          if ((PropTypeInfo.GetTypeKind() === pas.System.TTypeKind.tkClass) && Prop.GetValue(AObject).IsObject()) {
            sub = "{";
            ListProperties(Prop.GetValue(AObject).AsObject(),Prop.GetPropertyType(),{get: function () {
                return sub;
              }, set: function (v) {
                sub = v;
              }});
            sub = sub + "}";
            js.set(js.get() + sep + '"' + subn + '":' + sub);
            continue;
          };
          if (pn === "string") {
            js.set(js.get() + sep + '"' + Prop.GetName() + '":' + '"' + Prop.GetValue(AObject).ToString() + '"');
          };
          if (pn === "longint") {
            js.set(js.get() + sep + '"' + Prop.GetName() + '":' + pas.SysUtils.IntToStr(Prop.GetValue(AObject).AsInteger()));
          };
          if (pn === "boolean") {
            if (Prop.GetValue(AObject).AsBoolean()) {
              js.set(js.get() + sep + '"' + Prop.GetName() + '":' + "true")}
             else js.set(js.get() + sep + '"' + Prop.GetName() + '":' + "false");
          };
          if (pn === "double") {
            js.set(js.get() + sep + '"' + Prop.GetName() + '":' + pas.SysUtils.FloatToStr(Prop.GetValue(AObject).AsExtended()));
          };
          if (pn === "TDateTime") {
            js.set(js.get() + sep + '"' + Prop.GetName() + '":' + '"' + pas["WEBLib.REST"].TRESTClient.DateTimeToWL(Prop.GetValue(AObject).AsExtended()) + '"');
          };
          if (pn === "TDate") {
            js.set(js.get() + sep + '"' + Prop.GetName() + '":' + '"' + pas["WEBLib.REST"].TRESTClient.DateToWL(Prop.GetValue(AObject).AsExtended()) + '"');
          };
          if (pn === "TTime") {
            js.set(js.get() + sep + '"' + Prop.GetName() + '":' + '"' + pas["WEBLib.REST"].TRESTClient.TimeToWL(Prop.GetValue(AObject).AsExtended()) + '"');
          };
        };
      };
      Context.$assign(pas.RTTI.TRTTIContext.Create());
      TypeInfo = Context.GetType$1($Self.$class.ClassType());
      jsonstr = "{";
      ListProperties($Self,TypeInfo,{get: function () {
          return jsonstr;
        }, set: function (v) {
          jsonstr = v;
        }});
      jsonstr = jsonstr + "}";
      res = JSON.parse(jsonstr);
      Result = res;
      Context.Free();
      return Result;
    };
  });
  this.UseVariable = function (AValue) {
  };
  this.UseVariable$1 = function (AValue) {
  };
  this.UseVariable$2 = function (AValue) {
  };
  this.ArrayBufferToBase64 = function (Buffer) {
    var Result = "";
    function _arrayBufferToBase64(buf) {
    var binary = '';
    var bytes = new Uint8Array(buf);
    var len = bytes.byteLength;
    for (var i = 0; i < len; i++) {
        binary += String.fromCharCode( bytes[i] );
    }
    return window.btoa(binary);
    }
    Result = _arrayBufferToBase64(Buffer);
    return Result;
  };
  this.Base64ToArrayBuffer = function (Base64) {
    var Result = null;
    function _base64ToArrayBuffer(data) {
            var binary_string = window.atob(data);
            var len = binary_string.length;
            var bytes = new Uint8Array(len);
            for (var i = 0; i < len; i++) {
                bytes[i] = binary_string.charCodeAt(i);
            }
            return bytes.buffer;
        }
    
        Result = _base64ToArrayBuffer(Base64);
    return Result;
  };
  this.StringToBase64 = function (AValue) {
    var Result = "";
    var res = "";
    res = window.btoa(AValue);
    Result = res;
    return Result;
  };
  this.Base64ToString = function (AValue) {
    var Result = "";
    var res = "";
    res = window.atob(AValue);
    Result = res;
    return Result;
  };
  var cSizeOfDouble = 8;
  this.SizeOf = function (AValue) {
    var Result = 0;
    Result = 8;
    return Result;
  };
  var cSizeOfInteger = 4;
  this.SizeOf$1 = function (AValue) {
    var Result = 0;
    Result = 4;
    return Result;
  };
  this.InsertAfter = function (newNode, referenceNode) {
    referenceNode.parentNode.insertBefore(newNode,referenceNode.nextSibling);
  };
  this.MatchStrEx = function (AValue1, AValue2, ACaseSensitive) {
    var Result = false;
    var ch = "\x00";
    var lastop = "\x00";
    var sep = 0;
    var cp = 0;
    var res = false;
    var newres = false;
    var CharArray = [];
    AValue1 = pas.SysUtils.Trim(AValue1);
    AValue1 = $impl.StripLogicSpaces(AValue1);
    sep = -1;
    if ($impl.VarPos("=",AValue1,{get: function () {
        return sep;
      }, set: function (v) {
        sep = v;
      }}) === 1) pas.System.Delete({get: function () {
        return AValue1;
      }, set: function (v) {
        AValue1 = v;
      }},sep,1);
    lastop = "\x00";
    res = true;
    CharArray = rtl.arraySetLength(CharArray,"\x00",5);
    CharArray[0] = "(";
    CharArray[1] = ";";
    CharArray[2] = "^";
    CharArray[3] = "&";
    CharArray[4] = "|";
    if (AValue1 === "") {
      Result = AValue2 === "";
      return Result;
    };
    if ((AValue1 !== "*") && (AValue2 === "")) {
      Result = false;
      return Result;
    };
    do {
      ch = $impl.FirstChar(CharArray,AValue1,{get: function () {
          return sep;
        }, set: function (v) {
          sep = v;
        }});
      if (ch !== "\x00") {
        if ((AValue1.length > 0) && (AValue1.charAt(0) === "(") && (pas.System.Pos("(",AValue1) > 0)) {
          cp = $impl.ClosingParenthesis(AValue1);
          newres = $mod.MatchStrEx(pas.System.Copy(AValue1,2,cp - 2),AValue2,ACaseSensitive);
          pas.System.Delete({get: function () {
              return AValue1;
            }, set: function (v) {
              AValue1 = v;
            }},1,cp);
        } else {
          newres = $mod.MatchStr(pas.System.Copy(AValue1,1,sep - 1),AValue2,ACaseSensitive);
          pas.System.Delete({get: function () {
              return AValue1;
            }, set: function (v) {
              AValue1 = v;
            }},1,sep);
        };
        if (lastop === "\x00") {
          res = newres}
         else {
          var $tmp = lastop;
          if (($tmp === ";") || ($tmp === "^") || ($tmp === "|")) {
            res = res || newres}
           else if ($tmp === "&") res = res && newres;
        };
        lastop = ch;
      };
    } while (!(ch === "\x00"));
    newres = $mod.MatchStr(AValue1,AValue2,ACaseSensitive);
    if (lastop === "\x00") {
      res = newres}
     else {
      var $tmp1 = lastop;
      if (($tmp1 === ";") || ($tmp1 === "^") || ($tmp1 === "|")) {
        res = res || newres}
       else if ($tmp1 === "&") res = res && newres;
    };
    Result = res;
    return Result;
  };
  this.MatchStr = function (AValue1, AValue2, ACaseSensitive) {
    var Result = false;
    if (ACaseSensitive) {
      Result = $impl.Matches(AValue1,AValue2)}
     else Result = $impl.Matches(pas.SysUtils.UpperCase(AValue1),pas.SysUtils.UpperCase(AValue2));
    return Result;
  };
  this.SelectElementContents = function (AElement) {
    if (window.getSelection && document.createRange) {
        var sel = window.getSelection();
        var range = document.createRange();
        range.selectNodeContents(AElement);
        sel.removeAllRanges();
        sel.addRange(range);
    } else if (document.selection && document.body.createTextRange) {
        var textRange = document.body.createTextRange();
        textRange.moveToElementText(AElement);
        textRange.select();
    };
  };
  this.FormatProp = function (AFmt, AArgs) {
    var Result = "";
    Result = pas.SysUtils.Format$1(AFmt,AArgs,pas.SysUtils.TFormatSettings.Invariant());
    return Result;
  };
  this.StringIsFloat = function (N) {
    var Result = false;
    var f = 0.0;
    Result = pas.SysUtils.TryStrToFloat$2(N,{get: function () {
        return f;
      }, set: function (v) {
        f = v;
      }});
    return Result;
  };
  this.StringIsInteger = function (N) {
    var Result = false;
    var I = 0;
    Result = true;
    if (pas.SysUtils.Trim(N) === "") return false;
    if ((pas.SysUtils.Trim(N).length > 1) && (pas.SysUtils.Trim(N).charAt(0) === "0")) return false;
    if (!(N.charCodeAt(I - 1) in rtl.createSet(null,48,57,45))) return false;
    for (var $l = 2, $end = N.length; $l <= $end; $l++) {
      I = $l;
      if (!(N.charCodeAt(I - 1) in rtl.createSet(null,48,57))) {
        Result = false;
        break;
      };
    };
    return Result;
  };
  this.MD5Hash = function (N) {
    var Result = "";
    var h = "";
    function md5(inputString) {
      var hc="0123456789abcdef";
      function rh(n) {var j,s="";for(j=0;j<=3;j++) s+=hc.charAt((n>>(j*8+4))&0x0F)+hc.charAt((n>>(j*8))&0x0F);return s;}
      function ad(x,y) {var l=(x&0xFFFF)+(y&0xFFFF);var m=(x>>16)+(y>>16)+(l>>16);return (m<<16)|(l&0xFFFF);}
      function rl(n,c)            {return (n<<c)|(n>>>(32-c));}
      function cm(q,a,b,x,s,t)    {return ad(rl(ad(ad(a,q),ad(x,t)),s),b);}
      function ff(a,b,c,d,x,s,t)  {return cm((b&c)|((~b)&d),a,b,x,s,t);}
      function gg(a,b,c,d,x,s,t)  {return cm((b&d)|(c&(~d)),a,b,x,s,t);}
      function hh(a,b,c,d,x,s,t)  {return cm(b^c^d,a,b,x,s,t);}
      function ii(a,b,c,d,x,s,t)  {return cm(c^(b|(~d)),a,b,x,s,t);}
      function sb(x) {
          var i;var nblk=((x.length+8)>>6)+1;var blks=new Array(nblk*16);for(i=0;i<nblk*16;i++) blks[i]=0;
          for(i=0;i<x.length;i++) blks[i>>2]|=x.charCodeAt(i)<<((i%4)*8);
          blks[i>>2]|=0x80<<((i%4)*8);blks[nblk*16-2]=x.length*8;return blks;
      }
      var i,x=sb(inputString),a=1732584193,b=-271733879,c=-1732584194,d=271733878,olda,oldb,oldc,oldd;
      for(i=0;i<x.length;i+=16) {olda=a;oldb=b;oldc=c;oldd=d;
          a=ff(a,b,c,d,x[i+ 0], 7, -680876936);d=ff(d,a,b,c,x[i+ 1],12, -389564586);c=ff(c,d,a,b,x[i+ 2],17,  606105819);
          b=ff(b,c,d,a,x[i+ 3],22,-1044525330);a=ff(a,b,c,d,x[i+ 4], 7, -176418897);d=ff(d,a,b,c,x[i+ 5],12, 1200080426);
          c=ff(c,d,a,b,x[i+ 6],17,-1473231341);b=ff(b,c,d,a,x[i+ 7],22,  -45705983);a=ff(a,b,c,d,x[i+ 8], 7, 1770035416);
          d=ff(d,a,b,c,x[i+ 9],12,-1958414417);c=ff(c,d,a,b,x[i+10],17,     -42063);b=ff(b,c,d,a,x[i+11],22,-1990404162);
          a=ff(a,b,c,d,x[i+12], 7, 1804603682);d=ff(d,a,b,c,x[i+13],12,  -40341101);c=ff(c,d,a,b,x[i+14],17,-1502002290);
          b=ff(b,c,d,a,x[i+15],22, 1236535329);a=gg(a,b,c,d,x[i+ 1], 5, -165796510);d=gg(d,a,b,c,x[i+ 6], 9,-1069501632);
          c=gg(c,d,a,b,x[i+11],14,  643717713);b=gg(b,c,d,a,x[i+ 0],20, -373897302);a=gg(a,b,c,d,x[i+ 5], 5, -701558691);
          d=gg(d,a,b,c,x[i+10], 9,   38016083);c=gg(c,d,a,b,x[i+15],14, -660478335);b=gg(b,c,d,a,x[i+ 4],20, -405537848);
          a=gg(a,b,c,d,x[i+ 9], 5,  568446438);d=gg(d,a,b,c,x[i+14], 9,-1019803690);c=gg(c,d,a,b,x[i+ 3],14, -187363961);
          b=gg(b,c,d,a,x[i+ 8],20, 1163531501);a=gg(a,b,c,d,x[i+13], 5,-1444681467);d=gg(d,a,b,c,x[i+ 2], 9,  -51403784);
          c=gg(c,d,a,b,x[i+ 7],14, 1735328473);b=gg(b,c,d,a,x[i+12],20,-1926607734);a=hh(a,b,c,d,x[i+ 5], 4,    -378558);
          d=hh(d,a,b,c,x[i+ 8],11,-2022574463);c=hh(c,d,a,b,x[i+11],16, 1839030562);b=hh(b,c,d,a,x[i+14],23,  -35309556);
          a=hh(a,b,c,d,x[i+ 1], 4,-1530992060);d=hh(d,a,b,c,x[i+ 4],11, 1272893353);c=hh(c,d,a,b,x[i+ 7],16, -155497632);
          b=hh(b,c,d,a,x[i+10],23,-1094730640);a=hh(a,b,c,d,x[i+13], 4,  681279174);d=hh(d,a,b,c,x[i+ 0],11, -358537222);
          c=hh(c,d,a,b,x[i+ 3],16, -722521979);b=hh(b,c,d,a,x[i+ 6],23,   76029189);a=hh(a,b,c,d,x[i+ 9], 4, -640364487);
          d=hh(d,a,b,c,x[i+12],11, -421815835);c=hh(c,d,a,b,x[i+15],16,  530742520);b=hh(b,c,d,a,x[i+ 2],23, -995338651);
          a=ii(a,b,c,d,x[i+ 0], 6, -198630844);d=ii(d,a,b,c,x[i+ 7],10, 1126891415);c=ii(c,d,a,b,x[i+14],15,-1416354905);
          b=ii(b,c,d,a,x[i+ 5],21,  -57434055);a=ii(a,b,c,d,x[i+12], 6, 1700485571);d=ii(d,a,b,c,x[i+ 3],10,-1894986606);
          c=ii(c,d,a,b,x[i+10],15,   -1051523);b=ii(b,c,d,a,x[i+ 1],21,-2054922799);a=ii(a,b,c,d,x[i+ 8], 6, 1873313359);
          d=ii(d,a,b,c,x[i+15],10,  -30611744);c=ii(c,d,a,b,x[i+ 6],15,-1560198380);b=ii(b,c,d,a,x[i+13],21, 1309151649);
          a=ii(a,b,c,d,x[i+ 4], 6, -145523070);d=ii(d,a,b,c,x[i+11],10,-1120210379);c=ii(c,d,a,b,x[i+ 2],15,  718787259);
          b=ii(b,c,d,a,x[i+ 9],21, -343485551);a=ad(a,olda);b=ad(b,oldb);c=ad(c,oldc);d=ad(d,oldd);
      }
      return rh(a)+rh(b)+rh(c)+rh(d);
    }
    h = md5(N);
    Result = h;
    return Result;
  };
  this.GetSysInfo = function () {
    var Result = $mod.TSysInfo.$new();
    function GetInfo(window)
        {
            var unknown = '-';
    
            // screen
            var screenSize = '';
            if (screen.width) {
                var width = (screen.width) ? screen.width : '';
                var height = (screen.height) ? screen.height : '';
                screenSize += '' + width + " x " + height;
            }
    
            // browser
            var nVer = navigator.appVersion;
            var nAgt = navigator.userAgent;
            var browser = navigator.appName;
            var version = '' + parseFloat(navigator.appVersion);
            var majorVersion = parseInt(navigator.appVersion, 10);
            var nameOffset, verOffset, ix;
    
            // Opera
            if ((verOffset = nAgt.indexOf('Opera')) != -1) {
                browser = 'Opera';
                version = nAgt.substring(verOffset + 6);
                if ((verOffset = nAgt.indexOf('Version')) != -1) {
                    version = nAgt.substring(verOffset + 8);
                }
            }
            // Opera Next
            if ((verOffset = nAgt.indexOf('OPR')) != -1) {
                browser = 'Opera';
                version = nAgt.substring(verOffset + 4);
            }
            // Legacy Edge
            else if ((verOffset = nAgt.indexOf('Edge')) != -1) {
                browser = 'Microsoft Legacy Edge';
                version = nAgt.substring(verOffset + 5);
            }
            // Edge (Chromium)
            else if ((verOffset = nAgt.indexOf('Edg')) != -1) {
                browser = 'Microsoft Edge';
                version = nAgt.substring(verOffset + 4);
            }
            // MSIE
            else if ((verOffset = nAgt.indexOf('MSIE')) != -1) {
                browser = 'Microsoft Internet Explorer';
                version = nAgt.substring(verOffset + 5);
            }
            // Chrome
            else if ((verOffset = nAgt.indexOf('Chrome')) != -1) {
                browser = 'Chrome';
                version = nAgt.substring(verOffset + 7);
            }
            // Safari
            else if ((verOffset = nAgt.indexOf('Safari')) != -1) {
                browser = 'Safari';
                version = nAgt.substring(verOffset + 7);
                if ((verOffset = nAgt.indexOf('Version')) != -1) {
                    version = nAgt.substring(verOffset + 8);
                }
            }
            // Firefox
            else if ((verOffset = nAgt.indexOf('Firefox')) != -1) {
                browser = 'Firefox';
                version = nAgt.substring(verOffset + 8);
            }
            // MSIE 11+
            else if (nAgt.indexOf('Trident/') != -1) {
                browser = 'Microsoft Internet Explorer';
                version = nAgt.substring(nAgt.indexOf('rv:') + 3);
            }
            // Other browsers
            else if ((nameOffset = nAgt.lastIndexOf(' ') + 1) < (verOffset = nAgt.lastIndexOf('/'))) {
                browser = nAgt.substring(nameOffset, verOffset);
                version = nAgt.substring(verOffset + 1);
                if (browser.toLowerCase() == browser.toUpperCase()) {
                    browser = navigator.appName;
                }
            }
            // trim the version string
            if ((ix = version.indexOf(';')) != -1) version = version.substring(0, ix);
            if ((ix = version.indexOf(' ')) != -1) version = version.substring(0, ix);
            if ((ix = version.indexOf(')')) != -1) version = version.substring(0, ix);
    
            majorVersion = parseInt('' + version, 10);
            if (isNaN(majorVersion)) {
                version = '' + parseFloat(navigator.appVersion);
                majorVersion = parseInt(navigator.appVersion, 10);
            }
    
            // mobile version
            var mobile = /Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(nVer);
    
            // cookie
            var cookieEnabled = (navigator.cookieEnabled) ? true : false;
    
            if (typeof navigator.cookieEnabled == 'undefined' && !cookieEnabled) {
                document.cookie = 'testcookie';
                cookieEnabled = (document.cookie.indexOf('testcookie') != -1) ? true : false;
            }
    
            // system
            var os = unknown;
            var clientStrings = [
                {s:'Windows 10', r:/(Windows 10.0|Windows NT 10.0)/},
                {s:'Windows 8.1', r:/(Windows 8.1|Windows NT 6.3)/},
                {s:'Windows 8', r:/(Windows 8|Windows NT 6.2)/},
                {s:'Windows 7', r:/(Windows 7|Windows NT 6.1)/},
                {s:'Windows Vista', r:/Windows NT 6.0/},
                {s:'Windows Server 2003', r:/Windows NT 5.2/},
                {s:'Windows XP', r:/(Windows NT 5.1|Windows XP)/},
                {s:'Windows 2000', r:/(Windows NT 5.0|Windows 2000)/},
                {s:'Windows ME', r:/(Win 9x 4.90|Windows ME)/},
                {s:'Windows 98', r:/(Windows 98|Win98)/},
                {s:'Windows 95', r:/(Windows 95|Win95|Windows_95)/},
                {s:'Windows NT 4.0', r:/(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/},
                {s:'Windows CE', r:/Windows CE/},
                {s:'Windows 3.11', r:/Win16/},
                {s:'Android', r:/Android/},
                {s:'Open BSD', r:/OpenBSD/},
                {s:'Sun OS', r:/SunOS/},
                {s:'Chrome OS', r:/CrOS/},
                {s:'Linux', r:/(Linux|X11(?!.*CrOS))/},
                {s:'iOS', r:/(iPhone|iPad|iPod)/},
                {s:'Mac OS X', r:/Mac OS X/},
                {s:'Mac OS', r:/(Mac OS|MacPPC|MacIntel|Mac_PowerPC|Macintosh)/},
                {s:'QNX', r:/QNX/},
                {s:'UNIX', r:/UNIX/},
                {s:'BeOS', r:/BeOS/},
                {s:'OS/2', r:/OS\/2/},
                {s:'Search Bot', r:/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/}
            ];
            for (var id in clientStrings) {
                var cs = clientStrings[id];
                if (cs.r.test(nAgt)) {
                    os = cs.s;
                    break;
                }
            }
    
            var osVersion = unknown;
    
            if (/Windows/.test(os)) {
                osVersion = /Windows (.*)/.exec(os)[1];
                os = 'Windows';
            }
    
            switch (os) {
                case 'Mac OS':
                case 'Mac OS X':
                case 'Android':
                    osVersion = /(?:Android|Mac OS|Mac OS X|MacPPC|MacIntel|Mac_PowerPC|Macintosh) ([\.\_\d]+)/.exec(nAgt)[1];
                    break;
    
                case 'iOS':
                    osVersion = /OS (\d+)_(\d+)_?(\d+)?/.exec(nVer);
                    osVersion = osVersion[1] + '.' + osVersion[2] + '.' + (osVersion[3] | 0);
                    break;
            }
    
            // flash (you'll need to include swfobject)
            /* script src="//ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js" */
            var flashVersion = 'no check';
            if (typeof swfobject != 'undefined') {
                var fv = swfobject.getFlashPlayerVersion();
                if (fv.major > 0) {
                    flashVersion = fv.major + '.' + fv.minor + ' r' + fv.release;
                }
                else  {
                    flashVersion = unknown;
                }
            }
           Result.screenSize = screenSize;
           Result.browser = browser;
           Result.browserversion = version;
           Result.browsermajorVersion = majorVersion;
           Result.mobile = mobile;
           Result.os = os;
           Result.osVersion = osVersion;
           Result.cookieEnabled = cookieEnabled;
          }
          GetInfo(window);
    return Result;
  };
  $mod.$implcode = function () {
    $impl.FCompare = null;
    $impl.InternalCompare = function (AItem1, AItem2) {
      var Result = 0;
      Result = $impl.FCompare(rtl.getObject(AItem1),rtl.getObject(AItem2));
      return Result;
    };
    $impl.StripThousandSep = function (ps) {
      var Result = "";
      while (pas.System.Pos(pas.SysUtils.FormatSettings.ThousandSeparator,ps) > 0) pas.System.Delete({get: function () {
          return ps;
        }, set: function (v) {
          ps = v;
        }},pas.System.Pos(pas.SysUtils.FormatSettings.ThousandSeparator,ps),1);
      Result = ps;
      return Result;
    };
    $impl.VarPos = function (ASubValue, AValue, AResult) {
      var Result = 0;
      AResult.set(pas.System.Pos(ASubValue,AValue));
      Result = AResult.get();
      return Result;
    };
    $impl.IsDate = function (AValue, ADate) {
      var Result = false;
      var su = "";
      var ts = "";
      var da = 0;
      var mo = 0;
      var ye = 0;
      var ho = 0;
      var mi = 0;
      var se = 0;
      var err = 0;
      var dp = 0;
      var mp = 0;
      var yp = 0;
      var vp = 0;
      Result = false;
      ts = "";
      su = pas.SysUtils.UpperCase(pas.SysUtils.FormatSettings.ShortDateFormat);
      dp = pas.System.Pos("D",su);
      mp = pas.System.Pos("M",su);
      yp = pas.System.Pos("Y",su);
      da = 0;
      mo = 0;
      ye = 0;
      ho = 0;
      mi = 0;
      se = 0;
      vp = -1;
      if ($impl.VarPos(pas.SysUtils.FormatSettings.DateSeparator,AValue,{get: function () {
          return vp;
        }, set: function (v) {
          vp = v;
        }}) > 0) {
        su = pas.System.Copy(AValue,1,vp - 1);
        if ((dp < mp) && (dp < yp)) {
          pas.System.val$5(su,{get: function () {
              return da;
            }, set: function (v) {
              da = v;
            }},{get: function () {
              return err;
            }, set: function (v) {
              err = v;
            }})}
         else if ((mp < dp) && (mp < yp)) {
          pas.System.val$5(su,{get: function () {
              return mo;
            }, set: function (v) {
              mo = v;
            }},{get: function () {
              return err;
            }, set: function (v) {
              err = v;
            }})}
         else if ((yp < mp) && (yp < dp)) pas.System.val$5(su,{get: function () {
            return ye;
          }, set: function (v) {
            ye = v;
          }},{get: function () {
            return err;
          }, set: function (v) {
            err = v;
          }});
        if (err !== 0) return Result;
        pas.System.Delete({get: function () {
            return AValue;
          }, set: function (v) {
            AValue = v;
          }},1,vp);
        if ($impl.VarPos(pas.SysUtils.FormatSettings.DateSeparator,AValue,{get: function () {
            return vp;
          }, set: function (v) {
            vp = v;
          }}) > 0) {
          su = pas.System.Copy(AValue,1,vp - 1);
          if (((dp > mp) && (dp < yp)) || ((dp > yp) && (dp < mp))) {
            pas.System.val$5(su,{get: function () {
                return da;
              }, set: function (v) {
                da = v;
              }},{get: function () {
                return err;
              }, set: function (v) {
                err = v;
              }})}
           else if (((mp > dp) && (mp < yp)) || ((mp > yp) && (mp < dp))) {
            pas.System.val$5(su,{get: function () {
                return mo;
              }, set: function (v) {
                mo = v;
              }},{get: function () {
                return err;
              }, set: function (v) {
                err = v;
              }})}
           else if (((yp > mp) && (yp < dp)) || ((yp > dp) && (yp < mp))) pas.System.val$5(su,{get: function () {
              return ye;
            }, set: function (v) {
              ye = v;
            }},{get: function () {
              return err;
            }, set: function (v) {
              err = v;
            }});
          if (err !== 0) return Result;
          pas.System.Delete({get: function () {
              return AValue;
            }, set: function (v) {
              AValue = v;
            }},1,vp);
          AValue = pas.SysUtils.Trim(AValue);
          if ($impl.VarPos(" ",AValue,{get: function () {
              return vp;
            }, set: function (v) {
              vp = v;
            }}) > 0) {
            ts = pas.System.Copy(AValue,vp,AValue.length);
            AValue = pas.System.Copy(AValue,1,vp - 1);
          };
          if ((dp > mp) && (dp > yp)) {
            pas.System.val$5(AValue,{get: function () {
                return da;
              }, set: function (v) {
                da = v;
              }},{get: function () {
                return err;
              }, set: function (v) {
                err = v;
              }})}
           else if ((mp > dp) && (mp > yp)) {
            pas.System.val$5(AValue,{get: function () {
                return mo;
              }, set: function (v) {
                mo = v;
              }},{get: function () {
                return err;
              }, set: function (v) {
                err = v;
              }})}
           else if ((yp > mp) && (yp > dp)) pas.System.val$5(AValue,{get: function () {
              return ye;
            }, set: function (v) {
              ye = v;
            }},{get: function () {
              return err;
            }, set: function (v) {
              err = v;
            }});
          if (err !== 0) return Result;
          if (da > 31) return Result;
          if (mo > 12) return Result;
          if (ts !== "") {
            if ($impl.VarPos(pas.SysUtils.FormatSettings.TimeSeparator,ts,{get: function () {
                return vp;
              }, set: function (v) {
                vp = v;
              }}) > 0) {
              su = pas.System.Copy(ts,1,vp - 1);
              pas.System.val$5(su,{get: function () {
                  return ho;
                }, set: function (v) {
                  ho = v;
                }},{get: function () {
                  return err;
                }, set: function (v) {
                  err = v;
                }});
              if (err !== 0) return Result;
              if (ho > 23) return Result;
              pas.System.Delete({get: function () {
                  return ts;
                }, set: function (v) {
                  ts = v;
                }},1,vp);
              if ($impl.VarPos(pas.SysUtils.FormatSettings.TimeSeparator,ts,{get: function () {
                  return vp;
                }, set: function (v) {
                  vp = v;
                }}) > 0) {
                su = pas.System.Copy(ts,1,vp - 1);
                pas.System.val$5(su,{get: function () {
                    return mi;
                  }, set: function (v) {
                    mi = v;
                  }},{get: function () {
                    return err;
                  }, set: function (v) {
                    err = v;
                  }});
                if (err !== 0) return Result;
                pas.System.Delete({get: function () {
                    return ts;
                  }, set: function (v) {
                    ts = v;
                  }},1,vp);
                pas.System.val$5(ts,{get: function () {
                    return se;
                  }, set: function (v) {
                    se = v;
                  }},{get: function () {
                    return err;
                  }, set: function (v) {
                    err = v;
                  }});
                if (err !== 0) return Result;
                if (se > 60) return Result;
              } else {
                pas.System.val$5(su,{get: function () {
                    return mi;
                  }, set: function (v) {
                    mi = v;
                  }},{get: function () {
                    return err;
                  }, set: function (v) {
                    err = v;
                  }});
                if (err !== 0) return Result;
              };
              if (mi > 59) return Result;
              Result = true;
            };
          } else Result = true;
          try {
            ADate.set(pas.SysUtils.EncodeDate(ye,mo,da) + pas.SysUtils.EncodeTime(ho,mi,se,0));
          } catch ($e) {
            Result = false;
          };
        };
      };
      return Result;
    };
    var larger = ">";
    var smaller = "<";
    var logand = "&";
    var logor = "^";
    var asterix = "*";
    var qmark = "?";
    var negation = "!";
    $impl.Matches = function (s0a, s1a) {
      var Result = false;
      var matching = false;
      var done = false;
      var len = 0;
      var lastchar = "\x00";
      var s0 = 0;
      var s1 = 0;
      var s2 = 0;
      var s3 = 0;
      var oksmaller = false;
      var oklarger = false;
      var negflag = false;
      var compstr = "";
      var flag1 = false;
      var flag2 = false;
      var flag3 = false;
      var equal = false;
      var n1 = 0.0;
      var n2 = 0.0;
      var code1 = 0;
      var code2 = 0;
      var dt1 = 0.0;
      var dt2 = 0.0;
      var q = 0;
      var i = 0;
      i = 0;
      oksmaller = true;
      oklarger = true;
      flag1 = false;
      flag2 = false;
      flag3 = false;
      negflag = false;
      equal = false;
      s2 = pas.System.Pos(larger,s0a);
      if (s2 !== 0) {
        s2 += 1;
        if (s0a.charAt(s2 - i - 1) === "=") {
          equal = true;
          s2 += 1;
        };
        while (s0a.charAt(s2 - i - 1) === " ") s2 += 1;
        s3 = s2;
        len = 0;
        lastchar = "\x00";
        q = 0;
        while (((s2 - i) <= s0a.length) && (s0a.charAt(s2 - i - 1) !== " ") && (s2 <= s0a.length) && (pas.System.Odd(q) || ((s0a.charAt(s2 - i - 1) !== "&") && (s0a.charAt(s2 - i - 1) !== "|")))) {
          if (s0a.charAt(s2 - i - 1) === '"') q += 1;
          if ((len === 0) && (s0a.charAt(s2 - i - 1) === '"')) {
            s3 += 1}
           else len += 1;
          lastchar = s0a.charAt(s2 - i - 1);
          s2 += 1;
          if (((s2 - i) <= s0a.length) && (s0a.charAt(s2 - i - 1) === " ") && pas.System.Odd(q)) {
            lastchar = s0a.charAt(s2 - i - 1);
            s2 += 1;
          };
        };
        if ((len > 0) && (lastchar === '"')) len -= 1;
        compstr = pas.System.Copy(s0a,s3,len);
        pas.System.val$8($impl.StripThousandSep(s1a),{get: function () {
            return n1;
          }, set: function (v) {
            n1 = v;
          }},{get: function () {
            return code1;
          }, set: function (v) {
            code1 = v;
          }});
        pas.System.val$8($impl.StripThousandSep(compstr),{get: function () {
            return n2;
          }, set: function (v) {
            n2 = v;
          }},{get: function () {
            return code2;
          }, set: function (v) {
            code2 = v;
          }});
        dt2 = 0;
        if ($impl.IsDate(compstr,{get: function () {
            return dt2;
          }, set: function (v) {
            dt2 = v;
          }})) code2 = 1;
        dt1 = 0;
        if ($impl.IsDate(s1a,{get: function () {
            return dt1;
          }, set: function (v) {
            dt1 = v;
          }})) code1 = 1;
        if ((code1 === 0) && (code2 === 0)) {
          if (equal) {
            oklarger = n1 >= n2}
           else oklarger = n1 > n2;
        } else {
          if ($impl.IsDate(compstr,{get: function () {
              return dt2;
            }, set: function (v) {
              dt2 = v;
            }}) && $impl.IsDate(s1a,{get: function () {
              return dt1;
            }, set: function (v) {
              dt1 = v;
            }})) {
            if (equal) {
              oklarger = dt1 >= dt2}
             else oklarger = dt1 > dt2;
          } else {
            if (equal) {
              oklarger = pas.SysUtils.CompareStr(compstr,s1a) <= 0}
             else oklarger = pas.SysUtils.CompareStr(compstr,s1a) < 0;
          };
        };
        flag1 = true;
      };
      equal = false;
      s2 = pas.System.Pos(smaller,s0a);
      if (s2 !== 0) {
        s2 += 1;
        if (s0a.charAt(s2 - i - 1) === "=") {
          equal = true;
          s2 += 1;
        };
        lastchar = "\x00";
        while (((s2 - i) <= s0a.length) && (s0a.charAt(s2 - i - 1) === " ")) s2 += 1;
        s3 = s2;
        len = 0;
        q = 0;
        while (((s2 - i) <= s0a.length) && (s0a.charAt(s2 - i - 1) !== " ") && (s2 <= s0a.length) && (pas.System.Odd(q) || ((s0a.charAt(s2 - i - 1) !== "&") && (s0a.charAt(s2 - i - 1) !== "|")))) {
          if (s0a.charAt(s2 - i - 1) === '"') q += 1;
          if ((len === 0) && (s0a.charAt(s2 - i - 1) === '"')) {
            s3 += 1}
           else len += 1;
          lastchar = s0a.charAt(s2 - i - 1);
          s2 += 1;
        };
        if ((len > 0) && (lastchar === '"')) len -= 1;
        compstr = pas.System.Copy(s0a,s3,len);
        pas.System.val$8($impl.StripThousandSep(s1a),{get: function () {
            return n1;
          }, set: function (v) {
            n1 = v;
          }},{get: function () {
            return code1;
          }, set: function (v) {
            code1 = v;
          }});
        pas.System.val$8($impl.StripThousandSep(compstr),{get: function () {
            return n2;
          }, set: function (v) {
            n2 = v;
          }},{get: function () {
            return code2;
          }, set: function (v) {
            code2 = v;
          }});
        if ($impl.IsDate(compstr,{get: function () {
            return dt2;
          }, set: function (v) {
            dt2 = v;
          }})) code2 = 1;
        if ($impl.IsDate(s1a,{get: function () {
            return dt1;
          }, set: function (v) {
            dt1 = v;
          }})) code1 = 1;
        if ((code1 === 0) && (code2 === 0)) {
          if (equal) {
            oksmaller = n1 <= n2}
           else oksmaller = n1 < n2;
        } else {
          if ($impl.IsDate(compstr,{get: function () {
              return dt2;
            }, set: function (v) {
              dt2 = v;
            }}) && $impl.IsDate(s1a,{get: function () {
              return dt1;
            }, set: function (v) {
              dt1 = v;
            }})) {
            if (equal) {
              oksmaller = dt1 <= dt2}
             else oksmaller = dt1 < dt2;
          } else {
            if (equal) {
              oksmaller = pas.SysUtils.CompareStr(compstr,s1a) >= 0}
             else oksmaller = pas.SysUtils.CompareStr(compstr,s1a) > 0;
          };
        };
        flag2 = true;
      };
      s2 = pas.System.Pos(negation,s0a);
      if (s2 !== 0) {
        s2 += 1;
        while (s0a.charAt(s2 - i - 1) === " ") s2 += 1;
        s3 = s2;
        len = 0;
        lastchar = "\x00";
        q = 0;
        while ((s0a.charAt(s2 - i - 1) !== " ") && (s2 <= s0a.length) && (pas.System.Odd(q) || ((s0a.charAt(s2 - i - 1) !== "&") && (s0a.charAt(s2 - i - 1) !== "|")))) {
          if (s0a.charAt(s2 - i - 1) === '"') q += 1;
          if ((len === 0) && (s0a.charAt(s2 - i - 1) === '"')) {
            s3 += 1}
           else len += 1;
          lastchar = s0a.charAt(s2 - i - 1);
          s2 += 1;
        };
        if ((len > 0) && (lastchar === '"')) len -= 1;
        compstr = pas.System.Copy(s0a,s3,len);
        flag3 = true;
      };
      if (flag3) {
        if (pas.System.Pos(larger,s0a) === 0) flag1 = flag3;
        if (pas.System.Pos(smaller,s0a) === 0) flag2 = flag3;
      };
      if (pas.System.Pos(logor,s0a) !== 0) if (flag1 || flag2) {
        Result = oksmaller || oklarger;
        return Result;
      };
      if (pas.System.Pos(logand,s0a) !== 0) if (flag1 && flag2) {
        Result = oksmaller && oklarger;
        return Result;
      };
      if (((pas.System.Pos(larger,s0a) !== 0) && oklarger) || ((pas.System.Pos(smaller,s0a) !== 0) && oksmaller)) {
        Result = true;
        return Result;
      };
      s0 = 1;
      s1 = 1;
      done = (s0a === "") || (s1a === "");
      matching = true;
      while (!done && matching) {
        var $tmp = s0a.charAt(s0 - i - 1);
        if ($tmp === qmark) {
          matching = s1 <= s1a.length;
          if (matching) {
            s0 += 1;
            s1 += 1;
          };
        } else if ($tmp === negation) {
          negflag = true;
          s0 += 1;
        } else if ($tmp === '"') {
          s0 += 1;
        } else if ($tmp === asterix) {
          do {
            s0 += 1;
          } while (!(((s0 - i) > s0a.length) || (s0a.charAt(s0 - i - 1) !== asterix)));
          len = s1a.length - s1;
          s1 += len;
          matching = $impl.Matches(pas.System.Copy(s0a,s0,s0a.length),pas.System.Copy(s1a,s1,s1a.length));
          while ((len >= 0) && !matching) {
            s1 -= 1;
            len -= 1;
            matching = $impl.Matches(pas.System.Copy(s0a,s0,s0a.length),pas.System.Copy(s1a,s1,s1a.length));
          };
          if (matching) {
            s0 = s0a.length + 1;
            s1 = s1a.length + 1;
          };
        } else {
          if ((s0 <= s0a.length) && (s1 <= s1a.length)) {
            matching = s0a.charAt(s0 - i - 1) === s1a.charAt(s1 - i - 1)}
           else matching = false;
          if (matching) {
            s0 += 1;
            s1 += 1;
          };
        };
        done = (s0 > s0a.length) && (s1 > s1a.length);
      };
      if (negflag) {
        Result = !matching}
       else Result = matching;
      return Result;
    };
    $impl.StripLogicSpaces = function (AValue) {
      var Result = "";
      var i = 0;
      var k = 0;
      var q = 0;
      q = 0;
      i = 1;
      k = AValue.length;
      Result = "";
      while (i <= k) {
        if (AValue.charAt(i - 1) === '"') q += 1;
        if (AValue.charAt(i - 1) === " ") {
          if (pas.System.Odd(q)) Result = Result + AValue.charAt(i - 1);
        } else Result = Result + AValue.charAt(i - 1);
        i += 1;
      };
      return Result;
    };
    $impl.FirstChar = function (ACharset, AValue, spos) {
      var Result = "\x00";
      var i = 0;
      var q = 0;
      var j = 0;
      j = 1;
      i = 1;
      q = 0;
      spos.set(-1);
      Result = "\x00";
      while (i <= AValue.length) {
        if (AValue.charAt(i - j - 1) === '"') q += 1;
        if (pas.SysUtils.CharInSet(AValue.charAt(i - j - 1),ACharset) && !pas.System.Odd(q)) {
          spos.set(i);
          Result = AValue.charAt(i - j - 1);
          break;
        };
        i += 1;
      };
      return Result;
    };
    $impl.ClosingParenthesis = function (s1) {
      var Result = 0;
      var i = 0;
      var j = 0;
      var k = 0;
      var r = 0;
      r = 0;
      j = 0;
      k = 0;
      i = 1;
      while (i <= s1.length) {
        if (s1.charAt(i - 1) === ")") k += 1;
        if (s1.charAt(i - 1) === "(") j += 1;
        if ((s1.charAt(i - 1) === ")") && (j === k)) {
          r = i;
          break;
        };
        i += 1;
      };
      Result = r;
      return Result;
    };
  };
},["RTLConsts","WEBLib.Consts","RTTI","WEBLib.REST"]);
rtl.module("WEBLib.Controls",["System","Classes","WEBLib.Graphics","Types","SysUtils","Web","JS"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.VK_CANCEL = 3;
  this.VK_BACK = 8;
  this.VK_TAB = 9;
  this.VK_RETURN = 13;
  this.VK_SHIFT = 16;
  this.VK_CONTROL = 17;
  this.VK_MENU = 18;
  this.VK_PAUSE = 19;
  this.VK_CAPITAL = 20;
  this.VK_ESCAPE = 27;
  this.VK_SPACE = 32;
  this.VK_PRIOR = 33;
  this.VK_NEXT = 34;
  this.VK_END = 35;
  this.VK_HOME = 36;
  this.VK_LEFT = 37;
  this.VK_UP = 38;
  this.VK_RIGHT = 39;
  this.VK_DOWN = 40;
  this.VK_PRINT = 42;
  this.VK_SNAPSHOT = 44;
  this.VK_INSERT = 45;
  this.VK_DELETE = 46;
  this.VK_HELP = 47;
  this.VK_LWIN = 91;
  this.VK_RWIN = 92;
  this.VK_NUMPAD0 = 96;
  this.VK_NUMPAD1 = 97;
  this.VK_NUMPAD2 = 98;
  this.VK_NUMPAD3 = 99;
  this.VK_NUMPAD4 = 100;
  this.VK_NUMPAD5 = 101;
  this.VK_NUMPAD6 = 102;
  this.VK_NUMPAD7 = 103;
  this.VK_NUMPAD8 = 104;
  this.VK_NUMPAD9 = 105;
  this.VK_MULTIPLY = 106;
  this.VK_ADD = 107;
  this.VK_SEPARATOR = 108;
  this.VK_SUBTRACT = 109;
  this.VK_DECIMAL = 110;
  this.VK_DIVIDE = 111;
  this.VK_F1 = 112;
  this.VK_F2 = 113;
  this.VK_F3 = 114;
  this.VK_F4 = 115;
  this.VK_F5 = 116;
  this.VK_F6 = 117;
  this.VK_F7 = 118;
  this.VK_F8 = 119;
  this.VK_F9 = 120;
  this.VK_F10 = 121;
  this.VK_F11 = 122;
  this.VK_F12 = 123;
  this.VK_F13 = 124;
  this.VK_F14 = 125;
  this.VK_F15 = 126;
  this.VK_F16 = 127;
  this.VK_F17 = 128;
  this.VK_F18 = 129;
  this.VK_F19 = 130;
  this.VK_F20 = 131;
  this.VK_F21 = 132;
  this.VK_F22 = 133;
  this.VK_F23 = 134;
  this.VK_F24 = 135;
  this.VK_NUMLOCK = 144;
  this.WHEEL_DELTA = 120;
  this.RELEASETIMEOUT = 150;
  this.$rtti.$inherited("TCursor",rtl.longint,{});
  this.crDefault = 0;
  this.crNone = 1;
  this.crArrow = 2;
  this.crCross = 3;
  this.crIBeam = 4;
  this.crSize = 5;
  this.crSizeNESW = 6;
  this.crSizeNS = 7;
  this.crSizeNWSE = 8;
  this.crSizeWE = 9;
  this.crUpArrow = 10;
  this.crHourGlass = 11;
  this.crDrag = 12;
  this.crNoDrop = 13;
  this.crHSplit = 14;
  this.crVSplit = 15;
  this.crMultIDrag = 16;
  this.crSQLWait = 17;
  this.crNo = 18;
  this.crAppStart = 19;
  this.crHelp = 20;
  this.crHandPoint = 21;
  this.crSizeAll = 22;
  this.CSSBackground = "background-color";
  this.CSSZIndex = "z-index";
  this.$rtti.$Class("TCSSCodeManager");
  this.TCSSLibrary = {"0": "cssNone", cssNone: 0, "1": "cssBootstrap", cssBootstrap: 1};
  this.$rtti.$Enum("TCSSLibrary",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TCSSLibrary});
  this.TDragState = {"0": "dsDragEnter", dsDragEnter: 0, "1": "dsDragLeave", dsDragLeave: 1, "2": "dsDragMove", dsDragMove: 2};
  this.$rtti.$Enum("TDragState",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TDragState});
  this.TDragMode = {"0": "dmManual", dmManual: 0, "1": "dmAutomatic", dmAutomatic: 1};
  this.$rtti.$Enum("TDragMode",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TDragMode});
  this.TDragKind = {"0": "dkDrag", dkDrag: 0, "1": "dkDock", dkDock: 1};
  this.$rtti.$Enum("TDragKind",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TDragKind});
  rtl.createClass(this,"TDragObject",pas.System.TObject,function () {
  });
  this.TAlign = {"0": "alNone", alNone: 0, "1": "alTop", alTop: 1, "2": "alBottom", alBottom: 2, "3": "alLeft", alLeft: 3, "4": "alRight", alRight: 4, "5": "alClient", alClient: 5, "6": "alCustom", alCustom: 6};
  this.$rtti.$Enum("TAlign",{minvalue: 0, maxvalue: 6, ordtype: 1, enumtype: this.TAlign});
  this.TMouseButton = {"0": "mbLeft", mbLeft: 0, "1": "mbRight", mbRight: 1, "2": "mbMiddle", mbMiddle: 2};
  this.$rtti.$Enum("TMouseButton",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TMouseButton});
  this.TBorderStyle = {"0": "bsNone", bsNone: 0, "1": "bsSingle", bsSingle: 1};
  this.$rtti.$Enum("TBorderStyle",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TBorderStyle});
  this.TSizeStyle = {"0": "ssPercent", ssPercent: 0, "1": "ssAbsolute", ssAbsolute: 1, "2": "ssAuto", ssAuto: 2};
  this.$rtti.$Enum("TSizeStyle",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TSizeStyle});
  this.TScrollStyle = {"0": "ssNone", ssNone: 0, "1": "ssHorizontal", ssHorizontal: 1, "2": "ssVertical", ssVertical: 2, "3": "ssBoth", ssBoth: 3};
  this.$rtti.$Enum("TScrollStyle",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TScrollStyle});
  this.TStyleElements$a = {"0": "seFont", seFont: 0, "1": "seClient", seClient: 1, "2": "seBorder", seBorder: 2};
  this.$rtti.$Enum("TStyleElements$a",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TStyleElements$a});
  this.$rtti.$Set("TStyleElements",{comptype: this.$rtti["TStyleElements$a"]});
  this.TAnchorKind = {"0": "akLeft", akLeft: 0, "1": "akTop", akTop: 1, "2": "akRight", akRight: 2, "3": "akBottom", akBottom: 3};
  this.$rtti.$Enum("TAnchorKind",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TAnchorKind});
  this.$rtti.$Set("TAnchors",{comptype: this.$rtti["TAnchorKind"]});
  this.$rtti.$inherited("TElementClassName",rtl.string,{});
  this.$rtti.$inherited("TElementID",rtl.string,{});
  this.TElementFont = {"0": "efProperty", efProperty: 0, "1": "efCSS", efCSS: 1};
  this.$rtti.$Enum("TElementFont",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TElementFont});
  this.TElementPosition = {"0": "epAbsolute", epAbsolute: 0, "1": "epRelative", epRelative: 1, "2": "epIgnore", epIgnore: 2};
  this.$rtti.$Enum("TElementPosition",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TElementPosition});
  this.TElementEvent = {"0": "eeClick", eeClick: 0, "1": "eeMouseDown", eeMouseDown: 1, "2": "eeMouseUp", eeMouseUp: 2, "3": "eeMouseMove", eeMouseMove: 3, "4": "eeDblClick", eeDblClick: 4, "5": "eeKeyPress", eeKeyPress: 5, "6": "eeKeyDown", eeKeyDown: 6, "7": "eeKeyUp", eeKeyUp: 7, "8": "eeTouchStart", eeTouchStart: 8, "9": "eeTouchMove", eeTouchMove: 9, "10": "eeTouchEnd", eeTouchEnd: 10};
  this.$rtti.$Enum("TElementEvent",{minvalue: 0, maxvalue: 10, ordtype: 1, enumtype: this.TElementEvent});
  this.$rtti.$Set("TEventPropagation",{comptype: this.$rtti["TElementEvent"]});
  this.TTextDirection = {"0": "tdDefault", tdDefault: 0, "1": "tdLeftToRight", tdLeftToRight: 1, "2": "tdRightToLeft", tdRightToLeft: 2, "3": "tdInherit", tdInherit: 3};
  this.$rtti.$Enum("TTextDirection",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TTextDirection});
  this.TBevelCut = {"0": "bvNone", bvNone: 0, "1": "bvLowered", bvLowered: 1, "2": "bvRaised", bvRaised: 2, "3": "bvSpace", bvSpace: 3};
  this.$rtti.$Enum("TBevelCut",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TBevelCut});
  this.TBevelEdge = {"0": "beLeft", beLeft: 0, "1": "beTop", beTop: 1, "2": "beRight", beRight: 2, "3": "beBottom", beBottom: 3};
  this.$rtti.$Enum("TBevelEdge",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TBevelEdge});
  this.$rtti.$Set("TBevelEdges",{comptype: this.$rtti["TBevelEdge"]});
  this.TBevelKind = {"0": "bkNone", bkNone: 0, "1": "bkTile", bkTile: 1, "2": "bkSoft", bkSoft: 2, "3": "bkFlat", bkFlat: 3};
  this.$rtti.$Enum("TBevelKind",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TBevelKind});
  this.TInputType = {"0": "itText", itText: 0, "1": "itEmail", itEmail: 1, "2": "itDate", itDate: 2, "3": "itDateTime", itDateTime: 3, "4": "itFile", itFile: 4, "5": "itMonth", itMonth: 5, "6": "itNumber", itNumber: 6, "7": "itPassword", itPassword: 7, "8": "itSearch", itSearch: 8, "9": "itTime", itTime: 9, "10": "itURL", itURL: 10, "11": "itWeek", itWeek: 11};
  this.$rtti.$Enum("TInputType",{minvalue: 0, maxvalue: 11, ordtype: 1, enumtype: this.TInputType});
  this.TMaterialGlyphType = {"0": "mgNormal", mgNormal: 0, "1": "mgOutlined", mgOutlined: 1, "2": "mgTwoTone", mgTwoTone: 2, "3": "mgRound", mgRound: 3, "4": "mgSharp", mgSharp: 4};
  this.$rtti.$Enum("TMaterialGlyphType",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TMaterialGlyphType});
  rtl.recNewT(this,"TJSXMLHttpRequestRecord",function () {
    this.req = null;
    this.$eq = function (b) {
      return this.req === b.req;
    };
    this.$assign = function (s) {
      this.req = s.req;
      return this;
    };
    var $r = $mod.$rtti.$Record("TJSXMLHttpRequestRecord",{},this);
    $r.addField("req",pas.Web.$rtti["TJSXMLHttpRequest"]);
  });
  rtl.recNewT(this,"TJSEventRecord",function () {
    this.event = null;
    this.$eq = function (b) {
      return this.event === b.event;
    };
    this.$assign = function (s) {
      this.event = s.event;
      return this;
    };
    var $r = $mod.$rtti.$Record("TJSEventRecord",{},this);
    $r.addField("event",pas.Web.$rtti["TJSEvent"]);
  });
  this.$rtti.$MethodVar("THTTPResponseEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AResponse",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("THTTPRequestResponseEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ARequest",this.$rtti["TJSXMLHttpRequestRecord"]],["AResponse",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("THTTPAbortEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]]]), methodkind: 0});
  this.$rtti.$MethodVar("THTTPErrorEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ARequest",this.$rtti["TJSXMLHttpRequestRecord"]],["Event",this.$rtti["TJSEventRecord"]],["Handled",rtl.boolean,1]]), methodkind: 0});
  rtl.recNewT(this,"TJSHTMLElementRecord",function () {
    this.element = null;
    this.$eq = function (b) {
      return this.element === b.element;
    };
    this.$assign = function (s) {
      this.element = s.element;
      return this;
    };
    var $r = $mod.$rtti.$Record("TJSHTMLElementRecord",{},this);
    $r.addField("element",pas.Web.$rtti["TJSHTMLElement"]);
  });
  rtl.recNewT(this,"TJSObjectRecord",function () {
    this.jsobject = null;
    this.$eq = function (b) {
      return this.jsobject === b.jsobject;
    };
    this.$assign = function (s) {
      this.jsobject = s.jsobject;
      return this;
    };
    var $r = $mod.$rtti.$Record("TJSObjectRecord",{},this);
    $r.addField("jsobject",pas.JS.$rtti["TJSObject"]);
  });
  rtl.recNewT(this,"TJSArrayRecord",function () {
    this.jsarray = null;
    this.$eq = function (b) {
      return this.jsarray === b.jsarray;
    };
    this.$assign = function (s) {
      this.jsarray = s.jsarray;
      return this;
    };
    var $r = $mod.$rtti.$Record("TJSArrayRecord",{},this);
    $r.addField("jsarray",pas.JS.$rtti["TJSArray"]);
  });
  rtl.recNewT(this,"TJSArrayBufferRecord",function () {
    this.jsarraybuffer = null;
    this.$eq = function (b) {
      return this.jsarraybuffer === b.jsarraybuffer;
    };
    this.$assign = function (s) {
      this.jsarraybuffer = s.jsarraybuffer;
      return this;
    };
    var $r = $mod.$rtti.$Record("TJSArrayBufferRecord",{},this);
    $r.addField("jsarraybuffer",pas.JS.$rtti["TJSArrayBuffer"]);
  });
  rtl.createClass(this,"TDragSourceObject",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FJSEvent = null;
      this.FObject = null;
    };
    this.$final = function () {
      this.FJSEvent = undefined;
      this.FObject = undefined;
      pas.System.TObject.$final.call(this);
    };
  });
  this.$rtti.$MethodVar("TNotifyEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TMouseEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Button",this.$rtti["TMouseButton"]],["Shift",pas.Classes.$rtti["TShiftState"]],["X",rtl.longint],["Y",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TMouseWheelEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Shift",pas.Classes.$rtti["TShiftState"]],["WheelDelta",rtl.longint],["MousePos",pas.Types.$rtti["TPoint"]],["Handled",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TMouseWheelUpDownEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Shift",pas.Classes.$rtti["TShiftState"]],["MousePos",pas.Types.$rtti["TPoint"]],["Handled",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TMouseMoveEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Shift",pas.Classes.$rtti["TShiftState"]],["X",rtl.longint],["Y",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TKeyEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AKey",rtl.word,1],["Shift",pas.Classes.$rtti["TShiftState"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TKeyPressEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AChar",rtl.char,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTouchEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["X",rtl.longint],["Y",rtl.longint]]), methodkind: 0});
  this.TBiDiMode = {"0": "bdLeftToRight", bdLeftToRight: 0, "1": "bdRightToLeft", bdRightToLeft: 1, "2": "bdRightToLeftNoAlign", bdRightToLeftNoAlign: 2, "3": "bdRightToLeftReadingOnly", bdRightToLeftReadingOnly: 3};
  this.$rtti.$Enum("TBiDiMode",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TBiDiMode});
  this.$rtti.$MethodVar("TDragOverEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Source",pas.System.$rtti["TObject"]],["X",rtl.longint],["Y",rtl.longint],["State",this.$rtti["TDragState"]],["Accept",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TDragDropEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Source",pas.System.$rtti["TObject"]],["X",rtl.longint],["Y",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TStartDragEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["DragObject",this.$rtti["TDragObject"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TEndDragEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Target",pas.System.$rtti["TObject"]],["X",rtl.longint],["Y",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TScreenshotEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ABitmap",pas["WEBLib.Graphics"].$rtti["TBitmap"]]]), methodkind: 0});
  this.TControlStyleValue = {"0": "csAcceptsControls", csAcceptsControls: 0, "1": "csSetCaption", csSetCaption: 1};
  this.$rtti.$Enum("TControlStyleValue",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TControlStyleValue});
  this.$rtti.$Set("TControlStyle",{comptype: this.$rtti["TControlStyleValue"]});
  rtl.createClass(this,"TMargins",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FOnChange = null;
      this.FLeft = 0;
      this.FTop = 0;
      this.FRight = 0;
      this.FBottom = 0;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetLeft = function (Value) {
      if (Value !== this.FLeft) {
        this.FLeft = Value;
        this.DoChange();
      };
    };
    this.SetTop = function (Value) {
      if (Value !== this.FTop) {
        this.FTop = Value;
        this.DoChange();
      };
    };
    this.SetRight = function (Value) {
      if (Value !== this.FRight) {
        this.FRight = Value;
        this.DoChange();
      };
    };
    this.SetBottom = function (Value) {
      if (Value !== this.FBottom) {
        this.FBottom = Value;
        this.DoChange();
      };
    };
    this.DoChange = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Create$1 = function () {
      this.FLeft = 3;
      this.FTop = 3;
      this.FBottom = 3;
      this.FRight = 3;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TMargins.isPrototypeOf(Source)) {
        this.FLeft = rtl.as(Source,$mod.TMargins).FLeft;
        this.FTop = rtl.as(Source,$mod.TMargins).FTop;
        this.FBottom = rtl.as(Source,$mod.TMargins).FBottom;
        this.FRight = rtl.as(Source,$mod.TMargins).FRight;
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    var $r = this.$rtti;
    $r.addProperty("Left",2,rtl.longint,"FLeft","SetLeft",4,{Default: 3});
    $r.addProperty("Top",2,rtl.longint,"FTop","SetTop",4,{Default: 3});
    $r.addProperty("Right",2,rtl.longint,"FRight","SetRight",4,{Default: 3});
    $r.addProperty("Bottom",2,rtl.longint,"FBottom","SetBottom",4,{Default: 3});
  });
  rtl.createClass(this,"TCenter",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FHorizontal = false;
      this.FVertical = false;
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetHorizontal = function (Value) {
      if (this.FHorizontal !== Value) {
        this.FHorizontal = Value;
        this.DoChange();
      };
    };
    this.SetVertical = function (Value) {
      if (this.FVertical !== Value) {
        this.FVertical = Value;
        this.DoChange();
      };
    };
    this.DoChange = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Assign = function (Source) {
      if ($mod.TCenter.isPrototypeOf(Source)) {
        this.FHorizontal = rtl.as(Source,$mod.TCenter).FHorizontal;
        this.FVertical = rtl.as(Source,$mod.TCenter).FVertical;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Horizontal",2,rtl.boolean,"FHorizontal","SetHorizontal",4,{Default: false});
    $r.addProperty("Vertical",2,rtl.boolean,"FVertical","SetVertical",4,{Default: false});
  });
  rtl.createClass(this,"TPadding",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FOnChange = null;
      this.FLeft = 0;
      this.FTop = 0;
      this.FRight = 0;
      this.FBottom = 0;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetLeft = function (Value) {
      if (this.FLeft !== Value) {
        this.FLeft = Value;
        this.DoChange();
      };
    };
    this.SetTop = function (Value) {
      if (this.FTop !== Value) {
        this.FTop = Value;
        this.DoChange();
      };
    };
    this.SetRight = function (Value) {
      if (this.FRight !== Value) {
        this.FRight = Value;
        this.DoChange();
      };
    };
    this.SetBottom = function (Value) {
      if (this.FBottom !== Value) {
        this.FBottom = Value;
        this.DoChange();
      };
    };
    this.DoChange = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FLeft = 0;
      this.FTop = 0;
      this.FRight = 0;
      this.FBottom = 0;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TPadding.isPrototypeOf(Source)) {
        this.FLeft = rtl.as(Source,$mod.TPadding).FLeft;
        this.FRight = rtl.as(Source,$mod.TPadding).FRight;
        this.FTop = rtl.as(Source,$mod.TPadding).FTop;
        this.FBottom = rtl.as(Source,$mod.TPadding).FBottom;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Left",2,rtl.longint,"FLeft","SetLeft",4,{Default: 0});
    $r.addProperty("Top",2,rtl.longint,"FTop","SetTop",4,{Default: 0});
    $r.addProperty("Right",2,rtl.longint,"FRight","SetRight",4,{Default: 0});
    $r.addProperty("Bottom",2,rtl.longint,"FBottom","SetBottom",4,{Default: 0});
  });
  rtl.createInterface(this,"IControl","{6325F220-F2E4-384C-B7C4-A6C697D13DCF}",["EnterChildren","ExitChildren"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("EnterChildren",1,[["AObject",$r]],2,rtl.boolean);
    $r.addMethod("ExitChildren",1,[["AObject",$r]],2,rtl.boolean);
  });
  rtl.createClass(this,"TControl",pas.Classes.TComponent,function () {
    this.$init = function () {
      pas.Classes.TComponent.$init.call(this);
      this.FGotFocus = false;
      this.FAcceptDrag = false;
      this.FCaptureDown = false;
      this.FMouseInsideLayer = false;
      this.FLayer = null;
      this.FCaptured = false;
      this.FControlCreated = false;
      this.FUpdateCount = 0;
      this.FBlockUpdateElement = false;
      this.FElement = null;
      this.FID = "";
      this.FNew = false;
      this.FContainer = null;
      this.FElementEvent = null;
      this.FLastElementEvent = null;
      this.FElementClassName = "";
      this.FFont = null;
      this.FParent = null;
      this.FPrevParent = null;
      this.FControls = [];
      this.FOnDragOver = null;
      this.FOnDragDrop = null;
      this.FOnStartDrag = null;
      this.FonEndDrag = null;
      this.FOnClick = null;
      this.FOnDblClick = null;
      this.FOnMouseDown = null;
      this.FOnMouseUp = null;
      this.FOnMouseMove = null;
      this.FOnKeyDown = null;
      this.FOnKeyUp = null;
      this.FOnKeyPress = null;
      this.FOnEnter = null;
      this.FOnExit = null;
      this.FEnabled = false;
      this.FHint = "";
      this.FRole = "";
      this.FShowHint = false;
      this.FTabOrder = 0;
      this.FTabStop = false;
      this.FVisible = false;
      this.FWidth = 0;
      this.FHeight = 0;
      this.FTag$1 = 0;
      this.FAlign = 0;
      this.FAnchors = {};
      this.FAlignWithMargins = false;
      this.FIsAligning = false;
      this.FOnMouseEnter = null;
      this.FOnMouseLeave = null;
      this.FCursor = 0;
      this.FDoubleBuffered = false;
      this.FControlStyle = {};
      this.FMargins = null;
      this.FCenter = null;
      this.FOnMouseWheel = null;
      this.FParentDoubleBuffered = false;
      this.FParentColor = false;
      this.FParentFont = false;
      this.FParentBiDiMode = false;
      this.FOnTouchMove = null;
      this.FOnTouchStart = null;
      this.FOnTouchEnd = null;
      this.FOnTouchCancel = null;
      this.FLinkTouchEvents = false;
      this.FWidthStyle = 0;
      this.FHeightStyle = 0;
      this.FWidthPercent = 0.0;
      this.FHeightPercent = 0.0;
      this.FOrigRect = pas.Types.TRect.$new();
      this.FOrigParentRect = pas.Types.TRect.$new();
      this.FIsResizing = false;
      this.FShowFocus = false;
      this.FBorderWidth = 0;
      this.FOrigTop = 0;
      this.FOrigLeft = 0;
      this.FUpdateTopLeft = false;
      this.FEnablePropagation = false;
      this.FParentShowHint = false;
      this.FScriptLoaded = false;
      this.FControlScriptCount = 0;
      this.FControlScriptCountLoaded = 0;
      this.FRequiredScripts = null;
      this.FElementFont = 0;
      this.FElementPosition = 0;
      this.FParentElement = null;
      this.FTagObject = null;
      this.FClipChildren = false;
      this.FTextDirection = 0;
      this.FEventStopPropagation = {};
      this.FParentElementID = "";
      this.FOnResize = null;
      this.FMouseMovePtr = null;
      this.FMouseDownPtr = null;
      this.FMouseUpPtr = null;
      this.FMouseEnterPtr = null;
      this.FMouseLeavePtr = null;
      this.FClickPtr = null;
      this.FDblClickPtr = null;
      this.FKeyDownPtr = null;
      this.FKeyUpPtr = null;
      this.FKeyPressPtr = null;
      this.FInputPtr = null;
      this.FTouchStartPtr = null;
      this.FTouchEndPtr = null;
      this.FTouchMovePtr = null;
      this.FTouchCancelPtr = null;
      this.FContextMenuPtr = null;
      this.FExitPtr = null;
      this.FEnterPtr = null;
      this.FWheelPtr = null;
      this.FLayerMouseEnterPtr = null;
      this.FLayerMouseLeavePtr = null;
      this.FScriptLoadedPtr = null;
      this.FDragStartPtr = null;
      this.FDragOverPtr = null;
      this.FDragEnterPtr = null;
      this.FDragLeavePtr = null;
      this.FDragEndPtr = null;
      this.FDragDropPtr = null;
      this.FChildOrder = 0;
      this.FAllowTouch = false;
      this.FCtl3D = false;
      this.FParentCtl3D = false;
      this.FWheelAccumulator = 0;
      this.FWheelMousePos = pas.Types.TPoint.$new();
      this.FBiDiMode = 0;
      this.FOnMouseWheelDown = null;
      this.FOnMouseWheelUp = null;
      this.FNoUserSelect = false;
      this.FEventsBound = false;
      this.FDragMode = 0;
      this.FToolTip = undefined;
      this.FDesignTime = false;
      this.FColor = 0;
    };
    this.$final = function () {
      this.FLayer = undefined;
      this.FElement = undefined;
      this.FContainer = undefined;
      this.FElementEvent = undefined;
      this.FLastElementEvent = undefined;
      this.FFont = undefined;
      this.FParent = undefined;
      this.FPrevParent = undefined;
      this.FControls = undefined;
      this.FOnDragOver = undefined;
      this.FOnDragDrop = undefined;
      this.FOnStartDrag = undefined;
      this.FonEndDrag = undefined;
      this.FOnClick = undefined;
      this.FOnDblClick = undefined;
      this.FOnMouseDown = undefined;
      this.FOnMouseUp = undefined;
      this.FOnMouseMove = undefined;
      this.FOnKeyDown = undefined;
      this.FOnKeyUp = undefined;
      this.FOnKeyPress = undefined;
      this.FOnEnter = undefined;
      this.FOnExit = undefined;
      this.FAnchors = undefined;
      this.FOnMouseEnter = undefined;
      this.FOnMouseLeave = undefined;
      this.FControlStyle = undefined;
      this.FMargins = undefined;
      this.FCenter = undefined;
      this.FOnMouseWheel = undefined;
      this.FOnTouchMove = undefined;
      this.FOnTouchStart = undefined;
      this.FOnTouchEnd = undefined;
      this.FOnTouchCancel = undefined;
      this.FOrigRect = undefined;
      this.FOrigParentRect = undefined;
      this.FRequiredScripts = undefined;
      this.FParentElement = undefined;
      this.FTagObject = undefined;
      this.FEventStopPropagation = undefined;
      this.FOnResize = undefined;
      this.FWheelMousePos = undefined;
      this.FOnMouseWheelDown = undefined;
      this.FOnMouseWheelUp = undefined;
      pas.Classes.TComponent.$final.call(this);
    };
    this.GetControlsCount = function () {
      var Result = 0;
      Result = rtl.length(this.FControls);
      return Result;
    };
    this.GetControls = function (Index) {
      var Result = null;
      Result = this.FControls[Index];
      return Result;
    };
    this.SetVisible = function (AValue) {
      if (this.FVisible !== AValue) {
        this.VisibleChanging();
        this.FVisible = AValue;
        this.UpdateElement();
        this.DoRealign();
        this.AlignControl(this);
        this.VisibleChanged();
      };
    };
    this.SetHint = function (AValue) {
      if (this.FHint !== AValue) {
        this.FHint = AValue;
        this.UpdateElement();
      };
    };
    this.SetShowHint = function (AValue) {
      if (this.FShowHint !== AValue) {
        this.FShowHint = AValue;
        this.UpdateElement();
      };
    };
    this.SetTabOrder = function (AValue) {
      if (this.FTabOrder !== AValue) {
        this.FTabOrder = AValue;
        this.UpdateElement();
      };
    };
    this.SetTabStop = function (AValue) {
      if (this.FTabStop !== AValue) {
        this.FTabStop = AValue;
        this.UpdateElement();
      };
    };
    this.SetAlign = function (Value) {
      if (this.FAlign !== Value) {
        this.FAlign = Value;
        this.DoRealign();
      };
    };
    this.SetAlignWithMargins = function (Value) {
      if (this.FAlignWithMargins !== Value) {
        this.FAlignWithMargins = Value;
        this.DoRealign();
      };
    };
    this.GetBoundsRect = function () {
      var Result = pas.Types.TRect.$new();
      Result.Left = this.GetLeft();
      Result.Top = this.GetTop();
      Result.Right = this.GetLeft() + this.GetWidth();
      Result.Bottom = this.GetTop() + this.GetHeight();
      return Result;
    };
    this.SetBoundsRect = function (Value) {
      this.SetBoundsInt(Value.Left,Value.Top,Value.Right - Value.Left,Value.Bottom - Value.Top);
    };
    this.SetID = function (Value) {
      var eh = null;
      var el = null;
      var tmp = null;
      var frm = null;
      var p = null;
      var l = 0;
      var t = 0;
      var w = 0;
      var h = 0;
      if (this.FNew && (this.FID !== Value)) {
        eh = document.getElementById(Value);
        if (eh != null) {
          l = this.FLeft;
          t = this.FTop;
          w = this.FWidth;
          h = this.FHeight;
          tmp = null;
          this.UnbindEvents();
          if (this.FContainer != null) {
            this.FParentElement = this.FContainer.parentElement;
            tmp = document.createElement("SPAN");
            this.$class.MoveElements(this.FContainer,tmp);
          };
          p = this.FParent;
          this.SetParent(null);
          this.CreateWithID(Value);
          this.SetParentComponent(p);
          this.FID = Value;
          this.FWidth = w;
          this.FHeight = h;
          this.UpdateElement();
          if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
            this.FLeft = l;
            this.FTop = t;
          };
          if (tmp != null) {
            this.GetElementHandle().textContent = "";
            this.MoveElementsAndFree(tmp,this.GetElementHandle());
          };
          return;
        };
      };
      if (!this.FNew && (this.FID !== Value)) {
        w = this.FWidth;
        h = this.FHeight;
        eh = document.getElementById(this.FID);
        if (eh != null) {
          tmp = document.createElement("SPAN");
          this.$class.MoveElements(eh,tmp);
          this.UnbindEvents();
        };
        if (Value !== "") {
          eh = document.getElementById(Value);
          if (eh != null) {
            this.CreateWithID(Value);
            this.FID = Value;
            this.FWidth = w;
            this.FHeight = h;
            this.UpdateElement();
            this.MoveElementsAndFree(tmp,this.FContainer);
            return;
          };
        };
        this.FNew = true;
        this.FElement = null;
        this.CreateControl();
        if (Value === "") {
          this.CreateInitialize();
          this.FWidth = w;
          this.FHeight = h;
        };
        if (this.FParentElement != null) {
          this.FParentElement.appendChild(this.GetContainer());
        } else document.body.appendChild(this.GetContainer());
        frm = pas["WEBLib.Forms"].GetParentForm(this);
        if (frm != null) {
          this.SetParent(frm);
          this.SetElementPosition($mod.TElementPosition.epAbsolute);
          this.SetLeft(0);
          this.SetTop(0);
        };
        if (tmp != null) this.MoveElementsAndFree(tmp,this.FContainer);
        this.UpdateElement();
        this.UpdateElementSize();
      };
      this.FID = Value;
      if (this.FContainer != null) this.FContainer.setAttribute("id",Value);
    };
    this.SetMargins = function (Value) {
      this.FMargins.Assign(Value);
    };
    this.SetAnchors = function (Value) {
      if (rtl.neSet(this.FAnchors,Value)) {
        this.FAnchors = rtl.refSet(Value);
        if (!(pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) {
          this.UpdateAnchoring();
        };
      };
    };
    this.GetElementEvent = function () {
      var Result = null;
      Result = this.FElementEvent;
      return Result;
    };
    this.GetClientOrigin = function () {
      var Result = pas.Types.TPoint.$new();
      var r = null;
      Result.$assign(pas.Types.Point(0,0));
      if (this.GetElementHandle() != null) {
        r = this.GetElementHandle().getBoundingClientRect();
        Result.$assign(pas.Types.Point(Math.round(r.left),Math.round(r.top)));
      };
      return Result;
    };
    this.SetBorderWidth = function (Value) {
      if (this.FBorderWidth !== Value) {
        this.FBorderWidth = Value;
        this.UpdateElement();
      };
    };
    this.GetIsLinked = function () {
      var Result = false;
      Result = !this.FNew;
      return Result;
    };
    this.SetScriptLoaded = function (Value) {
      this.FScriptLoaded = Value;
    };
    this.SetRequiredScripts = function (Value) {
      this.FRequiredScripts.Assign(Value);
    };
    this.SetElementFont = function (Value) {
      if (this.FElementFont !== Value) {
        this.FElementFont = Value;
        this.UpdateElementVisual();
      };
    };
    this.SetElementPosition = function (Value) {
      if (this.FElementPosition !== Value) {
        this.FElementPosition = Value;
        if (this.GetElementHandle() != null) {
          this.UpdateElementSize();
          this.RecreateCanvas();
          this.InternalResize();
        };
      };
    };
    this.SetParentElement = function (Value) {
      if (this.FNew) {
        this.FElementPosition = $mod.TElementPosition.epRelative;
        this.CreateControl();
        this.FParentElement = Value;
        if (this.FParentElement != null) {
          this.FParentElement.appendChild(this.GetContainer());
        };
      } else {
        if (this.FParentElement != null) this.FParentElement.removeChild(this.GetContainer());
        this.FParentElement = Value;
        if (this.FParentElement != null) this.FParentElement.appendChild(this.GetContainer());
        this.UpdateElement();
      };
      this.InitScript();
      this.Invalidate();
    };
    this.SetClipChildren = function (Value) {
      this.FClipChildren = Value;
      this.UpdateElement();
    };
    this.SetParentElementID = function (Value) {
      var el = null;
      this.FParentElementID = Value;
      el = document.getElementById(this.FParentElementID);
      if (el != null) this.SetParentElement(el);
    };
    this.SetChildOrderEx = function (Value) {
      this.FChildOrder = Value;
    };
    this.GetRole = function () {
      var Result = "";
      Result = this.FRole;
      if (this.GetElementHandle() != null) Result = this.GetElementHandle().getAttribute("role");
      return Result;
    };
    this.SetRole = function (Value) {
      this.FRole = Value;
      if (this.GetElementHandle() != null) {
        if (Value === "") {
          this.GetElementHandle().removeAttribute("role")}
         else this.GetElementHandle().setAttribute("role",Value);
      };
    };
    this.GetContainer = function () {
      var Result = null;
      Result = this.FContainer;
      return Result;
    };
    this.GetChildContainer = function () {
      var Result = null;
      Result = this.FContainer;
      return Result;
    };
    this.SetParentFont = function (Value) {
      if ((Value !== this.FParentFont) && Value && (this.FParent != null)) {
        this.BeginUpdate();
        this.FFont.Assign(this.FParent.FFont);
        this.EndUpdate();
        this.UpdateElement();
      };
      this.FParentFont = Value;
    };
    this.SetParentColor = function (Value) {
      if ((this.FParentColor !== Value) && Value && (this.FParent != null)) {
        this.SetColor(this.FParent.FColor);
      };
      this.FParentColor = Value;
    };
    this.SetDragMode = function (Value) {
      this.FDragMode = Value;
      if (Value === $mod.TDragMode.dmAutomatic) {
        this.BeginDrag()}
       else this.DisableDrag();
    };
    this.GetClientHeight = function () {
      var Result = 0;
      Result = this.GetHeight();
      return Result;
    };
    this.GetClientWidth = function () {
      var Result = 0;
      Result = this.GetWidth();
      return Result;
    };
    this.SetClientHeight = function (Value) {
      this.SetHeight(Value);
    };
    this.SetClientWidth = function (Value) {
      this.SetWidth(Value);
    };
    this.SetHeightStyle = function (Value) {
      if (this.FHeightStyle !== Value) {
        this.FHeightStyle = Value;
        if ((this.FHeightStyle === $mod.TSizeStyle.ssAuto) && (this.GetElementHandle() != null) && !this.GetIsLinked()) this.GetElementStyle().removeProperty("height");
        this.UpdateElementSize();
        this.ResetAnchoring();
        this.DoBoundsChange();
      };
    };
    this.SetWidthStyle = function (Value) {
      if (this.FWidthStyle !== Value) {
        this.FWidthStyle = Value;
        if ((this.FWidthStyle === $mod.TSizeStyle.ssAuto) && (this.GetElementHandle() != null) && !this.GetIsLinked()) this.GetElementStyle().removeProperty("width");
        this.UpdateElementSize();
        this.ResetAnchoring();
        this.DoBoundsChange();
      };
    };
    this.SetHeightPercent = function (Value) {
      if (this.FHeightPercent !== Value) {
        this.FHeightPercent = Value;
        this.UpdateElementSize();
        this.ResetAnchoring();
        this.DoBoundsChange();
      };
    };
    this.SetWidthPercent = function (Value) {
      if (this.FWidthPercent !== Value) {
        this.FWidthPercent = Value;
        this.UpdateElementSize();
        this.ResetAnchoring();
        this.DoBoundsChange();
      };
    };
    this.SetShowFocus = function (Value) {
      if (this.FShowFocus !== Value) {
        this.FShowFocus = Value;
        this.UpdateElement();
      };
    };
    this.SetWidth = function (AValue) {
      if (this.FWidth !== AValue) {
        this.FWidth = AValue;
        this.ResetAnchoring();
        this.DoBoundsChange();
        if (this.GetIsLinked() && (this.FWidthStyle === $mod.TSizeStyle.ssAbsolute) && !(pas.Classes.TComponentStateItem.csLoading in this.FComponentState) && !this.IsUpdating() && (this.GetElementHandle() != null)) {
          if (AValue >= 0) {
            this.GetElementStyle().setProperty("width",pas.SysUtils.IntToStr(AValue) + "px")}
           else this.GetElementStyle().removeProperty("width");
        };
      };
    };
    this.SetHeight = function (AValue) {
      var dr = null;
      if (this.FHeight !== AValue) {
        if ((this.FAlign in rtl.createSet($mod.TAlign.alLeft,$mod.TAlign.alRight,$mod.TAlign.alClient)) && (this.GetElementHandle() != null)) {
          dr = this.GetElementHandle().getBoundingClientRect();
          if ((dr.top + AValue) >= pas["WEBLib.Forms"].WinHeight()) {
            AValue = Math.round(pas["WEBLib.Forms"].WinHeight() - dr.top);
          };
        };
        this.FHeight = AValue;
        this.ResetAnchoring();
        this.DoBoundsChange();
        if (this.GetIsLinked() && (this.FHeightStyle === $mod.TSizeStyle.ssAbsolute) && !(pas.Classes.TComponentStateItem.csLoading in this.FComponentState) && !this.IsUpdating() && (this.GetElementHandle() != null)) {
          if (AValue >= 0) {
            this.GetElementStyle().setProperty("height",pas.SysUtils.IntToStr(AValue) + "px")}
           else this.GetElementStyle().removeProperty("height");
        };
      };
    };
    this.SetWidthInt = function (AValue) {
      this.FWidth = AValue;
    };
    this.SetHeightInt = function (AValue) {
      this.FHeight = AValue;
    };
    this.SetEnabled = function (Value) {
      if (this.FEnabled !== Value) {
        this.FEnabled = Value;
        this.UpdateElementData();
      };
    };
    this.RecreateCanvas = function () {
    };
    this.VisibleChanging = function () {
    };
    this.VisibleChanged = function () {
      var i = 0;
      for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
        i = $l;
        this.GetControls(i).VisibleChanged();
      };
    };
    this.ColorChanging = function () {
    };
    this.IncUpdateCount = function () {
      this.FUpdateCount += 1;
    };
    this.DecUpdateCount = function () {
      this.FUpdateCount -= 1;
    };
    this.FocusedControlEntered = function () {
      var p = null;
      var c = null;
      var $ir = rtl.createIntfRefs();
      try {
        p = this.FParent;
        while (p !== null) if (pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(p,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.IControl),{get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }}) && c.EnterChildren($ir.ref(2,rtl.queryIntfT(this,$mod.IControl)))) {
          break}
         else p = p.FParent;
      } finally {
        $ir.free();
        rtl._Release(c);
      };
    };
    this.FocusedControlExited = function () {
      var p = null;
      var c = null;
      var undef = false;
      var $ir = rtl.createIntfRefs();
      try {
        p = this.FParent;
        undef = false;
        undef = (p == undefined);
        while (!undef && (p !== null)) if (pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(p,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.IControl),{get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }}) && c.ExitChildren($ir.ref(2,rtl.queryIntfT(this,$mod.IControl)))) {
          break}
         else p = p.FParent;
      } finally {
        $ir.free();
        rtl._Release(c);
      };
    };
    this.EnterChildren = function (AObject) {
      var Result = false;
      rtl._AddRef(AObject);
      try {
        Result = false;
      } finally {
        rtl._Release(AObject);
      };
      return Result;
    };
    this.ExitChildren = function (AObject) {
      var Result = false;
      rtl._AddRef(AObject);
      try {
        Result = false;
      } finally {
        rtl._Release(AObject);
      };
      return Result;
    };
    this.GetWidth = function () {
      var Result = 0;
      var cr = null;
      Result = this.FWidth;
      if ((this.GetElementHandle() != null) && !(pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) {
        if (Result === -1) {
          Result = Math.round(pas.System.Int(this.GetElementHandle().offsetWidth));
        };
        if (this.FWidthStyle !== $mod.TSizeStyle.ssAbsolute) {
          cr = this.GetElementHandle().getBoundingClientRect();
          Result = Math.round(pas.System.Int(cr.right - cr.left));
        };
      };
      return Result;
    };
    this.GetHeight = function () {
      var Result = 0;
      var cr = null;
      Result = this.FHeight;
      if ((this.GetElementHandle() != null) && !(pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) {
        if (Result === -1) {
          Result = Math.round(pas.System.Int(this.GetElementHandle().offsetHeight));
        };
        if (this.FHeightStyle !== $mod.TSizeStyle.ssAbsolute) {
          cr = this.GetElementHandle().getBoundingClientRect();
          Result = Math.round(pas.System.Int(cr.bottom - cr.top));
        };
      };
      return Result;
    };
    this.GetOuterWidth = function () {
      var Result = 0;
      Result = this.FWidth - this.FBorderWidth;
      return Result;
    };
    this.GetOuterHeight = function () {
      var Result = 0;
      Result = this.FHeight - this.FBorderWidth;
      return Result;
    };
    this.GetDesignWidth = function () {
      var Result = 0;
      Result = this.FWidth;
      return Result;
    };
    this.GetDesignHeight = function () {
      var Result = 0;
      Result = this.FHeight;
      return Result;
    };
    this.GetDesignLeft = function () {
      var Result = 0;
      Result = this.FLeft;
      return Result;
    };
    this.GetDesignTop = function () {
      var Result = 0;
      Result = this.FTop;
      return Result;
    };
    this.GetLeft = function () {
      var Result = 0;
      Result = this.FLeft;
      if ((Result === -1) && (this.GetElementHandle() != null) && !(pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) Result = Math.round(this.GetElementHandle().offsetLeft);
      return Result;
    };
    this.GetTop = function () {
      var Result = 0;
      Result = this.FTop;
      if ((Result === -1) && (this.GetElementHandle() != null) && !(pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) Result = Math.round(this.GetElementHandle().offsetTop);
      return Result;
    };
    this.HandleAllocated = function () {
      var Result = false;
      Result = true;
      return Result;
    };
    this.CreateElement = function () {
      var Result = null;
      Result = null;
      return Result;
    };
    this.CreateChildElements = function (AContainer) {
    };
    this.ContainerElement = function () {
      var Result = null;
      Result = document.body;
      return Result;
    };
    this.IsStructuralElement = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    this.IsEnabled = function () {
      var Result = false;
      Result = this.FEnabled;
      return Result;
    };
    this.GetNewName = function () {
      var Result = "";
      var s = "";
      var lPrefix = "";
      var frm = null;
      s = this.$classname;
      pas.System.Delete({get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},1,1);
      lPrefix = "";
      frm = pas["WEBLib.Forms"].GetParentForm(this);
      if (frm != null) lPrefix = frm.$classname;
      Result = lPrefix + "_" + $mod.FindUniqueName(s);
      return Result;
    };
    this.IsInputControl = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    this.UseCSSFont = function () {
      var Result = false;
      Result = !((this.FElementClassName === "") && (this.FElementFont === $mod.TElementFont.efProperty) && !this.GetIsLinked());
      return Result;
    };
    this.UseCSSFontColor = function () {
      var Result = false;
      Result = !(pas["WEBLib.Forms"].Application.FThemed && (pas["WEBLib.Graphics"].ColorToRGB(this.FFont.FColor) === pas["WEBLib.Graphics"].RGB(0,0,0)));
      return Result;
    };
    this.RecreateElement = function () {
      if (this.GetContainer() != null) {
        this.UnbindEvents();
        this.GetContainer().parentNode.removeChild(this.GetContainer());
        this.FElement = null;
        this.CreateControl();
        if ((this.FParent != null) && (this.FParent.GetContainer() != null)) this.FParent.GetChildContainer().appendChild(this.GetContainer());
      };
    };
    this.BindElement = function () {
    };
    this.CreateInitialize = function () {
      var frm = null;
      this.FDesignTime = (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) && !((pas.Classes.TComponentStateItem.csReading in this.FOwner.FComponentState) || (pas.Classes.TComponentStateItem.csLoading in this.FOwner.FComponentState));
      this.FRequiredScripts = pas.Classes.TStringList.$create("Create$1");
      this.FOrigRect.$assign(pas.Types.Rect(-1,-1,-1,-1));
      this.FClipChildren = true;
      if (this.FDesignTime) {
        frm = pas["WEBLib.Forms"].GetParentForm(this);
        if ((frm != null) && pas["WEBLib.Forms"].TForm.isPrototypeOf(frm) && (rtl.as(frm,pas["WEBLib.Forms"].TForm).FCSSLibrary !== $mod.TCSSLibrary.cssNone)) {
          this.InitCSSLibrary(rtl.as(frm,pas["WEBLib.Forms"].TForm).FCSSLibrary);
        };
      };
    };
    this.DestroyControls = function () {
      var i = 0;
      var ctrl = null;
      for (var $l = this.GetControlsCount() - 1; $l >= 0; $l--) {
        i = $l;
        ctrl = this.GetControls(i);
        ctrl = rtl.freeLoc(ctrl);
      };
    };
    this.ClearControls = function () {
      this.FControls = rtl.arraySetLength(this.FControls,null,0);
    };
    this.GetElementStyle = function () {
      var Result = null;
      Result = this.GetElementHandle().style;
      return Result;
    };
    this.InitCSSLibrary = function (ALibrary) {
    };
    this.SetControlCursor = function (Value) {
      this.FCursor = Value;
      if ((this.FElementClassName === "") && (this.GetElementHandle() != null)) {
        this.SetElementPointer(this.GetElementHandle(),Value);
      };
    };
    this.SetBiDiMode = function (Value) {
      if (this.GetElementHandle() != null) {
        if (Value === $mod.TBiDiMode.bdLeftToRight) {
          this.GetElementHandle().removeAttribute("dir")}
         else this.GetElementHandle().setAttribute("dir","rtl");
      };
    };
    this.GetMouseEventButton = function (Event) {
      var Result = 0;
      Result = $mod.TMouseButton.mbLeft;
      var $tmp = Event.button;
      if ($tmp === 0) {
        Result = $mod.TMouseButton.mbLeft}
       else if ($tmp === 1) {
        Result = $mod.TMouseButton.mbMiddle}
       else if ($tmp === 2) Result = $mod.TMouseButton.mbRight;
      return Result;
    };
    this.GetMouseEventShiftState = function (Event) {
      var Result = {};
      Result = {};
      if (Event.shiftKey) Result = rtl.unionSet(Result,rtl.createSet(pas.Classes.TShiftState$a.ssShift));
      if (Event.ctrlKey) Result = rtl.unionSet(Result,rtl.createSet(pas.Classes.TShiftState$a.ssCtrl));
      if (Event.altKey) Result = rtl.unionSet(Result,rtl.createSet(pas.Classes.TShiftState$a.ssAlt));
      if ((Event.buttons & 1) === 1) Result = rtl.unionSet(Result,rtl.createSet(pas.Classes.TShiftState$a.ssLeft));
      if ((Event.buttons & 2) === 2) Result = rtl.unionSet(Result,rtl.createSet(pas.Classes.TShiftState$a.ssRight));
      if ((Event.buttons & 4) === 4) Result = rtl.unionSet(Result,rtl.createSet(pas.Classes.TShiftState$a.ssMIDdle));
      return Result;
    };
    this.GetKeyBoardEventShiftState = function (Event) {
      var Result = {};
      Result = {};
      if (Event.shiftKey) Result = rtl.unionSet(Result,rtl.createSet(pas.Classes.TShiftState$a.ssShift));
      if (Event.ctrlKey) Result = rtl.unionSet(Result,rtl.createSet(pas.Classes.TShiftState$a.ssCtrl));
      if (Event.altKey) Result = rtl.unionSet(Result,rtl.createSet(pas.Classes.TShiftState$a.ssAlt));
      return Result;
    };
    this.GetMouseWheelEventShiftState = function (Event) {
      var Result = {};
      Result = {};
      if (Event.shiftKey) Result = rtl.unionSet(Result,rtl.createSet(pas.Classes.TShiftState$a.ssShift));
      if (Event.ctrlKey) Result = rtl.unionSet(Result,rtl.createSet(pas.Classes.TShiftState$a.ssCtrl));
      if (Event.altKey) Result = rtl.unionSet(Result,rtl.createSet(pas.Classes.TShiftState$a.ssAlt));
      return Result;
    };
    this.GetTouchEventShiftState = function (Event) {
      var Result = {};
      Result = {};
      if (Event.shiftKey) Result = rtl.unionSet(Result,rtl.createSet(pas.Classes.TShiftState$a.ssShift));
      if (Event.ctrlKey) Result = rtl.unionSet(Result,rtl.createSet(pas.Classes.TShiftState$a.ssCtrl));
      if (Event.altKey) Result = rtl.unionSet(Result,rtl.createSet(pas.Classes.TShiftState$a.ssAlt));
      return Result;
    };
    this.HandleDoClick = function (Event) {
      var Result = false;
      this.FElementEvent = Event;
      if ($mod.TElementEvent.eeClick in this.FEventStopPropagation) this.StopPropagation();
      if (this.FEnabled) this.Click();
      Result = true;
      this.FElementEvent = null;
      return Result;
    };
    this.HandleDoWheel = function (Event) {
      var Result = false;
      var ss = {};
      var h = false;
      var l = 0.0;
      var t = 0.0;
      this.FElementEvent = Event;
      this.StopPropagation();
      this.XYToClient(Event.clientX,Event.clientY,{get: function () {
          return l;
        }, set: function (v) {
          l = v;
        }},{get: function () {
          return t;
        }, set: function (v) {
          t = v;
        }});
      this.FWheelMousePos.x = Math.round(l);
      this.FWheelMousePos.y = Math.round(t);
      ss = rtl.refSet(this.GetMouseWheelEventShiftState(Event));
      h = false;
      this.MouseWheel(rtl.refSet(ss),pas.System.Trunc(-Event.deltaY),{get: function () {
          return h;
        }, set: function (v) {
          h = v;
        }});
      Result = true;
      this.FElementEvent = null;
      return Result;
    };
    this.HandleDoDblClick = function (Event) {
      var Result = false;
      this.FCaptureDown = false;
      this.FElementEvent = Event;
      if ($mod.TElementEvent.eeDblClick in this.FEventStopPropagation) this.StopPropagation();
      if (this.FEnabled) this.DblClick();
      Result = true;
      this.FElementEvent = null;
      return Result;
    };
    this.HandleDoMouseDown = function (Event) {
      var Result = false;
      var l = 0.0;
      var t = 0.0;
      var ss = {};
      var mb = 0;
      var AEvent = null;
      AEvent = Event;
      this.FElementEvent = AEvent;
      if ($mod.TElementEvent.eeMouseDown in this.FEventStopPropagation) this.StopPropagation();
      if (!this.CanFocus()) this.PreventDefault();
      $impl.FMouseX = Math.round(AEvent.clientX);
      $impl.FMouseY = Math.round(AEvent.clientY);
      this.XYToClient(AEvent.clientX,AEvent.clientY,{get: function () {
          return l;
        }, set: function (v) {
          l = v;
        }},{get: function () {
          return t;
        }, set: function (v) {
          t = v;
        }});
      if (this.HasVertScrollBar() && (l > (this.GetWidth() - $mod.GetScrollBarWidth()))) return Result;
      if (this.HasHorzScrollBar() && (t > (this.GetHeight() - $mod.GetScrollBarHeight()))) return Result;
      ss = rtl.refSet(this.GetMouseEventShiftState(AEvent));
      mb = this.GetMouseEventButton(AEvent);
      this.MouseDown(mb,rtl.refSet(ss),pas.System.Trunc(l),pas.System.Trunc(t));
      Result = true;
      this.FElementEvent = null;
      return Result;
    };
    this.HandleDoMouseUp = function (Event) {
      var Result = false;
      var l = 0.0;
      var t = 0.0;
      var ss = {};
      var mb = 0;
      var AEvent = null;
      AEvent = Event;
      this.FElementEvent = AEvent;
      if ($mod.TElementEvent.eeMouseUp in this.FEventStopPropagation) this.StopPropagation();
      this.XYToClient(AEvent.clientX,AEvent.clientY,{get: function () {
          return l;
        }, set: function (v) {
          l = v;
        }},{get: function () {
          return t;
        }, set: function (v) {
          t = v;
        }});
      if (this.HasVertScrollBar() && (l > (this.GetWidth() - $mod.GetScrollBarWidth()))) {
        this.FElementEvent = null;
        return Result;
      };
      if (this.HasHorzScrollBar() && (t > (this.GetHeight() - $mod.GetScrollBarHeight()))) {
        this.FElementEvent = null;
        return Result;
      };
      ss = rtl.refSet(this.GetMouseEventShiftState(AEvent));
      mb = this.GetMouseEventButton(AEvent);
      if (this.FDragMode === $mod.TDragMode.dmManual) this.DisableDrag();
      this.MouseUp(mb,rtl.refSet(ss),pas.System.Trunc(l),pas.System.Trunc(t));
      Result = true;
      this.FElementEvent = null;
      return Result;
    };
    this.HandleDoMouseMove = function (Event) {
      var Result = false;
      var l = 0.0;
      var t = 0.0;
      var ss = {};
      var AEvent = null;
      AEvent = Event;
      this.FElementEvent = AEvent;
      $impl.FCursorX = Math.round(AEvent.clientX);
      $impl.FCursorY = Math.round(AEvent.clientY);
      if ($mod.TElementEvent.eeMouseMove in this.FEventStopPropagation) this.StopPropagation();
      this.XYToClient(AEvent.clientX,AEvent.clientY,{get: function () {
          return l;
        }, set: function (v) {
          l = v;
        }},{get: function () {
          return t;
        }, set: function (v) {
          t = v;
        }});
      ss = rtl.refSet(this.GetMouseEventShiftState(AEvent));
      this.MouseMove(rtl.refSet(ss),pas.System.Trunc(l),pas.System.Trunc(t));
      Result = true;
      this.FElementEvent = null;
      return Result;
    };
    this.HandleDoMouseLeave = function (Event) {
      var Result = false;
      if (this.Captured()) return Result;
      Event.stopPropagation();
      this.DoMouseLeave();
      Result = true;
      return Result;
    };
    this.HandleDoContextMenu = function (Event) {
      var Result = false;
      Result = true;
      return Result;
    };
    this.LayerHandleDoMouseEnter = function (Event) {
      var Result = false;
      if ((Event.buttons === 0) && this.Captured() && !this.FMouseInsideLayer) {
        this.ReleaseCapture();
        this.HandleDoMouseUp(Event);
        this.HandleDoMouseLeave(Event);
      };
      this.FMouseInsideLayer = true;
      Result = true;
      return Result;
    };
    this.LayerHandleDoMouseLeave = function (Event) {
      var Result = false;
      this.FMouseInsideLayer = false;
      Result = true;
      return Result;
    };
    this.HandleDoMouseEnter = function (Event) {
      var Result = false;
      if (this.Captured()) return Result;
      Event.stopPropagation();
      this.DoMouseEnter();
      Result = true;
      return Result;
    };
    this.HandleDoKeyDown = function (Event) {
      var Result = false;
      var k = 0;
      var ss = {};
      var undef = false;
      var AEvent = null;
      AEvent = Event;
      this.FElementEvent = AEvent;
      if ($mod.TElementEvent.eeKeyDown in this.FEventStopPropagation) this.StopPropagation();
      undef = (AEvent.key == undefined);
      if (!undef) {
        k = this.GetKeyCode(AEvent.key,true);
        ss = rtl.refSet(this.GetKeyBoardEventShiftState(AEvent));
        this.KeyDown({get: function () {
            return k;
          }, set: function (v) {
            k = v;
          }},rtl.refSet(ss));
        if (k in rtl.createSet(13,27,9)) {
          this.KeyPreview({get: function () {
              return k;
            }, set: function (v) {
              k = v;
            }},rtl.refSet(ss));
        };
      };
      Result = true;
      if (k === 0) this.PreventDefault();
      this.FElementEvent = null;
      return Result;
    };
    this.HandleDoKeyUp = function (Event) {
      var Result = false;
      var k = 0;
      var ss = {};
      var c = "\x00";
      var undef = false;
      var AEvent = null;
      AEvent = Event;
      this.FElementEvent = AEvent;
      if ($mod.TElementEvent.eeKeyUp in this.FEventStopPropagation) this.StopPropagation();
      undef = (AEvent.key == undefined);
      if (!undef) {
        k = this.GetKeyCode(AEvent.key,true);
        ss = rtl.refSet(this.GetKeyBoardEventShiftState(AEvent));
        if (k === 27) {
          c = "\x1B";
          this.KeyPress({get: function () {
              return c;
            }, set: function (v) {
              c = v;
            }});
        };
        this.KeyUp({get: function () {
            return k;
          }, set: function (v) {
            k = v;
          }},rtl.refSet(ss));
      };
      Result = true;
      if (k === 0) this.PreventDefault();
      this.FElementEvent = null;
      return Result;
    };
    this.HandleDoKeyPress = function (Event) {
      var Result = false;
      var c = "\x00";
      var AEvent = null;
      AEvent = Event;
      this.FElementEvent = AEvent;
      if ($mod.TElementEvent.eeKeyPress in this.FEventStopPropagation) this.StopPropagation();
      if (this.IsKeyCharacter(AEvent.key)) {
        c = this.GetKeyChar(AEvent.key);
        this.KeyPress({get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }});
      };
      Result = true;
      if (c === "\x00") this.PreventDefault();
      this.FElementEvent = null;
      return Result;
    };
    this.HandleDoInput = function (Event) {
      var Result = false;
      var c = "\x00";
      var stemp = "";
      if ($mod.IsAndroid()) {
        this.FElementEvent = Event;
        if ($mod.TElementEvent.eeKeyPress in this.FEventStopPropagation) this.StopPropagation();
        c = "\x00";
        if (Event.data !== "") {
          stemp = Event.data;
          if (pas.System.Assigned(stemp)) {
            c = stemp.charAt(stemp.length - 1)}
           else c = "\b";
          this.KeyPress({get: function () {
              return c;
            }, set: function (v) {
              c = v;
            }});
        };
        Result = true;
        if (c === "\x00") this.PreventDefault();
        this.FElementEvent = null;
      };
      return Result;
    };
    this.HandleDoExit = function (Event) {
      var Result = false;
      this.DoExit();
      Result = true;
      this.FocusedControlExited();
      return Result;
    };
    this.HandleDoEnter = function (Event) {
      var Result = false;
      this.FElementEvent = Event;
      this.StopPropagation();
      this.DoEnter();
      Result = true;
      this.FElementEvent = null;
      this.FGotFocus = true;
      this.FocusedControlEntered();
      return Result;
    };
    this.HandleDoTouchStart = function (Event) {
      var Result = false;
      var l = 0.0;
      var t = 0.0;
      var touch = null;
      var ss = {};
      this.FElementEvent = Event;
      this.FLastElementEvent = Event;
      if ($mod.TElementEvent.eeTouchStart in this.FEventStopPropagation) this.StopPropagation();
      if (!this.FAllowTouch) this.PreventDefault();
      if (Event.touches.length > 0) {
        touch = Event.touches.item(0);
        this.XYToClient(touch.clientX,touch.clientY,{get: function () {
            return l;
          }, set: function (v) {
            l = v;
          }},{get: function () {
            return t;
          }, set: function (v) {
            t = v;
          }});
        ss = rtl.refSet(this.GetTouchEventShiftState(Event));
        if (this.FLinkTouchEvents) {
          this.MouseDown($mod.TMouseButton.mbLeft,rtl.refSet(ss),pas.System.Trunc(l),pas.System.Trunc(t));
        };
        this.TouchStart(pas.System.Trunc(l),pas.System.Trunc(t));
      };
      Result = true;
      this.FElementEvent = null;
      return Result;
    };
    this.HandleDoTouchMove = function (Event) {
      var Result = false;
      var l = 0.0;
      var t = 0.0;
      var touch = null;
      var ss = {};
      this.FElementEvent = Event;
      this.FLastElementEvent = Event;
      if ($mod.TElementEvent.eeTouchMove in this.FEventStopPropagation) this.StopPropagation();
      if (!this.FAllowTouch) this.PreventDefault();
      if (this.Captured()) this.PreventDefault();
      if (Event.touches.length > 0) {
        touch = Event.touches.item(0);
        this.XYToClient(touch.clientX,touch.clientY,{get: function () {
            return l;
          }, set: function (v) {
            l = v;
          }},{get: function () {
            return t;
          }, set: function (v) {
            t = v;
          }});
        ss = rtl.refSet(this.GetTouchEventShiftState(Event));
        if (this.FLinkTouchEvents) this.MouseMove(rtl.refSet(ss),pas.System.Trunc(l),pas.System.Trunc(t));
        this.TouchMove(pas.System.Trunc(l),pas.System.Trunc(t));
      };
      this.FElementEvent = null;
      Result = true;
      return Result;
    };
    this.HandleDoTouchEnd = function (Event) {
      var Result = false;
      var l = 0.0;
      var t = 0.0;
      var touch = null;
      var ss = {};
      this.FElementEvent = Event;
      if (!this.FAllowTouch) this.PreventDefault();
      this.ReleaseCapture();
      if ($mod.TElementEvent.eeTouchEnd in this.FEventStopPropagation) this.StopPropagation();
      if ((this.FLastElementEvent != null) && (this.FLastElementEvent.touches.length > 0)) {
        touch = this.FLastElementEvent.touches.item(0);
        this.XYToClient(touch.clientX,touch.clientY,{get: function () {
            return l;
          }, set: function (v) {
            l = v;
          }},{get: function () {
            return t;
          }, set: function (v) {
            t = v;
          }});
        ss = rtl.refSet(this.GetTouchEventShiftState(Event));
        if (this.FLinkTouchEvents) {
          this.MouseUp($mod.TMouseButton.mbLeft,rtl.refSet(ss),pas.System.Trunc(l),pas.System.Trunc(t));
          if (this.FEnabled && !this.FAllowTouch) this.Click();
        };
        this.TouchEnd(pas.System.Trunc(l),pas.System.Trunc(t));
      };
      this.FElementEvent = null;
      Result = true;
      return Result;
    };
    this.HandleDoTouchCancel = function (Event) {
      var Result = false;
      var l = 0.0;
      var t = 0.0;
      var touch = null;
      var ss = {};
      this.FElementEvent = Event;
      this.ReleaseCapture();
      this.StopPropagation();
      if (Event.touches.length > 0) {
        touch = Event.touches.item(0);
        this.XYToClient(touch.clientX,touch.clientY,{get: function () {
            return l;
          }, set: function (v) {
            l = v;
          }},{get: function () {
            return t;
          }, set: function (v) {
            t = v;
          }});
        ss = rtl.refSet(this.GetTouchEventShiftState(Event));
        if (this.FLinkTouchEvents) {
          this.MouseUp($mod.TMouseButton.mbLeft,rtl.refSet(ss),pas.System.Trunc(l),pas.System.Trunc(t));
        };
        this.TouchCancel(pas.System.Trunc(l),pas.System.Trunc(t));
      };
      this.FElementEvent = null;
      Result = true;
      return Result;
    };
    this.HandleDoDragStart = function (Event) {
      var Result = false;
      var obj = null;
      this.FElementEvent = Event;
      Event.stopPropagation();
      obj = null;
      this.DoStartDrag({get: function () {
          return obj;
        }, set: function (v) {
          obj = v;
        }});
      if (obj != null) {
        $impl.DragObject = obj}
       else $impl.DragObject = this;
      Result = true;
      return Result;
    };
    this.HandleDoDragOver = function (Event) {
      var Result = false;
      this.FElementEvent = Event;
      Event.stopPropagation();
      this.DragOver($impl.DragObject,Event.clientX,Event.clientY,$mod.TDragState.dsDragMove,{p: this, get: function () {
          return this.p.FAcceptDrag;
        }, set: function (v) {
          this.p.FAcceptDrag = v;
        }});
      if (this.FAcceptDrag && (!this.IsInputControl() || (Event.dataTransfer.items.length === 0))) Event.preventDefault();
      Result = !this.FAcceptDrag;
      this.FElementEvent = null;
      return Result;
    };
    this.HandleDoDragEnter = function (Event) {
      var Result = false;
      this.FElementEvent = Event;
      Event.stopPropagation();
      this.FAcceptDrag = this.IsInputControl();
      this.DragOver($impl.DragObject,Event.clientX,Event.clientY,$mod.TDragState.dsDragEnter,{p: this, get: function () {
          return this.p.FAcceptDrag;
        }, set: function (v) {
          this.p.FAcceptDrag = v;
        }});
      if (this.FAcceptDrag) Event.preventDefault();
      Result = !this.FAcceptDrag;
      this.FElementEvent = null;
      return Result;
    };
    this.HandledoDragLeave = function (Event) {
      var Result = false;
      this.FElementEvent = Event;
      Event.stopPropagation();
      this.DragOver($impl.DragObject,Event.clientX,Event.clientY,$mod.TDragState.dsDragLeave,{p: this, get: function () {
          return this.p.FAcceptDrag;
        }, set: function (v) {
          this.p.FAcceptDrag = v;
        }});
      Result = true;
      this.FElementEvent = null;
      return Result;
    };
    this.HandleDoDragEnd = function (Event) {
      var Result = false;
      this.FElementEvent = Event;
      Event.stopPropagation();
      this.DoEndDrag($impl.DragObject,Event.clientX,Event.clientY);
      Result = true;
      if (this.FDragMode === $mod.TDragMode.dmManual) this.DisableDrag();
      this.FElementEvent = null;
      return Result;
    };
    this.HandleDoDragDrop = function (Event) {
      var Result = false;
      this.FElementEvent = Event;
      Event.stopPropagation();
      if (!this.FAcceptDrag) {
        Event.preventDefault()}
       else {
        if (!this.IsInputControl()) Event.preventDefault();
        this.DragDrop($impl.DragObject,Event.clientX,Event.clientY);
      };
      Result = this.FAcceptDrag;
      this.FElementEvent = null;
      return Result;
    };
    this.HandleKeyPreview = function (Key) {
    };
    this.HandleFontChanged = function (Sender) {
      if (this.FUpdateCount === 0) {
        this.SetParentFont(false);
        this.ParentFontChanged();
      };
      this.FontChanged();
    };
    this.ParentFontChanged = function () {
      var i = 0;
      for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.GetControls(i).FParentFont) {
          this.GetControls(i).FFont.Assign(this.FFont);
          this.GetControls(i).FontChanged();
          this.GetControls(i).FParentFont = true;
          this.GetControls(i).ParentFontChanged();
        };
      };
    };
    this.DoExit = function () {
      if (this.FOnExit != null) this.FOnExit(this);
    };
    this.DoEnter = function () {
      if (this.FOnEnter != null) this.FOnEnter(this);
    };
    this.Click = function () {
      if ((this.FOnClick != null) && this.IsEnabled()) this.FOnClick(this);
    };
    this.UpdateElement = function () {
      if (this.FBlockUpdateElement || (this.FUpdateCount > 0)) return;
      if ((this.GetElementHandle() != null) && (this.GetElementHandle() !== this.ContainerElement()) && !this.IsUpdating()) {
        this.UpdateElementData();
        if (!this.GetIsLinked()) {
          this.UpdateElementVisual();
        };
      };
    };
    this.UpdateElementSize = function () {
      var es = null;
      var offsLeft = 0;
      var offsTop = 0;
      var ow = 0;
      var ctrl = null;
      var cr = null;
      if (this.FBlockUpdateElement || (this.FUpdateCount > 0)) return;
      if (this.GetIsLinked()) return;
      if ((this.GetElementHandle() != null) && (this.GetElementHandle() !== this.ContainerElement())) {
        es = this.GetElementStyle();
        offsLeft = 0;
        offsTop = 0;
        ctrl = this.FParent;
        while ((ctrl != null) && (this.FElementPosition === $mod.TElementPosition.epAbsolute) && (ctrl.FElementPosition !== $mod.TElementPosition.epAbsolute) && !pas["WEBLib.Forms"].TCustomForm.isPrototypeOf(ctrl)) {
          if (ctrl.GetIsLinked() && (ctrl.GetElementHandle() != null) && (ctrl.GetElementHandle().style.getPropertyValue("position") !== "absolute")) {
            cr = ctrl.GetElementHandle().getBoundingClientRect();
            offsLeft = Math.round(cr.left);
            offsTop = Math.round(cr.top);
            if ((ctrl.FParent != null) && (ctrl.FParent.GetElementHandle() != null) && (ctrl.FParent.GetElementHandle().style.getPropertyValue("position") === "absolute")) {
              cr = ctrl.FParent.GetElementHandle().getBoundingClientRect();
              offsLeft = offsLeft - Math.round(cr.left);
              offsTop = offsTop - Math.round(cr.top);
            };
            break;
          };
          ctrl = ctrl.FParent;
        };
        if ((this.FParent != null) && this.FParent.IsStructuralElement()) {
          offsLeft = this.FParent.GetLeft();
          offsTop = this.FParent.GetTop();
        };
        if (this.FElementPosition === $mod.TElementPosition.epAbsolute) {
          if (this.FTop !== -1) {
            es.setProperty("top",pas.SysUtils.IntToStr(this.FTop + offsTop) + "px")}
           else es.setProperty("top","");
          if (this.FLeft !== -1) {
            es.setProperty("left",pas.SysUtils.IntToStr(this.FLeft + offsLeft) + "px")}
           else es.setProperty("left","");
        } else {
          es.removeProperty("top");
          es.removeProperty("left");
        };
        if (this.FWidthStyle === $mod.TSizeStyle.ssAbsolute) {
          ow = this.GetOuterWidth();
          if (this.FWidth !== -1) {
            es.setProperty("width",pas.SysUtils.IntToStr(ow) + "px")}
           else es.removeProperty("width");
        };
        if (this.FWidthStyle === $mod.TSizeStyle.ssAuto) {
          es.removeProperty("width");
        };
        if (this.FHeightStyle === $mod.TSizeStyle.ssAbsolute) {
          if (this.FHeight !== -1) {
            es.setProperty("height",pas.SysUtils.IntToStr(this.GetOuterHeight()) + "px")}
           else es.removeProperty("height");
        };
        if (this.FHeightStyle === $mod.TSizeStyle.ssAuto) {
          es.removeProperty("height");
        };
        if (this.FWidthStyle === $mod.TSizeStyle.ssPercent) {
          if (this.FWidth !== -1) {
            es.setProperty("width",pas["WEBLib.Utils"].FormatProp("%.2f%%",pas.System.VarRecs(3,this.FWidthPercent)))}
           else es.removeProperty("width");
        };
        if (this.FHeightStyle === $mod.TSizeStyle.ssPercent) {
          if (this.FHeight !== -1) {
            es.setProperty("height",pas["WEBLib.Utils"].FormatProp("%.2f%%",pas.System.VarRecs(3,this.FHeightPercent)))}
           else es.removeProperty("height");
        };
        if (this.FElementPosition === $mod.TElementPosition.epAbsolute) {
          es.setProperty("position","absolute")}
         else if (this.FElementPosition === $mod.TElementPosition.epRelative) {
          es.setProperty("position","relative")}
         else es.removeProperty("position");
        es.setProperty("box-sizing","border-box");
      };
    };
    this.UpdateElementVisual = function () {
      var eh = null;
      var es = null;
      var useCSS = false;
      var LinkedForm = false;
      eh = this.GetElementHandle();
      if (!(eh != null)) return;
      if (this.IsUpdating()) return;
      es = this.GetElementStyle();
      if (this.FParentFont && (this.FParent != null)) {
        this.FFont.FOnChange = null;
        this.FFont.Assign(this.FParent.FFont);
        this.FFont.FOnChange = rtl.createCallback(this,"HandleFontChanged");
      };
      if (this.FElementClassName === "") {
        LinkedForm = pas["WEBLib.Forms"].TCustomForm.isPrototypeOf(this) && (rtl.as(this,pas["WEBLib.Forms"].TCustomForm).FFormContainer !== "");
        if (!this.GetIsLinked() && !LinkedForm) {
          if (this.FClipChildren && (pas.SysUtils.LowerCase(eh.tagName) !== pas["WEBLib.WebTools"].cBodyTag)) {
            es.setProperty("overflow","hidden")}
           else es.setProperty("overflow","");
        };
        this.SetElementPointer(eh,this.FCursor);
      };
      if (this.Captured()) this.FLayer.style.setProperty("cursor",es.getPropertyValue("cursor"));
      if ((this.FElementClassName !== "") || this.CanShowFocus()) {
        es.setProperty("outline","")}
       else es.setProperty("outline","none");
      this.UpdateElementSize();
      var $tmp = this.FTextDirection;
      if ($tmp === $mod.TTextDirection.tdDefault) {
        es.removeProperty("direction")}
       else if ($tmp === $mod.TTextDirection.tdRightToLeft) {
        es.setProperty("direction","rtl")}
       else if ($tmp === $mod.TTextDirection.tdLeftToRight) {
        es.setProperty("direction","ltr")}
       else if ($tmp === $mod.TTextDirection.tdInherit) es.setProperty("direction","inherit");
      if ((this.FElementClassName === "") && this.FNoUserSelect) {
        es.setProperty("webkit-user-select","none");
        es.setProperty("moz-user-select","none");
        es.setProperty("khtml-user-select","none");
        es.setProperty("ms-user-select","none");
        es.setProperty("user-select","none");
        es.setProperty("-webkit-tap-highlight-color","transparent");
      };
      this.SetElementColor(eh,this.FColor);
      useCSS = this.UseCSSFont();
      if (!this.GetIsLinked()) $mod.SetHTMLElementFont(eh,this.FFont,useCSS);
      if (!useCSS) {
        if (this.IsEnabled() && this.UseCSSFontColor()) es.setProperty("color",pas["WEBLib.Graphics"].ColorToHTML(this.FFont.FColor));
      } else {
        es.removeProperty("color");
      };
    };
    this.UpdateElementData = function () {
      var frm = null;
      var el = null;
      var AToolTip = "";
      var ToolTipClass = "";
      var ToolTipPos = "";
      var ToolTipPause = 0;
      var ToolTipHidePause = 0;
      var tt = undefined;
      var isBootstrap = false;
      if (this.GetElementHandle() != null) {
        if (!(pas.Classes.TComponentStateItem.csDesigning in this.FComponentState)) {
          if (this.FVisible) {
            this.GetElementStyle().setProperty("display","")}
           else this.GetElementStyle().setProperty("display","none");
        };
        this.EnableTab();
        if (this.FContainer != null) {
          if (this.IsEnabled()) {
            this.FContainer.removeAttribute("disabled");
            this.FContainer.style.removeProperty("pointer-events");
          } else {
            this.FContainer.setAttribute("disabled","");
            this.FContainer.style.setProperty("pointer-events","none");
          };
        };
        if (this.GetIsLinked() && (this.FHint === "")) return;
        if ((this.FContainer != null) && (this.GetRole() !== "")) this.FContainer.setAttribute("role",this.FRole);
        frm = pas["WEBLib.Forms"].GetParentForm(this);
        isBootstrap = (frm != null) && (frm.FCSSLibrary === $mod.TCSSLibrary.cssBootstrap);
        if (isBootstrap && this.FShowHint && (this.FHint !== "")) {
          el = this.GetElementHandle();
          AToolTip = this.FHint;
          var $tmp = pas["WEBLib.Forms"].Application.FHintPosition;
          if ($tmp === pas["WEBLib.Forms"].THintPosition.hpLeft) {
            ToolTipPos = "left"}
           else if ($tmp === pas["WEBLib.Forms"].THintPosition.hpRight) {
            ToolTipPos = "right"}
           else if ($tmp === pas["WEBLib.Forms"].THintPosition.hpTop) {
            ToolTipPos = "top"}
           else if ($tmp === pas["WEBLib.Forms"].THintPosition.hpBottom) ToolTipPos = "bottom";
          ToolTipClass = pas["WEBLib.Forms"].Application.FHintClassName;
          ToolTipPause = pas["WEBLib.Forms"].Application.FHintPause;
          ToolTipHidePause = pas["WEBLib.Forms"].Application.FHintHidePause;
          tt = this.FToolTip;
          if (tt) { tt.dispose(); }
          el.setAttribute('title',AToolTip);
          tt = new bootstrap.Tooltip(el, {
          title: AToolTip,
          trigger: 'hover',
          placement: ToolTipPos,
          customClass: ToolTipClass,
          delay: { "show": ToolTipPause, "hide": ToolTipHidePause }
          });
          this.FToolTip = tt;
        } else {
          if (this.FContainer != null) {
            if (this.FShowHint && (this.FHint !== "")) {
              if (isBootstrap) {
                this.FContainer.setAttribute("data-title",this.FHint)}
               else this.FContainer.setAttribute("title",this.FHint);
            } else {
              if (isBootstrap) {
                this.FContainer.removeAttribute("data-title")}
               else this.FContainer.removeAttribute("title");
            };
          };
        };
        if (!this.IsEnabled() || (this.FElementFont === $mod.TElementFont.efCSS)) {
          this.GetElementStyle().removeProperty("color")}
         else if (this.UseCSSFontColor()) this.GetElementStyle().setProperty("color",pas["WEBLib.Graphics"].ColorToHTML(this.FFont.FColor));
      };
    };
    this.UpdateParent = function () {
      this.InternalUpdateParent();
      if (this.FAlign !== $mod.TAlign.alNone) {
        this.UpdateChildren(this.FPrevParent);
        this.UpdateChildren(this.FParent);
      };
    };
    this.UpdateControlSize = function (AWidth, AHeight) {
      this.FWidth = AWidth;
      this.FHeight = AHeight;
    };
    this.InternalUpdateParent = function () {
      var p = null;
      p = this.FPrevParent;
      if (this.FNew) {
        this.CreateControl();
        if (this.GetContainer() != null) {
          if ((this.FParent != null) && !(this.FParent.GetContainer() != null)) this.FParent.CreateControl();
          if ((this.FParent !== p) && (p != null) && (p.GetContainer() != null)) {
            if (this.GetContainer().parentNode === p.GetChildContainer()) p.GetChildContainer().removeChild(this.GetContainer());
          };
          if ((this.FParent != null) && (this.FParent.GetContainer() != null)) {
            this.FParent.GetChildContainer().appendChild(this.GetContainer());
          };
        };
      };
    };
    this.UpdateChildren = function (AControl) {
      var I = 0;
      var c = null;
      if ((AControl != null) && !(pas.Classes.TComponentStateItem.csDestroying in this.FComponentState)) {
        if (AControl.FAlign !== $mod.TAlign.alNone) AControl.DoRealign();
        if ($mod.TCustomControl.isPrototypeOf(AControl)) {
          rtl.as(AControl,$mod.TCustomControl).RecreateCanvas();
          rtl.as(AControl,$mod.TCustomControl).Invalidate();
        };
        for (var $l = 0, $end = AControl.GetControlsCount() - 1; $l <= $end; $l++) {
          I = $l;
          c = AControl.GetControls(I);
          this.UpdateChildren(c);
        };
      };
    };
    this.PersistinHTML = function () {
      var i = 0;
      for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
        i = $l;
        this.GetControls(i).PersistinHTML();
      };
    };
    this.LoadFromHTML = function (HTML) {
      if (this.GetElementHandle() != null) this.GetElementHandle().outerHTML = HTML;
    };
    this.InitFromHTML = function () {
      var i = 0;
      for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
        i = $l;
        this.GetControls(i).InitFromHTML();
      };
    };
    this.SaveState = function () {
      var Result = "";
      Result = "";
      return Result;
    };
    this.LoadState = function (AState) {
    };
    this.DisableTab = function () {
      var i = 0;
      if (!(this.FTabStop && this.CanFocus())) {
        if (this.GetContainer() != null) this.GetContainer().setAttribute("tabindex","-1");
      };
      for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
        i = $l;
        this.GetControls(i).DisableTab();
      };
    };
    this.EnableTab = function () {
      var i = 0;
      if ((this.FContainer != null) && !this.GetIsLinked()) {
        if (this.FTabStop && this.CanFocus()) {
          this.FContainer.setAttribute("tabindex",pas.SysUtils.IntToStr(this.FTabOrder + 1));
        } else {
          this.FContainer.setAttribute("tabindex","-1");
        };
      };
      for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
        i = $l;
        this.GetControls(i).EnableTab();
      };
    };
    this.SetElementClassName = function (AValue) {
      if (this.FElementClassName !== AValue) {
        this.FElementClassName = AValue;
        if (this.FContainer != null) this.FContainer.setAttribute("class",AValue);
        this.UpdateElement();
      };
    };
    this.SetColor = function (AValue) {
      this.FColor = AValue;
      this.UpdateElementVisual();
      this.ColorChanging();
    };
    this.SetFont = function (AValue) {
      this.FFont.SetName(AValue.FName);
      this.FFont.SetSize(AValue.FSize);
      this.FFont.SetStyle(rtl.refSet(AValue.FStyle));
      this.FFont.SetColor(AValue.FColor);
    };
    this.SetParent = function (AValue) {
      var isNew = false;
      if (AValue != null) AValue = AValue.CanAcceptChild(this);
      isNew = this.FNew;
      if (this.FParent !== AValue) {
        if (this.FParent != null) this.FParent.UnRegisterParent(this);
        this.FPrevParent = this.FParent;
        this.FParent = AValue;
        this.FGotFocus = false;
        this.UpdateParent();
        if (!(pas.Classes.TComponentStateItem.csDestroying in this.FComponentState)) {
          if (!isNew) this.UpdateElement();
          this.InitScript();
        };
        if (this.FParent != null) this.FParent.RegisterParent(this);
        if ((pas.Classes.TComponentStateItem.csLoading in this.FComponentState) && (this.FParent != null) && !(pas.Classes.TComponentStateItem.csLoading in this.FParent.FComponentState)) this.Loaded();
        if ((AValue != null) && (this.FParent != null) && !this.FParent.IsUpdating()) {
          if (this.FAlign !== $mod.TAlign.alNone) {
            this.DoRealign()}
           else this.Realign();
        };
        if (!(pas.Classes.TComponentStateItem.csDestroying in this.FComponentState)) this.Invalidate();
      };
    };
    this.RegisterParent = function (AValue) {
      this.FControls = rtl.arraySetLength(this.FControls,null,rtl.length(this.FControls) + 1);
      this.FControls[rtl.length(this.FControls) - 1] = AValue;
    };
    this.UnRegisterParent = function (AValue) {
      var i = 0;
      var flg = false;
      flg = false;
      for (var $l = 0, $end = rtl.length(this.FControls) - 1; $l <= $end; $l++) {
        i = $l;
        if (this.FControls[i] === AValue) {
          flg = true;
        };
        if (flg && (i < (rtl.length(this.FControls) - 1))) this.FControls[i] = this.FControls[i + 1];
      };
      if (flg) this.FControls = rtl.arraySetLength(this.FControls,null,rtl.length(this.FControls) - 1);
    };
    this.CanAcceptChild = function (AValue) {
      var Result = null;
      Result = this;
      return Result;
    };
    this.SetLeft = function (AValue) {
      if (this.FLeft !== AValue) {
        this.FLeft = AValue;
        this.ResetAnchoring();
        if (!this.FUpdateTopLeft) this.FOrigLeft = AValue;
        this.UpdateElementSize();
        this.RecreateCanvas();
        this.InternalResize();
        if (!(pas.Classes.TComponentStateItem.csLoading in this.FComponentState) && (this.FAlign !== $mod.TAlign.alNone) && (this.FParent != null)) {
          this.DoRealign();
        };
      };
    };
    this.SetTop = function (AValue) {
      if (this.FTop !== AValue) {
        this.FTop = AValue;
        this.ResetAnchoring();
        if (!this.FUpdateTopLeft) this.FOrigTop = AValue;
        this.UpdateElementSize();
        this.RecreateCanvas();
        this.InternalResize();
        if (!(pas.Classes.TComponentStateItem.csLoading in this.FComponentState) && (this.FAlign !== $mod.TAlign.alNone) && (this.FParent != null)) {
          this.DoRealign();
        };
      };
    };
    this.MouseUp = function (Button, Shift, X, Y) {
      if (!this.FEnabled) return;
      if (this.FOnMouseUp != null) this.FOnMouseUp(this,Button,rtl.refSet(Shift),X,Y);
    };
    this.MouseDown = function (Button, Shift, X, Y) {
      if (!this.FEnabled) return;
      if (this.FOnMouseDown != null) this.FOnMouseDown(this,Button,rtl.refSet(Shift),X,Y);
    };
    this.MouseMove = function (Shift, X, Y) {
      if (!this.FEnabled) return;
      if (this.FOnMouseMove != null) this.FOnMouseMove(this,rtl.refSet(Shift),X,Y);
    };
    this.TouchStart = function (X, Y) {
      if (this.FOnTouchStart != null) this.FOnTouchStart(this,X,Y);
    };
    this.TouchMove = function (X, Y) {
      if (this.FOnTouchMove != null) this.FOnTouchMove(this,X,Y);
    };
    this.TouchEnd = function (X, Y) {
      if (this.FOnTouchEnd != null) this.FOnTouchEnd(this,X,Y);
    };
    this.TouchCancel = function (X, Y) {
      if (this.FOnTouchCancel != null) this.FOnTouchCancel(this,X,Y);
    };
    this.DoMouseEnter = function () {
      if (this.FOnMouseEnter != null) this.FOnMouseEnter(this);
    };
    this.DoMouseLeave = function () {
      if (this.FOnMouseLeave != null) this.FOnMouseLeave(this);
    };
    this.MouseWheel = function (Shift, WheelDelta, Handled) {
      var IsNeg = false;
      if (this.FOnMouseWheel != null) this.FOnMouseWheel(this,rtl.refSet(Shift),WheelDelta,pas.Types.TPoint.$clone(pas.Types.Point(0,0)),Handled);
      this.FWheelAccumulator += WheelDelta;
      while (Math.abs(this.FWheelAccumulator) >= 120) {
        IsNeg = this.FWheelAccumulator < 0;
        this.FWheelAccumulator = Math.abs(this.FWheelAccumulator) - 120;
        if (IsNeg) {
          if (this.FWheelAccumulator !== 0) this.FWheelAccumulator = -this.FWheelAccumulator;
          this.DoMouseWheelDown(rtl.refSet(Shift),pas.Types.TPoint.$clone(this.FWheelMousePos));
        } else this.DoMouseWheelUp(rtl.refSet(Shift),pas.Types.TPoint.$clone(this.FWheelMousePos));
      };
    };
    this.DoMouseWheelDown = function (Shift, MousePos) {
      var Result = false;
      Result = false;
      if (this.FOnMouseWheelDown != null) this.FOnMouseWheelDown(this,rtl.refSet(Shift),pas.Types.TPoint.$clone(MousePos),{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.DoMouseWheelUp = function (Shift, MousePos) {
      var Result = false;
      Result = false;
      if (this.FOnMouseWheelUp != null) this.FOnMouseWheelUp(this,rtl.refSet(Shift),pas.Types.TPoint.$clone(MousePos),{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.DblClick = function () {
      if (this.FOnDblClick != null) this.FOnDblClick(this);
    };
    this.KeyDown = function (Key, Shift) {
      if (this.FOnKeyDown != null) this.FOnKeyDown(this,Key,rtl.refSet(Shift));
    };
    this.KeyPreview = function (Key, Shift) {
      if ((this.FOwner != null) && $mod.TControl.isPrototypeOf(this.FOwner)) {
        rtl.as(this.FOwner,$mod.TControl).KeyPreview(Key,rtl.refSet(Shift));
      };
    };
    this.KeyPress = function (Key) {
      if (this.FOnKeyPress != null) this.FOnKeyPress(this,Key);
    };
    this.KeyUp = function (Key, Shift) {
      if (this.FOnKeyUp != null) this.FOnKeyUp(this,Key,rtl.refSet(Shift));
    };
    this.SetFocus = function () {
      var e = null;
      if (!this.CanFocus()) return;
      if (this.GetElementHandle() != null) {
        e = this.GetElementHandle();
        if (this.FGotFocus) {
          e.focus();
        } else {
          setTimeout(function() {e.focus();}, 1);
        };
      };
    };
    this.DoMarginsChanged = function (Sender) {
      this.DoRealign();
    };
    this.DoCenterChanged = function (Sender) {
      this.DoRealign();
    };
    this.DoRealign = function () {
      if ((this.FParent != null) && !this.FParent.IsUpdating()) {
        this.FParent.AlignControl(this.FParent);
      };
    };
    this.DoBoundsChange = function () {
      var b = false;
      var frm = null;
      this.UpdateElementSize();
      this.RecreateCanvas();
      if (this.FIsResizing) return;
      this.FIsResizing = true;
      this.InternalResize();
      this.DoRealign();
      b = false;
      frm = pas["WEBLib.Forms"].GetParentForm(this);
      if (frm != null) {
        b = frm.FIsResizing$1;
        b = b || (frm.FUpdateCount > 0);
      };
      b = b || (this.FUpdateCount > 0);
      b = b || this.FIsAligning;
      if (!b) {
        this.UpdateChildAnchoring();
      };
      this.FIsResizing = false;
    };
    this.DoEndDrag = function (Target, X, Y) {
      if (this.FonEndDrag != null) this.FonEndDrag(this,Target,X,Y);
    };
    this.DoStartDrag = function (DragObject) {
      if (this.FOnStartDrag != null) this.FOnStartDrag(this,DragObject);
    };
    this.DragOver = function (Source, X, Y, State, Accept) {
      if (this.FOnDragOver != null) this.FOnDragOver(this,Source,X,Y,State,Accept);
    };
    this.IsFocused = function () {
      var Result = false;
      Result = this.FContainer === document.activeElement;
      return Result;
    };
    this.Focused = function () {
      var Result = false;
      Result = this.FContainer === document.activeElement;
      return Result;
    };
    this.GetID = function () {
      var Result = "";
      Result = this.FID;
      return Result;
    };
    this.GetElementHandle = function () {
      var Result = null;
      Result = null;
      if ((this.FContainer != null) && this.FControlCreated) Result = this.FContainer;
      return Result;
    };
    this.GetElementBindHandle = function () {
      var Result = null;
      Result = this.GetElementHandle();
      return Result;
    };
    this.GetElement = function () {
      var Result = null;
      Result = document.getElementById(this.GetID());
      return Result;
    };
    this.GetKeyCode = function (AValue, IgnoreCase) {
      var Result = 0;
      var i = 0;
      i = -1;
      var $tmp = AValue;
      if ($tmp === "Up") {
        i = 38}
       else if ($tmp === "Down") {
        i = 40}
       else if ($tmp === "Left") {
        i = 37}
       else if ($tmp === "Right") {
        i = 39}
       else if ($tmp === "!") {
        i = 56}
       else if ($tmp === '"') {
        i = 51}
       else if ($tmp === "#") {
        i = 51}
       else if ($tmp === "$") {
        i = 186}
       else if ($tmp === "%") {
        i = 192}
       else if ($tmp === "'") {
        i = 52}
       else if ($tmp === "(") {
        i = 53}
       else if ($tmp === ")") {
        i = 219}
       else if ($tmp === "*") {
        i = 106}
       else if ($tmp === "+") {
        i = 107}
       else if ($tmp === "-") {
        i = 109}
       else if ($tmp === ",") {
        i = 44}
       else if ($tmp === ".") {
        i = 46}
       else if ($tmp === "/") {
        i = 111}
       else if ($tmp === "\\") {
        i = 226}
       else if ($tmp === "=") {
        i = 187}
       else if ($tmp === "<") {
        i = 226}
       else if ($tmp === ">") {
        i = 226}
       else if ($tmp === pas.Web.TJSKeyNames.BackSpace) {
        i = 8}
       else if ($tmp === pas.Web.TJSKeyNames.Tab) {
        i = 9}
       else if ($tmp === pas.Web.TJSKeyNames.Enter) {
        i = 13}
       else if ($tmp === pas.Web.TJSKeyNames.Shift) {
        i = 16}
       else if ($tmp === pas.Web.TJSKeyNames.Control) {
        i = 17}
       else if ($tmp === pas.Web.TJSKeyNames.Alt) {
        i = 18}
       else if ($tmp === pas.Web.TJSKeyNames.Pause) {
        i = 19}
       else if ($tmp === pas.Web.TJSKeyNames.CapsLock) {
        i = 20}
       else if ($tmp === pas.Web.TJSKeyNames.Escape) {
        i = 27}
       else if ($tmp === pas.Web.TJSKeyNames.PageUp) {
        i = 33}
       else if ($tmp === pas.Web.TJSKeyNames.PageDown) {
        i = 34}
       else if ($tmp === pas.Web.TJSKeyNames._End) {
        i = 35}
       else if ($tmp === pas.Web.TJSKeyNames.Home) {
        i = 36}
       else if ($tmp === pas.Web.TJSKeyNames.ArrowLeft) {
        i = 37}
       else if ($tmp === pas.Web.TJSKeyNames.ArrowUp) {
        i = 38}
       else if ($tmp === pas.Web.TJSKeyNames.ArrowRight) {
        i = 39}
       else if ($tmp === pas.Web.TJSKeyNames.ArrowDown) {
        i = 40}
       else if ($tmp === pas.Web.TJSKeyNames.Insert) {
        i = 45}
       else if ($tmp === pas.Web.TJSKeyNames.Delete) {
        i = 46}
       else if ($tmp === pas.Web.TJSKeyNames.F1) {
        i = 112}
       else if ($tmp === pas.Web.TJSKeyNames.F2) {
        i = 113}
       else if ($tmp === pas.Web.TJSKeyNames.F3) {
        i = 114}
       else if ($tmp === pas.Web.TJSKeyNames.F4) {
        i = 115}
       else if ($tmp === pas.Web.TJSKeyNames.F5) {
        i = 116}
       else if ($tmp === pas.Web.TJSKeyNames.F6) {
        i = 117}
       else if ($tmp === pas.Web.TJSKeyNames.F7) {
        i = 118}
       else if ($tmp === pas.Web.TJSKeyNames.F8) {
        i = 119}
       else if ($tmp === pas.Web.TJSKeyNames.F9) {
        i = 120}
       else if ($tmp === pas.Web.TJSKeyNames.F10) {
        i = 121}
       else if ($tmp === pas.Web.TJSKeyNames.F11) {
        i = 122}
       else if ($tmp === pas.Web.TJSKeyNames.F12) {
        i = 123}
       else if ($tmp === pas.Web.TJSKeyNames.F13) {
        i = 124}
       else if ($tmp === pas.Web.TJSKeyNames.F14) {
        i = 125}
       else if ($tmp === pas.Web.TJSKeyNames.F15) {
        i = 126}
       else if ($tmp === pas.Web.TJSKeyNames.F16) {
        i = 127}
       else if ($tmp === pas.Web.TJSKeyNames.F17) {
        i = 128}
       else if ($tmp === pas.Web.TJSKeyNames.F18) {
        i = 129}
       else if ($tmp === pas.Web.TJSKeyNames.F19) {
        i = 130}
       else if ($tmp === pas.Web.TJSKeyNames.F20) {
        i = 131}
       else {
        if (pas.System.Assigned(AValue) && (AValue.length > 0)) {
          i = AValue.charCodeAt(1 - 1);
          if (IgnoreCase && (i >= 97) && (i <= 122)) {
            i = i & 0xDF}
           else if ((i >= 65) && (i <= 90)) {
            i = i | 0x40}
           else if (i > 122) i = i | 0x80;
        };
      };
      Result = i;
      return Result;
    };
    this.GetKeyChar = function (AValue) {
      var Result = "\x00";
      var i = 0;
      i = -1;
      Result = "\x00";
      var $tmp = AValue;
      if ($tmp === pas.Web.TJSKeyNames.BackSpace) {
        i = 8}
       else if ($tmp === pas.Web.TJSKeyNames.Tab) {
        i = 9}
       else if ($tmp === pas.Web.TJSKeyNames.Enter) {
        i = 13}
       else if ($tmp === pas.Web.TJSKeyNames.Shift) {
        i = 16}
       else if ($tmp === pas.Web.TJSKeyNames.Control) {
        i = 17}
       else if ($tmp === pas.Web.TJSKeyNames.Alt) {
        i = 18}
       else if ($tmp === pas.Web.TJSKeyNames.Pause) {
        i = 19}
       else if ($tmp === pas.Web.TJSKeyNames.CapsLock) {
        i = 20}
       else if ($tmp === pas.Web.TJSKeyNames.Escape) {
        i = 27}
       else if ($tmp === pas.Web.TJSKeyNames.PageUp) {
        i = 33}
       else if ($tmp === pas.Web.TJSKeyNames.PageDown) {
        i = 34}
       else if ($tmp === pas.Web.TJSKeyNames._End) {
        i = 35}
       else if ($tmp === pas.Web.TJSKeyNames.Home) {
        i = 36}
       else if ($tmp === pas.Web.TJSKeyNames.ArrowLeft) {
        i = 37}
       else if ($tmp === pas.Web.TJSKeyNames.ArrowUp) {
        i = 38}
       else if ($tmp === pas.Web.TJSKeyNames.ArrowRight) {
        i = 39}
       else if ($tmp === pas.Web.TJSKeyNames.ArrowDown) {
        i = 40}
       else if ($tmp === pas.Web.TJSKeyNames.Insert) {
        i = 45}
       else if ($tmp === pas.Web.TJSKeyNames.Delete) {
        i = 46}
       else if ($tmp === pas.Web.TJSKeyNames.F1) {
        i = 112}
       else if ($tmp === pas.Web.TJSKeyNames.F2) {
        i = 113}
       else if ($tmp === pas.Web.TJSKeyNames.F3) {
        i = 114}
       else if ($tmp === pas.Web.TJSKeyNames.F4) {
        i = 115}
       else if ($tmp === pas.Web.TJSKeyNames.F5) {
        i = 116}
       else if ($tmp === pas.Web.TJSKeyNames.F6) {
        i = 117}
       else if ($tmp === pas.Web.TJSKeyNames.F7) {
        i = 118}
       else if ($tmp === pas.Web.TJSKeyNames.F8) {
        i = 119}
       else if ($tmp === pas.Web.TJSKeyNames.F9) {
        i = 120}
       else if ($tmp === pas.Web.TJSKeyNames.F10) {
        i = 121}
       else if ($tmp === pas.Web.TJSKeyNames.F11) {
        i = 122}
       else if ($tmp === pas.Web.TJSKeyNames.F12) {
        i = 123}
       else if ($tmp === pas.Web.TJSKeyNames.F13) {
        i = 124}
       else if ($tmp === pas.Web.TJSKeyNames.F14) {
        i = 125}
       else if ($tmp === pas.Web.TJSKeyNames.F15) {
        i = 126}
       else if ($tmp === pas.Web.TJSKeyNames.F16) {
        i = 127}
       else if ($tmp === pas.Web.TJSKeyNames.F17) {
        i = 128}
       else if ($tmp === pas.Web.TJSKeyNames.F18) {
        i = 129}
       else if ($tmp === pas.Web.TJSKeyNames.F19) {
        i = 130}
       else if ($tmp === pas.Web.TJSKeyNames.F20) {
        i = 131}
       else {
        Result = AValue.charAt(0);
      };
      if (i !== -1) Result = String.fromCharCode(i);
      return Result;
    };
    this.IsKeyCharacter = function (AValue) {
      var Result = false;
      var $tmp = AValue;
      if (($tmp === "Up") || ($tmp === "Down") || ($tmp === "Left") || ($tmp === "Right") || ($tmp === pas.Web.TJSKeyNames.Shift) || ($tmp === pas.Web.TJSKeyNames.Control) || ($tmp === pas.Web.TJSKeyNames.Alt) || ($tmp === pas.Web.TJSKeyNames.Pause) || ($tmp === pas.Web.TJSKeyNames.CapsLock) || ($tmp === pas.Web.TJSKeyNames.PageUp) || ($tmp === pas.Web.TJSKeyNames.PageDown) || ($tmp === pas.Web.TJSKeyNames._End) || ($tmp === pas.Web.TJSKeyNames.Home) || ($tmp === pas.Web.TJSKeyNames.ArrowLeft) || ($tmp === pas.Web.TJSKeyNames.ArrowUp) || ($tmp === pas.Web.TJSKeyNames.ArrowRight) || ($tmp === pas.Web.TJSKeyNames.ArrowDown) || ($tmp === pas.Web.TJSKeyNames.Insert) || ($tmp === pas.Web.TJSKeyNames.Delete) || ($tmp === pas.Web.TJSKeyNames.F1) || ($tmp === pas.Web.TJSKeyNames.F2) || ($tmp === pas.Web.TJSKeyNames.F3) || ($tmp === pas.Web.TJSKeyNames.F4) || ($tmp === pas.Web.TJSKeyNames.F5) || ($tmp === pas.Web.TJSKeyNames.F6) || ($tmp === pas.Web.TJSKeyNames.F7) || ($tmp === pas.Web.TJSKeyNames.F8) || ($tmp === pas.Web.TJSKeyNames.F9) || ($tmp === pas.Web.TJSKeyNames.F10) || ($tmp === pas.Web.TJSKeyNames.F11) || ($tmp === pas.Web.TJSKeyNames.F12) || ($tmp === pas.Web.TJSKeyNames.F13) || ($tmp === pas.Web.TJSKeyNames.F14) || ($tmp === pas.Web.TJSKeyNames.F15) || ($tmp === pas.Web.TJSKeyNames.F16) || ($tmp === pas.Web.TJSKeyNames.F17) || ($tmp === pas.Web.TJSKeyNames.F18) || ($tmp === pas.Web.TJSKeyNames.F19) || ($tmp === pas.Web.TJSKeyNames.F20)) {
        Result = false}
       else {
        Result = true;
      };
      return Result;
    };
    this.GetClientRect = function () {
      var Result = pas.Types.TRect.$new();
      var css = "";
      var p = 0;
      var brdr = 0;
      css = pas.SysUtils.UpperCase(this.GetStyle("border-width"));
      brdr = 0;
      p = pas.System.Pos("PX",css);
      if (p > 0) {
        pas.System.Delete({get: function () {
            return css;
          }, set: function (v) {
            css = v;
          }},p,2);
        pas.System.val$6(css,{get: function () {
            return brdr;
          }, set: function (v) {
            brdr = v;
          }},{get: function () {
            return p;
          }, set: function (v) {
            p = v;
          }});
      };
      Result.$assign(pas.Types.Rect(0,0,this.GetWidth() - (2 * brdr),this.GetHeight() - (2 * brdr)));
      return Result;
    };
    this.CreateControl = function () {
      if (!(this.FElement != null)) {
        this.FElement = this.CreateElement();
        if (this.FElement != null) {
          this.FControlCreated = true;
          this.FContainer = this.FElement;
          if (!(this.GetID() === "body")) this.GetContainer().setAttribute("id",this.GetID());
          this.GetContainer().setAttribute("zindex","0");
          if (this.FElementClassName !== "") this.GetContainer().setAttribute("class",this.FElementClassName);
          this.CreateChildElements(this.FElement);
          this.BindEvents();
          this.UpdateElement();
        };
      };
    };
    this.ClearMethodPointers = function () {
      this.FWheelPtr = null;
      this.FClickPtr = null;
      this.FDblClickPtr = null;
      this.FMouseDownPtr = null;
      this.FMouseUpPtr = null;
      this.FMouseMovePtr = null;
      this.FMouseLeavePtr = null;
      this.FMouseEnterPtr = null;
      this.FKeyDownPtr = null;
      this.FKeyUpPtr = null;
      this.FKeyPressPtr = null;
      this.FInputPtr = null;
      this.FEnterPtr = null;
      this.FExitPtr = null;
      this.FTouchStartPtr = null;
      this.FTouchEndPtr = null;
      this.FTouchMovePtr = null;
      this.FTouchCancelPtr = null;
      this.FLayerMouseLeavePtr = null;
      this.FLayerMouseEnterPtr = null;
      this.FScriptLoadedPtr = null;
      this.FContextMenuPtr = null;
    };
    this.GetMethodPointers = function () {
      if (this.FWheelPtr === null) {
        this.FWheelPtr = rtl.createCallback(this,"HandleDoWheel");
        this.FClickPtr = rtl.createCallback(this,"HandleDoClick");
        this.FDblClickPtr = rtl.createCallback(this,"HandleDoDblClick");
        this.FMouseDownPtr = rtl.createCallback(this,"HandleDoMouseDown");
        this.FMouseUpPtr = rtl.createCallback(this,"HandleDoMouseUp");
        this.FMouseMovePtr = rtl.createCallback(this,"HandleDoMouseMove");
        this.FMouseLeavePtr = rtl.createCallback(this,"HandleDoMouseLeave");
        this.FMouseEnterPtr = rtl.createCallback(this,"HandleDoMouseEnter");
        this.FKeyDownPtr = rtl.createCallback(this,"HandleDoKeyDown");
        this.FKeyUpPtr = rtl.createCallback(this,"HandleDoKeyUp");
        this.FKeyPressPtr = rtl.createCallback(this,"HandleDoKeyPress");
        this.FInputPtr = rtl.createCallback(this,"HandleDoInput");
        this.FEnterPtr = rtl.createCallback(this,"HandleDoEnter");
        this.FExitPtr = rtl.createCallback(this,"HandleDoExit");
        this.FTouchStartPtr = rtl.createCallback(this,"HandleDoTouchStart");
        this.FTouchEndPtr = rtl.createCallback(this,"HandleDoTouchEnd");
        this.FTouchMovePtr = rtl.createCallback(this,"HandleDoTouchMove");
        this.FTouchCancelPtr = rtl.createCallback(this,"HandleDoTouchCancel");
        this.FLayerMouseLeavePtr = rtl.createCallback(this,"LayerHandleDoMouseLeave");
        this.FLayerMouseEnterPtr = rtl.createCallback(this,"LayerHandleDoMouseEnter");
        this.FScriptLoadedPtr = rtl.createCallback(this,"RequiredScriptLoaded");
        this.FDragStartPtr = rtl.createCallback(this,"HandleDoDragStart");
        this.FDragOverPtr = rtl.createCallback(this,"HandleDoDragOver");
        this.FDragEnterPtr = rtl.createCallback(this,"HandleDoDragEnter");
        this.FDragLeavePtr = rtl.createCallback(this,"HandledoDragLeave");
        this.FDragEndPtr = rtl.createCallback(this,"HandleDoDragEnd");
        this.FDragDropPtr = rtl.createCallback(this,"HandleDoDragDrop");
        this.FContextMenuPtr = rtl.createCallback(this,"HandleDoContextMenu");
      };
    };
    this.EventsBound = function () {
      var Result = false;
      Result = this.FEventsBound;
      return Result;
    };
    this.BindEvents = function () {
      var eh = null;
      var wp = null;
      if (this.GetElementBindHandle() != null) {
        this.GetMethodPointers();
        this.FEventsBound = true;
        eh = this.GetElementBindHandle();
        wp = this.FWheelPtr;
        eh.addEventListener('wheel', wp, { passive:true});
        eh.addEventListener("click",this.FClickPtr);
        eh.addEventListener("dblclick",this.FDblClickPtr);
        eh.addEventListener("mousedown",this.FMouseDownPtr);
        eh.addEventListener("mouseup",this.FMouseUpPtr);
        eh.addEventListener("mousemove",this.FMouseMovePtr);
        eh.addEventListener("mouseleave",this.FMouseLeavePtr);
        eh.addEventListener("mouseenter",this.FMouseEnterPtr);
        eh.addEventListener("keydown",this.FKeyDownPtr);
        eh.addEventListener("keyup",this.FKeyUpPtr);
        eh.addEventListener("keypress",this.FKeyPressPtr);
        eh.addEventListener("input",this.FInputPtr);
        eh.addEventListener("focus",this.FEnterPtr);
        eh.addEventListener("blur",this.FExitPtr);
        wp = this.FTouchStartPtr;
        eh.addEventListener('touchstart', wp, {passive: true});
        wp = this.FTouchMovePtr;
        eh.addEventListener('touchmove', wp, {passive:true});
        eh.addEventListener("touchend",this.FTouchEndPtr);
        eh.addEventListener("touchcancel",this.FTouchCancelPtr);
        eh.addEventListener("contextmenu",this.FContextMenuPtr);
        eh.addEventListener("dragstart",this.FDragStartPtr);
        eh.addEventListener("dragover",this.FDragOverPtr);
        eh.addEventListener("dragenter",this.FDragEnterPtr);
        eh.addEventListener("dragleave",this.FDragLeavePtr);
        eh.addEventListener("dragend",this.FDragEndPtr);
        eh.addEventListener("drop",this.FDragDropPtr);
      };
    };
    this.UnbindEvents = function () {
      var eh = null;
      this.ReleaseCapture();
      if (this.GetElementBindHandle() != null) {
        eh = this.GetElementBindHandle();
        eh.removeEventListener("wheel",this.FWheelPtr);
        eh.removeEventListener("click",this.FClickPtr);
        eh.removeEventListener("dblclick",this.FDblClickPtr);
        eh.removeEventListener("mousedown",this.FMouseDownPtr);
        eh.removeEventListener("mouseup",this.FMouseUpPtr);
        eh.removeEventListener("mousemove",this.FMouseMovePtr);
        eh.removeEventListener("mouseleave",this.FMouseLeavePtr);
        eh.removeEventListener("mouseenter",this.FMouseEnterPtr);
        eh.removeEventListener("keydown",this.FKeyDownPtr);
        eh.removeEventListener("keyup",this.FKeyUpPtr);
        eh.removeEventListener("keypress",this.FKeyPressPtr);
        eh.removeEventListener("focus",this.FEnterPtr);
        eh.removeEventListener("blur",this.FExitPtr);
        eh.removeEventListener("input",this.FInputPtr);
        eh.removeEventListener("touchstart",this.FTouchStartPtr);
        eh.removeEventListener("touchmove",this.FTouchMovePtr);
        eh.removeEventListener("touchend",this.FTouchEndPtr);
        eh.removeEventListener("touchcancel",this.FTouchEndPtr);
        eh.removeEventListener("contextmenu",this.FContextMenuPtr);
      };
    };
    this.UpdatePadding = function (ARect) {
    };
    this.AlignControls = function (AControl, ARect) {
      var $Self = this;
      var j = 0;
      function DoPosition(Control, AAlign) {
        var dl = 0;
        var dt = 0;
        var dr = 0;
        var db = 0;
        if (!Control.AnchoringInitialized()) $Self.InitAnchoring();
        Control.FUpdateTopLeft = true;
        if (Control.FAlignWithMargins) {
          dl = Control.FMargins.FLeft;
          dt = Control.FMargins.FTop;
          db = Control.FMargins.FBottom;
          dr = Control.FMargins.FRight;
        } else {
          dl = 0;
          dt = 0;
          db = 0;
          dr = 0;
        };
        var $tmp = AAlign;
        if ($tmp === $mod.TAlign.alTop) {
          Control.SetBoundsInt(ARect.Left + dl,ARect.Top + dt,ARect.Right - ARect.Left - dl - dr,Control.GetHeight());
          ARect.Top = ARect.Top + Control.GetHeight() + dt + db;
        } else if ($tmp === $mod.TAlign.alBottom) {
          Control.SetBoundsInt(ARect.Left + dl,ARect.Bottom - Control.GetHeight() - db - 1,ARect.Right - ARect.Left - dl - dr - 1,Control.GetHeight());
          ARect.Bottom = ARect.Bottom - Control.GetHeight() - dt - db;
        } else if ($tmp === $mod.TAlign.alLeft) {
          Control.SetBoundsInt(ARect.Left + dl,ARect.Top + dt,Control.GetWidth(),ARect.Bottom - ARect.Top - dt - db);
          ARect.Left = ARect.Left + Control.GetWidth() + dl + dr;
        } else if ($tmp === $mod.TAlign.alRight) {
          Control.SetBoundsInt(ARect.Right - Control.GetWidth() - dr,ARect.Top + dt,Control.GetWidth(),ARect.Bottom - ARect.Top - db - dt);
          ARect.Right = ARect.Right - Control.GetWidth() - dr - dl;
        } else if ($tmp === $mod.TAlign.alClient) {
          Control.SetBoundsInt(ARect.Left + dl,ARect.Top + dt,ARect.Right - ARect.Left - dl - dr,ARect.Bottom - ARect.Top - db - dt);
        } else if ($tmp === $mod.TAlign.alCustom) {
          dl = Control.GetLeft();
          dt = Control.GetTop();
          dr = 0;
          db = 0;
          if (Control.FCenter.FVertical || Control.FCenter.FHorizontal) {
            if (Control.FCenter.FHorizontal) {
              dl = ARect.Left;
              dr = rtl.trunc((ARect.Right - ARect.Left - Control.GetWidth()) / 2);
            };
            if (Control.FCenter.FVertical) {
              dt = ARect.Top;
              db = rtl.trunc((ARect.Bottom - ARect.Top - Control.GetHeight()) / 2);
            };
            Control.SetBoundsInt(dl + dr,dt + db,Control.GetWidth(),Control.GetHeight());
          };
        };
        Control.FUpdateTopLeft = false;
      };
      function DoAlign(AAlign) {
        var i = 0;
        var j = 0;
        var ins = 0;
        var il = null;
        var b = false;
        il = pas.Classes.TList.$create("Create$1");
        for (var $l = 0, $end = $Self.GetControlsCount() - 1; $l <= $end; $l++) {
          i = $l;
          b = ($Self.GetControls(i).FCenter.FVertical || $Self.GetControls(i).FCenter.FHorizontal) && (AAlign === $mod.TAlign.alCustom);
          if (b || (($Self.GetControls(i).FAlign === AAlign) && ($Self.GetControls(i).FVisible || (pas.Classes.TComponentStateItem.csDesigning in $Self.FComponentState)))) {
            ins = il.GetCount();
            for (var $l1 = il.GetCount() - 1; $l1 >= 0; $l1--) {
              j = $l1;
              var $tmp = AAlign;
              if ($tmp === $mod.TAlign.alTop) {
                if ($Self.GetControls(i).FOrigTop < rtl.getObject(il.Get(j)).FOrigTop) ins = j}
               else if ($tmp === $mod.TAlign.alLeft) {
                if ($Self.GetControls(i).FOrigLeft < rtl.getObject(il.Get(j)).FOrigLeft) ins = j}
               else if ($tmp === $mod.TAlign.alRight) {
                if (($Self.GetControls(i).FOrigLeft + $Self.GetControls(i).GetWidth()) > (rtl.getObject(il.Get(j)).FOrigLeft + rtl.getObject(il.Get(j)).GetWidth())) ins = j}
               else if ($tmp === $mod.TAlign.alBottom) if (($Self.GetControls(i).FOrigTop + $Self.GetControls(i).GetHeight()) > (rtl.getObject(il.Get(j)).FOrigTop + rtl.getObject(il.Get(j)).GetHeight())) ins = j;
            };
            il.Insert(ins,$Self.GetControls(i));
          };
        };
        for (var $l2 = 0, $end1 = il.GetCount() - 1; $l2 <= $end1; $l2++) {
          i = $l2;
          DoPosition(rtl.getObject(il.Get(i)),AAlign);
        };
        il = rtl.freeLoc(il);
      };
      this.UpdatePadding(ARect);
      DoAlign($mod.TAlign.alTop);
      DoAlign($mod.TAlign.alBottom);
      DoAlign($mod.TAlign.alLeft);
      DoAlign($mod.TAlign.alRight);
      DoAlign($mod.TAlign.alClient);
      DoAlign($mod.TAlign.alCustom);
      for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
        j = $l;
        this.GetControls(j).AlignControl(this.GetControls(j));
      };
    };
    this.AlignControl = function (AControl) {
      var r = pas.Types.TRect.$new();
      var cr = null;
      var ovf = "";
      var ovfx = "";
      var ovfy = "";
      var eh = null;
      var el = null;
      var frm = null;
      var ctop = 0;
      var vscrl = 0;
      var sbw = 0;
      if (this.FIsAligning) return;
      if (this.IsUpdating()) return;
      if (pas.Classes.TComponentStateItem.csLoading in this.FComponentState) return;
      if ((this.FParent != null) && !this.FParent.FVisible) return;
      frm = pas["WEBLib.Forms"].GetParentForm(this);
      if ((frm != null) && frm.IsUpdating()) return;
      ctop = 0;
      if ((frm != null) && (frm.FFormContainer !== "") && pas["WEBLib.Forms"].TCustomForm.isPrototypeOf(AControl)) {
        el = document.getElementById(frm.FFormContainer);
        if (el != null) {
          cr = el.getBoundingClientRect();
          ctop = Math.round(cr.top + 1);
        };
      };
      this.FIsAligning = true;
      if (!(AControl != null)) return;
      eh = AControl.GetElementHandle();
      if (eh != null) {
        ovf = AControl.GetElementStyle().getPropertyValue("overflow");
        ovfx = AControl.GetElementStyle().getPropertyValue("overflow-x");
        ovfy = AControl.GetElementStyle().getPropertyValue("overflow-y");
        if (this.FClipChildren && (pas.SysUtils.LowerCase(eh.tagName) !== pas["WEBLib.WebTools"].cBodyTag)) {
          AControl.GetElementStyle().setProperty("overflow","hidden")}
         else AControl.GetElementStyle().setProperty("overflow","");
      };
      r.$assign(this.GetClientRect());
      r.Bottom = r.Bottom - ctop;
      if (this.GetIsLinked()) {
        cr = this.GetElementHandle().getBoundingClientRect();
        r.$assign(pas.Types.Rect(0,0,Math.round(cr.right - cr.left),Math.round(cr.bottom - cr.top)));
      };
      if (((r.Bottom + ctop) > pas["WEBLib.Forms"].WinHeight()) && (this.FHeightStyle !== $mod.TSizeStyle.ssAbsolute) && !(this.FElementPosition === $mod.TElementPosition.epAbsolute) && !this.GetIsLinked() && !(pas["WEBLib.Forms"].VSIDE != null)) {
        if (((this.FParent != null) && pas["WEBLib.Forms"].TCustomForm.isPrototypeOf(this.FParent)) || pas["WEBLib.Forms"].TCustomForm.isPrototypeOf(this)) {
          r.Bottom = pas["WEBLib.Forms"].WinHeight() - ctop;
        };
      };
      if ((eh != null) && (eh.tagName === "BODY")) {
        vscrl = 0;
        if ((document.body.scrollHeight > document.body.clientHeight) && !(pas.Classes.TComponentStateItem.csDesigning in this.FComponentState)) vscrl = 16;
        if (frm.FFormContainer !== "") {
          r.Bottom = Math.round(Math.min(r.Bottom,pas["WEBLib.Forms"].WinHeight()));
          r.Right = Math.round(Math.min(r.Right - vscrl,pas["WEBLib.Forms"].WinWidth()));
        } else {
          r.Bottom = frm.GetHeight();
          r.Right = frm.GetWidth();
        };
      };
      if (pas["WEBLib.Forms"].TCustomForm.isPrototypeOf(AControl) && !(pas["WEBLib.Forms"].VSIDE != null)) {
        if (r.Bottom > pas["WEBLib.Forms"].WinHeight()) r.Bottom = pas["WEBLib.Forms"].WinHeight();
        if (r.Right > pas["WEBLib.Forms"].WinWidth()) r.Right = pas["WEBLib.Forms"].WinWidth();
      };
      if (AControl.IsStructuralElement()) {
        r.$assign(this.FParent.GetClientRect());
      };
      if ((pas["WEBLib.Forms"].Application.CalcScrollBarWidth() < 16) && !pas["WEBLib.Forms"].TCustomForm.isPrototypeOf(AControl)) {
        if ((AControl.FParent != null) && (AControl.GetElementHandle() != null)) {
          if (AControl.GetElementHandle().scrollHeight > AControl.GetElementHandle().clientHeight) {
            sbw = pas["WEBLib.Forms"].Application.CalcScrollBarWidth();
            if (sbw === 0) sbw = 16;
            r.Right = r.Right + (17 - sbw);
          };
        };
      };
      this.AlignControls(AControl,r);
      if (eh != null) {
        AControl.GetElementStyle().setProperty("overflow",ovf);
        AControl.GetElementStyle().setProperty("overflow-x",ovfx);
        AControl.GetElementStyle().setProperty("overflow-y",ovfy);
      };
      this.FIsAligning = false;
    };
    this.InitAnchoring = function () {
      var $Self = this;
      var i = 0;
      var dx = 0;
      var dy = 0;
      function SizeBorderOffset(AObject, ax, ay) {
        var prop = null;
        ax.set(0);
        ay.set(0);
        prop = pas.TypInfo.GetPropInfo(AObject.$class.ClassInfo(),"BorderStyle");
        if (prop != null) {
          i = pas.TypInfo.GetOrdProp$1(AObject,prop);
          if (i in rtl.createSet(1,4,5)) {
            ax.set(4);
            ay.set(4);
          };
          if (i in rtl.createSet(2,3)) {
            ax.set(16);
            ay.set(16);
          };
        };
      };
      if (this.AnchoringInitialized()) return;
      dx = 0;
      dy = 0;
      if (pas["WEBLib.Forms"].TForm.isPrototypeOf($Self)) {
        if (rtl.as($Self,pas["WEBLib.Forms"].TForm).IsMiletus()) SizeBorderOffset($Self,{get: function () {
            return dx;
          }, set: function (v) {
            dx = v;
          }},{get: function () {
            return dy;
          }, set: function (v) {
            dy = v;
          }});
        this.FOrigRect.$assign(pas.Types.Rect(0,0,this.GetDesignWidth() - dx,this.GetDesignHeight() - dy));
      } else {
        this.FOrigRect.$assign(pas.Types.Rect(this.GetDesignLeft(),this.GetDesignTop(),this.GetDesignLeft() + this.GetDesignWidth(),this.GetDesignTop() + this.GetDesignHeight()));
      };
      if (this.FParent != null) {
        if (pas["WEBLib.Forms"].TForm.isPrototypeOf(this.FParent)) {
          if (rtl.as(this.FParent,pas["WEBLib.Forms"].TForm).IsMiletus()) {
            SizeBorderOffset(this.FParent,{get: function () {
                return dx;
              }, set: function (v) {
                dx = v;
              }},{get: function () {
                return dy;
              }, set: function (v) {
                dy = v;
              }});
          };
          this.FOrigParentRect.$assign(pas.Types.Rect(0,0,this.FParent.GetDesignWidth() - dx,this.FParent.GetDesignHeight() - dy));
        } else {
          if (!this.FParent.AnchoringInitialized()) this.FParent.InitAnchoring();
          this.FOrigParentRect.$assign(pas.Types.Rect(this.FParent.GetDesignLeft(),this.FParent.GetDesignTop(),this.FParent.GetDesignLeft() + this.FParent.GetDesignWidth(),this.FParent.GetDesignTop() + this.FParent.GetDesignHeight()));
        };
      };
      for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
        i = $l;
        this.GetControls(i).InitAnchoring();
      };
    };
    this.AnchoringInitialized = function () {
      var Result = false;
      Result = (this.FOrigRect.Left !== -1) || (this.FOrigRect.Top !== -1);
      return Result;
    };
    this.InitScript = function () {
    };
    this.Realign = function () {
      this.AlignControl(this);
    };
    this.Loaded = function () {
      var i = 0;
      var NodeList = null;
      var NodeLen = 0;
      var CurIdx = 0;
      var TargetIdx = 0;
      var RefNode = null;
      var TargetNode = null;
      var C = null;
      if (!(pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) return;
      pas.Classes.TComponent.Loaded.call(this);
      if (this.GetChildContainer() != null) {
        NodeList = this.GetChildContainer().childNodes;
        NodeLen = NodeList.length;
        for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
          i = $l;
          C = this.GetControls(i);
          if (!((C.FElementPosition in rtl.createSet($mod.TElementPosition.epRelative,$mod.TElementPosition.epIgnore)) && !C.GetIsLinked() && (C.FChildOrder >= 0))) {
            C.Loaded();
            continue;
          };
          TargetIdx = C.FChildOrder;
          TargetNode = C.GetContainer();
          if (TargetIdx >= NodeLen) {
            this.GetChildContainer().appendChild(TargetNode);
            C.Loaded();
            continue;
          };
          // Find current index of TargetNode inside NodeList
          CurIdx = Array.prototype.indexOf.call(NodeList, TargetNode);
          // If it moves forward, compensate for the removal
          if (CurIdx !== -1 && TargetIdx > CurIdx) { TargetIdx++; };
          if (CurIdx === -1) ;
          if (TargetIdx < NodeLen) {
            RefNode = NodeList.item(TargetIdx)}
           else RefNode = null;
          if (RefNode != null) {
            this.GetChildContainer().insertBefore(TargetNode,RefNode)}
           else this.GetChildContainer().appendChild(TargetNode);
          C.Loaded();
        };
      } else {
        for (var $l1 = 0, $end1 = this.GetControlsCount() - 1; $l1 <= $end1; $l1++) {
          i = $l1;
          this.GetControls(i).Loaded();
        };
      };
      for (var $l2 = 0, $end2 = this.GetComponentCount() - 1; $l2 <= $end2; $l2++) {
        i = $l2;
        if (pas.Classes.TComponentStateItem.csLoading in this.GetComponent(i).FComponentState) this.GetComponent(i).Loaded();
      };
      var $tmp = this.FAlign;
      if ($tmp === $mod.TAlign.alClient) {
        if (this.FParent != null) this.SetBoundsInt(0,0,this.FParent.FWidth,this.FParent.FHeight);
      };
      this.Resize();
      this.UpdateElement();
    };
    this.InternalResize = function () {
      if (pas.Classes.TComponentStateItem.csLoading in this.FComponentState) return;
      this.Resize();
    };
    this.FontChanged = function () {
      this.UpdateElementVisual();
    };
    this.DisposeOf = function () {
      var t = null;
      t = this;
      t = rtl.freeLoc(t);
    };
    this.ClearChildElements = function () {
      var el = null;
      if (!(this.GetElementHandle() != null)) return;
      while (this.GetElementHandle().childElementCount > 0) {
        el = this.GetElementHandle().firstChild;
        this.GetElementHandle().removeChild(el);
      };
    };
    this.HookElement = function () {
      var el = null;
      var i = 0;
      el = document.getElementById(this.FID);
      this.FContainer = el;
      this.BindElement();
      this.BindEvents();
      for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
        i = $l;
        this.GetControls(i).HookElement();
      };
    };
    this.SetElementColor = function (AElement, AColor) {
      var noCSS = false;
      noCSS = !pas["WEBLib.Forms"].Application.FThemed && !(this.FElementClassName !== "");
      if (!this.GetIsLinked()) $mod.SetHTMLElementColor(AElement,AColor,!noCSS);
    };
    this.MoveElements = function (FromElement, ToElement) {
      if (FromElement && ToElement) {
        while (FromElement.childNodes.length) { ToElement.appendChild(FromElement.firstChild); }
      };
    };
    this.MoveElementsAndFree = function (FromElement, ToElement) {
      if (FromElement && ToElement){
        while (FromElement.childNodes.length) { ToElement.appendChild(FromElement.firstChild); }
        FromElement.remove();
      };
    };
    this.CreateWithID = function (AID) {
      var el = null;
      this.ClearMethodPointers();
      this.FUpdateCount = 0;
      this.FControlCreated = false;
      this.FLinkTouchEvents = true;
      this.FIsResizing = false;
      if (((this.FOwner != null) && (pas.Classes.TComponentStateItem.csLoading in this.FOwner.FComponentState)) || !(this.FOwner != null)) {
        if (!((this.FOwner != null) && (pas.Classes.TComponentStateItem.csDesigning in this.FOwner.FComponentState))) this.Loading();
      };
      this.FElementPosition = $mod.TElementPosition.epAbsolute;
      this.FWidthStyle = $mod.TSizeStyle.ssAbsolute;
      this.FHeightStyle = $mod.TSizeStyle.ssAbsolute;
      el = document.getElementById(AID);
      this.FNew = !(el != null);
      this.FFont = pas["WEBLib.Graphics"].TFont.$create("Create$1");
      this.FFont.FOnChange = rtl.createCallback(this,"HandleFontChanged");
      if (this.FNew) {
        this.FContainer = null;
      } else {
        this.FContainer = el;
        this.FControlCreated = true;
        this.FElementPosition = $mod.TElementPosition.epRelative;
        this.CreateChildElements(el);
        this.BindElement();
        this.BindEvents();
      };
      this.FID = AID;
      this.FEnabled = true;
      this.FVisible = true;
      this.FLeft = 0;
      this.FTop = 0;
      this.FAlign = $mod.TAlign.alNone;
      this.FAlignWithMargins = false;
      this.FIsAligning = false;
      this.FParentFont = true;
      this.FParentBiDiMode = true;
      this.FParentColor = false;
      this.FAnchors = rtl.createSet($mod.TAnchorKind.akLeft,$mod.TAnchorKind.akTop);
      this.FShowFocus = false;
      this.FBorderWidth = 0;
      this.FEnablePropagation = false;
      this.FToolTip = null;
      this.FColor = 16711422;
      this.FMargins = $mod.TMargins.$create("Create$1");
      this.FMargins.FOnChange = rtl.createCallback(this,"DoMarginsChanged");
      this.FCenter = $mod.TCenter.$create("Create");
      this.FCenter.FOnChange = rtl.createCallback(this,"DoCenterChanged");
      this.FParent = null;
      this.FPrevParent = null;
      if (!($mod.TControlStyleValue.csAcceptsControls in this.FControlStyle)) this.ClearControls();
      this.CreateInitialize();
    };
    this.AddInstanceStyle = function (css) {
      var cssname = "";
      cssname = this.FName + "_style";
      this.$class.AddInstanceStyle$1(cssname,css);
    };
    this.AddInstanceStyle$1 = function (id, css) {
      function writeStylesOnce(styleName, cssText) {
          var styleElement = document.getElementById(styleName);
          if (styleElement) {
            styleElement.innerHTML = cssText;
            return;
            }
          styleElement = document.createElement('style');
          styleElement.type = 'text/css';
          styleElement.id = styleName;
          styleElement.innerHTML = cssText;
          document.getElementsByTagName('head')[0].appendChild(styleElement);
      }
      writeStylesOnce(id,css);
    };
    this.AddControlStyle = function (css) {
      var cssname = "";
      cssname = this.$classname;
      function writeStylesOnce(styleName, cssText) {
          var styleElement = document.getElementById(styleName);
          if (styleElement) {
               styleElement.innerHTML = cssText;
            return;
            }
          styleElement = document.createElement('style');
          styleElement.type = 'text/css';
          styleElement.id = styleName;
          styleElement.innerHTML = cssText;
          document.getElementsByTagName('head')[0].appendChild(styleElement);
      }
      writeStylesOnce(cssname,css);
    };
    this.AddControlLink = function (linkid, link) {
      function writeLinkOnce(linkName, linkText) {
          var linkElement = document.getElementById(linkName);
          if (linkElement)
            return;
          linkElement = document.createElement('link');
          linkElement.id = linkName;
          linkElement.setAttribute('rel', 'stylesheet');
          linkElement.setAttribute('type', 'text/css');
          linkElement.setAttribute('href', linkText);
          document.getElementsByTagName('head')[0].appendChild(linkElement);
      }
      writeLinkOnce(linkid,link);
    };
    this.AddControlScriptLink = function (link) {
      var id = "";
      var script = null;
      id = this.$classname;
      if (!(document.getElementById(id) != null)) {
        script = document.createElement("script");
        script.id = id;
        script.src = link;
        script.type = "text/javascript";
        document.head.appendChild(script);
      };
    };
    this.AddControlScriptSource = function (source) {
      var id = "";
      var script = null;
      id = this.$classname + "SRC";
      if (!(document.getElementById(id) != null)) {
        script = document.createElement("script");
        script.id = id;
        script.innerHTML = source;
        script.type = "text/javascript";
        document.head.appendChild(script);
      };
    };
    this.AddRequiredScripts = function () {
      var Result = false;
      var i = 0;
      var j = 0;
      var el = null;
      var scr = null;
      var found = false;
      var loading = false;
      this.FControlScriptCount = 0;
      for (var $l = 0, $end = this.FRequiredScripts.GetCount() - 1; $l <= $end; $l++) {
        j = $l;
        found = false;
        loading = false;
        for (var $l1 = 0, $end1 = document.head.children.length - 1; $l1 <= $end1; $l1++) {
          i = $l1;
          el = document.head.children.item(i);
          if (el.tagName === "SCRIPT") {
            scr = el;
            if (pas.System.Pos(this.FRequiredScripts.Get(j),scr.src) > 0) {
              found = true;
              if (scr.title === "tmswebloading") {
                loading = true;
                if (!(this.FScriptLoadedPtr != null)) this.FScriptLoadedPtr = rtl.createCallback(this,"RequiredScriptLoaded");
                scr.addEventListener("load",this.FScriptLoadedPtr);
              };
              break;
            };
          };
        };
        if (!found) {
          this.FControlScriptCount += 1;
          this.AddRequiredScript(this.RequiredBaseURL() + this.FRequiredScripts.Get(j));
        };
        if (found && loading) this.FControlScriptCount += 1;
      };
      Result = this.FControlScriptCount > 0;
      return Result;
    };
    this.AddRequiredScript = function (link) {
      var id = "";
      var script = null;
      script = document.createElement("script");
      script.src = link;
      script.type = "text/javascript";
      script.title = "tmswebloading";
      if (!(this.FScriptLoadedPtr != null)) this.FScriptLoadedPtr = rtl.createCallback(this,"RequiredScriptLoaded");
      script.addEventListener("load",this.FScriptLoadedPtr);
      document.head.appendChild(script);
    };
    this.ResetAnchoring = function () {
      this.FOrigRect.$assign(pas.Types.Rect(-1,-1,-1,-1));
      this.InitAnchoring();
    };
    this.UpdateSize = function () {
      var i = 0;
      this.UpdateElementSize();
      for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
        i = $l;
        this.GetControls(i).UpdateSize();
      };
    };
    this.UpdateAnchoring = function () {
      var dxr = 0;
      var dyr = 0;
      var dxo = 0;
      var dyo = 0;
      var dxw = 0;
      var dyw = 0;
      var br = pas.Types.TRect.$new();
      var r = pas.Types.TRect.$new();
      if (pas.Classes.TComponentStateItem.csLoading in this.FComponentState) return;
      if (!this.FControlCreated) return;
      if ((this.FOrigRect.Left === -1) && (this.FOrigRect.Top === -1)) this.InitAnchoring();
      if ((this.FParent != null) && !this.FParent.AnchoringInitialized()) return;
      if (this.FAlign !== $mod.TAlign.alClient) {
        if ((this.FParent != null) && !pas["WEBLib.Forms"].TForm.isPrototypeOf(this)) {
          r.$assign(this.FParent.GetBoundsRect());
          dxr = r.Right - r.Left - (this.FOrigParentRect.Right - this.FOrigParentRect.Left);
          dyr = r.Bottom - r.Top - (this.FOrigParentRect.Bottom - this.FOrigParentRect.Top);
          br.$assign(this.FOrigRect);
          dxo = 0;
          dyo = 0;
          dxw = 0;
          dyw = 0;
          if ($mod.TAnchorKind.akRight in this.FAnchors) {
            if ($mod.TAnchorKind.akLeft in this.FAnchors) {
              dxw = dxr}
             else dxo = dxr;
          };
          if ($mod.TAnchorKind.akBottom in this.FAnchors) {
            if ($mod.TAnchorKind.akTop in this.FAnchors) {
              dyw = dyr}
             else dyo = dyr;
          };
          if (($mod.TAnchorKind.akBottom in this.FAnchors) || ($mod.TAnchorKind.akRight in this.FAnchors)) {
            this.SetBoundsInt(br.Left + dxo,br.Top + dyo,(br.Right - br.Left) + dxw,(br.Bottom - br.Top) + dyw);
          };
        };
      };
      this.UpdateChildAnchoring();
    };
    this.UpdateChildAnchoring = function () {
      var i = 0;
      for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
        i = $l;
        this.GetControls(i).UpdateAnchoring();
      };
    };
    this.SetElementPointer = function (AElement, ACursor) {
      if (ACursor !== 0) {
        AElement.style.setProperty("cursor",$mod.GetHTMLCursorName(ACursor))}
       else AElement.style.removeProperty("cursor");
    };
    this.GetWebClassName = function () {
      var Result = "";
      Result = this.$classname;
      pas.System.Delete({get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }},1,1);
      Result = "TWeb" + Result;
      return Result;
    };
    this.GetCSSManager = function () {
      var Result = null;
      var frm = null;
      var i = 0;
      Result = null;
      frm = pas["WEBLib.Forms"].GetParentForm(this);
      if (frm != null) {
        for (var $l = 0, $end = frm.GetComponentCount() - 1; $l <= $end; $l++) {
          i = $l;
          if ($mod.TCSSCodeManager.isPrototypeOf(frm.GetComponent(i))) {
            Result = rtl.as(frm.GetComponent(i),$mod.TCSSCodeManager);
          };
        };
      };
      return Result;
    };
    this.IsUpdating = function () {
      var Result = false;
      Result = this.FUpdateCount > 0;
      return Result;
    };
    this.CanShowFocus = function () {
      var Result = false;
      Result = this.FShowFocus;
      return Result;
    };
    this.RequiredScriptLoaded = function (Event) {
      rtl.asExt(Event.target,HTMLScriptElement).title = "tmswebloaded";
      this.FControlScriptCountLoaded += 1;
    };
    this.InjectCSS = function () {
      var cssname = "";
      var css = "";
      var cssmgr = null;
      cssname = this.GetWebClassName();
      css = "";
      cssmgr = this.GetCSSManager();
      if (cssmgr != null) css = cssmgr.GetClassCSS(cssname);
      if (css !== "") this.AddControlStyle(css);
    };
    this.StartCapture = function () {
      var eh = null;
      if (!this.FCaptureDown) return;
      if (this.Captured()) this.ReleaseCapture();
      this.FMouseInsideLayer = true;
      this.FLayer = document.createElement("SPAN");
      document.body.appendChild(this.FLayer);
      eh = this.FLayer;
      eh.addEventListener("mouseenter",this.FLayerMouseEnterPtr);
      eh.addEventListener("mouseleave",this.FLayerMouseLeavePtr);
      eh.addEventListener("mousedown",this.FMouseDownPtr);
      eh.addEventListener("mouseup",this.FMouseUpPtr);
      eh.addEventListener("mousemove",this.FMouseMovePtr);
      eh.addEventListener("touchstart",this.FTouchStartPtr);
      eh.addEventListener("touchmove",this.FTouchMovePtr);
      eh.addEventListener("touchend",this.FTouchEndPtr);
      eh.addEventListener("touchcancel",this.FTouchCancelPtr);
      eh.style.setProperty("top","0");
      eh.style.setProperty("left","0");
      eh.style.setProperty("right","0");
      eh.style.setProperty("bottom","0");
      eh.style.setProperty("webkit-user-select","none");
      eh.style.setProperty("moz-user-select","none");
      eh.style.setProperty("khtml-user-select","none");
      eh.style.setProperty("ms-user-select","none");
      eh.style.setProperty("user-select","none");
      eh.style.setProperty("position","absolute");
      eh.style.setProperty($mod.CSSZIndex,"999999");
      this.FCaptured = true;
      this.UpdateElement();
    };
    this.RequiredBaseURL = function () {
      var Result = "";
      Result = "";
      return Result;
    };
    this.GetStyle = function (css) {
      var Result = "";
      var res = "";
      var el = null;
      el = this.GetElementHandle();
      res = "";
      if (!(el != null)) return Result;
      if (window.getComputedStyle) res = getComputedStyle(el, '')[css];
      if(el.currentStyle) res = el.currentStyle[css];
      Result = res;
      return Result;
    };
    this.SetBoundsInt = function (X, Y, AWidth, AHeight) {
      if ((X !== this.GetLeft()) || (Y !== this.GetTop()) || ((AWidth !== this.GetWidth()) && (this.FWidthStyle === $mod.TSizeStyle.ssAbsolute)) || ((AHeight !== this.GetHeight()) && (this.FHeightStyle === $mod.TSizeStyle.ssAbsolute)) || ((this.FParent != null) && this.FParent.GetIsLinked())) {
        this.FBlockUpdateElement = true;
        this.FLeft = X;
        this.FTop = Y;
        this.FWidth = AWidth;
        this.FHeight = AHeight;
        this.FBlockUpdateElement = false;
        this.UpdateElementSize();
        if (this.FAlign !== $mod.TAlign.alNone) {
          this.DoRealign()}
         else this.Realign();
        this.RecreateCanvas();
        this.DoBoundsChange();
        this.Invalidate();
        this.UpdateChildAnchoring();
      };
    };
    this.MoveFirst = function (AControl) {
      var i = 0;
      var fnd = false;
      fnd = false;
      for (var $l = this.GetControlsCount() - 1; $l >= 0; $l--) {
        i = $l;
        if (this.FControls[i] === AControl) fnd = true;
        if (fnd) {
          if (i > 0) {
            this.FControls[i] = this.FControls[i - 1]}
           else this.FControls[i] = AControl;
        };
      };
    };
    this.MoveLast = function (AControl) {
      var i = 0;
      var fnd = false;
      fnd = false;
      for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.FControls[i] === AControl) fnd = true;
        if (fnd) {
          if (i < (this.GetControlsCount() - 1)) {
            this.FControls[i] = this.FControls[i + 1]}
           else this.FControls[i] = AControl;
        };
      };
    };
    this.EnableDrag = function () {
      if (this.GetContainer() != null) this.GetContainer().setAttribute("draggable","true");
    };
    this.DisableDrag = function () {
      if ((this.GetContainer() != null) && (this.GetContainer().getAttribute("draggable") === "true")) this.GetContainer().setAttribute("draggable","false");
    };
    this.Create$2 = function (ID) {
      this.FGotFocus = false;
      this.FTabStop = true;
      this.FAllowTouch = true;
      this.CreateWithID(ID);
      return this;
    };
    this.Create$1 = function (AOwner) {
      var lName = "";
      var frm = null;
      var lDesign = false;
      this.FGotFocus = false;
      this.FEventsBound = false;
      this.FTabStop = true;
      this.FAllowTouch = true;
      this.FNoUserSelect = true;
      this.ClearMethodPointers();
      pas.Classes.TComponent.Create$1.call(this,AOwner);
      this.FEventStopPropagation = rtl.createSet($mod.TElementEvent.eeClick,$mod.TElementEvent.eeDblClick,$mod.TElementEvent.eeMouseUp,$mod.TElementEvent.eeMouseMove,$mod.TElementEvent.eeMouseDown,$mod.TElementEvent.eeKeyPress,$mod.TElementEvent.eeKeyDown,$mod.TElementEvent.eeKeyUp,$mod.TElementEvent.eeTouchMove,$mod.TElementEvent.eeTouchStart,$mod.TElementEvent.eeTouchEnd);
      this.FScriptLoaded = false;
      this.FElementFont = $mod.TElementFont.efProperty;
      this.FElementPosition = $mod.TElementPosition.epAbsolute;
      this.FParentElement = null;
      this.FTextDirection = $mod.TTextDirection.tdDefault;
      lDesign = false;
      frm = pas["WEBLib.Forms"].GetParentForm(this);
      if (frm != null) {
        lDesign = pas.Classes.TComponentStateItem.csDesigning in frm.FComponentState;
      };
      lName = this.GetNewName();
      if (lDesign) {
        this.CreateWithID("")}
       else this.CreateWithID(lName);
      if ((AOwner != null) && !(pas.Classes.TComponentStateItem.csDesigning in AOwner.FComponentState)) this.SetName(lName);
      return this;
    };
    this.Destroy = function () {
      this.UnbindEvents();
      this.DestroyControls();
      if ((this.GetContainer() != null) && (this.FParent != null) && (this.FParent.GetChildContainer() != null)) {
        if (this.FParent.GetChildContainer() === this.GetContainer().parentNode) {
          this.FParent.GetChildContainer().removeChild(this.GetContainer());
        };
        this.FContainer = null;
        this.SetParent(null);
        this.FControlCreated = false;
      };
      rtl.free(this,"FRequiredScripts");
      rtl.free(this,"FMargins");
      rtl.free(this,"FCenter");
      rtl.free(this,"FFont");
      if (pas.System.Assigned(this.FToolTip)) {
        this.FToolTip.dispose();
        this.FToolTip = null;
      };
      pas.Classes.TComponent.Destroy.call(this);
    };
    this.Release = function () {
      var $Self = this;
      function Free$1() {
        $Self.$destroy("Destroy");
      };
      window.setTimeout(rtl.createSafeCallback(null,Free$1),150);
    };
    this.Assign = function (Source) {
    };
    this.DragDrop = function (Source, X, Y) {
      if (this.FOnDragDrop != null) this.FOnDragDrop(this,Source,X,Y);
    };
    this.Resize = function () {
      if (this.FOnResize != null) this.FOnResize(this);
    };
    this.Capture = function () {
      this.FCaptureDown = true;
      window.setTimeout(rtl.createSafeCallback(this,"StartCapture"),100);
    };
    this.ApplyName = function () {
      var s = "";
      var prefix = "";
      var frm = null;
      s = this.$classname;
      pas.System.Delete({get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},1,1);
      prefix = "";
      frm = pas["WEBLib.Forms"].GetParentForm(this);
      if (frm != null) prefix = frm.$classname;
      this.SetID(prefix + "_" + $mod.FindUniqueName(s));
    };
    this.ReleaseCapture = function () {
      var eh = null;
      this.FCaptureDown = false;
      if (this.FCaptured && (this.FLayer != null)) {
        eh = this.FLayer;
        eh.removeEventListener("mouseenter",this.FLayerMouseEnterPtr);
        eh.removeEventListener("mouseleave",this.FLayerMouseLeavePtr);
        eh.removeEventListener("mousedown",this.FMouseDownPtr);
        eh.removeEventListener("mouseup",this.FMouseUpPtr);
        eh.removeEventListener("mousemove",this.FMouseMovePtr);
        eh.removeEventListener("touchstart",this.FTouchStartPtr);
        eh.removeEventListener("touchmove",this.FTouchMovePtr);
        eh.removeEventListener("touchend",this.FTouchEndPtr);
        eh.removeEventListener("touchcancel",this.FTouchEndPtr);
        document.body.removeChild(eh);
        this.FCaptured = false;
        this.FLayer = null;
        this.UpdateElement();
      };
    };
    this.BringToFront = function () {
      if ((this.GetElementHandle() != null) && (this.GetElementHandle().parentElement != null)) {
        try {
          this.GetElementHandle().parentElement.appendChild(this.GetElementHandle());
          if (this.FParent != null) this.FParent.MoveLast(this);
        } catch ($e) {
        };
      };
    };
    this.SendToBack = function () {
      if ((this.GetElementHandle() != null) && (this.GetElementHandle().parentElement != null)) {
        this.GetElementHandle().parentElement.insertBefore(this.GetElementHandle(),this.GetElementHandle().parentElement.firstElementChild);
        if (this.FParent != null) this.FParent.MoveFirst(this);
      };
    };
    this.Show = function () {
      this.SetVisible(true);
    };
    this.Hide = function () {
      this.SetVisible(false);
    };
    this.PreventDefault = function () {
      if (this.GetElementEvent() != null) this.GetElementEvent().preventDefault();
    };
    this.StopPropagation = function () {
      if ((this.GetElementEvent() != null) && !this.FEnablePropagation) this.GetElementEvent().stopPropagation();
    };
    this.BeginDrag = function () {
      this.EnableDrag();
    };
    this.BeginUpdate = function () {
      this.FUpdateCount += 1;
    };
    this.EndUpdate = function () {
      if (this.FUpdateCount > 0) {
        this.FUpdateCount -= 1;
        if (this.FUpdateCount === 0) this.UpdateElement();
      };
    };
    this.Invalidate = function () {
    };
    this.SetParentComponent = function (Value) {
      if ((this.FParent !== Value) && $mod.TControl.isPrototypeOf(Value)) this.SetParent(Value);
    };
    this.SetBounds = function (X, Y, AWidth, AHeight) {
      this.SetBoundsInt(X,Y,AWidth,AHeight);
      this.FWidth = AWidth;
      this.FHeight = AHeight;
      if (!this.FUpdateTopLeft) {
        this.FOrigTop = Y;
        this.FOrigLeft = X;
      };
      this.ResetAnchoring();
      if (!(pas.Classes.TComponentStateItem.csLoading in this.FComponentState) && (this.FAlign !== $mod.TAlign.alNone) && (this.FParent != null)) {
        this.DoRealign();
      };
    };
    this.XYToClient = function (X, Y, AClientX, AClientY) {
      var p = null;
      var cr = null;
      var el = null;
      var OrigX = 0.0;
      var OrigY = 0.0;
      var norel = false;
      var formcont = false;
      var r = pas.Types.TRect.$new();
      var cs = null;
      var csx = 0;
      var csy = 0;
      var scrollx = 0;
      var scrolly = 0;
      norel = true;
      formcont = false;
      scrollx = 0;
      scrolly = 0;
      if (this.FElementPosition === $mod.TElementPosition.epAbsolute) {
        scrollx = document.body.scrollLeft + document.documentElement.scrollLeft;
        scrolly = document.body.scrollTop + document.documentElement.scrollTop;
        OrigX = X - this.GetLeft();
        OrigY = Y - this.GetTop();
      } else {
        norel = false;
        cr = this.GetElementHandle().getBoundingClientRect();
        OrigX = X - cr.left;
        OrigY = Y - cr.top;
        AClientX.set(OrigX);
        AClientY.set(OrigY);
        return;
      };
      AClientX.set(OrigX);
      AClientY.set(OrigY);
      p = this.FParent;
      if (pas["WEBLib.Forms"].TCustomForm.isPrototypeOf(this) && !(p != null) && (this.GetContainer() != null)) {
        cr = this.GetContainer().getBoundingClientRect();
        AClientX.set(AClientX.get() - cr.left);
        AClientY.set(AClientY.get() - cr.top);
      };
      while (p != null) {
        if (p.GetIsLinked()) {
          if (pas["WEBLib.Forms"].TCustomForm.isPrototypeOf(p)) {
            cr = p.GetContainer().getBoundingClientRect();
          } else {
            cr = p.GetElementHandle().getBoundingClientRect();
          };
          AClientX.set(AClientX.get() - cr.left);
          AClientY.set(AClientY.get() - cr.top);
          AClientX.set(AClientX.get() + p.GetElementHandle().scrollLeft);
          AClientY.set(AClientY.get() + p.GetElementHandle().scrollTop);
          scrollx = 0;
          scrolly = 0;
          break;
        } else if (pas["WEBLib.Forms"].TCustomForm.isPrototypeOf(p)) {
          if (rtl.as(p,pas["WEBLib.Forms"].TCustomForm).FFormContainer !== "") {
            el = document.getElementById(rtl.as(p,pas["WEBLib.Forms"].TCustomForm).FFormContainer);
            if (el != null) {
              formcont = true;
              cr = el.getBoundingClientRect();
              AClientX.set(AClientX.get() - cr.left);
              AClientY.set(AClientY.get() - cr.top);
            };
          };
          if ((rtl.as(p,pas["WEBLib.Forms"].TCustomForm).GetContainer() != null) && (rtl.as(p,pas["WEBLib.Forms"].TCustomForm).FFormContainer === "") && rtl.as(p,pas["WEBLib.Forms"].TCustomForm).FPopup) {
            cr = rtl.as(p,pas["WEBLib.Forms"].TCustomForm).GetContainer().getBoundingClientRect();
            AClientX.set(AClientX.get() - cr.left);
            AClientY.set(AClientY.get() - cr.top);
            r.$assign(rtl.as(p,pas["WEBLib.Forms"].TCustomForm).GetClientRect());
            AClientY.set(AClientY.get() + r.Top);
            scrollx = 0;
            scrolly = 0;
          };
        } else if (p.FElementPosition in rtl.createSet($mod.TElementPosition.epRelative,$mod.TElementPosition.epIgnore)) {
          if (p.GetElementHandle() != null) {
            cr = p.GetElementHandle().getBoundingClientRect();
            AClientX.set(OrigX - cr.left);
            AClientY.set(OrigY - cr.top);
            scrollx = 0;
            scrolly = 0;
            if (norel) {
              cs = window.getComputedStyle(document.documentElement);
              csx = parseInt(cs.marginLeft,10);
              csy = parseInt(cs.marginTop,10);
              AClientX.set(AClientX.get() + csx);
              AClientY.set(AClientY.get() + csy);
            };
            norel = false;
            break;
          };
        } else if ((p.FElementPosition === $mod.TElementPosition.epAbsolute) && norel) {
          AClientX.set(AClientX.get() - p.GetLeft());
          AClientY.set(AClientY.get() - p.GetTop());
          if (p.GetElementHandle() != null) {
            AClientX.set(AClientX.get() + p.GetElementHandle().scrollLeft);
            AClientY.set(AClientY.get() + p.GetElementHandle().scrollTop);
          };
          OrigX = AClientX.get();
          OrigY = AClientY.get();
        };
        p = p.FParent;
      };
      if ((this.FElementPosition === $mod.TElementPosition.epAbsolute) && !formcont) {
        AClientX.set(AClientX.get() + scrollx);
        AClientY.set(AClientY.get() + scrolly);
      };
    };
    this.ClientToXY = function (AClientX, AClientY, X, Y) {
      var p = null;
      var cr = null;
      X.set((AClientX + this.GetLeft()) - document.body.scrollLeft - document.documentElement.scrollLeft);
      Y.set((AClientY + this.GetTop()) - document.body.scrollTop - document.documentElement.scrollTop);
      p = this.FParent;
      while (p != null) {
        if (p.GetIsLinked()) {
          if (pas["WEBLib.Forms"].TCustomForm.isPrototypeOf(p)) {
            cr = p.GetContainer().getBoundingClientRect()}
           else cr = p.GetElementHandle().getBoundingClientRect();
          X.set(X.get() + cr.left);
          Y.set(Y.get() + cr.top);
        };
        if (pas["WEBLib.Forms"].TCustomForm.isPrototypeOf(p)) {
          if ((rtl.as(p,pas["WEBLib.Forms"].TCustomForm).GetContainer() != null) && (rtl.as(p,pas["WEBLib.Forms"].TCustomForm).FFormContainer === "") && (rtl.as(p,pas["WEBLib.Forms"].TCustomForm).FFormFileName !== "") && rtl.as(p,pas["WEBLib.Forms"].TCustomForm).FPopup) {
            cr = rtl.as(p,pas["WEBLib.Forms"].TCustomForm).GetContainer().getBoundingClientRect();
            X.set(X.get() + cr.left);
            Y.set(Y.get() + cr.top);
          };
        };
        if (p.FElementPosition === $mod.TElementPosition.epAbsolute) {
          X.set(X.get() + p.GetLeft());
          Y.set(Y.get() + p.GetTop());
        };
        p = p.FParent;
      };
    };
    this.GetChildren = function (Proc, Root) {
      var I = 0;
      var Control = null;
      for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
        I = $l;
        Control = this.GetControls(I);
        if ((Control.FOwner === Root) || (Root === null)) Proc(Control);
      };
    };
    this.Captured = function () {
      var Result = false;
      Result = this.FCaptured && (this.FLayer != null);
      return Result;
    };
    this.MakeScreenshot = function () {
      var Result = null;
      Result = null;
      return Result;
    };
    this.ClientToScreen = function (Point) {
      var Result = pas.Types.TPoint.$new();
      var Origin = pas.Types.TPoint.$new();
      Origin.$assign(this.GetClientOrigin());
      Result.x = Point.x + Origin.x;
      Result.y = Point.y + Origin.y;
      return Result;
    };
    this.ScreenToClient = function (Point) {
      var Result = pas.Types.TPoint.$new();
      var Origin = pas.Types.TPoint.$new();
      Origin.$assign(this.GetClientOrigin());
      Result.x = Point.x - Origin.x;
      Result.y = Point.y - Origin.y;
      return Result;
    };
    this.CanFocus = function () {
      var Result = false;
      Result = true;
      return Result;
    };
    this.HasHorzScrollBar = function () {
      var Result = false;
      Result = false;
      if (this.GetElementHandle() != null) Result = this.GetElementHandle().clientWidth < this.GetElementHandle().scrollWidth;
      return Result;
    };
    this.HasVertScrollBar = function () {
      var Result = false;
      Result = false;
      if (this.GetElementHandle() != null) Result = this.GetElementHandle().clientHeight < this.GetElementHandle().scrollHeight;
      return Result;
    };
    rtl.addIntf(this,$mod.IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $mod.$rtti.$DynArray("TControl.FControls$a",{eltype: $r});
  });
  this.TScrollBarKind = {"0": "sbHorizontal", sbHorizontal: 0, "1": "sbVertical", sbVertical: 1};
  this.$rtti.$Enum("TScrollBarKind",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TScrollBarKind});
  rtl.createClass(this,"TControlScrollBar",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FKind = 0;
      this.FControl = null;
    };
    this.$final = function () {
      this.FControl = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.Create$1 = function (AControl, AKind) {
      this.FControl = AControl;
      this.FKind = AKind;
      return this;
    };
    this.IsScrollBarVisible = function () {
      var Result = false;
      Result = false;
      if (this.FControl.GetElementHandle() != null) {
        if (this.FKind === $mod.TScrollBarKind.sbVertical) {
          Result = this.FControl.GetElementHandle().scrollHeight > this.FControl.GetElementHandle().clientHeight}
         else Result = this.FControl.GetElementHandle().scrollWidth > this.FControl.GetElementHandle().clientWidth;
      };
      return Result;
    };
    this.ScrollPos = function () {
      var Result = 0;
      Result = 0;
      if (this.FControl.GetElementHandle() != null) {
        if (this.FKind === $mod.TScrollBarKind.sbVertical) {
          Result = this.FControl.GetElementHandle().scrollTop}
         else Result = this.FControl.GetElementHandle().scrollLeft;
      };
      return Result;
    };
    this.Range = function () {
      var Result = 0;
      Result = 0;
      if (this.FControl.GetElementHandle() != null) {
        if (this.FKind === $mod.TScrollBarKind.sbVertical) {
          Result = this.FControl.GetElementHandle().scrollHeight}
         else Result = this.FControl.GetElementHandle().scrollWidth;
      };
      return Result;
    };
  });
  this.$rtti.$Class("TWinControl");
  this.$rtti.$ClassRef("TWinControlClass",{instancetype: this.$rtti["TWinControl"]});
  rtl.createClass(this,"TWinControl",this.TControl,function () {
    rtl.addIntf(this,$mod.IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Cursor",2,$mod.$rtti["TCursor"],"FCursor","SetControlCursor",4,{Default: 0});
    $r.addProperty("ElementClassName",2,$mod.$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("Hint",2,rtl.string,"FHint","SetHint");
    $r.addProperty("Left",3,rtl.longint,"GetLeft","SetLeft");
    $r.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",4,{Default: false});
    $r.addProperty("Tag",0,rtl.longint,"FTag$1","FTag$1",4,{Default: 0});
    $r.addProperty("Top",3,rtl.longint,"GetTop","SetTop");
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("OnMouseDown",0,$mod.$rtti["TMouseEvent"],"FOnMouseDown","FOnMouseDown");
    $r.addProperty("OnMouseUp",0,$mod.$rtti["TMouseEvent"],"FOnMouseUp","FOnMouseUp");
    $r.addProperty("OnMouseMove",0,$mod.$rtti["TMouseMoveEvent"],"FOnMouseMove","FOnMouseMove");
    $r.addProperty("OnMouseEnter",0,$mod.$rtti["TNotifyEvent"],"FOnMouseEnter","FOnMouseEnter");
    $r.addProperty("OnMouseLeave",0,$mod.$rtti["TNotifyEvent"],"FOnMouseLeave","FOnMouseLeave");
    $r.addProperty("OnKeyUp",0,$mod.$rtti["TKeyEvent"],"FOnKeyUp","FOnKeyUp");
    $r.addProperty("OnKeyDown",0,$mod.$rtti["TKeyEvent"],"FOnKeyDown","FOnKeyDown");
    $r.addProperty("OnKeyPress",0,$mod.$rtti["TKeyPressEvent"],"FOnKeyPress","FOnKeyPress");
    $r.addProperty("OnEnter",0,$mod.$rtti["TNotifyEvent"],"FOnEnter","FOnEnter");
    $r.addProperty("OnExit",0,$mod.$rtti["TNotifyEvent"],"FOnExit","FOnExit");
  });
  this.$rtti.$Class("TCustomControl");
  this.$rtti.$ClassRef("TCustomControlClass",{instancetype: this.$rtti["TCustomControl"]});
  rtl.createClass(this,"TCustomControl",this.TWinControl,function () {
    this.$init = function () {
      $mod.TWinControl.$init.call(this);
      this.FCaption = "";
      this.FPixelRatio = 0.0;
      this.FPainting = false;
      this.FCanvas = null;
      this.FElementCanvas = null;
      this.FBorderStyle = 0;
      this.FBorderColor = 0;
      this.FCustomBorder = false;
      this.FOnScreenShot = null;
      this.FBevelOuter = 0;
      this.FBevelWidth = 0;
      this.FBevelCut = 0;
      this.FBevelEdges = {};
      this.FBevelKind = 0;
    };
    this.$final = function () {
      this.FCanvas = undefined;
      this.FElementCanvas = undefined;
      this.FOnScreenShot = undefined;
      this.FBevelEdges = undefined;
      $mod.TWinControl.$final.call(this);
    };
    this.GetCanvas = function () {
      var Result = null;
      if (!(this.FCanvas != null)) {
        if (!this.GetIsLinked()) {
          this.CreateControl()}
         else {
          if (!(this.FElementCanvas != null)) this.FElementCanvas = document.getElementById(this.GetID());
          this.RecreateCanvas();
        };
      };
      Result = this.FCanvas;
      return Result;
    };
    this.RenderDesigning = function (ACaption, AElement, AControl, ADisplay, AImage) {
      var LContainer = null;
      var LLabel = null;
      var LDiv = null;
      var LHasLabel = false;
      LContainer = AElement;
      LLabel = LContainer.firstChild;
      LHasLabel = (LLabel != null) && (LLabel.tagName === "DIV") && (LLabel.getAttribute("data-design") === "1");
      if ((pas.Classes.TComponentStateItem.csDesigning in AControl.FComponentState) && ADisplay && (this.FElementClassName === "")) {
        LContainer.style.setProperty("border","1px solid gray");
        if (AImage === "") {
          LContainer.style.setProperty("background-color","#F0F0F0")}
         else LContainer.style.setProperty("background-color","white");
        if (LHasLabel) return;
        LContainer.innerHTML = "";
        if (AImage !== "") {
          LDiv = document.createElement("DIV");
          LDiv.style.setProperty("background-color","white");
          LDiv.style.setProperty("background-repeat","no-repeat");
          LDiv.style.setProperty("background-position-y","center");
          LDiv.style.setProperty("background-image","url(" + AImage + ")");
          LDiv.style.setProperty("background-position-x","center");
          LDiv.style.setProperty("background-size","128px");
          LDiv.style.setProperty("top","50%");
          LDiv.style.setProperty("left","50%");
          LDiv.style.setProperty("height","70%");
          LContainer.appendChild(LDiv);
        };
        LLabel = document.createElement("DIV");
        LLabel.setAttribute("data-design","1");
        LLabel.innerHTML = ACaption;
        LLabel.style.setProperty("position","relative");
        LLabel.style.setProperty("top","50%");
        LLabel.style.setProperty("left","50%");
        LLabel.style.setProperty("display","inline-block");
        LLabel.style.setProperty("transform","translateX(-50%)");
        this.FCustomBorder = true;
        LContainer.appendChild(LLabel);
      } else {
        if (LHasLabel) {
          while (LContainer.firstChild != null) LContainer.removeChild(LContainer.firstChild);
          LContainer.style.removeProperty("border");
          LContainer.style.removeProperty("background-color");
        };
      };
    };
    this.GetPixelRatio = function () {
      var Result = 0.0;
      var res = 0.0;
      var ctx = document.createElement("canvas").getContext("2d"),
          dpr = window.devicePixelRatio || 1,
          bsr = ctx.webkitBackingStorePixelRatio ||
                ctx.mozBackingStorePixelRatio ||
                ctx.msBackingStorePixelRatio ||
                ctx.oBackingStorePixelRatio ||
                ctx.backingStorePixelRatio || 1;
      res = dpr / bsr;
      Result = res;
      return Result;
    };
    this.GetContext = function () {
      var Result = null;
      var ctx = null;
      ctx = this.FElementCanvas.getContext("2d");
      Result = ctx;
      return Result;
    };
    this.RecreateCanvas = function () {
      var px = 0.0;
      var el = null;
      var h = 0;
      var w = 0;
      if (this.FElementCanvas != null) {
        if (!this.FPainting) {
          if (this.GetIsLinked()) {
            el = this.GetElementHandle();
          } else el = document.getElementById(this.GetID() + "_Canvas");
          if (el != null) {
            this.FElementCanvas = el;
            rtl.free(this,"FCanvas");
            this.FCanvas = null;
          };
          px = this.GetPixelRatio();
          h = Math.min(16383,this.GetHeight() - this.GetCanvasHeightOffset());
          w = Math.min(16383,this.GetWidth() - this.GetCanvasWidthOffset());
          if (this.FElementPosition === $mod.TElementPosition.epRelative) {
            this.FElementCanvas.style.setProperty("position","relative")}
           else this.FElementCanvas.style.setProperty("position","absolute");
          this.FElementCanvas.style.setProperty("height",pas.SysUtils.IntToStr(h) + "px");
          this.FElementCanvas.style.setProperty("width",pas.SysUtils.IntToStr(w) + "px");
          this.FElementCanvas.height = Math.round(h * px);
          this.FElementCanvas.width = Math.round(w * px);
        };
        if (!(this.FCanvas != null)) {
          this.FCanvas = pas["WEBLib.Graphics"].TCanvas.$create("Create$1",[this.FElementCanvas]);
        };
        this.FCanvas.FApplyPixelRatio = true;
        this.FCanvas.SetTransform(1,0,0,1,0,0);
      };
    };
    this.SetBorderStyle = function (AValue) {
      if (this.FBorderStyle !== AValue) {
        this.FBorderStyle = AValue;
        this.UpdateElement();
      };
    };
    this.SetBorderColor = function (AValue) {
      if (this.FBorderColor !== AValue) {
        this.FBorderColor = AValue;
        this.UpdateElement();
      };
    };
    this.SetName = function (NewName) {
      var cs = {};
      var ownername = "";
      ownername = "";
      if (!((pas["WEBLib.Forms"].VSIDE != null) && (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState))) {
        if (pas["WEBLib.Forms"].TFrame.isPrototypeOf(this)) {
          ownername = "F" + $mod.FindUniqueName(this.FName) + "_";
        };
      };
      pas.Classes.TComponent.SetName.call(this,ownername + NewName);
      if (($mod.TControlStyleValue.csSetCaption in this.FControlStyle) && (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) && !(pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) {
        if ((this.FOwner != null) && (pas.Classes.TComponentStateItem.csLoading in this.FOwner.FComponentState)) return;
        cs = rtl.refSet(this.FControlStyle);
        this.SetCaption(NewName);
        this.FControlStyle = rtl.refSet(cs);
      };
    };
    this.SetCaption = function (AValue) {
      this.FCaption = AValue;
      this.FControlStyle = rtl.diffSet(this.FControlStyle,rtl.createSet($mod.TControlStyleValue.csSetCaption));
    };
    this.CreateControl = function () {
      $mod.TControl.CreateControl.call(this);
      this.RecreateCanvas();
    };
    this.Loaded = function () {
      $mod.TControl.Loaded.call(this);
      this.Invalidate();
    };
    this.UpdateElementVisual = function () {
      $mod.TControl.UpdateElementVisual.call(this);
      if (this.GetElementHandle() != null) {
        if (!this.GetIsLinked() && (this.FElementClassName === "")) {
          if (this.FBorderStyle === $mod.TBorderStyle.bsSingle) {
            if (this.FCustomBorder) {
              this.GetElementStyle().setProperty("border-style","solid");
              this.GetElementStyle().setProperty("border-width","1px");
              this.GetElementStyle().setProperty("border-color",pas["WEBLib.Graphics"].ColorToHTML(this.FBorderColor));
            } else this.GetElementStyle().setProperty("border-style","");
          } else {
            this.GetElementStyle().setProperty("border-style","none");
          };
        };
        if (this.FElementClassName !== "") {
          this.GetElementStyle().removeProperty("border-style");
          this.GetElementStyle().removeProperty("border-width");
          this.GetElementStyle().removeProperty("border-color");
        };
      };
    };
    this.CreateElement = function () {
      var Result = null;
      this.FElementCanvas = document.createElement("CANVAS");
      if ($mod.TControlStyleValue.csAcceptsControls in this.FControlStyle) {
        Result = document.createElement("SPAN");
        Result.appendChild(this.FElementCanvas);
        if (this.GetID() !== "") this.FElementCanvas.setAttribute("id",this.GetID() + "_Canvas");
        this.FElementCanvas.setAttribute("zindex","-1");
      } else Result = this.FElementCanvas;
      return Result;
    };
    this.GetCanvasHeightOffset = function () {
      var Result = 0;
      Result = 0;
      return Result;
    };
    this.GetCanvasWidthOffset = function () {
      var Result = 0;
      Result = 0;
      return Result;
    };
    this.BindElement = function () {
      if ((this.GetContainer().tagName !== "CANVAS") && !this.FControlCreated) {
        this.FElementCanvas = document.createElement("CANVAS");
        this.GetContainer().appendChild(this.FElementCanvas);
      };
    };
    this.BindEvents = function () {
      $mod.TControl.BindEvents.call(this);
    };
    this.HandleScreenShot = function (Sender) {
      if (this.FOnScreenShot != null) this.FOnScreenShot(this,Sender);
    };
    this.Paint = function () {
    };
    this.CreateInitialize = function () {
      $mod.TControl.CreateInitialize.call(this);
      this.FControlStyle = rtl.unionSet(this.FControlStyle,rtl.createSet($mod.TControlStyleValue.csSetCaption));
      this.FBorderStyle = $mod.TBorderStyle.bsSingle;
      this.FBorderColor = 12632256;
      this.FPainting = false;
      this.FWidth = 100;
      this.FHeight = 25;
      this.FWidthPercent = 100;
      this.FHeightPercent = 100;
      this.FCustomBorder = false;
    };
    this.Destroy = function () {
      if (this.FCanvas != null) rtl.free(this,"FCanvas");
      $mod.TControl.Destroy.call(this);
    };
    this.MakeScreenshot = function () {
      var Result = null;
      Result = pas["WEBLib.Graphics"].TBitmap.$create("Create$3");
      Result.FOnChange = rtl.createCallback(this,"HandleScreenShot");
      Result.LoadFromCanvas(this.GetCanvas());
      return Result;
    };
    this.Resize = function () {
      $mod.TControl.Resize.call(this);
      this.Invalidate();
    };
    this.Invalidate = function () {
      var px = 0.0;
      var frm = null;
      $mod.TControl.Invalidate.call(this);
      if ((this.FParent === null) || (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState)) return;
      if (!this.FVisible) return;
      if (this.FUpdateCount > 0) return;
      frm = pas["WEBLib.Forms"].GetParentForm(this);
      if (frm != null) if (frm.IsUpdating()) return;
      px = this.GetPixelRatio();
      if (px !== this.FPixelRatio) this.RecreateCanvas();
      this.FPixelRatio = this.GetPixelRatio();
      this.FPainting = true;
      if (this.FCanvas != null) this.FCanvas.Clear();
      this.Paint();
      this.FPainting = false;
    };
    this.SetFocus = function () {
      $mod.TControl.SetFocus.call(this);
    };
    this.Focused = function () {
      var Result = false;
      Result = $mod.TControl.Focused.call(this);
      return Result;
    };
    this.EndUpdate = function () {
      $mod.TControl.EndUpdate.call(this);
      if (this.FUpdateCount === 0) this.Invalidate();
    };
    rtl.addIntf(this,$mod.IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TjQueryCustomControl",this.TWinControl,function () {
    this.$init = function () {
      $mod.TWinControl.$init.call(this);
      this.FIsInitialized = false;
    };
    this.InitJQueryOnce = function () {
      if (this.IsUpdating()) return;
      if (this.FIsInitialized) return;
      this.FIsInitialized = true;
      this.InitJQuery();
    };
    this.CreateElement = function () {
      var Result = null;
      Result = document.createElement("DIV");
      return Result;
    };
    this.Loaded = function () {
      $mod.TControl.Loaded.call(this);
      this.InitJQueryOnce();
    };
    this.SetParent = function (AValue) {
      $mod.TControl.SetParent.apply(this,arguments);
      this.InitJQueryOnce();
    };
    this.GetJQID = function () {
      var Result = "";
      Result = "#" + this.GetID();
      return Result;
    };
    this.InitJQuery = function () {
    };
    this.CreateInitialize = function () {
      $mod.TControl.CreateInitialize.call(this);
      this.FIsInitialized = false;
    };
    rtl.addIntf(this,$mod.IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("ElementPosition",2,$mod.$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: $mod.TElementPosition.epAbsolute});
  });
  rtl.createClass(this,"TGraphicControl",this.TCustomControl,function () {
    rtl.addIntf(this,$mod.IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TScrollingGraphicControl",this.TCustomControl,function () {
    this.CreateElement = function () {
      var Result = null;
      Result = document.createElement("DIV");
      return Result;
    };
    this.UpdateElement = function () {
      $mod.TControl.UpdateElement.call(this);
      if (this.GetElementHandle() != null) this.GetElementHandle().style.setProperty("overflow","auto");
    };
    rtl.addIntf(this,$mod.IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TCustomHTMLDiv",this.TCustomControl,function () {
    this.CreateElement = function () {
      var Result = null;
      Result = document.createElement("DIV");
      return Result;
    };
    rtl.addIntf(this,$mod.IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TControlManager",pas.Classes.TComponent,function () {
    this.$init = function () {
      pas.Classes.TComponent.$init.call(this);
      this.FInstanceCount = 0;
    };
    this.Create$1 = function (AOwner) {
      pas.Classes.TComponent.Create$1.apply(this,arguments);
      this.FInstanceCount = 0;
      return this;
    };
    this.GetInstanceNumber = function () {
      var Result = 0;
      this.FInstanceCount += 1;
      Result = this.FInstanceCount;
      return Result;
    };
    this.Reset = function () {
      this.FInstanceCount = 0;
    };
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TCSSCodeFragment",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FControlClassname = "";
      this.FCSS = null;
    };
    this.$final = function () {
      this.FCSS = undefined;
      pas.Classes.TCollectionItem.$final.call(this);
    };
    this.SetCSS = function (Value) {
      this.FCSS.Assign(Value);
    };
    this.Create$1 = function (Collection) {
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      this.FCSS = pas.Classes.TStringList.$create("Create$1");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FCSS");
      pas.Classes.TCollectionItem.Destroy.call(this);
    };
    var $r = this.$rtti;
    $r.addProperty("ControlClassname",0,rtl.string,"FControlClassname","FControlClassname");
    $r.addProperty("CSS",2,pas.Classes.$rtti["TStringList"],"FCSS","SetCSS");
  });
  rtl.createClass(this,"TCSSCodeFragments",pas.Classes.TOwnedCollection,function () {
    this.GetItemEx = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItemEx = function (Index, Value) {
      this.SetItem(Index,Value);
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,$mod.TCSSCodeFragment);
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      return Result;
    };
  });
  rtl.createClass(this,"TCSSCodeManager",pas.Classes.TComponent,function () {
    this.$init = function () {
      pas.Classes.TComponent.$init.call(this);
      this.FCSSFragments = null;
    };
    this.$final = function () {
      this.FCSSFragments = undefined;
      pas.Classes.TComponent.$final.call(this);
    };
    this.SetCSSFragments = function (Value) {
      this.FCSSFragments.Assign(Value);
    };
    this.Create$1 = function (AOwner) {
      pas.Classes.TComponent.Create$1.apply(this,arguments);
      this.FCSSFragments = $mod.TCSSCodeFragments.$create("Create$3",[this]);
      this.FCSSFragments.FPropName = "CSSFragments";
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FCSSFragments");
      pas.Classes.TComponent.Destroy.call(this);
    };
    this.GetClassFragment = function (AClassname) {
      var Result = null;
      var i = 0;
      Result = null;
      for (var $l = 0, $end = this.FCSSFragments.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.FCSSFragments.GetItemEx(i).FControlClassname === AClassname) Result = this.FCSSFragments.GetItemEx(i);
      };
      return Result;
    };
    this.GetClassCSS = function (AClassname) {
      var Result = "";
      var CSSCodeFragment = null;
      Result = "";
      CSSCodeFragment = this.GetClassFragment(AClassname);
      if (CSSCodeFragment != null) Result = CSSCodeFragment.FCSS.GetTextStr();
      return Result;
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("CSSFragments",2,$mod.$rtti["TCSSCodeFragments"],"FCSSFragments","SetCSSFragments");
  });
  rtl.createInterface(this,"ITMSFNCDataBinderBase","{778B63C9-34E3-4B65-A6B8-85E3EB1D17C3}",["DataBeginUpdate","DataEndUpdate"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("DataBeginUpdate",0,[]);
    $r.addMethod("DataEndUpdate",0,[]);
  });
  rtl.createInterface(this,"ITMSFNCDataBinderGrid","{D23BDEAA-49B1-451A-9401-0D0D11A9957A}",["SetDataColumnCount","SetDataRowCount","ClearData","GetDataRowCount","SetDataValue","SetDataHeader","DataInsertRow"],this.ITMSFNCDataBinderBase,function () {
    var $r = this.$rtti;
    $r.addMethod("SetDataColumnCount",0,[["AValue",rtl.longint]]);
    $r.addMethod("SetDataRowCount",0,[["AValue",rtl.longint]]);
    $r.addMethod("ClearData",0,[]);
    $r.addMethod("GetDataRowCount",1,[],2,rtl.longint);
    $r.addMethod("SetDataValue",0,[["AColumn",rtl.longint],["ARow",rtl.longint],["AValue",rtl.string]]);
    $r.addMethod("SetDataHeader",0,[["AColumn",rtl.longint],["AValue",rtl.string]]);
    $r.addMethod("DataInsertRow",0,[["AInsertPosition",rtl.longint]]);
  });
  rtl.createHelper(this,"TStringListHelper",null,function () {
    this.LoadFromJSONArray = function (ja) {
      var jsa = null;
      var i = 0;
      jsa = JSON.parse(ja);
      for (var $l = 0, $end = jsa.length - 1; $l <= $end; $l++) {
        i = $l;
        this.Add("" + jsa[i]);
      };
    };
    this.LoadFromJSONArrayURL = function (URL) {
      var $Self = this;
      var Result = null;
      var req = null;
      function ResultHandler(response) {
        var jsa = null;
        var i = 0;
        jsa = JSON.parse(response);
        for (var $l = 0, $end = jsa.length - 1; $l <= $end; $l++) {
          i = $l;
          $Self.Add("" + jsa[i]);
        };
      };
      Result = new Promise(function (ASuccess, AFailed) {
        req = new XMLHttpRequest();
        req.open("GET",URL);
        req.onload = function() {
                  if (req.status != 200) {
                    AFailed(false); }
                  else {
        
                    ResultHandler(req.response);
                    ASuccess(true);
                  }
                };
        req.send();
      });
      return Result;
    };
  });
  this.FindGlobalComponent = function (Name) {
    var Result = null;
    Result = null;
    return Result;
  };
  this.GetMousePos = function () {
    var Result = pas.Types.TPoint.$new();
    Result.$assign(pas.Types.Point($impl.FMouseX,$impl.FMouseY));
    return Result;
  };
  this.GetCursorPos = function (pt) {
    pt.x = $impl.FCursorX;
    pt.y = $impl.FCursorY;
  };
  this.FindUniqueName = function (Name) {
    var Result = "";
    Result = Name + pas.SysUtils.IntToStr($impl.ControlManager.GetInstanceNumber());
    return Result;
  };
  this.GetScrollBarHeight = function () {
    var Result = 0;
    var res = 0;
    res = $impl.ScrollBH;
    if (res === 0) {
      var outer = document.createElement("div");
            outer.style.visibility = "hidden";
            outer.style.height = "100px";
            outer.style.msOverflowStyle = "scrollbar"; // needed for WinJS apps
      
            document.body.appendChild(outer);
      
            var HeightNoScroll = outer.offsetHeight;
            // force scrollbars
            outer.style.overflow = "scroll";
      
            // add innerdiv
            var inner = document.createElement("div");
            inner.style.height = "100%";
            outer.appendChild(inner);
      
            var HeightWithScroll = inner.offsetHeight;
      
            // remove divs
            outer.parentNode.removeChild(outer);
      
            res = HeightNoScroll - HeightWithScroll;
      
            //res = 0;
      $impl.ScrollBH = res;
    };
    Result = res;
    return Result;
  };
  this.GetScrollBarWidth = function () {
    var Result = 0;
    var res = 0;
    res = $impl.ScrollBW;
    if (res === 0) {
      var outer = document.createElement("div");
            outer.style.visibility = "hidden";
            outer.style.width = "100px";
            outer.style.msOverflowStyle = "scrollbar"; // needed for WinJS apps
      
            document.body.appendChild(outer);
      
            var widthNoScroll = outer.offsetWidth;
            // force scrollbars
            outer.style.overflow = "scroll";
      
            // add innerdiv
            var inner = document.createElement("div");
            inner.style.width = "100%";
            outer.appendChild(inner);
      
            var widthWithScroll = inner.offsetWidth;
      
            // remove divs
            outer.parentNode.removeChild(outer);
      
            res = widthNoScroll - widthWithScroll;
      $impl.ScrollBW = res;
    };
    Result = res;
    return Result;
  };
  this.SetHTMLElementFont = function (AElement, AFont, UseCSS) {
    var s = "";
    if (UseCSS) {
      AElement.style.removeProperty("font-family");
      AElement.style.removeProperty("font-style");
      AElement.style.removeProperty("font-weight");
      AElement.style.removeProperty("font-size");
      AElement.style.removeProperty("text-decoration");
    } else {
      AElement.style.setProperty("font-family",AFont.FName);
      AElement.style.setProperty("font-style","normal");
      if (pas["WEBLib.Graphics"].TFontStyle.fsBold in AFont.FStyle) {
        AElement.style.setProperty("font-weight","bold")}
       else AElement.style.setProperty("font-weight","");
      if (pas["WEBLib.Graphics"].TFontStyle.fsItalic in AFont.FStyle) AElement.style.setProperty("font-style","italic");
      s = "";
      if (pas["WEBLib.Graphics"].TFontStyle.fsUnderline in AFont.FStyle) s = "underline";
      if (pas["WEBLib.Graphics"].TFontStyle.fsStrikeOut in AFont.FStyle) {
        if (s !== "") s = s + " ";
        s = s + "line-through";
      };
      if (s !== "") {
        AElement.style.setProperty("text-decoration",s)}
       else AElement.style.removeProperty("text-decoration");
      if (AFont.FSize !== 0) AElement.style.setProperty("font-size",pas.SysUtils.IntToStr(AFont.FSize) + "pt");
    };
  };
  this.SetHTMLElementColor = function (AElement, AColor, UseCSS) {
    if (UseCSS || (AColor === -1) || (AColor === 16711422)) {
      AElement.style.removeProperty($impl.cStyleBkgColor)}
     else AElement.style.setProperty($impl.cStyleBkgColor,pas["WEBLib.Graphics"].ColorToHTML(AColor));
  };
  this.GetHTMLCursorName = function (ACursor) {
    var Result = "";
    Result = "default";
    var $tmp = ACursor;
    if ($tmp === 0) {
      Result = "default"}
     else if ($tmp === 2) {
      Result = "auto"}
     else if ($tmp === 1) {
      Result = "none"}
     else if ($tmp === 3) {
      Result = "crosshair"}
     else if ($tmp === 4) {
      Result = "text"}
     else if ($tmp === 6) {
      Result = "nesw-resize"}
     else if ($tmp === 7) {
      Result = "ns-resize"}
     else if ($tmp === 8) {
      Result = "nwse-resize"}
     else if ($tmp === 9) {
      Result = "ew-resize"}
     else if ($tmp === 10) {
      Result = "n-resize"}
     else if ($tmp === 11) {
      Result = "wait"}
     else if ($tmp === 12) {
      Result = "copy"}
     else if ($tmp === 13) {
      Result = "no-drop"}
     else if ($tmp === 14) {
      Result = "col-resize"}
     else if ($tmp === 15) {
      Result = "row-resize"}
     else if ($tmp === 16) {
      Result = "copy"}
     else if ($tmp === 17) {
      Result = "progress"}
     else if ($tmp === 18) {
      Result = "not-allowed"}
     else if ($tmp === 19) {
      Result = "progress"}
     else if ($tmp === 20) {
      Result = "help"}
     else if ($tmp === 21) {
      Result = "pointer"}
     else if (($tmp === 22) || ($tmp === 5)) Result = "move";
    return Result;
  };
  this.GetHTMLElementAbsoluteRect = function (AElement) {
    var Result = pas.Types.TRect.$new();
    var s = "";
    function GetInt(AValue) {
      var Result = 0;
      var e = 0;
      AValue = pas.SysUtils.StringReplace(AValue,"px","",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
      pas.System.val$6(AValue,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }},{get: function () {
          return e;
        }, set: function (v) {
          e = v;
        }});
      return Result;
    };
    s = AElement.style.getPropertyValue("left");
    Result.Left = GetInt(s);
    s = AElement.style.getPropertyValue("top");
    Result.Top = GetInt(s);
    s = AElement.style.getPropertyValue("width");
    Result.Right = Result.Left + GetInt(s);
    s = AElement.style.getPropertyValue("height");
    Result.Bottom = Result.Top + GetInt(s);
    return Result;
  };
  this.CursorToString = function (ACursor) {
    var Result = "";
    Result = "crDefault";
    var $tmp = ACursor;
    if ($tmp === 0) {
      Result = "crDefault"}
     else if ($tmp === 2) {
      Result = "crArrow"}
     else if ($tmp === 1) {
      Result = "crNone"}
     else if ($tmp === 3) {
      Result = "crCross"}
     else if ($tmp === 5) {
      Result = "ctSize"}
     else if ($tmp === 4) {
      Result = "crIBeam"}
     else if ($tmp === 6) {
      Result = "crSizeNESW"}
     else if ($tmp === 7) {
      Result = "crSizeNS"}
     else if ($tmp === 8) {
      Result = "crSizeNWSE"}
     else if ($tmp === 9) {
      Result = "crSizeWE"}
     else if ($tmp === 10) {
      Result = "crUpArrow"}
     else if ($tmp === 11) {
      Result = "crHourGlass"}
     else if ($tmp === 12) {
      Result = "crDrag"}
     else if ($tmp === 13) {
      Result = "crNoDrop"}
     else if ($tmp === 14) {
      Result = "crHSplit"}
     else if ($tmp === 15) {
      Result = "crVSplit"}
     else if ($tmp === 16) {
      Result = "crMultiDrag"}
     else if ($tmp === 17) {
      Result = "crSQLWait"}
     else if ($tmp === 18) {
      Result = "crNo"}
     else if ($tmp === 19) {
      Result = "crAppStart"}
     else if ($tmp === 20) {
      Result = "crHelp"}
     else if ($tmp === 21) {
      Result = "crHandpoint"}
     else if ($tmp === 22) Result = "crSizeAll";
    return Result;
  };
  this.StringToCursor = function (S) {
    var Result = 0;
    var us = "";
    Result = 0;
    us = pas.SysUtils.UpperCase(S);
    if (us === "CRDEFAULT") {
      Result = 0}
     else if (us === "CRARROW") {
      Result = 2}
     else if (us === "CRNONE") {
      Result = 1}
     else if (us === "CRCROSS") {
      Result = 3}
     else if (us === "CRSIZE") {
      Result = 5}
     else if (us === "CRIBEAM") {
      Result = 4}
     else if (us === "CRSIZENESW") {
      Result = 6}
     else if (us === "CRSIZENS") {
      Result = 7}
     else if (us === "CRSIZENWSE") {
      Result = 8}
     else if (us === "CRSIZEWE") {
      Result = 9}
     else if (us === "CRUPARROW") {
      Result = 10}
     else if (us === "CRHOURGLASS") {
      Result = 11}
     else if (us === "CRDRAG") {
      Result = 12}
     else if (us === "CRNODROP") {
      Result = 13}
     else if (us === "CRHSPLIT") {
      Result = 14}
     else if (us === "CRVSPLIT") {
      Result = 15}
     else if (us === "CRMULTIDRAG") {
      Result = 16}
     else if (us === "CRSQLWAIT") {
      Result = 17}
     else if (us === "CRNO") {
      Result = 18}
     else if (us === "CRAPPSTART") {
      Result = 19}
     else if (us === "CRHELP") {
      Result = 20}
     else if (us === "CRHANDPOINT") {
      Result = 21}
     else if (us === "CRSIZEALL") Result = 22;
    return Result;
  };
  this.IsAndroid = function () {
    var Result = false;
    var sagent = "";
    sagent = navigator.userAgent;
    Result = pas.System.Pos("Android",sagent) > 0;
    return Result;
  };
  this.GetMaterialClass = function (mg) {
    var Result = "";
    Result = "material-icons";
    var $tmp = mg;
    if ($tmp === $mod.TMaterialGlyphType.mgOutlined) {
      Result = "material-icons-outlined"}
     else if ($tmp === $mod.TMaterialGlyphType.mgTwoTone) {
      Result = "material-icons-two-tone"}
     else if ($tmp === $mod.TMaterialGlyphType.mgRound) {
      Result = "material-icons-round"}
     else if ($tmp === $mod.TMaterialGlyphType.mgSharp) Result = "material-icons-sharp";
    return Result;
  };
  this.InputTypeString = function (AInputType) {
    var Result = "";
    var $tmp = AInputType;
    if ($tmp === $mod.TInputType.itText) {
      Result = "text"}
     else if ($tmp === $mod.TInputType.itEmail) {
      Result = "email"}
     else if ($tmp === $mod.TInputType.itDate) {
      Result = "date"}
     else if ($tmp === $mod.TInputType.itDateTime) {
      Result = "datetime-local"}
     else if ($tmp === $mod.TInputType.itFile) {
      Result = "file"}
     else if ($tmp === $mod.TInputType.itMonth) {
      Result = "month"}
     else if ($tmp === $mod.TInputType.itNumber) {
      Result = "number"}
     else if ($tmp === $mod.TInputType.itPassword) {
      Result = "password"}
     else if ($tmp === $mod.TInputType.itSearch) {
      Result = "search"}
     else if ($tmp === $mod.TInputType.itTime) {
      Result = "time"}
     else if ($tmp === $mod.TInputType.itURL) {
      Result = "url"}
     else if ($tmp === $mod.TInputType.itWeek) Result = "week";
    return Result;
  };
  $mod.$implcode = function () {
    $impl.ControlManager = null;
    $impl.FMouseX = 0;
    $impl.FMouseY = 0;
    $impl.FCursorX = 0;
    $impl.FCursorY = 0;
    $impl.ScrollBW = 0;
    $impl.ScrollBH = 0;
    $impl.DragObject = null;
    $impl.cStyleBkgColor = "background-color";
  };
  $mod.$init = function () {
    $impl.ScrollBW = 0;
    $impl.ScrollBH = 0;
    $impl.DragObject = null;
    $impl.ControlManager = $mod.TControlManager.$create("Create$1",[null]);
  };
},["WEBLib.Dialogs","WEBLib.Forms","Math","TypInfo","WEBLib.WebTools","WEBLib.Utils"]);
rtl.module("WEBLib.WebTools",["System","Classes","Web","JS","WEBLib.Controls","WEBLib.Graphics"],function () {
  "use strict";
  var $mod = this;
  this.CRLF = "\r\n";
  this.LNBR = "<BR>";
  this.cBodyTag = "body";
  this.cHTMLExt = ".html";
  this.TOperatingSystem = {"0": "osUnknown", osUnknown: 0, "1": "osWindows", osWindows: 1, "2": "osmacOS", osmacOS: 2, "3": "osLinux", osLinux: 3, "4": "osAndroid", osAndroid: 4, "5": "osiOS", osiOS: 5};
  this.$rtti.$Enum("TOperatingSystem",{minvalue: 0, maxvalue: 5, ordtype: 1, enumtype: this.TOperatingSystem});
  this.DoubleToHTML = function (d) {
    var Result = "";
    Result = pas.SysUtils.Format$1("%g",pas.System.VarRecs(3,d),pas.SysUtils.TFormatSettings.Invariant());
    return Result;
  };
  this.MessageBeep = function (AType) {
    var snd = new Audio("data:audio/wav;base64,//uQRAAAAWMSLwUIYAAsYkXgoQwAEaYLWfkWgAI0wWs/ItAAAGDgYtAgAyN+QWaAAihwMWm4G8QQRDiMcCBcH3Cc+CDv/7xA4Tvh9Rz/y8QADBwMWgQAZG/ILNAARQ4GLTcDeI"+
        "IIhxGOBAuD7hOfBB3/94gcJ3w+o5/5eIAIAAAVwWgQAVQ2ORaIQwEMAJiDg95G4nQL7mQVWI6GwRcfsZAcsKkJvxgxEjzFUgfHoSQ9Qq7KNwqHwuB13MA4a1q/DmBrHgPcmjiGoh//EwC5nGPEmS4RcfkVK"+
    "OhJf+WOgoxJclFz3kgn//dBA+ya1GhurNn8zb//9NNutNuhz31f////9vt///z+IdAEAAAK4LQIAKobHItEIYCGAExBwe8jcToF9zIKrEdDYIuP2MgOWFSE34wYiR5iqQPj0JIeoVdlG4VD4XA67mAcNa1f"+
    "hzA1jwHuTRxDUQ//iYBczjHiTJcIuPyKlHQkv/LHQUYkuSi57yQT//uggfZNajQ3Vmz+Zt//+mm3Wm3Q576v////+32///5/EOgAAADVghQAAAAA//uQZAUAB1WI0PZugAAAAAoQwAAAEk3nRd2qAAAAACi"+
    "DgAAAAAAABCqEEQRLCgwpBGMlJkIz8jKhGvj4k6jzRnqasNKIeoh5gI7BJaC1A1AoNBjJgbyApVS4IDlZgDU5WUAxEKDNmmALHzZp0Fkz1FMTmGFl1FMEyodIavcCAUHDWrKAIA4aa2oCgILEBupZgHvAhE"+
    "BcZ6joQBxS76AgccrFlczBvKLC0QI2cBoCFvfTDAo7eoOQInqDPBtvrDEZBNYN5xwNwxQRfw8ZQ5wQVLvO8OYU+mHvFLlDh05Mdg7BT6YrRPpCBznMB2r//xKJjyyOh+cImr2/4doscwD6neZjuZR4AgAABY"+
    "AAAABy1xcdQtxYBYYZdifkUDgzzXaXn98Z0oi9ILU5mBjFANmRwlVJ3/6jYDAmxaiDG3/6xjQQCCKkRb/6kg/wW+kSJ5//rLobkLSiKmqP/0ikJuDaSaSf/6JiLYLEYnW/+kXg1WRVJL/9EmQ1YZIsv/6Qzw"+
    "y5qk7/+tEU0nkls3/zIUMPKNX/6yZLf+kFgAfgGyLFAUwY//uQZAUABcd5UiNPVXAAAApAAAAAE0VZQKw9ISAAACgAAAAAVQIygIElVrFkBS+Jhi+EAuu+lKAkYUEIsmEAEoMeDmCETMvfSHTGkF5RWH7kz/"+
    "ESHWPAq/kcCRhqBtMdokPdM7vil7RG98A2sc7zO6ZvTdM7pmOUAZTnJW+NXxqmd41dqJ6mLTXxrPpnV8avaIf5SvL7pndPvPpndJR9Kuu8fePvuiuhorgWjp7Mf/PRjxcFCPDkW31srioCExivv9lcwKEaHs"+
    "f/7ow2Fl1T/9RkXgEhYElAoCLFtMArxwivDJJ+bR1HTKJdlEoTELCIqgEwVGSQ+hIm0NbK8WXcTEI0UPoa2NbG4y2K00JEWbZavJXkYaqo9CRHS55FcZTjKEk3NKoCYUnSQ0rWxrZbFKbKIhOKPZe1cJKzZS"+
    "aQrIyULHDZmV5K4xySsDRKWOruanGtjLJXFEmwaIbDLX0hIPBUQPVFVkQkDoUNfSoDgQGKPekoxeGzA4DUvnn4bxzcZrtJyipKfPNy5w+9lnXwgqsiyHNeSVpemw4bWb9psYeq//uQZBoABQt4yMVxYAIAAA"+
    "kQoAAAHvYpL5m6AAgAACXDAAAAD59jblTirQe9upFsmZbpMudy7Lz1X1DYsxOOSWpfPqNX2WqktK0DMvuGwlbNj44TleLPQ+Gsfb+GOWOKJoIrWb3cIMeeON6lz2umTqMXV8Mj30yWPpjoSa9ujK8SyeJP5y5"+
    "mOW1D6hvLepeveEAEDo0mgCRClOEgANv3B9a6fikgUSu/DmAMATrGx7nng5p5iimPNZsfQLYB2sDLIkzRKZOHGAaUyDcpFBSLG9MCQALgAIgQs2YunOszLSAyQYPVC2YdGGeHD2dTdJk1pAHGAWDjnkcLKFym"+
    "S3RQZTInzySoBwMG0QueC3gMsCEYxUqlrcxK6k1LQQcsmyYeQPdC2YfuGPASCBkcVMQQqpVJshui1tkXQJQV0OXGAZMXSOEEBRirXbVRQW7ugq7IM7rPWSZyDlM3IuNEkxzCOJ0ny2ThNkyRai1b6ev//3dzN"+
    "GzNb//4uAvHT5sURcZCFcuKLhOFs8mLAAEAt4UWAAIABAAAAAB4qbHo0tIjVkUU//uQZAwABfSFz3ZqQAAAAAngwAAAE1HjMp2qAAAAACZDgAAAD5UkTE1UgZEUExqYynN1qZvqIOREEFmBcJQkwdxiFtw0q"+
    "EOkGYfRDifBui9MQg4QAHAqWtAWHoCxu1Yf4VfWLPIM2mHDFsbQEVGwyqQoQcwnfHeIkNt9YnkiaS1oizycqJrx4KOQjahZxWbcZgztj2c49nKmkId44S71j0c8eV9yDK6uPRzx5X18eDvjvQ6yKo9ZSS6l/"+
    "/8elePK/Lf//IInrOF/FvDoADYAGBMGb7FtErm5MXMlmPAJQVgWta7Zx2go+8xJ0UiCb8LHHdftWyLJE0QIAIsI+UbXu67dZMjmgDGCGl1H+vpF4NSDckSIkk7Vd+sxEhBQMRU8j/12UIRhzSaUdQ+rQU5kG"+
    "eFxm+hb1oh6pWWmv3uvmReDl0UnvtapVaIzo1jZbf/pD6ElLqSX+rUmOQNpJFa/r+sa4e/pBlAABoAAAAA3CUgShLdGIxsY7AUABPRrgCABdDuQ5GC7DqPQCgbbJUAoRSUj+NIEig0YfyWUho1VBBBA//uQZ"+
    "B4ABZx5zfMakeAAAAmwAAAAF5F3P0w9GtAAACfAAAAAwLhMDmAYWMgVEG1U0FIGCBgXBXAtfMH10000EEEEEECUBYln03TTTdNBDZopopYvrTTdNa325mImNg3TTPV9q3pmY0xoO6bv3r00y+IDGid/9aaaZ"+
    "TGMuj9mpu9Mpio1dXrr5HERTZSmqU36A3CumzN/9Robv/Xx4v9ijkSRSNLQhAWumap82WRSBUqXStV/YcS+XVLnSS+WLDroqArFkMEsAS+eWmrUzrO0oEmE40RlMZ5+ODIkAyKAGUwZ3mVKmcamcJnMW26MRP"+
    "gUw6j+LkhyHGVGYjSUUKNpuJUQoOIAyDvEyG8S5yfK6dhZc0Tx1KI/gviKL6qvvFs1+bWtaz58uUNnryq6kt5RzOCkPWlVqVX2a/EEBUdU1KrXLf40GoiiFXK///qpoiDXrOgqDR38JB0bw7SoL+ZB9o1RCk"+
    "QjQ2CBYZKd/+VJxZRRZlqSkKiws0WFxUyCwsKiMy7hUVFhIaCrNQsKkTIsLivwKKigsj8XYlwt/WKi2N4d//uQRCSAAjURNIHpMZBGYiaQPSYyAAABLAAAAAAAACWAAAAApUF/Mg+0aohSIRobBAsMlO//Kk"+
    "4soosy1JSFRYWaLC4qZBYWFRGZdwqKiwkNBVmoWFSJkWFxX4FFRQWR+LsS4W/rFRb////////////////////////////////////////////////////////////////////////////////////////////"+
    "////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////"+
    "////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////"+
    "/////////////VEFHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAU291bmRib3kuZGUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMjAwNGh0dHA6Ly93d3cuc291bmRib3kuZGUAAAAAAAAAACU=");
    snd.play();
  };
  this.OutputDebugString = function (s) {
    console.log(s);
  };
  this.GetTickCount = function () {
    var Result = 0;
    var n = 0;
    var d = new Date();
    n = d.getTime();
    Result = n;
    return Result;
  };
  this.GetQueryParam = function (AName) {
    var Result = "";
    var res = "";
    $mod.HasQueryParam(AName,{get: function () {
        return res;
      }, set: function (v) {
        res = v;
      }},true);
    Result = res;
    return Result;
  };
  this.HasQueryParam = function (AName, AValue, CaseSensitive) {
    var Result = false;
    var found = false;
    var s = "";
    s = "";
    if (!CaseSensitive) AName = pas.SysUtils.UpperCase(AName);
    var query = window.location.search.substring(1);
        var res = "";
        var key = "";
        found = false;
        var vars = query.split('&');
        for (var i = 0; i < vars.length; i++) {
          var pair = vars[i].split('=');
    
          key = decodeURIComponent(pair[0]);
          if (CaseSensitive == false)
          {
            key = key.toUpperCase();
          }
    
          if (key == AName) {
              res = decodeURIComponent(pair[1]);
              found = true;
           }
        }
        s = res;
    AValue.set(s);
    Result = found;
    return Result;
  };
  this.EscapeHTML = function (AValue) {
    var Result = "";
    var s = "";
    s = AValue;
    function escapeHTML(AString) {
      return AString.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
    }
    s = escapeHTML(s);
    Result = s;
    return Result;
  };
  this.GetLocaleShortDateFormat = function (ALocale) {
    var Result = "";
    Result = pas.SysUtils.TFormatSettings.Create$1(ALocale).ShortDateFormat;
    return Result;
  };
  this.GetLocaleLongDayName = function (DayOfWeek, ALocale) {
    var Result = "";
    var res = "";
    var baseDate = new Date(2017, 0, 1); // Sunday
        baseDate.setDate(baseDate.getDate() + DayOfWeek - 1);
    
        var loc = "";
        if (ALocale == '') { loc = navigator.language; }
        else { loc = ALocale; }
    
        res = baseDate.toLocaleDateString(loc, { weekday: 'long' });
    Result = res;
    return Result;
  };
  this.GetLocaleShortDayName = function (DayOfWeek, ALocale) {
    var Result = "";
    var res = "";
    var baseDate = new Date(2017, 0, 1); // Sunday
        baseDate.setDate(baseDate.getDate() + DayOfWeek - 1);
    
        var loc = "";
        if (ALocale == '') { loc = navigator.language; }
        else { loc = ALocale; }
    
        res = baseDate.toLocaleDateString(loc, { weekday: 'short' });
    Result = res;
    return Result;
  };
  this.GetLocaleLongMonthName = function (Month, ALocale) {
    var Result = "";
    var res = "";
    var baseDate = new Date(2017, Month - 1, 1);
    
        var loc = "";
        if (ALocale == '') { loc = navigator.language; }
        else { loc = ALocale; }
    
        res = baseDate.toLocaleDateString(loc, { month: 'long' });
    Result = res;
    return Result;
  };
  this.GetLocaleShortMonthName = function (Month, ALocale) {
    var Result = "";
    var res = "";
    var baseDate = new Date(2017, Month - 1, 1);
    
        var loc = "";
        if (ALocale == '') { loc = navigator.language; }
        else { loc = ALocale; }
    
        res = baseDate.toLocaleDateString(loc, { month: 'short' });
    Result = res;
    return Result;
  };
  this.GetLocaleDecimalSeparator = function (ALocale) {
    var Result = "";
    var res = "";
    var n = 1.1;
        var loc = "";
        if (ALocale == '') { loc = navigator.language; }
        else { loc = ALocale; }
    
        n = n.toLocaleString(loc).substring(1, 2);
        res = n;
    Result = res;
    return Result;
  };
  this.GetLocaleThousandSeparator = function (ALocale) {
    var Result = "";
    var res = "";
    var n = 1000.1;
    var loc = "";
    if (ALocale == '') { loc = navigator.language; }
    else { loc = ALocale; }
    n = n.toLocaleString(loc).substring(1, 2);
    res = n;
    Result = res;
    return Result;
  };
  this.LocaleFormatCurrency = function (Value, ACurrency, ALocale) {
    var Result = "";
    var res = "";
    var loc = "";
    if (ALocale == '') { loc = navigator.language; }
    else { loc = ALocale; }
    var number = Value;
    res = number.toLocaleString(loc, { style: 'currency', currency: ACurrency });
    Result = res;
    return Result;
  };
  this.GetLocaleCurrency = function (ALocale) {
    var Result = "";
    var res = "";
    var curr =
          {"BD": "BDT", "BE": "EUR", "BF": "XOF", "BG": "BGN", "BA": "BAM", "BB": "BBD", "WF": "XPF",
           "BL": "EUR", "BM": "BMD", "BN": "BND", "BO": "BOB", "BH": "BHD", "BI": "BIF", "BJ": "XOF",
           "BT": "BTN", "JM": "JMD", "BV": "NOK", "BW": "BWP", "WS": "WST", "BQ": "USD", "BR": "BRL",
           "BS": "BSD", "JE": "GBP", "BY": "BYR", "BZ": "BZD", "RU": "RUB", "RW": "RWF", "RS": "RSD",
           "TL": "USD", "RE": "EUR", "TM": "TMT", "TJ": "TJS", "RO": "RON", "TK": "NZD", "GW": "XOF",
           "GU": "USD", "GT": "GTQ", "GS": "GBP", "GR": "EUR", "GQ": "XAF", "GP": "EUR", "JP": "JPY",
           "GY": "GYD", "GG": "GBP", "GF": "EUR", "GE": "GEL", "GD": "XCD", "GB": "GBP", "GA": "XAF",
           "SV": "USD", "GN": "GNF", "GM": "GMD", "GL": "DKK", "GI": "GIP", "GH": "GHS", "OM": "OMR",
           "TN": "TND", "JO": "JOD", "HR": "HRK", "HT": "HTG", "HU": "HUF", "HK": "HKD", "HN": "HNL",
           "HM": "AUD", "VE": "VEF", "PR": "USD", "PS": "ILS", "PW": "USD", "PT": "EUR", "SJ": "NOK",
           "PY": "PYG", "IQ": "IQD", "PA": "PAB", "PF": "XPF", "PG": "PGK", "PE": "PEN", "PK": "PKR",
           "PH": "PHP", "PN": "NZD", "PL": "PLN", "PM": "EUR", "ZM": "ZMK", "EH": "MAD", "EE": "EUR",
           "EG": "EGP", "ZA": "ZAR", "EC": "USD", "IT": "EUR", "VN": "VND", "SB": "SBD", "ET": "ETB",
           "SO": "SOS", "ZW": "ZWL", "SA": "SAR", "ES": "EUR", "ER": "ERN", "ME": "EUR", "MD": "MDL",
           "MG": "MGA", "MF": "EUR", "MA": "MAD", "MC": "EUR", "UZ": "UZS", "MM": "MMK", "ML": "XOF",
           "MO": "MOP", "MN": "MNT", "MH": "USD", "MK": "MKD", "MU": "MUR", "MT": "EUR", "MW": "MWK",
           "MV": "MVR", "MQ": "EUR", "MP": "USD", "MS": "XCD", "MR": "MRO", "IM": "GBP", "UG": "UGX",
           "TZ": "TZS", "MY": "MYR", "MX": "MXN", "IL": "ILS", "FR": "EUR", "IO": "USD", "SH": "SHP",
           "FI": "EUR", "FJ": "FJD", "FK": "FKP", "FM": "USD", "FO": "DKK", "NI": "NIO", "NL": "EUR",
           "NO": "NOK", "NA": "NAD", "VU": "VUV", "NC": "XPF", "NE": "XOF", "NF": "AUD", "NG": "NGN",
           "NZ": "NZD", "NP": "NPR", "NR": "AUD", "NU": "NZD", "CK": "NZD", "XK": "EUR", "CI": "XOF",
           "CH": "CHF", "CO": "COP", "CN": "CNY", "CM": "XAF", "CL": "CLP", "CC": "AUD", "CA": "CAD",
           "CG": "XAF", "CF": "XAF", "CD": "CDF", "CZ": "CZK", "CY": "EUR", "CX": "AUD", "CR": "CRC",
           "CW": "ANG", "CV": "CVE", "CU": "CUP", "SZ": "SZL", "SY": "SYP", "SX": "ANG", "KG": "KGS",
           "KE": "KES", "SS": "SSP", "SR": "SRD", "KI": "AUD", "KH": "KHR", "KN": "XCD", "KM": "KMF",
           "ST": "STD", "SK": "EUR", "KR": "KRW", "SI": "EUR", "KP": "KPW", "KW": "KWD", "SN": "XOF",
           "SM": "EUR", "SL": "SLL", "SC": "SCR", "KZ": "KZT", "KY": "KYD", "SG": "SGD", "SE": "SEK",
           "SD": "SDG", "DO": "DOP", "DM": "XCD", "DJ": "DJF", "DK": "DKK", "VG": "USD", "DE": "EUR",
           "YE": "YER", "DZ": "DZD", "US": "USD", "UY": "UYU", "YT": "EUR", "UM": "USD", "LB": "LBP",
           "LC": "XCD", "LA": "LAK", "TV": "AUD", "TW": "TWD", "TT": "TTD", "TR": "TRY", "LK": "LKR",
           "LI": "CHF", "LV": "EUR", "TO": "TOP", "LT": "LTL", "LU": "EUR", "LR": "LRD", "LS": "LSL",
           "TH": "THB", "TF": "EUR", "TG": "XOF", "TD": "XAF", "TC": "USD", "LY": "LYD", "VA": "EUR",
           "VC": "XCD", "AE": "AED", "AD": "EUR", "AG": "XCD", "AF": "AFN", "AI": "XCD", "VI": "USD",
           "IS": "ISK", "IR": "IRR", "AM": "AMD", "AL": "ALL", "AO": "AOA", "AQ": "", "AS": "USD",
           "AR": "ARS", "AU": "AUD", "AT": "EUR", "AW": "AWG", "IN": "INR", "AX": "EUR", "AZ": "AZN",
           "IE": "EUR", "ID": "IDR", "UA": "UAH", "QA": "QAR", "MZ": "MZN"}
    
        var loc = "";
        if (ALocale == '') { loc = navigator.language; }
        else { loc = ALocale; }
        loc = loc.substring(3,5);
        loc = loc.toUpperCase();
        res = curr[loc] || '';
    Result = res;
    return Result;
  };
  this.GetBrowserLocale = function () {
    var Result = "";
    var res = "";
    res = navigator.language;
    Result = res;
    return Result;
  };
  this.GetOperatingSystem = function () {
    var Result = 0;
    var ag = "";
    var res = false;
    Result = $mod.TOperatingSystem.osUnknown;
    ag = navigator.userAgent;
    if (pas.System.Pos("Win",ag) > 0) Result = $mod.TOperatingSystem.osWindows;
    if (pas.System.Pos("Mac",ag) > 0) Result = $mod.TOperatingSystem.osmacOS;
    if (pas.System.Pos("Linux",ag) > 0) Result = $mod.TOperatingSystem.osLinux;
    if (pas.System.Pos("Android",ag) > 0) Result = $mod.TOperatingSystem.osAndroid;
    if (pas.System.Pos("Linux",ag) > 0) Result = $mod.TOperatingSystem.osLinux;
    res = ag.match(/(iPod|iPhone|iPad)/) &&
    ag.match(/AppleWebKit/);
    if (res) Result = $mod.TOperatingSystem.osiOS;
    return Result;
  };
  this.ProcessAccelerator = function (AValue, Accelerator) {
    var Result = "";
    var i = 0;
    var l = 0;
    var res = "";
    l = AValue.length;
    Accelerator.set("");
    res = "";
    i = 1;
    while (i <= l) {
      if (AValue.charAt(i - 1) === "&") {
        if (((i + 1) <= l) && (AValue.charAt((i + 1) - 1) !== "&")) {
          res = res + "<u>" + AValue.charAt((i + 1) - 1) + "</u>";
          Accelerator.set(AValue.charAt((i + 1) - 1));
        } else if (((i + 1) <= l) && (AValue.charAt((i + 1) - 1) === "&")) res = res + "&";
        i += 2;
      } else {
        res = res + AValue.charAt(i - 1);
        i += 1;
      };
    };
    Result = res;
    return Result;
  };
  this.GetBase64Image = function (AImage, AWidth, AHeight) {
    var Result = "";
    var s = "";
    var m = null;
    s = "";
    m = AImage;
    function getBase64Image(img) {
      var canvas = document.createElement("canvas");
      if (AWidth == 0) {
        canvas.width = img.width; }
        else {
        canvas.width = AWidth; }
      if (AHeight == 0) {
      canvas.height = img.height; }
      else {
        canvas.height = AHeight; }
      var ctx = canvas.getContext("2d");
      if ((AWidth == 0) || (AHeight == 0)) {
         ctx.drawImage(img, 0, 0); }
      else {
         ctx.drawImage(img, 0, 0, AWidth, AHeight); }
      var dataURL = canvas.toDataURL("image/png");
      return dataURL.replace(/^data:image\/(png|jpg);base64,/, "");
    }
    s = getBase64Image(m);
    Result = s;
    return Result;
  };
  this.DebugBreak = function () {
    debugger;
  };
  this.HexImageDecode = function (s) {
    var Result = null;
    var i = 0;
    var j = 0;
    var l = 0;
    var res = null;
    var c1 = 0;
    var c2 = 0;
    var hdr = 0;
    l = rtl.trunc(s.length / 2);
    j = 0;
    c1 = s.charCodeAt(1 - 1) - 48;
    if (c1 >= 10) c1 = c1 - 7;
    c2 = s.charCodeAt(2 - 1) - 48;
    if (c2 >= 10) c2 = c2 - 7;
    hdr = 1 + (c2 + (c1 << 4));
    i = pas.System.Pos("4A5045474",s);
    if ((i > 1) && (i < 10)) hdr += 4;
    i = pas.System.Pos("4269746D6",s);
    if ((i > 1) && (i < 10)) hdr += 4;
    res = new Uint8Array(l - hdr);
    for (var $l = hdr + 1, $end = l; $l <= $end; $l++) {
      i = $l;
      c1 = s.charCodeAt((i * 2) - 1 - 1) - 48;
      if (c1 >= 10) c1 = c1 - 7;
      c2 = s.charCodeAt((i * 2) - 1) - 48;
      if (c2 >= 10) c2 = c2 - 7;
      c2 = c2 + (c1 << 4);
      res[j] = c2;
      j += 1;
    };
    Result = res;
    return Result;
  };
  this.HexImageEncodeFromBase64 = function (s) {
    var Result = "";
    var ja = null;
    s = s.replace(/^data:image\/\S+;base64,/, "");
    //ja = Uint8Array.from(atob(s), c => c.charCodeAt(0))
    ja = Uint8Array.from(atob(s), function(c) { return c.charCodeAt(0);} );
    Result = $mod.HexImageEncode(ja);
    return Result;
  };
  this.HexImageEncode = function (a) {
    var Result = "";
    var i = 0;
    var l = 0;
    var b = 0;
    var s = "";
    var ls = "";
    Result = "";
    l = a.length;
    if (l === 0) return Result;
    l = ((l & 0xFF) << 24) + ((l & 0xFF00) << 8) + ((l & 0xFF0000) >>> 8) + ((l & 0xFF000000) >>> 24);
    ls = "";
    if ((a[0] === 137) && (a[1] === 80)) {
      s = "TPngImage";
      b = s.length;
    };
    if ((a[0] === 0xFF) && (a[1] === 0xD8)) {
      s = "TJPEGImage";
      b = s.length;
      ls = pas.SysUtils.IntToHex(l,8);
    };
    if ((a[0] === 66) && (a[1] === 77)) {
      s = "TBitmap";
      b = s.length;
      ls = pas.SysUtils.IntToHex(l,8);
    };
    if ((a[0] === 71) && (a[1] === 73)) {
      s = "TGIFImage";
      b = s.length;
    };
    Result = pas.SysUtils.IntToHex(b,2);
    for (var $l = 1, $end = s.length; $l <= $end; $l++) {
      i = $l;
      b = s.charCodeAt(i - 1);
      Result = Result + pas.SysUtils.IntToHex(b,2);
    };
    Result = Result + ls;
    for (var $l1 = 0, $end1 = a.length - 1; $l1 <= $end1; $l1++) {
      i = $l1;
      b = a[i];
      Result = Result + pas.SysUtils.IntToHex(b,2);
    };
    return Result;
  };
  this.HexImageDecodeAsBase64 = function (s) {
    var Result = "";
    var ja = null;
    ja = $mod.HexImageDecode(s);
    s = btoa(new Uint8Array(ja).reduce(function (data, byte) {
    return data + String.fromCharCode(byte);
    }, ''));
    Result = s;
    return Result;
  };
  this.EmptyImage = function () {
    var Result = "";
    Result = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";
    return Result;
  };
  this.NumAttribute = function (s) {
    var Result = "";
    var res = "";
    res = pas.SysUtils.TDoubleHelper.ToString$3.call({get: function () {
        return s;
      }, set: function (v) {
        s = v;
      }});
    Result = pas.SysUtils.StringReplace(res,",",".",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
    return Result;
  };
  this.DataURLToFile = function (AURL, FileName) {
    var Result = null;
    var afile = null;
    var arr = AURL.split(','),
    mime = arr[0].match(/:(.*?);/)[1],
    bstr = atob(arr[1]),
    n = bstr.length,
    u8arr = new Uint8Array(n);
    while(n--){
      u8arr[n] = bstr.charCodeAt(n);
    }
    afile = new File([u8arr], FileName, {type:mime});
    Result = afile;
    return Result;
  };
  this.DownloadFile = function (AFile) {
    var a = null;
    a = document.createElement("a");
    a.href = window.URL.createObjectURL(AFile);
    a.download = AFile.name;
    a.click();
  };
  this.PickerDateToDate = function (s) {
    var Result = 0.0;
    var ye = "";
    var mo = "";
    var da = "";
    var yei = 0;
    var moi = 0;
    var dai = 0;
    var e = 0;
    Result = 0;
    ye = pas.System.Copy(s,1,4);
    mo = pas.System.Copy(s,6,2);
    da = pas.System.Copy(s,9,2);
    pas.System.val$5(ye,{get: function () {
        return yei;
      }, set: function (v) {
        yei = v;
      }},{get: function () {
        return e;
      }, set: function (v) {
        e = v;
      }});
    pas.System.val$5(mo,{get: function () {
        return moi;
      }, set: function (v) {
        moi = v;
      }},{get: function () {
        return e;
      }, set: function (v) {
        e = v;
      }});
    pas.System.val$5(da,{get: function () {
        return dai;
      }, set: function (v) {
        dai = v;
      }},{get: function () {
        return e;
      }, set: function (v) {
        e = v;
      }});
    if ((yei !== 0) && (moi !== 0) && (dai !== 0)) Result = pas.SysUtils.EncodeDate(yei,moi,dai);
    return Result;
  };
  this.PickerTimeToTime = function (s) {
    var Result = 0.0;
    var ho = "";
    var mi = "";
    var se = "";
    var hoi = 0;
    var mii = 0;
    var sei = 0;
    var e = 0;
    Result = 0;
    ho = pas.System.Copy(s,1,2);
    mi = pas.System.Copy(s,4,2);
    se = pas.System.Copy(s,7,2);
    pas.System.val$5(ho,{get: function () {
        return hoi;
      }, set: function (v) {
        hoi = v;
      }},{get: function () {
        return e;
      }, set: function (v) {
        e = v;
      }});
    pas.System.val$5(mi,{get: function () {
        return mii;
      }, set: function (v) {
        mii = v;
      }},{get: function () {
        return e;
      }, set: function (v) {
        e = v;
      }});
    pas.System.val$5(se,{get: function () {
        return sei;
      }, set: function (v) {
        sei = v;
      }},{get: function () {
        return e;
      }, set: function (v) {
        e = v;
      }});
    if ((hoi >= 0) && (mii >= 0) && (sei >= 0)) Result = pas.SysUtils.EncodeTime(hoi,mii,sei,0);
    return Result;
  };
  this.URLString = function (s) {
    var Result = "";
    var res = "";
    function linkify(inputText) {
        var replacedText, replacePattern1, replacePattern2, replacePattern3;
    
        //URLs starting with http://, https://, or ftp://
        replacePattern1 = /(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim;
        replacedText = inputText.replace(replacePattern1, '<a href="$1" target="_blank">$1</a>');
    
        //URLs starting with "www." (without // before it, or it'd re-link the ones done above).
        replacePattern2 = /(^|[^\/])(www\.[\S]+(\b|$))/gim;
        replacedText = replacedText.replace(replacePattern2, '$1<a href="http://$2" target="_blank">$2</a>');
    
        //Change email addresses to mailto:: links.
        replacePattern3 = /(([a-zA-Z0-9\-\_\.])+@[a-zA-Z\_]+?(\.[a-zA-Z]{2,6})+)/gim;
        replacedText = replacedText.replace(replacePattern3, '<a href="mailto:$1">$1</a>');
    
        return replacedText;
        }
        res = linkify(s);
    Result = res;
    return Result;
  };
  this.IsURl = function (s) {
    var Result = false;
    var res = false;
    function CheckIsUrl(inputText) {
    if(new RegExp("([a-zA-Z0-9]+://)?([a-zA-Z0-9_]+:[a-zA-Z0-9_]+@)?([a-zA-Z0-9.-]+\\.[A-Za-z]{2,4})(:[0-9]+)?(/.*)?").test(inputText)) {
        return true;
    }
    return false;
    }
    res = CheckIsUrl(s);
    Result = res;
    return Result;
  };
  this.EmojiString = function (s) {
    var Result = "";
    var ls = null;
    var i = 0;
    var v = "";
    var k = "";
    for (var $l = 1, $end = s.length; $l <= $end; $l++) {
      i = $l;
      if (s.charAt(i - 1) === "|") s = rtl.setCharAt(s,i - 1,"¦");
    };
    ls = pas.Classes.TStringList.$create("Create$1");
    ls.AddPair(":)","&#x1F600;");
    ls.AddPair(":D","&#x1F601;");
    ls.AddPair(";)","&#x1F609;");
    ls.AddPair(":O","&#x1F62E;");
    ls.AddPair(":*","&#x1F617;");
    ls.AddPair(":P","&#x1F61C;");
    ls.AddPair(":(","&#x1F641;");
    ls.AddPair(":¦","&#x1F610;");
    ls.AddPair(":X","&#x1F910;");
    ls.AddPair("¦;)","&#x1F60E;");
    ls.AddPair(":<","&#x1F621;");
    for (var $l1 = 0, $end1 = ls.GetCount() - 1; $l1 <= $end1; $l1++) {
      i = $l1;
      v = ls.GetName(i);
      k = ls.GetValue(v);
      s = pas.SysUtils.StringReplace(s,v,k,rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
    };
    ls = rtl.freeLoc(ls);
    Result = s;
    return Result;
  };
  this.HTMLToString = function (s) {
    var Result = "";
    s = pas.SysUtils.StringReplace(s,"<","&lt;",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
    Result = pas.SysUtils.StringReplace(s,">","&gt;",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
    return Result;
  };
  this.FileSizeFmt = function (Size) {
    var Result = "";
    if (Size < 1000) Result = pas.SysUtils.IntToStr(Size) + " bytes";
    if ((Size >= 1000) && (Size < 1000000)) Result = pas.SysUtils.Format("%.2f",pas.System.VarRecs(3,Size / 1000)) + " Kb";
    if ((Size >= 1000000) && (Size < 1000000000)) Result = pas.SysUtils.Format("%.2f",pas.System.VarRecs(3,Size / 1000000)) + " Mb";
    if (Size >= 1000000000) Result = pas.SysUtils.Format("%.2f",pas.System.VarRecs(3,Size / 1000000000)) + " Gb";
    return Result;
  };
  this.FileSizeFmtSpeed = function (Size) {
    var Result = "";
    if (Size < 1000) Result = pas.SysUtils.IntToStr(Size) + " bytes/sec";
    if ((Size >= 1000) && (Size < 1000000)) Result = pas.SysUtils.Format("%.2f",pas.System.VarRecs(3,Size / 1000)) + " Kb/sec";
    if ((Size >= 1000000) && (Size < 1000000000)) Result = pas.SysUtils.Format("%.2f",pas.System.VarRecs(3,Size / 1000000)) + " Mb/sec";
    if (Size >= 1000000000) Result = pas.SysUtils.Format("%.2f",pas.System.VarRecs(3,Size / 1000000000)) + " Gb/sec";
    return Result;
  };
  this.ElementVisible = function (el) {
    var Result = false;
    var p = null;
    Result = false;
    p = el;
    while (p != null) {
      if (pas.SysUtils.LowerCase(p.tagName) === $mod.cBodyTag) Result = true;
      p = p.parentElement;
    };
    if (!Result) return Result;
    while (el != null) {
      if (el.style.getPropertyValue("display") === "none") {
        Result = false;
        return Result;
      };
      p = el.parentElement;
      if (!rtl.isExt(p,HTMLElement)) return Result;
      el = p;
    };
    return Result;
  };
  this.GetMaterialGlyph = function (AGlyph, ASize, AColor, AType) {
    var Result = "";
    var s = "";
    var matclr = "";
    var matsize = "";
    s = "<i";
    s = s + ' class="' + pas["WEBLib.Controls"].GetMaterialClass(AType) + '"';
    matclr = "";
    if (AColor !== -1) matclr = "color:" + pas["WEBLib.Graphics"].ColorToHTML(AColor) + ";";
    matsize = "";
    if (ASize !== 0) matsize = "font-size:" + pas.SysUtils.IntToStr(ASize) + "px;";
    s = s + ' style="pointer-events:none;' + matclr + matsize + '"';
    Result = s + ">" + AGlyph + "</i>";
    return Result;
  };
},["SysUtils","WEBLib.Utils"]);
rtl.module("contnrs",["System","SysUtils","Classes"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.$rtti.$RefToProcVar("TObjectListCallback",{procsig: rtl.newTIProcSig([["data",pas.System.$rtti["TObject"]],["arg",rtl.jsvalue]])});
  rtl.createClass(this,"TFPObjectList",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FFreeObjects = false;
      this.FList = null;
    };
    this.$final = function () {
      this.FList = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FList.FCount;
      return Result;
    };
    this.SetCount = function (AValue) {
      if (this.FList.FCount !== AValue) this.FList.SetCount(AValue);
    };
    this.GetItem = function (Index) {
      var Result = null;
      Result = rtl.getObject(this.FList.Get(Index));
      return Result;
    };
    this.SetItem = function (Index, AObject) {
      var O = null;
      if (this.FFreeObjects) {
        O = rtl.getObject(this.FList.Get(Index));
        this.FList.Put(Index,AObject);
        O = rtl.freeLoc(O);
      } else this.FList.Put(Index,AObject);
    };
    this.SetCapacity = function (NewCapacity) {
      this.FList.SetCapacity(NewCapacity);
    };
    this.GetCapacity = function () {
      var Result = 0;
      Result = this.FList.FCapacity;
      return Result;
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FList = pas.Classes.TFPList.$create("Create");
      this.FFreeObjects = true;
      return this;
    };
    this.Create$2 = function (FreeObjects) {
      this.Create$1();
      this.FFreeObjects = FreeObjects;
      return this;
    };
    this.Destroy = function () {
      if (this.FList !== null) {
        this.Clear();
        this.FList.$destroy("Destroy");
      };
      pas.System.TObject.Destroy.call(this);
    };
    this.Clear = function () {
      var i = 0;
      var O = null;
      if (this.FFreeObjects) for (var $l = this.FList.FCount - 1; $l >= 0; $l--) {
        i = $l;
        O = rtl.getObject(this.FList.Get(i));
        this.FList.Put(i,null);
        O = rtl.freeLoc(O);
      };
      this.FList.Clear();
    };
    this.Add = function (AObject) {
      var Result = 0;
      Result = this.FList.Add(AObject);
      return Result;
    };
    this.Delete = function (Index) {
      var O = null;
      if (this.FFreeObjects) {
        O = rtl.getObject(this.FList.Get(Index));
        this.FList.Put(Index,null);
        O = rtl.freeLoc(O);
      };
      this.FList.Delete(Index);
    };
    this.Exchange = function (Index1, Index2) {
      this.FList.Exchange(Index1,Index2);
    };
    this.Expand = function () {
      var Result = null;
      this.FList.Expand();
      Result = this;
      return Result;
    };
    this.Extract = function (Item) {
      var Result = null;
      Result = rtl.getObject(this.FList.Extract(Item));
      return Result;
    };
    this.Remove = function (AObject) {
      var Result = 0;
      var O = null;
      Result = this.IndexOf(AObject);
      if (Result !== -1) {
        if (this.FFreeObjects) {
          O = rtl.getObject(this.FList.Get(Result));
          this.FList.Put(Result,null);
          O = rtl.freeLoc(O);
        };
        this.FList.Delete(Result);
      };
      return Result;
    };
    this.IndexOf = function (AObject) {
      var Result = 0;
      Result = this.FList.IndexOf(AObject);
      return Result;
    };
    this.FindInstanceOf = function (AClass, AExact, AStartAt) {
      var Result = 0;
      var I = 0;
      I = AStartAt;
      Result = -1;
      if (AExact) {
        while ((I < this.GetCount()) && (Result === -1)) if (this.GetItem(I).$class.ClassType() === AClass) {
          Result = I}
         else I += 1}
       else while ((I < this.GetCount()) && (Result === -1)) if (this.GetItem(I).$class.InheritsFrom(AClass)) {
        Result = I}
       else I += 1;
      return Result;
    };
    this.Insert = function (Index, AObject) {
      this.FList.Insert(Index,AObject);
    };
    this.First = function () {
      var Result = null;
      Result = rtl.getObject(this.FList.First());
      return Result;
    };
    this.Last = function () {
      var Result = null;
      Result = rtl.getObject(this.FList.Last());
      return Result;
    };
    this.Move = function (CurIndex, NewIndex) {
      this.FList.Move(CurIndex,NewIndex);
    };
    this.Assign = function (Obj) {
      var i = 0;
      this.Clear();
      for (var $l = 0, $end = Obj.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        this.Add(Obj.GetItem(i));
      };
    };
    this.Pack = function () {
      this.FList.Pack();
    };
    this.Sort = function (Compare) {
      this.FList.Sort(Compare);
    };
    this.ForEachCall = function (proc2call, arg) {
      this.FList.ForEachCall(proc2call,arg);
    };
  });
  rtl.createClass(this,"TObjectList",pas.Classes.TList,function () {
    this.$init = function () {
      pas.Classes.TList.$init.call(this);
      this.FFreeObjects = false;
    };
    this.Notify = function (Ptr, Action) {
      var O = null;
      if (this.FFreeObjects) if (Action === pas.Classes.TListNotification.lnDeleted) {
        O = rtl.getObject(Ptr);
        O = rtl.freeLoc(O);
      };
      pas.Classes.TList.Notify.call(this,Ptr,Action);
    };
    this.GetItem = function (Index) {
      var Result = null;
      Result = rtl.getObject(pas.Classes.TList.Get.call(this,Index));
      return Result;
    };
    this.SetItem = function (Index, AObject) {
      this.Put(Index,AObject);
    };
    this.Create$2 = function () {
      pas.Classes.TList.Create$1.call(this);
      this.FFreeObjects = true;
      return this;
    };
    this.Create$3 = function (FreeObjects) {
      pas.Classes.TList.Create$1.call(this);
      this.FFreeObjects = FreeObjects;
      return this;
    };
    this.Add$1 = function (AObject) {
      var Result = 0;
      Result = pas.Classes.TList.Add.call(this,AObject);
      return Result;
    };
    this.Extract$1 = function (Item) {
      var Result = null;
      Result = rtl.getObject(pas.Classes.TList.Extract.call(this,Item));
      return Result;
    };
    this.Remove$1 = function (AObject) {
      var Result = 0;
      Result = pas.Classes.TList.Remove.call(this,AObject);
      return Result;
    };
    this.IndexOf$1 = function (AObject) {
      var Result = 0;
      Result = pas.Classes.TList.IndexOf.call(this,AObject);
      return Result;
    };
    this.FindInstanceOf = function (AClass, AExact, AStartAt) {
      var Result = 0;
      var I = 0;
      I = AStartAt;
      Result = -1;
      if (AExact) {
        while ((I < this.GetCount()) && (Result === -1)) if (this.GetItem(I).$class.ClassType() === AClass) {
          Result = I}
         else I += 1}
       else while ((I < this.GetCount()) && (Result === -1)) if (this.GetItem(I).$class.InheritsFrom(AClass)) {
        Result = I}
       else I += 1;
      return Result;
    };
    this.Insert$1 = function (Index, AObject) {
      pas.Classes.TList.Insert.call(this,Index,AObject);
    };
    this.First$1 = function () {
      var Result = null;
      Result = rtl.getObject(pas.Classes.TList.First.call(this));
      return Result;
    };
    this.Last$1 = function () {
      var Result = null;
      Result = rtl.getObject(pas.Classes.TList.Last.call(this));
      return Result;
    };
  });
  rtl.createClass(this,"TComponentList",this.TObjectList,function () {
    this.$init = function () {
      $mod.TObjectList.$init.call(this);
      this.FNotifier = null;
    };
    this.$final = function () {
      this.FNotifier = undefined;
      $mod.TObjectList.$final.call(this);
    };
    this.Notify = function (Ptr, Action) {
      if (this.FNotifier === null) {
        this.FNotifier = $impl.TlistComponent.$create("Create$1",[null]);
        this.FNotifier.Flist = this;
      };
      if (pas.System.Assigned(Ptr)) {
        var $with = rtl.getObject(Ptr);
        var $tmp = Action;
        if ($tmp === pas.Classes.TListNotification.lnAdded) {
          $with.FreeNotification(this.FNotifier)}
         else if (($tmp === pas.Classes.TListNotification.lnExtracted) || ($tmp === pas.Classes.TListNotification.lnDeleted)) $with.RemoveFreeNotification(this.FNotifier);
      };
      $mod.TObjectList.Notify.call(this,Ptr,Action);
    };
    this.GetItems = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItems = function (Index, AComponent) {
      this.Put(Index,AComponent);
    };
    this.HandleFreeNotify = function (Sender, AComponent) {
      this.Extract$2(AComponent);
      if (Sender === null) ;
    };
    this.Destroy = function () {
      pas.Classes.TList.Destroy.call(this);
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FNotifier;
        }, set: function (v) {
          this.p.FNotifier = v;
        }});
    };
    this.Add$2 = function (AComponent) {
      var Result = 0;
      Result = $mod.TObjectList.Add$1.call(this,AComponent);
      return Result;
    };
    this.Extract$2 = function (Item) {
      var Result = null;
      Result = $mod.TObjectList.Extract$1.call(this,Item);
      return Result;
    };
    this.Remove$2 = function (AComponent) {
      var Result = 0;
      Result = $mod.TObjectList.Remove$1.call(this,AComponent);
      return Result;
    };
    this.IndexOf$2 = function (AComponent) {
      var Result = 0;
      Result = $mod.TObjectList.IndexOf$1.call(this,AComponent);
      return Result;
    };
    this.First$2 = function () {
      var Result = null;
      Result = $mod.TObjectList.First$1.call(this);
      return Result;
    };
    this.Last$2 = function () {
      var Result = null;
      Result = $mod.TObjectList.Last$1.call(this);
      return Result;
    };
    this.Insert$2 = function (Index, AComponent) {
      $mod.TObjectList.Insert$1.call(this,Index,AComponent);
    };
  });
  rtl.createClass(this,"TClassList",pas.Classes.TList,function () {
    this.GetItems = function (Index) {
      var Result = null;
      Result = rtl.getObject(this.Get(Index));
      return Result;
    };
    this.SetItems = function (Index, AClass) {
      this.Put(Index,AClass);
    };
    this.Add$1 = function (AClass) {
      var Result = 0;
      Result = pas.Classes.TList.Add.call(this,AClass);
      return Result;
    };
    this.Extract$1 = function (Item) {
      var Result = null;
      Result = rtl.getObject(pas.Classes.TList.Extract.call(this,Item));
      return Result;
    };
    this.Remove$1 = function (AClass) {
      var Result = 0;
      Result = pas.Classes.TList.Remove.call(this,AClass);
      return Result;
    };
    this.IndexOf$1 = function (AClass) {
      var Result = 0;
      Result = pas.Classes.TList.IndexOf.call(this,AClass);
      return Result;
    };
    this.First$1 = function () {
      var Result = null;
      Result = rtl.getObject(pas.Classes.TList.First.call(this));
      return Result;
    };
    this.Last$1 = function () {
      var Result = null;
      Result = rtl.getObject(pas.Classes.TList.Last.call(this));
      return Result;
    };
    this.Insert$1 = function (Index, AClass) {
      pas.Classes.TList.Insert.call(this,Index,AClass);
    };
  });
  rtl.createClass(this,"TOrderedList",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FList = null;
    };
    this.$final = function () {
      this.FList = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.PopItem = function () {
      var Result = undefined;
      var $with = this.FList;
      if ($with.GetCount() > 0) {
        Result = $with.Get($with.GetCount() - 1);
        $with.Delete($with.GetCount() - 1);
      } else Result = null;
      return Result;
    };
    this.PeekItem = function () {
      var Result = undefined;
      var $with = this.FList;
      Result = $with.Get($with.GetCount() - 1);
      return Result;
    };
    this.Create$1 = function () {
      this.FList = pas.Classes.TList.$create("Create$1");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FList");
    };
    this.Count = function () {
      var Result = 0;
      Result = this.FList.GetCount();
      return Result;
    };
    this.AtLeast = function (ACount) {
      var Result = false;
      Result = this.FList.GetCount() >= ACount;
      return Result;
    };
    this.Push = function (AItem) {
      var Result = undefined;
      this.PushItem(AItem);
      Result = AItem;
      return Result;
    };
    this.Pop = function () {
      var Result = undefined;
      if (this.AtLeast(1)) {
        Result = this.PopItem()}
       else Result = null;
      return Result;
    };
    this.Peek = function () {
      var Result = undefined;
      if (this.AtLeast(1)) {
        Result = this.PeekItem()}
       else Result = null;
      return Result;
    };
  });
  rtl.createClass(this,"TStack",this.TOrderedList,function () {
    this.PushItem = function (AItem) {
      this.FList.Add(AItem);
    };
  });
  rtl.createClass(this,"TObjectStack",this.TStack,function () {
    this.Push$1 = function (AObject) {
      var Result = null;
      Result = rtl.getObject($mod.TOrderedList.Push.call(this,AObject));
      return Result;
    };
    this.Pop$1 = function () {
      var Result = null;
      Result = rtl.getObject($mod.TOrderedList.Pop.call(this));
      return Result;
    };
    this.Peek$1 = function () {
      var Result = null;
      Result = rtl.getObject($mod.TOrderedList.Peek.call(this));
      return Result;
    };
  });
  rtl.createClass(this,"TQueue",this.TOrderedList,function () {
    this.PushItem = function (AItem) {
      var $with = this.FList;
      $with.Insert(0,AItem);
    };
  });
  rtl.createClass(this,"TObjectQueue",this.TQueue,function () {
    this.Push$1 = function (AObject) {
      var Result = null;
      Result = rtl.getObject($mod.TOrderedList.Push.call(this,AObject));
      return Result;
    };
    this.Pop$1 = function () {
      var Result = null;
      Result = rtl.getObject($mod.TOrderedList.Pop.call(this));
      return Result;
    };
    this.Peek$1 = function () {
      var Result = null;
      Result = rtl.getObject($mod.TOrderedList.Peek.call(this));
      return Result;
    };
  });
  this.$rtti.$ProcVar("THashFunction",{procsig: rtl.newTIProcSig([["S",rtl.string,2],["TableSize",rtl.longword,2]],rtl.longword)});
  rtl.createClass(this,"THTCustomNode",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FKey = "";
    };
    this.CreateWith = function (AString) {
      pas.System.TObject.Create.call(this);
      this.FKey = AString;
      return this;
    };
    this.HasKey = function (AKey) {
      var Result = false;
      Result = AKey === this.FKey;
      return Result;
    };
  });
  this.$rtti.$ClassRef("THTCustomNodeClass",{instancetype: this.$rtti["THTCustomNode"]});
  rtl.createClass(this,"TFPCustomHashTable",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FHashTable = null;
      this.FHashFunction = null;
      this.FCount = 0;
      this.FHashTableSize = 0;
    };
    this.$final = function () {
      this.FHashTable = undefined;
      this.FHashFunction = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.GetDensity = function () {
      var Result = 0;
      Result = this.FHashTableSize - this.GetVoidSlots();
      return Result;
    };
    this.GetNumberOfCollisions = function () {
      var Result = 0;
      Result = this.FCount - (this.FHashTableSize - this.GetVoidSlots());
      return Result;
    };
    this.SetHashTableSize = function (Value) {
      var i = 0;
      var newSize = 0;
      if (Value !== this.FHashTableSize) {
        i = 0;
        while (($impl.PRIMELIST[i] < Value) && (i < 27)) i += 1;
        newSize = $impl.PRIMELIST[i];
        if (this.FCount === 0) {
          this.FHashTableSize = newSize;
          this.InitializeHashTable();
        } else this.ChangeTableSize(newSize);
      };
    };
    this.InitializeHashTable = function () {
      var i = 0;
      if (this.FHashTableSize > 0) for (var $l = 0, $end = this.FHashTableSize - 1; $l <= $end; $l++) {
        i = $l;
        this.FHashTable.Add(null);
      };
      this.FCount = 0;
    };
    this.GetVoidSlots = function () {
      var Result = 0;
      var i = 0;
      var num = 0;
      num = 0;
      if (this.FHashTableSize > 0) for (var $l = 0, $end = this.FHashTableSize - 1; $l <= $end; $l++) {
        i = $l;
        if (!(this.Chain(i) != null)) num += 1;
      };
      Result = num;
      return Result;
    };
    this.GetLoadFactor = function () {
      var Result = 0.0;
      Result = this.FCount / this.FHashTableSize;
      return Result;
    };
    this.GetAVGChainLen = function () {
      var Result = 0.0;
      Result = this.FCount / (this.FHashTableSize - this.GetVoidSlots());
      return Result;
    };
    this.GetMaxChainLength = function () {
      var Result = 0;
      var i = 0;
      Result = 0;
      if (this.FHashTableSize > 0) for (var $l = 0, $end = this.FHashTableSize - 1; $l <= $end; $l++) {
        i = $l;
        if (this.ChainLength(i) > Result) Result = this.ChainLength(i);
      };
      return Result;
    };
    this.Chain = function (index) {
      var Result = null;
      Result = this.FHashTable.GetItem(index);
      return Result;
    };
    this.ChainLength = function (ChainIndex) {
      var Result = 0;
      if (this.Chain(ChainIndex) != null) {
        Result = this.Chain(ChainIndex).GetCount()}
       else Result = 0;
      return Result;
    };
    this.FindOrCreateNew = function (aKey) {
      var Result = null;
      var hashCode = 0;
      var chn = null;
      var i = 0;
      hashCode = this.FHashFunction(aKey,this.FHashTableSize);
      chn = this.Chain(hashCode);
      if (chn != null) {
        if (chn.GetCount() > 0) for (var $l = 0, $end = chn.GetCount() - 1; $l <= $end; $l++) {
          i = $l;
          if (chn.GetItem(i).FKey === aKey) return chn.GetItem(i);
        };
      } else {
        this.FHashTable.SetItem(hashCode,$mod.TFPObjectList.$create("Create$2",[true]));
        chn = this.Chain(hashCode);
      };
      this.FCount += 1;
      Result = this.CreateNewNode(aKey);
      chn.Add(Result);
      return Result;
    };
    this.SetHashFunction = function (AHashFunction) {
      if (this.IsEmpty()) {
        this.FHashFunction = AHashFunction}
       else throw pas.SysUtils.Exception.$create("Create$1",[rtl.getResStr($mod,"NotEmptyMsg")]);
    };
    this.FindChainForAdd = function (aKey) {
      var Result = null;
      var hashCode = 0;
      var i = 0;
      hashCode = this.FHashFunction(aKey,this.FHashTableSize);
      Result = this.Chain(hashCode);
      if (Result != null) {
        if (Result.GetCount() > 0) for (var $l = 0, $end = Result.GetCount() - 1; $l <= $end; $l++) {
          i = $l;
          if (Result.GetItem(i).FKey === aKey) throw $mod.EDuplicate.$create("CreateFmt",[rtl.getResStr($mod,"DuplicateMsg"),pas.System.VarRecs(18,aKey)]);
        };
      } else {
        this.FHashTable.SetItem(hashCode,$mod.TFPObjectList.$create("Create$2",[true]));
        Result = this.Chain(hashCode);
      };
      this.FCount += 1;
      return Result;
    };
    this.Create$1 = function () {
      this.CreateWith(196613,$mod.RSHash);
      return this;
    };
    this.CreateWith = function (AHashTableSize, aHashFunc) {
      pas.System.TObject.Create.call(this);
      this.FHashTable = $mod.TFPObjectList.$create("Create$2",[true]);
      this.SetHashTableSize(AHashTableSize);
      this.FHashFunction = aHashFunc;
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FHashTable");
      pas.System.TObject.Destroy.call(this);
    };
    this.ChangeTableSize = function (ANewSize) {
      var SavedTable = null;
      var List = null;
      var SavedTableSize = 0;
      var i = 0;
      var j = 0;
      var temp = null;
      SavedTable = this.FHashTable;
      SavedTableSize = this.FHashTableSize;
      this.FHashTableSize = ANewSize;
      this.FHashTable = $mod.TFPObjectList.$create("Create$2",[true]);
      this.InitializeHashTable();
      if (SavedTableSize > 0) for (var $l = 0, $end = SavedTableSize - 1; $l <= $end; $l++) {
        i = $l;
        List = SavedTable.GetItem(i);
        if (List != null) for (var $l1 = 0, $end1 = List.GetCount() - 1; $l1 <= $end1; $l1++) {
          j = $l1;
          temp = List.GetItem(j);
          this.AddNode(temp);
        };
      };
      SavedTable = rtl.freeLoc(SavedTable);
    };
    this.Clear = function () {
      var i = 0;
      if (this.FHashTableSize > 0) for (var $l = 0, $end = this.FHashTableSize - 1; $l <= $end; $l++) {
        i = $l;
        if (this.Chain(i) != null) this.Chain(i).Clear();
      };
      this.FCount = 0;
    };
    this.Delete = function (aKey) {
      var hashCode = 0;
      var chn = null;
      var i = 0;
      hashCode = this.FHashFunction(aKey,this.FHashTableSize);
      chn = this.Chain(hashCode);
      if (chn != null) if (chn.GetCount() > 0) for (var $l = 0, $end = chn.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (chn.GetItem(i).FKey === aKey) {
          chn.Delete(i);
          this.FCount -= 1;
          return;
        };
      };
    };
    this.Find = function (aKey) {
      var Result = null;
      var hashCode = 0;
      var chn = null;
      var i = 0;
      hashCode = this.FHashFunction(aKey,this.FHashTableSize);
      chn = this.Chain(hashCode);
      if (chn != null) if (chn.GetCount() > 0) for (var $l = 0, $end = chn.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (chn.GetItem(i).FKey === aKey) return chn.GetItem(i);
      };
      Result = null;
      return Result;
    };
    this.IsEmpty = function () {
      var Result = false;
      Result = this.FCount === 0;
      return Result;
    };
  });
  rtl.createClass(this,"THTDataNode",this.THTCustomNode,function () {
    this.$init = function () {
      $mod.THTCustomNode.$init.call(this);
      this.FData = undefined;
    };
  });
  this.$rtti.$MethodVar("TDataIteratorMethod",{procsig: rtl.newTIProcSig([["Item",rtl.jsvalue],["Key",rtl.string,2],["Continue",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$ProcVar("TDataIteratorCallBack",{procsig: rtl.newTIProcSig([["Item",rtl.jsvalue],["Key",rtl.string,2],["Continue",rtl.boolean,1]])});
  rtl.createClass(this,"TFPDataHashTable",this.TFPCustomHashTable,function () {
    this.$init = function () {
      $mod.TFPCustomHashTable.$init.call(this);
      this.FIteratorCallBack = null;
    };
    this.$final = function () {
      this.FIteratorCallBack = undefined;
      $mod.TFPCustomHashTable.$final.call(this);
    };
    this.CallbackIterator = function (Item, Key, Continue) {
      this.FIteratorCallBack(Item,Key,Continue);
    };
    this.CreateNewNode = function (aKey) {
      var Result = null;
      Result = $mod.THTDataNode.$create("CreateWith",[aKey]);
      return Result;
    };
    this.AddNode = function (ANode) {
      this.Add(ANode.FKey,ANode.FData);
    };
    this.SetData = function (index, AValue) {
      this.FindOrCreateNew(index).FData = AValue;
    };
    this.GetData = function (index) {
      var Result = undefined;
      var node = null;
      node = this.Find(index);
      if (node != null) {
        Result = node.FData}
       else Result = null;
      return Result;
    };
    this.ForEachCall = function (aMethod) {
      var Result = null;
      var i = 0;
      var j = 0;
      var continue_ = false;
      Result = null;
      continue_ = true;
      if (this.FHashTableSize > 0) for (var $l = 0, $end = this.FHashTableSize - 1; $l <= $end; $l++) {
        i = $l;
        if (this.Chain(i) != null) if (this.Chain(i).GetCount() > 0) for (var $l1 = 0, $end1 = this.Chain(i).GetCount() - 1; $l1 <= $end1; $l1++) {
          j = $l1;
          aMethod(this.Chain(i).GetItem(j).FData,this.Chain(i).GetItem(j).FKey,{get: function () {
              return continue_;
            }, set: function (v) {
              continue_ = v;
            }});
          if (!continue_) {
            Result = this.Chain(i).GetItem(j);
            return Result;
          };
        };
      };
      return Result;
    };
    this.Iterate = function (aMethod) {
      var Result = undefined;
      var N = null;
      N = this.ForEachCall(aMethod);
      if (N != null) {
        Result = N.FData}
       else Result = null;
      return Result;
    };
    this.Iterate$1 = function (aMethod) {
      var Result = undefined;
      this.FIteratorCallBack = aMethod;
      Result = this.Iterate(rtl.createCallback(this,"CallbackIterator"));
      return Result;
    };
    this.Add = function (aKey, AItem) {
      var chn = null;
      var NewNode = null;
      chn = this.FindChainForAdd(aKey);
      NewNode = this.CreateNewNode(aKey);
      NewNode.FData = AItem;
      chn.Add(NewNode);
    };
  });
  rtl.createClass(this,"THTStringNode",this.THTCustomNode,function () {
    this.$init = function () {
      $mod.THTCustomNode.$init.call(this);
      this.FData = "";
    };
  });
  this.$rtti.$MethodVar("TStringIteratorMethod",{procsig: rtl.newTIProcSig([["Item",rtl.string],["Key",rtl.string,2],["Continue",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$ProcVar("TStringIteratorCallback",{procsig: rtl.newTIProcSig([["Item",rtl.string],["Key",rtl.string,2],["Continue",rtl.boolean,1]])});
  rtl.createClass(this,"TFPStringHashTable",this.TFPCustomHashTable,function () {
    this.$init = function () {
      $mod.TFPCustomHashTable.$init.call(this);
      this.FIteratorCallBack = null;
    };
    this.$final = function () {
      this.FIteratorCallBack = undefined;
      $mod.TFPCustomHashTable.$final.call(this);
    };
    this.CallbackIterator = function (Item, Key, Continue) {
      this.FIteratorCallBack(Item,Key,Continue);
    };
    this.CreateNewNode = function (aKey) {
      var Result = null;
      Result = $mod.THTStringNode.$create("CreateWith",[aKey]);
      return Result;
    };
    this.AddNode = function (ANode) {
      this.Add(ANode.FKey,ANode.FData);
    };
    this.SetData = function (Index, AValue) {
      this.FindOrCreateNew(Index).FData = AValue;
    };
    this.GetData = function (index) {
      var Result = "";
      var node = null;
      node = this.Find(index);
      if (node != null) {
        Result = node.FData}
       else Result = "";
      return Result;
    };
    this.ForEachCall = function (aMethod) {
      var Result = null;
      var i = 0;
      var j = 0;
      var continue_ = false;
      Result = null;
      continue_ = true;
      if (this.FHashTableSize > 0) for (var $l = 0, $end = this.FHashTableSize - 1; $l <= $end; $l++) {
        i = $l;
        if (this.Chain(i) != null) if (this.Chain(i).GetCount() > 0) for (var $l1 = 0, $end1 = this.Chain(i).GetCount() - 1; $l1 <= $end1; $l1++) {
          j = $l1;
          aMethod(this.Chain(i).GetItem(j).FData,this.Chain(i).GetItem(j).FKey,{get: function () {
              return continue_;
            }, set: function (v) {
              continue_ = v;
            }});
          if (!continue_) {
            Result = this.Chain(i).GetItem(j);
            return Result;
          };
        };
      };
      return Result;
    };
    this.Iterate = function (aMethod) {
      var Result = "";
      var N = null;
      N = this.ForEachCall(aMethod);
      if (N != null) {
        Result = N.FData}
       else Result = "";
      return Result;
    };
    this.Iterate$1 = function (aMethod) {
      var Result = "";
      this.FIteratorCallBack = aMethod;
      Result = this.Iterate(rtl.createCallback(this,"CallbackIterator"));
      return Result;
    };
    this.Add = function (aKey, aItem) {
      var chn = null;
      var NewNode = null;
      chn = this.FindChainForAdd(aKey);
      NewNode = this.CreateNewNode(aKey);
      NewNode.FData = aItem;
      chn.Add(NewNode);
    };
  });
  rtl.createClass(this,"THTObjectNode",this.THTCustomNode,function () {
    this.$init = function () {
      $mod.THTCustomNode.$init.call(this);
      this.FData = null;
    };
    this.$final = function () {
      this.FData = undefined;
      $mod.THTCustomNode.$final.call(this);
    };
  });
  rtl.createClass(this,"THTOwnedObjectNode",this.THTObjectNode,function () {
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FData;
        }, set: function (v) {
          this.p.FData = v;
        }});
      pas.System.TObject.Destroy.call(this);
    };
  });
  this.$rtti.$MethodVar("TObjectIteratorMethod",{procsig: rtl.newTIProcSig([["Item",pas.System.$rtti["TObject"]],["Key",rtl.string,2],["Continue",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$ProcVar("TObjectIteratorCallback",{procsig: rtl.newTIProcSig([["Item",pas.System.$rtti["TObject"]],["Key",rtl.string,2],["Continue",rtl.boolean,1]])});
  rtl.createClass(this,"TFPObjectHashTable",this.TFPCustomHashTable,function () {
    this.$init = function () {
      $mod.TFPCustomHashTable.$init.call(this);
      this.FOwnsObjects = false;
      this.FIteratorCallBack = null;
    };
    this.$final = function () {
      this.FIteratorCallBack = undefined;
      $mod.TFPCustomHashTable.$final.call(this);
    };
    this.CallbackIterator = function (Item, Key, Continue) {
      this.FIteratorCallBack(Item,Key,Continue);
    };
    this.CreateNewNode = function (aKey) {
      var Result = null;
      if (this.FOwnsObjects) {
        Result = $mod.THTOwnedObjectNode.$create("CreateWith",[aKey])}
       else Result = $mod.THTObjectNode.$create("CreateWith",[aKey]);
      return Result;
    };
    this.AddNode = function (ANode) {
      this.Add(ANode.FKey,ANode.FData);
    };
    this.SetData = function (Index, AObject) {
      this.FindOrCreateNew(Index).FData = AObject;
    };
    this.GetData = function (index) {
      var Result = null;
      var node = null;
      node = this.Find(index);
      if (node != null) {
        Result = node.FData}
       else Result = null;
      return Result;
    };
    this.ForEachCall = function (aMethod) {
      var Result = null;
      var i = 0;
      var j = 0;
      var continue_ = false;
      Result = null;
      continue_ = true;
      if (this.FHashTableSize > 0) for (var $l = 0, $end = this.FHashTableSize - 1; $l <= $end; $l++) {
        i = $l;
        if (this.Chain(i) != null) if (this.Chain(i).GetCount() > 0) for (var $l1 = 0, $end1 = this.Chain(i).GetCount() - 1; $l1 <= $end1; $l1++) {
          j = $l1;
          aMethod(this.Chain(i).GetItem(j).FData,this.Chain(i).GetItem(j).FKey,{get: function () {
              return continue_;
            }, set: function (v) {
              continue_ = v;
            }});
          if (!continue_) {
            Result = this.Chain(i).GetItem(j);
            return Result;
          };
        };
      };
      return Result;
    };
    this.Create$2 = function (AOwnsObjects) {
      $mod.TFPCustomHashTable.Create$1.call(this);
      this.FOwnsObjects = AOwnsObjects;
      return this;
    };
    this.CreateWith$1 = function (AHashTableSize, aHashFunc, AOwnsObjects) {
      $mod.TFPCustomHashTable.CreateWith.call(this,AHashTableSize,aHashFunc);
      this.FOwnsObjects = AOwnsObjects;
      return this;
    };
    this.Iterate = function (aMethod) {
      var Result = null;
      var N = null;
      N = this.ForEachCall(aMethod);
      if (N != null) {
        Result = N.FData}
       else Result = null;
      return Result;
    };
    this.Iterate$1 = function (aMethod) {
      var Result = null;
      this.FIteratorCallBack = aMethod;
      Result = this.Iterate(rtl.createCallback(this,"CallbackIterator"));
      return Result;
    };
    this.Add = function (aKey, AItem) {
      var chn = null;
      var NewNode = null;
      chn = this.FindChainForAdd(aKey);
      NewNode = this.CreateNewNode(aKey);
      NewNode.FData = AItem;
      chn.Add(NewNode);
    };
  });
  rtl.createClass(this,"EDuplicate",pas.SysUtils.Exception,function () {
  });
  rtl.createClass(this,"EKeyNotFound",pas.SysUtils.Exception,function () {
  });
  var b = 378551;
  this.RSHash = function (S, TableSize) {
    var Result = 0;
    var a = 0;
    var i = 0;
    a = 63689;
    Result = 0;
    if (S.length > 0) for (var $l = 1, $end = S.length; $l <= $end; $l++) {
      i = $l;
      Result = (Result * a) + S.charCodeAt(i - 1);
      a = a * 378551;
    };
    Result = rtl.lw(Result & 0x7FFFFFFF) % TableSize;
    return Result;
  };
  rtl.recNewT(this,"TBucketItem",function () {
    this.Item = undefined;
    this.Data = undefined;
    this.$eq = function (b) {
      return (this.Item === b.Item) && (this.Data === b.Data);
    };
    this.$assign = function (s) {
      this.Item = s.Item;
      this.Data = s.Data;
      return this;
    };
    var $r = $mod.$rtti.$Record("TBucketItem",{},this);
    $r.addField("Item",rtl.jsvalue);
    $r.addField("Data",rtl.jsvalue);
  });
  this.$rtti.$DynArray("TBucketItemArray",{eltype: this.$rtti["TBucketItem"]});
  rtl.recNewT(this,"TBucket",function () {
    this.Count = 0;
    this.$new = function () {
      var r = Object.create(this);
      r.Items = [];
      return r;
    };
    this.$eq = function (b) {
      return (this.Count === b.Count) && (this.Items === b.Items);
    };
    this.$assign = function (s) {
      this.Count = s.Count;
      this.Items = rtl.arrayRef(s.Items);
      return this;
    };
    var $r = $mod.$rtti.$Record("TBucket",{},this);
    $r.addField("Count",rtl.longint);
    $r.addField("Items",$mod.$rtti["TBucketItemArray"]);
  });
  this.$rtti.$DynArray("TBucketArray",{eltype: this.$rtti["TBucket"]});
  this.$rtti.$RefToProcVar("TBucketProc",{procsig: rtl.newTIProcSig([["AInfo",rtl.jsvalue],["AItem",rtl.jsvalue],["AData",rtl.jsvalue],["AContinue",rtl.boolean,4]])});
  rtl.createClass(this,"TCustomBucketList",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FBuckets = [];
    };
    this.$final = function () {
      this.FBuckets = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.GetBucketCount = function () {
      var Result = 0;
      Result = rtl.length(this.FBuckets);
      return Result;
    };
    this.GetData = function (AItem) {
      var Result = undefined;
      var B = 0;
      var I = 0;
      this.GetBucketItem(AItem,{get: function () {
          return B;
        }, set: function (v) {
          B = v;
        }},{get: function () {
          return I;
        }, set: function (v) {
          I = v;
        }});
      Result = this.FBuckets[B].Items[I].Data;
      return Result;
    };
    this.SetData = function (AItem, AData) {
      var B = 0;
      var I = 0;
      this.GetBucketItem(AItem,{get: function () {
          return B;
        }, set: function (v) {
          B = v;
        }},{get: function () {
          return I;
        }, set: function (v) {
          I = v;
        }});
      this.FBuckets[B].Items[I].Data = AData;
    };
    this.SetBucketCount = function (Value) {
      if (Value !== this.GetBucketCount()) this.FBuckets = rtl.arraySetLength(this.FBuckets,$mod.TBucket,Value);
    };
    this.GetBucketItem = function (AItem, ABucket, AIndex) {
      if (!this.FindItem(AItem,ABucket,AIndex)) this.Error(rtl.getResStr($mod,"SErrNoSuchItem"),pas.System.VarRecs(20,AItem));
    };
    this.AddItem = function (ABucket, AItem, AData) {
      var Result = undefined;
      var L = 0;
      L = rtl.length(this.FBuckets[ABucket].Items);
      if (this.FBuckets[ABucket].Count === L) {
        if (L < 8) {
          L = 8}
         else L = L + rtl.trunc(L / 2);
        this.FBuckets[ABucket].Items = rtl.arraySetLength(this.FBuckets[ABucket].Items,$mod.TBucketItem,L);
      };
      var $with = this.FBuckets[ABucket];
      $with.Items[$with.Count].Item = AItem;
      $with.Items[$with.Count].Data = AData;
      Result = AData;
      $with.Count += 1;
      return Result;
    };
    this.DeleteItem = function (ABucket, AIndex) {
      var Result = undefined;
      var I = 0;
      var L = 0;
      Result = this.FBuckets[ABucket].Items[AIndex].Data;
      if (this.FBuckets[ABucket].Count === 1) {
        this.FBuckets[ABucket].Items = rtl.arraySetLength(this.FBuckets[ABucket].Items,$mod.TBucketItem,0)}
       else {
        L = this.FBuckets[ABucket].Count - AIndex - 1;
        for (var $l = 0, $end = L - 1; $l <= $end; $l++) {
          I = $l;
          this.FBuckets[ABucket].Items[AIndex + I].$assign(this.FBuckets[ABucket].Items[AIndex + I + 1]);
        };
      };
      this.FBuckets[ABucket].Count -= 1;
      return Result;
    };
    this.Error = function (Msg, Args) {
      throw pas.Classes.EListError.$create("CreateFmt",[Msg,Args]);
    };
    this.FindItem = function (AItem, ABucket, AIndex) {
      var Result = false;
      var I = 0;
      var B = $mod.TBucket.$new();
      ABucket.set(this.BucketFor(AItem));
      B.$assign(this.FBuckets[ABucket.get()]);
      I = B.Count - 1;
      while ((I >= 0) && (B.Items[I].Item != AItem)) I -= 1;
      Result = I >= 0;
      if (Result) AIndex.set(I);
      return Result;
    };
    this.Destroy = function () {
      this.Clear();
      pas.System.TObject.Destroy.call(this);
    };
    this.Clear = function () {
      var B = $mod.TBucket.$new();
      var I = 0;
      var J = 0;
      for (var $l = 0, $end = rtl.length(this.FBuckets) - 1; $l <= $end; $l++) {
        I = $l;
        B.$assign(this.FBuckets[I]);
        for (var $l1 = B.Count - 1; $l1 >= 0; $l1--) {
          J = $l1;
          this.DeleteItem(I,J);
        };
      };
      this.FBuckets = rtl.arraySetLength(this.FBuckets,$mod.TBucket,0);
    };
    this.Add = function (AItem, AData) {
      var Result = undefined;
      var B = 0;
      var I = 0;
      if (this.FindItem(AItem,{get: function () {
          return B;
        }, set: function (v) {
          B = v;
        }},{get: function () {
          return I;
        }, set: function (v) {
          I = v;
        }})) this.Error(rtl.getResStr($mod,"SDuplicateItem"),pas.System.VarRecs(20,AItem));
      Result = this.AddItem(B,AItem,AData);
      return Result;
    };
    this.Assign = function (AList) {
      var I = 0;
      var J = 0;
      this.Clear();
      this.FBuckets = rtl.arraySetLength(this.FBuckets,$mod.TBucket,rtl.length(AList.FBuckets));
      for (var $l = 0, $end = this.GetBucketCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.FBuckets[I].Items = rtl.arraySetLength(this.FBuckets[I].Items,$mod.TBucketItem,rtl.length(AList.FBuckets[I].Items));
        for (var $l1 = 0, $end1 = AList.FBuckets[I].Count - 1; $l1 <= $end1; $l1++) {
          J = $l1;
          var $with = AList.FBuckets[I].Items[J];
          this.AddItem(I,$with.Item,$with.Data);
        };
      };
    };
    this.Exists = function (AItem) {
      var Result = false;
      var B = 0;
      var I = 0;
      Result = this.FindItem(AItem,{get: function () {
          return B;
        }, set: function (v) {
          B = v;
        }},{get: function () {
          return I;
        }, set: function (v) {
          I = v;
        }});
      return Result;
    };
    this.Find = function (AItem, AData) {
      var Result = false;
      var B = 0;
      var I = 0;
      Result = this.FindItem(AItem,{get: function () {
          return B;
        }, set: function (v) {
          B = v;
        }},{get: function () {
          return I;
        }, set: function (v) {
          I = v;
        }});
      if (Result) AData.set(this.FBuckets[B].Items[I].Data);
      return Result;
    };
    this.ForEach = function (AProc, AInfo) {
      var Result = false;
      var I = 0;
      var J = 0;
      var S = 0;
      var Bu = $mod.TBucket.$new();
      I = 0;
      Result = true;
      S = this.GetBucketCount();
      while (Result && (I < S)) {
        J = 0;
        Bu.$assign(this.FBuckets[I]);
        while (Result && (J < Bu.Count)) {
          var $with = Bu.Items[J];
          AProc(AInfo,$with.Item,$with.Data,{get: function () {
              return Result;
            }, set: function (v) {
              Result = v;
            }});
          J += 1;
        };
        I += 1;
      };
      return Result;
    };
    this.ForEach$1 = function (AProc) {
      var Result = false;
      Result = this.ForEach(AProc,null);
      return Result;
    };
    this.Remove = function (AItem) {
      var Result = undefined;
      var B = 0;
      var I = 0;
      if (this.FindItem(AItem,{get: function () {
          return B;
        }, set: function (v) {
          B = v;
        }},{get: function () {
          return I;
        }, set: function (v) {
          I = v;
        }})) {
        Result = this.FBuckets[B].Items[I].Data;
        this.DeleteItem(B,I);
      } else Result = null;
      return Result;
    };
  });
  this.TBucketListSizes = {"0": "bl2", bl2: 0, "1": "bl4", bl4: 1, "2": "bl8", bl8: 2, "3": "bl16", bl16: 3, "4": "bl32", bl32: 4, "5": "bl64", bl64: 5, "6": "bl128", bl128: 6, "7": "bl256", bl256: 7};
  this.$rtti.$Enum("TBucketListSizes",{minvalue: 0, maxvalue: 7, ordtype: 1, enumtype: this.TBucketListSizes});
  rtl.createClass(this,"TBucketList",this.TCustomBucketList,function () {
    this.$init = function () {
      $mod.TCustomBucketList.$init.call(this);
      this.FBucketMask = 0;
    };
    this.BucketFor = function (AItem) {
      var Result = 0;
      Result = rtl.lw(rtl.lw(rtl.trunc(AItem) >>> 2) & this.FBucketMask);
      return Result;
    };
    this.Create$1 = function (ABuckets) {
      var L = 0;
      pas.System.TObject.Create.call(this);
      L = 1 << (ABuckets + 1);
      this.SetBucketCount(L);
      this.FBucketMask = L - 1;
      return this;
    };
  });
  rtl.createClass(this,"TObjectBucketList",this.TBucketList,function () {
    this.GetData$1 = function (AItem) {
      var Result = null;
      Result = rtl.getObject($mod.TCustomBucketList.GetData.call(this,AItem));
      return Result;
    };
    this.SetData$1 = function (AItem, AData) {
      $mod.TCustomBucketList.SetData.call(this,AItem,AData);
    };
    this.Add$1 = function (AItem, AData) {
      var Result = null;
      Result = rtl.getObject($mod.TCustomBucketList.Add.call(this,AItem,AData));
      return Result;
    };
    this.Remove$1 = function (AItem) {
      var Result = null;
      Result = rtl.getObject($mod.TCustomBucketList.Remove.call(this,AItem));
      return Result;
    };
  });
  $mod.$implcode = function () {
    $impl.NPRIMES = 28;
    $mod.$rtti.$StaticArray("PRIMELIST$a",{dims: [28], eltype: rtl.longword});
    $impl.PRIMELIST = [53,97,193,389,769,1543,3079,6151,12289,24593,49157,98317,196613,393241,786433,1572869,3145739,6291469,12582917,25165843,50331653,100663319,201326611,402653189,805306457,1610612741,3221225473,4294967291];
    rtl.createClass($impl,"TlistComponent",pas.Classes.TComponent,function () {
      this.$init = function () {
        pas.Classes.TComponent.$init.call(this);
        this.Flist = null;
      };
      this.$final = function () {
        this.Flist = undefined;
        pas.Classes.TComponent.$final.call(this);
      };
      this.Notification = function (AComponent, Operation) {
        if (Operation === pas.Classes.TOperation.opRemove) this.Flist.HandleFreeNotify(this,AComponent);
        pas.Classes.TComponent.Notification.apply(this,arguments);
      };
      rtl.addIntf(this,pas.System.IUnknown);
    });
    $mod.$resourcestrings = {DuplicateMsg: {org: "An item with key %0:s already exists"}, NotEmptyMsg: {org: "Hash table not empty."}, SErrNoSuchItem: {org: "No item in list for %p"}, SDuplicateItem: {org: "Item already exists in list: %p"}};
  };
},["JS"]);
rtl.module("WEBLib.Graphics",["System","Classes","Types","UITypes","Web","JS"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.WEBDEFAULTFONT = "Arial";
  this.SysDefault = 0x20000000;
  this.clNone = -1;
  this.clBlack = 0x0;
  this.clMaroon = 0x80;
  this.clGreen = 0x8000;
  this.clOlive = 0x8080;
  this.clNavy = 0x800000;
  this.clPurple = 0x800080;
  this.clTeal = 0x808000;
  this.clGray = 0x808080;
  this.clSilver = 0xC0C0C0;
  this.clRed = 0xFF;
  this.clLime = 0xFF00;
  this.clYellow = 0xFFFF;
  this.clBlue = 0xFF0000;
  this.clFuchsia = 0xFF00FF;
  this.clAqua = 0xFFFF00;
  this.clLtGray = 0xC1C1C1;
  this.clDkGray = 0x818181;
  this.clWhite = 0xFFFFFF;
  this.clMoneyGreen = 0xC0DCC0;
  this.clSkyBlue = 0xF0CAA6;
  this.clCream = 0xF0FBFF;
  this.clMedGray = 0xA0A0A0;
  this.clDefault = 536870912;
  this.clBtnFace = 0xF0F0F0;
  this.clWindowText = 0x10101;
  this.clWindow = 0xFEFEFE;
  this.clHighlight = 0xD77800;
  this.clHighlightText = 0x30303;
  this.clInfoText = 0x20202;
  this.clInfoBk = 0xE1FFFF;
  this.clActiveCaption = 0xD1B499;
  this.clInactiveCaption = 0xDBCDBF;
  this.clInactiveCaptionText = 0x0;
  this.clHotLight = 0xCC6600;
  this.clScrollBar = 0xC8C8C8;
  this.clBackground = 15790320;
  this.clMenu = 15790320;
  this.clWindowFrame = 0x646464;
  this.clMenuText = 0;
  this.clCaptionText = 16777215;
  this.clActiveBorder = 0xB4B4B4;
  this.clAppWorkSpace = 0xABABAB;
  this.clBtnShadow = 0xA0A0A0;
  this.clGrayText = 0x6D6D6D;
  this.clBtnText = 0;
  this.clBtnHighlight = 16777215;
  this.cl3DDkShadow = 0x696969;
  this.cl3DLight = 0xE3E3E3;
  this.clMenuHighlight = 0xD77800;
  this.clMenuBar = 0xF0F0F0;
  this.clWebAliceblue = 0xFFF8F0;
  this.clWebAntiquewhite = 0xD7EBFA;
  this.clWebAqua = 0xFFFF00;
  this.clWebAquamarine = 0xD4FF7F;
  this.clWebAzure = 0xFFFFF0;
  this.clWebBeige = 0xDCF5F5;
  this.clWebBisque = 0xC4E4FF;
  this.clWebBlack = 0x0;
  this.clWebBlanchedalmond = 0xCDEBFF;
  this.clWebBlue = 0xFF0000;
  this.clWebBlueviolet = 0xE22B8A;
  this.clWebBrown = 0x2A2AA5;
  this.clWebBurlywood = 0x87B8DE;
  this.clWebCadetblue = 0xA09E5F;
  this.clWebChartreuse = 0xFF7F;
  this.clWebChocolate = 0x1E69D2;
  this.clWebCoral = 0x507FFF;
  this.clWebCornflowerblue = 0xED9564;
  this.clWebCornsilk = 0xDCF8FF;
  this.clWebCrimson = 0x3C14DC;
  this.clWebCyan = 0xFFFF00;
  this.clWebDarkblue = 0x8B0000;
  this.clWebDarkcyan = 0x8B8B00;
  this.clWebDarkgoldenrod = 0xB86B8;
  this.clWebDarkgray = 0xA9A9A9;
  this.clWebDarkgreen = 0x6400;
  this.clWebDarkgrey = 0xA9A9A9;
  this.clWebDarkkhaki = 0x6BB7BD;
  this.clWebDarkmagenta = 0x8B008B;
  this.clWebDarkolivegreen = 0x2F6B55;
  this.clWebDarkorange = 0x8CFF;
  this.clWebDarkorchid = 0xCC3299;
  this.clWebDarkred = 0x8B;
  this.clWebDarksalmon = 0x7A96E9;
  this.clWebDarkseagreen = 0x8FBC8F;
  this.clWebDarkslateblue = 0x8B3D48;
  this.clWebDarkslategray = 0x4F4F2F;
  this.clWebDarkslategrey = 0x4F4F2F;
  this.clWebDarkturquoise = 0xD1CE00;
  this.clWebDarkviolet = 0xD30094;
  this.clWebDeeppink = 0x9314FF;
  this.clWebDeepskyblue = 0xFFBF00;
  this.clWebDimgray = 0x696969;
  this.clWebDimgrey = 0x696969;
  this.clWebDodgerblue = 0xFF901E;
  this.clWebFirebrick = 0x2222B2;
  this.clWebFloralwhite = 0xF0FAFF;
  this.clWebForestgreen = 0x228B22;
  this.clWebFuchsia = 0xFF00FF;
  this.clWebGainsboro = 0xDCDCDC;
  this.clWebGhostwhite = 0xFFF8F8;
  this.clWebGold = 0xD7FF;
  this.clWebGoldenrod = 0x20A5DA;
  this.clWebGray = 0x808080;
  this.clWebGreen = 0x8000;
  this.clWebGreenyellow = 0x2FFFAD;
  this.clWebGrey = 0x808080;
  this.clWebHoneydew = 0xF0FFF0;
  this.clWebHotpink = 0xB469FF;
  this.clWebIndianred = 0x5C5CCD;
  this.clWebIndigo = 0x82004B;
  this.clWebIvory = 0xF0FFFF;
  this.clWebKhaki = 0x8CE6F0;
  this.clWebLavender = 0xFAE6E6;
  this.clWebLavenderblush = 0xF5F0FF;
  this.clWebLawngreen = 0xFC7C;
  this.clWebLemonchiffon = 0xCDFAFF;
  this.clWebLightblue = 0xE6D8AD;
  this.clWebLightcoral = 0x8080F0;
  this.clWebLightcyan = 0xFFFFE0;
  this.clWebLightgoldenrodyellow = 0xD2FAFA;
  this.clWebLightgray = 0xD3D3D3;
  this.clWebLightgreen = 0x90EE90;
  this.clWebLightgrey = 0xD3D3D3;
  this.clWebLightpink = 0xC1B6FF;
  this.clWebLightsalmon = 0x7AA0FF;
  this.clWebLightseagreen = 0xAAB220;
  this.clWebLightskyblue = 0xFACE87;
  this.clWebLightslategray = 0x998877;
  this.clWebLightslategrey = 0x998877;
  this.clWebLightsteelblue = 0xDEC4B0;
  this.clWebLightyellow = 0xE0FFFF;
  this.clWebLtGray = 0xC0C0C0;
  this.clWebMedGray = 0xA4A0A0;
  this.clWebDkGray = 0x808080;
  this.clWebMoneyGreen = 0xC0DCC0;
  this.clWebLegacySkyBlue = 0xF0CAA6;
  this.clWebCream = 0xF0FBFF;
  this.clWebLime = 0xFF00;
  this.clWebLimegreen = 0x32CD32;
  this.clWebLinen = 0xE6F0FA;
  this.clWebMagenta = 0xFF00FF;
  this.clWebMaroon = 0x80;
  this.clWebMediumaquamarine = 0xAACD66;
  this.clWebMediumblue = 0xCD0000;
  this.clWebMediumorchid = 0xD355BA;
  this.clWebMediumpurple = 0xDB7093;
  this.clWebMediumseagreen = 0x71B33C;
  this.clWebMediumslateblue = 0xEE687B;
  this.clWebMediumspringgreen = 0x9AFA00;
  this.clWebMediumturquoise = 0xCCD148;
  this.clWebMediumvioletred = 0x8515C7;
  this.clWebMidnightblue = 0x701919;
  this.clWebMintcream = 0xFAFFF5;
  this.clWebMistyrose = 0xE1E4FF;
  this.clWebMoccasin = 0xB5E4FF;
  this.clWebNavajowhite = 0xADDEFF;
  this.clWebNavy = 0x800000;
  this.clWebOldlace = 0xE6F5FD;
  this.clWebOlive = 0x8080;
  this.clWebOlivedrab = 0x238E6B;
  this.clWebOrange = 0xA5FF;
  this.clWebOrangered = 0x45FF;
  this.clWebOrchid = 0xD670DA;
  this.clWebPalegoldenrod = 0xAAE8EE;
  this.clWebPalegreen = 0x98FB98;
  this.clWebPaleturquoise = 0xEEEEAF;
  this.clWebPalevioletred = 0x9370DB;
  this.clWebPapayawhip = 0xD5EFFF;
  this.clWebPeachpuff = 0xB9DAFF;
  this.clWebPeru = 0x3F85CD;
  this.clWebPink = 0xCBC0FF;
  this.clWebPlum = 0xDDA0DD;
  this.clWebPowderblue = 0xE6E0B0;
  this.clWebPurple = 0x800080;
  this.clWebRed = 0xFF;
  this.clWebRosybrown = 0x8F8FBC;
  this.clWebRoyalblue = 0xE16941;
  this.clWebSaddlebrown = 0x13458B;
  this.clWebSalmon = 0x7280FA;
  this.clWebSandybrown = 0x60A4F4;
  this.clWebSeagreen = 0x578B2E;
  this.clWebSeashell = 0xEEF5FF;
  this.clWebSienna = 0x2D52A0;
  this.clWebSilver = 0xC0C0C0;
  this.clWebSkyblue = 0xEBCE87;
  this.clWebSlateblue = 0xCD5A6A;
  this.clWebSlategray = 0x908070;
  this.clWebSlategrey = 0x908070;
  this.clWebSnow = 0xFAFAFF;
  this.clWebSpringgreen = 0x7FFF00;
  this.clWebSteelblue = 0xB48246;
  this.clWebTan = 0x8CB4D2;
  this.clWebTeal = 0x808000;
  this.clWebThistle = 0xD8BFD8;
  this.clWebTomato = 0x4763FF;
  this.clWebTurquoise = 0xD0E040;
  this.clWebViolet = 0xEE82EE;
  this.clWebWheat = 0xB3DEF5;
  this.clWebWhite = 0xFFFFFF;
  this.clWebWhitesmoke = 0xF5F5F5;
  this.clWebYellow = 0xFFFF;
  this.clWebYellowgreen = 0x32CD9A;
  this.clAliceblue = 0xFFF8F0;
  this.clAntiquewhite = 0xD7EBFA;
  this.clAquamarine = 0xD4FF7F;
  this.clAzure = 0xFFFFF0;
  this.clBeige = 0xDCF5F5;
  this.clBisque = 0xC4E4FF;
  this.clBlanchedalmond = 0xCDEBFF;
  this.clBlueviolet = 0xE22B8A;
  this.clBrown = 0x2A2AA5;
  this.clBurlywood = 0x87B8DE;
  this.clCadetblue = 0xA09E5F;
  this.clChartreuse = 0xFF7F;
  this.clChocolate = 0x1E69D2;
  this.clCoral = 0x507FFF;
  this.clCornflowerblue = 0xED9564;
  this.clCornsilk = 0xDCF8FF;
  this.clCrimson = 0x3C14DC;
  this.clCyan = 0xFFFF00;
  this.clDarkblue = 0x8B0000;
  this.clDarkcyan = 0x8B8B00;
  this.clDarkgoldenrod = 0xB86B8;
  this.clDarkgray = 0xA9A9A9;
  this.clDarkgreen = 0x6400;
  this.clDarkgrey = 0xA9A9A9;
  this.clDarkkhaki = 0x6BB7BD;
  this.clDarkmagenta = 0x8B008B;
  this.clDarkolivegreen = 0x2F6B55;
  this.clDarkorange = 0x8CFF;
  this.clDarkorchid = 0xCC3299;
  this.clDarkred = 0x8B;
  this.clDarksalmon = 0x7A96E9;
  this.clDarkseagreen = 0x8FBC8F;
  this.clDarkslateblue = 0x8B3D48;
  this.clDarkslategray = 0x4F4F2F;
  this.clDarkslategrey = 0x4F4F2F;
  this.clDarkturquoise = 0xD1CE00;
  this.clDarkviolet = 0xD30094;
  this.clDeeppink = 0x9314FF;
  this.clDeepskyblue = 0xFFBF00;
  this.clDimgray = 0x696969;
  this.clDimgrey = 0x696969;
  this.clDodgerblue = 0xFF901E;
  this.clFirebrick = 0x2222B2;
  this.clFloralwhite = 0xF0FAFF;
  this.clForestgreen = 0x228B22;
  this.clGainsboro = 0xDCDCDC;
  this.clGhostwhite = 0xFFF8F8;
  this.clGold = 0xD7FF;
  this.clGoldenrod = 0x20A5DA;
  this.clGreenyellow = 0x2FFFAD;
  this.clGrey = 0x808080;
  this.clHoneydew = 0xF0FFF0;
  this.clHotpink = 0xB469FF;
  this.clIndianred = 0x5C5CCD;
  this.clIndigo = 0x82004B;
  this.clIvory = 0xF0FFFF;
  this.clKhaki = 0x8CE6F0;
  this.clLavender = 0xFAE6E6;
  this.clLavenderblush = 0xF5F0FF;
  this.clLawngreen = 0xFC7C;
  this.clLemonchiffon = 0xCDFAFF;
  this.clLightblue = 0xE6D8AD;
  this.clLightcoral = 0x8080F0;
  this.clLightcyan = 0xFFFFE0;
  this.clLightgoldenrodyellow = 0xD2FAFA;
  this.clLightgray = 0xD3D3D3;
  this.clLightgreen = 0x90EE90;
  this.clLightgrey = 0xD3D3D3;
  this.clLightpink = 0xC1B6FF;
  this.clLightsalmon = 0x7AA0FF;
  this.clLightseagreen = 0xAAB220;
  this.clLightskyblue = 0xFACE87;
  this.clLightslategray = 0x998877;
  this.clLightslategrey = 0x998877;
  this.clLightsteelblue = 0xDEC4B0;
  this.clLightyellow = 0xE0FFFF;
  this.clLegacySkyBlue = 0xF0CAA6;
  this.clLimegreen = 0x32CD32;
  this.clLinen = 0xE6F0FA;
  this.clMagenta = 0xFF00FF;
  this.clMediumaquamarine = 0xAACD66;
  this.clMediumblue = 0xCD0000;
  this.clMediumorchid = 0xD355BA;
  this.clMediumpurple = 0xDB7093;
  this.clMediumseagreen = 0x71B33C;
  this.clMediumslateblue = 0xEE687B;
  this.clMediumspringgreen = 0x9AFA00;
  this.clMediumturquoise = 0xCCD148;
  this.clMediumvioletred = 0x8515C7;
  this.clMidnightblue = 0x701919;
  this.clMintcream = 0xFAFFF5;
  this.clMistyrose = 0xE1E4FF;
  this.clMoccasin = 0xB5E4FF;
  this.clNavajowhite = 0xADDEFF;
  this.clOldlace = 0xE6F5FD;
  this.clOlivedrab = 0x238E6B;
  this.clOrange = 0xA5FF;
  this.clOrangered = 0x45FF;
  this.clOrchid = 0xD670DA;
  this.clPalegoldenrod = 0xAAE8EE;
  this.clPalegreen = 0x98FB98;
  this.clPaleturquoise = 0xEEEEAF;
  this.clPalevioletred = 0x9370DB;
  this.clPapayawhip = 0xD5EFFF;
  this.clPeachpuff = 0xB9DAFF;
  this.clPeru = 0x3F85CD;
  this.clPink = 0xCBC0FF;
  this.clPlum = 0xDDA0DD;
  this.clPowderblue = 0xE6E0B0;
  this.clRosybrown = 0x8F8FBC;
  this.clRoyalblue = 0xE16941;
  this.clSaddlebrown = 0x13458B;
  this.clSalmon = 0x7280FA;
  this.clSandybrown = 0x60A4F4;
  this.clSeagreen = 0x578B2E;
  this.clSeashell = 0xEEF5FF;
  this.clSienna = 0x2D52A0;
  this.clSlateblue = 0xCD5A6A;
  this.clSlategray = 0x908070;
  this.clSlategrey = 0x908070;
  this.clSnow = 0xFAFAFF;
  this.clSpringgreen = 0x7FFF00;
  this.clSteelblue = 0xB48246;
  this.clTan = 0x8CB4D2;
  this.clThistle = 0xD8BFD8;
  this.clTomato = 0x4763FF;
  this.clTurquoise = 0xD0E040;
  this.clViolet = 0xEE82EE;
  this.clWheat = 0xB3DEF5;
  this.clWhitesmoke = 0xF5F5F5;
  this.clYellowgreen = 0x32CD9A;
  this.clInactiveBorder = 0xFCF7F4;
  this.ANSI_CHARSET = 0;
  this.DEFAULT_CHARSET = 1;
  this.SYMBOL_CHARSET = 2;
  this.MAC_CHARSET = 77;
  this.SHIFTJIS_CHARSET = 128;
  this.HANGEUL_CHARSET = 129;
  this.JOHAB_CHARSET = 130;
  this.GB2312_CHARSET = 134;
  this.CHINESEBIG5_CHARSET = 136;
  this.GREEK_CHARSET = 161;
  this.TURKISH_CHARSET = 162;
  this.HEBREW_CHARSET = 177;
  this.ARABIC_CHARSET = 178;
  this.BALTIC_CHARSET = 186;
  this.RUSSIAN_CHARSET = 204;
  this.THAI_CHARSET = 222;
  this.EASTEUROPE_CHARSET = 238;
  this.OEM_CHARSET = 255;
  this.$rtti.$inherited("TColor",rtl.nativeint,{});
  this.TVerticalAlignment = {"0": "taAlignTop", taAlignTop: 0, "1": "taAlignBottom", taAlignBottom: 1, "2": "taVerticalCenter", taVerticalCenter: 2};
  this.$rtti.$Enum("TVerticalAlignment",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TVerticalAlignment});
  this.TPenStyle = {"0": "psSolid", psSolid: 0, "1": "psDash", psDash: 1, "2": "psDot", psDot: 2, "3": "psDashDot", psDashDot: 3, "4": "psDashDotDot", psDashDotDot: 4, "5": "psClear", psClear: 5, "6": "psInsideFrame", psInsideFrame: 6, "7": "psUserStyle", psUserStyle: 7, "8": "psAlternate", psAlternate: 8};
  this.$rtti.$Enum("TPenStyle",{minvalue: 0, maxvalue: 8, ordtype: 1, enumtype: this.TPenStyle});
  this.TPenMode = {"0": "pmBlack", pmBlack: 0, "1": "pmWhite", pmWhite: 1, "2": "pmNop", pmNop: 2, "3": "pmNot", pmNot: 3, "4": "pmCopy", pmCopy: 4, "5": "pmNotCopy", pmNotCopy: 5, "6": "pmMergePenNot", pmMergePenNot: 6, "7": "pmMaskPenNot", pmMaskPenNot: 7, "8": "pmMergeNotPen", pmMergeNotPen: 8, "9": "pmMaskNotPen", pmMaskNotPen: 9, "10": "pmMerge", pmMerge: 10, "11": "pmNotMerge", pmNotMerge: 11, "12": "pmMask", pmMask: 12, "13": "pmNotMask", pmNotMask: 13, "14": "pmXor", pmXor: 14, "15": "pmNotXor", pmNotXor: 15};
  this.$rtti.$Enum("TPenMode",{minvalue: 0, maxvalue: 15, ordtype: 1, enumtype: this.TPenMode});
  this.TBrushStyle = {"0": "bsSolid", bsSolid: 0, "1": "bsClear", bsClear: 1, "2": "bsHorizontal", bsHorizontal: 2, "3": "bsVertical", bsVertical: 3, "4": "bsFDiagonal", bsFDiagonal: 4, "5": "bsBDiagonal", bsBDiagonal: 5, "6": "bsCross", bsCross: 6, "7": "bsDiagCross", bsDiagCross: 7};
  this.$rtti.$Enum("TBrushStyle",{minvalue: 0, maxvalue: 7, ordtype: 1, enumtype: this.TBrushStyle});
  this.TBrushGradient = {"0": "bgNone", bgNone: 0, "1": "bgLinearVert", bgLinearVert: 1, "2": "bgLinearHorz", bgLinearHorz: 2, "3": "bgRadial", bgRadial: 3};
  this.$rtti.$Enum("TBrushGradient",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TBrushGradient});
  this.TFontStyle = {"0": "fsBold", fsBold: 0, "1": "fsItalic", fsItalic: 1, "2": "fsStrikeOut", fsStrikeOut: 2, "3": "fsUnderline", fsUnderline: 3};
  this.$rtti.$Enum("TFontStyle",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TFontStyle});
  this.$rtti.$Set("TFontStyles",{comptype: this.$rtti["TFontStyle"]});
  this.$rtti.$Int("TFontCharset",{minvalue: 0, maxvalue: 255, ordtype: 3});
  this.TTextFormats = {"0": "tfBottom", tfBottom: 0, "1": "tfCalcRect", tfCalcRect: 1, "2": "tfCenter", tfCenter: 2, "3": "tfEditControl", tfEditControl: 3, "4": "tfEndEllipsis", tfEndEllipsis: 4, "5": "tfPathEllipsis", tfPathEllipsis: 5, "6": "tfExpandTabs", tfExpandTabs: 6, "7": "tfExternalLeading", tfExternalLeading: 7, "8": "tfLeft", tfLeft: 8, "9": "tfModifyString", tfModifyString: 9, "10": "tfNoClip", tfNoClip: 10, "11": "tfNoPrefix", tfNoPrefix: 11, "12": "tfRight", tfRight: 12, "13": "tfRtlReading", tfRtlReading: 13, "14": "tfSingleLine", tfSingleLine: 14, "15": "tfTop", tfTop: 15, "16": "tfVerticalCenter", tfVerticalCenter: 16, "17": "tfWordBreak", tfWordBreak: 17, "18": "tfHidePrefix", tfHidePrefix: 18, "19": "tfNoFullWidthCharBreak", tfNoFullWidthCharBreak: 19, "20": "tfPrefixOnly", tfPrefixOnly: 20, "21": "tfTabStop", tfTabStop: 21, "22": "tfWordEllipsis", tfWordEllipsis: 22, "23": "tfComposited", tfComposited: 23};
  this.$rtti.$Enum("TTextFormats",{minvalue: 0, maxvalue: 23, ordtype: 1, enumtype: this.TTextFormats});
  this.$rtti.$Set("TTextFormat",{comptype: this.$rtti["TTextFormats"]});
  this.$rtti.$inherited("TBinaryString",rtl.string,{});
  rtl.recNewT(this,"TCanvasPointF",function () {
    this.X = 0.0;
    this.Y = 0.0;
    this.$eq = function (b) {
      return (this.X === b.X) && (this.Y === b.Y);
    };
    this.$assign = function (s) {
      this.X = s.X;
      this.Y = s.Y;
      return this;
    };
    var $r = $mod.$rtti.$Record("TCanvasPointF",{},this);
    $r.addField("X",rtl.double);
    $r.addField("Y",rtl.double);
  });
  rtl.recNewT(this,"TCanvasRectF",function () {
    this.Left = 0.0;
    this.Top = 0.0;
    this.Right = 0.0;
    this.Bottom = 0.0;
    this.$eq = function (b) {
      return (this.Left === b.Left) && (this.Top === b.Top) && (this.Right === b.Right) && (this.Bottom === b.Bottom);
    };
    this.$assign = function (s) {
      this.Left = s.Left;
      this.Top = s.Top;
      this.Right = s.Right;
      this.Bottom = s.Bottom;
      return this;
    };
    var $r = $mod.$rtti.$Record("TCanvasRectF",{},this);
    $r.addField("Left",rtl.double);
    $r.addField("Top",rtl.double);
    $r.addField("Right",rtl.double);
    $r.addField("Bottom",rtl.double);
  });
  rtl.recNewT(this,"TCanvasSizeF",function () {
    this.cx = 0.0;
    this.cy = 0.0;
    this.$eq = function (b) {
      return (this.cx === b.cx) && (this.cy === b.cy);
    };
    this.$assign = function (s) {
      this.cx = s.cx;
      this.cy = s.cy;
      return this;
    };
    var $r = $mod.$rtti.$Record("TCanvasSizeF",{},this);
    $r.addField("cx",rtl.double);
    $r.addField("cy",rtl.double);
  });
  rtl.createClass(this,"TPen",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FWidth = 0;
      this.FColor = 0;
      this.FStyle = 0;
      this.FMode = 0;
    };
    this.SetColor = function (Value) {
      this.FColor = Value;
    };
    this.Create$1 = function () {
      this.FColor = 0;
      this.FWidth = 1;
      this.FStyle = $mod.TPenStyle.psSolid;
      this.FMode = $mod.TPenMode.pmCopy;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TPen.isPrototypeOf(Source)) {
        this.FColor = rtl.as(Source,$mod.TPen).FColor;
        this.FStyle = rtl.as(Source,$mod.TPen).FStyle;
        this.FWidth = rtl.as(Source,$mod.TPen).FWidth;
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    var $r = this.$rtti;
    $r.addProperty("Color",2,$mod.$rtti["TColor"],"FColor","SetColor");
    $r.addProperty("Mode",0,$mod.$rtti["TPenMode"],"FMode","FMode",4,{Default: $mod.TPenMode.pmCopy});
    $r.addProperty("Width",0,rtl.longint,"FWidth","FWidth",4,{Default: 1});
    $r.addProperty("Style",0,$mod.$rtti["TPenStyle"],"FStyle","FStyle",4,{Default: $mod.TPenStyle.psSolid});
  });
  rtl.createClass(this,"TGradientColor",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FColor = 0;
      this.FStop = 0.0;
    };
    this.Assign = function (Source) {
      if ($mod.TGradientColor.isPrototypeOf(Source)) {
        this.FColor = rtl.as(Source,$mod.TGradientColor).FColor;
        this.FStop = rtl.as(Source,$mod.TGradientColor).FStop;
      };
    };
    this.Create$1 = function () {
      this.FColor = -1;
      this.FStop = 0;
      return this;
    };
    var $r = this.$rtti;
    $r.addProperty("Stop",0,rtl.double,"FStop","FStop");
    $r.addProperty("Color",0,$mod.$rtti["TColor"],"FColor","FColor",4,{Default: -1});
  });
  rtl.createClass(this,"TBrush",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FColor = 0;
      this.FStyle = 0;
      this.FGradientColors = null;
      this.FGradient = 0;
    };
    this.$final = function () {
      this.FGradientColors = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.Create$1 = function () {
      this.FColor = 16777215;
      this.FStyle = $mod.TBrushStyle.bsSolid;
      this.FGradient = $mod.TBrushGradient.bgNone;
      this.FGradientColors = pas.Classes.TList.$create("Create$1");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FGradientColors");
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TBrush.isPrototypeOf(Source)) {
        this.FColor = rtl.as(Source,$mod.TBrush).FColor;
        this.FStyle = rtl.as(Source,$mod.TBrush).FStyle;
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    this.AddGradientColor = function (AColor, AStop) {
      var gr = null;
      gr = $mod.TGradientColor.$create("Create$1");
      gr.FColor = AColor;
      gr.FStop = AStop;
      this.FGradientColors.Add(gr);
    };
    this.GetGradientColor = function (AIndex, AColor, AStop) {
      if (AIndex < this.FGradientColors.GetCount()) {
        AColor.set(rtl.getObject(this.FGradientColors.Get(AIndex)).FColor);
        AStop.set(rtl.getObject(this.FGradientColors.Get(AIndex)).FStop);
      } else throw pas.SysUtils.Exception.$create("Create$1",["Invalid gradient color index"]);
    };
    this.GradientCount = function () {
      var Result = 0;
      Result = this.FGradientColors.GetCount();
      return Result;
    };
    this.ClearGradient = function () {
      var i = 0;
      var gr = null;
      for (var $l = this.FGradientColors.GetCount() - 1; $l >= 0; $l--) {
        i = $l;
        gr = rtl.getObject(this.FGradientColors.Get(i));
        gr = rtl.freeLoc(gr);
        this.FGradientColors.Delete(i);
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Gradient",0,$mod.$rtti["TBrushGradient"],"FGradient","FGradient");
    $r.addProperty("Color",0,$mod.$rtti["TColor"],"FColor","FColor");
    $r.addProperty("Style",0,$mod.$rtti["TBrushStyle"],"FStyle","FStyle");
  });
  rtl.createClass(this,"TFont",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FName = "";
      this.FSize = 0;
      this.FColor = 0;
      this.FStyle = {};
      this.FOnChange = null;
      this.FHeight = 0;
      this.FCharset = 0;
      this.FOrientation = 0;
    };
    this.$final = function () {
      this.FStyle = undefined;
      this.FOnChange = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetHeight = function (Value) {
      var d = 0.0;
      d = (-Value * 72) / 96;
      this.FSize = Math.round(d);
      if (this.FHeight !== Value) {
        this.FHeight = Value;
        this.DoChange();
      };
    };
    this.SetName = function (AName) {
      if (this.FName !== AName) {
        this.FName = AName;
        this.DoChange();
      };
    };
    this.SetSize = function (ASize) {
      if (this.FSize !== ASize) {
        this.FSize = ASize;
        this.DoChange();
      };
    };
    this.SetColor = function (AColor) {
      if (this.FColor !== AColor) {
        this.FColor = AColor;
        this.DoChange();
      };
    };
    this.SetStyle = function (AStyle) {
      if (rtl.neSet(this.FStyle,AStyle)) {
        this.FStyle = rtl.refSet(AStyle);
        this.DoChange();
      };
    };
    this.DoChange = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Assign = function (Source) {
      if ($mod.TFont.isPrototypeOf(Source)) {
        this.FName = rtl.as(Source,$mod.TFont).FName;
        this.FColor = rtl.as(Source,$mod.TFont).FColor;
        this.FSize = rtl.as(Source,$mod.TFont).FSize;
        this.FStyle = rtl.refSet(rtl.as(Source,$mod.TFont).FStyle);
        this.DoChange();
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FName = $mod.WEBDEFAULTFONT;
      this.FSize = 8;
      this.FHeight = -11;
      this.FStyle = {};
      this.FColor = 0;
      return this;
    };
    this.ToString = function () {
      var Result = "";
      var s = "";
      s = "";
      if (($mod.TFontStyle.fsBold in this.FStyle) && ($mod.TFontStyle.fsItalic in this.FStyle)) {
        s = s + "bold italic"}
       else if ($mod.TFontStyle.fsBold in this.FStyle) {
        s = s + "bold"}
       else if ($mod.TFontStyle.fsItalic in this.FStyle) s = s + "italic";
      if (this.FSize !== 0) {
        Result = s + " " + $mod.FontSizeToHTML($mod.FontSizeToPx(this.FSize)) + " " + this.FName}
       else Result = s + " " + $mod.FontSizeToHTML($mod.FontSizeToPx(12)) + " " + this.FName;
      return Result;
    };
    var $r = this.$rtti;
    $r.addProperty("Charset",0,$mod.$rtti["TFontCharset"],"FCharset","FCharset");
    $r.addProperty("Name",2,pas.UITypes.$rtti["TFontName"],"FName","SetName");
    $r.addProperty("Height",2,rtl.longint,"FHeight","SetHeight");
    $r.addProperty("Style",2,$mod.$rtti["TFontStyles"],"FStyle","SetStyle");
    $r.addProperty("Color",2,$mod.$rtti["TColor"],"FColor","SetColor");
    $r.addProperty("Size",2,rtl.longint,"FSize","SetSize");
  });
  this.TImageType = {"0": "itBase64", itBase64: 0, "1": "itBMP", itBMP: 1, "2": "itPNG", itPNG: 2, "3": "itJPEG", itJPEG: 3, "4": "itGIF", itGIF: 4, "5": "itSVG", itSVG: 5};
  this.$rtti.$Enum("TImageType",{minvalue: 0, maxvalue: 5, ordtype: 1, enumtype: this.TImageType});
  this.$rtti.$Class("TCanvas");
  this.$rtti.$Class("TBitmap");
  this.$rtti.$RefToProcVar("TBitmapLoadedProc",{procsig: rtl.newTIProcSig([])});
  rtl.createClass(this,"TGraphic",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FAddToQueue = false;
      this.FCanvasElement = null;
      this.FEmpty = false;
      this.FData = "";
      this.FDataBin = "";
      this.FCanvas = null;
      this.FOnChange = null;
      this.FImage = null;
      this.FBitmap = null;
      this.FURL = "";
      this.FLoaded = null;
      this.FUsedCanvas = false;
    };
    this.$final = function () {
      this.FCanvasElement = undefined;
      this.FCanvas = undefined;
      this.FOnChange = undefined;
      this.FImage = undefined;
      this.FBitmap = undefined;
      this.FLoaded = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetHeight = function (Value) {
      this.FImage.height = Value;
      this.RecreateCanvas();
      this.DoChange();
    };
    this.SetWidth = function (Value) {
      this.FImage.width = Value;
      this.RecreateCanvas();
      this.DoChange();
    };
    this.GetCanvas = function () {
      var Result = null;
      if (!(this.FCanvas != null)) this.RecreateCanvas();
      Result = this.FCanvas;
      this.FUsedCanvas = true;
      return Result;
    };
    this.GetData = function () {
      var Result = "";
      Result = this.FDataBin;
      return Result;
    };
    this.SetData = function (Value) {
      var hx = "";
      if (this.FDataBin !== Value) {
        this.FDataBin = Value;
        hx = pas["WEBLib.WebTools"].HexImageDecodeAsBase64(this.FDataBin);
        if (pas.System.Pos("PHN2ZyB",hx) > 0) {
          this.LoadFromResource("data:image/svg+xml;base64," + hx)}
         else this.LoadFromResource("data:image/png;base64," + hx);
      };
    };
    this.DoChange = function () {
      var i = 0;
      this.FEmpty = (this.GetWidth() === 0) && (this.GetHeight() === 0);
      if (!this.FEmpty && (this.FData !== "") && !$impl.FCache.Exists(this.FData)) {
        $impl.FCache.Add$1($impl.TGraphicCache.$create("Create$1",[this.FImage,this.FData]));
        i = $impl.FQueue.IndexOf(this.FData);
        if ((i >= 0) && (i <= ($impl.FQueue.GetCount() - 1))) $impl.FQueue.Delete(i);
        $impl.FCacheCount -= 1;
        if ($impl.FCacheCount === 0) {
          if (pas["WEBLib.Forms"].Application.FOnImageCacheReady != null) pas["WEBLib.Forms"].Application.FOnImageCacheReady(pas["WEBLib.Forms"].Application);
        };
      };
      if (this.FOnChange != null) {
        this.FOnChange(this);
      };
      if (this.FLoaded != null) {
        this.FLoaded();
        this.FLoaded = null;
      };
    };
    this.SetURL = function (URL) {
      this.FURL = URL;
      this.LoadFromURL(URL,null);
    };
    this.GetWidth = function () {
      var Result = 0;
      var w = 0;
      w = 0;
      if (this.FImage != null) {
        w = this.FImage.width;
      };
      Result = w;
      return Result;
    };
    this.GetHeight = function () {
      var Result = 0;
      var h = 0;
      h = 0;
      if (this.FImage != null) {
        h = this.FImage.height;
      };
      Result = h;
      return Result;
    };
    this.RecreateCanvas = function () {
      if (!(this.FCanvasElement != null)) this.FCanvasElement = document.createElement("CANVAS");
      if (this.FCanvasElement != null) {
        this.FCanvasElement.height = this.GetHeight();
        this.FCanvasElement.width = this.GetWidth();
        if (!(this.FCanvas != null)) {
          this.FCanvas = $mod.TCanvas.$create("Create$1",[this.FCanvasElement]);
          this.FCanvas.FOnBeginScene = rtl.createCallback(this,"DoBeginScene");
          this.FCanvas.FOnEndScene = rtl.createCallback(this,"DoEndScene");
        };
      };
    };
    this.DoBeginScene = function (Sender) {
      this.FCanvas.Clear();
    };
    this.DoEndScene = function (Sender) {
      this.FAddToQueue = false;
      this.CaptureCanvas();
      this.FAddToQueue = true;
    };
    this.AssignEvents = function () {
      var me = this;
      this.FImage.onload = function() {
         me.DoChange();
        };
    };
    this.CreateImage = function () {
      this.FImage = new Image();
    };
    this.LoadFromCache = function (AData, ALoaded) {
      var dt = "";
      var o = null;
      var b = false;
      var s = "";
      var l = false;
      this.FData = AData;
      if (pas.System.Pos("DATA:",pas.SysUtils.UpperCase(AData)) > 0) {
        this.FDataBin = pas["WEBLib.WebTools"].HexImageEncodeFromBase64(AData);
      };
      dt = AData;
      if (dt === "") return;
      this.FLoaded = ALoaded;
      this.FUsedCanvas = false;
      if (!$impl.FCache.Find(dt,{get: function () {
          return o;
        }, set: function (v) {
          o = v;
        }})) {
        b = false;
        s = "";
        s = this.FImage.src;
        b = (s != '');
        l = b && (dt !== s);
        if (l) {
          this.CreateImage();
          this.AssignEvents();
        };
        if ((!l && ($impl.FQueue.IndexOf(dt) === -1)) || l) {
          this.FImage.src = dt;
          dt = this.FImage.src;
          this.FData = dt;
          if (pas.System.Pos("DATA:",pas.SysUtils.UpperCase(dt)) > 0) this.FDataBin = pas["WEBLib.WebTools"].HexImageEncodeFromBase64(dt);
          $impl.FCacheCount += 1;
          if (this.FAddToQueue) $impl.FQueue.Add(dt);
        } else if (!l && ($impl.FQueue.IndexOf(dt) !== -1)) {
          this.FImage.src = dt;
        };
      } else {
        this.FImage = o;
        this.DoChange();
      };
      if (this.FImage) {
        this.FEmpty = (this.FImage.src == '');
      };
    };
    this.CreateFromResource = function (AResource) {
      var Result = null;
      Result = this.CreateFromResource$1(AResource,0);
      return Result;
    };
    this.CreateFromResource$1 = function (AResource, AInstance) {
      var Result = null;
      Result = $mod.TGraphic.$create("Create$3");
      Result.LoadFromResource(AResource);
      return Result;
    };
    this.CreateFromURL = function (AURL) {
      var Result = null;
      Result = this.CreateFromURL$1(AURL,0);
      return Result;
    };
    this.CreateFromURL$1 = function (AURL, AInstance) {
      var Result = null;
      Result = $mod.TGraphic.$create("Create$3");
      Result.LoadFromURL(AURL,null);
      return Result;
    };
    this.Image = function () {
      var Result = null;
      Result = this.FImage;
      return Result;
    };
    this.Empty = function () {
      var Result = false;
      Result = this.FEmpty;
      return Result;
    };
    this.GetBase64Image = function () {
      var Result = "";
      Result = "";
      if (this.FCanvas != null) Result = this.FCanvas.GetBase64Image();
      return Result;
    };
    this.GetAsImage = function (AType) {
      var Result = "";
      Result = "";
      if (this.FCanvas != null) Result = this.FCanvas.GetAsImage(AType);
      return Result;
    };
    this.Create$1 = function (URL) {
      this.FAddToQueue = true;
      this.FEmpty = true;
      this.FData = "";
      this.FDataBin = "";
      this.Create$3();
      this.LoadFromURL(URL,null);
      return this;
    };
    this.Create$2 = function (Img) {
      this.FAddToQueue = true;
      this.FEmpty = true;
      this.FData = "";
      this.FDataBin = "";
      this.FURL = "";
      this.FImage = Img;
      this.FLoaded = null;
      return this;
    };
    this.Create$3 = function () {
      this.FAddToQueue = true;
      this.FEmpty = true;
      this.FData = "";
      this.FDataBin = "";
      this.FUsedCanvas = false;
      this.CreateImage();
      this.AssignEvents();
      return this;
    };
    this.CaptureCanvas = function () {
      if ((this.FCanvas != null) && (this.FCanvas.FElementCanvas != null)) this.LoadFromResource(this.FCanvas.FElementCanvas.toDataURL());
    };
    this.LoadFromCanvas = function (ACanvas) {
      if ((ACanvas != null) && (ACanvas.FElementCanvas != null)) this.LoadFromResource(ACanvas.FElementCanvas.toDataURL());
    };
    this.SetSize = function (AWidth, AHeight) {
      this.SetWidth(AWidth);
      this.SetHeight(AHeight);
    };
    this.Assign = function (Source) {
      var s = "";
      if ((Source != null) && $mod.TGraphic.isPrototypeOf(Source) && (rtl.as(Source,$mod.TGraphic).FCanvas != null)) {
        this.LoadFromCanvas(rtl.as(Source,$mod.TGraphic).FCanvas)}
       else if ((Source != null) && $mod.TGraphic.isPrototypeOf(Source) && (rtl.as(Source,$mod.TGraphic).FImage != null) && !rtl.as(Source,$mod.TGraphic).Empty()) {
        s = Source.FImage.src;
        this.LoadFromURL(s,null);
      } else if (!(Source != null)) {
        this.CreateImage();
        this.DoChange();
      };
    };
    this.LoadFromURL = function (AURL, ALoaded) {
      this.LoadFromURL$1(AURL,0,ALoaded);
    };
    this.LoadFromURL$1 = function (AURL, AHInstance, ALoaded) {
      this.FEmpty = true;
      this.LoadFromCache(AURL,ALoaded);
    };
    this.LoadFromFile = function (AFileName, ALoaded) {
      this.LoadFromURL$1(AFileName,0,ALoaded);
    };
    this.LoadFromResource = function (AResource) {
      this.LoadFromResource$1(AResource,0);
    };
    this.LoadFromResource$1 = function (AResource, AHInstance) {
      this.FEmpty = true;
      this.LoadFromCache(AResource,null);
    };
    this.LoadFromStream = function (AStream) {
      this.DoChange();
    };
    this.SaveToStream = function (AStream) {
      var s = "";
      var ms = null;
      s = this.GetAsImage($mod.TImageType.itBase64);
      ms = AStream;
      s = s.replace(/^data:image\/(png|jpg|jpeg);base64,/, "");
      
          var base64regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
          if (base64regex.test(s)) {
            var binary_string = window.atob(s);
            var len = binary_string.length;
            var bytes = new Uint8Array( len );
            for (var i = 0; i < len; i++)        {
                bytes[i] = binary_string.charCodeAt(i);
            }
            ms.Write(bytes, bytes.length);
          };
    };
    var $r = this.$rtti;
    $r.addProperty("OnChange",0,pas.Classes.$rtti["TNotifyEvent"],"FOnChange","FOnChange");
    $r.addProperty("URL",2,rtl.string,"FURL","SetURL");
    $r.addProperty("Data",3,$mod.$rtti["TBinaryString"],"GetData","SetData");
  });
  rtl.createClass(this,"TBitmap",this.TGraphic,function () {
    this.Assign = function (Source) {
      $mod.TGraphic.Assign.call(this,Source);
    };
  });
  rtl.recNewT(this,"TMatrix",function () {
    this.m11 = 0.0;
    this.m12 = 0.0;
    this.m13 = 0.0;
    this.m21 = 0.0;
    this.m22 = 0.0;
    this.m23 = 0.0;
    this.m31 = 0.0;
    this.m32 = 0.0;
    this.m33 = 0.0;
    this.$eq = function (b) {
      return (this.m11 === b.m11) && (this.m12 === b.m12) && (this.m13 === b.m13) && (this.m21 === b.m21) && (this.m22 === b.m22) && (this.m23 === b.m23) && (this.m31 === b.m31) && (this.m32 === b.m32) && (this.m33 === b.m33);
    };
    this.$assign = function (s) {
      this.m11 = s.m11;
      this.m12 = s.m12;
      this.m13 = s.m13;
      this.m21 = s.m21;
      this.m22 = s.m22;
      this.m23 = s.m23;
      this.m31 = s.m31;
      this.m32 = s.m32;
      this.m33 = s.m33;
      return this;
    };
    var $r = $mod.$rtti.$Record("TMatrix",{},this);
    $r.addField("m11",rtl.double);
    $r.addField("m12",rtl.double);
    $r.addField("m13",rtl.double);
    $r.addField("m21",rtl.double);
    $r.addField("m22",rtl.double);
    $r.addField("m23",rtl.double);
    $r.addField("m31",rtl.double);
    $r.addField("m32",rtl.double);
    $r.addField("m33",rtl.double);
  });
  rtl.createClass(this,"TCanvas",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FElementCanvas = null;
      this.FContext = null;
      this.FPen = null;
      this.FBrush = null;
      this.FFont = null;
      this.FPathOpen = false;
      this.FPathX = 0.0;
      this.FPathY = 0.0;
      this.FClipRect = $mod.TCanvasRectF.$new();
      this.FOnEndScene = null;
      this.FOnBeginScene = null;
      this.FApplyPixelRatio = false;
    };
    this.$final = function () {
      this.FElementCanvas = undefined;
      this.FContext = undefined;
      this.FPen = undefined;
      this.FBrush = undefined;
      this.FFont = undefined;
      this.FClipRect = undefined;
      this.FOnEndScene = undefined;
      this.FOnBeginScene = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.SetClipRect = function (Value) {
      this.FClipRect.$assign(Value);
      if (this.FContext != null) {
        this.FContext.beginPath();
        this.FContext.rect(this.FClipRect.Left,this.FClipRect.Top,this.FClipRect.Right - this.FClipRect.Left,this.FClipRect.Bottom - this.FClipRect.Top);
        this.FContext.clip();
      };
    };
    this.GetAccuOffset = function (X, Y, dx, dy) {
      dx.set(0);
      dy.set(0);
      if ((this.FPen.FWidth === 1) && (this.FPen.FStyle !== $mod.TPenStyle.psClear) && (pas.System.Frac(X) === 0)) dx.set(0.5);
      if ((this.FPen.FWidth === 1) && (this.FPen.FStyle !== $mod.TPenStyle.psClear) && (pas.System.Frac(Y) === 0)) dy.set(0.5);
    };
    this.GetPixel = function (X, Y) {
      var Result = 0;
      var imgd = null;
      Result = -1;
      if (this.FContext != null) {
        imgd = this.FContext.getImageData(X,Y,1,1);
        Result = $mod.RGBA(imgd.data[0],imgd.data[1],imgd.data[2],imgd.data[3]);
      };
      return Result;
    };
    this.SetPixel = function (X, Y, Clr) {
      if (this.FContext != null) {
        this.FContext.fillStyle = $mod.ColorToHTML(Clr);
        this.FContext.fillRect(X,Y,1,1);
      };
    };
    this.ApplyStroke = function () {
      if (this.FContext != null) {
        this.FContext.lineWidth = this.FPen.FWidth;
        this.FContext.strokeStyle = $mod.ColorToHTML(this.FPen.FColor);
        var $tmp = this.FPen.FStyle;
        if ($tmp === $mod.TPenStyle.psSolid) {
          this.FContext.setLineDash([])}
         else if ($tmp === $mod.TPenStyle.psDot) {
          this.FContext.setLineDash([1,2])}
         else if ($tmp === $mod.TPenStyle.psDash) {
          this.FContext.setLineDash([8,2])}
         else if ($tmp === $mod.TPenStyle.psDashDot) {
          this.FContext.setLineDash([6,2,2,2])}
         else if ($tmp === $mod.TPenStyle.psDashDotDot) {
          this.FContext.setLineDash([6,2,2,2,2,2])}
         else if ($tmp === $mod.TPenStyle.psClear) this.FContext.setLineDash([0,0xFFFF]);
      };
    };
    this.ApplyFill = function () {
      if (this.FContext != null) this.FContext.fillStyle = $mod.ColorToHTML(this.FBrush.FColor);
    };
    this.ApplyBrush = function (X1, Y1, X2, Y2) {
      var dx = 0.0;
      var dy = 0.0;
      var p = 0.0;
      var gr = null;
      var i = 0;
      var clr = "";
      var AColor = 0;
      var AStop = 0.0;
      this.GetAccuOffset(X1,Y1,{get: function () {
          return dx;
        }, set: function (v) {
          dx = v;
        }},{get: function () {
          return dy;
        }, set: function (v) {
          dy = v;
        }});
      if (this.FBrush.FStyle in rtl.createSet($mod.TBrushStyle.bsHorizontal,$mod.TBrushStyle.bsCross)) {
        p = Y1 + dy;
        this.FContext.lineWidth = 1;
        this.FContext.strokeStyle = $mod.ColorToHTML(this.FBrush.FColor);
        while (p < Y2) {
          this.FContext.moveTo(X1,p);
          this.FContext.lineTo(X2,p);
          p = p + 8;
        };
      };
      if (this.FBrush.FStyle in rtl.createSet($mod.TBrushStyle.bsVertical,$mod.TBrushStyle.bsCross)) {
        p = X1 + dx;
        this.FContext.lineWidth = 1;
        this.FContext.strokeStyle = $mod.ColorToHTML(this.FBrush.FColor);
        while (p < X2) {
          this.FContext.moveTo(p,Y1);
          this.FContext.lineTo(p,Y2);
          p = p + 8;
        };
      };
      if (this.FBrush.FStyle in rtl.createSet($mod.TBrushStyle.bsFDiagonal,$mod.TBrushStyle.bsDiagCross)) {
        p = (X1 + dx) - (X2 - X1);
        this.FContext.lineWidth = 1;
        this.FContext.strokeStyle = $mod.ColorToHTML(this.FBrush.FColor);
        while (p < X2) {
          this.FContext.moveTo(p,Y1);
          this.FContext.lineTo(p + (Y2 - Y1),Y2);
          p = p + 8;
        };
      };
      if (this.FBrush.FStyle in rtl.createSet($mod.TBrushStyle.bsBDiagonal,$mod.TBrushStyle.bsDiagCross)) {
        p = X1 + dx;
        this.FContext.lineWidth = 1;
        this.FContext.strokeStyle = $mod.ColorToHTML(this.FBrush.FColor);
        while (p < (X2 + (X2 - X1))) {
          this.FContext.moveTo(p,Y1);
          this.FContext.lineTo(p - (Y2 - Y1),Y2);
          p = p + 8;
        };
      };
      if (this.FBrush.FGradient !== $mod.TBrushGradient.bgNone) {
        var $tmp = this.FBrush.FGradient;
        if ($tmp === $mod.TBrushGradient.bgLinearHorz) {
          gr = this.FContext.createLinearGradient(X1,Y1,X2,Y1)}
         else if ($tmp === $mod.TBrushGradient.bgLinearVert) {
          gr = this.FContext.createLinearGradient(X1,Y1,X1,Y2)}
         else if ($tmp === $mod.TBrushGradient.bgRadial) gr = this.FContext.createRadialGradient(X1 + ((X2 - X1) / 2),Y1 + ((Y2 - Y1) / 2),0,X1 + ((X2 - X1) / 2),Y1 + ((Y2 - Y1) / 2),(X2 - X1) / 2);
        clr = $mod.ColorToHTML($mod.ColorToRGB(this.FBrush.FColor));
        gr.addColorStop(0,clr);
        for (var $l = 0, $end = this.FBrush.GradientCount() - 1; $l <= $end; $l++) {
          i = $l;
          this.FBrush.GetGradientColor(i,{get: function () {
              return AColor;
            }, set: function (v) {
              AColor = v;
            }},{get: function () {
              return AStop;
            }, set: function (v) {
              AStop = v;
            }});
          clr = $mod.ColorToHTML($mod.ColorToRGB(AColor));
          gr.addColorStop(AStop,clr);
        };
        this.FContext.fillStyle = gr;
        return;
      };
      this.FContext.stroke();
    };
    this.Create$1 = function (AControl) {
      this.FElementCanvas = AControl;
      if (navigator.userAgent.indexOf('Safari') !== -1 && navigator.userAgent.indexOf('Chrome') === -1) {
            this.FContext = AControl.getContext('2d');
          } else {
            this.FContext = AControl.getContext('2d',{ willReadFrequently: true});
      //      const dpr = window.devicePixelRatio || 1;
      //      console.log(dpr);
      //      this.FContext.scale(dpr, dpr);
          };
      this.FPen = $mod.TPen.$create("Create$1");
      this.FBrush = $mod.TBrush.$create("Create$1");
      this.FPathOpen = false;
      this.FFont = $mod.TFont.$create("Create$1");
      this.FApplyPixelRatio = false;
      return this;
    };
    this.Create$2 = function () {
      this.FElementCanvas = document.createElement("CANVAS");
      this.Create$1(this.FElementCanvas);
      return this;
    };
    this.Destroy = function () {
      pas.System.TObject.Destroy.call(this);
    };
    this.SetTransform = function (m11, m12, m21, m22, dx, dy) {
      var m = $mod.TMatrix.$new();
      var px = 0.0;
      if (this.FContext != null) {
        m.$assign($impl.MatrixIdentity());
        m.m11 = m11;
        m.m12 = m12;
        m.m21 = m21;
        m.m22 = m22;
        m.m31 = dx;
        m.m32 = dy;
        if (this.FApplyPixelRatio) {
          px = $impl.GetPixelRatio(this);
          m.$assign($impl.MatrixMultiply(m,$impl.MatrixCreateScaling(px,px)));
        };
        this.FContext.setTransform(m.m11,m.m12,m.m21,m.m22,m.m31,m.m32);
      };
    };
    this.Transform = function (m11, m12, m21, m22, dx, dy) {
      if (this.FContext != null) this.FContext.transform(m11,m12,m21,m22,dx,dy);
    };
    this.Rotate = function (Angle) {
      if (this.FContext != null) this.FContext.rotate(Angle);
    };
    this.Translate = function (X, Y) {
      if (this.FContext != null) this.FContext.translate(X,Y);
    };
    this.AngleArc = function (X, Y, Radius, StartAngle, SweepAngle) {
      this.AngleArc$1(X,Y,Radius,StartAngle,SweepAngle);
    };
    this.AngleArc$1 = function (X, Y, Radius, StartAngle, SweepAngle) {
      if (this.FContext != null) {
        this.FContext.beginPath();
        this.ApplyStroke();
        this.FContext.arc(X,Y,Radius,StartAngle,StartAngle + SweepAngle);
        this.FContext.stroke();
      };
    };
    this.CopyRect = function (DestRect, Canvas, SourceRect) {
      var sw = 0;
      var sh = 0;
      var dw = 0;
      var dh = 0;
      var imgData = null;
      var ACanvas = null;
      if (this.FContext != null) {
        sw = SourceRect.Right - SourceRect.Left;
        sh = SourceRect.Bottom - SourceRect.Top;
        dw = DestRect.Right - DestRect.Left;
        dh = DestRect.Bottom - DestRect.Top;
        imgData = this.FContext.getImageData(SourceRect.Left,SourceRect.Top,sw,sh);
        ACanvas = $mod.TCanvas.$create("Create$2");
        try {
          ACanvas.FElementCanvas.width = sw;
          ACanvas.FElementCanvas.height = sh;
          ACanvas.FContext.putImageData(imgData,0,0);
          Canvas.FContext.drawImage(ACanvas.FElementCanvas,DestRect.Left,DestRect.Top,dw,dh);
        } finally {
          ACanvas = rtl.freeLoc(ACanvas);
        };
      };
    };
    this.MoveTo = function (X, Y) {
      this.MoveTo$1(X,Y);
    };
    this.MoveTo$1 = function (X, Y) {
      var dx = 0.0;
      var dy = 0.0;
      if (this.FContext != null) {
        this.FPathOpen = true;
        this.FContext.beginPath();
        this.ApplyStroke();
        dx = 0;
        dy = 0;
        this.GetAccuOffset(X,Y,{get: function () {
            return dx;
          }, set: function (v) {
            dx = v;
          }},{get: function () {
            return dy;
          }, set: function (v) {
            dy = v;
          }});
        this.FContext.moveTo(X + dx,Y + dy);
      };
    };
    this.LineTo = function (X, Y) {
      this.LineTo$1(X,Y);
    };
    this.LineTo$1 = function (X, Y) {
      var dx = 0.0;
      var dy = 0.0;
      var clr = 0;
      if (this.FContext != null) {
        dx = 0;
        dy = 0;
        this.GetAccuOffset(X,Y,{get: function () {
            return dx;
          }, set: function (v) {
            dx = v;
          }},{get: function () {
            return dy;
          }, set: function (v) {
            dy = v;
          }});
        var $tmp = this.FPen.FMode;
        if ($tmp === $mod.TPenMode.pmBlack) {
          this.FContext.strokeStyle = $mod.ColorToHTML(0)}
         else if ($tmp === $mod.TPenMode.pmWhite) {
          this.FContext.strokeStyle = $mod.ColorToHTML(16777215)}
         else if ($tmp === $mod.TPenMode.pmXor) {
          this.FContext.globalCompositeOperation = "xor"}
         else if ($tmp === $mod.TPenMode.pmMask) {
          this.FContext.globalCompositeOperation = "source-atop"}
         else if ($tmp === $mod.TPenMode.pmNotCopy) {
          clr = $mod.ColorToRGB(this.FPen.FColor) ^ 0xFFFFFFFF;
          this.FContext.strokeStyle = $mod.ColorToHTML(clr);
        } else if ($tmp === $mod.TPenMode.pmNotXor) {
          clr = $mod.ColorToRGB(this.FPen.FColor) ^ 0xFFFFFFFF;
          this.FContext.strokeStyle = $mod.ColorToHTML(clr);
          this.FContext.globalCompositeOperation = "xor";
        };
        if (!this.FPathOpen) {
          this.FContext.beginPath();
          this.ApplyStroke();
          this.FContext.moveTo(this.FPathX + dx,this.FPathY + dy);
        };
        this.FContext.lineTo(X + dx,Y + dy);
        this.FContext.stroke();
        this.FPathX = X;
        this.FPathY = Y;
        this.FPathOpen = false;
        this.FContext.globalCompositeOperation = "source-over";
      };
    };
    this.Rectangle = function (X1, Y1, X2, Y2) {
      var dx = 0.0;
      var dy = 0.0;
      if (this.FContext != null) {
        this.FContext.save();
        this.FContext.beginPath();
        this.ApplyStroke();
        this.ApplyFill();
        this.GetAccuOffset(X1,Y1,{get: function () {
            return dx;
          }, set: function (v) {
            dx = v;
          }},{get: function () {
            return dy;
          }, set: function (v) {
            dy = v;
          }});
        let region = new Path2D();
        region.rect(X1, Y1, X2- X1 + 1, Y2 - Y1 + 1);
        this.FContext.clip(region, "evenodd");
        this.ApplyBrush(X1,Y1,X2,Y2);
        if (!(this.FBrush.FStyle in rtl.createSet($mod.TBrushStyle.bsClear,$mod.TBrushStyle.bsHorizontal,$mod.TBrushStyle.bsVertical,$mod.TBrushStyle.bsCross,$mod.TBrushStyle.bsFDiagonal,$mod.TBrushStyle.bsBDiagonal,$mod.TBrushStyle.bsDiagCross))) {
          this.FContext.rect(X1 + dx,Y1 + dy,X2 - X1,Y2 - Y1);
          this.FContext.fill();
        };
        if (this.FPen.FStyle !== $mod.TPenStyle.psClear) {
          this.ApplyStroke();
          this.FContext.beginPath();
          this.FContext.rect(X1 + dx,Y1 + dy,X2 - X1,Y2 - Y1);
          this.FContext.stroke();
        };
        this.FContext.restore();
      };
    };
    this.Rectangle$1 = function (X1, Y1, X2, Y2) {
      this.Rectangle(X1,Y1,X2,Y2);
    };
    this.Rectangle$2 = function (Rect) {
      this.Rectangle$1(Rect.Left,Rect.Top,Rect.Right,Rect.Bottom);
    };
    this.Rectangle$3 = function (Rect) {
      this.Rectangle(Rect.Left,Rect.Top,Rect.Right,Rect.Bottom);
    };
    this.RoundRect = function (X1, Y1, X2, Y2, X3, Y3) {
      this.RoundRect$1(X1,Y1,X2,Y2,X3,Y3);
    };
    this.RoundRect$1 = function (X1, Y1, X2, Y2, X3, Y3) {
      var dx = 0.0;
      var dy = 0.0;
      if (this.FContext != null) {
        if (X2 < X1) return;
        if (Y2 < Y1) return;
        this.FContext.beginPath();
        this.ApplyStroke();
        this.ApplyFill();
        this.GetAccuOffset(X1,Y1,{get: function () {
            return dx;
          }, set: function (v) {
            dx = v;
          }},{get: function () {
            return dy;
          }, set: function (v) {
            dy = v;
          }});
        this.FContext.moveTo(X1 + (X3 / 2),Y1 + dy);
        this.FContext.lineTo(X2 - (X3 / 2),Y1 + dy);
        this.FContext.ellipse(X2 - dx - (X3 / 2),Y1 + dy + (Y3 / 2),X3 / 2,Y3 / 2,0,Math.PI * 1.5,0);
        this.FContext.lineTo(X2 - dx,Y2 - (Y3 / 2));
        this.FContext.ellipse(X2 - dx - (X3 / 2),Y2 - dy - (Y3 / 2),X3 / 2,Y3 / 2,0,0,Math.PI * 0.5);
        this.FContext.lineTo(X1 + (X3 / 2),Y2 - dy);
        this.FContext.ellipse(X1 + dx + (X3 / 2),Y2 - dy - (Y3 / 2),X3 / 2,Y3 / 2,0,Math.PI * 0.5,Math.PI);
        this.FContext.lineTo(X1 + dx,Y1 + (Y3 / 2) + dy);
        this.FContext.ellipse(X1 + dx + (X3 / 2),Y1 + dy + (Y3 / 2),X3 / 2,Y3 / 2,0,Math.PI,Math.PI * 1.5);
        if (this.FBrush.FStyle === $mod.TBrushStyle.bsSolid) this.FContext.fill();
        if (this.FPen.FStyle !== $mod.TPenStyle.psClear) this.FContext.stroke();
        this.FContext.save();
        let region = new Path2D();
        region.moveTo(X1 + X3/2, Y1 + dy);
        region.lineTo(X2 - X3/2, Y1 + dy);
        region.ellipse(X2 - dx - X3 / 2, Y1 + dy + Y3/2, X3 / 2, Y3 / 2, 0, Math.PI * 1.5, 0);
        region.lineTo(X2 + dx, Y2 - Y3/2 );
        region.ellipse(X2 - dx - X3 / 2, Y2 - dy - Y3/2, X3 / 2, Y3 / 2, 0, 0, Math.PI * 0.5);
        region.lineTo(X1 + X3/2, Y2 + dy);
        region.ellipse(X1 + dx + X3 / 2, Y2 - dy - Y3/2, X3 / 2, Y3 / 2, 0, Math.PI * 0.5, Math.PI);
        region.lineTo(X1 + dx, Y1 + Y3/2 + dy);
        region.ellipse(X1 + dx + X3 / 2, Y1 + dy + Y3/2, X3 / 2, Y3 / 2, 0, Math.PI, Math.PI * 1.5);
        this.FContext.clip(region, "evenodd");
        this.ApplyBrush(X1,Y1,X2,Y2);
        this.FContext.restore();
      };
    };
    this.RoundRect$2 = function (Rect, CX, CY) {
      this.RoundRect(Rect.Left,Rect.Top,Rect.Right,Rect.Bottom,CX,CY);
    };
    this.RoundRect$3 = function (Rect, CX, CY) {
      this.RoundRect$1(Rect.Left,Rect.Top,Rect.Right,Rect.Bottom,CX,CY);
    };
    this.FillRect = function (Rect) {
      this.Rectangle$1(Rect.Left,Rect.Top,Rect.Right,Rect.Bottom);
    };
    this.FillRect$1 = function (Rect) {
      this.Rectangle(Rect.Left,Rect.Top,Rect.Right,Rect.Bottom);
    };
    this.Arc = function (X1, Y1, X2, Y2, X3, Y3, X4, Y4) {
      var rx = 0;
      var ry = 0;
      var angleStart = 0.0;
      var angleEnd = 0.0;
      if (this.FContext != null) {
        rx = rtl.trunc((X2 - X1) / 2);
        ry = rtl.trunc((Y2 - Y1) / 2);
        angleStart = $impl.AngleOfPoints(X1 + rx,Y1 + ry,X4,Y4);
        angleEnd = $impl.AngleOfPoints(X1 + rx,Y1 + ry,X3,Y3);
        this.FContext.beginPath();
        this.ApplyStroke();
        this.FContext.ellipse(X1 + rx,Y1 + ry,rx,ry,0,angleStart,angleEnd);
        this.FContext.stroke();
      };
    };
    this.Ellipse = function (X1, Y1, X2, Y2) {
      this.Ellipse$1(X1,Y1,X2,Y2);
    };
    this.Ellipse$1 = function (X1, Y1, X2, Y2) {
      var w = 0.0;
      var h = 0.0;
      var kappa = 0.0;
      var ox = 0.0;
      var oy = 0.0;
      var xe = 0.0;
      var ye = 0.0;
      var xm = 0.0;
      var ym = 0.0;
      if (this.FContext != null) {
        w = X2 - X1;
        h = Y2 - Y1;
        kappa = 0.5522848;
        ox = (w / 2) * kappa;
        oy = (h / 2) * kappa;
        xe = X1 + w;
        ye = Y1 + h;
        xm = X1 + (w / 2);
        ym = Y1 + (h / 2);
        this.FContext.save();
        let region = new Path2D();
        region.moveTo(X1, ym);
        region.bezierCurveTo(X1, ym - oy, xm - ox, Y1, xm, Y1);
        region.bezierCurveTo(xm + ox, Y1, xe, ym - oy, xe, ym);
        region.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);
        region.bezierCurveTo(xm - ox, ye, X1, ym + oy, X1, ym);
        region.closePath();
        this.FContext.clip(region, "evenodd");
        if (!(this.FBrush.FStyle in rtl.createSet($mod.TBrushStyle.bsSolid,$mod.TBrushStyle.bsClear)) && (this.FBrush.FGradient === $mod.TBrushGradient.bgNone)) this.ApplyBrush(X1,Y1,X2,Y2);
        this.FContext.restore();
        this.FContext.beginPath();
        this.ApplyStroke();
        if (this.FBrush.FGradient !== $mod.TBrushGradient.bgNone) {
          this.ApplyBrush(X1,Y1,X2,Y2);
        } else this.ApplyFill();
        this.FContext.moveTo(X1,ym);
        this.FContext.bezierCurveTo(X1,ym - oy,xm - ox,Y1,xm,Y1);
        this.FContext.bezierCurveTo(xm + ox,Y1,xe,ym - oy,xe,ym);
        this.FContext.bezierCurveTo(xe,ym + oy,xm + ox,ye,xm,ye);
        this.FContext.bezierCurveTo(xm - ox,ye,X1,ym + oy,X1,ym);
        this.FContext.closePath();
        if ((this.FBrush.FStyle === $mod.TBrushStyle.bsSolid) || (this.FBrush.FGradient !== $mod.TBrushGradient.bgNone)) this.FContext.fill();
        if (this.FPen.FStyle !== $mod.TPenStyle.psClear) this.FContext.stroke();
      };
    };
    this.Ellipse$2 = function (Rect) {
      this.Ellipse(Rect.Left,Rect.Top,Rect.Right,Rect.Bottom);
    };
    this.Ellipse$3 = function (Rect) {
      this.Ellipse$1(Rect.Left,Rect.Top,Rect.Right,Rect.Bottom);
    };
    this.Polyline = function (Points) {
      var l = 0;
      var i = 0;
      if (this.FContext != null) {
        l = rtl.length(Points);
        if (l === 0) return;
        this.FContext.beginPath();
        this.ApplyStroke();
        i = 0;
        this.FContext.moveTo(Points[i].x,Points[i].y);
        while (i < (l - 1)) {
          i += 1;
          this.FContext.lineTo(Points[i].x,Points[i].y);
        };
        if (this.FPen.FStyle !== $mod.TPenStyle.psClear) this.FContext.stroke();
      };
    };
    this.Polyline$1 = function (Points) {
      var l = 0;
      var i = 0;
      if (this.FContext != null) {
        l = rtl.length(Points);
        if (l === 0) return;
        this.FContext.beginPath();
        this.ApplyStroke();
        i = 0;
        this.FContext.moveTo(Points[i].X,Points[i].Y);
        while (i < (l - 1)) {
          i += 1;
          this.FContext.lineTo(Points[i].X,Points[i].Y);
        };
        if (this.FPen.FStyle !== $mod.TPenStyle.psClear) this.FContext.stroke();
      };
    };
    this.Polygon = function (Points) {
      var l = 0;
      var i = 0;
      var x1 = 0;
      var y1 = 0;
      var x2 = 0;
      var y2 = 0;
      if (this.FContext != null) {
        l = rtl.length(Points);
        if (l === 0) return;
        this.FContext.beginPath();
        this.ApplyStroke();
        x1 = 0xFFFF;
        y1 = 0xFFFF;
        x2 = 0;
        y2 = 0;
        for (var $l = 0, $end = rtl.length(Points) - 1; $l <= $end; $l++) {
          i = $l;
          if (Points[i].x < x1) x1 = Points[i].x;
          if (Points[i].y < y1) y1 = Points[i].y;
          if (Points[i].x > x2) x2 = Points[i].x;
          if (Points[i].y > y2) y2 = Points[i].y;
        };
        if (this.FBrush.FGradient !== $mod.TBrushGradient.bgNone) {
          this.ApplyBrush(x1,y1,x2,y2);
        } else this.ApplyFill();
        i = 0;
        this.FContext.moveTo(Points[i].x,Points[i].y);
        while (i < (l - 1)) {
          i += 1;
          this.FContext.lineTo(Points[i].x,Points[i].y);
        };
        this.FContext.closePath();
        if (this.FBrush.FStyle !== $mod.TBrushStyle.bsClear) this.FContext.fill();
        if (this.FPen.FStyle !== $mod.TPenStyle.psClear) this.FContext.stroke();
      };
    };
    this.Polygon$1 = function (Points) {
      var l = 0;
      var i = 0;
      var x1 = 0.0;
      var y1 = 0.0;
      var x2 = 0.0;
      var y2 = 0.0;
      if (this.FContext != null) {
        l = rtl.length(Points);
        if (l === 0) return;
        this.FContext.beginPath();
        this.ApplyStroke();
        x1 = 0xFFFF;
        y1 = 0xFFFF;
        x2 = 0;
        y2 = 0;
        for (var $l = 0, $end = rtl.length(Points) - 1; $l <= $end; $l++) {
          i = $l;
          if (Points[i].X < x1) x1 = Points[i].X;
          if (Points[i].Y < y1) y1 = Points[i].Y;
          if (Points[i].X > x2) x2 = Points[i].X;
          if (Points[i].Y > y2) y2 = Points[i].Y;
        };
        if (this.FBrush.FGradient !== $mod.TBrushGradient.bgNone) {
          this.ApplyBrush(x1,y1,x2,y2)}
         else this.ApplyFill();
        i = 0;
        this.FContext.moveTo(Points[i].X,Points[i].Y);
        while (i < (l - 1)) {
          i += 1;
          this.FContext.lineTo(Points[i].X,Points[i].Y);
        };
        this.FContext.closePath();
        if (this.FBrush.FStyle !== $mod.TBrushStyle.bsClear) this.FContext.fill();
        if (this.FPen.FStyle !== $mod.TPenStyle.psClear) this.FContext.stroke();
      };
    };
    this.TextOut = function (X, Y, Text) {
      this.TextOut$1(X,Y,Text);
    };
    this.TextOut$1 = function (X, Y, Text) {
      var tm = null;
      var DrwText = "";
      if (this.FContext != null) {
        DrwText = Text.replace('\0','');
        this.FContext.fillStyle = $mod.ColorToHTML(this.FFont.FColor);
        this.FContext.font = this.FFont.ToString();
        this.FContext.textBaseline = "top";
        this.FContext.fillText(DrwText,X,Y);
        if ($mod.TFontStyle.fsUnderline in this.FFont.FStyle) {
          tm = this.FContext.measureText(DrwText);
          this.FContext.fillRect(X,Y + (this.FFont.FSize * 1.4),tm.width,1);
        };
        if ($mod.TFontStyle.fsStrikeOut in this.FFont.FStyle) {
          tm = this.FContext.measureText(DrwText);
          this.FContext.fillRect(X,Y + (this.FFont.FSize * 0.7),tm.width,1);
        };
      };
    };
    this.Draw = function (X, Y, Graphic) {
      this.Draw$1(X,Y,Graphic);
    };
    this.Draw$1 = function (X, Y, Graphic) {
      var img = null;
      if (this.FContext != null) {
        img = Graphic.Image();
        if (img != null) {
          if (Graphic.FUsedCanvas) {
            this.FContext.drawImage(Graphic.FCanvasElement,X,Y)}
           else this.FContext.drawImage(img,X,Y);
        };
      };
    };
    this.StretchDraw = function (Rect, Graphic) {
      this.StretchDraw$1($mod.TCanvasRectF.$clone($mod.CreateCanvasRectF(Rect.Left,Rect.Top,Rect.Right,Rect.Bottom)),Graphic);
    };
    this.StretchDraw$1 = function (Rect, Graphic) {
      var img = null;
      if (this.FContext != null) {
        img = Graphic.Image();
        if (img != null) {
          if (Graphic.FUsedCanvas) {
            this.FContext.drawImage(Graphic.FCanvasElement,0,0,Graphic.GetWidth(),Graphic.GetHeight(),Rect.Left,Rect.Top,Rect.Right - Rect.Left,Rect.Bottom - Rect.Top)}
           else this.FContext.drawImage(img,0,0,Graphic.GetWidth(),Graphic.GetHeight(),Rect.Left,Rect.Top,Rect.Right - Rect.Left,Rect.Bottom - Rect.Top);
        };
      };
    };
    this.DrawFocusRect = function (Rect) {
      this.DrawFocusRect$1($mod.CreateCanvasRectF(Rect.Left,Rect.Top,Rect.Right,Rect.Bottom));
    };
    this.DrawFocusRect$1 = function (Rect) {
      var ps = 0;
      ps = this.FPen.FStyle;
      this.FPen.FStyle = $mod.TPenStyle.psDot;
      this.FPen.FWidth = 1;
      this.FPen.SetColor(0);
      this.MoveTo$1(Rect.Left,Rect.Top);
      this.LineTo$1(Rect.Right,Rect.Top);
      this.LineTo$1(Rect.Right,Rect.Bottom);
      this.LineTo$1(Rect.Left,Rect.Bottom);
      this.LineTo$1(Rect.Left,Rect.Top);
      this.FPen.FStyle = ps;
    };
    this.BeginScene = function () {
      if (this.FOnBeginScene != null) this.FOnBeginScene(this);
    };
    this.EndScene = function () {
      if (this.FOnEndScene != null) this.FOnEndScene(this);
    };
    this.PathBegin = function () {
      if (this.FContext != null) this.FContext.beginPath();
    };
    this.PathClose = function () {
      if (this.FContext != null) this.FContext.closePath();
    };
    this.PathStroke = function () {
      if (this.FContext != null) {
        this.ApplyStroke();
        this.FContext.stroke();
      };
    };
    this.PathFill = function () {
      if (this.FContext != null) {
        this.ApplyFill();
        this.ApplyBrush(10,10,50,50);
        this.FContext.fill();
      };
    };
    this.PathMoveTo = function (X, Y) {
      this.PathMoveTo$1(X,Y);
    };
    this.PathMoveTo$1 = function (X, Y) {
      var dx = 0.0;
      var dy = 0.0;
      if (this.FContext != null) {
        dx = 0;
        dy = 0;
        this.GetAccuOffset(X,Y,{get: function () {
            return dx;
          }, set: function (v) {
            dx = v;
          }},{get: function () {
            return dy;
          }, set: function (v) {
            dy = v;
          }});
        this.FContext.moveTo(X + dx,Y + dy);
      };
    };
    this.PathLineTo = function (X, Y) {
      this.PathLineTo$1(X,Y);
    };
    this.PathLineTo$1 = function (X, Y) {
      var dx = 0.0;
      var dy = 0.0;
      if (this.FContext != null) {
        dx = 0;
        dy = 0;
        this.GetAccuOffset(X,Y,{get: function () {
            return dx;
          }, set: function (v) {
            dx = v;
          }},{get: function () {
            return dy;
          }, set: function (v) {
            dy = v;
          }});
        this.FContext.lineTo(X + dx,Y + dy);
      };
    };
    this.Save = function () {
      if (this.FContext != null) this.FContext.save();
    };
    this.Clip = function () {
      if (this.FContext != null) this.FContext.clip();
    };
    this.Restore = function () {
      if (this.FContext != null) this.FContext.restore();
    };
    this.Refresh = function () {
    };
    this.Clear = function () {
      if ((this.FContext != null) && (this.FElementCanvas != null)) this.FContext.clearRect(0,0,this.FElementCanvas.width,this.FElementCanvas.height);
    };
    this.Clear$1 = function (AColor) {
      var c = 0;
      var s = 0;
      this.Clear();
      if (this.FElementCanvas != null) {
        c = this.FBrush.FColor;
        s = this.FBrush.FStyle;
        this.FBrush.FColor = AColor;
        this.FBrush.FStyle = $mod.TBrushStyle.bsSolid;
        this.FillRect(pas.Types.Rect(0,0,this.FElementCanvas.width,this.FElementCanvas.height));
        this.FBrush.FColor = c;
        this.FBrush.FStyle = s;
      };
    };
    this.TextExtent = function (Text) {
      var Result = $mod.TCanvasSizeF.$new();
      Result.cx = this.TextWidth(Text);
      Result.cy = this.TextHeight(Text);
      return Result;
    };
    this.TextRect = function (ARect, Text, WordWrap, Calculate, AHorizontalAlignment, AVerticalAlignment) {
      var Result = pas.Types.TRect.$new();
      var r = $mod.TCanvasRectF.$new();
      r.$assign(this.TextRect$1($mod.TCanvasRectF.$clone($mod.CreateCanvasRectF(ARect.Left,ARect.Top,ARect.Right,ARect.Bottom)),Text,WordWrap,Calculate,AHorizontalAlignment,AVerticalAlignment));
      Result.$assign(pas.Types.Rect(Math.round(r.Left),Math.round(r.Top),Math.round(r.Right),Math.round(r.Bottom)));
      return Result;
    };
    this.TextRect$1 = function (ARect, Text, WordWrap, Calculate, AHorizontalAlignment, AVerticalAlignment) {
      var $Self = this;
      var Result = $mod.TCanvasRectF.$new();
      var i = 0;
      var s = "";
      var sn = "";
      var st = "";
      var l = 0;
      var w = 0.0;
      var mw = 0.0;
      var f = false;
      var p = 0;
      var tw = 0.0;
      var th = 0.0;
      var lcnt = 0;
      var rs = $mod.TCanvasRectF.$new();
      var fws = 0.0;
      var ths = 0.0;
      var ww = false;
      var wwx = false;
      var fx = false;
      function DrawText(AText, AWidth, AHeight) {
        if (ww) {
          var $tmp = AHorizontalAlignment;
          if ($tmp === pas.Classes.TAlignment.taCenter) {
            $Self.TextOut$1(ARect.Left + ((ARect.Right - ARect.Left - AWidth) / 2),ARect.Top,AText)}
           else if ($tmp === pas.Classes.TAlignment.taLeftJustify) {
            $Self.TextOut$1(ARect.Left,ARect.Top,AText)}
           else if ($tmp === pas.Classes.TAlignment.taRightJustify) $Self.TextOut$1(ARect.Right - AWidth,ARect.Top,AText);
        } else {
          var $tmp1 = AHorizontalAlignment;
          if ($tmp1 === pas.Classes.TAlignment.taCenter) {
            var $tmp2 = AVerticalAlignment;
            if ($tmp2 === $mod.TVerticalAlignment.taAlignTop) {
              $Self.TextOut$1(ARect.Left + ((ARect.Right - ARect.Left - AWidth) / 2),ARect.Top,AText)}
             else if ($tmp2 === $mod.TVerticalAlignment.taVerticalCenter) {
              $Self.TextOut$1(ARect.Left + ((ARect.Right - ARect.Left - AWidth) / 2),ARect.Top + ((ARect.Bottom - ARect.Top - AHeight) / 2),AText)}
             else if ($tmp2 === $mod.TVerticalAlignment.taAlignBottom) $Self.TextOut$1(ARect.Left + ((ARect.Right - ARect.Left - AWidth) / 2),ARect.Bottom - AHeight,AText);
          } else if ($tmp1 === pas.Classes.TAlignment.taLeftJustify) {
            var $tmp3 = AVerticalAlignment;
            if ($tmp3 === $mod.TVerticalAlignment.taAlignTop) {
              $Self.TextOut$1(ARect.Left,ARect.Top,AText)}
             else if ($tmp3 === $mod.TVerticalAlignment.taVerticalCenter) {
              $Self.TextOut$1(ARect.Left,ARect.Top + ((ARect.Bottom - ARect.Top - AHeight) / 2),AText)}
             else if ($tmp3 === $mod.TVerticalAlignment.taAlignBottom) $Self.TextOut$1(ARect.Left,ARect.Bottom - AHeight,AText);
          } else if ($tmp1 === pas.Classes.TAlignment.taRightJustify) {
            var $tmp4 = AVerticalAlignment;
            if ($tmp4 === $mod.TVerticalAlignment.taAlignTop) {
              $Self.TextOut$1(ARect.Right - AWidth,ARect.Top,AText)}
             else if ($tmp4 === $mod.TVerticalAlignment.taVerticalCenter) {
              $Self.TextOut$1(ARect.Right - AWidth,ARect.Top + ((ARect.Bottom - ARect.Top - AHeight) / 2),AText)}
             else if ($tmp4 === $mod.TVerticalAlignment.taAlignBottom) $Self.TextOut$1(ARect.Right - AWidth,ARect.Bottom - AHeight,AText);
          };
        };
      };
      function FindNextWord(Text, APos) {
        var Result = "";
        var l = 0;
        var i = 0;
        Result = "";
        l = Text.length;
        if (APos.get() > l) return Result;
        i = APos.get();
        while (true) {
          if (((Text.charAt(i - 1) === "\n") && (Text.charAt(i - 1 - 1) === "\r")) || ((Text.charAt(i - 1) === "\r") && (Text.charAt(i - 1 - 1) === "\n")) || (Text.charAt(i - 1) === " ")) {
            if (Text.charAt(i - 1) === " ") {
              Result = pas.System.Copy(Text,APos.get(),i - (APos.get() - 1))}
             else Result = pas.System.Copy(Text,APos.get(),i - APos.get());
            break;
          } else if ((Text.charAt(i - 1) === "\n") || (Text.charAt(i - 1) === "\r") || (Text.charAt(i - 1) === " ")) {
            Result = pas.System.Copy(Text,APos.get(),i - (APos.get() - 1));
            break;
          } else if (i >= l) {
            Result = pas.System.Copy(Text,APos.get(),i - (APos.get() - 1));
            break;
          } else i += 1;
        };
        APos.set(i + 1);
        return Result;
      };
      ww = WordWrap || (pas.System.Pos("\r",Text) > 0) || (pas.System.Pos("\n",Text) > 0);
      wwx = !WordWrap && ((pas.System.Pos("\r",Text) > 0) || (pas.System.Pos("\n",Text) > 0));
      if (!ww) {
        w = this.TextWidth(Text);
        th = this.TextHeight(Text);
        if (!Calculate) DrawText(Text,w,th);
        Result.$assign($mod.CreateCanvasRectF(ARect.Left,ARect.Top,ARect.Left + w,ARect.Top + th));
      } else {
        rs.$assign(ARect);
        mw = 0;
        i = 1;
        ths = this.FFont.FSize * 0.5;
        lcnt = 0;
        fws = 0;
        tw = 0;
        s = FindNextWord(Text,{get: function () {
            return i;
          }, set: function (v) {
            i = v;
          }});
        w = this.TextWidth(s);
        th = this.TextHeight(s) + ths;
        mw = mw + w;
        if ((s.length > 0) && (s.charAt(s.length - 1) === " ")) mw = mw + fws;
        fx = false;
        while (i <= Text.length) {
          l = s.length;
          if ((l >= 2) && (((s.charAt(l - 1) === "\n") && (s.charAt(l - 1 - 1) === "\r")) || ((s.charAt(l - 1) === "\r") && (s.charAt(l - 1 - 1) === "\n")))) {
            s = pas.System.Copy(s,1,l - 2);
            f = true;
          } else if ((l >= 1) && ((s.charAt(l - 1) === "\n") || (s.charAt(l - 1) === "\r"))) {
            s = pas.System.Copy(s,1,l - 1);
            f = true;
          } else f = false;
          sn = FindNextWord(Text,{get: function () {
              return i;
            }, set: function (v) {
              i = v;
            }});
          w = this.TextWidth(sn);
          th = Math.max(th,this.TextHeight(sn) + ths);
          if (((ARect.Left + mw + w) > ARect.Right) || f) {
            if ((s !== "") && !fx) {
              p = s.length;
              st = pas.System.Copy(s,1,p);
              lcnt += 1;
              if (mw > tw) tw = mw;
              if (!Calculate) DrawText(st,mw,th);
              mw = 0;
            };
            s = "";
            fx = false;
            if ((wwx && f) || !wwx) {
              ARect.Top = ARect.Top + th}
             else if (wwx && !f) fx = true;
            if ((pas.System.Trunc(ARect.Top) > pas.System.Trunc((ARect.Bottom - th) + ths)) && !Calculate) break;
          };
          mw = mw + w;
          if ((sn.length > 0) && (sn.charAt(sn.length - 1) === " ")) mw = mw + fws;
          s = s + sn;
        };
        if (s !== "") {
          p = s.length;
          st = pas.System.Copy(s,1,p);
          lcnt += 1;
          if (mw > tw) tw = mw;
          if (!Calculate) DrawText(st,mw,th);
        };
        Result.$assign($mod.CreateCanvasRectF(rs.Left,rs.Top,rs.Left + tw,rs.Top + (lcnt * th)));
      };
      return Result;
    };
    this.TextRect$2 = function (ARect, Text, TextFormat) {
      var Result = $mod.TCanvasRectF.$new();
      var ha = 0;
      var va = 0;
      ha = pas.Classes.TAlignment.taLeftJustify;
      va = $mod.TVerticalAlignment.taAlignTop;
      if ($mod.TTextFormats.tfCenter in TextFormat) {
        ha = pas.Classes.TAlignment.taCenter}
       else if ($mod.TTextFormats.tfRight in TextFormat) ha = pas.Classes.TAlignment.taRightJustify;
      if ($mod.TTextFormats.tfVerticalCenter in TextFormat) {
        va = $mod.TVerticalAlignment.taVerticalCenter}
       else if ($mod.TTextFormats.tfBottom in TextFormat) va = $mod.TVerticalAlignment.taAlignBottom;
      Result.$assign(this.TextRect$1($mod.TCanvasRectF.$clone(ARect),Text,$mod.TTextFormats.tfWordBreak in TextFormat,$mod.TTextFormats.tfCalcRect in TextFormat,ha,va));
      return Result;
    };
    this.TextWidth = function (Text) {
      var Result = 0.0;
      var f = "";
      var tm = null;
      if (this.FContext != null) {
        f = this.FFont.ToString();
        this.FContext.font = f;
        tm = this.FContext.measureText(Text);
        Result = tm.width;
      };
      return Result;
    };
    this.TextHeight = function (Text) {
      var Result = 0.0;
      Result = $mod.FontSizeToPx(this.FFont.FSize);
      return Result;
    };
    this.GetBase64Image = function () {
      var Result = "";
      Result = "";
      if (this.FElementCanvas != null) Result = this.FElementCanvas.toDataURL();
      return Result;
    };
    this.GetAsImage = function (AType) {
      var Result = "";
      Result = "";
      if (this.FElementCanvas != null) {
        var $tmp = AType;
        if ($tmp === $mod.TImageType.itBase64) {
          Result = this.FElementCanvas.toDataURL()}
         else if ($tmp === $mod.TImageType.itPNG) {
          Result = this.FElementCanvas.toDataURL("image/png")}
         else if ($tmp === $mod.TImageType.itJPEG) {
          Result = this.FElementCanvas.toDataURL("image/jpeg",1.0)}
         else if ($tmp === $mod.TImageType.itBMP) {
          Result = this.FElementCanvas.toDataURL("image/bmp")}
         else if ($tmp === $mod.TImageType.itGIF) {
          Result = this.FElementCanvas.toDataURL("image/gif")}
         else if ($tmp === $mod.TImageType.itSVG) Result = this.FElementCanvas.toDataURL("image/svg+xml");
      };
      return Result;
    };
    this.DownloadImage = function (AFileName, AType) {
      var s = "";
      var el = null;
      if (this.FElementCanvas != null) {
        s = this.GetAsImage(AType);
        el = document.createElement("a");
        el.setAttribute("href",s);
        if (AFileName !== "") el.setAttribute("download",AFileName);
        el.style.setProperty("display","none");
        document.body.appendChild(el);
        el.click();
        document.body.removeChild(el);
      };
    };
  });
  rtl.createClassExt(this,"TJSCSSStyleDeclarationEx",CSSStyleDeclaration,"",function () {
    this.$init = function () {
      this.filter = "";
    };
    this.$final = function () {
    };
  });
  rtl.createClassExt(this,"TJSHTMLElementEx",HTMLElement,"",function () {
    this.$init = function () {
    };
    this.$final = function () {
    };
  });
  rtl.createClassExt(this,"TJSCanvasRenderingContext2DEx",CanvasRenderingContext2D,"",function () {
    this.$init = function () {
    };
    this.$final = function () {
    };
  });
  rtl.createClass(this,"TURLPicture",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FOnChange = null;
      this.FFilename = "";
      this.FData = "";
      this.FOnDataChange = null;
      this.FWidth = 0;
      this.FHeight = 0;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      this.FOnDataChange = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetData = function (Value) {
      if (this.FData !== Value) {
        this.FData = Value;
        this.DataChanged();
      };
    };
    this.GetData = function () {
      var Result = "";
      Result = this.FData;
      return Result;
    };
    this.Changed = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.DataChanged = function () {
      if (this.FOnDataChange != null) this.FOnDataChange(this);
    };
    this.LoadFromFile = function (AFileName) {
      this.FFilename = AFileName;
      this.Changed();
    };
    this.Assign = function (Source) {
      if ($mod.TURLPicture.isPrototypeOf(Source)) {
        this.FFilename = rtl.as(Source,$mod.TURLPicture).FFilename;
        this.Changed();
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    var $r = this.$rtti;
    $r.addProperty("OnChange",0,pas.Classes.$rtti["TNotifyEvent"],"FOnChange","FOnChange");
    $r.addProperty("Data",3,$mod.$rtti["TBinaryString"],"GetData","SetData");
  });
  this.$rtti.$RefToProcVar("TThumbnailCreatedProc",{procsig: rtl.newTIProcSig([["ADataURL",rtl.string]])});
  this.ColorToRGB = function (Color) {
    var Result = 0;
    Result = Color;
    return Result;
  };
  this.ColorToHex = function (c) {
    var Result = "";
    var s = "";
    s = c.toString(16);
    
        while (s.length < 6)
        {
          s = "0" + s;
        };
    Result = pas.System.Copy(s,5,2) + pas.System.Copy(s,3,2) + pas.System.Copy(s,1,2);
    return Result;
  };
  this.ColorToHTML = function (c) {
    var Result = "";
    if ((c & 0xFFFFFFFF) === -1) {
      Result = "#00000000"}
     else if ((c & 0xFF000000) !== 0) {
      Result = "#" + $mod.ColorToHex(c & 0xFFFFFF) + pas.SysUtils.IntToHex(Math.floor((c & 0xFF000000) / 16777216) & 0xFF,2);
    } else Result = "#" + $mod.ColorToHex(c);
    return Result;
  };
  this.HTMLToColor = function (s) {
    var Result = 0;
    if (pas.System.Pos("#",s) === 1) pas.System.Delete({get: function () {
        return s;
      }, set: function (v) {
        s = v;
      }},1,1);
    Result = $mod.HexToColor(s);
    return Result;
  };
  this.ColorToString = function (Color) {
    var Result = "";
    var $tmp = Color;
    if ($tmp === -1) {
      Result = "clNone"}
     else if ($tmp === 0) {
      Result = "clBlack"}
     else if ($tmp === 128) {
      Result = "clMaroon"}
     else if ($tmp === 32768) {
      Result = "clGreen"}
     else if ($tmp === 32896) {
      Result = "clOlive"}
     else if ($tmp === 8388608) {
      Result = "clNavy"}
     else if ($tmp === 8388736) {
      Result = "clPurple"}
     else if ($tmp === 8421376) {
      Result = "clTeal"}
     else if ($tmp === 8421504) {
      Result = "clGray"}
     else if ($tmp === 12632256) {
      Result = "clSilver"}
     else if ($tmp === 255) {
      Result = "clRed"}
     else if ($tmp === 65280) {
      Result = "clLime"}
     else if ($tmp === 65535) {
      Result = "clYellow"}
     else if ($tmp === 16711680) {
      Result = "clBlue"}
     else if ($tmp === 16711935) {
      Result = "clFuchsia"}
     else if ($tmp === 16776960) {
      Result = "clAqua"}
     else if ($tmp === 16777215) {
      Result = "clWhite"}
     else if ($tmp === 12698049) {
      Result = "clLtGray"}
     else if ($tmp === 8487297) {
      Result = "clDkGray"}
     else if ($tmp === 536870912) {
      Result = "clDefault"}
     else if ($tmp === 15790320) {
      Result = "clBtnFace"}
     else if ($tmp === 65793) {
      Result = "clWindowText"}
     else if ($tmp === 16711422) {
      Result = "clWindow"}
     else if ($tmp === 14120960) {
      Result = "clHighlight"}
     else if ($tmp === 197379) {
      Result = "clHighlightText"}
     else if ($tmp === 131586) {
      Result = "clInfoText"}
     else if ($tmp === 14811135) {
      Result = "clInfoBk"}
     else if ($tmp === 13743257) {
      Result = "clActiveCaption"}
     else if ($tmp === 14405055) {
      Result = "clInactiveCaption"}
     else if ($tmp === 13395456) {
      Result = "clHotLight"}
     else {
      Result = "$" + $impl.ColorToVCL(Color);
    };
    return Result;
  };
  this.StringToColor = function (S) {
    var Result = 0;
    var us = "";
    var clr = 0;
    us = pas.SysUtils.UpperCase(S);
    if (us === "CLNONE") {
      Result = -1}
     else if (us === "CLBLACK") {
      Result = 0}
     else if (us === "CLMAROON") {
      Result = 128}
     else if (us === "CLGREEN") {
      Result = 32768}
     else if (us === "CLOLIVE") {
      Result = 32896}
     else if (us === "CLNAVY") {
      Result = 8388608}
     else if (us === "CLPURPLE") {
      Result = 8388736}
     else if (us === "CLTEAL") {
      Result = 8421376}
     else if (us === "CLGRAY") {
      Result = 8421504}
     else if (us === "CLSILVER") {
      Result = 12632256}
     else if (us === "CLRED") {
      Result = 255}
     else if (us === "CLLIME") {
      Result = 65280}
     else if (us === "CLYELLOW") {
      Result = 65535}
     else if (us === "CLBLUE") {
      Result = 16711680}
     else if (us === "CLFUCHSIA") {
      Result = 16711935}
     else if (us === "CLAQUA") {
      Result = 16776960}
     else if (us === "CLWHITE") {
      Result = 16777215}
     else if (us === "CLLTGRAY") {
      Result = 12698049}
     else if (us === "CLDKGRAY") {
      Result = 8487297}
     else if (us === "CLDEFAULT") {
      Result = 536870912}
     else if (us === "CLBTNFACE") {
      Result = 15790320}
     else if (us === "CLWINDOWTEXT") {
      Result = 65793}
     else if (us === "CLWINDOW") {
      Result = 16711422}
     else if (us === "CLHIGHLIGHT") {
      Result = 14120960}
     else if (us === "CLHIGHLIGHTTEXT") {
      Result = 16777215}
     else if (us === "CLINFOTEXT") {
      Result = 131586}
     else if (us === "CLINFOBK") {
      Result = 14811135}
     else if (us === "CLACTIVECAPTION") {
      Result = 13743257}
     else if (us === "CLINACTIVECAPTION") {
      Result = 14405055}
     else if (us === "CLHOTLIGHT") {
      Result = 13395456}
     else {
      clr = $mod.HexToColor(us);
      Result = ((clr & 0xFF) << 16) | (clr & 0xFF00) | ((clr & 0xFF0000) >>> 16) | (clr & 0xFF000000);
    };
    return Result;
  };
  this.CharsetToIdent = function (ACharSet) {
    var Result = "";
    var $tmp = ACharSet;
    if ($tmp === 0) {
      Result = "ANSI_CHARSET"}
     else if ($tmp === 1) {
      Result = "DEFAULT_CHARSET"}
     else if ($tmp === 2) {
      Result = "SYMBOL_CHARSET"}
     else if ($tmp === 77) {
      Result = "MAC_CHARSET"}
     else if ($tmp === 128) {
      Result = "SHIFTJIS_CHARSET"}
     else if ($tmp === 129) {
      Result = "HANGEUL_CHARSET"}
     else if ($tmp === 130) {
      Result = "JOHAB_CHARSET"}
     else if ($tmp === 134) {
      Result = "GB2312_CHARSET"}
     else if ($tmp === 136) {
      Result = "CHINESEBIG5_CHARSET"}
     else if ($tmp === 161) {
      Result = "GREEK_CHARSET"}
     else if ($tmp === 162) {
      Result = "TURKISH_CHARSET"}
     else if ($tmp === 177) {
      Result = "HEBREW_CHARSET"}
     else if ($tmp === 178) {
      Result = "ARABIC_CHARSET"}
     else if ($tmp === 186) {
      Result = "BALTIC_CHARSET"}
     else if ($tmp === 204) {
      Result = "RUSSIAN_CHARSET"}
     else if ($tmp === 222) {
      Result = "THAI_CHARSET"}
     else if ($tmp === 238) {
      Result = "EASTEUROPE_CHARSET"}
     else if ($tmp === 255) Result = "OEM_CHARSET";
    return Result;
  };
  this.IdentToCharset = function (S) {
    var Result = 0;
    if (S === "ANSI_CHARSET") Result = 0;
    if (S === "DEFAULT_CHARSET") Result = 1;
    if (S === "SYMBOL_CHARSET") Result = 2;
    if (S === "MAC_CHARSET") Result = 77;
    if (S === "SHIFTJIS_CHARSET") Result = 128;
    if (S === "HANGEUL_CHARSET") Result = 129;
    if (S === "JOHAB_CHARSET") Result = 130;
    if (S === "GB2312_CHARSET") Result = 134;
    if (S === "CHINESEBIG5_CHARSET") Result = 136;
    if (S === "GREEK_CHARSET") Result = 161;
    if (S === "TURKISH_CHARSET") Result = 162;
    if (S === "HEBREW_CHARSET") Result = 177;
    if (S === "ARABIC_CHARSET") Result = 178;
    if (S === "BALTIC_CHARSET") Result = 186;
    if (S === "RUSSIAN_CHARSET") Result = 204;
    if (S === "THAI_CHARSET") Result = 222;
    if (S === "EASTEUROPE_CHARSET") Result = 238;
    if (S === "OEM_CHARSET") Result = 255;
    return Result;
  };
  this.FontSizeToHTML = function (sz) {
    var Result = "";
    Result = pas.SysUtils.FloatToStr(sz) + "px";
    Result = pas.SysUtils.StringReplace(Result,",",".",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
    return Result;
  };
  this.HTMLChar = function (h) {
    var Result = 0;
    pas.System.Delete({get: function () {
        return h;
      }, set: function (v) {
        h = v;
      }},1,3);
    pas.System.Delete({get: function () {
        return h;
      }, set: function (v) {
        h = v;
      }},h.length - 1,1);
    Result = pas.SysUtils.StrToInt("0x" + h);
    return Result;
  };
  this.HexToColor = function (h) {
    var Result = 0;
    var s = "";
    var i = 0;
    s = "";
    for (var $l = 1, $end = h.length; $l <= $end; $l++) {
      i = $l;
      if (((h.charAt(i - 1) >= "0") && (h.charAt(i - 1) <= "9")) || ((h.charAt(i - 1) >= "A") && (h.charAt(i - 1) <= "F")) || ((h.charAt(i - 1) >= "a") && (h.charAt(i - 1) <= "f"))) s = s + h.charAt(i - 1);
    };
    if (s.length > 6) {
      s = "$" + pas.System.Copy(s,1,2) + pas.System.Copy(s,7,2) + pas.System.Copy(s,5,2) + pas.System.Copy(s,3,2)}
     else if (s.length === 3) {
      s = "$" + pas.System.Copy(s,3,1) + pas.System.Copy(s,3,1) + pas.System.Copy(s,2,1) + pas.System.Copy(s,2,1) + pas.System.Copy(s,1,1) + pas.System.Copy(s,1,1)}
     else s = "$" + pas.System.Copy(s,5,2) + pas.System.Copy(s,3,2) + pas.System.Copy(s,1,2);
    Result = pas.SysUtils.StrToInt64(s);
    return Result;
  };
  this.RGBToColor = function (argb) {
    var Result = 0;
    var r = "";
    var g = "";
    var b = "";
    var ri = 0;
    var gi = 0;
    var bi = 0;
    var e = 0;
    Result = -1;
    argb = pas.SysUtils.Trim(argb);
    if (pas.System.Pos("RGB",pas.SysUtils.UpperCase(argb)) > 0) {
      pas.System.Delete({get: function () {
          return argb;
        }, set: function (v) {
          argb = v;
        }},1,4);
      r = pas.System.Copy(argb,1,pas.System.Pos(",",argb) - 1);
      pas.System.Delete({get: function () {
          return argb;
        }, set: function (v) {
          argb = v;
        }},1,pas.System.Pos(",",argb) + 1);
      g = pas.System.Copy(argb,1,pas.System.Pos(",",argb) - 1);
      pas.System.Delete({get: function () {
          return argb;
        }, set: function (v) {
          argb = v;
        }},1,pas.System.Pos(",",argb) + 1);
      b = pas.System.Copy(argb,1,pas.System.Pos(")",argb) - 1);
      pas.System.val$3(r,{get: function () {
          return ri;
        }, set: function (v) {
          ri = v;
        }},{get: function () {
          return e;
        }, set: function (v) {
          e = v;
        }});
      pas.System.val$3(g,{get: function () {
          return gi;
        }, set: function (v) {
          gi = v;
        }},{get: function () {
          return e;
        }, set: function (v) {
          e = v;
        }});
      pas.System.val$3(b,{get: function () {
          return bi;
        }, set: function (v) {
          bi = v;
        }},{get: function () {
          return e;
        }, set: function (v) {
          e = v;
        }});
      Result = $mod.RGB(ri,gi,bi);
    };
    return Result;
  };
  this.FontSizeToPx = function (sz) {
    var Result = 0.0;
    Result = (sz * 96) / 72;
    return Result;
  };
  this.GetRValue = function (rgb) {
    var Result = 0;
    Result = rgb & 0xFF & 255;
    return Result;
  };
  this.GetGValue = function (rgb) {
    var Result = 0;
    Result = Math.floor(rgb / 256) & 0xFF & 255;
    return Result;
  };
  this.GetBValue = function (rgb) {
    var Result = 0;
    Result = Math.floor(rgb / 65536) & 0xFF & 255;
    return Result;
  };
  this.CreateCanvasRectF = function (Left, Top, Right, Bottom) {
    var Result = $mod.TCanvasRectF.$new();
    Result.Left = Left;
    Result.Top = Top;
    Result.Right = Right;
    Result.Bottom = Bottom;
    return Result;
  };
  this.CreateCanvasPointF = function (X, Y) {
    var Result = $mod.TCanvasPointF.$new();
    Result.X = X;
    Result.Y = Y;
    return Result;
  };
  this.CreateCanvasSizeF = function (cx, cy) {
    var Result = $mod.TCanvasSizeF.$new();
    Result.cx = cx;
    Result.cy = cy;
    return Result;
  };
  this.CanvasRectF = function (Left, Top, Right, Bottom) {
    var Result = $mod.TCanvasRectF.$new();
    Result.$assign($mod.CreateCanvasRectF(Left,Top,Right,Bottom));
    return Result;
  };
  this.CanvasPointF = function (X, Y) {
    var Result = $mod.TCanvasPointF.$new();
    Result.$assign($mod.CreateCanvasPointF(X,Y));
    return Result;
  };
  this.CanvasSizeF = function (cx, cy) {
    var Result = $mod.TCanvasSizeF.$new();
    Result.$assign($mod.CreateCanvasSizeF(cx,cy));
    return Result;
  };
  this.RGB = function (r, g, b) {
    var Result = 0;
    Result = r | (g << 8) | (b << 16);
    return Result;
  };
  this.RGBA = function (r, g, b, a) {
    var Result = 0;
    Result = r | (g << 8) | (b << 16) | (a << 24);
    return Result;
  };
  this.CSSFont = function (Font) {
    var Result = "";
    var res = "";
    var fs = "";
    res = "font-family:" + Font.FName + ";";
    res = res + "font-style: normal;";
    if ($mod.TFontStyle.fsBold in Font.FStyle) res = res + "font-weight: bold;";
    if ($mod.TFontStyle.fsItalic in Font.FStyle) res = res + "font-style: italic;";
    fs = "";
    if ($mod.TFontStyle.fsUnderline in Font.FStyle) fs = fs + " underline";
    if ($mod.TFontStyle.fsStrikeOut in Font.FStyle) fs = fs + " line-through";
    if (fs !== "") res = res + "text-decoration:" + fs + ";";
    res = res + "font-size:" + pas.SysUtils.IntToStr(Font.FSize) + "pt;";
    Result = res;
    return Result;
  };
  this.CreateThumbnail = function (ADataURL, AWidth, AHeight, UseAspectRatio, ThumbnailReady) {
    var LImg = null;
    if ((AWidth <= 0) || (AHeight <= 0)) return;
    LImg = document.createElement("IMG");
    LImg.onload = function() {
    
          var w = LImg.width;
          var h = LImg.height;
    
          var neww = AWidth;
          var newh = AHeight;
    
          if (UseAspectRatio) {
            if ((w/neww) > (h/newh))
            {
              newh = h / (w/neww);
            }
            else
            {
              neww = w / (h/newh);
            }
          }
          var LCanvas = document.createElement('CANVAS');
          var ctx = LCanvas.getContext("2d");
          ctx.drawImage(LImg, 0, 0, neww, newh);
          var res = LCanvas.toDataURL("image/png");
          ThumbnailReady(res);
        };
    LImg.setAttribute("src",ADataURL);
  };
  $mod.$implcode = function () {
    rtl.createClass($impl,"TGraphicCache",pas.System.TObject,function () {
      this.$init = function () {
        pas.System.TObject.$init.call(this);
        this.FImage = null;
        this.FID = "";
      };
      this.$final = function () {
        this.FImage = undefined;
        pas.System.TObject.$final.call(this);
      };
      this.Create$1 = function (AImage, AID) {
        this.FImage = AImage;
        this.FID = AID;
        return this;
      };
    });
    rtl.createClass($impl,"TGraphicCacheList",pas.contnrs.TObjectList,function () {
      this.Find = function (AID, FImage) {
        var Result = false;
        var I = 0;
        var it = null;
        Result = false;
        for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          it = rtl.as(this.GetItem(I),$impl.TGraphicCache);
          if ((it.FID === AID) && (it.FImage != null)) {
            FImage.set(it.FImage);
            Result = true;
            break;
          };
        };
        return Result;
      };
      this.Exists = function (AID) {
        var Result = false;
        var I = 0;
        var it = null;
        Result = false;
        for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          it = rtl.as(this.GetItem(I),$impl.TGraphicCache);
          if ((it.FID === AID) && (it.FImage != null)) {
            Result = true;
            break;
          };
        };
        return Result;
      };
    });
    $impl.FCache = null;
    $impl.FQueue = null;
    $impl.FCacheCount = 0;
    $impl.MatrixIdentity = function () {
      var Result = $mod.TMatrix.$new();
      Result.m11 = 1;
      Result.m12 = 0;
      Result.m13 = 0;
      Result.m21 = 0;
      Result.m22 = 1;
      Result.m23 = 0;
      Result.m31 = 0;
      Result.m32 = 0;
      Result.m33 = 1;
      return Result;
    };
    $impl.GetPixelRatio = function (ACanvas) {
      var Result = 0.0;
      var res = 0.0;
      var ca = null;
      ca = ACanvas;
      var ctx = ca.FContext,
          dpr = window.devicePixelRatio || 1,
          bsr = ctx.webkitBackingStorePixelRatio ||
                ctx.mozBackingStorePixelRatio ||
                ctx.msBackingStorePixelRatio ||
                ctx.oBackingStorePixelRatio ||
                ctx.backingStorePixelRatio || 1;
      res = dpr / bsr;
      Result = res;
      return Result;
    };
    $impl.MatrixCreateScaling = function (AScaleX, AScaleY) {
      var Result = $mod.TMatrix.$new();
      Result.$assign($impl.MatrixIdentity());
      Result.m11 = AScaleX;
      Result.m22 = AScaleY;
      return Result;
    };
    $impl.MatrixMultiply = function (AMatrix1, AMatrix2) {
      var Result = $mod.TMatrix.$new();
      Result.m11 = (AMatrix1.m11 * AMatrix2.m11) + (AMatrix1.m12 * AMatrix2.m21) + (AMatrix1.m13 * AMatrix2.m31);
      Result.m12 = (AMatrix1.m11 * AMatrix2.m12) + (AMatrix1.m12 * AMatrix2.m22) + (AMatrix1.m13 * AMatrix2.m32);
      Result.m13 = (AMatrix1.m11 * AMatrix2.m13) + (AMatrix1.m12 * AMatrix2.m23) + (AMatrix1.m13 * AMatrix2.m33);
      Result.m21 = (AMatrix1.m21 * AMatrix2.m11) + (AMatrix1.m22 * AMatrix2.m21) + (AMatrix1.m23 * AMatrix2.m31);
      Result.m22 = (AMatrix1.m21 * AMatrix2.m12) + (AMatrix1.m22 * AMatrix2.m22) + (AMatrix1.m23 * AMatrix2.m32);
      Result.m23 = (AMatrix1.m21 * AMatrix2.m13) + (AMatrix1.m22 * AMatrix2.m23) + (AMatrix1.m23 * AMatrix2.m33);
      Result.m31 = (AMatrix1.m31 * AMatrix2.m11) + (AMatrix1.m32 * AMatrix2.m21) + (AMatrix1.m33 * AMatrix2.m31);
      Result.m32 = (AMatrix1.m31 * AMatrix2.m12) + (AMatrix1.m32 * AMatrix2.m22) + (AMatrix1.m33 * AMatrix2.m32);
      Result.m33 = (AMatrix1.m31 * AMatrix2.m13) + (AMatrix1.m32 * AMatrix2.m23) + (AMatrix1.m33 * AMatrix2.m33);
      return Result;
    };
    $impl.ColorToVCL = function (c) {
      var Result = "";
      var s = "";
      s = c.toString(16);
      while (s.length < 6)
      {
        s = "0" + s;
      };
      Result = pas.System.Copy(s,1,2) + pas.System.Copy(s,3,2) + pas.System.Copy(s,5,2);
      return Result;
    };
    $impl.AngleOfPoints = function (x1, y1, x2, y2) {
      var Result = 0.0;
      var part1 = 0.0;
      var part2 = 0.0;
      var angle = 0.0;
      if ((x1 === x2) && (y1 === y2)) {
        Result = 0.0;
        return Result;
      };
      part1 = Math.abs(y2 - y1);
      if (part1 === 0) {
        part1 = 0.0000001;
        y1 = y1 + 0.0000001;
      };
      part2 = Math.abs(x2 - x1);
      if (part2 === 0) {
        part2 = 0.0000001;
        x1 = x1 + 0.0000001;
      };
      angle = Math.atan(part1 / part2);
      if ((x1 > x2) && (y1 < y2)) angle = Math.PI - angle;
      if ((x1 > x2) && (y1 > y2)) angle = angle + Math.PI;
      if ((x1 < x2) && (y1 > y2)) angle = (2 * Math.PI) - angle;
      while (angle >= (2 * Math.PI)) angle = angle - (2 * Math.PI);
      while (angle < 0) angle = angle + (2 * Math.PI);
      Result = angle;
      return Result;
    };
  };
  $mod.$init = function () {
    $impl.FCache = $impl.TGraphicCacheList.$create("Create$2");
    $impl.FQueue = pas.Classes.TStringList.$create("Create$1");
  };
},["WEBLib.Forms","WEBLib.WebTools","Math","SysUtils","contnrs"]);
rtl.module("WEBLib.Modules",["System","Classes"],function () {
  "use strict";
  var $mod = this;
  this.$rtti.$Class("TDataModule");
  this.$rtti.$ClassRef("TDataModuleClass",{instancetype: this.$rtti["TDataModule"]});
  rtl.createClass(this,"TDataModule",pas.Classes.TComponent,function () {
    this.$init = function () {
      pas.Classes.TComponent.$init.call(this);
      this.FHeight = 0;
      this.FOldCreateOrder = false;
      this.FOnCreate = null;
      this.FOnDestroy = null;
      this.FWidth = 0;
    };
    this.$final = function () {
      this.FOnCreate = undefined;
      this.FOnDestroy = undefined;
      pas.Classes.TComponent.$final.call(this);
    };
    this.DoCreate = function () {
      this.LoadDFMValues();
      if (this.FOnCreate != null) this.FOnCreate(this);
    };
    this.DoDestroy = function () {
      if (this.FOnDestroy != null) this.FOnDestroy(this);
    };
    this.LoadDFMValues = function () {
    };
    this.CreateNew = function (AOwner, Dummy) {
      pas.Classes.TComponent.Create$1.call(this,AOwner);
      return this;
    };
    this.AfterConstruction = function () {
      pas.System.TObject.AfterConstruction.call(this);
      if (!this.FOldCreateOrder) this.DoCreate();
    };
    this.BeforeDestruction = function () {
      pas.Classes.TComponent.BeforeDestruction.call(this);
      if (!this.FOldCreateOrder) this.DoDestroy();
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("OnCreate",0,pas.Classes.$rtti["TNotifyEvent"],"FOnCreate","FOnCreate");
    $r.addProperty("OnDestroy",0,pas.Classes.$rtti["TNotifyEvent"],"FOnDestroy","FOnDestroy");
  });
});
rtl.module("WEBLib.Lang",["System"],function () {
  "use strict";
  var $mod = this;
  this.TUILanguage = {"0": "lNone", lNone: 0, "1": "lAfar", lAfar: 1, "2": "lAbkhazian", lAbkhazian: 2, "3": "lAvestan", lAvestan: 3, "4": "lAfrikaans", lAfrikaans: 4, "5": "lAkan", lAkan: 5, "6": "lAmharic", lAmharic: 6, "7": "lAragonese", lAragonese: 7, "8": "lArabic", lArabic: 8, "9": "lAssamese", lAssamese: 9, "10": "lAvaric", lAvaric: 10, "11": "lAymara", lAymara: 11, "12": "lAzerbaijani", lAzerbaijani: 12, "13": "lBashkir", lBashkir: 13, "14": "lBelarusian", lBelarusian: 14, "15": "lBulgarian", lBulgarian: 15, "16": "lBihari", lBihari: 16, "17": "lBislama", lBislama: 17, "18": "lBambara", lBambara: 18, "19": "lBengali", lBengali: 19, "20": "lTibetan", lTibetan: 20, "21": "lBreton", lBreton: 21, "22": "lBosnian", lBosnian: 22, "23": "lCatalan", lCatalan: 23, "24": "lChechen", lChechen: 24, "25": "lChamorro", lChamorro: 25, "26": "lCorsican", lCorsican: 26, "27": "lCree", lCree: 27, "28": "lCzech", lCzech: 28, "29": "lOldSlavic", lOldSlavic: 29, "30": "lChuvash", lChuvash: 30, "31": "lWelsh", lWelsh: 31, "32": "lDanish", lDanish: 32, "33": "lGerman", lGerman: 33, "34": "lDivehi", lDivehi: 34, "35": "lDzongkha", lDzongkha: 35, "36": "lEwe", lEwe: 36, "37": "lEnglish", lEnglish: 37, "38": "lEsperanto", lEsperanto: 38, "39": "lSpanish", lSpanish: 39, "40": "lEstonian", lEstonian: 40, "41": "lBasque", lBasque: 41, "42": "lPersian", lPersian: 42, "43": "lFulah", lFulah: 43, "44": "lFinnish", lFinnish: 44, "45": "lFijian", lFijian: 45, "46": "lFaroese", lFaroese: 46, "47": "lFrench", lFrench: 47, "48": "lWesternFrisian", lWesternFrisian: 48, "49": "lIrish", lIrish: 49, "50": "lGaelic", lGaelic: 50, "51": "lGalician", lGalician: 51, "52": "lGuarani", lGuarani: 52, "53": "lGujarati", lGujarati: 53, "54": "lManx", lManx: 54, "55": "lHausa", lHausa: 55, "56": "lHebrew", lHebrew: 56, "57": "lHindi", lHindi: 57, "58": "lHiriMotu", lHiriMotu: 58, "59": "lCroatian", lCroatian: 59, "60": "lHaitian", lHaitian: 60, "61": "lHungarian", lHungarian: 61, "62": "lArmenian", lArmenian: 62, "63": "lHerero", lHerero: 63, "64": "lInterlingua", lInterlingua: 64, "65": "lIndonesian", lIndonesian: 65, "66": "lInterlingue", lInterlingue: 66, "67": "lIgbo", lIgbo: 67, "68": "lSichuanYi", lSichuanYi: 68, "69": "lInupiaq", lInupiaq: 69, "70": "lIdo", lIdo: 70, "71": "lIcelandic", lIcelandic: 71, "72": "lItalian", lItalian: 72, "73": "lInuktitut", lInuktitut: 73, "74": "lJapanese", lJapanese: 74, "75": "lJavanese", lJavanese: 75, "76": "lGeorgian", lGeorgian: 76, "77": "lKongo", lKongo: 77, "78": "lKikuyu", lKikuyu: 78, "79": "lKuanyama", lKuanyama: 79, "80": "lKazakh", lKazakh: 80, "81": "lKalaallisut", lKalaallisut: 81, "82": "lCentralKhmer", lCentralKhmer: 82, "83": "lKannada", lKannada: 83, "84": "lKorean", lKorean: 84, "85": "lKanuri", lKanuri: 85, "86": "lKashmiri", lKashmiri: 86, "87": "lKurdish", lKurdish: 87, "88": "lKomi", lKomi: 88, "89": "lCornish", lCornish: 89, "90": "lKirghiz", lKirghiz: 90, "91": "lLatin", lLatin: 91, "92": "lLuxembourgish", lLuxembourgish: 92, "93": "lGanda", lGanda: 93, "94": "lLimburgan", lLimburgan: 94, "95": "lLingala", lLingala: 95, "96": "lLao", lLao: 96, "97": "lLithuanian", lLithuanian: 97, "98": "lLubaKatanga", lLubaKatanga: 98, "99": "lLatvian", lLatvian: 99, "100": "lMalagasy", lMalagasy: 100, "101": "lMarshallese", lMarshallese: 101, "102": "lMaori", lMaori: 102, "103": "lMacedonian", lMacedonian: 103, "104": "lMalayalam", lMalayalam: 104, "105": "lMongolian", lMongolian: 105, "106": "lMarathi", lMarathi: 106, "107": "lMalay", lMalay: 107, "108": "lMaltese", lMaltese: 108, "109": "lBurmese", lBurmese: 109, "110": "lNauru", lNauru: 110, "111": "lNdebele", lNdebele: 111, "112": "lNepali", lNepali: 112, "113": "lNdonga", lNdonga: 113, "114": "lDutch", lDutch: 114, "115": "lNorwegian", lNorwegian: 115, "116": "lNavajo", lNavajo: 116, "117": "lChichewa", lChichewa: 117, "118": "lOccitan", lOccitan: 118, "119": "lOjibwa", lOjibwa: 119, "120": "lOromo", lOromo: 120, "121": "lOriya", lOriya: 121, "122": "lOssetian", lOssetian: 122, "123": "lPanjabi", lPanjabi: 123, "124": "lPali", lPali: 124, "125": "lPolish", lPolish: 125, "126": "lPushto", lPushto: 126, "127": "lPortuguese", lPortuguese: 127, "128": "lQuechua", lQuechua: 128, "129": "lRomansh", lRomansh: 129, "130": "lRundi", lRundi: 130, "131": "lRomanian", lRomanian: 131, "132": "lRussian", lRussian: 132, "133": "lKinyarwanda", lKinyarwanda: 133, "134": "lSanskrit", lSanskrit: 134, "135": "lSardinian", lSardinian: 135, "136": "lSindhi", lSindhi: 136, "137": "lNorthernSami", lNorthernSami: 137, "138": "lSango", lSango: 138, "139": "lSinhala", lSinhala: 139, "140": "lSlovak", lSlovak: 140, "141": "lSlovenian", lSlovenian: 141, "142": "lSamoan", lSamoan: 142, "143": "lShona", lShona: 143, "144": "lSomali", lSomali: 144, "145": "lAlbanian", lAlbanian: 145, "146": "lSerbian", lSerbian: 146, "147": "lSwati", lSwati: 147, "148": "lSotho", lSotho: 148, "149": "lSundanese", lSundanese: 149, "150": "lSwedish", lSwedish: 150, "151": "lSwahili", lSwahili: 151, "152": "lTamil", lTamil: 152, "153": "lTelugu", lTelugu: 153, "154": "lTajik", lTajik: 154, "155": "lThai", lThai: 155, "156": "lTigrinya", lTigrinya: 156, "157": "lTurkmen", lTurkmen: 157, "158": "lTagalog", lTagalog: 158, "159": "lTswana", lTswana: 159, "160": "lTonga", lTonga: 160, "161": "lTurkish", lTurkish: 161, "162": "lTsonga", lTsonga: 162, "163": "lTatar", lTatar: 163, "164": "lTwi", lTwi: 164, "165": "lTahitian", lTahitian: 165, "166": "lUighur", lUighur: 166, "167": "lUkrainian", lUkrainian: 167, "168": "lUrdu", lUrdu: 168, "169": "lUzbek", lUzbek: 169, "170": "lVenda", lVenda: 170, "171": "lVietnamese", lVietnamese: 171, "172": "lWalloon", lWalloon: 172, "173": "lWolof", lWolof: 173, "174": "lXhosa", lXhosa: 174, "175": "lYiddish", lYiddish: 175, "176": "lYoruba", lYoruba: 176, "177": "lZhuang", lZhuang: 177, "178": "lChinese", lChinese: 178, "179": "lZulu", lZulu: 179};
  this.$rtti.$Enum("TUILanguage",{minvalue: 0, maxvalue: 179, ordtype: 1, enumtype: this.TUILanguage});
  this.GetLanguageISO639_1Code = function (ALang) {
    var Result = "";
    var $tmp = ALang;
    if ($tmp === $mod.TUILanguage.lNone) {
      Result = ""}
     else if ($tmp === $mod.TUILanguage.lAfar) {
      Result = "aa"}
     else if ($tmp === $mod.TUILanguage.lAbkhazian) {
      Result = "ab"}
     else if ($tmp === $mod.TUILanguage.lAvestan) {
      Result = "ae"}
     else if ($tmp === $mod.TUILanguage.lAfrikaans) {
      Result = "af"}
     else if ($tmp === $mod.TUILanguage.lAkan) {
      Result = "ak"}
     else if ($tmp === $mod.TUILanguage.lAmharic) {
      Result = "am"}
     else if ($tmp === $mod.TUILanguage.lAragonese) {
      Result = "an"}
     else if ($tmp === $mod.TUILanguage.lArabic) {
      Result = "ar"}
     else if ($tmp === $mod.TUILanguage.lAssamese) {
      Result = "as"}
     else if ($tmp === $mod.TUILanguage.lAvaric) {
      Result = "av"}
     else if ($tmp === $mod.TUILanguage.lAymara) {
      Result = "ay"}
     else if ($tmp === $mod.TUILanguage.lAzerbaijani) {
      Result = "az"}
     else if ($tmp === $mod.TUILanguage.lBashkir) {
      Result = "ba"}
     else if ($tmp === $mod.TUILanguage.lBelarusian) {
      Result = "be"}
     else if ($tmp === $mod.TUILanguage.lBulgarian) {
      Result = "bg"}
     else if ($tmp === $mod.TUILanguage.lBihari) {
      Result = "bh"}
     else if ($tmp === $mod.TUILanguage.lBislama) {
      Result = "bi"}
     else if ($tmp === $mod.TUILanguage.lBambara) {
      Result = "bm"}
     else if ($tmp === $mod.TUILanguage.lBengali) {
      Result = "bn"}
     else if ($tmp === $mod.TUILanguage.lTibetan) {
      Result = "bo"}
     else if ($tmp === $mod.TUILanguage.lBreton) {
      Result = "br"}
     else if ($tmp === $mod.TUILanguage.lBosnian) {
      Result = "bd"}
     else if ($tmp === $mod.TUILanguage.lCatalan) {
      Result = "ca"}
     else if ($tmp === $mod.TUILanguage.lChechen) {
      Result = "ce"}
     else if ($tmp === $mod.TUILanguage.lChamorro) {
      Result = "ch"}
     else if ($tmp === $mod.TUILanguage.lCorsican) {
      Result = "co"}
     else if ($tmp === $mod.TUILanguage.lCree) {
      Result = "cr"}
     else if ($tmp === $mod.TUILanguage.lCzech) {
      Result = "cs"}
     else if ($tmp === $mod.TUILanguage.lOldSlavic) {
      Result = "cu"}
     else if ($tmp === $mod.TUILanguage.lChuvash) {
      Result = "cv"}
     else if ($tmp === $mod.TUILanguage.lWelsh) {
      Result = "cy"}
     else if ($tmp === $mod.TUILanguage.lDanish) {
      Result = "da"}
     else if ($tmp === $mod.TUILanguage.lGerman) {
      Result = "de"}
     else if ($tmp === $mod.TUILanguage.lDivehi) {
      Result = "dv"}
     else if ($tmp === $mod.TUILanguage.lDzongkha) {
      Result = "dz"}
     else if ($tmp === $mod.TUILanguage.lEwe) {
      Result = "ee"}
     else if ($tmp === $mod.TUILanguage.lEnglish) {
      Result = "en"}
     else if ($tmp === $mod.TUILanguage.lEsperanto) {
      Result = "eo"}
     else if ($tmp === $mod.TUILanguage.lSpanish) {
      Result = "es"}
     else if ($tmp === $mod.TUILanguage.lEstonian) {
      Result = "et"}
     else if ($tmp === $mod.TUILanguage.lBasque) {
      Result = "eu"}
     else if ($tmp === $mod.TUILanguage.lPersian) {
      Result = "fa"}
     else if ($tmp === $mod.TUILanguage.lFulah) {
      Result = "ff"}
     else if ($tmp === $mod.TUILanguage.lFinnish) {
      Result = "fi"}
     else if ($tmp === $mod.TUILanguage.lFijian) {
      Result = "fj"}
     else if ($tmp === $mod.TUILanguage.lFaroese) {
      Result = "fo"}
     else if ($tmp === $mod.TUILanguage.lFrench) {
      Result = "fr"}
     else if ($tmp === $mod.TUILanguage.lWesternFrisian) {
      Result = "fy"}
     else if ($tmp === $mod.TUILanguage.lIrish) {
      Result = "ga"}
     else if ($tmp === $mod.TUILanguage.lGaelic) {
      Result = "gd"}
     else if ($tmp === $mod.TUILanguage.lGalician) {
      Result = "gl"}
     else if ($tmp === $mod.TUILanguage.lGuarani) {
      Result = "gn"}
     else if ($tmp === $mod.TUILanguage.lGujarati) {
      Result = "gu"}
     else if ($tmp === $mod.TUILanguage.lManx) {
      Result = "gv"}
     else if ($tmp === $mod.TUILanguage.lHausa) {
      Result = "ha"}
     else if ($tmp === $mod.TUILanguage.lHebrew) {
      Result = "he"}
     else if ($tmp === $mod.TUILanguage.lHindi) {
      Result = "hi"}
     else if ($tmp === $mod.TUILanguage.lHiriMotu) {
      Result = "ho"}
     else if ($tmp === $mod.TUILanguage.lCroatian) {
      Result = "hr"}
     else if ($tmp === $mod.TUILanguage.lHaitian) {
      Result = "ht"}
     else if ($tmp === $mod.TUILanguage.lHungarian) {
      Result = "hu"}
     else if ($tmp === $mod.TUILanguage.lArmenian) {
      Result = "hy"}
     else if ($tmp === $mod.TUILanguage.lHerero) {
      Result = "hz"}
     else if ($tmp === $mod.TUILanguage.lInterlingua) {
      Result = "ia"}
     else if ($tmp === $mod.TUILanguage.lIndonesian) {
      Result = "id"}
     else if ($tmp === $mod.TUILanguage.lInterlingue) {
      Result = "ie"}
     else if ($tmp === $mod.TUILanguage.lIgbo) {
      Result = "ig"}
     else if ($tmp === $mod.TUILanguage.lSichuanYi) {
      Result = "ii"}
     else if ($tmp === $mod.TUILanguage.lInupiaq) {
      Result = "ik"}
     else if ($tmp === $mod.TUILanguage.lIdo) {
      Result = "id"}
     else if ($tmp === $mod.TUILanguage.lIcelandic) {
      Result = "is"}
     else if ($tmp === $mod.TUILanguage.lItalian) {
      Result = "it"}
     else if ($tmp === $mod.TUILanguage.lInuktitut) {
      Result = "iu"}
     else if ($tmp === $mod.TUILanguage.lJapanese) {
      Result = "ja"}
     else if ($tmp === $mod.TUILanguage.lJavanese) {
      Result = "jv"}
     else if ($tmp === $mod.TUILanguage.lGeorgian) {
      Result = "ka"}
     else if ($tmp === $mod.TUILanguage.lKongo) {
      Result = "kg"}
     else if ($tmp === $mod.TUILanguage.lKikuyu) {
      Result = "ki"}
     else if ($tmp === $mod.TUILanguage.lKuanyama) {
      Result = "kj"}
     else if ($tmp === $mod.TUILanguage.lKazakh) {
      Result = "kk"}
     else if ($tmp === $mod.TUILanguage.lKalaallisut) {
      Result = "kl"}
     else if ($tmp === $mod.TUILanguage.lCentralKhmer) {
      Result = "km"}
     else if ($tmp === $mod.TUILanguage.lKannada) {
      Result = "kn"}
     else if ($tmp === $mod.TUILanguage.lKorean) {
      Result = "ko"}
     else if ($tmp === $mod.TUILanguage.lKanuri) {
      Result = "kr"}
     else if ($tmp === $mod.TUILanguage.lKashmiri) {
      Result = "ks"}
     else if ($tmp === $mod.TUILanguage.lKurdish) {
      Result = "ku"}
     else if ($tmp === $mod.TUILanguage.lKomi) {
      Result = "kv"}
     else if ($tmp === $mod.TUILanguage.lCornish) {
      Result = "kw"}
     else if ($tmp === $mod.TUILanguage.lKirghiz) {
      Result = "ky"}
     else if ($tmp === $mod.TUILanguage.lLatin) {
      Result = "la"}
     else if ($tmp === $mod.TUILanguage.lLuxembourgish) {
      Result = "lb"}
     else if ($tmp === $mod.TUILanguage.lGanda) {
      Result = "lg"}
     else if ($tmp === $mod.TUILanguage.lLimburgan) {
      Result = "li"}
     else if ($tmp === $mod.TUILanguage.lLingala) {
      Result = "ln"}
     else if ($tmp === $mod.TUILanguage.lLao) {
      Result = "lo"}
     else if ($tmp === $mod.TUILanguage.lLithuanian) {
      Result = "lt"}
     else if ($tmp === $mod.TUILanguage.lLubaKatanga) {
      Result = "lu"}
     else if ($tmp === $mod.TUILanguage.lLatvian) {
      Result = "lv"}
     else if ($tmp === $mod.TUILanguage.lMalagasy) {
      Result = "mg"}
     else if ($tmp === $mod.TUILanguage.lMarshallese) {
      Result = "mh"}
     else if ($tmp === $mod.TUILanguage.lMaori) {
      Result = "mi"}
     else if ($tmp === $mod.TUILanguage.lMacedonian) {
      Result = "mk"}
     else if ($tmp === $mod.TUILanguage.lMalayalam) {
      Result = "ml"}
     else if ($tmp === $mod.TUILanguage.lMongolian) {
      Result = "mn"}
     else if ($tmp === $mod.TUILanguage.lMarathi) {
      Result = "mr"}
     else if ($tmp === $mod.TUILanguage.lMalay) {
      Result = "ms"}
     else if ($tmp === $mod.TUILanguage.lMaltese) {
      Result = "mt"}
     else if ($tmp === $mod.TUILanguage.lBurmese) {
      Result = "my"}
     else if ($tmp === $mod.TUILanguage.lNauru) {
      Result = "na"}
     else if ($tmp === $mod.TUILanguage.lNdebele) {
      Result = "nb"}
     else if ($tmp === $mod.TUILanguage.lNepali) {
      Result = "nd"}
     else if ($tmp === $mod.TUILanguage.lNdonga) {
      Result = "ng"}
     else if ($tmp === $mod.TUILanguage.lDutch) {
      Result = "nl"}
     else if ($tmp === $mod.TUILanguage.lNorwegian) {
      Result = "no"}
     else if ($tmp === $mod.TUILanguage.lNavajo) {
      Result = "nv"}
     else if ($tmp === $mod.TUILanguage.lChichewa) {
      Result = "ny"}
     else if ($tmp === $mod.TUILanguage.lOccitan) {
      Result = "oc"}
     else if ($tmp === $mod.TUILanguage.lOjibwa) {
      Result = "oj"}
     else if ($tmp === $mod.TUILanguage.lOromo) {
      Result = "om"}
     else if ($tmp === $mod.TUILanguage.lOriya) {
      Result = "or"}
     else if ($tmp === $mod.TUILanguage.lOssetian) {
      Result = "os"}
     else if ($tmp === $mod.TUILanguage.lPanjabi) {
      Result = "pa"}
     else if ($tmp === $mod.TUILanguage.lPali) {
      Result = "pi"}
     else if ($tmp === $mod.TUILanguage.lPolish) {
      Result = "pl"}
     else if ($tmp === $mod.TUILanguage.lPushto) {
      Result = "ps"}
     else if ($tmp === $mod.TUILanguage.lPortuguese) {
      Result = "pt"}
     else if ($tmp === $mod.TUILanguage.lQuechua) {
      Result = "qu"}
     else if ($tmp === $mod.TUILanguage.lRomansh) {
      Result = "rm"}
     else if ($tmp === $mod.TUILanguage.lRundi) {
      Result = "rn"}
     else if ($tmp === $mod.TUILanguage.lRomanian) {
      Result = "ro"}
     else if ($tmp === $mod.TUILanguage.lRussian) {
      Result = "ru"}
     else if ($tmp === $mod.TUILanguage.lKinyarwanda) {
      Result = "rw"}
     else if ($tmp === $mod.TUILanguage.lSanskrit) {
      Result = "sa"}
     else if ($tmp === $mod.TUILanguage.lSardinian) {
      Result = "sc"}
     else if ($tmp === $mod.TUILanguage.lSindhi) {
      Result = "sd"}
     else if ($tmp === $mod.TUILanguage.lNorthernSami) {
      Result = "se"}
     else if ($tmp === $mod.TUILanguage.lSango) {
      Result = "sg"}
     else if ($tmp === $mod.TUILanguage.lSinhala) {
      Result = "si"}
     else if ($tmp === $mod.TUILanguage.lSlovak) {
      Result = "sk"}
     else if ($tmp === $mod.TUILanguage.lSlovenian) {
      Result = "sl"}
     else if ($tmp === $mod.TUILanguage.lSamoan) {
      Result = "sm"}
     else if ($tmp === $mod.TUILanguage.lShona) {
      Result = "sn"}
     else if ($tmp === $mod.TUILanguage.lSomali) {
      Result = "so"}
     else if ($tmp === $mod.TUILanguage.lAlbanian) {
      Result = "sq"}
     else if ($tmp === $mod.TUILanguage.lSerbian) {
      Result = "sr"}
     else if ($tmp === $mod.TUILanguage.lSwati) {
      Result = "ss"}
     else if ($tmp === $mod.TUILanguage.lSotho) {
      Result = "st"}
     else if ($tmp === $mod.TUILanguage.lSundanese) {
      Result = "su"}
     else if ($tmp === $mod.TUILanguage.lSwedish) {
      Result = "sv"}
     else if ($tmp === $mod.TUILanguage.lSwahili) {
      Result = "sw"}
     else if ($tmp === $mod.TUILanguage.lTamil) {
      Result = "ta"}
     else if ($tmp === $mod.TUILanguage.lTelugu) {
      Result = "te"}
     else if ($tmp === $mod.TUILanguage.lTajik) {
      Result = "tg"}
     else if ($tmp === $mod.TUILanguage.lThai) {
      Result = "th"}
     else if ($tmp === $mod.TUILanguage.lTigrinya) {
      Result = "ti"}
     else if ($tmp === $mod.TUILanguage.lTurkmen) {
      Result = "tk"}
     else if ($tmp === $mod.TUILanguage.lTagalog) {
      Result = "tl"}
     else if ($tmp === $mod.TUILanguage.lTswana) {
      Result = "tn"}
     else if ($tmp === $mod.TUILanguage.lTonga) {
      Result = "to"}
     else if ($tmp === $mod.TUILanguage.lTurkish) {
      Result = "tr"}
     else if ($tmp === $mod.TUILanguage.lTsonga) {
      Result = "ts"}
     else if ($tmp === $mod.TUILanguage.lTatar) {
      Result = "tt"}
     else if ($tmp === $mod.TUILanguage.lTwi) {
      Result = "tw"}
     else if ($tmp === $mod.TUILanguage.lTahitian) {
      Result = "ty"}
     else if ($tmp === $mod.TUILanguage.lUighur) {
      Result = "ug"}
     else if ($tmp === $mod.TUILanguage.lUkrainian) {
      Result = "uk"}
     else if ($tmp === $mod.TUILanguage.lUrdu) {
      Result = "ur"}
     else if ($tmp === $mod.TUILanguage.lUzbek) {
      Result = "uz"}
     else if ($tmp === $mod.TUILanguage.lVenda) {
      Result = "ve"}
     else if ($tmp === $mod.TUILanguage.lVietnamese) {
      Result = "vi"}
     else if ($tmp === $mod.TUILanguage.lWalloon) {
      Result = "wa"}
     else if ($tmp === $mod.TUILanguage.lWolof) {
      Result = "wo"}
     else if ($tmp === $mod.TUILanguage.lXhosa) {
      Result = "xh"}
     else if ($tmp === $mod.TUILanguage.lYiddish) {
      Result = "yi"}
     else if ($tmp === $mod.TUILanguage.lYoruba) {
      Result = "yo"}
     else if ($tmp === $mod.TUILanguage.lZhuang) {
      Result = "za"}
     else if ($tmp === $mod.TUILanguage.lChinese) {
      Result = "zh"}
     else if ($tmp === $mod.TUILanguage.lZulu) Result = "zu";
    return Result;
  };
});
rtl.module("WEBLib.Menus",["System","Classes","SysUtils","WEBLib.Controls","WEBLib.Graphics","Web"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.$rtti.$Class("TMainMenu");
  this.$rtti.$Class("TMenuItem");
  this.$rtti.$Class("TCustomMainMenu");
  this.TMenuItemAutoFlag = {"0": "maAutomatic", maAutomatic: 0, "1": "maManual", maManual: 1, "2": "maParent", maParent: 2};
  this.$rtti.$Enum("TMenuItemAutoFlag",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TMenuItemAutoFlag});
  this.TMenuBreak = {"0": "mbNone", mbNone: 0, "1": "mbBreak", mbBreak: 1, "2": "mbBarBreak", mbBarBreak: 2};
  this.$rtti.$Enum("TMenuBreak",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TMenuBreak});
  this.$rtti.$Int("THelpContext",{minvalue: -2147483647, maxvalue: 2147483647, ordtype: 4});
  this.$rtti.$inherited("TShortCut",rtl.word,{});
  this.TMainMenuHamburgerMenuVisible = {"0": "hmAlways", hmAlways: 0, "1": "hmNever", hmNever: 1, "2": "hmResponsive", hmResponsive: 2};
  this.$rtti.$Enum("TMainMenuHamburgerMenuVisible",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TMainMenuHamburgerMenuVisible});
  this.$rtti.$MethodVar("TMainMenuChangeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Source",this.$rtti["TMenuItem"]],["Rebuild",rtl.boolean]]), methodkind: 0});
  rtl.createClass(this,"TMenuItemList",pas.Classes.TList,function () {
    this.GetItem = function (Index) {
      var Result = null;
      Result = rtl.getObject(this.Get(Index));
      return Result;
    };
    this.PutItem = function (Index, Value) {
      this.Put(Index,Value);
    };
  });
  rtl.createClass(this,"TMenuItem",pas.Classes.TComponent,function () {
    this.$init = function () {
      pas.Classes.TComponent.$init.call(this);
      this.FOwner$1 = null;
      this.FCaption = "";
      this.FItems = null;
      this.FParentItem = null;
      this.FUpdateCount = 0;
      this.FOnClick = null;
      this.FChecked = false;
      this.FEnabled = false;
      this.FDefault = false;
      this.FAutoCheck = false;
      this.FHint = "";
      this.FAutoHotkeys = 0;
      this.FRadioItem = false;
      this.FGroupIndex = 0;
      this.FVisible = false;
      this.FShortCut = 0;
      this.FBreak = 0;
      this.FImageIndex = 0;
      this.FAutoLineReduction = 0;
      this.FHelpContext = 0;
      this.FElementClassName = "";
      this.FParentMenu = null;
    };
    this.$final = function () {
      this.FOwner$1 = undefined;
      this.FItems = undefined;
      this.FParentItem = undefined;
      this.FOnClick = undefined;
      this.FParentMenu = undefined;
      pas.Classes.TComponent.$final.call(this);
    };
    this.SetChecked = function (Value) {
      var pm = null;
      var Item = null;
      var OtherItem = null;
      var MenuOwner = null;
      var I = 0;
      if (this.FChecked !== Value) {
        this.FChecked = Value;
        MenuOwner = this.FParentMenu;
        if (MenuOwner != null) {
          if ($mod.TMenuItem.isPrototypeOf(MenuOwner) && Value) {
            Item = MenuOwner;
            for (var $l = 0, $end = Item.FItems.GetCount() - 1; $l <= $end; $l++) {
              I = $l;
              OtherItem = Item.FItems.GetItem(I);
              if (OtherItem.FRadioItem && (OtherItem !== this)) OtherItem.SetChecked(false);
            };
          };
          while (!$mod.TCustomMainMenu.isPrototypeOf(MenuOwner) && (MenuOwner != null)) {
            MenuOwner = MenuOwner.FOwner;
          };
        };
        pm = this.GetParentMenu();
        if (pm != null) pm.UpdateElement();
      };
    };
    this.SetCaption = function (Value) {
      var pm = null;
      this.FCaption = Value;
      pm = this.GetParentMenu();
      if (pm != null) pm.UpdateElement();
    };
    this.SetImageIndex = function (Value) {
      var pm = null;
      this.FImageIndex = Value;
      pm = this.GetParentMenu();
      if (pm != null) pm.UpdateElement();
    };
    this.SetEnabled = function (Value) {
      if (this.FEnabled !== Value) {
        this.FEnabled = Value;
        this.GetParentMenu().UpdateElement();
      };
    };
    this.GetMenuItem = function (AIndex) {
      var Result = null;
      Result = this.FItems.GetItem(AIndex);
      return Result;
    };
    this.SetMenuItem = function (AIndex, Value) {
      this.FItems.PutItem(AIndex,Value);
    };
    this.GetCount = function () {
      var Result = 0;
      if (this.FItems === null) {
        Result = 0}
       else Result = this.FItems.GetCount();
      return Result;
    };
    this.Create$1 = function (AOwner) {
      this.FParentMenu = null;
      if ($mod.TMainMenu.isPrototypeOf(AOwner)) this.FParentMenu = AOwner;
      pas.Classes.TComponent.Create$1.call(this,AOwner);
      this.FAutoHotkeys = $mod.TMenuItemAutoFlag.maParent;
      this.FAutoLineReduction = $mod.TMenuItemAutoFlag.maParent;
      this.FImageIndex = -1;
      this.FHint = "";
      this.FCaption = "MenuItem";
      this.FChecked = false;
      this.FEnabled = true;
      this.FDefault = false;
      this.FRadioItem = false;
      this.FVisible = true;
      this.FOwner$1 = AOwner;
      return this;
    };
    this.Destroy = function () {
      var i = 0;
      var pm = null;
      var mnu = null;
      pm = this.GetParentMenu();
      if ((this.FParentItem != null) && (pm != null)) {
        pm.BeginUpdate();
        for (var $l = this.FParentItem.FItems.GetCount() - 1; $l >= 0; $l--) {
          i = $l;
          if (this.FParentItem.FItems.GetItem(i) === this) {
            this.FParentItem.FItems.Delete(i);
          };
        };
        pm.EndUpdate();
      };
      if (this.FItems != null) {
        for (var $l1 = this.FItems.GetCount() - 1; $l1 >= 0; $l1--) {
          i = $l1;
          mnu = this.FItems.GetItem(i);
          mnu.FParentItem = null;
          mnu = rtl.freeLoc(mnu);
          this.FItems.Delete(i);
        };
      };
      pas.Classes.TComponent.Destroy.call(this);
    };
    this.Assign = function (Source) {
      var i = 0;
      var srcmenu = null;
      var mnu = null;
      var pm = null;
      if ($mod.TMenuItem.isPrototypeOf(Source)) {
        srcmenu = rtl.as(Source,$mod.TMenuItem);
        this.FAutoCheck = srcmenu.FAutoCheck;
        this.FAutoHotkeys = srcmenu.FAutoHotkeys;
        this.FAutoLineReduction = srcmenu.FAutoLineReduction;
        this.FBreak = srcmenu.FBreak;
        this.FCaption = srcmenu.FCaption;
        this.FChecked = srcmenu.FChecked;
        this.FDefault = srcmenu.FDefault;
        this.FEnabled = srcmenu.FEnabled;
        this.FGroupIndex = srcmenu.FGroupIndex;
        this.FHelpContext = srcmenu.FHelpContext;
        this.FHint = srcmenu.FHint;
        this.FImageIndex = srcmenu.FImageIndex;
        this.FRadioItem = srcmenu.FRadioItem;
        this.FShortCut = srcmenu.FShortCut;
        this.FVisible = srcmenu.FVisible;
        this.FElementClassName = srcmenu.FElementClassName;
        pm = this.GetParentMenu();
        if (this.FParentItem != null) this.SetName(pm.GetUniqueName(srcmenu.FCaption));
        if (srcmenu.FItems != null) {
          if (this.FItems != null) {
            for (var $l = this.FItems.GetCount() - 1; $l >= 0; $l--) {
              i = $l;
              this.RemoveItem(this.GetParentMenu().FParent,this.FItems.GetItem(i));
            };
            this.FItems.Clear();
          } else this.FItems = $mod.TMenuItemList.$create("Create$1");
          for (var $l1 = 0, $end = srcmenu.FItems.GetCount() - 1; $l1 <= $end; $l1++) {
            i = $l1;
            mnu = $mod.TMenuItem.$create("Create$1",[pm.FOwner]);
            mnu.FParentMenu = pm;
            mnu.FParentItem = this;
            mnu.Assign(srcmenu.FItems.GetItem(i));
            this.FItems.Add(mnu);
          };
        };
      };
    };
    this.BeginUpdate$1 = function () {
      this.FUpdateCount += 1;
    };
    this.EndUpdate$1 = function () {
      if (this.FUpdateCount > 0) {
        this.FUpdateCount -= 1;
        if (this.FUpdateCount === 0) this.GetParentMenu().UpdateElement();
      };
    };
    this.SetParentComponent = function (Value) {
      pas.Classes.TComponent.SetParentComponent.apply(this,arguments);
      this.FParentMenu = Value;
      if (Value !== null) {
        if ($mod.TCustomMainMenu.isPrototypeOf(Value)) {
          if (!Value.FItems.IsChild(this)) Value.FItems.Add(this);
        } else if ($mod.TMenuItem.isPrototypeOf(Value)) {
          if (!Value.IsChild(this)) Value.Add(this);
        };
      };
    };
    this.Add = function (Item) {
      this.Insert$1(this.GetCount(),Item);
    };
    this.Insert$1 = function (Index, Item) {
      if (this.FItems === null) this.FItems = $mod.TMenuItemList.$create("Create$1");
      this.FItems.Insert(Index,Item);
      Item.FParentItem = this;
      if (Item.GetParentMenu() != null) Item.GetParentMenu().UpdateElement();
    };
    this.IsChild = function (Item) {
      var Result = false;
      var i = 0;
      Result = false;
      if (!(this.FItems != null)) return Result;
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.FItems.GetItem(i) === Item) {
          Result = true;
        };
      };
      return Result;
    };
    this.GetOwner = function () {
      var Result = null;
      Result = this.FOwner$1;
      return Result;
    };
    this.GetParentMenu = function () {
      var Result = null;
      var AOwner = null;
      Result = null;
      AOwner = this.FParentMenu;
      while ((AOwner != null) && $mod.TMenuItem.isPrototypeOf(AOwner)) {
        AOwner = AOwner.FParentMenu;
      };
      if (AOwner != null) Result = AOwner;
      return Result;
    };
    this.GetChildren = function (Proc, Root) {
      var I = 0;
      if (this.FItems != null) for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        Proc(this.FItems.GetItem(I));
      };
    };
    this.SetChildOrder = function (Child, Order) {
      var idx = 0;
      idx = this.FItems.IndexOf(Child);
      if ((idx >= 0) && (Order < this.FItems.GetCount())) {
        this.FItems.Move(idx,Order);
      };
    };
    this.RemoveItem = function (AOwner, AItem) {
      var I = 0;
      if (AItem.FItems != null) {
        for (var $l = AItem.FItems.GetCount() - 1; $l >= 0; $l--) {
          I = $l;
          this.RemoveItem(AOwner,AItem.FItems.GetItem(I));
        };
      };
      AOwner.RemoveComponent(AItem);
    };
    this.Clear = function () {
      var i = 0;
      var mnu = null;
      for (var $l = this.GetCount() - 1; $l >= 0; $l--) {
        i = $l;
        mnu = this.FItems.GetItem(i);
        if (mnu.FItems != null) mnu.FItems.Clear();
        mnu = rtl.freeLoc(mnu);
      };
    };
    this.Click = function () {
      var pm = null;
      if (this.FOnClick != null) this.FOnClick(this);
      pm = this.GetParentMenu();
      if (pm.FIsPopupMenu) {
        if ((pm.FLayer$1 != null) && !(pm.FContainer$1 != null)) {
          pm.FLayer$1.parentElement.removeChild(pm.FLayer$1);
          pm.FLayer$1 = null;
        };
      };
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("AutoCheck",0,rtl.boolean,"FAutoCheck","FAutoCheck",4,{Default: false});
    $r.addProperty("AutoHotkeys",0,$mod.$rtti["TMenuItemAutoFlag"],"FAutoHotkeys","FAutoHotkeys",4,{Default: $mod.TMenuItemAutoFlag.maParent});
    $r.addProperty("AutoLineReduction",0,$mod.$rtti["TMenuItemAutoFlag"],"FAutoLineReduction","FAutoLineReduction",4,{Default: $mod.TMenuItemAutoFlag.maParent});
    $r.addProperty("Break",0,$mod.$rtti["TMenuBreak"],"FBreak","FBreak",4,{Default: $mod.TMenuBreak.mbNone});
    $r.addProperty("Caption",2,rtl.string,"FCaption","SetCaption");
    $r.addProperty("Checked",2,rtl.boolean,"FChecked","SetChecked",4,{Default: false});
    $r.addProperty("Default",0,rtl.boolean,"FDefault","FDefault",4,{Default: false});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("GroupIndex",0,rtl.byte,"FGroupIndex","FGroupIndex",4,{Default: 0});
    $r.addProperty("HelpContext",0,$mod.$rtti["THelpContext"],"FHelpContext","FHelpContext",4,{Default: 0});
    $r.addProperty("Hint",0,rtl.string,"FHint","FHint");
    $r.addProperty("ImageIndex",2,rtl.longint,"FImageIndex","SetImageIndex",4,{Default: -1});
    $r.addProperty("RadioItem",0,rtl.boolean,"FRadioItem","FRadioItem",4,{Default: false});
    $r.addProperty("ShortCut",0,$mod.$rtti["TShortCut"],"FShortCut","FShortCut",4,{Default: 0});
    $r.addProperty("Visible",0,rtl.boolean,"FVisible","FVisible",4,{Default: true});
    $r.addProperty("ElementClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","FElementClassName");
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
  });
  this.$rtti.$Class("TMainMenuAppearance");
  rtl.createClass(this,"THamburgerMenu",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FOwner = null;
      this.FVisible = 0;
      this.FCaption = "";
      this.FBackgroundColor = 0;
      this.FCaptionColor = 0;
      this.FResponsiveMaxWidth = 0;
    };
    this.$final = function () {
      this.FOwner = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetVisible = function (Value) {
      if (this.FVisible !== Value) {
        this.FVisible = Value;
        this.FOwner.FOwner.UpdateElement();
      };
    };
    this.SetBackgroundColor = function (Value) {
      if (this.FBackgroundColor !== Value) {
        this.FBackgroundColor = Value;
        this.FOwner.FOwner.UpdateElement();
      };
    };
    this.SetCaption = function (Value) {
      if (this.FCaption !== Value) {
        this.FCaption = Value;
        this.FOwner.FOwner.UpdateElement();
      };
    };
    this.SetCaptionColor = function (Value) {
      if (this.FCaptionColor !== Value) {
        this.FCaptionColor = Value;
        this.FOwner.FOwner.UpdateElement();
      };
    };
    this.SetResponsiveMaxWidth = function (Value) {
      if (this.FResponsiveMaxWidth !== Value) {
        this.FResponsiveMaxWidth = Value;
        this.FOwner.FOwner.UpdateElement();
      };
    };
    this.Create$1 = function (AOwner) {
      this.FBackgroundColor = 12632256;
      this.FCaption = "Menu";
      this.FCaptionColor = 16777215;
      this.FVisible = $mod.TMainMenuHamburgerMenuVisible.hmResponsive;
      this.FResponsiveMaxWidth = 768;
      this.FOwner = AOwner;
      return this;
    };
    this.Destroy = function () {
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      pas.Classes.TPersistent.Assign.apply(this,arguments);
      if ($mod.THamburgerMenu.isPrototypeOf(Source)) {
        this.FBackgroundColor = rtl.as(Source,$mod.THamburgerMenu).FBackgroundColor;
        this.FCaption = rtl.as(Source,$mod.THamburgerMenu).FCaption;
        this.FCaptionColor = rtl.as(Source,$mod.THamburgerMenu).FCaptionColor;
        this.FVisible = rtl.as(Source,$mod.THamburgerMenu).FVisible;
        this.FResponsiveMaxWidth = rtl.as(Source,$mod.THamburgerMenu).FResponsiveMaxWidth;
      };
    };
    this.GetOwner = function () {
      var Result = null;
      Result = this.FOwner;
      return Result;
    };
    var $r = this.$rtti;
    $r.addProperty("Caption",2,rtl.string,"FCaption","SetCaption");
    $r.addProperty("CaptionColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FCaptionColor","SetCaptionColor",4,{Default: 16777215});
    $r.addProperty("BackgroundColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FBackgroundColor","SetBackgroundColor",4,{Default: 12632256});
    $r.addProperty("Visible",2,$mod.$rtti["TMainMenuHamburgerMenuVisible"],"FVisible","SetVisible",4,{Default: $mod.TMainMenuHamburgerMenuVisible.hmResponsive});
    $r.addProperty("ResponsiveMaxWidth",2,rtl.longint,"FResponsiveMaxWidth","SetResponsiveMaxWidth",4,{Default: 768});
  });
  rtl.createClass(this,"TMainMenuAppearance",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FOwner = null;
      this.FBackgroundColor = 0;
      this.FHoverFontColor = 0;
      this.FHoverColor = 0;
      this.FImageURLs = null;
      this.FHamburgerMenu = null;
      this.FImageSize = 0;
      this.FSubmenuIndicator = "";
    };
    this.$final = function () {
      this.FOwner = undefined;
      this.FImageURLs = undefined;
      this.FHamburgerMenu = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetBackgroundColor = function (Value) {
      if (this.FBackgroundColor !== Value) {
        this.FBackgroundColor = Value;
        this.FOwner.UpdateElement();
      };
    };
    this.SetHoverColor = function (Value) {
      if (this.FHoverColor !== Value) {
        this.FHoverColor = Value;
        this.FOwner.UpdateElement();
      };
    };
    this.SetHoverFontColor = function (Value) {
      if (this.FHoverFontColor !== Value) {
        this.FHoverFontColor = Value;
        this.FOwner.UpdateElement();
      };
    };
    this.SetImageURLs = function (Value) {
      this.FImageURLs.Assign(Value);
    };
    this.SetImageSize = function (Value) {
      if (this.FImageSize !== Value) {
        this.FImageSize = Value;
        this.FOwner.UpdateElement();
      };
    };
    this.SetSubmenuIndicator = function (Value) {
      if (this.FSubmenuIndicator !== Value) {
        this.FSubmenuIndicator = Value;
        this.FOwner.UpdateElement();
      };
    };
    this.HandleImageURLsChanged = function (Sender) {
      this.FOwner.UpdateElement();
    };
    this.Create$1 = function (AOwner) {
      this.FBackgroundColor = 0xF0F0F0;
      this.FHoverColor = 14120960;
      this.FHoverFontColor = 197379;
      this.FHamburgerMenu = $mod.THamburgerMenu.$create("Create$1",[this]);
      this.FImageURLs = pas.Classes.TStringList.$create("Create$1");
      this.FImageURLs.SetSkipLastLineBreak(true);
      this.FImageURLs.FOnChange = rtl.createCallback(this,"HandleImageURLsChanged");
      this.FImageSize = 16;
      this.FSubmenuIndicator = "&#9658;";
      this.FOwner = AOwner;
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FHamburgerMenu");
      rtl.free(this,"FImageURLs");
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      pas.Classes.TPersistent.Assign.apply(this,arguments);
      if ($mod.TMainMenuAppearance.isPrototypeOf(Source)) {
        this.FBackgroundColor = rtl.as(Source,$mod.TMainMenuAppearance).FBackgroundColor;
        this.FHoverColor = rtl.as(Source,$mod.TMainMenuAppearance).FHoverColor;
        this.FHoverFontColor = rtl.as(Source,$mod.TMainMenuAppearance).FHoverFontColor;
        this.FHamburgerMenu.Assign(rtl.as(Source,$mod.TMainMenuAppearance).FHamburgerMenu);
        this.FImageURLs.Assign(rtl.as(Source,$mod.TMainMenuAppearance).FImageURLs);
        this.FImageSize = rtl.as(Source,$mod.TMainMenuAppearance).FImageSize;
        this.FSubmenuIndicator = rtl.as(Source,$mod.TMainMenuAppearance).FSubmenuIndicator;
      };
    };
    this.GetOwner = function () {
      var Result = null;
      Result = this.FOwner;
      return Result;
    };
    var $r = this.$rtti;
    $r.addProperty("BackgroundColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FBackgroundColor","SetBackgroundColor",4,{Default: 15790320});
    $r.addProperty("HamburgerMenu",0,$mod.$rtti["THamburgerMenu"],"FHamburgerMenu","FHamburgerMenu");
    $r.addProperty("HoverColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FHoverColor","SetHoverColor",4,{Default: 14120960});
    $r.addProperty("HoverFontColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FHoverFontColor","SetHoverFontColor",4,{Default: 197379});
    $r.addProperty("ImageURLs",2,pas.Classes.$rtti["TStringList"],"FImageURLs","SetImageURLs");
    $r.addProperty("ImageSize",2,rtl.longint,"FImageSize","SetImageSize",4,{Default: 16});
    $r.addProperty("SubmenuIndicator",2,rtl.string,"FSubmenuIndicator","SetSubmenuIndicator");
  });
  rtl.createClass(this,"TCustomMainMenu",pas["WEBLib.Controls"].TCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Controls"].TCustomControl.$init.call(this);
      this.FItems = null;
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FItems = undefined;
      this.FOnChange = undefined;
      pas["WEBLib.Controls"].TCustomControl.$final.call(this);
    };
    this.Loaded = function () {
      pas["WEBLib.Controls"].TCustomControl.Loaded.call(this);
      if (this.IsUpdating()) return;
      if (this.GetElementHandle() != null) this.UpdateElement();
    };
    this.UpdateElement = function () {
      pas["WEBLib.Controls"].TControl.UpdateElement.call(this);
      if (this.IsUpdating()) return;
    };
    this.GetUniqueName = function (AName) {
      var Result = "";
      var i = 0;
      var id = 0;
      var found = false;
      id = 1;
      if (AName === "") AName = this.FName + "item";
      AName = $impl.MakeValidName(AName);
      do {
        Result = AName + pas.SysUtils.IntToStr(id);
        found = true;
        for (var $l = 0, $end = this.FOwner.GetComponentCount() - 1; $l <= $end; $l++) {
          i = $l;
          if (this.FOwner.GetComponent(i).FName === Result) {
            found = false;
            id += 1;
            break;
          };
        };
      } while (!found);
      return Result;
    };
    this.SetName = function (NewName) {
      pas["WEBLib.Controls"].TCustomControl.SetName.apply(this,arguments);
      if (this.IsUpdating()) return;
      if (pas.Classes.TComponentStateItem.csLoading in this.FComponentState) return;
      this.UpdateElement();
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.FItems = $mod.TMenuItem.$create("Create$1",[this]);
      this.FItems.FParentMenu = this;
      this.SetWidthStyle(pas["WEBLib.Controls"].TSizeStyle.ssAuto);
      this.SetHeight(30);
    };
    this.Destroy = function () {
      rtl.free(this,"FItems");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.GetChildren = function (Proc, Root) {
      var I = 0;
      if ((this.FItems != null) && (this.FItems.FItems != null)) {
        for (var $l = 0, $end = this.FItems.FItems.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          Proc(this.FItems.FItems.GetItem(I));
        };
      };
    };
    this.SetChildOrder = function (Child, Order) {
      var idx = 0;
      idx = this.FItems.FItems.IndexOf(Child);
      if ((idx >= 0) && (Order < this.FItems.FItems.GetCount())) {
        this.FItems.FItems.Move(idx,Order);
      };
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Items",0,$mod.$rtti["TMenuItem"],"FItems","");
    $r.addProperty("OnChange",0,$mod.$rtti["TMainMenuChangeEvent"],"FOnChange","FOnChange");
  });
  rtl.createClass(this,"TMainMenu",this.TCustomMainMenu,function () {
    this.$init = function () {
      $mod.TCustomMainMenu.$init.call(this);
      this.FMenu = null;
      this.FMainMenu = false;
      this.FMenuIndex = 0;
      this.FAppearance = null;
      this.FContainer$1 = null;
      this.FIsPopupMenu = false;
      this.FShowPopup = false;
      this.FAutoMerge = false;
      this.FZIndex = "";
      this.FElementItemClassName = "";
      this.FDocClickPtr = null;
      this.FLayer$1 = null;
    };
    this.$final = function () {
      this.FMenu = undefined;
      this.FAppearance = undefined;
      this.FContainer$1 = undefined;
      this.FLayer$1 = undefined;
      $mod.TCustomMainMenu.$final.call(this);
    };
    this.HandleChange = function (Event) {
      var Result = false;
      var h = null;
      var it = null;
      Result = true;
      if (this.FIsPopupMenu) {
        this.FShowPopup = false;
        this.UpdateElement();
      };
      h = Event.target;
      if (!h.hasAttribute("id")) h = h.parentElement;
      it = this.GetItemByName(this.FItems,h.id);
      if (it != null) {
        if (it.FAutoCheck) it.SetChecked(!it.FChecked);
        if (this.FOnChange != null) this.FOnChange(this,it,false);
        it.Click();
      };
      return Result;
    };
    this.HandleDocClick = function (Event) {
      var Result = false;
      var popupel = null;
      Result = true;
      if (this.FIsPopupMenu) {
        popupel = this.GetElementHandle().getElementsByClassName("popup-menu");
        if ((popupel != null) && (popupel.item(0) != null)) {
          setTimeout(function(){popupel[0].style.display = "none"}, 25);
        };
        if (this.FLayer$1 != null) {
          this.FLayer$1.parentElement.removeChild(this.FLayer$1);
          this.FLayer$1 = null;
        };
      };
      return Result;
    };
    this.Loaded = function () {
      $mod.TCustomMainMenu.Loaded.call(this);
      if (this.IsUpdating()) return;
      if (!(this.FContainer$1 != null) && pas["WEBLib.Forms"].TCustomForm.isPrototypeOf(this.FParent) && (rtl.as(this.FParent,pas["WEBLib.Forms"].TCustomForm).FMenu === this)) {
        this.FContainer$1 = this.FParent;
      };
      if (this.GetElementHandle() != null) this.UpdateElement();
    };
    this.UpdateElement = function () {
      var MenuStyle = "";
      var MenuColorStyle = "";
      var MenuResponsiveStyle = "";
      var MenuImageSize = "";
      var ShowPopup = "";
      var ElHandle = null;
      var ElLabel = null;
      var ElSpan = null;
      var ElIcon = null;
      var ElCheckBox = null;
      var ElStyle = null;
      var ElScript = null;
      var ElItems = null;
      $mod.TCustomMainMenu.UpdateElement.call(this);
      if (this.IsUpdating()) return;
      if (!(this.GetElementHandle() != null) && !(this.FContainer$1 != null)) return;
      if (this.FContainer$1 != null) {
        ElHandle = this.FContainer$1.GetElementHandle();
        this.SetVisible(false);
      } else {
        ElHandle = this.GetElementHandle();
        ElHandle.style.setProperty("top",pas.SysUtils.IntToStr(this.GetTop()) + "px");
        ElHandle.style.setProperty("left",pas.SysUtils.IntToStr(this.GetLeft()) + "px");
        if ((pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) && !(this.FContainer$1 != null)) this.GetElementHandle().style.setProperty("background-color","silver");
      };
      if (this.FMenu != null) this.FMenu.parentElement.removeChild(this.FMenu);
      if (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState) return;
      this.FMenu = document.createElement("NAV");
      this.FMenu.setAttribute("id",this.GetID() + "menu");
      this.FMenu.innerHTML = "";
      if (this.FContainer$1 != null) {
        this.FMenu.style.setProperty("top","0");
        this.FMenu.style.setProperty("left","0");
        this.FMenu.style.setProperty("position","absolute");
        this.FMenu.style.setProperty("width","100%");
        this.FMenu.style.setProperty("z-index",this.FZIndex);
      };
      ElHandle.style.setProperty("overflow","visible");
      if (this.FAppearance.FHamburgerMenu.FVisible !== $mod.TMainMenuHamburgerMenuVisible.hmAlways) {
        if (this.FShowPopup) {
          ShowPopup = "block"}
         else ShowPopup = "none";
        MenuResponsiveStyle = "  #" + this.GetID() + "menu .main-menu {\r" + "    display: block;\r" + "  }\r" + "  #" + this.GetID() + "menu #toggle-menu {\r" + "    display: none;\r" + "  }\r" + "  #" + this.GetID() + "menu ul span.drop-label {\r" + "    display: inline-block;\r" + "  }\r" + "  #" + this.GetID() + "menu li {\r" + "    float: left;\r" + "    border-width: 0 1px 0 0;\r" + "  }\r" + "  #" + this.GetID() + "menu .popup-menu li, \r" + "  #" + this.GetID() + "menu .sub-menu li {\r" + "    float: none;\r" + "  }\r" + "  #" + this.GetID() + "menu .sub-menu {\r" + "    top: 100%;\r" + "  }\r" + "  #" + this.GetID() + "menu .popup-menu { \r" + "    top: 0;\r" + "  }\r" + "  #" + this.GetID() + "menu .popup-menu, \r" + "  #" + this.GetID() + "menu .sub-menu {\r" + "    border-width: 0;\r" + "    margin: 0;\r" + "    position: absolute;\r" + "    left: 0;\r" + "    min-width: 12em;\r" + "    z-index: 9999999;\r" + "\t   white-space: nowrap;\r" + "  }\r" + "  #" + this.GetID() + "menu .sub-menu {\r" + "    top: 100%;\r" + "  }\r" + "  #" + this.GetID() + "menu .popup-menu { \r" + "    display: " + ShowPopup + ";\r" + "  }\r" + "  #" + this.GetID() + "menu .sub-menu,\r" + "  #" + this.GetID() + 'menu input[type="checkbox"]:checked + .popup-menu,\r' + "  #" + this.GetID() + 'menu input[type="checkbox"]:checked + .sub-menu {\r' + "    display: none;\r" + "  }\r" + "  #" + this.GetID() + "menu .popup-menu li, \r" + "  #" + this.GetID() + "menu .sub-menu li {\r" + "    border-width: 1px;\r" + "  }\r" + "  #" + this.GetID() + "menu .popup-menu .sub-menu, \r" + "  #" + this.GetID() + "menu .sub-menu .sub-menu {\r" + "    top: 0;\r" + "    left: 100%;\r" + "  }\r" + "  #" + this.GetID() + 'menu li:hover > input[type="checkbox"] + .popup-menu, \r' + "  #" + this.GetID() + 'menu li:hover > input[type="checkbox"] + .sub-menu {\r' + "    display: block;\r" + "  }\r";
        if (this.FAppearance.FHamburgerMenu.FVisible === $mod.TMainMenuHamburgerMenuVisible.hmResponsive) {
          MenuResponsiveStyle = "@media only screen and (min-width: " + pas.SysUtils.IntToStr(this.FAppearance.FHamburgerMenu.FResponsiveMaxWidth) + "px) {\r" + MenuResponsiveStyle + "}";
        };
      };
      if (this.FAppearance.FImageSize > 0) {
        MenuImageSize = "  width: " + pas.SysUtils.IntToStr(this.FAppearance.FImageSize) + "px;\r" + "  height: " + pas.SysUtils.IntToStr(this.FAppearance.FImageSize) + "px;\r";
      };
      MenuStyle = "#" + this.GetID() + "menu ul {\r" + "  margin: 0;\r" + "  padding: 0;\r" + "}\r" + "#" + this.GetID() + "menu .main-menu {\r" + "  display: none;\r" + "}\r" + "#" + this.GetID() + "menu .popup-menu {\r" + "  display: block;\r" + "}\r" + "#" + this.GetID() + "menu label img.icon," + "#" + this.GetID() + "menu label span.checked {\r" + MenuImageSize + "  margin-right: 10px;\r" + "  pointer-events: none;\r" + "}\r" + "#" + this.GetID() + "tm:checked + .main-menu {\r" + "  display: block;\r" + "}\r" + "#" + this.GetID() + 'menu input[type="checkbox"],\r' + "#" + this.GetID() + "menu ul span.drop-label {\r" + "  display: none;\r" + "}\r" + "#" + this.GetID() + "menu li,\r" + "#" + this.GetID() + "menu #toggle-menu,\r" + "#" + this.GetID() + "menu .popup-menu,\r" + "#" + this.GetID() + "menu .sub-menu {\r" + "  border-width: 1px;\r" + "  border-style: solid;\r" + "  border-color: rgba(0, 0, 0, .05);\r" + "  border-bottom: 0px;\r" + "  border-top: 0px;\r" + "}\r" + "#" + this.GetID() + "menu li,\r" + "#" + this.GetID() + "menu #toggle-menu {\r" + "  border-width: 0 0 3px;\r" + "}\r" + "#" + this.GetID() + "menu .popup-menu,\r" + "#" + this.GetID() + "menu .sub-menu {\r" + "  border-width: 1px 1px 0;\r" + "  margin: 0 1em;\r" + "}\r" + "#" + this.GetID() + "menu .popup-menu li:first-child,\r" + "#" + this.GetID() + "menu .sub-menu li:first-child {\r" + "  border-top: 1px solid;\r" + "  border-color: rgba(0, 0, 0, .05);\r" + "}\r" + "#" + this.GetID() + "menu .popup-menu li:last-child,\r" + "#" + this.GetID() + "menu .sub-menu li:last-child {\r" + "  border-bottom: 1px solid;\r" + "  border-color: rgba(0, 0, 0, .05);\r" + "}\r" + "#" + this.GetID() + "menu li,\r" + "#" + this.GetID() + "menu #toggle-menu,\r" + "#" + this.GetID() + "menu li label {\r" + "  position: relative;\r" + "  display: block;\r" + "}\r" + "#" + this.GetID() + "menu #toggle-menu,\r" + "#" + this.GetID() + "menu li label { \r" + "  padding: 0.75em 1.5em;\r" + "  text-decoration: none;\r" + "}\r" + "#" + this.GetID() + "menu li span.menu-separator { \r" + "  display: block;\r" + "  width: 100%;\r" + "  height: 1px;\r" + "  background-color: rgba(0, 0, 0, .05);\r" + "}\r" + "#" + this.GetID() + "menu .popup-menu, \r" + "#" + this.GetID() + "menu .sub-menu {\r" + "  display: none;\r" + "}\r" + "#" + this.GetID() + 'menu input[type="checkbox"]:checked + .popup-menu,\r' + "#" + this.GetID() + 'menu input[type="checkbox"]:checked + .sub-menu {\r' + "  display: block;\r" + "  z-index: 3000;\r" + "}\r" + "#" + this.GetID() + "menu span.drop-icon {\r" + "  margin-left: 10px;" + "}\r" + "#" + this.GetID() + "menu span.hamburger-icon {\r" + "  float: right;\r" + "  padding: 0;\r" + "  margin: 0;\r" + "  font-weight: 900;\r" + "}\r" + "@media only screen and (max-width: 64em) and (min-width: 52.01em) {\r" + "  #" + this.GetID() + "menu li {\r" + "    width: auto;\r" + "  }\r" + "  #" + this.GetID() + "menu .sub-menu li {\r" + "    width: auto;\r" + "  }\r" + "}\r";
      MenuColorStyle = "";
      if (this.FElementClassName === "") {
        MenuColorStyle = "#" + this.GetID() + "menu .popup-menu, \r" + "#" + this.GetID() + "menu .sub-menu {\r" + "  background-color: " + pas["WEBLib.Graphics"].ColorToHTML(this.FAppearance.FBackgroundColor) + ";\r" + "}\r" + "@media only screen and (max-width: 64em) and (min-width: 52.01em) {\r" + "#" + this.GetID() + "menu .sub-menu {\r" + "  background-color: " + pas["WEBLib.Graphics"].ColorToHTML(this.FAppearance.FHamburgerMenu.FBackgroundColor) + ";\r" + "}\r" + "}\r" + "#" + this.GetID() + "menu li,\r" + "#" + this.GetID() + "menu #toggle-menu,\r" + "#" + this.GetID() + "menu li label {\r" + "}\r" + "#" + this.GetID() + "menu #toggle-menu {\r" + "  background-color: " + pas["WEBLib.Graphics"].ColorToHTML(this.FAppearance.FHamburgerMenu.FBackgroundColor) + ";\r" + "  color: " + pas["WEBLib.Graphics"].ColorToHTML(this.FAppearance.FHamburgerMenu.FCaptionColor) + ";\r" + "}\r" + "#" + this.GetID() + "menu .main-menu li label {\r" + "  background-color: " + pas["WEBLib.Graphics"].ColorToHTML(this.FAppearance.FBackgroundColor) + ";\r" + "}\r" + "#" + this.GetID() + "menu li label:hover {\r" + "  background-color: " + pas["WEBLib.Graphics"].ColorToHTML(this.FAppearance.FHoverColor) + ";\r" + "  color: " + pas["WEBLib.Graphics"].ColorToHTML(this.FAppearance.FHoverFontColor) + ";\r" + "}\r" + "#" + this.GetID() + "menu .popup-menu label:hover, \r" + "#" + this.GetID() + "menu .sub-menu label:hover {\r" + "  background-color: " + pas["WEBLib.Graphics"].ColorToHTML(this.FAppearance.FHoverColor) + ";\r" + "  color: " + pas["WEBLib.Graphics"].ColorToHTML(this.FAppearance.FHoverFontColor) + ";\r" + "}\r";
      };
      MenuStyle = MenuStyle + MenuColorStyle + MenuResponsiveStyle;
      this.FMainMenu = true;
      this.FMenuIndex = 0;
      ElStyle = document.createElement("STYLE");
      ElStyle.innerHTML = MenuStyle;
      ElScript = document.createElement("SCRIPT");
      ElScript.innerHTML = "function " + this.GetID() + "MenuClick(ctrl){" + "  el = ctrl.parentElement.parentElement;" + '  el.style.display = "none";' + '  setTimeout(function(){el.style.removeProperty("display")}, 25);' + "}" + "function " + this.GetID() + "MenuOut(ctrl){" + '  menuel = document.getElementById("' + this.GetID() + '");' + "  if(menuel) { " + '    popupel = menuel.getElementsByClassName("popup-menu");' + "    if(popupel) " + '      setTimeout(function(){popupel[0].style.display = "none"}, 25);' + "  }" + "}";
      ElLabel = document.createElement("LABEL");
      ElLabel.setAttribute("for",this.GetID() + "tm");
      ElLabel.setAttribute("id","toggle-menu");
      ElLabel.innerHTML = this.FAppearance.FHamburgerMenu.FCaption;
      ElSpan = document.createElement("SPAN");
      if (this.FElementItemClassName !== "") {
        ElSpan.setAttribute("class",this.FElementItemClassName)}
       else ElSpan.setAttribute("class","drop-label");
      ElLabel.appendChild(ElSpan);
      ElIcon = document.createElement("SPAN");
      ElIcon.setAttribute("class","hamburger-icon");
      ElIcon.innerHTML = "&#9776;";
      ElSpan.appendChild(ElIcon);
      ElCheckBox = document.createElement("INPUT");
      ElCheckBox.setAttribute("type","checkbox");
      ElCheckBox.setAttribute("id",this.GetID() + "tm");
      this.FMenu.appendChild(ElStyle);
      this.FMenu.appendChild(ElScript);
      this.FMenu.appendChild(ElLabel);
      this.FMenu.appendChild(ElCheckBox);
      ElItems = this.GetMenuSource(this.FItems);
      if (ElItems !== null) this.FMenu.appendChild(ElItems);
      ElHandle.appendChild(this.FMenu);
    };
    this.GetMenuSource = function (Item) {
      var Result = null;
      var I = 0;
      var it = null;
      var MenuClass = "";
      var ElListItem = null;
      var ElLabel = null;
      var ElCheckBox = null;
      var ElSymbol = null;
      var id = 0;
      var caption = "";
      Result = null;
      if ((Item.FItems != null) && (Item.FItems.GetCount() > 0)) {
        Result = document.createElement("UL");
        if (this.FMainMenu) {
          this.FMainMenu = false;
          if (this.FIsPopupMenu) {
            MenuClass = "popup-menu"}
           else MenuClass = "main-menu";
        } else MenuClass = "sub-menu";
        this.FMenuIndex = this.FMenuIndex + 1;
        Result.setAttribute("class",MenuClass);
        for (var $l = 0, $end = Item.FItems.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          it = Item.FItems.GetItem(I);
          id = id + 1;
          if (it.FName === "") {
            caption = pas.SysUtils.StringReplace(it.FCaption," ","",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
            caption = $impl.MakeValidName(caption);
            if (caption === "") caption = "MenuItem" + pas.SysUtils.IntToStr(id);
            it.SetName(caption + pas.SysUtils.IntToStr(id));
          };
          if (it.FVisible) {
            ElListItem = document.createElement("LI");
            if (it.FCaption !== "-") {
              ElLabel = document.createElement("LABEL");
              if (this.FElementItemClassName !== "") {
                ElLabel.setAttribute("class",this.FElementItemClassName)}
               else ElLabel.setAttribute("class","drop-label");
              ElLabel.setAttribute("title",it.FHint);
              if ((it.FImageIndex >= 0) && (this.FAppearance.FImageURLs.GetCount() > it.FImageIndex)) {
                ElLabel.innerHTML = '<img class="icon" src="' + this.FAppearance.FImageURLs.Get(it.FImageIndex) + '">'}
               else if (it.FChecked) {
                if (it.FRadioItem) {
                  ElLabel.innerHTML = '<span class="checked">&#9679;</span>'}
                 else ElLabel.innerHTML = '<span class="checked">&#10004;</span>';
              };
              ElLabel.innerHTML = ElLabel.innerHTML + it.FCaption;
            } else {
              ElLabel = document.createElement("SPAN");
              ElLabel.setAttribute("class","menu-separator");
              ElLabel.innerHTML = "";
            };
            if ((it.FItems != null) && (it.FItems.GetCount() > 0)) {
              ElSymbol = document.createElement("SPAN");
              ElSymbol.setAttribute("class","drop-icon");
              ElSymbol.innerHTML = this.FAppearance.FSubmenuIndicator;
              ElLabel.setAttribute("for","sm" + pas.SysUtils.IntToStr(this.FMenuIndex));
              ElLabel.appendChild(ElSymbol);
              if (!it.FEnabled) ElLabel.style.setProperty("color","gray");
              ElCheckBox = document.createElement("INPUT");
              ElCheckBox.setAttribute("type","checkbox");
              ElCheckBox.setAttribute("id","sm" + pas.SysUtils.IntToStr(this.FMenuIndex));
              ElListItem.appendChild(ElLabel);
              ElListItem.appendChild(ElCheckBox);
              if (it.FEnabled) ElListItem.appendChild(this.GetMenuSource(it));
            } else {
              ElLabel.setAttribute("for",this.GetID() + "tm");
              ElLabel.setAttribute("id",it.FName);
              if (it.FEnabled) {
                if (MenuClass === "sub-menu") {
                  if (it.FEnabled) ElLabel.setAttribute("onMouseUp",this.GetID() + "MenuClick(this);");
                };
                ElLabel.addEventListener("click",rtl.createSafeCallback(this,"HandleChange"));
              } else ElLabel.style.setProperty("color","gray");
              ElListItem.appendChild(ElLabel);
            };
            Result.appendChild(ElListItem);
          };
        };
      };
      return Result;
    };
    this.GetItemByName = function (AMenu, Name) {
      var Result = null;
      var I = 0;
      var it = null;
      Result = null;
      if (AMenu.FItems != null) {
        for (var $l = 0, $end = AMenu.FItems.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          it = AMenu.FItems.GetItem(I);
          if (it.FName === Name) {
            Result = it;
            if (it.FOnClick != null) Result.FOnClick = it.FOnClick;
            return Result;
          };
          if (!(Result != null)) Result = this.GetItemByName(it,Name);
        };
      };
      return Result;
    };
    this.ClearMethodPointers = function () {
      pas["WEBLib.Controls"].TControl.ClearMethodPointers.call(this);
      this.FDocClickPtr = null;
    };
    this.CreateInitialize = function () {
      $mod.TCustomMainMenu.CreateInitialize.call(this);
      this.FAppearance = $mod.TMainMenuAppearance.$create("Create$1",[this]);
      this.FContainer$1 = null;
      this.FMainMenu = true;
      this.FMenuIndex = 0;
      this.FIsPopupMenu = false;
      this.FShowPopup = false;
      this.SetTop(0);
      this.SetLeft(0);
      this.SetWidth(100);
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        this.SetElementPosition(pas["WEBLib.Controls"].TElementPosition.epRelative);
        this.SetWidthPercent(100);
        this.SetWidthStyle(pas["WEBLib.Controls"].TSizeStyle.ssPercent);
      };
    };
    this.CreateElement = function () {
      var Result = null;
      var LLabel = null;
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        Result = document.createElement("DIV");
        LLabel = document.createElement("DIV");
        LLabel.innerHTML = "TWebMainMenu";
        this.SetBorderStyle(pas["WEBLib.Controls"].TBorderStyle.bsSingle);
        LLabel.setAttribute("align","center");
        LLabel.style.setProperty("border","1px solid gray");
        LLabel.style.setProperty("vertical-align","middle");
        LLabel.style.setProperty("display","table-cell");
        Result.appendChild(LLabel);
      } else {
        Result = document.createElement("DIV");
        if (this.FIsPopupMenu) {
          this.FDocClickPtr = rtl.createCallback(this,"HandleDocClick");
        };
      };
      this.FZIndex = pas["WEBLib.Forms"].Application.MaxZIndexStr();
      pas["WEBLib.Forms"].Application.ChangeMaxZIndex(+1);
      return Result;
    };
    this.Destroy = function () {
      rtl.free(this,"FAppearance");
      $mod.TCustomMainMenu.Destroy.call(this);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Appearance",0,$mod.$rtti["TMainMenuAppearance"],"FAppearance","FAppearance");
    $r.addProperty("Container",0,pas["WEBLib.Controls"].$rtti["TControl"],"FContainer$1","FContainer$1");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementItemClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementItemClassName","FElementItemClassName");
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",4,{Default: true});
  });
  rtl.createClass(this,"TWebMainMenu",this.TMainMenu,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TPopupMenu",this.TMainMenu,function () {
    this.$init = function () {
      $mod.TMainMenu.$init.call(this);
      this.FOnPopup = null;
    };
    this.$final = function () {
      this.FOnPopup = undefined;
      $mod.TMainMenu.$final.call(this);
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.Controls"].TControl.Create$1.apply(this,arguments);
      if (pas["WEBLib.Controls"].TControl.isPrototypeOf(AOwner)) this.SetParent(AOwner);
      return this;
    };
    this.CreateInitialize = function () {
      $mod.TMainMenu.CreateInitialize.call(this);
      this.FAppearance.FHamburgerMenu.SetVisible($mod.TMainMenuHamburgerMenuVisible.hmNever);
      this.FIsPopupMenu = true;
    };
    this.Popup = function (X, Y) {
      var frm = null;
      var el = null;
      var LDidAppend = false;
      if (this.FOnPopup != null) this.FOnPopup(this);
      this.SetTop(Y);
      this.SetLeft(X);
      frm = pas["WEBLib.Forms"].GetParentForm(this);
      if (frm != null) {
        this.FLayer$1 = frm.CreateLayer();
        if (!frm.FPopup) {
          LDidAppend = false;
          if (frm.FFormContainer !== "") {
            el = document.getElementById(frm.FFormContainer);
            if (el != null) {
              el.appendChild(this.FLayer$1);
              LDidAppend = true;
            };
          };
          if (!LDidAppend && !(this.FContainer$1 != null)) {
            document.body.appendChild(this.FLayer$1);
          };
        } else {
          frm.GetElementHandle().appendChild(this.FLayer$1);
        };
        this.FLayer$1.style.setProperty("z-index",pas.SysUtils.IntToStr(pas["WEBLib.Forms"].Application.FMaxZIndex - 1));
        this.FLayer$1.addEventListener("click",this.FDocClickPtr);
      };
      this.FShowPopup = true;
      this.GetElementHandle().style.setProperty("z-index",pas.SysUtils.IntToStr(pas["WEBLib.Forms"].Application.FMaxZIndex));
      this.UpdateElement();
      this.FShowPopup = false;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("OnPopup",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnPopup","FOnPopup");
  });
  rtl.createClass(this,"TWebPopupMenu",this.TPopupMenu,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.$rtti.$Class("TWebCustomControl");
  this.$rtti.$ClassRef("TWebCustomControlClass",{instancetype: this.$rtti["TWebCustomControl"]});
  rtl.createClass(this,"TWebCustomControl",pas["WEBLib.Controls"].TCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Controls"].TCustomControl.$init.call(this);
      this.FPopupMenu = null;
    };
    this.$final = function () {
      this.FPopupMenu = undefined;
      pas["WEBLib.Controls"].TCustomControl.$final.call(this);
    };
    this.HandleDoContextMenu = function (Event) {
      var Result = false;
      var pt = pas.Types.TPoint.$new();
      var r = null;
      pas["WEBLib.Controls"].TControl.HandleDoContextMenu.apply(this,arguments);
      if (this.FPopupMenu != null) {
        Event.stopPropagation();
        Event.preventDefault();
        pt.$assign(pas.Types.Point(Math.round(Event.clientX),Math.round(Event.clientY)));
        if ((this.FPopupMenu.FOwner != null) && (this.FPopupMenu.FOwner.GetContainer() != null)) {
          r = this.FPopupMenu.FOwner.GetContainer().getBoundingClientRect();
          pt.x = pt.x - Math.round(r.left);
          pt.y = pt.y - Math.round(r.top);
        };
        this.FPopupMenu.Popup(pt.x,pt.y);
        Result = true;
      };
      return Result;
    };
    this.Notification = function (AComponent, Operation) {
      pas.Classes.TComponent.Notification.apply(this,arguments);
      if ((Operation === pas.Classes.TOperation.opRemove) && (AComponent === this.FPopupMenu)) this.FPopupMenu = null;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TWebGraphicControl",pas["WEBLib.Controls"].TGraphicControl,function () {
    this.$init = function () {
      pas["WEBLib.Controls"].TGraphicControl.$init.call(this);
      this.FPopupMenu = null;
    };
    this.$final = function () {
      this.FPopupMenu = undefined;
      pas["WEBLib.Controls"].TGraphicControl.$final.call(this);
    };
    this.HandleDoContextMenu = function (Event) {
      var Result = false;
      var pt = pas.Types.TPoint.$new();
      var r = null;
      pas["WEBLib.Controls"].TControl.HandleDoContextMenu.apply(this,arguments);
      if (this.FPopupMenu != null) {
        Event.stopPropagation();
        Event.preventDefault();
        pt.$assign(pas.Types.Point(Math.round(Event.clientX),Math.round(Event.clientY)));
        if ((this.FPopupMenu.FOwner != null) && (this.FPopupMenu.FOwner.GetContainer() != null)) {
          r = this.FPopupMenu.FOwner.GetContainer().getBoundingClientRect();
          pt.x = pt.x - Math.round(r.left);
          pt.y = pt.y - Math.round(r.top);
        };
        this.FPopupMenu.Popup(pt.x,pt.y);
        Result = true;
      };
      return Result;
    };
    this.Notification = function (AComponent, Operation) {
      pas.Classes.TComponent.Notification.apply(this,arguments);
      if ((Operation === pas.Classes.TOperation.opRemove) && (AComponent === this.FPopupMenu)) this.FPopupMenu = null;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  $mod.$implcode = function () {
    rtl.createClass($impl,"TCrackedApplication",pas["WEBLib.Forms"].TApplication,function () {
      rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
      rtl.addIntf(this,pas.System.IUnknown);
    });
    rtl.createClass($impl,"TCrackedForm",pas["WEBLib.Forms"].TForm,function () {
      rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
      rtl.addIntf(this,pas.System.IUnknown);
    });
    var Alpha = rtl.createSet(null,65,90,null,97,122,95);
    var AlphaNum = rtl.unionSet(Alpha,rtl.createSet(null,48,57));
    $impl.MakeValidName = function (s) {
      var Result = "";
      var i = 0;
      Result = "";
      for (var $l = 1, $end = s.length; $l <= $end; $l++) {
        i = $l;
        if (s.charCodeAt(i - 1) in AlphaNum) Result = Result + s.charAt(i - 1);
      };
      return Result;
    };
  };
},["Types","WEBLib.Forms"]);
rtl.module("WEBLib.ClientConnector",["System","Classes","WEBLib.JSON"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.TClientConnectorIdentifier = {"0": "ciUnknown", ciUnknown: 0, "1": "ciAndroid", ciAndroid: 1, "2": "ciiOS", ciiOS: 2, "3": "ciWindows", ciWindows: 3, "4": "ciMac", ciMac: 4};
  this.$rtti.$Enum("TClientConnectorIdentifier",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TClientConnectorIdentifier});
  this.$rtti.$MethodVar("TClientConnectorReceivedMessageEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AJSON",pas["WEBLib.JSON"].$rtti["TJSONObject"]]]), methodkind: 0});
  rtl.createClass(this,"TClientConnector",pas.Classes.TComponent,function () {
    this.$init = function () {
      pas.Classes.TComponent.$init.call(this);
      this.FOnReceivedMessage = null;
    };
    this.$final = function () {
      this.FOnReceivedMessage = undefined;
      pas.Classes.TComponent.$final.call(this);
    };
    this.Create$1 = function (AOwner) {
      pas.Classes.TComponent.Create$1.apply(this,arguments);
      pas["WEBLib.Forms"].Application.FClientConnector = this;
      return this;
    };
    this.Destroy = function () {
      pas["WEBLib.Forms"].Application.FClientConnector = null;
      pas.Classes.TComponent.Destroy.call(this);
    };
    this.Receive = function (AJSON) {
      var js = null;
      var o = null;
      var s = "";
      js = pas["WEBLib.JSON"].TJSON.$create("Create");
      s = decodeURIComponent(AJSON);
      o = js.Parse(s);
      if (this.FOnReceivedMessage != null) this.FOnReceivedMessage(this,o);
      o = rtl.freeLoc(o);
    };
    this.Send = function (AJSON) {
      var s = "";
      s = JSON.stringify(AJSON.fjo$1);
      this.SendMessage(s);
    };
    var MAXBUFFERCOUNT = 500;
    this.SendMessage = function (AMessage) {
      var $Self = this;
      var s = "";
      var cid = 0;
      var scid = "";
      var sSub = "";
      var sc = 0;
      function InternalSend(m) {
        var $tmp = cid;
        if ($tmp === $mod.TClientConnectorIdentifier.ciAndroid) {
          injectedObject.Setjsvalue(m);
          injectedObject.performClick();
        } else if (($tmp === $mod.TClientConnectorIdentifier.ciiOS) || ($tmp === $mod.TClientConnectorIdentifier.ciMac)) {
          window.webkit.messageHandlers.bridge.postMessage(m);
        } else if ($tmp === $mod.TClientConnectorIdentifier.ciWindows) {
          window.location = m;
        } else if ($tmp === $mod.TClientConnectorIdentifier.ciUnknown) pas["WEBLib.Dialogs"].ShowMessage("Please perform handshake from client first.");
      };
      s = AMessage;
      scid = window.TMSWEBCoreClientIdentifier;
      cid = $mod.TClientConnectorIdentifier.ciUnknown;
      var $tmp = pas.SysUtils.LowerCase(scid);
      if ($tmp === "android") {
        cid = $mod.TClientConnectorIdentifier.ciAndroid}
       else if ($tmp === "ios") {
        cid = $mod.TClientConnectorIdentifier.ciiOS}
       else if ($tmp === "windows") {
        cid = $mod.TClientConnectorIdentifier.ciWindows}
       else if (($tmp === "mac") || ($tmp === "macos")) cid = $mod.TClientConnectorIdentifier.ciMac;
      var $tmp1 = pas.SysUtils.LowerCase(scid);
      if (($tmp1 === "mac") || ($tmp1 === "macos") || ($tmp1 === "ios")) {
        InternalSend($impl.Prefix + encodeURIComponent(s))}
       else if (($tmp1 === "android") || ($tmp1 === "windows")) {
        InternalSend($impl.Prefix + "BUFFERSTART");
        while (s.length > 0) {
          sc = Math.min(s.length & 0xFFFFFFFF,500);
          sSub = pas.System.Copy(s,1,sc);
          pas.System.Delete({get: function () {
              return s;
            }, set: function (v) {
              s = v;
            }},1,sc);
          InternalSend($impl.Prefix + encodeURIComponent(sSub));
        };
        InternalSend($impl.Prefix + "BUFFEREND");
      };
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("OnReceivedMessage",0,$mod.$rtti["TClientConnectorReceivedMessageEvent"],"FOnReceivedMessage","FOnReceivedMessage");
  });
  rtl.createClass(this,"TWebClientConnector",this.TClientConnector,function () {
    rtl.addIntf(this,pas.System.IUnknown);
  });
  $mod.$implcode = function () {
    $impl.Prefix = "webclientevent://";
  };
},["Math","JS","WEBLib.Forms","SysUtils","WEBLib.Dialogs"]);
rtl.module("Rtl.BrowserLoadHelper",["System","Classes","SysUtils","JS","Web"],function () {
  "use strict";
  var $mod = this;
  rtl.createClass(this,"TBrowserLoadHelper",pas.Classes.TLoadHelper,function () {
    this.LoadText = function (aURL, aSync, OnLoaded, OnError) {
      var $Self = this;
      var ARequest = null;
      function doFetchOK(response) {
        var Result = undefined;
        Result = false;
        if (response.status !== 200) {
          if (OnError != null) OnError("Error " + pas.SysUtils.IntToStr(response.status) + ": " + response.statusText);
        } else response.text().then(function (value) {
          var Result = undefined;
          OnLoaded("" + value);
          return Result;
        });
        return Result;
      };
      function doFetchFail(response) {
        var Result = undefined;
        Result = false;
        OnError("Error 999: unknown error");
        return Result;
      };
      if (aSync) {
        window.fetch(aURL).then(doFetchOK).catch(doFetchFail)}
       else {
        ARequest = new XMLHttpRequest();
        ARequest.open("GET",aURL,false);
        ARequest.addEventListener("load",function (oEvent) {
          OnLoaded(ARequest.responseText);
        });
        ARequest.addEventListener("error",function (oEvent) {
          if (OnError != null) OnError(oEvent.message);
        });
        ARequest.send();
      };
    };
    this.LoadBytes = function (aURL, aSync, OnLoaded, OnError) {
      var $Self = this;
      var ARequest = null;
      function doFetchFail(response) {
        var Result = undefined;
        Result = false;
        if (rtl.isObject(response) && rtl.isExt(response,Error)) {
          OnError("Error 999: " + response.message)}
         else OnError("Error 999: unknown error");
        return Result;
      };
      function doFetchOK(response) {
        var Result = undefined;
        Result = false;
        if (response.status !== 200) {
          if (OnError != null) OnError("Error " + pas.SysUtils.IntToStr(response.status) + ": " + response.statusText);
        } else response.blob().then(function (value) {
          var Result = undefined;
          value.arrayBuffer().then(function (arr) {
            var Result = undefined;
            OnLoaded(arr);
            return Result;
          }).catch(doFetchFail);
          return Result;
        });
        return Result;
      };
      function StringToArrayBuffer(str) {
        var Result = null;
        var i = 0;
        var l = 0;
        l = str.length;
        Result = new ArrayBuffer(l * 2);
        var $with = new Uint16Array(Result);
        for (var $l = 1, $end = l; $l <= $end; $l++) {
          i = $l;
          $with[i - 1] = str.charCodeAt(i - 1);
        };
        return Result;
      };
      if (aSync) {
        window.fetch(aURL).then(doFetchOK).catch(doFetchFail)}
       else {
        ARequest = new XMLHttpRequest();
        ARequest.open("GET",aURL,false);
        ARequest.addEventListener("load",function (oEvent) {
          if (ARequest.status !== 200) {
            OnError("Error " + pas.SysUtils.IntToStr(ARequest.status) + ": " + ARequest.statusText)}
           else OnLoaded(StringToArrayBuffer(ARequest.responseText));
        });
        ARequest.addEventListener("error",function (oEvent) {
          if (OnError != null) OnError(oEvent.message);
        });
        ARequest.send();
      };
    };
  });
  $mod.$init = function () {
    pas.Classes.SetLoadHelperClass($mod.TBrowserLoadHelper);
  };
});
rtl.module("WEBLib.Forms",["System","Classes","Types","SysUtils","WEBLib.Graphics","WEBLib.Controls","WEBLib.Modules","WEBLib.Lang","WEBLib.Menus","Web","JS","WEBLib.ClientConnector","Rtl.BrowserLoadHelper"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.WEBCOREVERSION = "2.9.8.1";
  this.idOK = 1;
  this.idCancel = 2;
  this.idAbort = 3;
  this.idRetry = 4;
  this.idIgnore = 5;
  this.idYes = 6;
  this.idNo = 7;
  this.idClose = 8;
  this.idHelp = 9;
  this.idTryAgain = 10;
  this.idContinue = 11;
  this.mrNone = 0;
  this.mrOk = 1;
  this.mrCancel = 2;
  this.mrAbort = 3;
  this.mrRetry = 4;
  this.mrIgnore = 5;
  this.mrYes = 6;
  this.mrNo = 7;
  this.mrClose = 8;
  this.mrHelp = 9;
  this.mrTryAgain = 10;
  this.mrContinue = 11;
  this.mrAll = 11 + 1;
  this.mrNoToAll = 12 + 1;
  this.mrYesToAll = 13 + 1;
  this.rgiFirst = -1024;
  this.rgiLast = -513;
  this.igiFirst = 256;
  this.igiLast = 511;
  this.clTMSBlue = 0xE39E00;
  this.clTMSWEB = 0x8F8300;
  this.$rtti.$Class("TDragDockObject");
  this.$rtti.$Class("TCustomForm");
  this.$rtti.$Int("TConstraintSize",{minvalue: 0, maxvalue: 2147483647, ordtype: 5});
  this.TCloseAction = {"0": "caNone", caNone: 0, "1": "caHide", caHide: 1, "2": "caFree", caFree: 2, "3": "caMinimize", caMinimize: 3};
  this.$rtti.$Enum("TCloseAction",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TCloseAction});
  this.TFormStyle = {"0": "fsNormal", fsNormal: 0, "1": "fsStayOnTop", fsStayOnTop: 1};
  this.$rtti.$Enum("TFormStyle",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TFormStyle});
  this.TNavigationTarget = {"0": "ntBlank", ntBlank: 0, "1": "ntPage", ntPage: 1};
  this.$rtti.$Enum("TNavigationTarget",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TNavigationTarget});
  this.$rtti.$Int("TGestureID",{minvalue: -1024, maxvalue: 511, ordtype: 2});
  this.TInteractiveGestureFlag = {"0": "gfBegin", gfBegin: 0, "1": "gfInertia", gfInertia: 1, "2": "gfEnd", gfEnd: 2};
  this.$rtti.$Enum("TInteractiveGestureFlag",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TInteractiveGestureFlag});
  this.$rtti.$Set("TInteractiveGestureFlags",{comptype: this.$rtti["TInteractiveGestureFlag"]});
  this.TMouseActivate = {"0": "maDefault", maDefault: 0, "1": "maActivate", maActivate: 1, "2": "maActivateAndEat", maActivateAndEat: 2, "3": "maNoActivate", maNoActivate: 3, "4": "maNoActivateAndEat", maNoActivateAndEat: 4};
  this.$rtti.$Enum("TMouseActivate",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TMouseActivate});
  this.TScreenOrientation = {"0": "soPortrait", soPortrait: 0, "1": "soLandscape", soLandscape: 1};
  this.$rtti.$Enum("TScreenOrientation",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TScreenOrientation});
  this.TApplicationColorScheme = {"0": "csNoScheme", csNoScheme: 0, "1": "csLight", csLight: 1, "2": "csDark", csDark: 2};
  this.$rtti.$Enum("TApplicationColorScheme",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TApplicationColorScheme});
  rtl.recNewT(this,"TSmallPoint",function () {
    this.x = 0;
    this.y = 0;
    this.$eq = function (b) {
      return (this.x === b.x) && (this.y === b.y);
    };
    this.$assign = function (s) {
      this.x = s.x;
      this.y = s.y;
      return this;
    };
    var $r = $mod.$rtti.$Record("TSmallPoint",{},this);
    $r.addField("x",rtl.smallint);
    $r.addField("y",rtl.smallint);
  });
  rtl.recNewT(this,"TAlignInfo",function () {
    this.AlignList = null;
    this.ControlIndex = 0;
    this.Align = 0;
    this.Scratch = 0;
    this.$eq = function (b) {
      return (this.AlignList === b.AlignList) && (this.ControlIndex === b.ControlIndex) && (this.Align === b.Align) && (this.Scratch === b.Scratch);
    };
    this.$assign = function (s) {
      this.AlignList = s.AlignList;
      this.ControlIndex = s.ControlIndex;
      this.Align = s.Align;
      this.Scratch = s.Scratch;
      return this;
    };
    var $r = $mod.$rtti.$Record("TAlignInfo",{},this);
    $r.addField("AlignList",pas.Classes.$rtti["TList"]);
    $r.addField("ControlIndex",rtl.longint);
    $r.addField("Align",pas["WEBLib.Controls"].$rtti["TAlign"]);
    $r.addField("Scratch",rtl.longint);
  });
  rtl.recNewT(this,"TGestureEventInfo",function () {
    this.GestureID = 0;
    this.Angle = 0.0;
    this.Distance = 0;
    this.$new = function () {
      var r = Object.create(this);
      r.Location = pas.Types.TPoint.$new();
      r.Flags = {};
      r.InertiaVector = $mod.TSmallPoint.$new();
      r.TapLocation = $mod.TSmallPoint.$new();
      return r;
    };
    this.$eq = function (b) {
      return (this.GestureID === b.GestureID) && this.Location.$eq(b.Location) && rtl.eqSet(this.Flags,b.Flags) && (this.Angle === b.Angle) && this.InertiaVector.$eq(b.InertiaVector) && (this.Distance === b.Distance) && this.TapLocation.$eq(b.TapLocation);
    };
    this.$assign = function (s) {
      this.GestureID = s.GestureID;
      this.Location.$assign(s.Location);
      this.Flags = rtl.refSet(s.Flags);
      this.Angle = s.Angle;
      this.InertiaVector.$assign(s.InertiaVector);
      this.Distance = s.Distance;
      this.TapLocation.$assign(s.TapLocation);
      return this;
    };
    var $r = $mod.$rtti.$Record("TGestureEventInfo",{},this);
    $r.addField("GestureID",$mod.$rtti["TGestureID"]);
    $r.addField("Location",pas.Types.$rtti["TPoint"]);
    $r.addField("Flags",$mod.$rtti["TInteractiveGestureFlags"]);
    $r.addField("Angle",rtl.double);
    $r.addField("InertiaVector",$mod.$rtti["TSmallPoint"]);
    $r.addField("Distance",rtl.longint);
    $r.addField("TapLocation",$mod.$rtti["TSmallPoint"]);
  });
  this.$rtti.$MethodVar("TCloseEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Action",this.$rtti["TCloseAction"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TCloseQueryEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["CanClose",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TOrientationChangeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AOrientation",this.$rtti["TScreenOrientation"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TBeforeUnloadEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AMessage",rtl.string,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TAlignInsertBeforeEvent",{procsig: rtl.newTIProcSig([["Sender",pas["WEBLib.Controls"].$rtti["TWinControl"]],["C1",pas["WEBLib.Controls"].$rtti["TControl"]],["C2",pas["WEBLib.Controls"].$rtti["TControl"]]],rtl.boolean), methodkind: 1});
  this.$rtti.$MethodVar("TAlignPositionEvent",{procsig: rtl.newTIProcSig([["Sender",pas["WEBLib.Controls"].$rtti["TWinControl"]],["Control",pas["WEBLib.Controls"].$rtti["TControl"]],["NewLeft",rtl.longint,1],["NewTop",rtl.longint,1],["NewWidth",rtl.longint,1],["NewHeight",rtl.longint,1],["AlignRect",pas.Types.$rtti["TRect"],1],["AlignInfo",this.$rtti["TAlignInfo"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TCanResizeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["NewWidth",rtl.longint,1],["NewHeight",rtl.longint,1],["Resize",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TConstrainedResizeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["MinWidth",rtl.longint,1],["MinHeight",rtl.longint,1],["MaxWidth",rtl.longint,1],["MaxHeight",rtl.longint,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TContextPopupEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["MousePos",pas.Types.$rtti["TPoint"]],["Handled",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TDockDropEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Source",this.$rtti["TDragDockObject"]],["X",rtl.longint],["Y",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TDockOverEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Source",this.$rtti["TDragDockObject"]],["X",rtl.longint],["Y",rtl.longint],["State",pas["WEBLib.Controls"].$rtti["TDragState"]],["Accept",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TGestureEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["EventInfo",this.$rtti["TGestureEventInfo"],2],["Handled",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TGetSiteInfoEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["DockClient",pas["WEBLib.Controls"].$rtti["TControl"]],["InfluenceRect",pas.Types.$rtti["TRect"],1],["MousePos",pas.Types.$rtti["TPoint"]],["CanDock",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TMouseActivateEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Button",pas["WEBLib.Controls"].$rtti["TMouseButton"]],["Shift",pas.Classes.$rtti["TShiftState"]],["X",rtl.longint],["Y",rtl.longint],["HitTest",rtl.longint],["MouseActivate",this.$rtti["TMouseActivate"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TMouseWheelUpDownEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Shift",pas.Classes.$rtti["TShiftState"]],["MousePos",pas.Types.$rtti["TPoint"]],["Handled",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TStartDockEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["DragObject",this.$rtti["TDragDockObject"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TUnDockEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Client",pas["WEBLib.Controls"].$rtti["TControl"]],["NewTarget",pas["WEBLib.Controls"].$rtti["TWinControl"]],["Allow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("THashChangeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["oldURL",rtl.string],["newURL",rtl.string]]), methodkind: 0});
  this.$rtti.$RefToProcVar("TModalResultProc",{procsig: rtl.newTIProcSig([["AValue",rtl.longint]])});
  this.$rtti.$RefToProcVar("TFormCreatedProc",{procsig: rtl.newTIProcSig([["AForm",pas.System.$rtti["TObject"]]])});
  this.TWindowState = {"0": "wsNormal", wsNormal: 0, "1": "wsMinimized", wsMinimized: 1, "2": "wsMaximized", wsMaximized: 2};
  this.$rtti.$Enum("TWindowState",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TWindowState});
  this.TPopupMode = {"0": "pmNone", pmNone: 0, "1": "pmAuto", pmAuto: 1, "2": "pmExplicit", pmExplicit: 2};
  this.$rtti.$Enum("TPopupMode",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TPopupMode});
  this.TPopupClose = {"0": "pcOnDeactivate", pcOnDeactivate: 0, "1": "pcNever", pcNever: 1};
  this.$rtti.$Enum("TPopupClose",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TPopupClose});
  this.TPosition = {"0": "poDesigned", poDesigned: 0, "1": "poDefault", poDefault: 1, "2": "poDefaultPosOnly", poDefaultPosOnly: 2, "3": "poDefaultSizeOnly", poDefaultSizeOnly: 3, "4": "poScreenCenter", poScreenCenter: 4, "5": "poDesktopCenter", poDesktopCenter: 5, "6": "poMainFormCenter", poMainFormCenter: 6, "7": "poOwnerFormCenter", poOwnerFormCenter: 7};
  this.$rtti.$Enum("TPosition",{minvalue: 0, maxvalue: 7, ordtype: 1, enumtype: this.TPosition});
  this.TApplicationErrorType = {"0": "aeSilent", aeSilent: 0, "1": "aeDialog", aeDialog: 1, "2": "aeAlert", aeAlert: 2, "3": "aeFooter", aeFooter: 3};
  this.$rtti.$Enum("TApplicationErrorType",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TApplicationErrorType});
  this.TFormBorderStyle = {"0": "fbNone", fbNone: 0, "1": "fbSingle", fbSingle: 1, "2": "fbSizeable", fbSizeable: 2, "3": "fbDialog", fbDialog: 3, "4": "fbDialogSizeable", fbDialogSizeable: 4};
  this.$rtti.$Enum("TFormBorderStyle",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TFormBorderStyle});
  this.$rtti.$Enum("TFormBorder",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TFormBorderStyle});
  this.TBootstrapVersion = {"0": "bv3", bv3: 0, "1": "bv4", bv4: 1, "2": "bv5", bv5: 2};
  this.$rtti.$Enum("TBootstrapVersion",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TBootstrapVersion});
  rtl.createClass(this,"TCustomSizeConstraints",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FControl = null;
      this.FMaxHeight = 0;
      this.FMaxWidth = 0;
      this.FMinHeight = 0;
      this.FMinWidth = 0;
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FControl = undefined;
      this.FOnChange = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetConstraints = function (AIndex, AValue) {
      var $tmp = AIndex;
      if ($tmp === 0) {
        if (AValue !== this.FMaxHeight) {
          this.FMaxHeight = AValue;
          if ((AValue > 0) && (AValue < this.FMinHeight)) this.FMinHeight = AValue;
          this.Change();
        }}
       else if ($tmp === 1) {
        if (AValue !== this.FMaxWidth) {
          this.FMaxWidth = AValue;
          if ((AValue > 0) && (AValue < this.FMinWidth)) this.FMinWidth = AValue;
          this.Change();
        }}
       else if ($tmp === 2) {
        if (AValue !== this.FMinHeight) {
          this.FMinHeight = AValue;
          if ((this.FMaxHeight > 0) && (AValue > this.FMaxHeight)) this.FMaxHeight = AValue;
          this.Change();
        }}
       else if ($tmp === 3) if (AValue !== this.FMinWidth) {
        this.FMinWidth = AValue;
        if ((this.FMaxWidth > 0) && (AValue > this.FMaxWidth)) this.FMaxWidth = AValue;
        this.Change();
      };
    };
    this.Change = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.AssignTo = function (ADest) {
      if ($mod.TCustomSizeConstraints.isPrototypeOf(ADest)) {
        ADest.FMinHeight = this.FMinHeight;
        ADest.FMaxHeight = this.FMaxHeight;
        ADest.FMinWidth = this.FMinWidth;
        ADest.FMaxWidth = this.FMaxWidth;
        ADest.Change();
      } else pas.Classes.TPersistent.AssignTo.call(this,ADest);
    };
    this.Create$1 = function (AControl) {
      pas.System.TObject.Create.call(this);
      this.FControl = AControl;
      return this;
    };
  });
  rtl.createClass(this,"TSizeConstraints",this.TCustomSizeConstraints,function () {
    var $r = this.$rtti;
    $r.addProperty("MaxHeight",18,$mod.$rtti["TConstraintSize"],"FMaxHeight","SetConstraints",4,{index: 0, Default: 0});
    $r.addProperty("MaxWidth",18,$mod.$rtti["TConstraintSize"],"FMaxWidth","SetConstraints",4,{index: 1, Default: 0});
    $r.addProperty("MinHeight",18,$mod.$rtti["TConstraintSize"],"FMinHeight","SetConstraints",4,{index: 2, Default: 0});
    $r.addProperty("MinWidth",18,$mod.$rtti["TConstraintSize"],"FMinWidth","SetConstraints",4,{index: 3, Default: 0});
  });
  rtl.createClass(this,"TDragDockObject",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FBrush = null;
      this.FDockRect = pas.Types.TRect.$new();
      this.FDropAlign = 0;
      this.FDropOnControl = null;
      this.FEraseDockRect = pas.Types.TRect.$new();
      this.FEraseWhenMoving = false;
      this.FFloating = false;
      this.FFrameWidth = 0;
    };
    this.$final = function () {
      this.FBrush = undefined;
      this.FDockRect = undefined;
      this.FDropOnControl = undefined;
      this.FEraseDockRect = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function (AControl) {
      pas.System.TObject.Create.call(this);
      this.FBrush = pas["WEBLib.Graphics"].TBrush.$create("Create$1");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FBrush");
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
    };
  });
  rtl.createClass(this,"TCustomForm",pas["WEBLib.Controls"].TWinControl,function () {
    this.$init = function () {
      pas["WEBLib.Controls"].TWinControl.$init.call(this);
      this.FDesignContainer = null;
      this.FLayer$1 = null;
      this.FPopup = false;
      this.FDirectForm = false;
      this.FPopupElement = null;
      this.FFormFileName = "";
      this.FFormContent = "";
      this.FFormContainer = "";
      this.FFormElement = "";
      this.FFormStyle = 0;
      this.FOnCreate = null;
      this.FOnShow = null;
      this.FModalResult = 0;
      this.FOnPaint = null;
      this.FOnDeactivate = null;
      this.FOnCloseQuery = null;
      this.FOnClose = null;
      this.FModalProc = null;
      this.FCreatedProc = null;
      this.FWindowState = 0;
      this.FCaption = "";
      this.FIsResizing$1 = false;
      this.FOnScroll = null;
      this.FOnUnload = null;
      this.FOnBeforeUnload = null;
      this.FPopupMode = 0;
      this.FPopupClose = 0;
      this.FPosition = 0;
      this.FActiveControl = null;
      this.FMdx = 0;
      this.FMdy = 0;
      this.FDlgX = 0;
      this.FDlgY = 0;
      this.FCaptured$1 = false;
      this.FDown = false;
      this.FHasCaption = false;
      this.FMoveSpan = null;
      this.FCaptionElement = null;
      this.FCaptionCloseElement = null;
      this.FBorder = 0;
      this.FShadow = false;
      this.FTimerID = 0;
      this.FOrigWidth = 0;
      this.FOrigHeight = 0;
      this.FOldWidth = 0;
      this.FOldHeight = 0;
      this.FOnDestroy = null;
      this.FPopupOpacity = 0.0;
      this.FCreating = false;
      this.FCreated = false;
      this.FShown = false;
      this.FLoadedPtr = null;
      this.FDOMContentLoadedPtr = null;
      this.FUnloadPtr = null;
      this.FBeforeUnloadPtr = null;
      this.FResizePtr = null;
      this.FScrollPtr = null;
      this.FDocMouseUpPtr = null;
      this.FDocMouseMovePtr = null;
      this.FTitleDownPtr = null;
      this.FTitleTouchStartPtr = null;
      this.FDocTouchMovePtr = null;
      this.FDocTouchEndPtr = null;
      this.FDoClickPtr = null;
      this.FKeyDownPtr$1 = null;
      this.FOrientationChangePtr = null;
      this.FHashChangePtr = null;
      this.FCSSLibrary = 0;
      this.FNoHTML = false;
      this.FPrevActiveForm = null;
      this.FElementCaptionClassName = "";
      this.FElementPopupClassName = "";
      this.FMenu = null;
      this.FResizeObserver = null;
      this.FOnOrientationChange = null;
      this.FOnDOMContentLoaded = null;
      this.FShowClose = false;
      this.FOnHashChange = null;
      this.FDefaultCloseAction = 0;
    };
    this.$final = function () {
      this.FDesignContainer = undefined;
      this.FLayer$1 = undefined;
      this.FPopupElement = undefined;
      this.FOnCreate = undefined;
      this.FOnShow = undefined;
      this.FOnPaint = undefined;
      this.FOnDeactivate = undefined;
      this.FOnCloseQuery = undefined;
      this.FOnClose = undefined;
      this.FModalProc = undefined;
      this.FCreatedProc = undefined;
      this.FOnScroll = undefined;
      this.FOnUnload = undefined;
      this.FOnBeforeUnload = undefined;
      this.FActiveControl = undefined;
      this.FMoveSpan = undefined;
      this.FCaptionElement = undefined;
      this.FCaptionCloseElement = undefined;
      this.FOnDestroy = undefined;
      this.FPrevActiveForm = undefined;
      this.FMenu = undefined;
      this.FResizeObserver = undefined;
      this.FOnOrientationChange = undefined;
      this.FOnDOMContentLoaded = undefined;
      this.FOnHashChange = undefined;
      pas["WEBLib.Controls"].TWinControl.$final.call(this);
    };
    this.SetModalResult = function (Value) {
      this.FModalResult = Value;
      if (this.FModalResult !== 0) this.Close();
    };
    this.GetFormStyle = function () {
      var Result = 0;
      Result = this.FFormStyle;
      return Result;
    };
    this.SetFormStyle = function (Value) {
      this.FFormStyle = Value;
    };
    this.GetCanvas = function () {
      var Result = null;
      Result = null;
      return Result;
    };
    this.SetCaption = function (AValue) {
      if (this.FCaption !== AValue) {
        this.FCaption = AValue;
        this.UpdateElement();
      };
    };
    this.SetActiveControl = function (Value) {
      this.FActiveControl = Value;
      if (this.FActiveControl != null) this.FActiveControl.SetFocus();
    };
    this.SetShadow = function (Value) {
      if (this.FShadow !== Value) {
        this.FShadow = Value;
        this.UpdateElement();
      };
    };
    this.SetBorder = function (Value) {
      if (this.FBorder !== Value) {
        this.FBorder = Value;
        if (this.GetContainer() != null) this.AlignControl(this);
      };
    };
    this.SetFormContainer = function (Value) {
      var el = null;
      var old = null;
      var i = 0;
      old = this.GetContainer();
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        this.FFormContainer = Value}
       else {
        if (pas.SysUtils.UpperCase(Value) === "BODY") {
          this.FFormContainer = ""}
         else this.FFormContainer = Value;
      };
      if ((pas.Classes.TComponentStateItem.csLoading in this.FComponentState) && !(pas.Classes.TComponentStateItem.csDesigning in this.FComponentState)) return;
      if (this.FLayer$1 != null) {
        el = this.FLayer$1}
       else if (Value === "") {
        el = document.body;
      } else {
        el = document.getElementById(Value);
        if (!(el != null)) el = document.body;
      };
      if (el != null) {
        this.FContainer = el;
        if (old != null) {
          for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
            i = $l;
            if (this.GetControls(i).FParentElement === old) this.GetControls(i).FParentElement = el;
            if ((this.GetControls(i).GetElementHandle() != null) && (this.GetControls(i).GetElementHandle().parentElement === old)) {
              el.appendChild(this.GetControls(i).GetElementHandle());
            };
          };
        };
      };
    };
    this.GetActiveControl = function () {
      var Result = null;
      var i = 0;
      Result = this.FActiveControl;
      for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.GetControls(i).GetElementHandle() === document.activeElement) {
          Result = this.GetControls(i);
          break;
        };
      };
      return Result;
    };
    this.SetPosition = function (Value) {
      this.FPosition = Value;
    };
    this.ReadPixelsPerInch = function (AReader) {
    };
    this.WritePixelsPerInch = function (AWriter) {
    };
    this.SetWidth = function (AValue) {
      var eh = null;
      if (((pas.Classes.TComponentStateItem.csLoading in this.FComponentState) && (this.FFormContainer !== "")) || (!this.FPopup && !(this.GetElementHandle() != null))) {
        this.SetWidthInt(AValue);
        return;
      };
      pas["WEBLib.Controls"].TControl.SetWidth.apply(this,arguments);
      if (this.FPopup) {
        eh = this.FPopupElement;
        if (eh != null) eh.style.setProperty("width",pas.SysUtils.IntToStr(AValue) + "px");
      };
    };
    this.SetHeight = function (AValue) {
      var eh = null;
      if (((pas.Classes.TComponentStateItem.csLoading in this.FComponentState) && (this.FFormContainer !== "")) || (!this.FPopup && !(this.GetElementHandle() != null))) {
        this.SetHeightInt(AValue);
        if (this.FormContainerElement() != null) {
          if ((pas.SysUtils.UpperCase(this.FormContainerElement().tagName) !== "BODY") && !this.GetIsLinked()) this.FormContainerElement().style.setProperty("height",pas.SysUtils.IntToStr(AValue) + "px");
        };
        return;
      };
      pas["WEBLib.Controls"].TControl.SetHeight.apply(this,arguments);
      if ((this.FFormContainer !== "") && (this.FormContainerElement() != null) && !(pas.SysUtils.UpperCase(this.FormContainerElement().tagName) === "BODY")) {
        this.FormContainerElement().style.setProperty("height",pas.SysUtils.IntToStr(AValue) + "px");
        this.Realign();
      };
      if (this.FPopup) {
        eh = this.FPopupElement;
        if (eh != null) eh.style.setProperty("height",pas.SysUtils.IntToStr(AValue) + "px");
      };
    };
    this.SetClientHeight = function (Value) {
      if (this.FBorder in rtl.createSet($mod.TFormBorderStyle.fbDialog,$mod.TFormBorderStyle.fbDialogSizeable)) {
        this.SetHeight(Value + $mod.Application.FFormCaptionHeight);
      } else pas["WEBLib.Controls"].TControl.SetClientHeight.apply(this,arguments);
    };
    this.GetClientHeight = function () {
      var Result = 0;
      if (this.FBorder in rtl.createSet($mod.TFormBorderStyle.fbDialog,$mod.TFormBorderStyle.fbDialogSizeable)) {
        Result = this.GetHeight();
      } else Result = pas["WEBLib.Controls"].TControl.GetClientHeight.call(this);
      return Result;
    };
    this.HandleHashChange = function (Event) {
      var Result = false;
      var oldURL = "";
      var newURL = "";
      var newHash = "";
      var pc = null;
      var newform = null;
      oldURL = Event.oldURL;
      newURL = Event.newURL;
      if (this.FOnHashChange != null) {
        this.FOnHashChange(this,oldURL,newURL);
      };
      if ($mod.Application.FRouting) {
        newHash = pas.System.Copy(newURL,pas.System.Pos("#",newURL) + 1,newURL.length);
        pc = pas.Classes.GetClass("T" + this.FName);
        if ((pc != null) && ($mod.LastHash !== newHash)) {
          if ((pas.System.Pos("#" + this.FName + "?",oldURL + "?") !== 0) && (pas.System.Pos("#" + this.FName + "?",newURL + "?") === 0)) {
            this.Close();
          };
          if (!this.FPopup) {
            pc = pas.Classes.GetClass("T" + newHash);
            if (pc != null) {
              $mod.Application.AutoCreateForm(pc,{get: function () {
                  return newform;
                }, set: function (v) {
                  newform = v;
                }});
            };
          };
        };
      };
      Result = true;
      return Result;
    };
    this.HandleLoaded = function (Event) {
      var Result = false;
      this.Resize$1();
      this.InitAnchoring();
      Result = true;
      return Result;
    };
    this.HandleDOMContentLoaded = function (Event) {
      var Result = false;
      if (this.FOnDOMContentLoaded != null) this.FOnDOMContentLoaded(this);
      Result = true;
      return Result;
    };
    this.HandleScroll = function (Event) {
      var Result = false;
      if (this.FOnScroll != null) this.FOnScroll(this);
      Result = true;
      return Result;
    };
    this.HandleUnload = function (Event) {
      var Result = false;
      if (this.FOnUnload != null) this.FOnUnload(this);
      Result = true;
      return Result;
    };
    this.HandleBeforeUnload = function (Event) {
      var Result = false;
      var msg = "";
      msg = "";
      if (this.FOnBeforeUnload != null) this.FOnBeforeUnload(this,{get: function () {
          return msg;
        }, set: function (v) {
          msg = v;
        }});
      if (msg !== "") {
        Event.returnValue = msg;
        return msg;
      };
      Result = true;
      return Result;
    };
    this.HandleObserver = function () {
      var Result = false;
      this.Resize$1();
      Result = true;
      return Result;
    };
    this.HandleResize = function (Event) {
      var Result = false;
      if (this.FVisible && !(pas.Classes.TComponentStateItem.csDestroying in this.FComponentState)) {
        if (!(this.GetContainer() != null)) this.CreateControl();
        this.Resize$1();
        if (this.GetElementHandle() === document.body) window.setTimeout(rtl.createSafeCallback(this,"Resize$1"),25);
      };
      if (1 < 0) {
        this.HandleObserver();
      };
      Result = true;
      return Result;
    };
    this.HandleDocMouseMove = function (Event) {
      var Result = false;
      var deltax = 0.0;
      var deltay = 0.0;
      var el = null;
      var l = 0;
      var t = 0;
      if (this.FDown && (this.GetContainer() != null)) {
        deltax = Event.clientX - this.FMdx;
        deltay = Event.clientY - this.FMdy;
        if (this.FHasCaption && (this.FFormFileName !== "")) {
          el = this.GetContainer().parentNode}
         else el = this.GetContainer();
        el.style.setProperty("transform","");
        el.style.setProperty("position","absolute");
        l = Math.round(this.FDlgX + deltax);
        t = Math.round(this.FDlgY + deltay);
        el.style.setProperty("left",pas.SysUtils.IntToStr(l) + "px");
        el.style.setProperty("top",pas.SysUtils.IntToStr(t) + "px");
        this.FLeft = l;
        this.FTop = t;
      };
      Result = true;
      return Result;
    };
    this.HandleDocMouseUp = function (Event) {
      var Result = false;
      if (this.FDown) {
        this.FCaptured$1 = false;
        this.FDown = false;
        document.body.removeEventListener("mousemove",this.FDocMouseMovePtr);
        document.body.removeEventListener("mouseup",this.FDocMouseUpPtr);
        if (this.FMoveSpan != null) document.body.removeChild(this.FMoveSpan);
        this.FEventStopPropagation = rtl.unionSet(this.FEventStopPropagation,rtl.createSet(pas["WEBLib.Controls"].TElementEvent.eeMouseMove,pas["WEBLib.Controls"].TElementEvent.eeMouseUp));
        this.FMoveSpan = null;
      };
      Result = true;
      return Result;
    };
    this.HandleTitleDown = function (Event) {
      var Result = false;
      var r = null;
      Event.stopPropagation();
      Event.preventDefault();
      this.FPopupClose = $mod.TPopupClose.pcNever;
      this.FMdx = Math.round(Event.clientX);
      this.FMdy = Math.round(Event.clientY);
      if (this.FHasCaption && (this.FFormFileName !== "")) {
        r = this.GetContainer().parentNode.getBoundingClientRect()}
       else r = this.GetContainer().getBoundingClientRect();
      this.FDlgX = Math.round(pas.System.Int(r.left));
      this.FDlgY = Math.round(pas.System.Int(r.top));
      this.FDown = true;
      if (!this.FCaptured$1) {
        this.FCaptured$1 = true;
        this.FMoveSpan = document.createElement("SPAN");
        this.FMoveSpan.style.setProperty("top","0");
        this.FMoveSpan.style.setProperty("left","0");
        this.FMoveSpan.style.setProperty("right","0");
        this.FMoveSpan.style.setProperty("bottom","0");
        this.FMoveSpan.style.setProperty("position","absolute");
        document.body.appendChild(this.FMoveSpan);
        this.FEventStopPropagation = rtl.diffSet(this.FEventStopPropagation,rtl.createSet(pas["WEBLib.Controls"].TElementEvent.eeMouseMove,pas["WEBLib.Controls"].TElementEvent.eeMouseUp));
        document.body.addEventListener("mousemove",this.FDocMouseMovePtr);
        document.body.addEventListener("mouseup",this.FDocMouseUpPtr);
      };
      Result = true;
      return Result;
    };
    this.HandleTouchStart = function (Event) {
      var Result = false;
      var r = null;
      if (Event.touches.length === 0) return Result;
      Event.stopPropagation();
      Event.preventDefault();
      this.FPopupClose = $mod.TPopupClose.pcNever;
      this.FMdx = Math.round(Event.touches.item(0).clientX);
      this.FMdy = Math.round(Event.touches.item(0).clientY);
      if (this.FHasCaption && (this.FFormFileName !== "")) {
        r = this.GetContainer().parentNode.getBoundingClientRect()}
       else r = this.GetContainer().getBoundingClientRect();
      this.FDlgX = Math.round(pas.System.Int(r.left));
      this.FDlgY = Math.round(pas.System.Int(r.top));
      this.FDown = true;
      if (!this.FCaptured$1) {
        this.FCaptured$1 = true;
        this.FMoveSpan = document.createElement("SPAN");
        this.FMoveSpan.style.setProperty("top","0");
        this.FMoveSpan.style.setProperty("left","0");
        this.FMoveSpan.style.setProperty("right","0");
        this.FMoveSpan.style.setProperty("bottom","0");
        this.FMoveSpan.style.setProperty("position","absolute");
        document.body.appendChild(this.FMoveSpan);
        this.FEventStopPropagation = rtl.diffSet(this.FEventStopPropagation,rtl.createSet(pas["WEBLib.Controls"].TElementEvent.eeTouchMove,pas["WEBLib.Controls"].TElementEvent.eeTouchEnd));
        document.body.addEventListener("touchmove",this.FDocTouchMovePtr);
        document.body.addEventListener("touchend",this.FDocTouchEndPtr);
      };
      Result = true;
      return Result;
    };
    this.HandleDocTouchMove = function (Event) {
      var Result = false;
      var deltax = 0.0;
      var deltay = 0.0;
      var el = null;
      var l = 0;
      var t = 0;
      if (this.FDown && (this.GetContainer() != null)) {
        if (Event.touches.length === 0) return Result;
        deltax = Event.touches.item(0).clientX - this.FMdx;
        deltay = Event.touches.item(0).clientY - this.FMdy;
        if (this.FHasCaption && (this.FFormFileName !== "")) {
          el = this.GetContainer().parentNode}
         else el = this.GetContainer();
        el.style.setProperty("transform","");
        el.style.setProperty("position","absolute");
        l = Math.round(this.FDlgX + deltax);
        t = Math.round(this.FDlgY + deltay);
        el.style.setProperty("left",pas.SysUtils.IntToStr(l) + "px");
        el.style.setProperty("top",pas.SysUtils.IntToStr(t) + "px");
        this.FLeft = l;
        this.FTop = t;
      };
      Result = true;
      return Result;
    };
    this.HandleDocTouchEnd = function (Event) {
      var Result = false;
      if (this.FDown) {
        this.FCaptured$1 = false;
        this.FDown = false;
        document.body.removeEventListener("touchmove",this.FDocTouchMovePtr);
        document.body.removeEventListener("touchend",this.FDocTouchEndPtr);
        if (this.FMoveSpan != null) document.body.removeChild(this.FMoveSpan);
        this.FEventStopPropagation = rtl.unionSet(this.FEventStopPropagation,rtl.createSet(pas["WEBLib.Controls"].TElementEvent.eeTouchMove,pas["WEBLib.Controls"].TElementEvent.eeTouchEnd));
        this.FMoveSpan = null;
      };
      Result = true;
      return Result;
    };
    this.HandleCloseClick = function (Event) {
      var Result = false;
      var CanClose = false;
      CanClose = true;
      if (this.FOnCloseQuery != null) this.FOnCloseQuery(this,{get: function () {
          return CanClose;
        }, set: function (v) {
          CanClose = v;
        }});
      if (CanClose) this.Close();
      Result = true;
      return Result;
    };
    this.SetLeft = function (AValue) {
      var eh = null;
      pas["WEBLib.Controls"].TControl.SetLeft.apply(this,arguments);
      if (this.FPopup) {
        eh = this.FPopupElement;
        if (eh != null) eh.style.setProperty("left",pas.SysUtils.IntToStr(AValue) + "px");
      };
    };
    this.SetTop = function (AValue) {
      var eh = null;
      pas["WEBLib.Controls"].TControl.SetTop.apply(this,arguments);
      if (this.FPopup) {
        eh = this.FPopupElement;
        if (eh != null) eh.style.setProperty("top",pas.SysUtils.IntToStr(AValue) + "px");
      };
    };
    var cPixelsPerInch = "PixelsPerInch";
    this.DefineProperties = function (AFiler) {
      pas.Classes.TComponent.DefineProperties.call(this,AFiler);
      AFiler.DefineProperty(cPixelsPerInch,rtl.createCallback(this,"ReadPixelsPerInch"),rtl.createCallback(this,"WritePixelsPerInch"),false);
    };
    this.ClearMethodPointers = function () {
      pas["WEBLib.Controls"].TControl.ClearMethodPointers.call(this);
      this.FLoadedPtr = null;
      this.FDOMContentLoadedPtr = null;
      this.FUnloadPtr = null;
      this.FBeforeUnloadPtr = null;
      this.FResizePtr = null;
      this.FScrollPtr = null;
      this.FDocMouseUpPtr = null;
      this.FDocMouseMovePtr = null;
      this.FTitleDownPtr = null;
      this.FDocTouchMovePtr = null;
      this.FDocTouchEndPtr = null;
      this.FTitleTouchStartPtr = null;
      this.FDoClickPtr = null;
      this.FKeyDownPtr$1 = null;
      this.FOrientationChangePtr = null;
      this.FHashChangePtr = null;
    };
    this.GetMethodPointers = function () {
      pas["WEBLib.Controls"].TControl.GetMethodPointers.call(this);
      if (this.FLoadedPtr === null) {
        this.FLoadedPtr = rtl.createCallback(this,"HandleLoaded");
        this.FDOMContentLoadedPtr = rtl.createCallback(this,"HandleDOMContentLoaded");
        this.FUnloadPtr = rtl.createCallback(this,"HandleUnload");
        this.FBeforeUnloadPtr = rtl.createCallback(this,"HandleBeforeUnload");
        this.FResizePtr = rtl.createCallback(this,"HandleResize");
        this.FScrollPtr = rtl.createCallback(this,"HandleScroll");
        this.FDocMouseUpPtr = rtl.createCallback(this,"HandleDocMouseUp");
        this.FDocMouseMovePtr = rtl.createCallback(this,"HandleDocMouseMove");
        this.FTitleDownPtr = rtl.createCallback(this,"HandleTitleDown");
        this.FDoClickPtr = rtl.createCallback(this,"HandleDoClick$1");
        this.FKeyDownPtr$1 = rtl.createCallback(this,"HandleKeyDown");
        this.FOrientationChangePtr = rtl.createCallback(this,"HandleOrientationChange");
        this.FHashChangePtr = rtl.createCallback(this,"HandleHashChange");
        this.FTitleTouchStartPtr = rtl.createCallback(this,"HandleTouchStart");
        this.FDocTouchMovePtr = rtl.createCallback(this,"HandleDocTouchMove");
        this.FDocTouchEndPtr = rtl.createCallback(this,"HandleDocTouchEnd");
      };
    };
    this.VisibleChanged = function () {
      var LIsBody = false;
      pas["WEBLib.Controls"].TControl.VisibleChanged.call(this);
      if (this.FLayer$1 != null) {
        if (this.FVisible) {
          this.FLayer$1.style.setProperty("display","")}
         else this.FLayer$1.style.setProperty("display","none");
      } else {
        LIsBody = pas.SysUtils.LowerCase(this.GetID()) === pas["WEBLib.WebTools"].cBodyTag;
        if ((this.GetContainer() != null) && (this.FFormContainer !== "") && !LIsBody) {
          if (this.FVisible) {
            this.GetContainer().style.setProperty("display","")}
           else this.GetContainer().style.setProperty("display","none");
        };
      };
    };
    this.Resize$1 = function () {
      var i = 0;
      var ch = 0;
      var neww = 0;
      var newh = 0;
      var eh = null;
      var dr = null;
      if (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState) return;
      this.FIsResizing$1 = true;
      if (this.FPopup && (this.FPopupElement != null)) {
        eh = this.FPopupElement;
        dr = eh.getBoundingClientRect();
        neww = Math.round(dr.right - dr.left - 2);
        if (this.FBorder in rtl.createSet($mod.TFormBorderStyle.fbDialog,$mod.TFormBorderStyle.fbDialogSizeable)) {
          ch = this.GetCaptionHeight();
          newh = Math.round(dr.bottom - dr.top - ch - 2);
        } else newh = Math.round(dr.bottom - dr.top - 2);
      } else {
        neww = window.innerWidth;
        newh = window.innerHeight;
      };
      this.UpdateControlSize(neww,newh);
      if (!(pas["WEBLib.Controls"].IsAndroid() && (document.activeElement.tagName === "INPUT"))) this.AlignControl(this);
      this.DoResize();
      this.FIsResizing$1 = false;
      if (!this.IsUpdating()) {
        if ((this.FOrigRect.Left === -1) && (this.FOrigRect.Top === -1)) this.InitAnchoring();
        for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
          i = $l;
          this.GetControls(i).UpdateAnchoring();
        };
      };
    };
    this.CreateControl = function () {
      var s = "";
      if (!this.FVisible && !this.FPopup) return;
      pas["WEBLib.Controls"].TControl.CreateControl.call(this);
      s = "";
      if (typeof CONTAINERID !== "undefined") {
        try {
          s = CONTAINERID;
        }
        catch(e)
        {
        }
      };
      if (s !== "") this.SetFormContainer(s);
      this.UpdateSize();
    };
    this.DoClose = function (CloseAction) {
      if ((this.FModalProc != null) && (CloseAction.get() !== $mod.TCloseAction.caNone)) {
        this.FModalProc(this.FModalResult);
        this.FModalProc = null;
      };
    };
    this.BindEvents = function () {
      var pc = null;
      var hash = "";
      pas["WEBLib.Controls"].TControl.BindEvents.call(this);
      if (document.readyState !== "loading") if (this.FOnDOMContentLoaded != null) this.FOnDOMContentLoaded(this);
      window.addEventListener("resize",this.FResizePtr);
      window.addEventListener("load",this.FLoadedPtr);
      window.addEventListener("DOMContentLoaded",this.FDOMContentLoadedPtr);
      document.addEventListener("scroll",this.FScrollPtr);
      window.addEventListener("unload",this.FUnloadPtr);
      window.addEventListener("beforeunload",this.FBeforeUnloadPtr);
      window.addEventListener("keydown",this.FKeyDownPtr$1);
      window.addEventListener("orientationchange",this.FOrientationChangePtr);
      window.addEventListener("hashchange",this.FHashChangePtr);
      pc = pas.Classes.GetClass(this.$classname);
      if ((pc != null) && !this.FPopup && $mod.Application.FRouting) {
        hash = this.$classname;
        pas.System.Delete({get: function () {
            return hash;
          }, set: function (v) {
            hash = v;
          }},1,1);
        $mod.LastHash = hash;
        window.location.hash = hash;
      };
    };
    this.UnbindEvents = function () {
      pas["WEBLib.Controls"].TControl.UnbindEvents.call(this);
      if ((this.FLayer$1 != null) && (this.FPopupClose === $mod.TPopupClose.pcOnDeactivate)) this.FLayer$1.removeEventListener("click",this.FDoClickPtr);
      if (this.FResizeObserver != null) {
        this.FResizeObserver.disconnect();
      };
      window.removeEventListener("resize",this.FResizePtr);
      window.removeEventListener("load",this.FLoadedPtr);
      window.removeEventListener("DOMContentLoaded",this.FDOMContentLoadedPtr);
      document.removeEventListener("scroll",this.FScrollPtr);
      window.removeEventListener("unload",this.FUnloadPtr);
      window.removeEventListener("beforeunload",this.FBeforeUnloadPtr);
      window.removeEventListener("keydown",this.FKeyDownPtr$1);
      window.removeEventListener("orientationchange",this.FOrientationChangePtr);
      window.removeEventListener("hashchange",this.FHashChangePtr);
    };
    this.DoCreate = function () {
      this.BeginUpdate();
      this.LoadDFMValues();
      this.Loaded();
      if (this.FOnCreate != null) this.FOnCreate(this);
      this.FCreating = false;
      this.EndUpdate();
      this.UpdateChildren(this);
      this.Realign();
      this.DoResize();
    };
    this.Realign = function () {
      var el = null;
      var dr = null;
      var r = pas.Types.TRect.$new();
      if ((this.FFormContainer !== "") && (this.FAlign !== pas["WEBLib.Controls"].TAlign.alNone)) {
        el = document.getElementById(this.FFormContainer);
        if (el != null) {
          dr = el.getBoundingClientRect();
          if ((dr.width === 0) && (dr.height === 0) && (el.style.getPropertyValue("position") === "absolute")) {
            r.$assign(pas["WEBLib.Controls"].GetHTMLElementAbsoluteRect(el));
          } else {
            r.$assign(pas.Types.Rect(Math.round(dr.left),Math.round(dr.top),Math.round(dr.right),Math.round(dr.bottom)));
          };
          this.SetBoundsInt(r.Left,r.Top,r.Right - r.Left,r.Bottom - r.Top);
        };
      };
      pas["WEBLib.Controls"].TControl.Realign.call(this);
    };
    this.DoResize = function () {
      var w = 0;
      var h = 0;
      w = this.GetWidth();
      h = this.GetHeight();
      if ((w === this.FOldWidth) && (h === this.FOldHeight)) return;
      this.FOldWidth = w;
      this.FOldHeight = h;
      if (this.FOnResize != null) this.FOnResize(this);
    };
    this.DoShow = function () {
      this.DoAutoFocus();
      if ((this.FOnShow != null) && !this.FShown) {
        this.FShown = true;
        this.FOnShow(this);
      };
    };
    this.DoAutoFocus = function () {
      var i = 0;
      for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
        i = $l;
        if ((this.GetControls(i).FTabOrder === 0) && this.GetControls(i).FTabStop) {
          this.GetControls(i).SetFocus();
        };
      };
    };
    this.Paint = function () {
    };
    this.HandleDoClick$1 = function (Event) {
      var Result = false;
      Event.stopPropagation();
      if (this.FPopupClose === $mod.TPopupClose.pcOnDeactivate) this.Close();
      Result = true;
      return Result;
    };
    this.HandleKeyDown = function (Event) {
      var Result = false;
      var k = 0;
      k = this.GetKeyCode(Event.key,true);
      if (!pas.System.Assigned(k)) return Result;
      if ((k === 27) && !(pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) && this.FPopup) {
        this.Close();
      };
      Result = true;
      return Result;
    };
    this.HandleOrientationChange = function (Event) {
      var Result = false;
      var so = 0;
      var isPortrait = false;
      this.Resize$1();
      this.Realign();
      Result = true;
      if (this.FOnOrientationChange != null) {
        var mql = window.matchMedia("(orientation: portrait)");
        isPortrait = (mql.matches);
        if (isPortrait) {
          so = $mod.TScreenOrientation.soLandscape}
         else so = $mod.TScreenOrientation.soPortrait;
        this.FOnOrientationChange(this,so);
      };
      if (this.FOnResize != null) this.FOnResize(this);
      return Result;
    };
    this.HandleDoResize = function () {
      var dr = null;
      var neww = 0;
      var newh = 0;
      dr = this.GetContainer().getBoundingClientRect();
      neww = Math.round(dr.right - dr.left);
      newh = Math.round(dr.bottom - dr.top);
      if ((neww !== this.FOrigWidth) || (newh !== this.FOrigHeight)) {
        this.SetWidth(neww);
        this.SetHeight(newh);
        dr = this.GetContainer().getBoundingClientRect();
        this.FOrigWidth = Math.round(dr.right - dr.left);
        this.FOrigHeight = Math.round(dr.bottom - dr.top);
        this.AlignControl(this);
      };
    };
    this.KeyPreview = function (Key, Shift) {
      var i = 0;
      var lt = 0;
      var ft = 0;
      var lti = 0;
      var fti = 0;
      lt = -1;
      ft = 0xFFFF;
      for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (!this.GetControls(i).FVisible && this.GetControls(i).FEnabled) continue;
        if (this.GetControls(i).FTabOrder < ft) {
          ft = this.GetControls(i).FTabOrder;
          fti = i;
        };
        if (this.GetControls(i).FTabOrder > lt) {
          lt = this.GetControls(i).FTabOrder;
          lti = i;
        };
        if ((Key.get() === 13) || (Key.get() === 27)) this.GetControls(i).HandleKeyPreview(Key.get());
      };
      if ($mod.Application.FMainForm === this) return;
      if ((Key.get() === 9) && !(pas.Classes.TShiftState$a.ssShift in Shift) && (lti < this.GetControlsCount()) && (fti >= 0) && (fti !== lti)) {
        if (this.GetControls(lti).Focused()) {
          this.GetControls(fti).SetFocus();
          Key.set(0);
        };
      };
      if ((Key.get() === 9) && (pas.Classes.TShiftState$a.ssShift in Shift) && (fti >= 0) && (lti < this.GetControlsCount()) && (fti !== lti)) {
        if (this.GetControls(fti).Focused()) {
          this.GetControls(lti).SetFocus();
          Key.set(0);
        };
      };
    };
    this.GetWidth = function () {
      var Result = 0;
      var dr = null;
      var el = null;
      if (this.FFormElement !== "") {
        el = document.getElementById(this.FFormElement);
        if (el != null) {
          dr = el.getBoundingClientRect();
          Result = Math.round(dr.right - dr.left);
          return Result;
        };
      };
      if (this.GetElementHandle() === document.body) {
        dr = document.documentElement.getBoundingClientRect();
        Result = Math.round(dr.width);
        if (Result > window.innerWidth) Result = window.innerWidth;
      } else {
        if (this.FPopup) {
          Result = pas["WEBLib.Controls"].TControl.GetWidth.call(this)}
         else {
          Result = Math.round(this.GetElementHandle().offsetWidth);
          if (Result === 0) {
            if (this.FFormContainer !== "") {
              Result = pas["WEBLib.Controls"].TControl.GetWidth.call(this)}
             else Result = window.innerWidth;
          };
        };
      };
      return Result;
    };
    this.GetHeight = function () {
      var Result = 0;
      var d = 0;
      var s = "";
      var css = null;
      var el = null;
      var dr = null;
      if (this.FFormElement !== "") {
        el = document.getElementById(this.FFormElement);
        if (el != null) {
          dr = el.getBoundingClientRect();
          Result = Math.round(dr.bottom - dr.top);
          return Result;
        };
      };
      if (this.GetElementHandle() === document.body) {
        css = window.getComputedStyle(this.GetElementHandle());
        s = css.getPropertyValue("margin-top");
        s = pas.System.Copy(s,1,s.length - 2);
        d = Math.round(pas.SysUtils.StrToFloat$1(s,pas.SysUtils.TFormatSettings.Invariant()) - 2);
        dr = document.documentElement.getBoundingClientRect();
        Result = Math.round(dr.height);
        if (Result > window.innerHeight) Result = window.innerHeight - Math.max(0,d);
      } else {
        if (this.FPopup) {
          Result = pas["WEBLib.Controls"].TControl.GetHeight.call(this);
        } else {
          Result = Math.round(this.GetElementHandle().offsetHeight);
          if (Result === 0) {
            if (this.FFormContainer !== "") {
              Result = pas["WEBLib.Controls"].TControl.GetHeight.call(this)}
             else Result = window.innerHeight;
          };
        };
      };
      return Result;
    };
    this.GetLeft = function () {
      var Result = 0;
      var el = null;
      var dr = null;
      if (this.FPopup) {
        Result = pas["WEBLib.Controls"].TControl.GetLeft.call(this);
      } else {
        if (this.FFormElement !== "") {
          el = document.getElementById(this.FFormElement);
          if (el != null) {
            dr = el.getBoundingClientRect();
            Result = Math.round(dr.left);
          };
        } else {
          el = null;
          if (this.FFormContainer !== "") el = document.getElementById(this.FFormContainer);
          if (!(el != null)) el = this.GetElementHandle();
          Result = Math.round(el.offsetLeft);
        };
      };
      return Result;
    };
    this.GetTop = function () {
      var Result = 0;
      var el = null;
      var dr = null;
      if (this.FPopup) {
        Result = pas["WEBLib.Controls"].TControl.GetTop.call(this)}
       else {
        if (this.FFormElement !== "") {
          el = document.getElementById(this.FFormElement);
          if (el != null) {
            dr = el.getBoundingClientRect();
            Result = Math.round(dr.top);
          };
        } else {
          el = null;
          if (this.FFormContainer !== "") el = document.getElementById(this.FFormContainer);
          if (!(el != null)) el = this.GetElementHandle();
          Result = Math.round(el.offsetTop);
        };
      };
      return Result;
    };
    this.GetClientRect = function () {
      var Result = pas.Types.TRect.$new();
      Result.$assign(pas["WEBLib.Controls"].TControl.GetClientRect.call(this));
      return Result;
    };
    this.CreateElement = function () {
      var Result = null;
      var eh = null;
      var caph = null;
      if (!this.FPopup && (this.FormContainerElement() != null)) {
        Result = this.FormContainerElement();
        return Result;
      };
      Result = document.createElement("DIV");
      this.FLayer$1 = this.CreateLayer();
      document.body.appendChild(this.FLayer$1);
      eh = this.FLayer$1;
      if (this.FPopupClose === $mod.TPopupClose.pcOnDeactivate) {
        this.GetMethodPointers();
        eh.addEventListener("click",this.FDoClickPtr);
      };
      eh.style.setProperty(pas["WEBLib.Controls"].CSSZIndex,$mod.Application.MaxZIndexStr());
      if (this.FBorder === $mod.TFormBorderStyle.fbSizeable) {
        Result.style.setProperty("resize","both");
        Result.style.setProperty("overflow","auto");
      };
      this.FHasCaption = false;
      if (this.FBorder in rtl.createSet($mod.TFormBorderStyle.fbSizeable,$mod.TFormBorderStyle.fbDialog,$mod.TFormBorderStyle.fbDialogSizeable)) {
        caph = this.CreateCaption();
        Result.appendChild(caph);
      };
      return Result;
    };
    this.UpdateElement = function () {
      var clr = "";
      var el = null;
      if (this.FCreating) return;
      pas["WEBLib.Controls"].TControl.UpdateElement.call(this);
      if (this.IsUpdating()) return;
      if ((this.GetElementHandle() != null) || (this.GetContainer() != null)) {
        if (this.FCaption !== "") {
          if (!this.FPopup) {
            window.document.title = this.FCaption}
           else {
            if (this.FCaptionElement != null) {
              el = this.FCaptionElement.childNodes.item(0);
              if (el != null) el.nodeValue = this.FCaption;
              if (this.FShowClose && !(this.FCaptionCloseElement != null)) {
                this.FCaptionCloseElement = document.createElement("SPAN");
                this.FCaptionCloseElement.style.setProperty("float","right");
                this.FCaptionCloseElement.style.setProperty("cursor","default");
                this.FCaptionCloseElement.style.setProperty("margin-right","8px");
                this.FCaptionCloseElement.innerHTML = "&#x2716;";
                this.FCaptionElement.appendChild(this.FCaptionCloseElement);
                this.FCaptionCloseElement.addEventListener("click",rtl.createSafeCallback(this,"HandleCloseClick"));
                this.FCaptionCloseElement.addEventListener("touchstart",rtl.createSafeCallback(this,"HandleCloseClick"));
              };
              pas["WEBLib.Controls"].SetHTMLElementFont(this.FCaptionElement,this.FFont,!((this.FElementCaptionClassName === "") && (this.FElementFont === pas["WEBLib.Controls"].TElementFont.efProperty)));
            };
          };
        };
      };
      if (this.GetContainer() != null) {
        clr = pas["WEBLib.Graphics"].ColorToHTML(this.FColor);
        if (this.GetContainer() != null) {
          if ((this.FColor !== -1) && (this.FColor !== 16777215) && !this.FPopup && (this.FElementClassName === "")) this.GetContainer().style.setProperty(pas["WEBLib.Controls"].CSSBackground,clr);
          if (!this.FPopup && (this.FCSSLibrary !== pas["WEBLib.Controls"].TCSSLibrary.cssNone)) document.body.style.removeProperty(pas["WEBLib.Controls"].CSSBackground);
          if ((this.FElementClassName !== "") || (this.FColor === -1) || ((this.FColor === 16777215) && !this.FPopup)) this.GetContainer().style.removeProperty(pas["WEBLib.Controls"].CSSBackground);
          if ((this.FElementClassName === "") && !this.FPopup) {
            document.documentElement.style.setProperty('height','100%');
          };
          pas["WEBLib.Controls"].SetHTMLElementFont(this.GetContainer(),this.FFont,!((this.FElementClassName === "") && (this.FElementFont === pas["WEBLib.Controls"].TElementFont.efProperty)));
        };
        if (this.FPopup) {
          if (!(this.FPopupElement != null)) this.FPopupElement = this.GetContainer();
          if (this.FElementPopupClassName !== "") {
            this.GetContainer().style.removeProperty("border");
            this.FPopupElement.setAttribute("class",this.FElementPopupClassName);
          } else {
            if (this.FShadow) {
              this.FPopupElement.style.setProperty("box-shadow","3px 3px 3px silver");
            } else {
              this.FPopupElement.style.removeProperty("box-shadow");
            };
            this.FPopupElement.style.setProperty("border","1px solid gray");
          };
          if ((this.FCSSLibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap) && (this.FElementClassName === "")) {
            this.FPopupElement.setAttribute("class","card");
            this.FPopupElement.style.setProperty("display","block");
            this.GetContainer().style.removeProperty("box-shadow");
          };
        } else {
          this.GetContainer().style.removeProperty("box-shadow");
        };
      };
    };
    this.ContainerElement = function () {
      var Result = null;
      Result = this.FormContainerElement();
      return Result;
    };
    this.FormContainerElement = function () {
      var Result = null;
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        if (this.FDesignContainer != null) Result = this.FDesignContainer;
      };
      if (this.FFormContainer !== "") {
        Result = document.getElementById(this.FFormContainer);
        if (!(Result != null)) Result = document.body;
      } else {
        Result = document.body;
      };
      return Result;
    };
    this.GetElementBindHandle = function () {
      var Result = null;
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        Result = window;
        return Result;
      };
      if (this.FFormContainer !== "") {
        Result = window;
      } else {
        if (!this.FPopup) {
          Result = window;
        } else Result = pas["WEBLib.Controls"].TControl.GetElementBindHandle.call(this);
      };
      return Result;
    };
    this.GetElementHandle = function () {
      var Result = null;
      if (this.FPopup) {
        Result = pas["WEBLib.Controls"].TControl.GetElementHandle.call(this);
        if (!(Result != null)) Result = this.FPopupElement;
      } else Result = this.FormContainerElement();
      return Result;
    };
    this.SetElementClassName = function (AValue) {
      pas["WEBLib.Controls"].TControl.SetElementClassName.apply(this,arguments);
      if (this.FPopup && (this.FPopupElement != null)) {
        this.FPopupElement.setAttribute("class",AValue);
      };
    };
    this.CloseQuery = function () {
      var Result = false;
      Result = true;
      if (this.FOnCloseQuery != null) this.FOnCloseQuery(this,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.LoadDFMValues = function () {
    };
    this.Init = function () {
    };
    this.IsFocused = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    this.CreateLayer = function () {
      var Result = null;
      Result = document.createElement("SPAN");
      Result.style.setProperty("top","0");
      Result.style.setProperty("left","0");
      Result.style.setProperty("right","0");
      Result.style.setProperty("bottom","0");
      Result.style.setProperty("webkit-user-select","none");
      Result.style.setProperty("moz-user-select","none");
      Result.style.setProperty("khtml-user-select","none");
      Result.style.setProperty("ms-user-select","none");
      Result.style.setProperty("user-select","none");
      Result.style.setProperty("position","absolute");
      Result.style.setProperty("z-index",$mod.Application.MaxZIndexStr());
      return Result;
    };
    this.CreateCaption = function () {
      var Result = null;
      var BarHeight = "";
      BarHeight = pas.SysUtils.IntToStr($mod.Application.FFormCaptionHeight);
      this.FCaptionElement = document.createElement("DIV");
      this.FCaptionElement.innerHTML = this.FCaption;
      this.FCaptionElement.style.setProperty(pas["WEBLib.Controls"].CSSBackground,pas["WEBLib.Graphics"].ColorToHTML($mod.Application.FThemeColor));
      this.FCaptionElement.style.setProperty("color",pas["WEBLib.Graphics"].ColorToHTML($mod.Application.FThemeTextColor));
      this.FCaptionElement.style.setProperty("cursor","move");
      this.FCaptionElement.style.setProperty("height",BarHeight + "px");
      this.FCaptionElement.style.setProperty("line-height",BarHeight + "px");
      this.FCaptionElement.style.setProperty("border-bottom","1px solid black");
      this.FCaptionElement.style.setProperty("padding-left","4px");
      this.FCaptionElement.style.setProperty("-moz-user-select","none");
      this.FCaptionElement.style.setProperty("-webkit-user-select","none");
      this.FCaptionElement.style.setProperty("-ms-user-select","none");
      this.FCaptionElement.style.setProperty("user-select","none");
      this.FCaptionElement.style.setProperty("-o-user-select","none");
      if (this.FElementCaptionClassName !== "") this.FCaptionElement.setAttribute("class",this.FElementCaptionClassName);
      pas["WEBLib.Controls"].SetHTMLElementFont(this.FCaptionElement,this.FFont,!((this.FElementCaptionClassName === "") && (this.FElementFont === pas["WEBLib.Controls"].TElementFont.efProperty)));
      if (!(this.FTitleDownPtr != null)) this.GetMethodPointers();
      this.FCaptionElement.innerHTML = this.FCaption;
      this.FCaptionElement.addEventListener("mousedown",this.FTitleDownPtr);
      this.FCaptionElement.addEventListener("touchstart",this.FTitleTouchStartPtr);
      this.FHasCaption = true;
      Result = this.FCaptionElement;
      return Result;
    };
    this.GetCaptionHeight = function () {
      var Result = 0;
      var r = null;
      Result = 0;
      if ((this.FCaptionElement != null) && (this.FBorder in rtl.createSet($mod.TFormBorderStyle.fbDialog,$mod.TFormBorderStyle.fbDialogSizeable))) {
        r = this.FCaptionElement.getBoundingClientRect();
        Result = Math.round(r.bottom - r.top);
      };
      return Result;
    };
    this.SetColorScheme = function (AScheme) {
      var s = "";
      if (!$mod.Application.FThemed) return;
      var $tmp = AScheme;
      if ($tmp === $mod.TApplicationColorScheme.csDark) {
        this.SetColor(0x202124);
        s = "label,option,td,table,ul,li {background-color: #202124; color: #BEC1C6;}" + "\r\n" + "body,input,textarea,select,fieldset {background-color: #202124; color: #BEC1C6; border: 1px solid gray;}" + "\r\n" + "input:focus, textarea:focus, select:focus, span:focus { border: 1px solid silver; outline: none !important;}";
        this.AddCSS("appscheme",s);
      } else if ($tmp === $mod.TApplicationColorScheme.csLight) {
        this.SetColor(16777215);
        this.RemoveCSS("appscheme");
      };
    };
    this.SetCSSLibrary = function (ALibrary) {
      this.FCSSLibrary = ALibrary;
      if ((ALibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap) && (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) && !(pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) this.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
    };
    this.SetFormPos = function () {
      if (!(this.GetContainer() != null)) return;
      if (this.FPosition === $mod.TPosition.poScreenCenter) {
        this.FLeft = Math.round(($mod.WinWidth() - this.GetWidth()) / 2) + window.scrollX;
        this.FTop = Math.round(($mod.WinHeight() - this.GetHeight()) / 2) + window.scrollY;
      };
      this.GetContainer().style.setProperty("position","absolute");
      this.GetContainer().style.setProperty("width",pas.SysUtils.IntToStr(this.GetWidth()) + "px");
      this.GetContainer().style.setProperty("height",pas.SysUtils.IntToStr(this.GetHeight()) + "px");
      this.GetContainer().style.setProperty("left",pas.SysUtils.IntToStr(this.GetLeft()) + "px");
      this.GetContainer().style.setProperty("top",pas.SysUtils.IntToStr(this.GetTop()) + "px");
    };
    this.GetHTMLFileName = function (ADirectForm) {
      var Result = "";
      if (ADirectForm) {
        Result = ""}
       else Result = this.$module.$name + $mod.Application.GetFormExtension();
      return Result;
    };
    this.LoadedDone = function () {
      $mod.Application.TriggerNotification();
    };
    this.Loaded = function () {
      var el = null;
      pas["WEBLib.Controls"].TControl.Loaded.call(this);
      if ((this.FFormContainer !== "") && (this.FElementClassName !== "")) {
        el = this.FormContainerElement();
        if (el != null) {
          el.setAttribute("class",this.FElementClassName);
        };
      };
      this.LoadedDone();
    };
    this.ColorChanging = function () {
      pas["WEBLib.Controls"].TControl.ColorChanging.call(this);
      if (this.GetContainer() != null) {
        this.GetContainer().style.setProperty(pas["WEBLib.Controls"].CSSBackground,pas["WEBLib.Graphics"].ColorToHTML(this.FColor));
      };
    };
    this.SetParent = function (AValue) {
      if ((AValue != null) && (this.FLayer$1 != null)) {
        AValue.GetContainer().appendChild(this.FLayer$1);
      } else pas["WEBLib.Controls"].TControl.SetParent.apply(this,arguments);
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TControl.CreateInitialize.call(this);
      this.FAllowTouch = true;
      this.FModalResult = 0;
      this.FFormStyle = $mod.TFormStyle.fsNormal;
      this.FBorder = $mod.TFormBorderStyle.fbSizeable;
      this.FShadow = true;
      this.FShowClose = true;
      this.FDefaultCloseAction = $mod.TCloseAction.caHide;
      this.FTimerID = -1;
      this.FCaptionElement = null;
      this.FColor = 16777215;
      window.addEventListener("load",this.FLoadedPtr);
    };
    this.Create$2 = function (id) {
      this.FNoHTML = false;
      this.FCreating = true;
      this.FFormContainer = id;
      if (id === "") {
        pas["WEBLib.Controls"].TControl.Create$2.call(this,pas["WEBLib.WebTools"].cBodyTag)}
       else pas["WEBLib.Controls"].TControl.Create$2.call(this,id);
      this.FFormElement = "";
      this.FModalResult = 0;
      this.FFormStyle = $mod.TFormStyle.fsNormal;
      this.FDefaultCloseAction = $mod.TCloseAction.caHide;
      this.DoCreate();
      return this;
    };
    this.Create$5 = function (id, AReference) {
      this.FCreating = true;
      this.FFormContainer = id;
      pas["WEBLib.Controls"].TControl.Create$2.call(this,id);
      AReference.set(this);
      this.FFormElement = "";
      this.FModalResult = 0;
      this.FFormStyle = $mod.TFormStyle.fsNormal;
      this.FDefaultCloseAction = $mod.TCloseAction.caHide;
      this.DoCreate();
      return this;
    };
    this.Create$1 = function (AOwner) {
      this.FNoHTML = false;
      this.FCreating = true;
      this.FResizeObserver = null;
      pas["WEBLib.Controls"].TControl.Create$1.apply(this,arguments);
      this.FBorder = $mod.TFormBorderStyle.fbSingle;
      this.FFormFileName = "";
      this.FPopupMode = $mod.TPopupMode.pmNone;
      this.FPopupClose = $mod.TPopupClose.pcOnDeactivate;
      this.FPopup = true;
      this.FPosition = $mod.TPosition.poScreenCenter;
      this.FPopupOpacity = 1.0;
      this.FCreated = true;
      return this;
    };
    this.Create$7 = function (AOwner, IsPopup, ABorder, ATitle) {
      this.FNoHTML = false;
      this.FCreating = true;
      this.FResizeObserver = null;
      pas["WEBLib.Controls"].TControl.Create$1.call(this,AOwner);
      this.FBorder = ABorder;
      this.FCaption = ATitle;
      this.FFormFileName = "";
      this.FPopupMode = $mod.TPopupMode.pmNone;
      this.FPopupClose = $mod.TPopupClose.pcOnDeactivate;
      this.FPopup = IsPopup;
      this.FPosition = $mod.TPosition.poScreenCenter;
      this.FPopupOpacity = 1.0;
      return this;
    };
    this.CreateNew = function (AOwner, Dummy) {
      this.Create$1(AOwner);
      return this;
    };
    this.CreateNew$1 = function (AFileName) {
      this.FCreating = true;
      pas["WEBLib.Controls"].TControl.Create$2.call(this,pas["WEBLib.WebTools"].cBodyTag);
      this.FFormFileName = AFileName;
      if (this.FFormFileName !== "") $mod.Application.LoadForm(this,AFileName);
      return this;
    };
    this.CreateNew$2 = function () {
      var AFileName = "";
      this.FCreating = true;
      AFileName = this.$class.GetHTMLFileName(false);
      pas["WEBLib.Controls"].TControl.Create$2.call(this,pas["WEBLib.WebTools"].cBodyTag);
      this.FFormFileName = AFileName;
      if (this.FFormFileName !== "") $mod.Application.LoadForm(this,AFileName);
      return this;
    };
    this.CreateNew$3 = function (AProc) {
      this.FCreatedProc = AProc;
      this.CreateNew$2();
      return this;
    };
    this.CreateNew$4 = function (AElementID, AProc) {
      this.CreateNew$5(AElementID,"",AProc);
      return this;
    };
    this.CreateNew$5 = function (AElementID, AFileName, AProc) {
      this.FCreating = true;
      this.FFormContainer = AElementID;
      pas["WEBLib.Controls"].TControl.Create$2.call(this,AElementID);
      this.FCreatedProc = AProc;
      this.FFormElement = AElementID;
      if (AFileName === "") AFileName = this.$class.GetHTMLFileName(false);
      if (AFileName !== "") {
        $mod.Application.LoadForm(this,AFileName)}
       else if (this.FCreatedProc != null) this.FCreatedProc(this);
      return this;
    };
    this.CreateNewDirect = function (AElementID, AProc) {
      this.FCreating = true;
      this.FFormContainer = AElementID;
      pas["WEBLib.Controls"].TControl.Create$2.call(this,AElementID);
      this.FCreatedProc = AProc;
      this.FFormElement = AElementID;
      this.Init();
      this.LoadDFMValues();
      if (this.FCreatedProc != null) this.FCreatedProc(this);
      return this;
    };
    this.CreateDialog = function (ACaption) {
      var AFileName = "";
      this.FCreating = true;
      AFileName = this.$class.GetHTMLFileName(false);
      pas["WEBLib.Controls"].TControl.Create$2.call(this,pas["WEBLib.WebTools"].cBodyTag);
      this.SetCaption(ACaption);
      this.FPopup = true;
      this.SetBorder($mod.TFormBorderStyle.fbDialog);
      this.FFormFileName = AFileName;
      $mod.Application.LoadForm(this,AFileName);
      return this;
    };
    this.CreateDialogNew = function (ACaption) {
      var AFileName = "";
      this.FNoHTML = true;
      this.FCreating = true;
      AFileName = this.$class.GetHTMLFileName(false);
      pas["WEBLib.Controls"].TControl.Create$2.call(this,pas["WEBLib.WebTools"].cBodyTag);
      this.SetCaption(ACaption);
      this.FPopup = true;
      this.SetPosition($mod.TPosition.poScreenCenter);
      this.SetBorder($mod.TFormBorderStyle.fbDialog);
      this.FFormFileName = AFileName;
      return this;
    };
    this.Load = function () {
      var $Self = this;
      var Result = null;
      this.FShown = false;
      this.FFormFileName = this.$class.GetHTMLFileName(this.FDirectForm);
      this.Loading();
      if (this.FFormFileName === "") {
        this.Init();
        this.LoadDFMValues();
        Result = new Promise(function (ASuccess, AFailed) {
          ASuccess($Self);
        });
      } else {
        Result = new Promise(function (ASuccess, AFailed) {
          $mod.Application.LoadForm$1($Self,$Self.FFormFileName,function (AForm) {
            ASuccess(AForm);
          });
        });
      };
      return Result;
    };
    this.Execute = function () {
      var $Self = this;
      var Result = null;
      Result = new Promise(function (ASuccess, AFailed) {
        $Self.ShowModal$1(function (AValue) {
          ASuccess(AValue);
        });
      });
      return Result;
    };
    this.LoadAndExecute = function () {
      var $Self = this;
      var Result = null;
      async function LoadAsync() {
        var Result = false;
        Result = await $Self.Load();
        return Result;
      };
      LoadAsync();
      Result = new Promise(function (ASuccess, AFailed) {
        $Self.ShowModal$1(function (AValue) {
          ASuccess(AValue);
        });
      });
      return Result;
    };
    this.Destroy = function () {
      if (this.FVisible) this.Close();
      if (this.FOnDestroy != null) this.FOnDestroy(this);
      pas["WEBLib.Controls"].TControl.Destroy.call(this);
      if (this.FLayer$1 != null) {
        if (this.FormContainerElement() === this.FLayer$1.parentNode) this.FormContainerElement().removeChild(this.FLayer$1);
        this.FLayer$1 = null;
      };
    };
    this.Close = function () {
      var lAction = 0;
      var el = null;
      if (this.CloseQuery()) {
        this.UnbindEvents();
        lAction = this.FDefaultCloseAction;
        if (this.FTimerID !== -1) {
          window.clearInterval(this.FTimerID);
          this.FTimerID = -1;
        };
        if (this.FOnClose != null) this.FOnClose(this,{get: function () {
            return lAction;
          }, set: function (v) {
            lAction = v;
          }});
        if (lAction !== $mod.TCloseAction.caNone) {
          if (this.FLayer$1 != null) {
            if (this.GetContainer().parentNode === this.FLayer$1) {
              this.FLayer$1.removeChild(this.GetContainer());
            } else {
              if (this.GetContainer().parentNode.parentNode === this.FLayer$1) this.FLayer$1.removeChild(this.GetContainer().parentNode);
            };
            this.FContainer = null;
            if (this.FormContainerElement() === this.FLayer$1.parentNode) {
              this.FormContainerElement().removeChild(this.FLayer$1);
              $mod.Application.ChangeMaxZIndex(-1);
            };
            this.FLayer$1 = null;
          };
          if (this.FFormFileName === "") {
            if ((this.FFormElement !== "") && (this.GetContainer() != null)) {
              this.GetContainer().innerHTML = "";
              this.FContainer = null;
            } else if (this.GetContainer() != null) {
              if (this.FormContainerElement() === this.GetContainer().parentNode) this.FormContainerElement().removeChild(this.GetContainer());
              this.FContainer = null;
            };
          } else {
            if (this.FFormElement !== "") {
              this.GetContainer().innerHTML = "";
              this.FContainer = null;
            };
          };
          if ((this.FFormElement !== this.FFormContainer) && (this.FFormElement !== "")) {
            el = document.getElementById(this.FFormElement);
            if (el != null) el.innerHTML = "";
          };
          this.DoClose({get: function () {
              return lAction;
            }, set: function (v) {
              lAction = v;
            }});
          if ((lAction === $mod.TCloseAction.caFree) && !(pas.Classes.TComponentStateItem.csDestroying in this.FComponentState)) {
            this.SetVisible(false);
            $impl.ReleaseForm(this);
            if ($mod.Application.FMainForm === this) $mod.Application.FMainForm = null;
          };
          $mod.Application.FActiveForm = this.FPrevActiveForm;
          this.FShown = false;
          this.SetVisible(false);
        };
      };
    };
    this.GetUniqueComponentName = function (AComponent) {
      var Result = "";
      var s = "";
      var i = 0;
      var j = 0;
      var found = false;
      i = 1;
      do {
        found = false;
        s = pas.System.Copy(this.$classname,2,this.$classname.length) + "_" + pas.System.Copy(AComponent.$classname,2,AComponent.$classname.length) + pas.SysUtils.IntToStr(i);
        i += 1;
        for (var $l = 0, $end = this.GetComponentCount() - 1; $l <= $end; $l++) {
          j = $l;
          if (this.GetComponent(j).FName === s) {
            found = true;
            break;
          };
        };
      } while (!(found === false));
      Result = s;
      return Result;
    };
    this.IsMiletus = function () {
      var Result = false;
      var cl = null;
      cl = this.$class.ClassType();
      Result = false;
      do {
        cl = cl.$ancestor;
        if ((cl != null) && (cl.$classname === "TMiletusForm")) {
          Result = true;
          break;
        };
      } while (!(!(cl != null) || (cl.$classname === "TForm")));
      return Result;
    };
    this.PreventDefault$1 = function () {
      this.GetElementEvent().preventDefault();
    };
    this.SetBounds = function (X, Y, AWidth, AHeight) {
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        this.Resize$1();
        this.SetBoundsInt(X,Y,AWidth,AHeight);
      } else pas["WEBLib.Controls"].TControl.SetBounds.call(this,X,Y,AWidth,AHeight);
    };
    this.SelectFirst = function () {
      if (this.GetControlsCount() > 0) this.GetControls(0).SetFocus();
    };
    this.SelectNext = function (CurControl, GoForward, CheckTabStop) {
      var i = 0;
      if (this.GetControlsCount() > 0) {
        for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
          i = $l;
          if (this.GetControls(i) === CurControl) {
            if (GoForward) {
              if ((i + 1) <= (this.GetControlsCount() - 1)) {
                this.GetControls(i + 1).SetFocus()}
               else this.GetControls(0).SetFocus();
            } else {
              if ((i - 1) >= 0) {
                this.GetControls(i - 1).SetFocus()}
               else this.GetControls(this.GetControlsCount() - 1).SetFocus();
            };
            break;
          };
        };
      };
    };
    this.Show$1 = function () {
      var dr = null;
      var el = null;
      if (this.FCreating && this.FPopup) {
        $mod.Application.ChangeMaxZIndex(+1);
        this.FCreating = false;
        this.UpdateElement();
      };
      if (this.FFormFileName === "") {
        if (!(this.GetContainer() != null)) {
          if (this.FPopup) {
            this.FContainer = this.CreateElement();
            this.FPopupElement = this.GetContainer();
            this.SetFormPos();
            this.UpdateElement();
            this.FLayer$1.appendChild(this.GetContainer());
          } else {
            this.FContainer = this.CreateLayer();
            this.GetContainer().style.setProperty(pas["WEBLib.Controls"].CSSBackground,pas["WEBLib.Graphics"].ColorToHTML(this.FColor));
            document.body.appendChild(this.GetContainer());
          };
        } else {
          if ((this.FElementClassName !== "") && this.FDirectForm) {
            el = document.createElement("DIV");
            el.setAttribute("class",this.FElementClassName);
            el.appendChild(this.GetContainer());
            this.FContainer = el;
          };
          if (this.FPopup) {
            this.SetFormPos();
            this.FLayer$1.appendChild(this.GetContainer());
          } else {
            if (this.FLayer$1 != null) {
              this.FLayer$1.appendChild(this.GetContainer());
            } else {
              document.body.appendChild(this.GetContainer());
            };
          };
        };
        if (this.FPopup) {
          if (this.FPopupOpacity < 1) {
            this.FLayer$1.style.setProperty(pas["WEBLib.Controls"].CSSBackground,"rgb(0,0,0," + pas["WEBLib.WebTools"].DoubleToHTML(this.FPopupOpacity) + ")");
          };
          if (this.FBorder === $mod.TFormBorderStyle.fbSizeable) {
            dr = this.GetContainer().getBoundingClientRect();
            this.FOrigWidth = Math.round(dr.right - dr.left);
            this.FOrigHeight = Math.round(dr.bottom - dr.top);
            this.FTimerID = window.setInterval(rtl.createSafeCallback(this,"HandleDoResize"),100);
          } else {
            this.GetContainer().style.setProperty("resize","");
            this.GetContainer().style.setProperty("overflow","");
          };
        };
      };
      this.SetVisible(true);
      this.DoShow();
    };
    this.ShowModal = function () {
      var Result = 0;
      Result = this.ShowModal$1(null);
      return Result;
    };
    this.ShowModal$1 = function (AProc) {
      var Result = 0;
      if (this.FNoHTML || (this.FFormFileName === "")) {
        this.FPrevActiveForm = $mod.Application.FActiveForm;
        $mod.Application.FActiveForm = this;
        if (!this.FCreated) $mod.Application.CreateNewForm(this,"");
      };
      Result = 0;
      this.FNoHTML = false;
      this.FModalProc = AProc;
      this.SetModalResult(0);
      this.Show$1();
      return Result;
    };
    this.AddCSS = function (id, css) {
      function writeStylesOnce(styleName, cssText) {
          var styleElement = document.getElementById(styleName);
          if (styleElement) {
               styleElement.innerHTML = cssText;
            return;
            }
          styleElement = document.createElement('style');
          styleElement.type = 'text/css';
          styleElement.id = styleName;
          styleElement.innerHTML = cssText;
          document.getElementsByTagName('head')[0].appendChild(styleElement);
      }
      writeStylesOnce(id,css);
    };
    this.RemoveCSS = function (id) {
      var el = null;
      el = document.getElementById(id);
      if (el != null) document.head.removeChild(el);
    };
    this.UpdateCSS = function (id, css) {
      this.RemoveCSS(id);
      this.AddCSS(id,css);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.$rtti.$Class("TForm");
  this.$rtti.$ClassRef("TFormClass",{instancetype: this.$rtti["TForm"]});
  rtl.createClass(this,"TForm",this.TCustomForm,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("Caption",2,rtl.string,"FCaption","SetCaption");
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor");
    $r.addProperty("CSSLibrary",2,pas["WEBLib.Controls"].$rtti["TCSSLibrary"],"FCSSLibrary","SetCSSLibrary",4,{Default: pas["WEBLib.Controls"].TCSSLibrary.cssNone});
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("FormContainer",2,pas["WEBLib.Controls"].$rtti["TElementID"],"FFormContainer","SetFormContainer");
    $r.addProperty("FormStyle",3,$mod.$rtti["TFormStyle"],"GetFormStyle","SetFormStyle");
    $r.addProperty("Menu",0,pas["WEBLib.Controls"].$rtti["TCustomControl"],"FMenu","FMenu");
    $r.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",4,{Default: true});
    $r.addProperty("Shadow",2,rtl.boolean,"FShadow","SetShadow",4,{Default: true});
    $r.addProperty("ShowClose",0,rtl.boolean,"FShowClose","FShowClose",4,{Default: true});
    $r.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder");
    $r.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",4,{Default: true});
    $r.addProperty("OnBeforeUnload",0,$mod.$rtti["TBeforeUnloadEvent"],"FOnBeforeUnload","FOnBeforeUnload");
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnClose",0,$mod.$rtti["TCloseEvent"],"FOnClose","FOnClose");
    $r.addProperty("OnCloseQuery",0,$mod.$rtti["TCloseQueryEvent"],"FOnCloseQuery","FOnCloseQuery");
    $r.addProperty("OnCreate",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnCreate","FOnCreate");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnDeactivate",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDeactivate","FOnDeactivate");
    $r.addProperty("OnDestroy",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDestroy","FOnDestroy");
    $r.addProperty("OnDOMContentLoaded",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDOMContentLoaded","FOnDOMContentLoaded");
    $r.addProperty("OnHashChange",0,$mod.$rtti["THashChangeEvent"],"FOnHashChange","FOnHashChange");
    $r.addProperty("OnResize",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnResize","FOnResize");
    $r.addProperty("OnShow",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnShow","FOnShow");
    $r.addProperty("OnScroll",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnScroll","FOnScroll");
    $r.addProperty("OnOrientationChange",0,$mod.$rtti["TOrientationChangeEvent"],"FOnOrientationChange","FOnOrientationChange");
    $r.addProperty("OnPaint",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnPaint","FOnPaint");
    $r.addProperty("OnTouchStart",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchStart","FOnTouchStart");
    $r.addProperty("OnTouchMove",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchMove","FOnTouchMove");
    $r.addProperty("OnTouchEnd",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchEnd","FOnTouchEnd");
    $r.addProperty("OnUnload",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnUnload","FOnUnload");
  });
  this.$rtti.$ClassRef("TWebFormClass",{instancetype: this.$rtti["TForm"]});
  rtl.createClass(this,"TCustomFrame",pas["WEBLib.Controls"].TCustomHTMLDiv,function () {
    this.$init = function () {
      pas["WEBLib.Controls"].TCustomHTMLDiv.$init.call(this);
      this.FAutoScroll = false;
      this.FAutoSize = false;
      this.FBiDiMode$1 = 0;
      this.FConstraints = null;
      this.FCtl3D$1 = false;
      this.FDockSite = false;
      this.FDragCursor = 0;
      this.FDragKind = 0;
      this.FDragMode$1 = 0;
      this.FOnAlignInsertBefore = null;
      this.FOnAlignPosition = null;
      this.FOnCanResize = null;
      this.FOnConstrainedResize = null;
      this.FOnContextPopup = null;
      this.FOnDockDrop = null;
      this.FOnDockOver = null;
      this.FOnEndDock = null;
      this.FOnGesture = null;
      this.FOnGetSiteInfo = null;
      this.FOnMouseActivate = null;
      this.FOnMouseWheelDown$1 = null;
      this.FOnMouseWheelUp$1 = null;
      this.FOnStartDock = null;
      this.FOnUnDock = null;
      this.FPadding = null;
      this.FParentBackground = false;
      this.FParentCtl3D$1 = false;
      this.FPopupMenu = null;
      this.FStyleElements = {};
    };
    this.$final = function () {
      this.FConstraints = undefined;
      this.FOnAlignInsertBefore = undefined;
      this.FOnAlignPosition = undefined;
      this.FOnCanResize = undefined;
      this.FOnConstrainedResize = undefined;
      this.FOnContextPopup = undefined;
      this.FOnDockDrop = undefined;
      this.FOnDockOver = undefined;
      this.FOnEndDock = undefined;
      this.FOnGesture = undefined;
      this.FOnGetSiteInfo = undefined;
      this.FOnMouseActivate = undefined;
      this.FOnMouseWheelDown$1 = undefined;
      this.FOnMouseWheelUp$1 = undefined;
      this.FOnStartDock = undefined;
      this.FOnUnDock = undefined;
      this.FPadding = undefined;
      this.FPopupMenu = undefined;
      this.FStyleElements = undefined;
      pas["WEBLib.Controls"].TCustomHTMLDiv.$final.call(this);
    };
    var cMethodGet = "GET";
    var cTypeLoad = "load";
    var cHeaderCacheControl = "Cache-Control";
    var cValueNoCache = "no-cache";
    this.LoadHTMLFile = function (AId) {
      var $Self = this;
      var lFileName = "";
      var lRequest = null;
      function DoStatusCreate(AEvent) {
        var Result = false;
        var lElement = null;
        var lResponse = "";
        if (AEvent === null) return false;
        lResponse = AEvent.target.responseText;
        lElement = document.getElementById(AId);
        lElement.innerHTML = lResponse;
        Result = true;
        return Result;
      };
      lFileName = this.$class.GetHTMLFileName();
      if (lFileName !== "") {
        lRequest = new XMLHttpRequest();
        lRequest.addEventListener(cTypeLoad,rtl.createSafeCallback(null,DoStatusCreate));
        lRequest.open(cMethodGet,lFileName);
        lRequest.setRequestHeader(cHeaderCacheControl,cValueNoCache);
        lRequest.send();
      };
    };
    this.SetConstraints = function (AValue) {
      this.FConstraints.Assign(AValue);
    };
    this.SetPopupMenu = function (AValue) {
      this.FPopupMenu = AValue;
    };
    this.SetPadding = function (AValue) {
      this.FPadding.Assign(AValue);
    };
    this.GetHTMLFileName = function () {
      var Result = "";
      Result = this.$module.$name + $mod.Application.GetFormExtension();
      return Result;
    };
    this.LoadDFMValues = function () {
    };
    this.UpdateElement = function () {
      var nocolor = false;
      pas["WEBLib.Controls"].TControl.UpdateElement.call(this);
      nocolor = this.FColor in rtl.createSet(15790320,-1,16777215,16711422);
      if ((this.GetElementHandle() != null) && !this.IsUpdating() && (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) && nocolor) {
        this.GetElementHandle().style.setProperty("background-color",pas["WEBLib.Graphics"].ColorToHTML(0xF0F0F0));
      };
    };
    this.Create$2 = function (AId) {
      pas["WEBLib.Controls"].TControl.Create$2.call(this,AId);
      this.FPadding = pas["WEBLib.Controls"].TPadding.$create("Create$1");
      this.LoadHTMLFile(AId);
      return this;
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.Controls"].TControl.Create$1.call(this,AOwner);
      this.FPadding = pas["WEBLib.Controls"].TPadding.$create("Create$1");
      this.FConstraints = $mod.TSizeConstraints.$create("Create$1",[this]);
      return this;
    };
    this.CreateNew = function (AOwner) {
      this.Create$1(AOwner);
      this.BeforeLoadDFMValues();
      try {
        this.LoadFromForm();
      } finally {
        this.AfterLoadDFMValues();
      };
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FConstraints");
      rtl.free(this,"FPadding");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.LoadFromForm = function () {
      this.LoadDFMValues();
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.$rtti.$Class("TFrame");
  this.$rtti.$ClassRef("TFrameClass",{instancetype: this.$rtti["TFrame"]});
  rtl.createClass(this,"TFrame",this.TCustomFrame,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("AutoScroll",0,rtl.boolean,"FAutoScroll","FAutoScroll",4,{Default: false});
    $r.addProperty("AutoSize",0,rtl.boolean,"FAutoSize","FAutoSize",4,{Default: false});
    $r.addProperty("BiDiMode",4,pas["WEBLib.Controls"].$rtti["TBiDiMode"],"FBiDiMode$1","FBiDiMode$1");
    $r.addProperty("Constraints",2,$mod.$rtti["TSizeConstraints"],"FConstraints","SetConstraints");
    $r.addProperty("DockSite",0,rtl.boolean,"FDockSite","FDockSite",4,{Default: false});
    $r.addProperty("DoubleBuffered",0,rtl.boolean,"FDoubleBuffered","FDoubleBuffered",4,{Default: false});
    $r.addProperty("DragCursor",0,pas["WEBLib.Controls"].$rtti["TCursor"],"FDragCursor","FDragCursor",4,{Default: 12});
    $r.addProperty("DragKind",0,pas["WEBLib.Controls"].$rtti["TDragKind"],"FDragKind","FDragKind",4,{Default: pas["WEBLib.Controls"].TDragKind.dkDrag});
    $r.addProperty("DragMode",0,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode$1","FDragMode$1",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor");
    $r.addProperty("Ctl3D",4,rtl.boolean,"FCtl3D$1","FCtl3D$1");
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("Padding",2,pas["WEBLib.Controls"].$rtti["TPadding"],"FPadding","SetPadding");
    $r.addProperty("ParentBackground",0,rtl.boolean,"FParentBackground","FParentBackground",4,{Default: true});
    $r.addProperty("ParentBiDiMode",0,rtl.boolean,"FParentBiDiMode","FParentBiDiMode",4,{Default: true});
    $r.addProperty("ParentColor",2,rtl.boolean,"FParentColor","SetParentColor",4,{Default: false});
    $r.addProperty("ParentCtl3D",0,rtl.boolean,"FParentCtl3D$1","FParentCtl3D$1",4,{Default: true});
    $r.addProperty("ParentDoubleBuffered",0,rtl.boolean,"FParentDoubleBuffered","FParentDoubleBuffered",4,{Default: true});
    $r.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",4,{Default: true});
    $r.addProperty("ParentShowHint",0,rtl.boolean,"FParentShowHint","FParentShowHint");
    $r.addProperty("PopupMenu",2,pas["WEBLib.Menus"].$rtti["TPopupMenu"],"FPopupMenu","SetPopupMenu");
    $r.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",4,{Default: false});
    $r.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder");
    $r.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",4,{Default: true});
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("OnAlignInsertBefore",0,$mod.$rtti["TAlignInsertBeforeEvent"],"FOnAlignInsertBefore","FOnAlignInsertBefore");
    $r.addProperty("OnAlignPosition",0,$mod.$rtti["TAlignPositionEvent"],"FOnAlignPosition","FOnAlignPosition");
    $r.addProperty("OnCanResize",0,$mod.$rtti["TCanResizeEvent"],"FOnCanResize","FOnCanResize");
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnConstrainedResize",0,$mod.$rtti["TConstrainedResizeEvent"],"FOnConstrainedResize","FOnConstrainedResize");
    $r.addProperty("OnContextPopup",0,$mod.$rtti["TContextPopupEvent"],"FOnContextPopup","FOnContextPopup");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnDockDrop",0,$mod.$rtti["TDockDropEvent"],"FOnDockDrop","FOnDockDrop");
    $r.addProperty("OnDockOver",0,$mod.$rtti["TDockOverEvent"],"FOnDockOver","FOnDockOver");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDock",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FOnEndDock","FOnEndDock");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnEnter","FOnEnter");
    $r.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnExit","FOnExit");
    $r.addProperty("OnGesture",0,$mod.$rtti["TGestureEvent"],"FOnGesture","FOnGesture");
    $r.addProperty("OnGetSiteInfo",0,$mod.$rtti["TGetSiteInfoEvent"],"FOnGetSiteInfo","FOnGetSiteInfo");
    $r.addProperty("OnMouseActivate",0,$mod.$rtti["TMouseActivateEvent"],"FOnMouseActivate","FOnMouseActivate");
    $r.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseDown","FOnMouseDown");
    $r.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseEnter","FOnMouseEnter");
    $r.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseLeave","FOnMouseLeave");
    $r.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti["TMouseMoveEvent"],"FOnMouseMove","FOnMouseMove");
    $r.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseUp","FOnMouseUp");
    $r.addProperty("OnMouseWheel",0,pas["WEBLib.Controls"].$rtti["TMouseWheelEvent"],"FOnMouseWheel","FOnMouseWheel");
    $r.addProperty("OnMouseWheelDown",0,$mod.$rtti["TMouseWheelUpDownEvent"],"FOnMouseWheelDown$1","FOnMouseWheelDown$1");
    $r.addProperty("OnMouseWheelUp",0,$mod.$rtti["TMouseWheelUpDownEvent"],"FOnMouseWheelUp$1","FOnMouseWheelUp$1");
    $r.addProperty("OnResize",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnResize","FOnResize");
    $r.addProperty("OnStartDock",0,$mod.$rtti["TStartDockEvent"],"FOnStartDock","FOnStartDock");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
    $r.addProperty("OnUnDock",0,$mod.$rtti["TUnDockEvent"],"FOnUnDock","FOnUnDock");
  });
  rtl.recNewT(this,"TApplicationError",function () {
    this.AMessage = "";
    this.AFile = "";
    this.ALineNumber = 0;
    this.AColNumber = 0;
    this.AStack = "";
    this.AError = null;
    this.$eq = function (b) {
      return (this.AMessage === b.AMessage) && (this.AFile === b.AFile) && (this.ALineNumber === b.ALineNumber) && (this.AColNumber === b.AColNumber) && (this.AStack === b.AStack) && (this.AError === b.AError);
    };
    this.$assign = function (s) {
      this.AMessage = s.AMessage;
      this.AFile = s.AFile;
      this.ALineNumber = s.ALineNumber;
      this.AColNumber = s.AColNumber;
      this.AStack = s.AStack;
      this.AError = s.AError;
      return this;
    };
    var $r = $mod.$rtti.$Record("TApplicationError",{},this);
    $r.addField("AMessage",rtl.string);
    $r.addField("AFile",rtl.string);
    $r.addField("ALineNumber",rtl.longint);
    $r.addField("AColNumber",rtl.longint);
    $r.addField("AStack",rtl.string);
    $r.addField("AError",pas.JS.$rtti["TJSObject"]);
  });
  this.THintPosition = {"0": "hpLeft", hpLeft: 0, "1": "hpTop", hpTop: 1, "2": "hpRight", hpRight: 2, "3": "hpBottom", hpBottom: 3};
  this.$rtti.$Enum("THintPosition",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.THintPosition});
  this.TOnlineStatus = {"0": "osOnline", osOnline: 0, "1": "osOffline", osOffline: 1};
  this.$rtti.$Enum("TOnlineStatus",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TOnlineStatus});
  this.$rtti.$MethodVar("TApplicationErrorEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AError",this.$rtti["TApplicationError"]],["Handled",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TApplicationHashChangeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AHash",rtl.string],["Handled",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TApplicationOnlineChangeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AStatus",this.$rtti["TOnlineStatus"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TApplicationActiveChangeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Active",rtl.boolean]]), methodkind: 0});
  this.$rtti.$MethodVar("TApplicationCallBackEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AQuery",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TApplicationExceptionEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["E",pas.SysUtils.$rtti["Exception"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TApplicationPopStateEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["State",rtl.jsvalue]]), methodkind: 0});
  this.$rtti.$MethodVar("TApplicationAutoCreateFormEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AInstanceClass",this.$rtti["TFormClass"]],["AReference",null,1]]), methodkind: 0});
  rtl.createClass(this,"TApplication",pas["WEBLib.Controls"].TControl,function () {
    this.$init = function () {
      pas["WEBLib.Controls"].TControl.$init.call(this);
      this.FAppContainer = "";
      this.FMainFormOnTaskBar = false;
      this.FCanCreateForm = false;
      this.FAppInitializing = false;
      this.FLastReq = null;
      this.FFormCaptionHeight = 0;
      this.FActiveForm = null;
      this.FMainForm = null;
      this.FLoadForm = null;
      this.FInitFormClassName = "";
      this.FFormStack = null;
      this.FParameters = null;
      this.FIsRedirect = false;
      this.FLanguage = 0;
      this.FOnImageCacheReady = null;
      this.FOnError = null;
      this.FOnHashChange = null;
      this.FAutoFormRoute = false;
      this.FErrorType = 0;
      this.FClientConnector = null;
      this.FOnOnlineChange = null;
      this.FOnActivate = null;
      this.FThemeTextColor = 0;
      this.FThemeColor = 0;
      this.FThemed = false;
      this.FThemeButtonClassName = "";
      this.FOnOAuthToken = null;
      this.FOnOAuthCallBack = null;
      this.FOnFontCacheReady = null;
      this.FOnPopState = null;
      this.FMaxZIndex = 0;
      this.FCreatedProc = null;
      this.FHandleOAuth = false;
      this.FHintPause = 0;
      this.FHintHidePause = 0;
      this.FHintPosition = 0;
      this.FHintClassName = "";
      this.FOnExit$1 = null;
      this.FOnException = null;
      this.FOnAutoCreateForm = null;
      this.FRouting = false;
      this.FSBW = 0;
    };
    this.$final = function () {
      this.FLastReq = undefined;
      this.FActiveForm = undefined;
      this.FMainForm = undefined;
      this.FLoadForm = undefined;
      this.FFormStack = undefined;
      this.FParameters = undefined;
      this.FOnImageCacheReady = undefined;
      this.FOnError = undefined;
      this.FOnHashChange = undefined;
      this.FClientConnector = undefined;
      this.FOnOnlineChange = undefined;
      this.FOnActivate = undefined;
      this.FOnOAuthToken = undefined;
      this.FOnOAuthCallBack = undefined;
      this.FOnFontCacheReady = undefined;
      this.FOnPopState = undefined;
      this.FCreatedProc = undefined;
      this.FOnExit$1 = undefined;
      this.FOnException = undefined;
      this.FOnAutoCreateForm = undefined;
      pas["WEBLib.Controls"].TControl.$final.call(this);
    };
    this.DoFormLoad = function (Event) {
      var Result = false;
      var LResponse = "";
      LResponse = Event.target.responseText;
      this.CreateNewForm(this.FLoadForm,LResponse);
      if (this.FCreatedProc != null) {
        this.FCreatedProc(this);
        this.FCreatedProc = null;
      };
      Result = true;
      return Result;
    };
    this.DoFormAbort = function (Event) {
      var Result = false;
      pas["WEBLib.Dialogs"].ShowMessage("Failed to load form HTML template file");
      Result = true;
      return Result;
    };
    this.DoHandleError = function (Event) {
      var Result = false;
      var err = $mod.TApplicationError.$new();
      var el = null;
      var sp = null;
      var x = null;
      var msg = "";
      var pmsg = "";
      var pstack = "";
      var s = "";
      var isError = false;
      var isPromise = false;
      var jserror = undefined;
      var ex = null;
      isError = true;
      isPromise = false;
      jserror = null;
      err.AFile = "";
      err.ALineNumber = 0;
      err.AColNumber = 0;
      err.AError = null;
      if (Event.message == undefined) {
        isError = false;
        if (Event instanceof PromiseRejectionEvent)
        {
          isError = true;
          isPromise = true;
          pmsg = Event.reason.FMessage;
          pstack = Event.reason.FStack;
          jserror = Event.reason;
        }
      };
      if (!isPromise && (Event.message === "ResizeObserver loop limit exceeded")) return Result;
      if (!isPromise && (Event.message === "ResizeObserver loop completed with undelivered notifications.")) return Result;
      if (!isError) {
        err.AMessage = "Undefined JavaScript exception";
        err.AFile = "";
        err.ALineNumber = 0;
        err.AColNumber = 0;
        err.AError = null;
        if (this.FOnError != null) this.FOnError(this,$mod.TApplicationError.$clone(err),{get: function () {
            return Result;
          }, set: function (v) {
            Result = v;
          }});
        return Result;
      };
      if (isPromise) {
        err.AMessage = pmsg;
        err.AStack = pstack;
        err.AError = jserror;
      } else {
        err.AMessage = Event.message;
        err.AFile = Event.filename;
        err.ALineNumber = Event.lineno;
        err.AColNumber = Event.colno;
        err.AError = Event.error;
        err.AStack = "";
      };
      s = "";
      if (Event.error != null) {
        if (Event.error.stack) {
          err.AStack = Event.error.stack;
        }
        if (Event.error.fMessage) {
          err.AMessage = Event.error.fMessage;
        };
        function objToString (obj) {
              var str = '';
              for (var p in obj) {
                  if (obj.hasOwnProperty(p)) {
                      str += p + '::' + obj[p] + '\n';
                  }
              }
              return str;
              }
        
              // detect if it was an RTL exception
              if (Event.error.hasOwnProperty('FJSError'))
              {
                jserror = Event.error['FJSError'];
              }
        
              s = objToString(Event.error);
      };
      if (pas.System.Assigned(jserror)) {
        ex = err.AError; //Event.error;
        if (this.FOnException != null) this.FOnException(this,ex);
      };
      Result = false;
      msg = "ERROR<br>" + err.AMessage + " | " + s + err.AStack + "<BR> at " + err.AFile + " [" + pas.SysUtils.IntToStr(err.ALineNumber) + ":" + pas.SysUtils.IntToStr(err.AColNumber) + "]";
      var $tmp = this.FErrorType;
      if ($tmp === $mod.TApplicationErrorType.aeFooter) {
        el = document.getElementById("tmserrormessage");
        if (el != null) {
          rtl.asExt(el.firstChild,HTMLElement).innerHTML = msg;
        } else {
          el = document.createElement("DIV");
          el.setAttribute("id","tmserrormessage");
          el.style.setProperty("position","absolute");
          el.style.setProperty("font-family","Courier");
          el.style.setProperty("font-size","8pt");
          el.style.setProperty("bottom","0");
          el.style.setProperty("width","100%");
          el.style.setProperty("height","100px");
          el.style.setProperty("background","#ff0000");
          el.style.setProperty("color","#ffffff");
          document.body.style.setProperty("padding","0");
          document.body.style.setProperty("margin","0");
          sp = document.createElement("SPAN");
          sp.style.setProperty("margin-left","4px");
          sp.style.setProperty("float","left");
          sp.style.setProperty("overflow","hidden");
          sp.style.setProperty("display","block");
          sp.innerHTML = msg;
          el.appendChild(sp);
          x = document.createElement("SPAN");
          x.style.setProperty("font-family","Courier");
          x.style.setProperty("font-size","8pt");
          x.style.setProperty("font-weight","bold");
          x.style.setProperty("position","absolute");
          x.style.setProperty("width","20px");
          x.style.setProperty("vertical-align","top");
          x.style.setProperty("cursor","pointer");
          x.style.setProperty("text-align","right");
          x.style.setProperty("right","4px");
          x.style.setProperty("display","block");
          x.innerHTML = "X";
          x.onclick = rtl.createSafeCallback(this,"DoErrorClose");
          el.appendChild(x);
          document.body.appendChild(el);
        };
      } else if ($tmp === $mod.TApplicationErrorType.aeAlert) {
        window.alert(msg)}
       else if ($tmp === $mod.TApplicationErrorType.aeDialog) {
        this.AddControlLink("googlematerial","https://fonts.googleapis.com/icon?family=Material+Icons");
        pas["WEBLib.Dialogs"].MessageDlg(msg,pas["WEBLib.Dialogs"].TMsgDlgType.mtError,rtl.createSet(pas["WEBLib.Dialogs"].TMsgDlgBtn.mbOK),null);
      };
      if (this.FOnError != null) this.FOnError(this,$mod.TApplicationError.$clone(err),{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.DoHandleExit = function (Event) {
      var Result = false;
      Result = true;
      if (this.FOnExit$1 != null) this.FOnExit$1(this);
      return Result;
    };
    this.DoHashChange = function (Event) {
      var Result = false;
      var s = "";
      var fc = null;
      var frm = null;
      var bdy = null;
      var Handled = false;
      Result = true;
      if (!this.FAutoFormRoute) return Result;
      s  = location.hash;
      pas.System.Delete({get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},1,1);
      Handled = false;
      if (this.FOnHashChange != null) this.FOnHashChange(this,s,{get: function () {
          return Handled;
        }, set: function (v) {
          Handled = v;
        }});
      if (Handled) return Result;
      if (s === "") s = this.FInitFormClassName;
      if (s !== "") {
        if (this.FInitFormClassName === "") this.FInitFormClassName = this.FActiveForm.$classname;
        fc = pas.Classes.GetClass(s);
        if (fc != null) {
          bdy = document.body;
          this.CreateForm$6(fc,bdy,{get: function () {
              return frm;
            }, set: function (v) {
              frm = v;
            }});
        };
      };
      return Result;
    };
    this.DoPopState = function (Event) {
      var Result = false;
      if (this.FOnPopState != null) this.FOnPopState(this,Event.state);
      Result = true;
      return Result;
    };
    this.DoErrorClose = function (Event) {
      var Result = false;
      document.body.removeChild(Event.target.parentElement);
      Result = true;
      return Result;
    };
    this.DoUpdateOnlineStatus = function (Event) {
      var Result = false;
      Result = true;
      if (this.FOnOnlineChange != null) {
        if (window.navigator.onLine) {
          this.FOnOnlineChange(this,$mod.TOnlineStatus.osOnline)}
         else this.FOnOnlineChange(this,$mod.TOnlineStatus.osOffline);
      };
      return Result;
    };
    this.DoVisibilityChange = function (Event) {
      var Result = false;
      var res = false;
      Result = true;
      res = document.visibilityState === "visible";
      if (this.FOnActivate != null) this.FOnActivate(this,res);
      return Result;
    };
    this.SetLanguage = function (Value) {
      this.FLanguage = Value;
    };
    this.GetIsOnline = function () {
      var Result = false;
      Result = window.navigator.onLine;
      return Result;
    };
    this.GetIsMobile = function () {
      var Result = false;
      var mob = false;
      function TestMobile() {
            var check = false;
           (function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera);
           return check;
           };
      
          mob = TestMobile();
      Result = mob;
      return Result;
    };
    this.GetIsPWA = function () {
      var Result = false;
      var pwa = false;
      pwa = ('standalone' in window.navigator) && (window.navigator.standalone);
      Result = pwa;
      return Result;
    };
    this.InternalDownloadFile = function (AData, AFileName, AType, ANewTab) {
      var lElement = document.createElement('a');
      var lBlob = new Blob([AData], {type: AType})
      var lUrl = window.URL.createObjectURL(lBlob);
      lElement.href = lUrl;
      if (AFileName != ''){
        lElement.setAttribute('download', AFileName);
      }
      lElement.style.display = 'none';
      if (ANewTab == true) {
        lElement.target = '_blank';
      }
      document.body.appendChild(lElement);
      lElement.click();
      document.body.removeChild(lElement);
    };
    this.CreateNewForm = function (AForm, HTML) {
      var eh = null;
      var op = null;
      var span = null;
      var childspan = null;
      var formspan = null;
      var l = 0;
      var t = 0;
      var w = 0;
      var h = 0;
      var LCreatedProc = null;
      var LCaptionDiv = null;
      var LCaptionHeight = 0;
      var ro = null;
      if (this.FMainForm === null) this.FMainForm = AForm;
      span = null;
      formspan = null;
      LCaptionHeight = 0;
      if (!AForm.FPopup && (AForm.FFormElement !== "")) {
        AForm.FLayer$1 = null;
        eh = document.getElementById(AForm.FFormElement);
        if (eh != null) {
          eh.innerHTML = HTML;
          if ((AForm.FElementClassName === "") && (AForm.FCSSLibrary === pas["WEBLib.Controls"].TCSSLibrary.cssNone)) eh.style.setProperty(pas["WEBLib.Controls"].CSSBackground,pas["WEBLib.Graphics"].ColorToHTML(AForm.FColor));
        };
      } else {
        AForm.ClearControls();
        AForm.FLayer$1 = AForm.CreateLayer();
        document.body.appendChild(AForm.FLayer$1);
        eh = AForm.FLayer$1;
        if (AForm.FPopup && (AForm.FPopupOpacity < 1)) {
          op = AForm.CreateLayer();
          op.style.setProperty(pas["WEBLib.Controls"].CSSBackground,"rgb(0,0,0," + pas["WEBLib.WebTools"].DoubleToHTML(AForm.FPopupOpacity) + ")");
          op.style.setProperty(pas["WEBLib.Controls"].CSSZIndex,$mod.Application.MaxZIndexStr());
          eh.appendChild(op);
        };
        $mod.Application.ChangeMaxZIndex(+1);
        span = document.createElement("DIV");
        span.style.setProperty(pas["WEBLib.Controls"].CSSZIndex,$mod.Application.MaxZIndexStr());
        AForm.FPopupElement = span;
        if (AForm.FBorder in rtl.createSet($mod.TFormBorderStyle.fbDialog,$mod.TFormBorderStyle.fbDialogSizeable)) {
          span.style.setProperty("resize","both");
          span.style.setProperty("overflow","auto");
          ro = null;
          try
          {
          var frm = AForm;
          ro = new ResizeObserver( function(entries)  {
             window.requestAnimationFrame(() => {
                if (!Array.isArray(entries) || !entries.length) {
                  return;
                }
             entries.forEach( function(entry) {
               frm.HandleObserver();
               });
               } );
          });
            // Observe the scrollingElement for when the window gets resized
            ro.observe(span);
          }
          catch(err)
          {
            span.style.removeProperty('resize');
            span.style.removeProperty('overflow');
          };
          AForm.FResizeObserver = ro;
        };
        if (AForm.FElementClassName !== "") span.setAttribute("class",AForm.FElementClassName);
        if (AForm.FShadow && AForm.FPopup) span.style.setProperty("box-shadow","3px 3px 3px silver");
        eh.appendChild(span);
        AForm.GetMethodPointers();
        if (AForm.FBorder in rtl.createSet($mod.TFormBorderStyle.fbDialog,$mod.TFormBorderStyle.fbDialogSizeable)) {
          LCaptionDiv = AForm.CreateCaption();
          span.appendChild(LCaptionDiv);
          childspan = document.createElement("DIV");
          childspan.style.setProperty("position","absolute");
          childspan.style.setProperty("width","100%");
          childspan.setAttribute("id","childspan");
          span.appendChild(childspan);
          formspan = childspan;
          LCaptionHeight = $mod.Application.FFormCaptionHeight;
        } else {
          formspan = span;
        };
        formspan.innerHTML = HTML;
        AForm.FContainer = formspan;
      };
      AForm.Init();
      AForm.LoadDFMValues();
      if ((AForm.FBorder in rtl.createSet($mod.TFormBorderStyle.fbDialog,$mod.TFormBorderStyle.fbDialogSizeable)) && (AForm.FElementCaptionClassName !== "")) {
        LCaptionDiv.classList.add(AForm.FElementCaptionClassName);
        LCaptionDiv.style.removeProperty("background-color");
        LCaptionDiv.style.removeProperty("color");
      };
      if (AForm.FLayer$1 != null) {
        if (!AForm.FPopup) {
          if (AForm.FElementClassName === "") {
            if (AForm.FColor !== -1) {
              eh.style.setProperty(pas["WEBLib.Controls"].CSSBackground,pas["WEBLib.Graphics"].ColorToHTML(AForm.FColor))}
             else eh.style.setProperty(pas["WEBLib.Controls"].CSSBackground,"white");
          } else eh.setAttribute("class",AForm.FElementClassName);
          if ((AForm.FCSSLibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap) && (AForm.FElementClassName === "")) {
            eh.setAttribute("class","card");
            eh.style.removeProperty("background-color");
            eh.style.setProperty("display","block");
          };
        };
      };
      if ((span != null) && (AForm.FFormContainer === "") && AForm.FPopup && (AForm.FPosition === $mod.TPosition.poScreenCenter)) {
        span.style.setProperty("position","absolute");
        l = Math.max(0,Math.round(($mod.WinWidth() - AForm.GetWidth()) / 2)) + window.scrollX;
        t = Math.max(0,Math.round(($mod.WinHeight() - AForm.GetHeight()) / 2)) + window.scrollY;
        w = AForm.GetWidth();
        h = AForm.GetClientHeight() + LCaptionHeight;
        AForm.FTop = t;
        AForm.FLeft = l;
        AForm.SetWidthInt(w);
        AForm.SetHeightInt(h);
        if ((AForm.FElementClassName === "") && (AForm.FCSSLibrary === pas["WEBLib.Controls"].TCSSLibrary.cssNone)) {
          span.style.setProperty(pas["WEBLib.Controls"].CSSBackground,pas["WEBLib.Graphics"].ColorToHTML(AForm.FColor));
          span.style.setProperty("border","1px Black solid");
        };
        span.style.setProperty("top",pas.SysUtils.IntToStr(t) + "px");
        span.style.setProperty("left",pas.SysUtils.IntToStr(l) + "px");
        span.style.setProperty("width",pas.SysUtils.IntToStr(w) + "px");
        span.style.setProperty("height",pas.SysUtils.IntToStr(h) + "px");
      };
      if (formspan != null) this.ActivateChildScripts(formspan);
      if (AForm.FOnCreate != null) AForm.FOnCreate(AForm);
      if (AForm.FCreatedProc != null) {
        LCreatedProc = AForm.FCreatedProc;
        AForm.FCreatedProc = null;
        LCreatedProc(AForm);
      };
      AForm.Loaded();
      AForm.InitAnchoring();
      AForm.UpdateChildAnchoring();
      AForm.FCreating = false;
      AForm.UpdateElement();
      if (!AForm.EventsBound()) AForm.BindEvents();
      AForm.Resize$1();
      AForm.DoShow();
    };
    this.GetFormExtension = function () {
      var Result = "";
      if (this.FLanguage !== pas["WEBLib.Lang"].TUILanguage.lNone) {
        Result = "_" + pas["WEBLib.Lang"].GetLanguageISO639_1Code(this.FLanguage) + pas["WEBLib.WebTools"].cHTMLExt}
       else Result = pas["WEBLib.WebTools"].cHTMLExt;
      return Result;
    };
    var sExternalBrowserAuthorizationOK = '<div class="text2">Application succesfully authorized</div>You can close this browser window';
    var sExternalBrowserAuthorizationFailed = '<div class="text2">Application authorization failed</div><br/>Please try again.';
    var LB = "\r\n";
    var ImageFail = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeA" + "AAACXBIWXMAAA7DAAAOwwHHb6hkAAABtElEQVR4nO2bUY7CMAxEhz0NB+EgrDjXCg6yB+E4+9NKCAiN" + "7XHcjf1+ED+Z6ahNHScFiqIoBNwvp+v9crpG+3hG6+sgFQFwXv7ejj+/31JBDyy+ugN4ElkJD8Hqqyu" + "AhohYjA3D12YAGyIiMSYsXx8D6BTpFmPB9NUMQCjSJcaA7ettAEqRTTErHr5eAjCKfBSz4OXryzhgiz" + "OzWCJd/Fs8HoFHzHeCtxf2JNgt3MMID8zXoMpAtDarEDIbidJklMJUQ6MDty6GNDSNRdxtluWwhReDU" + "fONKADAx2jkZCsOAOAaXn4pY2let6oAAN/qTIG61lAHAOwmBFO1aQoACA/BXGqbAwDCQqCsOCkBAMND" + "oC23aQEAw0Kg9hqoAQDuIdAbLfQAALcQXFptLgEA9BDc+oxeLbF/Qz0C7AFTT4KpX4OpC6HUpXDqxVD" + "q5fBOLn5lbEMkdUssdVM0dVs89cZI6q2x1JujqbfHUx+Q2MPFj/LidUqsKajB05NXS4y6Zl/GurHGe6" + "QOSpLF5jgqqxSb67C0UGzO4/KdYnN/MLEhluOTmYZY+MWvDPU122dzRVHk5g+X6Lw5aVkK9AAAAABJRU5ErkJggg==";
    var ImageSuccess = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaX" + "HeAAAACXBIWXMAAA7DAAAOwwHHb6hkAAACC0lEQVR4nO2Zv3GDMBSHv+QyQEbICM4EOW+Q9BS4o2QTU" + "9LZBQNkg6zgETyCR0iRkOMIAv3Xk0+/zsiI931nI3iCkpKSkpKSkpKSkpJ7SDN0x2bo3nW//xCymNhp" + "hu4E1MAN2PdVe9k6524ETODHXIHXvmpva+c9BqwpWhbgAV6Ar61zsxeggB+z+x1XJmsBG/Bj6mboWtV" + "gtvcATfhpPvqq/ZwfzFKABTwoVobsBFjCj7kyWxmyugc4wsPCypCNAA/wY/L7C3iEP/dVe5geEC8gJD" + "wIFxAaHgQLiAEPQgXEggeBAmLCgzABseFBkIAU8CBEQCp4ECAgJTwYChibCzYXWpmv9jCVFTwYCJgVa" + "31BxXwucapFS4CiWOsLS4EHDQEbxRoXIAkeNgRoFqtdiDR4WBFgWOxmQRLhQdEQsSi2bobuqBqUCg8L" + "vwDHYg991Z49zjeNd3iYCfBU7J8E6fAAT7PPOw9znpqhA3hDODz8F7Dnp2vqKmJ1O8ogQeFh+R7wjB8" + "JrgkOD4plUICEKPCw/hyQSkI0eNh+EowtISo86L0LxJIQHR703wZDS0gCD2b9gFASksGDeUfIt4Sk8G" + "DRE/QoITk8WDZFPUgQAQ8OXWEHCWLgwbEtbiFBFDx42BcwkCAOHjxtjGhIEAkPHneGViSIhQfPW2MLE" + "kTDQ4C9wYmEi3T4kpKSkm+5ax+YhPsUTQAAAABJRU5ErkJggg==";
    var PlaceHolderImage = "#PLACEHOLDERIMAGE#";
    var PlaceHolderText = "#PLACEHOLDERTEXT#";
    var PlaceHolderColor = "#PLACEHOLDERCOLOR#";
    var AuthHTMLTemplate = "<!doctype html>" + LB + '<html lang="en">' + LB + "<head>" + LB + "  <title>Authentication Result</title>" + LB + '  <meta name="viewport" content="width=device-width, initial-scale=1">' + LB + "</head>" + LB + "<body>" + LB + "<style>" + LB + "  hr" + LB + "  {" + LB + "    border: none;" + LB + "    height: 1px;" + LB + "    background-color: rgb(171, 171, 171);" + LB + "  }" + LB + "  div.container" + LB + "  {" + LB + "    position: fixed;" + LB + "    font-family: Arial;" + LB + "    font-size: 12pt;" + LB + "    max-width: 100%;" + LB + "    max-height: 100%;" + LB + "    top: 50%;" + LB + "    left: 50%;" + LB + "    transform: translate(-50%, -50%);" + LB + "  }" + LB + "  div.section" + LB + "  {" + LB + "    display: inline-block;" + LB + "    margin: 15px;" + LB + "    padding: 5px;" + LB + "    float: left;" + LB + "  }" + LB + "  div.image img" + LB + "  {" + LB + "    height: 100%;" + LB + "  }" + LB + "  div.text" + LB + "  {" + LB + "    padding-top: 15px;" + LB + "  }" + LB + "  div.text2" + LB + "  {" + LB + "    font-size: 18pt;" + LB + "    color: #PLACEHOLDERCOLOR#;" + LB + "  }" + LB + "  span.title" + LB + "  {" + LB + "    font-size: 26px;" + LB + "  }" + LB + "</style>" + LB + '  <div class="container">' + LB + '  <div class="section image">' + LB + '    <img src="#PLACEHOLDERIMAGE#">' + LB + "  </div>" + LB + '  <div class="section text">' + LB + "  #PLACEHOLDERTEXT#" + LB + "  </div>" + LB + "  </div>" + LB + " </body>" + LB + "</html>";
    this.GetAuthorizationPageHTML = function (AAuthorizationSuccess) {
      var $Self = this;
      var Result = "";
      function ReplacePlaceHolders(APlaceHolders, APlaceHolderValues) {
        var Result = "";
        var I = 0;
        var s = "";
        s = AuthHTMLTemplate;
        for (var $l = 0, $end = rtl.length(APlaceHolders) - 1; $l <= $end; $l++) {
          I = $l;
          s = pas.SysUtils.StringReplace(s,APlaceHolders[I],APlaceHolderValues[I],rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
        };
        Result = s;
        return Result;
      };
      if (AAuthorizationSuccess) {
        Result = ReplacePlaceHolders([PlaceHolderImage,PlaceHolderText,PlaceHolderColor],[ImageSuccess,sExternalBrowserAuthorizationOK,"rgb(104, 164, 144)"])}
       else Result = ReplacePlaceHolders([PlaceHolderImage,PlaceHolderText,PlaceHolderColor],[ImageFail,sExternalBrowserAuthorizationFailed,"rgb(216, 99, 68)"]);
      return Result;
    };
    this.GetColorScheme = function () {
      var Result = 0;
      Result = $mod.TApplicationColorScheme.csNoScheme;
      if (window.matchMedia("(prefers-color-scheme)").media !== "not all") {
        if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
          Result = $mod.TApplicationColorScheme.csDark}
         else Result = $mod.TApplicationColorScheme.csLight;
      };
      return Result;
    };
    this.GetActive = function () {
      var Result = false;
      Result = !document.hidden;
      return Result;
    };
    this.GetBootstrapVersion = function () {
      var Result = 0;
      var bv = "";
      bv = "";
      if (typeof bootstrap !== 'undefined') {
        bv = bootstrap.Tooltip.VERSION;
      };
      Result = $mod.TBootstrapVersion.bv3;
      if (pas.System.Pos("4.",bv) === 1) {
        Result = $mod.TBootstrapVersion.bv4}
       else if (pas.System.Pos("5.",bv) === 1) Result = $mod.TBootstrapVersion.bv5;
      return Result;
    };
    this.ReloadForm = function () {
      var $Self = this;
      var lFileName = "";
      function DoStatusCreate(Event) {
        var Result = false;
        var i = 0;
        var ctl = null;
        var s = "";
        var sl = null;
        var response = "";
        response = Event.target.responseText;
        sl = pas.Classes.TStringList.$create("Create$1");
        for (var $l = $Self.FActiveForm.GetControlsCount() - 1; $l >= 0; $l--) {
          i = $l;
          ctl = $Self.FActiveForm.GetControls(i);
          s = ctl.SaveState();
          ctl.GetElementHandle().id = ctl.FName;
          s = ctl.FName + "=" + s;
          sl.Add(s);
        };
        for (var $l1 = $Self.FActiveForm.GetControlsCount() - 1; $l1 >= 0; $l1--) {
          i = $l1;
          ctl = $Self.FActiveForm.GetControls(i);
          $Self.FActiveForm.RemoveComponent(ctl);
          ctl = rtl.freeLoc(ctl);
        };
        $Self.FActiveForm.ClearControls();
        $Self.FActiveForm.UnbindEvents();
        document.body.innerHTML = response;
        $Self.FActiveForm.CreateControl();
        $Self.FActiveForm.DoCreate();
        $Self.FActiveForm.Init();
        for (var $l2 = $Self.FActiveForm.GetControlsCount() - 1; $l2 >= 0; $l2--) {
          i = $l2;
          ctl = $Self.FActiveForm.GetControls(i);
          s = sl.GetValue(ctl.FName);
          if (s !== "") ctl.LoadState(s);
        };
        sl = rtl.freeLoc(sl);
        $Self.FActiveForm.DoShow();
        Result = true;
        return Result;
      };
      lFileName = this.FActiveForm.$class.GetHTMLFileName(false);
      this.FLastReq = new XMLHttpRequest();
      this.FLastReq.addEventListener("load",rtl.createSafeCallback(null,DoStatusCreate));
      this.FLastReq.open("GET",lFileName);
      this.FLastReq.setRequestHeader("Cache-Control","no-cache");
      this.FLastReq.send();
    };
    this.ActivateChildScripts = function (AElement) {
      function nodeScriptReplace(node) {
                  if ( nodeScriptIs(node) === true ) {
                          node.parentNode.replaceChild( nodeScriptClone(node) , node );
                  }
                  else {
                          var i        = 0;
                          var children = node.childNodes;
                          while ( i < children.length ) {
                                  nodeScriptReplace( children[i++] );
                          }
                  }
      
                  return node;
          }
          function nodeScriptIs(node) {
                  return node.tagName === 'SCRIPT';
          }
          function nodeScriptClone(node){
                  var script  = document.createElement("script");
                  script.async = false;
                  script.text = node.innerHTML;
                  for( var i = node.attributes.length-1; i >= 0; i-- ) {
                          script.setAttribute( node.attributes[i].name, node.attributes[i].value );
                  }
                  return script;
          }
          nodeScriptReplace(AElement);
    };
    this.ChangeMaxZIndex = function (Delta) {
      this.FMaxZIndex = this.FMaxZIndex + Delta;
    };
    this.TriggerNotification = function () {
    };
    this.AutoCreateForm = function (AInstanceClass, AReference) {
      if (this.FOnAutoCreateForm != null) {
        this.FOnAutoCreateForm(this,AInstanceClass,AReference)}
       else this.CreateForm(AInstanceClass,AReference);
    };
    this.SetHash = function (AValue) {
      window.location.hash = AValue;
    };
    this.GetHash = function () {
      var Result = "";
      var s = "";
      s = window.location.hash;
      if ((s.length > 0) && (s.charAt(0) === "#")) pas.System.Delete({get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},1,1);
      Result = s;
      return Result;
    };
    this.PushForm = function (AForm) {
      var i = 0;
      for (var $l = 0, $end = AForm.GetControlsCount() - 1; $l <= $end; $l++) {
        i = $l;
        AForm.GetControls(i).PersistinHTML();
      };
      AForm.FFormContent = document.body.innerHTML;
      for (var $l1 = 0, $end1 = AForm.GetControlsCount() - 1; $l1 <= $end1; $l1++) {
        i = $l1;
        AForm.GetControls(i).DisableTab();
      };
      this.FFormStack.Add(AForm);
    };
    this.PopForm = function () {
      var Result = null;
      var i = 0;
      var frm = "";
      if (this.FFormStack.GetCount() > 0) {
        Result = rtl.getObject(this.FFormStack.Get(this.FFormStack.GetCount() - 1));
        frm = Result.FFormContent;
        this.FFormStack.Delete(this.FFormStack.GetCount() - 1);
        document.body.innerHTML = frm;
        Result.InitFromHTML();
        Result.BindEvents();
        for (var $l = 0, $end = Result.GetControlsCount() - 1; $l <= $end; $l++) {
          i = $l;
          Result.GetControls(i).HookElement();
        };
        for (var $l1 = 0, $end1 = Result.GetControlsCount() - 1; $l1 <= $end1; $l1++) {
          i = $l1;
          Result.GetControls(i).RecreateCanvas();
          Result.GetControls(i).InternalResize();
        };
        $mod.Application.FActiveForm = Result;
      };
      return Result;
    };
    this.LockForm = function (AForm) {
      var i = 0;
      for (var $l = 0, $end = AForm.GetControlsCount() - 1; $l <= $end; $l++) {
        i = $l;
        AForm.GetControls(i).DisableTab();
      };
    };
    this.UnLockForm = function (AForm) {
      var i = 0;
      for (var $l = 0, $end = AForm.GetControlsCount() - 1; $l <= $end; $l++) {
        i = $l;
        AForm.GetControls(i).EnableTab();
      };
    };
    this.Create$1 = function (AOwner) {
      this.FFormStack = pas.Classes.TList.$create("Create$1");
      this.FParameters = pas.Classes.TStringList.$create("Create$1");
      this.FAppContainer = pas["WEBLib.WebTools"].cBodyTag;
      this.FMainForm = null;
      this.FActiveForm = null;
      this.FInitFormClassName = "";
      this.FIsRedirect = false;
      this.FAutoFormRoute = false;
      this.FThemed = false;
      this.FThemeColor = 14917120;
      this.FThemeTextColor = 16777215;
      this.FFormCaptionHeight = 22;
      this.FMaxZIndex = 998;
      this.FHandleOAuth = true;
      this.FHintPause = 200;
      this.FHintHidePause = 250;
      this.FHintPosition = $mod.THintPosition.hpTop;
      this.FHintClassName = "";
      this.FSBW = -1;
      window.addEventListener("error",rtl.createCallback(this,"DoHandleError"));
      window.addEventListener("unhandledrejection",rtl.createCallback(this,"DoHandleError"));
      window.addEventListener("beforeunload",rtl.createSafeCallback(this,"DoHandleExit"));
      this.FErrorType = $mod.TApplicationErrorType.aeSilent;
      this.FErrorType = $mod.TApplicationErrorType.aeFooter;
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FFormStack");
      rtl.free(this,"FParameters");
      pas["WEBLib.Controls"].TControl.Destroy.call(this);
    };
    this.MaxZIndexStr = function () {
      var Result = "";
      Result = pas.SysUtils.IntToStr(this.FMaxZIndex);
      return Result;
    };
    this.IsPWAInstalled = function () {
      var $Self = this;
      var Result = null;
      var b = false;
      var s = "";
      b = false;
      s = window.location.hostname;
      Result = new Promise(async function (ASuccess, AFailed) {
        if ('getInstalledRelatedApps' in window.navigator) {
         const relatedApps = await navigator.getInstalledRelatedApps();
         relatedApps.forEach((app) => {
            if (app.id.indexOf(s) >= 0)
            {
              b = true;
            }
         });
        };
        ASuccess(b);
      });
      return Result;
    };
    this.CalcScrollBarWidth = function () {
      var Result = 0;
      var res = 0;
      if (this.FSBW !== -1) {
        Result = this.FSBW;
        return Result;
      };
      function getScrollbarWidth() {
            // Create a temporary div element
            const div = document.createElement('div');
      
            // Apply styles to force a scrollbar
            div.style.overflow = 'scroll';
            div.style.position = 'absolute';
            div.style.top = '-9999px'; // Move it off-screen
            div.style.width = '100px';
            div.style.height = '100px';
      
            // Append the div to the body
            document.body.appendChild(div);
      
            // Calculate the scrollbar width
            const scrollbarWidth = div.offsetWidth - div.clientWidth;
      
            // Remove the temporary element
            document.body.removeChild(div);
      
            res = scrollbarWidth;
          }
          getScrollbarWidth();
      this.FSBW = res;
      Result = this.FSBW;
      return Result;
    };
    this.GoBack = function () {
      window.history.back();
    };
    this.CreateNewForm$1 = function (AInstanceClass) {
      var Result = null;
      if (!($mod.VSIDE != null)) {
        Result = AInstanceClass.$create("Create$2",[pas["WEBLib.WebTools"].cBodyTag])}
       else Result = AInstanceClass.$create("Create$2",[""]);
      return Result;
    };
    this.CreateNewForm$2 = function (AInstanceClass, AElementID) {
      var Result = null;
      var el = null;
      var AForm = null;
      el = document.getElementById(AElementID);
      AForm = AInstanceClass.$create("Create$2",[AElementID]);
      AForm.FDesignContainer = el;
      AForm.SetFormContainer(AElementID);
      AForm.FFormElement = AElementID;
      AForm.CreateControl();
      AForm.FContainer = el;
      AForm.Init();
      Result = AForm;
      return Result;
    };
    this.CreateForm = function (AInstanceClass, AReference) {
      this.CreateForm$2(AInstanceClass,this.FAppContainer,AReference,null);
    };
    this.CreateForm$1 = function (AInstanceClass, AElementID, AReference) {
      this.CreateForm$2(AInstanceClass,AElementID,AReference,null);
    };
    this.CreateForm$2 = function (AInstanceClass, AElementID, AReference, AProc) {
      this.CreateForm$3(AInstanceClass,AElementID,AReference,AProc,true);
    };
    this.CreateForm$3 = function (AInstanceClass, AElementID, AReference, AProc, LoadHTML) {
      var $Self = this;
      var LFileName = "";
      function DoStatusCreate(Event) {
        var Result = false;
        var LElem = null;
        var LForm = null;
        var LResponse = "";
        var LIsBody = false;
        var LisLoaded = false;
        LisLoaded = Event != null;
        if (LisLoaded) {
          LResponse = Event.target.responseText;
          LIsBody = pas.SysUtils.LowerCase(AElementID) === pas["WEBLib.WebTools"].cBodyTag;
          if (LIsBody) {
            LElem = document.body}
           else LElem = document.getElementById(AElementID);
          LElem.innerHTML = LResponse;
        } else {
          LElem = document.body;
        };
        LForm = AInstanceClass.$create("Create$5",[AElementID,AReference]);
        LForm.FFormFileName = LFileName;
        if (LForm.FFormContainer === "") LForm.SetFormContainer(AElementID);
        if (!LIsBody) {
          LForm.FFormElement = AElementID;
          LForm.FContainer = LElem;
        };
        LForm.CreateControl();
        LForm.Init();
        LForm.SetColorScheme($mod.Application.GetColorScheme());
        LForm.FPrevActiveForm = $Self.FActiveForm;
        $Self.FActiveForm = LForm;
        if ($Self.FMainForm === null) $Self.FMainForm = LForm;
        if (AProc != null) AProc(LForm);
        Result = true;
        if (LisLoaded) $Self.ActivateChildScripts(LElem);
        $Self.FActiveForm.DoShow();
        $Self.FActiveForm.Resize$1();
        return Result;
      };
      if (this.FIsRedirect) return;
      if (this.FAppInitializing) {
        if (this.FCanCreateForm) {
          this.FCanCreateForm = false}
         else return;
      };
      LFileName = AInstanceClass.GetHTMLFileName(false);
      if ((LFileName !== "") && LoadHTML) {
        this.FLastReq = new XMLHttpRequest();
        this.FLastReq.addEventListener("load",rtl.createSafeCallback(null,DoStatusCreate));
        this.FLastReq.open("GET",LFileName);
        this.FLastReq.setRequestHeader("Cache-Control","no-cache");
        this.FLastReq.send();
      } else {
        DoStatusCreate(null);
      };
    };
    this.CreateForm$4 = function (AInstanceClass, AReference) {
      var lModule = null;
      lModule = AInstanceClass.$create("Create$1",[this]);
      AReference.set(lModule);
    };
    var cHTMLCode = '<html><head><meta http-equiv="Content-type" content="text/html; ' + 'charset=utf-8" /><title>TMS Web Project</title><style></style></head>' + "<body></body></html>";
    this.CreateForm$5 = function (AInstanceClass, AReference) {
      var lFrame = null;
      var lForm = null;
      lForm = $impl.TFramePreviewForm.$create("Create$1",[$mod.Application]);
      lFrame = AInstanceClass.$create("Create$1",[lForm]);
      lForm.FFrame = lFrame;
      lForm.FPopup = false;
      AReference.set(lFrame);
      $mod.Application.FActiveForm = lForm;
      $mod.Application.CreateNewForm(lForm,cHTMLCode);
    };
    this.CreateForm$6 = function (AInstanceClass, AElement, AReference) {
      this.CreateForm$2(AInstanceClass,AElement.id,AReference,null);
    };
    this.CreateFormDirect = function (AInstanceClass, AReference) {
      this.CreateForm$3(AInstanceClass,this.FAppContainer,AReference,null,false);
    };
    this.CreateFormDirect$1 = function (AInstanceClass, AElementID, AReference) {
      this.CreateForm$3(AInstanceClass,AElementID,AReference,null,false);
    };
    this.CreateFormDirect$2 = function (AInstanceClass, AReference) {
      this.CreateForm$4(AInstanceClass,AReference);
    };
    this.CreateFormDirect$3 = function (AInstanceClass, AReference) {
      this.CreateForm$5(AInstanceClass,AReference);
    };
    this.LoadForm = function (AForm, AFormFile) {
      AForm.FPrevActiveForm = this.FActiveForm;
      this.FActiveForm = AForm;
      this.FLoadForm = AForm;
      if (this.FMainForm === null) this.FMainForm = AForm;
      this.FLastReq = new XMLHttpRequest();
      this.FLastReq.addEventListener("load",rtl.createSafeCallback(this,"DoFormLoad"));
      this.FLastReq.addEventListener("abort",rtl.createSafeCallback(this,"DoFormAbort"));
      this.FLastReq.open("GET",AFormFile);
      this.FLastReq.send();
    };
    this.LoadForm$1 = function (AForm, AFormFile, FormLoaded) {
      this.FCreatedProc = FormLoaded;
      this.LoadForm(AForm,AFormFile);
    };
    this.ChangeCSS = function (id, href) {
      var styleElement = document.getElementById(id);
      if (styleElement) {
        styleElement.href = href;
        return;
      };
    };
    this.InsertCSS = function (id, href) {
      var styleElement = null;
      styleElement = document.getElementById(id);
      if (styleElement != null) {
        styleElement.href = href;
        return;
      };
      styleElement = document.createElement("link");
      styleElement.id = id;
      styleElement.rel = 'stylesheet';
      styleElement.href = href;
      document.getElementsByTagName("head").item(0).appendChild(styleElement);
    };
    this.RemoveCSS = function (id) {
      var styleElement = null;
      styleElement = document.getElementById(id);
      if (styleElement != null) {
        styleElement.parentNode.removeChild(styleElement);
      };
    };
    this.HasCSS = function (href) {
      var Result = false;
      var els = null;
      var i = 0;
      var s = "";
      Result = false;
      els = document.querySelectorAll("head > link");
      for (var $l = 0, $end = els.length - 1; $l <= $end; $l++) {
        i = $l;
        s = els.item(i).href;
        if (pas.SysUtils.CompareText(s,href) === 0) {
          Result = true;
          break;
        };
      };
      return Result;
    };
    this.ChangeLanguage = function (Value) {
      this.FLanguage = Value;
      if (this.FMainForm != null) this.ReloadForm();
    };
    this.Initialize = function () {
      var query = "";
      var token = "";
      var p = 0;
      var b = false;
      this.FCanCreateForm = true;
      this.FAppInitializing = true;
      this.FParameters.Clear();
      query = window.location.href;
      this.InitFormatSettings(pas["WEBLib.WebTools"].GetBrowserLocale());
      this.FParameters.SetDelimiter("&");
      this.FParameters.FStrictDelimiter = true;
      p = pas.System.Pos("?",query);
      if (p > 0) query = pas.System.Copy(query,p + 1,query.length);
      this.FParameters.SetDelimitedText(query);
      b = (window.name == "Authentication");
      if (this.FOnOAuthCallBack != null) {
        if ((this.FParameters.IndexOfName("oauthcallback") !== -1) || b) {
          this.FOnOAuthCallBack(this,query);
          this.FIsRedirect = true;
          document.body.innerHTML = this.GetAuthorizationPageHTML(true);
          return;
        };
      };
      if ((this.FParameters.IndexOfName("code") !== -1) && this.FHandleOAuth) {
        if (this.FOnOAuthToken != null) this.FOnOAuthToken(this,query);
        this.FIsRedirect = true;
        token = this.FParameters.GetValue("code");
        if (window.opener && window.opener.processAuthData){
          window.opener.processAuthData(token);
          window.close();
        };
      };
      window.addEventListener("hashchange",rtl.createSafeCallback(this,"DoHashChange"));
      window.addEventListener("online",rtl.createSafeCallback(this,"DoUpdateOnlineStatus"));
      window.addEventListener("offline",rtl.createSafeCallback(this,"DoUpdateOnlineStatus"));
      window.addEventListener("popstate",rtl.createCallback(this,"DoPopState"));
      document.addEventListener("visibilitychange",rtl.createSafeCallback(this,"DoVisibilityChange"));
      if (window.opener !== null) if (this.FParameters.IndexOfName("access_token") !== -1) {
        this.FIsRedirect = true;
        token = this.FParameters.GetValue("access_token");
        if (window.opener && window.opener.processAuthData){
          window.opener.processAuthData(token);
            window.close();
        };
      };
    };
    this.Route = function () {
      var Result = false;
      var frm = null;
      var hash = "";
      var pc = null;
      var i = 0;
      Result = false;
      this.FRouting = true;
      hash = window.location.hash;
      if (hash !== "") {
        hash = rtl.setCharAt(hash,0,"T");
        i = pas.System.Pos("?",hash);
        if (i > 0) hash = rtl.strSetLength(hash,i - 1);
        pc = pas.Classes.GetClass(hash);
        if (pc != null) {
          Result = true;
          $mod.Application.AutoCreateForm(pc,{get: function () {
              return frm;
            }, set: function (v) {
              frm = v;
            }});
        };
      };
      return Result;
    };
    this.InitFormatSettings = function (BrowserLocale) {
      var timestr = "";
      var i = 0;
      var locale = "";
      locale = BrowserLocale;
      pas.SysUtils.FormatSettings.ShortDateFormat = pas["WEBLib.WebTools"].GetLocaleShortDateFormat(locale);
      if (pas.System.Pos("/",pas.SysUtils.FormatSettings.ShortDateFormat) > 0) pas.SysUtils.FormatSettings.DateSeparator = "/";
      if (pas.System.Pos(".",pas.SysUtils.FormatSettings.ShortDateFormat) > 0) pas.SysUtils.FormatSettings.DateSeparator = ".";
      if (pas.System.Pos("-",pas.SysUtils.FormatSettings.ShortDateFormat) > 0) pas.SysUtils.FormatSettings.DateSeparator = "-";
      var event = new Date('Jan 1, 1980 06:07:08 GMT+00:00');
      var loc = "";
      if (locale == "") { loc = navigator.language; } else
      { loc = locale; }
      timestr = event.toLocaleTimeString(loc);
      if (pas.System.Pos(":",timestr) > 0) pas.SysUtils.FormatSettings.TimeSeparator = ":";
      if (pas.System.Pos(".",timestr) > 0) pas.SysUtils.FormatSettings.TimeSeparator = ".";
      if (pas.System.Pos("-",timestr) > 0) pas.SysUtils.FormatSettings.TimeSeparator = "-";
      for (i = 1; i <= 7; i++) {
        pas.SysUtils.FormatSettings.ShortDayNames[i - 1] = pas["WEBLib.WebTools"].GetLocaleShortDayName(i,locale);
        pas.SysUtils.FormatSettings.LongDayNames[i - 1] = pas["WEBLib.WebTools"].GetLocaleLongDayName(i,locale);
      };
      for (i = 1; i <= 12; i++) {
        pas.SysUtils.FormatSettings.ShortMonthNames[i - 1] = pas["WEBLib.WebTools"].GetLocaleShortMonthName(i,locale);
        pas.SysUtils.FormatSettings.LongMonthNames[i - 1] = pas["WEBLib.WebTools"].GetLocaleLongMonthName(i,locale);
      };
      pas.SysUtils.FormatSettings.DecimalSeparator = pas["WEBLib.WebTools"].GetLocaleDecimalSeparator("");
      if (pas.SysUtils.FormatSettings.DecimalSeparator === ".") {
        pas.SysUtils.FormatSettings.ThousandSeparator = ","}
       else pas.SysUtils.FormatSettings.ThousandSeparator = ".";
    };
    this.ReceiveMessageFromClient = function (AMessage) {
      if (this.FClientConnector != null) this.FClientConnector.Receive(AMessage);
    };
    this.RouteForm = function (AParameter) {
      var frm = null;
      var fc = null;
      fc = pas.Classes.GetClass(AParameter);
      $mod.Application.CreateForm(fc,{get: function () {
          return frm;
        }, set: function (v) {
          frm = v;
        }});
    };
    this.Run = function () {
      this.FCanCreateForm = true;
      this.FAppInitializing = false;
    };
    this.RunScript = function (Source) {
      eval(Source);
    };
    this.Terminate = function () {
      window.location.href = "about:blank";
    };
    this.Navigate = function (AURL, ATarget) {
      if (ATarget === $mod.TNavigationTarget.ntBlank) {
        window.open(AURL,"_blank")}
       else window.location.href = AURL;
    };
    this.Download = function (AURL) {
      window.location.href = AURL;
    };
    this.DownloadTextFile = function (AText, AFileName) {
      var element = document.createElement('a');
      element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(AText));
      if (AFileName != ''){
        element.setAttribute('download', AFileName);
      }
      element.style.display = 'none';
      document.body.appendChild(element);
      element.click();
      document.body.removeChild(element);
    };
    this.DownloadBinaryFile = function (AData, AFileName, ANewTab) {
      var lElement = document.createElement('a');
          var lUrl = window.URL.createObjectURL(AData);
          lElement.href = lUrl;
      
          if (AFileName != ''){
            lElement.setAttribute('download', AFileName);
          }
      
          lElement.style.display = 'none';
          if (ANewTab == true) {
            lElement.target = '_blank';
          }
          document.body.appendChild(lElement);
          lElement.click();
          document.body.removeChild(lElement);
    };
    this.DownloadBinaryFile$1 = function (AData, AFileName, ANewTab) {
      this.DownloadBinaryFile$2(Uint8Array.from(AData),AFileName,ANewTab);
    };
    this.DownloadBinaryFile$2 = function (AData, AFileName, ANewTab) {
      this.InternalDownloadFile(AData,AFileName,"octet/stream",ANewTab);
    };
    this.DownloadPDFFile = function (AData, AFileName, ANewTab) {
      this.DownloadPDFFile$1(Uint8Array.from(AData),AFileName,ANewTab);
    };
    this.DownloadPDFFile$1 = function (AData, AFileName, ANewTab) {
      this.InternalDownloadFile(AData,AFileName,"application/pdf",ANewTab);
    };
    this.EXEName = function () {
      var Result = "";
      Result = window.document.location.href;
      return Result;
    };
    this.IDETheme = function () {
      var Result = "";
      var s = "";
      Result = "";
      if (!($mod.VSIDE != null)) return Result;
      s = pas["WEBLib.Forms"].VSIDE.theme;
      Result = s;
      return Result;
    };
    this.IDECSS = function () {
      var Result = "";
      Result = "";
      if (this.IDETheme() === "vscode-light") {
        Result = ".IDECaption { background-color: #F0F0F0 !important; color: #555555 !important; border: 1px solid #DDDDDD !important}" + "\r\n" + ".IDEBkg { background-color: white !important; color: #555555 !important; border: 1px solid #DDDDDD !important}" + "\r\n" + ".IDEButton { background-color: #FAFAFA !important; font-size:10pt; color: #555555 !important; border: 1px solid #DDDDDD !important}" + "\r\n" + ".IDEButton:hover {background-color:#F0F0F0 !important}" + "\r\n" + ".IDEFont {font-size:10pt !important}";
      };
      if (this.IDETheme() === "vscode") {
        Result = ".IDECaption,.IDEButton { background-color: #3F3E43 !important; color: #FFFFFF !important; border: 1px solid #35353A !important}" + "\r\n" + ".IDEBkg { background-color: #2A2A2C !important; color: #A9ACB4 !important; border: 1px solid #35353A !important}" + "\r\n" + ".IDEButton:hover {background-color:#434857 !important}" + "\r\n" + ".IDEFont {font-size:10pt !important}";
      };
      return Result;
    };
    this.Version = function () {
      var Result = "";
      Result = $mod.WEBCOREVERSION;
      return Result;
    };
    this.IDEMessage = function (Msg) {
      pas["WEBLib.Forms"].VSIDE.ShowMessage(Msg);
    };
    this.IDEOpenURL = function (URL) {
      pas["WEBLib.Forms"].VSIDE.Open(URL);
    };
    this.NeedsFormRouting = function () {
      var Result = false;
      var s = "";
      Result = pas["WEBLib.WebTools"].HasQueryParam("form",{get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},true);
      if (Result) this.RouteForm(s);
      return Result;
    };
    this.ObjectURL = function (AFile) {
      var Result = "";
      var res = "";
      res = URL.createObjectURL(AFile);
      Result = res;
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.GetParentForm = function (AControl) {
    var Result = null;
    var FOwner = null;
    Result = null;
    FOwner = AControl;
    while ((FOwner != null) && !$mod.TCustomForm.isPrototypeOf(FOwner)) {
      if ((FOwner === AControl) && (FOwner.FOwner === null)) {
        FOwner = AControl.FParent}
       else FOwner = FOwner.FOwner;
    };
    if ((FOwner != null) && $mod.TCustomForm.isPrototypeOf(FOwner)) Result = rtl.as(FOwner,$mod.TCustomForm);
    return Result;
  };
  this.Log = function (v) {
    console.log(v);
  };
  this.Log$1 = function (arr) {
    var i = 0;
    var s = "";
    s = "[";
    for (var $l = 0, $end = rtl.length(arr) - 1; $l <= $end; $l++) {
      i = $l;
      function isPrimitive(test) {
              return (test !== Object(test));
            };
      
            if (isPrimitive(arr[i])) {
               var su1 = arr[i].toString();
               if (s != "[") { s = s + ","; }
               s = s + su1;
               }
            else
            {
              console.log(arr[i]);
               if (s != "[") { s = s + ","; }
               s = s + "#object";
            };
    };
    s = s + "]";
    $mod.Log(s);
  };
  this.WinWidth = function () {
    var Result = 0;
    var w = 0;
    if ($mod.VSIDE != null) {
      w = pas["WEBLib.Forms"].VSIDE.clientWidth();
    } else w = window.innerWidth;
    Result = w;
    return Result;
  };
  this.WinHeight = function () {
    var Result = 0;
    var h = 0;
    if ($mod.VSIDE != null) {
      h = pas["WEBLib.Forms"].VSIDE.clientHeight();
    } else h = window.innerHeight;
    Result = h;
    return Result;
  };
  this.Sleep = function (milliseconds) {
    var Result = null;
    Result = new Promise(function (resolve, reject) {
      window.setTimeout(function () {
        resolve(milliseconds);
      },milliseconds);
    });
    return Result;
  };
  this.Application = null;
  this.HandShakeScript = null;
  this.VSIDE = null;
  this.LastHash = "";
  this.FrameCount = 0;
  $mod.$implcode = function () {
    rtl.createClass($impl,"TFramePreviewForm",$mod.TForm,function () {
      this.$init = function () {
        $mod.TForm.$init.call(this);
        this.FFrame = null;
      };
      this.$final = function () {
        this.FFrame = undefined;
        $mod.TForm.$final.call(this);
      };
      this.LoadDFMValues = function () {
        $mod.TCustomForm.LoadDFMValues.call(this);
        this.FFrame.SetParentComponent(this);
        this.FFrame.LoadFromForm();
        this.FFrame.BeforeLoadDFMValues();
        try {
          this.FFrame.SetName("Frame1");
          this.FFrame.SetLeft(0);
          this.FFrame.SetTop(0);
          this.FFrame.SetWidth(640);
          this.FFrame.SetHeight(480);
        } finally {
          this.FFrame.AfterLoadDFMValues();
        };
        this.SetName("Form1" + pas["WEBLib.Utils"].TLongIntHelper.ToString.call({p: $mod, get: function () {
            return this.p.FrameCount;
          }, set: function (v) {
            this.p.FrameCount = v;
          }}));
        $mod.FrameCount += 1;
        this.SetLeft(0);
        this.SetTop(0);
        this.SetWidth(640);
        this.SetHeight(480);
      };
      rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
      rtl.addIntf(this,pas.System.IUnknown);
    });
    $impl.ReleaseForm = function (AForm) {
      AForm = rtl.freeLoc(AForm);
      AForm = null;
    };
  };
  $mod.$init = function () {
    $mod.FrameCount = 0;
    $mod.HandShakeScript = document.createElement("script");
    $mod.HandShakeScript.id = "HandShakeScript";
    $mod.HandShakeScript.type = "text/javascript";
    $mod.HandShakeScript.innerHTML = "var IDE = null;" + "\r\n" + 'var TMSWEBCoreClientIdentifier = "unknown";' + "\r\n" + 'var TMSWEBCoreOAuthCallback = "unknown";' + "\r\n" + "function HandShake(cid){" + "\r\n" + "  TMSWEBCoreClientIdentifier = cid;" + "\r\n" + "}";
    document.body.appendChild($mod.HandShakeScript);
    $mod.Application = $mod.TApplication.$create("Create$1",[null]);
  };
},["WEBLib.Dialogs","WEBLib.WebTools","WEBLib.JSON","WEBLib.Utils","Math"]);
rtl.module("Bcl.Json.Common",["System","Types","JS"],function () {
  "use strict";
  var $mod = this;
  this.JValue = function (Value) {
    var Result = undefined;
    Result = Value;
    return Result;
  };
  this.JValue$1 = function (Value) {
    var Result = undefined;
    Result = Value;
    return Result;
  };
  this.JValue$2 = function (Value) {
    var Result = undefined;
    Result = Value;
    return Result;
  };
  this.JValue$3 = function (Value) {
    var Result = undefined;
    Result = Value;
    return Result;
  };
  this.JToInt = function (Value) {
    var Result = 0;
    Result = rtl.trunc(Value);
    return Result;
  };
  this.JToStr = function (Value) {
    var Result = "";
    Result = "" + Value;
    return Result;
  };
  this.JToBool = function (Value) {
    var Result = false;
    Result = !(Value == false);
    return Result;
  };
  this.JIsString = function (Value) {
    var Result = false;
    Result = rtl.isString(Value);
    return Result;
  };
  this.JIsArray = function (Value) {
    var Result = false;
    Result = rtl.isArray(Value);
    return Result;
  };
  this.JIsInteger = function (Value) {
    var Result = false;
    Result = pas.JS.isInteger(Value);
    return Result;
  };
  this.JIsBool = function (Value) {
    var Result = false;
    Result = pas.JS.isBoolean(Value);
    return Result;
  };
  this.AsJObject = function (Value) {
    var Result = null;
    Result = Value;
    return Result;
  };
  this.AsJArray = function (Value) {
    var Result = null;
    Result = Value;
    return Result;
  };
  this.JStringOrDefault = function (Element) {
    var Result = "";
    if ($mod.JIsString(Element)) {
      Result = $mod.JToStr(Element)}
     else Result = "";
    return Result;
  };
  this.JIntegerOrDefault = function (Element) {
    var Result = 0;
    if ($mod.JIsInteger(Element)) {
      Result = $mod.JToInt(Element)}
     else Result = 0;
    return Result;
  };
  this.JBooleanOrDefault = function (Element) {
    var Result = false;
    if ($mod.JIsBool(Element)) {
      Result = $mod.JToBool(Element)}
     else Result = false;
    return Result;
  };
  this.JObjectKeys = function (Value) {
    var Result = [];
    Result = Object.keys(Value);
    return Result;
  };
});
rtl.module("Bcl.Collections.Common",["System","Types","Bcl.Json.Common","JS","SysUtils"],function () {
  "use strict";
  var $mod = this;
  rtl.createClass(this,"TStringMap",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FMap = null;
    };
    this.$final = function () {
      this.FMap = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.GetItem = function (Key) {
      var Result = null;
      Result = rtl.getObject(this.FMap[Key]);
      return Result;
    };
    this.GetKeys = function () {
      var Result = [];
      Result = Object.keys(this.FMap);
      return Result;
    };
    this.Create$1 = function (AOwnsObjects) {
      this.FMap = new Object();
      return this;
    };
    this.Destroy = function () {
      pas.System.TObject.Destroy.call(this);
    };
    this.Clear = function () {
      var I = 0;
      for (var $l = rtl.length(this.GetKeys()) - 1; $l >= 0; $l--) {
        I = $l;
        this.Remove(this.GetKeys()[I]);
      };
    };
    this.Add = function (Key, Value) {
      this.FMap[Key] = Value;
    };
    this.AddOrSetValue = function (Key, Value) {
      this.FMap[Key] = Value;
    };
    this.ContainsKey = function (Key) {
      var Result = false;
      Result = this.FMap.hasOwnProperty(Key);
      return Result;
    };
    this.Remove = function (Key) {
      delete this.FMap[Key];
    };
  });
});
rtl.module("XData.Web.Headers",["System","Types","SysUtils","Bcl.Collections.Common"],function () {
  "use strict";
  var $mod = this;
  rtl.createClass(this,"THttpHeaderInfo",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FName = "";
      this.FValue = "";
    };
    this.Create$1 = function (AName, AValue) {
      this.FName = AName;
      this.FValue = AValue;
      return this;
    };
  });
  rtl.createClass(this,"THttpHeaders",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FHeaders = null;
    };
    this.$final = function () {
      this.FHeaders = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.GetHeaderNames = function () {
      var Result = [];
      Result = this.FHeaders.GetKeys();
      return Result;
    };
    this.Create$1 = function () {
      this.FHeaders = pas["Bcl.Collections.Common"].TStringMap.$create("Create$1",[true]);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FHeaders");
      pas.System.TObject.Destroy.call(this);
    };
    this.SetValue = function (HeaderName, HeaderValue) {
      if (HeaderName !== "") this.FHeaders.AddOrSetValue(pas.SysUtils.LowerCase(HeaderName),$mod.THttpHeaderInfo.$create("Create$1",[pas.SysUtils.LowerCase(HeaderName),pas.SysUtils.Trim(HeaderValue)]));
    };
    this.AddValue = function (HeaderName, HeaderValue) {
      if (this.Exists(HeaderName)) {
        this.SetValue(HeaderName,this.Get(HeaderName) + "," + HeaderValue)}
       else this.SetValue(HeaderName,HeaderValue);
    };
    this.Get = function (HeaderName) {
      var Result = "";
      if (this.FHeaders.ContainsKey(pas.SysUtils.LowerCase(HeaderName))) {
        Result = this.FHeaders.GetItem(pas.SysUtils.LowerCase(HeaderName)).FValue}
       else Result = "";
      return Result;
    };
    this.Exists = function (HeaderName) {
      var Result = false;
      Result = this.FHeaders.ContainsKey(pas.SysUtils.LowerCase(HeaderName));
      return Result;
    };
    this.GetIfExists = function (HeaderName, HeaderValue) {
      var Result = false;
      Result = this.Exists(HeaderName);
      if (Result) HeaderValue.set(this.Get(HeaderName));
      return Result;
    };
    this.Remove = function (HeaderName) {
      if (this.FHeaders.ContainsKey(pas.SysUtils.LowerCase(HeaderName))) this.FHeaders.Remove(pas.SysUtils.LowerCase(HeaderName));
    };
    this.Clear = function () {
      this.FHeaders.Clear();
    };
  });
});
rtl.module("XData.Web.Request",["System","XData.Web.Headers"],function () {
  "use strict";
  var $mod = this;
  rtl.createInterface(this,"IHttpRequest","{782AF543-EFEB-4DA5-AC25-842DF76723A0}",["GetMethod","SetMethod","GetUri","SetUri","GetTimeout","SetTimeout","GetHeaders","GetContent","SetContent","GetResponseType","SetResponseType"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("GetMethod",1,[],2,rtl.string);
    $r.addMethod("SetMethod",0,[["Value",rtl.string,2]]);
    $r.addMethod("GetUri",1,[],2,rtl.string);
    $r.addMethod("SetUri",0,[["Value",rtl.string,2]]);
    $r.addMethod("GetTimeout",1,[],2,rtl.longint);
    $r.addMethod("SetTimeout",0,[["Value",rtl.longint,2]]);
    $r.addMethod("GetHeaders",1,[],2,pas["XData.Web.Headers"].$rtti["THttpHeaders"]);
    $r.addMethod("GetContent",1,[],2,rtl.jsvalue);
    $r.addMethod("SetContent",0,[["Value",rtl.jsvalue,2]]);
    $r.addMethod("GetResponseType",1,[],2,rtl.string);
    $r.addMethod("SetResponseType",0,[["Value",rtl.string,2]]);
    $r.addProperty("Method",3,rtl.string,"GetMethod","SetMethod",2);
    $r.addProperty("Uri",3,rtl.string,"GetUri","SetUri",2);
    $r.addProperty("Headers",1,pas["XData.Web.Headers"].$rtti["THttpHeaders"],"GetHeaders","",2);
    $r.addProperty("Content",3,rtl.jsvalue,"GetContent","SetContent",2);
    $r.addProperty("Timeout",3,rtl.longint,"GetTimeout","SetTimeout",2);
    $r.addProperty("ResponseType",3,rtl.string,"GetResponseType","SetResponseType",2);
  });
  rtl.createClass(this,"THttpRequest",pas.System.TInterfacedObject,function () {
    this.$init = function () {
      pas.System.TInterfacedObject.$init.call(this);
      this.FMethod = "";
      this.FUri = "";
      this.FHeaders = null;
      this.FContent = undefined;
      this.FTimeout = 0;
      this.FResponseType = "";
    };
    this.$final = function () {
      this.FHeaders = undefined;
      pas.System.TInterfacedObject.$final.call(this);
    };
    this.GetMethod = function () {
      var Result = "";
      Result = this.FMethod;
      return Result;
    };
    this.SetMethod = function (Value) {
      this.FMethod = pas.SysUtils.UpperCase(Value);
    };
    this.GetUri = function () {
      var Result = "";
      Result = this.FUri;
      return Result;
    };
    this.SetUri = function (Value) {
      this.FUri = Value;
    };
    this.GetTimeout = function () {
      var Result = 0;
      Result = this.FTimeout;
      return Result;
    };
    this.SetTimeout = function (Value) {
      this.FTimeout = Value;
    };
    this.GetHeaders = function () {
      var Result = null;
      Result = this.FHeaders;
      return Result;
    };
    this.GetContent = function () {
      var Result = undefined;
      Result = this.FContent;
      return Result;
    };
    this.SetContent = function (Value) {
      this.FContent = Value;
    };
    this.GetResponseType = function () {
      var Result = "";
      Result = this.FResponseType;
      return Result;
    };
    this.SetResponseType = function (Value) {
      this.FResponseType = Value;
    };
    this.Create$1 = function () {
      this.Create$3("","GET");
      return this;
    };
    this.Create$2 = function (AUri) {
      this.Create$3(AUri,"GET");
      return this;
    };
    this.Create$3 = function (AUri, AMethod) {
      this.FHeaders = pas["XData.Web.Headers"].THttpHeaders.$create("Create$1");
      this.FUri = AUri;
      this.FMethod = AMethod;
      this.FTimeout = 0;
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FHeaders");
      pas.System.TObject.Destroy.call(this);
    };
    rtl.addIntf(this,$mod.IHttpRequest);
    rtl.addIntf(this,pas.System.IUnknown);
  });
},["SysUtils"]);
rtl.module("XData.Web.Response",["System","XData.Web.Headers","Web"],function () {
  "use strict";
  var $mod = this;
  rtl.createInterface(this,"IHttpResponse","{4F5FBBEB-2D03-446F-AD75-FFF8DB09B0B0}",["GetStatusCode","GetStatusReason","GetHeaders","GetContentAsText","GetContent"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("GetStatusCode",1,[],2,rtl.longint);
    $r.addMethod("GetStatusReason",1,[],2,rtl.string);
    $r.addMethod("GetHeaders",1,[],2,pas["XData.Web.Headers"].$rtti["THttpHeaders"]);
    $r.addMethod("GetContentAsText",1,[],2,rtl.string);
    $r.addMethod("GetContent",1,[],2,rtl.jsvalue);
    $r.addProperty("StatusCode",1,rtl.longint,"GetStatusCode","",2);
    $r.addProperty("StatusReason",1,rtl.string,"GetStatusReason","",2);
    $r.addProperty("Headers",1,pas["XData.Web.Headers"].$rtti["THttpHeaders"],"GetHeaders","",2);
    $r.addProperty("ContentAsText",1,rtl.string,"GetContentAsText","",2);
    $r.addProperty("Content",1,rtl.jsvalue,"GetContent","",2);
  });
  rtl.createClass(this,"THttpResponse",pas.System.TInterfacedObject,function () {
    this.$init = function () {
      pas.System.TInterfacedObject.$init.call(this);
      this.FPrepared = false;
      this.FHeaders = null;
    };
    this.$final = function () {
      this.FHeaders = undefined;
      pas.System.TInterfacedObject.$final.call(this);
    };
    this.GetHeaders = function () {
      var Result = null;
      this.PrepareResponse();
      Result = this.FHeaders;
      return Result;
    };
    this.PrepareResponse = function () {
      if (this.FPrepared) return;
      this.FPrepared = true;
      this.UpdateHeaders(this.FHeaders);
    };
    this.Create$1 = function () {
      this.FHeaders = pas["XData.Web.Headers"].THttpHeaders.$create("Create$1");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FHeaders");
      pas.System.TObject.Destroy.call(this);
    };
    rtl.addIntf(this,$mod.IHttpResponse);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TXhrHttpResponse",this.THttpResponse,function () {
    this.$init = function () {
      $mod.THttpResponse.$init.call(this);
      this.FXhr = null;
    };
    this.$final = function () {
      this.FXhr = undefined;
      $mod.THttpResponse.$final.call(this);
    };
    this.GetStatusCode = function () {
      var Result = 0;
      Result = this.FXhr.status;
      return Result;
    };
    this.GetStatusReason = function () {
      var Result = "";
      Result = this.FXhr.statusText;
      return Result;
    };
    this.UpdateHeaders = function (AHeaders) {
      var I = 0;
      var SplitHeaders = [];
      var HeaderPair = [];
      SplitHeaders = pas.SysUtils.Trim(this.FXhr.getAllResponseHeaders()).split("\r\n");
      this.FHeaders.Clear();
      for (var $l = 0, $end = rtl.length(SplitHeaders) - 1; $l <= $end; $l++) {
        I = $l;
        HeaderPair = SplitHeaders[I].split(":");
        this.FHeaders.SetValue(pas.SysUtils.Trim(HeaderPair[0]),pas.SysUtils.Trim(HeaderPair[1]));
      };
    };
    this.GetContentAsText = function () {
      var Result = "";
      Result = this.FXhr.responseText;
      return Result;
    };
    this.GetContent = function () {
      var Result = undefined;
      Result = this.FXhr.response;
      return Result;
    };
    this.Create$2 = function (AXhr) {
      $mod.THttpResponse.Create$1.call(this);
      this.FXhr = AXhr;
      return this;
    };
    rtl.addIntf(this,$mod.IHttpResponse);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TDummyHttpResponse",this.THttpResponse,function () {
    this.GetStatusCode = function () {
      var Result = 0;
      Result = 0;
      return Result;
    };
    this.GetStatusReason = function () {
      var Result = "";
      Result = "";
      return Result;
    };
    this.UpdateHeaders = function (AHeaders) {
    };
    this.GetContentAsText = function () {
      var Result = "";
      Result = "";
      return Result;
    };
    this.GetContent = function () {
      var Result = undefined;
      Result = undefined;
      return Result;
    };
    rtl.addIntf(this,$mod.IHttpResponse);
    rtl.addIntf(this,pas.System.IUnknown);
  });
},["Types","SysUtils","JS"]);
rtl.module("StrUtils",["System","SysUtils","Types"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.AnsiResemblesText = function (AText, AOther) {
    var Result = false;
    if ($mod.AnsiResemblesProc != null) {
      Result = $mod.AnsiResemblesProc(AText,AOther)}
     else Result = false;
    return Result;
  };
  this.AnsiContainsText = function (AText, ASubText) {
    var Result = false;
    Result = pas.System.Pos(pas.SysUtils.UpperCase(ASubText),pas.SysUtils.UpperCase(AText)) > 0;
    return Result;
  };
  this.AnsiStartsText = function (ASubText, AText) {
    var Result = false;
    if ((AText.length >= ASubText.length) && (ASubText !== "")) {
      Result = pas.SysUtils.SameText(ASubText,pas.System.Copy(AText,1,ASubText.length))}
     else Result = false;
    return Result;
  };
  this.AnsiEndsText = function (ASubText, AText) {
    var Result = false;
    if (AText.length >= ASubText.length) {
      Result = pas.SysUtils.SameText(ASubText,$mod.RightStr(AText,ASubText.length))}
     else Result = false;
    return Result;
  };
  this.AnsiReplaceText = function (AText, AFromText, AToText) {
    var Result = "";
    Result = pas.SysUtils.StringReplace(AText,AFromText,AToText,rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll,pas.SysUtils.TStringReplaceFlag.rfIgnoreCase));
    return Result;
  };
  this.AnsiMatchText = function (AText, AValues) {
    var Result = false;
    Result = $mod.AnsiIndexText(AText,AValues) !== -1;
    return Result;
  };
  this.AnsiIndexText = function (AText, AValues) {
    var Result = 0;
    var i = 0;
    Result = -1;
    if (((rtl.length(AValues) - 1) === -1) || ((rtl.length(AValues) - 1) > 2147483647)) return Result;
    for (var $l = 0, $end = rtl.length(AValues) - 1; $l <= $end; $l++) {
      i = $l;
      if (pas.SysUtils.CompareText(AValues[i],AText) === 0) return i;
    };
    return Result;
  };
  this.StartsText = function (ASubText, AText) {
    var Result = false;
    Result = $mod.AnsiStartsText(ASubText,AText);
    return Result;
  };
  this.EndsText = function (ASubText, AText) {
    var Result = false;
    Result = $mod.AnsiEndsText(ASubText,AText);
    return Result;
  };
  this.ResemblesText = function (AText, AOther) {
    var Result = false;
    if ($mod.ResemblesProc != null) {
      Result = $mod.ResemblesProc(AText,AOther)}
     else Result = false;
    return Result;
  };
  this.ContainsText = function (AText, ASubText) {
    var Result = false;
    Result = $mod.AnsiContainsText(AText,ASubText);
    return Result;
  };
  this.MatchText = function (AText, AValues) {
    var Result = false;
    Result = $mod.AnsiMatchText(AText,AValues);
    return Result;
  };
  this.IndexText = function (AText, AValues) {
    var Result = 0;
    Result = $mod.AnsiIndexText(AText,AValues);
    return Result;
  };
  this.AnsiContainsStr = function (AText, ASubText) {
    var Result = false;
    Result = pas.System.Pos(ASubText,AText) > 0;
    return Result;
  };
  this.AnsiStartsStr = function (ASubText, AText) {
    var Result = false;
    if ((AText.length >= ASubText.length) && (ASubText !== "")) {
      Result = ASubText === pas.System.Copy(AText,1,ASubText.length)}
     else Result = false;
    return Result;
  };
  this.AnsiEndsStr = function (ASubText, AText) {
    var Result = false;
    if (AText.length >= ASubText.length) {
      Result = ASubText === $mod.RightStr(AText,ASubText.length)}
     else Result = false;
    return Result;
  };
  this.AnsiReplaceStr = function (AText, AFromText, AToText) {
    var Result = "";
    Result = pas.SysUtils.StringReplace(AText,AFromText,AToText,rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
    return Result;
  };
  this.AnsiMatchStr = function (AText, AValues) {
    var Result = false;
    Result = $mod.AnsiIndexStr(AText,AValues) !== -1;
    return Result;
  };
  this.AnsiIndexStr = function (AText, AValues) {
    var Result = 0;
    var i = 0;
    Result = -1;
    if (((rtl.length(AValues) - 1) === -1) || ((rtl.length(AValues) - 1) > 2147483647)) return Result;
    for (var $l = 0, $end = rtl.length(AValues) - 1; $l <= $end; $l++) {
      i = $l;
      if (AValues[i] === AText) return i;
    };
    return Result;
  };
  this.MatchStr = function (AText, AValues) {
    var Result = false;
    Result = $mod.IndexStr(AText,AValues) !== -1;
    return Result;
  };
  this.IndexStr = function (AText, AValues) {
    var Result = 0;
    var i = 0;
    Result = -1;
    if (((rtl.length(AValues) - 1) === -1) || ((rtl.length(AValues) - 1) > 2147483647)) return Result;
    for (var $l = 0, $end = rtl.length(AValues) - 1; $l <= $end; $l++) {
      i = $l;
      if (AValues[i] === AText) return i;
    };
    return Result;
  };
  this.ContainsStr = function (AText, ASubText) {
    var Result = false;
    Result = $mod.AnsiContainsStr(AText,ASubText);
    return Result;
  };
  this.StartsStr = function (ASubText, AText) {
    var Result = false;
    Result = $mod.AnsiStartsStr(ASubText,AText);
    return Result;
  };
  this.EndsStr = function (ASubText, AText) {
    var Result = false;
    Result = $mod.AnsiEndsStr(ASubText,AText);
    return Result;
  };
  this.DupeString = function (AText, ACount) {
    var Result = "";
    var i = 0;
    Result = "";
    for (var $l = 1, $end = ACount; $l <= $end; $l++) {
      i = $l;
      Result = Result + AText;
    };
    return Result;
  };
  this.ReverseString = function (AText) {
    var Result = "";
    var i = 0;
    var j = 0;
    Result = rtl.strSetLength(Result,AText.length);
    i = 1;
    j = AText.length;
    while (i <= j) {
      Result = rtl.setCharAt(Result,i - 1,AText.charAt(((j - i) + 1) - 1));
      i += 1;
    };
    return Result;
  };
  this.AnsiReverseString = function (AText) {
    var Result = "";
    Result = $mod.ReverseString(AText);
    return Result;
  };
  this.StuffString = function (AText, AStart, ALength, ASubText) {
    var Result = "";
    var i = 0;
    var j = 0;
    var k = 0;
    j = ASubText.length;
    i = AText.length;
    if (AStart > i) AStart = i + 1;
    k = (i + 1) - AStart;
    if (ALength > k) ALength = k;
    Result = rtl.strSetLength(Result,(i + j) - ALength);
    Result = pas.System.Copy(AText,1,AStart - 1) + pas.System.Copy(ASubText,1,j) + pas.System.Copy(AText,AStart + ALength,(i + 1) - AStart - ALength);
    return Result;
  };
  this.RandomFrom = function (AValues) {
    var Result = "";
    if ((rtl.length(AValues) - 1) === -1) return "";
    Result = AValues[pas.System.Random((rtl.length(AValues) - 1) + 1)];
    return Result;
  };
  this.IfThen = function (AValue, ATrue, AFalse) {
    var Result = "";
    if (AValue) {
      Result = ATrue}
     else Result = AFalse;
    return Result;
  };
  this.NaturalCompareText = function (S1, S2) {
    var Result = 0;
    Result = $mod.NaturalCompareText$1(S1,S2,pas.SysUtils.FormatSettings.DecimalSeparator,pas.SysUtils.FormatSettings.ThousandSeparator);
    return Result;
  };
  this.NaturalCompareText$1 = function (Str1, Str2, ADecSeparator, AThousandSeparator) {
    var Result = 0;
    var Num1 = 0.0;
    var Num2 = 0.0;
    var pStr1 = 0;
    var pStr2 = 0;
    var Len1 = 0;
    var Len2 = 0;
    var TextLen1 = 0;
    var TextLen2 = 0;
    var TextStr1 = "";
    var TextStr2 = "";
    var i = 0;
    var j = 0;
    function Sign(AValue) {
      var Result = 0;
      if (AValue < 0) {
        Result = -1}
       else if (AValue > 0) {
        Result = 1}
       else Result = 0;
      return Result;
    };
    function IsNumber(ch) {
      var Result = false;
      Result = ch.charCodeAt() in rtl.createSet(null,48,57);
      return Result;
    };
    function GetInteger(aString, pch, Len) {
      var Result = 0.0;
      Result = 0;
      while ((pch.get() <= aString.length) && IsNumber(aString.charAt(pch.get() - 1))) {
        Result = ((Result * 10) + aString.charCodeAt(pch.get() - 1)) - 48;
        Len.set(Len.get() + 1);
        pch.set(pch.get() + 1);
      };
      return Result;
    };
    function GetChars() {
      TextLen1 = 0;
      while (!(Str1.charCodeAt((pStr1 + TextLen1) - 1) in rtl.createSet(null,48,57)) && ((pStr1 + TextLen1) <= Str1.length)) TextLen1 += 1;
      TextStr1 = "";
      i = 1;
      j = 0;
      while (i <= TextLen1) {
        TextStr1 = TextStr1 + Str1.charAt((pStr1 + j) - 1);
        i += 1;
        j += 1;
      };
      TextLen2 = 0;
      while (!(Str2.charCodeAt((pStr2 + TextLen2) - 1) in rtl.createSet(null,48,57)) && ((pStr2 + TextLen2) <= Str2.length)) TextLen2 += 1;
      i = 1;
      j = 0;
      while (i <= TextLen2) {
        TextStr2 = TextStr2 + Str2.charAt((pStr2 + j) - 1);
        i += 1;
        j += 1;
      };
    };
    if ((Str1 !== "") && (Str2 !== "")) {
      pStr1 = 1;
      pStr2 = 1;
      Result = 0;
      while ((pStr1 <= Str1.length) && (pStr2 <= Str2.length)) {
        TextLen1 = 1;
        TextLen2 = 1;
        Len1 = 0;
        Len2 = 0;
        while (Str1.charAt(pStr1 - 1) === " ") {
          pStr1 += 1;
          Len1 += 1;
        };
        while (Str2.charAt(pStr2 - 1) === " ") {
          pStr2 += 1;
          Len2 += 1;
        };
        if (IsNumber(Str1.charAt(pStr1 - 1)) && IsNumber(Str2.charAt(pStr2 - 1))) {
          Num1 = GetInteger(Str1,{get: function () {
              return pStr1;
            }, set: function (v) {
              pStr1 = v;
            }},{get: function () {
              return Len1;
            }, set: function (v) {
              Len1 = v;
            }});
          Num2 = GetInteger(Str2,{get: function () {
              return pStr2;
            }, set: function (v) {
              pStr2 = v;
            }},{get: function () {
              return Len2;
            }, set: function (v) {
              Len2 = v;
            }});
          if (Num1 < Num2) {
            Result = -1}
           else if (Num1 > Num2) {
            Result = 1}
           else {
            Result = Sign(Len1 - Len2);
          };
          pStr1 -= 1;
          pStr2 -= 1;
        } else {
          GetChars();
          if (TextStr1 !== TextStr2) {
            Result = pas.SysUtils.CompareText(TextStr1,TextStr2)}
           else Result = 0;
        };
        if (Result !== 0) break;
        pStr1 += TextLen1;
        pStr2 += TextLen2;
      };
    };
    Num1 = Str1.length;
    Num2 = Str2.length;
    if ((Result === 0) && (Num1 !== Num2)) {
      if (Num1 < Num2) {
        Result = -1}
       else Result = 1;
    };
    if (ADecSeparator === "") ;
    if (AThousandSeparator === "") ;
    return Result;
  };
  this.LeftStr = function (AText, ACount) {
    var Result = "";
    Result = pas.System.Copy(AText,1,ACount);
    return Result;
  };
  this.RightStr = function (AText, ACount) {
    var Result = "";
    var j = 0;
    var l = 0;
    l = AText.length;
    j = ACount;
    if (j > l) j = l;
    Result = pas.System.Copy(AText,(l - j) + 1,j);
    return Result;
  };
  this.MidStr = function (AText, AStart, ACount) {
    var Result = "";
    if ((ACount === 0) || (AStart > AText.length)) return "";
    Result = pas.System.Copy(AText,AStart,ACount);
    return Result;
  };
  this.RightBStr = function (AText, AByteCount) {
    var Result = "";
    Result = $mod.RightStr(AText,AByteCount);
    return Result;
  };
  this.MidBStr = function (AText, AByteStart, AByteCount) {
    var Result = "";
    Result = $mod.MidStr(AText,AByteStart,AByteCount);
    return Result;
  };
  this.AnsiLeftStr = function (AText, ACount) {
    var Result = "";
    Result = pas.System.Copy(AText,1,ACount);
    return Result;
  };
  this.AnsiRightStr = function (AText, ACount) {
    var Result = "";
    Result = pas.System.Copy(AText,(AText.length - ACount) + 1,ACount);
    return Result;
  };
  this.AnsiMidStr = function (AText, AStart, ACount) {
    var Result = "";
    Result = pas.System.Copy(AText,AStart,ACount);
    return Result;
  };
  this.LeftBStr = function (AText, AByteCount) {
    var Result = "";
    Result = $mod.LeftStr(AText,AByteCount);
    return Result;
  };
  this.$rtti.$DynArray("WordDelimiters$a",{eltype: rtl.char});
  this.WordDelimiters = [];
  this.SErrAmountStrings = "Amount of search and replace strings don't match";
  this.SInvalidRomanNumeral = "%s is not a valid Roman numeral";
  this.TStringSearchOption = {"0": "soDown", soDown: 0, "1": "soMatchCase", soMatchCase: 1, "2": "soWholeWord", soWholeWord: 2};
  this.$rtti.$Enum("TStringSearchOption",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TStringSearchOption});
  this.$rtti.$Set("TStringSearchOptions",{comptype: this.$rtti["TStringSearchOption"]});
  this.PosEx = function (SubStr, S, Offset) {
    var Result = 0;
    Result = (new String(S)).indexOf(SubStr,Offset - 1) + 1;
    return Result;
  };
  this.PosEx$1 = function (SubStr, S) {
    var Result = 0;
    Result = $mod.PosEx(SubStr,S,1);
    return Result;
  };
  this.PosEx$2 = function (c, S, Offset) {
    var Result = 0;
    Result = (new String(S)).indexOf(c,Offset - 1) + 1;
    return Result;
  };
  this.StringsReplace = function (S, OldPattern, NewPattern, Flags) {
    var Result = "";
    var pc = 0;
    var pcc = 0;
    var lastpc = 0;
    var strcount = 0;
    var ResStr = "";
    var CompStr = "";
    var Found = false;
    var sc = 0;
    sc = rtl.length(OldPattern);
    if (sc !== rtl.length(NewPattern)) throw pas.SysUtils.Exception.$create("Create$1",[$mod.SErrAmountStrings]);
    sc -= 1;
    if (pas.SysUtils.TStringReplaceFlag.rfIgnoreCase in Flags) {
      CompStr = pas.SysUtils.UpperCase(S);
      for (var $l = 0, $end = sc; $l <= $end; $l++) {
        strcount = $l;
        OldPattern[strcount] = pas.SysUtils.UpperCase(OldPattern[strcount]);
      };
    } else CompStr = S;
    ResStr = "";
    pc = 1;
    pcc = 1;
    lastpc = pc + S.length;
    while (pc < lastpc) {
      Found = false;
      for (var $l1 = 0, $end1 = sc; $l1 <= $end1; $l1++) {
        strcount = $l1;
        if (pas.System.Copy(CompStr,pc,OldPattern[strcount].length) === OldPattern[strcount]) {
          ResStr = ResStr + NewPattern[strcount];
          pc = pc + OldPattern[strcount].length;
          pcc = pcc + OldPattern[strcount].length;
          Found = true;
        };
      };
      if (!Found) {
        ResStr = ResStr + S.charAt(pcc - 1);
        pc += 1;
        pcc += 1;
      } else if (!(pas.SysUtils.TStringReplaceFlag.rfReplaceAll in Flags)) {
        ResStr = ResStr + pas.System.Copy(S,pcc,(S.length - pcc) + 1);
        break;
      };
    };
    Result = ResStr;
    return Result;
  };
  this.ReplaceStr = function (AText, AFromText, AToText) {
    var Result = "";
    Result = $mod.AnsiReplaceStr(AText,AFromText,AToText);
    return Result;
  };
  this.ReplaceText = function (AText, AFromText, AToText) {
    var Result = "";
    Result = $mod.AnsiReplaceText(AText,AFromText,AToText);
    return Result;
  };
  this.$rtti.$Int("TSoundexLength",{minvalue: 1, maxvalue: 2147483647, ordtype: 5});
  this.Soundex = function (AText, ALength) {
    var Result = "";
    var S = "\x00";
    var PS = "\x00";
    var I = 0;
    var L = 0;
    Result = "";
    PS = "\x00";
    if (AText.length > 0) {
      Result = pas.System.upcase(AText.charAt(0));
      I = 2;
      L = AText.length;
      while ((I <= L) && (Result.length < ALength)) {
        S = $impl.SScore.charAt(AText.charCodeAt(I - 1) - 1);
        if (!(S.charCodeAt() in rtl.createSet(48,105,PS.charCodeAt()))) Result = Result + S;
        if (S !== "i") PS = S;
        I += 1;
      };
    };
    L = Result.length;
    if (L < ALength) Result = Result + pas.System.StringOfChar("0",ALength - L);
    return Result;
  };
  this.Soundex$1 = function (AText) {
    var Result = "";
    Result = $mod.Soundex(AText,4);
    return Result;
  };
  this.$rtti.$Int("TSoundexIntLength",{minvalue: 1, maxvalue: 8, ordtype: 1});
  this.SoundexInt = function (AText, ALength) {
    var Result = 0;
    var SE = "";
    var I = 0;
    Result = -1;
    SE = $mod.Soundex(AText,ALength);
    if (SE.length > 0) {
      Result = SE.charCodeAt(1 - 1) - 65;
      if (ALength > 1) {
        Result = (Result * 26) + (SE.charCodeAt(2 - 1) - 48);
        for (var $l = 3, $end = ALength; $l <= $end; $l++) {
          I = $l;
          Result = (SE.charCodeAt(I - 1) - 48) + (Result * 7);
        };
      };
      Result = ALength + (Result * 9);
    };
    return Result;
  };
  this.SoundexInt$1 = function (AText) {
    var Result = 0;
    Result = $mod.SoundexInt(AText,4);
    return Result;
  };
  this.DecodeSoundexInt = function (AValue) {
    var Result = "";
    var I = 0;
    var Len = 0;
    Result = "";
    Len = AValue % 9;
    AValue = rtl.trunc(AValue / 9);
    for (var $l = Len; $l >= 3; $l--) {
      I = $l;
      Result = String.fromCharCode(48 + (AValue % 7)) + Result;
      AValue = rtl.trunc(AValue / 7);
    };
    if (Len > 1) {
      Result = String.fromCharCode(48 + (AValue % 26)) + Result;
      AValue = rtl.trunc(AValue / 26);
    };
    Result = String.fromCharCode(65 + AValue) + Result;
    return Result;
  };
  this.SoundexWord = function (AText) {
    var Result = 0;
    var S = "";
    S = $mod.Soundex(AText,4);
    Result = S.charCodeAt(1 - 1) - 65;
    Result = ((Result * 26) + S.charCodeAt(2 - 1)) - 48;
    Result = ((Result * 7) + S.charCodeAt(3 - 1)) - 48;
    Result = ((Result * 7) + S.charCodeAt(4 - 1)) - 48;
    return Result;
  };
  this.DecodeSoundexWord = function (AValue) {
    var Result = "";
    Result = String.fromCharCode(48 + (AValue % 7));
    AValue = rtl.trunc(AValue / 7);
    Result = String.fromCharCode(48 + (AValue % 7)) + Result;
    AValue = rtl.trunc(AValue / 7);
    Result = pas.SysUtils.IntToStr(AValue % 26) + Result;
    AValue = rtl.trunc(AValue / 26);
    Result = String.fromCharCode(65 + AValue) + Result;
    return Result;
  };
  this.SoundexSimilar = function (AText, AOther, ALength) {
    var Result = false;
    Result = $mod.Soundex(AText,ALength) === $mod.Soundex(AOther,ALength);
    return Result;
  };
  this.SoundexSimilar$1 = function (AText, AOther) {
    var Result = false;
    Result = $mod.SoundexSimilar(AText,AOther,4);
    return Result;
  };
  this.SoundexCompare = function (AText, AOther, ALength) {
    var Result = 0;
    Result = pas.SysUtils.AnsiCompareStr($mod.Soundex(AText,ALength),$mod.Soundex(AOther,ALength));
    return Result;
  };
  this.SoundexCompare$1 = function (AText, AOther) {
    var Result = 0;
    Result = $mod.SoundexCompare(AText,AOther,4);
    return Result;
  };
  this.SoundexProc = function (AText, AOther) {
    var Result = false;
    Result = $mod.SoundexSimilar$1(AText,AOther);
    return Result;
  };
  this.$rtti.$ProcVar("TCompareTextProc",{procsig: rtl.newTIProcSig([["AText",rtl.string,2],["AOther",rtl.string,2]],rtl.boolean)});
  this.AnsiResemblesProc = null;
  this.ResemblesProc = null;
  this.TRomanConversionStrictness = {"0": "rcsStrict", rcsStrict: 0, "1": "rcsRelaxed", rcsRelaxed: 1, "2": "rcsDontCare", rcsDontCare: 2};
  this.$rtti.$Enum("TRomanConversionStrictness",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TRomanConversionStrictness});
  this.IsEmptyStr = function (S, EmptyChars) {
    var Result = false;
    var i = 0;
    var l = 0;
    l = S.length;
    i = 1;
    Result = true;
    while (Result && (i <= l)) {
      Result = pas.SysUtils.CharInSet(S.charAt(i - 1),EmptyChars);
      i += 1;
    };
    return Result;
  };
  this.DelSpace = function (S) {
    var Result = "";
    Result = $mod.DelChars(S," ");
    return Result;
  };
  this.DelChars = function (S, Chr) {
    var Result = "";
    var I = 0;
    var J = 0;
    Result = S;
    I = Result.length;
    while (I > 0) {
      if (Result.charAt(I - 1) === Chr) {
        J = I - 1;
        while ((J > 0) && (Result.charAt(J - 1) === Chr)) J -= 1;
        pas.System.Delete({get: function () {
            return Result;
          }, set: function (v) {
            Result = v;
          }},J + 1,I - J);
        I = J + 1;
      };
      I -= 1;
    };
    return Result;
  };
  this.DelSpace1 = function (S) {
    var Result = "";
    var I = 0;
    Result = S;
    for (var $l = Result.length; $l >= 2; $l--) {
      I = $l;
      if ((Result.charAt(I - 1) === " ") && (Result.charAt(I - 1 - 1) === " ")) pas.System.Delete({get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }},I,1);
    };
    return Result;
  };
  this.Tab2Space = function (S, Numb) {
    var Result = "";
    var I = 0;
    I = 1;
    Result = S;
    while (I <= Result.length) if (Result.charAt(I - 1) !== String.fromCharCode(9)) {
      I += 1}
     else {
      Result = rtl.setCharAt(Result,I - 1," ");
      if (Numb > 1) pas.System.Insert(pas.System.StringOfChar(" ",Numb - 1),{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }},I);
      I += Numb;
    };
    return Result;
  };
  this.NPos = function (C, S, N) {
    var Result = 0;
    var i = 0;
    var p = 0;
    var k = 0;
    Result = 0;
    if (N < 1) return Result;
    k = 0;
    i = 1;
    do {
      p = pas.System.Pos(C,S);
      k += p;
      if (p > 0) pas.System.Delete({get: function () {
          return S;
        }, set: function (v) {
          S = v;
        }},1,p);
      i += 1;
    } while (!((i > N) || (p === 0)));
    if (p > 0) Result = k;
    return Result;
  };
  this.RPosEX = function (C, S, offs) {
    var Result = 0;
    Result = (new String(S)).lastIndexOf(C,offs - 1) + 1;
    return Result;
  };
  this.RPosex$1 = function (Substr, Source, offs) {
    var Result = 0;
    Result = (new String(Source)).lastIndexOf(Substr,offs - 1) + 1;
    return Result;
  };
  this.RPos = function (c, S) {
    var Result = 0;
    Result = $mod.RPosex$1(c,S,S.length);
    return Result;
  };
  this.RPos$1 = function (Substr, Source) {
    var Result = 0;
    Result = $mod.RPosex$1(Substr,Source,Source.length);
    return Result;
  };
  this.AddChar = function (C, S, N) {
    var Result = "";
    var l = 0;
    Result = S;
    l = Result.length;
    if (l < N) Result = pas.System.StringOfChar(C,N - l) + Result;
    return Result;
  };
  this.AddCharR = function (C, S, N) {
    var Result = "";
    var l = 0;
    Result = S;
    l = Result.length;
    if (l < N) Result = Result + pas.System.StringOfChar(C,N - l);
    return Result;
  };
  this.PadLeft = function (S, N) {
    var Result = "";
    Result = $mod.AddChar(" ",S,N);
    return Result;
  };
  this.PadRight = function (S, N) {
    var Result = "";
    Result = $mod.AddCharR(" ",S,N);
    return Result;
  };
  this.PadCenter = function (S, Len) {
    var Result = "";
    if (S.length < Len) {
      Result = pas.System.StringOfChar(" ",rtl.trunc(Len / 2) - rtl.trunc(S.length / 2)) + S;
      Result = Result + pas.System.StringOfChar(" ",Len - Result.length);
    } else Result = S;
    return Result;
  };
  this.Copy2Symb = function (S, Symb) {
    var Result = "";
    var p = 0;
    p = pas.System.Pos(Symb,S);
    if (p === 0) p = S.length + 1;
    Result = pas.System.Copy(S,1,p - 1);
    return Result;
  };
  this.Copy2SymbDel = function (S, Symb) {
    var Result = "";
    var p = 0;
    p = pas.System.Pos(Symb,S.get());
    if (p === 0) {
      Result = S.get();
      S.set("");
    } else {
      Result = pas.System.Copy(S.get(),1,p - 1);
      pas.System.Delete(S,1,p);
    };
    return Result;
  };
  this.Copy2Space = function (S) {
    var Result = "";
    Result = $mod.Copy2Symb(S," ");
    return Result;
  };
  this.Copy2SpaceDel = function (S) {
    var Result = "";
    Result = $mod.Copy2SymbDel(S," ");
    return Result;
  };
  this.AnsiProperCase = function (S, WordDelims) {
    var Result = "";
    var P = 0;
    var L = 0;
    Result = pas.SysUtils.LowerCase(S);
    P = 1;
    L = Result.length;
    while (P <= L) {
      while ((P <= L) && pas.SysUtils.CharInSet(Result.charAt(P - 1),WordDelims)) P += 1;
      if (P <= L) Result = rtl.setCharAt(Result,P - 1,pas.System.upcase(Result.charAt(P - 1)));
      while ((P <= L) && !pas.SysUtils.CharInSet(Result.charAt(P - 1),WordDelims)) P += 1;
    };
    return Result;
  };
  this.WordCount = function (S, WordDelims) {
    var Result = 0;
    var P = 0;
    var L = 0;
    Result = 0;
    P = 1;
    L = S.length;
    while (P <= L) {
      while ((P <= L) && pas.SysUtils.CharInSet(S.charAt(P - 1),WordDelims)) P += 1;
      if (P <= L) Result += 1;
      while ((P <= L) && !pas.SysUtils.CharInSet(S.charAt(P - 1),WordDelims)) P += 1;
    };
    return Result;
  };
  this.WordPosition = function (N, S, WordDelims) {
    var Result = 0;
    var PS = 0;
    var P = 0;
    var PE = 0;
    var Count = 0;
    Result = 0;
    Count = 0;
    PS = 1;
    PE = S.length;
    P = PS;
    while ((P <= PE) && (Count !== N)) {
      while ((P <= PE) && pas.SysUtils.CharInSet(S.charAt(P - 1),WordDelims)) P += 1;
      if (P <= PE) Count += 1;
      if (Count !== N) {
        while ((P <= PE) && !pas.SysUtils.CharInSet(S.charAt(P - 1),WordDelims)) P += 1}
       else Result = (P - PS) + 1;
    };
    return Result;
  };
  this.ExtractWord = function (N, S, WordDelims) {
    var Result = "";
    var i = 0;
    Result = $mod.ExtractWordPos(N,S,WordDelims,{get: function () {
        return i;
      }, set: function (v) {
        i = v;
      }});
    return Result;
  };
  this.ExtractWordPos = function (N, S, WordDelims, Pos) {
    var Result = "";
    var i = 0;
    var j = 0;
    var l = 0;
    j = 0;
    i = $mod.WordPosition(N,S,WordDelims);
    if (i > 2147483647) {
      Result = "";
      Pos.set(-1);
      return Result;
    };
    Pos.set(i);
    if (i !== 0) {
      j = i;
      l = S.length;
      while ((j <= l) && !pas.SysUtils.CharInSet(S.charAt(j - 1),WordDelims)) j += 1;
    };
    Result = pas.System.Copy(S,i,j - i);
    return Result;
  };
  this.ExtractDelimited = function (N, S, Delims) {
    var Result = "";
    var w = 0;
    var i = 0;
    var l = 0;
    var len = 0;
    w = 0;
    i = 1;
    l = 0;
    len = S.length;
    Result = rtl.strSetLength(Result,0);
    while ((i <= len) && (w !== N)) {
      if (pas.SysUtils.CharInSet(S.charAt(i - 1),Delims)) {
        w += 1}
       else {
        if ((N - 1) === w) {
          l += 1;
          Result = Result + S.charAt(i - 1);
        };
      };
      i += 1;
    };
    return Result;
  };
  this.ExtractSubstr = function (S, Pos, Delims) {
    var Result = "";
    var i = 0;
    var l = 0;
    i = Pos.get();
    l = S.length;
    while ((i <= l) && !pas.SysUtils.CharInSet(S.charAt(i - 1),Delims)) i += 1;
    Result = pas.System.Copy(S,Pos.get(),i - Pos.get());
    while ((i <= l) && pas.SysUtils.CharInSet(S.charAt(i - 1),Delims)) i += 1;
    if (i > 2147483647) {
      Pos.set(2147483647)}
     else Pos.set(i);
    return Result;
  };
  this.IsWordPresent = function (W, S, WordDelims) {
    var Result = false;
    var i = 0;
    var Count = 0;
    Result = false;
    Count = $mod.WordCount(S,WordDelims);
    i = 1;
    while (!Result && (i <= Count)) {
      Result = $mod.ExtractWord(i,S,WordDelims) === W;
      i += 1;
    };
    return Result;
  };
  this.FindPart = function (HelpWilds, InputStr) {
    var Result = 0;
    var Diff = 0;
    var i = 0;
    var J = 0;
    Result = 0;
    i = pas.System.Pos("?",HelpWilds);
    if (i === 0) {
      Result = pas.System.Pos(HelpWilds,InputStr)}
     else {
      Diff = InputStr.length - HelpWilds.length;
      for (var $l = 0, $end = Diff; $l <= $end; $l++) {
        i = $l;
        for (var $l1 = 1, $end1 = HelpWilds.length; $l1 <= $end1; $l1++) {
          J = $l1;
          if ((InputStr.charAt((i + J) - 1) === HelpWilds.charAt(J - 1)) || (HelpWilds.charAt(J - 1) === "?")) {
            if (J === HelpWilds.length) {
              Result = i + 1;
              return Result;
            };
          } else break;
        };
      };
    };
    return Result;
  };
  this.IsWild = function (InputStr, Wilds, IgnoreCase) {
    var Result = false;
    var i = 0;
    var MaxinputWord = 0;
    var MaxWilds = 0;
    var eos = false;
    Result = true;
    if (Wilds === InputStr) return Result;
    i = pas.System.Pos("**",Wilds);
    while (i > 0) {
      pas.System.Delete({get: function () {
          return Wilds;
        }, set: function (v) {
          Wilds = v;
        }},i,1);
      i = pas.System.Pos("**",Wilds);
    };
    if (Wilds === "*") return Result;
    MaxinputWord = InputStr.length;
    MaxWilds = Wilds.length;
    if ((MaxWilds === 0) || (MaxinputWord === 0)) {
      Result = false;
      return Result;
    };
    if (IgnoreCase) {
      InputStr = pas.SysUtils.UpperCase(InputStr);
      Wilds = pas.SysUtils.UpperCase(Wilds);
    };
    Result = $impl.isMatch(1,InputStr,Wilds,1,1,MaxinputWord,MaxWilds,{get: function () {
        return eos;
      }, set: function (v) {
        eos = v;
      }});
    return Result;
  };
  this.XorString = function (Key, Src) {
    var Result = "";
    var i = 0;
    Result = Src;
    if (Key.length > 0) for (var $l = 1, $end = Src.length; $l <= $end; $l++) {
      i = $l;
      Result = rtl.setCharAt(Result,i - 1,String.fromCharCode(Key.charCodeAt((1 + ((i - 1) % Key.length)) - 1) ^ Src.charCodeAt(i - 1)));
    };
    return Result;
  };
  this.XorEncode = function (Key, Source) {
    var Result = "";
    var i = 0;
    var C = 0;
    Result = "";
    for (var $l = 1, $end = Source.length; $l <= $end; $l++) {
      i = $l;
      if (Key.length > 0) {
        C = Key.charCodeAt((1 + ((i - 1) % Key.length)) - 1) ^ Source.charCodeAt(i - 1)}
       else C = Source.charCodeAt(i - 1);
      Result = Result + pas.SysUtils.LowerCase(pas.SysUtils.IntToHex(C,2));
    };
    return Result;
  };
  this.XorDecode = function (Key, Source) {
    var Result = "";
    var i = 0;
    var C = "\x00";
    Result = "";
    for (var $l = 0, $end = rtl.trunc(Source.length / 2) - 1; $l <= $end; $l++) {
      i = $l;
      C = String.fromCharCode(pas.SysUtils.StrToIntDef("$" + pas.System.Copy(Source,(i * 2) + 1,2),32));
      if (Key.length > 0) C = String.fromCharCode(Key.charCodeAt((1 + (i % Key.length)) - 1) ^ C.charCodeAt());
      Result = Result + C;
    };
    return Result;
  };
  this.GetCmdLineArg = function (Switch, SwitchChars) {
    var Result = "";
    var i = 0;
    var S = "";
    i = 1;
    Result = "";
    while ((Result === "") && (i <= pas.System.ParamCount())) {
      S = pas.System.ParamStr(i);
      if ((rtl.length(SwitchChars) === 0) || (pas.SysUtils.CharInSet(S.charAt(0),SwitchChars) && (S.length > 1) && (pas.SysUtils.CompareText(pas.System.Copy(S,2,S.length - 1),Switch) === 0))) {
        i += 1;
        if (i <= pas.System.ParamCount()) Result = pas.System.ParamStr(i);
      };
      i += 1;
    };
    return Result;
  };
  this.Numb2USA = function (S) {
    var Result = "";
    var i = 0;
    var NA = 0;
    i = S.length;
    Result = S;
    NA = 0;
    while (i > 0) {
      if ((((((Result.length - i) + 1) - NA) % 3) === 0) && (i !== 1)) {
        pas.System.Insert(",",{get: function () {
            return Result;
          }, set: function (v) {
            Result = v;
          }},i);
        NA += 1;
      };
      i -= 1;
    };
    return Result;
  };
  this.Hex2Dec = function (S) {
    var Result = 0;
    var HexStr = "";
    if (pas.System.Pos("$",S) === 0) {
      HexStr = "$" + S}
     else HexStr = S;
    Result = pas.SysUtils.StrToInt(HexStr);
    return Result;
  };
  this.Dec2Numb = function (N, Len, Base) {
    var Result = "";
    var C = 0;
    var number = 0;
    if (N === 0) {
      Result = "0"}
     else {
      number = N;
      Result = "";
      while (number > 0) {
        C = number % Base;
        if (C > 9) {
          C = C + 55}
         else C = C + 48;
        Result = String.fromCharCode(C) + Result;
        number = rtl.trunc(number / Base);
      };
    };
    if (Result !== "") Result = $mod.AddChar("0",Result,Len);
    return Result;
  };
  this.Numb2Dec = function (S, Base) {
    var Result = 0;
    var i = 0;
    var P = 0;
    i = S.length;
    Result = 0;
    S = pas.SysUtils.UpperCase(S);
    P = 1;
    while (i >= 1) {
      if (S.charAt(i - 1) > "@") {
        Result = Result + ((S.charCodeAt(i - 1) - 55) * P)}
       else Result = Result + ((S.charCodeAt(i - 1) - 48) * P);
      i -= 1;
      P = P * Base;
    };
    return Result;
  };
  this.IntToBin = function (Value, Digits, Spaces) {
    var Result = "";
    var endpos = 0;
    var p = 0;
    var p2 = 0;
    var k = 0;
    Result = "";
    if (Digits > 32) Digits = 32;
    if (Spaces === 0) {
      Result = $mod.IntToBin$1(Value,Digits);
      return Result;
    };
    endpos = Digits + rtl.trunc((Digits - 1) / Spaces);
    Result = rtl.strSetLength(Result,endpos);
    p = endpos;
    p2 = 1;
    k = Spaces;
    while (p >= p2) {
      if (k === 0) {
        Result = rtl.setCharAt(Result,p - 1," ");
        p -= 1;
        k = Spaces;
      };
      Result = rtl.setCharAt(Result,p - 1,String.fromCharCode(48 + ((Value >>> 0) & 1)));
      Value = rtl.lw((Value >>> 0) >>> 1);
      p -= 1;
      k -= 1;
    };
    return Result;
  };
  this.IntToBin$1 = function (Value, Digits) {
    var Result = "";
    var p = 0;
    var p2 = 0;
    Result = "";
    if (Digits <= 0) return Result;
    Result = rtl.strSetLength(Result,Digits);
    p = Digits;
    p2 = 1;
    while ((p >= p2) && ((Value >>> 0) > 0)) {
      Result = rtl.setCharAt(Result,p - 1,String.fromCharCode(48 + ((Value >>> 0) & 1)));
      Value = rtl.lw((Value >>> 0) >>> 1);
      p -= 1;
    };
    Digits = (p - p2) + 1;
    while (Digits > 0) {
      Result = rtl.setCharAt(Result,Digits - 1,String.fromCharCode(48));
      Digits -= 1;
    };
    return Result;
  };
  this.IntToBin$2 = function (Value, Digits) {
    var Result = "";
    var p = 0;
    var p2 = 0;
    Result = "";
    if (Digits <= 0) return Result;
    Result = rtl.strSetLength(Result,Digits);
    p = Digits;
    p2 = 1;
    while ((p >= p2) && (Value > 0)) {
      Result = rtl.setCharAt(Result,p - 1,String.fromCharCode(48 + ((Value >>> 0) & 1)));
      Value = rtl.trunc(Value / 2);
      p -= 1;
    };
    Digits = (p - p2) + 1;
    while (Digits > 0) Result = rtl.setCharAt(Result,Digits - 1,"0");
    return Result;
  };
  var Arabics = [1,4,5,9,10,40,50,90,100,400,500,900,1000];
  var Romans = ["I","IV","V","IX","X","XL","L","XC","C","CD","D","CM","M"];
  this.IntToRoman = function (Value) {
    var Result = "";
    var i = 0;
    Result = "";
    for (var $l = 13; $l >= 1; $l--) {
      i = $l;
      while (Value >= Arabics[i - 1]) {
        Value = Value - Arabics[i - 1];
        Result = Result + Romans[i - 1];
      };
    };
    return Result;
  };
  this.TryRomanToInt = function (S, N, Strictness) {
    var Result = false;
    var i = 0;
    var Len = 0;
    var Terminated = false;
    Result = false;
    S = pas.SysUtils.UpperCase(S);
    Len = S.length;
    if (Strictness === $mod.TRomanConversionStrictness.rcsDontCare) {
      N.set($impl.RomanToIntDontCare(S));
      if (N.get() === 0) {
        Result = Len === 0;
      } else Result = true;
      return Result;
    };
    if (Len === 0) return Result;
    i = 1;
    N.set(0);
    Terminated = false;
    while ((i <= Len) && ((Strictness !== $mod.TRomanConversionStrictness.rcsStrict) || (i < 4)) && (S.charAt(i - 1) === "M")) {
      i += 1;
      N.set(N.get() + 1000);
    };
    if ((i <= Len) && (S.charAt(i - 1) === "D")) {
      i += 1;
      N.set(N.get() + 500);
    } else if (((i + 1) <= Len) && (S.charAt(i - 1) === "C")) {
      if (S.charAt((i + 1) - 1) === "M") {
        i += 2;
        N.set(N.get() + 900);
      } else if (S.charAt((i + 1) - 1) === "D") {
        i += 2;
        N.set(N.get() + 400);
      };
    };
    if ((i <= Len) && (S.charAt(i - 1) === "C")) {
      i += 1;
      N.set(N.get() + 100);
      if ((i <= Len) && (S.charAt(i - 1) === "C")) {
        i += 1;
        N.set(N.get() + 100);
      };
      if ((i <= Len) && (S.charAt(i - 1) === "C")) {
        i += 1;
        N.set(N.get() + 100);
      };
      if ((Strictness !== $mod.TRomanConversionStrictness.rcsStrict) && (i <= Len) && (S.charAt(i - 1) === "C")) {
        i += 1;
        N.set(N.get() + 100);
      };
    };
    if (((i + 1) <= Len) && (S.charAt(i - 1) === "X")) {
      if (S.charAt((i + 1) - 1) === "C") {
        i += 2;
        N.set(N.get() + 90);
      } else if (S.charAt((i + 1) - 1) === "L") {
        i += 2;
        N.set(N.get() + 40);
      };
    };
    if ((i <= Len) && (S.charAt(i - 1) === "L")) {
      i += 1;
      N.set(N.get() + 50);
    };
    if ((i <= Len) && (S.charAt(i - 1) === "X")) {
      i += 1;
      N.set(N.get() + 10);
      if ((i <= Len) && (S.charAt(i - 1) === "X")) {
        i += 1;
        N.set(N.get() + 10);
      };
      if ((i <= Len) && (S.charAt(i - 1) === "X")) {
        i += 1;
        N.set(N.get() + 10);
      };
      if ((Strictness !== $mod.TRomanConversionStrictness.rcsStrict) && (i <= Len) && (S.charAt(i - 1) === "X")) {
        i += 1;
        N.set(N.get() + 10);
      };
    };
    if (((i + 1) <= Len) && (S.charAt(i - 1) === "I")) {
      if (S.charAt((i + 1) - 1) === "X") {
        Terminated = true;
        i += 2;
        N.set(N.get() + 9);
      } else if (S.charAt((i + 1) - 1) === "V") {
        Terminated = true;
        i += 2;
        N.set(N.get() + 4);
      };
    };
    if (!Terminated && (i <= Len) && (S.charAt(i - 1) === "V")) {
      i += 1;
      N.set(N.get() + 5);
    };
    if (!Terminated && (i <= Len) && (S.charAt(i - 1) === "I")) {
      Terminated = true;
      i += 1;
      N.set(N.get() + 1);
      if ((i <= Len) && (S.charAt(i - 1) === "I")) {
        i += 1;
        N.set(N.get() + 1);
      };
      if ((i <= Len) && (S.charAt(i - 1) === "I")) {
        i += 1;
        N.set(N.get() + 1);
      };
      if ((Strictness !== $mod.TRomanConversionStrictness.rcsStrict) && (i <= Len) && (S.charAt(i - 1) === "I")) {
        i += 1;
        N.set(N.get() + 1);
      };
    };
    Result = i > Len;
    return Result;
  };
  this.RomanToInt = function (S, Strictness) {
    var Result = 0;
    if (!$mod.TryRomanToInt(S,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }},Strictness)) throw pas.SysUtils.EConvertError.$create("CreateFmt",[$mod.SInvalidRomanNumeral,pas.System.VarRecs(18,S)]);
    return Result;
  };
  this.RomanToIntDef = function (S, ADefault, Strictness) {
    var Result = 0;
    if (!$mod.TryRomanToInt(S,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }},Strictness)) Result = ADefault;
    return Result;
  };
  this.DigitChars = rtl.createSet(null,48,57);
  this.Brackets = rtl.createSet(40,41,91,93,123,125);
  this.StdWordDelims = rtl.unionSet(rtl.createSet(null,0,32,44,46,59,47,92,58,39,34,96),this.Brackets);
  this.StdSwitchChars = rtl.createSet(45,47);
  this.PosSet = function (c, s) {
    var Result = 0;
    Result = $mod.PosSetEx(c,s,1);
    return Result;
  };
  this.PosSet$1 = function (c, s) {
    var Result = 0;
    Result = $mod.PosSetEx$1(c,s,1);
    return Result;
  };
  this.PosSetEx = function (c, s, count) {
    var Result = 0;
    var i = 0;
    var j = 0;
    if (s === "") {
      j = 0}
     else {
      i = s.length;
      j = count;
      if (j > i) {
        Result = 0;
        return Result;
      };
      while ((j <= i) && !pas.SysUtils.CharInSet(s.charAt(j - 1),c)) j += 1;
      if (j > i) j = 0;
    };
    Result = j;
    return Result;
  };
  this.PosSetEx$1 = function (c, s, count) {
    var Result = 0;
    var cset = [];
    var i = 0;
    var l = 0;
    l = c.length;
    cset = rtl.arraySetLength(cset,"\x00",l);
    if (l > 0) for (var $l = 1, $end = l; $l <= $end; $l++) {
      i = $l;
      cset[i - 1] = c.charAt(i - 1);
    };
    Result = $mod.PosSetEx(cset,s,count);
    return Result;
  };
  this.Removeleadingchars = function (S, CSet) {
    var I = 0;
    var J = 0;
    I = S.get().length;
    if (I > 0) {
      J = 1;
      while ((J <= I) && pas.SysUtils.CharInSet(S.get().charAt(J - 1),CSet)) J += 1;
      if (J > 1) pas.System.Delete(S,1,J - 1);
    };
  };
  this.RemoveTrailingChars = function (S, CSet) {
    var i = 0;
    var j = 0;
    i = S.get().length;
    if (i > 0) {
      j = i;
      while ((j > 0) && pas.SysUtils.CharInSet(S.get().charAt(j - 1),CSet)) j -= 1;
      if (j !== i) S.set(rtl.strSetLength(S.get(),j));
    };
  };
  this.RemovePadChars = function (S, CSet) {
    var I = 0;
    var J = 0;
    var K = 0;
    I = S.get().length;
    if (I === 0) return;
    J = I;
    while ((J > 0) && pas.SysUtils.CharInSet(S.get().charAt(J - 1),CSet)) J -= 1;
    if (J === 0) {
      S.set("");
      return;
    };
    S.set(rtl.strSetLength(S.get(),J));
    I = J;
    K = 1;
    while ((K <= I) && pas.SysUtils.CharInSet(S.get().charAt(K - 1),CSet)) K += 1;
    if (K > 1) pas.System.Delete(S,1,K - 1);
  };
  this.TrimLeftSet = function (S, CSet) {
    var Result = "";
    Result = S;
    $mod.Removeleadingchars({get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }},CSet);
    return Result;
  };
  this.TrimRightSet = function (S, CSet) {
    var Result = "";
    Result = S;
    $mod.RemoveTrailingChars({get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }},CSet);
    return Result;
  };
  this.TrimSet = function (S, CSet) {
    var Result = "";
    Result = S;
    $mod.RemovePadChars({get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }},CSet);
    return Result;
  };
  this.SplitString = function (S, Delimiters) {
    var Result = [];
    Result = pas.SysUtils.TStringHelper.Split.call({get: function () {
        return S;
      }, set: function (v) {
        rtl.raiseE("EPropReadOnly");
      }},Delimiters);
    return Result;
  };
  this.$rtti.$DynArray("SizeIntArray",{eltype: rtl.nativeint});
  $mod.$implcode = function () {
    $impl.SScore = "00000000000000000000000000000000" + "00000000000000000000000000000000" + "0123012i02245501262301i2i2" + "000000" + "0123012i02245501262301i2i2" + "00000000000000000000000000000000" + "00000000000000000000000000000000" + "00000000000000000000000000000000" + "00000000000000000000000000000000" + "00000";
    $impl.Ord0 = 48;
    $impl.OrdA = 65;
    $impl.RomanValues = function (C) {
      var Result = 0;
      var $tmp = C;
      if ($tmp === "C") {
        Result = 100}
       else if ($tmp === "D") {
        Result = 500}
       else if ($tmp === "I") {
        Result = 1}
       else if ($tmp === "L") {
        Result = 50}
       else if ($tmp === "M") {
        Result = 1000}
       else if ($tmp === "V") {
        Result = 5}
       else if ($tmp === "X") {
        Result = 10}
       else {
        Result = 0;
      };
      return Result;
    };
    var RomanChars = rtl.createSet(67,68,73,76,77,86,88);
    $impl.RomanToIntDontCare = function (S) {
      var Result = 0;
      var index = "\x00";
      var Next = "\x00";
      var i = 0;
      var l = 0;
      var Negative = false;
      Result = 0;
      i = 0;
      Negative = (S.length > 0) && (S.charAt(0) === "-");
      if (Negative) i += 1;
      l = S.length;
      while (i < l) {
        i += 1;
        index = pas.System.upcase(S.charAt(i - 1));
        if (index.charCodeAt() in RomanChars) {
          if ((i + 1) <= l) {
            Next = pas.System.upcase(S.charAt((i + 1) - 1))}
           else Next = "\x00";
          if ((Next.charCodeAt() in RomanChars) && ($impl.RomanValues(index) < $impl.RomanValues(Next))) {
            Result += $impl.RomanValues(Next);
            Result -= $impl.RomanValues(index);
            i += 1;
          } else Result += $impl.RomanValues(index);
        } else {
          Result = 0;
          return Result;
        };
      };
      if (Negative) Result = -Result;
      return Result;
    };
    $impl.isMatch = function (level, inputstr, wilds, CWild, CinputWord, MaxInputword, maxwilds, EOS) {
      var Result = false;
      EOS.set(false);
      Result = true;
      do {
        if (wilds.charAt(CWild - 1) === "*") {
          CWild += 1;
          while (wilds.charAt(CWild - 1) === "?") {
            CWild += 1;
            CinputWord += 1;
          };
          do {
            while ((inputstr.charAt(CinputWord - 1) !== wilds.charAt(CWild - 1)) && (CinputWord <= MaxInputword)) CinputWord += 1;
            Result = $impl.isMatch(level + 1,inputstr,wilds,CWild,CinputWord,MaxInputword,maxwilds,EOS);
            if (!Result) CinputWord += 1;
          } while (!(Result || (CinputWord >= MaxInputword)));
          if (Result && EOS.get()) return Result;
          continue;
        };
        if (wilds.charAt(CWild - 1) === "?") {
          CWild += 1;
          CinputWord += 1;
          continue;
        };
        if (inputstr.charAt(CinputWord - 1) === wilds.charAt(CWild - 1)) {
          CWild += 1;
          CinputWord += 1;
          continue;
        };
        Result = false;
        return Result;
      } while (!((CinputWord > MaxInputword) || (CWild > maxwilds)));
      if ((CinputWord <= MaxInputword) || (CWild < maxwilds)) {
        Result = false}
       else if (CWild > maxwilds) {
        EOS.set(false)}
       else {
        EOS.set(wilds.charAt(CWild - 1) === "*");
        if (!EOS.get()) Result = false;
      };
      return Result;
    };
  };
  $mod.$init = function () {
    $mod.AnsiResemblesProc = $mod.SoundexProc;
    $mod.ResemblesProc = $mod.SoundexProc;
  };
},["JS"]);
rtl.module("Generics.Strings",["System"],function () {
  "use strict";
  var $mod = this;
  $mod.$resourcestrings = {SArgumentOutOfRange: {org: "Argument out of range"}};
});
rtl.module("Generics.Defaults",["System"],function () {
  "use strict";
  var $mod = this;
  $mod.$rtti.$Interface("IComparer<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderColumn>");
  $mod.$rtti.$Interface("IEnumerator<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderColumn>");
  $mod.$rtti.$Interface("IEnumerable<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderColumn>");
  $mod.$rtti.$Interface("IComparer<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderExpression>");
  $mod.$rtti.$Interface("IEnumerator<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderExpression>");
  $mod.$rtti.$Interface("IEnumerable<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderExpression>");
  $mod.$rtti.$Interface("IComparer<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroup>");
  $mod.$rtti.$Interface("IEnumerator<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroup>");
  $mod.$rtti.$Interface("IEnumerable<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroup>");
  $mod.$rtti.$Interface("IComparer<System.Longint>");
  $mod.$rtti.$Interface("IComparer<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroupOperator>");
  $mod.$rtti.$Interface("IComparer<System.String>");
  $mod.$rtti.$Interface("IEnumerator<System.String>");
  $mod.$rtti.$Interface("IEnumerable<System.String>");
  $mod.$rtti.$Interface("IComparer<XData.Model.Types.TXDataPrimitiveType>");
  $mod.$rtti.$Interface("IEnumerator<XData.Model.Types.TXDataPrimitiveType>");
  $mod.$rtti.$Interface("IEnumerable<XData.Model.Types.TXDataPrimitiveType>");
  $mod.$rtti.$Interface("IComparer<System.TObject>");
  $mod.$rtti.$Interface("IEnumerator<System.TObject>");
  $mod.$rtti.$Interface("IEnumerable<System.TObject>");
  $mod.$rtti.$Interface("IEnumerator<System.Longint>");
  $mod.$rtti.$Interface("IEnumerable<System.Longint>");
  $mod.$rtti.$Interface("IComparer<System.Double>");
  $mod.$rtti.$Interface("IEnumerator<System.Double>");
  $mod.$rtti.$Interface("IEnumerable<System.Double>");
  $mod.$rtti.$Interface("IComparer<WEBLib.TMSFNCPersistence.TTMSFNCObjectReference>");
  $mod.$rtti.$Interface("IEnumerator<WEBLib.TMSFNCPersistence.TTMSFNCObjectReference>");
  $mod.$rtti.$Interface("IEnumerable<WEBLib.TMSFNCPersistence.TTMSFNCObjectReference>");
  $mod.$rtti.$Interface("IComparer<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>");
  $mod.$rtti.$Interface("IEnumerator<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>");
  $mod.$rtti.$Interface("IEnumerable<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>");
  $mod.$rtti.$Interface("IComparer<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassItem>");
  $mod.$rtti.$Interface("IEnumerator<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassItem>");
  $mod.$rtti.$Interface("IEnumerable<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassItem>");
  $mod.$rtti.$Class("TComparer<System.String>");
  $mod.$rtti.$Class("TDefaultComparer<System.String>");
  $mod.$rtti.$Class("TDelegatedComparerEvents<System.String>");
  $mod.$rtti.$Class("TComparer<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>");
  $mod.$rtti.$Class("TDefaultComparer<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>");
  $mod.$rtti.$Class("TDelegatedComparerEvents<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>");
  $mod.$rtti.$Interface("IComparer<WEBLib.TMSFNCFilterDialog.TTMSFNCFilterDialogDrawItem>");
  $mod.$rtti.$Interface("IEnumerator<WEBLib.TMSFNCFilterDialog.TTMSFNCFilterDialogDrawItem>");
  $mod.$rtti.$Interface("IEnumerable<WEBLib.TMSFNCFilterDialog.TTMSFNCFilterDialogDrawItem>");
  $mod.$rtti.$Interface("IComparer<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellControlCache>");
  $mod.$rtti.$Interface("IEnumerator<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellControlCache>");
  $mod.$rtti.$Interface("IEnumerable<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellControlCache>");
  $mod.$rtti.$Interface("IComparer<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>");
  $mod.$rtti.$Interface("IEnumerator<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>");
  $mod.$rtti.$Interface("IEnumerable<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>");
  $mod.$rtti.$Interface("IComparer<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataTempData>");
  $mod.$rtti.$Interface("IEnumerator<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataTempData>");
  $mod.$rtti.$Interface("IEnumerable<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataTempData>");
  $mod.$rtti.$Interface("IComparer<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCell>");
  $mod.$rtti.$Interface("IEnumerator<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCell>");
  $mod.$rtti.$Interface("IEnumerable<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCell>");
  $mod.$rtti.$Interface("IComparer<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord>");
  $mod.$rtti.$Interface("IEnumerator<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord>");
  $mod.$rtti.$Interface("IEnumerable<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord>");
  $mod.$rtti.$Interface("IComparer<WEBLib.TMSFNCDataGridRenderer.TTMSFNCDataGridCellControlWrapperListItem>");
  $mod.$rtti.$Interface("IEnumerator<WEBLib.TMSFNCDataGridRenderer.TTMSFNCDataGridCellControlWrapperListItem>");
  $mod.$rtti.$Interface("IEnumerable<WEBLib.TMSFNCDataGridRenderer.TTMSFNCDataGridCellControlWrapperListItem>");
  $mod.$rtti.$Interface("IComparer<WEBLib.TMSFNCDataGrid.TTMSFNCDataGridHeaderGroup>");
  $mod.$rtti.$Interface("IEnumerator<WEBLib.TMSFNCDataGrid.TTMSFNCDataGridHeaderGroup>");
  $mod.$rtti.$Interface("IEnumerable<WEBLib.TMSFNCDataGrid.TTMSFNCDataGridHeaderGroup>");
  $mod.$rtti.$Interface("IComparer<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataSortInfo>");
  $mod.$rtti.$Class("TComparer<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataSortInfo>");
  $mod.$rtti.$Class("TDefaultComparer<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataSortInfo>");
  $mod.$rtti.$Class("TDelegatedComparerEvents<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataSortInfo>");
  $mod.$rtti.$Class("TComparer<System.Longint>");
  $mod.$rtti.$Class("TDefaultComparer<System.Longint>");
  $mod.$rtti.$Class("TDelegatedComparerEvents<System.Longint>");
  rtl.createInterface(this,"IComparer$$$G$$generics$defaults$$TTMSFNCFilterBuilderColumn","{505778ED-F783-4456-9691-32F419CC5E18}",["Compare"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("Compare",1,[["Left",pas["TMS.TMSFNCFilterBuilder"].$rtti["TTMSFNCFilterBuilderColumn"],2],["Right",pas["TMS.TMSFNCFilterBuilder"].$rtti["TTMSFNCFilterBuilderColumn"],2]],2,rtl.longint);
    };
  },"IComparer<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderColumn>");
  rtl.createInterface(this,"IEnumerator$$$G$$generics$defaults$$TTMSFNCFilterBuilderColumn","{5481614C-ABAE-3B79-9410-86A641724628}",["GetCurrent","MoveNext","Reset"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("GetCurrent",1,[],2,pas["TMS.TMSFNCFilterBuilder"].$rtti["TTMSFNCFilterBuilderColumn"]);
      $r.addMethod("MoveNext",1,[],2,rtl.boolean);
      $r.addMethod("Reset",0,[]);
      $r.addProperty("Current",1,pas["TMS.TMSFNCFilterBuilder"].$rtti["TTMSFNCFilterBuilderColumn"],"GetCurrent","",2);
    };
  },"IEnumerator<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderColumn>");
  rtl.createInterface(this,"IEnumerable$$$G$$generics$defaults$$TTMSFNCFilterBuilderColumn","{6F5382E7-BD68-308E-A271-E6A6418ED288}",["GetEnumerator"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("GetEnumerator",1,[],2,$mod.$rtti["IEnumerator<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderColumn>"]);
    };
  },"IEnumerable<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderColumn>");
  rtl.createInterface(this,"IComparer$$$G$$generics$defaults$$TTMSFNCFilterBuilderExpression","{505778ED-F783-4456-9691-32F419CC5E18}",["Compare"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("Compare",1,[["Left",pas["TMS.TMSFNCFilterBuilder"].$rtti["TTMSFNCFilterBuilderExpression"],2],["Right",pas["TMS.TMSFNCFilterBuilder"].$rtti["TTMSFNCFilterBuilderExpression"],2]],2,rtl.longint);
    };
  },"IComparer<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderExpression>");
  rtl.createInterface(this,"IEnumerator$$$G$$generics$defaults$$TTMSFNCFilterBuilderExpression","{8B8EE0BD-8AFE-31EA-AC12-6D149DEB1346}",["GetCurrent","MoveNext","Reset"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("GetCurrent",1,[],2,pas["TMS.TMSFNCFilterBuilder"].$rtti["TTMSFNCFilterBuilderExpression"]);
      $r.addMethod("MoveNext",1,[],2,rtl.boolean);
      $r.addMethod("Reset",0,[]);
      $r.addProperty("Current",1,pas["TMS.TMSFNCFilterBuilder"].$rtti["TTMSFNCFilterBuilderExpression"],"GetCurrent","",2);
    };
  },"IEnumerator<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderExpression>");
  rtl.createInterface(this,"IEnumerable$$$G$$generics$defaults$$TTMSFNCFilterBuilderExpression","{5444E27A-ACF8-32D6-AE8C-C3E813EB1348}",["GetEnumerator"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("GetEnumerator",1,[],2,$mod.$rtti["IEnumerator<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderExpression>"]);
    };
  },"IEnumerable<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderExpression>");
  rtl.createInterface(this,"IComparer$$$G$$generics$defaults$$TTMSFNCFilterBuilderGroup","{505778ED-F783-4456-9691-32F419CC5E18}",["Compare"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("Compare",1,[["Left",pas["TMS.TMSFNCFilterBuilder"].$rtti["TTMSFNCFilterBuilderGroup"],2],["Right",pas["TMS.TMSFNCFilterBuilder"].$rtti["TTMSFNCFilterBuilderGroup"],2]],2,rtl.longint);
    };
  },"IComparer<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroup>");
  rtl.createInterface(this,"IEnumerator$$$G$$generics$defaults$$TTMSFNCFilterBuilderGroup","{72C58485-E245-3EA8-8C1D-C19AA290C591}",["GetCurrent","MoveNext","Reset"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("GetCurrent",1,[],2,pas["TMS.TMSFNCFilterBuilder"].$rtti["TTMSFNCFilterBuilderGroup"]);
      $r.addMethod("MoveNext",1,[],2,rtl.boolean);
      $r.addMethod("Reset",0,[]);
      $r.addProperty("Current",1,pas["TMS.TMSFNCFilterBuilder"].$rtti["TTMSFNCFilterBuilderGroup"],"GetCurrent","",2);
    };
  },"IEnumerator<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroup>");
  rtl.createInterface(this,"IEnumerable$$$G$$generics$defaults$$TTMSFNCFilterBuilderGroup","{EC0979E7-BD68-3154-A42F-C19AA5223195}",["GetEnumerator"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("GetEnumerator",1,[],2,$mod.$rtti["IEnumerator<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroup>"]);
    };
  },"IEnumerable<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroup>");
  rtl.createInterface(this,"IComparer$$$G$$generics$defaults$$Longint","{505778ED-F783-4456-9691-32F419CC5E18}",["Compare"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("Compare",1,[["Left",rtl.longint,2],["Right",rtl.longint,2]],2,rtl.longint);
  },"IComparer<System.Longint>");
  rtl.createInterface(this,"IComparer$$$G$$generics$defaults$$TTMSFNCFilterBuilderGroupOperator","{505778ED-F783-4456-9691-32F419CC5E18}",["Compare"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("Compare",1,[["Left",pas["TMS.TMSFNCFilterBuilder"].$rtti["TTMSFNCFilterBuilderGroupOperator"],2],["Right",pas["TMS.TMSFNCFilterBuilder"].$rtti["TTMSFNCFilterBuilderGroupOperator"],2]],2,rtl.longint);
    };
  },"IComparer<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroupOperator>");
  rtl.createInterface(this,"IComparer$$$G$$generics$defaults$$String","{505778ED-F783-4456-9691-32F419CC5E18}",["Compare"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("Compare",1,[["Left",rtl.string,2],["Right",rtl.string,2]],2,rtl.longint);
  },"IComparer<System.String>");
  rtl.createInterface(this,"IEnumerator$$$G$$generics$defaults$$String","{742D446C-82CD-3563-961B-59A5E06F9EFD}",["GetCurrent","MoveNext","Reset"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("GetCurrent",1,[],2,rtl.string);
    $r.addMethod("MoveNext",1,[],2,rtl.boolean);
    $r.addMethod("Reset",0,[]);
    $r.addProperty("Current",1,rtl.string,"GetCurrent","",2);
  },"IEnumerator<System.String>");
  rtl.createInterface(this,"IEnumerable$$$G$$generics$defaults$$String","{A2E8B32C-82CD-3E79-8678-FDE8178D1227}",["GetEnumerator"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("GetEnumerator",1,[],2,$mod.$rtti["IEnumerator<System.String>"]);
  },"IEnumerable<System.String>");
  rtl.createInterface(this,"IComparer$$$G$$generics$defaults$$TXDataPrimitiveType","{505778ED-F783-4456-9691-32F419CC5E18}",["Compare"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("Compare",1,[["Left",pas["XData.Model.Types"].$rtti["TXDataPrimitiveType"],2],["Right",pas["XData.Model.Types"].$rtti["TXDataPrimitiveType"],2]],2,rtl.longint);
    };
  },"IComparer<XData.Model.Types.TXDataPrimitiveType>");
  rtl.createInterface(this,"IEnumerator$$$G$$generics$defaults$$TXDataPrimitiveType","{42D04618-C28C-3540-8EF3-86961EC2FB90}",["GetCurrent","MoveNext","Reset"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("GetCurrent",1,[],2,pas["XData.Model.Types"].$rtti["TXDataPrimitiveType"]);
      $r.addMethod("MoveNext",1,[],2,rtl.boolean);
      $r.addMethod("Reset",0,[]);
      $r.addProperty("Current",1,pas["XData.Model.Types"].$rtti["TXDataPrimitiveType"],"GetCurrent","",2);
    };
  },"IEnumerator<XData.Model.Types.TXDataPrimitiveType>");
  rtl.createInterface(this,"IEnumerable$$$G$$generics$defaults$$TXDataPrimitiveType","{FE3F0618-C2C5-3CFF-B3BD-C9CD3C3625BE}",["GetEnumerator"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("GetEnumerator",1,[],2,$mod.$rtti["IEnumerator<XData.Model.Types.TXDataPrimitiveType>"]);
    };
  },"IEnumerable<XData.Model.Types.TXDataPrimitiveType>");
  rtl.createInterface(this,"IComparer$$$G$$generics$defaults$$TObject","{505778ED-F783-4456-9691-32F419CC5E18}",["Compare"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("Compare",1,[["Left",pas.System.$rtti["TObject"],2],["Right",pas.System.$rtti["TObject"],2]],2,rtl.longint);
  },"IComparer<System.TObject>");
  rtl.createInterface(this,"IEnumerator$$$G$$generics$defaults$$TObject","{8EA8CE58-C397-337B-B088-7563ADDB2494}",["GetCurrent","MoveNext","Reset"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("GetCurrent",1,[],2,pas.System.$rtti["TObject"]);
    $r.addMethod("MoveNext",1,[],2,rtl.boolean);
    $r.addMethod("Reset",0,[]);
    $r.addProperty("Current",1,pas.System.$rtti["TObject"],"GetCurrent","",2);
  },"IEnumerator<System.TObject>");
  rtl.createInterface(this,"IEnumerable$$$G$$generics$defaults$$TObject","{E2FFA1CE-C397-3543-95B0-3285A78D1225}",["GetEnumerator"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("GetEnumerator",1,[],2,$mod.$rtti["IEnumerator<System.TObject>"]);
  },"IEnumerable<System.TObject>");
  rtl.createInterface(this,"IEnumerator$$$G$$generics$defaults$$Longint","{BE4D2658-C397-337B-B088-7563ADDB2523}",["GetCurrent","MoveNext","Reset"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("GetCurrent",1,[],2,rtl.longint);
    $r.addMethod("MoveNext",1,[],2,rtl.boolean);
    $r.addMethod("Reset",0,[]);
    $r.addProperty("Current",1,rtl.longint,"GetCurrent","",2);
  },"IEnumerator<System.Longint>");
  rtl.createInterface(this,"IEnumerable$$$G$$generics$defaults$$Longint","{12A3F9CE-C397-3543-95B0-3285A78D12B5}",["GetEnumerator"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("GetEnumerator",1,[],2,$mod.$rtti["IEnumerator<System.Longint>"]);
  },"IEnumerable<System.Longint>");
  rtl.createInterface(this,"IComparer$$$G$$generics$defaults$$Double","{505778ED-F783-4456-9691-32F419CC5E18}",["Compare"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("Compare",1,[["Left",rtl.double,2],["Right",rtl.double,2]],2,rtl.longint);
  },"IComparer<System.Double>");
  rtl.createInterface(this,"IEnumerator$$$G$$generics$defaults$$Double","{FF4B346C-82CD-3563-961B-59A5E06F9D0A}",["GetCurrent","MoveNext","Reset"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("GetCurrent",1,[],2,rtl.double);
    $r.addMethod("MoveNext",1,[],2,rtl.boolean);
    $r.addMethod("Reset",0,[]);
    $r.addProperty("Current",1,rtl.double,"GetCurrent","",2);
  },"IEnumerator<System.Double>");
  rtl.createInterface(this,"IEnumerable$$$G$$generics$defaults$$Double","{2D06A32C-82CD-3E79-8678-FDE8178D1135}",["GetEnumerator"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("GetEnumerator",1,[],2,$mod.$rtti["IEnumerator<System.Double>"]);
  },"IEnumerable<System.Double>");
  rtl.createInterface(this,"IComparer$$$G$$generics$defaults$$TTMSFNCObjectReference","{505778ED-F783-4456-9691-32F419CC5E18}",["Compare"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("Compare",1,[["Left",pas["WEBLib.TMSFNCPersistence"].$rtti["TTMSFNCObjectReference"],2],["Right",pas["WEBLib.TMSFNCPersistence"].$rtti["TTMSFNCObjectReference"],2]],2,rtl.longint);
    };
  },"IComparer<WEBLib.TMSFNCPersistence.TTMSFNCObjectReference>");
  rtl.createInterface(this,"IEnumerator$$$G$$generics$defaults$$TTMSFNCObjectReference","{CB4FB947-4FC0-3EE9-9891-10C2A41DEFE5}",["GetCurrent","MoveNext","Reset"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("GetCurrent",1,[],2,pas["WEBLib.TMSFNCPersistence"].$rtti["TTMSFNCObjectReference"]);
      $r.addMethod("MoveNext",1,[],2,rtl.boolean);
      $r.addMethod("Reset",0,[]);
      $r.addProperty("Current",1,pas["WEBLib.TMSFNCPersistence"].$rtti["TTMSFNCObjectReference"],"GetCurrent","",2);
    };
  },"IEnumerator<WEBLib.TMSFNCPersistence.TTMSFNCObjectReference>");
  rtl.createInterface(this,"IEnumerable$$$G$$generics$defaults$$TTMSFNCObjectReference","{DC1D42A4-DB4C-3D87-B7B7-10D0EACDFDCD}",["GetEnumerator"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("GetEnumerator",1,[],2,$mod.$rtti["IEnumerator<WEBLib.TMSFNCPersistence.TTMSFNCObjectReference>"]);
    };
  },"IEnumerable<WEBLib.TMSFNCPersistence.TTMSFNCObjectReference>");
  rtl.createInterface(this,"IComparer$$$G$$generics$defaults$$TTMSFNCJSONToClassProperty","{505778ED-F783-4456-9691-32F419CC5E18}",["Compare"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("Compare",1,[["Left",pas["WEBLib.TMSFNCPersistence"].$rtti["TTMSFNCJSONToClassProperty"],2],["Right",pas["WEBLib.TMSFNCPersistence"].$rtti["TTMSFNCJSONToClassProperty"],2]],2,rtl.longint);
    };
  },"IComparer<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>");
  rtl.createInterface(this,"IEnumerator$$$G$$generics$defaults$$TTMSFNCJSONToClassProperty","{138FCA5C-B9E0-37F6-AF5B-9FFF0B2C092C}",["GetCurrent","MoveNext","Reset"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("GetCurrent",1,[],2,pas["WEBLib.TMSFNCPersistence"].$rtti["TTMSFNCJSONToClassProperty"]);
      $r.addMethod("MoveNext",1,[],2,rtl.boolean);
      $r.addMethod("Reset",0,[]);
      $r.addProperty("Current",1,pas["WEBLib.TMSFNCPersistence"].$rtti["TTMSFNCJSONToClassProperty"],"GetCurrent","",2);
    };
  },"IEnumerator<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>");
  rtl.createInterface(this,"IEnumerable$$$G$$generics$defaults$$TTMSFNCJSONToClassProperty","{146E5B59-9457-309F-8A6E-5AFF0B2DEE87}",["GetEnumerator"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("GetEnumerator",1,[],2,$mod.$rtti["IEnumerator<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>"]);
    };
  },"IEnumerable<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>");
  rtl.createInterface(this,"IComparer$$$G$$generics$defaults$$TTMSFNCJSONToClassItem","{505778ED-F783-4456-9691-32F419CC5E18}",["Compare"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("Compare",1,[["Left",pas["WEBLib.TMSFNCPersistence"].$rtti["TTMSFNCJSONToClassItem"],2],["Right",pas["WEBLib.TMSFNCPersistence"].$rtti["TTMSFNCJSONToClassItem"],2]],2,rtl.longint);
    };
  },"IComparer<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassItem>");
  rtl.createInterface(this,"IEnumerator$$$G$$generics$defaults$$TTMSFNCJSONToClassItem","{53D75BB4-08C5-3F79-9891-10C2A41DED26}",["GetCurrent","MoveNext","Reset"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("GetCurrent",1,[],2,pas["WEBLib.TMSFNCPersistence"].$rtti["TTMSFNCJSONToClassItem"]);
      $r.addMethod("MoveNext",1,[],2,rtl.boolean);
      $r.addMethod("Reset",0,[]);
      $r.addProperty("Current",1,pas["WEBLib.TMSFNCPersistence"].$rtti["TTMSFNCJSONToClassItem"],"GetCurrent","",2);
    };
  },"IEnumerator<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassItem>");
  rtl.createInterface(this,"IEnumerable$$$G$$generics$defaults$$TTMSFNCJSONToClassItem","{64A4E411-9450-3E17-B7B7-10D0EACDFB0E}",["GetEnumerator"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("GetEnumerator",1,[],2,$mod.$rtti["IEnumerator<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassItem>"]);
    };
  },"IEnumerable<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassItem>");
  this.$rtti.$RefToProcVar("TOnComparison<System.String>",{procsig: rtl.newTIProcSig([["Left",rtl.string,2],["Right",rtl.string,2]],rtl.longint)});
  rtl.createClass(this,"TComparer$$$G$$generics$defaults$$String",pas.System.TInterfacedObject,function () {
    this.DefaultComparer = null;
    this.Default = function () {
      var Result = null;
      var $ok = false;
      try {
        if ($mod.TComparer$$$G$$generics$defaults$$String.DefaultComparer === null) $mod.TComparer$$$G$$generics$defaults$$String.DefaultComparer = $mod.TDefaultComparer$$$G$$generics$defaults$$String.$create("Create");
        Result = rtl.setIntfL(Result,rtl.queryIntfT($mod.TComparer$$$G$$generics$defaults$$String.DefaultComparer,$mod.IComparer$$$G$$generics$defaults$$String),true);
        $ok = true;
      } finally {
        if (!$ok) rtl._Release(Result);
      };
      return Result;
    };
    this.Construct = function (AComparison) {
      var Result = null;
      var $ok = false;
      try {
        Result = rtl.setIntfL(Result,rtl.queryIntfT($mod.TDelegatedComparerEvents$$$G$$generics$defaults$$String.$create("Create$1",[AComparison]),$mod.IComparer$$$G$$generics$defaults$$String),true);
        $ok = true;
      } finally {
        if (!$ok) rtl._Release(Result);
      };
      return Result;
    };
    rtl.addIntf(this,$mod.IComparer$$$G$$generics$defaults$$String);
    rtl.addIntf(this,pas.System.IUnknown);
  },"TComparer<System.String>");
  rtl.createClass(this,"TDefaultComparer$$$G$$generics$defaults$$String",this.TComparer$$$G$$generics$defaults$$String,function () {
    this.Compare = function (ALeft, ARight) {
      var Result = 0;
      if (ALeft < ARight) return -1;
      if (ALeft > ARight) return 1;
      Result = 0;
      if (ALeft === ARight) return Result;
      return Result;
    };
    rtl.addIntf(this,$mod.IComparer$$$G$$generics$defaults$$String);
    rtl.addIntf(this,pas.System.IUnknown);
  },"TDefaultComparer<System.String>");
  rtl.createClass(this,"TDelegatedComparerEvents$$$G$$generics$defaults$$String",this.TComparer$$$G$$generics$defaults$$String,function () {
    this.$init = function () {
      $mod.TComparer$$$G$$generics$defaults$$String.$init.call(this);
      this.FComparison = null;
    };
    this.$final = function () {
      this.FComparison = undefined;
      $mod.TComparer$$$G$$generics$defaults$$String.$final.call(this);
    };
    this.Compare = function (ALeft, ARight) {
      var Result = 0;
      Result = this.FComparison(ALeft,ARight);
      return Result;
    };
    this.Create$1 = function (AComparison) {
      pas.System.TObject.Create.call(this);
      this.FComparison = AComparison;
      return this;
    };
    rtl.addIntf(this,$mod.IComparer$$$G$$generics$defaults$$String);
    rtl.addIntf(this,pas.System.IUnknown);
  },"TDelegatedComparerEvents<System.String>");
  this.$rtti.$RefToProcVar("TOnComparison<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>",{init: function () {
      this.procsig = rtl.newTIProcSig([["Left",pas["WEBLib.TMSFNCPersistence"].$rtti["TTMSFNCJSONToClassProperty"],2],["Right",pas["WEBLib.TMSFNCPersistence"].$rtti["TTMSFNCJSONToClassProperty"],2]],rtl.longint);
    }});
  rtl.createClass(this,"TComparer$$$G$$generics$defaults$$TTMSFNCJSONToClassProperty",pas.System.TInterfacedObject,function () {
    this.$initSpec = function () {
      this.DefaultComparer = null;
    };
    this.Default = function () {
      var Result = null;
      var $ok = false;
      try {
        if ($mod.TComparer$$$G$$generics$defaults$$TTMSFNCJSONToClassProperty.DefaultComparer === null) $mod.TComparer$$$G$$generics$defaults$$TTMSFNCJSONToClassProperty.DefaultComparer = $mod.TDefaultComparer$$$G$$generics$defaults$$TTMSFNCJSONToClassProperty.$create("Create");
        Result = rtl.setIntfL(Result,rtl.queryIntfT($mod.TComparer$$$G$$generics$defaults$$TTMSFNCJSONToClassProperty.DefaultComparer,$mod.IComparer$$$G$$generics$defaults$$TTMSFNCJSONToClassProperty),true);
        $ok = true;
      } finally {
        if (!$ok) rtl._Release(Result);
      };
      return Result;
    };
    this.Construct = function (AComparison) {
      var Result = null;
      var $ok = false;
      try {
        Result = rtl.setIntfL(Result,rtl.queryIntfT($mod.TDelegatedComparerEvents$$$G$$generics$defaults$$TTMSFNCJSONToClassProperty.$create("Create$1",[AComparison]),$mod.IComparer$$$G$$generics$defaults$$TTMSFNCJSONToClassProperty),true);
        $ok = true;
      } finally {
        if (!$ok) rtl._Release(Result);
      };
      return Result;
    };
    rtl.addIntf(this,$mod.IComparer$$$G$$generics$defaults$$TTMSFNCJSONToClassProperty);
    rtl.addIntf(this,pas.System.IUnknown);
  },"TComparer<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>");
  rtl.createClass(this,"TDefaultComparer$$$G$$generics$defaults$$TTMSFNCJSONToClassProperty",this.TComparer$$$G$$generics$defaults$$TTMSFNCJSONToClassProperty,function () {
    this.$initSpec = function () {
    };
    this.Compare = function (ALeft, ARight) {
      var Result = 0;
      if (ALeft < ARight) return -1;
      if (ALeft > ARight) return 1;
      Result = 0;
      if (ALeft === ARight) return Result;
      return Result;
    };
    rtl.addIntf(this,$mod.IComparer$$$G$$generics$defaults$$TTMSFNCJSONToClassProperty);
    rtl.addIntf(this,pas.System.IUnknown);
  },"TDefaultComparer<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>");
  rtl.createClass(this,"TDelegatedComparerEvents$$$G$$generics$defaults$$TTMSFNCJSONToClassProperty",this.TComparer$$$G$$generics$defaults$$TTMSFNCJSONToClassProperty,function () {
    this.$initSpec = function () {
    };
    this.$init = function () {
      $mod.TComparer$$$G$$generics$defaults$$TTMSFNCJSONToClassProperty.$init.call(this);
      this.FComparison = null;
    };
    this.$final = function () {
      this.FComparison = undefined;
      $mod.TComparer$$$G$$generics$defaults$$TTMSFNCJSONToClassProperty.$final.call(this);
    };
    this.Compare = function (ALeft, ARight) {
      var Result = 0;
      Result = this.FComparison(ALeft,ARight);
      return Result;
    };
    this.Create$1 = function (AComparison) {
      pas.System.TObject.Create.call(this);
      this.FComparison = AComparison;
      return this;
    };
    rtl.addIntf(this,$mod.IComparer$$$G$$generics$defaults$$TTMSFNCJSONToClassProperty);
    rtl.addIntf(this,pas.System.IUnknown);
  },"TDelegatedComparerEvents<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>");
  rtl.createInterface(this,"IComparer$$$G$$generics$defaults$$TTMSFNCFilterDialogDrawItem","{505778ED-F783-4456-9691-32F419CC5E18}",["Compare"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("Compare",1,[["Left",pas["WEBLib.TMSFNCFilterDialog"].$rtti["TTMSFNCFilterDialogDrawItem"],2],["Right",pas["WEBLib.TMSFNCFilterDialog"].$rtti["TTMSFNCFilterDialogDrawItem"],2]],2,rtl.longint);
    };
  },"IComparer<WEBLib.TMSFNCFilterDialog.TTMSFNCFilterDialogDrawItem>");
  rtl.createInterface(this,"IEnumerator$$$G$$generics$defaults$$TTMSFNCFilterDialogDrawItem","{DA72D7D7-FAD0-3F8D-85AA-0D9C699DAC9E}",["GetCurrent","MoveNext","Reset"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("GetCurrent",1,[],2,pas["WEBLib.TMSFNCFilterDialog"].$rtti["TTMSFNCFilterDialogDrawItem"]);
      $r.addMethod("MoveNext",1,[],2,rtl.boolean);
      $r.addMethod("Reset",0,[]);
      $r.addProperty("Current",1,pas["WEBLib.TMSFNCFilterDialog"].$rtti["TTMSFNCFilterDialogDrawItem"],"GetCurrent","",2);
    };
  },"IEnumerator<WEBLib.TMSFNCFilterDialog.TTMSFNCFilterDialogDrawItem>");
  rtl.createInterface(this,"IEnumerable$$$G$$generics$defaults$$TTMSFNCFilterDialogDrawItem","{F1320D7B-3D06-3D00-9FFE-C90B299DACD7}",["GetEnumerator"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("GetEnumerator",1,[],2,$mod.$rtti["IEnumerator<WEBLib.TMSFNCFilterDialog.TTMSFNCFilterDialogDrawItem>"]);
    };
  },"IEnumerable<WEBLib.TMSFNCFilterDialog.TTMSFNCFilterDialogDrawItem>");
  rtl.createInterface(this,"IComparer$$$G$$generics$defaults$$TTMSFNCDataGridCellControlCache","{505778ED-F783-4456-9691-32F419CC5E18}",["Compare"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("Compare",1,[["Left",pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCellControlCache"],2],["Right",pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCellControlCache"],2]],2,rtl.longint);
    };
  },"IComparer<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellControlCache>");
  rtl.createInterface(this,"IEnumerator$$$G$$generics$defaults$$TTMSFNCDataGridCellControlCache","{7B0FC8B0-76D6-3BB7-8EF2-8D21AC06E587}",["GetCurrent","MoveNext","Reset"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("GetCurrent",1,[],2,pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCellControlCache"]);
      $r.addMethod("MoveNext",1,[],2,rtl.boolean);
      $r.addMethod("Reset",0,[]);
      $r.addProperty("Current",1,pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCellControlCache"],"GetCurrent","",2);
    };
  },"IEnumerator<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellControlCache>");
  rtl.createInterface(this,"IEnumerable$$$G$$generics$defaults$$TTMSFNCDataGridCellControlCache","{7B135A1C-7A50-3FAB-9FF3-B0C459ADD187}",["GetEnumerator"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("GetEnumerator",1,[],2,$mod.$rtti["IEnumerator<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellControlCache>"]);
    };
  },"IEnumerable<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellControlCache>");
  rtl.createInterface(this,"IComparer$$$G$$generics$defaults$$TTMSFNCDataGridSortIndex","{505778ED-F783-4456-9691-32F419CC5E18}",["Compare"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("Compare",1,[["Left",pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridSortIndex"],2],["Right",pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridSortIndex"],2]],2,rtl.longint);
    };
  },"IComparer<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>");
  rtl.createInterface(this,"IEnumerator$$$G$$generics$defaults$$TTMSFNCDataGridSortIndex","{C3DF4740-97B7-36F2-A49F-70E57965AA65}",["GetCurrent","MoveNext","Reset"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("GetCurrent",1,[],2,pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridSortIndex"]);
      $r.addMethod("MoveNext",1,[],2,rtl.boolean);
      $r.addMethod("Reset",0,[]);
      $r.addProperty("Current",1,pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridSortIndex"],"GetCurrent","",2);
    };
  },"IEnumerator<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>");
  rtl.createInterface(this,"IEnumerable$$$G$$generics$defaults$$TTMSFNCDataGridSortIndex","{DEB168DB-A971-3C0A-B100-D0E5798235C5}",["GetEnumerator"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("GetEnumerator",1,[],2,$mod.$rtti["IEnumerator<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>"]);
    };
  },"IEnumerable<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>");
  rtl.createInterface(this,"IComparer$$$G$$generics$defaults$$TTMSFNCDataGridDataTempData","{505778ED-F783-4456-9691-32F419CC5E18}",["Compare"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("Compare",1,[["Left",pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataTempData"],2],["Right",pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataTempData"],2]],2,rtl.longint);
    };
  },"IComparer<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataTempData>");
  rtl.createInterface(this,"IEnumerator$$$G$$generics$defaults$$TTMSFNCDataGridDataTempData","{E3D35995-7B7D-3944-AD61-BD3C699DAC95}",["GetCurrent","MoveNext","Reset"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("GetCurrent",1,[],2,pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataTempData"]);
      $r.addMethod("MoveNext",1,[],2,rtl.boolean);
      $r.addMethod("Reset",0,[]);
      $r.addProperty("Current",1,pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataTempData"],"GetCurrent","",2);
    };
  },"IEnumerator<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataTempData>");
  rtl.createInterface(this,"IEnumerable$$$G$$generics$defaults$$TTMSFNCDataGridDataTempData","{F9939039-BEB3-36B8-86B5-78AB299DACCE}",["GetEnumerator"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("GetEnumerator",1,[],2,$mod.$rtti["IEnumerator<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataTempData>"]);
    };
  },"IEnumerable<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataTempData>");
  rtl.createInterface(this,"IComparer$$$G$$generics$defaults$$TTMSFNCDataGridCell","{505778ED-F783-4456-9691-32F419CC5E18}",["Compare"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("Compare",1,[["Left",pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCell"],2],["Right",pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCell"],2]],2,rtl.longint);
    };
  },"IComparer<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCell>");
  rtl.createInterface(this,"IEnumerator$$$G$$generics$defaults$$TTMSFNCDataGridCell","{FF64CBB0-3A6F-3B03-B94F-39409D150DCF}",["GetCurrent","MoveNext","Reset"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("GetCurrent",1,[],2,pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCell"]);
      $r.addMethod("MoveNext",1,[],2,rtl.boolean);
      $r.addMethod("Reset",0,[]);
      $r.addProperty("Current",1,pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCell"],"GetCurrent","",2);
    };
  },"IEnumerator<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCell>");
  rtl.createInterface(this,"IEnumerable$$$G$$generics$defaults$$TTMSFNCDataGridCell","{36823FDB-682B-39C3-A776-72575E4BB112}",["GetEnumerator"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("GetEnumerator",1,[],2,$mod.$rtti["IEnumerator<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCell>"]);
    };
  },"IEnumerable<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCell>");
  rtl.createInterface(this,"IComparer$$$G$$generics$defaults$$TTMSFNCDataGridCellCoord","{505778ED-F783-4456-9691-32F419CC5E18}",["Compare"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("Compare",1,[["Left",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"],2],["Right",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"],2]],2,rtl.longint);
    };
  },"IComparer<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord>");
  rtl.createInterface(this,"IEnumerator$$$G$$generics$defaults$$TTMSFNCDataGridCellCoord","{C3DF4740-5671-3575-B7B1-70E57965AA65}",["GetCurrent","MoveNext","Reset"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("GetCurrent",1,[],2,pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]);
      $r.addMethod("MoveNext",1,[],2,rtl.boolean);
      $r.addMethod("Reset",0,[]);
      $r.addProperty("Current",1,pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"],"GetCurrent","",2);
    };
  },"IEnumerator<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord>");
  rtl.createInterface(this,"IEnumerable$$$G$$generics$defaults$$TTMSFNCDataGridCellCoord","{DEB168DB-682B-3A8B-8312-D0E5798235C5}",["GetEnumerator"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("GetEnumerator",1,[],2,$mod.$rtti["IEnumerator<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord>"]);
    };
  },"IEnumerable<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord>");
  rtl.createInterface(this,"IComparer$$$G$$generics$defaults$$TTMSFNCDataGridCellControlWrapperListItem","{505778ED-F783-4456-9691-32F419CC5E18}",["Compare"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("Compare",1,[["Left",pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCellControlWrapperListItem"],2],["Right",pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCellControlWrapperListItem"],2]],2,rtl.longint);
    };
  },"IComparer<WEBLib.TMSFNCDataGridRenderer.TTMSFNCDataGridCellControlWrapperListItem>");
  rtl.createInterface(this,"IEnumerator$$$G$$generics$defaults$$TTMSFNCDataGridCellControlWrapperListItem","{FC31F658-38D3-3AC1-B441-C74C2309B90D}",["GetCurrent","MoveNext","Reset"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("GetCurrent",1,[],2,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCellControlWrapperListItem"]);
      $r.addMethod("MoveNext",1,[],2,rtl.boolean);
      $r.addMethod("Reset",0,[]);
      $r.addProperty("Current",1,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCellControlWrapperListItem"],"GetCurrent","",2);
    };
  },"IEnumerator<WEBLib.TMSFNCDataGridRenderer.TTMSFNCDataGridCellControlWrapperListItem>");
  rtl.createInterface(this,"IEnumerable$$$G$$generics$defaults$$TTMSFNCDataGridCellControlWrapperListItem","{C9BA53E4-C382-3871-A467-D592D317A11D}",["GetEnumerator"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("GetEnumerator",1,[],2,$mod.$rtti["IEnumerator<WEBLib.TMSFNCDataGridRenderer.TTMSFNCDataGridCellControlWrapperListItem>"]);
    };
  },"IEnumerable<WEBLib.TMSFNCDataGridRenderer.TTMSFNCDataGridCellControlWrapperListItem>");
  rtl.createInterface(this,"IComparer$$$G$$generics$defaults$$TTMSFNCDataGridHeaderGroup","{505778ED-F783-4456-9691-32F419CC5E18}",["Compare"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("Compare",1,[["Left",pas["WEBLib.TMSFNCDataGrid"].$rtti["TTMSFNCDataGridHeaderGroup"],2],["Right",pas["WEBLib.TMSFNCDataGrid"].$rtti["TTMSFNCDataGridHeaderGroup"],2]],2,rtl.longint);
    };
  },"IComparer<WEBLib.TMSFNCDataGrid.TTMSFNCDataGridHeaderGroup>");
  rtl.createInterface(this,"IEnumerator$$$G$$generics$defaults$$TTMSFNCDataGridHeaderGroup","{BEBFF720-0A51-3F1C-B4A1-BB7FA9CC6402}",["GetCurrent","MoveNext","Reset"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("GetCurrent",1,[],2,pas["WEBLib.TMSFNCDataGrid"].$rtti["TTMSFNCDataGridHeaderGroup"]);
      $r.addMethod("MoveNext",1,[],2,rtl.boolean);
      $r.addMethod("Reset",0,[]);
      $r.addProperty("Current",1,pas["WEBLib.TMSFNCDataGrid"].$rtti["TTMSFNCDataGridHeaderGroup"],"GetCurrent","",2);
    };
  },"IEnumerator<WEBLib.TMSFNCDataGrid.TTMSFNCDataGridHeaderGroup>");
  rtl.createInterface(this,"IEnumerable$$$G$$generics$defaults$$TTMSFNCDataGridHeaderGroup","{073E655B-F2A6-3592-8147-BB801BFAE56F}",["GetEnumerator"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("GetEnumerator",1,[],2,$mod.$rtti["IEnumerator<WEBLib.TMSFNCDataGrid.TTMSFNCDataGridHeaderGroup>"]);
    };
  },"IEnumerable<WEBLib.TMSFNCDataGrid.TTMSFNCDataGridHeaderGroup>");
  rtl.createInterface(this,"IComparer$$$G$$generics$defaults$$TTMSFNCDataGridDataSortInfo","{505778ED-F783-4456-9691-32F419CC5E18}",["Compare"],pas.System.IUnknown,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $r.addMethod("Compare",1,[["Left",pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataSortInfo"],2],["Right",pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataSortInfo"],2]],2,rtl.longint);
    };
  },"IComparer<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataSortInfo>");
  this.$rtti.$RefToProcVar("TOnComparison<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataSortInfo>",{init: function () {
      this.procsig = rtl.newTIProcSig([["Left",pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataSortInfo"],2],["Right",pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataSortInfo"],2]],rtl.longint);
    }});
  rtl.createClass(this,"TComparer$$$G$$generics$defaults$$TTMSFNCDataGridDataSortInfo",pas.System.TInterfacedObject,function () {
    this.$initSpec = function () {
      this.DefaultComparer = null;
    };
    this.Default = function () {
      var Result = null;
      var $ok = false;
      try {
        if ($mod.TComparer$$$G$$generics$defaults$$TTMSFNCDataGridDataSortInfo.DefaultComparer === null) $mod.TComparer$$$G$$generics$defaults$$TTMSFNCDataGridDataSortInfo.DefaultComparer = $mod.TDefaultComparer$$$G$$generics$defaults$$TTMSFNCDataGridDataSortInfo.$create("Create");
        Result = rtl.setIntfL(Result,rtl.queryIntfT($mod.TComparer$$$G$$generics$defaults$$TTMSFNCDataGridDataSortInfo.DefaultComparer,$mod.IComparer$$$G$$generics$defaults$$TTMSFNCDataGridDataSortInfo),true);
        $ok = true;
      } finally {
        if (!$ok) rtl._Release(Result);
      };
      return Result;
    };
    this.Construct = function (AComparison) {
      var Result = null;
      var $ok = false;
      try {
        Result = rtl.setIntfL(Result,rtl.queryIntfT($mod.TDelegatedComparerEvents$$$G$$generics$defaults$$TTMSFNCDataGridDataSortInfo.$create("Create$1",[AComparison]),$mod.IComparer$$$G$$generics$defaults$$TTMSFNCDataGridDataSortInfo),true);
        $ok = true;
      } finally {
        if (!$ok) rtl._Release(Result);
      };
      return Result;
    };
    rtl.addIntf(this,$mod.IComparer$$$G$$generics$defaults$$TTMSFNCDataGridDataSortInfo);
    rtl.addIntf(this,pas.System.IUnknown);
  },"TComparer<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataSortInfo>");
  rtl.createClass(this,"TDefaultComparer$$$G$$generics$defaults$$TTMSFNCDataGridDataSortInfo",this.TComparer$$$G$$generics$defaults$$TTMSFNCDataGridDataSortInfo,function () {
    this.$initSpec = function () {
    };
    this.Compare = function (ALeft, ARight) {
      var Result = 0;
      if (ALeft < ARight) return -1;
      if (ALeft > ARight) return 1;
      Result = 0;
      if (ALeft.$eq(ARight)) return Result;
      return Result;
    };
    rtl.addIntf(this,$mod.IComparer$$$G$$generics$defaults$$TTMSFNCDataGridDataSortInfo);
    rtl.addIntf(this,pas.System.IUnknown);
  },"TDefaultComparer<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataSortInfo>");
  rtl.createClass(this,"TDelegatedComparerEvents$$$G$$generics$defaults$$TTMSFNCDataGridDataSortInfo",this.TComparer$$$G$$generics$defaults$$TTMSFNCDataGridDataSortInfo,function () {
    this.$initSpec = function () {
    };
    this.$init = function () {
      $mod.TComparer$$$G$$generics$defaults$$TTMSFNCDataGridDataSortInfo.$init.call(this);
      this.FComparison = null;
    };
    this.$final = function () {
      this.FComparison = undefined;
      $mod.TComparer$$$G$$generics$defaults$$TTMSFNCDataGridDataSortInfo.$final.call(this);
    };
    this.Compare = function (ALeft, ARight) {
      var Result = 0;
      Result = this.FComparison(ALeft,ARight);
      return Result;
    };
    this.Create$1 = function (AComparison) {
      pas.System.TObject.Create.call(this);
      this.FComparison = AComparison;
      return this;
    };
    rtl.addIntf(this,$mod.IComparer$$$G$$generics$defaults$$TTMSFNCDataGridDataSortInfo);
    rtl.addIntf(this,pas.System.IUnknown);
  },"TDelegatedComparerEvents<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataSortInfo>");
  this.$rtti.$RefToProcVar("TOnComparison<System.Longint>",{procsig: rtl.newTIProcSig([["Left",rtl.longint,2],["Right",rtl.longint,2]],rtl.longint)});
  rtl.createClass(this,"TComparer$$$G$$generics$defaults$$Longint",pas.System.TInterfacedObject,function () {
    this.DefaultComparer = null;
    this.Default = function () {
      var Result = null;
      var $ok = false;
      try {
        if ($mod.TComparer$$$G$$generics$defaults$$Longint.DefaultComparer === null) $mod.TComparer$$$G$$generics$defaults$$Longint.DefaultComparer = $mod.TDefaultComparer$$$G$$generics$defaults$$Longint.$create("Create");
        Result = rtl.setIntfL(Result,rtl.queryIntfT($mod.TComparer$$$G$$generics$defaults$$Longint.DefaultComparer,$mod.IComparer$$$G$$generics$defaults$$Longint),true);
        $ok = true;
      } finally {
        if (!$ok) rtl._Release(Result);
      };
      return Result;
    };
    this.Construct = function (AComparison) {
      var Result = null;
      var $ok = false;
      try {
        Result = rtl.setIntfL(Result,rtl.queryIntfT($mod.TDelegatedComparerEvents$$$G$$generics$defaults$$Longint.$create("Create$1",[AComparison]),$mod.IComparer$$$G$$generics$defaults$$Longint),true);
        $ok = true;
      } finally {
        if (!$ok) rtl._Release(Result);
      };
      return Result;
    };
    rtl.addIntf(this,$mod.IComparer$$$G$$generics$defaults$$Longint);
    rtl.addIntf(this,pas.System.IUnknown);
  },"TComparer<System.Longint>");
  rtl.createClass(this,"TDefaultComparer$$$G$$generics$defaults$$Longint",this.TComparer$$$G$$generics$defaults$$Longint,function () {
    this.Compare = function (ALeft, ARight) {
      var Result = 0;
      if (ALeft < ARight) return -1;
      if (ALeft > ARight) return 1;
      Result = 0;
      if (ALeft === ARight) return Result;
      return Result;
    };
    rtl.addIntf(this,$mod.IComparer$$$G$$generics$defaults$$Longint);
    rtl.addIntf(this,pas.System.IUnknown);
  },"TDefaultComparer<System.Longint>");
  rtl.createClass(this,"TDelegatedComparerEvents$$$G$$generics$defaults$$Longint",this.TComparer$$$G$$generics$defaults$$Longint,function () {
    this.$init = function () {
      $mod.TComparer$$$G$$generics$defaults$$Longint.$init.call(this);
      this.FComparison = null;
    };
    this.$final = function () {
      this.FComparison = undefined;
      $mod.TComparer$$$G$$generics$defaults$$Longint.$final.call(this);
    };
    this.Compare = function (ALeft, ARight) {
      var Result = 0;
      Result = this.FComparison(ALeft,ARight);
      return Result;
    };
    this.Create$1 = function (AComparison) {
      pas.System.TObject.Create.call(this);
      this.FComparison = AComparison;
      return this;
    };
    rtl.addIntf(this,$mod.IComparer$$$G$$generics$defaults$$Longint);
    rtl.addIntf(this,pas.System.IUnknown);
  },"TDelegatedComparerEvents<System.Longint>");
});
rtl.module("Generics.Collections",["System","Classes","SysUtils","RTLConsts","Types","JS","Generics.Strings","Generics.Defaults"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  $mod.$rtti.$Class("TEnumerator<Generics.Collections.TPair<Generics.Collections.TDictionary.TKey,Generics.Collections.TDictionary.TValue>>");
  $mod.$rtti.$Class("TEnumerable<Generics.Collections.TPair<Generics.Collections.TDictionary.TKey,Generics.Collections.TDictionary.TValue>>");
  $mod.$rtti.$Class("TEnumerator<Generics.Collections.TPair<Generics.Collections.TObjectDictionary.TKey,Generics.Collections.TObjectDictionary.TValue>>");
  $mod.$rtti.$Class("TEnumerable<Generics.Collections.TPair<Generics.Collections.TObjectDictionary.TKey,Generics.Collections.TObjectDictionary.TValue>>");
  $mod.$rtti.$Class("TEnumerator<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderColumn>");
  $mod.$rtti.$Class("TEnumerable<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderColumn>");
  $mod.$rtti.$Class("TCustomArrayHelper<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderColumn>");
  $mod.$rtti.$Class("TArrayHelper<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderColumn>");
  $mod.$rtti.$Class("TCustomList<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderColumn>");
  $mod.$rtti.$Class("TCustomListEnumerator<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderColumn>");
  $mod.$rtti.$Class("TList<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderColumn>");
  $mod.$rtti.$Class("TObjectList<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderColumn>");
  $mod.$rtti.$Class("TEnumerator<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderExpression>");
  $mod.$rtti.$Class("TEnumerable<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderExpression>");
  $mod.$rtti.$Class("TCustomArrayHelper<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderExpression>");
  $mod.$rtti.$Class("TArrayHelper<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderExpression>");
  $mod.$rtti.$Class("TCustomList<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderExpression>");
  $mod.$rtti.$Class("TCustomListEnumerator<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderExpression>");
  $mod.$rtti.$Class("TList<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderExpression>");
  $mod.$rtti.$Class("TObjectList<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderExpression>");
  $mod.$rtti.$Class("TEnumerator<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroup>");
  $mod.$rtti.$Class("TEnumerable<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroup>");
  $mod.$rtti.$Class("TCustomArrayHelper<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroup>");
  $mod.$rtti.$Class("TArrayHelper<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroup>");
  $mod.$rtti.$Class("TCustomList<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroup>");
  $mod.$rtti.$Class("TCustomListEnumerator<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroup>");
  $mod.$rtti.$Class("TList<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroup>");
  $mod.$rtti.$Class("TObjectList<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroup>");
  $mod.$rtti.$Class("TEnumerator<Generics.Collections.TPair<System.Longint,Generics.Collections.TPair<System.Double,System.Double>>>");
  $mod.$rtti.$Class("TEnumerable<Generics.Collections.TPair<System.Longint,Generics.Collections.TPair<System.Double,System.Double>>>");
  $mod.$rtti.$Class("TEnumerator<System.Longint>");
  $mod.$rtti.$Class("TEnumerator<Generics.Collections.TPair<System.Double,System.Double>>");
  $mod.$rtti.$Class("TEnumerable<Generics.Collections.TPair<System.Double,System.Double>>");
  $mod.$rtti.$Class("TEnumerable<System.Longint>");
  $mod.$rtti.$Class("TDictionary<System.Longint,Generics.Collections.TPair<System.Double,System.Double>>");
  $mod.$rtti.$Class("TEnumerator<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroupOperator>");
  $mod.$rtti.$Class("TEnumerable<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroupOperator>");
  $mod.$rtti.$Class("TCustomArrayHelper<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroupOperator>");
  $mod.$rtti.$Class("TArrayHelper<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroupOperator>");
  $mod.$rtti.$Class("TCustomList<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroupOperator>");
  $mod.$rtti.$Class("TCustomListEnumerator<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroupOperator>");
  $mod.$rtti.$Class("TStack<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroupOperator>");
  $mod.$rtti.$Class("TEnumerator<System.String>");
  $mod.$rtti.$Class("TEnumerable<System.String>");
  $mod.$rtti.$Class("TCustomArrayHelper<System.String>");
  $mod.$rtti.$Class("TArrayHelper<System.String>");
  $mod.$rtti.$Class("TCustomList<System.String>");
  $mod.$rtti.$Class("TCustomListEnumerator<System.String>");
  $mod.$rtti.$Class("TList<System.String>");
  $mod.$rtti.$Class("TEnumerator<XData.Model.Types.TXDataPrimitiveType>");
  $mod.$rtti.$Class("TEnumerable<XData.Model.Types.TXDataPrimitiveType>");
  $mod.$rtti.$Class("TCustomArrayHelper<XData.Model.Types.TXDataPrimitiveType>");
  $mod.$rtti.$Class("TArrayHelper<XData.Model.Types.TXDataPrimitiveType>");
  $mod.$rtti.$Class("TCustomList<XData.Model.Types.TXDataPrimitiveType>");
  $mod.$rtti.$Class("TCustomListEnumerator<XData.Model.Types.TXDataPrimitiveType>");
  $mod.$rtti.$Class("TList<XData.Model.Types.TXDataPrimitiveType>");
  $mod.$rtti.$Class("TEnumerator<Generics.Collections.TPair<System.String,System.TObject>>");
  $mod.$rtti.$Class("TEnumerable<Generics.Collections.TPair<System.String,System.TObject>>");
  $mod.$rtti.$Class("TEnumerator<System.TObject>");
  $mod.$rtti.$Class("TEnumerable<System.TObject>");
  $mod.$rtti.$Class("TDictionary<System.String,System.TObject>");
  $mod.$rtti.$Class("TEnumerator<Generics.Collections.TPair<System.Longint,System.TObject>>");
  $mod.$rtti.$Class("TEnumerable<Generics.Collections.TPair<System.Longint,System.TObject>>");
  $mod.$rtti.$Class("TDictionary<System.Longint,System.TObject>");
  $mod.$rtti.$Class("TEnumerator<Generics.Collections.TPair<System.Longint,System.Longint>>");
  $mod.$rtti.$Class("TEnumerable<Generics.Collections.TPair<System.Longint,System.Longint>>");
  $mod.$rtti.$Class("TDictionary<System.Longint,System.Longint>");
  $mod.$rtti.$Class("TEnumerator<Generics.Collections.TPair<System.Longint,System.Boolean>>");
  $mod.$rtti.$Class("TEnumerable<Generics.Collections.TPair<System.Longint,System.Boolean>>");
  $mod.$rtti.$Class("TEnumerator<System.Boolean>");
  $mod.$rtti.$Class("TEnumerable<System.Boolean>");
  $mod.$rtti.$Class("TDictionary<System.Longint,System.Boolean>");
  $mod.$rtti.$Class("TEnumerator<Generics.Collections.TPair<System.Longint,System.Double>>");
  $mod.$rtti.$Class("TEnumerable<Generics.Collections.TPair<System.Longint,System.Double>>");
  $mod.$rtti.$Class("TEnumerator<System.Double>");
  $mod.$rtti.$Class("TEnumerable<System.Double>");
  $mod.$rtti.$Class("TDictionary<System.Longint,System.Double>");
  $mod.$rtti.$Class("TCustomArrayHelper<System.TObject>");
  $mod.$rtti.$Class("TArrayHelper<System.TObject>");
  $mod.$rtti.$Class("TCustomList<System.TObject>");
  $mod.$rtti.$Class("TCustomListEnumerator<System.TObject>");
  $mod.$rtti.$Class("TList<System.TObject>");
  $mod.$rtti.$Class("TObjectList<System.TObject>");
  $mod.$rtti.$Class("TCustomArrayHelper<System.Longint>");
  $mod.$rtti.$Class("TArrayHelper<System.Longint>");
  $mod.$rtti.$Class("TCustomList<System.Longint>");
  $mod.$rtti.$Class("TCustomListEnumerator<System.Longint>");
  $mod.$rtti.$Class("TList<System.Longint>");
  $mod.$rtti.$Class("TCustomArrayHelper<System.Double>");
  $mod.$rtti.$Class("TArrayHelper<System.Double>");
  $mod.$rtti.$Class("TCustomList<System.Double>");
  $mod.$rtti.$Class("TCustomListEnumerator<System.Double>");
  $mod.$rtti.$Class("TList<System.Double>");
  $mod.$rtti.$Class("TEnumerator<WEBLib.TMSFNCPersistence.TTMSFNCObjectReference>");
  $mod.$rtti.$Class("TEnumerable<WEBLib.TMSFNCPersistence.TTMSFNCObjectReference>");
  $mod.$rtti.$Class("TCustomArrayHelper<WEBLib.TMSFNCPersistence.TTMSFNCObjectReference>");
  $mod.$rtti.$Class("TArrayHelper<WEBLib.TMSFNCPersistence.TTMSFNCObjectReference>");
  $mod.$rtti.$Class("TCustomList<WEBLib.TMSFNCPersistence.TTMSFNCObjectReference>");
  $mod.$rtti.$Class("TCustomListEnumerator<WEBLib.TMSFNCPersistence.TTMSFNCObjectReference>");
  $mod.$rtti.$Class("TList<WEBLib.TMSFNCPersistence.TTMSFNCObjectReference>");
  $mod.$rtti.$Class("TObjectList<WEBLib.TMSFNCPersistence.TTMSFNCObjectReference>");
  $mod.$rtti.$Class("TEnumerator<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>");
  $mod.$rtti.$Class("TEnumerable<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>");
  $mod.$rtti.$Class("TCustomArrayHelper<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>");
  $mod.$rtti.$Class("TArrayHelper<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>");
  $mod.$rtti.$Class("TCustomList<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>");
  $mod.$rtti.$Class("TCustomListEnumerator<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>");
  $mod.$rtti.$Class("TList<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>");
  $mod.$rtti.$Class("TObjectList<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>");
  $mod.$rtti.$Class("TEnumerator<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassItem>");
  $mod.$rtti.$Class("TEnumerable<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassItem>");
  $mod.$rtti.$Class("TCustomArrayHelper<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassItem>");
  $mod.$rtti.$Class("TArrayHelper<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassItem>");
  $mod.$rtti.$Class("TCustomList<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassItem>");
  $mod.$rtti.$Class("TCustomListEnumerator<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassItem>");
  $mod.$rtti.$Class("TList<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassItem>");
  $mod.$rtti.$Class("TObjectList<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassItem>");
  $mod.$rtti.$Class("TEnumerator<Generics.Collections.TPair<System.String,WEBLib.DesignIntf.TIconData>>");
  $mod.$rtti.$Class("TEnumerable<Generics.Collections.TPair<System.String,WEBLib.DesignIntf.TIconData>>");
  $mod.$rtti.$Class("TEnumerator<WEBLib.DesignIntf.TIconData>");
  $mod.$rtti.$Class("TEnumerable<WEBLib.DesignIntf.TIconData>");
  $mod.$rtti.$Class("TDictionary<System.String,WEBLib.DesignIntf.TIconData>");
  $mod.$rtti.$Class("TObjectDictionary<System.String,WEBLib.DesignIntf.TIconData>");
  $mod.$rtti.$Class("TEnumerator<WEBLib.TMSFNCFilterDialog.TTMSFNCFilterDialogDrawItem>");
  $mod.$rtti.$Class("TEnumerable<WEBLib.TMSFNCFilterDialog.TTMSFNCFilterDialogDrawItem>");
  $mod.$rtti.$Class("TCustomArrayHelper<WEBLib.TMSFNCFilterDialog.TTMSFNCFilterDialogDrawItem>");
  $mod.$rtti.$Class("TArrayHelper<WEBLib.TMSFNCFilterDialog.TTMSFNCFilterDialogDrawItem>");
  $mod.$rtti.$Class("TCustomList<WEBLib.TMSFNCFilterDialog.TTMSFNCFilterDialogDrawItem>");
  $mod.$rtti.$Class("TCustomListEnumerator<WEBLib.TMSFNCFilterDialog.TTMSFNCFilterDialogDrawItem>");
  $mod.$rtti.$Class("TList<WEBLib.TMSFNCFilterDialog.TTMSFNCFilterDialogDrawItem>");
  $mod.$rtti.$Class("TObjectList<WEBLib.TMSFNCFilterDialog.TTMSFNCFilterDialogDrawItem>");
  $mod.$rtti.$Class("TEnumerator<Generics.Collections.TPair<System.Longint,WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellItem>>");
  $mod.$rtti.$Class("TEnumerable<Generics.Collections.TPair<System.Longint,WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellItem>>");
  $mod.$rtti.$Class("TEnumerator<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellItem>");
  $mod.$rtti.$Class("TEnumerable<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellItem>");
  $mod.$rtti.$Class("TDictionary<System.Longint,WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellItem>");
  $mod.$rtti.$Class("TObjectDictionary<System.Longint,WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellItem>");
  $mod.$rtti.$Class("TEnumerator<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellControlCache>");
  $mod.$rtti.$Class("TEnumerable<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellControlCache>");
  $mod.$rtti.$Class("TCustomArrayHelper<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellControlCache>");
  $mod.$rtti.$Class("TArrayHelper<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellControlCache>");
  $mod.$rtti.$Class("TCustomList<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellControlCache>");
  $mod.$rtti.$Class("TCustomListEnumerator<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellControlCache>");
  $mod.$rtti.$Class("TList<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellControlCache>");
  $mod.$rtti.$Class("TObjectList<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellControlCache>");
  $mod.$rtti.$Class("TEnumerator<Generics.Collections.TPair<System.Longint,WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridRowItem>>");
  $mod.$rtti.$Class("TEnumerable<Generics.Collections.TPair<System.Longint,WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridRowItem>>");
  $mod.$rtti.$Class("TEnumerator<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridRowItem>");
  $mod.$rtti.$Class("TEnumerable<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridRowItem>");
  $mod.$rtti.$Class("TDictionary<System.Longint,WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridRowItem>");
  $mod.$rtti.$Class("TObjectDictionary<System.Longint,WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridRowItem>");
  $mod.$rtti.$Class("TEnumerator<Generics.Collections.TPair<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataGroup>>");
  $mod.$rtti.$Class("TEnumerable<Generics.Collections.TPair<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataGroup>>");
  $mod.$rtti.$Class("TEnumerator<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataGroup>");
  $mod.$rtti.$Class("TEnumerable<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataGroup>");
  $mod.$rtti.$Class("TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataGroup>");
  $mod.$rtti.$Class("TObjectDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataGroup>");
  $mod.$rtti.$Class("TEnumerator<Generics.Collections.TPair<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>>");
  $mod.$rtti.$Class("TEnumerable<Generics.Collections.TPair<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>>");
  $mod.$rtti.$Class("TEnumerator<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>");
  $mod.$rtti.$Class("TEnumerable<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>");
  $mod.$rtti.$Class("TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>");
  $mod.$rtti.$Class("TEnumerator<Generics.Collections.TPair<System.Longint,Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>>>");
  $mod.$rtti.$Class("TEnumerable<Generics.Collections.TPair<System.Longint,Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>>>");
  $mod.$rtti.$Class("TEnumerator<Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>>");
  $mod.$rtti.$Class("TEnumerable<Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>>");
  $mod.$rtti.$Class("TDictionary<System.Longint,Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>>");
  $mod.$rtti.$Class("TObjectDictionary<System.Longint,Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>>");
  $mod.$rtti.$Class("TEnumerator<Generics.Collections.TPair<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>>");
  $mod.$rtti.$Class("TEnumerable<Generics.Collections.TPair<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>>");
  $mod.$rtti.$Class("TEnumerator<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>");
  $mod.$rtti.$Class("TEnumerable<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>");
  $mod.$rtti.$Class("TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>");
  $mod.$rtti.$Class("TEnumerator<Generics.Collections.TPair<System.Longint,Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>>>");
  $mod.$rtti.$Class("TEnumerable<Generics.Collections.TPair<System.Longint,Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>>>");
  $mod.$rtti.$Class("TEnumerator<Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>>");
  $mod.$rtti.$Class("TEnumerable<Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>>");
  $mod.$rtti.$Class("TDictionary<System.Longint,Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>>");
  $mod.$rtti.$Class("TObjectDictionary<System.Longint,Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>>");
  $mod.$rtti.$Class("TEnumerator<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>");
  $mod.$rtti.$Class("TEnumerable<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>");
  $mod.$rtti.$Class("TCustomArrayHelper<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>");
  $mod.$rtti.$Class("TArrayHelper<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>");
  $mod.$rtti.$Class("TCustomList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>");
  $mod.$rtti.$Class("TCustomListEnumerator<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>");
  $mod.$rtti.$Class("TList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>");
  $mod.$rtti.$Class("TObjectList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>");
  $mod.$rtti.$Class("TEnumerator<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataTempData>");
  $mod.$rtti.$Class("TEnumerable<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataTempData>");
  $mod.$rtti.$Class("TCustomArrayHelper<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataTempData>");
  $mod.$rtti.$Class("TArrayHelper<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataTempData>");
  $mod.$rtti.$Class("TCustomList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataTempData>");
  $mod.$rtti.$Class("TCustomListEnumerator<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataTempData>");
  $mod.$rtti.$Class("TList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataTempData>");
  $mod.$rtti.$Class("TObjectList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataTempData>");
  $mod.$rtti.$Class("TEnumerator<Generics.Collections.TPair<System.String,System.TArray<System.String>>>");
  $mod.$rtti.$Class("TEnumerable<Generics.Collections.TPair<System.String,System.TArray<System.String>>>");
  $mod.$rtti.$Class("TEnumerator<System.TArray<System.String>>");
  $mod.$rtti.$Class("TEnumerable<System.TArray<System.String>>");
  $mod.$rtti.$Class("TDictionary<System.String,System.TArray<System.String>>");
  $mod.$rtti.$Class("TEnumerator<Generics.Collections.TPair<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataCustomListIndexEntry>>");
  $mod.$rtti.$Class("TEnumerable<Generics.Collections.TPair<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataCustomListIndexEntry>>");
  $mod.$rtti.$Class("TEnumerator<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataCustomListIndexEntry>");
  $mod.$rtti.$Class("TEnumerable<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataCustomListIndexEntry>");
  $mod.$rtti.$Class("TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataCustomListIndexEntry>");
  $mod.$rtti.$Class("TEnumerator<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCell>");
  $mod.$rtti.$Class("TEnumerable<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCell>");
  $mod.$rtti.$Class("TCustomArrayHelper<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCell>");
  $mod.$rtti.$Class("TArrayHelper<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCell>");
  $mod.$rtti.$Class("TCustomList<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCell>");
  $mod.$rtti.$Class("TCustomListEnumerator<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCell>");
  $mod.$rtti.$Class("TList<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCell>");
  $mod.$rtti.$Class("TObjectList<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCell>");
  $mod.$rtti.$Class("TEnumerator<Generics.Collections.TPair<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord,System.Boolean>>");
  $mod.$rtti.$Class("TEnumerable<Generics.Collections.TPair<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord,System.Boolean>>");
  $mod.$rtti.$Class("TEnumerator<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord>");
  $mod.$rtti.$Class("TEnumerable<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord>");
  $mod.$rtti.$Class("TDictionary<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord,System.Boolean>");
  $mod.$rtti.$Class("TCustomArrayHelper<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord>");
  $mod.$rtti.$Class("TArrayHelper<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord>");
  $mod.$rtti.$Class("TCustomList<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord>");
  $mod.$rtti.$Class("TCustomListEnumerator<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord>");
  $mod.$rtti.$Class("TList<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord>");
  $mod.$rtti.$Class("TEnumerator<WEBLib.TMSFNCDataGridRenderer.TTMSFNCDataGridCellControlWrapperListItem>");
  $mod.$rtti.$Class("TEnumerable<WEBLib.TMSFNCDataGridRenderer.TTMSFNCDataGridCellControlWrapperListItem>");
  $mod.$rtti.$Class("TCustomArrayHelper<WEBLib.TMSFNCDataGridRenderer.TTMSFNCDataGridCellControlWrapperListItem>");
  $mod.$rtti.$Class("TArrayHelper<WEBLib.TMSFNCDataGridRenderer.TTMSFNCDataGridCellControlWrapperListItem>");
  $mod.$rtti.$Class("TCustomList<WEBLib.TMSFNCDataGridRenderer.TTMSFNCDataGridCellControlWrapperListItem>");
  $mod.$rtti.$Class("TCustomListEnumerator<WEBLib.TMSFNCDataGridRenderer.TTMSFNCDataGridCellControlWrapperListItem>");
  $mod.$rtti.$Class("TList<WEBLib.TMSFNCDataGridRenderer.TTMSFNCDataGridCellControlWrapperListItem>");
  $mod.$rtti.$Class("TObjectList<WEBLib.TMSFNCDataGridRenderer.TTMSFNCDataGridCellControlWrapperListItem>");
  $mod.$rtti.$Class("TEnumerator<WEBLib.TMSFNCDataGrid.TTMSFNCDataGridHeaderGroup>");
  $mod.$rtti.$Class("TEnumerable<WEBLib.TMSFNCDataGrid.TTMSFNCDataGridHeaderGroup>");
  $mod.$rtti.$Class("TCustomArrayHelper<WEBLib.TMSFNCDataGrid.TTMSFNCDataGridHeaderGroup>");
  $mod.$rtti.$Class("TArrayHelper<WEBLib.TMSFNCDataGrid.TTMSFNCDataGridHeaderGroup>");
  $mod.$rtti.$Class("TCustomList<WEBLib.TMSFNCDataGrid.TTMSFNCDataGridHeaderGroup>");
  $mod.$rtti.$Class("TCustomListEnumerator<WEBLib.TMSFNCDataGrid.TTMSFNCDataGridHeaderGroup>");
  $mod.$rtti.$Class("TList<WEBLib.TMSFNCDataGrid.TTMSFNCDataGridHeaderGroup>");
  $mod.$rtti.$Class("TObjectList<WEBLib.TMSFNCDataGrid.TTMSFNCDataGridHeaderGroup>");
  $mod.$rtti.$Class("TEnumerator<Generics.Collections.TPair<System.Longint,Generics.Collections.TObjectList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>>>");
  $mod.$rtti.$Class("TEnumerable<Generics.Collections.TPair<System.Longint,Generics.Collections.TObjectList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>>>");
  $mod.$rtti.$Class("TEnumerator<Generics.Collections.TObjectList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>>");
  $mod.$rtti.$Class("TEnumerable<Generics.Collections.TObjectList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>>");
  $mod.$rtti.$Class("TDictionary<System.Longint,Generics.Collections.TObjectList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>>");
  $mod.$rtti.$Class("TObjectDictionary<System.Longint,Generics.Collections.TObjectList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>>");
  $mod.$rtti.$Class("TEnumerator<Generics.Collections.TPair<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord,System.Longint>>");
  $mod.$rtti.$Class("TEnumerable<Generics.Collections.TPair<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord,System.Longint>>");
  $mod.$rtti.$Class("TDictionary<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord,System.Longint>");
  this.TCollectionNotification = {"0": "cnAdded", cnAdded: 0, "1": "cnRemoved", cnRemoved: 1, "2": "cnExtracted", cnExtracted: 2};
  this.$rtti.$Enum("TCollectionNotification",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TCollectionNotification});
  rtl.recNewT(this,"TBinarySearchResult",function () {
    this.FoundIndex = 0;
    this.CandidateIndex = 0;
    this.CompareResult = 0;
    this.$eq = function (b) {
      return (this.FoundIndex === b.FoundIndex) && (this.CandidateIndex === b.CandidateIndex) && (this.CompareResult === b.CompareResult);
    };
    this.$assign = function (s) {
      this.FoundIndex = s.FoundIndex;
      this.CandidateIndex = s.CandidateIndex;
      this.CompareResult = s.CompareResult;
      return this;
    };
    var $r = $mod.$rtti.$Record("TBinarySearchResult",{},this);
    $r.addField("FoundIndex",rtl.nativeint);
    $r.addField("CandidateIndex",rtl.nativeint);
    $r.addField("CompareResult",rtl.nativeint);
  });
  this.TDirection = {"0": "FromBeginning", FromBeginning: 0, "1": "fromEnd", fromEnd: 1};
  this.$rtti.$Enum("TDirection",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TDirection});
  rtl.createClass(this,"EDictionary",pas.SysUtils.Exception,function () {
  });
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TPair$Generics$Collections$TDictionary$TKey$Generics$Collections$TDictionary$TValue$",pas.System.TObject,function () {
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<Generics.Collections.TPair<Generics.Collections.TDictionary.TKey,Generics.Collections.TDictionary.TValue>>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TPair$Generics$Collections$TDictionary$TKey$Generics$Collections$TDictionary$TValue$",pas.System.TObject,function () {
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push($mod.TPair$$$G$$generics$collections$$TKey$$TValue.$clone(LEnumerator.DoGetCurrent()));
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<Generics.Collections.TPair<Generics.Collections.TDictionary.TKey,Generics.Collections.TDictionary.TValue>>");
  this.TDictionaryOwnership = {"0": "doOwnsKeys", doOwnsKeys: 0, "1": "doOwnsValues", doOwnsValues: 1};
  this.$rtti.$Enum("TDictionaryOwnership",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TDictionaryOwnership});
  this.$rtti.$Set("TDictionaryOwnerships",{comptype: this.$rtti["TDictionaryOwnership"]});
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TPair$Generics$Collections$TObjectDictionary$TKey$Generics$Collections$TObjectDictionary$TValue$",pas.System.TObject,function () {
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<Generics.Collections.TPair<Generics.Collections.TObjectDictionary.TKey,Generics.Collections.TObjectDictionary.TValue>>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TPair$Generics$Collections$TObjectDictionary$TKey$Generics$Collections$TObjectDictionary$TValue$",pas.System.TObject,function () {
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push($mod.TPair$$$G$$generics$collections$$TKey$$TValue.$clone(LEnumerator.DoGetCurrent()));
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<Generics.Collections.TPair<Generics.Collections.TObjectDictionary.TKey,Generics.Collections.TObjectDictionary.TValue>>");
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderColumn>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push(LEnumerator.DoGetCurrent());
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderColumn>");
  this.$rtti.$MethodVar("TCollectionNotifyEvent<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderColumn>",{init: function () {
      this.procsig = rtl.newTIProcSig([["ASender",pas.System.$rtti["TObject"]],["AItem",pas["TMS.TMSFNCFilterBuilder"].$rtti["TTMSFNCFilterBuilderColumn"],2],["AAction",$mod.$rtti["TCollectionNotification"]]]);
    }, methodkind: 0});
  rtl.createClass(this,"TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.Sort = function (AValues, AComparer) {
      this.Sort$1(AValues,AComparer,0,rtl.length(AValues.get()));
    };
    this.Sort$1 = function (AValues, AComparer, AIndex, ACount) {
      if (ACount <= 1) return;
      this.QuickSort(AValues,AIndex,(AIndex + ACount) - 1,AComparer);
    };
    this.BinarySearch$2 = function (AValues, AItem, AFoundIndex, AComparer) {
      var Result = false;
      Result = this.BinarySearch$1(AValues,AItem,AFoundIndex,AComparer,0,rtl.length(AValues));
      return Result;
    };
    this.BinarySearch$3 = function (AValues, AItem, ASearchResult, AComparer) {
      var Result = false;
      Result = this.BinarySearch(AValues,AItem,ASearchResult,AComparer,0,rtl.length(AValues));
      return Result;
    };
  },"TCustomArrayHelper<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderColumn>");
  rtl.createClass(this,"TArrayHelper$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn",this.TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn,function () {
    this.$initSpec = function () {
    };
    this.QuickSort = function (AValues, ALeft, ARight, AComparer) {
      var I = 0;
      var J = 0;
      var P = null;
      var Q = null;
      if (((ARight - ALeft) <= 0) || (rtl.length(AValues.get()) === 0)) return;
      do {
        I = ALeft;
        J = ARight;
        P = AValues.get()[ALeft + Math.floor((ARight - ALeft) / 2)];
        do {
          while (AComparer.Compare(AValues.get()[I],P) < 0) I += 1;
          while (AComparer.Compare(AValues.get()[J],P) > 0) J -= 1;
          if (I <= J) {
            if (I !== J) {
              Q = AValues.get()[I];
              AValues.get()[I] = AValues.get()[J];
              AValues.get()[J] = Q;
            };
            I += 1;
            J -= 1;
          };
        } while (!(I > J));
        if ((J - ALeft) < (ARight - I)) {
          if (ALeft < J) this.QuickSort(AValues,ALeft,J,AComparer);
          ALeft = I;
        } else {
          if (I < ARight) this.QuickSort(AValues,I,ARight,AComparer);
          ARight = J;
        };
      } while (!(ALeft >= ARight));
    };
    this.BinarySearch = function (AValues, AItem, ASearchResult, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var ilo = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      ilo = imid * imid;
      imid = ilo * imid;
      while (imin < imax) {
        imid = rtl.trunc((imax + imin) / 2);
        ASearchResult.CompareResult = AComparer.Compare(AValues[imid],AItem);
        if (ASearchResult.CompareResult < 0) {
          imin = imid + 1}
         else {
          if (ASearchResult.CompareResult === 0) {
            ASearchResult.FoundIndex = imid;
            ASearchResult.CandidateIndex = imid;
            return true;
          };
          imax = imid;
        };
      };
      Result = imax === imin;
      if (Result) {
        ASearchResult.CompareResult = AComparer.Compare(AValues[imin],AItem);
        ASearchResult.CandidateIndex = imin;
        Result = ASearchResult.CompareResult === 0;
        if (Result) {
          ASearchResult.FoundIndex = imin}
         else ASearchResult.FoundIndex = -1;
      } else {
        ASearchResult.CompareResult = 0;
        ASearchResult.FoundIndex = -1;
        ASearchResult.CandidateIndex = -1;
      };
      return Result;
    };
    this.BinarySearch$1 = function (AValues, AItem, AFoundIndex, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var LCompare = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      while (imin < imax) {
        imid = rtl.trunc((imin + imax) / 2);
        LCompare = AComparer.Compare(AValues[imid],AItem);
        if (LCompare < 0) {
          imin = imid + 1}
         else {
          if (LCompare === 0) {
            AFoundIndex.set(imid);
            return true;
          };
          imax = imid;
        };
      };
      LCompare = AComparer.Compare(AValues[imin],AItem);
      Result = (imax === imin) && (LCompare === 0);
      if (Result) {
        AFoundIndex.set(imin)}
       else AFoundIndex.set(-1);
      return Result;
    };
  },"TArrayHelper<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderColumn>");
  rtl.createClass(this,"TCustomList$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn",this.TEnumerable$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $mod.$rtti.$DynArray("TCustomList<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderColumn>.FItems$a",{eltype: pas["TMS.TMSFNCFilterBuilder"].$rtti["TTMSFNCFilterBuilderColumn"]});
    };
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn.$init.call(this);
      this.FOnNotify = null;
      this.FLength = 0;
      this.FItems = [];
    };
    this.$final = function () {
      this.FOnNotify = undefined;
      this.FItems = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn.$final.call(this);
    };
    this.GetCapacity = function () {
      var Result = 0;
      Result = rtl.length(this.FItems);
      return Result;
    };
    this.PrepareAddingItem = function () {
      var Result = 0;
      if (this.FLength === rtl.length(this.FItems)) this.FItems.push(null);
      Result = this.FLength;
      this.FLength += 1;
      return Result;
    };
    this.PrepareAddingRange = function (ACount) {
      var Result = 0;
      var l = 0;
      if (ACount < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (ACount === 0) return this.FLength - 1;
      for (var $l = rtl.length(this.FItems) + 1, $end = this.FLength + ACount; $l <= $end; $l++) {
        l = $l;
        this.FItems.push(null);
      };
      Result = this.FLength;
      this.FLength += ACount;
      return Result;
    };
    this.Notify = function (AValue, ACollectionNotification) {
      if (this.FOnNotify != null) this.FOnNotify(this,AValue,ACollectionNotification);
    };
    this.DoRemove = function (AIndex, ACollectionNotification) {
      var Result = null;
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      this.FLength -= 1;
      this.FItems[AIndex] = null;
      this.FItems.splice(AIndex,1);
      this.Notify(Result,ACollectionNotification);
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FLength;
      return Result;
    };
  },"TCustomList<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderColumn>");
  rtl.createClass(this,"TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn",this.TEnumerator$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn,function () {
    this.$initSpec = function () {
    };
    this.$init = function () {
      $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn.$init.call(this);
      this.FList = null;
      this.FIndex = 0;
    };
    this.$final = function () {
      this.FList = undefined;
      $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn.$final.call(this);
    };
    this.DoMoveNext = function () {
      var Result = false;
      this.FIndex += 1;
      Result = (this.FList.FLength > 0) && (this.FIndex < this.FList.FLength);
      return Result;
    };
    this.DoGetCurrent = function () {
      var Result = null;
      Result = this.GetCurrent();
      return Result;
    };
    this.GetCurrent = function () {
      var Result = null;
      Result = this.FList.FItems[this.FIndex];
      return Result;
    };
    this.Create$1 = function (AList) {
      pas.System.TObject.Create.call(this);
      this.FIndex = -1;
      this.FList = AList;
      return this;
    };
  },"TCustomListEnumerator<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderColumn>");
  rtl.createClass(this,"TList$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn",this.TCustomList$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn,function () {
    this.$initSpec = function () {
      rtl.createClass(this,"TEnumerator",$mod.TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn,function () {
      },"TList<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderColumn>.TEnumerator");
    };
    this.$init = function () {
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn.$init.call(this);
      this.FComparer = null;
    };
    this.$final = function () {
      rtl.setIntfP(this,"FComparer",null);
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn.$final.call(this);
    };
    this.SameValue = function (Left, Right) {
      var Result = false;
      if (this.FComparer != null) {
        Result = this.FComparer.Compare(Left,Right) === 0}
       else Result = Left === Right;
      return Result;
    };
    this.SetCapacity = function (AValue) {
      if (AValue < this.FLength) this.SetCount(AValue);
      this.FItems = rtl.arraySetLength(this.FItems,null,AValue);
    };
    this.SetCount = function (AValue) {
      if (AValue < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (AValue > this.GetCapacity()) {
        this.SetCapacity(AValue)}
       else if (AValue < this.FLength) this.DeleteRange(AValue,this.FLength - AValue);
      this.FLength = AValue;
    };
    this.InitializeList = function () {
    };
    this.InternalInsert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.FItems.splice(AIndex,0,AValue);
      this.FLength += 1;
      this.FItems[AIndex] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.GetEnumerator$1();
      return Result;
    };
    this.GetItem = function (AIndex) {
      var Result = null;
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      return Result;
    };
    this.SetItem = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.Notify(this.FItems[AIndex],$mod.TCollectionNotification.cnRemoved);
      this.FItems[AIndex] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.Create$1 = function () {
      this.InitializeList();
      return this;
    };
    this.Create$2 = function (AComparer) {
      this.InitializeList();
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Create$3 = function (ACollection) {
      var LItem = null;
      this.Create$1();
      var $in = ACollection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LItem = $in.DoGetCurrent();
          this.Add(LItem);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Destroy = function () {
      this.SetCapacity(0);
    };
    this.Add = function (AValue) {
      var Result = 0;
      Result = this.PrepareAddingItem();
      this.FItems[Result] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
      return Result;
    };
    this.AddRange = function (AValues) {
      this.InsertRange(this.FLength,AValues);
    };
    this.AddRange$1 = function (AEnumerable) {
      var LValue = null;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.Add(LValue);
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.AddRange$2 = function (AEnumerable) {
      var LValue = null;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.Add(LValue);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Insert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.InternalInsert(AIndex,AValue);
    };
    this.InsertRange = function (AIndex, AValues) {
      var LLength = 0;
      var i = 0;
      var LValue = null;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LLength = rtl.length(AValues);
      if (LLength === 0) return;
      if (AIndex !== this.PrepareAddingRange(LLength)) {
        for (var $l = AIndex, $end = this.FLength - LLength - 1; $l <= $end; $l++) {
          i = $l;
          this.FItems[i + LLength] = this.FItems[i];
        };
        for (var $l1 = 0, $end1 = LLength - 1; $l1 <= $end1; $l1++) {
          i = $l1;
          this.FItems[AIndex + i] = null;
        };
      };
      for (var $l2 = 0, $end2 = LLength - 1; $l2 <= $end2; $l2++) {
        i = $l2;
        LValue = AValues[i];
        this.FItems[i + AIndex] = LValue;
        this.Notify(LValue,$mod.TCollectionNotification.cnAdded);
      };
    };
    this.InsertRange$1 = function (AIndex, AEnumerable) {
      var LValue = null;
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.InsertRange$2 = function (AIndex, AEnumerable) {
      var LValue = null;
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Remove = function (AValue) {
      var Result = 0;
      Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.RemoveItem = function (AValue, Direction) {
      var Result = 0;
      if (Direction === $mod.TDirection.fromEnd) {
        Result = this.LastIndexOf(AValue)}
       else Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.Delete = function (AIndex) {
      this.DoRemove(AIndex,$mod.TCollectionNotification.cnRemoved);
    };
    this.DeleteRange = function (AIndex, ACount) {
      var LDeleted = [];
      var i = 0;
      if (ACount === 0) return;
      if ((ACount < 0) || (AIndex < 0) || ((AIndex + ACount) > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LDeleted = this.FItems.splice(AIndex,this.FLength);
      this.FLength -= ACount;
      for (var $l = 0, $end = rtl.length(LDeleted) - 1; $l <= $end; $l++) {
        i = $l;
        this.Notify(LDeleted[i],$mod.TCollectionNotification.cnRemoved);
      };
    };
    this.ExtractIndex = function (AIndex) {
      var Result = null;
      Result = this.DoRemove(AIndex,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.Extract = function (AValue) {
      var Result = null;
      var LIndex = 0;
      LIndex = this.IndexOf(AValue);
      if (LIndex < 0) {
        Result = null}
       else Result = this.DoRemove(LIndex,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.Exchange = function (AIndex1, AIndex2) {
      var LTemp = null;
      LTemp = this.FItems[AIndex1];
      this.FItems[AIndex1] = this.FItems[AIndex2];
      this.FItems[AIndex2] = LTemp;
    };
    this.Move = function (AIndex, ANewIndex) {
      var Arr = null;
      var LTemp = undefined;
      var i = 0;
      if (ANewIndex === AIndex) return;
      if ((ANewIndex < 0) || (ANewIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Arr = this.FItems;
      LTemp = Arr[AIndex];
      if (AIndex < ANewIndex) {
        for (var $l = AIndex, $end = ANewIndex - 1; $l <= $end; $l++) {
          i = $l;
          Arr[i] = Arr[i + 1];
        }}
       else for (var $l1 = AIndex, $end1 = ANewIndex + 1; $l1 >= $end1; $l1--) {
        i = $l1;
        Arr[i] = Arr[i - 1];
      };
      Arr[ANewIndex] = LTemp;
    };
    this.First = function () {
      var Result = null;
      Result = this.GetItem(0);
      return Result;
    };
    this.Last = function () {
      var Result = null;
      Result = this.GetItem(this.FLength - 1);
      return Result;
    };
    this.Clear = function () {
      this.SetCount(0);
      this.SetCapacity(0);
    };
    this.Contains = function (AValue) {
      var Result = false;
      Result = this.IndexOf(AValue) >= 0;
      return Result;
    };
    this.IndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = 0, $end = this.FLength - 1; $l <= $end; $l++) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.LastIndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = this.FLength - 1; $l >= 0; $l--) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.Reverse = function () {
      var a = 0;
      var b = 0;
      var LTemp = null;
      a = 0;
      b = this.FLength - 1;
      while (a < b) {
        LTemp = this.FItems[a];
        this.FItems[a] = this.FItems[b];
        this.FItems[b] = LTemp;
        a += 1;
        b -= 1;
      };
    };
    this.TrimExcess = function () {
      this.SetCapacity(this.FLength);
    };
    this.Sort = function () {
      $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},this.FComparer,0,this.FLength);
    };
    this.Sort$1 = function (AComparer) {
      $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},AComparer,0,this.FLength);
    };
    this.BinarySearch = function (AItem, AIndex) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn.BinarySearch$1(this.FItems,AItem,AIndex,this.FComparer,0,this.FLength);
      return Result;
    };
    this.BinarySearch$1 = function (AItem, AIndex, AComparer) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn.BinarySearch$1(this.FItems,AItem,AIndex,AComparer,0,this.FLength);
      return Result;
    };
  },"TList<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderColumn>");
  rtl.createClass(this,"TObjectList$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn",this.TList$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn,function () {
    this.$initSpec = function () {
    };
    this.$init = function () {
      $mod.TList$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn.$init.call(this);
      this.FObjectsOwner = false;
    };
    this.Notify = function (aValue, Action) {
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn.Notify.call(this,aValue,Action);
      if (this.FObjectsOwner && (Action === $mod.TCollectionNotification.cnRemoved)) aValue = rtl.freeLoc(aValue);
    };
    this.Create$4 = function (aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn.Create$1.call(this);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
    this.Create$5 = function (AComparer, aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn.Create$2.call(this,AComparer);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
    this.Create$6 = function (aCollection, aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn.Create$3.call(this,aCollection);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
  },"TObjectList<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderColumn>");
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderExpression>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push(LEnumerator.DoGetCurrent());
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderExpression>");
  this.$rtti.$MethodVar("TCollectionNotifyEvent<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderExpression>",{init: function () {
      this.procsig = rtl.newTIProcSig([["ASender",pas.System.$rtti["TObject"]],["AItem",pas["TMS.TMSFNCFilterBuilder"].$rtti["TTMSFNCFilterBuilderExpression"],2],["AAction",$mod.$rtti["TCollectionNotification"]]]);
    }, methodkind: 0});
  rtl.createClass(this,"TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.Sort = function (AValues, AComparer) {
      this.Sort$1(AValues,AComparer,0,rtl.length(AValues.get()));
    };
    this.Sort$1 = function (AValues, AComparer, AIndex, ACount) {
      if (ACount <= 1) return;
      this.QuickSort(AValues,AIndex,(AIndex + ACount) - 1,AComparer);
    };
    this.BinarySearch$2 = function (AValues, AItem, AFoundIndex, AComparer) {
      var Result = false;
      Result = this.BinarySearch$1(AValues,AItem,AFoundIndex,AComparer,0,rtl.length(AValues));
      return Result;
    };
    this.BinarySearch$3 = function (AValues, AItem, ASearchResult, AComparer) {
      var Result = false;
      Result = this.BinarySearch(AValues,AItem,ASearchResult,AComparer,0,rtl.length(AValues));
      return Result;
    };
  },"TCustomArrayHelper<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderExpression>");
  rtl.createClass(this,"TArrayHelper$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression",this.TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression,function () {
    this.$initSpec = function () {
    };
    this.QuickSort = function (AValues, ALeft, ARight, AComparer) {
      var I = 0;
      var J = 0;
      var P = null;
      var Q = null;
      if (((ARight - ALeft) <= 0) || (rtl.length(AValues.get()) === 0)) return;
      do {
        I = ALeft;
        J = ARight;
        P = AValues.get()[ALeft + Math.floor((ARight - ALeft) / 2)];
        do {
          while (AComparer.Compare(AValues.get()[I],P) < 0) I += 1;
          while (AComparer.Compare(AValues.get()[J],P) > 0) J -= 1;
          if (I <= J) {
            if (I !== J) {
              Q = AValues.get()[I];
              AValues.get()[I] = AValues.get()[J];
              AValues.get()[J] = Q;
            };
            I += 1;
            J -= 1;
          };
        } while (!(I > J));
        if ((J - ALeft) < (ARight - I)) {
          if (ALeft < J) this.QuickSort(AValues,ALeft,J,AComparer);
          ALeft = I;
        } else {
          if (I < ARight) this.QuickSort(AValues,I,ARight,AComparer);
          ARight = J;
        };
      } while (!(ALeft >= ARight));
    };
    this.BinarySearch = function (AValues, AItem, ASearchResult, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var ilo = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      ilo = imid * imid;
      imid = ilo * imid;
      while (imin < imax) {
        imid = rtl.trunc((imax + imin) / 2);
        ASearchResult.CompareResult = AComparer.Compare(AValues[imid],AItem);
        if (ASearchResult.CompareResult < 0) {
          imin = imid + 1}
         else {
          if (ASearchResult.CompareResult === 0) {
            ASearchResult.FoundIndex = imid;
            ASearchResult.CandidateIndex = imid;
            return true;
          };
          imax = imid;
        };
      };
      Result = imax === imin;
      if (Result) {
        ASearchResult.CompareResult = AComparer.Compare(AValues[imin],AItem);
        ASearchResult.CandidateIndex = imin;
        Result = ASearchResult.CompareResult === 0;
        if (Result) {
          ASearchResult.FoundIndex = imin}
         else ASearchResult.FoundIndex = -1;
      } else {
        ASearchResult.CompareResult = 0;
        ASearchResult.FoundIndex = -1;
        ASearchResult.CandidateIndex = -1;
      };
      return Result;
    };
    this.BinarySearch$1 = function (AValues, AItem, AFoundIndex, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var LCompare = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      while (imin < imax) {
        imid = rtl.trunc((imin + imax) / 2);
        LCompare = AComparer.Compare(AValues[imid],AItem);
        if (LCompare < 0) {
          imin = imid + 1}
         else {
          if (LCompare === 0) {
            AFoundIndex.set(imid);
            return true;
          };
          imax = imid;
        };
      };
      LCompare = AComparer.Compare(AValues[imin],AItem);
      Result = (imax === imin) && (LCompare === 0);
      if (Result) {
        AFoundIndex.set(imin)}
       else AFoundIndex.set(-1);
      return Result;
    };
  },"TArrayHelper<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderExpression>");
  rtl.createClass(this,"TCustomList$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression",this.TEnumerable$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $mod.$rtti.$DynArray("TCustomList<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderExpression>.FItems$a",{eltype: pas["TMS.TMSFNCFilterBuilder"].$rtti["TTMSFNCFilterBuilderExpression"]});
    };
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression.$init.call(this);
      this.FOnNotify = null;
      this.FLength = 0;
      this.FItems = [];
    };
    this.$final = function () {
      this.FOnNotify = undefined;
      this.FItems = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression.$final.call(this);
    };
    this.GetCapacity = function () {
      var Result = 0;
      Result = rtl.length(this.FItems);
      return Result;
    };
    this.PrepareAddingItem = function () {
      var Result = 0;
      if (this.FLength === rtl.length(this.FItems)) this.FItems.push(null);
      Result = this.FLength;
      this.FLength += 1;
      return Result;
    };
    this.PrepareAddingRange = function (ACount) {
      var Result = 0;
      var l = 0;
      if (ACount < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (ACount === 0) return this.FLength - 1;
      for (var $l = rtl.length(this.FItems) + 1, $end = this.FLength + ACount; $l <= $end; $l++) {
        l = $l;
        this.FItems.push(null);
      };
      Result = this.FLength;
      this.FLength += ACount;
      return Result;
    };
    this.Notify = function (AValue, ACollectionNotification) {
      if (this.FOnNotify != null) this.FOnNotify(this,AValue,ACollectionNotification);
    };
    this.DoRemove = function (AIndex, ACollectionNotification) {
      var Result = null;
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      this.FLength -= 1;
      this.FItems[AIndex] = null;
      this.FItems.splice(AIndex,1);
      this.Notify(Result,ACollectionNotification);
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FLength;
      return Result;
    };
  },"TCustomList<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderExpression>");
  rtl.createClass(this,"TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression",this.TEnumerator$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression,function () {
    this.$initSpec = function () {
    };
    this.$init = function () {
      $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression.$init.call(this);
      this.FList = null;
      this.FIndex = 0;
    };
    this.$final = function () {
      this.FList = undefined;
      $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression.$final.call(this);
    };
    this.DoMoveNext = function () {
      var Result = false;
      this.FIndex += 1;
      Result = (this.FList.FLength > 0) && (this.FIndex < this.FList.FLength);
      return Result;
    };
    this.DoGetCurrent = function () {
      var Result = null;
      Result = this.GetCurrent();
      return Result;
    };
    this.GetCurrent = function () {
      var Result = null;
      Result = this.FList.FItems[this.FIndex];
      return Result;
    };
    this.Create$1 = function (AList) {
      pas.System.TObject.Create.call(this);
      this.FIndex = -1;
      this.FList = AList;
      return this;
    };
  },"TCustomListEnumerator<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderExpression>");
  rtl.createClass(this,"TList$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression",this.TCustomList$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression,function () {
    this.$initSpec = function () {
      rtl.createClass(this,"TEnumerator",$mod.TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression,function () {
      },"TList<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderExpression>.TEnumerator");
    };
    this.$init = function () {
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression.$init.call(this);
      this.FComparer = null;
    };
    this.$final = function () {
      rtl.setIntfP(this,"FComparer",null);
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression.$final.call(this);
    };
    this.SameValue = function (Left, Right) {
      var Result = false;
      if (this.FComparer != null) {
        Result = this.FComparer.Compare(Left,Right) === 0}
       else Result = Left === Right;
      return Result;
    };
    this.SetCapacity = function (AValue) {
      if (AValue < this.FLength) this.SetCount(AValue);
      this.FItems = rtl.arraySetLength(this.FItems,null,AValue);
    };
    this.SetCount = function (AValue) {
      if (AValue < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (AValue > this.GetCapacity()) {
        this.SetCapacity(AValue)}
       else if (AValue < this.FLength) this.DeleteRange(AValue,this.FLength - AValue);
      this.FLength = AValue;
    };
    this.InitializeList = function () {
    };
    this.InternalInsert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.FItems.splice(AIndex,0,AValue);
      this.FLength += 1;
      this.FItems[AIndex] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.GetEnumerator$1();
      return Result;
    };
    this.GetItem = function (AIndex) {
      var Result = null;
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      return Result;
    };
    this.SetItem = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.Notify(this.FItems[AIndex],$mod.TCollectionNotification.cnRemoved);
      this.FItems[AIndex] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.Create$1 = function () {
      this.InitializeList();
      return this;
    };
    this.Create$2 = function (AComparer) {
      this.InitializeList();
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Create$3 = function (ACollection) {
      var LItem = null;
      this.Create$1();
      var $in = ACollection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LItem = $in.DoGetCurrent();
          this.Add(LItem);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Destroy = function () {
      this.SetCapacity(0);
    };
    this.Add = function (AValue) {
      var Result = 0;
      Result = this.PrepareAddingItem();
      this.FItems[Result] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
      return Result;
    };
    this.AddRange = function (AValues) {
      this.InsertRange(this.FLength,AValues);
    };
    this.AddRange$1 = function (AEnumerable) {
      var LValue = null;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.Add(LValue);
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.AddRange$2 = function (AEnumerable) {
      var LValue = null;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.Add(LValue);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Insert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.InternalInsert(AIndex,AValue);
    };
    this.InsertRange = function (AIndex, AValues) {
      var LLength = 0;
      var i = 0;
      var LValue = null;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LLength = rtl.length(AValues);
      if (LLength === 0) return;
      if (AIndex !== this.PrepareAddingRange(LLength)) {
        for (var $l = AIndex, $end = this.FLength - LLength - 1; $l <= $end; $l++) {
          i = $l;
          this.FItems[i + LLength] = this.FItems[i];
        };
        for (var $l1 = 0, $end1 = LLength - 1; $l1 <= $end1; $l1++) {
          i = $l1;
          this.FItems[AIndex + i] = null;
        };
      };
      for (var $l2 = 0, $end2 = LLength - 1; $l2 <= $end2; $l2++) {
        i = $l2;
        LValue = AValues[i];
        this.FItems[i + AIndex] = LValue;
        this.Notify(LValue,$mod.TCollectionNotification.cnAdded);
      };
    };
    this.InsertRange$1 = function (AIndex, AEnumerable) {
      var LValue = null;
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.InsertRange$2 = function (AIndex, AEnumerable) {
      var LValue = null;
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Remove = function (AValue) {
      var Result = 0;
      Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.RemoveItem = function (AValue, Direction) {
      var Result = 0;
      if (Direction === $mod.TDirection.fromEnd) {
        Result = this.LastIndexOf(AValue)}
       else Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.Delete = function (AIndex) {
      this.DoRemove(AIndex,$mod.TCollectionNotification.cnRemoved);
    };
    this.DeleteRange = function (AIndex, ACount) {
      var LDeleted = [];
      var i = 0;
      if (ACount === 0) return;
      if ((ACount < 0) || (AIndex < 0) || ((AIndex + ACount) > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LDeleted = this.FItems.splice(AIndex,this.FLength);
      this.FLength -= ACount;
      for (var $l = 0, $end = rtl.length(LDeleted) - 1; $l <= $end; $l++) {
        i = $l;
        this.Notify(LDeleted[i],$mod.TCollectionNotification.cnRemoved);
      };
    };
    this.ExtractIndex = function (AIndex) {
      var Result = null;
      Result = this.DoRemove(AIndex,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.Extract = function (AValue) {
      var Result = null;
      var LIndex = 0;
      LIndex = this.IndexOf(AValue);
      if (LIndex < 0) {
        Result = null}
       else Result = this.DoRemove(LIndex,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.Exchange = function (AIndex1, AIndex2) {
      var LTemp = null;
      LTemp = this.FItems[AIndex1];
      this.FItems[AIndex1] = this.FItems[AIndex2];
      this.FItems[AIndex2] = LTemp;
    };
    this.Move = function (AIndex, ANewIndex) {
      var Arr = null;
      var LTemp = undefined;
      var i = 0;
      if (ANewIndex === AIndex) return;
      if ((ANewIndex < 0) || (ANewIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Arr = this.FItems;
      LTemp = Arr[AIndex];
      if (AIndex < ANewIndex) {
        for (var $l = AIndex, $end = ANewIndex - 1; $l <= $end; $l++) {
          i = $l;
          Arr[i] = Arr[i + 1];
        }}
       else for (var $l1 = AIndex, $end1 = ANewIndex + 1; $l1 >= $end1; $l1--) {
        i = $l1;
        Arr[i] = Arr[i - 1];
      };
      Arr[ANewIndex] = LTemp;
    };
    this.First = function () {
      var Result = null;
      Result = this.GetItem(0);
      return Result;
    };
    this.Last = function () {
      var Result = null;
      Result = this.GetItem(this.FLength - 1);
      return Result;
    };
    this.Clear = function () {
      this.SetCount(0);
      this.SetCapacity(0);
    };
    this.Contains = function (AValue) {
      var Result = false;
      Result = this.IndexOf(AValue) >= 0;
      return Result;
    };
    this.IndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = 0, $end = this.FLength - 1; $l <= $end; $l++) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.LastIndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = this.FLength - 1; $l >= 0; $l--) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.Reverse = function () {
      var a = 0;
      var b = 0;
      var LTemp = null;
      a = 0;
      b = this.FLength - 1;
      while (a < b) {
        LTemp = this.FItems[a];
        this.FItems[a] = this.FItems[b];
        this.FItems[b] = LTemp;
        a += 1;
        b -= 1;
      };
    };
    this.TrimExcess = function () {
      this.SetCapacity(this.FLength);
    };
    this.Sort = function () {
      $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},this.FComparer,0,this.FLength);
    };
    this.Sort$1 = function (AComparer) {
      $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},AComparer,0,this.FLength);
    };
    this.BinarySearch = function (AItem, AIndex) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression.BinarySearch$1(this.FItems,AItem,AIndex,this.FComparer,0,this.FLength);
      return Result;
    };
    this.BinarySearch$1 = function (AItem, AIndex, AComparer) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression.BinarySearch$1(this.FItems,AItem,AIndex,AComparer,0,this.FLength);
      return Result;
    };
  },"TList<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderExpression>");
  rtl.createClass(this,"TObjectList$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression",this.TList$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression,function () {
    this.$initSpec = function () {
    };
    this.$init = function () {
      $mod.TList$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression.$init.call(this);
      this.FObjectsOwner = false;
    };
    this.Notify = function (aValue, Action) {
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression.Notify.call(this,aValue,Action);
      if (this.FObjectsOwner && (Action === $mod.TCollectionNotification.cnRemoved)) aValue = rtl.freeLoc(aValue);
    };
    this.Create$4 = function (aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression.Create$1.call(this);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
    this.Create$5 = function (AComparer, aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression.Create$2.call(this,AComparer);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
    this.Create$6 = function (aCollection, aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression.Create$3.call(this,aCollection);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
  },"TObjectList<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderExpression>");
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroup>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push(LEnumerator.DoGetCurrent());
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroup>");
  this.$rtti.$MethodVar("TCollectionNotifyEvent<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroup>",{init: function () {
      this.procsig = rtl.newTIProcSig([["ASender",pas.System.$rtti["TObject"]],["AItem",pas["TMS.TMSFNCFilterBuilder"].$rtti["TTMSFNCFilterBuilderGroup"],2],["AAction",$mod.$rtti["TCollectionNotification"]]]);
    }, methodkind: 0});
  rtl.createClass(this,"TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.Sort = function (AValues, AComparer) {
      this.Sort$1(AValues,AComparer,0,rtl.length(AValues.get()));
    };
    this.Sort$1 = function (AValues, AComparer, AIndex, ACount) {
      if (ACount <= 1) return;
      this.QuickSort(AValues,AIndex,(AIndex + ACount) - 1,AComparer);
    };
    this.BinarySearch$2 = function (AValues, AItem, AFoundIndex, AComparer) {
      var Result = false;
      Result = this.BinarySearch$1(AValues,AItem,AFoundIndex,AComparer,0,rtl.length(AValues));
      return Result;
    };
    this.BinarySearch$3 = function (AValues, AItem, ASearchResult, AComparer) {
      var Result = false;
      Result = this.BinarySearch(AValues,AItem,ASearchResult,AComparer,0,rtl.length(AValues));
      return Result;
    };
  },"TCustomArrayHelper<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroup>");
  rtl.createClass(this,"TArrayHelper$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup",this.TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup,function () {
    this.$initSpec = function () {
    };
    this.QuickSort = function (AValues, ALeft, ARight, AComparer) {
      var I = 0;
      var J = 0;
      var P = null;
      var Q = null;
      if (((ARight - ALeft) <= 0) || (rtl.length(AValues.get()) === 0)) return;
      do {
        I = ALeft;
        J = ARight;
        P = AValues.get()[ALeft + Math.floor((ARight - ALeft) / 2)];
        do {
          while (AComparer.Compare(AValues.get()[I],P) < 0) I += 1;
          while (AComparer.Compare(AValues.get()[J],P) > 0) J -= 1;
          if (I <= J) {
            if (I !== J) {
              Q = AValues.get()[I];
              AValues.get()[I] = AValues.get()[J];
              AValues.get()[J] = Q;
            };
            I += 1;
            J -= 1;
          };
        } while (!(I > J));
        if ((J - ALeft) < (ARight - I)) {
          if (ALeft < J) this.QuickSort(AValues,ALeft,J,AComparer);
          ALeft = I;
        } else {
          if (I < ARight) this.QuickSort(AValues,I,ARight,AComparer);
          ARight = J;
        };
      } while (!(ALeft >= ARight));
    };
    this.BinarySearch = function (AValues, AItem, ASearchResult, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var ilo = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      ilo = imid * imid;
      imid = ilo * imid;
      while (imin < imax) {
        imid = rtl.trunc((imax + imin) / 2);
        ASearchResult.CompareResult = AComparer.Compare(AValues[imid],AItem);
        if (ASearchResult.CompareResult < 0) {
          imin = imid + 1}
         else {
          if (ASearchResult.CompareResult === 0) {
            ASearchResult.FoundIndex = imid;
            ASearchResult.CandidateIndex = imid;
            return true;
          };
          imax = imid;
        };
      };
      Result = imax === imin;
      if (Result) {
        ASearchResult.CompareResult = AComparer.Compare(AValues[imin],AItem);
        ASearchResult.CandidateIndex = imin;
        Result = ASearchResult.CompareResult === 0;
        if (Result) {
          ASearchResult.FoundIndex = imin}
         else ASearchResult.FoundIndex = -1;
      } else {
        ASearchResult.CompareResult = 0;
        ASearchResult.FoundIndex = -1;
        ASearchResult.CandidateIndex = -1;
      };
      return Result;
    };
    this.BinarySearch$1 = function (AValues, AItem, AFoundIndex, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var LCompare = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      while (imin < imax) {
        imid = rtl.trunc((imin + imax) / 2);
        LCompare = AComparer.Compare(AValues[imid],AItem);
        if (LCompare < 0) {
          imin = imid + 1}
         else {
          if (LCompare === 0) {
            AFoundIndex.set(imid);
            return true;
          };
          imax = imid;
        };
      };
      LCompare = AComparer.Compare(AValues[imin],AItem);
      Result = (imax === imin) && (LCompare === 0);
      if (Result) {
        AFoundIndex.set(imin)}
       else AFoundIndex.set(-1);
      return Result;
    };
  },"TArrayHelper<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroup>");
  rtl.createClass(this,"TCustomList$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup",this.TEnumerable$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $mod.$rtti.$DynArray("TCustomList<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroup>.FItems$a",{eltype: pas["TMS.TMSFNCFilterBuilder"].$rtti["TTMSFNCFilterBuilderGroup"]});
    };
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup.$init.call(this);
      this.FOnNotify = null;
      this.FLength = 0;
      this.FItems = [];
    };
    this.$final = function () {
      this.FOnNotify = undefined;
      this.FItems = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup.$final.call(this);
    };
    this.GetCapacity = function () {
      var Result = 0;
      Result = rtl.length(this.FItems);
      return Result;
    };
    this.PrepareAddingItem = function () {
      var Result = 0;
      if (this.FLength === rtl.length(this.FItems)) this.FItems.push(null);
      Result = this.FLength;
      this.FLength += 1;
      return Result;
    };
    this.PrepareAddingRange = function (ACount) {
      var Result = 0;
      var l = 0;
      if (ACount < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (ACount === 0) return this.FLength - 1;
      for (var $l = rtl.length(this.FItems) + 1, $end = this.FLength + ACount; $l <= $end; $l++) {
        l = $l;
        this.FItems.push(null);
      };
      Result = this.FLength;
      this.FLength += ACount;
      return Result;
    };
    this.Notify = function (AValue, ACollectionNotification) {
      if (this.FOnNotify != null) this.FOnNotify(this,AValue,ACollectionNotification);
    };
    this.DoRemove = function (AIndex, ACollectionNotification) {
      var Result = null;
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      this.FLength -= 1;
      this.FItems[AIndex] = null;
      this.FItems.splice(AIndex,1);
      this.Notify(Result,ACollectionNotification);
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FLength;
      return Result;
    };
  },"TCustomList<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroup>");
  rtl.createClass(this,"TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup",this.TEnumerator$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup,function () {
    this.$initSpec = function () {
    };
    this.$init = function () {
      $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup.$init.call(this);
      this.FList = null;
      this.FIndex = 0;
    };
    this.$final = function () {
      this.FList = undefined;
      $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup.$final.call(this);
    };
    this.DoMoveNext = function () {
      var Result = false;
      this.FIndex += 1;
      Result = (this.FList.FLength > 0) && (this.FIndex < this.FList.FLength);
      return Result;
    };
    this.DoGetCurrent = function () {
      var Result = null;
      Result = this.GetCurrent();
      return Result;
    };
    this.GetCurrent = function () {
      var Result = null;
      Result = this.FList.FItems[this.FIndex];
      return Result;
    };
    this.Create$1 = function (AList) {
      pas.System.TObject.Create.call(this);
      this.FIndex = -1;
      this.FList = AList;
      return this;
    };
  },"TCustomListEnumerator<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroup>");
  rtl.createClass(this,"TList$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup",this.TCustomList$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup,function () {
    this.$initSpec = function () {
      rtl.createClass(this,"TEnumerator",$mod.TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup,function () {
      },"TList<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroup>.TEnumerator");
    };
    this.$init = function () {
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup.$init.call(this);
      this.FComparer = null;
    };
    this.$final = function () {
      rtl.setIntfP(this,"FComparer",null);
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup.$final.call(this);
    };
    this.SameValue = function (Left, Right) {
      var Result = false;
      if (this.FComparer != null) {
        Result = this.FComparer.Compare(Left,Right) === 0}
       else Result = Left === Right;
      return Result;
    };
    this.SetCapacity = function (AValue) {
      if (AValue < this.FLength) this.SetCount(AValue);
      this.FItems = rtl.arraySetLength(this.FItems,null,AValue);
    };
    this.SetCount = function (AValue) {
      if (AValue < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (AValue > this.GetCapacity()) {
        this.SetCapacity(AValue)}
       else if (AValue < this.FLength) this.DeleteRange(AValue,this.FLength - AValue);
      this.FLength = AValue;
    };
    this.InitializeList = function () {
    };
    this.InternalInsert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.FItems.splice(AIndex,0,AValue);
      this.FLength += 1;
      this.FItems[AIndex] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.GetEnumerator$1();
      return Result;
    };
    this.GetItem = function (AIndex) {
      var Result = null;
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      return Result;
    };
    this.SetItem = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.Notify(this.FItems[AIndex],$mod.TCollectionNotification.cnRemoved);
      this.FItems[AIndex] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.Create$1 = function () {
      this.InitializeList();
      return this;
    };
    this.Create$2 = function (AComparer) {
      this.InitializeList();
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Create$3 = function (ACollection) {
      var LItem = null;
      this.Create$1();
      var $in = ACollection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LItem = $in.DoGetCurrent();
          this.Add(LItem);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Destroy = function () {
      this.SetCapacity(0);
    };
    this.Add = function (AValue) {
      var Result = 0;
      Result = this.PrepareAddingItem();
      this.FItems[Result] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
      return Result;
    };
    this.AddRange = function (AValues) {
      this.InsertRange(this.FLength,AValues);
    };
    this.AddRange$1 = function (AEnumerable) {
      var LValue = null;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.Add(LValue);
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.AddRange$2 = function (AEnumerable) {
      var LValue = null;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.Add(LValue);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Insert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.InternalInsert(AIndex,AValue);
    };
    this.InsertRange = function (AIndex, AValues) {
      var LLength = 0;
      var i = 0;
      var LValue = null;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LLength = rtl.length(AValues);
      if (LLength === 0) return;
      if (AIndex !== this.PrepareAddingRange(LLength)) {
        for (var $l = AIndex, $end = this.FLength - LLength - 1; $l <= $end; $l++) {
          i = $l;
          this.FItems[i + LLength] = this.FItems[i];
        };
        for (var $l1 = 0, $end1 = LLength - 1; $l1 <= $end1; $l1++) {
          i = $l1;
          this.FItems[AIndex + i] = null;
        };
      };
      for (var $l2 = 0, $end2 = LLength - 1; $l2 <= $end2; $l2++) {
        i = $l2;
        LValue = AValues[i];
        this.FItems[i + AIndex] = LValue;
        this.Notify(LValue,$mod.TCollectionNotification.cnAdded);
      };
    };
    this.InsertRange$1 = function (AIndex, AEnumerable) {
      var LValue = null;
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.InsertRange$2 = function (AIndex, AEnumerable) {
      var LValue = null;
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Remove = function (AValue) {
      var Result = 0;
      Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.RemoveItem = function (AValue, Direction) {
      var Result = 0;
      if (Direction === $mod.TDirection.fromEnd) {
        Result = this.LastIndexOf(AValue)}
       else Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.Delete = function (AIndex) {
      this.DoRemove(AIndex,$mod.TCollectionNotification.cnRemoved);
    };
    this.DeleteRange = function (AIndex, ACount) {
      var LDeleted = [];
      var i = 0;
      if (ACount === 0) return;
      if ((ACount < 0) || (AIndex < 0) || ((AIndex + ACount) > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LDeleted = this.FItems.splice(AIndex,this.FLength);
      this.FLength -= ACount;
      for (var $l = 0, $end = rtl.length(LDeleted) - 1; $l <= $end; $l++) {
        i = $l;
        this.Notify(LDeleted[i],$mod.TCollectionNotification.cnRemoved);
      };
    };
    this.ExtractIndex = function (AIndex) {
      var Result = null;
      Result = this.DoRemove(AIndex,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.Extract = function (AValue) {
      var Result = null;
      var LIndex = 0;
      LIndex = this.IndexOf(AValue);
      if (LIndex < 0) {
        Result = null}
       else Result = this.DoRemove(LIndex,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.Exchange = function (AIndex1, AIndex2) {
      var LTemp = null;
      LTemp = this.FItems[AIndex1];
      this.FItems[AIndex1] = this.FItems[AIndex2];
      this.FItems[AIndex2] = LTemp;
    };
    this.Move = function (AIndex, ANewIndex) {
      var Arr = null;
      var LTemp = undefined;
      var i = 0;
      if (ANewIndex === AIndex) return;
      if ((ANewIndex < 0) || (ANewIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Arr = this.FItems;
      LTemp = Arr[AIndex];
      if (AIndex < ANewIndex) {
        for (var $l = AIndex, $end = ANewIndex - 1; $l <= $end; $l++) {
          i = $l;
          Arr[i] = Arr[i + 1];
        }}
       else for (var $l1 = AIndex, $end1 = ANewIndex + 1; $l1 >= $end1; $l1--) {
        i = $l1;
        Arr[i] = Arr[i - 1];
      };
      Arr[ANewIndex] = LTemp;
    };
    this.First = function () {
      var Result = null;
      Result = this.GetItem(0);
      return Result;
    };
    this.Last = function () {
      var Result = null;
      Result = this.GetItem(this.FLength - 1);
      return Result;
    };
    this.Clear = function () {
      this.SetCount(0);
      this.SetCapacity(0);
    };
    this.Contains = function (AValue) {
      var Result = false;
      Result = this.IndexOf(AValue) >= 0;
      return Result;
    };
    this.IndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = 0, $end = this.FLength - 1; $l <= $end; $l++) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.LastIndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = this.FLength - 1; $l >= 0; $l--) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.Reverse = function () {
      var a = 0;
      var b = 0;
      var LTemp = null;
      a = 0;
      b = this.FLength - 1;
      while (a < b) {
        LTemp = this.FItems[a];
        this.FItems[a] = this.FItems[b];
        this.FItems[b] = LTemp;
        a += 1;
        b -= 1;
      };
    };
    this.TrimExcess = function () {
      this.SetCapacity(this.FLength);
    };
    this.Sort = function () {
      $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},this.FComparer,0,this.FLength);
    };
    this.Sort$1 = function (AComparer) {
      $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},AComparer,0,this.FLength);
    };
    this.BinarySearch = function (AItem, AIndex) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup.BinarySearch$1(this.FItems,AItem,AIndex,this.FComparer,0,this.FLength);
      return Result;
    };
    this.BinarySearch$1 = function (AItem, AIndex, AComparer) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup.BinarySearch$1(this.FItems,AItem,AIndex,AComparer,0,this.FLength);
      return Result;
    };
  },"TList<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroup>");
  rtl.createClass(this,"TObjectList$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup",this.TList$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup,function () {
    this.$initSpec = function () {
    };
    this.$init = function () {
      $mod.TList$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup.$init.call(this);
      this.FObjectsOwner = false;
    };
    this.Notify = function (aValue, Action) {
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup.Notify.call(this,aValue,Action);
      if (this.FObjectsOwner && (Action === $mod.TCollectionNotification.cnRemoved)) aValue = rtl.freeLoc(aValue);
    };
    this.Create$4 = function (aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup.Create$1.call(this);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
    this.Create$5 = function (AComparer, aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup.Create$2.call(this,AComparer);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
    this.Create$6 = function (aCollection, aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup.Create$3.call(this,aCollection);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
  },"TObjectList<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroup>");
  rtl.recNewT(this,"TPair$$$G$$generics$collections$$Double$$Double",function () {
    this.Key = 0.0;
    this.Value = 0.0;
    this.$eq = function (b) {
      return (this.Key === b.Key) && (this.Value === b.Value);
    };
    this.$assign = function (s) {
      this.Key = s.Key;
      this.Value = s.Value;
      return this;
    };
    this.Create = function (AKey, AValue) {
      this.Key = AKey;
      this.Value = AValue;
      return this;
    };
    var $r = $mod.$rtti.$Record("TPair<System.Double,System.Double>",{},this);
    $r.addField("Key",rtl.double);
    $r.addField("Value",rtl.double);
    $r.addMethod("Create",2,[["AKey",rtl.double,2],["AValue",rtl.double,2]]);
  });
  rtl.recNewT(this,"TPair$$$G$$generics$collections$$Longint$$TPair$System$Double$System$Double$",function () {
    this.Key = 0;
    this.$new = function () {
      var r = Object.create(this);
      r.Value = $mod.TPair$$$G$$generics$collections$$Double$$Double.$new();
      return r;
    };
    this.$eq = function (b) {
      return (this.Key === b.Key) && this.Value.$eq(b.Value);
    };
    this.$assign = function (s) {
      this.Key = s.Key;
      this.Value.$assign(s.Value);
      return this;
    };
    this.Create = function (AKey, AValue) {
      this.Key = AKey;
      this.Value.$assign(AValue);
      return this;
    };
    var $r = $mod.$rtti.$Record("TPair<System.Longint,Generics.Collections.TPair<System.Double,System.Double>>",{},this);
    $r.addField("Key",rtl.longint);
    $r.addField("Value",$mod.$rtti["TPair<System.Double,System.Double>"]);
    $r.addMethod("Create",2,[["AKey",rtl.longint,2],["AValue",$mod.$rtti["TPair<System.Double,System.Double>"],2]]);
  });
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TPair$System$Longint$Generics$Collections$TPair$System$Double$System$Double$$",pas.System.TObject,function () {
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<Generics.Collections.TPair<System.Longint,Generics.Collections.TPair<System.Double,System.Double>>>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TPair$System$Longint$Generics$Collections$TPair$System$Double$System$Double$$",pas.System.TObject,function () {
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push($mod.TPair$$$G$$generics$collections$$Longint$$TPair$System$Double$System$Double$.$clone(LEnumerator.DoGetCurrent()));
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<Generics.Collections.TPair<System.Longint,Generics.Collections.TPair<System.Double,System.Double>>>");
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$Longint",pas.System.TObject,function () {
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<System.Longint>");
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TPair$System$Double$System$Double$",pas.System.TObject,function () {
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<Generics.Collections.TPair<System.Double,System.Double>>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TPair$System$Double$System$Double$",pas.System.TObject,function () {
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push($mod.TPair$$$G$$generics$collections$$Double$$Double.$clone(LEnumerator.DoGetCurrent()));
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<Generics.Collections.TPair<System.Double,System.Double>>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$Longint",pas.System.TObject,function () {
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push(LEnumerator.DoGetCurrent());
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<System.Longint>");
  this.$rtti.$MethodVar("TCollectionNotifyEvent<System.Longint>",{procsig: rtl.newTIProcSig([["ASender",pas.System.$rtti["TObject"]],["AItem",rtl.longint,2],["AAction",this.$rtti["TCollectionNotification"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TCollectionNotifyEvent<Generics.Collections.TPair<System.Double,System.Double>>",{procsig: rtl.newTIProcSig([["ASender",pas.System.$rtti["TObject"]],["AItem",this.$rtti["TPair<System.Double,System.Double>"],2],["AAction",this.$rtti["TCollectionNotification"]]]), methodkind: 0});
  rtl.createClass(this,"TDictionary$$$G$$generics$collections$$Longint$$TPair$System$Double$System$Double$",this.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$Generics$Collections$TPair$System$Double$System$Double$$,function () {
    rtl.createClass(this,"TPairEnumerator",$mod.TEnumerator$$$G$$generics$collections$$TPair$System$Longint$Generics$Collections$TPair$System$Double$System$Double$$,function () {
      this.$init = function () {
        $mod.TEnumerator$$$G$$generics$collections$$TPair$System$Longint$Generics$Collections$TPair$System$Double$System$Double$$.$init.call(this);
        this.FIter = null;
        this.FVal = null;
      };
      this.$final = function () {
        this.FIter = undefined;
        this.FVal = undefined;
        $mod.TEnumerator$$$G$$generics$collections$$TPair$System$Longint$Generics$Collections$TPair$System$Double$System$Double$$.$final.call(this);
      };
      this.GetCurrent = function () {
        var Result = $mod.TPair$$$G$$generics$collections$$Longint$$TPair$System$Double$System$Double$.$new();
        Result.$assign(this.DoGetCurrent());
        return Result;
      };
      this.DoGetCurrent = function () {
        var Result = $mod.TPair$$$G$$generics$collections$$Longint$$TPair$System$Double$System$Double$.$new();
        var A = [];
        A = this.FVal.value;
        Result.$assign($mod.TPair$$$G$$generics$collections$$Longint$$TPair$System$Double$System$Double$.$new());
        Result.Create(rtl.trunc(A[0]),rtl.getObject(A[1]));
        return Result;
      };
      this.DoMoveNext = function () {
        var Result = false;
        this.FVal = this.FIter.next();
        Result = !this.FVal.done;
        return Result;
      };
      this.Create$1 = function (ADictionary) {
        this.FIter = ADictionary.FMap.entries();
        return this;
      };
      this.MoveNext$1 = function () {
        var Result = false;
        Result = this.DoMoveNext();
        return Result;
      };
    },"TDictionary<System.Longint,Generics.Collections.TPair<System.Double,System.Double>>.TPairEnumerator");
    rtl.createClass(this,"TKeyEnumerator",$mod.TEnumerator$$$G$$generics$collections$$Longint,function () {
      this.$init = function () {
        $mod.TEnumerator$$$G$$generics$collections$$Longint.$init.call(this);
        this.FIter = null;
        this.FVal = null;
      };
      this.$final = function () {
        this.FIter = undefined;
        this.FVal = undefined;
        $mod.TEnumerator$$$G$$generics$collections$$Longint.$final.call(this);
      };
      this.GetCurrent = function () {
        var Result = 0;
        Result = this.DoGetCurrent();
        return Result;
      };
      this.DoGetCurrent = function () {
        var Result = 0;
        Result = rtl.trunc(this.FVal.value);
        return Result;
      };
      this.DoMoveNext = function () {
        var Result = false;
        this.FVal = this.FIter.next();
        Result = !this.FVal.done;
        return Result;
      };
      this.Create$1 = function (AIter) {
        this.FIter = AIter;
        return this;
      };
      this.Create$2 = function (ADictionary) {
        this.Create$1(ADictionary.FMap.keys());
        return this;
      };
      this.MoveNext$1 = function () {
        var Result = false;
        Result = this.DoMoveNext();
        return Result;
      };
    },"TDictionary<System.Longint,Generics.Collections.TPair<System.Double,System.Double>>.TKeyEnumerator");
    rtl.createClass(this,"TValueEnumerator",$mod.TEnumerator$$$G$$generics$collections$$TPair$System$Double$System$Double$,function () {
      this.$init = function () {
        $mod.TEnumerator$$$G$$generics$collections$$TPair$System$Double$System$Double$.$init.call(this);
        this.FIter = null;
        this.FVal = null;
      };
      this.$final = function () {
        this.FIter = undefined;
        this.FVal = undefined;
        $mod.TEnumerator$$$G$$generics$collections$$TPair$System$Double$System$Double$.$final.call(this);
      };
      this.GetCurrent = function () {
        var Result = $mod.TPair$$$G$$generics$collections$$Double$$Double.$new();
        Result.$assign(this.DoGetCurrent());
        return Result;
      };
      this.DoGetCurrent = function () {
        var Result = $mod.TPair$$$G$$generics$collections$$Double$$Double.$new();
        Result.$assign(rtl.getObject(this.FVal.value));
        return Result;
      };
      this.DoMoveNext = function () {
        var Result = false;
        this.FVal = this.FIter.next();
        Result = !this.FVal.done;
        return Result;
      };
      this.Create$1 = function (AIter) {
        this.FIter = AIter;
        return this;
      };
      this.Create$2 = function (ADictionary) {
        this.Create$1(ADictionary.FMap.values());
        return this;
      };
      this.MoveNext$1 = function () {
        var Result = false;
        Result = this.DoMoveNext();
        return Result;
      };
    },"TDictionary<System.Longint,Generics.Collections.TPair<System.Double,System.Double>>.TValueEnumerator");
    rtl.createClass(this,"TValueCollection",$mod.TEnumerable$$$G$$generics$collections$$TPair$System$Double$System$Double$,function () {
      this.$init = function () {
        $mod.TEnumerable$$$G$$generics$collections$$TPair$System$Double$System$Double$.$init.call(this);
        this.FMap = null;
      };
      this.$final = function () {
        this.FMap = undefined;
        $mod.TEnumerable$$$G$$generics$collections$$TPair$System$Double$System$Double$.$final.call(this);
      };
      this.GetCount = function () {
        var Result = 0;
        Result = this.FMap.size;
        return Result;
      };
      this.DoGetEnumerator = function () {
        var Result = null;
        Result = $mod.TDictionary$$$G$$generics$collections$$Longint$$TPair$System$Double$System$Double$.TValueEnumerator.$create("Create$1",[this.FMap.values()]);
        return Result;
      };
      this.Create$1 = function (ADictionary) {
        this.FMap = ADictionary.FMap;
        return this;
      };
      this.GetEnumerator$1 = function () {
        var Result = null;
        Result = this.DoGetEnumerator();
        return Result;
      };
      this.ToArray = function () {
        var Result = [];
        var I = 0;
        var P = $mod.TPair$$$G$$generics$collections$$Double$$Double.$new();
        Result = rtl.arraySetLength(Result,$mod.TPair$$$G$$generics$collections$$Double$$Double,this.FMap.size);
        var $in = this.GetEnumerator$1();
        try {
          while ($in.MoveNext$1()) {
            P = $in.GetCurrent();
            Result[I].$assign(P);
            I += 1;
          }
        } finally {
          $in = rtl.freeLoc($in)
        };
        return Result;
      };
    },"TDictionary<System.Longint,Generics.Collections.TPair<System.Double,System.Double>>.TValueCollection");
    rtl.createClass(this,"TKeyCollection",$mod.TEnumerable$$$G$$generics$collections$$Longint,function () {
      this.$init = function () {
        $mod.TEnumerable$$$G$$generics$collections$$Longint.$init.call(this);
        this.FMap = null;
      };
      this.$final = function () {
        this.FMap = undefined;
        $mod.TEnumerable$$$G$$generics$collections$$Longint.$final.call(this);
      };
      this.GetCount = function () {
        var Result = 0;
        Result = this.FMap.size;
        return Result;
      };
      this.DoGetEnumerator = function () {
        var Result = null;
        Result = this.GetEnumerator$1();
        return Result;
      };
      this.Create$1 = function (ADictionary) {
        this.FMap = ADictionary.FMap;
        return this;
      };
      this.GetEnumerator$1 = function () {
        var Result = null;
        Result = $mod.TDictionary$$$G$$generics$collections$$Longint$$TPair$System$Double$System$Double$.TKeyEnumerator.$create("Create$1",[this.FMap.keys()]);
        return Result;
      };
      this.ToArray = function () {
        var Result = [];
        Result = $mod.TEnumerable$$$G$$generics$collections$$Longint.ToArray.call(this);
        return Result;
      };
    },"TDictionary<System.Longint,Generics.Collections.TPair<System.Double,System.Double>>.TKeyCollection");
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$Generics$Collections$TPair$System$Double$System$Double$$.$init.call(this);
      this.FMap = null;
      this.FComparer = null;
      this.FOnKeyNotify = null;
      this.FOnValueNotify = null;
      this.FKeyCollection = null;
      this.FValueCollection = null;
    };
    this.$final = function () {
      this.FMap = undefined;
      rtl.setIntfP(this,"FComparer",null);
      this.FOnKeyNotify = undefined;
      this.FOnValueNotify = undefined;
      this.FKeyCollection = undefined;
      this.FValueCollection = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$Generics$Collections$TPair$System$Double$System$Double$$.$final.call(this);
    };
    this.GetEffectiveKey = function (Key) {
      var Result = 0;
      var it = null;
      var v = null;
      if (!(this.FComparer != null)) return Key;
      it = this.FMap.keys();
      v = it.next();
      while (!v.done) {
        Result = rtl.trunc(v.value);
        if (this.FComparer.Compare(Result,Key) === 0) return Result;
        v = it.next();
      };
      Result = Key;
      return Result;
    };
    this.GetItem = function (Key) {
      var Result = $mod.TPair$$$G$$generics$collections$$Double$$Double.$new();
      var V = undefined;
      V = this.FMap.get(this.GetEffectiveKey(Key));
      if (pas.JS.isUndefined(V)) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictKeyNotFound")]);
      Result.$assign(rtl.getObject(V));
      return Result;
    };
    this.SetItem = function (Key, Value) {
      var V = undefined;
      V = this.FMap.get(this.GetEffectiveKey(Key));
      if (!pas.JS.isUndefined(V)) this.ValueNotify(rtl.getObject(V),$mod.TCollectionNotification.cnRemoved);
      this.FMap.set(Key,$mod.TPair$$$G$$generics$collections$$Double$$Double.$clone(Value));
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoAdd = function (Key, Value) {
      this.FMap.set(this.GetEffectiveKey(Key),$mod.TPair$$$G$$generics$collections$$Double$$Double.$clone(Value));
      this.KeyNotify(Key,$mod.TCollectionNotification.cnAdded);
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoRemove = function (Key, Notification) {
      var Result = $mod.TPair$$$G$$generics$collections$$Double$$Double.$new();
      var V = undefined;
      var K = 0;
      K = this.GetEffectiveKey(Key);
      V = this.FMap.get(K);
      if (!pas.JS.isUndefined(V)) {
        this.FMap.delete(K);
        Result.$assign(rtl.getObject(V));
        this.KeyNotify(Key,Notification);
        this.ValueNotify(Result,Notification);
      };
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FMap.size;
      return Result;
    };
    this.CanClearMap = function () {
      var Result = false;
      Result = (this.FOnKeyNotify === null) && (this.FOnValueNotify === null);
      return Result;
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.PairNotify = function (Key, Value, Action) {
      this.KeyNotify(Key,Action);
      this.ValueNotify(Value,Action);
    };
    this.KeyNotify = function (Key, Action) {
      if (this.FOnKeyNotify != null) this.FOnKeyNotify(this,Key,Action);
    };
    this.ValueNotify = function (Value, Action) {
      if (this.FOnValueNotify != null) this.FOnValueNotify(this,Value,Action);
    };
    this.Create$1 = function (ACapacity) {
      this.FMap = new Map();
      if (ACapacity > 0) ;
      return this;
    };
    this.Create$2 = function (Collection) {
      var aPair = $mod.TPair$$$G$$generics$collections$$Longint$$TPair$System$Double$System$Double$.$new();
      this.Create$1(0);
      var $in = Collection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          aPair = $in.DoGetCurrent();
          this.Add(aPair.Key,aPair.Value);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Create$3 = function (AComparer) {
      this.Create$1(0);
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FKeyCollection;
        }, set: function (v) {
          this.p.FKeyCollection = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FValueCollection;
        }, set: function (v) {
          this.p.FValueCollection = v;
        }});
      this.Clear();
      this.FMap = null;
      pas.System.TObject.Destroy.call(this);
    };
    this.Add = function (Key, Value) {
      if (this.FMap.has(this.GetEffectiveKey(Key))) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictDuplicateKey")]);
      this.DoAdd(Key,Value);
    };
    this.Remove = function (Key) {
      this.DoRemove(Key,$mod.TCollectionNotification.cnRemoved);
    };
    this.ExtractPair = function (Key) {
      var Result = $mod.TPair$$$G$$generics$collections$$Longint$$TPair$System$Double$System$Double$.$new();
      var K = 0;
      Result.$assign($mod.TPair$$$G$$generics$collections$$Longint$$TPair$System$Double$System$Double$.$new());
      K = this.GetEffectiveKey(Key);
      if (this.FMap.has(K)) {
        Result.Create(Key,rtl.getObject(this.FMap.get(K)));
        this.FMap.delete(K);
      } else Result.Create(Key,$mod.TPair$$$G$$generics$collections$$Double$$Double.$new());
      return Result;
    };
    this.Clear = function () {
      var Iter = null;
      var IVal = null;
      var A = [];
      var K = 0;
      var V = $mod.TPair$$$G$$generics$collections$$Double$$Double.$new();
      if (this.CanClearMap()) {
        this.FMap.clear()}
       else {
        Iter = this.FMap.entries();
        do {
          IVal = Iter.next();
          if (!IVal.done) {
            A = IVal.value;
            K = rtl.trunc(A[0]);
            V.$assign(rtl.getObject(A[1]));
            this.FMap.delete(K);
            this.PairNotify(K,$mod.TPair$$$G$$generics$collections$$Double$$Double.$clone(V),$mod.TCollectionNotification.cnRemoved);
          };
        } while (!IVal.done);
      };
    };
    this.TryGetValue = function (Key, Value) {
      var Result = false;
      var K = 0;
      K = this.GetEffectiveKey(Key);
      Result = this.FMap.has(K);
      if (Result) Value.$assign(rtl.getObject(this.FMap.get(K)));
      return Result;
    };
    this.AddOrSetValue = function (Key, Value) {
      var k = 0;
      k = this.GetEffectiveKey(Key);
      if (!this.FMap.has(k)) {
        this.DoAdd(Key,Value)}
       else this.SetItem(k,Value);
    };
    this.ContainsKey = function (Key) {
      var Result = false;
      Result = this.FMap.has(this.GetEffectiveKey(Key));
      return Result;
    };
    this.ContainsValue = function (Value) {
      var Result = false;
      var It = null;
      var Res = null;
      Result = false;
      It = this.FMap.values();
      do {
        Res = It.next();
        if (!Res.done) Result = Value.$eq(rtl.getObject(Res.value));
      } while (!(Result || Res.done));
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      Result = $mod.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$Generics$Collections$TPair$System$Double$System$Double$$.ToArray.call(this);
      return Result;
    };
    this.GetKeys = function () {
      var Result = null;
      if (this.FKeyCollection === null) this.FKeyCollection = this.TKeyCollection.$create("Create$1",[this]);
      Result = this.FKeyCollection;
      return Result;
    };
    this.GetValues = function () {
      var Result = null;
      if (this.FValueCollection === null) this.FValueCollection = this.TValueCollection.$create("Create$1",[this]);
      Result = this.FValueCollection;
      return Result;
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
  },"TDictionary<System.Longint,Generics.Collections.TPair<System.Double,System.Double>>");
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TTMSFNCFilterBuilderGroupOperator",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroupOperator>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TTMSFNCFilterBuilderGroupOperator",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push(LEnumerator.DoGetCurrent());
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroupOperator>");
  this.$rtti.$MethodVar("TCollectionNotifyEvent<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroupOperator>",{init: function () {
      this.procsig = rtl.newTIProcSig([["ASender",pas.System.$rtti["TObject"]],["AItem",pas["TMS.TMSFNCFilterBuilder"].$rtti["TTMSFNCFilterBuilderGroupOperator"],2],["AAction",$mod.$rtti["TCollectionNotification"]]]);
    }, methodkind: 0});
  rtl.createClass(this,"TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCFilterBuilderGroupOperator",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.Sort = function (AValues, AComparer) {
      this.Sort$1(AValues,AComparer,0,rtl.length(AValues.get()));
    };
    this.Sort$1 = function (AValues, AComparer, AIndex, ACount) {
      if (ACount <= 1) return;
      this.QuickSort(AValues,AIndex,(AIndex + ACount) - 1,AComparer);
    };
    this.BinarySearch$2 = function (AValues, AItem, AFoundIndex, AComparer) {
      var Result = false;
      Result = this.BinarySearch$1(AValues,AItem,AFoundIndex,AComparer,0,rtl.length(AValues));
      return Result;
    };
    this.BinarySearch$3 = function (AValues, AItem, ASearchResult, AComparer) {
      var Result = false;
      Result = this.BinarySearch(AValues,AItem,ASearchResult,AComparer,0,rtl.length(AValues));
      return Result;
    };
  },"TCustomArrayHelper<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroupOperator>");
  rtl.createClass(this,"TArrayHelper$$$G$$generics$collections$$TTMSFNCFilterBuilderGroupOperator",this.TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCFilterBuilderGroupOperator,function () {
    this.$initSpec = function () {
    };
    this.QuickSort = function (AValues, ALeft, ARight, AComparer) {
      var I = 0;
      var J = 0;
      var P = 0;
      var Q = 0;
      if (((ARight - ALeft) <= 0) || (rtl.length(AValues.get()) === 0)) return;
      do {
        I = ALeft;
        J = ARight;
        P = AValues.get()[ALeft + Math.floor((ARight - ALeft) / 2)];
        do {
          while (AComparer.Compare(AValues.get()[I],P) < 0) I += 1;
          while (AComparer.Compare(AValues.get()[J],P) > 0) J -= 1;
          if (I <= J) {
            if (I !== J) {
              Q = AValues.get()[I];
              AValues.get()[I] = AValues.get()[J];
              AValues.get()[J] = Q;
            };
            I += 1;
            J -= 1;
          };
        } while (!(I > J));
        if ((J - ALeft) < (ARight - I)) {
          if (ALeft < J) this.QuickSort(AValues,ALeft,J,AComparer);
          ALeft = I;
        } else {
          if (I < ARight) this.QuickSort(AValues,I,ARight,AComparer);
          ARight = J;
        };
      } while (!(ALeft >= ARight));
    };
    this.BinarySearch = function (AValues, AItem, ASearchResult, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var ilo = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      ilo = imid * imid;
      imid = ilo * imid;
      while (imin < imax) {
        imid = rtl.trunc((imax + imin) / 2);
        ASearchResult.CompareResult = AComparer.Compare(AValues[imid],AItem);
        if (ASearchResult.CompareResult < 0) {
          imin = imid + 1}
         else {
          if (ASearchResult.CompareResult === 0) {
            ASearchResult.FoundIndex = imid;
            ASearchResult.CandidateIndex = imid;
            return true;
          };
          imax = imid;
        };
      };
      Result = imax === imin;
      if (Result) {
        ASearchResult.CompareResult = AComparer.Compare(AValues[imin],AItem);
        ASearchResult.CandidateIndex = imin;
        Result = ASearchResult.CompareResult === 0;
        if (Result) {
          ASearchResult.FoundIndex = imin}
         else ASearchResult.FoundIndex = -1;
      } else {
        ASearchResult.CompareResult = 0;
        ASearchResult.FoundIndex = -1;
        ASearchResult.CandidateIndex = -1;
      };
      return Result;
    };
    this.BinarySearch$1 = function (AValues, AItem, AFoundIndex, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var LCompare = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      while (imin < imax) {
        imid = rtl.trunc((imin + imax) / 2);
        LCompare = AComparer.Compare(AValues[imid],AItem);
        if (LCompare < 0) {
          imin = imid + 1}
         else {
          if (LCompare === 0) {
            AFoundIndex.set(imid);
            return true;
          };
          imax = imid;
        };
      };
      LCompare = AComparer.Compare(AValues[imin],AItem);
      Result = (imax === imin) && (LCompare === 0);
      if (Result) {
        AFoundIndex.set(imin)}
       else AFoundIndex.set(-1);
      return Result;
    };
  },"TArrayHelper<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroupOperator>");
  rtl.createClass(this,"TCustomList$$$G$$generics$collections$$TTMSFNCFilterBuilderGroupOperator",this.TEnumerable$$$G$$generics$collections$$TTMSFNCFilterBuilderGroupOperator,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $mod.$rtti.$DynArray("TCustomList<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroupOperator>.FItems$a",{eltype: pas["TMS.TMSFNCFilterBuilder"].$rtti["TTMSFNCFilterBuilderGroupOperator"]});
    };
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCFilterBuilderGroupOperator.$init.call(this);
      this.FOnNotify = null;
      this.FLength = 0;
      this.FItems = [];
    };
    this.$final = function () {
      this.FOnNotify = undefined;
      this.FItems = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCFilterBuilderGroupOperator.$final.call(this);
    };
    this.GetCapacity = function () {
      var Result = 0;
      Result = rtl.length(this.FItems);
      return Result;
    };
    this.PrepareAddingItem = function () {
      var Result = 0;
      if (this.FLength === rtl.length(this.FItems)) this.FItems.push(pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderGroupOperator.fgoAND);
      Result = this.FLength;
      this.FLength += 1;
      return Result;
    };
    this.PrepareAddingRange = function (ACount) {
      var Result = 0;
      var l = 0;
      if (ACount < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (ACount === 0) return this.FLength - 1;
      for (var $l = rtl.length(this.FItems) + 1, $end = this.FLength + ACount; $l <= $end; $l++) {
        l = $l;
        this.FItems.push(pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderGroupOperator.fgoAND);
      };
      Result = this.FLength;
      this.FLength += ACount;
      return Result;
    };
    this.Notify = function (AValue, ACollectionNotification) {
      if (this.FOnNotify != null) this.FOnNotify(this,AValue,ACollectionNotification);
    };
    this.DoRemove = function (AIndex, ACollectionNotification) {
      var Result = 0;
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      this.FLength -= 1;
      this.FItems[AIndex] = pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderGroupOperator.fgoAND;
      this.FItems.splice(AIndex,1);
      this.Notify(Result,ACollectionNotification);
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FLength;
      return Result;
    };
  },"TCustomList<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroupOperator>");
  rtl.createClass(this,"TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCFilterBuilderGroupOperator",this.TEnumerator$$$G$$generics$collections$$TTMSFNCFilterBuilderGroupOperator,function () {
    this.$initSpec = function () {
    };
    this.$init = function () {
      $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCFilterBuilderGroupOperator.$init.call(this);
      this.FList = null;
      this.FIndex = 0;
    };
    this.$final = function () {
      this.FList = undefined;
      $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCFilterBuilderGroupOperator.$final.call(this);
    };
    this.DoMoveNext = function () {
      var Result = false;
      this.FIndex += 1;
      Result = (this.FList.FLength > 0) && (this.FIndex < this.FList.FLength);
      return Result;
    };
    this.DoGetCurrent = function () {
      var Result = 0;
      Result = this.GetCurrent();
      return Result;
    };
    this.GetCurrent = function () {
      var Result = 0;
      Result = this.FList.FItems[this.FIndex];
      return Result;
    };
    this.Create$1 = function (AList) {
      pas.System.TObject.Create.call(this);
      this.FIndex = -1;
      this.FList = AList;
      return this;
    };
  },"TCustomListEnumerator<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroupOperator>");
  rtl.createClass(this,"TStack$$$G$$generics$collections$$TTMSFNCFilterBuilderGroupOperator",this.TCustomList$$$G$$generics$collections$$TTMSFNCFilterBuilderGroupOperator,function () {
    this.$initSpec = function () {
      rtl.createClass(this,"TEnumerator",$mod.TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCFilterBuilderGroupOperator,function () {
        this.Create$2 = function (AStack) {
          $mod.TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCFilterBuilderGroupOperator.Create$1.call(this,AStack);
          return this;
        };
      },"TStack<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroupOperator>.TEnumerator");
    };
    this.DoRemove = function (AIndex, ACollectionNotification) {
      var Result = 0;
      if ((this.FLength === 0) || (AIndex !== (this.FLength - 1))) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      this.FItems[AIndex] = pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderGroupOperator.fgoAND;
      this.FLength -= 1;
      this.Notify(Result,ACollectionNotification);
      return Result;
    };
    this.SetCapacity = function (AValue) {
      if (AValue < this.GetCount()) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.FItems = rtl.arraySetLength(this.FItems,0,AValue);
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.GetEnumerator$1();
      return Result;
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TEnumerator.$create("Create$2",[this]);
      return Result;
    };
    this.Destroy = function () {
      this.Clear();
      pas.System.TObject.Destroy.call(this);
    };
    this.Clear = function () {
      while (this.GetCount() > 0) this.Pop();
    };
    this.Push = function (aValue) {
      if (this.GetCapacity() <= this.FLength) this.SetCapacity(this.FLength + 10);
      this.FItems[this.FLength] = aValue;
      this.FLength += 1;
      this.Notify(aValue,$mod.TCollectionNotification.cnAdded);
    };
    this.Pop = function () {
      var Result = 0;
      Result = this.DoRemove(this.FLength - 1,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.Peek = function () {
      var Result = 0;
      if (this.GetCount() < 1) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[this.FLength - 1];
      return Result;
    };
    this.Extract = function () {
      var Result = 0;
      Result = this.DoRemove(this.FLength - 1,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.TrimExcess = function () {
      this.SetCapacity(this.FLength);
    };
  },"TStack<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroupOperator>");
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$String",pas.System.TObject,function () {
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<System.String>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$String",pas.System.TObject,function () {
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push(LEnumerator.DoGetCurrent());
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<System.String>");
  this.$rtti.$MethodVar("TCollectionNotifyEvent<System.String>",{procsig: rtl.newTIProcSig([["ASender",pas.System.$rtti["TObject"]],["AItem",rtl.string,2],["AAction",this.$rtti["TCollectionNotification"]]]), methodkind: 0});
  rtl.createClass(this,"TCustomArrayHelper$$$G$$generics$collections$$String",pas.System.TObject,function () {
    this.Sort = function (AValues, AComparer) {
      this.Sort$1(AValues,AComparer,0,rtl.length(AValues.get()));
    };
    this.Sort$1 = function (AValues, AComparer, AIndex, ACount) {
      if (ACount <= 1) return;
      this.QuickSort(AValues,AIndex,(AIndex + ACount) - 1,AComparer);
    };
    this.BinarySearch$2 = function (AValues, AItem, AFoundIndex, AComparer) {
      var Result = false;
      Result = this.BinarySearch$1(AValues,AItem,AFoundIndex,AComparer,0,rtl.length(AValues));
      return Result;
    };
    this.BinarySearch$3 = function (AValues, AItem, ASearchResult, AComparer) {
      var Result = false;
      Result = this.BinarySearch(AValues,AItem,ASearchResult,AComparer,0,rtl.length(AValues));
      return Result;
    };
  },"TCustomArrayHelper<System.String>");
  rtl.createClass(this,"TArrayHelper$$$G$$generics$collections$$String",this.TCustomArrayHelper$$$G$$generics$collections$$String,function () {
    this.QuickSort = function (AValues, ALeft, ARight, AComparer) {
      var I = 0;
      var J = 0;
      var P = "";
      var Q = "";
      if (((ARight - ALeft) <= 0) || (rtl.length(AValues.get()) === 0)) return;
      do {
        I = ALeft;
        J = ARight;
        P = AValues.get()[ALeft + Math.floor((ARight - ALeft) / 2)];
        do {
          while (AComparer.Compare(AValues.get()[I],P) < 0) I += 1;
          while (AComparer.Compare(AValues.get()[J],P) > 0) J -= 1;
          if (I <= J) {
            if (I !== J) {
              Q = AValues.get()[I];
              AValues.get()[I] = AValues.get()[J];
              AValues.get()[J] = Q;
            };
            I += 1;
            J -= 1;
          };
        } while (!(I > J));
        if ((J - ALeft) < (ARight - I)) {
          if (ALeft < J) this.QuickSort(AValues,ALeft,J,AComparer);
          ALeft = I;
        } else {
          if (I < ARight) this.QuickSort(AValues,I,ARight,AComparer);
          ARight = J;
        };
      } while (!(ALeft >= ARight));
    };
    this.BinarySearch = function (AValues, AItem, ASearchResult, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var ilo = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      ilo = imid * imid;
      imid = ilo * imid;
      while (imin < imax) {
        imid = rtl.trunc((imax + imin) / 2);
        ASearchResult.CompareResult = AComparer.Compare(AValues[imid],AItem);
        if (ASearchResult.CompareResult < 0) {
          imin = imid + 1}
         else {
          if (ASearchResult.CompareResult === 0) {
            ASearchResult.FoundIndex = imid;
            ASearchResult.CandidateIndex = imid;
            return true;
          };
          imax = imid;
        };
      };
      Result = imax === imin;
      if (Result) {
        ASearchResult.CompareResult = AComparer.Compare(AValues[imin],AItem);
        ASearchResult.CandidateIndex = imin;
        Result = ASearchResult.CompareResult === 0;
        if (Result) {
          ASearchResult.FoundIndex = imin}
         else ASearchResult.FoundIndex = -1;
      } else {
        ASearchResult.CompareResult = 0;
        ASearchResult.FoundIndex = -1;
        ASearchResult.CandidateIndex = -1;
      };
      return Result;
    };
    this.BinarySearch$1 = function (AValues, AItem, AFoundIndex, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var LCompare = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      while (imin < imax) {
        imid = rtl.trunc((imin + imax) / 2);
        LCompare = AComparer.Compare(AValues[imid],AItem);
        if (LCompare < 0) {
          imin = imid + 1}
         else {
          if (LCompare === 0) {
            AFoundIndex.set(imid);
            return true;
          };
          imax = imid;
        };
      };
      LCompare = AComparer.Compare(AValues[imin],AItem);
      Result = (imax === imin) && (LCompare === 0);
      if (Result) {
        AFoundIndex.set(imin)}
       else AFoundIndex.set(-1);
      return Result;
    };
  },"TArrayHelper<System.String>");
  rtl.createClass(this,"TCustomList$$$G$$generics$collections$$String",this.TEnumerable$$$G$$generics$collections$$String,function () {
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$String.$init.call(this);
      this.FOnNotify = null;
      this.FLength = 0;
      this.FItems = [];
    };
    this.$final = function () {
      this.FOnNotify = undefined;
      this.FItems = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$String.$final.call(this);
    };
    this.GetCapacity = function () {
      var Result = 0;
      Result = rtl.length(this.FItems);
      return Result;
    };
    this.PrepareAddingItem = function () {
      var Result = 0;
      if (this.FLength === rtl.length(this.FItems)) this.FItems.push("");
      Result = this.FLength;
      this.FLength += 1;
      return Result;
    };
    this.PrepareAddingRange = function (ACount) {
      var Result = 0;
      var l = 0;
      if (ACount < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (ACount === 0) return this.FLength - 1;
      for (var $l = rtl.length(this.FItems) + 1, $end = this.FLength + ACount; $l <= $end; $l++) {
        l = $l;
        this.FItems.push("");
      };
      Result = this.FLength;
      this.FLength += ACount;
      return Result;
    };
    this.Notify = function (AValue, ACollectionNotification) {
      if (this.FOnNotify != null) this.FOnNotify(this,AValue,ACollectionNotification);
    };
    this.DoRemove = function (AIndex, ACollectionNotification) {
      var Result = "";
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      this.FLength -= 1;
      this.FItems[AIndex] = "";
      this.FItems.splice(AIndex,1);
      this.Notify(Result,ACollectionNotification);
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FLength;
      return Result;
    };
    var $r = this.$rtti;
    $mod.$rtti.$DynArray("TCustomList<System.String>.FItems$a",{eltype: rtl.string});
  },"TCustomList<System.String>");
  rtl.createClass(this,"TCustomListEnumerator$$$G$$generics$collections$$String",this.TEnumerator$$$G$$generics$collections$$String,function () {
    this.$init = function () {
      $mod.TEnumerator$$$G$$generics$collections$$String.$init.call(this);
      this.FList = null;
      this.FIndex = 0;
    };
    this.$final = function () {
      this.FList = undefined;
      $mod.TEnumerator$$$G$$generics$collections$$String.$final.call(this);
    };
    this.DoMoveNext = function () {
      var Result = false;
      this.FIndex += 1;
      Result = (this.FList.FLength > 0) && (this.FIndex < this.FList.FLength);
      return Result;
    };
    this.DoGetCurrent = function () {
      var Result = "";
      Result = this.GetCurrent();
      return Result;
    };
    this.GetCurrent = function () {
      var Result = "";
      Result = this.FList.FItems[this.FIndex];
      return Result;
    };
    this.Create$1 = function (AList) {
      pas.System.TObject.Create.call(this);
      this.FIndex = -1;
      this.FList = AList;
      return this;
    };
  },"TCustomListEnumerator<System.String>");
  rtl.createClass(this,"TList$$$G$$generics$collections$$String",this.TCustomList$$$G$$generics$collections$$String,function () {
    rtl.createClass(this,"TEnumerator",$mod.TCustomListEnumerator$$$G$$generics$collections$$String,function () {
    },"TList<System.String>.TEnumerator");
    this.$init = function () {
      $mod.TCustomList$$$G$$generics$collections$$String.$init.call(this);
      this.FComparer = null;
    };
    this.$final = function () {
      rtl.setIntfP(this,"FComparer",null);
      $mod.TCustomList$$$G$$generics$collections$$String.$final.call(this);
    };
    this.SameValue = function (Left, Right) {
      var Result = false;
      if (this.FComparer != null) {
        Result = this.FComparer.Compare(Left,Right) === 0}
       else Result = Left === Right;
      return Result;
    };
    this.SetCapacity = function (AValue) {
      if (AValue < this.FLength) this.SetCount(AValue);
      this.FItems = rtl.arraySetLength(this.FItems,"",AValue);
    };
    this.SetCount = function (AValue) {
      if (AValue < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (AValue > this.GetCapacity()) {
        this.SetCapacity(AValue)}
       else if (AValue < this.FLength) this.DeleteRange(AValue,this.FLength - AValue);
      this.FLength = AValue;
    };
    this.InitializeList = function () {
    };
    this.InternalInsert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.FItems.splice(AIndex,0,AValue);
      this.FLength += 1;
      this.FItems[AIndex] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.GetEnumerator$1();
      return Result;
    };
    this.GetItem = function (AIndex) {
      var Result = "";
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      return Result;
    };
    this.SetItem = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.Notify(this.FItems[AIndex],$mod.TCollectionNotification.cnRemoved);
      this.FItems[AIndex] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.Create$1 = function () {
      this.InitializeList();
      return this;
    };
    this.Create$2 = function (AComparer) {
      this.InitializeList();
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Create$3 = function (ACollection) {
      var LItem = "";
      this.Create$1();
      var $in = ACollection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LItem = $in.DoGetCurrent();
          this.Add(LItem);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Destroy = function () {
      this.SetCapacity(0);
    };
    this.Add = function (AValue) {
      var Result = 0;
      Result = this.PrepareAddingItem();
      this.FItems[Result] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
      return Result;
    };
    this.AddRange = function (AValues) {
      this.InsertRange(this.FLength,AValues);
    };
    this.AddRange$1 = function (AEnumerable) {
      var LValue = "";
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.Add(LValue);
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.AddRange$2 = function (AEnumerable) {
      var LValue = "";
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.Add(LValue);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Insert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.InternalInsert(AIndex,AValue);
    };
    this.InsertRange = function (AIndex, AValues) {
      var LLength = 0;
      var i = 0;
      var LValue = "";
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LLength = rtl.length(AValues);
      if (LLength === 0) return;
      if (AIndex !== this.PrepareAddingRange(LLength)) {
        for (var $l = AIndex, $end = this.FLength - LLength - 1; $l <= $end; $l++) {
          i = $l;
          this.FItems[i + LLength] = this.FItems[i];
        };
        for (var $l1 = 0, $end1 = LLength - 1; $l1 <= $end1; $l1++) {
          i = $l1;
          this.FItems[AIndex + i] = "";
        };
      };
      for (var $l2 = 0, $end2 = LLength - 1; $l2 <= $end2; $l2++) {
        i = $l2;
        LValue = AValues[i];
        this.FItems[i + AIndex] = LValue;
        this.Notify(LValue,$mod.TCollectionNotification.cnAdded);
      };
    };
    this.InsertRange$1 = function (AIndex, AEnumerable) {
      var LValue = "";
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.InsertRange$2 = function (AIndex, AEnumerable) {
      var LValue = "";
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Remove = function (AValue) {
      var Result = 0;
      Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.RemoveItem = function (AValue, Direction) {
      var Result = 0;
      if (Direction === $mod.TDirection.fromEnd) {
        Result = this.LastIndexOf(AValue)}
       else Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.Delete = function (AIndex) {
      this.DoRemove(AIndex,$mod.TCollectionNotification.cnRemoved);
    };
    this.DeleteRange = function (AIndex, ACount) {
      var LDeleted = [];
      var i = 0;
      if (ACount === 0) return;
      if ((ACount < 0) || (AIndex < 0) || ((AIndex + ACount) > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LDeleted = this.FItems.splice(AIndex,this.FLength);
      this.FLength -= ACount;
      for (var $l = 0, $end = rtl.length(LDeleted) - 1; $l <= $end; $l++) {
        i = $l;
        this.Notify(LDeleted[i],$mod.TCollectionNotification.cnRemoved);
      };
    };
    this.ExtractIndex = function (AIndex) {
      var Result = "";
      Result = this.DoRemove(AIndex,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.Extract = function (AValue) {
      var Result = "";
      var LIndex = 0;
      LIndex = this.IndexOf(AValue);
      if (LIndex < 0) {
        Result = ""}
       else Result = this.DoRemove(LIndex,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.Exchange = function (AIndex1, AIndex2) {
      var LTemp = "";
      LTemp = this.FItems[AIndex1];
      this.FItems[AIndex1] = this.FItems[AIndex2];
      this.FItems[AIndex2] = LTemp;
    };
    this.Move = function (AIndex, ANewIndex) {
      var Arr = null;
      var LTemp = undefined;
      var i = 0;
      if (ANewIndex === AIndex) return;
      if ((ANewIndex < 0) || (ANewIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Arr = this.FItems;
      LTemp = Arr[AIndex];
      if (AIndex < ANewIndex) {
        for (var $l = AIndex, $end = ANewIndex - 1; $l <= $end; $l++) {
          i = $l;
          Arr[i] = Arr[i + 1];
        }}
       else for (var $l1 = AIndex, $end1 = ANewIndex + 1; $l1 >= $end1; $l1--) {
        i = $l1;
        Arr[i] = Arr[i - 1];
      };
      Arr[ANewIndex] = LTemp;
    };
    this.First = function () {
      var Result = "";
      Result = this.GetItem(0);
      return Result;
    };
    this.Last = function () {
      var Result = "";
      Result = this.GetItem(this.FLength - 1);
      return Result;
    };
    this.Clear = function () {
      this.SetCount(0);
      this.SetCapacity(0);
    };
    this.Contains = function (AValue) {
      var Result = false;
      Result = this.IndexOf(AValue) >= 0;
      return Result;
    };
    this.IndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = 0, $end = this.FLength - 1; $l <= $end; $l++) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.LastIndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = this.FLength - 1; $l >= 0; $l--) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.Reverse = function () {
      var a = 0;
      var b = 0;
      var LTemp = "";
      a = 0;
      b = this.FLength - 1;
      while (a < b) {
        LTemp = this.FItems[a];
        this.FItems[a] = this.FItems[b];
        this.FItems[b] = LTemp;
        a += 1;
        b -= 1;
      };
    };
    this.TrimExcess = function () {
      this.SetCapacity(this.FLength);
    };
    this.Sort = function () {
      $mod.TArrayHelper$$$G$$generics$collections$$String.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},this.FComparer,0,this.FLength);
    };
    this.Sort$1 = function (AComparer) {
      $mod.TArrayHelper$$$G$$generics$collections$$String.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},AComparer,0,this.FLength);
    };
    this.BinarySearch = function (AItem, AIndex) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$String.BinarySearch$1(this.FItems,AItem,AIndex,this.FComparer,0,this.FLength);
      return Result;
    };
    this.BinarySearch$1 = function (AItem, AIndex, AComparer) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$String.BinarySearch$1(this.FItems,AItem,AIndex,AComparer,0,this.FLength);
      return Result;
    };
  },"TList<System.String>");
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TXDataPrimitiveType",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<XData.Model.Types.TXDataPrimitiveType>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TXDataPrimitiveType",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push(LEnumerator.DoGetCurrent());
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<XData.Model.Types.TXDataPrimitiveType>");
  this.$rtti.$MethodVar("TCollectionNotifyEvent<XData.Model.Types.TXDataPrimitiveType>",{init: function () {
      this.procsig = rtl.newTIProcSig([["ASender",pas.System.$rtti["TObject"]],["AItem",pas["XData.Model.Types"].$rtti["TXDataPrimitiveType"],2],["AAction",$mod.$rtti["TCollectionNotification"]]]);
    }, methodkind: 0});
  rtl.createClass(this,"TCustomArrayHelper$$$G$$generics$collections$$TXDataPrimitiveType",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.Sort = function (AValues, AComparer) {
      this.Sort$1(AValues,AComparer,0,rtl.length(AValues.get()));
    };
    this.Sort$1 = function (AValues, AComparer, AIndex, ACount) {
      if (ACount <= 1) return;
      this.QuickSort(AValues,AIndex,(AIndex + ACount) - 1,AComparer);
    };
    this.BinarySearch$2 = function (AValues, AItem, AFoundIndex, AComparer) {
      var Result = false;
      Result = this.BinarySearch$1(AValues,AItem,AFoundIndex,AComparer,0,rtl.length(AValues));
      return Result;
    };
    this.BinarySearch$3 = function (AValues, AItem, ASearchResult, AComparer) {
      var Result = false;
      Result = this.BinarySearch(AValues,AItem,ASearchResult,AComparer,0,rtl.length(AValues));
      return Result;
    };
  },"TCustomArrayHelper<XData.Model.Types.TXDataPrimitiveType>");
  rtl.createClass(this,"TArrayHelper$$$G$$generics$collections$$TXDataPrimitiveType",this.TCustomArrayHelper$$$G$$generics$collections$$TXDataPrimitiveType,function () {
    this.$initSpec = function () {
    };
    this.QuickSort = function (AValues, ALeft, ARight, AComparer) {
      var I = 0;
      var J = 0;
      var P = null;
      var Q = null;
      if (((ARight - ALeft) <= 0) || (rtl.length(AValues.get()) === 0)) return;
      do {
        I = ALeft;
        J = ARight;
        P = AValues.get()[ALeft + Math.floor((ARight - ALeft) / 2)];
        do {
          while (AComparer.Compare(AValues.get()[I],P) < 0) I += 1;
          while (AComparer.Compare(AValues.get()[J],P) > 0) J -= 1;
          if (I <= J) {
            if (I !== J) {
              Q = AValues.get()[I];
              AValues.get()[I] = AValues.get()[J];
              AValues.get()[J] = Q;
            };
            I += 1;
            J -= 1;
          };
        } while (!(I > J));
        if ((J - ALeft) < (ARight - I)) {
          if (ALeft < J) this.QuickSort(AValues,ALeft,J,AComparer);
          ALeft = I;
        } else {
          if (I < ARight) this.QuickSort(AValues,I,ARight,AComparer);
          ARight = J;
        };
      } while (!(ALeft >= ARight));
    };
    this.BinarySearch = function (AValues, AItem, ASearchResult, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var ilo = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      ilo = imid * imid;
      imid = ilo * imid;
      while (imin < imax) {
        imid = rtl.trunc((imax + imin) / 2);
        ASearchResult.CompareResult = AComparer.Compare(AValues[imid],AItem);
        if (ASearchResult.CompareResult < 0) {
          imin = imid + 1}
         else {
          if (ASearchResult.CompareResult === 0) {
            ASearchResult.FoundIndex = imid;
            ASearchResult.CandidateIndex = imid;
            return true;
          };
          imax = imid;
        };
      };
      Result = imax === imin;
      if (Result) {
        ASearchResult.CompareResult = AComparer.Compare(AValues[imin],AItem);
        ASearchResult.CandidateIndex = imin;
        Result = ASearchResult.CompareResult === 0;
        if (Result) {
          ASearchResult.FoundIndex = imin}
         else ASearchResult.FoundIndex = -1;
      } else {
        ASearchResult.CompareResult = 0;
        ASearchResult.FoundIndex = -1;
        ASearchResult.CandidateIndex = -1;
      };
      return Result;
    };
    this.BinarySearch$1 = function (AValues, AItem, AFoundIndex, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var LCompare = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      while (imin < imax) {
        imid = rtl.trunc((imin + imax) / 2);
        LCompare = AComparer.Compare(AValues[imid],AItem);
        if (LCompare < 0) {
          imin = imid + 1}
         else {
          if (LCompare === 0) {
            AFoundIndex.set(imid);
            return true;
          };
          imax = imid;
        };
      };
      LCompare = AComparer.Compare(AValues[imin],AItem);
      Result = (imax === imin) && (LCompare === 0);
      if (Result) {
        AFoundIndex.set(imin)}
       else AFoundIndex.set(-1);
      return Result;
    };
  },"TArrayHelper<XData.Model.Types.TXDataPrimitiveType>");
  rtl.createClass(this,"TCustomList$$$G$$generics$collections$$TXDataPrimitiveType",this.TEnumerable$$$G$$generics$collections$$TXDataPrimitiveType,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $mod.$rtti.$DynArray("TCustomList<XData.Model.Types.TXDataPrimitiveType>.FItems$a",{eltype: pas["XData.Model.Types"].$rtti["TXDataPrimitiveType"]});
    };
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$TXDataPrimitiveType.$init.call(this);
      this.FOnNotify = null;
      this.FLength = 0;
      this.FItems = [];
    };
    this.$final = function () {
      this.FOnNotify = undefined;
      this.FItems = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$TXDataPrimitiveType.$final.call(this);
    };
    this.GetCapacity = function () {
      var Result = 0;
      Result = rtl.length(this.FItems);
      return Result;
    };
    this.PrepareAddingItem = function () {
      var Result = 0;
      if (this.FLength === rtl.length(this.FItems)) this.FItems.push(null);
      Result = this.FLength;
      this.FLength += 1;
      return Result;
    };
    this.PrepareAddingRange = function (ACount) {
      var Result = 0;
      var l = 0;
      if (ACount < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (ACount === 0) return this.FLength - 1;
      for (var $l = rtl.length(this.FItems) + 1, $end = this.FLength + ACount; $l <= $end; $l++) {
        l = $l;
        this.FItems.push(null);
      };
      Result = this.FLength;
      this.FLength += ACount;
      return Result;
    };
    this.Notify = function (AValue, ACollectionNotification) {
      if (this.FOnNotify != null) this.FOnNotify(this,AValue,ACollectionNotification);
    };
    this.DoRemove = function (AIndex, ACollectionNotification) {
      var Result = null;
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      this.FLength -= 1;
      this.FItems[AIndex] = null;
      this.FItems.splice(AIndex,1);
      this.Notify(Result,ACollectionNotification);
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FLength;
      return Result;
    };
  },"TCustomList<XData.Model.Types.TXDataPrimitiveType>");
  rtl.createClass(this,"TCustomListEnumerator$$$G$$generics$collections$$TXDataPrimitiveType",this.TEnumerator$$$G$$generics$collections$$TXDataPrimitiveType,function () {
    this.$initSpec = function () {
    };
    this.$init = function () {
      $mod.TEnumerator$$$G$$generics$collections$$TXDataPrimitiveType.$init.call(this);
      this.FList = null;
      this.FIndex = 0;
    };
    this.$final = function () {
      this.FList = undefined;
      $mod.TEnumerator$$$G$$generics$collections$$TXDataPrimitiveType.$final.call(this);
    };
    this.DoMoveNext = function () {
      var Result = false;
      this.FIndex += 1;
      Result = (this.FList.FLength > 0) && (this.FIndex < this.FList.FLength);
      return Result;
    };
    this.DoGetCurrent = function () {
      var Result = null;
      Result = this.GetCurrent();
      return Result;
    };
    this.GetCurrent = function () {
      var Result = null;
      Result = this.FList.FItems[this.FIndex];
      return Result;
    };
    this.Create$1 = function (AList) {
      pas.System.TObject.Create.call(this);
      this.FIndex = -1;
      this.FList = AList;
      return this;
    };
  },"TCustomListEnumerator<XData.Model.Types.TXDataPrimitiveType>");
  rtl.createClass(this,"TList$$$G$$generics$collections$$TXDataPrimitiveType",this.TCustomList$$$G$$generics$collections$$TXDataPrimitiveType,function () {
    this.$initSpec = function () {
      rtl.createClass(this,"TEnumerator",$mod.TCustomListEnumerator$$$G$$generics$collections$$TXDataPrimitiveType,function () {
      },"TList<XData.Model.Types.TXDataPrimitiveType>.TEnumerator");
    };
    this.$init = function () {
      $mod.TCustomList$$$G$$generics$collections$$TXDataPrimitiveType.$init.call(this);
      this.FComparer = null;
    };
    this.$final = function () {
      rtl.setIntfP(this,"FComparer",null);
      $mod.TCustomList$$$G$$generics$collections$$TXDataPrimitiveType.$final.call(this);
    };
    this.SameValue = function (Left, Right) {
      var Result = false;
      if (this.FComparer != null) {
        Result = this.FComparer.Compare(Left,Right) === 0}
       else Result = Left === Right;
      return Result;
    };
    this.SetCapacity = function (AValue) {
      if (AValue < this.FLength) this.SetCount(AValue);
      this.FItems = rtl.arraySetLength(this.FItems,null,AValue);
    };
    this.SetCount = function (AValue) {
      if (AValue < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (AValue > this.GetCapacity()) {
        this.SetCapacity(AValue)}
       else if (AValue < this.FLength) this.DeleteRange(AValue,this.FLength - AValue);
      this.FLength = AValue;
    };
    this.InitializeList = function () {
    };
    this.InternalInsert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.FItems.splice(AIndex,0,AValue);
      this.FLength += 1;
      this.FItems[AIndex] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.GetEnumerator$1();
      return Result;
    };
    this.GetItem = function (AIndex) {
      var Result = null;
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      return Result;
    };
    this.SetItem = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.Notify(this.FItems[AIndex],$mod.TCollectionNotification.cnRemoved);
      this.FItems[AIndex] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.Create$1 = function () {
      this.InitializeList();
      return this;
    };
    this.Create$2 = function (AComparer) {
      this.InitializeList();
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Create$3 = function (ACollection) {
      var LItem = null;
      this.Create$1();
      var $in = ACollection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LItem = $in.DoGetCurrent();
          this.Add(LItem);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Destroy = function () {
      this.SetCapacity(0);
    };
    this.Add = function (AValue) {
      var Result = 0;
      Result = this.PrepareAddingItem();
      this.FItems[Result] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
      return Result;
    };
    this.AddRange = function (AValues) {
      this.InsertRange(this.FLength,AValues);
    };
    this.AddRange$1 = function (AEnumerable) {
      var LValue = null;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.Add(LValue);
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.AddRange$2 = function (AEnumerable) {
      var LValue = null;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.Add(LValue);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Insert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.InternalInsert(AIndex,AValue);
    };
    this.InsertRange = function (AIndex, AValues) {
      var LLength = 0;
      var i = 0;
      var LValue = null;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LLength = rtl.length(AValues);
      if (LLength === 0) return;
      if (AIndex !== this.PrepareAddingRange(LLength)) {
        for (var $l = AIndex, $end = this.FLength - LLength - 1; $l <= $end; $l++) {
          i = $l;
          this.FItems[i + LLength] = this.FItems[i];
        };
        for (var $l1 = 0, $end1 = LLength - 1; $l1 <= $end1; $l1++) {
          i = $l1;
          this.FItems[AIndex + i] = null;
        };
      };
      for (var $l2 = 0, $end2 = LLength - 1; $l2 <= $end2; $l2++) {
        i = $l2;
        LValue = AValues[i];
        this.FItems[i + AIndex] = LValue;
        this.Notify(LValue,$mod.TCollectionNotification.cnAdded);
      };
    };
    this.InsertRange$1 = function (AIndex, AEnumerable) {
      var LValue = null;
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.InsertRange$2 = function (AIndex, AEnumerable) {
      var LValue = null;
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Remove = function (AValue) {
      var Result = 0;
      Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.RemoveItem = function (AValue, Direction) {
      var Result = 0;
      if (Direction === $mod.TDirection.fromEnd) {
        Result = this.LastIndexOf(AValue)}
       else Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.Delete = function (AIndex) {
      this.DoRemove(AIndex,$mod.TCollectionNotification.cnRemoved);
    };
    this.DeleteRange = function (AIndex, ACount) {
      var LDeleted = [];
      var i = 0;
      if (ACount === 0) return;
      if ((ACount < 0) || (AIndex < 0) || ((AIndex + ACount) > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LDeleted = this.FItems.splice(AIndex,this.FLength);
      this.FLength -= ACount;
      for (var $l = 0, $end = rtl.length(LDeleted) - 1; $l <= $end; $l++) {
        i = $l;
        this.Notify(LDeleted[i],$mod.TCollectionNotification.cnRemoved);
      };
    };
    this.ExtractIndex = function (AIndex) {
      var Result = null;
      Result = this.DoRemove(AIndex,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.Extract = function (AValue) {
      var Result = null;
      var LIndex = 0;
      LIndex = this.IndexOf(AValue);
      if (LIndex < 0) {
        Result = null}
       else Result = this.DoRemove(LIndex,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.Exchange = function (AIndex1, AIndex2) {
      var LTemp = null;
      LTemp = this.FItems[AIndex1];
      this.FItems[AIndex1] = this.FItems[AIndex2];
      this.FItems[AIndex2] = LTemp;
    };
    this.Move = function (AIndex, ANewIndex) {
      var Arr = null;
      var LTemp = undefined;
      var i = 0;
      if (ANewIndex === AIndex) return;
      if ((ANewIndex < 0) || (ANewIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Arr = this.FItems;
      LTemp = Arr[AIndex];
      if (AIndex < ANewIndex) {
        for (var $l = AIndex, $end = ANewIndex - 1; $l <= $end; $l++) {
          i = $l;
          Arr[i] = Arr[i + 1];
        }}
       else for (var $l1 = AIndex, $end1 = ANewIndex + 1; $l1 >= $end1; $l1--) {
        i = $l1;
        Arr[i] = Arr[i - 1];
      };
      Arr[ANewIndex] = LTemp;
    };
    this.First = function () {
      var Result = null;
      Result = this.GetItem(0);
      return Result;
    };
    this.Last = function () {
      var Result = null;
      Result = this.GetItem(this.FLength - 1);
      return Result;
    };
    this.Clear = function () {
      this.SetCount(0);
      this.SetCapacity(0);
    };
    this.Contains = function (AValue) {
      var Result = false;
      Result = this.IndexOf(AValue) >= 0;
      return Result;
    };
    this.IndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = 0, $end = this.FLength - 1; $l <= $end; $l++) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.LastIndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = this.FLength - 1; $l >= 0; $l--) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.Reverse = function () {
      var a = 0;
      var b = 0;
      var LTemp = null;
      a = 0;
      b = this.FLength - 1;
      while (a < b) {
        LTemp = this.FItems[a];
        this.FItems[a] = this.FItems[b];
        this.FItems[b] = LTemp;
        a += 1;
        b -= 1;
      };
    };
    this.TrimExcess = function () {
      this.SetCapacity(this.FLength);
    };
    this.Sort = function () {
      $mod.TArrayHelper$$$G$$generics$collections$$TXDataPrimitiveType.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},this.FComparer,0,this.FLength);
    };
    this.Sort$1 = function (AComparer) {
      $mod.TArrayHelper$$$G$$generics$collections$$TXDataPrimitiveType.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},AComparer,0,this.FLength);
    };
    this.BinarySearch = function (AItem, AIndex) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$TXDataPrimitiveType.BinarySearch$1(this.FItems,AItem,AIndex,this.FComparer,0,this.FLength);
      return Result;
    };
    this.BinarySearch$1 = function (AItem, AIndex, AComparer) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$TXDataPrimitiveType.BinarySearch$1(this.FItems,AItem,AIndex,AComparer,0,this.FLength);
      return Result;
    };
  },"TList<XData.Model.Types.TXDataPrimitiveType>");
  rtl.recNewT(this,"TPair$$$G$$generics$collections$$String$$TObject",function () {
    this.Key = "";
    this.Value = null;
    this.$eq = function (b) {
      return (this.Key === b.Key) && (this.Value === b.Value);
    };
    this.$assign = function (s) {
      this.Key = s.Key;
      this.Value = s.Value;
      return this;
    };
    this.Create = function (AKey, AValue) {
      this.Key = AKey;
      this.Value = AValue;
      return this;
    };
    var $r = $mod.$rtti.$Record("TPair<System.String,System.TObject>",{},this);
    $r.addField("Key",rtl.string);
    $r.addField("Value",pas.System.$rtti["TObject"]);
    $r.addMethod("Create",2,[["AKey",rtl.string,2],["AValue",pas.System.$rtti["TObject"],2]]);
  });
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TPair$System$String$System$TObject$",pas.System.TObject,function () {
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<Generics.Collections.TPair<System.String,System.TObject>>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TPair$System$String$System$TObject$",pas.System.TObject,function () {
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push($mod.TPair$$$G$$generics$collections$$String$$TObject.$clone(LEnumerator.DoGetCurrent()));
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<Generics.Collections.TPair<System.String,System.TObject>>");
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TObject",pas.System.TObject,function () {
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<System.TObject>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TObject",pas.System.TObject,function () {
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push(LEnumerator.DoGetCurrent());
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<System.TObject>");
  this.$rtti.$MethodVar("TCollectionNotifyEvent<System.TObject>",{procsig: rtl.newTIProcSig([["ASender",pas.System.$rtti["TObject"]],["AItem",pas.System.$rtti["TObject"],2],["AAction",this.$rtti["TCollectionNotification"]]]), methodkind: 0});
  rtl.createClass(this,"TDictionary$$$G$$generics$collections$$String$$TObject",this.TEnumerable$$$G$$generics$collections$$TPair$System$String$System$TObject$,function () {
    rtl.createClass(this,"TPairEnumerator",$mod.TEnumerator$$$G$$generics$collections$$TPair$System$String$System$TObject$,function () {
      this.$init = function () {
        $mod.TEnumerator$$$G$$generics$collections$$TPair$System$String$System$TObject$.$init.call(this);
        this.FIter = null;
        this.FVal = null;
      };
      this.$final = function () {
        this.FIter = undefined;
        this.FVal = undefined;
        $mod.TEnumerator$$$G$$generics$collections$$TPair$System$String$System$TObject$.$final.call(this);
      };
      this.GetCurrent = function () {
        var Result = $mod.TPair$$$G$$generics$collections$$String$$TObject.$new();
        Result.$assign(this.DoGetCurrent());
        return Result;
      };
      this.DoGetCurrent = function () {
        var Result = $mod.TPair$$$G$$generics$collections$$String$$TObject.$new();
        var A = [];
        A = this.FVal.value;
        Result.$assign($mod.TPair$$$G$$generics$collections$$String$$TObject.$new());
        Result.Create("" + A[0],rtl.getObject(A[1]));
        return Result;
      };
      this.DoMoveNext = function () {
        var Result = false;
        this.FVal = this.FIter.next();
        Result = !this.FVal.done;
        return Result;
      };
      this.Create$1 = function (ADictionary) {
        this.FIter = ADictionary.FMap.entries();
        return this;
      };
      this.MoveNext$1 = function () {
        var Result = false;
        Result = this.DoMoveNext();
        return Result;
      };
    },"TDictionary<System.String,System.TObject>.TPairEnumerator");
    rtl.createClass(this,"TKeyEnumerator",$mod.TEnumerator$$$G$$generics$collections$$String,function () {
      this.$init = function () {
        $mod.TEnumerator$$$G$$generics$collections$$String.$init.call(this);
        this.FIter = null;
        this.FVal = null;
      };
      this.$final = function () {
        this.FIter = undefined;
        this.FVal = undefined;
        $mod.TEnumerator$$$G$$generics$collections$$String.$final.call(this);
      };
      this.GetCurrent = function () {
        var Result = "";
        Result = this.DoGetCurrent();
        return Result;
      };
      this.DoGetCurrent = function () {
        var Result = "";
        Result = "" + this.FVal.value;
        return Result;
      };
      this.DoMoveNext = function () {
        var Result = false;
        this.FVal = this.FIter.next();
        Result = !this.FVal.done;
        return Result;
      };
      this.Create$1 = function (AIter) {
        this.FIter = AIter;
        return this;
      };
      this.Create$2 = function (ADictionary) {
        this.Create$1(ADictionary.FMap.keys());
        return this;
      };
      this.MoveNext$1 = function () {
        var Result = false;
        Result = this.DoMoveNext();
        return Result;
      };
    },"TDictionary<System.String,System.TObject>.TKeyEnumerator");
    rtl.createClass(this,"TValueEnumerator",$mod.TEnumerator$$$G$$generics$collections$$TObject,function () {
      this.$init = function () {
        $mod.TEnumerator$$$G$$generics$collections$$TObject.$init.call(this);
        this.FIter = null;
        this.FVal = null;
      };
      this.$final = function () {
        this.FIter = undefined;
        this.FVal = undefined;
        $mod.TEnumerator$$$G$$generics$collections$$TObject.$final.call(this);
      };
      this.GetCurrent = function () {
        var Result = null;
        Result = this.DoGetCurrent();
        return Result;
      };
      this.DoGetCurrent = function () {
        var Result = null;
        Result = rtl.getObject(this.FVal.value);
        return Result;
      };
      this.DoMoveNext = function () {
        var Result = false;
        this.FVal = this.FIter.next();
        Result = !this.FVal.done;
        return Result;
      };
      this.Create$1 = function (AIter) {
        this.FIter = AIter;
        return this;
      };
      this.Create$2 = function (ADictionary) {
        this.Create$1(ADictionary.FMap.values());
        return this;
      };
      this.MoveNext$1 = function () {
        var Result = false;
        Result = this.DoMoveNext();
        return Result;
      };
    },"TDictionary<System.String,System.TObject>.TValueEnumerator");
    rtl.createClass(this,"TValueCollection",$mod.TEnumerable$$$G$$generics$collections$$TObject,function () {
      this.$init = function () {
        $mod.TEnumerable$$$G$$generics$collections$$TObject.$init.call(this);
        this.FMap = null;
      };
      this.$final = function () {
        this.FMap = undefined;
        $mod.TEnumerable$$$G$$generics$collections$$TObject.$final.call(this);
      };
      this.GetCount = function () {
        var Result = 0;
        Result = this.FMap.size;
        return Result;
      };
      this.DoGetEnumerator = function () {
        var Result = null;
        Result = $mod.TDictionary$$$G$$generics$collections$$String$$TObject.TValueEnumerator.$create("Create$1",[this.FMap.values()]);
        return Result;
      };
      this.Create$1 = function (ADictionary) {
        this.FMap = ADictionary.FMap;
        return this;
      };
      this.GetEnumerator$1 = function () {
        var Result = null;
        Result = this.DoGetEnumerator();
        return Result;
      };
      this.ToArray = function () {
        var Result = [];
        var I = 0;
        var P = null;
        Result = rtl.arraySetLength(Result,null,this.FMap.size);
        var $in = this.GetEnumerator$1();
        try {
          while ($in.MoveNext$1()) {
            P = $in.GetCurrent();
            Result[I] = P;
            I += 1;
          }
        } finally {
          $in = rtl.freeLoc($in)
        };
        return Result;
      };
    },"TDictionary<System.String,System.TObject>.TValueCollection");
    rtl.createClass(this,"TKeyCollection",$mod.TEnumerable$$$G$$generics$collections$$String,function () {
      this.$init = function () {
        $mod.TEnumerable$$$G$$generics$collections$$String.$init.call(this);
        this.FMap = null;
      };
      this.$final = function () {
        this.FMap = undefined;
        $mod.TEnumerable$$$G$$generics$collections$$String.$final.call(this);
      };
      this.GetCount = function () {
        var Result = 0;
        Result = this.FMap.size;
        return Result;
      };
      this.DoGetEnumerator = function () {
        var Result = null;
        Result = this.GetEnumerator$1();
        return Result;
      };
      this.Create$1 = function (ADictionary) {
        this.FMap = ADictionary.FMap;
        return this;
      };
      this.GetEnumerator$1 = function () {
        var Result = null;
        Result = $mod.TDictionary$$$G$$generics$collections$$String$$TObject.TKeyEnumerator.$create("Create$1",[this.FMap.keys()]);
        return Result;
      };
      this.ToArray = function () {
        var Result = [];
        Result = $mod.TEnumerable$$$G$$generics$collections$$String.ToArray.call(this);
        return Result;
      };
    },"TDictionary<System.String,System.TObject>.TKeyCollection");
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$TPair$System$String$System$TObject$.$init.call(this);
      this.FMap = null;
      this.FComparer = null;
      this.FOnKeyNotify = null;
      this.FOnValueNotify = null;
      this.FKeyCollection = null;
      this.FValueCollection = null;
    };
    this.$final = function () {
      this.FMap = undefined;
      rtl.setIntfP(this,"FComparer",null);
      this.FOnKeyNotify = undefined;
      this.FOnValueNotify = undefined;
      this.FKeyCollection = undefined;
      this.FValueCollection = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$TPair$System$String$System$TObject$.$final.call(this);
    };
    this.GetEffectiveKey = function (Key) {
      var Result = "";
      var it = null;
      var v = null;
      if (!(this.FComparer != null)) return Key;
      it = this.FMap.keys();
      v = it.next();
      while (!v.done) {
        Result = "" + v.value;
        if (this.FComparer.Compare(Result,Key) === 0) return Result;
        v = it.next();
      };
      Result = Key;
      return Result;
    };
    this.GetItem = function (Key) {
      var Result = null;
      var V = undefined;
      V = this.FMap.get(this.GetEffectiveKey(Key));
      if (pas.JS.isUndefined(V)) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictKeyNotFound")]);
      Result = rtl.getObject(V);
      return Result;
    };
    this.SetItem = function (Key, Value) {
      var V = undefined;
      V = this.FMap.get(this.GetEffectiveKey(Key));
      if (!pas.JS.isUndefined(V)) this.ValueNotify(rtl.getObject(V),$mod.TCollectionNotification.cnRemoved);
      this.FMap.set(Key,Value);
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoAdd = function (Key, Value) {
      this.FMap.set(this.GetEffectiveKey(Key),Value);
      this.KeyNotify(Key,$mod.TCollectionNotification.cnAdded);
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoRemove = function (Key, Notification) {
      var Result = null;
      var V = undefined;
      var K = "";
      K = this.GetEffectiveKey(Key);
      V = this.FMap.get(K);
      if (!pas.JS.isUndefined(V)) {
        this.FMap.delete(K);
        Result = rtl.getObject(V);
        this.KeyNotify(Key,Notification);
        this.ValueNotify(Result,Notification);
      };
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FMap.size;
      return Result;
    };
    this.CanClearMap = function () {
      var Result = false;
      Result = (this.FOnKeyNotify === null) && (this.FOnValueNotify === null);
      return Result;
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.PairNotify = function (Key, Value, Action) {
      this.KeyNotify(Key,Action);
      this.ValueNotify(Value,Action);
    };
    this.KeyNotify = function (Key, Action) {
      if (this.FOnKeyNotify != null) this.FOnKeyNotify(this,Key,Action);
    };
    this.ValueNotify = function (Value, Action) {
      if (this.FOnValueNotify != null) this.FOnValueNotify(this,Value,Action);
    };
    this.Create$1 = function (ACapacity) {
      this.FMap = new Map();
      if (ACapacity > 0) ;
      return this;
    };
    this.Create$2 = function (Collection) {
      var aPair = $mod.TPair$$$G$$generics$collections$$String$$TObject.$new();
      this.Create$1(0);
      var $in = Collection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          aPair = $in.DoGetCurrent();
          this.Add(aPair.Key,aPair.Value);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Create$3 = function (AComparer) {
      this.Create$1(0);
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FKeyCollection;
        }, set: function (v) {
          this.p.FKeyCollection = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FValueCollection;
        }, set: function (v) {
          this.p.FValueCollection = v;
        }});
      this.Clear();
      this.FMap = null;
      pas.System.TObject.Destroy.call(this);
    };
    this.Add = function (Key, Value) {
      if (this.FMap.has(this.GetEffectiveKey(Key))) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictDuplicateKey")]);
      this.DoAdd(Key,Value);
    };
    this.Remove = function (Key) {
      this.DoRemove(Key,$mod.TCollectionNotification.cnRemoved);
    };
    this.ExtractPair = function (Key) {
      var Result = $mod.TPair$$$G$$generics$collections$$String$$TObject.$new();
      var K = "";
      Result.$assign($mod.TPair$$$G$$generics$collections$$String$$TObject.$new());
      K = this.GetEffectiveKey(Key);
      if (this.FMap.has(K)) {
        Result.Create(Key,rtl.getObject(this.FMap.get(K)));
        this.FMap.delete(K);
      } else Result.Create(Key,null);
      return Result;
    };
    this.Clear = function () {
      var Iter = null;
      var IVal = null;
      var A = [];
      var K = "";
      var V = null;
      if (this.CanClearMap()) {
        this.FMap.clear()}
       else {
        Iter = this.FMap.entries();
        do {
          IVal = Iter.next();
          if (!IVal.done) {
            A = IVal.value;
            K = "" + A[0];
            V = rtl.getObject(A[1]);
            this.FMap.delete(K);
            this.PairNotify(K,V,$mod.TCollectionNotification.cnRemoved);
          };
        } while (!IVal.done);
      };
    };
    this.TryGetValue = function (Key, Value) {
      var Result = false;
      var K = "";
      K = this.GetEffectiveKey(Key);
      Result = this.FMap.has(K);
      if (Result) Value.set(rtl.getObject(this.FMap.get(K)));
      return Result;
    };
    this.AddOrSetValue = function (Key, Value) {
      var k = "";
      k = this.GetEffectiveKey(Key);
      if (!this.FMap.has(k)) {
        this.DoAdd(Key,Value)}
       else this.SetItem(k,Value);
    };
    this.ContainsKey = function (Key) {
      var Result = false;
      Result = this.FMap.has(this.GetEffectiveKey(Key));
      return Result;
    };
    this.ContainsValue = function (Value) {
      var Result = false;
      var It = null;
      var Res = null;
      Result = false;
      It = this.FMap.values();
      do {
        Res = It.next();
        if (!Res.done) Result = Value === rtl.getObject(Res.value);
      } while (!(Result || Res.done));
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      Result = $mod.TEnumerable$$$G$$generics$collections$$TPair$System$String$System$TObject$.ToArray.call(this);
      return Result;
    };
    this.GetKeys = function () {
      var Result = null;
      if (this.FKeyCollection === null) this.FKeyCollection = this.TKeyCollection.$create("Create$1",[this]);
      Result = this.FKeyCollection;
      return Result;
    };
    this.GetValues = function () {
      var Result = null;
      if (this.FValueCollection === null) this.FValueCollection = this.TValueCollection.$create("Create$1",[this]);
      Result = this.FValueCollection;
      return Result;
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
  },"TDictionary<System.String,System.TObject>");
  rtl.recNewT(this,"TPair$$$G$$generics$collections$$Longint$$TObject",function () {
    this.Key = 0;
    this.Value = null;
    this.$eq = function (b) {
      return (this.Key === b.Key) && (this.Value === b.Value);
    };
    this.$assign = function (s) {
      this.Key = s.Key;
      this.Value = s.Value;
      return this;
    };
    this.Create = function (AKey, AValue) {
      this.Key = AKey;
      this.Value = AValue;
      return this;
    };
    var $r = $mod.$rtti.$Record("TPair<System.Longint,System.TObject>",{},this);
    $r.addField("Key",rtl.longint);
    $r.addField("Value",pas.System.$rtti["TObject"]);
    $r.addMethod("Create",2,[["AKey",rtl.longint,2],["AValue",pas.System.$rtti["TObject"],2]]);
  });
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TPair$System$Longint$System$TObject$",pas.System.TObject,function () {
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<Generics.Collections.TPair<System.Longint,System.TObject>>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TPair$System$Longint$System$TObject$",pas.System.TObject,function () {
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push($mod.TPair$$$G$$generics$collections$$Longint$$TObject.$clone(LEnumerator.DoGetCurrent()));
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<Generics.Collections.TPair<System.Longint,System.TObject>>");
  rtl.createClass(this,"TDictionary$$$G$$generics$collections$$Longint$$TObject",this.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$System$TObject$,function () {
    rtl.createClass(this,"TPairEnumerator",$mod.TEnumerator$$$G$$generics$collections$$TPair$System$Longint$System$TObject$,function () {
      this.$init = function () {
        $mod.TEnumerator$$$G$$generics$collections$$TPair$System$Longint$System$TObject$.$init.call(this);
        this.FIter = null;
        this.FVal = null;
      };
      this.$final = function () {
        this.FIter = undefined;
        this.FVal = undefined;
        $mod.TEnumerator$$$G$$generics$collections$$TPair$System$Longint$System$TObject$.$final.call(this);
      };
      this.GetCurrent = function () {
        var Result = $mod.TPair$$$G$$generics$collections$$Longint$$TObject.$new();
        Result.$assign(this.DoGetCurrent());
        return Result;
      };
      this.DoGetCurrent = function () {
        var Result = $mod.TPair$$$G$$generics$collections$$Longint$$TObject.$new();
        var A = [];
        A = this.FVal.value;
        Result.$assign($mod.TPair$$$G$$generics$collections$$Longint$$TObject.$new());
        Result.Create(rtl.trunc(A[0]),rtl.getObject(A[1]));
        return Result;
      };
      this.DoMoveNext = function () {
        var Result = false;
        this.FVal = this.FIter.next();
        Result = !this.FVal.done;
        return Result;
      };
      this.Create$1 = function (ADictionary) {
        this.FIter = ADictionary.FMap.entries();
        return this;
      };
      this.MoveNext$1 = function () {
        var Result = false;
        Result = this.DoMoveNext();
        return Result;
      };
    },"TDictionary<System.Longint,System.TObject>.TPairEnumerator");
    rtl.createClass(this,"TKeyEnumerator",$mod.TEnumerator$$$G$$generics$collections$$Longint,function () {
      this.$init = function () {
        $mod.TEnumerator$$$G$$generics$collections$$Longint.$init.call(this);
        this.FIter = null;
        this.FVal = null;
      };
      this.$final = function () {
        this.FIter = undefined;
        this.FVal = undefined;
        $mod.TEnumerator$$$G$$generics$collections$$Longint.$final.call(this);
      };
      this.GetCurrent = function () {
        var Result = 0;
        Result = this.DoGetCurrent();
        return Result;
      };
      this.DoGetCurrent = function () {
        var Result = 0;
        Result = rtl.trunc(this.FVal.value);
        return Result;
      };
      this.DoMoveNext = function () {
        var Result = false;
        this.FVal = this.FIter.next();
        Result = !this.FVal.done;
        return Result;
      };
      this.Create$1 = function (AIter) {
        this.FIter = AIter;
        return this;
      };
      this.Create$2 = function (ADictionary) {
        this.Create$1(ADictionary.FMap.keys());
        return this;
      };
      this.MoveNext$1 = function () {
        var Result = false;
        Result = this.DoMoveNext();
        return Result;
      };
    },"TDictionary<System.Longint,System.TObject>.TKeyEnumerator");
    rtl.createClass(this,"TValueEnumerator",$mod.TEnumerator$$$G$$generics$collections$$TObject,function () {
      this.$init = function () {
        $mod.TEnumerator$$$G$$generics$collections$$TObject.$init.call(this);
        this.FIter = null;
        this.FVal = null;
      };
      this.$final = function () {
        this.FIter = undefined;
        this.FVal = undefined;
        $mod.TEnumerator$$$G$$generics$collections$$TObject.$final.call(this);
      };
      this.GetCurrent = function () {
        var Result = null;
        Result = this.DoGetCurrent();
        return Result;
      };
      this.DoGetCurrent = function () {
        var Result = null;
        Result = rtl.getObject(this.FVal.value);
        return Result;
      };
      this.DoMoveNext = function () {
        var Result = false;
        this.FVal = this.FIter.next();
        Result = !this.FVal.done;
        return Result;
      };
      this.Create$1 = function (AIter) {
        this.FIter = AIter;
        return this;
      };
      this.Create$2 = function (ADictionary) {
        this.Create$1(ADictionary.FMap.values());
        return this;
      };
      this.MoveNext$1 = function () {
        var Result = false;
        Result = this.DoMoveNext();
        return Result;
      };
    },"TDictionary<System.Longint,System.TObject>.TValueEnumerator");
    rtl.createClass(this,"TValueCollection",$mod.TEnumerable$$$G$$generics$collections$$TObject,function () {
      this.$init = function () {
        $mod.TEnumerable$$$G$$generics$collections$$TObject.$init.call(this);
        this.FMap = null;
      };
      this.$final = function () {
        this.FMap = undefined;
        $mod.TEnumerable$$$G$$generics$collections$$TObject.$final.call(this);
      };
      this.GetCount = function () {
        var Result = 0;
        Result = this.FMap.size;
        return Result;
      };
      this.DoGetEnumerator = function () {
        var Result = null;
        Result = $mod.TDictionary$$$G$$generics$collections$$Longint$$TObject.TValueEnumerator.$create("Create$1",[this.FMap.values()]);
        return Result;
      };
      this.Create$1 = function (ADictionary) {
        this.FMap = ADictionary.FMap;
        return this;
      };
      this.GetEnumerator$1 = function () {
        var Result = null;
        Result = this.DoGetEnumerator();
        return Result;
      };
      this.ToArray = function () {
        var Result = [];
        var I = 0;
        var P = null;
        Result = rtl.arraySetLength(Result,null,this.FMap.size);
        var $in = this.GetEnumerator$1();
        try {
          while ($in.MoveNext$1()) {
            P = $in.GetCurrent();
            Result[I] = P;
            I += 1;
          }
        } finally {
          $in = rtl.freeLoc($in)
        };
        return Result;
      };
    },"TDictionary<System.Longint,System.TObject>.TValueCollection");
    rtl.createClass(this,"TKeyCollection",$mod.TEnumerable$$$G$$generics$collections$$Longint,function () {
      this.$init = function () {
        $mod.TEnumerable$$$G$$generics$collections$$Longint.$init.call(this);
        this.FMap = null;
      };
      this.$final = function () {
        this.FMap = undefined;
        $mod.TEnumerable$$$G$$generics$collections$$Longint.$final.call(this);
      };
      this.GetCount = function () {
        var Result = 0;
        Result = this.FMap.size;
        return Result;
      };
      this.DoGetEnumerator = function () {
        var Result = null;
        Result = this.GetEnumerator$1();
        return Result;
      };
      this.Create$1 = function (ADictionary) {
        this.FMap = ADictionary.FMap;
        return this;
      };
      this.GetEnumerator$1 = function () {
        var Result = null;
        Result = $mod.TDictionary$$$G$$generics$collections$$Longint$$TObject.TKeyEnumerator.$create("Create$1",[this.FMap.keys()]);
        return Result;
      };
      this.ToArray = function () {
        var Result = [];
        Result = $mod.TEnumerable$$$G$$generics$collections$$Longint.ToArray.call(this);
        return Result;
      };
    },"TDictionary<System.Longint,System.TObject>.TKeyCollection");
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$System$TObject$.$init.call(this);
      this.FMap = null;
      this.FComparer = null;
      this.FOnKeyNotify = null;
      this.FOnValueNotify = null;
      this.FKeyCollection = null;
      this.FValueCollection = null;
    };
    this.$final = function () {
      this.FMap = undefined;
      rtl.setIntfP(this,"FComparer",null);
      this.FOnKeyNotify = undefined;
      this.FOnValueNotify = undefined;
      this.FKeyCollection = undefined;
      this.FValueCollection = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$System$TObject$.$final.call(this);
    };
    this.GetEffectiveKey = function (Key) {
      var Result = 0;
      var it = null;
      var v = null;
      if (!(this.FComparer != null)) return Key;
      it = this.FMap.keys();
      v = it.next();
      while (!v.done) {
        Result = rtl.trunc(v.value);
        if (this.FComparer.Compare(Result,Key) === 0) return Result;
        v = it.next();
      };
      Result = Key;
      return Result;
    };
    this.GetItem = function (Key) {
      var Result = null;
      var V = undefined;
      V = this.FMap.get(this.GetEffectiveKey(Key));
      if (pas.JS.isUndefined(V)) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictKeyNotFound")]);
      Result = rtl.getObject(V);
      return Result;
    };
    this.SetItem = function (Key, Value) {
      var V = undefined;
      V = this.FMap.get(this.GetEffectiveKey(Key));
      if (!pas.JS.isUndefined(V)) this.ValueNotify(rtl.getObject(V),$mod.TCollectionNotification.cnRemoved);
      this.FMap.set(Key,Value);
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoAdd = function (Key, Value) {
      this.FMap.set(this.GetEffectiveKey(Key),Value);
      this.KeyNotify(Key,$mod.TCollectionNotification.cnAdded);
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoRemove = function (Key, Notification) {
      var Result = null;
      var V = undefined;
      var K = 0;
      K = this.GetEffectiveKey(Key);
      V = this.FMap.get(K);
      if (!pas.JS.isUndefined(V)) {
        this.FMap.delete(K);
        Result = rtl.getObject(V);
        this.KeyNotify(Key,Notification);
        this.ValueNotify(Result,Notification);
      };
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FMap.size;
      return Result;
    };
    this.CanClearMap = function () {
      var Result = false;
      Result = (this.FOnKeyNotify === null) && (this.FOnValueNotify === null);
      return Result;
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.PairNotify = function (Key, Value, Action) {
      this.KeyNotify(Key,Action);
      this.ValueNotify(Value,Action);
    };
    this.KeyNotify = function (Key, Action) {
      if (this.FOnKeyNotify != null) this.FOnKeyNotify(this,Key,Action);
    };
    this.ValueNotify = function (Value, Action) {
      if (this.FOnValueNotify != null) this.FOnValueNotify(this,Value,Action);
    };
    this.Create$1 = function (ACapacity) {
      this.FMap = new Map();
      if (ACapacity > 0) ;
      return this;
    };
    this.Create$2 = function (Collection) {
      var aPair = $mod.TPair$$$G$$generics$collections$$Longint$$TObject.$new();
      this.Create$1(0);
      var $in = Collection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          aPair = $in.DoGetCurrent();
          this.Add(aPair.Key,aPair.Value);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Create$3 = function (AComparer) {
      this.Create$1(0);
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FKeyCollection;
        }, set: function (v) {
          this.p.FKeyCollection = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FValueCollection;
        }, set: function (v) {
          this.p.FValueCollection = v;
        }});
      this.Clear();
      this.FMap = null;
      pas.System.TObject.Destroy.call(this);
    };
    this.Add = function (Key, Value) {
      if (this.FMap.has(this.GetEffectiveKey(Key))) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictDuplicateKey")]);
      this.DoAdd(Key,Value);
    };
    this.Remove = function (Key) {
      this.DoRemove(Key,$mod.TCollectionNotification.cnRemoved);
    };
    this.ExtractPair = function (Key) {
      var Result = $mod.TPair$$$G$$generics$collections$$Longint$$TObject.$new();
      var K = 0;
      Result.$assign($mod.TPair$$$G$$generics$collections$$Longint$$TObject.$new());
      K = this.GetEffectiveKey(Key);
      if (this.FMap.has(K)) {
        Result.Create(Key,rtl.getObject(this.FMap.get(K)));
        this.FMap.delete(K);
      } else Result.Create(Key,null);
      return Result;
    };
    this.Clear = function () {
      var Iter = null;
      var IVal = null;
      var A = [];
      var K = 0;
      var V = null;
      if (this.CanClearMap()) {
        this.FMap.clear()}
       else {
        Iter = this.FMap.entries();
        do {
          IVal = Iter.next();
          if (!IVal.done) {
            A = IVal.value;
            K = rtl.trunc(A[0]);
            V = rtl.getObject(A[1]);
            this.FMap.delete(K);
            this.PairNotify(K,V,$mod.TCollectionNotification.cnRemoved);
          };
        } while (!IVal.done);
      };
    };
    this.TryGetValue = function (Key, Value) {
      var Result = false;
      var K = 0;
      K = this.GetEffectiveKey(Key);
      Result = this.FMap.has(K);
      if (Result) Value.set(rtl.getObject(this.FMap.get(K)));
      return Result;
    };
    this.AddOrSetValue = function (Key, Value) {
      var k = 0;
      k = this.GetEffectiveKey(Key);
      if (!this.FMap.has(k)) {
        this.DoAdd(Key,Value)}
       else this.SetItem(k,Value);
    };
    this.ContainsKey = function (Key) {
      var Result = false;
      Result = this.FMap.has(this.GetEffectiveKey(Key));
      return Result;
    };
    this.ContainsValue = function (Value) {
      var Result = false;
      var It = null;
      var Res = null;
      Result = false;
      It = this.FMap.values();
      do {
        Res = It.next();
        if (!Res.done) Result = Value === rtl.getObject(Res.value);
      } while (!(Result || Res.done));
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      Result = $mod.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$System$TObject$.ToArray.call(this);
      return Result;
    };
    this.GetKeys = function () {
      var Result = null;
      if (this.FKeyCollection === null) this.FKeyCollection = this.TKeyCollection.$create("Create$1",[this]);
      Result = this.FKeyCollection;
      return Result;
    };
    this.GetValues = function () {
      var Result = null;
      if (this.FValueCollection === null) this.FValueCollection = this.TValueCollection.$create("Create$1",[this]);
      Result = this.FValueCollection;
      return Result;
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
  },"TDictionary<System.Longint,System.TObject>");
  rtl.recNewT(this,"TPair$$$G$$generics$collections$$Longint$$Longint",function () {
    this.Key = 0;
    this.Value = 0;
    this.$eq = function (b) {
      return (this.Key === b.Key) && (this.Value === b.Value);
    };
    this.$assign = function (s) {
      this.Key = s.Key;
      this.Value = s.Value;
      return this;
    };
    this.Create = function (AKey, AValue) {
      this.Key = AKey;
      this.Value = AValue;
      return this;
    };
    var $r = $mod.$rtti.$Record("TPair<System.Longint,System.Longint>",{},this);
    $r.addField("Key",rtl.longint);
    $r.addField("Value",rtl.longint);
    $r.addMethod("Create",2,[["AKey",rtl.longint,2],["AValue",rtl.longint,2]]);
  });
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TPair$System$Longint$System$Longint$",pas.System.TObject,function () {
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<Generics.Collections.TPair<System.Longint,System.Longint>>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TPair$System$Longint$System$Longint$",pas.System.TObject,function () {
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push($mod.TPair$$$G$$generics$collections$$Longint$$Longint.$clone(LEnumerator.DoGetCurrent()));
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<Generics.Collections.TPair<System.Longint,System.Longint>>");
  rtl.createClass(this,"TDictionary$$$G$$generics$collections$$Longint$$Longint",this.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$System$Longint$,function () {
    rtl.createClass(this,"TPairEnumerator",$mod.TEnumerator$$$G$$generics$collections$$TPair$System$Longint$System$Longint$,function () {
      this.$init = function () {
        $mod.TEnumerator$$$G$$generics$collections$$TPair$System$Longint$System$Longint$.$init.call(this);
        this.FIter = null;
        this.FVal = null;
      };
      this.$final = function () {
        this.FIter = undefined;
        this.FVal = undefined;
        $mod.TEnumerator$$$G$$generics$collections$$TPair$System$Longint$System$Longint$.$final.call(this);
      };
      this.GetCurrent = function () {
        var Result = $mod.TPair$$$G$$generics$collections$$Longint$$Longint.$new();
        Result.$assign(this.DoGetCurrent());
        return Result;
      };
      this.DoGetCurrent = function () {
        var Result = $mod.TPair$$$G$$generics$collections$$Longint$$Longint.$new();
        var A = [];
        A = this.FVal.value;
        Result.$assign($mod.TPair$$$G$$generics$collections$$Longint$$Longint.$new());
        Result.Create(rtl.trunc(A[0]),rtl.trunc(A[1]));
        return Result;
      };
      this.DoMoveNext = function () {
        var Result = false;
        this.FVal = this.FIter.next();
        Result = !this.FVal.done;
        return Result;
      };
      this.Create$1 = function (ADictionary) {
        this.FIter = ADictionary.FMap.entries();
        return this;
      };
      this.MoveNext$1 = function () {
        var Result = false;
        Result = this.DoMoveNext();
        return Result;
      };
    },"TDictionary<System.Longint,System.Longint>.TPairEnumerator");
    rtl.createClass(this,"TKeyEnumerator",$mod.TEnumerator$$$G$$generics$collections$$Longint,function () {
      this.$init = function () {
        $mod.TEnumerator$$$G$$generics$collections$$Longint.$init.call(this);
        this.FIter = null;
        this.FVal = null;
      };
      this.$final = function () {
        this.FIter = undefined;
        this.FVal = undefined;
        $mod.TEnumerator$$$G$$generics$collections$$Longint.$final.call(this);
      };
      this.GetCurrent = function () {
        var Result = 0;
        Result = this.DoGetCurrent();
        return Result;
      };
      this.DoGetCurrent = function () {
        var Result = 0;
        Result = rtl.trunc(this.FVal.value);
        return Result;
      };
      this.DoMoveNext = function () {
        var Result = false;
        this.FVal = this.FIter.next();
        Result = !this.FVal.done;
        return Result;
      };
      this.Create$1 = function (AIter) {
        this.FIter = AIter;
        return this;
      };
      this.Create$2 = function (ADictionary) {
        this.Create$1(ADictionary.FMap.keys());
        return this;
      };
      this.MoveNext$1 = function () {
        var Result = false;
        Result = this.DoMoveNext();
        return Result;
      };
    },"TDictionary<System.Longint,System.Longint>.TKeyEnumerator");
    rtl.createClass(this,"TValueEnumerator",$mod.TEnumerator$$$G$$generics$collections$$Longint,function () {
      this.$init = function () {
        $mod.TEnumerator$$$G$$generics$collections$$Longint.$init.call(this);
        this.FIter = null;
        this.FVal = null;
      };
      this.$final = function () {
        this.FIter = undefined;
        this.FVal = undefined;
        $mod.TEnumerator$$$G$$generics$collections$$Longint.$final.call(this);
      };
      this.GetCurrent = function () {
        var Result = 0;
        Result = this.DoGetCurrent();
        return Result;
      };
      this.DoGetCurrent = function () {
        var Result = 0;
        Result = rtl.trunc(this.FVal.value);
        return Result;
      };
      this.DoMoveNext = function () {
        var Result = false;
        this.FVal = this.FIter.next();
        Result = !this.FVal.done;
        return Result;
      };
      this.Create$1 = function (AIter) {
        this.FIter = AIter;
        return this;
      };
      this.Create$2 = function (ADictionary) {
        this.Create$1(ADictionary.FMap.values());
        return this;
      };
      this.MoveNext$1 = function () {
        var Result = false;
        Result = this.DoMoveNext();
        return Result;
      };
    },"TDictionary<System.Longint,System.Longint>.TValueEnumerator");
    rtl.createClass(this,"TValueCollection",$mod.TEnumerable$$$G$$generics$collections$$Longint,function () {
      this.$init = function () {
        $mod.TEnumerable$$$G$$generics$collections$$Longint.$init.call(this);
        this.FMap = null;
      };
      this.$final = function () {
        this.FMap = undefined;
        $mod.TEnumerable$$$G$$generics$collections$$Longint.$final.call(this);
      };
      this.GetCount = function () {
        var Result = 0;
        Result = this.FMap.size;
        return Result;
      };
      this.DoGetEnumerator = function () {
        var Result = null;
        Result = $mod.TDictionary$$$G$$generics$collections$$Longint$$Longint.TValueEnumerator.$create("Create$1",[this.FMap.values()]);
        return Result;
      };
      this.Create$1 = function (ADictionary) {
        this.FMap = ADictionary.FMap;
        return this;
      };
      this.GetEnumerator$1 = function () {
        var Result = null;
        Result = this.DoGetEnumerator();
        return Result;
      };
      this.ToArray = function () {
        var Result = [];
        var I = 0;
        var P = 0;
        Result = rtl.arraySetLength(Result,0,this.FMap.size);
        var $in = this.GetEnumerator$1();
        try {
          while ($in.MoveNext$1()) {
            P = $in.GetCurrent();
            Result[I] = P;
            I += 1;
          }
        } finally {
          $in = rtl.freeLoc($in)
        };
        return Result;
      };
    },"TDictionary<System.Longint,System.Longint>.TValueCollection");
    rtl.createClass(this,"TKeyCollection",$mod.TEnumerable$$$G$$generics$collections$$Longint,function () {
      this.$init = function () {
        $mod.TEnumerable$$$G$$generics$collections$$Longint.$init.call(this);
        this.FMap = null;
      };
      this.$final = function () {
        this.FMap = undefined;
        $mod.TEnumerable$$$G$$generics$collections$$Longint.$final.call(this);
      };
      this.GetCount = function () {
        var Result = 0;
        Result = this.FMap.size;
        return Result;
      };
      this.DoGetEnumerator = function () {
        var Result = null;
        Result = this.GetEnumerator$1();
        return Result;
      };
      this.Create$1 = function (ADictionary) {
        this.FMap = ADictionary.FMap;
        return this;
      };
      this.GetEnumerator$1 = function () {
        var Result = null;
        Result = $mod.TDictionary$$$G$$generics$collections$$Longint$$Longint.TKeyEnumerator.$create("Create$1",[this.FMap.keys()]);
        return Result;
      };
      this.ToArray = function () {
        var Result = [];
        Result = $mod.TEnumerable$$$G$$generics$collections$$Longint.ToArray.call(this);
        return Result;
      };
    },"TDictionary<System.Longint,System.Longint>.TKeyCollection");
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$System$Longint$.$init.call(this);
      this.FMap = null;
      this.FComparer = null;
      this.FOnKeyNotify = null;
      this.FOnValueNotify = null;
      this.FKeyCollection = null;
      this.FValueCollection = null;
    };
    this.$final = function () {
      this.FMap = undefined;
      rtl.setIntfP(this,"FComparer",null);
      this.FOnKeyNotify = undefined;
      this.FOnValueNotify = undefined;
      this.FKeyCollection = undefined;
      this.FValueCollection = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$System$Longint$.$final.call(this);
    };
    this.GetEffectiveKey = function (Key) {
      var Result = 0;
      var it = null;
      var v = null;
      if (!(this.FComparer != null)) return Key;
      it = this.FMap.keys();
      v = it.next();
      while (!v.done) {
        Result = rtl.trunc(v.value);
        if (this.FComparer.Compare(Result,Key) === 0) return Result;
        v = it.next();
      };
      Result = Key;
      return Result;
    };
    this.GetItem = function (Key) {
      var Result = 0;
      var V = undefined;
      V = this.FMap.get(this.GetEffectiveKey(Key));
      if (pas.JS.isUndefined(V)) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictKeyNotFound")]);
      Result = rtl.trunc(V);
      return Result;
    };
    this.SetItem = function (Key, Value) {
      var V = undefined;
      V = this.FMap.get(this.GetEffectiveKey(Key));
      if (!pas.JS.isUndefined(V)) this.ValueNotify(rtl.trunc(V),$mod.TCollectionNotification.cnRemoved);
      this.FMap.set(Key,Value);
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoAdd = function (Key, Value) {
      this.FMap.set(this.GetEffectiveKey(Key),Value);
      this.KeyNotify(Key,$mod.TCollectionNotification.cnAdded);
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoRemove = function (Key, Notification) {
      var Result = 0;
      var V = undefined;
      var K = 0;
      K = this.GetEffectiveKey(Key);
      V = this.FMap.get(K);
      if (!pas.JS.isUndefined(V)) {
        this.FMap.delete(K);
        Result = rtl.trunc(V);
        this.KeyNotify(Key,Notification);
        this.ValueNotify(Result,Notification);
      };
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FMap.size;
      return Result;
    };
    this.CanClearMap = function () {
      var Result = false;
      Result = (this.FOnKeyNotify === null) && (this.FOnValueNotify === null);
      return Result;
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.PairNotify = function (Key, Value, Action) {
      this.KeyNotify(Key,Action);
      this.ValueNotify(Value,Action);
    };
    this.KeyNotify = function (Key, Action) {
      if (this.FOnKeyNotify != null) this.FOnKeyNotify(this,Key,Action);
    };
    this.ValueNotify = function (Value, Action) {
      if (this.FOnValueNotify != null) this.FOnValueNotify(this,Value,Action);
    };
    this.Create$1 = function (ACapacity) {
      this.FMap = new Map();
      if (ACapacity > 0) ;
      return this;
    };
    this.Create$2 = function (Collection) {
      var aPair = $mod.TPair$$$G$$generics$collections$$Longint$$Longint.$new();
      this.Create$1(0);
      var $in = Collection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          aPair = $in.DoGetCurrent();
          this.Add(aPair.Key,aPair.Value);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Create$3 = function (AComparer) {
      this.Create$1(0);
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FKeyCollection;
        }, set: function (v) {
          this.p.FKeyCollection = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FValueCollection;
        }, set: function (v) {
          this.p.FValueCollection = v;
        }});
      this.Clear();
      this.FMap = null;
      pas.System.TObject.Destroy.call(this);
    };
    this.Add = function (Key, Value) {
      if (this.FMap.has(this.GetEffectiveKey(Key))) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictDuplicateKey")]);
      this.DoAdd(Key,Value);
    };
    this.Remove = function (Key) {
      this.DoRemove(Key,$mod.TCollectionNotification.cnRemoved);
    };
    this.ExtractPair = function (Key) {
      var Result = $mod.TPair$$$G$$generics$collections$$Longint$$Longint.$new();
      var K = 0;
      Result.$assign($mod.TPair$$$G$$generics$collections$$Longint$$Longint.$new());
      K = this.GetEffectiveKey(Key);
      if (this.FMap.has(K)) {
        Result.Create(Key,rtl.trunc(this.FMap.get(K)));
        this.FMap.delete(K);
      } else Result.Create(Key,-2147483648);
      return Result;
    };
    this.Clear = function () {
      var Iter = null;
      var IVal = null;
      var A = [];
      var K = 0;
      var V = 0;
      if (this.CanClearMap()) {
        this.FMap.clear()}
       else {
        Iter = this.FMap.entries();
        do {
          IVal = Iter.next();
          if (!IVal.done) {
            A = IVal.value;
            K = rtl.trunc(A[0]);
            V = rtl.trunc(A[1]);
            this.FMap.delete(K);
            this.PairNotify(K,V,$mod.TCollectionNotification.cnRemoved);
          };
        } while (!IVal.done);
      };
    };
    this.TryGetValue = function (Key, Value) {
      var Result = false;
      var K = 0;
      K = this.GetEffectiveKey(Key);
      Result = this.FMap.has(K);
      if (Result) Value.set(rtl.trunc(this.FMap.get(K)));
      return Result;
    };
    this.AddOrSetValue = function (Key, Value) {
      var k = 0;
      k = this.GetEffectiveKey(Key);
      if (!this.FMap.has(k)) {
        this.DoAdd(Key,Value)}
       else this.SetItem(k,Value);
    };
    this.ContainsKey = function (Key) {
      var Result = false;
      Result = this.FMap.has(this.GetEffectiveKey(Key));
      return Result;
    };
    this.ContainsValue = function (Value) {
      var Result = false;
      var It = null;
      var Res = null;
      Result = false;
      It = this.FMap.values();
      do {
        Res = It.next();
        if (!Res.done) Result = Value === rtl.trunc(Res.value);
      } while (!(Result || Res.done));
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      Result = $mod.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$System$Longint$.ToArray.call(this);
      return Result;
    };
    this.GetKeys = function () {
      var Result = null;
      if (this.FKeyCollection === null) this.FKeyCollection = this.TKeyCollection.$create("Create$1",[this]);
      Result = this.FKeyCollection;
      return Result;
    };
    this.GetValues = function () {
      var Result = null;
      if (this.FValueCollection === null) this.FValueCollection = this.TValueCollection.$create("Create$1",[this]);
      Result = this.FValueCollection;
      return Result;
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
  },"TDictionary<System.Longint,System.Longint>");
  rtl.recNewT(this,"TPair$$$G$$generics$collections$$Longint$$Boolean",function () {
    this.Key = 0;
    this.Value = false;
    this.$eq = function (b) {
      return (this.Key === b.Key) && (this.Value === b.Value);
    };
    this.$assign = function (s) {
      this.Key = s.Key;
      this.Value = s.Value;
      return this;
    };
    this.Create = function (AKey, AValue) {
      this.Key = AKey;
      this.Value = AValue;
      return this;
    };
    var $r = $mod.$rtti.$Record("TPair<System.Longint,System.Boolean>",{},this);
    $r.addField("Key",rtl.longint);
    $r.addField("Value",rtl.boolean);
    $r.addMethod("Create",2,[["AKey",rtl.longint,2],["AValue",rtl.boolean,2]]);
  });
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TPair$System$Longint$System$Boolean$",pas.System.TObject,function () {
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<Generics.Collections.TPair<System.Longint,System.Boolean>>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TPair$System$Longint$System$Boolean$",pas.System.TObject,function () {
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push($mod.TPair$$$G$$generics$collections$$Longint$$Boolean.$clone(LEnumerator.DoGetCurrent()));
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<Generics.Collections.TPair<System.Longint,System.Boolean>>");
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$Boolean",pas.System.TObject,function () {
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<System.Boolean>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$Boolean",pas.System.TObject,function () {
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push(LEnumerator.DoGetCurrent());
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<System.Boolean>");
  this.$rtti.$MethodVar("TCollectionNotifyEvent<System.Boolean>",{procsig: rtl.newTIProcSig([["ASender",pas.System.$rtti["TObject"]],["AItem",rtl.boolean,2],["AAction",this.$rtti["TCollectionNotification"]]]), methodkind: 0});
  rtl.createClass(this,"TDictionary$$$G$$generics$collections$$Longint$$Boolean",this.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$System$Boolean$,function () {
    rtl.createClass(this,"TPairEnumerator",$mod.TEnumerator$$$G$$generics$collections$$TPair$System$Longint$System$Boolean$,function () {
      this.$init = function () {
        $mod.TEnumerator$$$G$$generics$collections$$TPair$System$Longint$System$Boolean$.$init.call(this);
        this.FIter = null;
        this.FVal = null;
      };
      this.$final = function () {
        this.FIter = undefined;
        this.FVal = undefined;
        $mod.TEnumerator$$$G$$generics$collections$$TPair$System$Longint$System$Boolean$.$final.call(this);
      };
      this.GetCurrent = function () {
        var Result = $mod.TPair$$$G$$generics$collections$$Longint$$Boolean.$new();
        Result.$assign(this.DoGetCurrent());
        return Result;
      };
      this.DoGetCurrent = function () {
        var Result = $mod.TPair$$$G$$generics$collections$$Longint$$Boolean.$new();
        var A = [];
        A = this.FVal.value;
        Result.$assign($mod.TPair$$$G$$generics$collections$$Longint$$Boolean.$new());
        Result.Create(rtl.trunc(A[0]),!(A[1] == false));
        return Result;
      };
      this.DoMoveNext = function () {
        var Result = false;
        this.FVal = this.FIter.next();
        Result = !this.FVal.done;
        return Result;
      };
      this.Create$1 = function (ADictionary) {
        this.FIter = ADictionary.FMap.entries();
        return this;
      };
      this.MoveNext$1 = function () {
        var Result = false;
        Result = this.DoMoveNext();
        return Result;
      };
    },"TDictionary<System.Longint,System.Boolean>.TPairEnumerator");
    rtl.createClass(this,"TKeyEnumerator",$mod.TEnumerator$$$G$$generics$collections$$Longint,function () {
      this.$init = function () {
        $mod.TEnumerator$$$G$$generics$collections$$Longint.$init.call(this);
        this.FIter = null;
        this.FVal = null;
      };
      this.$final = function () {
        this.FIter = undefined;
        this.FVal = undefined;
        $mod.TEnumerator$$$G$$generics$collections$$Longint.$final.call(this);
      };
      this.GetCurrent = function () {
        var Result = 0;
        Result = this.DoGetCurrent();
        return Result;
      };
      this.DoGetCurrent = function () {
        var Result = 0;
        Result = rtl.trunc(this.FVal.value);
        return Result;
      };
      this.DoMoveNext = function () {
        var Result = false;
        this.FVal = this.FIter.next();
        Result = !this.FVal.done;
        return Result;
      };
      this.Create$1 = function (AIter) {
        this.FIter = AIter;
        return this;
      };
      this.Create$2 = function (ADictionary) {
        this.Create$1(ADictionary.FMap.keys());
        return this;
      };
      this.MoveNext$1 = function () {
        var Result = false;
        Result = this.DoMoveNext();
        return Result;
      };
    },"TDictionary<System.Longint,System.Boolean>.TKeyEnumerator");
    rtl.createClass(this,"TValueEnumerator",$mod.TEnumerator$$$G$$generics$collections$$Boolean,function () {
      this.$init = function () {
        $mod.TEnumerator$$$G$$generics$collections$$Boolean.$init.call(this);
        this.FIter = null;
        this.FVal = null;
      };
      this.$final = function () {
        this.FIter = undefined;
        this.FVal = undefined;
        $mod.TEnumerator$$$G$$generics$collections$$Boolean.$final.call(this);
      };
      this.GetCurrent = function () {
        var Result = false;
        Result = this.DoGetCurrent();
        return Result;
      };
      this.DoGetCurrent = function () {
        var Result = false;
        Result = !(this.FVal.value == false);
        return Result;
      };
      this.DoMoveNext = function () {
        var Result = false;
        this.FVal = this.FIter.next();
        Result = !this.FVal.done;
        return Result;
      };
      this.Create$1 = function (AIter) {
        this.FIter = AIter;
        return this;
      };
      this.Create$2 = function (ADictionary) {
        this.Create$1(ADictionary.FMap.values());
        return this;
      };
      this.MoveNext$1 = function () {
        var Result = false;
        Result = this.DoMoveNext();
        return Result;
      };
    },"TDictionary<System.Longint,System.Boolean>.TValueEnumerator");
    rtl.createClass(this,"TValueCollection",$mod.TEnumerable$$$G$$generics$collections$$Boolean,function () {
      this.$init = function () {
        $mod.TEnumerable$$$G$$generics$collections$$Boolean.$init.call(this);
        this.FMap = null;
      };
      this.$final = function () {
        this.FMap = undefined;
        $mod.TEnumerable$$$G$$generics$collections$$Boolean.$final.call(this);
      };
      this.GetCount = function () {
        var Result = 0;
        Result = this.FMap.size;
        return Result;
      };
      this.DoGetEnumerator = function () {
        var Result = null;
        Result = $mod.TDictionary$$$G$$generics$collections$$Longint$$Boolean.TValueEnumerator.$create("Create$1",[this.FMap.values()]);
        return Result;
      };
      this.Create$1 = function (ADictionary) {
        this.FMap = ADictionary.FMap;
        return this;
      };
      this.GetEnumerator$1 = function () {
        var Result = null;
        Result = this.DoGetEnumerator();
        return Result;
      };
      this.ToArray = function () {
        var Result = [];
        var I = 0;
        var P = false;
        Result = rtl.arraySetLength(Result,false,this.FMap.size);
        var $in = this.GetEnumerator$1();
        try {
          while ($in.MoveNext$1()) {
            P = $in.GetCurrent();
            Result[I] = P;
            I += 1;
          }
        } finally {
          $in = rtl.freeLoc($in)
        };
        return Result;
      };
    },"TDictionary<System.Longint,System.Boolean>.TValueCollection");
    rtl.createClass(this,"TKeyCollection",$mod.TEnumerable$$$G$$generics$collections$$Longint,function () {
      this.$init = function () {
        $mod.TEnumerable$$$G$$generics$collections$$Longint.$init.call(this);
        this.FMap = null;
      };
      this.$final = function () {
        this.FMap = undefined;
        $mod.TEnumerable$$$G$$generics$collections$$Longint.$final.call(this);
      };
      this.GetCount = function () {
        var Result = 0;
        Result = this.FMap.size;
        return Result;
      };
      this.DoGetEnumerator = function () {
        var Result = null;
        Result = this.GetEnumerator$1();
        return Result;
      };
      this.Create$1 = function (ADictionary) {
        this.FMap = ADictionary.FMap;
        return this;
      };
      this.GetEnumerator$1 = function () {
        var Result = null;
        Result = $mod.TDictionary$$$G$$generics$collections$$Longint$$Boolean.TKeyEnumerator.$create("Create$1",[this.FMap.keys()]);
        return Result;
      };
      this.ToArray = function () {
        var Result = [];
        Result = $mod.TEnumerable$$$G$$generics$collections$$Longint.ToArray.call(this);
        return Result;
      };
    },"TDictionary<System.Longint,System.Boolean>.TKeyCollection");
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$System$Boolean$.$init.call(this);
      this.FMap = null;
      this.FComparer = null;
      this.FOnKeyNotify = null;
      this.FOnValueNotify = null;
      this.FKeyCollection = null;
      this.FValueCollection = null;
    };
    this.$final = function () {
      this.FMap = undefined;
      rtl.setIntfP(this,"FComparer",null);
      this.FOnKeyNotify = undefined;
      this.FOnValueNotify = undefined;
      this.FKeyCollection = undefined;
      this.FValueCollection = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$System$Boolean$.$final.call(this);
    };
    this.GetEffectiveKey = function (Key) {
      var Result = 0;
      var it = null;
      var v = null;
      if (!(this.FComparer != null)) return Key;
      it = this.FMap.keys();
      v = it.next();
      while (!v.done) {
        Result = rtl.trunc(v.value);
        if (this.FComparer.Compare(Result,Key) === 0) return Result;
        v = it.next();
      };
      Result = Key;
      return Result;
    };
    this.GetItem = function (Key) {
      var Result = false;
      var V = undefined;
      V = this.FMap.get(this.GetEffectiveKey(Key));
      if (pas.JS.isUndefined(V)) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictKeyNotFound")]);
      Result = !(V == false);
      return Result;
    };
    this.SetItem = function (Key, Value) {
      var V = undefined;
      V = this.FMap.get(this.GetEffectiveKey(Key));
      if (!pas.JS.isUndefined(V)) this.ValueNotify(!(V == false),$mod.TCollectionNotification.cnRemoved);
      this.FMap.set(Key,Value);
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoAdd = function (Key, Value) {
      this.FMap.set(this.GetEffectiveKey(Key),Value);
      this.KeyNotify(Key,$mod.TCollectionNotification.cnAdded);
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoRemove = function (Key, Notification) {
      var Result = false;
      var V = undefined;
      var K = 0;
      K = this.GetEffectiveKey(Key);
      V = this.FMap.get(K);
      if (!pas.JS.isUndefined(V)) {
        this.FMap.delete(K);
        Result = !(V == false);
        this.KeyNotify(Key,Notification);
        this.ValueNotify(Result,Notification);
      };
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FMap.size;
      return Result;
    };
    this.CanClearMap = function () {
      var Result = false;
      Result = (this.FOnKeyNotify === null) && (this.FOnValueNotify === null);
      return Result;
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.PairNotify = function (Key, Value, Action) {
      this.KeyNotify(Key,Action);
      this.ValueNotify(Value,Action);
    };
    this.KeyNotify = function (Key, Action) {
      if (this.FOnKeyNotify != null) this.FOnKeyNotify(this,Key,Action);
    };
    this.ValueNotify = function (Value, Action) {
      if (this.FOnValueNotify != null) this.FOnValueNotify(this,Value,Action);
    };
    this.Create$1 = function (ACapacity) {
      this.FMap = new Map();
      if (ACapacity > 0) ;
      return this;
    };
    this.Create$2 = function (Collection) {
      var aPair = $mod.TPair$$$G$$generics$collections$$Longint$$Boolean.$new();
      this.Create$1(0);
      var $in = Collection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          aPair = $in.DoGetCurrent();
          this.Add(aPair.Key,aPair.Value);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Create$3 = function (AComparer) {
      this.Create$1(0);
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FKeyCollection;
        }, set: function (v) {
          this.p.FKeyCollection = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FValueCollection;
        }, set: function (v) {
          this.p.FValueCollection = v;
        }});
      this.Clear();
      this.FMap = null;
      pas.System.TObject.Destroy.call(this);
    };
    this.Add = function (Key, Value) {
      if (this.FMap.has(this.GetEffectiveKey(Key))) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictDuplicateKey")]);
      this.DoAdd(Key,Value);
    };
    this.Remove = function (Key) {
      this.DoRemove(Key,$mod.TCollectionNotification.cnRemoved);
    };
    this.ExtractPair = function (Key) {
      var Result = $mod.TPair$$$G$$generics$collections$$Longint$$Boolean.$new();
      var K = 0;
      Result.$assign($mod.TPair$$$G$$generics$collections$$Longint$$Boolean.$new());
      K = this.GetEffectiveKey(Key);
      if (this.FMap.has(K)) {
        Result.Create(Key,!(this.FMap.get(K) == false));
        this.FMap.delete(K);
      } else Result.Create(Key,false);
      return Result;
    };
    this.Clear = function () {
      var Iter = null;
      var IVal = null;
      var A = [];
      var K = 0;
      var V = false;
      if (this.CanClearMap()) {
        this.FMap.clear()}
       else {
        Iter = this.FMap.entries();
        do {
          IVal = Iter.next();
          if (!IVal.done) {
            A = IVal.value;
            K = rtl.trunc(A[0]);
            V = !(A[1] == false);
            this.FMap.delete(K);
            this.PairNotify(K,V,$mod.TCollectionNotification.cnRemoved);
          };
        } while (!IVal.done);
      };
    };
    this.TryGetValue = function (Key, Value) {
      var Result = false;
      var K = 0;
      K = this.GetEffectiveKey(Key);
      Result = this.FMap.has(K);
      if (Result) Value.set(!(this.FMap.get(K) == false));
      return Result;
    };
    this.AddOrSetValue = function (Key, Value) {
      var k = 0;
      k = this.GetEffectiveKey(Key);
      if (!this.FMap.has(k)) {
        this.DoAdd(Key,Value)}
       else this.SetItem(k,Value);
    };
    this.ContainsKey = function (Key) {
      var Result = false;
      Result = this.FMap.has(this.GetEffectiveKey(Key));
      return Result;
    };
    this.ContainsValue = function (Value) {
      var Result = false;
      var It = null;
      var Res = null;
      Result = false;
      It = this.FMap.values();
      do {
        Res = It.next();
        if (!Res.done) Result = Value === !(Res.value == false);
      } while (!(Result || Res.done));
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      Result = $mod.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$System$Boolean$.ToArray.call(this);
      return Result;
    };
    this.GetKeys = function () {
      var Result = null;
      if (this.FKeyCollection === null) this.FKeyCollection = this.TKeyCollection.$create("Create$1",[this]);
      Result = this.FKeyCollection;
      return Result;
    };
    this.GetValues = function () {
      var Result = null;
      if (this.FValueCollection === null) this.FValueCollection = this.TValueCollection.$create("Create$1",[this]);
      Result = this.FValueCollection;
      return Result;
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
  },"TDictionary<System.Longint,System.Boolean>");
  rtl.recNewT(this,"TPair$$$G$$generics$collections$$Longint$$Double",function () {
    this.Key = 0;
    this.Value = 0.0;
    this.$eq = function (b) {
      return (this.Key === b.Key) && (this.Value === b.Value);
    };
    this.$assign = function (s) {
      this.Key = s.Key;
      this.Value = s.Value;
      return this;
    };
    this.Create = function (AKey, AValue) {
      this.Key = AKey;
      this.Value = AValue;
      return this;
    };
    var $r = $mod.$rtti.$Record("TPair<System.Longint,System.Double>",{},this);
    $r.addField("Key",rtl.longint);
    $r.addField("Value",rtl.double);
    $r.addMethod("Create",2,[["AKey",rtl.longint,2],["AValue",rtl.double,2]]);
  });
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TPair$System$Longint$System$Double$",pas.System.TObject,function () {
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<Generics.Collections.TPair<System.Longint,System.Double>>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TPair$System$Longint$System$Double$",pas.System.TObject,function () {
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push($mod.TPair$$$G$$generics$collections$$Longint$$Double.$clone(LEnumerator.DoGetCurrent()));
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<Generics.Collections.TPair<System.Longint,System.Double>>");
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$Double",pas.System.TObject,function () {
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<System.Double>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$Double",pas.System.TObject,function () {
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push(LEnumerator.DoGetCurrent());
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<System.Double>");
  this.$rtti.$MethodVar("TCollectionNotifyEvent<System.Double>",{procsig: rtl.newTIProcSig([["ASender",pas.System.$rtti["TObject"]],["AItem",rtl.double,2],["AAction",this.$rtti["TCollectionNotification"]]]), methodkind: 0});
  rtl.createClass(this,"TDictionary$$$G$$generics$collections$$Longint$$Double",this.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$System$Double$,function () {
    rtl.createClass(this,"TPairEnumerator",$mod.TEnumerator$$$G$$generics$collections$$TPair$System$Longint$System$Double$,function () {
      this.$init = function () {
        $mod.TEnumerator$$$G$$generics$collections$$TPair$System$Longint$System$Double$.$init.call(this);
        this.FIter = null;
        this.FVal = null;
      };
      this.$final = function () {
        this.FIter = undefined;
        this.FVal = undefined;
        $mod.TEnumerator$$$G$$generics$collections$$TPair$System$Longint$System$Double$.$final.call(this);
      };
      this.GetCurrent = function () {
        var Result = $mod.TPair$$$G$$generics$collections$$Longint$$Double.$new();
        Result.$assign(this.DoGetCurrent());
        return Result;
      };
      this.DoGetCurrent = function () {
        var Result = $mod.TPair$$$G$$generics$collections$$Longint$$Double.$new();
        var A = [];
        A = this.FVal.value;
        Result.$assign($mod.TPair$$$G$$generics$collections$$Longint$$Double.$new());
        Result.Create(rtl.trunc(A[0]),rtl.getNumber(A[1]));
        return Result;
      };
      this.DoMoveNext = function () {
        var Result = false;
        this.FVal = this.FIter.next();
        Result = !this.FVal.done;
        return Result;
      };
      this.Create$1 = function (ADictionary) {
        this.FIter = ADictionary.FMap.entries();
        return this;
      };
      this.MoveNext$1 = function () {
        var Result = false;
        Result = this.DoMoveNext();
        return Result;
      };
    },"TDictionary<System.Longint,System.Double>.TPairEnumerator");
    rtl.createClass(this,"TKeyEnumerator",$mod.TEnumerator$$$G$$generics$collections$$Longint,function () {
      this.$init = function () {
        $mod.TEnumerator$$$G$$generics$collections$$Longint.$init.call(this);
        this.FIter = null;
        this.FVal = null;
      };
      this.$final = function () {
        this.FIter = undefined;
        this.FVal = undefined;
        $mod.TEnumerator$$$G$$generics$collections$$Longint.$final.call(this);
      };
      this.GetCurrent = function () {
        var Result = 0;
        Result = this.DoGetCurrent();
        return Result;
      };
      this.DoGetCurrent = function () {
        var Result = 0;
        Result = rtl.trunc(this.FVal.value);
        return Result;
      };
      this.DoMoveNext = function () {
        var Result = false;
        this.FVal = this.FIter.next();
        Result = !this.FVal.done;
        return Result;
      };
      this.Create$1 = function (AIter) {
        this.FIter = AIter;
        return this;
      };
      this.Create$2 = function (ADictionary) {
        this.Create$1(ADictionary.FMap.keys());
        return this;
      };
      this.MoveNext$1 = function () {
        var Result = false;
        Result = this.DoMoveNext();
        return Result;
      };
    },"TDictionary<System.Longint,System.Double>.TKeyEnumerator");
    rtl.createClass(this,"TValueEnumerator",$mod.TEnumerator$$$G$$generics$collections$$Double,function () {
      this.$init = function () {
        $mod.TEnumerator$$$G$$generics$collections$$Double.$init.call(this);
        this.FIter = null;
        this.FVal = null;
      };
      this.$final = function () {
        this.FIter = undefined;
        this.FVal = undefined;
        $mod.TEnumerator$$$G$$generics$collections$$Double.$final.call(this);
      };
      this.GetCurrent = function () {
        var Result = 0.0;
        Result = this.DoGetCurrent();
        return Result;
      };
      this.DoGetCurrent = function () {
        var Result = 0.0;
        Result = rtl.getNumber(this.FVal.value);
        return Result;
      };
      this.DoMoveNext = function () {
        var Result = false;
        this.FVal = this.FIter.next();
        Result = !this.FVal.done;
        return Result;
      };
      this.Create$1 = function (AIter) {
        this.FIter = AIter;
        return this;
      };
      this.Create$2 = function (ADictionary) {
        this.Create$1(ADictionary.FMap.values());
        return this;
      };
      this.MoveNext$1 = function () {
        var Result = false;
        Result = this.DoMoveNext();
        return Result;
      };
    },"TDictionary<System.Longint,System.Double>.TValueEnumerator");
    rtl.createClass(this,"TValueCollection",$mod.TEnumerable$$$G$$generics$collections$$Double,function () {
      this.$init = function () {
        $mod.TEnumerable$$$G$$generics$collections$$Double.$init.call(this);
        this.FMap = null;
      };
      this.$final = function () {
        this.FMap = undefined;
        $mod.TEnumerable$$$G$$generics$collections$$Double.$final.call(this);
      };
      this.GetCount = function () {
        var Result = 0;
        Result = this.FMap.size;
        return Result;
      };
      this.DoGetEnumerator = function () {
        var Result = null;
        Result = $mod.TDictionary$$$G$$generics$collections$$Longint$$Double.TValueEnumerator.$create("Create$1",[this.FMap.values()]);
        return Result;
      };
      this.Create$1 = function (ADictionary) {
        this.FMap = ADictionary.FMap;
        return this;
      };
      this.GetEnumerator$1 = function () {
        var Result = null;
        Result = this.DoGetEnumerator();
        return Result;
      };
      this.ToArray = function () {
        var Result = [];
        var I = 0;
        var P = 0.0;
        Result = rtl.arraySetLength(Result,0.0,this.FMap.size);
        var $in = this.GetEnumerator$1();
        try {
          while ($in.MoveNext$1()) {
            P = $in.GetCurrent();
            Result[I] = P;
            I += 1;
          }
        } finally {
          $in = rtl.freeLoc($in)
        };
        return Result;
      };
    },"TDictionary<System.Longint,System.Double>.TValueCollection");
    rtl.createClass(this,"TKeyCollection",$mod.TEnumerable$$$G$$generics$collections$$Longint,function () {
      this.$init = function () {
        $mod.TEnumerable$$$G$$generics$collections$$Longint.$init.call(this);
        this.FMap = null;
      };
      this.$final = function () {
        this.FMap = undefined;
        $mod.TEnumerable$$$G$$generics$collections$$Longint.$final.call(this);
      };
      this.GetCount = function () {
        var Result = 0;
        Result = this.FMap.size;
        return Result;
      };
      this.DoGetEnumerator = function () {
        var Result = null;
        Result = this.GetEnumerator$1();
        return Result;
      };
      this.Create$1 = function (ADictionary) {
        this.FMap = ADictionary.FMap;
        return this;
      };
      this.GetEnumerator$1 = function () {
        var Result = null;
        Result = $mod.TDictionary$$$G$$generics$collections$$Longint$$Double.TKeyEnumerator.$create("Create$1",[this.FMap.keys()]);
        return Result;
      };
      this.ToArray = function () {
        var Result = [];
        Result = $mod.TEnumerable$$$G$$generics$collections$$Longint.ToArray.call(this);
        return Result;
      };
    },"TDictionary<System.Longint,System.Double>.TKeyCollection");
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$System$Double$.$init.call(this);
      this.FMap = null;
      this.FComparer = null;
      this.FOnKeyNotify = null;
      this.FOnValueNotify = null;
      this.FKeyCollection = null;
      this.FValueCollection = null;
    };
    this.$final = function () {
      this.FMap = undefined;
      rtl.setIntfP(this,"FComparer",null);
      this.FOnKeyNotify = undefined;
      this.FOnValueNotify = undefined;
      this.FKeyCollection = undefined;
      this.FValueCollection = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$System$Double$.$final.call(this);
    };
    this.GetEffectiveKey = function (Key) {
      var Result = 0;
      var it = null;
      var v = null;
      if (!(this.FComparer != null)) return Key;
      it = this.FMap.keys();
      v = it.next();
      while (!v.done) {
        Result = rtl.trunc(v.value);
        if (this.FComparer.Compare(Result,Key) === 0) return Result;
        v = it.next();
      };
      Result = Key;
      return Result;
    };
    this.GetItem = function (Key) {
      var Result = 0.0;
      var V = undefined;
      V = this.FMap.get(this.GetEffectiveKey(Key));
      if (pas.JS.isUndefined(V)) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictKeyNotFound")]);
      Result = rtl.getNumber(V);
      return Result;
    };
    this.SetItem = function (Key, Value) {
      var V = undefined;
      V = this.FMap.get(this.GetEffectiveKey(Key));
      if (!pas.JS.isUndefined(V)) this.ValueNotify(rtl.getNumber(V),$mod.TCollectionNotification.cnRemoved);
      this.FMap.set(Key,Value);
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoAdd = function (Key, Value) {
      this.FMap.set(this.GetEffectiveKey(Key),Value);
      this.KeyNotify(Key,$mod.TCollectionNotification.cnAdded);
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoRemove = function (Key, Notification) {
      var Result = 0.0;
      var V = undefined;
      var K = 0;
      K = this.GetEffectiveKey(Key);
      V = this.FMap.get(K);
      if (!pas.JS.isUndefined(V)) {
        this.FMap.delete(K);
        Result = rtl.getNumber(V);
        this.KeyNotify(Key,Notification);
        this.ValueNotify(Result,Notification);
      };
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FMap.size;
      return Result;
    };
    this.CanClearMap = function () {
      var Result = false;
      Result = (this.FOnKeyNotify === null) && (this.FOnValueNotify === null);
      return Result;
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.PairNotify = function (Key, Value, Action) {
      this.KeyNotify(Key,Action);
      this.ValueNotify(Value,Action);
    };
    this.KeyNotify = function (Key, Action) {
      if (this.FOnKeyNotify != null) this.FOnKeyNotify(this,Key,Action);
    };
    this.ValueNotify = function (Value, Action) {
      if (this.FOnValueNotify != null) this.FOnValueNotify(this,Value,Action);
    };
    this.Create$1 = function (ACapacity) {
      this.FMap = new Map();
      if (ACapacity > 0) ;
      return this;
    };
    this.Create$2 = function (Collection) {
      var aPair = $mod.TPair$$$G$$generics$collections$$Longint$$Double.$new();
      this.Create$1(0);
      var $in = Collection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          aPair = $in.DoGetCurrent();
          this.Add(aPair.Key,aPair.Value);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Create$3 = function (AComparer) {
      this.Create$1(0);
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FKeyCollection;
        }, set: function (v) {
          this.p.FKeyCollection = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FValueCollection;
        }, set: function (v) {
          this.p.FValueCollection = v;
        }});
      this.Clear();
      this.FMap = null;
      pas.System.TObject.Destroy.call(this);
    };
    this.Add = function (Key, Value) {
      if (this.FMap.has(this.GetEffectiveKey(Key))) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictDuplicateKey")]);
      this.DoAdd(Key,Value);
    };
    this.Remove = function (Key) {
      this.DoRemove(Key,$mod.TCollectionNotification.cnRemoved);
    };
    this.ExtractPair = function (Key) {
      var Result = $mod.TPair$$$G$$generics$collections$$Longint$$Double.$new();
      var K = 0;
      Result.$assign($mod.TPair$$$G$$generics$collections$$Longint$$Double.$new());
      K = this.GetEffectiveKey(Key);
      if (this.FMap.has(K)) {
        Result.Create(Key,rtl.getNumber(this.FMap.get(K)));
        this.FMap.delete(K);
      } else Result.Create(Key,0.0);
      return Result;
    };
    this.Clear = function () {
      var Iter = null;
      var IVal = null;
      var A = [];
      var K = 0;
      var V = 0.0;
      if (this.CanClearMap()) {
        this.FMap.clear()}
       else {
        Iter = this.FMap.entries();
        do {
          IVal = Iter.next();
          if (!IVal.done) {
            A = IVal.value;
            K = rtl.trunc(A[0]);
            V = rtl.getNumber(A[1]);
            this.FMap.delete(K);
            this.PairNotify(K,V,$mod.TCollectionNotification.cnRemoved);
          };
        } while (!IVal.done);
      };
    };
    this.TryGetValue = function (Key, Value) {
      var Result = false;
      var K = 0;
      K = this.GetEffectiveKey(Key);
      Result = this.FMap.has(K);
      if (Result) Value.set(rtl.getNumber(this.FMap.get(K)));
      return Result;
    };
    this.AddOrSetValue = function (Key, Value) {
      var k = 0;
      k = this.GetEffectiveKey(Key);
      if (!this.FMap.has(k)) {
        this.DoAdd(Key,Value)}
       else this.SetItem(k,Value);
    };
    this.ContainsKey = function (Key) {
      var Result = false;
      Result = this.FMap.has(this.GetEffectiveKey(Key));
      return Result;
    };
    this.ContainsValue = function (Value) {
      var Result = false;
      var It = null;
      var Res = null;
      Result = false;
      It = this.FMap.values();
      do {
        Res = It.next();
        if (!Res.done) Result = Value === rtl.getNumber(Res.value);
      } while (!(Result || Res.done));
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      Result = $mod.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$System$Double$.ToArray.call(this);
      return Result;
    };
    this.GetKeys = function () {
      var Result = null;
      if (this.FKeyCollection === null) this.FKeyCollection = this.TKeyCollection.$create("Create$1",[this]);
      Result = this.FKeyCollection;
      return Result;
    };
    this.GetValues = function () {
      var Result = null;
      if (this.FValueCollection === null) this.FValueCollection = this.TValueCollection.$create("Create$1",[this]);
      Result = this.FValueCollection;
      return Result;
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
  },"TDictionary<System.Longint,System.Double>");
  rtl.createClass(this,"TCustomArrayHelper$$$G$$generics$collections$$TObject",pas.System.TObject,function () {
    this.Sort = function (AValues, AComparer) {
      this.Sort$1(AValues,AComparer,0,rtl.length(AValues.get()));
    };
    this.Sort$1 = function (AValues, AComparer, AIndex, ACount) {
      if (ACount <= 1) return;
      this.QuickSort(AValues,AIndex,(AIndex + ACount) - 1,AComparer);
    };
    this.BinarySearch$2 = function (AValues, AItem, AFoundIndex, AComparer) {
      var Result = false;
      Result = this.BinarySearch$1(AValues,AItem,AFoundIndex,AComparer,0,rtl.length(AValues));
      return Result;
    };
    this.BinarySearch$3 = function (AValues, AItem, ASearchResult, AComparer) {
      var Result = false;
      Result = this.BinarySearch(AValues,AItem,ASearchResult,AComparer,0,rtl.length(AValues));
      return Result;
    };
  },"TCustomArrayHelper<System.TObject>");
  rtl.createClass(this,"TArrayHelper$$$G$$generics$collections$$TObject",this.TCustomArrayHelper$$$G$$generics$collections$$TObject,function () {
    this.QuickSort = function (AValues, ALeft, ARight, AComparer) {
      var I = 0;
      var J = 0;
      var P = null;
      var Q = null;
      if (((ARight - ALeft) <= 0) || (rtl.length(AValues.get()) === 0)) return;
      do {
        I = ALeft;
        J = ARight;
        P = AValues.get()[ALeft + Math.floor((ARight - ALeft) / 2)];
        do {
          while (AComparer.Compare(AValues.get()[I],P) < 0) I += 1;
          while (AComparer.Compare(AValues.get()[J],P) > 0) J -= 1;
          if (I <= J) {
            if (I !== J) {
              Q = AValues.get()[I];
              AValues.get()[I] = AValues.get()[J];
              AValues.get()[J] = Q;
            };
            I += 1;
            J -= 1;
          };
        } while (!(I > J));
        if ((J - ALeft) < (ARight - I)) {
          if (ALeft < J) this.QuickSort(AValues,ALeft,J,AComparer);
          ALeft = I;
        } else {
          if (I < ARight) this.QuickSort(AValues,I,ARight,AComparer);
          ARight = J;
        };
      } while (!(ALeft >= ARight));
    };
    this.BinarySearch = function (AValues, AItem, ASearchResult, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var ilo = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      ilo = imid * imid;
      imid = ilo * imid;
      while (imin < imax) {
        imid = rtl.trunc((imax + imin) / 2);
        ASearchResult.CompareResult = AComparer.Compare(AValues[imid],AItem);
        if (ASearchResult.CompareResult < 0) {
          imin = imid + 1}
         else {
          if (ASearchResult.CompareResult === 0) {
            ASearchResult.FoundIndex = imid;
            ASearchResult.CandidateIndex = imid;
            return true;
          };
          imax = imid;
        };
      };
      Result = imax === imin;
      if (Result) {
        ASearchResult.CompareResult = AComparer.Compare(AValues[imin],AItem);
        ASearchResult.CandidateIndex = imin;
        Result = ASearchResult.CompareResult === 0;
        if (Result) {
          ASearchResult.FoundIndex = imin}
         else ASearchResult.FoundIndex = -1;
      } else {
        ASearchResult.CompareResult = 0;
        ASearchResult.FoundIndex = -1;
        ASearchResult.CandidateIndex = -1;
      };
      return Result;
    };
    this.BinarySearch$1 = function (AValues, AItem, AFoundIndex, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var LCompare = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      while (imin < imax) {
        imid = rtl.trunc((imin + imax) / 2);
        LCompare = AComparer.Compare(AValues[imid],AItem);
        if (LCompare < 0) {
          imin = imid + 1}
         else {
          if (LCompare === 0) {
            AFoundIndex.set(imid);
            return true;
          };
          imax = imid;
        };
      };
      LCompare = AComparer.Compare(AValues[imin],AItem);
      Result = (imax === imin) && (LCompare === 0);
      if (Result) {
        AFoundIndex.set(imin)}
       else AFoundIndex.set(-1);
      return Result;
    };
  },"TArrayHelper<System.TObject>");
  rtl.createClass(this,"TCustomList$$$G$$generics$collections$$TObject",this.TEnumerable$$$G$$generics$collections$$TObject,function () {
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$TObject.$init.call(this);
      this.FOnNotify = null;
      this.FLength = 0;
      this.FItems = [];
    };
    this.$final = function () {
      this.FOnNotify = undefined;
      this.FItems = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$TObject.$final.call(this);
    };
    this.GetCapacity = function () {
      var Result = 0;
      Result = rtl.length(this.FItems);
      return Result;
    };
    this.PrepareAddingItem = function () {
      var Result = 0;
      if (this.FLength === rtl.length(this.FItems)) this.FItems.push(null);
      Result = this.FLength;
      this.FLength += 1;
      return Result;
    };
    this.PrepareAddingRange = function (ACount) {
      var Result = 0;
      var l = 0;
      if (ACount < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (ACount === 0) return this.FLength - 1;
      for (var $l = rtl.length(this.FItems) + 1, $end = this.FLength + ACount; $l <= $end; $l++) {
        l = $l;
        this.FItems.push(null);
      };
      Result = this.FLength;
      this.FLength += ACount;
      return Result;
    };
    this.Notify = function (AValue, ACollectionNotification) {
      if (this.FOnNotify != null) this.FOnNotify(this,AValue,ACollectionNotification);
    };
    this.DoRemove = function (AIndex, ACollectionNotification) {
      var Result = null;
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      this.FLength -= 1;
      this.FItems[AIndex] = null;
      this.FItems.splice(AIndex,1);
      this.Notify(Result,ACollectionNotification);
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FLength;
      return Result;
    };
    var $r = this.$rtti;
    $mod.$rtti.$DynArray("TCustomList<System.TObject>.FItems$a",{eltype: pas.System.$rtti["TObject"]});
  },"TCustomList<System.TObject>");
  rtl.createClass(this,"TCustomListEnumerator$$$G$$generics$collections$$TObject",this.TEnumerator$$$G$$generics$collections$$TObject,function () {
    this.$init = function () {
      $mod.TEnumerator$$$G$$generics$collections$$TObject.$init.call(this);
      this.FList = null;
      this.FIndex = 0;
    };
    this.$final = function () {
      this.FList = undefined;
      $mod.TEnumerator$$$G$$generics$collections$$TObject.$final.call(this);
    };
    this.DoMoveNext = function () {
      var Result = false;
      this.FIndex += 1;
      Result = (this.FList.FLength > 0) && (this.FIndex < this.FList.FLength);
      return Result;
    };
    this.DoGetCurrent = function () {
      var Result = null;
      Result = this.GetCurrent();
      return Result;
    };
    this.GetCurrent = function () {
      var Result = null;
      Result = this.FList.FItems[this.FIndex];
      return Result;
    };
    this.Create$1 = function (AList) {
      pas.System.TObject.Create.call(this);
      this.FIndex = -1;
      this.FList = AList;
      return this;
    };
  },"TCustomListEnumerator<System.TObject>");
  rtl.createClass(this,"TList$$$G$$generics$collections$$TObject",this.TCustomList$$$G$$generics$collections$$TObject,function () {
    rtl.createClass(this,"TEnumerator",$mod.TCustomListEnumerator$$$G$$generics$collections$$TObject,function () {
    },"TList<System.TObject>.TEnumerator");
    this.$init = function () {
      $mod.TCustomList$$$G$$generics$collections$$TObject.$init.call(this);
      this.FComparer = null;
    };
    this.$final = function () {
      rtl.setIntfP(this,"FComparer",null);
      $mod.TCustomList$$$G$$generics$collections$$TObject.$final.call(this);
    };
    this.SameValue = function (Left, Right) {
      var Result = false;
      if (this.FComparer != null) {
        Result = this.FComparer.Compare(Left,Right) === 0}
       else Result = Left === Right;
      return Result;
    };
    this.SetCapacity = function (AValue) {
      if (AValue < this.FLength) this.SetCount(AValue);
      this.FItems = rtl.arraySetLength(this.FItems,null,AValue);
    };
    this.SetCount = function (AValue) {
      if (AValue < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (AValue > this.GetCapacity()) {
        this.SetCapacity(AValue)}
       else if (AValue < this.FLength) this.DeleteRange(AValue,this.FLength - AValue);
      this.FLength = AValue;
    };
    this.InitializeList = function () {
    };
    this.InternalInsert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.FItems.splice(AIndex,0,AValue);
      this.FLength += 1;
      this.FItems[AIndex] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.GetEnumerator$1();
      return Result;
    };
    this.GetItem = function (AIndex) {
      var Result = null;
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      return Result;
    };
    this.SetItem = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.Notify(this.FItems[AIndex],$mod.TCollectionNotification.cnRemoved);
      this.FItems[AIndex] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.Create$1 = function () {
      this.InitializeList();
      return this;
    };
    this.Create$2 = function (AComparer) {
      this.InitializeList();
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Create$3 = function (ACollection) {
      var LItem = null;
      this.Create$1();
      var $in = ACollection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LItem = $in.DoGetCurrent();
          this.Add(LItem);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Destroy = function () {
      this.SetCapacity(0);
    };
    this.Add = function (AValue) {
      var Result = 0;
      Result = this.PrepareAddingItem();
      this.FItems[Result] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
      return Result;
    };
    this.AddRange = function (AValues) {
      this.InsertRange(this.FLength,AValues);
    };
    this.AddRange$1 = function (AEnumerable) {
      var LValue = null;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.Add(LValue);
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.AddRange$2 = function (AEnumerable) {
      var LValue = null;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.Add(LValue);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Insert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.InternalInsert(AIndex,AValue);
    };
    this.InsertRange = function (AIndex, AValues) {
      var LLength = 0;
      var i = 0;
      var LValue = null;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LLength = rtl.length(AValues);
      if (LLength === 0) return;
      if (AIndex !== this.PrepareAddingRange(LLength)) {
        for (var $l = AIndex, $end = this.FLength - LLength - 1; $l <= $end; $l++) {
          i = $l;
          this.FItems[i + LLength] = this.FItems[i];
        };
        for (var $l1 = 0, $end1 = LLength - 1; $l1 <= $end1; $l1++) {
          i = $l1;
          this.FItems[AIndex + i] = null;
        };
      };
      for (var $l2 = 0, $end2 = LLength - 1; $l2 <= $end2; $l2++) {
        i = $l2;
        LValue = AValues[i];
        this.FItems[i + AIndex] = LValue;
        this.Notify(LValue,$mod.TCollectionNotification.cnAdded);
      };
    };
    this.InsertRange$1 = function (AIndex, AEnumerable) {
      var LValue = null;
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.InsertRange$2 = function (AIndex, AEnumerable) {
      var LValue = null;
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Remove = function (AValue) {
      var Result = 0;
      Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.RemoveItem = function (AValue, Direction) {
      var Result = 0;
      if (Direction === $mod.TDirection.fromEnd) {
        Result = this.LastIndexOf(AValue)}
       else Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.Delete = function (AIndex) {
      this.DoRemove(AIndex,$mod.TCollectionNotification.cnRemoved);
    };
    this.DeleteRange = function (AIndex, ACount) {
      var LDeleted = [];
      var i = 0;
      if (ACount === 0) return;
      if ((ACount < 0) || (AIndex < 0) || ((AIndex + ACount) > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LDeleted = this.FItems.splice(AIndex,this.FLength);
      this.FLength -= ACount;
      for (var $l = 0, $end = rtl.length(LDeleted) - 1; $l <= $end; $l++) {
        i = $l;
        this.Notify(LDeleted[i],$mod.TCollectionNotification.cnRemoved);
      };
    };
    this.ExtractIndex = function (AIndex) {
      var Result = null;
      Result = this.DoRemove(AIndex,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.Extract = function (AValue) {
      var Result = null;
      var LIndex = 0;
      LIndex = this.IndexOf(AValue);
      if (LIndex < 0) {
        Result = null}
       else Result = this.DoRemove(LIndex,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.Exchange = function (AIndex1, AIndex2) {
      var LTemp = null;
      LTemp = this.FItems[AIndex1];
      this.FItems[AIndex1] = this.FItems[AIndex2];
      this.FItems[AIndex2] = LTemp;
    };
    this.Move = function (AIndex, ANewIndex) {
      var Arr = null;
      var LTemp = undefined;
      var i = 0;
      if (ANewIndex === AIndex) return;
      if ((ANewIndex < 0) || (ANewIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Arr = this.FItems;
      LTemp = Arr[AIndex];
      if (AIndex < ANewIndex) {
        for (var $l = AIndex, $end = ANewIndex - 1; $l <= $end; $l++) {
          i = $l;
          Arr[i] = Arr[i + 1];
        }}
       else for (var $l1 = AIndex, $end1 = ANewIndex + 1; $l1 >= $end1; $l1--) {
        i = $l1;
        Arr[i] = Arr[i - 1];
      };
      Arr[ANewIndex] = LTemp;
    };
    this.First = function () {
      var Result = null;
      Result = this.GetItem(0);
      return Result;
    };
    this.Last = function () {
      var Result = null;
      Result = this.GetItem(this.FLength - 1);
      return Result;
    };
    this.Clear = function () {
      this.SetCount(0);
      this.SetCapacity(0);
    };
    this.Contains = function (AValue) {
      var Result = false;
      Result = this.IndexOf(AValue) >= 0;
      return Result;
    };
    this.IndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = 0, $end = this.FLength - 1; $l <= $end; $l++) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.LastIndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = this.FLength - 1; $l >= 0; $l--) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.Reverse = function () {
      var a = 0;
      var b = 0;
      var LTemp = null;
      a = 0;
      b = this.FLength - 1;
      while (a < b) {
        LTemp = this.FItems[a];
        this.FItems[a] = this.FItems[b];
        this.FItems[b] = LTemp;
        a += 1;
        b -= 1;
      };
    };
    this.TrimExcess = function () {
      this.SetCapacity(this.FLength);
    };
    this.Sort = function () {
      $mod.TArrayHelper$$$G$$generics$collections$$TObject.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},this.FComparer,0,this.FLength);
    };
    this.Sort$1 = function (AComparer) {
      $mod.TArrayHelper$$$G$$generics$collections$$TObject.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},AComparer,0,this.FLength);
    };
    this.BinarySearch = function (AItem, AIndex) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$TObject.BinarySearch$1(this.FItems,AItem,AIndex,this.FComparer,0,this.FLength);
      return Result;
    };
    this.BinarySearch$1 = function (AItem, AIndex, AComparer) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$TObject.BinarySearch$1(this.FItems,AItem,AIndex,AComparer,0,this.FLength);
      return Result;
    };
  },"TList<System.TObject>");
  rtl.createClass(this,"TObjectList$$$G$$generics$collections$$TObject",this.TList$$$G$$generics$collections$$TObject,function () {
    this.$init = function () {
      $mod.TList$$$G$$generics$collections$$TObject.$init.call(this);
      this.FObjectsOwner = false;
    };
    this.Notify = function (aValue, Action) {
      $mod.TCustomList$$$G$$generics$collections$$TObject.Notify.call(this,aValue,Action);
      if (this.FObjectsOwner && (Action === $mod.TCollectionNotification.cnRemoved)) aValue = rtl.freeLoc(aValue);
    };
    this.Create$4 = function (aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TObject.Create$1.call(this);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
    this.Create$5 = function (AComparer, aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TObject.Create$2.call(this,AComparer);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
    this.Create$6 = function (aCollection, aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TObject.Create$3.call(this,aCollection);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
  },"TObjectList<System.TObject>");
  rtl.createClass(this,"TCustomArrayHelper$$$G$$generics$collections$$Longint",pas.System.TObject,function () {
    this.Sort = function (AValues, AComparer) {
      this.Sort$1(AValues,AComparer,0,rtl.length(AValues.get()));
    };
    this.Sort$1 = function (AValues, AComparer, AIndex, ACount) {
      if (ACount <= 1) return;
      this.QuickSort(AValues,AIndex,(AIndex + ACount) - 1,AComparer);
    };
    this.BinarySearch$2 = function (AValues, AItem, AFoundIndex, AComparer) {
      var Result = false;
      Result = this.BinarySearch$1(AValues,AItem,AFoundIndex,AComparer,0,rtl.length(AValues));
      return Result;
    };
    this.BinarySearch$3 = function (AValues, AItem, ASearchResult, AComparer) {
      var Result = false;
      Result = this.BinarySearch(AValues,AItem,ASearchResult,AComparer,0,rtl.length(AValues));
      return Result;
    };
  },"TCustomArrayHelper<System.Longint>");
  rtl.createClass(this,"TArrayHelper$$$G$$generics$collections$$Longint",this.TCustomArrayHelper$$$G$$generics$collections$$Longint,function () {
    this.QuickSort = function (AValues, ALeft, ARight, AComparer) {
      var I = 0;
      var J = 0;
      var P = 0;
      var Q = 0;
      if (((ARight - ALeft) <= 0) || (rtl.length(AValues.get()) === 0)) return;
      do {
        I = ALeft;
        J = ARight;
        P = AValues.get()[ALeft + Math.floor((ARight - ALeft) / 2)];
        do {
          while (AComparer.Compare(AValues.get()[I],P) < 0) I += 1;
          while (AComparer.Compare(AValues.get()[J],P) > 0) J -= 1;
          if (I <= J) {
            if (I !== J) {
              Q = AValues.get()[I];
              AValues.get()[I] = AValues.get()[J];
              AValues.get()[J] = Q;
            };
            I += 1;
            J -= 1;
          };
        } while (!(I > J));
        if ((J - ALeft) < (ARight - I)) {
          if (ALeft < J) this.QuickSort(AValues,ALeft,J,AComparer);
          ALeft = I;
        } else {
          if (I < ARight) this.QuickSort(AValues,I,ARight,AComparer);
          ARight = J;
        };
      } while (!(ALeft >= ARight));
    };
    this.BinarySearch = function (AValues, AItem, ASearchResult, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var ilo = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      ilo = imid * imid;
      imid = ilo * imid;
      while (imin < imax) {
        imid = rtl.trunc((imax + imin) / 2);
        ASearchResult.CompareResult = AComparer.Compare(AValues[imid],AItem);
        if (ASearchResult.CompareResult < 0) {
          imin = imid + 1}
         else {
          if (ASearchResult.CompareResult === 0) {
            ASearchResult.FoundIndex = imid;
            ASearchResult.CandidateIndex = imid;
            return true;
          };
          imax = imid;
        };
      };
      Result = imax === imin;
      if (Result) {
        ASearchResult.CompareResult = AComparer.Compare(AValues[imin],AItem);
        ASearchResult.CandidateIndex = imin;
        Result = ASearchResult.CompareResult === 0;
        if (Result) {
          ASearchResult.FoundIndex = imin}
         else ASearchResult.FoundIndex = -1;
      } else {
        ASearchResult.CompareResult = 0;
        ASearchResult.FoundIndex = -1;
        ASearchResult.CandidateIndex = -1;
      };
      return Result;
    };
    this.BinarySearch$1 = function (AValues, AItem, AFoundIndex, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var LCompare = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      while (imin < imax) {
        imid = rtl.trunc((imin + imax) / 2);
        LCompare = AComparer.Compare(AValues[imid],AItem);
        if (LCompare < 0) {
          imin = imid + 1}
         else {
          if (LCompare === 0) {
            AFoundIndex.set(imid);
            return true;
          };
          imax = imid;
        };
      };
      LCompare = AComparer.Compare(AValues[imin],AItem);
      Result = (imax === imin) && (LCompare === 0);
      if (Result) {
        AFoundIndex.set(imin)}
       else AFoundIndex.set(-1);
      return Result;
    };
  },"TArrayHelper<System.Longint>");
  rtl.createClass(this,"TCustomList$$$G$$generics$collections$$Longint",this.TEnumerable$$$G$$generics$collections$$Longint,function () {
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$Longint.$init.call(this);
      this.FOnNotify = null;
      this.FLength = 0;
      this.FItems = [];
    };
    this.$final = function () {
      this.FOnNotify = undefined;
      this.FItems = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$Longint.$final.call(this);
    };
    this.GetCapacity = function () {
      var Result = 0;
      Result = rtl.length(this.FItems);
      return Result;
    };
    this.PrepareAddingItem = function () {
      var Result = 0;
      if (this.FLength === rtl.length(this.FItems)) this.FItems.push(-2147483648);
      Result = this.FLength;
      this.FLength += 1;
      return Result;
    };
    this.PrepareAddingRange = function (ACount) {
      var Result = 0;
      var l = 0;
      if (ACount < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (ACount === 0) return this.FLength - 1;
      for (var $l = rtl.length(this.FItems) + 1, $end = this.FLength + ACount; $l <= $end; $l++) {
        l = $l;
        this.FItems.push(-2147483648);
      };
      Result = this.FLength;
      this.FLength += ACount;
      return Result;
    };
    this.Notify = function (AValue, ACollectionNotification) {
      if (this.FOnNotify != null) this.FOnNotify(this,AValue,ACollectionNotification);
    };
    this.DoRemove = function (AIndex, ACollectionNotification) {
      var Result = 0;
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      this.FLength -= 1;
      this.FItems[AIndex] = -2147483648;
      this.FItems.splice(AIndex,1);
      this.Notify(Result,ACollectionNotification);
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FLength;
      return Result;
    };
    var $r = this.$rtti;
    $mod.$rtti.$DynArray("TCustomList<System.Longint>.FItems$a",{eltype: rtl.longint});
  },"TCustomList<System.Longint>");
  rtl.createClass(this,"TCustomListEnumerator$$$G$$generics$collections$$Longint",this.TEnumerator$$$G$$generics$collections$$Longint,function () {
    this.$init = function () {
      $mod.TEnumerator$$$G$$generics$collections$$Longint.$init.call(this);
      this.FList = null;
      this.FIndex = 0;
    };
    this.$final = function () {
      this.FList = undefined;
      $mod.TEnumerator$$$G$$generics$collections$$Longint.$final.call(this);
    };
    this.DoMoveNext = function () {
      var Result = false;
      this.FIndex += 1;
      Result = (this.FList.FLength > 0) && (this.FIndex < this.FList.FLength);
      return Result;
    };
    this.DoGetCurrent = function () {
      var Result = 0;
      Result = this.GetCurrent();
      return Result;
    };
    this.GetCurrent = function () {
      var Result = 0;
      Result = this.FList.FItems[this.FIndex];
      return Result;
    };
    this.Create$1 = function (AList) {
      pas.System.TObject.Create.call(this);
      this.FIndex = -1;
      this.FList = AList;
      return this;
    };
  },"TCustomListEnumerator<System.Longint>");
  rtl.createClass(this,"TList$$$G$$generics$collections$$Longint",this.TCustomList$$$G$$generics$collections$$Longint,function () {
    rtl.createClass(this,"TEnumerator",$mod.TCustomListEnumerator$$$G$$generics$collections$$Longint,function () {
    },"TList<System.Longint>.TEnumerator");
    this.$init = function () {
      $mod.TCustomList$$$G$$generics$collections$$Longint.$init.call(this);
      this.FComparer = null;
    };
    this.$final = function () {
      rtl.setIntfP(this,"FComparer",null);
      $mod.TCustomList$$$G$$generics$collections$$Longint.$final.call(this);
    };
    this.SameValue = function (Left, Right) {
      var Result = false;
      if (this.FComparer != null) {
        Result = this.FComparer.Compare(Left,Right) === 0}
       else Result = Left === Right;
      return Result;
    };
    this.SetCapacity = function (AValue) {
      if (AValue < this.FLength) this.SetCount(AValue);
      this.FItems = rtl.arraySetLength(this.FItems,0,AValue);
    };
    this.SetCount = function (AValue) {
      if (AValue < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (AValue > this.GetCapacity()) {
        this.SetCapacity(AValue)}
       else if (AValue < this.FLength) this.DeleteRange(AValue,this.FLength - AValue);
      this.FLength = AValue;
    };
    this.InitializeList = function () {
    };
    this.InternalInsert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.FItems.splice(AIndex,0,AValue);
      this.FLength += 1;
      this.FItems[AIndex] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.GetEnumerator$1();
      return Result;
    };
    this.GetItem = function (AIndex) {
      var Result = 0;
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      return Result;
    };
    this.SetItem = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.Notify(this.FItems[AIndex],$mod.TCollectionNotification.cnRemoved);
      this.FItems[AIndex] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.Create$1 = function () {
      this.InitializeList();
      return this;
    };
    this.Create$2 = function (AComparer) {
      this.InitializeList();
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Create$3 = function (ACollection) {
      var LItem = 0;
      this.Create$1();
      var $in = ACollection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LItem = $in.DoGetCurrent();
          this.Add(LItem);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Destroy = function () {
      this.SetCapacity(0);
    };
    this.Add = function (AValue) {
      var Result = 0;
      Result = this.PrepareAddingItem();
      this.FItems[Result] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
      return Result;
    };
    this.AddRange = function (AValues) {
      this.InsertRange(this.FLength,AValues);
    };
    this.AddRange$1 = function (AEnumerable) {
      var LValue = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.Add(LValue);
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.AddRange$2 = function (AEnumerable) {
      var LValue = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.Add(LValue);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Insert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.InternalInsert(AIndex,AValue);
    };
    this.InsertRange = function (AIndex, AValues) {
      var LLength = 0;
      var i = 0;
      var LValue = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LLength = rtl.length(AValues);
      if (LLength === 0) return;
      if (AIndex !== this.PrepareAddingRange(LLength)) {
        for (var $l = AIndex, $end = this.FLength - LLength - 1; $l <= $end; $l++) {
          i = $l;
          this.FItems[i + LLength] = this.FItems[i];
        };
        for (var $l1 = 0, $end1 = LLength - 1; $l1 <= $end1; $l1++) {
          i = $l1;
          this.FItems[AIndex + i] = -2147483648;
        };
      };
      for (var $l2 = 0, $end2 = LLength - 1; $l2 <= $end2; $l2++) {
        i = $l2;
        LValue = AValues[i];
        this.FItems[i + AIndex] = LValue;
        this.Notify(LValue,$mod.TCollectionNotification.cnAdded);
      };
    };
    this.InsertRange$1 = function (AIndex, AEnumerable) {
      var LValue = 0;
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.InsertRange$2 = function (AIndex, AEnumerable) {
      var LValue = 0;
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Remove = function (AValue) {
      var Result = 0;
      Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.RemoveItem = function (AValue, Direction) {
      var Result = 0;
      if (Direction === $mod.TDirection.fromEnd) {
        Result = this.LastIndexOf(AValue)}
       else Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.Delete = function (AIndex) {
      this.DoRemove(AIndex,$mod.TCollectionNotification.cnRemoved);
    };
    this.DeleteRange = function (AIndex, ACount) {
      var LDeleted = [];
      var i = 0;
      if (ACount === 0) return;
      if ((ACount < 0) || (AIndex < 0) || ((AIndex + ACount) > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LDeleted = this.FItems.splice(AIndex,this.FLength);
      this.FLength -= ACount;
      for (var $l = 0, $end = rtl.length(LDeleted) - 1; $l <= $end; $l++) {
        i = $l;
        this.Notify(LDeleted[i],$mod.TCollectionNotification.cnRemoved);
      };
    };
    this.ExtractIndex = function (AIndex) {
      var Result = 0;
      Result = this.DoRemove(AIndex,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.Extract = function (AValue) {
      var Result = 0;
      var LIndex = 0;
      LIndex = this.IndexOf(AValue);
      if (LIndex < 0) {
        Result = -2147483648}
       else Result = this.DoRemove(LIndex,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.Exchange = function (AIndex1, AIndex2) {
      var LTemp = 0;
      LTemp = this.FItems[AIndex1];
      this.FItems[AIndex1] = this.FItems[AIndex2];
      this.FItems[AIndex2] = LTemp;
    };
    this.Move = function (AIndex, ANewIndex) {
      var Arr = null;
      var LTemp = undefined;
      var i = 0;
      if (ANewIndex === AIndex) return;
      if ((ANewIndex < 0) || (ANewIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Arr = this.FItems;
      LTemp = Arr[AIndex];
      if (AIndex < ANewIndex) {
        for (var $l = AIndex, $end = ANewIndex - 1; $l <= $end; $l++) {
          i = $l;
          Arr[i] = Arr[i + 1];
        }}
       else for (var $l1 = AIndex, $end1 = ANewIndex + 1; $l1 >= $end1; $l1--) {
        i = $l1;
        Arr[i] = Arr[i - 1];
      };
      Arr[ANewIndex] = LTemp;
    };
    this.First = function () {
      var Result = 0;
      Result = this.GetItem(0);
      return Result;
    };
    this.Last = function () {
      var Result = 0;
      Result = this.GetItem(this.FLength - 1);
      return Result;
    };
    this.Clear = function () {
      this.SetCount(0);
      this.SetCapacity(0);
    };
    this.Contains = function (AValue) {
      var Result = false;
      Result = this.IndexOf(AValue) >= 0;
      return Result;
    };
    this.IndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = 0, $end = this.FLength - 1; $l <= $end; $l++) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.LastIndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = this.FLength - 1; $l >= 0; $l--) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.Reverse = function () {
      var a = 0;
      var b = 0;
      var LTemp = 0;
      a = 0;
      b = this.FLength - 1;
      while (a < b) {
        LTemp = this.FItems[a];
        this.FItems[a] = this.FItems[b];
        this.FItems[b] = LTemp;
        a += 1;
        b -= 1;
      };
    };
    this.TrimExcess = function () {
      this.SetCapacity(this.FLength);
    };
    this.Sort = function () {
      $mod.TArrayHelper$$$G$$generics$collections$$Longint.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},this.FComparer,0,this.FLength);
    };
    this.Sort$1 = function (AComparer) {
      $mod.TArrayHelper$$$G$$generics$collections$$Longint.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},AComparer,0,this.FLength);
    };
    this.BinarySearch = function (AItem, AIndex) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$Longint.BinarySearch$1(this.FItems,AItem,AIndex,this.FComparer,0,this.FLength);
      return Result;
    };
    this.BinarySearch$1 = function (AItem, AIndex, AComparer) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$Longint.BinarySearch$1(this.FItems,AItem,AIndex,AComparer,0,this.FLength);
      return Result;
    };
  },"TList<System.Longint>");
  rtl.createClass(this,"TCustomArrayHelper$$$G$$generics$collections$$Double",pas.System.TObject,function () {
    this.Sort = function (AValues, AComparer) {
      this.Sort$1(AValues,AComparer,0,rtl.length(AValues.get()));
    };
    this.Sort$1 = function (AValues, AComparer, AIndex, ACount) {
      if (ACount <= 1) return;
      this.QuickSort(AValues,AIndex,(AIndex + ACount) - 1,AComparer);
    };
    this.BinarySearch$2 = function (AValues, AItem, AFoundIndex, AComparer) {
      var Result = false;
      Result = this.BinarySearch$1(AValues,AItem,AFoundIndex,AComparer,0,rtl.length(AValues));
      return Result;
    };
    this.BinarySearch$3 = function (AValues, AItem, ASearchResult, AComparer) {
      var Result = false;
      Result = this.BinarySearch(AValues,AItem,ASearchResult,AComparer,0,rtl.length(AValues));
      return Result;
    };
  },"TCustomArrayHelper<System.Double>");
  rtl.createClass(this,"TArrayHelper$$$G$$generics$collections$$Double",this.TCustomArrayHelper$$$G$$generics$collections$$Double,function () {
    this.QuickSort = function (AValues, ALeft, ARight, AComparer) {
      var I = 0;
      var J = 0;
      var P = 0.0;
      var Q = 0.0;
      if (((ARight - ALeft) <= 0) || (rtl.length(AValues.get()) === 0)) return;
      do {
        I = ALeft;
        J = ARight;
        P = AValues.get()[ALeft + Math.floor((ARight - ALeft) / 2)];
        do {
          while (AComparer.Compare(AValues.get()[I],P) < 0) I += 1;
          while (AComparer.Compare(AValues.get()[J],P) > 0) J -= 1;
          if (I <= J) {
            if (I !== J) {
              Q = AValues.get()[I];
              AValues.get()[I] = AValues.get()[J];
              AValues.get()[J] = Q;
            };
            I += 1;
            J -= 1;
          };
        } while (!(I > J));
        if ((J - ALeft) < (ARight - I)) {
          if (ALeft < J) this.QuickSort(AValues,ALeft,J,AComparer);
          ALeft = I;
        } else {
          if (I < ARight) this.QuickSort(AValues,I,ARight,AComparer);
          ARight = J;
        };
      } while (!(ALeft >= ARight));
    };
    this.BinarySearch = function (AValues, AItem, ASearchResult, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var ilo = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      ilo = imid * imid;
      imid = ilo * imid;
      while (imin < imax) {
        imid = rtl.trunc((imax + imin) / 2);
        ASearchResult.CompareResult = AComparer.Compare(AValues[imid],AItem);
        if (ASearchResult.CompareResult < 0) {
          imin = imid + 1}
         else {
          if (ASearchResult.CompareResult === 0) {
            ASearchResult.FoundIndex = imid;
            ASearchResult.CandidateIndex = imid;
            return true;
          };
          imax = imid;
        };
      };
      Result = imax === imin;
      if (Result) {
        ASearchResult.CompareResult = AComparer.Compare(AValues[imin],AItem);
        ASearchResult.CandidateIndex = imin;
        Result = ASearchResult.CompareResult === 0;
        if (Result) {
          ASearchResult.FoundIndex = imin}
         else ASearchResult.FoundIndex = -1;
      } else {
        ASearchResult.CompareResult = 0;
        ASearchResult.FoundIndex = -1;
        ASearchResult.CandidateIndex = -1;
      };
      return Result;
    };
    this.BinarySearch$1 = function (AValues, AItem, AFoundIndex, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var LCompare = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      while (imin < imax) {
        imid = rtl.trunc((imin + imax) / 2);
        LCompare = AComparer.Compare(AValues[imid],AItem);
        if (LCompare < 0) {
          imin = imid + 1}
         else {
          if (LCompare === 0) {
            AFoundIndex.set(imid);
            return true;
          };
          imax = imid;
        };
      };
      LCompare = AComparer.Compare(AValues[imin],AItem);
      Result = (imax === imin) && (LCompare === 0);
      if (Result) {
        AFoundIndex.set(imin)}
       else AFoundIndex.set(-1);
      return Result;
    };
  },"TArrayHelper<System.Double>");
  rtl.createClass(this,"TCustomList$$$G$$generics$collections$$Double",this.TEnumerable$$$G$$generics$collections$$Double,function () {
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$Double.$init.call(this);
      this.FOnNotify = null;
      this.FLength = 0;
      this.FItems = [];
    };
    this.$final = function () {
      this.FOnNotify = undefined;
      this.FItems = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$Double.$final.call(this);
    };
    this.GetCapacity = function () {
      var Result = 0;
      Result = rtl.length(this.FItems);
      return Result;
    };
    this.PrepareAddingItem = function () {
      var Result = 0;
      if (this.FLength === rtl.length(this.FItems)) this.FItems.push(0.0);
      Result = this.FLength;
      this.FLength += 1;
      return Result;
    };
    this.PrepareAddingRange = function (ACount) {
      var Result = 0;
      var l = 0;
      if (ACount < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (ACount === 0) return this.FLength - 1;
      for (var $l = rtl.length(this.FItems) + 1, $end = this.FLength + ACount; $l <= $end; $l++) {
        l = $l;
        this.FItems.push(0.0);
      };
      Result = this.FLength;
      this.FLength += ACount;
      return Result;
    };
    this.Notify = function (AValue, ACollectionNotification) {
      if (this.FOnNotify != null) this.FOnNotify(this,AValue,ACollectionNotification);
    };
    this.DoRemove = function (AIndex, ACollectionNotification) {
      var Result = 0.0;
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      this.FLength -= 1;
      this.FItems[AIndex] = 0.0;
      this.FItems.splice(AIndex,1);
      this.Notify(Result,ACollectionNotification);
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FLength;
      return Result;
    };
    var $r = this.$rtti;
    $mod.$rtti.$DynArray("TCustomList<System.Double>.FItems$a",{eltype: rtl.double});
  },"TCustomList<System.Double>");
  rtl.createClass(this,"TCustomListEnumerator$$$G$$generics$collections$$Double",this.TEnumerator$$$G$$generics$collections$$Double,function () {
    this.$init = function () {
      $mod.TEnumerator$$$G$$generics$collections$$Double.$init.call(this);
      this.FList = null;
      this.FIndex = 0;
    };
    this.$final = function () {
      this.FList = undefined;
      $mod.TEnumerator$$$G$$generics$collections$$Double.$final.call(this);
    };
    this.DoMoveNext = function () {
      var Result = false;
      this.FIndex += 1;
      Result = (this.FList.FLength > 0) && (this.FIndex < this.FList.FLength);
      return Result;
    };
    this.DoGetCurrent = function () {
      var Result = 0.0;
      Result = this.GetCurrent();
      return Result;
    };
    this.GetCurrent = function () {
      var Result = 0.0;
      Result = this.FList.FItems[this.FIndex];
      return Result;
    };
    this.Create$1 = function (AList) {
      pas.System.TObject.Create.call(this);
      this.FIndex = -1;
      this.FList = AList;
      return this;
    };
  },"TCustomListEnumerator<System.Double>");
  rtl.createClass(this,"TList$$$G$$generics$collections$$Double",this.TCustomList$$$G$$generics$collections$$Double,function () {
    rtl.createClass(this,"TEnumerator",$mod.TCustomListEnumerator$$$G$$generics$collections$$Double,function () {
    },"TList<System.Double>.TEnumerator");
    this.$init = function () {
      $mod.TCustomList$$$G$$generics$collections$$Double.$init.call(this);
      this.FComparer = null;
    };
    this.$final = function () {
      rtl.setIntfP(this,"FComparer",null);
      $mod.TCustomList$$$G$$generics$collections$$Double.$final.call(this);
    };
    this.SameValue = function (Left, Right) {
      var Result = false;
      if (this.FComparer != null) {
        Result = this.FComparer.Compare(Left,Right) === 0}
       else Result = Left === Right;
      return Result;
    };
    this.SetCapacity = function (AValue) {
      if (AValue < this.FLength) this.SetCount(AValue);
      this.FItems = rtl.arraySetLength(this.FItems,0.0,AValue);
    };
    this.SetCount = function (AValue) {
      if (AValue < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (AValue > this.GetCapacity()) {
        this.SetCapacity(AValue)}
       else if (AValue < this.FLength) this.DeleteRange(AValue,this.FLength - AValue);
      this.FLength = AValue;
    };
    this.InitializeList = function () {
    };
    this.InternalInsert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.FItems.splice(AIndex,0,AValue);
      this.FLength += 1;
      this.FItems[AIndex] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.GetEnumerator$1();
      return Result;
    };
    this.GetItem = function (AIndex) {
      var Result = 0.0;
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      return Result;
    };
    this.SetItem = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.Notify(this.FItems[AIndex],$mod.TCollectionNotification.cnRemoved);
      this.FItems[AIndex] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.Create$1 = function () {
      this.InitializeList();
      return this;
    };
    this.Create$2 = function (AComparer) {
      this.InitializeList();
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Create$3 = function (ACollection) {
      var LItem = 0.0;
      this.Create$1();
      var $in = ACollection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LItem = $in.DoGetCurrent();
          this.Add(LItem);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Destroy = function () {
      this.SetCapacity(0);
    };
    this.Add = function (AValue) {
      var Result = 0;
      Result = this.PrepareAddingItem();
      this.FItems[Result] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
      return Result;
    };
    this.AddRange = function (AValues) {
      this.InsertRange(this.FLength,AValues);
    };
    this.AddRange$1 = function (AEnumerable) {
      var LValue = 0.0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.Add(LValue);
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.AddRange$2 = function (AEnumerable) {
      var LValue = 0.0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.Add(LValue);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Insert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.InternalInsert(AIndex,AValue);
    };
    this.InsertRange = function (AIndex, AValues) {
      var LLength = 0;
      var i = 0;
      var LValue = 0.0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LLength = rtl.length(AValues);
      if (LLength === 0) return;
      if (AIndex !== this.PrepareAddingRange(LLength)) {
        for (var $l = AIndex, $end = this.FLength - LLength - 1; $l <= $end; $l++) {
          i = $l;
          this.FItems[i + LLength] = this.FItems[i];
        };
        for (var $l1 = 0, $end1 = LLength - 1; $l1 <= $end1; $l1++) {
          i = $l1;
          this.FItems[AIndex + i] = 0.0;
        };
      };
      for (var $l2 = 0, $end2 = LLength - 1; $l2 <= $end2; $l2++) {
        i = $l2;
        LValue = AValues[i];
        this.FItems[i + AIndex] = LValue;
        this.Notify(LValue,$mod.TCollectionNotification.cnAdded);
      };
    };
    this.InsertRange$1 = function (AIndex, AEnumerable) {
      var LValue = 0.0;
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.InsertRange$2 = function (AIndex, AEnumerable) {
      var LValue = 0.0;
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Remove = function (AValue) {
      var Result = 0;
      Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.RemoveItem = function (AValue, Direction) {
      var Result = 0;
      if (Direction === $mod.TDirection.fromEnd) {
        Result = this.LastIndexOf(AValue)}
       else Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.Delete = function (AIndex) {
      this.DoRemove(AIndex,$mod.TCollectionNotification.cnRemoved);
    };
    this.DeleteRange = function (AIndex, ACount) {
      var LDeleted = [];
      var i = 0;
      if (ACount === 0) return;
      if ((ACount < 0) || (AIndex < 0) || ((AIndex + ACount) > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LDeleted = this.FItems.splice(AIndex,this.FLength);
      this.FLength -= ACount;
      for (var $l = 0, $end = rtl.length(LDeleted) - 1; $l <= $end; $l++) {
        i = $l;
        this.Notify(LDeleted[i],$mod.TCollectionNotification.cnRemoved);
      };
    };
    this.ExtractIndex = function (AIndex) {
      var Result = 0.0;
      Result = this.DoRemove(AIndex,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.Extract = function (AValue) {
      var Result = 0.0;
      var LIndex = 0;
      LIndex = this.IndexOf(AValue);
      if (LIndex < 0) {
        Result = 0.0}
       else Result = this.DoRemove(LIndex,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.Exchange = function (AIndex1, AIndex2) {
      var LTemp = 0.0;
      LTemp = this.FItems[AIndex1];
      this.FItems[AIndex1] = this.FItems[AIndex2];
      this.FItems[AIndex2] = LTemp;
    };
    this.Move = function (AIndex, ANewIndex) {
      var Arr = null;
      var LTemp = undefined;
      var i = 0;
      if (ANewIndex === AIndex) return;
      if ((ANewIndex < 0) || (ANewIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Arr = this.FItems;
      LTemp = Arr[AIndex];
      if (AIndex < ANewIndex) {
        for (var $l = AIndex, $end = ANewIndex - 1; $l <= $end; $l++) {
          i = $l;
          Arr[i] = Arr[i + 1];
        }}
       else for (var $l1 = AIndex, $end1 = ANewIndex + 1; $l1 >= $end1; $l1--) {
        i = $l1;
        Arr[i] = Arr[i - 1];
      };
      Arr[ANewIndex] = LTemp;
    };
    this.First = function () {
      var Result = 0.0;
      Result = this.GetItem(0);
      return Result;
    };
    this.Last = function () {
      var Result = 0.0;
      Result = this.GetItem(this.FLength - 1);
      return Result;
    };
    this.Clear = function () {
      this.SetCount(0);
      this.SetCapacity(0);
    };
    this.Contains = function (AValue) {
      var Result = false;
      Result = this.IndexOf(AValue) >= 0;
      return Result;
    };
    this.IndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = 0, $end = this.FLength - 1; $l <= $end; $l++) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.LastIndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = this.FLength - 1; $l >= 0; $l--) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.Reverse = function () {
      var a = 0;
      var b = 0;
      var LTemp = 0.0;
      a = 0;
      b = this.FLength - 1;
      while (a < b) {
        LTemp = this.FItems[a];
        this.FItems[a] = this.FItems[b];
        this.FItems[b] = LTemp;
        a += 1;
        b -= 1;
      };
    };
    this.TrimExcess = function () {
      this.SetCapacity(this.FLength);
    };
    this.Sort = function () {
      $mod.TArrayHelper$$$G$$generics$collections$$Double.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},this.FComparer,0,this.FLength);
    };
    this.Sort$1 = function (AComparer) {
      $mod.TArrayHelper$$$G$$generics$collections$$Double.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},AComparer,0,this.FLength);
    };
    this.BinarySearch = function (AItem, AIndex) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$Double.BinarySearch$1(this.FItems,AItem,AIndex,this.FComparer,0,this.FLength);
      return Result;
    };
    this.BinarySearch$1 = function (AItem, AIndex, AComparer) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$Double.BinarySearch$1(this.FItems,AItem,AIndex,AComparer,0,this.FLength);
      return Result;
    };
  },"TList<System.Double>");
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TTMSFNCObjectReference",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<WEBLib.TMSFNCPersistence.TTMSFNCObjectReference>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TTMSFNCObjectReference",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push(LEnumerator.DoGetCurrent());
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<WEBLib.TMSFNCPersistence.TTMSFNCObjectReference>");
  this.$rtti.$MethodVar("TCollectionNotifyEvent<WEBLib.TMSFNCPersistence.TTMSFNCObjectReference>",{init: function () {
      this.procsig = rtl.newTIProcSig([["ASender",pas.System.$rtti["TObject"]],["AItem",pas["WEBLib.TMSFNCPersistence"].$rtti["TTMSFNCObjectReference"],2],["AAction",$mod.$rtti["TCollectionNotification"]]]);
    }, methodkind: 0});
  rtl.createClass(this,"TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCObjectReference",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.Sort = function (AValues, AComparer) {
      this.Sort$1(AValues,AComparer,0,rtl.length(AValues.get()));
    };
    this.Sort$1 = function (AValues, AComparer, AIndex, ACount) {
      if (ACount <= 1) return;
      this.QuickSort(AValues,AIndex,(AIndex + ACount) - 1,AComparer);
    };
    this.BinarySearch$2 = function (AValues, AItem, AFoundIndex, AComparer) {
      var Result = false;
      Result = this.BinarySearch$1(AValues,AItem,AFoundIndex,AComparer,0,rtl.length(AValues));
      return Result;
    };
    this.BinarySearch$3 = function (AValues, AItem, ASearchResult, AComparer) {
      var Result = false;
      Result = this.BinarySearch(AValues,AItem,ASearchResult,AComparer,0,rtl.length(AValues));
      return Result;
    };
  },"TCustomArrayHelper<WEBLib.TMSFNCPersistence.TTMSFNCObjectReference>");
  rtl.createClass(this,"TArrayHelper$$$G$$generics$collections$$TTMSFNCObjectReference",this.TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCObjectReference,function () {
    this.$initSpec = function () {
    };
    this.QuickSort = function (AValues, ALeft, ARight, AComparer) {
      var I = 0;
      var J = 0;
      var P = null;
      var Q = null;
      if (((ARight - ALeft) <= 0) || (rtl.length(AValues.get()) === 0)) return;
      do {
        I = ALeft;
        J = ARight;
        P = AValues.get()[ALeft + Math.floor((ARight - ALeft) / 2)];
        do {
          while (AComparer.Compare(AValues.get()[I],P) < 0) I += 1;
          while (AComparer.Compare(AValues.get()[J],P) > 0) J -= 1;
          if (I <= J) {
            if (I !== J) {
              Q = AValues.get()[I];
              AValues.get()[I] = AValues.get()[J];
              AValues.get()[J] = Q;
            };
            I += 1;
            J -= 1;
          };
        } while (!(I > J));
        if ((J - ALeft) < (ARight - I)) {
          if (ALeft < J) this.QuickSort(AValues,ALeft,J,AComparer);
          ALeft = I;
        } else {
          if (I < ARight) this.QuickSort(AValues,I,ARight,AComparer);
          ARight = J;
        };
      } while (!(ALeft >= ARight));
    };
    this.BinarySearch = function (AValues, AItem, ASearchResult, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var ilo = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      ilo = imid * imid;
      imid = ilo * imid;
      while (imin < imax) {
        imid = rtl.trunc((imax + imin) / 2);
        ASearchResult.CompareResult = AComparer.Compare(AValues[imid],AItem);
        if (ASearchResult.CompareResult < 0) {
          imin = imid + 1}
         else {
          if (ASearchResult.CompareResult === 0) {
            ASearchResult.FoundIndex = imid;
            ASearchResult.CandidateIndex = imid;
            return true;
          };
          imax = imid;
        };
      };
      Result = imax === imin;
      if (Result) {
        ASearchResult.CompareResult = AComparer.Compare(AValues[imin],AItem);
        ASearchResult.CandidateIndex = imin;
        Result = ASearchResult.CompareResult === 0;
        if (Result) {
          ASearchResult.FoundIndex = imin}
         else ASearchResult.FoundIndex = -1;
      } else {
        ASearchResult.CompareResult = 0;
        ASearchResult.FoundIndex = -1;
        ASearchResult.CandidateIndex = -1;
      };
      return Result;
    };
    this.BinarySearch$1 = function (AValues, AItem, AFoundIndex, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var LCompare = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      while (imin < imax) {
        imid = rtl.trunc((imin + imax) / 2);
        LCompare = AComparer.Compare(AValues[imid],AItem);
        if (LCompare < 0) {
          imin = imid + 1}
         else {
          if (LCompare === 0) {
            AFoundIndex.set(imid);
            return true;
          };
          imax = imid;
        };
      };
      LCompare = AComparer.Compare(AValues[imin],AItem);
      Result = (imax === imin) && (LCompare === 0);
      if (Result) {
        AFoundIndex.set(imin)}
       else AFoundIndex.set(-1);
      return Result;
    };
  },"TArrayHelper<WEBLib.TMSFNCPersistence.TTMSFNCObjectReference>");
  rtl.createClass(this,"TCustomList$$$G$$generics$collections$$TTMSFNCObjectReference",this.TEnumerable$$$G$$generics$collections$$TTMSFNCObjectReference,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $mod.$rtti.$DynArray("TCustomList<WEBLib.TMSFNCPersistence.TTMSFNCObjectReference>.FItems$a",{eltype: pas["WEBLib.TMSFNCPersistence"].$rtti["TTMSFNCObjectReference"]});
    };
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCObjectReference.$init.call(this);
      this.FOnNotify = null;
      this.FLength = 0;
      this.FItems = [];
    };
    this.$final = function () {
      this.FOnNotify = undefined;
      this.FItems = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCObjectReference.$final.call(this);
    };
    this.GetCapacity = function () {
      var Result = 0;
      Result = rtl.length(this.FItems);
      return Result;
    };
    this.PrepareAddingItem = function () {
      var Result = 0;
      if (this.FLength === rtl.length(this.FItems)) this.FItems.push(null);
      Result = this.FLength;
      this.FLength += 1;
      return Result;
    };
    this.PrepareAddingRange = function (ACount) {
      var Result = 0;
      var l = 0;
      if (ACount < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (ACount === 0) return this.FLength - 1;
      for (var $l = rtl.length(this.FItems) + 1, $end = this.FLength + ACount; $l <= $end; $l++) {
        l = $l;
        this.FItems.push(null);
      };
      Result = this.FLength;
      this.FLength += ACount;
      return Result;
    };
    this.Notify = function (AValue, ACollectionNotification) {
      if (this.FOnNotify != null) this.FOnNotify(this,AValue,ACollectionNotification);
    };
    this.DoRemove = function (AIndex, ACollectionNotification) {
      var Result = null;
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      this.FLength -= 1;
      this.FItems[AIndex] = null;
      this.FItems.splice(AIndex,1);
      this.Notify(Result,ACollectionNotification);
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FLength;
      return Result;
    };
  },"TCustomList<WEBLib.TMSFNCPersistence.TTMSFNCObjectReference>");
  rtl.createClass(this,"TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCObjectReference",this.TEnumerator$$$G$$generics$collections$$TTMSFNCObjectReference,function () {
    this.$initSpec = function () {
    };
    this.$init = function () {
      $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCObjectReference.$init.call(this);
      this.FList = null;
      this.FIndex = 0;
    };
    this.$final = function () {
      this.FList = undefined;
      $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCObjectReference.$final.call(this);
    };
    this.DoMoveNext = function () {
      var Result = false;
      this.FIndex += 1;
      Result = (this.FList.FLength > 0) && (this.FIndex < this.FList.FLength);
      return Result;
    };
    this.DoGetCurrent = function () {
      var Result = null;
      Result = this.GetCurrent();
      return Result;
    };
    this.GetCurrent = function () {
      var Result = null;
      Result = this.FList.FItems[this.FIndex];
      return Result;
    };
    this.Create$1 = function (AList) {
      pas.System.TObject.Create.call(this);
      this.FIndex = -1;
      this.FList = AList;
      return this;
    };
  },"TCustomListEnumerator<WEBLib.TMSFNCPersistence.TTMSFNCObjectReference>");
  rtl.createClass(this,"TList$$$G$$generics$collections$$TTMSFNCObjectReference",this.TCustomList$$$G$$generics$collections$$TTMSFNCObjectReference,function () {
    this.$initSpec = function () {
      rtl.createClass(this,"TEnumerator",$mod.TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCObjectReference,function () {
      },"TList<WEBLib.TMSFNCPersistence.TTMSFNCObjectReference>.TEnumerator");
    };
    this.$init = function () {
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCObjectReference.$init.call(this);
      this.FComparer = null;
    };
    this.$final = function () {
      rtl.setIntfP(this,"FComparer",null);
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCObjectReference.$final.call(this);
    };
    this.SameValue = function (Left, Right) {
      var Result = false;
      if (this.FComparer != null) {
        Result = this.FComparer.Compare(Left,Right) === 0}
       else Result = Left === Right;
      return Result;
    };
    this.SetCapacity = function (AValue) {
      if (AValue < this.FLength) this.SetCount(AValue);
      this.FItems = rtl.arraySetLength(this.FItems,null,AValue);
    };
    this.SetCount = function (AValue) {
      if (AValue < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (AValue > this.GetCapacity()) {
        this.SetCapacity(AValue)}
       else if (AValue < this.FLength) this.DeleteRange(AValue,this.FLength - AValue);
      this.FLength = AValue;
    };
    this.InitializeList = function () {
    };
    this.InternalInsert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.FItems.splice(AIndex,0,AValue);
      this.FLength += 1;
      this.FItems[AIndex] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.GetEnumerator$1();
      return Result;
    };
    this.GetItem = function (AIndex) {
      var Result = null;
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      return Result;
    };
    this.SetItem = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.Notify(this.FItems[AIndex],$mod.TCollectionNotification.cnRemoved);
      this.FItems[AIndex] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.Create$1 = function () {
      this.InitializeList();
      return this;
    };
    this.Create$2 = function (AComparer) {
      this.InitializeList();
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Create$3 = function (ACollection) {
      var LItem = null;
      this.Create$1();
      var $in = ACollection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LItem = $in.DoGetCurrent();
          this.Add(LItem);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Destroy = function () {
      this.SetCapacity(0);
    };
    this.Add = function (AValue) {
      var Result = 0;
      Result = this.PrepareAddingItem();
      this.FItems[Result] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
      return Result;
    };
    this.AddRange = function (AValues) {
      this.InsertRange(this.FLength,AValues);
    };
    this.AddRange$1 = function (AEnumerable) {
      var LValue = null;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.Add(LValue);
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.AddRange$2 = function (AEnumerable) {
      var LValue = null;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.Add(LValue);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Insert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.InternalInsert(AIndex,AValue);
    };
    this.InsertRange = function (AIndex, AValues) {
      var LLength = 0;
      var i = 0;
      var LValue = null;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LLength = rtl.length(AValues);
      if (LLength === 0) return;
      if (AIndex !== this.PrepareAddingRange(LLength)) {
        for (var $l = AIndex, $end = this.FLength - LLength - 1; $l <= $end; $l++) {
          i = $l;
          this.FItems[i + LLength] = this.FItems[i];
        };
        for (var $l1 = 0, $end1 = LLength - 1; $l1 <= $end1; $l1++) {
          i = $l1;
          this.FItems[AIndex + i] = null;
        };
      };
      for (var $l2 = 0, $end2 = LLength - 1; $l2 <= $end2; $l2++) {
        i = $l2;
        LValue = AValues[i];
        this.FItems[i + AIndex] = LValue;
        this.Notify(LValue,$mod.TCollectionNotification.cnAdded);
      };
    };
    this.InsertRange$1 = function (AIndex, AEnumerable) {
      var LValue = null;
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.InsertRange$2 = function (AIndex, AEnumerable) {
      var LValue = null;
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Remove = function (AValue) {
      var Result = 0;
      Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.RemoveItem = function (AValue, Direction) {
      var Result = 0;
      if (Direction === $mod.TDirection.fromEnd) {
        Result = this.LastIndexOf(AValue)}
       else Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.Delete = function (AIndex) {
      this.DoRemove(AIndex,$mod.TCollectionNotification.cnRemoved);
    };
    this.DeleteRange = function (AIndex, ACount) {
      var LDeleted = [];
      var i = 0;
      if (ACount === 0) return;
      if ((ACount < 0) || (AIndex < 0) || ((AIndex + ACount) > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LDeleted = this.FItems.splice(AIndex,this.FLength);
      this.FLength -= ACount;
      for (var $l = 0, $end = rtl.length(LDeleted) - 1; $l <= $end; $l++) {
        i = $l;
        this.Notify(LDeleted[i],$mod.TCollectionNotification.cnRemoved);
      };
    };
    this.ExtractIndex = function (AIndex) {
      var Result = null;
      Result = this.DoRemove(AIndex,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.Extract = function (AValue) {
      var Result = null;
      var LIndex = 0;
      LIndex = this.IndexOf(AValue);
      if (LIndex < 0) {
        Result = null}
       else Result = this.DoRemove(LIndex,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.Exchange = function (AIndex1, AIndex2) {
      var LTemp = null;
      LTemp = this.FItems[AIndex1];
      this.FItems[AIndex1] = this.FItems[AIndex2];
      this.FItems[AIndex2] = LTemp;
    };
    this.Move = function (AIndex, ANewIndex) {
      var Arr = null;
      var LTemp = undefined;
      var i = 0;
      if (ANewIndex === AIndex) return;
      if ((ANewIndex < 0) || (ANewIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Arr = this.FItems;
      LTemp = Arr[AIndex];
      if (AIndex < ANewIndex) {
        for (var $l = AIndex, $end = ANewIndex - 1; $l <= $end; $l++) {
          i = $l;
          Arr[i] = Arr[i + 1];
        }}
       else for (var $l1 = AIndex, $end1 = ANewIndex + 1; $l1 >= $end1; $l1--) {
        i = $l1;
        Arr[i] = Arr[i - 1];
      };
      Arr[ANewIndex] = LTemp;
    };
    this.First = function () {
      var Result = null;
      Result = this.GetItem(0);
      return Result;
    };
    this.Last = function () {
      var Result = null;
      Result = this.GetItem(this.FLength - 1);
      return Result;
    };
    this.Clear = function () {
      this.SetCount(0);
      this.SetCapacity(0);
    };
    this.Contains = function (AValue) {
      var Result = false;
      Result = this.IndexOf(AValue) >= 0;
      return Result;
    };
    this.IndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = 0, $end = this.FLength - 1; $l <= $end; $l++) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.LastIndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = this.FLength - 1; $l >= 0; $l--) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.Reverse = function () {
      var a = 0;
      var b = 0;
      var LTemp = null;
      a = 0;
      b = this.FLength - 1;
      while (a < b) {
        LTemp = this.FItems[a];
        this.FItems[a] = this.FItems[b];
        this.FItems[b] = LTemp;
        a += 1;
        b -= 1;
      };
    };
    this.TrimExcess = function () {
      this.SetCapacity(this.FLength);
    };
    this.Sort = function () {
      $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCObjectReference.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},this.FComparer,0,this.FLength);
    };
    this.Sort$1 = function (AComparer) {
      $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCObjectReference.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},AComparer,0,this.FLength);
    };
    this.BinarySearch = function (AItem, AIndex) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCObjectReference.BinarySearch$1(this.FItems,AItem,AIndex,this.FComparer,0,this.FLength);
      return Result;
    };
    this.BinarySearch$1 = function (AItem, AIndex, AComparer) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCObjectReference.BinarySearch$1(this.FItems,AItem,AIndex,AComparer,0,this.FLength);
      return Result;
    };
  },"TList<WEBLib.TMSFNCPersistence.TTMSFNCObjectReference>");
  rtl.createClass(this,"TObjectList$$$G$$generics$collections$$TTMSFNCObjectReference",this.TList$$$G$$generics$collections$$TTMSFNCObjectReference,function () {
    this.$initSpec = function () {
    };
    this.$init = function () {
      $mod.TList$$$G$$generics$collections$$TTMSFNCObjectReference.$init.call(this);
      this.FObjectsOwner = false;
    };
    this.Notify = function (aValue, Action) {
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCObjectReference.Notify.call(this,aValue,Action);
      if (this.FObjectsOwner && (Action === $mod.TCollectionNotification.cnRemoved)) aValue = rtl.freeLoc(aValue);
    };
    this.Create$4 = function (aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCObjectReference.Create$1.call(this);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
    this.Create$5 = function (AComparer, aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCObjectReference.Create$2.call(this,AComparer);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
    this.Create$6 = function (aCollection, aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCObjectReference.Create$3.call(this,aCollection);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
  },"TObjectList<WEBLib.TMSFNCPersistence.TTMSFNCObjectReference>");
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TTMSFNCJSONToClassProperty",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TTMSFNCJSONToClassProperty",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push(LEnumerator.DoGetCurrent());
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>");
  this.$rtti.$MethodVar("TCollectionNotifyEvent<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>",{init: function () {
      this.procsig = rtl.newTIProcSig([["ASender",pas.System.$rtti["TObject"]],["AItem",pas["WEBLib.TMSFNCPersistence"].$rtti["TTMSFNCJSONToClassProperty"],2],["AAction",$mod.$rtti["TCollectionNotification"]]]);
    }, methodkind: 0});
  rtl.createClass(this,"TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCJSONToClassProperty",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.Sort = function (AValues, AComparer) {
      this.Sort$1(AValues,AComparer,0,rtl.length(AValues.get()));
    };
    this.Sort$1 = function (AValues, AComparer, AIndex, ACount) {
      if (ACount <= 1) return;
      this.QuickSort(AValues,AIndex,(AIndex + ACount) - 1,AComparer);
    };
    this.BinarySearch$2 = function (AValues, AItem, AFoundIndex, AComparer) {
      var Result = false;
      Result = this.BinarySearch$1(AValues,AItem,AFoundIndex,AComparer,0,rtl.length(AValues));
      return Result;
    };
    this.BinarySearch$3 = function (AValues, AItem, ASearchResult, AComparer) {
      var Result = false;
      Result = this.BinarySearch(AValues,AItem,ASearchResult,AComparer,0,rtl.length(AValues));
      return Result;
    };
  },"TCustomArrayHelper<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>");
  rtl.createClass(this,"TArrayHelper$$$G$$generics$collections$$TTMSFNCJSONToClassProperty",this.TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCJSONToClassProperty,function () {
    this.$initSpec = function () {
    };
    this.QuickSort = function (AValues, ALeft, ARight, AComparer) {
      var I = 0;
      var J = 0;
      var P = null;
      var Q = null;
      if (((ARight - ALeft) <= 0) || (rtl.length(AValues.get()) === 0)) return;
      do {
        I = ALeft;
        J = ARight;
        P = AValues.get()[ALeft + Math.floor((ARight - ALeft) / 2)];
        do {
          while (AComparer.Compare(AValues.get()[I],P) < 0) I += 1;
          while (AComparer.Compare(AValues.get()[J],P) > 0) J -= 1;
          if (I <= J) {
            if (I !== J) {
              Q = AValues.get()[I];
              AValues.get()[I] = AValues.get()[J];
              AValues.get()[J] = Q;
            };
            I += 1;
            J -= 1;
          };
        } while (!(I > J));
        if ((J - ALeft) < (ARight - I)) {
          if (ALeft < J) this.QuickSort(AValues,ALeft,J,AComparer);
          ALeft = I;
        } else {
          if (I < ARight) this.QuickSort(AValues,I,ARight,AComparer);
          ARight = J;
        };
      } while (!(ALeft >= ARight));
    };
    this.BinarySearch = function (AValues, AItem, ASearchResult, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var ilo = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      ilo = imid * imid;
      imid = ilo * imid;
      while (imin < imax) {
        imid = rtl.trunc((imax + imin) / 2);
        ASearchResult.CompareResult = AComparer.Compare(AValues[imid],AItem);
        if (ASearchResult.CompareResult < 0) {
          imin = imid + 1}
         else {
          if (ASearchResult.CompareResult === 0) {
            ASearchResult.FoundIndex = imid;
            ASearchResult.CandidateIndex = imid;
            return true;
          };
          imax = imid;
        };
      };
      Result = imax === imin;
      if (Result) {
        ASearchResult.CompareResult = AComparer.Compare(AValues[imin],AItem);
        ASearchResult.CandidateIndex = imin;
        Result = ASearchResult.CompareResult === 0;
        if (Result) {
          ASearchResult.FoundIndex = imin}
         else ASearchResult.FoundIndex = -1;
      } else {
        ASearchResult.CompareResult = 0;
        ASearchResult.FoundIndex = -1;
        ASearchResult.CandidateIndex = -1;
      };
      return Result;
    };
    this.BinarySearch$1 = function (AValues, AItem, AFoundIndex, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var LCompare = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      while (imin < imax) {
        imid = rtl.trunc((imin + imax) / 2);
        LCompare = AComparer.Compare(AValues[imid],AItem);
        if (LCompare < 0) {
          imin = imid + 1}
         else {
          if (LCompare === 0) {
            AFoundIndex.set(imid);
            return true;
          };
          imax = imid;
        };
      };
      LCompare = AComparer.Compare(AValues[imin],AItem);
      Result = (imax === imin) && (LCompare === 0);
      if (Result) {
        AFoundIndex.set(imin)}
       else AFoundIndex.set(-1);
      return Result;
    };
  },"TArrayHelper<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>");
  rtl.createClass(this,"TCustomList$$$G$$generics$collections$$TTMSFNCJSONToClassProperty",this.TEnumerable$$$G$$generics$collections$$TTMSFNCJSONToClassProperty,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $mod.$rtti.$DynArray("TCustomList<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>.FItems$a",{eltype: pas["WEBLib.TMSFNCPersistence"].$rtti["TTMSFNCJSONToClassProperty"]});
    };
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCJSONToClassProperty.$init.call(this);
      this.FOnNotify = null;
      this.FLength = 0;
      this.FItems = [];
    };
    this.$final = function () {
      this.FOnNotify = undefined;
      this.FItems = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCJSONToClassProperty.$final.call(this);
    };
    this.GetCapacity = function () {
      var Result = 0;
      Result = rtl.length(this.FItems);
      return Result;
    };
    this.PrepareAddingItem = function () {
      var Result = 0;
      if (this.FLength === rtl.length(this.FItems)) this.FItems.push(null);
      Result = this.FLength;
      this.FLength += 1;
      return Result;
    };
    this.PrepareAddingRange = function (ACount) {
      var Result = 0;
      var l = 0;
      if (ACount < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (ACount === 0) return this.FLength - 1;
      for (var $l = rtl.length(this.FItems) + 1, $end = this.FLength + ACount; $l <= $end; $l++) {
        l = $l;
        this.FItems.push(null);
      };
      Result = this.FLength;
      this.FLength += ACount;
      return Result;
    };
    this.Notify = function (AValue, ACollectionNotification) {
      if (this.FOnNotify != null) this.FOnNotify(this,AValue,ACollectionNotification);
    };
    this.DoRemove = function (AIndex, ACollectionNotification) {
      var Result = null;
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      this.FLength -= 1;
      this.FItems[AIndex] = null;
      this.FItems.splice(AIndex,1);
      this.Notify(Result,ACollectionNotification);
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FLength;
      return Result;
    };
  },"TCustomList<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>");
  rtl.createClass(this,"TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCJSONToClassProperty",this.TEnumerator$$$G$$generics$collections$$TTMSFNCJSONToClassProperty,function () {
    this.$initSpec = function () {
    };
    this.$init = function () {
      $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCJSONToClassProperty.$init.call(this);
      this.FList = null;
      this.FIndex = 0;
    };
    this.$final = function () {
      this.FList = undefined;
      $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCJSONToClassProperty.$final.call(this);
    };
    this.DoMoveNext = function () {
      var Result = false;
      this.FIndex += 1;
      Result = (this.FList.FLength > 0) && (this.FIndex < this.FList.FLength);
      return Result;
    };
    this.DoGetCurrent = function () {
      var Result = null;
      Result = this.GetCurrent();
      return Result;
    };
    this.GetCurrent = function () {
      var Result = null;
      Result = this.FList.FItems[this.FIndex];
      return Result;
    };
    this.Create$1 = function (AList) {
      pas.System.TObject.Create.call(this);
      this.FIndex = -1;
      this.FList = AList;
      return this;
    };
  },"TCustomListEnumerator<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>");
  rtl.createClass(this,"TList$$$G$$generics$collections$$TTMSFNCJSONToClassProperty",this.TCustomList$$$G$$generics$collections$$TTMSFNCJSONToClassProperty,function () {
    this.$initSpec = function () {
      rtl.createClass(this,"TEnumerator",$mod.TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCJSONToClassProperty,function () {
      },"TList<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>.TEnumerator");
    };
    this.$init = function () {
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCJSONToClassProperty.$init.call(this);
      this.FComparer = null;
    };
    this.$final = function () {
      rtl.setIntfP(this,"FComparer",null);
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCJSONToClassProperty.$final.call(this);
    };
    this.SameValue = function (Left, Right) {
      var Result = false;
      if (this.FComparer != null) {
        Result = this.FComparer.Compare(Left,Right) === 0}
       else Result = Left === Right;
      return Result;
    };
    this.SetCapacity = function (AValue) {
      if (AValue < this.FLength) this.SetCount(AValue);
      this.FItems = rtl.arraySetLength(this.FItems,null,AValue);
    };
    this.SetCount = function (AValue) {
      if (AValue < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (AValue > this.GetCapacity()) {
        this.SetCapacity(AValue)}
       else if (AValue < this.FLength) this.DeleteRange(AValue,this.FLength - AValue);
      this.FLength = AValue;
    };
    this.InitializeList = function () {
    };
    this.InternalInsert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.FItems.splice(AIndex,0,AValue);
      this.FLength += 1;
      this.FItems[AIndex] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.GetEnumerator$1();
      return Result;
    };
    this.GetItem = function (AIndex) {
      var Result = null;
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      return Result;
    };
    this.SetItem = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.Notify(this.FItems[AIndex],$mod.TCollectionNotification.cnRemoved);
      this.FItems[AIndex] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.Create$1 = function () {
      this.InitializeList();
      return this;
    };
    this.Create$2 = function (AComparer) {
      this.InitializeList();
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Create$3 = function (ACollection) {
      var LItem = null;
      this.Create$1();
      var $in = ACollection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LItem = $in.DoGetCurrent();
          this.Add(LItem);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Destroy = function () {
      this.SetCapacity(0);
    };
    this.Add = function (AValue) {
      var Result = 0;
      Result = this.PrepareAddingItem();
      this.FItems[Result] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
      return Result;
    };
    this.AddRange = function (AValues) {
      this.InsertRange(this.FLength,AValues);
    };
    this.AddRange$1 = function (AEnumerable) {
      var LValue = null;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.Add(LValue);
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.AddRange$2 = function (AEnumerable) {
      var LValue = null;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.Add(LValue);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Insert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.InternalInsert(AIndex,AValue);
    };
    this.InsertRange = function (AIndex, AValues) {
      var LLength = 0;
      var i = 0;
      var LValue = null;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LLength = rtl.length(AValues);
      if (LLength === 0) return;
      if (AIndex !== this.PrepareAddingRange(LLength)) {
        for (var $l = AIndex, $end = this.FLength - LLength - 1; $l <= $end; $l++) {
          i = $l;
          this.FItems[i + LLength] = this.FItems[i];
        };
        for (var $l1 = 0, $end1 = LLength - 1; $l1 <= $end1; $l1++) {
          i = $l1;
          this.FItems[AIndex + i] = null;
        };
      };
      for (var $l2 = 0, $end2 = LLength - 1; $l2 <= $end2; $l2++) {
        i = $l2;
        LValue = AValues[i];
        this.FItems[i + AIndex] = LValue;
        this.Notify(LValue,$mod.TCollectionNotification.cnAdded);
      };
    };
    this.InsertRange$1 = function (AIndex, AEnumerable) {
      var LValue = null;
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.InsertRange$2 = function (AIndex, AEnumerable) {
      var LValue = null;
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Remove = function (AValue) {
      var Result = 0;
      Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.RemoveItem = function (AValue, Direction) {
      var Result = 0;
      if (Direction === $mod.TDirection.fromEnd) {
        Result = this.LastIndexOf(AValue)}
       else Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.Delete = function (AIndex) {
      this.DoRemove(AIndex,$mod.TCollectionNotification.cnRemoved);
    };
    this.DeleteRange = function (AIndex, ACount) {
      var LDeleted = [];
      var i = 0;
      if (ACount === 0) return;
      if ((ACount < 0) || (AIndex < 0) || ((AIndex + ACount) > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LDeleted = this.FItems.splice(AIndex,this.FLength);
      this.FLength -= ACount;
      for (var $l = 0, $end = rtl.length(LDeleted) - 1; $l <= $end; $l++) {
        i = $l;
        this.Notify(LDeleted[i],$mod.TCollectionNotification.cnRemoved);
      };
    };
    this.ExtractIndex = function (AIndex) {
      var Result = null;
      Result = this.DoRemove(AIndex,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.Extract = function (AValue) {
      var Result = null;
      var LIndex = 0;
      LIndex = this.IndexOf(AValue);
      if (LIndex < 0) {
        Result = null}
       else Result = this.DoRemove(LIndex,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.Exchange = function (AIndex1, AIndex2) {
      var LTemp = null;
      LTemp = this.FItems[AIndex1];
      this.FItems[AIndex1] = this.FItems[AIndex2];
      this.FItems[AIndex2] = LTemp;
    };
    this.Move = function (AIndex, ANewIndex) {
      var Arr = null;
      var LTemp = undefined;
      var i = 0;
      if (ANewIndex === AIndex) return;
      if ((ANewIndex < 0) || (ANewIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Arr = this.FItems;
      LTemp = Arr[AIndex];
      if (AIndex < ANewIndex) {
        for (var $l = AIndex, $end = ANewIndex - 1; $l <= $end; $l++) {
          i = $l;
          Arr[i] = Arr[i + 1];
        }}
       else for (var $l1 = AIndex, $end1 = ANewIndex + 1; $l1 >= $end1; $l1--) {
        i = $l1;
        Arr[i] = Arr[i - 1];
      };
      Arr[ANewIndex] = LTemp;
    };
    this.First = function () {
      var Result = null;
      Result = this.GetItem(0);
      return Result;
    };
    this.Last = function () {
      var Result = null;
      Result = this.GetItem(this.FLength - 1);
      return Result;
    };
    this.Clear = function () {
      this.SetCount(0);
      this.SetCapacity(0);
    };
    this.Contains = function (AValue) {
      var Result = false;
      Result = this.IndexOf(AValue) >= 0;
      return Result;
    };
    this.IndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = 0, $end = this.FLength - 1; $l <= $end; $l++) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.LastIndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = this.FLength - 1; $l >= 0; $l--) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.Reverse = function () {
      var a = 0;
      var b = 0;
      var LTemp = null;
      a = 0;
      b = this.FLength - 1;
      while (a < b) {
        LTemp = this.FItems[a];
        this.FItems[a] = this.FItems[b];
        this.FItems[b] = LTemp;
        a += 1;
        b -= 1;
      };
    };
    this.TrimExcess = function () {
      this.SetCapacity(this.FLength);
    };
    this.Sort = function () {
      $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCJSONToClassProperty.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},this.FComparer,0,this.FLength);
    };
    this.Sort$1 = function (AComparer) {
      $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCJSONToClassProperty.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},AComparer,0,this.FLength);
    };
    this.BinarySearch = function (AItem, AIndex) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCJSONToClassProperty.BinarySearch$1(this.FItems,AItem,AIndex,this.FComparer,0,this.FLength);
      return Result;
    };
    this.BinarySearch$1 = function (AItem, AIndex, AComparer) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCJSONToClassProperty.BinarySearch$1(this.FItems,AItem,AIndex,AComparer,0,this.FLength);
      return Result;
    };
  },"TList<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>");
  rtl.createClass(this,"TObjectList$$$G$$generics$collections$$TTMSFNCJSONToClassProperty",this.TList$$$G$$generics$collections$$TTMSFNCJSONToClassProperty,function () {
    this.$initSpec = function () {
    };
    this.$init = function () {
      $mod.TList$$$G$$generics$collections$$TTMSFNCJSONToClassProperty.$init.call(this);
      this.FObjectsOwner = false;
    };
    this.Notify = function (aValue, Action) {
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCJSONToClassProperty.Notify.call(this,aValue,Action);
      if (this.FObjectsOwner && (Action === $mod.TCollectionNotification.cnRemoved)) aValue = rtl.freeLoc(aValue);
    };
    this.Create$4 = function (aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCJSONToClassProperty.Create$1.call(this);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
    this.Create$5 = function (AComparer, aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCJSONToClassProperty.Create$2.call(this,AComparer);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
    this.Create$6 = function (aCollection, aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCJSONToClassProperty.Create$3.call(this,aCollection);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
  },"TObjectList<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>");
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TTMSFNCJSONToClassItem",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassItem>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TTMSFNCJSONToClassItem",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push(LEnumerator.DoGetCurrent());
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassItem>");
  this.$rtti.$MethodVar("TCollectionNotifyEvent<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassItem>",{init: function () {
      this.procsig = rtl.newTIProcSig([["ASender",pas.System.$rtti["TObject"]],["AItem",pas["WEBLib.TMSFNCPersistence"].$rtti["TTMSFNCJSONToClassItem"],2],["AAction",$mod.$rtti["TCollectionNotification"]]]);
    }, methodkind: 0});
  rtl.createClass(this,"TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCJSONToClassItem",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.Sort = function (AValues, AComparer) {
      this.Sort$1(AValues,AComparer,0,rtl.length(AValues.get()));
    };
    this.Sort$1 = function (AValues, AComparer, AIndex, ACount) {
      if (ACount <= 1) return;
      this.QuickSort(AValues,AIndex,(AIndex + ACount) - 1,AComparer);
    };
    this.BinarySearch$2 = function (AValues, AItem, AFoundIndex, AComparer) {
      var Result = false;
      Result = this.BinarySearch$1(AValues,AItem,AFoundIndex,AComparer,0,rtl.length(AValues));
      return Result;
    };
    this.BinarySearch$3 = function (AValues, AItem, ASearchResult, AComparer) {
      var Result = false;
      Result = this.BinarySearch(AValues,AItem,ASearchResult,AComparer,0,rtl.length(AValues));
      return Result;
    };
  },"TCustomArrayHelper<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassItem>");
  rtl.createClass(this,"TArrayHelper$$$G$$generics$collections$$TTMSFNCJSONToClassItem",this.TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCJSONToClassItem,function () {
    this.$initSpec = function () {
    };
    this.QuickSort = function (AValues, ALeft, ARight, AComparer) {
      var I = 0;
      var J = 0;
      var P = null;
      var Q = null;
      if (((ARight - ALeft) <= 0) || (rtl.length(AValues.get()) === 0)) return;
      do {
        I = ALeft;
        J = ARight;
        P = AValues.get()[ALeft + Math.floor((ARight - ALeft) / 2)];
        do {
          while (AComparer.Compare(AValues.get()[I],P) < 0) I += 1;
          while (AComparer.Compare(AValues.get()[J],P) > 0) J -= 1;
          if (I <= J) {
            if (I !== J) {
              Q = AValues.get()[I];
              AValues.get()[I] = AValues.get()[J];
              AValues.get()[J] = Q;
            };
            I += 1;
            J -= 1;
          };
        } while (!(I > J));
        if ((J - ALeft) < (ARight - I)) {
          if (ALeft < J) this.QuickSort(AValues,ALeft,J,AComparer);
          ALeft = I;
        } else {
          if (I < ARight) this.QuickSort(AValues,I,ARight,AComparer);
          ARight = J;
        };
      } while (!(ALeft >= ARight));
    };
    this.BinarySearch = function (AValues, AItem, ASearchResult, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var ilo = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      ilo = imid * imid;
      imid = ilo * imid;
      while (imin < imax) {
        imid = rtl.trunc((imax + imin) / 2);
        ASearchResult.CompareResult = AComparer.Compare(AValues[imid],AItem);
        if (ASearchResult.CompareResult < 0) {
          imin = imid + 1}
         else {
          if (ASearchResult.CompareResult === 0) {
            ASearchResult.FoundIndex = imid;
            ASearchResult.CandidateIndex = imid;
            return true;
          };
          imax = imid;
        };
      };
      Result = imax === imin;
      if (Result) {
        ASearchResult.CompareResult = AComparer.Compare(AValues[imin],AItem);
        ASearchResult.CandidateIndex = imin;
        Result = ASearchResult.CompareResult === 0;
        if (Result) {
          ASearchResult.FoundIndex = imin}
         else ASearchResult.FoundIndex = -1;
      } else {
        ASearchResult.CompareResult = 0;
        ASearchResult.FoundIndex = -1;
        ASearchResult.CandidateIndex = -1;
      };
      return Result;
    };
    this.BinarySearch$1 = function (AValues, AItem, AFoundIndex, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var LCompare = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      while (imin < imax) {
        imid = rtl.trunc((imin + imax) / 2);
        LCompare = AComparer.Compare(AValues[imid],AItem);
        if (LCompare < 0) {
          imin = imid + 1}
         else {
          if (LCompare === 0) {
            AFoundIndex.set(imid);
            return true;
          };
          imax = imid;
        };
      };
      LCompare = AComparer.Compare(AValues[imin],AItem);
      Result = (imax === imin) && (LCompare === 0);
      if (Result) {
        AFoundIndex.set(imin)}
       else AFoundIndex.set(-1);
      return Result;
    };
  },"TArrayHelper<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassItem>");
  rtl.createClass(this,"TCustomList$$$G$$generics$collections$$TTMSFNCJSONToClassItem",this.TEnumerable$$$G$$generics$collections$$TTMSFNCJSONToClassItem,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $mod.$rtti.$DynArray("TCustomList<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassItem>.FItems$a",{eltype: pas["WEBLib.TMSFNCPersistence"].$rtti["TTMSFNCJSONToClassItem"]});
    };
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCJSONToClassItem.$init.call(this);
      this.FOnNotify = null;
      this.FLength = 0;
      this.FItems = [];
    };
    this.$final = function () {
      this.FOnNotify = undefined;
      this.FItems = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCJSONToClassItem.$final.call(this);
    };
    this.GetCapacity = function () {
      var Result = 0;
      Result = rtl.length(this.FItems);
      return Result;
    };
    this.PrepareAddingItem = function () {
      var Result = 0;
      if (this.FLength === rtl.length(this.FItems)) this.FItems.push(null);
      Result = this.FLength;
      this.FLength += 1;
      return Result;
    };
    this.PrepareAddingRange = function (ACount) {
      var Result = 0;
      var l = 0;
      if (ACount < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (ACount === 0) return this.FLength - 1;
      for (var $l = rtl.length(this.FItems) + 1, $end = this.FLength + ACount; $l <= $end; $l++) {
        l = $l;
        this.FItems.push(null);
      };
      Result = this.FLength;
      this.FLength += ACount;
      return Result;
    };
    this.Notify = function (AValue, ACollectionNotification) {
      if (this.FOnNotify != null) this.FOnNotify(this,AValue,ACollectionNotification);
    };
    this.DoRemove = function (AIndex, ACollectionNotification) {
      var Result = null;
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      this.FLength -= 1;
      this.FItems[AIndex] = null;
      this.FItems.splice(AIndex,1);
      this.Notify(Result,ACollectionNotification);
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FLength;
      return Result;
    };
  },"TCustomList<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassItem>");
  rtl.createClass(this,"TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCJSONToClassItem",this.TEnumerator$$$G$$generics$collections$$TTMSFNCJSONToClassItem,function () {
    this.$initSpec = function () {
    };
    this.$init = function () {
      $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCJSONToClassItem.$init.call(this);
      this.FList = null;
      this.FIndex = 0;
    };
    this.$final = function () {
      this.FList = undefined;
      $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCJSONToClassItem.$final.call(this);
    };
    this.DoMoveNext = function () {
      var Result = false;
      this.FIndex += 1;
      Result = (this.FList.FLength > 0) && (this.FIndex < this.FList.FLength);
      return Result;
    };
    this.DoGetCurrent = function () {
      var Result = null;
      Result = this.GetCurrent();
      return Result;
    };
    this.GetCurrent = function () {
      var Result = null;
      Result = this.FList.FItems[this.FIndex];
      return Result;
    };
    this.Create$1 = function (AList) {
      pas.System.TObject.Create.call(this);
      this.FIndex = -1;
      this.FList = AList;
      return this;
    };
  },"TCustomListEnumerator<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassItem>");
  rtl.createClass(this,"TList$$$G$$generics$collections$$TTMSFNCJSONToClassItem",this.TCustomList$$$G$$generics$collections$$TTMSFNCJSONToClassItem,function () {
    this.$initSpec = function () {
      rtl.createClass(this,"TEnumerator",$mod.TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCJSONToClassItem,function () {
      },"TList<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassItem>.TEnumerator");
    };
    this.$init = function () {
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCJSONToClassItem.$init.call(this);
      this.FComparer = null;
    };
    this.$final = function () {
      rtl.setIntfP(this,"FComparer",null);
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCJSONToClassItem.$final.call(this);
    };
    this.SameValue = function (Left, Right) {
      var Result = false;
      if (this.FComparer != null) {
        Result = this.FComparer.Compare(Left,Right) === 0}
       else Result = Left === Right;
      return Result;
    };
    this.SetCapacity = function (AValue) {
      if (AValue < this.FLength) this.SetCount(AValue);
      this.FItems = rtl.arraySetLength(this.FItems,null,AValue);
    };
    this.SetCount = function (AValue) {
      if (AValue < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (AValue > this.GetCapacity()) {
        this.SetCapacity(AValue)}
       else if (AValue < this.FLength) this.DeleteRange(AValue,this.FLength - AValue);
      this.FLength = AValue;
    };
    this.InitializeList = function () {
    };
    this.InternalInsert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.FItems.splice(AIndex,0,AValue);
      this.FLength += 1;
      this.FItems[AIndex] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.GetEnumerator$1();
      return Result;
    };
    this.GetItem = function (AIndex) {
      var Result = null;
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      return Result;
    };
    this.SetItem = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.Notify(this.FItems[AIndex],$mod.TCollectionNotification.cnRemoved);
      this.FItems[AIndex] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.Create$1 = function () {
      this.InitializeList();
      return this;
    };
    this.Create$2 = function (AComparer) {
      this.InitializeList();
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Create$3 = function (ACollection) {
      var LItem = null;
      this.Create$1();
      var $in = ACollection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LItem = $in.DoGetCurrent();
          this.Add(LItem);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Destroy = function () {
      this.SetCapacity(0);
    };
    this.Add = function (AValue) {
      var Result = 0;
      Result = this.PrepareAddingItem();
      this.FItems[Result] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
      return Result;
    };
    this.AddRange = function (AValues) {
      this.InsertRange(this.FLength,AValues);
    };
    this.AddRange$1 = function (AEnumerable) {
      var LValue = null;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.Add(LValue);
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.AddRange$2 = function (AEnumerable) {
      var LValue = null;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.Add(LValue);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Insert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.InternalInsert(AIndex,AValue);
    };
    this.InsertRange = function (AIndex, AValues) {
      var LLength = 0;
      var i = 0;
      var LValue = null;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LLength = rtl.length(AValues);
      if (LLength === 0) return;
      if (AIndex !== this.PrepareAddingRange(LLength)) {
        for (var $l = AIndex, $end = this.FLength - LLength - 1; $l <= $end; $l++) {
          i = $l;
          this.FItems[i + LLength] = this.FItems[i];
        };
        for (var $l1 = 0, $end1 = LLength - 1; $l1 <= $end1; $l1++) {
          i = $l1;
          this.FItems[AIndex + i] = null;
        };
      };
      for (var $l2 = 0, $end2 = LLength - 1; $l2 <= $end2; $l2++) {
        i = $l2;
        LValue = AValues[i];
        this.FItems[i + AIndex] = LValue;
        this.Notify(LValue,$mod.TCollectionNotification.cnAdded);
      };
    };
    this.InsertRange$1 = function (AIndex, AEnumerable) {
      var LValue = null;
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.InsertRange$2 = function (AIndex, AEnumerable) {
      var LValue = null;
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Remove = function (AValue) {
      var Result = 0;
      Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.RemoveItem = function (AValue, Direction) {
      var Result = 0;
      if (Direction === $mod.TDirection.fromEnd) {
        Result = this.LastIndexOf(AValue)}
       else Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.Delete = function (AIndex) {
      this.DoRemove(AIndex,$mod.TCollectionNotification.cnRemoved);
    };
    this.DeleteRange = function (AIndex, ACount) {
      var LDeleted = [];
      var i = 0;
      if (ACount === 0) return;
      if ((ACount < 0) || (AIndex < 0) || ((AIndex + ACount) > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LDeleted = this.FItems.splice(AIndex,this.FLength);
      this.FLength -= ACount;
      for (var $l = 0, $end = rtl.length(LDeleted) - 1; $l <= $end; $l++) {
        i = $l;
        this.Notify(LDeleted[i],$mod.TCollectionNotification.cnRemoved);
      };
    };
    this.ExtractIndex = function (AIndex) {
      var Result = null;
      Result = this.DoRemove(AIndex,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.Extract = function (AValue) {
      var Result = null;
      var LIndex = 0;
      LIndex = this.IndexOf(AValue);
      if (LIndex < 0) {
        Result = null}
       else Result = this.DoRemove(LIndex,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.Exchange = function (AIndex1, AIndex2) {
      var LTemp = null;
      LTemp = this.FItems[AIndex1];
      this.FItems[AIndex1] = this.FItems[AIndex2];
      this.FItems[AIndex2] = LTemp;
    };
    this.Move = function (AIndex, ANewIndex) {
      var Arr = null;
      var LTemp = undefined;
      var i = 0;
      if (ANewIndex === AIndex) return;
      if ((ANewIndex < 0) || (ANewIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Arr = this.FItems;
      LTemp = Arr[AIndex];
      if (AIndex < ANewIndex) {
        for (var $l = AIndex, $end = ANewIndex - 1; $l <= $end; $l++) {
          i = $l;
          Arr[i] = Arr[i + 1];
        }}
       else for (var $l1 = AIndex, $end1 = ANewIndex + 1; $l1 >= $end1; $l1--) {
        i = $l1;
        Arr[i] = Arr[i - 1];
      };
      Arr[ANewIndex] = LTemp;
    };
    this.First = function () {
      var Result = null;
      Result = this.GetItem(0);
      return Result;
    };
    this.Last = function () {
      var Result = null;
      Result = this.GetItem(this.FLength - 1);
      return Result;
    };
    this.Clear = function () {
      this.SetCount(0);
      this.SetCapacity(0);
    };
    this.Contains = function (AValue) {
      var Result = false;
      Result = this.IndexOf(AValue) >= 0;
      return Result;
    };
    this.IndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = 0, $end = this.FLength - 1; $l <= $end; $l++) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.LastIndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = this.FLength - 1; $l >= 0; $l--) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.Reverse = function () {
      var a = 0;
      var b = 0;
      var LTemp = null;
      a = 0;
      b = this.FLength - 1;
      while (a < b) {
        LTemp = this.FItems[a];
        this.FItems[a] = this.FItems[b];
        this.FItems[b] = LTemp;
        a += 1;
        b -= 1;
      };
    };
    this.TrimExcess = function () {
      this.SetCapacity(this.FLength);
    };
    this.Sort = function () {
      $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCJSONToClassItem.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},this.FComparer,0,this.FLength);
    };
    this.Sort$1 = function (AComparer) {
      $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCJSONToClassItem.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},AComparer,0,this.FLength);
    };
    this.BinarySearch = function (AItem, AIndex) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCJSONToClassItem.BinarySearch$1(this.FItems,AItem,AIndex,this.FComparer,0,this.FLength);
      return Result;
    };
    this.BinarySearch$1 = function (AItem, AIndex, AComparer) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCJSONToClassItem.BinarySearch$1(this.FItems,AItem,AIndex,AComparer,0,this.FLength);
      return Result;
    };
  },"TList<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassItem>");
  rtl.createClass(this,"TObjectList$$$G$$generics$collections$$TTMSFNCJSONToClassItem",this.TList$$$G$$generics$collections$$TTMSFNCJSONToClassItem,function () {
    this.$initSpec = function () {
    };
    this.$init = function () {
      $mod.TList$$$G$$generics$collections$$TTMSFNCJSONToClassItem.$init.call(this);
      this.FObjectsOwner = false;
    };
    this.Notify = function (aValue, Action) {
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCJSONToClassItem.Notify.call(this,aValue,Action);
      if (this.FObjectsOwner && (Action === $mod.TCollectionNotification.cnRemoved)) aValue = rtl.freeLoc(aValue);
    };
    this.Create$4 = function (aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCJSONToClassItem.Create$1.call(this);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
    this.Create$5 = function (AComparer, aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCJSONToClassItem.Create$2.call(this,AComparer);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
    this.Create$6 = function (aCollection, aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCJSONToClassItem.Create$3.call(this,aCollection);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
  },"TObjectList<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassItem>");
  rtl.recNewT(this,"TPair$$$G$$generics$collections$$String$$TIconData",function () {
    var $r = $mod.$rtti.$Record("TPair<System.String,WEBLib.DesignIntf.TIconData>",{},this);
    this.$initSpec = function () {
      this.Key = "";
      this.Value = null;
      $r.addField("Key",rtl.string);
      $r.addField("Value",pas["WEBLib.DesignIntf"].$rtti["TIconData"]);
      $r.addMethod("Create",2,[["AKey",rtl.string,2],["AValue",pas["WEBLib.DesignIntf"].$rtti["TIconData"],2]]);
    };
    this.$eq = function (b) {
      return (this.Key === b.Key) && (this.Value === b.Value);
    };
    this.$assign = function (s) {
      this.Key = s.Key;
      this.Value = s.Value;
      return this;
    };
    this.Create = function (AKey, AValue) {
      this.Key = AKey;
      this.Value = AValue;
      return this;
    };
  });
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TPair$System$String$WEBLib$DesignIntf$TIconData$",pas.System.TObject,function () {
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<Generics.Collections.TPair<System.String,WEBLib.DesignIntf.TIconData>>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TPair$System$String$WEBLib$DesignIntf$TIconData$",pas.System.TObject,function () {
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push($mod.TPair$$$G$$generics$collections$$String$$TIconData.$clone(LEnumerator.DoGetCurrent()));
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<Generics.Collections.TPair<System.String,WEBLib.DesignIntf.TIconData>>");
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TIconData",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<WEBLib.DesignIntf.TIconData>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TIconData",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push(LEnumerator.DoGetCurrent());
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<WEBLib.DesignIntf.TIconData>");
  this.$rtti.$MethodVar("TCollectionNotifyEvent<WEBLib.DesignIntf.TIconData>",{init: function () {
      this.procsig = rtl.newTIProcSig([["ASender",pas.System.$rtti["TObject"]],["AItem",pas["WEBLib.DesignIntf"].$rtti["TIconData"],2],["AAction",$mod.$rtti["TCollectionNotification"]]]);
    }, methodkind: 0});
  rtl.createClass(this,"TDictionary$$$G$$generics$collections$$String$$TIconData",this.TEnumerable$$$G$$generics$collections$$TPair$System$String$WEBLib$DesignIntf$TIconData$,function () {
    this.$initSpec = function () {
      rtl.createClass(this,"TPairEnumerator",$mod.TEnumerator$$$G$$generics$collections$$TPair$System$String$WEBLib$DesignIntf$TIconData$,function () {
        this.$init = function () {
          $mod.TEnumerator$$$G$$generics$collections$$TPair$System$String$WEBLib$DesignIntf$TIconData$.$init.call(this);
          this.FIter = null;
          this.FVal = null;
        };
        this.$final = function () {
          this.FIter = undefined;
          this.FVal = undefined;
          $mod.TEnumerator$$$G$$generics$collections$$TPair$System$String$WEBLib$DesignIntf$TIconData$.$final.call(this);
        };
        this.GetCurrent = function () {
          var Result = $mod.TPair$$$G$$generics$collections$$String$$TIconData.$new();
          Result.$assign(this.DoGetCurrent());
          return Result;
        };
        this.DoGetCurrent = function () {
          var Result = $mod.TPair$$$G$$generics$collections$$String$$TIconData.$new();
          var A = [];
          A = this.FVal.value;
          Result.$assign($mod.TPair$$$G$$generics$collections$$String$$TIconData.$new());
          Result.Create("" + A[0],rtl.getObject(A[1]));
          return Result;
        };
        this.DoMoveNext = function () {
          var Result = false;
          this.FVal = this.FIter.next();
          Result = !this.FVal.done;
          return Result;
        };
        this.Create$1 = function (ADictionary) {
          this.FIter = ADictionary.FMap.entries();
          return this;
        };
        this.MoveNext$1 = function () {
          var Result = false;
          Result = this.DoMoveNext();
          return Result;
        };
      },"TDictionary<System.String,WEBLib.DesignIntf.TIconData>.TPairEnumerator");
      rtl.createClass(this,"TKeyEnumerator",$mod.TEnumerator$$$G$$generics$collections$$String,function () {
        this.$init = function () {
          $mod.TEnumerator$$$G$$generics$collections$$String.$init.call(this);
          this.FIter = null;
          this.FVal = null;
        };
        this.$final = function () {
          this.FIter = undefined;
          this.FVal = undefined;
          $mod.TEnumerator$$$G$$generics$collections$$String.$final.call(this);
        };
        this.GetCurrent = function () {
          var Result = "";
          Result = this.DoGetCurrent();
          return Result;
        };
        this.DoGetCurrent = function () {
          var Result = "";
          Result = "" + this.FVal.value;
          return Result;
        };
        this.DoMoveNext = function () {
          var Result = false;
          this.FVal = this.FIter.next();
          Result = !this.FVal.done;
          return Result;
        };
        this.Create$1 = function (AIter) {
          this.FIter = AIter;
          return this;
        };
        this.Create$2 = function (ADictionary) {
          this.Create$1(ADictionary.FMap.keys());
          return this;
        };
        this.MoveNext$1 = function () {
          var Result = false;
          Result = this.DoMoveNext();
          return Result;
        };
      },"TDictionary<System.String,WEBLib.DesignIntf.TIconData>.TKeyEnumerator");
      rtl.createClass(this,"TValueEnumerator",$mod.TEnumerator$$$G$$generics$collections$$TIconData,function () {
        this.$init = function () {
          $mod.TEnumerator$$$G$$generics$collections$$TIconData.$init.call(this);
          this.FIter = null;
          this.FVal = null;
        };
        this.$final = function () {
          this.FIter = undefined;
          this.FVal = undefined;
          $mod.TEnumerator$$$G$$generics$collections$$TIconData.$final.call(this);
        };
        this.GetCurrent = function () {
          var Result = null;
          Result = this.DoGetCurrent();
          return Result;
        };
        this.DoGetCurrent = function () {
          var Result = null;
          Result = rtl.getObject(this.FVal.value);
          return Result;
        };
        this.DoMoveNext = function () {
          var Result = false;
          this.FVal = this.FIter.next();
          Result = !this.FVal.done;
          return Result;
        };
        this.Create$1 = function (AIter) {
          this.FIter = AIter;
          return this;
        };
        this.Create$2 = function (ADictionary) {
          this.Create$1(ADictionary.FMap.values());
          return this;
        };
        this.MoveNext$1 = function () {
          var Result = false;
          Result = this.DoMoveNext();
          return Result;
        };
      },"TDictionary<System.String,WEBLib.DesignIntf.TIconData>.TValueEnumerator");
      rtl.createClass(this,"TValueCollection",$mod.TEnumerable$$$G$$generics$collections$$TIconData,function () {
        this.$init = function () {
          $mod.TEnumerable$$$G$$generics$collections$$TIconData.$init.call(this);
          this.FMap = null;
        };
        this.$final = function () {
          this.FMap = undefined;
          $mod.TEnumerable$$$G$$generics$collections$$TIconData.$final.call(this);
        };
        this.GetCount = function () {
          var Result = 0;
          Result = this.FMap.size;
          return Result;
        };
        this.DoGetEnumerator = function () {
          var Result = null;
          Result = $mod.TDictionary$$$G$$generics$collections$$String$$TIconData.TValueEnumerator.$create("Create$1",[this.FMap.values()]);
          return Result;
        };
        this.Create$1 = function (ADictionary) {
          this.FMap = ADictionary.FMap;
          return this;
        };
        this.GetEnumerator$1 = function () {
          var Result = null;
          Result = this.DoGetEnumerator();
          return Result;
        };
        this.ToArray = function () {
          var Result = [];
          var I = 0;
          var P = null;
          Result = rtl.arraySetLength(Result,null,this.FMap.size);
          var $in = this.GetEnumerator$1();
          try {
            while ($in.MoveNext$1()) {
              P = $in.GetCurrent();
              Result[I] = P;
              I += 1;
            }
          } finally {
            $in = rtl.freeLoc($in)
          };
          return Result;
        };
      },"TDictionary<System.String,WEBLib.DesignIntf.TIconData>.TValueCollection");
      rtl.createClass(this,"TKeyCollection",$mod.TEnumerable$$$G$$generics$collections$$String,function () {
        this.$init = function () {
          $mod.TEnumerable$$$G$$generics$collections$$String.$init.call(this);
          this.FMap = null;
        };
        this.$final = function () {
          this.FMap = undefined;
          $mod.TEnumerable$$$G$$generics$collections$$String.$final.call(this);
        };
        this.GetCount = function () {
          var Result = 0;
          Result = this.FMap.size;
          return Result;
        };
        this.DoGetEnumerator = function () {
          var Result = null;
          Result = this.GetEnumerator$1();
          return Result;
        };
        this.Create$1 = function (ADictionary) {
          this.FMap = ADictionary.FMap;
          return this;
        };
        this.GetEnumerator$1 = function () {
          var Result = null;
          Result = $mod.TDictionary$$$G$$generics$collections$$String$$TIconData.TKeyEnumerator.$create("Create$1",[this.FMap.keys()]);
          return Result;
        };
        this.ToArray = function () {
          var Result = [];
          Result = $mod.TEnumerable$$$G$$generics$collections$$String.ToArray.call(this);
          return Result;
        };
      },"TDictionary<System.String,WEBLib.DesignIntf.TIconData>.TKeyCollection");
    };
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$TPair$System$String$WEBLib$DesignIntf$TIconData$.$init.call(this);
      this.FMap = null;
      this.FComparer = null;
      this.FOnKeyNotify = null;
      this.FOnValueNotify = null;
      this.FKeyCollection = null;
      this.FValueCollection = null;
    };
    this.$final = function () {
      this.FMap = undefined;
      rtl.setIntfP(this,"FComparer",null);
      this.FOnKeyNotify = undefined;
      this.FOnValueNotify = undefined;
      this.FKeyCollection = undefined;
      this.FValueCollection = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$TPair$System$String$WEBLib$DesignIntf$TIconData$.$final.call(this);
    };
    this.GetEffectiveKey = function (Key) {
      var Result = "";
      var it = null;
      var v = null;
      if (!(this.FComparer != null)) return Key;
      it = this.FMap.keys();
      v = it.next();
      while (!v.done) {
        Result = "" + v.value;
        if (this.FComparer.Compare(Result,Key) === 0) return Result;
        v = it.next();
      };
      Result = Key;
      return Result;
    };
    this.GetItem = function (Key) {
      var Result = null;
      var V = undefined;
      V = this.FMap.get(this.GetEffectiveKey(Key));
      if (pas.JS.isUndefined(V)) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictKeyNotFound")]);
      Result = rtl.getObject(V);
      return Result;
    };
    this.SetItem = function (Key, Value) {
      var V = undefined;
      V = this.FMap.get(this.GetEffectiveKey(Key));
      if (!pas.JS.isUndefined(V)) this.ValueNotify(rtl.getObject(V),$mod.TCollectionNotification.cnRemoved);
      this.FMap.set(Key,Value);
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoAdd = function (Key, Value) {
      this.FMap.set(this.GetEffectiveKey(Key),Value);
      this.KeyNotify(Key,$mod.TCollectionNotification.cnAdded);
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoRemove = function (Key, Notification) {
      var Result = null;
      var V = undefined;
      var K = "";
      K = this.GetEffectiveKey(Key);
      V = this.FMap.get(K);
      if (!pas.JS.isUndefined(V)) {
        this.FMap.delete(K);
        Result = rtl.getObject(V);
        this.KeyNotify(Key,Notification);
        this.ValueNotify(Result,Notification);
      };
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FMap.size;
      return Result;
    };
    this.CanClearMap = function () {
      var Result = false;
      Result = (this.FOnKeyNotify === null) && (this.FOnValueNotify === null);
      return Result;
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.PairNotify = function (Key, Value, Action) {
      this.KeyNotify(Key,Action);
      this.ValueNotify(Value,Action);
    };
    this.KeyNotify = function (Key, Action) {
      if (this.FOnKeyNotify != null) this.FOnKeyNotify(this,Key,Action);
    };
    this.ValueNotify = function (Value, Action) {
      if (this.FOnValueNotify != null) this.FOnValueNotify(this,Value,Action);
    };
    this.Create$1 = function (ACapacity) {
      this.FMap = new Map();
      if (ACapacity > 0) ;
      return this;
    };
    this.Create$2 = function (Collection) {
      var aPair = $mod.TPair$$$G$$generics$collections$$String$$TIconData.$new();
      this.Create$1(0);
      var $in = Collection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          aPair = $in.DoGetCurrent();
          this.Add(aPair.Key,aPair.Value);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Create$3 = function (AComparer) {
      this.Create$1(0);
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FKeyCollection;
        }, set: function (v) {
          this.p.FKeyCollection = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FValueCollection;
        }, set: function (v) {
          this.p.FValueCollection = v;
        }});
      this.Clear();
      this.FMap = null;
      pas.System.TObject.Destroy.call(this);
    };
    this.Add = function (Key, Value) {
      if (this.FMap.has(this.GetEffectiveKey(Key))) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictDuplicateKey")]);
      this.DoAdd(Key,Value);
    };
    this.Remove = function (Key) {
      this.DoRemove(Key,$mod.TCollectionNotification.cnRemoved);
    };
    this.ExtractPair = function (Key) {
      var Result = $mod.TPair$$$G$$generics$collections$$String$$TIconData.$new();
      var K = "";
      Result.$assign($mod.TPair$$$G$$generics$collections$$String$$TIconData.$new());
      K = this.GetEffectiveKey(Key);
      if (this.FMap.has(K)) {
        Result.Create(Key,rtl.getObject(this.FMap.get(K)));
        this.FMap.delete(K);
      } else Result.Create(Key,null);
      return Result;
    };
    this.Clear = function () {
      var Iter = null;
      var IVal = null;
      var A = [];
      var K = "";
      var V = null;
      if (this.CanClearMap()) {
        this.FMap.clear()}
       else {
        Iter = this.FMap.entries();
        do {
          IVal = Iter.next();
          if (!IVal.done) {
            A = IVal.value;
            K = "" + A[0];
            V = rtl.getObject(A[1]);
            this.FMap.delete(K);
            this.PairNotify(K,V,$mod.TCollectionNotification.cnRemoved);
          };
        } while (!IVal.done);
      };
    };
    this.TryGetValue = function (Key, Value) {
      var Result = false;
      var K = "";
      K = this.GetEffectiveKey(Key);
      Result = this.FMap.has(K);
      if (Result) Value.set(rtl.getObject(this.FMap.get(K)));
      return Result;
    };
    this.AddOrSetValue = function (Key, Value) {
      var k = "";
      k = this.GetEffectiveKey(Key);
      if (!this.FMap.has(k)) {
        this.DoAdd(Key,Value)}
       else this.SetItem(k,Value);
    };
    this.ContainsKey = function (Key) {
      var Result = false;
      Result = this.FMap.has(this.GetEffectiveKey(Key));
      return Result;
    };
    this.ContainsValue = function (Value) {
      var Result = false;
      var It = null;
      var Res = null;
      Result = false;
      It = this.FMap.values();
      do {
        Res = It.next();
        if (!Res.done) Result = Value === rtl.getObject(Res.value);
      } while (!(Result || Res.done));
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      Result = $mod.TEnumerable$$$G$$generics$collections$$TPair$System$String$WEBLib$DesignIntf$TIconData$.ToArray.call(this);
      return Result;
    };
    this.GetKeys = function () {
      var Result = null;
      if (this.FKeyCollection === null) this.FKeyCollection = this.TKeyCollection.$create("Create$1",[this]);
      Result = this.FKeyCollection;
      return Result;
    };
    this.GetValues = function () {
      var Result = null;
      if (this.FValueCollection === null) this.FValueCollection = this.TValueCollection.$create("Create$1",[this]);
      Result = this.FValueCollection;
      return Result;
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
  },"TDictionary<System.String,WEBLib.DesignIntf.TIconData>");
  rtl.createClass(this,"TObjectDictionary$$$G$$generics$collections$$String$$TIconData",this.TDictionary$$$G$$generics$collections$$String$$TIconData,function () {
    this.$initSpec = function () {
    };
    this.$init = function () {
      $mod.TDictionary$$$G$$generics$collections$$String$$TIconData.$init.call(this);
      this.FOwnerships = {};
    };
    this.$final = function () {
      this.FOwnerships = undefined;
      $mod.TDictionary$$$G$$generics$collections$$String$$TIconData.$final.call(this);
    };
    this.CanClearMap = function () {
      var Result = false;
      Result = $mod.TDictionary$$$G$$generics$collections$$String$$TIconData.CanClearMap.call(this) && rtl.eqSet(this.FOwnerships,{});
      return Result;
    };
    this.KeyNotify = function (Key, Action) {
      $mod.TDictionary$$$G$$generics$collections$$String$$TIconData.KeyNotify.call(this,Key,Action);
      if (($mod.TDictionaryOwnership.doOwnsKeys in this.FOwnerships) && (Action === $mod.TCollectionNotification.cnRemoved)) Key = rtl.freeLoc(Key);
    };
    this.ValueNotify = function (Value, Action) {
      $mod.TDictionary$$$G$$generics$collections$$String$$TIconData.ValueNotify.call(this,Value,Action);
      if (($mod.TDictionaryOwnership.doOwnsValues in this.FOwnerships) && (Action === $mod.TCollectionNotification.cnRemoved)) Value = rtl.freeLoc(Value);
    };
    this.Create$4 = function (aOwnerships, ACapacity) {
      this.FOwnerships = rtl.refSet(aOwnerships);
      $mod.TDictionary$$$G$$generics$collections$$String$$TIconData.Create$1.call(this,ACapacity);
      return this;
    };
    this.Create$5 = function (aOwnerships) {
      $mod.TDictionary$$$G$$generics$collections$$String$$TIconData.Create$1.call(this,0);
      this.FOwnerships = rtl.refSet(aOwnerships);
      return this;
    };
  },"TObjectDictionary<System.String,WEBLib.DesignIntf.TIconData>");
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<WEBLib.TMSFNCFilterDialog.TTMSFNCFilterDialogDrawItem>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push(LEnumerator.DoGetCurrent());
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<WEBLib.TMSFNCFilterDialog.TTMSFNCFilterDialogDrawItem>");
  this.$rtti.$MethodVar("TCollectionNotifyEvent<WEBLib.TMSFNCFilterDialog.TTMSFNCFilterDialogDrawItem>",{init: function () {
      this.procsig = rtl.newTIProcSig([["ASender",pas.System.$rtti["TObject"]],["AItem",pas["WEBLib.TMSFNCFilterDialog"].$rtti["TTMSFNCFilterDialogDrawItem"],2],["AAction",$mod.$rtti["TCollectionNotification"]]]);
    }, methodkind: 0});
  rtl.createClass(this,"TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.Sort = function (AValues, AComparer) {
      this.Sort$1(AValues,AComparer,0,rtl.length(AValues.get()));
    };
    this.Sort$1 = function (AValues, AComparer, AIndex, ACount) {
      if (ACount <= 1) return;
      this.QuickSort(AValues,AIndex,(AIndex + ACount) - 1,AComparer);
    };
    this.BinarySearch$2 = function (AValues, AItem, AFoundIndex, AComparer) {
      var Result = false;
      Result = this.BinarySearch$1(AValues,AItem,AFoundIndex,AComparer,0,rtl.length(AValues));
      return Result;
    };
    this.BinarySearch$3 = function (AValues, AItem, ASearchResult, AComparer) {
      var Result = false;
      Result = this.BinarySearch(AValues,AItem,ASearchResult,AComparer,0,rtl.length(AValues));
      return Result;
    };
  },"TCustomArrayHelper<WEBLib.TMSFNCFilterDialog.TTMSFNCFilterDialogDrawItem>");
  rtl.createClass(this,"TArrayHelper$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem",this.TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem,function () {
    this.$initSpec = function () {
    };
    this.QuickSort = function (AValues, ALeft, ARight, AComparer) {
      var I = 0;
      var J = 0;
      var P = null;
      var Q = null;
      if (((ARight - ALeft) <= 0) || (rtl.length(AValues.get()) === 0)) return;
      do {
        I = ALeft;
        J = ARight;
        P = AValues.get()[ALeft + Math.floor((ARight - ALeft) / 2)];
        do {
          while (AComparer.Compare(AValues.get()[I],P) < 0) I += 1;
          while (AComparer.Compare(AValues.get()[J],P) > 0) J -= 1;
          if (I <= J) {
            if (I !== J) {
              Q = AValues.get()[I];
              AValues.get()[I] = AValues.get()[J];
              AValues.get()[J] = Q;
            };
            I += 1;
            J -= 1;
          };
        } while (!(I > J));
        if ((J - ALeft) < (ARight - I)) {
          if (ALeft < J) this.QuickSort(AValues,ALeft,J,AComparer);
          ALeft = I;
        } else {
          if (I < ARight) this.QuickSort(AValues,I,ARight,AComparer);
          ARight = J;
        };
      } while (!(ALeft >= ARight));
    };
    this.BinarySearch = function (AValues, AItem, ASearchResult, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var ilo = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      ilo = imid * imid;
      imid = ilo * imid;
      while (imin < imax) {
        imid = rtl.trunc((imax + imin) / 2);
        ASearchResult.CompareResult = AComparer.Compare(AValues[imid],AItem);
        if (ASearchResult.CompareResult < 0) {
          imin = imid + 1}
         else {
          if (ASearchResult.CompareResult === 0) {
            ASearchResult.FoundIndex = imid;
            ASearchResult.CandidateIndex = imid;
            return true;
          };
          imax = imid;
        };
      };
      Result = imax === imin;
      if (Result) {
        ASearchResult.CompareResult = AComparer.Compare(AValues[imin],AItem);
        ASearchResult.CandidateIndex = imin;
        Result = ASearchResult.CompareResult === 0;
        if (Result) {
          ASearchResult.FoundIndex = imin}
         else ASearchResult.FoundIndex = -1;
      } else {
        ASearchResult.CompareResult = 0;
        ASearchResult.FoundIndex = -1;
        ASearchResult.CandidateIndex = -1;
      };
      return Result;
    };
    this.BinarySearch$1 = function (AValues, AItem, AFoundIndex, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var LCompare = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      while (imin < imax) {
        imid = rtl.trunc((imin + imax) / 2);
        LCompare = AComparer.Compare(AValues[imid],AItem);
        if (LCompare < 0) {
          imin = imid + 1}
         else {
          if (LCompare === 0) {
            AFoundIndex.set(imid);
            return true;
          };
          imax = imid;
        };
      };
      LCompare = AComparer.Compare(AValues[imin],AItem);
      Result = (imax === imin) && (LCompare === 0);
      if (Result) {
        AFoundIndex.set(imin)}
       else AFoundIndex.set(-1);
      return Result;
    };
  },"TArrayHelper<WEBLib.TMSFNCFilterDialog.TTMSFNCFilterDialogDrawItem>");
  rtl.createClass(this,"TCustomList$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem",this.TEnumerable$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $mod.$rtti.$DynArray("TCustomList<WEBLib.TMSFNCFilterDialog.TTMSFNCFilterDialogDrawItem>.FItems$a",{eltype: pas["WEBLib.TMSFNCFilterDialog"].$rtti["TTMSFNCFilterDialogDrawItem"]});
    };
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem.$init.call(this);
      this.FOnNotify = null;
      this.FLength = 0;
      this.FItems = [];
    };
    this.$final = function () {
      this.FOnNotify = undefined;
      this.FItems = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem.$final.call(this);
    };
    this.GetCapacity = function () {
      var Result = 0;
      Result = rtl.length(this.FItems);
      return Result;
    };
    this.PrepareAddingItem = function () {
      var Result = 0;
      if (this.FLength === rtl.length(this.FItems)) this.FItems.push(null);
      Result = this.FLength;
      this.FLength += 1;
      return Result;
    };
    this.PrepareAddingRange = function (ACount) {
      var Result = 0;
      var l = 0;
      if (ACount < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (ACount === 0) return this.FLength - 1;
      for (var $l = rtl.length(this.FItems) + 1, $end = this.FLength + ACount; $l <= $end; $l++) {
        l = $l;
        this.FItems.push(null);
      };
      Result = this.FLength;
      this.FLength += ACount;
      return Result;
    };
    this.Notify = function (AValue, ACollectionNotification) {
      if (this.FOnNotify != null) this.FOnNotify(this,AValue,ACollectionNotification);
    };
    this.DoRemove = function (AIndex, ACollectionNotification) {
      var Result = null;
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      this.FLength -= 1;
      this.FItems[AIndex] = null;
      this.FItems.splice(AIndex,1);
      this.Notify(Result,ACollectionNotification);
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FLength;
      return Result;
    };
  },"TCustomList<WEBLib.TMSFNCFilterDialog.TTMSFNCFilterDialogDrawItem>");
  rtl.createClass(this,"TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem",this.TEnumerator$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem,function () {
    this.$initSpec = function () {
    };
    this.$init = function () {
      $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem.$init.call(this);
      this.FList = null;
      this.FIndex = 0;
    };
    this.$final = function () {
      this.FList = undefined;
      $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem.$final.call(this);
    };
    this.DoMoveNext = function () {
      var Result = false;
      this.FIndex += 1;
      Result = (this.FList.FLength > 0) && (this.FIndex < this.FList.FLength);
      return Result;
    };
    this.DoGetCurrent = function () {
      var Result = null;
      Result = this.GetCurrent();
      return Result;
    };
    this.GetCurrent = function () {
      var Result = null;
      Result = this.FList.FItems[this.FIndex];
      return Result;
    };
    this.Create$1 = function (AList) {
      pas.System.TObject.Create.call(this);
      this.FIndex = -1;
      this.FList = AList;
      return this;
    };
  },"TCustomListEnumerator<WEBLib.TMSFNCFilterDialog.TTMSFNCFilterDialogDrawItem>");
  rtl.createClass(this,"TList$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem",this.TCustomList$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem,function () {
    this.$initSpec = function () {
      rtl.createClass(this,"TEnumerator",$mod.TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem,function () {
      },"TList<WEBLib.TMSFNCFilterDialog.TTMSFNCFilterDialogDrawItem>.TEnumerator");
    };
    this.$init = function () {
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem.$init.call(this);
      this.FComparer = null;
    };
    this.$final = function () {
      rtl.setIntfP(this,"FComparer",null);
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem.$final.call(this);
    };
    this.SameValue = function (Left, Right) {
      var Result = false;
      if (this.FComparer != null) {
        Result = this.FComparer.Compare(Left,Right) === 0}
       else Result = Left === Right;
      return Result;
    };
    this.SetCapacity = function (AValue) {
      if (AValue < this.FLength) this.SetCount(AValue);
      this.FItems = rtl.arraySetLength(this.FItems,null,AValue);
    };
    this.SetCount = function (AValue) {
      if (AValue < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (AValue > this.GetCapacity()) {
        this.SetCapacity(AValue)}
       else if (AValue < this.FLength) this.DeleteRange(AValue,this.FLength - AValue);
      this.FLength = AValue;
    };
    this.InitializeList = function () {
    };
    this.InternalInsert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.FItems.splice(AIndex,0,AValue);
      this.FLength += 1;
      this.FItems[AIndex] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.GetEnumerator$1();
      return Result;
    };
    this.GetItem = function (AIndex) {
      var Result = null;
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      return Result;
    };
    this.SetItem = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.Notify(this.FItems[AIndex],$mod.TCollectionNotification.cnRemoved);
      this.FItems[AIndex] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.Create$1 = function () {
      this.InitializeList();
      return this;
    };
    this.Create$2 = function (AComparer) {
      this.InitializeList();
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Create$3 = function (ACollection) {
      var LItem = null;
      this.Create$1();
      var $in = ACollection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LItem = $in.DoGetCurrent();
          this.Add(LItem);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Destroy = function () {
      this.SetCapacity(0);
    };
    this.Add = function (AValue) {
      var Result = 0;
      Result = this.PrepareAddingItem();
      this.FItems[Result] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
      return Result;
    };
    this.AddRange = function (AValues) {
      this.InsertRange(this.FLength,AValues);
    };
    this.AddRange$1 = function (AEnumerable) {
      var LValue = null;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.Add(LValue);
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.AddRange$2 = function (AEnumerable) {
      var LValue = null;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.Add(LValue);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Insert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.InternalInsert(AIndex,AValue);
    };
    this.InsertRange = function (AIndex, AValues) {
      var LLength = 0;
      var i = 0;
      var LValue = null;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LLength = rtl.length(AValues);
      if (LLength === 0) return;
      if (AIndex !== this.PrepareAddingRange(LLength)) {
        for (var $l = AIndex, $end = this.FLength - LLength - 1; $l <= $end; $l++) {
          i = $l;
          this.FItems[i + LLength] = this.FItems[i];
        };
        for (var $l1 = 0, $end1 = LLength - 1; $l1 <= $end1; $l1++) {
          i = $l1;
          this.FItems[AIndex + i] = null;
        };
      };
      for (var $l2 = 0, $end2 = LLength - 1; $l2 <= $end2; $l2++) {
        i = $l2;
        LValue = AValues[i];
        this.FItems[i + AIndex] = LValue;
        this.Notify(LValue,$mod.TCollectionNotification.cnAdded);
      };
    };
    this.InsertRange$1 = function (AIndex, AEnumerable) {
      var LValue = null;
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.InsertRange$2 = function (AIndex, AEnumerable) {
      var LValue = null;
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Remove = function (AValue) {
      var Result = 0;
      Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.RemoveItem = function (AValue, Direction) {
      var Result = 0;
      if (Direction === $mod.TDirection.fromEnd) {
        Result = this.LastIndexOf(AValue)}
       else Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.Delete = function (AIndex) {
      this.DoRemove(AIndex,$mod.TCollectionNotification.cnRemoved);
    };
    this.DeleteRange = function (AIndex, ACount) {
      var LDeleted = [];
      var i = 0;
      if (ACount === 0) return;
      if ((ACount < 0) || (AIndex < 0) || ((AIndex + ACount) > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LDeleted = this.FItems.splice(AIndex,this.FLength);
      this.FLength -= ACount;
      for (var $l = 0, $end = rtl.length(LDeleted) - 1; $l <= $end; $l++) {
        i = $l;
        this.Notify(LDeleted[i],$mod.TCollectionNotification.cnRemoved);
      };
    };
    this.ExtractIndex = function (AIndex) {
      var Result = null;
      Result = this.DoRemove(AIndex,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.Extract = function (AValue) {
      var Result = null;
      var LIndex = 0;
      LIndex = this.IndexOf(AValue);
      if (LIndex < 0) {
        Result = null}
       else Result = this.DoRemove(LIndex,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.Exchange = function (AIndex1, AIndex2) {
      var LTemp = null;
      LTemp = this.FItems[AIndex1];
      this.FItems[AIndex1] = this.FItems[AIndex2];
      this.FItems[AIndex2] = LTemp;
    };
    this.Move = function (AIndex, ANewIndex) {
      var Arr = null;
      var LTemp = undefined;
      var i = 0;
      if (ANewIndex === AIndex) return;
      if ((ANewIndex < 0) || (ANewIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Arr = this.FItems;
      LTemp = Arr[AIndex];
      if (AIndex < ANewIndex) {
        for (var $l = AIndex, $end = ANewIndex - 1; $l <= $end; $l++) {
          i = $l;
          Arr[i] = Arr[i + 1];
        }}
       else for (var $l1 = AIndex, $end1 = ANewIndex + 1; $l1 >= $end1; $l1--) {
        i = $l1;
        Arr[i] = Arr[i - 1];
      };
      Arr[ANewIndex] = LTemp;
    };
    this.First = function () {
      var Result = null;
      Result = this.GetItem(0);
      return Result;
    };
    this.Last = function () {
      var Result = null;
      Result = this.GetItem(this.FLength - 1);
      return Result;
    };
    this.Clear = function () {
      this.SetCount(0);
      this.SetCapacity(0);
    };
    this.Contains = function (AValue) {
      var Result = false;
      Result = this.IndexOf(AValue) >= 0;
      return Result;
    };
    this.IndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = 0, $end = this.FLength - 1; $l <= $end; $l++) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.LastIndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = this.FLength - 1; $l >= 0; $l--) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.Reverse = function () {
      var a = 0;
      var b = 0;
      var LTemp = null;
      a = 0;
      b = this.FLength - 1;
      while (a < b) {
        LTemp = this.FItems[a];
        this.FItems[a] = this.FItems[b];
        this.FItems[b] = LTemp;
        a += 1;
        b -= 1;
      };
    };
    this.TrimExcess = function () {
      this.SetCapacity(this.FLength);
    };
    this.Sort = function () {
      $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},this.FComparer,0,this.FLength);
    };
    this.Sort$1 = function (AComparer) {
      $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},AComparer,0,this.FLength);
    };
    this.BinarySearch = function (AItem, AIndex) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem.BinarySearch$1(this.FItems,AItem,AIndex,this.FComparer,0,this.FLength);
      return Result;
    };
    this.BinarySearch$1 = function (AItem, AIndex, AComparer) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem.BinarySearch$1(this.FItems,AItem,AIndex,AComparer,0,this.FLength);
      return Result;
    };
  },"TList<WEBLib.TMSFNCFilterDialog.TTMSFNCFilterDialogDrawItem>");
  rtl.createClass(this,"TObjectList$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem",this.TList$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem,function () {
    this.$initSpec = function () {
    };
    this.$init = function () {
      $mod.TList$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem.$init.call(this);
      this.FObjectsOwner = false;
    };
    this.Notify = function (aValue, Action) {
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem.Notify.call(this,aValue,Action);
      if (this.FObjectsOwner && (Action === $mod.TCollectionNotification.cnRemoved)) aValue = rtl.freeLoc(aValue);
    };
    this.Create$4 = function (aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem.Create$1.call(this);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
    this.Create$5 = function (AComparer, aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem.Create$2.call(this,AComparer);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
    this.Create$6 = function (aCollection, aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem.Create$3.call(this,aCollection);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
  },"TObjectList<WEBLib.TMSFNCFilterDialog.TTMSFNCFilterDialogDrawItem>");
  rtl.recNewT(this,"TPair$$$G$$generics$collections$$Longint$$TTMSFNCDataGridCellItem",function () {
    var $r = $mod.$rtti.$Record("TPair<System.Longint,WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellItem>",{},this);
    this.$initSpec = function () {
      this.Key = 0;
      this.Value = null;
      $r.addField("Key",rtl.longint);
      $r.addField("Value",pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCellItem"]);
      $r.addMethod("Create",2,[["AKey",rtl.longint,2],["AValue",pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCellItem"],2]]);
    };
    this.$eq = function (b) {
      return (this.Key === b.Key) && (this.Value === b.Value);
    };
    this.$assign = function (s) {
      this.Key = s.Key;
      this.Value = s.Value;
      return this;
    };
    this.Create = function (AKey, AValue) {
      this.Key = AKey;
      this.Value = AValue;
      return this;
    };
  });
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TPair$System$Longint$WEBLib$TMSFNCDataGridCell$TTMSFNCDataGridCellItem$",pas.System.TObject,function () {
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<Generics.Collections.TPair<System.Longint,WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellItem>>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TPair$System$Longint$WEBLib$TMSFNCDataGridCell$TTMSFNCDataGridCellItem$",pas.System.TObject,function () {
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push($mod.TPair$$$G$$generics$collections$$Longint$$TTMSFNCDataGridCellItem.$clone(LEnumerator.DoGetCurrent()));
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<Generics.Collections.TPair<System.Longint,WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellItem>>");
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCellItem",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellItem>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridCellItem",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push(LEnumerator.DoGetCurrent());
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellItem>");
  this.$rtti.$MethodVar("TCollectionNotifyEvent<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellItem>",{init: function () {
      this.procsig = rtl.newTIProcSig([["ASender",pas.System.$rtti["TObject"]],["AItem",pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCellItem"],2],["AAction",$mod.$rtti["TCollectionNotification"]]]);
    }, methodkind: 0});
  rtl.createClass(this,"TDictionary$$$G$$generics$collections$$Longint$$TTMSFNCDataGridCellItem",this.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$WEBLib$TMSFNCDataGridCell$TTMSFNCDataGridCellItem$,function () {
    this.$initSpec = function () {
      rtl.createClass(this,"TPairEnumerator",$mod.TEnumerator$$$G$$generics$collections$$TPair$System$Longint$WEBLib$TMSFNCDataGridCell$TTMSFNCDataGridCellItem$,function () {
        this.$init = function () {
          $mod.TEnumerator$$$G$$generics$collections$$TPair$System$Longint$WEBLib$TMSFNCDataGridCell$TTMSFNCDataGridCellItem$.$init.call(this);
          this.FIter = null;
          this.FVal = null;
        };
        this.$final = function () {
          this.FIter = undefined;
          this.FVal = undefined;
          $mod.TEnumerator$$$G$$generics$collections$$TPair$System$Longint$WEBLib$TMSFNCDataGridCell$TTMSFNCDataGridCellItem$.$final.call(this);
        };
        this.GetCurrent = function () {
          var Result = $mod.TPair$$$G$$generics$collections$$Longint$$TTMSFNCDataGridCellItem.$new();
          Result.$assign(this.DoGetCurrent());
          return Result;
        };
        this.DoGetCurrent = function () {
          var Result = $mod.TPair$$$G$$generics$collections$$Longint$$TTMSFNCDataGridCellItem.$new();
          var A = [];
          A = this.FVal.value;
          Result.$assign($mod.TPair$$$G$$generics$collections$$Longint$$TTMSFNCDataGridCellItem.$new());
          Result.Create(rtl.trunc(A[0]),rtl.getObject(A[1]));
          return Result;
        };
        this.DoMoveNext = function () {
          var Result = false;
          this.FVal = this.FIter.next();
          Result = !this.FVal.done;
          return Result;
        };
        this.Create$1 = function (ADictionary) {
          this.FIter = ADictionary.FMap.entries();
          return this;
        };
        this.MoveNext$1 = function () {
          var Result = false;
          Result = this.DoMoveNext();
          return Result;
        };
      },"TDictionary<System.Longint,WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellItem>.TPairEnumerator");
      rtl.createClass(this,"TKeyEnumerator",$mod.TEnumerator$$$G$$generics$collections$$Longint,function () {
        this.$init = function () {
          $mod.TEnumerator$$$G$$generics$collections$$Longint.$init.call(this);
          this.FIter = null;
          this.FVal = null;
        };
        this.$final = function () {
          this.FIter = undefined;
          this.FVal = undefined;
          $mod.TEnumerator$$$G$$generics$collections$$Longint.$final.call(this);
        };
        this.GetCurrent = function () {
          var Result = 0;
          Result = this.DoGetCurrent();
          return Result;
        };
        this.DoGetCurrent = function () {
          var Result = 0;
          Result = rtl.trunc(this.FVal.value);
          return Result;
        };
        this.DoMoveNext = function () {
          var Result = false;
          this.FVal = this.FIter.next();
          Result = !this.FVal.done;
          return Result;
        };
        this.Create$1 = function (AIter) {
          this.FIter = AIter;
          return this;
        };
        this.Create$2 = function (ADictionary) {
          this.Create$1(ADictionary.FMap.keys());
          return this;
        };
        this.MoveNext$1 = function () {
          var Result = false;
          Result = this.DoMoveNext();
          return Result;
        };
      },"TDictionary<System.Longint,WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellItem>.TKeyEnumerator");
      rtl.createClass(this,"TValueEnumerator",$mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCellItem,function () {
        this.$init = function () {
          $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCellItem.$init.call(this);
          this.FIter = null;
          this.FVal = null;
        };
        this.$final = function () {
          this.FIter = undefined;
          this.FVal = undefined;
          $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCellItem.$final.call(this);
        };
        this.GetCurrent = function () {
          var Result = null;
          Result = this.DoGetCurrent();
          return Result;
        };
        this.DoGetCurrent = function () {
          var Result = null;
          Result = rtl.getObject(this.FVal.value);
          return Result;
        };
        this.DoMoveNext = function () {
          var Result = false;
          this.FVal = this.FIter.next();
          Result = !this.FVal.done;
          return Result;
        };
        this.Create$1 = function (AIter) {
          this.FIter = AIter;
          return this;
        };
        this.Create$2 = function (ADictionary) {
          this.Create$1(ADictionary.FMap.values());
          return this;
        };
        this.MoveNext$1 = function () {
          var Result = false;
          Result = this.DoMoveNext();
          return Result;
        };
      },"TDictionary<System.Longint,WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellItem>.TValueEnumerator");
      rtl.createClass(this,"TValueCollection",$mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridCellItem,function () {
        this.$init = function () {
          $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridCellItem.$init.call(this);
          this.FMap = null;
        };
        this.$final = function () {
          this.FMap = undefined;
          $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridCellItem.$final.call(this);
        };
        this.GetCount = function () {
          var Result = 0;
          Result = this.FMap.size;
          return Result;
        };
        this.DoGetEnumerator = function () {
          var Result = null;
          Result = $mod.TDictionary$$$G$$generics$collections$$Longint$$TTMSFNCDataGridCellItem.TValueEnumerator.$create("Create$1",[this.FMap.values()]);
          return Result;
        };
        this.Create$1 = function (ADictionary) {
          this.FMap = ADictionary.FMap;
          return this;
        };
        this.GetEnumerator$1 = function () {
          var Result = null;
          Result = this.DoGetEnumerator();
          return Result;
        };
        this.ToArray = function () {
          var Result = [];
          var I = 0;
          var P = null;
          Result = rtl.arraySetLength(Result,null,this.FMap.size);
          var $in = this.GetEnumerator$1();
          try {
            while ($in.MoveNext$1()) {
              P = $in.GetCurrent();
              Result[I] = P;
              I += 1;
            }
          } finally {
            $in = rtl.freeLoc($in)
          };
          return Result;
        };
      },"TDictionary<System.Longint,WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellItem>.TValueCollection");
      rtl.createClass(this,"TKeyCollection",$mod.TEnumerable$$$G$$generics$collections$$Longint,function () {
        this.$init = function () {
          $mod.TEnumerable$$$G$$generics$collections$$Longint.$init.call(this);
          this.FMap = null;
        };
        this.$final = function () {
          this.FMap = undefined;
          $mod.TEnumerable$$$G$$generics$collections$$Longint.$final.call(this);
        };
        this.GetCount = function () {
          var Result = 0;
          Result = this.FMap.size;
          return Result;
        };
        this.DoGetEnumerator = function () {
          var Result = null;
          Result = this.GetEnumerator$1();
          return Result;
        };
        this.Create$1 = function (ADictionary) {
          this.FMap = ADictionary.FMap;
          return this;
        };
        this.GetEnumerator$1 = function () {
          var Result = null;
          Result = $mod.TDictionary$$$G$$generics$collections$$Longint$$TTMSFNCDataGridCellItem.TKeyEnumerator.$create("Create$1",[this.FMap.keys()]);
          return Result;
        };
        this.ToArray = function () {
          var Result = [];
          Result = $mod.TEnumerable$$$G$$generics$collections$$Longint.ToArray.call(this);
          return Result;
        };
      },"TDictionary<System.Longint,WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellItem>.TKeyCollection");
    };
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$WEBLib$TMSFNCDataGridCell$TTMSFNCDataGridCellItem$.$init.call(this);
      this.FMap = null;
      this.FComparer = null;
      this.FOnKeyNotify = null;
      this.FOnValueNotify = null;
      this.FKeyCollection = null;
      this.FValueCollection = null;
    };
    this.$final = function () {
      this.FMap = undefined;
      rtl.setIntfP(this,"FComparer",null);
      this.FOnKeyNotify = undefined;
      this.FOnValueNotify = undefined;
      this.FKeyCollection = undefined;
      this.FValueCollection = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$WEBLib$TMSFNCDataGridCell$TTMSFNCDataGridCellItem$.$final.call(this);
    };
    this.GetEffectiveKey = function (Key) {
      var Result = 0;
      var it = null;
      var v = null;
      if (!(this.FComparer != null)) return Key;
      it = this.FMap.keys();
      v = it.next();
      while (!v.done) {
        Result = rtl.trunc(v.value);
        if (this.FComparer.Compare(Result,Key) === 0) return Result;
        v = it.next();
      };
      Result = Key;
      return Result;
    };
    this.GetItem = function (Key) {
      var Result = null;
      var V = undefined;
      V = this.FMap.get(this.GetEffectiveKey(Key));
      if (pas.JS.isUndefined(V)) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictKeyNotFound")]);
      Result = rtl.getObject(V);
      return Result;
    };
    this.SetItem = function (Key, Value) {
      var V = undefined;
      V = this.FMap.get(this.GetEffectiveKey(Key));
      if (!pas.JS.isUndefined(V)) this.ValueNotify(rtl.getObject(V),$mod.TCollectionNotification.cnRemoved);
      this.FMap.set(Key,Value);
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoAdd = function (Key, Value) {
      this.FMap.set(this.GetEffectiveKey(Key),Value);
      this.KeyNotify(Key,$mod.TCollectionNotification.cnAdded);
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoRemove = function (Key, Notification) {
      var Result = null;
      var V = undefined;
      var K = 0;
      K = this.GetEffectiveKey(Key);
      V = this.FMap.get(K);
      if (!pas.JS.isUndefined(V)) {
        this.FMap.delete(K);
        Result = rtl.getObject(V);
        this.KeyNotify(Key,Notification);
        this.ValueNotify(Result,Notification);
      };
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FMap.size;
      return Result;
    };
    this.CanClearMap = function () {
      var Result = false;
      Result = (this.FOnKeyNotify === null) && (this.FOnValueNotify === null);
      return Result;
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.PairNotify = function (Key, Value, Action) {
      this.KeyNotify(Key,Action);
      this.ValueNotify(Value,Action);
    };
    this.KeyNotify = function (Key, Action) {
      if (this.FOnKeyNotify != null) this.FOnKeyNotify(this,Key,Action);
    };
    this.ValueNotify = function (Value, Action) {
      if (this.FOnValueNotify != null) this.FOnValueNotify(this,Value,Action);
    };
    this.Create$1 = function (ACapacity) {
      this.FMap = new Map();
      if (ACapacity > 0) ;
      return this;
    };
    this.Create$2 = function (Collection) {
      var aPair = $mod.TPair$$$G$$generics$collections$$Longint$$TTMSFNCDataGridCellItem.$new();
      this.Create$1(0);
      var $in = Collection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          aPair = $in.DoGetCurrent();
          this.Add(aPair.Key,aPair.Value);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Create$3 = function (AComparer) {
      this.Create$1(0);
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FKeyCollection;
        }, set: function (v) {
          this.p.FKeyCollection = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FValueCollection;
        }, set: function (v) {
          this.p.FValueCollection = v;
        }});
      this.Clear();
      this.FMap = null;
      pas.System.TObject.Destroy.call(this);
    };
    this.Add = function (Key, Value) {
      if (this.FMap.has(this.GetEffectiveKey(Key))) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictDuplicateKey")]);
      this.DoAdd(Key,Value);
    };
    this.Remove = function (Key) {
      this.DoRemove(Key,$mod.TCollectionNotification.cnRemoved);
    };
    this.ExtractPair = function (Key) {
      var Result = $mod.TPair$$$G$$generics$collections$$Longint$$TTMSFNCDataGridCellItem.$new();
      var K = 0;
      Result.$assign($mod.TPair$$$G$$generics$collections$$Longint$$TTMSFNCDataGridCellItem.$new());
      K = this.GetEffectiveKey(Key);
      if (this.FMap.has(K)) {
        Result.Create(Key,rtl.getObject(this.FMap.get(K)));
        this.FMap.delete(K);
      } else Result.Create(Key,null);
      return Result;
    };
    this.Clear = function () {
      var Iter = null;
      var IVal = null;
      var A = [];
      var K = 0;
      var V = null;
      if (this.CanClearMap()) {
        this.FMap.clear()}
       else {
        Iter = this.FMap.entries();
        do {
          IVal = Iter.next();
          if (!IVal.done) {
            A = IVal.value;
            K = rtl.trunc(A[0]);
            V = rtl.getObject(A[1]);
            this.FMap.delete(K);
            this.PairNotify(K,V,$mod.TCollectionNotification.cnRemoved);
          };
        } while (!IVal.done);
      };
    };
    this.TryGetValue = function (Key, Value) {
      var Result = false;
      var K = 0;
      K = this.GetEffectiveKey(Key);
      Result = this.FMap.has(K);
      if (Result) Value.set(rtl.getObject(this.FMap.get(K)));
      return Result;
    };
    this.AddOrSetValue = function (Key, Value) {
      var k = 0;
      k = this.GetEffectiveKey(Key);
      if (!this.FMap.has(k)) {
        this.DoAdd(Key,Value)}
       else this.SetItem(k,Value);
    };
    this.ContainsKey = function (Key) {
      var Result = false;
      Result = this.FMap.has(this.GetEffectiveKey(Key));
      return Result;
    };
    this.ContainsValue = function (Value) {
      var Result = false;
      var It = null;
      var Res = null;
      Result = false;
      It = this.FMap.values();
      do {
        Res = It.next();
        if (!Res.done) Result = Value === rtl.getObject(Res.value);
      } while (!(Result || Res.done));
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      Result = $mod.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$WEBLib$TMSFNCDataGridCell$TTMSFNCDataGridCellItem$.ToArray.call(this);
      return Result;
    };
    this.GetKeys = function () {
      var Result = null;
      if (this.FKeyCollection === null) this.FKeyCollection = this.TKeyCollection.$create("Create$1",[this]);
      Result = this.FKeyCollection;
      return Result;
    };
    this.GetValues = function () {
      var Result = null;
      if (this.FValueCollection === null) this.FValueCollection = this.TValueCollection.$create("Create$1",[this]);
      Result = this.FValueCollection;
      return Result;
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
  },"TDictionary<System.Longint,WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellItem>");
  rtl.createClass(this,"TObjectDictionary$$$G$$generics$collections$$Longint$$TTMSFNCDataGridCellItem",this.TDictionary$$$G$$generics$collections$$Longint$$TTMSFNCDataGridCellItem,function () {
    this.$initSpec = function () {
    };
    this.$init = function () {
      $mod.TDictionary$$$G$$generics$collections$$Longint$$TTMSFNCDataGridCellItem.$init.call(this);
      this.FOwnerships = {};
    };
    this.$final = function () {
      this.FOwnerships = undefined;
      $mod.TDictionary$$$G$$generics$collections$$Longint$$TTMSFNCDataGridCellItem.$final.call(this);
    };
    this.CanClearMap = function () {
      var Result = false;
      Result = $mod.TDictionary$$$G$$generics$collections$$Longint$$TTMSFNCDataGridCellItem.CanClearMap.call(this) && rtl.eqSet(this.FOwnerships,{});
      return Result;
    };
    this.KeyNotify = function (Key, Action) {
      $mod.TDictionary$$$G$$generics$collections$$Longint$$TTMSFNCDataGridCellItem.KeyNotify.call(this,Key,Action);
      if (($mod.TDictionaryOwnership.doOwnsKeys in this.FOwnerships) && (Action === $mod.TCollectionNotification.cnRemoved)) Key = rtl.freeLoc(Key);
    };
    this.ValueNotify = function (Value, Action) {
      $mod.TDictionary$$$G$$generics$collections$$Longint$$TTMSFNCDataGridCellItem.ValueNotify.call(this,Value,Action);
      if (($mod.TDictionaryOwnership.doOwnsValues in this.FOwnerships) && (Action === $mod.TCollectionNotification.cnRemoved)) Value = rtl.freeLoc(Value);
    };
    this.Create$4 = function (aOwnerships, ACapacity) {
      this.FOwnerships = rtl.refSet(aOwnerships);
      $mod.TDictionary$$$G$$generics$collections$$Longint$$TTMSFNCDataGridCellItem.Create$1.call(this,ACapacity);
      return this;
    };
    this.Create$5 = function (aOwnerships) {
      $mod.TDictionary$$$G$$generics$collections$$Longint$$TTMSFNCDataGridCellItem.Create$1.call(this,0);
      this.FOwnerships = rtl.refSet(aOwnerships);
      return this;
    };
  },"TObjectDictionary<System.Longint,WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellItem>");
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellControlCache>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push(LEnumerator.DoGetCurrent());
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellControlCache>");
  this.$rtti.$MethodVar("TCollectionNotifyEvent<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellControlCache>",{init: function () {
      this.procsig = rtl.newTIProcSig([["ASender",pas.System.$rtti["TObject"]],["AItem",pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCellControlCache"],2],["AAction",$mod.$rtti["TCollectionNotification"]]]);
    }, methodkind: 0});
  rtl.createClass(this,"TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.Sort = function (AValues, AComparer) {
      this.Sort$1(AValues,AComparer,0,rtl.length(AValues.get()));
    };
    this.Sort$1 = function (AValues, AComparer, AIndex, ACount) {
      if (ACount <= 1) return;
      this.QuickSort(AValues,AIndex,(AIndex + ACount) - 1,AComparer);
    };
    this.BinarySearch$2 = function (AValues, AItem, AFoundIndex, AComparer) {
      var Result = false;
      Result = this.BinarySearch$1(AValues,AItem,AFoundIndex,AComparer,0,rtl.length(AValues));
      return Result;
    };
    this.BinarySearch$3 = function (AValues, AItem, ASearchResult, AComparer) {
      var Result = false;
      Result = this.BinarySearch(AValues,AItem,ASearchResult,AComparer,0,rtl.length(AValues));
      return Result;
    };
  },"TCustomArrayHelper<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellControlCache>");
  rtl.createClass(this,"TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache",this.TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache,function () {
    this.$initSpec = function () {
    };
    this.QuickSort = function (AValues, ALeft, ARight, AComparer) {
      var I = 0;
      var J = 0;
      var P = null;
      var Q = null;
      if (((ARight - ALeft) <= 0) || (rtl.length(AValues.get()) === 0)) return;
      do {
        I = ALeft;
        J = ARight;
        P = AValues.get()[ALeft + Math.floor((ARight - ALeft) / 2)];
        do {
          while (AComparer.Compare(AValues.get()[I],P) < 0) I += 1;
          while (AComparer.Compare(AValues.get()[J],P) > 0) J -= 1;
          if (I <= J) {
            if (I !== J) {
              Q = AValues.get()[I];
              AValues.get()[I] = AValues.get()[J];
              AValues.get()[J] = Q;
            };
            I += 1;
            J -= 1;
          };
        } while (!(I > J));
        if ((J - ALeft) < (ARight - I)) {
          if (ALeft < J) this.QuickSort(AValues,ALeft,J,AComparer);
          ALeft = I;
        } else {
          if (I < ARight) this.QuickSort(AValues,I,ARight,AComparer);
          ARight = J;
        };
      } while (!(ALeft >= ARight));
    };
    this.BinarySearch = function (AValues, AItem, ASearchResult, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var ilo = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      ilo = imid * imid;
      imid = ilo * imid;
      while (imin < imax) {
        imid = rtl.trunc((imax + imin) / 2);
        ASearchResult.CompareResult = AComparer.Compare(AValues[imid],AItem);
        if (ASearchResult.CompareResult < 0) {
          imin = imid + 1}
         else {
          if (ASearchResult.CompareResult === 0) {
            ASearchResult.FoundIndex = imid;
            ASearchResult.CandidateIndex = imid;
            return true;
          };
          imax = imid;
        };
      };
      Result = imax === imin;
      if (Result) {
        ASearchResult.CompareResult = AComparer.Compare(AValues[imin],AItem);
        ASearchResult.CandidateIndex = imin;
        Result = ASearchResult.CompareResult === 0;
        if (Result) {
          ASearchResult.FoundIndex = imin}
         else ASearchResult.FoundIndex = -1;
      } else {
        ASearchResult.CompareResult = 0;
        ASearchResult.FoundIndex = -1;
        ASearchResult.CandidateIndex = -1;
      };
      return Result;
    };
    this.BinarySearch$1 = function (AValues, AItem, AFoundIndex, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var LCompare = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      while (imin < imax) {
        imid = rtl.trunc((imin + imax) / 2);
        LCompare = AComparer.Compare(AValues[imid],AItem);
        if (LCompare < 0) {
          imin = imid + 1}
         else {
          if (LCompare === 0) {
            AFoundIndex.set(imid);
            return true;
          };
          imax = imid;
        };
      };
      LCompare = AComparer.Compare(AValues[imin],AItem);
      Result = (imax === imin) && (LCompare === 0);
      if (Result) {
        AFoundIndex.set(imin)}
       else AFoundIndex.set(-1);
      return Result;
    };
  },"TArrayHelper<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellControlCache>");
  rtl.createClass(this,"TCustomList$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache",this.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $mod.$rtti.$DynArray("TCustomList<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellControlCache>.FItems$a",{eltype: pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCellControlCache"]});
    };
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache.$init.call(this);
      this.FOnNotify = null;
      this.FLength = 0;
      this.FItems = [];
    };
    this.$final = function () {
      this.FOnNotify = undefined;
      this.FItems = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache.$final.call(this);
    };
    this.GetCapacity = function () {
      var Result = 0;
      Result = rtl.length(this.FItems);
      return Result;
    };
    this.PrepareAddingItem = function () {
      var Result = 0;
      if (this.FLength === rtl.length(this.FItems)) this.FItems.push(null);
      Result = this.FLength;
      this.FLength += 1;
      return Result;
    };
    this.PrepareAddingRange = function (ACount) {
      var Result = 0;
      var l = 0;
      if (ACount < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (ACount === 0) return this.FLength - 1;
      for (var $l = rtl.length(this.FItems) + 1, $end = this.FLength + ACount; $l <= $end; $l++) {
        l = $l;
        this.FItems.push(null);
      };
      Result = this.FLength;
      this.FLength += ACount;
      return Result;
    };
    this.Notify = function (AValue, ACollectionNotification) {
      if (this.FOnNotify != null) this.FOnNotify(this,AValue,ACollectionNotification);
    };
    this.DoRemove = function (AIndex, ACollectionNotification) {
      var Result = null;
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      this.FLength -= 1;
      this.FItems[AIndex] = null;
      this.FItems.splice(AIndex,1);
      this.Notify(Result,ACollectionNotification);
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FLength;
      return Result;
    };
  },"TCustomList<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellControlCache>");
  rtl.createClass(this,"TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache",this.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache,function () {
    this.$initSpec = function () {
    };
    this.$init = function () {
      $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache.$init.call(this);
      this.FList = null;
      this.FIndex = 0;
    };
    this.$final = function () {
      this.FList = undefined;
      $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache.$final.call(this);
    };
    this.DoMoveNext = function () {
      var Result = false;
      this.FIndex += 1;
      Result = (this.FList.FLength > 0) && (this.FIndex < this.FList.FLength);
      return Result;
    };
    this.DoGetCurrent = function () {
      var Result = null;
      Result = this.GetCurrent();
      return Result;
    };
    this.GetCurrent = function () {
      var Result = null;
      Result = this.FList.FItems[this.FIndex];
      return Result;
    };
    this.Create$1 = function (AList) {
      pas.System.TObject.Create.call(this);
      this.FIndex = -1;
      this.FList = AList;
      return this;
    };
  },"TCustomListEnumerator<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellControlCache>");
  rtl.createClass(this,"TList$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache",this.TCustomList$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache,function () {
    this.$initSpec = function () {
      rtl.createClass(this,"TEnumerator",$mod.TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache,function () {
      },"TList<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellControlCache>.TEnumerator");
    };
    this.$init = function () {
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache.$init.call(this);
      this.FComparer = null;
    };
    this.$final = function () {
      rtl.setIntfP(this,"FComparer",null);
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache.$final.call(this);
    };
    this.SameValue = function (Left, Right) {
      var Result = false;
      if (this.FComparer != null) {
        Result = this.FComparer.Compare(Left,Right) === 0}
       else Result = Left === Right;
      return Result;
    };
    this.SetCapacity = function (AValue) {
      if (AValue < this.FLength) this.SetCount(AValue);
      this.FItems = rtl.arraySetLength(this.FItems,null,AValue);
    };
    this.SetCount = function (AValue) {
      if (AValue < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (AValue > this.GetCapacity()) {
        this.SetCapacity(AValue)}
       else if (AValue < this.FLength) this.DeleteRange(AValue,this.FLength - AValue);
      this.FLength = AValue;
    };
    this.InitializeList = function () {
    };
    this.InternalInsert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.FItems.splice(AIndex,0,AValue);
      this.FLength += 1;
      this.FItems[AIndex] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.GetEnumerator$1();
      return Result;
    };
    this.GetItem = function (AIndex) {
      var Result = null;
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      return Result;
    };
    this.SetItem = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.Notify(this.FItems[AIndex],$mod.TCollectionNotification.cnRemoved);
      this.FItems[AIndex] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.Create$1 = function () {
      this.InitializeList();
      return this;
    };
    this.Create$2 = function (AComparer) {
      this.InitializeList();
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Create$3 = function (ACollection) {
      var LItem = null;
      this.Create$1();
      var $in = ACollection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LItem = $in.DoGetCurrent();
          this.Add(LItem);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Destroy = function () {
      this.SetCapacity(0);
    };
    this.Add = function (AValue) {
      var Result = 0;
      Result = this.PrepareAddingItem();
      this.FItems[Result] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
      return Result;
    };
    this.AddRange = function (AValues) {
      this.InsertRange(this.FLength,AValues);
    };
    this.AddRange$1 = function (AEnumerable) {
      var LValue = null;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.Add(LValue);
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.AddRange$2 = function (AEnumerable) {
      var LValue = null;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.Add(LValue);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Insert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.InternalInsert(AIndex,AValue);
    };
    this.InsertRange = function (AIndex, AValues) {
      var LLength = 0;
      var i = 0;
      var LValue = null;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LLength = rtl.length(AValues);
      if (LLength === 0) return;
      if (AIndex !== this.PrepareAddingRange(LLength)) {
        for (var $l = AIndex, $end = this.FLength - LLength - 1; $l <= $end; $l++) {
          i = $l;
          this.FItems[i + LLength] = this.FItems[i];
        };
        for (var $l1 = 0, $end1 = LLength - 1; $l1 <= $end1; $l1++) {
          i = $l1;
          this.FItems[AIndex + i] = null;
        };
      };
      for (var $l2 = 0, $end2 = LLength - 1; $l2 <= $end2; $l2++) {
        i = $l2;
        LValue = AValues[i];
        this.FItems[i + AIndex] = LValue;
        this.Notify(LValue,$mod.TCollectionNotification.cnAdded);
      };
    };
    this.InsertRange$1 = function (AIndex, AEnumerable) {
      var LValue = null;
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.InsertRange$2 = function (AIndex, AEnumerable) {
      var LValue = null;
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Remove = function (AValue) {
      var Result = 0;
      Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.RemoveItem = function (AValue, Direction) {
      var Result = 0;
      if (Direction === $mod.TDirection.fromEnd) {
        Result = this.LastIndexOf(AValue)}
       else Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.Delete = function (AIndex) {
      this.DoRemove(AIndex,$mod.TCollectionNotification.cnRemoved);
    };
    this.DeleteRange = function (AIndex, ACount) {
      var LDeleted = [];
      var i = 0;
      if (ACount === 0) return;
      if ((ACount < 0) || (AIndex < 0) || ((AIndex + ACount) > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LDeleted = this.FItems.splice(AIndex,this.FLength);
      this.FLength -= ACount;
      for (var $l = 0, $end = rtl.length(LDeleted) - 1; $l <= $end; $l++) {
        i = $l;
        this.Notify(LDeleted[i],$mod.TCollectionNotification.cnRemoved);
      };
    };
    this.ExtractIndex = function (AIndex) {
      var Result = null;
      Result = this.DoRemove(AIndex,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.Extract = function (AValue) {
      var Result = null;
      var LIndex = 0;
      LIndex = this.IndexOf(AValue);
      if (LIndex < 0) {
        Result = null}
       else Result = this.DoRemove(LIndex,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.Exchange = function (AIndex1, AIndex2) {
      var LTemp = null;
      LTemp = this.FItems[AIndex1];
      this.FItems[AIndex1] = this.FItems[AIndex2];
      this.FItems[AIndex2] = LTemp;
    };
    this.Move = function (AIndex, ANewIndex) {
      var Arr = null;
      var LTemp = undefined;
      var i = 0;
      if (ANewIndex === AIndex) return;
      if ((ANewIndex < 0) || (ANewIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Arr = this.FItems;
      LTemp = Arr[AIndex];
      if (AIndex < ANewIndex) {
        for (var $l = AIndex, $end = ANewIndex - 1; $l <= $end; $l++) {
          i = $l;
          Arr[i] = Arr[i + 1];
        }}
       else for (var $l1 = AIndex, $end1 = ANewIndex + 1; $l1 >= $end1; $l1--) {
        i = $l1;
        Arr[i] = Arr[i - 1];
      };
      Arr[ANewIndex] = LTemp;
    };
    this.First = function () {
      var Result = null;
      Result = this.GetItem(0);
      return Result;
    };
    this.Last = function () {
      var Result = null;
      Result = this.GetItem(this.FLength - 1);
      return Result;
    };
    this.Clear = function () {
      this.SetCount(0);
      this.SetCapacity(0);
    };
    this.Contains = function (AValue) {
      var Result = false;
      Result = this.IndexOf(AValue) >= 0;
      return Result;
    };
    this.IndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = 0, $end = this.FLength - 1; $l <= $end; $l++) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.LastIndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = this.FLength - 1; $l >= 0; $l--) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.Reverse = function () {
      var a = 0;
      var b = 0;
      var LTemp = null;
      a = 0;
      b = this.FLength - 1;
      while (a < b) {
        LTemp = this.FItems[a];
        this.FItems[a] = this.FItems[b];
        this.FItems[b] = LTemp;
        a += 1;
        b -= 1;
      };
    };
    this.TrimExcess = function () {
      this.SetCapacity(this.FLength);
    };
    this.Sort = function () {
      $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},this.FComparer,0,this.FLength);
    };
    this.Sort$1 = function (AComparer) {
      $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},AComparer,0,this.FLength);
    };
    this.BinarySearch = function (AItem, AIndex) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache.BinarySearch$1(this.FItems,AItem,AIndex,this.FComparer,0,this.FLength);
      return Result;
    };
    this.BinarySearch$1 = function (AItem, AIndex, AComparer) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache.BinarySearch$1(this.FItems,AItem,AIndex,AComparer,0,this.FLength);
      return Result;
    };
  },"TList<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellControlCache>");
  rtl.createClass(this,"TObjectList$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache",this.TList$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache,function () {
    this.$initSpec = function () {
    };
    this.$init = function () {
      $mod.TList$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache.$init.call(this);
      this.FObjectsOwner = false;
    };
    this.Notify = function (aValue, Action) {
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache.Notify.call(this,aValue,Action);
      if (this.FObjectsOwner && (Action === $mod.TCollectionNotification.cnRemoved)) aValue = rtl.freeLoc(aValue);
    };
    this.Create$4 = function (aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache.Create$1.call(this);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
    this.Create$5 = function (AComparer, aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache.Create$2.call(this,AComparer);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
    this.Create$6 = function (aCollection, aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache.Create$3.call(this,aCollection);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
  },"TObjectList<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellControlCache>");
  rtl.recNewT(this,"TPair$$$G$$generics$collections$$Longint$$TTMSFNCDataGridRowItem",function () {
    var $r = $mod.$rtti.$Record("TPair<System.Longint,WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridRowItem>",{},this);
    this.$initSpec = function () {
      this.Key = 0;
      this.Value = null;
      $r.addField("Key",rtl.longint);
      $r.addField("Value",pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridRowItem"]);
      $r.addMethod("Create",2,[["AKey",rtl.longint,2],["AValue",pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridRowItem"],2]]);
    };
    this.$eq = function (b) {
      return (this.Key === b.Key) && (this.Value === b.Value);
    };
    this.$assign = function (s) {
      this.Key = s.Key;
      this.Value = s.Value;
      return this;
    };
    this.Create = function (AKey, AValue) {
      this.Key = AKey;
      this.Value = AValue;
      return this;
    };
  });
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TPair$System$Longint$WEBLib$TMSFNCDataGridCell$TTMSFNCDataGridRowItem$",pas.System.TObject,function () {
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<Generics.Collections.TPair<System.Longint,WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridRowItem>>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TPair$System$Longint$WEBLib$TMSFNCDataGridCell$TTMSFNCDataGridRowItem$",pas.System.TObject,function () {
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push($mod.TPair$$$G$$generics$collections$$Longint$$TTMSFNCDataGridRowItem.$clone(LEnumerator.DoGetCurrent()));
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<Generics.Collections.TPair<System.Longint,WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridRowItem>>");
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridRowItem",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridRowItem>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridRowItem",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push(LEnumerator.DoGetCurrent());
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridRowItem>");
  this.$rtti.$MethodVar("TCollectionNotifyEvent<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridRowItem>",{init: function () {
      this.procsig = rtl.newTIProcSig([["ASender",pas.System.$rtti["TObject"]],["AItem",pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridRowItem"],2],["AAction",$mod.$rtti["TCollectionNotification"]]]);
    }, methodkind: 0});
  rtl.createClass(this,"TDictionary$$$G$$generics$collections$$Longint$$TTMSFNCDataGridRowItem",this.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$WEBLib$TMSFNCDataGridCell$TTMSFNCDataGridRowItem$,function () {
    this.$initSpec = function () {
      rtl.createClass(this,"TPairEnumerator",$mod.TEnumerator$$$G$$generics$collections$$TPair$System$Longint$WEBLib$TMSFNCDataGridCell$TTMSFNCDataGridRowItem$,function () {
        this.$init = function () {
          $mod.TEnumerator$$$G$$generics$collections$$TPair$System$Longint$WEBLib$TMSFNCDataGridCell$TTMSFNCDataGridRowItem$.$init.call(this);
          this.FIter = null;
          this.FVal = null;
        };
        this.$final = function () {
          this.FIter = undefined;
          this.FVal = undefined;
          $mod.TEnumerator$$$G$$generics$collections$$TPair$System$Longint$WEBLib$TMSFNCDataGridCell$TTMSFNCDataGridRowItem$.$final.call(this);
        };
        this.GetCurrent = function () {
          var Result = $mod.TPair$$$G$$generics$collections$$Longint$$TTMSFNCDataGridRowItem.$new();
          Result.$assign(this.DoGetCurrent());
          return Result;
        };
        this.DoGetCurrent = function () {
          var Result = $mod.TPair$$$G$$generics$collections$$Longint$$TTMSFNCDataGridRowItem.$new();
          var A = [];
          A = this.FVal.value;
          Result.$assign($mod.TPair$$$G$$generics$collections$$Longint$$TTMSFNCDataGridRowItem.$new());
          Result.Create(rtl.trunc(A[0]),rtl.getObject(A[1]));
          return Result;
        };
        this.DoMoveNext = function () {
          var Result = false;
          this.FVal = this.FIter.next();
          Result = !this.FVal.done;
          return Result;
        };
        this.Create$1 = function (ADictionary) {
          this.FIter = ADictionary.FMap.entries();
          return this;
        };
        this.MoveNext$1 = function () {
          var Result = false;
          Result = this.DoMoveNext();
          return Result;
        };
      },"TDictionary<System.Longint,WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridRowItem>.TPairEnumerator");
      rtl.createClass(this,"TKeyEnumerator",$mod.TEnumerator$$$G$$generics$collections$$Longint,function () {
        this.$init = function () {
          $mod.TEnumerator$$$G$$generics$collections$$Longint.$init.call(this);
          this.FIter = null;
          this.FVal = null;
        };
        this.$final = function () {
          this.FIter = undefined;
          this.FVal = undefined;
          $mod.TEnumerator$$$G$$generics$collections$$Longint.$final.call(this);
        };
        this.GetCurrent = function () {
          var Result = 0;
          Result = this.DoGetCurrent();
          return Result;
        };
        this.DoGetCurrent = function () {
          var Result = 0;
          Result = rtl.trunc(this.FVal.value);
          return Result;
        };
        this.DoMoveNext = function () {
          var Result = false;
          this.FVal = this.FIter.next();
          Result = !this.FVal.done;
          return Result;
        };
        this.Create$1 = function (AIter) {
          this.FIter = AIter;
          return this;
        };
        this.Create$2 = function (ADictionary) {
          this.Create$1(ADictionary.FMap.keys());
          return this;
        };
        this.MoveNext$1 = function () {
          var Result = false;
          Result = this.DoMoveNext();
          return Result;
        };
      },"TDictionary<System.Longint,WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridRowItem>.TKeyEnumerator");
      rtl.createClass(this,"TValueEnumerator",$mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridRowItem,function () {
        this.$init = function () {
          $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridRowItem.$init.call(this);
          this.FIter = null;
          this.FVal = null;
        };
        this.$final = function () {
          this.FIter = undefined;
          this.FVal = undefined;
          $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridRowItem.$final.call(this);
        };
        this.GetCurrent = function () {
          var Result = null;
          Result = this.DoGetCurrent();
          return Result;
        };
        this.DoGetCurrent = function () {
          var Result = null;
          Result = rtl.getObject(this.FVal.value);
          return Result;
        };
        this.DoMoveNext = function () {
          var Result = false;
          this.FVal = this.FIter.next();
          Result = !this.FVal.done;
          return Result;
        };
        this.Create$1 = function (AIter) {
          this.FIter = AIter;
          return this;
        };
        this.Create$2 = function (ADictionary) {
          this.Create$1(ADictionary.FMap.values());
          return this;
        };
        this.MoveNext$1 = function () {
          var Result = false;
          Result = this.DoMoveNext();
          return Result;
        };
      },"TDictionary<System.Longint,WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridRowItem>.TValueEnumerator");
      rtl.createClass(this,"TValueCollection",$mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridRowItem,function () {
        this.$init = function () {
          $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridRowItem.$init.call(this);
          this.FMap = null;
        };
        this.$final = function () {
          this.FMap = undefined;
          $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridRowItem.$final.call(this);
        };
        this.GetCount = function () {
          var Result = 0;
          Result = this.FMap.size;
          return Result;
        };
        this.DoGetEnumerator = function () {
          var Result = null;
          Result = $mod.TDictionary$$$G$$generics$collections$$Longint$$TTMSFNCDataGridRowItem.TValueEnumerator.$create("Create$1",[this.FMap.values()]);
          return Result;
        };
        this.Create$1 = function (ADictionary) {
          this.FMap = ADictionary.FMap;
          return this;
        };
        this.GetEnumerator$1 = function () {
          var Result = null;
          Result = this.DoGetEnumerator();
          return Result;
        };
        this.ToArray = function () {
          var Result = [];
          var I = 0;
          var P = null;
          Result = rtl.arraySetLength(Result,null,this.FMap.size);
          var $in = this.GetEnumerator$1();
          try {
            while ($in.MoveNext$1()) {
              P = $in.GetCurrent();
              Result[I] = P;
              I += 1;
            }
          } finally {
            $in = rtl.freeLoc($in)
          };
          return Result;
        };
      },"TDictionary<System.Longint,WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridRowItem>.TValueCollection");
      rtl.createClass(this,"TKeyCollection",$mod.TEnumerable$$$G$$generics$collections$$Longint,function () {
        this.$init = function () {
          $mod.TEnumerable$$$G$$generics$collections$$Longint.$init.call(this);
          this.FMap = null;
        };
        this.$final = function () {
          this.FMap = undefined;
          $mod.TEnumerable$$$G$$generics$collections$$Longint.$final.call(this);
        };
        this.GetCount = function () {
          var Result = 0;
          Result = this.FMap.size;
          return Result;
        };
        this.DoGetEnumerator = function () {
          var Result = null;
          Result = this.GetEnumerator$1();
          return Result;
        };
        this.Create$1 = function (ADictionary) {
          this.FMap = ADictionary.FMap;
          return this;
        };
        this.GetEnumerator$1 = function () {
          var Result = null;
          Result = $mod.TDictionary$$$G$$generics$collections$$Longint$$TTMSFNCDataGridRowItem.TKeyEnumerator.$create("Create$1",[this.FMap.keys()]);
          return Result;
        };
        this.ToArray = function () {
          var Result = [];
          Result = $mod.TEnumerable$$$G$$generics$collections$$Longint.ToArray.call(this);
          return Result;
        };
      },"TDictionary<System.Longint,WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridRowItem>.TKeyCollection");
    };
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$WEBLib$TMSFNCDataGridCell$TTMSFNCDataGridRowItem$.$init.call(this);
      this.FMap = null;
      this.FComparer = null;
      this.FOnKeyNotify = null;
      this.FOnValueNotify = null;
      this.FKeyCollection = null;
      this.FValueCollection = null;
    };
    this.$final = function () {
      this.FMap = undefined;
      rtl.setIntfP(this,"FComparer",null);
      this.FOnKeyNotify = undefined;
      this.FOnValueNotify = undefined;
      this.FKeyCollection = undefined;
      this.FValueCollection = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$WEBLib$TMSFNCDataGridCell$TTMSFNCDataGridRowItem$.$final.call(this);
    };
    this.GetEffectiveKey = function (Key) {
      var Result = 0;
      var it = null;
      var v = null;
      if (!(this.FComparer != null)) return Key;
      it = this.FMap.keys();
      v = it.next();
      while (!v.done) {
        Result = rtl.trunc(v.value);
        if (this.FComparer.Compare(Result,Key) === 0) return Result;
        v = it.next();
      };
      Result = Key;
      return Result;
    };
    this.GetItem = function (Key) {
      var Result = null;
      var V = undefined;
      V = this.FMap.get(this.GetEffectiveKey(Key));
      if (pas.JS.isUndefined(V)) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictKeyNotFound")]);
      Result = rtl.getObject(V);
      return Result;
    };
    this.SetItem = function (Key, Value) {
      var V = undefined;
      V = this.FMap.get(this.GetEffectiveKey(Key));
      if (!pas.JS.isUndefined(V)) this.ValueNotify(rtl.getObject(V),$mod.TCollectionNotification.cnRemoved);
      this.FMap.set(Key,Value);
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoAdd = function (Key, Value) {
      this.FMap.set(this.GetEffectiveKey(Key),Value);
      this.KeyNotify(Key,$mod.TCollectionNotification.cnAdded);
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoRemove = function (Key, Notification) {
      var Result = null;
      var V = undefined;
      var K = 0;
      K = this.GetEffectiveKey(Key);
      V = this.FMap.get(K);
      if (!pas.JS.isUndefined(V)) {
        this.FMap.delete(K);
        Result = rtl.getObject(V);
        this.KeyNotify(Key,Notification);
        this.ValueNotify(Result,Notification);
      };
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FMap.size;
      return Result;
    };
    this.CanClearMap = function () {
      var Result = false;
      Result = (this.FOnKeyNotify === null) && (this.FOnValueNotify === null);
      return Result;
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.PairNotify = function (Key, Value, Action) {
      this.KeyNotify(Key,Action);
      this.ValueNotify(Value,Action);
    };
    this.KeyNotify = function (Key, Action) {
      if (this.FOnKeyNotify != null) this.FOnKeyNotify(this,Key,Action);
    };
    this.ValueNotify = function (Value, Action) {
      if (this.FOnValueNotify != null) this.FOnValueNotify(this,Value,Action);
    };
    this.Create$1 = function (ACapacity) {
      this.FMap = new Map();
      if (ACapacity > 0) ;
      return this;
    };
    this.Create$2 = function (Collection) {
      var aPair = $mod.TPair$$$G$$generics$collections$$Longint$$TTMSFNCDataGridRowItem.$new();
      this.Create$1(0);
      var $in = Collection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          aPair = $in.DoGetCurrent();
          this.Add(aPair.Key,aPair.Value);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Create$3 = function (AComparer) {
      this.Create$1(0);
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FKeyCollection;
        }, set: function (v) {
          this.p.FKeyCollection = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FValueCollection;
        }, set: function (v) {
          this.p.FValueCollection = v;
        }});
      this.Clear();
      this.FMap = null;
      pas.System.TObject.Destroy.call(this);
    };
    this.Add = function (Key, Value) {
      if (this.FMap.has(this.GetEffectiveKey(Key))) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictDuplicateKey")]);
      this.DoAdd(Key,Value);
    };
    this.Remove = function (Key) {
      this.DoRemove(Key,$mod.TCollectionNotification.cnRemoved);
    };
    this.ExtractPair = function (Key) {
      var Result = $mod.TPair$$$G$$generics$collections$$Longint$$TTMSFNCDataGridRowItem.$new();
      var K = 0;
      Result.$assign($mod.TPair$$$G$$generics$collections$$Longint$$TTMSFNCDataGridRowItem.$new());
      K = this.GetEffectiveKey(Key);
      if (this.FMap.has(K)) {
        Result.Create(Key,rtl.getObject(this.FMap.get(K)));
        this.FMap.delete(K);
      } else Result.Create(Key,null);
      return Result;
    };
    this.Clear = function () {
      var Iter = null;
      var IVal = null;
      var A = [];
      var K = 0;
      var V = null;
      if (this.CanClearMap()) {
        this.FMap.clear()}
       else {
        Iter = this.FMap.entries();
        do {
          IVal = Iter.next();
          if (!IVal.done) {
            A = IVal.value;
            K = rtl.trunc(A[0]);
            V = rtl.getObject(A[1]);
            this.FMap.delete(K);
            this.PairNotify(K,V,$mod.TCollectionNotification.cnRemoved);
          };
        } while (!IVal.done);
      };
    };
    this.TryGetValue = function (Key, Value) {
      var Result = false;
      var K = 0;
      K = this.GetEffectiveKey(Key);
      Result = this.FMap.has(K);
      if (Result) Value.set(rtl.getObject(this.FMap.get(K)));
      return Result;
    };
    this.AddOrSetValue = function (Key, Value) {
      var k = 0;
      k = this.GetEffectiveKey(Key);
      if (!this.FMap.has(k)) {
        this.DoAdd(Key,Value)}
       else this.SetItem(k,Value);
    };
    this.ContainsKey = function (Key) {
      var Result = false;
      Result = this.FMap.has(this.GetEffectiveKey(Key));
      return Result;
    };
    this.ContainsValue = function (Value) {
      var Result = false;
      var It = null;
      var Res = null;
      Result = false;
      It = this.FMap.values();
      do {
        Res = It.next();
        if (!Res.done) Result = Value === rtl.getObject(Res.value);
      } while (!(Result || Res.done));
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      Result = $mod.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$WEBLib$TMSFNCDataGridCell$TTMSFNCDataGridRowItem$.ToArray.call(this);
      return Result;
    };
    this.GetKeys = function () {
      var Result = null;
      if (this.FKeyCollection === null) this.FKeyCollection = this.TKeyCollection.$create("Create$1",[this]);
      Result = this.FKeyCollection;
      return Result;
    };
    this.GetValues = function () {
      var Result = null;
      if (this.FValueCollection === null) this.FValueCollection = this.TValueCollection.$create("Create$1",[this]);
      Result = this.FValueCollection;
      return Result;
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
  },"TDictionary<System.Longint,WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridRowItem>");
  rtl.createClass(this,"TObjectDictionary$$$G$$generics$collections$$Longint$$TTMSFNCDataGridRowItem",this.TDictionary$$$G$$generics$collections$$Longint$$TTMSFNCDataGridRowItem,function () {
    this.$initSpec = function () {
    };
    this.$init = function () {
      $mod.TDictionary$$$G$$generics$collections$$Longint$$TTMSFNCDataGridRowItem.$init.call(this);
      this.FOwnerships = {};
    };
    this.$final = function () {
      this.FOwnerships = undefined;
      $mod.TDictionary$$$G$$generics$collections$$Longint$$TTMSFNCDataGridRowItem.$final.call(this);
    };
    this.CanClearMap = function () {
      var Result = false;
      Result = $mod.TDictionary$$$G$$generics$collections$$Longint$$TTMSFNCDataGridRowItem.CanClearMap.call(this) && rtl.eqSet(this.FOwnerships,{});
      return Result;
    };
    this.KeyNotify = function (Key, Action) {
      $mod.TDictionary$$$G$$generics$collections$$Longint$$TTMSFNCDataGridRowItem.KeyNotify.call(this,Key,Action);
      if (($mod.TDictionaryOwnership.doOwnsKeys in this.FOwnerships) && (Action === $mod.TCollectionNotification.cnRemoved)) Key = rtl.freeLoc(Key);
    };
    this.ValueNotify = function (Value, Action) {
      $mod.TDictionary$$$G$$generics$collections$$Longint$$TTMSFNCDataGridRowItem.ValueNotify.call(this,Value,Action);
      if (($mod.TDictionaryOwnership.doOwnsValues in this.FOwnerships) && (Action === $mod.TCollectionNotification.cnRemoved)) Value = rtl.freeLoc(Value);
    };
    this.Create$4 = function (aOwnerships, ACapacity) {
      this.FOwnerships = rtl.refSet(aOwnerships);
      $mod.TDictionary$$$G$$generics$collections$$Longint$$TTMSFNCDataGridRowItem.Create$1.call(this,ACapacity);
      return this;
    };
    this.Create$5 = function (aOwnerships) {
      $mod.TDictionary$$$G$$generics$collections$$Longint$$TTMSFNCDataGridRowItem.Create$1.call(this,0);
      this.FOwnerships = rtl.refSet(aOwnerships);
      return this;
    };
  },"TObjectDictionary<System.Longint,WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridRowItem>");
  rtl.recNewT(this,"TPair$$$G$$generics$collections$$String$$TTMSFNCDataGridDataGroup",function () {
    var $r = $mod.$rtti.$Record("TPair<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataGroup>",{},this);
    this.$initSpec = function () {
      this.Key = "";
      this.Value = null;
      $r.addField("Key",rtl.string);
      $r.addField("Value",pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataGroup"]);
      $r.addMethod("Create",2,[["AKey",rtl.string,2],["AValue",pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataGroup"],2]]);
    };
    this.$eq = function (b) {
      return (this.Key === b.Key) && (this.Value === b.Value);
    };
    this.$assign = function (s) {
      this.Key = s.Key;
      this.Value = s.Value;
      return this;
    };
    this.Create = function (AKey, AValue) {
      this.Key = AKey;
      this.Value = AValue;
      return this;
    };
  });
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TPair$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataGroup$",pas.System.TObject,function () {
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<Generics.Collections.TPair<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataGroup>>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TPair$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataGroup$",pas.System.TObject,function () {
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push($mod.TPair$$$G$$generics$collections$$String$$TTMSFNCDataGridDataGroup.$clone(LEnumerator.DoGetCurrent()));
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<Generics.Collections.TPair<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataGroup>>");
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridDataGroup",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataGroup>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridDataGroup",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push(LEnumerator.DoGetCurrent());
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataGroup>");
  this.$rtti.$MethodVar("TCollectionNotifyEvent<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataGroup>",{init: function () {
      this.procsig = rtl.newTIProcSig([["ASender",pas.System.$rtti["TObject"]],["AItem",pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataGroup"],2],["AAction",$mod.$rtti["TCollectionNotification"]]]);
    }, methodkind: 0});
  rtl.createClass(this,"TDictionary$$$G$$generics$collections$$String$$TTMSFNCDataGridDataGroup",this.TEnumerable$$$G$$generics$collections$$TPair$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataGroup$,function () {
    this.$initSpec = function () {
      rtl.createClass(this,"TPairEnumerator",$mod.TEnumerator$$$G$$generics$collections$$TPair$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataGroup$,function () {
        this.$init = function () {
          $mod.TEnumerator$$$G$$generics$collections$$TPair$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataGroup$.$init.call(this);
          this.FIter = null;
          this.FVal = null;
        };
        this.$final = function () {
          this.FIter = undefined;
          this.FVal = undefined;
          $mod.TEnumerator$$$G$$generics$collections$$TPair$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataGroup$.$final.call(this);
        };
        this.GetCurrent = function () {
          var Result = $mod.TPair$$$G$$generics$collections$$String$$TTMSFNCDataGridDataGroup.$new();
          Result.$assign(this.DoGetCurrent());
          return Result;
        };
        this.DoGetCurrent = function () {
          var Result = $mod.TPair$$$G$$generics$collections$$String$$TTMSFNCDataGridDataGroup.$new();
          var A = [];
          A = this.FVal.value;
          Result.$assign($mod.TPair$$$G$$generics$collections$$String$$TTMSFNCDataGridDataGroup.$new());
          Result.Create("" + A[0],rtl.getObject(A[1]));
          return Result;
        };
        this.DoMoveNext = function () {
          var Result = false;
          this.FVal = this.FIter.next();
          Result = !this.FVal.done;
          return Result;
        };
        this.Create$1 = function (ADictionary) {
          this.FIter = ADictionary.FMap.entries();
          return this;
        };
        this.MoveNext$1 = function () {
          var Result = false;
          Result = this.DoMoveNext();
          return Result;
        };
      },"TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataGroup>.TPairEnumerator");
      rtl.createClass(this,"TKeyEnumerator",$mod.TEnumerator$$$G$$generics$collections$$String,function () {
        this.$init = function () {
          $mod.TEnumerator$$$G$$generics$collections$$String.$init.call(this);
          this.FIter = null;
          this.FVal = null;
        };
        this.$final = function () {
          this.FIter = undefined;
          this.FVal = undefined;
          $mod.TEnumerator$$$G$$generics$collections$$String.$final.call(this);
        };
        this.GetCurrent = function () {
          var Result = "";
          Result = this.DoGetCurrent();
          return Result;
        };
        this.DoGetCurrent = function () {
          var Result = "";
          Result = "" + this.FVal.value;
          return Result;
        };
        this.DoMoveNext = function () {
          var Result = false;
          this.FVal = this.FIter.next();
          Result = !this.FVal.done;
          return Result;
        };
        this.Create$1 = function (AIter) {
          this.FIter = AIter;
          return this;
        };
        this.Create$2 = function (ADictionary) {
          this.Create$1(ADictionary.FMap.keys());
          return this;
        };
        this.MoveNext$1 = function () {
          var Result = false;
          Result = this.DoMoveNext();
          return Result;
        };
      },"TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataGroup>.TKeyEnumerator");
      rtl.createClass(this,"TValueEnumerator",$mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridDataGroup,function () {
        this.$init = function () {
          $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridDataGroup.$init.call(this);
          this.FIter = null;
          this.FVal = null;
        };
        this.$final = function () {
          this.FIter = undefined;
          this.FVal = undefined;
          $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridDataGroup.$final.call(this);
        };
        this.GetCurrent = function () {
          var Result = null;
          Result = this.DoGetCurrent();
          return Result;
        };
        this.DoGetCurrent = function () {
          var Result = null;
          Result = rtl.getObject(this.FVal.value);
          return Result;
        };
        this.DoMoveNext = function () {
          var Result = false;
          this.FVal = this.FIter.next();
          Result = !this.FVal.done;
          return Result;
        };
        this.Create$1 = function (AIter) {
          this.FIter = AIter;
          return this;
        };
        this.Create$2 = function (ADictionary) {
          this.Create$1(ADictionary.FMap.values());
          return this;
        };
        this.MoveNext$1 = function () {
          var Result = false;
          Result = this.DoMoveNext();
          return Result;
        };
      },"TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataGroup>.TValueEnumerator");
      rtl.createClass(this,"TValueCollection",$mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridDataGroup,function () {
        this.$init = function () {
          $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridDataGroup.$init.call(this);
          this.FMap = null;
        };
        this.$final = function () {
          this.FMap = undefined;
          $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridDataGroup.$final.call(this);
        };
        this.GetCount = function () {
          var Result = 0;
          Result = this.FMap.size;
          return Result;
        };
        this.DoGetEnumerator = function () {
          var Result = null;
          Result = $mod.TDictionary$$$G$$generics$collections$$String$$TTMSFNCDataGridDataGroup.TValueEnumerator.$create("Create$1",[this.FMap.values()]);
          return Result;
        };
        this.Create$1 = function (ADictionary) {
          this.FMap = ADictionary.FMap;
          return this;
        };
        this.GetEnumerator$1 = function () {
          var Result = null;
          Result = this.DoGetEnumerator();
          return Result;
        };
        this.ToArray = function () {
          var Result = [];
          var I = 0;
          var P = null;
          Result = rtl.arraySetLength(Result,null,this.FMap.size);
          var $in = this.GetEnumerator$1();
          try {
            while ($in.MoveNext$1()) {
              P = $in.GetCurrent();
              Result[I] = P;
              I += 1;
            }
          } finally {
            $in = rtl.freeLoc($in)
          };
          return Result;
        };
      },"TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataGroup>.TValueCollection");
      rtl.createClass(this,"TKeyCollection",$mod.TEnumerable$$$G$$generics$collections$$String,function () {
        this.$init = function () {
          $mod.TEnumerable$$$G$$generics$collections$$String.$init.call(this);
          this.FMap = null;
        };
        this.$final = function () {
          this.FMap = undefined;
          $mod.TEnumerable$$$G$$generics$collections$$String.$final.call(this);
        };
        this.GetCount = function () {
          var Result = 0;
          Result = this.FMap.size;
          return Result;
        };
        this.DoGetEnumerator = function () {
          var Result = null;
          Result = this.GetEnumerator$1();
          return Result;
        };
        this.Create$1 = function (ADictionary) {
          this.FMap = ADictionary.FMap;
          return this;
        };
        this.GetEnumerator$1 = function () {
          var Result = null;
          Result = $mod.TDictionary$$$G$$generics$collections$$String$$TTMSFNCDataGridDataGroup.TKeyEnumerator.$create("Create$1",[this.FMap.keys()]);
          return Result;
        };
        this.ToArray = function () {
          var Result = [];
          Result = $mod.TEnumerable$$$G$$generics$collections$$String.ToArray.call(this);
          return Result;
        };
      },"TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataGroup>.TKeyCollection");
    };
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$TPair$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataGroup$.$init.call(this);
      this.FMap = null;
      this.FComparer = null;
      this.FOnKeyNotify = null;
      this.FOnValueNotify = null;
      this.FKeyCollection = null;
      this.FValueCollection = null;
    };
    this.$final = function () {
      this.FMap = undefined;
      rtl.setIntfP(this,"FComparer",null);
      this.FOnKeyNotify = undefined;
      this.FOnValueNotify = undefined;
      this.FKeyCollection = undefined;
      this.FValueCollection = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$TPair$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataGroup$.$final.call(this);
    };
    this.GetEffectiveKey = function (Key) {
      var Result = "";
      var it = null;
      var v = null;
      if (!(this.FComparer != null)) return Key;
      it = this.FMap.keys();
      v = it.next();
      while (!v.done) {
        Result = "" + v.value;
        if (this.FComparer.Compare(Result,Key) === 0) return Result;
        v = it.next();
      };
      Result = Key;
      return Result;
    };
    this.GetItem = function (Key) {
      var Result = null;
      var V = undefined;
      V = this.FMap.get(this.GetEffectiveKey(Key));
      if (pas.JS.isUndefined(V)) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictKeyNotFound")]);
      Result = rtl.getObject(V);
      return Result;
    };
    this.SetItem = function (Key, Value) {
      var V = undefined;
      V = this.FMap.get(this.GetEffectiveKey(Key));
      if (!pas.JS.isUndefined(V)) this.ValueNotify(rtl.getObject(V),$mod.TCollectionNotification.cnRemoved);
      this.FMap.set(Key,Value);
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoAdd = function (Key, Value) {
      this.FMap.set(this.GetEffectiveKey(Key),Value);
      this.KeyNotify(Key,$mod.TCollectionNotification.cnAdded);
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoRemove = function (Key, Notification) {
      var Result = null;
      var V = undefined;
      var K = "";
      K = this.GetEffectiveKey(Key);
      V = this.FMap.get(K);
      if (!pas.JS.isUndefined(V)) {
        this.FMap.delete(K);
        Result = rtl.getObject(V);
        this.KeyNotify(Key,Notification);
        this.ValueNotify(Result,Notification);
      };
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FMap.size;
      return Result;
    };
    this.CanClearMap = function () {
      var Result = false;
      Result = (this.FOnKeyNotify === null) && (this.FOnValueNotify === null);
      return Result;
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.PairNotify = function (Key, Value, Action) {
      this.KeyNotify(Key,Action);
      this.ValueNotify(Value,Action);
    };
    this.KeyNotify = function (Key, Action) {
      if (this.FOnKeyNotify != null) this.FOnKeyNotify(this,Key,Action);
    };
    this.ValueNotify = function (Value, Action) {
      if (this.FOnValueNotify != null) this.FOnValueNotify(this,Value,Action);
    };
    this.Create$1 = function (ACapacity) {
      this.FMap = new Map();
      if (ACapacity > 0) ;
      return this;
    };
    this.Create$2 = function (Collection) {
      var aPair = $mod.TPair$$$G$$generics$collections$$String$$TTMSFNCDataGridDataGroup.$new();
      this.Create$1(0);
      var $in = Collection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          aPair = $in.DoGetCurrent();
          this.Add(aPair.Key,aPair.Value);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Create$3 = function (AComparer) {
      this.Create$1(0);
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FKeyCollection;
        }, set: function (v) {
          this.p.FKeyCollection = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FValueCollection;
        }, set: function (v) {
          this.p.FValueCollection = v;
        }});
      this.Clear();
      this.FMap = null;
      pas.System.TObject.Destroy.call(this);
    };
    this.Add = function (Key, Value) {
      if (this.FMap.has(this.GetEffectiveKey(Key))) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictDuplicateKey")]);
      this.DoAdd(Key,Value);
    };
    this.Remove = function (Key) {
      this.DoRemove(Key,$mod.TCollectionNotification.cnRemoved);
    };
    this.ExtractPair = function (Key) {
      var Result = $mod.TPair$$$G$$generics$collections$$String$$TTMSFNCDataGridDataGroup.$new();
      var K = "";
      Result.$assign($mod.TPair$$$G$$generics$collections$$String$$TTMSFNCDataGridDataGroup.$new());
      K = this.GetEffectiveKey(Key);
      if (this.FMap.has(K)) {
        Result.Create(Key,rtl.getObject(this.FMap.get(K)));
        this.FMap.delete(K);
      } else Result.Create(Key,null);
      return Result;
    };
    this.Clear = function () {
      var Iter = null;
      var IVal = null;
      var A = [];
      var K = "";
      var V = null;
      if (this.CanClearMap()) {
        this.FMap.clear()}
       else {
        Iter = this.FMap.entries();
        do {
          IVal = Iter.next();
          if (!IVal.done) {
            A = IVal.value;
            K = "" + A[0];
            V = rtl.getObject(A[1]);
            this.FMap.delete(K);
            this.PairNotify(K,V,$mod.TCollectionNotification.cnRemoved);
          };
        } while (!IVal.done);
      };
    };
    this.TryGetValue = function (Key, Value) {
      var Result = false;
      var K = "";
      K = this.GetEffectiveKey(Key);
      Result = this.FMap.has(K);
      if (Result) Value.set(rtl.getObject(this.FMap.get(K)));
      return Result;
    };
    this.AddOrSetValue = function (Key, Value) {
      var k = "";
      k = this.GetEffectiveKey(Key);
      if (!this.FMap.has(k)) {
        this.DoAdd(Key,Value)}
       else this.SetItem(k,Value);
    };
    this.ContainsKey = function (Key) {
      var Result = false;
      Result = this.FMap.has(this.GetEffectiveKey(Key));
      return Result;
    };
    this.ContainsValue = function (Value) {
      var Result = false;
      var It = null;
      var Res = null;
      Result = false;
      It = this.FMap.values();
      do {
        Res = It.next();
        if (!Res.done) Result = Value === rtl.getObject(Res.value);
      } while (!(Result || Res.done));
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      Result = $mod.TEnumerable$$$G$$generics$collections$$TPair$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataGroup$.ToArray.call(this);
      return Result;
    };
    this.GetKeys = function () {
      var Result = null;
      if (this.FKeyCollection === null) this.FKeyCollection = this.TKeyCollection.$create("Create$1",[this]);
      Result = this.FKeyCollection;
      return Result;
    };
    this.GetValues = function () {
      var Result = null;
      if (this.FValueCollection === null) this.FValueCollection = this.TValueCollection.$create("Create$1",[this]);
      Result = this.FValueCollection;
      return Result;
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
  },"TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataGroup>");
  rtl.createClass(this,"TObjectDictionary$$$G$$generics$collections$$String$$TTMSFNCDataGridDataGroup",this.TDictionary$$$G$$generics$collections$$String$$TTMSFNCDataGridDataGroup,function () {
    this.$initSpec = function () {
    };
    this.$init = function () {
      $mod.TDictionary$$$G$$generics$collections$$String$$TTMSFNCDataGridDataGroup.$init.call(this);
      this.FOwnerships = {};
    };
    this.$final = function () {
      this.FOwnerships = undefined;
      $mod.TDictionary$$$G$$generics$collections$$String$$TTMSFNCDataGridDataGroup.$final.call(this);
    };
    this.CanClearMap = function () {
      var Result = false;
      Result = $mod.TDictionary$$$G$$generics$collections$$String$$TTMSFNCDataGridDataGroup.CanClearMap.call(this) && rtl.eqSet(this.FOwnerships,{});
      return Result;
    };
    this.KeyNotify = function (Key, Action) {
      $mod.TDictionary$$$G$$generics$collections$$String$$TTMSFNCDataGridDataGroup.KeyNotify.call(this,Key,Action);
      if (($mod.TDictionaryOwnership.doOwnsKeys in this.FOwnerships) && (Action === $mod.TCollectionNotification.cnRemoved)) Key = rtl.freeLoc(Key);
    };
    this.ValueNotify = function (Value, Action) {
      $mod.TDictionary$$$G$$generics$collections$$String$$TTMSFNCDataGridDataGroup.ValueNotify.call(this,Value,Action);
      if (($mod.TDictionaryOwnership.doOwnsValues in this.FOwnerships) && (Action === $mod.TCollectionNotification.cnRemoved)) Value = rtl.freeLoc(Value);
    };
    this.Create$4 = function (aOwnerships, ACapacity) {
      this.FOwnerships = rtl.refSet(aOwnerships);
      $mod.TDictionary$$$G$$generics$collections$$String$$TTMSFNCDataGridDataGroup.Create$1.call(this,ACapacity);
      return this;
    };
    this.Create$5 = function (aOwnerships) {
      $mod.TDictionary$$$G$$generics$collections$$String$$TTMSFNCDataGridDataGroup.Create$1.call(this,0);
      this.FOwnerships = rtl.refSet(aOwnerships);
      return this;
    };
  },"TObjectDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataGroup>");
  rtl.recNewT(this,"TPair$$$G$$generics$collections$$String$$TTMSFNCDataGridDataColumnCalculationArray",function () {
    var $r = $mod.$rtti.$Record("TPair<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>",{},this);
    this.$initSpec = function () {
      this.Key = "";
      $r.addField("Key",rtl.string);
      $r.addField("Value",pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataColumnCalculationArray"]);
      $r.addMethod("Create",2,[["AKey",rtl.string,2],["AValue",pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataColumnCalculationArray"],2]]);
    };
    this.$new = function () {
      var r = Object.create(this);
      r.Value = [];
      return r;
    };
    this.$eq = function (b) {
      return (this.Key === b.Key) && (this.Value === b.Value);
    };
    this.$assign = function (s) {
      this.Key = s.Key;
      this.Value = rtl.arrayRef(s.Value);
      return this;
    };
    this.Create = function (AKey, AValue) {
      this.Key = AKey;
      this.Value = rtl.arrayRef(AValue);
      return this;
    };
  });
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TPair$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$",pas.System.TObject,function () {
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<Generics.Collections.TPair<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TPair$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$",pas.System.TObject,function () {
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push($mod.TPair$$$G$$generics$collections$$String$$TTMSFNCDataGridDataColumnCalculationArray.$clone(LEnumerator.DoGetCurrent()));
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<Generics.Collections.TPair<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>>");
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridDataColumnCalculationArray",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridDataColumnCalculationArray",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push(LEnumerator.DoGetCurrent());
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>");
  this.$rtti.$MethodVar("TCollectionNotifyEvent<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>",{init: function () {
      this.procsig = rtl.newTIProcSig([["ASender",pas.System.$rtti["TObject"]],["AItem",pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataColumnCalculationArray"],2],["AAction",$mod.$rtti["TCollectionNotification"]]]);
    }, methodkind: 0});
  rtl.createClass(this,"TDictionary$$$G$$generics$collections$$String$$TTMSFNCDataGridDataColumnCalculationArray",this.TEnumerable$$$G$$generics$collections$$TPair$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$,function () {
    this.$initSpec = function () {
      rtl.createClass(this,"TPairEnumerator",$mod.TEnumerator$$$G$$generics$collections$$TPair$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$,function () {
        this.$init = function () {
          $mod.TEnumerator$$$G$$generics$collections$$TPair$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$.$init.call(this);
          this.FIter = null;
          this.FVal = null;
        };
        this.$final = function () {
          this.FIter = undefined;
          this.FVal = undefined;
          $mod.TEnumerator$$$G$$generics$collections$$TPair$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$.$final.call(this);
        };
        this.GetCurrent = function () {
          var Result = $mod.TPair$$$G$$generics$collections$$String$$TTMSFNCDataGridDataColumnCalculationArray.$new();
          Result.$assign(this.DoGetCurrent());
          return Result;
        };
        this.DoGetCurrent = function () {
          var Result = $mod.TPair$$$G$$generics$collections$$String$$TTMSFNCDataGridDataColumnCalculationArray.$new();
          var A = [];
          A = this.FVal.value;
          Result.$assign($mod.TPair$$$G$$generics$collections$$String$$TTMSFNCDataGridDataColumnCalculationArray.$new());
          Result.Create("" + A[0],A[1]);
          return Result;
        };
        this.DoMoveNext = function () {
          var Result = false;
          this.FVal = this.FIter.next();
          Result = !this.FVal.done;
          return Result;
        };
        this.Create$1 = function (ADictionary) {
          this.FIter = ADictionary.FMap.entries();
          return this;
        };
        this.MoveNext$1 = function () {
          var Result = false;
          Result = this.DoMoveNext();
          return Result;
        };
      },"TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>.TPairEnumerator");
      rtl.createClass(this,"TKeyEnumerator",$mod.TEnumerator$$$G$$generics$collections$$String,function () {
        this.$init = function () {
          $mod.TEnumerator$$$G$$generics$collections$$String.$init.call(this);
          this.FIter = null;
          this.FVal = null;
        };
        this.$final = function () {
          this.FIter = undefined;
          this.FVal = undefined;
          $mod.TEnumerator$$$G$$generics$collections$$String.$final.call(this);
        };
        this.GetCurrent = function () {
          var Result = "";
          Result = this.DoGetCurrent();
          return Result;
        };
        this.DoGetCurrent = function () {
          var Result = "";
          Result = "" + this.FVal.value;
          return Result;
        };
        this.DoMoveNext = function () {
          var Result = false;
          this.FVal = this.FIter.next();
          Result = !this.FVal.done;
          return Result;
        };
        this.Create$1 = function (AIter) {
          this.FIter = AIter;
          return this;
        };
        this.Create$2 = function (ADictionary) {
          this.Create$1(ADictionary.FMap.keys());
          return this;
        };
        this.MoveNext$1 = function () {
          var Result = false;
          Result = this.DoMoveNext();
          return Result;
        };
      },"TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>.TKeyEnumerator");
      rtl.createClass(this,"TValueEnumerator",$mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridDataColumnCalculationArray,function () {
        this.$init = function () {
          $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridDataColumnCalculationArray.$init.call(this);
          this.FIter = null;
          this.FVal = null;
        };
        this.$final = function () {
          this.FIter = undefined;
          this.FVal = undefined;
          $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridDataColumnCalculationArray.$final.call(this);
        };
        this.GetCurrent = function () {
          var Result = [];
          Result = this.DoGetCurrent();
          return Result;
        };
        this.DoGetCurrent = function () {
          var Result = [];
          Result = this.FVal.value;
          return Result;
        };
        this.DoMoveNext = function () {
          var Result = false;
          this.FVal = this.FIter.next();
          Result = !this.FVal.done;
          return Result;
        };
        this.Create$1 = function (AIter) {
          this.FIter = AIter;
          return this;
        };
        this.Create$2 = function (ADictionary) {
          this.Create$1(ADictionary.FMap.values());
          return this;
        };
        this.MoveNext$1 = function () {
          var Result = false;
          Result = this.DoMoveNext();
          return Result;
        };
      },"TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>.TValueEnumerator");
      rtl.createClass(this,"TValueCollection",$mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridDataColumnCalculationArray,function () {
        this.$init = function () {
          $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridDataColumnCalculationArray.$init.call(this);
          this.FMap = null;
        };
        this.$final = function () {
          this.FMap = undefined;
          $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridDataColumnCalculationArray.$final.call(this);
        };
        this.GetCount = function () {
          var Result = 0;
          Result = this.FMap.size;
          return Result;
        };
        this.DoGetEnumerator = function () {
          var Result = null;
          Result = $mod.TDictionary$$$G$$generics$collections$$String$$TTMSFNCDataGridDataColumnCalculationArray.TValueEnumerator.$create("Create$1",[this.FMap.values()]);
          return Result;
        };
        this.Create$1 = function (ADictionary) {
          this.FMap = ADictionary.FMap;
          return this;
        };
        this.GetEnumerator$1 = function () {
          var Result = null;
          Result = this.DoGetEnumerator();
          return Result;
        };
        this.ToArray = function () {
          var Result = [];
          var I = 0;
          var P = [];
          Result = rtl.arraySetLength(Result,[],this.FMap.size);
          var $in = this.GetEnumerator$1();
          try {
            while ($in.MoveNext$1()) {
              P = $in.GetCurrent();
              Result[I] = rtl.arrayRef(P);
              I += 1;
            }
          } finally {
            $in = rtl.freeLoc($in)
          };
          return Result;
        };
      },"TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>.TValueCollection");
      rtl.createClass(this,"TKeyCollection",$mod.TEnumerable$$$G$$generics$collections$$String,function () {
        this.$init = function () {
          $mod.TEnumerable$$$G$$generics$collections$$String.$init.call(this);
          this.FMap = null;
        };
        this.$final = function () {
          this.FMap = undefined;
          $mod.TEnumerable$$$G$$generics$collections$$String.$final.call(this);
        };
        this.GetCount = function () {
          var Result = 0;
          Result = this.FMap.size;
          return Result;
        };
        this.DoGetEnumerator = function () {
          var Result = null;
          Result = this.GetEnumerator$1();
          return Result;
        };
        this.Create$1 = function (ADictionary) {
          this.FMap = ADictionary.FMap;
          return this;
        };
        this.GetEnumerator$1 = function () {
          var Result = null;
          Result = $mod.TDictionary$$$G$$generics$collections$$String$$TTMSFNCDataGridDataColumnCalculationArray.TKeyEnumerator.$create("Create$1",[this.FMap.keys()]);
          return Result;
        };
        this.ToArray = function () {
          var Result = [];
          Result = $mod.TEnumerable$$$G$$generics$collections$$String.ToArray.call(this);
          return Result;
        };
      },"TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>.TKeyCollection");
    };
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$TPair$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$.$init.call(this);
      this.FMap = null;
      this.FComparer = null;
      this.FOnKeyNotify = null;
      this.FOnValueNotify = null;
      this.FKeyCollection = null;
      this.FValueCollection = null;
    };
    this.$final = function () {
      this.FMap = undefined;
      rtl.setIntfP(this,"FComparer",null);
      this.FOnKeyNotify = undefined;
      this.FOnValueNotify = undefined;
      this.FKeyCollection = undefined;
      this.FValueCollection = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$TPair$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$.$final.call(this);
    };
    this.GetEffectiveKey = function (Key) {
      var Result = "";
      var it = null;
      var v = null;
      if (!(this.FComparer != null)) return Key;
      it = this.FMap.keys();
      v = it.next();
      while (!v.done) {
        Result = "" + v.value;
        if (this.FComparer.Compare(Result,Key) === 0) return Result;
        v = it.next();
      };
      Result = Key;
      return Result;
    };
    this.GetItem = function (Key) {
      var Result = [];
      var V = undefined;
      V = this.FMap.get(this.GetEffectiveKey(Key));
      if (pas.JS.isUndefined(V)) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictKeyNotFound")]);
      Result = V;
      return Result;
    };
    this.SetItem = function (Key, Value) {
      var V = undefined;
      V = this.FMap.get(this.GetEffectiveKey(Key));
      if (!pas.JS.isUndefined(V)) this.ValueNotify(V,$mod.TCollectionNotification.cnRemoved);
      this.FMap.set(Key,Value);
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoAdd = function (Key, Value) {
      this.FMap.set(this.GetEffectiveKey(Key),Value);
      this.KeyNotify(Key,$mod.TCollectionNotification.cnAdded);
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoRemove = function (Key, Notification) {
      var Result = [];
      var V = undefined;
      var K = "";
      K = this.GetEffectiveKey(Key);
      V = this.FMap.get(K);
      if (!pas.JS.isUndefined(V)) {
        this.FMap.delete(K);
        Result = V;
        this.KeyNotify(Key,Notification);
        this.ValueNotify(Result,Notification);
      };
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FMap.size;
      return Result;
    };
    this.CanClearMap = function () {
      var Result = false;
      Result = (this.FOnKeyNotify === null) && (this.FOnValueNotify === null);
      return Result;
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.PairNotify = function (Key, Value, Action) {
      this.KeyNotify(Key,Action);
      this.ValueNotify(Value,Action);
    };
    this.KeyNotify = function (Key, Action) {
      if (this.FOnKeyNotify != null) this.FOnKeyNotify(this,Key,Action);
    };
    this.ValueNotify = function (Value, Action) {
      if (this.FOnValueNotify != null) this.FOnValueNotify(this,Value,Action);
    };
    this.Create$1 = function (ACapacity) {
      this.FMap = new Map();
      if (ACapacity > 0) ;
      return this;
    };
    this.Create$2 = function (Collection) {
      var aPair = $mod.TPair$$$G$$generics$collections$$String$$TTMSFNCDataGridDataColumnCalculationArray.$new();
      this.Create$1(0);
      var $in = Collection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          aPair = $in.DoGetCurrent();
          this.Add(aPair.Key,aPair.Value);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Create$3 = function (AComparer) {
      this.Create$1(0);
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FKeyCollection;
        }, set: function (v) {
          this.p.FKeyCollection = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FValueCollection;
        }, set: function (v) {
          this.p.FValueCollection = v;
        }});
      this.Clear();
      this.FMap = null;
      pas.System.TObject.Destroy.call(this);
    };
    this.Add = function (Key, Value) {
      if (this.FMap.has(this.GetEffectiveKey(Key))) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictDuplicateKey")]);
      this.DoAdd(Key,Value);
    };
    this.Remove = function (Key) {
      this.DoRemove(Key,$mod.TCollectionNotification.cnRemoved);
    };
    this.ExtractPair = function (Key) {
      var Result = $mod.TPair$$$G$$generics$collections$$String$$TTMSFNCDataGridDataColumnCalculationArray.$new();
      var K = "";
      Result.$assign($mod.TPair$$$G$$generics$collections$$String$$TTMSFNCDataGridDataColumnCalculationArray.$new());
      K = this.GetEffectiveKey(Key);
      if (this.FMap.has(K)) {
        Result.Create(Key,this.FMap.get(K));
        this.FMap.delete(K);
      } else Result.Create(Key,[]);
      return Result;
    };
    this.Clear = function () {
      var Iter = null;
      var IVal = null;
      var A = [];
      var K = "";
      var V = [];
      if (this.CanClearMap()) {
        this.FMap.clear()}
       else {
        Iter = this.FMap.entries();
        do {
          IVal = Iter.next();
          if (!IVal.done) {
            A = IVal.value;
            K = "" + A[0];
            V = A[1];
            this.FMap.delete(K);
            this.PairNotify(K,rtl.arrayRef(V),$mod.TCollectionNotification.cnRemoved);
          };
        } while (!IVal.done);
      };
    };
    this.TryGetValue = function (Key, Value) {
      var Result = false;
      var K = "";
      K = this.GetEffectiveKey(Key);
      Result = this.FMap.has(K);
      if (Result) Value.set(this.FMap.get(K));
      return Result;
    };
    this.AddOrSetValue = function (Key, Value) {
      var k = "";
      k = this.GetEffectiveKey(Key);
      if (!this.FMap.has(k)) {
        this.DoAdd(Key,Value)}
       else this.SetItem(k,Value);
    };
    this.ContainsKey = function (Key) {
      var Result = false;
      Result = this.FMap.has(this.GetEffectiveKey(Key));
      return Result;
    };
    this.ContainsValue = function (Value) {
      var Result = false;
      var It = null;
      var Res = null;
      Result = false;
      It = this.FMap.values();
      do {
        Res = It.next();
        if (!Res.done) Result = Value === Res.value;
      } while (!(Result || Res.done));
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      Result = $mod.TEnumerable$$$G$$generics$collections$$TPair$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$.ToArray.call(this);
      return Result;
    };
    this.GetKeys = function () {
      var Result = null;
      if (this.FKeyCollection === null) this.FKeyCollection = this.TKeyCollection.$create("Create$1",[this]);
      Result = this.FKeyCollection;
      return Result;
    };
    this.GetValues = function () {
      var Result = null;
      if (this.FValueCollection === null) this.FValueCollection = this.TValueCollection.$create("Create$1",[this]);
      Result = this.FValueCollection;
      return Result;
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
  },"TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>");
  rtl.recNewT(this,"TPair$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$",function () {
    this.Key = 0;
    this.Value = null;
    this.$eq = function (b) {
      return (this.Key === b.Key) && (this.Value === b.Value);
    };
    this.$assign = function (s) {
      this.Key = s.Key;
      this.Value = s.Value;
      return this;
    };
    this.Create = function (AKey, AValue) {
      this.Key = AKey;
      this.Value = AValue;
      return this;
    };
    var $r = $mod.$rtti.$Record("TPair<System.Longint,Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>>",{},this);
    $r.addField("Key",rtl.longint);
    $r.addField("Value",$mod.$rtti["TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>"]);
    $r.addMethod("Create",2,[["AKey",rtl.longint,2],["AValue",$mod.$rtti["TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>"],2]]);
  });
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TPair$System$Longint$Generics$Collections$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$$",pas.System.TObject,function () {
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<Generics.Collections.TPair<System.Longint,Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>>>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TPair$System$Longint$Generics$Collections$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$$",pas.System.TObject,function () {
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push($mod.TPair$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$.$clone(LEnumerator.DoGetCurrent()));
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<Generics.Collections.TPair<System.Longint,Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>>>");
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$",pas.System.TObject,function () {
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$",pas.System.TObject,function () {
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push(LEnumerator.DoGetCurrent());
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>>");
  this.$rtti.$MethodVar("TCollectionNotifyEvent<Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>>",{procsig: rtl.newTIProcSig([["ASender",pas.System.$rtti["TObject"]],["AItem",this.$rtti["TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>"],2],["AAction",this.$rtti["TCollectionNotification"]]]), methodkind: 0});
  rtl.createClass(this,"TDictionary$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$",this.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$Generics$Collections$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$$,function () {
    rtl.createClass(this,"TPairEnumerator",$mod.TEnumerator$$$G$$generics$collections$$TPair$System$Longint$Generics$Collections$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$$,function () {
      this.$init = function () {
        $mod.TEnumerator$$$G$$generics$collections$$TPair$System$Longint$Generics$Collections$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$$.$init.call(this);
        this.FIter = null;
        this.FVal = null;
      };
      this.$final = function () {
        this.FIter = undefined;
        this.FVal = undefined;
        $mod.TEnumerator$$$G$$generics$collections$$TPair$System$Longint$Generics$Collections$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$$.$final.call(this);
      };
      this.GetCurrent = function () {
        var Result = $mod.TPair$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$.$new();
        Result.$assign(this.DoGetCurrent());
        return Result;
      };
      this.DoGetCurrent = function () {
        var Result = $mod.TPair$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$.$new();
        var A = [];
        A = this.FVal.value;
        Result.$assign($mod.TPair$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$.$new());
        Result.Create(rtl.trunc(A[0]),rtl.getObject(A[1]));
        return Result;
      };
      this.DoMoveNext = function () {
        var Result = false;
        this.FVal = this.FIter.next();
        Result = !this.FVal.done;
        return Result;
      };
      this.Create$1 = function (ADictionary) {
        this.FIter = ADictionary.FMap.entries();
        return this;
      };
      this.MoveNext$1 = function () {
        var Result = false;
        Result = this.DoMoveNext();
        return Result;
      };
    },"TDictionary<System.Longint,Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>>.TPairEnumerator");
    rtl.createClass(this,"TKeyEnumerator",$mod.TEnumerator$$$G$$generics$collections$$Longint,function () {
      this.$init = function () {
        $mod.TEnumerator$$$G$$generics$collections$$Longint.$init.call(this);
        this.FIter = null;
        this.FVal = null;
      };
      this.$final = function () {
        this.FIter = undefined;
        this.FVal = undefined;
        $mod.TEnumerator$$$G$$generics$collections$$Longint.$final.call(this);
      };
      this.GetCurrent = function () {
        var Result = 0;
        Result = this.DoGetCurrent();
        return Result;
      };
      this.DoGetCurrent = function () {
        var Result = 0;
        Result = rtl.trunc(this.FVal.value);
        return Result;
      };
      this.DoMoveNext = function () {
        var Result = false;
        this.FVal = this.FIter.next();
        Result = !this.FVal.done;
        return Result;
      };
      this.Create$1 = function (AIter) {
        this.FIter = AIter;
        return this;
      };
      this.Create$2 = function (ADictionary) {
        this.Create$1(ADictionary.FMap.keys());
        return this;
      };
      this.MoveNext$1 = function () {
        var Result = false;
        Result = this.DoMoveNext();
        return Result;
      };
    },"TDictionary<System.Longint,Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>>.TKeyEnumerator");
    rtl.createClass(this,"TValueEnumerator",$mod.TEnumerator$$$G$$generics$collections$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$,function () {
      this.$init = function () {
        $mod.TEnumerator$$$G$$generics$collections$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$.$init.call(this);
        this.FIter = null;
        this.FVal = null;
      };
      this.$final = function () {
        this.FIter = undefined;
        this.FVal = undefined;
        $mod.TEnumerator$$$G$$generics$collections$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$.$final.call(this);
      };
      this.GetCurrent = function () {
        var Result = null;
        Result = this.DoGetCurrent();
        return Result;
      };
      this.DoGetCurrent = function () {
        var Result = null;
        Result = rtl.getObject(this.FVal.value);
        return Result;
      };
      this.DoMoveNext = function () {
        var Result = false;
        this.FVal = this.FIter.next();
        Result = !this.FVal.done;
        return Result;
      };
      this.Create$1 = function (AIter) {
        this.FIter = AIter;
        return this;
      };
      this.Create$2 = function (ADictionary) {
        this.Create$1(ADictionary.FMap.values());
        return this;
      };
      this.MoveNext$1 = function () {
        var Result = false;
        Result = this.DoMoveNext();
        return Result;
      };
    },"TDictionary<System.Longint,Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>>.TValueEnumerator");
    rtl.createClass(this,"TValueCollection",$mod.TEnumerable$$$G$$generics$collections$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$,function () {
      this.$init = function () {
        $mod.TEnumerable$$$G$$generics$collections$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$.$init.call(this);
        this.FMap = null;
      };
      this.$final = function () {
        this.FMap = undefined;
        $mod.TEnumerable$$$G$$generics$collections$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$.$final.call(this);
      };
      this.GetCount = function () {
        var Result = 0;
        Result = this.FMap.size;
        return Result;
      };
      this.DoGetEnumerator = function () {
        var Result = null;
        Result = $mod.TDictionary$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$.TValueEnumerator.$create("Create$1",[this.FMap.values()]);
        return Result;
      };
      this.Create$1 = function (ADictionary) {
        this.FMap = ADictionary.FMap;
        return this;
      };
      this.GetEnumerator$1 = function () {
        var Result = null;
        Result = this.DoGetEnumerator();
        return Result;
      };
      this.ToArray = function () {
        var Result = [];
        var I = 0;
        var P = null;
        Result = rtl.arraySetLength(Result,null,this.FMap.size);
        var $in = this.GetEnumerator$1();
        try {
          while ($in.MoveNext$1()) {
            P = $in.GetCurrent();
            Result[I] = P;
            I += 1;
          }
        } finally {
          $in = rtl.freeLoc($in)
        };
        return Result;
      };
    },"TDictionary<System.Longint,Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>>.TValueCollection");
    rtl.createClass(this,"TKeyCollection",$mod.TEnumerable$$$G$$generics$collections$$Longint,function () {
      this.$init = function () {
        $mod.TEnumerable$$$G$$generics$collections$$Longint.$init.call(this);
        this.FMap = null;
      };
      this.$final = function () {
        this.FMap = undefined;
        $mod.TEnumerable$$$G$$generics$collections$$Longint.$final.call(this);
      };
      this.GetCount = function () {
        var Result = 0;
        Result = this.FMap.size;
        return Result;
      };
      this.DoGetEnumerator = function () {
        var Result = null;
        Result = this.GetEnumerator$1();
        return Result;
      };
      this.Create$1 = function (ADictionary) {
        this.FMap = ADictionary.FMap;
        return this;
      };
      this.GetEnumerator$1 = function () {
        var Result = null;
        Result = $mod.TDictionary$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$.TKeyEnumerator.$create("Create$1",[this.FMap.keys()]);
        return Result;
      };
      this.ToArray = function () {
        var Result = [];
        Result = $mod.TEnumerable$$$G$$generics$collections$$Longint.ToArray.call(this);
        return Result;
      };
    },"TDictionary<System.Longint,Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>>.TKeyCollection");
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$Generics$Collections$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$$.$init.call(this);
      this.FMap = null;
      this.FComparer = null;
      this.FOnKeyNotify = null;
      this.FOnValueNotify = null;
      this.FKeyCollection = null;
      this.FValueCollection = null;
    };
    this.$final = function () {
      this.FMap = undefined;
      rtl.setIntfP(this,"FComparer",null);
      this.FOnKeyNotify = undefined;
      this.FOnValueNotify = undefined;
      this.FKeyCollection = undefined;
      this.FValueCollection = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$Generics$Collections$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$$.$final.call(this);
    };
    this.GetEffectiveKey = function (Key) {
      var Result = 0;
      var it = null;
      var v = null;
      if (!(this.FComparer != null)) return Key;
      it = this.FMap.keys();
      v = it.next();
      while (!v.done) {
        Result = rtl.trunc(v.value);
        if (this.FComparer.Compare(Result,Key) === 0) return Result;
        v = it.next();
      };
      Result = Key;
      return Result;
    };
    this.GetItem = function (Key) {
      var Result = null;
      var V = undefined;
      V = this.FMap.get(this.GetEffectiveKey(Key));
      if (pas.JS.isUndefined(V)) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictKeyNotFound")]);
      Result = rtl.getObject(V);
      return Result;
    };
    this.SetItem = function (Key, Value) {
      var V = undefined;
      V = this.FMap.get(this.GetEffectiveKey(Key));
      if (!pas.JS.isUndefined(V)) this.ValueNotify(rtl.getObject(V),$mod.TCollectionNotification.cnRemoved);
      this.FMap.set(Key,Value);
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoAdd = function (Key, Value) {
      this.FMap.set(this.GetEffectiveKey(Key),Value);
      this.KeyNotify(Key,$mod.TCollectionNotification.cnAdded);
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoRemove = function (Key, Notification) {
      var Result = null;
      var V = undefined;
      var K = 0;
      K = this.GetEffectiveKey(Key);
      V = this.FMap.get(K);
      if (!pas.JS.isUndefined(V)) {
        this.FMap.delete(K);
        Result = rtl.getObject(V);
        this.KeyNotify(Key,Notification);
        this.ValueNotify(Result,Notification);
      };
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FMap.size;
      return Result;
    };
    this.CanClearMap = function () {
      var Result = false;
      Result = (this.FOnKeyNotify === null) && (this.FOnValueNotify === null);
      return Result;
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.PairNotify = function (Key, Value, Action) {
      this.KeyNotify(Key,Action);
      this.ValueNotify(Value,Action);
    };
    this.KeyNotify = function (Key, Action) {
      if (this.FOnKeyNotify != null) this.FOnKeyNotify(this,Key,Action);
    };
    this.ValueNotify = function (Value, Action) {
      if (this.FOnValueNotify != null) this.FOnValueNotify(this,Value,Action);
    };
    this.Create$1 = function (ACapacity) {
      this.FMap = new Map();
      if (ACapacity > 0) ;
      return this;
    };
    this.Create$2 = function (Collection) {
      var aPair = $mod.TPair$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$.$new();
      this.Create$1(0);
      var $in = Collection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          aPair = $in.DoGetCurrent();
          this.Add(aPair.Key,aPair.Value);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Create$3 = function (AComparer) {
      this.Create$1(0);
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FKeyCollection;
        }, set: function (v) {
          this.p.FKeyCollection = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FValueCollection;
        }, set: function (v) {
          this.p.FValueCollection = v;
        }});
      this.Clear();
      this.FMap = null;
      pas.System.TObject.Destroy.call(this);
    };
    this.Add = function (Key, Value) {
      if (this.FMap.has(this.GetEffectiveKey(Key))) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictDuplicateKey")]);
      this.DoAdd(Key,Value);
    };
    this.Remove = function (Key) {
      this.DoRemove(Key,$mod.TCollectionNotification.cnRemoved);
    };
    this.ExtractPair = function (Key) {
      var Result = $mod.TPair$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$.$new();
      var K = 0;
      Result.$assign($mod.TPair$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$.$new());
      K = this.GetEffectiveKey(Key);
      if (this.FMap.has(K)) {
        Result.Create(Key,rtl.getObject(this.FMap.get(K)));
        this.FMap.delete(K);
      } else Result.Create(Key,null);
      return Result;
    };
    this.Clear = function () {
      var Iter = null;
      var IVal = null;
      var A = [];
      var K = 0;
      var V = null;
      if (this.CanClearMap()) {
        this.FMap.clear()}
       else {
        Iter = this.FMap.entries();
        do {
          IVal = Iter.next();
          if (!IVal.done) {
            A = IVal.value;
            K = rtl.trunc(A[0]);
            V = rtl.getObject(A[1]);
            this.FMap.delete(K);
            this.PairNotify(K,V,$mod.TCollectionNotification.cnRemoved);
          };
        } while (!IVal.done);
      };
    };
    this.TryGetValue = function (Key, Value) {
      var Result = false;
      var K = 0;
      K = this.GetEffectiveKey(Key);
      Result = this.FMap.has(K);
      if (Result) Value.set(rtl.getObject(this.FMap.get(K)));
      return Result;
    };
    this.AddOrSetValue = function (Key, Value) {
      var k = 0;
      k = this.GetEffectiveKey(Key);
      if (!this.FMap.has(k)) {
        this.DoAdd(Key,Value)}
       else this.SetItem(k,Value);
    };
    this.ContainsKey = function (Key) {
      var Result = false;
      Result = this.FMap.has(this.GetEffectiveKey(Key));
      return Result;
    };
    this.ContainsValue = function (Value) {
      var Result = false;
      var It = null;
      var Res = null;
      Result = false;
      It = this.FMap.values();
      do {
        Res = It.next();
        if (!Res.done) Result = Value === rtl.getObject(Res.value);
      } while (!(Result || Res.done));
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      Result = $mod.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$Generics$Collections$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$$.ToArray.call(this);
      return Result;
    };
    this.GetKeys = function () {
      var Result = null;
      if (this.FKeyCollection === null) this.FKeyCollection = this.TKeyCollection.$create("Create$1",[this]);
      Result = this.FKeyCollection;
      return Result;
    };
    this.GetValues = function () {
      var Result = null;
      if (this.FValueCollection === null) this.FValueCollection = this.TValueCollection.$create("Create$1",[this]);
      Result = this.FValueCollection;
      return Result;
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
  },"TDictionary<System.Longint,Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>>");
  rtl.createClass(this,"TObjectDictionary$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$",this.TDictionary$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$,function () {
    this.$init = function () {
      $mod.TDictionary$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$.$init.call(this);
      this.FOwnerships = {};
    };
    this.$final = function () {
      this.FOwnerships = undefined;
      $mod.TDictionary$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$.$final.call(this);
    };
    this.CanClearMap = function () {
      var Result = false;
      Result = $mod.TDictionary$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$.CanClearMap.call(this) && rtl.eqSet(this.FOwnerships,{});
      return Result;
    };
    this.KeyNotify = function (Key, Action) {
      $mod.TDictionary$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$.KeyNotify.call(this,Key,Action);
      if (($mod.TDictionaryOwnership.doOwnsKeys in this.FOwnerships) && (Action === $mod.TCollectionNotification.cnRemoved)) Key = rtl.freeLoc(Key);
    };
    this.ValueNotify = function (Value, Action) {
      $mod.TDictionary$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$.ValueNotify.call(this,Value,Action);
      if (($mod.TDictionaryOwnership.doOwnsValues in this.FOwnerships) && (Action === $mod.TCollectionNotification.cnRemoved)) Value = rtl.freeLoc(Value);
    };
    this.Create$4 = function (aOwnerships, ACapacity) {
      this.FOwnerships = rtl.refSet(aOwnerships);
      $mod.TDictionary$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$.Create$1.call(this,ACapacity);
      return this;
    };
    this.Create$5 = function (aOwnerships) {
      $mod.TDictionary$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$.Create$1.call(this,0);
      this.FOwnerships = rtl.refSet(aOwnerships);
      return this;
    };
  },"TObjectDictionary<System.Longint,Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>>");
  rtl.recNewT(this,"TPair$$$G$$generics$collections$$String$$TTMSFNCDataGridDataRowCalculationArray",function () {
    var $r = $mod.$rtti.$Record("TPair<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>",{},this);
    this.$initSpec = function () {
      this.Key = "";
      $r.addField("Key",rtl.string);
      $r.addField("Value",pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataRowCalculationArray"]);
      $r.addMethod("Create",2,[["AKey",rtl.string,2],["AValue",pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataRowCalculationArray"],2]]);
    };
    this.$new = function () {
      var r = Object.create(this);
      r.Value = [];
      return r;
    };
    this.$eq = function (b) {
      return (this.Key === b.Key) && (this.Value === b.Value);
    };
    this.$assign = function (s) {
      this.Key = s.Key;
      this.Value = rtl.arrayRef(s.Value);
      return this;
    };
    this.Create = function (AKey, AValue) {
      this.Key = AKey;
      this.Value = rtl.arrayRef(AValue);
      return this;
    };
  });
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TPair$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$",pas.System.TObject,function () {
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<Generics.Collections.TPair<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TPair$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$",pas.System.TObject,function () {
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push($mod.TPair$$$G$$generics$collections$$String$$TTMSFNCDataGridDataRowCalculationArray.$clone(LEnumerator.DoGetCurrent()));
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<Generics.Collections.TPair<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>>");
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridDataRowCalculationArray",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridDataRowCalculationArray",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push(LEnumerator.DoGetCurrent());
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>");
  this.$rtti.$MethodVar("TCollectionNotifyEvent<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>",{init: function () {
      this.procsig = rtl.newTIProcSig([["ASender",pas.System.$rtti["TObject"]],["AItem",pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataRowCalculationArray"],2],["AAction",$mod.$rtti["TCollectionNotification"]]]);
    }, methodkind: 0});
  rtl.createClass(this,"TDictionary$$$G$$generics$collections$$String$$TTMSFNCDataGridDataRowCalculationArray",this.TEnumerable$$$G$$generics$collections$$TPair$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$,function () {
    this.$initSpec = function () {
      rtl.createClass(this,"TPairEnumerator",$mod.TEnumerator$$$G$$generics$collections$$TPair$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$,function () {
        this.$init = function () {
          $mod.TEnumerator$$$G$$generics$collections$$TPair$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$.$init.call(this);
          this.FIter = null;
          this.FVal = null;
        };
        this.$final = function () {
          this.FIter = undefined;
          this.FVal = undefined;
          $mod.TEnumerator$$$G$$generics$collections$$TPair$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$.$final.call(this);
        };
        this.GetCurrent = function () {
          var Result = $mod.TPair$$$G$$generics$collections$$String$$TTMSFNCDataGridDataRowCalculationArray.$new();
          Result.$assign(this.DoGetCurrent());
          return Result;
        };
        this.DoGetCurrent = function () {
          var Result = $mod.TPair$$$G$$generics$collections$$String$$TTMSFNCDataGridDataRowCalculationArray.$new();
          var A = [];
          A = this.FVal.value;
          Result.$assign($mod.TPair$$$G$$generics$collections$$String$$TTMSFNCDataGridDataRowCalculationArray.$new());
          Result.Create("" + A[0],A[1]);
          return Result;
        };
        this.DoMoveNext = function () {
          var Result = false;
          this.FVal = this.FIter.next();
          Result = !this.FVal.done;
          return Result;
        };
        this.Create$1 = function (ADictionary) {
          this.FIter = ADictionary.FMap.entries();
          return this;
        };
        this.MoveNext$1 = function () {
          var Result = false;
          Result = this.DoMoveNext();
          return Result;
        };
      },"TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>.TPairEnumerator");
      rtl.createClass(this,"TKeyEnumerator",$mod.TEnumerator$$$G$$generics$collections$$String,function () {
        this.$init = function () {
          $mod.TEnumerator$$$G$$generics$collections$$String.$init.call(this);
          this.FIter = null;
          this.FVal = null;
        };
        this.$final = function () {
          this.FIter = undefined;
          this.FVal = undefined;
          $mod.TEnumerator$$$G$$generics$collections$$String.$final.call(this);
        };
        this.GetCurrent = function () {
          var Result = "";
          Result = this.DoGetCurrent();
          return Result;
        };
        this.DoGetCurrent = function () {
          var Result = "";
          Result = "" + this.FVal.value;
          return Result;
        };
        this.DoMoveNext = function () {
          var Result = false;
          this.FVal = this.FIter.next();
          Result = !this.FVal.done;
          return Result;
        };
        this.Create$1 = function (AIter) {
          this.FIter = AIter;
          return this;
        };
        this.Create$2 = function (ADictionary) {
          this.Create$1(ADictionary.FMap.keys());
          return this;
        };
        this.MoveNext$1 = function () {
          var Result = false;
          Result = this.DoMoveNext();
          return Result;
        };
      },"TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>.TKeyEnumerator");
      rtl.createClass(this,"TValueEnumerator",$mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridDataRowCalculationArray,function () {
        this.$init = function () {
          $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridDataRowCalculationArray.$init.call(this);
          this.FIter = null;
          this.FVal = null;
        };
        this.$final = function () {
          this.FIter = undefined;
          this.FVal = undefined;
          $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridDataRowCalculationArray.$final.call(this);
        };
        this.GetCurrent = function () {
          var Result = [];
          Result = this.DoGetCurrent();
          return Result;
        };
        this.DoGetCurrent = function () {
          var Result = [];
          Result = this.FVal.value;
          return Result;
        };
        this.DoMoveNext = function () {
          var Result = false;
          this.FVal = this.FIter.next();
          Result = !this.FVal.done;
          return Result;
        };
        this.Create$1 = function (AIter) {
          this.FIter = AIter;
          return this;
        };
        this.Create$2 = function (ADictionary) {
          this.Create$1(ADictionary.FMap.values());
          return this;
        };
        this.MoveNext$1 = function () {
          var Result = false;
          Result = this.DoMoveNext();
          return Result;
        };
      },"TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>.TValueEnumerator");
      rtl.createClass(this,"TValueCollection",$mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridDataRowCalculationArray,function () {
        this.$init = function () {
          $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridDataRowCalculationArray.$init.call(this);
          this.FMap = null;
        };
        this.$final = function () {
          this.FMap = undefined;
          $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridDataRowCalculationArray.$final.call(this);
        };
        this.GetCount = function () {
          var Result = 0;
          Result = this.FMap.size;
          return Result;
        };
        this.DoGetEnumerator = function () {
          var Result = null;
          Result = $mod.TDictionary$$$G$$generics$collections$$String$$TTMSFNCDataGridDataRowCalculationArray.TValueEnumerator.$create("Create$1",[this.FMap.values()]);
          return Result;
        };
        this.Create$1 = function (ADictionary) {
          this.FMap = ADictionary.FMap;
          return this;
        };
        this.GetEnumerator$1 = function () {
          var Result = null;
          Result = this.DoGetEnumerator();
          return Result;
        };
        this.ToArray = function () {
          var Result = [];
          var I = 0;
          var P = [];
          Result = rtl.arraySetLength(Result,[],this.FMap.size);
          var $in = this.GetEnumerator$1();
          try {
            while ($in.MoveNext$1()) {
              P = $in.GetCurrent();
              Result[I] = rtl.arrayRef(P);
              I += 1;
            }
          } finally {
            $in = rtl.freeLoc($in)
          };
          return Result;
        };
      },"TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>.TValueCollection");
      rtl.createClass(this,"TKeyCollection",$mod.TEnumerable$$$G$$generics$collections$$String,function () {
        this.$init = function () {
          $mod.TEnumerable$$$G$$generics$collections$$String.$init.call(this);
          this.FMap = null;
        };
        this.$final = function () {
          this.FMap = undefined;
          $mod.TEnumerable$$$G$$generics$collections$$String.$final.call(this);
        };
        this.GetCount = function () {
          var Result = 0;
          Result = this.FMap.size;
          return Result;
        };
        this.DoGetEnumerator = function () {
          var Result = null;
          Result = this.GetEnumerator$1();
          return Result;
        };
        this.Create$1 = function (ADictionary) {
          this.FMap = ADictionary.FMap;
          return this;
        };
        this.GetEnumerator$1 = function () {
          var Result = null;
          Result = $mod.TDictionary$$$G$$generics$collections$$String$$TTMSFNCDataGridDataRowCalculationArray.TKeyEnumerator.$create("Create$1",[this.FMap.keys()]);
          return Result;
        };
        this.ToArray = function () {
          var Result = [];
          Result = $mod.TEnumerable$$$G$$generics$collections$$String.ToArray.call(this);
          return Result;
        };
      },"TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>.TKeyCollection");
    };
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$TPair$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$.$init.call(this);
      this.FMap = null;
      this.FComparer = null;
      this.FOnKeyNotify = null;
      this.FOnValueNotify = null;
      this.FKeyCollection = null;
      this.FValueCollection = null;
    };
    this.$final = function () {
      this.FMap = undefined;
      rtl.setIntfP(this,"FComparer",null);
      this.FOnKeyNotify = undefined;
      this.FOnValueNotify = undefined;
      this.FKeyCollection = undefined;
      this.FValueCollection = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$TPair$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$.$final.call(this);
    };
    this.GetEffectiveKey = function (Key) {
      var Result = "";
      var it = null;
      var v = null;
      if (!(this.FComparer != null)) return Key;
      it = this.FMap.keys();
      v = it.next();
      while (!v.done) {
        Result = "" + v.value;
        if (this.FComparer.Compare(Result,Key) === 0) return Result;
        v = it.next();
      };
      Result = Key;
      return Result;
    };
    this.GetItem = function (Key) {
      var Result = [];
      var V = undefined;
      V = this.FMap.get(this.GetEffectiveKey(Key));
      if (pas.JS.isUndefined(V)) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictKeyNotFound")]);
      Result = V;
      return Result;
    };
    this.SetItem = function (Key, Value) {
      var V = undefined;
      V = this.FMap.get(this.GetEffectiveKey(Key));
      if (!pas.JS.isUndefined(V)) this.ValueNotify(V,$mod.TCollectionNotification.cnRemoved);
      this.FMap.set(Key,Value);
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoAdd = function (Key, Value) {
      this.FMap.set(this.GetEffectiveKey(Key),Value);
      this.KeyNotify(Key,$mod.TCollectionNotification.cnAdded);
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoRemove = function (Key, Notification) {
      var Result = [];
      var V = undefined;
      var K = "";
      K = this.GetEffectiveKey(Key);
      V = this.FMap.get(K);
      if (!pas.JS.isUndefined(V)) {
        this.FMap.delete(K);
        Result = V;
        this.KeyNotify(Key,Notification);
        this.ValueNotify(Result,Notification);
      };
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FMap.size;
      return Result;
    };
    this.CanClearMap = function () {
      var Result = false;
      Result = (this.FOnKeyNotify === null) && (this.FOnValueNotify === null);
      return Result;
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.PairNotify = function (Key, Value, Action) {
      this.KeyNotify(Key,Action);
      this.ValueNotify(Value,Action);
    };
    this.KeyNotify = function (Key, Action) {
      if (this.FOnKeyNotify != null) this.FOnKeyNotify(this,Key,Action);
    };
    this.ValueNotify = function (Value, Action) {
      if (this.FOnValueNotify != null) this.FOnValueNotify(this,Value,Action);
    };
    this.Create$1 = function (ACapacity) {
      this.FMap = new Map();
      if (ACapacity > 0) ;
      return this;
    };
    this.Create$2 = function (Collection) {
      var aPair = $mod.TPair$$$G$$generics$collections$$String$$TTMSFNCDataGridDataRowCalculationArray.$new();
      this.Create$1(0);
      var $in = Collection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          aPair = $in.DoGetCurrent();
          this.Add(aPair.Key,aPair.Value);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Create$3 = function (AComparer) {
      this.Create$1(0);
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FKeyCollection;
        }, set: function (v) {
          this.p.FKeyCollection = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FValueCollection;
        }, set: function (v) {
          this.p.FValueCollection = v;
        }});
      this.Clear();
      this.FMap = null;
      pas.System.TObject.Destroy.call(this);
    };
    this.Add = function (Key, Value) {
      if (this.FMap.has(this.GetEffectiveKey(Key))) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictDuplicateKey")]);
      this.DoAdd(Key,Value);
    };
    this.Remove = function (Key) {
      this.DoRemove(Key,$mod.TCollectionNotification.cnRemoved);
    };
    this.ExtractPair = function (Key) {
      var Result = $mod.TPair$$$G$$generics$collections$$String$$TTMSFNCDataGridDataRowCalculationArray.$new();
      var K = "";
      Result.$assign($mod.TPair$$$G$$generics$collections$$String$$TTMSFNCDataGridDataRowCalculationArray.$new());
      K = this.GetEffectiveKey(Key);
      if (this.FMap.has(K)) {
        Result.Create(Key,this.FMap.get(K));
        this.FMap.delete(K);
      } else Result.Create(Key,[]);
      return Result;
    };
    this.Clear = function () {
      var Iter = null;
      var IVal = null;
      var A = [];
      var K = "";
      var V = [];
      if (this.CanClearMap()) {
        this.FMap.clear()}
       else {
        Iter = this.FMap.entries();
        do {
          IVal = Iter.next();
          if (!IVal.done) {
            A = IVal.value;
            K = "" + A[0];
            V = A[1];
            this.FMap.delete(K);
            this.PairNotify(K,rtl.arrayRef(V),$mod.TCollectionNotification.cnRemoved);
          };
        } while (!IVal.done);
      };
    };
    this.TryGetValue = function (Key, Value) {
      var Result = false;
      var K = "";
      K = this.GetEffectiveKey(Key);
      Result = this.FMap.has(K);
      if (Result) Value.set(this.FMap.get(K));
      return Result;
    };
    this.AddOrSetValue = function (Key, Value) {
      var k = "";
      k = this.GetEffectiveKey(Key);
      if (!this.FMap.has(k)) {
        this.DoAdd(Key,Value)}
       else this.SetItem(k,Value);
    };
    this.ContainsKey = function (Key) {
      var Result = false;
      Result = this.FMap.has(this.GetEffectiveKey(Key));
      return Result;
    };
    this.ContainsValue = function (Value) {
      var Result = false;
      var It = null;
      var Res = null;
      Result = false;
      It = this.FMap.values();
      do {
        Res = It.next();
        if (!Res.done) Result = Value === Res.value;
      } while (!(Result || Res.done));
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      Result = $mod.TEnumerable$$$G$$generics$collections$$TPair$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$.ToArray.call(this);
      return Result;
    };
    this.GetKeys = function () {
      var Result = null;
      if (this.FKeyCollection === null) this.FKeyCollection = this.TKeyCollection.$create("Create$1",[this]);
      Result = this.FKeyCollection;
      return Result;
    };
    this.GetValues = function () {
      var Result = null;
      if (this.FValueCollection === null) this.FValueCollection = this.TValueCollection.$create("Create$1",[this]);
      Result = this.FValueCollection;
      return Result;
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
  },"TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>");
  rtl.recNewT(this,"TPair$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$",function () {
    this.Key = 0;
    this.Value = null;
    this.$eq = function (b) {
      return (this.Key === b.Key) && (this.Value === b.Value);
    };
    this.$assign = function (s) {
      this.Key = s.Key;
      this.Value = s.Value;
      return this;
    };
    this.Create = function (AKey, AValue) {
      this.Key = AKey;
      this.Value = AValue;
      return this;
    };
    var $r = $mod.$rtti.$Record("TPair<System.Longint,Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>>",{},this);
    $r.addField("Key",rtl.longint);
    $r.addField("Value",$mod.$rtti["TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>"]);
    $r.addMethod("Create",2,[["AKey",rtl.longint,2],["AValue",$mod.$rtti["TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>"],2]]);
  });
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TPair$System$Longint$Generics$Collections$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$$",pas.System.TObject,function () {
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<Generics.Collections.TPair<System.Longint,Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>>>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TPair$System$Longint$Generics$Collections$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$$",pas.System.TObject,function () {
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push($mod.TPair$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$.$clone(LEnumerator.DoGetCurrent()));
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<Generics.Collections.TPair<System.Longint,Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>>>");
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$",pas.System.TObject,function () {
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$",pas.System.TObject,function () {
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push(LEnumerator.DoGetCurrent());
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>>");
  this.$rtti.$MethodVar("TCollectionNotifyEvent<Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>>",{procsig: rtl.newTIProcSig([["ASender",pas.System.$rtti["TObject"]],["AItem",this.$rtti["TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>"],2],["AAction",this.$rtti["TCollectionNotification"]]]), methodkind: 0});
  rtl.createClass(this,"TDictionary$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$",this.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$Generics$Collections$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$$,function () {
    rtl.createClass(this,"TPairEnumerator",$mod.TEnumerator$$$G$$generics$collections$$TPair$System$Longint$Generics$Collections$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$$,function () {
      this.$init = function () {
        $mod.TEnumerator$$$G$$generics$collections$$TPair$System$Longint$Generics$Collections$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$$.$init.call(this);
        this.FIter = null;
        this.FVal = null;
      };
      this.$final = function () {
        this.FIter = undefined;
        this.FVal = undefined;
        $mod.TEnumerator$$$G$$generics$collections$$TPair$System$Longint$Generics$Collections$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$$.$final.call(this);
      };
      this.GetCurrent = function () {
        var Result = $mod.TPair$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$.$new();
        Result.$assign(this.DoGetCurrent());
        return Result;
      };
      this.DoGetCurrent = function () {
        var Result = $mod.TPair$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$.$new();
        var A = [];
        A = this.FVal.value;
        Result.$assign($mod.TPair$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$.$new());
        Result.Create(rtl.trunc(A[0]),rtl.getObject(A[1]));
        return Result;
      };
      this.DoMoveNext = function () {
        var Result = false;
        this.FVal = this.FIter.next();
        Result = !this.FVal.done;
        return Result;
      };
      this.Create$1 = function (ADictionary) {
        this.FIter = ADictionary.FMap.entries();
        return this;
      };
      this.MoveNext$1 = function () {
        var Result = false;
        Result = this.DoMoveNext();
        return Result;
      };
    },"TDictionary<System.Longint,Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>>.TPairEnumerator");
    rtl.createClass(this,"TKeyEnumerator",$mod.TEnumerator$$$G$$generics$collections$$Longint,function () {
      this.$init = function () {
        $mod.TEnumerator$$$G$$generics$collections$$Longint.$init.call(this);
        this.FIter = null;
        this.FVal = null;
      };
      this.$final = function () {
        this.FIter = undefined;
        this.FVal = undefined;
        $mod.TEnumerator$$$G$$generics$collections$$Longint.$final.call(this);
      };
      this.GetCurrent = function () {
        var Result = 0;
        Result = this.DoGetCurrent();
        return Result;
      };
      this.DoGetCurrent = function () {
        var Result = 0;
        Result = rtl.trunc(this.FVal.value);
        return Result;
      };
      this.DoMoveNext = function () {
        var Result = false;
        this.FVal = this.FIter.next();
        Result = !this.FVal.done;
        return Result;
      };
      this.Create$1 = function (AIter) {
        this.FIter = AIter;
        return this;
      };
      this.Create$2 = function (ADictionary) {
        this.Create$1(ADictionary.FMap.keys());
        return this;
      };
      this.MoveNext$1 = function () {
        var Result = false;
        Result = this.DoMoveNext();
        return Result;
      };
    },"TDictionary<System.Longint,Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>>.TKeyEnumerator");
    rtl.createClass(this,"TValueEnumerator",$mod.TEnumerator$$$G$$generics$collections$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$,function () {
      this.$init = function () {
        $mod.TEnumerator$$$G$$generics$collections$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$.$init.call(this);
        this.FIter = null;
        this.FVal = null;
      };
      this.$final = function () {
        this.FIter = undefined;
        this.FVal = undefined;
        $mod.TEnumerator$$$G$$generics$collections$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$.$final.call(this);
      };
      this.GetCurrent = function () {
        var Result = null;
        Result = this.DoGetCurrent();
        return Result;
      };
      this.DoGetCurrent = function () {
        var Result = null;
        Result = rtl.getObject(this.FVal.value);
        return Result;
      };
      this.DoMoveNext = function () {
        var Result = false;
        this.FVal = this.FIter.next();
        Result = !this.FVal.done;
        return Result;
      };
      this.Create$1 = function (AIter) {
        this.FIter = AIter;
        return this;
      };
      this.Create$2 = function (ADictionary) {
        this.Create$1(ADictionary.FMap.values());
        return this;
      };
      this.MoveNext$1 = function () {
        var Result = false;
        Result = this.DoMoveNext();
        return Result;
      };
    },"TDictionary<System.Longint,Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>>.TValueEnumerator");
    rtl.createClass(this,"TValueCollection",$mod.TEnumerable$$$G$$generics$collections$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$,function () {
      this.$init = function () {
        $mod.TEnumerable$$$G$$generics$collections$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$.$init.call(this);
        this.FMap = null;
      };
      this.$final = function () {
        this.FMap = undefined;
        $mod.TEnumerable$$$G$$generics$collections$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$.$final.call(this);
      };
      this.GetCount = function () {
        var Result = 0;
        Result = this.FMap.size;
        return Result;
      };
      this.DoGetEnumerator = function () {
        var Result = null;
        Result = $mod.TDictionary$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$.TValueEnumerator.$create("Create$1",[this.FMap.values()]);
        return Result;
      };
      this.Create$1 = function (ADictionary) {
        this.FMap = ADictionary.FMap;
        return this;
      };
      this.GetEnumerator$1 = function () {
        var Result = null;
        Result = this.DoGetEnumerator();
        return Result;
      };
      this.ToArray = function () {
        var Result = [];
        var I = 0;
        var P = null;
        Result = rtl.arraySetLength(Result,null,this.FMap.size);
        var $in = this.GetEnumerator$1();
        try {
          while ($in.MoveNext$1()) {
            P = $in.GetCurrent();
            Result[I] = P;
            I += 1;
          }
        } finally {
          $in = rtl.freeLoc($in)
        };
        return Result;
      };
    },"TDictionary<System.Longint,Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>>.TValueCollection");
    rtl.createClass(this,"TKeyCollection",$mod.TEnumerable$$$G$$generics$collections$$Longint,function () {
      this.$init = function () {
        $mod.TEnumerable$$$G$$generics$collections$$Longint.$init.call(this);
        this.FMap = null;
      };
      this.$final = function () {
        this.FMap = undefined;
        $mod.TEnumerable$$$G$$generics$collections$$Longint.$final.call(this);
      };
      this.GetCount = function () {
        var Result = 0;
        Result = this.FMap.size;
        return Result;
      };
      this.DoGetEnumerator = function () {
        var Result = null;
        Result = this.GetEnumerator$1();
        return Result;
      };
      this.Create$1 = function (ADictionary) {
        this.FMap = ADictionary.FMap;
        return this;
      };
      this.GetEnumerator$1 = function () {
        var Result = null;
        Result = $mod.TDictionary$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$.TKeyEnumerator.$create("Create$1",[this.FMap.keys()]);
        return Result;
      };
      this.ToArray = function () {
        var Result = [];
        Result = $mod.TEnumerable$$$G$$generics$collections$$Longint.ToArray.call(this);
        return Result;
      };
    },"TDictionary<System.Longint,Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>>.TKeyCollection");
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$Generics$Collections$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$$.$init.call(this);
      this.FMap = null;
      this.FComparer = null;
      this.FOnKeyNotify = null;
      this.FOnValueNotify = null;
      this.FKeyCollection = null;
      this.FValueCollection = null;
    };
    this.$final = function () {
      this.FMap = undefined;
      rtl.setIntfP(this,"FComparer",null);
      this.FOnKeyNotify = undefined;
      this.FOnValueNotify = undefined;
      this.FKeyCollection = undefined;
      this.FValueCollection = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$Generics$Collections$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$$.$final.call(this);
    };
    this.GetEffectiveKey = function (Key) {
      var Result = 0;
      var it = null;
      var v = null;
      if (!(this.FComparer != null)) return Key;
      it = this.FMap.keys();
      v = it.next();
      while (!v.done) {
        Result = rtl.trunc(v.value);
        if (this.FComparer.Compare(Result,Key) === 0) return Result;
        v = it.next();
      };
      Result = Key;
      return Result;
    };
    this.GetItem = function (Key) {
      var Result = null;
      var V = undefined;
      V = this.FMap.get(this.GetEffectiveKey(Key));
      if (pas.JS.isUndefined(V)) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictKeyNotFound")]);
      Result = rtl.getObject(V);
      return Result;
    };
    this.SetItem = function (Key, Value) {
      var V = undefined;
      V = this.FMap.get(this.GetEffectiveKey(Key));
      if (!pas.JS.isUndefined(V)) this.ValueNotify(rtl.getObject(V),$mod.TCollectionNotification.cnRemoved);
      this.FMap.set(Key,Value);
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoAdd = function (Key, Value) {
      this.FMap.set(this.GetEffectiveKey(Key),Value);
      this.KeyNotify(Key,$mod.TCollectionNotification.cnAdded);
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoRemove = function (Key, Notification) {
      var Result = null;
      var V = undefined;
      var K = 0;
      K = this.GetEffectiveKey(Key);
      V = this.FMap.get(K);
      if (!pas.JS.isUndefined(V)) {
        this.FMap.delete(K);
        Result = rtl.getObject(V);
        this.KeyNotify(Key,Notification);
        this.ValueNotify(Result,Notification);
      };
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FMap.size;
      return Result;
    };
    this.CanClearMap = function () {
      var Result = false;
      Result = (this.FOnKeyNotify === null) && (this.FOnValueNotify === null);
      return Result;
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.PairNotify = function (Key, Value, Action) {
      this.KeyNotify(Key,Action);
      this.ValueNotify(Value,Action);
    };
    this.KeyNotify = function (Key, Action) {
      if (this.FOnKeyNotify != null) this.FOnKeyNotify(this,Key,Action);
    };
    this.ValueNotify = function (Value, Action) {
      if (this.FOnValueNotify != null) this.FOnValueNotify(this,Value,Action);
    };
    this.Create$1 = function (ACapacity) {
      this.FMap = new Map();
      if (ACapacity > 0) ;
      return this;
    };
    this.Create$2 = function (Collection) {
      var aPair = $mod.TPair$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$.$new();
      this.Create$1(0);
      var $in = Collection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          aPair = $in.DoGetCurrent();
          this.Add(aPair.Key,aPair.Value);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Create$3 = function (AComparer) {
      this.Create$1(0);
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FKeyCollection;
        }, set: function (v) {
          this.p.FKeyCollection = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FValueCollection;
        }, set: function (v) {
          this.p.FValueCollection = v;
        }});
      this.Clear();
      this.FMap = null;
      pas.System.TObject.Destroy.call(this);
    };
    this.Add = function (Key, Value) {
      if (this.FMap.has(this.GetEffectiveKey(Key))) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictDuplicateKey")]);
      this.DoAdd(Key,Value);
    };
    this.Remove = function (Key) {
      this.DoRemove(Key,$mod.TCollectionNotification.cnRemoved);
    };
    this.ExtractPair = function (Key) {
      var Result = $mod.TPair$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$.$new();
      var K = 0;
      Result.$assign($mod.TPair$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$.$new());
      K = this.GetEffectiveKey(Key);
      if (this.FMap.has(K)) {
        Result.Create(Key,rtl.getObject(this.FMap.get(K)));
        this.FMap.delete(K);
      } else Result.Create(Key,null);
      return Result;
    };
    this.Clear = function () {
      var Iter = null;
      var IVal = null;
      var A = [];
      var K = 0;
      var V = null;
      if (this.CanClearMap()) {
        this.FMap.clear()}
       else {
        Iter = this.FMap.entries();
        do {
          IVal = Iter.next();
          if (!IVal.done) {
            A = IVal.value;
            K = rtl.trunc(A[0]);
            V = rtl.getObject(A[1]);
            this.FMap.delete(K);
            this.PairNotify(K,V,$mod.TCollectionNotification.cnRemoved);
          };
        } while (!IVal.done);
      };
    };
    this.TryGetValue = function (Key, Value) {
      var Result = false;
      var K = 0;
      K = this.GetEffectiveKey(Key);
      Result = this.FMap.has(K);
      if (Result) Value.set(rtl.getObject(this.FMap.get(K)));
      return Result;
    };
    this.AddOrSetValue = function (Key, Value) {
      var k = 0;
      k = this.GetEffectiveKey(Key);
      if (!this.FMap.has(k)) {
        this.DoAdd(Key,Value)}
       else this.SetItem(k,Value);
    };
    this.ContainsKey = function (Key) {
      var Result = false;
      Result = this.FMap.has(this.GetEffectiveKey(Key));
      return Result;
    };
    this.ContainsValue = function (Value) {
      var Result = false;
      var It = null;
      var Res = null;
      Result = false;
      It = this.FMap.values();
      do {
        Res = It.next();
        if (!Res.done) Result = Value === rtl.getObject(Res.value);
      } while (!(Result || Res.done));
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      Result = $mod.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$Generics$Collections$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$$.ToArray.call(this);
      return Result;
    };
    this.GetKeys = function () {
      var Result = null;
      if (this.FKeyCollection === null) this.FKeyCollection = this.TKeyCollection.$create("Create$1",[this]);
      Result = this.FKeyCollection;
      return Result;
    };
    this.GetValues = function () {
      var Result = null;
      if (this.FValueCollection === null) this.FValueCollection = this.TValueCollection.$create("Create$1",[this]);
      Result = this.FValueCollection;
      return Result;
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
  },"TDictionary<System.Longint,Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>>");
  rtl.createClass(this,"TObjectDictionary$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$",this.TDictionary$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$,function () {
    this.$init = function () {
      $mod.TDictionary$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$.$init.call(this);
      this.FOwnerships = {};
    };
    this.$final = function () {
      this.FOwnerships = undefined;
      $mod.TDictionary$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$.$final.call(this);
    };
    this.CanClearMap = function () {
      var Result = false;
      Result = $mod.TDictionary$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$.CanClearMap.call(this) && rtl.eqSet(this.FOwnerships,{});
      return Result;
    };
    this.KeyNotify = function (Key, Action) {
      $mod.TDictionary$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$.KeyNotify.call(this,Key,Action);
      if (($mod.TDictionaryOwnership.doOwnsKeys in this.FOwnerships) && (Action === $mod.TCollectionNotification.cnRemoved)) Key = rtl.freeLoc(Key);
    };
    this.ValueNotify = function (Value, Action) {
      $mod.TDictionary$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$.ValueNotify.call(this,Value,Action);
      if (($mod.TDictionaryOwnership.doOwnsValues in this.FOwnerships) && (Action === $mod.TCollectionNotification.cnRemoved)) Value = rtl.freeLoc(Value);
    };
    this.Create$4 = function (aOwnerships, ACapacity) {
      this.FOwnerships = rtl.refSet(aOwnerships);
      $mod.TDictionary$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$.Create$1.call(this,ACapacity);
      return this;
    };
    this.Create$5 = function (aOwnerships) {
      $mod.TDictionary$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$.Create$1.call(this,0);
      this.FOwnerships = rtl.refSet(aOwnerships);
      return this;
    };
  },"TObjectDictionary<System.Longint,Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>>");
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridSortIndex",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridSortIndex",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push(LEnumerator.DoGetCurrent());
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>");
  this.$rtti.$MethodVar("TCollectionNotifyEvent<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>",{init: function () {
      this.procsig = rtl.newTIProcSig([["ASender",pas.System.$rtti["TObject"]],["AItem",pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridSortIndex"],2],["AAction",$mod.$rtti["TCollectionNotification"]]]);
    }, methodkind: 0});
  rtl.createClass(this,"TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridSortIndex",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.Sort = function (AValues, AComparer) {
      this.Sort$1(AValues,AComparer,0,rtl.length(AValues.get()));
    };
    this.Sort$1 = function (AValues, AComparer, AIndex, ACount) {
      if (ACount <= 1) return;
      this.QuickSort(AValues,AIndex,(AIndex + ACount) - 1,AComparer);
    };
    this.BinarySearch$2 = function (AValues, AItem, AFoundIndex, AComparer) {
      var Result = false;
      Result = this.BinarySearch$1(AValues,AItem,AFoundIndex,AComparer,0,rtl.length(AValues));
      return Result;
    };
    this.BinarySearch$3 = function (AValues, AItem, ASearchResult, AComparer) {
      var Result = false;
      Result = this.BinarySearch(AValues,AItem,ASearchResult,AComparer,0,rtl.length(AValues));
      return Result;
    };
  },"TCustomArrayHelper<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>");
  rtl.createClass(this,"TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridSortIndex",this.TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridSortIndex,function () {
    this.$initSpec = function () {
    };
    this.QuickSort = function (AValues, ALeft, ARight, AComparer) {
      var I = 0;
      var J = 0;
      var P = null;
      var Q = null;
      if (((ARight - ALeft) <= 0) || (rtl.length(AValues.get()) === 0)) return;
      do {
        I = ALeft;
        J = ARight;
        P = AValues.get()[ALeft + Math.floor((ARight - ALeft) / 2)];
        do {
          while (AComparer.Compare(AValues.get()[I],P) < 0) I += 1;
          while (AComparer.Compare(AValues.get()[J],P) > 0) J -= 1;
          if (I <= J) {
            if (I !== J) {
              Q = AValues.get()[I];
              AValues.get()[I] = AValues.get()[J];
              AValues.get()[J] = Q;
            };
            I += 1;
            J -= 1;
          };
        } while (!(I > J));
        if ((J - ALeft) < (ARight - I)) {
          if (ALeft < J) this.QuickSort(AValues,ALeft,J,AComparer);
          ALeft = I;
        } else {
          if (I < ARight) this.QuickSort(AValues,I,ARight,AComparer);
          ARight = J;
        };
      } while (!(ALeft >= ARight));
    };
    this.BinarySearch = function (AValues, AItem, ASearchResult, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var ilo = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      ilo = imid * imid;
      imid = ilo * imid;
      while (imin < imax) {
        imid = rtl.trunc((imax + imin) / 2);
        ASearchResult.CompareResult = AComparer.Compare(AValues[imid],AItem);
        if (ASearchResult.CompareResult < 0) {
          imin = imid + 1}
         else {
          if (ASearchResult.CompareResult === 0) {
            ASearchResult.FoundIndex = imid;
            ASearchResult.CandidateIndex = imid;
            return true;
          };
          imax = imid;
        };
      };
      Result = imax === imin;
      if (Result) {
        ASearchResult.CompareResult = AComparer.Compare(AValues[imin],AItem);
        ASearchResult.CandidateIndex = imin;
        Result = ASearchResult.CompareResult === 0;
        if (Result) {
          ASearchResult.FoundIndex = imin}
         else ASearchResult.FoundIndex = -1;
      } else {
        ASearchResult.CompareResult = 0;
        ASearchResult.FoundIndex = -1;
        ASearchResult.CandidateIndex = -1;
      };
      return Result;
    };
    this.BinarySearch$1 = function (AValues, AItem, AFoundIndex, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var LCompare = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      while (imin < imax) {
        imid = rtl.trunc((imin + imax) / 2);
        LCompare = AComparer.Compare(AValues[imid],AItem);
        if (LCompare < 0) {
          imin = imid + 1}
         else {
          if (LCompare === 0) {
            AFoundIndex.set(imid);
            return true;
          };
          imax = imid;
        };
      };
      LCompare = AComparer.Compare(AValues[imin],AItem);
      Result = (imax === imin) && (LCompare === 0);
      if (Result) {
        AFoundIndex.set(imin)}
       else AFoundIndex.set(-1);
      return Result;
    };
  },"TArrayHelper<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>");
  rtl.createClass(this,"TCustomList$$$G$$generics$collections$$TTMSFNCDataGridSortIndex",this.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridSortIndex,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $mod.$rtti.$DynArray("TCustomList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>.FItems$a",{eltype: pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridSortIndex"]});
    };
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridSortIndex.$init.call(this);
      this.FOnNotify = null;
      this.FLength = 0;
      this.FItems = [];
    };
    this.$final = function () {
      this.FOnNotify = undefined;
      this.FItems = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridSortIndex.$final.call(this);
    };
    this.GetCapacity = function () {
      var Result = 0;
      Result = rtl.length(this.FItems);
      return Result;
    };
    this.PrepareAddingItem = function () {
      var Result = 0;
      if (this.FLength === rtl.length(this.FItems)) this.FItems.push(null);
      Result = this.FLength;
      this.FLength += 1;
      return Result;
    };
    this.PrepareAddingRange = function (ACount) {
      var Result = 0;
      var l = 0;
      if (ACount < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (ACount === 0) return this.FLength - 1;
      for (var $l = rtl.length(this.FItems) + 1, $end = this.FLength + ACount; $l <= $end; $l++) {
        l = $l;
        this.FItems.push(null);
      };
      Result = this.FLength;
      this.FLength += ACount;
      return Result;
    };
    this.Notify = function (AValue, ACollectionNotification) {
      if (this.FOnNotify != null) this.FOnNotify(this,AValue,ACollectionNotification);
    };
    this.DoRemove = function (AIndex, ACollectionNotification) {
      var Result = null;
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      this.FLength -= 1;
      this.FItems[AIndex] = null;
      this.FItems.splice(AIndex,1);
      this.Notify(Result,ACollectionNotification);
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FLength;
      return Result;
    };
  },"TCustomList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>");
  rtl.createClass(this,"TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCDataGridSortIndex",this.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridSortIndex,function () {
    this.$initSpec = function () {
    };
    this.$init = function () {
      $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridSortIndex.$init.call(this);
      this.FList = null;
      this.FIndex = 0;
    };
    this.$final = function () {
      this.FList = undefined;
      $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridSortIndex.$final.call(this);
    };
    this.DoMoveNext = function () {
      var Result = false;
      this.FIndex += 1;
      Result = (this.FList.FLength > 0) && (this.FIndex < this.FList.FLength);
      return Result;
    };
    this.DoGetCurrent = function () {
      var Result = null;
      Result = this.GetCurrent();
      return Result;
    };
    this.GetCurrent = function () {
      var Result = null;
      Result = this.FList.FItems[this.FIndex];
      return Result;
    };
    this.Create$1 = function (AList) {
      pas.System.TObject.Create.call(this);
      this.FIndex = -1;
      this.FList = AList;
      return this;
    };
  },"TCustomListEnumerator<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>");
  rtl.createClass(this,"TList$$$G$$generics$collections$$TTMSFNCDataGridSortIndex",this.TCustomList$$$G$$generics$collections$$TTMSFNCDataGridSortIndex,function () {
    this.$initSpec = function () {
      rtl.createClass(this,"TEnumerator",$mod.TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCDataGridSortIndex,function () {
      },"TList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>.TEnumerator");
    };
    this.$init = function () {
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCDataGridSortIndex.$init.call(this);
      this.FComparer = null;
    };
    this.$final = function () {
      rtl.setIntfP(this,"FComparer",null);
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCDataGridSortIndex.$final.call(this);
    };
    this.SameValue = function (Left, Right) {
      var Result = false;
      if (this.FComparer != null) {
        Result = this.FComparer.Compare(Left,Right) === 0}
       else Result = Left === Right;
      return Result;
    };
    this.SetCapacity = function (AValue) {
      if (AValue < this.FLength) this.SetCount(AValue);
      this.FItems = rtl.arraySetLength(this.FItems,null,AValue);
    };
    this.SetCount = function (AValue) {
      if (AValue < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (AValue > this.GetCapacity()) {
        this.SetCapacity(AValue)}
       else if (AValue < this.FLength) this.DeleteRange(AValue,this.FLength - AValue);
      this.FLength = AValue;
    };
    this.InitializeList = function () {
    };
    this.InternalInsert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.FItems.splice(AIndex,0,AValue);
      this.FLength += 1;
      this.FItems[AIndex] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.GetEnumerator$1();
      return Result;
    };
    this.GetItem = function (AIndex) {
      var Result = null;
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      return Result;
    };
    this.SetItem = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.Notify(this.FItems[AIndex],$mod.TCollectionNotification.cnRemoved);
      this.FItems[AIndex] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.Create$1 = function () {
      this.InitializeList();
      return this;
    };
    this.Create$2 = function (AComparer) {
      this.InitializeList();
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Create$3 = function (ACollection) {
      var LItem = null;
      this.Create$1();
      var $in = ACollection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LItem = $in.DoGetCurrent();
          this.Add(LItem);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Destroy = function () {
      this.SetCapacity(0);
    };
    this.Add = function (AValue) {
      var Result = 0;
      Result = this.PrepareAddingItem();
      this.FItems[Result] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
      return Result;
    };
    this.AddRange = function (AValues) {
      this.InsertRange(this.FLength,AValues);
    };
    this.AddRange$1 = function (AEnumerable) {
      var LValue = null;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.Add(LValue);
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.AddRange$2 = function (AEnumerable) {
      var LValue = null;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.Add(LValue);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Insert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.InternalInsert(AIndex,AValue);
    };
    this.InsertRange = function (AIndex, AValues) {
      var LLength = 0;
      var i = 0;
      var LValue = null;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LLength = rtl.length(AValues);
      if (LLength === 0) return;
      if (AIndex !== this.PrepareAddingRange(LLength)) {
        for (var $l = AIndex, $end = this.FLength - LLength - 1; $l <= $end; $l++) {
          i = $l;
          this.FItems[i + LLength] = this.FItems[i];
        };
        for (var $l1 = 0, $end1 = LLength - 1; $l1 <= $end1; $l1++) {
          i = $l1;
          this.FItems[AIndex + i] = null;
        };
      };
      for (var $l2 = 0, $end2 = LLength - 1; $l2 <= $end2; $l2++) {
        i = $l2;
        LValue = AValues[i];
        this.FItems[i + AIndex] = LValue;
        this.Notify(LValue,$mod.TCollectionNotification.cnAdded);
      };
    };
    this.InsertRange$1 = function (AIndex, AEnumerable) {
      var LValue = null;
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.InsertRange$2 = function (AIndex, AEnumerable) {
      var LValue = null;
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Remove = function (AValue) {
      var Result = 0;
      Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.RemoveItem = function (AValue, Direction) {
      var Result = 0;
      if (Direction === $mod.TDirection.fromEnd) {
        Result = this.LastIndexOf(AValue)}
       else Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.Delete = function (AIndex) {
      this.DoRemove(AIndex,$mod.TCollectionNotification.cnRemoved);
    };
    this.DeleteRange = function (AIndex, ACount) {
      var LDeleted = [];
      var i = 0;
      if (ACount === 0) return;
      if ((ACount < 0) || (AIndex < 0) || ((AIndex + ACount) > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LDeleted = this.FItems.splice(AIndex,this.FLength);
      this.FLength -= ACount;
      for (var $l = 0, $end = rtl.length(LDeleted) - 1; $l <= $end; $l++) {
        i = $l;
        this.Notify(LDeleted[i],$mod.TCollectionNotification.cnRemoved);
      };
    };
    this.ExtractIndex = function (AIndex) {
      var Result = null;
      Result = this.DoRemove(AIndex,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.Extract = function (AValue) {
      var Result = null;
      var LIndex = 0;
      LIndex = this.IndexOf(AValue);
      if (LIndex < 0) {
        Result = null}
       else Result = this.DoRemove(LIndex,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.Exchange = function (AIndex1, AIndex2) {
      var LTemp = null;
      LTemp = this.FItems[AIndex1];
      this.FItems[AIndex1] = this.FItems[AIndex2];
      this.FItems[AIndex2] = LTemp;
    };
    this.Move = function (AIndex, ANewIndex) {
      var Arr = null;
      var LTemp = undefined;
      var i = 0;
      if (ANewIndex === AIndex) return;
      if ((ANewIndex < 0) || (ANewIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Arr = this.FItems;
      LTemp = Arr[AIndex];
      if (AIndex < ANewIndex) {
        for (var $l = AIndex, $end = ANewIndex - 1; $l <= $end; $l++) {
          i = $l;
          Arr[i] = Arr[i + 1];
        }}
       else for (var $l1 = AIndex, $end1 = ANewIndex + 1; $l1 >= $end1; $l1--) {
        i = $l1;
        Arr[i] = Arr[i - 1];
      };
      Arr[ANewIndex] = LTemp;
    };
    this.First = function () {
      var Result = null;
      Result = this.GetItem(0);
      return Result;
    };
    this.Last = function () {
      var Result = null;
      Result = this.GetItem(this.FLength - 1);
      return Result;
    };
    this.Clear = function () {
      this.SetCount(0);
      this.SetCapacity(0);
    };
    this.Contains = function (AValue) {
      var Result = false;
      Result = this.IndexOf(AValue) >= 0;
      return Result;
    };
    this.IndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = 0, $end = this.FLength - 1; $l <= $end; $l++) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.LastIndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = this.FLength - 1; $l >= 0; $l--) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.Reverse = function () {
      var a = 0;
      var b = 0;
      var LTemp = null;
      a = 0;
      b = this.FLength - 1;
      while (a < b) {
        LTemp = this.FItems[a];
        this.FItems[a] = this.FItems[b];
        this.FItems[b] = LTemp;
        a += 1;
        b -= 1;
      };
    };
    this.TrimExcess = function () {
      this.SetCapacity(this.FLength);
    };
    this.Sort = function () {
      $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridSortIndex.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},this.FComparer,0,this.FLength);
    };
    this.Sort$1 = function (AComparer) {
      $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridSortIndex.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},AComparer,0,this.FLength);
    };
    this.BinarySearch = function (AItem, AIndex) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridSortIndex.BinarySearch$1(this.FItems,AItem,AIndex,this.FComparer,0,this.FLength);
      return Result;
    };
    this.BinarySearch$1 = function (AItem, AIndex, AComparer) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridSortIndex.BinarySearch$1(this.FItems,AItem,AIndex,AComparer,0,this.FLength);
      return Result;
    };
  },"TList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>");
  rtl.createClass(this,"TObjectList$$$G$$generics$collections$$TTMSFNCDataGridSortIndex",this.TList$$$G$$generics$collections$$TTMSFNCDataGridSortIndex,function () {
    this.$initSpec = function () {
    };
    this.$init = function () {
      $mod.TList$$$G$$generics$collections$$TTMSFNCDataGridSortIndex.$init.call(this);
      this.FObjectsOwner = false;
    };
    this.Notify = function (aValue, Action) {
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCDataGridSortIndex.Notify.call(this,aValue,Action);
      if (this.FObjectsOwner && (Action === $mod.TCollectionNotification.cnRemoved)) aValue = rtl.freeLoc(aValue);
    };
    this.Create$4 = function (aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCDataGridSortIndex.Create$1.call(this);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
    this.Create$5 = function (AComparer, aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCDataGridSortIndex.Create$2.call(this,AComparer);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
    this.Create$6 = function (aCollection, aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCDataGridSortIndex.Create$3.call(this,aCollection);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
  },"TObjectList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>");
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridDataTempData",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataTempData>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridDataTempData",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push(LEnumerator.DoGetCurrent());
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataTempData>");
  this.$rtti.$MethodVar("TCollectionNotifyEvent<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataTempData>",{init: function () {
      this.procsig = rtl.newTIProcSig([["ASender",pas.System.$rtti["TObject"]],["AItem",pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataTempData"],2],["AAction",$mod.$rtti["TCollectionNotification"]]]);
    }, methodkind: 0});
  rtl.createClass(this,"TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridDataTempData",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.Sort = function (AValues, AComparer) {
      this.Sort$1(AValues,AComparer,0,rtl.length(AValues.get()));
    };
    this.Sort$1 = function (AValues, AComparer, AIndex, ACount) {
      if (ACount <= 1) return;
      this.QuickSort(AValues,AIndex,(AIndex + ACount) - 1,AComparer);
    };
    this.BinarySearch$2 = function (AValues, AItem, AFoundIndex, AComparer) {
      var Result = false;
      Result = this.BinarySearch$1(AValues,AItem,AFoundIndex,AComparer,0,rtl.length(AValues));
      return Result;
    };
    this.BinarySearch$3 = function (AValues, AItem, ASearchResult, AComparer) {
      var Result = false;
      Result = this.BinarySearch(AValues,AItem,ASearchResult,AComparer,0,rtl.length(AValues));
      return Result;
    };
  },"TCustomArrayHelper<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataTempData>");
  rtl.createClass(this,"TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridDataTempData",this.TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridDataTempData,function () {
    this.$initSpec = function () {
    };
    this.QuickSort = function (AValues, ALeft, ARight, AComparer) {
      var I = 0;
      var J = 0;
      var P = null;
      var Q = null;
      if (((ARight - ALeft) <= 0) || (rtl.length(AValues.get()) === 0)) return;
      do {
        I = ALeft;
        J = ARight;
        P = AValues.get()[ALeft + Math.floor((ARight - ALeft) / 2)];
        do {
          while (AComparer.Compare(AValues.get()[I],P) < 0) I += 1;
          while (AComparer.Compare(AValues.get()[J],P) > 0) J -= 1;
          if (I <= J) {
            if (I !== J) {
              Q = AValues.get()[I];
              AValues.get()[I] = AValues.get()[J];
              AValues.get()[J] = Q;
            };
            I += 1;
            J -= 1;
          };
        } while (!(I > J));
        if ((J - ALeft) < (ARight - I)) {
          if (ALeft < J) this.QuickSort(AValues,ALeft,J,AComparer);
          ALeft = I;
        } else {
          if (I < ARight) this.QuickSort(AValues,I,ARight,AComparer);
          ARight = J;
        };
      } while (!(ALeft >= ARight));
    };
    this.BinarySearch = function (AValues, AItem, ASearchResult, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var ilo = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      ilo = imid * imid;
      imid = ilo * imid;
      while (imin < imax) {
        imid = rtl.trunc((imax + imin) / 2);
        ASearchResult.CompareResult = AComparer.Compare(AValues[imid],AItem);
        if (ASearchResult.CompareResult < 0) {
          imin = imid + 1}
         else {
          if (ASearchResult.CompareResult === 0) {
            ASearchResult.FoundIndex = imid;
            ASearchResult.CandidateIndex = imid;
            return true;
          };
          imax = imid;
        };
      };
      Result = imax === imin;
      if (Result) {
        ASearchResult.CompareResult = AComparer.Compare(AValues[imin],AItem);
        ASearchResult.CandidateIndex = imin;
        Result = ASearchResult.CompareResult === 0;
        if (Result) {
          ASearchResult.FoundIndex = imin}
         else ASearchResult.FoundIndex = -1;
      } else {
        ASearchResult.CompareResult = 0;
        ASearchResult.FoundIndex = -1;
        ASearchResult.CandidateIndex = -1;
      };
      return Result;
    };
    this.BinarySearch$1 = function (AValues, AItem, AFoundIndex, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var LCompare = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      while (imin < imax) {
        imid = rtl.trunc((imin + imax) / 2);
        LCompare = AComparer.Compare(AValues[imid],AItem);
        if (LCompare < 0) {
          imin = imid + 1}
         else {
          if (LCompare === 0) {
            AFoundIndex.set(imid);
            return true;
          };
          imax = imid;
        };
      };
      LCompare = AComparer.Compare(AValues[imin],AItem);
      Result = (imax === imin) && (LCompare === 0);
      if (Result) {
        AFoundIndex.set(imin)}
       else AFoundIndex.set(-1);
      return Result;
    };
  },"TArrayHelper<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataTempData>");
  rtl.createClass(this,"TCustomList$$$G$$generics$collections$$TTMSFNCDataGridDataTempData",this.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridDataTempData,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $mod.$rtti.$DynArray("TCustomList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataTempData>.FItems$a",{eltype: pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataTempData"]});
    };
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridDataTempData.$init.call(this);
      this.FOnNotify = null;
      this.FLength = 0;
      this.FItems = [];
    };
    this.$final = function () {
      this.FOnNotify = undefined;
      this.FItems = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridDataTempData.$final.call(this);
    };
    this.GetCapacity = function () {
      var Result = 0;
      Result = rtl.length(this.FItems);
      return Result;
    };
    this.PrepareAddingItem = function () {
      var Result = 0;
      if (this.FLength === rtl.length(this.FItems)) this.FItems.push(null);
      Result = this.FLength;
      this.FLength += 1;
      return Result;
    };
    this.PrepareAddingRange = function (ACount) {
      var Result = 0;
      var l = 0;
      if (ACount < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (ACount === 0) return this.FLength - 1;
      for (var $l = rtl.length(this.FItems) + 1, $end = this.FLength + ACount; $l <= $end; $l++) {
        l = $l;
        this.FItems.push(null);
      };
      Result = this.FLength;
      this.FLength += ACount;
      return Result;
    };
    this.Notify = function (AValue, ACollectionNotification) {
      if (this.FOnNotify != null) this.FOnNotify(this,AValue,ACollectionNotification);
    };
    this.DoRemove = function (AIndex, ACollectionNotification) {
      var Result = null;
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      this.FLength -= 1;
      this.FItems[AIndex] = null;
      this.FItems.splice(AIndex,1);
      this.Notify(Result,ACollectionNotification);
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FLength;
      return Result;
    };
  },"TCustomList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataTempData>");
  rtl.createClass(this,"TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCDataGridDataTempData",this.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridDataTempData,function () {
    this.$initSpec = function () {
    };
    this.$init = function () {
      $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridDataTempData.$init.call(this);
      this.FList = null;
      this.FIndex = 0;
    };
    this.$final = function () {
      this.FList = undefined;
      $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridDataTempData.$final.call(this);
    };
    this.DoMoveNext = function () {
      var Result = false;
      this.FIndex += 1;
      Result = (this.FList.FLength > 0) && (this.FIndex < this.FList.FLength);
      return Result;
    };
    this.DoGetCurrent = function () {
      var Result = null;
      Result = this.GetCurrent();
      return Result;
    };
    this.GetCurrent = function () {
      var Result = null;
      Result = this.FList.FItems[this.FIndex];
      return Result;
    };
    this.Create$1 = function (AList) {
      pas.System.TObject.Create.call(this);
      this.FIndex = -1;
      this.FList = AList;
      return this;
    };
  },"TCustomListEnumerator<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataTempData>");
  rtl.createClass(this,"TList$$$G$$generics$collections$$TTMSFNCDataGridDataTempData",this.TCustomList$$$G$$generics$collections$$TTMSFNCDataGridDataTempData,function () {
    this.$initSpec = function () {
      rtl.createClass(this,"TEnumerator",$mod.TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCDataGridDataTempData,function () {
      },"TList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataTempData>.TEnumerator");
    };
    this.$init = function () {
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCDataGridDataTempData.$init.call(this);
      this.FComparer = null;
    };
    this.$final = function () {
      rtl.setIntfP(this,"FComparer",null);
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCDataGridDataTempData.$final.call(this);
    };
    this.SameValue = function (Left, Right) {
      var Result = false;
      if (this.FComparer != null) {
        Result = this.FComparer.Compare(Left,Right) === 0}
       else Result = Left === Right;
      return Result;
    };
    this.SetCapacity = function (AValue) {
      if (AValue < this.FLength) this.SetCount(AValue);
      this.FItems = rtl.arraySetLength(this.FItems,null,AValue);
    };
    this.SetCount = function (AValue) {
      if (AValue < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (AValue > this.GetCapacity()) {
        this.SetCapacity(AValue)}
       else if (AValue < this.FLength) this.DeleteRange(AValue,this.FLength - AValue);
      this.FLength = AValue;
    };
    this.InitializeList = function () {
    };
    this.InternalInsert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.FItems.splice(AIndex,0,AValue);
      this.FLength += 1;
      this.FItems[AIndex] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.GetEnumerator$1();
      return Result;
    };
    this.GetItem = function (AIndex) {
      var Result = null;
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      return Result;
    };
    this.SetItem = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.Notify(this.FItems[AIndex],$mod.TCollectionNotification.cnRemoved);
      this.FItems[AIndex] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.Create$1 = function () {
      this.InitializeList();
      return this;
    };
    this.Create$2 = function (AComparer) {
      this.InitializeList();
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Create$3 = function (ACollection) {
      var LItem = null;
      this.Create$1();
      var $in = ACollection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LItem = $in.DoGetCurrent();
          this.Add(LItem);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Destroy = function () {
      this.SetCapacity(0);
    };
    this.Add = function (AValue) {
      var Result = 0;
      Result = this.PrepareAddingItem();
      this.FItems[Result] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
      return Result;
    };
    this.AddRange = function (AValues) {
      this.InsertRange(this.FLength,AValues);
    };
    this.AddRange$1 = function (AEnumerable) {
      var LValue = null;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.Add(LValue);
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.AddRange$2 = function (AEnumerable) {
      var LValue = null;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.Add(LValue);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Insert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.InternalInsert(AIndex,AValue);
    };
    this.InsertRange = function (AIndex, AValues) {
      var LLength = 0;
      var i = 0;
      var LValue = null;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LLength = rtl.length(AValues);
      if (LLength === 0) return;
      if (AIndex !== this.PrepareAddingRange(LLength)) {
        for (var $l = AIndex, $end = this.FLength - LLength - 1; $l <= $end; $l++) {
          i = $l;
          this.FItems[i + LLength] = this.FItems[i];
        };
        for (var $l1 = 0, $end1 = LLength - 1; $l1 <= $end1; $l1++) {
          i = $l1;
          this.FItems[AIndex + i] = null;
        };
      };
      for (var $l2 = 0, $end2 = LLength - 1; $l2 <= $end2; $l2++) {
        i = $l2;
        LValue = AValues[i];
        this.FItems[i + AIndex] = LValue;
        this.Notify(LValue,$mod.TCollectionNotification.cnAdded);
      };
    };
    this.InsertRange$1 = function (AIndex, AEnumerable) {
      var LValue = null;
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.InsertRange$2 = function (AIndex, AEnumerable) {
      var LValue = null;
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Remove = function (AValue) {
      var Result = 0;
      Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.RemoveItem = function (AValue, Direction) {
      var Result = 0;
      if (Direction === $mod.TDirection.fromEnd) {
        Result = this.LastIndexOf(AValue)}
       else Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.Delete = function (AIndex) {
      this.DoRemove(AIndex,$mod.TCollectionNotification.cnRemoved);
    };
    this.DeleteRange = function (AIndex, ACount) {
      var LDeleted = [];
      var i = 0;
      if (ACount === 0) return;
      if ((ACount < 0) || (AIndex < 0) || ((AIndex + ACount) > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LDeleted = this.FItems.splice(AIndex,this.FLength);
      this.FLength -= ACount;
      for (var $l = 0, $end = rtl.length(LDeleted) - 1; $l <= $end; $l++) {
        i = $l;
        this.Notify(LDeleted[i],$mod.TCollectionNotification.cnRemoved);
      };
    };
    this.ExtractIndex = function (AIndex) {
      var Result = null;
      Result = this.DoRemove(AIndex,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.Extract = function (AValue) {
      var Result = null;
      var LIndex = 0;
      LIndex = this.IndexOf(AValue);
      if (LIndex < 0) {
        Result = null}
       else Result = this.DoRemove(LIndex,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.Exchange = function (AIndex1, AIndex2) {
      var LTemp = null;
      LTemp = this.FItems[AIndex1];
      this.FItems[AIndex1] = this.FItems[AIndex2];
      this.FItems[AIndex2] = LTemp;
    };
    this.Move = function (AIndex, ANewIndex) {
      var Arr = null;
      var LTemp = undefined;
      var i = 0;
      if (ANewIndex === AIndex) return;
      if ((ANewIndex < 0) || (ANewIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Arr = this.FItems;
      LTemp = Arr[AIndex];
      if (AIndex < ANewIndex) {
        for (var $l = AIndex, $end = ANewIndex - 1; $l <= $end; $l++) {
          i = $l;
          Arr[i] = Arr[i + 1];
        }}
       else for (var $l1 = AIndex, $end1 = ANewIndex + 1; $l1 >= $end1; $l1--) {
        i = $l1;
        Arr[i] = Arr[i - 1];
      };
      Arr[ANewIndex] = LTemp;
    };
    this.First = function () {
      var Result = null;
      Result = this.GetItem(0);
      return Result;
    };
    this.Last = function () {
      var Result = null;
      Result = this.GetItem(this.FLength - 1);
      return Result;
    };
    this.Clear = function () {
      this.SetCount(0);
      this.SetCapacity(0);
    };
    this.Contains = function (AValue) {
      var Result = false;
      Result = this.IndexOf(AValue) >= 0;
      return Result;
    };
    this.IndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = 0, $end = this.FLength - 1; $l <= $end; $l++) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.LastIndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = this.FLength - 1; $l >= 0; $l--) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.Reverse = function () {
      var a = 0;
      var b = 0;
      var LTemp = null;
      a = 0;
      b = this.FLength - 1;
      while (a < b) {
        LTemp = this.FItems[a];
        this.FItems[a] = this.FItems[b];
        this.FItems[b] = LTemp;
        a += 1;
        b -= 1;
      };
    };
    this.TrimExcess = function () {
      this.SetCapacity(this.FLength);
    };
    this.Sort = function () {
      $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridDataTempData.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},this.FComparer,0,this.FLength);
    };
    this.Sort$1 = function (AComparer) {
      $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridDataTempData.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},AComparer,0,this.FLength);
    };
    this.BinarySearch = function (AItem, AIndex) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridDataTempData.BinarySearch$1(this.FItems,AItem,AIndex,this.FComparer,0,this.FLength);
      return Result;
    };
    this.BinarySearch$1 = function (AItem, AIndex, AComparer) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridDataTempData.BinarySearch$1(this.FItems,AItem,AIndex,AComparer,0,this.FLength);
      return Result;
    };
  },"TList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataTempData>");
  rtl.createClass(this,"TObjectList$$$G$$generics$collections$$TTMSFNCDataGridDataTempData",this.TList$$$G$$generics$collections$$TTMSFNCDataGridDataTempData,function () {
    this.$initSpec = function () {
    };
    this.$init = function () {
      $mod.TList$$$G$$generics$collections$$TTMSFNCDataGridDataTempData.$init.call(this);
      this.FObjectsOwner = false;
    };
    this.Notify = function (aValue, Action) {
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCDataGridDataTempData.Notify.call(this,aValue,Action);
      if (this.FObjectsOwner && (Action === $mod.TCollectionNotification.cnRemoved)) aValue = rtl.freeLoc(aValue);
    };
    this.Create$4 = function (aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCDataGridDataTempData.Create$1.call(this);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
    this.Create$5 = function (AComparer, aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCDataGridDataTempData.Create$2.call(this,AComparer);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
    this.Create$6 = function (aCollection, aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCDataGridDataTempData.Create$3.call(this,aCollection);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
  },"TObjectList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataTempData>");
  rtl.recNewT(this,"TPair$$$G$$generics$collections$$String$$TArray$System$String$",function () {
    this.Key = "";
    this.$new = function () {
      var r = Object.create(this);
      r.Value = [];
      return r;
    };
    this.$eq = function (b) {
      return (this.Key === b.Key) && (this.Value === b.Value);
    };
    this.$assign = function (s) {
      this.Key = s.Key;
      this.Value = rtl.arrayRef(s.Value);
      return this;
    };
    this.Create = function (AKey, AValue) {
      this.Key = AKey;
      this.Value = rtl.arrayRef(AValue);
      return this;
    };
    var $r = $mod.$rtti.$Record("TPair<System.String,System.TArray<System.String>>",{},this);
    $r.addField("Key",rtl.string);
    $r.addField("Value",pas.System.$rtti["TArray<System.String>"]);
    $r.addMethod("Create",2,[["AKey",rtl.string,2],["AValue",pas.System.$rtti["TArray<System.String>"],2]]);
  });
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TPair$System$String$System$TArray$System$String$$",pas.System.TObject,function () {
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<Generics.Collections.TPair<System.String,System.TArray<System.String>>>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TPair$System$String$System$TArray$System$String$$",pas.System.TObject,function () {
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push($mod.TPair$$$G$$generics$collections$$String$$TArray$System$String$.$clone(LEnumerator.DoGetCurrent()));
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<Generics.Collections.TPair<System.String,System.TArray<System.String>>>");
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TArray$System$String$",pas.System.TObject,function () {
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<System.TArray<System.String>>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TArray$System$String$",pas.System.TObject,function () {
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push(LEnumerator.DoGetCurrent());
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<System.TArray<System.String>>");
  this.$rtti.$MethodVar("TCollectionNotifyEvent<System.TArray<System.String>>",{procsig: rtl.newTIProcSig([["ASender",pas.System.$rtti["TObject"]],["AItem",pas.System.$rtti["TArray<System.String>"],2],["AAction",this.$rtti["TCollectionNotification"]]]), methodkind: 0});
  rtl.createClass(this,"TDictionary$$$G$$generics$collections$$String$$TArray$System$String$",this.TEnumerable$$$G$$generics$collections$$TPair$System$String$System$TArray$System$String$$,function () {
    rtl.createClass(this,"TPairEnumerator",$mod.TEnumerator$$$G$$generics$collections$$TPair$System$String$System$TArray$System$String$$,function () {
      this.$init = function () {
        $mod.TEnumerator$$$G$$generics$collections$$TPair$System$String$System$TArray$System$String$$.$init.call(this);
        this.FIter = null;
        this.FVal = null;
      };
      this.$final = function () {
        this.FIter = undefined;
        this.FVal = undefined;
        $mod.TEnumerator$$$G$$generics$collections$$TPair$System$String$System$TArray$System$String$$.$final.call(this);
      };
      this.GetCurrent = function () {
        var Result = $mod.TPair$$$G$$generics$collections$$String$$TArray$System$String$.$new();
        Result.$assign(this.DoGetCurrent());
        return Result;
      };
      this.DoGetCurrent = function () {
        var Result = $mod.TPair$$$G$$generics$collections$$String$$TArray$System$String$.$new();
        var A = [];
        A = this.FVal.value;
        Result.$assign($mod.TPair$$$G$$generics$collections$$String$$TArray$System$String$.$new());
        Result.Create("" + A[0],A[1]);
        return Result;
      };
      this.DoMoveNext = function () {
        var Result = false;
        this.FVal = this.FIter.next();
        Result = !this.FVal.done;
        return Result;
      };
      this.Create$1 = function (ADictionary) {
        this.FIter = ADictionary.FMap.entries();
        return this;
      };
      this.MoveNext$1 = function () {
        var Result = false;
        Result = this.DoMoveNext();
        return Result;
      };
    },"TDictionary<System.String,System.TArray<System.String>>.TPairEnumerator");
    rtl.createClass(this,"TKeyEnumerator",$mod.TEnumerator$$$G$$generics$collections$$String,function () {
      this.$init = function () {
        $mod.TEnumerator$$$G$$generics$collections$$String.$init.call(this);
        this.FIter = null;
        this.FVal = null;
      };
      this.$final = function () {
        this.FIter = undefined;
        this.FVal = undefined;
        $mod.TEnumerator$$$G$$generics$collections$$String.$final.call(this);
      };
      this.GetCurrent = function () {
        var Result = "";
        Result = this.DoGetCurrent();
        return Result;
      };
      this.DoGetCurrent = function () {
        var Result = "";
        Result = "" + this.FVal.value;
        return Result;
      };
      this.DoMoveNext = function () {
        var Result = false;
        this.FVal = this.FIter.next();
        Result = !this.FVal.done;
        return Result;
      };
      this.Create$1 = function (AIter) {
        this.FIter = AIter;
        return this;
      };
      this.Create$2 = function (ADictionary) {
        this.Create$1(ADictionary.FMap.keys());
        return this;
      };
      this.MoveNext$1 = function () {
        var Result = false;
        Result = this.DoMoveNext();
        return Result;
      };
    },"TDictionary<System.String,System.TArray<System.String>>.TKeyEnumerator");
    rtl.createClass(this,"TValueEnumerator",$mod.TEnumerator$$$G$$generics$collections$$TArray$System$String$,function () {
      this.$init = function () {
        $mod.TEnumerator$$$G$$generics$collections$$TArray$System$String$.$init.call(this);
        this.FIter = null;
        this.FVal = null;
      };
      this.$final = function () {
        this.FIter = undefined;
        this.FVal = undefined;
        $mod.TEnumerator$$$G$$generics$collections$$TArray$System$String$.$final.call(this);
      };
      this.GetCurrent = function () {
        var Result = [];
        Result = this.DoGetCurrent();
        return Result;
      };
      this.DoGetCurrent = function () {
        var Result = [];
        Result = this.FVal.value;
        return Result;
      };
      this.DoMoveNext = function () {
        var Result = false;
        this.FVal = this.FIter.next();
        Result = !this.FVal.done;
        return Result;
      };
      this.Create$1 = function (AIter) {
        this.FIter = AIter;
        return this;
      };
      this.Create$2 = function (ADictionary) {
        this.Create$1(ADictionary.FMap.values());
        return this;
      };
      this.MoveNext$1 = function () {
        var Result = false;
        Result = this.DoMoveNext();
        return Result;
      };
    },"TDictionary<System.String,System.TArray<System.String>>.TValueEnumerator");
    rtl.createClass(this,"TValueCollection",$mod.TEnumerable$$$G$$generics$collections$$TArray$System$String$,function () {
      this.$init = function () {
        $mod.TEnumerable$$$G$$generics$collections$$TArray$System$String$.$init.call(this);
        this.FMap = null;
      };
      this.$final = function () {
        this.FMap = undefined;
        $mod.TEnumerable$$$G$$generics$collections$$TArray$System$String$.$final.call(this);
      };
      this.GetCount = function () {
        var Result = 0;
        Result = this.FMap.size;
        return Result;
      };
      this.DoGetEnumerator = function () {
        var Result = null;
        Result = $mod.TDictionary$$$G$$generics$collections$$String$$TArray$System$String$.TValueEnumerator.$create("Create$1",[this.FMap.values()]);
        return Result;
      };
      this.Create$1 = function (ADictionary) {
        this.FMap = ADictionary.FMap;
        return this;
      };
      this.GetEnumerator$1 = function () {
        var Result = null;
        Result = this.DoGetEnumerator();
        return Result;
      };
      this.ToArray = function () {
        var Result = [];
        var I = 0;
        var P = [];
        Result = rtl.arraySetLength(Result,[],this.FMap.size);
        var $in = this.GetEnumerator$1();
        try {
          while ($in.MoveNext$1()) {
            P = $in.GetCurrent();
            Result[I] = rtl.arrayRef(P);
            I += 1;
          }
        } finally {
          $in = rtl.freeLoc($in)
        };
        return Result;
      };
    },"TDictionary<System.String,System.TArray<System.String>>.TValueCollection");
    rtl.createClass(this,"TKeyCollection",$mod.TEnumerable$$$G$$generics$collections$$String,function () {
      this.$init = function () {
        $mod.TEnumerable$$$G$$generics$collections$$String.$init.call(this);
        this.FMap = null;
      };
      this.$final = function () {
        this.FMap = undefined;
        $mod.TEnumerable$$$G$$generics$collections$$String.$final.call(this);
      };
      this.GetCount = function () {
        var Result = 0;
        Result = this.FMap.size;
        return Result;
      };
      this.DoGetEnumerator = function () {
        var Result = null;
        Result = this.GetEnumerator$1();
        return Result;
      };
      this.Create$1 = function (ADictionary) {
        this.FMap = ADictionary.FMap;
        return this;
      };
      this.GetEnumerator$1 = function () {
        var Result = null;
        Result = $mod.TDictionary$$$G$$generics$collections$$String$$TArray$System$String$.TKeyEnumerator.$create("Create$1",[this.FMap.keys()]);
        return Result;
      };
      this.ToArray = function () {
        var Result = [];
        Result = $mod.TEnumerable$$$G$$generics$collections$$String.ToArray.call(this);
        return Result;
      };
    },"TDictionary<System.String,System.TArray<System.String>>.TKeyCollection");
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$TPair$System$String$System$TArray$System$String$$.$init.call(this);
      this.FMap = null;
      this.FComparer = null;
      this.FOnKeyNotify = null;
      this.FOnValueNotify = null;
      this.FKeyCollection = null;
      this.FValueCollection = null;
    };
    this.$final = function () {
      this.FMap = undefined;
      rtl.setIntfP(this,"FComparer",null);
      this.FOnKeyNotify = undefined;
      this.FOnValueNotify = undefined;
      this.FKeyCollection = undefined;
      this.FValueCollection = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$TPair$System$String$System$TArray$System$String$$.$final.call(this);
    };
    this.GetEffectiveKey = function (Key) {
      var Result = "";
      var it = null;
      var v = null;
      if (!(this.FComparer != null)) return Key;
      it = this.FMap.keys();
      v = it.next();
      while (!v.done) {
        Result = "" + v.value;
        if (this.FComparer.Compare(Result,Key) === 0) return Result;
        v = it.next();
      };
      Result = Key;
      return Result;
    };
    this.GetItem = function (Key) {
      var Result = [];
      var V = undefined;
      V = this.FMap.get(this.GetEffectiveKey(Key));
      if (pas.JS.isUndefined(V)) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictKeyNotFound")]);
      Result = V;
      return Result;
    };
    this.SetItem = function (Key, Value) {
      var V = undefined;
      V = this.FMap.get(this.GetEffectiveKey(Key));
      if (!pas.JS.isUndefined(V)) this.ValueNotify(V,$mod.TCollectionNotification.cnRemoved);
      this.FMap.set(Key,Value);
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoAdd = function (Key, Value) {
      this.FMap.set(this.GetEffectiveKey(Key),Value);
      this.KeyNotify(Key,$mod.TCollectionNotification.cnAdded);
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoRemove = function (Key, Notification) {
      var Result = [];
      var V = undefined;
      var K = "";
      K = this.GetEffectiveKey(Key);
      V = this.FMap.get(K);
      if (!pas.JS.isUndefined(V)) {
        this.FMap.delete(K);
        Result = V;
        this.KeyNotify(Key,Notification);
        this.ValueNotify(Result,Notification);
      };
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FMap.size;
      return Result;
    };
    this.CanClearMap = function () {
      var Result = false;
      Result = (this.FOnKeyNotify === null) && (this.FOnValueNotify === null);
      return Result;
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.PairNotify = function (Key, Value, Action) {
      this.KeyNotify(Key,Action);
      this.ValueNotify(Value,Action);
    };
    this.KeyNotify = function (Key, Action) {
      if (this.FOnKeyNotify != null) this.FOnKeyNotify(this,Key,Action);
    };
    this.ValueNotify = function (Value, Action) {
      if (this.FOnValueNotify != null) this.FOnValueNotify(this,Value,Action);
    };
    this.Create$1 = function (ACapacity) {
      this.FMap = new Map();
      if (ACapacity > 0) ;
      return this;
    };
    this.Create$2 = function (Collection) {
      var aPair = $mod.TPair$$$G$$generics$collections$$String$$TArray$System$String$.$new();
      this.Create$1(0);
      var $in = Collection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          aPair = $in.DoGetCurrent();
          this.Add(aPair.Key,aPair.Value);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Create$3 = function (AComparer) {
      this.Create$1(0);
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FKeyCollection;
        }, set: function (v) {
          this.p.FKeyCollection = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FValueCollection;
        }, set: function (v) {
          this.p.FValueCollection = v;
        }});
      this.Clear();
      this.FMap = null;
      pas.System.TObject.Destroy.call(this);
    };
    this.Add = function (Key, Value) {
      if (this.FMap.has(this.GetEffectiveKey(Key))) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictDuplicateKey")]);
      this.DoAdd(Key,Value);
    };
    this.Remove = function (Key) {
      this.DoRemove(Key,$mod.TCollectionNotification.cnRemoved);
    };
    this.ExtractPair = function (Key) {
      var Result = $mod.TPair$$$G$$generics$collections$$String$$TArray$System$String$.$new();
      var K = "";
      Result.$assign($mod.TPair$$$G$$generics$collections$$String$$TArray$System$String$.$new());
      K = this.GetEffectiveKey(Key);
      if (this.FMap.has(K)) {
        Result.Create(Key,this.FMap.get(K));
        this.FMap.delete(K);
      } else Result.Create(Key,[]);
      return Result;
    };
    this.Clear = function () {
      var Iter = null;
      var IVal = null;
      var A = [];
      var K = "";
      var V = [];
      if (this.CanClearMap()) {
        this.FMap.clear()}
       else {
        Iter = this.FMap.entries();
        do {
          IVal = Iter.next();
          if (!IVal.done) {
            A = IVal.value;
            K = "" + A[0];
            V = A[1];
            this.FMap.delete(K);
            this.PairNotify(K,rtl.arrayRef(V),$mod.TCollectionNotification.cnRemoved);
          };
        } while (!IVal.done);
      };
    };
    this.TryGetValue = function (Key, Value) {
      var Result = false;
      var K = "";
      K = this.GetEffectiveKey(Key);
      Result = this.FMap.has(K);
      if (Result) Value.set(this.FMap.get(K));
      return Result;
    };
    this.AddOrSetValue = function (Key, Value) {
      var k = "";
      k = this.GetEffectiveKey(Key);
      if (!this.FMap.has(k)) {
        this.DoAdd(Key,Value)}
       else this.SetItem(k,Value);
    };
    this.ContainsKey = function (Key) {
      var Result = false;
      Result = this.FMap.has(this.GetEffectiveKey(Key));
      return Result;
    };
    this.ContainsValue = function (Value) {
      var Result = false;
      var It = null;
      var Res = null;
      Result = false;
      It = this.FMap.values();
      do {
        Res = It.next();
        if (!Res.done) Result = Value === Res.value;
      } while (!(Result || Res.done));
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      Result = $mod.TEnumerable$$$G$$generics$collections$$TPair$System$String$System$TArray$System$String$$.ToArray.call(this);
      return Result;
    };
    this.GetKeys = function () {
      var Result = null;
      if (this.FKeyCollection === null) this.FKeyCollection = this.TKeyCollection.$create("Create$1",[this]);
      Result = this.FKeyCollection;
      return Result;
    };
    this.GetValues = function () {
      var Result = null;
      if (this.FValueCollection === null) this.FValueCollection = this.TValueCollection.$create("Create$1",[this]);
      Result = this.FValueCollection;
      return Result;
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
  },"TDictionary<System.String,System.TArray<System.String>>");
  rtl.recNewT(this,"TPair$$$G$$generics$collections$$String$$TTMSFNCDataGridDataCustomListIndexEntry",function () {
    var $r = $mod.$rtti.$Record("TPair<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataCustomListIndexEntry>",{},this);
    this.$initSpec = function () {
      this.Key = "";
      $r.addField("Key",rtl.string);
      $r.addField("Value",pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataCustomListIndexEntry"]);
      $r.addMethod("Create",2,[["AKey",rtl.string,2],["AValue",pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataCustomListIndexEntry"],2]]);
    };
    this.$new = function () {
      var r = Object.create(this);
      r.Value = pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataCustomListIndexEntry.$new();
      return r;
    };
    this.$eq = function (b) {
      return (this.Key === b.Key) && this.Value.$eq(b.Value);
    };
    this.$assign = function (s) {
      this.Key = s.Key;
      this.Value.$assign(s.Value);
      return this;
    };
    this.Create = function (AKey, AValue) {
      this.Key = AKey;
      this.Value.$assign(AValue);
      return this;
    };
  });
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TPair$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataCustomListIndexEntry$",pas.System.TObject,function () {
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<Generics.Collections.TPair<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataCustomListIndexEntry>>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TPair$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataCustomListIndexEntry$",pas.System.TObject,function () {
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push($mod.TPair$$$G$$generics$collections$$String$$TTMSFNCDataGridDataCustomListIndexEntry.$clone(LEnumerator.DoGetCurrent()));
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<Generics.Collections.TPair<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataCustomListIndexEntry>>");
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridDataCustomListIndexEntry",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataCustomListIndexEntry>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridDataCustomListIndexEntry",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push(pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataCustomListIndexEntry.$clone(LEnumerator.DoGetCurrent()));
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataCustomListIndexEntry>");
  this.$rtti.$MethodVar("TCollectionNotifyEvent<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataCustomListIndexEntry>",{init: function () {
      this.procsig = rtl.newTIProcSig([["ASender",pas.System.$rtti["TObject"]],["AItem",pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataCustomListIndexEntry"],2],["AAction",$mod.$rtti["TCollectionNotification"]]]);
    }, methodkind: 0});
  rtl.createClass(this,"TDictionary$$$G$$generics$collections$$String$$TTMSFNCDataGridDataCustomListIndexEntry",this.TEnumerable$$$G$$generics$collections$$TPair$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataCustomListIndexEntry$,function () {
    this.$initSpec = function () {
      rtl.createClass(this,"TPairEnumerator",$mod.TEnumerator$$$G$$generics$collections$$TPair$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataCustomListIndexEntry$,function () {
        this.$init = function () {
          $mod.TEnumerator$$$G$$generics$collections$$TPair$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataCustomListIndexEntry$.$init.call(this);
          this.FIter = null;
          this.FVal = null;
        };
        this.$final = function () {
          this.FIter = undefined;
          this.FVal = undefined;
          $mod.TEnumerator$$$G$$generics$collections$$TPair$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataCustomListIndexEntry$.$final.call(this);
        };
        this.GetCurrent = function () {
          var Result = $mod.TPair$$$G$$generics$collections$$String$$TTMSFNCDataGridDataCustomListIndexEntry.$new();
          Result.$assign(this.DoGetCurrent());
          return Result;
        };
        this.DoGetCurrent = function () {
          var Result = $mod.TPair$$$G$$generics$collections$$String$$TTMSFNCDataGridDataCustomListIndexEntry.$new();
          var A = [];
          A = this.FVal.value;
          Result.$assign($mod.TPair$$$G$$generics$collections$$String$$TTMSFNCDataGridDataCustomListIndexEntry.$new());
          Result.Create("" + A[0],rtl.getObject(A[1]));
          return Result;
        };
        this.DoMoveNext = function () {
          var Result = false;
          this.FVal = this.FIter.next();
          Result = !this.FVal.done;
          return Result;
        };
        this.Create$1 = function (ADictionary) {
          this.FIter = ADictionary.FMap.entries();
          return this;
        };
        this.MoveNext$1 = function () {
          var Result = false;
          Result = this.DoMoveNext();
          return Result;
        };
      },"TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataCustomListIndexEntry>.TPairEnumerator");
      rtl.createClass(this,"TKeyEnumerator",$mod.TEnumerator$$$G$$generics$collections$$String,function () {
        this.$init = function () {
          $mod.TEnumerator$$$G$$generics$collections$$String.$init.call(this);
          this.FIter = null;
          this.FVal = null;
        };
        this.$final = function () {
          this.FIter = undefined;
          this.FVal = undefined;
          $mod.TEnumerator$$$G$$generics$collections$$String.$final.call(this);
        };
        this.GetCurrent = function () {
          var Result = "";
          Result = this.DoGetCurrent();
          return Result;
        };
        this.DoGetCurrent = function () {
          var Result = "";
          Result = "" + this.FVal.value;
          return Result;
        };
        this.DoMoveNext = function () {
          var Result = false;
          this.FVal = this.FIter.next();
          Result = !this.FVal.done;
          return Result;
        };
        this.Create$1 = function (AIter) {
          this.FIter = AIter;
          return this;
        };
        this.Create$2 = function (ADictionary) {
          this.Create$1(ADictionary.FMap.keys());
          return this;
        };
        this.MoveNext$1 = function () {
          var Result = false;
          Result = this.DoMoveNext();
          return Result;
        };
      },"TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataCustomListIndexEntry>.TKeyEnumerator");
      rtl.createClass(this,"TValueEnumerator",$mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridDataCustomListIndexEntry,function () {
        this.$init = function () {
          $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridDataCustomListIndexEntry.$init.call(this);
          this.FIter = null;
          this.FVal = null;
        };
        this.$final = function () {
          this.FIter = undefined;
          this.FVal = undefined;
          $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridDataCustomListIndexEntry.$final.call(this);
        };
        this.GetCurrent = function () {
          var Result = pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataCustomListIndexEntry.$new();
          Result.$assign(this.DoGetCurrent());
          return Result;
        };
        this.DoGetCurrent = function () {
          var Result = pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataCustomListIndexEntry.$new();
          Result.$assign(rtl.getObject(this.FVal.value));
          return Result;
        };
        this.DoMoveNext = function () {
          var Result = false;
          this.FVal = this.FIter.next();
          Result = !this.FVal.done;
          return Result;
        };
        this.Create$1 = function (AIter) {
          this.FIter = AIter;
          return this;
        };
        this.Create$2 = function (ADictionary) {
          this.Create$1(ADictionary.FMap.values());
          return this;
        };
        this.MoveNext$1 = function () {
          var Result = false;
          Result = this.DoMoveNext();
          return Result;
        };
      },"TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataCustomListIndexEntry>.TValueEnumerator");
      rtl.createClass(this,"TValueCollection",$mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridDataCustomListIndexEntry,function () {
        this.$init = function () {
          $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridDataCustomListIndexEntry.$init.call(this);
          this.FMap = null;
        };
        this.$final = function () {
          this.FMap = undefined;
          $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridDataCustomListIndexEntry.$final.call(this);
        };
        this.GetCount = function () {
          var Result = 0;
          Result = this.FMap.size;
          return Result;
        };
        this.DoGetEnumerator = function () {
          var Result = null;
          Result = $mod.TDictionary$$$G$$generics$collections$$String$$TTMSFNCDataGridDataCustomListIndexEntry.TValueEnumerator.$create("Create$1",[this.FMap.values()]);
          return Result;
        };
        this.Create$1 = function (ADictionary) {
          this.FMap = ADictionary.FMap;
          return this;
        };
        this.GetEnumerator$1 = function () {
          var Result = null;
          Result = this.DoGetEnumerator();
          return Result;
        };
        this.ToArray = function () {
          var Result = [];
          var I = 0;
          var P = pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataCustomListIndexEntry.$new();
          Result = rtl.arraySetLength(Result,pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataCustomListIndexEntry,this.FMap.size);
          var $in = this.GetEnumerator$1();
          try {
            while ($in.MoveNext$1()) {
              P = $in.GetCurrent();
              Result[I].$assign(P);
              I += 1;
            }
          } finally {
            $in = rtl.freeLoc($in)
          };
          return Result;
        };
      },"TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataCustomListIndexEntry>.TValueCollection");
      rtl.createClass(this,"TKeyCollection",$mod.TEnumerable$$$G$$generics$collections$$String,function () {
        this.$init = function () {
          $mod.TEnumerable$$$G$$generics$collections$$String.$init.call(this);
          this.FMap = null;
        };
        this.$final = function () {
          this.FMap = undefined;
          $mod.TEnumerable$$$G$$generics$collections$$String.$final.call(this);
        };
        this.GetCount = function () {
          var Result = 0;
          Result = this.FMap.size;
          return Result;
        };
        this.DoGetEnumerator = function () {
          var Result = null;
          Result = this.GetEnumerator$1();
          return Result;
        };
        this.Create$1 = function (ADictionary) {
          this.FMap = ADictionary.FMap;
          return this;
        };
        this.GetEnumerator$1 = function () {
          var Result = null;
          Result = $mod.TDictionary$$$G$$generics$collections$$String$$TTMSFNCDataGridDataCustomListIndexEntry.TKeyEnumerator.$create("Create$1",[this.FMap.keys()]);
          return Result;
        };
        this.ToArray = function () {
          var Result = [];
          Result = $mod.TEnumerable$$$G$$generics$collections$$String.ToArray.call(this);
          return Result;
        };
      },"TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataCustomListIndexEntry>.TKeyCollection");
    };
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$TPair$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataCustomListIndexEntry$.$init.call(this);
      this.FMap = null;
      this.FComparer = null;
      this.FOnKeyNotify = null;
      this.FOnValueNotify = null;
      this.FKeyCollection = null;
      this.FValueCollection = null;
    };
    this.$final = function () {
      this.FMap = undefined;
      rtl.setIntfP(this,"FComparer",null);
      this.FOnKeyNotify = undefined;
      this.FOnValueNotify = undefined;
      this.FKeyCollection = undefined;
      this.FValueCollection = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$TPair$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataCustomListIndexEntry$.$final.call(this);
    };
    this.GetEffectiveKey = function (Key) {
      var Result = "";
      var it = null;
      var v = null;
      if (!(this.FComparer != null)) return Key;
      it = this.FMap.keys();
      v = it.next();
      while (!v.done) {
        Result = "" + v.value;
        if (this.FComparer.Compare(Result,Key) === 0) return Result;
        v = it.next();
      };
      Result = Key;
      return Result;
    };
    this.GetItem = function (Key) {
      var Result = pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataCustomListIndexEntry.$new();
      var V = undefined;
      V = this.FMap.get(this.GetEffectiveKey(Key));
      if (pas.JS.isUndefined(V)) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictKeyNotFound")]);
      Result.$assign(rtl.getObject(V));
      return Result;
    };
    this.SetItem = function (Key, Value) {
      var V = undefined;
      V = this.FMap.get(this.GetEffectiveKey(Key));
      if (!pas.JS.isUndefined(V)) this.ValueNotify(rtl.getObject(V),$mod.TCollectionNotification.cnRemoved);
      this.FMap.set(Key,pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataCustomListIndexEntry.$clone(Value));
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoAdd = function (Key, Value) {
      this.FMap.set(this.GetEffectiveKey(Key),pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataCustomListIndexEntry.$clone(Value));
      this.KeyNotify(Key,$mod.TCollectionNotification.cnAdded);
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoRemove = function (Key, Notification) {
      var Result = pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataCustomListIndexEntry.$new();
      var V = undefined;
      var K = "";
      K = this.GetEffectiveKey(Key);
      V = this.FMap.get(K);
      if (!pas.JS.isUndefined(V)) {
        this.FMap.delete(K);
        Result.$assign(rtl.getObject(V));
        this.KeyNotify(Key,Notification);
        this.ValueNotify(Result,Notification);
      };
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FMap.size;
      return Result;
    };
    this.CanClearMap = function () {
      var Result = false;
      Result = (this.FOnKeyNotify === null) && (this.FOnValueNotify === null);
      return Result;
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.PairNotify = function (Key, Value, Action) {
      this.KeyNotify(Key,Action);
      this.ValueNotify(Value,Action);
    };
    this.KeyNotify = function (Key, Action) {
      if (this.FOnKeyNotify != null) this.FOnKeyNotify(this,Key,Action);
    };
    this.ValueNotify = function (Value, Action) {
      if (this.FOnValueNotify != null) this.FOnValueNotify(this,Value,Action);
    };
    this.Create$1 = function (ACapacity) {
      this.FMap = new Map();
      if (ACapacity > 0) ;
      return this;
    };
    this.Create$2 = function (Collection) {
      var aPair = $mod.TPair$$$G$$generics$collections$$String$$TTMSFNCDataGridDataCustomListIndexEntry.$new();
      this.Create$1(0);
      var $in = Collection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          aPair = $in.DoGetCurrent();
          this.Add(aPair.Key,aPair.Value);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Create$3 = function (AComparer) {
      this.Create$1(0);
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FKeyCollection;
        }, set: function (v) {
          this.p.FKeyCollection = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FValueCollection;
        }, set: function (v) {
          this.p.FValueCollection = v;
        }});
      this.Clear();
      this.FMap = null;
      pas.System.TObject.Destroy.call(this);
    };
    this.Add = function (Key, Value) {
      if (this.FMap.has(this.GetEffectiveKey(Key))) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictDuplicateKey")]);
      this.DoAdd(Key,Value);
    };
    this.Remove = function (Key) {
      this.DoRemove(Key,$mod.TCollectionNotification.cnRemoved);
    };
    this.ExtractPair = function (Key) {
      var Result = $mod.TPair$$$G$$generics$collections$$String$$TTMSFNCDataGridDataCustomListIndexEntry.$new();
      var K = "";
      Result.$assign($mod.TPair$$$G$$generics$collections$$String$$TTMSFNCDataGridDataCustomListIndexEntry.$new());
      K = this.GetEffectiveKey(Key);
      if (this.FMap.has(K)) {
        Result.Create(Key,rtl.getObject(this.FMap.get(K)));
        this.FMap.delete(K);
      } else Result.Create(Key,pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataCustomListIndexEntry.$new());
      return Result;
    };
    this.Clear = function () {
      var Iter = null;
      var IVal = null;
      var A = [];
      var K = "";
      var V = pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataCustomListIndexEntry.$new();
      if (this.CanClearMap()) {
        this.FMap.clear()}
       else {
        Iter = this.FMap.entries();
        do {
          IVal = Iter.next();
          if (!IVal.done) {
            A = IVal.value;
            K = "" + A[0];
            V.$assign(rtl.getObject(A[1]));
            this.FMap.delete(K);
            this.PairNotify(K,pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataCustomListIndexEntry.$clone(V),$mod.TCollectionNotification.cnRemoved);
          };
        } while (!IVal.done);
      };
    };
    this.TryGetValue = function (Key, Value) {
      var Result = false;
      var K = "";
      K = this.GetEffectiveKey(Key);
      Result = this.FMap.has(K);
      if (Result) Value.$assign(rtl.getObject(this.FMap.get(K)));
      return Result;
    };
    this.AddOrSetValue = function (Key, Value) {
      var k = "";
      k = this.GetEffectiveKey(Key);
      if (!this.FMap.has(k)) {
        this.DoAdd(Key,Value)}
       else this.SetItem(k,Value);
    };
    this.ContainsKey = function (Key) {
      var Result = false;
      Result = this.FMap.has(this.GetEffectiveKey(Key));
      return Result;
    };
    this.ContainsValue = function (Value) {
      var Result = false;
      var It = null;
      var Res = null;
      Result = false;
      It = this.FMap.values();
      do {
        Res = It.next();
        if (!Res.done) Result = Value.$eq(rtl.getObject(Res.value));
      } while (!(Result || Res.done));
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      Result = $mod.TEnumerable$$$G$$generics$collections$$TPair$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataCustomListIndexEntry$.ToArray.call(this);
      return Result;
    };
    this.GetKeys = function () {
      var Result = null;
      if (this.FKeyCollection === null) this.FKeyCollection = this.TKeyCollection.$create("Create$1",[this]);
      Result = this.FKeyCollection;
      return Result;
    };
    this.GetValues = function () {
      var Result = null;
      if (this.FValueCollection === null) this.FValueCollection = this.TValueCollection.$create("Create$1",[this]);
      Result = this.FValueCollection;
      return Result;
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
  },"TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataCustomListIndexEntry>");
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCell",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCell>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridCell",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push(LEnumerator.DoGetCurrent());
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCell>");
  this.$rtti.$MethodVar("TCollectionNotifyEvent<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCell>",{init: function () {
      this.procsig = rtl.newTIProcSig([["ASender",pas.System.$rtti["TObject"]],["AItem",pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCell"],2],["AAction",$mod.$rtti["TCollectionNotification"]]]);
    }, methodkind: 0});
  rtl.createClass(this,"TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridCell",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.Sort = function (AValues, AComparer) {
      this.Sort$1(AValues,AComparer,0,rtl.length(AValues.get()));
    };
    this.Sort$1 = function (AValues, AComparer, AIndex, ACount) {
      if (ACount <= 1) return;
      this.QuickSort(AValues,AIndex,(AIndex + ACount) - 1,AComparer);
    };
    this.BinarySearch$2 = function (AValues, AItem, AFoundIndex, AComparer) {
      var Result = false;
      Result = this.BinarySearch$1(AValues,AItem,AFoundIndex,AComparer,0,rtl.length(AValues));
      return Result;
    };
    this.BinarySearch$3 = function (AValues, AItem, ASearchResult, AComparer) {
      var Result = false;
      Result = this.BinarySearch(AValues,AItem,ASearchResult,AComparer,0,rtl.length(AValues));
      return Result;
    };
  },"TCustomArrayHelper<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCell>");
  rtl.createClass(this,"TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridCell",this.TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridCell,function () {
    this.$initSpec = function () {
    };
    this.QuickSort = function (AValues, ALeft, ARight, AComparer) {
      var I = 0;
      var J = 0;
      var P = null;
      var Q = null;
      if (((ARight - ALeft) <= 0) || (rtl.length(AValues.get()) === 0)) return;
      do {
        I = ALeft;
        J = ARight;
        P = AValues.get()[ALeft + Math.floor((ARight - ALeft) / 2)];
        do {
          while (AComparer.Compare(AValues.get()[I],P) < 0) I += 1;
          while (AComparer.Compare(AValues.get()[J],P) > 0) J -= 1;
          if (I <= J) {
            if (I !== J) {
              Q = AValues.get()[I];
              AValues.get()[I] = AValues.get()[J];
              AValues.get()[J] = Q;
            };
            I += 1;
            J -= 1;
          };
        } while (!(I > J));
        if ((J - ALeft) < (ARight - I)) {
          if (ALeft < J) this.QuickSort(AValues,ALeft,J,AComparer);
          ALeft = I;
        } else {
          if (I < ARight) this.QuickSort(AValues,I,ARight,AComparer);
          ARight = J;
        };
      } while (!(ALeft >= ARight));
    };
    this.BinarySearch = function (AValues, AItem, ASearchResult, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var ilo = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      ilo = imid * imid;
      imid = ilo * imid;
      while (imin < imax) {
        imid = rtl.trunc((imax + imin) / 2);
        ASearchResult.CompareResult = AComparer.Compare(AValues[imid],AItem);
        if (ASearchResult.CompareResult < 0) {
          imin = imid + 1}
         else {
          if (ASearchResult.CompareResult === 0) {
            ASearchResult.FoundIndex = imid;
            ASearchResult.CandidateIndex = imid;
            return true;
          };
          imax = imid;
        };
      };
      Result = imax === imin;
      if (Result) {
        ASearchResult.CompareResult = AComparer.Compare(AValues[imin],AItem);
        ASearchResult.CandidateIndex = imin;
        Result = ASearchResult.CompareResult === 0;
        if (Result) {
          ASearchResult.FoundIndex = imin}
         else ASearchResult.FoundIndex = -1;
      } else {
        ASearchResult.CompareResult = 0;
        ASearchResult.FoundIndex = -1;
        ASearchResult.CandidateIndex = -1;
      };
      return Result;
    };
    this.BinarySearch$1 = function (AValues, AItem, AFoundIndex, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var LCompare = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      while (imin < imax) {
        imid = rtl.trunc((imin + imax) / 2);
        LCompare = AComparer.Compare(AValues[imid],AItem);
        if (LCompare < 0) {
          imin = imid + 1}
         else {
          if (LCompare === 0) {
            AFoundIndex.set(imid);
            return true;
          };
          imax = imid;
        };
      };
      LCompare = AComparer.Compare(AValues[imin],AItem);
      Result = (imax === imin) && (LCompare === 0);
      if (Result) {
        AFoundIndex.set(imin)}
       else AFoundIndex.set(-1);
      return Result;
    };
  },"TArrayHelper<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCell>");
  rtl.createClass(this,"TCustomList$$$G$$generics$collections$$TTMSFNCDataGridCell",this.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridCell,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $mod.$rtti.$DynArray("TCustomList<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCell>.FItems$a",{eltype: pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCell"]});
    };
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridCell.$init.call(this);
      this.FOnNotify = null;
      this.FLength = 0;
      this.FItems = [];
    };
    this.$final = function () {
      this.FOnNotify = undefined;
      this.FItems = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridCell.$final.call(this);
    };
    this.GetCapacity = function () {
      var Result = 0;
      Result = rtl.length(this.FItems);
      return Result;
    };
    this.PrepareAddingItem = function () {
      var Result = 0;
      if (this.FLength === rtl.length(this.FItems)) this.FItems.push(null);
      Result = this.FLength;
      this.FLength += 1;
      return Result;
    };
    this.PrepareAddingRange = function (ACount) {
      var Result = 0;
      var l = 0;
      if (ACount < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (ACount === 0) return this.FLength - 1;
      for (var $l = rtl.length(this.FItems) + 1, $end = this.FLength + ACount; $l <= $end; $l++) {
        l = $l;
        this.FItems.push(null);
      };
      Result = this.FLength;
      this.FLength += ACount;
      return Result;
    };
    this.Notify = function (AValue, ACollectionNotification) {
      if (this.FOnNotify != null) this.FOnNotify(this,AValue,ACollectionNotification);
    };
    this.DoRemove = function (AIndex, ACollectionNotification) {
      var Result = null;
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      this.FLength -= 1;
      this.FItems[AIndex] = null;
      this.FItems.splice(AIndex,1);
      this.Notify(Result,ACollectionNotification);
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FLength;
      return Result;
    };
  },"TCustomList<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCell>");
  rtl.createClass(this,"TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCell",this.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCell,function () {
    this.$initSpec = function () {
    };
    this.$init = function () {
      $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCell.$init.call(this);
      this.FList = null;
      this.FIndex = 0;
    };
    this.$final = function () {
      this.FList = undefined;
      $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCell.$final.call(this);
    };
    this.DoMoveNext = function () {
      var Result = false;
      this.FIndex += 1;
      Result = (this.FList.FLength > 0) && (this.FIndex < this.FList.FLength);
      return Result;
    };
    this.DoGetCurrent = function () {
      var Result = null;
      Result = this.GetCurrent();
      return Result;
    };
    this.GetCurrent = function () {
      var Result = null;
      Result = this.FList.FItems[this.FIndex];
      return Result;
    };
    this.Create$1 = function (AList) {
      pas.System.TObject.Create.call(this);
      this.FIndex = -1;
      this.FList = AList;
      return this;
    };
  },"TCustomListEnumerator<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCell>");
  rtl.createClass(this,"TList$$$G$$generics$collections$$TTMSFNCDataGridCell",this.TCustomList$$$G$$generics$collections$$TTMSFNCDataGridCell,function () {
    this.$initSpec = function () {
      rtl.createClass(this,"TEnumerator",$mod.TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCell,function () {
      },"TList<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCell>.TEnumerator");
    };
    this.$init = function () {
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCDataGridCell.$init.call(this);
      this.FComparer = null;
    };
    this.$final = function () {
      rtl.setIntfP(this,"FComparer",null);
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCDataGridCell.$final.call(this);
    };
    this.SameValue = function (Left, Right) {
      var Result = false;
      if (this.FComparer != null) {
        Result = this.FComparer.Compare(Left,Right) === 0}
       else Result = Left === Right;
      return Result;
    };
    this.SetCapacity = function (AValue) {
      if (AValue < this.FLength) this.SetCount(AValue);
      this.FItems = rtl.arraySetLength(this.FItems,null,AValue);
    };
    this.SetCount = function (AValue) {
      if (AValue < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (AValue > this.GetCapacity()) {
        this.SetCapacity(AValue)}
       else if (AValue < this.FLength) this.DeleteRange(AValue,this.FLength - AValue);
      this.FLength = AValue;
    };
    this.InitializeList = function () {
    };
    this.InternalInsert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.FItems.splice(AIndex,0,AValue);
      this.FLength += 1;
      this.FItems[AIndex] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.GetEnumerator$1();
      return Result;
    };
    this.GetItem = function (AIndex) {
      var Result = null;
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      return Result;
    };
    this.SetItem = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.Notify(this.FItems[AIndex],$mod.TCollectionNotification.cnRemoved);
      this.FItems[AIndex] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.Create$1 = function () {
      this.InitializeList();
      return this;
    };
    this.Create$2 = function (AComparer) {
      this.InitializeList();
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Create$3 = function (ACollection) {
      var LItem = null;
      this.Create$1();
      var $in = ACollection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LItem = $in.DoGetCurrent();
          this.Add(LItem);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Destroy = function () {
      this.SetCapacity(0);
    };
    this.Add = function (AValue) {
      var Result = 0;
      Result = this.PrepareAddingItem();
      this.FItems[Result] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
      return Result;
    };
    this.AddRange = function (AValues) {
      this.InsertRange(this.FLength,AValues);
    };
    this.AddRange$1 = function (AEnumerable) {
      var LValue = null;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.Add(LValue);
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.AddRange$2 = function (AEnumerable) {
      var LValue = null;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.Add(LValue);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Insert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.InternalInsert(AIndex,AValue);
    };
    this.InsertRange = function (AIndex, AValues) {
      var LLength = 0;
      var i = 0;
      var LValue = null;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LLength = rtl.length(AValues);
      if (LLength === 0) return;
      if (AIndex !== this.PrepareAddingRange(LLength)) {
        for (var $l = AIndex, $end = this.FLength - LLength - 1; $l <= $end; $l++) {
          i = $l;
          this.FItems[i + LLength] = this.FItems[i];
        };
        for (var $l1 = 0, $end1 = LLength - 1; $l1 <= $end1; $l1++) {
          i = $l1;
          this.FItems[AIndex + i] = null;
        };
      };
      for (var $l2 = 0, $end2 = LLength - 1; $l2 <= $end2; $l2++) {
        i = $l2;
        LValue = AValues[i];
        this.FItems[i + AIndex] = LValue;
        this.Notify(LValue,$mod.TCollectionNotification.cnAdded);
      };
    };
    this.InsertRange$1 = function (AIndex, AEnumerable) {
      var LValue = null;
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.InsertRange$2 = function (AIndex, AEnumerable) {
      var LValue = null;
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Remove = function (AValue) {
      var Result = 0;
      Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.RemoveItem = function (AValue, Direction) {
      var Result = 0;
      if (Direction === $mod.TDirection.fromEnd) {
        Result = this.LastIndexOf(AValue)}
       else Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.Delete = function (AIndex) {
      this.DoRemove(AIndex,$mod.TCollectionNotification.cnRemoved);
    };
    this.DeleteRange = function (AIndex, ACount) {
      var LDeleted = [];
      var i = 0;
      if (ACount === 0) return;
      if ((ACount < 0) || (AIndex < 0) || ((AIndex + ACount) > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LDeleted = this.FItems.splice(AIndex,this.FLength);
      this.FLength -= ACount;
      for (var $l = 0, $end = rtl.length(LDeleted) - 1; $l <= $end; $l++) {
        i = $l;
        this.Notify(LDeleted[i],$mod.TCollectionNotification.cnRemoved);
      };
    };
    this.ExtractIndex = function (AIndex) {
      var Result = null;
      Result = this.DoRemove(AIndex,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.Extract = function (AValue) {
      var Result = null;
      var LIndex = 0;
      LIndex = this.IndexOf(AValue);
      if (LIndex < 0) {
        Result = null}
       else Result = this.DoRemove(LIndex,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.Exchange = function (AIndex1, AIndex2) {
      var LTemp = null;
      LTemp = this.FItems[AIndex1];
      this.FItems[AIndex1] = this.FItems[AIndex2];
      this.FItems[AIndex2] = LTemp;
    };
    this.Move = function (AIndex, ANewIndex) {
      var Arr = null;
      var LTemp = undefined;
      var i = 0;
      if (ANewIndex === AIndex) return;
      if ((ANewIndex < 0) || (ANewIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Arr = this.FItems;
      LTemp = Arr[AIndex];
      if (AIndex < ANewIndex) {
        for (var $l = AIndex, $end = ANewIndex - 1; $l <= $end; $l++) {
          i = $l;
          Arr[i] = Arr[i + 1];
        }}
       else for (var $l1 = AIndex, $end1 = ANewIndex + 1; $l1 >= $end1; $l1--) {
        i = $l1;
        Arr[i] = Arr[i - 1];
      };
      Arr[ANewIndex] = LTemp;
    };
    this.First = function () {
      var Result = null;
      Result = this.GetItem(0);
      return Result;
    };
    this.Last = function () {
      var Result = null;
      Result = this.GetItem(this.FLength - 1);
      return Result;
    };
    this.Clear = function () {
      this.SetCount(0);
      this.SetCapacity(0);
    };
    this.Contains = function (AValue) {
      var Result = false;
      Result = this.IndexOf(AValue) >= 0;
      return Result;
    };
    this.IndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = 0, $end = this.FLength - 1; $l <= $end; $l++) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.LastIndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = this.FLength - 1; $l >= 0; $l--) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.Reverse = function () {
      var a = 0;
      var b = 0;
      var LTemp = null;
      a = 0;
      b = this.FLength - 1;
      while (a < b) {
        LTemp = this.FItems[a];
        this.FItems[a] = this.FItems[b];
        this.FItems[b] = LTemp;
        a += 1;
        b -= 1;
      };
    };
    this.TrimExcess = function () {
      this.SetCapacity(this.FLength);
    };
    this.Sort = function () {
      $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridCell.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},this.FComparer,0,this.FLength);
    };
    this.Sort$1 = function (AComparer) {
      $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridCell.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},AComparer,0,this.FLength);
    };
    this.BinarySearch = function (AItem, AIndex) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridCell.BinarySearch$1(this.FItems,AItem,AIndex,this.FComparer,0,this.FLength);
      return Result;
    };
    this.BinarySearch$1 = function (AItem, AIndex, AComparer) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridCell.BinarySearch$1(this.FItems,AItem,AIndex,AComparer,0,this.FLength);
      return Result;
    };
  },"TList<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCell>");
  rtl.createClass(this,"TObjectList$$$G$$generics$collections$$TTMSFNCDataGridCell",this.TList$$$G$$generics$collections$$TTMSFNCDataGridCell,function () {
    this.$initSpec = function () {
    };
    this.$init = function () {
      $mod.TList$$$G$$generics$collections$$TTMSFNCDataGridCell.$init.call(this);
      this.FObjectsOwner = false;
    };
    this.Notify = function (aValue, Action) {
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCDataGridCell.Notify.call(this,aValue,Action);
      if (this.FObjectsOwner && (Action === $mod.TCollectionNotification.cnRemoved)) aValue = rtl.freeLoc(aValue);
    };
    this.Create$4 = function (aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCDataGridCell.Create$1.call(this);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
    this.Create$5 = function (AComparer, aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCDataGridCell.Create$2.call(this,AComparer);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
    this.Create$6 = function (aCollection, aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCDataGridCell.Create$3.call(this,aCollection);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
  },"TObjectList<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCell>");
  rtl.recNewT(this,"TPair$$$G$$generics$collections$$TTMSFNCDataGridCellCoord$$Boolean",function () {
    var $r = $mod.$rtti.$Record("TPair<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord,System.Boolean>",{},this);
    this.$initSpec = function () {
      this.Value = false;
      $r.addField("Key",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]);
      $r.addField("Value",rtl.boolean);
      $r.addMethod("Create",2,[["AKey",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"],2],["AValue",rtl.boolean,2]]);
    };
    this.$new = function () {
      var r = Object.create(this);
      r.Key = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      return r;
    };
    this.$eq = function (b) {
      return this.Key.$eq(b.Key) && (this.Value === b.Value);
    };
    this.$assign = function (s) {
      this.Key.$assign(s.Key);
      this.Value = s.Value;
      return this;
    };
    this.Create = function (AKey, AValue) {
      this.Key.$assign(AKey);
      this.Value = AValue;
      return this;
    };
  });
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TPair$WEBLib$TMSFNCDataGridCore$TTMSFNCDataGridCellCoord$System$Boolean$",pas.System.TObject,function () {
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<Generics.Collections.TPair<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord,System.Boolean>>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TPair$WEBLib$TMSFNCDataGridCore$TTMSFNCDataGridCellCoord$System$Boolean$",pas.System.TObject,function () {
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push($mod.TPair$$$G$$generics$collections$$TTMSFNCDataGridCellCoord$$Boolean.$clone(LEnumerator.DoGetCurrent()));
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<Generics.Collections.TPair<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord,System.Boolean>>");
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCellCoord",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridCellCoord",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(LEnumerator.DoGetCurrent()));
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord>");
  this.$rtti.$MethodVar("TCollectionNotifyEvent<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord>",{init: function () {
      this.procsig = rtl.newTIProcSig([["ASender",pas.System.$rtti["TObject"]],["AItem",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"],2],["AAction",$mod.$rtti["TCollectionNotification"]]]);
    }, methodkind: 0});
  rtl.createClass(this,"TDictionary$$$G$$generics$collections$$TTMSFNCDataGridCellCoord$$Boolean",this.TEnumerable$$$G$$generics$collections$$TPair$WEBLib$TMSFNCDataGridCore$TTMSFNCDataGridCellCoord$System$Boolean$,function () {
    this.$initSpec = function () {
      rtl.createClass(this,"TPairEnumerator",$mod.TEnumerator$$$G$$generics$collections$$TPair$WEBLib$TMSFNCDataGridCore$TTMSFNCDataGridCellCoord$System$Boolean$,function () {
        this.$init = function () {
          $mod.TEnumerator$$$G$$generics$collections$$TPair$WEBLib$TMSFNCDataGridCore$TTMSFNCDataGridCellCoord$System$Boolean$.$init.call(this);
          this.FIter = null;
          this.FVal = null;
        };
        this.$final = function () {
          this.FIter = undefined;
          this.FVal = undefined;
          $mod.TEnumerator$$$G$$generics$collections$$TPair$WEBLib$TMSFNCDataGridCore$TTMSFNCDataGridCellCoord$System$Boolean$.$final.call(this);
        };
        this.GetCurrent = function () {
          var Result = $mod.TPair$$$G$$generics$collections$$TTMSFNCDataGridCellCoord$$Boolean.$new();
          Result.$assign(this.DoGetCurrent());
          return Result;
        };
        this.DoGetCurrent = function () {
          var Result = $mod.TPair$$$G$$generics$collections$$TTMSFNCDataGridCellCoord$$Boolean.$new();
          var A = [];
          A = this.FVal.value;
          Result.$assign($mod.TPair$$$G$$generics$collections$$TTMSFNCDataGridCellCoord$$Boolean.$new());
          Result.Create(rtl.getObject(A[0]),!(A[1] == false));
          return Result;
        };
        this.DoMoveNext = function () {
          var Result = false;
          this.FVal = this.FIter.next();
          Result = !this.FVal.done;
          return Result;
        };
        this.Create$1 = function (ADictionary) {
          this.FIter = ADictionary.FMap.entries();
          return this;
        };
        this.MoveNext$1 = function () {
          var Result = false;
          Result = this.DoMoveNext();
          return Result;
        };
      },"TDictionary<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord,System.Boolean>.TPairEnumerator");
      rtl.createClass(this,"TKeyEnumerator",$mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCellCoord,function () {
        this.$init = function () {
          $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCellCoord.$init.call(this);
          this.FIter = null;
          this.FVal = null;
        };
        this.$final = function () {
          this.FIter = undefined;
          this.FVal = undefined;
          $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCellCoord.$final.call(this);
        };
        this.GetCurrent = function () {
          var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
          Result.$assign(this.DoGetCurrent());
          return Result;
        };
        this.DoGetCurrent = function () {
          var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
          Result.$assign(rtl.getObject(this.FVal.value));
          return Result;
        };
        this.DoMoveNext = function () {
          var Result = false;
          this.FVal = this.FIter.next();
          Result = !this.FVal.done;
          return Result;
        };
        this.Create$1 = function (AIter) {
          this.FIter = AIter;
          return this;
        };
        this.Create$2 = function (ADictionary) {
          this.Create$1(ADictionary.FMap.keys());
          return this;
        };
        this.MoveNext$1 = function () {
          var Result = false;
          Result = this.DoMoveNext();
          return Result;
        };
      },"TDictionary<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord,System.Boolean>.TKeyEnumerator");
      rtl.createClass(this,"TValueEnumerator",$mod.TEnumerator$$$G$$generics$collections$$Boolean,function () {
        this.$init = function () {
          $mod.TEnumerator$$$G$$generics$collections$$Boolean.$init.call(this);
          this.FIter = null;
          this.FVal = null;
        };
        this.$final = function () {
          this.FIter = undefined;
          this.FVal = undefined;
          $mod.TEnumerator$$$G$$generics$collections$$Boolean.$final.call(this);
        };
        this.GetCurrent = function () {
          var Result = false;
          Result = this.DoGetCurrent();
          return Result;
        };
        this.DoGetCurrent = function () {
          var Result = false;
          Result = !(this.FVal.value == false);
          return Result;
        };
        this.DoMoveNext = function () {
          var Result = false;
          this.FVal = this.FIter.next();
          Result = !this.FVal.done;
          return Result;
        };
        this.Create$1 = function (AIter) {
          this.FIter = AIter;
          return this;
        };
        this.Create$2 = function (ADictionary) {
          this.Create$1(ADictionary.FMap.values());
          return this;
        };
        this.MoveNext$1 = function () {
          var Result = false;
          Result = this.DoMoveNext();
          return Result;
        };
      },"TDictionary<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord,System.Boolean>.TValueEnumerator");
      rtl.createClass(this,"TValueCollection",$mod.TEnumerable$$$G$$generics$collections$$Boolean,function () {
        this.$init = function () {
          $mod.TEnumerable$$$G$$generics$collections$$Boolean.$init.call(this);
          this.FMap = null;
        };
        this.$final = function () {
          this.FMap = undefined;
          $mod.TEnumerable$$$G$$generics$collections$$Boolean.$final.call(this);
        };
        this.GetCount = function () {
          var Result = 0;
          Result = this.FMap.size;
          return Result;
        };
        this.DoGetEnumerator = function () {
          var Result = null;
          Result = $mod.TDictionary$$$G$$generics$collections$$TTMSFNCDataGridCellCoord$$Boolean.TValueEnumerator.$create("Create$1",[this.FMap.values()]);
          return Result;
        };
        this.Create$1 = function (ADictionary) {
          this.FMap = ADictionary.FMap;
          return this;
        };
        this.GetEnumerator$1 = function () {
          var Result = null;
          Result = this.DoGetEnumerator();
          return Result;
        };
        this.ToArray = function () {
          var Result = [];
          var I = 0;
          var P = false;
          Result = rtl.arraySetLength(Result,false,this.FMap.size);
          var $in = this.GetEnumerator$1();
          try {
            while ($in.MoveNext$1()) {
              P = $in.GetCurrent();
              Result[I] = P;
              I += 1;
            }
          } finally {
            $in = rtl.freeLoc($in)
          };
          return Result;
        };
      },"TDictionary<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord,System.Boolean>.TValueCollection");
      rtl.createClass(this,"TKeyCollection",$mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridCellCoord,function () {
        this.$init = function () {
          $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridCellCoord.$init.call(this);
          this.FMap = null;
        };
        this.$final = function () {
          this.FMap = undefined;
          $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridCellCoord.$final.call(this);
        };
        this.GetCount = function () {
          var Result = 0;
          Result = this.FMap.size;
          return Result;
        };
        this.DoGetEnumerator = function () {
          var Result = null;
          Result = this.GetEnumerator$1();
          return Result;
        };
        this.Create$1 = function (ADictionary) {
          this.FMap = ADictionary.FMap;
          return this;
        };
        this.GetEnumerator$1 = function () {
          var Result = null;
          Result = $mod.TDictionary$$$G$$generics$collections$$TTMSFNCDataGridCellCoord$$Boolean.TKeyEnumerator.$create("Create$1",[this.FMap.keys()]);
          return Result;
        };
        this.ToArray = function () {
          var Result = [];
          Result = $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridCellCoord.ToArray.call(this);
          return Result;
        };
      },"TDictionary<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord,System.Boolean>.TKeyCollection");
    };
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$TPair$WEBLib$TMSFNCDataGridCore$TTMSFNCDataGridCellCoord$System$Boolean$.$init.call(this);
      this.FMap = null;
      this.FComparer = null;
      this.FOnKeyNotify = null;
      this.FOnValueNotify = null;
      this.FKeyCollection = null;
      this.FValueCollection = null;
    };
    this.$final = function () {
      this.FMap = undefined;
      rtl.setIntfP(this,"FComparer",null);
      this.FOnKeyNotify = undefined;
      this.FOnValueNotify = undefined;
      this.FKeyCollection = undefined;
      this.FValueCollection = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$TPair$WEBLib$TMSFNCDataGridCore$TTMSFNCDataGridCellCoord$System$Boolean$.$final.call(this);
    };
    this.GetEffectiveKey = function (Key) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var it = null;
      var v = null;
      if (!(this.FComparer != null)) return Key;
      it = this.FMap.keys();
      v = it.next();
      while (!v.done) {
        Result.$assign(rtl.getObject(v.value));
        if (this.FComparer.Compare(Result,Key) === 0) return Result;
        v = it.next();
      };
      Result.$assign(Key);
      return Result;
    };
    this.GetItem = function (Key) {
      var Result = false;
      var V = undefined;
      V = this.FMap.get(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.GetEffectiveKey(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Key))));
      if (pas.JS.isUndefined(V)) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictKeyNotFound")]);
      Result = !(V == false);
      return Result;
    };
    this.SetItem = function (Key, Value) {
      var V = undefined;
      V = this.FMap.get(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.GetEffectiveKey(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Key))));
      if (!pas.JS.isUndefined(V)) this.ValueNotify(!(V == false),$mod.TCollectionNotification.cnRemoved);
      this.FMap.set(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Key),Value);
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoAdd = function (Key, Value) {
      this.FMap.set(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.GetEffectiveKey(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Key))),Value);
      this.KeyNotify(Key,$mod.TCollectionNotification.cnAdded);
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoRemove = function (Key, Notification) {
      var Result = false;
      var V = undefined;
      var K = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      K.$assign(this.GetEffectiveKey(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Key)));
      V = this.FMap.get(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(K));
      if (!pas.JS.isUndefined(V)) {
        this.FMap.delete(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(K));
        Result = !(V == false);
        this.KeyNotify(Key,Notification);
        this.ValueNotify(Result,Notification);
      };
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FMap.size;
      return Result;
    };
    this.CanClearMap = function () {
      var Result = false;
      Result = (this.FOnKeyNotify === null) && (this.FOnValueNotify === null);
      return Result;
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.PairNotify = function (Key, Value, Action) {
      this.KeyNotify(Key,Action);
      this.ValueNotify(Value,Action);
    };
    this.KeyNotify = function (Key, Action) {
      if (this.FOnKeyNotify != null) this.FOnKeyNotify(this,Key,Action);
    };
    this.ValueNotify = function (Value, Action) {
      if (this.FOnValueNotify != null) this.FOnValueNotify(this,Value,Action);
    };
    this.Create$1 = function (ACapacity) {
      this.FMap = new Map();
      if (ACapacity > 0) ;
      return this;
    };
    this.Create$2 = function (Collection) {
      var aPair = $mod.TPair$$$G$$generics$collections$$TTMSFNCDataGridCellCoord$$Boolean.$new();
      this.Create$1(0);
      var $in = Collection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          aPair = $in.DoGetCurrent();
          this.Add(aPair.Key,aPair.Value);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Create$3 = function (AComparer) {
      this.Create$1(0);
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FKeyCollection;
        }, set: function (v) {
          this.p.FKeyCollection = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FValueCollection;
        }, set: function (v) {
          this.p.FValueCollection = v;
        }});
      this.Clear();
      this.FMap = null;
      pas.System.TObject.Destroy.call(this);
    };
    this.Add = function (Key, Value) {
      if (this.FMap.has(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.GetEffectiveKey(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Key))))) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictDuplicateKey")]);
      this.DoAdd(Key,Value);
    };
    this.Remove = function (Key) {
      this.DoRemove(Key,$mod.TCollectionNotification.cnRemoved);
    };
    this.ExtractPair = function (Key) {
      var Result = $mod.TPair$$$G$$generics$collections$$TTMSFNCDataGridCellCoord$$Boolean.$new();
      var K = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      Result.$assign($mod.TPair$$$G$$generics$collections$$TTMSFNCDataGridCellCoord$$Boolean.$new());
      K.$assign(this.GetEffectiveKey(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Key)));
      if (this.FMap.has(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(K))) {
        Result.Create(Key,!(this.FMap.get(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(K)) == false));
        this.FMap.delete(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(K));
      } else Result.Create(Key,false);
      return Result;
    };
    this.Clear = function () {
      var Iter = null;
      var IVal = null;
      var A = [];
      var K = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var V = false;
      if (this.CanClearMap()) {
        this.FMap.clear()}
       else {
        Iter = this.FMap.entries();
        do {
          IVal = Iter.next();
          if (!IVal.done) {
            A = IVal.value;
            K.$assign(rtl.getObject(A[0]));
            V = !(A[1] == false);
            this.FMap.delete(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(K));
            this.PairNotify(K,V,$mod.TCollectionNotification.cnRemoved);
          };
        } while (!IVal.done);
      };
    };
    this.TryGetValue = function (Key, Value) {
      var Result = false;
      var K = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      K.$assign(this.GetEffectiveKey(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Key)));
      Result = this.FMap.has(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(K));
      if (Result) Value.set(!(this.FMap.get(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(K)) == false));
      return Result;
    };
    this.AddOrSetValue = function (Key, Value) {
      var k = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      k.$assign(this.GetEffectiveKey(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Key)));
      if (!this.FMap.has(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(k))) {
        this.DoAdd(Key,Value)}
       else this.SetItem(k,Value);
    };
    this.ContainsKey = function (Key) {
      var Result = false;
      Result = this.FMap.has(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.GetEffectiveKey(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Key))));
      return Result;
    };
    this.ContainsValue = function (Value) {
      var Result = false;
      var It = null;
      var Res = null;
      Result = false;
      It = this.FMap.values();
      do {
        Res = It.next();
        if (!Res.done) Result = Value === !(Res.value == false);
      } while (!(Result || Res.done));
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      Result = $mod.TEnumerable$$$G$$generics$collections$$TPair$WEBLib$TMSFNCDataGridCore$TTMSFNCDataGridCellCoord$System$Boolean$.ToArray.call(this);
      return Result;
    };
    this.GetKeys = function () {
      var Result = null;
      if (this.FKeyCollection === null) this.FKeyCollection = this.TKeyCollection.$create("Create$1",[this]);
      Result = this.FKeyCollection;
      return Result;
    };
    this.GetValues = function () {
      var Result = null;
      if (this.FValueCollection === null) this.FValueCollection = this.TValueCollection.$create("Create$1",[this]);
      Result = this.FValueCollection;
      return Result;
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
  },"TDictionary<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord,System.Boolean>");
  rtl.createClass(this,"TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridCellCoord",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.Sort = function (AValues, AComparer) {
      this.Sort$1(AValues,AComparer,0,rtl.length(AValues.get()));
    };
    this.Sort$1 = function (AValues, AComparer, AIndex, ACount) {
      if (ACount <= 1) return;
      this.QuickSort(AValues,AIndex,(AIndex + ACount) - 1,AComparer);
    };
    this.BinarySearch$2 = function (AValues, AItem, AFoundIndex, AComparer) {
      var Result = false;
      Result = this.BinarySearch$1(AValues,AItem,AFoundIndex,AComparer,0,rtl.length(AValues));
      return Result;
    };
    this.BinarySearch$3 = function (AValues, AItem, ASearchResult, AComparer) {
      var Result = false;
      Result = this.BinarySearch(AValues,AItem,ASearchResult,AComparer,0,rtl.length(AValues));
      return Result;
    };
  },"TCustomArrayHelper<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord>");
  rtl.createClass(this,"TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridCellCoord",this.TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridCellCoord,function () {
    this.$initSpec = function () {
    };
    this.QuickSort = function (AValues, ALeft, ARight, AComparer) {
      var I = 0;
      var J = 0;
      var P = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var Q = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      if (((ARight - ALeft) <= 0) || (rtl.length(AValues.get()) === 0)) return;
      do {
        I = ALeft;
        J = ARight;
        P.$assign(AValues.get()[ALeft + Math.floor((ARight - ALeft) / 2)]);
        do {
          while (AComparer.Compare(AValues.get()[I],P) < 0) I += 1;
          while (AComparer.Compare(AValues.get()[J],P) > 0) J -= 1;
          if (I <= J) {
            if (I !== J) {
              Q.$assign(AValues.get()[I]);
              AValues.get()[I].$assign(AValues.get()[J]);
              AValues.get()[J].$assign(Q);
            };
            I += 1;
            J -= 1;
          };
        } while (!(I > J));
        if ((J - ALeft) < (ARight - I)) {
          if (ALeft < J) this.QuickSort(AValues,ALeft,J,AComparer);
          ALeft = I;
        } else {
          if (I < ARight) this.QuickSort(AValues,I,ARight,AComparer);
          ARight = J;
        };
      } while (!(ALeft >= ARight));
    };
    this.BinarySearch = function (AValues, AItem, ASearchResult, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var ilo = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      ilo = imid * imid;
      imid = ilo * imid;
      while (imin < imax) {
        imid = rtl.trunc((imax + imin) / 2);
        ASearchResult.CompareResult = AComparer.Compare(AValues[imid],AItem);
        if (ASearchResult.CompareResult < 0) {
          imin = imid + 1}
         else {
          if (ASearchResult.CompareResult === 0) {
            ASearchResult.FoundIndex = imid;
            ASearchResult.CandidateIndex = imid;
            return true;
          };
          imax = imid;
        };
      };
      Result = imax === imin;
      if (Result) {
        ASearchResult.CompareResult = AComparer.Compare(AValues[imin],AItem);
        ASearchResult.CandidateIndex = imin;
        Result = ASearchResult.CompareResult === 0;
        if (Result) {
          ASearchResult.FoundIndex = imin}
         else ASearchResult.FoundIndex = -1;
      } else {
        ASearchResult.CompareResult = 0;
        ASearchResult.FoundIndex = -1;
        ASearchResult.CandidateIndex = -1;
      };
      return Result;
    };
    this.BinarySearch$1 = function (AValues, AItem, AFoundIndex, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var LCompare = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      while (imin < imax) {
        imid = rtl.trunc((imin + imax) / 2);
        LCompare = AComparer.Compare(AValues[imid],AItem);
        if (LCompare < 0) {
          imin = imid + 1}
         else {
          if (LCompare === 0) {
            AFoundIndex.set(imid);
            return true;
          };
          imax = imid;
        };
      };
      LCompare = AComparer.Compare(AValues[imin],AItem);
      Result = (imax === imin) && (LCompare === 0);
      if (Result) {
        AFoundIndex.set(imin)}
       else AFoundIndex.set(-1);
      return Result;
    };
  },"TArrayHelper<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord>");
  rtl.createClass(this,"TCustomList$$$G$$generics$collections$$TTMSFNCDataGridCellCoord",this.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridCellCoord,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $mod.$rtti.$DynArray("TCustomList<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord>.FItems$a",{eltype: pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]});
    };
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridCellCoord.$init.call(this);
      this.FOnNotify = null;
      this.FLength = 0;
      this.FItems = [];
    };
    this.$final = function () {
      this.FOnNotify = undefined;
      this.FItems = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridCellCoord.$final.call(this);
    };
    this.GetCapacity = function () {
      var Result = 0;
      Result = rtl.length(this.FItems);
      return Result;
    };
    this.PrepareAddingItem = function () {
      var Result = 0;
      if (this.FLength === rtl.length(this.FItems)) this.FItems.push(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new());
      Result = this.FLength;
      this.FLength += 1;
      return Result;
    };
    this.PrepareAddingRange = function (ACount) {
      var Result = 0;
      var l = 0;
      if (ACount < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (ACount === 0) return this.FLength - 1;
      for (var $l = rtl.length(this.FItems) + 1, $end = this.FLength + ACount; $l <= $end; $l++) {
        l = $l;
        this.FItems.push(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new());
      };
      Result = this.FLength;
      this.FLength += ACount;
      return Result;
    };
    this.Notify = function (AValue, ACollectionNotification) {
      if (this.FOnNotify != null) this.FOnNotify(this,AValue,ACollectionNotification);
    };
    this.DoRemove = function (AIndex, ACollectionNotification) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result.$assign(this.FItems[AIndex]);
      this.FLength -= 1;
      this.FItems[AIndex].$assign(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new());
      this.FItems.splice(AIndex,1);
      this.Notify(Result,ACollectionNotification);
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FLength;
      return Result;
    };
  },"TCustomList<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord>");
  rtl.createClass(this,"TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCellCoord",this.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCellCoord,function () {
    this.$initSpec = function () {
    };
    this.$init = function () {
      $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCellCoord.$init.call(this);
      this.FList = null;
      this.FIndex = 0;
    };
    this.$final = function () {
      this.FList = undefined;
      $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCellCoord.$final.call(this);
    };
    this.DoMoveNext = function () {
      var Result = false;
      this.FIndex += 1;
      Result = (this.FList.FLength > 0) && (this.FIndex < this.FList.FLength);
      return Result;
    };
    this.DoGetCurrent = function () {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      Result.$assign(this.GetCurrent());
      return Result;
    };
    this.GetCurrent = function () {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      Result.$assign(this.FList.FItems[this.FIndex]);
      return Result;
    };
    this.Create$1 = function (AList) {
      pas.System.TObject.Create.call(this);
      this.FIndex = -1;
      this.FList = AList;
      return this;
    };
  },"TCustomListEnumerator<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord>");
  rtl.createClass(this,"TList$$$G$$generics$collections$$TTMSFNCDataGridCellCoord",this.TCustomList$$$G$$generics$collections$$TTMSFNCDataGridCellCoord,function () {
    this.$initSpec = function () {
      rtl.createClass(this,"TEnumerator",$mod.TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCellCoord,function () {
      },"TList<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord>.TEnumerator");
    };
    this.$init = function () {
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCDataGridCellCoord.$init.call(this);
      this.FComparer = null;
    };
    this.$final = function () {
      rtl.setIntfP(this,"FComparer",null);
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCDataGridCellCoord.$final.call(this);
    };
    this.SameValue = function (Left, Right) {
      var Result = false;
      if (this.FComparer != null) {
        Result = this.FComparer.Compare(Left,Right) === 0}
       else Result = Left.$eq(Right);
      return Result;
    };
    this.SetCapacity = function (AValue) {
      if (AValue < this.FLength) this.SetCount(AValue);
      this.FItems = rtl.arraySetLength(this.FItems,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord,AValue);
    };
    this.SetCount = function (AValue) {
      if (AValue < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (AValue > this.GetCapacity()) {
        this.SetCapacity(AValue)}
       else if (AValue < this.FLength) this.DeleteRange(AValue,this.FLength - AValue);
      this.FLength = AValue;
    };
    this.InitializeList = function () {
    };
    this.InternalInsert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.FItems.splice(AIndex,0,AValue);
      this.FLength += 1;
      this.FItems[AIndex].$assign(AValue);
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.GetEnumerator$1();
      return Result;
    };
    this.GetItem = function (AIndex) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result.$assign(this.FItems[AIndex]);
      return Result;
    };
    this.SetItem = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.Notify(this.FItems[AIndex],$mod.TCollectionNotification.cnRemoved);
      this.FItems[AIndex].$assign(AValue);
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.Create$1 = function () {
      this.InitializeList();
      return this;
    };
    this.Create$2 = function (AComparer) {
      this.InitializeList();
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Create$3 = function (ACollection) {
      var LItem = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      this.Create$1();
      var $in = ACollection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LItem = $in.DoGetCurrent();
          this.Add(LItem);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Destroy = function () {
      this.SetCapacity(0);
    };
    this.Add = function (AValue) {
      var Result = 0;
      Result = this.PrepareAddingItem();
      this.FItems[Result].$assign(AValue);
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
      return Result;
    };
    this.AddRange = function (AValues) {
      this.InsertRange(this.FLength,AValues);
    };
    this.AddRange$1 = function (AEnumerable) {
      var LValue = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.Add(LValue);
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.AddRange$2 = function (AEnumerable) {
      var LValue = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.Add(LValue);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Insert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.InternalInsert(AIndex,AValue);
    };
    this.InsertRange = function (AIndex, AValues) {
      var LLength = 0;
      var i = 0;
      var LValue = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LLength = rtl.length(AValues);
      if (LLength === 0) return;
      if (AIndex !== this.PrepareAddingRange(LLength)) {
        for (var $l = AIndex, $end = this.FLength - LLength - 1; $l <= $end; $l++) {
          i = $l;
          this.FItems[i + LLength].$assign(this.FItems[i]);
        };
        for (var $l1 = 0, $end1 = LLength - 1; $l1 <= $end1; $l1++) {
          i = $l1;
          this.FItems[AIndex + i].$assign(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new());
        };
      };
      for (var $l2 = 0, $end2 = LLength - 1; $l2 <= $end2; $l2++) {
        i = $l2;
        LValue.$assign(AValues[i]);
        this.FItems[i + AIndex].$assign(LValue);
        this.Notify(LValue,$mod.TCollectionNotification.cnAdded);
      };
    };
    this.InsertRange$1 = function (AIndex, AEnumerable) {
      var LValue = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.InsertRange$2 = function (AIndex, AEnumerable) {
      var LValue = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Remove = function (AValue) {
      var Result = 0;
      Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.RemoveItem = function (AValue, Direction) {
      var Result = 0;
      if (Direction === $mod.TDirection.fromEnd) {
        Result = this.LastIndexOf(AValue)}
       else Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.Delete = function (AIndex) {
      this.DoRemove(AIndex,$mod.TCollectionNotification.cnRemoved);
    };
    this.DeleteRange = function (AIndex, ACount) {
      var LDeleted = [];
      var i = 0;
      if (ACount === 0) return;
      if ((ACount < 0) || (AIndex < 0) || ((AIndex + ACount) > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LDeleted = this.FItems.splice(AIndex,this.FLength);
      this.FLength -= ACount;
      for (var $l = 0, $end = rtl.length(LDeleted) - 1; $l <= $end; $l++) {
        i = $l;
        this.Notify(LDeleted[i],$mod.TCollectionNotification.cnRemoved);
      };
    };
    this.ExtractIndex = function (AIndex) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      Result.$assign(this.DoRemove(AIndex,$mod.TCollectionNotification.cnExtracted));
      return Result;
    };
    this.Extract = function (AValue) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var LIndex = 0;
      LIndex = this.IndexOf(AValue);
      if (LIndex < 0) {
        Result.$assign(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new())}
       else Result.$assign(this.DoRemove(LIndex,$mod.TCollectionNotification.cnExtracted));
      return Result;
    };
    this.Exchange = function (AIndex1, AIndex2) {
      var LTemp = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      LTemp.$assign(this.FItems[AIndex1]);
      this.FItems[AIndex1].$assign(this.FItems[AIndex2]);
      this.FItems[AIndex2].$assign(LTemp);
    };
    this.Move = function (AIndex, ANewIndex) {
      var Arr = null;
      var LTemp = undefined;
      var i = 0;
      if (ANewIndex === AIndex) return;
      if ((ANewIndex < 0) || (ANewIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Arr = this.FItems;
      LTemp = Arr[AIndex];
      if (AIndex < ANewIndex) {
        for (var $l = AIndex, $end = ANewIndex - 1; $l <= $end; $l++) {
          i = $l;
          Arr[i] = Arr[i + 1];
        }}
       else for (var $l1 = AIndex, $end1 = ANewIndex + 1; $l1 >= $end1; $l1--) {
        i = $l1;
        Arr[i] = Arr[i - 1];
      };
      Arr[ANewIndex] = LTemp;
    };
    this.First = function () {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      Result.$assign(this.GetItem(0));
      return Result;
    };
    this.Last = function () {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      Result.$assign(this.GetItem(this.FLength - 1));
      return Result;
    };
    this.Clear = function () {
      this.SetCount(0);
      this.SetCapacity(0);
    };
    this.Contains = function (AValue) {
      var Result = false;
      Result = this.IndexOf(AValue) >= 0;
      return Result;
    };
    this.IndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = 0, $end = this.FLength - 1; $l <= $end; $l++) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.LastIndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = this.FLength - 1; $l >= 0; $l--) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.Reverse = function () {
      var a = 0;
      var b = 0;
      var LTemp = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      a = 0;
      b = this.FLength - 1;
      while (a < b) {
        LTemp.$assign(this.FItems[a]);
        this.FItems[a].$assign(this.FItems[b]);
        this.FItems[b].$assign(LTemp);
        a += 1;
        b -= 1;
      };
    };
    this.TrimExcess = function () {
      this.SetCapacity(this.FLength);
    };
    this.Sort = function () {
      $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridCellCoord.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},this.FComparer,0,this.FLength);
    };
    this.Sort$1 = function (AComparer) {
      $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridCellCoord.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},AComparer,0,this.FLength);
    };
    this.BinarySearch = function (AItem, AIndex) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridCellCoord.BinarySearch$1(this.FItems,AItem,AIndex,this.FComparer,0,this.FLength);
      return Result;
    };
    this.BinarySearch$1 = function (AItem, AIndex, AComparer) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridCellCoord.BinarySearch$1(this.FItems,AItem,AIndex,AComparer,0,this.FLength);
      return Result;
    };
  },"TList<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord>");
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<WEBLib.TMSFNCDataGridRenderer.TTMSFNCDataGridCellControlWrapperListItem>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push(LEnumerator.DoGetCurrent());
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<WEBLib.TMSFNCDataGridRenderer.TTMSFNCDataGridCellControlWrapperListItem>");
  this.$rtti.$MethodVar("TCollectionNotifyEvent<WEBLib.TMSFNCDataGridRenderer.TTMSFNCDataGridCellControlWrapperListItem>",{init: function () {
      this.procsig = rtl.newTIProcSig([["ASender",pas.System.$rtti["TObject"]],["AItem",pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCellControlWrapperListItem"],2],["AAction",$mod.$rtti["TCollectionNotification"]]]);
    }, methodkind: 0});
  rtl.createClass(this,"TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.Sort = function (AValues, AComparer) {
      this.Sort$1(AValues,AComparer,0,rtl.length(AValues.get()));
    };
    this.Sort$1 = function (AValues, AComparer, AIndex, ACount) {
      if (ACount <= 1) return;
      this.QuickSort(AValues,AIndex,(AIndex + ACount) - 1,AComparer);
    };
    this.BinarySearch$2 = function (AValues, AItem, AFoundIndex, AComparer) {
      var Result = false;
      Result = this.BinarySearch$1(AValues,AItem,AFoundIndex,AComparer,0,rtl.length(AValues));
      return Result;
    };
    this.BinarySearch$3 = function (AValues, AItem, ASearchResult, AComparer) {
      var Result = false;
      Result = this.BinarySearch(AValues,AItem,ASearchResult,AComparer,0,rtl.length(AValues));
      return Result;
    };
  },"TCustomArrayHelper<WEBLib.TMSFNCDataGridRenderer.TTMSFNCDataGridCellControlWrapperListItem>");
  rtl.createClass(this,"TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem",this.TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem,function () {
    this.$initSpec = function () {
    };
    this.QuickSort = function (AValues, ALeft, ARight, AComparer) {
      var I = 0;
      var J = 0;
      var P = null;
      var Q = null;
      if (((ARight - ALeft) <= 0) || (rtl.length(AValues.get()) === 0)) return;
      do {
        I = ALeft;
        J = ARight;
        P = AValues.get()[ALeft + Math.floor((ARight - ALeft) / 2)];
        do {
          while (AComparer.Compare(AValues.get()[I],P) < 0) I += 1;
          while (AComparer.Compare(AValues.get()[J],P) > 0) J -= 1;
          if (I <= J) {
            if (I !== J) {
              Q = AValues.get()[I];
              AValues.get()[I] = AValues.get()[J];
              AValues.get()[J] = Q;
            };
            I += 1;
            J -= 1;
          };
        } while (!(I > J));
        if ((J - ALeft) < (ARight - I)) {
          if (ALeft < J) this.QuickSort(AValues,ALeft,J,AComparer);
          ALeft = I;
        } else {
          if (I < ARight) this.QuickSort(AValues,I,ARight,AComparer);
          ARight = J;
        };
      } while (!(ALeft >= ARight));
    };
    this.BinarySearch = function (AValues, AItem, ASearchResult, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var ilo = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      ilo = imid * imid;
      imid = ilo * imid;
      while (imin < imax) {
        imid = rtl.trunc((imax + imin) / 2);
        ASearchResult.CompareResult = AComparer.Compare(AValues[imid],AItem);
        if (ASearchResult.CompareResult < 0) {
          imin = imid + 1}
         else {
          if (ASearchResult.CompareResult === 0) {
            ASearchResult.FoundIndex = imid;
            ASearchResult.CandidateIndex = imid;
            return true;
          };
          imax = imid;
        };
      };
      Result = imax === imin;
      if (Result) {
        ASearchResult.CompareResult = AComparer.Compare(AValues[imin],AItem);
        ASearchResult.CandidateIndex = imin;
        Result = ASearchResult.CompareResult === 0;
        if (Result) {
          ASearchResult.FoundIndex = imin}
         else ASearchResult.FoundIndex = -1;
      } else {
        ASearchResult.CompareResult = 0;
        ASearchResult.FoundIndex = -1;
        ASearchResult.CandidateIndex = -1;
      };
      return Result;
    };
    this.BinarySearch$1 = function (AValues, AItem, AFoundIndex, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var LCompare = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      while (imin < imax) {
        imid = rtl.trunc((imin + imax) / 2);
        LCompare = AComparer.Compare(AValues[imid],AItem);
        if (LCompare < 0) {
          imin = imid + 1}
         else {
          if (LCompare === 0) {
            AFoundIndex.set(imid);
            return true;
          };
          imax = imid;
        };
      };
      LCompare = AComparer.Compare(AValues[imin],AItem);
      Result = (imax === imin) && (LCompare === 0);
      if (Result) {
        AFoundIndex.set(imin)}
       else AFoundIndex.set(-1);
      return Result;
    };
  },"TArrayHelper<WEBLib.TMSFNCDataGridRenderer.TTMSFNCDataGridCellControlWrapperListItem>");
  rtl.createClass(this,"TCustomList$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem",this.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $mod.$rtti.$DynArray("TCustomList<WEBLib.TMSFNCDataGridRenderer.TTMSFNCDataGridCellControlWrapperListItem>.FItems$a",{eltype: pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCellControlWrapperListItem"]});
    };
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem.$init.call(this);
      this.FOnNotify = null;
      this.FLength = 0;
      this.FItems = [];
    };
    this.$final = function () {
      this.FOnNotify = undefined;
      this.FItems = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem.$final.call(this);
    };
    this.GetCapacity = function () {
      var Result = 0;
      Result = rtl.length(this.FItems);
      return Result;
    };
    this.PrepareAddingItem = function () {
      var Result = 0;
      if (this.FLength === rtl.length(this.FItems)) this.FItems.push(null);
      Result = this.FLength;
      this.FLength += 1;
      return Result;
    };
    this.PrepareAddingRange = function (ACount) {
      var Result = 0;
      var l = 0;
      if (ACount < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (ACount === 0) return this.FLength - 1;
      for (var $l = rtl.length(this.FItems) + 1, $end = this.FLength + ACount; $l <= $end; $l++) {
        l = $l;
        this.FItems.push(null);
      };
      Result = this.FLength;
      this.FLength += ACount;
      return Result;
    };
    this.Notify = function (AValue, ACollectionNotification) {
      if (this.FOnNotify != null) this.FOnNotify(this,AValue,ACollectionNotification);
    };
    this.DoRemove = function (AIndex, ACollectionNotification) {
      var Result = null;
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      this.FLength -= 1;
      this.FItems[AIndex] = null;
      this.FItems.splice(AIndex,1);
      this.Notify(Result,ACollectionNotification);
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FLength;
      return Result;
    };
  },"TCustomList<WEBLib.TMSFNCDataGridRenderer.TTMSFNCDataGridCellControlWrapperListItem>");
  rtl.createClass(this,"TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem",this.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem,function () {
    this.$initSpec = function () {
    };
    this.$init = function () {
      $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem.$init.call(this);
      this.FList = null;
      this.FIndex = 0;
    };
    this.$final = function () {
      this.FList = undefined;
      $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem.$final.call(this);
    };
    this.DoMoveNext = function () {
      var Result = false;
      this.FIndex += 1;
      Result = (this.FList.FLength > 0) && (this.FIndex < this.FList.FLength);
      return Result;
    };
    this.DoGetCurrent = function () {
      var Result = null;
      Result = this.GetCurrent();
      return Result;
    };
    this.GetCurrent = function () {
      var Result = null;
      Result = this.FList.FItems[this.FIndex];
      return Result;
    };
    this.Create$1 = function (AList) {
      pas.System.TObject.Create.call(this);
      this.FIndex = -1;
      this.FList = AList;
      return this;
    };
  },"TCustomListEnumerator<WEBLib.TMSFNCDataGridRenderer.TTMSFNCDataGridCellControlWrapperListItem>");
  rtl.createClass(this,"TList$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem",this.TCustomList$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem,function () {
    this.$initSpec = function () {
      rtl.createClass(this,"TEnumerator",$mod.TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem,function () {
      },"TList<WEBLib.TMSFNCDataGridRenderer.TTMSFNCDataGridCellControlWrapperListItem>.TEnumerator");
    };
    this.$init = function () {
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem.$init.call(this);
      this.FComparer = null;
    };
    this.$final = function () {
      rtl.setIntfP(this,"FComparer",null);
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem.$final.call(this);
    };
    this.SameValue = function (Left, Right) {
      var Result = false;
      if (this.FComparer != null) {
        Result = this.FComparer.Compare(Left,Right) === 0}
       else Result = Left === Right;
      return Result;
    };
    this.SetCapacity = function (AValue) {
      if (AValue < this.FLength) this.SetCount(AValue);
      this.FItems = rtl.arraySetLength(this.FItems,null,AValue);
    };
    this.SetCount = function (AValue) {
      if (AValue < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (AValue > this.GetCapacity()) {
        this.SetCapacity(AValue)}
       else if (AValue < this.FLength) this.DeleteRange(AValue,this.FLength - AValue);
      this.FLength = AValue;
    };
    this.InitializeList = function () {
    };
    this.InternalInsert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.FItems.splice(AIndex,0,AValue);
      this.FLength += 1;
      this.FItems[AIndex] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.GetEnumerator$1();
      return Result;
    };
    this.GetItem = function (AIndex) {
      var Result = null;
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      return Result;
    };
    this.SetItem = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.Notify(this.FItems[AIndex],$mod.TCollectionNotification.cnRemoved);
      this.FItems[AIndex] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.Create$1 = function () {
      this.InitializeList();
      return this;
    };
    this.Create$2 = function (AComparer) {
      this.InitializeList();
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Create$3 = function (ACollection) {
      var LItem = null;
      this.Create$1();
      var $in = ACollection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LItem = $in.DoGetCurrent();
          this.Add(LItem);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Destroy = function () {
      this.SetCapacity(0);
    };
    this.Add = function (AValue) {
      var Result = 0;
      Result = this.PrepareAddingItem();
      this.FItems[Result] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
      return Result;
    };
    this.AddRange = function (AValues) {
      this.InsertRange(this.FLength,AValues);
    };
    this.AddRange$1 = function (AEnumerable) {
      var LValue = null;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.Add(LValue);
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.AddRange$2 = function (AEnumerable) {
      var LValue = null;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.Add(LValue);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Insert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.InternalInsert(AIndex,AValue);
    };
    this.InsertRange = function (AIndex, AValues) {
      var LLength = 0;
      var i = 0;
      var LValue = null;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LLength = rtl.length(AValues);
      if (LLength === 0) return;
      if (AIndex !== this.PrepareAddingRange(LLength)) {
        for (var $l = AIndex, $end = this.FLength - LLength - 1; $l <= $end; $l++) {
          i = $l;
          this.FItems[i + LLength] = this.FItems[i];
        };
        for (var $l1 = 0, $end1 = LLength - 1; $l1 <= $end1; $l1++) {
          i = $l1;
          this.FItems[AIndex + i] = null;
        };
      };
      for (var $l2 = 0, $end2 = LLength - 1; $l2 <= $end2; $l2++) {
        i = $l2;
        LValue = AValues[i];
        this.FItems[i + AIndex] = LValue;
        this.Notify(LValue,$mod.TCollectionNotification.cnAdded);
      };
    };
    this.InsertRange$1 = function (AIndex, AEnumerable) {
      var LValue = null;
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.InsertRange$2 = function (AIndex, AEnumerable) {
      var LValue = null;
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Remove = function (AValue) {
      var Result = 0;
      Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.RemoveItem = function (AValue, Direction) {
      var Result = 0;
      if (Direction === $mod.TDirection.fromEnd) {
        Result = this.LastIndexOf(AValue)}
       else Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.Delete = function (AIndex) {
      this.DoRemove(AIndex,$mod.TCollectionNotification.cnRemoved);
    };
    this.DeleteRange = function (AIndex, ACount) {
      var LDeleted = [];
      var i = 0;
      if (ACount === 0) return;
      if ((ACount < 0) || (AIndex < 0) || ((AIndex + ACount) > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LDeleted = this.FItems.splice(AIndex,this.FLength);
      this.FLength -= ACount;
      for (var $l = 0, $end = rtl.length(LDeleted) - 1; $l <= $end; $l++) {
        i = $l;
        this.Notify(LDeleted[i],$mod.TCollectionNotification.cnRemoved);
      };
    };
    this.ExtractIndex = function (AIndex) {
      var Result = null;
      Result = this.DoRemove(AIndex,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.Extract = function (AValue) {
      var Result = null;
      var LIndex = 0;
      LIndex = this.IndexOf(AValue);
      if (LIndex < 0) {
        Result = null}
       else Result = this.DoRemove(LIndex,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.Exchange = function (AIndex1, AIndex2) {
      var LTemp = null;
      LTemp = this.FItems[AIndex1];
      this.FItems[AIndex1] = this.FItems[AIndex2];
      this.FItems[AIndex2] = LTemp;
    };
    this.Move = function (AIndex, ANewIndex) {
      var Arr = null;
      var LTemp = undefined;
      var i = 0;
      if (ANewIndex === AIndex) return;
      if ((ANewIndex < 0) || (ANewIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Arr = this.FItems;
      LTemp = Arr[AIndex];
      if (AIndex < ANewIndex) {
        for (var $l = AIndex, $end = ANewIndex - 1; $l <= $end; $l++) {
          i = $l;
          Arr[i] = Arr[i + 1];
        }}
       else for (var $l1 = AIndex, $end1 = ANewIndex + 1; $l1 >= $end1; $l1--) {
        i = $l1;
        Arr[i] = Arr[i - 1];
      };
      Arr[ANewIndex] = LTemp;
    };
    this.First = function () {
      var Result = null;
      Result = this.GetItem(0);
      return Result;
    };
    this.Last = function () {
      var Result = null;
      Result = this.GetItem(this.FLength - 1);
      return Result;
    };
    this.Clear = function () {
      this.SetCount(0);
      this.SetCapacity(0);
    };
    this.Contains = function (AValue) {
      var Result = false;
      Result = this.IndexOf(AValue) >= 0;
      return Result;
    };
    this.IndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = 0, $end = this.FLength - 1; $l <= $end; $l++) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.LastIndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = this.FLength - 1; $l >= 0; $l--) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.Reverse = function () {
      var a = 0;
      var b = 0;
      var LTemp = null;
      a = 0;
      b = this.FLength - 1;
      while (a < b) {
        LTemp = this.FItems[a];
        this.FItems[a] = this.FItems[b];
        this.FItems[b] = LTemp;
        a += 1;
        b -= 1;
      };
    };
    this.TrimExcess = function () {
      this.SetCapacity(this.FLength);
    };
    this.Sort = function () {
      $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},this.FComparer,0,this.FLength);
    };
    this.Sort$1 = function (AComparer) {
      $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},AComparer,0,this.FLength);
    };
    this.BinarySearch = function (AItem, AIndex) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem.BinarySearch$1(this.FItems,AItem,AIndex,this.FComparer,0,this.FLength);
      return Result;
    };
    this.BinarySearch$1 = function (AItem, AIndex, AComparer) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem.BinarySearch$1(this.FItems,AItem,AIndex,AComparer,0,this.FLength);
      return Result;
    };
  },"TList<WEBLib.TMSFNCDataGridRenderer.TTMSFNCDataGridCellControlWrapperListItem>");
  rtl.createClass(this,"TObjectList$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem",this.TList$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem,function () {
    this.$initSpec = function () {
    };
    this.$init = function () {
      $mod.TList$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem.$init.call(this);
      this.FObjectsOwner = false;
    };
    this.Notify = function (aValue, Action) {
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem.Notify.call(this,aValue,Action);
      if (this.FObjectsOwner && (Action === $mod.TCollectionNotification.cnRemoved)) aValue = rtl.freeLoc(aValue);
    };
    this.Create$4 = function (aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem.Create$1.call(this);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
    this.Create$5 = function (AComparer, aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem.Create$2.call(this,AComparer);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
    this.Create$6 = function (aCollection, aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem.Create$3.call(this,aCollection);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
  },"TObjectList<WEBLib.TMSFNCDataGridRenderer.TTMSFNCDataGridCellControlWrapperListItem>");
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<WEBLib.TMSFNCDataGrid.TTMSFNCDataGridHeaderGroup>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push(LEnumerator.DoGetCurrent());
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<WEBLib.TMSFNCDataGrid.TTMSFNCDataGridHeaderGroup>");
  this.$rtti.$MethodVar("TCollectionNotifyEvent<WEBLib.TMSFNCDataGrid.TTMSFNCDataGridHeaderGroup>",{init: function () {
      this.procsig = rtl.newTIProcSig([["ASender",pas.System.$rtti["TObject"]],["AItem",pas["WEBLib.TMSFNCDataGrid"].$rtti["TTMSFNCDataGridHeaderGroup"],2],["AAction",$mod.$rtti["TCollectionNotification"]]]);
    }, methodkind: 0});
  rtl.createClass(this,"TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup",pas.System.TObject,function () {
    this.$initSpec = function () {
    };
    this.Sort = function (AValues, AComparer) {
      this.Sort$1(AValues,AComparer,0,rtl.length(AValues.get()));
    };
    this.Sort$1 = function (AValues, AComparer, AIndex, ACount) {
      if (ACount <= 1) return;
      this.QuickSort(AValues,AIndex,(AIndex + ACount) - 1,AComparer);
    };
    this.BinarySearch$2 = function (AValues, AItem, AFoundIndex, AComparer) {
      var Result = false;
      Result = this.BinarySearch$1(AValues,AItem,AFoundIndex,AComparer,0,rtl.length(AValues));
      return Result;
    };
    this.BinarySearch$3 = function (AValues, AItem, ASearchResult, AComparer) {
      var Result = false;
      Result = this.BinarySearch(AValues,AItem,ASearchResult,AComparer,0,rtl.length(AValues));
      return Result;
    };
  },"TCustomArrayHelper<WEBLib.TMSFNCDataGrid.TTMSFNCDataGridHeaderGroup>");
  rtl.createClass(this,"TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup",this.TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup,function () {
    this.$initSpec = function () {
    };
    this.QuickSort = function (AValues, ALeft, ARight, AComparer) {
      var I = 0;
      var J = 0;
      var P = null;
      var Q = null;
      if (((ARight - ALeft) <= 0) || (rtl.length(AValues.get()) === 0)) return;
      do {
        I = ALeft;
        J = ARight;
        P = AValues.get()[ALeft + Math.floor((ARight - ALeft) / 2)];
        do {
          while (AComparer.Compare(AValues.get()[I],P) < 0) I += 1;
          while (AComparer.Compare(AValues.get()[J],P) > 0) J -= 1;
          if (I <= J) {
            if (I !== J) {
              Q = AValues.get()[I];
              AValues.get()[I] = AValues.get()[J];
              AValues.get()[J] = Q;
            };
            I += 1;
            J -= 1;
          };
        } while (!(I > J));
        if ((J - ALeft) < (ARight - I)) {
          if (ALeft < J) this.QuickSort(AValues,ALeft,J,AComparer);
          ALeft = I;
        } else {
          if (I < ARight) this.QuickSort(AValues,I,ARight,AComparer);
          ARight = J;
        };
      } while (!(ALeft >= ARight));
    };
    this.BinarySearch = function (AValues, AItem, ASearchResult, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var ilo = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      ilo = imid * imid;
      imid = ilo * imid;
      while (imin < imax) {
        imid = rtl.trunc((imax + imin) / 2);
        ASearchResult.CompareResult = AComparer.Compare(AValues[imid],AItem);
        if (ASearchResult.CompareResult < 0) {
          imin = imid + 1}
         else {
          if (ASearchResult.CompareResult === 0) {
            ASearchResult.FoundIndex = imid;
            ASearchResult.CandidateIndex = imid;
            return true;
          };
          imax = imid;
        };
      };
      Result = imax === imin;
      if (Result) {
        ASearchResult.CompareResult = AComparer.Compare(AValues[imin],AItem);
        ASearchResult.CandidateIndex = imin;
        Result = ASearchResult.CompareResult === 0;
        if (Result) {
          ASearchResult.FoundIndex = imin}
         else ASearchResult.FoundIndex = -1;
      } else {
        ASearchResult.CompareResult = 0;
        ASearchResult.FoundIndex = -1;
        ASearchResult.CandidateIndex = -1;
      };
      return Result;
    };
    this.BinarySearch$1 = function (AValues, AItem, AFoundIndex, AComparer, AIndex, ACount) {
      var Result = false;
      var imin = 0;
      var imax = 0;
      var imid = 0;
      var LCompare = 0;
      imin = AIndex;
      imax = (AIndex + ACount) - 1;
      while (imin < imax) {
        imid = rtl.trunc((imin + imax) / 2);
        LCompare = AComparer.Compare(AValues[imid],AItem);
        if (LCompare < 0) {
          imin = imid + 1}
         else {
          if (LCompare === 0) {
            AFoundIndex.set(imid);
            return true;
          };
          imax = imid;
        };
      };
      LCompare = AComparer.Compare(AValues[imin],AItem);
      Result = (imax === imin) && (LCompare === 0);
      if (Result) {
        AFoundIndex.set(imin)}
       else AFoundIndex.set(-1);
      return Result;
    };
  },"TArrayHelper<WEBLib.TMSFNCDataGrid.TTMSFNCDataGridHeaderGroup>");
  rtl.createClass(this,"TCustomList$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup",this.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup,function () {
    this.$initSpec = function () {
      var $r = this.$rtti;
      $mod.$rtti.$DynArray("TCustomList<WEBLib.TMSFNCDataGrid.TTMSFNCDataGridHeaderGroup>.FItems$a",{eltype: pas["WEBLib.TMSFNCDataGrid"].$rtti["TTMSFNCDataGridHeaderGroup"]});
    };
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup.$init.call(this);
      this.FOnNotify = null;
      this.FLength = 0;
      this.FItems = [];
    };
    this.$final = function () {
      this.FOnNotify = undefined;
      this.FItems = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup.$final.call(this);
    };
    this.GetCapacity = function () {
      var Result = 0;
      Result = rtl.length(this.FItems);
      return Result;
    };
    this.PrepareAddingItem = function () {
      var Result = 0;
      if (this.FLength === rtl.length(this.FItems)) this.FItems.push(null);
      Result = this.FLength;
      this.FLength += 1;
      return Result;
    };
    this.PrepareAddingRange = function (ACount) {
      var Result = 0;
      var l = 0;
      if (ACount < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (ACount === 0) return this.FLength - 1;
      for (var $l = rtl.length(this.FItems) + 1, $end = this.FLength + ACount; $l <= $end; $l++) {
        l = $l;
        this.FItems.push(null);
      };
      Result = this.FLength;
      this.FLength += ACount;
      return Result;
    };
    this.Notify = function (AValue, ACollectionNotification) {
      if (this.FOnNotify != null) this.FOnNotify(this,AValue,ACollectionNotification);
    };
    this.DoRemove = function (AIndex, ACollectionNotification) {
      var Result = null;
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      this.FLength -= 1;
      this.FItems[AIndex] = null;
      this.FItems.splice(AIndex,1);
      this.Notify(Result,ACollectionNotification);
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FLength;
      return Result;
    };
  },"TCustomList<WEBLib.TMSFNCDataGrid.TTMSFNCDataGridHeaderGroup>");
  rtl.createClass(this,"TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup",this.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup,function () {
    this.$initSpec = function () {
    };
    this.$init = function () {
      $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup.$init.call(this);
      this.FList = null;
      this.FIndex = 0;
    };
    this.$final = function () {
      this.FList = undefined;
      $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup.$final.call(this);
    };
    this.DoMoveNext = function () {
      var Result = false;
      this.FIndex += 1;
      Result = (this.FList.FLength > 0) && (this.FIndex < this.FList.FLength);
      return Result;
    };
    this.DoGetCurrent = function () {
      var Result = null;
      Result = this.GetCurrent();
      return Result;
    };
    this.GetCurrent = function () {
      var Result = null;
      Result = this.FList.FItems[this.FIndex];
      return Result;
    };
    this.Create$1 = function (AList) {
      pas.System.TObject.Create.call(this);
      this.FIndex = -1;
      this.FList = AList;
      return this;
    };
  },"TCustomListEnumerator<WEBLib.TMSFNCDataGrid.TTMSFNCDataGridHeaderGroup>");
  rtl.createClass(this,"TList$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup",this.TCustomList$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup,function () {
    this.$initSpec = function () {
      rtl.createClass(this,"TEnumerator",$mod.TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup,function () {
      },"TList<WEBLib.TMSFNCDataGrid.TTMSFNCDataGridHeaderGroup>.TEnumerator");
    };
    this.$init = function () {
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup.$init.call(this);
      this.FComparer = null;
    };
    this.$final = function () {
      rtl.setIntfP(this,"FComparer",null);
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup.$final.call(this);
    };
    this.SameValue = function (Left, Right) {
      var Result = false;
      if (this.FComparer != null) {
        Result = this.FComparer.Compare(Left,Right) === 0}
       else Result = Left === Right;
      return Result;
    };
    this.SetCapacity = function (AValue) {
      if (AValue < this.FLength) this.SetCount(AValue);
      this.FItems = rtl.arraySetLength(this.FItems,null,AValue);
    };
    this.SetCount = function (AValue) {
      if (AValue < 0) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      if (AValue > this.GetCapacity()) {
        this.SetCapacity(AValue)}
       else if (AValue < this.FLength) this.DeleteRange(AValue,this.FLength - AValue);
      this.FLength = AValue;
    };
    this.InitializeList = function () {
    };
    this.InternalInsert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.FItems.splice(AIndex,0,AValue);
      this.FLength += 1;
      this.FItems[AIndex] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.GetEnumerator$1();
      return Result;
    };
    this.GetItem = function (AIndex) {
      var Result = null;
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Result = this.FItems[AIndex];
      return Result;
    };
    this.SetItem = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.Notify(this.FItems[AIndex],$mod.TCollectionNotification.cnRemoved);
      this.FItems[AIndex] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.Create$1 = function () {
      this.InitializeList();
      return this;
    };
    this.Create$2 = function (AComparer) {
      this.InitializeList();
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Create$3 = function (ACollection) {
      var LItem = null;
      this.Create$1();
      var $in = ACollection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LItem = $in.DoGetCurrent();
          this.Add(LItem);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Destroy = function () {
      this.SetCapacity(0);
    };
    this.Add = function (AValue) {
      var Result = 0;
      Result = this.PrepareAddingItem();
      this.FItems[Result] = AValue;
      this.Notify(AValue,$mod.TCollectionNotification.cnAdded);
      return Result;
    };
    this.AddRange = function (AValues) {
      this.InsertRange(this.FLength,AValues);
    };
    this.AddRange$1 = function (AEnumerable) {
      var LValue = null;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.Add(LValue);
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.AddRange$2 = function (AEnumerable) {
      var LValue = null;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.Add(LValue);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Insert = function (AIndex, AValue) {
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      this.InternalInsert(AIndex,AValue);
    };
    this.InsertRange = function (AIndex, AValues) {
      var LLength = 0;
      var i = 0;
      var LValue = null;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LLength = rtl.length(AValues);
      if (LLength === 0) return;
      if (AIndex !== this.PrepareAddingRange(LLength)) {
        for (var $l = AIndex, $end = this.FLength - LLength - 1; $l <= $end; $l++) {
          i = $l;
          this.FItems[i + LLength] = this.FItems[i];
        };
        for (var $l1 = 0, $end1 = LLength - 1; $l1 <= $end1; $l1++) {
          i = $l1;
          this.FItems[AIndex + i] = null;
        };
      };
      for (var $l2 = 0, $end2 = LLength - 1; $l2 <= $end2; $l2++) {
        i = $l2;
        LValue = AValues[i];
        this.FItems[i + AIndex] = LValue;
        this.Notify(LValue,$mod.TCollectionNotification.cnAdded);
      };
    };
    this.InsertRange$1 = function (AIndex, AEnumerable) {
      var LValue = null;
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.GetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        rtl._Release($in)
      };
    };
    this.InsertRange$2 = function (AIndex, AEnumerable) {
      var LValue = null;
      var i = 0;
      if ((AIndex < 0) || (AIndex > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      i = 0;
      var $in = AEnumerable.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          LValue = $in.DoGetCurrent();
          this.InternalInsert(AIndex + i,LValue);
          i += 1;
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Remove = function (AValue) {
      var Result = 0;
      Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.RemoveItem = function (AValue, Direction) {
      var Result = 0;
      if (Direction === $mod.TDirection.fromEnd) {
        Result = this.LastIndexOf(AValue)}
       else Result = this.IndexOf(AValue);
      if (Result >= 0) this.DoRemove(Result,$mod.TCollectionNotification.cnRemoved);
      return Result;
    };
    this.Delete = function (AIndex) {
      this.DoRemove(AIndex,$mod.TCollectionNotification.cnRemoved);
    };
    this.DeleteRange = function (AIndex, ACount) {
      var LDeleted = [];
      var i = 0;
      if (ACount === 0) return;
      if ((ACount < 0) || (AIndex < 0) || ((AIndex + ACount) > this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      LDeleted = this.FItems.splice(AIndex,this.FLength);
      this.FLength -= ACount;
      for (var $l = 0, $end = rtl.length(LDeleted) - 1; $l <= $end; $l++) {
        i = $l;
        this.Notify(LDeleted[i],$mod.TCollectionNotification.cnRemoved);
      };
    };
    this.ExtractIndex = function (AIndex) {
      var Result = null;
      Result = this.DoRemove(AIndex,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.Extract = function (AValue) {
      var Result = null;
      var LIndex = 0;
      LIndex = this.IndexOf(AValue);
      if (LIndex < 0) {
        Result = null}
       else Result = this.DoRemove(LIndex,$mod.TCollectionNotification.cnExtracted);
      return Result;
    };
    this.Exchange = function (AIndex1, AIndex2) {
      var LTemp = null;
      LTemp = this.FItems[AIndex1];
      this.FItems[AIndex1] = this.FItems[AIndex2];
      this.FItems[AIndex2] = LTemp;
    };
    this.Move = function (AIndex, ANewIndex) {
      var Arr = null;
      var LTemp = undefined;
      var i = 0;
      if (ANewIndex === AIndex) return;
      if ((ANewIndex < 0) || (ANewIndex >= this.FLength)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr(pas["Generics.Strings"],"SArgumentOutOfRange")]);
      Arr = this.FItems;
      LTemp = Arr[AIndex];
      if (AIndex < ANewIndex) {
        for (var $l = AIndex, $end = ANewIndex - 1; $l <= $end; $l++) {
          i = $l;
          Arr[i] = Arr[i + 1];
        }}
       else for (var $l1 = AIndex, $end1 = ANewIndex + 1; $l1 >= $end1; $l1--) {
        i = $l1;
        Arr[i] = Arr[i - 1];
      };
      Arr[ANewIndex] = LTemp;
    };
    this.First = function () {
      var Result = null;
      Result = this.GetItem(0);
      return Result;
    };
    this.Last = function () {
      var Result = null;
      Result = this.GetItem(this.FLength - 1);
      return Result;
    };
    this.Clear = function () {
      this.SetCount(0);
      this.SetCapacity(0);
    };
    this.Contains = function (AValue) {
      var Result = false;
      Result = this.IndexOf(AValue) >= 0;
      return Result;
    };
    this.IndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = 0, $end = this.FLength - 1; $l <= $end; $l++) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.LastIndexOf = function (AValue) {
      var Result = 0;
      var i = 0;
      for (var $l = this.FLength - 1; $l >= 0; $l--) {
        i = $l;
        if (this.SameValue(AValue,this.FItems[i])) return i;
      };
      Result = -1;
      return Result;
    };
    this.Reverse = function () {
      var a = 0;
      var b = 0;
      var LTemp = null;
      a = 0;
      b = this.FLength - 1;
      while (a < b) {
        LTemp = this.FItems[a];
        this.FItems[a] = this.FItems[b];
        this.FItems[b] = LTemp;
        a += 1;
        b -= 1;
      };
    };
    this.TrimExcess = function () {
      this.SetCapacity(this.FLength);
    };
    this.Sort = function () {
      $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},this.FComparer,0,this.FLength);
    };
    this.Sort$1 = function (AComparer) {
      $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup.Sort$1({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }},AComparer,0,this.FLength);
    };
    this.BinarySearch = function (AItem, AIndex) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup.BinarySearch$1(this.FItems,AItem,AIndex,this.FComparer,0,this.FLength);
      return Result;
    };
    this.BinarySearch$1 = function (AItem, AIndex, AComparer) {
      var Result = false;
      Result = $mod.TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup.BinarySearch$1(this.FItems,AItem,AIndex,AComparer,0,this.FLength);
      return Result;
    };
  },"TList<WEBLib.TMSFNCDataGrid.TTMSFNCDataGridHeaderGroup>");
  rtl.createClass(this,"TObjectList$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup",this.TList$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup,function () {
    this.$initSpec = function () {
    };
    this.$init = function () {
      $mod.TList$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup.$init.call(this);
      this.FObjectsOwner = false;
    };
    this.Notify = function (aValue, Action) {
      $mod.TCustomList$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup.Notify.call(this,aValue,Action);
      if (this.FObjectsOwner && (Action === $mod.TCollectionNotification.cnRemoved)) aValue = rtl.freeLoc(aValue);
    };
    this.Create$4 = function (aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup.Create$1.call(this);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
    this.Create$5 = function (AComparer, aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup.Create$2.call(this,AComparer);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
    this.Create$6 = function (aCollection, aOwnsObjects) {
      $mod.TList$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup.Create$3.call(this,aCollection);
      this.FObjectsOwner = aOwnsObjects;
      return this;
    };
  },"TObjectList<WEBLib.TMSFNCDataGrid.TTMSFNCDataGridHeaderGroup>");
  rtl.recNewT(this,"TPair$$$G$$generics$collections$$Longint$$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$",function () {
    this.Key = 0;
    this.Value = null;
    this.$eq = function (b) {
      return (this.Key === b.Key) && (this.Value === b.Value);
    };
    this.$assign = function (s) {
      this.Key = s.Key;
      this.Value = s.Value;
      return this;
    };
    this.Create = function (AKey, AValue) {
      this.Key = AKey;
      this.Value = AValue;
      return this;
    };
    var $r = $mod.$rtti.$Record("TPair<System.Longint,Generics.Collections.TObjectList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>>",{},this);
    $r.addField("Key",rtl.longint);
    $r.addField("Value",$mod.$rtti["TObjectList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>"]);
    $r.addMethod("Create",2,[["AKey",rtl.longint,2],["AValue",$mod.$rtti["TObjectList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>"],2]]);
  });
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TPair$System$Longint$Generics$Collections$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$$",pas.System.TObject,function () {
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<Generics.Collections.TPair<System.Longint,Generics.Collections.TObjectList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>>>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TPair$System$Longint$Generics$Collections$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$$",pas.System.TObject,function () {
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push($mod.TPair$$$G$$generics$collections$$Longint$$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$.$clone(LEnumerator.DoGetCurrent()));
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<Generics.Collections.TPair<System.Longint,Generics.Collections.TObjectList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>>>");
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$",pas.System.TObject,function () {
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<Generics.Collections.TObjectList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$",pas.System.TObject,function () {
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push(LEnumerator.DoGetCurrent());
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<Generics.Collections.TObjectList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>>");
  this.$rtti.$MethodVar("TCollectionNotifyEvent<Generics.Collections.TObjectList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>>",{procsig: rtl.newTIProcSig([["ASender",pas.System.$rtti["TObject"]],["AItem",this.$rtti["TObjectList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>"],2],["AAction",this.$rtti["TCollectionNotification"]]]), methodkind: 0});
  rtl.createClass(this,"TDictionary$$$G$$generics$collections$$Longint$$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$",this.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$Generics$Collections$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$$,function () {
    rtl.createClass(this,"TPairEnumerator",$mod.TEnumerator$$$G$$generics$collections$$TPair$System$Longint$Generics$Collections$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$$,function () {
      this.$init = function () {
        $mod.TEnumerator$$$G$$generics$collections$$TPair$System$Longint$Generics$Collections$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$$.$init.call(this);
        this.FIter = null;
        this.FVal = null;
      };
      this.$final = function () {
        this.FIter = undefined;
        this.FVal = undefined;
        $mod.TEnumerator$$$G$$generics$collections$$TPair$System$Longint$Generics$Collections$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$$.$final.call(this);
      };
      this.GetCurrent = function () {
        var Result = $mod.TPair$$$G$$generics$collections$$Longint$$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$.$new();
        Result.$assign(this.DoGetCurrent());
        return Result;
      };
      this.DoGetCurrent = function () {
        var Result = $mod.TPair$$$G$$generics$collections$$Longint$$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$.$new();
        var A = [];
        A = this.FVal.value;
        Result.$assign($mod.TPair$$$G$$generics$collections$$Longint$$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$.$new());
        Result.Create(rtl.trunc(A[0]),rtl.getObject(A[1]));
        return Result;
      };
      this.DoMoveNext = function () {
        var Result = false;
        this.FVal = this.FIter.next();
        Result = !this.FVal.done;
        return Result;
      };
      this.Create$1 = function (ADictionary) {
        this.FIter = ADictionary.FMap.entries();
        return this;
      };
      this.MoveNext$1 = function () {
        var Result = false;
        Result = this.DoMoveNext();
        return Result;
      };
    },"TDictionary<System.Longint,Generics.Collections.TObjectList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>>.TPairEnumerator");
    rtl.createClass(this,"TKeyEnumerator",$mod.TEnumerator$$$G$$generics$collections$$Longint,function () {
      this.$init = function () {
        $mod.TEnumerator$$$G$$generics$collections$$Longint.$init.call(this);
        this.FIter = null;
        this.FVal = null;
      };
      this.$final = function () {
        this.FIter = undefined;
        this.FVal = undefined;
        $mod.TEnumerator$$$G$$generics$collections$$Longint.$final.call(this);
      };
      this.GetCurrent = function () {
        var Result = 0;
        Result = this.DoGetCurrent();
        return Result;
      };
      this.DoGetCurrent = function () {
        var Result = 0;
        Result = rtl.trunc(this.FVal.value);
        return Result;
      };
      this.DoMoveNext = function () {
        var Result = false;
        this.FVal = this.FIter.next();
        Result = !this.FVal.done;
        return Result;
      };
      this.Create$1 = function (AIter) {
        this.FIter = AIter;
        return this;
      };
      this.Create$2 = function (ADictionary) {
        this.Create$1(ADictionary.FMap.keys());
        return this;
      };
      this.MoveNext$1 = function () {
        var Result = false;
        Result = this.DoMoveNext();
        return Result;
      };
    },"TDictionary<System.Longint,Generics.Collections.TObjectList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>>.TKeyEnumerator");
    rtl.createClass(this,"TValueEnumerator",$mod.TEnumerator$$$G$$generics$collections$$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$,function () {
      this.$init = function () {
        $mod.TEnumerator$$$G$$generics$collections$$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$.$init.call(this);
        this.FIter = null;
        this.FVal = null;
      };
      this.$final = function () {
        this.FIter = undefined;
        this.FVal = undefined;
        $mod.TEnumerator$$$G$$generics$collections$$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$.$final.call(this);
      };
      this.GetCurrent = function () {
        var Result = null;
        Result = this.DoGetCurrent();
        return Result;
      };
      this.DoGetCurrent = function () {
        var Result = null;
        Result = rtl.getObject(this.FVal.value);
        return Result;
      };
      this.DoMoveNext = function () {
        var Result = false;
        this.FVal = this.FIter.next();
        Result = !this.FVal.done;
        return Result;
      };
      this.Create$1 = function (AIter) {
        this.FIter = AIter;
        return this;
      };
      this.Create$2 = function (ADictionary) {
        this.Create$1(ADictionary.FMap.values());
        return this;
      };
      this.MoveNext$1 = function () {
        var Result = false;
        Result = this.DoMoveNext();
        return Result;
      };
    },"TDictionary<System.Longint,Generics.Collections.TObjectList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>>.TValueEnumerator");
    rtl.createClass(this,"TValueCollection",$mod.TEnumerable$$$G$$generics$collections$$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$,function () {
      this.$init = function () {
        $mod.TEnumerable$$$G$$generics$collections$$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$.$init.call(this);
        this.FMap = null;
      };
      this.$final = function () {
        this.FMap = undefined;
        $mod.TEnumerable$$$G$$generics$collections$$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$.$final.call(this);
      };
      this.GetCount = function () {
        var Result = 0;
        Result = this.FMap.size;
        return Result;
      };
      this.DoGetEnumerator = function () {
        var Result = null;
        Result = $mod.TDictionary$$$G$$generics$collections$$Longint$$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$.TValueEnumerator.$create("Create$1",[this.FMap.values()]);
        return Result;
      };
      this.Create$1 = function (ADictionary) {
        this.FMap = ADictionary.FMap;
        return this;
      };
      this.GetEnumerator$1 = function () {
        var Result = null;
        Result = this.DoGetEnumerator();
        return Result;
      };
      this.ToArray = function () {
        var Result = [];
        var I = 0;
        var P = null;
        Result = rtl.arraySetLength(Result,null,this.FMap.size);
        var $in = this.GetEnumerator$1();
        try {
          while ($in.MoveNext$1()) {
            P = $in.GetCurrent();
            Result[I] = P;
            I += 1;
          }
        } finally {
          $in = rtl.freeLoc($in)
        };
        return Result;
      };
    },"TDictionary<System.Longint,Generics.Collections.TObjectList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>>.TValueCollection");
    rtl.createClass(this,"TKeyCollection",$mod.TEnumerable$$$G$$generics$collections$$Longint,function () {
      this.$init = function () {
        $mod.TEnumerable$$$G$$generics$collections$$Longint.$init.call(this);
        this.FMap = null;
      };
      this.$final = function () {
        this.FMap = undefined;
        $mod.TEnumerable$$$G$$generics$collections$$Longint.$final.call(this);
      };
      this.GetCount = function () {
        var Result = 0;
        Result = this.FMap.size;
        return Result;
      };
      this.DoGetEnumerator = function () {
        var Result = null;
        Result = this.GetEnumerator$1();
        return Result;
      };
      this.Create$1 = function (ADictionary) {
        this.FMap = ADictionary.FMap;
        return this;
      };
      this.GetEnumerator$1 = function () {
        var Result = null;
        Result = $mod.TDictionary$$$G$$generics$collections$$Longint$$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$.TKeyEnumerator.$create("Create$1",[this.FMap.keys()]);
        return Result;
      };
      this.ToArray = function () {
        var Result = [];
        Result = $mod.TEnumerable$$$G$$generics$collections$$Longint.ToArray.call(this);
        return Result;
      };
    },"TDictionary<System.Longint,Generics.Collections.TObjectList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>>.TKeyCollection");
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$Generics$Collections$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$$.$init.call(this);
      this.FMap = null;
      this.FComparer = null;
      this.FOnKeyNotify = null;
      this.FOnValueNotify = null;
      this.FKeyCollection = null;
      this.FValueCollection = null;
    };
    this.$final = function () {
      this.FMap = undefined;
      rtl.setIntfP(this,"FComparer",null);
      this.FOnKeyNotify = undefined;
      this.FOnValueNotify = undefined;
      this.FKeyCollection = undefined;
      this.FValueCollection = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$Generics$Collections$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$$.$final.call(this);
    };
    this.GetEffectiveKey = function (Key) {
      var Result = 0;
      var it = null;
      var v = null;
      if (!(this.FComparer != null)) return Key;
      it = this.FMap.keys();
      v = it.next();
      while (!v.done) {
        Result = rtl.trunc(v.value);
        if (this.FComparer.Compare(Result,Key) === 0) return Result;
        v = it.next();
      };
      Result = Key;
      return Result;
    };
    this.GetItem = function (Key) {
      var Result = null;
      var V = undefined;
      V = this.FMap.get(this.GetEffectiveKey(Key));
      if (pas.JS.isUndefined(V)) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictKeyNotFound")]);
      Result = rtl.getObject(V);
      return Result;
    };
    this.SetItem = function (Key, Value) {
      var V = undefined;
      V = this.FMap.get(this.GetEffectiveKey(Key));
      if (!pas.JS.isUndefined(V)) this.ValueNotify(rtl.getObject(V),$mod.TCollectionNotification.cnRemoved);
      this.FMap.set(Key,Value);
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoAdd = function (Key, Value) {
      this.FMap.set(this.GetEffectiveKey(Key),Value);
      this.KeyNotify(Key,$mod.TCollectionNotification.cnAdded);
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoRemove = function (Key, Notification) {
      var Result = null;
      var V = undefined;
      var K = 0;
      K = this.GetEffectiveKey(Key);
      V = this.FMap.get(K);
      if (!pas.JS.isUndefined(V)) {
        this.FMap.delete(K);
        Result = rtl.getObject(V);
        this.KeyNotify(Key,Notification);
        this.ValueNotify(Result,Notification);
      };
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FMap.size;
      return Result;
    };
    this.CanClearMap = function () {
      var Result = false;
      Result = (this.FOnKeyNotify === null) && (this.FOnValueNotify === null);
      return Result;
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.PairNotify = function (Key, Value, Action) {
      this.KeyNotify(Key,Action);
      this.ValueNotify(Value,Action);
    };
    this.KeyNotify = function (Key, Action) {
      if (this.FOnKeyNotify != null) this.FOnKeyNotify(this,Key,Action);
    };
    this.ValueNotify = function (Value, Action) {
      if (this.FOnValueNotify != null) this.FOnValueNotify(this,Value,Action);
    };
    this.Create$1 = function (ACapacity) {
      this.FMap = new Map();
      if (ACapacity > 0) ;
      return this;
    };
    this.Create$2 = function (Collection) {
      var aPair = $mod.TPair$$$G$$generics$collections$$Longint$$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$.$new();
      this.Create$1(0);
      var $in = Collection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          aPair = $in.DoGetCurrent();
          this.Add(aPair.Key,aPair.Value);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Create$3 = function (AComparer) {
      this.Create$1(0);
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FKeyCollection;
        }, set: function (v) {
          this.p.FKeyCollection = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FValueCollection;
        }, set: function (v) {
          this.p.FValueCollection = v;
        }});
      this.Clear();
      this.FMap = null;
      pas.System.TObject.Destroy.call(this);
    };
    this.Add = function (Key, Value) {
      if (this.FMap.has(this.GetEffectiveKey(Key))) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictDuplicateKey")]);
      this.DoAdd(Key,Value);
    };
    this.Remove = function (Key) {
      this.DoRemove(Key,$mod.TCollectionNotification.cnRemoved);
    };
    this.ExtractPair = function (Key) {
      var Result = $mod.TPair$$$G$$generics$collections$$Longint$$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$.$new();
      var K = 0;
      Result.$assign($mod.TPair$$$G$$generics$collections$$Longint$$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$.$new());
      K = this.GetEffectiveKey(Key);
      if (this.FMap.has(K)) {
        Result.Create(Key,rtl.getObject(this.FMap.get(K)));
        this.FMap.delete(K);
      } else Result.Create(Key,null);
      return Result;
    };
    this.Clear = function () {
      var Iter = null;
      var IVal = null;
      var A = [];
      var K = 0;
      var V = null;
      if (this.CanClearMap()) {
        this.FMap.clear()}
       else {
        Iter = this.FMap.entries();
        do {
          IVal = Iter.next();
          if (!IVal.done) {
            A = IVal.value;
            K = rtl.trunc(A[0]);
            V = rtl.getObject(A[1]);
            this.FMap.delete(K);
            this.PairNotify(K,V,$mod.TCollectionNotification.cnRemoved);
          };
        } while (!IVal.done);
      };
    };
    this.TryGetValue = function (Key, Value) {
      var Result = false;
      var K = 0;
      K = this.GetEffectiveKey(Key);
      Result = this.FMap.has(K);
      if (Result) Value.set(rtl.getObject(this.FMap.get(K)));
      return Result;
    };
    this.AddOrSetValue = function (Key, Value) {
      var k = 0;
      k = this.GetEffectiveKey(Key);
      if (!this.FMap.has(k)) {
        this.DoAdd(Key,Value)}
       else this.SetItem(k,Value);
    };
    this.ContainsKey = function (Key) {
      var Result = false;
      Result = this.FMap.has(this.GetEffectiveKey(Key));
      return Result;
    };
    this.ContainsValue = function (Value) {
      var Result = false;
      var It = null;
      var Res = null;
      Result = false;
      It = this.FMap.values();
      do {
        Res = It.next();
        if (!Res.done) Result = Value === rtl.getObject(Res.value);
      } while (!(Result || Res.done));
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      Result = $mod.TEnumerable$$$G$$generics$collections$$TPair$System$Longint$Generics$Collections$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$$.ToArray.call(this);
      return Result;
    };
    this.GetKeys = function () {
      var Result = null;
      if (this.FKeyCollection === null) this.FKeyCollection = this.TKeyCollection.$create("Create$1",[this]);
      Result = this.FKeyCollection;
      return Result;
    };
    this.GetValues = function () {
      var Result = null;
      if (this.FValueCollection === null) this.FValueCollection = this.TValueCollection.$create("Create$1",[this]);
      Result = this.FValueCollection;
      return Result;
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
  },"TDictionary<System.Longint,Generics.Collections.TObjectList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>>");
  rtl.createClass(this,"TObjectDictionary$$$G$$generics$collections$$Longint$$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$",this.TDictionary$$$G$$generics$collections$$Longint$$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$,function () {
    this.$init = function () {
      $mod.TDictionary$$$G$$generics$collections$$Longint$$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$.$init.call(this);
      this.FOwnerships = {};
    };
    this.$final = function () {
      this.FOwnerships = undefined;
      $mod.TDictionary$$$G$$generics$collections$$Longint$$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$.$final.call(this);
    };
    this.CanClearMap = function () {
      var Result = false;
      Result = $mod.TDictionary$$$G$$generics$collections$$Longint$$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$.CanClearMap.call(this) && rtl.eqSet(this.FOwnerships,{});
      return Result;
    };
    this.KeyNotify = function (Key, Action) {
      $mod.TDictionary$$$G$$generics$collections$$Longint$$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$.KeyNotify.call(this,Key,Action);
      if (($mod.TDictionaryOwnership.doOwnsKeys in this.FOwnerships) && (Action === $mod.TCollectionNotification.cnRemoved)) Key = rtl.freeLoc(Key);
    };
    this.ValueNotify = function (Value, Action) {
      $mod.TDictionary$$$G$$generics$collections$$Longint$$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$.ValueNotify.call(this,Value,Action);
      if (($mod.TDictionaryOwnership.doOwnsValues in this.FOwnerships) && (Action === $mod.TCollectionNotification.cnRemoved)) Value = rtl.freeLoc(Value);
    };
    this.Create$4 = function (aOwnerships, ACapacity) {
      this.FOwnerships = rtl.refSet(aOwnerships);
      $mod.TDictionary$$$G$$generics$collections$$Longint$$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$.Create$1.call(this,ACapacity);
      return this;
    };
    this.Create$5 = function (aOwnerships) {
      $mod.TDictionary$$$G$$generics$collections$$Longint$$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$.Create$1.call(this,0);
      this.FOwnerships = rtl.refSet(aOwnerships);
      return this;
    };
  },"TObjectDictionary<System.Longint,Generics.Collections.TObjectList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>>");
  rtl.recNewT(this,"TPair$$$G$$generics$collections$$TTMSFNCDataGridCellCoord$$Longint",function () {
    var $r = $mod.$rtti.$Record("TPair<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord,System.Longint>",{},this);
    this.$initSpec = function () {
      this.Value = 0;
      $r.addField("Key",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]);
      $r.addField("Value",rtl.longint);
      $r.addMethod("Create",2,[["AKey",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"],2],["AValue",rtl.longint,2]]);
    };
    this.$new = function () {
      var r = Object.create(this);
      r.Key = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      return r;
    };
    this.$eq = function (b) {
      return this.Key.$eq(b.Key) && (this.Value === b.Value);
    };
    this.$assign = function (s) {
      this.Key.$assign(s.Key);
      this.Value = s.Value;
      return this;
    };
    this.Create = function (AKey, AValue) {
      this.Key.$assign(AKey);
      this.Value = AValue;
      return this;
    };
  });
  rtl.createClass(this,"TEnumerator$$$G$$generics$collections$$TPair$WEBLib$TMSFNCDataGridCore$TTMSFNCDataGridCellCoord$System$Longint$",pas.System.TObject,function () {
    this.MoveNext = function () {
      var Result = false;
      Result = this.DoMoveNext();
      return Result;
    };
  },"TEnumerator<Generics.Collections.TPair<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord,System.Longint>>");
  rtl.createClass(this,"TEnumerable$$$G$$generics$collections$$TPair$WEBLib$TMSFNCDataGridCore$TTMSFNCDataGridCellCoord$System$Longint$",pas.System.TObject,function () {
    this.GetEnumerator = function () {
      var Result = null;
      Result = this.DoGetEnumerator();
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      var LEnumerator = null;
      Result = [];
      LEnumerator = this.GetEnumerator();
      try {
        while (LEnumerator.MoveNext()) Result.push($mod.TPair$$$G$$generics$collections$$TTMSFNCDataGridCellCoord$$Longint.$clone(LEnumerator.DoGetCurrent()));
      } finally {
        LEnumerator = rtl.freeLoc(LEnumerator);
      };
      return Result;
    };
  },"TEnumerable<Generics.Collections.TPair<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord,System.Longint>>");
  rtl.createClass(this,"TDictionary$$$G$$generics$collections$$TTMSFNCDataGridCellCoord$$Longint",this.TEnumerable$$$G$$generics$collections$$TPair$WEBLib$TMSFNCDataGridCore$TTMSFNCDataGridCellCoord$System$Longint$,function () {
    this.$initSpec = function () {
      rtl.createClass(this,"TPairEnumerator",$mod.TEnumerator$$$G$$generics$collections$$TPair$WEBLib$TMSFNCDataGridCore$TTMSFNCDataGridCellCoord$System$Longint$,function () {
        this.$init = function () {
          $mod.TEnumerator$$$G$$generics$collections$$TPair$WEBLib$TMSFNCDataGridCore$TTMSFNCDataGridCellCoord$System$Longint$.$init.call(this);
          this.FIter = null;
          this.FVal = null;
        };
        this.$final = function () {
          this.FIter = undefined;
          this.FVal = undefined;
          $mod.TEnumerator$$$G$$generics$collections$$TPair$WEBLib$TMSFNCDataGridCore$TTMSFNCDataGridCellCoord$System$Longint$.$final.call(this);
        };
        this.GetCurrent = function () {
          var Result = $mod.TPair$$$G$$generics$collections$$TTMSFNCDataGridCellCoord$$Longint.$new();
          Result.$assign(this.DoGetCurrent());
          return Result;
        };
        this.DoGetCurrent = function () {
          var Result = $mod.TPair$$$G$$generics$collections$$TTMSFNCDataGridCellCoord$$Longint.$new();
          var A = [];
          A = this.FVal.value;
          Result.$assign($mod.TPair$$$G$$generics$collections$$TTMSFNCDataGridCellCoord$$Longint.$new());
          Result.Create(rtl.getObject(A[0]),rtl.trunc(A[1]));
          return Result;
        };
        this.DoMoveNext = function () {
          var Result = false;
          this.FVal = this.FIter.next();
          Result = !this.FVal.done;
          return Result;
        };
        this.Create$1 = function (ADictionary) {
          this.FIter = ADictionary.FMap.entries();
          return this;
        };
        this.MoveNext$1 = function () {
          var Result = false;
          Result = this.DoMoveNext();
          return Result;
        };
      },"TDictionary<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord,System.Longint>.TPairEnumerator");
      rtl.createClass(this,"TKeyEnumerator",$mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCellCoord,function () {
        this.$init = function () {
          $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCellCoord.$init.call(this);
          this.FIter = null;
          this.FVal = null;
        };
        this.$final = function () {
          this.FIter = undefined;
          this.FVal = undefined;
          $mod.TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCellCoord.$final.call(this);
        };
        this.GetCurrent = function () {
          var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
          Result.$assign(this.DoGetCurrent());
          return Result;
        };
        this.DoGetCurrent = function () {
          var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
          Result.$assign(rtl.getObject(this.FVal.value));
          return Result;
        };
        this.DoMoveNext = function () {
          var Result = false;
          this.FVal = this.FIter.next();
          Result = !this.FVal.done;
          return Result;
        };
        this.Create$1 = function (AIter) {
          this.FIter = AIter;
          return this;
        };
        this.Create$2 = function (ADictionary) {
          this.Create$1(ADictionary.FMap.keys());
          return this;
        };
        this.MoveNext$1 = function () {
          var Result = false;
          Result = this.DoMoveNext();
          return Result;
        };
      },"TDictionary<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord,System.Longint>.TKeyEnumerator");
      rtl.createClass(this,"TValueEnumerator",$mod.TEnumerator$$$G$$generics$collections$$Longint,function () {
        this.$init = function () {
          $mod.TEnumerator$$$G$$generics$collections$$Longint.$init.call(this);
          this.FIter = null;
          this.FVal = null;
        };
        this.$final = function () {
          this.FIter = undefined;
          this.FVal = undefined;
          $mod.TEnumerator$$$G$$generics$collections$$Longint.$final.call(this);
        };
        this.GetCurrent = function () {
          var Result = 0;
          Result = this.DoGetCurrent();
          return Result;
        };
        this.DoGetCurrent = function () {
          var Result = 0;
          Result = rtl.trunc(this.FVal.value);
          return Result;
        };
        this.DoMoveNext = function () {
          var Result = false;
          this.FVal = this.FIter.next();
          Result = !this.FVal.done;
          return Result;
        };
        this.Create$1 = function (AIter) {
          this.FIter = AIter;
          return this;
        };
        this.Create$2 = function (ADictionary) {
          this.Create$1(ADictionary.FMap.values());
          return this;
        };
        this.MoveNext$1 = function () {
          var Result = false;
          Result = this.DoMoveNext();
          return Result;
        };
      },"TDictionary<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord,System.Longint>.TValueEnumerator");
      rtl.createClass(this,"TValueCollection",$mod.TEnumerable$$$G$$generics$collections$$Longint,function () {
        this.$init = function () {
          $mod.TEnumerable$$$G$$generics$collections$$Longint.$init.call(this);
          this.FMap = null;
        };
        this.$final = function () {
          this.FMap = undefined;
          $mod.TEnumerable$$$G$$generics$collections$$Longint.$final.call(this);
        };
        this.GetCount = function () {
          var Result = 0;
          Result = this.FMap.size;
          return Result;
        };
        this.DoGetEnumerator = function () {
          var Result = null;
          Result = $mod.TDictionary$$$G$$generics$collections$$TTMSFNCDataGridCellCoord$$Longint.TValueEnumerator.$create("Create$1",[this.FMap.values()]);
          return Result;
        };
        this.Create$1 = function (ADictionary) {
          this.FMap = ADictionary.FMap;
          return this;
        };
        this.GetEnumerator$1 = function () {
          var Result = null;
          Result = this.DoGetEnumerator();
          return Result;
        };
        this.ToArray = function () {
          var Result = [];
          var I = 0;
          var P = 0;
          Result = rtl.arraySetLength(Result,0,this.FMap.size);
          var $in = this.GetEnumerator$1();
          try {
            while ($in.MoveNext$1()) {
              P = $in.GetCurrent();
              Result[I] = P;
              I += 1;
            }
          } finally {
            $in = rtl.freeLoc($in)
          };
          return Result;
        };
      },"TDictionary<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord,System.Longint>.TValueCollection");
      rtl.createClass(this,"TKeyCollection",$mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridCellCoord,function () {
        this.$init = function () {
          $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridCellCoord.$init.call(this);
          this.FMap = null;
        };
        this.$final = function () {
          this.FMap = undefined;
          $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridCellCoord.$final.call(this);
        };
        this.GetCount = function () {
          var Result = 0;
          Result = this.FMap.size;
          return Result;
        };
        this.DoGetEnumerator = function () {
          var Result = null;
          Result = this.GetEnumerator$1();
          return Result;
        };
        this.Create$1 = function (ADictionary) {
          this.FMap = ADictionary.FMap;
          return this;
        };
        this.GetEnumerator$1 = function () {
          var Result = null;
          Result = $mod.TDictionary$$$G$$generics$collections$$TTMSFNCDataGridCellCoord$$Longint.TKeyEnumerator.$create("Create$1",[this.FMap.keys()]);
          return Result;
        };
        this.ToArray = function () {
          var Result = [];
          Result = $mod.TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridCellCoord.ToArray.call(this);
          return Result;
        };
      },"TDictionary<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord,System.Longint>.TKeyCollection");
    };
    this.$init = function () {
      $mod.TEnumerable$$$G$$generics$collections$$TPair$WEBLib$TMSFNCDataGridCore$TTMSFNCDataGridCellCoord$System$Longint$.$init.call(this);
      this.FMap = null;
      this.FComparer = null;
      this.FOnKeyNotify = null;
      this.FOnValueNotify = null;
      this.FKeyCollection = null;
      this.FValueCollection = null;
    };
    this.$final = function () {
      this.FMap = undefined;
      rtl.setIntfP(this,"FComparer",null);
      this.FOnKeyNotify = undefined;
      this.FOnValueNotify = undefined;
      this.FKeyCollection = undefined;
      this.FValueCollection = undefined;
      $mod.TEnumerable$$$G$$generics$collections$$TPair$WEBLib$TMSFNCDataGridCore$TTMSFNCDataGridCellCoord$System$Longint$.$final.call(this);
    };
    this.GetEffectiveKey = function (Key) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var it = null;
      var v = null;
      if (!(this.FComparer != null)) return Key;
      it = this.FMap.keys();
      v = it.next();
      while (!v.done) {
        Result.$assign(rtl.getObject(v.value));
        if (this.FComparer.Compare(Result,Key) === 0) return Result;
        v = it.next();
      };
      Result.$assign(Key);
      return Result;
    };
    this.GetItem = function (Key) {
      var Result = 0;
      var V = undefined;
      V = this.FMap.get(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.GetEffectiveKey(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Key))));
      if (pas.JS.isUndefined(V)) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictKeyNotFound")]);
      Result = rtl.trunc(V);
      return Result;
    };
    this.SetItem = function (Key, Value) {
      var V = undefined;
      V = this.FMap.get(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.GetEffectiveKey(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Key))));
      if (!pas.JS.isUndefined(V)) this.ValueNotify(rtl.trunc(V),$mod.TCollectionNotification.cnRemoved);
      this.FMap.set(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Key),Value);
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoAdd = function (Key, Value) {
      this.FMap.set(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.GetEffectiveKey(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Key))),Value);
      this.KeyNotify(Key,$mod.TCollectionNotification.cnAdded);
      this.ValueNotify(Value,$mod.TCollectionNotification.cnAdded);
    };
    this.DoRemove = function (Key, Notification) {
      var Result = 0;
      var V = undefined;
      var K = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      K.$assign(this.GetEffectiveKey(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Key)));
      V = this.FMap.get(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(K));
      if (!pas.JS.isUndefined(V)) {
        this.FMap.delete(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(K));
        Result = rtl.trunc(V);
        this.KeyNotify(Key,Notification);
        this.ValueNotify(Result,Notification);
      };
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FMap.size;
      return Result;
    };
    this.CanClearMap = function () {
      var Result = false;
      Result = (this.FOnKeyNotify === null) && (this.FOnValueNotify === null);
      return Result;
    };
    this.DoGetEnumerator = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.PairNotify = function (Key, Value, Action) {
      this.KeyNotify(Key,Action);
      this.ValueNotify(Value,Action);
    };
    this.KeyNotify = function (Key, Action) {
      if (this.FOnKeyNotify != null) this.FOnKeyNotify(this,Key,Action);
    };
    this.ValueNotify = function (Value, Action) {
      if (this.FOnValueNotify != null) this.FOnValueNotify(this,Value,Action);
    };
    this.Create$1 = function (ACapacity) {
      this.FMap = new Map();
      if (ACapacity > 0) ;
      return this;
    };
    this.Create$2 = function (Collection) {
      var aPair = $mod.TPair$$$G$$generics$collections$$TTMSFNCDataGridCellCoord$$Longint.$new();
      this.Create$1(0);
      var $in = Collection.GetEnumerator();
      try {
        while ($in.MoveNext()) {
          aPair = $in.DoGetCurrent();
          this.Add(aPair.Key,aPair.Value);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return this;
    };
    this.Create$3 = function (AComparer) {
      this.Create$1(0);
      rtl.setIntfP(this,"FComparer",AComparer);
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FKeyCollection;
        }, set: function (v) {
          this.p.FKeyCollection = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FValueCollection;
        }, set: function (v) {
          this.p.FValueCollection = v;
        }});
      this.Clear();
      this.FMap = null;
      pas.System.TObject.Destroy.call(this);
    };
    this.Add = function (Key, Value) {
      if (this.FMap.has(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.GetEffectiveKey(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Key))))) throw $mod.EDictionary.$create("Create$1",[rtl.getResStr($mod,"SErrDictDuplicateKey")]);
      this.DoAdd(Key,Value);
    };
    this.Remove = function (Key) {
      this.DoRemove(Key,$mod.TCollectionNotification.cnRemoved);
    };
    this.ExtractPair = function (Key) {
      var Result = $mod.TPair$$$G$$generics$collections$$TTMSFNCDataGridCellCoord$$Longint.$new();
      var K = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      Result.$assign($mod.TPair$$$G$$generics$collections$$TTMSFNCDataGridCellCoord$$Longint.$new());
      K.$assign(this.GetEffectiveKey(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Key)));
      if (this.FMap.has(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(K))) {
        Result.Create(Key,rtl.trunc(this.FMap.get(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(K))));
        this.FMap.delete(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(K));
      } else Result.Create(Key,-2147483648);
      return Result;
    };
    this.Clear = function () {
      var Iter = null;
      var IVal = null;
      var A = [];
      var K = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var V = 0;
      if (this.CanClearMap()) {
        this.FMap.clear()}
       else {
        Iter = this.FMap.entries();
        do {
          IVal = Iter.next();
          if (!IVal.done) {
            A = IVal.value;
            K.$assign(rtl.getObject(A[0]));
            V = rtl.trunc(A[1]);
            this.FMap.delete(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(K));
            this.PairNotify(K,V,$mod.TCollectionNotification.cnRemoved);
          };
        } while (!IVal.done);
      };
    };
    this.TryGetValue = function (Key, Value) {
      var Result = false;
      var K = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      K.$assign(this.GetEffectiveKey(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Key)));
      Result = this.FMap.has(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(K));
      if (Result) Value.set(rtl.trunc(this.FMap.get(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(K))));
      return Result;
    };
    this.AddOrSetValue = function (Key, Value) {
      var k = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      k.$assign(this.GetEffectiveKey(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Key)));
      if (!this.FMap.has(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(k))) {
        this.DoAdd(Key,Value)}
       else this.SetItem(k,Value);
    };
    this.ContainsKey = function (Key) {
      var Result = false;
      Result = this.FMap.has(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.GetEffectiveKey(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Key))));
      return Result;
    };
    this.ContainsValue = function (Value) {
      var Result = false;
      var It = null;
      var Res = null;
      Result = false;
      It = this.FMap.values();
      do {
        Res = It.next();
        if (!Res.done) Result = Value === rtl.trunc(Res.value);
      } while (!(Result || Res.done));
      return Result;
    };
    this.ToArray = function () {
      var Result = [];
      Result = $mod.TEnumerable$$$G$$generics$collections$$TPair$WEBLib$TMSFNCDataGridCore$TTMSFNCDataGridCellCoord$System$Longint$.ToArray.call(this);
      return Result;
    };
    this.GetKeys = function () {
      var Result = null;
      if (this.FKeyCollection === null) this.FKeyCollection = this.TKeyCollection.$create("Create$1",[this]);
      Result = this.FKeyCollection;
      return Result;
    };
    this.GetValues = function () {
      var Result = null;
      if (this.FValueCollection === null) this.FValueCollection = this.TValueCollection.$create("Create$1",[this]);
      Result = this.FValueCollection;
      return Result;
    };
    this.GetEnumerator$1 = function () {
      var Result = null;
      Result = this.TPairEnumerator.$create("Create$1",[this]);
      return Result;
    };
  },"TDictionary<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord,System.Longint>");
  $mod.$implcode = function () {
    $mod.$resourcestrings = {SErrDictKeyNotFound: {org: "Key value not found"}, SErrDictDuplicateKey: {org: "Duplicate key value"}};
  };
},[]);
rtl.module("Bcl.Json.Attributes",["System","Generics.Collections","Classes"],function () {
  "use strict";
  var $mod = this;
  this.TInclusionMode = {"0": "Always", Always: 0, "1": "NonDefault", NonDefault: 1};
  this.$rtti.$Enum("TInclusionMode",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TInclusionMode});
  rtl.createClass(this,"TJsonNamingStrategy",pas.System.TObject,function () {
  });
  this.$rtti.$ClassRef("TJsonNamingStrategyClass",{instancetype: this.$rtti["TJsonNamingStrategy"]});
  rtl.createClass(this,"TCustomJsonConverter",pas.System.TObject,function () {
  });
  this.$rtti.$ClassRef("TCustomJsonConverterClass",{instancetype: this.$rtti["TCustomJsonConverter"]});
  rtl.createClass(this,"JsonPropertyAttribute",pas.System.TCustomAttribute,function () {
    this.$init = function () {
      pas.System.TCustomAttribute.$init.call(this);
      this.FName = "";
    };
    this.Create$1 = function () {
      this.Create$2("");
      return this;
    };
    this.Create$2 = function (AName) {
      this.FName = AName;
      return this;
    };
  });
  rtl.createClass(this,"JsonIgnoreAttribute",pas.System.TCustomAttribute,function () {
  });
  rtl.createClass(this,"JsonIncludeAttribute",pas.System.TCustomAttribute,function () {
    this.$init = function () {
      pas.System.TCustomAttribute.$init.call(this);
      this.FInclusionMode = 0;
    };
    this.Create$1 = function (AInclusionMode) {
      this.FInclusionMode = AInclusionMode;
      return this;
    };
  });
  rtl.createClass(this,"JsonNamingStrategyAttribute",pas.System.TCustomAttribute,function () {
    this.$init = function () {
      pas.System.TCustomAttribute.$init.call(this);
      this.FStrategyClass = null;
    };
    this.$final = function () {
      this.FStrategyClass = undefined;
      pas.System.TCustomAttribute.$final.call(this);
    };
    this.Create$1 = function (AStrategyClass) {
      this.FStrategyClass = AStrategyClass;
      return this;
    };
  });
  rtl.createClass(this,"JsonEnumValuesAttribute",pas.System.TCustomAttribute,function () {
    this.$init = function () {
      pas.System.TCustomAttribute.$init.call(this);
      this.FEnumValues = null;
    };
    this.$final = function () {
      this.FEnumValues = undefined;
      pas.System.TCustomAttribute.$final.call(this);
    };
    this.Create$1 = function (AEnumValues) {
      var List = null;
      var I = 0;
      this.FEnumValues = pas["Generics.Collections"].TList$$$G$$generics$collections$$String.$create("Create$1");
      List = pas.Classes.TStringList.$create("Create$1");
      try {
        for (var $l = 0, $end = List.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          this.FEnumValues.Add(List.Get(I));
        };
      } finally {
        List = rtl.freeLoc(List);
      };
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FEnumValues");
      pas.System.TObject.Destroy.call(this);
    };
  });
  rtl.createClass(this,"JsonConverterAttribute",pas.System.TCustomAttribute,function () {
    this.$init = function () {
      pas.System.TCustomAttribute.$init.call(this);
      this.FConverterClass = null;
    };
    this.$final = function () {
      this.FConverterClass = undefined;
      pas.System.TCustomAttribute.$final.call(this);
    };
    this.SetConverterClass = function (Value) {
      this.FConverterClass = Value;
    };
    this.Create$1 = function (AConverterClass) {
      this.FConverterClass = AConverterClass;
      return this;
    };
  });
  rtl.createClass(this,"JsonManagedAttribute",pas.System.TCustomAttribute,function () {
  });
});
rtl.module("Bcl.Rtti.Common",["System","SysUtils","JS"],function () {
  "use strict";
  var $mod = this;
  rtl.createClass(this,"EInvalidJSCast",pas.SysUtils.Exception,function () {
    this.Create$2 = function (Value, TypeName) {
      pas.SysUtils.Exception.CreateFmt.call(this,"Cannot cast value %s to type %s",pas.System.VarRecs(18,$mod.TValue_ToString(Value),18,TypeName));
      return this;
    };
  });
  this.TValue_IsArray = function (Value) {
    var Result = false;
    Result = rtl.isArray(Value);
    return Result;
  };
  this.TValue_GetArrayLength = function (Value) {
    var Result = 0;
    Result = Value.length;
    return Result;
  };
  this.TValue_GetArrayElement = function (Value, Index) {
    var Result = undefined;
    Result = Value[Index];
    return Result;
  };
  this.TValue_AsString = function (Value) {
    var Result = "";
    if (!rtl.isString(Value)) throw $mod.EInvalidJSCast.$create("Create$2",[Value,"String"]);
    Result = "" + Value;
    return Result;
  };
  this.TValue_AsInteger = function (Value) {
    var Result = 0;
    Result = 0;
    Result = Math.floor(Value);
    if ((Result != Value) || (typeof(Value) !== "number")) throw $mod.EInvalidJSCast.$create("Create$2",[Value,"Integer"]);
    return Result;
  };
  this.TValue_AsOrdinal = function (Value) {
    var Result = 0;
    Result = $mod.TValue_AsInteger(Value);
    return Result;
  };
  this.TValue_AsBoolean = function (Value) {
    var Result = false;
    Result = false;
    if (!pas.JS.isBoolean(Value)) throw $mod.EInvalidJSCast.$create("Create$2",[Value,"Boolean"]);
    Result = !(Value == false);
    return Result;
  };
  this.TValue_AsExtended = function (Value) {
    var Result = 0.0;
    Result = 0.0;
    if (!rtl.isNumber(Value)) throw $mod.EInvalidJSCast.$create("Create$2",[Value,"Number"]);
    Result = rtl.getNumber(Value);
    return Result;
  };
  this.TValue_AsDouble = function (Value) {
    var Result = 0.0;
    Result = $mod.TValue_AsExtended(Value);
    return Result;
  };
  this.TValue_AsBytes = function (Value) {
    var Result = [];
    Result = Value;
    return Result;
  };
  this.TValue_IsEmpty = function (Value) {
    var Result = false;
    Result = Value == null;
    return Result;
  };
  this.TValue_FromDateTime = function (Value) {
    var Result = undefined;
    Result = Value;
    return Result;
  };
  this.TValue_FromDate = function (Value) {
    var Result = undefined;
    Result = Value;
    return Result;
  };
  this.TValue_FromTime = function (Value) {
    var Result = undefined;
    Result = Value;
    return Result;
  };
  this.TValue_FromBytes = function (Value) {
    var Result = undefined;
    Result = Value;
    return Result;
  };
  this.TValue_ToString = function (Value) {
    return "" + Value;
  };
});
rtl.module("Bcl.SysUtils",["System"],function () {
  "use strict";
  var $mod = this;
  this.TryStrToNumber = function (S, Value) {
    var Result = false;
    var J = undefined;
    J = parseFloat(S);
    Result = !isNaN(J);
    if (Result) Value.set(rtl.getNumber(J));
    return Result;
  };
  this.NumberToStr = function (Value) {
    return Value.toString();
  };
},["JS"]);
rtl.module("TimeSpan",["System"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  rtl.recNewT(this,"TTimeSpan",function () {
    this.FTicks = 0;
    this.FMinValue = 0;
    this.FMaxValue = 0;
    this.FZero = 0;
    this.cIntLengthShift = 52 - 1;
    this.MillisecondsPerTick = 0.0001;
    this.SecondsPerTick = 1e-7;
    this.MinutesPerTick = 1.6666666666666667E-9;
    this.HoursPerTick = 2.7777777777777777E-11;
    this.DaysPerTick = 1.1574074074074074E-12;
    this.MillisPerSecond = 1000;
    this.MillisPerMinute = 60 * 1000;
    this.MillisPerHour = 60 * 60000;
    this.MillisPerDay = 24 * 3600000;
    this.MaxSeconds = 922337203685;
    this.MinSeconds = -922337203685;
    this.MaxMilliseconds = 922337203685477;
    this.MinMilliseconds = -922337203685477;
    this.TicksPerMillisecond = 10000;
    this.TicksPerSecond = 1000 * 10000;
    this.TicksPerMinute = 60 * 10000000;
    this.TicksPerHour = 60 * 600000000;
    this.TicksPerDay = 24 * 36000000000;
    this.$eq = function (b) {
      return this.FTicks === b.FTicks;
    };
    this.$assign = function (s) {
      this.FTicks = s.FTicks;
      return this;
    };
    this.GetDays = function () {
      var Result = 0;
      Result = rtl.trunc(this.FTicks / 864000000000) & 0xFFFFFFFF;
      return Result;
    };
    this.GetHours = function () {
      var Result = 0;
      Result = (rtl.trunc(this.FTicks / 36000000000) % 24) & 0xFFFFFFFF;
      return Result;
    };
    this.GetMinutes = function () {
      var Result = 0;
      Result = (rtl.trunc(this.FTicks / 600000000) % 60) & 0xFFFFFFFF;
      return Result;
    };
    this.GetSeconds = function () {
      var Result = 0;
      Result = (rtl.trunc(this.FTicks / 10000000) % 60) & 0xFFFFFFFF;
      return Result;
    };
    this.GetMilliseconds = function () {
      var Result = 0;
      Result = (rtl.trunc(this.FTicks / 10000) % 1000) & 0xFFFFFFFF;
      return Result;
    };
    this.GetTotalDays = function () {
      var Result = 0.0;
      Result = this.FTicks * 1.1574074074074074E-12;
      return Result;
    };
    this.GetTotalHours = function () {
      var Result = 0.0;
      Result = this.FTicks * 2.7777777777777777E-11;
      return Result;
    };
    this.GetTotalMinutes = function () {
      var Result = 0.0;
      Result = this.FTicks * 1.6666666666666667E-9;
      return Result;
    };
    this.GetTotalSeconds = function () {
      var Result = 0.0;
      Result = this.FTicks * 1E-7;
      return Result;
    };
    this.GetTotalMilliseconds = function () {
      var Result = 0.0;
      Result = 1E-4;
      Result = this.FTicks * Result;
      if (Result > 922337203685477) {
        Result = 922337203685477}
       else if (Result < -922337203685477) Result = -922337203685477;
      return Result;
    };
    this.GetScaledInterval = function (AValue, AScale) {
      var Result = $mod.TTimeSpan.$new();
      var lNewValue = 0.0;
      if (isNaN(AValue)) throw pas.SysUtils.EArgumentException.$create("Create$1",[rtl.getResStr($mod,"STimespanValueCannotBeNan")]);
      lNewValue = AValue * AScale;
      if (AValue >= 0.0) {
        lNewValue = lNewValue + 0.5}
       else lNewValue = lNewValue - 0.5;
      if ((lNewValue > 922337203685477) || (lNewValue < -922337203685477)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr($mod,"STimespanElementTooLong")]);
      Result.$assign($mod.TTimeSpan.$new().Create(pas.System.Trunc(lNewValue) * 10000));
      return Result;
    };
    this.get_MaxValue = function () {
      var Result = $mod.TTimeSpan.$new();
      Result.FTicks = $mod.TTimeSpan.FMaxValue;
      return Result;
    };
    this.get_MinValue = function () {
      var Result = $mod.TTimeSpan.$new();
      Result.FTicks = $mod.TTimeSpan.FMinValue;
      return Result;
    };
    this.get_Zero = function () {
      var Result = $mod.TTimeSpan.$new();
      Result.FTicks = $mod.TTimeSpan.FZero;
      return Result;
    };
    this.Create = function (ATicks) {
      this.FTicks = ATicks;
      return this;
    };
    this.Create$1 = function (AHours, AMinutes, ASeconds) {
      this.FTicks = (AHours * 3600) + (AMinutes * 60) + ASeconds;
      if ((this.FTicks > 922337203685) || (this.FTicks < -922337203685)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr($mod,"STimespanTooLong")]);
      this.FTicks = this.FTicks * 10000000;
      return this;
    };
    this.Create$2 = function (ADays, AHours, AMinutes, ASeconds) {
      this.Create$3(ADays,AHours,AMinutes,ASeconds,0);
      return this;
    };
    this.Create$3 = function (ADays, AHours, AMinutes, ASeconds, AMilliseconds) {
      var lTicks = 0;
      lTicks = (((ADays * 86400) + (AHours * 3600) + (AMinutes * 60) + ASeconds) * 1000) + AMilliseconds;
      if ((lTicks > 922337203685477) || (lTicks < -922337203685477)) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr($mod,"STimespanTooLong")]);
      this.FTicks = lTicks * 10000;
      return this;
    };
    this.Add = function (ATimeSpan) {
      var Result = $mod.TTimeSpan.$new();
      var lNewTicks = 0;
      lNewTicks = this.FTicks + ATimeSpan.FTicks;
      if ((Math.floor(this.FTicks / 2251799813685248) === Math.floor(ATimeSpan.FTicks / 2251799813685248)) && (Math.floor(this.FTicks / 2251799813685248) !== Math.floor(lNewTicks / 2251799813685248))) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr($mod,"STimespanTooLong")]);
      Result.$assign($mod.TTimeSpan.$new().Create(lNewTicks));
      return Result;
    };
    this.Duration = function () {
      var Result = $mod.TTimeSpan.$new();
      if (this.FTicks === this.get_MinValue().FTicks) throw pas.SysUtils.EIntOverflow.$create("Create$1",[rtl.getResStr($mod,"SInvalidTimespanDuration")]);
      if (this.FTicks < 0) {
        Result.$assign($mod.TTimeSpan.$new().Create(-this.FTicks))}
       else Result.$assign($mod.TTimeSpan.$new().Create(this.FTicks));
      return Result;
    };
    this.Negate = function () {
      var Result = $mod.TTimeSpan.$new();
      if (this.FTicks === this.get_MinValue().FTicks) throw pas.SysUtils.EIntOverflow.$create("Create$1",[rtl.getResStr($mod,"SCannotNegateTimespan")]);
      Result.$assign($mod.TTimeSpan.$new().Create(-this.FTicks));
      return Result;
    };
    this.Subtract = function (ATimeSpan) {
      var Result = $mod.TTimeSpan.$new();
      var lNewTicks = 0;
      lNewTicks = this.FTicks - ATimeSpan.FTicks;
      if ((Math.floor(this.FTicks / 2251799813685248) !== Math.floor(ATimeSpan.FTicks / 2251799813685248)) && (Math.floor(this.FTicks / 2251799813685248) !== Math.floor(lNewTicks / 2251799813685248))) throw pas.SysUtils.EArgumentOutOfRangeException.$create("Create$1",[rtl.getResStr($mod,"STimespanTooLong")]);
      Result.$assign($mod.TTimeSpan.$new().Create(lNewTicks));
      return Result;
    };
    this.ToString = function () {
      var Result = "";
      var lFormat = "";
      var lDays = 0;
      var lSecondTicks = 0;
      var lTicks = 0;
      lFormat = "%1:.2d:%2:.2d:%3:.2d";
      lDays = rtl.trunc(this.FTicks / 864000000000);
      lTicks = this.FTicks % 864000000000;
      if (this.FTicks < 0) lTicks = -lTicks;
      if (lDays !== 0) lFormat = "%0:d." + lFormat;
      lSecondTicks = lTicks % 10000000;
      if (lSecondTicks !== 0) lFormat = lFormat + ".%4:.7d";
      Result = pas.SysUtils.TStringHelper.Format(lFormat,pas.System.VarRecs(19,lDays,19,rtl.trunc(lTicks / 36000000000) % 24,19,rtl.trunc(lTicks / 600000000) % 60,19,rtl.trunc(lTicks / 10000000) % 60,19,lSecondTicks));
      return Result;
    };
    this.FromDays = function (AValue) {
      var Result = $mod.TTimeSpan.$new();
      Result.$assign($mod.TTimeSpan.GetScaledInterval(AValue,86400000));
      return Result;
    };
    this.FromHours = function (AValue) {
      var Result = $mod.TTimeSpan.$new();
      Result.$assign($mod.TTimeSpan.GetScaledInterval(AValue,3600000));
      return Result;
    };
    this.FromMinutes = function (AValue) {
      var Result = $mod.TTimeSpan.$new();
      Result.$assign($mod.TTimeSpan.GetScaledInterval(AValue,60000));
      return Result;
    };
    this.FromSeconds = function (AValue) {
      var Result = $mod.TTimeSpan.$new();
      Result.$assign($mod.TTimeSpan.GetScaledInterval(AValue,1000));
      return Result;
    };
    this.FromMilliseconds = function (AValue) {
      var Result = $mod.TTimeSpan.$new();
      Result.$assign($mod.TTimeSpan.GetScaledInterval(AValue,1));
      return Result;
    };
    this.FromTicks = function (AValue) {
      var Result = $mod.TTimeSpan.$new();
      Result.$assign($mod.TTimeSpan.$new().Create(AValue));
      return Result;
    };
    this.Subtract$1 = function (ADateTimeLeft, ADateTimeRight) {
      var Result = $mod.TTimeSpan.$new();
      Result.$assign($mod.TTimeSpan.$new().Create(pas.System.Trunc(pas.SysUtils.TimeStampToMSecs(pas.SysUtils.DateTimeToTimeStamp(ADateTimeLeft)) - pas.SysUtils.TimeStampToMSecs(pas.SysUtils.DateTimeToTimeStamp(ADateTimeRight))) * 10000));
      return Result;
    };
    this.Parse = function (AValue) {
      var Result = $mod.TTimeSpan.$new();
      var lParser = $impl.TTimeSpanParser.$new();
      Result.$assign($mod.TTimeSpan.$new().Create(lParser.Convert(AValue)));
      return Result;
    };
    this.TryParse = function (AValue, ATimeSpan) {
      var Result = false;
      var lTicks = 0;
      var lParser = $impl.TTimeSpanParser.$new();
      Result = lParser.TryConvert(AValue,{get: function () {
          return lTicks;
        }, set: function (v) {
          lTicks = v;
        }}) === $impl.TTimeSpanParser.TParseError.peNone;
      if (Result) {
        ATimeSpan.$assign($mod.TTimeSpan.$new().Create(lTicks))}
       else ATimeSpan.$assign($mod.TTimeSpan.get_Zero());
      return Result;
    };
    var $r = $mod.$rtti.$Record("TTimeSpan",{},this);
    $r.addMethod("Create",2,[["ATicks",rtl.nativeint]]);
    $r.addMethod("Create$1",2,[["AHours",rtl.longint,2],["AMinutes",rtl.longint,2],["ASeconds",rtl.longint,2]]);
    $r.addMethod("Create$2",2,[["ADays",rtl.longint,2],["AHours",rtl.longint,2],["AMinutes",rtl.longint,2],["ASeconds",rtl.longint,2]]);
    $r.addMethod("Create$3",2,[["ADays",rtl.longint,2],["AHours",rtl.longint,2],["AMinutes",rtl.longint,2],["ASeconds",rtl.longint,2],["AMilliseconds",rtl.longint,2]]);
    $r.addMethod("Add",1,[["ATimeSpan",$r,2]],2,$r);
    $r.addMethod("Duration",1,[],2,$r);
    $r.addMethod("Negate",1,[],2,$r);
    $r.addMethod("Subtract",1,[["ATimeSpan",$r,2]],2,$r);
    $r.addMethod("ToString",1,[],2,rtl.string);
    $r.addMethod("FromDays",5,[["AValue",rtl.double,2]],2,$r,1);
    $r.addMethod("FromHours",5,[["AValue",rtl.double,2]],2,$r,1);
    $r.addMethod("FromMinutes",5,[["AValue",rtl.double,2]],2,$r,1);
    $r.addMethod("FromSeconds",5,[["AValue",rtl.double,2]],2,$r,1);
    $r.addMethod("FromMilliseconds",5,[["AValue",rtl.double,2]],2,$r,1);
    $r.addMethod("FromTicks",5,[["AValue",rtl.nativeint,2]],2,$r,1);
    $r.addMethod("Subtract$1",5,[["ADateTimeLeft",pas.System.$rtti["TDateTime"],2],["ADateTimeRight",pas.System.$rtti["TDateTime"],2]],2,$r,1);
    $r.addMethod("Parse",5,[["AValue",rtl.string,2]],2,$r,1);
    $r.addMethod("TryParse",5,[["AValue",rtl.string,2],["ATimeSpan",$r,4]],2,rtl.boolean,1);
    $r.addProperty("Ticks",0,rtl.nativeint,"FTicks","",2);
    $r.addProperty("Days",1,rtl.longint,"GetDays","",2);
    $r.addProperty("Hours",1,rtl.longint,"GetHours","",2);
    $r.addProperty("Minutes",1,rtl.longint,"GetMinutes","",2);
    $r.addProperty("Seconds",1,rtl.longint,"GetSeconds","",2);
    $r.addProperty("Milliseconds",1,rtl.longint,"GetMilliseconds","",2);
    $r.addProperty("TotalDays",1,rtl.double,"GetTotalDays","",2);
    $r.addProperty("TotalHours",1,rtl.double,"GetTotalHours","",2);
    $r.addProperty("TotalMinutes",1,rtl.double,"GetTotalMinutes","",2);
    $r.addProperty("TotalSeconds",1,rtl.double,"GetTotalSeconds","",2);
    $r.addProperty("TotalMilliseconds",1,rtl.double,"GetTotalMilliseconds","",2);
    $r.addProperty("MinValue",33,$r,"get_MinValue","",2);
    $r.addProperty("MaxValue",33,$r,"get_MaxValue","",2);
    $r.addProperty("Zero",33,$r,"get_Zero","",2);
  },true);
  $mod.$implcode = function () {
    rtl.recNewT($impl,"TTimeSpanParser",function () {
      this.TParseError = {"0": "peNone", peNone: 0, "1": "peFormat", peFormat: 1, "2": "peOverflow", peOverflow: 2, "3": "peOverflowHMS", peOverflowHMS: 3};
      $mod.$rtti.$Enum("TTimeSpanParser.TParseError",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TParseError});
      this.FStr = "";
      this.FPos = 0;
      this.$eq = function (b) {
        return (this.FStr === b.FStr) && (this.FPos === b.FPos);
      };
      this.$assign = function (s) {
        this.FStr = s.FStr;
        this.FPos = s.FPos;
        return this;
      };
      this.CurrentChar = function () {
        var Result = "\x00";
        if ((this.FPos >= 1) && (this.FPos <= this.FStr.length)) {
          Result = this.FStr.charAt(this.FPos - 1)}
         else Result = "\x00";
        return Result;
      };
      this.NextChar = function () {
        var Result = "\x00";
        if (this.FPos <= this.FStr.length) this.FPos += 1;
        Result = this.CurrentChar();
        return Result;
      };
      this.NextNonDigit = function () {
        var Result = "\x00";
        var lCount = 0;
        for (var $l = this.FPos, $end = this.FStr.length; $l <= $end; $l++) {
          lCount = $l;
          Result = this.FStr.charAt(lCount - 1);
          if ((Result < "0") || (Result > "9")) return Result;
        };
        Result = "\x00";
        return Result;
      };
      this.Convert = function (AValue) {
        var Result = 0;
        Result = 0;
        var $tmp = this.TryConvert(AValue,{get: function () {
            return Result;
          }, set: function (v) {
            Result = v;
          }});
        if ($tmp === $impl.TTimeSpanParser.TParseError.peFormat) {
          throw pas.SysUtils.Exception.$create("Create$1",[rtl.getResStr($mod,"SInvalidTimespanFormat")])}
         else if ($tmp === $impl.TTimeSpanParser.TParseError.peOverflow) {
          throw pas.SysUtils.EIntOverflow.$create("Create$1",[rtl.getResStr($mod,"STimespanTooLong")])}
         else if ($tmp === $impl.TTimeSpanParser.TParseError.peOverflowHMS) throw pas.SysUtils.EIntOverflow.$create("Create$1",[rtl.getResStr($mod,"STimespanElementTooLong")]);
        return Result;
      };
      this.TryConvert = function (AString, AValue) {
        var Result = 0;
        var lDays = 0;
        var lIsNegative = false;
        var lTicks = 0;
        var lTimeVal = 0;
        lTicks = 0;
        AValue.set(0);
        this.FStr = AString;
        this.FPos = 1;
        this.SkipWhite();
        lIsNegative = false;
        if (this.CurrentChar() === "-") {
          lIsNegative = true;
          this.NextChar();
        };
        if (this.NextNonDigit() === ":") {
          Result = this.ConvertTime({get: function () {
              return lTicks;
            }, set: function (v) {
              lTicks = v;
            }});
          if (Result !== $impl.TTimeSpanParser.TParseError.peNone) return Result;
        } else {
          Result = this.NextInt(0xa2e3ff,{get: function () {
              return lDays;
            }, set: function (v) {
              lDays = v;
            }});
          if (Result !== $impl.TTimeSpanParser.TParseError.peNone) return Result;
          lTicks = lDays * 864000000000;
          if (this.CurrentChar() === ".") {
            this.NextChar();
            Result = this.ConvertTime({get: function () {
                return lTimeVal;
              }, set: function (v) {
                lTimeVal = v;
              }});
            if (Result !== $impl.TTimeSpanParser.TParseError.peNone) return Result;
            lTicks = lTicks + lTimeVal;
          };
        };
        if (lIsNegative) {
          lTicks = -lTicks;
          if (lTicks > 0) return $impl.TTimeSpanParser.TParseError.peOverflow;
        } else if (lTicks < 0) return $impl.TTimeSpanParser.TParseError.peOverflow;
        this.SkipWhite();
        if (this.FPos <= this.FStr.length) return $impl.TTimeSpanParser.TParseError.peFormat;
        AValue.set(lTicks);
        Result = $impl.TTimeSpanParser.TParseError.peNone;
        return Result;
      };
      this.NextInt = function (AMaxValue, AValue) {
        var Result = 0;
        var lChar = "\x00";
        var lStartPos = 0;
        AValue.set(0);
        lStartPos = this.FPos;
        lChar = this.CurrentChar();
        while ((lChar >= "0") && (lChar <= "9")) {
          if ((AValue.get() & 0xF0000000) !== 0) return $impl.TTimeSpanParser.TParseError.peOverflow;
          AValue.set((AValue.get() * 10) + (lChar.charCodeAt() - 0x30));
          if (AValue.get() < 0) return $impl.TTimeSpanParser.TParseError.peOverflow;
          lChar = this.NextChar();
        };
        if (this.FPos === lStartPos) return $impl.TTimeSpanParser.TParseError.peFormat;
        if (AValue.get() > AMaxValue) return $impl.TTimeSpanParser.TParseError.peOverflow;
        Result = $impl.TTimeSpanParser.TParseError.peNone;
        return Result;
      };
      this.ConvertTime = function (ATime) {
        var Result = 0;
        var lChar = "\x00";
        var lPart = 0;
        ATime.set(0);
        Result = this.NextInt(23,{get: function () {
            return lPart;
          }, set: function (v) {
            lPart = v;
          }});
        if (Result !== $impl.TTimeSpanParser.TParseError.peNone) {
          if (Result === $impl.TTimeSpanParser.TParseError.peOverflow) Result = $impl.TTimeSpanParser.TParseError.peOverflowHMS;
          return Result;
        };
        ATime.set(lPart * 36000000000);
        if (this.CurrentChar() !== ":") return $impl.TTimeSpanParser.TParseError.peFormat;
        this.NextChar();
        Result = this.NextInt(59,{get: function () {
            return lPart;
          }, set: function (v) {
            lPart = v;
          }});
        if (Result !== $impl.TTimeSpanParser.TParseError.peNone) {
          if (Result === $impl.TTimeSpanParser.TParseError.peOverflow) Result = $impl.TTimeSpanParser.TParseError.peOverflowHMS;
          return Result;
        };
        ATime.set(ATime.get() + (lPart * 600000000));
        if (this.CurrentChar() === ":") {
          if (this.NextChar() !== ".") {
            Result = this.NextInt(59,{get: function () {
                return lPart;
              }, set: function (v) {
                lPart = v;
              }});
            if (Result !== $impl.TTimeSpanParser.TParseError.peNone) {
              if (Result === $impl.TTimeSpanParser.TParseError.peOverflow) Result = $impl.TTimeSpanParser.TParseError.peOverflowHMS;
              return Result;
            };
            ATime.set(ATime.get() + (lPart * 10000000));
          };
          if (this.CurrentChar() === ".") {
            lChar = this.NextChar();
            lPart = 10000000;
            while ((lPart > 1) && (lChar >= "0") && (lChar <= "9")) {
              lPart = rtl.trunc(lPart / 10);
              ATime.set(ATime.get() + ((lChar.charCodeAt() - 0x30) * lPart));
              lChar = this.NextChar();
            };
          };
        };
        Result = $impl.TTimeSpanParser.TParseError.peNone;
        return Result;
      };
      this.SkipWhite = function () {
        var lChar = "\x00";
        lChar = this.CurrentChar();
        while ((lChar === " ") || (lChar === "\t")) lChar = this.NextChar();
      };
      var $r = $mod.$rtti.$Record("TTimeSpanParser",{},this);
      $r.addMethod("CurrentChar",1,[],2,rtl.char);
      $r.addMethod("NextChar",1,[],2,rtl.char);
      $r.addMethod("NextNonDigit",1,[],2,rtl.char);
      $r.addMethod("Convert",1,[["AValue",rtl.string,2]],2,rtl.nativeint);
      $r.addMethod("TryConvert",1,[["AString",rtl.string,2],["AValue",rtl.nativeint,4]],2,$mod.$rtti["TTimeSpanParser.TParseError"]);
      $r.addMethod("NextInt",1,[["AMaxValue",rtl.longint],["AValue",rtl.longint,4]],2,$mod.$rtti["TTimeSpanParser.TParseError"]);
      $r.addMethod("ConvertTime",1,[["ATime",rtl.nativeint,4]],2,$mod.$rtti["TTimeSpanParser.TParseError"]);
      $r.addMethod("SkipWhite",0,[]);
    });
    $mod.$resourcestrings = {SCannotNegateTimespan: {org: "Negating the minimum value of a Timespan is invalid"}, SInvalidTimespanDuration: {org: "The duration cannot be returned because the absolute value exceeds the value of TTimeSpan.MaxValue"}, SInvalidTimespanFormat: {org: "Invalid Timespan format"}, STimespanElementTooLong: {org: "Timespan element too long"}, STimespanTooLong: {org: "Timespan too long"}, STimespanValueCannotBeNan: {org: "Value cannot be NaN"}};
  };
  $mod.$init = function () {
    (function () {
      $mod.TTimeSpan.FMinValue = 9007199254740991;
      $mod.TTimeSpan.FMaxValue = -9007199254740991;
    })();
  };
},["SysUtils","Math"]);
rtl.module("dateutils.helper",["System","Generics.Defaults","Generics.Collections"],function () {
  "use strict";
  var $mod = this;
  rtl.createClass(this,"TDateUtilsHelper",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FCache = null;
    };
    this.$final = function () {
      this.FCache = undefined;
      pas.System.TObject.$final.call(this);
    };
    var cJanuary = 0;
    var cDecember = 11;
    this.CalcPoints = function (AYear, AValue) {
      var Result = false;
      var lMonth = 0;
      var lDay = 0;
      var lHour = 0;
      var lDate = null;
      var lOffset = 0;
      var lOffsetNext = 0;
      var lFirst = false;
      var lDateTime = 0.0;
      lFirst = true;
      for (lMonth = 0; lMonth <= 11; lMonth++) {
        for (var $l = 1, $end = pas.SysUtils.MonthDays[+pas.SysUtils.IsLeapYear(AYear)][(lMonth + 1) - 1]; $l <= $end; $l++) {
          lDay = $l;
          for (lHour = 0; lHour <= 23; lHour++) {
            lDate = new Date(AYear,lMonth,lDay,lHour,0,0,0);
            lOffset = lDate.getTimezoneOffset();
            lDate.setHours(lDate.getHours() + 1);
            lOffsetNext = lDate.getTimezoneOffset();
            if (lOffset !== lOffsetNext) {
              lDateTime = pas.SysUtils.EncodeDate(AYear,lMonth + 1,lDay);
              if (lFirst) {
                AValue.Key = lDateTime + pas.SysUtils.EncodeTime(lHour + 1,0,0,0)}
               else AValue.Value = lDateTime + pas.SysUtils.EncodeTime(lHour,0,0,0);
              lFirst = false;
            };
          };
        };
      };
      Result = !lFirst;
      if (Result) this.FCache.Add(AYear,AValue);
      return Result;
    };
    this.Find = function (AYear, AResult) {
      var Result = false;
      Result = this.FCache.TryGetValue(AYear,AResult);
      return Result;
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FCache = pas["Generics.Collections"].TDictionary$$$G$$generics$collections$$Longint$$TPair$System$Double$System$Double$.$create("Create$1",[0]);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FCache");
      pas.System.TObject.Destroy.call(this);
    };
    this.Force = function (AYear, AValue) {
      var Result = false;
      Result = this.Find(AYear,AValue);
      if (!Result) Result = this.CalcPoints(AYear,AValue);
      return Result;
    };
  });
},["SysUtils","JS"]);
rtl.module("DateUtils",["System","SysUtils","Math","TimeSpan","dateutils.helper"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.DaysPerWeek = 7;
  this.WeeksPerFortnight = 2;
  this.MonthsPerYear = 12;
  this.YearsPerDecade = 10;
  this.YearsPerCentury = 100;
  this.YearsPerMillennium = 1000;
  this.DayMonday = 1;
  this.DayTuesday = 2;
  this.DayWednesday = 3;
  this.DayThursday = 4;
  this.DayFriday = 5;
  this.DaySaturday = 6;
  this.DaySunday = 7;
  this.OneHour = 1 / 24;
  this.OneMinute = 1 / 1440;
  this.OneSecond = 1 / 86400;
  this.OneMillisecond = 1 / 86400000;
  this.$rtti.$StaticArray("DaysPerYear$a",{dims: [2], eltype: rtl.word});
  this.DaysPerYear = [365,366];
  this.RecodeLeaveFieldAsIs = 65535;
  this.ApproxDaysPerMonth = 30.4375;
  this.ApproxDaysPerYear = 365.25;
  this.DateOf = function (AValue) {
    var Result = 0.0;
    Result = pas.System.Trunc(AValue);
    return Result;
  };
  this.TimeOf = function (AValue) {
    var Result = 0.0;
    Result = pas.System.Frac(AValue);
    return Result;
  };
  this.IsInLeapYear = function (AValue) {
    var Result = false;
    Result = pas.SysUtils.IsLeapYear($mod.YearOf(AValue));
    return Result;
  };
  this.IsPM = function (AValue) {
    var Result = false;
    Result = $mod.HourOf(AValue) >= 12;
    return Result;
  };
  this.IsValidDate = function (AYear, AMonth, ADay) {
    var Result = false;
    Result = (AYear !== 0) && (AYear < 10000) && $impl.IsValidMonth(AMonth) && (ADay !== 0) && (ADay <= pas.SysUtils.MonthDays[+pas.SysUtils.IsLeapYear(AYear)][AMonth - 1]);
    return Result;
  };
  this.IsValidTime = function (AHour, AMinute, ASecond, AMilliSecond) {
    var Result = false;
    Result = (AHour === 24) && (AMinute === 0) && (ASecond === 0) && (AMilliSecond === 0);
    Result = Result || ((AHour < 24) && (AMinute < 60) && (ASecond < 60) && (AMilliSecond < 1000));
    return Result;
  };
  this.IsValidDateTime = function (AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond) {
    var Result = false;
    Result = $mod.IsValidDate(AYear,AMonth,ADay) && $mod.IsValidTime(AHour,AMinute,ASecond,AMilliSecond);
    return Result;
  };
  this.IsValidDateDay = function (AYear, ADayOfYear) {
    var Result = false;
    Result = (AYear !== 0) && (ADayOfYear !== 0) && (AYear < 10000) && (ADayOfYear <= $mod.DaysPerYear[+pas.SysUtils.IsLeapYear(AYear)]);
    return Result;
  };
  this.IsValidDateWeek = function (AYear, AWeekOfYear, ADayOfWeek) {
    var Result = false;
    Result = (AYear !== 0) && (AYear < 10000) && $impl.IsValidDayOfWeek(ADayOfWeek) && (AWeekOfYear !== 0) && (AWeekOfYear <= $mod.WeeksInAYear(AYear));
    return Result;
  };
  this.IsValidDateMonthWeek = function (AYear, AMonth, AWeekOfMonth, ADayOfWeek) {
    var Result = false;
    Result = (AYear !== 0) && (AYear < 10000) && $impl.IsValidMonth(AMonth) && $impl.IsValidWeekOfMonth(AWeekOfMonth) && $impl.IsValidDayOfWeek(ADayOfWeek);
    return Result;
  };
  this.WeeksInYear = function (AValue) {
    var Result = 0;
    Result = $mod.WeeksInAYear($mod.YearOf(AValue));
    return Result;
  };
  this.WeeksInAYear = function (AYear) {
    var Result = 0;
    var DOW = 0;
    Result = 52;
    DOW = $mod.DayOfTheWeek($mod.StartOfAYear(AYear));
    if ((DOW === 4) || ((DOW === 3) && pas.SysUtils.IsLeapYear(AYear))) Result += 1;
    return Result;
  };
  this.DaysInYear = function (AValue) {
    var Result = 0;
    Result = $mod.DaysPerYear[+pas.SysUtils.IsLeapYear($mod.YearOf(AValue))];
    return Result;
  };
  this.DaysInAYear = function (AYear) {
    var Result = 0;
    Result = $mod.DaysPerYear[+pas.SysUtils.IsLeapYear(AYear)];
    return Result;
  };
  this.DaysInMonth = function (AValue) {
    var Result = 0;
    var Y = 0;
    var M = 0;
    var D = 0;
    pas.SysUtils.DecodeDate(AValue,{get: function () {
        return Y;
      }, set: function (v) {
        Y = v;
      }},{get: function () {
        return M;
      }, set: function (v) {
        M = v;
      }},{get: function () {
        return D;
      }, set: function (v) {
        D = v;
      }});
    Result = pas.SysUtils.MonthDays[+pas.SysUtils.IsLeapYear(Y)][M - 1];
    return Result;
  };
  this.DaysInAMonth = function (AYear, AMonth) {
    var Result = 0;
    Result = pas.SysUtils.MonthDays[+pas.SysUtils.IsLeapYear(AYear)][AMonth - 1];
    return Result;
  };
  this.Today = function () {
    var Result = 0.0;
    Result = pas.SysUtils.Date();
    return Result;
  };
  this.Yesterday = function () {
    var Result = 0.0;
    Result = pas.SysUtils.Date() - 1;
    return Result;
  };
  this.Tomorrow = function () {
    var Result = 0.0;
    Result = pas.SysUtils.Date() + 1;
    return Result;
  };
  this.IsToday = function (AValue) {
    var Result = false;
    Result = $mod.IsSameDay(AValue,pas.SysUtils.Date());
    return Result;
  };
  this.IsSameDay = function (AValue, ABasis) {
    var Result = false;
    var D = 0.0;
    D = AValue - pas.System.Trunc(ABasis);
    Result = (D >= 0) && (D < 1);
    return Result;
  };
  this.IsSameMonth = function (Avalue, ABasis) {
    var Result = false;
    Result = $mod.YearOf(Avalue) === $mod.YearOf(ABasis);
    Result = Result && ($mod.MonthOf(Avalue) === $mod.MonthOf(ABasis));
    return Result;
  };
  this.PreviousDayOfWeek = function (DayOfWeek) {
    var Result = 0;
    if (!$impl.IsValidDayOfWeek(DayOfWeek)) throw pas.SysUtils.EConvertError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SErrInvalidDayOfWeek"),pas.System.VarRecs(0,DayOfWeek)]);
    Result = $impl.DOWMap[DayOfWeek - 1];
    return Result;
  };
  this.YearOf = function (AValue) {
    var Result = 0;
    var D = 0;
    var M = 0;
    pas.SysUtils.DecodeDate(AValue,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }},{get: function () {
        return D;
      }, set: function (v) {
        D = v;
      }},{get: function () {
        return M;
      }, set: function (v) {
        M = v;
      }});
    return Result;
  };
  this.MonthOf = function (AValue) {
    var Result = 0;
    var Y = 0;
    var D = 0;
    pas.SysUtils.DecodeDate(AValue,{get: function () {
        return Y;
      }, set: function (v) {
        Y = v;
      }},{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }},{get: function () {
        return D;
      }, set: function (v) {
        D = v;
      }});
    return Result;
  };
  this.WeekOf = function (AValue) {
    var Result = 0;
    Result = $mod.WeekOfTheYear(AValue);
    return Result;
  };
  this.DayOf = function (AValue) {
    var Result = 0;
    var Y = 0;
    var M = 0;
    pas.SysUtils.DecodeDate(AValue,{get: function () {
        return Y;
      }, set: function (v) {
        Y = v;
      }},{get: function () {
        return M;
      }, set: function (v) {
        M = v;
      }},{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }});
    return Result;
  };
  this.HourOf = function (AValue) {
    var Result = 0;
    var N = 0;
    var S = 0;
    var MS = 0;
    pas.SysUtils.DecodeTime(AValue,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }},{get: function () {
        return N;
      }, set: function (v) {
        N = v;
      }},{get: function () {
        return S;
      }, set: function (v) {
        S = v;
      }},{get: function () {
        return MS;
      }, set: function (v) {
        MS = v;
      }});
    return Result;
  };
  this.MinuteOf = function (AValue) {
    var Result = 0;
    var H = 0;
    var S = 0;
    var MS = 0;
    pas.SysUtils.DecodeTime(AValue,{get: function () {
        return H;
      }, set: function (v) {
        H = v;
      }},{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }},{get: function () {
        return S;
      }, set: function (v) {
        S = v;
      }},{get: function () {
        return MS;
      }, set: function (v) {
        MS = v;
      }});
    return Result;
  };
  this.SecondOf = function (AValue) {
    var Result = 0;
    var H = 0;
    var N = 0;
    var MS = 0;
    pas.SysUtils.DecodeTime(AValue,{get: function () {
        return H;
      }, set: function (v) {
        H = v;
      }},{get: function () {
        return N;
      }, set: function (v) {
        N = v;
      }},{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }},{get: function () {
        return MS;
      }, set: function (v) {
        MS = v;
      }});
    return Result;
  };
  this.MilliSecondOf = function (AValue) {
    var Result = 0;
    var H = 0;
    var N = 0;
    var S = 0;
    pas.SysUtils.DecodeTime(AValue,{get: function () {
        return H;
      }, set: function (v) {
        H = v;
      }},{get: function () {
        return N;
      }, set: function (v) {
        N = v;
      }},{get: function () {
        return S;
      }, set: function (v) {
        S = v;
      }},{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }});
    return Result;
  };
  this.StartOfTheYear = function (AValue) {
    var Result = 0.0;
    Result = pas.SysUtils.EncodeDate($mod.YearOf(AValue),1,1);
    return Result;
  };
  this.EndOfTheYear = function (AValue) {
    var Result = 0.0;
    Result = $mod.EncodeDateTime($mod.YearOf(AValue),12,31,23,59,59,999);
    return Result;
  };
  this.StartOfAYear = function (AYear) {
    var Result = 0.0;
    Result = pas.SysUtils.EncodeDate(AYear,1,1);
    return Result;
  };
  this.EndOfAYear = function (AYear) {
    var Result = 0.0;
    Result = $mod.EncodeDateTime(AYear,12,31,23,59,59,999);
    return Result;
  };
  this.StartOfTheMonth = function (AValue) {
    var Result = 0.0;
    var Y = 0;
    var M = 0;
    var D = 0;
    pas.SysUtils.DecodeDate(AValue,{get: function () {
        return Y;
      }, set: function (v) {
        Y = v;
      }},{get: function () {
        return M;
      }, set: function (v) {
        M = v;
      }},{get: function () {
        return D;
      }, set: function (v) {
        D = v;
      }});
    Result = pas.SysUtils.EncodeDate(Y,M,1);
    return Result;
  };
  this.EndOfTheMonth = function (AValue) {
    var Result = 0.0;
    var Y = 0;
    var M = 0;
    var D = 0;
    pas.SysUtils.DecodeDate(AValue,{get: function () {
        return Y;
      }, set: function (v) {
        Y = v;
      }},{get: function () {
        return M;
      }, set: function (v) {
        M = v;
      }},{get: function () {
        return D;
      }, set: function (v) {
        D = v;
      }});
    Result = $mod.EncodeDateTime(Y,M,pas.SysUtils.MonthDays[+pas.SysUtils.IsLeapYear(Y)][M - 1],23,59,59,999);
    return Result;
  };
  this.StartOfAMonth = function (AYear, AMonth) {
    var Result = 0.0;
    Result = pas.SysUtils.EncodeDate(AYear,AMonth,1);
    return Result;
  };
  this.EndOfAMonth = function (AYear, AMonth) {
    var Result = 0.0;
    Result = $mod.EncodeDateTime(AYear,AMonth,pas.SysUtils.MonthDays[+pas.SysUtils.IsLeapYear(AYear)][AMonth - 1],23,59,59,999);
    return Result;
  };
  this.StartOfTheWeek = function (AValue) {
    var Result = 0.0;
    Result = (pas.System.Trunc(AValue) - $mod.DayOfTheWeek(AValue)) + 1;
    return Result;
  };
  this.EndOfTheWeek = function (AValue) {
    var Result = 0.0;
    Result = $mod.EndOfTheDay((AValue - $mod.DayOfTheWeek(AValue)) + 7);
    return Result;
  };
  this.StartOfAWeek = function (AYear, AWeekOfYear, ADayOfWeek) {
    var Result = 0.0;
    Result = $mod.EncodeDateWeek(AYear,AWeekOfYear,ADayOfWeek);
    return Result;
  };
  this.StartOfAWeek$1 = function (AYear, AWeekOfYear) {
    var Result = 0.0;
    Result = $mod.StartOfAWeek(AYear,AWeekOfYear,1);
    return Result;
  };
  this.EndOfAWeek = function (AYear, AWeekOfYear, ADayOfWeek) {
    var Result = 0.0;
    Result = $mod.EndOfTheDay($mod.EncodeDateWeek(AYear,AWeekOfYear,ADayOfWeek));
    return Result;
  };
  this.EndOfAWeek$1 = function (AYear, AWeekOfYear) {
    var Result = 0.0;
    Result = $mod.EndOfAWeek(AYear,AWeekOfYear,7);
    return Result;
  };
  this.StartOfTheDay = function (AValue) {
    var Result = 0.0;
    Result = pas.System.Trunc(AValue);
    return Result;
  };
  this.EndOfTheDay = function (AValue) {
    var Result = 0.0;
    var Y = 0;
    var M = 0;
    var D = 0;
    pas.SysUtils.DecodeDate(AValue,{get: function () {
        return Y;
      }, set: function (v) {
        Y = v;
      }},{get: function () {
        return M;
      }, set: function (v) {
        M = v;
      }},{get: function () {
        return D;
      }, set: function (v) {
        D = v;
      }});
    Result = $mod.EncodeDateTime(Y,M,D,23,59,59,999);
    return Result;
  };
  this.StartOfADay = function (AYear, AMonth, ADay) {
    var Result = 0.0;
    Result = pas.SysUtils.EncodeDate(AYear,AMonth,ADay);
    return Result;
  };
  this.StartOfADay$1 = function (AYear, ADayOfYear) {
    var Result = 0.0;
    Result = ($mod.StartOfAYear(AYear) + ADayOfYear) - 1;
    return Result;
  };
  this.EndOfADay = function (AYear, AMonth, ADay) {
    var Result = 0.0;
    Result = $mod.EndOfTheDay(pas.SysUtils.EncodeDate(AYear,AMonth,ADay));
    return Result;
  };
  this.EndOfADay$1 = function (AYear, ADayOfYear) {
    var Result = 0.0;
    Result = (($mod.StartOfAYear(AYear) + ADayOfYear) - 1) + pas.SysUtils.EncodeTime(23,59,59,999);
    return Result;
  };
  this.MonthOfTheYear = function (AValue) {
    var Result = 0;
    Result = $mod.MonthOf(AValue);
    return Result;
  };
  this.WeekOfTheYear = function (AValue) {
    var Result = 0;
    var Y = 0;
    var DOW = 0;
    $mod.DecodeDateWeek(AValue,{get: function () {
        return Y;
      }, set: function (v) {
        Y = v;
      }},{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }},{get: function () {
        return DOW;
      }, set: function (v) {
        DOW = v;
      }});
    return Result;
  };
  this.WeekOfTheYear$1 = function (AValue, AYear) {
    var Result = 0;
    var DOW = 0;
    $mod.DecodeDateWeek(AValue,AYear,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }},{get: function () {
        return DOW;
      }, set: function (v) {
        DOW = v;
      }});
    return Result;
  };
  this.DayOfTheYear = function (AValue) {
    var Result = 0;
    Result = pas.System.Trunc((AValue - $mod.StartOfTheYear(AValue)) + 1);
    return Result;
  };
  this.HourOfTheYear = function (AValue) {
    var Result = 0;
    var H = 0;
    var M = 0;
    var S = 0;
    var MS = 0;
    pas.SysUtils.DecodeTime(AValue,{get: function () {
        return H;
      }, set: function (v) {
        H = v;
      }},{get: function () {
        return M;
      }, set: function (v) {
        M = v;
      }},{get: function () {
        return S;
      }, set: function (v) {
        S = v;
      }},{get: function () {
        return MS;
      }, set: function (v) {
        MS = v;
      }});
    Result = H + (($mod.DayOfTheYear(AValue) - 1) * 24);
    return Result;
  };
  this.MinuteOfTheYear = function (AValue) {
    var Result = 0;
    var H = 0;
    var M = 0;
    var S = 0;
    var MS = 0;
    pas.SysUtils.DecodeTime(AValue,{get: function () {
        return H;
      }, set: function (v) {
        H = v;
      }},{get: function () {
        return M;
      }, set: function (v) {
        M = v;
      }},{get: function () {
        return S;
      }, set: function (v) {
        S = v;
      }},{get: function () {
        return MS;
      }, set: function (v) {
        MS = v;
      }});
    Result = M + ((H + (($mod.DayOfTheYear(AValue) - 1) * 24)) * 60);
    return Result;
  };
  this.SecondOfTheYear = function (AValue) {
    var Result = 0;
    var H = 0;
    var M = 0;
    var S = 0;
    var MS = 0;
    pas.SysUtils.DecodeTime(AValue,{get: function () {
        return H;
      }, set: function (v) {
        H = v;
      }},{get: function () {
        return M;
      }, set: function (v) {
        M = v;
      }},{get: function () {
        return S;
      }, set: function (v) {
        S = v;
      }},{get: function () {
        return MS;
      }, set: function (v) {
        MS = v;
      }});
    Result = ((M + ((H + (($mod.DayOfTheYear(AValue) - 1) * 24)) * 60)) * 60) + S;
    return Result;
  };
  this.MilliSecondOfTheYear = function (AValue) {
    var Result = 0;
    var H = 0;
    var M = 0;
    var S = 0;
    var MS = 0;
    pas.SysUtils.DecodeTime(AValue,{get: function () {
        return H;
      }, set: function (v) {
        H = v;
      }},{get: function () {
        return M;
      }, set: function (v) {
        M = v;
      }},{get: function () {
        return S;
      }, set: function (v) {
        S = v;
      }},{get: function () {
        return MS;
      }, set: function (v) {
        MS = v;
      }});
    Result = ((((M + ((H + (($mod.DayOfTheYear(AValue) - 1) * 24)) * 60)) * 60) + S) * 1000) + MS;
    return Result;
  };
  this.WeekOfTheMonth = function (AValue) {
    var Result = 0;
    var Y = 0;
    var M = 0;
    var DOW = 0;
    $mod.DecodeDateMonthWeek(AValue,{get: function () {
        return Y;
      }, set: function (v) {
        Y = v;
      }},{get: function () {
        return M;
      }, set: function (v) {
        M = v;
      }},{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }},{get: function () {
        return DOW;
      }, set: function (v) {
        DOW = v;
      }});
    return Result;
  };
  this.WeekOfTheMonth$1 = function (AValue, AYear, AMonth) {
    var Result = 0;
    var DOW = 0;
    $mod.DecodeDateMonthWeek(AValue,AYear,AMonth,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }},{get: function () {
        return DOW;
      }, set: function (v) {
        DOW = v;
      }});
    return Result;
  };
  this.DayOfTheMonth = function (AValue) {
    var Result = 0;
    var Y = 0;
    var M = 0;
    pas.SysUtils.DecodeDate(AValue,{get: function () {
        return Y;
      }, set: function (v) {
        Y = v;
      }},{get: function () {
        return M;
      }, set: function (v) {
        M = v;
      }},{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }});
    return Result;
  };
  this.HourOfTheMonth = function (AValue) {
    var Result = 0;
    var Y = 0;
    var M = 0;
    var D = 0;
    var H = 0;
    var N = 0;
    var S = 0;
    var MS = 0;
    $mod.DecodeDateTime(AValue,{get: function () {
        return Y;
      }, set: function (v) {
        Y = v;
      }},{get: function () {
        return M;
      }, set: function (v) {
        M = v;
      }},{get: function () {
        return D;
      }, set: function (v) {
        D = v;
      }},{get: function () {
        return H;
      }, set: function (v) {
        H = v;
      }},{get: function () {
        return N;
      }, set: function (v) {
        N = v;
      }},{get: function () {
        return S;
      }, set: function (v) {
        S = v;
      }},{get: function () {
        return MS;
      }, set: function (v) {
        MS = v;
      }});
    Result = ((D - 1) * 24) + H;
    return Result;
  };
  this.MinuteOfTheMonth = function (AValue) {
    var Result = 0;
    var Y = 0;
    var M = 0;
    var D = 0;
    var H = 0;
    var N = 0;
    var S = 0;
    var MS = 0;
    $mod.DecodeDateTime(AValue,{get: function () {
        return Y;
      }, set: function (v) {
        Y = v;
      }},{get: function () {
        return M;
      }, set: function (v) {
        M = v;
      }},{get: function () {
        return D;
      }, set: function (v) {
        D = v;
      }},{get: function () {
        return H;
      }, set: function (v) {
        H = v;
      }},{get: function () {
        return N;
      }, set: function (v) {
        N = v;
      }},{get: function () {
        return S;
      }, set: function (v) {
        S = v;
      }},{get: function () {
        return MS;
      }, set: function (v) {
        MS = v;
      }});
    Result = ((((D - 1) * 24) + H) * 60) + N;
    return Result;
  };
  this.SecondOfTheMonth = function (AValue) {
    var Result = 0;
    var Y = 0;
    var M = 0;
    var D = 0;
    var H = 0;
    var N = 0;
    var S = 0;
    var MS = 0;
    $mod.DecodeDateTime(AValue,{get: function () {
        return Y;
      }, set: function (v) {
        Y = v;
      }},{get: function () {
        return M;
      }, set: function (v) {
        M = v;
      }},{get: function () {
        return D;
      }, set: function (v) {
        D = v;
      }},{get: function () {
        return H;
      }, set: function (v) {
        H = v;
      }},{get: function () {
        return N;
      }, set: function (v) {
        N = v;
      }},{get: function () {
        return S;
      }, set: function (v) {
        S = v;
      }},{get: function () {
        return MS;
      }, set: function (v) {
        MS = v;
      }});
    Result = ((((((D - 1) * 24) + H) * 60) + N) * 60) + S;
    return Result;
  };
  this.MilliSecondOfTheMonth = function (AValue) {
    var Result = 0;
    var Y = 0;
    var M = 0;
    var D = 0;
    var H = 0;
    var N = 0;
    var S = 0;
    var MS = 0;
    $mod.DecodeDateTime(AValue,{get: function () {
        return Y;
      }, set: function (v) {
        Y = v;
      }},{get: function () {
        return M;
      }, set: function (v) {
        M = v;
      }},{get: function () {
        return D;
      }, set: function (v) {
        D = v;
      }},{get: function () {
        return H;
      }, set: function (v) {
        H = v;
      }},{get: function () {
        return N;
      }, set: function (v) {
        N = v;
      }},{get: function () {
        return S;
      }, set: function (v) {
        S = v;
      }},{get: function () {
        return MS;
      }, set: function (v) {
        MS = v;
      }});
    Result = ((((((((D - 1) * 24) + H) * 60) + N) * 60) + S) * 1000) + MS;
    return Result;
  };
  this.DayOfTheWeek = function (AValue) {
    var Result = 0;
    Result = $impl.DOWMap[pas.SysUtils.DayOfWeek(AValue) - 1];
    return Result;
  };
  this.HourOfTheWeek = function (AValue) {
    var Result = 0;
    var H = 0;
    var M = 0;
    var S = 0;
    var MS = 0;
    pas.SysUtils.DecodeTime(AValue,{get: function () {
        return H;
      }, set: function (v) {
        H = v;
      }},{get: function () {
        return M;
      }, set: function (v) {
        M = v;
      }},{get: function () {
        return S;
      }, set: function (v) {
        S = v;
      }},{get: function () {
        return MS;
      }, set: function (v) {
        MS = v;
      }});
    Result = (($mod.DayOfTheWeek(AValue) - 1) * 24) + H;
    return Result;
  };
  this.MinuteOfTheWeek = function (AValue) {
    var Result = 0;
    var H = 0;
    var M = 0;
    var S = 0;
    var MS = 0;
    pas.SysUtils.DecodeTime(AValue,{get: function () {
        return H;
      }, set: function (v) {
        H = v;
      }},{get: function () {
        return M;
      }, set: function (v) {
        M = v;
      }},{get: function () {
        return S;
      }, set: function (v) {
        S = v;
      }},{get: function () {
        return MS;
      }, set: function (v) {
        MS = v;
      }});
    Result = (((($mod.DayOfTheWeek(AValue) - 1) * 24) + H) * 60) + M;
    return Result;
  };
  this.SecondOfTheWeek = function (AValue) {
    var Result = 0;
    var H = 0;
    var M = 0;
    var S = 0;
    var MS = 0;
    pas.SysUtils.DecodeTime(AValue,{get: function () {
        return H;
      }, set: function (v) {
        H = v;
      }},{get: function () {
        return M;
      }, set: function (v) {
        M = v;
      }},{get: function () {
        return S;
      }, set: function (v) {
        S = v;
      }},{get: function () {
        return MS;
      }, set: function (v) {
        MS = v;
      }});
    Result = (((((($mod.DayOfTheWeek(AValue) - 1) * 24) + H) * 60) + M) * 60) + S;
    return Result;
  };
  this.MilliSecondOfTheWeek = function (AValue) {
    var Result = 0;
    var H = 0;
    var M = 0;
    var S = 0;
    var MS = 0;
    pas.SysUtils.DecodeTime(AValue,{get: function () {
        return H;
      }, set: function (v) {
        H = v;
      }},{get: function () {
        return M;
      }, set: function (v) {
        M = v;
      }},{get: function () {
        return S;
      }, set: function (v) {
        S = v;
      }},{get: function () {
        return MS;
      }, set: function (v) {
        MS = v;
      }});
    Result = (((((((($mod.DayOfTheWeek(AValue) - 1) * 24) + H) * 60) + M) * 60) + S) * 1000) + MS;
    return Result;
  };
  this.HourOfTheDay = function (AValue) {
    var Result = 0;
    Result = $mod.HourOf(AValue);
    return Result;
  };
  this.MinuteOfTheDay = function (AValue) {
    var Result = 0;
    var H = 0;
    var M = 0;
    var S = 0;
    var MS = 0;
    pas.SysUtils.DecodeTime(AValue,{get: function () {
        return H;
      }, set: function (v) {
        H = v;
      }},{get: function () {
        return M;
      }, set: function (v) {
        M = v;
      }},{get: function () {
        return S;
      }, set: function (v) {
        S = v;
      }},{get: function () {
        return MS;
      }, set: function (v) {
        MS = v;
      }});
    Result = (H * 60) + M;
    return Result;
  };
  this.SecondOfTheDay = function (AValue) {
    var Result = 0;
    var H = 0;
    var M = 0;
    var S = 0;
    var MS = 0;
    pas.SysUtils.DecodeTime(AValue,{get: function () {
        return H;
      }, set: function (v) {
        H = v;
      }},{get: function () {
        return M;
      }, set: function (v) {
        M = v;
      }},{get: function () {
        return S;
      }, set: function (v) {
        S = v;
      }},{get: function () {
        return MS;
      }, set: function (v) {
        MS = v;
      }});
    Result = (((H * 60) + M) * 60) + S;
    return Result;
  };
  this.MilliSecondOfTheDay = function (AValue) {
    var Result = 0;
    var H = 0;
    var M = 0;
    var S = 0;
    var MS = 0;
    pas.SysUtils.DecodeTime(AValue,{get: function () {
        return H;
      }, set: function (v) {
        H = v;
      }},{get: function () {
        return M;
      }, set: function (v) {
        M = v;
      }},{get: function () {
        return S;
      }, set: function (v) {
        S = v;
      }},{get: function () {
        return MS;
      }, set: function (v) {
        MS = v;
      }});
    Result = (((((H * 60) + M) * 60) + S) * 1000) + MS;
    return Result;
  };
  this.MinuteOfTheHour = function (AValue) {
    var Result = 0;
    Result = $mod.MinuteOf(AValue);
    return Result;
  };
  this.SecondOfTheHour = function (AValue) {
    var Result = 0;
    var H = 0;
    var S = 0;
    var M = 0;
    var MS = 0;
    pas.SysUtils.DecodeTime(AValue,{get: function () {
        return H;
      }, set: function (v) {
        H = v;
      }},{get: function () {
        return M;
      }, set: function (v) {
        M = v;
      }},{get: function () {
        return S;
      }, set: function (v) {
        S = v;
      }},{get: function () {
        return MS;
      }, set: function (v) {
        MS = v;
      }});
    Result = (M * 60) + S;
    return Result;
  };
  this.MilliSecondOfTheHour = function (AValue) {
    var Result = 0;
    var H = 0;
    var S = 0;
    var M = 0;
    var MS = 0;
    pas.SysUtils.DecodeTime(AValue,{get: function () {
        return H;
      }, set: function (v) {
        H = v;
      }},{get: function () {
        return M;
      }, set: function (v) {
        M = v;
      }},{get: function () {
        return S;
      }, set: function (v) {
        S = v;
      }},{get: function () {
        return MS;
      }, set: function (v) {
        MS = v;
      }});
    Result = (((M * 60) + S) * 1000) + MS;
    return Result;
  };
  this.SecondOfTheMinute = function (AValue) {
    var Result = 0;
    Result = $mod.SecondOf(AValue);
    return Result;
  };
  this.MilliSecondOfTheMinute = function (AValue) {
    var Result = 0;
    var H = 0;
    var S = 0;
    var M = 0;
    var MS = 0;
    pas.SysUtils.DecodeTime(AValue,{get: function () {
        return H;
      }, set: function (v) {
        H = v;
      }},{get: function () {
        return M;
      }, set: function (v) {
        M = v;
      }},{get: function () {
        return S;
      }, set: function (v) {
        S = v;
      }},{get: function () {
        return MS;
      }, set: function (v) {
        MS = v;
      }});
    Result = (S * 1000) + MS;
    return Result;
  };
  this.MilliSecondOfTheSecond = function (AValue) {
    var Result = 0;
    Result = $mod.MilliSecondOf(AValue);
    return Result;
  };
  this.WithinPastYears = function (ANow, AThen, AYears) {
    var Result = false;
    Result = $mod.YearsBetween(ANow,AThen,false) <= AYears;
    return Result;
  };
  this.WithinPastMonths = function (ANow, AThen, AMonths) {
    var Result = false;
    Result = $mod.MonthsBetween(ANow,AThen,false) <= AMonths;
    return Result;
  };
  this.WithinPastWeeks = function (ANow, AThen, AWeeks) {
    var Result = false;
    Result = $mod.WeeksBetween(ANow,AThen) <= AWeeks;
    return Result;
  };
  this.WithinPastDays = function (ANow, AThen, ADays) {
    var Result = false;
    Result = $mod.DaysBetween(ANow,AThen) <= ADays;
    return Result;
  };
  this.WithinPastHours = function (ANow, AThen, AHours) {
    var Result = false;
    Result = $mod.HoursBetween(ANow,AThen) <= AHours;
    return Result;
  };
  this.WithinPastMinutes = function (ANow, AThen, AMinutes) {
    var Result = false;
    Result = $mod.MinutesBetween(ANow,AThen) <= AMinutes;
    return Result;
  };
  this.WithinPastSeconds = function (ANow, AThen, ASeconds) {
    var Result = false;
    Result = $mod.SecondsBetween(ANow,AThen) <= ASeconds;
    return Result;
  };
  this.WithinPastMilliSeconds = function (ANow, AThen, AMilliSeconds) {
    var Result = false;
    Result = $mod.MilliSecondsBetween(ANow,AThen) <= AMilliSeconds;
    return Result;
  };
  this.YearsBetween = function (ANow, AThen, AExact) {
    var Result = 0;
    var yy = 0;
    var mm = 0;
    var dd = 0;
    if (AExact && (ANow >= -693594) && (AThen >= -693594) && (ANow <= pas.SysUtils.MaxDateTime) && (AThen <= pas.SysUtils.MaxDateTime)) {
      $mod.PeriodBetween(ANow,AThen,{get: function () {
          return yy;
        }, set: function (v) {
          yy = v;
        }},{get: function () {
          return mm;
        }, set: function (v) {
          mm = v;
        }},{get: function () {
          return dd;
        }, set: function (v) {
          dd = v;
        }});
      Result = yy;
    } else Result = pas.System.Trunc((Math.abs($impl.DateTimeDiff(ANow,AThen)) + 5.7870370370370369E-9) / $mod.ApproxDaysPerYear);
    return Result;
  };
  this.MonthsBetween = function (ANow, AThen, AExact) {
    var Result = 0;
    var y = 0;
    var m = 0;
    var d = 0;
    if (AExact && (ANow >= -693594) && (AThen >= -693594) && (ANow <= pas.SysUtils.MaxDateTime) && (AThen <= pas.SysUtils.MaxDateTime)) {
      $mod.PeriodBetween(ANow,AThen,{get: function () {
          return y;
        }, set: function (v) {
          y = v;
        }},{get: function () {
          return m;
        }, set: function (v) {
          m = v;
        }},{get: function () {
          return d;
        }, set: function (v) {
          d = v;
        }});
      Result = (y * 12) + m;
    } else Result = pas.System.Trunc((Math.abs($impl.DateTimeDiff(ANow,AThen)) + 5.7870370370370369E-9) / $mod.ApproxDaysPerMonth);
    return Result;
  };
  this.WeeksBetween = function (ANow, AThen) {
    var Result = 0;
    Result = rtl.trunc(pas.System.Trunc(Math.abs($impl.DateTimeDiff(ANow,AThen)) + 5.7870370370370369E-9) / 7);
    return Result;
  };
  this.DaysBetween = function (ANow, AThen) {
    var Result = 0;
    Result = pas.System.Trunc(Math.abs($impl.DateTimeDiff(ANow,AThen)) + 5.7870370370370369E-9);
    return Result;
  };
  this.HoursBetween = function (ANow, AThen) {
    var Result = 0;
    Result = pas.System.Trunc((Math.abs($impl.DateTimeDiff(ANow,AThen)) + 5.7870370370370369E-9) * 24);
    return Result;
  };
  this.MinutesBetween = function (ANow, AThen) {
    var Result = 0;
    Result = pas.System.Trunc((Math.abs($impl.DateTimeDiff(ANow,AThen)) + 5.7870370370370369E-9) * 1440);
    return Result;
  };
  this.SecondsBetween = function (ANow, AThen) {
    var Result = 0;
    Result = pas.System.Trunc((Math.abs($impl.DateTimeDiff(ANow,AThen)) + 5.7870370370370369E-9) * 86400);
    return Result;
  };
  this.MilliSecondsBetween = function (ANow, AThen) {
    var Result = 0;
    Result = pas.System.Trunc((Math.abs($impl.DateTimeDiff(ANow,AThen)) + 5.7870370370370369E-9) * 86400000);
    return Result;
  };
  this.PeriodBetween = function (ANow, AThen, Years, months, days) {
    var Y1 = 0;
    var Y2 = 0;
    var M1 = 0;
    var M2 = 0;
    var D1 = 0;
    var D2 = 0;
    if (AThen > ANow) {
      pas.SysUtils.DecodeDate(ANow,{get: function () {
          return Y1;
        }, set: function (v) {
          Y1 = v;
        }},{get: function () {
          return M1;
        }, set: function (v) {
          M1 = v;
        }},{get: function () {
          return D1;
        }, set: function (v) {
          D1 = v;
        }});
      pas.SysUtils.DecodeDate(AThen,{get: function () {
          return Y2;
        }, set: function (v) {
          Y2 = v;
        }},{get: function () {
          return M2;
        }, set: function (v) {
          M2 = v;
        }},{get: function () {
          return D2;
        }, set: function (v) {
          D2 = v;
        }});
    } else {
      pas.SysUtils.DecodeDate(AThen,{get: function () {
          return Y1;
        }, set: function (v) {
          Y1 = v;
        }},{get: function () {
          return M1;
        }, set: function (v) {
          M1 = v;
        }},{get: function () {
          return D1;
        }, set: function (v) {
          D1 = v;
        }});
      pas.SysUtils.DecodeDate(ANow,{get: function () {
          return Y2;
        }, set: function (v) {
          Y2 = v;
        }},{get: function () {
          return M2;
        }, set: function (v) {
          M2 = v;
        }},{get: function () {
          return D2;
        }, set: function (v) {
          D2 = v;
        }});
    };
    Years.set(Y2 - Y1);
    if ((M1 > M2) || ((M1 === M2) && (D1 > D2))) Years.set(Years.get() - 1);
    if (M1 > M2) M2 += 12;
    months.set(M2 - M1);
    if (D2 >= D1) {
      days.set(D2 - D1)}
     else {
      if (months.get() === 0) {
        months.set(11)}
       else months.set(months.get() - 1);
      days.set(($mod.DaysInAMonth(Y1,M1) - D1) + D2);
    };
  };
  this.YearSpan = function (ANow, AThen) {
    var Result = 0.0;
    Result = Math.abs($impl.DateTimeDiff(ANow,AThen)) / $mod.ApproxDaysPerYear;
    return Result;
  };
  this.MonthSpan = function (ANow, AThen) {
    var Result = 0.0;
    Result = Math.abs($impl.DateTimeDiff(ANow,AThen)) / $mod.ApproxDaysPerMonth;
    return Result;
  };
  this.WeekSpan = function (ANow, AThen) {
    var Result = 0.0;
    Result = Math.abs($impl.DateTimeDiff(ANow,AThen)) / 7;
    return Result;
  };
  this.DaySpan = function (ANow, AThen) {
    var Result = 0.0;
    Result = Math.abs($impl.DateTimeDiff(ANow,AThen));
    return Result;
  };
  this.HourSpan = function (ANow, AThen) {
    var Result = 0.0;
    Result = Math.abs($impl.DateTimeDiff(ANow,AThen)) * 24;
    return Result;
  };
  this.MinuteSpan = function (ANow, AThen) {
    var Result = 0.0;
    Result = Math.abs($impl.DateTimeDiff(ANow,AThen)) * 1440;
    return Result;
  };
  this.SecondSpan = function (ANow, AThen) {
    var Result = 0.0;
    Result = Math.abs($impl.DateTimeDiff(ANow,AThen)) * 86400;
    return Result;
  };
  this.MilliSecondSpan = function (ANow, AThen) {
    var Result = 0.0;
    Result = Math.abs($impl.DateTimeDiff(ANow,AThen)) * 86400000;
    return Result;
  };
  this.IncYear = function (AValue, ANumberOfYears) {
    var Result = 0.0;
    var Y = 0;
    var M = 0;
    var D = 0;
    var H = 0;
    var N = 0;
    var S = 0;
    var MS = 0;
    $mod.DecodeDateTime(AValue,{get: function () {
        return Y;
      }, set: function (v) {
        Y = v;
      }},{get: function () {
        return M;
      }, set: function (v) {
        M = v;
      }},{get: function () {
        return D;
      }, set: function (v) {
        D = v;
      }},{get: function () {
        return H;
      }, set: function (v) {
        H = v;
      }},{get: function () {
        return N;
      }, set: function (v) {
        N = v;
      }},{get: function () {
        return S;
      }, set: function (v) {
        S = v;
      }},{get: function () {
        return MS;
      }, set: function (v) {
        MS = v;
      }});
    Y = Y + ANumberOfYears;
    if ((M === 2) && (D === 29) && !pas.SysUtils.IsLeapYear(Y)) D = 28;
    Result = $mod.EncodeDateTime(Y,M,D,H,N,S,MS);
    return Result;
  };
  this.IncYear$1 = function (AValue) {
    var Result = 0.0;
    Result = $mod.IncYear(AValue,1);
    return Result;
  };
  this.IncWeek = function (AValue, ANumberOfWeeks) {
    var Result = 0.0;
    Result = AValue + (ANumberOfWeeks * 7);
    $impl.MaybeSkipTimeWarp(AValue,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }});
    return Result;
  };
  this.IncWeek$1 = function (AValue) {
    var Result = 0.0;
    Result = $mod.IncWeek(AValue,1);
    return Result;
  };
  this.IncDay = function (AValue, ANumberOfDays) {
    var Result = 0.0;
    Result = AValue + ANumberOfDays;
    $impl.MaybeSkipTimeWarp(AValue,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }});
    return Result;
  };
  this.IncDay$1 = function (AValue) {
    var Result = 0.0;
    Result = $mod.IncDay(AValue,1);
    return Result;
  };
  this.IncHour = function (AValue, ANumberOfHours) {
    var Result = 0.0;
    if (AValue >= 0) {
      Result = AValue + (ANumberOfHours / 24)}
     else Result = $impl.IncNegativeTime(AValue,ANumberOfHours / 24);
    $impl.MaybeSkipTimeWarp(AValue,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }});
    return Result;
  };
  this.IncHour$1 = function (AValue) {
    var Result = 0.0;
    Result = $mod.IncHour(AValue,1);
    return Result;
  };
  this.IncMinute = function (AValue, ANumberOfMinutes) {
    var Result = 0.0;
    if (AValue >= 0) {
      Result = AValue + (ANumberOfMinutes / 1440)}
     else Result = $impl.IncNegativeTime(AValue,ANumberOfMinutes / 1440);
    $impl.MaybeSkipTimeWarp(AValue,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }});
    return Result;
  };
  this.IncMinute$1 = function (AValue) {
    var Result = 0.0;
    Result = $mod.IncMinute(AValue,1);
    return Result;
  };
  this.IncSecond = function (AValue, ANumberOfSeconds) {
    var Result = 0.0;
    if (AValue >= 0) {
      Result = AValue + (ANumberOfSeconds / 86400)}
     else Result = $impl.IncNegativeTime(AValue,ANumberOfSeconds / 86400);
    $impl.MaybeSkipTimeWarp(AValue,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }});
    return Result;
  };
  this.IncSecond$1 = function (AValue) {
    var Result = 0.0;
    Result = $mod.IncSecond(AValue,1);
    return Result;
  };
  this.IncMilliSecond = function (AValue, ANumberOfMilliSeconds) {
    var Result = 0.0;
    if (AValue >= 0) {
      Result = AValue + (ANumberOfMilliSeconds / 86400000)}
     else Result = $impl.IncNegativeTime(AValue,ANumberOfMilliSeconds / 86400000);
    $impl.MaybeSkipTimeWarp(AValue,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }});
    return Result;
  };
  this.IncMilliSecond$1 = function (AValue) {
    var Result = 0.0;
    Result = $mod.IncMilliSecond(AValue,1);
    return Result;
  };
  this.EncodeDateTime = function (AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond) {
    var Result = 0.0;
    if (!$mod.TryEncodeDateTime(AYear,AMonth,ADay,AHour,AMinute,ASecond,AMilliSecond,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }})) $mod.InvalidDateTimeError$1(AYear,AMonth,ADay,AHour,AMinute,ASecond,AMilliSecond);
    return Result;
  };
  this.DecodeDateTime = function (AValue, AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond) {
    pas.SysUtils.DecodeTime(AValue,AHour,AMinute,ASecond,AMilliSecond);
    if (AHour.get() === 24) {
      AHour.set(0);
      pas.SysUtils.DecodeDate(Math.round(AValue),AYear,AMonth,ADay);
    } else pas.SysUtils.DecodeDate(AValue,AYear,AMonth,ADay);
  };
  this.TryEncodeDateTime = function (AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond, AValue) {
    var Result = false;
    var tmp = 0.0;
    Result = pas.SysUtils.TryEncodeDate(AYear,AMonth,ADay,AValue);
    Result = Result && pas.SysUtils.TryEncodeTime(AHour,AMinute,ASecond,AMilliSecond,{get: function () {
        return tmp;
      }, set: function (v) {
        tmp = v;
      }});
    if (Result) AValue.set(pas.SysUtils.ComposeDateTime(AValue.get(),tmp));
    return Result;
  };
  this.EncodeDateWeek = function (AYear, AWeekOfYear, ADayOfWeek) {
    var Result = 0.0;
    if (!$mod.TryEncodeDateWeek(AYear,AWeekOfYear,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }},ADayOfWeek)) $mod.InvalidDateWeekError(AYear,AWeekOfYear,ADayOfWeek);
    return Result;
  };
  this.EncodeDateWeek$1 = function (AYear, AWeekOfYear) {
    var Result = 0.0;
    Result = $mod.EncodeDateWeek(AYear,AWeekOfYear,1);
    return Result;
  };
  this.DecodeDateWeek = function (AValue, AYear, AWeekOfYear, ADayOfWeek) {
    var DOY = 0;
    var D = 0;
    var YS = 0.0;
    var YSDOW = 0;
    var YEDOW = 0;
    AYear.set($mod.YearOf(AValue));
    ADayOfWeek.set(pas.SysUtils.DayOfWeek(AValue) - 1);
    if (ADayOfWeek.get() === 0) ADayOfWeek.set(7);
    YS = $mod.StartOfAYear(AYear.get());
    DOY = pas.System.Trunc(AValue - YS) + 1;
    YSDOW = $mod.DayOfTheWeek(YS);
    if (YSDOW < 5) {
      DOY += YSDOW - 1}
     else DOY -= 8 - YSDOW;
    if (DOY <= 0) {
      $mod.DecodeDateWeek(YS - 1,AYear,AWeekOfYear,{get: function () {
          return D;
        }, set: function (v) {
          D = v;
        }})}
     else {
      AWeekOfYear.set(rtl.trunc(DOY / 7));
      if ((DOY % 7) !== 0) AWeekOfYear.set(AWeekOfYear.get() + 1);
      if (AWeekOfYear.get() > 52) {
        YEDOW = YSDOW;
        if (pas.SysUtils.IsLeapYear(AYear.get())) {
          YEDOW += 1;
          if (YEDOW > 7) YEDOW = 1;
        };
        if (YEDOW < 4) {
          AYear.set(AYear.get() + 1);
          AWeekOfYear.set(1);
        };
      };
    };
  };
  this.TryEncodeDateWeek = function (AYear, AWeekOfYear, AValue, ADayOfWeek) {
    var Result = false;
    var DOW = 0;
    var Rest = 0;
    Result = $mod.IsValidDateWeek(AYear,AWeekOfYear,ADayOfWeek);
    if (Result) {
      AValue.set(pas.SysUtils.EncodeDate(AYear,1,1) + (7 * (AWeekOfYear - 1)));
      DOW = $mod.DayOfTheWeek(AValue.get());
      Rest = ADayOfWeek - DOW;
      if (DOW > 4) Rest += 7;
      AValue.set(AValue.get() + Rest);
    };
    return Result;
  };
  this.TryEncodeDateWeek$1 = function (AYear, AWeekOfYear, AValue) {
    var Result = false;
    Result = $mod.TryEncodeDateWeek(AYear,AWeekOfYear,AValue,1);
    return Result;
  };
  this.EncodeDateDay = function (AYear, ADayOfYear) {
    var Result = 0.0;
    if (!$mod.TryEncodeDateDay(AYear,ADayOfYear,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }})) $mod.InvalidDateDayError(AYear,ADayOfYear);
    return Result;
  };
  this.DecodeDateDay = function (AValue, AYear, ADayOfYear) {
    var M = 0;
    var D = 0;
    pas.SysUtils.DecodeDate(AValue,AYear,{get: function () {
        return M;
      }, set: function (v) {
        M = v;
      }},{get: function () {
        return D;
      }, set: function (v) {
        D = v;
      }});
    ADayOfYear.set(pas.System.Trunc(AValue - pas.SysUtils.EncodeDate(AYear.get(),1,1)) + 1);
  };
  this.TryEncodeDateDay = function (AYear, ADayOfYear, AValue) {
    var Result = false;
    Result = (ADayOfYear !== 0) && (ADayOfYear <= $mod.DaysPerYear[+pas.SysUtils.IsLeapYear(AYear)]);
    if (Result) AValue.set((pas.SysUtils.EncodeDate(AYear,1,1) + ADayOfYear) - 1);
    return Result;
  };
  this.EncodeDateMonthWeek = function (AYear, AMonth, AWeekOfMonth, ADayOfWeek) {
    var Result = 0.0;
    if (!$mod.TryEncodeDateMonthWeek(AYear,AMonth,AWeekOfMonth,ADayOfWeek,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }})) $mod.InvalidDateMonthWeekError(AYear,AMonth,AWeekOfMonth,ADayOfWeek);
    return Result;
  };
  this.DecodeDateMonthWeek = function (AValue, AYear, AMonth, AWeekOfMonth, ADayOfWeek) {
    var D = 0;
    var SDOM = 0;
    var EDOM = 0;
    var SOM = 0.0;
    var DOM = 0;
    pas.SysUtils.DecodeDate(AValue,AYear,AMonth,{get: function () {
        return D;
      }, set: function (v) {
        D = v;
      }});
    ADayOfWeek.set($mod.DayOfTheWeek(AValue));
    SOM = pas.SysUtils.EncodeDate(AYear.get(),AMonth.get(),1);
    SDOM = $mod.DayOfTheWeek(SOM);
    DOM = (D - 1) + SDOM;
    if (SDOM > 4) DOM -= 7;
    if (DOM <= 0) {
      $mod.DecodeDateMonthWeek(SOM - 1,AYear,AMonth,AWeekOfMonth,{get: function () {
          return D;
        }, set: function (v) {
          D = v;
        }})}
     else {
      AWeekOfMonth.set(rtl.trunc(DOM / 7));
      if ((DOM % 7) !== 0) AWeekOfMonth.set(AWeekOfMonth.get() + 1);
      EDOM = $mod.DayOfTheWeek($mod.EndOfAMonth(AYear.get(),AMonth.get()));
      if ((EDOM < 4) && (($mod.DaysInAMonth(AYear.get(),AMonth.get()) - D) < EDOM)) {
        AWeekOfMonth.set(1);
        AMonth.set(AMonth.get() + 1);
        if (AMonth.get() === 13) {
          AMonth.set(1);
          AYear.set(AYear.get() + 1);
        };
      };
    };
  };
  this.TryEncodeDateMonthWeek = function (AYear, AMonth, AWeekOfMonth, ADayOfWeek, AValue) {
    var Result = false;
    var S = 0;
    var DOM = 0;
    Result = $mod.IsValidDateMonthWeek(AYear,AMonth,AWeekOfMonth,ADayOfWeek);
    if (Result) {
      AValue.set(pas.SysUtils.EncodeDate(AYear,AMonth,1));
      DOM = (((AWeekOfMonth - 1) * 7) + ADayOfWeek) - 1;
      S = $mod.DayOfTheWeek(AValue.get());
      DOM -= S - 1;
      if ((S === 5) || (S === 6) || (S === 7)) DOM += 7;
      AValue.set(AValue.get() + DOM);
    };
    return Result;
  };
  this.TryEncodeTimeInterval = function (Hour, Min, Sec, MSec, Time) {
    var Result = false;
    Result = (Min < 60) && (Sec < 60) && (MSec < 1000);
    if (Result) Time.set(((Hour * 3600000) + (Min * 60000) + (Sec * 1000) + MSec) / 86400000);
    return Result;
  };
  this.EncodeTimeInterval = function (Hour, Minute, Second, MilliSecond) {
    var Result = 0.0;
    if (!$mod.TryEncodeTimeInterval(Hour,Minute,Second,MilliSecond,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }})) throw pas.SysUtils.EConvertError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SErrInvalidHourMinuteSecMsec"),pas.System.VarRecs(0,Hour,0,Minute,0,Second,0,MilliSecond)]);
    return Result;
  };
  this.RecodeYear = function (AValue, AYear) {
    var Result = 0.0;
    Result = $mod.RecodeDateTime(AValue,AYear,65535,65535,65535,65535,65535,65535);
    return Result;
  };
  this.RecodeMonth = function (AValue, AMonth) {
    var Result = 0.0;
    Result = $mod.RecodeDateTime(AValue,65535,AMonth,65535,65535,65535,65535,65535);
    return Result;
  };
  this.RecodeDay = function (AValue, ADay) {
    var Result = 0.0;
    Result = $mod.RecodeDateTime(AValue,65535,65535,ADay,65535,65535,65535,65535);
    return Result;
  };
  this.RecodeHour = function (AValue, AHour) {
    var Result = 0.0;
    Result = $mod.RecodeDateTime(AValue,65535,65535,65535,AHour,65535,65535,65535);
    return Result;
  };
  this.RecodeMinute = function (AValue, AMinute) {
    var Result = 0.0;
    Result = $mod.RecodeDateTime(AValue,65535,65535,65535,65535,AMinute,65535,65535);
    return Result;
  };
  this.RecodeSecond = function (AValue, ASecond) {
    var Result = 0.0;
    Result = $mod.RecodeDateTime(AValue,65535,65535,65535,65535,65535,ASecond,65535);
    return Result;
  };
  this.RecodeMilliSecond = function (AValue, AMilliSecond) {
    var Result = 0.0;
    Result = $mod.RecodeDateTime(AValue,65535,65535,65535,65535,65535,65535,AMilliSecond);
    return Result;
  };
  this.RecodeDate = function (AValue, AYear, AMonth, ADay) {
    var Result = 0.0;
    Result = $mod.RecodeDateTime(AValue,AYear,AMonth,ADay,65535,65535,65535,65535);
    return Result;
  };
  this.RecodeTime = function (AValue, AHour, AMinute, ASecond, AMilliSecond) {
    var Result = 0.0;
    Result = $mod.RecodeDateTime(AValue,65535,65535,65535,AHour,AMinute,ASecond,AMilliSecond);
    return Result;
  };
  this.RecodeDateTime = function (AValue, AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond) {
    var Result = 0.0;
    if (!$mod.TryRecodeDateTime(AValue,AYear,AMonth,ADay,AHour,AMinute,ASecond,AMilliSecond,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }})) $mod.InvalidDateTimeError(AYear,AMonth,ADay,AHour,AMinute,ASecond,AMilliSecond,AValue);
    return Result;
  };
  this.TryRecodeDateTime = function (AValue, AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond, AResult) {
    var Result = false;
    function FV(AV, Arg) {
      if (Arg !== 65535) AV.set(Arg);
    };
    var Y = 0;
    var M = 0;
    var D = 0;
    var H = 0;
    var N = 0;
    var S = 0;
    var MS = 0;
    $mod.DecodeDateTime(AValue,{get: function () {
        return Y;
      }, set: function (v) {
        Y = v;
      }},{get: function () {
        return M;
      }, set: function (v) {
        M = v;
      }},{get: function () {
        return D;
      }, set: function (v) {
        D = v;
      }},{get: function () {
        return H;
      }, set: function (v) {
        H = v;
      }},{get: function () {
        return N;
      }, set: function (v) {
        N = v;
      }},{get: function () {
        return S;
      }, set: function (v) {
        S = v;
      }},{get: function () {
        return MS;
      }, set: function (v) {
        MS = v;
      }});
    FV({get: function () {
        return Y;
      }, set: function (v) {
        Y = v;
      }},AYear);
    FV({get: function () {
        return M;
      }, set: function (v) {
        M = v;
      }},AMonth);
    FV({get: function () {
        return D;
      }, set: function (v) {
        D = v;
      }},ADay);
    FV({get: function () {
        return H;
      }, set: function (v) {
        H = v;
      }},AHour);
    FV({get: function () {
        return N;
      }, set: function (v) {
        N = v;
      }},AMinute);
    FV({get: function () {
        return S;
      }, set: function (v) {
        S = v;
      }},ASecond);
    FV({get: function () {
        return MS;
      }, set: function (v) {
        MS = v;
      }},AMilliSecond);
    Result = $mod.TryEncodeDateTime(Y,M,D,H,N,S,MS,AResult);
    return Result;
  };
  this.CompareDateTime = function (A, B) {
    var Result = 0;
    if ($mod.SameDateTime(A,B)) {
      Result = 0}
     else if (pas.System.Trunc(A) === pas.System.Trunc(B)) {
      if (Math.abs(pas.System.Frac(A)) > Math.abs(pas.System.Frac(B))) {
        Result = 1}
       else Result = -1;
    } else {
      if (A > B) {
        Result = 1}
       else Result = -1;
    };
    return Result;
  };
  this.CompareDate = function (A, B) {
    var Result = 0;
    if ($mod.SameDate(A,B)) {
      Result = 0}
     else if (A < B) {
      Result = -1}
     else Result = 1;
    return Result;
  };
  this.CompareTime = function (A, B) {
    var Result = 0;
    if ($mod.SameTime(A,B)) {
      Result = 0}
     else if (pas.System.Frac(A) < pas.System.Frac(B)) {
      Result = -1}
     else Result = 1;
    return Result;
  };
  this.SameDateTime = function (A, B) {
    var Result = false;
    Result = Math.abs(A - B) < 1.1574074074074074E-8;
    return Result;
  };
  this.SameDate = function (A, B) {
    var Result = false;
    Result = pas.System.Trunc(A) === pas.System.Trunc(B);
    return Result;
  };
  this.SameTime = function (A, B) {
    var Result = false;
    Result = pas.System.Frac(Math.abs(A - B)) < 1.1574074074074074E-8;
    return Result;
  };
  this.NthDayOfWeek = function (AValue) {
    var Result = 0;
    Result = $impl.InternalNthDayOfWeek($mod.DayOfTheMonth(AValue));
    return Result;
  };
  this.DecodeDayOfWeekInMonth = function (AValue, AYear, AMonth, ANthDayOfWeek, ADayOfWeek) {
    var D = 0;
    pas.SysUtils.DecodeDate(AValue,AYear,AMonth,{get: function () {
        return D;
      }, set: function (v) {
        D = v;
      }});
    ADayOfWeek.set($mod.DayOfTheWeek(AValue));
    ANthDayOfWeek.set($impl.InternalNthDayOfWeek(D));
  };
  this.EncodeDayOfWeekInMonth = function (AYear, AMonth, ANthDayOfWeek, ADayOfWeek) {
    var Result = 0.0;
    if (!$mod.TryEncodeDayOfWeekInMonth(AYear,AMonth,ANthDayOfWeek,ADayOfWeek,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }})) $mod.InvalidDayOfWeekInMonthError(AYear,AMonth,ANthDayOfWeek,ADayOfWeek);
    return Result;
  };
  this.TryEncodeDayOfWeekInMonth = function (AYear, AMonth, ANthDayOfWeek, ADayOfWeek, AValue) {
    var Result = false;
    var SOM = 0;
    var D = 0;
    SOM = $mod.DayOfTheWeek(pas.SysUtils.EncodeDate(AYear,AMonth,1));
    D = ((1 + ADayOfWeek) - SOM) + (7 * (ANthDayOfWeek - 1));
    if (SOM > ADayOfWeek) D = D + 7;
    Result = pas.SysUtils.TryEncodeDate(AYear,AMonth,D,AValue);
    return Result;
  };
  this.InvalidDateTimeError = function (AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond, ABaseDate) {
    function DoField(Arg, Def, Unknown) {
      var Result = "";
      if (Def === 0) ;
      if (Arg !== 65535) {
        Result = pas.SysUtils.Format("%.*d",pas.System.VarRecs(19,Unknown.length,0,Arg))}
       else if (ABaseDate === 0) {
        Result = Unknown}
       else Result = pas.SysUtils.Format("%.*d",pas.System.VarRecs(19,Unknown.length,0,Arg));
      return Result;
    };
    var Y = 0;
    var M = 0;
    var D = 0;
    var H = 0;
    var N = 0;
    var S = 0;
    var MS = 0;
    var Msg = "";
    $mod.DecodeDateTime(ABaseDate,{get: function () {
        return Y;
      }, set: function (v) {
        Y = v;
      }},{get: function () {
        return M;
      }, set: function (v) {
        M = v;
      }},{get: function () {
        return D;
      }, set: function (v) {
        D = v;
      }},{get: function () {
        return H;
      }, set: function (v) {
        H = v;
      }},{get: function () {
        return N;
      }, set: function (v) {
        N = v;
      }},{get: function () {
        return S;
      }, set: function (v) {
        S = v;
      }},{get: function () {
        return MS;
      }, set: function (v) {
        MS = v;
      }});
    Msg = DoField(AYear,Y,"????");
    Msg = Msg + pas.SysUtils.FormatSettings.DateSeparator + DoField(AMonth,M,"??");
    Msg = Msg + pas.SysUtils.FormatSettings.DateSeparator + DoField(ADay,D,"??");
    Msg = Msg + " " + DoField(AHour,H,"??");
    Msg = Msg + pas.SysUtils.FormatSettings.TimeSeparator + DoField(AMinute,N,"??");
    Msg = Msg + pas.SysUtils.FormatSettings.TimeSeparator + DoField(ASecond,S,"??");
    Msg = Msg + pas.SysUtils.FormatSettings.DecimalSeparator + DoField(AMilliSecond,MS,"???");
    throw pas.SysUtils.EConvertError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SErrInvalidTimeStamp"),pas.System.VarRecs(18,Msg)]);
  };
  this.InvalidDateTimeError$1 = function (AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond) {
    $mod.InvalidDateTimeError(AYear,AMonth,ADay,AHour,AMinute,ASecond,AMilliSecond,0);
  };
  this.InvalidDateWeekError = function (AYear, AWeekOfYear, ADayOfWeek) {
    throw pas.SysUtils.EConvertError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SErrInvalidDateWeek"),pas.System.VarRecs(0,AYear,0,AWeekOfYear,0,ADayOfWeek)]);
  };
  this.InvalidDateDayError = function (AYear, ADayOfYear) {
    throw pas.SysUtils.EConvertError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SErrInvalidDayOfYear"),pas.System.VarRecs(0,AYear,0,ADayOfYear)]);
  };
  this.InvalidDateMonthWeekError = function (AYear, AMonth, AWeekOfMonth, ADayOfWeek) {
    throw pas.SysUtils.EConvertError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SErrInvalidDateMonthWeek"),pas.System.VarRecs(0,AYear,0,AMonth,0,AWeekOfMonth,0,ADayOfWeek)]);
  };
  this.InvalidDayOfWeekInMonthError = function (AYear, AMonth, ANthDayOfWeek, ADayOfWeek) {
    throw pas.SysUtils.EConvertError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SErrInvalidDayOfWeekInMonth"),pas.System.VarRecs(0,AYear,0,AMonth,0,ANthDayOfWeek,0,ADayOfWeek)]);
  };
  this.DateTimeToJulianDate = function (AValue) {
    var Result = 0.0;
    var day = 0;
    var month = 0;
    var year = 0;
    var a = 0;
    var y = 0;
    var m = 0;
    pas.SysUtils.DecodeDate(AValue,{get: function () {
        return year;
      }, set: function (v) {
        year = v;
      }},{get: function () {
        return month;
      }, set: function (v) {
        month = v;
      }},{get: function () {
        return day;
      }, set: function (v) {
        day = v;
      }});
    a = rtl.trunc((14 - month) / 12);
    y = (year + 4800) - a;
    m = (month + (12 * a)) - 3;
    Result = ((((day + rtl.trunc(((153 * m) + 2) / 5) + (365 * y) + rtl.trunc(y / 4)) - rtl.trunc(y / 100)) + rtl.trunc(y / 400)) - 32045.5) + pas.System.Frac(AValue);
    return Result;
  };
  this.JulianDateToDateTime = function (AValue) {
    var Result = 0.0;
    if (!$mod.TryJulianDateToDateTime(AValue,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }})) throw pas.SysUtils.EConvertError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SInvalidJulianDate"),pas.System.VarRecs(3,AValue)]);
    return Result;
  };
  this.TryJulianDateToDateTime = function (AValue, ADateTime) {
    var Result = false;
    var a = 0;
    var b = 0;
    var c = 0;
    var d = 0;
    var e = 0;
    var m = 0;
    var day = 0;
    var month = 0;
    var year = 0;
    a = pas.System.Trunc(AValue + 32044.5);
    b = rtl.trunc(((4 * a) + 3) / 146097);
    c = a - rtl.trunc((146097 * b) / 4);
    d = rtl.trunc(((4 * c) + 3) / 1461);
    e = c - rtl.trunc((1461 * d) / 4);
    m = rtl.trunc(((5 * e) + 2) / 153);
    day = (e - rtl.trunc(((153 * m) + 2) / 5)) + 1;
    month = (m + 3) - (12 * rtl.trunc(m / 10));
    year = (((100 * b) + d) - 4800) + rtl.trunc(m / 10);
    Result = pas.SysUtils.TryEncodeDate(year,month,day,ADateTime);
    if (Result) ADateTime.set(ADateTime.get() + pas.System.Frac(AValue - 0.5));
    return Result;
  };
  this.DateTimeToModifiedJulianDate = function (AValue) {
    var Result = 0.0;
    Result = $mod.DateTimeToJulianDate(AValue) - 2400000.5;
    return Result;
  };
  this.ModifiedJulianDateToDateTime = function (AValue) {
    var Result = 0.0;
    Result = $mod.JulianDateToDateTime(AValue + 2400000.5);
    return Result;
  };
  this.TryModifiedJulianDateToDateTime = function (AValue, ADateTime) {
    var Result = false;
    Result = $mod.TryJulianDateToDateTime(AValue + 2400000.5,ADateTime);
    return Result;
  };
  this.DateTimeToUnix = function (AValue) {
    var Result = 0;
    Result = Math.round($impl.DateTimeDiff($mod.RecodeMilliSecond(AValue,0),25569) * 86400);
    return Result;
  };
  this.UnixToDateTime = function (AValue, AReturnUTC) {
    var Result = 0.0;
    if (AReturnUTC) {
      Result = $mod.IncSecond(25569,AValue)}
     else Result = $mod.TTimeZone.GetLocal().ToLocalTime($mod.IncSecond(25569,AValue));
    return Result;
  };
  var Epoch = 24107 * 24 * 3600;
  this.UnixTimeStampToMac = function (AValue) {
    var Result = 0;
    Result = AValue + 2082844800;
    return Result;
  };
  this.DateTimeToMac = function (AValue) {
    var Result = 0;
    var Epoch = 0.0;
    Epoch = $mod.EncodeDateTime(1904,1,1,0,0,0,0);
    Result = $mod.SecondsBetween(Epoch,AValue);
    return Result;
  };
  this.MacToDateTime = function (AValue) {
    var Result = 0.0;
    var Epoch = 0.0;
    Epoch = $mod.EncodeDateTime(1904,1,1,0,0,0,0);
    Result = $mod.IncSecond(Epoch,AValue);
    return Result;
  };
  var Epoch$1 = 24107 * 24 * 3600;
  this.MacTimeStampToUnix = function (AValue) {
    var Result = 0;
    Result = AValue - 2082844800;
    return Result;
  };
  this.DateTimeToDosDateTime = function (AValue) {
    var Result = 0;
    var year = 0;
    var month = 0;
    var day = 0;
    var hour = 0;
    var min = 0;
    var sec = 0;
    var msec = 0;
    var zs = 0;
    $mod.DecodeDateTime(AValue,{get: function () {
        return year;
      }, set: function (v) {
        year = v;
      }},{get: function () {
        return month;
      }, set: function (v) {
        month = v;
      }},{get: function () {
        return day;
      }, set: function (v) {
        day = v;
      }},{get: function () {
        return hour;
      }, set: function (v) {
        hour = v;
      }},{get: function () {
        return min;
      }, set: function (v) {
        min = v;
      }},{get: function () {
        return sec;
      }, set: function (v) {
        sec = v;
      }},{get: function () {
        return msec;
      }, set: function (v) {
        msec = v;
      }});
    Result = -1980;
    Result = Result + (year & 127);
    Result = Result << 4;
    Result = Result + month;
    Result = Result << 5;
    Result = Result + day;
    Result = Result << 16;
    zs = hour;
    zs = zs << 6;
    zs = zs + min;
    zs = zs << 5;
    zs = zs + rtl.trunc(sec / 2);
    Result = Result + (zs & 0xffff);
    return Result;
  };
  this.DosDateTimeToDateTime = function (AValue) {
    var Result = 0.0;
    var year = 0;
    var month = 0;
    var day = 0;
    var hour = 0;
    var min = 0;
    var sec = 0;
    sec = (AValue & 31) * 2;
    AValue = AValue >>> 5;
    min = AValue & 63;
    AValue = AValue >>> 6;
    hour = AValue & 31;
    AValue = AValue >>> 5;
    day = AValue & 31;
    AValue = AValue >>> 5;
    month = AValue & 15;
    AValue = AValue >>> 4;
    year = AValue + 1980;
    Result = $mod.EncodeDateTime(year,month,day,hour,min,sec,0);
    return Result;
  };
  this.UniversalTimeToLocal = function (UT) {
    var Result = 0.0;
    var lOffset = 0;
    $impl.GetLocalTimeOffset$1(UT,true,{get: function () {
        return lOffset;
      }, set: function (v) {
        lOffset = v;
      }});
    Result = $mod.UniversalTimeToLocal$1(UT,-lOffset);
    return Result;
  };
  this.UniversalTimeToLocal$1 = function (UT, TZOffset) {
    var Result = 0.0;
    if (TZOffset > 0) {
      Result = UT + pas.SysUtils.EncodeTime(rtl.trunc(TZOffset / 60),TZOffset % 60,0,0)}
     else if (TZOffset < 0) {
      Result = UT - pas.SysUtils.EncodeTime(rtl.trunc(Math.abs(TZOffset) / 60),Math.abs(TZOffset) % 60,0,0)}
     else Result = UT;
    return Result;
  };
  this.LocalTimeToUniversal = function (LT) {
    var Result = 0.0;
    var lOffset = 0;
    $impl.GetLocalTimeOffset$1(LT,false,{get: function () {
        return lOffset;
      }, set: function (v) {
        lOffset = v;
      }});
    Result = $mod.LocalTimeToUniversal$1(LT,-lOffset);
    return Result;
  };
  this.LocalTimeToUniversal$1 = function (LT, TZOffset) {
    var Result = 0.0;
    if (TZOffset > 0) {
      Result = LT - pas.SysUtils.EncodeTime(rtl.trunc(TZOffset / 60),TZOffset % 60,0,0)}
     else if (TZOffset < 0) {
      Result = LT + pas.SysUtils.EncodeTime(rtl.trunc(Math.abs(TZOffset) / 60),Math.abs(TZOffset) % 60,0,0)}
     else Result = LT;
    return Result;
  };
  this.DateTimeToRFC3339 = function (ADate) {
    var Result = "";
    Result = pas.SysUtils.FormatDateTime('yyyy-mm-dd"T"hh":"nn":"ss"."zzz"Z"',ADate);
    return Result;
  };
  this.DateToRFC3339 = function (ADate) {
    var Result = "";
    Result = pas.SysUtils.FormatDateTime("yyyy-mm-dd",ADate);
    return Result;
  };
  this.TimeToRFC3339 = function (ADate) {
    var Result = "";
    Result = pas.SysUtils.FormatDateTime('hh":"nn":"ss"."zzz',ADate);
    return Result;
  };
  var TPartPos = {"0": "ppTime", ppTime: 0, "1": "ppYear", ppYear: 1, "2": "ppMonth", ppMonth: 2, "3": "ppDay", ppDay: 3, "4": "ppHour", ppHour: 4, "5": "ppMinute", ppMinute: 5, "6": "ppSec", ppSec: 6, "7": "ppMSec", ppMSec: 7};
  var P = [11,1,6,9,12,15,18,21];
  this.TryRFC3339ToDateTime = function (Avalue, ADateTime) {
    var Result = false;
    var lY = 0;
    var lM = 0;
    var lD = 0;
    var lH = 0;
    var lMi = 0;
    var lS = 0;
    var lMs = 0;
    if (pas.SysUtils.Trim(Avalue) === "") {
      Result = true;
      ADateTime.set(0);
    };
    lY = pas.SysUtils.StrToIntDef(pas.System.Copy(Avalue,P[TPartPos.ppYear],4),-1);
    lM = pas.SysUtils.StrToIntDef(pas.System.Copy(Avalue,P[TPartPos.ppMonth],2),-1);
    lD = pas.SysUtils.StrToIntDef(pas.System.Copy(Avalue,P[TPartPos.ppDay],2),-1);
    if (Avalue.length >= P[TPartPos.ppTime]) {
      lH = pas.SysUtils.StrToIntDef(pas.System.Copy(Avalue,P[TPartPos.ppHour],2),-1);
      lMi = pas.SysUtils.StrToIntDef(pas.System.Copy(Avalue,P[TPartPos.ppMinute],2),-1);
      if (Avalue.length >= P[TPartPos.ppSec]) {
        lS = pas.SysUtils.StrToIntDef(pas.System.Copy(Avalue,P[TPartPos.ppSec],2),-1)}
       else lS = 0;
      if (Avalue.length >= P[TPartPos.ppMSec]) lMs = pas.SysUtils.StrToIntDef(pas.System.Copy(Avalue,P[TPartPos.ppMSec],3),-1);
    } else {
      lH = 0;
      lMi = 0;
      lS = 0;
      lMs = 0;
    };
    Result = (lY >= 0) && (lM >= 0) && (lD >= 0) && (lH >= 0) && (lMi >= 0) && (lS >= 0) && (lMs >= 0);
    if (!Result) {
      ADateTime.set(0)}
     else if ((lY === 0) || (lM === 0) || (lD === 0)) {
      ADateTime.set(pas.SysUtils.EncodeTime(lH,lMi,lS,0))}
     else ADateTime.set(pas.SysUtils.EncodeDate(lY,lM,lD) + pas.SysUtils.EncodeTime(lH,lMi,lS,lMs));
    return Result;
  };
  this.RFC3339ToDateTime = function (Avalue) {
    var Result = 0.0;
    if (!$mod.TryRFC3339ToDateTime(Avalue,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }})) Result = 0;
    return Result;
  };
  this.DateTimeToMilliseconds = function (ADateTime) {
    var Result = 0;
    var LTimeStamp = pas.SysUtils.TTimeStamp.$new();
    LTimeStamp.$assign(pas.SysUtils.DateTimeToTimeStamp(ADateTime));
    Result = LTimeStamp.Date;
    Result = (Result * 86400000) + LTimeStamp.Time;
    return Result;
  };
  this.TimeToMilliseconds = function (ATime) {
    var Result = 0;
    Result = Math.round(Math.abs($mod.TimeOf(ATime)) * 86400000);
    return Result;
  };
  rtl.createClass(this,"TDateTimeScanner",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FPattern = "";
      this.FText = "";
      this.FPatternOffset = 0;
      this.FLen = 0;
      this.FPatternLen = 0;
      this.FPatternPos = 0;
      this.FPos = 0;
      this.FY = 0;
      this.FM = 0;
      this.FD = 0;
      this.FTimeval = 0.0;
    };
    this.ArrayMatchError = function () {
      $impl.raiseexception(pas.SysUtils.Format($impl.SNoArrayMatch,pas.System.VarRecs(0,this.FPatternPos + 1,0,this.FPos)));
    };
    this.DoDateTime = function () {
      this.MatchPattern(pas.SysUtils.FormatSettings.ShortDateFormat);
      this.MatchPattern("\t");
      this.MatchPattern(pas.SysUtils.FormatSettings.LongTimeFormat);
      this.FPatternPos += 1;
    };
    this.SetPattern = function (AValue) {
      if (this.FPattern === AValue) return;
      this.FPattern = AValue;
      this.FPatternLen = this.FPattern.length;
    };
    this.SetText = function (AValue) {
      if (this.FText === AValue) return;
      this.FText = AValue;
      this.FLen = this.FText.length;
    };
    this.ScanFixedInt = function (maxv) {
      var Result = 0;
      var c = "\x00";
      var n = "\x00";
      var oi = 0;
      Result = 0;
      oi = this.FPos;
      c = this.FPattern.charAt(this.FPatternPos - 1);
      while ((this.FPatternPos <= this.FPatternLen) && (this.FPattern.charAt(this.FPatternPos - 1) === c)) this.FPatternPos += 1;
      n = this.FText.charAt(this.FPos - 1);
      while ((maxv > 0) && (this.FPos <= this.FLen) && (n.charCodeAt() in rtl.createSet(null,48,57))) {
        Result = ((Result * 10) + n.charCodeAt()) - 48;
        this.FPos += 1;
        maxv -= 1;
        if (this.FPos <= this.FLen) n = this.FText.charAt(this.FPos - 1);
      };
      if (oi === this.FPos) $impl.raiseexception(pas.SysUtils.Format($impl.SPatternCharMismatch,pas.System.VarRecs(9,c,0,oi)));
      return Result;
    };
    this.ScanPatternLength = function () {
      var Result = 0;
      var c = "\x00";
      var i = 0;
      Result = this.FPatternPos;
      i = this.FPatternPos;
      c = this.FPattern.charAt(i - 1);
      while ((i <= this.FPatternLen) && (this.FPattern.charAt(i - 1) === c)) i += 1;
      Result = i - Result;
      return Result;
    };
    this.MatchChar = function (c) {
      var N = "\x00";
      if (this.FPos <= this.FLen) {
        N = this.FText.charAt(this.FPos - 1)}
       else N = "?";
      if (N !== c) $impl.raiseexception(pas.SysUtils.Format($impl.SNoCharMatch,pas.System.VarRecs(9,N,9,c,0,this.FPatternPos + this.FPatternOffset,0,this.FPos)));
      this.FPatternPos += 1;
      this.FPos += 1;
    };
    this.FindIMatch = function (values, aTerm) {
      var Result = 0;
      var l = 0;
      var i = 0;
      Result = -1;
      l = rtl.length(values) - 1;
      i = 0;
      while ((i <= l) && (Result === -1)) {
        if (pas.SysUtils.SameText(pas.System.Copy(aTerm,1,values[i].length),values[i])) Result = i;
        i += 1;
      };
      return Result;
    };
    this.FindMatch = function (Values) {
      var Result = 0;
      Result = this.FindIMatch(Values,pas.System.Copy(this.FText,this.FPos,(this.FLen - this.FPos) + 1));
      if (Result === -1) {
        this.ArrayMatchError()}
       else {
        this.FPos += Values[Result].length + 1;
        this.FPatternPos += Values[Result].length + 1;
        Result += 1;
      };
      return Result;
    };
    this.MatchPattern = function (aPattern) {
      var T = "";
      var cPos = 0;
      T = this.FPattern;
      cPos = this.FPatternPos;
      this.FPatternOffset = this.FPatternPos;
      this.FPattern = aPattern;
      this.FPatternLen = aPattern.length;
      try {
        this.Scan(-1);
      } finally {
        this.FPattern = T;
        this.FPatternLen = aPattern.length;
        this.FPatternPos = cPos;
        this.FPatternOffset = 0;
      };
    };
    this.DoYear = function () {
      var I = 0;
      var pivot = 0;
      I = this.ScanPatternLength();
      this.FY = this.ScanFixedInt(4);
      if (I <= 2) {
        pivot = $mod.YearOf(pas.SysUtils.Now()) - pas.SysUtils.TwoDigitYearCenturyWindow;
        this.FY += rtl.trunc(pivot / 100) * 100;
        if ((pas.SysUtils.TwoDigitYearCenturyWindow > 0) && (this.FY < pivot)) this.FY += 100;
      };
    };
    this.DoMonth = function () {
      var I = 0;
      I = this.ScanPatternLength();
      var $tmp = I;
      if (($tmp === 1) || ($tmp === 2)) {
        this.FM = this.ScanFixedInt(2)}
       else if ($tmp === 3) {
        this.FM = this.FindMatch(pas.SysUtils.FormatSettings.ShortMonthNames)}
       else if ($tmp === 4) this.FM = this.FindMatch(pas.SysUtils.FormatSettings.LongMonthNames);
    };
    this.DoDay = function () {
      var I = 0;
      I = this.ScanPatternLength();
      var $tmp = I;
      if (($tmp === 1) || ($tmp === 2)) {
        this.FD = this.ScanFixedInt(2)}
       else if ($tmp === 3) {
        this.FD = this.FindMatch(pas.SysUtils.FormatSettings.ShortDayNames)}
       else if ($tmp === 4) {
        this.FD = this.FindMatch(pas.SysUtils.FormatSettings.LongDayNames)}
       else if ($tmp === 5) {
        this.MatchPattern(pas.SysUtils.FormatSettings.ShortDateFormat)}
       else if ($tmp === 6) this.MatchPattern(pas.SysUtils.FormatSettings.LongDateFormat);
    };
    this.DoTime = function () {
      var I = 0;
      I = this.ScanPatternLength();
      var $tmp = I;
      if ($tmp === 1) {
        this.MatchPattern(pas.SysUtils.FormatSettings.ShortTimeFormat)}
       else if ($tmp === 2) this.MatchPattern(pas.SysUtils.FormatSettings.LongTimeFormat);
    };
    this.DoAMPM = function () {
      var I = 0;
      I = this.FindIMatch($impl.AMPMformatting,pas.System.Copy(this.FPattern,this.FPatternPos,5));
      var $tmp = I;
      if ($tmp === 0) {
        I = this.FindIMatch(["AM","PM"],pas.System.Copy(this.FText,this.FPos,2));
        var $tmp1 = I;
        if ($tmp1 === 0) {}
        else if ($tmp1 === 1) {
          this.FTimeval = this.FTimeval + (12 * 0.041666666666666664)}
         else {
          this.ArrayMatchError();
        };
        this.FPatternPos += $impl.AMPMformatting[0].length;
        this.FPos += 2;
      } else if ($tmp === 1) {
        var $tmp2 = pas.System.upcase(this.FText.charAt(this.FPos - 1));
        if ($tmp2 === "A") {}
        else if ($tmp2 === "P") {
          this.FTimeval = this.FTimeval + (12 * 0.041666666666666664)}
         else {
          this.ArrayMatchError();
        };
        this.FPatternPos += $impl.AMPMformatting[1].length;
        this.FPos += 1;
      } else if ($tmp === 2) {
        I = this.FindIMatch([pas.SysUtils.FormatSettings.TimeAMString,pas.SysUtils.FormatSettings.TimePMString],pas.System.Copy(this.FText,this.FPos,5));
        var $tmp3 = I;
        if ($tmp3 === 0) {
          this.FPos += pas.SysUtils.FormatSettings.TimeAMString.length}
         else if ($tmp3 === 1) {
          this.FTimeval = this.FTimeval + (12 * 0.041666666666666664);
          this.FPos += pas.SysUtils.FormatSettings.TimePMString.length;
        } else {
          this.ArrayMatchError();
        };
        this.FPatternPos += $impl.AMPMformatting[2].length;
        this.FPatternPos += 2;
        this.FPos += 2;
      } else {
        this.MatchChar(this.FPattern.charAt(this.FPatternPos - 1));
      };
    };
    this.Scan = function (StartPos) {
      var Result = 0.0;
      var lasttoken = "\x00";
      var activequote = "\x00";
      var lch = "\x00";
      var i = 0;
      if (StartPos < 1) StartPos = 1;
      if (this.FPos < StartPos) this.FPos = StartPos;
      this.FPatternPos = 1;
      activequote = "\x00";
      lasttoken = " ";
      while ((this.FPos <= this.FLen) && (this.FPatternPos <= this.FPatternLen)) {
        lch = pas.System.upcase(this.FPattern.charAt(this.FPatternPos - 1));
        if (activequote !== "\x00") {
          if (activequote !== lch) {
            this.MatchChar(lch)}
           else {
            activequote = "\x00";
            this.FPatternPos += 1;
          };
        } else {
          if ((lch === "M") && (lasttoken === "H")) {
            i = this.ScanPatternLength();
            if (i > 2) $impl.raiseexception(pas.SysUtils.Format($impl.SHHMMError,pas.System.VarRecs(0,this.FPatternOffset + this.FPatternPos + 1)));
            this.FTimeval = this.FTimeval + (this.ScanFixedInt(2) * 6.9444444444444447E-4);
          } else {
            var $tmp = lch;
            if ($tmp === "Y") {
              this.DoYear()}
             else if ($tmp === "M") {
              this.DoMonth()}
             else if ($tmp === "D") {
              this.DoDay()}
             else if ($tmp === "T") {
              this.DoTime()}
             else if ($tmp === "H") {
              this.FTimeval = this.FTimeval + (this.ScanFixedInt(2) * 0.041666666666666664)}
             else if ($tmp === "N") {
              this.FTimeval = this.FTimeval + (this.ScanFixedInt(2) * 6.9444444444444447E-4)}
             else if ($tmp === "S") {
              this.FTimeval = this.FTimeval + (this.ScanFixedInt(2) * 1.1574074074074073E-5)}
             else if ($tmp === "Z") {
              this.FTimeval = this.FTimeval + (this.ScanFixedInt(3) * 1.1574074074074074E-8)}
             else if ($tmp === "A") {
              this.DoAMPM()}
             else if ($tmp === "/") {
              this.MatchChar(pas.SysUtils.FormatSettings.DateSeparator)}
             else if ($tmp === ":") {
              this.MatchChar(pas.SysUtils.FormatSettings.TimeSeparator);
              lch = lasttoken;
            } else if (($tmp === "'") || ($tmp === '"')) {
              activequote = lch;
              this.FPatternPos += 1;
            } else if ($tmp === "C") {
              this.DoDateTime()}
             else if ($tmp === "?") {
              this.FPatternPos += 1;
              this.FPos += 1;
            } else if ($tmp === "\t") {
              while ((this.FPos <= this.FLen) && (this.FText.charCodeAt(this.FPos - 1) in $impl.whitespace)) this.FPos += 1;
              this.FPatternPos += 1;
            } else {
              this.MatchChar(this.FPattern.charAt(this.FPatternPos - 1));
            };
          };
          lasttoken = lch;
        };
      };
      Result = this.FTimeval;
      if ((this.FY > 0) && (this.FM > 0) && (this.FD > 0)) Result = Result + pas.SysUtils.EncodeDate(this.FY,this.FM,this.FD);
      return Result;
    };
  });
  this.ScanDateTime = function (APattern, AValue, APos) {
    var Result = 0.0;
    var T = null;
    T = $mod.TDateTimeScanner.$create("Create");
    try {
      T.SetPattern(APattern);
      T.SetText(AValue);
      Result = T.Scan(APos);
    } finally {
      T = rtl.freeLoc(T);
    };
    return Result;
  };
  this.TLocalTimeType = {"0": "lttStandard", lttStandard: 0, "1": "lttDaylight", lttDaylight: 1, "2": "lttAmbiguous", lttAmbiguous: 2, "3": "lttInvalid", lttInvalid: 3};
  this.$rtti.$Enum("TLocalTimeType",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TLocalTimeType});
  rtl.createClass(this,"ELocalTimeInvalid",pas.SysUtils.Exception,function () {
  });
  rtl.createClass(this,"EDateTimeException",pas.SysUtils.Exception,function () {
  });
  rtl.createClass(this,"TTimeZone",pas.System.TObject,function () {
    this.FLocal = null;
    this.GetAbbreviationForNow = function () {
      var Result = "";
      Result = this.GetAbbreviation(pas.SysUtils.Now(),false);
      return Result;
    };
    this.GetCurrentUtcOffset = function () {
      var Result = pas.TimeSpan.TTimeSpan.$new();
      Result.$assign(this.GetUtcOffset(pas.SysUtils.Now(),false));
      return Result;
    };
    this.GetDisplayNameForNow = function () {
      var Result = "";
      Result = this.GetDisplayName(pas.SysUtils.Now(),false);
      return Result;
    };
    this.GetLocal = function () {
      var Result = null;
      if (!(this.FLocal != null)) $mod.TTimeZone.FLocal = $mod.TLocalTimeZone.$create("Create$1");
      Result = this.FLocal;
      return Result;
    };
    this.GetUtcOffsetInSeconds = function (ADateTime, AForceDaylight) {
      var Result = 0;
      var lDSTSave = 0;
      var lOffset = 0;
      var lType = 0;
      this.DoGetOffsetsAndType(ADateTime,{get: function () {
          return lOffset;
        }, set: function (v) {
          lOffset = v;
        }},{get: function () {
          return lDSTSave;
        }, set: function (v) {
          lDSTSave = v;
        }},{get: function () {
          return lType;
        }, set: function (v) {
          lType = v;
        }});
      if (lType === $mod.TLocalTimeType.lttInvalid) {
        throw $mod.ELocalTimeInvalid.$create("CreateFmt",[rtl.getResStr($mod,"SLocalTimeInvalid"),pas.System.VarRecs(18,pas.SysUtils.DateTimeToStr(ADateTime,false))])}
       else if ((lType === $mod.TLocalTimeType.lttDaylight) || ((lType === $mod.TLocalTimeType.lttAmbiguous) && AForceDaylight)) {
        Result = lOffset + lDSTSave}
       else Result = lOffset;
      return Result;
    };
    var cAbbreviationFormat_Hours = "%s%s%.2d";
    var cAbbreviationFormat_Minutes = "%s%s%.2d:%.2d";
    var cGMT = "GMT";
    var cMinus = "-";
    var cPlus = "+";
    this.GetAbbreviation = function (ADateTime, AForceDaylight) {
      var Result = "";
      var lAbsOffset = 0;
      var lHours = 0;
      var lMinutes = 0;
      var lOffset = 0;
      var lSignChar = "\x00";
      lOffset = this.GetUtcOffsetInSeconds(ADateTime,AForceDaylight);
      if (lOffset === 0) {
        Result = cGMT}
       else {
        lAbsOffset = Math.abs(lOffset);
        lHours = rtl.trunc(lAbsOffset / 3600);
        lMinutes = rtl.trunc((lAbsOffset % 3600) / 60);
        if (lOffset < 0) {
          lSignChar = cMinus}
         else lSignChar = cPlus;
        if (lMinutes > 0) {
          Result = pas.SysUtils.Format(cAbbreviationFormat_Minutes,pas.System.VarRecs(18,cGMT,9,lSignChar,0,lHours,0,lMinutes))}
         else Result = pas.SysUtils.Format(cAbbreviationFormat_Hours,pas.System.VarRecs(18,cGMT,9,lSignChar,0,lHours));
      };
      return Result;
    };
    this.GetDisplayName = function (ADateTime, AForceDaylight) {
      var Result = "";
      if (this.GetLocalTimeType(ADateTime) === $mod.TLocalTimeType.lttInvalid) throw $mod.ELocalTimeInvalid.$create("CreateFmt",[rtl.getResStr($mod,"SLocalTimeInvalid"),pas.System.VarRecs(18,pas.SysUtils.DateTimeToStr(ADateTime,false))]);
      Result = this.DoGetDisplayName(ADateTime,AForceDaylight);
      return Result;
    };
    this.GetLocalTimeType = function (ADateTime) {
      var Result = 0;
      var lDSTSave = 0;
      var lOffset = 0;
      this.DoGetOffsetsAndType(ADateTime,{get: function () {
          return lOffset;
        }, set: function (v) {
          lOffset = v;
        }},{get: function () {
          return lDSTSave;
        }, set: function (v) {
          lDSTSave = v;
        }},{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.GetUtcOffset = function (ADateTime, AForceDaylight) {
      var Result = pas.TimeSpan.TTimeSpan.$new();
      Result.$assign(pas.TimeSpan.TTimeSpan.FromSeconds(this.GetUtcOffsetInSeconds(ADateTime,AForceDaylight)));
      return Result;
    };
    this.HasDST = function () {
      var Result = false;
      Result = this.HasDST$1(pas.SysUtils.Now());
      return Result;
    };
    this.HasDST$1 = function (AYear) {
      var Result = false;
      var lDstSave = 0;
      var lOffset = 0;
      var lType = 0;
      this.DoGetOffsetsAndType(AYear,{get: function () {
          return lOffset;
        }, set: function (v) {
          lOffset = v;
        }},{get: function () {
          return lDstSave;
        }, set: function (v) {
          lDstSave = v;
        }},{get: function () {
          return lType;
        }, set: function (v) {
          lType = v;
        }});
      Result = lDstSave !== 0;
      return Result;
    };
    this.IncMilliSecond = function (AValue, ANumberOfMilliSeconds) {
      var Result = 0.0;
      var lTempTime = 0;
      var lTimeStamp = pas.SysUtils.TTimeStamp.$new();
      lTimeStamp.$assign(pas.SysUtils.DateTimeToTimeStamp(AValue));
      lTempTime = pas.SysUtils.TimeStampToMSecs(lTimeStamp);
      lTempTime = lTempTime + ANumberOfMilliSeconds;
      lTimeStamp.$assign(pas.SysUtils.MSecsToTimeStamp(lTempTime));
      Result = pas.SysUtils.TimeStampToDateTime(lTimeStamp);
      return Result;
    };
    this.IncSecond = function (AValue, ANumberOfSeconds) {
      var Result = 0.0;
      Result = this.IncMilliSecond(AValue,ANumberOfSeconds * 1000);
      return Result;
    };
    this.IsAmbiguousTime = function (ADateTime) {
      var Result = false;
      Result = this.GetLocalTimeType(ADateTime) === $mod.TLocalTimeType.lttAmbiguous;
      return Result;
    };
    this.IsDaylightTime = function (ADateTime, AForceDaylight) {
      var Result = false;
      var $tmp = this.GetLocalTimeType(ADateTime);
      if ($tmp === $mod.TLocalTimeType.lttDaylight) {
        Result = true}
       else if ($tmp === $mod.TLocalTimeType.lttAmbiguous) {
        Result = AForceDaylight}
       else {
        Result = false;
      };
      return Result;
    };
    this.IsInvalidTime = function (ADateTime) {
      var Result = false;
      Result = this.GetLocalTimeType(ADateTime) === $mod.TLocalTimeType.lttInvalid;
      return Result;
    };
    this.IsStandardTime = function (ADateTime, AForceDaylight) {
      var Result = false;
      var $tmp = this.GetLocalTimeType(ADateTime);
      if ($tmp === $mod.TLocalTimeType.lttStandard) {
        Result = true}
       else if ($tmp === $mod.TLocalTimeType.lttAmbiguous) {
        Result = !AForceDaylight}
       else {
        Result = false;
      };
      return Result;
    };
    this.ToLocalTime = function (ADateTime) {
      var Result = 0.0;
      var lDSTSave = 0;
      var lOffset = 0;
      var lType = 0;
      this.DoGetOffsetsAndType(ADateTime,{get: function () {
          return lOffset;
        }, set: function (v) {
          lOffset = v;
        }},{get: function () {
          return lDSTSave;
        }, set: function (v) {
          lDSTSave = v;
        }},{get: function () {
          return lType;
        }, set: function (v) {
          lType = v;
        }});
      Result = this.IncSecond(ADateTime,lOffset);
      this.DoGetOffsetsAndType(Result,{get: function () {
          return lOffset;
        }, set: function (v) {
          lOffset = v;
        }},{get: function () {
          return lDSTSave;
        }, set: function (v) {
          lDSTSave = v;
        }},{get: function () {
          return lType;
        }, set: function (v) {
          lType = v;
        }});
      if (lType in rtl.createSet($mod.TLocalTimeType.lttInvalid,$mod.TLocalTimeType.lttDaylight)) Result = this.IncSecond(Result,lDSTSave);
      return Result;
    };
    this.ToUniversalTime = function (ADateTime, AForceDaylight) {
      var Result = 0.0;
      var lOffset = 0;
      lOffset = this.GetUtcOffsetInSeconds(ADateTime,AForceDaylight);
      Result = this.IncSecond(ADateTime,-lOffset);
      return Result;
    };
  });
  rtl.createClass(this,"TLocalTimeZone",this.TTimeZone,function () {
    this.$init = function () {
      $mod.TTimeZone.$init.call(this);
      this.FDST = null;
    };
    this.$final = function () {
      this.FDST = undefined;
      $mod.TTimeZone.$final.call(this);
    };
    this.DoGetDisplayName = function (ADateTime, AForceDaylight) {
      var Result = "";
      var lDateTime = 0;
      var lLocale = "";
      lLocale = undefined;
      lDateTime = $mod.DateTimeToUnix(ADateTime) * 1000;
      Result = (new Date(lDateTime)).toLocaleDateString(lLocale,pas.JS.New(["day","2-digit","timeZoneName","long"]));
      Result = pas.SysUtils.TStringHelper.Substring.call({get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }},4);
      return Result;
    };
    this.DoGetID = function () {
      var Result = "";
      var lLocale = "";
      lLocale = undefined;
      Result = (new Date()).toLocaleDateString(lLocale,pas.JS.New(["day","2-digit","timeZoneName","longGeneric"]));
      Result = pas.SysUtils.TStringHelper.Substring.call({get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }},4);
      return Result;
    };
    var cIndexJanuary = 0;
    var cIndexJuly = 6;
    this.DoGetOffsetsAndType = function (ADateTime, AOffset, ADstSave, AType) {
      var lDate = null;
      var lOffsetSummer = 0;
      var lOffsetWinter = 0;
      var lStdOffset = 0;
      var lDST = pas["Generics.Collections"].TPair$$$G$$generics$collections$$Double$$Double.$new();
      lDate = new Date($mod.DateTimeToUnix(ADateTime) * 1000);
      lOffsetSummer = (new Date($mod.YearOf(ADateTime),6,1,0,0,0,0)).getTimezoneOffset();
      lOffsetWinter = (new Date($mod.YearOf(ADateTime),0,1,0,0,0,0)).getTimezoneOffset();
      lStdOffset = Math.max(lOffsetSummer,lOffsetWinter);
      AOffset.set(-lStdOffset * 60);
      ADstSave.set(Math.abs(lOffsetSummer - lOffsetWinter) * 60);
      if (this.FDST.Force($mod.YearOf(ADateTime),lDST)) {
        if ((ADateTime > lDST.Key) && (ADateTime < $mod.IncHour$1(lDST.Key))) {
          AType.set($mod.TLocalTimeType.lttInvalid);
          return;
        };
        if ((ADateTime > lDST.Value) && (ADateTime < $mod.IncHour$1(lDST.Value))) {
          AType.set($mod.TLocalTimeType.lttAmbiguous);
          return;
        };
      };
      if (lDate.getTimezoneOffset() === lStdOffset) {
        AType.set($mod.TLocalTimeType.lttStandard)}
       else AType.set($mod.TLocalTimeType.lttDaylight);
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FDST = pas["dateutils.helper"].TDateUtilsHelper.$create("Create$1");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FDST");
      pas.System.TObject.Destroy.call(this);
    };
  });
  this.TISO8601ToDateOption = {"0": "ioReturnUTC", ioReturnUTC: 0, "1": "ioNoTZIsLocal", ioNoTZIsLocal: 1};
  this.$rtti.$Enum("TISO8601ToDateOption",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TISO8601ToDateOption});
  this.$rtti.$Set("TISO8601ToDateOptions",{comptype: this.$rtti["TISO8601ToDateOption"]});
  this.ISO8601ToDate = function (AISODate, AReturnUTC) {
    var Result = 0.0;
    if (!$mod.TryISO8601ToDate$1(AISODate,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }},rtl.refSet($impl.CISO8601ToDateOptions[+AReturnUTC]))) throw $mod.EDateTimeException.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SErrInvalidTimeStamp"),pas.System.VarRecs(18,AISODate)]);
    return Result;
  };
  this.ISO8601ToDate$1 = function (AISODate, AOptions) {
    var Result = 0.0;
    if (!$mod.TryISO8601ToDate$1(AISODate,{get: function () {
        return Result;
      }, set: function (v) {
        Result = v;
      }},rtl.refSet(AOptions))) throw $mod.EDateTimeException.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SErrInvalidTimeStamp"),pas.System.VarRecs(18,AISODate)]);
    return Result;
  };
  this.TryISO8601ToDate = function (AISODate, AValue, AReturnUTC) {
    var Result = false;
    Result = $mod.TryISO8601ToDate$1(AISODate,AValue,rtl.refSet($impl.CISO8601ToDateOptions[+AReturnUTC]));
    return Result;
  };
  this.TryISO8601ToDate$1 = function (AISODate, AValue, AOptions) {
    var Result = false;
    var S = "";
    var TZ = "";
    var L = 0;
    var Offset = 0;
    var TZOffset = 0;
    S = AISODate;
    L = S.length;
    if (L === 0) return false;
    if (S.charAt(L - 1) === "Z") {
      TZ = "Z";
      S = pas.System.Copy(S,1,L - 1);
    } else if (((L > 11) && ((S.charCodeAt(10) in rtl.createSet(84,32)) || (S.charCodeAt(8) in rtl.createSet(84,32)))) || (S.charAt(0) === "T")) {
      if (S.charCodeAt(L - 2 - 1) in rtl.createSet(43,45)) {
        TZ = pas.System.Copy(S,L - 2,3);
        S = pas.System.Copy(S,1,L - 3);
      } else if (S.charCodeAt(L - 4 - 1) in rtl.createSet(43,45)) {
        TZ = pas.System.Copy(S,L - 4,5);
        S = pas.System.Copy(S,1,L - 5);
      } else if ((S.charCodeAt(L - 5 - 1) in rtl.createSet(43,45)) && ((L > 13) || (S.charAt(0) === "T"))) {
        TZ = pas.System.Copy(S,L - 5,6);
        S = pas.System.Copy(S,1,L - 6);
      };
    };
    Result = $impl.TryISOStrToDateTime(S,AValue);
    if (TZ === "") {
      if ($mod.TISO8601ToDateOption.ioNoTZIsLocal in AOptions) {
        if ($mod.TISO8601ToDateOption.ioReturnUTC in AOptions) AValue.set($mod.LocalTimeToUniversal(AValue.get()));
      } else {
        if (!($mod.TISO8601ToDateOption.ioReturnUTC in AOptions)) {
          Result = Result && $impl.GetLocalTimeOffset$1(AValue.get(),false,{get: function () {
              return TZOffset;
            }, set: function (v) {
              TZOffset = v;
            }});
          if (!Result) return Result;
          AValue.set($mod.IncMinute(AValue.get(),TZOffset));
        };
      };
    } else {
      Result = Result && $impl.TryISOTZStrToTZOffset(TZ,{get: function () {
          return TZOffset;
        }, set: function (v) {
          TZOffset = v;
        }});
      if (!Result) return Result;
      AValue.set($mod.IncMinute(AValue.get(),TZOffset));
      if ($mod.TISO8601ToDateOption.ioReturnUTC in AOptions) {
        Offset = 0}
       else Offset = -$impl.GetLocalTimeOffset$2(AValue.get(),true);
      AValue.set($mod.IncMinute(AValue.get(),Offset));
    };
    return Result;
  };
  var SDateFormat = "%.4d-%.2d-%.2dT%.2d:%.2d:%.2d.%.3dZ";
  var SOffsetFormat = "%s%s%.02d:%.02d";
  var Neg = ["+","-"];
  this.DateToISO8601 = function (ADate, AInputIsUTC) {
    var Result = "";
    var y = 0;
    var mo = 0;
    var d = 0;
    var h = 0;
    var mi = 0;
    var se = 0;
    var ms = 0;
    var Bias = 0;
    var TimeZone = null;
    pas.SysUtils.DecodeDate(ADate,{get: function () {
        return y;
      }, set: function (v) {
        y = v;
      }},{get: function () {
        return mo;
      }, set: function (v) {
        mo = v;
      }},{get: function () {
        return d;
      }, set: function (v) {
        d = v;
      }});
    pas.SysUtils.DecodeTime(ADate,{get: function () {
        return h;
      }, set: function (v) {
        h = v;
      }},{get: function () {
        return mi;
      }, set: function (v) {
        mi = v;
      }},{get: function () {
        return se;
      }, set: function (v) {
        se = v;
      }},{get: function () {
        return ms;
      }, set: function (v) {
        ms = v;
      }});
    Result = pas.SysUtils.Format(SDateFormat,pas.System.VarRecs(0,y,0,mo,0,d,0,h,0,mi,0,se,0,ms));
    if (!AInputIsUTC) {
      TimeZone = $mod.TTimeZone.GetLocal();
      Bias = pas.System.Trunc(TimeZone.GetUtcOffset(ADate,false).Negate().GetTotalMinutes());
      if (Bias !== 0) {
        Result = rtl.strSetLength(Result,pas.SysUtils.TStringHelper.GetLength.call({get: function () {
            return Result;
          }, set: function (v) {
            Result = v;
          }}) - 1);
        Result = pas.SysUtils.Format(SOffsetFormat,pas.System.VarRecs(18,Result,18,Neg[+(Bias > 0)],0,rtl.trunc(Math.abs(Bias) / 60),0,Math.abs(Bias) % 60));
      };
    };
    return Result;
  };
  $mod.$implcode = function () {
    $impl.TDateTimeEpsilon = 2.2204460493e-16;
    $impl.HalfMilliSecond = 1.1574074074074074E-8 / 2;
    $impl.IsValidMonth = function (AMonth) {
      var Result = false;
      Result = (AMonth >= 1) && (AMonth <= 12);
      return Result;
    };
    $impl.IsValidDayOfWeek = function (ADayOfWeek) {
      var Result = false;
      Result = (ADayOfWeek >= 1) && (ADayOfWeek <= 7);
      return Result;
    };
    $impl.IsValidWeekOfMonth = function (AWeekOfMonth) {
      var Result = false;
      Result = (AWeekOfMonth >= 1) && (AWeekOfMonth <= 5);
      return Result;
    };
    $mod.$rtti.$StaticArray("DOWMap$a",{dims: [7], eltype: rtl.word});
    $impl.DOWMap = [7,1,2,3,4,5,6];
    $impl.DateTimeDiff = function (ANow, AThen) {
      var Result = 0.0;
      Result = ANow - AThen;
      if ((ANow > 0) && (AThen < 0)) {
        Result = Result - 0.5}
       else if ((ANow < -1.0) && (AThen > -1.0)) Result = Result + 0.5;
      return Result;
    };
    $impl.MaybeSkipTimeWarp = function (OldDate, NewDate) {
      if ((OldDate >= 0) && (NewDate.get() < -2.2204460493E-16)) {
        NewDate.set(pas.System.Int((NewDate.get() - 1.0) + 2.2204460493E-16) - pas.System.Frac(1.0 + pas.System.Frac(NewDate.get())))}
       else if ((OldDate <= -1.0) && (NewDate.get() > (-1.0 + 2.2204460493E-16))) NewDate.set(pas.System.Int((NewDate.get() + 1.0) - 2.2204460493E-16) + pas.System.Frac(1.0 - Math.abs(pas.System.Frac(1.0 + NewDate.get()))));
    };
    $impl.IncNegativeTime = function (AValue, Addend) {
      var Result = 0.0;
      var newtime = 0.0;
      newtime = -pas.System.Frac(AValue) + pas.System.Frac(Addend);
      if (pas.Math.SameValue(newtime,pas.System.Int(newtime) + 1,2.2204460493E-16)) {
        newtime = pas.System.Int(newtime) + 1}
       else if (pas.Math.SameValue(newtime,pas.System.Int(newtime),2.2204460493E-16)) newtime = pas.System.Int(newtime);
      if (newtime < -2.2204460493E-16) {
        newtime = 1.0 + newtime;
        AValue = pas.System.Int(AValue) - 1;
      } else if (newtime >= (1.0 - 2.2204460493E-16)) {
        newtime = newtime - 1.0;
        AValue = pas.System.Int(AValue) + 1;
      };
      Result = (pas.System.Int(AValue) + pas.System.Int(Addend)) - newtime;
      return Result;
    };
    $impl.LFAI = 65535;
    $impl.InternalNthDayOfWeek = function (DoM) {
      var Result = 0;
      Result = rtl.trunc((DoM - 1) / 7) + 1;
      return Result;
    };
    $impl.whitespace = rtl.createSet(32,13,10);
    $impl.hrfactor = 1 / 24;
    $impl.minfactor = 1 / (24 * 60);
    $impl.secfactor = 1 / (24 * 60 * 60);
    $impl.mssecfactor = 1 / (24 * 60 * 60 * 1000);
    $mod.$rtti.$StaticArray("AMPMformatting$a",{dims: [3], eltype: rtl.string});
    $impl.AMPMformatting = ["am/pm","a/p","ampm"];
    $impl.raiseexception = function (s) {
      throw pas.SysUtils.EConvertError.$create("Create$1",[s]);
    };
    $impl.GetLocalTimeOffset = function () {
      var Result = 0;
      Result = (new Date()).getTimezoneOffset();
      return Result;
    };
    $impl.GetLocalTimeOffset$1 = function (DateTime, InputIsUTC, Offset) {
      var Result = false;
      Offset.set(pas.SysUtils.DateTimeToJSDate(DateTime,InputIsUTC).getTimezoneOffset());
      Result = true;
      return Result;
    };
    $impl.GetLocalTimeOffset$2 = function (DateTime, InputIsUTC) {
      var Result = 0;
      if (!$impl.GetLocalTimeOffset$1(DateTime,InputIsUTC,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }})) Result = $impl.GetLocalTimeOffset();
      return Result;
    };
    $impl.SPatternCharMismatch = 'Pattern mismatch char "%s" at position %d.';
    $impl.SNoCharMatch = 'Mismatch char "%s" <> "%s" at pattern position %d, string position %d.';
    $impl.SHHMMError = "mm in a sequence hh:mm is interpreted as minutes. No longer versions allowed! (Position : %d).";
    $impl.SNoArrayMatch = "Can't match any allowed value at pattern position %d, string position %d.";
    $impl.TryISOStrToDate = function (aString, outDate) {
      var Result = false;
      var xYear = 0;
      var xMonth = 0;
      var xDay = 0;
      var $tmp = aString.length;
      if ($tmp === 4) {
        Result = pas.SysUtils.TryStrToInt(aString,{get: function () {
            return xYear;
          }, set: function (v) {
            xYear = v;
          }}) && pas.SysUtils.TryEncodeDate(xYear,1,1,outDate)}
       else if ($tmp === 6) {
        Result = pas.SysUtils.TryStrToInt(pas.System.Copy(aString,1,4),{get: function () {
            return xYear;
          }, set: function (v) {
            xYear = v;
          }}) && pas.SysUtils.TryStrToInt(pas.System.Copy(aString,5,2),{get: function () {
            return xMonth;
          }, set: function (v) {
            xMonth = v;
          }}) && pas.SysUtils.TryEncodeDate(xYear,xMonth,1,outDate)}
       else if ($tmp === 7) {
        Result = pas.SysUtils.TryStrToInt(pas.System.Copy(aString,1,4),{get: function () {
            return xYear;
          }, set: function (v) {
            xYear = v;
          }}) && pas.SysUtils.TryStrToInt(pas.System.Copy(aString,6,2),{get: function () {
            return xMonth;
          }, set: function (v) {
            xMonth = v;
          }}) && pas.SysUtils.TryEncodeDate(xYear,xMonth,1,outDate)}
       else if ($tmp === 8) {
        Result = pas.SysUtils.TryStrToInt(pas.System.Copy(aString,1,4),{get: function () {
            return xYear;
          }, set: function (v) {
            xYear = v;
          }}) && pas.SysUtils.TryStrToInt(pas.System.Copy(aString,5,2),{get: function () {
            return xMonth;
          }, set: function (v) {
            xMonth = v;
          }}) && pas.SysUtils.TryStrToInt(pas.System.Copy(aString,7,2),{get: function () {
            return xDay;
          }, set: function (v) {
            xDay = v;
          }}) && pas.SysUtils.TryEncodeDate(xYear,xMonth,xDay,outDate)}
       else if ($tmp === 10) {
        Result = pas.SysUtils.TryStrToInt(pas.System.Copy(aString,1,4),{get: function () {
            return xYear;
          }, set: function (v) {
            xYear = v;
          }}) && pas.SysUtils.TryStrToInt(pas.System.Copy(aString,6,2),{get: function () {
            return xMonth;
          }, set: function (v) {
            xMonth = v;
          }}) && pas.SysUtils.TryStrToInt(pas.System.Copy(aString,9,2),{get: function () {
            return xDay;
          }, set: function (v) {
            xDay = v;
          }}) && pas.SysUtils.TryEncodeDate(xYear,xMonth,xDay,outDate)}
       else {
        Result = false;
      };
      if (!Result) outDate.set(0);
      return Result;
    };
    $impl.TryISOStrToTime = function (aString, outTime) {
      var Result = false;
      var xHour = 0;
      var xMinute = 0;
      var xSecond = 0;
      var xLength = 0;
      var res = 0;
      var xFractionalSecond = 0.0;
      var tmp = "";
      Result = true;
      xLength = aString.length;
      if ((xLength > 0) && (aString.charAt(xLength - 1) === "Z")) {
        xLength -= 1;
      } else if ((xLength > 6) && pas.SysUtils.CharInSet(aString.charAt(xLength - 5 - 1),["+","-"])) {
        Result = pas.SysUtils.TryStrToInt(pas.System.Copy(aString,xLength - 4,2),{get: function () {
            return xHour;
          }, set: function (v) {
            xHour = v;
          }}) && (aString.charAt(xLength - 2 - 1) === ":") && pas.SysUtils.TryStrToInt(pas.System.Copy(aString,xLength - 1,2),{get: function () {
            return xMinute;
          }, set: function (v) {
            xMinute = v;
          }});
        xLength -= 6;
      } else if ((xLength > 5) && pas.SysUtils.CharInSet(aString.charAt(xLength - 4 - 1),["+","-"])) {
        Result = pas.SysUtils.TryStrToInt(pas.System.Copy(aString,xLength - 3,2),{get: function () {
            return xHour;
          }, set: function (v) {
            xHour = v;
          }}) && pas.SysUtils.TryStrToInt(pas.System.Copy(aString,xLength - 1,2),{get: function () {
            return xMinute;
          }, set: function (v) {
            xMinute = v;
          }});
        xLength -= 5;
      } else if ((xLength > 3) && pas.SysUtils.CharInSet(aString.charAt(xLength - 2 - 1),["+","-"])) {
        Result = pas.SysUtils.TryStrToInt(pas.System.Copy(aString,xLength - 1,2),{get: function () {
            return xHour;
          }, set: function (v) {
            xHour = v;
          }});
        xLength -= 3;
      };
      if (!Result) {
        outTime.set(0);
        return Result;
      };
      var $tmp = xLength;
      if ($tmp === 2) {
        Result = pas.SysUtils.TryStrToInt(aString,{get: function () {
            return xHour;
          }, set: function (v) {
            xHour = v;
          }}) && pas.SysUtils.TryEncodeTime(xHour,0,0,0,outTime)}
       else if ($tmp === 4) {
        Result = pas.SysUtils.TryStrToInt(pas.System.Copy(aString,1,2),{get: function () {
            return xHour;
          }, set: function (v) {
            xHour = v;
          }}) && pas.SysUtils.TryStrToInt(pas.System.Copy(aString,3,2),{get: function () {
            return xMinute;
          }, set: function (v) {
            xMinute = v;
          }}) && pas.SysUtils.TryEncodeTime(xHour,xMinute,0,0,outTime)}
       else if ($tmp === 5) {
        Result = pas.SysUtils.TryStrToInt(pas.System.Copy(aString,1,2),{get: function () {
            return xHour;
          }, set: function (v) {
            xHour = v;
          }}) && (aString.charAt(2) === ":") && pas.SysUtils.TryStrToInt(pas.System.Copy(aString,4,2),{get: function () {
            return xMinute;
          }, set: function (v) {
            xMinute = v;
          }}) && pas.SysUtils.TryEncodeTime(xHour,xMinute,0,0,outTime)}
       else if ($tmp === 6) {
        Result = pas.SysUtils.TryStrToInt(pas.System.Copy(aString,1,2),{get: function () {
            return xHour;
          }, set: function (v) {
            xHour = v;
          }}) && pas.SysUtils.TryStrToInt(pas.System.Copy(aString,3,2),{get: function () {
            return xMinute;
          }, set: function (v) {
            xMinute = v;
          }}) && pas.SysUtils.TryStrToInt(pas.System.Copy(aString,5,2),{get: function () {
            return xSecond;
          }, set: function (v) {
            xSecond = v;
          }}) && pas.SysUtils.TryEncodeTime(xHour,xMinute,xSecond,0,outTime)}
       else {
        if ((xLength >= 8) && (aString.charAt(2) === ":") && (aString.charAt(5) === ":")) {
          Result = pas.SysUtils.TryStrToInt(pas.System.Copy(aString,1,2),{get: function () {
              return xHour;
            }, set: function (v) {
              xHour = v;
            }}) && pas.SysUtils.TryStrToInt(pas.System.Copy(aString,4,2),{get: function () {
              return xMinute;
            }, set: function (v) {
              xMinute = v;
            }}) && pas.SysUtils.TryStrToInt(pas.System.Copy(aString,7,2),{get: function () {
              return xSecond;
            }, set: function (v) {
              xSecond = v;
            }}) && pas.SysUtils.TryEncodeTime(xHour,xMinute,xSecond,0,outTime);
          if (Result && (xLength >= 9)) {
            tmp = pas.System.Copy(aString,10,xLength - 9);
            pas.System.val$8("." + tmp,{get: function () {
                return xFractionalSecond;
              }, set: function (v) {
                xFractionalSecond = v;
              }},{get: function () {
                return res;
              }, set: function (v) {
                res = v;
              }});
            Result = res === 0;
            if (Result) outTime.set(outTime.get() + (xFractionalSecond * 1.1574074074074073E-5));
          };
        } else if ((xLength >= 7) && (aString.charCodeAt(6) in rtl.createSet(46,44))) {
          Result = pas.SysUtils.TryStrToInt(pas.System.Copy(aString,1,2),{get: function () {
              return xHour;
            }, set: function (v) {
              xHour = v;
            }}) && pas.SysUtils.TryStrToInt(pas.System.Copy(aString,3,2),{get: function () {
              return xMinute;
            }, set: function (v) {
              xMinute = v;
            }}) && pas.SysUtils.TryStrToInt(pas.System.Copy(aString,5,2),{get: function () {
              return xSecond;
            }, set: function (v) {
              xSecond = v;
            }}) && pas.SysUtils.TryEncodeTime(xHour,xMinute,xSecond,0,outTime);
          tmp = pas.System.Copy(aString,8,xLength - 7);
          if (Result && (tmp !== "")) {
            pas.System.val$8("." + tmp,{get: function () {
                return xFractionalSecond;
              }, set: function (v) {
                xFractionalSecond = v;
              }},{get: function () {
                return res;
              }, set: function (v) {
                res = v;
              }});
            Result = res === 0;
            if (Result) outTime.set(outTime.get() + (xFractionalSecond * 1.1574074074074073E-5));
          };
        } else Result = false;
      };
      if (!Result) outTime.set(0);
      return Result;
    };
    $impl.TryISOStrToDateTime = function (aString, outDateTime) {
      var Result = false;
      var xLength = 0;
      var sDate = "";
      var sTime = "";
      var xDate = 0.0;
      var xTime = 0.0;
      xLength = aString.length;
      if (xLength === 0) return false;
      if (aString.charAt(0) === "T") {
        Result = $impl.TryISOStrToTime(pas.System.Copy(aString,2,aString.length - 1),outDateTime);
        return Result;
      };
      if (xLength in rtl.createSet(4,7,8,10)) {
        Result = $impl.TryISOStrToDate(aString,outDateTime);
        return Result;
      };
      if ((xLength > 11) && pas.SysUtils.CharInSet(aString.charAt(10),[" ","T"])) {
        sDate = pas.System.Copy(aString,1,10);
        sTime = pas.System.Copy(aString,12,aString.length);
      } else if ((xLength > 9) && pas.SysUtils.CharInSet(aString.charAt(8),[" ","T"])) {
        sDate = pas.System.Copy(aString,1,8);
        sTime = pas.System.Copy(aString,10,aString.length);
      } else return false;
      Result = $impl.TryISOStrToDate(sDate,{get: function () {
          return xDate;
        }, set: function (v) {
          xDate = v;
        }}) && $impl.TryISOStrToTime(sTime,{get: function () {
          return xTime;
        }, set: function (v) {
          xTime = v;
        }});
      if (Result) {
        outDateTime.set(xDate + xTime)}
       else outDateTime.set(0);
      return Result;
    };
    $impl.TryISOTZStrToTZOffset = function (TZ, TZOffset) {
      var Result = false;
      var H = 0;
      var M = 0;
      Result = (TZ === "Z") || (TZ === "");
      if (Result) {
        TZOffset.set(0)}
       else {
        Result = TZ.charCodeAt(0) in rtl.createSet(43,45);
        if (!Result) return Result;
        var $tmp = TZ.length;
        if ($tmp === 3) {
          Result = pas.SysUtils.TryStrToInt(pas.System.Copy(TZ,2,2),{get: function () {
              return H;
            }, set: function (v) {
              H = v;
            }});
          M = 0;
        } else if ($tmp === 5) {
          Result = pas.SysUtils.TryStrToInt(pas.System.Copy(TZ,2,2),{get: function () {
              return H;
            }, set: function (v) {
              H = v;
            }}) && pas.SysUtils.TryStrToInt(pas.System.Copy(TZ,4,2),{get: function () {
              return M;
            }, set: function (v) {
              M = v;
            }})}
         else if ($tmp === 6) {
          Result = pas.SysUtils.TryStrToInt(pas.System.Copy(TZ,2,2),{get: function () {
              return H;
            }, set: function (v) {
              H = v;
            }}) && pas.SysUtils.TryStrToInt(pas.System.Copy(TZ,5,2),{get: function () {
              return M;
            }, set: function (v) {
              M = v;
            }})}
         else {
          Result = false;
        };
        if (!Result) return Result;
        TZOffset.set((H * 60) + M);
        if (TZ.charAt(0) === "+") TZOffset.set(-TZOffset.get());
      };
      return Result;
    };
    $impl.CISO8601ToDateOptions$a$clone = function (a) {
      var b = [];
      b.length = 2;
      for (var c = 0; c < 2; c++) b[c] = rtl.refSet(a[c]);
      return b;
    };
    $mod.$rtti.$StaticArray("CISO8601ToDateOptions$a",{dims: [2], eltype: $mod.$rtti["TISO8601ToDateOptions"]});
    $impl.CISO8601ToDateOptions = [{},rtl.createSet($mod.TISO8601ToDateOption.ioReturnUTC)];
    $mod.$resourcestrings = {SLocalTimeInvalid: {org: 'The given "%s" local time is invalid (situated within the missing period prior to DST).'}};
  };
},["JS","RTLConsts"]);
rtl.module("Bcl.Utils",["System","SysUtils","Classes","JS","WEBLib.Utils"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.$rtti.$StaticArray("TBase64EncodeTable",{dims: [64], eltype: rtl.char});
  this.TTimeZoneMode = {"0": "Error", Error: 0, "1": "Ignore", Ignore: 1, "2": "AsUTC", AsUTC: 2, "3": "AsLocal", AsLocal: 3};
  this.$rtti.$Enum("TTimeZoneMode",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TTimeZoneMode});
  rtl.recNewT(this,"TTimeZoneInfo",function () {
    this.HourOff = 0;
    this.MinOff = 0;
    this.HasTimeZone = false;
    this.IsUTC = false;
    this.$eq = function (b) {
      return (this.HourOff === b.HourOff) && (this.MinOff === b.MinOff) && (this.HasTimeZone === b.HasTimeZone) && (this.IsUTC === b.IsUTC);
    };
    this.$assign = function (s) {
      this.HourOff = s.HourOff;
      this.MinOff = s.MinOff;
      this.HasTimeZone = s.HasTimeZone;
      this.IsUTC = s.IsUTC;
      return this;
    };
    this.Init = function () {
      this.HourOff = 0;
      this.MinOff = 0;
      this.HasTimeZone = false;
      this.IsUTC = false;
    };
    var $r = $mod.$rtti.$Record("TTimeZoneInfo",{},this);
    $r.addField("HourOff",rtl.longint);
    $r.addField("MinOff",rtl.longint);
    $r.addField("HasTimeZone",rtl.boolean);
    $r.addField("IsUTC",rtl.boolean);
    $r.addMethod("Init",0,[]);
  });
  rtl.createClass(this,"TBclUtils",pas.System.TObject,function () {
    this.InitFormatSettings = function (FS) {
      FS.$assign(pas.SysUtils.TFormatSettings.Create());
    };
    this.InternalISOToTime = function (Text, DateTime, TimeZone) {
      var $Self = this;
      var Result = false;
      var TextLen = 0;
      function ExtractDigit(CharIndex, Value) {
        var Result = false;
        Result = (CharIndex.get() <= TextLen) && $Self.IsDigit(Text.charAt(CharIndex.get() - 1));
        if (Result) {
          Value.set(Text.charCodeAt(CharIndex.get() - 1) - 48);
          CharIndex.set(CharIndex.get() + 1);
        };
        return Result;
      };
      function ExtractDoubleDigit(CharIndex, Value) {
        var Result = false;
        var N10 = 0;
        var N = 0;
        Result = ExtractDigit(CharIndex,{get: function () {
            return N10;
          }, set: function (v) {
            N10 = v;
          }}) && ExtractDigit(CharIndex,{get: function () {
            return N;
          }, set: function (v) {
            N = v;
          }});
        if (Result) Value.set((N10 * 10) + N);
        return Result;
      };
      function ExtractChar(CharIndex, C) {
        var Result = false;
        Result = (CharIndex.get() <= TextLen) && (Text.charAt(CharIndex.get() - 1) === C);
        if (Result) CharIndex.set(CharIndex.get() + 1);
        return Result;
      };
      function ExtractHourMinOffset(CharIndex, HourOff, MinOff) {
        var Result = false;
        if (!ExtractDoubleDigit(CharIndex,HourOff)) return false;
        ExtractChar(CharIndex,":");
        if (!ExtractDoubleDigit(CharIndex,MinOff)) return false;
        Result = CharIndex.get() > TextLen;
        return Result;
      };
      function ExtractTimeZone(CharIndex, HourOff, MinOff) {
        var Result = false;
        HourOff.set(0);
        MinOff.set(0);
        if (ExtractChar(CharIndex,"Z")) {
          Result = CharIndex.get() > TextLen;
        } else if (ExtractChar(CharIndex,"+")) {
          Result = ExtractHourMinOffset(CharIndex,HourOff,MinOff);
        } else if (ExtractChar(CharIndex,"-")) {
          Result = ExtractHourMinOffset(CharIndex,HourOff,MinOff);
          HourOff.set(-HourOff.get());
          MinOff.set(-MinOff.get());
        } else Result = false;
        return Result;
      };
      function IsFinal(CharIndex, HasTimeZone, IsUTC) {
        var Result = false;
        var C = "\x00";
        if (CharIndex.get() <= TextLen) {
          C = Text.charAt(CharIndex.get() - 1)}
         else C = "\x00";
        Result = (C === "\x00") || (C === "Z") || (C === "+") || (C === "-");
        HasTimeZone.set(C !== "\x00");
        IsUTC.set(C === "Z");
        return Result;
      };
      var Hour = 0;
      var Min = 0;
      var Sec = 0;
      var MSec = 0;
      var MsecDigit = 0;
      var HourOff = 0;
      var MinOff = 0;
      var HasTimeChar = false;
      var HasTimeZone = false;
      var IsUTC = false;
      var CharIndex = 0;
      var Mul = 0;
      DateTime.set(0);
      if (Text === "") {
        Result = true;
      } else {
        Hour = 0;
        Min = 0;
        Sec = 0;
        MSec = 0;
        HourOff = 0;
        MinOff = 0;
        HasTimeZone = false;
        IsUTC = false;
        TextLen = Text.length;
        CharIndex = 1;
        if (!ExtractDoubleDigit({get: function () {
            return CharIndex;
          }, set: function (v) {
            CharIndex = v;
          }},{get: function () {
            return Hour;
          }, set: function (v) {
            Hour = v;
          }})) return false;
        HasTimeChar = ExtractChar({get: function () {
            return CharIndex;
          }, set: function (v) {
            CharIndex = v;
          }},":");
        if (!ExtractDoubleDigit({get: function () {
            return CharIndex;
          }, set: function (v) {
            CharIndex = v;
          }},{get: function () {
            return Min;
          }, set: function (v) {
            Min = v;
          }})) return false;
        if (!IsFinal({get: function () {
            return CharIndex;
          }, set: function (v) {
            CharIndex = v;
          }},{get: function () {
            return HasTimeZone;
          }, set: function (v) {
            HasTimeZone = v;
          }},{get: function () {
            return IsUTC;
          }, set: function (v) {
            IsUTC = v;
          }})) {
          if (HasTimeChar && !ExtractChar({get: function () {
              return CharIndex;
            }, set: function (v) {
              CharIndex = v;
            }},":")) return false;
          if (!ExtractDoubleDigit({get: function () {
              return CharIndex;
            }, set: function (v) {
              CharIndex = v;
            }},{get: function () {
              return Sec;
            }, set: function (v) {
              Sec = v;
            }})) return false;
          if (!IsFinal({get: function () {
              return CharIndex;
            }, set: function (v) {
              CharIndex = v;
            }},{get: function () {
              return HasTimeZone;
            }, set: function (v) {
              HasTimeZone = v;
            }},{get: function () {
              return IsUTC;
            }, set: function (v) {
              IsUTC = v;
            }})) {
            if (!ExtractChar({get: function () {
                return CharIndex;
              }, set: function (v) {
                CharIndex = v;
              }},".")) return false;
            Mul = 100;
            do {
              if (!ExtractDigit({get: function () {
                  return CharIndex;
                }, set: function (v) {
                  CharIndex = v;
                }},{get: function () {
                  return MsecDigit;
                }, set: function (v) {
                  MsecDigit = v;
                }})) return false;
              MSec = MSec + (MsecDigit * Mul);
              Mul = rtl.trunc(Mul / 10);
            } while (!IsFinal({get: function () {
                return CharIndex;
              }, set: function (v) {
                CharIndex = v;
              }},{get: function () {
                return HasTimeZone;
              }, set: function (v) {
                HasTimeZone = v;
              }},{get: function () {
                return IsUTC;
              }, set: function (v) {
                IsUTC = v;
              }}));
          };
        };
        if (HasTimeZone) {
          if (!ExtractTimeZone({get: function () {
              return CharIndex;
            }, set: function (v) {
              CharIndex = v;
            }},{get: function () {
              return HourOff;
            }, set: function (v) {
              HourOff = v;
            }},{get: function () {
              return MinOff;
            }, set: function (v) {
              MinOff = v;
            }})) return false;
        };
        Result = pas.SysUtils.TryEncodeTime(Hour,Min,Sec,MSec,DateTime);
        if (Result) {
          TimeZone.HourOff = HourOff;
          TimeZone.MinOff = MinOff;
          TimeZone.HasTimeZone = HasTimeZone;
          TimeZone.IsUTC = IsUTC;
        };
      };
      return Result;
    };
    this.AdjustTimeZone = function (DateTime, TimeZone, TimeZoneMode) {
      var $Self = this;
      var Result = false;
      function AdjustTime(Value, HourOff, MinOff) {
        var Result = 0.0;
        var Delta = 0.0;
        Result = Value;
        Delta = pas.SysUtils.EncodeTime(Math.abs(HourOff),Math.abs(MinOff),0,0);
        if (((HourOff * 60) + MinOff) > 0) {
          Result = Result - Delta}
         else Result = Result + Delta;
        return Result;
      };
      var $tmp = TimeZoneMode;
      if ($tmp === $mod.TTimeZoneMode.Error) {
        if (TimeZone.HasTimeZone) return false}
       else if ($tmp === $mod.TTimeZoneMode.Ignore) {}
      else if ($tmp === $mod.TTimeZoneMode.AsUTC) {
        if (TimeZone.HasTimeZone) {
          DateTime.set(AdjustTime(DateTime.get(),TimeZone.HourOff,TimeZone.MinOff))}
         else {
          DateTime.set(pas.DateUtils.IncMinute(DateTime.get(),pas.SysUtils.DateTimeToJSDate(DateTime.get(),false).getTimezoneOffset()));
        }}
       else if ($tmp === $mod.TTimeZoneMode.AsLocal) if (TimeZone.HasTimeZone) {
        DateTime.set(AdjustTime(DateTime.get(),TimeZone.HourOff,TimeZone.MinOff));
        DateTime.set(pas.DateUtils.IncMinute(DateTime.get(),-pas.SysUtils.DateTimeToJSDate(DateTime.get(),false).getTimezoneOffset()));
      };
      Result = true;
      return Result;
    };
    this.DateTimeToISO = function (Value, FullNotation) {
      var Result = "";
      var Year = 0;
      var Month = 0;
      var Day = 0;
      var Hour = 0;
      var Minute = 0;
      var Second = 0;
      var MS = 0;
      if (!FullNotation && (Value === pas.DateUtils.DateOf(Value))) {
        Result = this.DateToISO(Value)}
       else {
        pas.DateUtils.DecodeDateTime(Value,{get: function () {
            return Year;
          }, set: function (v) {
            Year = v;
          }},{get: function () {
            return Month;
          }, set: function (v) {
            Month = v;
          }},{get: function () {
            return Day;
          }, set: function (v) {
            Day = v;
          }},{get: function () {
            return Hour;
          }, set: function (v) {
            Hour = v;
          }},{get: function () {
            return Minute;
          }, set: function (v) {
            Minute = v;
          }},{get: function () {
            return Second;
          }, set: function (v) {
            Second = v;
          }},{get: function () {
            return MS;
          }, set: function (v) {
            MS = v;
          }});
        if (FullNotation || (pas.DateUtils.DateOf(Value) !== 0)) {
          Result = pas.SysUtils.Format("%sT%s",pas.System.VarRecs(18,this.DateToISO(Value),18,this.TimeToISO(Value)))}
         else Result = pas.SysUtils.Format("%s",pas.System.VarRecs(18,this.TimeToISO(Value)));
      };
      return Result;
    };
    this.TryISOToDateTime = function (Value, DateTime) {
      var Result = false;
      Result = this.TryISOToDateTime$1(Value,DateTime,$mod.DefaultTimeZoneMode);
      return Result;
    };
    this.TryISOToDateTime$1 = function (Value, DateTime, TimeZoneMode) {
      var Result = false;
      var TimeZone = $mod.TTimeZoneInfo.$new();
      Result = this.TryISOToDateTime$2(Value,DateTime,TimeZone,TimeZoneMode);
      return Result;
    };
    this.TryISOToDateTime$2 = function (Value, DateTime, TimeZone, TimeZoneMode) {
      var Result = false;
      var DatePart = 0.0;
      var TimePart = 0.0;
      var TIndex = 0;
      TimeZone.Init();
      DateTime.set(0);
      if (Value === "") {
        Result = true;
      } else {
        Result = false;
        TIndex = pas.System.Pos("T",Value);
        if (TIndex > 0) {
          Result = this.TryISOToDate(pas.System.Copy(Value,1,TIndex - 1),{get: function () {
              return DatePart;
            }, set: function (v) {
              DatePart = v;
            }}) && this.InternalISOToTime(pas.System.Copy(Value,TIndex + 1,2147483647),{get: function () {
              return TimePart;
            }, set: function (v) {
              TimePart = v;
            }},TimeZone);
          if (Result) DateTime.set(DatePart + TimePart);
        } else if (this.TryISOToDate(Value,{get: function () {
            return DatePart;
          }, set: function (v) {
            DatePart = v;
          }})) {
          Result = true;
          DateTime.set(DatePart);
        } else if (this.InternalISOToTime(Value,{get: function () {
            return TimePart;
          }, set: function (v) {
            TimePart = v;
          }},TimeZone)) {
          Result = true;
          DateTime.set(TimePart);
        };
        if (Result) Result = this.AdjustTimeZone(DateTime,TimeZone,TimeZoneMode);
      };
      return Result;
    };
    this.TimeToISO = function (Value) {
      var Result = "";
      var Year = 0;
      var Month = 0;
      var Day = 0;
      var Hour = 0;
      var Minute = 0;
      var Second = 0;
      var MS = 0;
      pas.DateUtils.DecodeDateTime(Value,{get: function () {
          return Year;
        }, set: function (v) {
          Year = v;
        }},{get: function () {
          return Month;
        }, set: function (v) {
          Month = v;
        }},{get: function () {
          return Day;
        }, set: function (v) {
          Day = v;
        }},{get: function () {
          return Hour;
        }, set: function (v) {
          Hour = v;
        }},{get: function () {
          return Minute;
        }, set: function (v) {
          Minute = v;
        }},{get: function () {
          return Second;
        }, set: function (v) {
          Second = v;
        }},{get: function () {
          return MS;
        }, set: function (v) {
          MS = v;
        }});
      if ((MS !== 0) || $mod.FullISOTimeNotation) {
        Result = pas.SysUtils.Format("%.2d:%.2d:%.2d.%.3d",pas.System.VarRecs(0,Hour,0,Minute,0,Second,0,MS))}
       else if (Second !== 0) {
        Result = pas.SysUtils.Format("%.2d:%.2d:%.2d",pas.System.VarRecs(0,Hour,0,Minute,0,Second))}
       else Result = pas.SysUtils.Format("%.2d:%.2d",pas.System.VarRecs(0,Hour,0,Minute));
      return Result;
    };
    this.TryISOToTime = function (Value, DateTime) {
      var Result = false;
      Result = this.TryISOToTime$1(Value,DateTime,$mod.DefaultTimeZoneMode);
      return Result;
    };
    this.TryISOToTime$1 = function (Value, DateTime, TimeZoneMode) {
      var Result = false;
      var TimeZone = $mod.TTimeZoneInfo.$new();
      var TempDate = 0.0;
      Result = this.InternalISOToTime(Value,{get: function () {
          return TempDate;
        }, set: function (v) {
          TempDate = v;
        }},TimeZone);
      if (Result) {
        TempDate = pas.SysUtils.Date() + TempDate;
        Result = this.AdjustTimeZone({get: function () {
            return TempDate;
          }, set: function (v) {
            TempDate = v;
          }},TimeZone,TimeZoneMode);
        TempDate = pas.System.Frac(TempDate);
      };
      DateTime.set(TempDate);
      return Result;
    };
    this.DateToISO = function (Value) {
      var Result = "";
      var Year = 0;
      var Month = 0;
      var Day = 0;
      pas.SysUtils.DecodeDate(Value,{get: function () {
          return Year;
        }, set: function (v) {
          Year = v;
        }},{get: function () {
          return Month;
        }, set: function (v) {
          Month = v;
        }},{get: function () {
          return Day;
        }, set: function (v) {
          Day = v;
        }});
      Result = pas.SysUtils.Format("%.4d-%.2d-%.2d",pas.System.VarRecs(0,Year,0,Month,0,Day));
      return Result;
    };
    this.TryISOToDate = function (Text, DateTime) {
      var $Self = this;
      var Result = false;
      var TextLen = 0;
      function ExtractDigit(CharIndex, Value) {
        var Result = false;
        Result = (CharIndex.get() <= TextLen) && $Self.IsDigit(Text.charAt(CharIndex.get() - 1));
        if (Result) {
          Value.set(Text.charCodeAt(CharIndex.get() - 1) - 48);
          CharIndex.set(CharIndex.get() + 1);
        };
        return Result;
      };
      function ExtractDoubleDigit(CharIndex, Value) {
        var Result = false;
        var N10 = 0;
        var N = 0;
        Result = ExtractDigit(CharIndex,{get: function () {
            return N10;
          }, set: function (v) {
            N10 = v;
          }}) && ExtractDigit(CharIndex,{get: function () {
            return N;
          }, set: function (v) {
            N = v;
          }});
        if (Result) Value.set((N10 * 10) + N);
        return Result;
      };
      function ExtractFourDigits(CharIndex, Value) {
        var Result = false;
        var N1000 = 0;
        var N100 = 0;
        var N10 = 0;
        var N = 0;
        Result = ExtractDigit(CharIndex,{get: function () {
            return N1000;
          }, set: function (v) {
            N1000 = v;
          }}) && ExtractDigit(CharIndex,{get: function () {
            return N100;
          }, set: function (v) {
            N100 = v;
          }}) && ExtractDigit(CharIndex,{get: function () {
            return N10;
          }, set: function (v) {
            N10 = v;
          }}) && ExtractDigit(CharIndex,{get: function () {
            return N;
          }, set: function (v) {
            N = v;
          }});
        if (Result) Value.set((N1000 * 1000) + (N100 * 100) + (N10 * 10) + N);
        return Result;
      };
      function ExtractChar(CharIndex, C) {
        var Result = false;
        Result = (CharIndex.get() <= TextLen) && (Text.charAt(CharIndex.get() - 1) === C);
        if (Result) CharIndex.set(CharIndex.get() + 1);
        return Result;
      };
      function IsFinal(CharIndex) {
        var Result = false;
        var C = "\x00";
        if (CharIndex.get() <= TextLen) {
          C = Text.charAt(CharIndex.get() - 1)}
         else C = "\x00";
        Result = C === "\x00";
        return Result;
      };
      var Year = 0;
      var Month = 0;
      var Day = 0;
      var CharIndex = 0;
      var HasDateChar = false;
      var TempDate = 0.0;
      DateTime.set(0);
      if (Text === "") {
        Result = true;
      } else {
        Year = 0;
        Month = 0;
        TextLen = Text.length;
        CharIndex = 1;
        if (!ExtractFourDigits({get: function () {
            return CharIndex;
          }, set: function (v) {
            CharIndex = v;
          }},{get: function () {
            return Year;
          }, set: function (v) {
            Year = v;
          }})) return false;
        HasDateChar = ExtractChar({get: function () {
            return CharIndex;
          }, set: function (v) {
            CharIndex = v;
          }},"-");
        if (!ExtractDoubleDigit({get: function () {
            return CharIndex;
          }, set: function (v) {
            CharIndex = v;
          }},{get: function () {
            return Month;
          }, set: function (v) {
            Month = v;
          }})) return false;
        if (HasDateChar && !ExtractChar({get: function () {
            return CharIndex;
          }, set: function (v) {
            CharIndex = v;
          }},"-")) return false;
        if (!ExtractDoubleDigit({get: function () {
            return CharIndex;
          }, set: function (v) {
            CharIndex = v;
          }},{get: function () {
            return Day;
          }, set: function (v) {
            Day = v;
          }})) return false;
        if (!IsFinal({get: function () {
            return CharIndex;
          }, set: function (v) {
            CharIndex = v;
          }})) return false;
        Result = pas.SysUtils.TryEncodeDate(Year,Month,Day,{get: function () {
            return TempDate;
          }, set: function (v) {
            TempDate = v;
          }});
        if (Result) DateTime.set(TempDate);
      };
      return Result;
    };
    this.TryISOToDateLenient = function (Text, DateTime) {
      var Result = false;
      var Y = 0;
      var M = 0;
      var D = 0;
      var H = 0;
      var N = 0;
      var S = 0;
      var MS = 0;
      var Value = 0.0;
      Result = this.TryISOToDateTime$1(Text,{get: function () {
          return Value;
        }, set: function (v) {
          Value = v;
        }},$mod.TTimeZoneMode.Ignore);
      if (Result) {
        pas.DateUtils.DecodeDateTime(Value,{get: function () {
            return Y;
          }, set: function (v) {
            Y = v;
          }},{get: function () {
            return M;
          }, set: function (v) {
            M = v;
          }},{get: function () {
            return D;
          }, set: function (v) {
            D = v;
          }},{get: function () {
            return H;
          }, set: function (v) {
            H = v;
          }},{get: function () {
            return N;
          }, set: function (v) {
            N = v;
          }},{get: function () {
            return S;
          }, set: function (v) {
            S = v;
          }},{get: function () {
            return MS;
          }, set: function (v) {
            MS = v;
          }});
        DateTime.set(pas.SysUtils.EncodeDate(Y,M,D));
        Result = (H === 0) && (N === 0) && (S === 0) && (MS === 0);
      };
      return Result;
    };
    this.ISOToDate = function (Value) {
      var Result = 0.0;
      if (!this.TryISOToDate(Value,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }})) throw pas.SysUtils.EConvertError.$create("CreateFmt",[$impl.SInvalidDateFormat,pas.System.VarRecs(18,Value)]);
      return Result;
    };
    this.ISOToDateTime = function (Value) {
      var Result = 0.0;
      if (!this.TryISOToDateTime(Value,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }})) throw pas.SysUtils.EConvertError.$create("CreateFmt",[$impl.SInvalidDateFormat,pas.System.VarRecs(18,Value)]);
      return Result;
    };
    this.ISOToDateTime$1 = function (Value, TimeZoneMode) {
      var Result = 0.0;
      if (!this.TryISOToDateTime$1(Value,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }},TimeZoneMode)) throw pas.SysUtils.EConvertError.$create("CreateFmt",[$impl.SInvalidDateFormat,pas.System.VarRecs(18,Value)]);
      return Result;
    };
    this.ISOToTime = function (Value) {
      var Result = 0.0;
      if (!this.TryISOToTime(Value,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }})) throw pas.SysUtils.EConvertError.$create("CreateFmt",[$impl.SInvalidDateFormat,pas.System.VarRecs(18,Value)]);
      return Result;
    };
    var DayNames = ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];
    var MonthNames = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
    this.DateTimeToUtcString = function (Value) {
      var Result = "";
      var Y = 0;
      var M = 0;
      var D = 0;
      var H = 0;
      var Mn = 0;
      var S = 0;
      var MS = 0;
      pas.SysUtils.DecodeDate(Value,{get: function () {
          return Y;
        }, set: function (v) {
          Y = v;
        }},{get: function () {
          return M;
        }, set: function (v) {
          M = v;
        }},{get: function () {
          return D;
        }, set: function (v) {
          D = v;
        }});
      pas.SysUtils.DecodeTime(Value,{get: function () {
          return H;
        }, set: function (v) {
          H = v;
        }},{get: function () {
          return Mn;
        }, set: function (v) {
          Mn = v;
        }},{get: function () {
          return S;
        }, set: function (v) {
          S = v;
        }},{get: function () {
          return MS;
        }, set: function (v) {
          MS = v;
        }});
      Result = pas.SysUtils.Format("%s, %.2d %s %.4d %.2d:%.2d:%.2d GMT",pas.System.VarRecs(18,DayNames[pas.SysUtils.DayOfWeek(Value) - 1],0,D,18,MonthNames[M - 1],0,Y,0,H,0,Mn,0,S));
      return Result;
    };
    var EncodeTable = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/"];
    this.EncodeBase64 = function (Input) {
      var Result = "";
      Result = this.InternalEncodeBase64(Input,EncodeTable.slice(0),true);
      return Result;
    };
    var EncodeTable$1 = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","-","_"];
    this.EncodeBase64Url = function (Input) {
      var Result = "";
      Result = this.InternalEncodeBase64(Input,EncodeTable$1.slice(0),false);
      return Result;
    };
    var DecodeTable = [61,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,62,64,62,64,63,52,53,54,55,56,57,58,59,60,61,64,64,64,64,64,64,64,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,64,64,64,64,63,64,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,64,64,64,64,64];
    this.DecodeBase64 = function (Input) {
      var $Self = this;
      var Result = [];
      var StrLen = 0;
      function DecodePacket(Idx, nChars) {
        var Result = $impl.TPacket.$new();
        Result.a[0] = (DecodeTable[Input.charAt((Idx + 0) - 1).charCodeAt()] << 2) | (DecodeTable[Input.charAt((Idx + 1) - 1).charCodeAt()] >>> 4);
        nChars.set(1);
        if (((Idx + 2) <= StrLen) && (Input.charAt((Idx + 2) - 1) !== "=")) {
          nChars.set(nChars.get() + 1);
          Result.a[1] = ((DecodeTable[Input.charAt((Idx + 1) - 1).charCodeAt()] << 4) | (DecodeTable[Input.charAt((Idx + 2) - 1).charCodeAt()] >>> 2)) & 0xFF;
        };
        if (((Idx + 3) <= StrLen) && (Input.charAt((Idx + 3) - 1) !== "=")) {
          nChars.set(nChars.get() + 1);
          Result.a[2] = ((DecodeTable[Input.charAt((Idx + 2) - 1).charCodeAt()] << 6) | DecodeTable[Input.charAt((Idx + 3) - 1).charCodeAt()]) & 0xFF;
        };
        return Result;
      };
      var I = 0;
      var J = 0;
      var K = 0;
      var Packet = $impl.TPacket.$new();
      var Len = 0;
      Result = rtl.arraySetLength(Result,0,rtl.trunc((Input.length + 2) / 4) * 3);
      StrLen = Input.length;
      Len = 0;
      for (var $l = 1, $end = rtl.trunc((StrLen + 2) / 4); $l <= $end; $l++) {
        I = $l;
        Packet.$assign(DecodePacket(((I - 1) * 4) + 1,{get: function () {
            return J;
          }, set: function (v) {
            J = v;
          }}));
        K = 0;
        while (J > 0) {
          Result[Len] = Packet.a[K];
          Len += 1;
          K += 1;
          J -= 1;
        };
      };
      Result = rtl.arraySetLength(Result,0,Len);
      return Result;
    };
    this.DecodeBase64Url = function (Input) {
      var Result = [];
      Result = this.DecodeBase64(Input);
      return Result;
    };
    this.RandomBytes = function (Length) {
      var crypto = (typeof window !== 'undefined') ? (window.crypto || window.msCrypto) : null;
      return crypto.getRandomValues(new Uint8Array(Length));
    };
    this.RandomString = function (ByteLength) {
      var Result = "";
      Result = this.EncodeBase64Url(this.RandomBytes(ByteLength));
      return Result;
    };
    var HexChars$a$clone = function (a) {
      var b = [];
      b.length = 2;
      for (var c = 0; c < 2; c++) b[c] = a[c].slice(0);
      return b;
    };
    var HexChars = ["0123456789abcdef","0123456789ABCDEF"];
    this.BytesToHex = function (Bytes, AsUpperCase) {
      var Result = "";
      var ByteIndex = 0;
      var StrIndex = 0;
      var Len = 0;
      Len = rtl.length(Bytes);
      Result = rtl.strSetLength(Result,Len * 2);
      StrIndex = 1;
      for (var $l = 0, $end = Len - 1; $l <= $end; $l++) {
        ByteIndex = $l;
        Result = rtl.setCharAt(Result,StrIndex - 1,HexChars[+AsUpperCase][Bytes[ByteIndex] >>> 4]);
        Result = rtl.setCharAt(Result,(StrIndex + 1) - 1,HexChars[+AsUpperCase][Bytes[ByteIndex] & 0xf]);
        StrIndex += 2;
      };
      return Result;
    };
    this.IsDigit = function (C) {
      var Result = false;
      Result = (C >= "0") && (C <= "9");
      return Result;
    };
    this.CombineUrlFast = function (AbsoluteUrl, RelativeUrl) {
      var Result = "";
      Result = AbsoluteUrl;
      if ((Result.length > 0) && (Result.charAt(Result.length - 1) !== "/")) Result = Result + "/";
      Result = Result + RelativeUrl;
      return Result;
    };
    this.InternalEncodeBase64 = function (Input, EncodeTable, Padding) {
      var $Self = this;
      var Result = "";
      var Output = "";
      function EncodePacket(Packet, NumChars, Idx) {
        Output = rtl.setCharAt(Output,(Idx + 0) - 1,EncodeTable[Packet.a[0] >>> 2]);
        Output = rtl.setCharAt(Output,(Idx + 1) - 1,EncodeTable[((Packet.a[0] << 4) | (Packet.a[1] >>> 4)) & 0x3f]);
        if (NumChars < 2) {
          Output = rtl.setCharAt(Output,(Idx + 2) - 1,"=")}
         else Output = rtl.setCharAt(Output,(Idx + 2) - 1,EncodeTable[((Packet.a[1] << 2) | (Packet.a[2] >>> 6)) & 0x3f]);
        if (NumChars < 3) {
          Output = rtl.setCharAt(Output,(Idx + 3) - 1,"=")}
         else Output = rtl.setCharAt(Output,(Idx + 3) - 1,EncodeTable[Packet.a[2] & 0x3f]);
      };
      var I = 0;
      var K = 0;
      var J = 0;
      var Packet = $impl.TPacket.$new();
      Output = "";
      I = rtl.trunc(rtl.length(Input) / 3) * 4;
      if ((rtl.length(Input) % 3) > 0) I += 4;
      Output = rtl.strSetLength(Output,I);
      J = 1;
      for (var $l = 1, $end = rtl.trunc(rtl.length(Input) / 3); $l <= $end; $l++) {
        I = $l;
        Packet.a[0] = Input[(I - 1) * 3];
        Packet.a[1] = Input[((I - 1) * 3) + 1];
        Packet.a[2] = Input[((I - 1) * 3) + 2];
        Packet.a[3] = 0;
        EncodePacket(Packet,3,J);
        J += 4;
      };
      K = 0;
      Packet.a[0] = 0;
      Packet.a[1] = 0;
      Packet.a[2] = 0;
      Packet.a[3] = 0;
      for (var $l1 = (rtl.length(Input) - (rtl.length(Input) % 3)) + 1, $end1 = rtl.length(Input); $l1 <= $end1; $l1++) {
        I = $l1;
        Packet.a[K] = Input[I - 1];
        K += 1;
        if (I === rtl.length(Input)) EncodePacket(Packet,rtl.length(Input) % 3,J);
      };
      if (!Padding && (Output.length >= 2)) {
        if (Output.charAt(Output.length - 1 - 1) === "=") {
          Output = rtl.strSetLength(Output,Output.length - 2)}
         else if (Output.charAt(Output.length - 1) === "=") Output = rtl.strSetLength(Output,Output.length - 1);
      };
      Result = Output;
      return Result;
    };
    this.PercentEncode = function (S) {
      var Result = "";
      Result = encodeURIComponent(S);
      return Result;
    };
    this.PercentDecode = function (S) {
      var Result = "";
      Result = decodeURIComponent(S);
      return Result;
    };
  });
  this.FreeObj = function (Obj) {
    pas.SysUtils.FreeAndNil(Obj);
  };
  this.DefaultTimeZoneMode = 0;
  this.FullISOTimeNotation = false;
  $mod.$implcode = function () {
    $impl.SInvalidDateFormat = "Value %s is not a valid datetime";
    rtl.recNewT($impl,"TPacket",function () {
      this.$new = function () {
        var r = Object.create(this);
        r.a = rtl.arraySetLength(null,0,4);
        return r;
      };
      this.$eq = function (b) {
        return rtl.arrayEq(this.a,b.a);
      };
      this.$assign = function (s) {
        this.a = s.a.slice(0);
        return this;
      };
      var $r = $mod.$rtti.$Record("TPacket",{},this);
      $mod.$rtti.$StaticArray("TPacket.a$a",{dims: [4], eltype: rtl.byte});
      $r.addField("a",$mod.$rtti["TPacket.a$a"]);
    });
  };
  $mod.$init = function () {
    $mod.DefaultTimeZoneMode = $mod.TTimeZoneMode.Error;
    $mod.FullISOTimeNotation = false;
  };
},["DateUtils"]);
rtl.module("XData.Model.Types",["System","Generics.Collections","SysUtils","Bcl.SysUtils","Bcl.Collections.Common","XData.Model.Classes"],function () {
  "use strict";
  var $mod = this;
  rtl.createClass(this,"TXDataPrimitiveType",pas["XData.Model.Classes"].TXDataScalarType,function () {
    this.Destroy = function () {
      pas["XData.Model.Classes"].TXDataScalarType.Destroy.call(this);
    };
  });
  rtl.createClass(this,"TXDataBinaryType",this.TXDataPrimitiveType,function () {
    this.GetName = function () {
      var Result = "";
      Result = "Binary";
      return Result;
    };
    this.GetTypeKind = function () {
      var Result = 0;
      Result = pas["XData.Model.Classes"].TXTypeKind.xtBinary;
      return Result;
    };
    this.ValueToLiteral = function (Value, Literal) {
      var Result = false;
      Literal.set(pas["Bcl.Utils"].TBclUtils.EncodeBase64(Value));
      Result = true;
      return Result;
    };
    this.LiteralToValue = function (Literal, Value) {
      var Result = false;
      Value.set(pas["Bcl.Utils"].TBclUtils.DecodeBase64(Literal));
      Result = true;
      return Result;
    };
  });
  rtl.createClass(this,"TXDataBooleanType",this.TXDataPrimitiveType,function () {
    this.GetName = function () {
      var Result = "";
      Result = "Boolean";
      return Result;
    };
    this.GetTypeKind = function () {
      var Result = 0;
      Result = pas["XData.Model.Classes"].TXTypeKind.xtBoolean;
      return Result;
    };
    this.ValueToLiteral = function (Value, Literal) {
      var Result = false;
      if (Value) {
        Literal.set("true")}
       else Literal.set("false");
      Result = true;
      return Result;
    };
    this.LiteralToValue = function (Literal, Value) {
      var Result = false;
      if (pas.SysUtils.SameText(Literal,"true")) {
        Value.set(true);
        Result = true;
      } else if (pas.SysUtils.SameText(Literal,"false")) {
        Value.set(false);
        Result = true;
      } else Result = false;
      return Result;
    };
  });
  rtl.createClass(this,"TXDataByteType",this.TXDataPrimitiveType,function () {
    this.GetName = function () {
      var Result = "";
      Result = "Byte";
      return Result;
    };
    this.GetTypeKind = function () {
      var Result = 0;
      Result = pas["XData.Model.Classes"].TXTypeKind.xtByte;
      return Result;
    };
    this.ValueToLiteral = function (Value, Literal) {
      var Result = false;
      Literal.set(pas.SysUtils.IntToStr(Value));
      Result = true;
      return Result;
    };
    this.LiteralToValue = function (Literal, Value) {
      var Result = false;
      var V = 0;
      Result = pas.SysUtils.TryStrToInt(Literal,{get: function () {
          return V;
        }, set: function (v) {
          V = v;
        }});
      Value.set(V & 255);
      return Result;
    };
  });
  rtl.createClass(this,"TXDataDateTimeType",this.TXDataPrimitiveType,function () {
    this.GetName = function () {
      var Result = "";
      Result = "DateTime";
      return Result;
    };
    this.GetTypeKind = function () {
      var Result = 0;
      Result = pas["XData.Model.Classes"].TXTypeKind.xtDateTime;
      return Result;
    };
    this.ValueToLiteral = function (Value, Literal) {
      var Result = false;
      Result = true;
      Literal.set(pas["Bcl.Utils"].TBclUtils.DateTimeToISO(Value,false));
      return Result;
    };
    this.LiteralToValue = function (Literal, Value) {
      var Result = false;
      Result = pas["Bcl.Utils"].TBclUtils.TryISOToDateTime(Literal,Value);
      return Result;
    };
  });
  rtl.createClass(this,"TXDataDateType",this.TXDataPrimitiveType,function () {
    this.GetName = function () {
      var Result = "";
      Result = "Date";
      return Result;
    };
    this.GetTypeKind = function () {
      var Result = 0;
      Result = pas["XData.Model.Classes"].TXTypeKind.xtDate;
      return Result;
    };
    this.ValueToLiteral = function (Value, Literal) {
      var Result = false;
      Result = true;
      Literal.set(pas["Bcl.Utils"].TBclUtils.DateToISO(Value));
      return Result;
    };
    this.LiteralToValue = function (Literal, Value) {
      var Result = false;
      Result = pas["Bcl.Utils"].TBclUtils.TryISOToDateLenient(Literal,Value);
      return Result;
    };
  });
  rtl.createClass(this,"TXDataCurrencyType",this.TXDataPrimitiveType,function () {
    this.GetName = function () {
      var Result = "";
      Result = "Currency";
      return Result;
    };
    this.GetTypeKind = function () {
      var Result = 0;
      Result = pas["XData.Model.Classes"].TXTypeKind.xtCurrency;
      return Result;
    };
  });
  rtl.createClass(this,"TXDataDoubleType",this.TXDataPrimitiveType,function () {
    this.GetName = function () {
      var Result = "";
      Result = "Double";
      return Result;
    };
    this.GetTypeKind = function () {
      var Result = 0;
      Result = pas["XData.Model.Classes"].TXTypeKind.xtDouble;
      return Result;
    };
    this.ValueToLiteral = function (Value, Literal) {
      var Result = false;
      Literal.set(pas["Bcl.SysUtils"].NumberToStr(Value));
      Result = true;
      return Result;
    };
    this.LiteralToValue = function (Literal, Value) {
      var Result = false;
      Result = pas["Bcl.SysUtils"].TryStrToNumber(Literal,Value);
      return Result;
    };
  });
  rtl.createClass(this,"TXDataGuidType",this.TXDataPrimitiveType,function () {
    this.GetName = function () {
      var Result = "";
      Result = "Guid";
      return Result;
    };
    this.GetTypeKind = function () {
      var Result = 0;
      Result = pas["XData.Model.Classes"].TXTypeKind.xtGuid;
      return Result;
    };
    this.ValueToLiteral = function (Value, Literal) {
      var Result = false;
      Result = true;
      var $tmp = Value.length;
      if ($tmp === 36) {
        Literal.set(Value)}
       else if ($tmp === 38) {
        Literal.set(pas.System.Copy(Value,2,36))}
       else {
        Result = false;
      };
      return Result;
    };
    this.LiteralToValue = function (Literal, Value) {
      var Result = false;
      Result = true;
      var $tmp = Literal.length;
      if ($tmp === 36) {
        Value.set(Literal)}
       else if ($tmp === 38) {
        Value.set(pas.System.Copy(Literal,2,36))}
       else {
        Result = false;
      };
      return Result;
    };
  });
  rtl.createClass(this,"TXDataVariantType",this.TXDataPrimitiveType,function () {
    this.GetName = function () {
      var Result = "";
      Result = "Variant";
      return Result;
    };
    this.GetTypeKind = function () {
      var Result = 0;
      Result = pas["XData.Model.Classes"].TXTypeKind.xtVariant;
      return Result;
    };
    this.ValueToLiteral = function (Value, Literal) {
      var Result = false;
      var T = null;
      T = $mod.TXDataPrimitiveTypes.Instance();
      Result = true;
      var $tmp = pas.JS.GetValueType(Value);
      if ($tmp === pas.JS.TJSValueType.jvtNull) {
        Literal.set("null")}
       else if ($tmp === pas.JS.TJSValueType.jvtBoolean) {
        Result = T.FBooleanType.ValueToLiteral(!(Value == false),Literal)}
       else if ($tmp === pas.JS.TJSValueType.jvtInteger) {
        Result = T.FInt32Type.ValueToLiteral(rtl.trunc(Value),Literal)}
       else if ($tmp === pas.JS.TJSValueType.jvtFloat) {
        Result = T.FDoubleType.ValueToLiteral(rtl.getNumber(Value),Literal)}
       else if ($tmp === pas.JS.TJSValueType.jvtString) {
        Result = T.FStringType.ValueToLiteral("" + Value,Literal);
        Literal.set($mod.LiteralQuote(Literal.get()));
      } else {
        Result = false;
      };
      return Result;
    };
    this.LiteralToValue = function (Literal, Value) {
      var Result = false;
      var T = null;
      var BoolValue = false;
      var Int32Value = 0;
      var Int64Value = 0;
      var DoubleValue = 0.0;
      var StringValue = "";
      T = $mod.TXDataPrimitiveTypes.Instance();
      Result = true;
      if (Literal === "null") {
        Value.set(null)}
       else if (T.FBooleanType.LiteralToValue(Literal,{get: function () {
          return BoolValue;
        }, set: function (v) {
          BoolValue = v;
        }})) {
        Value.set(BoolValue)}
       else if (T.FInt32Type.LiteralToValue(Literal,{get: function () {
          return Int32Value;
        }, set: function (v) {
          Int32Value = v;
        }})) {
        Value.set(Int32Value)}
       else if (T.FInt64Type.LiteralToValue(Literal,{get: function () {
          return Int64Value;
        }, set: function (v) {
          Int64Value = v;
        }})) {
        Value.set(Int64Value)}
       else if (T.FDoubleType.LiteralToValue(Literal,{get: function () {
          return DoubleValue;
        }, set: function (v) {
          DoubleValue = v;
        }})) {
        Value.set(DoubleValue)}
       else if (T.FStringType.LiteralToValue(Literal,{get: function () {
          return StringValue;
        }, set: function (v) {
          StringValue = v;
        }}) && $mod.LiteralUnquote({get: function () {
          return StringValue;
        }, set: function (v) {
          StringValue = v;
        }})) {
        Value.set(StringValue)}
       else Result = false;
      return Result;
    };
  });
  rtl.createClass(this,"TXDataInt16Type",this.TXDataPrimitiveType,function () {
    this.GetName = function () {
      var Result = "";
      Result = "Int16";
      return Result;
    };
    this.GetTypeKind = function () {
      var Result = 0;
      Result = pas["XData.Model.Classes"].TXTypeKind.xtInt16;
      return Result;
    };
    this.ValueToLiteral = function (Value, Literal) {
      var Result = false;
      Literal.set(pas.SysUtils.IntToStr(Value));
      Result = true;
      return Result;
    };
    this.LiteralToValue = function (Literal, Value) {
      var Result = false;
      Result = pas.SysUtils.TryStrToInt(Literal,Value);
      return Result;
    };
  });
  rtl.createClass(this,"TXDataInt32Type",this.TXDataPrimitiveType,function () {
    this.GetName = function () {
      var Result = "";
      Result = "Int32";
      return Result;
    };
    this.GetTypeKind = function () {
      var Result = 0;
      Result = pas["XData.Model.Classes"].TXTypeKind.xtInt32;
      return Result;
    };
    this.ValueToLiteral = function (Value, Literal) {
      var Result = false;
      Literal.set(pas.SysUtils.IntToStr(Value));
      Result = true;
      return Result;
    };
    this.LiteralToValue = function (Literal, Value) {
      var Result = false;
      Result = pas.SysUtils.TryStrToInt(Literal,Value);
      return Result;
    };
  });
  rtl.createClass(this,"TXDataInt64Type",this.TXDataPrimitiveType,function () {
    this.GetName = function () {
      var Result = "";
      Result = "Int64";
      return Result;
    };
    this.GetTypeKind = function () {
      var Result = 0;
      Result = pas["XData.Model.Classes"].TXTypeKind.xtInt64;
      return Result;
    };
    this.ValueToLiteral = function (Value, Literal) {
      var Result = false;
      Literal.set(pas.SysUtils.IntToStr(Value));
      Result = true;
      return Result;
    };
    this.LiteralToValue = function (Literal, Value) {
      var Result = false;
      Result = pas.SysUtils.TryStrToInt(Literal,Value);
      return Result;
    };
  });
  rtl.createClass(this,"TXDataSByteType",this.TXDataPrimitiveType,function () {
    this.GetName = function () {
      var Result = "";
      Result = "SByte";
      return Result;
    };
    this.GetTypeKind = function () {
      var Result = 0;
      Result = pas["XData.Model.Classes"].TXTypeKind.xtSByte;
      return Result;
    };
    this.ValueToLiteral = function (Value, Literal) {
      var Result = false;
      Literal.set(pas.SysUtils.IntToStr(Value));
      Result = true;
      return Result;
    };
    this.LiteralToValue = function (Literal, Value) {
      var Result = false;
      var V = 0;
      Result = pas.SysUtils.TryStrToInt(Literal,{get: function () {
          return V;
        }, set: function (v) {
          V = v;
        }});
      Value.set(((V & 255) << 24) >> 24);
      return Result;
    };
  });
  rtl.createClass(this,"TXDataStringType",this.TXDataPrimitiveType,function () {
    this.GetName = function () {
      var Result = "";
      Result = "String";
      return Result;
    };
    this.GetTypeKind = function () {
      var Result = 0;
      Result = pas["XData.Model.Classes"].TXTypeKind.xtText;
      return Result;
    };
    this.ValueToLiteral = function (Value, Literal) {
      var Result = false;
      Literal.set(Value);
      Result = true;
      return Result;
    };
    this.LiteralToValue = function (Literal, Value) {
      var Result = false;
      Value.set(Literal);
      Result = true;
      return Result;
    };
  });
  rtl.createClass(this,"TXDataTimeType",this.TXDataPrimitiveType,function () {
    this.GetName = function () {
      var Result = "";
      Result = "Time";
      return Result;
    };
    this.GetTypeKind = function () {
      var Result = 0;
      Result = pas["XData.Model.Classes"].TXTypeKind.xtTime;
      return Result;
    };
    this.ValueToLiteral = function (Value, Literal) {
      var Result = false;
      Result = true;
      Literal.set(pas["Bcl.Utils"].TBclUtils.TimeToISO(Value));
      return Result;
    };
    this.LiteralToValue = function (Literal, Value) {
      var Result = false;
      Result = pas["Bcl.Utils"].TBclUtils.TryISOToTime(Literal,Value);
      return Result;
    };
  });
  rtl.createClass(this,"TXDataStreamType",this.TXDataPrimitiveType,function () {
    this.GetName = function () {
      var Result = "";
      Result = "Stream";
      return Result;
    };
    this.GetTypeKind = function () {
      var Result = 0;
      Result = pas["XData.Model.Classes"].TXTypeKind.xtStream;
      return Result;
    };
  });
  rtl.createClass(this,"TXDataRawType",this.TXDataPrimitiveType,function () {
    this.GetName = function () {
      var Result = "";
      Result = "Raw";
      return Result;
    };
    this.GetTypeKind = function () {
      var Result = 0;
      Result = pas["XData.Model.Classes"].TXTypeKind.xtRaw;
      return Result;
    };
  });
  rtl.createClass(this,"TXDataPrimitiveTypes",pas.System.TObject,function () {
    this.FInstance = null;
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FTypes = null;
      this.FTypeList = null;
      this.FBinaryType = null;
      this.FBooleanType = null;
      this.FByteType = null;
      this.FDateTimeType = null;
      this.FDateType = null;
      this.FDoubleType = null;
      this.FInt16Type = null;
      this.FInt32Type = null;
      this.FInt64Type = null;
      this.FSByteType = null;
      this.FStringType = null;
      this.FTimeType = null;
      this.FStreamType = null;
      this.FRawType = null;
      this.FGuidType = null;
      this.FCurrencyType = null;
      this.FVariantType = null;
    };
    this.$final = function () {
      this.FTypes = undefined;
      this.FTypeList = undefined;
      this.FBinaryType = undefined;
      this.FBooleanType = undefined;
      this.FByteType = undefined;
      this.FDateTimeType = undefined;
      this.FDateType = undefined;
      this.FDoubleType = undefined;
      this.FInt16Type = undefined;
      this.FInt32Type = undefined;
      this.FInt64Type = undefined;
      this.FSByteType = undefined;
      this.FStringType = undefined;
      this.FTimeType = undefined;
      this.FStreamType = undefined;
      this.FRawType = undefined;
      this.FGuidType = undefined;
      this.FCurrencyType = undefined;
      this.FVariantType = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.PrivateCreate = function () {
      this.FTypes = pas["Bcl.Collections.Common"].TStringMap.$create("Create$1",[false]);
      this.FTypeList = pas["Generics.Collections"].TList$$$G$$generics$collections$$TXDataPrimitiveType.$create("Create$1");
      this.FBinaryType = $mod.TXDataBinaryType.$create("Create");
      this.FBooleanType = $mod.TXDataBooleanType.$create("Create");
      this.FByteType = $mod.TXDataByteType.$create("Create");
      this.FDateTimeType = $mod.TXDataDateTimeType.$create("Create");
      this.FDateType = $mod.TXDataDateType.$create("Create");
      this.FDoubleType = $mod.TXDataDoubleType.$create("Create");
      this.FInt16Type = $mod.TXDataInt16Type.$create("Create");
      this.FInt32Type = $mod.TXDataInt32Type.$create("Create");
      this.FInt64Type = $mod.TXDataInt64Type.$create("Create");
      this.FSByteType = $mod.TXDataSByteType.$create("Create");
      this.FStringType = $mod.TXDataStringType.$create("Create");
      this.FTimeType = $mod.TXDataTimeType.$create("Create");
      this.FStreamType = $mod.TXDataStreamType.$create("Create");
      this.FRawType = $mod.TXDataRawType.$create("Create");
      this.FGuidType = $mod.TXDataGuidType.$create("Create");
      this.FCurrencyType = $mod.TXDataCurrencyType.$create("Create");
      this.FVariantType = $mod.TXDataVariantType.$create("Create");
      this.AddType(pas.SysUtils.LowerCase(this.FBinaryType.GetName()),this.FBinaryType);
      this.AddType(pas.SysUtils.LowerCase(this.FBooleanType.GetName()),this.FBooleanType);
      this.AddType(pas.SysUtils.LowerCase(this.FByteType.GetName()),this.FByteType);
      this.AddType(pas.SysUtils.LowerCase(this.FDateTimeType.GetName()),this.FDateTimeType);
      this.AddType(pas.SysUtils.LowerCase(this.FDateType.GetName()),this.FDateType);
      this.AddType(pas.SysUtils.LowerCase(this.FDoubleType.GetName()),this.FDoubleType);
      this.AddType(pas.SysUtils.LowerCase(this.FInt16Type.GetName()),this.FInt16Type);
      this.AddType(pas.SysUtils.LowerCase(this.FInt32Type.GetName()),this.FInt32Type);
      this.AddType(pas.SysUtils.LowerCase(this.FInt64Type.GetName()),this.FInt64Type);
      this.AddType(pas.SysUtils.LowerCase(this.FSByteType.GetName()),this.FSByteType);
      this.AddType(pas.SysUtils.LowerCase(this.FStringType.GetName()),this.FStringType);
      this.AddType(pas.SysUtils.LowerCase(this.FTimeType.GetName()),this.FTimeType);
      this.AddType(pas.SysUtils.LowerCase(this.FStreamType.GetName()),this.FStreamType);
      this.AddType(pas.SysUtils.LowerCase(this.FRawType.GetName()),this.FRawType);
      this.AddType(pas.SysUtils.LowerCase(this.FGuidType.GetName()),this.FGuidType);
      this.AddType(pas.SysUtils.LowerCase(this.FCurrencyType.GetName()),this.FCurrencyType);
      this.AddType(pas.SysUtils.LowerCase(this.FVariantType.GetName()),this.FVariantType);
    };
    this.PrivateDestroy = function () {
      rtl.free(this,"FTypeList");
      rtl.free(this,"FTypes");
      rtl.free(this,"FVariantType");
      rtl.free(this,"FCurrencyType");
      rtl.free(this,"FGuidType");
      rtl.free(this,"FBinaryType");
      rtl.free(this,"FBooleanType");
      rtl.free(this,"FByteType");
      rtl.free(this,"FDateTimeType");
      rtl.free(this,"FDateType");
      rtl.free(this,"FDoubleType");
      rtl.free(this,"FInt16Type");
      rtl.free(this,"FInt32Type");
      rtl.free(this,"FInt64Type");
      rtl.free(this,"FSByteType");
      rtl.free(this,"FStringType");
      rtl.free(this,"FTimeType");
      rtl.free(this,"FStreamType");
      rtl.free(this,"FRawType");
    };
    this.AddType = function (Key, Value) {
      this.FTypes.Add(Key,Value);
      this.FTypeList.Add(Value);
    };
    this.GetTypes = function () {
      var Result = null;
      Result = this.FTypeList;
      return Result;
    };
    this.Instance = function () {
      var Result = null;
      if (this.FInstance === null) {
        $mod.TXDataPrimitiveTypes.FInstance = $mod.TXDataPrimitiveTypes.$create("Create");
        this.FInstance.PrivateCreate();
      };
      Result = this.FInstance;
      return Result;
    };
    this.ClassDestroy = function () {
      if (this.FInstance !== null) {
        rtl.free(this,"FInstance");
        $mod.TXDataPrimitiveTypes.FInstance = null;
      };
    };
    this.Find = function (AName) {
      var Result = null;
      if (this.FTypes.ContainsKey(pas.SysUtils.LowerCase(AName))) {
        Result = this.FTypes.GetItem(pas.SysUtils.LowerCase(AName))}
       else Result = null;
      return Result;
    };
    this.Destroy = function () {
      this.PrivateDestroy();
      pas.System.TObject.Destroy.call(this);
    };
  });
  this.LiteralQuote = function (Str) {
    var Result = "";
    Result = pas.SysUtils.StringReplace(Str,"'","''",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
    Result = "'" + Result + "'";
    return Result;
  };
  this.LiteralUnquote = function (Str) {
    var Result = false;
    var Len = 0;
    Result = true;
    Len = Str.get().length;
    if ((Len >= 2) && (Str.get().charAt(0) === "'") && (Str.get().charAt(Len - 1) === "'")) {
      Str.set(pas.System.Copy(Str.get(),2,Len - 2));
      Str.set(pas.SysUtils.StringReplace(Str.get(),"''","'",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll)));
    };
    return Result;
  };
},["JS","Bcl.Utils"]);
rtl.module("XData.Types.Converters",["System","SysUtils","Bcl.Rtti.Common","JS","XData.Model.Classes"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  rtl.createClass(this,"TXDataTypeBaseConverter",pas["XData.Model.Classes"].TXDataTypeConverter,function () {
  });
  rtl.createClass(this,"TXDataInt32Converter",this.TXDataTypeBaseConverter,function () {
    this.GetXDataType = function () {
      var Result = null;
      Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FInt32Type;
      return Result;
    };
    this.TryValueToUrl = function (Value, Literal) {
      var Result = false;
      Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FInt32Type.ValueToLiteral(pas["Bcl.Rtti.Common"].TValue_AsInteger(Value),Literal);
      return Result;
    };
    this.TryUrlToValue = function (Literal, Value) {
      var Result = false;
      var IntValue = 0;
      Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FInt32Type.LiteralToValue(Literal,{get: function () {
          return IntValue;
        }, set: function (v) {
          IntValue = v;
        }});
      Value.set(IntValue);
      return Result;
    };
  });
  rtl.createClass(this,"TXDataInt16Converter",this.TXDataTypeBaseConverter,function () {
    this.GetXDataType = function () {
      var Result = null;
      Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FInt16Type;
      return Result;
    };
    this.TryValueToUrl = function (Value, Literal) {
      var Result = false;
      Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FInt16Type.ValueToLiteral(pas["Bcl.Rtti.Common"].TValue_AsInteger(Value),Literal);
      return Result;
    };
    this.TryUrlToValue = function (Literal, Value) {
      var Result = false;
      var IntValue = 0;
      Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FInt16Type.LiteralToValue(Literal,{get: function () {
          return IntValue;
        }, set: function (v) {
          IntValue = v;
        }});
      Value.set(IntValue);
      return Result;
    };
  });
  rtl.createClass(this,"TXDataBooleanConverter",this.TXDataTypeBaseConverter,function () {
    this.GetXDataType = function () {
      var Result = null;
      Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FBooleanType;
      return Result;
    };
    this.TryValueToUrl = function (Value, Literal) {
      var Result = false;
      Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FBooleanType.ValueToLiteral(pas["Bcl.Rtti.Common"].TValue_AsBoolean(Value),Literal);
      return Result;
    };
    this.TryUrlToValue = function (Literal, Value) {
      var Result = false;
      var BoolValue = false;
      Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FBooleanType.LiteralToValue(Literal,{get: function () {
          return BoolValue;
        }, set: function (v) {
          BoolValue = v;
        }});
      if (Result) Value.set(BoolValue);
      return Result;
    };
  });
  rtl.createClass(this,"TXDataDoubleConverter",this.TXDataTypeBaseConverter,function () {
    this.GetXDataType = function () {
      var Result = null;
      Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FDoubleType;
      return Result;
    };
    this.TryValueToUrl = function (Value, Literal) {
      var Result = false;
      Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FDoubleType.ValueToLiteral(pas["Bcl.Rtti.Common"].TValue_AsExtended(Value),Literal);
      return Result;
    };
    this.TryUrlToValue = function (Literal, Value) {
      var Result = false;
      var DoubleValue = 0.0;
      Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FDoubleType.LiteralToValue(Literal,{get: function () {
          return DoubleValue;
        }, set: function (v) {
          DoubleValue = v;
        }});
      if (Result) Value.set(DoubleValue);
      return Result;
    };
  });
  rtl.createClass(this,"TXDataDateTimeConverter",this.TXDataTypeBaseConverter,function () {
    this.GetXDataType = function () {
      var Result = null;
      Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FDateTimeType;
      return Result;
    };
    this.TryValueToUrl = function (Value, Literal) {
      var Result = false;
      if (rtl.isString(Value)) {
        Result = true;
        Literal.set("" + Value);
      } else Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FDateTimeType.ValueToLiteral(pas["Bcl.Rtti.Common"].TValue_AsDouble(Value),Literal);
      return Result;
    };
    this.TryUrlToValue = function (Literal, Value) {
      var Result = false;
      var DateValue = 0.0;
      Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FDateTimeType.LiteralToValue(Literal,{get: function () {
          return DateValue;
        }, set: function (v) {
          DateValue = v;
        }});
      if (Result) Value.set(pas["Bcl.Rtti.Common"].TValue_FromDateTime(DateValue));
      return Result;
    };
  });
  rtl.createClass(this,"TXDataDateConverter",this.TXDataTypeBaseConverter,function () {
    this.GetXDataType = function () {
      var Result = null;
      Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FDateType;
      return Result;
    };
    this.TryValueToUrl = function (Value, Literal) {
      var Result = false;
      if (rtl.isString(Value)) {
        Result = true;
        Literal.set("" + Value);
      } else Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FDateType.ValueToLiteral(pas["Bcl.Rtti.Common"].TValue_AsDouble(Value),Literal);
      return Result;
    };
    this.TryUrlToValue = function (Literal, Value) {
      var Result = false;
      var DateValue = 0.0;
      Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FDateType.LiteralToValue(Literal,{get: function () {
          return DateValue;
        }, set: function (v) {
          DateValue = v;
        }});
      if (Result) Value.set(pas["Bcl.Rtti.Common"].TValue_FromDate(DateValue));
      return Result;
    };
  });
  rtl.createClass(this,"TXDataTimeConverter",this.TXDataTypeBaseConverter,function () {
    this.GetXDataType = function () {
      var Result = null;
      Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FTimeType;
      return Result;
    };
    this.TryValueToUrl = function (Value, Literal) {
      var Result = false;
      if (rtl.isString(Value)) {
        Result = true;
        Literal.set("" + Value);
      } else Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FTimeType.ValueToLiteral(pas["Bcl.Rtti.Common"].TValue_AsDouble(Value),Literal);
      return Result;
    };
    this.TryUrlToValue = function (Literal, Value) {
      var Result = false;
      var TimeValue = 0.0;
      Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FTimeType.LiteralToValue(Literal,{get: function () {
          return TimeValue;
        }, set: function (v) {
          TimeValue = v;
        }});
      if (Result) Value.set(pas["Bcl.Rtti.Common"].TValue_FromTime(TimeValue));
      return Result;
    };
  });
  rtl.createClass(this,"TXDataBinaryConverter",this.TXDataTypeBaseConverter,function () {
    this.GetXDataType = function () {
      var Result = null;
      Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FBinaryType;
      return Result;
    };
    this.TryValueToUrl = function (Value, Literal) {
      var Result = false;
      var Bytes = [];
      Bytes = pas["Bcl.Rtti.Common"].TValue_AsBytes(Value);
      Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FBinaryType.ValueToLiteral(rtl.arrayRef(Bytes),Literal);
      Literal.set(pas["XData.Model.Types"].LiteralQuote(Literal.get()));
      return Result;
    };
    this.TryUrlToValue = function (Literal, Value) {
      var Result = false;
      var Bytes = [];
      var StringValue = "";
      StringValue = Literal;
      pas["XData.Model.Types"].LiteralUnquote({get: function () {
          return StringValue;
        }, set: function (v) {
          StringValue = v;
        }});
      Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FBinaryType.LiteralToValue(StringValue,{get: function () {
          return Bytes;
        }, set: function (v) {
          Bytes = v;
        }});
      if (Result) Value.set(pas["Bcl.Rtti.Common"].TValue_FromBytes(Bytes));
      return Result;
    };
  });
  rtl.createClass(this,"TXDataStringConverter",this.TXDataTypeBaseConverter,function () {
    this.GetXDataType = function () {
      var Result = null;
      Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FStringType;
      return Result;
    };
    this.TryValueToUrl = function (Value, Literal) {
      var Result = false;
      Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FStringType.ValueToLiteral(pas["XData.Model.Types"].LiteralQuote(pas["Bcl.Rtti.Common"].TValue_AsString(Value)),Literal);
      return Result;
    };
    this.TryUrlToValue = function (Literal, Value) {
      var Result = false;
      var StringValue = "";
      Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FStringType.LiteralToValue(Literal,{get: function () {
          return StringValue;
        }, set: function (v) {
          StringValue = v;
        }}) && pas["XData.Model.Types"].LiteralUnquote({get: function () {
          return StringValue;
        }, set: function (v) {
          StringValue = v;
        }});
      if (Result) Value.set(StringValue);
      return Result;
    };
  });
  rtl.createClass(this,"TXDataUnquotedStringConverter",this.TXDataStringConverter,function () {
    this.TryValueToUrl = function (Value, Literal) {
      var Result = false;
      Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FStringType.ValueToLiteral(pas["Bcl.Rtti.Common"].TValue_AsString(Value),Literal);
      return Result;
    };
  });
  rtl.createClass(this,"TXDataCharConverter",this.TXDataTypeBaseConverter,function () {
    this.GetXDataType = function () {
      var Result = null;
      Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FStringType;
      return Result;
    };
    this.TryValueToUrl = function (Value, Literal) {
      var Result = false;
      Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FStringType.ValueToLiteral(pas["XData.Model.Types"].LiteralQuote(pas["Bcl.Rtti.Common"].TValue_AsString(Value)),Literal);
      return Result;
    };
    this.TryUrlToValue = function (Literal, Value) {
      var Result = false;
      var StringValue = "";
      Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FStringType.LiteralToValue(Literal,{get: function () {
          return StringValue;
        }, set: function (v) {
          StringValue = v;
        }}) && pas["XData.Model.Types"].LiteralUnquote({get: function () {
          return StringValue;
        }, set: function (v) {
          StringValue = v;
        }});
      if (Result) Value.set(StringValue);
      return Result;
    };
  });
  rtl.createClass(this,"TXDataGuidConverter",this.TXDataTypeBaseConverter,function () {
    this.GetXDataType = function () {
      var Result = null;
      Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FGuidType;
      return Result;
    };
    this.TryValueToUrl = function (Value, Literal) {
      var Result = false;
      Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FGuidType.ValueToLiteral(pas["Bcl.Rtti.Common"].TValue_AsString(Value),Literal);
      return Result;
    };
    this.TryUrlToValue = function (Literal, Value) {
      var Result = false;
      var GuidValue = "";
      Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FGuidType.LiteralToValue(Literal,{get: function () {
          return GuidValue;
        }, set: function (v) {
          GuidValue = v;
        }});
      if (Result) Value.set(GuidValue);
      return Result;
    };
  });
  rtl.createClass(this,"TXDataVariantConverter",this.TXDataTypeBaseConverter,function () {
    this.GetXDataType = function () {
      var Result = null;
      Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FVariantType;
      return Result;
    };
    this.TryValueToUrl = function (Value, Literal) {
      var Result = false;
      Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FVariantType.ValueToLiteral(Value,Literal);
      return Result;
    };
    this.TryUrlToValue = function (Literal, Value) {
      var Result = false;
      var VariantValue = undefined;
      Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FVariantType.LiteralToValue(Literal,{get: function () {
          return VariantValue;
        }, set: function (v) {
          VariantValue = v;
        }});
      return Result;
    };
  });
  rtl.createClass(this,"TXDataEnumConverter",pas["XData.Model.Classes"].TXDataTypeConverter,function () {
    this.$init = function () {
      pas["XData.Model.Classes"].TXDataTypeConverter.$init.call(this);
      this.FEnumType = null;
    };
    this.$final = function () {
      this.FEnumType = undefined;
      pas["XData.Model.Classes"].TXDataTypeConverter.$final.call(this);
    };
    this.GetXDataType = function () {
      var Result = null;
      Result = this.FEnumType;
      return Result;
    };
    this.TryValueToUrl = function (Value, Literal) {
      var Result = false;
      var I = 0;
      var EnumValue = 0;
      EnumValue = pas["Bcl.Rtti.Common"].TValue_AsOrdinal(Value);
      Result = false;
      for (var $l = 0, $end = this.FEnumType.FMembers.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (EnumValue === this.FEnumType.FMembers.GetItem$1(I).FValue) {
          Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().FStringType.ValueToLiteral(this.FEnumType.FMembers.GetItem$1(I).FName,Literal);
          return Result;
        };
      };
      return Result;
    };
    this.TryUrlToValue = function (Literal, Value) {
      var Result = false;
      var I = 0;
      var StringValue = "";
      StringValue = Literal;
      Result = false;
      if (pas["XData.Model.Types"].LiteralUnquote({get: function () {
          return StringValue;
        }, set: function (v) {
          StringValue = v;
        }})) for (var $l = 0, $end = this.FEnumType.FMembers.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (StringValue === this.FEnumType.FMembers.GetItem$1(I).FName) {
          Value.set(this.FEnumType.FMembers.GetItem$1(I).FValue);
          return true;
        };
      };
      return Result;
    };
    this.Create$1 = function (AEnumType) {
      this.FEnumType = AEnumType;
      return this;
    };
  });
  $mod.$implcode = function () {
    $impl.AddDefaultUrlConverters = function () {
      var Types = null;
      Types = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance();
      Types.FInt32Type.FUrlConverter = $mod.TXDataInt32Converter.$create("Create");
      Types.FInt16Type.FUrlConverter = $mod.TXDataInt16Converter.$create("Create");
      Types.FInt64Type.FUrlConverter = $mod.TXDataInt32Converter.$create("Create");
      Types.FBooleanType.FUrlConverter = $mod.TXDataBooleanConverter.$create("Create");
      Types.FDoubleType.FUrlConverter = $mod.TXDataDoubleConverter.$create("Create");
      Types.FCurrencyType.FUrlConverter = $mod.TXDataDoubleConverter.$create("Create");
      Types.FDateTimeType.FUrlConverter = $mod.TXDataDateTimeConverter.$create("Create");
      Types.FDateType.FUrlConverter = $mod.TXDataDateConverter.$create("Create");
      Types.FTimeType.FUrlConverter = $mod.TXDataTimeConverter.$create("Create");
      Types.FBinaryType.FUrlConverter = $mod.TXDataBinaryConverter.$create("Create");
      Types.FStreamType.FUrlConverter = $mod.TXDataBinaryConverter.$create("Create");
      Types.FStringType.FUrlConverter = $mod.TXDataStringConverter.$create("Create");
      Types.FGuidType.FUrlConverter = $mod.TXDataGuidConverter.$create("Create");
      Types.FVariantType.FUrlConverter = $mod.TXDataVariantConverter.$create("Create");
    };
  };
  $mod.$init = function () {
    $impl.AddDefaultUrlConverters();
  };
},["XData.Model.Types"]);
rtl.module("XData.Utils",["System","SysUtils"],function () {
  "use strict";
  var $mod = this;
  rtl.createClass(this,"TXDataUtils",pas.System.TObject,function () {
    this.GetNameAndKey = function (Input, Name, Key) {
      var Result = false;
      var P1 = 0;
      var Len = 0;
      var KeyLen = 0;
      P1 = pas.System.Pos("(",Input);
      Len = Input.length;
      KeyLen = Len - P1 - 1;
      Result = (P1 > 1) && (Len >= 4) && (Input.charAt(Len - 1) === ")") && (KeyLen > 0);
      if (Result) {
        Name.set(pas.System.Copy(Input,1,P1 - 1));
        Key.set(pas.System.Copy(Input,P1 + 1,KeyLen));
      };
      return Result;
    };
    this.GetQualifiedName = function (AQualifiedName, APrefix, AName) {
      var I = 0;
      var Len = 0;
      Len = AQualifiedName.length;
      I = Len;
      while (I > 0) {
        if (AQualifiedName.charAt(I - 1) === ".") break;
        I -= 1;
      };
      if (I > 0) {
        APrefix.set(pas.System.Copy(AQualifiedName,1,I - 1));
        AName.set(pas.System.Copy(AQualifiedName,I + 1,2147483647));
      } else {
        APrefix.set("");
        AName.set(AQualifiedName);
      };
    };
    this.XSBoolean = function (S, ADefault) {
      var Result = false;
      if (S === "") return ADefault;
      Result = (S === "true") || (S === "1") || (S === "yes");
      return Result;
    };
    this.CombineUrlFast = function (AbsoluteUrl, RelativeUrl) {
      var Result = "";
      Result = AbsoluteUrl;
      if ((Result.length > 0) && (Result.charAt(Result.length - 1) !== "/")) Result = Result + "/";
      Result = Result + RelativeUrl;
      return Result;
    };
    this.DateTimeToUnix = function (Value) {
      var Result = 0;
      Result = Math.round((Value - 25569) * 86400);
      return Result;
    };
    this.DateTimeToJson = function (Value) {
      var Result = "";
      Result = pas.SysUtils.Format("\\/Date(%d)\\/",pas.System.VarRecs(0,this.DateTimeToUnix(Value) * 1000));
      return Result;
    };
  });
});
rtl.module("XData.Model.Classes",["System","Classes","SysUtils","Types","StrUtils","TypInfo","contnrs","Bcl.Json.Attributes","Bcl.Collections.Common","Bcl.Rtti.Common"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.$rtti.$Class("TXDataEntityType");
  this.$rtti.$Class("TXDataStructuredType");
  this.$rtti.$Class("TXDataInstanceType");
  this.TXTypeKind = {"0": "xtUndefined", xtUndefined: 0, "1": "xtText", xtText: 1, "2": "xtInt32", xtInt32: 2, "3": "xtInt64", xtInt64: 3, "4": "xtDouble", xtDouble: 4, "5": "xtBoolean", xtBoolean: 5, "6": "xtDateTime", xtDateTime: 6, "7": "xtDate", xtDate: 7, "8": "xtTime", xtTime: 8, "9": "xtCurrency", xtCurrency: 9, "10": "xtGuid", xtGuid: 10, "11": "xtVariant", xtVariant: 11, "12": "xtBinary", xtBinary: 12, "13": "xtStream", xtStream: 13, "14": "xtInt16", xtInt16: 14, "15": "xtByte", xtByte: 15, "16": "xtSByte", xtSByte: 16, "17": "xtEntity", xtEntity: 17, "18": "xtEntityCollection", xtEntityCollection: 18, "19": "xtEnum", xtEnum: 19, "20": "xtScalarCollection", xtScalarCollection: 20, "21": "xtRaw", xtRaw: 21, "22": "xtInstance", xtInstance: 22, "23": "xtInstanceCollection", xtInstanceCollection: 23};
  this.$rtti.$Enum("TXTypeKind",{minvalue: 0, maxvalue: 23, ordtype: 1, enumtype: this.TXTypeKind});
  this.$rtti.$Class("TXDataSchema");
  this.$rtti.$Class("TXDataModel");
  this.$rtti.$Class("TXDataTypeConverter");
  rtl.createClass(this,"TXDataModelObject",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FData = undefined;
      this.FOwnsDataObject = false;
      this.FDescription = "";
      this.FParent = null;
    };
    this.$final = function () {
      this.FParent = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Destroy = function () {
      pas.System.TObject.Destroy.call(this);
    };
    var $r = this.$rtti;
    $r.attr = [pas["Bcl.Json.Attributes"].JsonIncludeAttribute,"Create$1",[pas["Bcl.Json.Attributes"].TInclusionMode.NonDefault]];
  });
  rtl.createClass(this,"TXDataOwnedList",pas.contnrs.TObjectList,function () {
    this.$init = function () {
      pas.contnrs.TObjectList.$init.call(this);
      this.FOwner = null;
    };
    this.$final = function () {
      this.FOwner = undefined;
      pas.contnrs.TObjectList.$final.call(this);
    };
    this.Notify = function (Ptr, Action) {
      if (this.FOwner === null) return;
      if (Action === pas.Classes.TListNotification.lnAdded) {
        rtl.getObject(Ptr).FParent = this.FOwner}
       else rtl.getObject(Ptr).FParent = null;
      pas.contnrs.TObjectList.Notify.apply(this,arguments);
    };
    this.Create$4 = function (AOwner) {
      pas.contnrs.TObjectList.Create$3.call(this,AOwner !== null);
      this.FOwner = AOwner;
      return this;
    };
    this.Create$5 = function () {
      this.Create$4(null);
      return this;
    };
  });
  rtl.createClass(this,"TXDataType",this.TXDataModelObject,function () {
    this.$init = function () {
      $mod.TXDataModelObject.$init.call(this);
      this.FName = "";
      this.FUrlConverter = null;
    };
    this.$final = function () {
      this.FUrlConverter = undefined;
      $mod.TXDataModelObject.$final.call(this);
    };
    this.GetName = function () {
      var Result = "";
      Result = this.FName;
      return Result;
    };
    this.GetIsCollection = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    this.GetWrappedType = function () {
      var Result = null;
      Result = null;
      return Result;
    };
    this.GetTypeKind = function () {
      var Result = 0;
      Result = $mod.TXTypeKind.xtUndefined;
      return Result;
    };
    this.QualifiedName = function () {
      var Result = "";
      Result = this.GetName();
      return Result;
    };
  });
  this.$rtti.$Class("TXDataScalarCollectionType");
  rtl.createClass(this,"TXDataScalarType",this.TXDataType,function () {
    this.$init = function () {
      $mod.TXDataType.$init.call(this);
      this.FCollection = null;
    };
    this.$final = function () {
      this.FCollection = undefined;
      $mod.TXDataType.$final.call(this);
    };
    this.GetCollection = function () {
      var Result = null;
      if (this.FCollection === null) {
        this.FCollection = $mod.TXDataScalarCollectionType.$create("Create");
        this.FCollection.FItemType = this;
      };
      Result = this.FCollection;
      return Result;
    };
    this.Destroy = function () {
      rtl.free(this,"FCollection");
      $mod.TXDataModelObject.Destroy.call(this);
    };
  });
  rtl.createClass(this,"TXDataEnumMember",this.TXDataModelObject,function () {
    this.$init = function () {
      $mod.TXDataModelObject.$init.call(this);
      this.FName = "";
      this.FValue = 0;
    };
  });
  rtl.createClass(this,"TXDataEnumMemberList",pas.contnrs.TObjectList,function () {
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
  });
  rtl.createClass(this,"TXDataEnumType",this.TXDataScalarType,function () {
    this.$init = function () {
      $mod.TXDataScalarType.$init.call(this);
      this.FMembers = null;
    };
    this.$final = function () {
      this.FMembers = undefined;
      $mod.TXDataScalarType.$final.call(this);
    };
    this.GetSchema = function () {
      var Result = null;
      Result = this.FParent;
      return Result;
    };
    this.GetTypeKind = function () {
      var Result = 0;
      Result = $mod.TXTypeKind.xtEnum;
      return Result;
    };
    this.QualifiedName = function () {
      var Result = "";
      Result = this.GetName();
      if (this.GetSchema() !== null) {
        if (this.GetSchema().FAlias !== "") {
          Result = this.GetSchema().FAlias + "." + this.GetName()}
         else if (this.GetSchema().FNamespace !== "") Result = this.GetSchema().FNamespace + "." + this.GetName();
      };
      return Result;
    };
    this.Create$1 = function () {
      this.FMembers = $mod.TXDataEnumMemberList.$create("Create$2");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FMembers");
      $mod.TXDataScalarType.Destroy.call(this);
    };
    this.AddMember = function (AName, AValue) {
      var Result = null;
      Result = $mod.TXDataEnumMember.$create("Create");
      this.FMembers.Add$1(Result);
      Result.FName = AName;
      Result.FValue = AValue;
      return Result;
    };
    var $r = this.$rtti;
    $r.attr = [pas["Bcl.Json.Attributes"].JsonIncludeAttribute,"Create$1",[pas["Bcl.Json.Attributes"].TInclusionMode.NonDefault]];
  });
  rtl.createClass(this,"TXDataEnumTypeList",this.TXDataOwnedList,function () {
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
  });
  rtl.createClass(this,"TXDataScalarCollectionType",this.TXDataScalarType,function () {
    this.$init = function () {
      $mod.TXDataScalarType.$init.call(this);
      this.FItemType = null;
    };
    this.$final = function () {
      this.FItemType = undefined;
      $mod.TXDataScalarType.$final.call(this);
    };
    this.GetIsCollection = function () {
      var Result = false;
      Result = true;
      return Result;
    };
    this.GetName = function () {
      var Result = "";
      if (this.FItemType !== null) {
        Result = pas.SysUtils.Format("Collection(%s)",pas.System.VarRecs(18,this.FItemType.GetName()))}
       else Result = "Collection()";
      return Result;
    };
    this.GetWrappedType = function () {
      var Result = null;
      Result = this.FItemType;
      return Result;
    };
    this.GetTypeKind = function () {
      var Result = 0;
      Result = $mod.TXTypeKind.xtScalarCollection;
      return Result;
    };
    this.QualifiedName = function () {
      var Result = "";
      if (this.FItemType !== null) {
        Result = pas.SysUtils.Format("Collection(%s)",pas.System.VarRecs(18,this.FItemType.QualifiedName()))}
       else Result = "Collection()";
      return Result;
    };
  });
  this.TDocRequired = {"0": "Default", Default: 0, "1": "Required", Required: 1, "2": "NotRequired", NotRequired: 2};
  this.$rtti.$Enum("TDocRequired",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TDocRequired});
  rtl.createClass(this,"TXDataProperty",this.TXDataModelObject,function () {
    this.$init = function () {
      $mod.TXDataModelObject.$init.call(this);
      this.FName = "";
      this.FRequired = false;
      this.FDocRequired = 0;
    };
    this.GetParent = function () {
      var Result = null;
      Result = this.FParent;
      return Result;
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      return this;
    };
    this.Destroy = function () {
      $mod.TXDataModelObject.Destroy.call(this);
    };
    this.QualifiedName = function () {
      var Result = "";
      if (this.GetParent() !== null) {
        Result = this.GetParent().QualifiedName() + "." + this.FName}
       else Result = this.FName;
      return Result;
    };
    var $r = this.$rtti;
    $r.attr = [pas["Bcl.Json.Attributes"].JsonIncludeAttribute,"Create$1",[pas["Bcl.Json.Attributes"].TInclusionMode.NonDefault]];
  });
  rtl.createClass(this,"TXDataPropertyList",pas.contnrs.TObjectList,function () {
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
  });
  rtl.createClass(this,"TXDataScalarProperty",this.TXDataProperty,function () {
    this.$init = function () {
      $mod.TXDataProperty.$init.call(this);
      this.FType = null;
      this.FLength = 0;
      this.FPrecision = 0;
      this.FScale = 0;
      this.FTypeRef = "";
      this.FDefaultValue = undefined;
      this.FHasDefaultValue = false;
    };
    this.$final = function () {
      this.FType = undefined;
      $mod.TXDataProperty.$final.call(this);
    };
    this.SetType = function (Value) {
      this.FType = Value;
    };
    this.GetUrlConverter = function () {
      var Result = null;
      if (this.FType !== null) {
        Result = this.FType.FUrlConverter}
       else Result = null;
      return Result;
    };
    this.GetTypeRef = function () {
      var Result = "";
      if (this.FType !== null) {
        Result = this.FType.GetName()}
       else Result = "";
      return Result;
    };
    this.SetDefaultValue = function (Value) {
      this.FDefaultValue = Value;
      this.FHasDefaultValue = true;
    };
    this.GetTypeKind = function () {
      var Result = 0;
      if (this.FType === null) {
        Result = $mod.TXTypeKind.xtUndefined}
       else Result = this.FType.GetTypeKind();
      return Result;
    };
    this.GetValueType = function () {
      var Result = null;
      Result = this.FType;
      return Result;
    };
    this.IsSimple = function () {
      var Result = false;
      Result = true;
      return Result;
    };
    var $r = this.$rtti;
    $r.attr = [pas["Bcl.Json.Attributes"].JsonIncludeAttribute,"Create$1",[pas["Bcl.Json.Attributes"].TInclusionMode.NonDefault]];
  });
  rtl.createClass(this,"TXDataSimpleProperty",this.TXDataScalarProperty,function () {
    this.GetParent$1 = function () {
      var Result = null;
      Result = this.GetParent();
      return Result;
    };
    this.Prepare = function () {
      if (this.FTypeRef !== "") {
        this.SetType(this.GetParent$1().GetSchema().FindScalarType(this.FTypeRef));
        if (this.FType === null) throw $mod.EModelReferenceNotFound.$create("CreateFmt",["Property type %s not found for property %s.%s",pas.System.VarRecs(18,this.FTypeRef,18,this.GetParent$1().GetName(),18,this.FName)]);
        this.FTypeRef = "";
      };
      if (this.FType.FUrlConverter === null) throw $mod.EUrlConverterNotFound.$create("Create$2",[this.FType]);
    };
  });
  rtl.createClass(this,"TXDataInstanceSimpleProperty",this.TXDataScalarProperty,function () {
    this.GetParent$1 = function () {
      var Result = null;
      Result = this.GetParent();
      return Result;
    };
    this.Prepare = function () {
      if (this.FTypeRef !== "") {
        this.SetType(this.GetParent$1().GetSchema().FindScalarType(this.FTypeRef));
        this.FTypeRef = "";
      };
    };
  });
  rtl.createClass(this,"TXDataSimplePropertyList",this.TXDataOwnedList,function () {
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
  });
  rtl.createClass(this,"TXDataInstanceScalarPropertyList",this.TXDataOwnedList,function () {
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
  });
  rtl.createClass(this,"TXDataStructuredProperty",this.TXDataProperty,function () {
    this.$init = function () {
      $mod.TXDataProperty.$init.call(this);
      this.FTargetRef = "";
    };
    this.GetTargetRef = function () {
      var Result = "";
      if (this.GetTarget() !== null) {
        Result = this.GetTarget().GetName()}
       else Result = this.FTargetRef;
      return Result;
    };
    this.GetValueType = function () {
      var Result = null;
      Result = this.GetTarget();
      return Result;
    };
    this.IsSimple = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    var $r = this.$rtti;
    $r.attr = [pas["Bcl.Json.Attributes"].JsonIncludeAttribute,"Create$1",[pas["Bcl.Json.Attributes"].TInclusionMode.NonDefault]];
  });
  rtl.createClass(this,"TXDataInstanceNavigationProperty",this.TXDataStructuredProperty,function () {
    this.$init = function () {
      $mod.TXDataStructuredProperty.$init.call(this);
      this.FTarget = null;
    };
    this.$final = function () {
      this.FTarget = undefined;
      $mod.TXDataStructuredProperty.$final.call(this);
    };
    this.GetParent$1 = function () {
      var Result = null;
      Result = this.GetParent();
      return Result;
    };
    this.Prepare = function () {
      if (this.FTargetRef !== "") {
        this.FTarget = this.GetParent$1().GetSchema().FindEntityType(this.FTargetRef);
        if (this.FTarget === null) this.FTarget = this.GetParent$1().GetSchema().FindInstanceType(this.FTargetRef);
        this.FTargetRef = "";
      };
    };
    this.GetTypeKind = function () {
      var Result = 0;
      if (this.FTarget === null) return $mod.TXTypeKind.xtUndefined;
      if ($mod.TXDataEntityType.isPrototypeOf(this.FTarget)) {
        if (this.FTarget.GetIsCollection()) {
          Result = $mod.TXTypeKind.xtEntityCollection}
         else Result = $mod.TXTypeKind.xtEntity;
      } else {
        if (this.FTarget.GetIsCollection()) {
          Result = $mod.TXTypeKind.xtInstanceCollection}
         else Result = $mod.TXTypeKind.xtInstance;
      };
      return Result;
    };
    this.GetTarget = function () {
      var Result = null;
      Result = this.FTarget;
      return Result;
    };
    var $r = this.$rtti;
    $r.attr = [pas["Bcl.Json.Attributes"].JsonIncludeAttribute,"Create$1",[pas["Bcl.Json.Attributes"].TInclusionMode.NonDefault]];
  });
  rtl.createClass(this,"TXDataNavigationProperty",this.TXDataStructuredProperty,function () {
    this.$init = function () {
      $mod.TXDataStructuredProperty.$init.call(this);
      this.FTarget = null;
    };
    this.$final = function () {
      this.FTarget = undefined;
      $mod.TXDataStructuredProperty.$final.call(this);
    };
    this.GetParent$1 = function () {
      var Result = null;
      Result = this.GetParent();
      return Result;
    };
    this.Prepare = function () {
      if (this.FTargetRef !== "") {
        this.FTarget = this.GetParent$1().GetSchema().FindEntityType(this.FTargetRef);
        if (this.FTarget === null) throw $mod.EModelReferenceNotFound.$create("CreateFmt",["Target %s not found for navigation property %s.%s",pas.System.VarRecs(18,this.FTargetRef,18,this.GetParent$1().GetName(),18,this.FName)]);
        this.FTargetRef = "";
      };
    };
    this.GetTypeKind = function () {
      var Result = 0;
      if ((this.FTarget !== null) && this.FTarget.GetIsCollection()) {
        Result = $mod.TXTypeKind.xtEntityCollection}
       else Result = $mod.TXTypeKind.xtEntity;
      return Result;
    };
    this.GetTarget = function () {
      var Result = null;
      Result = this.FTarget;
      return Result;
    };
    var $r = this.$rtti;
    $r.attr = [pas["Bcl.Json.Attributes"].JsonIncludeAttribute,"Create$1",[pas["Bcl.Json.Attributes"].TInclusionMode.NonDefault]];
  });
  rtl.createClass(this,"TXDataNavigationPropertyList",this.TXDataOwnedList,function () {
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
  });
  rtl.createClass(this,"TXDataInstanceNavigationPropertyList",this.TXDataOwnedList,function () {
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
  });
  this.$rtti.$DynArray("TXDataSimplePropertyArray",{eltype: this.$rtti["TXDataSimpleProperty"]});
  rtl.createClass(this,"TXDataStructuredType",this.TXDataType,function () {
    this.GetSchema = function () {
      var Result = null;
      Result = this.FParent;
      return Result;
    };
    this.FindScalarProperty = function (AName) {
      var Result = null;
      var Prop = null;
      var I = 0;
      for (var $l = 0, $end = this.ScalarPropertyCount() - 1; $l <= $end; $l++) {
        I = $l;
        Prop = this.GetScalarProperty(I);
        if (pas.SysUtils.SameText(AName,Prop.FName)) return Prop;
      };
      Result = null;
      return Result;
    };
    this.FindStructuredProperty = function (AName) {
      var Result = null;
      var Prop = null;
      var I = 0;
      for (var $l = 0, $end = this.StructuredPropertyCount() - 1; $l <= $end; $l++) {
        I = $l;
        Prop = this.GetStructuredProperty(I);
        if (pas.SysUtils.SameText(AName,Prop.FName)) return Prop;
      };
      Result = null;
      return Result;
    };
    this.FindAnyProperty = function (AName) {
      var Result = null;
      Result = this.FindScalarProperty(AName);
      if (Result === null) Result = this.FindStructuredProperty(AName);
      return Result;
    };
  });
  this.$rtti.$Class("TXDataInstanceCollectionType");
  rtl.createClass(this,"TXDataInstanceType",this.TXDataStructuredType,function () {
    this.$init = function () {
      $mod.TXDataStructuredType.$init.call(this);
      this.FBaseType = null;
      this.FProperties = null;
      this.FNavigationProperties = null;
      this.FCollection = null;
      this.FBaseTypeRef = "";
    };
    this.$final = function () {
      this.FBaseType = undefined;
      this.FProperties = undefined;
      this.FNavigationProperties = undefined;
      this.FCollection = undefined;
      $mod.TXDataStructuredType.$final.call(this);
    };
    this.GetBaseTypeRef = function () {
      var Result = "";
      if (this.FBaseType !== null) {
        Result = this.FBaseType.GetName()}
       else Result = "";
      return Result;
    };
    this.Prepare = function () {
      var I = 0;
      if (this.FBaseTypeRef !== "") {
        this.FBaseType = this.GetSchema().FindInstanceType(this.FBaseTypeRef);
        if (this.FBaseType === null) throw $mod.EModelReferenceNotFound.$create("CreateFmt",["BaseType %s not found for instance type %s",pas.System.VarRecs(18,this.FBaseTypeRef,18,this.GetName())]);
        this.FBaseTypeRef = "";
      };
      if (this.FBaseType !== null) this.FBaseType.Prepare();
      for (var $l = 0, $end = this.FProperties.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.FProperties.GetItem$1(I).Prepare();
      };
      for (var $l1 = 0, $end1 = this.FNavigationProperties.GetCount() - 1; $l1 <= $end1; $l1++) {
        I = $l1;
        this.FNavigationProperties.GetItem$1(I).Prepare();
      };
    };
    this.GetCollection = function () {
      var Result = null;
      if (this.FCollection === null) {
        this.FCollection = $mod.TXDataInstanceCollectionType.$create("Create$1");
        this.FCollection.FItemType = this;
        this.FCollection.FParent = this.FParent;
      };
      Result = this.FCollection;
      return Result;
    };
    this.GetTypeKind = function () {
      var Result = 0;
      Result = $mod.TXTypeKind.xtInstance;
      return Result;
    };
    this.ScalarPropertyCount = function () {
      var Result = 0;
      Result = this.FProperties.GetCount();
      return Result;
    };
    this.GetScalarProperty = function (Index) {
      var Result = null;
      Result = this.FProperties.GetItem$1(Index);
      return Result;
    };
    this.StructuredPropertyCount = function () {
      var Result = 0;
      Result = this.FNavigationProperties.GetCount();
      return Result;
    };
    this.GetStructuredProperty = function (Index) {
      var Result = null;
      Result = this.FNavigationProperties.GetItem$1(Index);
      return Result;
    };
    this.QualifiedName = function () {
      var Result = "";
      Result = this.GetName();
      if (this.GetSchema() !== null) {
        if (this.GetSchema().FAlias !== "") {
          Result = this.GetSchema().FAlias + "." + this.GetName()}
         else if (this.GetSchema().FNamespace !== "") Result = this.GetSchema().FNamespace + "." + this.GetName();
      };
      return Result;
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FProperties = $mod.TXDataInstanceScalarPropertyList.$create("Create$4",[this]);
      this.FNavigationProperties = $mod.TXDataInstanceNavigationPropertyList.$create("Create$4",[this]);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FNavigationProperties");
      rtl.free(this,"FProperties");
      rtl.free(this,"FCollection");
      $mod.TXDataModelObject.Destroy.call(this);
    };
    var $r = this.$rtti;
    $r.attr = [pas["Bcl.Json.Attributes"].JsonIncludeAttribute,"Create$1",[pas["Bcl.Json.Attributes"].TInclusionMode.NonDefault]];
  });
  rtl.createClass(this,"TXDataInstanceCollectionType",this.TXDataInstanceType,function () {
    this.$init = function () {
      $mod.TXDataInstanceType.$init.call(this);
      this.FItemType = null;
    };
    this.$final = function () {
      this.FItemType = undefined;
      $mod.TXDataInstanceType.$final.call(this);
    };
    this.GetName = function () {
      var Result = "";
      if (this.FItemType !== null) {
        Result = pas.SysUtils.Format("Collection(%s)",pas.System.VarRecs(18,this.FItemType.GetName()))}
       else Result = "Collection()";
      return Result;
    };
    this.GetIsCollection = function () {
      var Result = false;
      Result = true;
      return Result;
    };
    this.GetWrappedType = function () {
      var Result = null;
      Result = this.FItemType;
      return Result;
    };
    this.GetTypeKind = function () {
      var Result = 0;
      Result = $mod.TXTypeKind.xtInstanceCollection;
      return Result;
    };
    this.QualifiedName = function () {
      var Result = "";
      if (this.FItemType !== null) {
        Result = pas.SysUtils.Format("Collection(%s)",pas.System.VarRecs(18,this.FItemType.QualifiedName()))}
       else Result = "Collection()";
      return Result;
    };
  });
  this.$rtti.$Class("TXDataEntityCollectionType");
  this.$rtti.$Class("TXDataEntitySet");
  rtl.createClass(this,"TXDataEntityType",this.TXDataStructuredType,function () {
    this.$init = function () {
      $mod.TXDataStructuredType.$init.call(this);
      this.FKey = null;
      this.FBaseType = null;
      this.FProperties = null;
      this.FNavigationProperties = null;
      this.FCollection = null;
      this.FDefaultEntitySet = null;
      this.FBaseTypeRef = "";
      this.FKeyRef = [];
    };
    this.$final = function () {
      this.FKey = undefined;
      this.FBaseType = undefined;
      this.FProperties = undefined;
      this.FNavigationProperties = undefined;
      this.FCollection = undefined;
      this.FDefaultEntitySet = undefined;
      this.FKeyRef = undefined;
      $mod.TXDataStructuredType.$final.call(this);
    };
    this.GetBaseTypeRef = function () {
      var Result = "";
      if (this.FBaseType !== null) {
        Result = this.FBaseType.GetName()}
       else Result = "";
      return Result;
    };
    this.GetKeyRef = function () {
      var Result = [];
      var I = 0;
      Result = rtl.arraySetLength(Result,"",this.FKey.GetCount());
      for (var $l = 0, $end = this.FKey.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        Result[I] = this.FKey.GetItem$1(I).FName;
      };
      return Result;
    };
    this.Prepare = function () {
      var KeyItem = "";
      var TempProp = null;
      var I = 0;
      if (this.FBaseTypeRef !== "") {
        this.FBaseType = this.GetSchema().FindEntityType(this.FBaseTypeRef);
        if (this.FBaseType === null) throw $mod.EModelReferenceNotFound.$create("CreateFmt",["BaseType %s not found for entity type %s",pas.System.VarRecs(18,this.FBaseTypeRef,18,this.GetName())]);
        this.FBaseTypeRef = "";
      };
      if (this.FBaseType !== null) this.FBaseType.Prepare();
      if (rtl.length(this.FKeyRef) > 0) {
        this.FKey.Clear();
        for (var $l = 0, $end = rtl.length(this.FKeyRef) - 1; $l <= $end; $l++) {
          I = $l;
          KeyItem = this.FKeyRef[I];
          TempProp = this.FindProperty(KeyItem);
          if (TempProp === null) TempProp = this.FindNavigationProperty(KeyItem);
          if (TempProp === null) throw $mod.EModelReferenceNotFound.$create("CreateFmt",["Key property %s not found on entity type %s",pas.System.VarRecs(18,KeyItem,18,this.GetName())]);
          this.FKey.Add$1(TempProp);
        };
        this.FKeyRef = rtl.arraySetLength(this.FKeyRef,"",0);
      };
      for (var $l1 = 0, $end1 = this.FProperties.GetCount() - 1; $l1 <= $end1; $l1++) {
        I = $l1;
        this.FProperties.GetItem$1(I).Prepare();
      };
      for (var $l2 = 0, $end2 = this.FNavigationProperties.GetCount() - 1; $l2 <= $end2; $l2++) {
        I = $l2;
        this.FNavigationProperties.GetItem$1(I).Prepare();
      };
    };
    this.GetCollection = function () {
      var Result = null;
      if (this.FCollection === null) {
        this.FCollection = $mod.TXDataEntityCollectionType.$create("Create$1");
        this.FCollection.FItemType = this;
        this.FCollection.FParent = this.FParent;
      };
      Result = this.FCollection;
      return Result;
    };
    this.GetTypeKind = function () {
      var Result = 0;
      Result = $mod.TXTypeKind.xtEntity;
      return Result;
    };
    this.ScalarPropertyCount = function () {
      var Result = 0;
      Result = this.FProperties.GetCount();
      return Result;
    };
    this.GetScalarProperty = function (Index) {
      var Result = null;
      Result = this.FProperties.GetItem$1(Index);
      return Result;
    };
    this.StructuredPropertyCount = function () {
      var Result = 0;
      Result = this.FNavigationProperties.GetCount();
      return Result;
    };
    this.GetStructuredProperty = function (Index) {
      var Result = null;
      Result = this.FNavigationProperties.GetItem$1(Index);
      return Result;
    };
    this.QualifiedName = function () {
      var Result = "";
      Result = this.GetName();
      if (this.GetSchema() !== null) {
        if (this.GetSchema().FAlias !== "") {
          Result = this.GetSchema().FAlias + "." + this.GetName()}
         else if (this.GetSchema().FNamespace !== "") Result = this.GetSchema().FNamespace + "." + this.GetName();
      };
      return Result;
    };
    this.FindScalarProperty = function (AName) {
      var Result = null;
      Result = $mod.TXDataStructuredType.FindScalarProperty.call(this,AName);
      if ((Result === null) && (this.FBaseType !== null)) Result = this.FBaseType.FindScalarProperty(AName);
      return Result;
    };
    this.FindStructuredProperty = function (AName) {
      var Result = null;
      Result = $mod.TXDataStructuredType.FindStructuredProperty.call(this,AName);
      if ((Result === null) && (this.FBaseType !== null)) Result = this.FBaseType.FindStructuredProperty(AName);
      return Result;
    };
    this.FindProperty = function (AName) {
      var Result = null;
      Result = this.FindScalarProperty(AName);
      return Result;
    };
    this.FindNavigationProperty = function (AName) {
      var Result = null;
      Result = this.FindStructuredProperty(AName);
      return Result;
    };
    this.IsInheritedFrom = function (ABase) {
      var Result = false;
      if (ABase === this) {
        Result = true}
       else Result = (this.FBaseType !== null) && this.FBaseType.IsInheritedFrom(ABase);
      return Result;
    };
    this.RootType = function () {
      var Result = null;
      Result = this;
      while (Result.FBaseType !== null) Result = Result.FBaseType;
      return Result;
    };
    this.KeyScalarProperties = function () {
      var $Self = this;
      var Result = [];
      function FillKeyConverters(AType, KeyProps) {
        var Key = null;
        var I = 0;
        AType = AType.RootType();
        for (var $l = 0, $end = AType.FKey.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          Key = AType.FKey.GetItem$1(I);
          if (Key.IsSimple()) {
            KeyProps.set(rtl.arraySetLength(KeyProps.get(),null,rtl.length(KeyProps.get()) + 1));
            KeyProps.get()[rtl.length(KeyProps.get()) - 1] = Key;
          } else FillKeyConverters(Key.FTarget,KeyProps);
        };
      };
      var KeyProps = [];
      KeyProps = rtl.arraySetLength(KeyProps,null,0);
      FillKeyConverters($Self,{get: function () {
          return KeyProps;
        }, set: function (v) {
          KeyProps = v;
        }});
      Result = rtl.arrayRef(KeyProps);
      return Result;
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FKey = $mod.TXDataPropertyList.$create("Create$3",[false]);
      this.FProperties = $mod.TXDataSimplePropertyList.$create("Create$4",[this]);
      this.FNavigationProperties = $mod.TXDataNavigationPropertyList.$create("Create$4",[this]);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FKey");
      rtl.free(this,"FNavigationProperties");
      rtl.free(this,"FProperties");
      rtl.free(this,"FCollection");
      $mod.TXDataModelObject.Destroy.call(this);
    };
    var $r = this.$rtti;
    $r.attr = [pas["Bcl.Json.Attributes"].JsonIncludeAttribute,"Create$1",[pas["Bcl.Json.Attributes"].TInclusionMode.NonDefault]];
  });
  rtl.createClass(this,"TXDataEntityCollectionType",this.TXDataEntityType,function () {
    this.$init = function () {
      $mod.TXDataEntityType.$init.call(this);
      this.FItemType = null;
    };
    this.$final = function () {
      this.FItemType = undefined;
      $mod.TXDataEntityType.$final.call(this);
    };
    this.GetName = function () {
      var Result = "";
      if (this.FItemType !== null) {
        Result = pas.SysUtils.Format("Collection(%s)",pas.System.VarRecs(18,this.FItemType.GetName()))}
       else Result = "Collection()";
      return Result;
    };
    this.GetIsCollection = function () {
      var Result = false;
      Result = true;
      return Result;
    };
    this.GetWrappedType = function () {
      var Result = null;
      Result = this.FItemType;
      return Result;
    };
    this.GetTypeKind = function () {
      var Result = 0;
      Result = $mod.TXTypeKind.xtEntityCollection;
      return Result;
    };
    this.QualifiedName = function () {
      var Result = "";
      if (this.FItemType !== null) {
        Result = pas.SysUtils.Format("Collection(%s)",pas.System.VarRecs(18,this.FItemType.QualifiedName()))}
       else Result = "Collection()";
      return Result;
    };
  });
  this.$rtti.$Class("TXDataEntityContainer");
  rtl.createClass(this,"TXDataEntitySet",this.TXDataModelObject,function () {
    this.$init = function () {
      $mod.TXDataModelObject.$init.call(this);
      this.FName = "";
      this.FEntityType = null;
      this.FTagName = "";
      this.FTagGroup = "";
      this.FEntityTypeRef = "";
    };
    this.$final = function () {
      this.FEntityType = undefined;
      $mod.TXDataModelObject.$final.call(this);
    };
    this.GetContainer = function () {
      var Result = null;
      Result = this.FParent;
      return Result;
    };
    this.GetEntityTypeRef = function () {
      var Result = "";
      if (this.FEntityType !== null) {
        Result = this.FEntityType.GetName()}
       else Result = "";
      return Result;
    };
    this.Prepare = function () {
      if (this.FEntityTypeRef !== "") {
        this.FEntityType = this.GetContainer().GetSchema().FindEntityType(this.FEntityTypeRef);
        if (this.FEntityType === null) throw $mod.EModelReferenceNotFound.$create("CreateFmt",["EntityType not found: %s",pas.System.VarRecs(18,this.FEntityTypeRef)]);
        this.FEntityTypeRef = "";
      };
    };
    var $r = this.$rtti;
    $r.attr = [pas["Bcl.Json.Attributes"].JsonIncludeAttribute,"Create$1",[pas["Bcl.Json.Attributes"].TInclusionMode.NonDefault]];
  });
  rtl.createClass(this,"TXDataEntitySetList",this.TXDataOwnedList,function () {
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
  });
  rtl.createClass(this,"TXDataEntityContainer",this.TXDataModelObject,function () {
    this.$init = function () {
      $mod.TXDataModelObject.$init.call(this);
      this.FName = "";
      this.FEntitySets = null;
    };
    this.$final = function () {
      this.FEntitySets = undefined;
      $mod.TXDataModelObject.$final.call(this);
    };
    this.GetSchema = function () {
      var Result = null;
      Result = this.FParent;
      return Result;
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FEntitySets = $mod.TXDataEntitySetList.$create("Create$4",[this]);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FEntitySets");
      $mod.TXDataModelObject.Destroy.call(this);
    };
    this.FindEntitySet = function (AName) {
      var Result = null;
      var EntitySet = null;
      var I = 0;
      for (var $l = 0, $end = this.FEntitySets.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        EntitySet = this.FEntitySets.GetItem$1(I);
        if (pas.SysUtils.SameText(EntitySet.FName,AName)) return EntitySet;
      };
      Result = null;
      return Result;
    };
    var $r = this.$rtti;
    $r.attr = [pas["Bcl.Json.Attributes"].JsonIncludeAttribute,"Create$1",[pas["Bcl.Json.Attributes"].TInclusionMode.NonDefault]];
  });
  rtl.createClass(this,"TXDataEntityContainerList",this.TXDataOwnedList,function () {
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
  });
  this.$rtti.$Class("TXDataAction");
  this.TBindingMode = {"0": "FromBody", FromBody: 0, "1": "FromURI", FromURI: 1, "2": "FromPath", FromPath: 2};
  this.$rtti.$Enum("TBindingMode",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TBindingMode});
  rtl.createClass(this,"TXDataParamDef",this.TXDataModelObject,function () {
    this.$init = function () {
      $mod.TXDataModelObject.$init.call(this);
      this.FName = "";
      this.FTypeRef = "";
      this.FTypeNameRef = "";
      this.FDocRequired = 0;
      this.FType = null;
      this.FBindingMode = 0;
      this.FOutput = false;
      this.FInput = false;
      this.FDefaultValue = undefined;
      this.FHasDefaultValue = false;
    };
    this.$final = function () {
      this.FType = undefined;
      $mod.TXDataModelObject.$final.call(this);
    };
    this.GetUrlConverter = function () {
      var Result = null;
      if (this.FType !== null) {
        Result = this.FType.FUrlConverter}
       else Result = null;
      return Result;
    };
    this.GetTypeRef = function () {
      var Result = "";
      if ((this.FType !== null) && $mod.TXDataScalarType.isPrototypeOf(this.FType) && !this.FType.GetIsCollection()) {
        Result = this.FType.GetName()}
       else Result = "";
      return Result;
    };
    this.GetTypeNameRef = function () {
      var Result = "";
      if ((this.FType !== null) && (this.GetTypeRef() === "")) {
        Result = this.FType.GetName()}
       else Result = "";
      return Result;
    };
    this.Prepare = function () {
      if (this.FTypeRef !== "") {
        this.FType = this.GetParent().GetController().GetSchema().FindType(this.FTypeRef);
        if (this.FType === null) throw $mod.EModelReferenceNotFound.$create("CreateFmt",["Param type %s not found for property %s.%s",pas.System.VarRecs(18,this.FTypeRef,18,this.GetParent().FName,18,this.FName)]);
        this.FTypeRef = "";
      };
      if (this.FTypeNameRef !== "") {
        this.FType = this.GetParent().GetController().GetSchema().FindType(this.FTypeNameRef);
        this.FTypeNameRef = "";
      };
    };
    this.SetDefaultValue = function (Value) {
      this.FDefaultValue = Value;
      this.FHasDefaultValue = true;
    };
    this.GetParent = function () {
      var Result = null;
      Result = this.FParent;
      return Result;
    };
    this.Index = function () {
      var Result = 0;
      Result = this.GetParent().IndexOf(this);
      return Result;
    };
    var $r = this.$rtti;
    $r.attr = [pas["Bcl.Json.Attributes"].JsonIncludeAttribute,"Create$1",[pas["Bcl.Json.Attributes"].TInclusionMode.NonDefault]];
  });
  rtl.createClass(this,"TXDataParamDefList",this.TXDataOwnedList,function () {
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
  });
  rtl.createClass(this,"EFromURIBindingNotSupported",pas.SysUtils.Exception,function () {
    this.Create$2 = function (AParam) {
      var ParamTypeName = "";
      if (AParam.FType !== null) {
        ParamTypeName = AParam.FType.GetName()}
       else ParamTypeName = "(undefined)";
      pas.SysUtils.Exception.CreateFmt.call(this,'Cannot define action "%s": Type "%s" for param "%s" cannot be bound from URI',pas.System.VarRecs(18,AParam.GetParent().FName,18,ParamTypeName,18,AParam.FName));
      return this;
    };
  });
  this.$rtti.$Class("TXDataController");
  rtl.createClass(this,"TXDataRouteSegment",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FParamName = "";
      this.FValue = "";
      this.FParamIndex = 0;
      this.FIsParam = false;
    };
    this.Create$1 = function (AValue) {
      this.FValue = AValue;
      if ((this.FValue.length >= 3) && (this.FValue.charAt(0) === "{") && (this.FValue.charAt(this.FValue.length - 1) === "}")) {
        this.FIsParam = true;
        this.FParamName = pas.System.Copy(this.FValue,2,this.FValue.length - 2);
      };
      return this;
    };
  });
  rtl.createClass(this,"TXDataRouteSegmentList",this.TXDataOwnedList,function () {
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
  });
  rtl.createClass(this,"TXDataRouteInfo",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FSegments = null;
      this.FParamCount = 0;
      this.FPriority = 0;
    };
    this.$final = function () {
      this.FSegments = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.GetSegment = function (Index) {
      var Result = null;
      Result = this.FSegments.GetItem$1(Index);
      return Result;
    };
    this.GetSegmentCount = function () {
      var Result = 0;
      Result = this.FSegments.GetCount();
      return Result;
    };
    this.Create$1 = function () {
      this.FSegments = $mod.TXDataRouteSegmentList.$create("Create$5");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FSegments");
      pas.System.TObject.Destroy.call(this);
    };
    this.Process = function (ARoute) {
      var I = 0;
      var StrSegments = [];
      StrSegments = $impl.SplitString(ARoute,"/");
      for (var $l = 0, $end = rtl.length(StrSegments) - 1; $l <= $end; $l++) {
        I = $l;
        if (StrSegments[I] !== "") this.FSegments.Add$1($mod.TXDataRouteSegment.$create("Create$1",[StrSegments[I]]));
      };
      this.FPriority = 0;
      this.FParamCount = 0;
      for (var $l1 = 0, $end1 = this.GetSegmentCount() - 1; $l1 <= $end1; $l1++) {
        I = $l1;
        if (this.GetSegment(I).FIsParam) {
          this.FParamCount += 1}
         else this.FPriority = this.FPriority | (1 << (16 - I));
      };
    };
  });
  rtl.createClass(this,"TXDataAction",this.TXDataModelObject,function () {
    this.$init = function () {
      $mod.TXDataModelObject.$init.call(this);
      this.FName = "";
      this.FParameters = null;
      this.FHttpMethod = "";
      this.FIsParamStream = false;
      this.FIsResultStream = false;
      this.FIsResultCriteria = false;
      this.FIsResultSingleObject = false;
      this.FOperationId = "";
      this.FConsumes = "";
      this.FRemarks = "";
      this.FRouteInfo = null;
      this.FReturnType = null;
      this.FIsDeprecated = false;
      this.FReturnTypeRef = "";
    };
    this.$final = function () {
      this.FParameters = undefined;
      this.FRouteInfo = undefined;
      this.FReturnType = undefined;
      $mod.TXDataModelObject.$final.call(this);
    };
    this.ParamCount = function (Binding) {
      var Result = 0;
      var I = 0;
      Result = 0;
      for (var $l = 0, $end = this.FParameters.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (this.FParameters.GetItem$1(I).FBindingMode === Binding) Result += 1;
      };
      return Result;
    };
    this.GetParam = function (Binding, Index) {
      var Result = null;
      var I = 0;
      var CurIndex = 0;
      Result = null;
      CurIndex = -1;
      for (var $l = 0, $end = this.FParameters.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (this.FParameters.GetItem$1(I).FBindingMode === Binding) {
          CurIndex += 1;
          if (Index === CurIndex) {
            Result = this.FParameters.GetItem$1(I);
            return Result;
          };
        };
      };
      $impl.ErrorOutOfRange();
      return Result;
    };
    this.GetReturnTypeRef = function () {
      var Result = "";
      if (this.FReturnType !== null) {
        Result = this.FReturnType.GetName()}
       else Result = "";
      return Result;
    };
    this.Prepare = function () {
      var ParamDefIndex = 0;
      var ParamDef = null;
      var Segment = null;
      var I = 0;
      for (var $l = 0, $end = this.FParameters.GetCount() - 1; $l <= $end; $l++) {
        ParamDefIndex = $l;
        ParamDef = this.FParameters.GetItem$1(ParamDefIndex);
        ParamDef.Prepare();
      };
      if (this.FReturnTypeRef !== "") {
        this.FReturnType = this.GetController().GetSchema().FindType(this.FReturnTypeRef);
        if (this.FReturnType === null) throw $mod.EModelReferenceNotFound.$create("CreateFmt",["Return type %s not found for action %s.%s",pas.System.VarRecs(18,this.FReturnTypeRef,18,this.GetController().FName,18,this.FName)]);
        this.FReturnTypeRef = "";
      };
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FRouteInfo;
        }, set: function (v) {
          this.p.FRouteInfo = v;
        }});
      this.FRouteInfo = $mod.TXDataRouteInfo.$create("Create$1");
      this.FRouteInfo.Process(this.GetController().FName + "/" + this.FName);
      for (var $l1 = 0, $end1 = this.FRouteInfo.GetSegmentCount() - 1; $l1 <= $end1; $l1++) {
        I = $l1;
        Segment = this.FRouteInfo.GetSegment(I);
        if (Segment.FIsParam) {
          Segment.FParamIndex = -1;
          for (var $l2 = 0, $end2 = this.PathParamCount() - 1; $l2 <= $end2; $l2++) {
            ParamDefIndex = $l2;
            if (pas.SysUtils.SameText(this.GetPathParam(ParamDefIndex).FName,Segment.FParamName)) {
              Segment.FParamIndex = ParamDefIndex;
              break;
            };
          };
          if (Segment.FParamIndex === -1) throw $mod.EXDataInvalidRouteParam.$create("Create$2",[this,Segment.FValue]);
        };
      };
    };
    this.GetBodyParam = function (Index) {
      var Result = null;
      Result = this.GetParam($mod.TBindingMode.FromBody,Index);
      return Result;
    };
    this.GetPathParam = function (Index) {
      var Result = null;
      Result = this.GetParam($mod.TBindingMode.FromPath,Index);
      return Result;
    };
    this.GetQueryParam = function (Index) {
      var Result = null;
      Result = this.GetParam($mod.TBindingMode.FromURI,Index);
      return Result;
    };
    this.GetController = function () {
      var Result = null;
      Result = this.FParent;
      return Result;
    };
    this.HasOutputParams = function () {
      var Result = false;
      var ParamDef = null;
      var I = 0;
      for (var $l = 0, $end = this.FParameters.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        ParamDef = this.FParameters.GetItem$1(I);
        if (ParamDef.FOutput) return true;
      };
      Result = false;
      return Result;
    };
    this.IsFormContent = function () {
      var Result = false;
      Result = pas.SysUtils.SameText(this.FConsumes,"application/x-www-form-urlencoded");
      return Result;
    };
    this.IsJsonContent = function () {
      var Result = false;
      Result = (this.FConsumes === "") || pas.SysUtils.SameText(this.FConsumes,"application/json");
      return Result;
    };
    this.Create$1 = function () {
      this.FHttpMethod = "POST";
      this.FParameters = $mod.TXDataParamDefList.$create("Create$4",[this]);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FParameters");
      rtl.free(this,"FRouteInfo");
      $mod.TXDataModelObject.Destroy.call(this);
    };
    this.FindParameter = function (AName) {
      var Result = null;
      var I = 0;
      I = this.IndexOfParameter(AName);
      if (I >= 0) {
        Result = this.FParameters.GetItem$1(I)}
       else Result = null;
      return Result;
    };
    this.IndexOfParameter = function (AName) {
      var Result = 0;
      var I = 0;
      for (var $l = 0, $end = this.FParameters.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (pas.SysUtils.SameText(this.FParameters.GetItem$1(I).FName,AName)) return I;
      };
      Result = -1;
      return Result;
    };
    this.IndexOf = function (Param) {
      var Result = 0;
      Result = this.FParameters.IndexOf$1(Param);
      return Result;
    };
    this.ParamStreamIndex = function () {
      var Result = 0;
      var I = 0;
      for (var $l = 0, $end = this.FParameters.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if ((this.FParameters.GetItem$1(I).FType != null) && (this.FParameters.GetItem$1(I).FType.GetTypeKind() === $mod.TXTypeKind.xtRaw)) {
          Result = I;
          return Result;
        };
      };
      if (this.FIsParamStream) {
        Result = 0}
       else Result = -1;
      return Result;
    };
    this.BodyParamCount = function () {
      var Result = 0;
      Result = this.ParamCount($mod.TBindingMode.FromBody);
      return Result;
    };
    this.QueryParamCount = function () {
      var Result = 0;
      Result = this.ParamCount($mod.TBindingMode.FromURI);
      return Result;
    };
    this.RequiredPathParamCount = function () {
      var Result = 0;
      var I = 0;
      Result = 0;
      for (var $l = 0, $end = this.FParameters.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (this.FParameters.GetItem$1(I).FBindingMode === $mod.TBindingMode.FromPath) if (!this.FParameters.GetItem$1(I).FHasDefaultValue) Result += 1;
      };
      return Result;
    };
    this.PathParamCount = function () {
      var Result = 0;
      Result = this.ParamCount($mod.TBindingMode.FromPath);
      return Result;
    };
    var $r = this.$rtti;
    $r.attr = [pas["Bcl.Json.Attributes"].JsonIncludeAttribute,"Create$1",[pas["Bcl.Json.Attributes"].TInclusionMode.NonDefault]];
  });
  rtl.createClass(this,"TXDataActionList",this.TXDataOwnedList,function () {
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
  });
  rtl.createClass(this,"TXDataController",this.TXDataModelObject,function () {
    this.$init = function () {
      $mod.TXDataModelObject.$init.call(this);
      this.FName = "";
      this.FActions = null;
      this.FServiceClass = null;
      this.FRouteInfo = null;
      this.FTagName = "";
      this.FTagGroup = "";
    };
    this.$final = function () {
      this.FActions = undefined;
      this.FServiceClass = undefined;
      this.FRouteInfo = undefined;
      $mod.TXDataModelObject.$final.call(this);
    };
    this.GetSchema = function () {
      var Result = null;
      Result = this.FParent;
      return Result;
    };
    this.Prepare = function () {
      var ActionIndex = 0;
      var Action = null;
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FRouteInfo;
        }, set: function (v) {
          this.p.FRouteInfo = v;
        }});
      this.FRouteInfo = $mod.TXDataRouteInfo.$create("Create$1");
      this.FRouteInfo.Process(this.FName);
      for (var $l = 0, $end = this.FActions.GetCount() - 1; $l <= $end; $l++) {
        ActionIndex = $l;
        Action = this.FActions.GetItem$1(ActionIndex);
        Action.Prepare();
      };
    };
    this.Create$1 = function () {
      this.FActions = $mod.TXDataActionList.$create("Create$4",[this]);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FActions");
      rtl.free(this,"FRouteInfo");
      $mod.TXDataModelObject.Destroy.call(this);
    };
    var $r = this.$rtti;
    $r.attr = [pas["Bcl.Json.Attributes"].JsonIncludeAttribute,"Create$1",[pas["Bcl.Json.Attributes"].TInclusionMode.NonDefault]];
  });
  rtl.createClass(this,"TXDataEntityTypeList",this.TXDataOwnedList,function () {
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
  });
  rtl.createClass(this,"TXDataInstanceTypeList",this.TXDataOwnedList,function () {
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
  });
  rtl.createClass(this,"TXDataControllerList",this.TXDataOwnedList,function () {
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
  });
  rtl.createClass(this,"TXDataSchema",this.TXDataModelObject,function () {
    this.$init = function () {
      $mod.TXDataModelObject.$init.call(this);
      this.FNamespace = "";
      this.FAlias = "";
      this.FEntityTypes = null;
      this.FEntityContainers = null;
      this.FEnumTypes = null;
      this.FInstanceTypes = null;
      this.FControllers = null;
    };
    this.$final = function () {
      this.FEntityTypes = undefined;
      this.FEntityContainers = undefined;
      this.FEnumTypes = undefined;
      this.FInstanceTypes = undefined;
      this.FControllers = undefined;
      $mod.TXDataModelObject.$final.call(this);
    };
    this.GetModel = function () {
      var Result = null;
      Result = this.FParent;
      return Result;
    };
    this.IsCollectionName = function (Name, SubType) {
      var Result = false;
      var Wrapper = "";
      Result = pas["XData.Utils"].TXDataUtils.GetNameAndKey(Name,{get: function () {
          return Wrapper;
        }, set: function (v) {
          Wrapper = v;
        }},SubType) && (Wrapper === "Collection");
      return Result;
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FEntityTypes = $mod.TXDataEntityTypeList.$create("Create$4",[this]);
      this.FInstanceTypes = $mod.TXDataInstanceTypeList.$create("Create$4",[this]);
      this.FEnumTypes = $mod.TXDataEnumTypeList.$create("Create$4",[this]);
      this.FEntityContainers = $mod.TXDataEntityContainerList.$create("Create$4",[this]);
      this.FControllers = $mod.TXDataControllerList.$create("Create$4",[this]);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FEntityTypes");
      rtl.free(this,"FInstanceTypes");
      rtl.free(this,"FEnumTypes");
      rtl.free(this,"FEntityContainers");
      rtl.free(this,"FControllers");
      $mod.TXDataModelObject.Destroy.call(this);
    };
    this.FindOrDefineConverter = function (AType) {
      var Result = null;
      if (AType === null) return null;
      if (AType.FUrlConverter !== null) return AType.FUrlConverter;
      Result = this.GetModel().FUrlConverters.Find(AType.GetName());
      if (Result === null) {
        if ($mod.TXDataEnumType.isPrototypeOf(AType)) {
          Result = pas["XData.Types.Converters"].TXDataEnumConverter.$create("Create$1",[AType]);
          this.GetModel().FUrlConverters.RegisterConverter(AType.GetName(),Result);
        };
      };
      return Result;
    };
    this.FindEntityType = function (AName) {
      var Result = null;
      var EntityType = null;
      var SubType = "";
      var I = 0;
      if (this.IsCollectionName(AName,{get: function () {
          return SubType;
        }, set: function (v) {
          SubType = v;
        }})) {
        EntityType = this.FindEntityType(SubType);
        if (EntityType !== null) {
          Result = EntityType.GetCollection()}
         else Result = null;
      } else {
        for (var $l = 0, $end = this.FEntityTypes.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          EntityType = this.FEntityTypes.GetItem$1(I);
          if (pas.SysUtils.SameText(EntityType.GetName(),AName)) return EntityType;
        };
        Result = null;
      };
      return Result;
    };
    this.FindInstanceType = function (AName) {
      var Result = null;
      var InstanceType = null;
      var SubType = "";
      var I = 0;
      if (this.IsCollectionName(AName,{get: function () {
          return SubType;
        }, set: function (v) {
          SubType = v;
        }})) {
        InstanceType = this.FindInstanceType(SubType);
        if (InstanceType !== null) {
          Result = InstanceType.GetCollection()}
         else Result = null;
      } else {
        for (var $l = 0, $end = this.FInstanceTypes.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          InstanceType = this.FInstanceTypes.GetItem$1(I);
          if (pas.SysUtils.SameText(InstanceType.GetName(),AName)) return InstanceType;
        };
        Result = null;
      };
      return Result;
    };
    this.FindEnumType = function (AName) {
      var Result = null;
      var EnumType = null;
      var I = 0;
      for (var $l = 0, $end = this.FEnumTypes.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        EnumType = this.FEnumTypes.GetItem$1(I);
        if (pas.SysUtils.SameText(EnumType.GetName(),AName)) return EnumType;
      };
      Result = null;
      return Result;
    };
    this.FindEnumMember = function (AName) {
      var Result = null;
      var EnumType = null;
      var EnumMember = null;
      var I = 0;
      var J = 0;
      for (var $l = 0, $end = this.FEnumTypes.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        EnumType = this.FEnumTypes.GetItem$1(I);
        for (var $l1 = 0, $end1 = EnumType.FMembers.GetCount() - 1; $l1 <= $end1; $l1++) {
          J = $l1;
          EnumMember = EnumType.FMembers.GetItem$1(J);
          if (pas.SysUtils.SameText(EnumMember.FName,AName)) return EnumMember;
        };
      };
      Result = null;
      return Result;
    };
    this.FindScalarType = function (Name) {
      var Result = null;
      var SubType = "";
      Result = this.FindEnumType(Name);
      if (Result === null) {
        if (this.IsCollectionName(Name,{get: function () {
            return SubType;
          }, set: function (v) {
            SubType = v;
          }})) {
          Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().Find(SubType);
          if (Result !== null) Result = Result.GetCollection();
        } else Result = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().Find(Name);
      };
      return Result;
    };
    this.FindType = function (Name) {
      var Result = null;
      Result = this.FindScalarType(Name);
      if (Result === null) Result = this.FindEntityType(Name);
      if (Result === null) Result = this.FindInstanceType(Name);
      return Result;
    };
    this.FindContainer = function (AName) {
      var Result = null;
      var Container = null;
      var I = 0;
      for (var $l = 0, $end = this.FEntityContainers.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        Container = this.FEntityContainers.GetItem$1(I);
        if (pas.SysUtils.SameText(Container.FName,AName)) return Container;
      };
      Result = null;
      return Result;
    };
    this.FindController = function (AName) {
      var Result = null;
      var Controller = null;
      var I = 0;
      for (var $l = 0, $end = this.FControllers.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        Controller = this.FControllers.GetItem$1(I);
        if (pas.SysUtils.SameText(Controller.FName,AName)) return Controller;
      };
      Result = null;
      return Result;
    };
    var $r = this.$rtti;
    $r.attr = [pas["Bcl.Json.Attributes"].JsonIncludeAttribute,"Create$1",[pas["Bcl.Json.Attributes"].TInclusionMode.NonDefault]];
  });
  rtl.createClass(this,"TXDataSchemaList",this.TXDataOwnedList,function () {
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
  });
  rtl.createClass(this,"TXDataUrlConverters",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FConverterMap = null;
    };
    this.$final = function () {
      this.FConverterMap = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FConverterMap = pas["Bcl.Collections.Common"].TStringMap.$create("Create$1",[true]);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FConverterMap");
      pas.System.TObject.Destroy.call(this);
    };
    this.Find = function (ATypeName) {
      var Result = null;
      if (this.FConverterMap.ContainsKey(ATypeName)) {
        Result = this.FConverterMap.GetItem(ATypeName)}
       else Result = null;
      return Result;
    };
    this.RegisterConverter = function (ATypeName, AConverter) {
      this.FConverterMap.AddOrSetValue(ATypeName,AConverter);
    };
  });
  rtl.createClass(this,"TXDataBaseModel",this.TXDataModelObject,function () {
    this.$init = function () {
      $mod.TXDataModelObject.$init.call(this);
      this.FTitle = "";
      this.FVersion = "";
      this.FSchemas = null;
      this.FUrlConverters = null;
    };
    this.$final = function () {
      this.FSchemas = undefined;
      this.FUrlConverters = undefined;
      $mod.TXDataModelObject.$final.call(this);
    };
    this.GetDefaultEntityContainer = function () {
      var Result = null;
      if ((this.FSchemas.GetCount() > 0) && (this.FSchemas.GetItem$1(0).FEntityContainers.GetCount() > 0)) {
        Result = this.FSchemas.GetItem$1(0).FEntityContainers.GetItem$1(0)}
       else Result = null;
      return Result;
    };
    this.Prepare = function () {
      var Schema = null;
      var Container = null;
      var EntitySet = null;
      var EntityType = null;
      var InstanceType = null;
      var SchemaIndex = 0;
      var ContainerIndex = 0;
      var EntitySetIndex = 0;
      var EntityTypeIndex = 0;
      var InstanceTypeIndex = 0;
      var ControllerIndex = 0;
      var Controller = null;
      var ScalarTypeIndex = 0;
      var ScalarType = null;
      for (var $l = 0, $end = this.FSchemas.GetCount() - 1; $l <= $end; $l++) {
        SchemaIndex = $l;
        Schema = this.FSchemas.GetItem$1(SchemaIndex);
        for (var $l1 = 0, $end1 = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().GetTypes().FLength - 1; $l1 <= $end1; $l1++) {
          ScalarTypeIndex = $l1;
          ScalarType = pas["XData.Model.Types"].TXDataPrimitiveTypes.Instance().GetTypes().GetItem(ScalarTypeIndex);
          ScalarType.FUrlConverter = Schema.FindOrDefineConverter(ScalarType);
          ScalarType.GetCollection().FUrlConverter = Schema.FindOrDefineConverter(ScalarType.GetCollection());
        };
        for (var $l2 = 0, $end2 = Schema.FEnumTypes.GetCount() - 1; $l2 <= $end2; $l2++) {
          ScalarTypeIndex = $l2;
          ScalarType = Schema.FEnumTypes.GetItem$1(ScalarTypeIndex);
          ScalarType.FUrlConverter = Schema.FindOrDefineConverter(ScalarType);
        };
        for (var $l3 = 0, $end3 = Schema.FEntityTypes.GetCount() - 1; $l3 <= $end3; $l3++) {
          EntityTypeIndex = $l3;
          EntityType = Schema.FEntityTypes.GetItem$1(EntityTypeIndex);
          EntityType.FUrlConverter = Schema.FindOrDefineConverter(EntityType);
          EntityType.GetCollection().FUrlConverter = Schema.FindOrDefineConverter(EntityType.GetCollection());
        };
        for (var $l4 = 0, $end4 = Schema.FInstanceTypes.GetCount() - 1; $l4 <= $end4; $l4++) {
          InstanceTypeIndex = $l4;
          InstanceType = Schema.FInstanceTypes.GetItem$1(InstanceTypeIndex);
          InstanceType.FUrlConverter = Schema.FindOrDefineConverter(InstanceType);
          InstanceType.GetCollection().FUrlConverter = Schema.FindOrDefineConverter(InstanceType.GetCollection());
        };
        for (var $l5 = 0, $end5 = Schema.FEntityContainers.GetCount() - 1; $l5 <= $end5; $l5++) {
          ContainerIndex = $l5;
          Container = Schema.FEntityContainers.GetItem$1(ContainerIndex);
          for (var $l6 = 0, $end6 = Container.FEntitySets.GetCount() - 1; $l6 <= $end6; $l6++) {
            EntitySetIndex = $l6;
            EntitySet = Container.FEntitySets.GetItem$1(EntitySetIndex);
            EntitySet.Prepare();
          };
        };
        for (var $l7 = 0, $end7 = Schema.FEntityTypes.GetCount() - 1; $l7 <= $end7; $l7++) {
          EntityTypeIndex = $l7;
          EntityType = Schema.FEntityTypes.GetItem$1(EntityTypeIndex);
          EntityType.Prepare();
        };
        for (var $l8 = 0, $end8 = Schema.FInstanceTypes.GetCount() - 1; $l8 <= $end8; $l8++) {
          InstanceTypeIndex = $l8;
          InstanceType = Schema.FInstanceTypes.GetItem$1(InstanceTypeIndex);
          InstanceType.Prepare();
        };
        for (var $l9 = 0, $end9 = Schema.FControllers.GetCount() - 1; $l9 <= $end9; $l9++) {
          ControllerIndex = $l9;
          Controller = Schema.FControllers.GetItem$1(ControllerIndex);
          Controller.Prepare();
        };
      };
    };
    this.Create$1 = function () {
      this.FTitle = "Server API";
      this.FVersion = "3";
      this.FSchemas = $mod.TXDataSchemaList.$create("Create$4",[this]);
      this.FUrlConverters = $mod.TXDataUrlConverters.$create("Create$1");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FSchemas");
      rtl.free(this,"FUrlConverters");
      $mod.TXDataModelObject.Destroy.call(this);
    };
    this.FindSchema = function (APrefix) {
      var Result = null;
      var LocalSchema = null;
      var I = 0;
      for (var $l = 0, $end = this.FSchemas.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        LocalSchema = this.FSchemas.GetItem$1(I);
        if (pas.SysUtils.SameText(APrefix,LocalSchema.FNamespace) || pas.SysUtils.SameText(APrefix,LocalSchema.FAlias)) return LocalSchema;
      };
      Result = null;
      return Result;
    };
    this.GetEntityType = function (QualifiedName) {
      var Result = null;
      Result = this.FindEntityType(QualifiedName);
      if (Result === null) throw $mod.EXDataEntityTypeNotFound.$create("Create$2",[QualifiedName]);
      return Result;
    };
    this.FindEntityType = function (QualifiedName) {
      var Result = null;
      var Prefix = "";
      var LocalName = "";
      var Schema = null;
      Result = null;
      pas["XData.Utils"].TXDataUtils.GetQualifiedName(QualifiedName,{get: function () {
          return Prefix;
        }, set: function (v) {
          Prefix = v;
        }},{get: function () {
          return LocalName;
        }, set: function (v) {
          LocalName = v;
        }});
      Schema = this.FindSchema(Prefix);
      if (Schema !== null) Result = Schema.FindEntityType(LocalName);
      return Result;
    };
    this.GetEntitySet = function (QualifiedName) {
      var Result = null;
      Result = this.FindEntitySet(QualifiedName);
      if (Result === null) throw $mod.EXDataEntitySetNotFound.$create("Create$2",[QualifiedName]);
      return Result;
    };
    this.FindEntitySet = function (QualifiedName) {
      var Result = null;
      var Prefix = "";
      var LocalName = "";
      var Schema = null;
      var Container = null;
      var I = 0;
      Result = null;
      pas["XData.Utils"].TXDataUtils.GetQualifiedName(QualifiedName,{get: function () {
          return Prefix;
        }, set: function (v) {
          Prefix = v;
        }},{get: function () {
          return LocalName;
        }, set: function (v) {
          LocalName = v;
        }});
      Container = null;
      if (Prefix === "") {
        Container = this.GetDefaultEntityContainer();
      } else {
        for (var $l = 0, $end = this.FSchemas.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          Schema = this.FSchemas.GetItem$1(I);
          Container = Schema.FindContainer(Prefix);
          if (Container !== null) break;
        };
      };
      if (Container !== null) Result = Container.FindEntitySet(LocalName);
      return Result;
    };
    this.FindInstanceType = function (QualifiedName) {
      var Result = null;
      var Prefix = "";
      var LocalName = "";
      var Schema = null;
      Result = null;
      pas["XData.Utils"].TXDataUtils.GetQualifiedName(QualifiedName,{get: function () {
          return Prefix;
        }, set: function (v) {
          Prefix = v;
        }},{get: function () {
          return LocalName;
        }, set: function (v) {
          LocalName = v;
        }});
      Schema = this.FindSchema(Prefix);
      if (Schema !== null) Result = Schema.FindInstanceType(LocalName);
      return Result;
    };
    this.FindController = function (AName) {
      var Result = null;
      var Schema = null;
      var I = 0;
      Result = null;
      for (var $l = 0, $end = this.FSchemas.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        Schema = this.FSchemas.GetItem$1(I);
        Result = Schema.FindController(AName);
        if (Result !== null) break;
      };
      return Result;
    };
    this.FindActionByOperationId = function (AOperationId) {
      var Result = null;
      var Schema = null;
      var Controller = null;
      var Action = null;
      var I = 0;
      var J = 0;
      var L = 0;
      Result = null;
      for (var $l = 0, $end = this.FSchemas.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        Schema = this.FSchemas.GetItem$1(I);
        for (var $l1 = 0, $end1 = Schema.FControllers.GetCount() - 1; $l1 <= $end1; $l1++) {
          J = $l1;
          Controller = Schema.FControllers.GetItem$1(J);
          for (var $l2 = 0, $end2 = Controller.FActions.GetCount() - 1; $l2 <= $end2; $l2++) {
            L = $l2;
            Action = Controller.FActions.GetItem$1(L);
            if (pas.SysUtils.SameText(Action.FOperationId,AOperationId)) return Action;
          };
        };
      };
      return Result;
    };
    this.DefaultEntitySet = function (AType) {
      var Result = null;
      var Schema = null;
      var EntitySet = null;
      var Container = null;
      var SchemaIndex = 0;
      var ContainerIndex = 0;
      var EntitySetIndex = 0;
      if (AType.FDefaultEntitySet !== null) return AType.FDefaultEntitySet;
      for (var $l = 0, $end = this.FSchemas.GetCount() - 1; $l <= $end; $l++) {
        SchemaIndex = $l;
        Schema = this.FSchemas.GetItem$1(SchemaIndex);
        for (var $l1 = 0, $end1 = Schema.FEntityContainers.GetCount() - 1; $l1 <= $end1; $l1++) {
          ContainerIndex = $l1;
          Container = Schema.FEntityContainers.GetItem$1(ContainerIndex);
          for (var $l2 = 0, $end2 = Container.FEntitySets.GetCount() - 1; $l2 <= $end2; $l2++) {
            EntitySetIndex = $l2;
            EntitySet = Container.FEntitySets.GetItem$1(EntitySetIndex);
            if (EntitySet.FEntityType === AType) {
              this.DefineDefaultEntitySet(AType,EntitySet);
              return EntitySet;
            };
          };
        };
      };
      Result = null;
      return Result;
    };
    this.DefineDefaultEntitySet = function (AType, EntitySet) {
      AType.FDefaultEntitySet = EntitySet;
    };
    var $r = this.$rtti;
    $r.attr = [pas["Bcl.Json.Attributes"].JsonIncludeAttribute,"Create$1",[pas["Bcl.Json.Attributes"].TInclusionMode.NonDefault]];
  });
  this.$rtti.$RefToProcVar("TXDataGetPropValueProc",{procsig: rtl.newTIProcSig([["Entity",rtl.jsvalue],["Prop",this.$rtti["TXDataSimpleProperty"]]],rtl.jsvalue)});
  this.$rtti.$RefToProcVar("TXDataGetNavPropValueProc",{procsig: rtl.newTIProcSig([["Entity",rtl.jsvalue],["NavProp",this.$rtti["TXDataNavigationProperty"]]],rtl.jsvalue)});
  rtl.createClass(this,"TXDataModel",this.TXDataBaseModel,function () {
    this.IdToKeyPredicate = function (Entity, AType, GetPropValue, GetNavPropValue) {
      var $Self = this;
      var Result = "";
      function FillKeyValues(Entity, AType, Values) {
        var Key = null;
        var I = 0;
        AType = AType.RootType();
        for (var $l = 0, $end = AType.FKey.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          Key = AType.FKey.GetItem$1(I);
          if (Key.IsSimple()) {
            Values.set(rtl.arraySetLength(Values.get(),undefined,rtl.length(Values.get()) + 1));
            Values.get()[rtl.length(Values.get()) - 1] = GetPropValue(Entity,Key);
          } else FillKeyValues(GetNavPropValue(Entity,Key),Key.FTarget,Values);
        };
      };
      var ValueList = [];
      var SimpleKey = null;
      AType = AType.RootType();
      if (AType.FKey.GetCount() === 0) return "";
      if ((AType.FKey.GetCount() === 1) && AType.FKey.GetItem$1(0).IsSimple()) {
        SimpleKey = AType.FKey.GetItem$1(0);
        Result = SimpleKey.GetUrlConverter().ValueToUrl(GetPropValue(Entity,SimpleKey),SimpleKey.FName);
      } else {
        ValueList = rtl.arraySetLength(ValueList,undefined,0);
        FillKeyValues(Entity,AType,{get: function () {
            return ValueList;
          }, set: function (v) {
            ValueList = v;
          }});
        Result = this.IdToKeyPredicate$1(AType,ValueList);
      };
      return Result;
    };
    this.IdToKeyPredicate$1 = function (AType, Id) {
      var Result = "";
      var I = 0;
      var Value = undefined;
      var CastValue = undefined;
      var IsArray = false;
      var KeyProps = [];
      AType = AType.RootType();
      if (AType.FKey.GetCount() === 0) return "";
      if ((AType.FKey.GetCount() === 1) && AType.FKey.GetItem$1(0).IsSimple()) {
        Result = AType.FKey.GetItem$1(0).GetUrlConverter().ValueToUrl(Id,AType.FKey.GetItem$1(0).FName)}
       else {
        KeyProps = AType.KeyScalarProperties();
        IsArray = pas["Bcl.Rtti.Common"].TValue_IsArray(Id);
        if (IsArray && (pas["Bcl.Rtti.Common"].TValue_GetArrayLength(Id) !== rtl.length(KeyProps))) throw $mod.ECannotBuildKeyPredicateWrongValueLength.$create("Create$2",[AType]);
        if (!IsArray && (rtl.length(KeyProps) !== 1)) throw $mod.ECannotBuildKeyPredicateWrongValueLength.$create("Create$2",[AType]);
        for (var $l = 0, $end = rtl.length(KeyProps) - 1; $l <= $end; $l++) {
          I = $l;
          if (IsArray) {
            Value = pas["Bcl.Rtti.Common"].TValue_GetArrayElement(Id,I)}
           else Value = Id;
          CastValue = Value;
          if (Result !== "") Result = Result + ",";
          Result = Result + KeyProps[I].GetUrlConverter().ValueToUrl(CastValue,KeyProps[I].FName);
        };
      };
      return Result;
    };
    this.CanonicalUrlFromId = function (EntityType, Id) {
      var Result = "";
      var EntitySet = null;
      EntitySet = this.DefaultEntitySet(EntityType);
      if (EntitySet === null) throw $mod.ECannotBuildCanonicalUrl.$create("Create$2",[EntityType]);
      Result = pas.SysUtils.Format("%s(%s)",pas.System.VarRecs(18,this.EntitySetUrl(EntitySet),18,this.IdToKeyPredicate$1(EntityType,Id)));
      return Result;
    };
    this.CanonicalUrlFromEntity = function (EntityType, Entity, GetPropValue, GetNavPropValue) {
      var Result = "";
      var EntitySet = null;
      EntitySet = this.DefaultEntitySet(EntityType);
      if (EntitySet === null) throw $mod.ECannotBuildCanonicalUrl.$create("Create$2",[EntityType]);
      Result = pas.SysUtils.Format("%s(%s)",pas.System.VarRecs(18,this.EntitySetUrl(EntitySet),18,this.IdToKeyPredicate(Entity,EntityType,GetPropValue,GetNavPropValue)));
      return Result;
    };
    this.EntitySetUrl = function (AEntitySet) {
      var Result = "";
      Result = AEntitySet.FName;
      return Result;
    };
    this.DefaultSchema = function () {
      var Result = null;
      if (this.FSchemas.GetCount() >= 0) {
        Result = this.FSchemas.GetItem$1(0)}
       else Result = null;
      return Result;
    };
    var $r = this.$rtti;
    $r.attr = [pas["Bcl.Json.Attributes"].JsonIncludeAttribute,"Create$1",[pas["Bcl.Json.Attributes"].TInclusionMode.NonDefault]];
  });
  rtl.createClass(this,"ECannotSetTypeKind",pas.SysUtils.Exception,function () {
    this.Create$2 = function (Prop, Value) {
      pas.SysUtils.Exception.CreateFmt.call(this,'Cannot set property "%s" type to type kind %s',pas.System.VarRecs(18,Prop.QualifiedName(),18,pas.SysUtils.IntToStr(Value)));
      return this;
    };
  });
  rtl.createClass(this,"TXDataTypeConverter",pas.System.TObject,function () {
    this.TryValueToUrl = function (Value, Literal) {
      var Result = false;
      Result = false;
      return Result;
    };
    this.TryUrlToValue = function (Literal, Value) {
      var Result = false;
      Result = false;
      return Result;
    };
    this.Destroy = function () {
      pas.System.TObject.Destroy.call(this);
    };
    this.ValueToUrl = function (Value, PropName) {
      var Result = "";
      if (Value == null) {
        return "null"}
       else {
        if (!this.TryValueToUrl(Value,{get: function () {
            return Result;
          }, set: function (v) {
            Result = v;
          }})) throw $mod.EConvertToUrlError.$create("Create$2",[PropName,Value]);
      };
      return Result;
    };
    this.UrlToValue = function (Literal, PropName) {
      var Result = undefined;
      if (!this.TryUrlToValue(Literal,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }})) throw $mod.EConvertFromUrlError.$create("Create$2",[PropName,Literal]);
      return Result;
    };
  });
  rtl.createClass(this,"EConvertToUrlError",pas.SysUtils.Exception,function () {
    this.Create$2 = function (PropName, Value) {
      if (PropName !== "") {
        pas.SysUtils.Exception.CreateFmt.call(this,'Cannot serialize value "%s" to Url parameter "%s"',pas.System.VarRecs(18,pas["Bcl.Rtti.Common"].TValue_ToString(Value),18,PropName))}
       else pas.SysUtils.Exception.CreateFmt.call(this,'Cannot serialize value "%s" to Url',pas.System.VarRecs(18,pas["Bcl.Rtti.Common"].TValue_ToString(Value)));
      return this;
    };
  });
  rtl.createClass(this,"EConvertFromUrlError",pas.SysUtils.Exception,function () {
    this.Create$2 = function (PropName, Literal) {
      if (PropName !== "") {
        pas.SysUtils.Exception.CreateFmt.call(this,'Cannot deserialize value "%s" from Url parameter "%s"',pas.System.VarRecs(18,Literal,18,PropName))}
       else pas.SysUtils.Exception.CreateFmt.call(this,'Cannot deserialize value "%s" from Url',pas.System.VarRecs(18,Literal));
      return this;
    };
  });
  rtl.createClass(this,"EModelTypeNotFound",pas.SysUtils.Exception,function () {
  });
  rtl.createClass(this,"EModelReferenceNotFound",pas.SysUtils.Exception,function () {
  });
  rtl.createClass(this,"EXDataEntityTypeNotFound",pas.SysUtils.Exception,function () {
    this.Create$2 = function (AName) {
      pas.SysUtils.Exception.CreateFmt.call(this,'Entity type not found for type "%s"',pas.System.VarRecs(18,AName));
      return this;
    };
  });
  rtl.createClass(this,"EXDataEntitySetNotFound",pas.SysUtils.Exception,function () {
    this.Create$2 = function (AName) {
      pas.SysUtils.Exception.CreateFmt.call(this,'Entity set "%s" not found',pas.System.VarRecs(18,AName));
      return this;
    };
  });
  rtl.createClass(this,"ECannotBuildKeyPredicateWrongValueLength",pas.SysUtils.Exception,function () {
    this.Create$2 = function (AType) {
      pas.SysUtils.Exception.CreateFmt.call(this,'Cannot create id predicate for type "%s". ' + "The length of id value does not match number of elements in composite key",pas.System.VarRecs(18,AType.QualifiedName()));
      return this;
    };
  });
  rtl.createClass(this,"ECannotBuildCanonicalUrl",pas.SysUtils.Exception,function () {
    this.Create$2 = function (AType) {
      pas.SysUtils.Exception.CreateFmt.call(this,'Cannot create canonical url for type "%s"',pas.System.VarRecs(18,AType.QualifiedName()));
      return this;
    };
  });
  rtl.createClass(this,"EUrlConverterNotFound",pas.SysUtils.Exception,function () {
    this.Create$2 = function (AType) {
      var ATypeName = "";
      if (AType === null) {
        ATypeName = "(null)"}
       else ATypeName = AType.GetName();
      pas.SysUtils.Exception.CreateFmt.call(this,'Could not find URL converter for type "%s"',pas.System.VarRecs(18,ATypeName));
      return this;
    };
  });
  rtl.createClass(this,"EIndexOutOfRange",pas.SysUtils.Exception,function () {
  });
  rtl.createClass(this,"EXDataInvalidRouteParam",pas.SysUtils.Exception,function () {
    this.Create$2 = function (Action, ParamName) {
      pas.SysUtils.Exception.CreateFmt.call(this,'Invalid param "%s" in route of action "%s"',pas.System.VarRecs(18,ParamName,18,Action.FOperationId));
      return this;
    };
  });
  $mod.$implcode = function () {
    $impl.ErrorOutOfRange = function () {
      throw $mod.EIndexOutOfRange.$create("Create$1",["Index out of range"]);
    };
    $mod.$rtti.$DynArray("TValueArray",{eltype: rtl.jsvalue});
    $impl.FindDelimiter = function (S, StartIdx) {
      var Result = 0;
      var Stop = false;
      var Len = 0;
      Result = 0;
      Len = S.length;
      Stop = false;
      while (!Stop && (StartIdx <= Len)) if (S.charAt(StartIdx - 1) === "/") {
        Result = StartIdx;
        Stop = true;
      } else StartIdx += 1;
      return Result;
    };
    $impl.SplitString = function (S, Delimiters) {
      var Result = [];
      var StartIdx = 0;
      var FoundIdx = 0;
      var SplitPoints = 0;
      var CurrentSplit = 0;
      var i = 0;
      Result = [];
      if (S !== "") {
        SplitPoints = 0;
        for (var $l = 1, $end = S.length; $l <= $end; $l++) {
          i = $l;
          if (S.charAt(i - 1) === "/") SplitPoints += 1;
        };
        Result = rtl.arraySetLength(Result,"",SplitPoints + 1);
        StartIdx = 1;
        CurrentSplit = 0;
        do {
          FoundIdx = $impl.FindDelimiter(S,StartIdx);
          if (FoundIdx !== 0) {
            Result[CurrentSplit] = pas.System.Copy(S,StartIdx,FoundIdx - StartIdx);
            CurrentSplit += 1;
            StartIdx = FoundIdx + 1;
          };
        } while (!(CurrentSplit === SplitPoints));
        Result[SplitPoints] = pas.System.Copy(S,StartIdx,(S.length - StartIdx) + 1);
      };
      return Result;
    };
  };
},["XData.Model.Types","XData.Types.Converters","XData.Utils"]);
rtl.module("Bcl.TypInfo.Common",["System","TypInfo"],function () {
  "use strict";
  var $mod = this;
  this.GetTypeName_ = function (TypeInfo) {
    var Result = "";
    Result = TypeInfo.name;
    return Result;
  };
  this.GetEnumName_ = function (TypeInfo, Value) {
    var Result = "";
    Result = TypeInfo.enumtype[Value];
    return Result;
  };
  this.GetEnumValue_ = function (TypeInfo, Name) {
    var Result = 0;
    Result = TypeInfo.enumtype[Name];
    return Result;
  };
});
rtl.module("XData.Model.Deserializer",["System","SysUtils","Types","TypInfo","JS","Bcl.Json.Common","Bcl.TypInfo.Common","XData.Model.Classes"],function () {
  "use strict";
  var $mod = this;
  rtl.createClass(this,"EXDataModelDeserialization",pas.SysUtils.Exception,function () {
  });
  rtl.createClass(this,"TXDataModelDeserializer",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FModel = null;
      this.FRoot = null;
    };
    this.$final = function () {
      this.FModel = undefined;
      this.FRoot = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function (AModel, Json) {
      this.FModel = AModel;
      this.FRoot = JSON.parse(Json);
      return this;
    };
    this.Destroy = function () {
      pas.System.TObject.Destroy.call(this);
    };
    this.Read = function () {
      this.ReadModel(this.FModel,this.FRoot);
      this.FModel.Prepare();
    };
    this.ReadBase = function (Base, JObj) {
      var Key = "";
      var Keys = [];
      var KeyIndex = 0;
      Keys = pas["Bcl.Json.Common"].JObjectKeys(JObj);
      for (var $l = 0, $end = rtl.length(Keys) - 1; $l <= $end; $l++) {
        KeyIndex = $l;
        Key = Keys[KeyIndex];
        if (Key === "Description") Base.FDescription = pas["Bcl.Json.Common"].JToStr(JObj[Key]);
      };
    };
    this.ReadType = function (XDataType, JObj) {
      var Key = "";
      var Keys = [];
      var KeyIndex = 0;
      this.ReadBase(XDataType,JObj);
      Keys = pas["Bcl.Json.Common"].JObjectKeys(JObj);
      for (var $l = 0, $end = rtl.length(Keys) - 1; $l <= $end; $l++) {
        KeyIndex = $l;
        Key = Keys[KeyIndex];
        if (Key === "Name") XDataType.FName = pas["Bcl.Json.Common"].JToStr(JObj[Key]);
      };
    };
    this.ReadStructuredType = function (StructuredType, JObj) {
      this.ReadType(StructuredType,JObj);
    };
    this.ReadScalarType = function (ScalarType, JObj) {
      this.ReadType(ScalarType,JObj);
    };
    this.ReadModel = function (Model, JObj) {
      var Key = "";
      var I = 0;
      var JSchemas = null;
      var Keys = [];
      var KeyIndex = 0;
      this.ReadBase(Model,JObj);
      Model.FSchemas.Clear();
      Keys = pas["Bcl.Json.Common"].JObjectKeys(JObj);
      for (var $l = 0, $end = rtl.length(Keys) - 1; $l <= $end; $l++) {
        KeyIndex = $l;
        Key = Keys[KeyIndex];
        if (Key === "Title") {
          Model.FTitle = pas["Bcl.Json.Common"].JToStr(JObj[Key])}
         else if (Key === "Version") {
          Model.FVersion = pas["Bcl.Json.Common"].JToStr(JObj[Key])}
         else if (Key === "Schemas") {
          JSchemas = pas["Bcl.Json.Common"].AsJArray(JObj[Key]);
          for (var $l1 = 0, $end1 = JSchemas.length - 1; $l1 <= $end1; $l1++) {
            I = $l1;
            this.ReadSchema(Model.FSchemas.GetItem$1(Model.FSchemas.Add$1(pas["XData.Model.Classes"].TXDataSchema.$create("Create$1"))),pas["Bcl.Json.Common"].AsJObject(JSchemas[I]));
          };
        };
      };
    };
    this.ReadSchema = function (Schema, JObj) {
      var Key = "";
      var I = 0;
      var JEntityTypes = null;
      var JInstanceTypes = null;
      var JEntityContainers = null;
      var JEnumTypes = null;
      var JControllers = null;
      var Keys = [];
      var KeyIndex = 0;
      this.ReadBase(Schema,JObj);
      Schema.FEntityTypes.Clear();
      Schema.FInstanceTypes.Clear();
      Schema.FEntityContainers.Clear();
      Schema.FEnumTypes.Clear();
      Schema.FControllers.Clear();
      Keys = pas["Bcl.Json.Common"].JObjectKeys(JObj);
      for (var $l = 0, $end = rtl.length(Keys) - 1; $l <= $end; $l++) {
        KeyIndex = $l;
        Key = Keys[KeyIndex];
        if (Key === "Namespace") {
          Schema.FNamespace = pas["Bcl.Json.Common"].JToStr(JObj[Key])}
         else if (Key === "Alias") {
          Schema.FAlias = pas["Bcl.Json.Common"].JToStr(JObj[Key])}
         else if (Key === "EntityTypes") {
          JEntityTypes = pas["Bcl.Json.Common"].AsJArray(JObj[Key]);
          for (var $l1 = 0, $end1 = JEntityTypes.length - 1; $l1 <= $end1; $l1++) {
            I = $l1;
            this.ReadEntityType(Schema.FEntityTypes.GetItem$1(Schema.FEntityTypes.Add$1(pas["XData.Model.Classes"].TXDataEntityType.$create("Create$1"))),pas["Bcl.Json.Common"].AsJObject(JEntityTypes[I]));
          };
        } else if (Key === "InstanceTypes") {
          JInstanceTypes = pas["Bcl.Json.Common"].AsJArray(JObj[Key]);
          for (var $l2 = 0, $end2 = JInstanceTypes.length - 1; $l2 <= $end2; $l2++) {
            I = $l2;
            this.ReadInstanceType(Schema.FInstanceTypes.GetItem$1(Schema.FInstanceTypes.Add$1(pas["XData.Model.Classes"].TXDataInstanceType.$create("Create$1"))),pas["Bcl.Json.Common"].AsJObject(JInstanceTypes[I]));
          };
        } else if (Key === "EntityContainers") {
          JEntityContainers = pas["Bcl.Json.Common"].AsJArray(JObj[Key]);
          for (var $l3 = 0, $end3 = JEntityContainers.length - 1; $l3 <= $end3; $l3++) {
            I = $l3;
            this.ReadEntityContainer(Schema.FEntityContainers.GetItem$1(Schema.FEntityContainers.Add$1(pas["XData.Model.Classes"].TXDataEntityContainer.$create("Create$1"))),pas["Bcl.Json.Common"].AsJObject(JEntityContainers[I]));
          };
        } else if (Key === "EnumTypes") {
          JEnumTypes = pas["Bcl.Json.Common"].AsJArray(JObj[Key]);
          for (var $l4 = 0, $end4 = JEnumTypes.length - 1; $l4 <= $end4; $l4++) {
            I = $l4;
            this.ReadEnumType(Schema.FEnumTypes.GetItem$1(Schema.FEnumTypes.Add$1(pas["XData.Model.Classes"].TXDataEnumType.$create("Create$1"))),pas["Bcl.Json.Common"].AsJObject(JEnumTypes[I]));
          };
        } else if (Key === "Controllers") {
          JControllers = pas["Bcl.Json.Common"].AsJArray(JObj[Key]);
          for (var $l5 = 0, $end5 = JControllers.length - 1; $l5 <= $end5; $l5++) {
            I = $l5;
            this.ReadController(Schema.FControllers.GetItem$1(Schema.FControllers.Add$1(pas["XData.Model.Classes"].TXDataController.$create("Create$1"))),pas["Bcl.Json.Common"].AsJObject(JControllers[I]));
          };
        };
      };
    };
    this.ReadEntityType = function (EntityType, JObj) {
      var Key = "";
      var I = 0;
      var JProperties = null;
      var JNavigationProperties = null;
      var JKey = null;
      var TempKeyRef = [];
      var Keys = [];
      var KeyIndex = 0;
      this.ReadStructuredType(EntityType,JObj);
      TempKeyRef = rtl.arraySetLength(TempKeyRef,"",0);
      EntityType.FProperties.Clear();
      EntityType.FNavigationProperties.Clear();
      Keys = pas["Bcl.Json.Common"].JObjectKeys(JObj);
      for (var $l = 0, $end = rtl.length(Keys) - 1; $l <= $end; $l++) {
        KeyIndex = $l;
        Key = Keys[KeyIndex];
        if (Key === "Properties") {
          JProperties = pas["Bcl.Json.Common"].AsJArray(JObj[Key]);
          for (var $l1 = 0, $end1 = JProperties.length - 1; $l1 <= $end1; $l1++) {
            I = $l1;
            this.ReadSimpleProperty(EntityType.FProperties.GetItem$1(EntityType.FProperties.Add$1(pas["XData.Model.Classes"].TXDataSimpleProperty.$create("Create$1"))),pas["Bcl.Json.Common"].AsJObject(JProperties[I]));
          };
        } else if (Key === "NavigationProperties") {
          JNavigationProperties = pas["Bcl.Json.Common"].AsJArray(JObj[Key]);
          for (var $l2 = 0, $end2 = JNavigationProperties.length - 1; $l2 <= $end2; $l2++) {
            I = $l2;
            this.ReadNavigationProperty(EntityType.FNavigationProperties.GetItem$1(EntityType.FNavigationProperties.Add$1(pas["XData.Model.Classes"].TXDataNavigationProperty.$create("Create$1"))),pas["Bcl.Json.Common"].AsJObject(JNavigationProperties[I]));
          };
        } else if (Key === "BaseType") {
          EntityType.FBaseTypeRef = pas["Bcl.Json.Common"].JToStr(JObj[Key])}
         else if (Key === "Key") {
          JKey = pas["Bcl.Json.Common"].AsJArray(JObj[Key]);
          TempKeyRef = rtl.arraySetLength(TempKeyRef,"",JKey.length);
          for (var $l3 = 0, $end3 = JKey.length - 1; $l3 <= $end3; $l3++) {
            I = $l3;
            TempKeyRef[I] = pas["Bcl.Json.Common"].JToStr(JKey[I]);
          };
          EntityType.FKeyRef = rtl.arrayRef(TempKeyRef);
        };
      };
    };
    this.ReadInstanceType = function (InstanceType, JObj) {
      var Key = "";
      var I = 0;
      var JProperties = null;
      var JNavigationProperties = null;
      var Keys = [];
      var KeyIndex = 0;
      this.ReadStructuredType(InstanceType,JObj);
      InstanceType.FProperties.Clear();
      InstanceType.FNavigationProperties.Clear();
      Keys = pas["Bcl.Json.Common"].JObjectKeys(JObj);
      for (var $l = 0, $end = rtl.length(Keys) - 1; $l <= $end; $l++) {
        KeyIndex = $l;
        Key = Keys[KeyIndex];
        if (Key === "Properties") {
          JProperties = pas["Bcl.Json.Common"].AsJArray(JObj[Key]);
          for (var $l1 = 0, $end1 = JProperties.length - 1; $l1 <= $end1; $l1++) {
            I = $l1;
            this.ReadInstanceSimpleProperty(InstanceType.FProperties.GetItem$1(InstanceType.FProperties.Add$1(pas["XData.Model.Classes"].TXDataInstanceSimpleProperty.$create("Create$1"))),pas["Bcl.Json.Common"].AsJObject(JProperties[I]));
          };
        } else if (Key === "NavigationProperties") {
          JNavigationProperties = pas["Bcl.Json.Common"].AsJArray(JObj[Key]);
          for (var $l2 = 0, $end2 = JNavigationProperties.length - 1; $l2 <= $end2; $l2++) {
            I = $l2;
            this.ReadInstanceNavigationProperty(InstanceType.FNavigationProperties.GetItem$1(InstanceType.FNavigationProperties.Add$1(pas["XData.Model.Classes"].TXDataInstanceNavigationProperty.$create("Create$1"))),pas["Bcl.Json.Common"].AsJObject(JNavigationProperties[I]));
          };
        } else if (Key === "BaseType") InstanceType.FBaseTypeRef = pas["Bcl.Json.Common"].JToStr(JObj[Key]);
      };
    };
    this.ReadScalarProperty = function (ScalarProperty, JObj) {
      var Key = "";
      var Keys = [];
      var KeyIndex = 0;
      this.ReadProperty(ScalarProperty,JObj);
      Keys = pas["Bcl.Json.Common"].JObjectKeys(JObj);
      for (var $l = 0, $end = rtl.length(Keys) - 1; $l <= $end; $l++) {
        KeyIndex = $l;
        Key = Keys[KeyIndex];
        if (Key === "Length") {
          ScalarProperty.FLength = pas["Bcl.Json.Common"].JToInt(JObj[Key])}
         else if (Key === "Precision") {
          ScalarProperty.FPrecision = pas["Bcl.Json.Common"].JToInt(JObj[Key])}
         else if (Key === "Scale") {
          ScalarProperty.FScale = pas["Bcl.Json.Common"].JToInt(JObj[Key])}
         else if (Key === "Type") ScalarProperty.FTypeRef = pas["Bcl.Json.Common"].JToStr(JObj[Key]);
      };
    };
    this.ReadSimpleProperty = function (SimpleProperty, JObj) {
      this.ReadScalarProperty(SimpleProperty,JObj);
    };
    this.ReadInstanceSimpleProperty = function (ScalarProperty, JObj) {
      this.ReadScalarProperty(ScalarProperty,JObj);
    };
    this.ReadStructuredProperty = function (StructuredProperty, JObj) {
      var Key = "";
      var Keys = [];
      var KeyIndex = 0;
      this.ReadProperty(StructuredProperty,JObj);
      Keys = pas["Bcl.Json.Common"].JObjectKeys(JObj);
      for (var $l = 0, $end = rtl.length(Keys) - 1; $l <= $end; $l++) {
        KeyIndex = $l;
        Key = Keys[KeyIndex];
        if (Key === "Target") StructuredProperty.FTargetRef = pas["Bcl.Json.Common"].JToStr(JObj[Key]);
      };
    };
    this.ReadNavigationProperty = function (NavigationProperty, JObj) {
      this.ReadStructuredProperty(NavigationProperty,JObj);
    };
    this.ReadInstanceNavigationProperty = function (NavigationProperty, JObj) {
      this.ReadStructuredProperty(NavigationProperty,JObj);
    };
    this.ReadProperty = function (Prop, JObj) {
      var Key = "";
      var Keys = [];
      var KeyIndex = 0;
      this.ReadBase(Prop,JObj);
      Keys = pas["Bcl.Json.Common"].JObjectKeys(JObj);
      for (var $l = 0, $end = rtl.length(Keys) - 1; $l <= $end; $l++) {
        KeyIndex = $l;
        Key = Keys[KeyIndex];
        if (Key === "Name") {
          Prop.FName = pas["Bcl.Json.Common"].JToStr(JObj[Key])}
         else if (Key === "Required") Prop.FRequired = pas["Bcl.Json.Common"].JToBool(JObj[Key]);
      };
    };
    this.ReadEntityContainer = function (Container, JObj) {
      var Key = "";
      var I = 0;
      var JEntitySets = null;
      var Keys = [];
      var KeyIndex = 0;
      this.ReadBase(Container,JObj);
      Keys = pas["Bcl.Json.Common"].JObjectKeys(JObj);
      for (var $l = 0, $end = rtl.length(Keys) - 1; $l <= $end; $l++) {
        KeyIndex = $l;
        Key = Keys[KeyIndex];
        if (Key === "Name") {
          Container.FName = pas["Bcl.Json.Common"].JToStr(JObj[Key])}
         else if (Key === "EntitySets") {
          JEntitySets = pas["Bcl.Json.Common"].AsJArray(JObj[Key]);
          for (var $l1 = 0, $end1 = JEntitySets.length - 1; $l1 <= $end1; $l1++) {
            I = $l1;
            this.ReadEntitySet(Container.FEntitySets.GetItem$1(Container.FEntitySets.Add$1(pas["XData.Model.Classes"].TXDataEntitySet.$create("Create"))),pas["Bcl.Json.Common"].AsJObject(JEntitySets[I]));
          };
        };
      };
    };
    this.ReadEntitySet = function (EntitySet, JObj) {
      var Key = "";
      var Keys = [];
      var KeyIndex = 0;
      this.ReadBase(EntitySet,JObj);
      Keys = pas["Bcl.Json.Common"].JObjectKeys(JObj);
      for (var $l = 0, $end = rtl.length(Keys) - 1; $l <= $end; $l++) {
        KeyIndex = $l;
        Key = Keys[KeyIndex];
        if (Key === "Name") {
          EntitySet.FName = pas["Bcl.Json.Common"].JToStr(JObj[Key])}
         else if (Key === "EntityType") EntitySet.FEntityTypeRef = pas["Bcl.Json.Common"].JToStr(JObj[Key]);
      };
    };
    this.ReadEnumType = function (EnumType, JObj) {
      var Key = "";
      var I = 0;
      var JMembers = null;
      var Keys = [];
      var KeyIndex = 0;
      this.ReadScalarType(EnumType,JObj);
      Keys = pas["Bcl.Json.Common"].JObjectKeys(JObj);
      for (var $l = 0, $end = rtl.length(Keys) - 1; $l <= $end; $l++) {
        KeyIndex = $l;
        Key = Keys[KeyIndex];
        if (Key === "Members") {
          JMembers = pas["Bcl.Json.Common"].AsJArray(JObj[Key]);
          for (var $l1 = 0, $end1 = JMembers.length - 1; $l1 <= $end1; $l1++) {
            I = $l1;
            this.ReadEnumMember(EnumType.FMembers.GetItem$1(EnumType.FMembers.Add$1(pas["XData.Model.Classes"].TXDataEnumMember.$create("Create"))),pas["Bcl.Json.Common"].AsJObject(JMembers[I]));
          };
        };
      };
    };
    this.ReadEnumMember = function (EnumMember, JObj) {
      var Key = "";
      var Keys = [];
      var KeyIndex = 0;
      this.ReadBase(EnumMember,JObj);
      Keys = pas["Bcl.Json.Common"].JObjectKeys(JObj);
      for (var $l = 0, $end = rtl.length(Keys) - 1; $l <= $end; $l++) {
        KeyIndex = $l;
        Key = Keys[KeyIndex];
        if (Key === "Name") {
          EnumMember.FName = pas["Bcl.Json.Common"].JToStr(JObj[Key])}
         else if (Key === "Value") EnumMember.FValue = pas["Bcl.Json.Common"].JToInt(JObj[Key]);
      };
    };
    this.ReadController = function (Controller, JObj) {
      var Key = "";
      var I = 0;
      var JActions = null;
      var Keys = [];
      var KeyIndex = 0;
      this.ReadBase(Controller,JObj);
      Keys = pas["Bcl.Json.Common"].JObjectKeys(JObj);
      for (var $l = 0, $end = rtl.length(Keys) - 1; $l <= $end; $l++) {
        KeyIndex = $l;
        Key = Keys[KeyIndex];
        if (Key === "Name") {
          Controller.FName = pas["Bcl.Json.Common"].JToStr(JObj[Key])}
         else if (Key === "Actions") {
          JActions = pas["Bcl.Json.Common"].AsJArray(JObj[Key]);
          for (var $l1 = 0, $end1 = JActions.length - 1; $l1 <= $end1; $l1++) {
            I = $l1;
            this.ReadAction(Controller.FActions.GetItem$1(Controller.FActions.Add$1(pas["XData.Model.Classes"].TXDataAction.$create("Create$1"))),pas["Bcl.Json.Common"].AsJObject(JActions[I]));
          };
        };
      };
    };
    this.ReadAction = function (Action, JObj) {
      var Key = "";
      var I = 0;
      var JParamDefs = null;
      var Keys = [];
      var KeyIndex = 0;
      this.ReadBase(Action,JObj);
      Keys = pas["Bcl.Json.Common"].JObjectKeys(JObj);
      for (var $l = 0, $end = rtl.length(Keys) - 1; $l <= $end; $l++) {
        KeyIndex = $l;
        Key = Keys[KeyIndex];
        if (Key === "Name") {
          Action.FName = pas["Bcl.Json.Common"].JToStr(JObj[Key])}
         else if (Key === "Parameters") {
          JParamDefs = pas["Bcl.Json.Common"].AsJArray(JObj[Key]);
          for (var $l1 = 0, $end1 = JParamDefs.length - 1; $l1 <= $end1; $l1++) {
            I = $l1;
            this.ReadParamDef(Action.FParameters.GetItem$1(Action.FParameters.Add$1(pas["XData.Model.Classes"].TXDataParamDef.$create("Create"))),pas["Bcl.Json.Common"].AsJObject(JParamDefs[I]));
          };
        } else if (Key === "HttpMethod") {
          Action.FHttpMethod = pas["Bcl.Json.Common"].JToStr(JObj[Key])}
         else if (Key === "IsParamStream") {
          Action.FIsParamStream = pas["Bcl.Json.Common"].JToBool(JObj[Key])}
         else if (Key === "IsResultStream") {
          Action.FIsResultStream = pas["Bcl.Json.Common"].JToBool(JObj[Key])}
         else if (Key === "IsResultCriteria") {
          Action.FIsResultCriteria = pas["Bcl.Json.Common"].JToBool(JObj[Key])}
         else if (Key === "IsResultSingleObject") {
          Action.FIsResultSingleObject = pas["Bcl.Json.Common"].JToBool(JObj[Key])}
         else if (Key === "OperationId") {
          Action.FOperationId = pas["Bcl.Json.Common"].JToStr(JObj[Key])}
         else if (Key === "ReturnType") {
          Action.FReturnTypeRef = pas["Bcl.Json.Common"].JToStr(JObj[Key])}
         else if (Key === "Consumes") Action.FConsumes = pas["Bcl.Json.Common"].JToStr(JObj[Key]);
      };
    };
    this.ReadParamDef = function (ParamDef, JObj) {
      var Key = "";
      var Keys = [];
      var KeyIndex = 0;
      this.ReadBase(ParamDef,JObj);
      Keys = pas["Bcl.Json.Common"].JObjectKeys(JObj);
      for (var $l = 0, $end = rtl.length(Keys) - 1; $l <= $end; $l++) {
        KeyIndex = $l;
        Key = Keys[KeyIndex];
        if (Key === "Name") {
          ParamDef.FName = pas["Bcl.Json.Common"].JToStr(JObj[Key])}
         else if (Key === "BindingMode") {
          ParamDef.FBindingMode = pas["Bcl.TypInfo.Common"].GetEnumValue_(pas["XData.Model.Classes"].$rtti["TBindingMode"],pas["Bcl.Json.Common"].JToStr(JObj[Key]))}
         else if (Key === "Output") {
          ParamDef.FOutput = pas["Bcl.Json.Common"].JToBool(JObj[Key])}
         else if (Key === "Input") {
          ParamDef.FInput = pas["Bcl.Json.Common"].JToBool(JObj[Key])}
         else if (Key === "Type") {
          ParamDef.FTypeRef = pas["Bcl.Json.Common"].JToStr(JObj[Key])}
         else if (Key === "TypeName") ParamDef.FTypeNameRef = pas["Bcl.Json.Common"].JToStr(JObj[Key]);
      };
    };
    this.Deserialize = function (AModel, Json) {
      var Deserializer = null;
      Deserializer = $mod.TXDataModelDeserializer.$create("Create$1",[AModel,Json]);
      try {
        Deserializer.Read();
      } finally {
        Deserializer = rtl.freeLoc(Deserializer);
      };
    };
  });
});
rtl.module("XData.Web.Connection",["System","Types","Classes","SysUtils","Web","JS","XData.Web.Request","XData.Web.Response","XData.Model.Classes"],function () {
  "use strict";
  var $mod = this;
  this.$rtti.$Class("TXDataWebConnection");
  this.$rtti.$Class("TXDataWebConnectionDesignData");
  this.$rtti.$RefToProcVar("THttpResponseProc",{procsig: rtl.newTIProcSig([["Response",pas["XData.Web.Response"].$rtti["IHttpResponse"]]])});
  this.$rtti.$RefToProcVar("THttpErrorProc",{procsig: rtl.newTIProcSig([])});
  this.$rtti.$RefToProcVar("THttpEventProc",{procsig: rtl.newTIProcSig([["Event",rtl.jsvalue]])});
  this.$rtti.$RefToProcVar("THttpRequestProc",{procsig: rtl.newTIProcSig([["Request",pas["XData.Web.Request"].$rtti["IHttpRequest"]]])});
  rtl.createClass(this,"TXDataWebConnectionRequest",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FRequest = null;
      this.FConnection = null;
      this.FRequestProc = null;
      this.FAsync = false;
    };
    this.$final = function () {
      rtl.setIntfP(this,"FRequest",null);
      this.FConnection = undefined;
      this.FRequestProc = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function (AConnection, ARequest) {
      rtl._AddRef(ARequest);
      try {
        this.FConnection = AConnection;
        rtl.setIntfP(this,"FRequest",ARequest);
      } finally {
        rtl._Release(ARequest);
      };
      return this;
    };
  });
  rtl.createClass(this,"TXDataWebConnectionResponse",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FRequest = null;
      this.FResponse = null;
      this.FConnection = null;
      this.FSuccessProc = null;
      this.FAsync = false;
    };
    this.$final = function () {
      rtl.setIntfP(this,"FRequest",null);
      rtl.setIntfP(this,"FResponse",null);
      this.FConnection = undefined;
      this.FSuccessProc = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function (AConnection, ARequest, AResponse) {
      rtl._AddRef(ARequest);
      rtl._AddRef(AResponse);
      try {
        this.FConnection = AConnection;
        rtl.setIntfP(this,"FRequest",ARequest);
        rtl.setIntfP(this,"FResponse",AResponse);
      } finally {
        rtl._Release(ARequest);
        rtl._Release(AResponse);
      };
      return this;
    };
  });
  rtl.createClass(this,"TXDataWebConnectionError",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FResponse = null;
      this.FConnection = null;
      this.FErrorMessage = "";
      this.FRequestUrl = "";
    };
    this.$final = function () {
      rtl.setIntfP(this,"FResponse",null);
      this.FConnection = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function (AConnection, AResponse, ARequestUrl, AErrorMessage) {
      rtl._AddRef(AResponse);
      try {
        this.FConnection = AConnection;
        rtl.setIntfP(this,"FResponse",AResponse);
        this.FErrorMessage = AErrorMessage;
        this.FRequestUrl = ARequestUrl;
      } finally {
        rtl._Release(AResponse);
      };
      return this;
    };
  });
  rtl.createClass(this,"EXDataWebConnectionException",pas.SysUtils.Exception,function () {
    this.$init = function () {
      pas.SysUtils.Exception.$init.call(this);
      this.FError = null;
    };
    this.$final = function () {
      this.FError = undefined;
      pas.SysUtils.Exception.$final.call(this);
    };
    this.Create$2 = function (AError) {
      this.FError = AError;
      pas.SysUtils.Exception.CreateFmt.call(this,"Error connecting to %s",pas.System.VarRecs(18,AError.FRequestUrl));
      return this;
    };
  });
  this.$rtti.$MethodVar("TXDataWebConnectionRequestEvent",{procsig: rtl.newTIProcSig([["Args",this.$rtti["TXDataWebConnectionRequest"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TXDataWebConnectionResponseEvent",{procsig: rtl.newTIProcSig([["Args",this.$rtti["TXDataWebConnectionResponse"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TXDataWebConnectionErrorEvent",{procsig: rtl.newTIProcSig([["error",this.$rtti["TXDataWebConnectionError"]]]), methodkind: 0});
  this.$rtti.$RefToProcVar("TXDataWebConnectionErrorProc",{procsig: rtl.newTIProcSig([["error",this.$rtti["TXDataWebConnectionError"]]])});
  this.$rtti.$RefToProcVar("TXDataWebConnectionConnectProc",{procsig: rtl.newTIProcSig([])});
  rtl.createClass(this,"TXDataWebConnection",pas.Classes.TComponent,function () {
    this.$init = function () {
      pas.Classes.TComponent.$init.call(this);
      this.FURL = "";
      this.FModel = null;
      this.FOnConnect = null;
      this.FStreamedConnected = false;
      this.FOnRequest = null;
      this.FOnResponse = null;
      this.FOnError = null;
      this.FDesignData = null;
    };
    this.$final = function () {
      this.FModel = undefined;
      this.FOnConnect = undefined;
      this.FOnRequest = undefined;
      this.FOnResponse = undefined;
      this.FOnError = undefined;
      this.FDesignData = undefined;
      pas.Classes.TComponent.$final.call(this);
    };
    this.GetConnected = function () {
      var Result = false;
      Result = this.FModel != null;
      return Result;
    };
    this.SetConnected = function (Value) {
      if ((pas.Classes.TComponentStateItem.csLoading in this.FComponentState) && Value) {
        this.FStreamedConnected = true}
       else {
        if (Value === this.GetConnected()) return;
        if (Value) {
          this.DoConnect(null,null);
        } else {
          this.DoDisconnect();
        };
      };
    };
    this.IsDesignDataStored = function () {
      var Result = false;
      Result = this.FDesignData.FPersist;
      return Result;
    };
    this.SetDesignData = function (Value) {
      this.FDesignData.Assign(Value);
    };
    this.DoError = function (Response, RequestUrl, ErrorMessage, ErrorProc) {
      var error = null;
      rtl._AddRef(Response);
      try {
        error = $mod.TXDataWebConnectionError.$create("Create$1",[this,Response,RequestUrl,ErrorMessage]);
        if (ErrorProc != null) {
          ErrorProc(error)}
         else if (this.FOnError != null) {
          this.FOnError(error)}
         else throw pas.SysUtils.Exception.$create("Create$1",["XDataConnectionError: " + ErrorMessage]);
      } finally {
        rtl._Release(Response);
      };
    };
    this.SetURL = function (Value) {
      if (this.FURL !== Value) {
        this.FURL = Value;
        this.DoDisconnect();
      };
    };
    this.DoConnect = function (ConnectProc, ErrorProc) {
      var $Self = this;
      var ModelUrl = "";
      function OnSuccess(Resp) {
        var LocalModel = null;
        rtl._AddRef(Resp);
        try {
          if (Resp.GetStatusCode() === 200) {
            LocalModel = pas["XData.Model.Classes"].TXDataModel.$create("Create$1");
            try {
              pas["XData.Model.Deserializer"].TXDataModelDeserializer.Deserialize(LocalModel,Resp.GetContentAsText());
              $Self.FModel = LocalModel;
            } catch ($e) {
              LocalModel = rtl.freeLoc(LocalModel);
              throw $e;
            };
            if (ConnectProc != null) {
              ConnectProc()}
             else if ($Self.FOnConnect != null) $Self.FOnConnect($Self);
          } else $Self.DoError(Resp,ModelUrl,pas.SysUtils.Format("Error %d. Could not connect retrieve XData model from %s",pas.System.VarRecs(0,Resp.GetStatusCode(),18,ModelUrl)),ErrorProc);
        } finally {
          rtl._Release(Resp);
        };
      };
      function LocalError() {
        var Resp = null;
        try {
          Resp = rtl.setIntfL(Resp,rtl.queryIntfT(pas["XData.Web.Response"].TDummyHttpResponse.$create("Create$1"),pas["XData.Web.Response"].IHttpResponse),true);
          $Self.DoError(Resp,ModelUrl,"Error connecting to XData server",ErrorProc);
        } finally {
          rtl._Release(Resp);
        };
      };
      var Req = null;
      var I = 0;
      try {
        rtl.free(this,"FModel");
        this.FModel = null;
        ModelUrl = pas["Bcl.Utils"].TBclUtils.CombineUrlFast($Self.FURL,"$model");
        Req = rtl.setIntfL(Req,rtl.queryIntfT(pas["XData.Web.Request"].THttpRequest.$create("Create$2",[ModelUrl]),pas["XData.Web.Request"].IHttpRequest),true);
        for (var $l = 0, $end = this.FDesignData.FHeaders.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          if (this.FDesignData.FHeaders.GetName(I) !== "") Req.GetHeaders().SetValue(this.FDesignData.FHeaders.GetName(I),this.FDesignData.FHeaders.GetValueFromIndex(I));
        };
        this.SendRequest(Req,OnSuccess,LocalError);
      } finally {
        rtl._Release(Req);
      };
    };
    this.DoDisconnect = function () {
      rtl.free(this,"FModel");
      this.FModel = null;
    };
    this.LoadModel = function () {
      this.DoConnect(null,null);
    };
    this.SendRequest = function (Request, SuccessProc, ErrorProc) {
      var $Self = this;
      function LocalSuccess(Response) {
        var ResponseArgs = null;
        var Async = false;
        rtl._AddRef(Response);
        try {
          Async = false;
          if ($Self.FOnResponse != null) {
            ResponseArgs = $mod.TXDataWebConnectionResponse.$create("Create$1",[$Self,Request,Response]);
            try {
              ResponseArgs.FSuccessProc = function (Response) {
                rtl._AddRef(Response);
                try {
                  SuccessProc(Response);
                } finally {
                  rtl._Release(Response);
                };
              };
              $Self.FOnResponse(ResponseArgs);
              Async = ResponseArgs.FAsync;
              if (!Async) Response = rtl.setIntfL(Response,ResponseArgs.FResponse);
            } finally {
              if (!Async) ResponseArgs = rtl.freeLoc(ResponseArgs);
            };
          };
          if (!Async) SuccessProc(Response);
        } finally {
          rtl._Release(Response);
        };
      };
      var RequestArgs = null;
      var Async = false;
      rtl._AddRef(Request);
      try {
        Async = false;
        if (this.FOnRequest != null) {
          RequestArgs = $mod.TXDataWebConnectionRequest.$create("Create$1",[$Self,Request]);
          try {
            RequestArgs.FRequestProc = function (Request) {
              rtl._AddRef(Request);
              try {
                $mod.InternalSendRequest(Request,LocalSuccess,function (Event) {
                  ErrorProc();
                });
              } finally {
                rtl._Release(Request);
              };
            };
            this.FOnRequest(RequestArgs);
            Async = RequestArgs.FAsync;
          } finally {
            if (!Async) RequestArgs = rtl.freeLoc(RequestArgs);
          };
        };
        if (!Async) $mod.InternalSendRequest(Request,LocalSuccess,function (Event) {
          ErrorProc();
        });
      } finally {
        rtl._Release(Request);
      };
    };
    this.SendRequestAsync = async function (Request) {
      var $Self = this;
      var Result = null;
      rtl._AddRef(Request);
      try {
        Result = new Promise(function (resolve, reject) {
          $Self.SendRequest(Request,function (Response) {
            rtl._AddRef(Response);
            try {
              Response._AddRef();
              resolve(Response);
            } finally {
              rtl._Release(Response);
            };
          },function () {
            reject(pas.SysUtils.Exception.$create("Create$1",["Request error: " + Request.GetUri()]));
          });
        });
      } finally {
        rtl._Release(Request);
      };
      return Result;
    };
    this.AbsoluteUrl = function (RelativeUrl) {
      var Result = "";
      Result = pas["Bcl.Utils"].TBclUtils.CombineUrlFast(this.FURL,RelativeUrl);
      return Result;
    };
    this.Create$1 = function (AOwner) {
      pas.Classes.TComponent.Create$1.call(this,AOwner);
      this.FDesignData = $mod.TXDataWebConnectionDesignData.$create("Create$1");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FDesignData");
      rtl.free(this,"FModel");
      pas.Classes.TComponent.Destroy.call(this);
    };
    this.Open = function (ConnectProc, ErrorProc) {
      if (!this.GetConnected()) this.DoConnect(ConnectProc,ErrorProc);
    };
    this.OpenAsync = async function () {
      var $Self = this;
      var Result = undefined;
      Result = new Promise(function (resolve, reject) {
        $Self.DoConnect(function () {
          if ($Self.FOnConnect != null) $Self.FOnConnect($Self);
          resolve(null);
        },function (error) {
          reject($mod.EXDataWebConnectionException.$create("Create$2",[error]));
        });
      });
      return Result;
    };
    this.Close = function () {
      this.SetConnected(false);
    };
    this.Loaded = function () {
      pas.Classes.TComponent.Loaded.call(this);
      if (this.FStreamedConnected) this.SetConnected(true);
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("URL",2,rtl.string,"FURL","SetURL");
    $r.addProperty("DesignData",14,$mod.$rtti["TXDataWebConnectionDesignData"],"FDesignData","SetDesignData",4,{stored: "IsDesignDataStored"});
    $r.addProperty("Connected",3,rtl.boolean,"GetConnected","SetConnected",4,{Default: false});
    $r.addProperty("OnConnect",0,pas.Classes.$rtti["TNotifyEvent"],"FOnConnect","FOnConnect");
    $r.addProperty("OnError",0,$mod.$rtti["TXDataWebConnectionErrorEvent"],"FOnError","FOnError");
    $r.addProperty("OnRequest",0,$mod.$rtti["TXDataWebConnectionRequestEvent"],"FOnRequest","FOnRequest");
    $r.addProperty("OnResponse",0,$mod.$rtti["TXDataWebConnectionResponseEvent"],"FOnResponse","FOnResponse");
  });
  rtl.createClass(this,"TXDataWebConnectionDesignData",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FHeaders = null;
      this.FPersist = false;
    };
    this.$final = function () {
      this.FHeaders = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.IsStored = function () {
      var Result = false;
      Result = this.FPersist;
      return Result;
    };
    this.SetHeaders = function (Value) {
      this.FHeaders.Assign(Value);
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FHeaders = pas.Classes.TStringList.$create("Create$1");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FHeaders");
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TXDataWebConnectionDesignData.isPrototypeOf(Source)) {
        this.FPersist = Source.FPersist;
        this.SetHeaders(Source.FHeaders);
      } else pas.Classes.TPersistent.Assign.call(this,Source);
    };
    var $r = this.$rtti;
    $r.addProperty("Headers",14,pas.Classes.$rtti["TStrings"],"FHeaders","SetHeaders",4,{stored: "IsStored"});
    $r.addProperty("Persist",12,rtl.boolean,"FPersist","FPersist",4,{stored: "IsStored"});
  });
  rtl.createClass(this,"EEventException",pas.SysUtils.Exception,function () {
    this.$init = function () {
      pas.SysUtils.Exception.$init.call(this);
      this.FEvent = undefined;
    };
    this.Create$2 = function (Msg, AEvent) {
      pas.SysUtils.Exception.Create$1.call(this,Msg);
      this.FEvent = AEvent;
      return this;
    };
  });
  this.InternalSendRequest = function (Req, SuccessProc, ErrorProc) {
    var Xhr = null;
    function XhrLoad() {
      var Resp = null;
      try {
        Resp = rtl.setIntfL(Resp,rtl.queryIntfT(pas["XData.Web.Response"].TXhrHttpResponse.$create("Create$2",[Xhr]),pas["XData.Web.Response"].IHttpResponse),true);
        if (SuccessProc != null) SuccessProc(Resp);
      } finally {
        rtl._Release(Resp);
      };
    };
    function XhrError(Event) {
      if (ErrorProc != null) ErrorProc(Event);
    };
    var HeaderNames = [];
    var I = 0;
    rtl._AddRef(Req);
    try {
      Xhr = new XMLHttpRequest();
      Xhr.open(Req.GetMethod(),Req.GetUri(),true);
      HeaderNames = Req.GetHeaders().GetHeaderNames();
      for (var $l = 0, $end = rtl.length(HeaderNames) - 1; $l <= $end; $l++) {
        I = $l;
        Xhr.setRequestHeader(HeaderNames[I],Req.GetHeaders().Get(HeaderNames[I]));
      };
      Xhr.addEventListener("load",XhrLoad);
      Xhr.addEventListener("error",XhrError);
      Xhr.addEventListener("timeout",XhrError);
      if (Req.GetTimeout() > 0) Xhr.timeout = Req.GetTimeout();
      if (Req.GetResponseType() !== "") Xhr.responseType = Req.GetResponseType();
      if (pas.JS.isDefined(Req.GetContent()) && !pas.JS.isNull(Req.GetContent())) {
        Xhr.send(Req.GetContent())}
       else Xhr.send();
    } finally {
      rtl._Release(Req);
    };
  };
  this.InternalSendRequestAsync = async function (Req, SuccessProc, ErrorProc) {
    var Result = undefined;
    rtl._AddRef(Req);
    try {
      Result = new Promise(function (resolve, reject) {
        $mod.InternalSendRequest(Req,function (Response) {
          rtl._AddRef(Response);
          try {
            resolve(Response);
          } finally {
            rtl._Release(Response);
          };
        },function (Event) {
          reject($mod.EEventException.$create("Create$2",["XHR request failed",Event]));
        });
      });
    } finally {
      rtl._Release(Req);
    };
    return Result;
  };
},["Bcl.Utils","XData.Model.Deserializer"]);
rtl.module("XData.Bind.Converter",["System","TypInfo","SysUtils","XData.Model.Classes"],function () {
  "use strict";
  var $mod = this;
  this.BindValueToUrl = function (Value, PropName, Info, UrlConverter) {
    var Result = "";
    Result = UrlConverter.ValueToUrl(Value,PropName);
    return Result;
  };
});
rtl.module("XData.Web.Client",["System","JS","SysUtils","Classes","Types","Bcl.Rtti.Common","Bcl.Json.Common","XData.Model.Classes","XData.Web.Connection","XData.Web.Request","XData.Web.Response"],function () {
  "use strict";
  var $mod = this;
  this.$rtti.$Class("TXDataWebClient");
  this.TXDataClientRequestType = {"0": "rtGet", rtGet: 0, "1": "rtList", rtList: 1, "2": "rtPut", rtPut: 2, "3": "rtPost", rtPost: 3, "4": "rtDelete", rtDelete: 4, "5": "rtRawInvoke", rtRawInvoke: 5};
  this.$rtti.$Enum("TXDataClientRequestType",{minvalue: 0, maxvalue: 5, ordtype: 1, enumtype: this.TXDataClientRequestType});
  rtl.createClass(this,"TXDataClientResponse",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FResponse = null;
      this.FRequestType = 0;
      this.FResult = undefined;
      this.FRequestId = "";
      this.FCount = 0;
      this.FClient = null;
    };
    this.$final = function () {
      rtl.setIntfP(this,"FResponse",null);
      this.FClient = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.GetResponseText = function () {
      var Result = "";
      Result = this.FResponse.GetContentAsText();
      return Result;
    };
    this.GetStatusCode = function () {
      var Result = 0;
      Result = this.FResponse.GetStatusCode();
      return Result;
    };
    this.GetResultAsArray = function () {
      var Result = null;
      Result = pas.JS.toArray(this.FResult);
      return Result;
    };
    this.GetResultAsObject = function () {
      var Result = null;
      Result = pas.JS.toObject(this.FResult);
      return Result;
    };
    this.Create$1 = function (AClient, AResponse, AResult, ARequestType, ARequestId, ACount) {
      rtl._AddRef(AResponse);
      try {
        rtl.setIntfP(this,"FResponse",AResponse);
        this.FResult = AResult;
        this.FRequestType = ARequestType;
        this.FRequestId = ARequestId;
        this.FCount = ACount;
        this.FClient = AClient;
      } finally {
        rtl._Release(AResponse);
      };
      return this;
    };
  });
  rtl.createClass(this,"TXDataClientRequest",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FRequest = null;
      this.FRequestType = 0;
      this.FRequestId = "";
      this.FClient = null;
    };
    this.$final = function () {
      rtl.setIntfP(this,"FRequest",null);
      this.FClient = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function (AClient, ARequest, ARequestType, ARequestId) {
      rtl._AddRef(ARequest);
      try {
        rtl.setIntfP(this,"FRequest",ARequest);
        this.FRequestType = ARequestType;
        this.FRequestId = ARequestId;
        this.FClient = AClient;
      } finally {
        rtl._Release(ARequest);
      };
      return this;
    };
  });
  rtl.createClass(this,"TXDataClientError",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FResponse = null;
      this.FRequestId = "";
      this.FErrorCode = "";
      this.FErrorMessage = "";
      this.FRequestUrl = "";
      this.FClient = null;
    };
    this.$final = function () {
      rtl.setIntfP(this,"FResponse",null);
      this.FClient = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.GetStatusCode = function () {
      var Result = 0;
      Result = this.FResponse.GetStatusCode();
      return Result;
    };
    this.Create$1 = function (AClient, AResponse, ARequestUrl, AErrorCode, AErrorMessage, ARequestId) {
      rtl._AddRef(AResponse);
      try {
        rtl.setIntfP(this,"FResponse",AResponse);
        this.FErrorCode = AErrorCode;
        this.FErrorMessage = AErrorMessage;
        this.FRequestId = ARequestId;
        this.FRequestUrl = ARequestUrl;
        this.FClient = AClient;
      } finally {
        rtl._Release(AResponse);
      };
      return this;
    };
  });
  this.$rtti.$MethodVar("TXDataClientLoadEvent",{procsig: rtl.newTIProcSig([["Response",this.$rtti["TXDataClientResponse"]]]), methodkind: 0});
  this.$rtti.$RefToProcVar("TXDataClientLoadProc",{procsig: rtl.newTIProcSig([["Response",this.$rtti["TXDataClientResponse"]]])});
  this.$rtti.$MethodVar("TXDataClientErrorEvent",{procsig: rtl.newTIProcSig([["error",this.$rtti["TXDataClientError"]]]), methodkind: 0});
  this.$rtti.$RefToProcVar("TXDataClientErrorProc",{procsig: rtl.newTIProcSig([["error",this.$rtti["TXDataClientError"]]])});
  this.$rtti.$MethodVar("TXDataClientRequestEvent",{procsig: rtl.newTIProcSig([["Request",this.$rtti["TXDataClientRequest"]]]), methodkind: 0});
  this.$rtti.$RefToProcVar("THttpResponseProc",{procsig: rtl.newTIProcSig([["Response",pas["XData.Web.Response"].$rtti["IHttpResponse"]]])});
  this.TReferenceSolvingMode = {"0": "rsAll", rsAll: 0, "1": "rsNone", rsNone: 1};
  this.$rtti.$Enum("TReferenceSolvingMode",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TReferenceSolvingMode});
  rtl.createClass(this,"TXDataWebClient",pas.Classes.TComponent,function () {
    this.$init = function () {
      pas.Classes.TComponent.$init.call(this);
      this.FOnLoad = null;
      this.FOnError = null;
      this.FOnRequest = null;
      this.FConnection = null;
      this.FReferenceSolvingMode = 0;
    };
    this.$final = function () {
      this.FOnLoad = undefined;
      this.FOnError = undefined;
      this.FOnRequest = undefined;
      this.FConnection = undefined;
      pas.Classes.TComponent.$final.call(this);
    };
    this.EntityTypeFromEntitySet = function (EntitySetName) {
      var Result = null;
      Result = null;
      Result = this.Model().GetEntitySet(EntitySetName).FEntityType;
      if (Result === null) throw $mod.EXDataClientException.$create("CreateFmt",['Invalid entity set "%s"',pas.System.VarRecs(18,EntitySetName)]);
      return Result;
    };
    this.SetConnection = function (Value) {
      if (Value !== this.FConnection) {
        if (this.FConnection !== null) this.FConnection.RemoveFreeNotification(this);
        this.FConnection = Value;
        if (this.FConnection !== null) this.FConnection.FreeNotification(this);
      };
    };
    this.Model = function () {
      var Result = null;
      this.CheckConnection();
      if (!(this.FConnection.FModel != null)) throw $mod.EXDataClientException.$create("Create$1",["TXDataWebConnection is not connected"]);
      Result = this.FConnection.FModel;
      return Result;
    };
    this.Url = function () {
      var Result = "";
      this.CheckConnection();
      Result = this.FConnection.FURL;
      return Result;
    };
    this.CheckConnection = function () {
      if (!(this.FConnection != null)) throw $mod.EXDataClientException.$create("Create$1",["Missing XData Connection"]);
    };
    this.ParseError = function (Response, ErrorCode, ErrorMessage) {
      var ErrorResult = undefined;
      var ErrorObject = null;
      rtl._AddRef(Response);
      try {
        ErrorCode.set("");
        ErrorMessage.set(Response.GetStatusReason());
        if (pas.SysUtils.SameText(Response.GetHeaders().Get("content-type"),"application/json")) {
          ErrorResult = null;
          try {
            ErrorResult = JSON.parse(Response.GetContentAsText());
          } catch ($e) {
          };
          if (rtl.isObject(ErrorResult) && rtl.isObject(ErrorResult["error"])) {
            ErrorObject = ErrorResult["error"];
            ErrorCode.set(pas.JS.ToString(ErrorObject["code"]));
            ErrorMessage.set(pas.JS.ToString(ErrorObject["message"]));
          };
        };
      } finally {
        rtl._Release(Response);
      };
    };
    this.SolveReferences = function (json) {
      var byid = {}, // all objects by id
              refs = []; // references to objects that could not be resolved
          json = (function recurse(obj, prop, parent) {
              if (typeof obj !== 'object' || !obj) // a primitive value
                  return obj;
              if (Object.prototype.toString.call(obj) === '[object Array]') {
                  for (var i = 0; i < obj.length; i++)
                      // check also if the array element is not a primitive value
                      if (typeof obj[i] !== 'object' || !obj[i]) // a primitive value
                          continue;
                      else if ("$ref" in obj[i])
                          obj[i] = recurse(obj[i], i, obj);
                      else
                          obj[i] = recurse(obj[i], prop, obj);
                  return obj;
              }
              if ("$ref" in obj) { // a reference
                  var ref = obj.$ref;
                  if (ref in byid)
                      return byid[ref];
                  // else we have to make it lazy:
                  refs.push([parent, prop, ref]);
                  return;
              } else if ("$id" in obj) {
                  var id = obj.$id;
                  delete obj.$id;
                  if ("$values" in obj) // an array
                      obj = obj.$values.map(recurse);
                  else // a plain object
                      for (var p in obj)
                          obj[p] = recurse(obj[p], p, obj);
                  byid[id] = obj;
              } else {
                  // NEW: recurse into plain objects (no $id / $ref),
                  // e.g. { "value": [ ... ] }
                  for (var p in obj)
                      obj[p] = recurse(obj[p], p, obj);
              }
              return obj;
          })(json); // run it!
      
          for (var i = 0; i < refs.length; i++) { // resolve previously unknown references
              var ref = refs[i];
              ref[0][ref[1]] = byid[ref[2]];
              // Notice that this throws if you put in a reference at top-level
          };
    };
    this.DoLoad = function (Response, SuccessProc, AsyncMode) {
      try {
        var $tmp = this.FReferenceSolvingMode;
        if ($tmp === $mod.TReferenceSolvingMode.rsAll) this.SolveReferences(Response.FResult);
        if (AsyncMode) {
          if (this.FOnLoad != null) this.FOnLoad(Response);
          if (SuccessProc != null) SuccessProc(Response);
        } else {
          if (SuccessProc != null) {
            SuccessProc(Response);
            return;
          };
          if (this.FOnLoad != null) this.FOnLoad(Response);
        };
      } finally {
        if (!AsyncMode) Response = rtl.freeLoc(Response);
      };
    };
    this.DoError = function (Response, RequestUrl, RequestId, ErrorMessage, ErrorProc, AsyncMode) {
      var ErrorCode = "";
      var ClientError = null;
      rtl._AddRef(Response);
      try {
        if (Response === null) Response = rtl.setIntfL(Response,rtl.queryIntfT(pas["XData.Web.Response"].TDummyHttpResponse.$create("Create$1"),pas["XData.Web.Response"].IHttpResponse),true);
        ErrorCode = "";
        if (ErrorMessage === "") this.ParseError(Response,{get: function () {
            return ErrorCode;
          }, set: function (v) {
            ErrorCode = v;
          }},{get: function () {
            return ErrorMessage;
          }, set: function (v) {
            ErrorMessage = v;
          }});
        ClientError = $mod.TXDataClientError.$create("Create$1",[this,Response,RequestUrl,ErrorCode,ErrorMessage,RequestId]);
        if (AsyncMode) {
          if (this.FOnError != null) this.FOnError(ClientError);
          if (ErrorProc != null) {
            ErrorProc(ClientError)}
           else throw $mod.EXDataClientRequestException.$create("Create$2",[ClientError]);
        } else {
          if (ErrorProc != null) {
            ErrorProc(ClientError);
            return;
          };
          if (this.FOnError != null) {
            this.FOnError(ClientError)}
           else throw $mod.EXDataClientRequestException.$create("Create$2",[ClientError]);
        };
      } finally {
        rtl._Release(Response);
      };
    };
    this.RequestUrl = function (RelativeUrl) {
      var Result = "";
      Result = pas["XData.Utils"].TXDataUtils.CombineUrlFast(this.Url(),RelativeUrl);
      return Result;
    };
    this.GetNavPropValue = function (Entity, Prop) {
      var Result = undefined;
      Result = Entity[Prop.FName];
      return Result;
    };
    this.GetPropValue = function (Entity, Prop) {
      var Result = undefined;
      Result = Entity[Prop.FName];
      return Result;
    };
    this.InternalGet = function (EntitySet, QueryString, Id, RequestId, SuccessProc, ErrorProc, AsyncMode) {
      var $Self = this;
      var RequestUri = "";
      function LocalSuccess(Resp) {
        var JsonResult = undefined;
        rtl._AddRef(Resp);
        try {
          if (Resp.GetStatusCode() === 200) {
            JsonResult = JSON.parse(Resp.GetContentAsText());
            if (rtl.isObject(JsonResult)) {
              $Self.DoLoad($mod.TXDataClientResponse.$create("Create$1",[$Self,Resp,JsonResult,$mod.TXDataClientRequestType.rtGet,RequestId,0]),SuccessProc,AsyncMode)}
             else $Self.DoError(Resp,RequestUri,RequestId,"Invalid JSON object from GET request",ErrorProc,AsyncMode);
          } else if (Resp.GetStatusCode() === 404) {
            $Self.DoLoad($mod.TXDataClientResponse.$create("Create$1",[$Self,Resp,null,$mod.TXDataClientRequestType.rtGet,RequestId,0]),SuccessProc,AsyncMode)}
           else $Self.DoError(Resp,RequestUri,RequestId,"",ErrorProc,AsyncMode);
        } finally {
          rtl._Release(Resp);
        };
      };
      function LocalError() {
        $Self.DoError(null,RequestUri,RequestId,"",ErrorProc,AsyncMode);
      };
      var Req = null;
      try {
        RequestUri = this.RequestUrl(pas["Bcl.Utils"].TBclUtils.PercentEncode(this.Model().CanonicalUrlFromId(this.EntityTypeFromEntitySet(EntitySet),Id)));
        if (QueryString !== "") RequestUri = RequestUri + "?" + QueryString;
        Req = rtl.setIntfL(Req,rtl.queryIntfT(pas["XData.Web.Request"].THttpRequest.$create("Create$2",[RequestUri]),pas["XData.Web.Request"].IHttpRequest),true);
        this.DoRequest($mod.TXDataClientRequest.$create("Create$1",[$Self,Req,$mod.TXDataClientRequestType.rtGet,RequestId]));
        this.Send(Req,LocalSuccess,LocalError);
      } finally {
        rtl._Release(Req);
      };
    };
    this.InternalPut = function (EntitySet, Entity, RequestId, SuccessProc, ErrorProc, AsyncMode) {
      var $Self = this;
      var RequestUri = "";
      function LocalSuccess(Resp) {
        rtl._AddRef(Resp);
        try {
          if (Resp.GetStatusCode() === 200) {
            $Self.DoLoad($mod.TXDataClientResponse.$create("Create$1",[$Self,Resp,null,$mod.TXDataClientRequestType.rtPut,RequestId,0]),SuccessProc,AsyncMode)}
           else $Self.DoError(Resp,RequestUri,RequestId,"",ErrorProc,AsyncMode);
        } finally {
          rtl._Release(Resp);
        };
      };
      function LocalError() {
        $Self.DoError(null,RequestUri,RequestId,"",ErrorProc,AsyncMode);
      };
      var Req = null;
      try {
        RequestUri = this.RequestUrl(pas["Bcl.Utils"].TBclUtils.PercentEncode(this.Model().CanonicalUrlFromEntity(this.EntityTypeFromEntitySet(EntitySet),Entity,rtl.createCallback($Self,"GetPropValue"),rtl.createCallback($Self,"GetNavPropValue"))));
        Req = rtl.setIntfL(Req,rtl.queryIntfT(pas["XData.Web.Request"].THttpRequest.$create("Create$3",[RequestUri,"PUT"]),pas["XData.Web.Request"].IHttpRequest),true);
        Req.GetHeaders().SetValue("content-type","application/json");
        Req.SetContent(JSON.stringify(Entity));
        this.DoRequest($mod.TXDataClientRequest.$create("Create$1",[$Self,Req,$mod.TXDataClientRequestType.rtPut,RequestId]));
        this.Send(Req,LocalSuccess,LocalError);
      } finally {
        rtl._Release(Req);
      };
    };
    this.InternalPost = function (EntitySet, Entity, RequestId, SuccessProc, ErrorProc, AsyncMode) {
      var $Self = this;
      var RequestUri = "";
      function LocalSuccess(Resp) {
        var Value = undefined;
        var Obj = null;
        var EntityType = null;
        var I = 0;
        var Prop = "";
        rtl._AddRef(Resp);
        try {
          if (Resp.GetStatusCode() === 201) {
            Value = JSON.parse(Resp.GetContentAsText());
            if (rtl.isObject(Value)) {
              Obj = pas.JS.toObject(Value);
              EntityType = $Self.EntityTypeFromEntitySet(EntitySet);
              for (var $l = 0, $end = EntityType.FKey.GetCount() - 1; $l <= $end; $l++) {
                I = $l;
                Prop = EntityType.FKey.GetItem$1(I).FName;
                if (!pas.JS.isNull(Obj[Prop])) Entity[Prop] = Obj[Prop];
              };
            };
            $Self.DoLoad($mod.TXDataClientResponse.$create("Create$1",[$Self,Resp,JSON.parse(Resp.GetContentAsText()),$mod.TXDataClientRequestType.rtPost,RequestId,0]),SuccessProc,AsyncMode);
          } else $Self.DoError(Resp,RequestUri,RequestId,"",ErrorProc,AsyncMode);
        } finally {
          rtl._Release(Resp);
        };
      };
      function LocalError() {
        $Self.DoError(null,RequestUri,RequestId,"",ErrorProc,AsyncMode);
      };
      var Req = null;
      try {
        RequestUri = this.RequestUrl(pas["Bcl.Utils"].TBclUtils.PercentEncode(this.Model().EntitySetUrl(this.Model().GetEntitySet(EntitySet))));
        Req = rtl.setIntfL(Req,rtl.queryIntfT(pas["XData.Web.Request"].THttpRequest.$create("Create$3",[RequestUri,"POST"]),pas["XData.Web.Request"].IHttpRequest),true);
        Req.GetHeaders().SetValue("content-type","application/json");
        Req.SetContent(JSON.stringify(Entity));
        this.DoRequest($mod.TXDataClientRequest.$create("Create$1",[$Self,Req,$mod.TXDataClientRequestType.rtPost,RequestId]));
        this.Send(Req,LocalSuccess,LocalError);
      } finally {
        rtl._Release(Req);
      };
    };
    this.InternalDelete = function (EntitySet, Entity, RequestId, SuccessProc, ErrorProc, AsyncMode) {
      var $Self = this;
      var Req = null;
      var RequestUri = "";
      function LocalSuccess(Resp) {
        rtl._AddRef(Resp);
        try {
          if (Resp.GetStatusCode() === 204) {
            $Self.DoLoad($mod.TXDataClientResponse.$create("Create$1",[$Self,Resp,null,$mod.TXDataClientRequestType.rtDelete,RequestId,0]),SuccessProc,AsyncMode)}
           else $Self.DoError(Resp,RequestUri,RequestId,"",ErrorProc,AsyncMode);
        } finally {
          rtl._Release(Resp);
        };
      };
      function LocalError() {
        $Self.DoError(null,RequestUri,RequestId,"",ErrorProc,AsyncMode);
      };
      try {
        RequestUri = this.RequestUrl(pas["Bcl.Utils"].TBclUtils.PercentEncode(this.Model().CanonicalUrlFromEntity(this.EntityTypeFromEntitySet(EntitySet),Entity,rtl.createCallback($Self,"GetPropValue"),rtl.createCallback($Self,"GetNavPropValue"))));
        Req = rtl.setIntfL(Req,rtl.queryIntfT(pas["XData.Web.Request"].THttpRequest.$create("Create$3",[RequestUri,"DELETE"]),pas["XData.Web.Request"].IHttpRequest),true);
        this.DoRequest($mod.TXDataClientRequest.$create("Create$1",[$Self,Req,$mod.TXDataClientRequestType.rtDelete,RequestId]));
        this.Send(Req,LocalSuccess,LocalError);
      } finally {
        rtl._Release(Req);
      };
    };
    this.InternalList = function (EntitySet, Query, RequestId, SuccessProc, ErrorProc, AsyncMode) {
      var $Self = this;
      var RequestUri = "";
      function LocalSuccess(Resp) {
        var JsonResult = undefined;
        var ObjResult = null;
        var Count = 0;
        rtl._AddRef(Resp);
        try {
          if (Resp.GetStatusCode() === 200) {
            JsonResult = JSON.parse(Resp.GetContentAsText());
            if (rtl.isObject(JsonResult) && rtl.isArray(JsonResult["value"])) {
              ObjResult = JsonResult;
              if (ObjResult.hasOwnProperty("@xdata.count")) {
                Count = rtl.trunc(ObjResult["@xdata.count"])}
               else Count = 0;
              $Self.DoLoad($mod.TXDataClientResponse.$create("Create$1",[$Self,Resp,ObjResult["value"],$mod.TXDataClientRequestType.rtList,RequestId,Count]),SuccessProc,AsyncMode);
            } else $Self.DoError(Resp,RequestUri,RequestId,"Invalid JSON array from LIST request",ErrorProc,AsyncMode);
          } else $Self.DoError(Resp,RequestUri,RequestId,"",ErrorProc,AsyncMode);
        } finally {
          rtl._Release(Resp);
        };
      };
      function LocalError() {
        $Self.DoError(null,RequestUri,RequestId,"",ErrorProc,AsyncMode);
      };
      var Req = null;
      try {
        RequestUri = this.RequestUrl(pas["Bcl.Utils"].TBclUtils.PercentEncode(this.Model().EntitySetUrl(this.Model().GetEntitySet(EntitySet))));
        if (Query !== "") RequestUri = RequestUri + "?" + Query;
        Req = rtl.setIntfL(Req,rtl.queryIntfT(pas["XData.Web.Request"].THttpRequest.$create("Create$2",[RequestUri]),pas["XData.Web.Request"].IHttpRequest),true);
        this.DoRequest($mod.TXDataClientRequest.$create("Create$1",[$Self,Req,$mod.TXDataClientRequestType.rtList,RequestId]));
        this.Send(Req,LocalSuccess,LocalError);
      } finally {
        rtl._Release(Req);
      };
    };
    this.InternalRawInvoke = function (OperationId, Args, Query, RequestId, SuccessProc, ErrorProc, AsyncMode) {
      var Invoker = null;
      var Action = null;
      if (RequestId === "") RequestId = OperationId;
      Action = this.Model().FindActionByOperationId(OperationId);
      if (Action === null) throw $mod.EXDataClientException.$create("CreateFmt",['Operation "%s" not found',pas.System.VarRecs(18,OperationId)]);
      Invoker = $mod.TXDataWebInvoker.$create("Create$1",[this,Action,SuccessProc,ErrorProc,AsyncMode]);
      Invoker.FRequestId = RequestId;
      Invoker.Execute(Args,Query);
    };
    this.DoRequest = function (Request) {
      try {
        if (this.FOnRequest != null) this.FOnRequest(Request);
      } finally {
        Request = rtl.freeLoc(Request);
      };
    };
    this.Send = function (Req, SuccessProc, ErrorProc) {
      rtl._AddRef(Req);
      try {
        this.FConnection.SendRequest(Req,SuccessProc,ErrorProc);
      } finally {
        rtl._Release(Req);
      };
    };
    this.Notification = function (AComponent, Operation) {
      pas.Classes.TComponent.Notification.apply(this,arguments);
      if ((Operation === pas.Classes.TOperation.opRemove) && (AComponent === this.FConnection)) this.SetConnection(null);
    };
    this.Get = function (EntitySet, Id, RequestId) {
      this.Get$2(EntitySet,"",Id,RequestId);
    };
    this.Get$1 = function (EntitySet, Id, SuccessProc, ErrorProc) {
      this.InternalGet(EntitySet,"",Id,"get",SuccessProc,ErrorProc,false);
    };
    this.Get$2 = function (EntitySet, QueryString, Id, RequestId) {
      this.InternalGet(EntitySet,QueryString,Id,RequestId,null,null,false);
    };
    this.Get$3 = function (EntitySet, QueryString, Id, SuccessProc, ErrorProc) {
      this.InternalGet(EntitySet,QueryString,Id,"get",SuccessProc,ErrorProc,false);
    };
    this.GetAsync = async function (EntitySet, QueryString, Id) {
      var $Self = this;
      var Result = null;
      var promise = null;
      promise = new Promise(function (resolve, reject) {
        $Self.InternalGet(EntitySet,QueryString,Id,"get",function (Response) {
          resolve(Response);
        },function (error) {
          reject($mod.EXDataClientRequestException.$create("Create$2",[error]));
        },true);
      });
      return promise;
      return Result;
    };
    this.GetAsync$1 = async function (EntitySet, Id) {
      var Result = null;
      Result = await this.GetAsync(EntitySet,"",Id);
      return Result;
    };
    this.Put = function (EntitySet, Entity, RequestId) {
      this.InternalPut(EntitySet,Entity,RequestId,null,null,false);
    };
    this.Put$1 = function (EntitySet, Entity, SuccessProc, ErrorProc) {
      this.InternalPut(EntitySet,Entity,"put",SuccessProc,ErrorProc,false);
    };
    this.PutAsync = async function (EntitySet, Entity) {
      var $Self = this;
      var Result = null;
      var promise = null;
      promise = new Promise(function (resolve, reject) {
        $Self.InternalPut(EntitySet,Entity,"put",function (Response) {
          resolve(Response);
        },function (error) {
          reject($mod.EXDataClientRequestException.$create("Create$2",[error]));
        },true);
      });
      return promise;
      return Result;
    };
    this.Post = function (EntitySet, Entity, RequestId) {
      this.InternalPost(EntitySet,Entity,RequestId,null,null,false);
    };
    this.Post$1 = function (EntitySet, Entity, SuccessProc, ErrorProc) {
      this.InternalPost(EntitySet,Entity,"post",SuccessProc,ErrorProc,false);
    };
    this.PostAsync = async function (EntitySet, Entity) {
      var $Self = this;
      var Result = null;
      var promise = null;
      promise = new Promise(function (resolve, reject) {
        $Self.InternalPost(EntitySet,Entity,"post",function (Response) {
          resolve(Response);
        },function (error) {
          reject($mod.EXDataClientRequestException.$create("Create$2",[error]));
        },true);
      });
      return promise;
      return Result;
    };
    this.Delete = function (EntitySet, Entity, RequestId) {
      this.InternalDelete(EntitySet,Entity,RequestId,null,null,false);
    };
    this.Delete$1 = function (EntitySet, Entity, SuccessProc, ErrorProc) {
      this.InternalDelete(EntitySet,Entity,"delete",SuccessProc,ErrorProc,false);
    };
    this.DeleteAsync = async function (EntitySet, Entity) {
      var $Self = this;
      var Result = null;
      var promise = null;
      promise = new Promise(function (resolve, reject) {
        $Self.InternalDelete(EntitySet,Entity,"delete",function (Response) {
          resolve(Response);
        },function (error) {
          reject($mod.EXDataClientRequestException.$create("Create$2",[error]));
        },true);
      });
      return promise;
      return Result;
    };
    this.List = function (EntitySet, Query, RequestId) {
      this.InternalList(EntitySet,Query,RequestId,null,null,false);
    };
    this.List$1 = function (EntitySet, Query, SuccessProc, ErrorProc) {
      this.InternalList(EntitySet,Query,"list",SuccessProc,ErrorProc,false);
    };
    this.ListAsync = async function (EntitySet, Query) {
      var $Self = this;
      var Result = null;
      var promise = null;
      promise = new Promise(function (resolve, reject) {
        $Self.InternalList(EntitySet,Query,"list",function (Response) {
          resolve(Response);
        },function (error) {
          reject($mod.EXDataClientRequestException.$create("Create$2",[error]));
        },true);
      });
      return promise;
      return Result;
    };
    this.RawInvoke = function (OperationId, Args, Query, SuccessProc, ErrorProc) {
      this.InternalRawInvoke(OperationId,Args,Query,"",SuccessProc,ErrorProc,false);
    };
    this.RawInvoke$1 = function (OperationId, Args, RequestId) {
      this.InternalRawInvoke(OperationId,Args,"",RequestId,null,null,false);
    };
    this.RawInvoke$2 = function (OperationId, Args, SuccessProc, ErrorProc) {
      this.InternalRawInvoke(OperationId,Args,"","",SuccessProc,ErrorProc,false);
    };
    this.RawInvokeAsync = async function (OperationId, Args) {
      var $Self = this;
      var Result = null;
      var promise = null;
      promise = new Promise(function (resolve, reject) {
        $Self.InternalRawInvoke(OperationId,Args,"","",function (Response) {
          resolve(Response);
        },function (error) {
          reject($mod.EXDataClientRequestException.$create("Create$2",[error]));
        },true);
      });
      return promise;
      return Result;
    };
    this.RawInvokeAsync$1 = async function (OperationId, Args, Query) {
      var $Self = this;
      var Result = null;
      var promise = null;
      promise = new Promise(function (resolve, reject) {
        $Self.InternalRawInvoke(OperationId,Args,Query,"",function (Response) {
          resolve(Response);
        },function (error) {
          reject($mod.EXDataClientRequestException.$create("Create$2",[error]));
        },true);
      });
      return promise;
      return Result;
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Connection",2,pas["XData.Web.Connection"].$rtti["TXDataWebConnection"],"FConnection","SetConnection");
    $r.addProperty("OnLoad",0,$mod.$rtti["TXDataClientLoadEvent"],"FOnLoad","FOnLoad");
    $r.addProperty("OnError",0,$mod.$rtti["TXDataClientErrorEvent"],"FOnError","FOnError");
    $r.addProperty("OnRequest",0,$mod.$rtti["TXDataClientRequestEvent"],"FOnRequest","FOnRequest");
    $r.addProperty("ReferenceSolvingMode",0,$mod.$rtti["TReferenceSolvingMode"],"FReferenceSolvingMode","FReferenceSolvingMode",4,{Default: $mod.TReferenceSolvingMode.rsAll});
  });
  rtl.createClass(this,"TXDataWebInvoker",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FClient = null;
      this.FAction = null;
      this.FRequestId = "";
      this.FSuccessProc = null;
      this.FErrorProc = null;
      this.FAsyncMode = false;
    };
    this.$final = function () {
      this.FClient = undefined;
      this.FAction = undefined;
      this.FSuccessProc = undefined;
      this.FErrorProc = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.DoLoad = function (Response) {
      this.FClient.DoLoad(Response,this.FSuccessProc,this.FAsyncMode);
    };
    this.DoError = function (Response, RequestUrl, RequestId, ErrorMessage) {
      rtl._AddRef(Response);
      try {
        this.FClient.DoError(Response,RequestUrl,RequestId,ErrorMessage,this.FErrorProc,this.FAsyncMode);
      } finally {
        rtl._Release(Response);
      };
    };
    this.CreateHttpRequest = function () {
      var Result = null;
      var $ok = false;
      try {
        Result = rtl.setIntfL(Result,rtl.queryIntfT(pas["XData.Web.Request"].THttpRequest.$create("Create$1"),pas["XData.Web.Request"].IHttpRequest),true);
        $ok = true;
      } finally {
        if (!$ok) rtl._Release(Result);
      };
      return Result;
    };
    this.RequestUrl = function (RelativeUrl) {
      var Result = "";
      Result = this.FClient.RequestUrl(RelativeUrl);
      return Result;
    };
    this.BuildQueryString = function (Args, BindingModeFilter, Query) {
      var $Self = this;
      var Result = "";
      var QueryString = "";
      function WriteQueryParam(Name, Value) {
        if (QueryString !== "") QueryString = QueryString + "&";
        QueryString = QueryString + pas["Bcl.Utils"].TBclUtils.PercentEncode(Name) + "=" + pas["Bcl.Utils"].TBclUtils.PercentEncode(Value);
      };
      function WriteObjectToQuery(Obj, AType) {
        var I = 0;
        var Prop = null;
        var Value = undefined;
        if (Obj === null) return;
        for (var $l = 0, $end = AType.ScalarPropertyCount() - 1; $l <= $end; $l++) {
          I = $l;
          Prop = AType.GetScalarProperty(I);
          Value = Obj[Prop.FName];
          if (!pas.JS.isUndefined(Value)) WriteQueryParam(Prop.FName,pas["XData.Bind.Converter"].BindValueToUrl(Value,Prop.FName,null,Prop.GetUrlConverter()));
        };
      };
      var I = 0;
      var Param = null;
      QueryString = Query;
      for (var $l = 0, $end = this.FAction.FParameters.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (this.FAction.FParameters.GetItem$1(I).FBindingMode === BindingModeFilter) {
          Param = this.FAction.FParameters.GetItem$1(I);
          if (Param.FInput && (I <= rtl.length(Args))) {
            if (pas["XData.Model.Classes"].TXDataStructuredType.isPrototypeOf(Param.FType)) {
              WriteObjectToQuery(pas.JS.toObject(Args[I]),Param.FType);
            } else WriteQueryParam(Param.FName,pas["XData.Bind.Converter"].BindValueToUrl(Args[I],Param.FName,null,Param.GetUrlConverter()));
          };
        };
      };
      Result = QueryString;
      return Result;
    };
    this.GetPathParamValues = function (Args) {
      var Result = [];
      var I = 0;
      var Param = null;
      var ParamIndex = 0;
      ParamIndex = 0;
      Result = rtl.arraySetLength(Result,"",this.FAction.FParameters.GetCount());
      for (var $l = 0, $end = this.FAction.FParameters.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (this.FAction.FParameters.GetItem$1(I).FBindingMode === pas["XData.Model.Classes"].TBindingMode.FromPath) {
          Param = this.FAction.FParameters.GetItem$1(I);
          if (Param.FInput && (I <= rtl.length(Args))) {
            Result[ParamIndex] = pas["Bcl.Utils"].TBclUtils.PercentEncode(pas["XData.Bind.Converter"].BindValueToUrl(Args[I],Param.FName,null,Param.GetUrlConverter()));
            ParamIndex += 1;
          };
        };
      };
      Result = rtl.arrayCopy(0,Result,0,ParamIndex);
      return Result;
    };
    this.BuildUrlRoute = function (Args) {
      var $Self = this;
      var Result = "";
      var PathParamValues = [];
      var UsedParamValues = [];
      function AddRouteSegments(RouteInfo) {
        var I = 0;
        for (var $l = 0, $end = RouteInfo.GetSegmentCount() - 1; $l <= $end; $l++) {
          I = $l;
          if (RouteInfo.GetSegment(I).FIsParam) {
            if (RouteInfo.GetSegment(I).FParamIndex < rtl.length(PathParamValues)) {
              Result = Result + PathParamValues[RouteInfo.GetSegment(I).FParamIndex]}
             else throw $mod.EXDataWrongRouteParams.$create("Create$2",[$Self.FAction]);
            UsedParamValues[RouteInfo.GetSegment(I).FParamIndex] = true;
          } else Result = Result + RouteInfo.GetSegment(I).FValue;
          Result = Result + "/";
        };
      };
      var I = 0;
      PathParamValues = this.GetPathParamValues(Args);
      UsedParamValues = rtl.arraySetLength(UsedParamValues,false,rtl.length(PathParamValues));
      Result = "";
      AddRouteSegments(this.FAction.FRouteInfo);
      for (var $l = 0, $end = rtl.length(UsedParamValues) - 1; $l <= $end; $l++) {
        I = $l;
        if (!UsedParamValues[I]) Result = Result + PathParamValues[I] + "/";
      };
      return Result;
    };
    this.SetParamStreamBody = function (Req, Args, ArgIndex) {
      rtl._AddRef(Req);
      try {
        if (ArgIndex >= rtl.length(Args)) throw $mod.EXDataWrongParameterCount.$create("Create$2",[this.FAction,ArgIndex + 1]);
        Req.SetContent(Args[ArgIndex]);
      } finally {
        rtl._Release(Req);
      };
    };
    this.SetJsonParamsBody = function (Req, Args) {
      var I = 0;
      var Param = null;
      var ParamObj = null;
      var ParamValue = undefined;
      rtl._AddRef(Req);
      try {
        ParamObj = new Object();
        for (var $l = 0, $end = this.FAction.FParameters.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          if (this.FAction.FParameters.GetItem$1(I).FBindingMode === pas["XData.Model.Classes"].TBindingMode.FromBody) {
            Param = this.FAction.FParameters.GetItem$1(I);
            if (Param.FInput && (I < rtl.length(Args))) {
              ParamValue = Args[I];
              this.TransformParam(Param,{get: function () {
                  return ParamValue;
                }, set: function (v) {
                  ParamValue = v;
                }});
              ParamObj[Param.FName] = ParamValue;
            };
          };
        };
        Req.SetContent(JSON.stringify(ParamObj));
      } finally {
        rtl._Release(Req);
      };
    };
    this.SetJsonObjectBody = function (Req, Args) {
      var ParamIndex = 0;
      rtl._AddRef(Req);
      try {
        ParamIndex = this.FAction.GetBodyParam(0).Index();
        if (rtl.length(Args) <= ParamIndex) throw $mod.EXDataWrongParameterCount.$create("Create$2",[this.FAction,ParamIndex + 1]);
        Req.SetContent(JSON.stringify(Args[ParamIndex]));
      } finally {
        rtl._Release(Req);
      };
    };
    this.SetFormBody = function (Req, Args) {
      rtl._AddRef(Req);
      try {
        Req.SetContent(this.BuildQueryString(Args,pas["XData.Model.Classes"].TBindingMode.FromBody,""));
      } finally {
        rtl._Release(Req);
      };
    };
    this.TransformParam = function (Param, Value) {
    };
    this.Create$1 = function (AClient, AAction, ASuccessProc, AErrorProc, AAsyncMode) {
      this.FClient = AClient;
      this.FAction = AAction;
      this.FSuccessProc = ASuccessProc;
      this.FErrorProc = AErrorProc;
      this.FAsyncMode = AAsyncMode;
      return this;
    };
    this.Execute = function (Args, Query) {
      var $Self = this;
      var RequestUrl = "";
      function OnSuccess(Resp) {
        var ResultValue = undefined;
        var JsonResult = undefined;
        rtl._AddRef(Resp);
        try {
          if ((Resp.GetStatusCode() !== 200) && (Resp.GetStatusCode() !== 204) && (Resp.GetStatusCode() !== 404)) {
            $Self.DoError(Resp,RequestUrl,$Self.FRequestId,"");
            return;
          };
          if ($Self.FAction.FIsResultStream) {
            if (Resp.GetStatusCode() === 404) {
              $Self.DoError(Resp,RequestUrl,$Self.FRequestId,"")}
             else {
              ResultValue = Resp.GetContent();
              $Self.DoLoad($mod.TXDataClientResponse.$create("Create$1",[$Self.FClient,Resp,ResultValue,$mod.TXDataClientRequestType.rtRawInvoke,$Self.FRequestId,0]));
            };
          } else if ($Self.FAction.FIsResultCriteria) {
            $Self.DoError(Resp,RequestUrl,$Self.FRequestId,"TCriteria result yet not supported in TXDataClient");
          } else {
            if (Resp.GetStatusCode() !== 204) {
              JsonResult = JSON.parse(Resp.GetContentAsText());
            } else JsonResult = null;
            $Self.DoLoad($mod.TXDataClientResponse.$create("Create$1",[$Self.FClient,Resp,JsonResult,$mod.TXDataClientRequestType.rtRawInvoke,$Self.FRequestId,0]));
          };
        } finally {
          rtl._Release(Resp);
        };
      };
      function LocalError() {
        $Self.DoError(null,RequestUrl,$Self.FRequestId,"");
      };
      var Req = null;
      var QueryString = "";
      var SingleBodyParamIndex = 0;
      try {
        Req = rtl.setIntfL(Req,this.CreateHttpRequest(),true);
        QueryString = this.BuildQueryString(Args,pas["XData.Model.Classes"].TBindingMode.FromURI,Query);
        RequestUrl = this.BuildUrlRoute(Args);
        if (QueryString !== "") RequestUrl = RequestUrl + "?" + QueryString;
        RequestUrl = $Self.RequestUrl(RequestUrl);
        Req.SetUri(RequestUrl);
        Req.SetMethod(this.FAction.FHttpMethod);
        if (this.FAction.FIsResultStream) Req.SetResponseType("blob");
        if (this.FAction.FIsParamStream) {
          this.SetParamStreamBody(Req,Args,this.FAction.ParamStreamIndex())}
         else if (this.FAction.BodyParamCount() > 0) {
          if (this.FAction.IsFormContent()) {
            this.SetFormBody(Req,Args)}
           else {
            SingleBodyParamIndex = this.FAction.GetBodyParam(0).Index();
            if ((this.FAction.BodyParamCount() === 1) && (rtl.length(Args) > SingleBodyParamIndex) && rtl.isObject(Args[SingleBodyParamIndex])) {
              this.SetJsonObjectBody(Req,Args)}
             else this.SetJsonParamsBody(Req,Args);
          };
          if (this.FAction.FConsumes !== "") {
            Req.GetHeaders().SetValue("content-type",this.FAction.FConsumes)}
           else Req.GetHeaders().SetValue("content-type","application/json");
        };
        this.FClient.DoRequest($mod.TXDataClientRequest.$create("Create$1",[this.FClient,Req,$mod.TXDataClientRequestType.rtRawInvoke,this.FRequestId]));
        this.FClient.Send(Req,OnSuccess,LocalError);
      } finally {
        rtl._Release(Req);
      };
    };
  });
  rtl.createClass(this,"EXDataClientException",pas.SysUtils.Exception,function () {
  });
  rtl.createClass(this,"EXDataClientRequestException",this.EXDataClientException,function () {
    this.$init = function () {
      $mod.EXDataClientException.$init.call(this);
      this.FErrorResult = null;
    };
    this.$final = function () {
      this.FErrorResult = undefined;
      $mod.EXDataClientException.$final.call(this);
    };
    this.Create$2 = function (AClientError) {
      var Msg = "";
      this.FErrorResult = AClientError;
      Msg = "XData server request error." + pas.System.sLineBreak + "Uri: " + AClientError.FRequestUrl;
      Msg = Msg + pas.System.sLineBreak + "Status code: " + pas.SysUtils.IntToStr(AClientError.GetStatusCode());
      if (AClientError.FErrorCode !== "") Msg = Msg + pas.System.sLineBreak + "Error Code: " + AClientError.FErrorCode;
      if (AClientError.FErrorMessage !== "") Msg = Msg + pas.System.sLineBreak + AClientError.FErrorMessage;
      pas.SysUtils.Exception.Create$1.call(this,Msg);
      return this;
    };
  });
  rtl.createClass(this,"EXDataOperationRequestException",this.EXDataClientRequestException,function () {
  });
  rtl.createClass(this,"EXDataWrongParameterCount",this.EXDataClientException,function () {
    this.Create$2 = function (Action, PassedParameters) {
      pas.SysUtils.Exception.CreateFmt.call(this,'Incorrect parameter count for Operation "%s". Expected at least: %d, actual: %d',pas.System.VarRecs(18,Action.FOperationId,0,Action.FParameters.GetCount(),0,PassedParameters));
      return this;
    };
  });
  rtl.createClass(this,"EXDataWrongRouteParams",this.EXDataClientException,function () {
    this.Create$2 = function (Action) {
      pas.SysUtils.Exception.CreateFmt.call(this,'Invalid number of route params for Operation "%s". ' + "Route params: %d, Path params: %d",pas.System.VarRecs(18,Action.FOperationId,0,Action.FRouteInfo.FParamCount,0,Action.PathParamCount()));
      return this;
    };
  });
},["Bcl.Utils","XData.Bind.Converter","XData.Utils"]);
rtl.module("App.Types",["System","Bcl.Rtti.Common"],function () {
  "use strict";
  var $mod = this;
  this.$rtti.$RefToProcVar("TProc",{procsig: rtl.newTIProcSig([])});
  this.$rtti.$RefToProcVar("TSuccessProc",{procsig: rtl.newTIProcSig([])});
  this.$rtti.$RefToProcVar("TLogoutProc",{procsig: rtl.newTIProcSig([["AMessage",rtl.string]])});
  this.$rtti.$RefToProcVar("TUnauthorizedAccessProc",{procsig: rtl.newTIProcSig([["AMessage",rtl.string]])});
  this.$rtti.$RefToProcVar("TVersionCheckCallback",{procsig: rtl.newTIProcSig([["Success",rtl.boolean],["ErrorMessage",rtl.string]])});
  this.$rtti.$RefToProcVar("TListProc",{procsig: rtl.newTIProcSig([])});
  this.$rtti.$RefToProcVar("TSelectProc",{procsig: rtl.newTIProcSig([["AParam",rtl.string]])});
  this.$rtti.$RefToProcVar("TSelectProc2",{procsig: rtl.newTIProcSig([["AParam",rtl.string],["BParam",rtl.string]])});
  this.$rtti.$RefToProcVar("TSelectProc3",{procsig: rtl.newTIProcSig([["AParam",rtl.string],["BParam",rtl.string],["CParam",rtl.boolean]])});
  this.$rtti.$RefToProcVar("TSelectProc4",{procsig: rtl.newTIProcSig([["AParam",rtl.string],["BParam",rtl.string],["CParam",rtl.string],["DParam",rtl.boolean]])});
  this.$rtti.$RefToProcVar("TSearchProc",{procsig: rtl.newTIProcSig([["AParam",rtl.string],["BParam",rtl.string],["CParam",rtl.longint],["DParam",rtl.boolean]])});
  this.$rtti.$RefToProcVar("TReportProc",{procsig: rtl.newTIProcSig([["AParam",rtl.string]])});
});
rtl.module("App.Config",["System","JS","XData.Web.Connection","XData.Web.Request","XData.Web.Response"],function () {
  "use strict";
  var $mod = this;
  rtl.createClass(this,"TAppConfig",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FAuthUrl = "";
      this.FApiUrl = "";
      this.FAppUrl = "";
    };
    this.Create$1 = function () {
      this.FAuthUrl = "";
      this.FApiUrl = "";
      this.FAppUrl = "";
      return this;
    };
  });
  this.$rtti.$RefToProcVar("TConfigLoadedProc",{procsig: rtl.newTIProcSig([["Config",this.$rtti["TAppConfig"]]])});
  this.LoadConfig = function (LoadProc) {
    function OnSuccess(Response) {
      var Obj = null;
      var Config = null;
      rtl._AddRef(Response);
      try {
        Config = $mod.TAppConfig.$create("Create$1");
        try {
          if (Response.GetStatusCode() === 200) {
            Obj = JSON.parse(Response.GetContentAsText());
            if (pas.JS.ToString(Obj["AuthUrl"]) !== "") Config.FAuthUrl = pas.JS.ToString(Obj["AuthUrl"]);
            if (pas.JS.ToString(Obj["ApiUrl"]) !== "") Config.FApiUrl = pas.JS.ToString(Obj["ApiUrl"]);
          };
        } finally {
          LoadProc(Config);
          Config = rtl.freeLoc(Config);
        };
      } finally {
        rtl._Release(Response);
      };
    };
    function OnError() {
      var Config = null;
      Config = $mod.TAppConfig.$create("Create$1");
      try {
        LoadProc(Config);
      } finally {
        Config = rtl.freeLoc(Config);
      };
    };
    var Conn = null;
    var $ir = rtl.createIntfRefs();
    try {
      Conn = pas["XData.Web.Connection"].TXDataWebConnection.$create("Create$1",[null]);
      try {
        Conn.SendRequest($ir.ref(1,rtl.queryIntfT(pas["XData.Web.Request"].THttpRequest.$create("Create$2",["config/config.json"]),pas["XData.Web.Request"].IHttpRequest)),OnSuccess,OnError);
      } finally {
        Conn = rtl.freeLoc(Conn);
      };
    } finally {
      $ir.free();
    };
  };
});
rtl.module("WEBLib.StdCtrls",["System","Classes","WEBLib.Controls","SysUtils","Web","WEBLib.Graphics","Types","WEBLib.WebTools","WEBLib.Forms","WEBLib.Menus"],function () {
  "use strict";
  var $mod = this;
  this.TEditCharCase = {"0": "wecLowerCase", wecLowerCase: 0, "1": "wecNormal", wecNormal: 1, "2": "wecMixedCase", wecMixedCase: 2, "3": "wecUpperCase", wecUpperCase: 3};
  this.$rtti.$Enum("TEditCharCase",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TEditCharCase});
  this.TCheckBoxState = {"0": "cbChecked", cbChecked: 0, "1": "cbGrayed", cbGrayed: 1, "2": "cbUnchecked", cbUnchecked: 2};
  this.$rtti.$Enum("TCheckBoxState",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TCheckBoxState});
  this.TDateTimeKind = {"0": "dtkDate", dtkDate: 0, "1": "dtkTime", dtkTime: 1};
  this.$rtti.$Enum("TDateTimeKind",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TDateTimeKind});
  this.TEllipsisPosition = {"0": "epEndEllipsis", epEndEllipsis: 0, "1": "epNone", epNone: 1, "2": "epPathEllipsis", epPathEllipsis: 2, "3": "epWordEllipsis", epWordEllipsis: 3};
  this.$rtti.$Enum("TEllipsisPosition",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TEllipsisPosition});
  this.TTextLayout = {"0": "tlTop", tlTop: 0, "1": "tlCenter", tlCenter: 1, "2": "tlBottom", tlBottom: 2};
  this.$rtti.$Enum("TTextLayout",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTextLayout});
  this.TSysLinkType = {"0": "sltID", sltID: 0, "1": "sltURL", sltURL: 1};
  this.$rtti.$Enum("TSysLinkType",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TSysLinkType});
  this.TAutoCompletion = {"0": "acOff", acOff: 0, "1": "acHonorificPrefix", acHonorificPrefix: 1, "2": "acGivenName", acGivenName: 2, "3": "acAdditionalName", acAdditionalName: 3, "4": "acFamilyName", acFamilyName: 4, "5": "acHonorificSuffix", acHonorificSuffix: 5, "6": "acNickName", acNickName: 6, "7": "acEmail", acEmail: 7, "8": "acUserName", acUserName: 8, "9": "acNewPassword", acNewPassword: 9, "10": "acCurrentPassword", acCurrentPassword: 10, "11": "acOrganizationTitle", acOrganizationTitle: 11, "12": "acOrganization", acOrganization: 12, "13": "acStreetAddress", acStreetAddress: 13, "14": "acAddressLine1", acAddressLine1: 14, "15": "acAddressLine2", acAddressLine2: 15, "16": "acAddressLine3", acAddressLine3: 16, "17": "acAddressLevel1", acAddressLevel1: 17, "18": "acAddressLevel2", acAddressLevel2: 18, "19": "acAddressLevel3", acAddressLevel3: 19, "20": "acAddressLevel4", acAddressLevel4: 20, "21": "acCountry", acCountry: 21, "22": "acCountryName", acCountryName: 22, "23": "acPostalCode", acPostalCode: 23, "24": "acCCName", acCCName: 24, "25": "acCCGivenName", acCCGivenName: 25, "26": "acCCAdditionalName", acCCAdditionalName: 26, "27": "acCCFamilyName", acCCFamilyName: 27, "28": "acCCNumber", acCCNumber: 28, "29": "acExpiry", acExpiry: 29, "30": "acExpiryMonth", acExpiryMonth: 30, "31": "acExpiryYear", acExpiryYear: 31, "32": "acCSC", acCSC: 32, "33": "acType", acType: 33, "34": "acTransactionCurrency", acTransactionCurrency: 34, "35": "acTransactionAmount", acTransactionAmount: 35, "36": "acLanguage", acLanguage: 36, "37": "acBirthday", acBirthday: 37, "38": "acBirthdayDay", acBirthdayDay: 38, "39": "acBirthDayMonth", acBirthDayMonth: 39, "40": "acBirthDayYear", acBirthDayYear: 40, "41": "acSex", acSex: 41, "42": "acTelephone", acTelephone: 42, "43": "acTelephoneCountryCode", acTelephoneCountryCode: 43, "44": "acTelephoneNational", acTelephoneNational: 44, "45": "acTelephoneAreaCode", acTelephoneAreaCode: 45, "46": "acTelephoneLocal", acTelephoneLocal: 46, "47": "acTelephoneExtension", acTelephoneExtension: 47, "48": "acIMPP", acIMPP: 48, "49": "acURL", acURL: 49, "50": "acPhoto", acPhoto: 50, "51": "acNone", acNone: 51, "52": "acNope", acNope: 52};
  this.$rtti.$Enum("TAutoCompletion",{minvalue: 0, maxvalue: 52, ordtype: 1, enumtype: this.TAutoCompletion});
  this.TEditType = {"0": "weString", weString: 0, "1": "weFloat", weFloat: 1, "2": "weHex", weHex: 2, "3": "weNumeric", weNumeric: 3, "4": "weSignedFloat", weSignedFloat: 4, "5": "weSignedNumeric", weSignedNumeric: 5, "6": "weSearch", weSearch: 6};
  this.$rtti.$Enum("TEditType",{minvalue: 0, maxvalue: 6, ordtype: 1, enumtype: this.TEditType});
  this.THTMLType = {"0": "tLABELTAG", tLABELTAG: 0, "1": "tSPAN", tSPAN: 1, "2": "tDIV", tDIV: 2, "3": "tH1", tH1: 3, "4": "tH2", tH2: 4, "5": "tH3", tH3: 5, "6": "tH4", tH4: 6, "7": "tH5", tH5: 7, "8": "tH6", tH6: 8, "9": "tP", tP: 9};
  this.$rtti.$Enum("THTMLType",{minvalue: 0, maxvalue: 9, ordtype: 1, enumtype: this.THTMLType});
  this.$rtti.$MethodVar("TLinkClickEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Link",rtl.string],["LinkType",this.$rtti["TSysLinkType"]]]), methodkind: 0});
  rtl.createClass(this,"TCustomLabel",pas["WEBLib.Menus"].TWebCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Menus"].TWebCustomControl.$init.call(this);
      this.FContent = null;
      this.FAutoSize = false;
      this.FEllipsisPosition = 0;
      this.FWordWrap = false;
      this.FAlignment = 0;
      this.FLayout = 0;
      this.FTransparent = false;
      this.FHTMLType = 0;
      this.FFocusControl = null;
      this.FShowAccelChar = false;
      this.FColor$1 = 0;
      this.FHasAccel = false;
      this.FHasHTML = false;
      this.FElementLabelClassName = "";
      this.FOrigWidth = 0;
      this.FOldWidth = 0;
      this.FOldHeight = 0;
      this.FHTML = "";
    };
    this.$final = function () {
      this.FContent = undefined;
      this.FFocusControl = undefined;
      pas["WEBLib.Menus"].TWebCustomControl.$final.call(this);
    };
    this.SetLayout = function (Value) {
      if (this.FLayout !== Value) {
        this.FLayout = Value;
        this.UpdateElementVisual();
      };
    };
    this.SetAlignment = function (Value) {
      if (this.FAlignment !== Value) {
        this.FAlignment = Value;
        this.UpdateElementVisual();
      };
    };
    this.GetContentHandle = function () {
      var Result = null;
      Result = this.FContent;
      return Result;
    };
    this.SetTransparent = function (Value) {
      if (this.FTransparent !== Value) {
        this.FTransparent = Value;
        this.UpdateElementVisual();
      };
    };
    this.SetHTMLType = function (Value) {
      var el = null;
      if (this.FHTMLType !== Value) {
        this.FHTMLType = Value;
        if (this.FHTMLType in rtl.createSet(null,$mod.THTMLType.tH1,$mod.THTMLType.tH6)) this.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
        if ((this.GetElementHandle() != null) && (this.FContent != null)) {
          el = this.GetElementHandle().firstChild;
          if ((el != null) && (el.getAttribute("data-lbl") === "lbl")) {
            this.GetElementHandle().removeChild(this.FContent);
            this.FContent = this.CreateLabelElement();
            this.GetElementHandle().appendChild(this.FContent);
            this.UpdateElement();
          };
        };
      };
    };
    this.SetColorEx = function (Value) {
      this.FColor$1 = Value;
      if ((pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) && (this.FColor$1 !== 16777215)) this.SetTransparent(false);
      this.UpdateElement();
    };
    this.SetElementLabelClassName = function (Value) {
      if (this.FElementLabelClassName !== Value) {
        this.FElementLabelClassName = Value;
        this.UpdateElement();
      };
    };
    this.SetHTML = function (Value) {
      if (this.FHTML !== Value) {
        this.FHTML = Value;
        this.UpdateElementData();
      };
    };
    this.SetWidth = function (AValue) {
      if ((AValue !== -1) && (pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) this.FOrigWidth = AValue;
      pas["WEBLib.Controls"].TControl.SetWidth.apply(this,arguments);
    };
    this.CreateElement = function () {
      var Result = null;
      Result = document.createElement("DIV");
      this.FContent = this.CreateLabelElement();
      Result.appendChild(this.FContent);
      return Result;
    };
    this.CreateLabelElement = function () {
      var Result = null;
      Result = null;
      var $tmp = this.FHTMLType;
      if ($tmp === $mod.THTMLType.tSPAN) {
        Result = document.createElement("SPAN")}
       else if ($tmp === $mod.THTMLType.tDIV) {
        Result = document.createElement("DIV")}
       else if ($tmp === $mod.THTMLType.tH1) {
        Result = document.createElement("H1")}
       else if ($tmp === $mod.THTMLType.tH2) {
        Result = document.createElement("H2")}
       else if ($tmp === $mod.THTMLType.tH3) {
        Result = document.createElement("H3")}
       else if ($tmp === $mod.THTMLType.tH4) {
        Result = document.createElement("H4")}
       else if ($tmp === $mod.THTMLType.tH5) {
        Result = document.createElement("H5")}
       else if ($tmp === $mod.THTMLType.tH6) {
        Result = document.createElement("H6")}
       else if ($tmp === $mod.THTMLType.tLABELTAG) {
        Result = document.createElement("LABEL")}
       else if ($tmp === $mod.THTMLType.tP) Result = document.createElement("P");
      Result.setAttribute("data-lbl","lbl");
      return Result;
    };
    this.GetDisplayText = function () {
      var Result = "";
      Result = this.FCaption;
      return Result;
    };
    this.CanShowFocus = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    this.SetParent = function (AValue) {
      pas["WEBLib.Controls"].TControl.SetParent.apply(this,arguments);
      if (this.FAutoSize && (this.FAlignment !== pas.Classes.TAlignment.taLeftJustify) && (this.FOrigWidth !== -1)) {
        this.SetLeft((this.GetLeft() + this.FOrigWidth) - this.GetWidth());
        this.FOrigWidth = -1;
      };
    };
    this.BindElement = function () {
      this.FContent = this.GetContainer().firstElementChild;
    };
    this.Loaded = function () {
      pas["WEBLib.Controls"].TCustomControl.Loaded.call(this);
      if (this.FShowAccelChar && (this.FFocusControl != null)) this.UpdateElementData();
    };
    this.UpdateAutoSize = function () {
      if (this.FAutoSize && (this.FAlign === pas["WEBLib.Controls"].TAlign.alNone)) {
        if ((this.GetElementHandle() != null) && pas["WEBLib.WebTools"].ElementVisible(this.GetElementHandle())) {
          this.SetWidth(-1);
          this.SetHeight(-1);
        };
        this.FEllipsisPosition = $mod.TEllipsisPosition.epNone;
      };
    };
    this.UpdateElementData = function () {
      var lTxt = "";
      var acc = "";
      var ml = false;
      var contentelement = null;
      pas["WEBLib.Controls"].TControl.UpdateElementData.call(this);
      acc = "";
      lTxt = this.GetDisplayText();
      if (this.FShowAccelChar && (pas.System.Pos("&",lTxt) > 0)) {
        lTxt = pas["WEBLib.WebTools"].ProcessAccelerator(lTxt,{get: function () {
            return acc;
          }, set: function (v) {
            acc = v;
          }})}
       else {
        if (this.FHTML === "") {
          lTxt = pas["WEBLib.WebTools"].HTMLToString(lTxt)}
         else lTxt = this.FHTML;
      };
      ml = false;
      if (pas.System.Pos("\r",lTxt) > 0) {
        ml = true;
        if (pas.System.Pos("\n",lTxt) > 0) lTxt = pas.SysUtils.StringReplace(lTxt,"\n","",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll,pas.SysUtils.TStringReplaceFlag.rfIgnoreCase));
        lTxt = pas.SysUtils.StringReplace(lTxt,"\r","<BR>",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll,pas.SysUtils.TStringReplaceFlag.rfIgnoreCase));
      } else if (pas.System.Pos("\n",lTxt) > 0) {
        ml = true;
        lTxt = pas.SysUtils.StringReplace(lTxt,"\n","<BR>",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll,pas.SysUtils.TStringReplaceFlag.rfIgnoreCase));
      };
      if (this.GetIsLinked() && (lTxt === "") && (pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) return;
      if (this.GetContentHandle() != null) {
        if (this.GetIsLinked()) {
          contentelement = this.GetContentHandle();
          if (this.GetID() !== "") {
            contentelement = document.getElementById(this.GetID());
          };
          if (contentelement != null) {
            if (pas.System.Assigned(this.GetContentHandle().nodeValue)) {
              contentelement.nodeValue = lTxt}
             else if (contentelement.childElementCount === 0) contentelement.innerHTML = lTxt;
          };
        } else {
          if ((this.GetContentHandle().childElementCount > 0) && pas.System.Assigned(this.GetContentHandle().nodeValue) && !this.FHasAccel && !this.FHasHTML && !ml) {
            this.GetContentHandle().nodeValue = lTxt;
          } else {
            this.GetContentHandle().innerHTML = lTxt;
          };
        };
      } else this.GetElementHandle().innerHTML = lTxt;
      this.FHasHTML = pas.System.Pos("</",lTxt) > 0;
      this.FHasAccel = acc !== "";
      if ((acc !== "") && (this.FFocusControl != null)) {
        this.GetContentHandle().setAttribute("accesskey",acc);
        this.GetContentHandle().setAttribute("for",this.FFocusControl.GetID());
      };
    };
    this.UpdateElementVisual = function () {
      var ow = 0;
      var oh = 0;
      pas["WEBLib.Controls"].TCustomControl.UpdateElementVisual.call(this);
      if (this.IsUpdating()) return;
      if (this.GetElementHandle() != null) {
        oh = Math.round(this.GetElementHandle().offsetHeight);
        ow = Math.round(this.GetElementHandle().offsetWidth);
        if (oh > 0) this.FOldHeight = oh;
        if (ow > 0) this.FOldWidth = ow;
        if (this.FVisible && (!this.FAutoSize || (this.FAlign !== pas["WEBLib.Controls"].TAlign.alNone)) && ((this.FAlignment !== pas.Classes.TAlignment.taLeftJustify) || (this.FLayout !== $mod.TTextLayout.tlTop))) this.GetElementHandle().style.setProperty("display","table");
        this.GetElementHandle().setAttribute("zindex","1");
        if (this.FAutoSize && (this.FAlign === pas["WEBLib.Controls"].TAlign.alNone) && !(pas.Classes.TComponentStateItem.csDesigning in this.FComponentState)) {
          this.GetElementHandle().style.setProperty("overflow","")}
         else this.GetElementHandle().style.setProperty("overflow","hidden");
      };
      if (this.GetContentHandle() != null) {
        var $tmp = this.FLayout;
        if ($tmp === $mod.TTextLayout.tlTop) {
          this.GetContentHandle().style.setProperty("vertical-align","top")}
         else if ($tmp === $mod.TTextLayout.tlCenter) {
          this.GetContentHandle().style.setProperty("vertical-align","middle")}
         else if ($tmp === $mod.TTextLayout.tlBottom) this.GetContentHandle().style.setProperty("vertical-align","bottom");
        var $tmp1 = this.FAlignment;
        if ($tmp1 === pas.Classes.TAlignment.taLeftJustify) {
          this.GetContentHandle().style.removeProperty("text-align")}
         else if ($tmp1 === pas.Classes.TAlignment.taCenter) {
          this.GetContentHandle().style.setProperty("text-align","center")}
         else if ($tmp1 === pas.Classes.TAlignment.taRightJustify) this.GetContentHandle().style.setProperty("text-align","right");
        pas["WEBLib.Controls"].SetHTMLElementColor(this.GetElementHandle(),this.FColor$1,this.FTransparent || (this.FColor$1 === -1) || (this.FColor$1 === 16711422));
        pas["WEBLib.Controls"].SetHTMLElementColor(this.GetContentHandle(),this.FColor$1,this.FTransparent || (this.FColor$1 === -1) || (this.FColor$1 === 16711422));
        this.GetContentHandle().style.setProperty("display","table-cell");
        if (this.FElementClassName === "") {
          if (this.FEnabled && (this.FElementFont === pas["WEBLib.Controls"].TElementFont.efProperty) && !this.GetIsLinked()) {
            this.GetContentHandle().style.setProperty("color",pas["WEBLib.Graphics"].ColorToHTML(this.FFont.FColor))}
           else this.GetContentHandle().style.removeProperty("color");
          this.SetElementPointer(this.GetContentHandle(),this.FCursor);
          pas["WEBLib.Controls"].SetHTMLElementFont(this.GetContentHandle(),this.FFont,!((this.FElementFont === pas["WEBLib.Controls"].TElementFont.efProperty) && !this.GetIsLinked()));
        } else {
          this.GetContentHandle().style.removeProperty("color");
          pas["WEBLib.Controls"].SetHTMLElementFont(this.GetContentHandle(),this.FFont,true);
        };
        if (this.FElementLabelClassName !== "") {
          this.GetContentHandle().setAttribute("class",this.FElementLabelClassName)}
         else this.GetContentHandle().removeAttribute("class");
        if ((this.FElementPosition === pas["WEBLib.Controls"].TElementPosition.epAbsolute) || (this.FWidthStyle === pas["WEBLib.Controls"].TSizeStyle.ssAbsolute)) {
          if (this.FEllipsisPosition === $mod.TEllipsisPosition.epNone) {
            this.GetContentHandle().style.setProperty("text-overflow","clip")}
           else this.GetContentHandle().style.setProperty("text-overflow","ellipsis");
        } else this.GetContentHandle().style.removeProperty("text-overflow");
        if (this.FWordWrap) {
          this.GetContentHandle().style.setProperty("white-space","normal")}
         else this.GetContentHandle().style.setProperty("white-space","nowrap");
        this.GetElementHandle().style.setProperty("user-select","");
        if (this.FCursor === 0) this.GetElementHandle().style.setProperty("cursor","");
        if (this.FAutoSize && (this.FAlign === pas["WEBLib.Controls"].TAlign.alNone) && !(pas.Classes.TComponentStateItem.csDesigning in this.FComponentState)) {
          this.GetElementHandle().style.removeProperty("width");
          this.GetElementHandle().style.removeProperty("height");
        };
      };
    };
    this.UpdateElementSize = function () {
      pas["WEBLib.Controls"].TControl.UpdateElementSize.call(this);
      if (this.FAutoSize && (this.FAlign === pas["WEBLib.Controls"].TAlign.alNone) && (this.GetElementHandle() != null)) {
        if (!(pas.Classes.TComponentStateItem.csDesigning in this.FComponentState)) {
          this.GetElementHandle().style.removeProperty("width");
          this.GetElementHandle().style.removeProperty("height");
        };
      };
      if ((this.GetContentHandle() != null) && (this.FAlign in rtl.createSet(pas["WEBLib.Controls"].TAlign.alLeft,pas["WEBLib.Controls"].TAlign.alRight,pas["WEBLib.Controls"].TAlign.alClient)) && !this.FAutoSize && (this.FLayout in rtl.createSet($mod.TTextLayout.tlCenter,$mod.TTextLayout.tlBottom))) {
        this.GetContentHandle().style.setProperty("height",pas.SysUtils.TIntegerHelper.ToString$1.call({p: this.GetHeight(), get: function () {
            return this.p;
          }, set: function (v) {
            this.p = v;
          }}) + "px");
      };
    };
    this.SetAutoSize = function (AValue) {
      if (this.FAutoSize !== AValue) {
        this.FAutoSize = AValue;
        this.UpdateAutoSize();
        this.UpdateElement();
      };
    };
    this.SetCaption = function (AValue) {
      var dw = 0;
      if (this.FCaption !== AValue) {
        dw = this.GetWidth();
        pas["WEBLib.Controls"].TCustomControl.SetCaption.call(this,AValue);
        this.UpdateAutoSize();
        this.UpdateElement();
        dw = dw - this.GetWidth();
        if (this.FAutoSize && (this.FAlignment !== pas.Classes.TAlignment.taLeftJustify) && (dw !== 0) && (pas["WEBLib.Controls"].TAnchorKind.akRight in this.FAnchors) && !this.IsUpdating()) this.SetLeft(this.GetLeft() + dw);
      };
    };
    this.SetControlCursor = function (Value) {
      pas["WEBLib.Controls"].TControl.SetControlCursor.apply(this,arguments);
      if ((this.FElementClassName === "") && (this.GetContentHandle() != null)) this.SetElementPointer(this.GetContentHandle(),this.FCursor);
    };
    this.SetEllipsisPosition = function (AValue) {
      if (this.FEllipsisPosition !== AValue) {
        this.FEllipsisPosition = AValue;
        if (this.FEllipsisPosition !== $mod.TEllipsisPosition.epNone) this.FAutoSize = false;
        this.UpdateElement();
      };
    };
    this.GetWidth = function () {
      var Result = 0;
      if (this.FAutoSize && (this.GetElementHandle() != null) && (this.FParent != null)) {
        Result = Math.round(this.GetElementHandle().offsetWidth);
        if (Result === 0) Result = pas["WEBLib.Controls"].TControl.GetWidth.call(this);
        if ((Result === 0) && (this.FCaption !== "") && (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState)) Result = this.FOldWidth;
      } else Result = pas["WEBLib.Controls"].TControl.GetWidth.call(this);
      return Result;
    };
    this.GetHeight = function () {
      var Result = 0;
      if (this.FAutoSize && (this.GetElementHandle() != null) && (this.FParent != null)) {
        Result = Math.round(this.GetElementHandle().offsetHeight);
        if (Result === 0) Result = pas["WEBLib.Controls"].TControl.GetHeight.call(this);
        if ((Result === 0) && (this.FCaption !== "") && (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState)) Result = this.FOldHeight;
      } else Result = pas["WEBLib.Controls"].TControl.GetHeight.call(this);
      return Result;
    };
    this.InitCSSLibrary = function (ALibrary) {
      if (ALibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap) {
        this.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
        this.SetHeightStyle(pas["WEBLib.Controls"].TSizeStyle.ssAuto);
      };
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.FAutoSize = true;
      this.FLayout = $mod.TTextLayout.tlTop;
      this.FEllipsisPosition = $mod.TEllipsisPosition.epNone;
      this.FColor$1 = 16777215;
      this.FTransparent = true;
      this.FAlignment = pas.Classes.TAlignment.taLeftJustify;
      this.SetTabStop(false);
      this.FShowAccelChar = true;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TLabel",this.TCustomLabel,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("Alignment",2,pas.Classes.$rtti["TAlignment"],"FAlignment","SetAlignment",4,{Default: pas.Classes.TAlignment.taLeftJustify});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("AutoSize",2,rtl.boolean,"FAutoSize","SetAutoSize",4,{Default: true});
    $r.addProperty("Caption",2,rtl.string,"FCaption","SetCaption");
    $r.addProperty("ChildOrder",2,rtl.longint,"FChildOrder","SetChildOrderEx",4,{Default: 0});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor$1","SetColorEx",4,{Default: 16777215});
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("EllipsisPosition",2,$mod.$rtti["TEllipsisPosition"],"FEllipsisPosition","SetEllipsisPosition",4,{Default: $mod.TEllipsisPosition.epNone});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementLabelClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementLabelClassName","SetElementLabelClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("FocusControl",0,pas["WEBLib.Controls"].$rtti["TWinControl"],"FFocusControl","FFocusControl");
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Hint",2,rtl.string,"FHint","SetHint");
    $r.addProperty("HTML",2,rtl.string,"FHTML","SetHTML");
    $r.addProperty("HTMLType",2,$mod.$rtti["THTMLType"],"FHTMLType","SetHTMLType",4,{Default: $mod.THTMLType.tLABELTAG});
    $r.addProperty("Layout",2,$mod.$rtti["TTextLayout"],"FLayout","SetLayout",4,{Default: $mod.TTextLayout.tlTop});
    $r.addProperty("Left",3,rtl.longint,"GetLeft","SetLeft");
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",4,{Default: true});
    $r.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti["TPopupMenu"],"FPopupMenu","FPopupMenu");
    $r.addProperty("ShowAccelChar",0,rtl.boolean,"FShowAccelChar","FShowAccelChar",4,{Default: true});
    $r.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",4,{Default: false});
    $r.addProperty("TextDirection",0,pas["WEBLib.Controls"].$rtti["TTextDirection"],"FTextDirection","FTextDirection",4,{Default: pas["WEBLib.Controls"].TTextDirection.tdDefault});
    $r.addProperty("Top",3,rtl.longint,"GetTop","SetTop");
    $r.addProperty("Transparent",2,rtl.boolean,"FTransparent","SetTransparent",4,{Default: true});
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("WordWrap",0,rtl.boolean,"FWordWrap","FWordWrap",4,{Default: false});
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnTouchStart",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchStart","FOnTouchStart");
    $r.addProperty("OnTouchEnd",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchEnd","FOnTouchEnd");
    $r.addProperty("OnTouchMove",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchMove","FOnTouchMove");
    $r.addProperty("OnTouchCancel",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchCancel","FOnTouchCancel");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
  });
  rtl.createClass(this,"TWebLabel",this.TLabel,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TCustomInput",pas["WEBLib.Menus"].TWebCustomControl,function () {
    this.IsInputControl = function () {
      var Result = false;
      Result = true;
      return Result;
    };
    this.GetInputType = function () {
      var Result = "";
      Result = "EDIT";
      return Result;
    };
    this.CreateElement = function () {
      var Result = null;
      Result = document.createElement("INPUT");
      Result.setAttribute("type",this.GetInputType());
      return Result;
    };
    this.UpdateElementVisual = function () {
      pas["WEBLib.Controls"].TCustomControl.UpdateElementVisual.call(this);
      if ((this.GetContainer() != null) && !this.GetIsLinked()) {
        this.GetContainer().style.setProperty("-moz-box-sizing","border-box");
        this.GetContainer().style.setProperty("-webkit-box-sizing","border-box");
        this.GetContainer().style.setProperty("box-sizing","border-box");
      };
    };
    this.LoadState = function (AState) {
      this.GetElementHandle().value = AState;
    };
    this.SaveState = function () {
      var Result = "";
      Result = this.GetElementHandle().value;
      return Result;
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.SetShowFocus(true);
      this.FNoUserSelect = false;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TCustomEdit",this.TCustomInput,function () {
    this.$init = function () {
      $mod.TCustomInput.$init.call(this);
      this.FCharCase = 0;
      this.FMaxLength = 0;
      this.FReadOnly = false;
      this.FText = "";
      this.FTextHint = "";
      this.FSelStart = 0;
      this.FAlignment = 0;
      this.FHideSelection = false;
      this.FPasswordChar = "\x00";
      this.FOnChange = null;
      this.FAutoSize = false;
      this.FAutoSelect = false;
      this.FSelLength = 0;
      this.FNumeric = false;
      this.FAutoCompletion = 0;
      this.FEditType = 0;
      this.FRequired = false;
      this.FAutoFocus = false;
      this.FPattern = "";
      this.FHandlePastePtr = null;
      this.FHandleCutPtr = null;
      this.FHandleChangePtr = null;
      this.FHandleInvalidPtr = null;
      this.FHandleSearchPtr = null;
      this.FSpellCheck = false;
      this.FRequiredText = "";
      this.FOnSearch = null;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      this.FOnSearch = undefined;
      $mod.TCustomInput.$final.call(this);
    };
    this.SetAlignment = function (Value) {
      this.FAlignment = Value;
      this.UpdateElement();
    };
    this.SetHideSelection = function (Value) {
      if (this.FHideSelection !== Value) {
        this.FHideSelection = Value;
        this.UpdateElement();
      };
    };
    this.SetAutoSelect = function (Value) {
      if (this.FAutoSelect !== Value) {
        this.FAutoSelect = Value;
        this.UpdateElement();
      };
    };
    this.SetAutoSize = function (Value) {
      if (this.FAutoSize !== Value) {
        this.FAutoSize = Value;
        this.UpdateElement();
      };
    };
    this.SetSelLength = function (Value) {
      this.FSelLength = Value;
      this.UpdateElement();
    };
    this.SetSelStart = function (Value) {
      this.FSelStart = Value;
      this.UpdateElement();
    };
    this.SetPasswordChar = function (Value) {
      this.FPasswordChar = Value;
      this.UpdateElement();
    };
    this.SetNumeric = function (Value) {
      this.FNumeric = Value;
      this.UpdateElement();
    };
    this.SetAutoCompletion = function (Value) {
      if (this.FAutoCompletion !== Value) {
        this.FAutoCompletion = Value;
        this.UpdateElement();
      };
    };
    this.SetAutoFocus = function (Value) {
      if (this.FAutoFocus !== Value) {
        this.FAutoFocus = Value;
        this.UpdateElement();
      };
    };
    this.SetRequired = function (Value) {
      if (this.FRequired !== Value) {
        this.FRequired = Value;
        this.UpdateElement();
      };
    };
    this.SetPattern = function (Value) {
      if (this.FPattern !== Value) {
        this.FPattern = Value;
        this.UpdateElement();
      };
    };
    this.GetSelLength = function () {
      var Result = 0;
      Result = -1;
      if (this.GetElementInputHandle() != null) Result = this.GetElementInputHandle().selectionEnd - this.GetElementInputHandle().selectionStart;
      return Result;
    };
    this.GetSelStart = function () {
      var Result = 0;
      Result = -1;
      if (this.GetElementInputHandle() != null) Result = this.GetElementInputHandle().selectionStart;
      return Result;
    };
    this.SetEditType = function (Value) {
      if (this.FEditType !== Value) {
        this.FEditType = Value;
        this.UpdateElement();
      };
    };
    this.GetSelText = function () {
      var Result = "";
      Result = pas.System.Copy(this.GetText(),this.GetSelStart() + 1,this.GetSelLength());
      return Result;
    };
    this.SetSpellCheck = function (Value) {
      if (this.FSpellCheck !== Value) {
        this.FSpellCheck = Value;
        this.UpdateElement();
      };
    };
    this.GetElementInputHandle = function () {
      var Result = null;
      Result = this.GetContainer();
      return Result;
    };
    this.DoHandlePaste = function (Event) {
      var Result = false;
      var s = "";
      var clp = false;
      clp = false;
      var clipboardData = Event.clipboardData || window.clipboardData;
      if (clipboardData) {
      s = clipboardData.getData('Text');
      clp = true;
      };
      if (clp && (!this.CanPaste(s) || !this.Validate(s))) {
        Event.preventDefault();
        Event.stopPropagation();
      };
      Result = false;
      return Result;
    };
    this.DoHandleCut = function (Event) {
      var Result = false;
      if (!this.CanCut()) {
        Event.preventDefault();
        Event.stopPropagation();
      };
      Result = false;
      return Result;
    };
    this.DoHandleChange = function (Event) {
      var Result = false;
      this.Change();
      Result = true;
      if (this.FRequiredText !== "") {
        this.GetElementInputHandle().setCustomValidity("");
      };
      return Result;
    };
    this.DoHandleInvalid = function (Event) {
      var Result = false;
      this.GetElementInputHandle().setCustomValidity(this.FRequiredText);
      Result = true;
      return Result;
    };
    this.DoHandleSearch = function (Event) {
      var Result = false;
      Result = true;
      if (this.FOnSearch != null) this.FOnSearch(this);
      return Result;
    };
    this.IsCustomEditor = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    this.KeyPress = function (Key) {
      var isValid = false;
      pas["WEBLib.Controls"].TControl.KeyPress.call(this,Key);
      isValid = true;
      var $tmp = this.FEditType;
      if ($tmp === $mod.TEditType.weNumeric) {
        isValid = Key.get().charCodeAt() in rtl.createSet(null,48,57)}
       else if ($tmp === $mod.TEditType.weSignedNumeric) {
        isValid = Key.get().charCodeAt() in rtl.createSet(null,48,57,43,45)}
       else if ($tmp === $mod.TEditType.weFloat) {
        isValid = Key.get().charCodeAt() in rtl.createSet(null,48,57,44,46)}
       else if ($tmp === $mod.TEditType.weSignedFloat) {
        isValid = Key.get().charCodeAt() in rtl.createSet(null,48,57,44,46,43,45)}
       else if ($tmp === $mod.TEditType.weHex) isValid = Key.get().charCodeAt() in rtl.createSet(null,48,57,null,65,70);
      if (!isValid) Key.set("\x00");
    };
    this.DoEnter = function () {
      var el = null;
      pas["WEBLib.Controls"].TControl.DoEnter.call(this);
      if (this.FAutoSelect && (this.GetElementInputHandle() != null)) {
        el = this.GetElementInputHandle();
        el.select();
      };
    };
    this.GetInputType = function () {
      var Result = "";
      if (this.FPasswordChar !== "\x00") {
        Result = "PASSWORD"}
       else if (this.FNumeric) {
        Result = "NUMBER"}
       else if (this.FEditType in rtl.createSet($mod.TEditType.weFloat,$mod.TEditType.weNumeric)) {
        Result = "TEL"}
       else if (this.FEditType === $mod.TEditType.weSearch) {
        Result = "SEARCH"}
       else Result = "TEXT";
      return Result;
    };
    this.PersistinHTML = function () {
      this.GetElementInputHandle().setAttribute("value",this.GetText());
    };
    this.GetText = function () {
      var Result = "";
      Result = this.FText;
      if (this.GetElementInputHandle() != null) Result = this.GetElementInputHandle().value;
      if (this.FCharCase === $mod.TEditCharCase.wecUpperCase) Result = pas.SysUtils.UpperCase(Result);
      if (this.FCharCase === $mod.TEditCharCase.wecLowerCase) Result = pas.SysUtils.LowerCase(Result);
      return Result;
    };
    this.GetDisplayText = function () {
      var Result = "";
      Result = this.FText;
      return Result;
    };
    this.IsReadOnly = function () {
      var Result = false;
      Result = this.FReadOnly;
      return Result;
    };
    this.Validate = function (AValue) {
      var Result = false;
      var i = 0;
      var Key = "\x00";
      var isvalid = false;
      Result = true;
      for (var $l = 1, $end = AValue.length; $l <= $end; $l++) {
        i = $l;
        Key = AValue.charAt(i - 1);
        isvalid = true;
        var $tmp = this.FEditType;
        if ($tmp === $mod.TEditType.weNumeric) {
          isvalid = Key.charCodeAt() in rtl.createSet(null,48,57)}
         else if ($tmp === $mod.TEditType.weSignedNumeric) {
          isvalid = Key.charCodeAt() in rtl.createSet(null,48,57,43,45)}
         else if ($tmp === $mod.TEditType.weFloat) {
          isvalid = Key.charCodeAt() in rtl.createSet(null,48,57,44,46)}
         else if ($tmp === $mod.TEditType.weSignedFloat) {
          isvalid = Key.charCodeAt() in rtl.createSet(null,48,57,44,46,43,45)}
         else if ($tmp === $mod.TEditType.weHex) isvalid = Key.charCodeAt() in rtl.createSet(null,48,57,null,65,70);
        if (!isvalid) {
          Result = false;
          break;
        };
      };
      return Result;
    };
    this.ClearMethodPointers = function () {
      pas["WEBLib.Controls"].TControl.ClearMethodPointers.call(this);
      this.FHandlePastePtr = null;
      this.FHandleCutPtr = null;
      this.FHandleChangePtr = null;
      this.FHandleInvalidPtr = null;
      this.FHandleSearchPtr = null;
    };
    this.GetMethodPointers = function () {
      pas["WEBLib.Controls"].TControl.GetMethodPointers.call(this);
      this.FHandlePastePtr = rtl.createCallback(this,"DoHandlePaste");
      this.FHandleCutPtr = rtl.createCallback(this,"DoHandleCut");
      this.FHandleChangePtr = rtl.createCallback(this,"DoHandleChange");
      this.FHandleInvalidPtr = rtl.createCallback(this,"DoHandleInvalid");
      this.FHandleSearchPtr = rtl.createCallback(this,"DoHandleSearch");
    };
    this.BindEvents = function () {
      pas["WEBLib.Controls"].TCustomControl.BindEvents.call(this);
      if (this.GetElementInputHandle() != null) {
        this.GetElementInputHandle().addEventListener("input",this.FHandleChangePtr);
        this.GetElementInputHandle().addEventListener("paste",this.FHandlePastePtr);
        this.GetElementInputHandle().addEventListener("cut",this.FHandleCutPtr);
        this.GetElementInputHandle().addEventListener("invalid",this.FHandleInvalidPtr);
        this.GetElementInputHandle().addEventListener("search",this.FHandleSearchPtr);
      };
    };
    this.UnbindEvents = function () {
      pas["WEBLib.Controls"].TControl.UnbindEvents.call(this);
      if (this.GetElementInputHandle() != null) {
        this.GetElementInputHandle().removeEventListener("input",this.FHandleChangePtr);
        this.GetElementInputHandle().removeEventListener("paste",this.FHandlePastePtr);
        this.GetElementInputHandle().removeEventListener("cut",this.FHandleCutPtr);
        this.GetElementInputHandle().removeEventListener("invalid",this.FHandleInvalidPtr);
        this.GetElementInputHandle().removeEventListener("search",this.FHandleSearchPtr);
      };
    };
    this.UpdateElementData = function () {
      var eh = null;
      var ss = 0;
      var sl = 0;
      var isNum = false;
      var doAc = false;
      pas["WEBLib.Controls"].TControl.UpdateElementData.call(this);
      if (this.GetElementInputHandle() != null) {
        if (!this.GetIsLinked()) {
          var $tmp = this.FCharCase;
          if ($tmp === $mod.TEditCharCase.wecUpperCase) {
            this.GetElementInputHandle().style.setProperty("text-transform","uppercase")}
           else if ($tmp === $mod.TEditCharCase.wecLowerCase) {
            this.GetElementInputHandle().style.setProperty("text-transform","lowercase")}
           else if ($tmp === $mod.TEditCharCase.wecMixedCase) {
            this.GetElementInputHandle().style.setProperty("text-transform","capitalize")}
           else if ($tmp === $mod.TEditCharCase.wecNormal) this.GetElementInputHandle().style.setProperty("text-transform","initial");
        };
        this.GetElementInputHandle().readOnly = this.IsReadOnly();
        if (this.FTextHint !== "") this.GetElementInputHandle().placeholder = this.FTextHint;
        doAc = true;
        if (this.GetIsLinked()) {
          doAc = !this.GetElementInputHandle().hasAttribute("autocomplete");
        };
        if (doAc) {
          if (this.FAutoCompletion === $mod.TAutoCompletion.acNope) {
            this.GetElementInputHandle().setAttribute("autocomplete","nope");
            if (!this.GetIsLinked()) this.GetElementInputHandle().removeAttribute("name");
          } else if (this.FAutoCompletion === $mod.TAutoCompletion.acNone) {
            this.GetElementInputHandle().setAttribute("autocomplete","off");
            if (!this.GetIsLinked()) this.GetElementInputHandle().removeAttribute("name");
          } else if (this.FAutoCompletion !== $mod.TAutoCompletion.acOff) {
            this.GetElementInputHandle().setAttribute("autocomplete","on");
            if (!this.GetIsLinked()) this.GetElementInputHandle().setAttribute("name",$mod.GetAutoCompletionName(this.FAutoCompletion));
          } else {
            this.GetElementInputHandle().removeAttribute("autocomplete");
            if (!this.GetIsLinked()) this.GetElementInputHandle().removeAttribute("name");
          };
        };
        if (!this.GetIsLinked()) {
          this.GetElementInputHandle().setAttribute("type",this.GetInputType());
          this.GetElementInputHandle().setAttribute("role","textbox");
          var $tmp1 = this.FAlignment;
          if ($tmp1 === pas.Classes.TAlignment.taLeftJustify) {
            this.GetElementInputHandle().style.removeProperty("text-align")}
           else if ($tmp1 === pas.Classes.TAlignment.taCenter) {
            this.GetElementInputHandle().style.setProperty("text-align","center")}
           else if ($tmp1 === pas.Classes.TAlignment.taRightJustify) this.GetElementInputHandle().style.setProperty("text-align","right");
        };
        if (this.FRequired) {
          this.GetElementInputHandle().setAttribute("required","")}
         else if (!this.GetIsLinked()) this.GetElementInputHandle().removeAttribute("required");
        if (this.FAutoFocus) {
          this.GetElementInputHandle().setAttribute("autofocus","")}
         else if (!this.GetIsLinked()) this.GetElementInputHandle().removeAttribute("autofocus");
        if (this.FPattern !== "") {
          this.GetElementInputHandle().setAttribute("pattern",this.FPattern)}
         else this.GetElementInputHandle().removeAttribute("pattern");
        if (this.FMaxLength <= 0) {
          this.GetElementInputHandle().removeAttribute("maxLength")}
         else this.GetElementInputHandle().maxLength = this.FMaxLength;
        this.GetElementInputHandle().value = this.GetDisplayText();
        isNum = pas.SysUtils.UpperCase(this.GetInputType()) === "NUMBER";
        if (!this.FSpellCheck) {
          this.GetElementInputHandle().setAttribute("spellcheck","false")}
         else this.GetElementInputHandle().removeAttribute("spellcheck");
        if (!isNum && !this.GetIsLinked() && !this.IsCustomEditor()) {
          ss = this.FSelStart;
          sl = this.FSelStart + this.FSelLength;
          eh = this.GetElementInputHandle();
          setTimeout(function() {
            eh.setSelectionRange(ss, sl);
          }, 1);
        };
      };
    };
    this.UpdateSelection = function () {
      this.FSelStart = this.GetSelStart();
      this.FSelLength = this.GetSelLength();
    };
    this.SetCharCase = function (AValue) {
      if (this.FCharCase !== AValue) {
        this.FCharCase = AValue;
        this.UpdateElement();
      };
    };
    this.SetMaxLength = function (AValue) {
      if (this.FMaxLength !== AValue) {
        this.FMaxLength = AValue;
        this.UpdateElementData();
      };
    };
    this.SetReadOnly = function (AValue) {
      if (this.FReadOnly !== AValue) {
        this.FReadOnly = AValue;
        this.UpdateElement();
      };
    };
    this.SetText = function (AValue) {
      this.FText = AValue;
      if (this.GetElementInputHandle() != null) {
        this.GetElementInputHandle().value = this.GetDisplayText();
        this.GetElementInputHandle().readOnly = this.IsReadOnly();
      };
    };
    this.SetTextHint = function (AValue) {
      this.FTextHint = AValue;
      this.UpdateElement();
    };
    this.CanPaste = function (AValue) {
      var Result = false;
      Result = true;
      return Result;
    };
    this.CanCut = function () {
      var Result = false;
      Result = true;
      return Result;
    };
    this.InitCSSLibrary = function (ALibrary) {
      if (ALibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap) {
        this.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
        this.SetElementClassName("form-control");
        this.SetHeightStyle(pas["WEBLib.Controls"].TSizeStyle.ssAuto);
      };
    };
    this.CreateInitialize = function () {
      $mod.TCustomInput.CreateInitialize.call(this);
      this.FAutoCompletion = $mod.TAutoCompletion.acOff;
      this.FEditType = $mod.TEditType.weString;
      this.FText = "";
      this.FCharCase = $mod.TEditCharCase.wecNormal;
      this.FMaxLength = 0;
      this.FReadOnly = false;
      this.FTextHint = "";
      this.FPasswordChar = "\x00";
      this.FSpellCheck = true;
      this.FAutoSelect = true;
      this.SetHeight(25);
    };
    this.Clear = function () {
      this.SetText("");
    };
    this.ClearSelection = function () {
      var s = "";
      s = this.GetText();
      this.SetText(pas.System.Copy(s,1,this.GetSelStart()) + pas.System.Copy(s,this.GetSelStart() + this.GetSelLength(),s.length));
    };
    this.Change = function () {
      if (this.GetElementHandle() != null) this.FText = this.GetElementInputHandle().value;
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.SelectAll = function () {
      if (this.GetElementInputHandle() != null) this.GetElementInputHandle().select();
    };
    this.CopyToClipboard = function () {
      var s = "";
      s = this.GetText();
      navigator.clipboard.writeText(s);
    };
    this.SetSelection = function (ASelStart, ASelLength) {
      var eh = null;
      this.FSelStart = ASelStart;
      this.FSelLength = ASelLength;
      eh = this.GetElementInputHandle();
      if (eh != null) {
        eh.setSelectionRange(ASelStart, ASelStart + ASelLength);
      };
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TEdit",this.TCustomEdit,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Alignment",2,pas.Classes.$rtti["TAlignment"],"FAlignment","SetAlignment");
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("AutoCompletion",2,$mod.$rtti["TAutoCompletion"],"FAutoCompletion","SetAutoCompletion",4,{Default: $mod.TAutoCompletion.acOff});
    $r.addProperty("AutoFocus",2,rtl.boolean,"FAutoFocus","SetAutoFocus",4,{Default: false});
    $r.addProperty("AutoSize",2,rtl.boolean,"FAutoSize","SetAutoSize",4,{Default: false});
    $r.addProperty("AutoSelect",2,rtl.boolean,"FAutoSelect","SetAutoSelect",4,{Default: true});
    $r.addProperty("BiDiMode",2,pas["WEBLib.Controls"].$rtti["TBiDiMode"],"FBiDiMode","SetBiDiMode",4,{Default: pas["WEBLib.Controls"].TBiDiMode.bdLeftToRight});
    $r.addProperty("BorderStyle",2,pas["WEBLib.Controls"].$rtti["TBorderStyle"],"FBorderStyle","SetBorderStyle",4,{Default: pas["WEBLib.Controls"].TBorderStyle.bsSingle});
    $r.addProperty("Center",0,pas["WEBLib.Controls"].$rtti["TCenter"],"FCenter","");
    $r.addProperty("CharCase",2,$mod.$rtti["TEditCharCase"],"FCharCase","SetCharCase",4,{Default: $mod.TEditCharCase.wecNormal});
    $r.addProperty("ChildOrder",2,rtl.longint,"FChildOrder","SetChildOrderEx",4,{Default: 0});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor");
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("EditType",2,$mod.$rtti["TEditType"],"FEditType","SetEditType",4,{Default: $mod.TEditType.weString});
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Hint",2,rtl.string,"FHint","SetHint");
    $r.addProperty("HideSelection",2,rtl.boolean,"FHideSelection","SetHideSelection");
    $r.addProperty("Left",3,rtl.longint,"GetLeft","SetLeft");
    $r.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",4,{Default: true});
    $r.addProperty("PasswordChar",2,rtl.char,"FPasswordChar","SetPasswordChar",4,{Default: "\x00"});
    $r.addProperty("Pattern",2,rtl.string,"FPattern","SetPattern");
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("MaxLength",2,rtl.longint,"FMaxLength","SetMaxLength",4,{Default: 0});
    $r.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti["TPopupMenu"],"FPopupMenu","FPopupMenu");
    $r.addProperty("ReadOnly",2,rtl.boolean,"FReadOnly","SetReadOnly",4,{Default: false});
    $r.addProperty("Required",2,rtl.boolean,"FRequired","SetRequired",4,{Default: false});
    $r.addProperty("RequiredText",0,rtl.string,"FRequiredText","FRequiredText");
    $r.addProperty("ShowFocus",2,rtl.boolean,"FShowFocus","SetShowFocus",4,{Default: false});
    $r.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",4,{Default: false});
    $r.addProperty("SpellCheck",2,rtl.boolean,"FSpellCheck","SetSpellCheck",4,{Default: true});
    $r.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder");
    $r.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",4,{Default: true});
    $r.addProperty("Text",3,rtl.string,"GetText","SetText");
    $r.addProperty("TextDirection",0,pas["WEBLib.Controls"].$rtti["TTextDirection"],"FTextDirection","FTextDirection",4,{Default: pas["WEBLib.Controls"].TTextDirection.tdDefault});
    $r.addProperty("TextHint",2,rtl.string,"FTextHint","SetTextHint");
    $r.addProperty("Top",3,rtl.longint,"GetTop","SetTop");
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChange","FOnChange");
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnKeyDown",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyDown","FOnKeyDown");
    $r.addProperty("OnKeyPress",0,pas["WEBLib.Controls"].$rtti["TKeyPressEvent"],"FOnKeyPress","FOnKeyPress");
    $r.addProperty("OnKeyUp",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyUp","FOnKeyUp");
    $r.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseDown","FOnMouseDown");
    $r.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseUp","FOnMouseUp");
    $r.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti["TMouseMoveEvent"],"FOnMouseMove","FOnMouseMove");
    $r.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseLeave","FOnMouseLeave");
    $r.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseEnter","FOnMouseEnter");
    $r.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnEnter","FOnEnter");
    $r.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnExit","FOnExit");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnSearch",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnSearch","FOnSearch");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
  });
  rtl.createClass(this,"TWebEdit",this.TEdit,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TSpinEdit",this.TCustomInput,function () {
    this.$init = function () {
      $mod.TCustomInput.$init.call(this);
      this.FIncrement = 0;
      this.FMaxValue = 0;
      this.FMinValue = 0;
      this.FValue = 0;
      this.FAutoSize = false;
      this.FOnChange = null;
      this.FReadOnly = false;
      this.FHandleChangePtr = null;
      this.FHandleInvalidPtr = null;
      this.FRequiredText = "";
      this.FRequired = false;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      $mod.TCustomInput.$final.call(this);
    };
    this.GetText = function () {
      var Result = "";
      Result = pas.SysUtils.IntToStr(this.GetValue());
      return Result;
    };
    this.SetText = function (Value) {
      var i = 0;
      i = 0;
      if (pas.SysUtils.TryStrToInt(Value,{get: function () {
          return i;
        }, set: function (v) {
          i = v;
        }})) {
        this.SetValue(i)}
       else this.SetValue(0);
    };
    this.GetElementInputHandle = function () {
      var Result = null;
      Result = this.GetContainer();
      return Result;
    };
    this.SetReadOnly = function (Value) {
      if (this.FReadOnly !== Value) {
        this.FReadOnly = Value;
        this.UpdateElement();
      };
    };
    this.SetRequired = function (Value) {
      if (this.FRequired !== Value) {
        this.FRequired = Value;
        this.UpdateElement();
      };
    };
    this.KeyPress = function (Key) {
      if (!(Key.get().charCodeAt() in rtl.createSet(null,48,57))) {
        Key.set("\x00");
        this.PreventDefault();
        this.StopPropagation();
      };
      pas["WEBLib.Controls"].TControl.KeyPress.apply(this,arguments);
    };
    this.PersistinHTML = function () {
      this.GetElementInputHandle().setAttribute("value",pas.SysUtils.IntToStr(this.GetValue()));
    };
    this.GetInputType = function () {
      var Result = "";
      Result = "NUMBER";
      return Result;
    };
    this.UpdateElementData = function () {
      pas["WEBLib.Controls"].TControl.UpdateElementData.call(this);
      if (this.GetContainer() != null) {
        this.GetContainer().setAttribute("inputmode","numeric");
        this.GetContainer().setAttribute("pattern","[0-9]*");
        this.GetContainer().value = this.GetDisplayText();
        this.GetElementInputHandle().readOnly = this.IsReadOnly();
        if (this.FRequired) {
          this.GetElementInputHandle().setAttribute("required","")}
         else this.GetElementInputHandle().removeAttribute("required");
      };
    };
    this.GetValue = function () {
      var Result = 0;
      var s = "";
      Result = this.FValue;
      if (!(this.GetContainer() != null)) return Result;
      s = this.GetContainer().value;
      if (s !== "") Result = pas.SysUtils.StrToInt(s);
      return Result;
    };
    this.SetIncrement = function (AValue) {
      this.FIncrement = AValue;
      if (this.GetContainer() != null) this.GetContainer().setAttribute("step",pas.SysUtils.IntToStr(AValue));
    };
    this.SetMaxValue = function (AValue) {
      this.FMaxValue = AValue;
      if (this.GetContainer() != null) this.GetContainer().setAttribute("max",pas.SysUtils.IntToStr(AValue));
    };
    this.SetMinValue = function (AValue) {
      this.FMinValue = AValue;
      if (this.GetContainer() != null) this.GetContainer().setAttribute("min",pas.SysUtils.IntToStr(AValue));
    };
    this.SetValue = function (AValue) {
      this.FValue = AValue;
      this.UpdateElement();
    };
    this.DoHandleChange = function (Event) {
      var Result = false;
      this.Change();
      Result = true;
      if (this.FRequiredText !== "") {
        this.GetElementInputHandle().setCustomValidity("");
      };
      return Result;
    };
    this.DoHandleInvalid = function (Event) {
      var Result = false;
      this.GetElementInputHandle().setCustomValidity(this.FRequiredText);
      Result = true;
      return Result;
    };
    this.IsReadOnly = function () {
      var Result = false;
      Result = this.FReadOnly;
      return Result;
    };
    this.GetDisplayText = function () {
      var Result = "";
      Result = pas.SysUtils.IntToStr(this.FValue);
      return Result;
    };
    this.BindEvents = function () {
      pas["WEBLib.Controls"].TCustomControl.BindEvents.call(this);
      if (this.GetElementInputHandle() != null) {
        this.GetElementInputHandle().addEventListener("input",this.FHandleChangePtr);
        this.GetElementInputHandle().addEventListener("invalid",this.FHandleInvalidPtr);
      };
    };
    this.UnbindEvents = function () {
      pas["WEBLib.Controls"].TControl.UnbindEvents.call(this);
      if (this.GetElementInputHandle() != null) {
        this.GetElementInputHandle().removeEventListener("input",this.FHandleChangePtr);
        this.GetElementInputHandle().removeEventListener("invalid",this.FHandleInvalidPtr);
      };
    };
    this.Change = function () {
      this.FValue = this.GetValue();
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.ClearMethodPointers = function () {
      pas["WEBLib.Controls"].TControl.ClearMethodPointers.call(this);
      this.FHandleChangePtr = null;
      this.FHandleInvalidPtr = null;
    };
    this.GetMethodPointers = function () {
      pas["WEBLib.Controls"].TControl.GetMethodPointers.call(this);
      this.FHandleChangePtr = rtl.createCallback(this,"DoHandleChange");
      this.FHandleInvalidPtr = rtl.createCallback(this,"DoHandleInvalid");
    };
    this.InitCSSLibrary = function (ALibrary) {
      if (ALibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap) {
        this.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
        this.SetElementClassName("form-control");
        this.SetHeightStyle(pas["WEBLib.Controls"].TSizeStyle.ssAuto);
      };
    };
    this.CreateInitialize = function () {
      $mod.TCustomInput.CreateInitialize.call(this);
      this.FIncrement = 1;
      this.FMaxValue = 100;
      this.FMinValue = 0;
      this.SetShowFocus(true);
      this.SetHeight(25);
      this.AddControlStyle('input[type="number"]::-webkit-inner-spin-button { opacity: 1 !important; }');
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("AutoSize",0,rtl.boolean,"FAutoSize","FAutoSize");
    $r.addProperty("BiDiMode",2,pas["WEBLib.Controls"].$rtti["TBiDiMode"],"FBiDiMode","SetBiDiMode",4,{Default: pas["WEBLib.Controls"].TBiDiMode.bdLeftToRight});
    $r.addProperty("BorderStyle",2,pas["WEBLib.Controls"].$rtti["TBorderStyle"],"FBorderStyle","SetBorderStyle",4,{Default: pas["WEBLib.Controls"].TBorderStyle.bsSingle});
    $r.addProperty("ChildOrder",2,rtl.longint,"FChildOrder","SetChildOrderEx",4,{Default: 0});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor");
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Hint",2,rtl.string,"FHint","SetHint");
    $r.addProperty("Increment",2,rtl.longint,"FIncrement","SetIncrement");
    $r.addProperty("Left",3,rtl.longint,"GetLeft","SetLeft");
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("MaxValue",2,rtl.longint,"FMaxValue","SetMaxValue",4,{Default: 100});
    $r.addProperty("MinValue",2,rtl.longint,"FMinValue","SetMinValue",4,{Default: 0});
    $r.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",4,{Default: true});
    $r.addProperty("ReadOnly",2,rtl.boolean,"FReadOnly","SetReadOnly",4,{Default: false});
    $r.addProperty("Required",2,rtl.boolean,"FRequired","SetRequired",4,{Default: false});
    $r.addProperty("RequiredText",0,rtl.string,"FRequiredText","FRequiredText");
    $r.addProperty("Role",3,rtl.string,"GetRole","SetRole");
    $r.addProperty("ShowFocus",2,rtl.boolean,"FShowFocus","SetShowFocus",4,{Default: false});
    $r.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",4,{Default: false});
    $r.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",4,{Default: true});
    $r.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder");
    $r.addProperty("TextDirection",0,pas["WEBLib.Controls"].$rtti["TTextDirection"],"FTextDirection","FTextDirection",4,{Default: pas["WEBLib.Controls"].TTextDirection.tdDefault});
    $r.addProperty("Value",3,rtl.longint,"GetValue","SetValue");
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChange","FOnChange");
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnKeyDown",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyDown","FOnKeyDown");
    $r.addProperty("OnKeyPress",0,pas["WEBLib.Controls"].$rtti["TKeyPressEvent"],"FOnKeyPress","FOnKeyPress");
    $r.addProperty("OnKeyUp",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyUp","FOnKeyUp");
    $r.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseDown","FOnMouseDown");
    $r.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseUp","FOnMouseUp");
    $r.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti["TMouseMoveEvent"],"FOnMouseMove","FOnMouseMove");
    $r.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseLeave","FOnMouseLeave");
    $r.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseEnter","FOnMouseEnter");
    $r.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnEnter","FOnEnter");
    $r.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnExit","FOnExit");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
  });
  rtl.createClass(this,"TWebSpinEdit",this.TSpinEdit,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TDateTimePicker",this.TCustomInput,function () {
    this.$init = function () {
      $mod.TCustomInput.$init.call(this);
      this.FDate = 0.0;
      this.FTime = 0.0;
      this.FKind = 0;
      this.FOnChange = null;
      this.FReadOnly = false;
      this.FElementCheck = null;
      this.FElementPicker = null;
      this.FShowCheckBox = false;
      this.FClickPtr$1 = null;
      this.FHandleChangePtr = null;
      this.FFocusPtr = null;
      this.FBlurPtr = null;
      this.FChecked = false;
      this.FShowSeconds = false;
      this.FAutoDropDown = false;
      this.FIsBootstrap = false;
      this.FMax = 0.0;
      this.FMin = 0.0;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      this.FElementCheck = undefined;
      this.FElementPicker = undefined;
      $mod.TCustomInput.$final.call(this);
    };
    this.SetDate = function (AValue) {
      if (this.FDate !== AValue) {
        this.FDate = pas.System.Int(AValue);
        this.FTime = 0;
        this.UpdateElementData();
      };
    };
    this.GetDate = function () {
      var Result = 0.0;
      var str = "";
      Result = pas.System.Int(this.FDate) + pas.System.Frac(this.FTime);
      if (!(this.GetElementPicker() != null)) return Result;
      str = this.GetElementPicker().value;
      if (this.FKind === $mod.TDateTimeKind.dtkDate) {
        Result = pas["WEBLib.WebTools"].PickerDateToDate(str) + pas.System.Frac(this.FTime);
      } else Result = this.FTime;
      return Result;
    };
    this.SetTime = function (AValue) {
      if (this.FTime !== AValue) {
        this.FDate = 0;
        this.FTime = AValue;
        this.UpdateElementData();
      };
    };
    this.GetTime = function () {
      var Result = 0.0;
      var str = "";
      if (this.FDate > 0) {
        Result = pas.System.Frac(this.FTime) + pas.System.Int(this.FDate)}
       else Result = pas.System.Frac(this.FTime);
      if (!(this.GetElementPicker() != null)) return Result;
      str = this.GetElementPicker().value;
      if (this.FKind === $mod.TDateTimeKind.dtkTime) {
        Result = pas["WEBLib.WebTools"].PickerTimeToTime(str) + pas.System.Int(this.FDate);
      } else Result = this.FTime;
      return Result;
    };
    this.SetKind = function (AValue) {
      var dt = 0.0;
      this.FKind = AValue;
      if (this.GetElementPicker() != null) {
        dt = pas.System.Int(this.FDate) + pas.System.Frac(this.FTime);
        if (AValue === $mod.TDateTimeKind.dtkDate) {
          this.GetElementPicker().setAttribute("type","DATE")}
         else this.GetElementPicker().setAttribute("type","TIME");
        this.SetDate(dt);
        this.SetTime(dt);
        this.UpdateElement();
      };
    };
    this.SetText = function (Value) {
      if (!(this.GetElementPicker() != null)) return;
    };
    this.GetText = function () {
      var Result = "";
      Result = "";
      if (!(this.GetElementPicker() != null)) return Result;
      Result = this.GetElementPicker().value;
      return Result;
    };
    this.SetReadOnly = function (Value) {
      this.FReadOnly = Value;
      this.UpdateElement();
    };
    this.SetShowCheckBox = function (Value) {
      if (this.FShowCheckBox !== Value) {
        this.FShowCheckBox = Value;
        this.UpdateElementVisual();
      };
    };
    this.SetChecked = function (Value) {
      if (this.FChecked !== Value) {
        this.FChecked = Value;
        this.UpdateElementVisual();
      };
    };
    this.GetDateTime = function () {
      var Result = 0.0;
      Result = pas.System.Int(this.FDate) + pas.System.Frac(this.FTime);
      return Result;
    };
    this.SetDateTime = function (Value) {
      this.FDate = pas.System.Int(Value);
      this.FTime = pas.System.Frac(Value);
      this.UpdateElementData();
    };
    this.SetShowSeconds = function (Value) {
      if (this.FShowSeconds !== Value) {
        this.FShowSeconds = Value;
        this.UpdateElement();
      };
    };
    this.SetMax = function (Value) {
      if (this.FMax !== Value) {
        this.FMax = Value;
        this.UpdateElementData();
      };
    };
    this.SetMin = function (Value) {
      if (this.FMin !== Value) {
        this.FMin = Value;
        this.UpdateElementData();
      };
    };
    this.DoCheckClick = function (Event) {
      var Result = false;
      this.FChecked = this.FElementCheck.checked;
      if (this.FChecked) {
        this.GetElementPicker().removeAttribute("disabled")}
       else this.GetElementPicker().setAttribute("disabled","true");
      Result = true;
      return Result;
    };
    this.DoPickerFocus = function (Event) {
      var Result = false;
      if (!this.GetIsLinked() && !this.FIsBootstrap) this.GetElementHandle().style.setProperty("outline","auto");
      Result = true;
      this.DoEnter();
      return Result;
    };
    this.DoPickerBlur = function (Event) {
      var Result = false;
      if (!this.GetIsLinked() && !this.FIsBootstrap) this.GetElementHandle().style.setProperty("outline","none");
      Result = true;
      this.DoExit();
      return Result;
    };
    this.DoHandleChange = function (Event) {
      var Result = false;
      this.Change();
      Result = true;
      return Result;
    };
    this.HandleDoEnter = function (Event) {
      var Result = false;
      var el = null;
      Result = pas["WEBLib.Controls"].TControl.HandleDoEnter.call(this,Event);
      if (this.FAutoDropDown) {
        el = this.GetElementPicker();
        el.showPicker();
      };
      return Result;
    };
    this.GetElementBindHandle = function () {
      var Result = null;
      Result = this.GetElementPicker();
      return Result;
    };
    this.BindEvents = function () {
      pas["WEBLib.Controls"].TCustomControl.BindEvents.call(this);
      if (this.FElementCheck != null) this.FElementCheck.addEventListener("click",this.FClickPtr$1);
      if (this.GetElementPicker() != null) {
        this.GetElementPicker().addEventListener("input",this.FHandleChangePtr);
        this.GetElementPicker().addEventListener("focus",this.FFocusPtr);
        this.GetElementPicker().addEventListener("blur",this.FBlurPtr);
      };
    };
    this.UnbindEvents = function () {
      pas["WEBLib.Controls"].TControl.UnbindEvents.call(this);
      if (this.FElementCheck != null) this.FElementCheck.removeEventListener("click",this.FClickPtr$1);
      if (this.GetElementPicker() != null) {
        this.GetElementPicker().removeEventListener("input",this.FHandleChangePtr);
        this.GetElementPicker().removeEventListener("focus",this.FFocusPtr);
        this.GetElementPicker().removeEventListener("blur",this.FBlurPtr);
      };
    };
    this.UpdateElementData = function () {
      var el = null;
      var s = "";
      var i = 0;
      var d = 0;
      var m = 0;
      var y = 0;
      pas["WEBLib.Controls"].TControl.UpdateElementData.call(this);
      el = this.GetElementPicker();
      if (el != null) {
        if (!this.GetIsLinked()) el.setAttribute("step","1");
        var $tmp = this.FKind;
        if ($tmp === $mod.TDateTimeKind.dtkTime) {
          if (this.FShowSeconds) {
            s = pas.SysUtils.FormatDateTime("HH:MM:SS",this.FTime)}
           else s = pas.SysUtils.FormatDateTime("HH:MM",this.FTime);
          for (var $l = 1, $end = s.length; $l <= $end; $l++) {
            i = $l;
            if (!(s.charCodeAt(i - 1) in rtl.createSet(null,48,57))) s = rtl.setCharAt(s,i - 1,":");
          };
          el.value = s;
          if (!this.FShowSeconds) el.setAttribute("step","60");
        } else if ($tmp === $mod.TDateTimeKind.dtkDate) {
          if (this.FDate === 0) {
            el.value = ""}
           else {
            s = pas.SysUtils.FormatDateTime("yyyy-MM-dd",this.FDate);
            for (var $l1 = 1, $end1 = s.length; $l1 <= $end1; $l1++) {
              i = $l1;
              if (!(s.charCodeAt(i - 1) in rtl.createSet(null,48,57))) s = rtl.setCharAt(s,i - 1,"-");
            };
            el.value = s;
          };
        };
        if (!this.GetIsLinked()) {
          if (this.FTabStop) {
            el.setAttribute("tabindex",pas.SysUtils.IntToStr(this.FTabOrder))}
           else el.setAttribute("tabindex","-1");
        } else {
          if (this.FTabStop) el.setAttribute("tabindex",pas.SysUtils.IntToStr(this.FTabOrder));
        };
        if (this.FKind === $mod.TDateTimeKind.dtkDate) {
          if (this.FMin !== 0) {
            pas.SysUtils.DecodeDate(this.FMin,{get: function () {
                return y;
              }, set: function (v) {
                y = v;
              }},{get: function () {
                return m;
              }, set: function (v) {
                m = v;
              }},{get: function () {
                return d;
              }, set: function (v) {
                d = v;
              }});
            el.setAttribute("min",pas.SysUtils.Format("%d",pas.System.VarRecs(0,y)) + "-" + pas.SysUtils.Format("%.*d",pas.System.VarRecs(0,2,0,m)) + "-" + pas.SysUtils.Format("%.*d",pas.System.VarRecs(0,2,0,d)));
          } else el.removeAttribute("min");
          if (this.FMax !== 0) {
            pas.SysUtils.DecodeDate(this.FMax,{get: function () {
                return y;
              }, set: function (v) {
                y = v;
              }},{get: function () {
                return m;
              }, set: function (v) {
                m = v;
              }},{get: function () {
                return d;
              }, set: function (v) {
                d = v;
              }});
            el.setAttribute("max",pas.SysUtils.Format("%d",pas.System.VarRecs(0,y)) + "-" + pas.SysUtils.Format("%.*d",pas.System.VarRecs(0,2,0,m)) + "-" + pas.SysUtils.Format("%.*d",pas.System.VarRecs(0,2,0,d)));
          } else el.removeAttribute("max");
        };
        el.readOnly = this.IsReadOnly();
        if (this.IsEnabled()) {
          el.removeAttribute("disabled")}
         else el.setAttribute("disabled","");
      };
    };
    this.UpdateElementVisual = function () {
      var frm = null;
      $mod.TCustomInput.UpdateElementVisual.call(this);
      frm = pas["WEBLib.Forms"].GetParentForm(this);
      this.FIsBootstrap = (frm != null) && (frm.FCSSLibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap) && (this.FElementClassName !== "");
      if ((this.GetElementPicker() != null) && (this.GetElementHandle() != null) && (this.FElementCheck != null)) {
        this.FElementCheck.setAttribute("type","CHECKBOX");
        if (this.FKind === $mod.TDateTimeKind.dtkDate) {
          this.GetElementPicker().setAttribute("type","DATE")}
         else this.GetElementPicker().setAttribute("type","TIME");
        if (this.FElementClassName === "") {
          this.GetElementPicker().style.setProperty("border","none");
          this.GetElementPicker().style.setProperty("border-width","0px");
          this.GetElementPicker().style.setProperty("outline","none");
          this.GetElementPicker().style.setProperty("font-family","inherit");
          this.GetElementPicker().style.setProperty("font-size","inherit");
          this.GetElementPicker().style.setProperty("width","100%");
          this.GetElementPicker().style.setProperty("height","100%");
        } else {
          if (this.FIsBootstrap) {
            this.GetElementPicker().setAttribute("class",this.FElementClassName);
            this.GetElementHandle().removeAttribute("class");
          };
        };
        if (!this.GetIsLinked()) {
          this.GetElementHandle().style.setProperty("padding","1px");
          this.GetElementHandle().style.setProperty("outline","none");
        };
        if ((this.FBorderStyle === pas["WEBLib.Controls"].TBorderStyle.bsSingle) && (this.FElementClassName === "")) {
          if (!this.FEnabled) {
            this.GetElementHandle().style.setProperty("border","1px silver solid")}
           else this.GetElementHandle().style.setProperty("border","1px solid");
          this.GetElementHandle().style.setProperty("border-radius","3px");
        } else {
          if (this.FIsBootstrap) {
            this.GetElementHandle().style.removeProperty("border");
            this.GetElementHandle().style.removeProperty("box-sizing");
          };
        };
        if (this.FElementCheck != null) {
          if (this.FShowCheckBox) {
            this.FElementCheck.style.setProperty("display","")}
           else this.FElementCheck.style.setProperty("display","none");
        };
        if (this.FShowCheckBox) {
          if (this.FChecked) {
            this.GetElementPicker().removeAttribute("disabled")}
           else this.GetElementPicker().setAttribute("disabled","true");
        };
      };
    };
    this.CreateElement = function () {
      var Result = null;
      Result = document.createElement("DIV");
      this.FElementCheck = document.createElement("INPUT");
      this.FElementPicker = document.createElement("INPUT");
      Result.appendChild(this.FElementCheck);
      Result.appendChild(this.FElementPicker);
      return Result;
    };
    this.GetInputType = function () {
      var Result = "";
      if (this.FKind === $mod.TDateTimeKind.dtkDate) {
        Result = "DATE"}
       else Result = "TIME";
      return Result;
    };
    this.Change = function () {
      this.FTime = this.GetTime();
      this.FDate = this.GetDate();
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.IsReadOnly = function () {
      var Result = false;
      Result = this.FReadOnly;
      return Result;
    };
    this.ClearMethodPointers = function () {
      pas["WEBLib.Controls"].TControl.ClearMethodPointers.call(this);
      this.FHandleChangePtr = null;
      this.FBlurPtr = null;
      this.FFocusPtr = null;
      this.FClickPtr$1 = null;
    };
    this.GetMethodPointers = function () {
      pas["WEBLib.Controls"].TControl.GetMethodPointers.call(this);
      this.FHandleChangePtr = rtl.createCallback(this,"DoHandleChange");
      this.FClickPtr$1 = rtl.createCallback(this,"DoCheckClick");
      this.FFocusPtr = rtl.createCallback(this,"DoPickerFocus");
      this.FBlurPtr = rtl.createCallback(this,"DoPickerBlur");
    };
    this.GetElementPicker = function () {
      var Result = null;
      if (this.GetIsLinked()) {
        Result = this.GetElementHandle()}
       else Result = this.FElementPicker;
      return Result;
    };
    this.SetEnabled = function (Value) {
      var el = null;
      pas["WEBLib.Controls"].TControl.SetEnabled.apply(this,arguments);
      el = this.GetElementPicker();
      if (el != null) {
        if (Value) {
          el.removeAttribute("disabled")}
         else el.setAttribute("disabled","");
      };
    };
    this.InitCSSLibrary = function (ALibrary) {
      if (ALibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap) {
        this.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
        this.SetElementClassName("form-control");
        this.SetHeightStyle(pas["WEBLib.Controls"].TSizeStyle.ssAuto);
      };
    };
    this.CreateInitialize = function () {
      $mod.TCustomInput.CreateInitialize.call(this);
      this.FMin = 0;
      this.FMax = 0;
      this.SetDate(pas.SysUtils.Now());
      this.SetShowFocus(true);
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        this.SetWidth(170);
        this.SetHeight(25);
      };
      this.FDate = pas.System.Int(pas.SysUtils.Now());
      this.FTime = 0;
      this.FReadOnly = false;
      this.FShowSeconds = true;
      this.FIsBootstrap = false;
    };
    this.Clear = function () {
      this.GetElementPicker().value = "";
    };
    this.SetFocus = function () {
      var $Self = this;
      var el = null;
      function IntSetFocus() {
        el.focus();
      };
      if (1 < 0) IntSetFocus();
      if (this.GetElementPicker() != null) {
        el = this.GetElementPicker();
        setTimeout(IntSetFocus, 100);
      };
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("AutoDropDown",0,rtl.boolean,"FAutoDropDown","FAutoDropDown",4,{Default: false});
    $r.addProperty("BorderStyle",2,pas["WEBLib.Controls"].$rtti["TBorderStyle"],"FBorderStyle","SetBorderStyle",4,{Default: pas["WEBLib.Controls"].TBorderStyle.bsSingle});
    $r.addProperty("Checked",2,rtl.boolean,"FChecked","SetChecked",4,{Default: false});
    $r.addProperty("ChildOrder",2,rtl.longint,"FChildOrder","SetChildOrderEx",4,{Default: 0});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor");
    $r.addProperty("Date",3,pas.System.$rtti["TDate"],"GetDate","SetDate");
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Hint",2,rtl.string,"FHint","SetHint");
    $r.addProperty("Kind",2,$mod.$rtti["TDateTimeKind"],"FKind","SetKind");
    $r.addProperty("Left",3,rtl.longint,"GetLeft","SetLeft");
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("Max",2,pas.System.$rtti["TDateTime"],"FMax","SetMax");
    $r.addProperty("Min",2,pas.System.$rtti["TDateTime"],"FMin","SetMin");
    $r.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",4,{Default: true});
    $r.addProperty("ReadOnly",2,rtl.boolean,"FReadOnly","SetReadOnly",4,{Default: false});
    $r.addProperty("Role",3,rtl.string,"GetRole","SetRole");
    $r.addProperty("ShowCheckBox",2,rtl.boolean,"FShowCheckBox","SetShowCheckBox",4,{Default: false});
    $r.addProperty("ShowFocus",2,rtl.boolean,"FShowFocus","SetShowFocus",4,{Default: false});
    $r.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",4,{Default: false});
    $r.addProperty("ShowSeconds",2,rtl.boolean,"FShowSeconds","SetShowSeconds",4,{Default: true});
    $r.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",4,{Default: true});
    $r.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder");
    $r.addProperty("Text",3,rtl.string,"GetText","SetText");
    $r.addProperty("TextDirection",0,pas["WEBLib.Controls"].$rtti["TTextDirection"],"FTextDirection","FTextDirection",4,{Default: pas["WEBLib.Controls"].TTextDirection.tdDefault});
    $r.addProperty("Time",3,pas.System.$rtti["TTime"],"GetTime","SetTime");
    $r.addProperty("Top",3,rtl.longint,"GetTop","SetTop");
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChange","FOnChange");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnKeyDown",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyDown","FOnKeyDown");
    $r.addProperty("OnKeyPress",0,pas["WEBLib.Controls"].$rtti["TKeyPressEvent"],"FOnKeyPress","FOnKeyPress");
    $r.addProperty("OnKeyUp",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyUp","FOnKeyUp");
    $r.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseDown","FOnMouseDown");
    $r.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseUp","FOnMouseUp");
    $r.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti["TMouseMoveEvent"],"FOnMouseMove","FOnMouseMove");
    $r.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseLeave","FOnMouseLeave");
    $r.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseEnter","FOnMouseEnter");
    $r.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnEnter","FOnEnter");
    $r.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnExit","FOnExit");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
  });
  rtl.createClass(this,"TWebDateTimePicker",this.TDateTimePicker,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TButton",pas["WEBLib.Menus"].TWebCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Menus"].TWebCustomControl.$init.call(this);
      this.FModalResult = 0;
      this.FDefault = false;
      this.FCancel = false;
      this.FButtonType = "";
    };
    this.SetButtonType = function (Value) {
      this.FButtonType = Value;
      this.UpdateElementData();
    };
    this.SetDefault = function (Value) {
      this.FDefault = Value;
      if (this.FDefault) this.SetFocus();
    };
    this.CreateElement = function () {
      var Result = null;
      Result = document.createElement("BUTTON");
      Result.setAttribute("type","BUTTON");
      return Result;
    };
    this.SetCaption = function (AValue) {
      if (this.FCaption !== AValue) {
        pas["WEBLib.Controls"].TCustomControl.SetCaption.call(this,AValue);
        this.UpdateElementData();
      };
    };
    this.UpdateElementData = function () {
      var acc = "";
      pas["WEBLib.Controls"].TControl.UpdateElementData.call(this);
      if (this.GetIsLinked() && (this.FCaption === "")) return;
      if (this.GetElementHandle() != null) {
        if ((this.GetElementHandle().childElementCount === 0) || (pas.System.Pos("</",this.FCaption) > 0) || !this.GetIsLinked()) {
          this.GetElementHandle().innerHTML = pas["WEBLib.WebTools"].ProcessAccelerator(this.FCaption,{get: function () {
              return acc;
            }, set: function (v) {
              acc = v;
            }});
        };
        if (acc !== "") this.GetElementHandle().setAttribute("accesskey",acc);
        this.GetElementHandle().setAttribute("role","button");
        this.GetElementHandle().setAttribute("aria-label",this.FCaption);
        if (this.FButtonType !== "") {
          this.GetElementHandle().setAttribute("type",this.FButtonType)}
         else this.GetElementHandle().setAttribute("type","BUTTON");
      };
    };
    this.UpdateElementVisual = function () {
      var ecn = "";
      pas["WEBLib.Controls"].TCustomControl.UpdateElementVisual.call(this);
      if (this.GetElementHandle() != null) {
        this.GetElementHandle().style.removeProperty("outline");
        this.GetElementHandle().style.removeProperty("user-select");
        ecn = pas.SysUtils.UpperCase(this.FElementClassName);
        if ((ecn === "BTN") || (pas.System.Pos("BTN ",ecn) > 0)) ;
      };
    };
    this.HandleKeyPreview = function (Key) {
      pas["WEBLib.Controls"].TControl.HandleKeyPreview.apply(this,arguments);
      if (this.FDefault && (Key === 13)) {
        this.Click();
      };
      if (this.FCancel && (Key === 27)) {
        this.Click();
      };
    };
    this.InitCSSLibrary = function (ALibrary) {
      if (ALibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap) {
        this.SetElementClassName("btn btn-light");
        this.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
        this.SetHeightStyle(pas["WEBLib.Controls"].TSizeStyle.ssAuto);
      };
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      if ((pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) && (this.FCaption === "")) this.SetCaption(this.FName);
      this.SetColor(-1);
      this.FModalResult = 0;
    };
    this.Click = function () {
      var frm = null;
      pas["WEBLib.Controls"].TControl.Click.call(this);
      if (this.FModalResult !== 0) {
        frm = pas["WEBLib.Forms"].GetParentForm(this);
        if (frm != null) frm.SetModalResult(this.FModalResult);
      };
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("BiDiMode",2,pas["WEBLib.Controls"].$rtti["TBiDiMode"],"FBiDiMode","SetBiDiMode",4,{Default: pas["WEBLib.Controls"].TBiDiMode.bdLeftToRight});
    $r.addProperty("BorderStyle",2,pas["WEBLib.Controls"].$rtti["TBorderStyle"],"FBorderStyle","SetBorderStyle",4,{Default: pas["WEBLib.Controls"].TBorderStyle.bsSingle});
    $r.addProperty("ButtonType",2,rtl.string,"FButtonType","SetButtonType");
    $r.addProperty("Caption",2,rtl.string,"FCaption","SetCaption");
    $r.addProperty("Cancel",0,rtl.boolean,"FCancel","FCancel",4,{Default: false});
    $r.addProperty("Center",0,pas["WEBLib.Controls"].$rtti["TCenter"],"FCenter","");
    $r.addProperty("ChildOrder",2,rtl.longint,"FChildOrder","SetChildOrderEx",4,{Default: 0});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor");
    $r.addProperty("Default",2,rtl.boolean,"FDefault","SetDefault",4,{Default: false});
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Hint",2,rtl.string,"FHint","SetHint");
    $r.addProperty("Left",3,rtl.longint,"GetLeft","SetLeft");
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("ModalResult",0,rtl.longint,"FModalResult","FModalResult",4,{Default: 0});
    $r.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti["TPopupMenu"],"FPopupMenu","FPopupMenu");
    $r.addProperty("Role",3,rtl.string,"GetRole","SetRole");
    $r.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",4,{Default: true});
    $r.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",4,{Default: false});
    $r.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder");
    $r.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",4,{Default: true});
    $r.addProperty("TextDirection",0,pas["WEBLib.Controls"].$rtti["TTextDirection"],"FTextDirection","FTextDirection",4,{Default: pas["WEBLib.Controls"].TTextDirection.tdDefault});
    $r.addProperty("Top",3,rtl.longint,"GetTop","SetTop");
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnKeyDown",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyDown","FOnKeyDown");
    $r.addProperty("OnKeyPress",0,pas["WEBLib.Controls"].$rtti["TKeyPressEvent"],"FOnKeyPress","FOnKeyPress");
    $r.addProperty("OnKeyUp",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyUp","FOnKeyUp");
    $r.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseDown","FOnMouseDown");
    $r.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseUp","FOnMouseUp");
    $r.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti["TMouseMoveEvent"],"FOnMouseMove","FOnMouseMove");
    $r.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseLeave","FOnMouseLeave");
    $r.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseEnter","FOnMouseEnter");
    $r.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnEnter","FOnEnter");
    $r.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnExit","FOnExit");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
  });
  rtl.createClass(this,"TWebButton",this.TButton,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TCheckBox",pas["WEBLib.Menus"].TWebCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Menus"].TWebCustomControl.$init.call(this);
      this.FChecked = false;
      this.FState = 0;
      this.FElementButtonClassName = "";
      this.FElementLabelClassName = "";
      this.FOnCheckClick = null;
      this.FAlignment = 0;
      this.FAllowGrayed = false;
    };
    this.$final = function () {
      this.FOnCheckClick = undefined;
      pas["WEBLib.Menus"].TWebCustomControl.$final.call(this);
    };
    this.SetAlignment = function (Value) {
      if (this.FAlignment !== Value) {
        this.FAlignment = Value;
        this.UpdateElementVisual();
      };
    };
    this.Loaded = function () {
      var lbl = null;
      pas["WEBLib.Controls"].TCustomControl.Loaded.call(this);
      if (this.GetContainer() != null) {
        if (!this.GetIsLinked()) {
          lbl = this.GetContainer().children.item(1);
          lbl.onclick = rtl.createSafeCallback(this,"HandleLabelClick");
        };
      };
    };
    this.UpdateElementData = function () {
      var chk = null;
      var btn = null;
      pas["WEBLib.Controls"].TControl.UpdateElementData.call(this);
      if (this.GetContainer() != null) {
        chk = this.GetCheckElement();
        if (chk != null) {
          chk.disabled = !this.IsEnabled();
          chk.checked = this.FChecked;
          chk.indeterminate = this.GetState() === $mod.TCheckBoxState.cbGrayed;
        };
        if (!this.GetIsLinked()) {
          if (this.FCaption !== "") this.GetContainer().lastElementChild.innerHTML = this.FCaption;
          this.GetElementHandle().setAttribute("tabindex","-1");
          btn = this.GetElementHandle().firstChild;
          btn.setAttribute("tabindex","-1");
        };
        if (this.FTabStop) this.GetContainer().setAttribute("tabindex",pas.SysUtils.IntToStr(this.FTabOrder));
      };
    };
    this.UpdateElementSize = function () {
      pas["WEBLib.Controls"].TControl.UpdateElementSize.call(this);
      if ((this.GetContainer() != null) && !this.GetIsLinked() && (this.FElementPosition === pas["WEBLib.Controls"].TElementPosition.epAbsolute)) {
        if (this.FHeightStyle !== pas["WEBLib.Controls"].TSizeStyle.ssAuto) {
          this.GetContainer().firstElementChild.style.setProperty("height","100%")}
         else this.GetContainer().firstElementChild.style.removeProperty("height");
      };
    };
    this.UpdateElementVisual = function () {
      var btn = null;
      var lbl = null;
      var frm = null;
      var isbs = false;
      pas["WEBLib.Controls"].TCustomControl.UpdateElementVisual.call(this);
      if (this.GetElementHandle() != null) {
        btn = this.GetElementHandle().firstChild;
        if (btn != null) {
          if (btn.style != null) btn.style.setProperty("margin-right","4px");
          if (this.FElementClassName === "") {
            btn.style.setProperty("vertical-align","middle");
            btn.style.setProperty("margin-top","0px");
          };
          if (this.FElementButtonClassName !== "") {
            btn.setAttribute("class",this.FElementButtonClassName)}
           else btn.removeAttribute("class");
        };
        lbl = this.GetElementHandle().lastElementChild;
        if (lbl != null) {
          if (this.FElementLabelClassName !== "") {
            lbl.setAttribute("class",this.FElementLabelClassName)}
           else lbl.removeAttribute("class");
        };
        if (!this.FTabStop || !this.FShowFocus || (this.FElementClassName !== "")) this.GetElementHandle().style.setProperty("outline","none");
        if (!this.GetIsLinked()) {
          this.GetElementHandle().style.setProperty("user-select","none");
          if (this.FElementPosition === pas["WEBLib.Controls"].TElementPosition.epAbsolute) {
            if (this.FElementButtonClassName === "") {
              if (this.FAlignment === pas.Classes.TAlignment.taRightJustify) {
                btn.style.removeProperty("float");
              } else {
                btn.style.setProperty("float","right");
              };
              if (this.FHeightStyle === pas["WEBLib.Controls"].TSizeStyle.ssAuto) {
                btn.style.removeProperty("height")}
               else if (this.FElementPosition === pas["WEBLib.Controls"].TElementPosition.epAbsolute) btn.style.setProperty("height","100%");
              btn.style.setProperty("vertical-align","middle");
              if (!$mod.TCheckGroup.isPrototypeOf(this.FParent)) {
                btn.style.setProperty("margin-top","0px");
                btn.style.setProperty("margin-bottom","0px");
              };
            };
            frm = pas["WEBLib.Forms"].GetParentForm(this);
            isbs = (frm != null) && (frm.FCSSLibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap);
            if ((this.FElementLabelClassName === "") || isbs) {
              lbl = this.GetContainer().lastElementChild;
              lbl.style.setProperty("vertical-align","middle");
              lbl.style.setProperty("min-height","100%");
              lbl.style.setProperty("height","100%");
              lbl.style.setProperty("overflow","hidden");
              lbl.style.setProperty("display","inline-flex");
              lbl.style.setProperty("align-items","center");
            };
          };
        };
      };
    };
    this.PersistinHTML = function () {
      var cb = null;
      if (!(this.GetContainer() != null)) return;
      cb = this.GetCheckElement();
      if (cb.checked) {
        cb.setAttribute("checked","checked")}
       else cb.removeAttribute("checked");
    };
    this.CreateElement = function () {
      var Result = null;
      var btn = null;
      var lbl = null;
      Result = document.createElement("SPAN");
      btn = document.createElement("INPUT");
      lbl = document.createElement("SPAN");
      btn.setAttribute("TYPE","CHECKBOX");
      btn.setAttribute("id",this.GetID() + "ck");
      btn.setAttribute("role","checkbox");
      lbl.setAttribute("id",this.GetID() + "lbl");
      lbl.setAttribute("value",this.GetID());
      Result.appendChild(btn);
      Result.appendChild(lbl);
      rtl.asExt(btn,HTMLInputElement).onclick = rtl.createSafeCallback(this,"HandleCheckClick");
      return Result;
    };
    this.SetChecked = function (AValue) {
      this.FChecked = AValue;
      if (AValue) {
        this.FState = $mod.TCheckBoxState.cbChecked}
       else this.FState = $mod.TCheckBoxState.cbUnchecked;
      this.UpdateElement();
    };
    this.GetChecked = function () {
      var Result = false;
      var el = null;
      if (this.GetContainer() != null) {
        el = this.GetCheckElement();
        if (el != null) this.FChecked = el.checked;
      };
      Result = this.FChecked;
      return Result;
    };
    this.SetState = function (AValue) {
      this.FState = AValue;
      this.FChecked = this.FState === $mod.TCheckBoxState.cbChecked;
      this.UpdateElement();
    };
    this.GetState = function () {
      var Result = 0;
      Result = this.FState;
      return Result;
    };
    this.SetCaption = function (AValue) {
      if (this.FCaption !== AValue) {
        pas["WEBLib.Controls"].TCustomControl.SetCaption.call(this,AValue);
        if (this.GetContainer() != null) {
          if (this.GetIsLinked()) {
            if ((this.GetContainer().lastElementChild != null) && (this.GetContainer().lastElementChild.tagName === "SPAN")) this.GetContainer().lastElementChild.innerHTML = AValue;
          } else if (this.GetContainer().lastElementChild != null) this.GetContainer().lastElementChild.innerHTML = AValue;
        };
      };
    };
    this.SetEnabled = function (Value) {
      var el = null;
      pas["WEBLib.Controls"].TControl.SetEnabled.apply(this,arguments);
      if (this.GetContainer() != null) {
        el = this.GetCheckElement();
        if (el != null) el.disabled = !Value;
      };
    };
    this.HandleLabelClick = function (Event) {
      var Result = false;
      var chk = null;
      if ((this.GetContainer() != null) && this.FEnabled) {
        if (this.FAllowGrayed) {
          if (this.FState === $mod.TCheckBoxState.cbUnchecked) {
            this.FState = $mod.TCheckBoxState.cbGrayed}
           else if (this.FState === $mod.TCheckBoxState.cbGrayed) {
            this.FState = $mod.TCheckBoxState.cbChecked}
           else if (this.FState === $mod.TCheckBoxState.cbChecked) this.FState = $mod.TCheckBoxState.cbUnchecked;
          chk = this.GetCheckElement();
          chk.checked = this.FState === $mod.TCheckBoxState.cbChecked;
          chk.indeterminate = this.FState === $mod.TCheckBoxState.cbGrayed;
        } else {
          chk = this.GetCheckElement();
          chk.checked = !chk.checked;
        };
      };
      this.DoCheckClick();
      Result = true;
      return Result;
    };
    this.HandleCheckClick = function (Event) {
      var Result = false;
      var chk = null;
      if (this.FAllowGrayed && this.FEnabled) {
        if (this.FState === $mod.TCheckBoxState.cbUnchecked) {
          this.FState = $mod.TCheckBoxState.cbGrayed}
         else if (this.FState === $mod.TCheckBoxState.cbGrayed) {
          this.FState = $mod.TCheckBoxState.cbChecked}
         else if (this.FState === $mod.TCheckBoxState.cbChecked) this.FState = $mod.TCheckBoxState.cbUnchecked;
        chk = this.GetCheckElement();
        chk.checked = this.FState === $mod.TCheckBoxState.cbChecked;
        chk.indeterminate = this.FState === $mod.TCheckBoxState.cbGrayed;
      };
      this.DoCheckClick();
      Result = true;
      return Result;
    };
    this.Click = function () {
      pas["WEBLib.Controls"].TControl.Click.call(this);
      if (!this.FAllowGrayed) {
        this.FChecked = this.GetChecked();
        if (this.FChecked) {
          this.FState = $mod.TCheckBoxState.cbChecked}
         else this.FState = $mod.TCheckBoxState.cbUnchecked;
      };
      this.SetFocus();
    };
    this.DoCheckClick = function () {
      if (this.FOnCheckClick != null) this.FOnCheckClick(this);
    };
    this.GetCheckElement = function () {
      var Result = null;
      if (this.GetIsLinked()) {
        if (this.GetElementHandle().tagName === "INPUT") {
          Result = this.GetElementHandle()}
         else Result = this.GetContainer().firstElementChild;
      } else Result = this.GetContainer().firstElementChild;
      return Result;
    };
    this.KeyPress = function (ch) {
      var chk = null;
      pas["WEBLib.Controls"].TControl.KeyPress.apply(this,arguments);
      if (ch.get() === " ") {
        if ((this.GetContainer() != null) && !this.GetIsLinked()) {
          chk = this.GetCheckElement();
          chk.checked = !chk.checked;
        };
      };
    };
    this.LoadState = function (AState) {
      var cb = null;
      if (!(this.GetContainer() != null)) return;
      cb = this.GetCheckElement();
      cb.checked = AState === "1";
    };
    this.SaveState = function () {
      var Result = "";
      var cb = null;
      if (!(this.GetContainer() != null)) return Result;
      cb = this.GetCheckElement();
      if (cb.checked) {
        Result = "1"}
       else Result = "0";
      return Result;
    };
    this.InitCSSLibrary = function (ALibrary) {
      if (ALibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap) {
        this.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
        this.SetElementClassName("custom-control custom-checkbox");
        this.FElementButtonClassName = "custom-control-input";
        this.FElementLabelClassName = "custom-control-label";
        this.SetHeightStyle(pas["WEBLib.Controls"].TSizeStyle.ssAuto);
      };
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.SetColor(-1);
      this.FChecked = false;
      this.FState = $mod.TCheckBoxState.cbUnchecked;
      this.SetAlignment(pas.Classes.TAlignment.taRightJustify);
      if ((pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) && (this.FCaption === "")) this.SetCaption(this.FName);
      this.SetShowFocus(true);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("Alignment",2,pas.Classes.$rtti["TAlignment"],"FAlignment","SetAlignment",4,{Default: pas.Classes.TAlignment.taRightJustify});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("AllowGrayed",0,rtl.boolean,"FAllowGrayed","FAllowGrayed",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("Caption",2,rtl.string,"FCaption","SetCaption");
    $r.addProperty("Checked",3,rtl.boolean,"GetChecked","SetChecked",4,{Default: false});
    $r.addProperty("ChildOrder",2,rtl.longint,"FChildOrder","SetChildOrderEx",4,{Default: 0});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor",4,{Default: -1});
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementButtonClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementButtonClassName","FElementButtonClassName");
    $r.addProperty("ElementLabelClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementLabelClassName","FElementLabelClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Hint",2,rtl.string,"FHint","SetHint");
    $r.addProperty("Left",3,rtl.longint,"GetLeft","SetLeft");
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",4,{Default: true});
    $r.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti["TPopupMenu"],"FPopupMenu","FPopupMenu");
    $r.addProperty("Role",3,rtl.string,"GetRole","SetRole");
    $r.addProperty("ShowFocus",2,rtl.boolean,"FShowFocus","SetShowFocus",4,{Default: false});
    $r.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",4,{Default: false});
    $r.addProperty("State",3,$mod.$rtti["TCheckBoxState"],"GetState","SetState",4,{Default: $mod.TCheckBoxState.cbUnchecked});
    $r.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder");
    $r.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",4,{Default: true});
    $r.addProperty("Top",3,rtl.longint,"GetTop","SetTop");
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnKeyDown",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyDown","FOnKeyDown");
    $r.addProperty("OnKeyPress",0,pas["WEBLib.Controls"].$rtti["TKeyPressEvent"],"FOnKeyPress","FOnKeyPress");
    $r.addProperty("OnKeyUp",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyUp","FOnKeyUp");
    $r.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseDown","FOnMouseDown");
    $r.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseUp","FOnMouseUp");
    $r.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti["TMouseMoveEvent"],"FOnMouseMove","FOnMouseMove");
    $r.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseLeave","FOnMouseLeave");
    $r.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseEnter","FOnMouseEnter");
    $r.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnEnter","FOnEnter");
    $r.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnExit","FOnExit");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
  });
  rtl.createClass(this,"TWebCheckBox",this.TCheckBox,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TRadioButton",pas["WEBLib.Menus"].TWebCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Menus"].TWebCustomControl.$init.call(this);
      this.FChecked = false;
      this.FGroupName = "";
      this.FElementButtonClassName = "";
      this.FElementLabelClassName = "";
    };
    this.PersistinHTML = function () {
      var rb = null;
      if (!(this.GetContainer() != null)) return;
      rb = this.GetRadioElement();
      if (rb.checked) {
        rb.setAttribute("checked","checked")}
       else rb.removeAttribute("checked");
    };
    this.CreateElement = function () {
      var Result = null;
      var btn = null;
      var lbl = null;
      Result = document.createElement("SPAN");
      btn = document.createElement("INPUT");
      lbl = document.createElement("SPAN");
      Result.addEventListener("click",rtl.createSafeCallback(this,"HandleLabelClick"));
      btn.setAttribute("TYPE","RADIO");
      btn.setAttribute("id",this.GetID() + "rd");
      btn.setAttribute("name",this.FGroupName);
      btn.setAttribute("role","radio");
      btn.setAttribute("tabindex","-1");
      btn.addEventListener("click",rtl.createSafeCallback(this,"HandleRadioClick"));
      lbl.setAttribute("id",this.GetID() + "lbl");
      lbl.setAttribute("value",this.GetID());
      Result.appendChild(btn);
      Result.appendChild(lbl);
      return Result;
    };
    this.SetChecked = function (AValue) {
      var el = null;
      this.FChecked = AValue;
      if (this.GetContainer() != null) {
        el = this.GetRadioElement();
        if (el != null) el.checked = AValue;
      };
    };
    this.GetChecked = function () {
      var Result = false;
      var el = null;
      Result = this.FChecked;
      if (this.GetContainer() != null) {
        el = this.GetRadioElement();
        if (el != null) Result = el.checked;
      };
      return Result;
    };
    this.SetEnabled = function (Value) {
      var el = null;
      pas["WEBLib.Controls"].TControl.SetEnabled.apply(this,arguments);
      if (this.GetContainer() != null) {
        el = this.GetRadioElement();
        if (el != null) el.disabled = !Value;
      };
    };
    this.SetCaption = function (AValue) {
      if (this.FCaption !== AValue) {
        pas["WEBLib.Controls"].TCustomControl.SetCaption.call(this,AValue);
        if ((this.GetContainer() != null) && !this.GetIsLinked()) this.GetContainer().lastElementChild.innerHTML = AValue;
      };
    };
    this.SetGroupName = function (AValue) {
      this.FGroupName = AValue;
      this.UpdateElementData();
    };
    this.HandleLabelClick = function (Event) {
      var Result = false;
      var rb = null;
      if ((this.GetContainer() != null) && this.FEnabled) {
        rb = this.GetRadioElement();
        rb.checked = true;
      };
      Result = true;
      return Result;
    };
    this.HandleRadioClick = function (Event) {
      var Result = false;
      this.SetFocus();
      Result = true;
      return Result;
    };
    this.UpdateElementSize = function () {
      pas["WEBLib.Controls"].TControl.UpdateElementSize.call(this);
      if ((this.GetContainer() != null) && !this.GetIsLinked()) {
        if (this.FHeightStyle !== pas["WEBLib.Controls"].TSizeStyle.ssAuto) {
          this.GetContainer().firstElementChild.style.setProperty("height","100%")}
         else this.GetContainer().firstElementChild.style.removeProperty("height");
      };
    };
    this.UpdateElementData = function () {
      var btn = null;
      pas["WEBLib.Controls"].TControl.UpdateElementData.call(this);
      if (this.GetContainer() != null) {
        if (this.GetIsLinked()) {
          this.GetElementHandle().setAttribute("name",this.FGroupName)}
         else {
          this.GetContainer().firstElementChild.setAttribute("name",this.FGroupName);
          btn = this.GetElementHandle().firstChild;
          btn.disabled = !this.FEnabled;
        };
        if (!this.GetIsLinked()) {
          if (this.FCaption !== "") this.GetContainer().lastElementChild.innerHTML = this.FCaption;
          this.GetElementHandle().setAttribute("tabindex","-1");
          if (this.FTabStop && (btn != null)) btn.setAttribute("tabindex","-1");
        };
        if (this.FTabStop) this.GetContainer().setAttribute("tabindex",pas.SysUtils.IntToStr(this.FTabOrder));
      };
    };
    this.UpdateElementVisual = function () {
      var btn = null;
      var lbl = null;
      var isbs = false;
      var frm = null;
      pas["WEBLib.Controls"].TCustomControl.UpdateElementVisual.call(this);
      if (this.GetElementHandle() != null) {
        if (!this.GetIsLinked()) {
          btn = this.GetElementHandle().firstChild;
          btn.style.setProperty("margin-right","4px");
          btn.style.setProperty("vertical-align","middle");
          btn.style.setProperty("margin-top","0px");
          if (btn != null) {
            if (this.FElementButtonClassName !== "") {
              btn.setAttribute("class",this.FElementButtonClassName)}
             else btn.removeAttribute("class");
          };
          lbl = this.GetElementHandle().lastElementChild;
          if (lbl != null) {
            if (this.FElementLabelClassName !== "") {
              lbl.setAttribute("class",this.FElementLabelClassName)}
             else lbl.removeAttribute("class");
          };
        };
        if (!this.FTabStop || !this.FShowFocus || (this.FElementClassName !== "")) this.GetElementHandle().style.setProperty("outline","none");
        if (!this.GetIsLinked()) {
          this.GetElementHandle().style.setProperty("user-select","none");
          this.GetElementHandle().style.setProperty("white-space","normal");
          if (this.FElementPosition === pas["WEBLib.Controls"].TElementPosition.epAbsolute) {
            if (this.FElementButtonClassName === "") {
              if (this.FHeightStyle !== pas["WEBLib.Controls"].TSizeStyle.ssAuto) {
                btn.style.setProperty("height","100%")}
               else btn.style.removeProperty("height");
              btn.style.setProperty("vertical-align","middle");
              if (!$mod.TRadioGroup.isPrototypeOf(this.FParent)) {
                btn.style.setProperty("margin-top","0px");
                btn.style.setProperty("margin-bottom","0px");
              };
            };
            frm = pas["WEBLib.Forms"].GetParentForm(this);
            isbs = (frm != null) && (frm.FCSSLibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap);
            if ((this.FElementLabelClassName === "") || isbs) {
              lbl = this.GetContainer().lastElementChild;
              lbl.style.setProperty("vertical-align","middle");
              lbl.style.setProperty("min-height","100%");
              lbl.style.setProperty("height","100%");
              if (!$mod.TRadioGroup.isPrototypeOf(this.FParent)) lbl.style.setProperty("position","absolute");
              lbl.style.setProperty("overflow","hidden");
              lbl.style.setProperty("display","inline-flex");
              lbl.style.setProperty("align-items","center");
            };
          };
        };
      };
    };
    this.GetRadioElement = function () {
      var Result = null;
      if (this.GetIsLinked()) {
        Result = this.GetElementHandle()}
       else Result = this.GetContainer().firstElementChild;
      return Result;
    };
    this.KeyPress = function (ch) {
      var rb = null;
      pas["WEBLib.Controls"].TControl.KeyPress.apply(this,arguments);
      if (ch.get() === " ") {
        rb = this.GetRadioElement();
        rb.checked = true;
      };
    };
    this.LoadState = function (AState) {
      var rb = null;
      if (!(this.GetContainer() != null)) return;
      rb = this.GetRadioElement();
      rb.checked = AState === "1";
    };
    this.SaveState = function () {
      var Result = "";
      var rb = null;
      if (!(this.GetContainer() != null)) return Result;
      rb = this.GetRadioElement();
      if (rb.checked) {
        Result = "1"}
       else Result = "0";
      return Result;
    };
    this.InitCSSLibrary = function (ALibrary) {
      if (ALibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap) {
        this.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
        this.SetElementClassName("form-control");
        this.SetHeightStyle(pas["WEBLib.Controls"].TSizeStyle.ssAuto);
      };
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.SetColor(-1);
      if ((pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) && (this.FCaption === "")) this.SetCaption(this.FName);
      this.FGroupName = "";
      this.SetShowFocus(true);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("Caption",2,rtl.string,"FCaption","SetCaption");
    $r.addProperty("Checked",3,rtl.boolean,"GetChecked","SetChecked",4,{Default: false});
    $r.addProperty("ChildOrder",2,rtl.longint,"FChildOrder","SetChildOrderEx",4,{Default: 0});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor",4,{Default: -1});
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementButtonClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementButtonClassName","FElementButtonClassName");
    $r.addProperty("ElementLabelClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementLabelClassName","FElementLabelClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("GroupName",2,rtl.string,"FGroupName","SetGroupName");
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Hint",2,rtl.string,"FHint","SetHint");
    $r.addProperty("Left",3,rtl.longint,"GetLeft","SetLeft");
    $r.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",4,{Default: true});
    $r.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti["TPopupMenu"],"FPopupMenu","FPopupMenu");
    $r.addProperty("Role",3,rtl.string,"GetRole","SetRole");
    $r.addProperty("ShowFocus",2,rtl.boolean,"FShowFocus","SetShowFocus",4,{Default: false});
    $r.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",4,{Default: false});
    $r.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder");
    $r.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",4,{Default: true});
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnKeyDown",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyDown","FOnKeyDown");
    $r.addProperty("OnKeyPress",0,pas["WEBLib.Controls"].$rtti["TKeyPressEvent"],"FOnKeyPress","FOnKeyPress");
    $r.addProperty("OnKeyUp",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyUp","FOnKeyUp");
    $r.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseDown","FOnMouseDown");
    $r.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseUp","FOnMouseUp");
    $r.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti["TMouseMoveEvent"],"FOnMouseMove","FOnMouseMove");
    $r.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseLeave","FOnMouseLeave");
    $r.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseEnter","FOnMouseEnter");
    $r.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnEnter","FOnEnter");
    $r.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnExit","FOnExit");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
  });
  rtl.createClass(this,"TWebRadioButton",this.TRadioButton,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TListBox",pas["WEBLib.Menus"].TWebCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Menus"].TWebCustomControl.$init.call(this);
      this.FItems = null;
      this.FItemIndex = 0;
      this.FMultiSelect = false;
      this.FSelected = null;
      this.FItemHeight = 0;
      this.FSorted = false;
      this.FOnChange = null;
      this.FHandleChangePtr = null;
      this.FElementItemClassName = "";
    };
    this.$final = function () {
      this.FItems = undefined;
      this.FSelected = undefined;
      this.FOnChange = undefined;
      pas["WEBLib.Menus"].TWebCustomControl.$final.call(this);
    };
    this.SetItemHeight = function (Value) {
      this.FItemHeight = Value;
    };
    this.SetSorted = function (Value) {
      this.FSorted = Value;
      this.FItems.SetSorted(Value);
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FItems.GetCount();
      return Result;
    };
    this.GetElementSelectHandle = function () {
      var Result = null;
      Result = this.GetContainer();
      return Result;
    };
    this.GetSelCount = function () {
      var Result = 0;
      var i = 0;
      Result = 0;
      if (this.GetContainer() != null) {
        for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
          i = $l;
          if (this.GetContainer().options.item(i).selected) Result += 1;
        };
      };
      return Result;
    };
    this.GetValues = function (AIndex) {
      var Result = "";
      var opt = null;
      var el = null;
      if ((AIndex >= 0) && (AIndex < this.FItems.GetCount())) {
        el = this.GetElementHandle();
        opt = el.options.item(AIndex);
        Result = opt.getAttribute("value");
      };
      return Result;
    };
    this.SetValues = function (AIndex, Value) {
      var opt = null;
      var el = null;
      if ((AIndex >= 0) && (AIndex < this.FItems.GetCount())) {
        el = this.GetElementHandle();
        opt = el.options.item(AIndex);
        opt.setAttribute("value",Value);
      };
    };
    this.DoHandleChange = function (Event) {
      var Result = false;
      this.Change();
      Result = true;
      return Result;
    };
    this.DoItemsChange = function (Sender) {
      this.DoUpdateList();
    };
    this.DoUpdateList = function () {
      var i = 0;
      var j = 0;
      var opt = null;
      var k = "";
      var v = "";
      var s = "";
      if (!(this.GetContainer() != null)) return;
      if (this.IsUpdating()) return;
      if (this.GetElementHandle().tagName !== "SELECT") return;
      for (var $l = this.GetContainer().options.length - 1; $l >= 0; $l--) {
        i = $l;
        this.GetContainer().remove(i);
      };
      for (var $l1 = 0, $end = this.FItems.GetCount() - 1; $l1 <= $end; $l1++) {
        i = $l1;
        s = this.FItems.Get(i);
        k = s;
        v = s;
        j = pas.System.Pos(this.FItems.GetNameValueSeparator(),s);
        if (j > 0) {
          v = pas.System.Copy(s,1,j - 1);
          k = pas.System.Copy(s,j + 1,0xFFFF);
        } else k = "";
        opt = new Option(v);
        if (k !== "") opt.setAttribute("value",k);
        opt.setAttribute("role","listitem");
        if (this.FElementItemClassName !== "") opt.setAttribute("class",this.FElementItemClassName);
        if (this.FDragMode === pas["WEBLib.Controls"].TDragMode.dmAutomatic) opt.setAttribute("draggable","true");
        this.GetContainer().add(opt);
      };
      this.UpdateElementData();
    };
    this.PersistinHTML = function () {
      var i = 0;
      if (!(this.GetContainer() != null)) return;
      if (this.GetElementHandle().tagName !== "SELECT") return;
      for (var $l = 0, $end = this.GetContainer().options.length - 1; $l <= $end; $l++) {
        i = $l;
        if (this.GetContainer().options.item(i).selected) {
          this.GetContainer().options.item(i).setAttribute("selected","selected")}
         else this.GetContainer().options.item(i).removeAttribute("selected");
      };
    };
    this.GetItemIndex = function () {
      var Result = 0;
      Result = this.FItemIndex;
      if (this.GetContainer() != null) Result = this.GetContainer().selectedIndex;
      return Result;
    };
    this.CreateElement = function () {
      var Result = null;
      Result = document.createElement("SELECT");
      Result.setAttribute("Size","2");
      return Result;
    };
    this.GetSelected = function (AIndex) {
      var Result = false;
      if (AIndex < this.FSelected.GetCount()) {
        Result = !(this.FSelected.Get(AIndex) == false)}
       else Result = false;
      if (this.GetElementHandle().tagName !== "SELECT") return Result;
      if ((this.GetContainer() != null) && (AIndex < this.GetContainer().options.length)) Result = this.GetContainer().options.item(AIndex).selected;
      return Result;
    };
    this.SetSelected = function (AIndex, AValue) {
      while (AIndex >= this.FSelected.GetCount()) this.FSelected.Add(false);
      this.FSelected.Put(AIndex,AValue);
      if (this.GetContainer() != null) {
        this.GetContainer().options.item(AIndex).selected = AValue;
      };
    };
    this.SetItems = function (AItems) {
      this.FItems.Assign(AItems);
    };
    this.SetItemIndex = function (AIndex) {
      if (this.FItemIndex !== AIndex) {
        this.FItemIndex = AIndex;
        this.UpdateElement();
      };
    };
    this.SetMultiSelect = function (AValue) {
      this.FMultiSelect = AValue;
      if (this.GetContainer() != null) this.GetContainer().multiple = AValue;
    };
    this.Loaded = function () {
      pas["WEBLib.Controls"].TCustomControl.Loaded.call(this);
      this.DoUpdateList();
      this.UpdateElement();
    };
    this.UpdateElementData = function () {
      var i = 0;
      var b = false;
      pas["WEBLib.Controls"].TControl.UpdateElementData.call(this);
      if (this.GetElementSelectHandle() != null) {
        this.GetElementSelectHandle().style.setProperty("overflow","auto");
        if (!this.FMultiSelect) {
          this.GetElementSelectHandle().selectedIndex = this.FItemIndex}
         else {
          for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
            i = $l;
            if (this.FSelected.GetCount() > i) {
              b = !(this.FSelected.Get(i) == false);
              if (this.GetContainer() != null) this.GetContainer().options.item(i).selected = b;
            };
          };
        };
      };
    };
    this.UpdateElementVisual = function () {
      pas["WEBLib.Controls"].TCustomControl.UpdateElementVisual.call(this);
      if (this.GetElementSelectHandle() != null) {
        this.GetElementSelectHandle().style.setProperty("overflow","auto");
        this.GetElementSelectHandle().setAttribute("role","listbox");
        this.GetElementSelectHandle().setAttribute("aria-busy","true");
      };
    };
    this.UpdateParent = function () {
      pas["WEBLib.Controls"].TControl.UpdateParent.call(this);
      this.DoUpdateList();
    };
    this.BindEvents = function () {
      pas["WEBLib.Controls"].TCustomControl.BindEvents.call(this);
      if (this.GetElementHandle() != null) {
        this.GetElementHandle().addEventListener("change",this.FHandleChangePtr);
      };
    };
    this.UnbindEvents = function () {
      pas["WEBLib.Controls"].TControl.UnbindEvents.call(this);
      if (this.GetElementHandle() != null) {
        this.GetElementHandle().removeEventListener("change",this.FHandleChangePtr);
      };
    };
    this.Change = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.SaveState = function () {
      var Result = "";
      var i = 0;
      var s = "";
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.GetSelected(i)) {
          s = s + ",1"}
         else s = s + ",0";
      };
      pas.System.Delete({get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},1,1);
      Result = s;
      return Result;
    };
    this.LoadState = function (AState) {
      var sl = null;
      var i = 0;
      sl = pas.Classes.TStringList.$create("Create$1");
      sl.SetDelimiter(",");
      sl.SetCommaText(AState);
      for (var $l = 0, $end = sl.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        this.SetSelected(i,sl.Get(i) === "1");
      };
      sl = rtl.freeLoc(sl);
    };
    this.EnableDrag = function () {
      var I = 0;
      if (!(this.GetContainer() != null)) return;
      for (var $l = 0, $end = this.GetContainer().options.length - 1; $l <= $end; $l++) {
        I = $l;
        this.GetContainer().options.item(I).setAttribute("draggable","true");
      };
    };
    this.DisableDrag = function () {
      var I = 0;
      if (!(this.GetContainer() != null)) return;
      for (var $l = 0, $end = this.GetContainer().options.length - 1; $l <= $end; $l++) {
        I = $l;
        this.GetContainer().options.item(I).setAttribute("draggable","false");
      };
    };
    this.ClearMethodPointers = function () {
      pas["WEBLib.Controls"].TControl.ClearMethodPointers.call(this);
      this.FHandleChangePtr = null;
    };
    this.GetMethodPointers = function () {
      pas["WEBLib.Controls"].TControl.GetMethodPointers.call(this);
      this.FHandleChangePtr = rtl.createCallback(this,"DoHandleChange");
    };
    this.InitCSSLibrary = function (ALibrary) {
      if (ALibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap) {
        this.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
        this.SetElementClassName("form-control");
      };
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.FItems = pas.Classes.TStringList.$create("Create$1");
      this.FItems.SetSkipLastLineBreak(true);
      this.FItems.FOnChange = rtl.createCallback(this,"DoItemsChange");
      this.FMultiSelect = false;
      this.FSelected = pas.Classes.TList.$create("Create$1");
      this.FItemIndex = -1;
      this.SetShowFocus(true);
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        this.SetWidth(160);
        this.SetHeight(180);
      };
    };
    this.Destroy = function () {
      rtl.free(this,"FItems");
      rtl.free(this,"FSelected");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.EndUpdate = function () {
      pas["WEBLib.Controls"].TCustomControl.EndUpdate.call(this);
      this.DoUpdateList();
    };
    this.ClearSelection = function () {
      var i = 0;
      this.SetItemIndex(-1);
      if (!(this.GetContainer() != null)) return;
      if (this.GetElementHandle().tagName !== "SELECT") return;
      for (var $l = 0, $end = this.GetContainer().options.length - 1; $l <= $end; $l++) {
        i = $l;
        this.GetContainer().options.item(i).selected = false;
      };
    };
    this.SelectAll = function () {
      var i = 0;
      if (!(this.GetContainer() != null)) return;
      if (this.GetElementHandle().tagName !== "SELECT") return;
      for (var $l = 0, $end = this.GetContainer().options.length - 1; $l <= $end; $l++) {
        i = $l;
        this.SetSelected(i,true);
        this.GetContainer().options.item(i).selected = true;
      };
    };
    this.DeleteSelected = function () {
      var i = 0;
      this.FItems.BeginUpdate();
      for (var $l = this.FItems.GetCount() - 1; $l >= 0; $l--) {
        i = $l;
        if (this.GetSelected(i)) this.FItems.Delete(i);
      };
      this.FItems.EndUpdate();
    };
    this.AddItem = function (Item, AObject) {
      this.FItems.AddObject(Item,AObject);
    };
    this.Clear = function () {
      this.BeginUpdate();
      this.FItems.Clear();
      this.EndUpdate();
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("BiDiMode",2,pas["WEBLib.Controls"].$rtti["TBiDiMode"],"FBiDiMode","SetBiDiMode",4,{Default: pas["WEBLib.Controls"].TBiDiMode.bdLeftToRight});
    $r.addProperty("BorderStyle",2,pas["WEBLib.Controls"].$rtti["TBorderStyle"],"FBorderStyle","SetBorderStyle",4,{Default: pas["WEBLib.Controls"].TBorderStyle.bsSingle});
    $r.addProperty("ChildOrder",2,rtl.longint,"FChildOrder","SetChildOrderEx",4,{Default: 0});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor");
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementItemClassName",0,rtl.string,"FElementItemClassName","FElementItemClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Hint",2,rtl.string,"FHint","SetHint");
    $r.addProperty("ItemHeight",2,rtl.longint,"FItemHeight","SetItemHeight");
    $r.addProperty("ItemIndex",3,rtl.longint,"GetItemIndex","SetItemIndex",4,{Default: -1});
    $r.addProperty("Items",2,pas.Classes.$rtti["TStrings"],"FItems","SetItems");
    $r.addProperty("Left",3,rtl.longint,"GetLeft","SetLeft");
    $r.addProperty("MultiSelect",2,rtl.boolean,"FMultiSelect","SetMultiSelect");
    $r.addProperty("ParentColor",2,rtl.boolean,"FParentColor","SetParentColor",4,{Default: false});
    $r.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",4,{Default: true});
    $r.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti["TPopupMenu"],"FPopupMenu","FPopupMenu");
    $r.addProperty("Role",3,rtl.string,"GetRole","SetRole");
    $r.addProperty("ShowFocus",2,rtl.boolean,"FShowFocus","SetShowFocus",4,{Default: false});
    $r.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",4,{Default: false});
    $r.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder");
    $r.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",4,{Default: true});
    $r.addProperty("TextDirection",0,pas["WEBLib.Controls"].$rtti["TTextDirection"],"FTextDirection","FTextDirection",4,{Default: pas["WEBLib.Controls"].TTextDirection.tdDefault});
    $r.addProperty("Top",3,rtl.longint,"GetTop","SetTop");
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChange","FOnChange");
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnKeyDown",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyDown","FOnKeyDown");
    $r.addProperty("OnKeyPress",0,pas["WEBLib.Controls"].$rtti["TKeyPressEvent"],"FOnKeyPress","FOnKeyPress");
    $r.addProperty("OnKeyUp",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyUp","FOnKeyUp");
    $r.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseDown","FOnMouseDown");
    $r.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseUp","FOnMouseUp");
    $r.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti["TMouseMoveEvent"],"FOnMouseMove","FOnMouseMove");
    $r.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseLeave","FOnMouseLeave");
    $r.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseEnter","FOnMouseEnter");
    $r.addProperty("OnMouseWheel",0,pas["WEBLib.Controls"].$rtti["TMouseWheelEvent"],"FOnMouseWheel","FOnMouseWheel");
    $r.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnEnter","FOnEnter");
    $r.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnExit","FOnExit");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
  });
  rtl.createClass(this,"TWebListBox",this.TListBox,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.TComboBoxStyle = {"0": "csDropDownList", csDropDownList: 0, "1": "csDropDown", csDropDown: 1};
  this.$rtti.$Enum("TComboBoxStyle",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TComboBoxStyle});
  rtl.createClass(this,"TCustomComboBox",pas["WEBLib.Menus"].TWebCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Menus"].TWebCustomControl.$init.call(this);
      this.FItems = null;
      this.FItemIndex = 0;
      this.FStyle = 0;
      this.FDroppedDown = false;
      this.FOnChange = null;
      this.FTextHint = "";
      this.FListName = "";
      this.FText = "";
      this.FHandleChangePtr = null;
      this.FHandleInputPtr = null;
      this.FHandleFocusInPtr = null;
      this.FHandleFocusOutPtr = null;
      this.FOnFocusOut = null;
      this.FOnFocusIn = null;
      this.FRequired = false;
      this.FRequiredText = "";
      this.FHandleInvalidPtr = null;
      this.FSorted = false;
    };
    this.$final = function () {
      this.FItems = undefined;
      this.FOnChange = undefined;
      this.FOnFocusOut = undefined;
      this.FOnFocusIn = undefined;
      pas["WEBLib.Menus"].TWebCustomControl.$final.call(this);
    };
    this.GetText = function () {
      var Result = "";
      var el = null;
      var AName = "";
      var AValue = "";
      Result = "";
      if (this.FStyle === $mod.TComboBoxStyle.csDropDown) {
        if (this.GetElementHandle() != null) Result = this.GetElementHandle().value;
      } else if (this.GetItemIndex() >= 0) {
        if (this.GetItemIndex() < this.FItems.GetCount()) {
          this.FItems.GetNameValue(this.GetItemIndex(),{get: function () {
              return AName;
            }, set: function (v) {
              AName = v;
            }},{get: function () {
              return AValue;
            }, set: function (v) {
              AValue = v;
            }});
          if ((AName !== "") && (AValue !== "")) {
            Result = AName}
           else Result = this.FItems.Get(this.GetItemIndex());
        } else {
          if (this.GetIsLinked()) {
            if (this.GetItemIndex() < this.GetElementHandle().childElementCount) {
              el = this.GetElementHandle().children.item(this.GetItemIndex());
              if (el.tagName === "OPTION") Result = el.innerHTML;
            };
          };
        };
      };
      return Result;
    };
    this.SetText = function (Value) {
      var I = 0;
      var AName = "";
      var AValue = "";
      if (this.FStyle === $mod.TComboBoxStyle.csDropDown) {
        this.FText = Value;
        this.UpdateElement();
      } else {
        for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          this.FItems.GetNameValue(I,{get: function () {
              return AName;
            }, set: function (v) {
              AName = v;
            }},{get: function () {
              return AValue;
            }, set: function (v) {
              AValue = v;
            }});
          if ((Value === this.FItems.Get(I)) || (Value === AName)) this.SetItemIndex(I);
        };
      };
    };
    this.SetStyle = function (Value) {
      if (this.FStyle !== Value) {
        this.FStyle = Value;
        if (!this.GetIsLinked()) this.RecreateElement();
      };
    };
    this.SetDroppedDown = function (Value) {
      this.FDroppedDown = Value;
    };
    this.GetElementSelectHandle = function () {
      var Result = null;
      Result = this.GetContainer();
      return Result;
    };
    this.SetTextHint = function (Value) {
      if (this.FTextHint !== Value) {
        this.FTextHint = Value;
        this.DoUpdateList();
      };
    };
    this.GetValues = function (AIndex) {
      var Result = "";
      var opt = null;
      var el = null;
      if ((AIndex >= 0) && (AIndex < this.FItems.GetCount())) {
        el = this.GetElementHandle();
        opt = el.options.item(AIndex);
        Result = opt.getAttribute("value");
      };
      return Result;
    };
    this.SetValues = function (AIndex, Value) {
      var opt = null;
      var el = null;
      if ((AIndex >= 0) && (AIndex < this.FItems.GetCount())) {
        el = this.GetElementHandle();
        opt = el.options.item(AIndex);
        opt.setAttribute("value",Value);
      };
    };
    this.SetRequired = function (Value) {
      if (this.FRequired !== Value) {
        this.FRequired = Value;
        this.UpdateElement();
      };
    };
    this.SetSorted = function (Value) {
      this.FItems.SetSorted(true);
      this.FSorted = Value;
    };
    this.DoHandleChange = function (Event) {
      var Result = false;
      this.Change();
      Result = true;
      if (this.FRequiredText !== "") {
        this.GetElementHandle().setCustomValidity("");
      };
      Result = true;
      return Result;
    };
    this.DoHandleInput = function (Event) {
      var Result = false;
      if (this.FStyle === $mod.TComboBoxStyle.csDropDown) this.Change();
      Result = true;
      return Result;
    };
    this.DoHandleFocusIn = function (Event) {
      var Result = false;
      if (this.FOnFocusIn != null) this.FOnFocusIn(this);
      Result = true;
      return Result;
    };
    this.DoHandleFocusOut = function (Event) {
      var Result = false;
      if (this.FOnFocusOut != null) this.FOnFocusOut(this);
      Result = true;
      return Result;
    };
    this.DoHandleInvalid = function (Event) {
      var Result = false;
      this.GetElementHandle().setCustomValidity(this.FRequiredText);
      Result = true;
      return Result;
    };
    this.DoItemsChange = function (Sender) {
      this.DoUpdateList();
    };
    this.ClearMethodPointers = function () {
      pas["WEBLib.Controls"].TControl.ClearMethodPointers.call(this);
      this.FHandleChangePtr = null;
      this.FHandleInputPtr = null;
      this.FHandleInvalidPtr = null;
    };
    this.GetMethodPointers = function () {
      pas["WEBLib.Controls"].TControl.GetMethodPointers.call(this);
      this.FHandleChangePtr = rtl.createCallback(this,"DoHandleChange");
      this.FHandleInputPtr = rtl.createCallback(this,"DoHandleInput");
      this.FHandleFocusInPtr = rtl.createCallback(this,"DoHandleFocusIn");
      this.FHandleFocusOutPtr = rtl.createCallback(this,"DoHandleFocusOut");
      this.FHandleInvalidPtr = rtl.createCallback(this,"DoHandleInvalid");
    };
    this.AddTextHint = function () {
      var opt = null;
      if ((this.FTextHint !== "") && (this.FStyle === $mod.TComboBoxStyle.csDropDownList)) {
        opt = document.createElement("OPTION");
        opt.setAttribute("value","");
        opt.setAttribute("disabled","true");
        opt.setAttribute("selected","true");
        opt.setAttribute("hidden","true");
        opt.innerHTML = this.FTextHint;
        this.GetContainer().appendChild(opt);
      };
    };
    this.DoUpdateList = function () {
      var i = 0;
      var j = 0;
      var s = "";
      var k = "";
      var v = "";
      var opt = null;
      var el = null;
      if (!(this.GetContainer() != null)) return;
      if (this.GetElementHandle().tagName === "INPUT") {
        this.GetElementHandle().value = this.GetText();
        el = document.getElementById(this.FName + "_LIST");
        if (el != null) el.parentNode.removeChild(el);
        if (this.FTextHint !== "") this.GetElementHandle().placeholder = this.FTextHint;
        el = document.createElement("DATALIST");
        el.setAttribute("id",this.FListName);
        document.body.appendChild(el);
        for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
          i = $l;
          s = this.FItems.Get(i);
          opt = document.createElement("OPTION");
          k = s;
          v = s;
          j = pas.System.Pos(this.FItems.GetNameValueSeparator(),s);
          if (j > 0) {
            v = pas.System.Copy(s,1,j - 1);
            k = pas.System.Copy(s,j + 1,0xFFFF);
          };
          opt.setAttribute("value",k);
          opt.innerHTML = v;
          el.appendChild(opt);
        };
      } else {
        if (this.GetElementHandle().tagName !== "SELECT") return;
        for (var $l1 = this.GetContainer().options.length - 1; $l1 >= 0; $l1--) {
          i = $l1;
          this.GetContainer().remove(i);
        };
        this.AddTextHint();
        for (var $l2 = 0, $end1 = this.FItems.GetCount() - 1; $l2 <= $end1; $l2++) {
          i = $l2;
          s = this.FItems.Get(i);
          opt = document.createElement("OPTION");
          k = s;
          v = s;
          j = pas.System.Pos(this.FItems.GetNameValueSeparator(),s);
          if (j > 0) {
            v = pas.System.Copy(s,1,j - 1);
            k = pas.System.Copy(s,j + 1,0xFFFF);
          };
          opt.setAttribute("value",k);
          opt.innerHTML = v;
          this.GetContainer().appendChild(opt);
        };
      };
      this.UpdateElement();
    };
    this.LoadState = function (AState) {
      var idx = 0;
      var e = 0;
      pas.System.val$6(AState,{get: function () {
          return idx;
        }, set: function (v) {
          idx = v;
        }},{get: function () {
          return e;
        }, set: function (v) {
          e = v;
        }});
      if (e === 0) this.SetItemIndex(idx);
    };
    this.SaveState = function () {
      var Result = "";
      Result = pas.SysUtils.IntToStr(this.GetItemIndex());
      return Result;
    };
    this.GetItemIndex = function () {
      var Result = 0;
      if (this.FStyle === $mod.TComboBoxStyle.csDropDown) {
        Result = this.FItems.IndexOf(this.FText);
      } else {
        Result = this.FItemIndex;
        if (this.GetContainer() != null) {
          Result = this.GetContainer().selectedIndex;
          if (this.FTextHint !== "") Result = Result - 1;
        };
      };
      return Result;
    };
    this.CreateElement = function () {
      var Result = null;
      if (this.FStyle === $mod.TComboBoxStyle.csDropDownList) {
        Result = document.createElement("SELECT")}
       else {
        Result = document.createElement("INPUT");
        this.FListName = this.FName + "_LIST";
        Result.setAttribute("list",this.FListName);
      };
      return Result;
    };
    this.BindEvents = function () {
      pas["WEBLib.Controls"].TCustomControl.BindEvents.call(this);
      if (this.GetElementHandle() != null) {
        this.GetElementHandle().addEventListener("input",this.FHandleInputPtr);
        this.GetElementHandle().addEventListener("change",this.FHandleChangePtr);
        this.GetElementHandle().addEventListener("focusin",this.FHandleFocusInPtr);
        this.GetElementHandle().addEventListener("focusout",this.FHandleFocusOutPtr);
        this.GetElementHandle().addEventListener("invalid",this.FHandleInvalidPtr);
      };
    };
    this.UnbindEvents = function () {
      pas["WEBLib.Controls"].TControl.UnbindEvents.call(this);
      if (this.GetElementHandle() != null) {
        this.GetElementHandle().removeEventListener("input",this.FHandleInputPtr);
        this.GetElementHandle().removeEventListener("change",this.FHandleChangePtr);
        this.GetElementHandle().removeEventListener("focusin",this.FHandleFocusInPtr);
        this.GetElementHandle().removeEventListener("focusout",this.FHandleFocusOutPtr);
        this.GetElementHandle().removeEventListener("invalid",this.FHandleInvalidPtr);
      };
    };
    this.UpdateElementData = function () {
      var d = 0;
      pas["WEBLib.Controls"].TControl.UpdateElementData.call(this);
      if (this.FRequired) {
        this.GetElementHandle().setAttribute("required","")}
       else if (!this.GetIsLinked()) this.GetElementHandle().removeAttribute("required");
      if (this.FStyle === $mod.TComboBoxStyle.csDropDown) {
        if (this.GetElementHandle() != null) {
          this.GetElementHandle().value = this.FText;
          this.FListName = this.FName + "_LIST";
          this.GetElementHandle().setAttribute("list",this.FListName);
        };
      } else if (this.GetElementSelectHandle() != null) {
        d = 0;
        if (this.FTextHint !== "") d = 1;
        this.GetElementSelectHandle().selectedIndex = this.FItemIndex + d;
        this.GetElementSelectHandle().setAttribute("role","combobox");
      };
    };
    this.UpdateElementVisual = function () {
      pas["WEBLib.Controls"].TCustomControl.UpdateElementVisual.call(this);
    };
    this.UpdateParent = function () {
      pas["WEBLib.Controls"].TControl.UpdateParent.call(this);
      this.DoUpdateList();
    };
    this.SetItems = function (AItems) {
      this.FItems.Assign(AItems);
    };
    this.SetItemIndex = function (AIndex) {
      if (this.FItemIndex !== AIndex) {
        this.FItemIndex = AIndex;
        if ((AIndex >= 0) && (this.FStyle in rtl.createSet($mod.TComboBoxStyle.csDropDown,$mod.TComboBoxStyle.csDropDownList)) && (AIndex < this.FItems.GetCount())) this.FText = this.FItems.Get(AIndex);
        this.UpdateElement();
      };
    };
    this.Loaded = function () {
      pas["WEBLib.Controls"].TCustomControl.Loaded.call(this);
      this.DoUpdateList();
    };
    this.Change = function () {
      this.FItemIndex = this.GetItemIndex();
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.PersistinHTML = function () {
      var sel = null;
      pas["WEBLib.Controls"].TControl.PersistinHTML.call(this);
      sel = this.GetElementHandle().children.item(this.GetItemIndex());
      if (sel != null) sel.setAttribute("selected","selected");
    };
    this.InitCSSLibrary = function (ALibrary) {
      if (ALibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap) {
        this.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
        this.SetElementClassName("form-select");
        this.SetHeightStyle(pas["WEBLib.Controls"].TSizeStyle.ssAuto);
      };
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.FItems = pas.Classes.TStringList.$create("Create$1");
      this.FItems.FOnChange = rtl.createCallback(this,"DoItemsChange");
      this.FItemIndex = -1;
      this.FStyle = $mod.TComboBoxStyle.csDropDownList;
      this.SetShowFocus(true);
      this.SetHeight(25);
    };
    this.Destroy = function () {
      rtl.free(this,"FItems");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.Clear = function () {
      this.FItems.Clear();
    };
    this.AddItem = function (Item, AObject) {
      this.FItems.AddObject(Item,AObject);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TComboBox",this.TCustomComboBox,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("BiDiMode",2,pas["WEBLib.Controls"].$rtti["TBiDiMode"],"FBiDiMode","SetBiDiMode",4,{Default: pas["WEBLib.Controls"].TBiDiMode.bdLeftToRight});
    $r.addProperty("BorderStyle",2,pas["WEBLib.Controls"].$rtti["TBorderStyle"],"FBorderStyle","SetBorderStyle",4,{Default: pas["WEBLib.Controls"].TBorderStyle.bsSingle});
    $r.addProperty("ChildOrder",2,rtl.longint,"FChildOrder","SetChildOrderEx",4,{Default: 0});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor");
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Hint",2,rtl.string,"FHint","SetHint");
    $r.addProperty("ItemIndex",3,rtl.longint,"GetItemIndex","SetItemIndex",4,{Default: -1});
    $r.addProperty("Items",2,pas.Classes.$rtti["TStrings"],"FItems","SetItems");
    $r.addProperty("Left",3,rtl.longint,"GetLeft","SetLeft");
    $r.addProperty("OnFocusIn",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnFocusIn","FOnFocusIn");
    $r.addProperty("OnFocusOut",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnFocusOut","FOnFocusOut");
    $r.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",4,{Default: true});
    $r.addProperty("Required",2,rtl.boolean,"FRequired","SetRequired",4,{Default: false});
    $r.addProperty("RequiredText",0,rtl.string,"FRequiredText","FRequiredText");
    $r.addProperty("Role",3,rtl.string,"GetRole","SetRole");
    $r.addProperty("ShowFocus",2,rtl.boolean,"FShowFocus","SetShowFocus",4,{Default: false});
    $r.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",4,{Default: false});
    $r.addProperty("Style",2,$mod.$rtti["TComboBoxStyle"],"FStyle","SetStyle");
    $r.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder");
    $r.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",4,{Default: true});
    $r.addProperty("Text",3,rtl.string,"GetText","SetText");
    $r.addProperty("TextDirection",0,pas["WEBLib.Controls"].$rtti["TTextDirection"],"FTextDirection","FTextDirection",4,{Default: pas["WEBLib.Controls"].TTextDirection.tdDefault});
    $r.addProperty("TextHint",2,rtl.string,"FTextHint","SetTextHint");
    $r.addProperty("Top",3,rtl.longint,"GetTop","SetTop");
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChange","FOnChange");
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnKeyDown",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyDown","FOnKeyDown");
    $r.addProperty("OnKeyPress",0,pas["WEBLib.Controls"].$rtti["TKeyPressEvent"],"FOnKeyPress","FOnKeyPress");
    $r.addProperty("OnKeyUp",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyUp","FOnKeyUp");
    $r.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseDown","FOnMouseDown");
    $r.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseUp","FOnMouseUp");
    $r.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti["TMouseMoveEvent"],"FOnMouseMove","FOnMouseMove");
    $r.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseLeave","FOnMouseLeave");
    $r.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseEnter","FOnMouseEnter");
    $r.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnEnter","FOnEnter");
    $r.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnExit","FOnExit");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
  });
  rtl.createClass(this,"TWebComboBox",this.TComboBox,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TFontPicker",this.TCustomComboBox,function () {
    this.CreateInitialize = function () {
      var $Self = this;
      var tst = false;
      function Add(s) {
        tst = d.detect(s);
        if (tst) $Self.FItems.Add(s);
      };
      $mod.TCustomComboBox.CreateInitialize.call(this);
      var Detector = function() {
          // a font will be compared against all the three default fonts.
          // and if it doesn't match all 3 then that font is not available.
          var baseFonts = ['monospace', 'sans-serif', 'serif'];
      
          //we use m or w because these two characters take up the maximum width.
          // And we use a LLi so that the same matching fonts can get separated
          var testString = "mmmmmmmmmmlli";
      
          //we test using 72px font size, we may use any size. I guess larger the better.
          var testSize = '72px';
      
          var h = document.getElementsByTagName("body")[0];
      
          // create a SPAN in the document to get the width of the text we use to test
          var s = document.createElement("span");
          s.style.fontSize = testSize;
          s.innerHTML = testString;
          var defaultWidth = {};
          var defaultHeight = {};
          for (var index in baseFonts) {
              //get the default width for the three base fonts
              s.style.fontFamily = baseFonts[index];
              h.appendChild(s);
              defaultWidth[baseFonts[index]] = s.offsetWidth; //width for the default font
              defaultHeight[baseFonts[index]] = s.offsetHeight; //height for the defualt font
              h.removeChild(s);
          }
      
          function detect(font) {
              var detected = false;
              for (var index in baseFonts) {
                  s.style.fontFamily = font + ',' + baseFonts[index]; // name of the font along with the base font for fallback.
                  h.appendChild(s);
                  var matched = (s.offsetWidth != defaultWidth[baseFonts[index]] || s.offsetHeight != defaultHeight[baseFonts[index]]);
                  h.removeChild(s);
                  detected = detected || matched;
              }
              return detected;
          }
      
          this.detect = detect;
          };
      
          var d = new Detector();
          //tst = d.detect("Arial");
      Add("Arial");
      Add("Arial Black");
      Add("Arial Narrow");
      Add("Courier");
      Add("Courier New");
      Add("Georgia");
      Add("Lucida Console");
      Add("Modena");
      Add("Monotype Corsiva");
      Add("Papyrus");
      Add("Tahoma");
      Add("Times");
      Add("Times New Roman");
      Add("Trebuchet MS");
      Add("Verdana");
      Add("Verona");
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor");
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("Hint",2,rtl.string,"FHint","SetHint");
    $r.addProperty("ItemIndex",3,rtl.longint,"GetItemIndex","SetItemIndex",4,{Default: -1});
    $r.addProperty("Left",3,rtl.longint,"GetLeft","SetLeft");
    $r.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",4,{Default: false});
    $r.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder");
    $r.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",4,{Default: true});
    $r.addProperty("Text",3,rtl.string,"GetText","SetText");
    $r.addProperty("Top",3,rtl.longint,"GetTop","SetTop");
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChange","FOnChange");
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnKeyDown",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyDown","FOnKeyDown");
    $r.addProperty("OnKeyPress",0,pas["WEBLib.Controls"].$rtti["TKeyPressEvent"],"FOnKeyPress","FOnKeyPress");
    $r.addProperty("OnKeyUp",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyUp","FOnKeyUp");
    $r.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseDown","FOnMouseDown");
    $r.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseUp","FOnMouseUp");
    $r.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti["TMouseMoveEvent"],"FOnMouseMove","FOnMouseMove");
    $r.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseLeave","FOnMouseLeave");
    $r.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseEnter","FOnMouseEnter");
    $r.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnEnter","FOnEnter");
    $r.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnExit","FOnExit");
  });
  rtl.createClass(this,"TWebFontPicker",this.TFontPicker,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.TFontSizePickerMode = {"0": "fmPointSize", fmPointSize: 0, "1": "fmRelativeSize", fmRelativeSize: 1};
  this.$rtti.$Enum("TFontSizePickerMode",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TFontSizePickerMode});
  rtl.createClass(this,"TFontSizePicker",this.TCustomComboBox,function () {
    this.$init = function () {
      $mod.TCustomComboBox.$init.call(this);
      this.FPickerMode = 0;
    };
    this.SetPickerMode = function (AValue) {
      this.FPickerMode = AValue;
      this.Init();
    };
    this.Init = function () {
      this.FItems.Clear();
      var $tmp = this.FPickerMode;
      if ($tmp === $mod.TFontSizePickerMode.fmPointSize) {
        this.FItems.Add("8");
        this.FItems.Add("9");
        this.FItems.Add("10");
        this.FItems.Add("11");
        this.FItems.Add("12");
        this.FItems.Add("14");
        this.FItems.Add("16");
        this.FItems.Add("18");
        this.FItems.Add("20");
        this.FItems.Add("22");
        this.FItems.Add("24");
        this.FItems.Add("26");
        this.FItems.Add("28");
        this.FItems.Add("36");
        this.FItems.Add("48");
        this.FItems.Add("72");
      } else if ($tmp === $mod.TFontSizePickerMode.fmRelativeSize) {
        this.FItems.Add("8");
        this.FItems.Add("9");
        this.FItems.Add("10");
        this.FItems.Add("14");
        this.FItems.Add("18");
        this.FItems.Add("24");
        this.FItems.Add("36");
      };
    };
    this.CreateInitialize = function () {
      $mod.TCustomComboBox.CreateInitialize.call(this);
      this.SetPickerMode($mod.TFontSizePickerMode.fmPointSize);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor");
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Hint",2,rtl.string,"FHint","SetHint");
    $r.addProperty("ItemIndex",3,rtl.longint,"GetItemIndex","SetItemIndex",4,{Default: -1});
    $r.addProperty("Left",3,rtl.longint,"GetLeft","SetLeft");
    $r.addProperty("PickerMode",2,$mod.$rtti["TFontSizePickerMode"],"FPickerMode","SetPickerMode");
    $r.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",4,{Default: false});
    $r.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder");
    $r.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",4,{Default: true});
    $r.addProperty("Text",3,rtl.string,"GetText","SetText");
    $r.addProperty("Top",3,rtl.longint,"GetTop","SetTop");
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChange","FOnChange");
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnKeyDown",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyDown","FOnKeyDown");
    $r.addProperty("OnKeyPress",0,pas["WEBLib.Controls"].$rtti["TKeyPressEvent"],"FOnKeyPress","FOnKeyPress");
    $r.addProperty("OnKeyUp",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyUp","FOnKeyUp");
    $r.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseDown","FOnMouseDown");
    $r.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseUp","FOnMouseUp");
    $r.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti["TMouseMoveEvent"],"FOnMouseMove","FOnMouseMove");
    $r.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseLeave","FOnMouseLeave");
    $r.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseEnter","FOnMouseEnter");
    $r.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnEnter","FOnEnter");
    $r.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnExit","FOnExit");
  });
  rtl.createClass(this,"TLineSpacingPicker",this.TCustomComboBox,function () {
    this.CreateInitialize = function () {
      $mod.TCustomComboBox.CreateInitialize.call(this);
      this.FItems.Clear();
      this.FItems.Add("1");
      this.FItems.Add("1.5");
      this.FItems.Add("2");
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor");
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Hint",2,rtl.string,"FHint","SetHint");
    $r.addProperty("ItemIndex",3,rtl.longint,"GetItemIndex","SetItemIndex",4,{Default: -1});
    $r.addProperty("Left",3,rtl.longint,"GetLeft","SetLeft");
    $r.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",4,{Default: false});
    $r.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder");
    $r.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",4,{Default: true});
    $r.addProperty("Text",3,rtl.string,"GetText","SetText");
    $r.addProperty("Top",3,rtl.longint,"GetTop","SetTop");
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChange","FOnChange");
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnKeyDown",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyDown","FOnKeyDown");
    $r.addProperty("OnKeyPress",0,pas["WEBLib.Controls"].$rtti["TKeyPressEvent"],"FOnKeyPress","FOnKeyPress");
    $r.addProperty("OnKeyUp",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyUp","FOnKeyUp");
    $r.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseDown","FOnMouseDown");
    $r.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseUp","FOnMouseUp");
    $r.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti["TMouseMoveEvent"],"FOnMouseMove","FOnMouseMove");
    $r.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseLeave","FOnMouseLeave");
    $r.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseEnter","FOnMouseEnter");
    $r.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnEnter","FOnEnter");
    $r.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnExit","FOnExit");
  });
  rtl.createClass(this,"TWebFontSizePicker",this.TFontSizePicker,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TCustomMemo",pas["WEBLib.Menus"].TWebCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Menus"].TWebCustomControl.$init.call(this);
      this.FWordWrap = false;
      this.FBlockChange = false;
      this.FLines = null;
      this.FSelStart = 0;
      this.FSelLength = 0;
      this.FCaretPosition = pas.Types.TPoint.$new();
      this.FAutoSize = false;
      this.FOnChange = null;
      this.FReadOnly = false;
      this.FTextHint = "";
      this.FHandleChangePtr = null;
      this.FHandlePastePtr = null;
      this.FHandleCutPtr = null;
      this.FHandleInputPtr = null;
      this.FHandleInvalidPtr = null;
      this.FWantTabs = false;
      this.FAutoCompletion = 0;
      this.FSpellCheck = false;
      this.FModified = false;
      this.FScrollbars = 0;
      this.FRequiredText = "";
      this.FRequired = false;
      this.FMaxLength = 0;
    };
    this.$final = function () {
      this.FLines = undefined;
      this.FCaretPosition = undefined;
      this.FOnChange = undefined;
      pas["WEBLib.Menus"].TWebCustomControl.$final.call(this);
    };
    this.GetText = function () {
      var Result = "";
      if (this.GetElementInputHandle() != null) {
        this.FBlockChange = true;
        this.FLines.SetTextStr(this.GetElementInputHandle().value);
        this.FBlockChange = false;
      };
      Result = this.FLines.GetTextStr();
      return Result;
    };
    this.SetText = function (Value) {
      this.FLines.SetTextStr(Value);
    };
    this.SetSelLength = function (Value) {
      if (this.FSelLength !== Value) {
        this.FSelLength = Value;
        this.UpdateElement();
      };
    };
    this.SetSelStart = function (Value) {
      if (this.FSelStart !== Value) {
        this.FSelStart = Value;
        this.UpdateElement();
      };
    };
    this.SetAutoSize = function (Value) {
      if (this.FAutoSize !== Value) {
        this.FAutoSize = Value;
        this.UpdateElement();
      };
    };
    this.GetElementInputHandle = function () {
      var Result = null;
      Result = this.GetContainer();
      return Result;
    };
    this.SetReadOnly = function (Value) {
      if (this.FReadOnly !== Value) {
        this.FReadOnly = Value;
        this.UpdateElement();
      };
    };
    this.GetSelLength = function () {
      var Result = 0;
      Result = -1;
      if (this.GetElementInputHandle() != null) Result = this.GetElementInputHandle().selectionEnd - this.GetElementInputHandle().selectionStart;
      return Result;
    };
    this.GetSelStart = function () {
      var Result = 0;
      Result = -1;
      if (this.GetElementInputHandle() != null) Result = this.GetElementInputHandle().selectionStart;
      return Result;
    };
    this.SetTextHint = function (Value) {
      if (this.FTextHint !== Value) {
        this.FTextHint = Value;
        this.UpdateElement();
      };
    };
    this.SetAutoCompletion = function (Value) {
      if (this.FAutoCompletion !== Value) {
        this.FAutoCompletion = Value;
        this.UpdateElementData();
      };
    };
    this.SetSpellCheck = function (Value) {
      if (this.FSpellCheck !== Value) {
        this.FSpellCheck = Value;
        this.UpdateElement();
      };
    };
    this.SetWantTabs = function (Value) {
      if (this.FWantTabs !== Value) {
        this.FWantTabs = Value;
        this.UpdateElement();
      };
    };
    this.SetWordWrap = function (Value) {
      if (this.FWordWrap !== Value) {
        this.FWordWrap = Value;
        this.UpdateElement();
      };
    };
    this.GetCaretPos = function () {
      var Result = pas.Types.TPoint.$new();
      Result.$assign(this.GetCaret());
      return Result;
    };
    this.SetCaretPos = function (Value) {
      this.SetCaret(Value.x,Value.y);
    };
    this.SetScrollBars = function (Value) {
      if (this.FScrollbars !== Value) {
        this.FScrollbars = Value;
        this.UpdateElement();
      };
    };
    this.GetSelText = function () {
      var Result = "";
      Result = "";
      if (this.GetElementInputHandle() != null) Result = pas.SysUtils.TStringHelper.Substring$1.call({p: this.GetElementInputHandle(), get: function () {
          return this.p.value;
        }, set: function (v) {
          this.p.value = v;
        }},this.GetSelStart(),this.GetSelStart() + this.GetSelLength());
      return Result;
    };
    this.SetRequired = function (Value) {
      if (this.FRequired !== Value) {
        this.FRequired = Value;
        this.UpdateElement();
      };
    };
    this.SetMaxLength = function (Value) {
      if (this.FMaxLength !== Value) {
        this.FMaxLength = Value;
        this.UpdateElementData();
      };
    };
    this.IsInputControl = function () {
      var Result = false;
      Result = true;
      return Result;
    };
    this.HandleDoKeyDown = function (Event) {
      var Result = false;
      var eh = null;
      var AEvent = null;
      AEvent = Event;
      if ((this.GetKeyCode(AEvent.key,true) === 9) && this.FWantTabs) {
        eh = this.GetElementInputHandle();
        var sstart = eh.selectionStart;
              var send = eh.selectionEnd;
        
              eh.value = eh.value.substring(0, sstart) + "\t" +eh.value.substring(send);
              // put caret at right position again
              eh.selectionStart = eh.selectionEnd = sstart + 1;
        
              AEvent.stopPropagation();
              AEvent.preventDefault();
      } else pas["WEBLib.Controls"].TControl.HandleDoKeyDown.apply(this,arguments);
      return Result;
    };
    this.CreateElement = function () {
      var Result = null;
      Result = document.createElement("TEXTAREA");
      return Result;
    };
    this.DoHandlePaste = function (Event) {
      var Result = false;
      var s = "";
      var clp = false;
      clp = false;
      var clipboardData = Event.clipboardData || window.clipboardData;
      if (clipboardData) {
        s = clipboardData.getData('Text');
        clp = true;
      };
      if (clp && !this.CanPaste(s)) {
        Event.preventDefault();
        Event.stopPropagation();
      };
      Result = false;
      return Result;
    };
    this.DoHandleCut = function (Event) {
      var Result = false;
      if (!this.CanCut()) {
        Event.preventDefault();
        Event.stopPropagation();
      };
      Result = false;
      return Result;
    };
    this.DoHandleInput = function (Event) {
      var Result = false;
      this.GetText();
      this.Change();
      if (this.FAutoSize) this.DoAutoSize();
      Result = true;
      return Result;
    };
    this.DoHandleChange = function (Event) {
      var Result = false;
      this.FModified = true;
      this.Change();
      if (this.FRequiredText !== "") {
        this.GetElementInputHandle().setCustomValidity("");
      };
      Result = true;
      return Result;
    };
    this.DoHandleInvalid = function (Event) {
      var Result = false;
      this.GetElementInputHandle().setCustomValidity(this.FRequiredText);
      Result = true;
      return Result;
    };
    this.IsReadOnly = function () {
      var Result = false;
      Result = this.FReadOnly;
      return Result;
    };
    this.PersistinHTML = function () {
      this.GetElementInputHandle().innerHTML = this.FLines.GetTextStr();
    };
    this.GetDisplayText = function () {
      var Result = "";
      Result = this.FLines.GetTextStr();
      return Result;
    };
    this.DoAutoSize = function () {
      var sh = 0;
      var el = null;
      this.GetElementInputHandle().style.setProperty("overflow","hidden");
      this.GetElementInputHandle().style.setProperty("height","auto");
      el = this.GetElementInputHandle();
      sh = el.scrollHeight;
      this.GetElementInputHandle().style.setProperty("height",pas.SysUtils.TIntegerHelper.ToString$1.call({get: function () {
          return sh;
        }, set: function (v) {
          sh = v;
        }}) + "px");
    };
    this.BindEvents = function () {
      pas["WEBLib.Controls"].TCustomControl.BindEvents.call(this);
      if (this.GetElementInputHandle() != null) {
        this.GetElementInputHandle().addEventListener("input",this.FHandleInputPtr);
        this.GetElementInputHandle().addEventListener("change",this.FHandleChangePtr);
        this.GetElementInputHandle().addEventListener("paste",this.FHandlePastePtr);
        this.GetElementInputHandle().addEventListener("cut",this.FHandleCutPtr);
        this.GetElementInputHandle().addEventListener("invalid",this.FHandleInvalidPtr);
      };
    };
    this.UnbindEvents = function () {
      pas["WEBLib.Controls"].TControl.UnbindEvents.call(this);
      if (this.GetElementInputHandle() != null) {
        this.GetElementInputHandle().removeEventListener("input",this.FHandleInputPtr);
        this.GetElementInputHandle().removeEventListener("change",this.FHandleChangePtr);
        this.GetElementInputHandle().removeEventListener("paste",this.FHandlePastePtr);
        this.GetElementInputHandle().removeEventListener("cut",this.FHandleCutPtr);
        this.GetElementInputHandle().removeEventListener("invalid",this.FHandleInvalidPtr);
      };
    };
    this.UpdateElementData = function () {
      var ss = 0;
      var sl = 0;
      var e = null;
      pas["WEBLib.Controls"].TControl.UpdateElementData.call(this);
      if ((this.GetElementInputHandle() != null) && !this.FBlockChange) {
        if (this.FRequired) {
          this.GetElementInputHandle().setAttribute("required","")}
         else if (!this.GetIsLinked()) this.GetElementInputHandle().removeAttribute("required");
        this.GetElementInputHandle().value = this.GetDisplayText();
        if (this.GetElementInputHandle().tagName === "TEXTAREA") {
          this.GetElementInputHandle().setSelectionRange(this.GetSelStart(),this.GetSelStart() + this.GetSelLength());
        };
        if (!this.GetIsLinked()) {
          this.GetElementInputHandle().style.setProperty("resize","none");
        };
        this.GetElementInputHandle().readOnly = this.IsReadOnly();
        if (this.FTextHint !== "") this.GetElementInputHandle().placeholder = this.FTextHint;
        if (this.FMaxLength <= 0) {
          this.GetElementInputHandle().removeAttribute("maxLength")}
         else this.GetElementInputHandle().maxLength = this.FMaxLength;
        if (!this.GetIsLinked()) {
          if (this.FAutoCompletion === $mod.TAutoCompletion.acNone) {
            this.GetElementInputHandle().setAttribute("autocomplete","none");
            if (!this.GetIsLinked()) this.GetElementInputHandle().removeAttribute("name");
          } else if (this.FAutoCompletion !== $mod.TAutoCompletion.acOff) {
            this.GetElementInputHandle().setAttribute("autocomplete","on");
            if (!this.GetIsLinked()) this.GetElementInputHandle().setAttribute("name",$mod.GetAutoCompletionName(this.FAutoCompletion));
          } else {
            this.GetElementInputHandle().removeAttribute("autocomplete");
            if (!this.GetIsLinked()) this.GetElementInputHandle().removeAttribute("name");
          };
          ss = this.FSelStart;
          sl = this.FSelStart + this.FSelLength;
          e = this.GetElementInputHandle();
          setTimeout(function() {
            e.setSelectionRange(ss, sl);
          }, 1);
        };
      };
    };
    this.UpdateElementVisual = function () {
      pas["WEBLib.Controls"].TCustomControl.UpdateElementVisual.call(this);
      if ((this.GetElementInputHandle() != null) && !this.FBlockChange && !this.GetIsLinked()) {
        if (this.FAutoSize) {
          this.GetElementInputHandle().style.setProperty("overflow","hidden");
          this.GetElementInputHandle().style.setProperty("height","auto");
        } else {
          this.GetElementInputHandle().style.setProperty("overflow","auto");
          var $tmp = this.FScrollbars;
          if ($tmp === pas["WEBLib.Controls"].TScrollStyle.ssNone) {
            this.GetElementInputHandle().style.setProperty("overflow","hidden");
          } else if ($tmp === pas["WEBLib.Controls"].TScrollStyle.ssVertical) {
            this.GetElementInputHandle().style.removeProperty("overflow");
            this.GetElementInputHandle().style.setProperty("overflow-x","hidden");
            this.GetElementInputHandle().style.setProperty("overflow-y","auto");
          } else if ($tmp === pas["WEBLib.Controls"].TScrollStyle.ssHorizontal) {
            this.GetElementInputHandle().style.removeProperty("overflow");
            this.GetElementInputHandle().style.setProperty("overflow-x","auto");
            this.GetElementInputHandle().style.setProperty("overflow-y","hidden");
          } else if ($tmp === pas["WEBLib.Controls"].TScrollStyle.ssBoth) {
            this.GetElementInputHandle().style.setProperty("overflow","auto");
          };
        };
        this.GetElementInputHandle().style.setProperty("margin","0");
        if ((this.FColor !== -1) && (this.FColor !== 16711422)) {
          this.GetElementInputHandle().style.setProperty("background-color",pas["WEBLib.Graphics"].ColorToHTML(this.FColor))}
         else this.GetElementInputHandle().style.removeProperty("background-color");
        if (!this.FSpellCheck) {
          this.GetElementInputHandle().setAttribute("spellcheck","false")}
         else if (this.GetElementInputHandle().hasAttribute("spellcheck")) this.GetElementInputHandle().removeAttribute("spellcheck");
        if (!this.FWordWrap) {
          this.GetElementInputHandle().setAttribute("wrap","off")}
         else if (this.GetElementInputHandle().hasAttribute("wrap")) this.GetElementInputHandle().removeAttribute("wrap");
      };
    };
    this.UpdateElementSize = function () {
      pas["WEBLib.Controls"].TControl.UpdateElementSize.call(this);
      if (this.FAutoSize) this.DoAutoSize();
    };
    this.UpdateSelection = function () {
      this.FSelStart = this.GetSelStart();
      this.FSelLength = this.GetSelLength();
    };
    this.SetLines = function (ALines) {
      this.FLines.Assign(ALines);
    };
    this.ClearMethodPointers = function () {
      pas["WEBLib.Controls"].TControl.ClearMethodPointers.call(this);
      this.FHandleChangePtr = null;
      this.FHandleInputPtr = null;
      this.FHandlePastePtr = null;
      this.FHandleCutPtr = null;
      this.FHandleInvalidPtr = null;
    };
    this.GetMethodPointers = function () {
      pas["WEBLib.Controls"].TControl.GetMethodPointers.call(this);
      this.FHandleChangePtr = rtl.createCallback(this,"DoHandleChange");
      this.FHandleInputPtr = rtl.createCallback(this,"DoHandleInput");
      this.FHandlePastePtr = rtl.createCallback(this,"DoHandlePaste");
      this.FHandleCutPtr = rtl.createCallback(this,"DoHandleCut");
      this.FHandleInvalidPtr = rtl.createCallback(this,"DoHandleInvalid");
    };
    this.DoLinesChange = function (Sender) {
      if ((this.GetElementInputHandle() != null) && !this.FBlockChange) {
        this.GetElementInputHandle().value = this.GetDisplayText();
        this.GetElementInputHandle().readOnly = this.IsReadOnly();
      };
    };
    this.CanPaste = function (AValue) {
      var Result = false;
      Result = true;
      return Result;
    };
    this.CanCut = function () {
      var Result = false;
      Result = true;
      return Result;
    };
    this.SaveState = function () {
      var Result = "";
      Result = this.FLines.GetTextStr();
      return Result;
    };
    this.LoadState = function (AState) {
      this.FLines.SetTextStr(AState);
    };
    this.Change = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.SetCaret = function (x, y) {
      var i = 0;
      var l = 0;
      l = 0;
      for (var $l = 0, $end = this.FLines.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (i < y) l = l + this.FLines.Get(i).length + 1;
      };
      this.SetSelStart(l + x);
    };
    this.GetCaret = function () {
      var Result = pas.Types.TPoint.$new();
      var l = 0;
      var i = 0;
      var ll = 0;
      var tl = 0;
      var ss = 0;
      l = 0;
      tl = 0;
      ss = this.GetSelStart();
      for (var $l = 0, $end = this.FLines.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        ll = this.FLines.Get(i).length + 1;
        if (ss > (tl + ll)) {
          l += 1;
          tl = tl + ll;
        } else {
          break;
        };
      };
      Result.x = ss - tl;
      Result.y = l;
      return Result;
    };
    this.InitCSSLibrary = function (ALibrary) {
      if (ALibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap) {
        this.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
        this.SetElementClassName("form-control");
      };
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.FSpellCheck = true;
      this.FLines = pas.Classes.TStringList.$create("Create$1");
      this.FLines.SetSkipLastLineBreak(true);
      this.FLines.FOnChange = rtl.createCallback(this,"DoLinesChange");
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        this.SetWidth(400);
        this.SetHeight(300);
      };
      this.SetShowFocus(true);
      this.SetClipChildren(false);
      this.FWantTabs = false;
      this.FAutoSize = false;
      this.FMaxLength = 0;
      this.FAutoCompletion = $mod.TAutoCompletion.acOff;
      this.FWordWrap = true;
      this.FScrollbars = pas["WEBLib.Controls"].TScrollStyle.ssBoth;
      this.FNoUserSelect = false;
    };
    this.Destroy = function () {
      rtl.free(this,"FLines");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.Clear = function () {
      this.FLines.Clear();
    };
    this.SelectAll = function () {
      if (this.GetElementInputHandle() != null) this.GetElementInputHandle().select();
    };
    this.CopyToClipboard = function () {
      var s = "";
      s = this.GetText();
      navigator.clipboard.writeText(s);
    };
    this.ScrollBy = function (DeltaX, DeltaY) {
      if (this.GetElementHandle() != null) {
        this.GetElementHandle().scrollTop = this.GetElementHandle().scrollTop + DeltaY;
        this.GetElementHandle().scrollLeft = this.GetElementHandle().scrollLeft + DeltaX;
      };
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TMemo",this.TCustomMemo,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("AutoSize",2,rtl.boolean,"FAutoSize","SetAutoSize");
    $r.addProperty("BiDiMode",2,pas["WEBLib.Controls"].$rtti["TBiDiMode"],"FBiDiMode","SetBiDiMode",4,{Default: pas["WEBLib.Controls"].TBiDiMode.bdLeftToRight});
    $r.addProperty("BorderStyle",2,pas["WEBLib.Controls"].$rtti["TBorderStyle"],"FBorderStyle","SetBorderStyle",4,{Default: pas["WEBLib.Controls"].TBorderStyle.bsSingle});
    $r.addProperty("ChildOrder",2,rtl.longint,"FChildOrder","SetChildOrderEx",4,{Default: 0});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor");
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Hint",2,rtl.string,"FHint","SetHint");
    $r.addProperty("Left",3,rtl.longint,"GetLeft","SetLeft");
    $r.addProperty("Lines",2,pas.Classes.$rtti["TStrings"],"FLines","SetLines");
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("MaxLength",2,rtl.longint,"FMaxLength","SetMaxLength");
    $r.addProperty("ParentColor",2,rtl.boolean,"FParentColor","SetParentColor",4,{Default: false});
    $r.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",4,{Default: true});
    $r.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti["TPopupMenu"],"FPopupMenu","FPopupMenu");
    $r.addProperty("ReadOnly",2,rtl.boolean,"FReadOnly","SetReadOnly");
    $r.addProperty("Required",2,rtl.boolean,"FRequired","SetRequired",4,{Default: false});
    $r.addProperty("RequiredText",0,rtl.string,"FRequiredText","FRequiredText");
    $r.addProperty("Role",3,rtl.string,"GetRole","SetRole");
    $r.addProperty("SelStart",3,rtl.longint,"GetSelStart","SetSelStart");
    $r.addProperty("SelLength",3,rtl.longint,"GetSelLength","SetSelLength");
    $r.addProperty("ShowFocus",2,rtl.boolean,"FShowFocus","SetShowFocus",4,{Default: false});
    $r.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",4,{Default: false});
    $r.addProperty("Spellcheck",2,rtl.boolean,"FSpellCheck","SetSpellCheck",4,{Default: true});
    $r.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder");
    $r.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",4,{Default: true});
    $r.addProperty("TextDirection",0,pas["WEBLib.Controls"].$rtti["TTextDirection"],"FTextDirection","FTextDirection",4,{Default: pas["WEBLib.Controls"].TTextDirection.tdDefault});
    $r.addProperty("Top",3,rtl.longint,"GetTop","SetTop");
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChange","FOnChange");
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnKeyDown",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyDown","FOnKeyDown");
    $r.addProperty("OnKeyPress",0,pas["WEBLib.Controls"].$rtti["TKeyPressEvent"],"FOnKeyPress","FOnKeyPress");
    $r.addProperty("OnKeyUp",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyUp","FOnKeyUp");
    $r.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseDown","FOnMouseDown");
    $r.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseUp","FOnMouseUp");
    $r.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti["TMouseMoveEvent"],"FOnMouseMove","FOnMouseMove");
    $r.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseLeave","FOnMouseLeave");
    $r.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseEnter","FOnMouseEnter");
    $r.addProperty("OnMouseWheel",0,pas["WEBLib.Controls"].$rtti["TMouseWheelEvent"],"FOnMouseWheel","FOnMouseWheel");
    $r.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnEnter","FOnEnter");
    $r.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnExit","FOnExit");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
  });
  rtl.createClass(this,"TWebMemo",this.TMemo,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TControlGroup",pas["WEBLib.Menus"].TWebCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Menus"].TWebCustomControl.$init.call(this);
      this.FControls$1 = null;
      this.FOldCount = 0;
      this.FColumns = 0;
      this.FItems = null;
      this.FOnChange = null;
      this.FElementButtonClassName = "";
      this.FElementLabelClassName = "";
      this.FElementGroupClassName = "";
      this.FControlPosition = 0;
      this.FElementLegendClassName = "";
    };
    this.$final = function () {
      this.FControls$1 = undefined;
      this.FItems = undefined;
      this.FOnChange = undefined;
      pas["WEBLib.Menus"].TWebCustomControl.$final.call(this);
    };
    this.SetControlPosition = function (Value) {
      if (this.FControlPosition !== Value) {
        this.FControlPosition = Value;
        this.DoUpdateList();
      };
    };
    this.CreateElement = function () {
      var Result = null;
      var legend = null;
      Result = document.createElement("FIELDSET");
      legend = document.createElement("LEGEND");
      Result.appendChild(legend);
      legend.innerHTML = this.FCaption;
      legend.setAttribute("class","w-auto " + this.FElementLegendClassName);
      if (this.FCaption === "") {
        legend.style.setProperty("display","none")}
       else legend.style.setProperty("display","");
      legend.style.setProperty("float","none");
      Result.style.setProperty("display","inline-block");
      Result.style.setProperty("-webkit-padding-before","0px");
      Result.style.setProperty("-webkit-padding-after","0px");
      Result.style.setProperty("-webkit-padding-end","0px");
      Result.style.setProperty("-webkit-padding-start","0px");
      Result.style.setProperty("border","1px");
      return Result;
    };
    this.DoHandleChange = function (Event) {
      var Result = false;
      this.Change();
      Result = true;
      return Result;
    };
    this.DoHandleClick = function (AControl) {
      this.Change();
    };
    this.DoItemsChange = function (Sender) {
      this.DoUpdateList();
    };
    this.DoControlClick = function (Sender) {
      this.DoHandleClick(rtl.as(Sender,pas["WEBLib.Controls"].TCustomControl));
    };
    this.SetCaption = function (AValue) {
      var el = null;
      pas["WEBLib.Controls"].TCustomControl.SetCaption.call(this,AValue);
      if (!(this.GetContainer() != null)) return;
      el = this.GetContainer().firstElementChild;
      if (el != null) {
        el.innerHTML = AValue;
        if (AValue === "") {
          el.style.setProperty("display","none")}
         else el.style.setProperty("display","");
      };
    };
    this.SetColumns = function (AValue) {
      if ((this.FColumns > 0) && (this.FColumns !== AValue)) {
        this.FColumns = AValue;
        this.DoUpdateList();
      };
    };
    this.SetItems = function (AItems) {
      this.FItems.Assign(AItems);
      this.DoUpdateList();
    };
    this.DoUpdateList = function () {
      var i = 0;
      var s = "";
      var rd = null;
      var dx = 0;
      var dy = 0;
      var dc = 0;
      var col = 0;
      var row = 0;
      var ypos = 0;
      var legend = null;
      var chk = [];
      if (!(this.GetContainer() != null)) return;
      if (this.FItems.GetCount() === 0) return;
      dy = Math.round(this.FFont.FSize * 2.5);
      dx = rtl.trunc(this.GetWidth() / this.FColumns);
      if (this.FCaption !== "") {
        dc = this.FFont.FSize}
       else dc = 4;
      col = 0;
      row = 0;
      if (this.FOldCount > 0) chk = rtl.arraySetLength(chk,false,this.FOldCount);
      for (var $l = 0, $end = this.FOldCount - 1; $l <= $end; $l++) {
        i = $l;
        rd = rtl.getObject(this.FControls$1.Get(i));
        if ($mod.TRadioButton.isPrototypeOf(rd)) chk[i] = rtl.as(rd,$mod.TRadioButton).GetChecked();
        if ($mod.TCheckBox.isPrototypeOf(rd)) chk[i] = rtl.as(rd,$mod.TCheckBox).GetChecked();
        rd = rtl.freeLoc(rd);
      };
      this.FControls$1.Clear();
      while (this.GetContainer().childElementCount > 0) this.GetContainer().removeChild(this.GetContainer().firstChild);
      if (this.FCaption !== "") {
        legend = document.createElement("LEGEND");
        this.GetElementHandle().appendChild(legend);
        legend.innerHTML = this.FCaption;
        legend.setAttribute("class","w-auto " + this.FElementLegendClassName);
        legend.style.setProperty("float","none");
        pas["WEBLib.Controls"].SetHTMLElementFont(legend,this.FFont,!((this.FElementFont === pas["WEBLib.Controls"].TElementFont.efProperty) && (this.FElementClassName === "")));
      };
      if (this.FElementGroupClassName !== "") {
        this.GetElementHandle().setAttribute("class",this.FElementGroupClassName)}
       else this.GetElementHandle().setAttribute("class","border p-2");
      this.GetContainer().style.setProperty("margin","0px");
      for (var $l1 = 0, $end1 = this.FItems.GetCount() - 1; $l1 <= $end1; $l1++) {
        i = $l1;
        ypos = dc + (row * dy);
        s = this.FItems.Get(i);
        rd = this.CreateGroupControl(4 + (col * dx),ypos,i,s,this.FControlPosition,this.GetGroupControlState(i),true);
        rd.SetEnabled(this.FEnabled);
        this.FControls$1.Add(rd);
        if (i <= this.FOldCount) {
          if ($mod.TRadioButton.isPrototypeOf(rd)) rtl.as(rd,$mod.TRadioButton).SetChecked(chk[i]);
          if ($mod.TCheckBox.isPrototypeOf(rd)) rtl.as(rd,$mod.TCheckBox).SetChecked(chk[i]);
        };
        if (!this.GetIsLinked()) {
          rd.GetContainer().style.setProperty("float","left");
          rd.GetContainer().style.setProperty("width",pas.SysUtils.IntToStr(pas.System.Trunc(100 / this.FColumns) - 5) + "%");
          if (this.FTabStop) {
            rd.GetContainer().setAttribute("tabindex",pas.SysUtils.TIntegerHelper.ToString$1.call({p: this, get: function () {
                return this.p.FTabOrder;
              }, set: function (v) {
                this.p.FTabOrder = v;
              }}));
            this.GetContainer().setAttribute("tabindex","-1");
          } else rd.GetContainer().setAttribute("tabindex","-1");
        };
        if ((i % this.FColumns) === 0) rd.GetContainer().style.setProperty("clear","left");
        this.GetElementHandle().appendChild(rd.GetContainer());
        if (col < (this.FColumns - 1)) {
          col += 1}
         else {
          col = 0;
          row += 1;
        };
      };
      this.FOldCount = this.FItems.GetCount();
    };
    this.Change = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Loaded = function () {
      pas["WEBLib.Controls"].TCustomControl.Loaded.call(this);
      this.DoUpdateList();
    };
    this.FontChanged = function () {
      pas["WEBLib.Controls"].TControl.FontChanged.call(this);
      this.DoUpdateList();
    };
    this.CreateGroupControl = function (ALeft, ATop, AIndex, ACaption, APosition, AState, AEnabled) {
      var Result = null;
      Result = null;
      return Result;
    };
    this.GetGroupControlState = function (AIndex) {
      var Result = false;
      Result = false;
      return Result;
    };
    this.GetGroupControl = function (AIndex) {
      var Result = null;
      Result = rtl.getObject(this.FControls$1.Get(AIndex));
      return Result;
    };
    this.SetEnabled = function (Value) {
      var i = 0;
      pas["WEBLib.Controls"].TControl.SetEnabled.apply(this,arguments);
      for (var $l = 0, $end = this.FControls$1.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        rtl.getObject(this.FControls$1.Get(i)).SetEnabled(Value);
      };
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.FColumns = 1;
      this.FControls$1 = pas.Classes.TList.$create("Create$1");
      this.FItems = pas.Classes.TStringList.$create("Create$1");
      this.FItems.FOnChange = rtl.createCallback(this,"DoItemsChange");
      this.FOldCount = -1;
      this.FControlPosition = pas["WEBLib.Controls"].TElementPosition.epAbsolute;
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        this.SetWidth(200);
        this.SetHeight(200);
      };
    };
    this.Destroy = function () {
      rtl.free(this,"FControls$1");
      rtl.free(this,"FItems");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.EndUpdate = function () {
      pas["WEBLib.Controls"].TCustomControl.EndUpdate.call(this);
      this.DoUpdateList();
    };
    this.SetHeight = function (AValue) {
      pas["WEBLib.Controls"].TControl.SetHeight.apply(this,arguments);
      this.DoUpdateList();
    };
    this.SetWidth = function (AValue) {
      pas["WEBLib.Controls"].TControl.SetWidth.apply(this,arguments);
      this.DoUpdateList();
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("Caption",2,rtl.string,"FCaption","SetCaption");
    $r.addProperty("ChildOrder",2,rtl.longint,"FChildOrder","SetChildOrderEx",4,{Default: 0});
    $r.addProperty("Columns",2,rtl.longint,"FColumns","SetColumns");
    $r.addProperty("ControlPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FControlPosition","SetControlPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementButtonClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementButtonClassName","FElementButtonClassName");
    $r.addProperty("ElementGroupClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementGroupClassName","FElementGroupClassName");
    $r.addProperty("ElementLabelClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementLabelClassName","FElementLabelClassName");
    $r.addProperty("ElementLegendClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementLegendClassName","FElementLegendClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Items",2,pas.Classes.$rtti["TStrings"],"FItems","SetItems");
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",4,{Default: true});
    $r.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti["TPopupMenu"],"FPopupMenu","FPopupMenu");
    $r.addProperty("Role",3,rtl.string,"GetRole","SetRole");
    $r.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",4,{Default: true});
    $r.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder");
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChange","FOnChange");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
  });
  rtl.createClass(this,"TRadioGroup",this.TControlGroup,function () {
    this.$init = function () {
      $mod.TControlGroup.$init.call(this);
      this.FItemIndex = 0;
      this.FOldItemIndex = 0;
    };
    this.DoHandleClick = function (AControl) {
      if (this.GetItemIndex() === this.FOldItemIndex) return;
      this.Change();
      this.FOldItemIndex = this.GetItemIndex();
    };
    this.GetItemIndex = function () {
      var Result = 0;
      var el = null;
      var i = 0;
      Result = this.FItemIndex;
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        el = document.getElementById(this.GetID() + pas.SysUtils.IntToStr(i) + "rd");
        if (el != null) {
          if (el.checked) Result = i;
        };
      };
      return Result;
    };
    this.SetItemIndex = function (AIndex) {
      var el = null;
      if ((AIndex === -1) && (this.GetItemIndex() >= 0)) {
        el = document.getElementById(this.GetID() + pas.SysUtils.IntToStr(this.GetItemIndex()) + "rd");
        if (el != null) el.checked = false;
        this.FItemIndex = -1;
      } else {
        this.FItemIndex = AIndex;
        if ((AIndex >= 0) && (AIndex < this.FItems.GetCount())) {
          el = document.getElementById(this.GetID() + pas.SysUtils.IntToStr(AIndex) + "rd");
          if (el != null) el.checked = true;
        };
      };
    };
    this.CreateGroupControl = function (ALeft, ATop, AIndex, ACaption, APosition, AState, AEnabled) {
      var Result = null;
      var rd = null;
      var id = "";
      id = this.GetID();
      if (id === "") id = this.FName;
      rd = $mod.TRadioButton.$create("Create$2",[id + pas.SysUtils.IntToStr(AIndex)]);
      rd.SetElementPosition(APosition);
      rd.SetElementFont(this.FElementFont);
      rd.SetElementClassName(this.FElementClassName);
      rd.FElementButtonClassName = this.FElementButtonClassName;
      rd.FElementLabelClassName = this.FElementLabelClassName;
      rd.SetHeightStyle(pas["WEBLib.Controls"].TSizeStyle.ssAuto);
      rd.SetParentFont(false);
      rd.FFont.Assign(this.FFont);
      rd.SetParent(this);
      rd.SetCaption(ACaption);
      rd.SetGroupName(id);
      rd.SetTop(ATop);
      rd.SetLeft(ALeft);
      rd.SetWidthStyle(pas["WEBLib.Controls"].TSizeStyle.ssAuto);
      rd.SetWidthPercent(100);
      rd.FOnClick = rtl.createCallback(this,"DoControlClick");
      rd.SetChecked(AState);
      rd.SetEnabled(AEnabled);
      rd.FTag$1 = AIndex;
      rd.SetTabStop(true);
      Result = rd;
      return Result;
    };
    this.GetGroupControlState = function (AIndex) {
      var Result = false;
      Result = AIndex === this.FItemIndex;
      return Result;
    };
    this.LoadState = function (AState) {
      var idx = 0;
      var e = 0;
      pas.System.val$6(AState,{get: function () {
          return idx;
        }, set: function (v) {
          idx = v;
        }},{get: function () {
          return e;
        }, set: function (v) {
          e = v;
        }});
      if (e === 0) this.SetItemIndex(idx);
    };
    this.SaveState = function () {
      var Result = "";
      Result = pas.SysUtils.IntToStr(this.GetItemIndex());
      return Result;
    };
    this.CreateInitialize = function () {
      $mod.TControlGroup.CreateInitialize.call(this);
      this.FItemIndex = -1;
      this.FOldItemIndex = -2;
    };
    this.SetFocus = function () {
      var idx = 0;
      var rd = null;
      if (this.FItems.GetCount() === 0) return;
      idx = this.GetItemIndex();
      if (idx < 0) idx = 0;
      rd = this.GetGroupControl(idx);
      if (rd != null) rd.SetFocus();
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("ItemIndex",3,rtl.longint,"GetItemIndex","SetItemIndex");
  });
  rtl.createClass(this,"TWebRadioGroup",this.TRadioGroup,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.$rtti.$MethodVar("TCheckClickEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AIndex",rtl.longint]]), methodkind: 0});
  rtl.createClass(this,"TCheckGroup",this.TControlGroup,function () {
    this.$init = function () {
      $mod.TControlGroup.$init.call(this);
      this.FOnCheckClick = null;
    };
    this.$final = function () {
      this.FOnCheckClick = undefined;
      $mod.TControlGroup.$final.call(this);
    };
    this.GetChecked = function (AIndex) {
      var Result = false;
      Result = rtl.as(this.GetGroupControl(AIndex),$mod.TCheckBox).GetChecked();
      return Result;
    };
    this.SetChecked = function (AIndex, Value) {
      rtl.as(this.GetGroupControl(AIndex),$mod.TCheckBox).SetChecked(Value);
    };
    this.DoHandleClick = function (AControl) {
      $mod.TControlGroup.DoHandleClick.apply(this,arguments);
      if (this.FOnCheckClick != null) this.FOnCheckClick(this,AControl.FTag$1);
    };
    this.CreateGroupControl = function (ALeft, ATop, AIndex, ACaption, APosition, AState, AEnabled) {
      var Result = null;
      var cb = null;
      var id = "";
      id = this.GetID();
      if (id === "") id = this.FName;
      cb = $mod.TCheckBox.$create("Create$2",[id + pas.SysUtils.IntToStr(AIndex)]);
      cb.SetCaption(ACaption);
      cb.SetElementPosition(APosition);
      cb.SetElementFont(this.FElementFont);
      cb.SetElementClassName(this.FElementClassName);
      cb.FElementButtonClassName = this.FElementButtonClassName;
      cb.FElementLabelClassName = this.FElementLabelClassName;
      cb.SetParentFont(false);
      cb.FFont.Assign(this.FFont);
      cb.SetParent(this);
      cb.SetTop(ATop);
      cb.SetLeft(ALeft);
      cb.SetWidthStyle(pas["WEBLib.Controls"].TSizeStyle.ssPercent);
      cb.SetWidthPercent(100);
      cb.SetHeightStyle(pas["WEBLib.Controls"].TSizeStyle.ssAuto);
      cb.FOnCheckClick = rtl.createCallback(this,"DoControlClick");
      cb.SetChecked(AState);
      cb.SetEnabled(AEnabled);
      cb.FTag$1 = AIndex;
      cb.SetTabStop(true);
      Result = cb;
      return Result;
    };
    this.GetGroupControlState = function (AIndex) {
      var Result = false;
      Result = false;
      return Result;
    };
    this.SaveState = function () {
      var Result = "";
      var i = 0;
      var s = "";
      s = "";
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.GetChecked(i)) {
          s = s + ",1"}
         else s = s + ",0";
      };
      pas.System.Delete({get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},1,1);
      Result = s;
      return Result;
    };
    this.LoadState = function (AState) {
      var sl = null;
      var i = 0;
      sl = pas.Classes.TStringList.$create("Create$1");
      sl.SetDelimiter(",");
      sl.SetCommaText(AState);
      for (var $l = 0, $end = sl.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        this.SetChecked(i,sl.Get(i) === "1");
      };
      sl = rtl.freeLoc(sl);
    };
    this.CreateInitialize = function () {
      $mod.TControlGroup.CreateInitialize.call(this);
    };
    this.SetFocus = function () {
      var cb = null;
      if (this.FItems.GetCount() > 0) {
        cb = this.GetGroupControl(0);
        if (cb != null) cb.SetFocus();
      };
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("OnCheckClick",0,$mod.$rtti["TCheckClickEvent"],"FOnCheckClick","FOnCheckClick");
  });
  rtl.createClass(this,"TWebCheckGroup",this.TCheckGroup,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TColorPicker",this.TCustomInput,function () {
    this.$init = function () {
      $mod.TCustomInput.$init.call(this);
      this.FColor$1 = 0;
      this.FOnSelect = null;
      this.FHandleChangePtr = null;
    };
    this.$final = function () {
      this.FOnSelect = undefined;
      $mod.TCustomInput.$final.call(this);
    };
    this.GetElementInputHandle = function () {
      var Result = null;
      Result = this.GetContainer();
      return Result;
    };
    this.UpdateElementVisual = function () {
      $mod.TCustomInput.UpdateElementVisual.call(this);
      if (this.GetElementHandle() != null) {
        this.GetElementHandle().style.setProperty("padding","0px");
        this.GetElementHandle().style.setProperty("width",pas.SysUtils.IntToStr(this.GetWidth() - 2) + "px");
        this.GetElementHandle().style.setProperty("height",pas.SysUtils.IntToStr(this.GetHeight() - 2) + "px");
        this.GetElementHandle().style.setProperty("min-width","32px");
      };
    };
    this.DoHandleChange = function (Event) {
      var Result = false;
      this.Select();
      Result = true;
      return Result;
    };
    this.GetInputType = function () {
      var Result = "";
      Result = "COLOR";
      return Result;
    };
    this.GetColor = function () {
      var Result = 0;
      Result = this.FColor$1;
      if (this.GetContainer() != null) Result = pas["WEBLib.Graphics"].HexToColor(this.GetContainer().value);
      return Result;
    };
    this.SetColor$1 = function (AValue) {
      this.FColor$1 = AValue;
      if (this.GetContainer() != null) this.GetContainer().value = pas["WEBLib.Graphics"].ColorToHTML(AValue);
    };
    this.BindEvents = function () {
      pas["WEBLib.Controls"].TCustomControl.BindEvents.call(this);
      if (this.GetElementInputHandle() != null) {
        this.GetElementInputHandle().addEventListener("input",this.FHandleChangePtr);
      };
    };
    this.UnbindEvents = function () {
      pas["WEBLib.Controls"].TControl.UnbindEvents.call(this);
      if (this.GetElementInputHandle() != null) {
        this.GetElementInputHandle().removeEventListener("input",this.FHandleChangePtr);
      };
    };
    this.Select = function () {
      if (this.FOnSelect != null) this.FOnSelect(this);
    };
    this.ClearMethodPointers = function () {
      pas["WEBLib.Controls"].TControl.ClearMethodPointers.call(this);
      this.FHandleChangePtr = null;
    };
    this.GetMethodPointers = function () {
      pas["WEBLib.Controls"].TControl.GetMethodPointers.call(this);
      this.FHandleChangePtr = rtl.createCallback(this,"DoHandleChange");
    };
    this.InitCSSLibrary = function (ALibrary) {
      if (ALibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap) {
        this.SetElementClassName("form-control");
        this.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
        this.SetHeightStyle(pas["WEBLib.Controls"].TSizeStyle.ssAuto);
      };
    };
    this.CreateInitialize = function () {
      $mod.TCustomInput.CreateInitialize.call(this);
      this.FColor$1 = 0;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("ChildOrder",2,rtl.longint,"FChildOrder","SetChildOrderEx",4,{Default: 0});
    $r.addProperty("Color",3,pas["WEBLib.Graphics"].$rtti["TColor"],"GetColor","SetColor$1");
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("Left",3,rtl.longint,"GetLeft","SetLeft");
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("Role",3,rtl.string,"GetRole","SetRole");
    $r.addProperty("Top",3,rtl.longint,"GetTop","SetTop");
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnSelect",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnSelect","FOnSelect");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
  });
  rtl.createClass(this,"TWebColorPicker",this.TColorPicker,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TScrollBarContent",pas["WEBLib.Controls"].TCustomControl,function () {
    this.CreateElement = function () {
      var Result = null;
      Result = document.createElement("SPAN");
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TScrollBar",pas["WEBLib.Controls"].TCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Controls"].TCustomControl.$init.call(this);
      this.FScrolling = false;
      this.FPageSizing = false;
      this.FContent = null;
      this.FKind = 0;
      this.FPosition = 0;
      this.FSmallChange = 0;
      this.FMax = 0;
      this.FMin = 0;
      this.FLargeChange = 0;
      this.FPageSize = 0;
      this.FOnChange = null;
      this.FScrollPtr = null;
    };
    this.$final = function () {
      this.FContent = undefined;
      this.FOnChange = undefined;
      pas["WEBLib.Controls"].TCustomControl.$final.call(this);
    };
    this.SetKind = function (Value) {
      if (this.FKind !== Value) {
        this.FKind = Value;
        var $tmp = this.FKind;
        if ($tmp === pas["WEBLib.Controls"].TScrollBarKind.sbHorizontal) {
          this.SetBounds(this.GetLeft(),this.GetTop(),this.GetHeight(),17);
        } else if ($tmp === pas["WEBLib.Controls"].TScrollBarKind.sbVertical) {
          this.SetBounds(this.GetLeft(),this.GetTop(),17,this.GetWidth());
        };
        this.UpdateElement();
        this.UpdateContent();
      };
    };
    this.SetPosition = function (Value) {
      if (this.FPosition !== Value) {
        this.FPosition = Value;
        this.UpdateContent();
        if (this.FOnChange != null) this.FOnChange(this);
      };
    };
    this.SetMax = function (Value) {
      if (this.FMax !== Value) {
        this.FMax = Value;
        this.UpdateContent();
      };
    };
    this.SetMin = function (Value) {
      if (this.FMin !== Value) {
        this.FMin = Value;
        this.UpdateContent();
      };
    };
    this.SetPageSize = function (Value) {
      if (this.FPageSize !== Value) {
        this.FPageSizing = true;
        this.FPageSize = Value;
        this.UpdateContent();
      };
    };
    this.GetPosition = function () {
      var Result = 0;
      Result = 0;
      if (this.GetElement() != null) {
        var $tmp = this.FKind;
        if ($tmp === pas["WEBLib.Controls"].TScrollBarKind.sbHorizontal) {
          Result = Math.round(this.GetValue(this.GetElement().scrollLeft))}
         else if ($tmp === pas["WEBLib.Controls"].TScrollBarKind.sbVertical) Result = Math.round(this.GetValue(this.GetElement().scrollTop));
      } else Result = this.FPosition;
      return Result;
    };
    this.GetPageSize = function () {
      var Result = 0;
      Result = this.FPageSize;
      if (Result === 0) Result = 25;
      return Result;
    };
    this.GetValue = function (XYPos) {
      var Result = 0.0;
      Result = 0;
      if (this.FContent != null) {
        var $tmp = this.FKind;
        if ($tmp === pas["WEBLib.Controls"].TScrollBarKind.sbHorizontal) {
          if (this.FContent.GetWidth() > 0) Result = (XYPos / this.FContent.GetWidth()) * (this.FMax - this.FMin);
        } else if ($tmp === pas["WEBLib.Controls"].TScrollBarKind.sbVertical) {
          if (this.FContent.GetHeight() > 0) Result = (XYPos / this.FContent.GetHeight()) * (this.FMax - this.FMin);
        };
      };
      return Result;
    };
    this.CreateElement = function () {
      var Result = null;
      Result = document.createElement("SPAN");
      return Result;
    };
    this.DoScroll = function (Event) {
      var Result = false;
      var p = 0;
      this.FScrolling = true;
      p = this.GetPosition();
      if (!this.FPageSizing && !(p === this.FPosition) && (this.FOnChange != null)) this.FOnChange(this);
      this.FPageSizing = false;
      this.FPosition = p;
      this.FScrolling = false;
      Result = true;
      return Result;
    };
    this.BindEvents = function () {
      pas["WEBLib.Controls"].TCustomControl.BindEvents.call(this);
      if (this.GetElementHandle() != null) this.GetElementHandle().addEventListener("scroll",this.FScrollPtr);
    };
    this.UnbindEvents = function () {
      pas["WEBLib.Controls"].TControl.UnbindEvents.call(this);
      if (this.GetElementHandle() != null) this.GetElementHandle().removeEventListener("scroll",this.FScrollPtr);
    };
    this.UpdateElementVisual = function () {
      pas["WEBLib.Controls"].TCustomControl.UpdateElementVisual.call(this);
      if (this.GetElementHandle() != null) {
        this.GetElementHandle().style.setProperty("overflow","auto");
        var $tmp = this.FKind;
        if ($tmp === pas["WEBLib.Controls"].TScrollBarKind.sbHorizontal) {
          this.GetElementHandle().style.setProperty("overflow-y","hidden");
          this.GetElementHandle().style.setProperty("overflow-x","");
        } else if ($tmp === pas["WEBLib.Controls"].TScrollBarKind.sbVertical) {
          this.GetElementHandle().style.setProperty("overflow-y","");
          this.GetElementHandle().style.setProperty("overflow-x","hidden");
        };
      };
    };
    this.UpdateContent = function () {
      var x = 0;
      var y = 0;
      var w = 0;
      var h = 0;
      var ps = 0;
      var v = 0.0;
      if (!(this.FContent != null) || !(this.GetElementHandle() != null) || this.FScrolling) return;
      ps = this.GetPageSize();
      v = (this.FMax - this.FMin) / ps;
      var $tmp = this.FKind;
      if ($tmp === pas["WEBLib.Controls"].TScrollBarKind.sbHorizontal) {
        y = 0;
        h = this.GetHeight();
        w = Math.round(v * this.GetWidth());
        x = Math.round(((this.FPosition - this.FMin) / (this.FMax - this.FMin)) * w);
      } else if ($tmp === pas["WEBLib.Controls"].TScrollBarKind.sbVertical) {
        x = 0;
        w = this.GetWidth();
        h = Math.round(v * this.GetHeight());
        y = Math.round(((this.FPosition - this.FMin) / (this.FMax - this.FMin)) * h);
      };
      this.FContent.SetBounds(0,0,w,h);
      this.GetElementHandle().scrollLeft = x;
      this.GetElementHandle().scrollTop = y;
    };
    this.Loaded = function () {
      pas["WEBLib.Controls"].TCustomControl.Loaded.call(this);
      this.UpdateContent();
    };
    this.ClearMethodPointers = function () {
      pas["WEBLib.Controls"].TControl.ClearMethodPointers.call(this);
      this.FScrollPtr = null;
    };
    this.GetMethodPointers = function () {
      pas["WEBLib.Controls"].TControl.GetMethodPointers.call(this);
      this.FScrollPtr = rtl.createCallback(this,"DoScroll");
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.SetTabStop(true);
      this.FKind = pas["WEBLib.Controls"].TScrollBarKind.sbHorizontal;
      this.FPosition = 0;
      this.FMin = 0;
      this.FMax = 100;
      this.FSmallChange = 1;
      this.FLargeChange = 1;
      this.FPageSizing = false;
      this.FContent = $mod.TScrollBarContent.$create("Create$1",[this]);
      this.FContent.SetParent(this);
      this.FContent.SetWidth(121);
      this.FContent.SetHeight(17);
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        this.SetWidth(121);
        this.SetHeight(17);
      };
      this.UpdateContent();
    };
    this.Destroy = function () {
      rtl.free(this,"FContent");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.SetBounds = function (X, Y, AWidth, AHeight) {
      pas["WEBLib.Controls"].TControl.SetBounds.apply(this,arguments);
      this.UpdateContent();
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("Kind",2,pas["WEBLib.Controls"].$rtti["TScrollBarKind"],"FKind","SetKind");
    $r.addProperty("Position",3,rtl.longint,"GetPosition","SetPosition");
    $r.addProperty("Left",3,rtl.longint,"GetLeft","SetLeft");
    $r.addProperty("SmallChange",0,rtl.longint,"FSmallChange","FSmallChange");
    $r.addProperty("LargeChange",0,rtl.longint,"FLargeChange","FLargeChange");
    $r.addProperty("Max",2,rtl.longint,"FMax","SetMax");
    $r.addProperty("Min",2,rtl.longint,"FMin","SetMin");
    $r.addProperty("PageSize",3,rtl.longint,"GetPageSize","SetPageSize");
    $r.addProperty("Top",3,rtl.longint,"GetTop","SetTop");
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChange","FOnChange");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
  });
  rtl.createClass(this,"TWebScrollBar",this.TScrollBar,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.GetAutoCompletionName = function (aAutoCompletion) {
    var Result = "";
    var $tmp = aAutoCompletion;
    if ($tmp === $mod.TAutoCompletion.acOff) {
      Result = ""}
     else if ($tmp === $mod.TAutoCompletion.acHonorificPrefix) {
      Result = "honorific-prefix"}
     else if ($tmp === $mod.TAutoCompletion.acGivenName) {
      Result = "given-name"}
     else if ($tmp === $mod.TAutoCompletion.acAdditionalName) {
      Result = "additional-name"}
     else if ($tmp === $mod.TAutoCompletion.acFamilyName) {
      Result = "family-name"}
     else if ($tmp === $mod.TAutoCompletion.acHonorificSuffix) {
      Result = "honorific-suffix"}
     else if ($tmp === $mod.TAutoCompletion.acNickName) {
      Result = "nickname"}
     else if ($tmp === $mod.TAutoCompletion.acEmail) {
      Result = "email"}
     else if ($tmp === $mod.TAutoCompletion.acUserName) {
      Result = "username"}
     else if ($tmp === $mod.TAutoCompletion.acNewPassword) {
      Result = "new-password"}
     else if ($tmp === $mod.TAutoCompletion.acCurrentPassword) {
      Result = "current-password"}
     else if ($tmp === $mod.TAutoCompletion.acOrganizationTitle) {
      Result = "organization-title"}
     else if ($tmp === $mod.TAutoCompletion.acOrganization) {
      Result = "organization"}
     else if ($tmp === $mod.TAutoCompletion.acStreetAddress) {
      Result = "street-address"}
     else if ($tmp === $mod.TAutoCompletion.acAddressLine1) {
      Result = "address-line1"}
     else if ($tmp === $mod.TAutoCompletion.acAddressLine2) {
      Result = "address-line2"}
     else if ($tmp === $mod.TAutoCompletion.acAddressLine3) {
      Result = "address-line3"}
     else if ($tmp === $mod.TAutoCompletion.acAddressLevel1) {
      Result = "address-level1"}
     else if ($tmp === $mod.TAutoCompletion.acAddressLevel2) {
      Result = "address-level2"}
     else if ($tmp === $mod.TAutoCompletion.acAddressLevel3) {
      Result = "address-level3"}
     else if ($tmp === $mod.TAutoCompletion.acAddressLevel4) {
      Result = "address-level4"}
     else if ($tmp === $mod.TAutoCompletion.acCountry) {
      Result = "country"}
     else if ($tmp === $mod.TAutoCompletion.acCountryName) {
      Result = "country-name"}
     else if ($tmp === $mod.TAutoCompletion.acPostalCode) {
      Result = "postal-code"}
     else if ($tmp === $mod.TAutoCompletion.acCCName) {
      Result = "cc-name"}
     else if ($tmp === $mod.TAutoCompletion.acCCGivenName) {
      Result = "cc-given-name"}
     else if ($tmp === $mod.TAutoCompletion.acCCAdditionalName) {
      Result = "cc-additional-name"}
     else if ($tmp === $mod.TAutoCompletion.acCCFamilyName) {
      Result = "cc-family-name"}
     else if ($tmp === $mod.TAutoCompletion.acCCNumber) {
      Result = "cc-number"}
     else if ($tmp === $mod.TAutoCompletion.acExpiry) {
      Result = "cc-exp"}
     else if ($tmp === $mod.TAutoCompletion.acExpiryMonth) {
      Result = "cc-exp-month"}
     else if ($tmp === $mod.TAutoCompletion.acExpiryYear) {
      Result = "cc-exp-year"}
     else if ($tmp === $mod.TAutoCompletion.acCSC) {
      Result = "cc-csc"}
     else if ($tmp === $mod.TAutoCompletion.acType) {
      Result = "cc-type"}
     else if ($tmp === $mod.TAutoCompletion.acTransactionCurrency) {
      Result = "transaction-currency"}
     else if ($tmp === $mod.TAutoCompletion.acTransactionAmount) {
      Result = "transaction-amount"}
     else if ($tmp === $mod.TAutoCompletion.acLanguage) {
      Result = "language"}
     else if ($tmp === $mod.TAutoCompletion.acBirthday) {
      Result = "bday"}
     else if ($tmp === $mod.TAutoCompletion.acBirthdayDay) {
      Result = "bday-day"}
     else if ($tmp === $mod.TAutoCompletion.acBirthDayMonth) {
      Result = "bday-month"}
     else if ($tmp === $mod.TAutoCompletion.acBirthDayYear) {
      Result = "bday-year"}
     else if ($tmp === $mod.TAutoCompletion.acSex) {
      Result = "sex"}
     else if ($tmp === $mod.TAutoCompletion.acTelephone) {
      Result = "tel"}
     else if ($tmp === $mod.TAutoCompletion.acTelephoneCountryCode) {
      Result = "tel-country-code"}
     else if ($tmp === $mod.TAutoCompletion.acTelephoneNational) {
      Result = "tel-national"}
     else if ($tmp === $mod.TAutoCompletion.acTelephoneAreaCode) {
      Result = "tel-area-code"}
     else if ($tmp === $mod.TAutoCompletion.acTelephoneLocal) {
      Result = "tel-local"}
     else if ($tmp === $mod.TAutoCompletion.acTelephoneExtension) {
      Result = "tel-extension"}
     else if ($tmp === $mod.TAutoCompletion.acIMPP) {
      Result = "impp"}
     else if ($tmp === $mod.TAutoCompletion.acURL) {
      Result = "url"}
     else if ($tmp === $mod.TAutoCompletion.acPhoto) {
      Result = "photo"}
     else if ($tmp === $mod.TAutoCompletion.acNope) Result = "nope";
    return Result;
  };
});
rtl.module("WEBLib.ExtCtrls",["System","Classes","SysUtils","Types","WEBLib.Controls","WEBLib.StdCtrls","WEBLib.Graphics","Web","JS","WEBLib.WebTools","WEBLib.Menus","WEBLib.REST"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.TLinkTarget = {"0": "ltCurrentTab", ltCurrentTab: 0, "1": "ltNewTab", ltNewTab: 1};
  this.$rtti.$Enum("TLinkTarget",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TLinkTarget});
  rtl.createClass(this,"TCustomLinkLabel",pas["WEBLib.StdCtrls"].TCustomLabel,function () {
    this.$init = function () {
      pas["WEBLib.StdCtrls"].TCustomLabel.$init.call(this);
      this.FDisplText = "";
      this.FOnLinkClick = null;
      this.FWidthStyle$1 = 0;
      this.FHeightPercent$1 = 0.0;
      this.FHeightStyle$1 = 0;
      this.FWidthPercent$1 = 0.0;
      this.FTarget = 0;
    };
    this.$final = function () {
      this.FOnLinkClick = undefined;
      pas["WEBLib.StdCtrls"].TCustomLabel.$final.call(this);
    };
    this.SetTarget = function (Value) {
      if (this.FTarget !== Value) {
        this.FTarget = Value;
        this.SetCaption(this.FCaption);
      };
    };
    this.SetWidthStyle$1 = function (Value) {
      this.FWidthStyle$1 = Value;
    };
    this.SetHeightStyle$1 = function (Value) {
      this.FHeightStyle$1 = Value;
    };
    this.SetHeightPercent$1 = function (Value) {
      this.FHeightPercent$1 = Value;
    };
    this.SetWidthPercent$1 = function (Value) {
      this.FWidthPercent$1 = Value;
    };
    this.GetOuterWidth = function () {
      var Result = 0;
      if (this.FAlign !== pas["WEBLib.Controls"].TAlign.alNone) {
        Result = pas["WEBLib.Controls"].TControl.GetOuterWidth.call(this)}
       else Result = this.GetWidth();
      return Result;
    };
    this.GetOuterHeight = function () {
      var Result = 0;
      if (this.FAlign !== pas["WEBLib.Controls"].TAlign.alNone) {
        Result = pas["WEBLib.Controls"].TControl.GetOuterHeight.call(this)}
       else Result = this.GetHeight();
      return Result;
    };
    this.GetDisplayText = function () {
      var Result = "";
      Result = this.FDisplText;
      return Result;
    };
    this.SetCaption = function (AValue) {
      var iopen = 0;
      var iopena = 0;
      var iopeni = 0;
      var iopenend = 0;
      var iopenendt = 0;
      var iclose = 0;
      var scaption = "";
      var shref = "";
      var stext = "";
      var sanchor = "";
      var sid = "";
      var stype = "";
      var slcaption = "";
      var anchor = null;
      var span = null;
      var contentelement = null;
      pas["WEBLib.StdCtrls"].TCustomLabel.SetCaption.call(this,AValue);
      if (!(this.GetContainer() != null)) return;
      contentelement = this.GetContentHandle();
      if (this.GetID() !== "") {
        contentelement = document.getElementById(this.GetID());
      };
      if ((contentelement != null) && pas.System.Assigned(contentelement.nodeValue)) contentelement.nodeValue = "";
      scaption = AValue;
      slcaption = pas.SysUtils.LowerCase(scaption);
      if ((pas.System.Pos("https://",slcaption) === 1) || (pas.System.Pos("http://",slcaption) === 1)) {
        scaption = '<a href="' + scaption + '"';
        if (this.FTarget === $mod.TLinkTarget.ltNewTab) scaption = scaption + ' target="_blank"';
        scaption = scaption + ">" + this.FCaption + "</a>";
        if (!(this.FOnLinkClick != null)) {
          contentelement.innerHTML = scaption;
          return;
        };
      };
      sanchor = '<a href="';
      sid = '<a id="';
      if ((this.FOnLinkClick != null) && ((pas.System.Pos(sanchor,scaption) > 0) || (pas.System.Pos(sid,scaption) > 0))) {
        contentelement.innerHTML = "";
        while ((pas.System.Pos(sanchor,scaption) > 0) || (pas.System.Pos(sid,scaption) > 0)) {
          iopena = pas.System.Pos(sanchor,scaption);
          iopeni = pas.System.Pos(sid,scaption);
          if (((iopena < iopeni) || (iopeni <= 0)) && (iopena > 0)) {
            stype = "#url#";
            iopen = iopena + sanchor.length;
          } else {
            stype = "#id#";
            iopen = iopeni + sid.length;
          };
          iopenend = pas.System.Pos('">',scaption);
          iopenendt = pas.System.Pos('" ',scaption);
          if ((iopenendt > 0) && (iopenendt < iopenend)) iopenend = iopenendt;
          iclose = pas.System.Pos("</a>",scaption);
          shref = pas.System.Copy(scaption,iopen,iopenend - iopen);
          iopenend = pas.System.Pos('">',scaption);
          iclose = pas.System.Pos("</a>",scaption);
          stext = pas.System.Copy(scaption,iopenend + 2,iclose - (iopenend + 2));
          span = document.createElement("SPAN");
          span.innerHTML = pas.System.Copy(scaption,0,iopen);
          contentelement.appendChild(span);
          anchor = document.createElement("A");
          anchor.setAttribute("href","#");
          anchor.setAttribute("id",stype + shref);
          anchor.innerHTML = stext;
          anchor.onclick = rtl.createSafeCallback(this,"DoLinkClick");
          contentelement.appendChild(anchor);
          pas.System.Delete({get: function () {
              return scaption;
            }, set: function (v) {
              scaption = v;
            }},1,pas.System.Pos("</a>",scaption) + 3);
        };
        span = document.createElement("SPAN");
        span.innerHTML = scaption;
        contentelement.appendChild(span);
        this.FDisplText = scaption;
      } else {
        this.FDisplText = pas.SysUtils.StringReplace(AValue,"> <",">&nbsp;<",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
        if ((contentelement != null) && pas.System.Assigned(contentelement.nodeValue)) {
          contentelement.nodeValue = this.FDisplText}
         else if ((contentelement != null) && (contentelement.childElementCount <= 1)) contentelement.innerHTML = this.FDisplText;
      };
    };
    this.DoLinkClick = function (Event) {
      var Result = false;
      var slink = "";
      var stype = "";
      var svalue = "";
      var ltype = 0;
      svalue = Event.target.getAttribute("id");
      stype = "#url#";
      ltype = pas["WEBLib.StdCtrls"].TSysLinkType.sltURL;
      if (!(pas.System.Pos(stype,svalue) > 0)) {
        stype = "#id#";
        ltype = pas["WEBLib.StdCtrls"].TSysLinkType.sltID;
      };
      slink = pas.SysUtils.StringReplace(svalue,stype,"",{});
      if (this.FOnLinkClick != null) this.FOnLinkClick(this,slink,ltype);
      Result = true;
      return Result;
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.Controls"].TControl.Create$1.apply(this,arguments);
      this.FWidthStyle$1 = pas["WEBLib.Controls"].TSizeStyle.ssAbsolute;
      this.FWidthPercent$1 = 100;
      this.FHeightStyle$1 = pas["WEBLib.Controls"].TSizeStyle.ssAbsolute;
      this.FHeightPercent$1 = 100;
      this.SetTransparent(true);
      return this;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("Alignment",2,pas.Classes.$rtti["TAlignment"],"FAlignment","SetAlignment",4,{Default: pas.Classes.TAlignment.taLeftJustify});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("AutoSize",2,rtl.boolean,"FAutoSize","SetAutoSize",4,{Default: true});
    $r.addProperty("Caption",2,rtl.string,"FCaption","SetCaption");
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor$1","SetColorEx",4,{Default: 16777215});
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("EllipsisPosition",2,pas["WEBLib.StdCtrls"].$rtti["TEllipsisPosition"],"FEllipsisPosition","SetEllipsisPosition",4,{Default: pas["WEBLib.StdCtrls"].TEllipsisPosition.epNone});
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("Hint",2,rtl.string,"FHint","SetHint");
    $r.addProperty("Layout",2,pas["WEBLib.StdCtrls"].$rtti["TTextLayout"],"FLayout","SetLayout",4,{Default: pas["WEBLib.StdCtrls"].TTextLayout.tlTop});
    $r.addProperty("Left",3,rtl.longint,"GetLeft","SetLeft");
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",4,{Default: false});
    $r.addProperty("Target",2,$mod.$rtti["TLinkTarget"],"FTarget","SetTarget",4,{Default: $mod.TLinkTarget.ltCurrentTab});
    $r.addProperty("Top",3,rtl.longint,"GetTop","SetTop");
    $r.addProperty("Transparent",2,rtl.boolean,"FTransparent","SetTransparent",4,{Default: true});
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("WordWrap",0,rtl.boolean,"FWordWrap","FWordWrap",4,{Default: false});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle$1","SetHeightStyle$1",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle$1","SetWidthStyle$1",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent$1","SetHeightPercent$1",4,{Default: 100});
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent$1","SetWidthPercent$1",4,{Default: 100});
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnLinkClick",0,pas["WEBLib.StdCtrls"].$rtti["TLinkClickEvent"],"FOnLinkClick","FOnLinkClick");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
  });
  rtl.createClass(this,"TLinkLabel",this.TCustomLinkLabel,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Caption",2,rtl.string,"FCaption","SetCaption");
    $r.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",4,{Default: true});
  });
  rtl.createClass(this,"TWebLinkLabel",this.TLinkLabel,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.TTrackBarOrientation = {"0": "trHorizontal", trHorizontal: 0, "1": "trVertical", trVertical: 1};
  this.$rtti.$Enum("TTrackBarOrientation",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTrackBarOrientation});
  rtl.createClass(this,"TTrackBar",pas["WEBLib.StdCtrls"].TCustomInput,function () {
    this.$init = function () {
      pas["WEBLib.StdCtrls"].TCustomInput.$init.call(this);
      this.FMax = 0;
      this.FMin = 0;
      this.FPosition = 0;
      this.FOnChange = null;
      this.FOrientation = 0;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      pas["WEBLib.StdCtrls"].TCustomInput.$final.call(this);
    };
    this.SetOrientation = function (Value) {
      var ow = 0;
      var oh = 0;
      if (this.FOrientation !== Value) {
        ow = this.GetWidth();
        oh = this.GetHeight();
        this.FOrientation = Value;
        if (!(pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) {
          this.SetWidth(oh);
          this.SetHeight(ow);
        };
        this.UpdateElement();
      };
    };
    this.GetElementInputHandle = function () {
      var Result = null;
      Result = this.GetContainer();
      return Result;
    };
    this.GetInputType = function () {
      var Result = "";
      Result = "range";
      return Result;
    };
    this.DoHandleChange = function (Event) {
      var Result = false;
      var el = null;
      el = this.GetElementHandle();
      this.FPosition = el.value;
      this.Change();
      Result = true;
      return Result;
    };
    this.BindEvents = function () {
      pas["WEBLib.Controls"].TCustomControl.BindEvents.call(this);
      if (this.GetElementHandle() != null) {
        this.GetElementHandle().oninput = rtl.createSafeCallback(this,"DoHandleChange");
      };
    };
    this.SetMax = function (AValue) {
      if (this.FMax !== AValue) {
        this.FMax = AValue;
        this.DoUpdate();
      };
    };
    this.SetMin = function (AValue) {
      if (this.FMin !== AValue) {
        this.FMin = AValue;
        this.DoUpdate();
      };
    };
    this.SetPosition = function (AValue) {
      if (this.FPosition !== AValue) {
        this.FPosition = AValue;
        this.DoUpdate();
      };
    };
    this.GetPosition = function () {
      var Result = 0;
      var s = "";
      Result = this.FPosition;
      if (!(this.GetContainer() != null)) return Result;
      s = this.GetContainer().value;
      if (s !== "") Result = pas.SysUtils.StrToInt(s);
      return Result;
    };
    this.DoUpdate = function () {
      var el = null;
      if (!(this.GetContainer() != null)) return;
      this.GetContainer().setAttribute("max",pas.SysUtils.IntToStr(this.FMax));
      this.GetContainer().setAttribute("min",pas.SysUtils.IntToStr(this.FMin));
      el = this.GetElementHandle();
      el.value = this.FPosition;
      el.setAttribute('value',this.FPosition);
    };
    this.Change = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.CreateControl = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateControl.call(this);
      this.DoUpdate();
    };
    this.UpdateElementVisual = function () {
      var el = null;
      pas["WEBLib.StdCtrls"].TCustomInput.UpdateElementVisual.call(this);
      el = this.GetElementHandle();
      if (this.FOrientation === $mod.TTrackBarOrientation.trHorizontal) {
        el.removeAttribute("orient");
        el.style.removeProperty("writing-mode");
        el.style.removeProperty("-webkit-appearance");
        el.style.removeProperty("height");
        if (this.FWidthStyle === pas["WEBLib.Controls"].TSizeStyle.ssAbsolute) el.style.setProperty("width",pas.SysUtils.IntToStr(this.GetWidth()));
      } else {
        el.setAttribute("orient","vertical");
        el.style.setProperty("writing-mode","bt-lt");
        el.style.setProperty("-webkit-appearance","slider-vertical");
        el.style.removeProperty("width");
        if (this.FHeightStyle === pas["WEBLib.Controls"].TSizeStyle.ssAbsolute) el.style.setProperty("height",pas.SysUtils.IntToStr(this.GetHeight()));
        el.style.setProperty("width","22px");
      };
    };
    this.CreateInitialize = function () {
      pas["WEBLib.StdCtrls"].TCustomInput.CreateInitialize.call(this);
      this.FMax = 100;
      this.FMin = 0;
      this.FPosition = 0;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Left",3,rtl.longint,"GetLeft","SetLeft");
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("Max",2,rtl.longint,"FMax","SetMax",4,{Default: 10});
    $r.addProperty("Min",2,rtl.longint,"FMin","SetMin",4,{Default: 0});
    $r.addProperty("Orientation",2,$mod.$rtti["TTrackBarOrientation"],"FOrientation","SetOrientation",4,{Default: $mod.TTrackBarOrientation.trHorizontal});
    $r.addProperty("Position",3,rtl.longint,"GetPosition","SetPosition",4,{Default: 0});
    $r.addProperty("Role",3,rtl.string,"GetRole","SetRole");
    $r.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",4,{Default: false});
    $r.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder");
    $r.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",4,{Default: true});
    $r.addProperty("Top",3,rtl.longint,"GetTop","SetTop");
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChange","FOnChange");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
  });
  rtl.createClass(this,"TWebTrackBar",this.TTrackBar,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTimer",pas.Classes.TComponent,function () {
    this.$init = function () {
      pas.Classes.TComponent.$init.call(this);
      this.FInterval = 0;
      this.FTimerID = 0;
      this.FOnTimer = null;
      this.FEnabled = false;
    };
    this.$final = function () {
      this.FOnTimer = undefined;
      pas.Classes.TComponent.$final.call(this);
    };
    this.SetEnabled = function (Value) {
      this.FEnabled = Value;
      this.DoUpdateTimer();
    };
    this.SetInterval = function (AValue) {
      this.FInterval = AValue;
      this.DoUpdateTimer();
    };
    this.DoTimer = function () {
      if (this.FOnTimer != null) this.FOnTimer(this);
    };
    this.DoUpdateTimer = function () {
      this.DoClearTimer();
      if (this.FEnabled) this.FTimerID = window.setInterval(rtl.createSafeCallback(this,"DoTimer"),this.FInterval);
    };
    this.DoClearTimer = function () {
      if (this.FTimerID !== -1) {
        window.clearInterval(this.FTimerID);
        this.FTimerID = -1;
      };
    };
    this.Create$1 = function (AOwner) {
      pas.Classes.TComponent.Create$1.apply(this,arguments);
      this.FInterval = 1000;
      this.FTimerID = -1;
      this.SetEnabled(true);
      return this;
    };
    this.Destroy = function () {
      this.DoClearTimer();
      pas.Classes.TComponent.Destroy.call(this);
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Interval",2,rtl.longint,"FInterval","SetInterval",4,{Default: 1000});
    $r.addProperty("OnTimer",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnTimer","FOnTimer");
  });
  rtl.createClass(this,"TWebTimer",this.TTimer,function () {
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.$rtti.$MethodVar("TGeolocationEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Lat",rtl.double],["Lon",rtl.double],["Alt",rtl.double]]), methodkind: 0});
  this.$rtti.$MethodVar("TGeolocationExEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Lat",rtl.double],["Lon",rtl.double],["Alt",rtl.double],["Accuracy",rtl.double]]), methodkind: 0});
  this.$rtti.$MethodVar("TGeolocationErrorEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACode",rtl.longint],["AMessage",rtl.string]]), methodkind: 0});
  this.$rtti.$RefToProcVar("TGeolocationResponseProc",{procsig: rtl.newTIProcSig([["APosition",pas.Web.$rtti["TJSPosition"]]])});
  rtl.createClass(this,"TGeoLocation",pas.Classes.TComponent,function () {
    this.$init = function () {
      pas.Classes.TComponent.$init.call(this);
      this.FOnGeolocation = null;
      this.FWidth = 0;
      this.FHeight = 0;
      this.FMaximumAge = 0;
      this.FTimeOut = 0;
      this.FHighPrecision = false;
      this.FTrackID = 0;
      this.FOnGeolocationUpdate = null;
      this.FOnGeolocationEx = null;
      this.FOnGeolocationError = null;
      this.FOnGeolocationUpdateEx = null;
    };
    this.$final = function () {
      this.FOnGeolocation = undefined;
      this.FOnGeolocationUpdate = undefined;
      this.FOnGeolocationEx = undefined;
      this.FOnGeolocationError = undefined;
      this.FOnGeolocationUpdateEx = undefined;
      pas.Classes.TComponent.$final.call(this);
    };
    this.DoHandleGeolocation = function (APosition) {
      if (this.FOnGeolocation != null) this.FOnGeolocation(this,APosition.coords.latitude,APosition.coords.longitude,APosition.coords.altitude);
      if (this.FOnGeolocationEx != null) this.FOnGeolocationEx(this,APosition.coords.latitude,APosition.coords.longitude,APosition.coords.altitude,APosition.coords.accuracy);
    };
    this.DoHandleError = function (AValue) {
      if (this.FOnGeolocationError != null) this.FOnGeolocationError(this,AValue.code,AValue.message);
    };
    this.DoHandleGeolocationAsync = function (AProc) {
      var $Self = this;
      var posopt = pas.Web.TJSPositionOptions.$new();
      function Handler(APosition) {
        AProc(pas.Web.TJSPosition.$clone(APosition));
      };
      posopt.enableHighAccuracy = this.FHighPrecision;
      posopt.timeout = this.FTimeOut;
      posopt.maximumAge = this.FMaximumAge;
      navigator.geolocation.getCurrentPosition(Handler,null,pas.Web.TJSPositionOptions.$clone(posopt));
    };
    this.DoHandleGeolocationUpdate = function (APosition) {
      if (this.FOnGeolocationUpdate != null) this.FOnGeolocationUpdate(this,APosition.coords.latitude,APosition.coords.longitude,APosition.coords.altitude);
      if (this.FOnGeolocationUpdateEx != null) this.FOnGeolocationUpdateEx(this,APosition.coords.latitude,APosition.coords.longitude,APosition.coords.altitude,APosition.coords.accuracy);
    };
    this.Create$1 = function (AOwner) {
      pas.Classes.TComponent.Create$1.apply(this,arguments);
      this.FHighPrecision = false;
      this.FTimeOut = 60000;
      this.FMaximumAge = 0;
      this.FTrackID = -1;
      return this;
    };
    this.HasGeolocation = function () {
      var Result = false;
      Result = navigator.geolocation != null;
      return Result;
    };
    this.GetGeolocation = function () {
      var posopt = pas.Web.TJSPositionOptions.$new();
      if (navigator.geolocation != null) {
        posopt.enableHighAccuracy = this.FHighPrecision;
        posopt.timeout = this.FTimeOut;
        posopt.maximumAge = this.FMaximumAge;
        navigator.geolocation.getCurrentPosition(rtl.createCallback(this,"DoHandleGeolocation"),rtl.createCallback(this,"DoHandleError"),pas.Web.TJSPositionOptions.$clone(posopt));
      };
    };
    this.GetGeolocationAsync = function () {
      var $Self = this;
      var Result = null;
      var posopt = pas.Web.TJSPositionOptions.$new();
      Result = new Promise(function (ASuccess, AFailed) {
        if (navigator.geolocation != null) {
          $Self.DoHandleGeolocationAsync(function (APosition) {
            ASuccess(pas.Web.TJSPosition.$clone(APosition));
          });
        } else AFailed(null);
      });
      return Result;
    };
    this.StartTracking = function () {
      var posopt = pas.Web.TJSPositionOptions.$new();
      if (this.FTrackID !== -1) this.StopTracking();
      if (navigator.geolocation != null) {
        posopt.enableHighAccuracy = this.FHighPrecision;
        posopt.timeout = this.FTimeOut;
        posopt.maximumAge = this.FMaximumAge;
        this.FTrackID = navigator.geolocation.watchPosition(rtl.createCallback(this,"DoHandleGeolocationUpdate"),rtl.createCallback(this,"DoHandleError"),pas.Web.TJSPositionOptions.$clone(posopt));
      };
    };
    this.StopTracking = function () {
      if ((navigator.geolocation != null) && (this.FTrackID !== -1)) {
        navigator.geolocation.clearWatch(this.FTrackID);
        this.FTrackID = -1;
      };
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("HighPrecision",0,rtl.boolean,"FHighPrecision","FHighPrecision",4,{Default: false});
    $r.addProperty("TimeOut",0,rtl.longint,"FTimeOut","FTimeOut",4,{Default: 60000});
    $r.addProperty("MaximumAge",0,rtl.longint,"FMaximumAge","FMaximumAge",4,{Default: 0});
    $r.addProperty("OnGeolocation",0,$mod.$rtti["TGeolocationEvent"],"FOnGeolocation","FOnGeolocation");
    $r.addProperty("OnGeolocationEx",0,$mod.$rtti["TGeolocationExEvent"],"FOnGeolocationEx","FOnGeolocationEx");
    $r.addProperty("OnGeolocationError",0,$mod.$rtti["TGeolocationErrorEvent"],"FOnGeolocationError","FOnGeolocationError");
    $r.addProperty("OnGeolocationUpdate",0,$mod.$rtti["TGeolocationEvent"],"FOnGeolocationUpdate","FOnGeolocationUpdate");
    $r.addProperty("OnGeolocationUpdateEx",0,$mod.$rtti["TGeolocationExEvent"],"FOnGeolocationUpdateEx","FOnGeolocationUpdateEx");
  });
  rtl.createClass(this,"TWebGeoLocation",this.TGeoLocation,function () {
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TPaintBox",pas["WEBLib.Menus"].TWebGraphicControl,function () {
    this.$init = function () {
      pas["WEBLib.Menus"].TWebGraphicControl.$init.call(this);
      this.FOnPaint = null;
    };
    this.$final = function () {
      this.FOnPaint = undefined;
      pas["WEBLib.Menus"].TWebGraphicControl.$final.call(this);
    };
    this.Paint = function () {
      pas["WEBLib.Controls"].TCustomControl.Paint.call(this);
      if (this.FOnPaint != null) this.FOnPaint(this);
    };
    this.UpdateElementVisual = function () {
      pas["WEBLib.Controls"].TCustomControl.UpdateElementVisual.call(this);
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        this.GetElementHandle().style.setProperty("border","1px dotted gray");
      };
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti["TPopupMenu"],"FPopupMenu","FPopupMenu");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnMouseWheel",0,pas["WEBLib.Controls"].$rtti["TMouseWheelEvent"],"FOnMouseWheel","FOnMouseWheel");
    $r.addProperty("OnPaint",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnPaint","FOnPaint");
    $r.addProperty("OnTouchStart",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchStart","FOnTouchStart");
    $r.addProperty("OnTouchMove",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchMove","FOnTouchMove");
    $r.addProperty("OnTouchEnd",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchEnd","FOnTouchEnd");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
  });
  rtl.createClass(this,"TWebPaintBox",this.TPaintBox,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.$rtti.$RefToProcVar("TImageLoadedProc",{procsig: rtl.newTIProcSig([["AEvent",pas.Web.$rtti["TJSEvent"]]])});
  this.$rtti.$RefToProcVar("TImageErrorProc",{procsig: rtl.newTIProcSig([["AEvent",pas.Web.$rtti["TJSEvent"]]])});
  rtl.createClass(this,"TCustomImageControl",pas["WEBLib.Menus"].TWebCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Menus"].TWebCustomControl.$init.call(this);
      this.FURL = "";
      this.FPicture = null;
      this.FAutoSize = false;
      this.FOnLoaded = null;
      this.FOnError = null;
      this.FImageLoadPtr = null;
      this.FImageErrorPtr = null;
      this.FImageLoaded = null;
      this.FImageError = null;
    };
    this.$final = function () {
      this.FPicture = undefined;
      this.FOnLoaded = undefined;
      this.FOnError = undefined;
      this.FImageLoaded = undefined;
      this.FImageError = undefined;
      pas["WEBLib.Menus"].TWebCustomControl.$final.call(this);
    };
    this.SetURL = function (AURL) {
      this.FURL = AURL;
      this.SetContainerURL(AURL);
    };
    this.GetBase64Img = function () {
      var Result = "";
      Result = pas["WEBLib.WebTools"].GetBase64Image(this.GetElementHandle(),0,0);
      return Result;
    };
    this.HandleImageLoad = function (AEvent) {
      var Result = false;
      var el = null;
      var w = 0;
      var h = 0;
      el = this.GetElementHandle();
      w = el.naturalWidth;
      h = el.naturalHeight;
      this.FPicture.FWidth = w;
      this.FPicture.FHeight = h;
      if (this.FOnLoaded != null) this.FOnLoaded(this);
      if (this.FImageLoaded != null) this.FImageLoaded(AEvent);
      Result = true;
      return Result;
    };
    this.HandleError = function (AEvent) {
      var Result = false;
      var Handled = false;
      var LEventRec = pas["WEBLib.Controls"].TJSEventRecord.$new();
      var LRequestRec = pas["WEBLib.Controls"].TJSXMLHttpRequestRecord.$new();
      Result = true;
      Handled = false;
      if (this.FOnError != null) {
        LEventRec.event = AEvent;
        LRequestRec.req = AEvent.target;
        this.FOnError(this,pas["WEBLib.Controls"].TJSXMLHttpRequestRecord.$clone(LRequestRec),pas["WEBLib.Controls"].TJSEventRecord.$clone(LEventRec),{get: function () {
            return Handled;
          }, set: function (v) {
            Handled = v;
          }});
      };
      if (this.FImageError != null) this.FImageError(AEvent);
      if (!Handled && !(pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) && (this.FURL !== "")) throw pas.SysUtils.Exception.$create("Create$1",["Error loading image " + this.FURL]);
      return Result;
    };
    this.SetPicture = function (Value) {
      this.FPicture.Assign(Value);
    };
    this.PictureChanged = function (Sender) {
      this.SetURL(this.FPicture.FFilename);
      this.UpdateElement();
    };
    this.PictureDataChanged = function (Sender) {
      this.SetContainerURL("data:image/png;base64," + pas["WEBLib.WebTools"].HexImageDecodeAsBase64(this.FPicture.GetData()));
    };
    this.CreateElement = function () {
      var Result = null;
      Result = document.createElement("IMG");
      if (this.FURL !== "") Result.setAttribute("src",this.FURL);
      return Result;
    };
    this.UpdateElement = function () {
      pas["WEBLib.Controls"].TControl.UpdateElement.call(this);
      if (this.FAutoSize && (this.GetElementHandle() != null)) {
        this.GetElementHandle().style.removeProperty("width");
        this.GetElementHandle().style.removeProperty("height");
      };
    };
    this.SetContainerURL = function (AURL) {
      if (this.GetContainer() != null) {
        if (AURL === "") {
          this.GetContainer().removeAttribute("src")}
         else this.GetContainer().setAttribute("src",AURL);
        this.UpdateElement();
      };
    };
    this.BindEvents = function () {
      pas["WEBLib.Controls"].TCustomControl.BindEvents.call(this);
      if (this.GetElementBindHandle() != null) {
        this.GetElementBindHandle().addEventListener("load",this.FImageLoadPtr);
        if (!(pas.Classes.TComponentStateItem.csDesigning in this.FComponentState)) this.GetElementBindHandle().addEventListener("error",this.FImageErrorPtr);
      };
    };
    this.UnbindEvents = function () {
      var eh = null;
      pas["WEBLib.Controls"].TControl.UnbindEvents.call(this);
      if (this.GetElementBindHandle() != null) {
        eh = this.GetElementBindHandle();
        eh.removeEventListener("load",this.FImageLoadPtr);
        if (!(pas.Classes.TComponentStateItem.csDesigning in this.FComponentState)) eh.removeEventListener("error",this.FImageErrorPtr);
      };
    };
    this.ClearMethodPointers = function () {
      pas["WEBLib.Controls"].TControl.ClearMethodPointers.call(this);
      this.FImageLoadPtr = null;
      this.FImageErrorPtr = null;
    };
    this.GetMethodPointers = function () {
      pas["WEBLib.Controls"].TControl.GetMethodPointers.call(this);
      if (this.FImageLoadPtr === null) this.FImageLoadPtr = rtl.createCallback(this,"HandleImageLoad");
      if (this.FImageErrorPtr === null) this.FImageErrorPtr = rtl.createCallback(this,"HandleError");
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.FPicture = pas["WEBLib.Graphics"].TURLPicture.$create("Create");
      this.FPicture.FOnChange = rtl.createCallback(this,"PictureChanged");
      this.FPicture.FOnDataChange = rtl.createCallback(this,"PictureDataChanged");
      this.SetColor(-1);
      this.SetTabStop(false);
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        this.SetWidth(400);
        this.SetHeight(300);
      };
    };
    this.Destroy = function () {
      rtl.free(this,"FPicture");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.Clear = function () {
      this.SetURL($impl.emptyimgres);
    };
    this.DataURL = function () {
      var Result = "";
      Result = "data:image/png;base64," + this.GetBase64Img();
      return Result;
    };
    this.DataURL$1 = function (AWidth, AHeight) {
      var Result = "";
      Result = "data:image/png;base64," + pas["WEBLib.WebTools"].GetBase64Image(this.GetElementHandle(),AWidth,AHeight);
      return Result;
    };
    this.ResizeImage = function () {
      this.ResizeImage$2(this.GetWidth(),this.GetHeight(),false);
    };
    this.ResizeImage$1 = function (AWidth, AHeight) {
      this.ResizeImage$2(AWidth,AHeight,false);
    };
    this.ResizeImage$2 = function (AWidth, AHeight, AspectRatio) {
      var w = 0;
      var h = 0;
      var r = 0.0;
      if (AspectRatio) {
        if ((this.ImageWidth() === AWidth) || (this.ImageHeight() === AHeight)) return;
      } else {
        if ((this.ImageWidth() === AWidth) && (this.ImageHeight() === AHeight)) return;
      };
      if ((AWidth === 0) || (AHeight === 0)) return;
      w = AWidth;
      h = AHeight;
      if (AspectRatio) {
        if ((this.ImageWidth() / w) > (this.ImageHeight() / h)) {
          r = this.ImageWidth() / w}
         else r = this.ImageHeight() / h;
        w = Math.round(this.ImageWidth() / r);
        h = Math.round(this.ImageHeight() / r);
      };
      this.SetURL("data:image/png;base64," + pas["WEBLib.WebTools"].GetBase64Image(this.GetElementHandle(),w,h));
    };
    this.ImageWidth = function () {
      var Result = 0;
      var el = null;
      var w = 0;
      Result = -1;
      if (this.GetElementHandle() != null) {
        el = this.GetElementHandle();
        w = el.naturalWidth;
        Result = w;
      };
      return Result;
    };
    this.ImageHeight = function () {
      var Result = 0;
      var el = null;
      var h = 0;
      Result = -1;
      if (this.GetElementHandle() != null) {
        el = this.GetElementHandle();
        h = el.naturalHeight;
        Result = h;
      };
      return Result;
    };
    this.LoadFromArrayBuffer = function (AArray) {
      var uint8b = null;
      var dataUri = "";
      uint8b = new Uint8Array(AArray);
      dataUri = btoa(new Uint8Array(uint8b).reduce(function (data, byte) {
      return data + String.fromCharCode(byte);
      }, ''));
      this.SetURL("data:image/jpeg;base64," + dataUri);
    };
    this.SaveToArrayBuffer = function (AArray) {
      AArray = pas["WEBLib.Utils"].Base64ToArrayBuffer(this.GetBase64Img());
    };
    this.LoadFromURL = function (AURL) {
      var $Self = this;
      var Result = null;
      Result = new Promise(function (ASuccess, AFailed) {
        $Self.LoadFromURL$1(AURL,function (AEvent) {
          ASuccess(AEvent);
        },function (AEvent) {
          AFailed(AEvent);
        });
      });
      return Result;
    };
    this.LoadFromURL$1 = function (AURL, ImageLoaded, ImageError) {
      this.FImageLoaded = ImageLoaded;
      this.FImageError = ImageError;
      this.SetURL(AURL);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("AutoSize",0,rtl.boolean,"FAutoSize","FAutoSize",4,{Default: false});
    $r.addProperty("Center",0,pas["WEBLib.Controls"].$rtti["TCenter"],"FCenter","");
    $r.addProperty("ChildOrder",2,rtl.longint,"FChildOrder","SetChildOrderEx",4,{Default: 0});
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti["TPopupMenu"],"FPopupMenu","FPopupMenu");
    $r.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",4,{Default: false});
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnError",0,pas["WEBLib.Controls"].$rtti["THTTPErrorEvent"],"FOnError","FOnError");
    $r.addProperty("OnLoaded",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnLoaded","FOnLoaded");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
  });
  rtl.createClass(this,"TImageControl",this.TCustomImageControl,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Picture",2,pas["WEBLib.Graphics"].$rtti["TURLPicture"],"FPicture","SetPicture");
    $r.addProperty("URL",2,rtl.string,"FURL","SetURL");
  });
  rtl.createClass(this,"TWebImageControl",this.TImageControl,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.$rtti.$Class("TImageZoomControl");
  rtl.createClass(this,"TImageZoomAppearance",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FOwner = null;
      this.FHeightPercent = 0;
      this.FWidthPercent = 0;
      this.FResponsiveHeightPercent = 0;
      this.FResponsiveWidthPercent = 0;
      this.FResponsiveMaxWidth = 0;
    };
    this.$final = function () {
      this.FOwner = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetHeightPercent = function (Value) {
      if ((this.FHeightPercent !== Value) && (this.FHeightPercent <= 100)) {
        this.FHeightPercent = Value;
        this.FOwner.UpdateElement();
      };
    };
    this.SetWidthPercent = function (Value) {
      if ((this.FWidthPercent !== Value) && (this.FWidthPercent <= 100)) {
        this.FWidthPercent = Value;
        this.FOwner.UpdateElement();
      };
    };
    this.SetResponsiveHeightPercent = function (Value) {
      if ((this.FResponsiveHeightPercent !== Value) && (this.FResponsiveHeightPercent <= 100)) {
        this.FResponsiveHeightPercent = Value;
        this.FOwner.UpdateElement();
      };
    };
    this.SetResponsiveWidthPercent = function (Value) {
      if ((this.FResponsiveWidthPercent !== Value) && (this.FResponsiveWidthPercent <= 100)) {
        this.FResponsiveWidthPercent = Value;
        this.FOwner.UpdateElement();
      };
    };
    this.SetResponsiveMaxWidth = function (Value) {
      if ((this.FResponsiveMaxWidth !== Value) && (this.FResponsiveMaxWidth >= 0)) {
        this.FResponsiveMaxWidth = Value;
        this.FOwner.UpdateElement();
      };
    };
    this.Create$1 = function (AOwner) {
      this.FHeightPercent = 100;
      this.FWidthPercent = 100;
      this.FResponsiveHeightPercent = 100;
      this.FResponsiveWidthPercent = 100;
      this.FResponsiveMaxWidth = 768;
      this.FOwner = AOwner;
      return this;
    };
    this.Destroy = function () {
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      pas.Classes.TPersistent.Assign.apply(this,arguments);
      if ($mod.TImageZoomAppearance.isPrototypeOf(Source)) {
        this.FHeightPercent = rtl.as(Source,$mod.TImageZoomAppearance).FHeightPercent;
        this.FWidthPercent = rtl.as(Source,$mod.TImageZoomAppearance).FWidthPercent;
        this.FResponsiveHeightPercent = rtl.as(Source,$mod.TImageZoomAppearance).FResponsiveHeightPercent;
        this.FResponsiveWidthPercent = rtl.as(Source,$mod.TImageZoomAppearance).FResponsiveWidthPercent;
        this.FResponsiveMaxWidth = rtl.as(Source,$mod.TImageZoomAppearance).FResponsiveMaxWidth;
      };
    };
    this.GetOwner = function () {
      var Result = null;
      Result = this.FOwner;
      return Result;
    };
    var $r = this.$rtti;
    $r.addProperty("HeightPercent",2,rtl.longint,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("WidthPercent",2,rtl.longint,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("ResponsiveHeightPercent",2,rtl.longint,"FResponsiveHeightPercent","SetResponsiveHeightPercent",4,{Default: 100});
    $r.addProperty("ResponsiveWidthPercent",2,rtl.longint,"FResponsiveWidthPercent","SetResponsiveWidthPercent",4,{Default: 100});
    $r.addProperty("ResponsiveMaxWidth",2,rtl.longint,"FResponsiveMaxWidth","SetResponsiveMaxWidth",4,{Default: 768});
  });
  rtl.createClass(this,"TImageZoomControl",this.TCustomImageControl,function () {
    this.$init = function () {
      $mod.TCustomImageControl.$init.call(this);
      this.FStyle = null;
      this.FOverlay = null;
      this.FPictureZoom = null;
      this.FURLZoom = "";
      this.FPictureZoomDataURL = "";
      this.FAppearance = null;
      this.FZoomBkgOpacity = 0.0;
      this.FZoomBkgColor = 0;
    };
    this.$final = function () {
      this.FStyle = undefined;
      this.FOverlay = undefined;
      this.FPictureZoom = undefined;
      this.FAppearance = undefined;
      $mod.TCustomImageControl.$final.call(this);
    };
    this.SetPictureZoom = function (Value) {
      this.FPictureZoom.Assign(Value);
    };
    this.SetURLZoom = function (Value) {
      if (this.FURLZoom !== Value) {
        this.FURLZoom = Value;
        this.UpdateElement();
      };
    };
    this.PictureZoomChanged = function (Sender) {
      this.SetURLZoom(this.FPictureZoom.FFilename);
      this.FPictureZoomDataURL = "";
      this.UpdateElement();
    };
    this.PictureZoomDataChanged = function (Sender) {
      this.FPictureZoomDataURL = "data:image/png;base64," + pas["WEBLib.WebTools"].HexImageDecodeAsBase64(this.FPictureZoom.GetData());
      this.UpdateElement();
    };
    this.UpdateElement = function () {
      var PopupImage = "";
      var Popup = null;
      var r = 0;
      var g = 0;
      var b = 0;
      var l = 0;
      var op = "";
      $mod.TCustomImageControl.UpdateElement.call(this);
      if (!(this.GetElementHandle() != null)) return;
      if (this.FOverlay != null) {
        this.GetElementHandle().setAttribute("onClick",'document.getElementById("' + this.FName + 'myModal").style.display = "block"');
        if (this.FPictureZoomDataURL !== "") {
          PopupImage = this.FPictureZoomDataURL}
         else PopupImage = this.FURLZoom;
        if (PopupImage === "") PopupImage = this.FURL;
        if (this.GetIsLinked() && (PopupImage === "")) {
          PopupImage = this.GetElementHandle().getAttribute("src");
        };
        op = pas.SysUtils.FloatToStr(this.FZoomBkgOpacity);
        pas.SysUtils.StringReplace(op,",",".",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
        l = pas["WEBLib.Graphics"].ColorToRGB(this.FZoomBkgColor);
        r = pas["WEBLib.Graphics"].GetRValue(l);
        g = pas["WEBLib.Graphics"].GetGValue(l);
        b = pas["WEBLib.Graphics"].GetBValue(l);
        this.FStyle.innerHTML = "." + this.FName + "modal-overlay {\r" + "  display: none;\r" + "  position: fixed;\r" + "  z-index: 99999999;\r" + "  width: 100%;\r" + "  height: 100%;\r" + "  overflow: hidden;\r" + "  top: 50%;\r" + "  left: 50%;\r" + "  -ms-transform: translate(-50%, -50%);\r" + "  transform: translate(-50%, -50%);\r" + "  background-color: rgba(" + pas.SysUtils.TByteHelper.ToString$1.call({get: function () {
            return r;
          }, set: function (v) {
            r = v;
          }}) + "," + pas.SysUtils.TByteHelper.ToString$1.call({get: function () {
            return g;
          }, set: function (v) {
            g = v;
          }}) + "," + pas.SysUtils.TByteHelper.ToString$1.call({get: function () {
            return b;
          }, set: function (v) {
            b = v;
          }}) + ",0.2);\r" + "}\r" + "." + this.FName + "modal {\r" + "  display: block;\r" + "  position: absolute;\r" + "  z-index: 99999999;\r" + "  width: " + pas.SysUtils.IntToStr(this.FAppearance.FWidthPercent) + "%;\r" + "  height: " + pas.SysUtils.IntToStr(this.FAppearance.FHeightPercent) + "%;\r" + "  overflow: hidden;\r" + "  top: 50%;\r" + "  left: 50%;\r" + "  -ms-transform: translate(-50%, -50%);\r" + "  transform: translate(-50%, -50%);\r" + "  background-color: rgba(" + pas.SysUtils.TByteHelper.ToString$1.call({get: function () {
            return r;
          }, set: function (v) {
            r = v;
          }}) + "," + pas.SysUtils.TByteHelper.ToString$1.call({get: function () {
            return g;
          }, set: function (v) {
            g = v;
          }}) + "," + pas.SysUtils.TByteHelper.ToString$1.call({get: function () {
            return b;
          }, set: function (v) {
            b = v;
          }}) + "," + op + ");\r" + "}\r" + "." + this.FName + "modal-content {\r" + "  display: block;\r" + "  margin: 0;\r" + "  position: absolute;\r" + "  top: 50%;\r" + "  left: 50%;\r" + "  -ms-transform: translate(-50%, -50%);\r" + "  transform: translate(-50%, -50%);\r" + "  max-width: 100%;\r" + "  max-height: 100%;\r" + "}\r" + "." + this.FName + "close {\r" + "  z-index: 99999999;\r" + "  position: absolute;\r" + "  top: 15px;\r" + "  right: 35px;\r" + "  color: #f1f1f1;\r" + "  font-size: 40px;\r" + "  font-weight: bold;\r" + "  transition: 0.3s;\r" + "}\r" + "." + this.FName + "close:hover,\r" + "." + this.FName + "close:focus {\r" + "  color: #bbb;\r" + "  text-decoration: none;\r" + "  cursor: pointer;\r" + "}\r" + "@media only screen and (max-width: 769px) {\r" + "\t." + this.FName + "modal {\r" + "  width: " + pas.SysUtils.IntToStr(this.FAppearance.FResponsiveWidthPercent) + "%;\r" + "  height: " + pas.SysUtils.IntToStr(this.FAppearance.FResponsiveHeightPercent) + "%;\r" + "\t}\r" + "}\r";
        this.FOverlay.setAttribute("onClick",'this.style.display = "none";');
        this.FOverlay.setAttribute("id",this.FName + "myModal");
        this.FOverlay.setAttribute("class",this.FName + "modal-overlay");
        while (this.FOverlay.firstChild != null) this.FOverlay.removeChild(this.FOverlay.firstChild);
        Popup = document.createElement("DIV");
        Popup.setAttribute("class",this.FName + "modal");
        Popup.innerHTML = '<span class="' + this.FName + 'close">&times;</span>' + '<img class="' + this.FName + 'modal-content" src="' + PopupImage + '">';
        this.FOverlay.innerHTML = "";
        this.FOverlay.appendChild(Popup);
      };
    };
    this.CreateInitialize = function () {
      $mod.TCustomImageControl.CreateInitialize.call(this);
      this.FAppearance = $mod.TImageZoomAppearance.$create("Create$1",[this]);
      this.FPictureZoom = pas["WEBLib.Graphics"].TURLPicture.$create("Create");
      this.FPictureZoom.FOnChange = rtl.createCallback(this,"PictureZoomChanged");
      this.FPictureZoom.FOnDataChange = rtl.createCallback(this,"PictureZoomDataChanged");
      this.FPictureZoomDataURL = "";
      this.FZoomBkgColor = 0;
      this.FZoomBkgOpacity = 0.9;
      this.FStyle = document.createElement("STYLE");
      this.FOverlay = document.createElement("DIV");
      document.body.appendChild(this.FStyle);
      document.body.appendChild(this.FOverlay);
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        this.SetWidth(100);
        this.SetHeight(75);
      };
    };
    this.CreateElement = function () {
      var Result = null;
      Result = $mod.TCustomImageControl.CreateElement.call(this);
      return Result;
    };
    this.Destroy = function () {
      rtl.free(this,"FAppearance");
      rtl.free(this,"FPictureZoom");
      $mod.TCustomImageControl.Destroy.call(this);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Appearance",0,$mod.$rtti["TImageZoomAppearance"],"FAppearance","FAppearance");
    $r.addProperty("Picture",2,pas["WEBLib.Graphics"].$rtti["TURLPicture"],"FPicture","SetPicture");
    $r.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti["TPopupMenu"],"FPopupMenu","FPopupMenu");
    $r.addProperty("URL",2,rtl.string,"FURL","SetURL");
    $r.addProperty("PictureZoom",2,pas["WEBLib.Graphics"].$rtti["TURLPicture"],"FPictureZoom","SetPictureZoom");
    $r.addProperty("URLZoom",2,rtl.string,"FURLZoom","SetURLZoom");
    $r.addProperty("ZoomBkgColor",0,pas["WEBLib.Graphics"].$rtti["TColor"],"FZoomBkgColor","FZoomBkgColor",4,{Default: 0});
    $r.addProperty("ZoomBkgOpacity",0,rtl.double,"FZoomBkgOpacity","FZoomBkgOpacity");
  });
  rtl.createClass(this,"TWebImageZoomControl",this.TImageZoomControl,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TCustomPanel",pas["WEBLib.Menus"].TWebCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Menus"].TWebCustomControl.$init.call(this);
      this.FAutoSize = false;
      this.FIsSizing = false;
      this.FPadding = null;
      this.FShowCaption = false;
      this.FLabel = null;
      this.FPanelBody = null;
      this.FElementBodyClassName = "";
      this.FAlignment = 0;
    };
    this.$final = function () {
      this.FPadding = undefined;
      this.FLabel = undefined;
      this.FPanelBody = undefined;
      pas["WEBLib.Menus"].TWebCustomControl.$final.call(this);
    };
    this.SetShowCaption = function (Value) {
      if (this.FShowCaption !== Value) {
        this.FShowCaption = Value;
        this.UpdateElementVisual();
      };
    };
    this.SetPadding = function (Value) {
      this.FPadding.Assign(Value);
      this.Realign();
    };
    this.SetAlignment = function (Value) {
      if (this.FAlignment !== Value) {
        this.FAlignment = Value;
        this.UpdateElement();
      };
    };
    this.CreateElement = function () {
      var Result = null;
      Result = document.createElement("SPAN");
      this.FPanelBody = document.createElement("DIV");
      this.FPanelBody.setAttribute("class","card-body");
      Result.appendChild(this.FPanelBody);
      return Result;
    };
    this.SetCaption = function (AValue) {
      pas["WEBLib.Controls"].TCustomControl.SetCaption.call(this,AValue);
      if ((this.GetElementHandle() != null) && this.FShowCaption) {
        if (!(this.FLabel != null)) {
          this.FLabel = document.createElement("SPAN");
          this.FLabel.innerHTML = this.FCaption;
          if (this.GetChildContainer() != null) {
            this.GetChildContainer().appendChild(this.FLabel)}
           else this.GetElementHandle().appendChild(this.FLabel);
          this.UpdateElementVisual();
        } else {
          this.FLabel.innerHTML = this.FCaption;
        };
      };
    };
    this.SetBorderStyle = function (AValue) {
      pas["WEBLib.Controls"].TCustomControl.SetBorderStyle.apply(this,arguments);
      this.UpdateElement();
    };
    this.SetAutoSize = function (AValue) {
      this.FAutoSize = AValue;
      if (this.FAutoSize && !this.IsUpdating()) {
        this.DoAutoSize();
      };
    };
    this.UpdateElementVisual = function () {
      pas["WEBLib.Controls"].TCustomControl.UpdateElementVisual.call(this);
      if (this.GetElementHandle() != null) {
        if (!this.GetIsLinked()) {
          if (this.FAutoSize) {
            this.GetElementHandle().style.setProperty("overflow","");
            this.GetElementHandle().style.setProperty("white-space","normal");
            if (this.FVisible) this.GetElementHandle().style.setProperty("display","inline");
          } else {
            this.GetElementHandle().style.setProperty("overflow","hidden");
            this.GetElementHandle().style.setProperty("white-space","nowrap");
            if (this.FVisible) this.GetElementHandle().style.setProperty("display","inline-block");
          };
          this.GetElementHandle().style.setProperty("padding-left",pas.SysUtils.IntToStr(this.FPadding.FLeft) + "px");
          this.GetElementHandle().style.setProperty("padding-right",pas.SysUtils.IntToStr(this.FPadding.FRight) + "px");
          this.GetElementHandle().style.setProperty("padding-top",pas.SysUtils.IntToStr(this.FPadding.FTop) + "px");
          this.GetElementHandle().style.setProperty("padding-bottom",pas.SysUtils.IntToStr(this.FPadding.FBottom) + "px");
          this.GetElementHandle().style.setProperty("box-sizing","border-box");
          if (this.FElementBodyClassName !== "") {
            this.GetChildContainer().setAttribute("class",this.FElementBodyClassName)}
           else this.GetChildContainer().removeAttribute("class");
        };
        if (this.FLabel != null) {
          if (this.FShowCaption) {
            this.FLabel.innerHTML = this.FCaption}
           else this.FLabel.innerHTML = "";
          if (this.FVisible) {
            this.GetElementHandle().style.setProperty("display","flex");
            var $tmp = this.FAlignment;
            if ($tmp === pas.Classes.TAlignment.taLeftJustify) {
              this.GetElementHandle().style.setProperty("justify-content","flex-start")}
             else if ($tmp === pas.Classes.TAlignment.taCenter) {
              this.GetElementHandle().style.setProperty("justify-content","center")}
             else if ($tmp === pas.Classes.TAlignment.taRightJustify) this.GetElementHandle().style.setProperty("justify-content","flex-end");
            this.GetElementHandle().style.setProperty("align-items","center");
          };
        };
        this.GetElementHandle().style.setProperty("user-select","");
        if (this.FCursor === 0) this.GetElementHandle().style.setProperty("cursor","");
      };
    };
    this.HandleKeyPreview = function (Key) {
      var i = 0;
      for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
        i = $l;
        if ((Key === 13) || (Key === 27)) this.GetControls(i).HandleKeyPreview(Key);
      };
    };
    this.GetOuterWidth = function () {
      var Result = 0;
      Result = pas["WEBLib.Controls"].TControl.GetOuterWidth.call(this);
      return Result;
    };
    this.GetOuterHeight = function () {
      var Result = 0;
      Result = pas["WEBLib.Controls"].TControl.GetOuterHeight.call(this);
      return Result;
    };
    this.GetChildContainer = function () {
      var Result = null;
      if (this.FPanelBody != null) {
        Result = this.FPanelBody}
       else Result = pas["WEBLib.Controls"].TControl.GetChildContainer.call(this);
      return Result;
    };
    this.RegisterParent = function (AValue) {
      pas["WEBLib.Controls"].TControl.RegisterParent.apply(this,arguments);
      if (this.FAutoSize) this.DoAutoSize();
    };
    this.UnRegisterParent = function (AValue) {
      pas["WEBLib.Controls"].TControl.UnRegisterParent.apply(this,arguments);
      if (this.FAutoSize) this.DoAutoSize();
    };
    this.UpdatePadding = function (ARect) {
      ARect.Left = this.FPadding.FLeft;
      ARect.Top = this.FPadding.FTop;
      ARect.Right = ARect.Right - this.FPadding.FRight;
      ARect.Bottom = ARect.Bottom - this.FPadding.FBottom;
    };
    this.DoAutoSize = function () {
      var i = 0;
      var minx = 0;
      var miny = 0;
      var maxx = 0;
      var maxy = 0;
      var r = null;
      var el = null;
      if (this.FIsSizing) return;
      this.FIsSizing = true;
      if ((this.FWidthStyle === pas["WEBLib.Controls"].TSizeStyle.ssAbsolute) && (this.FHeightStyle === pas["WEBLib.Controls"].TSizeStyle.ssAbsolute)) {
        maxx = 0;
        maxy = 0;
        minx = 0xFFFF;
        miny = 0xFFFF;
        for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
          i = $l;
          if (this.GetControls(i).FWidthStyle === pas["WEBLib.Controls"].TSizeStyle.ssAbsolute) {
            if ((this.GetControls(i).GetLeft() + this.GetControls(i).GetWidth()) > maxx) maxx = this.GetControls(i).GetLeft() + this.GetControls(i).GetWidth();
            if (this.GetControls(i).GetLeft() < minx) minx = this.GetControls(i).GetLeft();
          } else {
            el = this.GetControls(i).GetElementHandle();
            if (el != null) {
              r = el.getBoundingClientRect();
              if (((r.x - this.GetLeft()) + r.width) > maxx) maxx = Math.round((r.x - this.GetLeft()) + r.width);
              minx = 0;
            };
          };
          if (this.GetControls(i).FHeightStyle === pas["WEBLib.Controls"].TSizeStyle.ssAbsolute) {
            if ((this.GetControls(i).GetTop() + this.GetControls(i).GetHeight()) > maxy) maxy = this.GetControls(i).GetTop() + this.GetControls(i).GetHeight();
            if (this.GetControls(i).GetTop() < miny) miny = this.GetControls(i).GetTop();
          } else {
            el = this.GetControls(i).GetElementHandle();
            if (el != null) {
              r = el.getBoundingClientRect();
              if (((r.y - this.GetTop()) + r.height) > maxy) maxy = Math.round((r.y - this.GetTop()) + r.height);
              miny = 0;
            };
          };
        };
        if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
          if ((this.GetControlsCount() === 0) || (maxx === 0) || (maxy === 0)) return;
        };
        if (this.FBorderStyle === pas["WEBLib.Controls"].TBorderStyle.bsSingle) {
          maxx += 1;
          maxy += 1;
        };
        for (var $l1 = 0, $end1 = this.GetControlsCount() - 1; $l1 <= $end1; $l1++) {
          i = $l1;
          this.GetControls(i).SetLeft(this.GetControls(i).GetLeft() - minx);
          this.GetControls(i).SetTop(this.GetControls(i).GetTop() - miny);
        };
        this.SetWidth(maxx - minx);
        this.SetHeight(maxy - miny);
      } else {
        this.SetWidth(-1);
        this.SetHeight(-1);
      };
      this.UpdateElement();
      this.FIsSizing = false;
    };
    this.AlignControl = function (AControl) {
      pas["WEBLib.Controls"].TControl.AlignControl.apply(this,arguments);
      if (this.FAutoSize) this.DoAutoSize();
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) this.FEnablePropagation = true;
      this.FAutoSize = false;
      this.FAlignment = pas.Classes.TAlignment.taCenter;
      this.SetColor(15790320);
      this.SetTabStop(false);
      this.FCustomBorder = true;
      this.SetShowCaption(true);
      this.FControlStyle = rtl.unionSet(this.FControlStyle,rtl.createSet(pas["WEBLib.Controls"].TControlStyleValue.csAcceptsControls));
      this.FLabel = null;
      this.FPadding = pas["WEBLib.Controls"].TPadding.$create("Create$1");
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        this.SetWidth(400);
        this.SetHeight(300);
      };
    };
    this.Destroy = function () {
      rtl.free(this,"FPadding");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.EndUpdate = function () {
      pas["WEBLib.Controls"].TCustomControl.EndUpdate.call(this);
      if (this.FAutoSize) this.SetAutoSize(true);
    };
    this.SetBounds = function (X, Y, AWidth, AHeight) {
      pas["WEBLib.Controls"].TControl.SetBounds.apply(this,arguments);
      if (this.FAutoSize) this.DoAutoSize();
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TPanel",this.TCustomPanel,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("Alignment",2,pas.Classes.$rtti["TAlignment"],"FAlignment","SetAlignment",4,{Default: pas.Classes.TAlignment.taCenter});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("AutoSize",2,rtl.boolean,"FAutoSize","SetAutoSize",4,{Default: false});
    $r.addProperty("BorderColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FBorderColor","SetBorderColor",4,{Default: 12632256});
    $r.addProperty("BorderStyle",2,pas["WEBLib.Controls"].$rtti["TBorderStyle"],"FBorderStyle","SetBorderStyle",4,{Default: pas["WEBLib.Controls"].TBorderStyle.bsSingle});
    $r.addProperty("Caption",2,rtl.string,"FCaption","SetCaption");
    $r.addProperty("Center",0,pas["WEBLib.Controls"].$rtti["TCenter"],"FCenter","");
    $r.addProperty("ChildOrder",2,rtl.longint,"FChildOrder","SetChildOrderEx",4,{Default: 0});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor");
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("ElementBodyClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementBodyClassName","FElementBodyClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("Padding",2,pas["WEBLib.Controls"].$rtti["TPadding"],"FPadding","SetPadding");
    $r.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",4,{Default: true});
    $r.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti["TPopupMenu"],"FPopupMenu","FPopupMenu");
    $r.addProperty("Role",3,rtl.string,"GetRole","SetRole");
    $r.addProperty("ShowCaption",2,rtl.boolean,"FShowCaption","SetShowCaption",4,{Default: true});
    $r.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder");
    $r.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",4,{Default: true});
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
    $r.addProperty("OnTouchStart",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchStart","FOnTouchStart");
    $r.addProperty("OnTouchMove",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchMove","FOnTouchMove");
    $r.addProperty("OnTouchEnd",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchEnd","FOnTouchEnd");
    $r.addProperty("OnTouchCancel",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchCancel","FOnTouchCancel");
  });
  rtl.createClass(this,"TDivPanel",this.TPanel,function () {
    this.CreateElement = function () {
      var Result = null;
      Result = document.createElement("DIV");
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TWebPanel",this.TPanel,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TCustomGroupBox",pas["WEBLib.Menus"].TWebCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Menus"].TWebCustomControl.$init.call(this);
      this.FCaption$1 = "";
      this.FLegend = null;
      this.FFieldSet = null;
      this.FElementLegendClassName = "";
      this.FPadding = null;
      this.FTransparent = false;
    };
    this.$final = function () {
      this.FLegend = undefined;
      this.FFieldSet = undefined;
      this.FPadding = undefined;
      pas["WEBLib.Menus"].TWebCustomControl.$final.call(this);
    };
    this.SetElementLegendClassName = function (Value) {
      if (this.FElementLegendClassName !== Value) {
        this.FElementLegendClassName = Value;
        this.UpdateElementVisual();
      };
    };
    this.SetPadding = function (Value) {
      this.FPadding.Assign(Value);
      this.Realign();
    };
    this.SetTransparent = function (Value) {
      if (this.FTransparent !== Value) {
        this.FTransparent = Value;
        this.UpdateElementVisual();
      };
    };
    this.UpdatePadding = function (ARect) {
      ARect.Left = this.FPadding.FLeft;
      ARect.Top = this.FPadding.FTop;
      ARect.Right = ARect.Right - this.FPadding.FRight;
      ARect.Bottom = ARect.Bottom - this.FPadding.FBottom;
    };
    this.SetFieldSetSize = function () {
      var dx = 0;
      var dy = 0;
      if (this.FFieldSet != null) {
        dx = 4;
        dy = 2;
        if ((this.FElementClassName !== "") || (this.FElementLegendClassName !== "")) {
          dx = 0;
          dy = 0;
        };
        if (this.FWidthStyle === pas["WEBLib.Controls"].TSizeStyle.ssAbsolute) {
          this.FFieldSet.style.setProperty("width",pas.SysUtils.IntToStr(this.GetWidth() - dx) + "px")}
         else this.FFieldSet.style.setProperty("width","90%");
        if (this.FHeightStyle === pas["WEBLib.Controls"].TSizeStyle.ssAbsolute) {
          this.FFieldSet.style.setProperty("height",pas.SysUtils.IntToStr(this.GetHeight() - dy) + "px")}
         else this.FFieldSet.style.setProperty("height","90%");
      };
    };
    this.SetCaption = function (Value) {
      if (this.FCaption$1 !== Value) {
        this.FCaption$1 = Value;
        this.UpdateElementData();
      };
    };
    this.CreateElement = function () {
      var Result = null;
      Result = document.createElement("DIV");
      this.FFieldSet = document.createElement("FIELDSET");
      Result.appendChild(this.FFieldSet);
      this.FLegend = document.createElement("LEGEND");
      this.FFieldSet.appendChild(this.FLegend);
      this.FLegend.innerHTML = this.FCaption$1;
      return Result;
    };
    this.UpdateElementData = function () {
      pas["WEBLib.Controls"].TControl.UpdateElementData.call(this);
      if (this.FLegend != null) {
        this.FLegend.innerHTML = this.FCaption$1;
      };
    };
    this.UpdateElementVisual = function () {
      pas["WEBLib.Controls"].TCustomControl.UpdateElementVisual.call(this);
      if (this.GetElementHandle() != null) {
        this.GetElementHandle().style.removeProperty("background-color");
      };
      if (this.FLegend != null) {
        this.FLegend.setAttribute("class","w-auto " + this.FElementLegendClassName);
        this.FLegend.style.setProperty("float","none");
      };
      if (this.FFieldSet != null) {
        if (this.FTransparent) {
          this.FFieldSet.style.removeProperty("background-color")}
         else this.FFieldSet.style.setProperty("background-color",pas["WEBLib.Graphics"].ColorToHTML(this.FColor));
        this.FFieldSet.style.setProperty("overflow","visible");
        this.SetFieldSetSize();
        this.FFieldSet.style.setProperty("white-space","nowrap");
        this.FFieldSet.style.setProperty("padding-left",pas.SysUtils.IntToStr(this.FPadding.FLeft) + "px");
        this.FFieldSet.style.setProperty("padding-right",pas.SysUtils.IntToStr(this.FPadding.FRight) + "px");
        this.FFieldSet.style.setProperty("padding-top",pas.SysUtils.IntToStr(this.FPadding.FTop) + "px");
        this.FFieldSet.style.setProperty("padding-bottom",pas.SysUtils.IntToStr(this.FPadding.FBottom) + "px");
        if (this.FVisible) this.FFieldSet.style.setProperty("display","inline-block");
        this.FFieldSet.style.setProperty("webkit-user-select","none");
        this.FFieldSet.style.setProperty("moz-user-select","none");
        this.FFieldSet.style.setProperty("khtml-user-select","none");
        this.FFieldSet.style.setProperty("ms-user-select","none");
        this.FFieldSet.style.setProperty("user-select","none");
        this.FFieldSet.style.setProperty("border","1px solid " + pas["WEBLib.Graphics"].ColorToHTML(this.FBorderColor));
      };
    };
    this.SetBoundsInt = function (X, Y, AWidth, AHeight) {
      pas["WEBLib.Controls"].TControl.SetBoundsInt.apply(this,arguments);
      this.SetFieldSetSize();
    };
    this.InitCSSLibrary = function (ALibrary) {
      if (ALibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap) {
        this.SetElementLegendClassName("h6");
      };
    };
    this.Destroy = function () {
      rtl.free(this,"FPadding");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.FEnablePropagation = true;
      this.FControlStyle = rtl.unionSet(this.FControlStyle,rtl.createSet(pas["WEBLib.Controls"].TControlStyleValue.csAcceptsControls));
      this.SetColor(15790320);
      this.FTransparent = false;
      this.FPadding = pas["WEBLib.Controls"].TPadding.$create("Create$1");
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        this.SetWidth(400);
        this.SetHeight(300);
      };
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TGroupBox",this.TCustomGroupBox,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("BorderColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FBorderColor","SetBorderColor",4,{Default: 12632256});
    $r.addProperty("Caption",2,rtl.string,"FCaption$1","SetCaption");
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor");
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementLegendClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementLegendClassName","SetElementLegendClassName");
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",4,{Default: true});
    $r.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti["TPopupMenu"],"FPopupMenu","FPopupMenu");
    $r.addProperty("Role",3,rtl.string,"GetRole","SetRole");
    $r.addProperty("Transparent",2,rtl.boolean,"FTransparent","SetTransparent");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
    $r.addProperty("OnTouchStart",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchStart","FOnTouchStart");
    $r.addProperty("OnTouchMove",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchMove","FOnTouchMove");
    $r.addProperty("OnTouchEnd",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchEnd","FOnTouchEnd");
    $r.addProperty("OnTouchCancel",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchCancel","FOnTouchCancel");
  });
  rtl.createClass(this,"TWebGroupBox",this.TGroupBox,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TScrollBox",this.TCustomPanel,function () {
    this.$init = function () {
      $mod.TCustomPanel.$init.call(this);
      this.FAutoScroll = false;
      this.FScrollBars = 0;
      this.FScrollPtr = null;
      this.FOnScroll = null;
      this.FVertScrollBar = null;
      this.FHorzScrollBar = null;
    };
    this.$final = function () {
      this.FOnScroll = undefined;
      this.FVertScrollBar = undefined;
      this.FHorzScrollBar = undefined;
      $mod.TCustomPanel.$final.call(this);
    };
    this.GetScrollLeft = function () {
      var Result = 0;
      Result = this.GetElementHandle().scrollLeft;
      return Result;
    };
    this.GetScrollTop = function () {
      var Result = 0;
      Result = this.GetElementHandle().scrollTop;
      return Result;
    };
    this.SetScrollLeft = function (Value) {
      this.GetElementHandle().scrollLeft = Value;
    };
    this.SetScrollTop = function (Value) {
      this.GetElementHandle().scrollTop = Value;
    };
    this.SetScrollBars = function (Value) {
      if (this.FScrollBars !== Value) {
        this.FScrollBars = Value;
        this.UpdateElement();
      };
    };
    this.UpdateElement = function () {
      pas["WEBLib.Controls"].TControl.UpdateElement.call(this);
    };
    this.UpdateElementVisual = function () {
      $mod.TCustomPanel.UpdateElementVisual.call(this);
      this.UpdateScrollStyle();
    };
    this.UpdateScrollStyle = function () {
      if ((this.GetElementHandle() != null) && !this.IsUpdating()) {
        var $tmp = this.FScrollBars;
        if ($tmp === pas["WEBLib.Controls"].TScrollStyle.ssNone) {
          this.GetElementHandle().style.setProperty("overflow","hidden");
        } else if ($tmp === pas["WEBLib.Controls"].TScrollStyle.ssVertical) {
          this.GetElementHandle().style.removeProperty("overflow");
          this.GetElementHandle().style.setProperty("overflow-x","hidden");
          this.GetElementHandle().style.setProperty("overflow-y","auto");
        } else if ($tmp === pas["WEBLib.Controls"].TScrollStyle.ssHorizontal) {
          this.GetElementHandle().style.removeProperty("overflow");
          this.GetElementHandle().style.setProperty("overflow-x","auto");
          this.GetElementHandle().style.setProperty("overflow-y","hidden");
        } else if ($tmp === pas["WEBLib.Controls"].TScrollStyle.ssBoth) {
          this.GetElementHandle().style.setProperty("overflow","auto");
        };
        if (this.FVisible && !this.GetIsLinked()) this.GetElementHandle().style.setProperty("display","inline-block");
      };
    };
    this.SetAutoScroll = function (AValue) {
      this.FAutoScroll = AValue;
    };
    this.GetClientRect = function () {
      var Result = pas.Types.TRect.$new();
      var dw = 0;
      var dh = 0;
      dw = 0;
      dh = 0;
      if ((this.GetElementHandle().scrollHeight > this.GetElementHandle().clientHeight) && (this.FScrollBars in rtl.createSet(pas["WEBLib.Controls"].TScrollStyle.ssBoth,pas["WEBLib.Controls"].TScrollStyle.ssVertical))) dw = pas["WEBLib.Controls"].GetScrollBarWidth();
      if ((this.GetElementHandle().scrollWidth > this.GetElementHandle().clientWidth) && (this.FScrollBars in rtl.createSet(pas["WEBLib.Controls"].TScrollStyle.ssBoth,pas["WEBLib.Controls"].TScrollStyle.ssHorizontal))) dh = pas["WEBLib.Controls"].GetScrollBarHeight();
      Result.$assign(pas.Types.Rect(0,0,this.GetElementHandle().clientWidth - dw,this.GetElementHandle().clientHeight - dh));
      return Result;
    };
    this.HandleDoScroll = function (Event) {
      var Result = false;
      this.DoScroll();
      Result = true;
      return Result;
    };
    this.DoScroll = function () {
      if (this.FOnScroll != null) this.FOnScroll(this);
    };
    this.ClearMethodPointers = function () {
      pas["WEBLib.Controls"].TControl.ClearMethodPointers.call(this);
      this.FScrollPtr = null;
    };
    this.GetMethodPointers = function () {
      pas["WEBLib.Controls"].TControl.GetMethodPointers.call(this);
      if (this.FScrollPtr === null) {
        this.FScrollPtr = rtl.createCallback(this,"HandleDoScroll");
      };
    };
    this.BindEvents = function () {
      var eh = null;
      pas["WEBLib.Controls"].TCustomControl.BindEvents.call(this);
      if (this.GetElementBindHandle() != null) {
        eh = this.GetElementBindHandle();
        eh.addEventListener("scroll",this.FScrollPtr);
      };
    };
    this.UnbindEvents = function () {
      var eh = null;
      pas["WEBLib.Controls"].TControl.UnbindEvents.call(this);
      if (this.GetElementBindHandle() != null) {
        eh = this.GetElementBindHandle();
        eh.removeEventListener("scroll",this.FScrollPtr);
      };
    };
    this.CreateInitialize = function () {
      $mod.TCustomPanel.CreateInitialize.call(this);
      this.FAutoScroll = true;
      this.FScrollBars = pas["WEBLib.Controls"].TScrollStyle.ssBoth;
      this.FHorzScrollBar = pas["WEBLib.Controls"].TControlScrollBar.$create("Create$1",[this,pas["WEBLib.Controls"].TScrollBarKind.sbHorizontal]);
      this.FVertScrollBar = pas["WEBLib.Controls"].TControlScrollBar.$create("Create$1",[this,pas["WEBLib.Controls"].TScrollBarKind.sbVertical]);
    };
    this.Destroy = function () {
      rtl.free(this,"FHorzScrollBar");
      rtl.free(this,"FVertScrollBar");
      $mod.TCustomPanel.Destroy.call(this);
    };
    this.ScrollBy = function (DeltaX, DeltaY) {
      this.SetScrollLeft(this.GetScrollLeft() + DeltaX);
      this.SetScrollTop(this.GetScrollTop() + DeltaY);
    };
    this.EndUpdate = function () {
      $mod.TCustomPanel.EndUpdate.call(this);
      this.AlignControl(this);
      this.AlignControl(this);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("AutoScroll",2,rtl.boolean,"FAutoScroll","SetAutoScroll");
    $r.addProperty("BorderColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FBorderColor","SetBorderColor",4,{Default: 12632256});
    $r.addProperty("BorderStyle",2,pas["WEBLib.Controls"].$rtti["TBorderStyle"],"FBorderStyle","SetBorderStyle",4,{Default: pas["WEBLib.Controls"].TBorderStyle.bsSingle});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor");
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("Padding",2,pas["WEBLib.Controls"].$rtti["TPadding"],"FPadding","SetPadding");
    $r.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti["TPopupMenu"],"FPopupMenu","FPopupMenu");
    $r.addProperty("Role",3,rtl.string,"GetRole","SetRole");
    $r.addProperty("ScrollBars",2,pas["WEBLib.Controls"].$rtti["TScrollStyle"],"FScrollBars","SetScrollBars");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseDown","FOnMouseDown");
    $r.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti["TMouseMoveEvent"],"FOnMouseMove","FOnMouseMove");
    $r.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseUp","FOnMouseUp");
    $r.addProperty("OnResize",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnResize","FOnResize");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnScroll",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnScroll","FOnScroll");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
    $r.addProperty("OnTouchStart",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchStart","FOnTouchStart");
    $r.addProperty("OnTouchMove",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchMove","FOnTouchMove");
    $r.addProperty("OnTouchEnd",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchEnd","FOnTouchEnd");
    $r.addProperty("OnTouchCancel",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchCancel","FOnTouchCancel");
  });
  rtl.createClass(this,"TWebScrollBox",this.TScrollBox,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TSplitter",pas["WEBLib.Controls"].TCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Controls"].TCustomControl.$init.call(this);
      this.FLayer$1 = null;
      this.FTouched = false;
      this.FFirstMove = false;
      this.FSplitControl = null;
      this.FSplitPos = 0;
      this.FSizing = false;
      this.FSizingX = 0.0;
      this.FSizingY = 0.0;
      this.FOriginalWidth = 0;
      this.FOriginalHeight = 0;
      this.FGripColor = 0;
      this.FOnMoved = null;
      this.FOnMove = null;
    };
    this.$final = function () {
      this.FLayer$1 = undefined;
      this.FSplitControl = undefined;
      this.FOnMoved = undefined;
      this.FOnMove = undefined;
      pas["WEBLib.Controls"].TCustomControl.$final.call(this);
    };
    this.SetGripColor = function (Value) {
      if (this.FGripColor !== Value) {
        this.FGripColor = Value;
        this.Invalidate();
      };
    };
    this.CreateElement = function () {
      var Result = null;
      Result = pas["WEBLib.Controls"].TCustomControl.CreateElement.call(this);
      return Result;
    };
    this.UpdateElement = function () {
      pas["WEBLib.Controls"].TControl.UpdateElement.call(this);
    };
    this.UpdateElementSize = function () {
      pas["WEBLib.Controls"].TControl.UpdateElementSize.call(this);
    };
    this.ColorChanging = function () {
      pas["WEBLib.Controls"].TControl.ColorChanging.call(this);
      this.Invalidate();
    };
    this.DoSizeStart = function (X, Y) {
      var r = pas.Types.TRect.$new();
      var rc = pas.Types.TRect.$new();
      var i = 0;
      var c = null;
      var eh = null;
      this.FSizing = true;
      Y = Y - document.documentElement.scrollTop;
      r.$assign(pas.Types.Rect(this.GetLeft(),this.GetTop(),this.GetLeft() + this.GetWidth(),this.GetTop() + this.GetHeight()));
      if (this.FParent != null) {
        if (this.FAlign in rtl.createSet(pas["WEBLib.Controls"].TAlign.alRight,pas["WEBLib.Controls"].TAlign.alBottom)) {
          for (var $l = 0, $end = this.FParent.GetControlsCount() - 1; $l <= $end; $l++) {
            i = $l;
            c = this.FParent.GetControls(i);
            rc.$assign(pas.Types.Rect(c.GetLeft(),c.GetTop(),c.GetLeft() + c.GetWidth(),c.GetTop() + c.GetHeight()));
            if ((this.FAlign === pas["WEBLib.Controls"].TAlign.alRight) && (c !== this) && ((r.Left - rc.Right) < 4) && ((r.Left - rc.Right) >= 0)) {
              this.FSplitPos = rc.Left;
            };
            if ((this.FAlign === pas["WEBLib.Controls"].TAlign.alBottom) && (c !== this) && ((r.Top - rc.Bottom) < 4) && ((r.Top - rc.Bottom) >= -4)) {
              this.FSplitPos = rc.Top;
            };
          };
        };
        for (var $l1 = 0, $end1 = this.FParent.GetControlsCount() - 1; $l1 <= $end1; $l1++) {
          i = $l1;
          c = this.FParent.GetControls(i);
          rc.$assign(pas.Types.Rect(c.GetLeft(),c.GetTop(),c.GetLeft() + c.GetWidth(),c.GetTop() + c.GetHeight()));
          if ((c.FAlign === this.FAlign) && (c !== this)) {
            if ((this.FAlign === pas["WEBLib.Controls"].TAlign.alLeft) && ((rc.Right - r.Left) < 4)) {
              this.FSplitControl = c;
              this.FOriginalWidth = this.FSplitControl.GetWidth();
              this.FSizing = true;
              this.FSizingX = X;
              this.FSizingY = Y;
              break;
            };
            if ((this.FAlign === pas["WEBLib.Controls"].TAlign.alRight) && ((rc.Left - r.Right) < 4)) {
              this.FSplitControl = c;
              this.FSplitPos = rc.Right - this.FSplitPos - this.GetWidth();
              this.FOriginalWidth = this.FSplitControl.GetWidth();
              this.FSizing = true;
              this.FSizingX = X;
              this.FSizingY = Y;
              break;
            };
            if ((this.FAlign === pas["WEBLib.Controls"].TAlign.alTop) && ((rc.Bottom - r.Top) < 4)) {
              this.FSplitControl = c;
              this.FOriginalHeight = this.FSplitControl.GetHeight();
              this.FSizing = true;
              this.FSizingX = X;
              this.FSizingY = Y;
              break;
            };
            if ((this.FAlign === pas["WEBLib.Controls"].TAlign.alBottom) && ((rc.Top - r.Bottom) < 4)) {
              this.FSplitControl = c;
              this.FSplitPos = rc.Bottom - this.FSplitPos - this.GetHeight();
              this.FOriginalHeight = this.FSplitControl.GetHeight();
              this.FSizing = true;
              this.FSizingX = X;
              this.FSizingY = Y;
              break;
            };
          };
        };
      };
      this.FLayer$1 = document.createElement("SPAN");
      document.body.appendChild(this.FLayer$1);
      eh = this.FLayer$1;
      eh.style.setProperty("top","0");
      eh.style.setProperty("left","0");
      eh.style.setProperty("right","0");
      eh.style.setProperty("bottom","0");
      eh.style.setProperty("z-index","99999999");
      eh.style.setProperty("webkit-user-select","none");
      eh.style.setProperty("moz-user-select","none");
      eh.style.setProperty("khtml-user-select","none");
      eh.style.setProperty("ms-user-select","none");
      eh.style.setProperty("user-select","none");
      eh.style.setProperty("position","fixed");
      if (this.FAlign in rtl.createSet(pas["WEBLib.Controls"].TAlign.alLeft,pas["WEBLib.Controls"].TAlign.alRight)) eh.style.setProperty("cursor","col-resize");
      if (this.FAlign in rtl.createSet(pas["WEBLib.Controls"].TAlign.alTop,pas["WEBLib.Controls"].TAlign.alBottom)) eh.style.setProperty("cursor","row-resize");
      this.FFirstMove = true;
      this.FSizing = true;
      eh.addEventListener("mousemove",rtl.createSafeCallback(this,"HandleDocDoMouseMove"));
      eh.addEventListener("mouseup",rtl.createSafeCallback(this,"HandleDocDoMouseUp"));
      eh.addEventListener("touchmove",rtl.createCallback(this,"HandleDocDoTouchMove"));
      eh.addEventListener("touchend",rtl.createCallback(this,"HandleDocDoTouchEnd"));
    };
    this.HandleDoTouchStart = function (Event) {
      var Result = false;
      var l = 0.0;
      var t = 0.0;
      var touch = null;
      this.StopPropagation();
      this.PreventDefault();
      if (Event.touches.length > 0) {
        touch = Event.touches.item(0);
        this.FTouched = true;
        this.Invalidate();
        this.Invalidate();
        this.XYToClient(touch.clientX,touch.clientY,{get: function () {
            return l;
          }, set: function (v) {
            l = v;
          }},{get: function () {
            return t;
          }, set: function (v) {
            t = v;
          }});
        this.DoSizeStart(Math.round(l),Math.round(t));
      };
      Result = false;
      return Result;
    };
    this.HandleDocDoMouseMove = function (Event) {
      var Result = false;
      var dx = 0;
      var dy = 0;
      if (this.FSizing && (this.FSplitControl != null)) {
        if (this.FFirstMove) {
          this.FSizingX = Event.clientX;
          this.FSizingY = Event.clientY - document.documentElement.scrollTop;
          this.FFirstMove = false;
        } else {
          dx = Math.round(Event.clientX - this.FSizingX);
          dy = Math.round(Event.clientY - document.documentElement.scrollTop - this.FSizingY);
          if (this.FAlign === pas["WEBLib.Controls"].TAlign.alLeft) this.FSplitControl.SetWidth(Math.max(0,this.FOriginalWidth + dx));
          if (this.FAlign === pas["WEBLib.Controls"].TAlign.alRight) this.FSplitControl.SetWidth(Math.max(0,Math.min(this.FSplitPos,this.FOriginalWidth - dx)));
          if (this.FAlign === pas["WEBLib.Controls"].TAlign.alTop) this.FSplitControl.SetHeight(Math.max(0,this.FOriginalHeight + dy));
          if (this.FAlign === pas["WEBLib.Controls"].TAlign.alBottom) this.FSplitControl.SetHeight(Math.max(0,Math.min(this.FSplitPos,this.FOriginalHeight - dy)));
          this.DoRealign();
          if (this.FOnMove != null) this.FOnMove(this);
        };
      };
      Result = true;
      return Result;
    };
    this.HandleDocDoMouseUp = function (Event) {
      var Result = false;
      this.FSizing = false;
      this.FSplitControl = null;
      this.FFirstMove = true;
      this.FLayer$1.parentNode.removeChild(this.FLayer$1);
      Result = true;
      if (this.FOnMoved != null) this.FOnMoved(this);
      return Result;
    };
    this.HandleDocDoTouchMove = function (Event) {
      var Result = false;
      var touch = null;
      var dx = 0;
      var dy = 0;
      this.StopPropagation();
      if (Event.touches.length > 0) {
        touch = Event.touches.item(0);
        if (this.FSizing && (this.FSplitControl != null)) {
          if (this.FFirstMove) {
            this.FSizingX = touch.clientX;
            this.FSizingY = touch.clientY;
            this.FFirstMove = false;
          } else {
            dx = Math.round(touch.clientX - this.FSizingX);
            dy = Math.round(touch.clientY - this.FSizingY);
            if (this.FAlign === pas["WEBLib.Controls"].TAlign.alLeft) this.FSplitControl.SetWidth(this.FOriginalWidth + dx);
            if (this.FAlign === pas["WEBLib.Controls"].TAlign.alRight) this.FSplitControl.SetWidth(this.FOriginalWidth - dx);
            if (this.FAlign === pas["WEBLib.Controls"].TAlign.alTop) this.FSplitControl.SetHeight(this.FOriginalHeight + dy);
            if (this.FAlign === pas["WEBLib.Controls"].TAlign.alBottom) this.FSplitControl.SetHeight(this.FOriginalHeight - dy);
            this.DoRealign();
            if (this.FOnMove != null) this.FOnMove(this);
          };
        };
      };
      Result = true;
      return Result;
    };
    this.HandleDocDoTouchEnd = function (Event) {
      var Result = false;
      this.FTouched = false;
      this.Invalidate();
      this.FSizing = false;
      this.FSplitControl = null;
      this.FFirstMove = true;
      this.FLayer$1.parentNode.removeChild(this.FLayer$1);
      Result = true;
      if (this.FOnMoved != null) this.FOnMoved(this);
      return Result;
    };
    this.DoMouseEnter = function () {
      pas["WEBLib.Controls"].TControl.DoMouseEnter.call(this);
      if (this.FAlign in rtl.createSet(pas["WEBLib.Controls"].TAlign.alLeft,pas["WEBLib.Controls"].TAlign.alRight)) this.SetControlCursor(14);
      if (this.FAlign in rtl.createSet(pas["WEBLib.Controls"].TAlign.alTop,pas["WEBLib.Controls"].TAlign.alBottom)) this.SetControlCursor(15);
    };
    this.MouseUp = function (Button, Shift, X, Y) {
      pas["WEBLib.Controls"].TControl.MouseUp.apply(this,arguments);
      this.FSizing = false;
      this.FSplitControl = null;
    };
    this.MouseDown = function (Button, Shift, X, Y) {
      pas["WEBLib.Controls"].TControl.MouseDown.apply(this,arguments);
      this.DoSizeStart(X,Y);
    };
    this.Paint = function () {
      var xofs = 0;
      var dx = 0;
      var yofs = 0;
      var dy = 0;
      var i = 0;
      if (this.FTouched) {
        this.GetCanvas().FBrush.FColor = 8421504;
        this.GetCanvas().FPen.SetColor(8421504);
      } else {
        this.GetCanvas().FBrush.FColor = this.FColor;
        this.GetCanvas().FPen.SetColor(this.FColor);
      };
      this.GetCanvas().FBrush.FStyle = pas["WEBLib.Graphics"].TBrushStyle.bsSolid;
      this.GetCanvas().Rectangle$2(this.GetClientRect());
      if (this.FAlign in rtl.createSet(pas["WEBLib.Controls"].TAlign.alLeft,pas["WEBLib.Controls"].TAlign.alRight)) {
        dx = 0;
        dy = 6;
        yofs = rtl.trunc(this.GetHeight() / 2) - 9;
        xofs = rtl.trunc(this.GetWidth() / 2);
      };
      if (this.FAlign in rtl.createSet(pas["WEBLib.Controls"].TAlign.alTop,pas["WEBLib.Controls"].TAlign.alBottom)) {
        dx = 6;
        dy = 0;
        xofs = rtl.trunc(this.GetWidth() / 2) - 9;
        yofs = rtl.trunc(this.GetHeight() / 2) - 1;
      };
      this.GetCanvas().FBrush.FColor = this.FGripColor;
      this.GetCanvas().FPen.SetColor(this.FGripColor);
      for (i = 0; i <= 2; i++) {
        this.GetCanvas().Rectangle$1(xofs,yofs,xofs + 2,yofs + 2);
        xofs = xofs + dx;
        yofs = yofs + dy;
      };
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.SetControlCursor(14);
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        this.SetWidth(6);
        this.SetHeight(100);
      };
      this.SetAlign(pas["WEBLib.Controls"].TAlign.alLeft);
      this.FSplitControl = null;
      this.SetGripColor(16777215);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("GripColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FGripColor","SetGripColor",4,{Default: 16777215});
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnTouchStart",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchStart","FOnTouchStart");
    $r.addProperty("OnTouchMove",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchMove","FOnTouchMove");
    $r.addProperty("OnTouchEnd",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchEnd","FOnTouchEnd");
    $r.addProperty("OnTouchCancel",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchCancel","FOnTouchCancel");
    $r.addProperty("OnMove",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMove","FOnMove");
    $r.addProperty("OnMoved",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMoved","FOnMoved");
  });
  rtl.createClass(this,"TWebSplitter",this.TSplitter,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.TVerticalAlignment = {"0": "vaTop", vaTop: 0, "1": "vaCenter", vaCenter: 1, "2": "vaBottom", vaBottom: 2};
  this.$rtti.$Enum("TVerticalAlignment",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TVerticalAlignment});
  this.TGridPanelExpandStyle = {"0": "esAddRows", esAddRows: 0, "1": "esAddColumns", esAddColumns: 1};
  this.$rtti.$Enum("TGridPanelExpandStyle",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TGridPanelExpandStyle});
  rtl.createClass(this,"TGridPanelRow",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FSizeStyle = 0;
      this.FValue = 0;
      this.FMarginBottom = 0;
      this.FMarginTop = 0;
      this.FAlignment = 0;
      this.FElementClassName = "";
    };
    this.SetMarginBottom = function (Value) {
      if (this.FMarginBottom !== Value) {
        this.FMarginBottom = Value;
        this.FCollection.Update(this);
      };
    };
    this.SetMarginTop = function (Value) {
      if (this.FMarginTop !== Value) {
        this.FMarginTop = Value;
        this.FCollection.Update(this);
      };
    };
    this.SetSizeStyle = function (Value) {
      if (this.FSizeStyle !== Value) {
        this.FSizeStyle = Value;
        this.FCollection.Update(this);
      };
    };
    this.SetValue = function (Value) {
      if (this.FValue !== Value) {
        this.FValue = Value;
        this.FCollection.Update(this);
      };
    };
    this.HeightAttribute = function () {
      var Result = "";
      Result = "";
      var $tmp = this.FSizeStyle;
      if ($tmp === pas["WEBLib.Controls"].TSizeStyle.ssPercent) {
        Result = pas.SysUtils.IntToStr(this.FValue) + "%"}
       else if ($tmp === pas["WEBLib.Controls"].TSizeStyle.ssAbsolute) Result = pas.SysUtils.IntToStr(this.FValue) + "px";
      return Result;
    };
    this.Create$1 = function (ACollection) {
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      this.FSizeStyle = pas["WEBLib.Controls"].TSizeStyle.ssPercent;
      this.FAlignment = $mod.TVerticalAlignment.vaTop;
      this.FMarginTop = 0;
      this.FMarginBottom = 0;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TGridPanelRow.isPrototypeOf(Source)) {
        this.FAlignment = rtl.as(Source,$mod.TGridPanelRow).FAlignment;
        this.FSizeStyle = rtl.as(Source,$mod.TGridPanelRow).FSizeStyle;
        this.FElementClassName = rtl.as(Source,$mod.TGridPanelRow).FElementClassName;
        this.FValue = rtl.as(Source,$mod.TGridPanelRow).FValue;
        this.FMarginTop = rtl.as(Source,$mod.TGridPanelRow).FMarginTop;
        this.FMarginBottom = rtl.as(Source,$mod.TGridPanelRow).FMarginBottom;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Alignment",0,$mod.$rtti["TVerticalAlignment"],"FAlignment","FAlignment",4,{Default: $mod.TVerticalAlignment.vaTop});
    $r.addProperty("ElementClassName",0,rtl.string,"FElementClassName","FElementClassName");
    $r.addProperty("MarginTop",2,rtl.longint,"FMarginTop","SetMarginTop");
    $r.addProperty("MarginBottom",2,rtl.longint,"FMarginBottom","SetMarginBottom");
    $r.addProperty("SizeStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FSizeStyle","SetSizeStyle");
    $r.addProperty("Value",2,rtl.longint,"FValue","SetValue");
  });
  rtl.createClass(this,"TGridPanelRows",pas.Classes.TOwnedCollection,function () {
    this.$init = function () {
      pas.Classes.TOwnedCollection.$init.call(this);
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      pas.Classes.TOwnedCollection.$final.call(this);
    };
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      this.SetItem(Index,Value);
    };
    this.Update = function (Item) {
      pas.Classes.TCollection.Update.apply(this,arguments);
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,$mod.TGridPanelRow);
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      return Result;
    };
  });
  rtl.createClass(this,"TGridPanelColumn",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FSizeStyle = 0;
      this.FValue = 0;
      this.FMarginLeft = 0;
      this.FAlignment = 0;
      this.FMarginRight = 0;
      this.FElementClassName = "";
    };
    this.SetMarginLeft = function (Value) {
      if (this.FMarginLeft !== Value) {
        this.FMarginLeft = Value;
        this.FCollection.Update(this);
      };
    };
    this.SetMarginRight = function (Value) {
      if (this.FMarginRight !== Value) {
        this.FMarginRight = Value;
        this.FCollection.Update(this);
      };
    };
    this.SetSizeStyle = function (Value) {
      if (this.FSizeStyle !== Value) {
        this.FSizeStyle = Value;
        this.FCollection.Update(this);
      };
    };
    this.SetValue = function (Value) {
      if (this.FValue !== Value) {
        this.FValue = Value;
        this.FCollection.Update(this);
      };
    };
    this.WidthAttribute = function () {
      var Result = "";
      Result = "";
      var $tmp = this.FSizeStyle;
      if ($tmp === pas["WEBLib.Controls"].TSizeStyle.ssPercent) {
        Result = pas.SysUtils.IntToStr(this.FValue) + "%"}
       else if ($tmp === pas["WEBLib.Controls"].TSizeStyle.ssAbsolute) Result = pas.SysUtils.IntToStr(this.FValue) + "px";
      return Result;
    };
    this.Create$1 = function (ACollection) {
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      this.FSizeStyle = pas["WEBLib.Controls"].TSizeStyle.ssPercent;
      this.FValue = 0;
      this.FMarginLeft = 0;
      this.FMarginRight = 0;
      this.FAlignment = pas.Classes.TAlignment.taLeftJustify;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TGridPanelColumn.isPrototypeOf(Source)) {
        this.FAlignment = rtl.as(Source,$mod.TGridPanelColumn).FAlignment;
        this.FSizeStyle = rtl.as(Source,$mod.TGridPanelColumn).FSizeStyle;
        this.FElementClassName = rtl.as(Source,$mod.TGridPanelColumn).FElementClassName;
        this.FValue = rtl.as(Source,$mod.TGridPanelColumn).FValue;
        this.FMarginLeft = rtl.as(Source,$mod.TGridPanelColumn).FMarginLeft;
        this.FMarginRight = rtl.as(Source,$mod.TGridPanelColumn).FMarginRight;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Alignment",0,pas.Classes.$rtti["TAlignment"],"FAlignment","FAlignment",4,{Default: pas.Classes.TAlignment.taLeftJustify});
    $r.addProperty("ElementClassName",0,rtl.string,"FElementClassName","FElementClassName");
    $r.addProperty("MarginLeft",2,rtl.longint,"FMarginLeft","SetMarginLeft",4,{Default: 0});
    $r.addProperty("MarginRight",2,rtl.longint,"FMarginRight","SetMarginRight",4,{Default: 0});
    $r.addProperty("SizeStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FSizeStyle","SetSizeStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssPercent});
    $r.addProperty("Value",2,rtl.longint,"FValue","SetValue");
  });
  rtl.createClass(this,"TGridPanelColumns",pas.Classes.TOwnedCollection,function () {
    this.$init = function () {
      pas.Classes.TOwnedCollection.$init.call(this);
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      pas.Classes.TOwnedCollection.$final.call(this);
    };
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      this.SetItem(Index,Value);
    };
    this.Update = function (Item) {
      pas.Classes.TCollection.Update.apply(this,arguments);
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,$mod.TGridPanelColumn);
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      return Result;
    };
  });
  rtl.createClass(this,"TControlCollectionItem",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FControl = null;
      this.FRow = 0;
      this.FColumn = 0;
    };
    this.$final = function () {
      this.FControl = undefined;
      pas.Classes.TCollectionItem.$final.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TControlCollectionItem.isPrototypeOf(Source)) {
        this.FColumn = rtl.as(Source,$mod.TControlCollectionItem).FColumn;
        this.FRow = rtl.as(Source,$mod.TControlCollectionItem).FRow;
        this.FControl = rtl.as(Source,$mod.TControlCollectionItem).FControl;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Column",0,rtl.longint,"FColumn","FColumn");
    $r.addProperty("Row",0,rtl.longint,"FRow","FRow");
    $r.addProperty("Control",0,pas["WEBLib.Controls"].$rtti["TWinControl"],"FControl","FControl");
  });
  rtl.createClass(this,"TControlCollection",pas.Classes.TOwnedCollection,function () {
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      this.SetItem(Index,Value);
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,$mod.TControlCollectionItem);
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      return Result;
    };
    this.FindItem = function (AControl) {
      var Result = null;
      var i = 0;
      Result = null;
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.GetItem$1(i).FControl === AControl) {
          Result = this.GetItem$1(i);
          return Result;
        };
      };
      return Result;
    };
    this.GetItemAtCell = function (ACol, ARow) {
      var Result = null;
      var i = 0;
      Result = null;
      if ((this.Owner() != null) && $mod.TGridPanel.isPrototypeOf(this.Owner())) {
        i = ACol + (rtl.as(this.Owner(),$mod.TGridPanel).FColumnCollection.GetCount() * ARow);
        if (i < this.GetCount()) Result = this.GetItem$1(i);
      };
      return Result;
    };
  });
  rtl.createClass(this,"TGridPanel",pas["WEBLib.Menus"].TWebCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Menus"].TWebCustomControl.$init.call(this);
      this.FDesignTime$1 = false;
      this.FUpdateTable = false;
      this.FColCount = 0;
      this.FRowCollection = null;
      this.FColumnCollection = null;
      this.FControlCollection = null;
      this.FGridLineWidth = 0;
      this.FGridLineColor = 0;
      this.FExpandStyle = 0;
      this.FTbl = null;
      this.FTblBody = null;
    };
    this.$final = function () {
      this.FRowCollection = undefined;
      this.FColumnCollection = undefined;
      this.FControlCollection = undefined;
      this.FTbl = undefined;
      this.FTblBody = undefined;
      pas["WEBLib.Menus"].TWebCustomControl.$final.call(this);
    };
    this.SetColumnCollection = function (Value) {
      this.FColumnCollection.Assign(Value);
    };
    this.SetRowCollection = function (Value) {
      this.FRowCollection.Assign(Value);
    };
    this.SetControlCollection = function (Value) {
      this.FControlCollection.Assign(Value);
    };
    this.CreateTable = function () {
      var Result = null;
      var row = null;
      var j = 0;
      var ps = "";
      this.FTbl = document.createElement("table");
      this.FTbl.setAttribute("width","100%");
      this.FTbl.setAttribute("height","100%");
      if (this.FElementClassName !== "") {
        this.FTbl.setAttribute("class",this.FElementClassName)}
       else {
        if ((this.FGridLineColor !== -1) && (this.FGridLineWidth > 0)) {
          ps = pas.SysUtils.IntToStr(this.FGridLineWidth) + "px solid " + pas["WEBLib.Graphics"].ColorToHTML(this.FGridLineColor)}
         else {
          if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
            ps = "1px dotted gray"}
           else ps = "0px";
        };
        this.FTbl.style.setProperty("border",ps);
        this.FTbl.style.setProperty("border-collapse","collapse");
      };
      pas["WEBLib.Controls"].SetHTMLElementColor(this.FTbl,this.FColor,!((this.FElementClassName === "") && !this.GetIsLinked()));
      this.FTblBody = document.createElement("tbody");
      for (var $l = 0, $end = this.FRowCollection.GetCount() - 1; $l <= $end; $l++) {
        j = $l;
        row = this.CreateRow(j);
        this.FTblBody.appendChild(row);
      };
      this.FTbl.appendChild(this.FTblBody);
      Result = this.FTbl;
      return Result;
    };
    this.CreateRow = function (AIndex) {
      var Result = null;
      var row = null;
      var cell = null;
      var i = 0;
      var ps = "";
      if ((this.FGridLineColor !== -1) && (this.FGridLineWidth > 0)) {
        ps = pas.SysUtils.IntToStr(this.FGridLineWidth) + "px solid " + pas["WEBLib.Graphics"].ColorToHTML(this.FGridLineColor)}
       else {
        if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
          ps = "1px dotted gray"}
         else ps = "0px";
      };
      row = document.createElement("tr");
      if (this.FElementClassName === "") row.style.setProperty("border",ps);
      if (AIndex < this.FRowCollection.GetCount()) {
        if (this.FRowCollection.GetItem$1(AIndex).FMarginTop !== 0) row.style.setProperty("margin-top",pas.SysUtils.IntToStr(this.FRowCollection.GetItem$1(AIndex).FMarginTop));
        if (this.FRowCollection.GetItem$1(AIndex).FMarginBottom !== 0) row.style.setProperty("margin-bottom",pas.SysUtils.IntToStr(this.FRowCollection.GetItem$1(AIndex).FMarginBottom));
        if (this.FRowCollection.GetItem$1(AIndex).FElementClassName !== "") {
          row.setAttribute("class",this.FRowCollection.GetItem$1(AIndex).FElementClassName);
        };
        var $tmp = this.FRowCollection.GetItem$1(AIndex).FAlignment;
        if ($tmp === $mod.TVerticalAlignment.vaCenter) {
          row.setAttribute("valign","middle")}
         else if ($tmp === $mod.TVerticalAlignment.vaBottom) row.setAttribute("valign","bottom");
        if (this.FElementClassName === "") row.style.setProperty("border",ps);
        row.setAttribute("height",this.FRowCollection.GetItem$1(AIndex).HeightAttribute());
      };
      for (var $l = 0, $end = this.FColumnCollection.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        cell = document.createElement("td");
        if (this.FElementClassName === "") cell.style.setProperty("border",ps);
        if (this.FColumnCollection.GetItem$1(i).FMarginLeft !== 0) cell.style.setProperty("padding-left",pas.SysUtils.IntToStr(this.FColumnCollection.GetItem$1(i).FMarginLeft) + "px");
        if (this.FColumnCollection.GetItem$1(i).FMarginRight !== 0) cell.style.setProperty("padding-right",pas.SysUtils.IntToStr(this.FColumnCollection.GetItem$1(i).FMarginRight) + "px");
        if (this.FColumnCollection.GetItem$1(i).FElementClassName !== "") {
          cell.setAttribute("class",this.FColumnCollection.GetItem$1(i).FElementClassName);
        };
        var $tmp1 = this.FColumnCollection.GetItem$1(i).FAlignment;
        if ($tmp1 === pas.Classes.TAlignment.taCenter) {
          cell.setAttribute("align","center")}
         else if ($tmp1 === pas.Classes.TAlignment.taRightJustify) cell.setAttribute("align","right");
        cell.setAttribute("id",this.FName + "R" + pas.SysUtils.IntToStr(AIndex) + "C" + pas.SysUtils.IntToStr(i));
        if (AIndex === 0) {
          cell.style.setProperty("width",this.FColumnCollection.GetItem$1(i).WidthAttribute());
        };
        row.appendChild(cell);
      };
      Result = row;
      return Result;
    };
    this.CreateElement = function () {
      var Result = null;
      Result = document.createElement("SPAN");
      return Result;
    };
    this.AlignControl = function (AControl) {
      if (!(pas.Classes.TComponentStateItem.csDestroying in this.FComponentState)) this.UpdateTable();
      pas["WEBLib.Controls"].TControl.AlignControl.apply(this,arguments);
    };
    this.UpdateTable = function () {
      var i = 0;
      var j = 0;
      var k = 0;
      var mw = 0;
      var numrows = 0;
      var fragment = null;
      var destid = "";
      var control = null;
      var el = null;
      var row = null;
      var isPercent = false;
      var f = 0.0;
      if (!(this.FTblBody != null)) return;
      if (this.IsUpdating()) return;
      if (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState) return;
      isPercent = true;
      mw = 0;
      for (var $l = 0, $end = this.FRowCollection.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.FRowCollection.GetItem$1(i).FSizeStyle !== pas["WEBLib.Controls"].TSizeStyle.ssPercent) {
          isPercent = false;
          break;
        } else mw = mw + this.FRowCollection.GetItem$1(i).FValue;
      };
      if (isPercent && (mw > 100)) {
        f = mw / 100;
        for (var $l1 = 0, $end1 = this.FRowCollection.GetCount() - 1; $l1 <= $end1; $l1++) {
          i = $l1;
          this.FRowCollection.GetItem$1(i).FValue = pas.System.Trunc(this.FRowCollection.GetItem$1(i).FValue / f);
        };
      };
      isPercent = true;
      mw = 0;
      for (var $l2 = 0, $end2 = this.FColumnCollection.GetCount() - 1; $l2 <= $end2; $l2++) {
        i = $l2;
        if (this.FColumnCollection.GetItem$1(i).FSizeStyle !== pas["WEBLib.Controls"].TSizeStyle.ssPercent) {
          isPercent = false;
          break;
        } else mw = mw + this.FColumnCollection.GetItem$1(i).FValue;
      };
      if (isPercent && (mw > 100)) {
        f = mw / 100;
        for (var $l3 = 0, $end3 = this.FColumnCollection.GetCount() - 1; $l3 <= $end3; $l3++) {
          i = $l3;
          this.FColumnCollection.GetItem$1(i).FValue = pas.System.Trunc(this.FColumnCollection.GetItem$1(i).FValue / f);
        };
      };
      numrows = this.FRowCollection.GetCount();
      if (this.FColCount !== this.FColumnCollection.GetCount()) numrows = 0;
      while (this.FTblBody.childNodes.length > numrows) {
        this.FTblBody.removeChild(this.FTblBody.childNodes.item(this.FTblBody.childNodes.length - 1));
      };
      while (this.FTblBody.childNodes.length < this.FRowCollection.GetCount()) {
        row = this.CreateRow(this.FTblBody.childNodes.length);
        this.FTblBody.appendChild(row);
      };
      for (var $l4 = 0, $end4 = this.FRowCollection.GetCount() - 1; $l4 <= $end4; $l4++) {
        i = $l4;
        row = this.FTblBody.childNodes.item(i);
        row.setAttribute("height",this.FRowCollection.GetItem$1(i).HeightAttribute());
      };
      i = 0;
      j = 0;
      for (var $l5 = 0, $end5 = this.FControlCollection.GetCount() - 1; $l5 <= $end5; $l5++) {
        k = $l5;
        if (this.FControlCollection.GetItem$1(k).FControl != null) {
          fragment = document.createDocumentFragment();
          control = this.FControlCollection.GetItem$1(k).FControl;
          this.FControlCollection.GetItem$1(k).FColumn = i;
          this.FControlCollection.GetItem$1(k).FRow = j;
          control.SetElementPosition(pas["WEBLib.Controls"].TElementPosition.epRelative);
          control.SetChildOrderEx(-1);
          if (control.FAlign === pas["WEBLib.Controls"].TAlign.alLeft) {
            control.SetHeightStyle(pas["WEBLib.Controls"].TSizeStyle.ssPercent);
            control.SetHeightPercent(100);
            if (control.GetElementHandle() != null) control.GetElementHandle().style.setProperty("float","left");
          };
          if (control.FAlign === pas["WEBLib.Controls"].TAlign.alRight) {
            control.SetHeightStyle(pas["WEBLib.Controls"].TSizeStyle.ssPercent);
            control.SetHeightPercent(100);
            if (control.GetElementHandle() != null) control.GetElementHandle().style.setProperty("float","right");
          };
          if (control.FAlign in rtl.createSet(pas["WEBLib.Controls"].TAlign.alTop,pas["WEBLib.Controls"].TAlign.alBottom)) {
            control.SetWidthStyle(pas["WEBLib.Controls"].TSizeStyle.ssPercent);
            control.SetWidthPercent(100);
          };
          if (control.FAlign === pas["WEBLib.Controls"].TAlign.alClient) {
            control.SetWidthStyle(pas["WEBLib.Controls"].TSizeStyle.ssPercent);
            control.SetHeightStyle(pas["WEBLib.Controls"].TSizeStyle.ssPercent);
            control.SetWidthPercent(100);
            control.SetHeightPercent(100);
          };
          row = this.FTblBody.childNodes.item(j);
          if ((row != null) && (j < this.FRowCollection.GetCount())) {
            row.setAttribute("height",this.FRowCollection.GetItem$1(j).HeightAttribute());
            if (this.FRowCollection.GetItem$1(j).FElementClassName !== "") {
              row.setAttribute("class",this.FRowCollection.GetItem$1(j).FElementClassName)}
             else row.removeAttribute("class");
          };
          if (control.GetElementHandle() != null) fragment.appendChild(control.GetElementHandle());
          destid = this.FName + "R" + pas.SysUtils.IntToStr(j) + "C" + pas.SysUtils.IntToStr(i);
          el = document.getElementById(destid);
          if (!(el != null)) {
            row = this.CreateRow(j);
            this.FTblBody.appendChild(row);
            el = document.getElementById(destid);
            if (this.FRowCollection.GetCount() > j) row.setAttribute("height",this.FRowCollection.GetItem$1(j).HeightAttribute());
          } else {
            if ((j === 0) && (i < this.FColumnCollection.GetCount())) {
              if (this.FColumnCollection.GetItem$1(i).FSizeStyle === pas["WEBLib.Controls"].TSizeStyle.ssAbsolute) {
                this.FTbl.removeAttribute("width");
                this.FTbl.removeAttribute("height");
              } else {
                this.FTbl.setAttribute("width","100%");
                this.FTbl.setAttribute("height","100%");
              };
              el.style.setProperty("width",this.FColumnCollection.GetItem$1(i).WidthAttribute());
            };
          };
          if (el != null) {
            el.appendChild(fragment);
            if (control.FAlign === pas["WEBLib.Controls"].TAlign.alTop) el.style.setProperty("vertical-align","top");
            if (control.FAlign === pas["WEBLib.Controls"].TAlign.alBottom) el.style.setProperty("vertical-align","bottom");
          };
          i += 1;
          if (i === this.FColumnCollection.GetCount()) {
            i = 0;
            j += 1;
          };
        };
      };
      for (var $l6 = 0, $end6 = this.FColumnCollection.GetCount() - 1; $l6 <= $end6; $l6++) {
        i = $l6;
        destid = this.FName + "R0C" + pas.SysUtils.IntToStr(i);
        el = document.getElementById(destid);
        if (el != null) el.style.setProperty("width",this.FColumnCollection.GetItem$1(i).WidthAttribute());
      };
      this.FColCount = this.FColumnCollection.GetCount();
    };
    this.UpdateElement = function () {
      pas["WEBLib.Controls"].TControl.UpdateElement.call(this);
      if ((this.GetElementHandle() != null) && !this.IsUpdating()) {
        this.GetElementHandle().style.setProperty("user-select","");
        if (this.FCursor === 0) this.GetElementHandle().style.setProperty("cursor","");
        if (this.FUpdateTable && (this.GetContainer() != null)) {
          this.GetContainer().appendChild(this.CreateTable());
          this.UpdateTable();
          this.FUpdateTable = false;
        };
      };
    };
    this.UpdateElementVisual = function () {
      pas["WEBLib.Controls"].TCustomControl.UpdateElementVisual.call(this);
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        this.GetElementHandle().style.setProperty("border","1px dotted gray");
      };
      if (!this.GetIsLinked() && (this.FTbl != null)) {
        if (this.FColor !== -1) {
          this.FTbl.style.setProperty("background-color",pas["WEBLib.Graphics"].ColorToHTML(this.FColor))}
         else this.FTbl.style.removeProperty("background-color");
      };
    };
    this.RegisterParent = function (AValue) {
      pas["WEBLib.Controls"].TControl.RegisterParent.apply(this,arguments);
      if (!this.IsUpdating() && !(pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) {
        if (pas.Classes.TComponentStateItem.csLoading in AValue.FComponentState) return;
        this.FControlCollection.Add$1().FControl = AValue;
        if (this.FControlCollection.GetCount() > (this.FColumnCollection.GetCount() * this.FRowCollection.GetCount())) {
          if (this.FExpandStyle === $mod.TGridPanelExpandStyle.esAddRows) {
            this.FRowCollection.Add$1()}
           else this.FColumnCollection.Add$1();
        };
        this.UpdateTable();
      };
    };
    this.TableChanged = function (Sender) {
      this.UpdateTable();
    };
    this.Notification = function (AComponent, Operation) {
      var i = 0;
      var destid = "";
      var el = null;
      if ((Operation === pas.Classes.TOperation.opRemove) && !(pas.Classes.TComponentStateItem.csDestroying in this.FComponentState)) {
        for (var $l = this.FControlCollection.GetCount() - 1; $l >= 0; $l--) {
          i = $l;
          if (this.FControlCollection.GetItem$1(i).FControl === AComponent) {
            destid = this.FName + "R" + pas.SysUtils.IntToStr(this.FControlCollection.GetItem$1(i).FRow) + "C" + pas.SysUtils.IntToStr(this.FControlCollection.GetItem$1(i).FColumn);
            el = document.getElementById(destid);
            el.removeChild(el.firstChild);
            this.FControlCollection.GetItem$1(i).FControl = null;
            this.FControlCollection.Delete(i);
          };
        };
        this.UpdateTable();
      };
      pas["WEBLib.Menus"].TWebCustomControl.Notification.apply(this,arguments);
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.FDesignTime$1 = (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) && !((pas.Classes.TComponentStateItem.csReading in this.FOwner.FComponentState) || (pas.Classes.TComponentStateItem.csLoading in this.FOwner.FComponentState));
      this.FEnablePropagation = true;
      this.FControlStyle = rtl.unionSet(this.FControlStyle,rtl.createSet(pas["WEBLib.Controls"].TControlStyleValue.csAcceptsControls));
      this.FUpdateTable = true;
      this.FColCount = -1;
      this.FRowCollection = $mod.TGridPanelRows.$create("Create$3",[this]);
      this.FRowCollection.FPropName = "RowCollection";
      if (this.FDesignTime$1 && !(pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) {
        this.FRowCollection.Add$1();
        this.FRowCollection.GetItem$1(0).SetValue(100);
        this.FRowCollection.GetItem$1(0).SetSizeStyle(pas["WEBLib.Controls"].TSizeStyle.ssPercent);
      };
      this.FColumnCollection = $mod.TGridPanelColumns.$create("Create$3",[this]);
      this.FColumnCollection.FPropName = "ColumnCollection";
      if (this.FDesignTime$1 && !(pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) {
        this.FColumnCollection.Add$1();
        this.FColumnCollection.Add$1();
        this.FColumnCollection.GetItem$1(0).SetValue(50);
        this.FColumnCollection.GetItem$1(1).SetValue(50);
        this.FColumnCollection.GetItem$1(0).SetSizeStyle(pas["WEBLib.Controls"].TSizeStyle.ssPercent);
        this.FColumnCollection.GetItem$1(1).SetSizeStyle(pas["WEBLib.Controls"].TSizeStyle.ssPercent);
      };
      this.FRowCollection.FOnChange = rtl.createCallback(this,"TableChanged");
      this.FColumnCollection.FOnChange = rtl.createCallback(this,"TableChanged");
      this.FControlCollection = $mod.TControlCollection.$create("Create$3",[this]);
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        this.SetWidth(400);
        this.SetHeight(300);
      };
    };
    this.Destroy = function () {
      rtl.free(this,"FRowCollection");
      rtl.free(this,"FColumnCollection");
      rtl.free(this,"FControlCollection");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.AddControl = function (AControl) {
      this.FControlCollection.Add$1().FControl = AControl;
      AControl.SetParent(this);
      if (this.FControlCollection.GetCount() > (this.FColumnCollection.GetCount() * this.FRowCollection.GetCount())) {
        if (this.FExpandStyle === $mod.TGridPanelExpandStyle.esAddRows) {
          this.FRowCollection.Add$1()}
         else this.FColumnCollection.Add$1();
      };
    };
    this.RemoveControl = function (AControl) {
      var i = 0;
      var r = 0;
      var c = 0;
      var row = null;
      var d = 0.0;
      for (var $l = 0, $end = this.FControlCollection.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.FControlCollection.GetItem$1(i).FControl === AControl) {
          r = this.FControlCollection.GetItem$1(i).FRow;
          c = this.FControlCollection.GetItem$1(i).FColumn;
          row = this.FTblBody.childNodes.item(r);
          row.childNodes.item(c).innerHTML = "";
          this.FControlCollection.Delete(i);
          break;
        };
      };
      if (this.FColumnCollection.GetCount() > 0) {
        d = this.FControlCollection.GetCount() / this.FColumnCollection.GetCount();
        if (pas.System.Frac(d) > 0) d = pas.System.Trunc(d + 1);
        while (d < this.FRowCollection.GetCount()) {
          this.FRowCollection.Delete(this.FRowCollection.GetCount() - 1);
        };
      };
    };
    this.EndUpdate = function () {
      pas["WEBLib.Controls"].TCustomControl.EndUpdate.call(this);
      this.UpdateTable();
    };
    this.RemoveControls = function () {
      var i = 0;
      for (var $l = this.FControlCollection.GetCount() - 1; $l >= 0; $l--) {
        i = $l;
        this.RemoveControl(this.FControlCollection.GetItem$1(i).FControl);
      };
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor");
    $r.addProperty("ControlCollection",2,$mod.$rtti["TControlCollection"],"FControlCollection","SetControlCollection");
    $r.addProperty("ColumnCollection",2,$mod.$rtti["TGridPanelColumns"],"FColumnCollection","SetColumnCollection");
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("ExpandStyle",0,$mod.$rtti["TGridPanelExpandStyle"],"FExpandStyle","FExpandStyle",4,{Default: $mod.TGridPanelExpandStyle.esAddRows});
    $r.addProperty("GridLineWidth",0,rtl.longint,"FGridLineWidth","FGridLineWidth",4,{Default: 0});
    $r.addProperty("GridLineColor",0,pas["WEBLib.Graphics"].$rtti["TColor"],"FGridLineColor","FGridLineColor",4,{Default: 0});
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti["TPopupMenu"],"FPopupMenu","FPopupMenu");
    $r.addProperty("Role",3,rtl.string,"GetRole","SetRole");
    $r.addProperty("RowCollection",2,$mod.$rtti["TGridPanelRows"],"FRowCollection","SetRowCollection");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
    $r.addProperty("OnTouchStart",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchStart","FOnTouchStart");
    $r.addProperty("OnTouchMove",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchMove","FOnTouchMove");
    $r.addProperty("OnTouchEnd",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchEnd","FOnTouchEnd");
    $r.addProperty("OnTouchCancel",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchCancel","FOnTouchCancel");
  });
  rtl.createClass(this,"TWebGridPanel",this.TGridPanel,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.TMultiMediaType = {"0": "mtVideo", mtVideo: 0, "1": "mtAudio", mtAudio: 1};
  this.$rtti.$Enum("TMultiMediaType",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TMultiMediaType});
  this.TMultiMediaControl = {"0": "mcFullscreen", mcFullscreen: 0, "1": "mcDownload", mcDownload: 1, "2": "mcRemoteplayback", mcRemoteplayback: 2, "3": "mcPlaybackrate", mcPlaybackrate: 3, "4": "mcPictureInPicture", mcPictureInPicture: 4};
  this.$rtti.$Enum("TMultiMediaControl",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TMultiMediaControl});
  this.$rtti.$Set("TMultiMediaControls",{comptype: this.$rtti["TMultiMediaControl"]});
  this.$rtti.$Int("TMultiMediaVolume",{minvalue: 0, maxvalue: 100, ordtype: 1});
  this.TMultiMediaPreload = {"0": "mpAuto", mpAuto: 0, "1": "mpNone", mpNone: 1, "2": "mpMetadata", mpMetadata: 2};
  this.$rtti.$Enum("TMultiMediaPreload",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TMultiMediaPreload});
  rtl.createClass(this,"TMultimediaPlayer",pas["WEBLib.Controls"].TCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Controls"].TCustomControl.$init.call(this);
      this.FURL = "";
      this.FMultimediaType = 0;
      this.FAutoPlay = false;
      this.FControls$1 = false;
      this.FMuted = false;
      this.FLoop = false;
      this.FVolume = 0;
      this.FPlaybackRate = 0.0;
      this.FContextMenu = false;
      this.FPoster = "";
      this.FHideControls = {};
      this.FPreload = 0;
    };
    this.$final = function () {
      this.FHideControls = undefined;
      pas["WEBLib.Controls"].TCustomControl.$final.call(this);
    };
    this.SetAutoPlay = function (Value) {
      if (this.FAutoPlay !== Value) {
        this.FAutoPlay = Value;
        this.UpdateElement();
      };
    };
    this.SetControls = function (Value) {
      if (this.FControls$1 !== Value) {
        this.FControls$1 = Value;
        this.UpdateElement();
      };
    };
    this.SetMuted = function (Value) {
      var el = null;
      if (this.FMuted !== Value) {
        this.FMuted = Value;
        if (this.GetElementHandle() != null) {
          el = this.GetElementHandle();
          el.muted = Value;
        };
      };
    };
    this.SetLoop = function (Value) {
      var el = null;
      if (this.FLoop !== Value) {
        this.FLoop = Value;
        if (this.GetElementHandle() != null) {
          el = this.GetElementHandle();
          el.loop = Value;
        };
      };
    };
    this.SetURL = function (Value) {
      if (this.FURL !== Value) {
        this.FURL = Value;
        this.UpdateElement();
      };
    };
    this.SetVolume = function (Value) {
      var el = null;
      if ((this.FVolume !== Value) && (Value >= 0) && (Value <= 100)) {
        this.FVolume = Value;
        if (this.GetElementHandle() != null) {
          el = this.GetElementHandle();
          el.volume = Value/100;
        };
      };
    };
    this.GetCurrentTime = function () {
      var Result = 0.0;
      var el = null;
      var i = 0.0;
      el = this.GetElementHandle();
      if (el != null) {
        i = el.currentTime;
      };
      Result = i;
      return Result;
    };
    this.SetCurrentTime = function (Value) {
      var el = null;
      el = this.GetElementHandle();
      if (el != null) el.currentTime = Value;
    };
    this.GetDuration = function () {
      var Result = 0.0;
      var el = null;
      var i = 0.0;
      el = this.GetElementHandle();
      if (el != null) {
        i = el.duration;
      };
      Result = i;
      return Result;
    };
    this.GetEnded = function () {
      var Result = false;
      var el = null;
      var e = false;
      el = this.GetElementHandle();
      if (el != null) {
        e = el.ended;
      };
      Result = e;
      return Result;
    };
    this.GetPaused = function () {
      var Result = false;
      var el = null;
      var e = false;
      el = this.GetElementHandle();
      if (el != null) {
        e = el.paused;
      };
      Result = e;
      return Result;
    };
    this.SetPlaybackRate = function (Value) {
      if (this.FPlaybackRate !== Value) {
        this.FPlaybackRate = Value;
        this.UpdateElement();
      };
    };
    this.SetContextMenu = function (Value) {
      if (this.FContextMenu !== Value) {
        this.FContextMenu = Value;
        this.UpdateElement();
      };
    };
    this.SetPoster = function (Value) {
      var el = null;
      if (this.FPoster !== Value) {
        this.FPoster = Value;
        if (this.GetElementHandle() != null) {
          el = this.GetElementHandle();
          el.poster = Value;
        };
      };
    };
    this.SetHideControls = function (Value) {
      if (rtl.neSet(this.FHideControls,Value)) {
        this.FHideControls = rtl.refSet(Value);
        this.UpdateElement();
      };
    };
    this.SetPreload = function (Value) {
      var s = "";
      var el = null;
      if (this.FPreload !== Value) {
        this.FPreload = Value;
        if (this.GetElementHandle() != null) {
          el = this.GetElementHandle();
          var $tmp = Value;
          if ($tmp === $mod.TMultiMediaPreload.mpNone) {
            s = "none"}
           else if ($tmp === $mod.TMultiMediaPreload.mpAuto) {
            s = "auto"}
           else if ($tmp === $mod.TMultiMediaPreload.mpMetadata) s = "metadata";
          el.preload = s;
        };
      };
    };
    this.CreateElement = function () {
      var Result = null;
      var el = null;
      var src = null;
      var p = "";
      if (this.FMultimediaType === $mod.TMultiMediaType.mtVideo) {
        el = document.createElement("VIDEO")}
       else el = document.createElement("AUDIO");
      src = document.createElement("SOURCE");
      var $tmp = this.FPreload;
      if ($tmp === $mod.TMultiMediaPreload.mpNone) {
        p = "none"}
       else if ($tmp === $mod.TMultiMediaPreload.mpAuto) {
        p = "auto"}
       else if ($tmp === $mod.TMultiMediaPreload.mpMetadata) p = "metadata";
      el.defaultPlaybackRate = this.FPlaybackRate;
      el.preload = p;
      el.appendChild(src);
      Result = el;
      return Result;
    };
    this.UpdateElement = function () {
      var $Self = this;
      var el = null;
      var vid = null;
      var nocontrols = "";
      function booltoattr(b) {
        var Result = "";
        if (b) {
          Result = "true"}
         else Result = "false";
        return Result;
      };
      pas["WEBLib.Controls"].TControl.UpdateElement.call(this);
      if (this.GetElementHandle() != null) {
        vid = this.GetElementHandle();
        vid.controls = this.FControls;
        vid.defaultPlaybackRate = this.FPlaybackRate;
        vid.playbackRate = this.FPlaybackRate;
        vid.muted = this.FMuted;
        if (this.FControls$1) {
          this.GetElementHandle().setAttribute("controls","")}
         else this.GetElementHandle().removeAttribute("controls");
        if (this.FAutoPlay) {
          this.GetElementHandle().setAttribute("autoplay",booltoattr(this.FAutoPlay))}
         else this.GetElementHandle().removeAttribute("autoplay");
        if (this.FMuted) {
          this.GetElementHandle().setAttribute("muted",booltoattr(this.FMuted))}
         else this.GetElementHandle().removeAttribute("muted");
        if (!this.FContextMenu) {
          this.GetElementHandle().setAttribute("oncontextmenu","return false;")}
         else this.GetElementHandle().removeAttribute("oncontextmenu");
        this.GetElementHandle().setAttribute("volume",pas["WEBLib.Utils"].FormatProp("%.2f",pas.System.VarRecs(3,this.FVolume / 100)));
        this.GetElementHandle().setAttribute("src",this.FURL);
        nocontrols = "";
        if ($mod.TMultiMediaControl.mcFullscreen in this.FHideControls) nocontrols = "nofullscreen ";
        if ($mod.TMultiMediaControl.mcDownload in this.FHideControls) nocontrols = nocontrols + "nodownload ";
        if ($mod.TMultiMediaControl.mcRemoteplayback in this.FHideControls) nocontrols = nocontrols + "noremoteplayback ";
        if ($mod.TMultiMediaControl.mcPlaybackrate in this.FHideControls) nocontrols = nocontrols + "noplaybackrate ";
        if (nocontrols !== "") {
          this.GetElementHandle().setAttribute("controlsList",nocontrols)}
         else if (this.GetElementHandle().hasAttribute("controlsList")) this.GetElementHandle().removeAttribute("controlsList");
        if ($mod.TMultiMediaControl.mcPictureInPicture in this.FHideControls) {
          this.GetElementHandle().setAttribute("disablePictureInPicture","")}
         else if (this.GetElementHandle().hasAttribute("disablePictureInPicture")) this.GetElementHandle().removeAttribute("disablePictureInPicture");
      };
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.FVolume = 100;
      this.FPlaybackRate = 1;
      this.FMuted = false;
      this.FAutoPlay = false;
      this.FContextMenu = true;
      this.FPreload = $mod.TMultiMediaPreload.mpAuto;
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        this.SetWidth(400);
        this.SetHeight(300);
      };
    };
    this.Play = function () {
      var el = null;
      el = this.GetElementHandle();
      if (el != null) el.play();
    };
    this.Pause = function () {
      var el = null;
      el = this.GetElementHandle();
      if (el != null) {
        el.pause();
      };
    };
    this.ReLoad = function () {
      var el = null;
      el = this.GetElementHandle();
      if (el != null) el.load();
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("AutoPlay",2,rtl.boolean,"FAutoPlay","SetAutoPlay");
    $r.addProperty("Controls",2,rtl.boolean,"FControls$1","SetControls");
    $r.addProperty("ContextMenu",2,rtl.boolean,"FContextMenu","SetContextMenu",4,{Default: true});
    $r.addProperty("HideControls",2,$mod.$rtti["TMultiMediaControls"],"FHideControls","SetHideControls");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Loop",2,rtl.boolean,"FLoop","SetLoop");
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("MultimediaType",0,$mod.$rtti["TMultiMediaType"],"FMultimediaType","FMultimediaType");
    $r.addProperty("Muted",2,rtl.boolean,"FMuted","SetMuted");
    $r.addProperty("PlaybackRate",2,rtl.double,"FPlaybackRate","SetPlaybackRate");
    $r.addProperty("Poster",2,rtl.string,"FPoster","SetPoster");
    $r.addProperty("Preload",2,$mod.$rtti["TMultiMediaPreload"],"FPreload","SetPreload");
    $r.addProperty("URL",2,rtl.string,"FURL","SetURL");
    $r.addProperty("Volume",2,$mod.$rtti["TMultiMediaVolume"],"FVolume","SetVolume");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseDown","FOnMouseDown");
    $r.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseUp","FOnMouseUp");
    $r.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti["TMouseMoveEvent"],"FOnMouseMove","FOnMouseMove");
  });
  rtl.createClass(this,"TWebMultiMediaPlayer",this.TMultimediaPlayer,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"THTMLContainer",pas["WEBLib.Controls"].TCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Controls"].TCustomControl.$init.call(this);
      this.FHTML = null;
      this.FScrollStyle = 0;
      this.FURL = "";
      this.FOnLoaded = null;
    };
    this.$final = function () {
      this.FHTML = undefined;
      this.FOnLoaded = undefined;
      pas["WEBLib.Controls"].TCustomControl.$final.call(this);
    };
    this.SetHTML = function (Value) {
      this.FHTML.Assign(Value);
    };
    this.SetURL = function (Value) {
      this.FURL = Value;
      this.LoadFromURL(this.FURL);
    };
    this.CreateElement = function () {
      var Result = null;
      Result = document.createElement("DIV");
      return Result;
    };
    this.UpdateElement = function () {
      var TextFound = false;
      pas["WEBLib.Controls"].TControl.UpdateElement.call(this);
      if (!this.IsUpdating() && (this.GetElementHandle() != null) && (this.GetContainer() != null)) {
        if (this.FElementClassName !== "") {
          this.GetElementHandle().style.removeProperty("border");
          this.GetElementHandle().style.removeProperty("background-color");
        } else this.GetElementHandle().style.setProperty("white-space","normal");
        if (this.FHTML != null) {
          TextFound = this.FHTML.GetTextStr() !== "";
          this.GetContainer().innerHTML = this.FHTML.GetTextStr();
        };
        if (!this.GetIsLinked() && (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState)) this.RenderDesigning(this.$classname,this.GetContainer(),this,!TextFound,"");
        if (!this.GetIsLinked()) {
          pas["WEBLib.Controls"].SetHTMLElementFont(this.GetElementHandle(),this.FFont,this.FElementFont === pas["WEBLib.Controls"].TElementFont.efCSS);
        };
        var $tmp = this.FScrollStyle;
        if ($tmp === pas["WEBLib.Controls"].TScrollStyle.ssBoth) {
          this.GetElementHandle().style.setProperty("overflow","auto")}
         else if ($tmp === pas["WEBLib.Controls"].TScrollStyle.ssNone) {
          this.GetElementHandle().style.setProperty("overflow","")}
         else if ($tmp === pas["WEBLib.Controls"].TScrollStyle.ssVertical) {
          this.GetElementHandle().style.setProperty("overflow-y","auto")}
         else if ($tmp === pas["WEBLib.Controls"].TScrollStyle.ssHorizontal) this.GetElementHandle().style.setProperty("overflow-x","auto");
      };
    };
    this.HTMLChanged = function (Sender) {
      this.UpdateElement();
    };
    this.DoLoaded = function () {
      if (this.FOnLoaded != null) this.FOnLoaded(this);
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.FHTML = pas.Classes.TStringList.$create("Create$1");
      this.FHTML.SetSkipLastLineBreak(true);
      this.FHTML.FOnChange = rtl.createCallback(this,"HTMLChanged");
      this.FScrollStyle = pas["WEBLib.Controls"].TScrollStyle.ssBoth;
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        this.SetWidth(240);
        this.SetHeight(160);
      };
    };
    this.Destroy = function () {
      rtl.free(this,"FHTML");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.LoadFromURL = function (AURL) {
      var $Self = this;
      var Result = null;
      var wr = null;
      Result = new Promise(function (ASuccess, AFailed) {
        wr = pas["WEBLib.REST"].TWebHTTPRequest.$create("Create$1",[$Self]);
        wr.FURL = AURL;
        wr.Execute$1(function (AResponse, ARequest) {
          $Self.FHTML.SetTextStr(AResponse);
          $Self.DoLoaded();
          ASuccess(true);
        },function (ARequest) {
          AFailed(false);
        });
      });
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("HTML",2,pas.Classes.$rtti["TStringList"],"FHTML","SetHTML");
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",4,{Default: true});
    $r.addProperty("Role",3,rtl.string,"GetRole","SetRole");
    $r.addProperty("ScrollStyle",0,pas["WEBLib.Controls"].$rtti["TScrollStyle"],"FScrollStyle","FScrollStyle");
    $r.addProperty("URL",2,rtl.string,"FURL","SetURL");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnLoaded",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnLoaded","FOnLoaded");
    $r.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseDown","FOnMouseDown");
    $r.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti["TMouseMoveEvent"],"FOnMouseMove","FOnMouseMove");
    $r.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseUp","FOnMouseUp");
    $r.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseLeave","FOnMouseLeave");
    $r.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseEnter","FOnMouseEnter");
    $r.addProperty("OnTouchEnd",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchEnd","FOnTouchEnd");
    $r.addProperty("OnTouchCancel",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchCancel","FOnTouchCancel");
    $r.addProperty("OnTouchStart",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchStart","FOnTouchStart");
    $r.addProperty("OnTouchMove",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchMove","FOnTouchMove");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
  });
  rtl.createClass(this,"TWebHTMLContainer",this.THTMLContainer,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"THTMLForm",pas["WEBLib.Controls"].TCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Controls"].TCustomControl.$init.call(this);
      this.FOnSubmit = null;
      this.FAction = "";
    };
    this.$final = function () {
      this.FOnSubmit = undefined;
      pas["WEBLib.Controls"].TCustomControl.$final.call(this);
    };
    this.SetAction = function (Value) {
      var el = null;
      this.FAction = Value;
      if (!(pas.Classes.TComponentStateItem.csDesigning in this.FComponentState)) {
        if (this.GetIsLinked()) {
          el = this.GetElementHandle()}
         else el = this.GetChildContainer();
        if (el != null) el.setAttribute("action",this.FAction);
      };
    };
    this.UpdateElement = function () {
      if (!(this.GetElementHandle() != null)) return;
      pas["WEBLib.Controls"].TControl.UpdateElement.call(this);
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) this.GetElementHandle().style.setProperty("background","repeating-linear-gradient(45deg,#EEEEEE 10px,#EEEEEE 10px, #ffffff 20px)");
    };
    this.CreateElement = function () {
      var Result = null;
      Result = document.createElement("DIV");
      Result.appendChild(document.createElement("FORM"));
      return Result;
    };
    this.DoHandleSubmit = function (Event) {
      var Result = false;
      this.FElementEvent = Event;
      if (this.FOnSubmit != null) this.FOnSubmit(this);
      Result = true;
      return Result;
    };
    this.GetChildContainer = function () {
      var Result = null;
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        Result = this.GetElementHandle()}
       else {
        if (this.GetIsLinked()) {
          Result = this.GetElementHandle()}
         else Result = this.GetElementHandle().firstChild;
      };
      return Result;
    };
    this.BindEvents = function () {
      pas["WEBLib.Controls"].TCustomControl.BindEvents.call(this);
      this.GetChildContainer().addEventListener("submit",rtl.createSafeCallback(this,"DoHandleSubmit"));
    };
    this.CheckValidity = function () {
      var Result = false;
      var el = null;
      var res = false;
      el = this.GetElementHandle();
      res = el.checkValidity();
      Result = res;
      return Result;
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.FEnablePropagation = true;
      this.FControlStyle = rtl.unionSet(this.FControlStyle,rtl.createSet(pas["WEBLib.Controls"].TControlStyleValue.csAcceptsControls));
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        this.SetWidth(400);
        this.SetHeight(300);
      };
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Action",2,rtl.string,"FAction","SetAction");
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Role",3,rtl.string,"GetRole","SetRole");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnSubmit",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnSubmit","FOnSubmit");
  });
  rtl.createClass(this,"TWebHTMLForm",this.THTMLForm,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TBadge",pas["WEBLib.Controls"].TCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Controls"].TCustomControl.$init.call(this);
      this.FTextColor = 0;
      this.FText = "";
    };
    this.SetTextColor = function (Value) {
      this.FTextColor = Value;
      this.UpdateElement();
    };
    this.SetText = function (Value) {
      this.FText = Value;
      this.UpdateElement();
    };
    this.CreateElement = function () {
      var Result = null;
      Result = document.createElement("SPAN");
      return Result;
    };
    this.UpdateElement = function () {
      pas["WEBLib.Controls"].TControl.UpdateElement.call(this);
      if (this.GetElementHandle() != null) {
        this.GetElementHandle().innerHTML = this.FText;
        if (this.FElementClassName === "") {
          this.GetElementHandle().setAttribute("class","tmsbadge");
          this.GetElementHandle().style.setProperty("color",pas["WEBLib.Graphics"].ColorToHTML(this.FTextColor));
        } else {
          this.GetElementHandle().style.removeProperty("color");
        };
        this.GetElementHandle().style.removeProperty("width");
        this.GetElementHandle().style.removeProperty("height");
      };
    };
    this.SetElementClassName = function (AValue) {
      pas["WEBLib.Controls"].TControl.SetElementClassName.apply(this,arguments);
      this.UpdateElement();
    };
    this.CreateInitialize = function () {
      var css = "";
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.SetColor(255);
      this.FTextColor = 16777215;
      this.FText = "1";
      css = "span.tmsbadge {" + "  background: #FF0000;" + "  border-radius: 0.8em;" + "  -moz-border-radius: 0.8em;" + "  -webkit-border-radius: 0.8em;" + "  color: #ffffff;" + "  display: inline-block;" + "  line-height: 1.6em;" + "  margin-right: 5px;" + "  text-align: center;" + "  width: 1.6em;" + "}";
      this.AddControlStyle(css);
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        this.SetWidth(20);
        this.SetHeight(20);
      };
    };
    this.Destroy = function () {
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor",4,{Default: 255});
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("Role",3,rtl.string,"GetRole","SetRole");
    $r.addProperty("Text",2,rtl.string,"FText","SetText");
    $r.addProperty("TextColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FTextColor","SetTextColor");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseDown","FOnMouseDown");
    $r.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseUp","FOnMouseUp");
    $r.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti["TMouseMoveEvent"],"FOnMouseMove","FOnMouseMove");
  });
  rtl.createClass(this,"TWebBadge",this.TBadge,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TAccordionSection",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FCaption = "";
      this.FContent = "";
      this.FTag = 0;
      this.FExpanded = false;
      this.FControl = null;
    };
    this.$final = function () {
      this.FControl = undefined;
      pas.Classes.TCollectionItem.$final.call(this);
    };
    this.SetExpanded = function (Value) {
      if (this.FExpanded !== Value) {
        this.FExpanded = Value;
        if (this.FExpanded) {
          rtl.as(rtl.as(this.FCollection,$mod.TAccordionSections).Owner(),$mod.TAccordion).Expand(this)}
         else rtl.as(rtl.as(this.FCollection,$mod.TAccordionSections).Owner(),$mod.TAccordion).Collapse(this);
      };
    };
    this.SetCaption = function (Value) {
      this.FCaption = Value;
      rtl.as(this.FCollection,$mod.TAccordionSections).Update(this);
    };
    this.SetContent = function (Value) {
      this.FContent = Value;
      rtl.as(this.FCollection,$mod.TAccordionSections).Update(this);
    };
    this.Assign = function (Source) {
      if ($mod.TAccordionSection.isPrototypeOf(Source)) {
        this.FCaption = rtl.as(Source,$mod.TAccordionSection).FCaption;
        this.FContent = rtl.as(Source,$mod.TAccordionSection).FContent;
        this.FTag = rtl.as(Source,$mod.TAccordionSection).FTag;
      };
    };
    this.CaptionElement = function () {
      var Result = null;
      Result = document.getElementById(rtl.as(rtl.as(this.FCollection,$mod.TAccordionSections).Owner(),$mod.TAccordion).FName + "_" + pas.SysUtils.IntToStr(this.GetIndex()));
      return Result;
    };
    this.PanelElement = function () {
      var Result = null;
      var el = null;
      el = this.CaptionElement();
      Result = el.nextElementSibling;
      return Result;
    };
    var $r = this.$rtti;
    $r.addProperty("Caption",2,rtl.string,"FCaption","SetCaption");
    $r.addProperty("Content",2,rtl.string,"FContent","SetContent");
    $r.addProperty("Tag",0,rtl.longint,"FTag","FTag");
  });
  rtl.createClass(this,"TAccordionSections",pas.Classes.TOwnedCollection,function () {
    this.$init = function () {
      pas.Classes.TOwnedCollection.$init.call(this);
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      pas.Classes.TOwnedCollection.$final.call(this);
    };
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      this.SetItem(Index,Value);
    };
    this.Update = function (Item) {
      pas.Classes.TCollection.Update.apply(this,arguments);
      if ((this.FOnChange != null) && (this.FUpdateCount === 0)) this.FOnChange(this);
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,$mod.TAccordionSection);
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      return Result;
    };
  });
  this.$rtti.$MethodVar("TAccordionSectionEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ASection",this.$rtti["TAccordionSection"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TAccordionSectionAllowEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ASection",this.$rtti["TAccordionSection"]],["Allow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TAccordionSectionRenderEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ASection",this.$rtti["TAccordionSection"]],["ACaption",pas["WEBLib.Controls"].$rtti["TJSHTMLElementRecord"]],["APanel",pas["WEBLib.Controls"].$rtti["TJSHTMLElementRecord"]]]), methodkind: 0});
  rtl.createClass(this,"TAccordion",pas["WEBLib.Controls"].TCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Controls"].TCustomControl.$init.call(this);
      this.FStyleRendered = false;
      this.FSections = null;
      this.FOnCollapsing = null;
      this.FOnExpanding = null;
      this.FOnCollapsed = null;
      this.FOnExpanded = null;
      this.FOnRenderSection = null;
      this.FElementSectionClassName = "";
      this.FElementContentClassName = "";
    };
    this.$final = function () {
      this.FSections = undefined;
      this.FOnCollapsing = undefined;
      this.FOnExpanding = undefined;
      this.FOnCollapsed = undefined;
      this.FOnExpanded = undefined;
      this.FOnRenderSection = undefined;
      pas["WEBLib.Controls"].TCustomControl.$final.call(this);
    };
    this.SetSections = function (Value) {
      this.FSections.Assign(Value);
    };
    this.CreateElement = function () {
      var Result = null;
      Result = document.createElement("DIV");
      return Result;
    };
    this.UpdateElement = function () {
      pas["WEBLib.Controls"].TControl.UpdateElement.call(this);
    };
    this.RenderAccordion = function () {
      var i = 0;
      var sp = null;
      var btn = null;
      var divel = null;
      var p = null;
      var LCaptionElementRec = pas["WEBLib.Controls"].TJSHTMLElementRecord.$new();
      var LPanelElementRec = pas["WEBLib.Controls"].TJSHTMLElementRecord.$new();
      if (this.GetElementHandle().childNodes.length > 0) {
        while (this.GetElementHandle().firstChild != null) this.GetElementHandle().removeChild(this.GetElementHandle().firstChild);
        if (this.FElementClassName !== "") {
          this.GetElementHandle().style.removeProperty("border");
          this.GetElementHandle().style.removeProperty("background-color");
        };
      };
      sp = document.createElement("SPAN");
      this.GetElementHandle().appendChild(sp);
      for (var $l = 0, $end = this.FSections.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        btn = document.createElement("BUTTON");
        btn.innerHTML = this.FSections.GetItem$1(i).FCaption;
        btn.setAttribute("id",this.FName + "_" + pas.SysUtils.IntToStr(i));
        btn.setAttribute("class","accordion_" + this.FName);
        if (this.FElementSectionClassName !== "") btn.classList.add(this.FElementSectionClassName);
        btn.addEventListener("click",rtl.createSafeCallback(this,"DoAccordionClick"));
        divel = document.createElement("DIV");
        divel.setAttribute("class","accordionpanel_" + this.FName);
        p = document.createElement("P");
        p.style.setProperty("user-select","text");
        if (this.FElementContentClassName !== "") p.setAttribute("class",this.FElementContentClassName);
        p.innerHTML = this.FSections.GetItem$1(i).FContent;
        sp.appendChild(btn);
        sp.appendChild(divel);
        divel.appendChild(p);
        if (this.FOnRenderSection != null) {
          LCaptionElementRec.element = btn;
          LPanelElementRec.element = p;
          this.FOnRenderSection(this,this.FSections.GetItem$1(i),pas["WEBLib.Controls"].TJSHTMLElementRecord.$clone(LCaptionElementRec),pas["WEBLib.Controls"].TJSHTMLElementRecord.$clone(LPanelElementRec));
        };
      };
      if (!this.GetIsLinked() && (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState)) this.RenderDesigning(this.$classname,this.GetContainer(),this,this.FSections.GetCount() === 0,"");
    };
    this.RenderStyle = function () {
      var css = "";
      if (this.FStyleRendered) return;
      this.FStyleRendered = true;
      css = ".accordion_" + this.FName + " {" + "background-color: #eee;" + "color: #444;" + "cursor: pointer;" + "padding: 18px;" + "width: 100%;" + "text-align: left;" + "border: none;" + "outline: none;" + "transition: 0.4s;" + "}" + "\r\n" + ".accordionactive_" + this.FName + ", .accordion_" + this.FName + "::hover {" + "background-color: #ccc;" + "}" + "\r\n" + ".accordionactive_" + this.FName + "::before {" + "transform: rotate(90deg);" + "}" + "\r\n" + ".accordion_" + this.FName + "::before {" + '  content: "\\25B6";' + "  font-size: 13px;" + "  display: inline-block;" + "  margin-right: 5px;" + "}" + "\r\n" + ".accordionpanel_" + this.FName + " {" + "padding: 0 18px;" + "max-height: 0;" + "overflow: hidden;" + "transition: max-height 0.2s ease-out;" + "}";
      this.AddInstanceStyle(css);
    };
    this.SectionsChanged = function (Sender) {
      if (!this.IsUpdating()) {
        this.RenderStyle();
        this.RenderAccordion();
      };
    };
    this.DoAccordionClick = function (Event) {
      var Result = false;
      var el = null;
      var pnl = null;
      var s = "";
      var Allow = false;
      var ASection = null;
      var i = 0;
      var e = 0;
      el = Event.srcElement;
      Allow = true;
      ASection = null;
      if (el.hasAttribute("id")) {
        s = el.getAttribute("id");
        s = pas.System.Copy(s,pas.System.Pos(this.FName,s) + this.FName.length + 1,s.length);
        pas.System.val$6(s,{get: function () {
            return i;
          }, set: function (v) {
            i = v;
          }},{get: function () {
            return e;
          }, set: function (v) {
            e = v;
          }});
        if ((e === 0) && (i < this.FSections.GetCount())) ASection = this.FSections.GetItem$1(i);
      };
      if (el.classList.contains("accordionactive_" + this.FName)) {
        if (this.FOnCollapsing != null) this.FOnCollapsing(this,ASection,{get: function () {
            return Allow;
          }, set: function (v) {
            Allow = v;
          }});
      } else {
        if (this.FOnExpanding != null) this.FOnExpanding(this,ASection,{get: function () {
            return Allow;
          }, set: function (v) {
            Allow = v;
          }});
      };
      if (!Allow) return Result;
      el.classList.toggle("accordionactive_" + this.FName);
      pnl = el.nextElementSibling;
      if (ASection.FControl != null) {
        ASection.FControl.SetElementPosition(pas["WEBLib.Controls"].TElementPosition.epRelative);
        pnl.appendChild(ASection.FControl.GetElementHandle());
        ASection.FControl.SetVisible(true);
      };
      s = pnl.style.getPropertyValue("max-height");
      if ((s !== "0px") && (s !== "")) {
        pnl.style.setProperty("max-height","0");
      } else {
        pnl.style.setProperty("max-height",pas.SysUtils.IntToStr(pnl.scrollHeight) + "px");
      };
      if (el.classList.contains("accordionactive_" + this.FName)) {
        ASection.FExpanded = true;
        if (this.FOnExpanded != null) this.FOnExpanded(this,ASection);
      } else {
        ASection.FExpanded = false;
        if (this.FOnCollapsed != null) this.FOnCollapsed(this,ASection);
      };
      Result = true;
      return Result;
    };
    this.UpdateElementVisual = function () {
      pas["WEBLib.Controls"].TCustomControl.UpdateElementVisual.call(this);
      this.GetElementHandle().style.setProperty("overflow-y","auto");
      this.GetElementHandle().style.setProperty("overflow-x","hidden");
    };
    this.Expand = function (ASection) {
      var el = null;
      var pnl = null;
      var LClass = "";
      el = ASection.CaptionElement();
      pnl = el.nextElementSibling;
      if (ASection.FControl != null) {
        ASection.FControl.SetElementPosition(pas["WEBLib.Controls"].TElementPosition.epRelative);
        pnl.appendChild(ASection.FControl.GetElementHandle());
        ASection.FControl.SetVisible(true);
      };
      LClass = "accordionactive_" + this.FName;
      if (!el.classList.contains(LClass)) el.classList.add(LClass);
      pnl.style.setProperty("max-height",pas.SysUtils.IntToStr(pnl.scrollHeight) + "px");
    };
    this.Collapse = function (ASection) {
      var el = null;
      var pnl = null;
      var LClass = "";
      el = ASection.CaptionElement();
      LClass = "accordionactive_" + this.FName;
      if (el.classList.contains(LClass)) el.classList.remove(LClass);
      pnl = el.nextElementSibling;
      pnl.style.setProperty("max-height","0");
    };
    this.SetElementClassName = function (AValue) {
      pas["WEBLib.Controls"].TControl.SetElementClassName.apply(this,arguments);
      if (this.FElementClassName !== "") this.RenderAccordion();
    };
    this.Loaded = function () {
      var i = 0;
      pas["WEBLib.Controls"].TCustomControl.Loaded.call(this);
      for (var $l = 0, $end = this.FSections.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.FSections.GetItem$1(i).FControl != null) this.FSections.GetItem$1(i).FControl.SetVisible(false);
      };
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.FSections = $mod.TAccordionSections.$create("Create$3",[this]);
      this.FSections.FOnChange = rtl.createCallback(this,"SectionsChanged");
      this.FSections.FPropName = "Sections";
      this.FStyleRendered = false;
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        this.SetWidth(400);
        this.SetHeight(300);
      };
    };
    this.Destroy = function () {
      rtl.free(this,"FSections");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.EndUpdate = function () {
      pas["WEBLib.Controls"].TCustomControl.EndUpdate.call(this);
      this.RenderStyle();
      this.RenderAccordion();
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("ElementSectionClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementSectionClassName","FElementSectionClassName");
    $r.addProperty("ElementContentClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementContentClassName","FElementContentClassName");
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Role",3,rtl.string,"GetRole","SetRole");
    $r.addProperty("Sections",2,$mod.$rtti["TAccordionSections"],"FSections","SetSections");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnCollapsed",0,$mod.$rtti["TAccordionSectionEvent"],"FOnCollapsed","FOnCollapsed");
    $r.addProperty("OnCollapsing",0,$mod.$rtti["TAccordionSectionAllowEvent"],"FOnCollapsing","FOnCollapsing");
    $r.addProperty("OnExpanded",0,$mod.$rtti["TAccordionSectionEvent"],"FOnExpanded","FOnExpanded");
    $r.addProperty("OnExpanding",0,$mod.$rtti["TAccordionSectionAllowEvent"],"FOnExpanding","FOnExpanding");
    $r.addProperty("OnRenderSection",0,$mod.$rtti["TAccordionSectionRenderEvent"],"FOnRenderSection","FOnRenderSection");
    $r.addProperty("OnTouchStart",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchStart","FOnTouchStart");
    $r.addProperty("OnTouchMove",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchMove","FOnTouchMove");
    $r.addProperty("OnTouchEnd",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchEnd","FOnTouchEnd");
    $r.addProperty("OnTouchCancel",0,pas["WEBLib.Controls"].$rtti["TTouchEvent"],"FOnTouchCancel","FOnTouchCancel");
  });
  rtl.createClass(this,"TWebAccordion",this.TAccordion,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.TGridStyle = {"0": "gTemplateColumns", gTemplateColumns: 0, "1": "gTemplateRows", gTemplateRows: 1};
  this.$rtti.$Enum("TGridStyle",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TGridStyle});
  rtl.createClass(this,"TResponsiveLayoutItem",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FWidth = 0;
      this.FStyleType = 0;
      this.FStyle = "";
      this.FColumnGap = "";
      this.FRowGap = "";
      this.FTag = 0;
      this.FDescription = "";
      this.FMargins = null;
    };
    this.$final = function () {
      this.FMargins = undefined;
      pas.Classes.TCollectionItem.$final.call(this);
    };
    this.SetMargins = function (Value) {
      this.FMargins.Assign(Value);
      this.FCollection.Update(this);
    };
    this.SetColumnGap = function (Value) {
      if (this.FColumnGap !== Value) {
        this.FColumnGap = Value;
        this.FCollection.Update(this);
      };
    };
    this.SetRowGap = function (Value) {
      if (this.FRowGap !== Value) {
        this.FRowGap = Value;
        this.FCollection.Update(this);
      };
    };
    this.SetStyle = function (Value) {
      if (this.FStyle !== Value) {
        this.FStyle = Value;
        this.FCollection.Update(this);
      };
    };
    this.SetStyleType = function (Value) {
      if (this.FStyleType !== Value) {
        this.FStyleType = Value;
        this.FCollection.Update(this);
      };
    };
    this.SetWidth = function (Value) {
      if (this.FWidth !== Value) {
        this.FWidth = Value;
        this.FCollection.Update(this);
      };
    };
    this.Create$1 = function (AOwner) {
      this.FMargins = pas["WEBLib.Controls"].TMargins.$create("Create$1");
      this.FMargins.SetLeft(0);
      this.FMargins.SetTop(0);
      this.FMargins.SetRight(0);
      this.FMargins.SetBottom(0);
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FMargins");
      pas.Classes.TCollectionItem.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TResponsiveLayoutItem.isPrototypeOf(Source)) {
        this.FColumnGap = rtl.as(Source,$mod.TResponsiveLayoutItem).FColumnGap;
        this.FDescription = rtl.as(Source,$mod.TResponsiveLayoutItem).FDescription;
        this.FRowGap = rtl.as(Source,$mod.TResponsiveLayoutItem).FRowGap;
        this.FWidth = rtl.as(Source,$mod.TResponsiveLayoutItem).FWidth;
        this.FStyle = rtl.as(Source,$mod.TResponsiveLayoutItem).FStyle;
        this.FStyleType = rtl.as(Source,$mod.TResponsiveLayoutItem).FStyleType;
        this.FTag = rtl.as(Source,$mod.TResponsiveLayoutItem).FTag;
        this.FMargins.Assign(rtl.as(Source,$mod.TResponsiveLayoutItem).FMargins);
      };
    };
    var $r = this.$rtti;
    $r.addProperty("ColumnGap",2,rtl.string,"FColumnGap","SetColumnGap");
    $r.addProperty("Description",0,rtl.string,"FDescription","FDescription");
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("RowGap",2,rtl.string,"FRowGap","SetRowGap");
    $r.addProperty("StyleType",2,$mod.$rtti["TGridStyle"],"FStyleType","SetStyleType");
    $r.addProperty("Style",2,rtl.string,"FStyle","SetStyle");
    $r.addProperty("Tag",0,rtl.longint,"FTag","FTag");
    $r.addProperty("Width",2,rtl.longint,"FWidth","SetWidth");
  });
  rtl.createClass(this,"TResponsiveLayout",pas.Classes.TOwnedCollection,function () {
    this.$init = function () {
      pas.Classes.TOwnedCollection.$init.call(this);
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      pas.Classes.TOwnedCollection.$final.call(this);
    };
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      this.SetItem(Index,Value);
    };
    this.Update = function (Item) {
      pas.Classes.TCollection.Update.apply(this,arguments);
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.GetLayoutForWidth = function (w) {
      var Result = null;
      var i = 0;
      var d = 0;
      var j = 0;
      var l = 0;
      var mx = 0;
      Result = null;
      if (this.GetCount() === 0) return Result;
      d = 0xFFFF;
      j = -1;
      mx = 0;
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.GetItem$1(i).FWidth > mx) {
          mx = this.GetItem$1(i).FWidth;
          l = i;
        };
        if (w < this.GetItem$1(i).FWidth) {
          if ((this.GetItem$1(i).FWidth - w) < d) {
            d = this.GetItem$1(i).FWidth - w;
            j = i;
          };
        };
      };
      if (j === -1) j = l;
      Result = this.GetItem$1(j);
      return Result;
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,$mod.TResponsiveLayoutItem);
      return this;
    };
    this.Add$1 = function (AWidth, AStyle) {
      var Result = null;
      Result = this.Add$2();
      Result.SetWidth(AWidth);
      Result.SetStyle(AStyle);
      return Result;
    };
    this.Add$2 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      return Result;
    };
  });
  this.$rtti.$MethodVar("TResponsiveLayoutChangeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ALayout",this.$rtti["TResponsiveLayoutItem"]]]), methodkind: 0});
  rtl.createClass(this,"TResponsiveGridPanel",pas["WEBLib.Controls"].TCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Controls"].TCustomControl.$init.call(this);
      this.FDesignTime$1 = false;
      this.FLabel = null;
      this.FLayout = null;
      this.FActiveLayoutItem = null;
      this.FOldWidth = 0;
      this.FControlCollection = null;
      this.FOnLayoutChange = null;
      this.FResizePtr = null;
    };
    this.$final = function () {
      this.FLabel = undefined;
      this.FLayout = undefined;
      this.FActiveLayoutItem = undefined;
      this.FControlCollection = undefined;
      this.FOnLayoutChange = undefined;
      pas["WEBLib.Controls"].TCustomControl.$final.call(this);
    };
    this.SetControlCollection = function (Value) {
      this.FControlCollection.Assign(Value);
    };
    this.HandleResize = function (Event) {
      var Result = false;
      var w = 0;
      if (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState) return Result;
      Result = true;
      w = this.GetWidth();
      if (this.FOldWidth !== w) {
        this.FOldWidth = w;
        this.Resize();
      };
      return Result;
    };
    this.SetResponsiveStyle = function () {
      var li = null;
      var w = 0;
      var lGap = "";
      if (!(this.FLayout != null)) return;
      if (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState) return;
      if (!(this.GetElementHandle() != null)) return;
      w = this.GetWidth();
      li = this.FLayout.GetLayoutForWidth(w);
      if (li != null) {
        if (li.FStyleType === $mod.TGridStyle.gTemplateColumns) {
          this.GetElementHandle().style.setProperty("grid-template-columns",li.FStyle);
          this.GetElementHandle().style.removeProperty("grid-template-rows");
        } else {
          this.GetElementHandle().style.removeProperty("grid-template-columns");
          this.GetElementHandle().style.setProperty("grid-template-rows",li.FStyle);
        };
        lGap = li.FRowGap;
        if (pas.SysUtils.TStringHelper.IsNumber.call({get: function () {
            return lGap;
          }, set: function (v) {
            lGap = v;
          }})) lGap = lGap + "px";
        this.GetElementHandle().style.setProperty("grid-row-gap",lGap);
        lGap = li.FColumnGap;
        if (pas.SysUtils.TStringHelper.IsNumber.call({get: function () {
            return lGap;
          }, set: function (v) {
            lGap = v;
          }})) lGap = lGap + "px";
        this.GetElementHandle().style.setProperty("grid-column-gap",lGap);
        this.GetElementHandle().style.setProperty("padding-left",pas.SysUtils.IntToStr(li.FMargins.FLeft) + "px");
        this.GetElementHandle().style.setProperty("padding-top",pas.SysUtils.IntToStr(li.FMargins.FTop) + "px");
        this.GetElementHandle().style.setProperty("padding-right",pas.SysUtils.IntToStr(li.FMargins.FRight) + "px");
        this.GetElementHandle().style.setProperty("padding-bottom",pas.SysUtils.IntToStr(li.FMargins.FBottom) + "px");
      };
      if (li !== this.FActiveLayoutItem) {
        this.FActiveLayoutItem = li;
        if (this.FOnLayoutChange != null) this.FOnLayoutChange(this,this.FActiveLayoutItem);
      };
    };
    this.BindEvents = function () {
      pas["WEBLib.Controls"].TCustomControl.BindEvents.call(this);
      this.FResizePtr = rtl.createCallback(this,"HandleResize");
      document.defaultView.addEventListener("resize",this.FResizePtr);
    };
    this.UnbindEvents = function () {
      pas["WEBLib.Controls"].TControl.UnbindEvents.call(this);
      if (this.FResizePtr != null) {
        document.defaultView.removeEventListener("resize",this.FResizePtr);
        this.FResizePtr = null;
      };
    };
    this.UpdateControls = function () {
      var i = 0;
      var j = 0;
      var k = 0;
      var el = null;
      var sp = null;
      var fragment = null;
      var control = null;
      if (pas.Classes.TComponentStateItem.csLoading in this.FComponentState) return;
      if (this.IsUpdating()) return;
      if (!(this.GetElementHandle() != null)) return;
      if ((this.FControlCollection.GetCount() > 0) && (this.FLabel != null)) {
        this.GetElementHandle().removeChild(this.FLabel);
        this.FLabel = null;
        this.GetElementHandle().style.setProperty("display","grid");
      };
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        for (var $l = this.GetElementHandle().childElementCount - 1; $l >= 0; $l--) {
          i = $l;
          if (this.GetElementHandle().children.item(i).tagName === "SPAN") this.GetElementHandle().removeChild(this.GetElementHandle().children.item(i));
        };
        for (var $l1 = 0, $end = this.FLayout.GetCount() - 1; $l1 <= $end; $l1++) {
          i = $l1;
          sp = document.createElement("SPAN");
          sp.style.setProperty("position","absolute");
          sp.style.setProperty("width","4px");
          sp.style.setProperty("height","12px");
          sp.style.setProperty("background-color","red");
          sp.style.setProperty("top","0px");
          sp.style.setProperty("left",pas.SysUtils.IntToStr(this.FLayout.GetItem$1(i).FWidth) + "px");
          this.GetElementHandle().appendChild(sp);
        };
      };
      for (var $l2 = 0, $end1 = this.FControlCollection.GetCount() - 1; $l2 <= $end1; $l2++) {
        i = $l2;
        if (this.GridElementCount() <= i) {
          el = document.createElement("DIV");
          el.setAttribute("data","grid");
          if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) el.style.setProperty("border","1px silver dotted");
          this.GetElementHandle().appendChild(el);
        } else {
          k = 0;
          for (var $l3 = 0, $end2 = this.GetElementHandle().childElementCount - 1; $l3 <= $end2; $l3++) {
            j = $l3;
            el = this.GetElementHandle().children.item(j);
            if (el.getAttribute("data") === "grid") {
              if (k === i) {
                break}
               else k += 1;
            };
          };
        };
        fragment = document.createDocumentFragment();
        control = this.FControlCollection.GetItem$1(i).FControl;
        if (control != null) {
          control.SetElementPosition(pas["WEBLib.Controls"].TElementPosition.epRelative);
          control.SetChildOrderEx(-1);
          if (control.GetElementHandle() != null) {
            fragment.appendChild(control.GetElementHandle());
            el.appendChild(fragment);
          };
        };
      };
      this.UpdateElement();
    };
    this.CreateElement = function () {
      var Result = null;
      if ((pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) && (this.FControlCollection.GetCount() === 0)) {
        Result = document.createElement("DIV");
        this.FLabel = document.createElement("DIV");
        this.FLabel.innerHTML = this.$classname;
        this.SetBorderStyle(pas["WEBLib.Controls"].TBorderStyle.bsSingle);
        this.FLabel.setAttribute("align","center");
        this.FLabel.style.setProperty("border","1px solid silver");
        this.FLabel.style.setProperty("vertical-align","middle");
        this.FLabel.style.setProperty("display","table-cell");
        Result.appendChild(this.FLabel);
      } else {
        Result = document.createElement("DIV");
      };
      return Result;
    };
    this.GridElementCount = function () {
      var Result = 0;
      var i = 0;
      var el = null;
      Result = 0;
      for (var $l = 0, $end = this.GetElementHandle().childElementCount - 1; $l <= $end; $l++) {
        i = $l;
        el = this.GetElementHandle().children.item(i);
        if (el.getAttribute("data") === "grid") Result += 1;
      };
      return Result;
    };
    this.UpdateElement = function () {
      pas["WEBLib.Controls"].TControl.UpdateElement.call(this);
      if (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState) return;
      if (!(this.GetElementHandle() != null)) return;
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        if (this.FControlCollection.GetCount() === 0) {
          this.GetElementHandle().style.setProperty("display","table");
          if (this.FColor === -1) this.GetElementHandle().style.setProperty("background-color","silver");
        };
      };
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        this.GetElementHandle().style.setProperty("border","1px silver dotted");
      };
      this.GetElementHandle().style.setProperty("display","grid");
      this.SetResponsiveStyle();
    };
    this.Loaded = function () {
      pas["WEBLib.Controls"].TCustomControl.Loaded.call(this);
      this.UpdateControls();
    };
    this.RegisterParent = function (AValue) {
      pas["WEBLib.Controls"].TControl.RegisterParent.apply(this,arguments);
      if (!this.IsUpdating() && !(pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) {
        this.FControlCollection.Add$1().FControl = AValue;
        this.UpdateControls();
      };
    };
    this.Notification = function (AComponent, Operation) {
      var i = 0;
      var upd = false;
      var el = null;
      upd = false;
      if ((Operation === pas.Classes.TOperation.opRemove) && !(pas.Classes.TComponentStateItem.csDestroying in this.FComponentState)) {
        for (var $l = this.FControlCollection.GetCount() - 1; $l >= 0; $l--) {
          i = $l;
          if (this.FControlCollection.GetItem$1(i).FControl === AComponent) {
            el = this.GetElementHandle().children.item(i);
            while (el.childElementCount > 0) el.removeChild(el.firstChild);
            this.FControlCollection.GetItem$1(i).FControl = null;
            this.FControlCollection.Delete(i);
            upd = true;
          };
        };
      };
      pas.Classes.TComponent.Notification.apply(this,arguments);
      if (upd) this.UpdateControls();
    };
    this.LayoutChanged = function (Sender) {
      if (this.IsUpdating() || (pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) return;
      this.UpdateControls();
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.Controls"].TControl.Create$1.apply(this,arguments);
      this.FResizePtr = null;
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FControlCollection");
      rtl.free(this,"FLayout");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.CreateInitialize = function () {
      var li = null;
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.FDesignTime$1 = (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) && !((pas.Classes.TComponentStateItem.csReading in this.FOwner.FComponentState) || (pas.Classes.TComponentStateItem.csLoading in this.FOwner.FComponentState));
      this.FEnablePropagation = true;
      this.FControlStyle = rtl.unionSet(this.FControlStyle,rtl.createSet(pas["WEBLib.Controls"].TControlStyleValue.csAcceptsControls));
      this.FControlCollection = $mod.TControlCollection.$create("Create$3",[this]);
      this.FControlCollection.FPropName = "ControlCollection";
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        this.SetWidth(400);
        this.SetHeight(300);
      };
      this.FLabel = null;
      this.FActiveLayoutItem = null;
      this.FLayout = $mod.TResponsiveLayout.$create("Create$3",[this]);
      this.FLayout.FOnChange = rtl.createCallback(this,"LayoutChanged");
      this.FLayout.FPropName = "Layout";
      if (this.FDesignTime$1) {
        li = this.FLayout.Add$2();
        li.FDescription = "Smartphone";
        li.SetWidth(575);
        li.SetStyle("1fr");
        li = this.FLayout.Add$2();
        li.FDescription = "Tablet";
        li.SetWidth(768);
        li.SetStyle("1fr 1fr");
        li = this.FLayout.Add$2();
        li.FDescription = "Desktop";
        li.SetWidth(991);
        li.SetStyle("1fr 1fr 1fr");
        li = this.FLayout.Add$2();
        li.FDescription = "Large Desktop";
        li.SetWidth(1199);
        li.SetStyle("1fr 1fr 1fr 1fr");
      };
    };
    this.AlignControls = function (AControl, Rect) {
      pas["WEBLib.Controls"].TControl.AlignControls.apply(this,arguments);
      this.Resize();
    };
    this.GetChildren = function (Proc, Root) {
      pas["WEBLib.Controls"].TControl.GetChildren.apply(this,arguments);
    };
    this.Resize = function () {
      pas["WEBLib.Controls"].TCustomControl.Resize.call(this);
      this.SetResponsiveStyle();
    };
    this.AddControl = function (AControl) {
      this.FControlCollection.Add$1().FControl = AControl;
      AControl.SetParent(this);
    };
    this.RemoveControl = function (AControl) {
      var i = 0;
      for (var $l = 0, $end = this.FControlCollection.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.FControlCollection.GetItem$1(i).FControl === AControl) {
          if (AControl.GetElementHandle() != null) AControl.GetElementHandle().parentElement.removeChild(AControl.GetElementHandle());
          this.FControlCollection.Delete(i);
          break;
        };
      };
    };
    this.RemoveControls = function () {
      var i = 0;
      var AControl = null;
      for (var $l = this.FControlCollection.GetCount() - 1; $l >= 0; $l--) {
        i = $l;
        AControl = this.FControlCollection.GetItem$1(i).FControl;
        if ((AControl != null) && (AControl.GetElementHandle() != null)) AControl.GetElementHandle().parentElement.removeChild(AControl.GetElementHandle());
        this.FControlCollection.Delete(i);
      };
    };
    this.EndUpdate = function () {
      pas["WEBLib.Controls"].TCustomControl.EndUpdate.call(this);
      this.UpdateControls();
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("ChildOrder",2,rtl.longint,"FChildOrder","SetChildOrderEx",4,{Default: 0});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor");
    $r.addProperty("ControlCollection",2,$mod.$rtti["TControlCollection"],"FControlCollection","SetControlCollection");
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Hint",2,rtl.string,"FHint","SetHint");
    $r.addProperty("Layout",0,$mod.$rtti["TResponsiveLayout"],"FLayout","FLayout");
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("Role",3,rtl.string,"GetRole","SetRole");
    $r.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",4,{Default: false});
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnLayoutChange",0,$mod.$rtti["TResponsiveLayoutChangeEvent"],"FOnLayoutChange","FOnLayoutChange");
  });
  rtl.createClass(this,"TWebResponsiveGridPanel",this.TResponsiveGridPanel,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TLookupValueItem",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FValue = "";
      this.FDisplayText = "";
    };
    var $r = this.$rtti;
    $r.addProperty("Value",0,rtl.string,"FValue","FValue");
    $r.addProperty("DisplayText",0,rtl.string,"FDisplayText","FDisplayText");
  });
  rtl.createClass(this,"TLookupValues",pas.Classes.TOwnedCollection,function () {
    this.$init = function () {
      pas.Classes.TOwnedCollection.$init.call(this);
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      pas.Classes.TOwnedCollection.$final.call(this);
    };
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      this.SetItem(Index,Value);
    };
    this.DoChange = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Update = function (Item) {
      pas.Classes.TCollection.Update.apply(this,arguments);
      if (Item === null) this.DoChange();
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,$mod.TLookupValueItem);
      return this;
    };
    this.AddPair = function (AValue, ADisplayText) {
      var lv = null;
      lv = pas.Classes.TCollection.Add.call(this);
      lv.FValue = AValue;
      lv.FDisplayText = ADisplayText;
      if (this.FUpdateCount === 0) this.DoChange();
    };
    this.InsertPair = function (Index, AValue, ADisplayText) {
      var lv = null;
      lv = pas.Classes.TCollection.Insert.call(this,Index);
      lv.FValue = AValue;
      lv.FDisplayText = ADisplayText;
      if (this.FUpdateCount === 0) this.DoChange();
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      return Result;
    };
  });
  rtl.createClass(this,"TCustomLookupComboBox",pas["WEBLib.StdCtrls"].TCustomComboBox,function () {
    this.$init = function () {
      pas["WEBLib.StdCtrls"].TCustomComboBox.$init.call(this);
      this.FLookupValues = null;
    };
    this.$final = function () {
      this.FLookupValues = undefined;
      pas["WEBLib.StdCtrls"].TCustomComboBox.$final.call(this);
    };
    this.SetLookupValues = function (Value) {
      this.FLookupValues.Assign(Value);
    };
    this.GetDisplayText = function () {
      var Result = "";
      Result = "";
      if (this.GetItemIndex() >= 0) Result = this.FLookupValues.GetItem$1(this.GetItemIndex()).FDisplayText;
      return Result;
    };
    this.GetValue = function () {
      var Result = "";
      Result = "";
      if (this.GetItemIndex() >= 0) Result = this.FLookupValues.GetItem$1(this.GetItemIndex()).FValue;
      return Result;
    };
    this.SetDisplayText = function (Value) {
      var i = 0;
      var idx = 0;
      idx = -1;
      for (var $l = 0, $end = this.FLookupValues.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.FLookupValues.GetItem$1(i).FDisplayText === Value) {
          idx = i;
          break;
        };
      };
      this.SetItemIndex(idx);
    };
    this.SetValue = function (Value) {
      var i = 0;
      var idx = 0;
      idx = -1;
      for (var $l = 0, $end = this.FLookupValues.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.FLookupValues.GetItem$1(i).FValue === Value) {
          idx = i;
          break;
        };
      };
      this.SetItemIndex(idx);
    };
    this.ValuesChanged = function (Sender) {
      this.DoUpdateList();
    };
    this.DoUpdateList = function () {
      var i = 0;
      var opt = null;
      if (!(this.GetContainer() != null)) return;
      for (var $l = this.GetContainer().options.length - 1; $l >= 0; $l--) {
        i = $l;
        this.GetContainer().remove(i);
      };
      this.AddTextHint();
      for (var $l1 = 0, $end = this.FLookupValues.GetCount() - 1; $l1 <= $end; $l1++) {
        i = $l1;
        opt = document.createElement("OPTION");
        opt.setAttribute("value",this.FLookupValues.GetItem$1(i).FValue);
        opt.innerHTML = this.FLookupValues.GetItem$1(i).FDisplayText;
        this.GetContainer().appendChild(opt);
      };
      this.UpdateElement();
    };
    this.InitCSSLibrary = function (ALibrary) {
      if (ALibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap) {
        this.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
        this.SetElementClassName("custom-select");
      };
    };
    this.Destroy = function () {
      rtl.free(this,"FLookupValues");
      pas["WEBLib.StdCtrls"].TCustomComboBox.Destroy.call(this);
    };
    this.CreateInitialize = function () {
      pas["WEBLib.StdCtrls"].TCustomComboBox.CreateInitialize.call(this);
      this.FLookupValues = $mod.TLookupValues.$create("Create$3",[this]);
      this.FLookupValues.FPropName = "LookupValues";
      this.FLookupValues.FOnChange = rtl.createCallback(this,"ValuesChanged");
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor");
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Hint",2,rtl.string,"FHint","SetHint");
    $r.addProperty("ItemIndex",3,rtl.longint,"GetItemIndex","SetItemIndex",4,{Default: -1});
    $r.addProperty("Left",3,rtl.longint,"GetLeft","SetLeft");
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",4,{Default: true});
    $r.addProperty("Role",3,rtl.string,"GetRole","SetRole");
    $r.addProperty("ShowFocus",2,rtl.boolean,"FShowFocus","SetShowFocus",4,{Default: false});
    $r.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",4,{Default: false});
    $r.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder");
    $r.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",4,{Default: true});
    $r.addProperty("TextDirection",0,pas["WEBLib.Controls"].$rtti["TTextDirection"],"FTextDirection","FTextDirection",4,{Default: pas["WEBLib.Controls"].TTextDirection.tdDefault});
    $r.addProperty("TextHint",2,rtl.string,"FTextHint","SetTextHint");
    $r.addProperty("Top",3,rtl.longint,"GetTop","SetTop");
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChange","FOnChange");
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnKeyDown",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyDown","FOnKeyDown");
    $r.addProperty("OnKeyPress",0,pas["WEBLib.Controls"].$rtti["TKeyPressEvent"],"FOnKeyPress","FOnKeyPress");
    $r.addProperty("OnKeyUp",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyUp","FOnKeyUp");
    $r.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseDown","FOnMouseDown");
    $r.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseUp","FOnMouseUp");
    $r.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti["TMouseMoveEvent"],"FOnMouseMove","FOnMouseMove");
    $r.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseLeave","FOnMouseLeave");
    $r.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseEnter","FOnMouseEnter");
    $r.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnEnter","FOnEnter");
    $r.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnExit","FOnExit");
  });
  rtl.createClass(this,"TLookupComboBox",this.TCustomLookupComboBox,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("LookupValues",2,$mod.$rtti["TLookupValues"],"FLookupValues","SetLookupValues");
  });
  rtl.createClass(this,"TWebLookupComboBox",this.TLookupComboBox,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TCustomListBox",pas["WEBLib.Menus"].TWebCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Menus"].TWebCustomControl.$init.call(this);
      this.FItems = null;
      this.FItemIndex = 0;
      this.FItemHeight = 0;
      this.FSorted = false;
      this.FOnChange = null;
      this.FHandleChangePtr = null;
      this.FElementItemClassName = "";
    };
    this.$final = function () {
      this.FItems = undefined;
      this.FOnChange = undefined;
      pas["WEBLib.Menus"].TWebCustomControl.$final.call(this);
    };
    this.SetItemHeight = function (Value) {
      this.FItemHeight = Value;
    };
    this.SetSorted = function (Value) {
      this.FSorted = Value;
      this.FItems.Sort();
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FItems.GetCount();
      return Result;
    };
    this.GetItemElement = function (i) {
      var Result = null;
      Result = null;
      if ((this.GetContainer() != null) && (i < this.GetContainer().children.length)) Result = this.GetContainer().children.item(i);
      return Result;
    };
    this.DoHandleChange = function (Event) {
      var Result = false;
      this.Change();
      Result = true;
      return Result;
    };
    this.DoItemsChange = function (Sender) {
      this.DoUpdateList();
    };
    this.KeyDown = function (Key, Shift) {
      pas["WEBLib.Controls"].TControl.KeyDown.apply(this,arguments);
      if (Key.get() === 40) {
        this.SetItemIndex(this.GetItemIndex() + 1);
        Key.set(0);
      };
      if (Key.get() === 36) {
        this.SetItemIndex(0);
        Key.set(0);
      };
      if (Key.get() === 34) {
        this.SetItemIndex(this.GetItemIndex() + 4);
        Key.set(0);
      };
      if (Key.get() === 33) {
        this.SetItemIndex(this.GetItemIndex() - 4);
        Key.set(0);
      };
      if (Key.get() === 35) {
        this.SetItemIndex(this.FItems.GetCount() - 1);
        Key.set(0);
      };
      if (Key.get() === 38) {
        this.SetItemIndex(this.GetItemIndex() - 1);
        Key.set(0);
      };
    };
    this.DoUpdateList = function () {
      var i = 0;
      var opt = null;
      var chk = null;
      var txt = null;
      if (!(this.GetContainer() != null)) return;
      if (this.IsUpdating()) return;
      if (this.GetElementHandle().tagName !== "DIV") return;
      while (this.GetContainer().firstChild != null) this.GetContainer().removeChild(this.GetContainer().lastChild);
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        opt = document.createElement("LABEL");
        chk = document.createElement("INPUT");
        chk.setAttribute("type","checkbox");
        chk.style.setProperty("vertical-align","middle");
        opt.style.setProperty("vertical-align","middle");
        opt.appendChild(chk);
        opt.style.setProperty("display","block");
        txt = document.createTextNode(this.FItems.Get(i));
        opt.appendChild(txt);
        if (this.FElementItemClassName !== "") opt.setAttribute("class",this.FElementItemClassName);
        if (this.FDragMode === pas["WEBLib.Controls"].TDragMode.dmAutomatic) opt.setAttribute("draggable","true");
        this.GetContainer().appendChild(opt);
      };
      this.UpdateElementData();
    };
    this.PersistinHTML = function () {
      if (!(this.GetContainer() != null)) return;
      if (this.GetElementHandle().tagName !== "DIV") return;
    };
    this.SetItemIndex = function (Value) {
      var el = null;
      el = this.GetItemElement(Value);
      if (el != null) el.firstChild.focus();
    };
    this.GetItemIndex = function () {
      var Result = 0;
      var i = 0;
      var el = null;
      Result = this.FItemIndex;
      if (this.GetContainer() != null) {
        for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
          i = $l;
          el = this.GetItemElement(i);
          if (el != null) el = el.firstChild;
          if (el != null) {
            if (el === document.activeElement) {
              Result = i;
              break;
            };
          };
        };
      };
      return Result;
    };
    this.CreateElement = function () {
      var Result = null;
      Result = document.createElement("DIV");
      return Result;
    };
    this.SetItems = function (AItems) {
      this.FItems.Assign(AItems);
    };
    this.Loaded = function () {
      pas["WEBLib.Controls"].TCustomControl.Loaded.call(this);
      this.DoUpdateList();
      this.UpdateElement();
    };
    this.UpdateElementData = function () {
      pas["WEBLib.Controls"].TControl.UpdateElementData.call(this);
      if (this.GetElementHandle() != null) {
        this.GetElementHandle().style.setProperty("overflow","auto");
      };
    };
    this.UpdateElementVisual = function () {
      pas["WEBLib.Controls"].TCustomControl.UpdateElementVisual.call(this);
      if (this.GetElementHandle() != null) {
        this.GetElementHandle().style.setProperty("overflow","auto");
      };
    };
    this.UpdateParent = function () {
      pas["WEBLib.Controls"].TControl.UpdateParent.call(this);
      this.DoUpdateList();
    };
    this.BindEvents = function () {
      pas["WEBLib.Controls"].TCustomControl.BindEvents.call(this);
      if (this.GetElementHandle() != null) {
        this.GetElementHandle().addEventListener("change",this.FHandleChangePtr);
      };
    };
    this.UnbindEvents = function () {
      pas["WEBLib.Controls"].TControl.UnbindEvents.call(this);
      if (this.GetElementHandle() != null) {
        this.GetElementHandle().removeEventListener("change",this.FHandleChangePtr);
      };
    };
    this.Change = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.EnableDrag = function () {
      var I = 0;
      if (!(this.GetContainer() != null)) return;
      for (var $l = 0, $end = this.GetContainer().options.length - 1; $l <= $end; $l++) {
        I = $l;
        this.GetContainer().options.item(I).setAttribute("draggable","true");
      };
    };
    this.DisableDrag = function () {
      var I = 0;
      if (!(this.GetContainer() != null)) return;
      for (var $l = 0, $end = this.GetContainer().children.length - 1; $l <= $end; $l++) {
        I = $l;
        this.GetContainer().children.item(I).setAttribute("draggable","false");
      };
    };
    this.ClearMethodPointers = function () {
      pas["WEBLib.Controls"].TControl.ClearMethodPointers.call(this);
      this.FHandleChangePtr = null;
    };
    this.GetMethodPointers = function () {
      pas["WEBLib.Controls"].TControl.GetMethodPointers.call(this);
      this.FHandleChangePtr = rtl.createCallback(this,"DoHandleChange");
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.FItems = pas.Classes.TStringList.$create("Create$1");
      this.FItems.SetSkipLastLineBreak(true);
      this.FItems.FOnChange = rtl.createCallback(this,"DoItemsChange");
      this.FItemIndex = -1;
      this.SetBorderStyle(pas["WEBLib.Controls"].TBorderStyle.bsSingle);
      this.FCustomBorder = true;
      this.SetShowFocus(true);
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        this.SetWidth(160);
        this.SetHeight(180);
      };
    };
    this.Destroy = function () {
      rtl.free(this,"FItems");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.EndUpdate = function () {
      pas["WEBLib.Controls"].TCustomControl.EndUpdate.call(this);
      this.DoUpdateList();
    };
    this.AddItem = function (Item, AObject) {
      this.FItems.AddObject(Item,AObject);
    };
    this.SetFilter = function (AExpression, CaseSensitive) {
      var i = 0;
      var re = null;
      if (CaseSensitive) {
        re = new RegExp(AExpression)}
       else re = new RegExp(AExpression,"i");
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (!re.test(this.FItems.Get(i))) {
          this.GetItemElement(i).style.setProperty("display","none");
        } else this.GetItemElement(i).style.setProperty("display","block");
      };
    };
    this.RemoveFilter = function () {
      var i = 0;
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        this.GetItemElement(i).style.setProperty("display","block");
      };
    };
    this.Clear = function () {
      this.BeginUpdate();
      this.FItems.Clear();
      this.EndUpdate();
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TImageListBox",this.TCustomListBox,function () {
    this.DoUpdateList = function () {
      var i = 0;
      var opt = null;
      var img = null;
      if (!(this.GetContainer() != null)) return;
      if (this.IsUpdating()) return;
      if (this.GetElementHandle().tagName !== "DIV") return;
      while (this.GetContainer().firstChild != null) this.GetContainer().removeChild(this.GetContainer().lastChild);
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        opt = document.createElement("LABEL");
        img = document.createElement("IMG");
        img.setAttribute("src",this.FItems.Get(i));
        img.style.setProperty("display","inline-block");
        opt.appendChild(img);
        opt.style.setProperty("display","block");
        if (this.FElementItemClassName !== "") opt.setAttribute("class",this.FElementItemClassName);
        if (this.FDragMode === pas["WEBLib.Controls"].TDragMode.dmAutomatic) opt.setAttribute("draggable","true");
        this.GetContainer().appendChild(opt);
      };
      this.UpdateElementData();
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("BiDiMode",2,pas["WEBLib.Controls"].$rtti["TBiDiMode"],"FBiDiMode","SetBiDiMode",4,{Default: pas["WEBLib.Controls"].TBiDiMode.bdLeftToRight});
    $r.addProperty("BorderStyle",2,pas["WEBLib.Controls"].$rtti["TBorderStyle"],"FBorderStyle","SetBorderStyle",4,{Default: pas["WEBLib.Controls"].TBorderStyle.bsSingle});
    $r.addProperty("ChildOrder",2,rtl.longint,"FChildOrder","SetChildOrderEx",4,{Default: 0});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor");
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementItemClassName",0,rtl.string,"FElementItemClassName","FElementItemClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Hint",2,rtl.string,"FHint","SetHint");
    $r.addProperty("ItemHeight",2,rtl.longint,"FItemHeight","SetItemHeight");
    $r.addProperty("Items",2,pas.Classes.$rtti["TStrings"],"FItems","SetItems");
    $r.addProperty("Left",3,rtl.longint,"GetLeft","SetLeft");
    $r.addProperty("ParentColor",2,rtl.boolean,"FParentColor","SetParentColor",4,{Default: false});
    $r.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",4,{Default: true});
    $r.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti["TPopupMenu"],"FPopupMenu","FPopupMenu");
    $r.addProperty("Role",3,rtl.string,"GetRole","SetRole");
    $r.addProperty("ShowFocus",2,rtl.boolean,"FShowFocus","SetShowFocus",4,{Default: false});
    $r.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",4,{Default: false});
    $r.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder");
    $r.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",4,{Default: true});
    $r.addProperty("Top",3,rtl.longint,"GetTop","SetTop");
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChange","FOnChange");
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnKeyDown",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyDown","FOnKeyDown");
    $r.addProperty("OnKeyPress",0,pas["WEBLib.Controls"].$rtti["TKeyPressEvent"],"FOnKeyPress","FOnKeyPress");
    $r.addProperty("OnKeyUp",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyUp","FOnKeyUp");
    $r.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseDown","FOnMouseDown");
    $r.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseUp","FOnMouseUp");
    $r.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti["TMouseMoveEvent"],"FOnMouseMove","FOnMouseMove");
    $r.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseLeave","FOnMouseLeave");
    $r.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseEnter","FOnMouseEnter");
    $r.addProperty("OnMouseWheel",0,pas["WEBLib.Controls"].$rtti["TMouseWheelEvent"],"FOnMouseWheel","FOnMouseWheel");
    $r.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnEnter","FOnEnter");
    $r.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnExit","FOnExit");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
  });
  rtl.createClass(this,"TWebImageListBox",this.TImageListBox,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TSearchEdit",pas["WEBLib.StdCtrls"].TCustomEdit,function () {
    this.$init = function () {
      pas["WEBLib.StdCtrls"].TCustomEdit.$init.call(this);
      this.FSearchElement = null;
      this.FClearElement = null;
      this.FInputElement = null;
      this.FClearPtr = null;
      this.FSearchPtr = null;
      this.FOnSearchClick = null;
      this.FOnClearClick = null;
      this.FClearImageURL = "";
      this.FSearchImageURL = "";
    };
    this.$final = function () {
      this.FSearchElement = undefined;
      this.FClearElement = undefined;
      this.FInputElement = undefined;
      this.FOnSearchClick = undefined;
      this.FOnClearClick = undefined;
      pas["WEBLib.StdCtrls"].TCustomEdit.$final.call(this);
    };
    this.SetClearImageURL = function (Value) {
      this.FClearImageURL = Value;
    };
    this.SetSearchImageURL = function (Value) {
      this.FSearchImageURL = Value;
    };
    this.GetElementBindHandle = function () {
      var Result = null;
      Result = this.FInputElement;
      return Result;
    };
    this.GetElementInputHandle = function () {
      var Result = null;
      Result = this.FInputElement;
      return Result;
    };
    this.UpdateElementVisual = function () {
      pas["WEBLib.StdCtrls"].TCustomInput.UpdateElementVisual.call(this);
      if (this.FSearchElement != null) {
        if (this.FSearchImageURL !== "") {
          this.FSearchElement.setAttribute("src",this.FSearchImageURL)}
         else this.FSearchElement.setAttribute("src",$impl.btnsearchres);
      };
      if (this.FClearElement != null) {
        if (this.FClearImageURL !== "") {
          this.FClearElement.setAttribute("src",this.FClearImageURL)}
         else this.FClearElement.setAttribute("src",$impl.btnclearres);
      };
    };
    this.CreateChildElements = function (AContainer) {
      var FTable = null;
      var FRow = null;
      var FCell = null;
      pas["WEBLib.Controls"].TControl.CreateChildElements.apply(this,arguments);
      this.FSearchElement = document.createElement("IMG");
      this.FClearElement = document.createElement("IMG");
      this.FInputElement = document.createElement("INPUT");
      FTable = document.createElement("TABLE");
      FTable.style.setProperty("height","100%");
      FRow = document.createElement("TR");
      AContainer.appendChild(FTable);
      FTable.appendChild(FRow);
      FCell = document.createElement("TD");
      FRow.appendChild(FCell);
      FCell.appendChild(this.FSearchElement);
      FCell = document.createElement("TD");
      FRow.appendChild(FCell);
      FCell.appendChild(this.FInputElement);
      FCell = document.createElement("TD");
      FRow.appendChild(FCell);
      FCell.appendChild(this.FClearElement);
      this.FSearchElement.setAttribute("src",$impl.btnsearchres);
      this.FClearElement.setAttribute("src",$impl.btnclearres);
    };
    this.BindEvents = function () {
      pas["WEBLib.StdCtrls"].TCustomEdit.BindEvents.call(this);
      if (this.FClearElement != null) this.FClearElement.addEventListener("click",this.FClearPtr);
      if (this.FSearchElement != null) this.FSearchElement.addEventListener("click",this.FSearchPtr);
    };
    this.HandleDoClear = function (Event) {
      var Result = false;
      if (this.FOnClearClick != null) this.FOnClearClick(this);
      this.FInputElement.value = '';
      this.FInputElement.focus();
      Result = true;
      return Result;
    };
    this.HandleDoSearch = function (Event) {
      var Result = false;
      if (this.FOnSearchClick != null) this.FOnSearchClick(this);
      Result = true;
      return Result;
    };
    this.CreateElement = function () {
      var Result = null;
      Result = document.createElement("DIV");
      return Result;
    };
    this.UpdateElement = function () {
      pas["WEBLib.Controls"].TControl.UpdateElement.call(this);
      if ((this.GetElementHandle() != null) && (this.GetElementHandle() !== this.ContainerElement()) && !this.IsUpdating()) {
        if ((this.FElementClassName === "") && (this.FBorderStyle === pas["WEBLib.Controls"].TBorderStyle.bsSingle)) {
          this.GetElementHandle().style.setProperty("border","1px solid gray");
          this.GetElementHandle().style.setProperty("border-radius","4px");
        };
        this.FInputElement.style.setProperty("border","none");
        this.FInputElement.style.setProperty("outline","none");
        this.FInputElement.parentElement.style.setProperty("vertical-align","middle");
        this.FInputElement.parentElement.style.setProperty("width","100%");
        this.FSearchElement.parentElement.style.setProperty("vertical-align","middle");
        this.FClearElement.parentElement.style.setProperty("vertical-align","middle");
        if (this.FElementPosition === pas["WEBLib.Controls"].TElementPosition.epAbsolute) {
          this.FInputElement.style.setProperty("width","100%")}
         else this.FInputElement.style.removeProperty("width");
      };
    };
    this.SetEnabled = function (Value) {
      pas["WEBLib.Controls"].TControl.SetEnabled.apply(this,arguments);
      if (this.GetElementInputHandle() != null) {
        if (Value) {
          this.GetElementInputHandle().removeAttribute("disabled")}
         else this.GetElementInputHandle().setAttribute("disabled","");
      };
    };
    this.ClearMethodPointers = function () {
      pas["WEBLib.StdCtrls"].TCustomEdit.ClearMethodPointers.call(this);
      this.FClearPtr = null;
      this.FSearchPtr = null;
    };
    this.GetMethodPointers = function () {
      pas["WEBLib.StdCtrls"].TCustomEdit.GetMethodPointers.call(this);
      if (this.FClearPtr === null) this.FClearPtr = rtl.createCallback(this,"HandleDoClear");
      if (this.FSearchPtr === null) this.FSearchPtr = rtl.createCallback(this,"HandleDoSearch");
    };
    this.SetFocus = function () {
      var eh = null;
      if (this.GetElementInputHandle() != null) {
        eh = this.GetElementInputHandle();
        eh.focus();
      };
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Alignment",2,pas.Classes.$rtti["TAlignment"],"FAlignment","SetAlignment");
    $r.addProperty("AutoCompletion",2,pas["WEBLib.StdCtrls"].$rtti["TAutoCompletion"],"FAutoCompletion","SetAutoCompletion",4,{Default: pas["WEBLib.StdCtrls"].TAutoCompletion.acOff});
    $r.addProperty("AutoSelect",2,rtl.boolean,"FAutoSelect","SetAutoSelect",4,{Default: true});
    $r.addProperty("AutoFocus",2,rtl.boolean,"FAutoFocus","SetAutoFocus",4,{Default: false});
    $r.addProperty("AutoSize",2,rtl.boolean,"FAutoSize","SetAutoSize",4,{Default: false});
    $r.addProperty("BorderStyle",2,pas["WEBLib.Controls"].$rtti["TBorderStyle"],"FBorderStyle","SetBorderStyle",4,{Default: pas["WEBLib.Controls"].TBorderStyle.bsSingle});
    $r.addProperty("CharCase",2,pas["WEBLib.StdCtrls"].$rtti["TEditCharCase"],"FCharCase","SetCharCase",4,{Default: pas["WEBLib.StdCtrls"].TEditCharCase.wecNormal});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor");
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("HideSelection",2,rtl.boolean,"FHideSelection","SetHideSelection");
    $r.addProperty("MaxLength",2,rtl.longint,"FMaxLength","SetMaxLength",4,{Default: 0});
    $r.addProperty("PasswordChar",2,rtl.char,"FPasswordChar","SetPasswordChar",4,{Default: "\x00"});
    $r.addProperty("Pattern",2,rtl.string,"FPattern","SetPattern");
    $r.addProperty("ReadOnly",2,rtl.boolean,"FReadOnly","SetReadOnly",4,{Default: false});
    $r.addProperty("Required",2,rtl.boolean,"FRequired","SetRequired",4,{Default: false});
    $r.addProperty("RequiredText",0,rtl.string,"FRequiredText","FRequiredText");
    $r.addProperty("TextHint",2,rtl.string,"FTextHint","SetTextHint");
    $r.addMethod("SetFocus",0,[],4);
    $r.addProperty("Text",3,rtl.string,"GetText","SetText");
    $r.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChange","FOnChange");
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnKeyDown",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyDown","FOnKeyDown");
    $r.addProperty("OnKeyPress",0,pas["WEBLib.Controls"].$rtti["TKeyPressEvent"],"FOnKeyPress","FOnKeyPress");
    $r.addProperty("OnKeyUp",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyUp","FOnKeyUp");
    $r.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseDown","FOnMouseDown");
    $r.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseUp","FOnMouseUp");
    $r.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti["TMouseMoveEvent"],"FOnMouseMove","FOnMouseMove");
    $r.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseLeave","FOnMouseLeave");
    $r.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseEnter","FOnMouseEnter");
    $r.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnEnter","FOnEnter");
    $r.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnExit","FOnExit");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
    $r.addProperty("OnClearClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClearClick","FOnClearClick");
    $r.addProperty("OnSearchClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnSearchClick","FOnSearchClick");
  });
  rtl.createClass(this,"TWebSearchEdit",this.TSearchEdit,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Alignment",2,pas.Classes.$rtti["TAlignment"],"FAlignment","SetAlignment");
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("AutoCompletion",2,pas["WEBLib.StdCtrls"].$rtti["TAutoCompletion"],"FAutoCompletion","SetAutoCompletion",4,{Default: pas["WEBLib.StdCtrls"].TAutoCompletion.acOff});
    $r.addProperty("AutoFocus",2,rtl.boolean,"FAutoFocus","SetAutoFocus",4,{Default: false});
    $r.addProperty("AutoSize",2,rtl.boolean,"FAutoSize","SetAutoSize",4,{Default: false});
    $r.addProperty("AutoSelect",2,rtl.boolean,"FAutoSelect","SetAutoSelect",4,{Default: true});
    $r.addProperty("BiDiMode",2,pas["WEBLib.Controls"].$rtti["TBiDiMode"],"FBiDiMode","SetBiDiMode",4,{Default: pas["WEBLib.Controls"].TBiDiMode.bdLeftToRight});
    $r.addProperty("BorderStyle",2,pas["WEBLib.Controls"].$rtti["TBorderStyle"],"FBorderStyle","SetBorderStyle",4,{Default: pas["WEBLib.Controls"].TBorderStyle.bsSingle});
    $r.addProperty("CharCase",2,pas["WEBLib.StdCtrls"].$rtti["TEditCharCase"],"FCharCase","SetCharCase",4,{Default: pas["WEBLib.StdCtrls"].TEditCharCase.wecNormal});
    $r.addProperty("ChildOrder",2,rtl.longint,"FChildOrder","SetChildOrderEx",4,{Default: 0});
    $r.addProperty("ClearImageURL",2,rtl.string,"FClearImageURL","SetClearImageURL");
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor");
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("EditType",2,pas["WEBLib.StdCtrls"].$rtti["TEditType"],"FEditType","SetEditType",4,{Default: pas["WEBLib.StdCtrls"].TEditType.weString});
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Hint",2,rtl.string,"FHint","SetHint");
    $r.addProperty("HideSelection",2,rtl.boolean,"FHideSelection","SetHideSelection");
    $r.addProperty("Left",3,rtl.longint,"GetLeft","SetLeft");
    $r.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",4,{Default: true});
    $r.addProperty("PasswordChar",2,rtl.char,"FPasswordChar","SetPasswordChar",4,{Default: "\x00"});
    $r.addProperty("Pattern",2,rtl.string,"FPattern","SetPattern");
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("MaxLength",2,rtl.longint,"FMaxLength","SetMaxLength",4,{Default: 0});
    $r.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti["TPopupMenu"],"FPopupMenu","FPopupMenu");
    $r.addProperty("ReadOnly",2,rtl.boolean,"FReadOnly","SetReadOnly",4,{Default: false});
    $r.addProperty("Required",2,rtl.boolean,"FRequired","SetRequired",4,{Default: false});
    $r.addProperty("SearchImageURL",2,rtl.string,"FSearchImageURL","SetSearchImageURL");
    $r.addProperty("ShowFocus",2,rtl.boolean,"FShowFocus","SetShowFocus",4,{Default: false});
    $r.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",4,{Default: false});
    $r.addProperty("SpellCheck",2,rtl.boolean,"FSpellCheck","SetSpellCheck",4,{Default: true});
    $r.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder");
    $r.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",4,{Default: true});
    $r.addProperty("Text",3,rtl.string,"GetText","SetText");
    $r.addProperty("TextDirection",0,pas["WEBLib.Controls"].$rtti["TTextDirection"],"FTextDirection","FTextDirection",4,{Default: pas["WEBLib.Controls"].TTextDirection.tdDefault});
    $r.addProperty("TextHint",2,rtl.string,"FTextHint","SetTextHint");
    $r.addProperty("Top",3,rtl.longint,"GetTop","SetTop");
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChange","FOnChange");
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnKeyDown",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyDown","FOnKeyDown");
    $r.addProperty("OnKeyPress",0,pas["WEBLib.Controls"].$rtti["TKeyPressEvent"],"FOnKeyPress","FOnKeyPress");
    $r.addProperty("OnKeyUp",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyUp","FOnKeyUp");
    $r.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseDown","FOnMouseDown");
    $r.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseUp","FOnMouseUp");
    $r.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti["TMouseMoveEvent"],"FOnMouseMove","FOnMouseMove");
    $r.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseLeave","FOnMouseLeave");
    $r.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseEnter","FOnMouseEnter");
    $r.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnEnter","FOnEnter");
    $r.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnExit","FOnExit");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
    $r.addProperty("OnClearClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClearClick","FOnClearClick");
    $r.addProperty("OnSearchClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnSearchClick","FOnSearchClick");
  });
  rtl.createClass(this,"TEditButton",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FMaterialGlyph = "";
      this.FWidth = 0;
      this.FMaterialGlyphColor = 0;
      this.FCaption = "";
      this.FMaterialGlyphType = 0;
      this.FMaterialGlyphSize = 0;
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetMaterialGlyph = function (Value) {
      this.FMaterialGlyph = Value;
      this.Changed();
    };
    this.SetMaterialGlyphSize = function (Value) {
      this.FMaterialGlyphSize = Value;
      this.Changed();
    };
    this.SetMaterialGlyphType = function (Value) {
      this.FMaterialGlyphType = Value;
      this.Changed();
    };
    this.SetMaterialGyphColor = function (Value) {
      this.FMaterialGlyphColor = Value;
      this.Changed();
    };
    this.SetCaption = function (Value) {
      this.FCaption = Value;
      this.Changed();
    };
    this.SetWidth = function (Value) {
      this.FWidth = Value;
      this.Changed();
    };
    this.Changed = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FWidth = 24;
      this.FCaption = "";
      this.FMaterialGlyphColor = -1;
      this.FMaterialGlyphSize = 18;
      this.FMaterialGlyphType = pas["WEBLib.Controls"].TMaterialGlyphType.mgNormal;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TEditButton.isPrototypeOf(Source)) {
        this.FWidth = rtl.as(Source,$mod.TEditButton).FWidth;
        this.FMaterialGlyph = rtl.as(Source,$mod.TEditButton).FMaterialGlyph;
        this.FMaterialGlyphSize = rtl.as(Source,$mod.TEditButton).FMaterialGlyphSize;
        this.FMaterialGlyphColor = rtl.as(Source,$mod.TEditButton).FMaterialGlyphColor;
        this.FCaption = rtl.as(Source,$mod.TEditButton).FCaption;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Caption",2,rtl.string,"FCaption","SetCaption");
    $r.addProperty("MaterialGlyph",2,rtl.string,"FMaterialGlyph","SetMaterialGlyph");
    $r.addProperty("MaterialGlyphColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FMaterialGlyphColor","SetMaterialGyphColor",4,{Default: -1});
    $r.addProperty("MaterialGlyphSize",2,rtl.longint,"FMaterialGlyphSize","SetMaterialGlyphSize",4,{Default: 18});
    $r.addProperty("MaterialGlyphType",2,pas["WEBLib.Controls"].$rtti["TMaterialGlyphType"],"FMaterialGlyphType","SetMaterialGlyphType",4,{Default: pas["WEBLib.Controls"].TMaterialGlyphType.mgNormal});
    $r.addProperty("Width",2,rtl.longint,"FWidth","SetWidth",4,{Default: 24});
  });
  rtl.createClass(this,"TEditBtn",pas["WEBLib.StdCtrls"].TCustomEdit,function () {
    this.$init = function () {
      pas["WEBLib.StdCtrls"].TCustomEdit.$init.call(this);
      this.FBtnElement = null;
      this.FInputElement = null;
      this.FBtnClickPtr = null;
      this.FOnBtnClick = null;
      this.FButton = null;
      this.FElementInputClassName = "";
      this.FElementButtonClassName = "";
    };
    this.$final = function () {
      this.FBtnElement = undefined;
      this.FInputElement = undefined;
      this.FOnBtnClick = undefined;
      this.FButton = undefined;
      pas["WEBLib.StdCtrls"].TCustomEdit.$final.call(this);
    };
    this.SetButton = function (Value) {
      this.FButton.Assign(Value);
    };
    this.SetElementInputClassName = function (Value) {
      if (this.FElementInputClassName !== Value) {
        this.FElementInputClassName = Value;
        this.UpdateElement();
      };
    };
    this.SetElementButtonClassName = function (Value) {
      if (this.FElementButtonClassName !== Value) {
        this.FElementButtonClassName = Value;
        this.UpdateElement();
      };
    };
    this.HandleDoBtnClick = function (Event) {
      var Result = false;
      if (this.FOnBtnClick != null) this.FOnBtnClick(this);
      Result = true;
      return Result;
    };
    this.GetElementBindHandle = function () {
      var Result = null;
      Result = this.FInputElement;
      return Result;
    };
    this.GetElementInputHandle = function () {
      var Result = null;
      Result = this.FInputElement;
      return Result;
    };
    this.CreateElement = function () {
      var Result = null;
      var FTable = null;
      var FRow = null;
      var FCell1 = null;
      var FCell2 = null;
      Result = document.createElement("DIV");
      this.FBtnElement = document.createElement("BUTTON");
      this.FInputElement = document.createElement("INPUT");
      FTable = document.createElement("TABLE");
      FRow = document.createElement("TR");
      Result.appendChild(FTable);
      FTable.appendChild(FRow);
      FCell1 = document.createElement("TD");
      FRow.appendChild(FCell1);
      FCell1.appendChild(this.FInputElement);
      FCell2 = document.createElement("TD");
      FRow.appendChild(FCell2);
      FCell2.appendChild(this.FBtnElement);
      this.FBtnElement.innerHTML = "&nbsp;";
      FTable.style.setProperty("border","none");
      FTable.style.setProperty("border-collapse","collapse");
      FTable.style.setProperty("height","100%");
      return Result;
    };
    this.UpdateElement = function () {
      var h = 0;
      pas["WEBLib.Controls"].TControl.UpdateElement.call(this);
      if ((this.GetElementHandle() != null) && (this.GetElementHandle() !== this.ContainerElement()) && !this.IsUpdating()) {
        this.FInputElement.style.setProperty("outline","none");
        this.FInputElement.style.setProperty("box-sizing","unset");
        if (this.FElementPosition === pas["WEBLib.Controls"].TElementPosition.epAbsolute) {
          this.FInputElement.style.setProperty("width","100%")}
         else this.FInputElement.style.removeProperty("width");
        h = this.GetHeight() - 6 - 4;
        this.FInputElement.style.setProperty("height",pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
            return h;
          }, set: function (v) {
            h = v;
          }}) + "px");
        if (this.FElementInputClassName !== "") {
          this.FInputElement.setAttribute("class",this.FElementInputClassName)}
         else this.FInputElement.removeAttribute("class");
        if (this.FElementButtonClassName !== "") {
          this.FBtnElement.setAttribute("class",this.FElementButtonClassName)}
         else this.FBtnElement.removeAttribute("class");
        h = this.GetHeight() - 4;
        this.FBtnElement.style.setProperty("width",pas["WEBLib.Utils"].TLongIntHelper.ToString.call({p: this.FButton, get: function () {
            return this.p.FWidth;
          }, set: function (v) {
            this.p.FWidth = v;
          }}) + "px");
        this.FBtnElement.style.setProperty("padding","0");
        this.FBtnElement.style.setProperty("height",pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
            return h;
          }, set: function (v) {
            h = v;
          }}) + "px");
        pas["WEBLib.Controls"].SetHTMLElementFont(this.FInputElement,this.FFont,this.FElementFont === pas["WEBLib.Controls"].TElementFont.efCSS);
        if (this.FButton.FCaption !== "") this.FBtnElement.innerHTML = this.FButton.FCaption;
        if (this.FButton.FMaterialGlyph !== "") {
          this.FBtnElement.innerHTML = pas["WEBLib.WebTools"].GetMaterialGlyph(this.FButton.FMaterialGlyph,this.FButton.FMaterialGlyphSize,this.FButton.FMaterialGlyphColor,this.FButton.FMaterialGlyphType);
        };
        this.GetElementHandle().style.setProperty("border","none");
      };
    };
    this.ClearMethodPointers = function () {
      pas["WEBLib.StdCtrls"].TCustomEdit.ClearMethodPointers.call(this);
      this.FBtnClickPtr = null;
    };
    this.GetMethodPointers = function () {
      pas["WEBLib.StdCtrls"].TCustomEdit.GetMethodPointers.call(this);
      if (this.FBtnClickPtr === null) this.FBtnClickPtr = rtl.createCallback(this,"HandleDoBtnClick");
    };
    this.BindEvents = function () {
      pas["WEBLib.StdCtrls"].TCustomEdit.BindEvents.call(this);
      if (this.FBtnElement != null) this.FBtnElement.addEventListener("click",this.FBtnClickPtr);
    };
    this.ButtonChanged = function (Sender) {
      this.UpdateElement();
    };
    this.InitCSSLibrary = function (ALibrary) {
      if (ALibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap) {
        this.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
        this.SetElementClassName("");
        this.SetElementInputClassName("form-control");
        this.SetElementButtonClassName("btn btn-primary");
        this.SetHeightStyle(pas["WEBLib.Controls"].TSizeStyle.ssAuto);
      };
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.Controls"].TControl.Create$1.apply(this,arguments);
      this.FButton = $mod.TEditButton.$create("Create$1");
      this.FButton.FOnChange = rtl.createCallback(this,"ButtonChanged");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FButton");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TWebEditBtn",this.TEditBtn,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Alignment",2,pas.Classes.$rtti["TAlignment"],"FAlignment","SetAlignment");
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("AutoCompletion",2,pas["WEBLib.StdCtrls"].$rtti["TAutoCompletion"],"FAutoCompletion","SetAutoCompletion",4,{Default: pas["WEBLib.StdCtrls"].TAutoCompletion.acOff});
    $r.addProperty("AutoFocus",2,rtl.boolean,"FAutoFocus","SetAutoFocus",4,{Default: false});
    $r.addProperty("AutoSize",2,rtl.boolean,"FAutoSize","SetAutoSize",4,{Default: false});
    $r.addProperty("AutoSelect",2,rtl.boolean,"FAutoSelect","SetAutoSelect",4,{Default: true});
    $r.addProperty("BiDiMode",2,pas["WEBLib.Controls"].$rtti["TBiDiMode"],"FBiDiMode","SetBiDiMode",4,{Default: pas["WEBLib.Controls"].TBiDiMode.bdLeftToRight});
    $r.addProperty("BorderStyle",2,pas["WEBLib.Controls"].$rtti["TBorderStyle"],"FBorderStyle","SetBorderStyle",4,{Default: pas["WEBLib.Controls"].TBorderStyle.bsSingle});
    $r.addProperty("Button",2,$mod.$rtti["TEditButton"],"FButton","SetButton");
    $r.addProperty("CharCase",2,pas["WEBLib.StdCtrls"].$rtti["TEditCharCase"],"FCharCase","SetCharCase",4,{Default: pas["WEBLib.StdCtrls"].TEditCharCase.wecNormal});
    $r.addProperty("ChildOrder",2,rtl.longint,"FChildOrder","SetChildOrderEx",4,{Default: 0});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor");
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("EditType",2,pas["WEBLib.StdCtrls"].$rtti["TEditType"],"FEditType","SetEditType",4,{Default: pas["WEBLib.StdCtrls"].TEditType.weString});
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Hint",2,rtl.string,"FHint","SetHint");
    $r.addProperty("HideSelection",2,rtl.boolean,"FHideSelection","SetHideSelection");
    $r.addProperty("Left",3,rtl.longint,"GetLeft","SetLeft");
    $r.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",4,{Default: true});
    $r.addProperty("PasswordChar",2,rtl.char,"FPasswordChar","SetPasswordChar",4,{Default: "\x00"});
    $r.addProperty("Pattern",2,rtl.string,"FPattern","SetPattern");
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("MaxLength",2,rtl.longint,"FMaxLength","SetMaxLength",4,{Default: 0});
    $r.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti["TPopupMenu"],"FPopupMenu","FPopupMenu");
    $r.addProperty("ReadOnly",2,rtl.boolean,"FReadOnly","SetReadOnly",4,{Default: false});
    $r.addProperty("Required",2,rtl.boolean,"FRequired","SetRequired",4,{Default: false});
    $r.addProperty("RequiredText",0,rtl.string,"FRequiredText","FRequiredText");
    $r.addProperty("ShowFocus",2,rtl.boolean,"FShowFocus","SetShowFocus",4,{Default: false});
    $r.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",4,{Default: false});
    $r.addProperty("SpellCheck",2,rtl.boolean,"FSpellCheck","SetSpellCheck",4,{Default: true});
    $r.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder");
    $r.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",4,{Default: true});
    $r.addProperty("Text",3,rtl.string,"GetText","SetText");
    $r.addProperty("TextDirection",0,pas["WEBLib.Controls"].$rtti["TTextDirection"],"FTextDirection","FTextDirection",4,{Default: pas["WEBLib.Controls"].TTextDirection.tdDefault});
    $r.addProperty("TextHint",2,rtl.string,"FTextHint","SetTextHint");
    $r.addProperty("Top",3,rtl.longint,"GetTop","SetTop");
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChange","FOnChange");
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnKeyDown",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyDown","FOnKeyDown");
    $r.addProperty("OnKeyPress",0,pas["WEBLib.Controls"].$rtti["TKeyPressEvent"],"FOnKeyPress","FOnKeyPress");
    $r.addProperty("OnKeyUp",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyUp","FOnKeyUp");
    $r.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseDown","FOnMouseDown");
    $r.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseUp","FOnMouseUp");
    $r.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti["TMouseMoveEvent"],"FOnMouseMove","FOnMouseMove");
    $r.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseLeave","FOnMouseLeave");
    $r.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseEnter","FOnMouseEnter");
    $r.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnEnter","FOnEnter");
    $r.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnExit","FOnExit");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
    $r.addProperty("OnBtnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnBtnClick","FOnBtnClick");
  });
  $mod.$implcode = function () {
    $impl.btnclearres = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA70lEQVQ4jbWSzQ2CQBCFl5OROgSKgAMmHExUDia2QUSswqg9GK1COfnTjCbagm/Cw2wQFw46yZcM+5jZ+Vml/mQ2iMEcpPTt" + "NoEWyMAdHMCaiH9jMssUvAcn0KvRHXAGu29JMgZ3DBWKdgGzqmCz7PLmAfA1PQAT+q4q2unqCcaq6LM0nz/1QcjkoabnYKgnWIBlpSq59QGeIKpoK1Vs6G0ZD9smkM2kphYClh21bUGGKD07/I4rATKTKX1P1QxRsSTZc9MaryCpE+VxyCORPbs1usfgrWp4jS" + "lLPIINyXmWmIJ1k/5GTJbS/+j5J/YC/YEx2smgMEoAAAAASUVORK5CYII=";
    $impl.btnsearchres = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAABNUlEQVQ4jZWSPU7DQBCFU5ECiEBU/AgEcmXJtvxbuAo0pOAE1CAaAigViFNBOAMRFengBNCCwgH4XrQrBXntkJGePLsz782" + "Pt9WqMc/z2mma9sEITAzk9xWr400tiqJtEsdJkjzwPfR9f0WQD4bcvyqnqfIY3OpcFMU+hHMIazaH2L1EnJ0QvFJl45/iX8dxvOXIG4LLigCEFwLdLMsO8G/qxiR2pJ24OpiYeS/AZp1AWZarynUJfElgdmaXsZsOXXy7BPSruk3keSMM7BKbjLynyhLZ9h6X" + "bwIidw3k6W9k1KUKmW8vz/MNEt45P+rxhGG4LMw+JHaw4ySbc890MgDPWiz4sU/5T2Uudk3LJ2Y5x6quFzhvD1ZgZMm2sjr6F9kIfARBsC6RhclG4AzypzpZmIz9Aj6Qcv0OcR9YAAAAAElFTkSuQmCC";
    $impl.emptyimgres = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=";
  };
},["WEBLib.Utils","Math"]);
rtl.module("WEBLib.Toast",["System","Web","Classes","SysUtils","WEBLib.Controls","WEBLib.ExtCtrls"],function () {
  "use strict";
  var $mod = this;
  this.$rtti.$Class("TToast");
  this.TToastPosition = {"0": "tpTopLeft", tpTopLeft: 0, "1": "tpTopRight", tpTopRight: 1, "2": "tpBottomLeft", tpBottomLeft: 2, "3": "tpBottomRight", tpBottomRight: 3, "4": "tpAbsolute", tpAbsolute: 4, "5": "tpContainer", tpContainer: 5};
  this.$rtti.$Enum("TToastPosition",{minvalue: 0, maxvalue: 5, ordtype: 1, enumtype: this.TToastPosition});
  this.TToastTime = {"0": "ttNone", ttNone: 0, "1": "ttShow", ttShow: 1, "2": "ttDeltaShow", ttDeltaShow: 2};
  this.$rtti.$Enum("TToastTime",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TToastTime});
  rtl.createClass(this,"TToastItem",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FBody = "";
      this.FHeader = "";
      this.FCloseButton = false;
      this.FElementHandle = null;
      this.FElementTime = null;
      this.FAutoHide = false;
      this.FTime = 0;
      this.FDispTime = 0.0;
      this.FVisible = false;
      this.FID$1 = 0;
      this.FTag = 0;
      this.FAutoDelete = false;
    };
    this.$final = function () {
      this.FElementHandle = undefined;
      this.FElementTime = undefined;
      pas.Classes.TCollectionItem.$final.call(this);
    };
    this.SetVisible = function (Value) {
      if (this.FVisible !== Value) {
        this.FVisible = Value;
        if (this.FVisible) {
          this.Show()}
         else this.Hide();
      };
    };
    this.ToastID = function () {
      var Result = "";
      Result = this.FCollection.Owner().FName + pas.SysUtils.IntToStr(this.FID$1);
      return Result;
    };
    this.UpdateToast = function (el) {
      var hdr = null;
      var bdy = null;
      var btn = null;
      var cap = null;
      el.classList.add("toast");
      if (this.FAutoHide) {
        el.setAttribute("data-bs-autohide","true");
        el.setAttribute("data-bs-delay",pas.SysUtils.IntToStr(this.Toast().FAutoHideDelay));
      } else el.setAttribute("data-bs-autohide","false");
      el.setAttribute("data-bs-animation","true");
      el.setAttribute("role","alert");
      el.setAttribute("id",this.ToastID());
      el.style.setProperty("min-width","300px");
      hdr = document.createElement("DIV");
      hdr.setAttribute("class","toast-header");
      cap = document.createElement("STRONG");
      if (rtl.as(this.FCollection.Owner(),$mod.TToast).FLevel === $mod.TLibraryLevel.llv4) {
        cap.setAttribute("class","mr-auto")}
       else cap.setAttribute("class","me-auto");
      cap.innerHTML = this.FHeader;
      hdr.appendChild(cap);
      if (this.FTime !== $mod.TToastTime.ttNone) {
        this.FElementTime = document.createElement("SMALL");
        if (this.FTime === $mod.TToastTime.ttShow) this.FElementTime.innerHTML = pas.SysUtils.TimeToStr(pas.SysUtils.Now());
        hdr.appendChild(this.FElementTime);
      };
      if (this.FCloseButton) {
        btn = document.createElement("BUTTON");
        btn.setAttribute("type","button");
        if (rtl.as(this.FCollection.Owner(),$mod.TToast).FLevel === $mod.TLibraryLevel.llv4) {
          btn.setAttribute("class","ml-2 mb-1 close");
          btn.setAttribute("data-bs-dismiss","toast");
        } else {
          btn.setAttribute("class","btn-close");
          btn.setAttribute("data-bs-dismiss","toast");
        };
        btn.setAttribute("data-id",this.ToastID());
        if (rtl.as(this.FCollection.Owner(),$mod.TToast).FLevel === $mod.TLibraryLevel.llv4) btn.innerHTML = "&times;";
        btn.addEventListener("click",this.Toast().FClosePtr);
        hdr.appendChild(btn);
      };
      bdy = document.createElement("DIV");
      bdy.setAttribute("class","toast-body");
      bdy.innerHTML = this.FBody;
      el.appendChild(hdr);
      el.appendChild(bdy);
    };
    this.Create$1 = function (ACollection) {
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      rtl.as(ACollection,$mod.TToastCollection).FUniqueID = rtl.as(ACollection,$mod.TToastCollection).FUniqueID + 1;
      this.FElementHandle = null;
      this.FTime = $mod.TToastTime.ttNone;
      this.FCloseButton = true;
      this.FID$1 = rtl.as(ACollection,$mod.TToastCollection).FUniqueID;
      return this;
    };
    this.Destroy = function () {
      pas.Classes.TCollectionItem.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TToastItem.isPrototypeOf(Source)) {
        this.FBody = rtl.as(Source,$mod.TToastItem).FBody;
        this.FHeader = rtl.as(Source,$mod.TToastItem).FHeader;
        this.FCloseButton = rtl.as(Source,$mod.TToastItem).FCloseButton;
        this.FAutoHide = rtl.as(Source,$mod.TToastItem).FAutoHide;
        this.FTime = rtl.as(Source,$mod.TToastItem).FTime;
        this.FTag = rtl.as(Source,$mod.TToastItem).FTag;
      };
    };
    this.Show = function () {
      var id = "";
      var el = null;
      var FHidePtr = null;
      this.Toast().UpdatePosition();
      this.Update();
      if (!(this.FElementHandle != null)) this.FElementHandle = this.CreateToast();
      id = this.ToastID();
      el = this.Toast().FToastContainer;
      if ((this.Toast().FPosition === $mod.TToastPosition.tpContainer) && (this.Toast().FContainer !== "")) {
        el = document.getElementById(this.Toast().FContainer);
        if (!(el != null)) el = this.Toast().FToastContainer;
      };
      if (this.Toast().FOnShow != null) {
        this.Toast().FOnShow(this.Toast(),this.GetIndex(),this.FElementHandle);
      };
      el.appendChild(this.FElementHandle);
      if (id !== "") {
        FHidePtr = this.Toast().FAutoHidePtr;
        var tst = document.getElementById(id);  //select id of toast
        
              tst.addEventListener('hidden.bs.toast', FHidePtr);
        
              var msg = new bootstrap.Toast(tst);  //inizialize it
              msg.show();  //show it;
      };
      this.FDispTime = pas.SysUtils.Now();
      this.FVisible = true;
    };
    this.Hide = function () {
      var id = "";
      if (this.FElementHandle != null) {
        id = this.ToastID();
        var tst = document.getElementById(id); //select id of toast
        var msg = new bootstrap.Toast(tst); //inizialize it
        msg.hide(); //show it;
        this.FVisible = false;
      };
    };
    this.CreateToast = function () {
      var Result = null;
      var el = null;
      el = document.createElement("DIV");
      this.UpdateToast(el);
      Result = el;
      return Result;
    };
    this.Update = function () {
      if (this.FElementHandle != null) {
        this.DeleteHTML();
        this.UpdateToast(this.FElementHandle);
      } else this.FElementHandle = this.CreateToast();
    };
    this.DeleteHTML = function () {
      if (this.FElementHandle != null) {
        while (this.FElementHandle.firstChild != null) this.FElementHandle.removeChild(this.FElementHandle.firstChild);
      };
    };
    this.Toast = function () {
      var Result = null;
      Result = this.FCollection.Owner();
      return Result;
    };
    var $r = this.$rtti;
    $r.addProperty("AutoDelete",0,rtl.boolean,"FAutoDelete","FAutoDelete",4,{Default: false});
    $r.addProperty("AutoHide",0,rtl.boolean,"FAutoHide","FAutoHide",4,{Default: false});
    $r.addProperty("Body",0,rtl.string,"FBody","FBody");
    $r.addProperty("CloseButton",0,rtl.boolean,"FCloseButton","FCloseButton",4,{Default: true});
    $r.addProperty("Tag",0,rtl.longint,"FTag","FTag",4,{Default: 0});
    $r.addProperty("Time",0,$mod.$rtti["TToastTime"],"FTime","FTime");
    $r.addProperty("Header",0,rtl.string,"FHeader","FHeader");
  });
  rtl.createClass(this,"TToastCollection",pas.Classes.TOwnedCollection,function () {
    this.$init = function () {
      pas.Classes.TOwnedCollection.$init.call(this);
      this.FUniqueID = 0;
    };
    this.GetItem$1 = function (AIndex) {
      var Result = null;
      Result = this.GetItem(AIndex);
      return Result;
    };
    this.SetItem$1 = function (AIndex, Value) {
      this.SetItem(AIndex,Value);
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,$mod.TToastItem);
      this.FUniqueID = 0;
      return this;
    };
    this.Add$1 = function (AHeader, ABody) {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      Result.FHeader = AHeader;
      Result.FBody = ABody;
      return Result;
    };
    this.Add$2 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      return Result;
    };
  });
  this.$rtti.$MethodVar("TToastHideEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AIndex",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TToastShowEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AIndex",rtl.longint],["AElement",pas.Web.$rtti["TJSHTMLElement"]]]), methodkind: 0});
  this.TLibraryLevel = {"0": "llv4", llv4: 0, "1": "llv5", llv5: 1};
  this.$rtti.$Enum("TLibraryLevel",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TLibraryLevel});
  rtl.createClass(this,"TToast",pas.Classes.TComponent,function () {
    this.$init = function () {
      pas.Classes.TComponent.$init.call(this);
      this.FToastContainer = null;
      this.FItems = null;
      this.FPosition = 0;
      this.FTimer = null;
      this.FAutoHideDelay = 0;
      this.FContainer = "";
      this.FX = 0;
      this.FY = 0;
      this.FClosePtr = null;
      this.FOnHide = null;
      this.FLevel = 0;
      this.FOnShow = null;
      this.FAutoHidePtr = null;
    };
    this.$final = function () {
      this.FToastContainer = undefined;
      this.FItems = undefined;
      this.FTimer = undefined;
      this.FOnHide = undefined;
      this.FOnShow = undefined;
      pas.Classes.TComponent.$final.call(this);
    };
    this.SetX = function (Value) {
      this.FX = Value;
    };
    this.SetY = function (Value) {
      this.FY = Value;
    };
    this.SetItems = function (Value) {
      this.FItems.Assign(Value);
    };
    this.UpdatePosition = function () {
      var el = null;
      this.EnsureToastArea();
      el = this.FToastContainer;
      var $tmp = this.FPosition;
      if ($tmp === $mod.TToastPosition.tpTopLeft) {
        el.style.setProperty("top","0");
        el.style.setProperty("left","0");
        el.style.removeProperty("right");
        el.style.removeProperty("bottom");
      } else if ($tmp === $mod.TToastPosition.tpTopRight) {
        el.style.setProperty("top","0");
        el.style.removeProperty("left");
        el.style.setProperty("right","0");
        el.style.removeProperty("bottom");
      } else if ($tmp === $mod.TToastPosition.tpBottomLeft) {
        el.style.removeProperty("top");
        el.style.setProperty("left","0");
        el.style.removeProperty("right");
        el.style.setProperty("bottom","0");
      } else if ($tmp === $mod.TToastPosition.tpBottomRight) {
        el.style.removeProperty("top");
        el.style.removeProperty("left");
        el.style.setProperty("right","0");
        el.style.setProperty("bottom","0");
      } else if ($tmp === $mod.TToastPosition.tpAbsolute) {
        el.style.setProperty("top",pas.SysUtils.IntToStr(this.FY) + "px");
        el.style.setProperty("left",pas.SysUtils.IntToStr(this.FX) + "px");
        el.style.removeProperty("right");
        el.style.removeProperty("bottom");
      };
      el.style.setProperty("position","absolute");
      el.style.setProperty("z-index",pas.SysUtils.TIntegerHelper.ToString$1.call({a: pas["WEBLib.Forms"].Application.FMaxZIndex + 1, get: function () {
          return this.a;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }}));
    };
    this.EnsureToastArea = function () {
      if (!(this.FToastContainer != null)) {
        this.FToastContainer = document.createElement("DIV");
        document.body.appendChild(this.FToastContainer);
      };
    };
    this.UpdateTimes = function (Sender) {
      var i = 0;
      var d = 0.0;
      var h = 0;
      var mi = 0;
      var se = 0;
      var se1100 = 0;
      var s = "";
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.FItems.GetItem$1(i).FVisible && (this.FItems.GetItem$1(i).FTime === $mod.TToastTime.ttDeltaShow)) {
          d = pas.SysUtils.Now() - this.FItems.GetItem$1(i).FDispTime;
          pas.SysUtils.DecodeTime(d,{get: function () {
              return h;
            }, set: function (v) {
              h = v;
            }},{get: function () {
              return mi;
            }, set: function (v) {
              mi = v;
            }},{get: function () {
              return se;
            }, set: function (v) {
              se = v;
            }},{get: function () {
              return se1100;
            }, set: function (v) {
              se1100 = v;
            }});
          if (h > 0) {
            s = pas.SysUtils.IntToStr(h) + "h " + pas.SysUtils.IntToStr(mi) + "m"}
           else if (mi > 0) {
            s = pas.SysUtils.IntToStr(h) + "m " + pas.SysUtils.IntToStr(se) + "s"}
           else s = pas.SysUtils.IntToStr(se) + "s";
          this.FItems.GetItem$1(i).FElementTime.innerHTML = s + " ago";
        };
      };
    };
    this.HandleClose = function (Event) {
      var Result = false;
      var sid = "";
      var id = 0;
      var e = 0;
      var l = 0;
      sid = Event.target.getAttribute("data-id");
      l = this.FName.length;
      pas.System.Delete({get: function () {
          return sid;
        }, set: function (v) {
          sid = v;
        }},1,l);
      pas.System.val$6(sid,{get: function () {
          return id;
        }, set: function (v) {
          id = v;
        }},{get: function () {
          return e;
        }, set: function (v) {
          e = v;
        }});
      if (e === 0) {
        this.DoHideToast(id);
      };
      Result = true;
      return Result;
    };
    this.DoHideToast = function (AIndex) {
      var Idx = 0;
      var i = 0;
      Idx = -1;
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.FItems.GetItem$1(i).FID$1 === AIndex) Idx = i;
      };
      if (Idx === -1) return;
      if (this.FOnHide != null) this.FOnHide(this,Idx);
      this.FItems.GetItem$1(Idx).Hide();
      if (this.FItems.GetItem$1(Idx).FAutoDelete) {
        this.FItems.GetItem$1(Idx).DeleteHTML();
        this.FItems.Delete(Idx);
      };
    };
    this.HandleAutoHide = function (Event) {
      var Result = false;
      var sid = "";
      var id = 0;
      var e = 0;
      var l = 0;
      sid = Event.target.getAttribute("id");
      l = this.FName.length;
      pas.System.Delete({get: function () {
          return sid;
        }, set: function (v) {
          sid = v;
        }},1,l);
      pas.System.val$6(sid,{get: function () {
          return id;
        }, set: function (v) {
          id = v;
        }},{get: function () {
          return e;
        }, set: function (v) {
          e = v;
        }});
      if (e === 0) {
        this.DoHideToast(id);
      };
      Result = true;
      return Result;
    };
    this.Create$1 = function (AOwner) {
      pas.Classes.TComponent.Create$1.apply(this,arguments);
      this.FItems = $mod.TToastCollection.$create("Create$3",[this]);
      this.FToastContainer = null;
      this.FTimer = pas["WEBLib.ExtCtrls"].TTimer.$create("Create$1",[this]);
      this.FTimer.FOnTimer = rtl.createCallback(this,"UpdateTimes");
      this.FAutoHideDelay = 5000;
      this.FLevel = $mod.TLibraryLevel.llv5;
      this.FClosePtr = rtl.createCallback(this,"HandleClose");
      this.FAutoHidePtr = rtl.createCallback(this,"HandleAutoHide");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FTimer");
      pas.Classes.TComponent.Destroy.call(this);
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("AutoHideDelay",0,rtl.longint,"FAutoHideDelay","FAutoHideDelay",4,{Default: 5000});
    $r.addProperty("Container",0,pas["WEBLib.Controls"].$rtti["TElementID"],"FContainer","FContainer");
    $r.addProperty("Items",2,$mod.$rtti["TToastCollection"],"FItems","SetItems");
    $r.addProperty("Level",0,$mod.$rtti["TLibraryLevel"],"FLevel","FLevel",4,{Default: $mod.TLibraryLevel.llv5});
    $r.addProperty("Position",0,$mod.$rtti["TToastPosition"],"FPosition","FPosition");
    $r.addProperty("X",2,rtl.longint,"FX","SetX",4,{Default: 0});
    $r.addProperty("Y",2,rtl.longint,"FY","SetY",4,{Default: 0});
    $r.addProperty("OnHide",0,$mod.$rtti["TToastHideEvent"],"FOnHide","FOnHide");
    $r.addProperty("OnShow",0,$mod.$rtti["TToastShowEvent"],"FOnShow","FOnShow");
  });
  rtl.createClass(this,"TWebToast",this.TToast,function () {
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.CreateToast = function (ATitle, ABody, AID) {
    var Result = null;
    var el = null;
    var hdr = null;
    var bdy = null;
    el = document.createElement("DIV");
    el.classList.add("toast");
    el.setAttribute("data-bs-autohide","false");
    el.setAttribute("id",AID);
    hdr = document.createElement("DIV");
    hdr.setAttribute("class","toast-header");
    hdr.innerHTML = ATitle;
    bdy = document.createElement("DIV");
    bdy.setAttribute("class","toast-body");
    bdy.innerHTML = ABody;
    el.appendChild(hdr);
    el.appendChild(bdy);
    Result = el;
    return Result;
  };
},["WEBLib.Forms"]);
rtl.module("Utils",["System","Classes","SysUtils","JS","Web","WEBLib.Forms","WEBLib.Toast","DateUtils","WEBLib.Dialogs"],function () {
  "use strict";
  var $mod = this;
  this.ShowStatusMessage = function (AMessage, AClass, AElementId) {
    var StatusMessage = null;
    StatusMessage = document.getElementById(AElementId);
    if (StatusMessage != null) {
      if (AMessage === "") {
        StatusMessage.style.setProperty("display","none");
        StatusMessage.className = "";
        StatusMessage.innerHTML = "";
      } else {
        StatusMessage.innerHTML = AMessage;
        StatusMessage.className = "alert " + AClass;
        StatusMessage.style.setProperty("display","block");
      };
    } else window.console.log("Error: Status message element not found");
  };
  this.HideStatusMessage = function (AElementId) {
    var StatusMessage = null;
    StatusMessage = document.getElementById(AElementId);
    if (StatusMessage != null) {
      StatusMessage.style.setProperty("display","none");
      StatusMessage.className = "";
      StatusMessage.innerHTML = "";
    } else window.console.log("Error: Status message element not found");
  };
  this.ShowSpinner = function (SpinnerID) {
    var SpinnerElement = null;
    SpinnerElement = document.getElementById(SpinnerID);
    if (SpinnerElement != null) {
      if (SpinnerElement.parentNode !== document.body) {
        document.body.appendChild(SpinnerElement);
      };
      SpinnerElement.classList.remove("d-none");
      SpinnerElement.classList.add("d-block");
    };
  };
  this.HideSpinner = function (SpinnerID) {
    var SpinnerElement = null;
    SpinnerElement = document.getElementById(SpinnerID);
    if (SpinnerElement != null) {
      SpinnerElement.classList.remove("d-block");
      SpinnerElement.classList.add("d-none");
    };
  };
  this.ShowErrorModal = function (msg) {
    var modal = document.getElementById('main_errormodal');
        var label = document.getElementById('main_lblmodal_body');
        var reloadBtn = document.getElementById('btn_modal_restart');
    
        if (label) label.innerText = msg;
    
        // Ensure modal is a direct child of <body>
        if (modal && modal.parentNode !== document.body) {
          document.body.appendChild(modal);
        }
    
        // Bind hard reload to button
        if (reloadBtn) {
          reloadBtn.onclick = function () {
            window.location.reload(true); // hard reload, bypass cache
          };
        }
    
        // Show the Bootstrap modal
        var bsModal = new bootstrap.Modal(modal, { keyboard: false });
        bsModal.show();
  };
  this.CalculateAge = function (DateOfBirth) {
    var Result = 0;
    var Today = null;
    var BirthDate = null;
    var Year = 0;
    var Month = 0;
    var Day = 0;
    var BirthYear = 0;
    var BirthMonth = 0;
    var BirthDay = 0;
    var DOBString = "";
    Today = new Date();
    Year = Today.getFullYear();
    Month = Today.getMonth() + 1;
    Day = Today.getDate();
    DOBString = pas.SysUtils.FormatDateTime("yyyy-mm-dd",DateOfBirth);
    BirthDate = new Date(DOBString);
    if (BirthDate === null) {
      return 0;
    };
    BirthYear = BirthDate.getFullYear();
    BirthMonth = BirthDate.getMonth() + 1;
    BirthDay = BirthDate.getDate();
    Result = Year - BirthYear;
    if ((Month < BirthMonth) || ((Month === BirthMonth) && (Day < BirthDay))) Result -= 1;
    return Result;
  };
  this.FormatPhoneNumber = function (PhoneNumber) {
    var Result = "";
    var Digits = "";
    Digits = pas.SysUtils.TStringHelper.Replace$2.call({a: pas.SysUtils.TStringHelper.Replace$2.call({a: pas.SysUtils.TStringHelper.Replace$2.call({a: pas.SysUtils.TStringHelper.Replace$2.call({get: function () {
              return PhoneNumber;
            }, set: function (v) {
              PhoneNumber = v;
            }},"(",""), get: function () {
            return this.a;
          }, set: function (v) {
            this.a = v;
          }},")",""), get: function () {
          return this.a;
        }, set: function (v) {
          this.a = v;
        }},"-",""), get: function () {
        return this.a;
      }, set: function (v) {
        this.a = v;
      }}," ","");
    var $tmp = Digits.length;
    if ($tmp === 7) {
      Result = pas.SysUtils.Format("%s-%s",pas.System.VarRecs(18,pas.System.Copy(Digits,1,3),18,pas.System.Copy(Digits,4,4)))}
     else if ($tmp === 10) {
      Result = pas.SysUtils.Format("(%s) %s-%s",pas.System.VarRecs(18,pas.System.Copy(Digits,1,3),18,pas.System.Copy(Digits,4,3),18,pas.System.Copy(Digits,7,4)))}
     else {
      Result = PhoneNumber;
    };
    return Result;
  };
  this.ApplyReportTitle = function (CurrentReportType) {
    var CrimeTitleElement = null;
    CrimeTitleElement = document.getElementById("crime_title");
    if (CrimeTitleElement != null) {
      CrimeTitleElement.innerText = CurrentReportType}
     else window.console.log('Element with ID "crime_title" not found.');
  };
  this.ShowToast = function (MessageText, ToastType) {
    var ParsedText = "";
    var ToastKind = "";
    var MsgPrefix = "";
    var Parts = [];
    ParsedText = pas.SysUtils.TStringHelper.Trim.call({get: function () {
        return MessageText;
      }, set: function (v) {
        rtl.raiseE("EPropReadOnly");
      }});
    ToastKind = pas.SysUtils.TStringHelper.ToLower.call({get: function () {
        return ToastType;
      }, set: function (v) {
        rtl.raiseE("EPropReadOnly");
      }});
    if (pas.SysUtils.TStringHelper.Contains.call({get: function () {
        return ParsedText;
      }, set: function (v) {
        ParsedText = v;
      }},":")) {
      Parts = pas.SysUtils.TStringHelper.Split$3.call({get: function () {
          return ParsedText;
        }, set: function (v) {
          ParsedText = v;
        }},[":"],2);
      MsgPrefix = pas.SysUtils.TStringHelper.ToLower.call({a: pas.SysUtils.TStringHelper.Trim.call({a: 0, p: Parts, get: function () {
            return this.p[this.a];
          }, set: function (v) {
            this.p[this.a] = v;
          }}), get: function () {
          return this.a;
        }, set: function (v) {
          this.a = v;
        }});
      if ((MsgPrefix === "success") || (MsgPrefix === "failure")) {
        ParsedText = pas.SysUtils.TStringHelper.Trim.call({a: 1, p: Parts, get: function () {
            return this.p[this.a];
          }, set: function (v) {
            this.p[this.a] = v;
          }});
        if (MsgPrefix === "success") {
          ToastKind = "success"}
         else ToastKind = "danger";
      };
    };
    var toastEl = document.getElementById('bootstrapToast');
        var toastBody = document.getElementById('bootstrapToastBody');
    
        if (!toastEl || !toastBody) return;
    
        toastBody.innerText = ParsedText;
    
        toastEl.classList.remove('bg-success', 'bg-danger', 'bg-warning', 'bg-primary');
        toastEl.classList.remove('slide-in');
    
        switch (ToastKind) {
          case 'danger':
            toastEl.classList.add('bg-danger');
            break;
          case 'warning':
            toastEl.classList.add('bg-warning');
            break;
          case 'info':
            toastEl.classList.add('bg-primary');
            break;
          default:
            toastEl.classList.add('bg-success');
        }
    
        // Add slide-in animation
        toastEl.classList.add('slide-in');
    
        var toast = new bootstrap.Toast(toastEl, { delay: 2500 });
        toast.show();
    
        // Remove animation class after it's done (so it can be reapplied)
        setTimeout(function() {
          toastEl.classList.remove('slide-in');
        }, 500);
  };
  this.ShowConfirmationModal = function (msg, leftLabel, rightLabel, ConfirmProc) {
    var modal = document.getElementById('main_confirmation_modal');
        var body = document.getElementById('main_modal_body');
        var btnLeft = document.getElementById('btn_confirm_left');
        var btnRight = document.getElementById('btn_confirm_right');
        var bsModal;
    
        if (body) body.innerText = msg;
        if (btnLeft) btnLeft.innerText = leftLabel;
        if (btnRight) btnRight.innerText = rightLabel;
    
        if (modal && modal.parentNode !== document.body) {
          document.body.appendChild(modal);
        }
    
        btnLeft.onclick = null;
        btnRight.onclick = null;
    
        btnLeft.onclick = function () {
          bsModal.hide();
          ConfirmProc(true); // user confirmed
        };
    
        btnRight.onclick = function () {
          bsModal.hide();
          ConfirmProc(false); // user canceled
        };
    
        bsModal = new bootstrap.Modal(modal, { keyboard: false });
        bsModal.show();
  };
  this.ShowNotificationModal = function (msg) {
    var modal = document.getElementById('main_notification_modal');
        var label = document.getElementById('main_notification_modal_body');
        var closeBtn = document.getElementById('btn_modal_close');
    
        if (label) label.innerText = msg;
    
        // Ensure modal is a direct child of <body>
        if (modal && modal.parentNode !== document.body) {
          document.body.appendChild(modal);
        }
    
        // Button simply closes the modal
        if (closeBtn) {
          closeBtn.onclick = function () {
            var existing = bootstrap.Modal.getInstance(modal);
            if (existing) {
              existing.hide();
            }
          };
        }
    
        // Show the Bootstrap modal
        var bsModal = new bootstrap.Modal(modal, { keyboard: false });
        bsModal.show();
  };
});
rtl.module("ConnectionModule",["System","SysUtils","Classes","WEBLib.Modules","XData.Web.Connection","App.Types","App.Config","XData.Web.Client"],function () {
  "use strict";
  var $mod = this;
  rtl.createClass(this,"TDMConnection",pas["WEBLib.Modules"].TDataModule,function () {
    this.clientVersion = "0.0.1";
    this.$init = function () {
      pas["WEBLib.Modules"].TDataModule.$init.call(this);
      this.ApiConnection = null;
      this.AuthConnection = null;
      this.XDataWebClient1 = null;
      this.FUnauthorizedAccessProc = null;
      this.FUserIdParam = "";
      this.FTaskIdParam = "";
      this.FCodeParam = "";
    };
    this.$final = function () {
      this.ApiConnection = undefined;
      this.AuthConnection = undefined;
      this.XDataWebClient1 = undefined;
      this.FUnauthorizedAccessProc = undefined;
      pas["WEBLib.Modules"].TDataModule.$final.call(this);
    };
    this.ApiConnectionError = function (error) {
      pas.Utils.ShowErrorModal(error.ToString());
    };
    this.ApiConnectionRequest = function (Args) {
      if (pas["Auth.Service"].AuthService().Authenticated()) Args.FRequest.GetHeaders().SetValue("Authorization","Bearer " + pas["Auth.Service"].AuthService().GetToken());
    };
    this.ApiConnectionResponse = function (Args) {
      if ((Args.FResponse.GetStatusCode() === 401) && (this.FUnauthorizedAccessProc != null)) this.FUnauthorizedAccessProc(pas.SysUtils.Format("%d: %s",pas.System.VarRecs(0,Args.FResponse.GetStatusCode(),18,Args.FResponse.GetContentAsText())));
    };
    this.AuthConnectionError = function (error) {
      pas.Utils.ShowErrorModal(error.ToString());
    };
    this.InitApp = function (SuccessProc, UnauthorizedAccessProc) {
      var $Self = this;
      function ConfigLoaded(Config) {
        if (Config.FAuthUrl !== "") $Self.AuthConnection.SetURL(Config.FAuthUrl);
        if (Config.FApiUrl !== "") $Self.ApiConnection.SetURL(Config.FApiUrl);
        $Self.AuthConnection.Open(SuccessProc,null);
      };
      this.FUnauthorizedAccessProc = UnauthorizedAccessProc;
      pas["App.Config"].LoadConfig(ConfigLoaded);
    };
    this.SetClientConfig = function (Callback) {
      var $Self = this;
      this.XDataWebClient1.SetConnection(this.AuthConnection);
      this.XDataWebClient1.RawInvoke$2("IAuthService.VerifyVersion",[this.clientVersion],function (Response) {
        var jsonResult = null;
        var error = "";
        jsonResult = Response.FResult;
        if (jsonResult.hasOwnProperty("error")) {
          error = "" + jsonResult["error"]}
         else error = "";
        if (error !== "") {
          Callback(false,error)}
         else Callback(true,"");
      },function (error) {
        Callback(false,error.FErrorMessage);
      });
    };
    this.LoadDFMValues = function () {
      pas["WEBLib.Modules"].TDataModule.LoadDFMValues.call(this);
      this.ApiConnection = pas["XData.Web.Connection"].TXDataWebConnection.$create("Create$1",[this]);
      this.AuthConnection = pas["XData.Web.Connection"].TXDataWebConnection.$create("Create$1",[this]);
      this.XDataWebClient1 = pas["XData.Web.Client"].TXDataWebClient.$create("Create$1",[this]);
      this.ApiConnection.BeforeLoadDFMValues();
      this.AuthConnection.BeforeLoadDFMValues();
      this.XDataWebClient1.BeforeLoadDFMValues();
      try {
        this.SetName("DMConnection");
        this.FHeight = 264;
        this.FWidth = 395;
        this.ApiConnection.SetParentComponent(this);
        this.ApiConnection.SetName("ApiConnection");
        this.SetEvent$1(this.ApiConnection,this,"OnError","ApiConnectionError");
        this.SetEvent$1(this.ApiConnection,this,"OnRequest","ApiConnectionRequest");
        this.SetEvent$1(this.ApiConnection,this,"OnResponse","ApiConnectionResponse");
        this.ApiConnection.SetLeft(48);
        this.ApiConnection.SetTop(80);
        this.AuthConnection.SetParentComponent(this);
        this.AuthConnection.SetName("AuthConnection");
        this.SetEvent$1(this.AuthConnection,this,"OnError","AuthConnectionError");
        this.AuthConnection.SetLeft(48);
        this.AuthConnection.SetTop(16);
        this.XDataWebClient1.SetParentComponent(this);
        this.XDataWebClient1.SetName("XDataWebClient1");
        this.XDataWebClient1.SetConnection(this.AuthConnection);
        this.XDataWebClient1.SetLeft(269);
        this.XDataWebClient1.SetTop(164);
      } finally {
        this.ApiConnection.AfterLoadDFMValues();
        this.AuthConnection.AfterLoadDFMValues();
        this.XDataWebClient1.AfterLoadDFMValues();
      };
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addField("ApiConnection",pas["XData.Web.Connection"].$rtti["TXDataWebConnection"],4);
    $r.addField("AuthConnection",pas["XData.Web.Connection"].$rtti["TXDataWebConnection"],4);
    $r.addField("XDataWebClient1",pas["XData.Web.Client"].$rtti["TXDataWebClient"],4);
    $r.addMethod("ApiConnectionError",0,[["error",pas["XData.Web.Connection"].$rtti["TXDataWebConnectionError"]]],4);
    $r.addMethod("ApiConnectionRequest",0,[["Args",pas["XData.Web.Connection"].$rtti["TXDataWebConnectionRequest"]]],4);
    $r.addMethod("ApiConnectionResponse",0,[["Args",pas["XData.Web.Connection"].$rtti["TXDataWebConnectionResponse"]]],4);
    $r.addMethod("AuthConnectionError",0,[["error",pas["XData.Web.Connection"].$rtti["TXDataWebConnectionError"]]],4);
  });
  this.DMConnection = null;
},["JS","Web","XData.Web.Request","XData.Web.Response","Auth.Service","Utils"]);
rtl.module("Auth.Service",["System","SysUtils","Web","JS","XData.Web.Client"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.TOKEN_NAME = "EMT3_WEB_TOKEN";
  this.$rtti.$RefToProcVar("TOnLoginSuccess",{procsig: rtl.newTIProcSig([])});
  this.$rtti.$RefToProcVar("TOnLoginError",{procsig: rtl.newTIProcSig([["AMsg",rtl.string]])});
  rtl.createClass(this,"TAuthService",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FClient = null;
    };
    this.$final = function () {
      this.FClient = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.SetToken = function (AToken) {
      window.localStorage.setItem($mod.TOKEN_NAME,AToken);
    };
    this.DeleteToken = function () {
      window.localStorage.removeItem($mod.TOKEN_NAME);
    };
    this.Create$1 = function () {
      this.FClient = pas["XData.Web.Client"].TXDataWebClient.$create("Create$1",[null]);
      this.FClient.SetConnection(pas.ConnectionModule.DMConnection.AuthConnection);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FClient");
      pas.System.TObject.Destroy.call(this);
    };
    this.Login = function (userId, taskId, urlCode, ASuccess, AError) {
      var $Self = this;
      function OnLoad(Response) {
        var Token = null;
        Token = Response.FResult;
        $Self.SetToken(pas.JS.ToString(Token["value"]));
        ASuccess();
      };
      function OnError(error) {
        AError(pas.SysUtils.Format("%s: %s",pas.System.VarRecs(18,error.FErrorCode,18,error.FErrorMessage)));
      };
      if ((userId === "") || (taskId === "") || (urlCode === "")) {
        AError("Missing URL parameters. Please reopen from emt3.");
        return;
      };
      this.FClient.RawInvoke$2("IAuthService.Login",[userId,taskId,urlCode],OnLoad,OnError);
    };
    this.Logout = function () {
      this.DeleteToken();
      window.localStorage.removeItem("EMT3_USER_ID");
      window.localStorage.removeItem("EMT3_TASK_ID");
      window.localStorage.removeItem("EMT3_CODE");
    };
    this.GetToken = function () {
      var Result = "";
      Result = window.localStorage.getItem($mod.TOKEN_NAME);
      return Result;
    };
    this.Authenticated = function () {
      var Result = false;
      Result = !pas.JS.isNull(window.localStorage.getItem($mod.TOKEN_NAME)) && (window.localStorage.getItem($mod.TOKEN_NAME) !== "");
      return Result;
    };
    this.TokenExpirationDate = function () {
      var Result = 0.0;
      var ExpirationDate = null;
      if (!this.Authenticated()) return pas.SysUtils.Now();
      ExpirationDate = $mod.TJwtHelper.TokenExpirationDate(this.GetToken());
      Result = pas.SysUtils.EncodeDate(ExpirationDate.getFullYear(),ExpirationDate.getMonth() + 1,ExpirationDate.getDate()) + pas.SysUtils.EncodeTime(ExpirationDate.getHours(),ExpirationDate.getMinutes(),ExpirationDate.getSeconds(),0);
      return Result;
    };
    this.TokenExpired = function () {
      var Result = false;
      if (!this.Authenticated()) return false;
      Result = $mod.TJwtHelper.TokenExpired(this.GetToken());
      return Result;
    };
    this.TokenPayload = function () {
      var Result = null;
      if (!this.Authenticated()) return null;
      Result = JSON.parse($mod.TJwtHelper.DecodePayload(this.GetToken()));
      return Result;
    };
  });
  rtl.createClass(this,"TJwtHelper",pas.System.TObject,function () {
    this.HasExpirationDate = function (AToken) {
      var Result = false;
      var Payload = "";
      var Obj = null;
      Payload = this.DecodePayload(AToken);
      Obj = JSON.parse(Payload);
      Result = Obj.hasOwnProperty("exp");
      return Result;
    };
    this.TokenExpirationDate = function (AToken) {
      var Result = null;
      var Payload = "";
      var Obj = null;
      var Epoch = 0;
      if (!this.HasExpirationDate(AToken)) throw pas.SysUtils.Exception.$create("Create$1",["Token has no expiration date"]);
      Payload = this.DecodePayload(AToken);
      Obj = JSON.parse(Payload);
      Epoch = pas.JS.toInteger(Obj["exp"]);
      Result = new Date(Epoch * 1000);
      return Result;
    };
    this.TokenExpired = function (AToken) {
      var Result = false;
      if (!this.HasExpirationDate(AToken)) return false;
      Result = Date.now() > pas.JS.toInteger(this.TokenExpirationDate(AToken).valueOf());
      return Result;
    };
    this.DecodePayload = function (AToken) {
      var Result = "";
      if (pas.SysUtils.Trim(AToken) === "") return "";
      Result = "";
      const parts = AToken.split('.');
      if (parts.length === 3) {
        Result = atob(parts[1].replace(/-/g,'+').replace(/_/g,'/'));
      };
      return Result;
    };
  });
  this.AuthService = function () {
    var Result = null;
    if (!($impl._AuthService != null)) $impl._AuthService = $mod.TAuthService.$create("Create$1");
    Result = $impl._AuthService;
    return Result;
  };
  $mod.$implcode = function () {
    $impl._AuthService = null;
  };
},["ConnectionModule"]);
rtl.module("WEBLib.Imaging.pngImage",["System"],function () {
  "use strict";
  var $mod = this;
  $mod.$init = function () {
  };
});
rtl.module("View.Login",["System","SysUtils","Classes","Web","WEBLib.Graphics","WEBLib.Controls","WEBLib.Forms","WEBLib.Dialogs","WEBLib.Controls","WEBLib.StdCtrls","WEBLib.StdCtrls","WEBLib.JSON","JS","XData.Web.Connection","WEBLib.ExtCtrls","App.Types","ConnectionModule","XData.Web.Client","WEBLib.Imaging.pngImage"],function () {
  "use strict";
  var $mod = this;
  rtl.createClass(this,"TFViewLogin",pas["WEBLib.Forms"].TForm,function () {
    this.$init = function () {
      pas["WEBLib.Forms"].TForm.$init.call(this);
      this.WebLabel1 = null;
      this.edtUsername = null;
      this.edtPassword = null;
      this.btnLogin = null;
      this.pnlMessage = null;
      this.lblMessage = null;
      this.btnCloseNotification = null;
      this.XDataWebClient = null;
      this.WebImageControl1 = null;
      this.lblClientVersion = null;
      this.FLoginProc = null;
      this.FMessage = "";
    };
    this.$final = function () {
      this.WebLabel1 = undefined;
      this.edtUsername = undefined;
      this.edtPassword = undefined;
      this.btnLogin = undefined;
      this.pnlMessage = undefined;
      this.lblMessage = undefined;
      this.btnCloseNotification = undefined;
      this.XDataWebClient = undefined;
      this.WebImageControl1 = undefined;
      this.lblClientVersion = undefined;
      this.FLoginProc = undefined;
      pas["WEBLib.Forms"].TForm.$final.call(this);
    };
    this.btnCloseNotificationClick = function (Sender) {
      this.HideNotification();
    };
    this.WebFormShow = function (Sender) {
      window.console.log(pas.ConnectionModule.DMConnection.clientVersion);
      $mod.FViewLogin.lblClientVersion.SetCaption("v" + pas.ConnectionModule.DMConnection.clientVersion);
      if (this.FMessage !== "") {
        this.ShowNotification(this.FMessage)}
       else this.HideNotification();
    };
    this.ShowNotification = function (Notification) {
      if (Notification !== "") {
        this.lblMessage.SetCaption(Notification);
        this.pnlMessage.GetElementHandle().classList.remove("d-none");
        this.pnlMessage.SetVisible(true);
      };
    };
    this.HideNotification = function () {
      this.pnlMessage.GetElementHandle().classList.add("d-none");
      this.pnlMessage.SetVisible(false);
    };
    this.Display = function (LoginProc) {
      $mod.TFViewLogin.Display$1(LoginProc,"");
    };
    this.Display$1 = function (LoginProc, AMsg) {
      var $Self = this;
      function FormCreate(AForm) {
        AForm.FMessage = AMsg;
      };
      if ($mod.FViewLogin != null) rtl.free($mod,"FViewLogin");
      $mod.FViewLogin = $mod.TFViewLogin.$create("CreateNew$3",[FormCreate]);
      $mod.FViewLogin.FLoginProc = LoginProc;
    };
    this.LoadDFMValues = function () {
      pas["WEBLib.Forms"].TCustomForm.LoadDFMValues.call(this);
      this.WebLabel1 = pas["WEBLib.StdCtrls"].TLabel.$create("Create$2",["view.login.title"]);
      this.WebImageControl1 = pas["WEBLib.ExtCtrls"].TImageControl.$create("Create$2",["kgpicture"]);
      this.lblClientVersion = pas["WEBLib.StdCtrls"].TLabel.$create("Create$2",["lbl_client_version"]);
      this.edtUsername = pas["WEBLib.StdCtrls"].TEdit.$create("Create$2",["view.login.edtusername"]);
      this.edtPassword = pas["WEBLib.StdCtrls"].TEdit.$create("Create$2",["view.login.edtpassword"]);
      this.btnLogin = pas["WEBLib.StdCtrls"].TButton.$create("Create$2",["view.login.btnlogin"]);
      this.pnlMessage = pas["WEBLib.ExtCtrls"].TPanel.$create("Create$2",["view.login.message"]);
      this.lblMessage = pas["WEBLib.StdCtrls"].TLabel.$create("Create$2",["view.login.message.label"]);
      this.btnCloseNotification = pas["WEBLib.StdCtrls"].TButton.$create("Create$2",["view.login.message.button"]);
      this.XDataWebClient = pas["XData.Web.Client"].TXDataWebClient.$create("Create$1",[this]);
      this.WebLabel1.BeforeLoadDFMValues();
      this.WebImageControl1.BeforeLoadDFMValues();
      this.lblClientVersion.BeforeLoadDFMValues();
      this.edtUsername.BeforeLoadDFMValues();
      this.edtPassword.BeforeLoadDFMValues();
      this.btnLogin.BeforeLoadDFMValues();
      this.pnlMessage.BeforeLoadDFMValues();
      this.lblMessage.BeforeLoadDFMValues();
      this.btnCloseNotification.BeforeLoadDFMValues();
      this.XDataWebClient.BeforeLoadDFMValues();
      try {
        this.SetName("FViewLogin");
        this.SetWidth(1322);
        this.SetHeight(764);
        this.SetCSSLibrary(pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap);
        this.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
        this.FFont.FCharset = 1;
        this.FFont.SetColor(65793);
        this.FFont.SetHeight(-11);
        this.FFont.SetName("Tahoma");
        this.FFont.SetStyle({});
        this.SetParentFont(false);
        this.SetEvent(this,"OnShow","WebFormShow");
        this.WebLabel1.SetParentComponent(this);
        this.WebLabel1.SetName("WebLabel1");
        this.WebLabel1.SetLeft(240);
        this.WebLabel1.SetTop(112);
        this.WebLabel1.SetWidth(67);
        this.WebLabel1.SetHeight(13);
        this.WebLabel1.SetCaption("Please Sign In");
        this.WebLabel1.SetElementPosition(pas["WEBLib.Controls"].TElementPosition.epRelative);
        this.WebLabel1.FFont.FCharset = 0;
        this.WebLabel1.FFont.SetColor(65793);
        this.WebLabel1.FFont.SetHeight(-11);
        this.WebLabel1.FFont.SetName("Tahoma");
        this.WebLabel1.FFont.SetStyle({});
        this.WebLabel1.SetHeightPercent(100.000000000000000000);
        this.WebLabel1.SetParentFont(false);
        this.WebLabel1.SetTransparent(false);
        this.WebLabel1.SetWidthPercent(100.000000000000000000);
        this.WebImageControl1.SetParentComponent(this);
        this.WebImageControl1.SetName("WebImageControl1");
        this.WebImageControl1.SetLeft(24);
        this.WebImageControl1.SetTop(52);
        this.WebImageControl1.SetWidth(200);
        this.WebImageControl1.SetHeight(196);
        this.WebImageControl1.SetHeightPercent(100.000000000000000000);
        this.WebImageControl1.SetWidthPercent(100.000000000000000000);
        this.WebImageControl1.SetChildOrderEx(5);
        this.WebImageControl1.SetElementPosition(pas["WEBLib.Controls"].TElementPosition.epRelative);
        this.WebImageControl1.FPicture.LoadFromFile("View.Login.WebImageControl1.Picture.png");
        this.lblClientVersion.SetParentComponent(this);
        this.lblClientVersion.SetName("lblClientVersion");
        this.lblClientVersion.SetLeft(272);
        this.lblClientVersion.SetTop(229);
        this.lblClientVersion.SetWidth(72);
        this.lblClientVersion.SetHeight(13);
        this.lblClientVersion.SetCaption("lblClientVersion");
        this.lblClientVersion.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
        this.lblClientVersion.SetElementPosition(pas["WEBLib.Controls"].TElementPosition.epRelative);
        this.lblClientVersion.SetHeightStyle(pas["WEBLib.Controls"].TSizeStyle.ssAuto);
        this.lblClientVersion.SetHeightPercent(100.000000000000000000);
        this.lblClientVersion.SetWidthPercent(100.000000000000000000);
        this.edtUsername.SetParentComponent(this);
        this.edtUsername.SetName("edtUsername");
        this.edtUsername.SetLeft(240);
        this.edtUsername.SetTop(136);
        this.edtUsername.SetWidth(121);
        this.edtUsername.SetHeight(21);
        this.edtUsername.SetElementPosition(pas["WEBLib.Controls"].TElementPosition.epRelative);
        this.edtUsername.FFont.FCharset = 0;
        this.edtUsername.FFont.SetColor(0);
        this.edtUsername.FFont.SetHeight(-11);
        this.edtUsername.FFont.SetName("Arial");
        this.edtUsername.FFont.SetStyle({});
        this.edtUsername.SetHeightPercent(100.000000000000000000);
        this.edtUsername.SetHideSelection(false);
        this.edtUsername.SetParentFont(false);
        this.edtUsername.SetTextHint("Username");
        this.edtUsername.SetWidthPercent(100.000000000000000000);
        this.edtPassword.SetParentComponent(this);
        this.edtPassword.SetName("edtPassword");
        this.edtPassword.SetLeft(240);
        this.edtPassword.SetTop(163);
        this.edtPassword.SetWidth(121);
        this.edtPassword.SetHeight(21);
        this.edtPassword.SetElementPosition(pas["WEBLib.Controls"].TElementPosition.epRelative);
        this.edtPassword.FFont.FCharset = 0;
        this.edtPassword.FFont.SetColor(0);
        this.edtPassword.FFont.SetHeight(-11);
        this.edtPassword.FFont.SetName("Arial");
        this.edtPassword.FFont.SetStyle({});
        this.edtPassword.SetHeightPercent(100.000000000000000000);
        this.edtPassword.SetHideSelection(false);
        this.edtPassword.SetParentFont(false);
        this.edtPassword.SetPasswordChar("*");
        this.edtPassword.SetTabOrder(1);
        this.edtPassword.SetTextHint("Password");
        this.edtPassword.SetWidthPercent(100.000000000000000000);
        this.btnLogin.SetParentComponent(this);
        this.btnLogin.SetName("btnLogin");
        this.btnLogin.SetLeft(240);
        this.btnLogin.SetTop(190);
        this.btnLogin.SetWidth(121);
        this.btnLogin.SetHeight(25);
        this.btnLogin.SetCaption("Login");
        this.btnLogin.SetElementPosition(pas["WEBLib.Controls"].TElementPosition.epRelative);
        this.btnLogin.FFont.FCharset = 0;
        this.btnLogin.FFont.SetColor(0);
        this.btnLogin.FFont.SetHeight(-11);
        this.btnLogin.FFont.SetName("Arial");
        this.btnLogin.FFont.SetStyle({});
        this.btnLogin.SetHeightPercent(100.000000000000000000);
        this.btnLogin.SetParentFont(false);
        this.btnLogin.SetRole("null");
        this.btnLogin.SetTabOrder(2);
        this.btnLogin.SetWidthPercent(100.000000000000000000);
        this.pnlMessage.SetParentComponent(this);
        this.pnlMessage.SetName("pnlMessage");
        this.pnlMessage.SetLeft(240);
        this.pnlMessage.SetTop(65);
        this.pnlMessage.SetWidth(121);
        this.pnlMessage.SetHeight(33);
        this.pnlMessage.SetElementPosition(pas["WEBLib.Controls"].TElementPosition.epRelative);
        this.pnlMessage.FFont.FCharset = 0;
        this.pnlMessage.FFont.SetColor(0);
        this.pnlMessage.FFont.SetHeight(-11);
        this.pnlMessage.FFont.SetName("Arial");
        this.pnlMessage.FFont.SetStyle({});
        this.pnlMessage.SetParentFont(false);
        this.pnlMessage.SetRole("null");
        this.pnlMessage.SetTabOrder(3);
        this.pnlMessage.SetVisible(false);
        this.lblMessage.SetParentComponent(this.pnlMessage);
        this.lblMessage.SetName("lblMessage");
        this.lblMessage.SetLeft(16);
        this.lblMessage.SetTop(11);
        this.lblMessage.SetWidth(44);
        this.lblMessage.SetHeight(14);
        this.lblMessage.SetCaption("Message");
        this.lblMessage.SetHeightPercent(100.000000000000000000);
        this.lblMessage.SetWidthPercent(100.000000000000000000);
        this.btnCloseNotification.SetParentComponent(this.pnlMessage);
        this.btnCloseNotification.SetName("btnCloseNotification");
        this.btnCloseNotification.SetLeft(96);
        this.btnCloseNotification.SetTop(3);
        this.btnCloseNotification.SetWidth(22);
        this.btnCloseNotification.SetHeight(25);
        this.btnCloseNotification.SetHeightPercent(100.000000000000000000);
        this.btnCloseNotification.SetRole("null");
        this.btnCloseNotification.SetWidthPercent(100.000000000000000000);
        this.SetEvent$1(this.btnCloseNotification,this,"OnClick","btnCloseNotificationClick");
        this.XDataWebClient.SetParentComponent(this);
        this.XDataWebClient.SetName("XDataWebClient");
        this.XDataWebClient.SetConnection(pas.ConnectionModule.DMConnection.AuthConnection);
        this.XDataWebClient.SetLeft(492);
        this.XDataWebClient.SetTop(102);
      } finally {
        this.WebLabel1.AfterLoadDFMValues();
        this.WebImageControl1.AfterLoadDFMValues();
        this.lblClientVersion.AfterLoadDFMValues();
        this.edtUsername.AfterLoadDFMValues();
        this.edtPassword.AfterLoadDFMValues();
        this.btnLogin.AfterLoadDFMValues();
        this.pnlMessage.AfterLoadDFMValues();
        this.lblMessage.AfterLoadDFMValues();
        this.btnCloseNotification.AfterLoadDFMValues();
        this.XDataWebClient.AfterLoadDFMValues();
      };
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addField("WebLabel1",pas["WEBLib.StdCtrls"].$rtti["TLabel"],4);
    $r.addField("edtUsername",pas["WEBLib.StdCtrls"].$rtti["TEdit"],4);
    $r.addField("edtPassword",pas["WEBLib.StdCtrls"].$rtti["TEdit"],4);
    $r.addField("btnLogin",pas["WEBLib.StdCtrls"].$rtti["TButton"],4);
    $r.addField("pnlMessage",pas["WEBLib.ExtCtrls"].$rtti["TPanel"],4);
    $r.addField("lblMessage",pas["WEBLib.StdCtrls"].$rtti["TLabel"],4);
    $r.addField("btnCloseNotification",pas["WEBLib.StdCtrls"].$rtti["TButton"],4);
    $r.addField("XDataWebClient",pas["XData.Web.Client"].$rtti["TXDataWebClient"],4);
    $r.addField("WebImageControl1",pas["WEBLib.ExtCtrls"].$rtti["TImageControl"],4);
    $r.addField("lblClientVersion",pas["WEBLib.StdCtrls"].$rtti["TLabel"],4);
    $r.addMethod("btnCloseNotificationClick",0,[["Sender",pas.System.$rtti["TObject"]]],4);
    $r.addMethod("WebFormShow",0,[["Sender",pas.System.$rtti["TObject"]]],4);
  });
  this.FViewLogin = null;
},["Auth.Service"]);
rtl.module("DBConst",["System"],function () {
  "use strict";
  var $mod = this;
  $mod.$resourcestrings = {SActiveDataset: {org: "Operation cannot be performed on an active dataset"}, SBadParamFieldType: {org: 'Bad fieldtype for parameter "%s".'}, SCantSetAutoIncFields: {org: "AutoInc Fields are read-only"}, SConnected: {org: "Operation cannot be performed on a connected database"}, SDatasetReadOnly: {org: "Dataset is read-only."}, SDatasetRegistered: {org: 'Dataset already registered : "%s"'}, SDuplicateFieldName: {org: 'Duplicate fieldname : "%s"'}, SErrAssTransaction: {org: "Cannot assign transaction while old transaction active!"}, SErrColumnNotFound: {org: 'Column "%s" not found.'}, SErrDatabasenAssigned: {org: "Database not assigned!"}, SErrNoDatabaseAvailable: {org: "Invalid operation: Not attached to database"}, SErrNoDatabaseName: {org: "Database connect string (DatabaseName) not filled in!"}, SErrNoSelectStatement: {org: "Cannot open a non-select statement"}, SErrNoStatement: {org: "SQL statement not set"}, SErrTransAlreadyActive: {org: "Transaction already active"}, SErrTransactionnSet: {org: "Transaction not set"}, SErrIndexResultTooLong: {org: 'Index result for "%s" too long, >100 characters (%d).'}, SErrIndexBasedOnInvField: {org: 'Field "%s" has an invalid field type (%s) to base index on.'}, SErrIndexBasedOnUnkField: {org: 'Index based on unknown field "%s".'}, SErrConnTransactionnSet: {org: "Transaction of connection not set"}, SErrNotASQLConnection: {org: '"%s" is not a TSQLConnection'}, SErrNotASQLQuery: {org: '"%s" is not a TCustomSQLQuery'}, STransNotActive: {org: "Operation cannot be performed on an inactive transaction"}, STransActive: {org: "Operation cannot be performed on an active transaction"}, SFieldNotFound: {org: 'Field not found : "%s"'}, SInactiveDataset: {org: "Operation cannot be performed on an inactive dataset"}, SInvalidDisplayValues: {org: '"%s" are not valid boolean displayvalues'}, SInvalidFieldKind: {org: "%s : invalid field kind : "}, SInvalidBookmark: {org: "Invalid bookmark"}, SInvalidFieldSize: {org: "Invalid field size : %d"}, SInvalidTypeConversion: {org: "Invalid type conversion to %s in field %s"}, SNeedField: {org: "Field %s is required, but not supplied."}, SNeedFieldName: {org: "Field needs a name"}, SNoDataset: {org: 'No dataset asssigned for field : "%s"'}, SNoDatasetRegistered: {org: 'No such dataset registered : "%s"'}, SNoDatasets: {org: "No datasets are attached to the database"}, SNoSuchRecord: {org: "Could not find the requested record."}, SNoTransactionRegistered: {org: 'No such transaction registered : "%s"'}, SNoTransactions: {org: "No transactions are attached to the database"}, SNotABoolean: {org: '"%s" is not a valid boolean'}, SNotAFloat: {org: '"%s" is not a valid float'}, SNotAninteger: {org: '"%s" is not a valid integer'}, SNotConnected: {org: "Operation cannot be performed on an disconnected database"}, SNotEditing: {org: 'Operation not allowed, dataset "%s" is not in an edit or insert state.'}, SParameterNotFound: {org: 'Parameter "%s" not found'}, SRangeError: {org: "%f is not between %f and %f for %s"}, SReadOnlyField: {org: "Field %s cannot be modified, it is read-only."}, STransactionRegistered: {org: 'Transaction already registered : "%s"'}, SUniDirectional: {org: "Operation cannot be performed on an unidirectional dataset"}, SUnknownField: {org: 'No field named "%s" was found in dataset "%s"'}, SUnknownFieldType: {org: "Unknown field type : %s"}, SUnknownParamFieldType: {org: 'Unknown fieldtype for parameter "%s".'}, SMetadataUnavailable: {org: "The metadata is not available for this type of database."}, SDeletedRecord: {org: "The record is deleted."}, SIndexNotFound: {org: "Index '%s' not found"}, SParameterCountIncorrect: {org: "The number of parameters is incorrect."}, SUnsupportedParameter: {org: "Parameters of the type '%s' are not (yet) supported."}, SFieldValueError: {org: "Invalid value for field '%s'"}, SInvalidCalcType: {org: "Field '%s' cannot be a calculated or lookup field"}, SDuplicateName: {org: "Duplicate name '%s' in %s"}, SNoParseSQL: {org: "%s is only possible if ParseSQL is True"}, SLookupInfoError: {org: "Lookup information for field '%s' is incomplete"}, SUnsupportedFieldType: {org: "Fieldtype %s is not supported"}, SInvPacketRecordsValue: {org: "PacketRecords has to be larger then 0"}, SInvPacketRecordsValueFieldNames: {org: "PacketRecords must be -1 if IndexFieldNames is set"}, SInvalidSearchFieldType: {org: "Searching in fields of type %s is not supported"}, SDatasetEmpty: {org: "The dataset is empty"}, SFieldIsNull: {org: "The field is null"}, SOnUpdateError: {org: "An error occurred while applying the updates in a record: %s"}, SApplyRecNotSupported: {org: "Applying updates is not supported by this TDataset descendent"}, SNoWhereFields: {org: "No %s query specified and failed to generate one. (No fields for inclusion in where statement found)"}, SNoUpdateFields: {org: "No %s query specified and failed to generate one. (No fields found for insert- or update-statement found)"}, SNotSupported: {org: "Operation is not supported by this type of database"}, SDBCreateDropFailed: {org: "Creation or dropping of database failed"}, SMaxIndexes: {org: "The maximum amount of indexes is reached"}, SMinIndexes: {org: "The minimum amount of indexes is 1"}, STooManyFields: {org: "More fields specified then really exist"}, SFieldIndexError: {org: "Field index out of range"}, SIndexFieldMissing: {org: "Cannot access index field '%s'"}, SNoFieldIndexes: {org: "No index currently active"}, SNotIndexField: {org: "Field '%s' is not indexed and cannot be modified"}, SErrUnknownConnectorType: {org: 'Unknown connector type: "%s"'}, SNoIndexFieldNameGiven: {org: "There are no fields selected to base the index on"}, SStreamNotRecognised: {org: "The data-stream format is not recognized"}, SNoReaderClassRegistered: {org: "There is no TDatapacketReaderClass registered for this kind of data-stream"}, SErrCircularDataSourceReferenceNotAllowed: {org: "Circular datasource references are not allowed."}, SCommitting: {org: "Committing transaction"}, SRollingBack: {org: "Rolling back transaction"}, SCommitRetaining: {org: "Commit and retaining transaction"}, SRollBackRetaining: {org: "Rollback and retaining transaction"}, SErrNoFieldsDefined: {org: "Can not create a dataset when there are no fielddefinitions or fields defined"}, SErrApplyUpdBeforeRefresh: {org: "Must apply updates before refreshing data"}, SErrNoDataset: {org: "Missing (compatible) underlying dataset, can not open"}, SErrDisconnectedPacketRecords: {org: "For disconnected TSQLQuery instances, packetrecords must be -1"}, SErrImplicitNoRollBack: {org: "Implicit use of transactions does not allow rollback."}, SErrNoImplicitTransaction: {org: "Connection %s does not allow implicit transactions."}, SErrImplictTransactionStart: {org: 'Error: attempt to implicitly start a transaction on Connection "%s", transaction "%s".'}, SErrImplicitConnect: {org: 'Error: attempt to implicitly activate connection "%s".'}, SErrFailedToUpdateRecord: {org: "Failed to apply record updates: %d rows updated."}, SErrRefreshNotSingleton: {org: "Refresh SQL resulted in multiple records: %d."}, SErrRefreshEmptyResult: {org: "Refresh SQL resulted in empty result set."}, SErrNoKeyFieldForRefreshClause: {org: "No key field found to construct refresh SQL WHERE clause"}, SErrFailedToFetchReturningResult: {org: "Failed to fetch returning result"}, SLogParamValue: {org: 'Parameter "%s" value : "%s"'}, SErrInvalidDateTime: {org: 'Invalid date/time value : "%s"'}, SatEOFInternalOnly: {org: "loAtEOF is for internal use only."}, SErrInsertingSameRecordtwice: {org: "Attempt to insert the same record twice."}, SErrDoApplyUpdatesNeedsProxy: {org: "Cannot apply updates without Data proxy"}, SNestedDataSetClass: {org: "Nested dataset must inherit from %s"}, SCircularDataLink: {org: "Circular datalinks are not allowed"}};
});
rtl.module("DB",["System","Classes","SysUtils","JS","Types","DateUtils"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.dsMaxBufferCount = rtl.trunc(2147483647 / 8);
  this.dsMaxStringSize = 8192;
  this.$rtti.$StaticArray("YesNoChars$a",{dims: [2], eltype: rtl.char});
  this.YesNoChars = ["N","Y"];
  this.SQLDelimiterCharacters = rtl.createSet(59,44,32,40,41,13,10,9);
  this.TDataSetState = {"0": "dsInactive", dsInactive: 0, "1": "dsBrowse", dsBrowse: 1, "2": "dsEdit", dsEdit: 2, "3": "dsInsert", dsInsert: 3, "4": "dsSetKey", dsSetKey: 4, "5": "dsCalcFields", dsCalcFields: 5, "6": "dsFilter", dsFilter: 6, "7": "dsNewValue", dsNewValue: 7, "8": "dsOldValue", dsOldValue: 8, "9": "dsCurValue", dsCurValue: 9, "10": "dsBlockRead", dsBlockRead: 10, "11": "dsInternalCalc", dsInternalCalc: 11, "12": "dsOpening", dsOpening: 12, "13": "dsRefreshFields", dsRefreshFields: 13};
  this.$rtti.$Enum("TDataSetState",{minvalue: 0, maxvalue: 13, ordtype: 1, enumtype: this.TDataSetState});
  this.TDataEvent = {"0": "deFieldChange", deFieldChange: 0, "1": "deRecordChange", deRecordChange: 1, "2": "deDataSetChange", deDataSetChange: 2, "3": "deDataSetScroll", deDataSetScroll: 3, "4": "deLayoutChange", deLayoutChange: 4, "5": "deUpdateRecord", deUpdateRecord: 5, "6": "deUpdateState", deUpdateState: 6, "7": "deCheckBrowseMode", deCheckBrowseMode: 7, "8": "dePropertyChange", dePropertyChange: 8, "9": "deFieldListChange", deFieldListChange: 9, "10": "deFocusControl", deFocusControl: 10, "11": "deParentScroll", deParentScroll: 11, "12": "deConnectChange", deConnectChange: 12, "13": "deReconcileError", deReconcileError: 13, "14": "deDisabledStateChange", deDisabledStateChange: 14};
  this.$rtti.$Enum("TDataEvent",{minvalue: 0, maxvalue: 14, ordtype: 1, enumtype: this.TDataEvent});
  this.TUpdateStatus = {"0": "usModified", usModified: 0, "1": "usInserted", usInserted: 1, "2": "usDeleted", usDeleted: 2};
  this.$rtti.$Enum("TUpdateStatus",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TUpdateStatus});
  this.$rtti.$Set("TUpdateStatusSet",{comptype: this.$rtti["TUpdateStatus"]});
  this.TResolveStatus = {"0": "rsUnresolved", rsUnresolved: 0, "1": "rsResolving", rsResolving: 1, "2": "rsResolved", rsResolved: 2, "3": "rsResolveFailed", rsResolveFailed: 3};
  this.$rtti.$Enum("TResolveStatus",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TResolveStatus});
  this.$rtti.$Set("TResolveStatusSet",{comptype: this.$rtti["TResolveStatus"]});
  this.TUpdateMode = {"0": "upWhereAll", upWhereAll: 0, "1": "upWhereChanged", upWhereChanged: 1, "2": "upWhereKeyOnly", upWhereKeyOnly: 2};
  this.$rtti.$Enum("TUpdateMode",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TUpdateMode});
  this.TResolverResponse = {"0": "rrSkip", rrSkip: 0, "1": "rrAbort", rrAbort: 1, "2": "rrMerge", rrMerge: 2, "3": "rrApply", rrApply: 3, "4": "rrIgnore", rrIgnore: 4};
  this.$rtti.$Enum("TResolverResponse",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TResolverResponse});
  this.TProviderFlag = {"0": "pfInUpdate", pfInUpdate: 0, "1": "pfInWhere", pfInWhere: 1, "2": "pfInKey", pfInKey: 2, "3": "pfHidden", pfHidden: 3, "4": "pfRefreshOnInsert", pfRefreshOnInsert: 4, "5": "pfRefreshOnUpdate", pfRefreshOnUpdate: 5};
  this.$rtti.$Enum("TProviderFlag",{minvalue: 0, maxvalue: 5, ordtype: 1, enumtype: this.TProviderFlag});
  this.$rtti.$Set("TProviderFlags",{comptype: this.$rtti["TProviderFlag"]});
  this.$rtti.$Class("TFieldDef");
  this.$rtti.$Class("TFieldDefs");
  this.$rtti.$Class("TField");
  this.$rtti.$Class("TFields");
  this.$rtti.$Class("TDataSet");
  this.$rtti.$Class("TDataSource");
  this.$rtti.$Class("TDataLink");
  this.$rtti.$Class("TDataProxy");
  this.$rtti.$Class("TDataRequest");
  this.$rtti.$Class("TRecordUpdateDescriptor");
  this.$rtti.$Class("TRecordUpdateDescriptorList");
  this.$rtti.$Class("TRecordUpdateBatch");
  rtl.createClass(this,"EDatabaseError",pas.SysUtils.Exception,function () {
  });
  rtl.createClass(this,"EUpdateError",this.EDatabaseError,function () {
    this.$init = function () {
      $mod.EDatabaseError.$init.call(this);
      this.FContext = "";
      this.FErrorCode = 0;
      this.FOriginalException = null;
      this.FPreviousError = 0;
    };
    this.$final = function () {
      this.FOriginalException = undefined;
      $mod.EDatabaseError.$final.call(this);
    };
    this.Create$2 = function (NativeError, Context, ErrCode, PrevError, E) {
      pas.SysUtils.Exception.CreateFmt.call(this,NativeError,pas.System.VarRecs(18,Context));
      this.FContext = Context;
      this.FErrorCode = ErrCode;
      this.FPreviousError = PrevError;
      this.FOriginalException = E;
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FOriginalException");
      pas.System.TObject.Destroy.call(this);
    };
  });
  this.$rtti.$ClassRef("TFieldClass",{instancetype: this.$rtti["TField"]});
  this.TFieldType = {"0": "ftUnknown", ftUnknown: 0, "1": "ftString", ftString: 1, "2": "ftSmallint", ftSmallint: 2, "3": "ftInteger", ftInteger: 3, "4": "ftWord", ftWord: 4, "5": "ftBoolean", ftBoolean: 5, "6": "ftFloat", ftFloat: 6, "7": "ftCurrency", ftCurrency: 7, "8": "ftBCD", ftBCD: 8, "9": "ftDate", ftDate: 9, "10": "ftTime", ftTime: 10, "11": "ftDateTime", ftDateTime: 11, "12": "ftBytes", ftBytes: 12, "13": "ftVarBytes", ftVarBytes: 13, "14": "ftAutoInc", ftAutoInc: 14, "15": "ftBlob", ftBlob: 15, "16": "ftMemo", ftMemo: 16, "17": "ftGraphic", ftGraphic: 17, "18": "ftFmtMemo", ftFmtMemo: 18, "19": "ftParadoxOle", ftParadoxOle: 19, "20": "ftDBaseOle", ftDBaseOle: 20, "21": "ftTypedBinary", ftTypedBinary: 21, "22": "ftCursor", ftCursor: 22, "23": "ftFixedChar", ftFixedChar: 23, "24": "ftWideString", ftWideString: 24, "25": "ftLargeint", ftLargeint: 25, "26": "ftADT", ftADT: 26, "27": "ftArray", ftArray: 27, "28": "ftReference", ftReference: 28, "29": "ftDataSet", ftDataSet: 29, "30": "ftOraBlob", ftOraBlob: 30, "31": "ftOraClob", ftOraClob: 31, "32": "ftVariant", ftVariant: 32, "33": "ftInterface", ftInterface: 33, "34": "ftIDispatch", ftIDispatch: 34, "35": "ftGuid", ftGuid: 35, "36": "ftTimeStamp", ftTimeStamp: 36, "37": "ftFMTBcd", ftFMTBcd: 37, "38": "ftFixedWideChar", ftFixedWideChar: 38, "39": "ftWideMemo", ftWideMemo: 39, "40": "ftOraTimeStamp", ftOraTimeStamp: 40, "41": "ftOraInterval", ftOraInterval: 41, "42": "ftLongWord", ftLongWord: 42, "43": "ftShortint", ftShortint: 43, "44": "ftByte", ftByte: 44, "45": "ftExtended", ftExtended: 45, "46": "ftConnection", ftConnection: 46, "47": "ftParams", ftParams: 47, "48": "ftStream", ftStream: 48, "49": "ftTimeStampOffset", ftTimeStampOffset: 49, "50": "ftObject", ftObject: 50, "51": "ftSingle", ftSingle: 51};
  this.$rtti.$Enum("TFieldType",{minvalue: 0, maxvalue: 51, ordtype: 1, enumtype: this.TFieldType});
  this.ftNonTextTypes = rtl.createSet(this.TFieldType.ftBytes,this.TFieldType.ftVarBytes,this.TFieldType.ftBlob,this.TFieldType.ftMemo,this.TFieldType.ftGraphic,this.TFieldType.ftFmtMemo,this.TFieldType.ftParadoxOle,this.TFieldType.ftDBaseOle,this.TFieldType.ftTypedBinary,this.TFieldType.ftCursor,this.TFieldType.ftADT,this.TFieldType.ftArray,this.TFieldType.ftReference,this.TFieldType.ftDataSet);
  this.TFieldAttribute = {"0": "faHiddenCol", faHiddenCol: 0, "1": "faReadonly", faReadonly: 1, "2": "faRequired", faRequired: 2, "3": "faLink", faLink: 3, "4": "faUnNamed", faUnNamed: 4, "5": "faFixed", faFixed: 5};
  this.$rtti.$Enum("TFieldAttribute",{minvalue: 0, maxvalue: 5, ordtype: 1, enumtype: this.TFieldAttribute});
  this.$rtti.$Set("TFieldAttributes",{comptype: this.$rtti["TFieldAttribute"]});
  rtl.createClass(this,"TNamedItem",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FName = "";
    };
    this.GetDisplayName = function () {
      var Result = "";
      Result = this.FName;
      return Result;
    };
    this.SetDisplayName = function (Value) {
      var TmpInd = 0;
      if (this.FName === Value) return;
      if ((Value !== "") && $mod.TFieldDefs.isPrototypeOf(this.FCollection)) {
        TmpInd = this.FCollection.IndexOf(Value);
        if ((TmpInd >= 0) && (TmpInd !== this.GetIndex())) $mod.DatabaseErrorFmt(rtl.getResStr(pas.DBConst,"SDuplicateName"),pas.System.VarRecs(18,Value,18,this.FCollection.$classname));
      };
      this.FName = Value;
      pas.Classes.TCollectionItem.SetDisplayName.call(this,Value);
    };
    var $r = this.$rtti;
    $r.addProperty("Name",2,rtl.string,"FName","SetDisplayName");
  });
  rtl.createClass(this,"TDefCollection",pas.Classes.TOwnedCollection,function () {
    this.$init = function () {
      pas.Classes.TOwnedCollection.$init.call(this);
      this.FDataset = null;
      this.FUpdated = false;
    };
    this.$final = function () {
      this.FDataset = undefined;
      pas.Classes.TOwnedCollection.$final.call(this);
    };
    this.SetItemName = function (Item) {
      var N = null;
      var TN = "";
      N = rtl.as(Item,$mod.TNamedItem);
      if (N.FName === "") {
        TN = pas.System.Copy(this.$classname,2,5) + pas.SysUtils.IntToStr(N.FID + 1);
        if (this.FDataset != null) TN = this.FDataset.FName + TN;
        N.SetDisplayName(TN);
      } else pas.Classes.TCollection.SetItemName.call(this,Item);
    };
    this.create$3 = function (ADataset, AOwner, AClass) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,AClass);
      this.FDataset = ADataset;
      return this;
    };
    this.Find = function (AName) {
      var Result = null;
      var i = 0;
      Result = null;
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (pas.SysUtils.AnsiSameText(this.GetItem(i).FName,AName)) {
          Result = this.GetItem(i);
          break;
        };
      };
      return Result;
    };
    this.GetItemNames = function (List) {
      var i = 0;
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        List.Add(this.GetItem(i).FName);
      };
    };
    this.IndexOf = function (AName) {
      var Result = 0;
      var i = 0;
      Result = -1;
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (pas.SysUtils.AnsiSameText(this.GetItem(i).FName,AName)) {
          Result = i;
          break;
        };
      };
      return Result;
    };
  });
  rtl.createClass(this,"TFieldDef",this.TNamedItem,function () {
    this.$init = function () {
      $mod.TNamedItem.$init.call(this);
      this.FAttributes = {};
      this.FDataType = 0;
      this.FFieldNo = 0;
      this.FInternalCalcField = false;
      this.FPrecision = 0;
      this.FRequired = false;
      this.FSize = 0;
    };
    this.$final = function () {
      this.FAttributes = undefined;
      $mod.TNamedItem.$final.call(this);
    };
    this.GetFieldClass = function () {
      var Result = null;
      if ((this.FCollection != null) && $mod.TFieldDefs.isPrototypeOf(this.FCollection) && (this.FCollection.FDataset != null)) {
        Result = this.FCollection.FDataset.GetFieldClass(this.FDataType)}
       else Result = null;
      return Result;
    };
    this.SetAttributes = function (AValue) {
      this.FAttributes = rtl.refSet(AValue);
      this.Changed(false);
    };
    this.SetDataType = function (AValue) {
      this.FDataType = AValue;
      this.Changed(false);
    };
    this.SetPrecision = function (AValue) {
      this.FPrecision = AValue;
      this.Changed(false);
    };
    this.SetSize = function (AValue) {
      this.FSize = AValue;
      this.Changed(false);
    };
    this.SetRequired = function (AValue) {
      this.FRequired = AValue;
      this.Changed(false);
    };
    this.Create$1 = function (ACollection) {
      pas.Classes.TCollectionItem.Create$1.call(this,ACollection);
      this.FFieldNo = this.GetIndex() + 1;
      return this;
    };
    this.Create$3 = function (AOwner, AName, ADataType, ASize, ARequired, AFieldNo) {
      pas.Classes.TCollectionItem.Create$1.call(this,AOwner);
      this.SetDisplayName(AName);
      this.FDataType = ADataType;
      this.FSize = ASize;
      this.FRequired = ARequired;
      this.FPrecision = -1;
      this.FFieldNo = AFieldNo;
      return this;
    };
    this.Destroy = function () {
      pas.Classes.TCollectionItem.Destroy.call(this);
    };
    this.Assign = function (Source) {
      var fd = null;
      fd = null;
      if ($mod.TFieldDef.isPrototypeOf(Source)) fd = rtl.as(Source,$mod.TFieldDef);
      if (fd != null) {
        this.FCollection.BeginUpdate();
        try {
          this.SetDisplayName(fd.FName);
          this.SetDataType(fd.FDataType);
          this.SetSize(fd.FSize);
          this.SetPrecision(fd.FPrecision);
          this.FRequired = fd.FRequired;
        } finally {
          this.FCollection.EndUpdate();
        };
      } else pas.Classes.TPersistent.Assign.call(this,Source);
    };
    this.CreateField = function (AOwner) {
      var Result = null;
      var TheField = null;
      TheField = this.GetFieldClass();
      if (TheField === null) $mod.DatabaseErrorFmt(rtl.getResStr(pas.DBConst,"SUnknownFieldType"),pas.System.VarRecs(18,this.FName));
      Result = TheField.$create("Create$1",[AOwner]);
      try {
        Result.FFieldDef = this;
        Result.SetSize(this.FSize);
        Result.FRequired = this.FRequired;
        Result.FFieldName = this.FName;
        Result.FDisplayLabel = this.GetDisplayName();
        Result.FFieldNo = this.FFieldNo;
        Result.SetFieldType(this.FDataType);
        Result.FReadOnly = $mod.TFieldAttribute.faReadonly in this.FAttributes;
        Result.SetDataset(this.FCollection.FDataset);
        if ($mod.TFloatField.isPrototypeOf(Result)) Result.SetPrecision(this.FPrecision);
      } catch ($e) {
        Result = rtl.freeLoc(Result);
        throw $e;
      };
      return Result;
    };
    var $r = this.$rtti;
    $r.addProperty("Attributes",2,$mod.$rtti["TFieldAttributes"],"FAttributes","SetAttributes",4,{Default: {}});
    $r.addProperty("DataType",2,$mod.$rtti["TFieldType"],"FDataType","SetDataType");
    $r.addProperty("Precision",2,rtl.longint,"FPrecision","SetPrecision",4,{Default: 0});
    $r.addProperty("Size",2,rtl.longint,"FSize","SetSize",4,{Default: 0});
  });
  this.$rtti.$ClassRef("TFieldDefClass",{instancetype: this.$rtti["TFieldDef"]});
  rtl.createClass(this,"TFieldDefs",this.TDefCollection,function () {
    this.$init = function () {
      $mod.TDefCollection.$init.call(this);
      this.FHiddenFields = false;
    };
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, AValue) {
      this.SetItem(Index,AValue);
    };
    this.FieldDefClass = function () {
      var Result = null;
      Result = $mod.TFieldDef;
      return Result;
    };
    this.Create$4 = function (ADataSet) {
      $mod.TDefCollection.create$3.call(this,ADataSet,this.Owner(),this.$class.FieldDefClass());
      return this;
    };
    this.Add$1 = function (AName, ADataType, ASize, APrecision, ARequired, AReadOnly, AFieldNo) {
      var Result = null;
      Result = this.$class.FieldDefClass().$create("Create$3",[this,this.MakeNameUnique(AName),ADataType,ASize,ARequired,AFieldNo]);
      if (AReadOnly) Result.SetAttributes(rtl.unionSet(Result.FAttributes,rtl.createSet($mod.TFieldAttribute.faReadonly)));
      return Result;
    };
    this.Add$2 = function (AName, ADataType, ASize, ARequired, AFieldNo) {
      var Result = null;
      Result = this.$class.FieldDefClass().$create("Create$3",[this,AName,ADataType,ASize,ARequired,AFieldNo]);
      return Result;
    };
    this.Add$3 = function (AName, ADataType, ASize, ARequired) {
      if (AName.length === 0) $mod.DatabaseError$1(rtl.getResStr(pas.DBConst,"SNeedFieldName"),this.FDataset);
      this.BeginUpdate();
      try {
        this.Add$2(AName,ADataType,ASize,ARequired,this.GetCount() + 1);
      } finally {
        this.EndUpdate();
      };
    };
    this.Add$4 = function (AName, ADataType, ASize) {
      this.Add$3(AName,ADataType,ASize,false);
    };
    this.Add$5 = function (AName, ADataType) {
      this.Add$3(AName,ADataType,0,false);
    };
    this.Add$6 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.AddFieldDef = function () {
      var Result = null;
      Result = this.$class.FieldDefClass().$create("Create$3",[this,"",$mod.TFieldType.ftUnknown,0,false,this.GetCount() + 1]);
      return Result;
    };
    this.Assign$2 = function (FieldDefs) {
      var I = 0;
      this.Clear();
      for (var $l = 0, $end = FieldDefs.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.Add$3(FieldDefs.GetItem$1(I).FName,FieldDefs.GetItem$1(I).FDataType,FieldDefs.GetItem$1(I).FSize,FieldDefs.GetItem$1(I).FRequired);
      };
    };
    this.Find$1 = function (AName) {
      var Result = null;
      Result = rtl.as($mod.TDefCollection.Find.call(this,AName),$mod.TFieldDef);
      if (Result === null) $mod.DatabaseErrorFmt$1(rtl.getResStr(pas.DBConst,"SFieldNotFound"),pas.System.VarRecs(18,AName),this.FDataset);
      return Result;
    };
    this.Update$1 = function () {
      if (!this.FUpdated) {
        if (this.FDataset != null) this.FDataset.InitFieldDefs();
        this.FUpdated = true;
      };
    };
    this.MakeNameUnique = function (AName) {
      var Result = "";
      var DblFieldCount = 0;
      DblFieldCount = 0;
      Result = AName;
      while ($mod.TDefCollection.Find.call(this,Result) != null) {
        DblFieldCount += 1;
        Result = AName + "_" + pas.SysUtils.IntToStr(DblFieldCount);
      };
      return Result;
    };
  });
  this.$rtti.$ClassRef("TFieldDefsClass",{instancetype: this.$rtti["TFieldDefs"]});
  this.TFieldKind = {"0": "fkData", fkData: 0, "1": "fkCalculated", fkCalculated: 1, "2": "fkLookup", fkLookup: 2, "3": "fkInternalCalc", fkInternalCalc: 3};
  this.$rtti.$Enum("TFieldKind",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TFieldKind});
  this.$rtti.$Set("TFieldKinds",{comptype: this.$rtti["TFieldKind"]});
  this.$rtti.$MethodVar("TFieldNotifyEvent",{procsig: rtl.newTIProcSig([["Sender",this.$rtti["TField"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TFieldGetTextEvent",{procsig: rtl.newTIProcSig([["Sender",this.$rtti["TField"]],["aText",rtl.string,1],["DisplayText",rtl.boolean]]), methodkind: 0});
  this.$rtti.$MethodVar("TFieldSetTextEvent",{procsig: rtl.newTIProcSig([["Sender",this.$rtti["TField"]],["aText",rtl.string,2]]), methodkind: 0});
  this.$rtti.$DynArray("TFieldChars",{eltype: rtl.char});
  this.TAutoRefreshFlag = {"0": "arNone", arNone: 0, "1": "arAutoInc", arAutoInc: 1, "2": "arDefault", arDefault: 2};
  this.$rtti.$Enum("TAutoRefreshFlag",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TAutoRefreshFlag});
  rtl.createClass(this,"TLookupList",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FList = null;
    };
    this.$final = function () {
      this.FList = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function () {
      this.FList = pas.Classes.TFPList.$create("Create");
      return this;
    };
    this.Destroy = function () {
      this.Clear();
      this.FList.$destroy("Destroy");
      pas.System.TObject.Destroy.call(this);
    };
    this.Add = function (AKey, AValue) {
      var LookupRec = null;
      LookupRec = pas.JS.New(["Key",AKey,"Value",AValue]);
      this.FList.Add(LookupRec);
    };
    this.Clear = function () {
      this.FList.Clear();
    };
    this.FirstKeyByValue = function (AValue) {
      var Result = undefined;
      var i = 0;
      for (var $l = 0, $end = this.FList.FCount - 1; $l <= $end; $l++) {
        i = $l;
        var $with = this.FList.Get(i);
        if ($with["Value"] == AValue) {
          Result = $with["Key"];
          return Result;
        };
      };
      Result = null;
      return Result;
    };
    this.ValueOfKey = function (AKey) {
      var $Self = this;
      var Result = undefined;
      function VarArraySameValues(VarArray1, VarArray2) {
        var Result = false;
        var i = 0;
        Result = true;
        if (rtl.length(VarArray1) !== rtl.length(VarArray2)) return Result;
        for (var $l = 0, $end = rtl.length(VarArray1); $l <= $end; $l++) {
          i = $l;
          if (VarArray1[i] != VarArray2[i]) {
            Result = false;
            return Result;
          };
        };
        return Result;
      };
      var I = 0;
      Result = null;
      if (pas.JS.isNull(AKey)) return Result;
      I = this.FList.FCount - 1;
      if (rtl.isArray(AKey)) {
        while ((I >= 0) && !VarArraySameValues(this.FList.Get(I)["Key"],AKey)) I -= 1}
       else while ((I >= 0) && (this.FList.Get(I)["Key"] != AKey)) I -= 1;
      if (I >= 0) Result = this.FList.Get(I)["Value"];
      return Result;
    };
    this.ValuesToStrings = function (AStrings) {
      var i = 0;
      var p = null;
      AStrings.Clear();
      for (var $l = 0, $end = this.FList.FCount - 1; $l <= $end; $l++) {
        i = $l;
        p = this.FList.Get(i);
        AStrings.AddObject("" + p["Value"],p);
      };
    };
  });
  rtl.createClass(this,"TField",pas.Classes.TComponent,function () {
    this.$init = function () {
      pas.Classes.TComponent.$init.call(this);
      this.FAlignment = 0;
      this.FAttributeSet = "";
      this.FAutoGenerateValue = 0;
      this.FCalculated = false;
      this.FConstraintErrorMessage = "";
      this.FCustomConstraint = "";
      this.FDataSet = null;
      this.FDataType = 0;
      this.FDefaultExpression = "";
      this.FDisplayLabel = "";
      this.FDisplayWidth = 0;
      this.FFieldDef = null;
      this.FFieldKind = 0;
      this.FFieldName = "";
      this.FFieldNo = 0;
      this.FFields = null;
      this.FHasConstraints = false;
      this.FImportedConstraint = "";
      this.FIsIndexField = false;
      this.FKeyFields = "";
      this.FLookupCache = false;
      this.FLookupDataSet = null;
      this.FLookupKeyfields = "";
      this.FLookupresultField = "";
      this.FLookupList = null;
      this.FOnChange = null;
      this.FOnGetText = null;
      this.FOnSetText = null;
      this.FOnValidate = null;
      this.FOrigin = "";
      this.FReadOnly = false;
      this.FRequired = false;
      this.FSize = 0;
      this.FValidChars = [];
      this.FValueBuffer = undefined;
      this.FValidating = false;
      this.FVisible = false;
      this.FProviderFlags = {};
    };
    this.$final = function () {
      this.FDataSet = undefined;
      this.FFieldDef = undefined;
      this.FFields = undefined;
      this.FLookupDataSet = undefined;
      this.FLookupList = undefined;
      this.FOnChange = undefined;
      this.FOnGetText = undefined;
      this.FOnSetText = undefined;
      this.FOnValidate = undefined;
      this.FValidChars = undefined;
      this.FProviderFlags = undefined;
      pas.Classes.TComponent.$final.call(this);
    };
    this.GetIndex = function () {
      var Result = 0;
      if (this.FDataSet != null) {
        Result = this.FDataSet.FFieldList.IndexOf(this)}
       else Result = -1;
      return Result;
    };
    this.GetLookup = function () {
      var Result = false;
      Result = this.FFieldKind === $mod.TFieldKind.fkLookup;
      return Result;
    };
    this.SetAlignment = function (AValue) {
      if (this.FAlignment !== AValue) {
        this.FAlignment = AValue;
        this.PropertyChanged(false);
      };
    };
    this.SetIndex = function (AValue) {
      if (this.FFields !== null) this.FFields.SetFieldIndex(this,AValue);
    };
    this.GetDisplayText = function () {
      var Result = "";
      Result = rtl.strSetLength(Result,0);
      if (this.FOnGetText != null) {
        this.FOnGetText(this,{get: function () {
            return Result;
          }, set: function (v) {
            Result = v;
          }},true)}
       else this.GetText({get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }},true);
      return Result;
    };
    this.GetEditText = function () {
      var Result = "";
      Result = rtl.strSetLength(Result,0);
      if (this.FOnGetText != null) {
        this.FOnGetText(this,{get: function () {
            return Result;
          }, set: function (v) {
            Result = v;
          }},false)}
       else this.GetText({get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }},false);
      return Result;
    };
    this.SetEditText = function (AValue) {
      if (this.FOnSetText != null) {
        this.FOnSetText(this,AValue)}
       else this.SetText(AValue);
    };
    this.SetDisplayLabel = function (AValue) {
      if (this.FDisplayLabel !== AValue) {
        this.FDisplayLabel = AValue;
        this.PropertyChanged(true);
      };
    };
    this.SetDisplayWidth = function (AValue) {
      if (this.FDisplayWidth !== AValue) {
        this.FDisplayWidth = AValue;
        this.PropertyChanged(true);
      };
    };
    this.GetDisplayWidth = function () {
      var Result = 0;
      if (this.FDisplayWidth === 0) {
        Result = this.GetDefaultWidth()}
       else Result = this.FDisplayWidth;
      return Result;
    };
    var ValueToLookupMap = [$mod.TFieldKind.fkData,$mod.TFieldKind.fkLookup];
    this.SetLookup = function (AValue) {
      this.FFieldKind = ValueToLookupMap[+AValue];
    };
    this.SetReadOnly = function (AValue) {
      if (this.FReadOnly !== AValue) {
        this.FReadOnly = AValue;
        this.PropertyChanged(true);
      };
    };
    this.SetVisible = function (AValue) {
      if (this.FVisible !== AValue) {
        this.FVisible = AValue;
        this.PropertyChanged(true);
      };
    };
    this.IsDisplayLabelStored = function () {
      var Result = false;
      Result = this.GetDisplayName() !== this.FFieldName;
      return Result;
    };
    this.IsDisplayWidthStored = function () {
      var Result = false;
      Result = this.FDisplayWidth !== 0;
      return Result;
    };
    this.GetLookupList = function () {
      var Result = null;
      if (!(this.FLookupList != null)) this.FLookupList = $mod.TLookupList.$create("Create$1");
      Result = this.FLookupList;
      return Result;
    };
    this.CalcLookupValue = function () {
      if ((this.FLookupDataSet != null) && this.FLookupDataSet.GetActive()) {
        this.SetAsJSValue(this.FLookupDataSet.Lookup(this.FLookupKeyfields,this.FDataSet.GetFieldValues(this.FKeyFields),this.FLookupresultField))}
       else this.SetAsJSValue(null);
    };
    this.RaiseAccessError = function (TypeName) {
      var E = null;
      E = this.AccessError(TypeName);
      throw E;
    };
    this.AccessError = function (TypeName) {
      var Result = null;
      Result = $mod.EDatabaseError.$create("CreateFmt",[rtl.getResStr(pas.DBConst,"SInvalidTypeConversion"),pas.System.VarRecs(18,TypeName,18,this.FFieldName)]);
      return Result;
    };
    this.CheckInactive = function () {
      if (this.FDataSet != null) this.FDataSet.CheckInactive();
    };
    this.CheckTypeSize = function (AValue) {
      if ((AValue !== 0) && !this.IsBlob()) $mod.DatabaseErrorFmt(rtl.getResStr(pas.DBConst,"SInvalidFieldSize"),pas.System.VarRecs(0,AValue));
    };
    this.Change = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Bind = function (Binding) {
      if (Binding && (this.FFieldKind === $mod.TFieldKind.fkLookup)) {
        if ((this.FLookupDataSet === null) || (this.FLookupKeyfields === "") || (this.FLookupresultField === "") || (this.FKeyFields === "")) $mod.DatabaseErrorFmt(rtl.getResStr(pas.DBConst,"SLookupInfoError"),pas.System.VarRecs(18,this.GetDisplayName()));
        this.FFields.CheckFieldNames(this.FKeyFields);
        this.FLookupDataSet.Open();
        this.FLookupDataSet.FFieldList.CheckFieldNames(this.FLookupKeyfields);
        this.FLookupDataSet.FieldByName(this.FLookupresultField);
        if (this.FLookupCache) this.RefreshLookupList();
      };
    };
    this.DataChanged = function () {
      this.FDataSet.DataEvent($mod.TDataEvent.deFieldChange,this);
    };
    this.GetAsBoolean = function () {
      var Result = false;
      this.RaiseAccessError($impl.SBoolean);
      Result = false;
      return Result;
    };
    this.GetAsBytes = function () {
      var Result = [];
      this.RaiseAccessError($impl.SBytes);
      Result = [];
      return Result;
    };
    this.GetAsLargeInt = function () {
      var Result = 0;
      this.RaiseAccessError($impl.SLargeInt);
      Result = 0;
      return Result;
    };
    this.GetAsDateTime = function () {
      var Result = 0.0;
      this.RaiseAccessError($impl.SDateTime);
      Result = 0.0;
      return Result;
    };
    this.GetAsFloat = function () {
      var Result = 0.0;
      this.RaiseAccessError($impl.SDateTime);
      Result = 0.0;
      return Result;
    };
    this.GetAsLongint = function () {
      var Result = 0;
      Result = this.GetAsInteger();
      return Result;
    };
    this.GetAsInteger = function () {
      var Result = 0;
      this.RaiseAccessError($impl.SInteger);
      Result = 0;
      return Result;
    };
    this.GetAsJSValue = function () {
      var Result = undefined;
      Result = this.GetData();
      return Result;
    };
    this.GetOldValue = function () {
      var Result = undefined;
      var SaveState = 0;
      SaveState = this.FDataSet.FState;
      try {
        this.FDataSet.SetTempState($mod.TDataSetState.dsOldValue);
        Result = this.GetAsJSValue();
      } finally {
        this.FDataSet.RestoreState(SaveState);
      };
      return Result;
    };
    this.GetAsString = function () {
      var Result = "";
      Result = this.GetClassDesc();
      return Result;
    };
    this.GetCanModify = function () {
      var Result = false;
      Result = !this.FReadOnly;
      if (Result) {
        Result = this.FFieldKind in rtl.createSet($mod.TFieldKind.fkData,$mod.TFieldKind.fkInternalCalc);
        if (Result) {
          Result = (this.FDataSet != null) && this.FDataSet.GetActive();
          if (Result) Result = this.FDataSet.GetCanModify();
        };
      };
      return Result;
    };
    this.GetClassDesc = function () {
      var Result = "";
      var ClassN = "";
      ClassN = pas.System.Copy(this.$classname,2,pas.System.Pos("Field",this.$classname) - 2);
      if (this.GetIsNull()) {
        Result = "(" + pas.SysUtils.LowerCase(ClassN) + ")"}
       else Result = "(" + pas.SysUtils.UpperCase(ClassN) + ")";
      return Result;
    };
    this.GetDataSize = function () {
      var Result = 0;
      Result = 0;
      return Result;
    };
    this.GetDefaultWidth = function () {
      var Result = 0;
      Result = 10;
      return Result;
    };
    this.GetDisplayName = function () {
      var Result = "";
      if (this.FDisplayLabel !== "") {
        Result = this.FDisplayLabel}
       else Result = this.FFieldName;
      return Result;
    };
    this.GetCurValue = function () {
      var Result = undefined;
      var SaveState = 0;
      SaveState = this.FDataSet.FState;
      try {
        this.FDataSet.SetTempState($mod.TDataSetState.dsCurValue);
        Result = this.GetAsJSValue();
      } finally {
        this.FDataSet.RestoreState(SaveState);
      };
      return Result;
    };
    this.GetNewValue = function () {
      var Result = undefined;
      var SaveState = 0;
      SaveState = this.FDataSet.FState;
      try {
        this.FDataSet.SetTempState($mod.TDataSetState.dsNewValue);
        Result = this.GetAsJSValue();
      } finally {
        this.FDataSet.RestoreState(SaveState);
      };
      return Result;
    };
    this.GetIsNull = function () {
      var Result = false;
      Result = pas.JS.isNull(this.GetData());
      return Result;
    };
    this.GetText = function (AText, ADisplayText) {
      AText.set(this.GetAsString());
    };
    this.Notification = function (AComponent, Operation) {
      pas.Classes.TComponent.Notification.call(this,AComponent,Operation);
      if ((Operation === pas.Classes.TOperation.opRemove) && (AComponent === this.FLookupDataSet)) this.FLookupDataSet = null;
    };
    this.PropertyChanged = function (LayoutAffected) {
      if ((this.FDataSet !== null) && this.FDataSet.GetActive()) if (LayoutAffected) {
        this.FDataSet.DataEvent($mod.TDataEvent.deLayoutChange,0)}
       else this.FDataSet.DataEvent($mod.TDataEvent.deDataSetChange,0);
    };
    this.SetAsBoolean = function (AValue) {
      this.RaiseAccessError($impl.SBoolean);
    };
    this.SetAsDateTime = function (AValue) {
      this.RaiseAccessError($impl.SDateTime);
    };
    this.SetAsFloat = function (AValue) {
      this.RaiseAccessError($impl.SFloat);
    };
    this.SetAsLongint = function (AValue) {
      this.SetAsInteger(AValue);
    };
    this.SetAsInteger = function (AValue) {
      this.RaiseAccessError($impl.SInteger);
    };
    this.SetAsLargeInt = function (AValue) {
      this.RaiseAccessError($impl.SLargeInt);
    };
    this.SetAsJSValue = function (AValue) {
      if (pas.JS.isNull(AValue)) {
        this.Clear()}
       else try {
        this.SetVarValue(AValue);
      } catch ($e) {
        if (pas.SysUtils.EVariantError.isPrototypeOf($e)) {
          $mod.DatabaseErrorFmt(rtl.getResStr(pas.DBConst,"SFieldValueError"),pas.System.VarRecs(18,this.GetDisplayName()))}
         else throw $e
      };
    };
    this.SetAsString = function (AValue) {
      this.RaiseAccessError($impl.SString);
    };
    this.SetDataset = function (AValue) {
      if (AValue === this.FDataSet) return;
      if (this.FDataSet != null) {
        this.FDataSet.CheckInactive();
        this.FDataSet.FFieldList.Remove(this);
      };
      if (AValue != null) {
        AValue.CheckInactive();
        AValue.FFieldList.Add(this);
      };
      this.FDataSet = AValue;
    };
    this.SetDataType = function (AValue) {
      this.FDataType = AValue;
    };
    this.SetNewValue = function (AValue) {
      var SaveState = 0;
      SaveState = this.FDataSet.FState;
      try {
        this.FDataSet.SetTempState($mod.TDataSetState.dsNewValue);
        this.SetAsJSValue(AValue);
      } finally {
        this.FDataSet.RestoreState(SaveState);
      };
    };
    this.SetSize = function (AValue) {
      this.CheckInactive();
      this.$class.CheckTypeSize(AValue);
      this.FSize = AValue;
    };
    this.SetText = function (AValue) {
      this.SetAsString(AValue);
    };
    this.SetVarValue = function (AValue) {
      this.RaiseAccessError($impl.SJSValue);
    };
    this.SetAsBytes = function (AValue) {
      this.RaiseAccessError($impl.SBytes);
    };
    this.DefineProperties = function (Filer) {
      var $Self = this;
      function IgnoreReadString(Reader) {
        Reader.ReadString();
      };
      function IgnoreReadBoolean(Reader) {
        Reader.ReadBoolean();
      };
      function IgnoreWrite(Writer) {
        if (Writer === null) ;
      };
      Filer.DefineProperty("AttributeSet",IgnoreReadString,IgnoreWrite,false);
      Filer.DefineProperty("Calculated",IgnoreReadBoolean,IgnoreWrite,false);
      Filer.DefineProperty("Lookup",IgnoreReadBoolean,IgnoreWrite,false);
    };
    this.Create$1 = function (AOwner) {
      pas.Classes.TComponent.Create$1.call(this,AOwner);
      this.FVisible = true;
      this.FValidChars = rtl.arraySetLength(this.FValidChars,"\x00",255);
      this.FProviderFlags = rtl.createSet($mod.TProviderFlag.pfInUpdate,$mod.TProviderFlag.pfInWhere);
      return this;
    };
    this.Destroy = function () {
      if (this.FDataSet != null) {
        this.FDataSet.SetActive(false);
        if (this.FFields != null) this.FFields.Remove(this);
      };
      rtl.free(this,"FLookupList");
      pas.Classes.TComponent.Destroy.call(this);
    };
    this.GetParentComponent = function () {
      var Result = null;
      Result = this.FDataSet;
      return Result;
    };
    this.SetParentComponent = function (Value) {
      this.SetDataset(rtl.as(Value,$mod.TDataSet));
    };
    this.HasParent = function () {
      var Result = false;
      Result = true;
      return Result;
    };
    this.Assign = function (Source) {
      if (Source === null) {
        this.Clear()}
       else if ($mod.TField.isPrototypeOf(Source)) {
        this.SetAsJSValue(Source.GetAsJSValue());
      } else pas.Classes.TPersistent.Assign.call(this,Source);
    };
    this.AssignValue = function (AValue) {
      var $Self = this;
      function error() {
        $mod.DatabaseErrorFmt(rtl.getResStr(pas.DBConst,"SFieldValueError"),pas.System.VarRecs(18,$Self.GetDisplayName()));
      };
      var $tmp = pas.JS.GetValueType(AValue);
      if ($tmp === pas.JS.TJSValueType.jvtNull) {
        this.Clear()}
       else if ($tmp === pas.JS.TJSValueType.jvtBoolean) {
        this.SetAsBoolean(!(AValue == false))}
       else if ($tmp === pas.JS.TJSValueType.jvtInteger) {
        this.SetAsLargeInt(rtl.trunc(AValue))}
       else if ($tmp === pas.JS.TJSValueType.jvtFloat) {
        this.SetAsFloat(rtl.getNumber(AValue))}
       else if ($tmp === pas.JS.TJSValueType.jvtString) {
        this.SetAsString("" + AValue)}
       else if ($tmp === pas.JS.TJSValueType.jvtArray) {
        this.SetAsBytes(AValue)}
       else {
        error();
      };
    };
    this.Clear = function () {
      this.SetData(null);
    };
    this.FocusControl = function () {
      var Field1 = null;
      Field1 = this;
      this.FDataSet.DataEvent($mod.TDataEvent.deFocusControl,Field1);
    };
    this.GetData = function () {
      var Result = undefined;
      if (this.FDataSet === null) $mod.DatabaseErrorFmt(rtl.getResStr(pas.DBConst,"SNoDataset"),pas.System.VarRecs(18,this.FFieldName));
      if (this.FValidating) {
        Result = this.FValueBuffer}
       else {
        Result = this.FDataSet.GetFieldData(this);
        if (pas.JS.isUndefined(Result)) Result = null;
      };
      return Result;
    };
    this.IsBlob = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    this.IsValidChar = function (InputChar) {
      var Result = false;
      Result = pas.SysUtils.CharInSet(InputChar,this.FValidChars);
      return Result;
    };
    this.RefreshLookupList = function () {
      var tmpActive = false;
      if (!(this.FLookupDataSet != null) || (this.FLookupKeyfields.length === 0) || (this.FLookupresultField.length === 0) || (this.FKeyFields.length === 0)) return;
      tmpActive = this.FLookupDataSet.GetActive();
      try {
        this.FLookupDataSet.SetActive(true);
        this.FFields.CheckFieldNames(this.FKeyFields);
        this.FLookupDataSet.FFieldList.CheckFieldNames(this.FLookupKeyfields);
        this.FLookupDataSet.FieldByName(this.FLookupresultField);
        this.GetLookupList().Clear();
        this.FLookupDataSet.DisableControls();
        try {
          this.FLookupDataSet.First();
          while (!this.FLookupDataSet.GetEOF()) {
            this.FLookupDataSet.Next();
          };
        } finally {
          this.FLookupDataSet.EnableControls();
        };
      } finally {
        this.FLookupDataSet.SetActive(tmpActive);
      };
    };
    this.SetData = function (Buffer) {
      if (!(this.FDataSet != null)) $mod.DatabaseErrorFmt(rtl.getResStr(pas.DBConst,"SNoDataset"),pas.System.VarRecs(18,this.FFieldName));
      this.FDataSet.SetFieldData(this,Buffer);
    };
    this.SetFieldType = function (AValue) {
    };
    this.Validate = function (Buffer) {
      if (this.FOnValidate != null) {
        this.FValueBuffer = Buffer;
        this.FValidating = true;
        try {
          this.FOnValidate(this);
        } finally {
          this.FValidating = false;
        };
      };
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Alignment",2,pas.Classes.$rtti["TAlignment"],"FAlignment","SetAlignment",4,{Default: pas.Classes.TAlignment.taLeftJustify});
    $r.addProperty("CustomConstraint",0,rtl.string,"FCustomConstraint","FCustomConstraint");
    $r.addProperty("ConstraintErrorMessage",0,rtl.string,"FConstraintErrorMessage","FConstraintErrorMessage");
    $r.addProperty("DefaultExpression",0,rtl.string,"FDefaultExpression","FDefaultExpression");
    $r.addProperty("DisplayLabel",15,rtl.string,"GetDisplayName","SetDisplayLabel",4,{stored: "IsDisplayLabelStored"});
    $r.addProperty("DisplayWidth",15,rtl.longint,"GetDisplayWidth","SetDisplayWidth",4,{stored: "IsDisplayWidthStored"});
    $r.addProperty("FieldKind",0,$mod.$rtti["TFieldKind"],"FFieldKind","FFieldKind");
    $r.addProperty("FieldName",0,rtl.string,"FFieldName","FFieldName");
    $r.addProperty("HasConstraints",0,rtl.boolean,"FHasConstraints","");
    $r.addProperty("Index",3,rtl.longint,"GetIndex","SetIndex");
    $r.addProperty("ImportedConstraint",0,rtl.string,"FImportedConstraint","FImportedConstraint");
    $r.addProperty("KeyFields",0,rtl.string,"FKeyFields","FKeyFields");
    $r.addProperty("LookupCache",0,rtl.boolean,"FLookupCache","FLookupCache");
    $r.addProperty("LookupDataSet",0,$mod.$rtti["TDataSet"],"FLookupDataSet","FLookupDataSet");
    $r.addProperty("LookupKeyFields",0,rtl.string,"FLookupKeyfields","FLookupKeyfields");
    $r.addProperty("LookupResultField",0,rtl.string,"FLookupresultField","FLookupresultField");
    $r.addProperty("Origin",0,rtl.string,"FOrigin","FOrigin");
    $r.addProperty("ProviderFlags",0,$mod.$rtti["TProviderFlags"],"FProviderFlags","FProviderFlags");
    $r.addProperty("ReadOnly",2,rtl.boolean,"FReadOnly","SetReadOnly");
    $r.addProperty("Required",0,rtl.boolean,"FRequired","FRequired");
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("OnChange",0,$mod.$rtti["TFieldNotifyEvent"],"FOnChange","FOnChange");
    $r.addProperty("OnGetText",0,$mod.$rtti["TFieldGetTextEvent"],"FOnGetText","FOnGetText");
    $r.addProperty("OnSetText",0,$mod.$rtti["TFieldSetTextEvent"],"FOnSetText","FOnSetText");
    $r.addProperty("OnValidate",0,$mod.$rtti["TFieldNotifyEvent"],"FOnValidate","FOnValidate");
  });
  rtl.createClass(this,"TStringField",this.TField,function () {
    this.$init = function () {
      $mod.TField.$init.call(this);
      this.FFixedChar = false;
      this.FTransliterate = false;
    };
    this.CheckTypeSize = function (AValue) {
      if (AValue < 0) $mod.DatabaseErrorFmt(rtl.getResStr(pas.DBConst,"SInvalidFieldSize"),pas.System.VarRecs(0,AValue));
    };
    this.GetAsBoolean = function () {
      var Result = false;
      var S = "";
      S = this.GetAsString();
      Result = (S.length > 0) && (pas.System.upcase(S.charAt(0)).charCodeAt() in rtl.createSet(84,$mod.YesNoChars[1].charCodeAt()));
      return Result;
    };
    this.GetAsDateTime = function () {
      var Result = 0.0;
      Result = pas.SysUtils.StrToDateTime(this.GetAsString());
      return Result;
    };
    this.GetAsFloat = function () {
      var Result = 0.0;
      Result = pas.SysUtils.StrToFloat(this.GetAsString());
      return Result;
    };
    this.GetAsInteger = function () {
      var Result = 0;
      Result = pas.SysUtils.StrToInt(this.GetAsString());
      return Result;
    };
    this.GetAsLargeInt = function () {
      var Result = 0;
      Result = pas.SysUtils.StrToInt64(this.GetAsString());
      return Result;
    };
    this.GetAsString = function () {
      var Result = "";
      var V = undefined;
      V = this.GetData();
      if (rtl.isString(V)) {
        Result = "" + V}
       else Result = "";
      return Result;
    };
    this.GetAsJSValue = function () {
      var Result = undefined;
      Result = this.GetData();
      return Result;
    };
    this.GetDefaultWidth = function () {
      var Result = 0;
      Result = this.FSize;
      return Result;
    };
    this.GetText = function (AText, ADisplayText) {
      AText.set(this.GetAsString());
    };
    this.SetAsBoolean = function (AValue) {
      if (AValue) {
        this.SetAsString("T")}
       else this.SetAsString("F");
    };
    this.SetAsDateTime = function (AValue) {
      this.SetAsString(pas.SysUtils.DateTimeToStr(AValue,false));
    };
    this.SetAsFloat = function (AValue) {
      this.SetAsString(pas.SysUtils.FloatToStr(AValue));
    };
    this.SetAsInteger = function (AValue) {
      this.SetAsString(pas.SysUtils.IntToStr(AValue));
    };
    this.SetAsLargeInt = function (AValue) {
      this.SetAsString(pas.SysUtils.IntToStr(AValue));
    };
    this.SetAsString = function (AValue) {
      this.SetData(AValue);
    };
    this.SetVarValue = function (AValue) {
      if (rtl.isString(AValue)) {
        this.SetAsString("" + AValue)}
       else this.RaiseAccessError(rtl.getResStr(pas.DBConst,"SFieldValueError"));
    };
    this.Create$1 = function (AOwner) {
      $mod.TField.Create$1.call(this,AOwner);
      this.SetDataType($mod.TFieldType.ftString);
      this.FFixedChar = false;
      this.FTransliterate = false;
      this.FSize = 20;
      return this;
    };
    this.SetFieldType = function (AValue) {
      if (AValue in rtl.createSet($mod.TFieldType.ftString,$mod.TFieldType.ftFixedChar,$mod.TFieldType.ftWideString)) this.SetDataType(AValue);
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Size",2,rtl.longint,"FSize","SetSize",4,{Default: 20});
  });
  rtl.createClass(this,"TNumericField",this.TField,function () {
    this.$init = function () {
      $mod.TField.$init.call(this);
      this.FDisplayFormat = "";
      this.FEditFormat = "";
    };
    this.CheckTypeSize = function (AValue) {
      if (AValue > 16) $mod.DatabaseErrorFmt(rtl.getResStr(pas.DBConst,"SInvalidFieldSize"),pas.System.VarRecs(0,AValue));
    };
    this.RangeError = function (AValue, Min, Max) {
      $mod.DatabaseErrorFmt(rtl.getResStr(pas.DBConst,"SRangeError"),pas.System.VarRecs(3,AValue,3,Min,3,Max,18,this.FFieldName));
    };
    this.SetDisplayFormat = function (AValue) {
      if (this.FDisplayFormat !== AValue) {
        this.FDisplayFormat = AValue;
        this.PropertyChanged(true);
      };
    };
    this.SetEditFormat = function (AValue) {
      if (this.FEditFormat !== AValue) {
        this.FEditFormat = AValue;
        this.PropertyChanged(true);
      };
    };
    this.GetAsBoolean = function () {
      var Result = false;
      Result = this.GetAsInteger() !== 0;
      return Result;
    };
    this.SetAsBoolean = function (AValue) {
      this.SetAsInteger(AValue + 0);
    };
    this.Create$1 = function (AOwner) {
      $mod.TField.Create$1.call(this,AOwner);
      this.SetAlignment(pas.Classes.TAlignment.taRightJustify);
      return this;
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Alignment",2,pas.Classes.$rtti["TAlignment"],"FAlignment","SetAlignment",4,{Default: pas.Classes.TAlignment.taRightJustify});
    $r.addProperty("DisplayFormat",2,rtl.string,"FDisplayFormat","SetDisplayFormat");
    $r.addProperty("EditFormat",2,rtl.string,"FEditFormat","SetEditFormat");
  });
  rtl.createClass(this,"TIntegerField",this.TNumericField,function () {
    this.$init = function () {
      $mod.TNumericField.$init.call(this);
      this.FMinValue = 0;
      this.FMaxValue = 0;
      this.FMinRange = 0;
      this.FMaxRange = 0;
    };
    this.SetMinValue = function (AValue) {
      if ((AValue >= this.FMinRange) && (AValue <= this.FMaxRange)) {
        this.FMinValue = AValue}
       else this.RangeError(AValue,this.FMinRange,this.FMaxRange);
    };
    this.SetMaxValue = function (AValue) {
      if ((AValue >= this.FMinRange) && (AValue <= this.FMaxRange)) {
        this.FMaxValue = AValue}
       else this.RangeError(AValue,this.FMinRange,this.FMaxRange);
    };
    this.GetAsFloat = function () {
      var Result = 0.0;
      Result = this.GetAsInteger();
      return Result;
    };
    this.GetAsInteger = function () {
      var Result = 0;
      if (!this.GetValue({get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }})) Result = 0;
      return Result;
    };
    this.GetAsString = function () {
      var Result = "";
      var L = 0;
      if (this.GetValue({get: function () {
          return L;
        }, set: function (v) {
          L = v;
        }})) {
        Result = pas.SysUtils.IntToStr(L)}
       else Result = "";
      return Result;
    };
    this.GetAsJSValue = function () {
      var Result = undefined;
      var L = 0;
      if (this.GetValue({get: function () {
          return L;
        }, set: function (v) {
          L = v;
        }})) {
        Result = L}
       else Result = null;
      return Result;
    };
    this.GetText = function (AText, ADisplayText) {
      var l = 0;
      var fmt = "";
      AText.set("");
      if (!this.GetValue({get: function () {
          return l;
        }, set: function (v) {
          l = v;
        }})) return;
      if (ADisplayText || (this.FEditFormat === "")) {
        fmt = this.FDisplayFormat}
       else fmt = this.FEditFormat;
      if (fmt.length !== 0) {
        AText.set(pas.SysUtils.FormatFloat(fmt,l))}
       else AText.set("" + l);
    };
    this.GetValue = function (AValue) {
      var Result = false;
      var V = undefined;
      V = this.GetData();
      Result = pas.JS.isInteger(V);
      if (Result) AValue.set(rtl.trunc(V));
      return Result;
    };
    this.SetAsFloat = function (AValue) {
      this.SetAsInteger(Math.round(AValue));
    };
    this.SetAsInteger = function (AValue) {
      if (this.CheckRange(AValue)) {
        this.SetData(AValue)}
       else if ((this.FMinValue !== 0) || (this.FMaxValue !== 0)) {
        this.RangeError(AValue,this.FMinValue,this.FMaxValue)}
       else this.RangeError(AValue,this.FMinRange,this.FMaxRange);
    };
    this.SetAsString = function (AValue) {
      var L = 0;
      var Code = 0;
      if (AValue.length === 0) {
        this.Clear()}
       else {
        pas.System.val$6(AValue,{get: function () {
            return L;
          }, set: function (v) {
            L = v;
          }},{get: function () {
            return Code;
          }, set: function (v) {
            Code = v;
          }});
        if (Code === 0) {
          this.SetAsInteger(L)}
         else $mod.DatabaseErrorFmt(rtl.getResStr(pas.DBConst,"SNotAninteger"),pas.System.VarRecs(18,AValue));
      };
    };
    this.SetVarValue = function (AValue) {
      if (pas.JS.isInteger(AValue)) {
        this.SetAsInteger(rtl.trunc(AValue))}
       else this.RaiseAccessError($impl.SInteger);
    };
    this.GetAsLargeInt = function () {
      var Result = 0;
      Result = this.GetAsInteger();
      return Result;
    };
    this.SetAsLargeInt = function (AValue) {
      if ((AValue >= this.FMinRange) && (AValue <= this.FMaxRange)) {
        this.SetAsInteger(AValue)}
       else this.RangeError(AValue,this.FMinRange,this.FMaxRange);
    };
    this.Create$1 = function (AOwner) {
      $mod.TNumericField.Create$1.call(this,AOwner);
      this.SetDataType($mod.TFieldType.ftInteger);
      this.FMinRange = -2147483648;
      this.FMaxRange = 2147483647;
      return this;
    };
    this.CheckRange = function (AValue) {
      var Result = false;
      if ((this.FMinValue !== 0) || (this.FMaxValue !== 0)) {
        Result = (AValue >= this.FMinValue) && (AValue <= this.FMaxValue)}
       else Result = (AValue >= this.FMinRange) && (AValue <= this.FMaxRange);
      return Result;
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("MaxValue",2,rtl.longint,"FMaxValue","SetMaxValue",4,{Default: 0});
    $r.addProperty("MinValue",2,rtl.longint,"FMinValue","SetMinValue",4,{Default: 0});
  });
  rtl.createClass(this,"TSmallIntField",this.TIntegerField,function () {
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TWordField",this.TIntegerField,function () {
    this.SetAsWord = function (AValue) {
      this.SetAsInteger(AValue);
    };
    this.GetAsWord = function () {
      var Result = 0;
      var w = 0;
      if (!this.GetValue({get: function () {
          return w;
        }, set: function (v) {
          w = v;
        }})) {
        Result = 0}
       else Result = w;
      return Result;
    };
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TLargeintField",this.TNumericField,function () {
    this.$init = function () {
      $mod.TNumericField.$init.call(this);
      this.FMinValue = 0;
      this.FMaxValue = 0;
      this.FMinRange = 0;
      this.FMaxRange = 0;
    };
    this.SetMinValue = function (AValue) {
      if ((AValue >= this.FMinRange) && (AValue <= this.FMaxRange)) {
        this.FMinValue = AValue}
       else this.RangeError(AValue,this.FMinRange,this.FMaxRange);
    };
    this.SetMaxValue = function (AValue) {
      if ((AValue >= this.FMinRange) && (AValue <= this.FMaxRange)) {
        this.FMaxValue = AValue}
       else this.RangeError(AValue,this.FMinRange,this.FMaxRange);
    };
    this.GetAsFloat = function () {
      var Result = 0.0;
      Result = this.GetAsLargeInt();
      return Result;
    };
    this.GetAsInteger = function () {
      var Result = 0;
      Result = this.GetAsLargeInt();
      return Result;
    };
    this.GetAsLargeInt = function () {
      var Result = 0;
      if (!this.GetValue({get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }})) Result = 0;
      return Result;
    };
    this.GetAsString = function () {
      var Result = "";
      var L = 0;
      if (this.GetValue({get: function () {
          return L;
        }, set: function (v) {
          L = v;
        }})) {
        Result = pas.SysUtils.IntToStr(L)}
       else Result = "";
      return Result;
    };
    this.GetAsJSValue = function () {
      var Result = undefined;
      var L = 0;
      if (this.GetValue({get: function () {
          return L;
        }, set: function (v) {
          L = v;
        }})) {
        Result = L}
       else Result = null;
      return Result;
    };
    this.GetText = function (AText, ADisplayText) {
      var l = 0;
      var fmt = "";
      AText.set("");
      if (!this.GetValue({get: function () {
          return l;
        }, set: function (v) {
          l = v;
        }})) return;
      if (ADisplayText || (this.FEditFormat === "")) {
        fmt = this.FDisplayFormat}
       else fmt = this.FEditFormat;
      if (fmt.length !== 0) {
        AText.set(pas.SysUtils.FormatFloat(fmt,l))}
       else AText.set("" + l);
    };
    this.GetValue = function (AValue) {
      var Result = false;
      var P = undefined;
      P = this.GetData();
      Result = pas.JS.isInteger(P);
      if (Result) AValue.set(rtl.trunc(P));
      return Result;
    };
    this.SetAsFloat = function (AValue) {
      this.SetAsLargeInt(Math.round(AValue));
    };
    this.SetAsInteger = function (AValue) {
      this.SetAsLargeInt(AValue);
    };
    this.SetAsLargeInt = function (AValue) {
      if (this.CheckRange(AValue)) {
        this.SetData(AValue)}
       else this.RangeError(AValue,this.FMinValue,this.FMaxValue);
    };
    this.SetAsString = function (AValue) {
      var L = 0;
      var code = 0;
      if (AValue.length === 0) {
        this.Clear()}
       else {
        pas.System.val(AValue,{get: function () {
            return L;
          }, set: function (v) {
            L = v;
          }},{get: function () {
            return code;
          }, set: function (v) {
            code = v;
          }});
        if (code === 0) {
          this.SetAsLargeInt(L)}
         else $mod.DatabaseErrorFmt(rtl.getResStr(pas.DBConst,"SNotAninteger"),pas.System.VarRecs(18,AValue));
      };
    };
    this.SetVarValue = function (AValue) {
      if (pas.JS.isInteger(AValue)) {
        this.SetAsLargeInt(rtl.trunc(AValue))}
       else this.RaiseAccessError($impl.SLargeInt);
    };
    this.Create$1 = function (AOwner) {
      $mod.TNumericField.Create$1.call(this,AOwner);
      this.SetDataType($mod.TFieldType.ftLargeint);
      this.FMinRange = -9007199254740991;
      this.FMaxRange = 9007199254740991;
      return this;
    };
    this.CheckRange = function (AValue) {
      var Result = false;
      if ((this.FMinValue !== 0) || (this.FMaxValue !== 0)) {
        Result = (AValue >= this.FMinValue) && (AValue <= this.FMaxValue)}
       else Result = (AValue >= this.FMinRange) && (AValue <= this.FMaxRange);
      return Result;
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("MaxValue",2,rtl.nativeint,"FMaxValue","SetMaxValue",4,{Default: 0});
    $r.addProperty("MinValue",2,rtl.nativeint,"FMinValue","SetMinValue",4,{Default: 0});
  });
  rtl.createClass(this,"TAutoIncField",this.TIntegerField,function () {
    this.SetAsInteger = function (AValue) {
      $mod.TIntegerField.SetAsInteger.apply(this,arguments);
    };
    this.Create$1 = function (AOwner) {
      $mod.TIntegerField.Create$1.call(this,AOwner);
      this.SetDataType($mod.TFieldType.ftAutoInc);
      return this;
    };
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TFloatField",this.TNumericField,function () {
    this.$init = function () {
      $mod.TNumericField.$init.call(this);
      this.FCurrency = false;
      this.FMaxValue = 0.0;
      this.FMinValue = 0.0;
      this.FPrecision = 0;
    };
    this.SetCurrency = function (AValue) {
      if (this.FCurrency === AValue) return;
      this.FCurrency = AValue;
    };
    this.SetPrecision = function (AValue) {
      if ((AValue === -1) || (AValue > 1)) {
        this.FPrecision = AValue}
       else this.FPrecision = 2;
    };
    this.GetAsFloat = function () {
      var Result = 0.0;
      var P = undefined;
      P = this.GetData();
      if (rtl.isNumber(P)) {
        Result = rtl.getNumber(P)}
       else Result = 0.0;
      return Result;
    };
    this.GetAsLargeInt = function () {
      var Result = 0;
      Result = Math.round(this.GetAsFloat());
      return Result;
    };
    this.GetAsInteger = function () {
      var Result = 0;
      Result = Math.round(this.GetAsFloat());
      return Result;
    };
    this.GetAsJSValue = function () {
      var Result = undefined;
      var P = undefined;
      P = this.GetData();
      if (rtl.isNumber(P)) {
        Result = P}
       else Result = null;
      return Result;
    };
    this.GetAsString = function () {
      var Result = "";
      var P = undefined;
      P = this.GetData();
      if (rtl.isNumber(P)) {
        Result = pas.SysUtils.FloatToStr(rtl.getNumber(P))}
       else Result = "";
      return Result;
    };
    this.GetText = function (AText, ADisplayText) {
      var fmt = "";
      var E = 0.0;
      var Digits = 0;
      var ff = 0;
      var P = undefined;
      AText.set("");
      P = this.GetData();
      if (!rtl.isNumber(P)) return;
      E = rtl.getNumber(P);
      if (ADisplayText || (this.FEditFormat.length === 0)) {
        fmt = this.FDisplayFormat}
       else fmt = this.FEditFormat;
      Digits = 0;
      if (!this.FCurrency) {
        ff = pas.SysUtils.TFloatFormat.ffGeneral}
       else {
        Digits = 2;
        ff = pas.SysUtils.TFloatFormat.ffFixed;
      };
      if (fmt !== "") {
        AText.set(pas.SysUtils.FormatFloat(fmt,E))}
       else AText.set(pas.SysUtils.FloatToStrF(E,ff,this.FPrecision,Digits));
    };
    this.SetAsFloat = function (AValue) {
      if (this.CheckRange(AValue)) {
        this.SetData(AValue)}
       else this.RangeError(AValue,this.FMinValue,this.FMaxValue);
    };
    this.SetAsLargeInt = function (AValue) {
      this.SetAsFloat(AValue);
    };
    this.SetAsInteger = function (AValue) {
      this.SetAsFloat(AValue);
    };
    this.SetAsString = function (AValue) {
      var f = 0.0;
      if (AValue === "") {
        this.Clear()}
       else {
        if (!pas.SysUtils.TryStrToFloat$2(AValue,{get: function () {
            return f;
          }, set: function (v) {
            f = v;
          }})) $mod.DatabaseErrorFmt(rtl.getResStr(pas.DBConst,"SNotAFloat"),pas.System.VarRecs(18,AValue));
        this.SetAsFloat(f);
      };
    };
    this.SetVarValue = function (AValue) {
      if (rtl.isNumber(AValue)) {
        this.SetAsFloat(rtl.getNumber(AValue))}
       else this.RaiseAccessError("Float");
    };
    this.Create$1 = function (AOwner) {
      $mod.TNumericField.Create$1.call(this,AOwner);
      this.SetDataType($mod.TFieldType.ftFloat);
      this.FPrecision = 15;
      return this;
    };
    this.CheckRange = function (AValue) {
      var Result = false;
      if ((this.FMinValue !== 0) || (this.FMaxValue !== 0)) {
        Result = (AValue >= this.FMinValue) && (AValue <= this.FMaxValue)}
       else Result = true;
      return Result;
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Currency",2,rtl.boolean,"FCurrency","SetCurrency",4,{Default: false});
    $r.addProperty("MaxValue",0,rtl.double,"FMaxValue","FMaxValue");
    $r.addProperty("MinValue",0,rtl.double,"FMinValue","FMinValue");
    $r.addProperty("Precision",2,rtl.longint,"FPrecision","SetPrecision",4,{Default: 15});
  });
  rtl.createClass(this,"TBooleanField",this.TField,function () {
    this.FDisplays$a$clone = function (a) {
      var b = [];
      b.length = 2;
      for (var c = 0; c < 2; c++) b[c] = a[c].slice(0);
      return b;
    };
    this.$init = function () {
      $mod.TField.$init.call(this);
      this.FDisplayValues = "";
      this.FDisplays = rtl.arraySetLength(null,"",2,2);
    };
    this.$final = function () {
      this.FDisplays = undefined;
      $mod.TField.$final.call(this);
    };
    this.SetDisplayValues = function (AValue) {
      var I = 0;
      if (this.FDisplayValues !== AValue) {
        I = pas.System.Pos(";",AValue);
        if ((I < 2) || (I === AValue.length)) $mod.DatabaseErrorFmt(rtl.getResStr(pas.DBConst,"SInvalidDisplayValues"),pas.System.VarRecs(18,AValue));
        this.FDisplayValues = AValue;
        this.FDisplays[0][1] = pas.System.Copy(AValue,1,I - 1);
        this.FDisplays[1][1] = pas.SysUtils.UpperCase(this.FDisplays[0][1]);
        this.FDisplays[0][0] = pas.System.Copy(AValue,I + 1,AValue.length - I);
        this.FDisplays[1][0] = pas.SysUtils.UpperCase(this.FDisplays[0][0]);
        this.PropertyChanged(true);
      };
    };
    this.GetAsBoolean = function () {
      var Result = false;
      var P = undefined;
      P = this.GetData();
      if (pas.JS.isBoolean(P)) {
        Result = !(P == false)}
       else Result = false;
      return Result;
    };
    this.GetAsString = function () {
      var Result = "";
      var P = undefined;
      P = this.GetData();
      if (pas.JS.isBoolean(P)) {
        Result = this.FDisplays[0][+!(P == false)]}
       else Result = "";
      return Result;
    };
    this.GetAsJSValue = function () {
      var Result = undefined;
      var P = undefined;
      P = this.GetData();
      if (pas.JS.isBoolean(P)) {
        Result = !(P == false)}
       else Result = null;
      return Result;
    };
    this.GetAsInteger = function () {
      var Result = 0;
      Result = this.GetAsBoolean() + 0;
      return Result;
    };
    this.GetDefaultWidth = function () {
      var Result = 0;
      Result = this.FDisplays[0][0].length;
      if (Result < this.FDisplays[0][1].length) Result = this.FDisplays[0][1].length;
      return Result;
    };
    this.SetAsBoolean = function (AValue) {
      this.SetData(AValue);
    };
    this.SetAsString = function (AValue) {
      var Temp = "";
      Temp = pas.SysUtils.UpperCase(AValue);
      if (Temp === "") {
        this.Clear()}
       else if (pas.System.Pos(Temp,this.FDisplays[1][1]) === 1) {
        this.SetAsBoolean(true)}
       else if (pas.System.Pos(Temp,this.FDisplays[1][0]) === 1) {
        this.SetAsBoolean(false)}
       else $mod.DatabaseErrorFmt(rtl.getResStr(pas.DBConst,"SNotABoolean"),pas.System.VarRecs(18,AValue));
    };
    this.SetAsInteger = function (AValue) {
      this.SetAsBoolean(AValue !== 0);
    };
    this.SetVarValue = function (AValue) {
      if (pas.JS.isBoolean(AValue)) {
        this.SetAsBoolean(!(AValue == false))}
       else if (rtl.isNumber(AValue)) this.SetAsBoolean(rtl.getNumber(AValue) !== 0);
    };
    this.Create$1 = function (AOwner) {
      $mod.TField.Create$1.call(this,AOwner);
      this.SetDataType($mod.TFieldType.ftBoolean);
      this.SetDisplayValues("True;False");
      return this;
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $mod.$rtti.$StaticArray("TBooleanField.FDisplays$a",{dims: [2,2], eltype: rtl.string});
    $r.addProperty("DisplayValues",2,rtl.string,"FDisplayValues","SetDisplayValues");
  });
  rtl.createClass(this,"TDateTimeField",this.TField,function () {
    this.$init = function () {
      $mod.TField.$init.call(this);
      this.FDisplayFormat = "";
    };
    this.SetDisplayFormat = function (AValue) {
      if (this.FDisplayFormat !== AValue) {
        this.FDisplayFormat = AValue;
        this.PropertyChanged(true);
      };
    };
    this.ConvertToDateTime = function (aValue, aRaiseError) {
      var Result = 0.0;
      if (pas.JS.isNull(aValue)) {
        Result = 0}
       else if (this.FDataSet != null) {
        Result = this.FDataSet.ConvertToDateTime(this,aValue,aRaiseError)}
       else Result = $mod.TDataSet.DefaultConvertToDateTime(this,aValue,aRaiseError);
      return Result;
    };
    this.DateTimeToNativeDateTime = function (aValue) {
      var Result = undefined;
      if (this.FDataSet != null) {
        Result = this.FDataSet.ConvertDateTimeToNative(this,aValue)}
       else Result = $mod.TDataSet.DefaultConvertDateTimeToNative(this,aValue);
      return Result;
    };
    this.GetAsDateTime = function () {
      var Result = 0.0;
      Result = this.ConvertToDateTime(this.GetData(),false);
      return Result;
    };
    this.GetAsFloat = function () {
      var Result = 0.0;
      Result = this.GetAsDateTime();
      return Result;
    };
    this.GetAsString = function () {
      var Result = "";
      this.GetText({get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }},false);
      return Result;
    };
    this.GetAsJSValue = function () {
      var Result = undefined;
      Result = this.GetData();
      if (!rtl.isString(Result)) Result = null;
      return Result;
    };
    this.GetDataSize = function () {
      var Result = 0;
      Result = $mod.TField.GetDataSize.call(this);
      return Result;
    };
    this.GetText = function (AText, ADisplayText) {
      var R = 0.0;
      var F = "";
      R = this.ConvertToDateTime(this.GetData(),false);
      if (R === 0) {
        AText.set("")}
       else {
        if (ADisplayText && (this.FDisplayFormat.length !== 0)) {
          F = this.FDisplayFormat}
         else {
          var $tmp = this.FDataType;
          if ($tmp === $mod.TFieldType.ftTime) {
            F = pas.SysUtils.FormatSettings.LongTimeFormat}
           else if ($tmp === $mod.TFieldType.ftDate) {
            F = pas.SysUtils.FormatSettings.ShortDateFormat}
           else {
            F = "c";
          };
        };
        AText.set(pas.SysUtils.FormatDateTime(F,R));
      };
    };
    this.SetAsDateTime = function (AValue) {
      this.SetData(this.DateTimeToNativeDateTime(AValue));
    };
    this.SetAsFloat = function (AValue) {
      this.SetAsDateTime(AValue);
    };
    this.SetAsString = function (AValue) {
      var R = 0.0;
      if (AValue !== "") {
        R = pas.SysUtils.StrToDateTime(AValue);
        this.SetData(this.DateTimeToNativeDateTime(R));
      } else this.SetData(null);
    };
    this.SetVarValue = function (AValue) {
      this.SetAsDateTime(this.ConvertToDateTime(AValue,true));
    };
    this.Create$1 = function (AOwner) {
      $mod.TField.Create$1.call(this,AOwner);
      this.SetDataType($mod.TFieldType.ftDateTime);
      return this;
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("DisplayFormat",2,rtl.string,"FDisplayFormat","SetDisplayFormat");
  });
  rtl.createClass(this,"TDateField",this.TDateTimeField,function () {
    this.Create$1 = function (AOwner) {
      $mod.TDateTimeField.Create$1.call(this,AOwner);
      this.SetDataType($mod.TFieldType.ftDate);
      return this;
    };
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTimeField",this.TDateTimeField,function () {
    this.SetAsString = function (AValue) {
      var R = 0.0;
      if (AValue !== "") {
        R = pas.SysUtils.StrToTime(AValue);
        this.SetData(this.DateTimeToNativeDateTime(R));
      } else this.SetData(null);
    };
    this.Create$1 = function (AOwner) {
      $mod.TDateTimeField.Create$1.call(this,AOwner);
      this.SetDataType($mod.TFieldType.ftTime);
      return this;
    };
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TBinaryField",this.TField,function () {
    this.CheckTypeSize = function (AValue) {
      if (AValue < 1) $mod.DatabaseErrorFmt(rtl.getResStr(pas.DBConst,"SInvalidFieldSize"),pas.System.VarRecs(0,AValue));
    };
    this.BlobToBytes = function (aValue) {
      var Result = [];
      if (this.FDataSet != null) {
        Result = this.FDataSet.BlobDataToBytes(aValue)}
       else Result = $mod.TDataSet.DefaultBlobDataToBytes(aValue);
      return Result;
    };
    this.BytesToBlob = function (aValue) {
      var Result = undefined;
      if (this.FDataSet != null) {
        Result = this.FDataSet.BytesToBlobData(rtl.arrayRef(aValue))}
       else Result = $mod.TDataSet.DefaultBytesToBlobData(rtl.arrayRef(aValue));
      return Result;
    };
    this.GetAsString = function () {
      var Result = "";
      var V = undefined;
      var S = [];
      var I = 0;
      Result = "";
      V = this.GetData();
      if (V != null) if (this.FDataType in rtl.createSet($mod.TFieldType.ftMemo,$mod.TFieldType.ftGraphic)) {
        Result = "" + V}
       else {
        S = this.BlobToBytes(V);
        for (var $l = 0, $end = rtl.length(S) - 1; $l <= $end; $l++) {
          I = $l;
          Result = Result.concat(String.fromCharCode(S[I]));
        };
      };
      return Result;
    };
    this.GetAsJSValue = function () {
      var Result = undefined;
      Result = this.GetData();
      return Result;
    };
    this.GetValue = function (AValue) {
      var Result = false;
      var V = undefined;
      V = this.GetData();
      Result = V != null;
      if (Result) {
        AValue.set(this.BlobToBytes(V))}
       else AValue.set(rtl.arraySetLength(AValue.get(),0,0));
      return Result;
    };
    this.SetAsString = function (AValue) {
      var B = [];
      var i = 0;
      if (this.FDataType in rtl.createSet($mod.TFieldType.ftMemo,$mod.TFieldType.ftGraphic)) {
        this.SetData(AValue)}
       else {
        B = rtl.arraySetLength(B,0,AValue.length);
        for (var $l = 1, $end = AValue.length; $l <= $end; $l++) {
          i = $l;
          B[i - 1] = AValue.charCodeAt(i - 1);
        };
        this.SetAsBytes(B);
      };
    };
    this.SetVarValue = function (AValue) {
      var B = [];
      var I = 0;
      var Len = 0;
      if (rtl.isArray(AValue)) {
        Len = rtl.length(AValue);
        B = rtl.arraySetLength(B,0,Len);
        for (var $l = 1, $end = Len - 1; $l <= $end; $l++) {
          I = $l;
          B[I] = AValue[I];
        };
        this.SetAsBytes(B);
      } else if (rtl.isString(AValue)) {
        this.SetAsString("" + AValue)}
       else this.RaiseAccessError("Blob");
    };
    this.GetAsBytes = function () {
      var Result = [];
      var V = undefined;
      V = this.GetData();
      if (pas.System.Assigned(V)) {
        Result = this.BlobToBytes(V)}
       else Result = rtl.arraySetLength(Result,0,0);
      return Result;
    };
    this.SetAsBytes = function (aValue) {
      this.SetData(this.BytesToBlob(rtl.arrayRef(aValue)));
    };
    this.Create$1 = function (AOwner) {
      $mod.TField.Create$1.call(this,AOwner);
      return this;
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Size",2,rtl.longint,"FSize","SetSize",4,{Default: 16});
  });
  this.TBlobDisplayValue = {"0": "dvClass", dvClass: 0, "1": "dvFull", dvFull: 1, "2": "dvClip", dvClip: 2, "3": "dvFit", dvFit: 3};
  this.$rtti.$Enum("TBlobDisplayValue",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TBlobDisplayValue});
  this.TBlobStreamMode = {"0": "bmRead", bmRead: 0, "1": "bmWrite", bmWrite: 1, "2": "bmReadWrite", bmReadWrite: 2};
  this.$rtti.$Enum("TBlobStreamMode",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TBlobStreamMode});
  this.$rtti.$Enum("TBlobType",{minvalue: 15, maxvalue: 39, ordtype: 1, enumtype: this.TFieldType});
  rtl.createClass(this,"TBlobField",this.TBinaryField,function () {
    this.$init = function () {
      $mod.TBinaryField.$init.call(this);
      this.FDisplayValue = 0;
      this.FModified = false;
    };
    this.GetBlobType = function () {
      var Result = $mod.TFieldType.ftBlob;
      Result = this.FDataType;
      return Result;
    };
    this.SetBlobType = function (AValue) {
      if (this.GetBlobType() !== AValue) {
        this.SetFieldType(AValue);
        this.PropertyChanged(true);
      };
    };
    this.SetDisplayValue = function (AValue) {
      if (this.FDisplayValue === AValue) return;
      this.FDisplayValue = AValue;
      this.PropertyChanged(false);
    };
    this.CheckTypeSize = function (AValue) {
      if (AValue < 0) $mod.DatabaseErrorFmt(rtl.getResStr(pas.DBConst,"SInvalidFieldSize"),pas.System.VarRecs(0,AValue));
    };
    this.GetBlobSize = function () {
      var Result = 0;
      var B = [];
      B = this.GetAsBytes();
      Result = rtl.length(B);
      return Result;
    };
    this.GetIsNull = function () {
      var Result = false;
      if (!this.FModified) {
        Result = $mod.TField.GetIsNull.call(this)}
       else Result = this.GetBlobSize() === 0;
      return Result;
    };
    this.GetText = function (AText, ADisplayText) {
      var $tmp = this.FDisplayValue;
      if ($tmp === $mod.TBlobDisplayValue.dvClass) {
        AText.set(this.GetClassDesc())}
       else if ($tmp === $mod.TBlobDisplayValue.dvFull) {
        AText.set(this.GetAsString())}
       else if ($tmp === $mod.TBlobDisplayValue.dvClip) {
        AText.set(this.GetAsString());
        if (ADisplayText && (AText.get().length > this.GetDisplayWidth())) AText.set(pas.System.Copy(this.GetEditText(),1,this.GetDisplayWidth()) + "...");
      } else if ($tmp === $mod.TBlobDisplayValue.dvFit) {
        AText.set(this.GetAsString());
        if (ADisplayText && (AText.get().length > this.GetDisplayWidth())) AText.set(this.GetClassDesc());
      };
    };
    this.Create$1 = function (AOwner) {
      $mod.TBinaryField.Create$1.call(this,AOwner);
      this.SetDataType($mod.TFieldType.ftBlob);
      return this;
    };
    this.Clear = function () {
      this.SetData(null);
    };
    this.IsBlob = function () {
      var Result = false;
      Result = true;
      return Result;
    };
    this.SetFieldType = function (AValue) {
      if (AValue in rtl.createSet(null,$mod.TFieldType.ftBlob,$mod.TFieldType.ftWideMemo)) this.SetDataType(AValue);
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("DisplayValue",2,$mod.$rtti["TBlobDisplayValue"],"FDisplayValue","SetDisplayValue",4,{Default: $mod.TBlobDisplayValue.dvClass});
    $r.addProperty("BlobType",3,$mod.$rtti["TBlobType"],"GetBlobType","SetBlobType");
    $r.addProperty("Size",2,rtl.longint,"FSize","SetSize",4,{Default: 0});
  });
  rtl.createClass(this,"TMemoField",this.TBlobField,function () {
    this.GetText = function (AText, ADisplayText) {
      AText.set($mod.TBinaryField.GetAsString.call(this));
    };
    this.Create$1 = function (AOwner) {
      $mod.TBlobField.Create$1.call(this,AOwner);
      this.SetDataType($mod.TFieldType.ftMemo);
      return this;
    };
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TGraphicField",this.TBlobField,function () {
    this.Create$1 = function (AOwner) {
      $mod.TBlobField.Create$1.call(this,AOwner);
      this.SetDataType($mod.TFieldType.ftGraphic);
      return this;
    };
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TVariantField",this.TField,function () {
    this.CheckTypeSize = function (aValue) {
    };
    this.GetAsBoolean = function () {
      var Result = false;
      Result = this.GetAsJSValue() == true;
      return Result;
    };
    this.SetAsBoolean = function (aValue) {
      this.SetVarValue(aValue);
    };
    this.GetAsDateTime = function () {
      var Result = 0.0;
      var V = undefined;
      V = this.GetData();
      if (this.FDataSet != null) {
        Result = this.FDataSet.ConvertToDateTime(this,V,true)}
       else Result = $mod.TDataSet.DefaultConvertToDateTime(this,V,true);
      return Result;
    };
    this.SetAsDateTime = function (aValue) {
      this.SetVarValue(aValue);
    };
    this.GetAsFloat = function () {
      var Result = 0.0;
      var V = undefined;
      V = this.GetData();
      if (rtl.isNumber(V)) {
        Result = rtl.getNumber(V)}
       else if (rtl.isString(V)) {
        Result = parseFloat("" + V)}
       else this.RaiseAccessError("Variant");
      return Result;
    };
    this.SetAsFloat = function (aValue) {
      this.SetVarValue(aValue);
    };
    this.GetAsInteger = function () {
      var Result = 0;
      var V = undefined;
      V = this.GetData();
      if (pas.JS.isInteger(V)) {
        Result = rtl.trunc(V)}
       else if (rtl.isString(V)) {
        Result = parseInt("" + V)}
       else this.RaiseAccessError("Variant");
      return Result;
    };
    this.SetAsInteger = function (AValue) {
      this.SetVarValue(AValue);
    };
    this.GetAsString = function () {
      var Result = "";
      var V = undefined;
      V = this.GetData();
      if (pas.JS.isInteger(V)) {
        Result = pas.SysUtils.IntToStr(rtl.trunc(V))}
       else if (rtl.isNumber(V)) {
        Result = pas.SysUtils.FloatToStr(rtl.getNumber(V))}
       else if (rtl.isString(V)) {
        Result = "" + V}
       else this.RaiseAccessError("Variant");
      return Result;
    };
    this.SetAsString = function (aValue) {
      this.SetVarValue(aValue);
    };
    this.GetAsJSValue = function () {
      var Result = undefined;
      Result = this.GetData();
      return Result;
    };
    this.SetVarValue = function (aValue) {
      this.SetData(aValue);
    };
    this.Create$1 = function (AOwner) {
      $mod.TField.Create$1.call(this,AOwner);
      this.SetDataType($mod.TFieldType.ftVariant);
      return this;
    };
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TDataSetField",this.TField,function () {
    this.$init = function () {
      $mod.TField.$init.call(this);
      this.FNestedDataSet = null;
    };
    this.$final = function () {
      this.FNestedDataSet = undefined;
      $mod.TField.$final.call(this);
    };
    this.AssignNestedDataSet = function (Value) {
      if (this.FNestedDataSet != null) {
        this.FNestedDataSet.Close();
        this.FNestedDataSet.FDataSetField = null;
        if (this.FDataSet != null) this.FDataSet.GetNestedDataSets().Remove(this.FNestedDataSet);
      };
      if (Value != null) this.FDataSet.GetNestedDataSets().Add(Value);
      this.FNestedDataSet = Value;
    };
    this.Bind = function (Binding) {
      $mod.TField.Bind.apply(this,arguments);
      if (this.FNestedDataSet != null) if (Binding) {
        if (this.FNestedDataSet.FState === $mod.TDataSetState.dsInactive) this.FNestedDataSet.Open();
      } else this.FNestedDataSet.Close();
    };
    this.Create$1 = function (AOwner) {
      $mod.TField.Create$1.apply(this,arguments);
      this.SetDataType($mod.TFieldType.ftDataSet);
      return this;
    };
    this.Destroy = function () {
      this.AssignNestedDataSet(null);
      $mod.TField.Destroy.call(this);
    };
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.$rtti.$Class("TIndexDefs");
  this.TIndexOption = {"0": "ixPrimary", ixPrimary: 0, "1": "ixUnique", ixUnique: 1, "2": "ixDescending", ixDescending: 2, "3": "ixCaseInsensitive", ixCaseInsensitive: 3, "4": "ixExpression", ixExpression: 4, "5": "ixNonMaintained", ixNonMaintained: 5};
  this.$rtti.$Enum("TIndexOption",{minvalue: 0, maxvalue: 5, ordtype: 1, enumtype: this.TIndexOption});
  this.$rtti.$Set("TIndexOptions",{comptype: this.$rtti["TIndexOption"]});
  rtl.createClass(this,"TIndexDef",this.TNamedItem,function () {
    this.$init = function () {
      $mod.TNamedItem.$init.call(this);
      this.FCaseinsFields = "";
      this.FDescFields = "";
      this.FExpression = "";
      this.FFields = "";
      this.FOptions = {};
      this.FSource = "";
    };
    this.$final = function () {
      this.FOptions = undefined;
      $mod.TNamedItem.$final.call(this);
    };
    this.GetExpression = function () {
      var Result = "";
      Result = this.FExpression;
      return Result;
    };
    this.SetCaseInsFields = function (AValue) {
      if (this.FCaseinsFields === AValue) return;
      if (AValue !== "") this.FOptions = rtl.unionSet(this.FOptions,rtl.createSet($mod.TIndexOption.ixCaseInsensitive));
      this.FCaseinsFields = AValue;
    };
    this.SetDescFields = function (AValue) {
      if (this.FDescFields === AValue) return;
      if (AValue !== "") this.FOptions = rtl.unionSet(this.FOptions,rtl.createSet($mod.TIndexOption.ixDescending));
      this.FDescFields = AValue;
    };
    this.SetExpression = function (AValue) {
      this.FExpression = AValue;
    };
    this.Create$2 = function (Owner, AName, TheFields, TheOptions) {
      this.FName = AName;
      pas.Classes.TCollectionItem.Create$1.call(this,Owner);
      this.FFields = TheFields;
      this.FOptions = rtl.refSet(TheOptions);
      return this;
    };
    this.Assign = function (Source) {
      var idef = null;
      idef = null;
      if ($mod.TIndexDef.isPrototypeOf(Source)) idef = rtl.as(Source,$mod.TIndexDef);
      if (idef != null) {
        this.FName = idef.FName;
        this.FFields = idef.FFields;
        this.FOptions = rtl.refSet(idef.FOptions);
        this.FCaseinsFields = idef.FCaseinsFields;
        this.FDescFields = idef.FDescFields;
        this.FSource = idef.FSource;
        this.FExpression = idef.GetExpression();
      } else pas.Classes.TPersistent.Assign.call(this,Source);
    };
    var $r = this.$rtti;
    $r.addProperty("Expression",3,rtl.string,"GetExpression","SetExpression");
    $r.addProperty("Fields",0,rtl.string,"FFields","FFields");
    $r.addProperty("CaseInsFields",2,rtl.string,"FCaseinsFields","SetCaseInsFields");
    $r.addProperty("DescFields",2,rtl.string,"FDescFields","SetDescFields");
    $r.addProperty("Options",0,$mod.$rtti["TIndexOptions"],"FOptions","FOptions");
    $r.addProperty("Source",0,rtl.string,"FSource","FSource");
  });
  this.$rtti.$ClassRef("TIndexDefClass",{instancetype: this.$rtti["TIndexDef"]});
  rtl.createClass(this,"TIndexDefs",this.TDefCollection,function () {
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = rtl.as(pas.Classes.TCollection.GetItem.call(this,Index),$mod.TIndexDef);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      pas.Classes.TCollection.SetItem.call(this,Index,Value);
    };
    this.Create$4 = function (ADataSet) {
      $mod.TDefCollection.create$3.call(this,ADataSet,this.Owner(),$mod.TIndexDef);
      return this;
    };
    this.Add$1 = function (Name, Fields, Options) {
      this.FItemClass.$create("Create$2",[this,Name,Fields,rtl.refSet(Options)]);
    };
    this.AddIndexDef = function () {
      var Result = null;
      Result = this.FItemClass.$create("Create$2",[this,"","",{}]);
      return Result;
    };
    this.Find$1 = function (IndexName) {
      var Result = null;
      Result = rtl.as($mod.TDefCollection.Find.call(this,IndexName),$mod.TIndexDef);
      if (Result === null) $mod.DatabaseErrorFmt$1(rtl.getResStr(pas.DBConst,"SIndexNotFound"),pas.System.VarRecs(18,IndexName),this.FDataset);
      return Result;
    };
    this.FindIndexForFields = function (Fields) {
      var Result = null;
      Result = null;
      return Result;
    };
    this.GetIndexForFields = function (Fields, CaseInsensitive) {
      var Result = null;
      var i = 0;
      var FieldsLen = 0;
      var Last = null;
      Last = null;
      FieldsLen = Fields.length;
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        Result = this.GetItem$1(i);
        if (rtl.eqSet(rtl.intersectSet(Result.FOptions,rtl.createSet($mod.TIndexOption.ixDescending,$mod.TIndexOption.ixExpression)),{}) && (!CaseInsensitive || ($mod.TIndexOption.ixCaseInsensitive in Result.FOptions)) && pas.SysUtils.AnsiSameText(Fields,Result.FFields)) {
          return Result;
        } else if (pas.SysUtils.AnsiSameText(Fields,pas.System.Copy(Result.FFields,1,FieldsLen)) && ((Result.FFields.length === FieldsLen) || (Result.FFields.charAt((FieldsLen + 1) - 1) === ";"))) {
          if ((Last === null) || ((Last !== null) && (Last.FFields.length > Result.FFields.length))) Last = Result;
        };
      };
      Result = Last;
      return Result;
    };
    this.Update$1 = function () {
      if (!this.FUpdated && (this.FDataset != null)) {
        this.FDataset.UpdateIndexDefs();
        this.FUpdated = true;
      };
    };
  });
  rtl.createClass(this,"TCheckConstraint",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FCustomConstraint = "";
      this.FErrorMessage = "";
      this.FFromDictionary = false;
      this.FImportedConstraint = "";
    };
    this.Assign = function (Source) {
    };
    var $r = this.$rtti;
    $r.addProperty("CustomConstraint",0,rtl.string,"FCustomConstraint","FCustomConstraint");
    $r.addProperty("ErrorMessage",0,rtl.string,"FErrorMessage","FErrorMessage");
    $r.addProperty("FromDictionary",0,rtl.boolean,"FFromDictionary","FFromDictionary");
    $r.addProperty("ImportedConstraint",0,rtl.string,"FImportedConstraint","FImportedConstraint");
  });
  rtl.createClass(this,"TCheckConstraints",pas.Classes.TCollection,function () {
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = null;
      return Result;
    };
    this.SetItem$1 = function (index, Value) {
    };
    this.GetOwner = function () {
      var Result = null;
      Result = null;
      return Result;
    };
    this.Create$2 = function (AOwner) {
      pas.Classes.TCollection.Create$1.call(this,$mod.TCheckConstraint);
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = null;
      return Result;
    };
  });
  rtl.createClass(this,"TFieldsEnumerator",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FPosition = 0;
      this.FFields = null;
    };
    this.$final = function () {
      this.FFields = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.GetCurrent = function () {
      var Result = null;
      Result = this.FFields.GetField(this.FPosition);
      return Result;
    };
    this.Create$1 = function (AFields) {
      pas.System.TObject.Create.call(this);
      this.FFields = AFields;
      this.FPosition = -1;
      return this;
    };
    this.MoveNext = function () {
      var Result = false;
      this.FPosition += 1;
      Result = this.FPosition < this.FFields.GetCount();
      return Result;
    };
  });
  rtl.createClass(this,"TFields",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FDataset = null;
      this.FFieldList = null;
      this.FOnChange = null;
      this.FValidFieldKinds = {};
    };
    this.$final = function () {
      this.FDataset = undefined;
      this.FFieldList = undefined;
      this.FOnChange = undefined;
      this.FValidFieldKinds = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.ClearFieldDefs = function () {
      var i = 0;
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        this.GetField(i).FFieldDef = null;
      };
    };
    this.Changed = function () {
      if ((this.FDataset !== null) && !(pas.Classes.TComponentStateItem.csDestroying in this.FDataset.FComponentState)) this.FDataset.DataEvent($mod.TDataEvent.deFieldListChange,0);
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.CheckfieldKind = function (Fieldkind, Field) {
      if (!(Fieldkind in this.FValidFieldKinds)) $mod.DatabaseErrorFmt(rtl.getResStr(pas.DBConst,"SInvalidFieldKind"),pas.System.VarRecs(18,Field.FFieldName));
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FFieldList.FCount;
      return Result;
    };
    this.GetField = function (Index) {
      var Result = null;
      Result = rtl.getObject(this.FFieldList.Get(Index));
      return Result;
    };
    this.SetField = function (Index, Value) {
      this.GetField(Index).Assign(Value);
    };
    this.SetFieldIndex = function (Field, Value) {
      var Old = 0;
      Old = this.FFieldList.IndexOf(Field);
      if (Old === -1) return;
      if (Value < 0) Value = 0;
      if (Value >= this.GetCount()) Value = this.GetCount() - 1;
      if (Value !== Old) {
        this.FFieldList.Delete(Old);
        this.FFieldList.Insert(Value,Field);
        Field.PropertyChanged(true);
        this.Changed();
      };
    };
    this.Create$1 = function (ADataset) {
      this.FDataset = ADataset;
      this.FFieldList = pas.Classes.TFPList.$create("Create");
      this.FValidFieldKinds = rtl.createSet(null,$mod.TFieldKind.fkData,$mod.TFieldKind.fkInternalCalc);
      return this;
    };
    this.Destroy = function () {
      if (this.FFieldList != null) this.Clear();
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FFieldList;
        }, set: function (v) {
          this.p.FFieldList = v;
        }});
      pas.System.TObject.Destroy.call(this);
    };
    this.Add = function (Field) {
      this.CheckFieldName(Field.FFieldName);
      this.FFieldList.Add(Field);
      Field.FFields = this;
      this.Changed();
    };
    this.CheckFieldName = function (Value) {
      if (this.FindField(Value) !== null) $mod.DatabaseErrorFmt$1(rtl.getResStr(pas.DBConst,"SDuplicateFieldName"),pas.System.VarRecs(18,Value),this.FDataset);
    };
    this.CheckFieldNames = function (Value) {
      var N = "";
      var StrPos = 0;
      if (Value === "") return;
      StrPos = 1;
      do {
        N = $mod.ExtractFieldName(Value,{get: function () {
            return StrPos;
          }, set: function (v) {
            StrPos = v;
          }});
        this.FieldByName(N);
      } while (!(StrPos > Value.length));
    };
    this.Clear = function () {
      var AField = null;
      while (this.FFieldList.FCount > 0) {
        AField = rtl.getObject(this.FFieldList.Last());
        AField.FDataSet = null;
        AField = rtl.freeLoc(AField);
        this.FFieldList.Delete(this.FFieldList.FCount - 1);
      };
      this.Changed();
    };
    this.FindField = function (Value) {
      var Result = null;
      var S = "";
      var I = 0;
      S = pas.SysUtils.UpperCase(Value);
      for (var $l = 0, $end = this.FFieldList.FCount - 1; $l <= $end; $l++) {
        I = $l;
        Result = rtl.getObject(this.FFieldList.Get(I));
        if (S === pas.SysUtils.UpperCase(Result.FFieldName)) {
          return Result;
        };
      };
      Result = null;
      return Result;
    };
    this.FieldByName = function (Value) {
      var Result = null;
      Result = this.FindField(Value);
      if (Result === null) $mod.DatabaseErrorFmt$1(rtl.getResStr(pas.DBConst,"SFieldNotFound"),pas.System.VarRecs(18,Value),this.FDataset);
      return Result;
    };
    this.FieldByNumber = function (FieldNo) {
      var Result = null;
      var i = 0;
      for (var $l = 0, $end = this.FFieldList.FCount - 1; $l <= $end; $l++) {
        i = $l;
        Result = rtl.getObject(this.FFieldList.Get(i));
        if (FieldNo === Result.FFieldNo) return Result;
      };
      Result = null;
      return Result;
    };
    this.GetEnumerator = function () {
      var Result = null;
      Result = $mod.TFieldsEnumerator.$create("Create$1",[this]);
      return Result;
    };
    this.GetFieldNames = function (Values) {
      var i = 0;
      Values.Clear();
      for (var $l = 0, $end = this.FFieldList.FCount - 1; $l <= $end; $l++) {
        i = $l;
        Values.Add(rtl.getObject(this.FFieldList.Get(i)).FFieldName);
      };
    };
    this.IndexOf = function (Field) {
      var Result = 0;
      Result = this.FFieldList.IndexOf(Field);
      return Result;
    };
    this.Remove = function (Value) {
      this.FFieldList.Remove(Value);
      Value.FFields = null;
      this.Changed();
    };
  });
  this.$rtti.$ClassRef("TFieldsClass",{instancetype: this.$rtti["TFields"]});
  this.$rtti.$DynArray("TParamBinding",{eltype: rtl.longint});
  this.TParamType = {"0": "ptUnknown", ptUnknown: 0, "1": "ptInput", ptInput: 1, "2": "ptOutput", ptOutput: 2, "3": "ptInputOutput", ptInputOutput: 3, "4": "ptResult", ptResult: 4};
  this.$rtti.$Enum("TParamType",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TParamType});
  this.$rtti.$Set("TParamTypes",{comptype: this.$rtti["TParamType"]});
  this.TParamStyle = {"0": "psInterbase", psInterbase: 0, "1": "psPostgreSQL", psPostgreSQL: 1, "2": "psSimulated", psSimulated: 2};
  this.$rtti.$Enum("TParamStyle",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TParamStyle});
  this.$rtti.$Class("TParams");
  rtl.createClass(this,"TParam",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FValue = undefined;
      this.FPrecision = 0;
      this.FNumericScale = 0;
      this.FName = "";
      this.FDataType = 0;
      this.FBound = false;
      this.FParamType = 0;
      this.FSize = 0;
    };
    this.GetDataSet = function () {
      var Result = null;
      if ((this.FCollection != null) && $mod.TParams.isPrototypeOf(this.FCollection)) {
        Result = this.FCollection.GetDataSet()}
       else Result = null;
      return Result;
    };
    this.IsParamStored = function () {
      var Result = false;
      Result = this.FBound;
      return Result;
    };
    this.AssignParam = function (Param) {
      if (!(Param != null)) {
        this.Clear();
        this.FDataType = $mod.TFieldType.ftUnknown;
        this.FParamType = $mod.TParamType.ptUnknown;
        this.FName = "";
        this.FSize = 0;
        this.FPrecision = 0;
        this.FNumericScale = 0;
      } else {
        this.FDataType = Param.FDataType;
        if (Param.GetIsNull()) {
          this.Clear()}
         else this.FValue = Param.FValue;
        this.FBound = Param.FBound;
        this.FName = Param.FName;
        if (this.FParamType === $mod.TParamType.ptUnknown) this.FParamType = Param.FParamType;
        this.FSize = Param.FSize;
        this.FPrecision = Param.FPrecision;
        this.FNumericScale = Param.FNumericScale;
      };
    };
    this.AssignTo = function (Dest) {
      if ($mod.TField.isPrototypeOf(Dest)) {
        this.AssignToField(Dest)}
       else pas.Classes.TPersistent.AssignTo.call(this,Dest);
    };
    this.GetAsBoolean = function () {
      var Result = false;
      if (!this.GetIsNull() && (this.FDataType === $mod.TFieldType.ftString)) {
        Result = pas.SysUtils.StrToBool("" + this.FValue);
      } else {
        if (this.GetIsNull()) {
          Result = false}
         else Result = this.FValue == true;
      };
      return Result;
    };
    this.GetAsBytes = function () {
      var Result = [];
      if (this.GetIsNull()) {
        Result = []}
       else if (rtl.isArray(this.FValue)) Result = this.FValue;
      return Result;
    };
    this.GetAsDateTime = function () {
      var Result = 0.0;
      if (!this.GetIsNull() && (this.FDataType === $mod.TFieldType.ftString)) {
        Result = pas.SysUtils.StrToDateTime("" + this.FValue);
      } else {
        if (this.GetIsNull()) {
          Result = 0.0}
         else Result = rtl.getNumber(this.FValue);
      };
      return Result;
    };
    this.GetAsFloat = function () {
      var Result = 0.0;
      if (!this.GetIsNull() && (this.FDataType === $mod.TFieldType.ftString)) {
        Result = pas.SysUtils.StrToFloat("" + this.FValue);
      } else {
        if (this.GetIsNull()) {
          Result = 0.0}
         else Result = rtl.getNumber(this.FValue);
      };
      return Result;
    };
    this.GetAsInteger = function () {
      var Result = 0;
      if (!this.GetIsNull() && (this.FDataType === $mod.TFieldType.ftString)) {
        Result = pas.SysUtils.StrToInt("" + this.FValue);
      } else {
        if (this.GetIsNull() || !pas.JS.isInteger(this.FValue)) {
          Result = 0}
         else Result = rtl.trunc(this.FValue);
      };
      return Result;
    };
    this.GetAsLargeInt = function () {
      var Result = 0;
      if (!this.GetIsNull() && (this.FDataType === $mod.TFieldType.ftString)) {
        Result = pas.SysUtils.StrToInt("" + this.FValue);
      } else {
        if (this.GetIsNull() || !pas.JS.isInteger(this.FValue)) {
          Result = 0}
         else Result = rtl.trunc(this.FValue);
      };
      return Result;
    };
    this.GetAsMemo = function () {
      var Result = "";
      if (this.GetIsNull() || !rtl.isString(this.FValue)) {
        Result = ""}
       else Result = "" + this.FValue;
      return Result;
    };
    this.GetAsString = function () {
      var Result = "";
      if (this.GetIsNull() || !rtl.isString(this.FValue)) {
        Result = ""}
       else Result = "" + this.FValue;
      return Result;
    };
    this.GetAsJSValue = function () {
      var Result = undefined;
      if (this.GetIsNull()) {
        Result = null}
       else Result = this.FValue;
      return Result;
    };
    this.GetDisplayName = function () {
      var Result = "";
      if (this.FName !== "") {
        Result = this.FName}
       else Result = pas.Classes.TCollectionItem.GetDisplayName.call(this);
      return Result;
    };
    this.GetIsNull = function () {
      var Result = false;
      Result = pas.JS.isNull(this.FValue);
      return Result;
    };
    this.IsEqual = function (AValue) {
      var Result = false;
      Result = (this.FName === AValue.FName) && (this.GetIsNull() === AValue.GetIsNull()) && (this.FBound === AValue.FBound) && (this.FDataType === AValue.FDataType) && (this.FParamType === AValue.FParamType) && (pas.JS.GetValueType(this.FValue) === pas.JS.GetValueType(AValue.FValue)) && (this.FValue == AValue.FValue);
      return Result;
    };
    this.SetAsBlob = function (AValue) {
      this.FDataType = $mod.TFieldType.ftBlob;
      this.SetAsJSValue(AValue);
    };
    this.SetAsBoolean = function (AValue) {
      this.FDataType = $mod.TFieldType.ftBoolean;
      this.SetAsJSValue(AValue);
    };
    this.SetAsBytes = function (AValue) {
    };
    this.SetAsDate = function (AValue) {
      this.FDataType = $mod.TFieldType.ftDate;
      this.SetAsJSValue(AValue);
    };
    this.SetAsDateTime = function (AValue) {
      this.FDataType = $mod.TFieldType.ftDateTime;
      this.SetAsJSValue(AValue);
    };
    this.SetAsFloat = function (AValue) {
      this.FDataType = $mod.TFieldType.ftFloat;
      this.SetAsJSValue(AValue);
    };
    this.SetAsInteger = function (AValue) {
      this.FDataType = $mod.TFieldType.ftInteger;
      this.SetAsJSValue(AValue);
    };
    this.SetAsLargeInt = function (AValue) {
      this.FDataType = $mod.TFieldType.ftLargeint;
      this.SetAsJSValue(AValue);
    };
    this.SetAsMemo = function (AValue) {
      this.FDataType = $mod.TFieldType.ftMemo;
      this.SetAsJSValue(AValue);
    };
    this.SetAsString = function (AValue) {
      if (this.FDataType !== $mod.TFieldType.ftFixedChar) this.FDataType = $mod.TFieldType.ftString;
      this.SetAsJSValue(AValue);
    };
    this.SetAsTime = function (AValue) {
      this.FDataType = $mod.TFieldType.ftTime;
      this.SetAsJSValue(AValue);
    };
    this.SetAsJSValue = function (AValue) {
      this.FValue = AValue;
      this.FBound = !pas.JS.isNull(AValue);
      if (this.FBound) {
        var $tmp = pas.JS.GetValueType(AValue);
        if ($tmp === pas.JS.TJSValueType.jvtBoolean) {
          this.FDataType = $mod.TFieldType.ftBoolean}
         else if ($tmp === pas.JS.TJSValueType.jvtInteger) {
          this.FDataType = $mod.TFieldType.ftInteger}
         else if ($tmp === pas.JS.TJSValueType.jvtFloat) {
          this.FDataType = $mod.TFieldType.ftFloat}
         else if (($tmp === pas.JS.TJSValueType.jvtObject) || ($tmp === pas.JS.TJSValueType.jvtArray)) this.FDataType = $mod.TFieldType.ftBlob;
      };
    };
    this.SetDataType = function (AValue) {
      this.FDataType = AValue;
    };
    this.SetText = function (AValue) {
      this.SetAsJSValue(AValue);
    };
    this.Create$1 = function (ACollection) {
      pas.Classes.TCollectionItem.Create$1.call(this,ACollection);
      this.FParamType = $mod.TParamType.ptUnknown;
      this.SetDataType($mod.TFieldType.ftUnknown);
      this.FValue = null;
      return this;
    };
    this.Create$3 = function (AParams, AParamType) {
      this.Create$1(AParams);
      this.FParamType = AParamType;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TParam.isPrototypeOf(Source)) {
        this.AssignParam(Source)}
       else if ($mod.TField.isPrototypeOf(Source)) {
        this.AssignField(Source)}
       else if (pas.Classes.TStrings.isPrototypeOf(Source)) {
        this.SetAsMemo(Source.GetTextStr())}
       else pas.Classes.TPersistent.Assign.call(this,Source);
    };
    this.AssignField = function (Field) {
      if (Field != null) {
        this.AssignFieldValue(Field,Field.GetAsJSValue());
        this.FName = Field.FFieldName;
      } else {
        this.Clear();
        this.FName = "";
      };
    };
    this.AssignToField = function (Field) {
      if (Field != null) {
        var $tmp = this.FDataType;
        if ($tmp === $mod.TFieldType.ftUnknown) {
          $mod.DatabaseErrorFmt$1(rtl.getResStr(pas.DBConst,"SUnknownParamFieldType"),pas.System.VarRecs(18,this.FName),this.GetDataSet())}
         else if (($tmp === $mod.TFieldType.ftInteger) || ($tmp === $mod.TFieldType.ftAutoInc)) {
          Field.SetAsInteger(this.GetAsInteger())}
         else if ($tmp === $mod.TFieldType.ftFloat) {
          Field.SetAsFloat(this.GetAsFloat())}
         else if ($tmp === $mod.TFieldType.ftBoolean) {
          Field.SetAsBoolean(this.GetAsBoolean())}
         else if (($tmp === $mod.TFieldType.ftBlob) || ($tmp === $mod.TFieldType.ftString) || ($tmp === $mod.TFieldType.ftWideString) || ($tmp === $mod.TFieldType.ftMemo) || ($tmp === $mod.TFieldType.ftFixedChar)) {
          Field.SetAsString(this.GetAsString())}
         else if (($tmp === $mod.TFieldType.ftTime) || ($tmp === $mod.TFieldType.ftDate) || ($tmp === $mod.TFieldType.ftDateTime)) Field.SetAsDateTime(this.GetAsDateTime());
      };
    };
    this.AssignFieldValue = function (Field, AValue) {
      if (Field != null) {
        if ((Field.FDataType === $mod.TFieldType.ftString) && Field.FFixedChar) {
          this.FDataType = $mod.TFieldType.ftFixedChar}
         else if ((Field.FDataType === $mod.TFieldType.ftMemo) && (Field.FSize > 255)) {
          this.FDataType = $mod.TFieldType.ftString}
         else this.FDataType = Field.FDataType;
        if (pas.JS.isNull(AValue)) {
          this.Clear()}
         else this.SetAsJSValue(AValue);
        this.FSize = Field.GetDataSize();
        this.FBound = true;
      };
    };
    this.AssignFromField = function (Field) {
      if (Field != null) {
        this.FDataType = Field.FDataType;
        var $tmp = Field.FDataType;
        if ($tmp === $mod.TFieldType.ftUnknown) {
          $mod.DatabaseErrorFmt$1(rtl.getResStr(pas.DBConst,"SUnknownParamFieldType"),pas.System.VarRecs(18,this.FName),this.GetDataSet())}
         else if (($tmp === $mod.TFieldType.ftInteger) || ($tmp === $mod.TFieldType.ftAutoInc)) {
          this.SetAsInteger(Field.GetAsInteger())}
         else if ($tmp === $mod.TFieldType.ftFloat) {
          this.SetAsFloat(Field.GetAsFloat())}
         else if ($tmp === $mod.TFieldType.ftBoolean) {
          this.SetAsBoolean(Field.GetAsBoolean())}
         else if (($tmp === $mod.TFieldType.ftBlob) || ($tmp === $mod.TFieldType.ftString) || ($tmp === $mod.TFieldType.ftWideString) || ($tmp === $mod.TFieldType.ftMemo) || ($tmp === $mod.TFieldType.ftFixedChar)) {
          this.SetAsString(Field.GetAsString())}
         else if (($tmp === $mod.TFieldType.ftTime) || ($tmp === $mod.TFieldType.ftDate) || ($tmp === $mod.TFieldType.ftDateTime)) this.SetAsDateTime(Field.GetAsDateTime());
      };
    };
    this.Clear = function () {
      this.FValue = null;
    };
    var $r = this.$rtti;
    $r.addProperty("DataType",2,$mod.$rtti["TFieldType"],"FDataType","SetDataType");
    $r.addProperty("Name",0,rtl.string,"FName","FName");
    $r.addProperty("NumericScale",0,rtl.longint,"FNumericScale","FNumericScale",4,{Default: 0});
    $r.addProperty("ParamType",0,$mod.$rtti["TParamType"],"FParamType","FParamType");
    $r.addProperty("Precision",0,rtl.longint,"FPrecision","FPrecision",4,{Default: 0});
    $r.addProperty("Size",0,rtl.longint,"FSize","FSize",4,{Default: 0});
    $r.addProperty("Value",15,rtl.jsvalue,"GetAsJSValue","SetAsJSValue",4,{stored: "IsParamStored"});
  });
  this.$rtti.$ClassRef("TParamClass",{instancetype: this.$rtti["TParam"]});
  rtl.createClass(this,"TParams",pas.Classes.TCollection,function () {
    this.$init = function () {
      pas.Classes.TCollection.$init.call(this);
      this.FOwner = null;
    };
    this.$final = function () {
      this.FOwner = undefined;
      pas.Classes.TCollection.$final.call(this);
    };
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = rtl.as(pas.Classes.TCollection.GetItem.call(this,Index),$mod.TParam);
      return Result;
    };
    this.GetParamValue = function (ParamName) {
      var Result = undefined;
      Result = this.ParamByName(ParamName).GetAsJSValue();
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      pas.Classes.TCollection.SetItem.call(this,Index,Value);
    };
    this.SetParamValue = function (ParamName, Value) {
      this.ParamByName(ParamName).SetAsJSValue(Value);
    };
    this.AssignTo = function (Dest) {
      if ($mod.TParams.isPrototypeOf(Dest)) {
        Dest.Assign(this)}
       else pas.Classes.TPersistent.AssignTo.call(this,Dest);
    };
    this.GetDataSet = function () {
      var Result = null;
      if ($mod.TDataSet.isPrototypeOf(this.FOwner)) {
        Result = this.FOwner}
       else Result = null;
      return Result;
    };
    this.GetOwner = function () {
      var Result = null;
      Result = this.FOwner;
      return Result;
    };
    this.ParamClass = function () {
      var Result = null;
      Result = $mod.TParam;
      return Result;
    };
    this.Create$2 = function (AOwner, AItemClass) {
      pas.Classes.TCollection.Create$1.call(this,AItemClass);
      this.FOwner = AOwner;
      return this;
    };
    this.Create$3 = function (AOwner) {
      this.Create$2(AOwner,this.$class.ParamClass());
      return this;
    };
    this.Create$4 = function () {
      this.Create$3(null);
      return this;
    };
    this.AddParam = function (Value) {
      Value.SetCollection(this);
    };
    this.AssignValues = function (Value) {
      var I = 0;
      var P = null;
      var PS = null;
      for (var $l = 0, $end = Value.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        PS = Value.GetItem$1(I);
        P = this.FindParam(PS.FName);
        if (P != null) P.Assign(PS);
      };
    };
    this.CreateParam = function (FldType, ParamName, ParamType) {
      var Result = null;
      Result = rtl.as(this.Add$1(),$mod.TParam);
      Result.FName = ParamName;
      Result.SetDataType(FldType);
      Result.FParamType = ParamType;
      return Result;
    };
    this.FindParam = function (Value) {
      var Result = null;
      var I = 0;
      Result = null;
      I = this.GetCount() - 1;
      while ((Result === null) && (I >= 0)) if (pas.SysUtils.CompareText(Value,this.GetItem$1(I).FName) === 0) {
        Result = this.GetItem$1(I)}
       else I -= 1;
      return Result;
    };
    this.GetParamList = function (List, ParamNames) {
      var P = null;
      var N = "";
      var StrPos = 0;
      if ((ParamNames === "") || (List === null)) return;
      StrPos = 1;
      do {
        N = $mod.ExtractFieldName(ParamNames,{get: function () {
            return StrPos;
          }, set: function (v) {
            StrPos = v;
          }});
        P = this.ParamByName(N);
        List.Add(P);
      } while (!(StrPos > ParamNames.length));
    };
    this.IsEqual = function (Value) {
      var Result = false;
      var I = 0;
      Result = Value.GetCount() === this.GetCount();
      I = this.GetCount() - 1;
      while (Result && (I >= 0)) {
        Result = this.GetItem$1(I).IsEqual(Value.GetItem$1(I));
        I -= 1;
      };
      return Result;
    };
    this.ParamByName = function (Value) {
      var Result = null;
      Result = this.FindParam(Value);
      if (Result === null) $mod.DatabaseErrorFmt$1(rtl.getResStr(pas.DBConst,"SParameterNotFound"),pas.System.VarRecs(18,Value),this.GetDataSet());
      return Result;
    };
    this.ParseSQL = function (SQL, DoCreate) {
      var Result = "";
      var pb = [];
      var rs = "";
      Result = this.ParseSQL$3(SQL,DoCreate,true,true,$mod.TParamStyle.psInterbase,{get: function () {
          return pb;
        }, set: function (v) {
          pb = v;
        }},{get: function () {
          return rs;
        }, set: function (v) {
          rs = v;
        }});
      return Result;
    };
    this.ParseSQL$1 = function (SQL, DoCreate, EscapeSlash, EscapeRepeat, ParameterStyle) {
      var Result = "";
      var pb = [];
      var rs = "";
      Result = this.ParseSQL$3(SQL,DoCreate,EscapeSlash,EscapeRepeat,ParameterStyle,{get: function () {
          return pb;
        }, set: function (v) {
          pb = v;
        }},{get: function () {
          return rs;
        }, set: function (v) {
          rs = v;
        }});
      return Result;
    };
    this.ParseSQL$2 = function (SQL, DoCreate, EscapeSlash, EscapeRepeat, ParameterStyle, ParamBinding) {
      var Result = "";
      var rs = "";
      Result = this.ParseSQL$3(SQL,DoCreate,EscapeSlash,EscapeRepeat,ParameterStyle,ParamBinding,{get: function () {
          return rs;
        }, set: function (v) {
          rs = v;
        }});
      return Result;
    };
    var TStringPart = rtl.recNewT(null,"",function () {
      this.Start = 0;
      this.Stop = 0;
      this.$eq = function (b) {
        return (this.Start === b.Start) && (this.Stop === b.Stop);
      };
      this.$assign = function (s) {
        this.Start = s.Start;
        this.Stop = s.Stop;
        return this;
      };
    });
    var ParamAllocStepSize = 8;
    var PAramDelimiters = [";",","," ","(",")","\r","\n","\t","\x00","=","+","-","*","\\","/","[","]","|"];
    this.ParseSQL$3 = function (SQL, DoCreate, EscapeSlash, EscapeRepeat, ParameterStyle, ParamBinding, ReplaceString) {
      var Result = "";
      var IgnorePart = false;
      var p = 0;
      var ParamNameStart = 0;
      var BufStart = 0;
      var ParamName = "";
      var QuestionMarkParamCount = 0;
      var ParameterIndex = 0;
      var NewLength = 0;
      var ParamCount = 0;
      var ParamPart = [];
      var NewQueryLength = 0;
      var NewQuery = "";
      var NewQueryIndex = 0;
      var BufIndex = 0;
      var CopyLen = 0;
      var i = 0;
      var tmpParam = null;
      if (DoCreate) this.Clear();
      ParamCount = 0;
      NewQueryLength = SQL.length;
      ParamPart = rtl.arraySetLength(ParamPart,TStringPart,8);
      ParamBinding.set(rtl.arraySetLength(ParamBinding.get(),0,8));
      QuestionMarkParamCount = 0;
      ReplaceString.set("$");
      if (ParameterStyle === $mod.TParamStyle.psSimulated) while (pas.System.Pos(ReplaceString.get(),SQL) > 0) ReplaceString.set(ReplaceString.get() + "$");
      p = 1;
      BufStart = p;
      do {
        while ($impl.SkipComments(SQL,{get: function () {
            return p;
          }, set: function (v) {
            p = v;
          }},EscapeSlash,EscapeRepeat)) {
        };
        var $tmp = SQL.charAt(p - 1);
        if (($tmp === ":") || ($tmp === "?")) {
          IgnorePart = false;
          if (SQL.charAt(p - 1) === ":") {
            p += 1;
            if (pas.SysUtils.CharInSet(SQL.charAt(p - 1),[":","="," "])) {
              IgnorePart = true;
              p += 1;
            } else {
              if (SQL.charAt(p - 1) === '"') {
                ParamNameStart = p;
                $impl.SkipQuotesString(SQL,{get: function () {
                    return p;
                  }, set: function (v) {
                    p = v;
                  }},'"',EscapeSlash,EscapeRepeat);
                ParamName = pas.System.Copy(SQL,ParamNameStart + 1,p - ParamNameStart - 2);
              } else {
                ParamNameStart = p;
                while (!pas.SysUtils.CharInSet(SQL.charAt(p - 1),PAramDelimiters)) p += 1;
                ParamName = pas.System.Copy(SQL,ParamNameStart,p - ParamNameStart);
              };
            };
          } else {
            p += 1;
            ParamNameStart = p;
            ParamName = "";
          };
          if (!IgnorePart) {
            ParamCount += 1;
            if (ParamCount > rtl.length(ParamPart)) {
              NewLength = rtl.length(ParamPart) + 8;
              ParamPart = rtl.arraySetLength(ParamPart,TStringPart,NewLength);
              ParamBinding.set(rtl.arraySetLength(ParamBinding.get(),0,NewLength));
            };
            if (DoCreate) {
              tmpParam = this.FindParam(ParamName);
              if (!(tmpParam != null)) {
                ParameterIndex = this.CreateParam($mod.TFieldType.ftUnknown,ParamName,$mod.TParamType.ptInput).GetIndex()}
               else ParameterIndex = tmpParam.GetIndex();
            } else {
              if (ParamName !== "") {
                ParameterIndex = this.ParamByName(ParamName).GetIndex()}
               else {
                ParameterIndex = QuestionMarkParamCount;
                QuestionMarkParamCount += 1;
              };
            };
            if (ParameterStyle in rtl.createSet($mod.TParamStyle.psPostgreSQL,$mod.TParamStyle.psSimulated)) {
              i = ParameterIndex + 1;
              do {
                NewQueryLength += 1;
                i = rtl.trunc(i / 10);
              } while (!(i === 0));
            };
            ParamBinding.get()[ParamCount - 1] = ParameterIndex;
            ParamPart[ParamCount - 1].Start = ParamNameStart - BufStart;
            ParamPart[ParamCount - 1].Stop = (p - BufStart) + 1;
            NewQueryLength -= p - ParamNameStart;
          };
        } else if ($tmp === "\x00") {
          break}
         else {
          p += 1;
        };
      } while (!false);
      ParamPart = rtl.arraySetLength(ParamPart,TStringPart,ParamCount);
      ParamBinding.set(rtl.arraySetLength(ParamBinding.get(),0,ParamCount));
      if (ParamCount <= 0) {
        NewQuery = SQL}
       else {
        if ((ParameterStyle === $mod.TParamStyle.psSimulated) && (ReplaceString.get().length > 1)) NewQueryLength += ParamCount * (ReplaceString.get().length - 1);
        NewQuery = rtl.strSetLength(NewQuery,NewQueryLength);
        NewQueryIndex = 1;
        BufIndex = 1;
        for (var $l = 0, $end = rtl.length(ParamPart) - 1; $l <= $end; $l++) {
          i = $l;
          CopyLen = ParamPart[i].Start - BufIndex;
          NewQuery = NewQuery + pas.System.Copy(SQL,BufIndex,CopyLen);
          NewQueryIndex += CopyLen;
          var $tmp1 = ParameterStyle;
          if ($tmp1 === $mod.TParamStyle.psInterbase) {
            NewQuery = NewQuery + "?";
            NewQueryIndex += 1;
          } else if (($tmp1 === $mod.TParamStyle.psPostgreSQL) || ($tmp1 === $mod.TParamStyle.psSimulated)) {
            ParamName = pas.SysUtils.IntToStr(ParamBinding.get()[i] + 1);
            NewQuery = pas.System.StringOfChar("$",ReplaceString.get().length);
            NewQuery = NewQuery + ParamName;
          };
          BufIndex = ParamPart[i].Stop;
        };
        CopyLen = (SQL.length + 1) - BufIndex;
        if (CopyLen > 0) NewQuery = NewQuery + pas.System.Copy(SQL,BufIndex,CopyLen);
      };
      Result = NewQuery;
      return Result;
    };
    this.RemoveParam = function (Value) {
      Value.SetCollection(null);
    };
    this.CopyParamValuesFromDataset = function (ADataset, CopyBound) {
      var I = 0;
      var P = null;
      var F = null;
      if (ADataset != null) for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        P = this.GetItem$1(I);
        if (CopyBound || !P.FBound) {
          F = ADataset.FieldByName(P.FName);
          P.AssignField(F);
          if (!CopyBound) P.FBound = false;
        };
      };
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
  });
  this.TBookmarkFlag = {"0": "bfCurrent", bfCurrent: 0, "1": "bfBOF", bfBOF: 1, "2": "bfEOF", bfEOF: 2, "3": "bfInserted", bfInserted: 3};
  this.$rtti.$Enum("TBookmarkFlag",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TBookmarkFlag});
  rtl.recNewT(this,"TBookmark",function () {
    this.Data = undefined;
    this.Flag = 0;
    this.$eq = function (b) {
      return (this.Data === b.Data) && (this.Flag === b.Flag);
    };
    this.$assign = function (s) {
      this.Data = s.Data;
      this.Flag = s.Flag;
      return this;
    };
    var $r = $mod.$rtti.$Record("TBookmark",{},this);
    $r.addField("Data",rtl.jsvalue);
    $r.addField("Flag",$mod.$rtti["TBookmarkFlag"]);
  });
  this.TGetMode = {"0": "gmCurrent", gmCurrent: 0, "1": "gmNext", gmNext: 1, "2": "gmPrior", gmPrior: 2};
  this.$rtti.$Enum("TGetMode",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TGetMode});
  this.TGetResult = {"0": "grOK", grOK: 0, "1": "grBOF", grBOF: 1, "2": "grEOF", grEOF: 2, "3": "grError", grError: 3};
  this.$rtti.$Enum("TGetResult",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TGetResult});
  this.TResyncMode$a = {"0": "rmExact", rmExact: 0, "1": "rmCenter", rmCenter: 1};
  this.$rtti.$Enum("TResyncMode$a",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TResyncMode$a});
  this.$rtti.$Set("TResyncMode",{comptype: this.$rtti["TResyncMode$a"]});
  this.TDataAction = {"0": "daFail", daFail: 0, "1": "daAbort", daAbort: 1, "2": "daRetry", daRetry: 2};
  this.$rtti.$Enum("TDataAction",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TDataAction});
  this.TUpdateAction = {"0": "uaFail", uaFail: 0, "1": "uaAbort", uaAbort: 1, "2": "uaSkip", uaSkip: 2, "3": "uaRetry", uaRetry: 3, "4": "uaApplied", uaApplied: 4};
  this.$rtti.$Enum("TUpdateAction",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TUpdateAction});
  this.TUpdateKind = {"0": "ukModify", ukModify: 0, "1": "ukInsert", ukInsert: 1, "2": "ukDelete", ukDelete: 2};
  this.$rtti.$Enum("TUpdateKind",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TUpdateKind});
  this.TLocateOption = {"0": "loCaseInsensitive", loCaseInsensitive: 0, "1": "loPartialKey", loPartialKey: 1, "2": "loFromCurrent", loFromCurrent: 2};
  this.$rtti.$Enum("TLocateOption",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TLocateOption});
  this.$rtti.$Set("TLocateOptions",{comptype: this.$rtti["TLocateOption"]});
  this.$rtti.$MethodVar("TDataOperation",{procsig: rtl.newTIProcSig([]), methodkind: 0});
  this.$rtti.$MethodVar("TDataSetNotifyEvent",{procsig: rtl.newTIProcSig([["DataSet",this.$rtti["TDataSet"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TDataSetErrorEvent",{procsig: rtl.newTIProcSig([["DataSet",this.$rtti["TDataSet"]],["E",this.$rtti["EDatabaseError"]],["DataAction",this.$rtti["TDataAction"],1]]), methodkind: 0});
  this.TFilterOption = {"0": "foCaseInsensitive", foCaseInsensitive: 0, "1": "foNoPartialCompare", foNoPartialCompare: 1};
  this.$rtti.$Enum("TFilterOption",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TFilterOption});
  this.$rtti.$Set("TFilterOptions",{comptype: this.$rtti["TFilterOption"]});
  this.TLoadOption = {"0": "loNoOpen", loNoOpen: 0, "1": "loNoEvents", loNoEvents: 1, "2": "loAtEOF", loAtEOF: 2, "3": "loCancelPending", loCancelPending: 3};
  this.$rtti.$Enum("TLoadOption",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TLoadOption});
  this.$rtti.$Set("TLoadOptions",{comptype: this.$rtti["TLoadOption"]});
  this.$rtti.$MethodVar("TDatasetLoadEvent",{procsig: rtl.newTIProcSig([["DataSet",this.$rtti["TDataSet"]],["Data",rtl.jsvalue]]), methodkind: 0});
  this.$rtti.$MethodVar("TDatasetLoadFailEvent",{procsig: rtl.newTIProcSig([["DataSet",this.$rtti["TDataSet"]],["ID",rtl.longint],["ErrorMsg",rtl.string,2]]), methodkind: 0});
  this.$rtti.$MethodVar("TFilterRecordEvent",{procsig: rtl.newTIProcSig([["DataSet",this.$rtti["TDataSet"]],["Accept",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$ClassRef("TDatasetClass",{instancetype: this.$rtti["TDataSet"]});
  this.TRecordState = {"0": "rsNew", rsNew: 0, "1": "rsClean", rsClean: 1, "2": "rsUpdate", rsUpdate: 2, "3": "rsDelete", rsDelete: 3};
  this.$rtti.$Enum("TRecordState",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TRecordState});
  rtl.recNewT(this,"TDataRecord",function () {
    this.data = undefined;
    this.state = 0;
    this.bookmark = undefined;
    this.bookmarkFlag = 0;
    this.$eq = function (b) {
      return (this.data === b.data) && (this.state === b.state) && (this.bookmark === b.bookmark) && (this.bookmarkFlag === b.bookmarkFlag);
    };
    this.$assign = function (s) {
      this.data = s.data;
      this.state = s.state;
      this.bookmark = s.bookmark;
      this.bookmarkFlag = s.bookmarkFlag;
      return this;
    };
    var $r = $mod.$rtti.$Record("TDataRecord",{},this);
    $r.addField("data",rtl.jsvalue);
    $r.addField("state",$mod.$rtti["TRecordState"]);
    $r.addField("bookmark",rtl.jsvalue);
    $r.addField("bookmarkFlag",$mod.$rtti["TBookmarkFlag"]);
  });
  this.$rtti.$DynArray("TBuffers",{eltype: this.$rtti["TDataRecord"]});
  rtl.recNewT(this,"TResolveInfo",function () {
    this.Data = undefined;
    this.Status = 0;
    this.ResolveStatus = 0;
    this.Error = "";
    this._private = undefined;
    this.$new = function () {
      var r = Object.create(this);
      r.BookMark = $mod.TBookmark.$new();
      return r;
    };
    this.$eq = function (b) {
      return (this.Data === b.Data) && (this.Status === b.Status) && (this.ResolveStatus === b.ResolveStatus) && (this.Error === b.Error) && this.BookMark.$eq(b.BookMark) && (this._private === b._private);
    };
    this.$assign = function (s) {
      this.Data = s.Data;
      this.Status = s.Status;
      this.ResolveStatus = s.ResolveStatus;
      this.Error = s.Error;
      this.BookMark.$assign(s.BookMark);
      this._private = s._private;
      return this;
    };
    var $r = $mod.$rtti.$Record("TResolveInfo",{},this);
    $r.addField("Data",rtl.jsvalue);
    $r.addField("Status",$mod.$rtti["TUpdateStatus"]);
    $r.addField("ResolveStatus",$mod.$rtti["TResolveStatus"]);
    $r.addField("Error",rtl.string);
    $r.addField("BookMark",$mod.$rtti["TBookmark"]);
    $r.addField("_private",rtl.jsvalue);
  });
  this.$rtti.$DynArray("TResolveInfoArray",{eltype: this.$rtti["TResolveInfo"]});
  rtl.recNewT(this,"TResolveResults",function () {
    this.$new = function () {
      var r = Object.create(this);
      r.Records = [];
      return r;
    };
    this.$eq = function (b) {
      return this.Records === b.Records;
    };
    this.$assign = function (s) {
      this.Records = rtl.arrayRef(s.Records);
      return this;
    };
    var $r = $mod.$rtti.$Record("TResolveResults",{},this);
    $r.addField("Records",$mod.$rtti["TResolveInfoArray"]);
  });
  this.$rtti.$MethodVar("TOnRecordResolveEvent",{procsig: rtl.newTIProcSig([["Sender",this.$rtti["TDataSet"]],["info",this.$rtti["TResolveInfo"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TApplyUpdatesEvent",{procsig: rtl.newTIProcSig([["Sender",this.$rtti["TDataSet"]],["info",this.$rtti["TResolveResults"]]]), methodkind: 0});
  rtl.createClass(this,"TDataSet",pas.Classes.TComponent,function () {
    this.$init = function () {
      pas.Classes.TComponent.$init.call(this);
      this.FAfterApplyUpdates = null;
      this.FAfterLoad = null;
      this.FBeforeApplyUpdates = null;
      this.FBeforeLoad = null;
      this.FBlockReadSize = 0;
      this.FCalcBuffer = $mod.TDataRecord.$new();
      this.FCalcFieldsCount = 0;
      this.FOnLoadFail = null;
      this.FOnRecordResolved = null;
      this.FOpenAfterRead = false;
      this.FActiveRecord = 0;
      this.FAfterCancel = null;
      this.FAfterClose = null;
      this.FAfterDelete = null;
      this.FAfterEdit = null;
      this.FAfterInsert = null;
      this.FAfterOpen = null;
      this.FAfterPost = null;
      this.FAfterRefresh = null;
      this.FAfterScroll = null;
      this.FAutoCalcFields = false;
      this.FBOF = false;
      this.FBeforeCancel = null;
      this.FBeforeClose = null;
      this.FBeforeDelete = null;
      this.FBeforeEdit = null;
      this.FBeforeInsert = null;
      this.FBeforeOpen = null;
      this.FBeforePost = null;
      this.FBeforeRefresh = null;
      this.FBeforeScroll = null;
      this.FBlobFieldCount = 0;
      this.FBuffers = [];
      this.FBufferCount = 0;
      this.FConstraints = null;
      this.FDisableControlsCount = 0;
      this.FDisableControlsState = 0;
      this.FCurrentRecord = 0;
      this.FDataSources = null;
      this.FDefaultFields = false;
      this.FEOF = false;
      this.FEnableControlsEvent = 0;
      this.FFieldList = null;
      this.FFieldDefs = null;
      this.FFilterOptions = {};
      this.FFilterText = "";
      this.FFiltered = false;
      this.FFound = false;
      this.FInternalCalcFields = false;
      this.FModified = false;
      this.FOnCalcFields = null;
      this.FOnDeleteError = null;
      this.FOnEditError = null;
      this.FOnFilterRecord = null;
      this.FOnNewRecord = null;
      this.FOnPostError = null;
      this.FRecordCount = 0;
      this.FIsUniDirectional = false;
      this.FState = 0;
      this.FInternalOpenComplete = false;
      this.FDataProxy = null;
      this.FDataRequestID = 0;
      this.FUpdateBatchID = 0;
      this.FChangeList = null;
      this.FBatchList = null;
      this.FInApplyupdates = false;
      this.FLoadCount = 0;
      this.FMinLoadID = 0;
      this.FDataSetField = null;
      this.FNestedDataSets = null;
      this.FNestedDataSetClass = null;
    };
    this.$final = function () {
      this.FAfterApplyUpdates = undefined;
      this.FAfterLoad = undefined;
      this.FBeforeApplyUpdates = undefined;
      this.FBeforeLoad = undefined;
      this.FCalcBuffer = undefined;
      this.FOnLoadFail = undefined;
      this.FOnRecordResolved = undefined;
      this.FAfterCancel = undefined;
      this.FAfterClose = undefined;
      this.FAfterDelete = undefined;
      this.FAfterEdit = undefined;
      this.FAfterInsert = undefined;
      this.FAfterOpen = undefined;
      this.FAfterPost = undefined;
      this.FAfterRefresh = undefined;
      this.FAfterScroll = undefined;
      this.FBeforeCancel = undefined;
      this.FBeforeClose = undefined;
      this.FBeforeDelete = undefined;
      this.FBeforeEdit = undefined;
      this.FBeforeInsert = undefined;
      this.FBeforeOpen = undefined;
      this.FBeforePost = undefined;
      this.FBeforeRefresh = undefined;
      this.FBeforeScroll = undefined;
      this.FBuffers = undefined;
      this.FConstraints = undefined;
      this.FDataSources = undefined;
      this.FFieldList = undefined;
      this.FFieldDefs = undefined;
      this.FFilterOptions = undefined;
      this.FOnCalcFields = undefined;
      this.FOnDeleteError = undefined;
      this.FOnEditError = undefined;
      this.FOnFilterRecord = undefined;
      this.FOnNewRecord = undefined;
      this.FOnPostError = undefined;
      this.FDataProxy = undefined;
      this.FChangeList = undefined;
      this.FBatchList = undefined;
      this.FDataSetField = undefined;
      this.FNestedDataSets = undefined;
      this.FNestedDataSetClass = undefined;
      pas.Classes.TComponent.$final.call(this);
    };
    this.DoInsertAppend = function (DoAppend) {
      var $Self = this;
      function DoInsert(DoAppend) {
        var BookBeforeInsert = $mod.TBookmark.$new();
        var TempBuf = $mod.TDataRecord.$new();
        var I = 0;
        if ($Self.FRecordCount > 0) BookBeforeInsert.$assign($Self.GetBookmark());
        if (!DoAppend) {
          if ($Self.FRecordCount > 0) {
            TempBuf.$assign($Self.FBuffers[$Self.FBufferCount]);
            for (var $l = $Self.FBufferCount, $end = $Self.FActiveRecord + 1; $l >= $end; $l--) {
              I = $l;
              $Self.FBuffers[I].$assign($Self.FBuffers[I - 1]);
            };
            $Self.FBuffers[$Self.FActiveRecord].$assign(TempBuf);
          };
        } else if ($Self.FRecordCount === $Self.FBufferCount) {
          $Self.ShiftBuffersBackward()}
         else {
          if ($Self.FRecordCount > 0) $Self.FActiveRecord += 1;
        };
        $Self.InitRecord($Self.FBuffers[$Self.FActiveRecord]);
        $Self.CursorPosChanged();
        if ($Self.FRecordCount === 0) {
          $Self.SetBookmarkFlag($Self.FBuffers[$Self.FActiveRecord],$mod.TBookmarkFlag.bfEOF)}
         else {
          $Self.FBOF = false;
          if ($Self.FRecordCount > 0) {
            $Self.SetBookmarkData($Self.FBuffers[$Self.FActiveRecord],$mod.TBookmark.$clone(BookBeforeInsert));
            $Self.FreeBookmark($mod.TBookmark.$clone(BookBeforeInsert));
          };
        };
        $Self.InternalInsert();
        if ($Self.FRecordCount < $Self.FBufferCount) $Self.FRecordCount += 1;
      };
      this.CheckBrowseMode();
      if (!this.GetCanModify()) $mod.DatabaseError$1(rtl.getResStr(pas.DBConst,"SDatasetReadOnly"),$Self);
      this.DoBeforeInsert();
      this.DoBeforeScroll();
      if (!DoAppend) {
        DoInsert(false);
      } else {
        this.ClearBuffers();
        this.InternalLast();
        this.GetPriorRecords();
        if (this.FRecordCount > 0) this.FActiveRecord = this.FRecordCount - 1;
        DoInsert(true);
        this.SetBookmarkFlag(this.FBuffers[this.FActiveRecord],$mod.TBookmarkFlag.bfEOF);
        this.FBOF = false;
        this.FEOF = true;
      };
      this.SetState($mod.TDataSetState.dsInsert);
      try {
        this.DoOnNewRecord();
      } catch ($e) {
        this.SetCurrentRecord(this.FActiveRecord);
        this.Resync({});
        throw $e;
      };
      this.FModified = false;
      this.DataEvent($mod.TDataEvent.deDataSetChange,0);
      this.DoAfterInsert();
      this.DoAfterScroll();
    };
    this.DoInternalOpen = function () {
      this.InternalOpen();
      this.FInternalOpenComplete = true;
      this.FRecordCount = 0;
      this.RecalcBufListSize();
      this.FBOF = true;
      this.FEOF = this.FRecordCount === 0;
      this.InitChangeList();
    };
    this.GetBuffer = function (Index) {
      var Result = $mod.TDataRecord.$new();
      Result.$assign(this.FBuffers[Index]);
      return Result;
    };
    this.GetDataProxy = function () {
      var Result = null;
      if (this.FDataProxy === null) this.SetDataProxy(this.DoGetDataProxy());
      Result = this.FDataProxy;
      return Result;
    };
    this.GetIsLoading = function () {
      var Result = false;
      Result = this.FLoadCount > 0;
      return Result;
    };
    this.RegisterDataSource = function (ADataSource) {
      this.FDataSources.Add(ADataSource);
      this.RecalcBufListSize();
    };
    this.SetConstraints = function (Value) {
      this.FConstraints.Assign(Value);
    };
    this.SetDataProxy = function (AValue) {
      if (AValue === this.FDataProxy) return;
      if (this.FDataProxy != null) this.FDataProxy.RemoveFreeNotification(this);
      this.FDataProxy = AValue;
      if (this.FDataProxy != null) this.FDataProxy.FreeNotification(this);
    };
    this.ShiftBuffersForward = function () {
      var TempBuf = $mod.TDataRecord.$new();
      var I = 0;
      TempBuf.$assign(this.FBuffers[this.FBufferCount]);
      for (var $l = this.FBufferCount; $l >= 1; $l--) {
        I = $l;
        this.FBuffers[I].$assign(this.FBuffers[I - 1]);
      };
      this.FBuffers[0].$assign(TempBuf);
    };
    this.ShiftBuffersBackward = function () {
      var TempBuf = $mod.TDataRecord.$new();
      var I = 0;
      TempBuf.$assign(this.FBuffers[0]);
      for (var $l = 1, $end = this.FBufferCount; $l <= $end; $l++) {
        I = $l;
        this.FBuffers[I - 1].$assign(this.FBuffers[I]);
      };
      this.FBuffers[this.FBufferCount].$assign(TempBuf);
    };
    this.TryDoing = function (P, Ev) {
      var Result = false;
      var Retry = 0;
      Result = true;
      Retry = $mod.TDataAction.daRetry;
      while (Retry === $mod.TDataAction.daRetry) try {
        this.UpdateCursorPos();
        P();
        return Result;
      } catch ($e) {
        if ($mod.EDatabaseError.isPrototypeOf($e)) {
          var E = $e;
          Retry = $mod.TDataAction.daFail;
          if (Ev != null) Ev(this,E,{get: function () {
              return Retry;
            }, set: function (v) {
              Retry = v;
            }});
          var $tmp = Retry;
          if ($tmp === $mod.TDataAction.daFail) {
            throw $e}
           else if ($tmp === $mod.TDataAction.daAbort) pas.SysUtils.Abort();
        } else {
          throw $e;
        }
      };
      return Result;
    };
    this.GetActive = function () {
      var Result = false;
      Result = (this.FState !== $mod.TDataSetState.dsInactive) && (this.FState !== $mod.TDataSetState.dsOpening);
      return Result;
    };
    this.UnRegisterDataSource = function (ADataSource) {
      this.FDataSources.Remove(ADataSource);
    };
    this.SetBlockReadSize = function (AValue) {
      this.FBlockReadSize = AValue;
      if (AValue > 0) {
        this.CheckActive();
        this.SetState($mod.TDataSetState.dsBlockRead);
      } else {
        if (this.FState === $mod.TDataSetState.dsBlockRead) this.SetState($mod.TDataSetState.dsBrowse);
      };
    };
    this.SetFieldDefs = function (AFieldDefs) {
      this.FFieldList.ClearFieldDefs();
      this.FFieldDefs.Assign$2(AFieldDefs);
    };
    this.DoInsertAppendRecord = function (Values, DoAppend) {
      var i = 0;
      var ValuesSize = 0;
      ValuesSize = rtl.length(Values);
      if (ValuesSize > this.GetfieldCount()) $mod.DatabaseError$1(rtl.getResStr(pas.DBConst,"STooManyFields"),this);
      if (DoAppend) {
        this.Append()}
       else this.Insert$1();
      for (var $l = 0, $end = ValuesSize - 1; $l <= $end; $l++) {
        i = $l;
        this.FFieldList.GetField(i).AssignValue(Values[i]);
      };
      this.Post();
    };
    this.ResolveRecordUpdate = function (anUpdate) {
      var Result = false;
      try {
        Result = this.DoResolveRecordUpdate(anUpdate);
        if (!Result) anUpdate.SetResolveStatus($mod.TResolveStatus.rsResolveFailed);
      } catch ($e) {
        if (pas.SysUtils.Exception.isPrototypeOf($e)) {
          var E = $e;
          anUpdate.ResolveFailed(E.$classname + ": " + E.FMessage);
          Result = false;
        } else throw $e
      };
      this.DoOnRecordResolved(anUpdate);
      return Result;
    };
    this.HandleRequestResponse = function (ARequest) {
      var DataAdded = false;
      if (!(ARequest != null)) return;
      if (ARequest.FRequestID <= this.FMinLoadID) {
        ARequest.$destroy("Destroy");
        return;
      };
      this.FLoadCount -= 1;
      var $tmp = ARequest.FSuccess;
      if ($tmp === $mod.TDataRequestResult.rrFail) {
        if (this.FOnLoadFail != null) this.FOnLoadFail(this,ARequest.FRequestID,ARequest.FErrorMsg);
      } else if (($tmp === $mod.TDataRequestResult.rrEOF) || ($tmp === $mod.TDataRequestResult.rrOK)) {
        DataAdded = false;
        if (ARequest.FEvent != null) ARequest.FEvent(this,ARequest.FData);
        if (ARequest.FSuccess !== $mod.TDataRequestResult.rrEOF) DataAdded = this.DataPacketReceived(ARequest);
        if (!(this.GetActive() || ($mod.TLoadOption.loNoOpen in ARequest.FLoadOptions))) {
          if (!($mod.TLoadOption.loNoEvents in ARequest.FLoadOptions)) this.DoAfterLoad();
          this.Open();
        } else {
          if (($mod.TLoadOption.loAtEOF in ARequest.FLoadOptions) && DataAdded) this.FEOF = false;
          if (!($mod.TLoadOption.loNoEvents in ARequest.FLoadOptions)) this.DoAfterLoad();
        };
      };
      ARequest.$destroy("Destroy");
    };
    this.GetNestedDataSets = function () {
      var Result = null;
      if (!(this.FNestedDataSets != null)) this.FNestedDataSets = pas.Classes.TFPList.$create("Create");
      Result = this.FNestedDataSets;
      return Result;
    };
    this.DoOnRecordResolved = function (anUpdate) {
      var Info = $mod.TResolveInfo.$new();
      if (!(this.FOnRecordResolved != null)) return;
      Info.$assign(this.RecordUpdateDescriptorToResolveInfo(anUpdate));
      this.FOnRecordResolved(this,$mod.TResolveInfo.$clone(Info));
    };
    this.RecordUpdateDescriptorToResolveInfo = function (anUpdate) {
      var Result = $mod.TResolveInfo.$new();
      Result.BookMark.$assign(anUpdate.FBookmark);
      Result.Data = anUpdate.FData;
      Result.Status = anUpdate.FStatus;
      Result.ResolveStatus = anUpdate.FResolveStatus;
      Result.Error = anUpdate.FResolveError;
      return Result;
    };
    this.DoResolveRecordUpdate = function (anUpdate) {
      var Result = false;
      Result = true;
      return Result;
    };
    this.GetRecordUpdates = function (AList) {
      var Result = 0;
      var I = 0;
      var MinIndex = 0;
      MinIndex = 0;
      for (var $l = MinIndex, $end = this.FChangeList.FCount - 1; $l <= $end; $l++) {
        I = $l;
        if (rtl.getObject(this.FChangeList.Get(I)).FResolveStatus === $mod.TResolveStatus.rsUnresolved) AList.Add(this.FChangeList.Get(I));
      };
      Result = this.FChangeList.FCount;
      return Result;
    };
    this.ResolveUpdateBatch = function (Sender, aBatch) {
      var BI = 0;
      var RI = 0;
      var Idx = 0;
      var RUD = null;
      var doRemove = false;
      var Results = $mod.TResolveResults.$new();
      if ((this.FBatchList != null) && (aBatch.FDataset === this)) {
        BI = this.FBatchList.IndexOf(aBatch)}
       else BI = -1;
      if (BI === -1) return;
      this.FBatchList.Delete(BI);
      Results.Records = rtl.arraySetLength(Results.Records,$mod.TResolveInfo,aBatch.FList.FCount);
      for (var $l = 0, $end = aBatch.FList.FCount - 1; $l <= $end; $l++) {
        RI = $l;
        RUD = aBatch.FList.GetUpdate(RI);
        Results.Records[RI].$assign(this.RecordUpdateDescriptorToResolveInfo(RUD));
        aBatch.FList.Put(RI,null);
        Idx = this.IndexInChangeList($mod.TBookmark.$clone(RUD.FBookmark));
        if (Idx !== -1) {
          doRemove = false;
          if (RUD.FResolveStatus === $mod.TResolveStatus.rsResolved) {
            doRemove = this.ResolveRecordUpdate(RUD)}
           else doRemove = RUD.FResolveStatus === $mod.TResolveStatus.rsResolved;
          if (doRemove) {
            RUD = rtl.freeLoc(RUD);
            this.FChangeList.Delete(Idx);
          } else RUD.Reset();
        };
      };
      if (this.FBatchList.FCount === 0) pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FBatchList;
        }, set: function (v) {
          this.p.FBatchList = v;
        }});
      this.DoAfterApplyUpdates(Results);
    };
    this.DataPacketReceived = function (ARequest) {
      var Result = false;
      Result = false;
      return Result;
    };
    this.DoLoad = function (aOptions, aAfterLoad) {
      var Result = false;
      var Request = null;
      if (!($mod.TLoadOption.loNoEvents in aOptions)) this.DoBeforeLoad();
      Result = this.GetDataProxy() !== null;
      if (!Result) return Result;
      Request = this.GetDataProxy().GetDataRequest(rtl.refSet(aOptions),rtl.createCallback(this,"HandleRequestResponse"),aAfterLoad);
      Request.FDataset = this;
      if (this.GetActive()) Request.FBookmark.$assign(this.GetBookmark());
      this.FDataRequestID += 1;
      Request.FRequestID = this.FDataRequestID;
      if (this.GetDataProxy().DoGetData(Request)) {
        this.FLoadCount += 1}
       else Request = rtl.freeLoc(Request);
      return Result;
    };
    this.DoGetDataProxy = function () {
      var Result = null;
      Result = null;
      return Result;
    };
    this.InitChangeList = function () {
      this.DoneChangeList();
      this.FChangeList = pas.Classes.TFPList.$create("Create");
    };
    this.DoneChangeList = function () {
      this.ClearChangeList();
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FChangeList;
        }, set: function (v) {
          this.p.FChangeList = v;
        }});
    };
    this.ClearChangeList = function () {
      var I = 0;
      if (!(this.FChangeList != null)) return;
      for (var $l = 0, $end = this.FChangeList.FCount - 1; $l <= $end; $l++) {
        I = $l;
        rtl.getObject(this.FChangeList.Get(I)).$destroy("Destroy");
        this.FChangeList.Put(I,null);
      };
    };
    this.ResetUpdateDescriptors = function () {
      var I = 0;
      for (var $l = 0, $end = this.FChangeList.FCount - 1; $l <= $end; $l++) {
        I = $l;
        rtl.getObject(this.FChangeList.Get(I)).Reset();
      };
    };
    this.GetApplyUpdateData = function (aBuffer) {
      var Result = undefined;
      Result = aBuffer.data;
      return Result;
    };
    this.IndexInChangeList = function (aBookmark) {
      var Result = 0;
      Result = -1;
      if (!(this.FChangeList != null)) return Result;
      Result = this.FChangeList.FCount - 1;
      while ((Result >= 0) && (this.CompareBookmarks($mod.TBookmark.$clone(aBookmark),$mod.TBookmark.$clone(rtl.getObject(this.FChangeList.Get(Result)).FBookmark)) !== 0)) Result -= 1;
      return Result;
    };
    this.AddToChangeList = function (aChange) {
      var Result = null;
      var B = $mod.TBookmark.$new();
      var I = 0;
      var aData = undefined;
      Result = null;
      if (!(this.FChangeList != null)) return Result;
      B.$assign(this.GetBookmark());
      I = this.IndexInChangeList($mod.TBookmark.$clone(B));
      if (I === -1) {
        aData = this.GetApplyUpdateData($mod.TDataRecord.$clone(this.ActiveBuffer()));
        if (this.GetDataProxy() != null) {
          Result = this.GetDataProxy().GetUpdateDescriptor(this,$mod.TBookmark.$clone(B),aData,aChange)}
         else Result = $mod.TRecordUpdateDescriptor.$create("Create$1",[null,this,$mod.TBookmark.$clone(B),aData,aChange]);
        this.FChangeList.Add(Result);
      } else {
        Result = rtl.getObject(this.FChangeList.Get(I));
        var $tmp = aChange;
        if ($tmp === $mod.TUpdateStatus.usDeleted) {
          if (Result.FStatus === $mod.TUpdateStatus.usInserted) {
            this.FChangeList.Delete(I)}
           else Result.FStatus = $mod.TUpdateStatus.usDeleted;
        } else if ($tmp === $mod.TUpdateStatus.usInserted) {
          $mod.DatabaseError$1(rtl.getResStr(pas.DBConst,"SErrInsertingSameRecordtwice"),this)}
         else if ($tmp === $mod.TUpdateStatus.usModified) Result.FData = this.GetApplyUpdateData($mod.TDataRecord.$clone(this.ActiveBuffer()));
      };
      return Result;
    };
    this.RemoveFromChangeList = function (R) {
      if (!((R != null) && (this.FChangeList != null))) return;
    };
    this.DoApplyUpdates = function () {
      var B = null;
      var l = null;
      var I = 0;
      if (!(this.GetDataProxy() != null)) $mod.DatabaseError$1(rtl.getResStr(pas.DBConst,"SErrDoApplyUpdatesNeedsProxy"),this);
      if (this.FInApplyupdates) return;
      try {
        this.FInApplyupdates = true;
        if (!((this.FChangeList != null) && (this.FChangeList.FCount > 0))) return;
        l = $mod.TRecordUpdateDescriptorList.$create("Create");
        try {
          I = this.GetRecordUpdates(l);
        } catch ($e) {
          l = rtl.freeLoc(l);
          throw $e;
        };
        this.FUpdateBatchID += 1;
        for (var $l = 0, $end = l.FCount - 1; $l <= $end; $l++) {
          I = $l;
          l.GetUpdate(I).SetResolveStatus($mod.TResolveStatus.rsResolving);
        };
        B = this.GetDataProxy().GetRecordUpdateBatch(this.FUpdateBatchID,l,true);
        B.FDataset = this;
        B.FLastChangeIndex = I;
        B.FOnResolve = rtl.createCallback(this,"ResolveUpdateBatch");
        if (!(this.FBatchList != null)) this.FBatchList = pas.Classes.TFPList.$create("Create");
        this.FBatchList.Add(B);
        this.GetDataProxy().ProcessUpdateBatch(B);
      } finally {
        this.FInApplyupdates = false;
      };
    };
    this.RecalcBufListSize = function () {
      var i = 0;
      var j = 0;
      var ABufferCount = 0;
      var DataLink = null;
      if (!this.IsCursorOpen()) return;
      if (this.FIsUniDirectional) {
        ABufferCount = 1}
       else ABufferCount = 10;
      for (var $l = 0, $end = this.FDataSources.FCount - 1; $l <= $end; $l++) {
        i = $l;
        for (var $l1 = 0, $end1 = rtl.getObject(this.FDataSources.Get(i)).FDataLinks.GetCount() - 1; $l1 <= $end1; $l1++) {
          j = $l1;
          DataLink = rtl.getObject(rtl.getObject(this.FDataSources.Get(i)).FDataLinks.Get(j));
          if (ABufferCount < DataLink.GetBufferCount()) ABufferCount = DataLink.GetBufferCount();
        };
      };
      if (this.FBufferCount === ABufferCount) return;
      this.SetBufListSize(ABufferCount);
      this.GetNextRecords();
      if ((this.FRecordCount < this.FBufferCount) && !this.FIsUniDirectional) {
        this.FActiveRecord = this.FActiveRecord + this.GetPriorRecords();
        this.CursorPosChanged();
      };
    };
    this.ActivateBuffers = function () {
      this.FBOF = false;
      this.FEOF = false;
      this.FActiveRecord = 0;
    };
    this.BindFields = function (Binding) {
      var i = 0;
      var FieldIndex = 0;
      var FieldDef = null;
      var Field = null;
      this.FCalcFieldsCount = 0;
      this.FBlobFieldCount = 0;
      for (var $l = 0, $end = this.FFieldList.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        Field = this.FFieldList.GetField(i);
        Field.FFieldDef = null;
        if (!Binding) {
          Field.FFieldNo = 0}
         else if (Field.FFieldKind in rtl.createSet($mod.TFieldKind.fkCalculated,$mod.TFieldKind.fkLookup)) {
          Field.FFieldNo = -1;
          this.FCalcFieldsCount += 1;
        } else {
          FieldIndex = this.FFieldDefs.IndexOf(Field.FFieldName);
          if (FieldIndex === -1) {
            $mod.DatabaseErrorFmt$1(rtl.getResStr(pas.DBConst,"SFieldNotFound"),pas.System.VarRecs(18,Field.FFieldName),this)}
           else {
            FieldDef = this.FFieldDefs.GetItem$1(FieldIndex);
            Field.FFieldDef = FieldDef;
            Field.FFieldNo = FieldDef.FFieldNo;
            if (FieldDef.FInternalCalcField) this.FInternalCalcFields = true;
            if (Field.$class.IsBlob()) {
              Field.FSize = FieldDef.FSize;
              this.FBlobFieldCount += 1;
            };
          };
        };
        Field.Bind(Binding);
      };
    };
    this.BlockReadNext = function () {
      this.MoveBy(1);
    };
    var BookmarkStates = rtl.createSet($mod.TDataSetState.dsBrowse,$mod.TDataSetState.dsEdit,$mod.TDataSetState.dsInsert);
    this.BookmarkAvailable = function () {
      var Result = false;
      Result = !this.IsEmpty() && !this.FIsUniDirectional && (this.FState in BookmarkStates) && (this.GetBookmarkFlag($mod.TDataRecord.$clone(this.ActiveBuffer())) === $mod.TBookmarkFlag.bfCurrent);
      return Result;
    };
    this.CalculateFields = function (Buffer) {
      var i = 0;
      this.FCalcBuffer.$assign(Buffer);
      if (this.FState !== $mod.TDataSetState.dsInternalCalc) {
        this.ClearCalcFields(this.FCalcBuffer);
        if (!this.FIsUniDirectional) for (var $l = 0, $end = this.FFieldList.GetCount() - 1; $l <= $end; $l++) {
          i = $l;
          if (this.FFieldList.GetField(i).FFieldKind === $mod.TFieldKind.fkLookup) this.FFieldList.GetField(i).CalcLookupValue();
        };
      };
      this.DoOnCalcFields();
    };
    this.CheckActive = function () {
      if (!this.GetActive()) $mod.DatabaseError$1(rtl.getResStr(pas.DBConst,"SInactiveDataset"),this);
    };
    this.CheckInactive = function () {
      if (this.GetActive()) $mod.DatabaseError$1(rtl.getResStr(pas.DBConst,"SActiveDataset"),this);
    };
    this.CheckBiDirectional = function () {
      if (this.FIsUniDirectional) $mod.DatabaseError$1(rtl.getResStr(pas.DBConst,"SUniDirectional"),this);
    };
    this.Loaded = function () {
      pas.Classes.TComponent.Loaded.call(this);
      try {
        if (this.FOpenAfterRead) this.SetActive(true);
      } catch ($e) {
        if (pas.SysUtils.Exception.isPrototypeOf($e)) {
          var E = $e;
          if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) this.InternalHandleException(E);
        } else {
          throw $e;
        }
      };
    };
    this.ClearBuffers = function () {
      this.FRecordCount = 0;
      this.FActiveRecord = 0;
      this.FCurrentRecord = -1;
      this.FBOF = true;
      this.FEOF = true;
    };
    this.ClearCalcFields = function (Buffer) {
    };
    this.CloseBlob = function (Field) {
    };
    this.CloseCursor = function () {
      this.ClearBuffers();
      this.SetBufListSize(1);
      this.FFieldList.ClearFieldDefs();
      this.InternalClose();
      this.FInternalOpenComplete = false;
    };
    this.CreateFields = function () {
      var I = 0;
      for (var $l = 0, $end = this.FFieldDefs.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (this.FFieldDefs.GetItem$1(I).FDataType !== $mod.TFieldType.ftUnknown) {
          this.FFieldDefs.GetItem$1(I).CreateField(this);
        };
      };
    };
    this.DataEvent = function (Event, Info) {
      var $Self = this;
      function HandleFieldChange(aField) {
        if (aField.FFieldKind in rtl.createSet($mod.TFieldKind.fkData,$mod.TFieldKind.fkInternalCalc)) $Self.SetModified(true);
        if ($Self.FState !== $mod.TDataSetState.dsSetKey) {
          if (aField.FFieldKind === $mod.TFieldKind.fkData) {
            if ($Self.FInternalCalcFields) {
              $Self.RefreshInternalCalcFields($Self.FBuffers[$Self.FActiveRecord])}
             else if ($Self.FAutoCalcFields && ($Self.FCalcFieldsCount !== 0)) $Self.CalculateFields($Self.FBuffers[$Self.FActiveRecord]);
          };
          aField.Change();
        };
      };
      function HandleScrollOrChange() {
        var A = 0;
        var NestedDataSet = null;
        if ($Self.FState !== $mod.TDataSetState.dsInsert) $Self.UpdateCursorPos();
        if ($Self.FNestedDataSets != null) for (var $l = 0, $end = $Self.GetNestedDataSets().FCount - 1; $l <= $end; $l++) {
          A = $l;
          NestedDataSet = rtl.getObject($Self.GetNestedDataSets().Get(A));
          if (NestedDataSet.GetActive()) NestedDataSet.DataEvent($mod.TDataEvent.deParentScroll,0);
        };
      };
      var i = 0;
      var $tmp = Event;
      if ($tmp === $mod.TDataEvent.deFieldChange) {
        HandleFieldChange(rtl.getObject(Info))}
       else if (($tmp === $mod.TDataEvent.deDataSetChange) || ($tmp === $mod.TDataEvent.deDataSetScroll)) {
        HandleScrollOrChange()}
       else if ($tmp === $mod.TDataEvent.deLayoutChange) this.FEnableControlsEvent = $mod.TDataEvent.deLayoutChange;
      if (!this.ControlsDisabled() && (this.FState !== $mod.TDataSetState.dsBlockRead)) {
        for (var $l = 0, $end = this.FDataSources.FCount - 1; $l <= $end; $l++) {
          i = $l;
          rtl.getObject(this.FDataSources.Get(i)).ProcessEvent(Event,Info);
        };
      };
    };
    this.DestroyFields = function () {
      this.FFieldList.Clear();
    };
    this.DoAfterCancel = function () {
      if (this.FAfterCancel != null) this.FAfterCancel(this);
    };
    this.DoAfterClose = function () {
      if ((this.FAfterClose != null) && !(pas.Classes.TComponentStateItem.csDestroying in this.FComponentState)) this.FAfterClose(this);
    };
    this.DoAfterDelete = function () {
      if (this.FAfterDelete != null) this.FAfterDelete(this);
    };
    this.DoAfterEdit = function () {
      if (this.FAfterEdit != null) this.FAfterEdit(this);
    };
    this.DoAfterInsert = function () {
      if (this.FAfterInsert != null) this.FAfterInsert(this);
    };
    this.DoAfterOpen = function () {
      if (this.FAfterOpen != null) this.FAfterOpen(this);
    };
    this.DoAfterPost = function () {
      if (this.FAfterPost != null) this.FAfterPost(this);
    };
    this.DoAfterScroll = function () {
      if (this.FAfterScroll != null) this.FAfterScroll(this);
    };
    this.DoAfterRefresh = function () {
      if (this.FAfterRefresh != null) this.FAfterRefresh(this);
    };
    this.DoBeforeCancel = function () {
      if (this.FBeforeCancel != null) this.FBeforeCancel(this);
    };
    this.DoBeforeClose = function () {
      if ((this.FBeforeClose != null) && !(pas.Classes.TComponentStateItem.csDestroying in this.FComponentState)) this.FBeforeClose(this);
    };
    this.DoBeforeDelete = function () {
      if (this.FBeforeDelete != null) this.FBeforeDelete(this);
    };
    this.DoBeforeEdit = function () {
      if (this.FBeforeEdit != null) this.FBeforeEdit(this);
    };
    this.DoBeforeInsert = function () {
      if (this.FBeforeInsert != null) this.FBeforeInsert(this);
    };
    this.DoBeforeOpen = function () {
      if (this.FBeforeOpen != null) this.FBeforeOpen(this);
    };
    this.DoBeforePost = function () {
      if (this.FBeforePost != null) this.FBeforePost(this);
    };
    this.DoBeforeScroll = function () {
      if (this.FBeforeScroll != null) this.FBeforeScroll(this);
    };
    this.DoBeforeRefresh = function () {
      if (this.FBeforeRefresh != null) this.FBeforeRefresh(this);
    };
    this.DoOnCalcFields = function () {
      if (this.FOnCalcFields != null) this.FOnCalcFields(this);
    };
    this.DoOnNewRecord = function () {
      if (this.FOnNewRecord != null) this.FOnNewRecord(this);
    };
    this.DoBeforeLoad = function () {
      if (this.FBeforeLoad != null) this.FBeforeLoad(this);
    };
    this.DoAfterLoad = function () {
      if (this.FAfterLoad != null) this.FAfterLoad(this);
    };
    this.DoBeforeApplyUpdates = function () {
      if (this.FBeforeApplyUpdates != null) this.FBeforeApplyUpdates(this);
    };
    this.DoAfterApplyUpdates = function (ResolveInfo) {
      if (this.FAfterApplyUpdates != null) this.FAfterApplyUpdates(this,$mod.TResolveResults.$clone(ResolveInfo));
    };
    this.FieldByNumber = function (FieldNo) {
      var Result = null;
      Result = this.FFieldList.FieldByNumber(FieldNo);
      return Result;
    };
    this.FindRecord = function (Restart, GoForward) {
      var Result = false;
      Result = false;
      return Result;
    };
    this.GetBookmarkStr = function () {
      var Result = "";
      var B = $mod.TBookmark.$new();
      Result = "";
      if (this.BookmarkAvailable()) {
        this.GetBookmarkData($mod.TDataRecord.$clone(this.ActiveBuffer()),B);
        Result = JSON.stringify($mod.TBookmark.$clone(B));
      };
      return Result;
    };
    this.GetCalcFields = function (Buffer) {
      var OldState = 0;
      if ((this.FCalcFieldsCount > 0) || this.FInternalCalcFields) {
        OldState = this.FState;
        this.FState = $mod.TDataSetState.dsCalcFields;
        try {
          this.CalculateFields(Buffer);
        } finally {
          this.FState = OldState;
        };
      };
    };
    this.GetCanModify = function () {
      var Result = false;
      Result = !this.FIsUniDirectional;
      return Result;
    };
    this.GetChildren = function (Proc, Root) {
      var I = 0;
      var Field = null;
      for (var $l = 0, $end = this.FFieldList.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        Field = this.FFieldList.GetField(I);
        if (Field.FOwner === Root) Proc(Field);
      };
    };
    this.GetFieldClass = function (FieldType) {
      var Result = null;
      Result = $mod.DefaultFieldClasses[FieldType];
      return Result;
    };
    this.GetfieldCount = function () {
      var Result = 0;
      Result = this.FFieldList.GetCount();
      return Result;
    };
    this.GetFieldValues = function (FieldName) {
      var Result = undefined;
      var i = 0;
      var FieldList = null;
      var A = [];
      FieldList = pas.Classes.TList.$create("Create$1");
      try {
        this.GetFieldList(FieldList,FieldName);
        if (FieldList.GetCount() > 1) {
          A = rtl.arraySetLength(A,undefined,FieldList.GetCount());
          for (var $l = 0, $end = FieldList.GetCount() - 1; $l <= $end; $l++) {
            i = $l;
            A[i] = rtl.getObject(FieldList.Get(i)).GetAsJSValue();
          };
          Result = A;
        } else Result = this.FieldByName(FieldName).GetAsJSValue();
      } finally {
        FieldList = rtl.freeLoc(FieldList);
      };
      return Result;
    };
    this.GetIsIndexField = function (Field) {
      var Result = false;
      Result = false;
      return Result;
    };
    this.GetIndexDefs = function (IndexDefs, IndexTypes) {
      var Result = null;
      var i = 0;
      var f = 0;
      var IndexFields = null;
      IndexDefs.Update$1();
      Result = $mod.TIndexDefs.$create("Create$4",[this]);
      Result.Assign(IndexDefs);
      i = 0;
      IndexFields = pas.Classes.TStringList.$create("Create$1");
      while (i < Result.GetCount()) {
        if (!(rtl.eqSet(IndexTypes,{}) && rtl.eqSet(Result.GetItem$1(i).FOptions,{})) && rtl.eqSet(rtl.intersectSet(IndexTypes,Result.GetItem$1(i).FOptions),{})) {
          Result.Delete(i);
          i -= 1;
        } else {
          for (var $l = 0, $end = IndexFields.GetCount() - 1; $l <= $end; $l++) {
            f = $l;
            if (this.FindField(IndexFields.Get(f)) === null) {
              Result.Delete(i);
              i -= 1;
              break;
            };
          };
        };
        i += 1;
      };
      IndexFields = rtl.freeLoc(IndexFields);
      return Result;
    };
    this.GetNextRecords = function () {
      var Result = 0;
      Result = 0;
      while ((this.FRecordCount < this.FBufferCount) && this.GetNextRecord()) Result += 1;
      return Result;
    };
    this.GetNextRecord = function () {
      var Result = false;
      var T = $mod.TDataRecord.$new();
      if (this.FRecordCount > 0) this.SetCurrentRecord(this.FRecordCount - 1);
      Result = this.GetRecord(this.FBuffers[this.FBufferCount],$mod.TGetMode.gmNext,true) === $mod.TGetResult.grOK;
      if (Result) {
        if (this.FRecordCount === 0) this.ActivateBuffers();
        if (this.FRecordCount === this.FBufferCount) {
          this.ShiftBuffersBackward()}
         else {
          this.FRecordCount += 1;
          this.FCurrentRecord = this.FRecordCount - 1;
          T.$assign(this.FBuffers[this.FCurrentRecord]);
          this.FBuffers[this.FCurrentRecord].$assign(this.FBuffers[this.FBufferCount]);
          this.FBuffers[this.FBufferCount].$assign(T);
        };
      } else this.CursorPosChanged();
      return Result;
    };
    this.GetPriorRecords = function () {
      var Result = 0;
      Result = 0;
      while ((this.FRecordCount < this.FBufferCount) && this.GetPriorRecord()) Result += 1;
      return Result;
    };
    this.GetPriorRecord = function () {
      var Result = false;
      this.CheckBiDirectional();
      if (this.FRecordCount > 0) this.SetCurrentRecord(0);
      Result = this.GetRecord(this.FBuffers[this.FBufferCount],$mod.TGetMode.gmPrior,true) === $mod.TGetResult.grOK;
      if (Result) {
        if (this.FRecordCount === 0) this.ActivateBuffers();
        this.ShiftBuffersForward();
        if (this.FRecordCount < this.FBufferCount) this.FRecordCount += 1;
      } else this.CursorPosChanged();
      return Result;
    };
    this.GetRecordCount = function () {
      var Result = 0;
      Result = -1;
      return Result;
    };
    this.GetRecNo = function () {
      var Result = 0;
      Result = -1;
      return Result;
    };
    this.InitFieldDefs = function () {
      if (this.IsCursorOpen()) {
        this.InternalInitFieldDefs()}
       else {
        try {
          this.OpenCursor(true);
        } finally {
          this.CloseCursor();
        };
      };
    };
    this.InitFieldDefsFromfields = function () {
      var i = 0;
      if (this.FFieldDefs.GetCount() === 0) {
        this.FFieldDefs.BeginUpdate();
        try {
          for (var $l = 0, $end = this.FFieldList.GetCount() - 1; $l <= $end; $l++) {
            i = $l;
            if (!(this.FFieldList.GetField(i).FFieldKind in rtl.createSet($mod.TFieldKind.fkCalculated,$mod.TFieldKind.fkLookup))) {
              this.FFieldList.GetField(i).FFieldDef = this.FFieldDefs.$class.FieldDefClass().$create("Create$3",[this.FFieldDefs,this.FFieldList.GetField(i).FFieldName,this.FFieldList.GetField(i).FDataType,this.FFieldList.GetField(i).FSize,this.FFieldList.GetField(i).FRequired,this.FFieldDefs.GetCount() + 1]);
              if (this.FFieldList.GetField(i).FRequired) this.FFieldList.GetField(i).FFieldDef.SetAttributes(rtl.unionSet(this.FFieldList.GetField(i).FFieldDef.FAttributes,rtl.createSet($mod.TFieldAttribute.faRequired)));
              if (this.FFieldList.GetField(i).FReadOnly) this.FFieldList.GetField(i).FFieldDef.SetAttributes(rtl.unionSet(this.FFieldList.GetField(i).FFieldDef.FAttributes,rtl.createSet($mod.TFieldAttribute.faReadonly)));
            };
          };
        } finally {
          this.FFieldDefs.EndUpdate();
        };
      };
    };
    this.InitRecord = function (Buffer) {
      this.InternalInitRecord(Buffer);
      this.ClearCalcFields(Buffer);
    };
    this.InternalCancel = function () {
    };
    this.InternalEdit = function () {
    };
    this.InternalInsert = function () {
    };
    this.InternalRefresh = function () {
    };
    this.OpenCursor = function (InfoQuery) {
      if (InfoQuery) {
        this.InternalInitFieldDefs()}
       else if (this.FState !== $mod.TDataSetState.dsOpening) this.DoInternalOpen();
    };
    this.OpenCursorcomplete = function () {
      try {
        if (this.FState === $mod.TDataSetState.dsOpening) this.DoInternalOpen();
      } finally {
        if (this.FInternalOpenComplete) {
          this.SetState($mod.TDataSetState.dsBrowse);
          this.DoAfterOpen();
          if (!this.IsEmpty()) this.DoAfterScroll();
        } else {
          this.SetState($mod.TDataSetState.dsInactive);
          this.CloseCursor();
        };
      };
    };
    this.RefreshInternalCalcFields = function (Buffer) {
    };
    this.RestoreState = function (Value) {
      this.FState = Value;
      this.FDisableControlsCount -= 1;
    };
    this.SetActive = function (Value) {
      if (Value && (this.FState === $mod.TDataSetState.dsInactive)) {
        if (pas.Classes.TComponentStateItem.csLoading in this.FComponentState) {
          this.FOpenAfterRead = true;
          return;
        } else {
          this.DoBeforeOpen();
          this.FEnableControlsEvent = $mod.TDataEvent.deLayoutChange;
          this.FInternalCalcFields = false;
          try {
            this.FDefaultFields = this.GetfieldCount() === 0;
            this.OpenCursor(false);
          } finally {
            if (this.FState !== $mod.TDataSetState.dsOpening) this.OpenCursorcomplete();
          };
        };
        this.FModified = false;
      } else if (!Value && (this.FState !== $mod.TDataSetState.dsInactive)) {
        this.DoBeforeClose();
        this.SetState($mod.TDataSetState.dsInactive);
        this.FDataRequestID = 0;
        this.DoneChangeList();
        this.CloseCursor();
        this.DoAfterClose();
        this.FModified = false;
      };
    };
    this.SetBookmarkStr = function (Value) {
      var O = null;
      var B = $mod.TBookmark.$new();
      O = JSON.parse(Value);
      B.Flag = O["flag"];
      B.Data = O["Index"];
      this.GotoBookmark(B);
    };
    this.SetBufListSize = function (Value) {
      var I = 0;
      if (Value < 0) Value = 0;
      if (Value === this.FBufferCount) return;
      if (Value > this.FBufferCount) {
        this.FBuffers = rtl.arraySetLength(this.FBuffers,$mod.TDataRecord,Value + 1);
        for (var $l = this.FBufferCount, $end = Value; $l <= $end; $l++) {
          I = $l;
          this.FBuffers[I].$assign(this.AllocRecordBuffer());
        };
      } else if (Value < this.FBufferCount) if ((Value >= 0) && (this.FActiveRecord > (Value - 1))) {
        for (var $l1 = 0, $end1 = this.FActiveRecord - Value; $l1 <= $end1; $l1++) {
          I = $l1;
          this.ShiftBuffersBackward();
        };
        this.FActiveRecord = Value - 1;
      };
      this.FBuffers = rtl.arraySetLength(this.FBuffers,$mod.TDataRecord,Value + 1);
      this.FBufferCount = Value;
      if (this.FRecordCount > this.FBufferCount) this.FRecordCount = this.FBufferCount;
    };
    this.SetChildOrder = function (Child, Order) {
      var Field = null;
      Field = rtl.as(Child,$mod.TField);
      if (this.FFieldList.IndexOf(Field) >= 0) Field.SetIndex(Order);
    };
    this.SetCurrentRecord = function (Index) {
      if (this.FCurrentRecord !== Index) {
        if (!this.FIsUniDirectional) {
          var $tmp = this.GetBookmarkFlag($mod.TDataRecord.$clone(this.FBuffers[Index]));
          if ($tmp === $mod.TBookmarkFlag.bfCurrent) {
            this.InternalSetToRecord($mod.TDataRecord.$clone(this.FBuffers[Index]))}
           else if ($tmp === $mod.TBookmarkFlag.bfBOF) {
            this.InternalFirst()}
           else if ($tmp === $mod.TBookmarkFlag.bfEOF) this.InternalLast();
        };
        this.FCurrentRecord = Index;
      };
    };
    this.SetDefaultFields = function (Value) {
      this.FDefaultFields = Value;
    };
    this.SetFiltered = function (Value) {
      if (Value) this.CheckBiDirectional();
      this.FFiltered = Value;
    };
    this.SetFilterOptions = function (Value) {
      this.CheckBiDirectional();
      this.FFilterOptions = rtl.refSet(Value);
    };
    this.SetFilterText = function (Value) {
      this.FFilterText = Value;
    };
    this.SetFieldValues = function (FieldName, Value) {
      var i = 0;
      var FieldList = null;
      var A = [];
      if (rtl.isArray(Value)) {
        FieldList = pas.Classes.TList.$create("Create$1");
        try {
          this.GetFieldList(FieldList,FieldName);
          A = Value;
          if ((FieldList.GetCount() === 1) && (rtl.length(A) > 0)) {
            this.FieldByName(FieldName).SetAsJSValue(Value)}
           else for (var $l = 0, $end = FieldList.GetCount() - 1; $l <= $end; $l++) {
            i = $l;
            rtl.getObject(FieldList.Get(i)).SetAsJSValue(A[i]);
          };
        } finally {
          FieldList = rtl.freeLoc(FieldList);
        };
      } else this.FieldByName(FieldName).SetAsJSValue(Value);
    };
    this.SetFound = function (Value) {
      this.FFound = Value;
    };
    this.SetModified = function (Value) {
      this.FModified = Value;
    };
    this.SetName = function (NewName) {
      var $Self = this;
      function CheckName(FieldName) {
        var Result = "";
        var i = 0;
        var j = 0;
        Result = FieldName;
        i = 0;
        j = 0;
        while (i < $Self.FFieldList.GetCount()) {
          if (Result === $Self.FFieldList.GetField(i).FFieldName) {
            j += 1;
            Result = FieldName + pas.SysUtils.IntToStr(j);
          } else i += 1;
        };
        return Result;
      };
      var i = 0;
      var nm = "";
      var old = "";
      if ($Self.FName === NewName) return;
      old = $Self.FName;
      pas.Classes.TComponent.SetName.call(this,NewName);
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) for (var $l = 0, $end = this.FFieldList.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        nm = old + this.FFieldList.GetField(i).FFieldName;
        if (pas.System.Copy(this.FFieldList.GetField(i).FName,1,nm.length) === nm) this.FFieldList.GetField(i).SetName(CheckName(NewName + this.FFieldList.GetField(i).FFieldName));
      };
    };
    this.SetOnFilterRecord = function (Value) {
      this.CheckBiDirectional();
      this.FOnFilterRecord = Value;
    };
    this.SetRecNo = function (Value) {
    };
    this.SetState = function (Value) {
      if (Value !== this.FState) {
        this.FState = Value;
        if (Value === $mod.TDataSetState.dsBrowse) this.FModified = false;
        this.DataEvent($mod.TDataEvent.deUpdateState,0);
      };
    };
    this.SetTempState = function (Value) {
      var Result = 0;
      Result = this.FState;
      this.FState = Value;
      this.FDisableControlsCount += 1;
      return Result;
    };
    this.TempBuffer = function () {
      var Result = $mod.TDataRecord.$new();
      Result.$assign(this.FBuffers[this.FRecordCount]);
      return Result;
    };
    this.UpdateIndexDefs = function () {
    };
    this.AllocRecordBuffer = function () {
      var Result = $mod.TDataRecord.$new();
      Result.data = null;
      Result.state = $mod.TRecordState.rsNew;
      return Result;
    };
    this.FreeRecordBuffer = function (Buffer) {
    };
    this.GetBookmarkData = function (Buffer, Data) {
    };
    this.GetBookmarkFlag = function (Buffer) {
      var Result = 0;
      Result = $mod.TBookmarkFlag.bfCurrent;
      return Result;
    };
    this.GetDataSource = function () {
      var Result = null;
      Result = null;
      return Result;
    };
    this.GetRecordSize = function () {
      var Result = 0;
      Result = 0;
      return Result;
    };
    this.InternalAddRecord = function (Buffer, AAppend) {
    };
    this.InternalDelete = function () {
    };
    this.InternalFirst = function () {
    };
    this.InternalGotoBookmark = function (ABookmark) {
    };
    this.InternalHandleException = function (E) {
      pas.SysUtils.ShowException(E,null);
    };
    this.InternalInitRecord = function (Buffer) {
    };
    this.InternalLast = function () {
    };
    this.InternalPost = function () {
      var $Self = this;
      function CheckRequiredFields() {
        var I = 0;
        for (var $l = 0, $end = $Self.FFieldList.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          if ($Self.FFieldList.GetField(I).FRequired && !$Self.FFieldList.GetField(I).FReadOnly && ($Self.FFieldList.GetField(I).FFieldKind === $mod.TFieldKind.fkData) && !($Self.FFieldList.GetField(I).FDataType === $mod.TFieldType.ftAutoInc) && $Self.FFieldList.GetField(I).GetIsNull()) $mod.DatabaseErrorFmt$1(rtl.getResStr(pas.DBConst,"SNeedField"),pas.System.VarRecs(18,$Self.FFieldList.GetField(I).GetDisplayName()),$Self);
        };
      };
      CheckRequiredFields();
    };
    this.InternalSetToRecord = function (Buffer) {
    };
    this.SetBookmarkFlag = function (Buffer, Value) {
    };
    this.SetBookmarkData = function (Buffer, Data) {
    };
    this.SetUniDirectional = function (Value) {
      this.FIsUniDirectional = Value;
    };
    this.Notification = function (AComponent, Operation) {
      pas.Classes.TComponent.Notification.call(this,AComponent,Operation);
      if ((Operation === pas.Classes.TOperation.opRemove) && (AComponent === this.FDataProxy)) this.FDataProxy = null;
    };
    this.SetDataSetField = function (Value) {
      if (Value === this.FDataSetField) return;
      if ((Value !== null) && ((Value.FDataSet === this) || ((Value.FDataSet.GetDataSource() !== null) && (Value.FDataSet.GetDataSource().FDataSet === this)))) $mod.DatabaseError$1(rtl.getResStr(pas.DBConst,"SCircularDataLink"),this);
      if ((Value != null) && !this.$class.InheritsFrom(Value.FDataSet.FNestedDataSetClass)) $mod.DatabaseErrorFmt$1(rtl.getResStr(pas.DBConst,"SNestedDataSetClass"),pas.System.VarRecs(18,Value.FDataSet.FNestedDataSetClass.$classname),this);
      if (this.GetActive()) this.Close();
      if (this.FDataSetField != null) this.FDataSetField.AssignNestedDataSet(null);
      this.FDataSetField = Value;
      if (Value != null) {
        Value.AssignNestedDataSet(this);
        if (Value.FDataSet.GetActive()) this.Open();
      };
    };
    this.GetFieldData = function (Field) {
      var Result = undefined;
      Result = this.GetFieldData$1(Field,$mod.TDataRecord.$clone(this.ActiveBuffer()));
      return Result;
    };
    this.SetFieldData = function (Field, AValue) {
      this.SetFieldData$1(Field,this.FBuffers[this.FActiveRecord],AValue);
    };
    this.GetFieldData$1 = function (Field, Buffer) {
      var Result = undefined;
      Result = Buffer.data[Field.FFieldName];
      if (pas.JS.isUndefined(Result)) Result = null;
      return Result;
    };
    this.SetFieldData$1 = function (Field, Buffer, AValue) {
      Buffer.data[Field.FFieldName] = AValue;
    };
    this.FieldDefsClass = function () {
      var Result = null;
      Result = $mod.TFieldDefs;
      return Result;
    };
    this.FieldsClass = function () {
      var Result = null;
      Result = $mod.TFields;
      return Result;
    };
    this.GetBOF = function () {
      var Result = false;
      Result = this.FBOF;
      return Result;
    };
    this.GetEOF = function () {
      var Result = false;
      Result = this.FEOF;
      return Result;
    };
    this.Create$1 = function (AOwner) {
      pas.Classes.TComponent.Create$1.call(this,AOwner);
      this.FFieldDefs = this.$class.FieldDefsClass().$create("Create$4",[this]);
      this.FFieldList = this.$class.FieldsClass().$create("Create$1",[this]);
      this.FDataSources = pas.Classes.TFPList.$create("Create");
      this.FConstraints = $mod.TCheckConstraints.$create("Create$2",[this]);
      this.FBuffers = rtl.arraySetLength(this.FBuffers,$mod.TDataRecord,1);
      this.FActiveRecord = 0;
      this.FEOF = true;
      this.FBOF = true;
      this.FIsUniDirectional = false;
      this.FAutoCalcFields = true;
      this.FDataRequestID = 0;
      this.FNestedDataSetClass = this.$class.ClassType();
      return this;
    };
    this.Destroy = function () {
      var i = 0;
      this.SetActive(false);
      this.SetDataSetField(null);
      rtl.free(this,"FFieldDefs");
      rtl.free(this,"FFieldList");
      rtl.free(this,"FNestedDataSets");
      while (this.FDataSources.FCount > 0) rtl.getObject(this.FDataSources.Get(this.FDataSources.FCount - 1)).SetDataSet(null);
      this.FDataSources.$destroy("Destroy");
      for (var $l = 0, $end = this.FBufferCount; $l <= $end; $l++) {
        i = $l;
        this.FreeRecordBuffer(this.FBuffers[i]);
      };
      rtl.free(this,"FConstraints");
      this.FBuffers = rtl.arraySetLength(this.FBuffers,$mod.TDataRecord,1);
      pas.Classes.TComponent.Destroy.call(this);
    };
    this.ActiveBuffer = function () {
      var Result = $mod.TDataRecord.$new();
      if (this.FActiveRecord !== -1) {
        Result.$assign(this.FBuffers[this.FActiveRecord])}
       else Result.$assign($mod.TDataRecord.$new());
      return Result;
    };
    this.Append = function () {
      this.DoInsertAppend(true);
    };
    this.AppendRecord = function (Values) {
      this.DoInsertAppendRecord(Values,true);
    };
    this.GetClonedDataSet = function (WithSettings) {
      var Result = null;
      Result = null;
      return Result;
    };
    this.BookmarkValid = function (ABookmark) {
      var Result = false;
      Result = false;
      return Result;
    };
    this.ConvertToDateTime = function (aField, aValue, ARaiseException) {
      var Result = 0.0;
      Result = this.$class.DefaultConvertToDateTime(aField,aValue,ARaiseException);
      return Result;
    };
    this.ConvertDateTimeToNative = function (aField, aValue) {
      var Result = undefined;
      Result = this.$class.DefaultConvertDateTimeToNative(aField,aValue);
      return Result;
    };
    this.DefaultConvertToDateTime = function (aField, aValue, ARaiseException) {
      var Result = 0.0;
      Result = 0;
      if (rtl.isString(aValue)) {
        if (("" + aValue) === "") {
          Result = 0}
         else if (!pas.DateUtils.TryRFC3339ToDateTime("" + aValue,{get: function () {
            return Result;
          }, set: function (v) {
            Result = v;
          }})) throw pas.SysUtils.EConvertError.$create("CreateFmt",[rtl.getResStr(pas.DBConst,"SErrInvalidDateTime"),pas.System.VarRecs(18,"" + aValue)]);
      } else if (rtl.isNumber(aValue)) {
        Result = rtl.getNumber(aValue)}
       else if (pas.JS.isDate(aValue)) Result = pas.SysUtils.JSDateToDateTime(aValue);
      return Result;
    };
    this.DefaultConvertDateTimeToNative = function (aField, aValue) {
      var Result = undefined;
      Result = pas.DateUtils.DateTimeToRFC3339(aValue);
      return Result;
    };
    this.BlobDataToBytes = function (aValue) {
      var Result = [];
      Result = this.$class.DefaultBlobDataToBytes(aValue);
      return Result;
    };
    this.DefaultBlobDataToBytes = function (aValue) {
      var Result = [];
      var S = "";
      var I = 0;
      var J = 0;
      var L = 0;
      Result = rtl.arraySetLength(Result,0,0);
      if (rtl.isString(aValue)) {
        S = "" + aValue;
        L = S.length;
        Result = rtl.arraySetLength(Result,0,rtl.trunc((L + 1) / 2));
        I = 1;
        J = 0;
        while (I < L) {
          try {
            Result[J] = pas.SysUtils.StrToInt("$" + pas.System.Copy(S,I,2));
            I += 2;
            J += 1;
          } catch ($e) {
            Result[J] = S.charCodeAt(I - 1);
            I += 1;
            J += 1;
          };
        };
      };
      return Result;
    };
    this.BytesToBlobData = function (aValue) {
      var Result = undefined;
      Result = this.$class.DefaultBytesToBlobData(rtl.arrayRef(aValue));
      return Result;
    };
    this.DefaultBytesToBlobData = function (aValue) {
      var Result = undefined;
      var S = "";
      var I = 0;
      if (rtl.length(aValue) === 0) {
        Result = null}
       else {
        S = "";
        for (var $l = 0, $end = rtl.length(aValue) - 1; $l <= $end; $l++) {
          I = $l;
          S = S.concat(pas.SysUtils.IntToHex(aValue[I],2));
        };
        Result = S;
      };
      return Result;
    };
    this.Cancel = function () {
      if (this.FState in rtl.createSet($mod.TDataSetState.dsEdit,$mod.TDataSetState.dsInsert)) {
        this.DataEvent($mod.TDataEvent.deCheckBrowseMode,0);
        this.DoBeforeCancel();
        this.UpdateCursorPos();
        this.InternalCancel();
        if ((this.FState === $mod.TDataSetState.dsInsert) && (this.FRecordCount === 1)) {
          this.FEOF = true;
          this.FBOF = true;
          this.FRecordCount = 0;
          this.InitRecord(this.FBuffers[this.FActiveRecord]);
          this.SetState($mod.TDataSetState.dsBrowse);
          this.DataEvent($mod.TDataEvent.deDataSetChange,0);
        } else {
          this.SetState($mod.TDataSetState.dsBrowse);
          this.SetCurrentRecord(this.FActiveRecord);
          this.Resync({});
        };
        this.DoAfterCancel();
      };
    };
    this.CheckBrowseMode = function () {
      this.CheckActive();
      this.DataEvent($mod.TDataEvent.deCheckBrowseMode,0);
      var $tmp = this.FState;
      if (($tmp === $mod.TDataSetState.dsEdit) || ($tmp === $mod.TDataSetState.dsInsert)) {
        this.UpdateRecord();
        if (this.FModified) {
          this.Post()}
         else this.Cancel();
      } else if ($tmp === $mod.TDataSetState.dsSetKey) this.Post();
    };
    this.ClearFields = function () {
      this.DataEvent($mod.TDataEvent.deCheckBrowseMode,0);
      this.InternalInitRecord(this.FBuffers[this.FActiveRecord]);
      if (this.FState !== $mod.TDataSetState.dsSetKey) this.GetCalcFields(this.FBuffers[this.FActiveRecord]);
      this.DataEvent($mod.TDataEvent.deRecordChange,0);
    };
    this.Close = function () {
      this.SetActive(false);
    };
    this.GetUpdateCount = function (UnresolvedOnly) {
      var Result = 0;
      var I = 0;
      Result = 0;
      if (!(this.FChangeList != null)) return Result;
      if (!UnresolvedOnly) {
        Result = this.FChangeList.FCount}
       else for (var $l = 0, $end = this.FChangeList.FCount - 1; $l <= $end; $l++) {
        I = $l;
        if (rtl.getObject(this.FChangeList.Get(I)).FResolveStatus === $mod.TResolveStatus.rsUnresolved) Result += 1;
      };
      return Result;
    };
    this.ApplyUpdates = function () {
      this.DoBeforeApplyUpdates();
      this.DoApplyUpdates();
    };
    this.ControlsDisabled = function () {
      var Result = false;
      Result = this.FDisableControlsCount > 0;
      return Result;
    };
    this.CompareBookmarks = function (Bookmark1, Bookmark2) {
      var Result = 0;
      Result = 0;
      return Result;
    };
    this.CursorPosChanged = function () {
      this.FCurrentRecord = -1;
    };
    this.Delete = function () {
      var R = null;
      if (!this.GetCanModify()) $mod.DatabaseError$1(rtl.getResStr(pas.DBConst,"SDatasetReadOnly"),this);
      if (this.IsEmpty()) $mod.DatabaseError$1(rtl.getResStr(pas.DBConst,"SDatasetEmpty"),this);
      if (this.FState in rtl.createSet($mod.TDataSetState.dsInsert)) {
        this.Cancel();
      } else {
        this.DataEvent($mod.TDataEvent.deCheckBrowseMode,0);
        this.DoBeforeDelete();
        this.DoBeforeScroll();
        R = this.AddToChangeList($mod.TUpdateStatus.usDeleted);
        if (!this.TryDoing(rtl.createCallback(this,"InternalDelete"),this.FOnDeleteError)) {
          if (R != null) this.RemoveFromChangeList(R);
          return;
        };
        this.SetState($mod.TDataSetState.dsBrowse);
        this.SetCurrentRecord(this.FActiveRecord);
        this.Resync({});
        this.DoAfterDelete();
        this.DoAfterScroll();
      };
    };
    this.DisableControls = function () {
      if (this.FDisableControlsCount === 0) {
        this.FDisableControlsState = this.FState;
        this.FEnableControlsEvent = $mod.TDataEvent.deDataSetChange;
      };
      this.FDisableControlsCount += 1;
    };
    this.Edit = function () {
      if (this.FState in rtl.createSet($mod.TDataSetState.dsEdit,$mod.TDataSetState.dsInsert)) return;
      this.CheckBrowseMode();
      if (!this.GetCanModify()) $mod.DatabaseError$1(rtl.getResStr(pas.DBConst,"SDatasetReadOnly"),this);
      if (this.FRecordCount === 0) {
        this.Append();
        return;
      };
      this.DoBeforeEdit();
      if (!this.TryDoing(rtl.createCallback(this,"InternalEdit"),this.FOnEditError)) return;
      this.GetCalcFields(this.FBuffers[this.FActiveRecord]);
      this.SetState($mod.TDataSetState.dsEdit);
      this.DataEvent($mod.TDataEvent.deRecordChange,0);
      this.DoAfterEdit();
    };
    this.EnableControls = function () {
      if (this.FDisableControlsCount > 0) this.FDisableControlsCount -= 1;
      if (this.FDisableControlsCount === 0) {
        if (this.FState !== this.FDisableControlsState) this.DataEvent($mod.TDataEvent.deUpdateState,0);
        if ((this.FState !== $mod.TDataSetState.dsInactive) && (this.FDisableControlsState !== $mod.TDataSetState.dsInactive)) this.DataEvent(this.FEnableControlsEvent,0);
      };
    };
    this.FieldByName = function (FieldName) {
      var Result = null;
      Result = this.FindField(FieldName);
      if (Result === null) $mod.DatabaseErrorFmt$1(rtl.getResStr(pas.DBConst,"SFieldNotFound"),pas.System.VarRecs(18,FieldName),this);
      return Result;
    };
    this.FindField = function (FieldName) {
      var Result = null;
      Result = this.FFieldList.FindField(FieldName);
      return Result;
    };
    this.FindFirst = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    this.FindLast = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    this.FindNext = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    this.FindPrior = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    this.First = function () {
      this.CheckBrowseMode();
      this.DoBeforeScroll();
      if (!this.FIsUniDirectional) {
        this.ClearBuffers()}
       else if (!this.FBOF) {
        this.SetActive(false);
        this.SetActive(true);
      };
      try {
        this.InternalFirst();
        if (!this.FIsUniDirectional) this.GetNextRecords();
      } finally {
        this.FBOF = true;
        this.DataEvent($mod.TDataEvent.deDataSetChange,0);
        this.DoAfterScroll();
      };
    };
    this.FreeBookmark = function (ABookmark) {
    };
    this.GetBookmark = function () {
      var Result = $mod.TBookmark.$new();
      if (this.BookmarkAvailable()) {
        this.GetBookmarkData($mod.TDataRecord.$clone(this.ActiveBuffer()),Result)}
       else Result.Data = null;
      return Result;
    };
    this.GetCurrentRecord = function (Buffer) {
      var Result = false;
      Result = false;
      return Result;
    };
    this.GetFieldList = function (List, FieldNames) {
      var F = null;
      var N = "";
      var StrPos = 0;
      if ((FieldNames === "") || (List === null)) return;
      StrPos = 1;
      do {
        N = $mod.ExtractFieldName(FieldNames,{get: function () {
            return StrPos;
          }, set: function (v) {
            StrPos = v;
          }});
        F = this.FieldByName(N);
        List.Add(F);
      } while (!(StrPos > FieldNames.length));
    };
    this.GetFieldList$1 = function (List, FieldNames) {
      var F = null;
      var N = "";
      var StrPos = 0;
      if ((FieldNames === "") || (List === null)) return;
      StrPos = 1;
      do {
        N = $mod.ExtractFieldName(FieldNames,{get: function () {
            return StrPos;
          }, set: function (v) {
            StrPos = v;
          }});
        F = this.FieldByName(N);
        List.Add(F);
      } while (!(StrPos > FieldNames.length));
    };
    this.GetFieldNames = function (List) {
      this.FFieldList.GetFieldNames(List);
    };
    this.GotoBookmark = function (ABookmark) {
      if (!pas.JS.isNull(ABookmark.Data)) {
        this.CheckBrowseMode();
        this.DoBeforeScroll();
        this.InternalGotoBookmark($mod.TBookmark.$clone(ABookmark));
        this.Resync(rtl.createSet($mod.TResyncMode$a.rmExact,$mod.TResyncMode$a.rmCenter));
        this.DoAfterScroll();
      };
    };
    this.Insert$1 = function () {
      this.DoInsertAppend(false);
    };
    this.InsertRecord = function (Values) {
      this.DoInsertAppendRecord(Values,false);
    };
    this.IsEmpty = function () {
      var Result = false;
      Result = this.FBOF && this.FEOF && !(this.FState === $mod.TDataSetState.dsInsert);
      return Result;
    };
    this.IsLinkedTo = function (ADataSource) {
      var Result = false;
      if ((ADataSource === null) || (ADataSource.FDataSet === null)) {
        Result = false;
      } else if (ADataSource.FDataSet === this) {
        Result = true;
      } else {
        Result = ADataSource.FDataSet.IsLinkedTo(ADataSource.FDataSet.GetDataSource());
      };
      return Result;
    };
    this.IsSequenced = function () {
      var Result = false;
      Result = true;
      return Result;
    };
    this.Last = function () {
      this.CheckBiDirectional();
      this.CheckBrowseMode();
      this.DoBeforeScroll();
      this.ClearBuffers();
      try {
        this.InternalLast();
        this.GetPriorRecords();
        if (this.FRecordCount > 0) this.FActiveRecord = this.FRecordCount - 1;
      } finally {
        this.FEOF = true;
        this.DataEvent($mod.TDataEvent.deDataSetChange,0);
        this.DoAfterScroll();
      };
    };
    this.Load = function (aOptions, aAfterLoad) {
      var Result = false;
      if ($mod.TLoadOption.loAtEOF in aOptions) $mod.DatabaseError$1(rtl.getResStr(pas.DBConst,"SatEOFInternalOnly"),this);
      if ($mod.TLoadOption.loCancelPending in aOptions) this.CancelLoading();
      Result = this.DoLoad(rtl.refSet(aOptions),aAfterLoad);
      return Result;
    };
    this.Locate = function (KeyFields, KeyValues, Options) {
      var Result = false;
      this.CheckBiDirectional();
      Result = false;
      return Result;
    };
    this.Lookup = function (KeyFields, KeyValues, ResultFields) {
      var Result = undefined;
      this.CheckBiDirectional();
      Result = null;
      return Result;
    };
    this.MoveBy = function (Distance) {
      var $Self = this;
      var Result = 0;
      var TheResult = 0;
      function ScrollForward() {
        var Result = 0;
        Result = 0;
        $Self.FBOF = false;
        while ((Distance > 0) && !$Self.FEOF) {
          if ($Self.FActiveRecord < ($Self.FRecordCount - 1)) {
            $Self.FActiveRecord += 1;
            Distance -= 1;
            TheResult += 1;
          } else {
            if ($Self.GetNextRecord()) {
              Distance -= 1;
              Result -= 1;
              TheResult += 1;
            } else {
              $Self.FEOF = true;
              $Self.DoLoad(rtl.createSet($mod.TLoadOption.loNoOpen,$mod.TLoadOption.loAtEOF),null);
            };
          };
        };
        return Result;
      };
      function ScrollBackward() {
        var Result = 0;
        $Self.CheckBiDirectional();
        Result = 0;
        $Self.FEOF = false;
        while ((Distance < 0) && !$Self.FBOF) {
          if ($Self.FActiveRecord > 0) {
            $Self.FActiveRecord -= 1;
            Distance += 1;
            TheResult -= 1;
          } else {
            if ($Self.GetPriorRecord()) {
              Distance += 1;
              Result += 1;
              TheResult -= 1;
            } else $Self.FBOF = true;
          };
        };
        return Result;
      };
      var Scrolled = 0;
      this.CheckBrowseMode();
      Result = 0;
      TheResult = 0;
      this.DoBeforeScroll();
      if ((Distance === 0) || ((Distance > 0) && this.FEOF) || ((Distance < 0) && this.FBOF)) return Result;
      try {
        Scrolled = 0;
        if (Distance > 0) {
          Scrolled = ScrollForward()}
         else Scrolled = ScrollBackward();
      } finally {
        this.DataEvent($mod.TDataEvent.deDataSetScroll,Scrolled);
        this.DoAfterScroll();
        Result = TheResult;
      };
      return Result;
    };
    this.Next = function () {
      if (this.FBlockReadSize > 0) {
        this.BlockReadNext()}
       else this.MoveBy(1);
    };
    this.Open = function () {
      this.SetActive(true);
    };
    var UpdateStates = [$mod.TUpdateStatus.usModified,$mod.TUpdateStatus.usInserted];
    this.Post = function () {
      var R = null;
      var WasInsert = false;
      this.UpdateRecord();
      if (this.FState in rtl.createSet($mod.TDataSetState.dsEdit,$mod.TDataSetState.dsInsert)) {
        this.DataEvent($mod.TDataEvent.deCheckBrowseMode,0);
        this.DoBeforePost();
        WasInsert = this.FState === $mod.TDataSetState.dsInsert;
        if (!this.TryDoing(rtl.createCallback(this,"InternalPost"),this.FOnPostError)) return;
        this.CursorPosChanged();
        this.SetState($mod.TDataSetState.dsBrowse);
        this.Resync({});
        R = this.AddToChangeList(UpdateStates[+WasInsert]);
        if (R != null) R.FBookmark.$assign(this.GetBookmark());
        this.DoAfterPost();
      } else if (this.FState !== $mod.TDataSetState.dsSetKey) $mod.DatabaseErrorFmt$1(rtl.getResStr(pas.DBConst,"SNotEditing"),pas.System.VarRecs(18,this.FName),this);
    };
    this.Prior = function () {
      this.MoveBy(-1);
    };
    this.Refresh = function () {
      this.CheckBrowseMode();
      this.DoBeforeRefresh();
      this.UpdateCursorPos();
      this.InternalRefresh();
      this.Resync({});
      this.DoAfterRefresh();
    };
    this.Resync = function (Mode) {
      var i = 0;
      var count = 0;
      if (this.FIsUniDirectional) return;
      if (this.GetRecord(this.FBuffers[0],$mod.TGetMode.gmCurrent,false) !== $mod.TGetResult.grOK) if ($mod.TResyncMode$a.rmExact in Mode) {
        $mod.DatabaseError$1(rtl.getResStr(pas.DBConst,"SNoSuchRecord"),this)}
       else if ((this.GetRecord(this.FBuffers[0],$mod.TGetMode.gmNext,true) !== $mod.TGetResult.grOK) && (this.GetRecord(this.FBuffers[0],$mod.TGetMode.gmPrior,true) !== $mod.TGetResult.grOK)) {
        this.ClearBuffers();
        this.InternalInitRecord(this.FBuffers[this.FActiveRecord]);
        this.DataEvent($mod.TDataEvent.deDataSetChange,0);
        return;
      };
      this.FCurrentRecord = 0;
      this.FEOF = false;
      this.FBOF = false;
      if ($mod.TResyncMode$a.rmCenter in Mode) {
        count = rtl.trunc(this.FRecordCount / 2)}
       else count = this.FActiveRecord;
      i = 0;
      this.FRecordCount = 1;
      this.FActiveRecord = 0;
      while ((i < count) && this.GetPriorRecord()) i += 1;
      this.FActiveRecord = i;
      this.GetNextRecords();
      if (this.FRecordCount < this.FBufferCount) this.FActiveRecord = this.FActiveRecord + this.GetPriorRecords();
      this.DataEvent($mod.TDataEvent.deDataSetChange,0);
    };
    this.CancelLoading = function () {
      this.FMinLoadID = this.FDataRequestID;
      this.FLoadCount = 0;
    };
    this.SetFields = function (Values) {
      var I = 0;
      for (var $l = 0, $end = rtl.length(Values) - 1; $l <= $end; $l++) {
        I = $l;
        this.FFieldList.GetField(I).AssignValue(Values[I]);
      };
    };
    this.UpdateCursorPos = function () {
      if (this.FRecordCount > 0) this.SetCurrentRecord(this.FActiveRecord);
    };
    this.UpdateRecord = function () {
      if (!(this.FState in $mod.dsEditModes)) $mod.DatabaseErrorFmt$1(rtl.getResStr(pas.DBConst,"SNotEditing"),pas.System.VarRecs(18,this.FName),this);
      this.DataEvent($mod.TDataEvent.deUpdateRecord,0);
    };
    this.GetPendingUpdates = function () {
      var Result = [];
      var L = null;
      var I = 0;
      L = $mod.TRecordUpdateDescriptorList.$create("Create");
      try {
        Result = rtl.arraySetLength(Result,$mod.TResolveInfo,this.GetRecordUpdates(L));
        for (var $l = 0, $end = L.FCount - 1; $l <= $end; $l++) {
          I = $l;
          Result[I].$assign(this.RecordUpdateDescriptorToResolveInfo(L.GetUpdate(I)));
        };
      } finally {
        L = rtl.freeLoc(L);
      };
      return Result;
    };
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TDataLink",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FFirstRecord = 0;
      this.FBufferCount = 0;
      this.FActive = false;
      this.FDataSourceFixed = false;
      this.FEditing = false;
      this.FReadOnly = false;
      this.FUpdatingRecord = false;
      this.FVisualControl = false;
      this.FDataSource = null;
    };
    this.$final = function () {
      this.FDataSource = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.CalcFirstRecord = function (Index) {
      var Result = 0;
      if (this.FDataSource.FDataSet.FActiveRecord > ((this.FFirstRecord + Index + this.FBufferCount) - 1)) {
        Result = this.FDataSource.FDataSet.FActiveRecord - ((this.FFirstRecord + Index + this.FBufferCount) - 1)}
       else if (this.FDataSource.FDataSet.FActiveRecord < (this.FFirstRecord + Index)) {
        Result = this.FDataSource.FDataSet.FActiveRecord - (this.FFirstRecord + Index)}
       else Result = 0;
      this.FFirstRecord += Index + Result;
      return Result;
    };
    this.CalcRange = function () {
      var aMax = 0;
      var aMin = 0;
      aMin = (this.GetDataset().FActiveRecord - this.FBufferCount) + 1;
      if (aMin < 0) aMin = 0;
      aMax = this.GetDataset().FBufferCount - this.FBufferCount;
      if (aMax < 0) aMax = 0;
      if (aMax > this.GetDataset().FActiveRecord) aMax = this.GetDataset().FActiveRecord;
      if (this.FFirstRecord < aMin) this.FFirstRecord = aMin;
      if (this.FFirstRecord > aMax) this.FFirstRecord = aMax;
      if ((this.FFirstRecord !== 0) && ((this.GetDataset().FActiveRecord - this.FFirstRecord) < (this.FBufferCount - 1))) this.FFirstRecord -= 1;
    };
    this.CheckActiveAndEditing = function () {
      var B = false;
      B = (this.FDataSource != null) && !(this.FDataSource.FState in rtl.createSet($mod.TDataSetState.dsInactive,$mod.TDataSetState.dsOpening));
      if (B !== this.FActive) {
        this.FActive = B;
        this.ActiveChanged();
      };
      B = (this.FDataSource != null) && (this.FDataSource.FState in $mod.dsEditModes) && !this.FReadOnly;
      if (B !== this.FEditing) {
        this.FEditing = B;
        this.EditingChanged();
      };
    };
    this.GetDataset = function () {
      var Result = null;
      if (this.FDataSource != null) {
        Result = this.FDataSource.FDataSet}
       else Result = null;
      return Result;
    };
    this.SetActive = function (AActive) {
      if (this.FActive !== AActive) {
        this.FActive = AActive;
        this.ActiveChanged();
      };
    };
    this.SetDataSource = function (Value) {
      if (this.FDataSource === Value) return;
      if (!this.FDataSourceFixed) {
        if (this.FDataSource != null) {
          this.FDataSource.UnregisterDataLink(this);
          this.FDataSource = null;
          this.CheckActiveAndEditing();
        };
        this.FDataSource = Value;
        if (this.FDataSource != null) {
          this.FDataSource.RegisterDataLink(this);
          this.CheckActiveAndEditing();
        };
      };
    };
    this.SetReadOnly = function (Value) {
      if (this.FReadOnly !== Value) {
        this.FReadOnly = Value;
        this.CheckActiveAndEditing();
      };
    };
    this.ActiveChanged = function () {
      this.FFirstRecord = 0;
    };
    this.CheckBrowseMode = function () {
    };
    this.DataEvent = function (Event, Info) {
      if (Event === $mod.TDataEvent.deUpdateState) {
        this.CheckActiveAndEditing()}
       else if (this.FActive) {
        var $tmp = Event;
        if (($tmp === $mod.TDataEvent.deFieldChange) || ($tmp === $mod.TDataEvent.deRecordChange)) {
          if (!this.FUpdatingRecord) this.RecordChanged(rtl.getObject(Info))}
         else if ($tmp === $mod.TDataEvent.deDataSetChange) {
          this.SetActive(this.FDataSource.FDataSet.GetActive());
          this.CalcRange();
          this.CalcFirstRecord(rtl.trunc(Info));
          this.DataSetChanged();
        } else if ($tmp === $mod.TDataEvent.deDataSetScroll) {
          this.DataSetScrolled(this.CalcFirstRecord(rtl.trunc(Info)))}
         else if ($tmp === $mod.TDataEvent.deLayoutChange) {
          this.CalcFirstRecord(rtl.trunc(Info));
          this.LayoutChanged();
        } else if ($tmp === $mod.TDataEvent.deUpdateRecord) {
          this.UpdateRecord()}
         else if ($tmp === $mod.TDataEvent.deCheckBrowseMode) {
          this.CheckBrowseMode()}
         else if ($tmp === $mod.TDataEvent.deFocusControl) this.FocusControl(Info);
      };
    };
    this.DataSetChanged = function () {
      this.RecordChanged(null);
    };
    this.DataSetScrolled = function (Distance) {
      this.DataSetChanged();
    };
    this.EditingChanged = function () {
    };
    this.FocusControl = function (Field) {
    };
    this.GetActiveRecord = function () {
      var Result = 0;
      Result = this.GetDataset().FActiveRecord - this.FFirstRecord;
      return Result;
    };
    this.GetBOF = function () {
      var Result = false;
      Result = this.GetDataset().GetBOF();
      return Result;
    };
    this.GetBufferCount = function () {
      var Result = 0;
      Result = this.FBufferCount;
      return Result;
    };
    this.GetEOF = function () {
      var Result = false;
      Result = this.GetDataset().GetEOF();
      return Result;
    };
    this.GetRecordCount = function () {
      var Result = 0;
      Result = this.GetDataset().FRecordCount;
      if (Result > this.GetBufferCount()) Result = this.GetBufferCount();
      return Result;
    };
    this.LayoutChanged = function () {
      this.DataSetChanged();
    };
    this.MoveBy = function (Distance) {
      var Result = 0;
      Result = this.GetDataset().MoveBy(Distance);
      return Result;
    };
    this.RecordChanged = function (Field) {
    };
    this.SetActiveRecord = function (Value) {
      this.GetDataset().FActiveRecord = Value + this.FFirstRecord;
    };
    this.SetBufferCount = function (Value) {
      if (this.FBufferCount !== Value) {
        this.FBufferCount = Value;
        if (this.FActive) {
          this.GetDataset().RecalcBufListSize();
          this.CalcRange();
        };
      };
    };
    this.UpdateData = function () {
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FBufferCount = 1;
      this.FFirstRecord = 0;
      this.FDataSource = null;
      this.FDataSourceFixed = false;
      return this;
    };
    this.Destroy = function () {
      this.FActive = false;
      this.FEditing = false;
      this.FDataSourceFixed = false;
      this.SetDataSource(null);
      pas.System.TObject.Destroy.call(this);
    };
    this.Edit = function () {
      var Result = false;
      if (!this.FReadOnly) this.FDataSource.Edit();
      Result = this.FEditing;
      return Result;
    };
    this.UpdateRecord = function () {
      this.FUpdatingRecord = true;
      try {
        this.UpdateData();
      } finally {
        this.FUpdatingRecord = false;
      };
    };
  });
  rtl.createClass(this,"TDetailDataLink",this.TDataLink,function () {
    this.GetDetailDataSet = function () {
      var Result = null;
      Result = null;
      return Result;
    };
  });
  rtl.createClass(this,"TMasterDataLink",this.TDetailDataLink,function () {
    this.$init = function () {
      $mod.TDetailDataLink.$init.call(this);
      this.FDetailDataSet = null;
      this.FFieldNames = "";
      this.FFields = null;
      this.FOnMasterChange = null;
      this.FOnMasterDisable = null;
    };
    this.$final = function () {
      this.FDetailDataSet = undefined;
      this.FFields = undefined;
      this.FOnMasterChange = undefined;
      this.FOnMasterDisable = undefined;
      $mod.TDetailDataLink.$final.call(this);
    };
    this.SetFieldNames = function (Value) {
      if (this.FFieldNames !== Value) {
        this.FFieldNames = Value;
        this.ActiveChanged();
      };
    };
    this.ActiveChanged = function () {
      this.FFields.Clear();
      if (this.FActive) try {
        this.GetDataset().GetFieldList(this.FFields,this.FFieldNames);
      } catch ($e) {
        this.FFields.Clear();
        throw $e;
      };
      if (this.FDetailDataSet.GetActive() && !(pas.Classes.TComponentStateItem.csDestroying in this.FDetailDataSet.FComponentState)) if (this.FActive && (this.FFields.GetCount() > 0)) {
        this.DoMasterChange()}
       else this.DoMasterDisable();
    };
    this.CheckBrowseMode = function () {
      if (this.FDetailDataSet.GetActive()) this.FDetailDataSet.CheckBrowseMode();
    };
    this.GetDetailDataSet = function () {
      var Result = null;
      Result = this.FDetailDataSet;
      return Result;
    };
    this.LayoutChanged = function () {
      this.ActiveChanged();
    };
    this.RecordChanged = function (Field) {
      if ((this.FDataSource.FState !== $mod.TDataSetState.dsSetKey) && this.FDetailDataSet.GetActive() && (this.FFields.GetCount() > 0) && ((Field === null) || (this.FFields.IndexOf(Field) >= 0))) this.DoMasterChange();
    };
    this.DoMasterDisable = function () {
      if (this.FOnMasterDisable != null) this.FOnMasterDisable(this);
    };
    this.DoMasterChange = function () {
      if (this.FOnMasterChange != null) this.FOnMasterChange(this);
    };
    this.Create$2 = function (ADataSet) {
      $mod.TDataLink.Create$1.call(this);
      this.FDetailDataSet = ADataSet;
      this.FFields = pas.Classes.TList.$create("Create$1");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FFields");
      $mod.TDataLink.Destroy.call(this);
    };
  });
  rtl.createClass(this,"TMasterParamsDataLink",this.TMasterDataLink,function () {
    this.$init = function () {
      $mod.TMasterDataLink.$init.call(this);
      this.FParams = null;
    };
    this.$final = function () {
      this.FParams = undefined;
      $mod.TMasterDataLink.$final.call(this);
    };
    this.SetParams = function (AValue) {
      this.FParams = AValue;
      if (AValue !== null) this.RefreshParamNames();
    };
    this.DoMasterDisable = function () {
      $mod.TMasterDataLink.DoMasterDisable.call(this);
    };
    this.DoMasterChange = function () {
      $mod.TMasterDataLink.DoMasterChange.call(this);
      if ((this.FParams != null) && (this.GetDetailDataSet() != null) && this.GetDetailDataSet().GetActive()) {
        this.GetDetailDataSet().CheckBrowseMode();
        this.GetDetailDataSet().Close();
        this.GetDetailDataSet().Open();
      };
    };
    this.Create$2 = function (ADataSet) {
      var P = null;
      $mod.TMasterDataLink.Create$2.call(this,ADataSet);
      if (ADataSet !== null) {
        P = pas.TypInfo.GetObjectProp$1(ADataSet,"Params",$mod.TParams);
        if (P !== null) this.SetParams(P);
      };
      return this;
    };
    this.RefreshParamNames = function () {
      var FN = "";
      var DS = null;
      var F = null;
      var I = 0;
      var P = null;
      FN = "";
      DS = this.GetDataset();
      if (this.FParams != null) {
        F = null;
        for (var $l = 0, $end = this.FParams.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          P = this.FParams.GetItem$1(I);
          if (!P.FBound) {
            if (DS != null) F = DS.FindField(P.FName);
            if (!(DS != null) || !DS.GetActive() || (F !== null)) {
              if (FN !== "") FN = FN + ";";
              FN = FN + P.FName;
            };
          };
        };
      };
      this.SetFieldNames(FN);
    };
    this.CopyParamsFromMaster = function (CopyBound) {
      if (this.FParams != null) this.FParams.CopyParamValuesFromDataset(this.GetDataset(),CopyBound);
    };
  });
  this.$rtti.$MethodVar("TDataChangeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Field",this.$rtti["TField"]]]), methodkind: 0});
  rtl.createClass(this,"TDataSource",pas.Classes.TComponent,function () {
    this.$init = function () {
      pas.Classes.TComponent.$init.call(this);
      this.FDataSet = null;
      this.FDataLinks = null;
      this.FEnabled = false;
      this.FAutoEdit = false;
      this.FState = 0;
      this.FOnStateChange = null;
      this.FOnDataChange = null;
      this.FOnUpdateData = null;
    };
    this.$final = function () {
      this.FDataSet = undefined;
      this.FDataLinks = undefined;
      this.FOnStateChange = undefined;
      this.FOnDataChange = undefined;
      this.FOnUpdateData = undefined;
      pas.Classes.TComponent.$final.call(this);
    };
    this.DistributeEvent = function (Event, Info) {
      var i = 0;
      for (var $l = 0, $end = this.FDataLinks.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (!rtl.getObject(this.FDataLinks.Get(i)).FVisualControl) {
          rtl.getObject(this.FDataLinks.Get(i)).DataEvent(Event,Info);
        };
      };
      for (var $l1 = 0, $end1 = this.FDataLinks.GetCount() - 1; $l1 <= $end1; $l1++) {
        i = $l1;
        if (rtl.getObject(this.FDataLinks.Get(i)).FVisualControl) {
          rtl.getObject(this.FDataLinks.Get(i)).DataEvent(Event,Info);
        };
      };
    };
    this.RegisterDataLink = function (DataLink) {
      this.FDataLinks.Add(DataLink);
      if (this.FDataSet != null) this.FDataSet.RecalcBufListSize();
    };
    var OnDataChangeEvents = rtl.createSet($mod.TDataEvent.deRecordChange,$mod.TDataEvent.deDataSetChange,$mod.TDataEvent.deDataSetScroll,$mod.TDataEvent.deLayoutChange,$mod.TDataEvent.deUpdateState);
    this.ProcessEvent = function (Event, Info) {
      var NeedDataChange = false;
      var FLastState = 0;
      if (Event === $mod.TDataEvent.deUpdateState) {
        NeedDataChange = this.FState === $mod.TDataSetState.dsInactive;
        FLastState = this.FState;
        if ((this.FDataSet != null) && this.FEnabled) {
          this.FState = this.FDataSet.FState}
         else this.FState = $mod.TDataSetState.dsInactive;
        if (this.FState === FLastState) return;
      } else NeedDataChange = true;
      this.DistributeEvent(Event,Info);
      if (!(pas.Classes.TComponentStateItem.csDestroying in this.FComponentState)) {
        if (Event === $mod.TDataEvent.deUpdateState) this.DoStateChange();
        if ((Event in OnDataChangeEvents) && NeedDataChange) this.DoDataChange(null);
        if (Event === $mod.TDataEvent.deFieldChange) this.DoDataChange(Info);
        if (Event === $mod.TDataEvent.deUpdateRecord) this.DoUpdateData();
      };
    };
    this.SetDataSet = function (ADataSet) {
      if (this.FDataSet !== null) {
        this.FDataSet.UnRegisterDataSource(this);
        this.FDataSet = null;
        this.ProcessEvent($mod.TDataEvent.deUpdateState,0);
      };
      if (ADataSet !== null) {
        ADataSet.RegisterDataSource(this);
        this.FDataSet = ADataSet;
        this.ProcessEvent($mod.TDataEvent.deUpdateState,0);
      };
    };
    this.SetEnabled = function (Value) {
      this.FEnabled = Value;
      this.ProcessEvent($mod.TDataEvent.deUpdateState,0);
    };
    this.UnregisterDataLink = function (DataLink) {
      this.FDataLinks.Remove(DataLink);
      if (this.FDataSet !== null) this.FDataSet.RecalcBufListSize();
    };
    this.DoDataChange = function (Info) {
      if (this.FOnDataChange != null) if (Info != null) {
        this.FOnDataChange(this,Info)}
       else this.FOnDataChange(this,null);
    };
    this.DoStateChange = function () {
      if (this.FOnStateChange != null) this.FOnStateChange(this);
    };
    this.DoUpdateData = function () {
      if (this.FOnUpdateData != null) this.FOnUpdateData(this);
    };
    this.Create$1 = function (AOwner) {
      pas.Classes.TComponent.Create$1.call(this,AOwner);
      this.FDataLinks = pas.Classes.TList.$create("Create$1");
      this.FEnabled = true;
      this.FAutoEdit = true;
      return this;
    };
    this.Destroy = function () {
      this.FOnStateChange = null;
      this.SetDataSet(null);
      while (this.FDataLinks.GetCount() > 0) rtl.getObject(this.FDataLinks.Get(this.FDataLinks.GetCount() - 1)).SetDataSource(null);
      rtl.free(this,"FDataLinks");
      pas.Classes.TComponent.Destroy.call(this);
    };
    this.Edit = function () {
      if ((this.FState === $mod.TDataSetState.dsBrowse) && this.FAutoEdit) this.FDataSet.Edit();
    };
    this.IsLinkedTo = function (ADataSet) {
      var Result = false;
      Result = false;
      return Result;
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("AutoEdit",0,rtl.boolean,"FAutoEdit","FAutoEdit",4,{Default: true});
    $r.addProperty("DataSet",2,$mod.$rtti["TDataSet"],"FDataSet","SetDataSet");
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("OnStateChange",0,pas.Classes.$rtti["TNotifyEvent"],"FOnStateChange","FOnStateChange");
    $r.addProperty("OnDataChange",0,$mod.$rtti["TDataChangeEvent"],"FOnDataChange","FOnDataChange");
    $r.addProperty("OnUpdateData",0,pas.Classes.$rtti["TNotifyEvent"],"FOnUpdateData","FOnUpdateData");
  });
  this.TDataRequestResult = {"0": "rrFail", rrFail: 0, "1": "rrEOF", rrEOF: 1, "2": "rrOK", rrOK: 2};
  this.$rtti.$Enum("TDataRequestResult",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TDataRequestResult});
  this.$rtti.$MethodVar("TDataRequestEvent",{procsig: rtl.newTIProcSig([["ARequest",this.$rtti["TDataRequest"]]]), methodkind: 0});
  rtl.createClass(this,"TDataRequest",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FBookmark = $mod.TBookmark.$new();
      this.FCurrent = $mod.TBookmark.$new();
      this.FDataset = null;
      this.FErrorMsg = "";
      this.FEvent = null;
      this.FLoadOptions = {};
      this.FRequestID = 0;
      this.FSuccess = 0;
      this.FData = undefined;
      this.FAfterRequest = null;
      this.FDataProxy = null;
    };
    this.$final = function () {
      this.FBookmark = undefined;
      this.FCurrent = undefined;
      this.FDataset = undefined;
      this.FEvent = undefined;
      this.FLoadOptions = undefined;
      this.FAfterRequest = undefined;
      this.FDataProxy = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.DoAfterRequest = function () {
      if (this.FAfterRequest != null) this.FAfterRequest(this);
    };
    this.Create$1 = function (aDataProxy, aOptions, aAfterRequest, aAfterLoad) {
      this.FDataProxy = aDataProxy;
      this.FLoadOptions = rtl.refSet(aOptions);
      this.FEvent = aAfterLoad;
      this.FAfterRequest = aAfterRequest;
      return this;
    };
  });
  this.$rtti.$ClassRef("TDataRequestClass",{instancetype: this.$rtti["TDataRequest"]});
  rtl.createClass(this,"TRecordUpdateDescriptor",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FBookmark = $mod.TBookmark.$new();
      this.FData = undefined;
      this.FDataset = null;
      this.FProxy = null;
      this.FResolveStatus = 0;
      this.FResolveError = "";
      this.FServerData = undefined;
      this.FStatus = 0;
    };
    this.$final = function () {
      this.FBookmark = undefined;
      this.FDataset = undefined;
      this.FProxy = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.SetResolveStatus = function (aValue) {
      this.FResolveStatus = aValue;
    };
    this.Reset = function () {
      this.FResolveStatus = $mod.TResolveStatus.rsUnresolved;
      this.FResolveError = "";
      this.FServerData = null;
    };
    this.Create$1 = function (aProxy, aDataset, aBookmark, AData, AStatus) {
      this.FDataset = aDataset;
      this.FBookmark.$assign(aBookmark);
      this.FData = AData;
      this.FStatus = AStatus;
      this.FProxy = aProxy;
      return this;
    };
    this.Resolve = function (aData) {
      this.SetResolveStatus($mod.TResolveStatus.rsResolved);
      this.FServerData = aData;
    };
    this.ResolveFailed = function (aError) {
      this.SetResolveStatus($mod.TResolveStatus.rsResolveFailed);
      this.FResolveError = aError;
    };
  });
  this.$rtti.$ClassRef("TRecordUpdateDescriptorClass",{instancetype: this.$rtti["TRecordUpdateDescriptor"]});
  rtl.createClass(this,"TRecordUpdateDescriptorList",pas.Classes.TFPList,function () {
    this.GetUpdate = function (AIndex) {
      var Result = null;
      Result = rtl.getObject(this.Get(AIndex));
      return Result;
    };
  });
  this.TUpdateBatchStatus = {"0": "ubsPending", ubsPending: 0, "1": "ubsProcessing", ubsProcessing: 1, "2": "ubsProcessed", ubsProcessed: 2, "3": "ubsResolved", ubsResolved: 3};
  this.$rtti.$Enum("TUpdateBatchStatus",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TUpdateBatchStatus});
  this.$rtti.$MethodVar("TResolveBatchEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ARequest",this.$rtti["TRecordUpdateBatch"]]]), methodkind: 0});
  rtl.createClass(this,"TRecordUpdateBatch",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FBatchID = 0;
      this.FDataset = null;
      this.FLastChangeIndex = 0;
      this.FList = null;
      this.FOnResolve = null;
      this.FOwnsList = false;
      this.FStatus = 0;
    };
    this.$final = function () {
      this.FDataset = undefined;
      this.FList = undefined;
      this.FOnResolve = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function (aBatchID, AList, AOwnsList) {
      this.FBatchID = aBatchID;
      this.FList = AList;
      this.FOwnsList = AOwnsList;
      this.FStatus = $mod.TUpdateBatchStatus.ubsPending;
      return this;
    };
    this.Destroy = function () {
      if (this.FOwnsList) this.FreeList();
      pas.System.TObject.Destroy.call(this);
    };
    this.FreeList = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FList;
        }, set: function (v) {
          this.p.FList = v;
        }});
    };
  });
  this.$rtti.$ClassRef("TRecordUpdateBatchClass",{instancetype: this.$rtti["TRecordUpdateBatch"]});
  rtl.createClass(this,"TDataProxy",pas.Classes.TComponent,function () {
    this.GetDataRequestClass = function () {
      var Result = null;
      Result = $mod.TDataRequest;
      return Result;
    };
    this.GetUpdateDescriptorClass = function () {
      var Result = null;
      Result = $mod.TRecordUpdateDescriptor;
      return Result;
    };
    this.GetUpdateBatchClass = function () {
      var Result = null;
      Result = $mod.TRecordUpdateBatch;
      return Result;
    };
    this.ResolveBatch = function (aBatch) {
      try {
        if (aBatch.FOnResolve != null) aBatch.FOnResolve(this,aBatch);
      } finally {
        aBatch = rtl.freeLoc(aBatch);
      };
    };
    this.GetDataRequest = function (aOptions, aAfterRequest, aAfterLoad) {
      var Result = null;
      Result = this.GetDataRequestClass().$create("Create$1",[this,rtl.refSet(aOptions),aAfterRequest,aAfterLoad]);
      return Result;
    };
    this.GetUpdateDescriptor = function (aDataset, aBookmark, AData, AStatus) {
      var Result = null;
      Result = this.GetUpdateDescriptorClass().$create("Create$1",[this,aDataset,$mod.TBookmark.$clone(aBookmark),AData,AStatus]);
      return Result;
    };
    this.GetRecordUpdateBatch = function (aBatchID, AList, AOwnsList) {
      var Result = null;
      Result = this.GetUpdateBatchClass().$create("Create$1",[aBatchID,AList,AOwnsList]);
      return Result;
    };
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.$rtti.$StaticArray("FieldTypeNames$a",{dims: [52], eltype: rtl.string});
  this.FieldTypeNames = ["Unknown","String","SmallInt","Integer","Word","Boolean","Float","Currency","BCD","Date","Time","DateTime","Bytes","VarBytes","AutoInc","Blob","Memo","Graphic","FmtMemo","ParadoxOle","dBaseOle","TypedBinary","Cursor","FixedChar","WideString","LargeInt","ADT","Array","Reference","DataSet","OraBlob","OraClob","Variant","Interface","IDispatch","Guid","TimeStamp","FMTBcd","FixedWideChar","WideMemo","OraTimeStamp","OraInterval","LongWord","ShortInt","Byte","Extended","Connection","Params","Stream","TimeStampOffset","Object","Single"];
  this.$rtti.$StaticArray("DefaultFieldClasses$a",{dims: [52], eltype: this.$rtti["TFieldClass"]});
  this.DefaultFieldClasses = [null,this.TStringField,this.TSmallIntField,this.TIntegerField,this.TWordField,this.TBooleanField,this.TFloatField,null,null,this.TDateField,this.TTimeField,this.TDateTimeField,null,null,this.TAutoIncField,this.TBlobField,this.TMemoField,this.TGraphicField,this.TBlobField,this.TBlobField,this.TBlobField,this.TBlobField,null,this.TStringField,null,this.TLargeintField,null,null,null,this.TDataSetField,this.TBlobField,this.TMemoField,this.TVariantField,null,null,null,null,null,null,null,null,this.TStringField,null,null,null,null,null,null,null,null,null,null];
  this.dsEditModes = rtl.createSet(this.TDataSetState.dsEdit,this.TDataSetState.dsInsert,this.TDataSetState.dsSetKey);
  this.dsWriteModes = rtl.createSet(this.TDataSetState.dsEdit,this.TDataSetState.dsInsert,this.TDataSetState.dsSetKey,this.TDataSetState.dsCalcFields,this.TDataSetState.dsFilter,this.TDataSetState.dsNewValue,this.TDataSetState.dsInternalCalc,this.TDataSetState.dsRefreshFields);
  this.DatabaseError = function (Msg) {
    throw $mod.EDatabaseError.$create("Create$1",[Msg]);
  };
  this.DatabaseError$1 = function (Msg, Comp) {
    if ((Comp != null) && (Comp.FName !== "")) {
      throw $mod.EDatabaseError.$create("CreateFmt",["%s : %s",pas.System.VarRecs(18,Comp.FName,18,Msg)])}
     else $mod.DatabaseError(Msg);
  };
  this.DatabaseErrorFmt = function (Fmt, Args) {
    throw $mod.EDatabaseError.$create("CreateFmt",[Fmt,Args]);
  };
  this.DatabaseErrorFmt$1 = function (Fmt, Args, Comp) {
    if (Comp != null) {
      throw $mod.EDatabaseError.$create("CreateFmt",[pas.SysUtils.Format("%s : %s",pas.System.VarRecs(18,Comp.FName,18,Fmt)),Args])}
     else $mod.DatabaseErrorFmt(Fmt,Args);
  };
  this.ExtractFieldName = function (Fields, Pos) {
    var Result = "";
    var i = 0;
    var FieldsLength = 0;
    i = Pos.get();
    FieldsLength = Fields.length;
    while ((i <= FieldsLength) && (Fields.charAt(i - 1) !== ";")) i += 1;
    Result = pas.SysUtils.Trim(pas.System.Copy(Fields,Pos.get(),i - Pos.get()));
    if ((i <= FieldsLength) && (Fields.charAt(i - 1) === ";")) i += 1;
    Pos.set(i);
    return Result;
  };
  $mod.$implcode = function () {
    $impl.DefaultBufferCount = 10;
    $impl.SBoolean = "Boolean";
    $impl.SDateTime = "TDateTime";
    $impl.SFloat = "Float";
    $impl.SInteger = "Integer";
    $impl.SLargeInt = "NativeInt";
    $impl.SJSValue = "JSValue";
    $impl.SString = "String";
    $impl.SBytes = "Bytes";
    $impl.SkipQuotesString = function (S, p, QuoteChar, EscapeSlash, EscapeRepeat) {
      var notRepeatEscaped = false;
      p.set(p.get() + 1);
      do {
        notRepeatEscaped = true;
        while (!pas.SysUtils.CharInSet(S.charAt(p.get() - 1),["\x00",QuoteChar])) {
          if (EscapeSlash && (S.charAt(p.get() - 1) === "\\") && (p.get() < S.length)) {
            p.set(p.get() + 2)}
           else p.set(p.get() + 1);
        };
        if (S.charAt(p.get() - 1) === QuoteChar) {
          p.set(p.get() + 1);
          if ((S.charAt(p.get() - 1) === QuoteChar) && EscapeRepeat) {
            notRepeatEscaped = false;
            p.set(p.get() + 1);
          };
        };
      } while (!notRepeatEscaped);
    };
    $impl.SkipComments = function (S, p, EscapeSlash, EscapeRepeat) {
      var Result = false;
      Result = false;
      var $tmp = S.charAt(p.get() - 1);
      if (($tmp === "'") || ($tmp === '"') || ($tmp === "`")) {
        Result = true;
        $impl.SkipQuotesString(S,p,S.charAt(p.get() - 1),EscapeSlash,EscapeRepeat);
      } else if ($tmp === "-") {
        p.set(p.get() + 1);
        if (S.charAt(p.get() - 1) === "-") {
          Result = true;
          do {
            p.set(p.get() + 1);
          } while (!pas.SysUtils.CharInSet(S.charAt(p.get() - 1),["\n","\r","\x00"]));
          while (pas.SysUtils.CharInSet(S.charAt(p.get() - 1),["\n","\r"])) p.set(p.get() + 1);
        };
      } else if ($tmp === "/") {
        p.set(p.get() + 1);
        if (S.charAt(p.get() - 1) === "*") {
          Result = true;
          p.set(p.get() + 1);
          while (p.get() <= S.length) {
            if (S.charAt(p.get() - 1) === "*") {
              p.set(p.get() + 1);
              if (S.charAt(p.get() - 1) === "/") break;
            } else p.set(p.get() + 1);
          };
          if ((p.get() <= S.length) && (S.charAt(p.get() - 1) === "/")) p.set(p.get() + 1);
        };
      };
      return Result;
    };
  };
},["DBConst","TypInfo"]);
rtl.module("fpexprpars",["System","Classes","SysUtils","contnrs","JS"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.TTokenType = {"0": "ttPlus", ttPlus: 0, "1": "ttMinus", ttMinus: 1, "2": "ttLessThan", ttLessThan: 2, "3": "ttLargerThan", ttLargerThan: 3, "4": "ttEqual", ttEqual: 4, "5": "ttDiv", ttDiv: 5, "6": "ttMod", ttMod: 6, "7": "ttMul", ttMul: 7, "8": "ttLeft", ttLeft: 8, "9": "ttRight", ttRight: 9, "10": "ttLessThanEqual", ttLessThanEqual: 10, "11": "ttLargerThanEqual", ttLargerThanEqual: 11, "12": "ttunequal", ttunequal: 12, "13": "ttNumber", ttNumber: 13, "14": "ttString", ttString: 14, "15": "ttIdentifier", ttIdentifier: 15, "16": "ttComma", ttComma: 16, "17": "ttAnd", ttAnd: 17, "18": "ttOr", ttOr: 18, "19": "ttXor", ttXor: 19, "20": "ttTrue", ttTrue: 20, "21": "ttFalse", ttFalse: 21, "22": "ttNot", ttNot: 22, "23": "ttif", ttif: 23, "24": "ttCase", ttCase: 24, "25": "ttPower", ttPower: 25, "26": "ttLike", ttLike: 26, "27": "ttEOF", ttEOF: 27};
  this.$rtti.$Enum("TTokenType",{minvalue: 0, maxvalue: 27, ordtype: 1, enumtype: this.TTokenType});
  this.ttDelimiters = rtl.createSet(this.TTokenType.ttPlus,this.TTokenType.ttMinus,this.TTokenType.ttLessThan,this.TTokenType.ttLargerThan,this.TTokenType.ttEqual,this.TTokenType.ttDiv,this.TTokenType.ttMul,this.TTokenType.ttLeft,this.TTokenType.ttRight,this.TTokenType.ttLessThanEqual,this.TTokenType.ttLargerThanEqual,this.TTokenType.ttunequal,this.TTokenType.ttPower);
  this.ttComparisons = rtl.createSet(this.TTokenType.ttLargerThan,this.TTokenType.ttLessThan,this.TTokenType.ttLargerThanEqual,this.TTokenType.ttLessThanEqual,this.TTokenType.ttEqual,this.TTokenType.ttunequal,this.TTokenType.ttLike);
  this.$rtti.$Class("TFPExpressionParser");
  this.$rtti.$Class("TExprBuiltInManager");
  this.$rtti.$Class("TFPExprFunction");
  this.$rtti.$ClassRef("TFPExprFunctionClass",{instancetype: this.$rtti["TFPExprFunction"]});
  this.TNumberKind = {"0": "nkDecimal", nkDecimal: 0, "1": "nkHex", nkHex: 1, "2": "nkOctal", nkOctal: 2, "3": "nkBinary", nkBinary: 3};
  this.$rtti.$Enum("TNumberKind",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TNumberKind});
  rtl.createClass(this,"TFPExpressionScanner",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FSource = "";
      this.LSource = 0;
      this.FPos = 0;
      this.FChar = "\x00";
      this.FToken = "";
      this.FTokenType = 0;
      this.FAllowLike = false;
    };
    this.GetCurrentChar = function () {
      var Result = "\x00";
      Result = this.FChar;
      return Result;
    };
    this.ScanError = function (Msg) {
      throw $mod.EExprScanner.$create("Create$1",[Msg]);
    };
    this.SetSource = function (AValue) {
      this.FSource = AValue;
      this.LSource = this.FSource.length;
      this.FTokenType = $mod.TTokenType.ttEOF;
      if (this.LSource === 0) {
        this.FPos = 0;
        this.FChar = $impl.cNull;
      } else {
        this.FPos = 1;
        this.FChar = this.FSource.charAt(0);
      };
      this.FToken = "";
    };
    this.DoIdentifier = function () {
      var Result = 0;
      var C = "\x00";
      var S = "";
      var IsBracket = false;
      C = this.GetCurrentChar();
      IsBracket = false;
      while ((!this.IsWordDelim(C) && (C !== $impl.cNull)) || (IsBracket && (C === " "))) {
        if (C === "[") IsBracket = true;
        if (C === "]") IsBracket = false;
        if (C !== '"') {
          this.FToken = this.FToken + C}
         else {
          C = this.NextPos();
          while (!(C.charCodeAt() in rtl.createSet($impl.cNull.charCodeAt(),34))) {
            this.FToken = this.FToken + C;
            C = this.NextPos();
          };
          if (C !== '"') this.ScanError(pas.SysUtils.Format(rtl.getResStr($mod,"SErrUnterminatedIdentifier"),pas.System.VarRecs(18,this.FToken)));
        };
        C = this.NextPos();
      };
      S = pas.SysUtils.LowerCase(this.FToken);
      if (S === "or") {
        Result = $mod.TTokenType.ttOr}
       else if (S === "xor") {
        Result = $mod.TTokenType.ttXor}
       else if (S === "and") {
        Result = $mod.TTokenType.ttAnd}
       else if (S === "true") {
        Result = $mod.TTokenType.ttTrue}
       else if (S === "false") {
        Result = $mod.TTokenType.ttFalse}
       else if (S === "not") {
        Result = $mod.TTokenType.ttNot}
       else if (S === "if") {
        Result = $mod.TTokenType.ttif}
       else if (S === "case") {
        Result = $mod.TTokenType.ttCase}
       else if (S === "mod") {
        Result = $mod.TTokenType.ttMod}
       else if ((S === "like") && this.FAllowLike) {
        Result = $mod.TTokenType.ttLike}
       else Result = $mod.TTokenType.ttIdentifier;
      return Result;
    };
    this.DoNumber = function (AKind) {
      var $Self = this;
      var Result = 0;
      var C = "\x00";
      var X = 0.0;
      var I = 0;
      var prevC = "\x00";
      function ValidDigit(C, AKind) {
        var Result = false;
        Result = $Self.IsDigit(C,AKind);
        if (!Result) {
          var $tmp = AKind;
          if ($tmp === $mod.TNumberKind.nkDecimal) {
            Result = (($Self.FToken !== "") && (pas.System.upcase(C) === "E")) || (($Self.FToken !== "") && (C.charCodeAt() in rtl.createSet(43,45)) && (prevC === "E"))}
           else if ($tmp === $mod.TNumberKind.nkHex) {
            Result = (C === $impl.cHexIdentifier) && (prevC === "\x00")}
           else if ($tmp === $mod.TNumberKind.nkOctal) {
            Result = (C === $impl.cOctalIdentifier) && (prevC === "\x00")}
           else if ($tmp === $mod.TNumberKind.nkBinary) Result = (C === $impl.cBinaryIdentifier) && (prevC === "\x00");
        };
        return Result;
      };
      C = this.GetCurrentChar();
      prevC = "\x00";
      while (C !== $impl.cNull) {
        if (this.IsWordDelim(C)) {
          var $tmp = AKind;
          if ($tmp === $mod.TNumberKind.nkDecimal) {
            if (!(prevC.charCodeAt() in rtl.createSet(69,45,43))) break}
           else if (($tmp === $mod.TNumberKind.nkHex) || ($tmp === $mod.TNumberKind.nkOctal)) {
            break}
           else if ($tmp === $mod.TNumberKind.nkBinary) if (prevC !== "\x00") break;
        };
        if (!ValidDigit(C,AKind)) this.ScanError(pas.SysUtils.Format(rtl.getResStr($mod,"SErrInvalidNumberChar"),pas.System.VarRecs(9,C)));
        this.FToken = this.FToken + C;
        prevC = pas.System.upcase(C);
        C = this.NextPos();
      };
      pas.System.val$8(this.FToken,{get: function () {
          return X;
        }, set: function (v) {
          X = v;
        }},{get: function () {
          return I;
        }, set: function (v) {
          I = v;
        }});
      if (I !== 0) this.ScanError(pas.SysUtils.Format(rtl.getResStr($mod,"SErrInvalidNumber"),pas.System.VarRecs(18,this.FToken)));
      Result = $mod.TTokenType.ttNumber;
      return Result;
    };
    this.DoDelimiter = function () {
      var Result = 0;
      var B = false;
      var C = "\x00";
      var D = "\x00";
      C = this.FChar;
      this.FToken = C;
      B = C.charCodeAt() in rtl.createSet(60,62);
      D = C;
      C = this.NextPos();
      if (B && (C.charCodeAt() in rtl.createSet(61,62))) {
        this.FToken = this.FToken + C;
        this.NextPos();
        if (D === ">") {
          Result = $mod.TTokenType.ttLargerThanEqual}
         else if (C === ">") {
          Result = $mod.TTokenType.ttunequal}
         else Result = $mod.TTokenType.ttLessThanEqual;
      } else {
        var $tmp = D;
        if ($tmp === "+") {
          Result = $mod.TTokenType.ttPlus}
         else if ($tmp === "-") {
          Result = $mod.TTokenType.ttMinus}
         else if ($tmp === "<") {
          Result = $mod.TTokenType.ttLessThan}
         else if ($tmp === ">") {
          Result = $mod.TTokenType.ttLargerThan}
         else if ($tmp === "=") {
          Result = $mod.TTokenType.ttEqual}
         else if ($tmp === "/") {
          Result = $mod.TTokenType.ttDiv}
         else if ($tmp === "*") {
          Result = $mod.TTokenType.ttMul}
         else if ($tmp === "(") {
          Result = $mod.TTokenType.ttLeft}
         else if ($tmp === ")") {
          Result = $mod.TTokenType.ttRight}
         else if ($tmp === ",") {
          Result = $mod.TTokenType.ttComma}
         else if ($tmp === "^") {
          Result = $mod.TTokenType.ttPower}
         else {
          this.ScanError(pas.SysUtils.Format(rtl.getResStr($mod,"SUnknownDelimiter"),pas.System.VarRecs(9,D)));
        };
      };
      return Result;
    };
    this.DoString = function () {
      var $Self = this;
      var Result = 0;
      function TerminatingChar(C) {
        var Result = false;
        Result = (C === $impl.cNull) || ((C === $impl.cSingleQuote) && !(($Self.FPos < $Self.LSource) && ($Self.FSource.charAt(($Self.FPos + 1) - 1) === $impl.cSingleQuote)));
        return Result;
      };
      var C = "\x00";
      this.FToken = "";
      C = this.NextPos();
      while (!TerminatingChar(C)) {
        this.FToken = this.FToken + C;
        if (C === $impl.cSingleQuote) this.NextPos();
        C = this.NextPos();
      };
      if (C === $impl.cNull) this.ScanError(rtl.getResStr($mod,"SBadQuotes"));
      Result = $mod.TTokenType.ttString;
      this.FTokenType = Result;
      this.NextPos();
      return Result;
    };
    this.NextPos = function () {
      var Result = "\x00";
      this.FPos += 1;
      if (this.FPos > this.FSource.length) {
        this.FChar = $impl.cNull}
       else this.FChar = this.FSource.charAt(this.FPos - 1);
      Result = this.FChar;
      return Result;
    };
    this.SkipWhiteSpace = function () {
      while ((this.FChar.charCodeAt() in $impl.WhiteSpace) && (this.FPos <= this.LSource)) this.NextPos();
    };
    this.IsWordDelim = function (C) {
      var Result = false;
      Result = C.charCodeAt() in $impl.WordDelimiters;
      return Result;
    };
    this.IsDelim = function (C) {
      var Result = false;
      Result = C.charCodeAt() in $impl.Delimiters;
      return Result;
    };
    this.IsDigit = function (C, AKind) {
      var Result = false;
      var $tmp = AKind;
      if ($tmp === $mod.TNumberKind.nkDecimal) {
        Result = C.charCodeAt() in $impl.Digits}
       else if ($tmp === $mod.TNumberKind.nkHex) {
        Result = C.charCodeAt() in $impl.HexDigits}
       else if ($tmp === $mod.TNumberKind.nkOctal) {
        Result = C.charCodeAt() in $impl.OctalDigits}
       else if ($tmp === $mod.TNumberKind.nkBinary) Result = C.charCodeAt() in $impl.BinaryDigits;
      return Result;
    };
    this.IsAlpha = function (C) {
      var Result = false;
      Result = C.charCodeAt() in rtl.createSet(null,65,90,null,97,122);
      return Result;
    };
    this.Create$1 = function () {
      this.SetSource("");
      return this;
    };
    this.GetToken = function () {
      var Result = 0;
      var C = "\x00";
      this.FToken = "";
      this.SkipWhiteSpace();
      C = this.FChar;
      if (C === $impl.cNull) {
        Result = $mod.TTokenType.ttEOF}
       else if (this.IsDelim(C)) {
        Result = this.DoDelimiter()}
       else if (C === $impl.cSingleQuote) {
        Result = this.DoString()}
       else if (C === $impl.cHexIdentifier) {
        Result = this.DoNumber($mod.TNumberKind.nkHex)}
       else if (C === $impl.cOctalIdentifier) {
        Result = this.DoNumber($mod.TNumberKind.nkOctal)}
       else if (C === $impl.cBinaryIdentifier) {
        Result = this.DoNumber($mod.TNumberKind.nkBinary)}
       else if (this.IsDigit(C,$mod.TNumberKind.nkDecimal)) {
        Result = this.DoNumber($mod.TNumberKind.nkDecimal)}
       else if (this.IsAlpha(C) || (C === '"') || (C === "_") || (C === "[") || (C === "]")) {
        Result = this.DoIdentifier()}
       else this.ScanError(pas.SysUtils.Format(rtl.getResStr($mod,"SErrUnknownCharacter"),pas.System.VarRecs(0,this.FPos,9,C)));
      this.FTokenType = Result;
      return Result;
    };
  });
  rtl.createClass(this,"EExprScanner",pas.SysUtils.Exception,function () {
  });
  this.TResultType = {"0": "rtBoolean", rtBoolean: 0, "1": "rtInteger", rtInteger: 1, "2": "rtFloat", rtFloat: 2, "3": "rtDateTime", rtDateTime: 3, "4": "rtString", rtString: 4, "5": "rtCurrency", rtCurrency: 5};
  this.$rtti.$Enum("TResultType",{minvalue: 0, maxvalue: 5, ordtype: 1, enumtype: this.TResultType});
  this.$rtti.$Set("TResultTypes",{comptype: this.$rtti["TResultType"]});
  rtl.recNewT(this,"TFPExpressionResult",function () {
    this.ResultType = 0;
    this.resValue = undefined;
    this.$eq = function (b) {
      return (this.ResultType === b.ResultType) && (this.resValue === b.resValue);
    };
    this.$assign = function (s) {
      this.ResultType = s.ResultType;
      this.resValue = s.resValue;
      return this;
    };
    var $r = $mod.$rtti.$Record("TFPExpressionResult",{},this);
    $r.addField("ResultType",$mod.$rtti["TResultType"]);
    $r.addField("resValue",rtl.jsvalue);
  });
  this.$rtti.$Pointer("PFPExpressionResult",{reftype: this.$rtti["TFPExpressionResult"]});
  this.$rtti.$DynArray("TExprParameterArray",{eltype: this.$rtti["TFPExpressionResult"]});
  rtl.createClass(this,"TFPExprNode",pas.System.TObject,function () {
    this.CheckNodeType = function (Anode, Allowed) {
      var S = "";
      var A = 0;
      if (Anode === null) $impl.RaiseParserError(rtl.getResStr($mod,"SErrNoNodeToCheck"));
      if (!(Anode.NodeType() in Allowed)) {
        S = "";
        for (A = 0; A <= 5; A++) if (A in Allowed) {
          if (S !== "") S = S + ",";
          S = S + $mod.ResultTypeName(A);
        };
        $impl.RaiseParserError$1(rtl.getResStr($mod,"SInvalidNodeType"),pas.System.VarRecs(18,$mod.ResultTypeName(Anode.NodeType()),18,S,18,Anode.AsString()));
      };
    };
    this.InitAggregate = function () {
    };
    this.UpdateAggregate = function () {
    };
    this.IsAggregate = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    this.HasAggregate = function () {
      var Result = false;
      Result = this.$class.IsAggregate();
      return Result;
    };
    this.NodeValue = function () {
      var Result = $mod.TFPExpressionResult.$new();
      Result.$assign(this.GetNodeValue());
      return Result;
    };
  });
  this.$rtti.$DynArray("TExprArgumentArray",{eltype: this.$rtti["TFPExprNode"]});
  rtl.createClass(this,"TFPBinaryOperation",this.TFPExprNode,function () {
    this.$init = function () {
      $mod.TFPExprNode.$init.call(this);
      this.FLeft = null;
      this.FRight = null;
    };
    this.$final = function () {
      this.FLeft = undefined;
      this.FRight = undefined;
      $mod.TFPExprNode.$final.call(this);
    };
    this.CheckSameNodeTypes = function () {
      var LT = 0;
      var RT = 0;
      LT = this.FLeft.NodeType();
      RT = this.FRight.NodeType();
      if (RT !== LT) $impl.RaiseParserError$1(rtl.getResStr($mod,"SErrTypesDoNotMatch"),pas.System.VarRecs(18,$mod.ResultTypeName(LT),18,$mod.ResultTypeName(RT),18,this.FLeft.AsString(),18,this.FRight.AsString()));
    };
    this.Create$1 = function (ALeft, ARight) {
      this.FLeft = ALeft;
      this.FRight = ARight;
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FLeft;
        }, set: function (v) {
          this.p.FLeft = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FRight;
        }, set: function (v) {
          this.p.FRight = v;
        }});
      pas.System.TObject.Destroy.call(this);
    };
    this.InitAggregate = function () {
      $mod.TFPExprNode.InitAggregate.call(this);
      if (this.FLeft != null) this.FLeft.InitAggregate();
      if (this.FRight != null) this.FRight.InitAggregate();
    };
    this.UpdateAggregate = function () {
      $mod.TFPExprNode.UpdateAggregate.call(this);
      if (this.FLeft != null) this.FLeft.UpdateAggregate();
      if (this.FRight != null) this.FRight.UpdateAggregate();
    };
    this.HasAggregate = function () {
      var Result = false;
      Result = $mod.TFPExprNode.HasAggregate.call(this);
      if (this.FLeft != null) Result = Result || this.FLeft.HasAggregate();
      if (this.FRight != null) Result = Result || this.FRight.HasAggregate();
      return Result;
    };
    this.Check = function () {
      if (!(this.FLeft != null)) $impl.RaiseParserError$1(rtl.getResStr($mod,"SErrNoleftOperand"),pas.System.VarRecs(18,this.$classname));
      if (!(this.FRight != null)) $impl.RaiseParserError$1(rtl.getResStr($mod,"SErrNoRightOperand"),pas.System.VarRecs(18,this.$classname));
    };
  });
  this.$rtti.$ClassRef("TFPBinaryOperationClass",{instancetype: this.$rtti["TFPBinaryOperation"]});
  rtl.createClass(this,"TFPBooleanOperation",this.TFPBinaryOperation,function () {
    this.Check = function () {
      $mod.TFPBinaryOperation.Check.call(this);
      this.CheckNodeType(this.FLeft,rtl.createSet($mod.TResultType.rtInteger,$mod.TResultType.rtBoolean));
      this.CheckNodeType(this.FRight,rtl.createSet($mod.TResultType.rtInteger,$mod.TResultType.rtBoolean));
      this.CheckSameNodeTypes();
    };
    this.NodeType = function () {
      var Result = 0;
      Result = this.FLeft.NodeType();
      return Result;
    };
  });
  rtl.createClass(this,"TFPBinaryAndOperation",this.TFPBooleanOperation,function () {
    this.GetNodeValue = function () {
      var Result = $mod.TFPExpressionResult.$new();
      var RRes = $mod.TFPExpressionResult.$new();
      Result.$assign(this.FLeft.GetNodeValue());
      RRes.$assign(this.FRight.GetNodeValue());
      var $tmp = Result.ResultType;
      if ($tmp === $mod.TResultType.rtBoolean) {
        Result.resValue = !(Result.resValue == false) && !(RRes.resValue == false)}
       else if ($tmp === $mod.TResultType.rtInteger) Result.resValue = rtl.and(rtl.trunc(Result.resValue),rtl.trunc(RRes.resValue));
      return Result;
    };
    this.AsString = function () {
      var Result = "";
      Result = this.FLeft.AsString() + " and " + this.FRight.AsString();
      return Result;
    };
  });
  rtl.createClass(this,"TFPBinaryOrOperation",this.TFPBooleanOperation,function () {
    this.GetNodeValue = function () {
      var Result = $mod.TFPExpressionResult.$new();
      var RRes = $mod.TFPExpressionResult.$new();
      Result.$assign(this.FLeft.GetNodeValue());
      RRes.$assign(this.FRight.GetNodeValue());
      var $tmp = Result.ResultType;
      if ($tmp === $mod.TResultType.rtBoolean) {
        Result.resValue = !(Result.resValue == false) || !(RRes.resValue == false)}
       else if ($tmp === $mod.TResultType.rtInteger) Result.resValue = rtl.or(rtl.trunc(Result.resValue),rtl.trunc(RRes.resValue));
      return Result;
    };
    this.AsString = function () {
      var Result = "";
      Result = this.FLeft.AsString() + " or " + this.FRight.AsString();
      return Result;
    };
  });
  rtl.createClass(this,"TFPBinaryXOrOperation",this.TFPBooleanOperation,function () {
    this.GetNodeValue = function () {
      var Result = $mod.TFPExpressionResult.$new();
      var RRes = $mod.TFPExpressionResult.$new();
      Result.$assign(this.FLeft.GetNodeValue());
      RRes.$assign(this.FRight.GetNodeValue());
      var $tmp = Result.ResultType;
      if ($tmp === $mod.TResultType.rtBoolean) {
        Result.resValue = !(Result.resValue == false) ^ !(RRes.resValue == false)}
       else if ($tmp === $mod.TResultType.rtInteger) Result.resValue = rtl.xor(rtl.trunc(Result.resValue),rtl.trunc(RRes.resValue));
      return Result;
    };
    this.AsString = function () {
      var Result = "";
      Result = this.FLeft.AsString() + " xor " + this.FRight.AsString();
      return Result;
    };
  });
  rtl.createClass(this,"TFPBooleanResultOperation",this.TFPBinaryOperation,function () {
    this.Check = function () {
      $mod.TFPBinaryOperation.Check.call(this);
      this.CheckSameNodeTypes();
    };
    this.NodeType = function () {
      var Result = 0;
      Result = $mod.TResultType.rtBoolean;
      return Result;
    };
  });
  this.$rtti.$ClassRef("TFPBooleanResultOperationClass",{instancetype: this.$rtti["TFPBooleanResultOperation"]});
  rtl.createClass(this,"TFPEqualOperation",this.TFPBooleanResultOperation,function () {
    this.GetNodeValue = function () {
      var Result = $mod.TFPExpressionResult.$new();
      var RRes = $mod.TFPExpressionResult.$new();
      Result.$assign(this.FLeft.GetNodeValue());
      RRes.$assign(this.FRight.GetNodeValue());
      Result.resValue = Result.resValue == RRes.resValue;
      Result.ResultType = $mod.TResultType.rtBoolean;
      return Result;
    };
    this.AsString = function () {
      var Result = "";
      Result = this.FLeft.AsString() + " = " + this.FRight.AsString();
      return Result;
    };
  });
  rtl.createClass(this,"TFPLikeOperation",this.TFPBooleanResultOperation,function () {
    this.$init = function () {
      $mod.TFPBooleanResultOperation.$init.call(this);
      this.FRE = null;
      this.FLast = "";
    };
    this.$final = function () {
      this.FRE = undefined;
      $mod.TFPBooleanResultOperation.$final.call(this);
    };
    var RESpecials = "([\\$\\+\\[\\]\\(\\)\\\\\\.\\*\\^\\?\\|])";
    this.GetNodeValue = function () {
      var Result = $mod.TFPExpressionResult.$new();
      var S = "";
      var RE = null;
      S = "" + this.FRight.NodeValue().resValue;
      if ((this.FLast !== "") && (S === this.FLast)) {
        RE = this.FRE}
       else {
        this.FLast = S;
        S = S.replace(new RegExp(RESpecials,"g"),"\\$1");
        S = pas.SysUtils.StringReplace(S,"%","(.*)",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
        S = pas.SysUtils.StringReplace(S,"_","(.)",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
        S = "^" + S + "$";
        try {
          this.FRE = new RegExp(S,"i");
          RE = this.FRE;
        } catch ($e) {
          Result.resValue = false;
          return Result;
        };
      };
      Result.resValue = RE.test("" + this.FLeft.NodeValue().resValue);
      return Result;
    };
    this.Check = function () {
      if (this.FLeft.NodeType() !== $mod.TResultType.rtString) $impl.RaiseParserError$1(rtl.getResStr($mod,"SErrStringTypeRequired"),pas.System.VarRecs(18,$mod.ResultTypeName(this.FLeft.NodeType()),18,this.FLeft.AsString()));
      if (this.FRight.NodeType() !== $mod.TResultType.rtString) $impl.RaiseParserError$1(rtl.getResStr($mod,"SErrStringTypeRequired"),pas.System.VarRecs(18,$mod.ResultTypeName(this.FRight.NodeType()),18,this.FRight.AsString()));
      $mod.TFPBooleanResultOperation.Check.call(this);
    };
    this.AsString = function () {
      var Result = "";
      Result = this.FLeft.AsString() + " LIKE " + this.FRight.AsString();
      return Result;
    };
  });
  rtl.createClass(this,"TFPUnequalOperation",this.TFPEqualOperation,function () {
    this.GetNodeValue = function () {
      var Result = $mod.TFPExpressionResult.$new();
      Result.$assign($mod.TFPEqualOperation.GetNodeValue.call(this));
      Result.resValue = !Result.resValue;
      return Result;
    };
    this.AsString = function () {
      var Result = "";
      Result = this.FLeft.AsString() + " <> " + this.FRight.AsString();
      return Result;
    };
  });
  rtl.createClass(this,"TFPOrderingOperation",this.TFPBooleanResultOperation,function () {
    var AllowedTypes = rtl.createSet($mod.TResultType.rtInteger,$mod.TResultType.rtFloat,$mod.TResultType.rtCurrency,$mod.TResultType.rtDateTime,$mod.TResultType.rtString);
    this.Check = function () {
      this.CheckNodeType(this.FLeft,AllowedTypes);
      this.CheckNodeType(this.FRight,AllowedTypes);
      $mod.TFPBooleanResultOperation.Check.call(this);
    };
  });
  rtl.createClass(this,"TFPLessThanOperation",this.TFPOrderingOperation,function () {
    this.GetNodeValue = function () {
      var Result = $mod.TFPExpressionResult.$new();
      var RRes = $mod.TFPExpressionResult.$new();
      Result.$assign(this.FLeft.GetNodeValue());
      RRes.$assign(this.FRight.GetNodeValue());
      var $tmp = Result.ResultType;
      if ($tmp === $mod.TResultType.rtInteger) {
        Result.resValue = rtl.trunc(Result.resValue) < rtl.trunc(RRes.resValue)}
       else if ($tmp === $mod.TResultType.rtFloat) {
        Result.resValue = rtl.getNumber(Result.resValue) < rtl.getNumber(RRes.resValue)}
       else if ($tmp === $mod.TResultType.rtCurrency) {
        Result.resValue = rtl.trunc(Result.resValue * 10000) < rtl.trunc(RRes.resValue * 10000)}
       else if ($tmp === $mod.TResultType.rtDateTime) {
        Result.resValue = rtl.getNumber(Result.resValue) < rtl.getNumber(RRes.resValue)}
       else if ($tmp === $mod.TResultType.rtString) Result.resValue = ("" + Result.resValue) < ("" + RRes.resValue);
      Result.ResultType = $mod.TResultType.rtBoolean;
      return Result;
    };
    this.AsString = function () {
      var Result = "";
      Result = this.FLeft.AsString() + " < " + this.FRight.AsString();
      return Result;
    };
  });
  rtl.createClass(this,"TFPGreaterThanOperation",this.TFPOrderingOperation,function () {
    this.GetNodeValue = function () {
      var Result = $mod.TFPExpressionResult.$new();
      var RRes = $mod.TFPExpressionResult.$new();
      Result.$assign(this.FLeft.GetNodeValue());
      RRes.$assign(this.FRight.GetNodeValue());
      var $tmp = Result.ResultType;
      if ($tmp === $mod.TResultType.rtInteger) {
        var $tmp1 = this.FRight.NodeType();
        if ($tmp1 === $mod.TResultType.rtInteger) {
          Result.resValue = rtl.trunc(Result.resValue) > rtl.trunc(RRes.resValue)}
         else if ($tmp1 === $mod.TResultType.rtFloat) {
          Result.resValue = rtl.trunc(Result.resValue) > rtl.getNumber(RRes.resValue)}
         else if ($tmp1 === $mod.TResultType.rtCurrency) Result.resValue = (rtl.trunc(Result.resValue) * 10000) > rtl.trunc(RRes.resValue * 10000);
      } else if ($tmp === $mod.TResultType.rtFloat) {
        var $tmp2 = this.FRight.NodeType();
        if ($tmp2 === $mod.TResultType.rtInteger) {
          Result.resValue = rtl.getNumber(Result.resValue) > rtl.trunc(RRes.resValue)}
         else if ($tmp2 === $mod.TResultType.rtFloat) {
          Result.resValue = rtl.getNumber(Result.resValue) > rtl.getNumber(RRes.resValue)}
         else if ($tmp2 === $mod.TResultType.rtCurrency) Result.resValue = (rtl.getNumber(Result.resValue) * 10000) > rtl.trunc(RRes.resValue * 10000);
      } else if ($tmp === $mod.TResultType.rtCurrency) {
        var $tmp3 = this.FRight.NodeType();
        if ($tmp3 === $mod.TResultType.rtInteger) {
          Result.resValue = rtl.trunc(Result.resValue * 10000) > (rtl.trunc(RRes.resValue) * 10000)}
         else if ($tmp3 === $mod.TResultType.rtFloat) {
          Result.resValue = rtl.trunc(Result.resValue * 10000) > (rtl.getNumber(RRes.resValue) * 10000)}
         else if ($tmp3 === $mod.TResultType.rtCurrency) Result.resValue = rtl.trunc(Result.resValue * 10000) > rtl.trunc(RRes.resValue * 10000);
      } else if ($tmp === $mod.TResultType.rtDateTime) {
        Result.resValue = rtl.getNumber(Result.resValue) > rtl.getNumber(RRes.resValue)}
       else if ($tmp === $mod.TResultType.rtString) Result.resValue = ("" + Result.resValue) > ("" + RRes.resValue);
      Result.ResultType = $mod.TResultType.rtBoolean;
      return Result;
    };
    this.AsString = function () {
      var Result = "";
      Result = this.FLeft.AsString() + " > " + this.FRight.AsString();
      return Result;
    };
  });
  rtl.createClass(this,"TFPLessThanEqualOperation",this.TFPGreaterThanOperation,function () {
    this.GetNodeValue = function () {
      var Result = $mod.TFPExpressionResult.$new();
      Result.$assign($mod.TFPGreaterThanOperation.GetNodeValue.call(this));
      Result.resValue = !Result.resValue;
      return Result;
    };
    this.AsString = function () {
      var Result = "";
      Result = this.FLeft.AsString() + " <= " + this.FRight.AsString();
      return Result;
    };
  });
  rtl.createClass(this,"TFPGreaterThanEqualOperation",this.TFPLessThanOperation,function () {
    this.GetNodeValue = function () {
      var Result = $mod.TFPExpressionResult.$new();
      Result.$assign($mod.TFPLessThanOperation.GetNodeValue.call(this));
      Result.resValue = !Result.resValue;
      return Result;
    };
    this.AsString = function () {
      var Result = "";
      Result = this.FLeft.AsString() + " >= " + this.FRight.AsString();
      return Result;
    };
  });
  rtl.createClass(this,"TIfOperation",this.TFPBinaryOperation,function () {
    this.$init = function () {
      $mod.TFPBinaryOperation.$init.call(this);
      this.FCondition = null;
    };
    this.$final = function () {
      this.FCondition = undefined;
      $mod.TFPBinaryOperation.$final.call(this);
    };
    this.GetNodeValue = function () {
      var Result = $mod.TFPExpressionResult.$new();
      Result.$assign(this.FCondition.GetNodeValue());
      if (!(Result.resValue == false)) {
        Result.$assign(this.FLeft.GetNodeValue())}
       else Result.$assign(this.FRight.GetNodeValue());
      return Result;
    };
    this.Check = function () {
      $mod.TFPBinaryOperation.Check.call(this);
      if (this.FCondition.NodeType() !== $mod.TResultType.rtBoolean) $impl.RaiseParserError$1(rtl.getResStr($mod,"SErrIFNeedsBoolean"),pas.System.VarRecs(18,this.FCondition.AsString()));
      this.CheckSameNodeTypes();
    };
    this.InitAggregate = function () {
      $mod.TFPBinaryOperation.InitAggregate.call(this);
      if (this.FCondition != null) this.FCondition.InitAggregate();
    };
    this.UpdateAggregate = function () {
      $mod.TFPBinaryOperation.UpdateAggregate.call(this);
      if (this.FCondition != null) this.FCondition.UpdateAggregate();
    };
    this.HasAggregate = function () {
      var Result = false;
      Result = $mod.TFPBinaryOperation.HasAggregate.call(this);
      if (this.FCondition != null) Result = Result || this.FCondition.HasAggregate();
      return Result;
    };
    this.NodeType = function () {
      var Result = 0;
      Result = this.FLeft.NodeType();
      return Result;
    };
    this.Create$2 = function (ACondition, ALeft, ARight) {
      $mod.TFPBinaryOperation.Create$1.call(this,ALeft,ARight);
      this.FCondition = ACondition;
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FCondition;
        }, set: function (v) {
          this.p.FCondition = v;
        }});
      $mod.TFPBinaryOperation.Destroy.call(this);
    };
    this.AsString = function () {
      var Result = "";
      Result = pas.SysUtils.Format("if(%s , %s , %s)",pas.System.VarRecs(18,this.FCondition.AsString(),18,this.FLeft.AsString(),18,this.FRight.AsString()));
      return Result;
    };
  });
  rtl.createClass(this,"TCaseOperation",this.TFPExprNode,function () {
    this.$init = function () {
      $mod.TFPExprNode.$init.call(this);
      this.FArgs = [];
      this.FCondition = null;
    };
    this.$final = function () {
      this.FArgs = undefined;
      this.FCondition = undefined;
      $mod.TFPExprNode.$final.call(this);
    };
    this.GetNodeValue = function () {
      var Result = $mod.TFPExpressionResult.$new();
      var I = 0;
      var L = 0;
      var B = false;
      var RT = $mod.TFPExpressionResult.$new();
      var RV = $mod.TFPExpressionResult.$new();
      RT.$assign(this.FArgs[0].GetNodeValue());
      L = rtl.length(this.FArgs);
      I = 2;
      B = false;
      while (!B && (I < L)) {
        Result.$assign(this.FArgs[I].GetNodeValue());
        var $tmp = RT.ResultType;
        if ($tmp === $mod.TResultType.rtBoolean) {
          B = RT.resValue == RV.resValue}
         else if ($tmp === $mod.TResultType.rtInteger) {
          B = RT.resValue == RV.resValue}
         else if ($tmp === $mod.TResultType.rtFloat) {
          B = RT.resValue == RV.resValue}
         else if ($tmp === $mod.TResultType.rtCurrency) {
          B = RT.resValue == RV.resValue}
         else if ($tmp === $mod.TResultType.rtDateTime) {
          B = RT.resValue == RV.resValue}
         else if ($tmp === $mod.TResultType.rtString) B = RT.resValue == RV.resValue;
        if (!B) I += 2;
      };
      Result.ResultType = this.FArgs[1].NodeType();
      if (B) {
        Result.$assign(this.FArgs[I + 1].GetNodeValue())}
       else if ((L % 2) === 0) Result.$assign(this.FArgs[1].GetNodeValue());
      return Result;
    };
    this.Check = function () {
      var T = 0;
      var V = 0;
      var I = 0;
      var N = null;
      if (rtl.length(this.FArgs) < 3) $impl.RaiseParserError(rtl.getResStr($mod,"SErrCaseNeeds3"));
      if ((rtl.length(this.FArgs) % 2) === 1) $impl.RaiseParserError(rtl.getResStr($mod,"SErrCaseEvenCount"));
      T = this.FArgs[0].NodeType();
      V = this.FArgs[1].NodeType();
      for (var $l = 2, $end = rtl.length(this.FArgs) - 1; $l <= $end; $l++) {
        I = $l;
        N = this.FArgs[I];
        if ((I % 2) === 0) {
          if (!$mod.TFPConstExpression.isPrototypeOf(N)) $impl.RaiseParserError$1(rtl.getResStr($mod,"SErrCaseLabelNotAConst"),pas.System.VarRecs(0,rtl.trunc(I / 2),18,N.AsString()));
          if (N.NodeType() !== T) $impl.RaiseParserError$1(rtl.getResStr($mod,"SErrCaseLabelType"),pas.System.VarRecs(0,rtl.trunc(I / 2),18,N.AsString(),18,$mod.ResultTypeName(T),18,$mod.ResultTypeName(N.NodeType())));
        } else {
          if (N.NodeType() !== V) $impl.RaiseParserError$1(rtl.getResStr($mod,"SErrCaseValueType"),pas.System.VarRecs(0,rtl.trunc((I - 1) / 2),18,N.AsString(),18,$mod.ResultTypeName(V),18,$mod.ResultTypeName(N.NodeType())));
        };
      };
    };
    this.InitAggregate = function () {
      var I = 0;
      $mod.TFPExprNode.InitAggregate.call(this);
      if (this.FCondition != null) this.FCondition.InitAggregate();
      for (var $l = 0, $end = rtl.length(this.FArgs) - 1; $l <= $end; $l++) {
        I = $l;
        this.FArgs[I].InitAggregate();
      };
    };
    this.UpdateAggregate = function () {
      var I = 0;
      $mod.TFPExprNode.UpdateAggregate.call(this);
      if (this.FCondition != null) this.FCondition.UpdateAggregate();
      for (var $l = 0, $end = rtl.length(this.FArgs) - 1; $l <= $end; $l++) {
        I = $l;
        this.FArgs[I].InitAggregate();
      };
    };
    this.HasAggregate = function () {
      var Result = false;
      var I = 0;
      var L = 0;
      Result = $mod.TFPExprNode.HasAggregate.call(this);
      L = rtl.length(this.FArgs);
      I = 0;
      while (!Result && (I < L)) {
        Result = Result || this.FArgs[I].HasAggregate();
        I += 1;
      };
      return Result;
    };
    this.NodeType = function () {
      var Result = 0;
      Result = this.FArgs[1].NodeType();
      return Result;
    };
    this.Create$1 = function (Args) {
      this.FArgs = rtl.arrayRef(Args);
      return this;
    };
    this.Destroy = function () {
      var I = 0;
      for (var $l = 0, $end = rtl.length(this.FArgs) - 1; $l <= $end; $l++) {
        I = $l;
        pas.SysUtils.FreeAndNil({a: I, p: this.FArgs, get: function () {
            return this.p[this.a];
          }, set: function (v) {
            this.p[this.a] = v;
          }});
      };
      pas.System.TObject.Destroy.call(this);
    };
    this.AsString = function () {
      var Result = "";
      var I = 0;
      Result = "";
      for (var $l = 0, $end = rtl.length(this.FArgs) - 1; $l <= $end; $l++) {
        I = $l;
        if (Result !== "") Result = Result + ", ";
        Result = Result + this.FArgs[I].AsString();
      };
      Result = "Case(" + Result + ")";
      return Result;
    };
  });
  rtl.createClass(this,"TMathOperation",this.TFPBinaryOperation,function () {
    var AllowedTypes = rtl.createSet($mod.TResultType.rtInteger,$mod.TResultType.rtFloat,$mod.TResultType.rtCurrency,$mod.TResultType.rtDateTime,$mod.TResultType.rtString);
    this.Check = function () {
      $mod.TFPBinaryOperation.Check.call(this);
      this.CheckNodeType(this.FLeft,AllowedTypes);
      this.CheckNodeType(this.FRight,AllowedTypes);
      this.CheckSameNodeTypes();
    };
    this.NodeType = function () {
      var Result = 0;
      Result = this.FLeft.NodeType();
      return Result;
    };
  });
  rtl.createClass(this,"TFPAddOperation",this.TMathOperation,function () {
    this.GetNodeValue = function () {
      var Result = $mod.TFPExpressionResult.$new();
      var RRes = $mod.TFPExpressionResult.$new();
      Result.$assign(this.FLeft.GetNodeValue());
      RRes.$assign(this.FRight.GetNodeValue());
      var $tmp = Result.ResultType;
      if ($tmp === $mod.TResultType.rtInteger) {
        Result.resValue = rtl.trunc(Result.resValue) + rtl.trunc(RRes.resValue)}
       else if ($tmp === $mod.TResultType.rtString) {
        Result.resValue = "" + Result.resValue + ("" + RRes.resValue)}
       else if ($tmp === $mod.TResultType.rtDateTime) {
        Result.resValue = rtl.getNumber(Result.resValue) + rtl.getNumber(RRes.resValue)}
       else if ($tmp === $mod.TResultType.rtFloat) {
        Result.resValue = rtl.getNumber(Result.resValue) + rtl.getNumber(RRes.resValue)}
       else if ($tmp === $mod.TResultType.rtCurrency) Result.resValue = (rtl.trunc(Result.resValue * 10000) + rtl.trunc(RRes.resValue * 10000)) / 10000;
      Result.ResultType = this.NodeType();
      return Result;
    };
    this.AsString = function () {
      var Result = "";
      Result = this.FLeft.AsString() + " + " + this.FRight.AsString();
      return Result;
    };
  });
  rtl.createClass(this,"TFPSubtractOperation",this.TMathOperation,function () {
    var AllowedTypes$1 = rtl.createSet($mod.TResultType.rtInteger,$mod.TResultType.rtFloat,$mod.TResultType.rtCurrency,$mod.TResultType.rtDateTime);
    this.Check = function () {
      this.CheckNodeType(this.FLeft,AllowedTypes$1);
      this.CheckNodeType(this.FRight,AllowedTypes$1);
      $mod.TMathOperation.Check.call(this);
    };
    this.GetNodeValue = function () {
      var Result = $mod.TFPExpressionResult.$new();
      var RRes = $mod.TFPExpressionResult.$new();
      Result.$assign(this.FLeft.GetNodeValue());
      RRes.$assign(this.FRight.GetNodeValue());
      var $tmp = Result.ResultType;
      if ($tmp === $mod.TResultType.rtInteger) {
        Result.resValue = rtl.trunc(Result.resValue) - rtl.trunc(RRes.resValue)}
       else if ($tmp === $mod.TResultType.rtDateTime) {
        Result.resValue = rtl.getNumber(Result.resValue) - rtl.getNumber(RRes.resValue)}
       else if ($tmp === $mod.TResultType.rtFloat) {
        Result.resValue = rtl.getNumber(Result.resValue) - rtl.getNumber(RRes.resValue)}
       else if ($tmp === $mod.TResultType.rtCurrency) Result.resValue = (rtl.trunc(Result.resValue * 10000) - rtl.trunc(RRes.resValue * 10000)) / 10000;
      return Result;
    };
    this.AsString = function () {
      var Result = "";
      Result = this.FLeft.AsString() + " - " + this.FRight.AsString();
      return Result;
    };
  });
  rtl.createClass(this,"TFPMultiplyOperation",this.TMathOperation,function () {
    var AllowedTypes$1 = rtl.createSet($mod.TResultType.rtInteger,$mod.TResultType.rtCurrency,$mod.TResultType.rtFloat);
    this.Check = function () {
      this.CheckNodeType(this.FLeft,AllowedTypes$1);
      this.CheckNodeType(this.FRight,AllowedTypes$1);
      $mod.TMathOperation.Check.call(this);
    };
    this.AsString = function () {
      var Result = "";
      Result = this.FLeft.AsString() + " * " + this.FRight.AsString();
      return Result;
    };
    this.GetNodeValue = function () {
      var Result = $mod.TFPExpressionResult.$new();
      var RRes = $mod.TFPExpressionResult.$new();
      Result.$assign(this.FLeft.GetNodeValue());
      RRes.$assign(this.FRight.GetNodeValue());
      var $tmp = Result.ResultType;
      if ($tmp === $mod.TResultType.rtInteger) {
        Result.resValue = rtl.trunc(Result.resValue) * rtl.trunc(RRes.resValue)}
       else if ($tmp === $mod.TResultType.rtFloat) {
        Result.resValue = rtl.getNumber(Result.resValue) * rtl.getNumber(RRes.resValue)}
       else if ($tmp === $mod.TResultType.rtCurrency) Result.resValue = ((rtl.trunc(Result.resValue * 10000) * rtl.trunc(RRes.resValue * 10000)) / 10000) / 10000;
      return Result;
    };
  });
  rtl.createClass(this,"TFPDivideOperation",this.TMathOperation,function () {
    var AllowedTypes$1 = rtl.createSet($mod.TResultType.rtInteger,$mod.TResultType.rtCurrency,$mod.TResultType.rtFloat);
    this.Check = function () {
      this.CheckNodeType(this.FLeft,AllowedTypes$1);
      this.CheckNodeType(this.FRight,AllowedTypes$1);
      $mod.TMathOperation.Check.call(this);
    };
    this.AsString = function () {
      var Result = "";
      Result = this.FLeft.AsString() + " / " + this.FRight.AsString();
      return Result;
    };
    this.NodeType = function () {
      var Result = 0;
      if ((this.FLeft.NodeType() === $mod.TResultType.rtCurrency) && (this.FRight.NodeType() === $mod.TResultType.rtCurrency)) {
        Result = $mod.TResultType.rtCurrency}
       else Result = $mod.TResultType.rtFloat;
      return Result;
    };
    this.GetNodeValue = function () {
      var Result = $mod.TFPExpressionResult.$new();
      var RRes = $mod.TFPExpressionResult.$new();
      Result.$assign(this.FLeft.GetNodeValue());
      RRes.$assign(this.FRight.GetNodeValue());
      var $tmp = Result.ResultType;
      if ($tmp === $mod.TResultType.rtInteger) {
        Result.resValue = rtl.trunc(Result.resValue) / rtl.trunc(RRes.resValue)}
       else if ($tmp === $mod.TResultType.rtFloat) {
        Result.resValue = rtl.getNumber(Result.resValue) / rtl.getNumber(RRes.resValue)}
       else if ($tmp === $mod.TResultType.rtCurrency) if (this.NodeType() === $mod.TResultType.rtCurrency) {
        Result.resValue = rtl.trunc((rtl.trunc(Result.resValue * 10000) / rtl.trunc(RRes.resValue * 10000)) * 10000) / 10000}
       else Result.resValue = rtl.getNumber(Result.resValue) / rtl.getNumber(RRes.resValue);
      Result.ResultType = this.NodeType();
      return Result;
    };
  });
  rtl.createClass(this,"TFPModuloOperation",this.TMathOperation,function () {
    this.Check = function () {
      this.CheckNodeType(this.FLeft,rtl.createSet($mod.TResultType.rtInteger));
      this.CheckNodeType(this.FRight,rtl.createSet($mod.TResultType.rtInteger));
      $mod.TMathOperation.Check.call(this);
    };
    this.AsString = function () {
      var Result = "";
      Result = this.FLeft.AsString() + " mod " + this.FRight.AsString();
      return Result;
    };
    this.NodeType = function () {
      var Result = 0;
      Result = $mod.TResultType.rtInteger;
      return Result;
    };
    this.GetNodeValue = function () {
      var Result = $mod.TFPExpressionResult.$new();
      var RRes = $mod.TFPExpressionResult.$new();
      Result.$assign(this.FLeft.GetNodeValue());
      RRes.$assign(this.FRight.GetNodeValue());
      Result.resValue = rtl.trunc(Result.resValue) % rtl.trunc(RRes.resValue);
      Result.ResultType = $mod.TResultType.rtInteger;
      return Result;
    };
  });
  rtl.createClass(this,"TFPPowerOperation",this.TMathOperation,function () {
    var AllowedTypes$1 = rtl.createSet($mod.TResultType.rtInteger,$mod.TResultType.rtCurrency,$mod.TResultType.rtFloat);
    this.Check = function () {
      this.CheckNodeType(this.FLeft,AllowedTypes$1);
      this.CheckNodeType(this.FRight,AllowedTypes$1);
    };
    this.AsString = function () {
      var Result = "";
      Result = this.FLeft.AsString() + "^" + this.FRight.AsString();
      return Result;
    };
    this.NodeType = function () {
      var Result = 0;
      Result = $mod.TResultType.rtFloat;
      return Result;
    };
    this.GetNodeValue = function () {
      var Result = $mod.TFPExpressionResult.$new();
      var RRes = $mod.TFPExpressionResult.$new();
      Result.$assign(this.FLeft.GetNodeValue());
      RRes.$assign(this.FRight.GetNodeValue());
      Result.resValue = $impl.power($mod.ArgToFloat($mod.TFPExpressionResult.$clone(Result)),$mod.ArgToFloat($mod.TFPExpressionResult.$clone(RRes)));
      Result.ResultType = $mod.TResultType.rtFloat;
      return Result;
    };
  });
  rtl.createClass(this,"TFPUnaryOperator",this.TFPExprNode,function () {
    this.$init = function () {
      $mod.TFPExprNode.$init.call(this);
      this.FOperand = null;
    };
    this.$final = function () {
      this.FOperand = undefined;
      $mod.TFPExprNode.$final.call(this);
    };
    this.Create$1 = function (AOperand) {
      this.FOperand = AOperand;
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FOperand;
        }, set: function (v) {
          this.p.FOperand = v;
        }});
      pas.System.TObject.Destroy.call(this);
    };
    this.InitAggregate = function () {
      $mod.TFPExprNode.InitAggregate.call(this);
      if (this.FOperand != null) this.FOperand.InitAggregate();
    };
    this.UpdateAggregate = function () {
      $mod.TFPExprNode.UpdateAggregate.call(this);
      if (this.FOperand != null) this.FOperand.UpdateAggregate();
    };
    this.HasAggregate = function () {
      var Result = false;
      Result = $mod.TFPExprNode.HasAggregate.call(this);
      if (this.FOperand != null) Result = Result || this.FOperand.HasAggregate();
      return Result;
    };
    this.Check = function () {
      if (!(this.FOperand != null)) $impl.RaiseParserError$1(rtl.getResStr($mod,"SErrNoOperand"),pas.System.VarRecs(18,this.$classname));
    };
  });
  rtl.createClass(this,"TFPConvertNode",this.TFPUnaryOperator,function () {
    this.AsString = function () {
      var Result = "";
      Result = this.FOperand.AsString();
      return Result;
    };
  });
  rtl.createClass(this,"TFPNotNode",this.TFPUnaryOperator,function () {
    this.Check = function () {
      if (!(this.FOperand.NodeType() in rtl.createSet($mod.TResultType.rtInteger,$mod.TResultType.rtBoolean))) $impl.RaiseParserError$1(rtl.getResStr($mod,"SErrNoNOTOperation"),pas.System.VarRecs(18,$mod.ResultTypeName(this.FOperand.NodeType()),18,this.FOperand.AsString()));
    };
    this.NodeType = function () {
      var Result = 0;
      Result = this.FOperand.NodeType();
      return Result;
    };
    this.GetNodeValue = function () {
      var Result = $mod.TFPExpressionResult.$new();
      Result.$assign(this.FOperand.GetNodeValue());
      var $tmp = Result.ResultType;
      if ($tmp === $mod.TResultType.rtInteger) {
        Result.resValue = !Result.resValue}
       else if ($tmp === $mod.TResultType.rtBoolean) Result.resValue = !Result.resValue;
      return Result;
    };
    this.AsString = function () {
      var Result = "";
      Result = "not " + this.FOperand.AsString();
      return Result;
    };
  });
  rtl.createClass(this,"TIntConvertNode",this.TFPConvertNode,function () {
    this.Check = function () {
      $mod.TFPUnaryOperator.Check.call(this);
      this.CheckNodeType(this.FOperand,rtl.createSet($mod.TResultType.rtInteger));
    };
  });
  rtl.createClass(this,"TIntToFloatNode",this.TIntConvertNode,function () {
    this.NodeType = function () {
      var Result = 0;
      Result = $mod.TResultType.rtFloat;
      return Result;
    };
    this.GetNodeValue = function () {
      var Result = $mod.TFPExpressionResult.$new();
      Result.$assign(this.FOperand.GetNodeValue());
      Result.resValue = Result.resValue;
      Result.ResultType = $mod.TResultType.rtFloat;
      return Result;
    };
  });
  rtl.createClass(this,"TIntToCurrencyNode",this.TIntConvertNode,function () {
    this.NodeType = function () {
      var Result = 0;
      Result = $mod.TResultType.rtCurrency;
      return Result;
    };
    this.GetNodeValue = function () {
      var Result = $mod.TFPExpressionResult.$new();
      Result.$assign(this.FOperand.GetNodeValue());
      Result.resValue = Result.resValue;
      Result.ResultType = $mod.TResultType.rtCurrency;
      return Result;
    };
  });
  rtl.createClass(this,"TIntToDateTimeNode",this.TIntConvertNode,function () {
    this.NodeType = function () {
      var Result = 0;
      Result = $mod.TResultType.rtDateTime;
      return Result;
    };
    this.GetNodeValue = function () {
      var Result = $mod.TFPExpressionResult.$new();
      Result.$assign(this.FOperand.GetNodeValue());
      Result.ResultType = $mod.TResultType.rtDateTime;
      return Result;
    };
  });
  rtl.createClass(this,"TFloatToDateTimeNode",this.TFPConvertNode,function () {
    this.Check = function () {
      $mod.TFPUnaryOperator.Check.call(this);
      this.CheckNodeType(this.FOperand,rtl.createSet($mod.TResultType.rtFloat));
    };
    this.NodeType = function () {
      var Result = 0;
      Result = $mod.TResultType.rtDateTime;
      return Result;
    };
    this.GetNodeValue = function () {
      var Result = $mod.TFPExpressionResult.$new();
      Result.$assign(this.FOperand.GetNodeValue());
      Result.ResultType = $mod.TResultType.rtDateTime;
      return Result;
    };
  });
  rtl.createClass(this,"TFloatToCurrencyNode",this.TFPConvertNode,function () {
    this.Check = function () {
      this.CheckNodeType(this.FOperand,rtl.createSet($mod.TResultType.rtFloat));
    };
    this.NodeType = function () {
      var Result = 0;
      Result = $mod.TResultType.rtCurrency;
      return Result;
    };
    this.GetNodeValue = function () {
      var Result = $mod.TFPExpressionResult.$new();
      Result.$assign(this.FOperand.GetNodeValue());
      Result.ResultType = $mod.TResultType.rtCurrency;
      Result.resValue = Result.resValue;
      return Result;
    };
  });
  rtl.createClass(this,"TCurrencyToDateTimeNode",this.TFPConvertNode,function () {
    this.Check = function () {
      $mod.TFPUnaryOperator.Check.call(this);
      this.CheckNodeType(this.FOperand,rtl.createSet($mod.TResultType.rtCurrency));
    };
    this.NodeType = function () {
      var Result = 0;
      Result = $mod.TResultType.rtDateTime;
      return Result;
    };
    this.GetNodeValue = function () {
      var Result = $mod.TFPExpressionResult.$new();
      var R = $mod.TFPExpressionResult.$new();
      R.$assign(this.FOperand.GetNodeValue());
      Result.resValue = rtl.trunc(R.resValue * 10000) / 10000;
      Result.ResultType = $mod.TResultType.rtDateTime;
      return Result;
    };
  });
  rtl.createClass(this,"TCurrencyToFloatNode",this.TFPConvertNode,function () {
    this.Check = function () {
      $mod.TFPUnaryOperator.Check.call(this);
      this.CheckNodeType(this.FOperand,rtl.createSet($mod.TResultType.rtCurrency));
    };
    this.NodeType = function () {
      var Result = 0;
      Result = $mod.TResultType.rtFloat;
      return Result;
    };
    this.GetNodeValue = function () {
      var Result = $mod.TFPExpressionResult.$new();
      Result.$assign(this.FOperand.GetNodeValue());
      Result.resValue = rtl.trunc(Result.resValue * 10000) / 10000;
      Result.ResultType = $mod.TResultType.rtFloat;
      return Result;
    };
  });
  rtl.createClass(this,"TFPNegateOperation",this.TFPUnaryOperator,function () {
    this.Check = function () {
      $mod.TFPUnaryOperator.Check.call(this);
      if (!(this.FOperand.NodeType() in rtl.createSet($mod.TResultType.rtInteger,$mod.TResultType.rtFloat,$mod.TResultType.rtCurrency))) $impl.RaiseParserError$1(rtl.getResStr($mod,"SErrNoNegation"),pas.System.VarRecs(18,$mod.ResultTypeName(this.FOperand.NodeType()),18,this.FOperand.AsString()));
    };
    this.NodeType = function () {
      var Result = 0;
      Result = this.FOperand.NodeType();
      return Result;
    };
    this.GetNodeValue = function () {
      var Result = $mod.TFPExpressionResult.$new();
      Result.$assign(this.FOperand.GetNodeValue());
      var $tmp = Result.ResultType;
      if ($tmp === $mod.TResultType.rtInteger) {
        Result.resValue = -rtl.trunc(Result.resValue)}
       else if ($tmp === $mod.TResultType.rtFloat) {
        Result.resValue = -rtl.getNumber(Result.resValue)}
       else if ($tmp === $mod.TResultType.rtCurrency) Result.resValue = -rtl.trunc(Result.resValue * 10000) / 10000;
      return Result;
    };
    this.AsString = function () {
      var Result = "";
      Result = "-" + pas.SysUtils.TrimLeft(this.FOperand.AsString());
      return Result;
    };
  });
  rtl.createClass(this,"TFPConstExpression",this.TFPExprNode,function () {
    this.$init = function () {
      $mod.TFPExprNode.$init.call(this);
      this.FValue = $mod.TFPExpressionResult.$new();
    };
    this.$final = function () {
      this.FValue = undefined;
      $mod.TFPExprNode.$final.call(this);
    };
    this.CreateString = function (AValue) {
      this.FValue.ResultType = $mod.TResultType.rtString;
      this.FValue.resValue = AValue;
      return this;
    };
    this.CreateInteger = function (AValue) {
      this.FValue.ResultType = $mod.TResultType.rtInteger;
      this.FValue.resValue = AValue;
      return this;
    };
    this.CreateDateTime = function (AValue) {
      this.FValue.ResultType = $mod.TResultType.rtDateTime;
      this.FValue.resValue = AValue;
      return this;
    };
    this.CreateFloat = function (AValue) {
      pas.System.TObject.Create.call(this);
      this.FValue.ResultType = $mod.TResultType.rtFloat;
      this.FValue.resValue = AValue;
      return this;
    };
    this.CreateBoolean = function (AValue) {
      this.FValue.ResultType = $mod.TResultType.rtBoolean;
      this.FValue.resValue = AValue;
      return this;
    };
    this.CreateCurrency = function (AValue) {
      pas.System.TObject.Create.call(this);
      this.FValue.ResultType = $mod.TResultType.rtCurrency;
      this.FValue.resValue = AValue / 10000;
      return this;
    };
    this.Check = function () {
    };
    this.NodeType = function () {
      var Result = 0;
      Result = this.FValue.ResultType;
      return Result;
    };
    this.GetNodeValue = function () {
      var Result = $mod.TFPExpressionResult.$new();
      Result.$assign(this.FValue);
      return Result;
    };
    this.AsString = function () {
      var Result = "";
      var $tmp = this.NodeType();
      if ($tmp === $mod.TResultType.rtString) {
        Result = "'" + ("" + this.FValue.resValue) + "'"}
       else if ($tmp === $mod.TResultType.rtInteger) {
        Result = pas.SysUtils.IntToStr(rtl.trunc(this.FValue.resValue))}
       else if ($tmp === $mod.TResultType.rtDateTime) {
        Result = "'" + pas.SysUtils.FormatDateTime("cccc",rtl.getNumber(this.FValue.resValue)) + "'"}
       else if ($tmp === $mod.TResultType.rtBoolean) {
        if (!(this.FValue.resValue == false)) {
          Result = "True"}
         else Result = "False"}
       else if ($tmp === $mod.TResultType.rtFloat) {
        Result = rtl.floatToStr(rtl.getNumber(this.FValue.resValue))}
       else if ($tmp === $mod.TResultType.rtCurrency) Result = rtl.floatToStr(rtl.trunc(this.FValue.resValue * 10000) / 10000);
      return Result;
    };
  });
  this.TIdentifierType = {"0": "itVariable", itVariable: 0, "1": "itFunctionHandler", itFunctionHandler: 1, "2": "itFunctionNode", itFunctionNode: 2};
  this.$rtti.$Enum("TIdentifierType",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TIdentifierType});
  this.$rtti.$RefToProcVar("TFPExprFunctionEvent",{procsig: rtl.newTIProcSig([["Args",this.$rtti["TExprParameterArray"],2]],this.$rtti["TFPExpressionResult"])});
  this.$rtti.$RefToProcVar("TFPExprVariableEvent",{procsig: rtl.newTIProcSig([["AName",rtl.string,2]],this.$rtti["TFPExpressionResult"])});
  rtl.createClass(this,"TFPExprIdentifierDef",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FNodeType = null;
      this.FOnGetVarValue = null;
      this.FStringValue = "";
      this.FValue = $mod.TFPExpressionResult.$new();
      this.FArgumentTypes = "";
      this.FIDType = 0;
      this.FName = "";
      this.FOnGetValue = null;
    };
    this.$final = function () {
      this.FNodeType = undefined;
      this.FOnGetVarValue = undefined;
      this.FValue = undefined;
      this.FOnGetValue = undefined;
      pas.Classes.TCollectionItem.$final.call(this);
    };
    this.GetAsBoolean = function () {
      var Result = false;
      this.CheckResultType($mod.TResultType.rtBoolean);
      this.CheckVariable();
      Result = !(this.FValue.resValue == false);
      return Result;
    };
    this.GetAsDateTime = function () {
      var Result = 0.0;
      this.CheckResultType($mod.TResultType.rtDateTime);
      this.CheckVariable();
      Result = rtl.getNumber(this.FValue.resValue);
      return Result;
    };
    this.GetAsFloat = function () {
      var Result = 0.0;
      this.CheckResultType($mod.TResultType.rtFloat);
      this.CheckVariable();
      Result = rtl.getNumber(this.FValue.resValue);
      return Result;
    };
    this.GetAsCurrency = function () {
      var Result = 0;
      this.CheckResultType($mod.TResultType.rtCurrency);
      this.CheckVariable();
      Result = rtl.trunc(this.FValue.resValue * 10000);
      return Result;
    };
    this.GetAsInteger = function () {
      var Result = 0;
      this.CheckResultType($mod.TResultType.rtInteger);
      this.CheckVariable();
      Result = rtl.trunc(this.FValue.resValue);
      return Result;
    };
    this.GetAsString = function () {
      var Result = "";
      this.CheckResultType($mod.TResultType.rtString);
      this.CheckVariable();
      Result = "" + this.FValue.resValue;
      return Result;
    };
    this.GetResultType = function () {
      var Result = 0;
      Result = this.FValue.ResultType;
      return Result;
    };
    this.GetValue = function () {
      var Result = "";
      var $tmp = this.FValue.ResultType;
      if ($tmp === $mod.TResultType.rtBoolean) {
        if (this.FValue.resValue) {
          Result = "True"}
         else Result = "False"}
       else if ($tmp === $mod.TResultType.rtInteger) {
        Result = pas.SysUtils.IntToStr(rtl.trunc(this.FValue.resValue))}
       else if ($tmp === $mod.TResultType.rtFloat) {
        Result = pas.SysUtils.FloatToStr(rtl.getNumber(this.FValue.resValue))}
       else if ($tmp === $mod.TResultType.rtCurrency) {
        Result = pas.SysUtils.CurrToStr(rtl.trunc(this.FValue.resValue * 10000))}
       else if ($tmp === $mod.TResultType.rtDateTime) {
        Result = pas.SysUtils.FormatDateTime("cccc",rtl.getNumber(this.FValue.resValue))}
       else if ($tmp === $mod.TResultType.rtString) Result = "" + this.FValue.resValue;
      return Result;
    };
    this.SetArgumentTypes = function (AValue) {
      var I = 0;
      if (this.FArgumentTypes === AValue) return;
      for (var $l = 1, $end = AValue.length; $l <= $end; $l++) {
        I = $l;
        $mod.CharToResultType(AValue.charAt(I - 1));
      };
      this.FArgumentTypes = AValue;
    };
    this.SetAsBoolean = function (AValue) {
      this.CheckVariable();
      this.CheckResultType($mod.TResultType.rtBoolean);
      this.FValue.resValue = AValue;
    };
    this.SetAsDateTime = function (AValue) {
      this.CheckVariable();
      this.CheckResultType($mod.TResultType.rtDateTime);
      this.FValue.resValue = AValue;
    };
    this.SetAsFloat = function (AValue) {
      this.CheckVariable();
      this.CheckResultType($mod.TResultType.rtFloat);
      this.FValue.resValue = AValue;
    };
    this.SetAsCurrency = function (AValue) {
      this.CheckVariable();
      this.CheckResultType($mod.TResultType.rtCurrency);
      this.FValue.resValue = AValue / 10000;
    };
    this.SetAsInteger = function (AValue) {
      this.CheckVariable();
      this.CheckResultType($mod.TResultType.rtInteger);
      this.FValue.resValue = AValue;
    };
    this.SetAsString = function (AValue) {
      this.CheckVariable();
      this.CheckResultType($mod.TResultType.rtString);
      this.FValue.resValue = AValue;
    };
    this.SetName = function (AValue) {
      if (this.FName === AValue) return;
      if (AValue !== "") if ((this.FCollection != null) && (this.FCollection.IndexOfIdentifier(AValue) !== -1)) $impl.RaiseParserError$1(rtl.getResStr($mod,"SErrDuplicateIdentifier"),pas.System.VarRecs(18,AValue));
      this.FName = AValue;
    };
    this.SetResultType = function (AValue) {
      if (AValue !== this.FValue.ResultType) {
        this.FValue.ResultType = AValue;
        this.SetValue(this.FStringValue);
      };
    };
    this.SetValue = function (AValue) {
      this.FStringValue = AValue;
      if (AValue !== "") {
        var $tmp = this.FValue.ResultType;
        if ($tmp === $mod.TResultType.rtBoolean) {
          this.FValue.resValue = this.FStringValue === "True"}
         else if ($tmp === $mod.TResultType.rtInteger) {
          this.FValue.resValue = pas.SysUtils.StrToInt(AValue)}
         else if ($tmp === $mod.TResultType.rtFloat) {
          this.FValue.resValue = pas.SysUtils.StrToFloat(AValue)}
         else if ($tmp === $mod.TResultType.rtCurrency) {
          this.FValue.resValue = pas.SysUtils.StrToCurr(AValue) / 10000}
         else if ($tmp === $mod.TResultType.rtDateTime) {
          this.FValue.resValue = pas.SysUtils.StrToDateTime(AValue)}
         else if ($tmp === $mod.TResultType.rtString) this.FValue.resValue = AValue;
      } else {
        var $tmp1 = this.FValue.ResultType;
        if ($tmp1 === $mod.TResultType.rtBoolean) {
          this.FValue.resValue = false}
         else if ($tmp1 === $mod.TResultType.rtInteger) {
          this.FValue.resValue = 0}
         else if ($tmp1 === $mod.TResultType.rtFloat) {
          this.FValue.resValue = 0.0}
         else if ($tmp1 === $mod.TResultType.rtCurrency) {
          this.FValue.resValue = 0.0}
         else if ($tmp1 === $mod.TResultType.rtDateTime) {
          this.FValue.resValue = 0}
         else if ($tmp1 === $mod.TResultType.rtString) this.FValue.resValue = "";
      };
    };
    this.CheckResultType = function (AType) {
      if (this.FValue.ResultType !== AType) $impl.RaiseParserError$1(rtl.getResStr($mod,"SErrInvalidResultType"),pas.System.VarRecs(18,$mod.ResultTypeName(AType)));
    };
    this.CheckVariable = function () {
      if (this.FIDType !== $mod.TIdentifierType.itVariable) $impl.RaiseParserError$1(rtl.getResStr($mod,"SErrNotVariable"),pas.System.VarRecs(18,this.FName));
      if (this.EventBasedVariable()) this.FetchValue();
    };
    this.FetchValue = function () {
      var RT = 0;
      var RT2 = 0;
      var I = 0;
      RT = this.GetResultType();
      if (this.FOnGetVarValue != null) this.FValue.$assign(this.FOnGetVarValue(this.FName));
      RT2 = this.FValue.ResultType;
      if (RT2 !== RT) {
        if ((RT2 === $mod.TResultType.rtInteger) && (RT === $mod.TResultType.rtFloat)) {
          this.FValue.ResultType = RT;
          I = rtl.trunc(this.FValue.resValue);
          this.FValue.resValue = I;
        } else {
          this.FValue.ResultType = RT;
          throw $mod.EExprParser.$create("CreateFmt",['Value handler for variable %s returned wrong type, expected "%s", got "%s"',pas.System.VarRecs(18,this.FName,18,pas.TypInfo.GetEnumName($mod.$rtti["TResultType"],RT),18,pas.TypInfo.GetEnumName($mod.$rtti["TResultType"],RT2))]);
        };
      };
    };
    this.ArgumentCount = function () {
      var Result = 0;
      Result = this.FArgumentTypes.length;
      return Result;
    };
    this.Assign = function (Source) {
      var EID = null;
      if ($mod.TFPExprIdentifierDef.isPrototypeOf(Source)) {
        EID = rtl.as(Source,$mod.TFPExprIdentifierDef);
        this.FStringValue = EID.FStringValue;
        this.FValue.$assign(EID.FValue);
        this.FArgumentTypes = EID.FArgumentTypes;
        this.FIDType = EID.FIDType;
        this.FName = EID.FName;
        this.FOnGetValue = EID.FOnGetValue;
        this.FOnGetVarValue = EID.FOnGetVarValue;
      } else pas.Classes.TPersistent.Assign.call(this,Source);
    };
    this.EventBasedVariable = function () {
      var Result = false;
      Result = this.FOnGetVarValue != null;
      return Result;
    };
    var $r = this.$rtti;
    $r.addProperty("IdentifierType",0,$mod.$rtti["TIdentifierType"],"FIDType","FIDType");
    $r.addProperty("Name",2,rtl.string,"FName","SetName");
    $r.addProperty("Value",3,rtl.string,"GetValue","SetValue");
    $r.addProperty("ParameterTypes",2,rtl.string,"FArgumentTypes","SetArgumentTypes");
    $r.addProperty("ResultType",3,$mod.$rtti["TResultType"],"GetResultType","SetResultType");
    $r.addProperty("OnGetFunctionValue",0,$mod.$rtti["TFPExprFunctionEvent"],"FOnGetValue","FOnGetValue");
    $r.addProperty("OnGetVariableValue",0,$mod.$rtti["TFPExprVariableEvent"],"FOnGetVarValue","FOnGetVarValue");
    $r.addProperty("NodeType",0,$mod.$rtti["TFPExprFunctionClass"],"FNodeType","FNodeType");
  });
  this.TBuiltInCategory = {"0": "bcStrings", bcStrings: 0, "1": "bcDateTime", bcDateTime: 1, "2": "bcMath", bcMath: 2, "3": "bcBoolean", bcBoolean: 3, "4": "bcConversion", bcConversion: 4, "5": "bcData", bcData: 5, "6": "bcVaria", bcVaria: 6, "7": "bcUser", bcUser: 7, "8": "bcAggregate", bcAggregate: 8};
  this.$rtti.$Enum("TBuiltInCategory",{minvalue: 0, maxvalue: 8, ordtype: 1, enumtype: this.TBuiltInCategory});
  this.$rtti.$Set("TBuiltInCategories",{comptype: this.$rtti["TBuiltInCategory"]});
  rtl.createClass(this,"TFPBuiltInExprIdentifierDef",this.TFPExprIdentifierDef,function () {
    this.$init = function () {
      $mod.TFPExprIdentifierDef.$init.call(this);
      this.FCategory = 0;
    };
    this.Assign = function (Source) {
      $mod.TFPExprIdentifierDef.Assign.call(this,Source);
      if ($mod.TFPBuiltInExprIdentifierDef.isPrototypeOf(Source)) this.FCategory = rtl.as(Source,$mod.TFPBuiltInExprIdentifierDef).FCategory;
    };
    var $r = this.$rtti;
    $r.addProperty("Category",0,$mod.$rtti["TBuiltInCategory"],"FCategory","FCategory");
  });
  rtl.createClass(this,"TFPExprIdentifierDefs",pas.Classes.TCollection,function () {
    this.$init = function () {
      pas.Classes.TCollection.$init.call(this);
      this.FParser = null;
    };
    this.$final = function () {
      this.FParser = undefined;
      pas.Classes.TCollection.$final.call(this);
    };
    this.GetI = function (AIndex) {
      var Result = null;
      Result = this.GetItem(AIndex);
      return Result;
    };
    this.SetI = function (AIndex, AValue) {
      this.SetItem(AIndex,AValue);
    };
    this.Update = function (Item) {
      pas.Classes.TCollection.Update.call(this,Item);
      if (this.FParser != null) this.FParser.FDirty = true;
    };
    this.IndexOfIdentifier = function (AName) {
      var Result = 0;
      Result = this.GetCount() - 1;
      while ((Result >= 0) && (pas.SysUtils.CompareText(this.GetI(Result).FName,AName) !== 0)) Result -= 1;
      return Result;
    };
    this.FindIdentifier = function (AName) {
      var Result = null;
      var I = 0;
      I = this.IndexOfIdentifier(AName);
      if (I === -1) {
        Result = null}
       else Result = this.GetI(I);
      return Result;
    };
    this.IdentifierByName = function (AName) {
      var Result = null;
      Result = this.FindIdentifier(AName);
      if (Result === null) $impl.RaiseParserError$1(rtl.getResStr($mod,"SErrUnknownIdentifier"),pas.System.VarRecs(18,AName));
      return Result;
    };
    this.AddVariable = function (AName, AResultType, ACallback) {
      var Result = null;
      Result = rtl.as(this.Add(),$mod.TFPExprIdentifierDef);
      Result.FIDType = $mod.TIdentifierType.itVariable;
      Result.SetName(AName);
      Result.SetResultType(AResultType);
      Result.FOnGetVarValue = ACallback;
      return Result;
    };
    this.AddVariable$1 = function (AName, AResultType, AValue) {
      var Result = null;
      Result = rtl.as(this.Add(),$mod.TFPExprIdentifierDef);
      Result.FIDType = $mod.TIdentifierType.itVariable;
      Result.SetName(AName);
      Result.SetResultType(AResultType);
      Result.SetValue(AValue);
      return Result;
    };
    this.AddBooleanVariable = function (AName, AValue) {
      var Result = null;
      Result = rtl.as(this.Add(),$mod.TFPExprIdentifierDef);
      Result.FIDType = $mod.TIdentifierType.itVariable;
      Result.SetName(AName);
      Result.SetResultType($mod.TResultType.rtBoolean);
      Result.FValue.resValue = AValue;
      return Result;
    };
    this.AddIntegerVariable = function (AName, AValue) {
      var Result = null;
      Result = rtl.as(this.Add(),$mod.TFPExprIdentifierDef);
      Result.FIDType = $mod.TIdentifierType.itVariable;
      Result.SetName(AName);
      Result.SetResultType($mod.TResultType.rtInteger);
      Result.FValue.resValue = AValue;
      return Result;
    };
    this.AddFloatVariable = function (AName, AValue) {
      var Result = null;
      Result = rtl.as(this.Add(),$mod.TFPExprIdentifierDef);
      Result.FIDType = $mod.TIdentifierType.itVariable;
      Result.SetName(AName);
      Result.SetResultType($mod.TResultType.rtFloat);
      Result.FValue.resValue = AValue;
      return Result;
    };
    this.AddCurrencyVariable = function (AName, AValue) {
      var Result = null;
      Result = rtl.as(this.Add(),$mod.TFPExprIdentifierDef);
      Result.FIDType = $mod.TIdentifierType.itVariable;
      Result.SetName(AName);
      Result.SetResultType($mod.TResultType.rtCurrency);
      Result.FValue.resValue = AValue / 10000;
      return Result;
    };
    this.AddStringVariable = function (AName, AValue) {
      var Result = null;
      Result = rtl.as(this.Add(),$mod.TFPExprIdentifierDef);
      Result.FIDType = $mod.TIdentifierType.itVariable;
      Result.SetName(AName);
      Result.SetResultType($mod.TResultType.rtString);
      Result.FValue.resValue = AValue;
      return Result;
    };
    this.AddDateTimeVariable = function (AName, AValue) {
      var Result = null;
      Result = rtl.as(this.Add(),$mod.TFPExprIdentifierDef);
      Result.FIDType = $mod.TIdentifierType.itVariable;
      Result.SetName(AName);
      Result.SetResultType($mod.TResultType.rtDateTime);
      Result.FValue.resValue = AValue;
      return Result;
    };
    this.AddFunction = function (AName, AResultType, AParamTypes, ACallBack) {
      var Result = null;
      Result = rtl.as(this.Add(),$mod.TFPExprIdentifierDef);
      Result.SetName(AName);
      Result.FIDType = $mod.TIdentifierType.itFunctionHandler;
      Result.SetArgumentTypes(AParamTypes);
      Result.SetResultType($mod.CharToResultType(AResultType));
      Result.FOnGetValue = ACallBack;
      return Result;
    };
    this.AddFunction$1 = function (AName, AResultType, AParamTypes, ANodeClass) {
      var Result = null;
      Result = rtl.as(this.Add(),$mod.TFPExprIdentifierDef);
      Result.SetName(AName);
      Result.FIDType = $mod.TIdentifierType.itFunctionNode;
      Result.SetArgumentTypes(AParamTypes);
      Result.SetResultType($mod.CharToResultType(AResultType));
      Result.FNodeType = ANodeClass;
      return Result;
    };
  });
  rtl.createClass(this,"TFPExprIdentifierNode",this.TFPExprNode,function () {
    this.$init = function () {
      $mod.TFPExprNode.$init.call(this);
      this.FID = null;
      this.PResult = null;
      this.FResultType = 0;
    };
    this.$final = function () {
      this.FID = undefined;
      $mod.TFPExprNode.$final.call(this);
    };
    this.CreateIdentifier = function (AID) {
      pas.System.TObject.Create.call(this);
      this.FID = AID;
      this.PResult = this.FID.FValue;
      this.FResultType = this.FID.GetResultType();
      return this;
    };
    this.NodeType = function () {
      var Result = 0;
      Result = this.FResultType;
      return Result;
    };
    this.GetNodeValue = function () {
      var Result = $mod.TFPExpressionResult.$new();
      if (this.FID.EventBasedVariable()) {
        this.FID.FetchValue();
        this.PResult = this.FID.FValue;
      };
      Result.$assign(this.PResult);
      Result.ResultType = this.FResultType;
      return Result;
    };
  });
  rtl.createClass(this,"TFPExprVariable",this.TFPExprIdentifierNode,function () {
    this.Check = function () {
    };
    this.AsString = function () {
      var Result = "";
      Result = this.FID.FName;
      return Result;
    };
  });
  rtl.createClass(this,"TFPExprFunction",this.TFPExprIdentifierNode,function () {
    this.$init = function () {
      $mod.TFPExprIdentifierNode.$init.call(this);
      this.FArgumentNodes = [];
      this.FargumentParams = [];
    };
    this.$final = function () {
      this.FArgumentNodes = undefined;
      this.FargumentParams = undefined;
      $mod.TFPExprIdentifierNode.$final.call(this);
    };
    this.CalcParams = function () {
      var I = 0;
      for (var $l = 0, $end = rtl.length(this.FargumentParams) - 1; $l <= $end; $l++) {
        I = $l;
        this.FargumentParams[I].$assign(this.FArgumentNodes[I].GetNodeValue());
      };
    };
    this.ConvertArgument = function (aIndex, aNode, aType) {
      var Result = null;
      var N = null;
      N = $mod.TFPExpressionParser.ConvertNode(aNode,aType);
      if (aNode === N) $impl.RaiseParserError$1(rtl.getResStr($mod,"SErrInvalidArgumentType"),pas.System.VarRecs(0,aIndex,18,$mod.ResultTypeName(aType),18,$mod.ResultTypeName(aNode.NodeType())));
      Result = N;
      return Result;
    };
    this.Check = function () {
      var I = 0;
      var rtp = 0;
      var rta = 0;
      if (rtl.length(this.FArgumentNodes) !== this.FID.ArgumentCount()) $impl.RaiseParserError$1(rtl.getResStr($mod,"ErrInvalidArgumentCount"),pas.System.VarRecs(18,this.FID.FName));
      for (var $l = 0, $end = rtl.length(this.FArgumentNodes) - 1; $l <= $end; $l++) {
        I = $l;
        rtp = $mod.CharToResultType(this.FID.FArgumentTypes.charAt((I + 1) - 1));
        rta = this.FArgumentNodes[I].NodeType();
        if (rtp !== rta) this.FArgumentNodes[I] = this.ConvertArgument(I + 1,this.FArgumentNodes[I],rtp);
      };
    };
    this.CreateFunction = function (AID, Args) {
      $mod.TFPExprIdentifierNode.CreateIdentifier.call(this,AID);
      this.FArgumentNodes = rtl.arrayRef(Args);
      this.FargumentParams = rtl.arraySetLength(this.FargumentParams,$mod.TFPExpressionResult,rtl.length(Args));
      return this;
    };
    this.Destroy = function () {
      var I = 0;
      for (var $l = 0, $end = rtl.length(this.FArgumentNodes) - 1; $l <= $end; $l++) {
        I = $l;
        pas.SysUtils.FreeAndNil({a: I, p: this.FArgumentNodes, get: function () {
            return this.p[this.a];
          }, set: function (v) {
            this.p[this.a] = v;
          }});
      };
      pas.System.TObject.Destroy.call(this);
    };
    this.InitAggregate = function () {
      var I = 0;
      for (var $l = 0, $end = rtl.length(this.FArgumentNodes) - 1; $l <= $end; $l++) {
        I = $l;
        this.FArgumentNodes[I].InitAggregate();
      };
    };
    this.UpdateAggregate = function () {
      var I = 0;
      for (var $l = 0, $end = rtl.length(this.FArgumentNodes) - 1; $l <= $end; $l++) {
        I = $l;
        this.FArgumentNodes[I].UpdateAggregate();
      };
    };
    this.HasAggregate = function () {
      var Result = false;
      var I = 0;
      Result = true;
      if (this.$class.IsAggregate()) return Result;
      for (var $l = 0, $end = rtl.length(this.FArgumentNodes) - 1; $l <= $end; $l++) {
        I = $l;
        if (this.FArgumentNodes[I].HasAggregate()) return Result;
      };
      Result = false;
      return Result;
    };
    this.AsString = function () {
      var Result = "";
      var S = "";
      var I = 0;
      S = "";
      for (var $l = 0, $end = rtl.length(this.FArgumentNodes) - 1; $l <= $end; $l++) {
        I = $l;
        if (S !== "") S = S + ",";
        S = S + this.FArgumentNodes[I].AsString();
      };
      if (S !== "") S = "(" + S + ")";
      Result = this.FID.FName + S;
      return Result;
    };
  });
  rtl.createClass(this,"TAggregateExpr",this.TFPExprFunction,function () {
    this.$init = function () {
      $mod.TFPExprFunction.$init.call(this);
      this.FResult = $mod.TFPExpressionResult.$new();
    };
    this.$final = function () {
      this.FResult = undefined;
      $mod.TFPExprFunction.$final.call(this);
    };
    this.IsAggregate = function () {
      var Result = false;
      Result = true;
      return Result;
    };
    this.GetNodeValue = function () {
      var Result = $mod.TFPExpressionResult.$new();
      Result.$assign(this.FResult);
      return Result;
    };
  });
  rtl.createClass(this,"TAggregateMin",this.TAggregateExpr,function () {
    this.$init = function () {
      $mod.TAggregateExpr.$init.call(this);
      this.FFirst = false;
    };
    this.InitAggregate = function () {
      $mod.TFPExprFunction.InitAggregate.call(this);
      this.FFirst = true;
      this.FResult.ResultType = this.FArgumentNodes[0].NodeType();
      var $tmp = this.FResult.ResultType;
      if ($tmp === $mod.TResultType.rtFloat) {
        this.FResult.resValue = 0.0}
       else if ($tmp === $mod.TResultType.rtCurrency) {
        this.FResult.resValue = 0.0}
       else if ($tmp === $mod.TResultType.rtInteger) this.FResult.resValue = 0;
    };
    this.UpdateAggregate = function () {
      var OK = false;
      var N = $mod.TFPExpressionResult.$new();
      N.$assign(this.FArgumentNodes[0].GetNodeValue());
      if (this.FFirst) {
        this.FFirst = false;
        OK = true;
      } else {
        var $tmp = N.ResultType;
        if ($tmp === $mod.TResultType.rtFloat) {
          OK = rtl.getNumber(N.resValue) < rtl.getNumber(this.FResult.resValue)}
         else if ($tmp === $mod.TResultType.rtCurrency) {
          OK = rtl.trunc(N.resValue * 10000) < rtl.trunc(this.FResult.resValue * 10000)}
         else if ($tmp === $mod.TResultType.rtInteger) OK = rtl.trunc(N.resValue) < rtl.trunc(this.FResult.resValue);
      };
      if (OK) {
        var $tmp1 = this.FResult.ResultType;
        if ($tmp1 === $mod.TResultType.rtFloat) {
          this.FResult.resValue = N.resValue}
         else if ($tmp1 === $mod.TResultType.rtCurrency) {
          this.FResult.resValue = N.resValue}
         else if ($tmp1 === $mod.TResultType.rtInteger) this.FResult.resValue = N.resValue;
      };
      $mod.TFPExprFunction.UpdateAggregate.call(this);
    };
  });
  rtl.createClass(this,"TAggregateMax",this.TAggregateExpr,function () {
    this.$init = function () {
      $mod.TAggregateExpr.$init.call(this);
      this.FFirst = false;
    };
    this.InitAggregate = function () {
      $mod.TFPExprFunction.InitAggregate.call(this);
      this.FFirst = true;
      this.FResult.ResultType = this.FArgumentNodes[0].NodeType();
      var $tmp = this.FResult.ResultType;
      if ($tmp === $mod.TResultType.rtFloat) {
        this.FResult.resValue = 0.0}
       else if ($tmp === $mod.TResultType.rtCurrency) {
        this.FResult.resValue = 0.0}
       else if ($tmp === $mod.TResultType.rtInteger) this.FResult.resValue = 0;
    };
    this.UpdateAggregate = function () {
      var OK = false;
      var N = $mod.TFPExpressionResult.$new();
      N.$assign(this.FArgumentNodes[0].GetNodeValue());
      if (this.FFirst) {
        this.FResult.ResultType = N.ResultType;
        this.FFirst = false;
        OK = true;
      } else {
        var $tmp = N.ResultType;
        if ($tmp === $mod.TResultType.rtFloat) {
          OK = rtl.getNumber(N.resValue) > rtl.getNumber(this.FResult.resValue)}
         else if ($tmp === $mod.TResultType.rtCurrency) {
          OK = rtl.trunc(N.resValue * 10000) > rtl.trunc(this.FResult.resValue * 10000)}
         else if ($tmp === $mod.TResultType.rtInteger) OK = rtl.trunc(N.resValue) > rtl.trunc(this.FResult.resValue);
      };
      if (OK) {
        var $tmp1 = N.ResultType;
        if ($tmp1 === $mod.TResultType.rtFloat) {
          this.FResult.resValue = N.resValue}
         else if ($tmp1 === $mod.TResultType.rtInteger) {
          this.FResult.resValue = N.resValue}
         else if ($tmp1 === $mod.TResultType.rtCurrency) this.FResult.resValue = N.resValue;
      };
    };
  });
  rtl.createClass(this,"TAggregateSum",this.TAggregateExpr,function () {
    this.ConvertArgument = function (aIndex, aNode, aType) {
      var Result = null;
      if (!(aNode.NodeType() in rtl.createSet($mod.TResultType.rtFloat,$mod.TResultType.rtInteger,$mod.TResultType.rtCurrency))) $impl.RaiseParserError$1(rtl.getResStr($mod,"SErrInvalidArgumentType"),pas.System.VarRecs(0,aIndex,18,$mod.ResultTypeName(aType),18,$mod.ResultTypeName(aNode.NodeType())));
      Result = aNode;
      return Result;
    };
    this.InitAggregate = function () {
      this.FResult.ResultType = this.FArgumentNodes[0].NodeType();
      var $tmp = this.FResult.ResultType;
      if ($tmp === $mod.TResultType.rtFloat) {
        this.FResult.resValue = 0.0}
       else if ($tmp === $mod.TResultType.rtCurrency) {
        this.FResult.resValue = 0.0}
       else if ($tmp === $mod.TResultType.rtInteger) this.FResult.resValue = 0;
    };
    this.UpdateAggregate = function () {
      var R = $mod.TFPExpressionResult.$new();
      R.$assign(this.FArgumentNodes[0].GetNodeValue());
      var $tmp = this.FResult.ResultType;
      if ($tmp === $mod.TResultType.rtFloat) {
        this.FResult.resValue = rtl.getNumber(this.FResult.resValue) + rtl.getNumber(R.resValue)}
       else if ($tmp === $mod.TResultType.rtCurrency) {
        this.FResult.resValue = (rtl.trunc(this.FResult.resValue * 10000) + rtl.trunc(R.resValue * 10000)) / 10000}
       else if ($tmp === $mod.TResultType.rtInteger) this.FResult.resValue = rtl.trunc(this.FResult.resValue) + rtl.trunc(R.resValue);
    };
  });
  rtl.createClass(this,"TAggregateAvg",this.TAggregateSum,function () {
    this.$init = function () {
      $mod.TAggregateSum.$init.call(this);
      this.FCount = 0;
    };
    this.InitAggregate = function () {
      $mod.TAggregateSum.InitAggregate.call(this);
    };
    this.UpdateAggregate = function () {
      $mod.TAggregateSum.UpdateAggregate.call(this);
      this.FCount += 1;
    };
    this.GetNodeValue = function () {
      var Result = $mod.TFPExpressionResult.$new();
      Result.$assign($mod.TAggregateExpr.GetNodeValue.call(this));
      Result.ResultType = this.FResult.ResultType;
      if (this.FCount === 0) {
        var $tmp = this.FResult.ResultType;
        if ($tmp === $mod.TResultType.rtInteger) {
          Result.ResultType = $mod.TResultType.rtFloat;
          Result.resValue = 0.0;
        } else if ($tmp === $mod.TResultType.rtFloat) {
          Result.resValue = 0.0}
         else if ($tmp === $mod.TResultType.rtCurrency) Result.resValue = 0.0;
      } else {
        var $tmp1 = this.FResult.ResultType;
        if ($tmp1 === $mod.TResultType.rtInteger) {
          Result.ResultType = $mod.TResultType.rtFloat;
          Result.resValue = rtl.trunc(this.FResult.resValue) / this.FCount;
        } else if ($tmp1 === $mod.TResultType.rtFloat) {
          Result.resValue = rtl.getNumber(this.FResult.resValue) / this.FCount}
         else if ($tmp1 === $mod.TResultType.rtCurrency) Result.resValue = rtl.trunc(rtl.trunc(this.FResult.resValue * 10000) / this.FCount) / 10000;
      };
      return Result;
    };
  });
  rtl.createClass(this,"TAggregateCount",this.TAggregateExpr,function () {
    this.InitAggregate = function () {
      this.FResult.ResultType = $mod.TResultType.rtInteger;
      this.FResult.resValue = 0;
    };
    this.UpdateAggregate = function () {
      this.FResult.resValue = rtl.trunc(this.FResult.resValue) + 1;
    };
  });
  rtl.createClass(this,"TFPFunctionEventHandler",this.TFPExprFunction,function () {
    this.$init = function () {
      $mod.TFPExprFunction.$init.call(this);
      this.FCallBack = null;
    };
    this.$final = function () {
      this.FCallBack = undefined;
      $mod.TFPExprFunction.$final.call(this);
    };
    this.CreateFunction = function (AID, Args) {
      $mod.TFPExprFunction.CreateFunction.apply(this,arguments);
      this.FCallBack = AID.FOnGetValue;
      return this;
    };
    this.GetNodeValue = function () {
      var Result = $mod.TFPExpressionResult.$new();
      if (rtl.length(this.FargumentParams) > 0) this.CalcParams();
      Result.$assign(this.FCallBack(this.FargumentParams));
      Result.ResultType = this.NodeType();
      return Result;
    };
  });
  rtl.createClass(this,"TFPExpressionParser",pas.Classes.TComponent,function () {
    this.$init = function () {
      pas.Classes.TComponent.$init.call(this);
      this.FBuiltIns = {};
      this.FExpression = "";
      this.FScanner = null;
      this.FExprNode = null;
      this.FIdentifiers = null;
      this.FHashList = null;
      this.FDirty = false;
    };
    this.$final = function () {
      this.FBuiltIns = undefined;
      this.FScanner = undefined;
      this.FExprNode = undefined;
      this.FIdentifiers = undefined;
      this.FHashList = undefined;
      pas.Classes.TComponent.$final.call(this);
    };
    this.CheckEOF = function () {
      if (this.TokenType() === $mod.TTokenType.ttEOF) this.ParserError(rtl.getResStr($mod,"SErrUnexpectedEndOfExpression"));
    };
    this.GetAsBoolean = function () {
      var Result = false;
      var Res = $mod.TFPExpressionResult.$new();
      this.EvaluateExpression(Res);
      this.CheckResultType(Res,$mod.TResultType.rtBoolean);
      Result = !(Res.resValue == false);
      return Result;
    };
    this.GetAsDateTime = function () {
      var Result = 0.0;
      var Res = $mod.TFPExpressionResult.$new();
      this.EvaluateExpression(Res);
      this.CheckResultType(Res,$mod.TResultType.rtDateTime);
      Result = rtl.getNumber(Res.resValue);
      return Result;
    };
    this.GetAsFloat = function () {
      var Result = 0.0;
      var Res = $mod.TFPExpressionResult.$new();
      this.EvaluateExpression(Res);
      this.CheckResultTypes(Res,rtl.createSet($mod.TResultType.rtFloat,$mod.TResultType.rtCurrency,$mod.TResultType.rtInteger));
      var $tmp = Res.ResultType;
      if ($tmp === $mod.TResultType.rtInteger) {
        Result = rtl.trunc(Res.resValue)}
       else if ($tmp === $mod.TResultType.rtFloat) {
        Result = rtl.getNumber(Res.resValue)}
       else if ($tmp === $mod.TResultType.rtCurrency) Result = rtl.trunc(Res.resValue * 10000) / 10000;
      return Result;
    };
    this.GetAsCurrency = function () {
      var Result = 0;
      var Res = $mod.TFPExpressionResult.$new();
      this.EvaluateExpression(Res);
      this.CheckResultTypes(Res,rtl.createSet($mod.TResultType.rtFloat,$mod.TResultType.rtCurrency,$mod.TResultType.rtInteger));
      var $tmp = Res.ResultType;
      if ($tmp === $mod.TResultType.rtInteger) {
        Result = rtl.trunc(Res.resValue) * 10000}
       else if ($tmp === $mod.TResultType.rtFloat) {
        Result = rtl.trunc(rtl.getNumber(Res.resValue) * 10000)}
       else if ($tmp === $mod.TResultType.rtCurrency) Result = rtl.trunc(Res.resValue * 10000);
      return Result;
    };
    this.GetAsInteger = function () {
      var Result = 0;
      var Res = $mod.TFPExpressionResult.$new();
      this.EvaluateExpression(Res);
      this.CheckResultType(Res,$mod.TResultType.rtInteger);
      Result = rtl.trunc(Res.resValue);
      return Result;
    };
    this.GetAsString = function () {
      var Result = "";
      var Res = $mod.TFPExpressionResult.$new();
      this.EvaluateExpression(Res);
      this.CheckResultType(Res,$mod.TResultType.rtString);
      Result = "" + Res.resValue;
      return Result;
    };
    this.GetAllowLike = function () {
      var Result = false;
      Result = this.FScanner.FAllowLike;
      return Result;
    };
    this.MatchNodes = function (Todo, Match) {
      var Result = null;
      var FromType = 0;
      var ToType = 0;
      Result = Todo;
      FromType = Todo.NodeType();
      ToType = Match.NodeType();
      if (FromType !== ToType) {
        var $tmp = FromType;
        if ($tmp === $mod.TResultType.rtInteger) {
          if (ToType in rtl.createSet($mod.TResultType.rtFloat,$mod.TResultType.rtCurrency,$mod.TResultType.rtDateTime)) Result = this.$class.ConvertNode(Todo,ToType)}
         else if ($tmp === $mod.TResultType.rtFloat) {
          if (ToType in rtl.createSet($mod.TResultType.rtCurrency,$mod.TResultType.rtDateTime)) Result = this.$class.ConvertNode(Todo,ToType)}
         else if ($tmp === $mod.TResultType.rtCurrency) if (ToType in rtl.createSet($mod.TResultType.rtFloat,$mod.TResultType.rtDateTime)) Result = this.$class.ConvertNode(Todo,ToType);
      };
      return Result;
    };
    this.CheckNodes = function (Left, Right) {
      Left.set(this.MatchNodes(Left.get(),Right.get()));
      Right.set(this.MatchNodes(Right.get(),Left.get()));
    };
    this.SetBuiltIns = function (AValue) {
      if (rtl.eqSet(this.FBuiltIns,AValue)) return;
      this.FBuiltIns = rtl.refSet(AValue);
      this.FDirty = true;
    };
    this.SetIdentifiers = function (AValue) {
      this.FIdentifiers.Assign(AValue);
    };
    this.SetAllowLike = function (AValue) {
      this.FScanner.FAllowLike = AValue;
    };
    this.ParserError = function (Msg) {
      throw $mod.EExprParser.$create("Create$1",[Msg]);
    };
    this.SetExpression = function (AValue) {
      if (this.FExpression === AValue) return;
      this.FExpression = AValue;
      this.FScanner.SetSource(AValue);
      if (this.FExprNode != null) pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FExprNode;
        }, set: function (v) {
          this.p.FExprNode = v;
        }});
      if (this.FExpression !== "") {
        this.GetToken();
        this.FExprNode = this.Level1();
        if (this.TokenType() !== $mod.TTokenType.ttEOF) this.ParserError(pas.SysUtils.Format(rtl.getResStr($mod,"SErrUnterminatedExpression"),pas.System.VarRecs(0,this.FScanner.FPos,18,this.CurrentToken())));
        this.FExprNode.Check();
      } else this.FExprNode = null;
    };
    this.CheckResultType = function (Res, AType) {
      if (Res.ResultType !== AType) $impl.RaiseParserError$1(rtl.getResStr($mod,"SErrInvalidResultType"),pas.System.VarRecs(18,$mod.ResultTypeName(Res.ResultType)));
    };
    this.CheckResultTypes = function (Res, ATypes) {
      if (!(Res.ResultType in ATypes)) $impl.RaiseParserError$1(rtl.getResStr($mod,"SErrInvalidResultType"),pas.System.VarRecs(18,$mod.ResultTypeName(Res.ResultType)));
    };
    this.ConvertNode = function (Todo, ToType) {
      var Result = null;
      Result = Todo;
      var $tmp = Todo.NodeType();
      if ($tmp === $mod.TResultType.rtInteger) {
        var $tmp1 = ToType;
        if ($tmp1 === $mod.TResultType.rtFloat) {
          Result = $mod.TIntToFloatNode.$create("Create$1",[Result])}
         else if ($tmp1 === $mod.TResultType.rtCurrency) {
          Result = $mod.TIntToCurrencyNode.$create("Create$1",[Result])}
         else if ($tmp1 === $mod.TResultType.rtDateTime) Result = $mod.TIntToDateTimeNode.$create("Create$1",[Result]);
      } else if ($tmp === $mod.TResultType.rtFloat) {
        var $tmp2 = ToType;
        if ($tmp2 === $mod.TResultType.rtCurrency) {
          Result = $mod.TFloatToCurrencyNode.$create("Create$1",[Result])}
         else if ($tmp2 === $mod.TResultType.rtDateTime) Result = $mod.TFloatToDateTimeNode.$create("Create$1",[Result]);
      } else if ($tmp === $mod.TResultType.rtCurrency) {
        var $tmp3 = ToType;
        if ($tmp3 === $mod.TResultType.rtFloat) {
          Result = $mod.TCurrencyToFloatNode.$create("Create$1",[Result])}
         else if ($tmp3 === $mod.TResultType.rtDateTime) Result = $mod.TCurrencyToDateTimeNode.$create("Create$1",[Result]);
      };
      return Result;
    };
    this.BuiltinsManager = function () {
      var Result = null;
      Result = $mod.BuiltinIdentifiers();
      return Result;
    };
    this.Level1 = function () {
      var Result = null;
      var tt = 0;
      var Right = null;
      if (this.TokenType() === $mod.TTokenType.ttNot) {
        this.GetToken();
        this.CheckEOF();
        Right = this.Level2();
        Result = $mod.TFPNotNode.$create("Create$1",[Right]);
      } else Result = this.Level2();
      try {
        while (this.TokenType() in rtl.createSet($mod.TTokenType.ttAnd,$mod.TTokenType.ttOr,$mod.TTokenType.ttXor)) {
          tt = this.TokenType();
          this.GetToken();
          this.CheckEOF();
          Right = this.Level2();
          var $tmp = tt;
          if ($tmp === $mod.TTokenType.ttOr) {
            Result = $mod.TFPBinaryOrOperation.$create("Create$1",[Result,Right])}
           else if ($tmp === $mod.TTokenType.ttAnd) {
            Result = $mod.TFPBinaryAndOperation.$create("Create$1",[Result,Right])}
           else if ($tmp === $mod.TTokenType.ttXor) {
            Result = $mod.TFPBinaryXOrOperation.$create("Create$1",[Result,Right])}
           else {
            this.ParserError(rtl.getResStr($mod,"SErrUnknownBooleanOp"));
          };
        };
      } catch ($e) {
        Result = rtl.freeLoc(Result);
        throw $e;
      };
      return Result;
    };
    this.Level2 = function () {
      var Result = null;
      var Right = null;
      var tt = 0;
      var C = null;
      Result = this.Level3();
      try {
        if (this.TokenType() in $mod.ttComparisons) {
          tt = this.TokenType();
          this.GetToken();
          this.CheckEOF();
          Right = this.Level3();
          this.CheckNodes({get: function () {
              return Result;
            }, set: function (v) {
              Result = v;
            }},{get: function () {
              return Right;
            }, set: function (v) {
              Right = v;
            }});
          var $tmp = tt;
          if ($tmp === $mod.TTokenType.ttLessThan) {
            C = $mod.TFPLessThanOperation}
           else if ($tmp === $mod.TTokenType.ttLessThanEqual) {
            C = $mod.TFPLessThanEqualOperation}
           else if ($tmp === $mod.TTokenType.ttLargerThan) {
            C = $mod.TFPGreaterThanOperation}
           else if ($tmp === $mod.TTokenType.ttLargerThanEqual) {
            C = $mod.TFPGreaterThanEqualOperation}
           else if ($tmp === $mod.TTokenType.ttEqual) {
            C = $mod.TFPEqualOperation}
           else if ($tmp === $mod.TTokenType.ttunequal) {
            C = $mod.TFPUnequalOperation}
           else if ($tmp === $mod.TTokenType.ttLike) {
            C = $mod.TFPLikeOperation}
           else {
            this.ParserError(rtl.getResStr($mod,"SErrUnknownComparison"));
          };
          Result = C.$create("Create$1",[Result,Right]);
        };
      } catch ($e) {
        Result = rtl.freeLoc(Result);
        throw $e;
      };
      return Result;
    };
    this.Level3 = function () {
      var Result = null;
      var tt = 0;
      var right = null;
      Result = this.Level4();
      try {
        while (this.TokenType() in rtl.createSet($mod.TTokenType.ttPlus,$mod.TTokenType.ttMinus)) {
          tt = this.TokenType();
          this.GetToken();
          this.CheckEOF();
          right = this.Level4();
          this.CheckNodes({get: function () {
              return Result;
            }, set: function (v) {
              Result = v;
            }},{get: function () {
              return right;
            }, set: function (v) {
              right = v;
            }});
          var $tmp = tt;
          if ($tmp === $mod.TTokenType.ttPlus) {
            Result = $mod.TFPAddOperation.$create("Create$1",[Result,right])}
           else if ($tmp === $mod.TTokenType.ttMinus) Result = $mod.TFPSubtractOperation.$create("Create$1",[Result,right]);
        };
      } catch ($e) {
        Result = rtl.freeLoc(Result);
        throw $e;
      };
      return Result;
    };
    this.Level4 = function () {
      var Result = null;
      var tt = 0;
      var right = null;
      Result = this.Level5();
      try {
        while (this.TokenType() in rtl.createSet($mod.TTokenType.ttMul,$mod.TTokenType.ttDiv,$mod.TTokenType.ttMod)) {
          tt = this.TokenType();
          this.GetToken();
          right = this.Level5();
          this.CheckNodes({get: function () {
              return Result;
            }, set: function (v) {
              Result = v;
            }},{get: function () {
              return right;
            }, set: function (v) {
              right = v;
            }});
          var $tmp = tt;
          if ($tmp === $mod.TTokenType.ttMul) {
            Result = $mod.TFPMultiplyOperation.$create("Create$1",[Result,right])}
           else if ($tmp === $mod.TTokenType.ttDiv) {
            Result = $mod.TFPDivideOperation.$create("Create$1",[Result,right])}
           else if ($tmp === $mod.TTokenType.ttMod) Result = $mod.TFPModuloOperation.$create("Create$1",[Result,right]);
        };
      } catch ($e) {
        Result = rtl.freeLoc(Result);
        throw $e;
      };
      return Result;
    };
    this.Level5 = function () {
      var Result = null;
      var B = false;
      B = false;
      if (this.TokenType() in rtl.createSet($mod.TTokenType.ttPlus,$mod.TTokenType.ttMinus)) {
        B = this.TokenType() === $mod.TTokenType.ttMinus;
        this.GetToken();
      };
      Result = this.Level6();
      if (B) Result = $mod.TFPNegateOperation.$create("Create$1",[Result]);
      return Result;
    };
    this.Level6 = function () {
      var Result = null;
      var right = null;
      Result = this.Level7();
      try {
        while (this.TokenType() === $mod.TTokenType.ttPower) {
          this.GetToken();
          right = this.Level5();
          this.CheckNodes({get: function () {
              return Result;
            }, set: function (v) {
              Result = v;
            }},{get: function () {
              return right;
            }, set: function (v) {
              right = v;
            }});
          Result = $mod.TFPPowerOperation.$create("Create$1",[Result,right]);
        };
      } catch ($e) {
        Result = rtl.freeLoc(Result);
        throw $e;
      };
      return Result;
    };
    this.Level7 = function () {
      var Result = null;
      if (this.TokenType() === $mod.TTokenType.ttLeft) {
        this.GetToken();
        Result = this.Level1();
        try {
          if (this.TokenType() !== $mod.TTokenType.ttRight) this.ParserError(pas.SysUtils.Format(rtl.getResStr($mod,"SErrBracketExpected"),pas.System.VarRecs(0,this.FScanner.FPos,18,this.CurrentToken())));
          this.GetToken();
        } catch ($e) {
          Result = rtl.freeLoc(Result);
          throw $e;
        };
      } else Result = this.Primitive();
      return Result;
    };
    this.Primitive = function () {
      var Result = null;
      var I = 0;
      var C = 0;
      var X = 0.0;
      var ACount = 0;
      var IFF = false;
      var IFC = false;
      var ID = null;
      var Args = [];
      var AI = 0;
      Args = rtl.arraySetLength(Args,null,0);
      if (this.TokenType() === $mod.TTokenType.ttNumber) {
        if (pas.SysUtils.TryStrToInt64(this.CurrentToken(),{get: function () {
            return I;
          }, set: function (v) {
            I = v;
          }})) {
          Result = $mod.TFPConstExpression.$create("CreateInteger",[I])}
         else {
          pas.System.val$8(this.CurrentToken(),{get: function () {
              return X;
            }, set: function (v) {
              X = v;
            }},{get: function () {
              return C;
            }, set: function (v) {
              C = v;
            }});
          if (C === 0) {
            Result = $mod.TFPConstExpression.$create("CreateFloat",[X])}
           else this.ParserError(pas.SysUtils.Format(rtl.getResStr($mod,"SErrInvalidFloat"),pas.System.VarRecs(18,this.CurrentToken())));
        };
      } else if (this.TokenType() === $mod.TTokenType.ttString) {
        Result = $mod.TFPConstExpression.$create("CreateString",[this.CurrentToken()])}
       else if (this.TokenType() in rtl.createSet($mod.TTokenType.ttTrue,$mod.TTokenType.ttFalse)) {
        Result = $mod.TFPConstExpression.$create("CreateBoolean",[this.TokenType() === $mod.TTokenType.ttTrue])}
       else if (!(this.TokenType() in rtl.createSet($mod.TTokenType.ttIdentifier,$mod.TTokenType.ttif,$mod.TTokenType.ttCase))) {
        this.ParserError(pas.SysUtils.Format(rtl.getResStr($mod,"SerrUnknownTokenAtPos"),pas.System.VarRecs(0,this.FScanner.FPos,18,this.CurrentToken())))}
       else {
        IFF = this.TokenType() === $mod.TTokenType.ttif;
        IFC = this.TokenType() === $mod.TTokenType.ttCase;
        if (!(IFF || IFC)) {
          ID = this.IdentifierByName(this.CurrentToken());
          if (ID === null) this.ParserError(pas.SysUtils.Format(rtl.getResStr($mod,"SErrUnknownIdentifier"),pas.System.VarRecs(18,this.CurrentToken())));
        };
        if (IFF) {
          ACount = 3}
         else if (IFC) {
          ACount = -4}
         else if (ID.FIDType in rtl.createSet($mod.TIdentifierType.itFunctionHandler,$mod.TIdentifierType.itFunctionNode)) {
          ACount = ID.ArgumentCount()}
         else ACount = 0;
        if (ACount !== 0) {
          this.GetToken();
          if (this.TokenType() !== $mod.TTokenType.ttLeft) this.ParserError(pas.SysUtils.Format(rtl.getResStr($mod,"SErrLeftBracketExpected"),pas.System.VarRecs(0,this.FScanner.FPos,18,this.CurrentToken())));
          Args = rtl.arraySetLength(Args,null,Math.abs(ACount));
          AI = 0;
          try {
            do {
              this.GetToken();
              if ((ACount < 0) && (AI === rtl.length(Args))) {
                Args = rtl.arraySetLength(Args,null,AI + 1);
                Args[AI] = null;
              };
              Args[AI] = this.Level1();
              AI += 1;
              if (this.TokenType() !== $mod.TTokenType.ttComma) if (AI < Math.abs(ACount)) this.ParserError(pas.SysUtils.Format(rtl.getResStr($mod,"SErrCommaExpected"),pas.System.VarRecs(0,this.FScanner.FPos,18,this.CurrentToken())));
            } while (!((AI === ACount) || ((ACount < 0) && (this.TokenType() === $mod.TTokenType.ttRight))));
            if (this.TokenType() !== $mod.TTokenType.ttRight) this.ParserError(pas.SysUtils.Format(rtl.getResStr($mod,"SErrBracketExpected"),pas.System.VarRecs(0,this.FScanner.FPos,18,this.CurrentToken())));
          } catch ($e) {
            if (pas.SysUtils.Exception.isPrototypeOf($e)) {
              var E = $e;
              AI -= 1;
              while (AI >= 0) {
                pas.SysUtils.FreeAndNil({a: AI, p: Args, get: function () {
                    return this.p[this.a];
                  }, set: function (v) {
                    this.p[this.a] = v;
                  }});
                AI -= 1;
              };
              throw $e;
            } else throw $e
          };
        };
        if (IFF) {
          Result = $mod.TIfOperation.$create("Create$2",[Args[0],Args[1],Args[2]])}
         else if (IFC) {
          Result = $mod.TCaseOperation.$create("Create$1",[rtl.arrayRef(Args)])}
         else {
          var $tmp = ID.FIDType;
          if ($tmp === $mod.TIdentifierType.itVariable) {
            Result = $mod.TFPExprVariable.$create("CreateIdentifier",[ID])}
           else if ($tmp === $mod.TIdentifierType.itFunctionHandler) {
            Result = $mod.TFPFunctionEventHandler.$create("CreateFunction",[ID,Args])}
           else if ($tmp === $mod.TIdentifierType.itFunctionNode) Result = ID.FNodeType.$create("CreateFunction",[ID,Args]);
        };
      };
      this.GetToken();
      return Result;
    };
    this.GetToken = function () {
      var Result = 0;
      Result = this.FScanner.GetToken();
      return Result;
    };
    this.TokenType = function () {
      var Result = 0;
      Result = this.FScanner.FTokenType;
      return Result;
    };
    this.CurrentToken = function () {
      var Result = "";
      Result = this.FScanner.FToken;
      return Result;
    };
    this.CreateHashList = function () {
      var ID = null;
      var BID = null;
      var I = 0;
      var M = null;
      this.FHashList.Clear();
      M = this.$class.BuiltinsManager();
      if (rtl.neSet(this.FBuiltIns,{}) && (M != null)) for (var $l = 0, $end = M.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        BID = M.GetI(I);
        if (BID.FCategory in this.FBuiltIns) this.FHashList.Add(pas.SysUtils.LowerCase(BID.FName),BID);
      };
      for (var $l1 = 0, $end1 = this.FIdentifiers.GetCount() - 1; $l1 <= $end1; $l1++) {
        I = $l1;
        ID = this.FIdentifiers.GetI(I);
        this.FHashList.Add(pas.SysUtils.LowerCase(ID.FName),ID);
      };
      this.FDirty = false;
    };
    this.Create$1 = function (AOwner) {
      pas.Classes.TComponent.Create$1.call(this,AOwner);
      this.FIdentifiers = $mod.TFPExprIdentifierDefs.$create("Create$1",[$mod.TFPExprIdentifierDef]);
      this.FIdentifiers.FParser = this;
      this.FScanner = $mod.TFPExpressionScanner.$create("Create$1");
      this.FHashList = pas.contnrs.TFPObjectHashTable.$create("Create$2",[false]);
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FHashList;
        }, set: function (v) {
          this.p.FHashList = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FExprNode;
        }, set: function (v) {
          this.p.FExprNode = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FIdentifiers;
        }, set: function (v) {
          this.p.FIdentifiers = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FScanner;
        }, set: function (v) {
          this.p.FScanner = v;
        }});
      pas.Classes.TComponent.Destroy.call(this);
    };
    this.IdentifierByName = function (AName) {
      var Result = null;
      var s = "";
      if (this.FDirty) this.CreateHashList();
      s = AName;
      if (s.length > 2) {
        if ((s.charAt(0) === "[") && (s.charAt(s.length - 1) === "]")) {
          pas.System.Delete({get: function () {
              return s;
            }, set: function (v) {
              s = v;
            }},1,1);
          pas.System.Delete({get: function () {
              return s;
            }, set: function (v) {
              s = v;
            }},s.length,1);
        };
      };
      Result = this.FHashList.GetData(pas.SysUtils.LowerCase(s));
      return Result;
    };
    this.Clear = function () {
      this.FExpression = "";
      this.FHashList.Clear();
      rtl.free(this,"FExprNode");
    };
    this.Evaluate = function (aExpression) {
      var Result = $mod.TFPExpressionResult.$new();
      var F = null;
      F = $mod.TFPExpressionParser.$create("Create$1",[null]);
      try {
        F.SetExpression(aExpression);
        Result.$assign(F.Evaluate$1());
      } finally {
        F = rtl.freeLoc(F);
      };
      return Result;
    };
    this.EvaluateExpression = function (Result) {
      Result.$assign(this.Evaluate$1());
    };
    this.ExtractNode = function (N) {
      var Result = false;
      Result = this.FExprNode != null;
      if (Result) {
        N.set(this.FExprNode);
        this.FExprNode = null;
        this.FExpression = "";
      };
      return Result;
    };
    this.Evaluate$1 = function () {
      var Result = $mod.TFPExpressionResult.$new();
      if (this.FExpression === "") this.ParserError(rtl.getResStr($mod,"SErrInExpressionEmpty"));
      if (!(this.FExprNode != null)) this.ParserError(rtl.getResStr($mod,"SErrInExpression"));
      Result.$assign(this.FExprNode.GetNodeValue());
      return Result;
    };
    this.ResultType = function () {
      var Result = 0;
      if (!(this.FExprNode != null)) this.ParserError(rtl.getResStr($mod,"SErrInExpression"));
      Result = this.FExprNode.NodeType();
      return Result;
    };
    this.HasAggregate = function () {
      var Result = false;
      Result = (this.FExprNode != null) && this.FExprNode.HasAggregate();
      return Result;
    };
    this.InitAggregate = function () {
      if (this.FExprNode != null) this.FExprNode.InitAggregate();
    };
    this.UpdateAggregate = function () {
      if (this.FExprNode != null) this.FExprNode.UpdateAggregate();
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Expression",2,rtl.string,"FExpression","SetExpression");
    $r.addProperty("Identifiers",2,$mod.$rtti["TFPExprIdentifierDefs"],"FIdentifiers","SetIdentifiers");
    $r.addProperty("BuiltIns",2,$mod.$rtti["TBuiltInCategories"],"FBuiltIns","SetBuiltIns");
  });
  this.$rtti.$ClassRef("TFPExpressionParserClass",{instancetype: this.$rtti["TFPExpressionParser"]});
  rtl.createClass(this,"TExprBuiltInManager",pas.Classes.TComponent,function () {
    this.$init = function () {
      pas.Classes.TComponent.$init.call(this);
      this.FDefs = null;
    };
    this.$final = function () {
      this.FDefs = undefined;
      pas.Classes.TComponent.$final.call(this);
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FDefs.GetCount();
      return Result;
    };
    this.GetI = function (AIndex) {
      var Result = null;
      Result = this.FDefs.GetI(AIndex);
      return Result;
    };
    this.Create$1 = function (AOwner) {
      pas.Classes.TComponent.Create$1.call(this,AOwner);
      this.FDefs = $mod.TFPExprIdentifierDefs.$create("Create$1",[$mod.TFPBuiltInExprIdentifierDef]);
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FDefs;
        }, set: function (v) {
          this.p.FDefs = v;
        }});
      pas.Classes.TComponent.Destroy.call(this);
    };
    this.IndexOfIdentifier = function (AName) {
      var Result = 0;
      Result = this.FDefs.IndexOfIdentifier(AName);
      return Result;
    };
    this.FindIdentifier = function (AName) {
      var Result = null;
      Result = this.FDefs.FindIdentifier(AName);
      return Result;
    };
    this.IdentifierByName = function (AName) {
      var Result = null;
      Result = this.FDefs.IdentifierByName(AName);
      return Result;
    };
    this.AddVariable = function (ACategory, AName, AResultType, AValue) {
      var Result = null;
      Result = this.FDefs.AddVariable$1(AName,AResultType,AValue);
      Result.FCategory = ACategory;
      return Result;
    };
    this.AddBooleanVariable = function (ACategory, AName, AValue) {
      var Result = null;
      Result = this.FDefs.AddBooleanVariable(AName,AValue);
      Result.FCategory = ACategory;
      return Result;
    };
    this.AddIntegerVariable = function (ACategory, AName, AValue) {
      var Result = null;
      Result = this.FDefs.AddIntegerVariable(AName,AValue);
      Result.FCategory = ACategory;
      return Result;
    };
    this.AddFloatVariable = function (ACategory, AName, AValue) {
      var Result = null;
      Result = this.FDefs.AddFloatVariable(AName,AValue);
      Result.FCategory = ACategory;
      return Result;
    };
    this.AddCurrencyVariable = function (ACategory, AName, AValue) {
      var Result = null;
      Result = this.FDefs.AddCurrencyVariable(AName,AValue);
      Result.FCategory = ACategory;
      return Result;
    };
    this.AddStringVariable = function (ACategory, AName, AValue) {
      var Result = null;
      Result = this.FDefs.AddStringVariable(AName,AValue);
      Result.FCategory = ACategory;
      return Result;
    };
    this.AddDateTimeVariable = function (ACategory, AName, AValue) {
      var Result = null;
      Result = this.FDefs.AddDateTimeVariable(AName,AValue);
      Result.FCategory = ACategory;
      return Result;
    };
    this.AddFunction = function (ACategory, AName, AResultType, AParamTypes, ACallBack) {
      var Result = null;
      Result = this.FDefs.AddFunction(AName,AResultType,AParamTypes,ACallBack);
      Result.FCategory = ACategory;
      return Result;
    };
    this.AddFunction$1 = function (ACategory, AName, AResultType, AParamTypes, ANodeClass) {
      var Result = null;
      Result = this.FDefs.AddFunction$1(AName,AResultType,AParamTypes,ANodeClass);
      Result.FCategory = ACategory;
      return Result;
    };
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"EExprParser",pas.SysUtils.Exception,function () {
  });
  this.AllBuiltIns = rtl.createSet(this.TBuiltInCategory.bcStrings,this.TBuiltInCategory.bcDateTime,this.TBuiltInCategory.bcMath,this.TBuiltInCategory.bcBoolean,this.TBuiltInCategory.bcConversion,this.TBuiltInCategory.bcData,this.TBuiltInCategory.bcVaria,this.TBuiltInCategory.bcUser,this.TBuiltInCategory.bcAggregate);
  this.TokenName = function (AToken) {
    var Result = "";
    Result = pas.TypInfo.GetEnumName($mod.$rtti["TTokenType"],AToken);
    return Result;
  };
  this.ResultTypeName = function (AResult) {
    var Result = "";
    Result = pas.TypInfo.GetEnumName($mod.$rtti["TResultType"],AResult);
    return Result;
  };
  this.CharToResultType = function (C) {
    var Result = 0;
    var $tmp = pas.System.upcase(C);
    if ($tmp === "S") {
      Result = $mod.TResultType.rtString}
     else if ($tmp === "D") {
      Result = $mod.TResultType.rtDateTime}
     else if ($tmp === "B") {
      Result = $mod.TResultType.rtBoolean}
     else if ($tmp === "I") {
      Result = $mod.TResultType.rtInteger}
     else if ($tmp === "F") {
      Result = $mod.TResultType.rtFloat}
     else if ($tmp === "C") {
      Result = $mod.TResultType.rtCurrency}
     else {
      $impl.RaiseParserError$1(rtl.getResStr($mod,"SErrInvalidResultCharacter"),pas.System.VarRecs(9,C));
    };
    return Result;
  };
  this.BuiltinIdentifiers = function () {
    var Result = null;
    if ($impl.BuiltIns === null) $impl.BuiltIns = $mod.TExprBuiltInManager.$create("Create$1",[null]);
    Result = $impl.BuiltIns;
    return Result;
  };
  this.RegisterStdBuiltins = function (AManager, Categories) {
    if ($mod.TBuiltInCategory.bcMath in Categories) {
      AManager.AddFloatVariable($mod.TBuiltInCategory.bcMath,"pi",Math.PI);
      AManager.AddFunction($mod.TBuiltInCategory.bcMath,"cos","F","F",$impl.BuiltInCos);
      AManager.AddFunction($mod.TBuiltInCategory.bcMath,"sin","F","F",$impl.BuiltInSin);
      AManager.AddFunction($mod.TBuiltInCategory.bcMath,"abs","F","F",$impl.BuiltInAbs);
      AManager.AddFunction($mod.TBuiltInCategory.bcMath,"sqr","F","F",$impl.BuiltInSqr);
      AManager.AddFunction($mod.TBuiltInCategory.bcMath,"sqrt","F","F",$impl.BuiltInSqrt);
      AManager.AddFunction($mod.TBuiltInCategory.bcMath,"exp","F","F",$impl.BuiltInExp);
      AManager.AddFunction($mod.TBuiltInCategory.bcMath,"ln","F","F",$impl.BuiltInLn);
      AManager.AddFunction($mod.TBuiltInCategory.bcMath,"log","F","F",$impl.BuiltInLog);
      AManager.AddFunction($mod.TBuiltInCategory.bcMath,"frac","F","F",$impl.BuiltInFrac);
      AManager.AddFunction($mod.TBuiltInCategory.bcMath,"int","F","F",$impl.BuiltInInt);
      AManager.AddFunction($mod.TBuiltInCategory.bcMath,"round","I","F",$impl.BuiltInRound);
      AManager.AddFunction($mod.TBuiltInCategory.bcMath,"trunc","I","F",$impl.BuiltInTrunc);
    };
    if ($mod.TBuiltInCategory.bcStrings in Categories) {
      AManager.AddFunction($mod.TBuiltInCategory.bcStrings,"length","I","S",$impl.BuiltInLength);
      AManager.AddFunction($mod.TBuiltInCategory.bcStrings,"copy","S","SII",$impl.BuiltInCopy);
      AManager.AddFunction($mod.TBuiltInCategory.bcStrings,"delete","S","SII",$impl.BuiltInDelete);
      AManager.AddFunction($mod.TBuiltInCategory.bcStrings,"pos","I","SS",$impl.BuiltInPos);
      AManager.AddFunction($mod.TBuiltInCategory.bcStrings,"lowercase","S","S",$impl.BuiltInLowercase);
      AManager.AddFunction($mod.TBuiltInCategory.bcStrings,"uppercase","S","S",$impl.BuiltInUppercase);
      AManager.AddFunction($mod.TBuiltInCategory.bcStrings,"stringreplace","S","SSSBB",$impl.BuiltInStringReplace);
      AManager.AddFunction($mod.TBuiltInCategory.bcStrings,"comparetext","I","SS",$impl.BuiltInCompareText);
    };
    if ($mod.TBuiltInCategory.bcDateTime in Categories) {
      AManager.AddFunction($mod.TBuiltInCategory.bcDateTime,"date","D","",$impl.BuiltInDate);
      AManager.AddFunction($mod.TBuiltInCategory.bcDateTime,"time","D","",$impl.BuiltInTime);
      AManager.AddFunction($mod.TBuiltInCategory.bcDateTime,"now","D","",$impl.BuiltInNow);
      AManager.AddFunction($mod.TBuiltInCategory.bcDateTime,"dayofweek","I","D",$impl.BuiltInDayofWeek);
      AManager.AddFunction($mod.TBuiltInCategory.bcDateTime,"extractyear","I","D",$impl.BuiltInExtractYear);
      AManager.AddFunction($mod.TBuiltInCategory.bcDateTime,"extractmonth","I","D",$impl.BuiltInExtractMonth);
      AManager.AddFunction($mod.TBuiltInCategory.bcDateTime,"extractday","I","D",$impl.BuiltInExtractDay);
      AManager.AddFunction($mod.TBuiltInCategory.bcDateTime,"extracthour","I","D",$impl.BuiltInExtractHour);
      AManager.AddFunction($mod.TBuiltInCategory.bcDateTime,"extractmin","I","D",$impl.BuiltInExtractMin);
      AManager.AddFunction($mod.TBuiltInCategory.bcDateTime,"extractsec","I","D",$impl.BuiltInExtractSec);
      AManager.AddFunction($mod.TBuiltInCategory.bcDateTime,"extractmsec","I","D",$impl.BuiltInExtractMSec);
      AManager.AddFunction($mod.TBuiltInCategory.bcDateTime,"encodedate","D","III",$impl.BuiltInEncodedate);
      AManager.AddFunction($mod.TBuiltInCategory.bcDateTime,"encodetime","D","IIII",$impl.BuiltInEncodeTime);
      AManager.AddFunction($mod.TBuiltInCategory.bcDateTime,"encodedatetime","D","IIIIIII",$impl.BuiltInEncodeDateTime);
      AManager.AddFunction($mod.TBuiltInCategory.bcDateTime,"shortdayname","S","I",$impl.BuiltInShortDayName);
      AManager.AddFunction($mod.TBuiltInCategory.bcDateTime,"shortmonthname","S","I",$impl.BuiltInShortMonthName);
      AManager.AddFunction($mod.TBuiltInCategory.bcDateTime,"longdayname","S","I",$impl.BuiltInLongDayName);
      AManager.AddFunction($mod.TBuiltInCategory.bcDateTime,"longmonthname","S","I",$impl.BuiltInLongMonthName);
    };
    if ($mod.TBuiltInCategory.bcBoolean in Categories) {
      AManager.AddFunction($mod.TBuiltInCategory.bcBoolean,"shl","I","II",$impl.BuiltInShl);
      AManager.AddFunction($mod.TBuiltInCategory.bcBoolean,"shr","I","II",$impl.BuiltInShr);
      AManager.AddFunction($mod.TBuiltInCategory.bcBoolean,"IFS","S","BSS",$impl.BuiltinIFS);
      AManager.AddFunction($mod.TBuiltInCategory.bcBoolean,"IFF","F","BFF",$impl.BuiltinIFF);
      AManager.AddFunction($mod.TBuiltInCategory.bcBoolean,"IFD","D","BDD",$impl.BuiltinIFD);
      AManager.AddFunction($mod.TBuiltInCategory.bcBoolean,"IFI","I","BII",$impl.BuiltinIFI);
    };
    if ($mod.TBuiltInCategory.bcConversion in Categories) {
      AManager.AddFunction($mod.TBuiltInCategory.bcConversion,"inttostr","S","I",$impl.BuiltInIntToStr);
      AManager.AddFunction($mod.TBuiltInCategory.bcConversion,"strtoint","I","S",$impl.BuiltInStrToInt);
      AManager.AddFunction($mod.TBuiltInCategory.bcConversion,"strtointdef","I","SI",$impl.BuiltInStrToIntDef);
      AManager.AddFunction($mod.TBuiltInCategory.bcConversion,"floattostr","S","F",$impl.BuiltInFloatToStr);
      AManager.AddFunction($mod.TBuiltInCategory.bcConversion,"strtofloat","F","S",$impl.BuiltInStrToFloat);
      AManager.AddFunction($mod.TBuiltInCategory.bcConversion,"strtofloatdef","F","SF",$impl.BuiltInStrToFloatDef);
      AManager.AddFunction($mod.TBuiltInCategory.bcConversion,"booltostr","S","B",$impl.BuiltInBoolToStr);
      AManager.AddFunction($mod.TBuiltInCategory.bcConversion,"strtobool","B","S",$impl.BuiltInStrToBool);
      AManager.AddFunction($mod.TBuiltInCategory.bcConversion,"strtobooldef","B","SB",$impl.BuiltInStrToBoolDef);
      AManager.AddFunction($mod.TBuiltInCategory.bcConversion,"datetostr","S","D",$impl.BuiltInDateToStr);
      AManager.AddFunction($mod.TBuiltInCategory.bcConversion,"timetostr","S","D",$impl.BuiltInTimeToStr);
      AManager.AddFunction($mod.TBuiltInCategory.bcConversion,"strtodate","D","S",$impl.BuiltInStrToDate);
      AManager.AddFunction($mod.TBuiltInCategory.bcConversion,"strtodatedef","D","SD",$impl.BuiltInStrToDateDef);
      AManager.AddFunction($mod.TBuiltInCategory.bcConversion,"strtotime","D","S",$impl.BuiltInStrToTime);
      AManager.AddFunction($mod.TBuiltInCategory.bcConversion,"strtotimedef","D","SD",$impl.BuiltInStrToTimeDef);
      AManager.AddFunction($mod.TBuiltInCategory.bcConversion,"strtodatetime","D","S",$impl.BuiltInStrToDateTime);
      AManager.AddFunction($mod.TBuiltInCategory.bcConversion,"strtodatetimedef","D","SD",$impl.BuiltInStrToDateTimeDef);
      AManager.AddFunction($mod.TBuiltInCategory.bcConversion,"formatfloat","S","SF",$impl.BuiltInFormatFloat);
      AManager.AddFunction($mod.TBuiltInCategory.bcConversion,"formatdatetime","S","SD",$impl.BuiltInFormatDateTime);
    };
    if ($mod.TBuiltInCategory.bcAggregate in Categories) {
      AManager.AddFunction$1($mod.TBuiltInCategory.bcAggregate,"count","I","",$mod.TAggregateCount);
      AManager.AddFunction$1($mod.TBuiltInCategory.bcAggregate,"sum","F","F",$mod.TAggregateSum);
      AManager.AddFunction$1($mod.TBuiltInCategory.bcAggregate,"avg","F","F",$mod.TAggregateAvg);
      AManager.AddFunction$1($mod.TBuiltInCategory.bcAggregate,"min","F","F",$mod.TAggregateMin);
      AManager.AddFunction$1($mod.TBuiltInCategory.bcAggregate,"max","F","F",$mod.TAggregateMax);
    };
  };
  this.ArgToFloat = function (Arg) {
    var Result = 0.0;
    if (Arg.ResultType === $mod.TResultType.rtInteger) {
      Result = rtl.trunc(Arg.resValue)}
     else if (Arg.ResultType === $mod.TResultType.rtCurrency) {
      Result = rtl.trunc(Arg.resValue * 10000) / 10000}
     else Result = rtl.getNumber(Arg.resValue);
    return Result;
  };
  $mod.$implcode = function () {
    $impl.cNull = "\x00";
    $impl.cSingleQuote = "'";
    $impl.cHexIdentifier = "$";
    $impl.cOctalIdentifier = "&";
    $impl.cBinaryIdentifier = "%";
    $impl.Digits = rtl.createSet(null,48,57,46);
    $impl.HexDigits = rtl.createSet(null,48,57,null,65,70,null,97,102);
    $impl.OctalDigits = rtl.createSet(null,48,55);
    $impl.BinaryDigits = rtl.createSet(48,49);
    $impl.WhiteSpace = rtl.createSet(32,13,10,9);
    $impl.Operators = rtl.createSet(43,45,60,62,61,47,42,94);
    $impl.Delimiters = rtl.unionSet($impl.Operators,rtl.createSet(44,40,41));
    $impl.Symbols = rtl.unionSet(rtl.createSet(37),$impl.Delimiters);
    $impl.WordDelimiters = rtl.unionSet($impl.WhiteSpace,$impl.Symbols);
    $impl.FileFormatSettings = pas.SysUtils.TFormatSettings.$new();
    $impl.RaiseParserError = function (Msg) {
      throw $mod.EExprParser.$create("Create$1",[Msg]);
    };
    $impl.RaiseParserError$1 = function (Fmt, Args) {
      throw $mod.EExprParser.$create("CreateFmt",[Fmt,Args]);
    };
    $impl.BuiltIns = null;
    $impl.power = function (base, exponent) {
      var Result = 0.0;
      var ex = 0;
      if (exponent === 0.0) {
        Result = 1.0}
       else if ((base === 0.0) && (exponent > 0.0)) {
        Result = 0.0}
       else if ((base < 0.0) && (pas.System.Frac(exponent) === 0.0)) {
        ex = Math.round(exponent);
        Result = Math.exp(exponent * Math.log(-base));
        if (pas.System.Odd(ex)) Result = -Result;
      } else Result = Math.exp(exponent * Math.log(base));
      return Result;
    };
    $impl.BuiltInCos = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtFloat;
      Result.resValue = Math.cos($mod.ArgToFloat($mod.TFPExpressionResult.$clone(Args[0])));
      return Result;
    };
    $impl.BuiltInSin = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtFloat;
      Result.resValue = Math.sin($mod.ArgToFloat($mod.TFPExpressionResult.$clone(Args[0])));
      return Result;
    };
    $impl.BuiltInAbs = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtFloat;
      Result.resValue = Math.abs($mod.ArgToFloat($mod.TFPExpressionResult.$clone(Args[0])));
      return Result;
    };
    $impl.BuiltInSqr = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtFloat;
      Result.resValue = pas.System.Sqr$1($mod.ArgToFloat($mod.TFPExpressionResult.$clone(Args[0])));
      return Result;
    };
    $impl.BuiltInSqrt = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtFloat;
      Result.resValue = Math.sqrt($mod.ArgToFloat($mod.TFPExpressionResult.$clone(Args[0])));
      return Result;
    };
    $impl.BuiltInExp = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtFloat;
      Result.resValue = Math.exp($mod.ArgToFloat($mod.TFPExpressionResult.$clone(Args[0])));
      return Result;
    };
    $impl.BuiltInLn = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtFloat;
      Result.resValue = Math.log($mod.ArgToFloat($mod.TFPExpressionResult.$clone(Args[0])));
      return Result;
    };
    $impl.L10 = 0.0;
    $impl.BuiltInLog = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtFloat;
      Result.resValue = Math.log($mod.ArgToFloat($mod.TFPExpressionResult.$clone(Args[0]))) / $impl.L10;
      return Result;
    };
    $impl.BuiltInRound = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtInteger;
      Result.resValue = Math.round($mod.ArgToFloat($mod.TFPExpressionResult.$clone(Args[0])));
      return Result;
    };
    $impl.BuiltInTrunc = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtInteger;
      Result.resValue = pas.System.Trunc($mod.ArgToFloat($mod.TFPExpressionResult.$clone(Args[0])));
      return Result;
    };
    $impl.BuiltInInt = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtInteger;
      Result.resValue = pas.System.Int($mod.ArgToFloat($mod.TFPExpressionResult.$clone(Args[0])));
      return Result;
    };
    $impl.BuiltInFrac = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtFloat;
      Result.resValue = pas.System.Frac($mod.ArgToFloat($mod.TFPExpressionResult.$clone(Args[0])));
      return Result;
    };
    $impl.BuiltInLength = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtInteger;
      Result.resValue = ("" + Args[0].resValue).length;
      return Result;
    };
    $impl.BuiltInCopy = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtString;
      Result.resValue = pas.System.Copy("" + Args[0].resValue,rtl.trunc(Args[1].resValue),rtl.trunc(Args[2].resValue));
      return Result;
    };
    $impl.BuiltInDelete = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      var S = "";
      Result.ResultType = $mod.TResultType.rtString;
      S = "" + Args[0].resValue;
      pas.System.Delete({get: function () {
          return S;
        }, set: function (v) {
          S = v;
        }},rtl.trunc(Args[1].resValue),rtl.trunc(Args[2].resValue));
      Result.resValue = S;
      return Result;
    };
    $impl.BuiltInPos = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtInteger;
      Result.resValue = pas.System.Pos("" + Args[0].resValue,"" + Args[1].resValue);
      return Result;
    };
    $impl.BuiltInUppercase = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtString;
      Result.resValue = pas.SysUtils.UpperCase("" + Args[0].resValue);
      return Result;
    };
    $impl.BuiltInLowercase = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtString;
      Result.resValue = pas.SysUtils.LowerCase("" + Args[0].resValue);
      return Result;
    };
    $impl.BuiltInStringReplace = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      var F = {};
      Result.ResultType = $mod.TResultType.rtString;
      F = {};
      if (!(Args[3].resValue == false)) F = rtl.includeSet(F,pas.SysUtils.TStringReplaceFlag.rfReplaceAll);
      if (!(Args[4].resValue == false)) F = rtl.includeSet(F,pas.SysUtils.TStringReplaceFlag.rfIgnoreCase);
      Result.resValue = pas.SysUtils.StringReplace("" + Args[0].resValue,"" + Args[1].resValue,"" + Args[2].resValue,rtl.refSet(F));
      return Result;
    };
    $impl.BuiltInCompareText = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtInteger;
      Result.resValue = pas.SysUtils.CompareText("" + Args[0].resValue,"" + Args[1].resValue);
      return Result;
    };
    $impl.BuiltInDate = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      if (rtl.length(Args) === 0) ;
      Result.ResultType = $mod.TResultType.rtDateTime;
      Result.resValue = pas.SysUtils.Date();
      return Result;
    };
    $impl.BuiltInTime = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      if (rtl.length(Args) === 0) ;
      Result.ResultType = $mod.TResultType.rtDateTime;
      Result.resValue = pas.SysUtils.Time();
      return Result;
    };
    $impl.BuiltInNow = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      if (rtl.length(Args) === 0) ;
      Result.ResultType = $mod.TResultType.rtDateTime;
      Result.resValue = pas.SysUtils.Now();
      return Result;
    };
    $impl.BuiltInDayofWeek = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtInteger;
      Result.resValue = pas.SysUtils.DayOfWeek(rtl.getNumber(Args[0].resValue));
      return Result;
    };
    $impl.BuiltInExtractYear = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      var Y = 0;
      var M = 0;
      var D = 0;
      Result.ResultType = $mod.TResultType.rtInteger;
      pas.SysUtils.DecodeDate(rtl.getNumber(Args[0].resValue),{get: function () {
          return Y;
        }, set: function (v) {
          Y = v;
        }},{get: function () {
          return M;
        }, set: function (v) {
          M = v;
        }},{get: function () {
          return D;
        }, set: function (v) {
          D = v;
        }});
      Result.resValue = Y;
      return Result;
    };
    $impl.BuiltInExtractMonth = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      var Y = 0;
      var M = 0;
      var D = 0;
      Result.ResultType = $mod.TResultType.rtInteger;
      pas.SysUtils.DecodeDate(rtl.getNumber(Args[0].resValue),{get: function () {
          return Y;
        }, set: function (v) {
          Y = v;
        }},{get: function () {
          return M;
        }, set: function (v) {
          M = v;
        }},{get: function () {
          return D;
        }, set: function (v) {
          D = v;
        }});
      Result.resValue = M;
      return Result;
    };
    $impl.BuiltInExtractDay = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      var Y = 0;
      var M = 0;
      var D = 0;
      Result.ResultType = $mod.TResultType.rtInteger;
      pas.SysUtils.DecodeDate(rtl.getNumber(Args[0].resValue),{get: function () {
          return Y;
        }, set: function (v) {
          Y = v;
        }},{get: function () {
          return M;
        }, set: function (v) {
          M = v;
        }},{get: function () {
          return D;
        }, set: function (v) {
          D = v;
        }});
      Result.resValue = D;
      return Result;
    };
    $impl.BuiltInExtractHour = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      var H = 0;
      var M = 0;
      var S = 0;
      var MS = 0;
      Result.ResultType = $mod.TResultType.rtInteger;
      pas.SysUtils.DecodeTime(rtl.getNumber(Args[0].resValue),{get: function () {
          return H;
        }, set: function (v) {
          H = v;
        }},{get: function () {
          return M;
        }, set: function (v) {
          M = v;
        }},{get: function () {
          return S;
        }, set: function (v) {
          S = v;
        }},{get: function () {
          return MS;
        }, set: function (v) {
          MS = v;
        }});
      Result.resValue = H;
      return Result;
    };
    $impl.BuiltInExtractMin = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      var H = 0;
      var M = 0;
      var S = 0;
      var MS = 0;
      Result.ResultType = $mod.TResultType.rtInteger;
      pas.SysUtils.DecodeTime(rtl.getNumber(Args[0].resValue),{get: function () {
          return H;
        }, set: function (v) {
          H = v;
        }},{get: function () {
          return M;
        }, set: function (v) {
          M = v;
        }},{get: function () {
          return S;
        }, set: function (v) {
          S = v;
        }},{get: function () {
          return MS;
        }, set: function (v) {
          MS = v;
        }});
      Result.resValue = M;
      return Result;
    };
    $impl.BuiltInExtractSec = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      var H = 0;
      var M = 0;
      var S = 0;
      var MS = 0;
      Result.ResultType = $mod.TResultType.rtInteger;
      pas.SysUtils.DecodeTime(rtl.getNumber(Args[0].resValue),{get: function () {
          return H;
        }, set: function (v) {
          H = v;
        }},{get: function () {
          return M;
        }, set: function (v) {
          M = v;
        }},{get: function () {
          return S;
        }, set: function (v) {
          S = v;
        }},{get: function () {
          return MS;
        }, set: function (v) {
          MS = v;
        }});
      Result.resValue = S;
      return Result;
    };
    $impl.BuiltInExtractMSec = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      var H = 0;
      var M = 0;
      var S = 0;
      var MS = 0;
      Result.ResultType = $mod.TResultType.rtInteger;
      pas.SysUtils.DecodeTime(rtl.getNumber(Args[0].resValue),{get: function () {
          return H;
        }, set: function (v) {
          H = v;
        }},{get: function () {
          return M;
        }, set: function (v) {
          M = v;
        }},{get: function () {
          return S;
        }, set: function (v) {
          S = v;
        }},{get: function () {
          return MS;
        }, set: function (v) {
          MS = v;
        }});
      Result.resValue = MS;
      return Result;
    };
    $impl.BuiltInEncodedate = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtDateTime;
      Result.resValue = pas.SysUtils.EncodeDate(rtl.trunc(Args[0].resValue),rtl.trunc(Args[1].resValue),rtl.trunc(Args[2].resValue));
      return Result;
    };
    $impl.BuiltInEncodeTime = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtDateTime;
      Result.resValue = pas.SysUtils.EncodeTime(rtl.trunc(Args[0].resValue),rtl.trunc(Args[1].resValue),rtl.trunc(Args[2].resValue),rtl.trunc(Args[3].resValue));
      return Result;
    };
    $impl.BuiltInEncodeDateTime = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtDateTime;
      Result.resValue = pas.SysUtils.EncodeDate(rtl.trunc(Args[0].resValue),rtl.trunc(Args[1].resValue),rtl.trunc(Args[2].resValue)) + pas.SysUtils.EncodeTime(rtl.trunc(Args[3].resValue),rtl.trunc(Args[4].resValue),rtl.trunc(Args[5].resValue),rtl.trunc(Args[6].resValue));
      return Result;
    };
    $impl.BuiltInShortDayName = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtString;
      Result.resValue = pas.SysUtils.FormatSettings.ShortDayNames[rtl.trunc(Args[0].resValue) - 1];
      return Result;
    };
    $impl.BuiltInShortMonthName = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtString;
      Result.resValue = pas.SysUtils.FormatSettings.ShortMonthNames[rtl.trunc(Args[0].resValue) - 1];
      return Result;
    };
    $impl.BuiltInLongDayName = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.resValue = pas.SysUtils.FormatSettings.LongDayNames[rtl.trunc(Args[0].resValue) - 1];
      return Result;
    };
    $impl.BuiltInLongMonthName = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtString;
      Result.resValue = pas.SysUtils.FormatSettings.LongMonthNames[rtl.trunc(Args[0].resValue) - 1];
      return Result;
    };
    $impl.BuiltInFormatDateTime = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtString;
      Result.resValue = pas.SysUtils.FormatDateTime("" + Args[0].resValue,rtl.getNumber(Args[1].resValue));
      return Result;
    };
    $impl.BuiltInIntToStr = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtString;
      Result.resValue = pas.SysUtils.IntToStr(rtl.trunc(Args[0].resValue));
      return Result;
    };
    $impl.BuiltInStrToInt = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtInteger;
      Result.resValue = pas.SysUtils.StrToInt("" + Args[0].resValue);
      return Result;
    };
    $impl.BuiltInStrToIntDef = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtInteger;
      Result.resValue = pas.SysUtils.StrToIntDef$1("" + Args[0].resValue,rtl.trunc(Args[1].resValue));
      return Result;
    };
    $impl.BuiltInFloatToStr = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtString;
      Result.resValue = pas.SysUtils.FloatToStr(rtl.getNumber(Args[0].resValue));
      return Result;
    };
    $impl.BuiltInStrToFloat = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtFloat;
      Result.resValue = pas.SysUtils.StrToFloat("" + Args[0].resValue);
      return Result;
    };
    $impl.BuiltInStrToFloatDef = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtFloat;
      Result.resValue = pas.SysUtils.StrToFloatDef("" + Args[0].resValue,rtl.getNumber(Args[1].resValue));
      return Result;
    };
    $impl.BuiltInDateToStr = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtString;
      Result.resValue = pas.SysUtils.DateToStr(rtl.getNumber(Args[0].resValue));
      return Result;
    };
    $impl.BuiltInTimeToStr = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtString;
      Result.resValue = pas.SysUtils.TimeToStr(rtl.getNumber(Args[0].resValue));
      return Result;
    };
    $impl.BuiltInStrToDate = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtDateTime;
      Result.resValue = pas.SysUtils.StrToDate("" + Args[0].resValue);
      return Result;
    };
    $impl.BuiltInStrToDateDef = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtDateTime;
      Result.resValue = pas.SysUtils.StrToDateDef("" + Args[0].resValue,rtl.getNumber(Args[1].resValue));
      return Result;
    };
    $impl.BuiltInStrToTime = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtDateTime;
      Result.resValue = pas.SysUtils.StrToTime("" + Args[0].resValue);
      return Result;
    };
    $impl.BuiltInStrToTimeDef = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtDateTime;
      Result.resValue = pas.SysUtils.StrToTimeDef("" + Args[0].resValue,rtl.getNumber(Args[1].resValue));
      return Result;
    };
    $impl.BuiltInStrToDateTime = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtDateTime;
      Result.resValue = pas.SysUtils.StrToDateTime("" + Args[0].resValue);
      return Result;
    };
    $impl.BuiltInStrToDateTimeDef = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtDateTime;
      Result.resValue = pas.SysUtils.StrToDateTimeDef("" + Args[0].resValue,rtl.getNumber(Args[1].resValue));
      return Result;
    };
    $impl.BuiltInFormatFloat = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtString;
      Result.resValue = pas.SysUtils.FormatFloat("" + Args[0].resValue,rtl.getNumber(Args[1].resValue));
      return Result;
    };
    $impl.BuiltInBoolToStr = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtString;
      Result.resValue = pas.SysUtils.BoolToStr(!(Args[0].resValue == false),false);
      return Result;
    };
    $impl.BuiltInStrToBool = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtBoolean;
      Result.resValue = pas.SysUtils.StrToBool("" + Args[0].resValue);
      return Result;
    };
    $impl.BuiltInStrToBoolDef = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.resValue = pas.SysUtils.StrToBoolDef("" + Args[0].resValue,!(Args[1].resValue == false));
      Result.ResultType = $mod.TResultType.rtBoolean;
      return Result;
    };
    $impl.BuiltInShl = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtInteger;
      Result.resValue = rtl.shl(rtl.trunc(Args[0].resValue),rtl.trunc(Args[1].resValue));
      return Result;
    };
    $impl.BuiltInShr = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtInteger;
      Result.resValue = rtl.shr(rtl.trunc(Args[0].resValue),rtl.trunc(Args[1].resValue));
      return Result;
    };
    $impl.BuiltinIFS = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtString;
      if (!(Args[0].resValue == false)) {
        Result.resValue = Args[1].resValue}
       else Result.resValue = Args[2].resValue;
      return Result;
    };
    $impl.BuiltinIFI = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtInteger;
      if (!(Args[0].resValue == false)) {
        Result.resValue = Args[1].resValue}
       else Result.resValue = Args[2].resValue;
      return Result;
    };
    $impl.BuiltinIFF = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtFloat;
      if (!(Args[0].resValue == false)) {
        Result.resValue = Args[1].resValue}
       else Result.resValue = Args[2].resValue;
      return Result;
    };
    $impl.BuiltinIFD = function (Args) {
      var Result = $mod.TFPExpressionResult.$new();
      Result.ResultType = $mod.TResultType.rtDateTime;
      if (!(Args[0].resValue == false)) {
        Result.resValue = Args[1].resValue}
       else Result.resValue = Args[2].resValue;
      return Result;
    };
    $impl.InitFileFormatSettings = function () {
      $impl.FileFormatSettings.$assign(pas.SysUtils.FormatSettings);
      $impl.FileFormatSettings.DecimalSeparator = ".";
      $impl.FileFormatSettings.DateSeparator = "-";
      $impl.FileFormatSettings.TimeSeparator = ":";
      $impl.FileFormatSettings.ShortDateFormat = "yyyy-mm-dd";
      $impl.FileFormatSettings.LongTimeFormat = "hh:nn:ss";
    };
    $mod.$resourcestrings = {SBadQuotes: {org: "Unterminated string"}, SUnknownDelimiter: {org: 'Unknown delimiter character: "%s"'}, SErrUnknownCharacter: {org: 'Unknown character at pos %d: "%s"'}, SErrUnexpectedEndOfExpression: {org: "Unexpected end of expression"}, SErrUnknownComparison: {org: "Internal error: Unknown comparison"}, SErrUnknownBooleanOp: {org: "Internal error: Unknown boolean operation"}, SErrBracketExpected: {org: "Expected ) bracket at position %d, but got %s"}, SerrUnknownTokenAtPos: {org: "Unknown token at pos %d : %s"}, SErrLeftBracketExpected: {org: "Expected ( bracket at position %d, but got %s"}, SErrInvalidFloat: {org: "%s is not a valid floating-point value"}, SErrUnknownIdentifier: {org: "Unknown identifier: %s"}, SErrInExpression: {org: "Cannot evaluate: error in expression"}, SErrInExpressionEmpty: {org: "Cannot evaluate: empty expression"}, SErrCommaExpected: {org: "Expected comma (,) at position %d, but got %s"}, SErrInvalidNumberChar: {org: "Unexpected character in number : %s"}, SErrInvalidNumber: {org: "Invalid numerical value : %s"}, SErrUnterminatedIdentifier: {org: "Unterminated quoted identifier: %s"}, SErrNoOperand: {org: "No operand for unary operation %s"}, SErrNoleftOperand: {org: "No left operand for binary operation %s"}, SErrNoRightOperand: {org: "No right operand for binary operation %s"}, SErrNoNegation: {org: "Cannot negate expression of type %s : %s"}, SErrNoNOTOperation: {org: 'Cannot perform "not" on expression of type %s: %s'}, SErrTypesDoNotMatch: {org: 'Type mismatch: %s<>%s for expressions "%s" and "%s".'}, SErrNoNodeToCheck: {org: "Internal error: No node to check !"}, SInvalidNodeType: {org: "Node type (%s) not in allowed types (%s) for expression: %s"}, SErrUnterminatedExpression: {org: "Badly terminated expression. Found token at position %d : %s"}, SErrDuplicateIdentifier: {org: 'An identifier with name "%s" already exists.'}, SErrInvalidResultCharacter: {org: '"%s" is not a valid return type indicator'}, ErrInvalidArgumentCount: {org: "Invalid argument count for function %s"}, SErrInvalidArgumentType: {org: "Invalid type for argument %d: Expected %s, got %s"}, SErrInvalidResultType: {org: "Invalid result type: %s"}, SErrNotVariable: {org: "Identifier %s is not a variable"}, SErrIFNeedsBoolean: {org: "First argument to IF must be of type boolean: %s"}, SErrCaseNeeds3: {org: "Case statement needs to have at least 4 arguments"}, SErrCaseEvenCount: {org: "Case statement needs to have an even number of arguments"}, SErrCaseLabelNotAConst: {org: 'Case label %d "%s" is not a constant expression'}, SErrCaseLabelType: {org: 'Case label %d "%s" needs type %s, but has type %s'}, SErrCaseValueType: {org: 'Case value %d "%s" needs type %s, but has type %s'}, SErrStringTypeRequired: {org: 'Expression requires string type, got type "%s" for %s'}};
  };
  $mod.$init = function () {
    $impl.L10 = Math.log(10);
    $mod.RegisterStdBuiltins($mod.BuiltinIdentifiers(),$mod.AllBuiltIns);
    $impl.InitFileFormatSettings();
  };
},["TypInfo"]);
rtl.module("JSONDataset",["System","Types","JS","DB","Classes","SysUtils","TypInfo","fpexprpars","Web"],function () {
  "use strict";
  var $mod = this;
  this.$rtti.$Class("TBaseJSONDataSet");
  this.$rtti.$Class("TJSONIndexDef");
  this.TJSONRowType = {"0": "rtJSONObject", rtJSONObject: 0, "1": "rtJSONArray", rtJSONArray: 1};
  this.$rtti.$Enum("TJSONRowType",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TJSONRowType});
  rtl.createClass(this,"TJSONFieldMapper",pas.System.TObject,function () {
    this.CopyRow = function (aRow) {
      var Result = undefined;
      Result = JSON.parse(JSON.stringify(aRow));
      return Result;
    };
    this.GetJSONDataForField$1 = function (F, Row) {
      var Result = undefined;
      Result = this.GetJSONDataForField(F.FFieldName,F.GetIndex(),Row);
      return Result;
    };
    this.SetJSONDataForField$1 = function (F, Row, Data) {
      this.SetJSONDataForField(F.FFieldName,F.GetIndex(),Row,Data);
    };
  });
  rtl.createClass(this,"TJSONDateField",pas.DB.TDateField,function () {
    this.$init = function () {
      pas.DB.TDateField.$init.call(this);
      this.FDateFormat = "";
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("DateFormat",0,rtl.string,"FDateFormat","FDateFormat");
  });
  rtl.createClass(this,"TJSONTimeField",pas.DB.TTimeField,function () {
    this.$init = function () {
      pas.DB.TTimeField.$init.call(this);
      this.FTimeFormat = "";
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("TimeFormat",0,rtl.string,"FTimeFormat","FTimeFormat");
  });
  rtl.createClass(this,"TJSONDateTimeField",pas.DB.TDateTimeField,function () {
    this.$init = function () {
      pas.DB.TDateTimeField.$init.call(this);
      this.FDateTimeFormat = "";
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("DateTimeFormat",0,rtl.string,"FDateTimeFormat","FDateTimeFormat");
  });
  rtl.createClass(this,"TFieldComparer",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FDesc = false;
      this.FValue = undefined;
      this.FField = null;
      this.FOptions = {};
      this.FDataset = null;
    };
    this.$final = function () {
      this.FField = undefined;
      this.FOptions = undefined;
      this.FDataset = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function (aDataset, aField, aValue, aOptions) {
      this.FField = aField;
      this.FValue = aValue;
      this.FOptions = rtl.refSet(aOptions);
      this.FDataset = aDataset;
      return this;
    };
    this.GetFieldValue = function (RowIndex) {
      var Result = undefined;
      Result = this.FDataset.FFieldMapper.GetJSONDataForField$1(this.FField,this.FDataset.FRows[RowIndex]);
      return Result;
    };
    this.CompareRows = function (RowIndex1, RowIndex2) {
      var Result = 0;
      Result = this.Compare(RowIndex1,this.GetFieldValue(RowIndex2));
      return Result;
    };
    this.Compare$1 = function (RowIndex) {
      var Result = 0;
      Result = this.Compare(RowIndex,this.FValue);
      return Result;
    };
  });
  this.$rtti.$ClassRef("TFieldComparerClass",{instancetype: this.$rtti["TFieldComparer"]});
  rtl.createClass(this,"TStringFieldComparer",this.TFieldComparer,function () {
    this.Compare = function (RowIndex, aValue) {
      var Result = 0;
      var S1 = "";
      var S2 = "";
      S1 = "" + this.GetFieldValue(RowIndex);
      S2 = "" + aValue;
      if (pas.DB.TLocateOption.loPartialKey in this.FOptions) S1 = pas.System.Copy(S1,1,S2.length);
      if (pas.DB.TLocateOption.loCaseInsensitive in this.FOptions) {
        Result = pas.SysUtils.CompareText(S1,S2)}
       else Result = pas.SysUtils.CompareStr(S1,S2);
      return Result;
    };
  });
  rtl.createClass(this,"TNativeIntFieldComparer",this.TFieldComparer,function () {
    this.Compare = function (RowIndex, aValue) {
      var Result = 0;
      var I1 = 0;
      var I2 = 0;
      I1 = rtl.trunc(this.GetFieldValue(RowIndex));
      I2 = rtl.trunc(aValue);
      Result = I1 - I2;
      return Result;
    };
  });
  rtl.createClass(this,"TBooleanFieldComparer",this.TFieldComparer,function () {
    this.Compare = function (RowIndex, aValue) {
      var Result = 0;
      var B1 = false;
      var B2 = false;
      B1 = !(this.GetFieldValue(RowIndex) == false);
      B2 = !(aValue == false);
      Result = (B1 + 0) - (B2 + 0);
      return Result;
    };
  });
  rtl.createClass(this,"TDateTimeFieldComparer",this.TFieldComparer,function () {
    this.Compare = function (RowIndex, aValue) {
      var $Self = this;
      var Result = 0;
      var D1 = 0.0;
      var D2 = 0.0;
      function ToDate(v) {
        var Result = 0.0;
        if (pas.JS.isDate(v)) {
          Result = pas.SysUtils.JSDateToDateTime(v)}
         else Result = $Self.FDataset.ConvertDateTimeField("" + v,$Self.FField);
        return Result;
      };
      D1 = ToDate(this.GetFieldValue(RowIndex));
      D2 = ToDate(aValue);
      Result = Math.round(D1 - D2);
      return Result;
    };
  });
  rtl.createClass(this,"TFloatFieldComparer",this.TFieldComparer,function () {
    this.Compare = function (RowIndex, aValue) {
      var Result = 0;
      var D1 = 0.0;
      var D2 = 0.0;
      D1 = rtl.getNumber(this.GetFieldValue(RowIndex));
      D2 = rtl.getNumber(aValue);
      Result = Math.round(D1 - D2);
      return Result;
    };
  });
  rtl.createClass(this,"TRecordComparer",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FDataset = null;
      this.FIndexBased = false;
      this.FItems = [];
      this.FOptions = {};
      this.FValues = [];
    };
    this.$final = function () {
      this.FDataset = undefined;
      this.FItems = undefined;
      this.FOptions = undefined;
      this.FValues = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.GetFieldComparer = function (Index) {
      var Result = null;
      if ((Index < 0) || (Index >= rtl.length(this.FItems))) throw pas.Classes.EListError.$create("CreateFmt",["Index out of bounds: %d not in [%d,%d]",pas.System.VarRecs(0,Index,0,0,19,rtl.length(this.FItems) - 1)]);
      Result = this.GetFieldComparer(Index);
      return Result;
    };
    this.ConstructItems = function (aFields) {
      var L = null;
      var FCC = null;
      var F = null;
      var I = 0;
      L = pas.Classes.TFPList.$create("Create");
      try {
        this.FDataset.GetFieldList$1(L,aFields);
        if (!this.FIndexBased && (L.FCount !== rtl.length(this.FValues))) throw pas.DB.EDatabaseError.$create("CreateFmt",["Array of values has different length (%d) from array of fields (%d)",pas.System.VarRecs(19,rtl.length(this.FValues),0,L.FCount)]);
        this.FItems = rtl.arraySetLength(this.FItems,null,L.FCount);
        for (var $l = 0, $end = L.FCount - 1; $l <= $end; $l++) {
          I = $l;
          F = rtl.getObject(L.Get(I));
          FCC = this.DataTypeToComparerClass(F.FDataType);
          if (FCC === null) throw pas.DB.EDatabaseError.$create("CreateFmt",["Cannot locate on field %s of type %s)",pas.System.VarRecs(18,F.FFieldName,18,pas.TypInfo.GetEnumName(pas.DB.$rtti["TFieldType"],F.FDataType))]);
          if (this.FIndexBased) {
            this.FItems[I] = FCC.$create("Create$1",[this.FDataset,F,null,rtl.refSet(this.FOptions)])}
           else this.FItems[I] = FCC.$create("Create$1",[this.FDataset,F,this.FValues[I],rtl.refSet(this.FOptions)]);
        };
      } finally {
        L = rtl.freeLoc(L);
      };
    };
    this.DataTypeToComparerClass = function (aFieldType) {
      var Result = null;
      var $tmp = aFieldType;
      if (($tmp === pas.DB.TFieldType.ftMemo) || ($tmp === pas.DB.TFieldType.ftFixedChar) || ($tmp === pas.DB.TFieldType.ftString)) {
        Result = $mod.TStringFieldComparer}
       else if (($tmp === pas.DB.TFieldType.ftAutoInc) || ($tmp === pas.DB.TFieldType.ftInteger) || ($tmp === pas.DB.TFieldType.ftLargeint)) {
        Result = $mod.TNativeIntFieldComparer}
       else if ($tmp === pas.DB.TFieldType.ftBoolean) {
        Result = $mod.TBooleanFieldComparer}
       else if ($tmp === pas.DB.TFieldType.ftFloat) {
        Result = $mod.TFloatFieldComparer}
       else if (($tmp === pas.DB.TFieldType.ftDate) || ($tmp === pas.DB.TFieldType.ftTime) || ($tmp === pas.DB.TFieldType.ftDateTime)) {
        Result = $mod.TDateTimeFieldComparer}
       else {
        Result = null;
      };
      return Result;
    };
    this.Compare = function (aRowindex) {
      var Result = 0;
      var I = 0;
      var L = 0;
      Result = 0;
      I = 0;
      L = rtl.length(this.FItems);
      while ((Result === 0) && (I < L)) {
        Result = this.FItems[I].Compare$1(aRowindex);
        I += 1;
      };
      return Result;
    };
    this.CompareRows = function (aRowindex1, aRowIndex2) {
      var Result = 0;
      var I = 0;
      var L = 0;
      Result = 0;
      I = 0;
      L = rtl.length(this.FItems);
      while ((Result === 0) && (I < L)) {
        Result = this.FItems[I].CompareRows(aRowindex1,aRowIndex2);
        if ((Result !== 0) && this.FItems[I].FDesc) Result = -Result;
        I += 1;
      };
      return Result;
    };
    this.updateFromIndex = function (aIndex) {
      var L = null;
      var I = 0;
      L = pas.Classes.TFPList.$create("Create");
      try {
        if (aIndex.FCaseinsFields !== "") {
          this.FDataset.GetFieldList$1(L,aIndex.FCaseinsFields);
          for (var $l = 0, $end = rtl.length(this.FItems) - 1; $l <= $end; $l++) {
            I = $l;
            if (L.IndexOf(this.FItems[I].FField) !== -1) this.FItems[I].FOptions = rtl.unionSet(this.FItems[I].FOptions,rtl.createSet(pas.DB.TLocateOption.loCaseInsensitive));
          };
        };
        L.Clear();
        this.FDataset.GetFieldList$1(L,aIndex.FDescFields);
        for (var $l1 = 0, $end1 = rtl.length(this.FItems) - 1; $l1 <= $end1; $l1++) {
          I = $l1;
          this.FItems[I].FDesc = (pas.DB.TIndexOption.ixDescending in aIndex.FOptions) || (L.IndexOf(this.FItems[I].FField) !== -1);
        };
      } finally {
        L = rtl.freeLoc(L);
      };
    };
    this.Create$1 = function (aDataset, aFields, aValues, aOptions) {
      this.FDataset = aDataset;
      if (rtl.isArray(aValues)) {
        this.FValues = aValues}
       else {
        this.FValues = rtl.arraySetLength(this.FValues,undefined,1);
        this.FValues[0] = aValues;
      };
      this.FOptions = rtl.refSet(aOptions);
      this.ConstructItems(aFields);
      return this;
    };
    this.Create$2 = function (aDataset, aIndex) {
      this.FDataset = aDataset;
      this.FIndexBased = true;
      if (pas.DB.TIndexOption.ixCaseInsensitive in aIndex.FOptions) this.FOptions = rtl.createSet(pas.DB.TLocateOption.loCaseInsensitive);
      this.ConstructItems(aIndex.FFields);
      this.updateFromIndex(aIndex);
      return this;
    };
    this.Destroy = function () {
      var I = 0;
      for (var $l = 0, $end = rtl.length(this.FItems) - 1; $l <= $end; $l++) {
        I = $l;
        rtl.free(this.FItems,I);
      };
      pas.System.TObject.Destroy.call(this);
    };
    var $r = this.$rtti;
    $mod.$rtti.$DynArray("TRecordComparer.FItems$a",{eltype: $mod.$rtti["TFieldComparer"]});
  });
  this.$rtti.$ClassRef("TRecordComparerClass",{instancetype: this.$rtti["TRecordComparer"]});
  rtl.createClass(this,"TJSONIndex",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FList = null;
      this.FRows = null;
      this.FDataset = null;
    };
    this.$final = function () {
      this.FList = undefined;
      this.FRows = undefined;
      this.FDataset = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.GetRecordIndex = function (aListIndex) {
      var Result = 0;
      if (pas.JS.isUndefined(this.FList[aListIndex])) {
        Result = -1}
       else Result = rtl.trunc(this.FList[aListIndex]);
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.FList.length;
      return Result;
    };
    this.ClearIndex = function () {
      this.FList.length = 0;
    };
    this.Create$1 = function (aDataset, aRows) {
      this.FRows = aRows;
      this.FList = new Array(this.FRows.length);
      this.FDataset = aDataset;
      this.CreateIndex();
      return this;
    };
    this.Delete = function (aListIndex) {
      var Result = 0;
      var a = null;
      a = this.FList.splice(aListIndex,1);
      if (a.length > 0) {
        Result = rtl.trunc(a[0])}
       else Result = -1;
      return Result;
    };
    this.DeleteByRowIndex = function (aRowIndex) {
      var Result = 0;
      Result = this.IndexOfRow(aRowIndex);
      if (Result !== -1) this.FList.splice(Result,1);
      return Result;
    };
    this.Insert = function (aCurrentIndex, aRecordIndex) {
      var Result = 0;
      Result = this.Append(aRecordIndex);
      return Result;
    };
    this.IndexOfRow = function (aRowIndex) {
      var Result = 0;
      Result = this.FList.indexOf(aRowIndex);
      return Result;
    };
  });
  rtl.createClass(this,"TDefaultJSONIndex",this.TJSONIndex,function () {
    this.CreateIndex = function () {
      var I = 0;
      for (var $l = 0, $end = this.FRows.length - 1; $l <= $end; $l++) {
        I = $l;
        this.FList[I] = I;
      };
    };
    this.AppendToIndex = function () {
      var I = 0;
      var L = 0;
      L = this.FList.length;
      this.FList.length = this.FRows.length;
      for (var $l = L, $end = this.FRows.length - 1; $l <= $end; $l++) {
        I = $l;
        this.FList[I] = I;
      };
    };
    this.Append = function (aRecordIndex) {
      var Result = 0;
      Result = this.FList.push(aRecordIndex) - 1;
      return Result;
    };
    this.Insert = function (aCurrentIndex, aRecordIndex) {
      var Result = 0;
      this.FList.splice(aCurrentIndex,0,aRecordIndex);
      Result = aCurrentIndex;
      return Result;
    };
    this.FindRecord = function (aRecordIndex) {
      var Result = 0;
      Result = this.FList.indexOf(aRecordIndex);
      return Result;
    };
    this.Update = function (aRecordIndex) {
      var Result = 0;
      Result = aRecordIndex;
      return Result;
    };
  });
  rtl.createClass(this,"TSortedJSONIndex",this.TJSONIndex,function () {
    this.$init = function () {
      $mod.TJSONIndex.$init.call(this);
      this.FComparer = null;
      this.FUnique = false;
    };
    this.$final = function () {
      this.FComparer = undefined;
      $mod.TJSONIndex.$final.call(this);
    };
    this.FindPos = function (aRecordIndex) {
      var Result = 0;
      var L = 0;
      var R = 0;
      var I = 0;
      var CompareRes = 0;
      if (!(this.FComparer != null)) return Result;
      L = 0;
      R = this.GetCount() - 1;
      while (L <= R) {
        I = L + rtl.trunc((R - L) / 2);
        CompareRes = this.FComparer.CompareRows(aRecordIndex,rtl.trunc(this.FList[I]));
        if (CompareRes > 0) {
          L = I + 1}
         else {
          R = I - 1;
          if (CompareRes === 0) {
            if (this.FUnique) L = I;
          };
        };
      };
      Result = L;
      return Result;
    };
    this.MergeSort = function (aList) {
      var Result = null;
      var temp = null;
      var l = 0;
      var p = 0;
      var q = 0;
      var e = 0;
      var tail = 0;
      var insize = 0;
      var nmerges = 0;
      var psize = 0;
      var qsize = 0;
      if (aList === null) return null;
      l = aList.length;
      Result = new Array(l);
      if (l === 0) return Result;
      insize = 1;
      do {
        p = 0;
        tail = 0;
        nmerges = 0;
        while (p < l) {
          nmerges += 1;
          psize = l - p;
          if (insize < psize) psize = insize;
          q = p + psize;
          qsize = insize;
          while ((psize > 0) || ((qsize > 0) && (q < l))) {
            if (psize === 0) {
              e = q;
              q += 1;
              qsize -= 1;
            } else if ((qsize === 0) || (q >= l)) {
              e = p;
              p += 1;
              psize -= 1;
            } else if (this.FComparer.CompareRows(rtl.trunc(aList[p]),rtl.trunc(aList[q])) <= 0) {
              e = p;
              p += 1;
              psize -= 1;
            } else {
              e = q;
              q += 1;
              qsize -= 1;
            };
            Result[tail] = aList[e];
            tail += 1;
          };
          p = q;
        };
        if (nmerges <= 1) return Result;
        insize = insize * 2;
        temp = Result;
        Result = aList;
        aList = temp;
      } while (!false);
      return Result;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FComparer;
        }, set: function (v) {
          this.p.FComparer = v;
        }});
      pas.System.TObject.Destroy.call(this);
    };
    this.CreateComparer = function (aIndex) {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FComparer;
        }, set: function (v) {
          this.p.FComparer = v;
        }});
      this.FComparer = $mod.TRecordComparer.$create("Create$2",[this.FDataset,aIndex]);
    };
    this.CreateIndex = function () {
      var Lst = [];
      var I = 0;
      var SrcLen = 0;
      var Destlen = 0;
      if (this.FComparer === null) return;
      SrcLen = this.FRows.length;
      Lst = rtl.arraySetLength(Lst,0,SrcLen);
      Destlen = 0;
      for (var $l = 0, $end = SrcLen - 1; $l <= $end; $l++) {
        I = $l;
        if (!pas.JS.isUndefined(this.FRows[I])) {
          Lst[Destlen] = I;
          Destlen += 1;
        };
      };
      Lst = rtl.arraySetLength(Lst,0,Destlen);
      this.FList = this.MergeSort(Lst);
    };
    this.AppendToIndex = function () {
      this.CreateIndex();
    };
    this.Append = function (aRecordIndex) {
      var Result = 0;
      Result = this.FindPos(aRecordIndex);
      this.FList.splice(Result,0,aRecordIndex);
      return Result;
    };
    this.FindRecord = function (aRecordIndex) {
      var Result = 0;
      Result = this.FList.indexOf(aRecordIndex);
      return Result;
    };
    this.Update = function (aRecordIndex) {
      var Result = 0;
      var aCurrentIndex = 0;
      aCurrentIndex = this.FindRecord(aRecordIndex);
      Result = this.FindPos(aRecordIndex);
      if (Result !== aCurrentIndex) this.FList.splice(Result,0,this.FList.splice(aCurrentIndex,1)[0]);
      return Result;
    };
  });
  rtl.createClass(this,"TJSONIndexDef",pas.DB.TIndexDef,function () {
    this.$init = function () {
      pas.DB.TIndexDef.$init.call(this);
      this.FIndex = null;
    };
    this.$final = function () {
      this.FIndex = undefined;
      pas.DB.TIndexDef.$final.call(this);
    };
    this.ClearIndex = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FIndex;
        }, set: function (v) {
          this.p.FIndex = v;
        }});
    };
    this.BuildIndex = function (aDataset) {
      if (this.FIndex === null) {
        this.FIndex = $mod.TSortedJSONIndex.$create("Create$1",[aDataset,aDataset.FRows])}
       else this.FIndex.ClearIndex();
      this.FIndex.CreateComparer(this);
      this.FIndex.CreateIndex();
    };
  });
  rtl.createClass(this,"TJSONIndexDefs",pas.DB.TIndexDefs,function () {
    this.GetD = function (aIndex) {
      var Result = null;
      Result = rtl.as(this.GetItem$1(aIndex),$mod.TJSONIndexDef);
      return Result;
    };
    this.SetD = function (aIndex, AValue) {
      this.SetItem$1(aIndex,AValue);
    };
    this.AddJSONIndexDef = function () {
      var Result = null;
      Result = rtl.as(this.Add(),$mod.TJSONIndexDef);
      return Result;
    };
  });
  this.TBlobFormat = {"0": "bfHex", bfHex: 0, "1": "bfBase64", bfBase64: 1, "2": "bfBytes", bfBytes: 2, "3": "bfCustom", bfCustom: 3};
  this.$rtti.$Enum("TBlobFormat",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TBlobFormat});
  this.$rtti.$Set("TBlobFormats",{comptype: this.$rtti["TBlobFormat"]});
  this.$rtti.$MethodVar("TOnDecodeBlobBytesEvent",{procsig: rtl.newTIProcSig([["Sender",pas.DB.$rtti["TDataSet"]],["aValue",rtl.jsvalue],["aData",pas.SysUtils.$rtti["TBytes"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TOnEncodeBlobBytesEvent",{procsig: rtl.newTIProcSig([["Sender",pas.DB.$rtti["TDataSet"]],["aData",pas.SysUtils.$rtti["TBytes"]],["aValue",rtl.jsvalue,1]]), methodkind: 0});
  rtl.createClass(this,"TBaseJSONDataSet",pas.DB.TDataSet,function () {
    this.$init = function () {
      pas.DB.TDataSet.$init.call(this);
      this.FActiveIndex = "";
      this.FBlobFormat = 0;
      this.FIndexes = null;
      this.FMUS = false;
      this.FOnDecodeBlobValue = null;
      this.FOnEncodeBlobValue = null;
      this.FOwnsData = false;
      this.FDefaultIndex = null;
      this.FCurrentIndex = null;
      this.FCurrent = 0;
      this.FMetaData = null;
      this.FRows = null;
      this.FDeletedRows = null;
      this.FFieldMapper = null;
      this.FEditIdx = 0;
      this.FEditRow = undefined;
      this.FFilterRow = undefined;
      this.FUseDateTimeFormatFields = false;
      this.FRowType = 0;
      this.FFilterExpression = null;
    };
    this.$final = function () {
      this.FIndexes = undefined;
      this.FOnDecodeBlobValue = undefined;
      this.FOnEncodeBlobValue = undefined;
      this.FDefaultIndex = undefined;
      this.FCurrentIndex = undefined;
      this.FMetaData = undefined;
      this.FRows = undefined;
      this.FDeletedRows = undefined;
      this.FFieldMapper = undefined;
      this.FFilterExpression = undefined;
      pas.DB.TDataSet.$final.call(this);
    };
    this.GetFilterField = function (AName) {
      var Result = pas.fpexprpars.TFPExpressionResult.$new();
      var F = null;
      var C = 0;
      F = this.FieldByName(AName);
      Result.ResultType = this.FieldTypeToExpressionType(F.FDataType);
      var $tmp = Result.ResultType;
      if ($tmp === pas.fpexprpars.TResultType.rtBoolean) {
        Result.resValue = F.GetAsBoolean()}
       else if ($tmp === pas.fpexprpars.TResultType.rtInteger) {
        Result.resValue = F.GetAsLargeInt()}
       else if ($tmp === pas.fpexprpars.TResultType.rtFloat) {
        Result.resValue = F.GetAsFloat()}
       else if ($tmp === pas.fpexprpars.TResultType.rtDateTime) {
        Result.resValue = F.GetAsDateTime()}
       else if ($tmp === pas.fpexprpars.TResultType.rtString) {
        Result.resValue = F.GetAsString()}
       else if ($tmp === pas.fpexprpars.TResultType.rtCurrency) {
        C = F.GetAsFloat() * 10000;
        Result.resValue = C / 10000;
      };
      return Result;
    };
    this.SetActiveIndex = function (AValue) {
      if (this.FActiveIndex === AValue) return;
      this.FActiveIndex = AValue;
      if (pas.Classes.TComponentStateItem.csLoading in this.FComponentState) return;
      this.ActivateIndex(this.GetActive());
    };
    this.SetIndexes = function (AValue) {
      if (this.FIndexes === AValue) return;
      this.FIndexes.Assign(AValue);
      if (this.GetActive()) this.BuildIndexes();
    };
    this.SetMetaData = function (AValue) {
      this.CheckInactive();
      this.FMetaData = AValue;
    };
    this.SetRows = function (AValue) {
      if (AValue === this.FRows) return;
      this.CheckInactive();
      this.FRows = null;
      this.AddToRows(AValue);
    };
    this.SetRowType = function (AValue) {
      if (this.FRowType === AValue) return;
      this.CheckInactive();
      this.FRowType = AValue;
    };
    this.RemoveCalcFields = function (Buf) {
      var i = 0;
      for (var $l = 0, $end = this.FFieldList.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.FFieldList.GetField(i).FFieldKind in rtl.createSet(pas.DB.TFieldKind.fkCalculated,pas.DB.TFieldKind.fkInternalCalc,pas.DB.TFieldKind.fkLookup)) this.FFieldMapper.RemoveField(this.FFieldList.GetField(i).FFieldName,this.FFieldList.GetField(i).GetIndex(),Buf);
      };
    };
    this.ActivateIndex = function (Build) {
      var Idx = null;
      if (this.FActiveIndex !== "") {
        Idx = rtl.as(this.FIndexes.Find$1(this.FActiveIndex),$mod.TJSONIndexDef)}
       else Idx = null;
      if (Idx === null) {
        this.FCurrentIndex = this.FDefaultIndex}
       else {
        if ((Idx.FIndex === null) && Build) Idx.BuildIndex(this);
        this.FCurrentIndex = Idx.FIndex;
      };
      if (this.GetActive()) this.Resync(rtl.createSet(pas.DB.TResyncMode$a.rmCenter));
    };
    this.FieldTypeToExpressionType = function (aDataType) {
      var Result = 0;
      var $tmp = aDataType;
      if (($tmp === pas.DB.TFieldType.ftMemo) || ($tmp === pas.DB.TFieldType.ftFixedChar) || ($tmp === pas.DB.TFieldType.ftString)) {
        Result = pas.fpexprpars.TResultType.rtString}
       else if (($tmp === pas.DB.TFieldType.ftInteger) || ($tmp === pas.DB.TFieldType.ftAutoInc) || ($tmp === pas.DB.TFieldType.ftLargeint)) {
        Result = pas.fpexprpars.TResultType.rtInteger}
       else if ($tmp === pas.DB.TFieldType.ftBoolean) {
        Result = pas.fpexprpars.TResultType.rtBoolean}
       else if ($tmp === pas.DB.TFieldType.ftFloat) {
        Result = pas.fpexprpars.TResultType.rtFloat}
       else if (($tmp === pas.DB.TFieldType.ftDate) || ($tmp === pas.DB.TFieldType.ftTime) || ($tmp === pas.DB.TFieldType.ftDateTime)) {
        Result = pas.fpexprpars.TResultType.rtDateTime}
       else {
        pas.DB.DatabaseErrorFmt$1("Fields of type %s are not supported in filter expressions.",pas.System.VarRecs(18,pas.DB.FieldTypeNames[aDataType]),this);
      };
      return Result;
    };
    this.GetFilterIsNull = function (Args) {
      var Result = pas.fpexprpars.TFPExpressionResult.$new();
      Result.ResultType = pas.fpexprpars.TResultType.rtBoolean;
      Result.resValue = this.FieldByName("" + Args[0].resValue).GetIsNull();
      return Result;
    };
    this.FilterExpressionClass = function () {
      var Result = null;
      Result = pas.fpexprpars.TFPExpressionParser;
      return Result;
    };
    this.CreateFilterExpression = function () {
      var Result = null;
      var I = 0;
      Result = this.FilterExpressionClass().$create("Create$1",[this]);
      Result.SetAllowLike(true);
      for (var $l = 0, $end = this.FFieldList.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (!(this.FFieldList.GetField(I).FDataType in rtl.createSet(pas.DB.TFieldType.ftBlob,pas.DB.TFieldType.ftMemo))) Result.FIdentifiers.AddVariable(this.FFieldList.GetField(I).FFieldName,this.FieldTypeToExpressionType(this.FFieldList.GetField(I).FDataType),rtl.createCallback(this,"GetFilterField"));
      };
      Result.FIdentifiers.AddFunction("IsNull","B","S",rtl.createCallback(this,"GetFilterIsNull"));
      Result.SetExpression(this.FFilterText);
      return Result;
    };
    this.DoFilterRecord = function () {
      var Result = false;
      var DS = 0;
      Result = true;
      DS = this.SetTempState(pas.DB.TDataSetState.dsFilter);
      try {
        if (this.FOnFilterRecord != null) {
          this.FOnFilterRecord(this,{get: function () {
              return Result;
            }, set: function (v) {
              Result = v;
            }});
          if (!Result) return Result;
        };
        if (!this.FFiltered || (this.FFilterText === "")) return Result;
        if (this.FFilterExpression === null) this.FFilterExpression = this.CreateFilterExpression();
        Result = this.FFilterExpression.GetAsBoolean();
      } finally {
        this.RestoreState(DS);
      };
      return Result;
    };
    this.CreateIndexDefs = function () {
      var Result = null;
      Result = $mod.TJSONIndexDefs.$create("create$3",[this,this,$mod.TJSONIndexDef]);
      return Result;
    };
    this.RecordComparerClass = function () {
      var Result = null;
      Result = $mod.TRecordComparer;
      return Result;
    };
    this.LocateRecordIndex = function (KeyFields, KeyValues, Options) {
      var Result = 0;
      var Comp = null;
      var RI = 0;
      var I = 0;
      Result = -1;
      Comp = this.RecordComparerClass().$create("Create$1",[this,KeyFields,KeyValues,rtl.refSet(Options)]);
      try {
        if (pas.DB.TLocateOption.loFromCurrent in Options) {
          I = this.FCurrent}
         else I = 0;
        RI = this.FCurrentIndex.GetRecordIndex(I);
        while ((Result === -1) && (RI !== -1)) {
          if (Comp.Compare(RI) === 0) Result = RI;
          I += 1;
          RI = this.FCurrentIndex.GetRecordIndex(I);
        };
      } finally {
        Comp = rtl.freeLoc(Comp);
      };
      return Result;
    };
    this.AllocRecordBuffer = function () {
      var Result = pas.DB.TDataRecord.$new();
      Result.data = new Object();
      Result.bookmark = null;
      Result.state = pas.DB.TRecordState.rsNew;
      return Result;
    };
    this.FreeRecordBuffer = function (Buffer) {
      Buffer.data = null;
      Buffer.bookmark = null;
      Buffer.state = pas.DB.TRecordState.rsNew;
    };
    this.InternalInitRecord = function (Buffer) {
      Buffer.data = this.FFieldMapper.CreateRow();
      Buffer.bookmark = null;
      Buffer.state = pas.DB.TRecordState.rsNew;
    };
    this.GetRecord = function (Buffer, GetMode, DoCheck) {
      var Result = 0;
      var BkmIdx = 0;
      var recordAccepted = false;
      Result = pas.DB.TGetResult.grOK;
      do {
        recordAccepted = true;
        var $tmp = GetMode;
        if ($tmp === pas.DB.TGetMode.gmNext) {
          if (this.FCurrent < (this.FCurrentIndex.GetCount() - 1)) {
            this.FCurrent += 1}
           else Result = pas.DB.TGetResult.grEOF}
         else if ($tmp === pas.DB.TGetMode.gmPrior) {
          if (this.FCurrent > 0) {
            this.FCurrent -= 1}
           else Result = pas.DB.TGetResult.grBOF}
         else if ($tmp === pas.DB.TGetMode.gmCurrent) if ((this.FCurrent < 0) || (this.FCurrent >= this.FCurrentIndex.GetCount())) Result = pas.DB.TGetResult.grEOF;
        if (Result === pas.DB.TGetResult.grOK) {
          BkmIdx = this.FCurrentIndex.GetRecordIndex(this.FCurrent);
          Buffer.data = this.FRows[BkmIdx];
          Buffer.bookmarkFlag = pas.DB.TBookmarkFlag.bfCurrent;
          Buffer.bookmark = BkmIdx;
          this.GetCalcFields(Buffer);
          if (this.FFiltered) {
            this.FFilterRow = Buffer.data;
            recordAccepted = this.DoFilterRecord();
            if (!recordAccepted && (GetMode === pas.DB.TGetMode.gmCurrent)) {
              recordAccepted = true;
              Result = pas.DB.TGetResult.grEOF;
            };
          };
        };
      } while (!recordAccepted);
      return Result;
    };
    this.GetRecordSize = function () {
      var Result = 0;
      Result = 0;
      return Result;
    };
    this.AddToRows = function (AValue) {
      if (this.FRows === null) {
        this.FRows = AValue}
       else {
        this.FRows = this.FRows.concat(AValue);
        this.AppendToIndexes();
      };
    };
    this.InternalClose = function () {
      this.BindFields(false);
      if (this.FDefaultFields) this.DestroyFields();
      this.FreeData();
    };
    this.InternalDelete = function () {
      var I = 0;
      var RowIdx = 0;
      var aIndex = null;
      RowIdx = this.FCurrentIndex.Delete(this.FCurrent);
      if (RowIdx !== -1) {
        for (var $l = 0, $end = this.FIndexes.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          aIndex = this.FIndexes.GetD(I).FIndex;
          if (aIndex !== this.FCurrentIndex) aIndex.DeleteByRowIndex(RowIdx);
        };
        if (!(this.FDeletedRows != null)) {
          this.FDeletedRows = new Array(this.FRows[RowIdx])}
         else this.FDeletedRows.push(this.FRows[RowIdx]);
        this.FRows[RowIdx] = undefined;
      };
    };
    this.InternalFirst = function () {
      this.FCurrent = -1;
    };
    this.InternalLast = function () {
      this.FCurrent = this.FCurrentIndex.GetCount();
    };
    this.InternalOpen = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FFieldMapper;
        }, set: function (v) {
          this.p.FFieldMapper = v;
        }});
      this.FFieldMapper = this.CreateFieldMapper();
      if (this.FRows === null) {
        this.FRows = new Array();
        this.FOwnsData = true;
      };
      this.CreateIndexes();
      this.InternalInitFieldDefs();
      if (this.FDefaultFields) this.CreateFields();
      this.BindFields(true);
      this.InitDateTimeFields();
      if (this.FActiveIndex !== "") this.ActivateIndex(true);
      this.FCurrent = -1;
    };
    this.InternalPost = function () {
      var I = 0;
      var NewIdx = 0;
      var NewCurrent = 0;
      var Idx = 0;
      var B = pas.DB.TBookmark.$new();
      pas.DB.TDataSet.InternalPost.call(this);
      NewCurrent = -1;
      this.GetBookmarkData(pas.DB.TDataRecord.$clone(this.ActiveBuffer()),B);
      if (this.FState === pas.DB.TDataSetState.dsInsert) {
        Idx = this.FRows.push(this.FEditRow) - 1;
        if (this.GetBookmarkFlag(pas.DB.TDataRecord.$clone(this.ActiveBuffer())) === pas.DB.TBookmarkFlag.bfEOF) {
          this.FDefaultIndex.Append(Idx);
          for (var $l = 0, $end = this.FIndexes.GetCount() - 1; $l <= $end; $l++) {
            I = $l;
            if (this.FIndexes.GetD(I).FIndex != null) {
              NewIdx = this.FIndexes.GetD(I).FIndex.Append(Idx);
              if (this.FIndexes.GetD(I).FIndex === this.FCurrentIndex) NewCurrent = NewIdx;
            };
          };
        } else {
          this.FCurrent = this.FDefaultIndex.Insert(this.FCurrent,Idx);
          for (var $l1 = 0, $end1 = this.FIndexes.GetCount() - 1; $l1 <= $end1; $l1++) {
            I = $l1;
            if (this.FIndexes.GetD(I).FIndex != null) {
              NewIdx = this.FIndexes.GetD(I).FIndex.Append(Idx);
              if (this.FIndexes.GetD(I).FIndex === this.FCurrentIndex) NewCurrent = NewIdx;
            };
          };
        };
      } else {
        if (this.FEditIdx === -1) pas.DB.DatabaseErrorFmt("Failed to retrieve record index for record %d",pas.System.VarRecs(0,this.FCurrent));
        Idx = this.FEditIdx;
        this.FRows[Idx] = this.FEditRow;
        this.FDefaultIndex.Update(Idx);
        for (var $l2 = 0, $end2 = this.FIndexes.GetCount() - 1; $l2 <= $end2; $l2++) {
          I = $l2;
          NewIdx = this.FCurrentIndex.Update(Idx);
          if (this.FIndexes.GetD(I).FIndex != null) if (this.FIndexes.GetD(I).FIndex === this.FCurrentIndex) NewCurrent = NewIdx;
        };
      };
      if (NewCurrent !== -1) this.FCurrent = NewCurrent;
      this.FEditIdx = -1;
      this.FEditRow = null;
    };
    this.InternalInsert = function () {
      var I = 0;
      var D = null;
      this.FEditRow = this.ActiveBuffer().data;
      for (var $l = 0, $end = this.FFieldDefs.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        D = this.FFieldDefs.GetItem$1(I);
        this.FFieldMapper.SetJSONDataForField(D.FName,D.GetIndex(),this.FEditRow,null);
      };
    };
    this.InternalEdit = function () {
      this.FEditIdx = this.FCurrentIndex.GetRecordIndex(this.FCurrent);
      if (!pas.JS.isUndefined(this.FRows[this.FEditIdx])) {
        this.FEditRow = this.FFieldMapper.CopyRow(this.FRows[this.FEditIdx]);
      } else this.FEditRow = this.FFieldMapper.CreateRow();
    };
    this.InternalCancel = function () {
      this.FEditIdx = -1;
      this.FEditRow = null;
    };
    this.InternalInitFieldDefs = function () {
      if (this.FMetaData != null) this.MetaDataToFieldDefs();
      if (this.FFieldDefs.GetCount() === 0) throw $mod.EJSONDataset.$create("Create$1",["No fields found"]);
    };
    this.InternalSetToRecord = function (Buffer) {
      this.FCurrent = this.FCurrentIndex.FindRecord(rtl.trunc(Buffer.bookmark));
    };
    this.SetFilterText = function (Value) {
      pas.DB.TDataSet.SetFilterText.call(this,Value);
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FFilterExpression;
        }, set: function (v) {
          this.p.FFilterExpression = v;
        }});
      if (this.GetActive()) this.Resync(rtl.createSet(pas.DB.TResyncMode$a.rmCenter));
    };
    this.SetFiltered = function (Value) {
      pas.DB.TDataSet.SetFiltered.call(this,Value);
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FFilterExpression;
        }, set: function (v) {
          this.p.FFilterExpression = v;
        }});
      if (this.GetActive()) this.Resync(rtl.createSet(pas.DB.TResyncMode$a.rmCenter));
    };
    this.GetFieldClass = function (FieldType) {
      var Result = null;
      if (this.FUseDateTimeFormatFields && (FieldType in rtl.createSet(pas.DB.TFieldType.ftDate,pas.DB.TFieldType.ftDateTime,pas.DB.TFieldType.ftTime))) {
        var $tmp = FieldType;
        if ($tmp === pas.DB.TFieldType.ftDate) {
          Result = $mod.TJSONDateField}
         else if ($tmp === pas.DB.TFieldType.ftDateTime) {
          Result = $mod.TJSONDateTimeField}
         else if ($tmp === pas.DB.TFieldType.ftTime) Result = $mod.TJSONTimeField;
      } else Result = pas.DB.TDataSet.GetFieldClass.call(this,FieldType);
      return Result;
    };
    this.GetApplyUpdateData = function (Buffer) {
      var Result = undefined;
      Result = this.FFieldMapper.CopyRow(Buffer.data);
      this.RemoveCalcFields(Result);
      return Result;
    };
    this.IsCursorOpen = function () {
      var Result = false;
      Result = this.FDefaultIndex != null;
      return Result;
    };
    this.GetBookmarkData = function (Buffer, Data) {
      Data.Data = Buffer.bookmark;
    };
    this.GetBookmarkFlag = function (Buffer) {
      var Result = 0;
      Result = Buffer.bookmarkFlag;
      return Result;
    };
    this.InternalGotoBookmark = function (ABookmark) {
      if (rtl.isNumber(ABookmark.Data)) this.FCurrent = this.FCurrentIndex.FindRecord(rtl.trunc(ABookmark.Data));
    };
    this.SetBookmarkFlag = function (Buffer, Value) {
      Buffer.bookmarkFlag = Value;
    };
    this.SetBookmarkData = function (Buffer, Data) {
      Buffer.bookmark = Data.Data;
    };
    this.GetRecordCount = function () {
      var Result = 0;
      if (this.FCurrentIndex != null) {
        Result = this.FCurrentIndex.GetCount()}
       else Result = 0;
      return Result;
    };
    this.SetRecNo = function (Value) {
      this.CheckBrowseMode();
      this.DoBeforeScroll();
      if ((Value < 1) || (Value > this.FCurrentIndex.GetCount())) throw $mod.EJSONDataset.$create("CreateFmt",["%s: SetRecNo: index %d out of range",pas.System.VarRecs(18,this.FName,0,Value)]);
      this.FCurrent = Value - 1;
      this.Resync({});
      this.DoAfterScroll();
    };
    this.GetRecNo = function () {
      var Result = 0;
      var bkmIdx = 0;
      bkmIdx = rtl.trunc(this.ActiveBuffer().bookmark);
      Result = this.FCurrentIndex.FindRecord(bkmIdx) + 1;
      return Result;
    };
    this.BuildIndexes = function () {
      var I = 0;
      for (var $l = 0, $end = this.FIndexes.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.FIndexes.GetD(I).BuildIndex(this);
      };
    };
    this.FreeData = function () {
      var I = 0;
      if (this.FOwnsData) {
        this.FRows = null;
        this.FMetaData = null;
      };
      for (var $l = 0, $end = this.FIndexes.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.FIndexes.GetD(I).ClearIndex();
      };
      this.FCurrentIndex = null;
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FDefaultIndex;
        }, set: function (v) {
          this.p.FDefaultIndex = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FFieldMapper;
        }, set: function (v) {
          this.p.FFieldMapper = v;
        }});
      this.FCurrentIndex = null;
      this.FDeletedRows = null;
    };
    this.AppendToIndexes = function () {
      this.FDefaultIndex.AppendToIndex();
      if ((this.FCurrentIndex != null) && (this.FCurrentIndex !== this.FDefaultIndex)) this.FCurrentIndex.AppendToIndex();
    };
    this.Clone = function (Source) {
      if (Source.FFieldDefs.GetCount() > 0) {
        this.FFieldDefs.Assign$2(Source.FFieldDefs);
        this.CreateFields();
      } else {
        Source.InitFieldDefsFromfields();
        this.FFieldDefs.Assign$2(Source.FFieldDefs);
        this.CreateFields();
      };
      this.SetRows(Source.FRows);
    };
    this.CreateIndexes = function () {
      this.FDefaultIndex = $mod.TDefaultJSONIndex.$create("Create$1",[this,this.FRows]);
      this.AppendToIndexes();
      if (this.FCurrentIndex === null) this.FCurrentIndex = this.FDefaultIndex;
    };
    this.MetaDataToFieldDefs = function () {
    };
    this.InitDateTimeFields = function () {
    };
    this.ConvertDateTimeField = function (S, F) {
      var Result = 0.0;
      var Ptrn = "";
      Result = 0;
      Ptrn = "";
      var $tmp = F.FDataType;
      if ($tmp === pas.DB.TFieldType.ftDate) {
        if ($mod.TJSONDateField.isPrototypeOf(F)) Ptrn = rtl.as(F,$mod.TJSONDateField).FDateFormat}
       else if ($tmp === pas.DB.TFieldType.ftTime) {
        if ($mod.TJSONTimeField.isPrototypeOf(F)) Ptrn = rtl.as(F,$mod.TJSONTimeField).FTimeFormat}
       else if ($tmp === pas.DB.TFieldType.ftDateTime) if ($mod.TJSONDateTimeField.isPrototypeOf(F)) Ptrn = rtl.as(F,$mod.TJSONDateTimeField).FDateTimeFormat;
      if (Ptrn === "") {
        Result = this.$class.DefaultConvertToDateTime(F,S,true)}
       else Result = pas.DateUtils.ScanDateTime(Ptrn,S,1);
      return Result;
    };
    this.FormatDateTimeField = function (DT, F) {
      var Result = "";
      var Ptrn = "";
      Result = "";
      Ptrn = "";
      var $tmp = F.FDataType;
      if ($tmp === pas.DB.TFieldType.ftDate) {
        if ($mod.TJSONDateField.isPrototypeOf(F)) Ptrn = F.FDateFormat}
       else if ($tmp === pas.DB.TFieldType.ftTime) {
        if ($mod.TJSONTimeField.isPrototypeOf(F)) Ptrn = F.FTimeFormat}
       else if ($tmp === pas.DB.TFieldType.ftDateTime) if ($mod.TJSONDateTimeField.isPrototypeOf(F)) Ptrn = F.FDateTimeFormat;
      if (Ptrn === "") {
        Result = pas.DateUtils.DateTimeToRFC3339(DT)}
       else Result = pas.SysUtils.FormatDateTime(Ptrn,DT);
      return Result;
    };
    this.CreateFieldMapper = function () {
      var Result = null;
      if (this.FRowType === $mod.TJSONRowType.rtJSONArray) {
        Result = $mod.TJSONArrayFieldMapper.$create("Create")}
       else Result = $mod.TJSONObjectFieldMapper.$create("Create");
      return Result;
    };
    this.Create$1 = function (AOwner) {
      pas.DB.TDataSet.Create$1.apply(this,arguments);
      this.FOwnsData = true;
      this.FUseDateTimeFormatFields = false;
      this.FEditIdx = -1;
      this.FIndexes = this.CreateIndexDefs();
      return this;
    };
    this.Destroy = function () {
      this.Close();
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FFilterExpression;
        }, set: function (v) {
          this.p.FFilterExpression = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FIndexes;
        }, set: function (v) {
          this.p.FIndexes = v;
        }});
      this.FEditIdx = -1;
      pas.DB.TDataSet.Destroy.call(this);
    };
    this.BlobDataToBytes = function (aValue) {
      var Result = [];
      Result = [];
      var $tmp = this.FBlobFormat;
      if ($tmp === $mod.TBlobFormat.bfHex) {
        Result = this.$class.DefaultBlobDataToBytes(aValue)}
       else if ($tmp === $mod.TBlobFormat.bfBase64) {
        Result = pas.SysUtils.BytesOf(atob("" + aValue))}
       else if ($tmp === $mod.TBlobFormat.bfBytes) {
        Result = aValue}
       else if ($tmp === $mod.TBlobFormat.bfCustom) if (this.FOnDecodeBlobValue != null) this.FOnDecodeBlobValue(this,aValue,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.BytesToBlobData = function (aValue) {
      var Result = undefined;
      Result = "";
      var $tmp = this.FBlobFormat;
      if ($tmp === $mod.TBlobFormat.bfHex) {
        Result = this.$class.DefaultBytesToBlobData(rtl.arrayRef(aValue))}
       else if ($tmp === $mod.TBlobFormat.bfBase64) {
        Result = btoa(pas.SysUtils.StringOf(aValue));
      } else if ($tmp === $mod.TBlobFormat.bfBytes) {
        Result = aValue}
       else if ($tmp === $mod.TBlobFormat.bfCustom) if (this.FOnEncodeBlobValue != null) this.FOnEncodeBlobValue(this,rtl.arrayRef(aValue),{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.ConvertDateTimeToNative = function (aField, aValue) {
      var Result = undefined;
      if (isNaN(aValue)) {
        Result = null}
       else Result = this.FormatDateTimeField(aValue,aField);
      return Result;
    };
    this.Locate = function (KeyFields, KeyValues, Options) {
      var Result = false;
      var I = 0;
      var BM = pas.DB.TBookmark.$new();
      Result = pas.DB.TDataSet.Locate.apply(this,arguments);
      I = this.LocateRecordIndex(KeyFields,KeyValues,rtl.refSet(Options));
      Result = I !== -1;
      if (Result) {
        BM.Data = I;
        BM.Flag = pas.DB.TBookmarkFlag.bfCurrent;
        this.GotoBookmark(BM);
      };
      return Result;
    };
    this.Lookup = function (KeyFields, KeyValues, ResultFields) {
      var Result = undefined;
      var RI = 0;
      var I = 0;
      var l = null;
      var Vals = [];
      Result = null;
      l = pas.Classes.TFPList.$create("Create");
      try {
        this.GetFieldList$1(l,ResultFields);
        Result = pas.DB.TDataSet.Lookup.call(this,KeyFields,KeyValues,ResultFields);
        RI = this.LocateRecordIndex(KeyFields,KeyValues,{});
        if (RI !== -1) {
          Vals = rtl.arraySetLength(Vals,undefined,l.FCount);
          for (var $l = 0, $end = l.FCount - 1; $l <= $end; $l++) {
            I = $l;
            Vals[I] = this.FFieldMapper.GetJSONDataForField$1(rtl.getObject(l.Get(I)),this.FRows[RI]);
          };
          if (l.FCount === 1) {
            Result = Vals[I]}
           else Result = Vals;
        };
      } finally {
        l = rtl.freeLoc(l);
      };
      return Result;
    };
    this.GetFieldData$1 = function (Field, Buffer) {
      var Result = undefined;
      var R = undefined;
      if (this.FState in rtl.createSet(pas.DB.TDataSetState.dsCalcFields,pas.DB.TDataSetState.dsInternalCalc)) {
        R = this.FCalcBuffer.data}
       else if (this.FState === pas.DB.TDataSetState.dsFilter) {
        R = this.FFilterRow}
       else if (this.FEditIdx == Buffer.bookmark) {
        if (this.FState === pas.DB.TDataSetState.dsOldValue) {
          R = Buffer.data}
         else R = this.FEditRow;
      } else {
        if (this.FState === pas.DB.TDataSetState.dsOldValue) {
          return null}
         else R = Buffer.data;
      };
      Result = this.FFieldMapper.GetJSONDataForField$1(Field,R);
      if (pas.JS.isUndefined(Result)) Result = null;
      return Result;
    };
    this.SetFieldData$1 = function (Field, Buffer, AValue) {
      var R = undefined;
      if (this.FState in rtl.createSet(pas.DB.TDataSetState.dsCalcFields,pas.DB.TDataSetState.dsInternalCalc)) {
        R = this.FCalcBuffer.data}
       else R = this.FEditRow;
      this.FFieldMapper.SetJSONDataForField$1(Field,R,AValue);
      if (!(this.FState in rtl.createSet(pas.DB.TDataSetState.dsCalcFields,pas.DB.TDataSetState.dsInternalCalc,pas.DB.TDataSetState.dsFilter,pas.DB.TDataSetState.dsNewValue))) this.DataEvent(pas.DB.TDataEvent.deFieldChange,Field);
      this.SetModified(true);
    };
    this.GetClonedDataSet = function (WithSettings) {
      var Result = null;
      var DS = null;
      Result = this.FNestedDataSetClass.$create("Create$1",[null]);
      try {
        DS = rtl.as(Result,$mod.TBaseJSONDataSet);
        if (WithSettings) {
          DS.SetFilterText(this.FFilterText);
          DS.SetOnFilterRecord(this.FOnFilterRecord);
          DS.SetFilterOptions(rtl.refSet(this.FFilterOptions));
          DS.SetFiltered(this.FFiltered);
        };
        DS.Clone(this);
        DS.SetActive(this.GetActive());
      } catch ($e) {
        Result = rtl.freeLoc(Result);
        throw $e;
      };
      return Result;
    };
    this.BookmarkValid = function (ABookmark) {
      var Result = false;
      Result = rtl.isNumber(ABookmark.Data);
      return Result;
    };
    this.CompareBookmarks = function (Bookmark1, Bookmark2) {
      var Result = 0;
      if (rtl.isNumber(Bookmark1.Data) && rtl.isNumber(Bookmark2.Data)) {
        Result = rtl.trunc(Bookmark2.Data) - rtl.trunc(Bookmark1.Data)}
       else {
        if (rtl.isNumber(Bookmark1.Data)) {
          Result = -1}
         else if (rtl.isNumber(Bookmark2.Data)) {
          Result = 1}
         else Result = 0;
      };
      return Result;
    };
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TJSONDataset",this.TBaseJSONDataSet,function () {
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("FieldDefs",2,pas.DB.$rtti["TFieldDefs"],"FFieldDefs","SetFieldDefs");
    $r.addProperty("RowType",2,$mod.$rtti["TJSONRowType"],"FRowType","SetRowType");
    $r.addProperty("UseDateTimeFormatFields",0,rtl.boolean,"FUseDateTimeFormatFields","FUseDateTimeFormatFields");
    $r.addProperty("Indexes",2,$mod.$rtti["TJSONIndexDefs"],"FIndexes","SetIndexes");
    $r.addProperty("ActiveIndex",2,rtl.string,"FActiveIndex","SetActiveIndex");
    $r.addProperty("Active",3,rtl.boolean,"GetActive","SetActive",4,{Default: false});
    $r.addProperty("BeforeOpen",0,pas.DB.$rtti["TDataSetNotifyEvent"],"FBeforeOpen","FBeforeOpen");
    $r.addProperty("AfterOpen",0,pas.DB.$rtti["TDataSetNotifyEvent"],"FAfterOpen","FAfterOpen");
    $r.addProperty("BeforeClose",0,pas.DB.$rtti["TDataSetNotifyEvent"],"FBeforeClose","FBeforeClose");
    $r.addProperty("AfterClose",0,pas.DB.$rtti["TDataSetNotifyEvent"],"FAfterClose","FAfterClose");
    $r.addProperty("BeforeInsert",0,pas.DB.$rtti["TDataSetNotifyEvent"],"FBeforeInsert","FBeforeInsert");
    $r.addProperty("AfterInsert",0,pas.DB.$rtti["TDataSetNotifyEvent"],"FAfterInsert","FAfterInsert");
    $r.addProperty("BeforeEdit",0,pas.DB.$rtti["TDataSetNotifyEvent"],"FBeforeEdit","FBeforeEdit");
    $r.addProperty("AfterEdit",0,pas.DB.$rtti["TDataSetNotifyEvent"],"FAfterEdit","FAfterEdit");
    $r.addProperty("BeforePost",0,pas.DB.$rtti["TDataSetNotifyEvent"],"FBeforePost","FBeforePost");
    $r.addProperty("AfterPost",0,pas.DB.$rtti["TDataSetNotifyEvent"],"FAfterPost","FAfterPost");
    $r.addProperty("BeforeCancel",0,pas.DB.$rtti["TDataSetNotifyEvent"],"FBeforeCancel","FBeforeCancel");
    $r.addProperty("AfterCancel",0,pas.DB.$rtti["TDataSetNotifyEvent"],"FAfterCancel","FAfterCancel");
    $r.addProperty("BeforeDelete",0,pas.DB.$rtti["TDataSetNotifyEvent"],"FBeforeDelete","FBeforeDelete");
    $r.addProperty("AfterDelete",0,pas.DB.$rtti["TDataSetNotifyEvent"],"FAfterDelete","FAfterDelete");
    $r.addProperty("BeforeScroll",0,pas.DB.$rtti["TDataSetNotifyEvent"],"FBeforeScroll","FBeforeScroll");
    $r.addProperty("AfterScroll",0,pas.DB.$rtti["TDataSetNotifyEvent"],"FAfterScroll","FAfterScroll");
    $r.addProperty("OnCalcFields",0,pas.DB.$rtti["TDataSetNotifyEvent"],"FOnCalcFields","FOnCalcFields");
    $r.addProperty("OnDeleteError",0,pas.DB.$rtti["TDataSetErrorEvent"],"FOnDeleteError","FOnDeleteError");
    $r.addProperty("OnEditError",0,pas.DB.$rtti["TDataSetErrorEvent"],"FOnEditError","FOnEditError");
    $r.addProperty("OnFilterRecord",2,pas.DB.$rtti["TFilterRecordEvent"],"FOnFilterRecord","SetOnFilterRecord");
    $r.addProperty("OnNewRecord",0,pas.DB.$rtti["TDataSetNotifyEvent"],"FOnNewRecord","FOnNewRecord");
    $r.addProperty("OnPostError",0,pas.DB.$rtti["TDataSetErrorEvent"],"FOnPostError","FOnPostError");
    $r.addProperty("OnRecordResolved",0,pas.DB.$rtti["TOnRecordResolveEvent"],"FOnRecordResolved","FOnRecordResolved");
    $r.addProperty("OnLoadFail",0,pas.DB.$rtti["TDatasetLoadFailEvent"],"FOnLoadFail","FOnLoadFail");
    $r.addProperty("BlobFormat",0,$mod.$rtti["TBlobFormat"],"FBlobFormat","FBlobFormat");
    $r.addProperty("OnDecodeBlobValue",0,$mod.$rtti["TOnDecodeBlobBytesEvent"],"FOnDecodeBlobValue","FOnDecodeBlobValue");
    $r.addProperty("OnEncodeBlobValue",0,$mod.$rtti["TOnEncodeBlobBytesEvent"],"FOnEncodeBlobValue","FOnEncodeBlobValue");
  });
  rtl.createClass(this,"TJSONObjectFieldMapper",this.TJSONFieldMapper,function () {
    this.RemoveField = function (FieldName, FieldIndex, Row) {
      pas.JS.JSDelete(Row,FieldName);
    };
    this.SetJSONDataForField = function (FieldName, FieldIndex, Row, Data) {
      Row[FieldName] = Data;
    };
    this.GetJSONDataForField = function (FieldName, FieldIndex, Row) {
      var Result = undefined;
      Result = Row[FieldName];
      return Result;
    };
    this.CreateRow = function () {
      var Result = undefined;
      Result = new Object();
      return Result;
    };
  });
  rtl.createClass(this,"TJSONArrayFieldMapper",this.TJSONFieldMapper,function () {
    this.RemoveField = function (FieldName, FieldIndex, Row) {
      Row.splice(FieldIndex,1);
    };
    this.SetJSONDataForField = function (FieldName, FieldIndex, Row, Data) {
      Row[FieldIndex] = Data;
    };
    this.GetJSONDataForField = function (FieldName, FieldIndex, Row) {
      var Result = undefined;
      Result = Row[FieldIndex];
      return Result;
    };
    this.CreateRow = function () {
      var Result = undefined;
      Result = new Array();
      return Result;
    };
  });
  rtl.createClass(this,"EJSONDataset",pas.DB.EDatabaseError,function () {
  });
},["DateUtils"]);
rtl.module("XData.Web.JsonDataset",["System","JS","DB","Classes","SysUtils","JSONDataset"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  rtl.createClass(this,"TXDataObjectFieldMapper",pas.JSONDataset.TJSONObjectFieldMapper,function () {
    this.GetPropValue = function (APropName, Obj) {
      var Result = undefined;
      var Value = undefined;
      var Prop = "";
      var SubProp = "";
      if (Obj === null) return null;
      $impl.SplitProp(APropName,{get: function () {
          return Prop;
        }, set: function (v) {
          Prop = v;
        }},{get: function () {
          return SubProp;
        }, set: function (v) {
          SubProp = v;
        }});
      Value = Obj[Prop];
      if (rtl.isObject(Value)) {
        if (SubProp === "") {
          Result = Value}
         else Result = this.GetPropValue(SubProp,Value);
      } else {
        if (SubProp === "") {
          Result = Value}
         else Result = null;
      };
      return Result;
    };
    this.SetJSONDataForField = function (FieldName, FieldIndex, Row, Data) {
      pas.JSONDataset.TJSONObjectFieldMapper.SetJSONDataForField.apply(this,arguments);
    };
    this.GetJSONDataForField = function (FieldName, FieldIndex, Row) {
      var Result = undefined;
      Result = this.GetPropValue(FieldName,Row);
      return Result;
    };
  });
  rtl.createClass(this,"TXDataWebEntityField",pas.DB.TVariantField,function () {
    this.GetAsString = function () {
      var Result = "";
      var V = undefined;
      V = this.GetData();
      if (rtl.isObject(V)) {
        Result = "[object]"}
       else if (pas.JS.isNull(V) || pas.JS.isUndefined(V)) {
        Result = "null"}
       else Result = pas.DB.TVariantField.GetAsString.call(this);
      return Result;
    };
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TXDataWebDatasetField",pas.DB.TVariantField,function () {
    this.GetAsString = function () {
      var Result = "";
      var V = undefined;
      V = this.GetData();
      if (rtl.isArray(V)) {
        Result = "[dataset]"}
       else if (pas.JS.isNull(V) || pas.JS.isUndefined(V)) {
        Result = "null"}
       else Result = pas.DB.TVariantField.GetAsString.call(this);
      return Result;
    };
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TXDataWebCurrencyField",pas.DB.TFloatField,function () {
    this.Create$1 = function (AOwner) {
      pas.DB.TFloatField.Create$1.apply(this,arguments);
      this.SetCurrency(true);
      return this;
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Currency",2,rtl.boolean,"FCurrency","SetCurrency",4,{Default: true});
  });
  rtl.createClass(this,"EXDataDatasetException",pas.SysUtils.Exception,function () {
  });
  rtl.createClass(this,"TXDataJsonDataset",pas.JSONDataset.TBaseJSONDataSet,function () {
    this.MetaDataToFieldDefs = function () {
    };
    this.GetFieldClass = function (FieldType) {
      var Result = null;
      var $tmp = FieldType;
      if ($tmp === pas.DB.TFieldType.ftVariant) {
        Result = $mod.TXDataWebEntityField}
       else if ($tmp === pas.DB.TFieldType.ftDataSet) {
        Result = $mod.TXDataWebDatasetField}
       else {
        Result = pas.JSONDataset.TBaseJSONDataSet.GetFieldClass.call(this,FieldType);
      };
      return Result;
    };
    this.CreateFieldMapper = function () {
      var Result = null;
      Result = $mod.TXDataObjectFieldMapper.$create("Create");
      return Result;
    };
    this.SetJsonData = function (Data) {
      var ArrayData = null;
      if (rtl.isArray(Data)) {
        ArrayData = Data}
       else ArrayData = new Array(Data);
      this.SetRows(ArrayData);
    };
    this.ConvertToDateTime = function (AField, AValue, ARaiseException) {
      var Result = 0.0;
      Result = 0;
      if (rtl.isString(AValue)) {
        if (!pas["Bcl.Utils"].TBclUtils.TryISOToDateTime("" + AValue,{get: function () {
            return Result;
          }, set: function (v) {
            Result = v;
          }}) && ARaiseException) throw pas.SysUtils.EConvertError.$create("CreateFmt",[rtl.getResStr(pas.DBConst,"SErrInvalidDateTime"),pas.System.VarRecs(18,"" + AValue)]);
      } else if (rtl.isNumber(AValue)) Result = rtl.getNumber(AValue);
      return Result;
    };
    this.ConvertDateTimeToNative = function (AField, AValue) {
      var Result = undefined;
      Result = pas["Bcl.Utils"].TBclUtils.DateTimeToISO(AValue,false);
      return Result;
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Indexes",2,pas.JSONDataset.$rtti["TJSONIndexDefs"],"FIndexes","SetIndexes");
    $r.addProperty("Filter",2,rtl.string,"FFilterText","SetFilterText");
    $r.addProperty("Filtered",2,rtl.boolean,"FFiltered","SetFiltered",4,{Default: false});
    $r.addProperty("AfterApplyUpdates",0,pas.DB.$rtti["TApplyUpdatesEvent"],"FAfterApplyUpdates","FAfterApplyUpdates");
    $r.addProperty("BeforeOpen",0,pas.DB.$rtti["TDataSetNotifyEvent"],"FBeforeOpen","FBeforeOpen");
    $r.addProperty("AfterOpen",0,pas.DB.$rtti["TDataSetNotifyEvent"],"FAfterOpen","FAfterOpen");
    $r.addProperty("BeforeClose",0,pas.DB.$rtti["TDataSetNotifyEvent"],"FBeforeClose","FBeforeClose");
    $r.addProperty("AfterClose",0,pas.DB.$rtti["TDataSetNotifyEvent"],"FAfterClose","FAfterClose");
    $r.addProperty("BeforeInsert",0,pas.DB.$rtti["TDataSetNotifyEvent"],"FBeforeInsert","FBeforeInsert");
    $r.addProperty("AfterInsert",0,pas.DB.$rtti["TDataSetNotifyEvent"],"FAfterInsert","FAfterInsert");
    $r.addProperty("BeforeEdit",0,pas.DB.$rtti["TDataSetNotifyEvent"],"FBeforeEdit","FBeforeEdit");
    $r.addProperty("AfterEdit",0,pas.DB.$rtti["TDataSetNotifyEvent"],"FAfterEdit","FAfterEdit");
    $r.addProperty("BeforePost",0,pas.DB.$rtti["TDataSetNotifyEvent"],"FBeforePost","FBeforePost");
    $r.addProperty("AfterPost",0,pas.DB.$rtti["TDataSetNotifyEvent"],"FAfterPost","FAfterPost");
    $r.addProperty("BeforeCancel",0,pas.DB.$rtti["TDataSetNotifyEvent"],"FBeforeCancel","FBeforeCancel");
    $r.addProperty("AfterCancel",0,pas.DB.$rtti["TDataSetNotifyEvent"],"FAfterCancel","FAfterCancel");
    $r.addProperty("BeforeDelete",0,pas.DB.$rtti["TDataSetNotifyEvent"],"FBeforeDelete","FBeforeDelete");
    $r.addProperty("AfterDelete",0,pas.DB.$rtti["TDataSetNotifyEvent"],"FAfterDelete","FAfterDelete");
    $r.addProperty("BeforeScroll",0,pas.DB.$rtti["TDataSetNotifyEvent"],"FBeforeScroll","FBeforeScroll");
    $r.addProperty("AfterScroll",0,pas.DB.$rtti["TDataSetNotifyEvent"],"FAfterScroll","FAfterScroll");
    $r.addProperty("OnCalcFields",0,pas.DB.$rtti["TDataSetNotifyEvent"],"FOnCalcFields","FOnCalcFields");
    $r.addProperty("OnDeleteError",0,pas.DB.$rtti["TDataSetErrorEvent"],"FOnDeleteError","FOnDeleteError");
    $r.addProperty("OnEditError",0,pas.DB.$rtti["TDataSetErrorEvent"],"FOnEditError","FOnEditError");
    $r.addProperty("OnFilterRecord",2,pas.DB.$rtti["TFilterRecordEvent"],"FOnFilterRecord","SetOnFilterRecord");
    $r.addProperty("OnNewRecord",0,pas.DB.$rtti["TDataSetNotifyEvent"],"FOnNewRecord","FOnNewRecord");
    $r.addProperty("OnPostError",0,pas.DB.$rtti["TDataSetErrorEvent"],"FOnPostError","FOnPostError");
  });
  $mod.$implcode = function () {
    $impl.SplitProp = function (AText, AProp, ASubProp) {
      var p = 0;
      p = pas.System.Pos(".",AText);
      if (p === 0) {
        AProp.set(AText);
        ASubProp.set("");
      } else {
        AProp.set(pas.System.Copy(AText,1,p - 1));
        ASubProp.set(pas.System.Copy(AText,p + 1,2147483647));
      };
    };
  };
},["DBConst","Bcl.Utils"]);
rtl.module("XData.Web.DatasetCommon",["System","DB","XData.Model.Classes"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.InitFieldDefsFromEntityType = function (Dataset, EntityType, SubPropsDepth, EnumAsString) {
    if (EntityType === null) {
      Dataset.FFieldDefs.Clear();
      return;
    };
    $impl.AddFieldDefsFromEntityType(Dataset,SubPropsDepth,"",EntityType,0,EnumAsString);
  };
  $mod.$implcode = function () {
    $impl.ftFixedSizeTypes = rtl.createSet(pas.DB.TFieldType.ftInteger,pas.DB.TFieldType.ftBoolean,pas.DB.TFieldType.ftFloat,pas.DB.TFieldType.ftDate,pas.DB.TFieldType.ftTime,pas.DB.TFieldType.ftDateTime,pas.DB.TFieldType.ftAutoInc,pas.DB.TFieldType.ftLargeint);
    $impl.XDataTypeToFieldType = function (AType, ALength, ForceAnsiString, EnumAsString) {
      var Result = 0;
      var IsMemo = false;
      var EnumMember = null;
      var I = 0;
      var $tmp = AType.GetTypeKind();
      if ($tmp === pas["XData.Model.Classes"].TXTypeKind.xtText) {
        IsMemo = ALength.get() > 65535;
        if (IsMemo) {
          Result = pas.DB.TFieldType.ftMemo;
        } else {
          Result = pas.DB.TFieldType.ftString;
        };
      } else if ($tmp === pas["XData.Model.Classes"].TXTypeKind.xtInt32) {
        Result = pas.DB.TFieldType.ftInteger}
       else if ($tmp === pas["XData.Model.Classes"].TXTypeKind.xtInt64) {
        Result = pas.DB.TFieldType.ftLargeint}
       else if ($tmp === pas["XData.Model.Classes"].TXTypeKind.xtDouble) {
        Result = pas.DB.TFieldType.ftFloat}
       else if ($tmp === pas["XData.Model.Classes"].TXTypeKind.xtBoolean) {
        Result = pas.DB.TFieldType.ftBoolean}
       else if ($tmp === pas["XData.Model.Classes"].TXTypeKind.xtDateTime) {
        Result = pas.DB.TFieldType.ftDateTime}
       else if ($tmp === pas["XData.Model.Classes"].TXTypeKind.xtDate) {
        Result = pas.DB.TFieldType.ftDate}
       else if ($tmp === pas["XData.Model.Classes"].TXTypeKind.xtTime) {
        Result = pas.DB.TFieldType.ftTime}
       else if ($tmp === pas["XData.Model.Classes"].TXTypeKind.xtCurrency) {
        Result = pas.DB.TFieldType.ftFloat}
       else if ($tmp === pas["XData.Model.Classes"].TXTypeKind.xtGuid) {
        Result = pas.DB.TFieldType.ftString}
       else if ($tmp === pas["XData.Model.Classes"].TXTypeKind.xtVariant) {
        Result = pas.DB.TFieldType.ftVariant}
       else if ($tmp === pas["XData.Model.Classes"].TXTypeKind.xtBinary) {
        Result = pas.DB.TFieldType.ftBlob}
       else if ($tmp === pas["XData.Model.Classes"].TXTypeKind.xtStream) {
        Result = pas.DB.TFieldType.ftBlob}
       else if ($tmp === pas["XData.Model.Classes"].TXTypeKind.xtInt16) {
        Result = pas.DB.TFieldType.ftInteger}
       else if ($tmp === pas["XData.Model.Classes"].TXTypeKind.xtByte) {
        Result = pas.DB.TFieldType.ftInteger}
       else if ($tmp === pas["XData.Model.Classes"].TXTypeKind.xtSByte) {
        Result = pas.DB.TFieldType.ftInteger}
       else if ($tmp === pas["XData.Model.Classes"].TXTypeKind.xtEnum) {
        if (EnumAsString) {
          Result = pas.DB.TFieldType.ftString;
          if ((ALength.get() === 0) && pas["XData.Model.Classes"].TXDataEnumType.isPrototypeOf(AType)) for (var $l = 0, $end = AType.FMembers.GetCount() - 1; $l <= $end; $l++) {
            I = $l;
            EnumMember = AType.FMembers.GetItem$1(I);
            if (EnumMember.FName.length > ALength.get()) ALength.set(EnumMember.FName.length);
          };
        } else Result = pas.DB.TFieldType.ftInteger}
       else {
        Result = pas.DB.TFieldType.ftUnknown;
      };
      return Result;
    };
    $impl.AddFieldDefsFromEntityType = function (Dataset, SubPropsDepth, APrefix, EntityType, ADepth, EnumAsString) {
      var DataType = 0;
      var Len = 0;
      var FieldDef = null;
      var NavProp = null;
      var Prop = null;
      var I = 0;
      if (EntityType.FBaseType !== null) $impl.AddFieldDefsFromEntityType(Dataset,SubPropsDepth,APrefix,EntityType.FBaseType,ADepth,EnumAsString);
      for (var $l = 0, $end = EntityType.FNavigationProperties.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        NavProp = EntityType.FNavigationProperties.GetItem$1(I);
        if (NavProp.FTarget !== null) {
          if (!NavProp.FTarget.GetIsCollection()) {
            FieldDef = Dataset.FFieldDefs.AddFieldDef();
            FieldDef.SetDisplayName(APrefix + NavProp.FName);
            FieldDef.SetDataType(pas.DB.TFieldType.ftVariant);
            FieldDef.SetRequired(NavProp.FRequired && (ADepth === 0));
            if (ADepth < SubPropsDepth) $impl.AddFieldDefsFromEntityType(Dataset,SubPropsDepth,APrefix + NavProp.FName + ".",NavProp.FTarget,ADepth + 1,EnumAsString);
          } else {
            FieldDef = Dataset.FFieldDefs.AddFieldDef();
            FieldDef.SetDisplayName(APrefix + NavProp.FName);
            FieldDef.SetDataType(pas.DB.TFieldType.ftDataSet);
            FieldDef.SetRequired(false);
            FieldDef.SetAttributes(rtl.unionSet(FieldDef.FAttributes,rtl.createSet(pas.DB.TFieldAttribute.faReadonly)));
          };
        };
      };
      for (var $l1 = 0, $end1 = EntityType.FProperties.GetCount() - 1; $l1 <= $end1; $l1++) {
        I = $l1;
        Prop = EntityType.FProperties.GetItem$1(I);
        if (Prop.FType !== null) {
          Len = Prop.FLength;
          DataType = $impl.XDataTypeToFieldType(Prop.FType,{get: function () {
              return Len;
            }, set: function (v) {
              Len = v;
            }},true,EnumAsString);
          if ((Len === 0) && (DataType in rtl.createSet(pas.DB.TFieldType.ftString))) Len = 255;
          FieldDef = Dataset.FFieldDefs.AddFieldDef();
          FieldDef.SetDisplayName(APrefix + Prop.FName);
          FieldDef.SetDataType(DataType);
          if (!(FieldDef.FDataType in $impl.ftFixedSizeTypes)) FieldDef.SetSize(Len);
          FieldDef.SetRequired(Prop.FRequired);
          FieldDef.SetRequired(FieldDef.FRequired && (ADepth === 0));
        };
      };
    };
  };
},[]);
rtl.module("XData.Web.Dataset",["System","Classes","DB","SysUtils","Types","XData.Web.Client","XData.Web.Connection","XData.Web.DatasetCommon","XData.Web.JsonDataset","XData.Model.Classes","JS"],function () {
  "use strict";
  var $mod = this;
  this.TServerRecordCountMode = {"0": "smNone", smNone: 0, "1": "smInlineCount", smInlineCount: 1};
  this.$rtti.$Enum("TServerRecordCountMode",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TServerRecordCountMode});
  this.$rtti.$RefToProcVar("TProc",{procsig: rtl.newTIProcSig([])});
  rtl.createClass(this,"TXDataWebDataSet",pas["XData.Web.JsonDataset"].TXDataJsonDataset,function () {
    this.$init = function () {
      pas["XData.Web.JsonDataset"].TXDataJsonDataset.$init.call(this);
      this.FEntitySetName = "";
      this.FConnection = null;
      this.FSubpropsDepth = 0;
      this.FQueryString = "";
      this.FServerRecordCountMode = 0;
      this.FQuerySkip = 0;
      this.FQueryTop = 0;
      this.FServerRecordCount = 0;
      this.FDesignLoad = false;
      this.FEnumAsInteger = false;
      this.FOpenResolver = null;
      this.FApplyUpdatesResolver = null;
    };
    this.$final = function () {
      this.FConnection = undefined;
      this.FOpenResolver = undefined;
      this.FApplyUpdatesResolver = undefined;
      pas["XData.Web.JsonDataset"].TXDataJsonDataset.$final.call(this);
    };
    this.SetConnection = function (Value) {
      if (Value !== this.FConnection) {
        this.SetActive(false);
        if (this.FConnection !== null) this.FConnection.RemoveFreeNotification(this);
        this.FConnection = Value;
        if (this.FConnection !== null) this.FConnection.FreeNotification(this);
        this.FFieldDefs.FUpdated = false;
      };
    };
    this.CheckConnected = function () {
      this.CheckConnection();
      if (!this.FConnection.GetConnected()) pas.DB.DatabaseError("Connection not active");
    };
    this.CheckConnection = function () {
      if (this.FConnection === null) pas.DB.DatabaseError("Connection not assigned");
    };
    this.CheckEntitySetName = function () {
      if (this.FEntitySetName === "") pas.DB.DatabaseError("EntitySetName not specified.");
    };
    this.EnsureConnected = function (Proc, ErrorProc) {
      var $Self = this;
      function Success() {
        Proc();
      };
      function OnError(error) {
        ErrorProc(error);
      };
      this.CheckConnection();
      if (this.FConnection.GetConnected()) {
        Proc()}
       else this.FConnection.Open(Success,OnError);
    };
    this.SetEntitySetName = function (Value) {
      if (this.FEntitySetName !== Value) {
        this.FEntitySetName = Value;
        this.FFieldDefs.FUpdated = false;
      };
    };
    this.SetSubpropsDepth = function (Value) {
      if (this.FSubpropsDepth !== Value) {
        this.FSubpropsDepth = Value;
        this.FFieldDefs.FUpdated = false;
      };
    };
    this.SetDesignLoad = function (Value) {
      if (Value !== this.FDesignLoad) {
        this.FDesignLoad = Value;
        if (Value) {
          this.Load$1()}
         else this.Close();
      };
    };
    this.Notification = function (AComponent, Operation) {
      pas.DB.TDataSet.Notification.apply(this,arguments);
      if ((Operation === pas.Classes.TOperation.opRemove) && (AComponent === this.FConnection)) this.SetConnection(null);
    };
    this.InternalInitFieldDefs = function () {
      this.FFieldDefs.Clear();
      if (!(pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) && (this.GetfieldCount() > 0)) {
        this.InitFieldDefsFromfields();
        return;
      };
      this.InitializeFieldDefinitions();
    };
    this.InitializeFieldDefinitions = function () {
      this.CheckConnected();
      this.CheckEntitySetName();
      pas["XData.Web.DatasetCommon"].InitFieldDefsFromEntityType(this,this.FConnection.FModel.GetEntitySet(this.FEntitySetName).FEntityType,this.FSubpropsDepth,!this.FEnumAsInteger);
    };
    this.GetCurrentData = function () {
      var Result = undefined;
      Result = this.ActiveBuffer().data;
      return Result;
    };
    this.InternalClose = function () {
      this.FServerRecordCount = 0;
      pas.JSONDataset.TBaseJSONDataSet.InternalClose.call(this);
    };
    this.DoAfterOpen = function () {
      pas.DB.TDataSet.DoAfterOpen.call(this);
      if (this.FOpenResolver != null) {
        this.FOpenResolver(true);
        this.FOpenResolver = null;
      };
    };
    this.DoAfterApplyUpdates = function (ResolveInfo) {
      pas.DB.TDataSet.DoAfterApplyUpdates.apply(this,arguments);
      if (this.FApplyUpdatesResolver != null) {
        this.FApplyUpdatesResolver(pas.DB.TResolveResults.$clone(ResolveInfo));
        this.FApplyUpdatesResolver = null;
      };
    };
    this.DataPacketReceived = function (ARequest) {
      var Result = false;
      var A = null;
      Result = false;
      if (pas.JS.isNull(ARequest.FData)) return Result;
      if (rtl.isArray(ARequest.FData)) {
        A = ARequest.FData}
       else pas.DB.DatabaseError("Cannot handle data packet");
      Result = A.length > 0;
      this.AddToRows(A);
      return Result;
    };
    this.DoGetDataProxy = function () {
      var Result = null;
      Result = $mod.TXDataDataProxy.$create("Create$1",[this]);
      return Result;
    };
    this.Load$1 = function () {
      var $Self = this;
      function LocalExecute() {
        pas.DB.TDataSet.Load.call($Self,{},null);
      };
      this.EnsureConnected(LocalExecute,null);
    };
    this.LoadAsync = function () {
      var $Self = this;
      var Result = null;
      Result = new Promise(function (ASuccess, AFailed) {
        $Self.EnsureConnected(function () {
          $Self.FOpenResolver = ASuccess;
          try {
            pas.DB.TDataSet.Load.call($Self,{},null);
          } catch ($e) {
            if (pas.SysUtils.Exception.isPrototypeOf($e)) {
              var E = $e;
              if (AFailed != null) {
                AFailed(E)}
               else throw $e;
            } else throw $e
          };
        },function (error) {
          AFailed(error);
        });
      });
      return Result;
    };
    this.ApplyUpdatesAsync = async function () {
      var $Self = this;
      var Result = pas.DB.TResolveResults.$new();
      var promise = null;
      promise = new Promise(function (resolve, reject) {
        $Self.FApplyUpdatesResolver = resolve;
        try {
          $Self.ApplyUpdates();
        } catch ($e) {
          if (pas.SysUtils.Exception.isPrototypeOf($e)) {
            var E = $e;
            if (reject != null) {
              reject(E)}
             else throw $e;
          } else throw $e
        };
      });
      return promise;
      return Result;
    };
    this.ClearPendingUpdates = function () {
      this.InitChangeList();
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("DesignLoad",2,rtl.boolean,"FDesignLoad","SetDesignLoad");
    $r.addProperty("EntitySetName",2,rtl.string,"FEntitySetName","SetEntitySetName");
    $r.addProperty("Connection",2,pas["XData.Web.Connection"].$rtti["TXDataWebConnection"],"FConnection","SetConnection");
    $r.addProperty("SubpropsDepth",2,rtl.longint,"FSubpropsDepth","SetSubpropsDepth",4,{Default: 0});
    $r.addProperty("QueryString",0,rtl.string,"FQueryString","FQueryString");
    $r.addProperty("QueryTop",0,rtl.longint,"FQueryTop","FQueryTop",4,{Default: 0});
    $r.addProperty("QuerySkip",0,rtl.longint,"FQuerySkip","FQuerySkip",4,{Default: 0});
    $r.addProperty("ServerRecordCountMode",0,$mod.$rtti["TServerRecordCountMode"],"FServerRecordCountMode","FServerRecordCountMode",4,{Default: $mod.TServerRecordCountMode.smNone});
    $r.addProperty("EnumAsInteger",0,rtl.boolean,"FEnumAsInteger","FEnumAsInteger",4,{Default: false});
  });
  rtl.createClass(this,"TXDataDataProxy",pas.DB.TDataProxy,function () {
    this.$init = function () {
      pas.DB.TDataProxy.$init.call(this);
      this.FDataset = null;
    };
    this.$final = function () {
      this.FDataset = undefined;
      pas.DB.TDataProxy.$final.call(this);
    };
    this.GetConnection = function () {
      var Result = null;
      Result = this.FDataset.FConnection;
      return Result;
    };
    this.CheckBatchComplete = function (ABatch) {
      var BatchOK = false;
      var I = 0;
      BatchOK = true;
      I = ABatch.FList.FCount - 1;
      while (BatchOK && (I >= 0)) {
        BatchOK = ABatch.FList.GetUpdate(I).FResolveStatus in rtl.createSet(pas.DB.TResolveStatus.rsResolved,pas.DB.TResolveStatus.rsResolveFailed);
        I -= 1;
      };
      if (BatchOK && (ABatch.FOnResolve != null)) ABatch.FOnResolve(this,ABatch);
    };
    this.QueryToObject = function (Query) {
      var Result = null;
      var Params = [];
      var P = 0;
      var I = 0;
      Result = new Object();
      Params = Query.split("&");
      for (var $l = 0, $end = rtl.length(Params) - 1; $l <= $end; $l++) {
        I = $l;
        P = pas.System.Pos("=",Params[I]);
        if (P > 1) Result[pas.System.Copy(Params[I],1,P - 1)] = pas.System.Copy(Params[I],P + 1,2147483647);
      };
      return Result;
    };
    this.ObjectToQuery = function (Obj) {
      var Result = "";
      var Key = "";
      Result = "";
      for (var $in = Object.keys(Obj), $l = 0, $end = rtl.length($in) - 1; $l <= $end; $l++) {
        Key = $in[$l];
        if (Result !== "") Result = Result + "&";
        Result = Result + Key + "=" + pas.JS.ToString(Obj[Key]);
      };
      return Result;
    };
    this.BuildQueryString = function () {
      var Result = "";
      var Query = null;
      Query = this.QueryToObject(this.FDataset.FQueryString);
      if (this.FDataset.FQueryTop !== 0) Query["$top"] = pas.SysUtils.IntToStr(this.FDataset.FQueryTop);
      if (this.FDataset.FQuerySkip !== 0) Query["$skip"] = pas.SysUtils.IntToStr(this.FDataset.FQuerySkip);
      if (this.FDataset.FServerRecordCountMode === $mod.TServerRecordCountMode.smInlineCount) Query["$inlinecount"] = "allpages";
      Result = this.ObjectToQuery(Query);
      return Result;
    };
    this.GetUpdateDescriptorClass = function () {
      var Result = null;
      Result = $mod.TXDataUpdateDescriptor;
      return Result;
    };
    this.ProcessUpdateBatch = function (ABatch) {
      var Result = false;
      var R = null;
      var I = 0;
      var XClient = null;
      var Entity = null;
      I = 0;
      while (I <= (ABatch.FList.FCount - 1)) {
        R = rtl.as(ABatch.FList.GetUpdate(I),$mod.TXDataUpdateDescriptor);
        if (R.FApplying) {
          ABatch.FList.Delete(I)}
         else {
          I += 1;
          R.FBatch = ABatch;
          R.FApplying = true;
          XClient = pas["XData.Web.Client"].TXDataWebClient.$create("Create$1",[null]);
          XClient.SetConnection(this.GetConnection());
          XClient.FOnLoad = rtl.createCallback(R,"OnLoad");
          XClient.FOnError = rtl.createCallback(R,"OnError");
          Entity = R.FData;
          var $tmp = R.FStatus;
          if ($tmp === pas.DB.TUpdateStatus.usInserted) {
            XClient.Post(this.FDataset.FEntitySetName,Entity,"post")}
           else if ($tmp === pas.DB.TUpdateStatus.usModified) {
            XClient.Put(this.FDataset.FEntitySetName,Entity,"put")}
           else if ($tmp === pas.DB.TUpdateStatus.usDeleted) XClient.Delete(this.FDataset.FEntitySetName,Entity,"delete");
        };
      };
      Result = true;
      return Result;
    };
    this.DoGetData = function (ARequest) {
      var Result = false;
      var XClient = null;
      if (!(pas.DB.TLoadOption.loAtEOF in ARequest.FLoadOptions)) {
        XClient = pas["XData.Web.Client"].TXDataWebClient.$create("Create$1",[null]);
        XClient.SetConnection(this.FDataset.FConnection);
        XClient.List$1(this.FDataset.FEntitySetName,this.BuildQueryString(),rtl.createCallback(ARequest,"OnSuccess"),null);
      };
      Result = true;
      return Result;
    };
    this.GetDataRequest = function (aOptions, aAfterRequest, aAfterLoad) {
      var Result = null;
      Result = $mod.TXDataDataRequest.$create("Create$1",[this,rtl.refSet(aOptions),aAfterRequest,aAfterLoad]);
      return Result;
    };
    this.Create$1 = function (AOwner) {
      pas.Classes.TComponent.Create$1.call(this,AOwner);
      if ($mod.TXDataWebDataSet.isPrototypeOf(AOwner)) {
        this.FDataset = rtl.as(AOwner,$mod.TXDataWebDataSet)}
       else throw pas["XData.Web.JsonDataset"].EXDataDatasetException.$create("Create$1",["Proxy created with invalid dataset"]);
      return this;
    };
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TXDataDataRequest",pas.DB.TDataRequest,function () {
    this.OnSuccess = function (Resp) {
      if (Resp.GetStatusCode() === 200) {
        this.FDataProxy.FDataset.FServerRecordCount = Resp.FCount;
        this.FData = Resp.FResult;
        if (rtl.isArray(this.FData)) {
          if (this.FData.length === 0) {
            this.FSuccess = pas.DB.TDataRequestResult.rrEOF}
           else this.FSuccess = pas.DB.TDataRequestResult.rrOK;
        } else {
          this.FSuccess = pas.DB.TDataRequestResult.rrFail;
          this.FErrorMsg = "Result is not an array";
        };
      } else {
        this.FDataProxy.FDataset.FServerRecordCount = 0;
        this.FData = null;
        this.FSuccess = pas.DB.TDataRequestResult.rrFail;
        this.FErrorMsg = Resp.FResponse.GetStatusReason();
      };
      this.DoAfterRequest();
    };
  });
  rtl.createClass(this,"TXDataUpdateDescriptor",pas.DB.TRecordUpdateDescriptor,function () {
    this.$init = function () {
      pas.DB.TRecordUpdateDescriptor.$init.call(this);
      this.FBatch = null;
      this.FApplying = false;
    };
    this.$final = function () {
      this.FBatch = undefined;
      pas.DB.TRecordUpdateDescriptor.$final.call(this);
    };
    this.OnLoad = function (Response) {
      this.Resolve(Response.FResult);
      this.FApplying = false;
      rtl.as(this.FProxy,$mod.TXDataDataProxy).CheckBatchComplete(this.FBatch);
    };
    this.OnError = function (error) {
      this.ResolveFailed(error.FErrorMessage);
      this.FApplying = false;
      rtl.as(this.FProxy,$mod.TXDataDataProxy).CheckBatchComplete(this.FBatch);
    };
  });
});
rtl.module("WEBLib.TMSFNCUtils",["System","Classes","SysUtils","Types","WEBLib.TMSFNCTypes","WEBLib.Graphics","WEBLib.Controls","WEBLib.Forms","JS","WEBLib.Dialogs","WEBLib.JSON","Web"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.PthDel = "/";
  this.FPC_FULLVERSION = 0;
  this.$rtti.$DynArray("TTMSFNCUtilsCharSet",{eltype: rtl.char});
  rtl.recNewT(this,"TTMSFNCUtilsFile",function () {
    this.Data = null;
    this.Name = "";
    this.$eq = function (b) {
      return (this.Data === b.Data) && (this.Name === b.Name);
    };
    this.$assign = function (s) {
      this.Data = s.Data;
      this.Name = s.Name;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCUtilsFile",{},this);
    $r.addField("Data",pas.JS.$rtti["TJSUint8Array"]);
    $r.addField("Name",rtl.string);
  });
  this.$rtti.$MethodVar("TTMSFNCUtilsLoadFileCompleteEvent",{procsig: rtl.newTIProcSig([["AFile",this.$rtti["TTMSFNCUtilsFile"],2]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCUtilsFileCallBackEvent",{procsig: rtl.newTIProcSig([["AFile",rtl.string,2],["AResult",rtl.boolean,2]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCUtils",pas.System.TObject,function () {
    this.GetTimeZoneInfo = function (ADateTime, ABias, ABiasDay, AIsDaylight) {
      var bias = 0;
      var biasday = 0;
      var isDaylight = false;
      Date.prototype.stdTimezoneOffset = function () {
              var jan = new Date(this.getFullYear(), 0, 1);
              var jul = new Date(this.getFullYear(), 6, 1);
              return Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());
          }
      
          Date.prototype.isDstObserved = function () {
              return this.getTimezoneOffset() < this.stdTimezoneOffset();
          }
          var dt = new Date();
          bias = dt.getTimezoneOffset();
          biasday = dt.stdTimezoneOffset();
          isDaylight = dt.isDstObserved();
      ABias.set(bias);
      ABiasDay.set(biasday);
      AIsDaylight.set(isDaylight);
    };
    this.OpenURL = function (AURL) {
      window.open(AURL, '_blank');
    };
    this.OpenFile = function (AFile, AControlReference) {
    };
    this.GetFonts = function (FontList) {
      FontList.BeginUpdate();
      FontList.Add("Arial");
      FontList.Add("Tahoma");
      FontList.Add("SimSun");
      FontList.Add("Arial Unicode MS");
      FontList.Add("Helvetica");
      FontList.Add("Times New Roman");
      FontList.Add("Times");
      FontList.Add("Courier New");
      FontList.Add("Courier");
      FontList.Add("Verdana");
      FontList.Add("Georgia");
      FontList.Add("Palatino");
      FontList.Add("Garamond");
      FontList.Add("Bookman");
      FontList.Add("Comic Sans MS");
      FontList.Add("Trebuchet MS");
      FontList.Add("Arial Black");
      FontList.Add("Impact");
      FontList.Add("Roboto");
      FontList.Sort();
      FontList.EndUpdate();
    };
    this.SetFontSize = function (AFont, ASize, AScaleFactor) {
      AFont.SetSize(Math.round((ASize / 96) * 72));
    };
    this.ScaleForCurrentDPI = function (AForm) {
      if (AForm != null) ;
    };
    this.ScaleForDPI = function (AControl, ADPI) {
    };
    this.GetHInstance = function () {
      var Result = 0;
      Result = pas["WEBLib.TMSFNCTypes"].HInstance();
      return Result;
    };
    this.IsHTMLUnicode = function (AValue) {
      var Result = false;
      Result = this.IsHTML(AValue);
      return Result;
    };
    this.IsHTML = function (AValue) {
      var Result = false;
      Result = (pas.System.Pos("</",AValue) > 0) || (pas.System.Pos("/>",AValue) > 0) || (pas.System.Pos("<BR>",pas.SysUtils.UpperCase(AValue)) > 0);
      return Result;
    };
    this.GetDocumentsPath = function () {
      var Result = "";
      Result = "";
      return Result;
    };
    this.GetAppPath = function () {
      var Result = "";
      Result = "file://";
      return Result;
    };
    this.GetTempPath = function () {
      var Result = "";
      Result = "";
      return Result;
    };
    this.GetMousePos = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var p = pas.Types.TPoint.$new();
      Result.$assign(pas["WEBLib.TMSFNCTypes"].PointF(-1,-1));
      p.$assign(pas["WEBLib.Controls"].GetMousePos());
      Result.$assign(pas["WEBLib.TMSFNCTypes"].PointF(p.x,p.y));
      return Result;
    };
    this.IsHighDPIScale = function (AOwner, ADefaultDPI) {
      var Result = false;
      Result = this.GetDPIScale(AOwner,ADefaultDPI) > 1;
      return Result;
    };
    this.GetDPIScale = function (AOwner, ADefaultDPI) {
      var Result = 0.0;
      Result = 1.0;
      return Result;
    };
    this.AddBackslash = function (AValue) {
      var Result = "";
      if ((AValue.length >= 1) && (AValue.charAt(AValue.length - 1) !== $mod.PthDel)) {
        Result = AValue + $mod.PthDel}
       else Result = AValue;
      return Result;
    };
    this.AddForwardslash = function (AValue) {
      var Result = "";
      if ((AValue.length >= 1) && (AValue.charAt(AValue.length - 1) !== "/")) {
        Result = AValue + "/"}
       else Result = AValue;
      return Result;
    };
    this.GetResourceStream = function (AResourceName) {
      var Result = null;
      Result = this.GetResourceStream$1(AResourceName,this.GetHInstance());
      return Result;
    };
    this.GetResourceStream$1 = function (AResourceName, AInstance) {
      rtl.rc(AInstance,0,9007199254740991);
      var Result = null;
      Result = null;
      return Result;
    };
    this.Clone = function (AComponent) {
      var Result = null;
      Result = null;
      throw pas.SysUtils.Exception.$create("Create$1",["Implement Clone"]);
      return Result;
    };
    this.HTMLStrip = function (AHTML) {
      var Result = "";
      var TagPos = 0;
      Result = "";
      while (pas.System.Pos("<BR>",pas.SysUtils.UpperCase(AHTML)) > 0) AHTML = pas.SysUtils.StringReplace(AHTML,"<BR>",String.fromCharCode(13) + String.fromCharCode(10),rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfIgnoreCase));
      while (pas.System.Pos("<HR>",pas.SysUtils.UpperCase(AHTML)) > 0) AHTML = pas.SysUtils.StringReplace(AHTML,"<HR>",String.fromCharCode(13) + String.fromCharCode(10),rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfIgnoreCase));
      TagPos = 0;
      while (this.VarPos("<",AHTML,{get: function () {
          return TagPos;
        }, set: function (v) {
          rtl.rc(v,-2147483648,2147483647);
          TagPos = v;
        }}) > 0) {
        Result = Result + pas.System.Copy(AHTML,1,TagPos - 1);
        if (this.VarPos(">",AHTML,{get: function () {
            return TagPos;
          }, set: function (v) {
            rtl.rc(v,-2147483648,2147483647);
            TagPos = v;
          }}) > 0) {
          pas.System.Delete({get: function () {
              return AHTML;
            }, set: function (v) {
              AHTML = v;
            }},1,TagPos)}
         else break;
      };
      Result = Result + AHTML;
      return Result;
    };
    this.VarPos = function (ASubValue, AValue, AResult) {
      rtl.rc(AResult.get(),-2147483648,2147483647);
      var Result = 0;
      AResult.set(pas.System.Pos(ASubValue,AValue));
      Result = rtl.rc(AResult.get(),-2147483648,2147483647);
      return Result;
    };
    this.VarPosNoCase = function (ASubValue, AValue, AResult) {
      rtl.rc(AResult.get(),-2147483648,2147483647);
      var Result = 0;
      AResult.set(pas.System.Pos(pas.SysUtils.UpperCase(ASubValue),pas.SysUtils.UpperCase(AValue)));
      Result = rtl.rc(AResult.get(),-2147483648,2147483647);
      return Result;
    };
    this.CharInStr = function (s, Index) {
      var Result = "\x00";
      Result = "\x00";
      if ((Index > 0) && (Index <= s.length)) {
        Result = s.charAt(Index - 1);
      };
      return Result;
    };
    this.HexStrToBytes = function (AValue) {
      var Result = [];
      var il = 0;
      var idx = 0;
      var b = [];
      Result = [];
      b = rtl.arraySetLength(b,0,rtl.trunc(AValue.length / 2));
      il = 1;
      idx = 0;
      while (il <= AValue.length) {
        b[idx] = pas.SysUtils.StrToInt("$" + AValue.charAt(il - 1) + AValue.charAt((il + 1) - 1));
        il = il + 2;
        idx = idx + 1;
      };
      Result = rtl.arrayRef(b);
      return Result;
    };
    this.URLDecode = function (AURL, ATrim) {
      var Result = "";
      if (AURL === "") {
        Result = "";
        return Result;
      };
      Result = decodeURIComponent(AURL);
      return Result;
    };
    this.URLEncode = function (AURL) {
      var Result = "";
      Result = encodeURIComponent(AURL);
      return Result;
    };
    this.EnDeCrypt = function (AValue) {
      var Result = "";
      var r = "";
      var i = 0;
      var c = "\x00";
      var b = 0;
      r = "";
      for (var $l = 1, $end = AValue.length; $l <= $end; $l++) {
        i = $l;
        b = AValue.charCodeAt(i - 1);
        b = (b & 0xE0) + ((b & 0x1F) ^ 5);
        c = String.fromCharCode(b);
        r = r + c;
      };
      Result = r;
      return Result;
    };
    this.SaveStreamToHexStr = function (AStream) {
      var Result = "";
      var s = "";
      var K = 0;
      var bt = [];
      s = "";
      AStream.SetPosition(0);
      for (var $l = 1, $end = AStream.GetSize(); $l <= $end; $l++) {
        K = $l;
        bt = rtl.arraySetLength(bt,0,1);
        AStream.Read({get: function () {
            return bt;
          }, set: function (v) {
            bt = v;
          }},1);
        s = s + pas.SysUtils.IntToHex(bt[0],2);
      };
      Result = s;
      return Result;
    };
    this.SaveStreamToBase64 = function (AStream, AURL) {
      var Result = "";
      var s = "";
      var a = [];
      s = "";
      Result = "";
      if (AStream.GetSize() < 1) return Result;
      AStream.SetPosition(0);
      a = rtl.arraySetLength(a,0,AStream.GetSize());
      AStream.Read({get: function () {
          return a;
        }, set: function (v) {
          a = v;
        }},AStream.GetSize());
      Result = $mod.TTMSFNCUtils.Encode64$1(a,AURL);
      return Result;
    };
    this.SaveBitmapToHexStr = function (ABitmap) {
      var Result = "";
      var ms = null;
      var s = "";
      var img = null;
      var ss = null;
      ms = pas.Classes.TMemoryStream.$create("Create");
      try {
        s = "";
        if (!ABitmap.Empty()) {
          img = ABitmap.Image();
          var canvas = document.createElement("canvas");
          canvas.width = img.width;
          canvas.height = img.height;
          var ctx = canvas.getContext("2d");
          ctx.drawImage(img, 0, 0);
          var dataURL = canvas.toDataURL("image/png");
          s = dataURL;
          ss = pas.Classes.TStringStream.$create("Create$2",[s]);
          try {
            s = this.SaveStreamToHexStr(ss);
          } finally {
            ss = rtl.freeLoc(ss);
          };
        };
        Result = s;
      } finally {
        ms = rtl.freeLoc(ms);
      };
      return Result;
    };
    this.SaveBitmapToBase64 = function (ABitmap, AURL) {
      var Result = "";
      var ms = null;
      var s = "";
      var img = null;
      var ss = null;
      ms = pas.Classes.TMemoryStream.$create("Create");
      try {
        s = "";
        if (!ABitmap.Empty()) {
          img = ABitmap.Image();
          var canvas = document.createElement("canvas");
          canvas.width = img.width;
          canvas.height = img.height;
          var ctx = canvas.getContext("2d");
          ctx.drawImage(img, 0, 0);
          var dataURL = canvas.toDataURL("image/png");
          s = dataURL;
        };
        Result = s;
      } finally {
        ms = rtl.freeLoc(ms);
      };
      return Result;
    };
    this.CreateBitmapFromHexStr = function (AHexStr) {
      var Result = null;
      Result = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      this.LoadBitmapFromHexStr(AHexStr,Result);
      return Result;
    };
    this.CreateBitmapFromBase64 = function (ABase64, AURL) {
      var Result = null;
      Result = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      this.LoadBitmapFromBase64(ABase64,Result,AURL);
      return Result;
    };
    this.MulDivInt = function (nNumber, nNumerator, nDenominator) {
      var $Self = this;
      var Result = 0;
      function MathRound(AValue) {
        var Result = 0;
        if (AValue >= 0) {
          Result = pas.System.Trunc(AValue + 0.5)}
         else Result = pas.System.Trunc(AValue - 0.5);
        return Result;
      };
      if (nDenominator === 0) {
        Result = -1}
       else Result = MathRound((nNumber * nNumerator) / nDenominator);
      return Result;
    };
    this.MulDivSingle = function (nNumber, nNumerator, nDenominator) {
      var Result = 0.0;
      if (nDenominator === 0) {
        Result = -1}
       else Result = (nNumber * nNumerator) / nDenominator;
      return Result;
    };
    var Measure = ["Bytes","KB","MB","GB","TB"];
    this.FormatBytesAsString = function (ASize) {
      var Result = "";
      var NewSize = 0.0;
      var i = 0;
      Result = "";
      if (ASize > -1) {
        i = 0;
        NewSize = ASize;
        while (NewSize >= 1024) {
          NewSize = NewSize / 1024;
          i += 1;
        };
        var $tmp = i;
        if ($tmp === 0) {
          Result = pas.SysUtils.FloatToStr(NewSize)}
         else if (($tmp === 1) || ($tmp === 2) || ($tmp === 3) || ($tmp === 4)) {
          Result = pas.SysUtils.FormatFloat("0.00",NewSize)}
         else {
          Result = pas.SysUtils.FloatToStr(NewSize);
        };
        Result = Result + " " + Measure[i];
      };
      return Result;
    };
    this.GetImageType = function (AData, AResetPosition) {
      var Result = "";
      Result = "";
      throw pas.SysUtils.Exception.$create("Create$1",["Implement GetImageType"]);
      return Result;
    };
    this.LoadStreamFromHexStr = function (AHexStr, AStream) {
      var sst = null;
      var bst = null;
      var M = 0;
      var bt = [];
      sst = pas.Classes.TStringStream.$create("Create$2",[AHexStr]);
      bst = pas.Classes.TBytesStream.$create("Create");
      try {
        for (var $l = 1, $end = rtl.trunc(sst.GetSize() / 2); $l <= $end; $l++) {
          M = $l;
          bt = this.HexStrToBytes(sst.ReadString(2));
          bst.Write(bt,rtl.length(bt));
        };
        bst.SetPosition(0);
        AStream.CopyFrom(bst,bst.GetSize());
      } finally {
        sst = rtl.freeLoc(sst);
        bst = rtl.freeLoc(bst);
      };
    };
    this.LoadStreamFromBase64 = function (ABase64, AStream, AURL) {
      var b = [];
      b = $mod.TTMSFNCUtils.Decode64ToBytes(ABase64,AURL);
      AStream.Write(b,rtl.length(b));
    };
    this.LoadBitmapFromHexStr = function (AHexStr, ABitmap) {
      var sst = null;
      var sb = null;
      var bst = null;
      var M = 0;
      var bt = [];
      var hx = "";
      sst = pas.Classes.TStringStream.$create("Create$2",[AHexStr]);
      bst = pas.Classes.TBytesStream.$create("Create");
      try {
        for (var $l = 1, $end = rtl.trunc(sst.GetSize() / 2); $l <= $end; $l++) {
          M = $l;
          bt = this.HexStrToBytes(sst.ReadString(2));
          bst.Write(bt,rtl.length(bt));
        };
        bst.SetPosition(0);
        hx = "";
        sb = pas.Classes.TStringStream.$create("Create$2",[""]);
        try {
          sb.CopyFrom(bst,bst.GetSize());
          hx = sb.GetDataString();
        } finally {
          sb = rtl.freeLoc(sb);
        };
        if (!(pas.System.Pos(";base64,",hx) > 0)) {
          ABitmap.LoadFromStream(bst);
        } else {
          ABitmap.LoadFromResource(hx);
        };
      } finally {
        sst = rtl.freeLoc(sst);
        bst = rtl.freeLoc(bst);
      };
    };
    this.LoadBitmapFromBase64 = function (ABase64, ABitmap, AURL) {
      var s = "";
      s = ABase64;
      if (!(pas.System.Pos(";base64,",s) > 0)) s = "data:image/png;base64," + s;
      ABitmap.LoadFromResource(s);
    };
    this.ConvertBitmapToJPEGStream = function (ABitmap, AQuality, ABackgroundColor) {
      var Result = null;
      Result = null;
      throw pas.SysUtils.Exception.$create("Create$1",["ConvertBitmapToJPEGStream"]);
      return Result;
    };
    this.Split = function (ADelimiter, AInput, AStrings, AClearEmptyStrings) {
      rtl.rcc(ADelimiter,0,65535);
      var C = 0;
      AStrings.Clear();
      AStrings.SetDelimiter(ADelimiter);
      AStrings.FStrictDelimiter = true;
      AStrings.SetDelimitedText(AInput);
      if (AClearEmptyStrings) {
        for (var $l = AStrings.GetCount() - 1; $l >= 0; $l--) {
          C = $l;
          if (AStrings.Get(C) === "") AStrings.Delete(C);
        };
      };
    };
    this.Split$1 = function (ADelimiter, AInput, AClearEmptyStrings) {
      rtl.rcc(ADelimiter,0,65535);
      var Result = [];
      var SL = null;
      var I = 0;
      SL = pas.Classes.TStringList.$create("Create$1");
      try {
        $mod.TTMSFNCUtils.Split(ADelimiter,AInput,SL,AClearEmptyStrings);
        Result = rtl.arraySetLength(Result,"",SL.GetCount());
        for (var $l = 0, $end = SL.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          rtl.rcArrW(Result,I,SL.Get(I));
        };
      } finally {
        SL = rtl.freeLoc(SL);
      };
      return Result;
    };
    this.Log = function (AMessage) {
      var m = "";
      m = AMessage;
      console.log(m);
    };
    this.EpochToDateTime = function (AEpoch) {
      var Result = 0.0;
      var dw = 0;
      dw = pas.SysUtils.StrToInt(AEpoch);
      Result = pas.DateUtils.UnixToDateTime(dw,true);
      return Result;
    };
    this.SplitURL = function (AURL, AHost, APath, AQuery, APort) {
      rtl.rc(APort.get(),-2147483648,2147483647);
      var p = 0;
      var off = 0;
      var portVal = 0;
      p = rtl.rc(pas.System.Pos("?",AURL),-2147483648,2147483647);
      if (p > 0) {
        AQuery.set(pas.System.Copy(AURL,p + 1,AURL.length));
        AURL = pas.System.Copy(AURL,0,p - 1);
      } else AQuery.set("");
      if (pas.System.Pos("http",pas.SysUtils.LowerCase(AURL)) === 0) AURL = "https://" + AURL;
      off = 9;
      p = rtl.rc(pas.System.Pos$1("/",AURL,off),-2147483648,2147483647);
      if (p > 0) {
        APath.set(pas.System.Copy(AURL,p,AURL.length));
        AURL = pas.System.Copy(AURL,0,p - 1);
      } else APath.set("");
      p = rtl.rc(pas.System.Pos$1(":",AURL,off),-2147483648,2147483647);
      if (p > 0) {
        portVal = 0;
        pas.SysUtils.TryStrToInt(pas.System.Copy(AURL,p + 1,AURL.length),{get: function () {
            return portVal;
          }, set: function (v) {
            rtl.rc(v,-2147483648,2147483647);
            portVal = v;
          }});
        APort.set(portVal);
        AURL = pas.SysUtils.TStringHelper.Substring$1.call({get: function () {
            return AURL;
          }, set: function (v) {
            AURL = v;
          }},0,p - 1);
      } else APort.set(0);
      AHost.set(AURL);
    };
    this.PlayAudio = function (AAudioBase64) {
      var b64 = "";
      try {
        b64 = AAudioBase64;
        try {
          var snd = new Audio("data:audio/wav;base64," + b64);
          snd.play();
        } finally {
        };
      } finally {
      };
    };
    this.DateTimeToISO = function (ADateTime, AAddDelimiters, AAddMilliSeconds) {
      var $Self = this;
      var Result = "";
      var da = 0;
      var mo = 0;
      var ye = 0;
      var ho = 0;
      var mi = 0;
      var se = 0;
      var ms = 0;
      var dd = "";
      var td = "";
      var msec = "";
      function IntToZStr(i, l) {
        var Result = "";
        var Res = "";
        Res = pas.SysUtils.IntToStr(i);
        while (Res.length < l) Res = "0" + Res;
        Result = Res;
        return Result;
      };
      if (AAddDelimiters) {
        dd = "-";
        td = ":";
      };
      pas.SysUtils.DecodeDate(ADateTime,{get: function () {
          return ye;
        }, set: function (v) {
          ye = v;
        }},{get: function () {
          return mo;
        }, set: function (v) {
          mo = v;
        }},{get: function () {
          return da;
        }, set: function (v) {
          da = v;
        }});
      pas.SysUtils.DecodeTime(ADateTime,{get: function () {
          return ho;
        }, set: function (v) {
          ho = v;
        }},{get: function () {
          return mi;
        }, set: function (v) {
          mi = v;
        }},{get: function () {
          return se;
        }, set: function (v) {
          se = v;
        }},{get: function () {
          return ms;
        }, set: function (v) {
          ms = v;
        }});
      if (AAddMilliSeconds) msec = "." + IntToZStr(ms,3) + "Z";
      Result = IntToZStr(ye,4) + dd + IntToZStr(mo,2) + dd + IntToZStr(da,2) + "T" + IntToZStr(ho,2) + td + IntToZStr(mi,2) + td + IntToZStr(se,2) + msec;
      return Result;
    };
    this.DateToISO = function (ADate, AAddDelimiters) {
      var $Self = this;
      var Result = "";
      var da = 0;
      var mo = 0;
      var ye = 0;
      var dd = "";
      function IntToZStr(i, l) {
        var Result = "";
        var Res = "";
        Res = pas.SysUtils.IntToStr(i);
        while (Res.length < l) Res = "0" + Res;
        Result = Res;
        return Result;
      };
      if (AAddDelimiters) dd = "-";
      pas.SysUtils.DecodeDate(ADate,{get: function () {
          return ye;
        }, set: function (v) {
          ye = v;
        }},{get: function () {
          return mo;
        }, set: function (v) {
          mo = v;
        }},{get: function () {
          return da;
        }, set: function (v) {
          da = v;
        }});
      Result = IntToZStr(ye,4) + dd + IntToZStr(mo,2) + dd + IntToZStr(da,2);
      return Result;
    };
    var STimePrefix = "T";
    this.ISOToDateTime = function (AISOString, AIsUTC) {
      var $Self = this;
      var Result = 0.0;
      var TimeString = "";
      var DateString = "";
      var TimePosition = 0;
      var SignPosition = 0;
      var da = 0;
      var mo = 0;
      var ye = 0;
      var ho = 0;
      var mi = 0;
      var se = 0;
      var HourOffset = 0;
      var MinuteOffset = 0;
      var err = 0;
      var sign = "";
      var s = "";
      var dt = 0.0;
      var dtt = 0.0;
      function AdjustDateTime(ADate, AHourOffset, AMinuteOffset) {
        var Result = 0.0;
        var AdjustDT = 0.0;
        var BiasLocal = 0;
        var BiasTime = 0;
        var BiasHour = 0;
        var BiasMins = 0;
        var BiasDT = 0.0;
        Result = ADate;
        if (AIsUTC) {
          if ((AHourOffset !== 0) || (AMinuteOffset !== 0)) {
            AdjustDT = pas.SysUtils.EncodeTime(Math.abs(AHourOffset),Math.abs(AMinuteOffset),0,0);
            if (((AHourOffset * 60) + AMinuteOffset) > 0) {
              Result = Result - AdjustDT}
             else Result = Result + AdjustDT;
          };
        } else {
          var dt = new Date();
          BiasLocal = dt.getTimezoneOffset();
          BiasTime = (AHourOffset * 60) + AMinuteOffset;
          if ((BiasLocal + BiasTime) === 0) return Result;
          BiasLocal = BiasLocal + BiasTime;
          BiasHour = rtl.trunc(Math.abs(BiasLocal) / 60);
          BiasMins = Math.abs(BiasLocal) % 60;
          BiasDT = pas.SysUtils.EncodeTime(BiasHour,BiasMins,0,0);
          if (BiasLocal > 0) {
            Result = Result - BiasDT}
           else Result = Result + BiasDT;
        };
        return Result;
      };
      Result = 0;
      s = AISOString;
      HourOffset = 0;
      MinuteOffset = 0;
      TimePosition = pas.System.Pos(STimePrefix,s);
      if (TimePosition >= 0) {
        DateString = pas.System.Copy(s,0,TimePosition);
        TimeString = pas.System.Copy(s,TimePosition + 1,s.length);
      };
      pas.System.val$5(pas.System.Copy(s,1,4),{get: function () {
          return ye;
        }, set: function (v) {
          ye = v;
        }},{get: function () {
          return err;
        }, set: function (v) {
          err = v;
        }});
      if (err > 0) return Result;
      pas.System.val$5(pas.System.Copy(s,6,2),{get: function () {
          return mo;
        }, set: function (v) {
          mo = v;
        }},{get: function () {
          return err;
        }, set: function (v) {
          err = v;
        }});
      if (err > 0) return Result;
      pas.System.val$5(pas.System.Copy(s,9,2),{get: function () {
          return da;
        }, set: function (v) {
          da = v;
        }},{get: function () {
          return err;
        }, set: function (v) {
          err = v;
        }});
      if (err > 0) return Result;
      pas.System.val$5(pas.System.Copy(s,12,2),{get: function () {
          return ho;
        }, set: function (v) {
          ho = v;
        }},{get: function () {
          return err;
        }, set: function (v) {
          err = v;
        }});
      if (err > 0) return Result;
      pas.System.val$5(pas.System.Copy(s,15,2),{get: function () {
          return mi;
        }, set: function (v) {
          mi = v;
        }},{get: function () {
          return err;
        }, set: function (v) {
          err = v;
        }});
      if (err > 0) return Result;
      pas.System.val$5(pas.System.Copy(s,18,2),{get: function () {
          return se;
        }, set: function (v) {
          se = v;
        }},{get: function () {
          return err;
        }, set: function (v) {
          err = v;
        }});
      if (err > 0) return Result;
      if (ye < 1) ye = 1;
      if (mo < 1) mo = 1;
      if (da < 1) da = 1;
      if (pas.System.Pos(".",s) > 0) {
        SignPosition = 24}
       else SignPosition = 20;
      if (s.length > SignPosition) {
        sign = pas.System.Copy(s,SignPosition,1);
        if ((sign === "-") || (sign === "+")) {
          pas.System.val$6(pas.System.Copy(s,SignPosition + 1,2),{get: function () {
              return HourOffset;
            }, set: function (v) {
              HourOffset = v;
            }},{get: function () {
              return err;
            }, set: function (v) {
              err = v;
            }});
          if (err > 0) return Result;
          pas.System.val$6(pas.System.Copy(s,SignPosition + 4,2),{get: function () {
              return MinuteOffset;
            }, set: function (v) {
              MinuteOffset = v;
            }},{get: function () {
              return err;
            }, set: function (v) {
              err = v;
            }});
          if (err > 0) return Result;
          if (sign === "-") {
            HourOffset = HourOffset * -1;
            MinuteOffset = MinuteOffset * -1;
          };
        };
      };
      if (pas.SysUtils.TryEncodeDate(ye,mo,da,{get: function () {
          return dt;
        }, set: function (v) {
          dt = v;
        }}) && pas.SysUtils.TryEncodeTime(ho,mi,se,0,{get: function () {
          return dtt;
        }, set: function (v) {
          dtt = v;
        }})) {
        Result = dt + dtt;
        Result = AdjustDateTime(Result,HourOffset,MinuteOffset);
      };
      return Result;
    };
    this.ISOToDate = function (AISOString) {
      var Result = 0.0;
      var da = 0;
      var mo = 0;
      var ye = 0;
      var err = 0;
      var s = "";
      s = AISOString;
      pas.System.val$5(pas.System.Copy(s,1,4),{get: function () {
          return ye;
        }, set: function (v) {
          ye = v;
        }},{get: function () {
          return err;
        }, set: function (v) {
          err = v;
        }});
      pas.System.val$5(pas.System.Copy(s,6,2),{get: function () {
          return mo;
        }, set: function (v) {
          mo = v;
        }},{get: function () {
          return err;
        }, set: function (v) {
          err = v;
        }});
      pas.System.val$5(pas.System.Copy(s,9,2),{get: function () {
          return da;
        }, set: function (v) {
          da = v;
        }},{get: function () {
          return err;
        }, set: function (v) {
          err = v;
        }});
      if (ye < 1) ye = 1;
      if (mo < 1) mo = 1;
      if (da < 1) da = 1;
      Result = pas.SysUtils.EncodeDate(ye,mo,da) + pas.SysUtils.EncodeTime(0,0,0,0);
      return Result;
    };
    this.DateTimeToUTC = function (ADateTime) {
      var $Self = this;
      var Result = "";
      var da = 0;
      var mo = 0;
      var ye = 0;
      var ho = 0;
      var mi = 0;
      var se = 0;
      var ms = 0;
      var bias = 0;
      var biasday = 0;
      var isDayLight = false;
      function IntToZStr(i, l) {
        var Result = "";
        var Res = "";
        Res = pas.SysUtils.IntToStr(i);
        while (Res.length < l) Res = "0" + Res;
        Result = Res;
        return Result;
      };
      bias = 0;
      biasday = 0;
      isDayLight = false;
      this.GetTimeZoneInfo(ADateTime,{get: function () {
          return bias;
        }, set: function (v) {
          bias = v;
        }},{get: function () {
          return biasday;
        }, set: function (v) {
          biasday = v;
        }},{get: function () {
          return isDayLight;
        }, set: function (v) {
          isDayLight = v;
        }});
      pas.SysUtils.DecodeDate(ADateTime,{get: function () {
          return ye;
        }, set: function (v) {
          ye = v;
        }},{get: function () {
          return mo;
        }, set: function (v) {
          mo = v;
        }},{get: function () {
          return da;
        }, set: function (v) {
          da = v;
        }});
      pas.SysUtils.DecodeTime(ADateTime,{get: function () {
          return ho;
        }, set: function (v) {
          ho = v;
        }},{get: function () {
          return mi;
        }, set: function (v) {
          mi = v;
        }},{get: function () {
          return se;
        }, set: function (v) {
          se = v;
        }},{get: function () {
          return ms;
        }, set: function (v) {
          ms = v;
        }});
      Result = pas.SysUtils.IntToStr(ye) + "-" + IntToZStr(mo,2) + "-" + IntToZStr(da,2) + "T" + IntToZStr(ho,2) + ":" + IntToZStr(mi,2) + ":" + IntToZStr(se,2);
      if (isDayLight) {
        if (bias <= 0) {
          Result = Result + "+" + IntToZStr(rtl.trunc((-bias - biasday) / 60),2) + ":00"}
         else Result = Result + "-" + IntToZStr(rtl.trunc((bias + biasday) / 60),2) + ":00";
      } else {
        if (bias !== 0) {
          if (bias <= 0) {
            Result = Result + "+" + IntToZStr(rtl.trunc(-bias / 60),2) + ":00"}
           else Result = Result + "-" + IntToZStr(rtl.trunc(bias / 60),2) + ":00";
        } else Result = Result + "+00:00";
      };
      return Result;
    };
    var UnixStartDate = 25569;
    this.DateTimeToMilliSeconds = function (ADateTime) {
      var Result = 0;
      var bias = 0;
      var biasday = 0;
      var isDayLight = false;
      bias = 0;
      biasday = 0;
      isDayLight = false;
      this.GetTimeZoneInfo(ADateTime,{get: function () {
          return bias;
        }, set: function (v) {
          bias = v;
        }},{get: function () {
          return biasday;
        }, set: function (v) {
          biasday = v;
        }},{get: function () {
          return isDayLight;
        }, set: function (v) {
          isDayLight = v;
        }});
      if (isDayLight) {
        Result = pas.DateUtils.MilliSecondsBetween(pas.DateUtils.IncHour(ADateTime,rtl.trunc((bias + biasday) / 60)),UnixStartDate)}
       else Result = pas.DateUtils.MilliSecondsBetween(pas.DateUtils.IncHour(ADateTime,rtl.trunc(bias / 60)),UnixStartDate);
      return Result;
    };
    this.GetMimeType = function (AFile) {
      var Result = "";
      var e = "";
      e = pas.SysUtils.ExtractFileExt(AFile);
      e = pas.SysUtils.LowerCase(pas.SysUtils.Trim(e));
      if ((e !== "") && (e.charAt(0) === ".")) e = pas.System.Copy(e,2,e.length - 1);
      Result = "";
      if ($impl.FMimeTypes != null) Result = $impl.FMimeTypes.GetValue(e);
      if (Result === "") Result = "application/octet-stream";
      return Result;
    };
    this.GetMimeType$1 = function (AData, AResetPosition) {
      var Result = "";
      Result = "";
      throw pas.SysUtils.Exception.$create("Create$1",["Implement GetMimeType"]);
      return Result;
    };
    this.GetFileExtension = function (AMime) {
      var Result = "";
      var I = 0;
      var e = "";
      e = pas.SysUtils.LowerCase(AMime);
      Result = "";
      if ($impl.FMimeTypes != null) {
        for (var $l = 0, $end = $impl.FMimeTypes.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          if ($impl.FMimeTypes.GetValueFromIndex(I) === e) {
            Result = $impl.FMimeTypes.GetName(I);
            return Result;
          };
        };
      };
      return Result;
    };
    this.FileToBase64 = function (AFile) {
      var Result = "";
      var s = "";
      function uint8ToString(buf) {
        var i, length, out = '';
        for (i = 0, length = buf.length; i < length; i += 1) {
            out += String.fromCharCode(buf[i]);
        }
        return out;
      }
      s = btoa(uint8ToString(AFile.Data));
      Result = s;
      return Result;
    };
    this.LoadFile = function (AFile, ALoadFileComplete) {
      var f = null;
      var c = null;
      var ua = null;
      if (1 < 0) $mod.CreateUploadFile("file",ua);
      f = AFile;
      c = ALoadFileComplete;
      var reader = new FileReader();
      
          reader.onload = function(e) {
            var s = new Uint8Array(reader.result);
            var fn = pas["WEBLib.TMSFNCUtils"].CreateUploadFile(f.name, s);
            if (c){
              c(fn);
            }
          }
      
          reader.readAsArrayBuffer(f);
    };
    this.Decode64 = function (AValue, AURL) {
      var Result = "";
      var s = "";
      Result = "";
      if (AValue.length === 0) return Result;
      s = AValue;
      if (AURL) {
        s = s + pas.System.StringOfChar("=",s.length % 4);
        s = pas.SysUtils.StringReplace(s,"-","+",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
        s = pas.SysUtils.StringReplace(s,"_","/",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
      };
      function b64DecodeUnicode(str) {
        var binary_string = window.atob(str);
        return binary_string;
      }
      return b64DecodeUnicode(s);
      return Result;
    };
    this.Encode64 = function (AValue, AURL) {
      var Result = "";
      var s = "";
      var v = "";
      Result = "";
      if (AValue.length === 0) return Result;
      v = AValue;
      function b64EncodeUnicode(str) {
        return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g,
            function toSolidBytes(match, p1) {
                return String.fromCharCode('0x' + p1);
        }));
      }
      s = b64EncodeUnicode(v);
      if (AURL) {
        s = pas.SysUtils.StringReplace(s,"+","-",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll,pas.SysUtils.TStringReplaceFlag.rfIgnoreCase));
        s = pas.SysUtils.StringReplace(s,"/","_",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll,pas.SysUtils.TStringReplaceFlag.rfIgnoreCase));
        s = pas.SysUtils.StringReplace(s,"=","",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll,pas.SysUtils.TStringReplaceFlag.rfIgnoreCase));
      };
      Result = s;
      return Result;
    };
    this.Encode64$1 = function (AValue, AURL) {
      var Result = "";
      var s = "";
      var v = [];
      Result = "";
      if (rtl.length(AValue) === 0) return Result;
      v = rtl.arrayRef(AValue);
      s = "";
      function _arrayBufferToBase64( buffer ) {
              var binary = '';
              var bytes = new Uint8Array( buffer );
              var len = bytes.byteLength;
              for (var i = 0; i < len; i++) {
                  binary += String.fromCharCode( bytes[ i ] );
              }
              return window.btoa( binary );
          }
      
          s = _arrayBufferToBase64(v);
      if (AURL) {
        s = pas.SysUtils.StringReplace(s,"+","-",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll,pas.SysUtils.TStringReplaceFlag.rfIgnoreCase));
        s = pas.SysUtils.StringReplace(s,"/","_",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll,pas.SysUtils.TStringReplaceFlag.rfIgnoreCase));
        s = pas.SysUtils.StringReplace(s,"=","",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll,pas.SysUtils.TStringReplaceFlag.rfIgnoreCase));
      };
      Result = s;
      return Result;
    };
    this.Log$1 = function (AObject) {
      window.console.log(AObject);
    };
    this.GetJSONProp = function (AJSONValue, APropertyName) {
      var Result = "";
      var v = null;
      Result = "";
      v = this.GetJSONValue(AJSONValue,APropertyName);
      if ((v != null) && !pas["WEBLib.JSON"].TJSONNull.isPrototypeOf(v)) Result = v.GetStrValue();
      return Result;
    };
    this.GetJSONValueAsBoolean = function (AJSONValue) {
      var Result = false;
      Result = false;
      if (AJSONValue != null) {
        Result = pas["WEBLib.JSON"].TJSONTrue.isPrototypeOf(AJSONValue);
      };
      return Result;
    };
    this.GetJSONValueAsString = function (AJSONValue) {
      var Result = "";
      Result = "";
      if (AJSONValue != null) {
        Result = AJSONValue.ToString();
      };
      return Result;
    };
    this.GetJSONValue = function (AJSONValue, APropertyName) {
      var Result = null;
      Result = null;
      try {
        if (pas["WEBLib.JSON"].TJSONObject.isPrototypeOf(AJSONValue)) {
          Result = rtl.as(AJSONValue,pas["WEBLib.JSON"].TJSONObject).GetValue$1(APropertyName);
        };
      } catch ($e) {
      };
      return Result;
    };
    this.FindJSONValue = function (AJSONValue, APath) {
      var Result = null;
      Result = null;
      try {
        if (AJSONValue != null) {
          Result = this.GetJSONValue(AJSONValue,APath);
        };
      } catch ($e) {
      };
      return Result;
    };
    this.GetJSONDoubleValue = function (AJSONValue, APropertyName) {
      var Result = 0.0;
      Result = this.GetJSONValueAsDouble(this.GetJSONValue(AJSONValue,APropertyName));
      return Result;
    };
    this.GetJSONValueAsDouble = function (AJSONValue) {
      var Result = 0.0;
      var v = null;
      Result = 0;
      v = AJSONValue;
      if ((v != null) && pas["WEBLib.JSON"].TJSONNumber.isPrototypeOf(v)) {
        Result = rtl.as(v,pas["WEBLib.JSON"].TJSONNumber).FDouble;
      };
      return Result;
    };
    this.GetJSONIntegerValue = function (AJSONValue, APropertyName) {
      var Result = 0;
      Result = this.GetJSONValueAsInteger(this.GetJSONValue(AJSONValue,APropertyName));
      return Result;
    };
    this.GetJSONValueAsInteger = function (AJSONValue) {
      var Result = 0;
      var v = null;
      Result = 0;
      v = AJSONValue;
      if ((v != null) && pas["WEBLib.JSON"].TJSONNumber.isPrototypeOf(v)) {
        Result = rtl.as(v,pas["WEBLib.JSON"].TJSONNumber).FInt;
      };
      return Result;
    };
    this.IsJSONTrue = function (AJSONValue) {
      var Result = false;
      Result = false;
      if (AJSONValue != null) Result = AJSONValue.GetStrValue() === "true";
      return Result;
    };
    this.IsJSONFalse = function (AJSONValue) {
      var Result = false;
      Result = false;
      if (AJSONValue != null) Result = AJSONValue.GetStrValue() === "false";
      return Result;
    };
    this.GetJSONArraySize = function (AJSONArray) {
      var Result = 0;
      Result = AJSONArray.GetCount();
      return Result;
    };
    this.GetJSONArrayItem = function (AJSONArray, AIndex) {
      var Result = null;
      Result = null;
      if ((AIndex >= 0) && (AIndex <= (this.GetJSONArraySize(AJSONArray) - 1))) {
        Result = AJSONArray.GetItem(AIndex);
      };
      return Result;
    };
    this.GetJSONObjectSize = function (AJSONObject) {
      var Result = 0;
      Result = AJSONObject.GetCount();
      return Result;
    };
    this.GetJSONObjectItem = function (AJSONObject, AIndex) {
      var Result = null;
      Result = null;
      if ((AIndex >= 0) && (AIndex <= (this.GetJSONObjectSize(AJSONObject) - 1))) {
        Result = AJSONObject.GetItem(AIndex);
      };
      return Result;
    };
    this.GetJSONObjectName = function (AJSONObject, AIndex) {
      var Result = "";
      var p = null;
      Result = "";
      if ((AIndex >= 0) && (AIndex <= (this.GetJSONObjectSize(AJSONObject) - 1))) {
        p = AJSONObject.Get$1(AIndex);
        if (p != null) Result = p.fjs.GetStrValue();
      };
      return Result;
    };
    this.ParseJSON = function (AJSON) {
      var Result = null;
      Result = pas["WEBLib.JSON"].TJSONObject.ParseJSONValue(AJSON);
      return Result;
    };
    this.IsJSON = function (AJSON) {
      var Result = false;
      var v = null;
      v = this.ParseJSON(AJSON);
      Result = false;
      if (v != null) {
        Result = true;
        v = rtl.freeLoc(v);
      };
      return Result;
    };
    this.StrToFloatDot = function (AValue) {
      var Result = 0.0;
      Result = pas.SysUtils.StrToFloat$1(AValue,$mod.FNCFormatSettings);
      return Result;
    };
    this.FloatToStrDot = function (AValue) {
      var Result = "";
      Result = pas.SysUtils.FloatToStr$1(AValue,$mod.FNCFormatSettings);
      return Result;
    };
    this.TryStrToFloatDot = function (AValue, AResult) {
      var Result = false;
      Result = pas.SysUtils.TryStrToFloat$3(AValue,AResult,$mod.FNCFormatSettings);
      return Result;
    };
    this.Decode64ToBytes = function (AValue, AURL) {
      var Result = [];
      var s = "";
      var ss = null;
      Result = [];
      if (AValue.length === 0) return Result;
      s = AValue;
      if (AURL) {
        s = s + pas.System.StringOfChar("=",s.length % 4);
        s = pas.SysUtils.StringReplace(s,"-","+",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
        s = pas.SysUtils.StringReplace(s,"_","/",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
      };
      function b64DecodeUnicode(str) {
        var binary_string = window.atob(str);
        return binary_string;
      }
      s = b64DecodeUnicode(s);
      ss = pas.Classes.TStringStream.$create("Create$3",["",pas.SysUtils.TEncoding.GetUTF8(),true]);
      try {
        ss.WriteString(s);
        Result = pas["WEBLib.TMSFNCTypes"].TTMSFNCMemoryStream.GetBytes.call(ss);
      } finally {
        ss = rtl.freeLoc(ss);
      };
      return Result;
    };
    this.MatchStrEx = function (AValue1, AValue2, ACaseSensitive) {
      var Result = false;
      var ch = "\x00";
      var lastOp = "\x00";
      var sep = 0;
      var cp = 0;
      var res = false;
      var newRes = false;
      var CharArray = [];
      var part = "";
      if (AValue1 === '""') AValue1 = "";
      if (AValue2 === '""') AValue2 = "";
      if ((AValue1 === "") && (AValue2 === "")) {
        Result = true;
        return Result;
      };
      AValue1 = pas.SysUtils.Trim(AValue1);
      AValue1 = this.StripLogicSpaces(AValue1);
      if ((AValue2 === "") && (pas.System.Pos('""',AValue1) === 0) && (pas.System.Pos("*",AValue1) === 0)) return false;
      CharArray = rtl.arraySetLength(CharArray,"\x00",5);
      CharArray[0] = "(";
      CharArray[1] = ";";
      CharArray[2] = "^";
      CharArray[3] = "&";
      CharArray[4] = "|";
      lastOp = "\x00";
      res = true;
      do {
        ch = rtl.rcc(this.FirstChar(rtl.arrayRef(CharArray),AValue1,{get: function () {
            return sep;
          }, set: function (v) {
            rtl.rc(v,-2147483648,2147483647);
            sep = v;
          }}),0,65535);
        if (ch !== "\x00") {
          if ((AValue1.length > 0) && (rtl.rcCharAt(AValue1,0) === "(")) {
            cp = rtl.rc(this.ClosingParenthesis(AValue1),-2147483648,2147483647);
            part = pas.System.Copy(AValue1,2,cp - 2);
            newRes = this.MatchStrEx(part,AValue2,ACaseSensitive);
            pas.System.Delete({get: function () {
                return AValue1;
              }, set: function (v) {
                AValue1 = v;
              }},1,cp);
          } else {
            part = pas.System.Copy(AValue1,1,sep - 1);
            newRes = this.MatchStr(part,AValue2,ACaseSensitive);
            pas.System.Delete({get: function () {
                return AValue1;
              }, set: function (v) {
                AValue1 = v;
              }},1,sep);
          };
          if (lastOp === "\x00") {
            res = newRes}
           else {
            var $tmp = lastOp;
            if ($tmp === "^") {
              res = res ^ newRes}
             else if ($tmp === "&") {
              res = res && newRes}
             else if (($tmp === "|") || ($tmp === ";")) res = res || newRes;
          };
          lastOp = rtl.rcc(ch,0,65535);
        };
      } while (!(ch === "\x00"));
      part = AValue1;
      newRes = this.MatchStr(part,AValue2,ACaseSensitive);
      if (lastOp === "\x00") {
        res = newRes}
       else {
        var $tmp1 = lastOp;
        if ($tmp1 === "^") {
          res = res ^ newRes}
         else if ($tmp1 === "&") {
          res = res && newRes}
         else if (($tmp1 === "|") || ($tmp1 === ";")) res = res || newRes;
      };
      Result = res;
      return Result;
    };
    this.MatchStrEx$1 = function (AValue, AArray, ACaseSensitive, AExpression) {
      var Result = false;
      Result = this.GetStrIdx(AValue,AArray,ACaseSensitive,AExpression) !== -1;
      return Result;
    };
    this.MatchStr = function (AValue1, AValue2, ACaseSensitive) {
      var Result = false;
      if (AValue1 === '""') AValue1 = "";
      if (AValue2 === '""') AValue2 = "";
      if ((AValue1 === "") && (AValue2 === "")) {
        Result = true;
        return Result;
      };
      AValue1 = pas.SysUtils.Trim(AValue1);
      AValue2 = pas.SysUtils.Trim(AValue2);
      if (AValue1 === "*") return true;
      if ((AValue1 === '""') || (AValue1 === "")) return AValue2 === "";
      if (AValue2 === "") return false;
      if ((AValue1.length > 1) && (rtl.rcCharAt(AValue1,0) === '"') && (rtl.rcCharAt(AValue1,AValue1.length - 1) === '"')) AValue1 = pas.System.Copy(AValue1,2,AValue1.length - 2);
      if (ACaseSensitive) {
        Result = this.Matches(AValue1,AValue2)}
       else Result = this.Matches(pas["WEBLib.TMSFNCTypes"].AnsiUpperCase(AValue1),pas["WEBLib.TMSFNCTypes"].AnsiUpperCase(AValue2));
      return Result;
    };
    this.GetStrIdx = function (AValue, AArray, ACaseSensitive, AExpression) {
      var Result = 0;
      var I = 0;
      Result = -1;
      for (var $l = 0, $end = rtl.length(AArray) - 1; $l <= $end; $l++) {
        I = $l;
        if (!AExpression) {
          if ((ACaseSensitive && (AValue === AArray[I])) || ((ACaseSensitive === false) && (pas.SysUtils.UpperCase(AValue) === pas.SysUtils.UpperCase(AArray[I])))) {
            Result = I;
            break;
          };
        } else if (this.MatchStr(AValue,AArray[I],ACaseSensitive)) {
          Result = I;
          break;
        };
      };
      return Result;
    };
    this.StripLogicSpaces = function (AValue) {
      var Result = "";
      var i = 0;
      var k = 0;
      var q = 0;
      q = 0;
      i = 1;
      k = AValue.length;
      Result = "";
      while (i <= k) {
        if (AValue.charAt(i - 1) === '"') q += 1;
        if (AValue.charAt(i - 1) === " ") {
          if (pas.System.Odd(q)) Result = Result + AValue.charAt(i - 1);
        } else Result = Result + AValue.charAt(i - 1);
        i += 1;
      };
      return Result;
    };
    this.FirstChar = function (ACharset, AValue, spos) {
      var Result = "\x00";
      var i = 0;
      var q = 0;
      var j = 0;
      j = 0;
      i = 1;
      q = 0;
      spos.set(-1);
      Result = "\x00";
      while (i <= AValue.length) {
        if (AValue.charAt(i - j - 1) === '"') q += 1;
        if (this.CharInSet(AValue.charAt(i - j - 1),rtl.arrayRef(ACharset)) && !pas.System.Odd(q)) {
          spos.set(i);
          Result = AValue.charAt(i - j - 1);
          break;
        };
        i += 1;
      };
      return Result;
    };
    this.CharInSet = function (ch, ACharSet) {
      var Result = false;
      var j = 0;
      Result = false;
      for (var $l = 0, $end = rtl.length(ACharSet) - 1; $l <= $end; $l++) {
        j = $l;
        if (ch === ACharSet[j]) {
          Result = true;
          break;
        };
      };
      return Result;
    };
    this.AddCharSet = function (ACharSet1, ACharSet2) {
      var Result = [];
      var l = 0;
      var j = 0;
      l = rtl.length(ACharSet1) + rtl.length(ACharSet2);
      Result = rtl.arraySetLength(Result,"\x00",l);
      l = 0;
      for (var $l = 0, $end = rtl.length(ACharSet1) - 1; $l <= $end; $l++) {
        j = $l;
        Result[l] = ACharSet1[j];
        l += 1;
      };
      for (var $l1 = 0, $end1 = rtl.length(ACharSet2) - 1; $l1 <= $end1; $l1++) {
        j = $l1;
        Result[l] = ACharSet2[j];
        l += 1;
      };
      return Result;
    };
    this.SubCharSet = function (ACharSet1, ACharSet2) {
      var Result = [];
      var i = 0;
      var j = 0;
      var l = 0;
      var found = false;
      l = 0;
      Result = rtl.arraySetLength(Result,"\x00",l);
      for (var $l = 0, $end = rtl.length(ACharSet1) - 1; $l <= $end; $l++) {
        i = $l;
        found = false;
        for (var $l1 = 0, $end1 = rtl.length(ACharSet2) - 1; $l1 <= $end1; $l1++) {
          j = $l1;
          if (ACharSet1[i] === ACharSet2[j]) {
            found = true;
            break;
          };
        };
        if (!found) {
          l += 1;
          Result = rtl.arraySetLength(Result,"\x00",l);
          Result[l - 1] = ACharSet1[i];
        };
      };
      return Result;
    };
    this.IsLetterOrDigit = function (AChar) {
      var Result = false;
      Result = $mod.TTMSFNCUtils.CharInSet(AChar,this.NumericCharSet()) || $mod.TTMSFNCUtils.CharInSet(AChar,this.AlphaCharSet());
      return Result;
    };
    this.AlphaCharSet = function () {
      var Result = [];
      var i = 0;
      var ch = "\x00";
      Result = rtl.arraySetLength(Result,"\x00",52);
      i = 0;
      for (var $l = 97; $l <= 122; $l++) {
        ch = String.fromCharCode($l);
        Result[i] = ch;
        i += 1;
      };
      for (var $l1 = 65; $l1 <= 90; $l1++) {
        ch = String.fromCharCode($l1);
        Result[i] = ch;
        i += 1;
      };
      return Result;
    };
    this.NumericCharSet = function () {
      var Result = [];
      var ch = "\x00";
      var i = 0;
      Result = rtl.arraySetLength(Result,"\x00",10);
      i = 0;
      for (var $l = 48; $l <= 57; $l++) {
        ch = String.fromCharCode($l);
        Result[i] = ch;
        i += 1;
      };
      return Result;
    };
    this.CreateCharSet = function (AValue) {
      var Result = [];
      var i = 0;
      Result = rtl.arraySetLength(Result,"\x00",AValue.length);
      for (var $l = 1, $end = AValue.length; $l <= $end; $l++) {
        i = $l;
        Result[i - 1] = this.CharInStr(AValue,i);
      };
      return Result;
    };
    this.IsDate = function (AValue, ADate) {
      var Result = false;
      var su = "";
      var ts = "";
      var da = 0;
      var mo = 0;
      var ye = 0;
      var ho = 0;
      var mi = 0;
      var se = 0;
      var err = 0;
      var dp = 0;
      var mp = 0;
      var yp = 0;
      var vp = 0;
      Result = false;
      ts = "";
      su = pas.SysUtils.UpperCase(pas.SysUtils.FormatSettings.ShortDateFormat);
      dp = pas.System.Pos("D",su);
      mp = pas.System.Pos("M",su);
      yp = pas.System.Pos("Y",su);
      da = 0;
      mo = 0;
      ye = 0;
      ho = 0;
      mi = 0;
      se = 0;
      vp = -1;
      if ($mod.TTMSFNCUtils.VarPos(pas.SysUtils.FormatSettings.DateSeparator,AValue,{get: function () {
          return vp;
        }, set: function (v) {
          vp = v;
        }}) > 0) {
        su = pas.System.Copy(AValue,1,vp - 1);
        if ((dp < mp) && (dp < yp)) {
          pas.System.val$5(su,{get: function () {
              return da;
            }, set: function (v) {
              da = v;
            }},{get: function () {
              return err;
            }, set: function (v) {
              err = v;
            }})}
         else if ((mp < dp) && (mp < yp)) {
          pas.System.val$5(su,{get: function () {
              return mo;
            }, set: function (v) {
              mo = v;
            }},{get: function () {
              return err;
            }, set: function (v) {
              err = v;
            }})}
         else if ((yp < mp) && (yp < dp)) pas.System.val$5(su,{get: function () {
            return ye;
          }, set: function (v) {
            ye = v;
          }},{get: function () {
            return err;
          }, set: function (v) {
            err = v;
          }});
        if (err !== 0) return Result;
        pas.System.Delete({get: function () {
            return AValue;
          }, set: function (v) {
            AValue = v;
          }},1,vp);
        if ($mod.TTMSFNCUtils.VarPos(pas.SysUtils.FormatSettings.DateSeparator,AValue,{get: function () {
            return vp;
          }, set: function (v) {
            vp = v;
          }}) > 0) {
          su = pas.System.Copy(AValue,1,vp - 1);
          if (((dp > mp) && (dp < yp)) || ((dp > yp) && (dp < mp))) {
            pas.System.val$5(su,{get: function () {
                return da;
              }, set: function (v) {
                da = v;
              }},{get: function () {
                return err;
              }, set: function (v) {
                err = v;
              }})}
           else if (((mp > dp) && (mp < yp)) || ((mp > yp) && (mp < dp))) {
            pas.System.val$5(su,{get: function () {
                return mo;
              }, set: function (v) {
                mo = v;
              }},{get: function () {
                return err;
              }, set: function (v) {
                err = v;
              }})}
           else if (((yp > mp) && (yp < dp)) || ((yp > dp) && (yp < mp))) pas.System.val$5(su,{get: function () {
              return ye;
            }, set: function (v) {
              ye = v;
            }},{get: function () {
              return err;
            }, set: function (v) {
              err = v;
            }});
          if (err !== 0) return Result;
          pas.System.Delete({get: function () {
              return AValue;
            }, set: function (v) {
              AValue = v;
            }},1,vp);
          AValue = pas.SysUtils.Trim(AValue);
          if ($mod.TTMSFNCUtils.VarPos(" ",AValue,{get: function () {
              return vp;
            }, set: function (v) {
              vp = v;
            }}) > 0) {
            ts = pas.System.Copy(AValue,vp,AValue.length);
            AValue = pas.System.Copy(AValue,1,vp - 1);
          };
          if ((dp > mp) && (dp > yp)) {
            pas.System.val$5(AValue,{get: function () {
                return da;
              }, set: function (v) {
                da = v;
              }},{get: function () {
                return err;
              }, set: function (v) {
                err = v;
              }})}
           else if ((mp > dp) && (mp > yp)) {
            pas.System.val$5(AValue,{get: function () {
                return mo;
              }, set: function (v) {
                mo = v;
              }},{get: function () {
                return err;
              }, set: function (v) {
                err = v;
              }})}
           else if ((yp > mp) && (yp > dp)) pas.System.val$5(AValue,{get: function () {
              return ye;
            }, set: function (v) {
              ye = v;
            }},{get: function () {
              return err;
            }, set: function (v) {
              err = v;
            }});
          if (err !== 0) return Result;
          if (da > 31) return Result;
          if (mo > 12) return Result;
          if (ts !== "") {
            if ($mod.TTMSFNCUtils.VarPos(pas.SysUtils.FormatSettings.TimeSeparator,ts,{get: function () {
                return vp;
              }, set: function (v) {
                vp = v;
              }}) > 0) {
              su = pas.System.Copy(ts,1,vp - 1);
              pas.System.val$5(su,{get: function () {
                  return ho;
                }, set: function (v) {
                  ho = v;
                }},{get: function () {
                  return err;
                }, set: function (v) {
                  err = v;
                }});
              if (err !== 0) return Result;
              if (ho > 23) return Result;
              pas.System.Delete({get: function () {
                  return ts;
                }, set: function (v) {
                  ts = v;
                }},1,vp);
              if ($mod.TTMSFNCUtils.VarPos(pas.SysUtils.FormatSettings.TimeSeparator,ts,{get: function () {
                  return vp;
                }, set: function (v) {
                  vp = v;
                }}) > 0) {
                su = pas.System.Copy(ts,1,vp - 1);
                pas.System.val$5(su,{get: function () {
                    return mi;
                  }, set: function (v) {
                    mi = v;
                  }},{get: function () {
                    return err;
                  }, set: function (v) {
                    err = v;
                  }});
                if (err !== 0) return Result;
                pas.System.Delete({get: function () {
                    return ts;
                  }, set: function (v) {
                    ts = v;
                  }},1,vp);
                pas.System.val$5(ts,{get: function () {
                    return se;
                  }, set: function (v) {
                    se = v;
                  }},{get: function () {
                    return err;
                  }, set: function (v) {
                    err = v;
                  }});
                if (err !== 0) return Result;
                if (se > 60) return Result;
              } else {
                pas.System.val$5(su,{get: function () {
                    return mi;
                  }, set: function (v) {
                    mi = v;
                  }},{get: function () {
                    return err;
                  }, set: function (v) {
                    err = v;
                  }});
                if (err !== 0) return Result;
              };
              if (mi > 59) return Result;
              Result = true;
            };
          } else Result = true;
          try {
            ADate.set(pas.SysUtils.EncodeDate(ye,mo,da) + pas.SysUtils.EncodeTime(ho,mi,se,0));
          } catch ($e) {
            Result = false;
          };
        };
      };
      return Result;
    };
    this.IPos = function (su, s) {
      var Result = 0;
      Result = pas.System.Pos(pas.SysUtils.UpperCase(su),pas.SysUtils.UpperCase(s));
      return Result;
    };
    this.UnFixMarkup = function (su, SpecialChars, SpecialCharsOnly) {
      var Result = "";
      var i = 0;
      if (!SpecialCharsOnly) {
        while (pas.System.Pos("&lt;",su) > 0) {
          this.TagReplaceString("&lt;","<",{get: function () {
              return su;
            }, set: function (v) {
              su = v;
            }});
        };
        while (pas.System.Pos("&gt;",su) > 0) {
          this.TagReplaceString("&gt;",">",{get: function () {
              return su;
            }, set: function (v) {
              su = v;
            }});
        };
        while (pas.System.Pos("&amp;",su) > 0) {
          this.TagReplaceString("&amp;","&",{get: function () {
              return su;
            }, set: function (v) {
              su = v;
            }});
        };
        while (pas.System.Pos("&quot;",su) > 0) {
          this.TagReplaceString("&quot;",'"',{get: function () {
              return su;
            }, set: function (v) {
              su = v;
            }});
        };
      };
      if (SpecialChars) {
        for (i = 4; i <= 92; i++) {
          while (pas.System.Pos($impl.HTMLSpecialChar[i - 1],su) > 0) {
            this.TagReplaceString($impl.HTMLSpecialChar[i - 1],$impl.HTMLEncodedChar[i - 1],{get: function () {
                return su;
              }, set: function (v) {
                su = v;
              }});
          };
        };
      };
      Result = su;
      return Result;
    };
    this.FixMarkup = function (su, SpecialChars) {
      var Result = "";
      var i = 0;
      var res = "";
      var ch = "\x00";
      while (pas.System.Pos("&",su) > 0) {
        this.TagReplaceString("&","*amp;",{get: function () {
            return su;
          }, set: function (v) {
            su = v;
          }});
      };
      while (pas.System.Pos("*amp;",su) > 0) {
        this.TagReplaceString("*amp;","&amp;",{get: function () {
            return su;
          }, set: function (v) {
            su = v;
          }});
      };
      while (pas.System.Pos('"',su) > 0) {
        this.TagReplaceString('"',"&quot;",{get: function () {
            return su;
          }, set: function (v) {
            su = v;
          }});
      };
      while (pas.System.Pos("<",su) > 0) {
        this.TagReplaceString("<","&lt;",{get: function () {
            return su;
          }, set: function (v) {
            su = v;
          }});
      };
      while (pas.System.Pos(">",su) > 0) {
        this.TagReplaceString(">","&gt;",{get: function () {
            return su;
          }, set: function (v) {
            su = v;
          }});
      };
      if (SpecialChars) {
        for (i = 4; i <= 92; i++) {
          while (pas.System.Pos($impl.HTMLEncodedChar[i - 1],su) > 0) {
            this.TagReplaceString($impl.HTMLEncodedChar[i - 1],$impl.HTMLSpecialChar[i - 1],{get: function () {
                return su;
              }, set: function (v) {
                su = v;
              }});
          };
        };
        res = "";
        for (var $l = 1, $end = su.length; $l <= $end; $l++) {
          i = $l;
          ch = this.CharInStr(su,i);
          if (ch.charCodeAt() > 256) {
            res = res + "&#" + pas.SysUtils.IntToStr(ch.charCodeAt()) + ";"}
           else res = res + ch;
        };
        su = res;
      };
      Result = su;
      return Result;
    };
    this.TagReplaceString = function (Srch, Repl, Dest) {
      var Result = false;
      var i = 0;
      i = this.IPos(Srch,Dest.get());
      if (i > 0) {
        Result = true;
        pas.System.Delete(Dest,i,Srch.length);
        Dest.set(pas.System.Copy(Dest.get(),1,i - 1) + Repl + pas.System.Copy(Dest.get(),i,Dest.get().length));
      } else Result = false;
      return Result;
    };
    var larger = ">";
    var smaller = "<";
    var logand = "&";
    var logor = "^";
    var asterix = "*";
    var qmark = "?";
    var negation = "!";
    this.Matches = function (s0a, s1a) {
      var Result = false;
      var matching = false;
      var done = false;
      var len = 0;
      var lastchar = "\x00";
      var s0 = 0;
      var s1 = 0;
      var s2 = 0;
      var s3 = 0;
      var oksmaller = false;
      var oklarger = false;
      var negflag = false;
      var compstr = "";
      var flag1 = false;
      var flag2 = false;
      var flag3 = false;
      var equal = false;
      var n1 = 0.0;
      var n2 = 0.0;
      var code1 = 0;
      var code2 = 0;
      var dt1 = 0.0;
      var dt2 = 0.0;
      var q = 0;
      var i = 0;
      if (s0a === '""') s0a = "";
      if (s1a === '""') s1a = "";
      if ((s0a === "") && (s1a === "")) {
        Result = true;
        return Result;
      };
      i = 0;
      oksmaller = true;
      oklarger = true;
      flag1 = false;
      flag2 = false;
      flag3 = false;
      negflag = false;
      equal = false;
      s2 = rtl.rc(pas.System.Pos(larger,s0a),-2147483648,2147483647);
      if (s2 !== 0) {
        s2 += 1;
        if (rtl.rcCharAt(s0a,s2 - i - 1) === "=") {
          equal = true;
          s2 += 1;
        };
        while (rtl.rcCharAt(s0a,s2 - i - 1) === " ") s2 += 1;
        s3 = rtl.rc(s2,-2147483648,2147483647);
        len = 0;
        lastchar = "\x00";
        q = 0;
        while (((s2 - i) <= s0a.length) && (rtl.rcCharAt(s0a,s2 - i - 1) !== " ") && (s2 <= s0a.length) && (pas.System.Odd(q) || ((rtl.rcCharAt(s0a,s2 - i - 1) !== "&") && (rtl.rcCharAt(s0a,s2 - i - 1) !== "|")))) {
          if (rtl.rcCharAt(s0a,s2 - i - 1) === '"') q += 1;
          if ((len === 0) && (rtl.rcCharAt(s0a,s2 - i - 1) === '"')) {
            s3 += 1}
           else len += 1;
          lastchar = rtl.rcc(rtl.rcCharAt(s0a,s2 - i - 1),0,65535);
          s2 += 1;
          if (((s2 - i) <= s0a.length) && (rtl.rcCharAt(s0a,s2 - i - 1) === " ") && pas.System.Odd(q)) {
            lastchar = rtl.rcc(rtl.rcCharAt(s0a,s2 - i - 1),0,65535);
            s2 += 1;
          };
        };
        if ((len > 0) && (lastchar === '"')) len -= 1;
        compstr = pas.System.Copy(s0a,s3,len);
        pas.System.val$8($mod.TTMSFNCUtils.StripThousandSep(s1a),{get: function () {
            return n1;
          }, set: function (v) {
            n1 = v;
          }},{get: function () {
            return code1;
          }, set: function (v) {
            rtl.rc(v,-2147483648,2147483647);
            code1 = v;
          }});
        pas.System.val$8($mod.TTMSFNCUtils.StripThousandSep(compstr),{get: function () {
            return n2;
          }, set: function (v) {
            n2 = v;
          }},{get: function () {
            return code2;
          }, set: function (v) {
            rtl.rc(v,-2147483648,2147483647);
            code2 = v;
          }});
        dt2 = 0;
        if ($mod.TTMSFNCUtils.IsDate(compstr,{get: function () {
            return dt2;
          }, set: function (v) {
            dt2 = v;
          }})) code2 = 1;
        dt1 = 0;
        if ($mod.TTMSFNCUtils.IsDate(s1a,{get: function () {
            return dt1;
          }, set: function (v) {
            dt1 = v;
          }})) code1 = 1;
        if ((code1 === 0) && (code2 === 0)) {
          if (equal) {
            oklarger = n1 >= n2}
           else oklarger = n1 > n2;
        } else {
          if ($mod.TTMSFNCUtils.IsDate(compstr,{get: function () {
              return dt2;
            }, set: function (v) {
              dt2 = v;
            }}) && $mod.TTMSFNCUtils.IsDate(s1a,{get: function () {
              return dt1;
            }, set: function (v) {
              dt1 = v;
            }})) {
            if (equal) {
              oklarger = dt1 >= dt2}
             else oklarger = dt1 > dt2;
          } else {
            if (equal) {
              oklarger = pas.SysUtils.CompareStr(compstr,s1a) <= 0}
             else oklarger = pas.SysUtils.CompareStr(compstr,s1a) < 0;
          };
        };
        flag1 = true;
      };
      equal = false;
      s2 = rtl.rc(pas.System.Pos(smaller,s0a),-2147483648,2147483647);
      if (s2 !== 0) {
        s2 += 1;
        if (rtl.rcCharAt(s0a,s2 - i - 1) === "=") {
          equal = true;
          s2 += 1;
        };
        lastchar = "\x00";
        while (((s2 - i) <= s0a.length) && (rtl.rcCharAt(s0a,s2 - i - 1) === " ")) s2 += 1;
        s3 = rtl.rc(s2,-2147483648,2147483647);
        len = 0;
        q = 0;
        while (((s2 - i) <= s0a.length) && (rtl.rcCharAt(s0a,s2 - i - 1) !== " ") && (s2 <= s0a.length) && (pas.System.Odd(q) || ((rtl.rcCharAt(s0a,s2 - i - 1) !== "&") && (rtl.rcCharAt(s0a,s2 - i - 1) !== "|")))) {
          if (rtl.rcCharAt(s0a,s2 - i - 1) === '"') q += 1;
          if ((len === 0) && (rtl.rcCharAt(s0a,s2 - i - 1) === '"')) {
            s3 += 1}
           else len += 1;
          lastchar = rtl.rcc(rtl.rcCharAt(s0a,s2 - i - 1),0,65535);
          s2 += 1;
        };
        if ((len > 0) && (lastchar === '"')) len -= 1;
        compstr = pas.System.Copy(s0a,s3,len);
        pas.System.val$8($mod.TTMSFNCUtils.StripThousandSep(s1a),{get: function () {
            return n1;
          }, set: function (v) {
            n1 = v;
          }},{get: function () {
            return code1;
          }, set: function (v) {
            rtl.rc(v,-2147483648,2147483647);
            code1 = v;
          }});
        pas.System.val$8($mod.TTMSFNCUtils.StripThousandSep(compstr),{get: function () {
            return n2;
          }, set: function (v) {
            n2 = v;
          }},{get: function () {
            return code2;
          }, set: function (v) {
            rtl.rc(v,-2147483648,2147483647);
            code2 = v;
          }});
        if ($mod.TTMSFNCUtils.IsDate(compstr,{get: function () {
            return dt2;
          }, set: function (v) {
            dt2 = v;
          }})) code2 = 1;
        if ($mod.TTMSFNCUtils.IsDate(s1a,{get: function () {
            return dt1;
          }, set: function (v) {
            dt1 = v;
          }})) code1 = 1;
        if ((code1 === 0) && (code2 === 0)) {
          if (equal) {
            oksmaller = n1 <= n2}
           else oksmaller = n1 < n2;
        } else {
          if ($mod.TTMSFNCUtils.IsDate(compstr,{get: function () {
              return dt2;
            }, set: function (v) {
              dt2 = v;
            }}) && $mod.TTMSFNCUtils.IsDate(s1a,{get: function () {
              return dt1;
            }, set: function (v) {
              dt1 = v;
            }})) {
            if (equal) {
              oksmaller = dt1 <= dt2}
             else oksmaller = dt1 < dt2;
          } else {
            if (equal) {
              oksmaller = pas.SysUtils.CompareStr(compstr,s1a) >= 0}
             else oksmaller = pas.SysUtils.CompareStr(compstr,s1a) > 0;
          };
        };
        flag2 = true;
      };
      s2 = rtl.rc(pas.System.Pos(negation,s0a),-2147483648,2147483647);
      if (s2 !== 0) {
        s2 += 1;
        while (rtl.rcCharAt(s0a,s2 - i - 1) === " ") s2 += 1;
        s3 = rtl.rc(s2,-2147483648,2147483647);
        len = 0;
        lastchar = "\x00";
        q = 0;
        while (((s2 - i) <= s0a.length) && (rtl.rcCharAt(s0a,s2 - i - 1) !== " ") && (s2 <= s0a.length) && (pas.System.Odd(q) || ((rtl.rcCharAt(s0a,s2 - i - 1) !== "&") && (rtl.rcCharAt(s0a,s2 - i - 1) !== "|")))) {
          if (rtl.rcCharAt(s0a,s2 - i - 1) === '"') q += 1;
          if ((len === 0) && (rtl.rcCharAt(s0a,s2 - i - 1) === '"')) {
            s3 += 1}
           else len += 1;
          lastchar = rtl.rcc(rtl.rcCharAt(s0a,s2 - i - 1),0,65535);
          s2 += 1;
        };
        if ((len > 0) && (lastchar === '"')) len -= 1;
        compstr = pas.System.Copy(s0a,s3,len);
        flag3 = true;
      };
      if (flag3) {
        if (pas.System.Pos(larger,s0a) === 0) flag1 = flag3;
        if (pas.System.Pos(smaller,s0a) === 0) flag2 = flag3;
      };
      if (pas.System.Pos(logor,s0a) !== 0) if (flag1 || flag2) {
        Result = oksmaller || oklarger;
        return Result;
      };
      if (pas.System.Pos(logand,s0a) !== 0) if (flag1 && flag2) {
        Result = oksmaller && oklarger;
        return Result;
      };
      if (((pas.System.Pos(larger,s0a) !== 0) && oklarger) || ((pas.System.Pos(smaller,s0a) !== 0) && oksmaller)) {
        Result = true;
        return Result;
      };
      s0 = 1;
      s1 = 1;
      done = (s0a === "") || (s1a === "");
      matching = true;
      while (!done && matching) {
        var $tmp = rtl.rcCharAt(s0a,s0 - i - 1);
        if ($tmp === qmark) {
          matching = s1 <= s1a.length;
          if (matching) {
            s0 += 1;
            s1 += 1;
          };
        } else if ($tmp === negation) {
          negflag = true;
          s0 += 1;
        } else if ($tmp === '"') {
          s0 += 1;
        } else if ($tmp === asterix) {
          do {
            s0 += 1;
          } while (!(((s0 - i) > s0a.length) || (rtl.rcCharAt(s0a,s0 - i - 1) !== asterix)));
          len = rtl.rc(s1a.length - s1,-2147483648,2147483647);
          s1 += len;
          matching = this.Matches(pas.System.Copy(s0a,s0,s0a.length),pas.System.Copy(s1a,s1,s1a.length));
          while ((len >= 0) && !matching) {
            s1 -= 1;
            len -= 1;
            matching = this.Matches(pas.System.Copy(s0a,s0,s0a.length),pas.System.Copy(s1a,s1,s1a.length));
          };
          if (matching) {
            s0 = rtl.rc(s0a.length + 1,-2147483648,2147483647);
            s1 = rtl.rc(s1a.length + 1,-2147483648,2147483647);
          };
        } else {
          if ((s0 <= s0a.length) && (s1 <= s1a.length)) {
            matching = rtl.rcCharAt(s0a,s0 - i - 1) === rtl.rcCharAt(s1a,s1 - i - 1)}
           else matching = false;
          if (matching) {
            s0 += 1;
            s1 += 1;
          };
        };
        done = (s0 > s0a.length) && (s1 > s1a.length);
      };
      if (negflag) {
        Result = !matching}
       else Result = matching;
      return Result;
    };
    this.StripThousandSep = function (ps) {
      var Result = "";
      var i = 0;
      var s = "";
      Result = "";
      s = ps;
      for (var $l = 1, $end = s.length; $l <= $end; $l++) {
        i = $l;
        if (s.charAt(i - 1) === pas.SysUtils.FormatSettings.DecimalSeparator) {
          Result = Result + "."}
         else if (s.charAt(i - 1) !== pas.SysUtils.FormatSettings.ThousandSeparator) Result = Result + s.charAt(i - 1);
      };
      return Result;
    };
    this.ClosingParenthesis = function (s1) {
      var Result = 0;
      var i = 0;
      var j = 0;
      var k = 0;
      var r = 0;
      r = 0;
      j = 0;
      k = 0;
      i = 1;
      while (i <= s1.length) {
        if (s1.charAt(i - 1) === ")") k += 1;
        if (s1.charAt(i - 1) === "(") j += 1;
        if ((s1.charAt(i - 1) === ")") && (j === k)) {
          r = i;
          break;
        };
        i += 1;
      };
      Result = r;
      return Result;
    };
    this.GetMarkupIndex = function (Markup) {
      var Result = 0;
      Result = this.IndexOfTextInArray(Markup,$impl.HTMLSpecialChar);
      return Result;
    };
    this.GetSpecialChar = function (Value) {
      var Result = "";
      Result = $impl.HTMLEncodedChar[Value - 1];
      return Result;
    };
    this.IndexOfTextInArray = function (AText, AValues) {
      var Result = 0;
      var I = 0;
      Result = -1;
      for (var $l = 0, $end = rtl.length(AValues) - 1; $l <= $end; $l++) {
        I = $l;
        if (pas.SysUtils.SameText(AText,AValues[I])) {
          if ((pas.System.Pos("cute",AText) > 0) || (pas.System.Pos("grave",AText) > 0) || (pas.System.Pos("uml",AText) > 0) || (pas.System.Pos("circ",AText) > 0) || (pas.System.Pos("tilde",AText) > 0) || (pas.System.Pos("ring",AText) > 0) || (pas.System.Pos("cedil",AText) > 0)) {
            if (AText === AValues[I]) {
              Result = I;
              break;
            };
          } else {
            Result = I;
            break;
          };
        };
      };
      return Result;
    };
    this.GetParentForm = function (AControl) {
      var Result = null;
      var c = null;
      Result = null;
      c = AControl;
      if (!(c != null)) return Result;
      if (pas["WEBLib.Forms"].TCustomForm.isPrototypeOf(c.FParent)) {
        Result = rtl.as(c.FParent,pas["WEBLib.Forms"].TCustomForm)}
       else Result = this.GetParentForm(c.FParent);
      return Result;
    };
    this.GetOwnerForm = function (AComponent) {
      var Result = null;
      var c = null;
      Result = null;
      c = AComponent;
      if (!(c != null)) return Result;
      if (pas["WEBLib.Forms"].TCustomForm.isPrototypeOf(c.FOwner)) {
        Result = rtl.as(c.FOwner,pas["WEBLib.Forms"].TCustomForm)}
       else Result = this.GetOwnerForm(c.FOwner);
      return Result;
    };
    this.Message = function (AMessage) {
      var Result = 0;
      Result = $mod.TTMSFNCUtils.Message$1(AMessage,pas["WEBLib.Dialogs"].TMsgDlgType.mtInformation,rtl.createSet(pas["WEBLib.Dialogs"].TMsgDlgBtn.mbOK),0);
      return Result;
    };
    this.Message$1 = function (AMessage, ADialogType, AButtons, AHelpContext) {
      var Result = 0;
      Result = 0;
      if (((pas["WEBLib.Dialogs"].TMsgDlgBtn.mbOK in AButtons) && (pas["WEBLib.Dialogs"].TMsgDlgBtn.mbCancel in AButtons)) || ((pas["WEBLib.Dialogs"].TMsgDlgBtn.mbYes in AButtons) && (pas["WEBLib.Dialogs"].TMsgDlgBtn.mbNo in AButtons))) {
        if (window.confirm(AMessage))
        {
          return 1
        }
        else
        {
          return 2
        };
      } else {
        window.alert(AMessage);
        return 1;
      };
      return Result;
    };
    this.SelectFile = function (AFileName, ADefaultFolder, AFilter, ACallBack) {
      var Result = false;
      Result = true;
      if (ACallBack != null) ACallBack(AFileName.get(),Result);
      return Result;
    };
    this.SaveFile = function (AFileName, AFilter, ACallBack) {
      var Result = false;
      Result = true;
      return Result;
    };
    this.EscapeString = function (AValue) {
      var $Self = this;
      var Result = "";
      var res = "";
      var ch = "\x00";
      var i = 0;
      function EscapeSpecialChar(ch, s) {
        var Result = false;
        var i = 0;
        Result = false;
        s.set("");
        for (i = 1; i <= 7; i++) {
          if (ch === $impl.JSONSpecialChar[i - 1]) {
            s.set($impl.JSONEncodedSpecialChar[i - 1]);
            Result = true;
            break;
          };
        };
        return Result;
      };
      Result = "";
      for (var $l = 1, $end = AValue.length; $l <= $end; $l++) {
        i = $l;
        ch = this.CharInStr(AValue,i);
        if (ch > "") {
          Result = Result + "\\u" + pas.SysUtils.IntToHex(ch.charCodeAt(),4)}
         else {
          res = "";
          if (EscapeSpecialChar(ch,{get: function () {
              return res;
            }, set: function (v) {
              res = v;
            }})) {
            Result = Result + res}
           else Result = Result + ch;
        };
      };
      return Result;
    };
    this.UnescapeString = function (AValue) {
      var Result = "";
      var i = 0;
      var j = 0;
      var c = 0;
      var o = 0;
      var s = "";
      var x = 0;
      s = rtl.strSetLength(s,AValue.length);
      o = 0;
      i = 1;
      j = 1;
      while (i <= AValue.length) {
        if (AValue.charAt(i - o - 1) === "\\") {
          if (i < AValue.length) {
            if (AValue.charAt((i + 1) - o - 1) === "\\") {
              x = j - o;
              s = rtl.setCharAt(s,x - 1,"\\");
              i += 2;
            } else if (AValue.charAt((i + 1) - o - 1) === "/") {
              x = j - o;
              s = rtl.setCharAt(s,x - 1,"/");
              i += 2;
            } else if (AValue.charAt((i + 1) - o - 1) === "b") {
              x = j - o;
              s = rtl.setCharAt(s,x - 1,"\b");
              i += 2;
            } else if (AValue.charAt((i + 1) - o - 1) === "f") {
              x = j - o;
              s = rtl.setCharAt(s,x - 1,"\f");
              i += 2;
            } else if (AValue.charAt((i + 1) - o - 1) === "n") {
              x = j - o;
              s = rtl.setCharAt(s,x - 1,"\n");
              i += 2;
            } else if (AValue.charAt((i + 1) - o - 1) === "r") {
              x = j - o;
              s = rtl.setCharAt(s,x - 1,"\r");
              i += 2;
            } else if (AValue.charAt((i + 1) - o - 1) === "t") {
              x = j - o;
              s = rtl.setCharAt(s,x - 1,"\t");
              i += 2;
            } else if (AValue.charAt((i + 1) - o - 1) === '"') {
              x = j - o;
              s = rtl.setCharAt(s,x - 1,'"');
              i += 2;
            } else if ((AValue.charAt((i + 1) - o - 1) === "u") && ((i + 1 + 4) <= AValue.length) && pas.SysUtils.TryStrToInt("$" + pas.System.Copy(AValue,i + 2,4),{get: function () {
                return c;
              }, set: function (v) {
                c = v;
              }})) {
              i += 6;
              x = j - o;
              s = rtl.setCharAt(s,x - 1,String.fromCharCode(c));
            } else throw pas.SysUtils.Exception.$create("CreateFmt",["Invalid code at position %s",pas.System.VarRecs(18,pas.SysUtils.IntToStr(i))]);
          } else throw pas.SysUtils.Exception.$create("Create$1",["Unexpected end of string"]);
        } else {
          x = j - o;
          s = rtl.setCharAt(s,x - 1,AValue.charAt(i - o - 1));
          i += 1;
        };
        j += 1;
      };
      s = rtl.strSetLength(s,j - 1);
      Result = s;
      return Result;
    };
    this.DownloadImage = function (AURL) {
      var Result = null;
      Result = null;
      return Result;
    };
    var CSVSeparators = [",",";","#","\t","|","@","*","-","+","&"];
    this.GetBestDelimiter = function (ALine1, Aline2, ACheckDecimalSeperator) {
      var Result = "\x00";
      var I = 0;
      var parts1 = 0;
      var parts2 = 0;
      var maxParts = 0;
      var maxBackup = 0;
      var Del = "\x00";
      var DelBackup = "\x00";
      var SplitChar = "\x00";
      var s = null;
      Del = "\x00";
      DelBackup = ",";
      parts2 = -1;
      maxParts = 0;
      maxBackup = 0;
      for (I = 1; I <= 10; I++) {
        SplitChar = CSVSeparators[I - 1];
        s = pas.Classes.TStringList.$create("Create$1");
        try {
          $mod.TTMSFNCUtils.Split(SplitChar,ALine1,s,false);
          parts1 = s.GetCount();
          if (Aline2 !== "") {
            $mod.TTMSFNCUtils.Split(SplitChar,Aline2,s,false);
            parts2 = s.GetCount();
          };
          if (!ACheckDecimalSeperator || (SplitChar !== pas.SysUtils.FormatSettings.DecimalSeparator)) {
            if ((parts2 > 0) && (parts1 === parts2)) {
              if (parts1 > maxParts) {
                Del = SplitChar;
                maxParts = parts1;
              };
            } else {
              if (parts1 > maxBackup) {
                DelBackup = SplitChar;
                maxBackup = parts1;
              };
            };
          };
        } finally {
          s = rtl.freeLoc(s);
        };
      };
      if (Del !== "\x00") {
        Result = Del}
       else Result = DelBackup;
      return Result;
    };
    this.IfElse$$$G$$WEBLib$TMSFNCUtils$$TTMSFNCDataGridSortDirection = function (ACondition, AResultTRUE, AResultFALSE) {
      var Result = 0;
      if (ACondition) {
        Result = AResultTRUE}
       else Result = AResultFALSE;
      return Result;
    };
    this.IfElse$$$G$$WEBLib$TMSFNCUtils$$Longint = function (ACondition, AResultTRUE, AResultFALSE) {
      var Result = 0;
      if (ACondition) {
        Result = AResultTRUE}
       else Result = AResultFALSE;
      return Result;
    };
    this.IfElse$$$G$$WEBLib$TMSFNCUtils$$String = function (ACondition, AResultTRUE, AResultFALSE) {
      var Result = "";
      if (ACondition) {
        Result = AResultTRUE}
       else Result = AResultFALSE;
      return Result;
    };
  });
  this.TTMSFNCClipBoardFormat = {"0": "cfText", cfText: 0, "1": "cfRTF", cfRTF: 1, "2": "cfHTML", cfHTML: 2, "3": "cfBitmap", cfBitmap: 3, "4": "cfBitmapWin", cfBitmapWin: 4, "5": "cfStream", cfStream: 5, "6": "cfRichTextStream", cfRichTextStream: 6};
  this.$rtti.$Enum("TTMSFNCClipBoardFormat",{minvalue: 0, maxvalue: 6, ordtype: 1, enumtype: this.TTMSFNCClipBoardFormat});
  rtl.createClass(this,"TTMSFNCClipBoard",pas.System.TObject,function () {
    this.FClipboardData = "";
    this.HasFormat = function (AFormat) {
      rtl.rc(AFormat,0,6);
      var Result = false;
      Result = true;
      return Result;
    };
    this.HasContent = function () {
      var Result = false;
      Result = this.HasFormat($mod.TTMSFNCClipBoardFormat.cfText) || this.HasFormat($mod.TTMSFNCClipBoardFormat.cfRTF) || this.HasFormat($mod.TTMSFNCClipBoardFormat.cfBitmap) || this.HasFormat($mod.TTMSFNCClipBoardFormat.cfBitmapWin) || this.HasFormat($mod.TTMSFNCClipBoardFormat.cfRichTextStream) || this.HasFormat($mod.TTMSFNCClipBoardFormat.cfStream);
      return Result;
    };
    this.Clear = function () {
    };
    this.SetText = function (AText) {
      $mod.TTMSFNCClipBoard.FClipboardData = AText;
      window.navigator.clipboard.writeText(AText);
    };
    this.GetText = function () {
      var Result = "";
      Result = this.FClipboardData;
      return Result;
    };
    this.SetStream = function (AStream) {
      throw pas.SysUtils.Exception.$create("Create$1",["SetStream not supported"]);
    };
    this.GetStream = function () {
      var Result = null;
      Result = null;
      throw pas.SysUtils.Exception.$create("Create$1",["GetStream not supported"]);
      return Result;
    };
    this.SetBitmap = function (ABitmap) {
      throw pas.SysUtils.Exception.$create("Create$1",["SetBitmap not supported"]);
    };
    this.GetBitmap = function () {
      var Result = null;
      Result = null;
      throw pas.SysUtils.Exception.$create("Create$1",["GetBitmap not supported"]);
      return Result;
    };
    this.SetRichTextStream = function (AStream) {
      throw pas.SysUtils.Exception.$create("Create$1",["SetRichTextStream not supported"]);
    };
    this.GetRichTextStream = function () {
      var Result = null;
      Result = null;
      throw pas.SysUtils.Exception.$create("Create$1",["GetRichTextStream not supported"]);
      return Result;
    };
    this.SetRTF = function (ARTF) {
      throw pas.SysUtils.Exception.$create("Create$1",["SetRTF not supported"]);
    };
    this.GetRTF = function () {
      var Result = "";
      Result = "";
      throw pas.SysUtils.Exception.$create("Create$1",["GetRTF not supported"]);
      return Result;
    };
    this.SetHTML = function (AHTML) {
      throw pas.SysUtils.Exception.$create("Create$1",["SetHTML not supported"]);
    };
    this.GetHTML = function () {
      var Result = "";
      Result = "";
      throw pas.SysUtils.Exception.$create("Create$1",["GetHTML not supported"]);
      return Result;
    };
  });
  this.Hiword = function (L) {
    var Result = 0;
    Result = rtl.lw(L >>> 16);
    return Result;
  };
  this.LoWord = function (L) {
    var Result = 0;
    Result = L & 0xFFFF;
    return Result;
  };
  this.MakeWord = function (b1, b2) {
    var Result = 0;
    Result = b1 | (b2 << 8);
    return Result;
  };
  this.MakeLong = function (i1, i2) {
    var Result = 0;
    Result = i1 | (i2 << 16);
    return Result;
  };
  this.CreateUploadFile = function (AName, AData) {
    var Result = $mod.TTMSFNCUtilsFile.$new();
    Result.Data = AData;
    Result.Name = AName;
    return Result;
  };
  this.ExtractFileNameEx = function (AFile) {
    var Result = "";
    Result = AFile.Name;
    return Result;
  };
  this.GetMimeTypeEx = function (AFile) {
    var Result = "";
    Result = $mod.TTMSFNCUtils.GetMimeType(AFile.Name);
    return Result;
  };
  this.CF_FNCSTREAM = 0;
  this.CF_FNCRICHTEXTSTREAM = 0;
  this.CF_FNCRTF = 0;
  this.CF_FNCBITMAP = 0;
  this.CF_FNCHTML = 0;
  this.FNCFormatSettings = pas.SysUtils.TFormatSettings.$new();
  $mod.$implcode = function () {
    $impl.HTMLNumSpecialChar = 92;
    $impl.JSONNumSpecialChar = 7;
    $mod.$rtti.$StaticArray("HTMLEncodedChar$a",{dims: [92], eltype: rtl.string});
    $impl.HTMLEncodedChar = ["&","<",">",'"'," ","é","è","ë","ê","ó","ò","ö","ô","í","ì","ï","î","ú","ù","ü","û","á","à","ä","â","É","È","Ë","Ê","Ó","Ò","Ö","Ô","Í","Ì","Ï","Î","Ú","Ù","Ü","Û","Á","À","Ä","Â","ç","Ç","ø","Ø","å","Å","©","®","€","«","»","ã","Ã","õ","Õ","™","§","¶","ß","£","$","§","‰","¶","'","¥","¤","¢","±","¡","°","ý","Ý","¼","½","¾","Æ","æ","Ñ","ñ","Ð","´","µ","¶","·","²","³"];
    $mod.$rtti.$StaticArray("HTMLSpecialChar$a",{dims: [92], eltype: rtl.string});
    $impl.HTMLSpecialChar = ["&amp;","&lt;","&gt;","&quot;","&nbsp;","&eacute;","&egrave;","&euml;","&ecirc;","&oacute;","&ograve;","&ouml;","&ocirc;","&iacute;","&igrave;","&iuml;","&icirc;","&uacute;","&ugrave;","&uuml;","&ucirc;","&aacute;","&agrave;","&auml;","&acirc;","&Eacute;","&Egrave;","&Euml;","&Ecirc;","&Oacute;","&Ograve;","&Ouml;","&Ocirc;","&Iacute;","&Igrave;","&Iuml;","&Icirc;","&Uacute;","&Ugrave;","&Uuml;","&Ucirc;","&Aacute;","&Agrave;","&Auml;","&Acirc;","&ccedil;","&Ccedil;","&oslash;","&Oslash;","&aring;","&Aring;","&copy;","&reg;","&euro;","&laquo;","&raquo;","&atilde;","&Atilde;","&otilde;","&Otilde","&trade;","&sect;","&para;","&szlig;","&pound;","&#36;","&sect;","&permil;","&para;","&#39;","&yen;","&curren;","&cent;","&plusmn;","&iexcl;","&deg;","&#x00FD;","&#221;","&frac14;","&frac12;","&frac34;","&AElig;","&aelig;","&Ntilde;","&ntilde;","&ETH;","&acute;","&micro;","&para;","&middot","&sup2;","&sup3;"];
    $mod.$rtti.$StaticArray("JSONSpecialChar$a",{dims: [7], eltype: rtl.char});
    $impl.JSONSpecialChar = ['"',"\\","\b","\f","\n","\r","\t"];
    $mod.$rtti.$StaticArray("JSONEncodedSpecialChar$a",{dims: [7], eltype: rtl.string});
    $impl.JSONEncodedSpecialChar = ["\\u0022","\\u005C","\\u0008","\\u000C","\\u000A","\\u000D","\\u0009"];
    $impl.FMimeTypes = null;
    $impl.RegisterMimeTypes = function () {
      function AddType(AExt, AMimeType) {
        $impl.FMimeTypes.Add(AExt + $impl.FMimeTypes.GetNameValueSeparator() + AMimeType);
      };
      AddType("ez","application/andrew-inset");
      AddType("aw","application/applixware");
      AddType("atom","application/atom+xml");
      AddType("atomcat","application/atomcat+xml");
      AddType("atomsvc","application/atomsvc+xml");
      AddType("bson","application/bson");
      AddType("ccxml","application/ccxml+xml");
      AddType("cdmia","application/cdmi-capability");
      AddType("cdmic","application/cdmi-container");
      AddType("cdmid","application/cdmi-domain");
      AddType("cdmio","application/cdmi-object");
      AddType("cdmiq","application/cdmi-queue");
      AddType("cu","application/cu-seeme");
      AddType("davmount","application/davmount+xml");
      AddType("dbk","application/docbook+xml");
      AddType("dssc","application/dssc+der");
      AddType("xdssc","application/dssc+xml");
      AddType("ecma","application/ecmascript");
      AddType("emma","application/emma+xml");
      AddType("epub","application/epub+zip");
      AddType("exi","application/exi");
      AddType("pfr","application/font-tdpfr");
      AddType("gml","application/gml+xml");
      AddType("gpx","application/gpx+xml");
      AddType("gxf","application/gxf");
      AddType("stk","application/hyperstudio");
      AddType("ink","application/inkml+xml");
      AddType("inkml","application/inkml+xml");
      AddType("ipfix","application/ipfix");
      AddType("jar","application/java-archive");
      AddType("ser","application/java-serialized-object");
      AddType("class","application/java-vm");
      AddType("js","application/javascript");
      AddType("json","application/json");
      AddType("jsonml","application/jsonml+json");
      AddType("lostxml","application/lost+xml");
      AddType("hqx","application/mac-binhex40");
      AddType("cpt","application/mac-compactpro");
      AddType("mads","application/mads+xml");
      AddType("mrc","application/marc");
      AddType("mrcx","application/marcxml+xml");
      AddType("ma","application/mathematica");
      AddType("nb","application/mathematica");
      AddType("mb","application/mathematica");
      AddType("mathml","application/mathml+xml");
      AddType("mbox","application/mbox");
      AddType("mscml","application/mediaservercontrol+xml");
      AddType("metalink","application/metalink+xml");
      AddType("meta4","application/metalink4+xml");
      AddType("mets","application/mets+xml");
      AddType("mods","application/mods+xml");
      AddType("m21","application/mp21");
      AddType("mp21","application/mp21");
      AddType("mp4s","application/mp4");
      AddType("doc","application/msword");
      AddType("dot","application/msword");
      AddType("mxf","application/mxf");
      AddType("bin","application/octet-stream");
      AddType("bpk","application/octet-stream");
      AddType("class","application/octet-stream");
      AddType("deploy","application/octet-stream");
      AddType("dist","application/octet-stream");
      AddType("distz","application/octet-stream");
      AddType("dmg","application/octet-stream");
      AddType("dms","application/octet-stream");
      AddType("dump","application/octet-stream");
      AddType("elc","application/octet-stream");
      AddType("iso","application/octet-stream");
      AddType("lha","application/octet-stream");
      AddType("lrf","application/octet-stream");
      AddType("lzh","application/octet-stream");
      AddType("mar","application/octet-stream");
      AddType("pkg","application/octet-stream");
      AddType("so","application/octet-stream");
      AddType("oda","application/oda");
      AddType("opf","application/oebps-package+xml");
      AddType("ogx","application/ogg");
      AddType("omdoc","application/omdoc+xml");
      AddType("onetoc","application/onenote");
      AddType("onetoc2","application/onenote");
      AddType("onetmp","application/onenote");
      AddType("onepkg","application/onenote");
      AddType("oxps","application/oxps");
      AddType("xer","application/patch-ops-error+xml");
      AddType("pdf","application/pdf");
      AddType("pgp","application/pgp-encrypted");
      AddType("asc","application/pgp-signature");
      AddType("sig","application/pgp-signature");
      AddType("prf","application/pics-rules");
      AddType("p10","application/pkcs10");
      AddType("p7m","application/pkcs7-mime");
      AddType("p7c","application/pkcs7-mime");
      AddType("p7s","application/pkcs7-signature");
      AddType("p8","application/pkcs8");
      AddType("ac","application/pkix-attr-cert");
      AddType("cer","application/pkix-cert");
      AddType("crl","application/pkix-crl");
      AddType("pkipath","application/pkix-pkipath");
      AddType("pki","application/pkixcmp");
      AddType("pls","application/pls+xml");
      AddType("ai","application/postscript");
      AddType("eps","application/postscript");
      AddType("ps","application/postscript");
      AddType("cww","application/prs.cww");
      AddType("pskcxml","application/pskc+xml");
      AddType("rdf","application/rdf+xml");
      AddType("rif","application/reginfo+xml");
      AddType("rnc","application/relax-ng-compact-syntax");
      AddType("rl","application/resource-lists+xml");
      AddType("rld","application/resource-lists-diff+xml");
      AddType("rs","application/rls-services+xml");
      AddType("gbr","application/rpki-ghostbusters");
      AddType("mft","application/rpki-manifest");
      AddType("roa","application/rpki-roa");
      AddType("rsd","application/rsd+xml");
      AddType("rss","application/rss+xml");
      AddType("rtf","application/rtf");
      AddType("sbml","application/sbml+xml");
      AddType("scq","application/scvp-cv-request");
      AddType("scs","application/scvp-cv-response");
      AddType("spq","application/scvp-vp-request");
      AddType("spp","application/scvp-vp-response");
      AddType("sdp","application/sdp");
      AddType("setpay","application/set-payment-initiation");
      AddType("setreg","application/set-registration-initiation");
      AddType("shf","application/shf+xml");
      AddType("smi","application/smil+xml");
      AddType("smil","application/smil+xml");
      AddType("soap","application/soap+xml");
      AddType("rq","application/sparql-query");
      AddType("srx","application/sparql-results+xml");
      AddType("gram","application/srgs");
      AddType("grxml","application/srgs+xml");
      AddType("sru","application/sru+xml");
      AddType("ssdl","application/ssdl+xml");
      AddType("ssml","application/ssml+xml");
      AddType("tei","application/tei+xml");
      AddType("teicorpus","application/tei+xml");
      AddType("tfi","application/thraud+xml");
      AddType("tsd","application/timestamped-data");
      AddType("plb","application/vnd.3gpp.pic-bw-large");
      AddType("psb","application/vnd.3gpp.pic-bw-small");
      AddType("pvb","application/vnd.3gpp.pic-bw-var");
      AddType("tcap","application/vnd.3gpp2.tcap");
      AddType("pwn","application/vnd.3m.post-it-notes");
      AddType("aso","application/vnd.accpac.simply.aso");
      AddType("imp","application/vnd.accpac.simply.imp");
      AddType("acu","application/vnd.acucobol");
      AddType("atc","application/vnd.acucorp");
      AddType("acutc","application/vnd.acucorp");
      AddType("air","application/vnd.adobe.air-application-installer-package+zip");
      AddType("fcdt","application/vnd.adobe.formscentral.fcdt");
      AddType("fxp","application/vnd.adobe.fxp");
      AddType("fxpl","application/vnd.adobe.fxp");
      AddType("xdp","application/vnd.adobe.xdp+xml");
      AddType("xfdf","application/vnd.adobe.xfdf");
      AddType("ahead","application/vnd.ahead.space");
      AddType("azf","application/vnd.airzip.filesecure.azf");
      AddType("azs","application/vnd.airzip.filesecure.azs");
      AddType("azw","application/vnd.amazon.ebook");
      AddType("acc","application/vnd.americandynamics.acc");
      AddType("ami","application/vnd.amiga.ami");
      AddType("apk","application/vnd.android.package-archive");
      AddType("cii","application/vnd.anser-web-certificate-issue-initiation");
      AddType("fti","application/vnd.anser-web-funds-transfer-initiation");
      AddType("atx","application/vnd.antix.game-component");
      AddType("mpkg","application/vnd.apple.installer+xml");
      AddType("m3u8","application/vnd.apple.mpegurl");
      AddType("swi","application/vnd.aristanetworks.swi");
      AddType("iota","application/vnd.astraea-software.iota");
      AddType("aep","application/vnd.audiograph");
      AddType("mpm","application/vnd.blueice.multipass");
      AddType("bmi","application/vnd.bmi");
      AddType("rep","application/vnd.businessobjects");
      AddType("cdxml","application/vnd.chemdraw+xml");
      AddType("mmd","application/vnd.chipnuts.karaoke-mmd");
      AddType("cdy","application/vnd.cinderella");
      AddType("cla","application/vnd.claymore");
      AddType("rp9","application/vnd.cloanto.rp9");
      AddType("c4g","application/vnd.clonk.c4group");
      AddType("c4d","application/vnd.clonk.c4group");
      AddType("c4f","application/vnd.clonk.c4group");
      AddType("c4p","application/vnd.clonk.c4group");
      AddType("c4u","application/vnd.clonk.c4group");
      AddType("c11amc","application/vnd.cluetrust.cartomobile-config");
      AddType("c11amz","application/vnd.cluetrust.cartomobile-config-pkg");
      AddType("csp","application/vnd.commonspace");
      AddType("cdbcmsg","application/vnd.contact.cmsg");
      AddType("cmc","application/vnd.cosmocaller");
      AddType("clkx","application/vnd.crick.clicker");
      AddType("clkk","application/vnd.crick.clicker.keyboard");
      AddType("clkp","application/vnd.crick.clicker.palette");
      AddType("clkt","application/vnd.crick.clicker.template");
      AddType("clkw","application/vnd.crick.clicker.wordbank");
      AddType("wbs","application/vnd.criticaltools.wbs+xml");
      AddType("pml","application/vnd.ctc-posml");
      AddType("ppd","application/vnd.cups-ppd");
      AddType("car","application/vnd.curl.car");
      AddType("pcurl","application/vnd.curl.pcurl");
      AddType("dart","application/vnd.dart");
      AddType("rdz","application/vnd.data-vision.rdz");
      AddType("uvf","application/vnd.dece.data");
      AddType("uvvf","application/vnd.dece.data");
      AddType("uvd","application/vnd.dece.data");
      AddType("uvvd","application/vnd.dece.data");
      AddType("uvt","application/vnd.dece.ttml+xml");
      AddType("uvvt","application/vnd.dece.ttml+xml");
      AddType("uvx","application/vnd.dece.unspecified");
      AddType("uvvx","application/vnd.dece.unspecified");
      AddType("uvz","application/vnd.dece.zip");
      AddType("uvvz","application/vnd.dece.zip");
      AddType("fe_launch","application/vnd.denovo.fcselayout-link");
      AddType("dna","application/vnd.dna");
      AddType("mlp","application/vnd.dolby.mlp");
      AddType("dpg","application/vnd.dpgraph");
      AddType("dfac","application/vnd.dreamfactory");
      AddType("kpxx","application/vnd.ds-keypoint");
      AddType("ait","application/vnd.dvb.ait");
      AddType("svc","application/vnd.dvb.service");
      AddType("geo","application/vnd.dynageo");
      AddType("mag","application/vnd.ecowin.chart");
      AddType("nml","application/vnd.enliven");
      AddType("esf","application/vnd.epson.esf");
      AddType("msf","application/vnd.epson.msf");
      AddType("qam","application/vnd.epson.quickanime");
      AddType("slt","application/vnd.epson.salt");
      AddType("ssf","application/vnd.epson.ssf");
      AddType("es3","application/vnd.eszigno3+xml");
      AddType("et3","application/vnd.eszigno3+xml");
      AddType("ez2","application/vnd.ezpix-album");
      AddType("ez3","application/vnd.ezpix-package");
      AddType("fdf","application/vnd.fdf");
      AddType("mseed","application/vnd.fdsn.mseed");
      AddType("seed","application/vnd.fdsn.seed");
      AddType("dataless","application/vnd.fdsn.seed");
      AddType("json","application/vnd.firedac.json");
      AddType("xml","application/vnd.firedac.xml");
      AddType("bin","application/vnd.firedac.bin");
      AddType("gph","application/vnd.flographit");
      AddType("ftc","application/vnd.fluxtime.clip");
      AddType("fm","application/vnd.framemaker");
      AddType("frame","application/vnd.framemaker");
      AddType("maker","application/vnd.framemaker");
      AddType("book","application/vnd.framemaker");
      AddType("fnc","application/vnd.frogans.fnc");
      AddType("ltf","application/vnd.frogans.ltf");
      AddType("fsc","application/vnd.fsc.weblaunch");
      AddType("oas","application/vnd.fujitsu.oasys");
      AddType("oa2","application/vnd.fujitsu.oasys2");
      AddType("oa3","application/vnd.fujitsu.oasys3");
      AddType("fg5","application/vnd.fujitsu.oasysgp");
      AddType("bh2","application/vnd.fujitsu.oasysprs");
      AddType("ddd","application/vnd.fujixerox.ddd");
      AddType("xdw","application/vnd.fujixerox.docuworks");
      AddType("xbd","application/vnd.fujixerox.docuworks.binder");
      AddType("fzs","application/vnd.fuzzysheet");
      AddType("txd","application/vnd.genomatix.tuxedo");
      AddType("ggb","application/vnd.geogebra.file");
      AddType("ggt","application/vnd.geogebra.tool");
      AddType("gex","application/vnd.geometry-explorer");
      AddType("gre","application/vnd.geometry-explorer");
      AddType("gxt","application/vnd.geonext");
      AddType("g2w","application/vnd.geoplan");
      AddType("g3w","application/vnd.geospace");
      AddType("gmx","application/vnd.gmx");
      AddType("kml","application/vnd.google-earth.kml+xml");
      AddType("kmz","application/vnd.google-earth.kmz");
      AddType("gqf","application/vnd.grafeq");
      AddType("gqs","application/vnd.grafeq");
      AddType("gac","application/vnd.groove-account");
      AddType("ghf","application/vnd.groove-help");
      AddType("gim","application/vnd.groove-identity-message");
      AddType("grv","application/vnd.groove-injector");
      AddType("gtm","application/vnd.groove-tool-message");
      AddType("tpl","application/vnd.groove-tool-template");
      AddType("vcg","application/vnd.groove-vcard");
      AddType("hal","application/vnd.hal+xml");
      AddType("zmm","application/vnd.handheld-entertainment+xml");
      AddType("hbci","application/vnd.hbci");
      AddType("les","application/vnd.hhe.lesson-player");
      AddType("hpgl","application/vnd.hp-hpgl");
      AddType("hpid","application/vnd.hp-hpid");
      AddType("hps","application/vnd.hp-hps");
      AddType("jlt","application/vnd.hp-jlyt");
      AddType("pcl","application/vnd.hp-pcl");
      AddType("pclxl","application/vnd.hp-pclxl");
      AddType("sfd-hdstx","application/vnd.hydrostatix.sof-data");
      AddType("mpy","application/vnd.ibm.minipay");
      AddType("afp","application/vnd.ibm.modcap");
      AddType("listafp","application/vnd.ibm.modcap");
      AddType("list3820","application/vnd.ibm.modcap");
      AddType("irm","application/vnd.ibm.rights-management");
      AddType("sc","application/vnd.ibm.secure-container");
      AddType("icc","application/vnd.iccprofile");
      AddType("icm","application/vnd.iccprofile");
      AddType("igl","application/vnd.igloader");
      AddType("ivp","application/vnd.immervision-ivp");
      AddType("ivu","application/vnd.immervision-ivu");
      AddType("igm","application/vnd.insors.igm");
      AddType("xpw","application/vnd.intercon.formnet");
      AddType("xpx","application/vnd.intercon.formnet");
      AddType("i2g","application/vnd.intergeo");
      AddType("qbo","application/vnd.intu.qbo");
      AddType("qfx","application/vnd.intu.qfx");
      AddType("rcprofile","application/vnd.ipunplugged.rcprofile");
      AddType("irp","application/vnd.irepository.package+xml");
      AddType("xpr","application/vnd.is-xpr");
      AddType("fcs","application/vnd.isac.fcs");
      AddType("jam","application/vnd.jam");
      AddType("rms","application/vnd.jcp.javame.midlet-rms");
      AddType("jisp","application/vnd.jisp");
      AddType("joda","application/vnd.joost.joda-archive");
      AddType("ktz","application/vnd.kahootz");
      AddType("ktr","application/vnd.kahootz");
      AddType("karbon","application/vnd.kde.karbon");
      AddType("chrt","application/vnd.kde.kchart");
      AddType("kfo","application/vnd.kde.kformula");
      AddType("flw","application/vnd.kde.kivio");
      AddType("kon","application/vnd.kde.kontour");
      AddType("kpr","application/vnd.kde.kpresenter");
      AddType("kpt","application/vnd.kde.kpresenter");
      AddType("ksp","application/vnd.kde.kspread");
      AddType("kwd","application/vnd.kde.kword");
      AddType("kwt","application/vnd.kde.kword");
      AddType("htke","application/vnd.kenameaapp");
      AddType("kia","application/vnd.kidspiration");
      AddType("kne","application/vnd.kinar");
      AddType("knp","application/vnd.kinar");
      AddType("skp","application/vnd.koan");
      AddType("skd","application/vnd.koan");
      AddType("skt","application/vnd.koan");
      AddType("skm","application/vnd.koan");
      AddType("sse","application/vnd.kodak-descriptor");
      AddType("lasxml","application/vnd.las.las+xml");
      AddType("lbd","application/vnd.llamagraphics.life-balance.desktop");
      AddType("lbe","application/vnd.llamagraphics.life-balance.exchange+xml");
      AddType("123","application/vnd.lotus-1-2-3");
      AddType("apr","application/vnd.lotus-approach");
      AddType("pre","application/vnd.lotus-freelance");
      AddType("nsf","application/vnd.lotus-notes");
      AddType("org","application/vnd.lotus-organizer");
      AddType("scm","application/vnd.lotus-screencam");
      AddType("lwp","application/vnd.lotus-wordpro");
      AddType("portpkg","application/vnd.macports.portpkg");
      AddType("mcd","application/vnd.mcd");
      AddType("mc1","application/vnd.medcalcdata");
      AddType("cdkey","application/vnd.mediastation.cdkey");
      AddType("mwf","application/vnd.mfer");
      AddType("mfm","application/vnd.mfmp");
      AddType("flo","application/vnd.micrografx.flo");
      AddType("igx","application/vnd.micrografx.igx");
      AddType("mif","application/vnd.mif");
      AddType("daf","application/vnd.mobius.daf");
      AddType("dis","application/vnd.mobius.dis");
      AddType("mbk","application/vnd.mobius.mbk");
      AddType("mqy","application/vnd.mobius.mqy");
      AddType("msl","application/vnd.mobius.msl");
      AddType("plc","application/vnd.mobius.plc");
      AddType("txf","application/vnd.mobius.txf");
      AddType("mpn","application/vnd.mophun.application");
      AddType("mpc","application/vnd.mophun.certificate");
      AddType("xul","application/vnd.mozilla.xul+xml");
      AddType("cil","application/vnd.ms-artgalry");
      AddType("cab","application/vnd.ms-cab-compressed");
      AddType("xls","application/vnd.ms-excel");
      AddType("xlm","application/vnd.ms-excel");
      AddType("xla","application/vnd.ms-excel");
      AddType("xlc","application/vnd.ms-excel");
      AddType("xlt","application/vnd.ms-excel");
      AddType("xlw","application/vnd.ms-excel");
      AddType("xlam","application/vnd.ms-excel.addin.macroenabled.12");
      AddType("xlsb","application/vnd.ms-excel.sheet.binary.macroenabled.12");
      AddType("xlsm","application/vnd.ms-excel.sheet.macroenabled.12");
      AddType("xltm","application/vnd.ms-excel.template.macroenabled.12");
      AddType("eot","application/vnd.ms-fontobject");
      AddType("chm","application/vnd.ms-htmlhelp");
      AddType("ims","application/vnd.ms-ims");
      AddType("lrm","application/vnd.ms-lrm");
      AddType("thmx","application/vnd.ms-officetheme");
      AddType("cat","application/vnd.ms-pki.seccat");
      AddType("stl","application/vnd.ms-pki.stl");
      AddType("ppt","application/vnd.ms-powerpoint");
      AddType("pps","application/vnd.ms-powerpoint");
      AddType("pot","application/vnd.ms-powerpoint");
      AddType("ppam","application/vnd.ms-powerpoint.addin.macroenabled.12");
      AddType("pptm","application/vnd.ms-powerpoint.presentation.macroenabled.12");
      AddType("sldm","application/vnd.ms-powerpoint.slide.macroenabled.12");
      AddType("ppsm","application/vnd.ms-powerpoint.slideshow.macroenabled.12");
      AddType("potm","application/vnd.ms-powerpoint.template.macroenabled.12");
      AddType("mpp","application/vnd.ms-project");
      AddType("mpt","application/vnd.ms-project");
      AddType("docm","application/vnd.ms-word.document.macroenabled.12");
      AddType("dotm","application/vnd.ms-word.template.macroenabled.12");
      AddType("wps","application/vnd.ms-works");
      AddType("wks","application/vnd.ms-works");
      AddType("wcm","application/vnd.ms-works");
      AddType("wdb","application/vnd.ms-works");
      AddType("wpl","application/vnd.ms-wpl");
      AddType("xps","application/vnd.ms-xpsdocument");
      AddType("mseq","application/vnd.mseq");
      AddType("mus","application/vnd.musician");
      AddType("msty","application/vnd.muvee.style");
      AddType("taglet","application/vnd.mynfc");
      AddType("nlu","application/vnd.neurolanguage.nlu");
      AddType("ntf","application/vnd.nitf");
      AddType("nitf","application/vnd.nitf");
      AddType("nnd","application/vnd.noblenet-directory");
      AddType("nns","application/vnd.noblenet-sealer");
      AddType("nnw","application/vnd.noblenet-web");
      AddType("ngdat","application/vnd.nokia.n-gage.data");
      AddType("n-gage","application/vnd.nokia.n-gage.symbian.install");
      AddType("rpst","application/vnd.nokia.radio-preset");
      AddType("rpss","application/vnd.nokia.radio-presets");
      AddType("edm","application/vnd.novadigm.edm");
      AddType("edx","application/vnd.novadigm.edx");
      AddType("FExt","application/vnd.novadigm.FExt");
      AddType("odc","application/vnd.oasis.opendocument.chart");
      AddType("otc","application/vnd.oasis.opendocument.chart-template");
      AddType("odb","application/vnd.oasis.opendocument.database");
      AddType("odf","application/vnd.oasis.opendocument.formula");
      AddType("odft","application/vnd.oasis.opendocument.formula-template");
      AddType("odg","application/vnd.oasis.opendocument.graphics");
      AddType("otg","application/vnd.oasis.opendocument.graphics-template");
      AddType("odi","application/vnd.oasis.opendocument.image");
      AddType("oti","application/vnd.oasis.opendocument.image-template");
      AddType("odp","application/vnd.oasis.opendocument.presentation");
      AddType("otp","application/vnd.oasis.opendocument.presentation-template");
      AddType("ods","application/vnd.oasis.opendocument.spreadsheet");
      AddType("ots","application/vnd.oasis.opendocument.spreadsheet-template");
      AddType("odt","application/vnd.oasis.opendocument.text");
      AddType("odm","application/vnd.oasis.opendocument.text-master");
      AddType("ott","application/vnd.oasis.opendocument.text-template");
      AddType("oth","application/vnd.oasis.opendocument.text-web");
      AddType("xo","application/vnd.olpc-sugar");
      AddType("dd2","application/vnd.oma.dd2+xml");
      AddType("oxt","application/vnd.openofficeorg.extension");
      AddType("pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation");
      AddType("sldx","application/vnd.openxmlformats-officedocument.presentationml.slide");
      AddType("ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow");
      AddType("potx","application/vnd.openxmlformats-officedocument.presentationml.template");
      AddType("xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
      AddType("xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template");
      AddType("docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document");
      AddType("dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template");
      AddType("mgp","application/vnd.osgeo.mapguide.package");
      AddType("dp","application/vnd.osgi.dp");
      AddType("esa","application/vnd.osgi.subsystem");
      AddType("pdb","application/vnd.palm");
      AddType("pqa","application/vnd.palm");
      AddType("oprc","application/vnd.palm");
      AddType("paw","application/vnd.pawaafile");
      AddType("str","application/vnd.pg.format");
      AddType("ei6","application/vnd.pg.osasli");
      AddType("efif","application/vnd.picsel");
      AddType("wg","application/vnd.pmi.widget");
      AddType("plf","application/vnd.pocketlearn");
      AddType("pbd","application/vnd.powerbuilder6");
      AddType("box","application/vnd.previewsystems.box");
      AddType("mgz","application/vnd.proteus.magazine");
      AddType("qps","application/vnd.publishare-delta-tree");
      AddType("ptid","application/vnd.pvi.ptid1");
      AddType("qxd","application/vnd.quark.quarkxpress");
      AddType("qxt","application/vnd.quark.quarkxpress");
      AddType("qwd","application/vnd.quark.quarkxpress");
      AddType("qwt","application/vnd.quark.quarkxpress");
      AddType("qxl","application/vnd.quark.quarkxpress");
      AddType("qxb","application/vnd.quark.quarkxpress");
      AddType("bed","application/vnd.realvnc.bed");
      AddType("mxl","application/vnd.recordare.musicxml");
      AddType("musicxml","application/vnd.recordare.musicxml+xml");
      AddType("cryptonote","application/vnd.rig.cryptonote");
      AddType("cod","application/vnd.rim.cod");
      AddType("rm","application/vnd.rn-realmedia");
      AddType("rmvb","application/vnd.rn-realmedia-vbr");
      AddType("link66","application/vnd.route66.link66+xml");
      AddType("st","application/vnd.sailingtracker.track");
      AddType("see","application/vnd.seemail");
      AddType("sema","application/vnd.sema");
      AddType("semd","application/vnd.semd");
      AddType("semf","application/vnd.semf");
      AddType("ifm","application/vnd.shana.informed.formdata");
      AddType("itp","application/vnd.shana.informed.formtemplate");
      AddType("iif","application/vnd.shana.informed.interchange");
      AddType("ipk","application/vnd.shana.informed.package");
      AddType("twd","application/vnd.simtech-mindmapper");
      AddType("twds","application/vnd.simtech-mindmapper");
      AddType("mmf","application/vnd.smaf");
      AddType("teacher","application/vnd.smart.teacher");
      AddType("sdkm","application/vnd.solent.sdkm+xml");
      AddType("sdkd","application/vnd.solent.sdkm+xml");
      AddType("dxp","application/vnd.spotfire.dxp");
      AddType("sfs","application/vnd.spotfire.sfs");
      AddType("sdc","application/vnd.stardivision.calc");
      AddType("sda","application/vnd.stardivision.draw");
      AddType("sdd","application/vnd.stardivision.impress");
      AddType("smf","application/vnd.stardivision.math");
      AddType("sdw","application/vnd.stardivision.writer");
      AddType("vor","application/vnd.stardivision.writer");
      AddType("sgl","application/vnd.stardivision.writer-global");
      AddType("smzip","application/vnd.stepmania.package");
      AddType("sm","application/vnd.stepmania.stepchart");
      AddType("sxc","application/vnd.sun.xml.calc");
      AddType("stc","application/vnd.sun.xml.calc.template");
      AddType("sxd","application/vnd.sun.xml.draw");
      AddType("std","application/vnd.sun.xml.draw.template");
      AddType("sxi","application/vnd.sun.xml.impress");
      AddType("sti","application/vnd.sun.xml.impress.template");
      AddType("sxm","application/vnd.sun.xml.math");
      AddType("sxw","application/vnd.sun.xml.writer");
      AddType("sxg","application/vnd.sun.xml.writer.global");
      AddType("stw","application/vnd.sun.xml.writer.template");
      AddType("sus","application/vnd.sus-calendar");
      AddType("susp","application/vnd.sus-calendar");
      AddType("svd","application/vnd.svd");
      AddType("sis","application/vnd.symbian.install");
      AddType("sisx","application/vnd.symbian.install");
      AddType("xsm","application/vnd.syncml+xml");
      AddType("bdm","application/vnd.syncml.dm+wbxml");
      AddType("xdm","application/vnd.syncml.dm+xml");
      AddType("tao","application/vnd.tao.intent-module-archive");
      AddType("pcap","application/vnd.tcpdump.pcap");
      AddType("cap","application/vnd.tcpdump.pcap");
      AddType("dmp","application/vnd.tcpdump.pcap");
      AddType("tmo","application/vnd.tmobile-livetv");
      AddType("tpt","application/vnd.trid.tpt");
      AddType("mxs","application/vnd.triscape.mxs");
      AddType("tra","application/vnd.trueapp");
      AddType("ufd","application/vnd.ufdl");
      AddType("ufdl","application/vnd.ufdl");
      AddType("utz","application/vnd.uiq.theme");
      AddType("umj","application/vnd.umajin");
      AddType("unityweb","application/vnd.unity");
      AddType("uoml","application/vnd.uoml+xml");
      AddType("vcx","application/vnd.vcx");
      AddType("vsd","application/vnd.visio");
      AddType("vst","application/vnd.visio");
      AddType("vss","application/vnd.visio");
      AddType("vsw","application/vnd.visio");
      AddType("vis","application/vnd.visionary");
      AddType("vsf","application/vnd.vsf");
      AddType("wbxml","application/vnd.wap.wbxml");
      AddType("wmlc","application/vnd.wap.wmlc");
      AddType("wmlsc","application/vnd.wap.wmlscriptc");
      AddType("wtb","application/vnd.webturbo");
      AddType("nbp","application/vnd.wolfram.player");
      AddType("wpd","application/vnd.wordperfect");
      AddType("wqd","application/vnd.wqd");
      AddType("stf","application/vnd.wt.stf");
      AddType("xar","application/vnd.xara");
      AddType("xfdl","application/vnd.xfdl");
      AddType("hvd","application/vnd.yamaha.hv-dic");
      AddType("hvs","application/vnd.yamaha.hv-script");
      AddType("hvp","application/vnd.yamaha.hv-voice");
      AddType("osf","application/vnd.yamaha.openscoreformat");
      AddType("osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml");
      AddType("saf","application/vnd.yamaha.smaf-audio");
      AddType("spf","application/vnd.yamaha.smaf-phrase");
      AddType("cmp","application/vnd.yellowriver-custom-menu");
      AddType("zir","application/vnd.zul");
      AddType("zirz","application/vnd.zul");
      AddType("zaz","application/vnd.zzazz.deck+xml");
      AddType("vxml","application/voicexml+xml");
      AddType("wgt","application/widget");
      AddType("hlp","application/winhlp");
      AddType("wsdl","application/wsdl+xml");
      AddType("wspolicy","application/wspolicy+xml");
      AddType("7z","application/x-7z-compressed");
      AddType("abw","application/x-abiword");
      AddType("ace","application/x-ace-compressed");
      AddType("dmg","application/x-apple-diskimage");
      AddType("aab","application/x-authorware-bin");
      AddType("x32","application/x-authorware-bin");
      AddType("u32","application/x-authorware-bin");
      AddType("vox","application/x-authorware-bin");
      AddType("aam","application/x-authorware-map");
      AddType("aas","application/x-authorware-seg");
      AddType("bcpio","application/x-bcpio");
      AddType("torrent","application/x-bittorrent");
      AddType("blb","application/x-blorb");
      AddType("blorb","application/x-blorb");
      AddType("bz","application/x-bzip");
      AddType("bz2","application/x-bzip2");
      AddType("boz","application/x-bzip2");
      AddType("cbr","application/x-cbr");
      AddType("cba","application/x-cbr");
      AddType("cbt","application/x-cbr");
      AddType("cbz","application/x-cbr");
      AddType("cb7","application/x-cbr");
      AddType("vcd","application/x-cdlink");
      AddType("cfs","application/x-cfs-compressed");
      AddType("chat","application/x-chat");
      AddType("pgn","application/x-chess-pgn");
      AddType("nsc","application/x-conference");
      AddType("cpio","application/x-cpio");
      AddType("csh","application/x-csh");
      AddType("deb","application/x-debian-package");
      AddType("udeb","application/x-debian-package");
      AddType("dgc","application/x-dgc-compressed");
      AddType("dir","application/x-director");
      AddType("dcr","application/x-director");
      AddType("dxr","application/x-director");
      AddType("cst","application/x-director");
      AddType("cct","application/x-director");
      AddType("cxt","application/x-director");
      AddType("w3d","application/x-director");
      AddType("fgd","application/x-director");
      AddType("swa","application/x-director");
      AddType("wad","application/x-doom");
      AddType("ncx","application/x-dtbncx+xml");
      AddType("dtb","application/x-dtbook+xml");
      AddType("res","application/x-dtbresource+xml");
      AddType("dvi","application/x-dvi");
      AddType("evy","application/x-envoy");
      AddType("eva","application/x-eva");
      AddType("bdf","application/x-font-bdf");
      AddType("gsf","application/x-font-ghostscript");
      AddType("psf","application/x-font-linux-psf");
      AddType("otf","application/x-font-otf");
      AddType("pcf","application/x-font-pcf");
      AddType("snf","application/x-font-snf");
      AddType("ttf","application/x-font-ttf");
      AddType("ttc","application/x-font-ttf");
      AddType("pfa","application/x-font-type1");
      AddType("pfb","application/x-font-type1");
      AddType("pfm","application/x-font-type1");
      AddType("afm","application/x-font-type1");
      AddType("woff","application/x-font-woff");
      AddType("arc","application/x-freearc");
      AddType("spl","application/x-futuresplash");
      AddType("gca","application/x-gca-compressed");
      AddType("ulx","application/x-glulx");
      AddType("gnumeric","application/x-gnumeric");
      AddType("gramps","application/x-gramps-xml");
      AddType("gtar","application/x-gtar");
      AddType("hdf","application/x-hdf");
      AddType("install","application/x-install-instructions");
      AddType("iso","application/x-iso9660-image");
      AddType("jnlp","application/x-java-jnlp-file");
      AddType("latex","application/x-latex");
      AddType("lzh","application/x-lzh-compressed");
      AddType("lha","application/x-lzh-compressed");
      AddType("mie","application/x-mie");
      AddType("prc","application/x-mobipocket-ebook");
      AddType("mobi","application/x-mobipocket-ebook");
      AddType("application","application/x-ms-application");
      AddType("lnk","application/x-ms-shortcut");
      AddType("wmd","application/x-ms-wmd");
      AddType("wmz","application/x-ms-wmz");
      AddType("xbap","application/x-ms-xbap");
      AddType("mdb","application/x-msaccess");
      AddType("obd","application/x-msbinder");
      AddType("crd","application/x-mscardfile");
      AddType("clp","application/x-msclip");
      AddType("exe","application/x-msdownload");
      AddType("dll","application/x-msdownload");
      AddType("com","application/x-msdownload");
      AddType("bat","application/x-msdownload");
      AddType("msi","application/x-msdownload");
      AddType("mvb","application/x-msmediaview");
      AddType("m13","application/x-msmediaview");
      AddType("m14","application/x-msmediaview");
      AddType("wmf","application/x-msmetafile");
      AddType("wmz","application/x-msmetafile");
      AddType("emf","application/x-msmetafile");
      AddType("emz","application/x-msmetafile");
      AddType("mny","application/x-msmoney");
      AddType("pub","application/x-mspublisher");
      AddType("scd","application/x-msschedule");
      AddType("trm","application/x-msterminal");
      AddType("wri","application/x-mswrite");
      AddType("nc","application/x-netcdf");
      AddType("cdf","application/x-netcdf");
      AddType("nzb","application/x-nzb");
      AddType("p12","application/x-pkcs12");
      AddType("pfx","application/x-pkcs12");
      AddType("p7b","application/x-pkcs7-certificates");
      AddType("spc","application/x-pkcs7-certificates");
      AddType("p7r","application/x-pkcs7-certreqresp");
      AddType("rar","application/x-rar-compressed");
      AddType("ris","application/x-research-info-systems");
      AddType("sh","application/x-sh");
      AddType("shar","application/x-shar");
      AddType("swf","application/x-shockwave-flash");
      AddType("xap","application/x-silverlight-app");
      AddType("sql","application/x-sql");
      AddType("sit","application/x-stuffit");
      AddType("sitx","application/x-stuffitx");
      AddType("srt","application/x-subrip");
      AddType("sv4cpio","application/x-sv4cpio");
      AddType("sv4crc","application/x-sv4crc");
      AddType("t3","application/x-t3vm-image");
      AddType("gam","application/x-tads");
      AddType("tar","application/x-tar");
      AddType("tcl","application/x-tcl");
      AddType("tex","application/x-tex");
      AddType("tfm","application/x-tex-tfm");
      AddType("texinfo","application/x-texinfo");
      AddType("texi","application/x-texinfo");
      AddType("obj","application/x-tgif");
      AddType("ustar","application/x-ustar");
      AddType("src","application/x-wais-source");
      AddType("der","application/x-x509-ca-cert");
      AddType("crt","application/x-x509-ca-cert");
      AddType("fig","application/x-xfig");
      AddType("xlf","application/x-xliff+xml");
      AddType("xpi","application/x-xpinstall");
      AddType("xz","application/x-xz");
      AddType("z1","application/x-zmachine");
      AddType("z2","application/x-zmachine");
      AddType("z3","application/x-zmachine");
      AddType("z4","application/x-zmachine");
      AddType("z5","application/x-zmachine");
      AddType("z6","application/x-zmachine");
      AddType("z7","application/x-zmachine");
      AddType("z8","application/x-zmachine");
      AddType("xaml","application/xaml+xml");
      AddType("xdf","application/xcap-diff+xml");
      AddType("xenc","application/xenc+xml");
      AddType("xhtml","application/xhtml+xml");
      AddType("xht","application/xhtml+xml");
      AddType("xml","application/xml");
      AddType("xsl","application/xml");
      AddType("dtd","application/xml-dtd");
      AddType("xop","application/xop+xml");
      AddType("xpl","application/xproc+xml");
      AddType("xslt","application/xslt+xml");
      AddType("xspf","application/xspf+xml");
      AddType("mxml","application/xv+xml");
      AddType("xhvml","application/xv+xml");
      AddType("xvml","application/xv+xml");
      AddType("xvm","application/xv+xml");
      AddType("yang","application/yang");
      AddType("yin","application/yin+xml");
      AddType("zip","application/zip");
      AddType("adp","audio/adpcm");
      AddType("au","audio/basic");
      AddType("snd","audio/basic");
      AddType("mid","audio/midi");
      AddType("midi","audio/midi");
      AddType("kar","audio/midi");
      AddType("rmi","audio/midi");
      AddType("mp4a","audio/mp4");
      AddType("mpga","audio/mpeg");
      AddType("mp2","audio/mpeg");
      AddType("mp2a","audio/mpeg");
      AddType("mp3","audio/mpeg");
      AddType("m2a","audio/mpeg");
      AddType("m3a","audio/mpeg");
      AddType("oga","audio/ogg");
      AddType("ogg","audio/ogg");
      AddType("spx","audio/ogg");
      AddType("s3m","audio/s3m");
      AddType("sil","audio/silk");
      AddType("uva","audio/vnd.dece.audio");
      AddType("uvva","audio/vnd.dece.audio");
      AddType("eol","audio/vnd.digital-winds");
      AddType("dra","audio/vnd.dra");
      AddType("dts","audio/vnd.dts");
      AddType("dtshd","audio/vnd.dts.hd");
      AddType("lvp","audio/vnd.lucent.voice");
      AddType("pya","audio/vnd.ms-playready.media.pya");
      AddType("ecelp4800","audio/vnd.nuera.ecelp4800");
      AddType("ecelp7470","audio/vnd.nuera.ecelp7470");
      AddType("ecelp9600","audio/vnd.nuera.ecelp9600");
      AddType("rip","audio/vnd.rip");
      AddType("weba","audio/webm");
      AddType("aac","audio/aac");
      AddType("aif","audio/x-aiff");
      AddType("aiff","audio/x-aiff");
      AddType("aifc","audio/x-aiff");
      AddType("caf","audio/x-caf");
      AddType("flac","audio/x-flac");
      AddType("mka","audio/x-matroska");
      AddType("m3u","audio/x-mpegurl");
      AddType("wax","audio/x-ms-wax");
      AddType("wma","audio/x-ms-wma");
      AddType("ram","audio/x-pn-realaudio");
      AddType("ra","audio/x-pn-realaudio");
      AddType("rmp","audio/x-pn-realaudio-plugin");
      AddType("wav","audio/x-wav");
      AddType("xm","audio/xm");
      AddType("cdx","chemical/x-cdx");
      AddType("cif","chemical/x-cif");
      AddType("cmdf","chemical/x-cmdf");
      AddType("cml","chemical/x-cml");
      AddType("csml","chemical/x-csml");
      AddType("xyz","chemical/x-xyz");
      AddType("bmp","image/bmp");
      AddType("cgm","image/cgm");
      AddType("g3","image/g3fax");
      AddType("gif","image/gif");
      AddType("ief","image/ief");
      AddType("jpeg","image/jpeg");
      AddType("jpg","image/jpeg");
      AddType("jpe","image/jpeg");
      AddType("ktx","image/ktx");
      AddType("png","image/png");
      AddType("btif","image/prs.btif");
      AddType("sgi","image/sgi");
      AddType("svg","image/svg+xml");
      AddType("svgz","image/svg+xml");
      AddType("tiff","image/tiff");
      AddType("tif","image/tiff");
      AddType("psd","image/vnd.adobe.photoshop");
      AddType("uvi","image/vnd.dece.graphic");
      AddType("uvvi","image/vnd.dece.graphic");
      AddType("uvg","image/vnd.dece.graphic");
      AddType("uvvg","image/vnd.dece.graphic");
      AddType("sub","image/vnd.dvb.subtitle");
      AddType("djvu","image/vnd.djvu");
      AddType("djv","image/vnd.djvu");
      AddType("dwg","image/vnd.dwg");
      AddType("dxf","image/vnd.dxf");
      AddType("fbs","image/vnd.fastbidsheet");
      AddType("fpx","image/vnd.fpx");
      AddType("fst","image/vnd.fst");
      AddType("mmr","image/vnd.fujixerox.edmics-mmr");
      AddType("rlc","image/vnd.fujixerox.edmics-rlc");
      AddType("mdi","image/vnd.ms-modi");
      AddType("wdp","image/vnd.ms-photo");
      AddType("npx","image/vnd.net-fpx");
      AddType("wbmp","image/vnd.wap.wbmp");
      AddType("xif","image/vnd.xiff");
      AddType("webp","image/webp");
      AddType("3ds","image/x-3ds");
      AddType("ras","image/x-cmu-raster");
      AddType("cmx","image/x-cmx");
      AddType("fh","image/x-freehand");
      AddType("fhc","image/x-freehand");
      AddType("fh4","image/x-freehand");
      AddType("fh5","image/x-freehand");
      AddType("fh7","image/x-freehand");
      AddType("ico","image/x-icon");
      AddType("sid","image/x-mrsid-image");
      AddType("pcx","image/x-pcx");
      AddType("pic","image/x-pict");
      AddType("pct","image/x-pict");
      AddType("pnm","image/x-portable-anymap");
      AddType("pbm","image/x-portable-bitmap");
      AddType("pgm","image/x-portable-graymap");
      AddType("ppm","image/x-portable-pixmap");
      AddType("rgb","image/x-rgb");
      AddType("tga","image/x-tga");
      AddType("xbm","image/x-xbitmap");
      AddType("xpm","image/x-xpixmap");
      AddType("xwd","image/x-xwindowdump");
      AddType("eml","message/rfc822");
      AddType("mime","message/rfc822");
      AddType("igs","model/iges");
      AddType("iges","model/iges");
      AddType("msh","model/mesh");
      AddType("mesh","model/mesh");
      AddType("silo","model/mesh");
      AddType("dae","model/vnd.collada+xml");
      AddType("dwf","model/vnd.dwf");
      AddType("gdl","model/vnd.gdl");
      AddType("gtw","model/vnd.gtw");
      AddType("mts","model/vnd.mts");
      AddType("vtu","model/vnd.vtu");
      AddType("wrl","model/vrml");
      AddType("vrml","model/vrml");
      AddType("x3db","model/x3d+binary");
      AddType("x3dbz","model/x3d+binary");
      AddType("x3dv","model/x3d+vrml");
      AddType("x3dvz","model/x3d+vrml");
      AddType("x3d","model/x3d+xml");
      AddType("x3dz","model/x3d+xml");
      AddType("appcache","text/cache-manifest");
      AddType("ics","text/calendar");
      AddType("ifb","text/calendar");
      AddType("cmd","text/cmd");
      AddType("css","text/css");
      AddType("csv","text/csv");
      AddType("html","text/html");
      AddType("htm","text/html");
      AddType("n3","text/n3");
      AddType("txt","text/plain");
      AddType("text","text/plain");
      AddType("conf","text/plain");
      AddType("def","text/plain");
      AddType("list","text/plain");
      AddType("log","text/plain");
      AddType("in","text/plain");
      AddType("js","text/plain");
      AddType("dsc","text/prs.lines.tag");
      AddType("rtx","text/richtext");
      AddType("sgml","text/sgml");
      AddType("sgm","text/sgml");
      AddType("tsv","text/tab-separated-values");
      AddType("t","text/troff");
      AddType("tr","text/troff");
      AddType("roff","text/troff");
      AddType("man","text/troff");
      AddType("me","text/troff");
      AddType("ms","text/troff");
      AddType("ttl","text/turtle");
      AddType("uri","text/uri-list");
      AddType("uris","text/uri-list");
      AddType("urls","text/uri-list");
      AddType("vcard","text/vcard");
      AddType("curl","text/vnd.curl");
      AddType("dcurl","text/vnd.curl.dcurl");
      AddType("scurl","text/vnd.curl.scurl");
      AddType("mcurl","text/vnd.curl.mcurl");
      AddType("sub","text/vnd.dvb.subtitle");
      AddType("fly","text/vnd.fly");
      AddType("flx","text/vnd.fmi.flexstor");
      AddType("gv","text/vnd.graphviz");
      AddType("3dml","text/vnd.in3d.3dml");
      AddType("spot","text/vnd.in3d.spot");
      AddType("jad","text/vnd.sun.j2me.app-descriptor");
      AddType("wml","text/vnd.wap.wml");
      AddType("wmls","text/vnd.wap.wmlscript");
      AddType("s","text/x-asm");
      AddType("asm","text/x-asm");
      AddType("c","text/x-c");
      AddType("cc","text/x-c");
      AddType("cxx","text/x-c");
      AddType("cpp","text/x-c");
      AddType("h","text/x-c");
      AddType("hh","text/x-c");
      AddType("dic","text/x-c");
      AddType("f","text/x-fortran");
      AddType("for","text/x-fortran");
      AddType("f77","text/x-fortran");
      AddType("f90","text/x-fortran");
      AddType("java","text/x-java-source");
      AddType("opml","text/x-opml");
      AddType("p","text/x-pascal");
      AddType("pas","text/x-pascal");
      AddType("nfo","text/x-nfo");
      AddType("etx","text/x-setext");
      AddType("sfv","text/x-sfv");
      AddType("uu","text/x-uuencode");
      AddType("vcs","text/x-vcalendar");
      AddType("vcf","text/x-vcard");
      AddType("xml","text/xml");
      AddType("xsl","text/xml");
      AddType("dtd","text/xml-dtd");
      AddType("3gp","video/3gpp");
      AddType("3g2","video/3gpp2");
      AddType("h261","video/h261");
      AddType("h263","video/h263");
      AddType("h264","video/h264");
      AddType("jpgv","video/jpeg");
      AddType("jpm","video/jpm");
      AddType("jpgm","video/jpm");
      AddType("mj2","video/mj2");
      AddType("mjp2","video/mj2");
      AddType("mp4","video/mp4");
      AddType("mp4v","video/mp4");
      AddType("mpg4","video/mp4");
      AddType("mpeg","video/mpeg");
      AddType("mpg","video/mpeg");
      AddType("mpe","video/mpeg");
      AddType("m1v","video/mpeg");
      AddType("m2v","video/mpeg");
      AddType("ogv","video/ogg");
      AddType("qt","video/quicktime");
      AddType("mov","video/quicktime");
      AddType("uvh","video/vnd.dece.hd");
      AddType("uvvh","video/vnd.dece.hd");
      AddType("uvm","video/vnd.dece.mobile");
      AddType("uvvm","video/vnd.dece.mobile");
      AddType("uvp","video/vnd.dece.pd");
      AddType("uvvp","video/vnd.dece.pd");
      AddType("uvs","video/vnd.dece.sd");
      AddType("uvvs","video/vnd.dece.sd");
      AddType("uvv","video/vnd.dece.video");
      AddType("uvvv","video/vnd.dece.video");
      AddType("dvb","video/vnd.dvb.file");
      AddType("fvt","video/vnd.fvt");
      AddType("mxu","video/vnd.mpegurl");
      AddType("m4u","video/vnd.mpegurl");
      AddType("pyv","video/vnd.ms-playready.media.pyv");
      AddType("uvu","video/vnd.uvvu.mp4");
      AddType("uvvu","video/vnd.uvvu.mp4");
      AddType("viv","video/vnd.vivo");
      AddType("webm","video/webm");
      AddType("f4v","video/x-f4v");
      AddType("fli","video/x-fli");
      AddType("flv","video/x-flv");
      AddType("m4v","video/x-m4v");
      AddType("mkv","video/x-matroska");
      AddType("mk3d","video/x-matroska");
      AddType("mks","video/x-matroska");
      AddType("mng","video/x-mng");
      AddType("asf","video/x-ms-asf");
      AddType("asx","video/x-ms-asf");
      AddType("vob","video/x-ms-vob");
      AddType("wm","video/x-ms-wm");
      AddType("wmv","video/x-ms-wmv");
      AddType("wmx","video/x-ms-wmx");
      AddType("wvx","video/x-ms-wvx");
      AddType("avi","video/x-msvideo");
      AddType("movie","video/x-sgi-movie");
      AddType("smv","video/x-smv");
      AddType("ice","x-conference/x-cooltalk");
    };
  };
  $mod.$init = function () {
    $mod.FNCFormatSettings.$assign(pas.SysUtils.TFormatSettings.Create());
    $mod.FNCFormatSettings.DecimalSeparator = ".";
    $mod.FNCFormatSettings.ThousandSeparator = ",";
    $impl.FMimeTypes = pas.Classes.TStringList.$create("Create$1");
    $impl.RegisterMimeTypes();
  };
},["DateUtils"]);
rtl.module("Variants",["System"],function () {
  "use strict";
  var $mod = this;
});
rtl.module("WEBLib.TMSFNCJSONReader",["System","Classes","SysUtils","WEBLib.TMSFNCTypes"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  rtl.createClass(this,"TTMSFNCJSONStreamReader",pas.System.TObject,function () {
    rtl.createClass(this,"EInvalidJsonInput",pas.SysUtils.Exception,function () {
      this.Create$2 = function () {
        pas.SysUtils.Exception.Create$1.call(this,"Invalid JSON Input");
        return this;
      };
    },"TTMSFNCJSONStreamReader.EInvalidJsonInput");
    rtl.createClass(this,"EInternalError",pas.SysUtils.Exception,function () {
      this.Create$2 = function () {
        pas.SysUtils.Exception.Create$1.call(this,"JSON stream reader internal error");
        return this;
      };
    },"TTMSFNCJSONStreamReader.EInternalError");
    rtl.createClass(this,"EEndOfInputReached",pas.SysUtils.Exception,function () {
      this.Create$2 = function () {
        pas.SysUtils.Exception.Create$1.call(this,"End of JSON input reached.");
        return this;
      };
    },"TTMSFNCJSONStreamReader.EEndOfInputReached");
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FStream = null;
      this.FReadStream = null;
    };
    this.$final = function () {
      this.FStream = undefined;
      this.FReadStream = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function (aStream) {
      this.FStream = aStream;
      this.FReadStream = pas.Classes.TStringStream.$create("Create$3",["",pas.SysUtils.TEncoding.GetANSI(),true]);
      this.FReadStream.CopyFrom(this.FStream,this.FStream.GetSize());
      this.FReadStream.SetPosition(0);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FReadStream");
      pas.System.TObject.Destroy.call(this);
    };
    this.NextChar = function () {
      var Result = "\x00";
      if (this.Eof()) throw this.EEndOfInputReached.$create("Create$2");
      Result = this.ReadChar();
      return Result;
    };
    this.PeekChar = function () {
      var Result = "\x00";
      var p = 0;
      p = this.FReadStream.GetPosition();
      Result = this.ReadChar();
      this.FReadStream.SetPosition(p);
      return Result;
    };
    this.ReadChar = function () {
      var Result = "\x00";
      var i = 0;
      var s = "";
      Result = "\x00";
      i = 1;
      if (this.FReadStream.GetPosition() < this.FReadStream.GetSize()) {
        s = this.FReadStream.ReadString(1);
        if ((s !== "") && pas.System.Assigned(s)) Result = s.charAt(i - 1);
      };
      return Result;
    };
    this.Backup = function (c) {
      this.FReadStream.SetPosition(this.FReadStream.GetPosition() - 1);
    };
    this.MoveNext = function (Count) {
      this.FReadStream.SetPosition(this.FReadStream.GetPosition() + Count);
    };
    this.Eof = function () {
      var Result = false;
      Result = this.FReadStream.GetPosition() === this.FReadStream.GetSize();
      return Result;
    };
  });
  this.TTMSFNCJSONToken = {"0": "jstoBeginObject", jstoBeginObject: 0, "1": "jstoEndObject", jstoEndObject: 1, "2": "jstoBeginArray", jstoBeginArray: 2, "3": "jstoEndArray", jstoEndArray: 3, "4": "jstoName", jstoName: 4, "5": "jstoBoolean", jstoBoolean: 5, "6": "jstoNull", jstoNull: 6, "7": "jstoText", jstoText: 7, "8": "jstoNumber", jstoNumber: 8, "9": "jstoEOF", jstoEOF: 9};
  this.$rtti.$Enum("TTMSFNCJSONToken",{minvalue: 0, maxvalue: 9, ordtype: 1, enumtype: this.TTMSFNCJSONToken});
  rtl.createClass(this,"TTMSFNCJSONReader",pas.System.TObject,function () {
    this.TTMSFNCJSONState = {"0": "jstNone", jstNone: 0, "1": "jstBeginObject", jstBeginObject: 1, "2": "jstEndObject", jstEndObject: 2, "3": "jstBeginArray", jstBeginArray: 3, "4": "jstEndArray", jstEndArray: 4, "5": "jstTrue", jstTrue: 5, "6": "jstFalse", jstFalse: 6, "7": "jstNull", jstNull: 7, "8": "jstDoubleQuoted", jstDoubleQuoted: 8, "9": "jstBuffered", jstBuffered: 9, "10": "jstDoubleQuotedName", jstDoubleQuotedName: 10, "11": "jstInt64", jstInt64: 11, "12": "jstNumber", jstNumber: 12, "13": "jstEOF", jstEOF: 13};
    $mod.$rtti.$Enum("TTMSFNCJSONReader.TTMSFNCJSONState",{minvalue: 0, maxvalue: 13, ordtype: 1, enumtype: this.TTMSFNCJSONState});
    this.TTMSFNCJSONNumberState = {"0": "jnstNone", jnstNone: 0, "1": "jnstSign", jnstSign: 1, "2": "jnstDigit", jnstDigit: 2, "3": "jnstDecimal", jnstDecimal: 3, "4": "jnstFraction", jnstFraction: 4, "5": "jnstExpE", jnstExpE: 5, "6": "jnstExpSign", jnstExpSign: 6, "7": "jnstExpDigit", jnstExpDigit: 7};
    $mod.$rtti.$Enum("TTMSFNCJSONReader.TTMSFNCJSONNumberState",{minvalue: 0, maxvalue: 7, ordtype: 1, enumtype: this.TTMSFNCJSONNumberState});
    this.TTMSFNCJSONScope = {"0": "jscEmptyDocument", jscEmptyDocument: 0, "1": "jscEmptyArray", jscEmptyArray: 1, "2": "jscEmptyObject", jscEmptyObject: 2, "3": "jscNonEmptyDocument", jscNonEmptyDocument: 3, "4": "jscNonEmptyArray", jscNonEmptyArray: 4, "5": "jscNonEmptyObject", jscNonEmptyObject: 5, "6": "jscDanglingName", jscDanglingName: 6};
    $mod.$rtti.$Enum("TTMSFNCJSONReader.TTMSFNCJSONScope",{minvalue: 0, maxvalue: 6, ordtype: 1, enumtype: this.TTMSFNCJSONScope});
    rtl.createClass(this,"EInvalidStateException",pas.SysUtils.Exception,function () {
      this.Create$2 = function (AState) {
        pas.SysUtils.Exception.CreateFmt.call(this,"Invalid Json parser state. Expected state: %d",pas.System.VarRecs(0,AState));
        return this;
      };
    },"TTMSFNCJSONReader.EInvalidStateException");
    rtl.createClass(this,"EUnterminatedArray",pas.SysUtils.Exception,function () {
      this.Create$2 = function () {
        pas.SysUtils.Exception.Create$1.call(this,"Unterminated array");
        return this;
      };
    },"TTMSFNCJSONReader.EUnterminatedArray");
    rtl.createClass(this,"EUnterminatedObject",pas.SysUtils.Exception,function () {
      this.Create$2 = function () {
        pas.SysUtils.Exception.Create$1.call(this,"Unterminated object");
        return this;
      };
    },"TTMSFNCJSONReader.EUnterminatedObject");
    rtl.createClass(this,"ENameExpected",pas.SysUtils.Exception,function () {
      this.Create$2 = function () {
        pas.SysUtils.Exception.Create$1.call(this,"Name expected");
        return this;
      };
    },"TTMSFNCJSONReader.ENameExpected");
    rtl.createClass(this,"EColonExpected",pas.SysUtils.Exception,function () {
      this.Create$2 = function () {
        pas.SysUtils.Exception.Create$1.call(this,"Colon expected");
        return this;
      };
    },"TTMSFNCJSONReader.EColonExpected");
    rtl.createClass(this,"EReaderClosed",pas.SysUtils.Exception,function () {
      this.Create$2 = function () {
        pas.SysUtils.Exception.Create$1.call(this,"Reader already closed");
        return this;
      };
    },"TTMSFNCJSONReader.EReaderClosed");
    rtl.createClass(this,"EMultipleRootNotAllowed",pas.SysUtils.Exception,function () {
      this.Create$2 = function () {
        pas.SysUtils.Exception.Create$1.call(this,"Multiple root values not allowed");
        return this;
      };
    },"TTMSFNCJSONReader.EMultipleRootNotAllowed");
    rtl.createClass(this,"EExpectedValue",pas.SysUtils.Exception,function () {
      this.Create$2 = function () {
        pas.SysUtils.Exception.Create$1.call(this,"Value expected but invalid character found");
        return this;
      };
    },"TTMSFNCJSONReader.EExpectedValue");
    rtl.createClass(this,"EObjectOrArrayExpected",pas.SysUtils.Exception,function () {
      this.Create$2 = function () {
        pas.SysUtils.Exception.Create$1.call(this,"Object or array expected as top-level value");
        return this;
      };
    },"TTMSFNCJSONReader.EObjectOrArrayExpected");
    rtl.createClass(this,"ETooManyDepthLevels",pas.SysUtils.Exception,function () {
      this.Create$2 = function () {
        pas.SysUtils.Exception.Create$1.call(this,"Maximum level of nested structured reached.");
        return this;
      };
    },"TTMSFNCJSONReader.ETooManyDepthLevels");
    rtl.createClass(this,"EInvalidEscaped",pas.SysUtils.Exception,function () {
      this.Create$2 = function () {
        pas.SysUtils.Exception.Create$1.call(this,"Invalid escaped sequence");
        return this;
      };
    },"TTMSFNCJSONReader.EInvalidEscaped");
    this.MaxNumberBuffer = 255;
    this.MaxStackSize = 255;
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FReader = null;
      this.FStack = rtl.arraySetLength(null,0,256);
      this.FStackSize = 0;
      this.FPeeked = 0;
      this.FPeekedInt64 = 0;
      this.FPeekedNumber = rtl.arraySetLength(null,"\x00",256);
      this.FPeekedString = "";
    };
    this.$final = function () {
      this.FReader = undefined;
      this.FStack = undefined;
      this.FPeekedNumber = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.NextPeek = function () {
      var Result = 0;
      if (this.FPeeked === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNone) this.FPeeked = this.DoPeek();
      Result = this.FPeeked;
      return Result;
    };
    this.CheckState = function (State) {
      if (this.NextPeek() !== State) throw this.EInvalidStateException.$create("Create$2",[State]);
    };
    this.SkipChar = function () {
      this.FReader.MoveNext(1);
      while (this.FReader.PeekChar().charCodeAt() in $impl.Wspace) this.FReader.MoveNext(1);
    };
    this.IsLiteral = function (C) {
      var Result = false;
      Result = !pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.CharInSet(C,pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.CreateCharSet("/\\;#{}[]:,' \r\n\f\t"));
      return Result;
    };
    this.IsDigit = function (C) {
      var Result = false;
      Result = (C <= "ÿ") && pas["WEBLib.TMSFNCTypes"].CharIsNumber(C);
      return Result;
    };
    this.DoPeek = function () {
      var Result = 0;
      var FPeekStack = 0;
      var C = "\x00";
      FPeekStack = this.FStack[this.FStackSize - 1];
      if (FPeekStack === $mod.TTMSFNCJSONReader.TTMSFNCJSONScope.jscEmptyArray) {
        this.FStack[this.FStackSize - 1] = $mod.TTMSFNCJSONReader.TTMSFNCJSONScope.jscNonEmptyArray}
       else if (FPeekStack === $mod.TTMSFNCJSONReader.TTMSFNCJSONScope.jscNonEmptyArray) {
        C = this.NextNonWhitespace();
        var $tmp = C;
        if ($tmp === "]") {
          while (this.FReader.PeekChar().charCodeAt() in $impl.Wspace) this.FReader.MoveNext(1);
          this.SkipChar();
          this.FPeeked = $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstEndArray;
          return this.FPeeked;
        } else if ($tmp === ",") {
          this.SkipChar()}
         else {
          throw this.EUnterminatedArray.$create("Create$2");
        };
      } else if (FPeekStack in rtl.createSet($mod.TTMSFNCJSONReader.TTMSFNCJSONScope.jscEmptyObject,$mod.TTMSFNCJSONReader.TTMSFNCJSONScope.jscNonEmptyObject)) {
        this.FStack[this.FStackSize - 1] = $mod.TTMSFNCJSONReader.TTMSFNCJSONScope.jscDanglingName;
        if (FPeekStack === $mod.TTMSFNCJSONReader.TTMSFNCJSONScope.jscNonEmptyObject) {
          C = this.NextNonWhitespace();
          var $tmp1 = C;
          if ($tmp1 === "}") {
            while (this.FReader.PeekChar().charCodeAt() in $impl.Wspace) this.FReader.MoveNext(1);
            this.SkipChar();
            this.FPeeked = $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstEndObject;
            return this.FPeeked;
          } else if ($tmp1 === ",") {
            this.SkipChar()}
           else {
            throw this.EUnterminatedObject.$create("Create$2");
          };
        };
        C = this.NextNonWhitespace();
        var $tmp2 = C;
        if ($tmp2 === '"') {
          this.SkipChar();
          this.FPeeked = $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstDoubleQuotedName;
          return this.FPeeked;
        } else if ($tmp2 === "}") {
          if (FPeekStack !== $mod.TTMSFNCJSONReader.TTMSFNCJSONScope.jscNonEmptyObject) {
            this.SkipChar();
            this.FPeeked = $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstEndObject;
            return this.FPeeked;
          } else throw this.ENameExpected.$create("Create$2")}
         else {
          throw this.ENameExpected.$create("Create$2");
        };
      } else if (FPeekStack === $mod.TTMSFNCJSONReader.TTMSFNCJSONScope.jscDanglingName) {
        this.FStack[this.FStackSize - 1] = $mod.TTMSFNCJSONReader.TTMSFNCJSONScope.jscNonEmptyObject;
        C = this.NextNonWhitespace();
        if (C === ":") {
          this.SkipChar()}
         else throw this.EColonExpected.$create("Create$2");
      } else if (FPeekStack === $mod.TTMSFNCJSONReader.TTMSFNCJSONScope.jscEmptyDocument) {
        this.FStack[this.FStackSize - 1] = $mod.TTMSFNCJSONReader.TTMSFNCJSONScope.jscNonEmptyDocument}
       else if (FPeekStack === $mod.TTMSFNCJSONReader.TTMSFNCJSONScope.jscNonEmptyDocument) {
        if (this.SkipWhitespaceUntilEnd()) {
          this.FPeeked = $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstEOF;
          return this.FPeeked;
        } else throw this.EMultipleRootNotAllowed.$create("Create$2");
      };
      C = this.NextNonWhitespace();
      var $tmp3 = C;
      if ($tmp3 === "]") {
        if (FPeekStack === $mod.TTMSFNCJSONReader.TTMSFNCJSONScope.jscEmptyArray) {
          this.SkipChar();
          this.FPeeked = $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstEndArray;
          return this.FPeeked;
        } else throw this.EExpectedValue.$create("Create$2")}
       else if ($tmp3 === '"') {
        if (this.FStackSize === 1) throw this.EObjectOrArrayExpected.$create("Create$2");
        this.SkipChar();
        this.FPeeked = $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstDoubleQuoted;
        return this.FPeeked;
      } else if ($tmp3 === "[") {
        this.SkipChar();
        this.FPeeked = $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstBeginArray;
        return this.FPeeked;
      } else if ($tmp3 === "{") {
        this.SkipChar();
        this.FPeeked = $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstBeginObject;
        return this.FPeeked;
      };
      if (this.FStackSize === 1) throw this.EObjectOrArrayExpected.$create("Create$2");
      Result = this.PeekKeyword();
      if (Result !== $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNone) return Result;
      Result = this.PeekNumber();
      if (Result !== $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNone) return Result;
      throw this.EExpectedValue.$create("Create$2");
      return Result;
    };
    this.PushScope = function (Scope) {
      if (this.FStackSize > 255) throw this.ETooManyDepthLevels.$create("Create$2");
      this.FStack[this.FStackSize] = Scope;
      this.FStackSize += 1;
    };
    this.NextNonWhitespace = function () {
      var Result = "\x00";
      var s = "\x00";
      var p = 0;
      p = this.FReader.FReadStream.GetPosition();
      Result = "\x00";
      s = this.ReadChar();
      do {
        if ((s > " ") || !(s.charCodeAt() in $impl.Wspace)) {
          this.FReader.FReadStream.SetPosition(p);
          return s;
        };
        s = this.ReadChar();
      } while (!this.FReader.Eof());
      this.FReader.FReadStream.SetPosition(p);
      return Result;
    };
    this.ReadChar = function () {
      var Result = "\x00";
      Result = this.FReader.ReadChar();
      return Result;
    };
    this.PeekKeyword = function () {
      var Result = 0;
      var $tmp = this.FReader.PeekChar();
      if (($tmp === "t") || ($tmp === "T")) {
        this.FReader.MoveNext(1);
        var $tmp1 = this.FReader.NextChar();
        if (($tmp1 === "r") || ($tmp1 === "R")) {
          var $tmp2 = this.FReader.NextChar();
          if (($tmp2 === "u") || ($tmp2 === "U")) {
            var $tmp3 = this.FReader.NextChar();
            if (($tmp3 === "e") || ($tmp3 === "E")) if (this.FReader.Eof() || !this.IsLiteral(this.FReader.PeekChar())) return $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstTrue;
          };
        };
      } else if (($tmp === "f") || ($tmp === "F")) {
        this.FReader.MoveNext(1);
        var $tmp4 = this.FReader.NextChar();
        if (($tmp4 === "a") || ($tmp4 === "A")) {
          var $tmp5 = this.FReader.NextChar();
          if (($tmp5 === "l") || ($tmp5 === "L")) {
            var $tmp6 = this.FReader.NextChar();
            if (($tmp6 === "s") || ($tmp6 === "S")) {
              var $tmp7 = this.FReader.NextChar();
              if (($tmp7 === "e") || ($tmp7 === "E")) if (this.FReader.Eof() || !this.IsLiteral(this.FReader.PeekChar())) return $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstFalse;
            };
          };
        };
      } else if (($tmp === "n") || ($tmp === "N")) {
        this.FReader.MoveNext(1);
        var $tmp8 = this.FReader.NextChar();
        if (($tmp8 === "a") || ($tmp8 === "A")) {
          var $tmp9 = this.FReader.NextChar();
          if (($tmp9 === "n") || ($tmp9 === "N")) if (this.FReader.Eof() || !this.IsLiteral(this.FReader.PeekChar())) return $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNull;
        } else if (($tmp8 === "u") || ($tmp8 === "U")) {
          var $tmp10 = this.FReader.NextChar();
          if (($tmp10 === "l") || ($tmp10 === "L")) {
            var $tmp11 = this.FReader.NextChar();
            if (($tmp11 === "l") || ($tmp11 === "L")) if (this.FReader.Eof() || !this.IsLiteral(this.FReader.PeekChar())) return $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNull;
          };
        };
      } else {
        return $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNone;
      };
      throw this.EExpectedValue.$create("Create$2");
      return Result;
    };
    var MinIncompleteInteger = rtl.trunc(-9007199254740991 / 10);
    this.PeekNumber = function () {
      var Result = 0;
      var Last = 0;
      var Negative = false;
      var FitsInInt64 = false;
      var Value = 0;
      var NewValue = 0;
      var C = "\x00";
      var BufIndex = 0;
      C = this.FReader.PeekChar();
      if ((C !== "-") && !this.IsDigit(C)) return $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNone;
      Negative = false;
      FitsInInt64 = true;
      Last = $mod.TTMSFNCJSONReader.TTMSFNCJSONNumberState.jnstNone;
      BufIndex = 0;
      Value = -1;
      do {
        if (BufIndex >= 255) throw this.EExpectedValue.$create("Create$2");
        C = this.FReader.NextChar();
        this.FPeekedNumber[BufIndex] = C;
        BufIndex += 1;
        var $tmp = C;
        if ($tmp === "-") {
          if (Last === $mod.TTMSFNCJSONReader.TTMSFNCJSONNumberState.jnstNone) {
            Negative = true;
            Last = $mod.TTMSFNCJSONReader.TTMSFNCJSONNumberState.jnstSign;
            continue;
          } else if (Last === $mod.TTMSFNCJSONReader.TTMSFNCJSONNumberState.jnstExpE) {
            Last = $mod.TTMSFNCJSONReader.TTMSFNCJSONNumberState.jnstExpSign;
            continue;
          } else throw this.EExpectedValue.$create("Create$2")}
         else if ($tmp === "+") {
          if (Last === $mod.TTMSFNCJSONReader.TTMSFNCJSONNumberState.jnstExpE) {
            Last = $mod.TTMSFNCJSONReader.TTMSFNCJSONNumberState.jnstExpSign;
            continue;
          } else throw this.EExpectedValue.$create("Create$2")}
         else if (($tmp === "e") || ($tmp === "E")) {
          if (Last in rtl.createSet($mod.TTMSFNCJSONReader.TTMSFNCJSONNumberState.jnstDigit,$mod.TTMSFNCJSONReader.TTMSFNCJSONNumberState.jnstFraction)) {
            Last = $mod.TTMSFNCJSONReader.TTMSFNCJSONNumberState.jnstExpE;
            continue;
          } else throw this.EExpectedValue.$create("Create$2")}
         else if ($tmp === ".") {
          if (Last === $mod.TTMSFNCJSONReader.TTMSFNCJSONNumberState.jnstDigit) {
            Last = $mod.TTMSFNCJSONReader.TTMSFNCJSONNumberState.jnstDecimal;
            continue;
          } else throw this.EExpectedValue.$create("Create$2")}
         else {
          if (!this.IsDigit(C)) if (!this.IsLiteral(C)) {
            this.FReader.Backup(C);
            BufIndex -= 1;
            break;
          } else throw this.EExpectedValue.$create("Create$2");
          if (Last in rtl.createSet($mod.TTMSFNCJSONReader.TTMSFNCJSONNumberState.jnstSign,$mod.TTMSFNCJSONReader.TTMSFNCJSONNumberState.jnstNone)) {
            Value = -(C.charCodeAt() - 48);
            Last = $mod.TTMSFNCJSONReader.TTMSFNCJSONNumberState.jnstDigit;
          } else if (Last === $mod.TTMSFNCJSONReader.TTMSFNCJSONNumberState.jnstDigit) {
            if (Value === 0) throw this.EExpectedValue.$create("Create$2");
            NewValue = (Value * 10) - (C.charCodeAt() - 48);
            FitsInInt64 = FitsInInt64 && ((Value > -900719925474099) || ((Value === -900719925474099) && (NewValue < Value)));
            Value = NewValue;
          } else if (Last === $mod.TTMSFNCJSONReader.TTMSFNCJSONNumberState.jnstDecimal) {
            Last = $mod.TTMSFNCJSONReader.TTMSFNCJSONNumberState.jnstFraction}
           else if (Last in rtl.createSet($mod.TTMSFNCJSONReader.TTMSFNCJSONNumberState.jnstExpE,$mod.TTMSFNCJSONReader.TTMSFNCJSONNumberState.jnstExpSign)) Last = $mod.TTMSFNCJSONReader.TTMSFNCJSONNumberState.jnstExpDigit;
        };
      } while (!false);
      if ((Last === $mod.TTMSFNCJSONReader.TTMSFNCJSONNumberState.jnstDigit) && FitsInInt64 && ((Value !== -9007199254740991) || Negative)) {
        if (Negative) {
          this.FPeekedInt64 = Value}
         else this.FPeekedInt64 = -Value;
        return $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstInt64;
      } else if (Last in rtl.createSet($mod.TTMSFNCJSONReader.TTMSFNCJSONNumberState.jnstDigit,$mod.TTMSFNCJSONReader.TTMSFNCJSONNumberState.jnstFraction,$mod.TTMSFNCJSONReader.TTMSFNCJSONNumberState.jnstExpDigit)) {
        this.FPeekedNumber[BufIndex] = "\x00";
        return $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNumber;
      } else throw this.EExpectedValue.$create("Create$2");
      return Result;
    };
    this.InternalReadQuoted = function (BuildString) {
      var Result = "";
      var pc = "";
      var c = "";
      var s = "";
      Result = "";
      s = "";
      pc = "";
      while (!this.FReader.Eof()) {
        c = this.ReadChar();
        if ((c === '"') && (pc !== "\\")) {
          break}
         else s = s + c;
        pc = c;
      };
      if (BuildString) Result = s;
      return Result;
    };
    this.ReadQuoted = function () {
      var Result = "";
      Result = this.InternalReadQuoted(true);
      return Result;
    };
    this.SkipQuoted = function () {
      this.InternalReadQuoted(false);
    };
    this.SkipWhitespaceUntilEnd = function () {
      var Result = false;
      var s = "\x00";
      var p = 0;
      p = this.FReader.FReadStream.GetPosition();
      Result = true;
      s = this.ReadChar();
      do {
        if ((s > " ") || !(s.charCodeAt() in $impl.Wspace)) {
          this.FReader.FReadStream.SetPosition(p);
          return false;
        };
        s = this.ReadChar();
      } while (!this.FReader.Eof());
      this.FReader.FReadStream.SetPosition(p);
      return Result;
    };
    this.Create$1 = function (AStream) {
      pas.System.TObject.Create.call(this);
      this.FReader = $mod.TTMSFNCJSONStreamReader.$create("Create$1",[AStream]);
      this.FPeeked = $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNone;
      this.FStack[0] = $mod.TTMSFNCJSONReader.TTMSFNCJSONScope.jscEmptyDocument;
      this.FStackSize = 1;
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FReader");
      pas.System.TObject.Destroy.call(this);
    };
    this.ReadBeginArray = function () {
      this.CheckState($mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstBeginArray);
      this.PushScope($mod.TTMSFNCJSONReader.TTMSFNCJSONScope.jscEmptyArray);
      this.FPeeked = $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNone;
    };
    this.ReadEndArray = function () {
      this.CheckState($mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstEndArray);
      this.FStackSize -= 1;
      this.FPeeked = $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNone;
    };
    this.ReadBeginObject = function () {
      this.CheckState($mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstBeginObject);
      this.PushScope($mod.TTMSFNCJSONReader.TTMSFNCJSONScope.jscEmptyObject);
      this.FPeeked = $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNone;
    };
    this.ReadEndObject = function () {
      this.CheckState($mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstEndObject);
      this.FStackSize -= 1;
      this.FPeeked = $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNone;
    };
    this.PeekName = function () {
      var Result = "";
      var p = 0;
      p = this.FReader.FReadStream.GetPosition();
      Result = this.ReadQuoted();
      this.FReader.FReadStream.SetPosition(p);
      return Result;
    };
    this.ReadName = function () {
      var Result = "";
      this.CheckState($mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstDoubleQuotedName);
      this.FPeeked = $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNone;
      Result = this.ReadQuoted();
      return Result;
    };
    this.ReadString = function () {
      var Result = "";
      var $tmp = this.NextPeek();
      if ($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstDoubleQuoted) {
        Result = this.ReadQuoted()}
       else if ($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstInt64) {
        Result = pas.SysUtils.IntToStr(this.FPeekedInt64)}
       else if ($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNumber) {
        Result = $impl.ArrayOfCharToString(this.FPeekedNumber.slice(0))}
       else if ($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstBuffered) {
        Result = this.FPeekedString}
       else {
        throw this.EInvalidStateException.$create("Create$2",[$mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstDoubleQuoted]);
      };
      this.FPeeked = $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNone;
      Result = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.UnescapeString(Result);
      return Result;
    };
    this.ReadBoolean = function () {
      var Result = false;
      var $tmp = this.NextPeek();
      if ($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstTrue) {
        Result = true}
       else if ($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstFalse) {
        Result = false}
       else {
        throw this.EInvalidStateException.$create("Create$2",[$mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstTrue]);
      };
      this.FPeeked = $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNone;
      return Result;
    };
    this.ReadDouble = function () {
      var Result = 0.0;
      var $tmp = this.NextPeek();
      if ($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstInt64) {
        this.FPeeked = $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNone;
        return this.FPeekedInt64;
      } else if ($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNumber) {
        if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.TryStrToFloatDot($impl.ArrayOfCharToString(this.FPeekedNumber.slice(0)),{get: function () {
            return Result;
          }, set: function (v) {
            Result = v;
          }})) {
          this.FPeeked = $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNone;
          return Result;
        } else this.FPeekedString = $impl.ArrayOfCharToString(this.FPeekedNumber.slice(0));
      } else if ($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstDoubleQuoted) {
        this.FPeekedString = this.ReadQuoted()}
       else if ($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstBuffered) {}
      else {
        throw this.EInvalidStateException.$create("Create$2",[$mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNumber]);
      };
      this.FPeeked = $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstBuffered;
      Result = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.StrToFloatDot(this.FPeekedString);
      this.FPeekedString = "";
      this.FPeeked = $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNone;
      return Result;
    };
    this.ReadInt64 = function () {
      var Result = 0;
      var AsDouble = 0.0;
      var $tmp = this.NextPeek();
      if ($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstInt64) {
        this.FPeeked = $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNone;
        return this.FPeekedInt64;
      } else if ($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNumber) {
        if (pas.SysUtils.TryStrToInt64($impl.ArrayOfCharToString(this.FPeekedNumber.slice(0)),{get: function () {
            return Result;
          }, set: function (v) {
            Result = v;
          }})) {
          this.FPeeked = $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNone;
          return Result;
        } else this.FPeekedString = $impl.ArrayOfCharToString(this.FPeekedNumber.slice(0));
      } else if ($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstDoubleQuoted) {
        this.FPeekedString = this.ReadQuoted();
        if (pas.SysUtils.TryStrToInt64(this.FPeekedString,{get: function () {
            return Result;
          }, set: function (v) {
            Result = v;
          }})) {
          this.FPeeked = $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNone;
          return Result;
        };
      } else if ($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstBuffered) {}
      else {
        throw this.EInvalidStateException.$create("Create$2",[$mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstInt64]);
      };
      this.FPeeked = $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstBuffered;
      AsDouble = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.StrToFloatDot(this.FPeekedString);
      Result = Math.round(AsDouble);
      if (AsDouble !== Result) throw this.EInvalidStateException.$create("Create$2",[$mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstInt64]);
      this.FPeekedString = "";
      this.FPeeked = $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNone;
      return Result;
    };
    this.ReadInteger = function () {
      var Result = 0;
      var AsDouble = 0.0;
      var $tmp = this.NextPeek();
      if ($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstInt64) {
        Result = this.FPeekedInt64 & 0xFFFFFFFF;
        if (Result !== this.FPeekedInt64) throw this.EInvalidStateException.$create("Create$2",[$mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstInt64]);
        this.FPeeked = $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNone;
        return Result;
      } else if ($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNumber) {
        if (pas.SysUtils.TryStrToInt($impl.ArrayOfCharToString(this.FPeekedNumber.slice(0)),{get: function () {
            return Result;
          }, set: function (v) {
            Result = v;
          }})) {
          this.FPeeked = $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNone;
          return Result;
        } else this.FPeekedString = $impl.ArrayOfCharToString(this.FPeekedNumber.slice(0));
      } else if ($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstDoubleQuoted) {
        this.FPeekedString = this.ReadQuoted();
        if (pas.SysUtils.TryStrToInt(this.FPeekedString,{get: function () {
            return Result;
          }, set: function (v) {
            Result = v;
          }})) {
          this.FPeeked = $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNone;
          return Result;
        };
      } else if ($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstBuffered) {}
      else {
        throw this.EInvalidStateException.$create("Create$2",[$mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstInt64]);
      };
      this.FPeeked = $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstBuffered;
      AsDouble = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.StrToFloatDot(this.FPeekedString);
      Result = Math.round(AsDouble);
      if (AsDouble !== Result) throw this.EInvalidStateException.$create("Create$2",[$mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstInt64]);
      this.FPeekedString = "";
      this.FPeeked = $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNone;
      return Result;
    };
    this.SkipValue = function () {
      var Count = 0;
      Count = 0;
      do {
        var $tmp = this.NextPeek();
        if ($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstBeginArray) {
          this.PushScope($mod.TTMSFNCJSONReader.TTMSFNCJSONScope.jscEmptyArray);
          Count += 1;
        } else if ($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstBeginObject) {
          this.PushScope($mod.TTMSFNCJSONReader.TTMSFNCJSONScope.jscEmptyObject);
          Count += 1;
        } else if (($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstEndArray) || ($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstEndObject)) {
          this.FStackSize -= 1;
          Count -= 1;
        } else if (($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstDoubleQuoted) || ($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstDoubleQuotedName)) this.SkipQuoted();
        this.FPeeked = $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNone;
      } while (!(Count <= 0));
    };
    this.ReadNull = function () {
      this.CheckState($mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNull);
      this.FPeeked = $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNone;
    };
    this.HasNext = function () {
      var Result = false;
      Result = !(this.NextPeek() in rtl.createSet($mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstEndObject,$mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstEndArray));
      return Result;
    };
    this.HasInt64 = function () {
      var Result = false;
      Result = this.NextPeek() in rtl.createSet($mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstInt64);
      return Result;
    };
    this.HasDouble = function () {
      var Result = false;
      Result = this.NextPeek() in rtl.createSet($mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNumber);
      return Result;
    };
    this.HasBoolean = function () {
      var Result = false;
      Result = this.Peek() in rtl.createSet($mod.TTMSFNCJSONToken.jstoBoolean);
      return Result;
    };
    this.HasString = function () {
      var Result = false;
      Result = this.Peek() in rtl.createSet($mod.TTMSFNCJSONToken.jstoText);
      return Result;
    };
    this.Peek = function () {
      var Result = 0;
      var $tmp = this.NextPeek();
      if ($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstBeginObject) {
        Result = $mod.TTMSFNCJSONToken.jstoBeginObject}
       else if ($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstEndObject) {
        Result = $mod.TTMSFNCJSONToken.jstoEndObject}
       else if ($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstBeginArray) {
        Result = $mod.TTMSFNCJSONToken.jstoBeginArray}
       else if ($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstEndArray) {
        Result = $mod.TTMSFNCJSONToken.jstoEndArray}
       else if ($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstDoubleQuotedName) {
        Result = $mod.TTMSFNCJSONToken.jstoName}
       else if (($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstTrue) || ($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstFalse)) {
        Result = $mod.TTMSFNCJSONToken.jstoBoolean}
       else if ($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNull) {
        Result = $mod.TTMSFNCJSONToken.jstoNull}
       else if (($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstDoubleQuoted) || ($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstBuffered)) {
        Result = $mod.TTMSFNCJSONToken.jstoText}
       else if (($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstInt64) || ($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstNumber)) {
        Result = $mod.TTMSFNCJSONToken.jstoNumber}
       else if ($tmp === $mod.TTMSFNCJSONReader.TTMSFNCJSONState.jstEOF) {
        Result = $mod.TTMSFNCJSONToken.jstoEOF}
       else {
        Result = $mod.TTMSFNCJSONToken.jstoEOF;
      };
      return Result;
    };
    this.IsNull = function () {
      var Result = false;
      Result = this.Peek() === $mod.TTMSFNCJSONToken.jstoNull;
      return Result;
    };
    this.Eof = function () {
      var Result = false;
      Result = this.Peek() === $mod.TTMSFNCJSONToken.jstoEOF;
      return Result;
    };
    var $r = this.$rtti;
    $mod.$rtti.$StaticArray("TTMSFNCJSONReader.FStack$a",{dims: [256], eltype: $mod.$rtti["TTMSFNCJSONReader.TTMSFNCJSONScope"]});
    $mod.$rtti.$StaticArray("TTMSFNCJSONReader.FPeekedNumber$a",{dims: [256], eltype: rtl.char});
  });
  $mod.$implcode = function () {
    $mod.$rtti.$Set("Wspace$a",{comptype: rtl.byte});
    $impl.Wspace = rtl.createSet(0x20,0xA,0xD,0x9,0xC);
    $impl.ArrayOfCharToString = function (AArray) {
      var Result = "";
      var I = 0;
      Result = "";
      for (var $l = 0, $end = rtl.length(AArray) - 1; $l <= $end; $l++) {
        I = $l;
        if (AArray[I] === "\x00") break;
        Result = Result + AArray[I];
      };
      return Result;
    };
  };
},["WEBLib.TMSFNCUtils"]);
rtl.module("WEBLib.TMSFNCJSONWriter",["System","Classes","SysUtils","WEBLib.TMSFNCTypes"],function () {
  "use strict";
  var $mod = this;
  rtl.createClass(this,"TTMSFNCJSONStreamWriter",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FStream = null;
      this.FWriteStream = null;
    };
    this.$final = function () {
      this.FStream = undefined;
      this.FWriteStream = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function (AStream) {
      this.FStream = AStream;
      this.FWriteStream = pas.Classes.TStringStream.$create("Create$3",["",pas.SysUtils.TEncoding.GetANSI(),true]);
      return this;
    };
    this.Destroy = function () {
      try {
        this.FWriteStream.SetPosition(0);
        this.FStream.CopyFrom(this.FWriteStream,this.FWriteStream.GetSize());
      } finally {
        rtl.free(this,"FWriteStream");
      };
      pas.System.TObject.Destroy.call(this);
    };
    this.Write = function (Value) {
      this.FWriteStream.WriteString(Value);
    };
  });
  rtl.createClass(this,"TTMSFNCJSONWriter",pas.System.TObject,function () {
    rtl.createClass(this,"ECannotWriteName",pas.SysUtils.Exception,function () {
      this.Create$2 = function () {
        pas.SysUtils.Exception.Create$1.call(this,"Cannot write name in current Json scope");
        return this;
      };
    },"TTMSFNCJSONWriter.ECannotWriteName");
    rtl.createClass(this,"EMultipleRootNotAllowed",pas.SysUtils.Exception,function () {
      this.Create$2 = function () {
        pas.SysUtils.Exception.Create$1.call(this,"Multiple root values not allowed");
        return this;
      };
    },"TTMSFNCJSONWriter.EMultipleRootNotAllowed");
    rtl.createClass(this,"EObjectOrArrayExpected",pas.SysUtils.Exception,function () {
      this.Create$2 = function () {
        pas.SysUtils.Exception.Create$1.call(this,"Object or array expected as top-level value");
        return this;
      };
    },"TTMSFNCJSONWriter.EObjectOrArrayExpected");
    rtl.createClass(this,"EInvalidNesting",pas.SysUtils.Exception,function () {
      this.Create$2 = function () {
        pas.SysUtils.Exception.Create$1.call(this,"Invalid nesting. Not all arrays/objects were properly closed.");
        return this;
      };
    },"TTMSFNCJSONWriter.EInvalidNesting");
    rtl.createClass(this,"EMissingValue",pas.SysUtils.Exception,function () {
      this.Create$2 = function () {
        pas.SysUtils.Exception.Create$1.call(this,"Json value missing");
        return this;
      };
    },"TTMSFNCJSONWriter.EMissingValue");
    rtl.createClass(this,"ETooManyDepthLevels",pas.SysUtils.Exception,function () {
      this.Create$2 = function () {
        pas.SysUtils.Exception.Create$1.call(this,"Maximum level of nested structured reached.");
        return this;
      };
    },"TTMSFNCJSONWriter.ETooManyDepthLevels");
    rtl.createClass(this,"EEmptyJson",pas.SysUtils.Exception,function () {
      this.Create$2 = function () {
        pas.SysUtils.Exception.Create$1.call(this,"Json is still empty. Cannot perform operation.");
        return this;
      };
    },"TTMSFNCJSONWriter.EEmptyJson");
    rtl.createClass(this,"EEmptyName",pas.SysUtils.Exception,function () {
      this.Create$2 = function () {
        pas.SysUtils.Exception.Create$1.call(this,"Cannot write empty name");
        return this;
      };
    },"TTMSFNCJSONWriter.EEmptyName");
    this.TTMSFNCJSONScope = {"0": "jscEmptyDocument", jscEmptyDocument: 0, "1": "jscEmptyArray", jscEmptyArray: 1, "2": "jscEmptyObject", jscEmptyObject: 2, "3": "jscNonEmptyDocument", jscNonEmptyDocument: 3, "4": "jscNonEmptyArray", jscNonEmptyArray: 4, "5": "jscNonEmptyObject", jscNonEmptyObject: 5, "6": "jscDanglingName", jscDanglingName: 6};
    $mod.$rtti.$Enum("TTMSFNCJSONWriter.TTMSFNCJSONScope",{minvalue: 0, maxvalue: 6, ordtype: 1, enumtype: this.TTMSFNCJSONScope});
    this.MaxStackSize = 255;
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FWriter = null;
      this.FStack = rtl.arraySetLength(null,0,256);
      this.FStackSize = 0;
      this.FIndent = "";
      this.FSeparator = "";
      this.FDeferredName = "";
    };
    this.$final = function () {
      this.FWriter = undefined;
      this.FStack = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.SetIndentLength = function (Value) {
      if (Value <= 0) {
        this.FIndent = "";
        this.FSeparator = ":";
      } else {
        this.FIndent = pas.System.StringOfChar(" ",Value);
        this.FSeparator = ": ";
      };
    };
    this.GetIndentLength = function () {
      var Result = 0;
      Result = this.FIndent.length;
      return Result;
    };
    this.OpenItem = function (Empty, OpenBracket) {
      var Result = null;
      this.BeforeValue(true);
      this.PushScope(Empty);
      this.FWriter.Write(OpenBracket);
      Result = this;
      return Result;
    };
    this.CloseItem = function (Empty, NonEmpty, CloseBracket) {
      var Result = null;
      var Context = 0;
      Context = this.PeekScope();
      if (!(Context in rtl.createSet(Empty,NonEmpty))) throw this.EInvalidNesting.$create("Create$2");
      if (this.FDeferredName !== "") throw this.EMissingValue.$create("Create$2");
      this.FStackSize -= 1;
      if (Context === NonEmpty) this.NewLine();
      this.FWriter.Write(CloseBracket);
      Result = this;
      return Result;
    };
    this.PushScope = function (Scope) {
      if (this.FStackSize > 255) throw this.ETooManyDepthLevels.$create("Create$2");
      this.FStack[this.FStackSize] = Scope;
      this.FStackSize += 1;
    };
    this.PeekScope = function () {
      var Result = 0;
      if (this.FStackSize === 0) throw this.EEmptyJson.$create("Create$2");
      Result = this.FStack[this.FStackSize - 1];
      return Result;
    };
    this.ReplaceTop = function (Scope) {
      if (this.FStackSize === 0) throw this.EEmptyJson.$create("Create$2");
      this.FStack[this.FStackSize - 1] = Scope;
    };
    this.WriteDeferredName = function () {
      if (this.FDeferredName !== "") {
        this.BeforeName();
        this.InternalWriteString(this.FDeferredName);
        this.FDeferredName = "";
      };
    };
    this.InternalWriteString = function (Value) {
      this.FWriter.Write('"');
      this.FWriter.Write(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.EscapeString(Value));
      this.FWriter.Write('"');
    };
    this.NewLine = function () {
      var I = 0;
      if (this.FIndent !== "") {
        this.FWriter.Write("\r\n");
        for (var $l = 1, $end = this.FStackSize - 1; $l <= $end; $l++) {
          I = $l;
          this.FWriter.Write(this.FIndent);
        };
      };
    };
    this.BeforeName = function () {
      var $tmp = this.PeekScope();
      if ($tmp === $mod.TTMSFNCJSONWriter.TTMSFNCJSONScope.jscNonEmptyObject) {
        this.FWriter.Write(",")}
       else if ($tmp === $mod.TTMSFNCJSONWriter.TTMSFNCJSONScope.jscEmptyObject) {}
      else {
        throw this.ECannotWriteName.$create("Create$2");
      };
      this.NewLine();
      this.ReplaceTop($mod.TTMSFNCJSONWriter.TTMSFNCJSONScope.jscDanglingName);
    };
    this.BeforeValue = function (Root) {
      var $tmp = this.PeekScope();
      if ($tmp === $mod.TTMSFNCJSONWriter.TTMSFNCJSONScope.jscNonEmptyDocument) {
        throw this.EMultipleRootNotAllowed.$create("Create$2")}
       else if ($tmp === $mod.TTMSFNCJSONWriter.TTMSFNCJSONScope.jscEmptyDocument) {
        if (!Root) throw this.EObjectOrArrayExpected.$create("Create$2");
        this.ReplaceTop($mod.TTMSFNCJSONWriter.TTMSFNCJSONScope.jscNonEmptyDocument);
      } else if ($tmp === $mod.TTMSFNCJSONWriter.TTMSFNCJSONScope.jscEmptyArray) {
        this.ReplaceTop($mod.TTMSFNCJSONWriter.TTMSFNCJSONScope.jscNonEmptyArray);
        this.NewLine();
      } else if ($tmp === $mod.TTMSFNCJSONWriter.TTMSFNCJSONScope.jscNonEmptyArray) {
        this.FWriter.Write(",");
        this.NewLine();
      } else if ($tmp === $mod.TTMSFNCJSONWriter.TTMSFNCJSONScope.jscDanglingName) {
        this.FWriter.Write(this.FSeparator);
        this.ReplaceTop($mod.TTMSFNCJSONWriter.TTMSFNCJSONScope.jscNonEmptyObject);
      } else {
        throw this.EInvalidNesting.$create("Create$2");
      };
    };
    this.Create$1 = function (AStream) {
      pas.System.TObject.Create.call(this);
      this.FWriter = $mod.TTMSFNCJSONStreamWriter.$create("Create$1",[AStream]);
      this.FSeparator = ":";
      this.PushScope($mod.TTMSFNCJSONWriter.TTMSFNCJSONScope.jscEmptyDocument);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FWriter");
      pas.System.TObject.Destroy.call(this);
    };
    this.WriteBeginArray = function () {
      var Result = null;
      this.WriteDeferredName();
      Result = this.OpenItem($mod.TTMSFNCJSONWriter.TTMSFNCJSONScope.jscEmptyArray,"[");
      return Result;
    };
    this.WriteEndArray = function () {
      var Result = null;
      Result = this.CloseItem($mod.TTMSFNCJSONWriter.TTMSFNCJSONScope.jscEmptyArray,$mod.TTMSFNCJSONWriter.TTMSFNCJSONScope.jscNonEmptyArray,"]");
      return Result;
    };
    this.WriteBeginObject = function () {
      var Result = null;
      this.WriteDeferredName();
      Result = this.OpenItem($mod.TTMSFNCJSONWriter.TTMSFNCJSONScope.jscEmptyObject,"{");
      return Result;
    };
    this.WriteEndObject = function () {
      var Result = null;
      Result = this.CloseItem($mod.TTMSFNCJSONWriter.TTMSFNCJSONScope.jscEmptyObject,$mod.TTMSFNCJSONWriter.TTMSFNCJSONScope.jscNonEmptyObject,"}");
      return Result;
    };
    this.WriteName = function (Name) {
      var Result = null;
      if (Name === "") throw this.EEmptyName.$create("Create$2");
      if (this.FDeferredName !== "") throw this.EMissingValue.$create("Create$2");
      if (this.FStackSize === 0) throw this.EEmptyJson.$create("Create$2");
      this.FDeferredName = Name;
      Result = this;
      return Result;
    };
    this.WriteString = function (Value) {
      var Result = null;
      this.WriteDeferredName();
      this.BeforeValue(false);
      this.InternalWriteString(Value);
      Result = this;
      return Result;
    };
    this.WriteRawString = function (Value) {
      var Result = null;
      this.WriteDeferredName();
      this.BeforeValue(false);
      this.FWriter.Write('"');
      this.FWriter.Write(Value);
      this.FWriter.Write('"');
      Result = this;
      return Result;
    };
    this.WriteBoolean = function (Value) {
      var Result = null;
      this.WriteDeferredName();
      this.BeforeValue(false);
      if (Value) {
        this.FWriter.Write("true")}
       else this.FWriter.Write("false");
      Result = this;
      return Result;
    };
    this.WriteNull = function () {
      var Result = null;
      this.WriteDeferredName();
      this.BeforeValue(false);
      this.FWriter.Write("null");
      Result = this;
      return Result;
    };
    this.WriteDouble = function (Value) {
      var Result = null;
      this.WriteDeferredName();
      this.BeforeValue(false);
      this.FWriter.Write(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.FloatToStrDot(Value));
      Result = this;
      return Result;
    };
    this.WriteInteger = function (Value) {
      var Result = null;
      this.WriteDeferredName();
      this.BeforeValue(false);
      this.FWriter.Write(pas.SysUtils.IntToStr(Value));
      Result = this;
      return Result;
    };
    this.Close = function () {
      if ((this.FStackSize > 1) || ((this.FStackSize === 1) && (this.PeekScope() !== $mod.TTMSFNCJSONWriter.TTMSFNCJSONScope.jscNonEmptyDocument))) throw this.EInvalidNesting.$create("Create$2");
    };
    var $r = this.$rtti;
    $mod.$rtti.$StaticArray("TTMSFNCJSONWriter.FStack$a",{dims: [256], eltype: $mod.$rtti["TTMSFNCJSONWriter.TTMSFNCJSONScope"]});
  });
},["WEBLib.TMSFNCUtils"]);
rtl.module("WEBLib.TMSFNCPersistence",["System","Generics.Collections","Classes","TypInfo","Variants","SysUtils","WEBLib.TMSFNCTypes","WEBLib.TMSFNCJSONReader","WEBLib.TMSFNCJSONWriter","WEBLib.JSON"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  rtl.createInterface(this,"ITMSFNCPersistence","{363F04AF-B8A7-4C47-A2D6-8ED9C44CEFF6}",["SaveSettingsToFile","LoadSettingsFromFile","SaveSettingsToStream","LoadSettingsFromStream","CanSaveProperty","CanLoadProperty"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("SaveSettingsToFile",0,[["AFileName",rtl.string],["AAppearanceOnly",rtl.boolean]]);
    $r.addMethod("LoadSettingsFromFile",0,[["AFileName",rtl.string]]);
    $r.addMethod("SaveSettingsToStream",0,[["AStream",pas.Classes.$rtti["TStream"]],["AAppearanceOnly",rtl.boolean]]);
    $r.addMethod("LoadSettingsFromStream",0,[["AStream",pas.Classes.$rtti["TStream"]]]);
    $r.addMethod("CanSaveProperty",1,[["AObject",pas.System.$rtti["TObject"]],["APropertyName",rtl.string],["APropertyType",pas.System.$rtti["TTypeKind"]]],2,rtl.boolean);
    $r.addMethod("CanLoadProperty",1,[["AObject",pas.System.$rtti["TObject"]],["APropertyName",rtl.string],["APropertyType",pas.System.$rtti["TTypeKind"]]],2,rtl.boolean);
  });
  rtl.createInterface(this,"ITMSFNCCustomReadWriteIO","{3BC2E91F-A937-47EE-A4CB-6F705B154901}",["CustomWriteProperty","CustomReadProperty"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("CustomWriteProperty",0,[["AObject",pas.System.$rtti["TObject"]],["APropertyName",rtl.string],["APropertyKind",pas.System.$rtti["TTypeKind"]],["AWriter",pas["WEBLib.TMSFNCJSONWriter"].$rtti["TTMSFNCJSONWriter"]],["ACanWrite",rtl.boolean,1]]);
    $r.addMethod("CustomReadProperty",0,[["AObject",pas.System.$rtti["TObject"]],["APropertyName",rtl.string],["APropertyKind",pas.System.$rtti["TTypeKind"]],["AReader",pas["WEBLib.TMSFNCJSONReader"].$rtti["TTMSFNCJSONReader"]],["ACanRead",rtl.boolean,1]]);
  });
  rtl.createInterface(this,"ITMSFNCBaseListIO","{FAB1D21E-D798-4CE0-B17B-9D75E4456AB4}",["GetItemClass"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("GetItemClass",1,[],2,pas.System.$rtti["TClass"]);
  });
  rtl.createInterface(this,"ITMSFNCBasePersistenceIO","{91DEAFC3-8932-45F4-A3ED-5AAA0C0E9250}",["CreateObject"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("CreateObject",1,[["AClassName",rtl.string,2],["ABaseClass",pas.System.$rtti["TClass"],2]],2,pas.System.$rtti["TObject"]);
  });
  rtl.createInterface(this,"ITMSFNCBaseCollectionIO","{90FDF257-7362-411D-B7F6-E2BEE2265016}",["AddItem"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("AddItem",1,[["AObject",pas.System.$rtti["TObject"],2]],2,pas.Classes.$rtti["TCollectionItem"]);
  });
  rtl.createInterface(this,"ITMSFNCPersistenceIO","{11B625F8-447A-4AE5-BB88-5ECDEA979AF7}",["NeedsObjectReference","GetObjectReference","FindObject","FixOwners"],this.ITMSFNCBasePersistenceIO,function () {
    var $r = this.$rtti;
    $r.addMethod("NeedsObjectReference",1,[["AClass",pas.System.$rtti["TClass"],2]],2,rtl.boolean);
    $r.addMethod("GetObjectReference",1,[["AObject",pas.System.$rtti["TObject"],2]],2,rtl.string);
    $r.addMethod("FindObject",1,[["AReference",rtl.string,2]],2,pas.System.$rtti["TObject"]);
    $r.addMethod("FixOwners",0,[["AObject",pas.System.$rtti["TObject"],2],["AObjectList",pas.System.$rtti["TObject"],2]]);
  });
  rtl.createClass(this,"ETMSFNCReaderException",pas.SysUtils.Exception,function () {
  });
  rtl.createClass(this,"TTMSFNCStringObjectDictionary",pas["Generics.Collections"].TDictionary$$$G$$generics$collections$$String$$TObject,function () {
  });
  rtl.createClass(this,"TTMSFNCIntegerObjectDictionary",pas["Generics.Collections"].TDictionary$$$G$$generics$collections$$Longint$$TObject,function () {
  });
  rtl.createClass(this,"TTMSFNCIntegerIntegerDictionary",pas["Generics.Collections"].TDictionary$$$G$$generics$collections$$Longint$$Longint,function () {
  });
  rtl.createClass(this,"TTMSFNCIntegerBooleanDictionary",pas["Generics.Collections"].TDictionary$$$G$$generics$collections$$Longint$$Boolean,function () {
  });
  rtl.createClass(this,"TTMSFNCIntegerDoubleDictionary",pas["Generics.Collections"].TDictionary$$$G$$generics$collections$$Longint$$Double,function () {
  });
  rtl.createClass(this,"TTMSFNCObjectList",pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TObject,function () {
  });
  rtl.createClass(this,"TTMSFNCStringList",pas["Generics.Collections"].TList$$$G$$generics$collections$$String,function () {
  });
  rtl.createClass(this,"TTMSFNCIntegerList",pas["Generics.Collections"].TList$$$G$$generics$collections$$Longint,function () {
  });
  rtl.createClass(this,"TTMSFNCDoubleList",pas["Generics.Collections"].TList$$$G$$generics$collections$$Double,function () {
  });
  this.$rtti.$DynArray("TTMSFNCObjectArray",{eltype: pas.System.$rtti["TObject"]});
  this.$rtti.$MethodVar("TTMSFNCWriterCustomWritePropertyEvent",{procsig: rtl.newTIProcSig([["AObject",pas.System.$rtti["TObject"]],["APropertyName",rtl.string],["APropertyKind",pas.System.$rtti["TTypeKind"]],["AWriter",pas["WEBLib.TMSFNCJSONWriter"].$rtti["TTMSFNCJSONWriter"]],["ACanWrite",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCWriterCustomIsAssignablePropertyEvent",{procsig: rtl.newTIProcSig([["AObject",pas.System.$rtti["TObject"]],["APropertyName",rtl.string],["AIsAssignable",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$DynArray("TTMSFNCExcludePropertyListArray",{eltype: rtl.string});
  rtl.createClass(this,"TTMSFNCWriter",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FWriter = null;
      this.FWriterRef = false;
      this.FIOReference = null;
      this.FOnCustomWriteProperty = null;
      this.FRootObject = null;
      this.FExcludeProperties = [];
      this.FOnCustomIsAssignableProperty = null;
    };
    this.$final = function () {
      this.FWriter = undefined;
      this.FIOReference = undefined;
      this.FOnCustomWriteProperty = undefined;
      this.FRootObject = undefined;
      this.FExcludeProperties = undefined;
      this.FOnCustomIsAssignableProperty = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.SetRootObject = function (Value) {
      this.FRootObject = Value;
      $mod.TTMSFNCPersistence.FRootObject = this.FRootObject;
    };
    this.SetExcludeProperties = function (Value) {
      this.FExcludeProperties = rtl.arrayRef(Value);
      $mod.TTMSFNCPersistence.FExcludeProperties = rtl.arrayRef(this.FExcludeProperties);
    };
    this.SetIOReference = function (Value) {
      this.FIOReference = Value;
      $mod.TTMSFNCPersistence.FIOReference = this.FIOReference;
    };
    this.WritePropInfoValue = function (AInstance, APropInfo) {
      var cn = "";
      var pName = "";
      var en = "";
      var k = 0;
      var p = null;
      var o = null;
      var v = pas.System.TMethod.$new();
      var c = 0;
      var vr = undefined;
      if ($mod.TTMSFNCPersistence.IsWriteOnly(APropInfo)) {
        this.FWriter.WriteNull();
        return;
      };
      o = AInstance;
      p = APropInfo;
      k = $mod.TTMSFNCPersistence.GetPropInfoType(p);
      pName = $mod.TTMSFNCPersistence.GetPropInfoName(p);
      var $tmp = k;
      if ($tmp === pas.System.TTypeKind.tkInteger) {
        cn = $mod.TTMSFNCPersistence.GetPropInfoTypeName(p);
        if ((cn === "TAlphaColor") || (cn === "TColor") || (cn === "TGraphicsColor")) {
          if (pas.TypInfo.GetOrdProp$1(o,p) === -1) {
            this.FWriter.WriteString("gcNull")}
           else {
            c = pas.TypInfo.GetOrdProp$1(o,p);
            this.FWriter.WriteString($impl.ColorToHTMLEx(c));
          };
        } else this.FWriter.WriteInteger(pas.TypInfo.GetOrdProp$1(o,p));
      } else if (($tmp === pas.System.TTypeKind.tkChar) || ($tmp === pas.System.TTypeKind.tkString)) {
        this.FWriter.WriteString(pas.TypInfo.GetStrProp$1(o,p))}
       else if ($tmp === pas.System.TTypeKind.tkEnumeration) {
        if ($mod.TTMSFNCPersistence.GetPropInfoDataTypeInfo(p) === rtl.boolean) {
          this.FWriter.WriteBoolean(pas.TypInfo.GetOrdProp$1(o,p) != 0)}
         else this.FWriter.WriteInteger(pas.TypInfo.GetOrdProp$1(o,p))}
       else if ($tmp === pas.System.TTypeKind.tkBool) {
        this.FWriter.WriteBoolean(pas.TypInfo.GetBoolProp$1(o,p))}
       else if ($tmp === pas.System.TTypeKind.tkDouble) {
        this.FWriter.WriteDouble(pas.TypInfo.GetFloatProp$1(o,p))}
       else if ($tmp === pas.System.TTypeKind.tkSet) {
        this.FWriter.WriteInteger(pas.TypInfo.GetOrdProp$1(o,p))}
       else if ($tmp === pas.System.TTypeKind.tkJSValue) {
        vr = pas.TypInfo.GetJSValueProp$3(o,p);
        if (pas.JS.isUndefined(vr) || pas.JS.isNull(vr)) {
          this.FWriter.WriteNull()}
         else if (rtl.isNumber(vr)) {
          if (pas.System.Frac(rtl.getNumber(vr)) === 0) {
            this.FWriter.WriteInteger(rtl.trunc(vr))}
           else this.FWriter.WriteDouble(rtl.getNumber(vr));
        } else if (pas.JS.isBoolean(vr)) {
          this.FWriter.WriteBoolean(!(vr == false))}
         else if (rtl.isString(vr)) {
          this.FWriter.WriteString("" + vr)}
         else this.FWriter.WriteNull();
      } else if ($tmp === pas.System.TTypeKind.tkMethod) {
        v.$assign(pas.TypInfo.GetMethodProp(o,p));
        if (v.Code === null) {
          this.FWriter.WriteNull()}
         else {
          if ($mod.TTMSFNCPersistence.FRootObject != null) {
            this.FWriter.WriteString($mod.TTMSFNCPersistence.FRootObject.$class.MethodName(v.Code))}
           else this.FWriter.WriteNull();
        };
      } else {
        en = $mod.TTMSFNCPersistence.GetEnumName(pas.System.$rtti["TTypeKind"],k);
        this.FWriter.WriteNull();
      };
      if (pas["WEBLib.Graphics"].TFont.isPrototypeOf(o) && (pName === "Size")) {
        this.FWriter.WriteName("IsFMX");
        this.FWriter.WriteBoolean(false);
      };
    };
    this.WriteProperties = function (AObject) {
      var ci = null;
      var a = [];
      var I = 0;
      if (AObject != null) {
        ci = AObject.$rtti;
        try {
          a = pas.TypInfo.GetPropList(ci,pas.System.tkAny,true);
          for (var $l = 0, $end = rtl.length(a) - 1; $l <= $end; $l++) {
            I = $l;
            this.WriteProperty(AObject,a[I]);
          };
        } finally {
        };
      };
    };
    this.WriteProperty = function (AObject, AProp) {
      var pName = "";
      var k = 0;
      var b = false;
      var a = false;
      var ap = false;
      var p = null;
      var crw = null;
      var o = null;
      try {
        if (!(AProp != null)) return;
        pName = $mod.TTMSFNCPersistence.GetPropInfoName(AProp);
        k = $mod.TTMSFNCPersistence.GetPropInfoType(AProp);
        b = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.IndexOfTextInArray(pName,$mod.TTMSFNCPersistence.FExcludeProperties) === -1;
        if (pas.SysUtils.Supports$3(AObject,$mod.ITMSFNCPersistence.$guid,{get: function () {
            return p;
          }, set: function (v) {
            p = v;
          }})) b = p.CanSaveProperty(AObject,pName,k);
        if (b) {
          a = true;
          if (this.FOnCustomWriteProperty != null) this.FOnCustomWriteProperty(AObject,pName,k,this.FWriter,{get: function () {
              return a;
            }, set: function (v) {
              a = v;
            }});
          if (a && pas.SysUtils.Supports$3(AObject,$mod.ITMSFNCCustomReadWriteIO.$guid,{get: function () {
              return crw;
            }, set: function (v) {
              crw = v;
            }})) crw.CustomWriteProperty(AObject,pName,k,this.FWriter,{get: function () {
              return a;
            }, set: function (v) {
              a = v;
            }});
          if (a) {
            this.FWriter.WriteName(pName);
            if (k in rtl.createSet(pas.System.TTypeKind.tkClass)) {
              o = pas.TypInfo.GetObjectProp(AObject,pName);
              ap = $mod.TTMSFNCPersistence.IsAssignableProperty(AObject,AProp);
              if (this.FOnCustomIsAssignableProperty != null) this.FOnCustomIsAssignableProperty(AObject,pName,{get: function () {
                  return ap;
                }, set: function (v) {
                  ap = v;
                }});
              if (ap) {
                if (pas.Classes.TComponent.isPrototypeOf(o)) {
                  this.FWriter.WriteString(rtl.as(o,pas.Classes.TComponent).FName)}
                 else this.FWriter.WriteString("");
              } else this.WriteObject(o);
            } else this.WritePropInfoValue(AObject,AProp);
          };
        };
      } finally {
        rtl._Release(p);
        rtl._Release(crw);
      };
    };
    this.WriteGenericObjectList = function (AList) {
      var I = 0;
      this.FWriter.WriteBeginArray();
      for (var $l = 0, $end = AList.FLength - 1; $l <= $end; $l++) {
        I = $l;
        this.WriteSingleObject(AList.GetItem(I));
      };
      this.FWriter.WriteEndArray();
    };
    this.WriteGenericStringList = function (AList) {
      var I = 0;
      this.FWriter.WriteBeginArray();
      for (var $l = 0, $end = AList.FLength - 1; $l <= $end; $l++) {
        I = $l;
        this.FWriter.WriteString(AList.GetItem(I));
      };
      this.FWriter.WriteEndArray();
    };
    this.WriteGenericIntegerList = function (AList) {
      var I = 0;
      this.FWriter.WriteBeginArray();
      for (var $l = 0, $end = AList.FLength - 1; $l <= $end; $l++) {
        I = $l;
        this.FWriter.WriteInteger(AList.GetItem(I));
      };
      this.FWriter.WriteEndArray();
    };
    this.WriteGenericDoubleList = function (AList) {
      var I = 0;
      this.FWriter.WriteBeginArray();
      for (var $l = 0, $end = AList.FLength - 1; $l <= $end; $l++) {
        I = $l;
        this.FWriter.WriteDouble(AList.GetItem(I));
      };
      this.FWriter.WriteEndArray();
    };
    this.WriteStrings = function (AList) {
      var I = 0;
      this.FWriter.WriteBeginArray();
      for (var $l = 0, $end = AList.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.FWriter.WriteString(AList.Get(I));
      };
      this.FWriter.WriteEndArray();
    };
    this.WriteGenericStringObjectDictionary = function (ADictionary) {
      var key = "";
      this.FWriter.WriteBeginArray();
      var $in = ADictionary.GetKeys().GetEnumerator$1();
      try {
        while ($in.MoveNext$1()) {
          key = $in.GetCurrent();
          this.FWriter.WriteBeginObject();
          this.FWriter.WriteName(key);
          this.WriteSingleObject(ADictionary.GetItem(key));
          this.FWriter.WriteEndObject();
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      this.FWriter.WriteEndArray();
    };
    this.WriteGenericIntegerObjectDictionary = function (ADictionary) {
      var key = 0;
      this.FWriter.WriteBeginArray();
      var $in = ADictionary.GetKeys().GetEnumerator$1();
      try {
        while ($in.MoveNext$1()) {
          key = $in.GetCurrent();
          this.FWriter.WriteBeginObject();
          this.FWriter.WriteName(pas.SysUtils.IntToStr(key));
          this.WriteSingleObject(ADictionary.GetItem(key));
          this.FWriter.WriteEndObject();
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      this.FWriter.WriteEndArray();
    };
    this.WriteGenericIntegerIntegerDictionary = function (ADictionary) {
      var key = 0;
      this.FWriter.WriteBeginArray();
      var $in = ADictionary.GetKeys().GetEnumerator$1();
      try {
        while ($in.MoveNext$1()) {
          key = $in.GetCurrent();
          this.FWriter.WriteBeginObject();
          this.FWriter.WriteName(pas.SysUtils.IntToStr(key));
          this.FWriter.WriteInteger(ADictionary.GetItem(key));
          this.FWriter.WriteEndObject();
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      this.FWriter.WriteEndArray();
    };
    this.WriteGenericIntegerBooleanDictionary = function (ADictionary) {
      var key = 0;
      this.FWriter.WriteBeginArray();
      var $in = ADictionary.GetKeys().GetEnumerator$1();
      try {
        while ($in.MoveNext$1()) {
          key = $in.GetCurrent();
          this.FWriter.WriteBeginObject();
          this.FWriter.WriteName(pas.SysUtils.IntToStr(key));
          this.FWriter.WriteBoolean(ADictionary.GetItem(key));
          this.FWriter.WriteEndObject();
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      this.FWriter.WriteEndArray();
    };
    this.WriteGenericIntegerDoubleDictionary = function (ADictionary) {
      var key = 0;
      this.FWriter.WriteBeginArray();
      var $in = ADictionary.GetKeys().GetEnumerator$1();
      try {
        while ($in.MoveNext$1()) {
          key = $in.GetCurrent();
          this.FWriter.WriteBeginObject();
          this.FWriter.WriteName(pas.SysUtils.IntToStr(key));
          this.FWriter.WriteDouble(ADictionary.GetItem(key));
          this.FWriter.WriteEndObject();
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      this.FWriter.WriteEndArray();
    };
    this.WriteCollection = function (ACollection) {
      var I = 0;
      this.FWriter.WriteBeginArray();
      for (var $l = 0, $end = ACollection.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.WriteSingleObject(ACollection.GetItem(I));
      };
      this.FWriter.WriteEndArray();
    };
    this.WriteList = function (AList) {
      var I = 0;
      this.FWriter.WriteBeginArray();
      for (var $l = 0, $end = AList.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.WriteSingleObject(rtl.getObject(AList.Get(I)));
      };
      this.FWriter.WriteEndArray();
    };
    this.WriteBitmap = function (ABitmap) {
      if (pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(ABitmap)) {
        this.FWriter.WriteString("");
        return;
      };
      this.FWriter.WriteString(ABitmap.GetData());
    };
    this.WriteSingleObject = function (AObject) {
      this.FWriter.WriteBeginObject();
      if ($mod.TTMSFNCPersistence.ClassTypeVariable !== "") {
        this.FWriter.WriteName($mod.TTMSFNCPersistence.ClassTypeVariable);
        this.FWriter.WriteString(AObject.$classname);
      };
      this.WriteProperties(AObject);
      this.FWriter.WriteEndObject();
    };
    this.WriteObject = function (AObject) {
      var b = null;
      try {
        if (AObject === null) {
          this.FWriter.WriteNull()}
         else {
          if ($mod.TTMSFNCPersistence.IsGenericList(AObject.$class.ClassType(),"String")) {
            this.WriteGenericStringList(AObject)}
           else if ($mod.TTMSFNCPersistence.IsGenericList(AObject.$class.ClassType(),"Integer")) {
            this.WriteGenericIntegerList(AObject)}
           else if ($mod.TTMSFNCPersistence.IsGenericList(AObject.$class.ClassType(),"Double")) {
            this.WriteGenericDoubleList(AObject)}
           else if ($mod.TTMSFNCPersistence.IsGenericList(AObject.$class.ClassType(),"")) {
            this.WriteGenericObjectList(AObject)}
           else if ($mod.TTMSFNCPersistence.IsGenericStringDictionary(AObject.$class.ClassType())) {
            if ($mod.TTMSFNCPersistence.IsGenericDictionaryValueTypeObject(AObject.$class.ClassType())) {
              this.WriteGenericStringObjectDictionary(AObject)}
             else this.FWriter.WriteNull();
          } else if ($mod.TTMSFNCPersistence.IsGenericIntegerDictionary(AObject.$class.ClassType())) {
            if ($mod.TTMSFNCPersistence.IsGenericDictionaryValueTypeObject(AObject.$class.ClassType())) {
              this.WriteGenericIntegerObjectDictionary(AObject)}
             else if ($mod.TTMSFNCPersistence.IsGenericDictionaryValueTypeInteger(AObject.$class.ClassType())) {
              this.WriteGenericIntegerIntegerDictionary(AObject)}
             else if ($mod.TTMSFNCPersistence.IsGenericDictionaryValueTypeBoolean(AObject.$class.ClassType())) {
              this.WriteGenericIntegerBooleanDictionary(AObject)}
             else if ($mod.TTMSFNCPersistence.IsGenericDictionaryValueTypeDouble(AObject.$class.ClassType())) {
              this.WriteGenericIntegerDoubleDictionary(AObject)}
             else this.FWriter.WriteNull();
          } else if ($mod.TTMSFNCPersistence.IsList(AObject.$class.ClassType())) {
            this.WriteList(AObject)}
           else if ($mod.TTMSFNCPersistence.IsCollection(AObject.$class.ClassType())) {
            this.WriteCollection(AObject)}
           else if ($mod.TTMSFNCPersistence.IsBitmap(AObject.$class.ClassType())) {
            this.WriteBitmap(AObject)}
           else if ($mod.TTMSFNCPersistence.IsDescendingClass(AObject.$class.ClassType(),["TStrings"])) {
            this.WriteStrings(AObject)}
           else {
            if ((this.FIOReference != null) && pas.SysUtils.Supports$3(this.FIOReference,$mod.ITMSFNCPersistenceIO.$guid,{get: function () {
                return b;
              }, set: function (v) {
                b = v;
              }})) {
              if (b.NeedsObjectReference(AObject.$class.ClassType())) {
                this.FWriter.WriteString(b.GetObjectReference(AObject))}
               else this.WriteSingleObject(AObject);
            } else this.WriteSingleObject(AObject);
          };
        };
      } finally {
        rtl._Release(b);
      };
    };
    this.Create$1 = function (AStream) {
      this.FWriter = pas["WEBLib.TMSFNCJSONWriter"].TTMSFNCJSONWriter.$create("Create$1",[AStream]);
      this.FWriterRef = false;
      return this;
    };
    this.Create$2 = function (AWriter) {
      this.FWriter = AWriter;
      this.FWriterRef = true;
      return this;
    };
    this.Destroy = function () {
      if (this.FWriterRef) {
        this.FWriter = null}
       else rtl.free(this,"FWriter");
      pas.System.TObject.Destroy.call(this);
    };
    this.Write = function (AObject) {
      this.WriteObject(AObject);
    };
    this.WriteArray = function (AName, AArray) {
      var I = 0;
      this.FWriter.WriteBeginObject();
      this.FWriter.WriteName(AName);
      this.FWriter.WriteBeginArray();
      for (var $l = 0, $end = rtl.length(AArray) - 1; $l <= $end; $l++) {
        I = $l;
        this.WriteSingleObject(AArray[I]);
      };
      this.FWriter.WriteEndArray();
      this.FWriter.WriteEndObject();
    };
  });
  this.$rtti.$MethodVar("TTMSFNCReaderCustomReadPropertyEvent",{procsig: rtl.newTIProcSig([["AObject",pas.System.$rtti["TObject"]],["APropertyName",rtl.string],["APropertyKind",pas.System.$rtti["TTypeKind"]],["AReader",pas["WEBLib.TMSFNCJSONReader"].$rtti["TTMSFNCJSONReader"]],["ACanRead",rtl.boolean,1]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCObjectReference",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.Instance = null;
      this.Prop = null;
      this.Id = "";
    };
    this.$final = function () {
      this.Instance = undefined;
      this.Prop = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function (AInstance, AProp, AId) {
      this.Instance = AInstance;
      this.Prop = AProp;
      this.Id = AId;
      return this;
    };
  });
  rtl.createClass(this,"TTMSFNCReader",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FReaderRef = false;
      this.FReferences = null;
      this.FReader = null;
      this.FIOReference = null;
      this.FOnCustomReadProperty = null;
      this.FRootObject = null;
      this.FExcludeProperties = [];
      this.FOnCustomIsAssignableProperty = null;
    };
    this.$final = function () {
      this.FReferences = undefined;
      this.FReader = undefined;
      this.FIOReference = undefined;
      this.FOnCustomReadProperty = undefined;
      this.FRootObject = undefined;
      this.FExcludeProperties = undefined;
      this.FOnCustomIsAssignableProperty = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.ReadSingleObject = function (ABaseClass) {
      var Result = null;
      var cn = "";
      var b = null;
      var p = null;
      try {
        this.FReader.ReadBeginObject();
        if ($mod.TTMSFNCPersistence.ClassTypeVariable !== "") {
          if (!this.FReader.HasNext() || (this.FReader.ReadName() !== $mod.TTMSFNCPersistence.ClassTypeVariable)) throw $mod.ETMSFNCReaderException.$create("Create$1",['"' + $mod.TTMSFNCPersistence.ClassTypeVariable + '" property not found in Object descriptor.']);
          cn = this.FReader.ReadString();
        };
        if (cn === "") cn = ABaseClass.$classname;
        Result = null;
        if (this.FIOReference != null) {
          if (pas.SysUtils.Supports$3(this.FIOReference,$mod.ITMSFNCBasePersistenceIO.$guid,{get: function () {
              return b;
            }, set: function (v) {
              b = v;
            }})) {
            Result = b.CreateObject(cn,ABaseClass)}
           else if (pas.SysUtils.Supports$3(this.FIOReference,$mod.ITMSFNCPersistenceIO.$guid,{get: function () {
              return p;
            }, set: function (v) {
              p = v;
            }})) Result = p.CreateObject(cn,ABaseClass);
        };
        if (!(Result != null)) Result = $mod.TTMSFNCPersistence.CreateObject(cn,ABaseClass);
        try {
          this.ReadProperties(Result);
          this.FReader.ReadEndObject();
        } catch ($e) {
          Result = rtl.freeLoc(Result);
          throw $e;
        };
      } finally {
        rtl._Release(b);
        rtl._Release(p);
      };
      return Result;
    };
    this.SetRootObject = function (Value) {
      this.FRootObject = Value;
      $mod.TTMSFNCPersistence.FRootObject = this.FRootObject;
    };
    this.SetExcludeProperties = function (Value) {
      this.FExcludeProperties = rtl.arrayRef(Value);
      $mod.TTMSFNCPersistence.FExcludeProperties = rtl.arrayRef(this.FExcludeProperties);
    };
    this.SetIOReference = function (Value) {
      this.FIOReference = Value;
      $mod.TTMSFNCPersistence.FIOReference = this.FIOReference;
    };
    this.ReadSingleObject$1 = function (AObject) {
      this.FReader.ReadBeginObject();
      if ($mod.TTMSFNCPersistence.ClassTypeVariable !== "") {
        if (!this.FReader.HasNext() || (this.FReader.ReadName() !== $mod.TTMSFNCPersistence.ClassTypeVariable)) throw $mod.ETMSFNCReaderException.$create("Create$1",['"' + $mod.TTMSFNCPersistence.ClassTypeVariable + '" property not found in Object descriptor.']);
        this.FReader.ReadString();
      };
      try {
        this.ReadProperties(AObject);
        this.FReader.ReadEndObject();
      } catch ($e) {
        throw $e;
      };
    };
    this.ReadProperties = function (AObject) {
      var Prop = null;
      while (this.FReader.HasNext()) {
        if (!this.FReader.IsNull()) {
          Prop = null;
          if (AObject != null) Prop = pas.TypInfo.GetPropInfo$2(AObject,this.FReader.ReadName());
          if (Prop != null) {
            this.ReadProperty(AObject,Prop)}
           else this.FReader.SkipValue();
        } else this.FReader.SkipValue();
      };
    };
    this.ReadProperty = function (AObject, AProp) {
      var pName = "";
      var ct = null;
      var b = false;
      var p = null;
      var pio = null;
      var k = 0;
      var a = false;
      var ap = false;
      var o = null;
      var n = "";
      var crw = null;
      try {
        if (!(AProp != null)) return;
        k = $mod.TTMSFNCPersistence.GetPropInfoType(AProp);
        pName = $mod.TTMSFNCPersistence.GetPropInfoName(AProp);
        b = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.IndexOfTextInArray(pName,$mod.TTMSFNCPersistence.FExcludeProperties) === -1;
        if (pas.SysUtils.Supports$3(AObject,$mod.ITMSFNCPersistence.$guid,{get: function () {
            return p;
          }, set: function (v) {
            p = v;
          }})) b = p.CanLoadProperty(AObject,pName,k);
        if (b) {
          a = true;
          if (this.FOnCustomReadProperty != null) this.FOnCustomReadProperty(AObject,pName,k,this.FReader,{get: function () {
              return a;
            }, set: function (v) {
              a = v;
            }});
          if (a && pas.SysUtils.Supports$3(AObject,$mod.ITMSFNCCustomReadWriteIO.$guid,{get: function () {
              return crw;
            }, set: function (v) {
              crw = v;
            }})) crw.CustomReadProperty(AObject,pName,k,this.FReader,{get: function () {
              return a;
            }, set: function (v) {
              a = v;
            }});
          if (a) {
            if (k in rtl.createSet(pas.System.TTypeKind.tkClass)) {
              ct = $mod.TTMSFNCPersistence.GetPropInfoDataTypeInfoClassType(AProp);
              if ($mod.TTMSFNCPersistence.IsGenericList(ct,"String")) {
                this.ReadGenericStringList(pas.TypInfo.GetObjectProp(AObject,pName))}
               else if ($mod.TTMSFNCPersistence.IsGenericList(ct,"Double")) {
                this.ReadGenericDoubleList(pas.TypInfo.GetObjectProp(AObject,pName))}
               else if ($mod.TTMSFNCPersistence.IsGenericList(ct,"Integer")) {
                this.ReadGenericIntegerList(pas.TypInfo.GetObjectProp(AObject,pName))}
               else if ($mod.TTMSFNCPersistence.IsGenericList(ct,"")) {
                this.ReadGenericObjectList(pas.TypInfo.GetObjectProp(AObject,pName))}
               else if ($mod.TTMSFNCPersistence.IsGenericStringDictionary(ct)) {
                if ($mod.TTMSFNCPersistence.IsGenericDictionaryValueTypeObject(ct)) {
                  this.ReadGenericStringObjectDictionary(pas.TypInfo.GetObjectProp(AObject,pName))}
                 else this.FReader.SkipValue();
              } else if ($mod.TTMSFNCPersistence.IsGenericIntegerDictionary(ct)) {
                if ($mod.TTMSFNCPersistence.IsGenericDictionaryValueTypeObject(ct)) {
                  this.ReadGenericIntegerObjectDictionary(pas.TypInfo.GetObjectProp(AObject,pName))}
                 else if ($mod.TTMSFNCPersistence.IsGenericDictionaryValueTypeInteger(ct)) {
                  this.ReadGenericIntegerIntegerDictionary(pas.TypInfo.GetObjectProp(AObject,pName))}
                 else if ($mod.TTMSFNCPersistence.IsGenericDictionaryValueTypeBoolean(ct)) {
                  this.ReadGenericIntegerBooleanDictionary(pas.TypInfo.GetObjectProp(AObject,pName))}
                 else if ($mod.TTMSFNCPersistence.IsGenericDictionaryValueTypeDouble(ct)) {
                  this.ReadGenericIntegerDoubleDictionary(pas.TypInfo.GetObjectProp(AObject,pName))}
                 else this.FReader.SkipValue();
              } else if ($mod.TTMSFNCPersistence.IsList(ct)) {
                this.ReadList(pas.TypInfo.GetObjectProp(AObject,pName))}
               else if ($mod.TTMSFNCPersistence.IsCollection(ct)) {
                this.ReadCollection(pas.TypInfo.GetObjectProp(AObject,pName))}
               else if ($mod.TTMSFNCPersistence.IsBitmap(ct)) {
                this.ReadBitmap(pas.TypInfo.GetObjectProp(AObject,pName))}
               else if ($mod.TTMSFNCPersistence.IsDescendingClass(ct,["TStrings"])) {
                this.ReadStrings(pas.TypInfo.GetObjectProp(AObject,pName))}
               else {
                a = false;
                if ((this.FIOReference != null) && pas.SysUtils.Supports$3(this.FIOReference,$mod.ITMSFNCPersistenceIO.$guid,{get: function () {
                    return pio;
                  }, set: function (v) {
                    pio = v;
                  }})) a = pio.NeedsObjectReference(ct);
                if (a) {
                  if (this.FReader.IsNull()) {
                    this.FReader.ReadNull();
                    pas.TypInfo.SetObjectProp(AObject,pName,null);
                  } else this.FReferences.Add($mod.TTMSFNCObjectReference.$create("Create$1",[AObject,AProp,this.FReader.ReadString()]));
                } else {
                  o = pas.TypInfo.GetObjectProp(AObject,pName);
                  ap = $mod.TTMSFNCPersistence.IsAssignableProperty(AObject,AProp);
                  if (this.FOnCustomIsAssignableProperty != null) this.FOnCustomIsAssignableProperty(AObject,pName,{get: function () {
                      return ap;
                    }, set: function (v) {
                      ap = v;
                    }});
                  if (ap) {
                    n = this.FReader.ReadString();
                    if ((this.FRootObject != null) && pas.Classes.TComponent.isPrototypeOf(this.FRootObject)) pas.TypInfo.SetObjectProp(AObject,pName,rtl.as(this.FRootObject,pas.Classes.TComponent).FindComponent(n));
                  } else this.ReadExistingObject(o);
                };
              };
            } else this.ReadPropInfoValue(AObject,AProp);
          };
        } else this.FReader.SkipValue();
      } finally {
        rtl._Release(p);
        rtl._Release(crw);
        rtl._Release(pio);
      };
    };
    this.ReadPropInfoValue = function (AInstance, APropInfo) {
      var pName = "";
      var cn = "";
      var cnv = "";
      var en = "";
      var k = 0;
      var p = null;
      var o = null;
      var i = 0;
      var s = "";
      var b = false;
      var d = 0.0;
      var ii = 0;
      var v = "";
      var m = pas.System.TMethod.$new();
      var bsz = false;
      var vr = undefined;
      if ($mod.TTMSFNCPersistence.IsWriteOnly(APropInfo) || this.FReader.IsNull()) {
        this.FReader.ReadNull();
        return;
      };
      o = AInstance;
      p = APropInfo;
      pName = $mod.TTMSFNCPersistence.GetPropInfoName(p);
      k = rtl.rc($mod.TTMSFNCPersistence.GetPropInfoType(p),0,20);
      var $tmp = k;
      if ($tmp === pas.System.TTypeKind.tkInteger) {
        cn = $mod.TTMSFNCPersistence.GetPropInfoTypeName(p);
        if ((cn === "TAlphaColor") || (cn === "TColor") || (cn === "TGraphicsColor")) {
          cnv = this.FReader.ReadString();
          if (!$mod.TTMSFNCPersistence.IsReadOnly(p)) {
            if (cnv === "gcNull") {
              pas.TypInfo.SetOrdProp(o,pName,-1)}
             else {
              pas.TypInfo.SetOrdProp(o,pName,$impl.HTMLToColorEx(cnv));
            };
          };
        } else {
          i = rtl.rc(this.FReader.ReadInteger(),-2147483648,2147483647);
          if (!$mod.TTMSFNCPersistence.IsReadOnly(p)) pas.TypInfo.SetOrdProp$1(o,p,i);
        };
      } else if (($tmp === pas.System.TTypeKind.tkChar) || ($tmp === pas.System.TTypeKind.tkString)) {
        s = this.FReader.ReadString();
        if (!$mod.TTMSFNCPersistence.IsReadOnly(p)) pas.TypInfo.SetStrProp$1(o,p,s);
      } else if ($tmp === pas.System.TTypeKind.tkEnumeration) {
        if ($mod.TTMSFNCPersistence.GetPropInfoDataTypeInfo(p) === rtl.boolean) {
          b = this.FReader.ReadBoolean();
          if (!$mod.TTMSFNCPersistence.IsReadOnly(p)) pas.TypInfo.SetOrdProp$1(o,p,(b ? 1 : 0));
        } else {
          i = rtl.rc(this.FReader.ReadInteger(),-2147483648,2147483647);
          if (!$mod.TTMSFNCPersistence.IsReadOnly(p)) pas.TypInfo.SetOrdProp$1(o,p,i);
        }}
       else if ($tmp === pas.System.TTypeKind.tkBool) {
        b = this.FReader.ReadBoolean();
        if (!$mod.TTMSFNCPersistence.IsReadOnly(p)) {
          pas.TypInfo.SetBoolProp$1(o,p,b);
        };
      } else if ($tmp === pas.System.TTypeKind.tkDouble) {
        d = this.FReader.ReadDouble();
        if (!$mod.TTMSFNCPersistence.IsReadOnly(p)) pas.TypInfo.SetFloatProp$1(o,p,d);
      } else if ($tmp === pas.System.TTypeKind.tkSet) {
        i = rtl.rc(this.FReader.ReadInteger(),-2147483648,2147483647);
        if (!$mod.TTMSFNCPersistence.IsReadOnly(p)) pas.TypInfo.SetOrdProp$1(o,p,i);
      } else if ($tmp === pas.System.TTypeKind.tkJSValue) {
        vr = null;
        if (this.FReader.HasDouble()) {
          vr = this.FReader.ReadDouble()}
         else if (this.FReader.HasInt64()) {
          vr = this.FReader.ReadInt64()}
         else if (this.FReader.HasBoolean()) {
          vr = this.FReader.ReadBoolean()}
         else if (this.FReader.HasString()) {
          vr = this.FReader.ReadString()}
         else this.FReader.ReadNull();
        if (!$mod.TTMSFNCPersistence.IsReadOnly(p)) {
          pas.TypInfo.SetJSValueProp$3(o,p,vr);
        };
      } else if ($tmp === pas.System.TTypeKind.tkMethod) {
        m.Data = null;
        m.Code = null;
        if (this.FReader.IsNull()) {
          this.FReader.ReadNull()}
         else {
          if ($mod.TTMSFNCPersistence.FRootObject != null) {
            v = this.FReader.ReadString();
            m.Code = $mod.TTMSFNCPersistence.FRootObject.$class.MethodAddress(v);
            if (m.Code !== null) m.Data = $mod.TTMSFNCPersistence.FRootObject;
          } else this.FReader.ReadNull();
        };
        pas.TypInfo.SetMethodProp(o,p,m);
      } else {
        en = $mod.TTMSFNCPersistence.GetEnumName(pas.System.$rtti["TTypeKind"],k);
        this.FReader.ReadNull();
      };
      if (pas["WEBLib.Graphics"].TFont.isPrototypeOf(o) && (pName === "Size")) {
        if (this.FReader.HasNext()) {
          s = this.FReader.PeekName();
          if (s === "IsFMX") {
            this.FReader.ReadName();
            bsz = this.FReader.ReadBoolean();
            if (bsz) {
              rtl.as(o,pas["WEBLib.Graphics"].TFont).SetSize(Math.round((rtl.as(o,pas["WEBLib.Graphics"].TFont).FSize / 96) * 72));
            };
          };
        };
      };
    };
    this.ReadExistingObject = function (AObject) {
      if (AObject != null) {
        if (!this.FReader.IsNull()) {
          this.FReader.ReadBeginObject();
          if ($mod.TTMSFNCPersistence.ClassTypeVariable !== "") {
            if (!this.FReader.HasNext() || (this.FReader.ReadName() !== $mod.TTMSFNCPersistence.ClassTypeVariable)) throw $mod.ETMSFNCReaderException.$create("Create$1",['"' + $mod.TTMSFNCPersistence.ClassTypeVariable + '" property not found in Object descriptor.']);
            this.FReader.ReadString();
          };
          this.ReadProperties(AObject);
          this.FReader.ReadEndObject();
        } else this.FReader.SkipValue();
      } else this.FReader.ReadNull();
    };
    this.ReadGenericStringList = function (AList) {
      var obj = "";
      AList.Clear();
      this.FReader.ReadBeginArray();
      while (this.FReader.HasNext()) {
        if (!this.FReader.IsNull()) {
          obj = this.FReader.ReadString();
          AList.Add(obj);
        } else this.FReader.SkipValue();
      };
      this.FReader.ReadEndArray();
    };
    this.ReadGenericDoubleList = function (AList) {
      var obj = 0.0;
      AList.Clear();
      this.FReader.ReadBeginArray();
      while (this.FReader.HasNext()) {
        if (!this.FReader.IsNull()) {
          obj = this.FReader.ReadDouble();
          AList.Add(obj);
        } else this.FReader.SkipValue();
      };
      this.FReader.ReadEndArray();
    };
    this.ReadGenericIntegerList = function (AList) {
      var obj = 0;
      AList.Clear();
      this.FReader.ReadBeginArray();
      while (this.FReader.HasNext()) {
        if (!this.FReader.IsNull()) {
          obj = this.FReader.ReadInteger();
          AList.Add(obj);
        } else this.FReader.SkipValue();
      };
      this.FReader.ReadEndArray();
    };
    this.ReadStrings = function (AList) {
      var obj = "";
      AList.Clear();
      this.FReader.ReadBeginArray();
      while (this.FReader.HasNext()) {
        if (!this.FReader.IsNull()) {
          obj = this.FReader.ReadString();
          AList.Add(obj);
        } else this.FReader.SkipValue();
      };
      this.FReader.ReadEndArray();
    };
    this.ReadGenericObjectList = function (AList) {
      var obj = null;
      var b = null;
      var c = null;
      var i = null;
      var cl = false;
      try {
        if (pas.SysUtils.Supports$3(AList,$mod.ITMSFNCBaseListIO.$guid,{get: function () {
            return i;
          }, set: function (v) {
            i = v;
          }})) {
          c = i.GetItemClass()}
         else c = $mod.TTMSFNCPersistence.GetGenericListType(AList.$class.ClassType());
        cl = false;
        this.FReader.ReadBeginArray();
        if (!this.FReader.HasNext()) {
          AList.Clear()}
         else {
          while (this.FReader.HasNext()) {
            if (!this.FReader.IsNull()) {
              obj = this.ReadSingleObject(c);
              if (obj != null) {
                if (!cl) {
                  AList.Clear();
                  cl = true;
                };
                if ((this.FIOReference != null) && pas.SysUtils.Supports$3(this.FIOReference,$mod.ITMSFNCPersistenceIO.$guid,{get: function () {
                    return b;
                  }, set: function (v) {
                    b = v;
                  }})) b.FixOwners(obj,AList);
                AList.Add(obj);
              };
            } else this.FReader.SkipValue();
          };
        };
        this.FReader.ReadEndArray();
      } finally {
        rtl._Release(i);
        rtl._Release(b);
      };
    };
    this.ReadGenericStringObjectDictionary = function (ADictionary) {
      var obj = null;
      var k = "";
      var c = null;
      var i = null;
      var cl = false;
      try {
        if (pas.SysUtils.Supports$3(ADictionary,$mod.ITMSFNCBaseListIO.$guid,{get: function () {
            return i;
          }, set: function (v) {
            i = v;
          }})) {
          c = i.GetItemClass()}
         else c = $mod.TTMSFNCPersistence.GetGenericDictionaryValueType(ADictionary.$class.ClassType());
        cl = false;
        ADictionary.Clear();
        this.FReader.ReadBeginArray();
        if (!this.FReader.HasNext()) {
          ADictionary.Clear()}
         else {
          while (this.FReader.HasNext()) {
            if (!this.FReader.IsNull()) {
              this.FReader.ReadBeginObject();
              k = this.FReader.ReadName();
              obj = this.ReadSingleObject(c);
              if (obj != null) {
                if (!cl) {
                  ADictionary.Clear();
                  cl = true;
                };
                ADictionary.Add(k,obj);
              };
              this.FReader.ReadEndObject();
            } else this.FReader.SkipValue();
          };
        };
        this.FReader.ReadEndArray();
      } finally {
        rtl._Release(i);
      };
    };
    this.ReadGenericIntegerObjectDictionary = function (ADictionary) {
      var obj = null;
      var k = 0;
      var c = null;
      var i = null;
      var cl = false;
      try {
        if (pas.SysUtils.Supports$3(ADictionary,$mod.ITMSFNCBaseListIO.$guid,{get: function () {
            return i;
          }, set: function (v) {
            i = v;
          }})) {
          c = i.GetItemClass()}
         else c = $mod.TTMSFNCPersistence.GetGenericDictionaryValueType(ADictionary.$class.ClassType());
        cl = false;
        ADictionary.Clear();
        this.FReader.ReadBeginArray();
        if (!this.FReader.HasNext()) {
          ADictionary.Clear()}
         else {
          while (this.FReader.HasNext()) {
            if (!this.FReader.IsNull()) {
              this.FReader.ReadBeginObject();
              pas.SysUtils.TryStrToInt(this.FReader.ReadName(),{get: function () {
                  return k;
                }, set: function (v) {
                  k = v;
                }});
              obj = this.ReadSingleObject(c);
              if (obj != null) {
                if (!cl) {
                  ADictionary.Clear();
                  cl = true;
                };
                ADictionary.Add(k,obj);
              };
              this.FReader.ReadEndObject();
            } else this.FReader.SkipValue();
          };
        };
        this.FReader.ReadEndArray();
      } finally {
        rtl._Release(i);
      };
    };
    this.ReadGenericIntegerIntegerDictionary = function (ADictionary) {
      var obj = 0;
      var k = 0;
      var cl = false;
      cl = false;
      ADictionary.Clear();
      this.FReader.ReadBeginArray();
      if (!this.FReader.HasNext()) {
        ADictionary.Clear()}
       else {
        while (this.FReader.HasNext()) {
          if (!this.FReader.IsNull()) {
            this.FReader.ReadBeginObject();
            pas.SysUtils.TryStrToInt(this.FReader.ReadName(),{get: function () {
                return k;
              }, set: function (v) {
                k = v;
              }});
            obj = this.FReader.ReadInteger();
            if (!cl) {
              ADictionary.Clear();
              cl = true;
            };
            ADictionary.Add(k,obj);
            this.FReader.ReadEndObject();
          } else this.FReader.SkipValue();
        };
      };
      this.FReader.ReadEndArray();
    };
    this.ReadGenericIntegerBooleanDictionary = function (ADictionary) {
      var obj = false;
      var k = 0;
      var cl = false;
      cl = false;
      ADictionary.Clear();
      this.FReader.ReadBeginArray();
      if (!this.FReader.HasNext()) {
        ADictionary.Clear()}
       else {
        while (this.FReader.HasNext()) {
          if (!this.FReader.IsNull()) {
            this.FReader.ReadBeginObject();
            pas.SysUtils.TryStrToInt(this.FReader.ReadName(),{get: function () {
                return k;
              }, set: function (v) {
                k = v;
              }});
            obj = this.FReader.ReadBoolean();
            if (!cl) {
              ADictionary.Clear();
              cl = true;
            };
            ADictionary.Add(k,obj);
            this.FReader.ReadEndObject();
          } else this.FReader.SkipValue();
        };
      };
      this.FReader.ReadEndArray();
    };
    this.ReadGenericIntegerDoubleDictionary = function (ADictionary) {
      var obj = 0.0;
      var k = 0;
      var cl = false;
      cl = false;
      ADictionary.Clear();
      this.FReader.ReadBeginArray();
      if (!this.FReader.HasNext()) {
        ADictionary.Clear()}
       else {
        while (this.FReader.HasNext()) {
          if (!this.FReader.IsNull()) {
            this.FReader.ReadBeginObject();
            pas.SysUtils.TryStrToInt(this.FReader.ReadName(),{get: function () {
                return k;
              }, set: function (v) {
                k = v;
              }});
            obj = this.FReader.ReadDouble();
            if (!cl) {
              ADictionary.Clear();
              cl = true;
            };
            ADictionary.Add(k,obj);
            this.FReader.ReadEndObject();
          } else this.FReader.SkipValue();
        };
      };
      this.FReader.ReadEndArray();
    };
    this.ReadCollection = function (ACollection) {
      var obj = null;
      var c = null;
      var i = null;
      var ii = null;
      var cl = false;
      try {
        if (pas.SysUtils.Supports$3(ACollection,$mod.ITMSFNCBaseListIO.$guid,{get: function () {
            return i;
          }, set: function (v) {
            i = v;
          }})) {
          c = i.GetItemClass()}
         else c = ACollection.FItemClass;
        pas.SysUtils.Supports$3(ACollection,$mod.ITMSFNCBaseCollectionIO.$guid,{get: function () {
            return ii;
          }, set: function (v) {
            ii = v;
          }});
        cl = false;
        this.FReader.ReadBeginArray();
        if (!this.FReader.HasNext()) {
          ACollection.Clear()}
         else {
          while (this.FReader.HasNext()) {
            if (!this.FReader.IsNull()) {
              obj = this.ReadSingleObject(c);
              if (obj != null) {
                if (!cl) {
                  ACollection.Clear();
                  cl = true;
                };
                try {
                  if (pas.Classes.TPersistent.isPrototypeOf(obj)) {
                    if (ii != null) {
                      ii.AddItem(obj).Assign(rtl.as(obj,pas.Classes.TPersistent))}
                     else ACollection.Add().Assign(rtl.as(obj,pas.Classes.TPersistent));
                  };
                } finally {
                  obj = rtl.freeLoc(obj);
                };
              };
            } else this.FReader.SkipValue();
          };
        };
        this.FReader.ReadEndArray();
      } finally {
        rtl._Release(i);
        rtl._Release(ii);
      };
    };
    this.ReadList = function (AList) {
      var obj = null;
      var b = null;
      var c = null;
      var i = null;
      var cl = false;
      try {
        c = pas.System.TObject;
        if (pas.SysUtils.Supports$3(AList,$mod.ITMSFNCBaseListIO.$guid,{get: function () {
            return i;
          }, set: function (v) {
            i = v;
          }})) c = i.GetItemClass();
        cl = false;
        this.FReader.ReadBeginArray();
        if (!this.FReader.HasNext()) {
          AList.Clear()}
         else {
          while (this.FReader.HasNext()) {
            if (!this.FReader.IsNull()) {
              obj = this.ReadSingleObject(c);
              if (obj != null) {
                if (!cl) {
                  AList.Clear();
                  cl = true;
                };
                if ((this.FIOReference != null) && pas.SysUtils.Supports$3(this.FIOReference,$mod.ITMSFNCPersistenceIO.$guid,{get: function () {
                    return b;
                  }, set: function (v) {
                    b = v;
                  }})) b.FixOwners(obj,AList);
                AList.Add(obj);
              };
            } else this.FReader.SkipValue();
          };
        };
        this.FReader.ReadEndArray();
      } finally {
        rtl._Release(i);
        rtl._Release(b);
      };
    };
    this.ReadBitmap = function (ABitmap) {
      var s = "";
      if (this.FReader.IsNull()) return;
      s = this.FReader.ReadString();
      if (s !== "") {
        ABitmap.SetData(s);
      };
    };
    this.ReadObject = function (AObject) {
      if (AObject === null) {
        this.FReader.ReadNull()}
       else {
        if ($mod.TTMSFNCPersistence.IsGenericList(AObject.$class.ClassType(),"String")) {
          this.ReadGenericStringList(AObject)}
         else if ($mod.TTMSFNCPersistence.IsGenericList(AObject.$class.ClassType(),"Double")) {
          this.ReadGenericDoubleList(AObject)}
         else if ($mod.TTMSFNCPersistence.IsGenericList(AObject.$class.ClassType(),"Integer")) {
          this.ReadGenericIntegerList(AObject)}
         else if ($mod.TTMSFNCPersistence.IsGenericList(AObject.$class.ClassType(),"")) {
          this.ReadGenericObjectList(AObject)}
         else if ($mod.TTMSFNCPersistence.IsGenericStringDictionary(AObject.$class.ClassType())) {
          if ($mod.TTMSFNCPersistence.IsGenericDictionaryValueTypeObject(AObject.$class.ClassType())) {
            this.ReadGenericStringObjectDictionary(AObject)}
           else this.FReader.ReadNull();
        } else if ($mod.TTMSFNCPersistence.IsGenericIntegerDictionary(AObject.$class.ClassType())) {
          if ($mod.TTMSFNCPersistence.IsGenericDictionaryValueTypeObject(AObject.$class.ClassType())) {
            this.ReadGenericIntegerObjectDictionary(AObject)}
           else if ($mod.TTMSFNCPersistence.IsGenericDictionaryValueTypeInteger(AObject.$class.ClassType())) {
            this.ReadGenericIntegerIntegerDictionary(AObject)}
           else if ($mod.TTMSFNCPersistence.IsGenericDictionaryValueTypeBoolean(AObject.$class.ClassType())) {
            this.ReadGenericIntegerBooleanDictionary(AObject)}
           else if ($mod.TTMSFNCPersistence.IsGenericDictionaryValueTypeDouble(AObject.$class.ClassType())) {
            this.ReadGenericIntegerDoubleDictionary(AObject)}
           else this.FReader.ReadNull();
        } else if ($mod.TTMSFNCPersistence.IsList(AObject.$class.ClassType())) {
          this.ReadList(AObject)}
         else if ($mod.TTMSFNCPersistence.IsCollection(AObject.$class.ClassType())) {
          this.ReadCollection(AObject)}
         else if ($mod.TTMSFNCPersistence.IsBitmap(AObject.$class.ClassType())) {
          this.ReadBitmap(AObject)}
         else if ($mod.TTMSFNCPersistence.IsDescendingClass(AObject.$class.ClassType(),["TStrings"])) {
          this.ReadStrings(AObject)}
         else this.ReadSingleObject$1(AObject);
      };
    };
    this.Create$1 = function (AStream) {
      this.FReader = pas["WEBLib.TMSFNCJSONReader"].TTMSFNCJSONReader.$create("Create$1",[AStream]);
      this.FReaderRef = false;
      this.FReferences = pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCObjectReference.$create("Create$4",[true]);
      return this;
    };
    this.Create$2 = function (AReader) {
      this.FReader = AReader;
      this.FReaderRef = true;
      this.FReferences = pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCObjectReference.$create("Create$4",[true]);
      return this;
    };
    this.Destroy = function () {
      if (this.FReaderRef) {
        this.FReader = null}
       else rtl.free(this,"FReader");
      rtl.free(this,"FReferences");
      pas.System.TObject.Destroy.call(this);
    };
    this.Read = function (AClass) {
      var Result = null;
      Result = this.ReadSingleObject(AClass);
      return Result;
    };
    this.Read$1 = function (AObject) {
      this.ReadObject(AObject);
    };
    this.ReadArray = function (AName) {
      var Result = [];
      var Name = "";
      this.FReader.ReadBeginObject();
      while (this.FReader.HasNext()) {
        if (!this.FReader.IsNull()) {
          Name = this.FReader.ReadName();
          if (Name === AName) {
            this.FReader.ReadBeginArray();
            while (this.FReader.HasNext()) {
              Result = rtl.arraySetLength(Result,null,rtl.length(Result) + 1);
              Result[rtl.length(Result) - 1] = this.ReadSingleObject(pas.System.TObject);
            };
            this.FReader.ReadEndArray();
          } else this.FReader.SkipValue();
        } else this.FReader.SkipValue();
      };
      return Result;
    };
    this.SolveReferences = function () {
      var b = null;
      var r = 0;
      var rf = null;
      var o = null;
      try {
        if ((this.FIOReference != null) && pas.SysUtils.Supports$3(this.FIOReference,$mod.ITMSFNCPersistenceIO.$guid,{get: function () {
            return b;
          }, set: function (v) {
            b = v;
          }})) {
          for (var $l = 0, $end = this.FReferences.FLength - 1; $l <= $end; $l++) {
            r = $l;
            rf = this.FReferences.GetItem(r);
            o = b.FindObject(rf.Id);
            pas.TypInfo.SetObjectProp$1(rf.Instance,rf.Prop,o);
          };
        };
      } finally {
        rtl._Release(b);
      };
    };
  });
  rtl.createClass(this,"TTMSFNCObjectPersistence",pas.System.TObject,function () {
    this.SaveObjectToString = function (AObject) {
      var Result = "";
      var ss = null;
      ss = pas.Classes.TStringStream.$create("Create$3",["",pas.SysUtils.TEncoding.GetUTF8(),true]);
      try {
        $mod.TTMSFNCPersistence.SaveSettingsToStream(AObject,ss);
        ss.SetPosition(0);
        Result = ss.GetDataString();
      } finally {
        ss = rtl.freeLoc(ss);
      };
      return Result;
    };
    this.LoadObjectFromString = function (AObject, AString) {
      var ms = null;
      ms = pas.Classes.TStringStream.$create("Create$3",[AString,pas.SysUtils.TEncoding.GetUTF8(),true]);
      try {
        $mod.TTMSFNCPersistence.LoadSettingsFromStream(AObject,ms);
      } finally {
        ms = rtl.freeLoc(ms);
      };
    };
  });
  rtl.createClass(this,"TTMSFNCPersistence",pas.System.TObject,function () {
    this.ClassTypeVariable = "";
    this.IgnoreExceptions = false;
    this.FOnCustomReadProperty = null;
    this.FOnCustomWriteProperty = null;
    this.FRootObject = null;
    this.FExcludeProperties = [];
    this.FIOReference = null;
    this.DoCustomReadProperty = function (AObject, APropertyName, APropertyKind, AReader, ACanRead) {
      rtl.rc(APropertyKind,0,20);
      if (this.FOnCustomReadProperty != null) this.FOnCustomReadProperty(AObject,APropertyName,APropertyKind,AReader,ACanRead);
    };
    this.DoCustomWriteProperty = function (AObject, APropertyName, APropertyKind, AWriter, ACanWrite) {
      rtl.rc(APropertyKind,0,20);
      if (this.FOnCustomWriteProperty != null) this.FOnCustomWriteProperty(AObject,APropertyName,APropertyKind,AWriter,ACanWrite);
    };
    this.SaveSettingsToFile = function (AObject, AFileName) {
      var ms = null;
      ms = pas.Classes.TMemoryStream.$create("Create");
      try {
        this.SaveSettingsToStream(AObject,ms);
        pas["WEBLib.TMSFNCTypes"].TTMSFNCMemoryStream.SaveToFile.call(ms,AFileName);
      } finally {
        ms = rtl.freeLoc(ms);
      };
    };
    this.LoadSettingsFromFile = function (AObject, AFileName) {
      var $Self = this;
      var ms = null;
      ms = pas.Classes.TMemoryStream.$create("Create");
      try {
        ms.LoadFromFile(AFileName,function () {
          $Self.LoadSettingsFromStream(AObject,ms);
          ms = rtl.freeLoc(ms);
        },null);
      } finally {
      };
    };
    this.SaveSettingsToStream = function (AObject, AStream) {
      var Writer = null;
      Writer = $mod.TTMSFNCWriter.$create("Create$1",[AStream]);
      try {
        Writer.SetIOReference($mod.TTMSFNCPersistence.FIOReference);
        Writer.SetRootObject($mod.TTMSFNCPersistence.FRootObject);
        Writer.FOnCustomWriteProperty = rtl.createCallback(this,"DoCustomWriteProperty");
        Writer.Write(AObject);
      } finally {
        Writer = rtl.freeLoc(Writer);
      };
    };
    this.LoadSettingsFromStream = function (AObject, AStream) {
      var Reader = null;
      AStream.SetPosition(0);
      Reader = $mod.TTMSFNCReader.$create("Create$1",[AStream]);
      try {
        Reader.SetIOReference($mod.TTMSFNCPersistence.FIOReference);
        Reader.SetRootObject($mod.TTMSFNCPersistence.FRootObject);
        Reader.FOnCustomReadProperty = rtl.createCallback(this,"DoCustomReadProperty");
        Reader.Read$1(AObject);
      } finally {
        Reader = rtl.freeLoc(Reader);
      };
    };
    this.GetEnumValues = function (AValues, APropInfo) {
      var p = null;
      var pi = null;
      var ps = null;
      var I = 0;
      var k = 0;
      p = $impl.GetTypeInfoEx(APropInfo);
      if ((p != null) && rtl.isExt(p,rtl.tTypeInfoSet)) p = p.comptype;
      if ((p != null) && rtl.isExt(p,rtl.tTypeInfoInteger)) {
        pi = p;
        for (var $l = pi.minvalue, $end = pi.maxvalue; $l <= $end; $l++) {
          I = $l;
          AValues.Add($mod.TTMSFNCPersistence.GetEnumName(p,I));
        };
      };
    };
    this.CreateObject = function (AClassName, BaseClass) {
      var Result = null;
      var ObjType = null;
      ObjType = pas.Classes.GetClass(AClassName);
      if (ObjType === null) {
        if ($mod.TTMSFNCPersistence.IgnoreExceptions) {
          Result = null;
          return Result;
        } else throw $mod.ETMSFNCReaderException.$create("CreateFmt",['Type "%s" not found',pas.System.VarRecs(18,AClassName)]);
      };
      if (!$mod.TTMSFNCPersistence.IgnoreExceptions) {
        if (!ObjType.InheritsFrom(pas.System.TObject)) throw $mod.ETMSFNCReaderException.$create("Create$1",['Type "%s" is not an class type']);
        if (BaseClass !== null) if (!ObjType.InheritsFrom(BaseClass)) throw $mod.ETMSFNCReaderException.$create("CreateFmt",['Type "%s" does not inherit from %s',pas.System.VarRecs(18,AClassName,18,BaseClass.$classname)]);
      };
      if (ObjType.InheritsFrom(pas["WEBLib.Controls"].TCustomControl)) {
        Result = ObjType.$create("Create$1",[null])}
       else if (ObjType.InheritsFrom(pas.Classes.TCollectionItem)) {
        Result = ObjType.$create("Create$1",[null])}
       else if (ObjType.InheritsFrom(pas.Classes.TPersistent)) {
        Result = ObjType.$create("Create")}
       else throw $mod.ETMSFNCReaderException.$create("CreateFmt",['Type "%s" not supported',pas.System.VarRecs(18,AClassName)]);
      return Result;
    };
    this.GetPropInfoDataTypeInfo = function (APropInfo) {
      var Result = null;
      Result = null;
      if (APropInfo != null) Result = APropInfo.typeinfo;
      return Result;
    };
    this.GetPropInfoDataTypeInfoClassType = function (APropInfo) {
      var Result = null;
      var t = null;
      Result = null;
      if ((APropInfo != null) && (APropInfo.typeinfo != null)) {
        t = APropInfo.typeinfo;
        if (t.class){
          return t.class.ClassType();
        };
      };
      return Result;
    };
    this.GetPropInfoType = function (APropInfo) {
      var Result = 0;
      if (APropInfo.typeinfo != null) {
        Result = rtl.rc(APropInfo.typeinfo.kind,0,20)}
       else Result = rtl.rc(pas.System.TTypeKind.tkUnknown,0,20);
      return Result;
    };
    this.GetPropInfoName = function (APropInfo) {
      var Result = "";
      Result = APropInfo.name;
      return Result;
    };
    this.GetPropInfoTypeName = function (APropInfo) {
      var Result = "";
      Result = "";
      if (APropInfo.typeinfo != null) Result = APropInfo.typeinfo.name;
      return Result;
    };
    this.GetEnumName = function (ATypeInfo, AValue) {
      rtl.rc(AValue,-2147483648,2147483647);
      var Result = "";
      Result = ATypeInfo.enumtype[AValue];
      return Result;
    };
    this.IsWriteOnly = function (APropInfo) {
      var Result = false;
      Result = APropInfo.getter === "";
      return Result;
    };
    this.IsReadOnly = function (APropInfo) {
      var Result = false;
      Result = APropInfo.setter === "";
      return Result;
    };
    this.IsAssignableProperty = function (AObject, APropInfo) {
      var Result = false;
      var oProp = null;
      var k = 0;
      var pName = "";
      Result = false;
      k = rtl.rc(this.GetPropInfoType(APropInfo),0,20);
      if (k in rtl.createSet(pas.System.TTypeKind.tkClass)) {
        pName = this.GetPropInfoName(APropInfo);
        oProp = pas.TypInfo.GetObjectProp(AObject,pName);
        Result = ((oProp != null) && this.IsComponent(oProp.$class.ClassType())) || !(oProp != null);
      };
      return Result;
    };
    this.IsColor = function (APropertyName) {
      var Result = false;
      Result = (APropertyName === "TAlphaColor") || (APropertyName === "TColor") || (APropertyName === "TGraphicsColor");
      return Result;
    };
    this.IsStrokeKind = function (APropertyName) {
      var Result = false;
      Result = APropertyName === "TTMSFNCGraphicsStrokeKind";
      return Result;
    };
    this.IsFillKind = function (APropertyName) {
      var Result = false;
      Result = APropertyName === "TTMSFNCGraphicsFillKind";
      return Result;
    };
    this.IsDate = function (APropertyName) {
      var Result = false;
      Result = APropertyName === "TDate";
      return Result;
    };
    this.IsDateTime = function (APropertyName) {
      var Result = false;
      Result = APropertyName === "TDateTime";
      return Result;
    };
    this.IsTime = function (APropertyName) {
      var Result = false;
      Result = APropertyName === "TTime";
      return Result;
    };
    this.GetGenericListType = function (AClass) {
      var Result = null;
      var cn = "";
      var po = 0;
      var pc = 0;
      var fn = "";
      var sl = null;
      var c = 0;
      var I = 0;
      var p = null;
      if (!(AClass != null)) return pas.System.TObject;
      do {
        cn = AClass.$classname;
        if (pas.StrUtils.AnsiStartsStr("TList<",cn) || pas.StrUtils.AnsiStartsStr("TObjectList<",cn)) {
          po = rtl.rc(pas.System.Pos("<",cn),-2147483648,2147483647);
          pc = rtl.rc(pas.System.Pos(">",cn),-2147483648,2147483647);
          if ((po > 0) && (pc > 0)) {
            fn = pas.System.Copy(cn,po + 1,pc - po - 1);
            sl = pas.Classes.TStringList.$create("Create$1");
            try {
              sl.SetDelimiter(".");
              sl.SetDelimitedText(fn);
              while (sl.GetCount() > 0) {
                fn = sl.GetDelimitedText();
                p = pas.Classes.GetClass(fn);
                if (p != null) return p;
                sl.Delete(0);
              };
            } finally {
              sl = rtl.freeLoc(sl);
            };
          };
        };
        AClass = AClass.$ancestor;
      } while (AClass != null);
      Result = pas.System.TObject;
      return Result;
    };
    this.GetGenericDictionaryValueType = function (AClass) {
      var Result = null;
      var cn = "";
      var po = 0;
      var pc = 0;
      var poc = 0;
      var fn = "";
      var sl = null;
      var c = 0;
      var I = 0;
      var p = null;
      if (!(AClass != null)) return pas.System.TObject;
      do {
        cn = AClass.$classname;
        if (pas.StrUtils.AnsiStartsStr("TDictionary<",cn) || pas.StrUtils.AnsiStartsStr("TObjectDictionary<",cn)) {
          po = rtl.rc(pas.System.Pos("<",cn),-2147483648,2147483647);
          pc = rtl.rc(pas.System.Pos(">",cn),-2147483648,2147483647);
          if ((po > 0) && (pc > 0)) {
            fn = pas.System.Copy(cn,po + 1,pc - po - 1);
            poc = rtl.rc(pas.System.Pos(",",fn),-2147483648,2147483647);
            if (poc > 0) {
              fn = pas.System.Copy(fn,poc + 1,fn.length - poc);
              sl = pas.Classes.TStringList.$create("Create$1");
              try {
                sl.SetDelimiter(".");
                sl.SetDelimitedText(fn);
                while (sl.GetCount() > 0) {
                  fn = sl.GetDelimitedText();
                  p = pas.Classes.GetClass(fn);
                  if (p != null) return p;
                  sl.Delete(0);
                };
              } finally {
                sl = rtl.freeLoc(sl);
              };
            };
          };
        };
        AClass = AClass.$ancestor;
      } while (AClass != null);
      Result = pas.System.TObject;
      return Result;
    };
    this.IsGenericDictionaryValueTypeObject = function (AClass) {
      var Result = false;
      var cn = "";
      var po = 0;
      var pc = 0;
      var poc = 0;
      var fn = "";
      var sl = null;
      var c = 0;
      var I = 0;
      var p = null;
      if (!(AClass != null)) return false;
      do {
        cn = AClass.$classname;
        if (pas.StrUtils.AnsiStartsStr("TDictionary<",cn) || pas.StrUtils.AnsiStartsStr("TObjectDictionary<",cn)) {
          po = rtl.rc(pas.System.Pos("<",cn),-2147483648,2147483647);
          pc = rtl.rc(pas.System.Pos(">",cn),-2147483648,2147483647);
          if ((po > 0) && (pc > 0)) {
            fn = pas.System.Copy(cn,po + 1,pc - po - 1);
            poc = rtl.rc(pas.System.Pos(",",fn),-2147483648,2147483647);
            if (poc > 0) {
              fn = pas.System.Copy(fn,poc + 1,fn.length - poc);
              sl = pas.Classes.TStringList.$create("Create$1");
              try {
                sl.SetDelimiter(".");
                sl.SetDelimitedText(fn);
                while (sl.GetCount() > 0) {
                  fn = sl.GetDelimitedText();
                  p = pas.Classes.GetClass(fn);
                  if (p != null) return true;
                  sl.Delete(0);
                };
              } finally {
                sl = rtl.freeLoc(sl);
              };
            };
          };
        };
        AClass = AClass.$ancestor;
      } while (AClass != null);
      Result = false;
      return Result;
    };
    this.IsGenericDictionaryValueTypeInteger = function (AClass) {
      var Result = false;
      var cn = "";
      var po = 0;
      var pc = 0;
      var poc = 0;
      var fn = "";
      var sl = null;
      var c = 0;
      var I = 0;
      if (!(AClass != null)) return false;
      do {
        cn = AClass.$classname;
        if (pas.StrUtils.AnsiStartsStr("TDictionary<",cn) || pas.StrUtils.AnsiStartsStr("TObjectDictionary<",cn)) {
          po = rtl.rc(pas.System.Pos("<",cn),-2147483648,2147483647);
          pc = rtl.rc(pas.System.Pos(">",cn),-2147483648,2147483647);
          if ((po > 0) && (pc > 0)) {
            fn = pas.System.Copy(cn,po + 1,pc - po - 1);
            poc = rtl.rc(pas.System.Pos(",",fn),-2147483648,2147483647);
            if (poc > 0) {
              fn = pas.System.Copy(fn,poc + 1,fn.length - poc);
              sl = pas.Classes.TStringList.$create("Create$1");
              try {
                sl.SetDelimiter(".");
                sl.SetDelimitedText(fn);
                while (sl.GetCount() > 0) {
                  fn = sl.GetDelimitedText();
                  if ((pas.SysUtils.UpperCase(fn) === "INTEGER") || (pas.SysUtils.UpperCase(fn) === "SYSTEM.INTEGER") || (pas.SysUtils.UpperCase(fn) === "LONGINT") || (pas.SysUtils.UpperCase(fn) === "SYSTEM.LONGINT")) return true;
                  sl.Delete(0);
                };
              } finally {
                sl = rtl.freeLoc(sl);
              };
            };
          };
        };
        AClass = AClass.$ancestor;
      } while (AClass != null);
      Result = false;
      return Result;
    };
    this.IsGenericDictionaryValueTypeBoolean = function (AClass) {
      var Result = false;
      var cn = "";
      var po = 0;
      var pc = 0;
      var poc = 0;
      var fn = "";
      var sl = null;
      var c = 0;
      var I = 0;
      if (!(AClass != null)) return false;
      do {
        cn = AClass.$classname;
        if (pas.StrUtils.AnsiStartsStr("TDictionary<",cn) || pas.StrUtils.AnsiStartsStr("TObjectDictionary<",cn)) {
          po = rtl.rc(pas.System.Pos("<",cn),-2147483648,2147483647);
          pc = rtl.rc(pas.System.Pos(">",cn),-2147483648,2147483647);
          if ((po > 0) && (pc > 0)) {
            fn = pas.System.Copy(cn,po + 1,pc - po - 1);
            poc = rtl.rc(pas.System.Pos(",",fn),-2147483648,2147483647);
            if (poc > 0) {
              fn = pas.System.Copy(fn,poc + 1,fn.length - poc);
              sl = pas.Classes.TStringList.$create("Create$1");
              try {
                sl.SetDelimiter(".");
                sl.SetDelimitedText(fn);
                while (sl.GetCount() > 0) {
                  fn = sl.GetDelimitedText();
                  if ((pas.SysUtils.UpperCase(fn) === "BOOLEAN") || (pas.SysUtils.UpperCase(fn) === "SYSTEM.BOOLEAN")) return true;
                  sl.Delete(0);
                };
              } finally {
                sl = rtl.freeLoc(sl);
              };
            };
          };
        };
        AClass = AClass.$ancestor;
      } while (AClass != null);
      Result = false;
      return Result;
    };
    this.IsGenericDictionaryValueTypeDouble = function (AClass) {
      var Result = false;
      var cn = "";
      var po = 0;
      var pc = 0;
      var poc = 0;
      var fn = "";
      var sl = null;
      var c = 0;
      var I = 0;
      if (!(AClass != null)) return false;
      do {
        cn = AClass.$classname;
        if (pas.StrUtils.AnsiStartsStr("TDictionary<",cn) || pas.StrUtils.AnsiStartsStr("TObjectDictionary<",cn)) {
          po = rtl.rc(pas.System.Pos("<",cn),-2147483648,2147483647);
          pc = rtl.rc(pas.System.Pos(">",cn),-2147483648,2147483647);
          if ((po > 0) && (pc > 0)) {
            fn = pas.System.Copy(cn,po + 1,pc - po - 1);
            poc = rtl.rc(pas.System.Pos(",",fn),-2147483648,2147483647);
            if (poc > 0) {
              fn = pas.System.Copy(fn,poc + 1,fn.length - poc);
              sl = pas.Classes.TStringList.$create("Create$1");
              try {
                sl.SetDelimiter(".");
                sl.SetDelimitedText(fn);
                while (sl.GetCount() > 0) {
                  fn = sl.GetDelimitedText();
                  if ((pas.SysUtils.UpperCase(fn) === "DOUBLE") || (pas.SysUtils.UpperCase(fn) === "SYSTEM.DOUBLE")) return true;
                  sl.Delete(0);
                };
              } finally {
                sl = rtl.freeLoc(sl);
              };
            };
          };
        };
        AClass = AClass.$ancestor;
      } while (AClass != null);
      Result = false;
      return Result;
    };
    this.IsGenericList = function (AClass, AType) {
      var Result = false;
      var cn = "";
      if (!(AClass != null)) return false;
      do {
        cn = AClass.$classname;
        if (pas.StrUtils.AnsiStartsStr("TList<",cn) || pas.StrUtils.AnsiStartsStr("TObjectList<",cn)) {
          if ((AType === "") || ((AType !== "") && (pas.System.Pos(pas.SysUtils.LowerCase(AType),pas.SysUtils.LowerCase(cn)) > 0)) || (pas.System.Pos(pas.SysUtils.LowerCase(AType),pas.SysUtils.LowerCase(cn)) > 0)) return true;
        };
        AClass = AClass.$ancestor;
      } while (AClass != null);
      Result = false;
      return Result;
    };
    this.IsGenericDictionary = function (AClass) {
      var Result = false;
      var cn = "";
      if (!(AClass != null)) return false;
      do {
        cn = AClass.$classname;
        if (pas.StrUtils.AnsiStartsStr("TDictionary<",cn) || pas.StrUtils.AnsiStartsStr("TObjectDictionary<",cn)) return true;
        AClass = AClass.$ancestor;
      } while (AClass != null);
      Result = false;
      return Result;
    };
    this.IsGenericStringDictionary = function (AClass) {
      var Result = false;
      var cn = "";
      if (!(AClass != null)) return false;
      do {
        cn = AClass.$classname;
        if (pas.StrUtils.AnsiStartsStr("TDictionary<string",cn) || pas.StrUtils.AnsiStartsStr("TObjectDictionary<string",cn) || pas.StrUtils.AnsiStartsStr("TDictionary<System.string",cn) || pas.StrUtils.AnsiStartsStr("TObjectDictionary<System.string",cn)) return true;
        AClass = AClass.$ancestor;
      } while (AClass != null);
      Result = false;
      return Result;
    };
    this.IsGenericIntegerDictionary = function (AClass) {
      var Result = false;
      var cn = "";
      if (!(AClass != null)) return false;
      do {
        cn = AClass.$classname;
        if (pas.StrUtils.AnsiStartsStr("TDictionary<Integer",cn) || pas.StrUtils.AnsiStartsStr("TObjectDictionary<Integer",cn) || pas.StrUtils.AnsiStartsStr("TDictionary<System.Integer",cn) || pas.StrUtils.AnsiStartsStr("TObjectDictionary<System.Integer",cn) || pas.StrUtils.AnsiStartsStr("TDictionary<System.Longint",cn) || pas.StrUtils.AnsiStartsStr("TObjectDictionary<System.Longint",cn)) return true;
        AClass = AClass.$ancestor;
      } while (AClass != null);
      Result = false;
      return Result;
    };
    this.IsCollection = function (AClass) {
      var Result = false;
      Result = this.IsDescendingClass(AClass,["TCollection"]);
      return Result;
    };
    this.IsComponent = function (AClass) {
      var Result = false;
      Result = this.IsDescendingClass(AClass,["TComponent","TTMSFNCCustomComponent"]);
      return Result;
    };
    this.IsControl = function (AClass) {
      var Result = false;
      Result = this.IsDescendingClass(AClass,["TControl"]);
      return Result;
    };
    this.IsList = function (AClass) {
      var Result = false;
      Result = this.IsDescendingClass(AClass,["TList"]);
      return Result;
    };
    this.IsDescendingClass = function (AClass, AClassParentList) {
      var Result = false;
      var cn = "";
      var I = 0;
      if (!(AClass != null)) return false;
      do {
        cn = AClass.$classname;
        for (var $l = 0, $end = rtl.length(AClassParentList) - 1; $l <= $end; $l++) {
          I = $l;
          if (cn === rtl.rcArrR(AClassParentList,I)) return true;
        };
        AClass = AClass.$ancestor;
      } while (AClass != null);
      Result = false;
      return Result;
    };
    this.IsBitmap = function (AClass) {
      var Result = false;
      Result = this.IsDescendingClass(AClass,["TBitmap","TPicture","TTMSFNCBitmap","TGraphic"]);
      return Result;
    };
    this.IsStrings = function (AClass) {
      var Result = false;
      Result = this.IsDescendingClass(AClass,["TStrings"]);
      return Result;
    };
  });
  this.TTMSFNCJSONToClassPropertyType = {"0": "cptUndefined", cptUndefined: 0, "1": "cptString", cptString: 1, "2": "cptBoolean", cptBoolean: 2, "3": "cptDateTime", cptDateTime: 3, "4": "cptObject", cptObject: 4, "5": "cptDouble", cptDouble: 5, "6": "cptInteger", cptInteger: 6, "7": "cptInteger64", cptInteger64: 7, "8": "cptObjectArray", cptObjectArray: 8, "9": "cptStringArray", cptStringArray: 9, "10": "cptBooleanArray", cptBooleanArray: 10, "11": "cptDateTimeArray", cptDateTimeArray: 11, "12": "cptDoubleArray", cptDoubleArray: 12, "13": "cptIntegerArray", cptIntegerArray: 13, "14": "cptInteger64Array", cptInteger64Array: 14};
  this.$rtti.$Enum("TTMSFNCJSONToClassPropertyType",{minvalue: 0, maxvalue: 14, ordtype: 1, enumtype: this.TTMSFNCJSONToClassPropertyType});
  this.TTMSFNCJSONToClassBaseClass = {"0": "cbcNone", cbcNone: 0, "1": "cbcPersistent", cbcPersistent: 1};
  this.$rtti.$Enum("TTMSFNCJSONToClassBaseClass",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCJSONToClassBaseClass});
  rtl.recNewT(this,"TTMSFNCJSONToClassOptions",function () {
    this.SortProperties = false;
    this.DelphiCasing = false;
    this.RemoveSpecialCharacters = false;
    this.AddConstructor = false;
    this.AddDestructor = false;
    this.AddAssign = false;
    this.AddUnit = false;
    this.BaseClass = 0;
    this.AddImplementation = false;
    this.$eq = function (b) {
      return (this.SortProperties === b.SortProperties) && (this.DelphiCasing === b.DelphiCasing) && (this.RemoveSpecialCharacters === b.RemoveSpecialCharacters) && (this.AddConstructor === b.AddConstructor) && (this.AddDestructor === b.AddDestructor) && (this.AddAssign === b.AddAssign) && (this.AddUnit === b.AddUnit) && (this.BaseClass === b.BaseClass) && (this.AddImplementation === b.AddImplementation);
    };
    this.$assign = function (s) {
      this.SortProperties = s.SortProperties;
      this.DelphiCasing = s.DelphiCasing;
      this.RemoveSpecialCharacters = s.RemoveSpecialCharacters;
      this.AddConstructor = s.AddConstructor;
      this.AddDestructor = s.AddDestructor;
      this.AddAssign = s.AddAssign;
      this.AddUnit = s.AddUnit;
      this.BaseClass = s.BaseClass;
      this.AddImplementation = s.AddImplementation;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCJSONToClassOptions",{},this);
    $r.addField("SortProperties",rtl.boolean);
    $r.addField("DelphiCasing",rtl.boolean);
    $r.addField("RemoveSpecialCharacters",rtl.boolean);
    $r.addField("AddConstructor",rtl.boolean);
    $r.addField("AddDestructor",rtl.boolean);
    $r.addField("AddAssign",rtl.boolean);
    $r.addField("AddUnit",rtl.boolean);
    $r.addField("BaseClass",$mod.$rtti["TTMSFNCJSONToClassBaseClass"]);
    $r.addField("AddImplementation",rtl.boolean);
  });
  this.$rtti.$RefToProcVar("TTMSFNCJSONToClassExportEvent",{procsig: rtl.newTIProcSig([["APropertyName",rtl.string,1],["APropertyType",this.$rtti["TTMSFNCJSONToClassPropertyType"],1]])});
  rtl.createClass(this,"TTMSFNCJSONToClassProperty",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FName = "";
      this.FType = 0;
    };
    var a = ["and","array","as","asm","begin","case","class","const","constructor","destructor","dispinterface","div","do","downto","else","end","except","exports","file","finalization","finally","for","function","goto","if","implementation","in","inherited","initialization","inline","interface","is","label","library","mod","nil","not","object","of","or","out","packed","procedure","program","property","raise","record","repeat","resourcestring","set","shl","shr","string","then","threadvar","to","try","type","unit","until","uses","var","while","with","xor"];
    this.FixKeyWord = function (AValue) {
      var Result = "";
      Result = AValue;
      if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.IndexOfTextInArray(pas.SysUtils.UpperCase(AValue),a) !== -1) Result = "&" + AValue;
      return Result;
    };
    this.IsObject = function () {
      var Result = false;
      Result = this.FType in rtl.createSet($mod.TTMSFNCJSONToClassPropertyType.cptObject,$mod.TTMSFNCJSONToClassPropertyType.cptObjectArray,$mod.TTMSFNCJSONToClassPropertyType.cptStringArray,$mod.TTMSFNCJSONToClassPropertyType.cptBooleanArray,$mod.TTMSFNCJSONToClassPropertyType.cptDateTimeArray,$mod.TTMSFNCJSONToClassPropertyType.cptDoubleArray,$mod.TTMSFNCJSONToClassPropertyType.cptIntegerArray,$mod.TTMSFNCJSONToClassPropertyType.cptInteger64Array);
      return Result;
    };
    this.DelphiName = function (ACallBack, AOptions, AFixKeyWord) {
      var Result = "";
      var n = "";
      var s = "";
      var c = "\x00";
      var sl = null;
      var I = 0;
      var p = "";
      var pt = 0;
      Result = "";
      if (this.FName.length > 0) {
        p = this.FName;
        pt = rtl.rc(this.FType,0,14);
        if (ACallBack != null) ACallBack({get: function () {
            return p;
          }, set: function (v) {
            p = v;
          }},{get: function () {
            return pt;
          }, set: function (v) {
            rtl.rc(v,0,14);
            pt = v;
          }});
        sl = pas.Classes.TStringList.$create("Create$1");
        try {
          if (AOptions.RemoveSpecialCharacters) {
            s = p;
            p = "";
            for (var $in = s, $l = 0, $end = $in.length - 1; $l <= $end; $l++) {
              c = $in.charAt($l);
              if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.IsLetterOrDigit(c)) {
                p = p + c}
               else p = p + "_";
            };
          };
          pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.Split("_",p,sl,false);
          for (var $l1 = 0, $end1 = sl.GetCount() - 1; $l1 <= $end1; $l1++) {
            I = $l1;
            n = sl.Get(I);
            if (n.length > 0) {
              if (AOptions.DelphiCasing) n = pas.SysUtils.UpperCase(rtl.rcCharAt(n,0)) + pas.System.Copy(n,2,n.length - 1);
            };
            Result = Result + n;
          };
          if (AFixKeyWord) Result = this.FixKeyWord(Result);
        } finally {
          sl = rtl.freeLoc(sl);
        };
      };
      return Result;
    };
    this.DelphiType = function (ACallBack, AOptions) {
      var Result = "";
      var n = "";
      var t = 0;
      Result = "";
      n = this.FName;
      t = rtl.rc(this.FType,0,14);
      if (ACallBack != null) ACallBack({get: function () {
          return n;
        }, set: function (v) {
          n = v;
        }},{get: function () {
          return t;
        }, set: function (v) {
          rtl.rc(v,0,14);
          t = v;
        }});
      var $tmp = t;
      if ($tmp === $mod.TTMSFNCJSONToClassPropertyType.cptUndefined) {
        Result = "UNDEFINED"}
       else if ($tmp === $mod.TTMSFNCJSONToClassPropertyType.cptString) {
        Result = "string"}
       else if ($tmp === $mod.TTMSFNCJSONToClassPropertyType.cptBoolean) {
        Result = "Boolean"}
       else if ($tmp === $mod.TTMSFNCJSONToClassPropertyType.cptDateTime) {
        Result = "TDateTime"}
       else if ($tmp === $mod.TTMSFNCJSONToClassPropertyType.cptObject) {
        Result = "T" + this.DelphiName(ACallBack,$mod.TTMSFNCJSONToClassOptions.$clone(AOptions),false)}
       else if ($tmp === $mod.TTMSFNCJSONToClassPropertyType.cptDouble) {
        Result = "Double"}
       else if ($tmp === $mod.TTMSFNCJSONToClassPropertyType.cptInteger) {
        Result = "Integer"}
       else if ($tmp === $mod.TTMSFNCJSONToClassPropertyType.cptInteger64) {
        Result = "Int64"}
       else if ($tmp === $mod.TTMSFNCJSONToClassPropertyType.cptObjectArray) {
        Result = "TObjectList<" + "T" + this.DelphiName(ACallBack,$mod.TTMSFNCJSONToClassOptions.$clone(AOptions),false) + ">"}
       else if ($tmp === $mod.TTMSFNCJSONToClassPropertyType.cptDoubleArray) {
        Result = "TList<Double>"}
       else if ($tmp === $mod.TTMSFNCJSONToClassPropertyType.cptStringArray) {
        Result = "TList<string>"}
       else if ($tmp === $mod.TTMSFNCJSONToClassPropertyType.cptBooleanArray) {
        Result = "TList<Boolean>"}
       else if ($tmp === $mod.TTMSFNCJSONToClassPropertyType.cptDateTimeArray) {
        Result = "TList<TDateTime>"}
       else if ($tmp === $mod.TTMSFNCJSONToClassPropertyType.cptIntegerArray) {
        Result = "TList<Integer>"}
       else if ($tmp === $mod.TTMSFNCJSONToClassPropertyType.cptInteger64Array) Result = "TList<Int64>";
      return Result;
    };
    this.Create$1 = function (AName, AType) {
      rtl.rc(AType,0,14);
      this.FName = AName;
      this.FType = rtl.rc(AType,0,14);
      return this;
    };
  });
  rtl.createClass(this,"TTMSFNCJSONToClassProperties",pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCJSONToClassProperty,function () {
  });
  rtl.createClass(this,"TTMSFNCJSONToClassItem",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FProperties = null;
      this.FParentProperty = null;
    };
    this.$final = function () {
      this.FProperties = undefined;
      this.FParentProperty = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.GetProperties = function () {
      var Result = null;
      if (!(this.FProperties != null)) this.FProperties = $mod.TTMSFNCJSONToClassProperties.$create("Create$4",[true]);
      Result = this.FProperties;
      return Result;
    };
    this.GetClassName = function (ACallBack, AOptions) {
      var Result = "";
      Result = "TMyDelphiClass";
      if (this.FParentProperty != null) Result = "T" + this.FParentProperty.DelphiName(ACallBack,$mod.TTMSFNCJSONToClassOptions.$clone(AOptions),false);
      return Result;
    };
    this.Create$1 = function (AParentProperty) {
      this.FParentProperty = AParentProperty;
      return this;
    };
    this.Destroy = function () {
      if (this.FProperties != null) rtl.free(this,"FProperties");
      pas.System.TObject.Destroy.call(this);
    };
  });
  rtl.createClass(this,"TTMSFNCJSONToClassItems",pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCJSONToClassItem,function () {
  });
  rtl.createClass(this,"TTMSFNCJSONToClass",pas.System.TObject,function () {
    this.FClasses = null;
    this.JSONValueToClass = function (AParentProperty, AJSONValue) {
      var v = null;
      var n = "";
      var p = null;
      var sz = 0;
      var K = 0;
      var t = 0;
      var ci = null;
      if (pas["WEBLib.JSON"].TJSONObject.isPrototypeOf(AJSONValue)) {
        ci = $mod.TTMSFNCJSONToClassItem.$create("Create$1",[AParentProperty]);
        this.FClasses.Add(ci);
        sz = rtl.rc(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONObjectSize(rtl.as(AJSONValue,pas["WEBLib.JSON"].TJSONObject)),-2147483648,2147483647);
        for (var $l = 0, $end = sz - 1; $l <= $end; $l++) {
          K = $l;
          n = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONObjectName(rtl.as(AJSONValue,pas["WEBLib.JSON"].TJSONObject),K);
          v = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONValue(AJSONValue,n);
          p = null;
          if (v != null) {
            t = rtl.rc(this.JSONValueToPropertyType(v),0,14);
            if (t !== $mod.TTMSFNCJSONToClassPropertyType.cptUndefined) {
              p = $mod.TTMSFNCJSONToClassProperty.$create("Create$1",[n,t]);
              ci.GetProperties().Add(p);
            };
          };
          this.JSONValueToClass(p,v);
        };
      } else if (pas["WEBLib.JSON"].TJSONArray.isPrototypeOf(AJSONValue)) {
        if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONArraySize(rtl.as(AJSONValue,pas["WEBLib.JSON"].TJSONArray)) > 0) {
          t = rtl.rc(this.JSONValueToPropertyType(AJSONValue),0,14);
          v = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONArrayItem(rtl.as(AJSONValue,pas["WEBLib.JSON"].TJSONArray),0);
          if (!(AParentProperty != null) && (t !== $mod.TTMSFNCJSONToClassPropertyType.cptUndefined)) {
            ci = $mod.TTMSFNCJSONToClassItem.$create("Create$1",[null]);
            p = $mod.TTMSFNCJSONToClassProperty.$create("Create$1",["Items",t]);
            ci.GetProperties().Add(p);
            this.FClasses.Add(ci);
            AParentProperty = p;
          };
          this.JSONValueToClass(AParentProperty,v);
        } else {
          ci = $mod.TTMSFNCJSONToClassItem.$create("Create$1",[AParentProperty]);
          this.FClasses.Add(ci);
        };
      };
    };
    this.JSONValueToPropertyType = function (AJSONValue) {
      var Result = 0;
      var s = "";
      var dt = 0.0;
      var b = false;
      var v = null;
      var p = 0;
      var d = 0.0;
      var i = 0;
      var i64 = 0;
      Result = rtl.rc($mod.TTMSFNCJSONToClassPropertyType.cptUndefined,0,14);
      if (!(AJSONValue != null)) return Result;
      if (pas["WEBLib.JSON"].TJSONObject.isPrototypeOf(AJSONValue)) {
        Result = rtl.rc($mod.TTMSFNCJSONToClassPropertyType.cptObject,0,14)}
       else if (pas["WEBLib.JSON"].TJSONArray.isPrototypeOf(AJSONValue)) {
        Result = rtl.rc($mod.TTMSFNCJSONToClassPropertyType.cptObjectArray,0,14);
        if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONArraySize(rtl.as(AJSONValue,pas["WEBLib.JSON"].TJSONArray)) > 0) {
          v = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONArrayItem(rtl.as(AJSONValue,pas["WEBLib.JSON"].TJSONArray),0);
          if (v != null) {
            p = rtl.rc(this.JSONValueToPropertyType(v),0,14);
            var $tmp = p;
            if ($tmp === $mod.TTMSFNCJSONToClassPropertyType.cptString) {
              Result = rtl.rc($mod.TTMSFNCJSONToClassPropertyType.cptStringArray,0,14)}
             else if ($tmp === $mod.TTMSFNCJSONToClassPropertyType.cptBoolean) {
              Result = rtl.rc($mod.TTMSFNCJSONToClassPropertyType.cptBooleanArray,0,14)}
             else if ($tmp === $mod.TTMSFNCJSONToClassPropertyType.cptDateTime) {
              Result = rtl.rc($mod.TTMSFNCJSONToClassPropertyType.cptDateTimeArray,0,14)}
             else if ($tmp === $mod.TTMSFNCJSONToClassPropertyType.cptObject) {
              Result = rtl.rc($mod.TTMSFNCJSONToClassPropertyType.cptObjectArray,0,14)}
             else if ($tmp === $mod.TTMSFNCJSONToClassPropertyType.cptDouble) {
              Result = rtl.rc($mod.TTMSFNCJSONToClassPropertyType.cptDoubleArray,0,14)}
             else if ($tmp === $mod.TTMSFNCJSONToClassPropertyType.cptInteger) {
              Result = rtl.rc($mod.TTMSFNCJSONToClassPropertyType.cptIntegerArray,0,14)}
             else if ($tmp === $mod.TTMSFNCJSONToClassPropertyType.cptInteger64) Result = rtl.rc($mod.TTMSFNCJSONToClassPropertyType.cptInteger64Array,0,14);
          };
        };
      } else if (pas["WEBLib.JSON"].TJSONNumber.isPrototypeOf(AJSONValue)) {
        s = AJSONValue.GetStrValue();
        if (pas.SysUtils.TryStrToInt(s,{get: function () {
            return i;
          }, set: function (v) {
            rtl.rc(v,-2147483648,2147483647);
            i = v;
          }})) {
          Result = rtl.rc($mod.TTMSFNCJSONToClassPropertyType.cptInteger,0,14)}
         else if (pas.SysUtils.TryStrToInt64(s,{get: function () {
            return i64;
          }, set: function (v) {
            rtl.rc(v,-9007199254740991,9007199254740991);
            i64 = v;
          }})) {
          Result = rtl.rc($mod.TTMSFNCJSONToClassPropertyType.cptInteger64,0,14)}
         else if (!pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.TryStrToFloatDot(s,{get: function () {
            return d;
          }, set: function (v) {
            d = v;
          }})) {
          Result = rtl.rc($mod.TTMSFNCJSONToClassPropertyType.cptString,0,14)}
         else Result = rtl.rc($mod.TTMSFNCJSONToClassPropertyType.cptDouble,0,14);
      } else if (pas["WEBLib.JSON"].TJSONTrue.isPrototypeOf(AJSONValue) || pas["WEBLib.JSON"].TJSONFalse.isPrototypeOf(AJSONValue)) {
        Result = rtl.rc($mod.TTMSFNCJSONToClassPropertyType.cptBoolean,0,14)}
       else if (pas["WEBLib.JSON"].TJSONString.isPrototypeOf(AJSONValue)) {
        s = AJSONValue.GetStrValue();
        if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.TryStrToFloatDot(s,{get: function () {
            return d;
          }, set: function (v) {
            d = v;
          }})) {
          Result = rtl.rc($mod.TTMSFNCJSONToClassPropertyType.cptString,0,14)}
         else if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.IsDate(s,{get: function () {
            return dt;
          }, set: function (v) {
            dt = v;
          }}) || (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.ISOToDateTime(s,true) > 0) || pas.SysUtils.TryStrToDateTime(s,{get: function () {
            return dt;
          }, set: function (v) {
            dt = v;
          }})) {
          Result = rtl.rc($mod.TTMSFNCJSONToClassPropertyType.cptDateTime,0,14)}
         else if (pas.SysUtils.TryStrToBool(s,{get: function () {
            return b;
          }, set: function (v) {
            b = v;
          }})) {
          Result = rtl.rc($mod.TTMSFNCJSONToClassPropertyType.cptBoolean,0,14)}
         else Result = rtl.rc($mod.TTMSFNCJSONToClassPropertyType.cptString,0,14);
      };
      return Result;
    };
    this.ExportToDelphi = function (AJSONString, AOptions, ACallBack) {
      var $Self = this;
      var Result = "";
      var root = null;
      var I = 0;
      var K = 0;
      var c = null;
      var sl = null;
      var p = null;
      var ind = "";
      var cn = "";
      var slRendered = null;
      function SortList(AList) {
        var $ir = rtl.createIntfRefs();
        try {
          AList.Sort$1($ir.ref(1,pas["Generics.Defaults"].TComparer$$$G$$generics$defaults$$TTMSFNCJSONToClassProperty.Construct(function (ALeft, ARight) {
            var Result = 0;
            Result = rtl.rc(pas.SysUtils.CompareText(ALeft.FName,ARight.FName),-2147483648,2147483647);
            return Result;
          })));
        } finally {
          $ir.free();
        };
      };
      root = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.ParseJSON(AJSONString);
      if (root != null) {
        try {
          $mod.TTMSFNCJSONToClass.FClasses = $mod.TTMSFNCJSONToClassItems.$create("Create$4",[true]);
          try {
            this.JSONValueToClass(null,root);
            sl = pas.Classes.TStringList.$create("Create$1");
            slRendered = pas.Classes.TStringList.$create("Create$1");
            try {
              ind = "";
              if (AOptions.AddUnit) {
                sl.Add("unit MyDelphiUnit;");
                sl.Add("");
                sl.Add("interface");
                sl.Add("");
                sl.Add("uses");
                sl.Add("  Classes, System.Generics.Collections;");
                sl.Add("");
                sl.Add("type");
                ind = "  ";
              };
              for (var $l = this.FClasses.FLength - 1; $l >= 0; $l--) {
                I = $l;
                c = this.FClasses.GetItem(I);
                cn = c.GetClassName(ACallBack,$mod.TTMSFNCJSONToClassOptions.$clone(AOptions));
                if (slRendered.IndexOf(cn) === -1) {
                  var $tmp = AOptions.BaseClass;
                  if ($tmp === $mod.TTMSFNCJSONToClassBaseClass.cbcNone) {
                    sl.Add(ind + cn + " = class")}
                   else if ($tmp === $mod.TTMSFNCJSONToClassBaseClass.cbcPersistent) sl.Add(ind + cn + " = class(TPersistent)");
                  if (AOptions.SortProperties) SortList(c.GetProperties());
                  if (c.GetProperties().FLength > 0) {
                    sl.Add(ind + "private");
                    for (var $l1 = 0, $end = c.GetProperties().FLength - 1; $l1 <= $end; $l1++) {
                      K = $l1;
                      p = c.GetProperties().GetItem(K);
                      sl.Add(ind + "  F" + p.DelphiName(ACallBack,$mod.TTMSFNCJSONToClassOptions.$clone(AOptions),false) + ": " + p.DelphiType(ACallBack,$mod.TTMSFNCJSONToClassOptions.$clone(AOptions)) + ";");
                    };
                  };
                  if (AOptions.AddConstructor || AOptions.AddDestructor || AOptions.AddAssign) {
                    sl.Add(ind + "public");
                    if (AOptions.AddAssign) {
                      var $tmp1 = AOptions.BaseClass;
                      if ($tmp1 === $mod.TTMSFNCJSONToClassBaseClass.cbcNone) {
                        sl.Add(ind + "  procedure Assign(Source: TObject);")}
                       else if ($tmp1 === $mod.TTMSFNCJSONToClassBaseClass.cbcPersistent) sl.Add(ind + "  procedure Assign(Source: TPersistent); override;");
                    };
                    if (AOptions.AddConstructor) sl.Add(ind + "  constructor Create;");
                    if (AOptions.AddDestructor) sl.Add(ind + "  destructor Destroy; override;");
                  };
                  if (c.GetProperties().FLength > 0) {
                    sl.Add(ind + "published");
                    for (var $l2 = 0, $end1 = c.GetProperties().FLength - 1; $l2 <= $end1; $l2++) {
                      K = $l2;
                      p = c.GetProperties().GetItem(K);
                      sl.Add(ind + "  property " + p.DelphiName(ACallBack,$mod.TTMSFNCJSONToClassOptions.$clone(AOptions),true) + ": " + p.DelphiType(ACallBack,$mod.TTMSFNCJSONToClassOptions.$clone(AOptions)) + " read F" + p.DelphiName(ACallBack,$mod.TTMSFNCJSONToClassOptions.$clone(AOptions),false) + " write F" + p.DelphiName(ACallBack,$mod.TTMSFNCJSONToClassOptions.$clone(AOptions),false) + ";");
                    };
                  };
                  sl.Add(ind + "end;");
                  sl.Add("");
                  slRendered.Add(cn);
                };
              };
              slRendered.Clear();
              if (AOptions.AddUnit) {
                sl.Add("implementation");
                sl.Add("");
                if (AOptions.AddImplementation) {
                  slRendered.Clear();
                  for (var $l3 = this.FClasses.FLength - 1; $l3 >= 0; $l3--) {
                    I = $l3;
                    c = this.FClasses.GetItem(I);
                    cn = c.GetClassName(ACallBack,$mod.TTMSFNCJSONToClassOptions.$clone(AOptions));
                    if (slRendered.IndexOf(cn) === -1) {
                      if (AOptions.AddConstructor || AOptions.AddDestructor || AOptions.AddAssign) {
                        sl.Add("{ " + c.GetClassName(ACallBack,$mod.TTMSFNCJSONToClassOptions.$clone(AOptions)) + " }");
                        sl.Add("");
                        if (AOptions.AddAssign) {
                          var $tmp2 = AOptions.BaseClass;
                          if ($tmp2 === $mod.TTMSFNCJSONToClassBaseClass.cbcNone) {
                            sl.Add("procedure " + cn + ".Assign(Source: TObject);")}
                           else if ($tmp2 === $mod.TTMSFNCJSONToClassBaseClass.cbcPersistent) sl.Add("procedure " + cn + ".Assign(Source: TPersistent);");
                          sl.Add("begin");
                          sl.Add("  if (Source is " + cn + ") then");
                          sl.Add("  begin");
                          for (var $l4 = 0, $end2 = c.GetProperties().FLength - 1; $l4 <= $end2; $l4++) {
                            K = $l4;
                            p = c.GetProperties().GetItem(K);
                            if (p.FType === $mod.TTMSFNCJSONToClassPropertyType.cptObject) {
                              sl.Add("    F" + p.DelphiName(ACallBack,$mod.TTMSFNCJSONToClassOptions.$clone(AOptions),false) + ".Assign((Source as " + cn + ")." + p.DelphiName(ACallBack,$mod.TTMSFNCJSONToClassOptions.$clone(AOptions),true) + ");")}
                             else if (!p.IsObject()) {
                              sl.Add("    F" + p.DelphiName(ACallBack,$mod.TTMSFNCJSONToClassOptions.$clone(AOptions),false) + " := (Source as " + cn + ")." + p.DelphiName(ACallBack,$mod.TTMSFNCJSONToClassOptions.$clone(AOptions),true) + ";")}
                             else sl.Add("    //F" + p.DelphiName(ACallBack,$mod.TTMSFNCJSONToClassOptions.$clone(AOptions),false) + " := (Source as " + cn + ")." + p.DelphiName(ACallBack,$mod.TTMSFNCJSONToClassOptions.$clone(AOptions),true) + "; //implement list copy");
                          };
                          sl.Add("  end;");
                          sl.Add("end;");
                          sl.Add("");
                        };
                        if (AOptions.AddConstructor) {
                          sl.Add("constructor " + cn + ".Create;");
                          sl.Add("begin");
                          sl.Add("  inherited;");
                          for (var $l5 = 0, $end3 = c.GetProperties().FLength - 1; $l5 <= $end3; $l5++) {
                            K = $l5;
                            p = c.GetProperties().GetItem(K);
                            if (p.IsObject()) sl.Add("  F" + p.DelphiName(ACallBack,$mod.TTMSFNCJSONToClassOptions.$clone(AOptions),false) + " := " + p.DelphiType(ACallBack,$mod.TTMSFNCJSONToClassOptions.$clone(AOptions)) + ".Create;");
                          };
                          sl.Add("end;");
                          sl.Add("");
                        };
                        if (AOptions.AddDestructor) {
                          sl.Add("destructor " + cn + ".Destroy;");
                          sl.Add("begin");
                          for (var $l6 = 0, $end4 = c.GetProperties().FLength - 1; $l6 <= $end4; $l6++) {
                            K = $l6;
                            p = c.GetProperties().GetItem(K);
                            if (p.IsObject()) sl.Add("  F" + p.DelphiName(ACallBack,$mod.TTMSFNCJSONToClassOptions.$clone(AOptions),false) + ".Free;");
                          };
                          sl.Add("  inherited;");
                          sl.Add("end;");
                          sl.Add("");
                        };
                        slRendered.Add(cn);
                      };
                    };
                  };
                };
                sl.Add("end.");
              };
              while (sl.GetCount() > 0) {
                if (sl.Get(sl.GetCount() - 1) === "") {
                  sl.Delete(sl.GetCount() - 1)}
                 else break;
              };
              Result = sl.GetTextStr();
            } finally {
              slRendered = rtl.freeLoc(slRendered);
              sl = rtl.freeLoc(sl);
            };
          } finally {
            rtl.free(this,"FClasses");
          };
        } finally {
          root = rtl.freeLoc(root);
        };
      };
      return Result;
    };
    this.ExportToDelphi$1 = function (AJSONString, ACallBack) {
      var Result = "";
      Result = this.ExportToDelphi(AJSONString,$mod.TTMSFNCJSONToClassOptions.$clone($mod.DefaultJSONToClassOptions()),ACallBack);
      return Result;
    };
    this.ExportToDelphi$2 = function (AJSONValue, AOptions, ACallBack) {
      var Result = "";
      Result = this.ExportToDelphi(AJSONValue.ToString(),$mod.TTMSFNCJSONToClassOptions.$clone(AOptions),ACallBack);
      return Result;
    };
    this.ExportToDelphi$3 = function (AJSONValue, ACallBack) {
      var Result = "";
      Result = this.ExportToDelphi(AJSONValue.ToString(),$mod.TTMSFNCJSONToClassOptions.$clone($mod.DefaultJSONToClassOptions()),ACallBack);
      return Result;
    };
    this.ExportToDelphiFromFile = function (AFileName, ACallBack) {
      var Result = "";
      Result = this.ExportToDelphiFromFile$1(AFileName,$mod.TTMSFNCJSONToClassOptions.$clone($mod.DefaultJSONToClassOptions()),ACallBack);
      return Result;
    };
    this.ExportToDelphiFromFile$1 = function (AFileName, AOptions, ACallBack) {
      var Result = "";
      var sl = null;
      sl = pas.Classes.TStringList.$create("Create$1");
      try {
        sl.LoadFromFile(AFileName);
        Result = this.ExportToDelphi(sl.GetTextStr(),$mod.TTMSFNCJSONToClassOptions.$clone(AOptions),ACallBack);
      } finally {
        sl = rtl.freeLoc(sl);
      };
      return Result;
    };
  });
  this.$rtti.$StaticArray("ExcludePropertyList$a",{dims: [59], eltype: rtl.string});
  this.ExcludePropertyList = ["Align","AllowFocus","Anchors","BevelEdges","BevelInner","BevelKind","BevelOuter","BevelWidth","BiDiMode","BitmapContainer","BorderSpacing","CanParentFocus","ClipChildren","ClipParent","Constraints","Ctl3D","DisableFocusEffect","DoubleBuffered","DragCursor","DragKind","DragMode","ElementID","ElementClassName","ElementPosition","ElementFont","Enabled","EnableDragHighLight","Height","Hint","HitTest","Left","Locked","Margins","Name","Opacity","Padding","ParentBiDiMode","ParentColor","ParentCtl3D","ParentDoubleBuffered","ParentFont","ParentShowHint","PopupMenu","Position","RotationAngle","RotationCenter","Scale","ShowHint","Size","StyleElements","StyleName","TabOrder","TabStop","Tag","Top","Touch","TouchTargetExpansion","Visible","Width"];
  this.DefaultJSONToClassOptions = function () {
    var Result = $mod.TTMSFNCJSONToClassOptions.$new();
    Result.AddUnit = false;
    Result.AddImplementation = false;
    Result.AddConstructor = false;
    Result.AddDestructor = false;
    Result.AddAssign = false;
    Result.BaseClass = $mod.TTMSFNCJSONToClassBaseClass.cbcNone;
    Result.SortProperties = true;
    Result.DelphiCasing = true;
    Result.RemoveSpecialCharacters = true;
    return Result;
  };
  $mod.$implcode = function () {
    $impl.gcNull = -1;
    $mod.$rtti.$ClassRef("TCustomControlClass",{instancetype: pas["WEBLib.Controls"].$rtti["TCustomControl"]});
    $impl.GetTypeInfoEx = function (APropInfo) {
      var Result = null;
      Result = APropInfo.typeinfo;
      return Result;
    };
    $impl.GetColorRed = function (AColor) {
      var Result = 0;
      AColor = pas["WEBLib.Graphics"].ColorToRGB(AColor);
      Result = pas["WEBLib.Graphics"].GetRValue(AColor);
      return Result;
    };
    $impl.GetColorGreen = function (AColor) {
      var Result = 0;
      AColor = pas["WEBLib.Graphics"].ColorToRGB(AColor);
      Result = pas["WEBLib.Graphics"].GetGValue(AColor);
      return Result;
    };
    $impl.GetColorBlue = function (AColor) {
      var Result = 0;
      AColor = pas["WEBLib.Graphics"].ColorToRGB(AColor);
      Result = pas["WEBLib.Graphics"].GetBValue(AColor);
      return Result;
    };
    $impl.HTMLToColorEx = function (AHTML) {
      var Result = 0;
      function HexVal(s) {
        var Result = 0;
        var i = 0;
        var j = 0;
        var i1 = 0;
        var i2 = 0;
        if (s.length < 2) {
          Result = 0;
          return Result;
        };
        i1 = 1;
        i2 = 2;
        if (s.charAt(i1 - 1) >= "A") {
          i = (s.charCodeAt(i1 - 1) - 65) + 10}
         else i = s.charCodeAt(i1 - 1) - 48;
        if (s.charAt(i2 - 1) >= "A") {
          j = (s.charCodeAt(i2 - 1) - 65) + 10}
         else j = s.charCodeAt(i2 - 1) - 48;
        Result = (i << 4) + j;
        return Result;
      };
      var r = 0;
      var g = 0;
      var b = 0;
      r = HexVal(pas.System.Copy(AHTML,2,2));
      g = HexVal(pas.System.Copy(AHTML,4,2)) << 8;
      b = HexVal(pas.System.Copy(AHTML,6,2)) << 16;
      Result = b + g + r;
      return Result;
    };
    var HTMLHexColor = "#RRGGBB";
    var HexDigit = ["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"];
    $impl.ColorToHTMLEx = function (AColor) {
      var Result = "";
      var c = 0;
      var i = 0;
      i = 1;
      c = pas["WEBLib.Graphics"].ColorToRGB(AColor);
      Result = HTMLHexColor;
      Result = rtl.setCharAt(Result,(1 + i) - 1,HexDigit[$impl.GetColorRed(c) >>> 4]);
      Result = rtl.setCharAt(Result,(2 + i) - 1,HexDigit[$impl.GetColorRed(c) & 0xF]);
      Result = rtl.setCharAt(Result,(3 + i) - 1,HexDigit[$impl.GetColorGreen(c) >>> 4]);
      Result = rtl.setCharAt(Result,(4 + i) - 1,HexDigit[$impl.GetColorGreen(c) & 0xF]);
      Result = rtl.setCharAt(Result,(5 + i) - 1,HexDigit[$impl.GetColorBlue(c) >>> 4]);
      Result = rtl.setCharAt(Result,(6 + i) - 1,HexDigit[$impl.GetColorBlue(c) & 0xF]);
      return Result;
    };
  };
  $mod.$init = function () {
    $mod.TTMSFNCPersistence.ClassTypeVariable = "$type";
    $mod.TTMSFNCPersistence.IgnoreExceptions = false;
  };
},["RTTI","DateUtils","StrUtils","WEBLib.Controls","WEBLib.Graphics","JS","Generics.Defaults","WEBLib.TMSFNCUtils"]);
rtl.module("WEBLib.TMSFNCTypes",["System","Types","Classes","WEBLib.Graphics","WEBLib.Controls","SysUtils","Math","WEBLib.JSON"],function () {
  "use strict";
  var $mod = this;
  rtl.createInterface(this,"ITMSFNCProductInfo","{C53329EA-7B3A-4507-AD9E-88ACD6A85054}",["GetVersion","GetDocURL","GetTipsURL"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("GetVersion",1,[],2,rtl.string);
    $r.addMethod("GetDocURL",1,[],2,rtl.string);
    $r.addMethod("GetTipsURL",1,[],2,rtl.string);
  });
  this.TTMSFNCBaseDocURL = "https://download.tmssoftware.com/doc/";
  this.TTMSFNCBaseTipsURL = "https://www.tmssoftware.com/site/tmsfnccore.asp?s=faq";
  this.pidWeb = 0x1000;
  this.ssCommand = pas.Classes.TShiftState$a.ssCtrl;
  this.TMSPlatformsWinOnly = 0;
  this.TMSPlatformsDesktop = 0;
  this.TMSPlatforms = 0;
  this.TMSPlatformsWeb = 0;
  this.TMSPlatformsWebDesktop = 0;
  this.KEY_CANCEL = 3;
  this.KEY_CONTROL = 17;
  this.KEY_SHIFT = 16;
  this.KEY_ESCAPE = 27;
  this.KEY_INSERT = 45;
  this.KEY_DELETE = 46;
  this.KEY_TAB = 9;
  this.KEY_SUBTRACT = 109;
  this.KEY_ADD = 107;
  this.KEY_MULTIPLY = 106;
  this.KEY_DIVIDE = 111;
  this.KEY_PRIOR = 33;
  this.KEY_NEXT = 34;
  this.KEY_UP = 38;
  this.KEY_DOWN = 40;
  this.KEY_RIGHT = 39;
  this.KEY_LEFT = 37;
  this.KEY_HOME = 36;
  this.KEY_END = 35;
  this.KEY_RETURN = 13;
  this.KEY_SPACE = 32;
  this.KEY_MENU = 18;
  this.KEY_BACK = 8;
  this.KEY_F1 = 112;
  this.KEY_F2 = 113;
  this.KEY_F3 = 114;
  this.KEY_F4 = 115;
  this.KEY_F5 = 116;
  this.KEY_F6 = 117;
  this.KEY_F7 = 118;
  this.KEY_F8 = 119;
  this.KEY_F9 = 120;
  this.KEY_F10 = 121;
  this.KEY_F11 = 122;
  this.KEY_F12 = 123;
  this.SReadError = "Stream read error";
  this.SWriteError = "Stream write error";
  this.$rtti.$RefToProcVar("TTMSFNCStreamLoadedEvent",{procsig: rtl.newTIProcSig([])});
  rtl.createHelper(this,"TTMSFNCMemoryStream",null,function () {
    this.GetBytes = function () {
      var Result = [];
      var p = 0;
      var b = [];
      p = this.GetPosition();
      this.SetPosition(0);
      b = rtl.arraySetLength(b,0,this.GetSize());
      this.Read$1(rtl.arrayRef(b),0,rtl.length(b));
      Result = rtl.arrayRef(b);
      this.SetPosition(p);
      return Result;
    };
    this.OpenFile = function (FileType) {
      var b = [];
      var s = "";
      var f = "";
      f = "tmp." + pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetFileExtension(FileType);
      b = rtl.arrayRef($mod.TTMSFNCMemoryStream.GetBytes.call(this));
      s = FileType;
      var file = new Blob([new Uint8Array(b)], {type: s});
      var fileURL = window.URL.createObjectURL(file);
      if (window.navigator && window.navigator.msSaveOrOpenBlob) {
        window.navigator.msSaveOrOpenBlob(file, f);
        return;
      }
      window.open(fileURL);
    };
    this.SaveToFile = function (FileName) {
      var s = "";
      var b = [];
      s = FileName;
      b = rtl.arrayRef($mod.TTMSFNCMemoryStream.GetBytes.call(this));
      var userAgent = navigator.userAgent.toLowerCase();
          if (userAgent.indexOf('electron/') > -1) {
            var arr = new Uint8Array(b);
            nfs.writeFileSync(s, arr);
          } else {
            var newBlob = new Blob([new Uint8Array(b)], {type: "octet/stream"})
      
            if (window.navigator && window.navigator.msSaveOrOpenBlob) {
              window.navigator.msSaveOrOpenBlob(newBlob, s);
              return;
            }
      
            const data = window.URL.createObjectURL(newBlob);
            var link = document.createElement('a');
            link.href = data;
            link.download = s;
            document.body.appendChild(link);
            link.click();
            setTimeout(function(){
             document.body.removeChild(link);
              window.URL.revokeObjectURL(data);
            }, 100);
          };
    };
  });
  rtl.recNewT(this,"TSizeF",function () {
    this.cx = 0.0;
    this.cy = 0.0;
    this.$eq = function (b) {
      return (this.cx === b.cx) && (this.cy === b.cy);
    };
    this.$assign = function (s) {
      this.cx = s.cx;
      this.cy = s.cy;
      return this;
    };
    var $r = $mod.$rtti.$Record("TSizeF",{},this);
    $r.addField("cx",rtl.double);
    $r.addField("cy",rtl.double);
  });
  rtl.recNewT(this,"TPointF",function () {
    this.X = 0.0;
    this.Y = 0.0;
    this.$eq = function (b) {
      return (this.X === b.X) && (this.Y === b.Y);
    };
    this.$assign = function (s) {
      this.X = s.X;
      this.Y = s.Y;
      return this;
    };
    var $r = $mod.$rtti.$Record("TPointF",{},this);
    $r.addField("X",rtl.double);
    $r.addField("Y",rtl.double);
  });
  rtl.recNewT(this,"TRectF",function () {
    this.Left = 0.0;
    this.Top = 0.0;
    this.Right = 0.0;
    this.Bottom = 0.0;
    this.$eq = function (b) {
      return (this.Left === b.Left) && (this.Top === b.Top) && (this.Right === b.Right) && (this.Bottom === b.Bottom);
    };
    this.$assign = function (s) {
      this.Left = s.Left;
      this.Top = s.Top;
      this.Right = s.Right;
      this.Bottom = s.Bottom;
      return this;
    };
    var $r = $mod.$rtti.$Record("TRectF",{},this);
    $r.addField("Left",rtl.double);
    $r.addField("Top",rtl.double);
    $r.addField("Right",rtl.double);
    $r.addField("Bottom",rtl.double);
  });
  this.$rtti.$Class("TTMSFNCBitmap");
  rtl.createClass(this,"TTMSFNCSVGImport",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FRotationAngle = 0.0;
      this.FViewRect = $mod.TRectF.$new();
      this.FGrayScale = false;
      this.FCustomFillColor = 0;
      this.FCustomStrokeColor = 0;
      this.FTintColor = 0;
      this.FCustomOpacity = 0.0;
    };
    this.$final = function () {
      this.FViewRect = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.Create$1 = function () {
      this.FRotationAngle = 0;
      this.FCustomOpacity = -1;
      this.FCustomFillColor = -1;
      this.FCustomStrokeColor = -1;
      this.FTintColor = -1;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCSVGImport.isPrototypeOf(Source)) {
        this.FGrayScale = rtl.as(Source,$mod.TTMSFNCSVGImport).FGrayScale;
        this.FCustomFillColor = rtl.as(Source,$mod.TTMSFNCSVGImport).FCustomFillColor;
        this.FCustomStrokeColor = rtl.as(Source,$mod.TTMSFNCSVGImport).FCustomStrokeColor;
        this.FTintColor = rtl.as(Source,$mod.TTMSFNCSVGImport).FTintColor;
        this.FCustomOpacity = rtl.as(Source,$mod.TTMSFNCSVGImport).FCustomOpacity;
        this.FRotationAngle = rtl.as(Source,$mod.TTMSFNCSVGImport).FRotationAngle;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("GrayScale",0,rtl.boolean,"FGrayScale","FGrayScale",4,{Default: false});
    $r.addProperty("CustomFillColor",0,pas["WEBLib.Graphics"].$rtti["TColor"],"FCustomFillColor","FCustomFillColor");
    $r.addProperty("CustomStrokeColor",0,pas["WEBLib.Graphics"].$rtti["TColor"],"FCustomStrokeColor","FCustomStrokeColor");
    $r.addProperty("TintColor",0,pas["WEBLib.Graphics"].$rtti["TColor"],"FTintColor","FTintColor");
    $r.addProperty("CustomOpacity",0,rtl.double,"FCustomOpacity","FCustomOpacity");
    $r.addProperty("RotationAngle",0,rtl.double,"FRotationAngle","FRotationAngle");
  });
  rtl.createClass(this,"TTMSFNCBitmap",pas["WEBLib.Graphics"].TBitmap,function () {
    this.CreateFromStream = function (AStream) {
      this.Create$3();
      this.LoadFromStream(AStream);
      return this;
    };
  });
  this.$rtti.$DynArray("TTMSFNCObjectExcludePropertyListArray",{eltype: rtl.string});
  rtl.createHelper(this,"TTMSFNCObjectHelper",null,function () {
    this.ToJSONValue = function () {
      var Result = null;
      Result = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.ParseJSON($mod.TTMSFNCObjectHelper.ToJSON$1.call(this));
      return Result;
    };
    this.ToJSON = function (AExcludedProperties) {
      var Result = "";
      var s = null;
      var p = null;
      var arr = [];
      var I = 0;
      var ep = [];
      arr = rtl.arraySetLength(arr,"",rtl.length(AExcludedProperties));
      for (var $l = 0, $end = rtl.length(AExcludedProperties) - 1; $l <= $end; $l++) {
        I = $l;
        arr[I] = AExcludedProperties[I];
      };
      s = pas.Classes.TStringStream.$create("Create$3",["",pas.SysUtils.TEncoding.GetANSI(),true]);
      p = pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.$create("Create");
      try {
        ep = p.FExcludeProperties;
        pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.FExcludeProperties = rtl.arrayRef(arr);
        p.$class.SaveSettingsToStream(this,s);
        pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.FExcludeProperties = rtl.arrayRef(ep);
        Result = s.GetDataString();
      } finally {
        p = rtl.freeLoc(p);
        s = rtl.freeLoc(s);
      };
      return Result;
    };
    this.ToJSON$1 = function () {
      var Result = "";
      var s = null;
      s = pas.Classes.TStringStream.$create("Create$3",["",pas.SysUtils.TEncoding.GetANSI(),true]);
      try {
        pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.SaveSettingsToStream(this,s);
        Result = s.GetDataString();
      } finally {
        s = rtl.freeLoc(s);
      };
      return Result;
    };
    this.FromJSON = function (Value) {
      var s = null;
      var cs = "";
      var obj = null;
      s = pas.Classes.TStringStream.$create("Create$3",[Value,pas.SysUtils.TEncoding.GetANSI(),true]);
      try {
        obj = pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.FIOReference;
        cs = pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.ClassTypeVariable;
        pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.ClassTypeVariable = "";
        pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.FIOReference = this;
        pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.LoadSettingsFromStream(this,s);
        pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.ClassTypeVariable = cs;
        pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.FIOReference = obj;
      } finally {
        s = rtl.freeLoc(s);
      };
    };
    this.Log = function () {
      pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.Log($mod.TTMSFNCObjectHelper.ToJSON$1.call(this));
    };
    this.SaveToJSONFile = function (AFileName) {
      pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.SaveSettingsToFile(this,AFileName);
    };
    this.LoadFromJSONFile = function (AFileName) {
      pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.LoadSettingsFromFile(this,AFileName);
    };
    this.SaveToJSONStream = function (AStream) {
      pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.SaveSettingsToStream(this,AStream);
    };
    this.LoadFromJSONStream = function (AStream) {
      pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.LoadSettingsFromStream(this,AStream);
    };
  });
  rtl.createHelper(this,"TTMSFNCJSONValueHelper",null,function () {
    this.GetProperties = function (AName) {
      var Result = null;
      Result = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONValue(this,AName);
      return Result;
    };
    this.GetAsArray = function () {
      var Result = null;
      Result = null;
      if (pas["WEBLib.JSON"].TJSONArray.isPrototypeOf(this)) Result = rtl.as(this,pas["WEBLib.JSON"].TJSONArray);
      return Result;
    };
    this.GetAsString = function () {
      var Result = "";
      Result = "";
      if (this != null) Result = this.GetStrValue();
      return Result;
    };
    this.GetAsDouble = function () {
      var Result = 0.0;
      Result = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONValueAsDouble(this);
      return Result;
    };
    this.GetAsInteger = function () {
      var Result = 0;
      Result = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONValueAsInteger(this);
      return Result;
    };
    this.GetAsBoolean = function () {
      var Result = false;
      Result = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONValueAsBoolean(this);
      return Result;
    };
    this.Find = function (APath) {
      var Result = null;
      Result = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.FindJSONValue(this,APath);
      return Result;
    };
  });
  rtl.createHelper(this,"TTMSFNCJSONArrayHelper",null,function () {
    this.GetValues = function (AIndex) {
      var Result = null;
      Result = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONArrayItem(this,AIndex);
      return Result;
    };
    this.GetLength = function () {
      var Result = 0;
      Result = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONArraySize(this);
      return Result;
    };
  });
  rtl.createClass(this,"TTMSFNCMargins",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FRight = 0.0;
      this.FBottom = 0.0;
      this.FTop = 0.0;
      this.FLeft = 0.0;
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetBottom = function (Value) {
      if (this.FBottom !== Value) {
        this.FBottom = Value;
        this.Changed();
      };
    };
    this.SetLeft = function (Value) {
      if (this.FLeft !== Value) {
        this.FLeft = Value;
        this.Changed();
      };
    };
    this.SetRight = function (Value) {
      if (this.FRight !== Value) {
        this.FRight = Value;
        this.Changed();
      };
    };
    this.SetTop = function (Value) {
      if (this.FTop !== Value) {
        this.FTop = Value;
        this.Changed();
      };
    };
    this.IsLeftStored = function () {
      var Result = false;
      Result = this.FLeft !== 0;
      return Result;
    };
    this.IsTopStored = function () {
      var Result = false;
      Result = this.FTop !== 0;
      return Result;
    };
    this.IsRightStored = function () {
      var Result = false;
      Result = this.FRight !== 0;
      return Result;
    };
    this.IsBottomStored = function () {
      var Result = false;
      Result = this.FBottom !== 0;
      return Result;
    };
    this.GetRect = function () {
      var Result = $mod.TRectF.$new();
      Result.$assign($mod.RectF(this.FLeft,this.FTop,this.FRight,this.FBottom));
      return Result;
    };
    this.SetRect = function (Value) {
      this.FLeft = Value.Left;
      this.FTop = Value.Top;
      this.FRight = Value.Right;
      this.FBottom = Value.Bottom;
      this.Changed();
    };
    this.Changed = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Create$1 = function () {
      this.FLeft = 0;
      this.FBottom = 0;
      this.FRight = 0;
      this.FTop = 0;
      return this;
    };
    this.Create$2 = function (ARect) {
      this.FLeft = ARect.Left;
      this.FBottom = ARect.Bottom;
      this.FRight = ARect.Right;
      this.FTop = ARect.Top;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCMargins.isPrototypeOf(Source)) {
        this.FLeft = rtl.as(Source,$mod.TTMSFNCMargins).FLeft;
        this.FTop = rtl.as(Source,$mod.TTMSFNCMargins).FTop;
        this.FRight = rtl.as(Source,$mod.TTMSFNCMargins).FRight;
        this.FBottom = rtl.as(Source,$mod.TTMSFNCMargins).FBottom;
      };
    };
    this.Empty = function () {
      var Result = false;
      var r = $mod.TRectF.$new();
      r.$assign($mod.RectF(this.FLeft,this.FTop,this.FRight,this.FBottom));
      Result = $mod.RectIsEmpty(r);
      return Result;
    };
    this.PaddingRect = function (R) {
      var Result = $mod.TRectF.$new();
      Result.$assign($mod.RectF(R.Left + this.FLeft,R.Top + this.FTop,R.Right - this.FRight,R.Bottom - this.FBottom));
      return Result;
    };
    var $r = this.$rtti;
    $r.addProperty("Left",14,rtl.double,"FLeft","SetLeft",4,{stored: "IsLeftStored"});
    $r.addProperty("Top",14,rtl.double,"FTop","SetTop",4,{stored: "IsTopStored"});
    $r.addProperty("Right",14,rtl.double,"FRight","SetRight",4,{stored: "IsRightStored"});
    $r.addProperty("Bottom",14,rtl.double,"FBottom","SetBottom",4,{stored: "IsBottomStored"});
    $r.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChange","FOnChange");
  });
  rtl.createClass(this,"TTMSFNCPoint",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FY = 0.0;
      this.FX = 0.0;
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetX = function (Value) {
      if (this.FX !== Value) {
        this.FX = Value;
        this.Changed();
      };
    };
    this.SetY = function (Value) {
      if (this.FY !== Value) {
        this.FY = Value;
        this.Changed();
      };
    };
    this.IsXStored = function () {
      var Result = false;
      Result = this.FX !== 0;
      return Result;
    };
    this.IsYStored = function () {
      var Result = false;
      Result = this.FY !== 0;
      return Result;
    };
    this.Changed = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Create$1 = function () {
      this.FX = 0;
      this.FY = 0;
      return this;
    };
    this.Create$2 = function (APoint) {
      this.FX = APoint.X;
      this.FY = APoint.Y;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCPoint.isPrototypeOf(Source)) {
        this.FX = rtl.as(Source,$mod.TTMSFNCPoint).FX;
        this.FY = rtl.as(Source,$mod.TTMSFNCPoint).FY;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("X",14,rtl.double,"FX","SetX",4,{stored: "IsXStored"});
    $r.addProperty("Y",14,rtl.double,"FY","SetY",4,{stored: "IsYStored"});
    $r.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChange","FOnChange");
  });
  rtl.createClass(this,"TTMSFNCScaledBitmap",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FBitmap = null;
      this.FScale = 0.0;
      this.FBitmapName = "";
    };
    this.$final = function () {
      this.FBitmap = undefined;
      pas.Classes.TCollectionItem.$final.call(this);
    };
    this.IsScaleStored = function () {
      var Result = false;
      Result = this.FScale !== 1.0;
      return Result;
    };
    this.SetBitmap = function (Value) {
      if (this.FBitmap !== Value) {
        this.FBitmap.Assign(Value);
        this.Changed(false);
      };
    };
    this.SetScale = function (Value) {
      if (this.FScale !== Value) {
        this.FScale = Value;
        this.Changed(false);
      };
    };
    this.SetBitmapName = function (Value) {
      if (this.FBitmapName !== Value) {
        this.FBitmapName = Value;
        this.Changed(false);
      };
    };
    this.BitmapChanged = function (Sender) {
      this.Changed(false);
    };
    this.Create$1 = function (ACollection) {
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      this.FBitmap = $mod.TTMSFNCBitmap.$create("Create$3");
      this.FBitmap.FOnChange = rtl.createCallback(this,"BitmapChanged");
      this.FScale = 1.0;
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FBitmap");
      pas.Classes.TCollectionItem.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCScaledBitmap.isPrototypeOf(Source)) {
        this.FBitmap.Assign(rtl.as(Source,$mod.TTMSFNCScaledBitmap).FBitmap);
        this.FBitmapName = rtl.as(Source,$mod.TTMSFNCScaledBitmap).FBitmapName;
        this.FScale = rtl.as(Source,$mod.TTMSFNCScaledBitmap).FScale;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Bitmap",2,$mod.$rtti["TTMSFNCBitmap"],"FBitmap","SetBitmap");
    $r.addProperty("BitmapName",2,rtl.string,"FBitmapName","SetBitmapName");
    $r.addProperty("Scale",14,rtl.double,"FScale","SetScale",4,{stored: "IsScaleStored"});
  });
  rtl.createClass(this,"TTMSFNCScaledBitmaps",pas.Classes.TOwnedCollection,function () {
    this.$init = function () {
      pas.Classes.TOwnedCollection.$init.call(this);
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      pas.Classes.TOwnedCollection.$final.call(this);
    };
    this.GetItems = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItems = function (Index, Value) {
      this.SetItem(Index,Value);
    };
    this.GetBitmap = function (Scale) {
      var Result = null;
      Result = this.GetBitmapByScale(Scale);
      return Result;
    };
    this.SetBitmap = function (Scale, Value) {
      var b = null;
      b = this.GetItemByScale(Scale);
      if (!(b != null)) b = this.Add$1(Scale);
      b.FBitmap.Assign(Value);
    };
    this.Update = function (Item) {
      pas.Classes.TCollection.Update.apply(this,arguments);
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,$mod.TTMSFNCScaledBitmap);
      return this;
    };
    this.Add$1 = function (Scale) {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      Result.SetScale(Scale);
      return Result;
    };
    this.AddBitmapFromResource = function (ResourceName, Scale) {
      var Result = null;
      Result = this.AddBitmapFromResource$1(ResourceName,0,Scale);
      return Result;
    };
    this.AddBitmapFromResource$1 = function (ResourceName, AInstance, Scale) {
      var Result = null;
      Result = this.Add$1(Scale);
      Result.FBitmap.LoadFromResource$1(ResourceName,AInstance);
      return Result;
    };
    this.AddBitmap = function (Bitmap, Scale) {
      var Result = null;
      Result = this.Add$1(Scale);
      Result.FBitmap.Assign(Bitmap);
      return Result;
    };
    this.AddBitmapName = function (BitmapName, Scale) {
      var Result = null;
      Result = this.Add$1(Scale);
      Result.SetBitmapName(BitmapName);
      return Result;
    };
    this.AddDrawBitmap = function (Bitmap, Scale) {
      var Result = null;
      Result = this.Add$1(Scale);
      Result.FBitmap.Assign(Bitmap);
      return Result;
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      return Result;
    };
    this.Insert$2 = function (Index, Scale) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      Result.SetScale(Scale);
      return Result;
    };
    this.GetBitmapByScale = function (Scale) {
      var Result = null;
      var it = null;
      Result = null;
      it = this.GetItemByScale(Scale);
      if (it != null) Result = it.FBitmap;
      return Result;
    };
    this.GetItemByScale = function (Scale) {
      var Result = null;
      var I = 0;
      var cl = null;
      var it = null;
      var mx = 0.0;
      Result = null;
      cl = null;
      mx = 0;
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        it = this.GetItems(I);
        if (it.FScale === Scale) {
          Result = it;
          break;
        } else if ((it.FScale !== Scale) && (it.FScale > mx)) {
          cl = it;
          mx = it.FScale;
        };
      };
      if (Result === null) Result = cl;
      return Result;
    };
  });
  this.TTMSFNCPictureFormat = {"0": "pfBMP", pfBMP: 0, "1": "pfGIF", pfGIF: 1, "2": "pfJPG", pfJPG: 2, "3": "pfPNG", pfPNG: 3, "4": "pfICO", pfICO: 4, "5": "pfTiff", pfTiff: 5, "6": "pfMetaFile", pfMetaFile: 6, "7": "pfNone", pfNone: 7};
  this.$rtti.$Enum("TTMSFNCPictureFormat",{minvalue: 0, maxvalue: 7, ordtype: 1, enumtype: this.TTMSFNCPictureFormat});
  rtl.createInterface(this,"ITMSFNCCustomEditor","{CC0C60B7-75F3-47CE-8A7F-8005A19F12E8}",["SetText","SetSelStart","SetSelLength","GetTextLength"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("SetText",0,[["AValue",rtl.string]]);
    $r.addMethod("SetSelStart",0,[["AValue",rtl.longint]]);
    $r.addMethod("SetSelLength",0,[["AValue",rtl.longint]]);
    $r.addMethod("GetTextLength",1,[],2,rtl.longint);
  });
  rtl.createClass(this,"TTMSFNCOwnedCollection",pas.Classes.TOwnedCollection,function () {
  });
  rtl.createClass(this,"TTMSFNCPersistent",pas.Classes.TPersistent,function () {
  });
  this.InflateRectEx = function (R, DX, DY) {
    R.Left = R.Left - DX;
    R.Right = R.Right + DX;
    R.Top = R.Top - DY;
    R.Bottom = R.Bottom + DY;
  };
  this.ConvertToRectF = function (Rect) {
    var Result = $mod.TRectF.$new();
    Result.Left = Rect.Left;
    Result.Top = Rect.Top;
    Result.Right = Rect.Right;
    Result.Bottom = Rect.Bottom;
    return Result;
  };
  this.ConvertToRectF$1 = function (Rect) {
    var Result = $mod.TRectF.$new();
    Result.$assign(Rect);
    return Result;
  };
  this.ConvertToRect = function (Rect) {
    var Result = pas.Types.TRect.$new();
    Result.Left = Math.round(Rect.Left);
    Result.Top = Math.round(Rect.Top);
    Result.Right = Math.round(Rect.Right);
    Result.Bottom = Math.round(Rect.Bottom);
    return Result;
  };
  this.ConvertToRect$1 = function (Rect) {
    var Result = pas.Types.TRect.$new();
    Result.$assign(Rect);
    return Result;
  };
  this.ConvertToSizeF = function (Size) {
    var Result = $mod.TSizeF.$new();
    Result.cx = Size.cx;
    Result.cy = Size.cy;
    return Result;
  };
  this.ConvertToSizeF$1 = function (Size) {
    var Result = $mod.TSizeF.$new();
    Result.$assign(Size);
    return Result;
  };
  this.ConvertToSize = function (Size) {
    var Result = pas.Types.TSize.$new();
    Result.cx = Math.round(Size.cx);
    Result.cy = Math.round(Size.cy);
    return Result;
  };
  this.ConvertToSize$1 = function (Size) {
    var Result = pas.Types.TSize.$new();
    Result.$assign(Size);
    return Result;
  };
  this.ConvertToPointF = function (Point) {
    var Result = $mod.TPointF.$new();
    Result.X = Point.x;
    Result.Y = Point.y;
    return Result;
  };
  this.ConvertToPointF$1 = function (Point) {
    var Result = $mod.TPointF.$new();
    Result.$assign(Point);
    return Result;
  };
  this.ConvertToPoint = function (Point) {
    var Result = pas.Types.TPoint.$new();
    Result.x = Math.round(Point.X);
    Result.y = Math.round(Point.Y);
    return Result;
  };
  this.ConvertToPoint$1 = function (Point) {
    var Result = pas.Types.TPoint.$new();
    Result.$assign(Point);
    return Result;
  };
  this.OffsetRectEx = function (R, DX, DY) {
    var Result = false;
    R.Left = R.Left + DX;
    R.Right = R.Right + DX;
    R.Top = R.Top + DY;
    R.Bottom = R.Bottom + DY;
    Result = true;
    return Result;
  };
  this.OffsetRectEx$1 = function (R, DX, DY) {
    var Result = false;
    R.Left = R.Left + DX;
    R.Right = R.Right + DX;
    R.Top = R.Top + DY;
    R.Bottom = R.Bottom + DY;
    Result = true;
    return Result;
  };
  this.PtInRectEx = function (Rect, P) {
    var Result = false;
    Result = (P.X >= Rect.Left) && (P.X < Rect.Right) && (P.Y >= Rect.Top) && (P.Y < Rect.Bottom);
    return Result;
  };
  this.IntersectRectEx = function (Rect1, Rect2) {
    var Result = false;
    Result = (Rect1.Left < Rect2.Right) && (Rect1.Right > Rect2.Left) && (Rect1.Top < Rect2.Bottom) && (Rect1.Bottom > Rect2.Top);
    return Result;
  };
  this.IntersectRectEx$1 = function (Rect, R1, R2) {
    var Result = false;
    var tmpRect = $mod.TRectF.$new();
    tmpRect.$assign(R1);
    if (R2.Left > R1.Left) tmpRect.Left = R2.Left;
    if (R2.Top > R1.Top) tmpRect.Top = R2.Top;
    if (R2.Right < R1.Right) tmpRect.Right = R2.Right;
    if (R2.Bottom < R1.Bottom) tmpRect.Bottom = R2.Bottom;
    Result = !$mod.RectIsEmpty(tmpRect);
    if (!Result) {
      tmpRect.Top = 0.0;
      tmpRect.Bottom = 0.0;
      tmpRect.Left = 0.0;
      tmpRect.Right = 0.0;
    };
    Rect.$assign(tmpRect);
    return Result;
  };
  this.EqualRectEx = function (R1, R2) {
    var Result = false;
    Result = (R1.Left === R2.Left) && (R1.Right === R2.Right) && (R1.Top === R2.Top) && (R1.Bottom === R2.Bottom);
    return Result;
  };
  this.EqualRectEx$1 = function (R1, R2) {
    var Result = false;
    Result = (R1.Left === R2.Left) && (R1.Right === R2.Right) && (R1.Top === R2.Top) && (R1.Bottom === R2.Bottom);
    return Result;
  };
  this.RectWidthEx = function (Rect) {
    var Result = 0;
    Result = Rect.Right - Rect.Left;
    return Result;
  };
  this.RectWidthEx$1 = function (Rect) {
    var Result = 0.0;
    Result = Rect.Right - Rect.Left;
    return Result;
  };
  this.RectHeightEx = function (Rect) {
    var Result = 0;
    Result = Rect.Bottom - Rect.Top;
    return Result;
  };
  this.RectHeightEx$1 = function (Rect) {
    var Result = 0.0;
    Result = Rect.Bottom - Rect.Top;
    return Result;
  };
  this.RectCenterEx = function (R, B) {
    var Result = pas.Types.TRect.$new();
    $mod.OffsetRectEx(R,-R.Left,-R.Top);
    $mod.OffsetRectEx(R,rtl.trunc(($mod.RectWidthEx(B) - $mod.RectWidthEx(R)) / 2),rtl.trunc(($mod.RectHeightEx(B) - $mod.RectHeightEx(R)) / 2));
    $mod.OffsetRectEx(R,B.Left,B.Top);
    Result.$assign(R);
    return Result;
  };
  this.RectCenterEx$1 = function (R, B) {
    var Result = $mod.TRectF.$new();
    $mod.OffsetRectEx$1(R,-R.Left,-R.Top);
    $mod.OffsetRectEx$1(R,Math.round(($mod.RectWidthEx$1(B) - $mod.RectWidthEx$1(R)) / 2),Math.round(($mod.RectHeightEx$1(B) - $mod.RectHeightEx$1(R)) / 2));
    $mod.OffsetRectEx$1(R,B.Left,B.Top);
    Result.$assign(R);
    return Result;
  };
  this.RectCenterAtEx = function (Rect, ADesignatedArea) {
    var Result = $mod.TRectF.$new();
    Result.$assign(Rect);
    $mod.RectCenterEx$1(Result,ADesignatedArea);
    return Result;
  };
  this.RectSnapToPixelEx = function (Rect, AScale, APlaceBetweenPixels) {
    var Result = $mod.TRectF.$new();
    var LScale = 0.0;
    var HalfPixel = 0.0;
    if (AScale <= 0) {
      LScale = 1}
     else LScale = AScale;
    Result.Left = pas.System.Trunc(Rect.Left * LScale) / LScale;
    Result.Top = pas.System.Trunc(Rect.Top * LScale) / LScale;
    Result.Right = Result.Left + (Math.round((Rect.Right - Rect.Left) * LScale) / LScale);
    Result.Bottom = Result.Top + (Math.round((Rect.Bottom - Rect.Top) * LScale) / LScale);
    if (APlaceBetweenPixels) {
      HalfPixel = 1 / (2 * LScale);
      $mod.OffsetRectEx$1(Result,HalfPixel,HalfPixel);
    };
    return Result;
  };
  this.RectFitIntoEx = function (Rect, ADesignatedArea, Ratio) {
    var Result = $mod.TRectF.$new();
    if (((ADesignatedArea.Right - ADesignatedArea.Left) <= 0) || ((ADesignatedArea.Bottom - ADesignatedArea.Top) <= 0)) {
      Ratio.set(1);
      return Rect;
    };
    if (((Rect.Right - Rect.Left) / (ADesignatedArea.Right - ADesignatedArea.Left)) > ((Rect.Bottom - Rect.Top) / (ADesignatedArea.Bottom - ADesignatedArea.Top))) {
      Ratio.set((Rect.Right - Rect.Left) / (ADesignatedArea.Right - ADesignatedArea.Left))}
     else Ratio.set((Rect.Bottom - Rect.Top) / (ADesignatedArea.Bottom - ADesignatedArea.Top));
    Result.$assign($mod.RectF(0,0,(Rect.Right - Rect.Left) / Ratio.get(),(Rect.Bottom - Rect.Top) / Ratio.get()));
    $mod.RectCenterEx$1(Result,ADesignatedArea);
    return Result;
  };
  this.RectFitIntoEx$1 = function (Rect, ADesignatedArea) {
    var Result = $mod.TRectF.$new();
    var Ratio = 0.0;
    Result.$assign($mod.RectFitIntoEx(Rect,ADesignatedArea,{get: function () {
        return Ratio;
      }, set: function (v) {
        Ratio = v;
      }}));
    return Result;
  };
  this.GetPointLength = function (Point) {
    var Result = 0.0;
    Result = Math.sqrt(pas.System.Sqr$1(Point.X) + pas.System.Sqr$1(Point.Y));
    return Result;
  };
  this.MakeRectF = function (Left, Top, Width, Height) {
    var Result = $mod.TRectF.$new();
    Result.Left = Left;
    Result.Top = Top;
    Result.Right = Left + Width;
    Result.Bottom = Top + Height;
    return Result;
  };
  this.CenterPointEx = function (R) {
    var Result = $mod.TPointF.$new();
    Result.X = ((R.Right - R.Left) / 2.0) + R.Left;
    Result.Y = ((R.Bottom - R.Top) / 2.0) + R.Top;
    return Result;
  };
  this.CompareValueEx = function (A, B, Epsilon) {
    var Result = 0;
    if (pas.Math.SameValue(A,B,Epsilon)) {
      Result = 0}
     else if (A < B) {
      Result = -1}
     else Result = 1;
    return Result;
  };
  this.RectIsEmpty = function (R) {
    var Result = false;
    Result = (R.Right < R.Left) || pas.Math.SameValue(R.Right,R.Left,0.0) || (R.Bottom < R.Top) || pas.Math.SameValue(R.Bottom,R.Top,0.0);
    return Result;
  };
  this.EmptyRect = function () {
    var Result = $mod.TRectF.$new();
    Result.$assign($mod.RectF(0,0,0,0));
    return Result;
  };
  this.RectIntersectsWithEx = function (ARect, R) {
    var Result = false;
    Result = (ARect.Left < R.Right) && (ARect.Right > R.Left) && (ARect.Top < R.Bottom) && (ARect.Bottom > R.Top);
    return Result;
  };
  this.RectF = function (Left, Top, Right, Bottom) {
    var Result = $mod.TRectF.$new();
    Result.Left = Left;
    Result.Top = Top;
    Result.Bottom = Bottom;
    Result.Right = Right;
    return Result;
  };
  this.PointF = function (X, Y) {
    var Result = $mod.TPointF.$new();
    Result.X = X;
    Result.Y = Y;
    return Result;
  };
  this.BitmapToDrawBitmap = function (ABitmap) {
    var Result = null;
    Result = null;
    if (ABitmap != null) {
      Result = ABitmap;
    };
    return Result;
  };
  this.IsBitmapEmpty = function (ABitmap) {
    var Result = false;
    var b = null;
    Result = true;
    if (ABitmap != null) {
      b = $mod.BitmapToDrawBitmap(ABitmap);
      if (b != null) {
        Result = b.Empty();
      };
    };
    return Result;
  };
  this.CharInArray = function (AChar, ACharArray) {
    var Result = false;
    var ch = "\x00";
    var I = 0;
    Result = false;
    for (var $l = 0, $end = rtl.length(ACharArray) - 1; $l <= $end; $l++) {
      I = $l;
      ch = ACharArray[I];
      if (ch === AChar) {
        Result = true;
        return Result;
      };
    };
    return Result;
  };
  this.CharIsNumber = function (AChar) {
    var Result = false;
    Result = AChar.charCodeAt() in rtl.createSet(null,48,57);
    return Result;
  };
  this.CharIsLetter = function (AChar) {
    var Result = false;
    Result = (AChar.charCodeAt() in rtl.createSet(null,97,122)) || (AChar.charCodeAt() in rtl.createSet(null,65,90));
    return Result;
  };
  this.CharIsHex = function (AChar) {
    var Result = false;
    Result = (AChar.charCodeAt() in rtl.createSet(null,48,57)) || (AChar.charCodeAt() in rtl.createSet(null,97,102)) || (AChar.charCodeAt() in rtl.createSet(null,65,70));
    return Result;
  };
  this.CharIsLetterOrNumber = function (AChar) {
    var Result = false;
    Result = $mod.CharIsLetter(AChar) || $mod.CharIsNumber(AChar);
    return Result;
  };
  this.VarToStr = function (S) {
    var Result = "";
    Result = S;
    return Result;
  };
  this.VarToDateTime = function (S) {
    var Result = 0.0;
    Result = pas.SysUtils.StrToDateTime(S);
    return Result;
  };
  this.AnsiPos = function (Substr, S) {
    var Result = 0;
    Result = pas.System.Pos(Substr,S);
    return Result;
  };
  this.AnsiUpperCase = function (S) {
    var Result = "";
    Result = pas.SysUtils.UpperCase(S);
    return Result;
  };
  this.AnsiLowerCase = function (S) {
    var Result = "";
    Result = pas.SysUtils.LowerCase(S);
    return Result;
  };
  this.HInstance = function () {
    var Result = 0;
    Result = 0;
    return Result;
  };
  this.CreateNewGUID = function () {
    var Result = "";
    var g = pas.System.TGuid.$new();
    pas.SysUtils.CreateGUID(g);
    Result = pas.SysUtils.GUIDToString(g);
    return Result;
  };
},["WEBLib.TMSFNCUtils","WEBLib.TMSFNCPersistence","JS"]);
rtl.module("WEBLib.TMSFNCGraphicsTypes",["System","Classes","Types","WEBLib.TMSFNCTypes","WEBLib.Graphics"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.FPC_FULLVERSION = 0;
  this.PathScale = 1E-4;
  this.PathFontSize = 1E-2;
  this.PathPosition = 1E-3;
  this.PathAngle = 1E-4;
  this.gcAliceblue = 0xFFF8F0;
  this.gcAntiquewhite = 0xD7EBFA;
  this.gcAqua = 0xFFFF00;
  this.gcAquamarine = 0xD4FF7F;
  this.gcAzure = 0xFFFFF0;
  this.gcBeige = 0xDCF5F5;
  this.gcBisque = 0xC4E4FF;
  this.gcBlack = 0x0;
  this.gcBlanchedalmond = 0xCDEBFF;
  this.gcBlue = 0xFF0000;
  this.gcBlueviolet = 0xE22B8A;
  this.gcBrown = 0x2A2AA5;
  this.gcBurlywood = 0x87B8DE;
  this.gcCadetblue = 0xA09E5F;
  this.gcChartreuse = 0xFF7F;
  this.gcChocolate = 0x1E69D2;
  this.gcCoral = 0x507FFF;
  this.gcCornflowerblue = 0xED9564;
  this.gcCornsilk = 0xDCF8FF;
  this.gcCrimson = 0x3C14DC;
  this.gcCyan = 0xFFFF00;
  this.gcDarkblue = 0x8B0000;
  this.gcDarkcyan = 0x8B8B00;
  this.gcDarkgoldenrod = 0xB86B8;
  this.gcDarkgray = 0xA9A9A9;
  this.gcDarkgreen = 0x6400;
  this.gcDarkgrey = 0xA9A9A9;
  this.gcDarkkhaki = 0x6BB7BD;
  this.gcDarkmagenta = 0x8B008B;
  this.gcDarkolivegreen = 0x2F6B55;
  this.gcDarkorange = 0x8CFF;
  this.gcDarkorchid = 0xCC3299;
  this.gcDarkred = 0x8B;
  this.gcDarksalmon = 0x7A96E9;
  this.gcDarkseagreen = 0x8FBC8F;
  this.gcDarkslateblue = 0x8B3D48;
  this.gcDarkslategray = 0x4F4F2F;
  this.gcDarkslategrey = 0x4F4F2F;
  this.gcDarkturquoise = 0xD1CE00;
  this.gcDarkviolet = 0xD30094;
  this.gcDeeppink = 0x9314FF;
  this.gcDeepskyblue = 0xFFBF00;
  this.gcDimgray = 0x696969;
  this.gcDimgrey = 0x696969;
  this.gcDodgerblue = 0xFF901E;
  this.gcFirebrick = 0x2222B2;
  this.gcFloralwhite = 0xF0FAFF;
  this.gcForestgreen = 0x228B22;
  this.gcFuchsia = 0xFF00FF;
  this.gcGainsboro = 0xDCDCDC;
  this.gcGhostwhite = 0xFFF8F8;
  this.gcGold = 0xD7FF;
  this.gcGoldenrod = 0x20A5DA;
  this.gcGray = 0x808080;
  this.gcGreen = 0x8000;
  this.gcGreenyellow = 0x2FFFAD;
  this.gcGrey = 0x808080;
  this.gcHoneydew = 0xF0FFF0;
  this.gcHotpink = 0xB469FF;
  this.gcIndianred = 0x5C5CCD;
  this.gcIndigo = 0x82004B;
  this.gcIvory = 0xF0FFFF;
  this.gcKhaki = 0x8CE6F0;
  this.gcLavender = 0xFAE6E6;
  this.gcLavenderblush = 0xF5F0FF;
  this.gcLawngreen = 0xFC7C;
  this.gcLemonchiffon = 0xCDFAFF;
  this.gcLightblue = 0xE6D8AD;
  this.gcLightcoral = 0x8080F0;
  this.gcLightcyan = 0xFFFFE0;
  this.gcLightgoldenrodyellow = 0xD2FAFA;
  this.gcLightgray = 0xD3D3D3;
  this.gcLightgreen = 0x90EE90;
  this.gcLightgrey = 0xD3D3D3;
  this.gcLightpink = 0xC1B6FF;
  this.gcLightsalmon = 0x7AA0FF;
  this.gcLightseagreen = 0xAAB220;
  this.gcLightskyblue = 0xFACE87;
  this.gcLightslategray = 0x998877;
  this.gcLightslategrey = 0x998877;
  this.gcLightsteelblue = 0xDEC4B0;
  this.gcLightyellow = 0xE0FFFF;
  this.gcLtGray = 0xC0C0C0;
  this.gcMedGray = 0xA4A0A0;
  this.gcDkGray = 0x808080;
  this.gcMoneyGreen = 0xC0DCC0;
  this.gcLegacySkyBlue = 0xF0CAA6;
  this.gcCream = 0xF0FBFF;
  this.gcLime = 0xFF00;
  this.gcLimegreen = 0x32CD32;
  this.gcLinen = 0xE6F0FA;
  this.gcMagenta = 0xFF00FF;
  this.gcMaroon = 0x80;
  this.gcMediumaquamarine = 0xAACD66;
  this.gcMediumblue = 0xCD0000;
  this.gcMediumorchid = 0xD355BA;
  this.gcMediumpurple = 0xDB7093;
  this.gcMediumseagreen = 0x71B33C;
  this.gcMediumslateblue = 0xEE687B;
  this.gcMediumspringgreen = 0x9AFA00;
  this.gcMediumturquoise = 0xCCD148;
  this.gcMediumvioletred = 0x8515C7;
  this.gcMidnightblue = 0x701919;
  this.gcMintcream = 0xFAFFF5;
  this.gcMistyrose = 0xE1E4FF;
  this.gcMoccasin = 0xB5E4FF;
  this.gcNavajowhite = 0xADDEFF;
  this.gcNavy = 0x800000;
  this.gcOldlace = 0xE6F5FD;
  this.gcOlive = 0x8080;
  this.gcOlivedrab = 0x238E6B;
  this.gcOrange = 0xA5FF;
  this.gcOrangered = 0x45FF;
  this.gcOrchid = 0xD670DA;
  this.gcPalegoldenrod = 0xAAE8EE;
  this.gcPalegreen = 0x98FB98;
  this.gcPaleturquoise = 0xEEEEAF;
  this.gcPalevioletred = 0x9370DB;
  this.gcPapayawhip = 0xD5EFFF;
  this.gcPeachpuff = 0xB9DAFF;
  this.gcPeru = 0x3F85CD;
  this.gcPink = 0xCBC0FF;
  this.gcPlum = 0xDDA0DD;
  this.gcPowderblue = 0xE6E0B0;
  this.gcPurple = 0x800080;
  this.gcRed = 0xFF;
  this.gcRosybrown = 0x8F8FBC;
  this.gcRoyalblue = 0xE16941;
  this.gcSaddlebrown = 0x13458B;
  this.gcSalmon = 0x7280FA;
  this.gcSandybrown = 0x60A4F4;
  this.gcSeagreen = 0x578B2E;
  this.gcSeashell = 0xEEF5FF;
  this.gcSienna = 0x2D52A0;
  this.gcSilver = 0xC0C0C0;
  this.gcSkyblue = 0xEBCE87;
  this.gcSlateblue = 0xCD5A6A;
  this.gcSlategray = 0x908070;
  this.gcSlategrey = 0x908070;
  this.gcSnow = 0xFAFAFF;
  this.gcSpringgreen = 0x7FFF00;
  this.gcSteelblue = 0xB48246;
  this.gcTan = 0x8CB4D2;
  this.gcTeal = 0x808000;
  this.gcThistle = 0xD8BFD8;
  this.gcTomato = 0x4763FF;
  this.gcTurquoise = 0xD0E040;
  this.gcViolet = 0xEE82EE;
  this.gcWheat = 0xB3DEF5;
  this.gcWhite = 0xFFFFFF;
  this.gcWhitesmoke = 0xF5F5F5;
  this.gcYellow = 0xFFFF;
  this.gcYellowgreen = 0x32CD9A;
  this.gcNull = -1;
  rtl.recNewT(this,"TTMSFNCGraphicsColorEntry",function () {
    this.Value = 0;
    this.Name = "";
    this.$eq = function (b) {
      return (this.Value === b.Value) && (this.Name === b.Name);
    };
    this.$assign = function (s) {
      this.Value = s.Value;
      this.Name = s.Name;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCGraphicsColorEntry",{},this);
    $r.addField("Value",pas["WEBLib.Graphics"].$rtti["TColor"]);
    $r.addField("Name",rtl.string);
  });
  this.TMSFNCGraphicsColorCount = 154;
  this.TTMSFNCGraphicsStrokeKind = {"0": "gskNone", gskNone: 0, "1": "gskSolid", gskSolid: 1, "2": "gskDash", gskDash: 2, "3": "gskDot", gskDot: 3, "4": "gskDashDot", gskDashDot: 4, "5": "gskDashDotDot", gskDashDotDot: 5};
  this.$rtti.$Enum("TTMSFNCGraphicsStrokeKind",{minvalue: 0, maxvalue: 5, ordtype: 1, enumtype: this.TTMSFNCGraphicsStrokeKind});
  this.TTMSFNCGraphicsTextureMode = {"0": "gtmOriginal", gtmOriginal: 0, "1": "gtmFit", gtmFit: 1, "2": "gtmStretch", gtmStretch: 2, "3": "gtmCenter", gtmCenter: 3, "4": "gtmTile", gtmTile: 4};
  this.$rtti.$Enum("TTMSFNCGraphicsTextureMode",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TTMSFNCGraphicsTextureMode});
  this.TTMSFNCGraphicsFillKind = {"0": "gfkNone", gfkNone: 0, "1": "gfkSolid", gfkSolid: 1, "2": "gfkGradient", gfkGradient: 2, "3": "gfkTexture", gfkTexture: 3};
  this.$rtti.$Enum("TTMSFNCGraphicsFillKind",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TTMSFNCGraphicsFillKind});
  this.TTMSFNCGraphicsFillGradientMode = {"0": "gfgmDefault", gfgmDefault: 0, "1": "gfgmCollection", gfgmCollection: 1};
  this.$rtti.$Enum("TTMSFNCGraphicsFillGradientMode",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCGraphicsFillGradientMode});
  this.TTMSFNCGraphicsFillGradientType = {"0": "gfgtLinear", gfgtLinear: 0, "1": "gfgtRadial", gfgtRadial: 1};
  this.$rtti.$Enum("TTMSFNCGraphicsFillGradientType",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCGraphicsFillGradientType});
  this.TTMSFNCGraphicsFillOrientation = {"0": "gfoHorizontal", gfoHorizontal: 0, "1": "gfoVertical", gfoVertical: 1, "2": "gfoCustom", gfoCustom: 2};
  this.$rtti.$Enum("TTMSFNCGraphicsFillOrientation",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCGraphicsFillOrientation});
  this.TTMSFNCGraphicsTextAlign = {"0": "gtaCenter", gtaCenter: 0, "1": "gtaLeading", gtaLeading: 1, "2": "gtaTrailing", gtaTrailing: 2};
  this.$rtti.$Enum("TTMSFNCGraphicsTextAlign",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCGraphicsTextAlign});
  this.TTMSFNCGraphicsTextTrimming = {"0": "gttNone", gttNone: 0, "1": "gttCharacter", gttCharacter: 1, "2": "gttWord", gttWord: 2};
  this.$rtti.$Enum("TTMSFNCGraphicsTextTrimming",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCGraphicsTextTrimming});
  this.TTMSFNCGraphicsSide = {"0": "gsLeft", gsLeft: 0, "1": "gsTop", gsTop: 1, "2": "gsRight", gsRight: 2, "3": "gsBottom", gsBottom: 3};
  this.$rtti.$Enum("TTMSFNCGraphicsSide",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TTMSFNCGraphicsSide});
  this.$rtti.$Set("TTMSFNCGraphicsSides",{comptype: this.$rtti["TTMSFNCGraphicsSide"]});
  this.TTMSFNCGraphicsTextQuality = {"0": "gtqDefault", gtqDefault: 0, "1": "gtqAntiAliasing", gtqAntiAliasing: 1, "2": "gtqClearType", gtqClearType: 2};
  this.$rtti.$Enum("TTMSFNCGraphicsTextQuality",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCGraphicsTextQuality});
  this.AllSides = rtl.createSet(this.TTMSFNCGraphicsSide.gsLeft,this.TTMSFNCGraphicsSide.gsTop,this.TTMSFNCGraphicsSide.gsRight,this.TTMSFNCGraphicsSide.gsBottom);
  this.Epsilon = 1E-40;
  rtl.recNewT(this,"TTMSFNCGraphicsMatrix",function () {
    this.m11 = 0.0;
    this.m12 = 0.0;
    this.m13 = 0.0;
    this.m21 = 0.0;
    this.m22 = 0.0;
    this.m23 = 0.0;
    this.m31 = 0.0;
    this.m32 = 0.0;
    this.m33 = 0.0;
    this.$eq = function (b) {
      return (this.m11 === b.m11) && (this.m12 === b.m12) && (this.m13 === b.m13) && (this.m21 === b.m21) && (this.m22 === b.m22) && (this.m23 === b.m23) && (this.m31 === b.m31) && (this.m32 === b.m32) && (this.m33 === b.m33);
    };
    this.$assign = function (s) {
      this.m11 = s.m11;
      this.m12 = s.m12;
      this.m13 = s.m13;
      this.m21 = s.m21;
      this.m22 = s.m22;
      this.m23 = s.m23;
      this.m31 = s.m31;
      this.m32 = s.m32;
      this.m33 = s.m33;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCGraphicsMatrix",{},this);
    $r.addField("m11",rtl.double);
    $r.addField("m12",rtl.double);
    $r.addField("m13",rtl.double);
    $r.addField("m21",rtl.double);
    $r.addField("m22",rtl.double);
    $r.addField("m23",rtl.double);
    $r.addField("m31",rtl.double);
    $r.addField("m32",rtl.double);
    $r.addField("m33",rtl.double);
  });
  this.$rtti.$Class("TTMSFNCGraphicsStroke");
  this.$rtti.$Class("TTMSFNCGraphicsFill");
  this.$rtti.$Class("TTMSFNCGraphicsFont");
  rtl.createClass(this,"TTMSFNCGraphicsSaveState",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FSaveDC = 0;
      this.FFont = null;
      this.FStroke = null;
      this.FFill = null;
      this.FCustomSaveDC = 0;
    };
    this.$final = function () {
      this.FFont = undefined;
      this.FStroke = undefined;
      this.FFill = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetStroke = function (Value) {
      this.FStroke.Assign(Value);
    };
    this.SetFill = function (Value) {
      this.FFill.Assign(Value);
    };
    this.SetFont = function (Value) {
      this.FFont.AssignSource(Value);
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FFill = $mod.TTMSFNCGraphicsFill.$create("Create$1",[$mod.TTMSFNCGraphicsFillKind.gfkSolid,16777215,8421504,-1,-1]);
      this.FStroke = $mod.TTMSFNCGraphicsStroke.$create("Create$1",[$mod.TTMSFNCGraphicsStrokeKind.gskSolid,12632256,1.0]);
      this.FFont = $mod.TTMSFNCGraphicsFont.$create("Create$2");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FFill");
      rtl.free(this,"FStroke");
      rtl.free(this,"FFont");
      pas.System.TObject.Destroy.call(this);
    };
  });
  rtl.createClass(this,"TTMSFNCGraphicsFillGradientItem",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FColor = 0;
      this.FPosition = 0.0;
      this.FOpacity = 0.0;
    };
    this.IsPositionStored = function () {
      var Result = false;
      Result = this.FPosition !== 0.0;
      return Result;
    };
    this.SetColor = function (Value) {
      rtl.rc(Value,-9007199254740991,9007199254740991);
      if (this.FColor !== Value) {
        this.FColor = rtl.rc(Value,-9007199254740991,9007199254740991);
        this.UpdateGradient();
      };
    };
    this.SetPosition = function (Value) {
      if (this.FPosition !== Value) {
        this.FPosition = Value;
        this.UpdateGradient();
      };
    };
    this.IsOpacityStored = function () {
      var Result = false;
      Result = this.FOpacity !== 1.0;
      return Result;
    };
    this.SetOpacity = function (Value) {
      if (this.FOpacity !== Value) {
        this.FOpacity = Value;
        this.UpdateGradient();
      };
    };
    this.UpdateGradient = function () {
      if ($mod.TTMSFNCGraphicsFillGradientItems.isPrototypeOf(this.FCollection)) rtl.as(this.FCollection,$mod.TTMSFNCGraphicsFillGradientItems).UpdateGradient();
    };
    this.Create$1 = function (ACollection) {
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      this.FColor = 16777215;
      this.FPosition = 0.0;
      this.FOpacity = 1.0;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCGraphicsFillGradientItem.isPrototypeOf(Source)) {
        this.FColor = rtl.rc(rtl.as(Source,$mod.TTMSFNCGraphicsFillGradientItem).FColor,-9007199254740991,9007199254740991);
        this.FOpacity = rtl.as(Source,$mod.TTMSFNCGraphicsFillGradientItem).FOpacity;
        this.FPosition = rtl.as(Source,$mod.TTMSFNCGraphicsFillGradientItem).FPosition;
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    var $r = this.$rtti;
    $r.addProperty("Opacity",14,rtl.double,"FOpacity","SetOpacity",4,{stored: "IsOpacityStored"});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor",4,{Default: 16777215});
    $r.addProperty("Position",14,rtl.double,"FPosition","SetPosition",4,{stored: "IsPositionStored"});
  });
  this.$rtti.$Class("TTMSFNCCustomGraphicsFill");
  rtl.createClass(this,"TTMSFNCGraphicsFillGradientItems",pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$init.call(this);
      this.FOwner$1 = null;
    };
    this.$final = function () {
      this.FOwner$1 = undefined;
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$final.call(this);
    };
    this.GetItemEx = function (Index) {
      rtl.rc(Index,-2147483648,2147483647);
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItemEx = function (Index, Value) {
      rtl.rc(Index,-2147483648,2147483647);
      pas.Classes.TCollection.SetItem.call(this,Index,Value);
    };
    this.UpdateGradient = function () {
      if (this.FOwner$1 != null) this.FOwner$1.Changed();
    };
    this.GetGradientClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCGraphicsFillGradientItem;
      return Result;
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,this.GetGradientClass());
      this.FOwner$1 = AOwner;
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (index) {
      rtl.rc(index,-2147483648,2147483647);
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,index);
      return Result;
    };
  });
  rtl.createClass(this,"TTMSFNCCustomGraphicsFill",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FUpdateCount = 0;
      this.FOnChanged = null;
      this.FOrientation = 0;
      this.FKind = 0;
      this.FDefaultKind = 0;
      this.FColor = 0;
      this.FDefaultColor = 0;
      this.FColorTo = 0;
      this.FColorMirror = 0;
      this.FColorMirrorTo = 0;
      this.FDefaultColorTo = 0;
      this.FDefaultColorMirror = 0;
      this.FDefaultColorMirrorTo = 0;
      this.FOpacity = 0.0;
      this.FTexture = null;
      this.FTextureMode = 0;
      this.FGradientMode = 0;
      this.FGradientItems = null;
      this.FGradientType = 0;
      this.FGradientAngle = 0.0;
      this.FGradientCenterPoint = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      this.FGradientCenterColor = 0;
      this.FGradientMatrix = $mod.TTMSFNCGraphicsMatrix.$new();
    };
    this.$final = function () {
      this.FOnChanged = undefined;
      this.FTexture = undefined;
      this.FGradientItems = undefined;
      this.FGradientCenterPoint = undefined;
      this.FGradientMatrix = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetKind = function (Value) {
      rtl.rc(Value,0,3);
      if (this.FKind !== Value) {
        this.FKind = rtl.rc(Value,0,3);
        this.Changed();
      };
    };
    this.SetOrientation = function (Value) {
      rtl.rc(Value,0,2);
      if (this.FOrientation !== Value) {
        this.FOrientation = rtl.rc(Value,0,2);
        this.Changed();
      };
    };
    this.SetColor = function (Value) {
      rtl.rc(Value,-9007199254740991,9007199254740991);
      if (this.FColor !== Value) {
        this.FColor = rtl.rc(Value,-9007199254740991,9007199254740991);
        if (this.FColor === -1) {
          this.FColor = -1}
         else if (this.FColor === 536870912) this.FColor = 15790320;
        this.Changed();
      };
    };
    this.SetColorTo = function (Value) {
      rtl.rc(Value,-9007199254740991,9007199254740991);
      if (this.FColorTo !== Value) {
        this.FColorTo = rtl.rc(Value,-9007199254740991,9007199254740991);
        if (this.FColorTo === -1) {
          this.FColorTo = -1}
         else if (this.FColorTo === 536870912) this.FColorTo = 15790320;
        this.Changed();
      };
    };
    this.SetColorMirror = function (Value) {
      rtl.rc(Value,-9007199254740991,9007199254740991);
      if (this.FColorMirror !== Value) {
        this.FColorMirror = rtl.rc(Value,-9007199254740991,9007199254740991);
        if (this.FColorMirror === -1) {
          this.FColorMirror = -1}
         else if (this.FColorMirror === 536870912) this.FColorMirror = 15790320;
        this.Changed();
      };
    };
    this.SetColorMirrorTo = function (Value) {
      rtl.rc(Value,-9007199254740991,9007199254740991);
      if (this.FColorMirrorTo !== Value) {
        this.FColorMirrorTo = rtl.rc(Value,-9007199254740991,9007199254740991);
        if (this.FColorMirrorTo === -1) {
          this.FColorMirrorTo = -1}
         else if (this.FColorMirrorTo === 536870912) this.FColorMirrorTo = 15790320;
        this.Changed();
      };
    };
    this.SetOpacity = function (Value) {
      if (this.FOpacity !== Value) {
        this.FOpacity = Value;
        this.Changed();
      };
    };
    this.IsOpacityStored = function () {
      var Result = false;
      Result = this.FOpacity !== 1;
      return Result;
    };
    this.SetTexture = function (Value) {
      if (this.FTexture !== Value) {
        this.FTexture.Assign(Value);
        this.Changed();
      };
    };
    this.SetTextureMode = function (Value) {
      rtl.rc(Value,0,4);
      if (this.FTextureMode !== Value) {
        this.FTextureMode = rtl.rc(Value,0,4);
        this.Changed();
      };
    };
    this.SetGradientItems = function (Value) {
      this.FGradientItems.Assign(Value);
    };
    this.SetGradientMode = function (Value) {
      rtl.rc(Value,0,1);
      if (this.FGradientMode !== Value) {
        this.FGradientMode = rtl.rc(Value,0,1);
        this.Changed();
      };
    };
    this.SetGradientType = function (Value) {
      rtl.rc(Value,0,1);
      if (this.FGradientType !== Value) {
        this.FGradientType = rtl.rc(Value,0,1);
        this.Changed();
      };
    };
    this.IsGradientAngleStored = function () {
      var Result = false;
      Result = this.FGradientAngle !== 0;
      return Result;
    };
    this.SetGradientAngle = function (Value) {
      if (this.FGradientAngle !== Value) {
        this.FGradientAngle = Value;
        this.Changed();
      };
    };
    this.SetGradientCenterPoint = function (Value) {
      this.FGradientCenterPoint.$assign(Value);
      this.Changed();
    };
    this.SetGradientCenterColor = function (Value) {
      rtl.rc(Value,-9007199254740991,9007199254740991);
      if (this.FGradientCenterColor !== Value) {
        this.FGradientCenterColor = rtl.rc(Value,-9007199254740991,9007199254740991);
        this.Changed();
      };
    };
    this.IsColorStored = function () {
      var Result = false;
      Result = this.FColor !== this.FDefaultColor;
      return Result;
    };
    this.IsKindStored = function () {
      var Result = false;
      Result = this.FKind !== this.FDefaultKind;
      return Result;
    };
    this.IsColorMirrorStored = function () {
      var Result = false;
      Result = this.FColorMirror !== this.FDefaultColorMirror;
      return Result;
    };
    this.IsColorMirrorToStored = function () {
      var Result = false;
      Result = this.FColorMirrorTo !== this.FDefaultColorMirrorTo;
      return Result;
    };
    this.IsColorToStored = function () {
      var Result = false;
      Result = this.FColorTo !== this.FDefaultColorTo;
      return Result;
    };
    this.Changed = function () {
      if ((this.FOnChanged != null) && (this.FUpdateCount === 0)) this.FOnChanged(this);
    };
    this.TextureChanged = function (Sender) {
      this.Changed();
    };
    this.Create$1 = function (AKind, AColor, AColorTo, AColorMirror, AColorMirrorTo) {
      rtl.rc(AKind,0,3);
      rtl.rc(AColor,-9007199254740991,9007199254740991);
      rtl.rc(AColorTo,-9007199254740991,9007199254740991);
      rtl.rc(AColorMirror,-9007199254740991,9007199254740991);
      rtl.rc(AColorMirrorTo,-9007199254740991,9007199254740991);
      this.FGradientItems = $mod.TTMSFNCGraphicsFillGradientItems.$create("Create$3",[this]);
      this.FKind = rtl.rc(AKind,0,3);
      this.FDefaultKind = rtl.rc(AKind,0,3);
      this.FGradientMatrix.$assign($mod.MatrixIdentity());
      this.FGradientCenterColor = -1;
      this.FGradientMode = rtl.rc($mod.TTMSFNCGraphicsFillGradientMode.gfgmDefault,0,1);
      this.FGradientAngle = 0.0;
      this.FGradientCenterPoint.$assign(pas["WEBLib.TMSFNCTypes"].PointF(0,0));
      this.FGradientType = rtl.rc($mod.TTMSFNCGraphicsFillGradientType.gfgtLinear,0,1);
      this.FColor = rtl.rc(AColor,-9007199254740991,9007199254740991);
      this.FDefaultColor = rtl.rc(AColor,-9007199254740991,9007199254740991);
      this.FOpacity = 1;
      this.FOrientation = rtl.rc($mod.TTMSFNCGraphicsFillOrientation.gfoVertical,0,2);
      this.FColorTo = rtl.rc(AColorTo,-9007199254740991,9007199254740991);
      this.FColorMirror = rtl.rc(AColorMirror,-9007199254740991,9007199254740991);
      this.FColorMirrorTo = rtl.rc(AColorMirrorTo,-9007199254740991,9007199254740991);
      this.FDefaultColorTo = rtl.rc(AColorTo,-9007199254740991,9007199254740991);
      this.FDefaultColorMirror = rtl.rc(AColorMirror,-9007199254740991,9007199254740991);
      this.FDefaultColorMirrorTo = rtl.rc(AColorMirrorTo,-9007199254740991,9007199254740991);
      this.FTextureMode = rtl.rc($mod.TTMSFNCGraphicsTextureMode.gtmStretch,0,4);
      this.FTexture = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      this.FTexture.FOnChange = rtl.createCallback(this,"TextureChanged");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FTexture");
      rtl.free(this,"FGradientItems");
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCCustomGraphicsFill.isPrototypeOf(Source)) {
        this.FColor = rtl.rc(rtl.as(Source,$mod.TTMSFNCCustomGraphicsFill).FColor,-9007199254740991,9007199254740991);
        this.FColorTo = rtl.rc(rtl.as(Source,$mod.TTMSFNCCustomGraphicsFill).FColorTo,-9007199254740991,9007199254740991);
        this.FColorMirror = rtl.rc(rtl.as(Source,$mod.TTMSFNCCustomGraphicsFill).FColorMirror,-9007199254740991,9007199254740991);
        this.FColorMirrorTo = rtl.rc(rtl.as(Source,$mod.TTMSFNCCustomGraphicsFill).FColorMirrorTo,-9007199254740991,9007199254740991);
        this.FKind = rtl.rc(rtl.as(Source,$mod.TTMSFNCCustomGraphicsFill).FKind,0,3);
        this.FOrientation = rtl.rc(rtl.as(Source,$mod.TTMSFNCCustomGraphicsFill).FOrientation,0,2);
        this.FOpacity = rtl.as(Source,$mod.TTMSFNCCustomGraphicsFill).FOpacity;
        this.FTexture.Assign(rtl.as(Source,$mod.TTMSFNCCustomGraphicsFill).FTexture);
        this.FTextureMode = rtl.rc(rtl.as(Source,$mod.TTMSFNCCustomGraphicsFill).FTextureMode,0,4);
        this.FGradientMode = rtl.rc(rtl.as(Source,$mod.TTMSFNCCustomGraphicsFill).FGradientMode,0,1);
        this.FGradientAngle = rtl.as(Source,$mod.TTMSFNCCustomGraphicsFill).FGradientAngle;
        this.FGradientCenterPoint.$assign(rtl.as(Source,$mod.TTMSFNCCustomGraphicsFill).FGradientCenterPoint);
        this.FGradientItems.Assign(rtl.as(Source,$mod.TTMSFNCCustomGraphicsFill).FGradientItems);
        this.FGradientType = rtl.rc(rtl.as(Source,$mod.TTMSFNCCustomGraphicsFill).FGradientType,0,1);
        this.FGradientCenterColor = rtl.rc(rtl.as(Source,$mod.TTMSFNCCustomGraphicsFill).FGradientCenterColor,-9007199254740991,9007199254740991);
      } else if ($mod.TTMSFNCCustomGraphicsStroke.isPrototypeOf(Source)) {
        this.FColor = rtl.rc(rtl.as(Source,$mod.TTMSFNCCustomGraphicsStroke).FColor,-9007199254740991,9007199254740991);
        this.FColorTo = -1;
        this.FColorMirror = -1;
        this.FColorMirrorTo = -1;
        this.FKind = rtl.rc($mod.TTMSFNCGraphicsFillKind.gfkSolid,0,3);
        this.FOrientation = rtl.rc($mod.TTMSFNCGraphicsFillOrientation.gfoVertical,0,2);
        this.FOpacity = 1;
      };
      this.Changed();
    };
    this.BeginUpdate = function () {
      this.FUpdateCount += 1;
    };
    this.EndUpdate = function () {
      this.FUpdateCount -= 1;
      this.Changed();
    };
    this.ClearGradientItems = function () {
      this.FGradientItems.Clear();
    };
    this.AddGradientItem = function (AColor, APosition, AOpacity) {
      rtl.rc(AColor,-9007199254740991,9007199254740991);
      var Result = null;
      Result = this.FGradientItems.Add$1();
      Result.SetColor(AColor);
      Result.SetPosition(APosition);
      Result.SetOpacity(AOpacity);
      return Result;
    };
  });
  rtl.createClass(this,"TTMSFNCGraphicsFill",this.TTMSFNCCustomGraphicsFill,function () {
    var $r = this.$rtti;
    $r.addProperty("OnChanged",0,pas.Classes.$rtti["TNotifyEvent"],"FOnChanged","FOnChanged");
    $r.addProperty("Kind",14,$mod.$rtti["TTMSFNCGraphicsFillKind"],"FKind","SetKind",4,{stored: "IsKindStored"});
    $r.addProperty("Orientation",2,$mod.$rtti["TTMSFNCGraphicsFillOrientation"],"FOrientation","SetOrientation",4,{Default: $mod.TTMSFNCGraphicsFillOrientation.gfoVertical});
    $r.addProperty("Color",14,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor",4,{stored: "IsColorStored"});
    $r.addProperty("ColorTo",14,pas["WEBLib.Graphics"].$rtti["TColor"],"FColorTo","SetColorTo",4,{stored: "IsColorToStored"});
    $r.addProperty("ColorMirror",14,pas["WEBLib.Graphics"].$rtti["TColor"],"FColorMirror","SetColorMirror",4,{stored: "IsColorMirrorStored"});
    $r.addProperty("ColorMirrorTo",14,pas["WEBLib.Graphics"].$rtti["TColor"],"FColorMirrorTo","SetColorMirrorTo",4,{stored: "IsColorMirrorToStored"});
    $r.addProperty("TextureMode",2,$mod.$rtti["TTMSFNCGraphicsTextureMode"],"FTextureMode","SetTextureMode",4,{Default: $mod.TTMSFNCGraphicsTextureMode.gtmStretch});
    $r.addProperty("Texture",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FTexture","SetTexture");
  });
  rtl.createClass(this,"TTMSFNCGraphicsFont",pas["WEBLib.Graphics"].TFont,function () {
    this.$init = function () {
      pas["WEBLib.Graphics"].TFont.$init.call(this);
      this.FUpdateCount = 0;
      this.FOnChanged = null;
    };
    this.$final = function () {
      this.FOnChanged = undefined;
      pas["WEBLib.Graphics"].TFont.$final.call(this);
    };
    this.DoChanged = function (Sender) {
      if ((this.FOnChanged != null) && (this.FUpdateCount === 0)) this.FOnChanged(this);
    };
    this.Create$2 = function () {
      pas["WEBLib.Graphics"].TFont.Create$1.call(this);
      this.SetHeight(-12);
      this.FOnChange = rtl.createCallback(this,"DoChanged");
      return this;
    };
    this.Assign = function (Source) {
      pas["WEBLib.Graphics"].TFont.Assign.call(this,Source);
      this.DoChanged(this);
    };
    this.AssignSource = function (Source) {
      this.Assign(Source);
    };
    this.BeginUpdate = function () {
      this.FUpdateCount += 1;
    };
    this.EndUpdate = function () {
      this.FUpdateCount -= 1;
      this.DoChanged(this);
    };
  });
  this.TTMSFNCAppearanceGlobalFontType = {"0": "aftNone", aftNone: 0, "1": "aftColor", aftColor: 1, "2": "aftSize", aftSize: 2, "3": "aftName", aftName: 3, "4": "aftScale", aftScale: 4, "5": "aftStyle", aftStyle: 5};
  this.$rtti.$Enum("TTMSFNCAppearanceGlobalFontType",{minvalue: 0, maxvalue: 5, ordtype: 1, enumtype: this.TTMSFNCAppearanceGlobalFontType});
  rtl.createInterface(this,"ITMSFNCAppearanceGlobalFont","{85CF4F6B-3FF9-4CB7-AD6A-7FC477ED5462}",["SetFonts"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("SetFonts",0,[["ASetType",$mod.$rtti["TTMSFNCAppearanceGlobalFontType"]]]);
  });
  rtl.createClass(this,"TTMSFNCAppearanceGlobalFont",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FOwner = null;
      this.FColor = 0;
      this.FSize = 0.0;
      this.FName = "";
      this.FScale = 0.0;
      this.FOldScale = 0.0;
      this.FStyle = {};
    };
    this.$final = function () {
      this.FOwner = undefined;
      this.FStyle = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetColor = function (Value) {
      rtl.rc(Value,-9007199254740991,9007199254740991);
      if (this.FColor !== Value) {
        this.FColor = rtl.rc(Value,-9007199254740991,9007199254740991);
        this.SetFonts($mod.TTMSFNCAppearanceGlobalFontType.aftColor);
      };
    };
    this.SetSize = function (Value) {
      if (this.FSize !== Value) {
        this.FSize = Value;
        this.SetFonts($mod.TTMSFNCAppearanceGlobalFontType.aftSize);
      };
    };
    this.SetName = function (Value) {
      if (this.FName !== Value) {
        this.FName = Value;
        this.SetFonts($mod.TTMSFNCAppearanceGlobalFontType.aftName);
      };
    };
    this.SetScale = function (Value) {
      if (this.FScale !== Value) {
        this.FOldScale = this.FScale;
        this.FScale = Value;
        this.SetFonts($mod.TTMSFNCAppearanceGlobalFontType.aftScale);
      };
    };
    this.SetStyle = function (Value) {
      if (rtl.neSet(this.FStyle,Value)) {
        this.FStyle = rtl.refSet(Value);
        this.SetFonts($mod.TTMSFNCAppearanceGlobalFontType.aftStyle);
      };
    };
    this.IsNameStored = function () {
      var Result = false;
      Result = this.FName !== "";
      return Result;
    };
    this.IsScaleStored = function () {
      var Result = false;
      Result = this.FScale !== 1;
      return Result;
    };
    this.IsSizeStored = function () {
      var Result = false;
      Result = this.FSize !== 0;
      return Result;
    };
    this.IsStyleStored = function () {
      var Result = false;
      Result = rtl.neSet(this.FStyle,{});
      return Result;
    };
    this.SetFonts = function (ASetType) {
      rtl.rc(ASetType,0,5);
      var fi = null;
      try {
        if (pas.SysUtils.Supports$3(this.FOwner,$mod.ITMSFNCAppearanceGlobalFont.$guid,{get: function () {
            return fi;
          }, set: function (v) {
            fi = v;
          }})) fi.SetFonts(ASetType);
      } finally {
        rtl._Release(fi);
      };
    };
    this.Create$1 = function (AOwner) {
      this.FOwner = AOwner;
      this.FColor = -1;
      this.FSize = 0;
      this.FScale = 1;
      this.FName = "";
      this.FStyle = {};
      return this;
    };
    this.Destroy = function () {
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCAppearanceGlobalFont.isPrototypeOf(Source)) {
        this.SetColor(rtl.as(Source,$mod.TTMSFNCAppearanceGlobalFont).FColor);
        this.SetSize(rtl.as(Source,$mod.TTMSFNCAppearanceGlobalFont).FSize);
        this.SetName(rtl.as(Source,$mod.TTMSFNCAppearanceGlobalFont).FName);
        this.SetScale(rtl.as(Source,$mod.TTMSFNCAppearanceGlobalFont).FScale);
        this.SetStyle(rtl.refSet(rtl.as(Source,$mod.TTMSFNCAppearanceGlobalFont).FStyle));
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    this.ApplyChange = function (AFont, ASetType) {
      rtl.rc(ASetType,0,5);
      if (AFont != null) {
        var $tmp = ASetType;
        if ($tmp === $mod.TTMSFNCAppearanceGlobalFontType.aftColor) {
          AFont.SetColor(this.FColor)}
         else if ($tmp === $mod.TTMSFNCAppearanceGlobalFontType.aftSize) {
          AFont.SetSize(Math.round(this.FSize))}
         else if ($tmp === $mod.TTMSFNCAppearanceGlobalFontType.aftName) {
          AFont.SetName(this.FName)}
         else if ($tmp === $mod.TTMSFNCAppearanceGlobalFontType.aftScale) {
          AFont.SetHeight(Math.round((AFont.FHeight * this.FScale) / this.FOldScale));
        } else if ($tmp === $mod.TTMSFNCAppearanceGlobalFontType.aftStyle) AFont.SetStyle(rtl.refSet(this.FStyle));
      };
    };
    this.GetOldScale = function () {
      var Result = 0.0;
      Result = this.FOldScale;
      return Result;
    };
    var $r = this.$rtti;
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor",4,{Default: -1});
    $r.addProperty("Size",14,rtl.double,"FSize","SetSize",4,{stored: "IsSizeStored"});
    $r.addProperty("Name",14,rtl.string,"FName","SetName",4,{stored: "IsNameStored"});
    $r.addProperty("Scale",14,rtl.double,"FScale","SetScale",4,{stored: "IsScaleStored"});
    $r.addProperty("Style",14,pas["WEBLib.Graphics"].$rtti["TFontStyles"],"FStyle","SetStyle",4,{stored: "IsStyleStored"});
  });
  rtl.createClass(this,"TTMSFNCCustomGraphicsStroke",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FUpdateCount = 0;
      this.FOnChanged = null;
      this.FKind = 0;
      this.FColor = 0;
      this.FWidth = 0.0;
      this.FOpacity = 0.0;
      this.FDefaultKind = 0;
      this.FDefaultColor = 0;
      this.FDefaultWidth = 0.0;
    };
    this.$final = function () {
      this.FOnChanged = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetKind = function (Value) {
      rtl.rc(Value,0,5);
      if (this.FKind !== Value) {
        this.FKind = rtl.rc(Value,0,5);
        this.Changed();
      };
    };
    this.SetColor = function (Value) {
      rtl.rc(Value,-9007199254740991,9007199254740991);
      if (this.FColor !== Value) {
        this.FColor = rtl.rc(Value,-9007199254740991,9007199254740991);
        if (this.FColor === -1) {
          this.FColor = -1}
         else if (this.FColor === 536870912) this.FColor = 15790320;
        this.Changed();
      };
    };
    this.SetWidth = function (Value) {
      if (this.FWidth !== Value) {
        this.FWidth = Value;
        this.Changed();
      };
    };
    this.SetOpacity = function (Value) {
      if (this.FOpacity !== Value) {
        this.FOpacity = Value;
        this.Changed();
      };
    };
    this.IsOpacityStored = function () {
      var Result = false;
      Result = this.FOpacity !== 1;
      return Result;
    };
    this.IsWidthStored = function () {
      var Result = false;
      Result = this.FWidth !== this.FDefaultWidth;
      return Result;
    };
    this.IsKindStored = function () {
      var Result = false;
      Result = this.FKind !== this.FDefaultKind;
      return Result;
    };
    this.IsColorStored = function () {
      var Result = false;
      Result = this.FColor !== this.FDefaultColor;
      return Result;
    };
    this.Changed = function () {
      if ((this.FOnChanged != null) && (this.FUpdateCount === 0)) this.FOnChanged(this);
    };
    this.Create$1 = function (AKind, AColor, AWidth) {
      rtl.rc(AKind,0,5);
      rtl.rc(AColor,-9007199254740991,9007199254740991);
      this.FKind = rtl.rc(AKind,0,5);
      this.FDefaultKind = rtl.rc(AKind,0,5);
      this.FColor = rtl.rc(AColor,-9007199254740991,9007199254740991);
      this.FDefaultColor = rtl.rc(AColor,-9007199254740991,9007199254740991);
      this.FOpacity = 1;
      this.FDefaultWidth = AWidth;
      this.FWidth = AWidth;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCCustomGraphicsStroke.isPrototypeOf(Source)) {
        this.FColor = rtl.rc(rtl.as(Source,$mod.TTMSFNCCustomGraphicsStroke).FColor,-9007199254740991,9007199254740991);
        this.FKind = rtl.rc(rtl.as(Source,$mod.TTMSFNCCustomGraphicsStroke).FKind,0,5);
        this.FOpacity = rtl.as(Source,$mod.TTMSFNCCustomGraphicsStroke).FOpacity;
        this.FWidth = rtl.as(Source,$mod.TTMSFNCCustomGraphicsStroke).FWidth;
      } else if ($mod.TTMSFNCCustomGraphicsFill.isPrototypeOf(Source)) {
        this.FColor = rtl.rc(rtl.as(Source,$mod.TTMSFNCCustomGraphicsFill).FColor,-9007199254740991,9007199254740991);
        this.FKind = rtl.rc($mod.TTMSFNCGraphicsStrokeKind.gskSolid,0,5);
        this.FOpacity = 1;
        this.FWidth = 1;
      };
      this.Changed();
    };
    this.BeginUpdate = function () {
      this.FUpdateCount += 1;
    };
    this.EndUpdate = function () {
      this.FUpdateCount -= 1;
      this.Changed();
    };
  });
  rtl.createClass(this,"TTMSFNCGraphicsStroke",this.TTMSFNCCustomGraphicsStroke,function () {
    var $r = this.$rtti;
    $r.addProperty("OnChanged",0,pas.Classes.$rtti["TNotifyEvent"],"FOnChanged","FOnChanged");
    $r.addProperty("Kind",14,$mod.$rtti["TTMSFNCGraphicsStrokeKind"],"FKind","SetKind",4,{stored: "IsKindStored"});
    $r.addProperty("Color",14,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor",4,{stored: "IsColorStored"});
    $r.addProperty("Width",14,rtl.double,"FWidth","SetWidth",4,{stored: "IsWidthStored"});
  });
  this.$rtti.$DynArray("TTMSFNCGraphicsPathPolygon",{eltype: pas["WEBLib.TMSFNCTypes"].$rtti["TPointF"]});
  this.TTMSFNCGraphicsPathPointKind = {"0": "gppMoveTo", gppMoveTo: 0, "1": "gppLineTo", gppLineTo: 1, "2": "gppCurveTo", gppCurveTo: 2, "3": "gppClose", gppClose: 3};
  this.$rtti.$Enum("TTMSFNCGraphicsPathPointKind",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TTMSFNCGraphicsPathPointKind});
  this.TTMSFNCGraphicsPathCubicBezier$clone = function (a) {
    var b = [];
    b.length = 4;
    for (var c = 0; c < 4; c++) b[c] = pas["WEBLib.TMSFNCTypes"].TPointF.$clone(a[c]);
    return b;
  };
  this.$rtti.$StaticArray("TTMSFNCGraphicsPathCubicBezier",{dims: [4], eltype: pas["WEBLib.TMSFNCTypes"].$rtti["TPointF"]});
  rtl.recNewT(this,"TTMSFNCGraphicsPathPoint",function () {
    this.Kind = 0;
    this.$new = function () {
      var r = Object.create(this);
      r.Point = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      return r;
    };
    this.$eq = function (b) {
      return (this.Kind === b.Kind) && this.Point.$eq(b.Point);
    };
    this.$assign = function (s) {
      this.Kind = s.Kind;
      this.Point.$assign(s.Point);
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCGraphicsPathPoint",{},this);
    $r.addField("Kind",$mod.$rtti["TTMSFNCGraphicsPathPointKind"]);
    $r.addField("Point",pas["WEBLib.TMSFNCTypes"].$rtti["TPointF"]);
  });
  this.TTMSFNCGraphicsPathDrawMode = {"0": "pdmPolygon", pdmPolygon: 0, "1": "pdmPolyline", pdmPolyline: 1, "2": "pdmPath", pdmPath: 2};
  this.$rtti.$Enum("TTMSFNCGraphicsPathDrawMode",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCGraphicsPathDrawMode});
  rtl.createClass(this,"TTMSFNCGraphicsPathPoints",pas.Classes.TList,function () {
    this.GetItem = function (Index) {
      rtl.rc(Index,-2147483648,2147483647);
      var Result = $mod.TTMSFNCGraphicsPathPoint.$new();
      Result.$assign(rtl.getObject(this.Get(Index)));
      return Result;
    };
    this.SetItem = function (Index, Value) {
      rtl.rc(Index,-2147483648,2147483647);
      var v = $mod.TTMSFNCGraphicsPathPoint.$new();
      v.$assign(Value);
      this.Put(Index,v);
    };
  });
  this.TTMSFNCGraphicsCorner = {"0": "gcTopLeft", gcTopLeft: 0, "1": "gcTopRight", gcTopRight: 1, "2": "gcBottomLeft", gcBottomLeft: 2, "3": "gcBottomRight", gcBottomRight: 3};
  this.$rtti.$Enum("TTMSFNCGraphicsCorner",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TTMSFNCGraphicsCorner});
  this.$rtti.$Set("TTMSFNCGraphicsCorners",{comptype: this.$rtti["TTMSFNCGraphicsCorner"]});
  rtl.createClass(this,"TTMSFNCGraphicsPath",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FStartPoint = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      this.FClippable = false;
      this.FPoints = null;
    };
    this.$final = function () {
      this.FStartPoint = undefined;
      this.FPoints = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.CalculateBezierCoefficients = function (Bezier, AX, BX, CX, AY, BY, CY) {
      CX.set(3 * (Bezier[1].X - Bezier[0].X));
      CY.set(3 * (Bezier[1].Y - Bezier[0].Y));
      BX.set((3 * (Bezier[2].X - Bezier[1].X)) - CX.get());
      BY.set((3 * (Bezier[2].Y - Bezier[1].Y)) - CY.get());
      AX.set(Bezier[3].X - Bezier[0].X - CX.get() - BX.get());
      AY.set(Bezier[3].Y - Bezier[0].Y - CY.get() - BY.get());
    };
    this.GetCount = function () {
      var Result = 0;
      Result = rtl.rc(this.FPoints.GetCount(),-2147483648,2147483647);
      return Result;
    };
    this.GetPoint = function (AIndex) {
      rtl.rc(AIndex,-2147483648,2147483647);
      var Result = $mod.TTMSFNCGraphicsPathPoint.$new();
      Result.$assign(this.FPoints.GetItem(AIndex));
      return Result;
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FPoints = $mod.TTMSFNCGraphicsPathPoints.$create("Create$1");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FPoints");
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      var I = 0;
      if ($mod.TTMSFNCGraphicsPath.isPrototypeOf(Source)) {
        this.FPoints.SetCount(Source.GetCount());
        for (var $l = 0, $end = Source.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          this.FPoints.SetItem(I,Source.GetPoint(I));
        };
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    this.LastPoint = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      if (this.GetCount() > 0) {
        Result.$assign(this.FPoints.GetItem(this.FPoints.GetCount() - 1).Point)}
       else {
        Result.$assign(pas["WEBLib.TMSFNCTypes"].PointF(0,0));
      };
      return Result;
    };
    this.IsPointVisible = function (P) {
      var Result = false;
      var pt = [];
      pt = rtl.arraySetLength(pt,pas["WEBLib.TMSFNCTypes"].TPointF,0);
      this.FlattenToPolygon({get: function () {
          return pt;
        }, set: function (v) {
          pt = v;
        }},0.25);
      Result = $mod.PointInPoly(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(P),rtl.arrayRef(pt));
      return Result;
    };
    this.IsRectVisible = function (R) {
      var Result = false;
      var pt = [];
      pt = rtl.arraySetLength(pt,pas["WEBLib.TMSFNCTypes"].TPointF,0);
      this.FlattenToPolygon({get: function () {
          return pt;
        }, set: function (v) {
          pt = v;
        }},0.25);
      Result = $mod.PolyInRect(rtl.arrayRef(pt),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(R));
      return Result;
    };
    this.PointOnBezier = function (StartPoint, AX, BX, CX, AY, BY, CY, T) {
      var Result = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var SquareT = 0.0;
      var CubeT = 0.0;
      SquareT = T * T;
      CubeT = SquareT * T;
      Result.X = (AX * CubeT) + (BX * SquareT) + (CX * T) + StartPoint.X;
      Result.Y = (AY * CubeT) + (BY * SquareT) + (CY * T) + StartPoint.Y;
      return Result;
    };
    this.CreateBezier = function (Bezier, PointCount) {
      rtl.rc(PointCount,-2147483648,2147483647);
      var Result = [];
      var AX = 0.0;
      var BX = 0.0;
      var CX = 0.0;
      var AY = 0.0;
      var BY = 0.0;
      var CY = 0.0;
      var DT = 0.0;
      var T = 0.0;
      var I = 0;
      if (PointCount === 0) return Result;
      DT = 1 / ((1 * PointCount) - 1);
      T = 0;
      Result = rtl.arraySetLength(Result,pas["WEBLib.TMSFNCTypes"].TPointF,PointCount);
      this.CalculateBezierCoefficients(Bezier,{get: function () {
          return AX;
        }, set: function (v) {
          AX = v;
        }},{get: function () {
          return BX;
        }, set: function (v) {
          BX = v;
        }},{get: function () {
          return CX;
        }, set: function (v) {
          CX = v;
        }},{get: function () {
          return AY;
        }, set: function (v) {
          AY = v;
        }},{get: function () {
          return BY;
        }, set: function (v) {
          BY = v;
        }},{get: function () {
          return CY;
        }, set: function (v) {
          CY = v;
        }});
      for (var $l = 0, $end = PointCount - 1; $l <= $end; $l++) {
        I = $l;
        rtl.rcArrR(Result,I).$assign(this.PointOnBezier(Bezier[0],AX,BX,CX,AY,BY,CY,T));
        T = T + DT;
      };
      return Result;
    };
    var SmallAmount = 0.001;
    this.GetBounds = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var I = 0;
      var pt = $mod.TTMSFNCGraphicsPathPoint.$new();
      if (this.FPoints.GetCount() < 1) return pas["WEBLib.TMSFNCTypes"].RectF(0,0,0,0);
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0xFFFF,0xFFFF,-0xFFFF,-0xFFFF));
      for (var $l = 0, $end = this.FPoints.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        pt.$assign(this.FPoints.GetItem(I));
        if (pt.Kind === $mod.TTMSFNCGraphicsPathPointKind.gppClose) continue;
        if (pt.Point.X < Result.Left) Result.Left = pt.Point.X;
        if (pt.Point.X > Result.Right) Result.Right = pt.Point.X;
        if (pt.Point.Y < Result.Top) Result.Top = pt.Point.Y;
        if (pt.Point.Y > Result.Bottom) Result.Bottom = pt.Point.Y;
      };
      if (pas.Math.SameValue(Result.Right - Result.Left,0,1E-3)) Result.Right = Result.Left + 1E-3;
      if (pas.Math.SameValue(Result.Bottom - Result.Top,0,1E-3)) Result.Bottom = Result.Top + 1E-3;
      return Result;
    };
    this.IsClippable = function () {
      var Result = false;
      Result = this.FClippable;
      return Result;
    };
    this.MoveTo = function (P) {
      var pt = $mod.TTMSFNCGraphicsPathPoint.$new();
      pt.Kind = rtl.rc($mod.TTMSFNCGraphicsPathPointKind.gppMoveTo,0,3);
      pt.Point.$assign(P);
      this.FPoints.Add($mod.TTMSFNCGraphicsPathPoint.$clone(pt));
      this.FStartPoint.$assign(this.FPoints.GetItem(this.FPoints.GetCount() - 1).Point);
    };
    this.LineTo = function (P) {
      var pt = $mod.TTMSFNCGraphicsPathPoint.$new();
      pt.Kind = rtl.rc($mod.TTMSFNCGraphicsPathPointKind.gppLineTo,0,3);
      pt.Point.$assign(P);
      this.FPoints.Add($mod.TTMSFNCGraphicsPathPoint.$clone(pt));
      if ((P.X === this.FStartPoint.X) && (P.Y === this.FStartPoint.Y)) this.FClippable = true;
    };
    this.CurveTo = function (ControlPoint1, ControlPoint2, EndPoint) {
      var pt = $mod.TTMSFNCGraphicsPathPoint.$new();
      pt.Kind = rtl.rc($mod.TTMSFNCGraphicsPathPointKind.gppCurveTo,0,3);
      pt.Point.$assign(ControlPoint1);
      this.FPoints.Add($mod.TTMSFNCGraphicsPathPoint.$clone(pt));
      pt.Kind = rtl.rc($mod.TTMSFNCGraphicsPathPointKind.gppCurveTo,0,3);
      pt.Point.$assign(ControlPoint2);
      this.FPoints.Add($mod.TTMSFNCGraphicsPathPoint.$clone(pt));
      pt.Kind = rtl.rc($mod.TTMSFNCGraphicsPathPointKind.gppCurveTo,0,3);
      pt.Point.$assign(EndPoint);
      this.FPoints.Add($mod.TTMSFNCGraphicsPathPoint.$clone(pt));
    };
    this.SmoothCurveTo = function (ControlPoint2, EndPoint) {
      var ControlPoint1 = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      if (this.GetCount() > 2) {
        ControlPoint1.X = this.LastPoint().X + (this.LastPoint().X - this.FPoints.GetItem(this.FPoints.GetCount() - 2).Point.X);
        ControlPoint1.Y = this.LastPoint().Y + (this.LastPoint().Y - this.FPoints.GetItem(this.FPoints.GetCount() - 2).Point.Y);
      } else ControlPoint1.$assign(ControlPoint2);
      this.CurveTo(ControlPoint1,ControlPoint2,EndPoint);
    };
    var OneThird = 1 / 3;
    var TwoThirds = 2 / 3;
    this.QuadCurveTo = function (ControlPoint, EndPoint) {
      var LP = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var CP1 = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var CP2 = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      LP.$assign(this.LastPoint());
      CP1.X = (0.33333333333333331 * LP.X) + (0.66666666666666663 * ControlPoint.X);
      CP1.Y = (0.33333333333333331 * LP.Y) + (0.66666666666666663 * ControlPoint.Y);
      CP2.X = (0.66666666666666663 * ControlPoint.X) + (0.33333333333333331 * EndPoint.X);
      CP2.Y = (0.66666666666666663 * ControlPoint.Y) + (0.33333333333333331 * EndPoint.Y);
      this.CurveTo(CP1,CP2,EndPoint);
    };
    this.AddPolygon = function (APolygon) {
      var I = 0;
      for (var $l = 0, $end = rtl.length(APolygon) - 1; $l <= $end; $l++) {
        I = $l;
        this.LineTo(rtl.rcArrR(APolygon,I));
      };
    };
    this.ClosePath = function () {
      var pt = $mod.TTMSFNCGraphicsPathPoint.$new();
      pt.Kind = rtl.rc($mod.TTMSFNCGraphicsPathPointKind.gppClose,0,3);
      pt.Point.$assign(this.FStartPoint);
      this.FPoints.Add($mod.TTMSFNCGraphicsPathPoint.$clone(pt));
      this.FClippable = true;
    };
    this.AddLine = function (StartPoint, EndPoint) {
      if (this.GetCount() === 0) {
        this.MoveTo(StartPoint)}
       else this.LineTo(StartPoint);
      this.LineTo(EndPoint);
    };
    this.AddEllipse = function (ARect) {
      var CX = 0.0;
      var CY = 0.0;
      var PX = 0.0;
      var PY = 0.0;
      var c = 0.0;
      c = 0.5522847498;
      CX = (ARect.Left + ARect.Right) / 2;
      CY = (ARect.Top + ARect.Bottom) / 2;
      PX = c * ((ARect.Right - ARect.Left) / 2);
      PY = c * ((ARect.Bottom - ARect.Top) / 2);
      this.MoveTo(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Left,CY));
      this.CurveTo(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Left,CY - PY),pas["WEBLib.TMSFNCTypes"].PointF(CX - PX,ARect.Top),pas["WEBLib.TMSFNCTypes"].PointF(CX,ARect.Top));
      this.CurveTo(pas["WEBLib.TMSFNCTypes"].PointF(CX + PX,ARect.Top),pas["WEBLib.TMSFNCTypes"].PointF(ARect.Right,CY - PY),pas["WEBLib.TMSFNCTypes"].PointF(ARect.Right,CY));
      this.CurveTo(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Right,CY + PY),pas["WEBLib.TMSFNCTypes"].PointF(CX + PX,ARect.Bottom),pas["WEBLib.TMSFNCTypes"].PointF(CX,ARect.Bottom));
      this.CurveTo(pas["WEBLib.TMSFNCTypes"].PointF(CX - PX,ARect.Bottom),pas["WEBLib.TMSFNCTypes"].PointF(ARect.Left,CY + PY),pas["WEBLib.TMSFNCTypes"].PointF(ARect.Left,CY));
      this.FClippable = true;
    };
    this.AddRectangle = function (ARect, ARoundingX, ARoundingY, ACorners) {
      if ((ARoundingX === 0.0) && (ARoundingY === 0.0)) {
        this.MoveTo(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Left,ARect.Top));
        this.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Right,ARect.Top));
        this.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Right,ARect.Bottom));
        this.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Left,ARect.Bottom));
      } else {
        if ($mod.TTMSFNCGraphicsCorner.gcBottomLeft in ACorners) {
          this.MoveTo(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Left + ARoundingX,ARect.Bottom));
          this.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Left + ARoundingX,ARect.Bottom - ARoundingY),pas["WEBLib.TMSFNCTypes"].PointF(ARoundingX,ARoundingY),-270,90);
          this.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Left,ARect.Bottom - ARoundingY));
        } else {
          this.MoveTo(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Left,ARect.Bottom));
        };
        if ($mod.TTMSFNCGraphicsCorner.gcTopLeft in ACorners) {
          this.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Left,ARect.Top + ARoundingY));
          this.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Left + ARoundingX,ARect.Top + ARoundingY),pas["WEBLib.TMSFNCTypes"].PointF(ARoundingX,ARoundingY),-180,90);
          this.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Left + ARoundingX,ARect.Top));
        } else this.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Left,ARect.Top));
        if ($mod.TTMSFNCGraphicsCorner.gcTopRight in ACorners) {
          this.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Right - ARoundingX,ARect.Top));
          this.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Right - ARoundingX,ARect.Top + ARoundingY),pas["WEBLib.TMSFNCTypes"].PointF(ARoundingX,ARoundingY),-90,90);
          this.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Right,ARect.Top + ARoundingY));
        } else this.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Right,ARect.Top));
        if ($mod.TTMSFNCGraphicsCorner.gcBottomRight in ACorners) {
          this.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Right,ARect.Bottom - ARoundingY));
          this.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Right - ARoundingX,ARect.Bottom - ARoundingY),pas["WEBLib.TMSFNCTypes"].PointF(ARoundingX,ARoundingY),0,90);
          this.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Right - ARoundingX,ARect.Bottom));
        } else this.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Right,ARect.Bottom));
        if ($mod.TTMSFNCGraphicsCorner.gcBottomLeft in ACorners) {
          this.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Left + ARoundingX,ARect.Bottom))}
         else this.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Left,ARect.Bottom));
      };
      this.ClosePath();
      this.FClippable = true;
    };
    var BezierArcAngleEpsilon = 0.01;
    var MinSweepAngle = 1E-10;
    this.AddArc = function (Center, Radius, StartAngle, SweepAngle) {
      var UseMoveTo = false;
      var I = 0;
      var F = 0.0;
      var TotalSweep = 0.0;
      var LocalSweep = 0.0;
      var PrevSweep = 0.0;
      var Done = false;
      StartAngle = pas.Math.DegToRad(StartAngle);
      SweepAngle = pas.Math.DegToRad(SweepAngle);
      I = rtl.rc(pas.System.Trunc(StartAngle / (2 * Math.PI)),-2147483648,2147483647);
      F = StartAngle - (I * 2 * Math.PI);
      StartAngle = F;
      if (SweepAngle >= (2 * Math.PI)) SweepAngle = 2 * Math.PI;
      if (SweepAngle <= (-2 * Math.PI)) SweepAngle = -2 * Math.PI;
      if (Math.abs(SweepAngle) < 1E-10) return;
      TotalSweep = 0;
      Done = false;
      UseMoveTo = true;
      do {
        if (SweepAngle < 0) {
          PrevSweep = TotalSweep;
          LocalSweep = -Math.PI / 2;
          TotalSweep = TotalSweep - (Math.PI / 2);
          if (TotalSweep <= (SweepAngle + 0.01)) {
            LocalSweep = SweepAngle - PrevSweep;
            Done = true;
          };
        } else {
          PrevSweep = TotalSweep;
          LocalSweep = Math.PI / 2;
          TotalSweep = TotalSweep + (Math.PI / 2);
          if (TotalSweep >= (SweepAngle - 0.01)) {
            LocalSweep = SweepAngle - PrevSweep;
            Done = true;
          };
        };
        $impl.DrawArcWithBezier(this,Center.X,Center.Y,Radius.X,Radius.Y,StartAngle,LocalSweep,UseMoveTo);
        UseMoveTo = false;
        StartAngle = StartAngle + LocalSweep;
      } while (!Done);
    };
    this.AddPath = function (APath) {
      var I = 0;
      this.FPoints.SetCapacity(this.FPoints.GetCount() + APath.GetCount());
      for (var $l = 0, $end = APath.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.FPoints.Add($mod.TTMSFNCGraphicsPathPoint.$clone(APath.GetPoint(I)));
      };
    };
    this.ApplyMatrix = function (AMatrix) {
      var I = 0;
      var pt = $mod.TTMSFNCGraphicsPathPoint.$new();
      if (this.FPoints.GetCount() > 0) {
        for (var $l = 0, $end = this.FPoints.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          if (this.FPoints.GetItem(I).Kind in rtl.createSet($mod.TTMSFNCGraphicsPathPointKind.gppMoveTo,$mod.TTMSFNCGraphicsPathPointKind.gppLineTo,$mod.TTMSFNCGraphicsPathPointKind.gppCurveTo)) {
            pt.$assign(this.FPoints.GetItem(I));
            pt.Point.$assign($mod.MatrixMultiply$1(pt.Point,AMatrix));
            this.FPoints.SetItem(I,pt);
          };
        };
      };
    };
    this.Clear = function () {
      this.FPoints.Clear();
    };
    this.Flatten = function (Flatness) {
      var J = 0;
      var I = 0;
      var BPts = [];
      var B = rtl.arraySetLength(null,pas["WEBLib.TMSFNCTypes"].TPointF,4);
      var F = 0.0;
      var Len = 0.0;
      var SegCount = 0;
      var OldPathData = null;
      var CurPoint = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var x = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      if (this.FPoints.GetCount() > 0) {
        F = Math.max(Flatness,0.05);
        OldPathData = $mod.TTMSFNCGraphicsPathPoints.$create("Create$1");
        try {
          OldPathData.SetCount(this.FPoints.GetCount());
          for (var $l = 0, $end = this.FPoints.GetCount() - 1; $l <= $end; $l++) {
            J = $l;
            OldPathData.Add($mod.TTMSFNCGraphicsPathPoint.$clone(this.FPoints.GetItem(J)));
          };
          this.FPoints.Clear();
          J = 0;
          while (J < OldPathData.GetCount()) {
            var $tmp = OldPathData.GetItem(J).Kind;
            if ($tmp === $mod.TTMSFNCGraphicsPathPointKind.gppMoveTo) {
              this.MoveTo(OldPathData.GetItem(J).Point);
              CurPoint.$assign(OldPathData.GetItem(J).Point);
            } else if ($tmp === $mod.TTMSFNCGraphicsPathPointKind.gppLineTo) {
              this.LineTo(OldPathData.GetItem(J).Point);
              CurPoint.$assign(OldPathData.GetItem(J).Point);
            } else if ($tmp === $mod.TTMSFNCGraphicsPathPointKind.gppCurveTo) {
              B[0].$assign(CurPoint);
              B[1].$assign(OldPathData.GetItem(J).Point);
              J += 1;
              B[2].$assign(OldPathData.GetItem(J).Point);
              J += 1;
              B[3].$assign(OldPathData.GetItem(J).Point);
              BPts = this.CreateBezier(B,6);
              Len = 0;
              for (var $l1 = 0, $end1 = rtl.length(BPts) - 1 - 1; $l1 <= $end1; $l1++) {
                I = $l1;
                x.X = rtl.rcArrR(BPts,I).X - rtl.rcArrR(BPts,I + 1).X;
                x.Y = rtl.rcArrR(BPts,I).Y - rtl.rcArrR(BPts,I + 1).Y;
                Len = Len + pas["WEBLib.TMSFNCTypes"].GetPointLength(x);
              };
              SegCount = rtl.rc(Math.round(Len / F),-2147483648,2147483647);
              if (SegCount < 2) {
                this.LineTo(B[3])}
               else {
                BPts = this.CreateBezier(B,SegCount);
                for (var $l2 = 0, $end2 = rtl.length(BPts) - 1; $l2 <= $end2; $l2++) {
                  I = $l2;
                  this.LineTo(rtl.rcArrR(BPts,I));
                };
                CurPoint.$assign(OldPathData.GetItem(J).Point);
              };
            } else if ($tmp === $mod.TTMSFNCGraphicsPathPointKind.gppClose) this.ClosePath();
            J += 1;
          };
        } finally {
          OldPathData = rtl.freeLoc(OldPathData);
        };
      };
    };
    this.FlattenToPolygon = function (Polygon, Flatness) {
      var $Self = this;
      function AddPoint(P) {
        if ((rtl.length(Polygon.get()) > 0) && pas.Math.SameValue(P.X,rtl.rcArrR(Polygon.get(),rtl.length(Polygon.get()) - 1).X,1E-3) && pas.Math.SameValue(P.Y,rtl.rcArrR(Polygon.get(),rtl.length(Polygon.get()) - 1).Y,1E-3)) return;
        Polygon.set(rtl.arraySetLength(Polygon.get(),pas["WEBLib.TMSFNCTypes"].TPointF,rtl.length(Polygon.get()) + 1));
        rtl.rcArrR(Polygon.get(),rtl.length(Polygon.get()) - 1).$assign(P);
      };
      var J = 0;
      var I = 0;
      var BPts = [];
      var B = rtl.arraySetLength(null,pas["WEBLib.TMSFNCTypes"].TPointF,4);
      var SP = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var CurPoint = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var X = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var F = 0.0;
      var Len = 0.0;
      var SegCount = 0;
      Polygon.set(rtl.arraySetLength(Polygon.get(),pas["WEBLib.TMSFNCTypes"].TPointF,0));
      if (this.FPoints.GetCount() > 0) {
        F = Math.max(Flatness,0.05);
        J = 0;
        while (J < this.FPoints.GetCount()) {
          var $tmp = this.FPoints.GetItem(J).Kind;
          if ($tmp === $mod.TTMSFNCGraphicsPathPointKind.gppMoveTo) {
            AddPoint(this.FPoints.GetItem(J).Point);
            CurPoint.$assign(this.FPoints.GetItem(J).Point);
            SP.$assign(CurPoint);
          } else if ($tmp === $mod.TTMSFNCGraphicsPathPointKind.gppLineTo) {
            AddPoint(this.FPoints.GetItem(J).Point);
            CurPoint.$assign(this.FPoints.GetItem(J).Point);
          } else if ($tmp === $mod.TTMSFNCGraphicsPathPointKind.gppCurveTo) {
            B[0].$assign(CurPoint);
            B[1].$assign(this.FPoints.GetItem(J).Point);
            J += 1;
            B[2].$assign(this.FPoints.GetItem(J).Point);
            J += 1;
            B[3].$assign(this.FPoints.GetItem(J).Point);
            BPts = this.CreateBezier(B,6);
            Len = 0;
            for (var $l = 0, $end = rtl.length(BPts) - 1 - 1; $l <= $end; $l++) {
              I = $l;
              X.X = rtl.rcArrR(BPts,I).X - rtl.rcArrR(BPts,I + 1).X;
              X.Y = rtl.rcArrR(BPts,I).Y - rtl.rcArrR(BPts,I + 1).Y;
              Len = Len + pas["WEBLib.TMSFNCTypes"].GetPointLength(X);
            };
            SegCount = rtl.rc(Math.round(Len / F),-2147483648,2147483647);
            if (SegCount < 2) {
              AddPoint(B[0]);
              AddPoint(B[3]);
            } else {
              BPts = this.CreateBezier(B,SegCount);
              for (var $l1 = 0, $end1 = rtl.length(BPts) - 1; $l1 <= $end1; $l1++) {
                I = $l1;
                AddPoint(rtl.rcArrR(BPts,I));
              };
            };
            CurPoint.$assign(this.FPoints.GetItem(J).Point);
          } else if ($tmp === $mod.TTMSFNCGraphicsPathPointKind.gppClose) {
            AddPoint(SP);
          };
          J += 1;
        };
      };
    };
  });
  rtl.createClass(this,"TTMSFNCGraphicsColorObject",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FColor = 0;
    };
    this.Create$1 = function (AColor) {
      rtl.rc(AColor,-9007199254740991,9007199254740991);
      this.FColor = rtl.rc(AColor,-9007199254740991,9007199254740991);
      return this;
    };
  });
  this.TTMSFNCGraphicsModifyRectMode = {"0": "gcrmNone", gcrmNone: 0, "1": "gcrmExpandAll", gcrmExpandAll: 1, "2": "gcrmShrinkAll", gcrmShrinkAll: 2, "3": "gcrmShiftRightAndExpandHeight", gcrmShiftRightAndExpandHeight: 3, "4": "gcrmShiftDownAndExpandWidth", gcrmShiftDownAndExpandWidth: 4, "5": "gcrmShiftRightAndShrinkHeight", gcrmShiftRightAndShrinkHeight: 5, "6": "gcrmShiftRightDown", gcrmShiftRightDown: 6, "7": "gcrmShiftRightUp", gcrmShiftRightUp: 7, "8": "gcrmShiftLeftUp", gcrmShiftLeftUp: 8, "9": "gcrmShiftLeftDown", gcrmShiftLeftDown: 9, "10": "gcrmShiftUpAndExpandWidth", gcrmShiftUpAndExpandWidth: 10, "11": "gcrmShiftLeftAndExpandHeight", gcrmShiftLeftAndExpandHeight: 11};
  this.$rtti.$Enum("TTMSFNCGraphicsModifyRectMode",{minvalue: 0, maxvalue: 11, ordtype: 1, enumtype: this.TTMSFNCGraphicsModifyRectMode});
  this.TTMSFNCGraphicsModifyPointMode = {"0": "gcpmNone", gcpmNone: 0, "1": "gcpmLeftUp", gcpmLeftUp: 1, "2": "gcpmRightDown", gcpmRightDown: 2, "3": "gcpmLeftDown", gcpmLeftDown: 3, "4": "gcpmRightUp", gcpmRightUp: 4};
  this.$rtti.$Enum("TTMSFNCGraphicsModifyPointMode",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TTMSFNCGraphicsModifyPointMode});
  this.TTMSFNCGraphicsExpanderState = {"0": "gesCollapsed", gesCollapsed: 0, "1": "gesExpanded", gesExpanded: 1};
  this.$rtti.$Enum("TTMSFNCGraphicsExpanderState",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCGraphicsExpanderState});
  this.TTMSFNCGraphicsCompactState = {"0": "gcsCollapsed", gcsCollapsed: 0, "1": "gcsExpanded", gcsExpanded: 1};
  this.$rtti.$Enum("TTMSFNCGraphicsCompactState",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCGraphicsCompactState});
  rtl.createClass(this,"TTMSFNCGraphicsColorList",pas.Classes.TStringList,function () {
    this.AddOrSetValue = function (AKey, AValue) {
      var I = 0;
      var it = null;
      it = null;
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (AKey === this.Get(I)) {
          it = this.GetObject(I);
          break;
        };
      };
      if (!(it != null)) {
        this.AddObject(AKey,AValue);
      } else this.PutObject(I,AValue);
    };
    this.TryGetValue = function (AKey, AValue) {
      var Result = false;
      var I = 0;
      Result = false;
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (AKey === this.Get(I)) {
          AValue.set(rtl.as(this.GetObject(I),$mod.TTMSFNCGraphicsColorObject));
          Result = true;
          break;
        };
      };
      return Result;
    };
  });
  this.ModifyRect = function (ARect, ARectMode) {
    var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
    Result.$assign(ARect);
    var $tmp = ARectMode;
    if ($tmp === $mod.TTMSFNCGraphicsModifyRectMode.gcrmExpandAll) {
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.System.Int(Result.Left) - 0.5,pas.System.Int(Result.Top) - 0.5,pas.System.Int(Result.Right) + 0.5,pas.System.Int(Result.Bottom) + 0.5))}
     else if ($tmp === $mod.TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll) {
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.System.Int(Result.Left) + 0.5,pas.System.Int(Result.Top) + 0.5,pas.System.Int(Result.Right) - 0.5,pas.System.Int(Result.Bottom) - 0.5))}
     else if ($tmp === $mod.TTMSFNCGraphicsModifyRectMode.gcrmShiftRightAndExpandHeight) {
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.System.Int(Result.Left) + 0.5,pas.System.Int(Result.Top) - 0.5,pas.System.Int(Result.Right) + 0.5,pas.System.Int(Result.Bottom) + 0.5))}
     else if ($tmp === $mod.TTMSFNCGraphicsModifyRectMode.gcrmShiftRightDown) {
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.System.Int(Result.Left) + 0.5,pas.System.Int(Result.Top) + 0.5,pas.System.Int(Result.Right) + 0.5,pas.System.Int(Result.Bottom) + 0.5))}
     else if ($tmp === $mod.TTMSFNCGraphicsModifyRectMode.gcrmShiftRightAndShrinkHeight) {
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.System.Int(Result.Left) + 0.5,pas.System.Int(Result.Top) + 0.5,pas.System.Int(Result.Right) + 0.5,pas.System.Int(Result.Bottom) - 0.5))}
     else if ($tmp === $mod.TTMSFNCGraphicsModifyRectMode.gcrmShiftDownAndExpandWidth) {
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.System.Int(Result.Left) - 0.5,pas.System.Int(Result.Top) + 0.5,pas.System.Int(Result.Right) + 0.5,pas.System.Int(Result.Bottom) + 0.5))}
     else if ($tmp === $mod.TTMSFNCGraphicsModifyRectMode.gcrmShiftUpAndExpandWidth) {
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.System.Int(Result.Left) - 0.5,pas.System.Int(Result.Top) - 0.5,pas.System.Int(Result.Right) + 0.5,pas.System.Int(Result.Bottom) - 0.5))}
     else if ($tmp === $mod.TTMSFNCGraphicsModifyRectMode.gcrmShiftRightUp) {
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.System.Int(Result.Left) + 0.5,pas.System.Int(Result.Top) - 0.5,pas.System.Int(Result.Right) + 0.5,pas.System.Int(Result.Bottom) - 0.5))}
     else if ($tmp === $mod.TTMSFNCGraphicsModifyRectMode.gcrmShiftLeftUp) {
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.System.Int(Result.Left) - 0.5,pas.System.Int(Result.Top) - 0.5,pas.System.Int(Result.Right) - 0.5,pas.System.Int(Result.Bottom) - 0.5))}
     else if ($tmp === $mod.TTMSFNCGraphicsModifyRectMode.gcrmShiftLeftDown) {
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.System.Int(Result.Left) - 0.5,pas.System.Int(Result.Top) + 0.5,pas.System.Int(Result.Right) - 0.5,pas.System.Int(Result.Bottom) + 0.5))}
     else if ($tmp === $mod.TTMSFNCGraphicsModifyRectMode.gcrmShiftLeftAndExpandHeight) Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.System.Int(Result.Left) - 0.5,pas.System.Int(Result.Top) - 0.5,pas.System.Int(Result.Right) - 0.5,pas.System.Int(Result.Bottom) + 0.5));
    return Result;
  };
  this.ModifyPoint = function (APoint, APointMode) {
    var Result = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
    Result.$assign(APoint);
    var $tmp = APointMode;
    if ($tmp === $mod.TTMSFNCGraphicsModifyPointMode.gcpmRightDown) {
      Result.$assign(pas["WEBLib.TMSFNCTypes"].PointF(pas.System.Int(Result.X) + 0.5,pas.System.Int(Result.Y) + 0.5))}
     else if ($tmp === $mod.TTMSFNCGraphicsModifyPointMode.gcpmLeftUp) {
      Result.$assign(pas["WEBLib.TMSFNCTypes"].PointF(pas.System.Int(Result.X) - 0.5,pas.System.Int(Result.Y) - 0.5))}
     else if ($tmp === $mod.TTMSFNCGraphicsModifyPointMode.gcpmRightUp) {
      Result.$assign(pas["WEBLib.TMSFNCTypes"].PointF(pas.System.Int(Result.X) + 0.5,pas.System.Int(Result.Y) - 0.5))}
     else if ($tmp === $mod.TTMSFNCGraphicsModifyPointMode.gcpmLeftDown) Result.$assign(pas["WEBLib.TMSFNCTypes"].PointF(pas.System.Int(Result.X) - 0.5,pas.System.Int(Result.Y) + 0.5));
    return Result;
  };
  this.MakeGraphicsColor = function (ARed, AGreen, ABlue) {
    rtl.rc(ARed,0,255);
    rtl.rc(AGreen,0,255);
    rtl.rc(ABlue,0,255);
    var Result = 0;
    Result = rtl.rc(pas["WEBLib.Graphics"].RGB(ARed,AGreen,ABlue),-9007199254740991,9007199254740991);
    return Result;
  };
  this.Lighter = function (AColor, APercent) {
    rtl.rc(AColor,-9007199254740991,9007199254740991);
    rtl.rc(APercent,0,255);
    var Result = 0;
    var r = 0;
    var g = 0;
    var b = 0;
    AColor = rtl.rc(pas["WEBLib.Graphics"].ColorToRGB(AColor),-9007199254740991,9007199254740991);
    r = rtl.rc(pas["WEBLib.Graphics"].GetRValue(AColor),0,255);
    g = rtl.rc(pas["WEBLib.Graphics"].GetGValue(AColor),0,255);
    b = rtl.rc(pas["WEBLib.Graphics"].GetBValue(AColor),0,255);
    r = rtl.rc(r + Math.min(255,pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(255 - r,APercent,100)),0,255);
    g = rtl.rc(g + Math.min(255,pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(255 - g,APercent,100)),0,255);
    b = rtl.rc(b + Math.min(255,pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(255 - b,APercent,100)),0,255);
    Result = rtl.rc($mod.MakeGraphicsColor(r,g,b),-9007199254740991,9007199254740991);
    return Result;
  };
  this.Darker = function (AColor, APercent) {
    rtl.rc(AColor,-9007199254740991,9007199254740991);
    rtl.rc(APercent,0,255);
    var Result = 0;
    var r = 0;
    var g = 0;
    var b = 0;
    AColor = rtl.rc(pas["WEBLib.Graphics"].ColorToRGB(AColor),-9007199254740991,9007199254740991);
    r = rtl.rc(pas["WEBLib.Graphics"].GetRValue(AColor),0,255);
    g = rtl.rc(pas["WEBLib.Graphics"].GetGValue(AColor),0,255);
    b = rtl.rc(pas["WEBLib.Graphics"].GetBValue(AColor),0,255);
    r = rtl.rc(r - Math.max(0,pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(255 - r,APercent,100)),0,255);
    g = rtl.rc(g - Math.max(0,pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(255 - g,APercent,100)),0,255);
    b = rtl.rc(b - Math.max(0,pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(255 - b,APercent,100)),0,255);
    Result = rtl.rc($mod.MakeGraphicsColor(r,g,b),-9007199254740991,9007199254740991);
    return Result;
  };
  this.Blend = function (AColor1, AColor2, ALevel) {
    var Result = 0;
    var c1 = 0;
    var c2 = 0;
    var r = 0;
    var g = 0;
    var b = 0;
    var v1 = 0;
    var v2 = 0;
    ALevel = Math.round(2.55 * ALevel);
    c1 = pas["WEBLib.Graphics"].ColorToRGB(AColor1);
    c2 = pas["WEBLib.Graphics"].ColorToRGB(AColor2);
    v1 = c1 & 255;
    v2 = c2 & 255;
    r = Math.max(0,Math.min(255,((ALevel * (v1 - v2)) >>> 8) + v2));
    v1 = Math.floor(c1 / 256) & 255;
    v2 = Math.floor(c2 / 256) & 255;
    g = Math.max(0,Math.min(255,((ALevel * (v1 - v2)) >>> 8) + v2));
    v1 = Math.floor(c1 / 65536) & 255;
    v2 = Math.floor(c2 / 65536) & 255;
    b = Math.max(0,Math.min(255,((ALevel * (v1 - v2)) >>> 8) + v2));
    Result = (b << 16) + (g << 8) + r;
    return Result;
  };
  this.ColorLookup = function () {
    var Result = null;
    Result = $impl.FColorLookup;
    return Result;
  };
  this.PointInPoly = function (APoint, APolygon) {
    var Result = false;
    var minX = 0.0;
    var maxX = 0.0;
    var minY = 0.0;
    var maxY = 0.0;
    var I = 0;
    var J = 0;
    var q = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
    var pt = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
    var ptn = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
    var inside = false;
    var chk = false;
    var calc = 0.0;
    var chkc = false;
    Result = false;
    if (rtl.length(APolygon) === 0) return Result;
    minX = APolygon[0].X;
    maxX = APolygon[0].X;
    minY = APolygon[0].Y;
    maxY = APolygon[0].Y;
    for (var $l = 1, $end = rtl.length(APolygon) - 1; $l <= $end; $l++) {
      I = $l;
      q.$assign(APolygon[I]);
      minX = Math.min(q.X,minX);
      maxX = Math.max(q.X,maxX);
      minY = Math.min(q.Y,minY);
      maxY = Math.max(q.Y,maxY);
    };
    if ((APoint.X < minX) || (APoint.X > maxX) || (APoint.Y < minY) || (APoint.Y > maxY)) {
      Result = false;
      return Result;
    };
    inside = false;
    J = rtl.length(APolygon) - 1;
    for (var $l1 = 0, $end1 = rtl.length(APolygon) - 1; $l1 <= $end1; $l1++) {
      I = $l1;
      pt.$assign(APolygon[I]);
      ptn.$assign(APolygon[J]);
      chk = (pt.Y > APoint.Y) !== (ptn.Y > APoint.Y);
      if ((ptn.Y - pt.Y) !== 0) {
        calc = (((ptn.X - pt.X) * (APoint.Y - pt.Y)) / (ptn.Y - pt.Y)) + pt.X;
        chkc = APoint.X < calc;
        if (chk && chkc) inside = !inside;
      };
      J = I;
    };
    Result = inside;
    return Result;
  };
  this.RectInPoly = function (ARect, APolygon) {
    var Result = false;
    Result = $mod.PointInPoly(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Left,ARect.Top)),rtl.arrayRef(APolygon)) || $mod.PointInPoly(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Right,ARect.Top)),rtl.arrayRef(APolygon)) || $mod.PointInPoly(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Left,ARect.Bottom)),rtl.arrayRef(APolygon)) || $mod.PointInPoly(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Right,ARect.Bottom)),rtl.arrayRef(APolygon));
    return Result;
  };
  this.PolyInRect = function (APolygon, ARect) {
    var Result = false;
    var I = 0;
    Result = false;
    for (var $l = 0, $end = rtl.length(APolygon) - 1; $l <= $end; $l++) {
      I = $l;
      if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(ARect,APolygon[I])) {
        Result = true;
        return Result;
      };
    };
    return Result;
  };
  this.DrawGradient = function (ACanvas, AColor, AColorTo, ARect, ARounding, ACorners, ADirection) {
    rtl.rc(AColor,-9007199254740991,9007199254740991);
    rtl.rc(AColorTo,-9007199254740991,9007199254740991);
    var diffr = 0;
    var startr = 0;
    var endr = 0;
    var diffg = 0;
    var startg = 0;
    var endg = 0;
    var diffb = 0;
    var startb = 0;
    var endb = 0;
    var si = 0;
    var rstepr = 0.0;
    var rstepg = 0.0;
    var rstepb = 0.0;
    var rstepw = 0.0;
    var i = 0;
    var stepw = 0;
    var oldp = 0;
    var oldb = 0;
    var Steps = 0;
    var R = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
    var dr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
    var iend = 0.0;
    var a = 0.0;
    var oldps = 0;
    var oldbs = 0;
    R.$assign(ARect);
    if (ADirection) {
      Steps = rtl.rc(Math.round(R.Right - R.Left),-2147483648,2147483647)}
     else Steps = rtl.rc(Math.round(R.Bottom - R.Top),-2147483648,2147483647);
    if (Steps === 0) Steps = 1;
    AColor = rtl.rc(pas["WEBLib.Graphics"].ColorToRGB(AColor),-9007199254740991,9007199254740991);
    AColorTo = rtl.rc(pas["WEBLib.Graphics"].ColorToRGB(AColorTo),-9007199254740991,9007199254740991);
    startr = rtl.rc(AColor & 0xFF,-2147483648,2147483647);
    startg = rtl.rc(Math.floor((AColor & 0xFF00) / 256),-2147483648,2147483647);
    startb = rtl.rc(Math.floor((AColor & 0xFF0000) / 65536),-2147483648,2147483647);
    endr = rtl.rc(AColorTo & 0xFF,-2147483648,2147483647);
    endg = rtl.rc(Math.floor((AColorTo & 0xFF00) / 256),-2147483648,2147483647);
    endb = rtl.rc(Math.floor((AColorTo & 0xFF0000) / 65536),-2147483648,2147483647);
    diffr = rtl.rc(endr - startr,-2147483648,2147483647);
    diffg = rtl.rc(endg - startg,-2147483648,2147483647);
    diffb = rtl.rc(endb - startb,-2147483648,2147483647);
    rstepr = diffr / Steps;
    rstepg = diffg / Steps;
    rstepb = diffb / Steps;
    if (ADirection) {
      rstepw = (R.Right - R.Left) / Steps}
     else rstepw = (R.Bottom - R.Top) / Steps;
    oldb = rtl.rc(ACanvas.FBrush.FColor,-9007199254740991,9007199254740991);
    oldbs = rtl.rc(ACanvas.FBrush.FStyle,0,7);
    oldp = rtl.rc(ACanvas.FPen.FColor,-9007199254740991,9007199254740991);
    oldps = rtl.rc(ACanvas.FPen.FStyle,0,8);
    ACanvas.FPen.FStyle = rtl.rc(pas["WEBLib.Graphics"].TPenStyle.psSolid,0,8);
    ACanvas.FBrush.FStyle = rtl.rc(pas["WEBLib.Graphics"].TBrushStyle.bsSolid,0,7);
    for (var $l = 0, $end = Steps - 1; $l <= $end; $l++) {
      i = $l;
      endr = rtl.rc(startr + Math.round(rstepr * i),-2147483648,2147483647);
      endg = rtl.rc(startg + Math.round(rstepg * i),-2147483648,2147483647);
      endb = rtl.rc(startb + Math.round(rstepb * i),-2147483648,2147483647);
      stepw = rtl.rc(Math.round(i * rstepw),0,65535);
      ACanvas.FPen.SetColor(endr + (endg << 8) + (endb << 16));
      ACanvas.FBrush.FColor = rtl.rc(ACanvas.FPen.FColor,-9007199254740991,9007199254740991);
      if (ADirection) {
        si = rtl.rc(pas.System.Trunc(rstepw),-2147483648,2147483647);
        iend = R.Left + stepw + si;
        iend = Math.min(iend,R.Right);
        dr.$assign(R);
        if ((i <= ARounding) && (($mod.TTMSFNCGraphicsCorner.gcTopLeft in ACorners) || ($mod.TTMSFNCGraphicsCorner.gcBottomLeft in ACorners))) {
          a = Math.sqrt(Math.pow(ARounding,2) - Math.pow(ARounding - i,2));
          if ($mod.TTMSFNCGraphicsCorner.gcTopLeft in ACorners) dr.Top = dr.Top + Math.round(ARounding - a);
          if ($mod.TTMSFNCGraphicsCorner.gcBottomLeft in ACorners) dr.Bottom = dr.Bottom - Math.round(ARounding - a);
        } else if ((i >= (Steps - ARounding)) && (($mod.TTMSFNCGraphicsCorner.gcBottomRight in ACorners) || ($mod.TTMSFNCGraphicsCorner.gcTopRight in ACorners))) {
          a = Math.sqrt(Math.pow(ARounding,2) - Math.pow(ARounding - (Steps - i),2));
          if ($mod.TTMSFNCGraphicsCorner.gcTopRight in ACorners) dr.Top = dr.Top + Math.round(ARounding - a);
          if ($mod.TTMSFNCGraphicsCorner.gcBottomRight in ACorners) dr.Bottom = dr.Bottom - Math.round(ARounding - a);
        };
        ACanvas.Rectangle(dr.Left + stepw,dr.Top,iend,dr.Bottom);
      } else {
        si = rtl.rc(pas.System.Trunc(rstepw),-2147483648,2147483647);
        iend = R.Top + stepw + si;
        iend = Math.min(iend,R.Bottom);
        dr.$assign(R);
        if ((i <= ARounding) && (($mod.TTMSFNCGraphicsCorner.gcTopLeft in ACorners) || ($mod.TTMSFNCGraphicsCorner.gcTopRight in ACorners))) {
          a = Math.sqrt(Math.pow(ARounding,2) - Math.pow(ARounding - i,2));
          if ($mod.TTMSFNCGraphicsCorner.gcTopLeft in ACorners) dr.Left = dr.Left + Math.round(ARounding - a);
          if ($mod.TTMSFNCGraphicsCorner.gcTopRight in ACorners) dr.Right = dr.Right - Math.round(ARounding - a);
        } else if ((i >= (Steps - ARounding)) && (($mod.TTMSFNCGraphicsCorner.gcBottomLeft in ACorners) || ($mod.TTMSFNCGraphicsCorner.gcBottomRight in ACorners))) {
          a = Math.sqrt(Math.pow(ARounding,2) - Math.pow(ARounding - (Steps - i),2));
          if ($mod.TTMSFNCGraphicsCorner.gcBottomLeft in ACorners) dr.Left = dr.Left + Math.round(ARounding - a);
          if ($mod.TTMSFNCGraphicsCorner.gcBottomRight in ACorners) dr.Right = dr.Right - Math.round(ARounding - a);
        };
        ACanvas.Rectangle(dr.Left,dr.Top + stepw,dr.Right,iend);
      };
    };
    ACanvas.FBrush.FColor = rtl.rc(oldb,-9007199254740991,9007199254740991);
    ACanvas.FBrush.FStyle = rtl.rc(oldbs,0,7);
    ACanvas.FPen.SetColor(oldp);
    ACanvas.FPen.FStyle = rtl.rc(oldps,0,8);
  };
  this.IsMatrixIdentity = function (AMatrix) {
    var Result = false;
    Result = (AMatrix.m11 === 1) && (AMatrix.m12 === 0) && (AMatrix.m13 === 0) && (AMatrix.m21 === 0) && (AMatrix.m22 === 1) && (AMatrix.m23 === 0) && (AMatrix.m31 === 0) && (AMatrix.m32 === 0) && (AMatrix.m33 === 1);
    return Result;
  };
  this.IsMatrixEmpty = function (AMatrix) {
    var Result = false;
    Result = (AMatrix.m11 === 0) && (AMatrix.m12 === 0) && (AMatrix.m13 === 0) && (AMatrix.m21 === 0) && (AMatrix.m22 === 0) && (AMatrix.m23 === 0) && (AMatrix.m31 === 0) && (AMatrix.m32 === 0) && (AMatrix.m33 === 0);
    return Result;
  };
  this.MatrixEmpty = function () {
    var Result = $mod.TTMSFNCGraphicsMatrix.$new();
    Result.m11 = 0;
    Result.m12 = 0;
    Result.m13 = 0;
    Result.m21 = 0;
    Result.m22 = 0;
    Result.m23 = 0;
    Result.m31 = 0;
    Result.m32 = 0;
    Result.m33 = 0;
    return Result;
  };
  this.MatrixIdentity = function () {
    var Result = $mod.TTMSFNCGraphicsMatrix.$new();
    Result.m11 = 1;
    Result.m12 = 0;
    Result.m13 = 0;
    Result.m21 = 0;
    Result.m22 = 1;
    Result.m23 = 0;
    Result.m31 = 0;
    Result.m32 = 0;
    Result.m33 = 1;
    return Result;
  };
  this.MatrixCreateRotation = function (AAngle) {
    var Result = $mod.TTMSFNCGraphicsMatrix.$new();
    var S = 0.0;
    var C = 0.0;
    S = Math.sin(AAngle);
    C = Math.cos(AAngle);
    Result.$assign($mod.MatrixIdentity());
    Result.m11 = C;
    Result.m12 = S;
    Result.m21 = -S;
    Result.m22 = C;
    return Result;
  };
  this.MatrixCreateScaling = function (AScaleX, AScaleY) {
    var Result = $mod.TTMSFNCGraphicsMatrix.$new();
    Result.$assign($mod.MatrixIdentity());
    Result.m11 = AScaleX;
    Result.m22 = AScaleY;
    return Result;
  };
  this.MatrixCreateTranslation = function (ADeltaX, ADeltaY) {
    var Result = $mod.TTMSFNCGraphicsMatrix.$new();
    Result.$assign($mod.MatrixIdentity());
    Result.m31 = ADeltaX;
    Result.m32 = ADeltaY;
    return Result;
  };
  this.MatrixMultiply = function (AMatrix1, AMatrix2) {
    var Result = $mod.TTMSFNCGraphicsMatrix.$new();
    Result.m11 = (AMatrix1.m11 * AMatrix2.m11) + (AMatrix1.m12 * AMatrix2.m21) + (AMatrix1.m13 * AMatrix2.m31);
    Result.m12 = (AMatrix1.m11 * AMatrix2.m12) + (AMatrix1.m12 * AMatrix2.m22) + (AMatrix1.m13 * AMatrix2.m32);
    Result.m13 = (AMatrix1.m11 * AMatrix2.m13) + (AMatrix1.m12 * AMatrix2.m23) + (AMatrix1.m13 * AMatrix2.m33);
    Result.m21 = (AMatrix1.m21 * AMatrix2.m11) + (AMatrix1.m22 * AMatrix2.m21) + (AMatrix1.m23 * AMatrix2.m31);
    Result.m22 = (AMatrix1.m21 * AMatrix2.m12) + (AMatrix1.m22 * AMatrix2.m22) + (AMatrix1.m23 * AMatrix2.m32);
    Result.m23 = (AMatrix1.m21 * AMatrix2.m13) + (AMatrix1.m22 * AMatrix2.m23) + (AMatrix1.m23 * AMatrix2.m33);
    Result.m31 = (AMatrix1.m31 * AMatrix2.m11) + (AMatrix1.m32 * AMatrix2.m21) + (AMatrix1.m33 * AMatrix2.m31);
    Result.m32 = (AMatrix1.m31 * AMatrix2.m12) + (AMatrix1.m32 * AMatrix2.m22) + (AMatrix1.m33 * AMatrix2.m32);
    Result.m33 = (AMatrix1.m31 * AMatrix2.m13) + (AMatrix1.m32 * AMatrix2.m23) + (AMatrix1.m33 * AMatrix2.m33);
    return Result;
  };
  this.MatrixMultiply$1 = function (APoint, AMatrix) {
    var Result = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
    Result.X = (APoint.X * AMatrix.m11) + (APoint.Y * AMatrix.m21) + AMatrix.m31;
    Result.Y = (APoint.X * AMatrix.m12) + (APoint.Y * AMatrix.m22) + AMatrix.m32;
    return Result;
  };
  $mod.$implcode = function () {
    $impl.FColorLookup = null;
    $impl.DrawArcWithBezier = function (Path, CenterX, CenterY, RadiusX, RadiusY, StartAngle, SweepRange, UseMoveTo) {
      var Coord = [];
      var Pts = [];
      var A = 0.0;
      var X = 0.0;
      var Y = 0.0;
      var C = 0.0;
      var B = 0.0;
      var CC = 0.0;
      var SS = 0.0;
      var I = 0;
      if (SweepRange === 0) {
        if (UseMoveTo) {
          if (Path.FPoints.GetCount() < 1) {
            Path.MoveTo(pas["WEBLib.TMSFNCTypes"].PointF(CenterX + (RadiusX * Math.cos(StartAngle)),CenterY - (RadiusY * Math.sin(StartAngle))))}
           else Path.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(CenterX + (RadiusX * Math.cos(StartAngle)),CenterY - (RadiusY * Math.sin(StartAngle))));
        };
        Path.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(CenterX + (RadiusX * Math.cos(StartAngle)),CenterY - (RadiusY * Math.sin(StartAngle))));
        return;
      };
      B = Math.sin(SweepRange / 2);
      C = Math.cos(SweepRange / 2);
      A = 1 - C;
      X = (A * 4) / 3;
      Y = B - ((X * C) / B);
      SS = Math.sin(StartAngle + (SweepRange / 2));
      CC = Math.cos(StartAngle + (SweepRange / 2));
      Coord = rtl.arraySetLength(Coord,pas["WEBLib.TMSFNCTypes"].TPointF,4);
      Coord[0].$assign(pas["WEBLib.TMSFNCTypes"].PointF(C,-B));
      Coord[1].$assign(pas["WEBLib.TMSFNCTypes"].PointF(C + X,-Y));
      Coord[2].$assign(pas["WEBLib.TMSFNCTypes"].PointF(C + X,Y));
      Coord[3].$assign(pas["WEBLib.TMSFNCTypes"].PointF(C,B));
      Pts = rtl.arraySetLength(Pts,pas["WEBLib.TMSFNCTypes"].TPointF,4);
      for (I = 0; I <= 3; I++) {
        rtl.rcArrR(Pts,I).$assign(pas["WEBLib.TMSFNCTypes"].PointF(CenterX + (RadiusX * ((rtl.rcArrR(Coord,I).X * CC) - (rtl.rcArrR(Coord,I).Y * SS))),CenterY + (RadiusY * ((rtl.rcArrR(Coord,I).X * SS) + (rtl.rcArrR(Coord,I).Y * CC)))));
      };
      if (UseMoveTo) {
        if (Path.FPoints.GetCount() < 1) {
          Path.MoveTo(Pts[0])}
         else Path.LineTo(Pts[0]);
      };
      Path.CurveTo(Pts[1],Pts[2],Pts[3]);
    };
  };
  $mod.$init = function () {
    $impl.FColorLookup = $mod.TTMSFNCGraphicsColorList.$create("Create$1");
    $impl.FColorLookup.AddOrSetValue("aliceblue",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[16775408]));
    $impl.FColorLookup.AddOrSetValue("antiquewhite",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[14150650]));
    $impl.FColorLookup.AddOrSetValue("aqua",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[16776960]));
    $impl.FColorLookup.AddOrSetValue("aquamarine",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[13959039]));
    $impl.FColorLookup.AddOrSetValue("azure",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[16777200]));
    $impl.FColorLookup.AddOrSetValue("beige",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[14480885]));
    $impl.FColorLookup.AddOrSetValue("bisque",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[12903679]));
    $impl.FColorLookup.AddOrSetValue("black",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[0]));
    $impl.FColorLookup.AddOrSetValue("blanchedalmond",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[13495295]));
    $impl.FColorLookup.AddOrSetValue("blue",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[16711680]));
    $impl.FColorLookup.AddOrSetValue("blueviolet",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[14822282]));
    $impl.FColorLookup.AddOrSetValue("brown",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[2763429]));
    $impl.FColorLookup.AddOrSetValue("burlywood",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[8894686]));
    $impl.FColorLookup.AddOrSetValue("cadetblue",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[10526303]));
    $impl.FColorLookup.AddOrSetValue("chartreuse",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[65407]));
    $impl.FColorLookup.AddOrSetValue("chocolate",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[1993170]));
    $impl.FColorLookup.AddOrSetValue("coral",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[5275647]));
    $impl.FColorLookup.AddOrSetValue("cornflowerblue",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[15570276]));
    $impl.FColorLookup.AddOrSetValue("cornsilk",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[14481663]));
    $impl.FColorLookup.AddOrSetValue("crimson",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[3937500]));
    $impl.FColorLookup.AddOrSetValue("cyan",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[16776960]));
    $impl.FColorLookup.AddOrSetValue("darkblue",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[9109504]));
    $impl.FColorLookup.AddOrSetValue("darkcyan",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[9145088]));
    $impl.FColorLookup.AddOrSetValue("darkgoldenrod",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[755384]));
    $impl.FColorLookup.AddOrSetValue("darkgray",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[11119017]));
    $impl.FColorLookup.AddOrSetValue("darkgreen",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[25600]));
    $impl.FColorLookup.AddOrSetValue("darkgrey",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[11119017]));
    $impl.FColorLookup.AddOrSetValue("darkkhaki",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[7059389]));
    $impl.FColorLookup.AddOrSetValue("darkmagenta",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[9109643]));
    $impl.FColorLookup.AddOrSetValue("darkolivegreen",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[3107669]));
    $impl.FColorLookup.AddOrSetValue("darkorange",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[36095]));
    $impl.FColorLookup.AddOrSetValue("darkorchid",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[13382297]));
    $impl.FColorLookup.AddOrSetValue("darkred",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[139]));
    $impl.FColorLookup.AddOrSetValue("darksalmon",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[8034025]));
    $impl.FColorLookup.AddOrSetValue("darkseagreen",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[9419919]));
    $impl.FColorLookup.AddOrSetValue("darkslateblue",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[9125192]));
    $impl.FColorLookup.AddOrSetValue("darkslategray",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[5197615]));
    $impl.FColorLookup.AddOrSetValue("darkslategrey",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[5197615]));
    $impl.FColorLookup.AddOrSetValue("darkturquoise",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[13749760]));
    $impl.FColorLookup.AddOrSetValue("darkviolet",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[13828244]));
    $impl.FColorLookup.AddOrSetValue("deeppink",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[9639167]));
    $impl.FColorLookup.AddOrSetValue("deepskyblue",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[16760576]));
    $impl.FColorLookup.AddOrSetValue("dimgray",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[6908265]));
    $impl.FColorLookup.AddOrSetValue("dimgrey",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[6908265]));
    $impl.FColorLookup.AddOrSetValue("dodgerblue",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[16748574]));
    $impl.FColorLookup.AddOrSetValue("firebrick",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[2237106]));
    $impl.FColorLookup.AddOrSetValue("floralwhite",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[15792895]));
    $impl.FColorLookup.AddOrSetValue("forestgreen",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[2263842]));
    $impl.FColorLookup.AddOrSetValue("fuchsia",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[16711935]));
    $impl.FColorLookup.AddOrSetValue("gainsboro",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[14474460]));
    $impl.FColorLookup.AddOrSetValue("ghostwhite",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[16775416]));
    $impl.FColorLookup.AddOrSetValue("gold",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[55295]));
    $impl.FColorLookup.AddOrSetValue("goldenrod",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[2139610]));
    $impl.FColorLookup.AddOrSetValue("gray",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[8421504]));
    $impl.FColorLookup.AddOrSetValue("green",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[32768]));
    $impl.FColorLookup.AddOrSetValue("greenyellow",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[3145645]));
    $impl.FColorLookup.AddOrSetValue("grey",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[8421504]));
    $impl.FColorLookup.AddOrSetValue("honeydew",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[15794160]));
    $impl.FColorLookup.AddOrSetValue("hotpink",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[11823615]));
    $impl.FColorLookup.AddOrSetValue("indianred",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[6053069]));
    $impl.FColorLookup.AddOrSetValue("indigo",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[8519755]));
    $impl.FColorLookup.AddOrSetValue("ivory",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[15794175]));
    $impl.FColorLookup.AddOrSetValue("khaki",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[9234160]));
    $impl.FColorLookup.AddOrSetValue("lavender",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[16443110]));
    $impl.FColorLookup.AddOrSetValue("lavenderblush",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[16118015]));
    $impl.FColorLookup.AddOrSetValue("lawngreen",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[64636]));
    $impl.FColorLookup.AddOrSetValue("lemonchiffon",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[13499135]));
    $impl.FColorLookup.AddOrSetValue("lightblue",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[15128749]));
    $impl.FColorLookup.AddOrSetValue("lightcoral",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[8421616]));
    $impl.FColorLookup.AddOrSetValue("lightcyan",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[16777184]));
    $impl.FColorLookup.AddOrSetValue("lightgoldenrodyellow",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[13826810]));
    $impl.FColorLookup.AddOrSetValue("lightgray",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[13882323]));
    $impl.FColorLookup.AddOrSetValue("lightgreen",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[9498256]));
    $impl.FColorLookup.AddOrSetValue("lightgrey",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[13882323]));
    $impl.FColorLookup.AddOrSetValue("lightpink",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[12695295]));
    $impl.FColorLookup.AddOrSetValue("lightsalmon",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[8036607]));
    $impl.FColorLookup.AddOrSetValue("lightseagreen",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[11186720]));
    $impl.FColorLookup.AddOrSetValue("lightskyblue",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[16436871]));
    $impl.FColorLookup.AddOrSetValue("lightslategray",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[10061943]));
    $impl.FColorLookup.AddOrSetValue("lightslategrey",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[10061943]));
    $impl.FColorLookup.AddOrSetValue("lightsteelblue",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[14599344]));
    $impl.FColorLookup.AddOrSetValue("lightyellow",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[14745599]));
    $impl.FColorLookup.AddOrSetValue("lime",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[65280]));
    $impl.FColorLookup.AddOrSetValue("limegreen",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[3329330]));
    $impl.FColorLookup.AddOrSetValue("linen",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[15134970]));
    $impl.FColorLookup.AddOrSetValue("magenta",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[16711935]));
    $impl.FColorLookup.AddOrSetValue("maroon",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[128]));
    $impl.FColorLookup.AddOrSetValue("mediumaquamarine",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[11193702]));
    $impl.FColorLookup.AddOrSetValue("mediumblue",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[13434880]));
    $impl.FColorLookup.AddOrSetValue("mediumorchid",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[13850042]));
    $impl.FColorLookup.AddOrSetValue("mediumpurple",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[14381203]));
    $impl.FColorLookup.AddOrSetValue("mediumseagreen",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[7451452]));
    $impl.FColorLookup.AddOrSetValue("mediumslateblue",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[15624315]));
    $impl.FColorLookup.AddOrSetValue("mediumspringgreen",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[10156544]));
    $impl.FColorLookup.AddOrSetValue("mediumturquoise",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[13422920]));
    $impl.FColorLookup.AddOrSetValue("mediumvioletred",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[8721863]));
    $impl.FColorLookup.AddOrSetValue("midnightblue",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[7346457]));
    $impl.FColorLookup.AddOrSetValue("mintcream",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[16449525]));
    $impl.FColorLookup.AddOrSetValue("mistyrose",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[14804223]));
    $impl.FColorLookup.AddOrSetValue("moccasin",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[11920639]));
    $impl.FColorLookup.AddOrSetValue("navajowhite",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[11394815]));
    $impl.FColorLookup.AddOrSetValue("navy",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[8388608]));
    $impl.FColorLookup.AddOrSetValue("oldlace",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[15136253]));
    $impl.FColorLookup.AddOrSetValue("olive",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[32896]));
    $impl.FColorLookup.AddOrSetValue("olivedrab",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[2330219]));
    $impl.FColorLookup.AddOrSetValue("orange",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[42495]));
    $impl.FColorLookup.AddOrSetValue("orangered",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[17919]));
    $impl.FColorLookup.AddOrSetValue("orchid",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[14053594]));
    $impl.FColorLookup.AddOrSetValue("palegoldenrod",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[11200750]));
    $impl.FColorLookup.AddOrSetValue("palegreen",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[10025880]));
    $impl.FColorLookup.AddOrSetValue("paleturquoise",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[15658671]));
    $impl.FColorLookup.AddOrSetValue("palevioletred",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[9662683]));
    $impl.FColorLookup.AddOrSetValue("papayawhip",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[14020607]));
    $impl.FColorLookup.AddOrSetValue("peachpuff",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[12180223]));
    $impl.FColorLookup.AddOrSetValue("peru",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[4163021]));
    $impl.FColorLookup.AddOrSetValue("pink",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[13353215]));
    $impl.FColorLookup.AddOrSetValue("plum",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[14524637]));
    $impl.FColorLookup.AddOrSetValue("powderblue",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[15130800]));
    $impl.FColorLookup.AddOrSetValue("purple",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[8388736]));
    $impl.FColorLookup.AddOrSetValue("red",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[255]));
    $impl.FColorLookup.AddOrSetValue("rosybrown",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[9408444]));
    $impl.FColorLookup.AddOrSetValue("royalblue",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[14772545]));
    $impl.FColorLookup.AddOrSetValue("saddlebrown",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[1262987]));
    $impl.FColorLookup.AddOrSetValue("salmon",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[7504122]));
    $impl.FColorLookup.AddOrSetValue("sandybrown",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[6333684]));
    $impl.FColorLookup.AddOrSetValue("seagreen",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[5737262]));
    $impl.FColorLookup.AddOrSetValue("seashell",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[15660543]));
    $impl.FColorLookup.AddOrSetValue("sienna",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[2970272]));
    $impl.FColorLookup.AddOrSetValue("skyblue",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[15453831]));
    $impl.FColorLookup.AddOrSetValue("slateblue",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[13458026]));
    $impl.FColorLookup.AddOrSetValue("slategray",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[9470064]));
    $impl.FColorLookup.AddOrSetValue("slategrey",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[9470064]));
    $impl.FColorLookup.AddOrSetValue("snow",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[16448255]));
    $impl.FColorLookup.AddOrSetValue("springgreen",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[8388352]));
    $impl.FColorLookup.AddOrSetValue("steelblue",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[11829830]));
    $impl.FColorLookup.AddOrSetValue("violet",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[15631086]));
    $impl.FColorLookup.AddOrSetValue("thistle",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[14204888]));
    $impl.FColorLookup.AddOrSetValue("tan",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[9221330]));
    $impl.FColorLookup.AddOrSetValue("tomato",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[4678655]));
    $impl.FColorLookup.AddOrSetValue("turquoise",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[13688896]));
    $impl.FColorLookup.AddOrSetValue("wheat",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[11788021]));
    $impl.FColorLookup.AddOrSetValue("whitesmoke",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[16119285]));
    $impl.FColorLookup.AddOrSetValue("yellowgreen",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[3329434]));
    $impl.FColorLookup.AddOrSetValue("red",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[255]));
    $impl.FColorLookup.AddOrSetValue("black",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[0]));
    $impl.FColorLookup.AddOrSetValue("blue",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[16711680]));
    $impl.FColorLookup.AddOrSetValue("green",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[32768]));
    $impl.FColorLookup.AddOrSetValue("aqua",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[16776960]));
    $impl.FColorLookup.AddOrSetValue("yellow",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[65535]));
    $impl.FColorLookup.AddOrSetValue("fuchsia",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[16711935]));
    $impl.FColorLookup.AddOrSetValue("white",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[16777215]));
    $impl.FColorLookup.AddOrSetValue("lime",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[65280]));
    $impl.FColorLookup.AddOrSetValue("silver",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[12632256]));
    $impl.FColorLookup.AddOrSetValue("gray",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[8421504]));
    $impl.FColorLookup.AddOrSetValue("olive",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[32896]));
    $impl.FColorLookup.AddOrSetValue("navy",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[8388608]));
    $impl.FColorLookup.AddOrSetValue("purple",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[8388736]));
    $impl.FColorLookup.AddOrSetValue("teal",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[8421376]));
    $impl.FColorLookup.AddOrSetValue("orange",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[42495]));
    $impl.FColorLookup.AddOrSetValue("maroon",$mod.TTMSFNCGraphicsColorObject.$create("Create$1",[128]));
  };
},["WEBLib.TMSFNCUtils","SysUtils","Math"]);
rtl.module("WEBLib.TMSFNCStyles",["System","Classes","WEBLib.Graphics","WEBLib.Controls","WEBLib.Forms","WEBLib.TMSFNCTypes","WEBLib.TMSFNCCustomComponent","WEBLib.TMSFNCGraphicsTypes","JS","WEBLib.JSON"],function () {
  "use strict";
  var $mod = this;
  rtl.createInterface(this,"ITMSFNCAdaptToStyle","{3EFF288D-3927-4E86-8E9D-EF684B501C9E}",["GetAdaptToStyle","SetAdaptToStyle"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("GetAdaptToStyle",1,[],2,rtl.boolean);
    $r.addMethod("SetAdaptToStyle",0,[["Value",rtl.boolean,2]]);
    $r.addProperty("AdaptToStyle",3,rtl.boolean,"GetAdaptToStyle","SetAdaptToStyle",2);
  });
  rtl.createClass(this,"TTMSFNCStyles",pas.System.TObject,function () {
    this.ExtractColor = function (AValue) {
      var $Self = this;
      var Result = 0;
      var s = "";
      var s2 = "";
      var sl = null;
      var p = 0;
      var p2 = 0;
      function ParseValue(AValue) {
        var Result = 0;
        Result = pas.SysUtils.StrToInt(pas.SysUtils.Trim(pas.SysUtils.StringReplace(AValue,"rgb(","",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll))));
        return Result;
      };
      Result = -1;
      if (AValue !== "") {
        s = pas.SysUtils.LowerCase(pas.SysUtils.StringReplace(AValue," ","",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll)));
        if (pas.System.Pos("linear-gradient",s) === 1) {
          p = pas.System.Pos("rgb",s);
          if (p === 0) p = pas.System.Pos("#",s);
          p2 = pas.System.Pos$1(")",s,p);
          s2 = pas.System.Copy(s,p,(p2 - p) + 1);
          p = pas.System.Pos$1("rgb",s,p2);
          if (p === 0) p = pas.System.Pos("#",s);
          p2 = pas.System.Pos$1(")",s,p);
          Result = this.ExtractColor(s2);
        } else if (pas.System.Pos("rgb",s) === 1) {
          sl = pas.Classes.TStringList.$create("Create$1");
          try {
            sl.SetDelimiter(",");
            sl.SetDelimitedText(s);
            Result = pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(ParseValue(sl.Get(0)),ParseValue(sl.Get(1)),ParseValue(sl.Get(2)));
          } finally {
            sl = rtl.freeLoc(sl);
          };
        } else if (pas.System.Pos("#",s) === 1) Result = pas["WEBLib.Graphics"].HexToColor(s);
      };
      return Result;
    };
    this.ExtractColorTo = function (AValue) {
      var $Self = this;
      var Result = 0;
      var s = "";
      var s3 = "";
      var sl = null;
      var p = 0;
      var p2 = 0;
      function ParseValue(AValue) {
        var Result = 0;
        Result = pas.SysUtils.StrToInt(pas.SysUtils.Trim(pas.SysUtils.StringReplace(AValue,"rgb(","",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll))));
        return Result;
      };
      Result = -1;
      if (AValue !== "") {
        s = pas.SysUtils.LowerCase(pas.SysUtils.StringReplace(AValue," ","",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll)));
        if (pas.System.Pos("linear-gradient",s) === 1) {
          p = pas.System.Pos("rgb",s);
          if (p === 0) p = pas.System.Pos("#",s);
          p2 = pas.System.Pos$1(")",s,p);
          p = pas.System.Pos$1("rgb",s,p2);
          if (p === 0) p = pas.System.Pos("#",s);
          p2 = pas.System.Pos$1(")",s,p);
          s3 = pas.System.Copy(s,p,(p2 - p) + 1);
          Result = this.ExtractColor(s3);
        } else if (pas.System.Pos("rgb",s) === 1) {
          sl = pas.Classes.TStringList.$create("Create$1");
          try {
            sl.SetDelimiter(",");
            sl.SetDelimitedText(s);
            Result = pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(ParseValue(sl.Get(0)),ParseValue(sl.Get(1)),ParseValue(sl.Get(2)));
          } finally {
            sl = rtl.freeLoc(sl);
          };
        } else if (pas.System.Pos("#",s) === 1) Result = pas["WEBLib.Graphics"].HexToColor(s);
      };
      return Result;
    };
    this.ExtractFontName = function (AValue) {
      var Result = "";
      Result = AValue;
      return Result;
    };
    this.GetStyleBackgroundFill = function () {
      var Result = "";
      Result = this.FindCSSStyleProperty(".TMSFNCGridStyle","background");
      return Result;
    };
    this.GetStyleBackgroundStroke = function () {
      var Result = "";
      Result = this.FindCSSStyleProperty(".TMSFNCGridStyle","border-color");
      return Result;
    };
    this.GetStyleDefaultButtonFill = function () {
      var Result = "";
      Result = this.FindCSSStyleProperty(".TMSFNCButtonStyle","background");
      return Result;
    };
    this.GetStyleDefaultButtonStroke = function () {
      var Result = "";
      Result = this.FindCSSStyleProperty(".TMSFNCButtonStyle","border-color");
      return Result;
    };
    this.GetStyleEditTextColor = function () {
      var Result = "";
      Result = this.FindCSSStyleProperty(".TMSFNCEditStyle","--foreground");
      return Result;
    };
    this.GetStyleEditFill = function () {
      var Result = "";
      Result = this.FindCSSStyleProperty(".TMSFNCEditStyle","background");
      return Result;
    };
    this.GetStyleEditStroke = function () {
      var Result = "";
      Result = this.FindCSSStyleProperty(".TMSFNCStyle","border-color");
      return Result;
    };
    this.GetStyleHeaderFill = function () {
      var Result = "";
      Result = this.FindCSSStyleProperty(".TMSFNCHeaderItemStyle","background");
      return Result;
    };
    this.GetStyleHeaderStroke = function () {
      var Result = "";
      Result = this.FindCSSStyleProperty(".TMSFNCHeaderItemStyle","border-color");
      return Result;
    };
    this.GetStyleSelectionFill = function () {
      var Result = "";
      Result = this.FindCSSStyleProperty(".TMSFNCGridStyle","--selection");
      return Result;
    };
    this.GetStyleAlternativeSelectionFill = function () {
      var Result = "";
      Result = this.FindCSSStyleProperty(".TMSFNCMemoStyle","--selection");
      return Result;
    };
    this.GetStyleAlternativeBackgroundFill = function () {
      var Result = "";
      Result = this.FindCSSStyleProperty(".TMSFNCMemoStyle","background");
      return Result;
    };
    this.GetStyleAlternativeBackgroundStroke = function () {
      var Result = "";
      Result = this.FindCSSStyleProperty(".TMSFNCMemoStyle","border-color");
      return Result;
    };
    this.GetStyleFocusFill = function () {
      var Result = "";
      Result = this.FindCSSStyleProperty(".TMSFNCGridStyle","--focus");
      return Result;
    };
    this.GetStyleLineFill = function () {
      var Result = "";
      Result = this.FindCSSStyleProperty(".TMSFNCGridStyle","--linefill");
      return Result;
    };
    this.GetStyleTextFont = function () {
      var Result = "";
      Result = this.FindCSSStyleProperty(".TMSFNCHeaderItemStyle","font-family");
      return Result;
    };
    this.GetStyleTextColor = function () {
      var Result = "";
      Result = this.FindCSSStyleProperty(".TMSFNCHeaderItemStyle","color");
      return Result;
    };
    this.GetStyleAlternateBackgroundFill = function () {
      var Result = "";
      Result = this.FindCSSStyleProperty(".TMSFNCGridStyle","--alternatingrowbackground");
      return Result;
    };
    this.FindCSSStyleRule = function (ARuleName) {
      var Result = null;
      var s = "";
      var f = "";
      Result = null;
      s = ARuleName;
      f = $mod.CSSStyleFileName;
      for (var i = 0; i < document.styleSheets.length; i++){
        var fn = document.styleSheets[i].href;
        if (fn != null) {
        if (f == fn.substring(fn.lastIndexOf('/')+1)){
          var classes = document.styleSheets[i].rules || document.styleSheets[i].cssRules;
          for (var x = 0; x < classes.length; x++) {
            if (classes[x].selectorText !== undefined) {
              if (classes[x].selectorText.startsWith(s)) {
                  return classes[x];
              }
            }
          }
         }
        }
      };
      return Result;
    };
    this.FindCSSStyleProperty = function (ARuleName, APropertyName) {
      var Result = "";
      var j = null;
      var s = "";
      var v = "";
      Result = "";
      j = this.FindCSSStyleRule(ARuleName);
      if (j != null) {
        s = APropertyName;
        v = j.style.getPropertyValue(s);
        Result = v;
      };
      return Result;
    };
    this.StyleServicesEnabled = function () {
      var Result = false;
      Result = true;
      return Result;
    };
    this.GetStyleLineFillColor = function (AColor) {
      var Result = false;
      var f = "";
      var c = 0;
      Result = false;
      if (this.StyleServicesEnabled()) {
        f = this.GetStyleLineFill();
        if (f !== "") {
          c = this.ExtractColor(f);
          AColor.set(c);
          Result = c !== -1;
        };
      };
      return Result;
    };
    this.GetStyleBackgroundFillColor = function (AColor) {
      var Result = false;
      var f = "";
      var c = 0;
      Result = false;
      if (this.StyleServicesEnabled()) {
        f = this.GetStyleBackgroundFill();
        if (f !== "") {
          c = this.ExtractColor(f);
          AColor.set(c);
          Result = c !== -1;
        };
      };
      return Result;
    };
    this.GetStyleBackgroundFillColorTo = function (AColor) {
      var Result = false;
      var f = "";
      var c = 0;
      Result = false;
      if (this.StyleServicesEnabled()) {
        f = this.GetStyleBackgroundFill();
        if (f !== "") {
          c = this.ExtractColorTo(f);
          AColor.set(c);
          Result = c !== -1;
        };
      };
      return Result;
    };
    this.GetStyleAlternativeBackgroundFillColor = function (AColor) {
      var Result = false;
      var f = "";
      var c = 0;
      Result = false;
      if (this.StyleServicesEnabled()) {
        f = this.GetStyleAlternativeBackgroundFill();
        if (f !== "") {
          c = this.ExtractColor(f);
          AColor.set(c);
          Result = c !== -1;
        };
      };
      return Result;
    };
    this.GetStyleAlternativeBackgroundFillColorTo = function (AColor) {
      var Result = false;
      var f = "";
      var c = 0;
      Result = false;
      if (this.StyleServicesEnabled()) {
        f = this.GetStyleAlternativeBackgroundFill();
        if (f !== "") {
          c = this.ExtractColorTo(f);
          AColor.set(c);
          Result = c !== -1;
        };
      };
      return Result;
    };
    this.GetStyleBackgroundStrokeColor = function (AColor) {
      var Result = false;
      var f = "";
      var c = 0;
      Result = false;
      if (this.StyleServicesEnabled()) {
        f = this.GetStyleBackgroundStroke();
        if (f !== "") {
          c = this.ExtractColor(f);
          AColor.set(c);
          Result = c !== -1;
        };
      };
      return Result;
    };
    this.GetStyleHeaderFillColor = function (AColor) {
      var Result = false;
      var f = "";
      var c = 0;
      Result = false;
      if (this.StyleServicesEnabled()) {
        f = this.GetStyleHeaderFill();
        if (f !== "") {
          c = this.ExtractColor(f);
          AColor.set(c);
          Result = c !== -1;
        };
      };
      return Result;
    };
    this.GetStyleHeaderFillColorTo = function (AColor) {
      var Result = false;
      var f = "";
      var c = 0;
      Result = false;
      if (this.StyleServicesEnabled()) {
        f = this.GetStyleHeaderFill();
        if (f !== "") {
          c = this.ExtractColorTo(f);
          AColor.set(c);
          Result = c !== -1;
        };
      };
      return Result;
    };
    this.GetStyleHeaderStrokeColor = function (AColor) {
      var Result = false;
      var f = "";
      var c = 0;
      Result = false;
      if (this.StyleServicesEnabled()) {
        f = this.GetStyleHeaderStroke();
        if (f !== "") {
          c = this.ExtractColor(f);
          AColor.set(c);
          Result = c !== -1;
        };
      };
      return Result;
    };
    this.GetStyleSelectionFillColor = function (AColor) {
      var Result = false;
      var f = "";
      var c = 0;
      Result = false;
      if (this.StyleServicesEnabled()) {
        f = this.GetStyleSelectionFill();
        if (f !== "") {
          c = this.ExtractColor(f);
          AColor.set(c);
          Result = c !== -1;
        };
      };
      return Result;
    };
    this.GetStyleSelectionFillColorTo = function (AColor) {
      var Result = false;
      var f = "";
      var c = 0;
      Result = false;
      if (this.StyleServicesEnabled()) {
        f = this.GetStyleSelectionFill();
        if (f !== "") {
          c = this.ExtractColorTo(f);
          AColor.set(c);
          Result = c !== -1;
        };
      };
      return Result;
    };
    this.GetStyleTextFontColor = function (AColor) {
      var Result = false;
      var f = "";
      var c = 0;
      Result = false;
      if (this.StyleServicesEnabled()) {
        f = this.GetStyleTextColor();
        if (f !== "") {
          c = this.ExtractColor(f);
          AColor.set(c);
          Result = c !== -1;
        };
      };
      return Result;
    };
    this.GetStyleAlternativeTextFontColor = function (AColor) {
      var Result = false;
      var f = "";
      var c = 0;
      Result = false;
      if (this.StyleServicesEnabled()) {
        f = this.GetStyleEditTextColor();
        if (f !== "") {
          c = this.ExtractColor(f);
          AColor.set(c);
          Result = c !== -1;
        };
      };
      return Result;
    };
    this.GetStyleDefaultButtonFillColor = function (AColor) {
      var Result = false;
      var f = "";
      var c = 0;
      Result = false;
      if (this.StyleServicesEnabled()) {
        f = this.GetStyleDefaultButtonFill();
        if (f !== "") {
          c = this.ExtractColor(f);
          AColor.set(c);
          Result = c !== -1;
        };
      };
      return Result;
    };
    this.GetStyleDefaultButtonStrokeColor = function (AColor) {
      var Result = false;
      var f = "";
      var c = 0;
      Result = false;
      if (this.StyleServicesEnabled()) {
        f = this.GetStyleDefaultButtonStroke();
        if (f !== "") {
          c = this.ExtractColor(f);
          AColor.set(c);
          Result = c !== -1;
        };
      };
      return Result;
    };
  });
  this.$rtti.$MethodVar("TTMSFNCStylesManagerCanLoadStyleEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AStyle",rtl.string],["AComponent",pas.Classes.$rtti["TComponent"]],["ACanLoadStyle",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCStylesManagerStyleLoadedEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AStyle",rtl.string],["AComponent",pas.Classes.$rtti["TComponent"]]]), methodkind: 0});
  this.$rtti.$DynArray("TTMSFNCStylesManagerFileArray",{eltype: rtl.string});
  this.$rtti.$DynArray("TTMSFNCStylesManagerComponentArray",{eltype: pas.Classes.$rtti["TComponent"]});
  rtl.createInterface(this,"ITMSFNCStylesManager","{88852C7F-B7B5-4FFA-BB47-6D95600CB1F3}",["GetSubComponentArray"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("GetSubComponentArray",1,[],2,$mod.$rtti["TTMSFNCStylesManagerComponentArray"]);
  });
  rtl.createClass(this,"TTMSFNCStylesManagerOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FAdaptFormColor = false;
    };
    this.Create$1 = function () {
      this.FAdaptFormColor = true;
      return this;
    };
    var $r = this.$rtti;
    $r.addProperty("AdaptFormColor",0,rtl.boolean,"FAdaptFormColor","FAdaptFormColor",4,{Default: true});
  });
  rtl.createClass(this,"TTMSFNCStylesManager",pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.$init.call(this);
      this.FComponents$1 = [];
      this.FStyle = "";
      this.FStyleResource = "";
      this.FStyleForm = null;
      this.FOnCanLoadStyle = null;
      this.FOnStyleLoaded = null;
      this.FOptions = null;
    };
    this.$final = function () {
      this.FComponents$1 = undefined;
      this.FStyleForm = undefined;
      this.FOnCanLoadStyle = undefined;
      this.FOnStyleLoaded = undefined;
      this.FOptions = undefined;
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.$final.call(this);
    };
    this.SetStyle = function (Value) {
      if (this.FStyle !== Value) {
        this.FStyle = Value;
        this.LoadStyleFromFile(this.FStyle);
      };
    };
    this.SetStyleResource = function (Value) {
      if (this.FStyleResource !== Value) {
        this.FStyleResource = Value;
        if (this.FStyleResource !== "") ;
      };
    };
    this.SetOptions = function (Value) {
      this.FOptions.Assign(Value);
    };
    this.GetDocURL = function () {
      var Result = "";
      Result = pas["WEBLib.TMSFNCTypes"].TTMSFNCBaseDocURL + "tmsfnccore/components/ttmsfncstyling";
      return Result;
    };
    this.InternalLoadStyleFromJSONValue = function (AJSONValue, AComponents) {
      var $Self = this;
      var ct = "";
      var I = 0;
      var K = 0;
      var f = null;
      var io = null;
      var s = null;
      var st = "";
      var b = false;
      var sm = null;
      var arr = [];
      function IsComponentInArray(AComponent) {
        var Result = false;
        var K = 0;
        if (((rtl.length(AComponents) > 0) && (rtl.length(AComponents) === 0)) || !(rtl.length(AComponents) > 0)) {
          Result = true}
         else {
          Result = false;
          for (var $l = 0, $end = rtl.length(AComponents) - 1; $l <= $end; $l++) {
            K = $l;
            if (AComponents[K] === AComponent) {
              Result = true;
              break;
            };
          };
        };
        return Result;
      };
      function ApplyStyleToComponent(AComponent) {
        var $ir = rtl.createIntfRefs();
        try {
          if (!(AComponent != null)) return;
          if ((AComponent.$classname === ct) && IsComponentInArray(AComponent)) {
            if (pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(AComponent,pas.System.IUnknown)),rtl.getIntfGUIDR(pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence),{get: function () {
                return io;
              }, set: function (v) {
                io = v;
              }})) {
              st = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONValueAsString(AJSONValue);
              b = true;
              $Self.DoCanLoadStyle(st,AComponent,{get: function () {
                  return b;
                }, set: function (v) {
                  b = v;
                }});
              if (b) {
                s = pas.Classes.TStringStream.$create("Create$3",[st,pas.SysUtils.TEncoding.GetANSI(),true]);
                try {
                  io.LoadSettingsFromStream(s);
                } finally {
                  s = rtl.freeLoc(s);
                };
                $Self.DoStyleLoaded(st,AComponent);
              };
            };
          };
        } finally {
          $ir.free();
          rtl._Release(io);
        };
      };
      var $ir = rtl.createIntfRefs();
      try {
        f = this.FStyleForm;
        if (!(f != null)) {
          if (pas["WEBLib.Forms"].TFrame.isPrototypeOf($Self.FOwner)) {
            f = $Self.FOwner}
           else f = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetOwnerForm($Self);
        };
        if (!(f != null)) return;
        if (AJSONValue != null) {
          ct = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONProp(AJSONValue,pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.ClassTypeVariable);
          if (ct !== "") {
            for (var $l = f.GetComponentCount() - 1; $l >= 0; $l--) {
              I = $l;
              ApplyStyleToComponent(f.GetComponent(I));
              if (pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(f.GetComponent(I),pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCStylesManager),{get: function () {
                  return sm;
                }, set: function (v) {
                  sm = v;
                }})) {
                arr = sm.GetSubComponentArray();
                for (var $l1 = 0, $end = rtl.length(arr) - 1; $l1 <= $end; $l1++) {
                  K = $l1;
                  ApplyStyleToComponent(arr[K]);
                };
              };
            };
          };
        };
      } finally {
        $ir.free();
        rtl._Release(sm);
      };
    };
    this.InternalLoadStyle = function (AValue, AComponents) {
      var v = null;
      var jv = null;
      var va = null;
      var fc = null;
      var fcs = "";
      var ja = null;
      var I = 0;
      var f = null;
      var c = 0;
      v = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.ParseJSON(AValue);
      if (v != null) {
        try {
          if (this.FOptions.FAdaptFormColor) {
            fc = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONValue(v,"FormColor");
            if (fc != null) {
              fcs = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONProp(v,"FormColor");
              f = this.FStyleForm;
              if (!(f != null)) f = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetOwnerForm(this);
              if (f != null) {
                c = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor(fcs);
                f.SetColor(c);
              };
            };
          };
          va = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONValue(v,"Styles");
          if (pas["WEBLib.JSON"].TJSONArray.isPrototypeOf(va)) {
            ja = rtl.as(va,pas["WEBLib.JSON"].TJSONArray);
            for (var $l = 0, $end = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONArraySize(ja) - 1; $l <= $end; $l++) {
              I = $l;
              jv = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONArrayItem(ja,I);
              if (jv != null) this.InternalLoadStyleFromJSONValue(jv,rtl.arrayRef(AComponents));
            };
          } else {
            if (v != null) this.InternalLoadStyleFromJSONValue(v,rtl.arrayRef(AComponents));
          };
        } finally {
          v = rtl.freeLoc(v);
        };
      };
    };
    this.DoCanLoadStyle = function (AStyle, AComponent, ACanLoadStyle) {
      if (this.FOnCanLoadStyle != null) this.FOnCanLoadStyle(this,AStyle,AComponent,ACanLoadStyle);
    };
    this.DoStyleLoaded = function (AStyle, AComponent) {
      if (this.FOnStyleLoaded != null) this.FOnStyleLoaded(this,AStyle,AComponent);
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.Create$1.apply(this,arguments);
      this.FOptions = $mod.TTMSFNCStylesManagerOptions.$create("Create$1");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FOptions");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.LoadStyleFromText = function (AText) {
      var a = [];
      a = rtl.arraySetLength(a,null,0);
      this.InternalLoadStyle(AText,rtl.arrayRef(a));
    };
    this.LoadStyleFromStream = function (AStream) {
      var a = [];
      a = rtl.arraySetLength(a,null,0);
      this.LoadStyleFromStream$1(AStream,rtl.arrayRef(a));
    };
    this.LoadStyleFromFile = function (AFile) {
      var a = [];
      a = rtl.arraySetLength(a,null,0);
      this.LoadStyleFromFile$1(AFile,rtl.arrayRef(a));
    };
    this.LoadStyleFromText$1 = function (AText, AComponents) {
      this.InternalLoadStyle(AText,rtl.arrayRef(AComponents));
    };
    this.LoadStyleFromStream$1 = function (AStream, AComponents) {
      var ss = null;
      ss = pas.Classes.TStringStream.$create("Create$1");
      try {
        ss.LoadFromStream(AStream);
        this.InternalLoadStyle(ss.GetDataString(),rtl.arrayRef(AComponents));
      } finally {
        ss = rtl.freeLoc(ss);
      };
    };
    this.LoadStyleFromFile$1 = function (AFile, AComponents) {
      var $Self = this;
      var ss = null;
      ss = pas.Classes.TStringStream.$create("Create$1");
      try {
        this.FComponents$1 = rtl.arrayRef(AComponents);
        ss.LoadFromFile(AFile,function () {
          $Self.InternalLoadStyle(ss.GetDataString(),rtl.arrayRef(AComponents));
          ss = rtl.freeLoc(ss);
        },null);
      } finally {
      };
    };
    this.LoadStyleFromURL = function (AURL, AComponents) {
      this.LoadStyleFromFile$1(AURL,rtl.arrayRef(AComponents));
    };
    this.LoadStyleFromURL$1 = function (AURL) {
      var a = [];
      a = rtl.arraySetLength(a,null,0);
      this.LoadStyleFromFile$1(AURL,rtl.arrayRef(a));
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Options",2,$mod.$rtti["TTMSFNCStylesManagerOptions"],"FOptions","SetOptions");
    $r.addProperty("Style",2,rtl.string,"FStyle","SetStyle");
    $r.addProperty("StyleResource",2,rtl.string,"FStyleResource","SetStyleResource");
    $r.addProperty("OnCanLoadStyle",0,$mod.$rtti["TTMSFNCStylesManagerCanLoadStyleEvent"],"FOnCanLoadStyle","FOnCanLoadStyle");
    $r.addProperty("OnStyleLoaded",0,$mod.$rtti["TTMSFNCStylesManagerStyleLoadedEvent"],"FOnStyleLoaded","FOnStyleLoaded");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
  this.CSSStyleFileName = "";
},["WEBLib.TMSFNCUtils","SysUtils","WEBLib.TMSFNCPersistence","WEBLib.TMSFNCGraphics"]);
rtl.module("WEBLib.DesignIntf",["System","Classes","Web","JS","TypInfo","WEBLib.Forms","WEBLib.Menus"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.$rtti.$Interface("IMenuItem");
  rtl.createInterface(this,"IMenuItems","{1F683FB4-D9CF-4CC7-934D-99A300314500}",["GetItem","SameAs","Find","FindByName","Count","Clear","AddItem","InsertItem","InsertItem$1","AddLine","InsertLine","InsertLine$1"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("GetItem",1,[["Index",rtl.longint]],2,$mod.$rtti["IMenuItem"]);
    $r.addMethod("SameAs",1,[["AItem",pas.System.$rtti["IUnknown"],2]],2,rtl.boolean);
    $r.addMethod("Find",1,[["ACaption",pas.System.$rtti["WideString"],2]],2,$mod.$rtti["IMenuItem"]);
    $r.addMethod("FindByName",1,[["AName",rtl.string,2]],2,$mod.$rtti["IMenuItem"]);
    $r.addMethod("Count",1,[],2,rtl.longint);
    $r.addProperty("Items",1,$mod.$rtti["IMenuItem"],"GetItem","",2);
    $r.addMethod("Clear",0,[]);
    $r.addMethod("AddItem",1,[["ACaption",pas.System.$rtti["WideString"],2],["AShortCut",pas["WEBLib.Menus"].$rtti["TShortCut"]],["AChecked",rtl.boolean],["AEnabled",rtl.boolean],["AOnClick",pas.Classes.$rtti["TNotifyEvent"]],["hCtx",pas["WEBLib.Menus"].$rtti["THelpContext"]],["AName",rtl.string,2]],2,$mod.$rtti["IMenuItem"]);
    $r.addMethod("InsertItem",1,[["ACaption",pas.System.$rtti["WideString"],2],["AShortCut",pas["WEBLib.Menus"].$rtti["TShortCut"]],["AChecked",rtl.boolean],["AEnabled",rtl.boolean],["AOnClick",pas.Classes.$rtti["TNotifyEvent"]],["hCtx",pas["WEBLib.Menus"].$rtti["THelpContext"]],["AName",rtl.string,2]],2,$mod.$rtti["IMenuItem"]);
    $r.addMethod("InsertItem$1",1,[["Index",rtl.longint],["ACaption",pas.System.$rtti["WideString"],2],["AShortCut",pas["WEBLib.Menus"].$rtti["TShortCut"]],["AChecked",rtl.boolean],["AEnabled",rtl.boolean],["AOnClick",pas.Classes.$rtti["TNotifyEvent"]],["hCtx",pas["WEBLib.Menus"].$rtti["THelpContext"]],["AName",rtl.string,2]],2,$mod.$rtti["IMenuItem"]);
    $r.addMethod("AddLine",1,[["AName",rtl.string,2]],2,$mod.$rtti["IMenuItem"]);
    $r.addMethod("InsertLine",1,[["AName",rtl.string,2]],2,$mod.$rtti["IMenuItem"]);
    $r.addMethod("InsertLine$1",1,[["Index",rtl.longint],["AName",rtl.string,2]],2,$mod.$rtti["IMenuItem"]);
  });
  rtl.createInterface(this,"IMenu","{C24B5609-AD3A-4246-8FDC-65B57EFA75AA}",["Items"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("Items",1,[],2,$mod.$rtti["IMenuItems"]);
  });
  rtl.createInterface(this,"IMainMenu","{4605DA9D-79C3-4969-8DC4-FAD9B96D287B}",[],this.IMenu,function () {
  });
  rtl.createInterface(this,"IPopupMenu","{16ABD57D-6CC6-4004-B4FD-53C46429894F}",["Popup","PopupComponent"],this.IMenu,function () {
    var $r = this.$rtti;
    $r.addMethod("Popup",0,[["X",rtl.longint],["Y",rtl.longint]]);
    $r.addMethod("PopupComponent",1,[],2,pas.Classes.$rtti["TComponent"]);
  });
  rtl.createInterface(this,"IMenuItem","{FEA8F8DA-E0D9-4DB3-B7B7-C1C38394BA17}",["GetCaption","SetCaption","GetChecked","SetChecked","GetEnabled","SetEnabled","GetGroupIndex","SetGroupIndex","GetHelpContext","SetHelpContext","GetHint","SetHint","GetRadioItem","SetRadioItem","GetShortCut","SetShortCut","GetTag","SetTag","GetVisible","SetVisible","Name","MenuIndex","Parent","HasParent","IsLine"],this.IMenuItems,function () {
    var $r = this.$rtti;
    $r.addMethod("GetCaption",1,[],2,pas.System.$rtti["WideString"]);
    $r.addMethod("SetCaption",0,[["ACaption",pas.System.$rtti["WideString"],2]]);
    $r.addMethod("GetChecked",1,[],2,rtl.boolean);
    $r.addMethod("SetChecked",0,[["AChecked",rtl.boolean]]);
    $r.addMethod("GetEnabled",1,[],2,rtl.boolean);
    $r.addMethod("SetEnabled",0,[["AEnabled",rtl.boolean]]);
    $r.addMethod("GetGroupIndex",1,[],2,rtl.byte);
    $r.addMethod("SetGroupIndex",0,[["AGroupIndex",rtl.byte]]);
    $r.addMethod("GetHelpContext",1,[],2,pas["WEBLib.Menus"].$rtti["THelpContext"]);
    $r.addMethod("SetHelpContext",0,[["AHelpContext",pas["WEBLib.Menus"].$rtti["THelpContext"]]]);
    $r.addMethod("GetHint",1,[],2,rtl.string);
    $r.addMethod("SetHint",0,[["AHint",rtl.string,2]]);
    $r.addMethod("GetRadioItem",1,[],2,rtl.boolean);
    $r.addMethod("SetRadioItem",0,[["ARadioItem",rtl.boolean]]);
    $r.addMethod("GetShortCut",1,[],2,pas["WEBLib.Menus"].$rtti["TShortCut"]);
    $r.addMethod("SetShortCut",0,[["AShortCut",pas["WEBLib.Menus"].$rtti["TShortCut"]]]);
    $r.addMethod("GetTag",1,[],2,rtl.longint);
    $r.addMethod("SetTag",0,[["AValue",rtl.longint]]);
    $r.addMethod("GetVisible",1,[],2,rtl.boolean);
    $r.addMethod("SetVisible",0,[["AVisible",rtl.boolean]]);
    $r.addMethod("Name",1,[],2,pas.Classes.$rtti["TComponentName"]);
    $r.addMethod("MenuIndex",1,[],2,rtl.longint);
    $r.addMethod("Parent",1,[],2,$r);
    $r.addMethod("HasParent",1,[],2,rtl.boolean);
    $r.addMethod("IsLine",1,[],2,rtl.boolean);
    $r.addProperty("Caption",3,pas.System.$rtti["WideString"],"GetCaption","SetCaption",2);
    $r.addProperty("Checked",3,rtl.boolean,"GetChecked","SetChecked",2);
    $r.addProperty("Enabled",3,rtl.boolean,"GetEnabled","SetEnabled",2);
    $r.addProperty("GroupIndex",3,rtl.byte,"GetGroupIndex","SetGroupIndex",2);
    $r.addProperty("HelpContext",3,pas["WEBLib.Menus"].$rtti["THelpContext"],"GetHelpContext","SetHelpContext",2);
    $r.addProperty("Hint",3,rtl.string,"GetHint","SetHint",2);
    $r.addProperty("RadioItem",3,rtl.boolean,"GetRadioItem","SetRadioItem",2);
    $r.addProperty("ShortCut",3,pas["WEBLib.Menus"].$rtti["TShortCut"],"GetShortCut","SetShortCut",2);
    $r.addProperty("Tag",3,rtl.longint,"GetTag","SetTag",2);
    $r.addProperty("Visible",3,rtl.boolean,"GetVisible","SetVisible",2);
  });
  rtl.createInterface(this,"IMenuItem2","{7BB2E6D5-A47D-4ECD-B891-29ECB256199F}",["Click"],this.IMenuItem,function () {
    var $r = this.$rtti;
    $r.addMethod("Click",0,[]);
  });
  this.$rtti.$MethodVar("TLoadJavaScriptCallBack",{procsig: rtl.newTIProcSig([["AJavaScriptFile",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TErrorJavaScriptCallBack",{procsig: rtl.newTIProcSig([["AError",pas.Web.$rtti["TJSErrorEvent"]]]), methodkind: 0});
  this.$rtti.$ClassRef("TComponentClass",{instancetype: pas.Classes.$rtti["TComponent"]});
  this.$rtti.$DynArray("TIconArray",{eltype: rtl.string});
  this.$rtti.$DynArray("TComponentClassArray",{eltype: this.$rtti["TComponentClass"]});
  rtl.createClass(this,"TRegisteredComponent",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FClass = null;
      this.FIcon = "";
      this.FPage = "";
    };
    this.$final = function () {
      this.FClass = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function (APage, AClass, AIcon) {
      this.FPage = APage;
      this.FClass = AClass;
      this.FIcon = AIcon;
      return this;
    };
  });
  rtl.createInterface(this,"IDesignerSelections","{2A041D7A-7175-3AD1-B2C4-57B3F6EDFAF4}",["Add","Get","GetCount"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("Add",1,[["Item",pas.Classes.$rtti["TPersistent"],2]],2,rtl.longint);
    $r.addMethod("Get",1,[["Index",rtl.longint]],2,pas.Classes.$rtti["TPersistent"]);
    $r.addMethod("GetCount",1,[],2,rtl.longint);
    $r.addProperty("Count",1,rtl.longint,"GetCount","",2);
    $r.addProperty("Items",1,pas.Classes.$rtti["TPersistent"],"Get","",2);
  });
  this.$rtti.$ProcVar("TGetStrProc",{procsig: rtl.newTIProcSig([["AUnitName",rtl.string]])});
  rtl.createClass(this,"TSelectionEditor",pas.System.TObject,function () {
    this.RequiresUnits = function (Proc) {
    };
  });
  this.$rtti.$ClassRef("TSelectionEditorClass",{instancetype: this.$rtti["TSelectionEditor"]});
  rtl.createClass(this,"TRegisteredSelectionEditor",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FClass = null;
      this.FEditor = null;
    };
    this.$final = function () {
      this.FClass = undefined;
      this.FEditor = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function (AClass, AEditorClass) {
      pas.System.TObject.Create.call(this);
      this.FClass = AClass;
      this.FEditor = AEditorClass;
      return this;
    };
  });
  rtl.createClass(this,"TLibraryRequirementsEditor",pas.System.TObject,function () {
    this.RequiresLibraries = function (Proc) {
    };
  });
  this.$rtti.$ClassRef("TLibraryRequirementsEditorClass",{instancetype: this.$rtti["TLibraryRequirementsEditor"]});
  rtl.createClass(this,"TRegisteredLibraryRequirementsEditor",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FClass = null;
      this.FEditor = null;
    };
    this.$final = function () {
      this.FClass = undefined;
      this.FEditor = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function (AClass, AEditorClass) {
      pas.System.TObject.Create.call(this);
      this.FClass = AClass;
      this.FEditor = AEditorClass;
      return this;
    };
  });
  this.TPropertyAttribute = {"0": "paDialog", paDialog: 0, "1": "paValueList", paValueList: 1, "2": "paSortList", paSortList: 2, "3": "paValueEditable", paValueEditable: 3, "4": "paSubProperties", paSubProperties: 4};
  this.$rtti.$Enum("TPropertyAttribute",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TPropertyAttribute});
  this.$rtti.$Set("TPropertyAttributes",{comptype: this.$rtti["TPropertyAttribute"]});
  rtl.createClass(this,"TPropertyEditor",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FComponent = null;
      this.FPropertyName = "";
      this.FPropertyInfo = null;
      this.FResultProc = null;
    };
    this.$final = function () {
      this.FComponent = undefined;
      this.FPropertyInfo = undefined;
      this.FResultProc = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.GetStrValue = function () {
      var Result = "";
      Result = this.GetStrValueAt(0);
      return Result;
    };
    this.GetStrValueAt = function (Index) {
      var Result = "";
      Result = pas.TypInfo.GetStrProp$1(this.FComponent,this.FPropertyInfo);
      return Result;
    };
    this.SetStrValue = function (Value) {
      pas.TypInfo.SetStrProp$1(this.FComponent,this.FPropertyInfo,Value);
    };
    this.Modified = function () {
    };
    this.Create$1 = function () {
      this.FPropertyName = "";
      this.FPropertyInfo = null;
      return this;
    };
    this.Edit = function () {
      this.Edit$1(null);
    };
    this.Edit$1 = function (AProc) {
      this.FResultProc = AProc;
    };
    this.GetAttributes = function () {
      var Result = {};
      Result = rtl.createSet($mod.TPropertyAttribute.paDialog);
      return Result;
    };
    this.GetValue = function () {
      var Result = "";
      Result = "(Unknown)";
      return Result;
    };
    this.GetComponent = function () {
      var Result = null;
      Result = this.FComponent;
      return Result;
    };
    this.GetComponent$1 = function (Index) {
      var Result = null;
      Result = this.FComponent;
      return Result;
    };
    this.GetValues = function (Proc) {
    };
    this.SetValue = function (Value) {
    };
    this.GetOrdValue = function () {
      var Result = 0;
      Result = this.GetOrdValueAt(0);
      return Result;
    };
    this.GetOrdValueAt = function (Index) {
      var Result = 0;
      Result = pas.TypInfo.GetOrdProp$1(this.FComponent,this.FPropertyInfo);
      return Result;
    };
    this.GetObjectValue = function () {
      var Result = null;
      Result = this.GetObjectValueAt(0);
      return Result;
    };
    this.GetObjectValueAt = function (Index) {
      var Result = null;
      Result = pas.TypInfo.GetObjectProp$2(this.FComponent,this.FPropertyInfo);
      return Result;
    };
    this.SetOrdValue = function (Value) {
      pas.TypInfo.SetOrdProp$1(this.FComponent,this.FPropertyInfo,Value);
    };
  });
  rtl.createClass(this,"TStringProperty",this.TPropertyEditor,function () {
    this.GetValue = function () {
      var Result = "";
      Result = this.GetStrValue();
      return Result;
    };
    this.SetValue = function (Value) {
      this.SetStrValue(Value);
    };
  });
  rtl.createClass(this,"TIntegerProperty",this.TPropertyEditor,function () {
  });
  rtl.createClass(this,"TClassProperty",this.TPropertyEditor,function () {
  });
  this.$rtti.$ClassRef("TPropertyEditorClass",{instancetype: this.$rtti["TPropertyEditor"]});
  rtl.createClass(this,"TRegisteredPropertyEditor",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FClass = null;
      this.FPropertyName = "";
      this.FPropertyType = null;
      this.FEditor = null;
    };
    this.$final = function () {
      this.FClass = undefined;
      this.FEditor = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function (APropertyType, AClass, AProperty, AEditor) {
      pas.System.TObject.Create.call(this);
      this.FClass = AClass;
      this.FPropertyName = AProperty;
      this.FPropertyType = APropertyType;
      this.FEditor = AEditor;
      return this;
    };
  });
  rtl.createClass(this,"TRegisteredIgnoredProperty",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FClass = null;
      this.FPropertyName = "";
    };
    this.$final = function () {
      this.FClass = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function (AClass, AProperty) {
      pas.System.TObject.Create.call(this);
      this.FClass = AClass;
      this.FPropertyName = AProperty;
      return this;
    };
  });
  rtl.createClass(this,"TComponentEditor",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FComponent = null;
      this.FResultProc = null;
      this.FExecResultProc = null;
    };
    this.$final = function () {
      this.FComponent = undefined;
      this.FResultProc = undefined;
      this.FExecResultProc = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Edit = function () {
      this.Edit$1(null);
    };
    this.Edit$1 = function (AProc) {
      this.FResultProc = AProc;
    };
    this.ExecuteVerb = function (Index) {
      this.ExecuteVerb$1(Index,null);
    };
    this.ExecuteVerb$1 = function (Index, AProc) {
      this.FExecResultProc = AProc;
    };
    this.PrepareItem = function (Index, AItem) {
    };
    this.GetVerb = function (Index) {
      var Result = "";
      Result = "";
      return Result;
    };
    this.GetVerbCount = function () {
      var Result = 0;
      Result = 0;
      return Result;
    };
    this.GetComponent = function () {
      var Result = null;
      Result = this.FComponent;
      return Result;
    };
    this.GetComponent$1 = function (Index) {
      var Result = null;
      Result = this.FComponent;
      return Result;
    };
    this.GetDefaultProperty = function () {
      var Result = "";
      Result = "";
      return Result;
    };
  });
  this.$rtti.$ClassRef("TComponentEditorClass",{instancetype: this.$rtti["TComponentEditor"]});
  rtl.createClass(this,"TRegisteredComponentEditor",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FClass = null;
      this.FEditor = null;
    };
    this.$final = function () {
      this.FClass = undefined;
      this.FEditor = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function (AClass, AEditorClass) {
      pas.System.TObject.Create.call(this);
      this.FClass = AClass;
      this.FEditor = AEditorClass;
      return this;
    };
  });
  rtl.createClass(this,"TDefaultEditor",this.TComponentEditor,function () {
  });
  this.$rtti.$ProcVar("TIdentToInt",{procsig: rtl.newTIProcSig([["Ident",rtl.string,2],["Int",rtl.longint,1]],rtl.boolean)});
  this.$rtti.$ProcVar("TIntToIdent",{procsig: rtl.newTIProcSig([["Int",rtl.longint],["Ident",rtl.string,1]],rtl.boolean)});
  rtl.createClass(this,"TRegisteredIdentToInt",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FIdentToInt = null;
      this.FIntToIdent = null;
      this.FPropertyType = null;
    };
    this.$final = function () {
      this.FIdentToInt = undefined;
      this.FIntToIdent = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function (APropertyType, AIdentToInt, AIntToIdent) {
      this.FPropertyType = APropertyType;
      this.FIdentToInt = AIdentToInt;
      this.FIntToIdent = AIntToIdent;
      return this;
    };
  });
  var cPNGExt = "_PNG";
  this.RegisterComponents = function (Page, ComponentClasses, Icons) {
    var I = 0;
    var c = null;
    var ic = "";
    for (var $l = 0, $end = rtl.length(ComponentClasses) - 1; $l <= $end; $l++) {
      I = $l;
      c = ComponentClasses[I];
      if (rtl.length(Icons) > 0) {
        ic = Icons[I]}
       else ic = "";
      if (ic === "") ic = $impl.TIconDataDict.Find(c.$classname + cPNGExt);
      if (ic === "") ic = $impl.TIconDataDict.Find(c.$classname);
      $impl.RegisteredComponentList[c.$classname] = $mod.TRegisteredComponent.$create("Create$1",[Page,c,ic]);
    };
  };
  this.RegisterSelectionEditor = function (AClass, AEditorClass) {
    $impl.RegisteredSelectionEditorList[AClass.$classname] = $mod.TRegisteredSelectionEditor.$create("Create$1",[AClass,AEditorClass]);
  };
  this.RegisterPropertyEditor = function (PropertyType, ComponentClass, PropertyName, EditorClass) {
    var LKey = "";
    var LType = "";
    var LClass = "";
    LType = "";
    if (PropertyType != null) LType = PropertyType.name;
    LClass = "";
    if (ComponentClass != null) LClass = ComponentClass.$classname;
    LKey = LType + "_" + LClass + "_" + PropertyName;
    $impl.RegisteredPropertyEditorList[LKey] = $mod.TRegisteredPropertyEditor.$create("Create$1",[PropertyType,ComponentClass,PropertyName,EditorClass]);
  };
  this.RegisterComponentEditor = function (AClass, ComponentEditor) {
    $impl.RegisteredComponentEditorList[AClass.$classname] = $mod.TRegisteredComponentEditor.$create("Create$1",[AClass,ComponentEditor]);
  };
  this.RegisterIgnoredProperty = function (ComponentClass, PropertyName) {
    var LKey = "";
    var LClass = "";
    LClass = "";
    if (ComponentClass != null) LClass = ComponentClass.$classname;
    LKey = LClass + "_" + PropertyName;
    $impl.RegisteredIgnoredPropertyList[LKey] = $mod.TRegisteredIgnoredProperty.$create("Create$1",[ComponentClass,PropertyName]);
  };
  this.RegisterLibraryRequirementsEditor = function (AClass, AEditorClass) {
    $impl.RegisteredLibraryRequirementsEditorList[AClass.$classname] = $mod.TRegisteredLibraryRequirementsEditor.$create("Create$1",[AClass,AEditorClass]);
  };
  this.RegisterIcon = function (AComponentName, AIconName, AUnitName) {
    $impl.TIconDataDict.Add(AComponentName,AIconName,AUnitName);
  };
  this.GetRegisteredComponents = function (List) {
    var a = Object.keys($impl.RegisteredComponentList).map(function(key) {
          return [$impl.RegisteredComponentList[key]];
        });
    
        a.forEach(function(element) {
          List.Add(element[0]);
        });
  };
  this.GetRegisteredPages = function (List) {
    var a = Object.keys($impl.RegisteredComponentList).map(function(key) {
          return [$impl.RegisteredComponentList[key]];
        });
    
        a.forEach(function(element) {
          var p = element[0].FPage;
          if (List.IndexOf(p) == -1) {
            List.Add(element[0].FPage);
          }
        });
  };
  this.GetSelectionEditors = function (List) {
    var a = Object.keys($impl.RegisteredSelectionEditorList).map(function(key) {
          return [$impl.RegisteredSelectionEditorList[key]];
        });
    
        a.forEach(function(element) {
          List.Add(element[0]);
        });
  };
  this.LoadComponentFromJavaScript = function (JavaScriptFile, CallBack, ErrorCallBack) {
    var self = this;
        var JavaScript = {
          loadcomponent: function(src) {
            var n = src.substr(0, src.lastIndexOf("."));
            if (!pas[n]) {
              var script = document.createElement('script'), loaded;
              script.async = false;
              script.setAttribute('src', src);
              script.onerror = function(e){
                if (ErrorCallBack != null)
                {
                  ErrorCallBack(e);
                }
              }
              script.onreadystatechange = script.onload = function() {
                if (!loaded) {
                  if (CallBack != null)
                    CallBack(src);
                }
                loaded = true;
              };
              document.getElementsByTagName('head')[0].appendChild(script);
            }
          }
        };
    
        JavaScript.loadcomponent(JavaScriptFile);
  };
  this.InitializeComponentFromJavaScript = function (JavaScriptFile) {
    var src = "";
    if ($mod.IsComponentFromJavaScriptLoaded(JavaScriptFile)) {
      src = JavaScriptFile;
      var n = src.substr(0, src.lastIndexOf("."))
      var module = pas[n];
      rtl.loadintf(module);
      rtl.loadimpl(module);
    };
  };
  this.GetRegisteredComponentClass = function (ComponentClassName) {
    var Result = null;
    var r = null;
    Result = null;
    r = $mod.GetRegisteredComponent(ComponentClassName);
    if (r != null) Result = r.FClass;
    return Result;
  };
  this.GetRegisteredComponent = function (ComponentClassName) {
    var Result = null;
    var res = null;
    Result = null;
    if (ComponentClassName === "") return Result;
    res = null;
    var a = Object.keys($impl.RegisteredComponentList).map(function(key) {
          return [$impl.RegisteredComponentList[key]];
        });
    
        for (let el of a) {
          if (el[0].FClass.$classname.toLowerCase() == ComponentClassName.toLowerCase()) {
            res = el[0];
            break; }
        };
    Result = res;
    return Result;
  };
  this.GetRegisteredSelectionEditor = function (ComponentClassName) {
    var Result = null;
    var cn = "";
    var c = null;
    Result = null;
    if (ComponentClassName === "") return Result;
    c = pas.Classes.GetClass(ComponentClassName);
    if (!(c != null)) {
      c = $mod.GetRegisteredComponentClass(ComponentClassName);
      if (!(c != null)) return null;
    };
    do {
      cn = c.$classname;
      Result = rtl.getObject($impl.RegisteredSelectionEditorList[cn]);
      if (Result != null) return Result;
      c = c.$ancestor;
    } while (c != null);
    return Result;
  };
  this.GetRegisteredLibraryRequirementsEditor = function (ComponentClassName) {
    var Result = null;
    var cn = "";
    var c = null;
    Result = null;
    if (ComponentClassName === "") return Result;
    c = pas.Classes.GetClass(ComponentClassName);
    if (!(c != null)) return null;
    do {
      cn = c.$classname;
      Result = rtl.getObject($impl.RegisteredLibraryRequirementsEditorList[cn]);
      if (Result != null) return Result;
      c = c.$ancestor;
    } while (c != null);
    return Result;
  };
  this.GetRegisteredPropertyEditor = function (PropertyType, AClass, AProperty) {
    var Result = null;
    var LKey = "";
    var LType = "";
    var LPropEditor = null;
    var LList = null;
    var i = 0;
    var c = null;
    Result = null;
    LType = PropertyType.name;
    LKey = LType + "__";
    LPropEditor = rtl.getObject($impl.RegisteredPropertyEditorList[LKey]);
    if (LPropEditor != null) Result = LPropEditor;
    if (!(Result != null) && (AClass != null) && (AProperty !== "")) {
      c = AClass;
      do {
        LKey = LType + "_" + c.$classname + "_" + AProperty;
        LPropEditor = rtl.getObject($impl.RegisteredPropertyEditorList[LKey]);
        if (LPropEditor != null) {
          Result = LPropEditor;
          break;
        };
        c = c.$ancestor;
      } while (c != null);
    };
    if (!(Result != null)) {
      LList = pas.Classes.TList.$create("Create$1");
      $impl.GetPropertyEditors(LList);
      for (var $l = 0, $end = LList.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        LPropEditor = rtl.getObject(LList.Get(i));
        if (LPropEditor.FPropertyType === PropertyType) {
          if ((LPropEditor.FPropertyName === "") || (LPropEditor.FPropertyName === AProperty)) {
            if (!(LPropEditor.FClass != null)) {
              Result = LPropEditor;
              break;
            } else if (AClass != null) {
              c = AClass;
              do {
                if (LPropEditor.FClass.$classname === c.$classname) {
                  Result = LPropEditor;
                  break;
                };
                c = c.$ancestor;
              } while (c != null);
              if (Result != null) break;
            };
          };
        };
      };
      LList = rtl.freeLoc(LList);
    };
    return Result;
  };
  this.GetRegisteredComponentEditor = function (AClass) {
    var Result = null;
    var cn = "";
    var c = null;
    Result = null;
    if (!(AClass != null)) return Result;
    c = AClass;
    if (!(c != null)) return null;
    do {
      cn = c.$classname;
      Result = rtl.getObject($impl.RegisteredComponentEditorList[cn]);
      if (Result != null) return Result;
      c = c.$ancestor;
    } while (c != null);
    return Result;
  };
  this.IsComponentFromJavaScriptLoaded = function (JavaScriptFile) {
    var Result = false;
    var src = "";
    src = JavaScriptFile;
    var n = src.substr(0, src.lastIndexOf("."))
    return (pas[n]);
    return Result;
  };
  this.IsIgnoredProperty = function (AClass, AProperty) {
    var Result = false;
    var LKey = "";
    var LIgnoredProperty = null;
    Result = false;
    if (!(AClass != null)) {
      LKey = "_" + AProperty;
      LIgnoredProperty = rtl.getObject($impl.RegisteredIgnoredPropertyList[LKey]);
      if (LIgnoredProperty != null) {
        Result = true;
      };
    } else if ((AClass != null) && (AProperty !== "")) {
      LKey = AClass.$classname + "_" + AProperty;
      LIgnoredProperty = rtl.getObject($impl.RegisteredIgnoredPropertyList[LKey]);
      if (LIgnoredProperty != null) {
        Result = true;
      } else {
        LKey = "_" + AProperty;
        LIgnoredProperty = rtl.getObject($impl.RegisteredIgnoredPropertyList[LKey]);
        if (LIgnoredProperty != null) {
          Result = true;
        };
      };
    };
    return Result;
  };
  this.RegisterIntegerConsts = function (IntegerPropertyType, AIdentToInt, AIntToIdent) {
    var LKey = "";
    LKey = IntegerPropertyType.name;
    $impl.RegisteredIdentToIntList[LKey] = $mod.TRegisteredIdentToInt.$create("Create$1",[IntegerPropertyType,AIdentToInt,AIntToIdent]);
  };
  this.GetRegisteredIdentToInt = function (IntegerPropertyType) {
    var Result = null;
    var ri = null;
    var LKey = "";
    Result = null;
    LKey = IntegerPropertyType.name;
    ri = rtl.getObject($impl.RegisteredIdentToIntList[LKey]);
    if (ri != null) Result = ri.FIdentToInt;
    return Result;
  };
  this.GetRegisteredIntToIdent = function (IntegerPropertyType) {
    var Result = null;
    var ri = null;
    var LKey = "";
    Result = null;
    LKey = IntegerPropertyType.name;
    ri = rtl.getObject($impl.RegisteredIdentToIntList[LKey]);
    if (ri != null) Result = ri.FIntToIdent;
    return Result;
  };
  $mod.$implcode = function () {
    rtl.createClass($impl,"TIconData",pas.System.TObject,function () {
      this.$init = function () {
        pas.System.TObject.$init.call(this);
        this.FNameConst = "";
        this.FNameUnit = "";
      };
    });
    rtl.createClass($impl,"TIconDataDict",pas.System.TObject,function () {
      this.FDict = null;
      this.Add = function (AComponentName, AConstantName, AUnitName) {
        var lData = null;
        if (this.FDict === null) $impl.TIconDataDict.FDict = pas["Generics.Collections"].TObjectDictionary$$$G$$generics$collections$$String$$TIconData.$create("Create$5",[rtl.createSet(pas["Generics.Collections"].TDictionaryOwnership.doOwnsValues)]);
        if (this.FDict.TryGetValue(pas.SysUtils.TStringHelper.ToUpper.call({get: function () {
            return AComponentName;
          }, set: function (v) {
            rtl.raiseE("EPropReadOnly");
          }}),{get: function () {
            return lData;
          }, set: function (v) {
            lData = v;
          }})) return;
        lData = $impl.TIconData.$create("Create");
        try {
          lData.FNameConst = AConstantName;
          lData.FNameUnit = AUnitName;
          if (pas.SysUtils.TStringHelper.IsEmpty.call({p: lData, get: function () {
              return this.p.FNameConst;
            }, set: function (v) {
              this.p.FNameConst = v;
            }})) ;
          if (pas.SysUtils.TStringHelper.IsEmpty.call({p: lData, get: function () {
              return this.p.FNameUnit;
            }, set: function (v) {
              this.p.FNameUnit = v;
            }})) ;
          this.FDict.Add(pas.SysUtils.TStringHelper.ToUpper.call({get: function () {
              return AComponentName;
            }, set: function (v) {
              rtl.raiseE("EPropReadOnly");
            }}),lData);
          lData = null;
        } finally {
          lData = rtl.freeLoc(lData);
        };
      };
      this.Find = function (AComponentName) {
        var Result = "";
        var lData = null;
        Result = pas.SysUtils.TStringHelper.Empty;
        if ((this.FDict === null) || !this.FDict.TryGetValue(pas.SysUtils.TStringHelper.ToUpper.call({get: function () {
            return AComponentName;
          }, set: function (v) {
            rtl.raiseE("EPropReadOnly");
          }}),{get: function () {
            return lData;
          }, set: function (v) {
            lData = v;
          }})) return Result;
        Result = pas[lData.FNameUnit][lData.FNameConst];
        return Result;
      };
    });
    $impl.RegisteredComponentList = null;
    $impl.RegisteredSelectionEditorList = null;
    $impl.RegisteredPropertyEditorList = null;
    $impl.RegisteredIgnoredPropertyList = null;
    $impl.RegisteredLibraryRequirementsEditorList = null;
    $impl.RegisteredComponentEditorList = null;
    $impl.RegisteredIdentToIntList = null;
    $impl.GetPropertyEditors = function (List) {
      var a = Object.keys($impl.RegisteredPropertyEditorList).map(function(key) {
            return [$impl.RegisteredPropertyEditorList[key]];
          });
      
          a.forEach(function(element) {
            List.Add(element[0]);
          });
    };
  };
  $mod.$init = function () {
    (function () {
      rtl.free($impl.TIconDataDict,"FDict");
    })();
    $impl.RegisteredComponentList = Object.create(null);
    $impl.RegisteredSelectionEditorList = Object.create(null);
    $impl.RegisteredPropertyEditorList = Object.create(null);
    $impl.RegisteredIgnoredPropertyList = Object.create(null);
    $impl.RegisteredLibraryRequirementsEditorList = Object.create(null);
    $impl.RegisteredComponentEditorList = Object.create(null);
    $impl.RegisteredIdentToIntList = Object.create(null);
  };
},["SysUtils","Generics.Collections"]);
rtl.module("WEBLib.TMSFNCCustomComponent",["System","Classes","WEBLib.TMSFNCTypes","WEBLib.TMSFNCPersistence","WEBLib.Controls","TypInfo"],function () {
  "use strict";
  var $mod = this;
  this.$rtti.$MethodVar("TTMSFNCCustomComponentCanSavePropertyEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AObject",pas.System.$rtti["TObject"]],["APropertyName",rtl.string],["APropertyType",pas.System.$rtti["TTypeKind"]],["ACanSave",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCustomComponentCanLoadPropertyEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AObject",pas.System.$rtti["TObject"]],["APropertyName",rtl.string],["APropertyType",pas.System.$rtti["TTypeKind"]],["ACanLoad",rtl.boolean,1]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCNameLabel",pas["WEBLib.Controls"].TCustomControl,function () {
    this.GetText = function () {
      var Result = "";
      Result = "";
      if (this.FOwner != null) Result = this.FOwner.FName;
      return Result;
    };
    this.Paint = function () {
      var g = null;
      pas["WEBLib.Controls"].TCustomControl.Paint.call(this);
      g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("Create$1",[this.GetCanvas(),false]);
      try {
        g.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
        g.FStroke.SetColor(0);
        g.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        g.FFill.SetColor(16777215);
        g.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,this.GetWidth(),this.GetHeight())),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        if ((this.FOwner != null) && $mod.TTMSFNCCustomComponent.isPrototypeOf(this.FOwner)) g.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(g.FFont.FHeight,rtl.as(this.FOwner,$mod.TTMSFNCCustomComponent).FDesigntimeFormPixelsPerInch,96));
        g.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,this.GetWidth(),this.GetHeight())),this.GetText(),false,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,true,false,-1,-1);
      } finally {
        g = rtl.freeLoc(g);
      };
    };
    this.SetBounds = function (X, Y, AWidth, AHeight) {
      var l = 0.0;
      var t = 0.0;
      var w = 0.0;
      var h = 0.0;
      var sc = 0;
      var sz = pas["WEBLib.TMSFNCTypes"].TSizeF.$new();
      var g = null;
      var c = null;
      g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[1,1,false,true]);
      try {
        sc = 6;
        if ((this.FOwner != null) && $mod.TTMSFNCCustomComponent.isPrototypeOf(this.FOwner)) {
          g.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(g.FFont.FHeight,rtl.as(this.FOwner,$mod.TTMSFNCCustomComponent).FDesigntimeFormPixelsPerInch,96));
          sc = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(sc,rtl.as(this.FOwner,$mod.TTMSFNCCustomComponent).FDesigntimeFormPixelsPerInch,96);
        };
        sz.$assign(g.CalculateTextSize$1(this.GetText()));
        w = sz.cx + sc;
        h = sz.cy + sc;
      } finally {
        g = rtl.freeLoc(g);
      };
      if ((this.FOwner != null) && pas["WEBLib.Controls"].TControl.isPrototypeOf(this.FOwner)) {
        c = rtl.as(this.FOwner,pas["WEBLib.Controls"].TControl);
        l = (c.GetWidth() / 2) - (w / 2);
        t = c.GetHeight();
      } else {
        l = X;
        t = Y;
      };
      pas["WEBLib.Controls"].TControl.SetBounds.call(this,Math.round(l),Math.round(t),Math.round(w),Math.round(h));
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCCustomComponent",pas["WEBLib.Controls"].TCustomControl,function () {
    this.FBlockPersistenceInterface = false;
    this.$init = function () {
      pas["WEBLib.Controls"].TCustomControl.$init.call(this);
      this.FStored = false;
      this.FNameLabel = null;
      this.FDesigntimeFormPixelsPerInch = 0;
      this.FAppearancePersisting = false;
      this.FAdaptToStyle = false;
      this.FOnCanSaveProperty = null;
      this.FOnCanLoadProperty = null;
    };
    this.$final = function () {
      this.FNameLabel = undefined;
      this.FOnCanSaveProperty = undefined;
      this.FOnCanLoadProperty = undefined;
      pas["WEBLib.Controls"].TCustomControl.$final.call(this);
    };
    this.GetVersionNumber = function (AMaj, AMin, ARel, ABld) {
      var Result = "";
      Result = "";
      return Result;
    };
    this.DoCanSaveProperty = function (AObject, APropertyName, APropertyType, ACanSave) {
      if (this.FOnCanSaveProperty != null) this.FOnCanSaveProperty(this,AObject,APropertyName,APropertyType,ACanSave);
    };
    this.DoCanLoadProperty = function (AObject, APropertyName, APropertyType, ACanLoad) {
      if (this.FOnCanLoadProperty != null) this.FOnCanLoadProperty(this,AObject,APropertyName,APropertyType,ACanLoad);
    };
    this.IsAppearanceProperty = function (AObject, APropertyName, APropertyType) {
      var Result = false;
      Result = false;
      return Result;
    };
    this.CanSaveProperty = function (AObject, APropertyName, APropertyType) {
      var Result = false;
      if ((AObject === this) && !this.FBlockPersistenceInterface) {
        Result = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.IndexOfTextInArray(APropertyName,pas["WEBLib.TMSFNCPersistence"].ExcludePropertyList) === -1}
       else Result = true;
      if (this.FAppearancePersisting) Result = Result && this.IsAppearanceProperty(AObject,APropertyName,APropertyType);
      this.DoCanSaveProperty(AObject,APropertyName,APropertyType,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.CanLoadProperty = function (AObject, APropertyName, APropertyType) {
      var Result = false;
      if ((AObject === this) && !this.FBlockPersistenceInterface) {
        Result = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.IndexOfTextInArray(APropertyName,pas["WEBLib.TMSFNCPersistence"].ExcludePropertyList) === -1}
       else Result = true;
      this.DoCanLoadProperty(AObject,APropertyName,APropertyType,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.GetVersion = function () {
      var Result = "";
      Result = "";
      return Result;
    };
    this.GetDocURL = function () {
      var Result = "";
      Result = pas["WEBLib.TMSFNCTypes"].TTMSFNCBaseDocURL;
      return Result;
    };
    this.GetTipsURL = function () {
      var Result = "";
      Result = pas["WEBLib.TMSFNCTypes"].TTMSFNCBaseTipsURL;
      return Result;
    };
    this.GetInstance = function () {
      var Result = 0;
      Result = pas["WEBLib.TMSFNCTypes"].HInstance();
      return Result;
    };
    this.SetDefaultGraphicColors = function () {
      var c = 0;
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleBackgroundFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultPopupFillColor = c}
       else pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultPopupFillColor = 16777215;
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleBackgroundStrokeColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultPopupStrokeColor = c}
       else pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultPopupStrokeColor = 12632256;
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleDefaultButtonFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultButtonFillColor = c}
       else pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultButtonFillColor = pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(225,225,225);
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleLineFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultButtonStrokeColor = c}
       else pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultButtonStrokeColor = 11119017;
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleTextFontColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultTextFontColor = c}
       else pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultTextFontColor = 0;
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleSelectionFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultSelectionFillColor = c;
        pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultButtonFillColorFocused = pas["WEBLib.TMSFNCGraphicsTypes"].Blend(c,pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultButtonFillColor,25);
        pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultButtonStrokeColorFocused = pas["WEBLib.TMSFNCGraphicsTypes"].Blend(c,pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultButtonStrokeColor,30);
      } else {
        pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultSelectionFillColor = 0;
        pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultButtonFillColorFocused = pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(229,241,251);
        pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultButtonStrokeColorFocused = pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(60,127,177);
      };
      pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultButtonStrokeColorDisabled = 11119017;
      pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultButtonFillColorDisabled = 13882323;
    };
    this.ChangeDPIScale = function (M, D) {
    };
    this.SetAdaptToStyle = function (Value) {
      this.FAdaptToStyle = Value;
    };
    this.Paint = function () {
      var pic = null;
      var g = null;
      var r = null;
      var rc = null;
      pas["WEBLib.Controls"].TCustomControl.Paint.call(this);
      r = null;
      pic = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("Create$1",[this.GetCanvas(),false]);
      try {
        g.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
        g.FStroke.SetColor(0);
        g.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,this.GetWidth(),this.GetHeight())),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        rc = pas["WEBLib.DesignIntf"].GetRegisteredComponent(this.$classname);
        if (rc != null) pic.LoadFromResource(rc.FIcon);
        g.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(2,2,this.GetWidth() - 2,this.GetHeight() - 2)),pic,true,true,true,false);
      } finally {
        if (r != null) r = rtl.freeLoc(r);
        pic = rtl.freeLoc(pic);
        g = rtl.freeLoc(g);
      };
    };
    this.Loaded = function () {
      pas["WEBLib.Controls"].TCustomControl.Loaded.call(this);
      this.RealignLabel();
      if (!(pas.Classes.TComponentStateItem.csDesigning in this.FComponentState)) this.SetVisible(false);
    };
    this.RealignLabel = function () {
      if (this.FNameLabel != null) this.FNameLabel.SetBounds(this.GetLeft(),this.GetTop(),this.GetWidth(),this.GetHeight());
    };
    this.RegisterRuntimeClasses = function () {
    };
    this.Notification = function (AComponent, AOperation) {
      pas.Classes.TComponent.Notification.apply(this,arguments);
      if ((AComponent === this.FNameLabel) && (AOperation === pas.Classes.TOperation.opRemove)) this.FNameLabel = null;
    };
    this.Create$1 = function (AOwner) {
      var ppi = 0;
      pas["WEBLib.Controls"].TControl.Create$1.apply(this,arguments);
      ppi = 96;
      this.FDesigntimeFormPixelsPerInch = ppi;
      this.SetDefaultGraphicColors();
      this.SetWidth(26);
      this.SetHeight(26);
      if (!this.IsDesigning()) this.RegisterRuntimeClasses();
      return this;
    };
    this.SetName = function (Value) {
      pas["WEBLib.Controls"].TCustomControl.SetName.apply(this,arguments);
      if (!(this.FNameLabel != null) && (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) && pas["WEBLib.Forms"].TCustomForm.isPrototypeOf(this.FOwner)) {
        this.FNameLabel = $mod.TTMSFNCNameLabel.$create("Create$1",[this]);
        this.FNameLabel.SetParent(this);
        this.FNameLabel.SetTabStop(false);
      };
      this.RealignLabel();
    };
    this.SetBounds = function (X, Y, AWidth, AHeight) {
      var sc = 0.0;
      sc = this.FDesigntimeFormPixelsPerInch / 96;
      pas["WEBLib.Controls"].TControl.SetBounds.call(this,X,Y,Math.round(26 * sc),Math.round(26 * sc));
      this.RealignLabel();
    };
    this.BeginUpdate = function () {
      pas["WEBLib.Controls"].TControl.BeginUpdate.call(this);
    };
    this.EndUpdate = function () {
      pas["WEBLib.Controls"].TCustomControl.EndUpdate.call(this);
    };
    this.IsDesignTime = function () {
      var Result = false;
      Result = false;
      if (this.FOwner != null) Result = this.IsDesigning() && !((pas.Classes.TComponentStateItem.csReading in this.FOwner.FComponentState) || (pas.Classes.TComponentStateItem.csLoading in this.FOwner.FComponentState));
      return Result;
    };
    this.IsLoading = function () {
      var Result = false;
      Result = pas.Classes.TComponentStateItem.csLoading in this.FOwner.FComponentState;
      return Result;
    };
    this.IsReading = function () {
      var Result = false;
      Result = pas.Classes.TComponentStateItem.csReading in this.FOwner.FComponentState;
      return Result;
    };
    this.IsDesigning = function () {
      var Result = false;
      Result = (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) || (pas["WEBLib.Forms"].VSIDE != null);
      return Result;
    };
    this.IsDestroying = function () {
      var Result = false;
      Result = pas.Classes.TComponentStateItem.csDestroying in this.FComponentState;
      return Result;
    };
    this.SaveSettingsToFile = function (AFileName, AAppearanceOnly) {
      this.FAppearancePersisting = AAppearanceOnly;
      pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.SaveSettingsToFile(this,AFileName);
      this.FAppearancePersisting = false;
    };
    this.LoadSettingsFromFile = function (AFileName) {
      pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.LoadSettingsFromFile(this,AFileName);
    };
    this.SaveSettingsToStream = function (AStream, AAppearanceOnly) {
      this.FAppearancePersisting = AAppearanceOnly;
      pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.SaveSettingsToStream(this,AStream);
      this.FAppearancePersisting = false;
    };
    this.LoadSettingsFromStream = function (AStream) {
      pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.LoadSettingsFromStream(this,AStream);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("OnCanSaveProperty",0,$mod.$rtti["TTMSFNCCustomComponentCanSavePropertyEvent"],"FOnCanSaveProperty","FOnCanSaveProperty");
    $r.addProperty("OnCanLoadProperty",0,$mod.$rtti["TTMSFNCCustomComponentCanLoadPropertyEvent"],"FOnCanLoadProperty","FOnCanLoadProperty");
  });
  this.$rtti.$ClassRef("TTMSFNCCustomComponentClass",{instancetype: this.$rtti["TTMSFNCCustomComponent"]});
},["WEBLib.TMSFNCUtils","SysUtils","WEBLib.Forms","WEBLib.TMSFNCStyles","WEBLib.TMSFNCGraphics","WEBLib.Graphics","WEBLib.TMSFNCGraphicsTypes","Types","WEBLib.DesignIntf"]);
rtl.module("WEBLib.TMSFNCBitmapContainer",["System","Classes","WEBLib.TMSFNCTypes","WEBLib.TMSFNCCustomComponent","WEBLib.Controls"],function () {
  "use strict";
  var $mod = this;
  this.MAJ_VER = 1;
  this.MIN_VER = 0;
  this.REL_VER = 0;
  this.BLD_VER = 0;
  this.$rtti.$Class("TTMSFNCBitmapContainer");
  this.$rtti.$Class("TTMSFNCBitmapItem");
  rtl.createInterface(this,"ITMSFNCBitmapContainer","{ED26710D-395F-4971-8AC9-A31083BF2A3C}",["SetBitmapContainer","GetBitmapContainer"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("SetBitmapContainer",0,[["Value",$mod.$rtti["TTMSFNCBitmapContainer"],2]]);
    $r.addMethod("GetBitmapContainer",1,[],2,$mod.$rtti["TTMSFNCBitmapContainer"]);
    $r.addProperty("BitmapContainer",3,$mod.$rtti["TTMSFNCBitmapContainer"],"GetBitmapContainer","SetBitmapContainer",2);
  });
  rtl.createInterface(this,"ITMSFNCBitmapContainerGetItem","{98F65D59-B40C-4574-AF9C-3CA68E86AE10}",["ItemCount","GetItem"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("ItemCount",1,[],2,rtl.longint);
    $r.addMethod("GetItem",1,[["AIndex",rtl.longint]],2,$mod.$rtti["TTMSFNCBitmapItem"]);
  });
  rtl.createClass(this,"TTMSFNCBitmapItem",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FBitmap = null;
      this.FTag = 0;
      this.FName = "";
    };
    this.$final = function () {
      this.FBitmap = undefined;
      pas.Classes.TCollectionItem.$final.call(this);
    };
    this.SetBitmap = function (Value) {
      this.FBitmap.Assign(Value);
    };
    this.Create$1 = function (ACollection) {
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      this.FBitmap = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      this.FBitmap.FOnChange = rtl.createCallback(this,"DoBitmapChanged");
      this.FName = "Item" + pas.SysUtils.IntToStr(this.FCollection.GetCount());
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FBitmap");
      pas.Classes.TCollectionItem.Destroy.call(this);
    };
    this.DoBitmapChanged = function (Sender) {
      if ($mod.TTMSFNCBitmapCollection.isPrototypeOf(this.FCollection)) {
        if (rtl.as(this.FCollection,$mod.TTMSFNCBitmapCollection).FOwner$1 != null) rtl.as(this.FCollection,$mod.TTMSFNCBitmapCollection).FOwner$1.DoBitmapChanged(this);
      };
    };
    this.Assign = function (Source) {
      this.FName = rtl.as(Source,$mod.TTMSFNCBitmapItem).FName;
      this.FTag = rtl.as(Source,$mod.TTMSFNCBitmapItem).FTag;
      this.FBitmap.Assign(rtl.as(Source,$mod.TTMSFNCBitmapItem).FBitmap);
    };
    this.GetDisplayName = function () {
      var Result = "";
      if (this.FName !== "") {
        Result = this.FName}
       else Result = "";
      return Result;
    };
    var $r = this.$rtti;
    $r.addProperty("Bitmap",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FBitmap","SetBitmap");
    $r.addProperty("Name",0,rtl.string,"FName","FName");
    $r.addProperty("Tag",0,rtl.nativeint,"FTag","FTag");
  });
  rtl.createClass(this,"TTMSFNCBitmapCollection",pas.Classes.TOwnedCollection,function () {
    this.$init = function () {
      pas.Classes.TOwnedCollection.$init.call(this);
      this.FOwner$1 = null;
    };
    this.$final = function () {
      this.FOwner$1 = undefined;
      pas.Classes.TOwnedCollection.$final.call(this);
    };
    this.GetItemEx = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItemEx = function (Index, Value) {
      pas.Classes.TCollection.SetItem.call(this,Index,Value);
    };
    this.GetBitmapItemClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCBitmapItem;
      return Result;
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,this.GetBitmapItemClass());
      this.FOwner$1 = AOwner;
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,index);
      return Result;
    };
  });
  rtl.createClass(this,"TControlList",pas.Classes.TList,function () {
  });
  rtl.createClass(this,"TTMSFNCBitmapContainer",pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.$init.call(this);
      this.FControls$1 = null;
      this.FItems = null;
      this.FOnBitmapChanged = null;
    };
    this.$final = function () {
      this.FControls$1 = undefined;
      this.FItems = undefined;
      this.FOnBitmapChanged = undefined;
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.$final.call(this);
    };
    this.SetItems = function (Value) {
      this.FItems.Assign(Value);
    };
    this.GetBitmapName = function (AIndex) {
      var Result = "";
      Result = "";
      if ((AIndex >= 0) && (AIndex <= (this.GetItems().GetCount() - 1))) Result = this.GetItems().GetItemEx(AIndex).FName;
      return Result;
    };
    this.GetBitmap = function (AIndex) {
      var Result = null;
      Result = null;
      if ((AIndex >= 0) && (AIndex <= (this.GetItems().GetCount() - 1))) Result = this.GetItems().GetItemEx(AIndex).FBitmap;
      return Result;
    };
    this.GetItems = function () {
      var Result = null;
      Result = this.FItems;
      return Result;
    };
    this.GetInstance = function () {
      var Result = 0;
      Result = pas["WEBLib.TMSFNCTypes"].HInstance();
      return Result;
    };
    this.GetVersion = function () {
      var Result = "";
      Result = this.$class.GetVersionNumber(1,0,0,0);
      return Result;
    };
    this.CreateItems = function () {
      var Result = null;
      Result = $mod.TTMSFNCBitmapCollection.$create("Create$3",[this]);
      return Result;
    };
    this.RegisterRuntimeClasses = function () {
      pas.Classes.RegisterClass($mod.TTMSFNCBitmapContainer);
    };
    this.Notification = function (AComponent, AOperation) {
      var i = 0;
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.Notification.apply(this,arguments);
      if ((AOperation === pas.Classes.TOperation.opRemove) && (this.FControls$1 != null)) {
        for (var $l = this.FControls$1.GetCount() - 1; $l >= 0; $l--) {
          i = $l;
          if (this.FControls$1.Get(i) == AComponent) this.FControls$1.Delete(i);
        };
      };
    };
    this.DoBitmapChanged = function (Sender) {
      var f = null;
      var I = 0;
      f = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetParentForm(this);
      if (f != null) {
        for (var $l = 0, $end = f.GetControlsCount() - 1; $l <= $end; $l++) {
          I = $l;
          if (pas["WEBLib.Controls"].TWinControl.isPrototypeOf(f.GetControls(I))) this.InvalidateMembers(rtl.as(f.GetControls(I),pas["WEBLib.Controls"].TWinControl));
        };
      };
      if (this.FOnBitmapChanged != null) this.FOnBitmapChanged(this);
    };
    this.InvalidateMembers = function (AControl) {
      var I = 0;
      if (!(AControl != null)) return;
      if (pas.TypInfo.GetPropInfo$2(AControl,"BitmapContainer") != null) AControl.Invalidate();
      for (var $l = 0, $end = AControl.GetControlsCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (pas["WEBLib.Controls"].TWinControl.isPrototypeOf(AControl.GetControls(I))) this.InvalidateMembers(rtl.as(AControl.GetControls(I),pas["WEBLib.Controls"].TWinControl));
      };
    };
    this.Create$5 = function () {
      this.Create$1(null);
      return this;
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.Create$1.apply(this,arguments);
      this.FItems = this.CreateItems();
      this.FControls$1 = $mod.TControlList.$create("Create$1");
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FControls$1;
        }, set: function (v) {
          this.p.FControls$1 = v;
        }});
      rtl.free(this,"FItems");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCBitmapContainer.isPrototypeOf(Source)) {
        this.FItems.Assign(rtl.as(Source,$mod.TTMSFNCBitmapContainer).GetItems());
      } else pas["WEBLib.Controls"].TControl.Assign.apply(this,arguments);
    };
    this.Changed = function () {
      var i = 0;
      for (var $l = 0, $end = this.FControls$1.GetCount() - 1; $l <= $end; $l++) i = $l;
    };
    this.RegisterControl = function (AControl) {
      this.FControls$1.Add(AControl);
    };
    this.FindBitmap = function (i, ABitmap) {
      if ((i >= 0) && (i <= (this.GetItems().GetCount() - 1))) ABitmap.Assign(this.GetItems().GetItemEx(i).FBitmap);
    };
    this.GetItem = function (AIndex) {
      var Result = null;
      Result = null;
      if ((AIndex >= 0) && (AIndex <= (this.ItemCount() - 1))) Result = this.GetItems().GetItemEx(AIndex);
      return Result;
    };
    this.FindBitmap$1 = function (s) {
      var Result = null;
      var i = 0;
      Result = null;
      s = pas.SysUtils.UpperCase(s);
      i = 1;
      while (i <= this.GetItems().GetCount()) {
        if (pas.SysUtils.UpperCase(this.GetItems().GetItemEx(i - 1).FName) === s) {
          Result = this.GetItems().GetItemEx(i - 1).FBitmap;
          break;
        };
        i += 1;
      };
      return Result;
    };
    this.ItemCount = function () {
      var Result = 0;
      Result = this.GetItems().GetCount();
      return Result;
    };
    this.RandomBitmapName = function () {
      var Result = "";
      Result = this.GetBitmapName(pas.System.Random(this.ItemCount()));
      return Result;
    };
    this.RandomBitmap = function () {
      var Result = null;
      Result = this.GetBitmap(pas.System.Random(this.ItemCount()));
      return Result;
    };
    this.AddFromURL = function (URL, BitmapName) {
      var bmpi = null;
      bmpi = this.GetItems().Add$1();
      bmpi.FBitmap.LoadFromURL(URL,null);
      bmpi.FName = BitmapName;
    };
    this.AddFromResource = function (ResourceName, BitmapName, AInstance) {
      var bmpi = null;
      bmpi = this.GetItems().Add$1();
      bmpi.FBitmap.LoadFromResource$1(ResourceName,AInstance);
      bmpi.FName = BitmapName;
    };
    this.AddFromResource$1 = function (ResourceName, BitmapName) {
      this.AddFromResource(ResourceName,BitmapName,this.GetInstance());
    };
    this.AddFromFile = function (FileName, BitmapName) {
      var bmpi = null;
      bmpi = this.GetItems().Add$1();
      bmpi.FBitmap.LoadFromFile(FileName,null);
      bmpi.FName = BitmapName;
    };
    rtl.addIntf(this,$mod.ITMSFNCBitmapContainerGetItem);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Items",3,$mod.$rtti["TTMSFNCBitmapCollection"],"GetItems","SetItems");
    $r.addProperty("Version",1,rtl.string,"GetVersion","");
    $r.addProperty("OnBitmapChanged",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnBitmapChanged","FOnBitmapChanged");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
},["TypInfo","WEBLib.Forms","SysUtils","WEBLib.TMSFNCUtils"]);
rtl.module("WEBLib.TMSFNCHTMLEngine",["System","Classes","WEBLib.TMSFNCGraphics","Types","WEBLib.Graphics","WEBLib.TMSFNCTypes","WEBLib.TMSFNCBitmapContainer","WEBLib.TMSFNCGraphicsTypes"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.TMSFNCHTMLENGINE_ATTR_DELIM = '"';
  this.HTMLDrawEx = function (AGraphics, s, fr, XPos, YPos, FocusLink, HoverLink, ShadowOffset, CheckHotSpot, CheckHeight, Print, Selected, Blink, HoverStyle, WordWrap, ResFactor, URLColor, HoverColor, HoverFontColor, ShadowColor, AnchorVal, StripVal, FocusAnchor, XSize, YSize, HyperLinks, MouseLink, HoverRect, LineCount, LineSpacing, BitmapContainer, Opacity, HyperLinkUnderline, HighlightColor, HighlightTextColor, HighlightTextStyle) {
    var Result = false;
    var cr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
    var cid = "";
    var cv = "";
    var ct = "";
    cid = "";
    cv = "";
    ct = "";
    cr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,0,0));
    Result = $mod.HTMLDrawEx$1(AGraphics,s,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(fr),XPos,YPos,FocusLink,HoverLink,ShadowOffset,CheckHotSpot,CheckHeight,Print,Selected,Blink,HoverStyle,WordWrap,false,"",ResFactor,URLColor,HoverColor,HoverFontColor,ShadowColor,AnchorVal,StripVal,FocusAnchor,XSize,YSize,HyperLinks,MouseLink,HoverRect,cr,{get: function () {
        return cid;
      }, set: function (v) {
        cid = v;
      }},{get: function () {
        return cv;
      }, set: function (v) {
        cv = v;
      }},{get: function () {
        return ct;
      }, set: function (v) {
        ct = v;
      }},LineCount,LineSpacing,BitmapContainer,Opacity,HyperLinkUnderline,HighlightColor,HighlightTextColor,rtl.refSet(HighlightTextStyle));
    return Result;
  };
  var TFloatStyle = {"0": "fsNone", fsNone: 0, "1": "fsLeft", fsLeft: 1, "2": "fsRight", fsRight: 2};
  this.HTMLDrawEx$1 = function (AGraphics, s, fr, XPos, YPos, FocusLink, HoverLink, ShadowOffset, CheckHotSpot, CheckHeight, Print, Selected, Blink, HoverStyle, WordWrap, Down, DownID, ResFactor, URLColor, HoverColor, HoverFontColor, ShadowColor, AnchorVal, StripVal, FocusAnchor, XSize, YSize, HyperLinks, MouseLink, HoverRect, ControlRect, CID, CV, CT, LineCount, LineSpacing, BitmapContainer, Opacity, HyperLinkUnderline, HighlightColor, HighlightTextColor, HighlightTextStyle) {
    var Result = false;
    var su = "";
    var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
    var dr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
    var hr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
    var rr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
    var htmlwidth = 0.0;
    var htmlheight = 0.0;
    var txtheight = 0.0;
    var ch = 0.0;
    var rh = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
    var Align = 0;
    var PIndent = 0;
    var OldFont = null;
    var OldFontColor = 0;
    var CalcFont = null;
    var CalcFontColor = 0;
    var DrawFont = null;
    var DrawFontCOlor = 0;
    var FontColor = 0;
    var OldPenColor = 0;
    var OldPenKind = 0;
    var OldCalcFont = null;
    var OldCalcFontColor = 0;
    var BkColor = 0;
    var BGColor = 0;
    var OldDrawFont = null;
    var OldDrawFontColor = 0;
    var Hotspot = false;
    var ImageHotspot = false;
    var Anchor = false;
    var OldAnchor = false;
    var MouseInAnchor = false;
    var error = false;
    var blnkKind = 0;
    var paracolor = 0;
    var pencolor = 0;
    var blnkcolor = 0;
    var hifcol = 0;
    var hibcol = 0;
    var LastAnchor = "";
    var OldAnchorVal = "";
    var LType = "";
    var IMGSize = pas.Types.TPoint.$new();
    var isSup = false;
    var isSub = false;
    var isPara = false;
    var isShad = false;
    var hlcount = 0;
    var licount = 0;
    var imgali = 0.0;
    var subh = 0.0;
    var suph = 0.0;
    var ListIndex = 0;
    var Invisible = false;
    var FoundTag = false;
    var nnFit = 0;
    var inspoint = 0;
    var hifStyles = {};
    var AltImg = 0;
    var ImgIdx = 0;
    var OldImgIdx = 0;
    var ColL = 0;
    var ColB = 0;
    var ofsx = 0;
    var newofsx = 0;
    var FHot = false;
    var floatrect = pas.Types.TRect.$new();
    var floatpt = pas.Types.TPoint.$new();
    var txtfloat = 0;
    var txtfloatbefore = 0;
    var imgfloat = 0;
    function HTMLDrawLine(AGraphics, s, r, Calc, w, h, subh, suph, imgali, Align, PIndent, XPos, YPos, Hotspot, ImageHotSpot, OffsetX, NewOffsetX, floatrect, txtfloat) {
      var Result = "";
      var su = "";
      var Res = "";
      var TagProp = "";
      var Prop = "";
      var Tagp = "";
      var LineText = "";
      var dsu = "";
      var cr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var ir = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var fs = {};
      var linebreak = false;
      var imgbreak = false;
      var linkbreak = false;
      var indent = 0;
      var bmpx = 0;
      var bmpy = 0;
      var imgw = 0;
      var imgh = 0;
      var err = 0;
      var sw = 0.0;
      var th = 0.0;
      var errs = 0.0;
      var rh = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var TagPos = 0;
      var SpacePos = 0;
      var o = 0;
      var l = 0;
      var bmp = null;
      var bmpcreated = false;
      var NewColor = 0;
      var TagWidth = 0;
      var TagHeight = 0;
      var WordLen = 0;
      var WordWidth = 0.0;
      var TagChar = "\x00";
      var LengthFits = false;
      var ptf1 = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var ptf2 = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var imgalign = 0;
      var imgoffs = 0;
      var imgth = 0;
      var ControlType = "";
      var ControlWidth = "";
      var ControlHeight = "";
      var ControlID = "";
      var ControlValue = "";
      var ControlProp = "";
      var ControlLen = "";
      Result = "";
      LineText = "";
      WordWidth = 0;
      r.Bottom = r.Bottom - subh.get();
      w.set(0);
      sw = 0;
      linebreak = false;
      imgbreak = false;
      linkbreak = false;
      Hotspot.set(false);
      ImageHotSpot.set(false);
      cr.$assign(r);
      Res = "";
      if (!Calc) cr.Left = cr.Left + OffsetX;
      if (isPara && !Calc) {
        pencolor = AGraphics.FStroke.FColor;
        AGraphics.FStroke.SetColor(AGraphics.FFill.FColor);
        AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
        AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(fr.Left,r.Top,fr.Right,r.Top + h.get())),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
      };
      while ((s.get().length > 0) && !linebreak && !imgbreak) {
        TagPos = pas.System.Pos("<",s.get());
        if (WordWrap) {
          SpacePos = $impl.PosBreak(s.get())}
         else SpacePos = 0;
        if ((TagPos > 0) && ((SpacePos > TagPos) || (SpacePos === 0))) {
          su = pas.System.Copy(s.get(),1,TagPos - 1)}
         else {
          if (SpacePos > 0) {
            su = pas.System.Copy(s.get(),1,SpacePos)}
           else su = s.get();
        };
        WordLen = su.length;
        while (pas.System.Pos("&nbsp;",su) > 0) {
          pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.TagReplaceString("&nbsp;"," ",{get: function () {
              return su;
            }, set: function (v) {
              su = v;
            }});
        };
        while (pas.System.Pos("&lt;",su) > 0) {
          pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.TagReplaceString("&lt;","<",{get: function () {
              return su;
            }, set: function (v) {
              su = v;
            }});
        };
        while (pas.System.Pos("&gt;",su) > 0) {
          pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.TagReplaceString("&gt;",">",{get: function () {
              return su;
            }, set: function (v) {
              su = v;
            }});
        };
        if (WordLen > 0) {
          rh.$assign(AGraphics.CalculateText(su,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,10000,10000)),false,false));
          th = rh.Bottom - rh.Top;
          if (isSub && (subh.get() < (th / 4))) subh.set(th / 4);
          if (isSup && (suph.get() < (th / 4))) suph.set(th / 4);
          if (th > h.get()) h.set(th);
          StripVal.set(StripVal.get() + su);
          if (Invisible) pas.System.Delete(s,1,WordLen);
          if (!Invisible) {
            if (!Calc) {
              if (isSup) cr.Bottom = cr.Bottom - suph.get();
              if (isSub) cr.Bottom = cr.Bottom + subh.get();
              cr.Bottom = cr.Bottom - imgali.get();
              rh.$assign(AGraphics.CalculateText(su,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,10000,10000)),false,false));
              errs = rh.Right - rh.Left;
              if (BkColor !== -1) {
                AGraphics.FFill.SetColor(BkColor);
                AGraphics.FStroke.SetColor(BkColor);
                AGraphics.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
                AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
                rh.$assign(AGraphics.CalculateText$1("gh"));
                AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(cr.Left,cr.Top,cr.Left + errs,cr.Top + (rh.Bottom - rh.Top))),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
              };
              BkColor = -1;
              if (isShad) {
                pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(cr,ShadowOffset,ShadowOffset);
                AGraphics.FFont.SetColor(ShadowColor);
                AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(cr),su,false,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,false,false,-1,-1);
                pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(cr,-ShadowOffset,-ShadowOffset);
                AGraphics.FFont.SetColor(OldFontColor);
              };
              if ((su !== "") && (su.charAt(su.length - 1) === " ") && Anchor) {
                dsu = su + "\x00"}
               else dsu = su;
              AGraphics.FFont.SetColor(FontColor);
              AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(cr),dsu,false,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,false,false,-1,-1);
              cr.Right = cr.Left + errs;
              if (Anchor && ((HyperLinks.get() - 1) === FocusLink)) FocusAnchor.set(LastAnchor);
              if (error) {
                AGraphics.FStroke.SetColor(255);
                AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
                AGraphics.FStroke.SetWidth(1);
                l = Math.round((cr.Left / 2) * 2);
                if ((l % 4) === 0) {
                  o = 2}
                 else o = 0;
                while (l < cr.Right) {
                  ptf1.$assign(pas["WEBLib.TMSFNCTypes"].PointF(l,(r.Bottom + o) - 1));
                  if (o === 2) {
                    o = 0}
                   else o = 2;
                  ptf2.$assign(pas["WEBLib.TMSFNCTypes"].PointF(l + 2,(r.Bottom + o) - 1));
                  AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(ptf1),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(ptf2),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
                  l += 2;
                };
              };
              cr.Left = cr.Right;
              cr.Right = r.Right;
              cr.Bottom = r.Bottom;
              cr.Top = r.Top;
            } else {
              cr.$assign(r);
              rh.$assign(AGraphics.CalculateText(su,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,10000,10000)),false,false));
              cr.Right = cr.Left + (rh.Right - rh.Left);
              if ((YPos > cr.Top) && (YPos < cr.Bottom) && (XPos > w.get())) {
                nnFit = 0;
                if (nnFit === WordLen) {
                  inspoint = inspoint + WordLen}
                 else inspoint = inspoint + nnFit;
              };
              WordWidth = cr.Right - cr.Left;
              w.set(w.get() + WordWidth);
              if (((XPos - cr.Left) >= (w.get() - WordWidth)) && ((XPos - cr.Left) <= w.get()) && Anchor) {
                Hotspot.set(true);
                if (YPos > cr.Top) {
                  AnchorVal.set(LastAnchor);
                  MouseInAnchor = true;
                };
              };
            };
            LengthFits = ((w.get() + PIndent.get()) < ((r.Right - r.Left - ofsx) + 1)) || ((r.Right - r.Left - ofsx) <= WordWidth);
            LineText = LineText + su;
            if (LengthFits || !WordWrap) {
              Res = Res + pas.System.Copy(s.get(),1,WordLen);
              pas.System.Delete(s,1,WordLen);
              if (su.length >= WordLen) {
                if (pas.System.Copy(su,WordLen,1) === " ") {
                  rh.$assign(AGraphics.CalculateText$1(" "));
                  sw = rh.Right - rh.Left;
                } else sw = 0;
              } else sw = 0;
            } else {
              linebreak = true;
              w.set(w.get() - WordWidth);
            };
          };
        };
        TagPos = pas.System.Pos("<",s.get());
        if ((TagPos === 1) && (s.get().length <= 2)) s.set("");
        if (!linebreak && (TagPos === 1) && (s.get().length > 2)) {
          if ((s.get().charAt(1) === "/") && (s.get().length > 3)) {
            var $tmp = pas.System.upcase(s.get().charAt(2));
            if ($tmp === "A") {
              if ((!HoverStyle || (HoverLink === HyperLinks.get())) && !Calc) {
                AGraphics.FFont.SetStyle(rtl.diffSet(AGraphics.FFont.FStyle,rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsUnderline)));
                if (HoverColor !== -1) BkColor = HoverColor;
                if (HoverFontColor !== -1) FontColor = HoverFontColor;
              };
              if (!Selected) FontColor = OldFontColor;
              Anchor = false;
              if (MouseInAnchor) {
                hr.Bottom = r.Bottom;
                hr.Right = r.Left + w.get();
                if (r.Top !== hr.Top) {
                  hr.Left = r.Left;
                  hr.Top = r.Top;
                };
                HoverRect.$assign(hr);
                MouseLink.set(HyperLinks.get());
                MouseInAnchor = false;
              };
              if (FocusLink === (HyperLinks.get() - 1)) {
                rr.Right = cr.Left;
                rr.Bottom = cr.Bottom - imgali.get();
                rh.$assign(AGraphics.CalculateText$1("gh"));
                rr.Top = rr.Bottom - (rh.Bottom - rh.Top);
                pas["WEBLib.TMSFNCTypes"].InflateRectEx(rr,1,0);
              };
            } else if ($tmp === "E") {
              if (!Calc) error = false;
            } else if ($tmp === "B") {
              if (s.get().charAt(3) !== ">") {
                FontColor = OldFontColor}
               else AGraphics.FFont.SetStyle(rtl.diffSet(AGraphics.FFont.FStyle,rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsBold)));
            } else if ($tmp === "S") {
              TagChar = pas.System.upcase(s.get().charAt(3));
              if (TagChar === "U") {
                isSup = false;
                isSub = false;
              } else if (TagChar === "H") {
                isShad = false}
               else AGraphics.FFont.SetStyle(rtl.diffSet(AGraphics.FFont.FStyle,rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsStrikeOut)));
            } else if ($tmp === "F") {
              AGraphics.FFont.SetName(OldFont.FName);
              AGraphics.FFont.SetSize(OldFont.FSize);
              if (!Calc && !Selected) {
                FontColor = OldFontColor;
                AGraphics.FFill.SetColor(BGColor);
              };
            } else if ($tmp === "H") {
              if (!Calc) {
                FontColor = hifcol;
                BkColor = hibcol;
                AGraphics.FFont.SetStyle(rtl.refSet(hifStyles));
                AGraphics.FFill.SetColor(hibcol);
              };
            } else if ($tmp === "I") {
              AGraphics.FFont.SetStyle(rtl.diffSet(AGraphics.FFont.FStyle,rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsItalic)));
            } else if ($tmp === "L") {
              linebreak = true;
            } else if ($tmp === "O") {
              NewOffsetX.set(0);
            } else if ($tmp === "P") {
              linebreak = true;
              if (!Calc) {
                AGraphics.FFill.SetColor(paracolor);
                isPara = false;
              };
            } else if ($tmp === "U") {
              if ((s.get().charAt(3) !== ">") && (ListIndex > 0)) {
                ListIndex -= 1}
               else AGraphics.FFont.SetStyle(rtl.diffSet(AGraphics.FFont.FStyle,rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsUnderline)));
            } else if ($tmp === "R") {}
            else if ($tmp === "Z") Invisible = false;
          } else {
            var $tmp1 = pas.System.upcase(s.get().charAt(1));
            if ($tmp1 === "A") {
              if ((FocusLink === HyperLinks.get()) && !Calc) {
                rr.Left = cr.Left;
                rr.Top = cr.Top;
              };
              HyperLinks.set(HyperLinks.get() + 1);
              if ((!HoverStyle || (HoverLink === HyperLinks.get())) && !Calc) {
                if (HyperLinkUnderline) AGraphics.FFont.SetStyle(rtl.unionSet(AGraphics.FFont.FStyle,rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsUnderline)));
                if ((HoverColor !== -1) && !Calc) BkColor = HoverColor;
                if (HoverFontColor !== -1) FontColor = HoverFontColor;
              };
              if (!Selected && ((HoverFontColor === -1) || (HoverLink !== HyperLinks.get()) || !HoverStyle)) {
                OldFontColor = FontColor;
                FontColor = URLColor;
              };
              TagProp = pas.System.Copy(s.get(),3,pas.System.Pos(">",s.get()) - 1);
              Prop = pas.System.Copy(TagProp,pas.System.Pos('"',TagProp) + 1,TagProp.length);
              Prop = pas.System.Copy(Prop,1,pas.System.Pos('"',Prop) - 1);
              LastAnchor = Prop;
              Anchor = true;
              hr.Left = w.get();
              hr.Top = r.Top;
            } else if ($tmp1 === "B") {
              TagChar = pas.System.upcase(s.get().charAt(2));
              var $tmp2 = TagChar;
              if ($tmp2 === ">") {
                AGraphics.FFont.SetStyle(rtl.unionSet(AGraphics.FFont.FStyle,rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsBold)))}
               else if ($tmp2 === "R") {
                linebreak = true;
                StripVal.set(StripVal.get() + "\r");
              } else if ($tmp2 === "L") {
                if (!Blink) FontColor = blnkcolor}
               else if ($tmp2 === "O") {
                bmpy = 0;
                Res = Res + pas.System.Copy(s.get(),1,pas.System.Pos(">",s.get()));
                if (!Calc && !Selected) {
                  TagProp = pas.SysUtils.UpperCase(pas.System.Copy(s.get(),6,pas.System.Pos(">",s.get()) - 1));
                  if (pas.System.Pos("BACKGROUND",TagProp) > 0) {
                    Prop = pas.System.Copy(TagProp,pas.System.Pos("BACKGROUND",TagProp) + 10,TagProp.length);
                    Prop = pas.System.Copy(Prop,pas.System.Pos('"',Prop) + 1,Prop.length);
                    Prop = pas.System.Copy(Prop,1,pas.System.Pos('"',Prop) - 1);
                    if (pas.System.Pos("IDX:",pas.SysUtils.UpperCase(Prop)) > 0) {
                      pas.System.Delete({get: function () {
                          return Prop;
                        }, set: function (v) {
                          Prop = v;
                        }},1,4);
                    };
                    bmp = null;
                    bmpcreated = false;
                    if ((pas.System.Pos(":",Prop) === 0) && (BitmapContainer != null)) {
                      bmp = BitmapContainer.FindBitmap$1(Prop);
                    };
                    if (pas.System.Pos("URL://",pas.SysUtils.UpperCase(Prop)) > 0) {
                      pas.System.Delete({get: function () {
                          return Prop;
                        }, set: function (v) {
                          Prop = v;
                        }},1,6);
                      bmp = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromURL(Prop);
                      bmpcreated = true;
                    };
                    if (bmp != null) {
                      if (!pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(bmp) && (bmp.GetWidth() > 0) && (bmp.GetHeight() > 0)) {
                        while (bmpy < (fr.Bottom - fr.Top)) {
                          bmpx = 0;
                          while (bmpx < (fr.Right - fr.Left)) {
                            AGraphics.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(Math.round(fr.Left + bmpx),Math.round(fr.Top + bmpy),Math.round(fr.Left + bmpx) + bmp.GetWidth(),Math.round(fr.Top + bmpy) + bmp.GetHeight())),bmp,true,false,true,false);
                            bmpx = bmpx + bmp.GetWidth();
                          };
                          bmpy = bmpy + bmp.GetHeight();
                        };
                      };
                      if (bmpcreated) bmp = rtl.freeLoc(bmp);
                    };
                  };
                  if (pas.System.Pos("BGTOPLEFT",TagProp) > 0) {
                    Prop = pas.System.Copy(TagProp,pas.System.Pos("BGTOPLEFT",TagProp) + 10,TagProp.length);
                    Prop = pas.System.Copy(Prop,pas.System.Pos('"',Prop) + 1,Prop.length);
                    Prop = pas.System.Copy(Prop,1,pas.System.Pos('"',Prop) - 1);
                    bmp = null;
                    if ((pas.System.Pos(":",Prop) === 0) && (BitmapContainer != null)) {
                      bmp = BitmapContainer.FindBitmap$1(Prop);
                    };
                    if (bmp != null) {
                      if (!pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(bmp) && (bmp.GetWidth() > 0) && (bmp.GetHeight() > 0)) {
                        AGraphics.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(Math.round(fr.Left),Math.round(fr.Top + bmpy),Math.round(fr.Left) + bmp.GetWidth(),Math.round(fr.Top) + bmp.GetHeight())),bmp,true,false,true,false);
                      };
                    };
                  };
                  if (pas.System.Pos("BGTOPRIGHT",TagProp) > 0) {
                    Prop = pas.System.Copy(TagProp,pas.System.Pos("BGTOPRIGHT",TagProp) + 10,TagProp.length);
                    Prop = pas.System.Copy(Prop,pas.System.Pos('"',Prop) + 1,Prop.length);
                    Prop = pas.System.Copy(Prop,1,pas.System.Pos('"',Prop) - 1);
                    bmp = null;
                    if ((pas.System.Pos(":",Prop) === 0) && (BitmapContainer != null)) {
                      bmp = BitmapContainer.FindBitmap$1(Prop);
                    };
                    if (bmp != null) {
                      if (!pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(bmp) && (bmp.GetWidth() > 0) && (bmp.GetHeight() > 0)) {
                        AGraphics.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(Math.round(fr.Right) - bmp.GetWidth(),Math.round(fr.Top + bmpy),Math.round(fr.Right),Math.round(fr.Top) + bmp.GetHeight())),bmp,true,false,true,false);
                      };
                    };
                  };
                  if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos("BGCOLOR",TagProp,{get: function () {
                      return TagPos;
                    }, set: function (v) {
                      TagPos = v;
                    }}) > 0) {
                    Prop = pas.System.Copy(TagProp,TagPos + 5,TagProp.length);
                    Prop = pas.System.Copy(Prop,pas.System.Pos('"',Prop) + 1,Prop.length);
                    Prop = pas.System.Copy(Prop,1,pas.System.Pos('"',Prop) - 1);
                    NewColor = -1;
                    if (Prop.length > 0) {
                      if (Prop.charAt(0) === "#") {
                        NewColor = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor(Prop)}
                       else {
                        NewColor = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.TextToColor(pas.SysUtils.LowerCase(Prop));
                      };
                    };
                    if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos("BGCOLORTO",TagProp,{get: function () {
                        return TagPos;
                      }, set: function (v) {
                        TagPos = v;
                      }}) > 0) {
                      Prop = pas.System.Copy(TagProp,TagPos + 5,TagProp.length);
                      Prop = pas.System.Copy(Prop,pas.System.Pos('"',Prop) + 1,Prop.length);
                      Prop = pas.System.Copy(Prop,1,pas.System.Pos('"',Prop) - 1);
                      Prop = "H";
                      if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos("DIR",TagProp,{get: function () {
                          return TagPos;
                        }, set: function (v) {
                          TagPos = v;
                        }}) > 0) {
                        Prop = pas.System.Copy(TagProp,TagPos + 3,TagProp.length);
                        Prop = pas.System.Copy(Prop,pas.System.Pos('"',Prop) + 1,Prop.length);
                        Prop = pas.System.Copy(Prop,1,pas.System.Pos('"',Prop) - 1);
                      };
                      AGraphics.FStroke.SetColor(NewColor);
                    } else {
                      BGColor = AGraphics.FFill.FColor;
                      AGraphics.FFill.SetColor(NewColor);
                      pencolor = AGraphics.FStroke.FColor;
                      AGraphics.FStroke.SetColor(NewColor);
                      AGraphics.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
                      AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
                      AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(fr.Left - 2,fr.Top,fr.Right,fr.Bottom)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
                      AGraphics.FStroke.SetColor(pencolor);
                    };
                  };
                };
              };
            } else if ($tmp1 === "E") {
              if (!Calc) error = true;
            } else if ($tmp1 === "C") {
              TagProp = pas.System.Copy(s.get(),9,pas.System.Pos(">",s.get()) - 1);
              ControlType = "";
              ControlID = "";
              ControlValue = "";
              ControlWidth = "";
              ControlHeight = "";
              ControlProp = "";
              ControlLen = "";
              $mod.ParseControl(TagProp,{get: function () {
                  return ControlType;
                }, set: function (v) {
                  ControlType = v;
                }},{get: function () {
                  return ControlID;
                }, set: function (v) {
                  ControlID = v;
                }},{get: function () {
                  return ControlValue;
                }, set: function (v) {
                  ControlValue = v;
                }},{get: function () {
                  return ControlWidth;
                }, set: function (v) {
                  ControlWidth = v;
                }},{get: function () {
                  return ControlHeight;
                }, set: function (v) {
                  ControlHeight = v;
                }},{get: function () {
                  return ControlProp;
                }, set: function (v) {
                  ControlProp = v;
                }},{get: function () {
                  return ControlLen;
                }, set: function (v) {
                  ControlLen = v;
                }});
              ch = 25;
              if (ControlHeight !== "") {
                pas.System.val$8(ControlHeight,{get: function () {
                    return ch;
                  }, set: function (v) {
                    ch = v;
                  }},{get: function () {
                    return err;
                  }, set: function (v) {
                    err = v;
                  }});
                if (err !== 0) ch = 25;
              };
              if ((ControlWidth !== "") || (ControlType === "CHECK") || (ControlType === "RADIO")) {
                pas.System.val$6(ControlWidth,{get: function () {
                    return indent;
                  }, set: function (v) {
                    indent = v;
                  }},{get: function () {
                    return err;
                  }, set: function (v) {
                    err = v;
                  }});
                if (err === 0) {
                  IMGSize.x = indent;
                  IMGSize.y = Math.round(AGraphics.CalculateTextHeight$1("gh")) + 10;
                };
                if ((ControlType === "CHECK") || (ControlType === "RADIO")) {
                  h.set(16)}
                 else h.set(23);
                if (ch > 25) h.set(ch - 2);
                if (!Calc) {
                  if ((ControlType === "EDIT") || (ControlType === "PASSWORD") || (ControlType === "MASK")) ;
                  if (ControlType === "COMBO") ;
                  if (ControlType === "CHECK") {
                    IMGSize.x = Math.round(16 * ResFactor) + 2;
                    IMGSize.y = IMGSize.x;
                    indent = IMGSize.x;
                    ir.$assign(pas["WEBLib.TMSFNCTypes"].RectF(cr.Left + 1,cr.Top + ((cr.Bottom - cr.Top - (IMGSize.y - 2)) / 2),(cr.Left + IMGSize.x) - 1,cr.Top + ((cr.Bottom - cr.Top - (IMGSize.y - 2)) / 2) + (IMGSize.y - 2)));
                    ir.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Math.round(ir.Left),Math.round(ir.Top),Math.round(ir.Right),Math.round(ir.Bottom)));
                    AGraphics.DrawCheckBox(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ir),pas.SysUtils.UpperCase(ControlValue) === "TRUE",Down && (DownID === ControlID),true,1.0);
                  };
                  if (ControlType === "RADIO") {
                    IMGSize.x = Math.round(16 * ResFactor) + 2;
                    IMGSize.y = IMGSize.x;
                    indent = IMGSize.x;
                    ir.$assign(pas["WEBLib.TMSFNCTypes"].RectF(cr.Left + 1,cr.Top + ((cr.Bottom - cr.Top - (IMGSize.y - 2)) / 2),(cr.Left + IMGSize.x) - 1,cr.Top + ((cr.Bottom - cr.Top - (IMGSize.y - 2)) / 2) + (IMGSize.y - 2)));
                    ir.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Math.round(ir.Left),Math.round(ir.Top),Math.round(ir.Right),Math.round(ir.Bottom)));
                    AGraphics.DrawRadioButton(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ir),pas.SysUtils.UpperCase(ControlValue) === "TRUE",Down && (DownID === ControlID),true,1.0);
                  };
                  if (ControlType === "BUTTON") {
                    IMGSize.y = 22;
                    ir.$assign(pas["WEBLib.TMSFNCTypes"].RectF(cr.Left + 2,cr.Top + ((cr.Bottom - cr.Top - IMGSize.y) / 2),(cr.Left + indent) - 2,cr.Top + ((cr.Bottom - cr.Top - IMGSize.y) / 2) + IMGSize.y));
                    FHot = pas["WEBLib.TMSFNCTypes"].PtInRectEx(ir,pas["WEBLib.TMSFNCTypes"].PointF(XPos,YPos));
                    ir.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Math.round(ir.Left),Math.round(ir.Top),Math.round(ir.Right),Math.round(ir.Bottom)));
                    AGraphics.DrawButton(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ir),Down && (DownID === ControlID),FHot,true,true,1.0);
                    pas["WEBLib.TMSFNCTypes"].InflateRectEx(ir,-2,-2);
                    AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ir),ControlValue,false,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,true,false,-1,-1);
                  };
                };
                if (ControlType === "BUTTON") IMGSize.y = 22;
                if (ControlType === "COMBO") IMGSize.y = 25;
                if ((ControlType === "CHECK") || (ControlType === "RADIO")) {
                  IMGSize.x = Math.round(16 * ResFactor) + 2;
                  IMGSize.y = IMGSize.x;
                };
                if ((((XPos - r.Left) > w.get()) && ((XPos - r.Left) < (w.get() + IMGSize.x)) && (YPos > cr.Top) && (YPos < (cr.Top + IMGSize.y))) || (CheckHotSpot && (CID.get() === ControlID))) {
                  ImageHotSpot.set(true);
                  AnchorVal.set("ctrl");
                  AltImg = ImgIdx;
                  ir.Left = r.Left + w.get();
                  ir.Right = ir.Left + IMGSize.x;
                  ir.Top = cr.Top;
                  ir.Bottom = cr.Top + IMGSize.y;
                  ControlRect.$assign(ir);
                  CV.set(ControlValue);
                  CID.set(ControlID);
                  CT.set(ControlType);
                };
                if (((w.get() + IMGSize.x) > (r.Right - r.Left)) && (IMGSize.x < (r.Right - r.Left))) {
                  imgbreak = true;
                } else {
                  w.set(w.get() + IMGSize.x);
                  cr.Left = cr.Left + IMGSize.x;
                  if (IMGSize.y > h.get()) h.set(IMGSize.y);
                };
              };
            } else if ($tmp1 === "H") {
              var $tmp3 = pas.System.upcase(s.get().charAt(2));
              if ($tmp3 === "R") {
                linebreak = true;
                if (!Calc) {
                  TagProp = pas.System.Copy(s.get(),4,pas.System.Pos(">",s.get()) - 1);
                  NewColor = 0;
                  if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos("COLOR",pas.SysUtils.UpperCase(TagProp),{get: function () {
                      return TagPos;
                    }, set: function (v) {
                      TagPos = v;
                    }}) > 0) {
                    Prop = pas.System.Copy(TagProp,TagPos + 5,TagProp.length);
                    Prop = pas.System.Copy(Prop,pas.System.Pos('"',Prop) + 1,Prop.length);
                    Prop = pas.System.Copy(Prop,1,pas.System.Pos('"',Prop) - 1);
                    if (Prop.length > 0) {
                      if (Prop.charAt(0) === "#") {
                        NewColor = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor(Prop)}
                       else {
                        NewColor = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.TextToColor(pas.SysUtils.LowerCase(Prop));
                      };
                    };
                  };
                  AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
                  pencolor = AGraphics.FStroke.FColor;
                  AGraphics.FStroke.SetColor(NewColor);
                  ptf1.$assign(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,cr.Bottom + 1));
                  ptf2.$assign(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,cr.Bottom + 1));
                  AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
                  AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(ptf1),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(ptf2),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
                  AGraphics.FStroke.SetColor(pencolor);
                };
              } else if ($tmp3 === "I") {
                if (!Calc) {
                  hifcol = FontColor;
                  hibcol = BkColor;
                  hifStyles = rtl.refSet(AGraphics.FFont.FStyle);
                  BkColor = HighlightColor;
                  FontColor = HighlightTextColor;
                };
                AGraphics.FFont.SetStyle(rtl.refSet(HighlightTextStyle));
              };
            } else if ($tmp1 === "I") {
              TagChar = pas.System.upcase(s.get().charAt(2));
              if (TagChar === ">") {
                AGraphics.FFont.SetStyle(rtl.unionSet(AGraphics.FFont.FStyle,rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsItalic)))}
               else if (TagChar === "N") {
                TagProp = pas.System.Copy(s.get(),3,pas.System.Pos(">",s.get()) - 1);
                Prop = pas.System.Copy(TagProp,pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.IPos("x",TagProp) + 2,TagProp.length);
                Prop = pas.System.Copy(Prop,pas.System.Pos('"',Prop) + 1,Prop.length);
                Prop = pas.System.Copy(Prop,1,pas.System.Pos('"',Prop) - 1);
                pas.System.val$6(Prop,{get: function () {
                    return indent;
                  }, set: function (v) {
                    indent = v;
                  }},{get: function () {
                    return err;
                  }, set: function (v) {
                    err = v;
                  }});
                if (err === 0) {
                  if (indent > w.get()) {
                    w.set(indent);
                    cr.Left = fr.Left + indent;
                  };
                };
              } else if (TagChar === "M") {
                imgalign = 0;
                imgoffs = 0;
                imgfloat = TFloatStyle.fsNone;
                imgth = Math.round(AGraphics.CalculateTextHeight$1("gh"));
                ImgIdx += 1;
                ir.$assign(cr);
                TagProp = pas.System.Copy(s.get(),3,pas.System.Pos(">",s.get()) - 1);
                Prop = pas.System.Copy(TagProp,pas.System.Pos("SRC",pas.SysUtils.UpperCase(TagProp)) + 4,TagProp.length);
                Prop = pas.System.Copy(Prop,pas.System.Pos('"',Prop) + 1,Prop.length);
                Prop = pas.System.Copy(Prop,1,pas.System.Pos('"',Prop) - 1);
                TagProp = pas.SysUtils.UpperCase(TagProp);
                if ((pas.System.Pos("ALT",TagProp) > 0) && (AltImg === ImgIdx)) {
                  Prop = pas.System.Copy(TagProp,pas.System.Pos("ALT",TagProp) + 4,TagProp.length);
                  Prop = pas.System.Copy(Prop,pas.System.Pos('"',Prop) + 1,Prop.length);
                  Prop = pas.System.Copy(Prop,1,pas.System.Pos('"',Prop) - 1);
                };
                TagWidth = 0;
                TagHeight = 0;
                if (pas.System.Pos("WIDTH",TagProp) > 0) {
                  Tagp = pas.System.Copy(TagProp,pas.System.Pos("WIDTH",TagProp) + 6,TagProp.length);
                  Tagp = pas.System.Copy(Tagp,pas.System.Pos('"',Tagp) + 1,Tagp.length);
                  Tagp = pas.System.Copy(Tagp,1,pas.System.Pos('"',Tagp) - 1);
                  pas.System.val$6(Tagp,{get: function () {
                      return TagWidth;
                    }, set: function (v) {
                      TagWidth = v;
                    }},{get: function () {
                      return err;
                    }, set: function (v) {
                      err = v;
                    }});
                  if (pas.System.Pos("%",Tagp) > 0) TagWidth = Math.round((TagWidth / 100) * (cr.Right - cr.Left));
                };
                if (pas.System.Pos("HEIGHT",TagProp) > 0) {
                  Tagp = pas.System.Copy(TagProp,pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.IPos("HEIGHT",TagProp) + 7,TagProp.length);
                  Tagp = pas.System.Copy(Tagp,pas.System.Pos('"',Tagp) + 1,Tagp.length);
                  Tagp = pas.System.Copy(Tagp,1,pas.System.Pos('"',Tagp) - 1);
                  pas.System.val$6(Tagp,{get: function () {
                      return TagHeight;
                    }, set: function (v) {
                      TagHeight = v;
                    }},{get: function () {
                      return err;
                    }, set: function (v) {
                      err = v;
                    }});
                  if (pas.System.Pos("%",Tagp) > 0) TagHeight = Math.round((TagHeight / 100) * (cr.Bottom - cr.Top));
                };
                if (pas.System.Pos("ALIGN",TagProp) > 0) {
                  Tagp = pas.System.Copy(TagProp,pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.IPos("ALIGN",TagProp) + 6,TagProp.length);
                  Tagp = pas.System.Copy(Tagp,pas.System.Pos('"',Tagp) + 1,Tagp.length);
                  Tagp = pas.System.Copy(Tagp,1,pas.System.Pos('"',Tagp) - 1);
                  if (Tagp === "MIDDLE") imgalign = 1;
                  if (Tagp === "TOP") imgalign = 2;
                };
                if (pas.System.Pos("FLOAT",TagProp) > 0) {
                  Tagp = pas.System.Copy(TagProp,pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.IPos("FLOAT",TagProp) + 6,TagProp.length);
                  Tagp = pas.System.Copy(Tagp,pas.System.Pos('"',Tagp) + 1,Tagp.length);
                  Tagp = pas.System.Copy(Tagp,1,pas.System.Pos('"',Tagp) - 1);
                  if (Tagp === "LEFT") {
                    imgfloat = TFloatStyle.fsLeft;
                    ir.Left = fr.Left;
                  };
                  if (Tagp === "RIGHT") imgfloat = TFloatStyle.fsRight;
                };
                IMGSize.x = 0;
                IMGSize.y = 0;
                if (pas.System.Pos("IDX:",pas.SysUtils.UpperCase(Prop)) > 0) {
                  pas.System.Delete({get: function () {
                      return Prop;
                    }, set: function (v) {
                      Prop = v;
                    }},1,4);
                };
                bmp = null;
                bmpcreated = false;
                if ((pas.System.Pos(":",Prop) === 0) && (BitmapContainer != null)) {
                  bmp = BitmapContainer.FindBitmap$1(Prop);
                };
                if (pas.System.Pos("URL://",pas.SysUtils.UpperCase(Prop)) > 0) {
                  pas.System.Delete({get: function () {
                      return Prop;
                    }, set: function (v) {
                      Prop = v;
                    }},1,6);
                  bmp = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromURL(Prop);
                  bmpcreated = true;
                };
                if (pas.System.Pos("DATA:",pas.SysUtils.UpperCase(Prop)) > 0) {
                  if (pas.System.Pos("BASE64,",pas.SysUtils.UpperCase(Prop)) > 0) {
                    pas.System.Delete({get: function () {
                        return Prop;
                      }, set: function (v) {
                        Prop = v;
                      }},1,pas.System.Pos("BASE64,",pas.SysUtils.UpperCase(Prop)) + 6);
                    bmp = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
                    pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.LoadBitmapFromBase64(Prop,bmp,false);
                    bmpcreated = true;
                  };
                };
                imgw = 0;
                imgh = 0;
                if (bmp != null) {
                  if (!pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(bmp)) {
                    if ((TagWidth > 0) && (TagHeight > 0)) {
                      imgw = TagWidth;
                      imgh = TagHeight;
                    };
                    if ((TagWidth > 0) && (TagHeight === 0)) {
                      imgw = TagWidth;
                      imgh = Math.round((TagWidth / bmp.GetWidth()) * bmp.GetHeight());
                    };
                    if ((TagWidth === 0) && (TagHeight > 0)) {
                      imgw = Math.round((TagHeight / bmp.GetHeight()) * bmp.GetWidth());
                      imgh = TagHeight;
                    };
                    if ((TagWidth === 0) && (TagHeight === 0)) {
                      imgw = bmp.GetWidth();
                      imgh = bmp.GetHeight();
                    };
                    if (imgfloat === TFloatStyle.fsRight) ir.Left = r.Right - imgw;
                    if (!Calc) {
                      if ((TagWidth > 0) || (TagHeight > 0)) {
                        AGraphics.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(Math.round(ir.Left),Math.round(ir.Top),Math.round(ir.Left) + imgw,Math.round(ir.Top) + imgh)),bmp,true,false,true,false);
                      } else if ((TagWidth > 0) && (TagHeight === 0)) {
                        AGraphics.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(Math.round(ir.Left),Math.round(ir.Top),Math.round(ir.Left) + TagWidth,Math.round(ir.Top) + TagHeight)),bmp,true,false,true,false);
                      } else {
                        AGraphics.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(Math.round(ir.Left),Math.round(ir.Top),Math.round(ir.Left) + bmp.GetWidth(),Math.round(ir.Top) + bmp.GetHeight())),bmp,true,false,true,false);
                      };
                    };
                    if ((TagWidth > 0) || (TagHeight > 0)) {
                      IMGSize.x = imgw;
                      IMGSize.y = imgh;
                    } else {
                      IMGSize.x = bmp.GetWidth();
                      IMGSize.y = bmp.GetHeight();
                    };
                  };
                  if (bmpcreated) bmp = rtl.freeLoc(bmp);
                };
                if (((XPos - r.Left) > w.get()) && ((XPos - r.Left) < (w.get() + IMGSize.x)) && (YPos > cr.Top) && (YPos < (cr.Top + IMGSize.y)) && Anchor) {
                  ImageHotSpot.set(true);
                  AnchorVal.set(LastAnchor);
                  AltImg = ImgIdx;
                };
                if (((w.get() + IMGSize.x) > (r.Right - r.Left)) && (IMGSize.x < (r.Right - r.Left))) {
                  imgbreak = true;
                } else {
                  w.set(w.get() + IMGSize.x + 2);
                  cr.Left = cr.Left + IMGSize.x + 2;
                  if (IMGSize.y > h.get()) h.set(IMGSize.y);
                };
                if (pas.System.Pos("ALIGN",TagProp) > 0) {
                  if (pas.System.Pos('"TOP',TagProp) > 0) {
                    rh.$assign(AGraphics.CalculateText$1("gh"));
                    imgali.set(h.get() - (rh.Bottom - rh.Top));
                  } else {
                    if (pas.System.Pos('"MIDDLE',TagProp) > 0) {
                      rh.$assign(AGraphics.CalculateText$1("gh"));
                      imgali.set((h.get() - (rh.Bottom - rh.Top)) / 2);
                    };
                  };
                };
                if (pas.System.Pos("WRAP",TagProp) > 0) {
                  rh.$assign(AGraphics.CalculateText$1("gh"));
                  h.set(rh.Bottom - rh.Top);
                  imgali.set(0);
                };
                if (imgfloat === TFloatStyle.fsLeft) {
                  rh.$assign(AGraphics.CalculateText$1("gh"));
                  imgali.set(h.get() - (rh.Bottom - rh.Top));
                  floatrect.Left = imgw;
                  floatrect.Bottom = imgh;
                  if (!Calc) {
                    rh.$assign(AGraphics.CalculateText$1("gh"));
                    h.set(rh.Bottom - rh.Top);
                  };
                };
                if (imgfloat === TFloatStyle.fsRight) {
                  rh.$assign(AGraphics.CalculateText$1("gh"));
                  imgali.set(h.get() - (rh.Bottom - rh.Top));
                  floatrect.Right = imgw;
                  floatrect.Bottom = imgh;
                  if (!Calc) {
                    rh.$assign(AGraphics.CalculateText$1("gh"));
                    h.set(rh.Bottom - rh.Top);
                  };
                  w.set(fr.Right);
                };
              };
            } else if ($tmp1 === "L") {
              NewColor = -1;
              LType = "";
              if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos(">",s.get(),{get: function () {
                  return TagPos;
                }, set: function (v) {
                  TagPos = v;
                }}) > 0) {
                TagProp = pas.SysUtils.UpperCase(pas.System.Copy(s.get(),3,TagPos - 1));
                if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos("TYPE",TagProp,{get: function () {
                    return TagPos;
                  }, set: function (v) {
                    TagPos = v;
                  }}) > 0) {
                  Prop = pas.System.Copy(TagProp,TagPos + 4,TagProp.length);
                  Prop = pas.System.Copy(Prop,pas.System.Pos('"',Prop) + 1,Prop.length);
                  Prop = pas.System.Copy(Prop,1,pas.System.Pos('"',Prop) - 1);
                  LType = Prop;
                };
                if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos("COLOR",TagProp,{get: function () {
                    return TagPos;
                  }, set: function (v) {
                    TagPos = v;
                  }}) > 0) {
                  Prop = pas.System.Copy(TagProp,TagPos + 5,TagProp.length);
                  Prop = pas.System.Copy(Prop,pas.System.Pos('"',Prop) + 1,Prop.length);
                  Prop = pas.System.Copy(Prop,1,pas.System.Pos('"',Prop) - 1);
                  if (Prop.length > 0) {
                    if (Prop.charAt(0) === "#") {
                      NewColor = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor(Prop)}
                     else NewColor = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.TextToColor(Prop);
                  };
                };
              };
              w.set(w.get() + (12 * ListIndex));
              if (linkbreak) {
                imgbreak = true}
               else linkbreak = true;
              cr.Left = cr.Left + (12 * (ListIndex - 1));
              if (!Calc && !Invisible) {
                if (LType === "") {
                  if (NewColor !== -1) {
                    ColL = AGraphics.FFont.FColor;
                    FontColor = NewColor;
                  };
                  Prop = AGraphics.FFont.FName;
                  fs = rtl.refSet(AGraphics.FFont.FStyle);
                  AGraphics.FFont.SetStyle({});
                  if (pas.System.Odd(ListIndex)) {
                    AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(cr),"•",false,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,false,false,-1,-1)}
                   else AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(cr),"o",false,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,false,false,-1,-1);
                  AGraphics.FFont.SetName(Prop);
                  AGraphics.FFont.SetStyle(rtl.refSet(fs));
                  if (NewColor !== -1) FontColor = ColL;
                } else {
                  ColB = -1;
                  if (LType === "SQUARE") {
                    ColB = AGraphics.FFill.FColor;
                    AGraphics.FStroke.SetColor(NewColor);
                    AGraphics.FFill.SetColor(NewColor);
                    AGraphics.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
                    AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
                    AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(cr.Left,cr.Top + 2,cr.Left + 8,cr.Top + 10)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
                    AGraphics.FFill.SetColor(ColB);
                  };
                  if (LType === "CIRCLE") {
                    ColB = AGraphics.FFill.FColor;
                    AGraphics.FStroke.SetColor(NewColor);
                    AGraphics.FFill.SetColor(NewColor);
                    AGraphics.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
                    AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
                    AGraphics.DrawEllipse$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(cr.Left,cr.Top + 2,cr.Left + 8,cr.Top + 10)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
                    AGraphics.FFill.SetColor(ColB);
                  };
                };
              };
              cr.Left = cr.Left + 12;
            } else if ($tmp1 === "U") {
              if (s.get().charAt(2) !== ">") {
                ListIndex += 1;
                if (w.get() > 0) linebreak = true;
              } else AGraphics.FFont.SetStyle(rtl.unionSet(AGraphics.FFont.FStyle,rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsUnderline)));
            } else if ($tmp1 === "O") {
              TagChar = pas.System.upcase(s.get().charAt(2));
              if (TagChar === "F") {
                TagProp = pas.System.Copy(s.get(),3,pas.System.Pos(">",s.get()) - 1);
                Prop = pas.System.Copy(TagProp,pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.IPos("x",TagProp) + 2,TagProp.length);
                Prop = pas.System.Copy(Prop,pas.System.Pos('"',Prop) + 1,Prop.length);
                Prop = pas.System.Copy(Prop,1,pas.System.Pos('"',Prop) - 1);
                pas.System.val$6(Prop,NewOffsetX,{get: function () {
                    return err;
                  }, set: function (v) {
                    err = v;
                  }});
                cr.Left = NewOffsetX.get();
                w.set(NewOffsetX.get());
              };
            } else if ($tmp1 === "P") {
              if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos(">",s.get(),{get: function () {
                  return TagPos;
                }, set: function (v) {
                  TagPos = v;
                }}) > 0) {
                TagProp = pas.SysUtils.UpperCase(pas.System.Copy(s.get(),3,TagPos - 1));
                if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos("ALIGN",TagProp,{get: function () {
                    return TagPos;
                  }, set: function (v) {
                    TagPos = v;
                  }}) > 0) {
                  Prop = pas.System.Copy(TagProp,TagPos + 5,TagProp.length);
                  Prop = pas.System.Copy(Prop,pas.System.Pos('"',Prop) + 1,Prop.length);
                  Prop = pas.System.Copy(Prop,1,pas.System.Pos('"',Prop) - 1);
                  if (pas.System.Pos("RIGHT",Prop) > 0) Align.set(pas.Classes.TAlignment.taRightJustify);
                  if (pas.System.Pos("LEFT",Prop) > 0) Align.set(pas.Classes.TAlignment.taLeftJustify);
                  if (pas.System.Pos("CENTER",Prop) > 0) Align.set(pas.Classes.TAlignment.taCenter);
                };
                if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos("INDENT",TagProp,{get: function () {
                    return TagPos;
                  }, set: function (v) {
                    TagPos = v;
                  }}) > 0) {
                  Prop = pas.System.Copy(TagProp,TagPos + 6,TagProp.length);
                  Prop = pas.System.Copy(Prop,pas.System.Pos('"',Prop) + 1,Prop.length);
                  Prop = pas.System.Copy(Prop,1,pas.System.Pos('"',Prop) - 1);
                  PIndent.set($impl.IStrToInt(Prop));
                };
                if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos("FLOAT",TagProp,{get: function () {
                    return TagPos;
                  }, set: function (v) {
                    TagPos = v;
                  }}) > 0) {
                  Prop = pas.System.Copy(TagProp,TagPos + 5,TagProp.length);
                  Prop = pas.System.Copy(Prop,pas.System.Pos('"',Prop) + 1,Prop.length);
                  Prop = pas.System.Copy(Prop,1,pas.System.Pos('"',Prop) - 1);
                  if (Prop === "LEFT") txtfloat.set(TFloatStyle.fsLeft);
                  if (Prop === "RIGHT") txtfloat.set(TFloatStyle.fsRight);
                  floatpt.$assign(pas.Types.Point(Math.round(r.Left),Math.round(r.Top)));
                };
                if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos("BGCOLOR",TagProp,{get: function () {
                    return TagPos;
                  }, set: function (v) {
                    TagPos = v;
                  }}) > 0) {
                  Prop = pas.System.Copy(TagProp,TagPos + 5,TagProp.length);
                  Prop = pas.System.Copy(Prop,pas.System.Pos('"',Prop) + 1,Prop.length);
                  Prop = pas.System.Copy(Prop,1,pas.System.Pos('"',Prop) - 1);
                  NewColor = -1;
                  if (Prop.length > 0) {
                    if (Prop.charAt(0) === "#") {
                      NewColor = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor(Prop)}
                     else NewColor = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.TextToColor(Prop);
                  };
                  if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos("BGCOLORTO",TagProp,{get: function () {
                      return TagPos;
                    }, set: function (v) {
                      TagPos = v;
                    }}) > 0) {
                    Prop = pas.System.Copy(TagProp,TagPos + 5,TagProp.length);
                    Prop = pas.System.Copy(Prop,pas.System.Pos('"',Prop) + 1,Prop.length);
                    Prop = pas.System.Copy(Prop,1,pas.System.Pos('"',Prop) - 1);
                    if (!Calc) {
                      isPara = true;
                      AGraphics.FStroke.SetColor(NewColor);
                    };
                  } else {
                    if (!Calc) {
                      isPara = true;
                      paracolor = AGraphics.FFill.FColor;
                      AGraphics.FFill.SetColor(NewColor);
                      pencolor = AGraphics.FStroke.FColor;
                      AGraphics.FStroke.SetColor(NewColor);
                      AGraphics.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
                      AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
                      AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(fr.Left,r.Top,fr.Right,r.Bottom)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
                    };
                  };
                };
              };
            } else if ($tmp1 === "F") {
              if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos(">",s.get(),{get: function () {
                  return TagPos;
                }, set: function (v) {
                  TagPos = v;
                }}) > 0) {
                if (AGraphics.FFill.FKind === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone) {
                  BGColor = -1}
                 else BGColor = AGraphics.FFill.FColor;
                TagProp = pas.SysUtils.UpperCase(pas.System.Copy(s.get(),6,TagPos - 6));
                if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos("FACE",TagProp,{get: function () {
                    return TagPos;
                  }, set: function (v) {
                    TagPos = v;
                  }}) > 0) {
                  Prop = pas.System.Copy(TagProp,TagPos + 4,TagProp.length);
                  Prop = pas.System.Copy(Prop,pas.System.Pos('"',Prop) + 1,Prop.length);
                  Prop = pas.System.Copy(Prop,1,pas.System.Pos('"',Prop) - 1);
                  AGraphics.FFont.SetName(Prop);
                };
                if ((pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos(" COLOR",TagProp,{get: function () {
                    return TagPos;
                  }, set: function (v) {
                    TagPos = v;
                  }}) > 0) && !Selected) {
                  Prop = pas.System.Copy(TagProp,TagPos + 6,TagProp.length);
                  Prop = pas.System.Copy(Prop,pas.System.Pos('"',Prop) + 1,Prop.length);
                  Prop = pas.System.Copy(Prop,1,pas.System.Pos('"',Prop) - 1);
                  if (AGraphics.FFill.FColor !== -1) {
                    OldFontColor = AGraphics.FFont.FColor}
                   else OldFontColor = 0;
                  if (Prop.length > 0) {
                    if (Prop.charAt(0) === "#") {
                      FontColor = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor(Prop)}
                     else FontColor = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.TextToColor(Prop);
                  };
                };
                if ((pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos("BGCOLOR",TagProp,{get: function () {
                    return TagPos;
                  }, set: function (v) {
                    TagPos = v;
                  }}) > 0) && !Calc && !Selected) {
                  Prop = pas.System.Copy(TagProp,TagPos + 7,TagProp.length);
                  Prop = pas.System.Copy(Prop,pas.System.Pos('"',Prop) + 1,Prop.length);
                  Prop = pas.System.Copy(Prop,1,pas.System.Pos('"',Prop) - 1);
                  if (Prop.length > 0) {
                    if (Prop.charAt(0) === "#") {
                      BkColor = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor(Prop)}
                     else BkColor = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.TextToColor(Prop);
                  };
                };
                if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos("STYLE",TagProp,{get: function () {
                    return TagPos;
                  }, set: function (v) {
                    TagPos = v;
                  }}) > 0) {
                  Prop = pas.System.Copy(TagProp,TagPos + 5,TagProp.length);
                  Prop = pas.System.Copy(Prop,pas.System.Pos("=",Prop) + 1,Prop.length);
                  Prop = pas.System.Copy(Prop,pas.System.Pos('"',Prop) + 1,Prop.length);
                  if (pas.System.Pos("FONT-SIZE:",pas.SysUtils.UpperCase(Prop)) > 0) {
                    pas.System.Delete({get: function () {
                        return Prop;
                      }, set: function (v) {
                        Prop = v;
                      }},1,10);
                    if (pas.System.Pos("PT",pas.SysUtils.UpperCase(Prop)) > 0) {
                      Prop = pas.SysUtils.Trim(pas.System.Copy(Prop,1,pas.System.Pos("PT",pas.SysUtils.UpperCase(Prop)) - 1));
                      pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.SetFontSize(AGraphics.FFont,$impl.IStrToInt(Prop),1);
                    };
                  };
                } else {
                  if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos("SIZE",TagProp,{get: function () {
                      return TagPos;
                    }, set: function (v) {
                      TagPos = v;
                    }}) > 0) {
                    Prop = pas.System.Copy(TagProp,TagPos + 4,TagProp.length);
                    Prop = pas.System.Copy(Prop,pas.System.Pos("=",Prop) + 1,Prop.length);
                    Prop = pas.System.Copy(Prop,pas.System.Pos('"',Prop) + 1,Prop.length);
                    Prop = pas.System.Copy(Prop,1,pas.System.Pos('"',Prop) - 1);
                    var $tmp4 = $impl.IStrToInt(Prop);
                    if ($tmp4 === 1) {
                      pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.SetFontSize(AGraphics.FFont,8,1)}
                     else if ($tmp4 === 2) {
                      pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.SetFontSize(AGraphics.FFont,10,1)}
                     else if ($tmp4 === 3) {
                      pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.SetFontSize(AGraphics.FFont,12,1)}
                     else if ($tmp4 === 4) {
                      pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.SetFontSize(AGraphics.FFont,14,1)}
                     else if ($tmp4 === 5) {
                      pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.SetFontSize(AGraphics.FFont,16,1)}
                     else {
                      pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.SetFontSize(AGraphics.FFont,$impl.IStrToInt(Prop),1);
                    };
                  };
                };
              };
            } else if ($tmp1 === "S") {
              TagChar = pas.System.upcase(s.get().charAt(2));
              if (TagChar === ">") {
                AGraphics.FFont.SetStyle(rtl.unionSet(AGraphics.FFont.FStyle,rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsStrikeOut)))}
               else {
                if (TagChar === "H") {
                  isShad = true}
                 else {
                  if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.IPos("<SUB>",s.get()) === 1) {
                    isSub = true}
                   else if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.IPos("<SUP>",s.get()) === 1) isSup = true;
                };
              };
            } else if ($tmp1 === "R") {
              TagProp = pas.System.Copy(s.get(),3,pas.System.Pos(">",s.get()) - 1);
              Prop = pas.System.Copy(TagProp,pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.IPos("a",TagProp) + 2,TagProp.length);
              Prop = pas.System.Copy(Prop,pas.System.Pos('"',Prop) + 1,Prop.length);
              Prop = pas.System.Copy(Prop,1,pas.System.Pos('"',Prop) - 1);
            } else if ($tmp1 === "Z") Invisible = true;
          };
          if ((pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos(">",s.get(),{get: function () {
              return TagPos;
            }, set: function (v) {
              TagPos = v;
            }}) > 0) && !imgbreak) {
            Res = Res + pas.System.Copy(s.get(),1,TagPos);
            pas.System.Delete(s,1,TagPos);
          } else if (!imgbreak) pas.System.Delete(s,1,s.get().length);
        };
      };
      w.set(w.get() - sw);
      if (w.get() > XSize.get()) XSize.set(w.get() + 2);
      if ((FocusLink === (HyperLinks.get() - 1)) && Anchor && !Calc) {
        rr.Right = cr.Left;
        rr.Bottom = cr.Bottom;
        pas["WEBLib.TMSFNCTypes"].InflateRectEx(rr,1,0);
        rr.Left = r.Left + 1;
        rr.Top = rr.Bottom;
      };
      Result = Res;
      return Result;
    };
    Anchor = false;
    error = false;
    OldFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
    OldFont.AssignSource(AGraphics.FFont);
    OldFontColor = AGraphics.FFont.FColor;
    DrawFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
    DrawFont.AssignSource(AGraphics.FFont);
    DrawFontCOlor = AGraphics.FFont.FColor;
    CalcFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
    CalcFont.AssignSource(AGraphics.FFont);
    CalcFontColor = AGraphics.FFont.FColor;
    OldDrawFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
    OldDrawFont.AssignSource(AGraphics.FFont);
    OldDrawFontColor = AGraphics.FFont.FColor;
    OldCalcFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
    OldCalcFont.AssignSource(AGraphics.FFont);
    OldCalcFontColor = AGraphics.FFont.FColor;
    blnkcolor = AGraphics.FFill.FColor;
    OldPenColor = AGraphics.FStroke.FColor;
    blnkKind = AGraphics.FFill.FKind;
    OldPenKind = AGraphics.FStroke.FKind;
    BGColor = -1;
    BkColor = -1;
    paracolor = -1;
    isPara = false;
    isShad = false;
    Invisible = false;
    ControlRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,0,0));
    CV.set("");
    CT.set("");
    if (!CheckHotSpot) CID.set("");
    ofsx = 0;
    newofsx = 0;
    txtfloat = TFloatStyle.fsNone;
    floatrect.$assign(pas.Types.Rect(0,0,0,0));
    Result = false;
    r.$assign(fr);
    Align = pas.Classes.TAlignment.taLeftJustify;
    PIndent = 0;
    XSize.set(0);
    YSize.set(0);
    HyperLinks.set(0);
    hlcount = 0;
    ListIndex = 0;
    licount = 0;
    StripVal.set("");
    FocusAnchor.set("");
    MouseLink.set(-1);
    MouseInAnchor = false;
    ImgIdx = 0;
    AltImg = -1;
    if (pas.System.Pos("&",s) > 0) {
      s = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.UnFixMarkup(s,true,true);
      do {
        FoundTag = false;
        if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.TagReplaceString("&amp;","&",{get: function () {
            return s;
          }, set: function (v) {
            s = v;
          }})) FoundTag = true;
      } while (FoundTag);
    };
    s = $impl.DBTagStrip(s);
    s = $impl.UnicodeTagStrip(s);
    s = $impl.CRLFStrip(s,true);
    inspoint = 0;
    LineCount.set(0);
    while (s.length > 0) {
      OldFont.AssignSource(OldCalcFont);
      OldFontColor = OldCalcFontColor;
      AGraphics.FFont.AssignSource(CalcFont);
      FontColor = CalcFontColor;
      OldAnchor = Anchor;
      OldAnchorVal = LastAnchor;
      suph = 0;
      subh = 0;
      imgali = 0;
      isSup = false;
      isSub = false;
      Hotspot = false;
      ImageHotspot = false;
      htmlwidth = 0;
      rh.$assign(AGraphics.CalculateText$1("gh"));
      htmlheight = rh.Bottom - rh.Top;
      txtheight = htmlheight;
      OldImgIdx = ImgIdx;
      s = pas.SysUtils.Trim(s);
      txtfloatbefore = txtfloat;
      su = HTMLDrawLine(AGraphics,{get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),true,{get: function () {
          return htmlwidth;
        }, set: function (v) {
          htmlwidth = v;
        }},{get: function () {
          return htmlheight;
        }, set: function (v) {
          htmlheight = v;
        }},{get: function () {
          return subh;
        }, set: function (v) {
          subh = v;
        }},{get: function () {
          return suph;
        }, set: function (v) {
          suph = v;
        }},{get: function () {
          return imgali;
        }, set: function (v) {
          imgali = v;
        }},{get: function () {
          return Align;
        }, set: function (v) {
          Align = v;
        }},{get: function () {
          return PIndent;
        }, set: function (v) {
          PIndent = v;
        }},XPos,YPos,{get: function () {
          return Hotspot;
        }, set: function (v) {
          Hotspot = v;
        }},{get: function () {
          return ImageHotspot;
        }, set: function (v) {
          ImageHotspot = v;
        }},ofsx,{get: function () {
          return newofsx;
        }, set: function (v) {
          newofsx = v;
        }},floatrect,{get: function () {
          return txtfloat;
        }, set: function (v) {
          txtfloat = v;
        }});
      LineCount.set(LineCount.get() + 1);
      Anchor = OldAnchor;
      LastAnchor = OldAnchorVal;
      CalcFont.AssignSource(AGraphics.FFont);
      CalcFontColor = AGraphics.FFont.FColor;
      OldCalcFont.AssignSource(OldFont);
      OldCalcFontColor = OldFontColor;
      htmlheight = htmlheight + LineSpacing;
      dr.$assign(r);
      var $tmp = Align;
      if ($tmp === pas.Classes.TAlignment.taCenter) {
        if ((r.Right - r.Left - htmlwidth) > 0) dr.Left = r.Left + ((r.Right - r.Left - htmlwidth) / 2)}
       else if ($tmp === pas.Classes.TAlignment.taRightJustify) if ((r.Right - htmlwidth) > r.Left) dr.Left = r.Right - htmlwidth;
      dr.Left = dr.Left + PIndent;
      dr.Right = dr.Right + PIndent;
      dr.Bottom = dr.Top + htmlheight + subh + suph;
      if (!CheckHeight) {
        OldFont.AssignSource(OldDrawFont);
        OldFontColor = OldDrawFontColor;
        AGraphics.FFont.AssignSource(DrawFont);
        FontColor = DrawFontCOlor;
        HyperLinks.set(hlcount);
        ListIndex = licount;
        ImgIdx = OldImgIdx;
        HTMLDrawLine(AGraphics,{get: function () {
            return su;
          }, set: function (v) {
            su = v;
          }},pas["WEBLib.TMSFNCTypes"].TRectF.$clone(dr),CheckHotSpot,{get: function () {
            return htmlwidth;
          }, set: function (v) {
            htmlwidth = v;
          }},{get: function () {
            return htmlheight;
          }, set: function (v) {
            htmlheight = v;
          }},{get: function () {
            return subh;
          }, set: function (v) {
            subh = v;
          }},{get: function () {
            return suph;
          }, set: function (v) {
            suph = v;
          }},{get: function () {
            return imgali;
          }, set: function (v) {
            imgali = v;
          }},{get: function () {
            return Align;
          }, set: function (v) {
            Align = v;
          }},{get: function () {
            return PIndent;
          }, set: function (v) {
            PIndent = v;
          }},XPos,YPos,{get: function () {
            return Hotspot;
          }, set: function (v) {
            Hotspot = v;
          }},{get: function () {
            return ImageHotspot;
          }, set: function (v) {
            ImageHotspot = v;
          }},ofsx,{get: function () {
            return newofsx;
          }, set: function (v) {
            newofsx = v;
          }},floatrect,{get: function () {
            return txtfloat;
          }, set: function (v) {
            txtfloat = v;
          }});
        hlcount = HyperLinks.get();
        licount = ListIndex;
        r.Left = fr.Left + floatrect.Left;
        r.Right = fr.Right - floatrect.Right;
        if (dr.Top > floatrect.Bottom) {
          floatrect.Left = 0;
          floatrect.Right = 0;
          r.Left = fr.Left;
        };
        rh.$assign(AGraphics.CalculateText$1("gh"));
        if ((Hotspot && (YPos > (dr.Bottom - imgali - (rh.Bottom - rh.Top))) && (YPos < (dr.Bottom - imgali))) || ImageHotspot) {
          Result = true;
        };
        ofsx = newofsx;
        DrawFont.AssignSource(AGraphics.FFont);
        DrawFontCOlor = FontColor;
        OldDrawFont.AssignSource(OldFont);
        OldDrawFontColor = OldFontColor;
      };
      if ((txtfloat !== TFloatStyle.fsNone) && (txtfloat !== txtfloatbefore)) {
        r.Left = floatpt.x;
        r.Top = floatpt.y;
        txtfloat = TFloatStyle.fsNone;
      } else {
        r.Top = r.Top + htmlheight + subh + suph;
        YSize.set(YSize.get() + htmlheight + subh + suph);
      };
      if (((r.Top + txtheight) > (r.Bottom + 1)) && !CheckHeight) s = "";
    };
    if (YSize.get() === 0) {
      rh.$assign(AGraphics.CalculateText$1("gh"));
      YSize.set(rh.Bottom - rh.Top);
    };
    inspoint = inspoint >>> 1;
    AGraphics.FStroke.SetKind(OldPenKind);
    AGraphics.FFill.SetKind(blnkKind);
    AGraphics.FStroke.SetColor(OldPenColor);
    AGraphics.FFill.SetColor(blnkcolor);
    AGraphics.FFont.AssignSource(OldFont);
    OldFont = rtl.freeLoc(OldFont);
    DrawFont = rtl.freeLoc(DrawFont);
    CalcFont = rtl.freeLoc(CalcFont);
    OldDrawFont = rtl.freeLoc(OldDrawFont);
    OldCalcFont = rtl.freeLoc(OldCalcFont);
    return Result;
  };
  this.HiLight = function (s, h, tag, DoCase, FullText) {
    var Result = "";
    var hs = "";
    var l = 0;
    var k = 0;
    var m = 0;
    var IsHTML = false;
    tag = pas.SysUtils.UpperCase(tag);
    hs = pas.SysUtils.UpperCase(s);
    l = pas.System.Pos("<" + tag + ">",hs);
    while (l > 0) {
      pas.System.Delete({get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},l,tag.length + 2);
      pas.System.Delete({get: function () {
          return hs;
        }, set: function (v) {
          hs = v;
        }},l,tag.length + 2);
      l = pas.System.Pos("<" + tag + ">",hs);
    };
    l = pas.System.Pos("</" + tag + ">",hs);
    while (l > 0) {
      pas.System.Delete({get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},l,tag.length + 3);
      pas.System.Delete({get: function () {
          return hs;
        }, set: function (v) {
          hs = v;
        }},l,tag.length + 3);
      l = pas.System.Pos("</" + tag + ">",hs);
    };
    if (!DoCase) h = pas["WEBLib.TMSFNCTypes"].AnsiUpperCase(h);
    IsHTML = pas.System.Pos("</",s) > 0;
    if (IsHTML) {
      hs = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.UnFixMarkup($impl.HTMLStripAll(s),true,false)}
     else hs = s;
    if (!DoCase) hs = pas["WEBLib.TMSFNCTypes"].AnsiUpperCase(hs);
    Result = "";
    if (FullText) {
      if (h === hs) if (IsHTML) {
        s = "<" + tag + ">" + s + "</" + tag + ">"}
       else s = "<" + tag + ">" + pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.FixMarkup(s,true) + "</" + tag + ">";
    } else if (!IsHTML) {
      l = pas.System.Pos(h,hs);
      if (l > 0) {
        do {
          Result = Result + pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.FixMarkup(pas.System.Copy(s,1,l - 1),false) + "<" + tag + ">" + pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.FixMarkup(pas.System.Copy(s,l,h.length),false) + "</" + tag + ">";
          pas.System.Delete({get: function () {
              return s;
            }, set: function (v) {
              s = v;
            }},1,(l + h.length) - 1);
          pas.System.Delete({get: function () {
              return hs;
            }, set: function (v) {
              hs = v;
            }},1,(l + h.length) - 1);
          l = pas.System.Pos(h,hs);
        } while (!(l === 0));
        s = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.FixMarkup(s,false);
      };
    } else {
      l = pas.System.Pos(h,hs);
      while (l > 0) {
        pas.System.Delete({get: function () {
            return hs;
          }, set: function (v) {
            hs = v;
          }},1,(l + h.length) - 1);
        do {
          k = pas.System.Pos("<",s);
          m = pas.System.Pos("&",s);
          while (((k > 0) && (k <= l)) || ((m > 0) && (m < l))) {
            if ((k > 0) && ((m <= 0) || (k < m))) {
              Result = Result + pas.System.Copy(s,1,k - 1);
              pas.System.Delete({get: function () {
                  return s;
                }, set: function (v) {
                  s = v;
                }},1,k - 1);
              l = l - (k - 1);
              m = m - (k - 1);
              k = pas.System.Pos(">",s);
              if (k === 0) k = s.length;
              Result = Result + pas.System.Copy(s,1,k);
              pas.System.Delete({get: function () {
                  return s;
                }, set: function (v) {
                  s = v;
                }},1,k);
              m = m - k;
              k = pas.System.Pos("<",s);
            } else {
              Result = Result + pas.System.Copy(s,1,m - 1);
              pas.System.Delete({get: function () {
                  return s;
                }, set: function (v) {
                  s = v;
                }},1,m - 1);
              l = l - (m - 1) - 1;
              k = k - (m - 1);
              m = pas.System.Pos(";",s);
              l = (l - m) + 1;
              if (m === 0) m = s.length;
              Result = Result + pas.System.Copy(s,1,m);
              pas.System.Delete({get: function () {
                  return s;
                }, set: function (v) {
                  s = v;
                }},1,m);
              k = k - m;
              m = pas.System.Pos("&",s);
            };
          };
          Result = Result + pas.System.Copy(s,1,l - 1) + "<" + tag + ">";
          pas.System.Delete({get: function () {
              return s;
            }, set: function (v) {
              s = v;
            }},1,l - 1);
          k = k - (l - 1);
          m = m - (l - 1);
          l = h.length;
          while ((((k > 0) && (k <= l)) || ((m > 0) && (m <= l))) && (l > 0) && (s !== "")) {
            if ((k > 0) && ((m <= 0) || (k < m))) {
              Result = Result + pas.System.Copy(s,1,k - 1);
              pas.System.Delete({get: function () {
                  return s;
                }, set: function (v) {
                  s = v;
                }},1,k - 1);
              l = l - (k - 1);
              m = m - (k - 1);
              k = pas.System.Pos(">",s);
              if (k === 0) k = s.length;
              Result = Result + pas.System.Copy(s,1,k);
              if (pas.SysUtils.UpperCase(pas.System.Copy(s,1,6)) === "</FONT") Result = Result + "</" + tag + "><" + tag + ">";
              pas.System.Delete({get: function () {
                  return s;
                }, set: function (v) {
                  s = v;
                }},1,k);
              m = m - k;
              k = pas.System.Pos("<",s);
            } else {
              Result = Result + pas.System.Copy(s,1,m - 1);
              pas.System.Delete({get: function () {
                  return s;
                }, set: function (v) {
                  s = v;
                }},1,m - 1);
              l = l - (m - 1) - 1;
              k = k - (m - 1);
              m = pas.System.Pos(";",s);
              if (m === 0) m = s.length;
              Result = Result + pas.System.Copy(s,1,m);
              pas.System.Delete({get: function () {
                  return s;
                }, set: function (v) {
                  s = v;
                }},1,m);
              k = k - m;
              m = pas.System.Pos("&",s);
            };
          };
          if (l > 0) {
            Result = Result + pas.System.Copy(s,1,l);
            pas.System.Delete({get: function () {
                return s;
              }, set: function (v) {
                s = v;
              }},1,l);
          };
          Result = Result + "</" + tag + ">";
          l = 0;
        } while (!(l === 0));
        l = pas.System.Pos(h,hs);
      };
    };
    Result = Result + s;
    return Result;
  };
  this.UnHiLight = function (s, tag) {
    var Result = "";
    var IsHTML = false;
    var WasHTML = false;
    Result = "";
    WasHTML = pas.System.Pos("</",s) > 0;
    tag = pas.SysUtils.UpperCase(tag);
    while (pas.System.Pos("<" + tag + ">",pas.SysUtils.UpperCase(s)) > 0) s = pas.SysUtils.StringReplace(s,"<" + tag + ">","",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfIgnoreCase));
    while (pas.System.Pos("</" + tag + ">",pas.SysUtils.UpperCase(s)) > 0) s = pas.SysUtils.StringReplace(s,"</" + tag + ">","",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfIgnoreCase));
    IsHTML = pas.System.Pos("</",s) > 0;
    if (WasHTML && !IsHTML) s = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.UnFixMarkup(s,false,false);
    Result = s;
    return Result;
  };
  this.GetControlValue = function (HTML, ControlID, ControlValue) {
    var Result = false;
    var lp = 0;
    var Tag = "";
    var CType = "";
    var CID = "";
    var CV = "";
    var CW = "";
    var CH = "";
    var CP = "";
    var CL = "";
    Result = false;
    lp = 0;
    while ($impl.VarIPos("<CONTROL ",HTML,{get: function () {
        return lp;
      }, set: function (v) {
        lp = v;
      }}) > 0) {
      pas.System.Delete({get: function () {
          return HTML;
        }, set: function (v) {
          HTML = v;
        }},1,lp);
      Tag = pas.System.Copy(HTML,1,pas.System.Pos(">",HTML));
      CType = "";
      CID = "";
      CV = "";
      CW = "";
      CH = "";
      CP = "";
      CL = "";
      $mod.ParseControl(Tag,{get: function () {
          return CType;
        }, set: function (v) {
          CType = v;
        }},{get: function () {
          return CID;
        }, set: function (v) {
          CID = v;
        }},{get: function () {
          return CV;
        }, set: function (v) {
          CV = v;
        }},{get: function () {
          return CW;
        }, set: function (v) {
          CW = v;
        }},{get: function () {
          return CH;
        }, set: function (v) {
          CH = v;
        }},{get: function () {
          return CP;
        }, set: function (v) {
          CP = v;
        }},{get: function () {
          return CL;
        }, set: function (v) {
          CL = v;
        }});
      if (ControlID === CID) {
        ControlValue.set(CV);
        Result = true;
        return Result;
      };
    };
    return Result;
  };
  this.GetControlProp = function (HTML, ControlID) {
    var Result = "";
    var lp = 0;
    var Tag = "";
    var CType = "";
    var CID = "";
    var CV = "";
    var CW = "";
    var CH = "";
    var CP = "";
    var CL = "";
    Result = "";
    lp = 0;
    while ($impl.VarIPos("<CONTROL ",HTML,{get: function () {
        return lp;
      }, set: function (v) {
        lp = v;
      }}) > 0) {
      pas.System.Delete({get: function () {
          return HTML;
        }, set: function (v) {
          HTML = v;
        }},1,lp);
      Tag = pas.System.Copy(HTML,1,pas.System.Pos(">",HTML));
      CType = "";
      CID = "";
      CV = "";
      CW = "";
      CH = "";
      CP = "";
      CL = "";
      $mod.ParseControl(Tag,{get: function () {
          return CType;
        }, set: function (v) {
          CType = v;
        }},{get: function () {
          return CID;
        }, set: function (v) {
          CID = v;
        }},{get: function () {
          return CV;
        }, set: function (v) {
          CV = v;
        }},{get: function () {
          return CW;
        }, set: function (v) {
          CW = v;
        }},{get: function () {
          return CH;
        }, set: function (v) {
          CH = v;
        }},{get: function () {
          return CP;
        }, set: function (v) {
          CP = v;
        }},{get: function () {
          return CL;
        }, set: function (v) {
          CL = v;
        }});
      if (ControlID === CID) {
        Result = CP;
        return Result;
      };
    };
    return Result;
  };
  this.GetControlMaxLen = function (HTML, ControlID) {
    var Result = 0;
    var lp = 0;
    var e = 0;
    var Tag = "";
    var CType = "";
    var CID = "";
    var CV = "";
    var CW = "";
    var CH = "";
    var CP = "";
    var CL = "";
    Result = 0;
    lp = 0;
    e = 0;
    while ($impl.VarIPos("<CONTROL ",HTML,{get: function () {
        return lp;
      }, set: function (v) {
        lp = v;
      }}) > 0) {
      pas.System.Delete({get: function () {
          return HTML;
        }, set: function (v) {
          HTML = v;
        }},1,lp);
      Tag = pas.System.Copy(HTML,1,pas.System.Pos(">",HTML));
      CType = "";
      CID = "";
      CV = "";
      CW = "";
      CH = "";
      CP = "";
      CL = "";
      $mod.ParseControl(Tag,{get: function () {
          return CType;
        }, set: function (v) {
          CType = v;
        }},{get: function () {
          return CID;
        }, set: function (v) {
          CID = v;
        }},{get: function () {
          return CV;
        }, set: function (v) {
          CV = v;
        }},{get: function () {
          return CW;
        }, set: function (v) {
          CW = v;
        }},{get: function () {
          return CH;
        }, set: function (v) {
          CH = v;
        }},{get: function () {
          return CP;
        }, set: function (v) {
          CP = v;
        }},{get: function () {
          return CL;
        }, set: function (v) {
          CL = v;
        }});
      if (ControlID === CID) {
        pas.System.val$6(CL,{get: function () {
            return Result;
          }, set: function (v) {
            Result = v;
          }},{get: function () {
            return e;
          }, set: function (v) {
            e = v;
          }});
        return Result;
      };
    };
    return Result;
  };
  this.SetControlValue = function (HTML, ControlID, ControlValue) {
    var Result = false;
    var lp = 0;
    var Tag = "";
    var Temp = "";
    var CType = "";
    var CID = "";
    var CV = "";
    var CW = "";
    var CH = "";
    var CP = "";
    var CL = "";
    Result = false;
    Temp = "";
    ControlValue = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.FixMarkup(ControlValue,true);
    lp = 0;
    while ($impl.VarIPos("<CONTROL ",HTML.get(),{get: function () {
        return lp;
      }, set: function (v) {
        lp = v;
      }}) > 0) {
      Temp = Temp + pas.System.Copy(HTML.get(),1,lp);
      pas.System.Delete(HTML,1,lp);
      Tag = pas.System.Copy(HTML.get(),1,pas.System.Pos(">",HTML.get()));
      CType = "";
      CID = "";
      CV = "";
      CW = "";
      CH = "";
      CP = "";
      CL = "";
      $mod.ParseControl(Tag,{get: function () {
          return CType;
        }, set: function (v) {
          CType = v;
        }},{get: function () {
          return CID;
        }, set: function (v) {
          CID = v;
        }},{get: function () {
          return CV;
        }, set: function (v) {
          CV = v;
        }},{get: function () {
          return CW;
        }, set: function (v) {
          CW = v;
        }},{get: function () {
          return CH;
        }, set: function (v) {
          CH = v;
        }},{get: function () {
          return CP;
        }, set: function (v) {
          CP = v;
        }},{get: function () {
          return CL;
        }, set: function (v) {
          CL = v;
        }});
      if (ControlID === CID) {
        Temp = Temp + "CONTROL ID=" + $mod.TMSFNCHTMLENGINE_ATTR_DELIM + ControlID + $mod.TMSFNCHTMLENGINE_ATTR_DELIM + " VALUE=" + $mod.TMSFNCHTMLENGINE_ATTR_DELIM + ControlValue + $mod.TMSFNCHTMLENGINE_ATTR_DELIM + " WIDTH=" + $mod.TMSFNCHTMLENGINE_ATTR_DELIM + CW + $mod.TMSFNCHTMLENGINE_ATTR_DELIM + " TYPE=" + $mod.TMSFNCHTMLENGINE_ATTR_DELIM + CType + $mod.TMSFNCHTMLENGINE_ATTR_DELIM;
        if (CP !== "") Temp = Temp + " PROP=" + $mod.TMSFNCHTMLENGINE_ATTR_DELIM + pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.FixMarkup(CP,true) + $mod.TMSFNCHTMLENGINE_ATTR_DELIM;
        if (CL !== "") Temp = Temp + " MAXLEN=" + $mod.TMSFNCHTMLENGINE_ATTR_DELIM + CL + $mod.TMSFNCHTMLENGINE_ATTR_DELIM;
        Temp = Temp + ">";
        HTML.set(Temp + pas.System.Copy(HTML.get(),pas.System.Pos(">",HTML.get()) + 1,HTML.get().length));
        Result = true;
        return Result;
      };
    };
    return Result;
  };
  this.ClearRadioControls = function (HTML) {
    var Result = "";
    var lp = 0;
    var Tag = "";
    var CType = "";
    var CID = "";
    var CV = "";
    var CW = "";
    var CH = "";
    var CP = "";
    var CL = "";
    var sl = null;
    var s = "";
    Result = "";
    s = HTML;
    sl = pas.Classes.TStringList.$create("Create$1");
    lp = 0;
    while ($impl.VarIPos("<CONTROL ",HTML,{get: function () {
        return lp;
      }, set: function (v) {
        lp = v;
      }}) > 0) {
      pas.System.Delete({get: function () {
          return HTML;
        }, set: function (v) {
          HTML = v;
        }},1,lp);
      Tag = pas.System.Copy(HTML,1,pas.System.Pos(">",HTML));
      CType = "";
      CID = "";
      CV = "";
      CW = "";
      CH = "";
      CP = "";
      CL = "";
      $mod.ParseControl(Tag,{get: function () {
          return CType;
        }, set: function (v) {
          CType = v;
        }},{get: function () {
          return CID;
        }, set: function (v) {
          CID = v;
        }},{get: function () {
          return CV;
        }, set: function (v) {
          CV = v;
        }},{get: function () {
          return CW;
        }, set: function (v) {
          CW = v;
        }},{get: function () {
          return CH;
        }, set: function (v) {
          CH = v;
        }},{get: function () {
          return CP;
        }, set: function (v) {
          CP = v;
        }},{get: function () {
          return CL;
        }, set: function (v) {
          CL = v;
        }});
      if (CType === "RADIO") sl.Add(CID);
    };
    for (var $l = 0, $end = sl.GetCount() - 1; $l <= $end; $l++) {
      lp = $l;
      $mod.SetControlValue({get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},sl.Get(lp),"FALSE");
    };
    sl = rtl.freeLoc(sl);
    Result = s;
    return Result;
  };
  this.GetNextControlID = function (HTML, ControlID) {
    var Result = "";
    var lp = 0;
    var Tag = "";
    var CType = "";
    var CID = "";
    var CV = "";
    var CW = "";
    var CH = "";
    var CP = "";
    var CL = "";
    var flg = false;
    Result = "";
    flg = ControlID === "";
    lp = 0;
    while ($impl.VarIPos("<CONTROL ",HTML,{get: function () {
        return lp;
      }, set: function (v) {
        lp = v;
      }}) > 0) {
      pas.System.Delete({get: function () {
          return HTML;
        }, set: function (v) {
          HTML = v;
        }},1,lp);
      Tag = pas.System.Copy(HTML,1,pas.System.Pos(">",HTML));
      CType = "";
      CID = "";
      CV = "";
      CW = "";
      CH = "";
      CP = "";
      CL = "";
      $mod.ParseControl(Tag,{get: function () {
          return CType;
        }, set: function (v) {
          CType = v;
        }},{get: function () {
          return CID;
        }, set: function (v) {
          CID = v;
        }},{get: function () {
          return CV;
        }, set: function (v) {
          CV = v;
        }},{get: function () {
          return CW;
        }, set: function (v) {
          CW = v;
        }},{get: function () {
          return CH;
        }, set: function (v) {
          CH = v;
        }},{get: function () {
          return CP;
        }, set: function (v) {
          CP = v;
        }},{get: function () {
          return CL;
        }, set: function (v) {
          CL = v;
        }});
      if (flg && (CType !== "BUTTON") && (CType !== "CHECK") && (CType !== "RADIO")) {
        Result = CID;
        return Result;
      };
      if (ControlID === CID) flg = true;
    };
    return Result;
  };
  this.HasHTMLControl = function (HTML) {
    var Result = false;
    var lp = 0;
    lp = 0;
    Result = $impl.VarIPos("<CONTROL",HTML,{get: function () {
        return lp;
      }, set: function (v) {
        lp = v;
      }}) > 0;
    return Result;
  };
  this.ParseControl = function (Tag, ControlType, ControlID, ControlValue, ControlWidth, ControlHeight, ControlProp, ControlLen) {
    var Prop = "";
    var vp = 0;
    ControlType.set("");
    ControlWidth.set("");
    ControlHeight.set("");
    ControlValue.set("");
    ControlID.set("");
    ControlProp.set("");
    ControlLen.set("");
    vp = 0;
    if ($impl.VarIPos("TYPE=",Tag,{get: function () {
        return vp;
      }, set: function (v) {
        vp = v;
      }}) > 0) {
      Prop = pas.System.Copy(Tag,vp + 1,Tag.length);
      Prop = pas.System.Copy(Prop,pas.System.Pos($mod.TMSFNCHTMLENGINE_ATTR_DELIM,Prop) + 1,Prop.length);
      Prop = pas.System.Copy(Prop,1,pas.System.Pos($mod.TMSFNCHTMLENGINE_ATTR_DELIM,Prop) - 1);
      ControlType.set(pas.SysUtils.UpperCase(Prop));
    };
    if ($impl.VarIPos("WIDTH=",Tag,{get: function () {
        return vp;
      }, set: function (v) {
        vp = v;
      }}) > 0) {
      Prop = pas.System.Copy(Tag,vp + 1,Tag.length);
      Prop = pas.System.Copy(Prop,pas.System.Pos($mod.TMSFNCHTMLENGINE_ATTR_DELIM,Prop) + 1,Prop.length);
      Prop = pas.System.Copy(Prop,1,pas.System.Pos($mod.TMSFNCHTMLENGINE_ATTR_DELIM,Prop) - 1);
      ControlWidth.set(Prop);
    };
    if ($impl.VarIPos("HEIGHT=",Tag,{get: function () {
        return vp;
      }, set: function (v) {
        vp = v;
      }}) > 0) {
      Prop = pas.System.Copy(Tag,vp + 1,Tag.length);
      Prop = pas.System.Copy(Prop,pas.System.Pos($mod.TMSFNCHTMLENGINE_ATTR_DELIM,Prop) + 1,Prop.length);
      Prop = pas.System.Copy(Prop,1,pas.System.Pos($mod.TMSFNCHTMLENGINE_ATTR_DELIM,Prop) - 1);
      ControlHeight.set(Prop);
    };
    if ($impl.VarIPos("ID=",Tag,{get: function () {
        return vp;
      }, set: function (v) {
        vp = v;
      }}) > 0) {
      Prop = pas.System.Copy(Tag,vp + 1,Tag.length);
      Prop = pas.System.Copy(Prop,pas.System.Pos($mod.TMSFNCHTMLENGINE_ATTR_DELIM,Prop) + 1,Prop.length);
      Prop = pas.System.Copy(Prop,1,pas.System.Pos($mod.TMSFNCHTMLENGINE_ATTR_DELIM,Prop) - 1);
      ControlID.set(Prop);
    };
    if ($impl.VarIPos("VALUE=",Tag,{get: function () {
        return vp;
      }, set: function (v) {
        vp = v;
      }}) > 0) {
      Prop = pas.System.Copy(Tag,vp + 1,Tag.length);
      Prop = pas.System.Copy(Prop,pas.System.Pos($mod.TMSFNCHTMLENGINE_ATTR_DELIM,Prop) + 1,Prop.length);
      Prop = pas.System.Copy(Prop,1,pas.System.Pos($mod.TMSFNCHTMLENGINE_ATTR_DELIM,Prop) - 1);
      ControlValue.set(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.UnFixMarkup(Prop,true,false));
    };
    if ($impl.VarIPos("PROP=",Tag,{get: function () {
        return vp;
      }, set: function (v) {
        vp = v;
      }}) > 0) {
      Prop = pas.System.Copy(Tag,vp + 1,Tag.length);
      Prop = pas.System.Copy(Prop,pas.System.Pos($mod.TMSFNCHTMLENGINE_ATTR_DELIM,Prop) + 1,Prop.length);
      Prop = pas.System.Copy(Prop,1,pas.System.Pos($mod.TMSFNCHTMLENGINE_ATTR_DELIM,Prop) - 1);
      ControlProp.set(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.UnFixMarkup(Prop,true,false));
    };
    if ($impl.VarIPos("MAXLEN=",Tag,{get: function () {
        return vp;
      }, set: function (v) {
        vp = v;
      }}) > 0) {
      Prop = pas.System.Copy(Tag,vp + 1,Tag.length);
      Prop = pas.System.Copy(Prop,pas.System.Pos($mod.TMSFNCHTMLENGINE_ATTR_DELIM,Prop) + 1,Prop.length);
      Prop = pas.System.Copy(Prop,1,pas.System.Pos($mod.TMSFNCHTMLENGINE_ATTR_DELIM,Prop) - 1);
      ControlLen.set(Prop);
    };
  };
  $mod.$implcode = function () {
    $impl.VarIPos = function (su, s, Res) {
      var Result = 0;
      Res.set(pas.System.Pos(su,pas.SysUtils.UpperCase(s)));
      Result = Res.get();
      return Result;
    };
    $impl.HTMLStripAll = function (s) {
      var Result = "";
      var TagPos = 0;
      var PTP = 0;
      Result = "";
      while (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos("<",s,{get: function () {
          return TagPos;
        }, set: function (v) {
          TagPos = v;
        }}) > 0) {
        PTP = TagPos;
        if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos(">",s,{get: function () {
            return TagPos;
          }, set: function (v) {
            TagPos = v;
          }}) > PTP) {
          Result = Result + pas.System.Copy(s,1,PTP - 1);
          pas.System.Delete({get: function () {
              return s;
            }, set: function (v) {
              s = v;
            }},1,TagPos);
        } else break;
      };
      Result = Result + s;
      return Result;
    };
    $impl.IStrToInt = function (s) {
      var Result = 0;
      var Err = 0;
      var Res = 0;
      pas.System.val$6(s,{get: function () {
          return Res;
        }, set: function (v) {
          Res = v;
        }},{get: function () {
          return Err;
        }, set: function (v) {
          Err = v;
        }});
      Result = Res;
      return Result;
    };
    $impl.DBTagStrip = function (s) {
      var Result = "";
      var i = 0;
      var j = 0;
      i = pas.System.Pos("<#",s);
      if (i > 0) {
        Result = pas.System.Copy(s,1,i - 1);
        pas.System.Delete({get: function () {
            return s;
          }, set: function (v) {
            s = v;
          }},1,i);
        j = pas.System.Pos(">",s);
        if (j > 0) pas.System.Delete({get: function () {
            return s;
          }, set: function (v) {
            s = v;
          }},j,1);
        Result = Result + s;
      } else Result = s;
      return Result;
    };
    $impl.HexVal = function (s) {
      var Result = 0;
      var i = 0;
      var j = 0;
      if (s.length < 2) {
        Result = 0;
        return Result;
      };
      if (s.charAt(0) >= "A") {
        i = (s.charCodeAt(1 - 1) - 65) + 10}
       else i = s.charCodeAt(1 - 1) - 48;
      if (s.charAt(1) >= "A") {
        j = (s.charCodeAt(2 - 1) - 65) + 10}
       else j = s.charCodeAt(2 - 1) - 48;
      Result = (i << 4) + j;
      return Result;
    };
    $impl.UnicodeTagStrip = function (s) {
      var Result = "";
      var i = 0;
      var j = 0;
      var k = 0;
      var e = 0;
      var nn = 0;
      var su = "";
      var res = "";
      var w = 0;
      var ishex = false;
      function NonNum(aval, dohex) {
        var Result = 0;
        var i = 0;
        var ofs = 0;
        if (dohex) {
          ofs = 4}
         else ofs = 3;
        Result = ofs;
        for (var $l = ofs, $end = aval.length; $l <= $end; $l++) {
          i = $l;
          if (!((aval.charAt(i - 1) >= "0") && (aval.charAt(i - 1) <= "9"))) {
            Result = i;
            break;
          };
          if (dohex && !((aval.charAt(i - 1) >= "A") && (aval.charAt(i - 1) <= "F")) && dohex && !((aval.charAt(i - 1) >= "a") && (aval.charAt(i - 1) <= "f"))) {
            Result = i;
            break;
          };
        };
        return Result;
      };
      res = "";
      do {
        i = pas.System.Pos("&#",s);
        k = pas.System.Pos("&&#",s);
        if ((k === (i - 1)) && (k !== 0)) i = 0;
        if (i > 0) {
          res = res + pas.System.Copy(s,1,i - 1);
          pas.System.Delete({get: function () {
              return s;
            }, set: function (v) {
              s = v;
            }},1,i - 1);
          ishex = pas.System.Pos("&#x",s) === 1;
          j = pas.System.Pos(";",s);
          if (j > 7) {
            nn = NonNum(s,ishex);
            j = nn;
          };
          if (j > 0) {
            if (ishex) {
              su = pas.System.Copy(s,4,j - 4);
              try {
                w = $impl.HexVal(su);
                e = 0;
              } catch ($e) {
                w = 0;
              };
            } else {
              su = pas.System.Copy(s,3,j - 3);
              pas.System.val$6(su,{get: function () {
                  return w;
                }, set: function (v) {
                  w = v;
                }},{get: function () {
                  return e;
                }, set: function (v) {
                  e = v;
                }});
            };
            if ((su.length > 0) && (su.length <= 6) && (e === 0)) {
              res = res + String.fromCharCode(w);
              pas.System.Delete({get: function () {
                  return s;
                }, set: function (v) {
                  s = v;
                }},1,j);
            };
          } else {
            res = res + "&#";
            pas.System.Delete({get: function () {
                return s;
              }, set: function (v) {
                s = v;
              }},1,2);
          };
        } else res = res + s;
      } while (!(i <= 0));
      Result = res;
      return Result;
    };
    $impl.CRLFStrip = function (s, Break) {
      var Result = "";
      var i = 0;
      Result = "";
      for (var $l = 1, $end = s.length; $l <= $end; $l++) {
        i = $l;
        if (!((s.charAt(i - 1) === "\r") || (s.charAt(i - 1) === "\n"))) {
          Result = Result + s.charAt(i - 1)}
         else if ((s.charAt(i - 1) === "\r") && Break) Result = Result + "<BR>";
      };
      return Result;
    };
    $impl.IsCJKChar = function (C) {
      var Result = false;
      Result = false;
      if (C < "✐") return Result;
      var $tmp = C.charCodeAt() & 0xFFFFFFFF;
      if ((($tmp >= 0x4E00) && ($tmp <= 0x9FFF)) || (($tmp >= 0x3400) && ($tmp <= 0x4DBF)) || (($tmp >= 0x20000) && ($tmp <= 0x2A6DF)) || (($tmp >= 0x2A700) && ($tmp <= 0x2B73F)) || (($tmp >= 0x2B740) && ($tmp <= 0x2B81F)) || (($tmp >= 0x2B820) && ($tmp <= 0x2CEAF)) || (($tmp >= 0xF900) && ($tmp <= 0xFAFF)) || (($tmp >= 0x2F800) && ($tmp <= 0x2FA1F))) Result = true;
      return Result;
    };
    $impl.PosBreak = function (A) {
      var Result = 0;
      var I = 0;
      var C = "\x00";
      Result = 0;
      for (var $l = 1, $end = A.length; $l <= $end; $l++) {
        I = $l;
        C = A.charAt(I - 1);
        if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.CharInSet(C,pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.CreateCharSet(" ")) || $impl.IsCJKChar(C)) {
          Result = I;
          break;
        };
      };
      return Result;
    };
  };
},["SysUtils","WEBLib.TMSFNCUtils"]);
rtl.module("WEBLib.TMSFNCGraphics.General",["System","Classes","WEBLib.TMSFNCGraphicsTypes","Types","WEBLib.Graphics","WEBLib.TMSFNCGraphics","WEBLib.TMSFNCTypes"],function () {
  "use strict";
  var $mod = this;
  rtl.createClass(this,"TTMSFNCGraphicsContextGeneral",pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphicsContext,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphicsContext.$init.call(this);
      this.FPrinting = false;
      this.FOldPenStyle = 0;
      this.FOldPenWidth = 0;
    };
    this.GetNativeCanvas = function () {
      var Result = null;
      Result = this.GetCanvas();
      return Result;
    };
    this.DrawRotatedText = function (ACanvas, ARect, AText, AAngle, AHorizontalAlign, AVerticalAlign) {
      var tw = 0.0;
      var th = 0.0;
      var so = 0;
      var s = "";
      var xs = 0.0;
      var ys = 0.0;
      var angle = 0.0;
      var ha = 0;
      var va = 0;
      var r = pas["WEBLib.Graphics"].TCanvasRectF.$new();
      s = AText;
      angle = -10 * AAngle;
      xs = ARect.Left;
      ys = ARect.Top;
      tw = ACanvas.TextWidth(s);
      th = ACanvas.TextHeight(s);
      var $tmp = AHorizontalAlign;
      if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading) {
        ha = pas.Classes.TAlignment.taLeftJustify}
       else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter) {
        ha = pas.Classes.TAlignment.taCenter}
       else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaTrailing) ha = pas.Classes.TAlignment.taRightJustify;
      var $tmp1 = AVerticalAlign;
      if ($tmp1 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter) {
        va = pas["WEBLib.Graphics"].TVerticalAlignment.taVerticalCenter}
       else if ($tmp1 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading) {
        va = pas["WEBLib.Graphics"].TVerticalAlignment.taAlignTop}
       else if ($tmp1 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaTrailing) va = pas["WEBLib.Graphics"].TVerticalAlignment.taAlignBottom;
      r.$assign(pas["WEBLib.Graphics"].CreateCanvasRectF(ARect.Left,ARect.Top,ARect.Right,ARect.Bottom));
      ACanvas.TextRect$1(pas["WEBLib.Graphics"].TCanvasRectF.$clone(r),s,false,false,ha,va);
    };
    this.Destroy = function () {
      pas.System.TObject.Destroy.call(this);
    };
    this.GetFillColor = function () {
      var Result = 0;
      Result = this.GetCanvas().FBrush.FColor;
      return Result;
    };
    this.CalculateText = function (AText, ARect, AWordWrapping) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.Graphics"].TCanvasRectF.$new();
      r.$assign(pas["WEBLib.Graphics"].CreateCanvasRectF(ARect.Left,ARect.Top,ARect.Right,ARect.Bottom));
      r.$assign(this.GetCanvas().TextRect$1(pas["WEBLib.Graphics"].TCanvasRectF.$clone(r),AText,AWordWrapping,true,pas.Classes.TAlignment.taLeftJustify,pas["WEBLib.Graphics"].TVerticalAlignment.taAlignTop));
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top,r.Right,r.Bottom));
      return Result;
    };
    this.SetTextAngle = function (ARect, AAngle) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var ar = 0.0;
      var cx = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var c = 0.0;
      var s = 0.0;
      var w = 0.0;
      var cw = 0.0;
      var h = 0.0;
      var ch = 0.0;
      Result.$assign(ARect);
      if (AAngle !== 0) {
        ar = pas.Math.DegToRad(AAngle);
        cx.X = Result.Left + ((Result.Right - Result.Left) / 2);
        cx.Y = Result.Top + ((Result.Bottom - Result.Top) / 2);
        this.GetCanvas().Transform(Math.cos(ar),Math.sin(ar),-Math.sin(ar),Math.cos(ar),cx.X,cx.Y);
        w = Result.Right - Result.Left;
        h = Result.Bottom - Result.Top;
        c = Math.cos(ar);
        s = Math.sin(ar);
        cw = Math.abs(w * c) + Math.abs(h * s);
        ch = Math.abs(w * s) + Math.abs(h * c);
        Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(-cw / 2,-ch / 2,cw / 2,ch / 2));
      };
      return Result;
    };
    this.CreatePath = function () {
      var Result = null;
      Result = null;
      return Result;
    };
    this.GetMatrix = function () {
      var Result = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsMatrix.$new();
      Result.$assign(pas["WEBLib.TMSFNCGraphicsTypes"].MatrixIdentity());
      return Result;
    };
    this.Render = function () {
    };
    this.PathOpen = function (APath) {
    };
    this.PathMoveTo = function (APath, APoint) {
      this.GetCanvas().PathMoveTo$1(APoint.X,APoint.Y);
    };
    this.PathLineTo = function (APath, APoint) {
      this.GetCanvas().PathLineTo$1(APoint.X,APoint.Y);
    };
    this.PathClose = function (APath) {
      this.GetCanvas().PathClose();
    };
    this.ResetTransform = function () {
      this.GetCanvas().SetTransform(1,0,0,1,0,0);
    };
    this.ResetClip = function () {
      this.RestoreState(null);
    };
    this.ScaleTransform = function (AX, AY) {
      var m = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsMatrix.$new();
      m.$assign(pas["WEBLib.TMSFNCGraphicsTypes"].MatrixCreateScaling(AX,AY));
      this.GetCanvas().Transform(m.m11,m.m12,m.m21,m.m22,m.m31,m.m32);
    };
    this.RotateTransform = function (AAngle) {
      var m = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsMatrix.$new();
      m.$assign(pas["WEBLib.TMSFNCGraphicsTypes"].MatrixCreateRotation(pas.Math.DegToRad(AAngle)));
      this.GetCanvas().Transform(m.m11,m.m12,m.m21,m.m22,m.m31,m.m32);
    };
    this.TranslateTransform = function (AX, AY) {
      var m = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsMatrix.$new();
      m.$assign(pas["WEBLib.TMSFNCGraphicsTypes"].MatrixCreateTranslation(AX,AY));
      this.GetCanvas().Transform(m.m11,m.m12,m.m21,m.m22,m.m31,m.m32);
    };
    this.SetTextQuality = function (ATextQuality) {
    };
    this.SetAntiAliasing = function (AAntiAliasing) {
    };
    this.SetShowAcceleratorChar = function (AShowAcceleratorChar) {
    };
    this.SetSize = function (AWidth, AHeight) {
    };
    this.ResetTextAngle = function (AAngle) {
      if (AAngle !== 0) this.GetCanvas().SetTransform(1,0,0,1,0,0);
    };
    this.BeginScene = function () {
      var Result = false;
      Result = false;
      if (this.GetCanvas() != null) {
        this.GetCanvas().BeginScene();
        Result = true;
        this.GetCanvas().Clear();
      };
      return Result;
    };
    this.EndScene = function () {
      this.GetCanvas().EndScene();
    };
    this.BeginPrinting = function () {
      this.FPrinting = true;
    };
    this.EndPrinting = function () {
      if (this.FPrinting) this.FPrinting = false;
    };
    this.StartSpecialPen = function () {
      this.FOldPenStyle = this.GetCanvas().FPen.FStyle;
      this.FOldPenWidth = this.GetCanvas().FPen.FWidth;
      this.GetCanvas().FPen.FStyle = pas["WEBLib.Graphics"].TPenStyle.psDot;
      this.GetCanvas().FPen.FWidth = 1;
    };
    this.StopSpecialPen = function () {
      this.GetCanvas().FPen.FStyle = this.FOldPenStyle;
      this.GetCanvas().FPen.FWidth = this.FOldPenWidth;
    };
    this.RestoreState = function (AState) {
      if (AState != null) AState.FSaveDC = 0;
      this.GetCanvas().Restore();
      this.GetCanvas().Refresh();
    };
    this.SaveState = function (AState) {
      this.GetCanvas().Refresh();
      this.GetCanvas().Save();
    };
    this.SetMatrix = function (AMatrix) {
    };
    this.SetScale = function (AScale) {
    };
    this.SetFontSize = function (ASize) {
      this.GetCanvas().FFont.SetSize(ASize);
    };
    this.SetFontColor = function (AColor) {
      this.GetCanvas().FFont.SetColor(AColor);
    };
    this.SetFontName = function (AName) {
      this.GetCanvas().FFont.SetName(AName);
    };
    this.SetFont = function (AFont) {
      this.GetCanvas().FFont.Assign(AFont);
    };
    this.SetFontStyles = function (AStyle) {
      this.GetCanvas().FFont.SetStyle(rtl.refSet(AStyle));
    };
    this.SetFill = function (AFill) {
      this.GetCanvas().FBrush.FColor = AFill.FColor;
      this.GetCanvas().FBrush.FGradient = pas["WEBLib.Graphics"].TBrushGradient.bgNone;
      this.GetCanvas().FBrush.ClearGradient();
      var $tmp = AFill.FKind;
      if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid) {
        this.GetCanvas().FBrush.FStyle = pas["WEBLib.Graphics"].TBrushStyle.bsSolid}
       else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient) {
        this.GetCanvas().FBrush.ClearGradient();
        if ((AFill.FColorMirror !== -1) && (AFill.FColorMirrorTo !== -1)) {
          this.GetCanvas().FBrush.AddGradientColor(AFill.FColor,0);
          this.GetCanvas().FBrush.AddGradientColor(AFill.FColorTo,0.5);
          this.GetCanvas().FBrush.AddGradientColor(AFill.FColorMirror,0.5);
          this.GetCanvas().FBrush.AddGradientColor(AFill.FColorMirrorTo,1);
        } else {
          this.GetCanvas().FBrush.AddGradientColor(AFill.FColor,0);
          this.GetCanvas().FBrush.AddGradientColor(AFill.FColorTo,1);
        };
        var $tmp1 = AFill.FOrientation;
        if ($tmp1 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillOrientation.gfoHorizontal) {
          this.GetCanvas().FBrush.FGradient = pas["WEBLib.Graphics"].TBrushGradient.bgLinearHorz}
         else if ($tmp1 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillOrientation.gfoVertical) this.GetCanvas().FBrush.FGradient = pas["WEBLib.Graphics"].TBrushGradient.bgLinearVert;
      } else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone) this.GetCanvas().FBrush.FStyle = pas["WEBLib.Graphics"].TBrushStyle.bsClear;
    };
    this.SetFillKind = function (AKind) {
      var $tmp = AKind;
      if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone) {
        this.GetCanvas().FBrush.FStyle = pas["WEBLib.Graphics"].TBrushStyle.bsClear}
       else if (($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid) || ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient)) this.GetCanvas().FBrush.FStyle = pas["WEBLib.Graphics"].TBrushStyle.bsSolid;
    };
    this.SetFillColor = function (AColor) {
      this.GetCanvas().FBrush.FColor = AColor;
    };
    this.SetStroke = function (AStroke) {
      this.GetCanvas().FPen.SetColor(AStroke.FColor);
      this.GetCanvas().FPen.FWidth = Math.round(AStroke.FWidth);
      var $tmp = AStroke.FKind;
      if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid) {
        this.GetCanvas().FPen.FStyle = pas["WEBLib.Graphics"].TPenStyle.psSolid}
       else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone) {
        this.GetCanvas().FPen.FStyle = pas["WEBLib.Graphics"].TPenStyle.psClear}
       else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskDash) {
        this.GetCanvas().FPen.FStyle = pas["WEBLib.Graphics"].TPenStyle.psDash}
       else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskDot) {
        this.GetCanvas().FPen.FStyle = pas["WEBLib.Graphics"].TPenStyle.psDot}
       else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskDashDot) {
        this.GetCanvas().FPen.FStyle = pas["WEBLib.Graphics"].TPenStyle.psDashDot}
       else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskDashDotDot) this.GetCanvas().FPen.FStyle = pas["WEBLib.Graphics"].TPenStyle.psDashDotDot;
    };
    this.SetStrokeKind = function (AKind) {
      var $tmp = AKind;
      if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone) {
        this.GetCanvas().FPen.FStyle = pas["WEBLib.Graphics"].TPenStyle.psClear}
       else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid) {
        this.GetCanvas().FPen.FStyle = pas["WEBLib.Graphics"].TPenStyle.psSolid}
       else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskDash) {
        this.GetCanvas().FPen.FStyle = pas["WEBLib.Graphics"].TPenStyle.psDash}
       else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskDot) {
        this.GetCanvas().FPen.FStyle = pas["WEBLib.Graphics"].TPenStyle.psDot}
       else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskDashDot) {
        this.GetCanvas().FPen.FStyle = pas["WEBLib.Graphics"].TPenStyle.psDashDot}
       else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskDashDotDot) this.GetCanvas().FPen.FStyle = pas["WEBLib.Graphics"].TPenStyle.psDashDotDot;
    };
    this.SetStrokeColor = function (AColor) {
      this.GetCanvas().FPen.SetColor(AColor);
    };
    this.SetStrokeWidth = function (AWidth) {
      this.GetCanvas().FPen.FWidth = Math.round(AWidth);
    };
    this.DrawLine = function (AStroke, AFromPoint, AToPoint, AModifyPointModeFrom, AModifyPointModeTo) {
      this.GetCanvas().MoveTo$1(AFromPoint.X,AFromPoint.Y);
      this.GetCanvas().LineTo$1(AToPoint.X,AToPoint.Y);
    };
    this.DrawPolygon = function (AStroke, APolygon) {
      var pts = [];
      var I = 0;
      var bs = 0;
      var c = 0;
      pts = rtl.arraySetLength(pts,pas["WEBLib.Graphics"].TCanvasPointF,rtl.length(APolygon));
      for (var $l = 0, $end = rtl.length(APolygon) - 1; $l <= $end; $l++) {
        I = $l;
        pts[I].$assign(pas["WEBLib.Graphics"].CreateCanvasPointF(APolygon[I].X,APolygon[I].Y));
      };
      c = this.GetCanvas().FBrush.FColor;
      bs = this.GetCanvas().FBrush.FStyle;
      this.GetCanvas().FBrush.FStyle = pas["WEBLib.Graphics"].TBrushStyle.bsClear;
      this.GetCanvas().Polygon$1(pts);
      this.GetCanvas().FBrush.FStyle = bs;
      this.GetCanvas().FBrush.FColor = c;
    };
    this.FillPolygon = function (AFill, APolygon) {
      var pts = [];
      var I = 0;
      var ps = 0;
      pts = rtl.arraySetLength(pts,pas["WEBLib.Graphics"].TCanvasPointF,rtl.length(APolygon));
      for (var $l = 0, $end = rtl.length(APolygon) - 1; $l <= $end; $l++) {
        I = $l;
        pts[I].$assign(pas["WEBLib.Graphics"].CreateCanvasPointF(APolygon[I].X,APolygon[I].Y));
      };
      ps = this.GetCanvas().FPen.FStyle;
      this.GetCanvas().FPen.FStyle = pas["WEBLib.Graphics"].TPenStyle.psClear;
      this.GetCanvas().Polygon$1(pts);
      this.GetCanvas().FPen.FStyle = ps;
    };
    this.DrawPolyline = function (AStroke, APolyline) {
      var I = 0;
      var pts = [];
      var bs = 0;
      var c = 0;
      pts = rtl.arraySetLength(pts,pas["WEBLib.Graphics"].TCanvasPointF,rtl.length(APolyline));
      for (var $l = 0, $end = rtl.length(APolyline) - 1; $l <= $end; $l++) {
        I = $l;
        pts[I].$assign(pas["WEBLib.Graphics"].CreateCanvasPointF(APolyline[I].X,APolyline[I].Y));
      };
      c = this.GetCanvas().FBrush.FColor;
      bs = this.GetCanvas().FBrush.FStyle;
      this.GetCanvas().FBrush.FStyle = pas["WEBLib.Graphics"].TBrushStyle.bsClear;
      this.GetCanvas().Polyline$1(pts);
      this.GetCanvas().FBrush.FStyle = bs;
      this.GetCanvas().FBrush.FColor = c;
    };
    this.FillPolyline = function (AFill, APolyline) {
      var pts = [];
      var I = 0;
      var ps = 0;
      pts = rtl.arraySetLength(pts,pas["WEBLib.Graphics"].TCanvasPointF,rtl.length(APolyline));
      for (var $l = 0, $end = rtl.length(APolyline) - 1; $l <= $end; $l++) {
        I = $l;
        pts[I].$assign(pas["WEBLib.Graphics"].CreateCanvasPointF(APolyline[I].X,APolyline[I].Y));
      };
      ps = this.GetCanvas().FPen.FStyle;
      this.GetCanvas().FPen.FStyle = pas["WEBLib.Graphics"].TPenStyle.psClear;
      this.GetCanvas().Polyline$1(pts);
      this.GetCanvas().FPen.FStyle = ps;
    };
    this.FillArc = function (AFill, ACenter, ARadius, AStartAngle, ASweepAngle) {
      var ps = 0;
      ps = this.GetCanvas().FPen.FStyle;
      this.GetCanvas().FPen.FStyle = pas["WEBLib.Graphics"].TPenStyle.psClear;
      this.GetCanvas().AngleArc$1(ACenter.X,ACenter.Y,ARadius.X,pas.Math.DegToRad(AStartAngle),pas.Math.DegToRad(ASweepAngle));
      this.GetCanvas().FPen.FStyle = ps;
    };
    this.DrawArc = function (AStroke, ACenter, ARadius, AStartAngle, ASweepAngle) {
      var bs = 0;
      var c = 0;
      c = this.GetCanvas().FBrush.FColor;
      bs = this.GetCanvas().FBrush.FStyle;
      this.GetCanvas().FBrush.FStyle = pas["WEBLib.Graphics"].TBrushStyle.bsClear;
      this.GetCanvas().AngleArc$1(ACenter.X,ACenter.Y,ARadius.X,pas.Math.DegToRad(AStartAngle),pas.Math.DegToRad(ASweepAngle));
      this.GetCanvas().FBrush.FStyle = bs;
      this.GetCanvas().FBrush.FColor = c;
    };
    this.FillRect = function (AFill, ARect, AModifyRectMode) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var c = 0;
      var bs = 0;
      var ps = 0;
      ARect.$assign(pas["WEBLib.TMSFNCGraphicsTypes"].ModifyRect(ARect,AModifyRectMode));
      r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARect.Left,ARect.Top,ARect.Right,ARect.Bottom));
      c = -1;
      bs = pas["WEBLib.Graphics"].TBrushStyle.bsClear;
      if (AFill.FKind === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient) {
        if ((AFill.FColor !== -1) && (AFill.FColorTo !== -1)) {
          if ((AFill.FColorMirror !== -1) && (AFill.FColorMirrorTo !== -1)) {
            var $tmp = AFill.FOrientation;
            if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillOrientation.gfoHorizontal) {
              pas["WEBLib.TMSFNCGraphicsTypes"].DrawGradient(this.GetCanvas(),AFill.FColor,AFill.FColorTo,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top,r.Left + ((r.Right - r.Left) / 2),r.Bottom)),0,{},true);
              pas["WEBLib.TMSFNCGraphicsTypes"].DrawGradient(this.GetCanvas(),AFill.FColorMirror,AFill.FColorMirrorTo,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + ((r.Right - r.Left) / 2),r.Top,r.Right,r.Bottom)),0,{},true);
            } else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillOrientation.gfoVertical) {
              pas["WEBLib.TMSFNCGraphicsTypes"].DrawGradient(this.GetCanvas(),AFill.FColor,AFill.FColorTo,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top,r.Right,r.Top + ((r.Bottom - r.Top) / 2))),0,{},false);
              pas["WEBLib.TMSFNCGraphicsTypes"].DrawGradient(this.GetCanvas(),AFill.FColorMirror,AFill.FColorMirrorTo,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top + ((r.Bottom - r.Top) / 2),r.Right,r.Bottom)),0,{},false);
            };
          } else pas["WEBLib.TMSFNCGraphicsTypes"].DrawGradient(this.GetCanvas(),AFill.FColor,AFill.FColorTo,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),0,{},AFill.FOrientation === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillOrientation.gfoHorizontal);
        };
        c = this.GetCanvas().FBrush.FColor;
        bs = this.GetCanvas().FBrush.FStyle;
        this.GetCanvas().FBrush.FStyle = pas["WEBLib.Graphics"].TBrushStyle.bsClear;
      };
      ps = this.GetCanvas().FPen.FStyle;
      this.GetCanvas().FPen.FStyle = pas["WEBLib.Graphics"].TPenStyle.psClear;
      if ((AFill.FColor !== -1) && (AFill.FKind === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid)) {
        this.GetCanvas().Rectangle$3(pas["WEBLib.Graphics"].CreateCanvasRectF(r.Left,r.Top,r.Right,r.Bottom));
      };
      this.GetCanvas().FPen.FStyle = ps;
      if (AFill.FKind === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient) {
        this.GetCanvas().FBrush.FColor = c;
        this.GetCanvas().FBrush.FStyle = bs;
      };
    };
    this.DrawRect = function (AStroke, ARect, ASides, AModifyRectMode) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      ARect.$assign(pas["WEBLib.TMSFNCGraphicsTypes"].ModifyRect(ARect,AModifyRectMode));
      r.$assign(ARect);
      if (pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsTop in ASides) this.DrawLine(AStroke,pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Top)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
      if (pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsLeft in ASides) this.DrawLine(AStroke,pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Bottom)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
      if (pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsBottom in ASides) this.DrawLine(AStroke,pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Bottom)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Bottom)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
      if (pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsRight in ASides) this.DrawLine(AStroke,pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Bottom)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
    };
    this.FillRoundRect = function (AFill, ARect, ARounding, ACorners, AModifyRectMode) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rg = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var c = {};
      ARect.$assign(pas["WEBLib.TMSFNCGraphicsTypes"].ModifyRect(ARect,AModifyRectMode));
      r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARect.Left,ARect.Top,ARect.Right,ARect.Bottom));
      rg.$assign(r);
      rg.Bottom = rg.Bottom - 1;
      rg.Right = rg.Right - 1;
      if (AFill.FKind === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient) {
        if ((AFill.FColor !== -1) && (AFill.FColorTo !== -1)) {
          if ((AFill.FColorMirror !== -1) && (AFill.FColorMirrorTo !== -1)) {
            var $tmp = AFill.FOrientation;
            if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillOrientation.gfoHorizontal) {
              c = {};
              if (pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopLeft in ACorners) c = rtl.unionSet(c,rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopLeft));
              if (pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft in ACorners) c = rtl.unionSet(c,rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft));
              pas["WEBLib.TMSFNCGraphicsTypes"].DrawGradient(this.GetCanvas(),AFill.FColor,AFill.FColorTo,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(rg.Left,rg.Top,rg.Left + ((rg.Right - rg.Left) / 2),r.Bottom)),ARounding,rtl.refSet(c),true);
              c = {};
              if (pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight in ACorners) c = rtl.unionSet(c,rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight));
              if (pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight in ACorners) c = rtl.unionSet(c,rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight));
              pas["WEBLib.TMSFNCGraphicsTypes"].DrawGradient(this.GetCanvas(),AFill.FColorMirror,AFill.FColorMirrorTo,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(rg.Left + ((rg.Right - r.Left) / 2),rg.Top,rg.Right,rg.Bottom)),ARounding,rtl.refSet(c),true);
            } else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillOrientation.gfoVertical) {
              c = {};
              if (pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopLeft in ACorners) c = rtl.unionSet(c,rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopLeft));
              if (pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight in ACorners) c = rtl.unionSet(c,rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight));
              pas["WEBLib.TMSFNCGraphicsTypes"].DrawGradient(this.GetCanvas(),AFill.FColor,AFill.FColorTo,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(rg.Left,rg.Top,rg.Right,rg.Top + ((rg.Bottom - rg.Top) / 2))),ARounding,rtl.refSet(c),false);
              c = {};
              if (pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft in ACorners) c = rtl.unionSet(c,rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft));
              if (pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight in ACorners) c = rtl.unionSet(c,rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight));
              pas["WEBLib.TMSFNCGraphicsTypes"].DrawGradient(this.GetCanvas(),AFill.FColorMirror,AFill.FColorMirrorTo,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(rg.Left,rg.Top + ((rg.Bottom - rg.Top) / 2),rg.Right,rg.Bottom)),ARounding,rtl.refSet(c),false);
            };
          } else pas["WEBLib.TMSFNCGraphicsTypes"].DrawGradient(this.GetCanvas(),AFill.FColor,AFill.FColorTo,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rg),ARounding,rtl.refSet(ACorners),AFill.FOrientation === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillOrientation.gfoHorizontal);
        };
      } else if ((AFill.FColor !== -1) && (AFill.FKind === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid)) pas["WEBLib.TMSFNCGraphicsTypes"].DrawGradient(this.GetCanvas(),AFill.FColor,AFill.FColor,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),ARounding,rtl.refSet(ACorners),AFill.FOrientation === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillOrientation.gfoHorizontal);
    };
    this.DrawRoundRect = function (AStroke, ARect, ARounding, ACorners, AModifyRectMode) {
      var $Self = this;
      var r = pas["WEBLib.Graphics"].TCanvasRectF.$new();
      var rg = pas["WEBLib.Graphics"].TCanvasRectF.$new();
      var rc = 0.0;
      var cl = 0;
      var bs = 0;
      function CanvasArc(ACanvas, Center, Radius, StartAngle, SweepAngle) {
        ACanvas.AngleArc$1(Center.X,Center.Y,Radius.X,pas.Math.DegToRad(StartAngle),pas.Math.DegToRad(SweepAngle));
      };
      ARect.$assign(pas["WEBLib.TMSFNCGraphicsTypes"].ModifyRect(ARect,AModifyRectMode));
      r.$assign(pas["WEBLib.Graphics"].CreateCanvasRectF(ARect.Left,ARect.Top,ARect.Right,ARect.Bottom));
      rg.$assign(r);
      rg.Bottom = rg.Bottom - 1;
      rg.Right = rg.Right - 1;
      cl = this.GetCanvas().FBrush.FColor;
      bs = this.GetCanvas().FBrush.FStyle;
      this.GetCanvas().FBrush.FStyle = pas["WEBLib.Graphics"].TBrushStyle.bsClear;
      rc = Math.round(ARounding);
      if (rtl.eqSet(ACorners,rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight))) {
        this.GetCanvas().RoundRect$3(r,rc * 2,rc * 2)}
       else if (rtl.eqSet(ACorners,{})) {
        this.GetCanvas().Rectangle$3(r)}
       else {
        if (pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft in ACorners) {
          this.GetCanvas().MoveTo$1(r.Left + rc,r.Bottom);
          CanvasArc(this.GetCanvas(),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + rc,r.Bottom - rc)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(rc,rc)),-270,90);
          this.GetCanvas().MoveTo$1(r.Left,r.Bottom - rc);
        } else {
          this.GetCanvas().MoveTo$1(r.Left,r.Bottom);
        };
        if (pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopLeft in ACorners) {
          this.GetCanvas().LineTo$1(r.Left,r.Top + rc);
          CanvasArc(this.GetCanvas(),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + rc,r.Top + rc)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(rc,rc)),-180,90);
          this.GetCanvas().MoveTo$1(r.Left + rc,r.Top);
        } else this.GetCanvas().LineTo$1(r.Left,r.Top);
        if (pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight in ACorners) {
          this.GetCanvas().LineTo$1(r.Right - rc,r.Top);
          CanvasArc(this.GetCanvas(),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - rc,r.Top + rc)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(rc,rc)),-90,90);
          this.GetCanvas().MoveTo$1(r.Right,r.Top + rc);
        } else this.GetCanvas().LineTo$1(r.Right,r.Top);
        if (pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight in ACorners) {
          this.GetCanvas().LineTo$1(r.Right,r.Bottom - rc);
          CanvasArc(this.GetCanvas(),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - rc,r.Bottom - rc)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(rc,rc)),0,90);
          this.GetCanvas().MoveTo$1(r.Right - rc,r.Bottom);
        } else {
          this.GetCanvas().LineTo$1(r.Right,r.Bottom);
        };
        if (pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft in ACorners) {
          this.GetCanvas().LineTo$1(r.Left + rc,r.Bottom);
        } else this.GetCanvas().LineTo$1(r.Left,r.Bottom);
      };
      this.GetCanvas().FBrush.FColor = cl;
      this.GetCanvas().FBrush.FStyle = bs;
    };
    this.FillEllipse = function (AFill, ARect, AModifyRectMode) {
      var r = pas["WEBLib.Graphics"].TCanvasRectF.$new();
      var ps = 0;
      ARect.$assign(pas["WEBLib.TMSFNCGraphicsTypes"].ModifyRect(ARect,AModifyRectMode));
      r.$assign(pas["WEBLib.Graphics"].CreateCanvasRectF(ARect.Left,ARect.Top,ARect.Right,ARect.Bottom));
      ps = this.GetCanvas().FPen.FStyle;
      this.GetCanvas().FPen.FStyle = pas["WEBLib.Graphics"].TPenStyle.psClear;
      this.GetCanvas().Ellipse$3(r);
      this.GetCanvas().FPen.FStyle = ps;
    };
    this.DrawEllipse = function (AStroke, ARect, AModifyRectMode) {
      var r = pas["WEBLib.Graphics"].TCanvasRectF.$new();
      var bs = 0;
      var c = 0;
      ARect.$assign(pas["WEBLib.TMSFNCGraphicsTypes"].ModifyRect(ARect,AModifyRectMode));
      r.$assign(pas["WEBLib.Graphics"].CreateCanvasRectF(ARect.Left,ARect.Top,ARect.Right,ARect.Bottom));
      c = this.GetCanvas().FBrush.FColor;
      bs = this.GetCanvas().FBrush.FStyle;
      this.GetCanvas().FBrush.FStyle = pas["WEBLib.Graphics"].TBrushStyle.bsClear;
      this.GetCanvas().Ellipse$3(r);
      this.GetCanvas().FBrush.FStyle = bs;
      this.GetCanvas().FBrush.FColor = c;
    };
    this.DrawBitmap = function (ABitmap, ASrcRect, ADstRect, AOpacity) {
      this.GetCanvas().StretchDraw$1(pas["WEBLib.Graphics"].TCanvasRectF.$clone(pas["WEBLib.Graphics"].CreateCanvasRectF(ADstRect.Left,ADstRect.Top,ADstRect.Right,ADstRect.Bottom)),ABitmap);
    };
    this.ClipRect = function (ARect) {
      this.GetCanvas().SetClipRect(pas["WEBLib.Graphics"].CreateCanvasRectF(ARect.Left,ARect.Top,ARect.Right,ARect.Bottom));
    };
    this.ClipPath = function (APath) {
      if (APath != null) {
        this.GetCanvas().PathBegin();
        this.ConvertToPath(APath,0.25);
        this.GetCanvas().Clip();
      };
    };
    this.DrawFocusPath = function (AStroke, APath, AColor) {
      var bs = 0;
      var c = 0;
      c = this.GetCanvas().FBrush.FColor;
      bs = this.GetCanvas().FBrush.FStyle;
      this.GetCanvas().FBrush.FStyle = pas["WEBLib.Graphics"].TBrushStyle.bsClear;
      this.GetCanvas().FPen.SetColor(AColor);
      this.StartSpecialPen();
      this.DrawPath(AStroke,APath,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPathDrawMode.pdmPolygon);
      this.StopSpecialPen();
      this.GetCanvas().FBrush.FColor = c;
      this.GetCanvas().FBrush.FStyle = bs;
    };
    this.DrawFocusRectangle = function (AStroke, ARect, AColor, AModifyRectMode) {
      var r = pas["WEBLib.Graphics"].TCanvasRectF.$new();
      var c = 0;
      var bs = 0;
      ARect.$assign(pas["WEBLib.TMSFNCGraphicsTypes"].ModifyRect(ARect,AModifyRectMode));
      r.$assign(pas["WEBLib.Graphics"].CreateCanvasRectF(ARect.Left,ARect.Top,ARect.Right,ARect.Bottom));
      c = this.GetCanvas().FBrush.FColor;
      bs = this.GetCanvas().FBrush.FStyle;
      this.GetCanvas().FBrush.FStyle = pas["WEBLib.Graphics"].TBrushStyle.bsClear;
      this.GetCanvas().FPen.SetColor(AColor);
      this.StartSpecialPen();
      this.GetCanvas().Rectangle$3(r);
      this.StopSpecialPen();
      this.GetCanvas().FBrush.FColor = c;
      this.GetCanvas().FBrush.FStyle = bs;
    };
    this.DrawText = function (AText, ARect, AWordWrapping, AHorizontalAlign, AVerticalAlign, ATrimming, AAngle) {
      var rcalc = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rh = 0;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var st = null;
      var c = 0;
      var bs = 0;
      c = this.GetCanvas().FBrush.FColor;
      bs = this.GetCanvas().FBrush.FStyle;
      this.GetCanvas().FBrush.FStyle = pas["WEBLib.Graphics"].TBrushStyle.bsClear;
      r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARect.Left,ARect.Top,ARect.Right,ARect.Bottom));
      if (AWordWrapping) {
        var $tmp = AVerticalAlign;
        if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter) {
          rcalc.$assign(this.CalculateText(AText,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AWordWrapping));
          rh = Math.round(rcalc.Bottom - rcalc.Top);
          r.Top = r.Top + Math.max(0,(r.Bottom - r.Top - rh) / 2);
          r.Bottom = Math.max(0,Math.min(Math.round(ARect.Bottom),r.Top + rh));
        } else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaTrailing) {
          rcalc.$assign(this.CalculateText(AText,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AWordWrapping));
          rh = Math.round(rcalc.Bottom - rcalc.Top);
          r.Top = r.Bottom - rh;
          r.Bottom = r.Top + rh;
        };
      };
      if (AAngle !== 0) {
        this.DrawRotatedText(this.GetCanvas(),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),AText,AAngle,AHorizontalAlign,AVerticalAlign)}
       else {
        st = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSaveState.$create("Create$1");
        try {
          this.SaveState(st);
          this.ClipRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r));
          var $tmp1 = AHorizontalAlign;
          if ($tmp1 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading) {
            var $tmp2 = AVerticalAlign;
            if ($tmp2 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading) {
              this.GetCanvas().TextRect$1(pas["WEBLib.Graphics"].TCanvasRectF.$clone(pas["WEBLib.Graphics"].CreateCanvasRectF(r.Left,r.Top,r.Right,r.Bottom)),AText,AWordWrapping,false,pas.Classes.TAlignment.taLeftJustify,pas["WEBLib.Graphics"].TVerticalAlignment.taAlignTop)}
             else if ($tmp2 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter) {
              this.GetCanvas().TextRect$1(pas["WEBLib.Graphics"].TCanvasRectF.$clone(pas["WEBLib.Graphics"].CreateCanvasRectF(r.Left,r.Top,r.Right,r.Bottom)),AText,AWordWrapping,false,pas.Classes.TAlignment.taLeftJustify,pas["WEBLib.Graphics"].TVerticalAlignment.taVerticalCenter)}
             else if ($tmp2 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaTrailing) this.GetCanvas().TextRect$1(pas["WEBLib.Graphics"].TCanvasRectF.$clone(pas["WEBLib.Graphics"].CreateCanvasRectF(r.Left,r.Top,r.Right,r.Bottom)),AText,AWordWrapping,false,pas.Classes.TAlignment.taLeftJustify,pas["WEBLib.Graphics"].TVerticalAlignment.taAlignBottom);
          } else if ($tmp1 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter) {
            var $tmp3 = AVerticalAlign;
            if ($tmp3 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading) {
              this.GetCanvas().TextRect$1(pas["WEBLib.Graphics"].TCanvasRectF.$clone(pas["WEBLib.Graphics"].CreateCanvasRectF(r.Left,r.Top,r.Right,r.Bottom)),AText,AWordWrapping,false,pas.Classes.TAlignment.taCenter,pas["WEBLib.Graphics"].TVerticalAlignment.taAlignTop)}
             else if ($tmp3 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter) {
              this.GetCanvas().TextRect$1(pas["WEBLib.Graphics"].TCanvasRectF.$clone(pas["WEBLib.Graphics"].CreateCanvasRectF(r.Left,r.Top,r.Right,r.Bottom)),AText,AWordWrapping,false,pas.Classes.TAlignment.taCenter,pas["WEBLib.Graphics"].TVerticalAlignment.taVerticalCenter)}
             else if ($tmp3 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaTrailing) this.GetCanvas().TextRect$1(pas["WEBLib.Graphics"].TCanvasRectF.$clone(pas["WEBLib.Graphics"].CreateCanvasRectF(r.Left,r.Top,r.Right,r.Bottom)),AText,AWordWrapping,false,pas.Classes.TAlignment.taCenter,pas["WEBLib.Graphics"].TVerticalAlignment.taAlignBottom);
          } else if ($tmp1 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaTrailing) {
            var $tmp4 = AVerticalAlign;
            if ($tmp4 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading) {
              this.GetCanvas().TextRect$1(pas["WEBLib.Graphics"].TCanvasRectF.$clone(pas["WEBLib.Graphics"].CreateCanvasRectF(r.Left,r.Top,r.Right,r.Bottom)),AText,AWordWrapping,false,pas.Classes.TAlignment.taRightJustify,pas["WEBLib.Graphics"].TVerticalAlignment.taAlignTop)}
             else if ($tmp4 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter) {
              this.GetCanvas().TextRect$1(pas["WEBLib.Graphics"].TCanvasRectF.$clone(pas["WEBLib.Graphics"].CreateCanvasRectF(r.Left,r.Top,r.Right,r.Bottom)),AText,AWordWrapping,false,pas.Classes.TAlignment.taRightJustify,pas["WEBLib.Graphics"].TVerticalAlignment.taVerticalCenter)}
             else if ($tmp4 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaTrailing) this.GetCanvas().TextRect$1(pas["WEBLib.Graphics"].TCanvasRectF.$clone(pas["WEBLib.Graphics"].CreateCanvasRectF(r.Left,r.Top,r.Right,r.Bottom)),AText,AWordWrapping,false,pas.Classes.TAlignment.taRightJustify,pas["WEBLib.Graphics"].TVerticalAlignment.taAlignBottom);
          };
        } finally {
          this.RestoreState(st);
        };
      };
      this.GetCanvas().FBrush.FColor = c;
      this.GetCanvas().FBrush.FStyle = bs;
    };
    this.DrawPath = function (AStroke, APath, APathMode) {
      var p = [];
      if (APath != null) {
        if (APathMode === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPathDrawMode.pdmPath) {
          this.GetCanvas().PathBegin();
          this.ConvertToPath(APath,0.25);
          this.GetCanvas().PathStroke();
        } else {
          p = rtl.arraySetLength(p,pas["WEBLib.TMSFNCTypes"].TPointF,0);
          APath.FlattenToPolygon({get: function () {
              return p;
            }, set: function (v) {
              p = v;
            }},0.25);
          var $tmp = APathMode;
          if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPathDrawMode.pdmPolygon) {
            this.DrawPolygon(AStroke,rtl.arrayRef(p))}
           else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPathDrawMode.pdmPolyline) this.DrawPolyline(AStroke,rtl.arrayRef(p));
        };
      };
    };
    this.FillPath = function (AFill, APath, APathMode) {
      var p = [];
      if (APath != null) {
        if (APathMode === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPathDrawMode.pdmPath) {
          this.GetCanvas().PathBegin();
          this.ConvertToPath(APath,0.25);
          this.GetCanvas().PathFill();
        } else {
          p = rtl.arraySetLength(p,pas["WEBLib.TMSFNCTypes"].TPointF,0);
          APath.FlattenToPolygon({get: function () {
              return p;
            }, set: function (v) {
              p = v;
            }},0.25);
          var $tmp = APathMode;
          if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPathDrawMode.pdmPolygon) {
            this.FillPolygon(AFill,rtl.arrayRef(p))}
           else if (($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPathDrawMode.pdmPolyline) || ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPathDrawMode.pdmPath)) this.FillPolyline(AFill,rtl.arrayRef(p));
        };
      };
    };
  });
  this.GetNativeContextClass = function () {
    var Result = null;
    Result = $mod.TTMSFNCGraphicsContextGeneral;
    return Result;
  };
},["Math"]);
rtl.module("WEBLib.TMSFNCGraphics.WEB",["System","Classes","WEBLib.TMSFNCGraphicsTypes","WEBLib.TMSFNCUtils","Types","WEBLib.TMSFNCTypes","WEBLib.TMSFNCGraphics","WEBLib.Graphics"],function () {
  "use strict";
  var $mod = this;
  rtl.createClass(this,"TTMSFNCGraphicsContextWEB",pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphicsContext,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphicsContext.$init.call(this);
      this.FActivePath = null;
      this.FScale = 0.0;
      this.FNeedsRendering = false;
      this.FFont = null;
      this.FFill = null;
      this.FStroke = null;
      this.FContextSize = pas["WEBLib.TMSFNCTypes"].TSizeF.$new();
      this.FNCanvas = null;
      this.FBitmap = null;
    };
    this.$final = function () {
      this.FActivePath = undefined;
      this.FFont = undefined;
      this.FFill = undefined;
      this.FStroke = undefined;
      this.FContextSize = undefined;
      this.FBitmap = undefined;
      pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphicsContext.$final.call(this);
    };
    this.GetNativeCanvas = function () {
      var Result = null;
      Result = this.FNCanvas;
      return Result;
    };
    this.DestroyResources = function () {
      if (this.FNCanvas != null) {
        this.RestoreContext();
        this.FNCanvas = null;
      };
      if (this.FBitmap != null) {
        rtl.free(this,"FBitmap");
        this.FBitmap = null;
      };
    };
    this.DrawTextInternal = function (AText, ARect, AWordWrap, AHorizontalAlignment, ACalculate) {
      var $Self = this;
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var i = 0;
      var s = "";
      var sn = "";
      var l = 0;
      var w = 0.0;
      var mw = 0.0;
      var f = false;
      var tw = 0.0;
      var th = 0.0;
      var lcnt = 0;
      var rs = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var fws = 0.0;
      function ApplyFont() {
      };
      function FindNextWord(AText, APos) {
        var Result = "";
        var l = 0;
        var i = 0;
        Result = "";
        l = AText.length;
        if (APos.get() > l) return Result;
        i = APos.get();
        while (true) {
          if (((AText.charAt(i - 1) === "\n") && (AText.charAt(i - 1 - 1) === "\r")) || ((AText.charAt(i - 1) === "\r") && (AText.charAt(i - 1 - 1) === "\n")) || (AText.charAt(i - 1) === " ")) {
            if (AText.charAt(i - 1) === " ") {
              Result = pas.System.Copy(AText,APos.get(),i - (APos.get() - 1))}
             else Result = pas.System.Copy(AText,APos.get(),i - APos.get());
            break;
          } else if ((AText.charAt(i - 1) === "\n") || (AText.charAt(i - 1) === "\r") || (AText.charAt(i - 1) === " ")) {
            Result = pas.System.Copy(AText,APos.get(),i - (APos.get() - 1));
            break;
          } else if (i >= l) {
            Result = pas.System.Copy(AText,APos.get(),i - (APos.get() - 1));
            break;
          } else i += 1;
        };
        APos.set(i + 1);
        return Result;
      };
      ApplyFont();
      if (!AWordWrap) {
        if (!ACalculate) ;
      } else {
        rs.$assign(ARect);
        mw = 0;
        i = 1;
        lcnt = 0;
        fws = 0;
        tw = 0;
        s = FindNextWord(AText,{get: function () {
            return i;
          }, set: function (v) {
            i = v;
          }});
        mw = mw + w;
        if ((s.length > 0) && (s.charAt(s.length - 1) === " ")) mw = mw + fws;
        while (i <= AText.length) {
          l = s.length;
          if ((l >= 2) && (((s.charAt(l - 1) === "\n") && (s.charAt(l - 1 - 1) === "\r")) || ((s.charAt(l - 1) === "\r") && (s.charAt(l - 1 - 1) === "\n")))) {
            s = pas.System.Copy(s,1,l - 2);
            f = true;
          } else if ((l >= 1) && ((s.charAt(l - 1) === "\n") || (s.charAt(l - 1) === "\r"))) {
            s = pas.System.Copy(s,1,l - 1);
            f = true;
          } else f = false;
          sn = FindNextWord(AText,{get: function () {
              return i;
            }, set: function (v) {
              i = v;
            }});
          if (((ARect.Left + mw + w) > ARect.Right) || f) {
            if (s !== "") {
              lcnt += 1;
              if (mw > tw) tw = mw;
              if (!ACalculate) ;
              mw = 0;
            };
            s = "";
            ARect.Top = ARect.Top + th;
            if ((pas.System.Trunc(ARect.Top) > pas.System.Trunc(ARect.Bottom - th)) && !ACalculate) break;
          };
          mw = mw + w;
          if ((sn.length > 0) && (sn.charAt(sn.length - 1) === " ")) mw = mw + fws;
          s = s + sn;
        };
        if (s !== "") {
          lcnt += 1;
          if (mw > tw) tw = mw;
          if (!ACalculate) ;
        };
        Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(rs.Left,rs.Top,rs.Left + tw,rs.Top + (lcnt * th)));
      };
      return Result;
    };
    this.DrawLinearGradient = function (ARect) {
      if (!(this.FNCanvas != null)) return;
      var $tmp = this.FFill.FOrientation;
      if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillOrientation.gfoHorizontal) {}
      else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillOrientation.gfoVertical) ;
      if ((this.FFill.FColorTo !== -1) && (this.FFill.FColorMirror !== -1)) {}
      else if (this.FFill.FColorTo !== -1) ;
    };
    this.FontChanged = function (Sender) {
    };
    this.FillChanged = function (Sender) {
      if (!(this.FNCanvas != null)) return;
      this.ApplyFill();
    };
    this.StrokeChanged = function (Sender) {
      if (!(this.FNCanvas != null)) return;
      this.ApplyStroke();
    };
    this.RestoreContext = function () {
      if (!(this.FNCanvas != null)) return;
    };
    this.SaveContext = function () {
      if (!(this.FNCanvas != null)) return;
    };
    this.ApplyStroke = function () {
      if (!(this.FNCanvas != null)) return;
    };
    this.ApplyFill = function () {
      if (!(this.FNCanvas != null)) return;
      var $tmp = this.FFill.FKind;
      if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid) ;
    };
    this.Create$1 = function (AGraphics) {
      pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphicsContext.Create$1.apply(this,arguments);
      this.FScale = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetDPIScale(null,-1);
      this.FNeedsRendering = true;
      this.FContextSize.cx = 0;
      this.FContextSize.cy = 0;
      this.FFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FFont.FOnChanged = rtl.createCallback(this,"FontChanged");
      this.FStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,12632256,1.0]);
      this.FStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16777215,8421504,-1,-1]);
      this.FFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      return this;
    };
    this.Destroy = function () {
      this.Render();
      if (this.FFont != null) {
        rtl.free(this,"FFont");
        this.FFont = null;
      };
      if (this.FFill != null) {
        rtl.free(this,"FFill");
        this.FFill = null;
      };
      if (this.FStroke != null) {
        rtl.free(this,"FStroke");
        this.FStroke = null;
      };
      this.DestroyResources();
      pas.System.TObject.Destroy.call(this);
    };
    this.GetFillColor = function () {
      var Result = 0;
      Result = this.GetGraphics().FFill.FColor;
      return Result;
    };
    this.CalculateText = function (AText, ARect, AWordWrapping) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,0,0));
      if (!(this.FNCanvas != null)) return Result;
      this.SaveContext();
      Result.$assign(this.DrawTextInternal(AText,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AWordWrapping,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading,true));
      this.RestoreContext();
      return Result;
    };
    this.SetTextAngle = function (ARect, AAngle) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var ar = 0.0;
      var cx = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var w = 0.0;
      var h = 0.0;
      var c = 0.0;
      var s = 0.0;
      var cw = 0.0;
      var ch = 0.0;
      Result.$assign(ARect);
      if (!(this.FNCanvas != null)) return Result;
      if (AAngle !== 0) {
        ar = pas.Math.DegToRad(AAngle);
        cx.X = Result.Left + ((Result.Right - Result.Left) / 2);
        cx.Y = Result.Top + ((Result.Bottom - Result.Top) / 2);
        this.SaveContext();
        w = Result.Right - Result.Left;
        h = Result.Bottom - Result.Top;
        c = Math.cos(ar);
        s = Math.sin(ar);
        cw = Math.abs(w * c) + Math.abs(h * s);
        ch = Math.abs(w * s) + Math.abs(h * c);
        Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(-cw / 2,-ch / 2,cw / 2,ch / 2));
      };
      return Result;
    };
    this.CreatePath = function () {
      var Result = null;
      Result = null;
      return Result;
    };
    this.GetMatrix = function () {
      var Result = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsMatrix.$new();
      Result.$assign(pas["WEBLib.TMSFNCGraphicsTypes"].MatrixEmpty());
      return Result;
    };
    this.Render = function () {
      if (!this.FNeedsRendering) return;
      this.FNeedsRendering = false;
      this.DestroyResources();
    };
    this.PathOpen = function (APath) {
    };
    this.PathMoveTo = function (APath, APoint) {
    };
    this.PathLineTo = function (APath, APoint) {
    };
    this.PathClose = function (APath) {
    };
    this.ResetClip = function () {
      if (!(this.FNCanvas != null)) return;
      this.RestoreContext();
    };
    this.ResetTransform = function () {
      if (!(this.FNCanvas != null)) return;
      this.RestoreContext();
      this.SaveContext();
    };
    this.ScaleTransform = function (AX, AY) {
      if (!(this.FNCanvas != null)) return;
    };
    this.RotateTransform = function (AAngle) {
      if (!(this.FNCanvas != null)) return;
    };
    this.TranslateTransform = function (AX, AY) {
      if (!(this.FNCanvas != null)) return;
    };
    this.SetTextQuality = function (ATextQuality) {
    };
    this.SetAntiAliasing = function (AAntiAliasing) {
      if (!(this.FNCanvas != null)) return;
    };
    this.SetShowAcceleratorChar = function (AShowAcceleratorChar) {
    };
    this.SetSize = function (AWidth, AHeight) {
      this.FContextSize.cx = AWidth;
      this.FContextSize.cy = AHeight;
      this.DestroyResources();
      this.FBitmap = pas["WEBLib.Graphics"].TBitmap.$create("Create$3");
      this.ScaleTransform(this.FScale,this.FScale);
      this.SaveContext();
    };
    this.SetMatrix = function (AMatrix) {
    };
    this.SetScale = function (AScale) {
      this.FScale = AScale;
    };
    this.ResetTextAngle = function (AAngle) {
      if (!(this.FNCanvas != null)) return;
      if (AAngle !== 0) this.RestoreContext();
    };
    this.BeginScene = function () {
      var Result = false;
      Result = false;
      if (!(this.FNCanvas != null)) return Result;
      Result = true;
      return Result;
    };
    this.EndScene = function () {
      if (!(this.FNCanvas != null)) return;
      this.Render();
    };
    this.BeginPrinting = function () {
    };
    this.EndPrinting = function () {
    };
    this.StartSpecialPen = function () {
      if (!(this.FNCanvas != null)) return;
    };
    this.StopSpecialPen = function () {
      if (!(this.FNCanvas != null)) return;
    };
    this.RestoreState = function (AState) {
      if (!(this.FNCanvas != null)) return;
      this.RestoreContext();
    };
    this.SaveState = function (AState) {
      if (!(this.FNCanvas != null)) return;
      this.SaveContext();
    };
    this.SetFontSize = function (ASize) {
      if (!(this.FNCanvas != null)) return;
      this.FFont.SetSize(ASize);
    };
    this.SetFontColor = function (AColor) {
      if (!(this.FNCanvas != null)) return;
      this.FFont.SetColor(AColor);
    };
    this.SetFontName = function (AName) {
      if (!(this.FNCanvas != null)) return;
      this.FFont.SetName(AName);
    };
    this.SetFont = function (AFont) {
      if (!(this.FNCanvas != null)) return;
      this.FFont.AssignSource(AFont);
    };
    this.SetFontStyles = function (AStyle) {
      if (!(this.FNCanvas != null)) return;
      this.FFont.SetStyle(rtl.refSet(AStyle));
    };
    this.SetFill = function (AFill) {
      if (!(this.FNCanvas != null)) return;
      this.FFill.Assign(AFill);
    };
    this.SetFillKind = function (AKind) {
      if (!(this.FNCanvas != null)) return;
      this.FFill.SetKind(AKind);
    };
    this.SetFillColor = function (AColor) {
      if (!(this.FNCanvas != null)) return;
      this.FFill.SetColor(AColor);
    };
    this.SetStroke = function (AStroke) {
      if (!(this.FNCanvas != null)) return;
      this.FStroke.Assign(AStroke);
    };
    this.SetStrokeKind = function (AKind) {
      if (!(this.FNCanvas != null)) return;
      this.FStroke.SetKind(AKind);
    };
    this.SetStrokeColor = function (AColor) {
      if (!(this.FNCanvas != null)) return;
      this.FStroke.SetColor(AColor);
    };
    this.SetStrokeWidth = function (AWidth) {
      if (!(this.FNCanvas != null)) return;
      this.FStroke.SetWidth(AWidth);
    };
    this.DrawLine = function (AStroke, AFromPoint, AToPoint, AModifyPointModeFrom, AModifyPointModeTo) {
      if (!(this.FNCanvas != null)) return;
      this.SaveContext();
      this.RestoreContext();
    };
    this.DrawPolygon = function (AStroke, APolygon) {
      if (!(this.FNCanvas != null)) return;
      if (rtl.length(APolygon) === 0) return;
      this.SaveContext();
      this.ApplyStroke();
      this.RestoreContext();
    };
    this.FillPolygon = function (AFill, APolygon) {
      if (!(this.FNCanvas != null)) return;
      if (rtl.length(APolygon) === 0) return;
      this.SaveContext();
      var $tmp = AFill.FKind;
      if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid) {
        this.ApplyFill();
      } else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient) {
        if (this.FActivePath != null) this.DrawLinearGradient(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.FActivePath.GetBounds()));
      };
      this.RestoreContext();
    };
    this.DrawPolyline = function (AStroke, APolyline) {
      if (!(this.FNCanvas != null)) return;
      if (rtl.length(APolyline) === 0) return;
      this.SaveContext();
      this.ApplyStroke();
      this.RestoreContext();
    };
    this.FillPolyline = function (AFill, APolyline) {
      if (!(this.FNCanvas != null)) return;
      if (rtl.length(APolyline) === 0) return;
      this.SaveContext();
      var $tmp = AFill.FKind;
      if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid) {
        this.ApplyFill();
      } else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient) {
        if (this.FActivePath != null) this.DrawLinearGradient(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.FActivePath.GetBounds()));
      };
      this.RestoreContext();
    };
    this.FillArc = function (AFill, ACenter, ARadius, AStartAngle, ASweepAngle) {
      if (!(this.FNCanvas != null)) return;
      this.SaveContext();
      var $tmp = AFill.FKind;
      if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid) {
        this.ApplyFill();
      } else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient) {
        this.DrawLinearGradient(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(ACenter.X - ARadius.X,ACenter.Y - ARadius.Y,ACenter.X + ARadius.X,ACenter.Y + ARadius.Y)));
      };
      this.RestoreContext();
    };
    this.DrawArc = function (AStroke, ACenter, ARadius, AStartAngle, ASweepAngle) {
      if (!(this.FNCanvas != null)) return;
      this.SaveContext();
      this.ApplyStroke();
      this.RestoreContext();
    };
    this.FillRect = function (AFill, ARect, AModifyRectMode) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (!(this.FNCanvas != null)) return;
      r.$assign(ARect);
      this.SaveContext();
      var $tmp = AFill.FKind;
      if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid) {
        this.ApplyFill();
      } else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient) {
        this.DrawLinearGradient(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r));
      };
      this.RestoreContext();
    };
    this.DrawRect = function (AStroke, ARect, ASides, AModifyRectMode) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (!(this.FNCanvas != null)) return;
      r.$assign(ARect);
      if (pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsTop in ASides) this.DrawLine(AStroke,pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Top)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
      if (pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsLeft in ASides) this.DrawLine(AStroke,pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Bottom)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
      if (pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsBottom in ASides) this.DrawLine(AStroke,pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Bottom)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Bottom)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
      if (pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsRight in ASides) this.DrawLine(AStroke,pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Bottom)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
    };
    this.FillRoundRect = function (AFill, ARect, ARounding, ACorners, AModifyRectMode) {
      var pth = null;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rc = 0.0;
      r.$assign(ARect);
      rc = ARounding;
      pth = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPath.$create("Create$1");
      try {
        if (pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft in ACorners) {
          pth.MoveTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + rc,r.Bottom));
          pth.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + rc,r.Bottom - rc),pas["WEBLib.TMSFNCTypes"].PointF(rc,rc),-270,90);
          pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Bottom - rc));
        } else {
          pth.MoveTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Bottom));
        };
        if (pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopLeft in ACorners) {
          pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Top + rc));
          pth.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + rc,r.Top + rc),pas["WEBLib.TMSFNCTypes"].PointF(rc,rc),-180,90);
          pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + rc,r.Top));
        } else pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Top));
        if (pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight in ACorners) {
          pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - rc,r.Top));
          pth.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - rc,r.Top + rc),pas["WEBLib.TMSFNCTypes"].PointF(rc,rc),-90,90);
          pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Top + rc));
        } else pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Top));
        if (pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight in ACorners) {
          pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Bottom - rc));
          pth.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - rc,r.Bottom - rc),pas["WEBLib.TMSFNCTypes"].PointF(rc,rc),0,90);
          pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - rc,r.Bottom));
        } else pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Bottom));
        if (pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft in ACorners) {
          pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + rc,r.Bottom))}
         else pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Bottom));
        pth.ClosePath();
        this.FillPath(this.FFill,pth,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPathDrawMode.pdmPolygon);
      } finally {
        pth = rtl.freeLoc(pth);
      };
    };
    this.DrawRoundRect = function (AStroke, ARect, ARounding, ACorners, AModifyRectMode) {
      var pth = null;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rc = 0.0;
      r.$assign(ARect);
      rc = ARounding;
      pth = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPath.$create("Create$1");
      try {
        if (pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft in ACorners) {
          pth.MoveTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + rc,r.Bottom));
          pth.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + rc,r.Bottom - rc),pas["WEBLib.TMSFNCTypes"].PointF(rc,rc),-270,90);
          pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Bottom - rc));
        } else {
          pth.MoveTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Bottom));
        };
        if (pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopLeft in ACorners) {
          pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Top + rc));
          pth.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + rc,r.Top + rc),pas["WEBLib.TMSFNCTypes"].PointF(rc,rc),-180,90);
          pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + rc,r.Top));
        } else pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Top));
        if (pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight in ACorners) {
          pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - rc,r.Top));
          pth.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - rc,r.Top + rc),pas["WEBLib.TMSFNCTypes"].PointF(rc,rc),-90,90);
          pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Top + rc));
        } else pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Top));
        if (pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight in ACorners) {
          pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Bottom - rc));
          pth.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - rc,r.Bottom - rc),pas["WEBLib.TMSFNCTypes"].PointF(rc,rc),0,90);
          pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - rc,r.Bottom));
        } else pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Bottom));
        if (pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft in ACorners) {
          pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + rc,r.Bottom))}
         else pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Bottom));
        pth.ClosePath();
        this.DrawPath(this.FStroke,pth,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPathDrawMode.pdmPolygon);
      } finally {
        pth = rtl.freeLoc(pth);
      };
    };
    this.FillEllipse = function (AFill, ARect, AModifyRectMode) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (!(this.FNCanvas != null)) return;
      r.$assign(ARect);
      this.SaveContext();
      var $tmp = AFill.FKind;
      if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid) {
        this.ApplyFill();
      } else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient) {
        this.DrawLinearGradient(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r));
      };
      this.RestoreContext();
    };
    this.DrawEllipse = function (AStroke, ARect, AModifyRectMode) {
      if (!(this.FNCanvas != null)) return;
      this.SaveContext();
      this.ApplyStroke();
      this.RestoreContext();
    };
    this.DrawBitmap = function (ABitmap, ASrcRect, ADstRect, AOpacity) {
      if (!(ABitmap != null) || !(this.FNCanvas != null)) return;
      this.SaveContext();
      try {} finally {
      };
      this.RestoreContext();
    };
    this.ClipRect = function (ARect) {
      if (!(this.FNCanvas != null)) return;
      this.SaveContext();
    };
    this.ClipPath = function (APath) {
      if (!(this.FNCanvas != null)) return;
      try {
        this.SaveContext();
      } finally {
      };
    };
    this.DrawFocusPath = function (AStroke, APath, AColor) {
      if (!(this.FNCanvas != null)) return;
    };
    this.DrawFocusRectangle = function (AStroke, ARect, AColor, AModifyRectMode) {
      if (!(this.FNCanvas != null)) return;
    };
    this.DrawText = function (AText, ARect, AWordWrapping, AHorizontalAlign, AVerticalAlign, ATrimming, AAngle) {
      var R = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (!(this.FNCanvas != null)) return;
      this.SaveContext();
      R.$assign(this.DrawTextInternal(AText,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AWordWrapping,AHorizontalAlign,true));
      var $tmp = AVerticalAlign;
      if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter) {
        this.DrawTextInternal(AText,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(ARect.Left,ARect.Top + ((ARect.Bottom - ARect.Top - (R.Bottom - R.Top)) / 2),ARect.Right,ARect.Top + ((ARect.Bottom - ARect.Top - (R.Bottom - R.Top)) / 2) + (R.Bottom - R.Top))),AWordWrapping,AHorizontalAlign,false)}
       else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading) {
        this.DrawTextInternal(AText,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(ARect.Left,ARect.Top,ARect.Right,ARect.Top + (R.Bottom - R.Top))),AWordWrapping,AHorizontalAlign,false)}
       else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaTrailing) this.DrawTextInternal(AText,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(ARect.Left,ARect.Bottom - (R.Bottom - R.Top),ARect.Right,ARect.Bottom)),AWordWrapping,AHorizontalAlign,false);
      this.RestoreContext();
    };
    this.DrawPath = function (AStroke, APath, APathMode) {
      var p = [];
      if (APath != null) {
        this.FActivePath = APath;
        p = rtl.arraySetLength(p,pas["WEBLib.TMSFNCTypes"].TPointF,0);
        APath.FlattenToPolygon({get: function () {
            return p;
          }, set: function (v) {
            p = v;
          }},0.25);
        var $tmp = APathMode;
        if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPathDrawMode.pdmPolygon) {
          this.DrawPolygon(AStroke,rtl.arrayRef(p))}
         else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPathDrawMode.pdmPolyline) this.DrawPolyline(AStroke,rtl.arrayRef(p));
        this.FActivePath = null;
      };
    };
    this.FillPath = function (AFill, APath, APathMode) {
      var p = [];
      if (APath != null) {
        this.FActivePath = APath;
        p = rtl.arraySetLength(p,pas["WEBLib.TMSFNCTypes"].TPointF,0);
        APath.FlattenToPolygon({get: function () {
            return p;
          }, set: function (v) {
            p = v;
          }},0.25);
        var $tmp = APathMode;
        if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPathDrawMode.pdmPolygon) {
          this.FillPolygon(AFill,rtl.arrayRef(p))}
         else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPathDrawMode.pdmPolyline) this.FillPolyline(AFill,rtl.arrayRef(p));
        this.FActivePath = null;
      };
    };
  });
  this.GetNativeContextClass = function () {
    var Result = null;
    Result = $mod.TTMSFNCGraphicsContextWEB;
    return Result;
  };
},["SysUtils","Math"]);
rtl.module("WEBLib.TMSFNCGraphics",["System","Classes","WEBLib.TMSFNCGraphicsTypes","WEBLib.Graphics","JS","WEBLib.TMSFNCBitmapContainer","Types","WEBLib.TMSFNCTypes"],function () {
  "use strict";
  var $mod = this;
  this.$rtti.$Class("TTMSFNCGraphics");
  rtl.createClass(this,"TTMSFNCGraphicsContext",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FGraphics = null;
    };
    this.$final = function () {
      this.FGraphics = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.GetCanvas = function () {
      var Result = null;
      Result = null;
      if (this.GetGraphics() != null) Result = this.GetGraphics().GetCanvas();
      return Result;
    };
    this.GetGraphics = function () {
      var Result = null;
      Result = this.FGraphics;
      return Result;
    };
    this.Create$1 = function (AGraphics) {
      this.FGraphics = AGraphics;
      return this;
    };
    this.ConvertToPath = function (APath, Flatness) {
      var Result = null;
      var J = 0;
      var I = 0;
      var BPts = [];
      var B = rtl.arraySetLength(null,pas["WEBLib.TMSFNCTypes"].TPointF,4);
      var F = 0.0;
      var Len = 0.0;
      var SegCount = 0;
      var CurPoint = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var x = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      Result = this.CreatePath();
      if (APath.GetCount() > 0) {
        F = Math.max(Flatness,0.05);
        J = 0;
        while (J < APath.GetCount()) {
          var $tmp = APath.GetPoint(J).Kind;
          if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPathPointKind.gppMoveTo) {
            this.PathOpen(Result);
            this.PathMoveTo(Result,pas["WEBLib.TMSFNCTypes"].TPointF.$clone(APath.GetPoint(J).Point));
            CurPoint.$assign(APath.GetPoint(J).Point);
          } else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPathPointKind.gppLineTo) {
            this.PathLineTo(Result,pas["WEBLib.TMSFNCTypes"].TPointF.$clone(APath.GetPoint(J).Point));
            CurPoint.$assign(APath.GetPoint(J).Point);
          } else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPathPointKind.gppCurveTo) {
            B[0].$assign(CurPoint);
            B[1].$assign(APath.GetPoint(J).Point);
            J += 1;
            B[2].$assign(APath.GetPoint(J).Point);
            J += 1;
            B[3].$assign(APath.GetPoint(J).Point);
            BPts = APath.CreateBezier(B,6);
            Len = 0;
            for (var $l = 0, $end = rtl.length(BPts) - 1 - 1; $l <= $end; $l++) {
              I = $l;
              x.X = BPts[I].X - BPts[I + 1].X;
              x.Y = BPts[I].Y - BPts[I + 1].Y;
              Len = Len + pas["WEBLib.TMSFNCTypes"].GetPointLength(x);
            };
            SegCount = Math.round(Len / F);
            if (SegCount < 2) {
              this.PathLineTo(Result,pas["WEBLib.TMSFNCTypes"].TPointF.$clone(B[3]))}
             else {
              BPts = APath.CreateBezier(B,SegCount);
              for (var $l1 = 0, $end1 = rtl.length(BPts) - 1; $l1 <= $end1; $l1++) {
                I = $l1;
                this.PathLineTo(Result,pas["WEBLib.TMSFNCTypes"].TPointF.$clone(BPts[I]));
              };
              CurPoint.$assign(APath.GetPoint(J).Point);
            };
          } else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPathPointKind.gppClose) this.PathClose(Result);
          J += 1;
        };
      };
      return Result;
    };
  });
  this.$rtti.$ClassRef("TTMSFNCGraphicsContextClass",{instancetype: this.$rtti["TTMSFNCGraphicsContext"]});
  rtl.createClass(this,"TTMSFNCGraphics",pas.System.TObject,function () {
    this.DefaultSelectionFillColor = 0;
    this.DefaultTextFontColor = 0;
    this.DefaultPopupFillColor = 0;
    this.DefaultPopupStrokeColor = 0;
    this.DefaultButtonStrokeColorFocused = 0;
    this.DefaultButtonFillColorFocused = 0;
    this.DefaultButtonStrokeColorDisabled = 0;
    this.DefaultButtonFillColorDisabled = 0;
    this.DefaultButtonStrokeColor = 0;
    this.DefaultButtonFillColor = 0;
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FSaveFont = null;
      this.FActiveCanvas = null;
      this.FBlockUpdate = 0;
      this.FNative = false;
      this.FContextNative = null;
      this.FContextGeneral = null;
      this.FBitmap = null;
      this.FFill = null;
      this.FStroke = null;
      this.FFont = null;
      this.FHighlightColor = 0;
      this.FOptimizedHTMLDrawing = false;
      this.FHighlightTextColor = 0;
      this.FHighlightFontStyles = {};
      this.FURLUnderline = false;
      this.FURLColor = 0;
      this.FBitmapContainer = null;
    };
    this.$final = function () {
      this.FSaveFont = undefined;
      this.FActiveCanvas = undefined;
      this.FContextNative = undefined;
      this.FContextGeneral = undefined;
      this.FBitmap = undefined;
      this.FFill = undefined;
      this.FStroke = undefined;
      this.FFont = undefined;
      this.FHighlightFontStyles = undefined;
      this.FBitmapContainer = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.GetCanvas = function () {
      var Result = null;
      Result = this.FActiveCanvas;
      return Result;
    };
    this.GetContext = function () {
      var Result = null;
      if (this.FNative) {
        Result = this.FContextNative}
       else Result = this.FContextGeneral;
      return Result;
    };
    this.FontChanged = function (Sender) {
      this.SetFont(rtl.as(Sender,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont));
    };
    this.FillChanged = function (Sender) {
      this.SetFill(rtl.as(Sender,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill));
    };
    this.StrokeChanged = function (Sender) {
      this.SetStroke(rtl.as(Sender,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke));
    };
    this.InitializeDefaultAppearance = function () {
      this.FURLColor = 16711680;
      this.FURLUnderline = true;
      this.SetFill(this.FFill);
      this.SetStroke(this.FStroke);
      this.SetFont(this.FFont);
    };
    this.InternalDrawBitmapPartSync = function (ASourceLeft, ASourceTop, ASourceRight, ASourceBottom, ADestinationLeft, ADestinationTop, ADestinationRight, ADestinationBottom, ABitmap, AAspectRatio, AStretch, ACenter, ACropping) {
      var $Self = this;
      var Result = null;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rs = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result = null;
      r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ADestinationLeft,ADestinationTop,ADestinationRight,ADestinationBottom));
      rs.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ASourceLeft,ASourceTop,ASourceRight,ASourceBottom));
      if (pas["WEBLib.TMSFNCTypes"].RectIsEmpty(r) || pas["WEBLib.TMSFNCTypes"].RectIsEmpty(rs)) return Result;
      if (!this.HasSVG(ABitmap)) {
        Result = new Promise(function (AResolve, AReject) {
          var bmp = null;
          var g = null;
          g = $mod.TTMSFNCGraphics.$create("CreateBitmapCanvas",[Math.round(ASourceRight - ASourceLeft),Math.round(ASourceBottom - ASourceTop),$Self.FNative,true]);
          try {
            g.BeginScene();
            g.DrawBitmap(-ASourceLeft,-ASourceTop,-ASourceLeft + g.FBitmap.GetWidth(),-ASourceTop + g.FBitmap.GetHeight(),ABitmap,false,false,false,false);
            g.EndScene();
            bmp = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
            bmp.Assign(g.FBitmap);
            AResolve(bmp);
          } finally {
            g = rtl.freeLoc(g);
          };
        });
      };
      return Result;
    };
    this.InternalCalculateText = function (AText, ARect, AWordWrapping, ASupportHTML) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var a = "";
      var s = "";
      var fa = "";
      var XSize = 0.0;
      var YSize = 0.0;
      var hl = 0;
      var ml = 0;
      var hr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var cr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var lc = 0;
      var AControlID = "";
      var AControlType = "";
      var AControlValue = "";
      Result.$assign(ARect);
      if (Math.round(Result.Right - Result.Left) <= 0) {
        Result.Bottom = Result.Top;
        return Result;
      };
      if (AText !== "") {
        if (ASupportHTML && ((pas.System.Pos("</",AText) > 0) || (pas.System.Pos("/>",AText) > 0) || (pas.System.Pos("<BR>",pas.SysUtils.UpperCase(AText)) > 0))) {
          hr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,0,0));
          XSize = 0;
          YSize = 0;
          hl = -1;
          ml = -1;
          fa = "";
          s = "";
          a = "";
          lc = 0;
          cr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,0,0));
          AControlID = "";
          AControlValue = "";
          AControlType = "";
          pas["WEBLib.TMSFNCHTMLEngine"].HTMLDrawEx$1(this,AText,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),0,0,-1,-1,0,false,true,false,false,false,false,AWordWrapping,false,"",1.0,this.FURLColor,-1,-1,-1,{get: function () {
              return a;
            }, set: function (v) {
              a = v;
            }},{get: function () {
              return s;
            }, set: function (v) {
              s = v;
            }},{get: function () {
              return fa;
            }, set: function (v) {
              fa = v;
            }},{get: function () {
              return XSize;
            }, set: function (v) {
              XSize = v;
            }},{get: function () {
              return YSize;
            }, set: function (v) {
              YSize = v;
            }},{get: function () {
              return hl;
            }, set: function (v) {
              hl = v;
            }},{get: function () {
              return ml;
            }, set: function (v) {
              ml = v;
            }},hr,cr,{get: function () {
              return AControlID;
            }, set: function (v) {
              AControlID = v;
            }},{get: function () {
              return AControlValue;
            }, set: function (v) {
              AControlValue = v;
            }},{get: function () {
              return AControlType;
            }, set: function (v) {
              AControlType = v;
            }},{get: function () {
              return lc;
            }, set: function (v) {
              lc = v;
            }},0,this.FBitmapContainer,1,this.FURLUnderline,this.FHighlightColor,this.FHighlightTextColor,rtl.refSet(this.FHighlightFontStyles));
          YSize = YSize + 1;
          Result.Right = Result.Left + XSize;
          Result.Bottom = Result.Top + YSize;
        } else {
          Result.$assign(this.GetContext().CalculateText(AText,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AWordWrapping));
          Result.Bottom = Result.Bottom + 1;
        };
      } else {
        Result.Right = Result.Left;
        Result.Bottom = Result.Top;
      };
      return Result;
    };
    this.InternalDrawText = function (ARect, AText, AControlID, AControlValue, AControlType, AWordWrapping, AHorizontalAlign, AVerticalAlign, ATrimming, AAngle, AMinWidth, AMinHeight, ASupportHTML, ATestAnchor, AX, AY) {
      var Result = "";
      var a = "";
      var s = "";
      var fa = "";
      var XSize = 0.0;
      var YSize = 0.0;
      var hl = 0;
      var ml = 0;
      var hr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var cr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var xs = 0.0;
      var ys = 0.0;
      var lc = 0;
      var htmlr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var isanchor = false;
      var st = null;
      var oldc = 0;
      oldc = this.GetContext().GetFillColor();
      this.GetContext().SetFillColor(this.FFont.FColor);
      if ((AMinHeight > -1) && ((ARect.Bottom - ARect.Top) < AMinHeight)) ARect.Bottom = ARect.Top + AMinHeight;
      if ((AMinWidth > -1) && ((ARect.Right - ARect.Left) < AMinWidth)) ARect.Right = ARect.Left + AMinWidth;
      ARect.$assign(this.GetContext().SetTextAngle(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AAngle));
      Result = "";
      if (((pas.System.Pos("</",AText) > 0) || (pas.System.Pos("/>",AText) > 0) || (pas.System.Pos("<BR>",pas.SysUtils.UpperCase(AText)) > 0)) && ASupportHTML) {
        hr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,0,0));
        XSize = 0;
        YSize = 0;
        hl = -1;
        ml = -1;
        fa = "";
        s = "";
        a = "";
        lc = 0;
        cr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,0,0));
        AControlID.set("");
        AControlValue.set("");
        AControlType.set("");
        pas["WEBLib.TMSFNCHTMLEngine"].HTMLDrawEx$1(this,AText,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),0,0,-1,-1,0,false,true,false,false,false,false,AWordWrapping,false,"",1.0,this.FURLColor,-1,-1,-1,{get: function () {
            return a;
          }, set: function (v) {
            a = v;
          }},{get: function () {
            return s;
          }, set: function (v) {
            s = v;
          }},{get: function () {
            return fa;
          }, set: function (v) {
            fa = v;
          }},{get: function () {
            return XSize;
          }, set: function (v) {
            XSize = v;
          }},{get: function () {
            return YSize;
          }, set: function (v) {
            YSize = v;
          }},{get: function () {
            return hl;
          }, set: function (v) {
            hl = v;
          }},{get: function () {
            return ml;
          }, set: function (v) {
            ml = v;
          }},hr,cr,AControlID,AControlValue,AControlType,{get: function () {
            return lc;
          }, set: function (v) {
            lc = v;
          }},0,this.FBitmapContainer,1,this.FURLUnderline,this.FHighlightColor,this.FHighlightTextColor,rtl.refSet(this.FHighlightFontStyles));
        YSize = YSize + 1;
        XSize = XSize + 1;
        if ((AWordWrapping && (lc <= 1)) || !AWordWrapping) {
          xs = ARect.Left;
          ys = ARect.Top;
          var $tmp = AHorizontalAlign;
          if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter) {
            xs = xs + ((ARect.Right - ARect.Left - XSize) / 2)}
           else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaTrailing) xs = (ARect.Left + (ARect.Right - ARect.Left)) - XSize;
          var $tmp1 = AVerticalAlign;
          if ($tmp1 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter) {
            ys = ys + ((ARect.Bottom - ARect.Top - YSize) / 2)}
           else if ($tmp1 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaTrailing) ys = (ys + (ARect.Bottom - ARect.Top)) - YSize;
          htmlr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(xs,ys,xs + XSize,ys + YSize));
        } else htmlr.$assign(ARect);
        st = this.SaveState(true);
        this.ClipRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect));
        isanchor = pas["WEBLib.TMSFNCHTMLEngine"].HTMLDrawEx$1(this,AText,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(htmlr),Math.round(AX),Math.round(AY),-1,-1,0,ATestAnchor,false,false,false,false,false,AWordWrapping,false,"",1.0,this.FURLColor,-1,-1,-1,{get: function () {
            return a;
          }, set: function (v) {
            a = v;
          }},{get: function () {
            return s;
          }, set: function (v) {
            s = v;
          }},{get: function () {
            return fa;
          }, set: function (v) {
            fa = v;
          }},{get: function () {
            return XSize;
          }, set: function (v) {
            XSize = v;
          }},{get: function () {
            return YSize;
          }, set: function (v) {
            YSize = v;
          }},{get: function () {
            return hl;
          }, set: function (v) {
            hl = v;
          }},{get: function () {
            return ml;
          }, set: function (v) {
            ml = v;
          }},hr,cr,AControlID,AControlValue,AControlType,{get: function () {
            return lc;
          }, set: function (v) {
            lc = v;
          }},0,this.FBitmapContainer,1,this.FURLUnderline,this.FHighlightColor,this.FHighlightTextColor,rtl.refSet(this.FHighlightFontStyles));
        this.RestoreState(st,true);
        if (isanchor) Result = a;
      } else if (!ATestAnchor) this.GetContext().DrawText(AText,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AWordWrapping,AHorizontalAlign,AVerticalAlign,ATrimming,AAngle);
      this.GetContext().ResetTextAngle(AAngle);
      this.GetContext().SetFillColor(oldc);
      return Result;
    };
    this.DrawTexture = function (ARect, ATexture, ATextureMode) {
      var LR = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var R = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var IR = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var I = 0;
      var J = 0;
      if (pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(ATexture)) return;
      LR.$assign(ARect);
      var $tmp = ATextureMode;
      if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextureMode.gtmOriginal) {
        R.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARect.Left,ARect.Top,ARect.Left + ATexture.GetWidth(),ARect.Top + ATexture.GetHeight()));
        pas["WEBLib.TMSFNCTypes"].IntersectRectEx$1(IR,LR,R);
        this.DrawBitmapPart$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,IR.Right - IR.Left,IR.Bottom - IR.Top)),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(R.Left,R.Top,R.Left + (IR.Right - IR.Left),R.Top + (IR.Bottom - IR.Top))),ATexture,false,false,false,false);
      } else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextureMode.gtmFit) {
        R.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,ATexture.GetWidth(),ATexture.GetHeight()));
        R.$assign(pas["WEBLib.TMSFNCTypes"].RectSnapToPixelEx(pas["WEBLib.TMSFNCTypes"].RectFitIntoEx$1(R,ARect),1,false));
        this.DrawBitmapPart$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,ATexture.GetWidth(),ATexture.GetHeight())),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(R),ATexture,false,true,false,false);
      } else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextureMode.gtmStretch) {
        this.DrawBitmapPart$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,ATexture.GetWidth(),ATexture.GetHeight())),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),ATexture,false,true,false,false)}
       else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextureMode.gtmTile) {
        for (var $l = 0, $end = pas.System.Trunc((LR.Right - LR.Left) / ATexture.GetWidth()) + 1; $l <= $end; $l++) {
          I = $l;
          for (var $l1 = 0, $end1 = pas.System.Trunc((LR.Bottom - LR.Top) / ATexture.GetHeight()) + 1; $l1 <= $end1; $l1++) {
            J = $l1;
            R.$assign(pas["WEBLib.TMSFNCTypes"].RectF(LR.Left,LR.Top,LR.Left + ATexture.GetWidth(),LR.Top + ATexture.GetHeight()));
            pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(R,I * ATexture.GetWidth(),J * ATexture.GetHeight());
            pas["WEBLib.TMSFNCTypes"].IntersectRectEx$1(IR,LR,R);
            if (pas["WEBLib.TMSFNCTypes"].IntersectRectEx(IR,R)) this.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(R.Left,R.Top,R.Left + (IR.Right - IR.Left),R.Top + (IR.Bottom - IR.Top))),ATexture,false,false,false,false);
          };
        };
      } else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextureMode.gtmCenter) {
        R.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,ATexture.GetWidth(),ATexture.GetHeight()));
        R.$assign(pas["WEBLib.TMSFNCTypes"].RectSnapToPixelEx(pas["WEBLib.TMSFNCTypes"].RectCenterAtEx(R,ARect),1,false));
        this.DrawBitmapPart$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,ATexture.GetWidth(),ATexture.GetHeight())),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(R),ATexture,true,false,true,false);
      };
    };
    this.DrawSVG = function (ABitmap, ARect) {
      var Result = false;
      Result = false;
      return Result;
    };
    this.HasSVG = function (ABitmap) {
      var Result = false;
      Result = false;
      return Result;
    };
    var TTMSFNCGraphicsColorToGrayscale = {"0": "ctgLightness", ctgLightness: 0, "1": "ctgAverage", ctgAverage: 1, "2": "ctgLuminosity", ctgLuminosity: 2};
    this.ConvertBitmapToGrayScale = function (ABitmap) {
      var $Self = this;
      function MinColor(A, B, C) {
        var Result = 0;
        Result = Math.min(A,Math.min(B,C));
        return Result;
      };
      function MaxColor(A, B, C) {
        var Result = 0;
        Result = Math.max(A,Math.max(B,C));
        return Result;
      };
      function ColorToGray(AColor, AMode) {
        var Result = 0;
        var R = 0;
        var G = 0;
        var B = 0;
        var X = 0;
        var A = 0;
        var $tmp = AMode;
        if ($tmp === TTMSFNCGraphicsColorToGrayscale.ctgLightness) {
          X = rtl.trunc((MaxColor(R,G,B) + MinColor(R,G,B)) / 2)}
         else if ($tmp === TTMSFNCGraphicsColorToGrayscale.ctgAverage) {
          X = rtl.trunc((R + G + B) / 3)}
         else if ($tmp === TTMSFNCGraphicsColorToGrayscale.ctgLuminosity) {
          X = Math.round((0.21 * R) + (0.71 * G) + (0.07 * B))}
         else {
          X = 0;
        };
        return Result;
      };
      var I = 0;
      var J = 0;
      if ((ABitmap != null) && !pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(ABitmap)) {
        for (var $l = 0, $end = ABitmap.GetWidth() - 1; $l <= $end; $l++) {
          I = $l;
          for (var $l1 = 0, $end1 = ABitmap.GetHeight() - 1; $l1 <= $end1; $l1++) {
            J = $l1;
          };
        };
      };
    };
    this.Create$1 = function (ACanvas, ANative) {
      this.FNative = ANative;
      this.FActiveCanvas = ACanvas;
      if (!ANative) {
        this.FContextGeneral = pas["WEBLib.TMSFNCGraphics.General"].TTMSFNCGraphicsContextGeneral.$create("Create$1",[this]);
        this.FContextGeneral.SetSize(1,1);
      } else {
        this.FContextNative = pas["WEBLib.TMSFNCGraphics.WEB"].GetNativeContextClass().$create("Create$1",[this]);
        this.FContextNative.SetSize(1,1);
      };
      this.FSaveFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      if (ACanvas != null) this.FSaveFont.Assign(ACanvas.FFont);
      this.FFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16777215,8421504,-1,-1]);
      this.FFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,12632256,1.0]);
      this.FStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FFont.FOnChanged = rtl.createCallback(this,"FontChanged");
      this.FHighlightColor = 16711680;
      this.FHighlightTextColor = 16777215;
      this.FHighlightFontStyles = {};
      this.InitializeDefaultAppearance();
      return this;
    };
    this.CreateNative = function (ACanvas) {
      this.Create$1(ACanvas,true);
      return this;
    };
    this.CreateBitmapCanvas = function (AWidth, AHeight, ANative, AHighDPI) {
      this.FNative = ANative;
      this.FBitmap = pas["WEBLib.Graphics"].TBitmap.$create("Create$3");
      this.FBitmap.SetWidth(AWidth);
      this.FBitmap.SetHeight(AHeight);
      this.FActiveCanvas = this.FBitmap.GetCanvas();
      if (!ANative) {
        this.FContextGeneral = pas["WEBLib.TMSFNCGraphics.General"].TTMSFNCGraphicsContextGeneral.$create("Create$1",[this]);
        this.FContextGeneral.SetSize(AWidth,AHeight);
      } else {
        this.FContextNative = pas["WEBLib.TMSFNCGraphics.WEB"].GetNativeContextClass().$create("Create$1",[this]);
        this.FContextNative.SetSize(AWidth,AHeight);
      };
      this.FFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16777215,8421504,-1,-1]);
      this.FFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,12632256,1.0]);
      this.FStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FFont.FOnChanged = rtl.createCallback(this,"FontChanged");
      this.InitializeDefaultAppearance();
      return this;
    };
    this.CreateNativeBitmapCanvas = function (AWidth, AHeight) {
      this.CreateBitmapCanvas(AWidth,AHeight,true,true);
      return this;
    };
    this.Destroy = function () {
      if (this.FContextNative != null) {
        rtl.free(this,"FContextNative");
        this.FContextNative = null;
      };
      if (this.FContextGeneral != null) {
        rtl.free(this,"FContextGeneral");
        this.FContextGeneral = null;
      };
      if (this.FFont != null) {
        rtl.free(this,"FFont");
        this.FFont = null;
      };
      if ((this.FSaveFont != null) && (this.FActiveCanvas != null)) {
        this.FActiveCanvas.FFont.Assign(this.FSaveFont);
        rtl.free(this,"FSaveFont");
        this.FSaveFont = null;
      };
      if (this.FFill != null) {
        this.FFill.FOnChanged = null;
        rtl.free(this,"FFill");
        this.FFill = null;
      };
      if (this.FStroke != null) {
        this.FStroke.FOnChanged = null;
        rtl.free(this,"FStroke");
        this.FStroke = null;
      };
      this.FBitmapContainer = null;
      if (this.FBitmap != null) {
        rtl.free(this,"FBitmap");
        this.FBitmap = null;
      };
      pas.System.TObject.Destroy.call(this);
    };
    this.GetMatrix = function () {
      var Result = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsMatrix.$new();
      Result.$assign(this.GetContext().GetMatrix());
      return Result;
    };
    this.StartSpecialPen = function () {
      this.GetContext().StartSpecialPen();
    };
    this.StopSpecialPen = function () {
      this.GetContext().StopSpecialPen();
    };
    this.BeginPrinting = function () {
      this.GetContext().BeginPrinting();
    };
    this.EndPrinting = function () {
      this.GetContext().EndPrinting();
    };
    this.BeginScene = function () {
      var Result = false;
      Result = this.GetContext().BeginScene();
      return Result;
    };
    this.EndScene = function () {
      this.GetContext().EndScene();
    };
    this.SetMatrix = function (AMatrix) {
      this.GetContext().SetMatrix(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsMatrix.$clone(AMatrix));
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCGraphics.isPrototypeOf(Source)) {
        this.FFill.BeginUpdate();
        this.FFill.Assign(rtl.as(Source,$mod.TTMSFNCGraphics).FFill);
        this.FFill.EndUpdate();
        this.FStroke.BeginUpdate();
        this.FStroke.Assign(rtl.as(Source,$mod.TTMSFNCGraphics).FStroke);
        this.FStroke.EndUpdate();
        this.FFont.BeginUpdate();
        this.FFont.AssignSource(rtl.as(Source,$mod.TTMSFNCGraphics).FFont);
        this.FFont.EndUpdate();
      };
    };
    this.SetFill = function (AFill) {
      if (this.FBlockUpdate > 0) return;
      this.FBlockUpdate += 1;
      this.GetContext().SetFill(AFill);
      this.FFill.Assign(AFill);
      this.FBlockUpdate -= 1;
    };
    this.SetStroke = function (AStroke) {
      if (this.FBlockUpdate > 0) return;
      this.FBlockUpdate += 1;
      this.GetContext().SetStroke(AStroke);
      this.FStroke.Assign(AStroke);
      this.FBlockUpdate -= 1;
    };
    this.RestoreState = function (AState, ACanvasOnly) {
      if (!ACanvasOnly) {
        this.SetFill(AState.FFill);
        this.SetStroke(AState.FStroke);
        this.SetFont(AState.FFont);
      };
      this.GetContext().RestoreState(AState);
      AState = rtl.freeLoc(AState);
    };
    this.SetFillKind = function (AKind) {
      if (this.FBlockUpdate > 0) return;
      this.FBlockUpdate += 1;
      this.GetContext().SetFillKind(AKind);
      this.FFill.SetKind(AKind);
      this.FBlockUpdate -= 1;
    };
    this.SetFillColor = function (AColor) {
      if (this.FBlockUpdate > 0) return;
      this.FBlockUpdate += 1;
      this.GetContext().SetFillColor(AColor);
      this.FFill.SetColor(AColor);
      this.FBlockUpdate -= 1;
    };
    this.SetFontColor = function (AColor) {
      if (this.FBlockUpdate > 0) return;
      this.FBlockUpdate += 1;
      this.GetContext().SetFontColor(AColor);
      this.FFont.SetColor(AColor);
      this.FBlockUpdate -= 1;
    };
    this.SetFontName = function (AName) {
      if (this.FBlockUpdate > 0) return;
      this.FBlockUpdate += 1;
      this.GetContext().SetFontName(AName);
      this.FFont.SetName(AName);
      this.FBlockUpdate -= 1;
    };
    this.SetFont = function (AFont) {
      if (this.FBlockUpdate > 0) return;
      this.FBlockUpdate += 1;
      this.GetContext().SetFont(AFont);
      this.FFont.AssignSource(AFont);
      this.FBlockUpdate -= 1;
    };
    this.SetFontSize = function (ASize) {
      if (this.FBlockUpdate > 0) return;
      this.FBlockUpdate += 1;
      this.GetContext().SetFontSize(ASize);
      this.FFont.SetSize(ASize);
      this.FBlockUpdate -= 1;
    };
    this.SetFontStyles = function (AStyle) {
      if (this.FBlockUpdate > 0) return;
      this.FBlockUpdate += 1;
      this.GetContext().SetFontStyles(rtl.refSet(AStyle));
      this.FFont.SetStyle(rtl.refSet(AStyle));
      this.FBlockUpdate -= 1;
    };
    this.SetStrokeKind = function (AKind) {
      if (this.FBlockUpdate > 0) return;
      this.FBlockUpdate += 1;
      this.GetContext().SetStrokeKind(AKind);
      this.FStroke.SetKind(AKind);
      this.FBlockUpdate -= 1;
    };
    this.SetStrokeColor = function (AColor) {
      if (this.FBlockUpdate > 0) return;
      this.FBlockUpdate += 1;
      this.GetContext().SetStrokeColor(AColor);
      this.FStroke.SetColor(AColor);
      this.FBlockUpdate -= 1;
    };
    this.SetStrokeWidth = function (AWidth) {
      if (this.FBlockUpdate > 0) return;
      this.FBlockUpdate += 1;
      this.GetContext().SetStrokeWidth(AWidth);
      this.FStroke.SetWidth(AWidth);
      this.FBlockUpdate -= 1;
    };
    this.DrawLine = function (AFromPoint, AToPoint, AModifyPointModeFrom, AModifyPointModeTo) {
      this.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].ConvertToPointF(AFromPoint)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].ConvertToPointF(AToPoint)),AModifyPointModeFrom,AModifyPointModeTo);
    };
    this.DrawLine$1 = function (AFromPoint, AToPoint, AModifyPointModeFrom, AModifyPointModeTo) {
      if ((this.FStroke.FColor !== -1) && (this.FStroke.FKind !== pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone)) this.GetContext().DrawLine(this.FStroke,pas["WEBLib.TMSFNCTypes"].TPointF.$clone(AFromPoint),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(AToPoint),AModifyPointModeFrom,AModifyPointModeTo);
    };
    this.DrawFocusRectangle = function (ALeft, ATop, ARight, ABottom, AColor, AModifyRectMode) {
      this.DrawFocusRectangle$1(pas.Types.TRect.$clone(pas.Types.Rect(ALeft,ATop,ARight,ABottom)),AColor,AModifyRectMode);
    };
    this.DrawFocusRectangle$1 = function (ARect, AColor, AModifyRectMode) {
      this.DrawFocusRectangle$3(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].ConvertToRectF(ARect)),AColor,AModifyRectMode);
    };
    this.DrawFocusRectangle$2 = function (ALeft, ATop, ARight, ABottom, AColor, AModifyRectMode) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ALeft,ATop,ARight,ABottom));
      this.GetContext().DrawFocusRectangle(this.FStroke,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),AColor,AModifyRectMode);
    };
    this.DrawFocusRectangle$3 = function (ARect, AColor, AModifyRectMode) {
      this.DrawFocusRectangle$2(ARect.Left,ARect.Top,ARect.Right,ARect.Bottom,AColor,AModifyRectMode);
    };
    this.DrawFocusPath = function (APath, AColor) {
      this.GetContext().DrawFocusPath(this.FStroke,APath,AColor);
    };
    this.DrawPolygon = function (APolygon) {
      var pth = null;
      if (((this.FFill.FColor !== -1) && (this.FFill.FKind !== pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone)) || (this.FFill.FKind === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkTexture)) {
        var $tmp = this.FFill.FKind;
        if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkTexture) {
          pth = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPath.$create("Create$1");
          try {
            pth.AddPolygon(APolygon);
            this.DrawTexture(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pth.GetBounds()),this.FFill.FTexture,this.FFill.FTextureMode);
          } finally {
            pth = rtl.freeLoc(pth);
          };
        } else {
          this.GetContext().FillPolygon(this.FFill,rtl.arrayRef(APolygon));
        };
      };
      if ((this.FStroke.FColor !== -1) && (this.FStroke.FKind !== pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone)) this.GetContext().DrawPolygon(this.FStroke,rtl.arrayRef(APolygon));
    };
    this.DrawPolyline = function (APolyline) {
      if ((this.FFill.FColor !== -1) && (this.FFill.FKind !== pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone)) this.GetContext().FillPolyline(this.FFill,rtl.arrayRef(APolyline));
      if ((this.FStroke.FColor !== -1) && (this.FStroke.FKind !== pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone)) this.GetContext().DrawPolyline(this.FStroke,rtl.arrayRef(APolyline));
    };
    this.DrawPath = function (APath, APathMode) {
      if (((this.FFill.FColor !== -1) && (this.FFill.FKind !== pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone)) || (this.FFill.FKind === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkTexture)) {
        var $tmp = this.FFill.FKind;
        if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkTexture) {
          this.DrawTexture(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(APath.GetBounds()),this.FFill.FTexture,this.FFill.FTextureMode)}
         else {
          this.GetContext().FillPath(this.FFill,APath,APathMode);
        };
      };
      if ((this.FStroke.FColor !== -1) && (this.FStroke.FKind !== pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone)) this.GetContext().DrawPath(this.FStroke,APath,APathMode);
    };
    this.DrawArc = function (Center, Radius, StartAngle, SweepAngle) {
      var pth = null;
      if ((this.FFill.FColor !== -1) && (this.FFill.FKind !== pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone)) {
        var $tmp = this.FFill.FKind;
        if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkTexture) {
          pth = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPath.$create("Create$1");
          try {
            pth.AddArc(Center,Radius,StartAngle,SweepAngle);
            this.DrawTexture(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pth.GetBounds()),this.FFill.FTexture,this.FFill.FTextureMode);
          } finally {
            pth = rtl.freeLoc(pth);
          };
        } else {
          this.GetContext().FillArc(this.FFill,pas["WEBLib.TMSFNCTypes"].TPointF.$clone(Center),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(Radius),StartAngle,SweepAngle);
        };
      };
      if ((this.FStroke.FColor !== -1) && (this.FStroke.FKind !== pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone)) this.GetContext().DrawArc(this.FStroke,pas["WEBLib.TMSFNCTypes"].TPointF.$clone(Center),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(Radius),StartAngle,SweepAngle);
    };
    this.DrawArc$1 = function (Center, Radius, StartAngle, SweepAngle) {
      this.DrawArc(pas["WEBLib.TMSFNCTypes"].ConvertToPointF(Center),pas["WEBLib.TMSFNCTypes"].ConvertToPointF(Radius),StartAngle,SweepAngle);
    };
    this.DrawRectangle = function (ALeft, ATop, ARight, ABottom, AModifyRectMode) {
      this.DrawRectangle$1(ALeft,ATop,ARight,ABottom,pas["WEBLib.TMSFNCGraphicsTypes"].AllSides,AModifyRectMode);
    };
    this.DrawRectangle$1 = function (ALeft, ATop, ARight, ABottom, ASides, AModifyRectMode) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var pth = null;
      r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ALeft,ATop,ARight,ABottom));
      if (((this.FFill.FColor !== -1) && (this.FFill.FKind !== pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone)) || (this.FFill.FKind === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkTexture)) {
        var $tmp = this.FFill.FKind;
        if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkTexture) {
          pth = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPath.$create("Create$1");
          try {
            pth.AddRectangle(r,0.0,0.0,rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight));
            this.DrawTexture(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FFill.FTexture,this.FFill.FTextureMode);
          } finally {
            pth = rtl.freeLoc(pth);
          };
        } else {
          this.GetContext().FillRect(this.FFill,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),AModifyRectMode);
        };
      };
      if ((this.FStroke.FColor !== -1) && (this.FStroke.FKind !== pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone)) this.GetContext().DrawRect(this.FStroke,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),rtl.refSet(ASides),AModifyRectMode);
    };
    this.DrawEllipse = function (ALeft, ATop, ARight, ABottom, AModifyRectMode) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var pth = null;
      r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ALeft,ATop,ARight,ABottom));
      if (((this.FFill.FColor !== -1) && (this.FFill.FKind !== pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone)) || (this.FFill.FKind === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkTexture)) {
        var $tmp = this.FFill.FKind;
        if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkTexture) {
          pth = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPath.$create("Create$1");
          try {
            pth.AddEllipse(r);
            this.DrawTexture(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FFill.FTexture,this.FFill.FTextureMode);
          } finally {
            pth = rtl.freeLoc(pth);
          };
        } else {
          this.GetContext().FillEllipse(this.FFill,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),AModifyRectMode);
        };
      };
      if ((this.FStroke.FColor !== -1) && (this.FStroke.FKind !== pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone)) this.GetContext().DrawEllipse(this.FStroke,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),AModifyRectMode);
    };
    this.DrawRectangle$2 = function (ARect, AModifyRectMode) {
      this.DrawRectangle(ARect.Left,ARect.Top,ARect.Right,ARect.Bottom,AModifyRectMode);
    };
    this.DrawRectangle$3 = function (ARect, ASides, AModifyRectMode) {
      this.DrawRectangle$1(ARect.Left,ARect.Top,ARect.Right,ARect.Bottom,rtl.refSet(ASides),AModifyRectMode);
    };
    this.DrawRectangle$4 = function (ALeft, ATop, ARight, ABottom, AModifyRectMode) {
      this.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(ALeft,ATop,ARight,ABottom)),AModifyRectMode);
    };
    this.DrawRectangle$5 = function (ALeft, ATop, ARight, ABottom, ASides, AModifyRectMode) {
      this.DrawRectangle$3(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(ALeft,ATop,ARight,ABottom)),rtl.refSet(ASides),AModifyRectMode);
    };
    this.DrawEllipse$1 = function (ALeft, ATop, ARight, ABottom, AModifyRectMode) {
      this.DrawEllipse$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(ALeft,ATop,ARight,ABottom)),AModifyRectMode);
    };
    this.DrawRectangle$6 = function (ARect, AModifyRectMode) {
      this.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].ConvertToRectF(ARect)),AModifyRectMode);
    };
    this.DrawRectangle$7 = function (ARect, ASides, AModifyRectMode) {
      this.DrawRectangle$3(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].ConvertToRectF(ARect)),rtl.refSet(ASides),AModifyRectMode);
    };
    this.DrawRoundRectangle = function (ALeft, ATop, ARight, ABottom, ARounding, ACorners, AModifyRectMode) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rc = 0.0;
      var pth = null;
      r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ALeft,ATop,ARight,ABottom));
      if (((this.FFill.FColor !== -1) && (this.FFill.FKind !== pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone)) || (this.FFill.FKind === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkTexture)) {
        var $tmp = this.FFill.FKind;
        if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkTexture) {
          pth = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPath.$create("Create$1");
          try {
            rc = ARounding;
            if (pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft in ACorners) {
              pth.MoveTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + rc,r.Bottom));
              pth.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + rc,r.Bottom - rc),pas["WEBLib.TMSFNCTypes"].PointF(rc,rc),-270,90);
              pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Bottom - rc));
            } else {
              pth.MoveTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Bottom));
            };
            if (pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopLeft in ACorners) {
              pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Top + rc));
              pth.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + rc,r.Top + rc),pas["WEBLib.TMSFNCTypes"].PointF(rc,rc),-180,90);
              pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + rc,r.Top));
            } else pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Top));
            if (pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight in ACorners) {
              pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - rc,r.Top));
              pth.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - rc,r.Top + rc),pas["WEBLib.TMSFNCTypes"].PointF(rc,rc),-90,90);
              pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Top + rc));
            } else pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Top));
            if (pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight in ACorners) {
              pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Bottom - rc));
              pth.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - rc,r.Bottom - rc),pas["WEBLib.TMSFNCTypes"].PointF(rc,rc),0,90);
              pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - rc,r.Bottom));
            } else pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Bottom));
            if (pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft in ACorners) {
              pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + rc,r.Bottom))}
             else pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Bottom));
            pth.ClosePath();
            this.DrawTexture(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FFill.FTexture,this.FFill.FTextureMode);
          } finally {
            pth = rtl.freeLoc(pth);
          };
        } else {
          this.GetContext().FillRoundRect(this.FFill,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),ARounding,rtl.refSet(ACorners),AModifyRectMode);
        };
      };
      if ((this.FStroke.FColor !== -1) && (this.FStroke.FKind !== pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone)) this.GetContext().DrawRoundRect(this.FStroke,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),ARounding,rtl.refSet(ACorners),AModifyRectMode);
    };
    this.DrawRoundRectangle$1 = function (ARect, ARounding, ACorners, AModifyRectMode) {
      this.DrawRoundRectangle(ARect.Left,ARect.Top,ARect.Right,ARect.Bottom,ARounding,rtl.refSet(ACorners),AModifyRectMode);
    };
    this.DrawRoundRectangle$2 = function (ALeft, ATop, ARight, ABottom, ARounding, ACorners, AModifyRectMode) {
      this.DrawRoundRectangle$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(ALeft,ATop,ARight,ABottom)),ARounding,rtl.refSet(ACorners),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
    };
    this.DrawRoundRectangle$3 = function (ARect, ARounding, ACorners, AModifyRectMode) {
      this.DrawRoundRectangle$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].ConvertToRectF(ARect)),ARounding,rtl.refSet(ACorners),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
    };
    this.DrawEllipse$2 = function (ARect, AModifyRectMode) {
      this.DrawEllipse(ARect.Left,ARect.Top,ARect.Right,ARect.Bottom,AModifyRectMode);
    };
    this.DrawBitmapPart = function (ASourceLeft, ASourceTop, ASourceRight, ASourceBottom, ADestinationLeft, ADestinationTop, ADestinationRight, ADestinationBottom, ABitmap, AAspectRatio, AStretch, ACenter, ACropping) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rs = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var g = null;
      var bmp = null;
      r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ADestinationLeft,ADestinationTop,ADestinationRight,ADestinationBottom));
      rs.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ASourceLeft,ASourceTop,ASourceRight,ASourceBottom));
      if (pas["WEBLib.TMSFNCTypes"].RectIsEmpty(r) || pas["WEBLib.TMSFNCTypes"].RectIsEmpty(rs)) return;
      if (!this.DrawSVG(ABitmap,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r))) {
        g = $mod.TTMSFNCGraphics.$create("CreateBitmapCanvas",[Math.round(ASourceRight - ASourceLeft),Math.round(ASourceBottom - ASourceTop),this.FNative,true]);
        try {
          g.BeginScene();
          g.DrawBitmap(-ASourceLeft,-ASourceTop,-ASourceLeft + g.FBitmap.GetWidth(),-ASourceTop + g.FBitmap.GetHeight(),ABitmap,false,false,false,false);
          g.EndScene();
          bmp = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
          try {
            bmp.Assign(g.FBitmap);
            this.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),bmp,AAspectRatio,AStretch,ACenter,ACropping);
          } finally {
            bmp = rtl.freeLoc(bmp);
          };
        } finally {
          g = rtl.freeLoc(g);
        };
      };
    };
    this.DrawBitmapPart$1 = function (ASourceRect, ADestinationRect, ABitmap, AAspectRatio, AStretch, ACenter, ACropping) {
      this.DrawBitmapPart(ASourceRect.Left,ASourceRect.Top,ASourceRect.Right,ASourceRect.Bottom,ADestinationRect.Left,ADestinationRect.Top,ADestinationRect.Right,ADestinationRect.Bottom,ABitmap,AAspectRatio,AStretch,ACenter,ACropping);
    };
    this.DrawBitmap = function (ALeft, ATop, ARight, ABottom, ABitmap, AAspectRatio, AStretch, ACenter, ACropping) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (!(ABitmap != null)) return;
      r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ALeft,ATop,ARight,ABottom));
      r.$assign(this.GetBitmapDrawRectangle$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),ABitmap,AAspectRatio,AStretch,ACenter,ACropping));
      if (!this.DrawSVG(ABitmap,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r))) this.GetContext().DrawBitmap(pas["WEBLib.TMSFNCTypes"].BitmapToDrawBitmap(ABitmap),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,ABitmap.GetWidth(),ABitmap.GetHeight())),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),1);
    };
    this.DrawBitmap$1 = function (ARect, ABitmap, AAspectRatio, AStretch, ACenter, ACropping) {
      this.DrawBitmap(ARect.Left,ARect.Top,ARect.Right,ARect.Bottom,ABitmap,AAspectRatio,AStretch,ACenter,ACropping);
    };
    this.DrawEllipse$3 = function (ARect, AModifyRectMode) {
      this.DrawEllipse$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].ConvertToRectF(ARect)),AModifyRectMode);
    };
    this.DrawBitmapPart$2 = function (ASourceLeft, ASourceTop, ASourceRight, ASourceBottom, ADestinationLeft, ADestinationTop, ADestinationRight, ADestinationBottom, ABitmap, AAspectRatio, AStretch, ACenter, ACropping) {
      this.DrawBitmapPart$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(ASourceLeft,ASourceTop,ASourceRight,ASourceBottom)),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(ADestinationLeft,ADestinationTop,ADestinationRight,ADestinationBottom)),ABitmap,AAspectRatio,AStretch,ACenter,ACropping);
    };
    this.DrawBitmapPart$3 = function (ASourceRect, ADestinationRect, ABitmap, AAspectRatio, AStretch, ACenter, ACropping) {
      this.DrawBitmapPart$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].ConvertToRectF(ASourceRect)),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].ConvertToRectF(ADestinationRect)),ABitmap,AAspectRatio,AStretch,ACenter,ACropping);
    };
    this.DrawBitmap$2 = function (ALeft, ATop, ARight, ABottom, ABitmap, AAspectRatio, AStretch, ACenter, ACropping) {
      this.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(ALeft,ATop,ARight,ABottom)),ABitmap,AAspectRatio,AStretch,ACenter,ACropping);
    };
    this.DrawBitmap$3 = function (ARect, ABitmap, AAspectRatio, AStretch, ACenter, ACropping) {
      this.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].ConvertToRectF(ARect)),ABitmap,AAspectRatio,AStretch,ACenter,ACropping);
    };
    this.DrawBitmap$4 = function (ALeft, ATop, ABitmap) {
      this.DrawBitmap$3(pas.Types.TRect.$clone(pas.Types.Rect(ALeft,ATop,ALeft + ABitmap.GetWidth(),ATop + ABitmap.GetHeight())),ABitmap,true,false,true,false);
    };
    this.DrawBitmap$5 = function (ALeft, ATop, ABitmap) {
      this.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(ALeft,ATop,ALeft + ABitmap.GetWidth(),ATop + ABitmap.GetHeight())),ABitmap,true,false,true,false);
    };
    this.DrawCheckBox = function (ARect, AChecked, AFocused, AEnabled, AScaleFactor) {
      var c = 0;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.$assign(ARect);
      pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,-1,-1);
      if (AEnabled) {
        if (AFocused) {
          c = 11829830}
         else c = 0;
      } else c = 11119017;
      this.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      if (AEnabled) {
        this.FFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(13882323,85))}
       else this.FFill.SetColor(13882323);
      this.FStroke.SetWidth(1);
      this.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FStroke.SetColor(c);
      this.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
      pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,-(r.Right - r.Left) / 5,-(r.Bottom - r.Top) / 5);
      this.FStroke.SetWidth(2);
      this.FStroke.SetColor(c);
      if (AChecked) {
        this.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - 1,r.Bottom - 1)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
        this.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - 1,r.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Bottom - 1)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
      };
    };
    this.DrawButton = function (ARect, ADown, AFocused, AEnabled, AAdaptToStyle, AScaleFactor) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.$assign(ARect);
      this.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FStroke.SetWidth(1);
      this.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      if (AAdaptToStyle) {
        if (AEnabled) {
          if (!AFocused) {
            this.FStroke.SetColor($mod.TTMSFNCGraphics.DefaultButtonStrokeColor);
            this.FFill.SetColor($mod.TTMSFNCGraphics.DefaultButtonFillColor);
          } else {
            this.FStroke.SetColor($mod.TTMSFNCGraphics.DefaultButtonStrokeColorFocused);
            this.FFill.SetColor($mod.TTMSFNCGraphics.DefaultButtonFillColorFocused);
          };
        } else {
          this.FStroke.SetColor($mod.TTMSFNCGraphics.DefaultButtonStrokeColorDisabled);
          this.FFill.SetColor($mod.TTMSFNCGraphics.DefaultButtonFillColorDisabled);
        };
      } else {
        if (AEnabled) {
          if (!AFocused) {
            this.FStroke.SetColor(11119017);
            this.FFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(225,225,225));
          } else {
            this.FStroke.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(60,127,177));
            this.FFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(229,241,251));
          };
        } else {
          this.FStroke.SetColor(11119017);
          this.FFill.SetColor(13882323);
        };
      };
      this.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
      pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,-1,-1);
      this.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
      if (!ADown) {
        this.FStroke.SetColor(this.FFill.FColor)}
       else this.FStroke.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(this.FStroke.FColor,40));
      this.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
    };
    this.DrawCloseButton = function (ARect, ADown, AFocused, AEnabled, AAdaptToStyle, AScaleFactor) {
      var bmp = null;
      var bmpa = null;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var g = null;
      this.DrawButton(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),ADown,AFocused,AEnabled,AAdaptToStyle,AScaleFactor);
      if (AAdaptToStyle) {
        bmpa = pas["WEBLib.Graphics"].TBitmap.$create("Create$3");
        bmpa.SetSize(Math.round(16 * AScaleFactor),Math.round(16 * AScaleFactor));
        g = $mod.TTMSFNCGraphics.$create("Create$1",[bmpa.GetCanvas(),false]);
        try {
          g.BeginScene();
          g.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
          g.FStroke.SetColor($mod.TTMSFNCGraphics.DefaultSelectionFillColor);
          g.FStroke.SetWidth(2);
          g.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(3 * AScaleFactor,3 * AScaleFactor)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(12 * AScaleFactor,12 * AScaleFactor)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
          g.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(3 * AScaleFactor,12 * AScaleFactor)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(12 * AScaleFactor,3 * AScaleFactor)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
        } finally {
          g.EndScene();
          g = rtl.freeLoc(g);
        };
        try {
          r.$assign(ARect);
          bmp = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
          try {
            bmp.Assign(bmpa);
            this.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),bmp,true,false,true,false);
          } finally {
            bmp = rtl.freeLoc(bmp);
          };
        } finally {
          bmpa = rtl.freeLoc(bmpa);
        };
      } else {
        bmp = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCGRAPHICSCLOSESVG);
        try {
          r.$assign(ARect);
          pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,-6 * AScaleFactor,-6 * AScaleFactor);
          this.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),bmp,true,false,true,false);
        } finally {
          bmp = rtl.freeLoc(bmp);
        };
      };
    };
    this.DrawExpanderButton = function (ARect, AState, ADown, AFocused, AEnabled, AAdaptToStyle, AScaleFactor) {
      var bmpa = null;
      var bmp = null;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var g = null;
      this.DrawButton(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),ADown,AFocused,AEnabled,AAdaptToStyle,AScaleFactor);
      if (AAdaptToStyle) {
        bmpa = pas["WEBLib.Graphics"].TBitmap.$create("Create$3");
        bmpa.SetSize(Math.round(16 * AScaleFactor),Math.round(16 * AScaleFactor));
        g = $mod.TTMSFNCGraphics.$create("Create$1",[bmpa.GetCanvas(),false]);
        try {
          g.BeginScene();
          g.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
          g.FStroke.SetWidth(2);
          g.FStroke.SetColor($mod.TTMSFNCGraphics.DefaultSelectionFillColor);
          var $tmp = AState;
          if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsExpanderState.gesCollapsed) {
            g.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(5 * AScaleFactor,6 * AScaleFactor)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(8 * AScaleFactor,9 * AScaleFactor)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
            g.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(8 * AScaleFactor,9 * AScaleFactor)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(11 * AScaleFactor,6 * AScaleFactor)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
          } else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsExpanderState.gesExpanded) {
            g.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(5 * AScaleFactor,9 * AScaleFactor)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(8 * AScaleFactor,6 * AScaleFactor)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
            g.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(8 * AScaleFactor,6 * AScaleFactor)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(11 * AScaleFactor,9 * AScaleFactor)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
          };
        } finally {
          g.EndScene();
          g = rtl.freeLoc(g);
        };
        if (bmpa != null) {
          try {
            r.$assign(ARect);
            bmp = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
            try {
              bmp.Assign(bmpa);
              this.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),bmp,true,false,true,false);
            } finally {
              bmp = rtl.freeLoc(bmp);
            };
          } finally {
            bmpa = rtl.freeLoc(bmpa);
          };
        };
      } else {
        var $tmp1 = AState;
        if ($tmp1 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsExpanderState.gesCollapsed) {
          bmp = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCGRAPHICSDOWNSVG)}
         else if ($tmp1 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsExpanderState.gesExpanded) {
          bmp = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCGRAPHICSUPSVG)}
         else {
          bmp = null;
        };
        if (bmp != null) {
          try {
            r.$assign(ARect);
            pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,-4 * AScaleFactor,-4 * AScaleFactor);
            this.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),bmp,true,false,true,false);
          } finally {
            bmp = rtl.freeLoc(bmp);
          };
        };
      };
    };
    this.DrawCompactButton = function (ARect, AState, ADown, AFocused, AEnabled, AAdaptToStyle, AScaleFactor) {
      var bmpa = null;
      var bmp = null;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var g = null;
      this.DrawButton(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),ADown,AFocused,AEnabled,AAdaptToStyle,AScaleFactor);
      if (AAdaptToStyle) {
        bmpa = pas["WEBLib.Graphics"].TBitmap.$create("Create$3");
        bmpa.SetSize(Math.round(16 * AScaleFactor),Math.round(16 * AScaleFactor));
        g = $mod.TTMSFNCGraphics.$create("Create$1",[bmpa.GetCanvas(),false]);
        try {
          g.BeginScene();
          g.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
          g.FStroke.SetWidth(2);
          g.FStroke.SetColor($mod.TTMSFNCGraphics.DefaultSelectionFillColor);
          var $tmp = AState;
          if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCompactState.gcsCollapsed) {
            g.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(6 * AScaleFactor,5 * AScaleFactor)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(9 * AScaleFactor,8 * AScaleFactor)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
            g.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(9 * AScaleFactor,8 * AScaleFactor)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(6 * AScaleFactor,11 * AScaleFactor)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
          } else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCompactState.gcsExpanded) {
            g.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(9 * AScaleFactor,5 * AScaleFactor)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(6 * AScaleFactor,8 * AScaleFactor)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
            g.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(6 * AScaleFactor,8 * AScaleFactor)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(9 * AScaleFactor,11 * AScaleFactor)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
          };
        } finally {
          g.EndScene();
          g = rtl.freeLoc(g);
        };
        if (bmpa != null) {
          try {
            r.$assign(ARect);
            bmp = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
            try {
              bmp.Assign(bmpa);
              this.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),bmp,true,false,true,false);
            } finally {
              bmp = rtl.freeLoc(bmp);
            };
          } finally {
            bmpa = rtl.freeLoc(bmpa);
          };
        };
      } else {
        var $tmp1 = AState;
        if ($tmp1 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCompactState.gcsCollapsed) {
          bmp = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCGRAPHICSRIGHTSVG)}
         else if ($tmp1 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCompactState.gcsExpanded) {
          bmp = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCGRAPHICSLEFTSVG)}
         else {
          bmp = null;
        };
        if (bmp != null) {
          try {
            r.$assign(ARect);
            pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,-4 * AScaleFactor,-4 * AScaleFactor);
            this.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),bmp,true,false,true,false);
          } finally {
            bmp = rtl.freeLoc(bmp);
          };
        };
      };
    };
    this.DrawDropDownButton = function (ARect, ADown, AFocused, AEnabled, ACenter, AAdaptToStyle, AScaleFactor) {
      var bmp = null;
      var bmpa = null;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var g = null;
      this.DrawButton(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),ADown,AFocused,AEnabled,AAdaptToStyle,1.0);
      if (AAdaptToStyle) {
        bmpa = pas["WEBLib.Graphics"].TBitmap.$create("Create$3");
        bmpa.SetSize(Math.round(7 * AScaleFactor),Math.round(7 * AScaleFactor));
        g = $mod.TTMSFNCGraphics.$create("Create$1",[bmpa.GetCanvas(),false]);
        try {
          g.BeginScene();
          g.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
          g.FStroke.SetColor($mod.TTMSFNCGraphics.DefaultSelectionFillColor);
          g.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(0,1 * AScaleFactor)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(6 * AScaleFactor,1 * AScaleFactor)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
          g.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(0,2 * AScaleFactor)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(6 * AScaleFactor,2 * AScaleFactor)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
          g.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(1 * AScaleFactor,3 * AScaleFactor)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(5 * AScaleFactor,3 * AScaleFactor)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
          g.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(2 * AScaleFactor,4 * AScaleFactor)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(4 * AScaleFactor,4 * AScaleFactor)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
          g.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(3 * AScaleFactor,5 * AScaleFactor)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(3 * AScaleFactor,5 * AScaleFactor)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
        } finally {
          g.EndScene();
          g = rtl.freeLoc(g);
        };
        try {
          if (((ARect.Right - bmpa.GetWidth() - (10 * AScaleFactor)) > ARect.Left) && !ACenter) {
            r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARect.Right - bmpa.GetWidth() - (10 * AScaleFactor),ARect.Top,ARect.Right,ARect.Bottom))}
           else r.$assign(ARect);
          bmp = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
          try {
            bmp.Assign(bmpa);
            this.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),bmp,true,false,true,false);
          } finally {
            bmp = rtl.freeLoc(bmp);
          };
        } finally {
          bmpa = rtl.freeLoc(bmpa);
        };
      } else {
        bmp = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
        bmp.LoadFromResource($mod.TMSFNCGRAPHICSEXPANDSVG);
        try {
          if (!ACenter) {
            r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARect.Right - (16 * AScaleFactor),ARect.Top,ARect.Right - (2 * AScaleFactor),ARect.Bottom));
            pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,-2 * AScaleFactor,-2 * AScaleFactor);
          } else {
            r.$assign(ARect);
            pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,-4 * AScaleFactor,-4 * AScaleFactor);
          };
          this.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),bmp,true,false,true,false);
        } finally {
          bmp = rtl.freeLoc(bmp);
        };
      };
    };
    this.DrawRadioButton = function (ARect, AChecked, AFocused, AEnabled, AScaleFactor) {
      var c = 0;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.$assign(ARect);
      pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,-1,-1);
      if (AEnabled) {
        if (AFocused) {
          c = 11829830}
         else c = 0;
      } else c = 11119017;
      this.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      if (AEnabled) {
        this.FFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(13882323,85))}
       else this.FFill.SetColor(13882323);
      this.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FStroke.SetWidth(1);
      this.FStroke.SetColor(c);
      this.DrawEllipse$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
      pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,-(r.Right - r.Left) / 5,-(r.Bottom - r.Top) / 5);
      this.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FFill.SetColor(c);
      if (AChecked) {
        this.DrawEllipse$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
      };
    };
    this.DrawProgressBar = function (ARect, AValue, AFormat, AMax, AColor, ATextColor, AShowText, AEnabled, AScaleFactor) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rp = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var v = 0.0;
      var tc = 0;
      var fc = 0;
      r.$assign(ARect);
      rp.$assign(r);
      fc = this.FFill.FColor;
      if (AEnabled) {
        this.FFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(13882323,75))}
       else this.FFill.SetColor(13882323);
      this.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FStroke.SetColor(11119017);
      this.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
      v = Math.max(0,Math.min(AValue,AMax));
      if ((v >= 0) && (v <= AMax) && (AMax > 0)) {
        pas["WEBLib.TMSFNCTypes"].InflateRectEx(rp,-1,-1);
        rp.Right = rp.Left + (((rp.Right - r.Left) * v) / AMax);
        this.FFill.SetColor(AColor);
        this.FStroke.SetColor(this.FFill.FColor);
        this.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rp),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        if (AShowText) {
          tc = this.FFont.FColor;
          this.FFont.SetColor(ATextColor);
          this.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas.SysUtils.Format(AFormat,pas.System.VarRecs(3,(v / AMax) * 100)),false,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,true,false,-1,-1);
          this.FFont.SetColor(tc);
        };
      };
      this.FFill.SetColor(fc);
    };
    this.DrawCheckBox$1 = function (ARect, AChecked, AFocused, AEnabled, AScaleFactor) {
      this.DrawCheckBox(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].ConvertToRectF(ARect)),AChecked,AFocused,AEnabled,AScaleFactor);
    };
    this.DrawButton$1 = function (ARect, ADown, AFocused, AEnabled, AAdaptToStyle, AScaleFactor) {
      this.DrawButton(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].ConvertToRectF(ARect)),ADown,AFocused,AEnabled,AAdaptToStyle,AScaleFactor);
    };
    this.DrawCloseButton$1 = function (ARect, ADown, AFocused, AEnabled, AAdaptToStyle, AScaleFactor) {
      this.DrawCloseButton(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].ConvertToRectF(ARect)),ADown,AFocused,AEnabled,AAdaptToStyle,AScaleFactor);
    };
    this.DrawExpanderButton$1 = function (ARect, AState, ADown, AFocused, AEnabled, AAdaptToStyle, AScaleFactor) {
      this.DrawExpanderButton(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].ConvertToRectF(ARect)),AState,ADown,AFocused,AEnabled,AAdaptToStyle,AScaleFactor);
    };
    this.DrawCompactButton$1 = function (ARect, AState, ADown, AFocused, AEnabled, AAdaptToStyle, AScaleFactor) {
      this.DrawCompactButton(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].ConvertToRectF(ARect)),AState,ADown,AFocused,AEnabled,AAdaptToStyle,AScaleFactor);
    };
    this.DrawDropDownButton$1 = function (ARect, ADown, AFocused, AEnabled, ACenter, AAdaptToStyle, AScaleFactor) {
      this.DrawDropDownButton(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].ConvertToRectF(ARect)),ADown,AFocused,AEnabled,ACenter,AAdaptToStyle,AScaleFactor);
    };
    this.DrawRadioButton$1 = function (ARect, AChecked, AFocused, AEnabled, AScaleFactor) {
      this.DrawRadioButton(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].ConvertToRectF(ARect)),AChecked,AFocused,AEnabled,AScaleFactor);
    };
    this.DrawProgressBar$1 = function (ARect, AValue, AFormat, AMax, AColor, ATextColor, AShowText, AEnabled, AScaleFactor) {
      this.DrawProgressBar(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].ConvertToRectF(ARect)),AValue,AFormat,AMax,AColor,ATextColor,AShowText,AEnabled,AScaleFactor);
    };
    this.DrawBitmapWithName = function (ALeft, ATop, ARight, ABottom, ABitmapName, AApplyScale, AScale, AAspectRatio, AStretch, ACenter, ACropping) {
      var b = null;
      b = this.$class.GetBitmapFromBitmapContainer(this.FBitmapContainer,ABitmapName,AApplyScale,AScale);
      if (b != null) this.DrawBitmap(ALeft,ATop,ARight,ABottom,b,AAspectRatio,AStretch,ACenter,ACropping);
    };
    this.DrawBitmapWithName$1 = function (ARect, ABitmapName, AApplyScale, AScale, AAspectRatio, AStretch, ACenter, ACropping) {
      var b = null;
      b = this.$class.GetBitmapFromBitmapContainer(this.FBitmapContainer,ABitmapName,AApplyScale,AScale);
      if (b != null) this.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),b,AAspectRatio,AStretch,ACenter,ACropping);
    };
    this.DrawScaledBitmap = function (ARect, ABitmaps, AScale, AAspectRatio, AStretch, ACenter, ACropping) {
      var b = null;
      var bmp = null;
      if (ABitmaps != null) {
        if (AScale > 0) {
          b = ABitmaps.GetItemByScale(AScale)}
         else b = ABitmaps.GetItemByScale(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetDPIScale(null,-1));
        if (b != null) {
          if ((b.FBitmap != null) && !pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(b.FBitmap)) {
            this.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),b.FBitmap,AAspectRatio,AStretch,ACenter,ACropping)}
           else {
            bmp = this.$class.GetBitmapFromBitmapContainer(this.FBitmapContainer,b.FBitmapName,true,AScale);
            if ((bmp != null) && !pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(bmp)) {
              this.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),bmp,AAspectRatio,AStretch,ACenter,ACropping)}
             else this.DrawBitmapWithName$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),b.FBitmapName,false,b.FScale,AAspectRatio,AStretch,ACenter,ACropping);
          };
        };
      };
    };
    this.DrawScaledBitmap$1 = function (ALeft, ATop, ARight, ABottom, ABitmaps, AScale, AAspectRatio, AStretch, ACenter, ACropping) {
      var b = null;
      var bmp = null;
      if (ABitmaps != null) {
        if (AScale > 0) {
          b = ABitmaps.GetItemByScale(AScale)}
         else b = ABitmaps.GetItemByScale(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetDPIScale(null,-1));
        if (b != null) {
          if ((b.FBitmap != null) && !pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(b.FBitmap)) {
            this.DrawBitmap(ALeft,ATop,ARight,ABottom,b.FBitmap,AAspectRatio,AStretch,ACenter,ACropping)}
           else {
            bmp = this.$class.GetBitmapFromBitmapContainer(this.FBitmapContainer,b.FBitmapName,true,AScale);
            if ((bmp != null) && !pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(bmp)) {
              this.DrawBitmap(ALeft,ATop,ARight,ABottom,bmp,AAspectRatio,AStretch,ACenter,ACropping)}
             else this.DrawBitmapWithName(ALeft,ATop,ARight,ABottom,b.FBitmapName,false,b.FScale,AAspectRatio,AStretch,ACenter,ACropping);
          };
        };
      };
    };
    this.DrawBitmapWithName$2 = function (ALeft, ATop, ARight, ABottom, ABitmapName, AApplyScale, AScale, AAspectRatio, AStretch, ACenter, ACropping) {
      this.DrawBitmapWithName$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(ALeft,ATop,ARight,ABottom)),ABitmapName,AApplyScale,AScale,AAspectRatio,AStretch,ACenter,ACropping);
    };
    this.DrawBitmapWithName$3 = function (ARect, ABitmapName, AApplyScale, AScale, AAspectRatio, AStretch, ACenter, ACropping) {
      this.DrawBitmapWithName$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].ConvertToRectF(ARect)),ABitmapName,AApplyScale,AScale,AAspectRatio,AStretch,ACenter,ACropping);
    };
    this.DrawScaledBitmap$2 = function (ARect, ABitmaps, AScale, AAspectRatio, AStretch, ACenter, ACropping) {
      this.DrawScaledBitmap(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].ConvertToRectF(ARect)),ABitmaps,AScale,AAspectRatio,AStretch,ACenter,ACropping);
    };
    this.DrawScaledBitmap$3 = function (ALeft, ATop, ARight, ABottom, ABitmaps, AScale, AAspectRatio, AStretch, ACenter, ACropping) {
      this.DrawScaledBitmap(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(ALeft,ATop,ARight,ABottom)),ABitmaps,AScale,AAspectRatio,AStretch,ACenter,ACropping);
    };
    this.GetBitmapDrawRectangle = function (ALeft, ATop, ARight, ABottom, ABitmap, AAspectRatio, AStretch, ACenter, ACropping) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var bmp = null;
      var rdest = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var w = 0.0;
      var h = 0.0;
      var x = 0.0;
      var y = 0.0;
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,0,0));
      bmp = ABitmap;
      if (bmp != null) {
        x = 0;
        y = 0;
        w = 0;
        h = 0;
        this.$class.GetAspectSize({get: function () {
            return w;
          }, set: function (v) {
            w = v;
          }},{get: function () {
            return h;
          }, set: function (v) {
            h = v;
          }},bmp.GetWidth(),bmp.GetHeight(),ARight - ALeft,ABottom - ATop,AAspectRatio,AStretch,ACropping);
        if (ACenter || ACropping) {
          x = Math.round((ARight - ALeft - w) / 2);
          y = Math.round((ABottom - ATop - h) / 2);
        };
        rdest.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ALeft + x,ATop + y,ALeft + x + w,ATop + y + h));
        Result.$assign(rdest);
      };
      return Result;
    };
    this.GetBitmapDrawRectangle$1 = function (ARect, ABitmap, AAspectRatio, AStretch, ACenter, ACropping) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(this.GetBitmapDrawRectangle(ARect.Left,ARect.Top,ARect.Right,ARect.Bottom,ABitmap,AAspectRatio,AStretch,ACenter,ACropping));
      return Result;
    };
    this.GetBitmapDrawRectangle$2 = function (ALeft, ATop, ARight, ABottom, ABitmap, AAspectRatio, AStretch, ACenter, ACropping) {
      var Result = pas.Types.TRect.$new();
      Result.$assign(pas["WEBLib.TMSFNCTypes"].ConvertToRect(this.GetBitmapDrawRectangle$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(ALeft,ATop,ARight,ABottom)),ABitmap,AAspectRatio,AStretch,ACenter,ACropping)));
      return Result;
    };
    this.GetBitmapDrawRectangle$3 = function (ARect, ABitmap, AAspectRatio, AStretch, ACenter, ACropping) {
      var Result = pas.Types.TRect.$new();
      Result.$assign(pas["WEBLib.TMSFNCTypes"].ConvertToRect(this.GetBitmapDrawRectangle$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].ConvertToRectF(ARect)),ABitmap,AAspectRatio,AStretch,ACenter,ACropping)));
      return Result;
    };
    this.ClipRect = function (ARect) {
      this.GetContext().ClipRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect));
    };
    this.DrawBitmapPartSync = async function (ASourceLeft, ASourceTop, ASourceRight, ASourceBottom, ADestinationLeft, ADestinationTop, ADestinationRight, ADestinationBottom, ABitmap, AAspectRatio, AStretch, ACenter, ACropping) {
      var Result = null;
      Result = await this.InternalDrawBitmapPartSync(ASourceLeft,ASourceTop,ASourceRight,ASourceBottom,ADestinationLeft,ADestinationTop,ADestinationRight,ADestinationBottom,ABitmap,AAspectRatio,AStretch,ACenter,ACropping);
      return Result;
    };
    this.CalculateTextSize = function (AText, ARect, AWordWrapping, ASupportHTML) {
      var Result = pas["WEBLib.TMSFNCTypes"].TSizeF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.$assign(this.CalculateText(AText,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AWordWrapping,ASupportHTML));
      Result.cx = r.Right - r.Left;
      Result.cy = r.Bottom - r.Top;
      return Result;
    };
    this.CalculateTextWidth = function (AText, ARect, AWordWrapping, ASupportHTML) {
      var Result = 0.0;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.$assign(this.CalculateText(AText,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AWordWrapping,ASupportHTML));
      Result = r.Right - r.Left;
      return Result;
    };
    this.CalculateTextHeight = function (AText, ARect, AWordWrapping, ASupportHTML) {
      var Result = 0.0;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.$assign(this.CalculateText(AText,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AWordWrapping,ASupportHTML));
      Result = r.Bottom - r.Top;
      return Result;
    };
    var arr$1 = ["<BR>","<BR/>"];
    this.CalculateText = function (AText, ARect, AWordWrapping, ASupportHTML) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var lst = null;
      var i = 0;
      var l = 0;
      var p = 0;
      var b = false;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var y = 0.0;
      Result.$assign(ARect);
      b = this.FOptimizedHTMLDrawing && pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.IsHTML(AText);
      if (b) {
        for (i = 0; i <= 1; i++) {
          p = pas.System.Pos(arr$1[i],pas.SysUtils.UpperCase(AText));
          l = arr$1[i].length;
        };
        if ((p > 0) && (l > 0)) {
          lst = pas.Classes.TStringList.$create("Create$1");
          try {
            lst.SetLineBreak(pas.System.Copy(AText,p,l));
            lst.SetTextStr(AText);
            y = 0;
            for (var $l = 0, $end = lst.GetCount() - 1; $l <= $end; $l++) {
              i = $l;
              r.$assign(this.InternalCalculateText(lst.Get(i),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AWordWrapping,ASupportHTML));
              y = y + (r.Bottom - r.Top);
            };
            Result.Bottom = Result.Top + y;
          } finally {
            lst = rtl.freeLoc(lst);
          };
        } else b = false;
      };
      if (!b) Result.$assign(this.InternalCalculateText(AText,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AWordWrapping,ASupportHTML));
      return Result;
    };
    this.CalculateTextSize$1 = function (AText) {
      var Result = pas["WEBLib.TMSFNCTypes"].TSizeF.$new();
      Result.$assign(this.CalculateTextSize(AText,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,10000,10000)),false,true));
      return Result;
    };
    this.CalculateTextWidth$1 = function (AText) {
      var Result = 0.0;
      Result = this.CalculateTextWidth(AText,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,10000,10000)),false,true);
      return Result;
    };
    this.CalculateTextHeight$1 = function (AText) {
      var Result = 0.0;
      Result = this.CalculateTextHeight(AText,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,10000,10000)),false,true);
      return Result;
    };
    this.CalculateText$1 = function (AText) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(this.CalculateText(AText,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,10000,10000)),false,true));
      return Result;
    };
    this.ClipRect$1 = function (ARect) {
      this.ClipRect$1(pas.Types.TRect.$clone(pas["WEBLib.TMSFNCTypes"].ConvertToRect$1(ARect)));
    };
    this.CalculateTextSize$2 = function (AText, ARect, AWordWrapping, ASupportHTML) {
      var Result = pas.Types.TSize.$new();
      Result.$assign(pas["WEBLib.TMSFNCTypes"].ConvertToSize(this.CalculateTextSize(AText,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].ConvertToRectF(ARect)),AWordWrapping,ASupportHTML)));
      return Result;
    };
    this.CalculateTextWidth$2 = function (AText, ARect, AWordWrapping, ASupportHTML) {
      var Result = 0;
      Result = Math.round(this.CalculateTextWidth(AText,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].ConvertToRectF(ARect)),AWordWrapping,ASupportHTML));
      return Result;
    };
    this.CalculateTextHeight$2 = function (AText, ARect, AWordWrapping, ASupportHTML) {
      var Result = 0;
      Result = Math.round(this.CalculateTextHeight(AText,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].ConvertToRectF(ARect)),AWordWrapping,ASupportHTML));
      return Result;
    };
    this.CalculateText$2 = function (AText, ARect, AWordWrapping, ASupportHTML) {
      var Result = pas.Types.TRect.$new();
      Result.$assign(pas["WEBLib.TMSFNCTypes"].ConvertToRect(this.CalculateText(AText,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].ConvertToRectF(ARect)),AWordWrapping,ASupportHTML)));
      return Result;
    };
    this.CalculateTextSizeInt = function (AText) {
      var Result = pas.Types.TSize.$new();
      Result.$assign(pas["WEBLib.TMSFNCTypes"].ConvertToSize(this.CalculateTextSize$1(AText)));
      return Result;
    };
    this.CalculateTextWidthInt = function (AText) {
      var Result = 0;
      Result = Math.round(this.CalculateTextWidth$1(AText));
      return Result;
    };
    this.CalculateTextHeightInt = function (AText) {
      var Result = 0;
      Result = Math.round(this.CalculateTextHeight$1(AText));
      return Result;
    };
    this.CalculateTextInt = function (AText) {
      var Result = pas.Types.TRect.$new();
      Result.$assign(pas["WEBLib.TMSFNCTypes"].ConvertToRect(this.CalculateText$1(AText)));
      return Result;
    };
    this.DrawText = function (APoint, AText, AAngle, ASupportHTML, ATestAnchor, AX, AY) {
      var Result = "";
      var AControlID = "";
      var AControlValue = "";
      var AControlType = "";
      AControlID = "";
      AControlValue = "";
      AControlType = "";
      Result = this.DrawText$5(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(APoint.X,APoint.Y,APoint.X + 10000,APoint.Y + 10000)),AText,{get: function () {
          return AControlID;
        }, set: function (v) {
          AControlID = v;
        }},{get: function () {
          return AControlValue;
        }, set: function (v) {
          AControlValue = v;
        }},{get: function () {
          return AControlType;
        }, set: function (v) {
          AControlType = v;
        }},false,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,AAngle,-1,-1,ASupportHTML,ATestAnchor,AX,AY);
      return Result;
    };
    this.DrawText$1 = function (ARect, AText, AWordWrapping, AHorizontalAlign, AVerticalAlign, ATrimming, AAngle, AMinWidth, AMinHeight, ASupportHTML, ATestAnchor, AX, AY) {
      var Result = "";
      var AControlID = "";
      var AControlValue = "";
      var AControlType = "";
      AControlID = "";
      AControlValue = "";
      AControlType = "";
      Result = this.DrawText$5(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AText,{get: function () {
          return AControlID;
        }, set: function (v) {
          AControlID = v;
        }},{get: function () {
          return AControlValue;
        }, set: function (v) {
          AControlValue = v;
        }},{get: function () {
          return AControlType;
        }, set: function (v) {
          AControlType = v;
        }},AWordWrapping,AHorizontalAlign,AVerticalAlign,ATrimming,AAngle,AMinWidth,AMinHeight,ASupportHTML,ATestAnchor,AX,AY);
      return Result;
    };
    this.DrawText$2 = function (ALeft, ATop, ARight, ABottom, AText, AWordWrapping, AHorizontalAlign, AVerticalAlign, ATrimming, AAngle, AMinWidth, AMinHeight, ASupportHTML, ATestAnchor, AX, AY) {
      var Result = "";
      var AControlID = "";
      var AControlValue = "";
      var AControlType = "";
      AControlID = "";
      AControlValue = "";
      AControlType = "";
      Result = this.DrawText$5(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(ALeft,ATop,ARight,ABottom)),AText,{get: function () {
          return AControlID;
        }, set: function (v) {
          AControlID = v;
        }},{get: function () {
          return AControlValue;
        }, set: function (v) {
          AControlValue = v;
        }},{get: function () {
          return AControlType;
        }, set: function (v) {
          AControlType = v;
        }},AWordWrapping,AHorizontalAlign,AVerticalAlign,ATrimming,AAngle,AMinWidth,AMinHeight,ASupportHTML,ATestAnchor,AX,AY);
      return Result;
    };
    this.DrawText$3 = function (ARect, AText, AWordWrapping, AHorizontalAlign, AVerticalAlign, ATrimming, AAngle, AMinWidth, AMinHeight, ASupportHTML, ATestAnchor, AX, AY) {
      var Result = "";
      var AControlID = "";
      var AControlValue = "";
      var AControlType = "";
      AControlID = "";
      AControlValue = "";
      AControlType = "";
      Result = this.DrawText$5(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].ConvertToRectF(ARect)),AText,{get: function () {
          return AControlID;
        }, set: function (v) {
          AControlID = v;
        }},{get: function () {
          return AControlValue;
        }, set: function (v) {
          AControlValue = v;
        }},{get: function () {
          return AControlType;
        }, set: function (v) {
          AControlType = v;
        }},AWordWrapping,AHorizontalAlign,AVerticalAlign,ATrimming,AAngle,AMinWidth,AMinHeight,ASupportHTML,ATestAnchor,AX,AY);
      return Result;
    };
    this.DrawText$4 = function (ALeft, ATop, ARight, ABottom, AText, AWordWrapping, AHorizontalAlign, AVerticalAlign, ATrimming, AAngle, AMinWidth, AMinHeight, ASupportHTML, ATestAnchor, AX, AY) {
      var Result = "";
      var AControlID = "";
      var AControlValue = "";
      var AControlType = "";
      AControlID = "";
      AControlValue = "";
      AControlType = "";
      Result = this.DrawText$5(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(ALeft,ATop,ARight,ABottom)),AText,{get: function () {
          return AControlID;
        }, set: function (v) {
          AControlID = v;
        }},{get: function () {
          return AControlValue;
        }, set: function (v) {
          AControlValue = v;
        }},{get: function () {
          return AControlType;
        }, set: function (v) {
          AControlType = v;
        }},AWordWrapping,AHorizontalAlign,AVerticalAlign,ATrimming,AAngle,AMinWidth,AMinHeight,ASupportHTML,ATestAnchor,AX,AY);
      return Result;
    };
    var arr = ["<BR>","<BR/>"];
    this.DrawText$5 = function (ARect, AText, AControlID, AControlValue, AControlType, AWordWrapping, AHorizontalAlign, AVerticalAlign, ATrimming, AAngle, AMinWidth, AMinHeight, ASupportHTML, ATestAnchor, AX, AY) {
      var Result = "";
      var lst = null;
      var i = 0;
      var l = 0;
      var p = 0;
      var b = false;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rd = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      rd.$assign(ARect);
      b = !ATestAnchor && this.FOptimizedHTMLDrawing;
      b = b && pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.IsHTML(AText);
      if (b) {
        for (i = 0; i <= 1; i++) {
          p = pas.System.Pos(arr[i],pas.SysUtils.UpperCase(AText));
          l = arr[i].length;
        };
        if ((p > 0) && (l > 0)) {
          lst = pas.Classes.TStringList.$create("Create$1");
          try {
            lst.SetLineBreak(pas.System.Copy(AText,p,l));
            lst.SetTextStr(AText);
            for (var $l = 0, $end = lst.GetCount() - 1; $l <= $end; $l++) {
              i = $l;
              r.$assign(this.CalculateText(lst.Get(i),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rd),AWordWrapping,ASupportHTML));
              this.InternalDrawText(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top,r.Right + 1,r.Bottom)),lst.Get(i),AControlID,AControlValue,AControlType,AWordWrapping,AHorizontalAlign,AVerticalAlign,ATrimming,AAngle,AMinWidth,AMinHeight,ASupportHTML,ATestAnchor,AX,AY);
              rd.Top = rd.Top + (r.Bottom - r.Top);
              rd.Bottom = rd.Bottom + (r.Bottom - r.Top);
            };
          } finally {
            lst = rtl.freeLoc(lst);
          };
        } else b = false;
      };
      if (!b) {
        Result = this.InternalDrawText(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AText,AControlID,AControlValue,AControlType,AWordWrapping,AHorizontalAlign,AVerticalAlign,ATrimming,AAngle,AMinWidth,AMinHeight,ASupportHTML,ATestAnchor,AX,AY);
      };
      return Result;
    };
    this.DrawText$6 = function (ALeft, ATop, ARight, ABottom, AText, AControlID, AControlValue, AControlType, AWordWrapping, AHorizontalAlign, AVerticalAlign, ATrimming, AAngle, AMinWidth, AMinHeight, ASupportHTML, ATestAnchor, AX, AY) {
      var Result = "";
      Result = this.DrawText$5(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(ALeft,ATop,ARight,ABottom)),AText,AControlID,AControlValue,AControlType,AWordWrapping,AHorizontalAlign,AVerticalAlign,ATrimming,AAngle,AMinWidth,AMinHeight,ASupportHTML,ATestAnchor,AX,AY);
      return Result;
    };
    this.DrawText$7 = function (ARect, AText, AControlID, AControlValue, AControlType, AWordWrapping, AHorizontalAlign, AVerticalAlign, ATrimming, AAngle, AMinWidth, AMinHeight, ASupportHTML, ATestAnchor, AX, AY) {
      var Result = "";
      Result = this.DrawText$5(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].ConvertToRectF(ARect)),AText,AControlID,AControlValue,AControlType,AWordWrapping,AHorizontalAlign,AVerticalAlign,ATrimming,AAngle,AMinWidth,AMinHeight,ASupportHTML,ATestAnchor,AX,AY);
      return Result;
    };
    this.DrawText$8 = function (ALeft, ATop, ARight, ABottom, AText, AControlID, AControlValue, AControlType, AWordWrapping, AHorizontalAlign, AVerticalAlign, ATrimming, AAngle, AMinWidth, AMinHeight, ASupportHTML, ATestAnchor, AX, AY) {
      var Result = "";
      Result = this.DrawText$5(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(ALeft,ATop,ARight,ABottom)),AText,AControlID,AControlValue,AControlType,AWordWrapping,AHorizontalAlign,AVerticalAlign,ATrimming,AAngle,AMinWidth,AMinHeight,ASupportHTML,ATestAnchor,AX,AY);
      return Result;
    };
    this.SaveState = function (ACanvasOnly) {
      var Result = null;
      Result = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSaveState.$create("Create$1");
      if (!ACanvasOnly) {
        Result.FFill.Assign(this.FFill);
        Result.FStroke.Assign(this.FStroke);
        Result.FFont.AssignSource(this.FFont);
      };
      this.GetContext().SaveState(Result);
      return Result;
    };
    this.ApplyHilight = function (AText, AHilight, ATag, ADoCase) {
      var Result = "";
      Result = pas["WEBLib.TMSFNCHTMLEngine"].HiLight(AText,AHilight,ATag,ADoCase,false);
      return Result;
    };
    this.GetBitmapFromBitmapContainer = function (ABitmapContainer, AName, AApplyScale, AScale) {
      var Result = null;
      Result = null;
      if ((ABitmapContainer != null) && (AName !== "")) {
        if (AApplyScale) {
          if (AScale > 0) {
            Result = ABitmapContainer.FindBitmap$1(AName + "_" + pas.SysUtils.FloatToStr(AScale))}
           else Result = ABitmapContainer.FindBitmap$1(AName + "_" + pas.SysUtils.FloatToStr(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetDPIScale(null,-1)));
        };
        if (!(Result != null)) Result = ABitmapContainer.FindBitmap$1(AName);
      };
      return Result;
    };
    this.GetScaledBitmap = function (ABitmaps, AScale, ABitmapContainer) {
      var Result = null;
      var b = null;
      var bmp = null;
      Result = null;
      if (ABitmaps != null) {
        if (AScale > 0) {
          b = ABitmaps.GetItemByScale(AScale)}
         else b = ABitmaps.GetItemByScale(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetDPIScale(null,-1));
        if (b != null) {
          if ((b.FBitmap != null) && !pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(b.FBitmap)) {
            Result = b.FBitmap}
           else {
            bmp = this.GetBitmapFromBitmapContainer(ABitmapContainer,b.FBitmapName,true,AScale);
            if ((bmp != null) && !pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(bmp)) {
              Result = bmp}
             else {
              bmp = this.GetBitmapFromBitmapContainer(ABitmapContainer,b.FBitmapName,false,0);
              if ((bmp != null) && !pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(bmp)) Result = bmp;
            };
          };
        };
      };
      return Result;
    };
    this.GetAspectSize = function (AWidth, AHeight, AOriginalWidth, AOriginalHeight, ANewWidth, ANewHeight, AAspectRatio, AStretch, ACropping) {
      var arc = 0.0;
      var ar = 0.0;
      if (AAspectRatio) {
        if ((AOriginalWidth > 0) && (AOriginalHeight > 0) && (ANewWidth > 0) && (ANewHeight > 0)) {
          if ((AOriginalWidth < ANewWidth) && (AOriginalHeight < ANewHeight) && !AStretch) {
            AWidth.set(AOriginalWidth);
            AHeight.set(AOriginalHeight);
          } else {
            if ((AOriginalWidth / AOriginalHeight) < (ANewWidth / ANewHeight)) {
              AHeight.set(ANewHeight);
              AWidth.set((ANewHeight * AOriginalWidth) / AOriginalHeight);
            } else {
              AWidth.set(ANewWidth);
              AHeight.set((ANewWidth * AOriginalHeight) / AOriginalWidth);
            };
          };
        } else {
          AWidth.set(0);
          AHeight.set(0);
        };
      } else {
        if (AStretch) {
          AWidth.set(ANewWidth);
          AHeight.set(ANewHeight);
        } else {
          AWidth.set(AOriginalWidth);
          AHeight.set(AOriginalHeight);
          if (ACropping) {
            if ((AWidth.get() >= AHeight.get()) && (AWidth.get() > 0)) {
              AHeight.set((AOriginalWidth / AWidth.get()) * AHeight.get());
              AWidth.set(AOriginalWidth);
            } else if ((AHeight.get() >= AWidth.get()) && (AHeight.get() > 0)) {
              AWidth.set((AOriginalHeight / AHeight.get()) * AWidth.get());
              AHeight.set(AOriginalHeight);
            };
            if (AHeight.get() === 0) {
              ar = 1}
             else ar = AWidth.get() / AHeight.get();
            if (AOriginalHeight === 0) {
              arc = 1}
             else arc = AOriginalWidth / AOriginalHeight;
            if ((ar < 1) || (arc > ar)) {
              AHeight.set(AOriginalWidth / ar);
              AWidth.set(AOriginalWidth);
            } else {
              AWidth.set(ar * AOriginalHeight);
              AHeight.set(AOriginalHeight);
            };
          };
        };
      };
    };
    this.DrawSample = function (ACanvas, ARect) {
      var g = null;
      g = $mod.TTMSFNCGraphics.$create("Create$1",[ACanvas,false]);
      try {
        g.FFont.SetName("Courier New");
        g.FFont.SetSize(20);
        g.FFont.SetColor(16777215);
        g.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient);
        g.FFill.SetColor(36095);
        g.FFill.SetColorTo(11829830);
        g.FStroke.SetColor(9109504);
        g.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        g.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),"Sample",false,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,true,false,-1,-1);
      } finally {
        g = rtl.freeLoc(g);
      };
    };
    this.SetDefaultGraphicColors = function () {
      $mod.TTMSFNCGraphics.DefaultPopupFillColor = 16777215;
      $mod.TTMSFNCGraphics.DefaultPopupStrokeColor = 12632256;
      $mod.TTMSFNCGraphics.DefaultButtonFillColor = pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(225,225,225);
      $mod.TTMSFNCGraphics.DefaultButtonStrokeColor = 11119017;
      $mod.TTMSFNCGraphics.DefaultTextFontColor = 0;
      $mod.TTMSFNCGraphics.DefaultSelectionFillColor = 0;
      $mod.TTMSFNCGraphics.DefaultButtonFillColorFocused = pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(229,241,251);
      $mod.TTMSFNCGraphics.DefaultButtonStrokeColorFocused = pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(60,127,177);
      $mod.TTMSFNCGraphics.DefaultButtonStrokeColorDisabled = 11119017;
      $mod.TTMSFNCGraphics.DefaultButtonFillColorDisabled = 13882323;
    };
    this.PointInCircle = function (APoint, ACenter, ARadius) {
      var Result = false;
      if (ARadius > 0) {
        Result = (pas.System.Sqr$1((APoint.X - ACenter.X) / ARadius) + pas.System.Sqr$1((APoint.Y - ACenter.Y) / ARadius)) <= 1}
       else Result = false;
      return Result;
    };
    this.PointInPath = function (APoint, APath) {
      var Result = false;
      Result = APath.IsPointVisible(APoint);
      return Result;
    };
    this.PointInPath$1 = function (APoint, APath) {
      var Result = false;
      Result = this.PointInPath(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].ConvertToPointF(APoint)),APath);
      return Result;
    };
    this.PointInPolygon = function (APoint, APolygon) {
      var Result = false;
      Result = pas["WEBLib.TMSFNCGraphicsTypes"].PointInPoly(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(APoint),rtl.arrayRef(APolygon));
      return Result;
    };
    this.PointInPolygon$1 = function (APoint, APolygon) {
      var Result = false;
      Result = this.PointInPolygon(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].ConvertToPointF(APoint)),rtl.arrayRef(APolygon));
      return Result;
    };
    this.PointInRect = function (APoint, ARect) {
      var Result = false;
      Result = pas["WEBLib.TMSFNCTypes"].PtInRectEx(ARect,APoint);
      return Result;
    };
    this.PointInRect$1 = function (APoint, ARect) {
      var Result = false;
      Result = this.PointInRect(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].ConvertToPointF(APoint)),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].ConvertToRectF(ARect)));
      return Result;
    };
    this.GetColorRed = function (AColor) {
      var Result = 0;
      AColor = pas["WEBLib.Graphics"].ColorToRGB(AColor);
      Result = pas["WEBLib.Graphics"].GetRValue(AColor);
      return Result;
    };
    this.GetColorGreen = function (AColor) {
      var Result = 0;
      AColor = pas["WEBLib.Graphics"].ColorToRGB(AColor);
      Result = pas["WEBLib.Graphics"].GetGValue(AColor);
      return Result;
    };
    this.GetColorBlue = function (AColor) {
      var Result = 0;
      AColor = pas["WEBLib.Graphics"].ColorToRGB(AColor);
      Result = pas["WEBLib.Graphics"].GetBValue(AColor);
      return Result;
    };
    var HTMLHexColor = "#RRGGBB";
    var HexDigit = ["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"];
    this.ColorToHTML = function (AColor) {
      var Result = "";
      var c = 0;
      var i = 0;
      i = 1;
      c = pas["WEBLib.Graphics"].ColorToRGB(AColor);
      Result = HTMLHexColor;
      Result = rtl.setCharAt(Result,(1 + i) - 1,HexDigit[this.GetColorRed(c) >>> 4]);
      Result = rtl.setCharAt(Result,(2 + i) - 1,HexDigit[this.GetColorRed(c) & 0xF]);
      Result = rtl.setCharAt(Result,(3 + i) - 1,HexDigit[this.GetColorGreen(c) >>> 4]);
      Result = rtl.setCharAt(Result,(4 + i) - 1,HexDigit[this.GetColorGreen(c) & 0xF]);
      Result = rtl.setCharAt(Result,(5 + i) - 1,HexDigit[this.GetColorBlue(c) >>> 4]);
      Result = rtl.setCharAt(Result,(6 + i) - 1,HexDigit[this.GetColorBlue(c) & 0xF]);
      return Result;
    };
    this.HTMLToColor = function (AHTML) {
      var Result = 0;
      var r = 0;
      var g = 0;
      var b = 0;
      Result = -1;
      if (AHTML === "") return Result;
      if (AHTML.length === 4) {
        r = pas.SysUtils.StrToInt("$" + pas.System.Copy(AHTML,2,1) + pas.System.Copy(AHTML,2,1));
        g = pas.SysUtils.StrToInt("$" + pas.System.Copy(AHTML,3,1) + pas.System.Copy(AHTML,3,1));
        b = pas.SysUtils.StrToInt("$" + pas.System.Copy(AHTML,4,1) + pas.System.Copy(AHTML,4,1));
      } else {
        r = pas.SysUtils.StrToInt("$" + pas.System.Copy(AHTML,2,2));
        g = pas.SysUtils.StrToInt("$" + pas.System.Copy(AHTML,4,2));
        b = pas.SysUtils.StrToInt("$" + pas.System.Copy(AHTML,6,2));
      };
      Result = pas["WEBLib.Graphics"].RGB(r,g,b);
      return Result;
    };
    this.TextToColor = function (AText) {
      var Result = 0;
      var s = "";
      var c = null;
      var v = null;
      s = AText;
      s = pas.SysUtils.LowerCase(s);
      if (pas.System.Pos("cl",s) === 1) pas.System.Delete({get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},1,2);
      if (pas.System.Pos("cla",s) === 1) pas.System.Delete({get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},1,3);
      if (pas.System.Pos("gc",s) === 1) pas.System.Delete({get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},1,2);
      Result = 0;
      c = pas["WEBLib.TMSFNCGraphicsTypes"].ColorLookup();
      if (c != null) {
        if (c.TryGetValue(s,{get: function () {
            return v;
          }, set: function (w) {
            v = w;
          }})) Result = v.FColor;
      };
      return Result;
    };
  });
  rtl.createInterface(this,"ITMSFNCGraphicsExport","{481CA803-8B50-4545-B212-57AC0D065D09}",["Export","ApplyExportScale","ResetExportScale","SetExportRect"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("Export",0,[["AGraphics",$mod.$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]]]);
    $r.addMethod("ApplyExportScale",0,[["AScale",rtl.double]]);
    $r.addMethod("ResetExportScale",0,[]);
    $r.addMethod("SetExportRect",0,[["AExportRect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]]]);
  });
  this.TMSFNCGRAPHICSCLOSE = "data:image/PNG;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJ" + "cEhZcwAACxIAAAsSAdLdfvwAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuOWwzfk4AAABVSURBVDhPYxh+" + "QBSI/0OYWAFIThjCxA5ACmAYHeCTQwHYFGITwwuQNSBjkgBFmkGAIgNAGv5BaZINQdYMA0Qbgk0zDBBlCCiR4FMA" + "khOCMIcJYGAAAHvVMBv6PIFYAAAAAElFTkSuQmCC";
  this.TMSFNCGRAPHICSDOWN = "data:image/PNG;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEwAACxMBA" + "JqcGAAAAGdJREFUOI3tzjsOwjAURNGDUqSgTxU5K2AVrJtswjUsgHSR0qdxAZZFPrS+3ZvRzBsqf9MUtBtazJk+oM" + "e0VTriiZCFX8nbpENMgfARjsn74vKj5IFruhfc8d6zIF9S/Hyk5HS4spMVeFcOjszaOwMAAAAASUVORK5CYII=";
  this.TMSFNCGRAPHICSDOWN2 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAA" + "RnQU1BAACxjwv8YQUAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMT" + "ZEaa/1AAAAdElEQVQ4T6XMsQ2AMBBD0UxBBwyA2L9jCWpY5bCLSJfgSFgUr+AHX4mIX2R0yOiQ0SGjQ8Ud5q7RCl" + "vX5IEDLlhS4/gGvuV/5YEJTuCAR+qYjW/N/81Hko8Mx/QKST0yHJOMCYfDMcnokNEho0NGh4zfRXkAxSYKjdpwcI" + "UAAAAASUVORK5CYII=";
  this.TMSFNCGRAPHICSUP = "data:image/PNG;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEwAACxMBAJq" + "cGAAAAEZJREFUOI3tjLEJACAMwLLo5EM+rTjpXV7g0oI4tYKbgYwJfJ6Txet4iu6Jxk10TTSuQACidzKAIrGik24ZpC" + "PeJ8ky+DhZ1JENPrPndiwAAAAASUVORK5CYII=";
  this.TMSFNCGRAPHICSUP2 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARn" + "QU1BAACxjwv8YQUAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa" + "/1AAAAcklEQVQ4T6XMMQ6AMAiF4S46eSEvremk5/IC+GggKfE1ER2+gZ9AEZFfaMygMYPGDBozaOyshu0aGo0eXmb4" + "hEbw42qGTx4B/HiHCWYYPgmDOWEDPfbmT46uNWEwC/THTp/oLvQwfEFjBo0ZNGbQ+J6UG5Y9CmuVGrAsAAAAAElFTkS" + "uQmCC";
  this.TMSFNCGRAPHICSPIN = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAARnQ" + "U1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1" + "AAABKklEQVQ4T2PAB0JDQ5mjoqIEgUxGiAiRIDo6WiY8PHwdEGvW19czQYUJA6AGhbCwsO9Aek1ISIiZvb09C1QKPwB" + "qaAbi/1DNJ4HYiqDNIE1ADZ9AGqGa/wLp6xERESZAaVQ/AyUUgDgIiOdCbQFrQsL/gPgxUM4OFACSQMYdIP4FFPwNxH" + "+gpqNoAortAYayHNSfjAwgNwMFvaCaMTQA8W+g+M7IyEgNiLuQAMgUoNsDgYruoWkCOe1gcHCwHlQpJgA6wwCo6DySJ" + "hD+BDQwCaoEEwA1SQAVzQLiq0BcBMRXgBhk25PAwEBJqDJUkJaWxgr0QzoQbwYqdABGNCeQrQPSDKTv44w3oFPEgYqm" + "Amk9UNqECjMCxWSBeAeUjx1ANWAkZCSD0AADAwDRpKHlJfOjAwAAAABJRU5ErkJggg==";
  this.TMSFNCGRAPHICSPIN2 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAARn" + "QU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa" + "/1AAAA/UlEQVQ4T33Su2oCQRTGcddLYWmlQhTLCBIsQgoLSW2nj2Bj7yv4DGkCeYOQxiaBNJapbCI2ooU+gY3gbf1/" + "w47MjosHfsvM7DlzY1JhGN6TQQGBM2bEOgke8IU60tGY4SYlqWGHT7wgC/PPT/SNoFDxH1owKyclWyrawsYJczwj8J" + "O1tR4+oFX8OGONtpLLWGCPA47Q7H78ogqd06yoPXeg4qQCTfaDR1x3ZxuapYsl3NDWJnjCtUjcThNTuKHL6cPNM2yj" + "hHfMMMQ/tNoGuoNYkeiTwwBjvCKPBlS8QuzFWPoU8QadQ29TY3qbFXxH/Ru2oYKbhww7kSdMXQD8wIToOQZE/AAAAA" + "BJRU5ErkJggg==";
  this.TMSFNCGRAPHICSRIGHT = "data:image/PNG;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEwAACxMB" + "AJqcGAAAAFNJREFUOI3tzzsSQFAQRNFDqSezHUuwYBJLsBuhEomE4/ll3HBq+nY1PxENRrS5xzK4L1jPSiISesxP" + "JcORJJqwU9xthjrX/ko4mpBQocN0tf1rbDeZDIfcSud0AAAAAElFTkSuQmCC";
  this.TMSFNCGRAPHICSLEFT = "data:image/PNG;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEwAACxMBA" + "JqcGAAAAEpJREFUOI3lzKENgEAQAMEJBkkIDdDTSxp6gqMyCkB8IQgMFdwZAutn+U19Bi84MUbxhZrBawSXB+8RDD" + "MaDkyvmQyZyYYuOvh6N24uDUKEV//MAAAAAElFTkSuQmCC";
  this.TMSFNCGRAPHICSEXPAND = "data:image/PNG;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOvwAADr8" + "BOAVTJAAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4zjOaXUAAAACVJREFUGFdj+P//P07MEBYW9h8Xxi" + "8JAjglYACnBAzglMAEDAwARZ1DA4NRF38AAAAASUVORK5CYII=";
  this.TMSFNCGRAPHICSEXPANDSVG = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d" + "3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMTJweC" + "IgaGVpZ2h0PSIxMnB4IiB2aWV3Qm94PSIwIDAgMTIgMTIiIHZlcnNpb249IjEuMSI+CjxnIGlkPSJzdXJmYWNlMSI+CjxwYXRoI" + "HN0eWxlPSIgc3Ryb2tlOm5vbmU7ZmlsbC1ydWxlOm5vbnplcm87ZmlsbDpyZ2IoMCUsMCUsMCUpO2ZpbGwtb3BhY2l0eToxOyIg" + "ZD0iTSAxMS44Mzk4NDQgMi44ODY3MTkgQyAxMS42Mjg5MDYgMi42NzU3ODEgMTEuMjgxMjUgMi42NzU3ODEgMTEuMDcwMzEyIDI" + "uODg2NzE5IEwgNiA3Ljk1NzAzMSBMIDAuOTI5Njg4IDIuODg2NzE5IEMgMC43MTg3NSAyLjY3NTc4MSAwLjM3MTA5NCAyLjY3NT" + "c4MSAwLjE2MDE1NiAyLjg4NjcxOSBDIC0wLjA1NDY4NzUgMy4xMDE1NjIgLTAuMDU0Njg3NSAzLjQ0NTMxMiAwLjE2MDE1NiAzL" + "jY2MDE1NiBMIDUuNjEzMjgxIDkuMTEzMjgxIEMgNS43MTQ4NDQgOS4yMTQ4NDQgNS44NTU0NjkgOS4yNzM0MzggNiA5LjI3MzQz" + "OCBDIDYuMTQ0NTMxIDkuMjczNDM4IDYuMjg1MTU2IDkuMjE0ODQ0IDYuMzg2NzE5IDkuMTEzMjgxIEwgMTEuODM5ODQ0IDMuNjY" + "wMTU2IEMgMTIuMDU0Njg4IDMuNDQ1MzEyIDEyLjA1NDY4OCAzLjEwMTU2MiAxMS44Mzk4NDQgMi44ODY3MTkgWiBNIDExLjgzOT" + "g0NCAyLjg4NjcxOSAiLz4KPC9nPgo8L3N2Zz4K";
  this.TMSFNCGRAPHICSDOWNSVG = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d" + "3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMTJweC" + "IgaGVpZ2h0PSIxMnB4IiB2aWV3Qm94PSIwIDAgMTIgMTIiIHZlcnNpb249IjEuMSI+CjxnIGlkPSJzdXJmYWNlMSI+CjxwYXRoI" + "HN0eWxlPSIgc3Ryb2tlOm5vbmU7ZmlsbC1ydWxlOm5vbnplcm87ZmlsbDpyZ2IoMCUsMCUsMCUpO2ZpbGwtb3BhY2l0eToxOyIg" + "ZD0iTSAxMS44Mzk4NDQgMi44ODY3MTkgQyAxMS42Mjg5MDYgMi42NzU3ODEgMTEuMjgxMjUgMi42NzU3ODEgMTEuMDcwMzEyIDI" + "uODg2NzE5IEwgNiA3Ljk1NzAzMSBMIDAuOTI5Njg4IDIuODg2NzE5IEMgMC43MTg3NSAyLjY3NTc4MSAwLjM3MTA5NCAyLjY3NT" + "c4MSAwLjE2MDE1NiAyLjg4NjcxOSBDIC0wLjA1NDY4NzUgMy4xMDE1NjIgLTAuMDU0Njg3NSAzLjQ0NTMxMiAwLjE2MDE1NiAzL" + "jY2MDE1NiBMIDUuNjEzMjgxIDkuMTEzMjgxIEMgNS43MTQ4NDQgOS4yMTQ4NDQgNS44NTU0NjkgOS4yNzM0MzggNiA5LjI3MzQz" + "OCBDIDYuMTQ0NTMxIDkuMjczNDM4IDYuMjg1MTU2IDkuMjE0ODQ0IDYuMzg2NzE5IDkuMTEzMjgxIEwgMTEuODM5ODQ0IDMuNjY" + "wMTU2IEMgMTIuMDU0Njg4IDMuNDQ1MzEyIDEyLjA1NDY4OCAzLjEwMTU2MiAxMS44Mzk4NDQgMi44ODY3MTkgWiBNIDExLjgzOT" + "g0NCAyLjg4NjcxOSAiLz4KPC9nPgo8L3N2Zz4K";
  this.TMSFNCGRAPHICSUPSVG = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3" + "dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMTJweCI" + "gaGVpZ2h0PSIxMnB4IiB2aWV3Qm94PSIwIDAgMTIgMTIiIHZlcnNpb249IjEuMSI+CjxnIGlkPSJzdXJmYWNlMSI+CjxwYXRoIH" + "N0eWxlPSIgc3Ryb2tlOm5vbmU7ZmlsbC1ydWxlOm5vbnplcm87ZmlsbDpyZ2IoMCUsMCUsMCUpO2ZpbGwtb3BhY2l0eToxOyIgZ" + "D0iTSAxMS44Mzk4NDQgOC4zMzk4NDQgTCA2LjM4NjcxOSAyLjg4NjcxOSBDIDYuMjg1MTU2IDIuNzg1MTU2IDYuMTQ0NTMxIDIu" + "NzI2NTYyIDYgMi43MjY1NjIgQyA1Ljg1NTQ2OSAyLjcyNjU2MiA1LjcxNDg0NCAyLjc4NTE1NiA1LjYxMzI4MSAyLjg4NjcxOSB" + "MIDAuMTYwMTU2IDguMzM5ODQ0IEMgLTAuMDU0Njg3NSA4LjU1NDY4OCAtMC4wNTQ2ODc1IDguODk4NDM4IDAuMTYwMTU2IDkuMT" + "EzMjgxIEMgMC4zNzEwOTQgOS4zMjQyMTkgMC43MTg3NSA5LjMyNDIxOSAwLjkyOTY4OCA5LjExMzI4MSBMIDYgNC4wNDI5NjkgT" + "CAxMS4wNzAzMTIgOS4xMTMyODEgQyAxMS4xNzU3ODEgOS4yMTg3NSAxMS4zMTY0MDYgOS4yNzM0MzggMTEuNDUzMTI1IDkuMjcz" + "NDM4IEMgMTEuNTkzNzUgOS4yNzM0MzggMTEuNzM0Mzc1IDkuMjE4NzUgMTEuODM5ODQ0IDkuMTEzMjgxIEMgMTIuMDU0Njg4IDg" + "uODk4NDM4IDEyLjA1NDY4OCA4LjU1NDY4OCAxMS44Mzk4NDQgOC4zMzk4NDQgWiBNIDExLjgzOTg0NCA4LjMzOTg0NCAiLz4KPC" + "9nPgo8L3N2Zz4K";
  this.TMSFNCGRAPHICSRIGHTSVG = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3" + "dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMTJweCI" + "gaGVpZ2h0PSIxMnB4IiB2aWV3Qm94PSIwIDAgMTIgMTIiIHZlcnNpb249IjEuMSI+CjxnIGlkPSJzdXJmYWNlMSI+CjxwYXRoIH" + "N0eWxlPSIgc3Ryb2tlOm5vbmU7ZmlsbC1ydWxlOm5vbnplcm87ZmlsbDpyZ2IoMCUsMCUsMCUpO2ZpbGwtb3BhY2l0eToxOyIgZ" + "D0iTSA5LjExMzI4MSA1LjYxMzI4MSBMIDMuNjYwMTU2IDAuMTYwMTU2IEMgMy40NDUzMTIgLTAuMDU0Njg3NSAzLjEwMTU2MiAt" + "MC4wNTQ2ODc1IDIuODg2NzE5IDAuMTYwMTU2IEMgMi42NzU3ODEgMC4zNzEwOTQgMi42NzU3ODEgMC43MTg3NSAyLjg4NjcxOSA" + "wLjkyOTY4OCBMIDcuOTU3MDMxIDYgTCAyLjg4NjcxOSAxMS4wNzAzMTIgQyAyLjY3NTc4MSAxMS4yODEyNSAyLjY3NTc4MSAxMS" + "42Mjg5MDYgMi44ODY3MTkgMTEuODM5ODQ0IEMgMi45OTIxODggMTEuOTQ1MzEyIDMuMTMyODEyIDEyIDMuMjczNDM4IDEyIEMgM" + "y40MTQwNjIgMTIgMy41NTA3ODEgMTEuOTQ1MzEyIDMuNjYwMTU2IDExLjgzOTg0NCBMIDkuMTEzMjgxIDYuMzg2NzE5IEMgOS4y" + "MTQ4NDQgNi4yODUxNTYgOS4yNzM0MzggNi4xNDQ1MzEgOS4yNzM0MzggNiBDIDkuMjczNDM4IDUuODU1NDY5IDkuMjE0ODQ0IDU" + "uNzE0ODQ0IDkuMTEzMjgxIDUuNjEzMjgxIFogTSA5LjExMzI4MSA1LjYxMzI4MSAiLz4KPC9nPgo8L3N2Zz4K";
  this.TMSFNCGRAPHICSLEFTSVG = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3" + "dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMTJweCI" + "gaGVpZ2h0PSIxMnB4IiB2aWV3Qm94PSIwIDAgMTIgMTIiIHZlcnNpb249IjEuMSI+CjxnIGlkPSJzdXJmYWNlMSI+CjxwYXRoIH" + "N0eWxlPSIgc3Ryb2tlOm5vbmU7ZmlsbC1ydWxlOm5vbnplcm87ZmlsbDpyZ2IoMCUsMCUsMCUpO2ZpbGwtb3BhY2l0eToxOyIgZ" + "D0iTSA0LjA0Mjk2OSA2IEwgOS4xMTMyODEgMC45Mjk2ODggQyA5LjMyNDIxOSAwLjcxODc1IDkuMzI0MjE5IDAuMzcxMDk0IDku" + "MTEzMjgxIDAuMTYwMTU2IEMgOC44OTg0MzggLTAuMDU0Njg3NSA4LjU1NDY4OCAtMC4wNTQ2ODc1IDguMzM5ODQ0IDAuMTYwMTU" + "2IEwgMi44ODY3MTkgNS42MTMyODEgQyAyLjc4NTE1NiA1LjcxNDg0NCAyLjcyNjU2MiA1Ljg1NTQ2OSAyLjcyNjU2MiA2IEMgMi" + "43MjY1NjIgNi4xNDQ1MzEgMi43ODUxNTYgNi4yODUxNTYgMi44ODY3MTkgNi4zODY3MTkgTCA4LjMzOTg0NCAxMS44Mzk4NDQgQ" + "yA4LjQ0OTIxOSAxMS45NDUzMTIgOC41ODU5MzggMTIgOC43MjY1NjIgMTIgQyA4Ljg2NzE4OCAxMiA5LjAwNzgxMiAxMS45NDUz" + "MTIgOS4xMTMyODEgMTEuODM5ODQ0IEMgOS4zMjQyMTkgMTEuNjI4OTA2IDkuMzI0MjE5IDExLjI4MTI1IDkuMTEzMjgxIDExLjA" + "3MDMxMiBaIE0gNC4wNDI5NjkgNiAiLz4KPC9nPgo8L3N2Zz4K";
  this.TMSFNCGRAPHICSCLOSESVG = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciI" + "HhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMTJweCIgaGVpZ2h0PSIxMnB4IiB2aWV3" + "Qm94PSIwIDAgMTIgMTIiIHZlcnNpb249IjEuMSI+CjxnIGlkPSJzdXJmYWNlMSI+CjxwYXRoIHN0eWxlPSIgc3Ryb2tlOm5vbmU" + "7ZmlsbC1ydWxlOm5vbnplcm87ZmlsbDpyZ2IoMCUsMCUsMCUpO2ZpbGwtb3BhY2l0eToxOyIgZD0iTSA3LjA2MjUgNiBMIDExLj" + "c4MTI1IDEuMjgxMjUgQyAxMi4wNzQyMTkgMC45ODgyODEgMTIuMDc0MjE5IDAuNTExNzE5IDExLjc4MTI1IDAuMjE4NzUgQyAxM" + "S40ODgyODEgLTAuMDc0MjE4OCAxMS4wMTE3MTkgLTAuMDc0MjE4OCAxMC43MTg3NSAwLjIxODc1IEwgNiA0LjkzNzUgTCAxLjI4" + "MTI1IDAuMjE4NzUgQyAwLjk4ODI4MSAtMC4wNzQyMTg4IDAuNTExNzE5IC0wLjA3NDIxODggMC4yMTg3NSAwLjIxODc1IEMgLTA" + "uMDc0MjE4OCAwLjUxMTcxOSAtMC4wNzQyMTg4IDAuOTg4MjgxIDAuMjE4NzUgMS4yODEyNSBMIDQuOTM3NSA2IEwgMC4yMTg3NS" + "AxMC43MTg3NSBDIC0wLjA3NDIxODggMTEuMDExNzE5IC0wLjA3NDIxODggMTEuNDg4MjgxIDAuMjE4NzUgMTEuNzgxMjUgQyAwL" + "jM2NzE4OCAxMS45MjU3ODEgMC41NTg1OTQgMTIgMC43NSAxMiBDIDAuOTQxNDA2IDEyIDEuMTMyODEyIDExLjkyNTc4MSAxLjI4" + "MTI1IDExLjc4MTI1IEwgNiA3LjA2MjUgTCAxMC43MTg3NSAxMS43ODEyNSBDIDEwLjg2NzE4OCAxMS45MjU3ODEgMTEuMDU4NTk" + "0IDEyIDExLjI1IDEyIEMgMTEuNDQxNDA2IDEyIDExLjYzMjgxMiAxMS45MjU3ODEgMTEuNzgxMjUgMTEuNzgxMjUgQyAxMi4wNz" + "QyMTkgMTEuNDg4MjgxIDEyLjA3NDIxOSAxMS4wMTE3MTkgMTEuNzgxMjUgMTAuNzE4NzUgWiBNIDcuMDYyNSA2ICIvPgo8L2c+C" + "jwvc3ZnPgo=";
  $mod.$init = function () {
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCGRAPHICSCLOSE);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCGRAPHICSDOWN);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCGRAPHICSRIGHT);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCGRAPHICSLEFT);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCGRAPHICSEXPAND);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCGRAPHICSPIN);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCGRAPHICSPIN2);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCGRAPHICSDOWN);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCGRAPHICSDOWN2);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCGRAPHICSUP);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCGRAPHICSUP2);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCGRAPHICSEXPANDSVG);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCGRAPHICSUPSVG);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCGRAPHICSRIGHTSVG);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCGRAPHICSLEFTSVG);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCGRAPHICSDOWNSVG);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCGRAPHICSCLOSESVG);
  };
},["SysUtils","Math","WEBLib.TMSFNCUtils","WEBLib.TMSFNCHTMLEngine","WEBLib.TMSFNCGraphics.General","WEBLib.TMSFNCGraphics.WEB"]);
rtl.module("WEBLib.TMSFNCUndo",["System","Classes","WEBLib.TMSFNCTypes"],function () {
  "use strict";
  var $mod = this;
  rtl.createClass(this,"TTMSFNCUndoStackItem",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FActionName = "";
      this.FState = null;
      this.FObj = null;
    };
    this.$final = function () {
      this.FState = undefined;
      this.FObj = undefined;
      pas.Classes.TCollectionItem.$final.call(this);
    };
    this.Create$1 = function (ACollection) {
      pas.Classes.TCollectionItem.Create$1.call(this,ACollection);
      this.FState = pas.Classes.TMemoryStream.$create("Create");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FState");
      pas.Classes.TCollectionItem.Destroy.call(this);
    };
  });
  rtl.createClass(this,"TTMSFNCUndoManager",pas.Classes.TCollection,function () {
    this.$init = function () {
      pas.Classes.TCollection.$init.call(this);
      this.FCurrent = 0;
      this.FObject = null;
      this.FMaxStackCount = 0;
    };
    this.$final = function () {
      this.FObject = undefined;
      pas.Classes.TCollection.$final.call(this);
    };
    this.GetStackItem = function (Index) {
      var Result = null;
      Result = null;
      if ((Index > -1) && (Index < this.GetCount())) Result = this.GetItem(Index);
      return Result;
    };
    this.NextUndoAction = function () {
      var Result = "";
      Result = "";
      if ((this.FCurrent > -1) && (this.FCurrent < this.GetCount())) Result = this.GetItem(this.FCurrent).FActionName;
      return Result;
    };
    this.NextRedoAction = function () {
      var Result = "";
      Result = "";
      if ((this.FCurrent >= -1) && (this.FCurrent < (this.GetCount() - 1))) Result = this.GetItem(this.FCurrent + 1).FActionName;
      return Result;
    };
    this.CanUndo = function () {
      var Result = false;
      Result = (this.FCurrent > 0) && (this.GetCount() > 0);
      return Result;
    };
    this.CanRedo = function () {
      var Result = false;
      Result = (this.FCurrent < (this.GetCount() - 1)) && (this.GetCount() > 0);
      return Result;
    };
    this.Undo = function () {
      var p = null;
      try {
        if ((this.FCurrent > 0) && (this.FCurrent <= this.GetCount())) {
          var $with = this.GetItem(this.FCurrent - 1);
          $with.FState.SetPosition(0);
          if (pas.SysUtils.Supports$3(this.FObject,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence.$guid,{get: function () {
              return p;
            }, set: function (v) {
              p = v;
            }})) {
            p.LoadSettingsFromStream($with.FState)}
           else pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.LoadSettingsFromStream(this.FObject,$with.FState);
          this.FCurrent -= 1;
        };
      } finally {
        rtl._Release(p);
      };
    };
    this.Redo = function () {
      var p = null;
      try {
        if ((this.FCurrent >= -1) && (this.FCurrent < (this.GetCount() - 1))) {
          var $with = this.GetItem(this.FCurrent + 1);
          $with.FState.SetPosition(0);
          if (pas.SysUtils.Supports$3(this.FObject,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence.$guid,{get: function () {
              return p;
            }, set: function (v) {
              p = v;
            }})) {
            p.LoadSettingsFromStream($with.FState)}
           else pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.LoadSettingsFromStream(this.FObject,$with.FState);
          this.FCurrent += 1;
        };
      } finally {
        rtl._Release(p);
      };
    };
    this.ClearUndoStack = function () {
      this.Clear();
      this.FCurrent = -1;
      this.PushState("");
    };
    this.PushState = function (AActionName) {
      var p = null;
      var it = null;
      try {
        while (this.FCurrent < (this.GetCount() - 1)) {
          it = this.GetItem(this.GetCount() - 1);
          it = rtl.freeLoc(it);
        };
        var $with = this.Add();
        $with.FActionName = AActionName;
        if (pas.SysUtils.Supports$3(this.FObject,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence.$guid,{get: function () {
            return p;
          }, set: function (v) {
            p = v;
          }})) {
          p.SaveSettingsToStream($with.FState,false)}
         else pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.SaveSettingsToStream(this.FObject,$with.FState);
        this.FCurrent += 1;
        if (this.GetCount() > this.FMaxStackCount) {
          this.Delete(0);
          this.FCurrent -= 1;
        };
      } finally {
        rtl._Release(p);
      };
    };
    this.Create$2 = function (AObject) {
      pas.Classes.TCollection.Create$1.call(this,$mod.TTMSFNCUndoStackItem);
      this.FObject = AObject;
      this.FMaxStackCount = 20;
      this.FCurrent = -1;
      return this;
    };
  });
},["SysUtils","WEBLib.TMSFNCPersistence"]);
rtl.module("WEBLib.TMSFNCEditorButton",["System","Classes","Types","WEBLib.TMSFNCTypes","WEBLib.Controls","WEBLib.StdCtrls","WEBLib.Forms","WEBLib.TMSFNCCustomControl","WEBLib.TMSFNCGraphics","WEBLib.TMSFNCGraphicsTypes","UITypes"],function () {
  "use strict";
  var $mod = this;
  this.MAJ_VER = 1;
  this.MIN_VER = 1;
  this.REL_VER = 0;
  this.BLD_VER = 0;
  this.$rtti.$Class("TTMSFNCEditorButtonAppearance");
  this.TTMSFNCEditorButtonPosition = {"0": "ebpAlone", ebpAlone: 0, "1": "ebpLeft", ebpLeft: 1, "2": "ebpTop", ebpTop: 2, "3": "ebpCenter", ebpCenter: 3, "4": "ebpRight", ebpRight: 4, "5": "ebpBottom", ebpBottom: 5};
  this.$rtti.$Enum("TTMSFNCEditorButtonPosition",{minvalue: 0, maxvalue: 5, ordtype: 1, enumtype: this.TTMSFNCEditorButtonPosition});
  rtl.createClass(this,"TTMSFNCCustomEditorButton",pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$init.call(this);
      this.FHover = false;
      this.FDown = false;
      this.FSelected = false;
      this.FAppearance = null;
      this.FText = "";
      this.FToggle = false;
      this.FButtonPosition = 0;
      this.FButtonPositionCorners = {};
      this.FModalResult = 0;
      this.FBitmap = null;
      this.FDisabledBitmap = null;
      this.FGroupName = "";
      this.FAcceleratorChar = "\x00";
      this.FAcceleratorCharPos = 0;
      this.FOnButtonClick = null;
      this.FBitmapMargins = null;
      this.FOnHandleAcceleratorKey = null;
      this.FDownBitmap = null;
    };
    this.$final = function () {
      this.FAppearance = undefined;
      this.FButtonPositionCorners = undefined;
      this.FBitmap = undefined;
      this.FDisabledBitmap = undefined;
      this.FOnButtonClick = undefined;
      this.FBitmapMargins = undefined;
      this.FOnHandleAcceleratorKey = undefined;
      this.FDownBitmap = undefined;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$final.call(this);
    };
    this.SetAppearance = function (Value) {
      this.FAppearance.Assign(Value);
      this.Invalidate();
    };
    this.SetText = function (Value) {
      if (this.FText !== Value) {
        this.FText = Value;
        this.SetAcceleratorChar(this.FText);
        this.Invalidate();
      };
    };
    this.SetToggle = function (Value) {
      if (this.FToggle !== Value) {
        this.FToggle = Value;
        this.Invalidate();
      };
    };
    this.SetSelected = function (Value) {
      if (this.FSelected !== Value) {
        this.FSelected = Value;
        if (this.FGroupName !== "") this.UpdateOtherGroupButtons();
        this.Invalidate();
      };
    };
    this.SetButtonPosition = function (Value) {
      if (this.FButtonPosition !== Value) {
        this.FButtonPosition = Value;
        this.SetButtonPositionCorners();
        this.Invalidate();
      };
    };
    this.SetButtonPositionCorners = function () {
      var $tmp = this.FButtonPosition;
      if ($tmp === $mod.TTMSFNCEditorButtonPosition.ebpLeft) {
        this.FButtonPositionCorners = rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft)}
       else if ($tmp === $mod.TTMSFNCEditorButtonPosition.ebpCenter) {
        this.FButtonPositionCorners = {}}
       else if ($tmp === $mod.TTMSFNCEditorButtonPosition.ebpRight) {
        this.FButtonPositionCorners = rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight)}
       else if ($tmp === $mod.TTMSFNCEditorButtonPosition.ebpTop) {
        this.FButtonPositionCorners = rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight)}
       else if ($tmp === $mod.TTMSFNCEditorButtonPosition.ebpBottom) {
        this.FButtonPositionCorners = rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight)}
       else {
        this.FButtonPositionCorners = rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight);
      };
    };
    this.SetBitmap = function (Value) {
      this.FBitmap.Assign(Value);
      this.DoBitmapChanged$1(this);
    };
    this.SetDisabledBitmap = function (Value) {
      this.FDisabledBitmap.Assign(Value);
      this.DoBitmapChanged$1(this);
    };
    this.SetGroupName = function (Value) {
      if (this.FGroupName !== Value) {
        this.FGroupName = Value;
      };
    };
    this.UpdateOtherGroupButtons = function () {
      var I = 0;
      for (var $l = 0, $end = this.FParent.GetControlsCount() - 1; $l <= $end; $l++) {
        I = $l;
        if ($mod.TTMSFNCCustomEditorButton.isPrototypeOf(this.FParent.GetControls(I)) && (this.FParent.GetControls(I).GetComponentIndex() !== this.GetComponentIndex())) {
          if ((rtl.as(this.FParent.GetControls(I),$mod.TTMSFNCCustomEditorButton).FGroupName === this.FGroupName) && rtl.as(this.FParent.GetControls(I),$mod.TTMSFNCCustomEditorButton).FToggle) {
            rtl.as(this.FParent.GetControls(I),$mod.TTMSFNCCustomEditorButton).SetSelectedByToggle(false);
          };
        };
      };
    };
    this.SetAcceleratorChar = function (AText) {
      var c = "\x00";
      this.FAcceleratorCharPos = pas.System.Pos("&",this.FText);
      if (this.FAcceleratorCharPos > 0) {
        c = pas.SysUtils.LowerCase(this.FText).charAt((this.FAcceleratorCharPos + 1) - 1);
        if (c !== this.FAcceleratorChar) {
          this.FAcceleratorChar = pas.SysUtils.LowerCase(this.FText).charAt((this.FAcceleratorCharPos + 1) - 1);
        };
      };
    };
    this.SetBitmapMargins = function (Value) {
      this.FBitmapMargins.Assign(Value);
    };
    this.SetDownBitmap = function (Value) {
      this.FDownBitmap.Assign(Value);
      this.DoBitmapChanged$1(this);
    };
    this.ChangeDPIScale = function (M, D) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ChangeDPIScale.apply(this,arguments);
      this.BeginUpdate();
      this.FAppearance.FRounding = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FAppearance.FRounding,M,D);
      this.FAppearance.FSelectionLineWidth = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FAppearance.FSelectionLineWidth,M,D);
      this.FAppearance.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FAppearance.FFont.FHeight,M,D));
      this.FAppearance.FHoverFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FAppearance.FHoverFont.FHeight,M,D));
      this.FAppearance.FDownFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FAppearance.FDownFont.FHeight,M,D));
      this.FAppearance.FSelectedFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FAppearance.FSelectedFont.FHeight,M,D));
      this.FAppearance.FDisabledFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FAppearance.FDisabledFont.FHeight,M,D));
      this.FAppearance.FStroke.SetWidth((this.FAppearance.FStroke.FWidth * M) / D);
      this.FAppearance.FSelectedStroke.SetWidth(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FAppearance.FSelectedStroke.FWidth,M,D));
      this.FAppearance.FHoverStroke.SetWidth(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FAppearance.FHoverStroke.FWidth,M,D));
      this.FAppearance.FDownStroke.SetWidth(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FAppearance.FDownStroke.FWidth,M,D));
      this.FAppearance.FDisabledStroke.SetWidth(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FAppearance.FDisabledStroke.FWidth,M,D));
      this.FBitmapMargins.SetTop(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FBitmapMargins.FTop,M,D));
      this.FBitmapMargins.SetLeft(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FBitmapMargins.FLeft,M,D));
      this.FBitmapMargins.SetRight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FBitmapMargins.FRight,M,D));
      this.FBitmapMargins.SetBottom(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FBitmapMargins.FBottom,M,D));
      this.EndUpdate();
    };
    this.SetSelectedByToggle = function (AValue) {
      this.FSelected = AValue;
      this.Invalidate();
    };
    this.DoButtonClick = function () {
      if (this.FOnButtonClick != null) this.FOnButtonClick(this);
    };
    this.HandleMouseDown = function (Button, Shift, X, Y) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseDown.apply(this,arguments);
      if (this.FEnabled) {
        this.FDown = true;
        this.Invalidate();
      };
    };
    this.HandleMouseEnter = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseEnter.call(this);
      if (this.FEnabled) {
        this.FHover = true;
        this.Invalidate();
      };
    };
    this.HandleMouseLeave = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseLeave.call(this);
      this.FHover = false;
      this.Invalidate();
    };
    this.HandleMouseMove = function (Shift, X, Y) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseMove.apply(this,arguments);
      if (this.FEnabled && !this.FHover) {
        this.FHover = true;
        this.Invalidate();
      };
    };
    this.HandleMouseUp = function (Button, Shift, X, Y) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseUp.apply(this,arguments);
      if (this.FEnabled) {
        if (this.FToggle) this.SetSelected(!this.FSelected);
        if (this.FDown) {
          if (this.FModalResult !== 0) ;
          this.DoButtonClick();
        };
      };
      this.FDown = false;
      this.Invalidate();
    };
    this.DoAppearanceChanged = function (Sender) {
      this.Invalidate();
    };
    this.DoBitmapChanged$1 = function (Sender) {
      this.Invalidate();
    };
    this.DoBitmapMarginsChanged = function (Sender) {
      this.Invalidate();
    };
    this.Draw = function (AGraphics, ARect) {
      this.DrawStandardBackGround(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect));
      this.DrawSelectionLine(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect));
      this.DrawButtonImage(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect));
      this.DrawButtonText(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect));
    };
    this.DrawStandardBackGround = function (AGraphics, ARect) {
      var drect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rounding = 0;
      if (!this.FEnabled) {
        AGraphics.FFill.Assign(this.FAppearance.FDisabledFill);
        AGraphics.FStroke.Assign(this.FAppearance.FDisabledStroke);
      } else if (this.FAppearance.FSelectionLine) {
        AGraphics.FFill.Assign(this.FAppearance.FFill);
        AGraphics.FStroke.Assign(this.FAppearance.FStroke);
      } else if (this.FSelected) {
        AGraphics.FFill.Assign(this.FAppearance.FSelectedFill);
        AGraphics.FStroke.Assign(this.FAppearance.FSelectedStroke);
      } else if (this.FDown) {
        AGraphics.FFill.Assign(this.FAppearance.FDownFill);
        AGraphics.FStroke.Assign(this.FAppearance.FDownStroke);
      } else if (this.FHover) {
        AGraphics.FFill.Assign(this.FAppearance.FHoverFill);
        AGraphics.FStroke.Assign(this.FAppearance.FHoverStroke);
      } else {
        AGraphics.FFill.Assign(this.FAppearance.FFill);
        AGraphics.FStroke.Assign(this.FAppearance.FStroke);
      };
      AGraphics.FStroke.SetWidth(pas.System.Trunc(AGraphics.FStroke.FWidth));
      drect.$assign(ARect);
      rounding = Math.min(this.FAppearance.FRounding,Math.round(this.GetHeight() / 2));
      AGraphics.DrawRoundRectangle$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(drect),rounding,rtl.refSet(this.FButtonPositionCorners),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
    };
    this.DrawSelectionLine = function (AGraphics, ARect) {
      var drect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rounding = 0;
      var sw = 0.0;
      if ((this.FSelected || this.FDown || this.FHover) && this.FAppearance.FSelectionLine) {
        if (this.FSelected) {
          AGraphics.FFill.Assign(this.FAppearance.FSelectedFill);
          AGraphics.FFont.Assign(this.FAppearance.FSelectedFont);
          AGraphics.FStroke.Assign(this.FAppearance.FSelectedStroke);
        } else if (this.FDown) {
          AGraphics.FFill.Assign(this.FAppearance.FDownFill);
          AGraphics.FFont.Assign(this.FAppearance.FDownFont);
          AGraphics.FStroke.Assign(this.FAppearance.FDownStroke);
        } else if (this.FHover) {
          AGraphics.FFill.Assign(this.FAppearance.FHoverFill);
          AGraphics.FFont.Assign(this.FAppearance.FHoverFont);
          AGraphics.FStroke.Assign(this.FAppearance.FHoverStroke);
        };
        AGraphics.FStroke.SetWidth(pas.System.Trunc(AGraphics.FStroke.FWidth));
        if (AGraphics.FStroke.FKind !== pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone) {
          sw = AGraphics.FStroke.FWidth}
         else sw = 0;
        drect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARect.Left,ARect.Bottom - sw - pas.System.Trunc(this.FAppearance.FSelectionLineWidth),ARect.Right,ARect.Bottom - sw));
        rounding = Math.round(Math.min(this.FAppearance.FRounding / 2,(drect.Bottom - drect.Top) / 2));
        if (this.FButtonPosition in rtl.createSet($mod.TTMSFNCEditorButtonPosition.ebpAlone,$mod.TTMSFNCEditorButtonPosition.ebpLeft)) drect.Left = drect.Left + rounding;
        if (this.FButtonPosition in rtl.createSet($mod.TTMSFNCEditorButtonPosition.ebpAlone,$mod.TTMSFNCEditorButtonPosition.ebpRight)) drect.Right = drect.Right - rounding;
        AGraphics.DrawRoundRectangle$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(drect),rounding,rtl.refSet(this.FButtonPositionCorners),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
      };
    };
    this.DrawBackground = function (AGraphics, ARect) {
    };
    this.DrawButtonText = function (AGraphics, ARect) {
      var txt = "";
      var tr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var va = 0;
      var ha = 0;
      var ww = false;
      var ro = 0;
      var cw = 0.0;
      var cs = 0.0;
      var rw = 0.0;
      var w = 0.0;
      var h = 0.0;
      if (this.FText !== "") {
        if (!this.FEnabled) {
          AGraphics.FFont.Assign(this.FAppearance.FDisabledFont)}
         else if (this.FAppearance.FSelectionLine) {
          AGraphics.FFont.Assign(this.FAppearance.FFont)}
         else if (this.FSelected) {
          AGraphics.FFont.Assign(this.FAppearance.FSelectedFont)}
         else if (this.FDown) {
          AGraphics.FFont.Assign(this.FAppearance.FDownFont)}
         else if (this.FHover) {
          AGraphics.FFont.Assign(this.FAppearance.FHoverFont)}
         else AGraphics.FFont.Assign(this.FAppearance.FFont);
        cs = 0;
        cw = 0;
        ww = false;
        ha = this.FAppearance.FTextAlignHorizontal;
        va = this.FAppearance.FTextAlignVertical;
        tr.$assign(ARect);
        if (this.FShowAcceleratorChar && (this.FAcceleratorCharPos > 0)) {
          txt = pas.SysUtils.StringReplace(this.FText,"&","",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
          if (this.FAcceleratorCharPos > 1) cs = AGraphics.CalculateTextWidth$1(pas.System.Copy(txt,0,this.FAcceleratorCharPos - 1));
          cw = AGraphics.CalculateTextWidth$1(txt.charAt(this.FAcceleratorCharPos - 1));
        } else txt = this.FText;
        ro = Math.min(this.FAppearance.FRounding,Math.round(this.GetHeight() / 2));
        w = AGraphics.CalculateTextWidth$1(txt) + 2;
        h = AGraphics.CalculateTextHeight$1("Hg");
        tr.Left = tr.Left + (ro / 4);
        tr.Right = tr.Right - (ro / 4);
        tr.Top = tr.Top + (ro / 4);
        tr.Bottom = tr.Bottom - (ro / 4);
        var $tmp = ha;
        if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter) {
          rw = tr.Right - tr.Left;
          tr.Left = Math.max(tr.Left,tr.Left + ((rw - w) / 2));
          tr.Right = Math.min(tr.Right,tr.Left + w);
        } else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading) {
          tr.Right = tr.Left + w;
        } else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaTrailing) {
          tr.Left = tr.Right - w;
        };
        var $tmp1 = va;
        if ($tmp1 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter) {
          rw = tr.Bottom - tr.Top;
          tr.Top = Math.max(tr.Top,tr.Top + ((rw - h) / 2));
          tr.Bottom = Math.min(tr.Bottom,tr.Top + h);
        } else if ($tmp1 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading) {
          tr.Bottom = tr.Top + h;
        } else if ($tmp1 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaTrailing) {
          tr.Top = tr.Bottom - h;
        };
        AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(tr),txt,ww,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,true,false,-1,-1);
        if (this.FShowAcceleratorChar && (this.FAcceleratorCharPos > 0) && !(this.FSelected || this.FDown)) {
          AGraphics.FStroke.SetWidth(pas.System.Trunc(this.ScalePaintValue$1(1.0)));
          AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
          AGraphics.FStroke.SetColor(AGraphics.FFont.FColor);
          AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(tr.Left + cs,tr.Bottom)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(tr.Left + cs + cw,tr.Bottom)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
        };
      };
    };
    this.DrawButtonImage = function (AGraphics, ARect) {
      var ir = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var ar = false;
      var s = false;
      var ro = 0;
      var bmp = null;
      if (!this.FEnabled && !pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(this.FDisabledBitmap)) {
        bmp = this.FDisabledBitmap}
       else if (!pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(this.FDownBitmap) && this.FDown) {
        bmp = this.FDownBitmap}
       else bmp = this.FBitmap;
      if (!pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(bmp)) {
        ar = true;
        s = true;
        ro = Math.min(this.FAppearance.FRounding,Math.round(Math.min(this.GetHeight() / 2,this.GetWidth() / 2)));
        ir.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARect.Left + Math.max(this.FBitmapMargins.FLeft,ro / 8),ARect.Top + Math.max(this.FBitmapMargins.FTop,ro / 8),ARect.Right - Math.max(this.FBitmapMargins.FRight,ro / 8),ARect.Bottom - Math.max(this.FBitmapMargins.FBottom,ro / 8)));
        AGraphics.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ir),bmp,ar,s,true,false);
      };
    };
    this.UpdateControlAfterResize = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.UpdateControlAfterResize.call(this);
    };
    this.HandleAcceleratorKey = function () {
      if (this.FOnHandleAcceleratorKey != null) {
        this.FOnHandleAcceleratorKey(this)}
       else if (this.FOnClick != null) this.FOnClick(this);
    };
    this.SetEnabled = function (Value) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.SetEnabled.apply(this,arguments);
      this.Invalidate();
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Create$1.apply(this,arguments);
      this.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
      this.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
      this.FTransparent = true;
      this.FAppearance = $mod.TTMSFNCEditorButtonAppearance.$create("Create$1",[this]);
      this.FAppearance.FOnChanged = rtl.createCallback(this,"DoAppearanceChanged");
      this.FBitmap = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      this.FBitmap.FOnChange = rtl.createCallback(this,"DoBitmapChanged$1");
      this.FDownBitmap = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      this.FBitmap.FOnChange = rtl.createCallback(this,"DoBitmapChanged$1");
      this.FBitmapMargins = pas["WEBLib.TMSFNCTypes"].TTMSFNCMargins.$create("Create$1");
      this.FBitmapMargins.FOnChange = rtl.createCallback(this,"DoBitmapMarginsChanged");
      this.FDisabledBitmap = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      this.FDisabledBitmap.FOnChange = rtl.createCallback(this,"DoBitmapChanged$1");
      this.FText = "Button";
      this.FButtonPositionCorners = rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight);
      this.FButtonPosition = $mod.TTMSFNCEditorButtonPosition.ebpAlone;
      this.SetWidth(80);
      this.SetHeight(25);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FAppearance");
      rtl.free(this,"FBitmap");
      rtl.free(this,"FDownBitmap");
      rtl.free(this,"FBitmapMargins");
      rtl.free(this,"FDisabledBitmap");
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Destroy.call(this);
    };
    this.Assign = function (Source) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Assign.apply(this,arguments);
    };
    this.BeginUpdate = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBase.BeginUpdate.call(this);
    };
    this.EndUpdate = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBase.EndUpdate.call(this);
      this.Invalidate();
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCEditorButtonAppearance",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FOwner = null;
      this.FDownStroke = null;
      this.FFont = null;
      this.FSelectedFill = null;
      this.FHoverFont = null;
      this.FFill = null;
      this.FSelectedStroke = null;
      this.FHoverFill = null;
      this.FStroke = null;
      this.FDownFont = null;
      this.FHoverStroke = null;
      this.FOnChanged = null;
      this.FDownFill = null;
      this.FSelectedFont = null;
      this.FRounding = 0;
      this.FTextAlignVertical = 0;
      this.FTextAlignHorizontal = 0;
      this.FSelectionLine = false;
      this.FSelectionLineWidth = 0.0;
      this.FDisabledFont = null;
      this.FDisabledFill = null;
      this.FDisabledStroke = null;
    };
    this.$final = function () {
      this.FOwner = undefined;
      this.FDownStroke = undefined;
      this.FFont = undefined;
      this.FSelectedFill = undefined;
      this.FHoverFont = undefined;
      this.FFill = undefined;
      this.FSelectedStroke = undefined;
      this.FHoverFill = undefined;
      this.FStroke = undefined;
      this.FDownFont = undefined;
      this.FHoverStroke = undefined;
      this.FOnChanged = undefined;
      this.FDownFill = undefined;
      this.FSelectedFont = undefined;
      this.FDisabledFont = undefined;
      this.FDisabledFill = undefined;
      this.FDisabledStroke = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetDownFill = function (Value) {
      this.FDownFill.Assign(Value);
      this.DoFillChanged(this);
    };
    this.SetDownFont = function (Value) {
      this.FDownFont.Assign(Value);
      this.DoFontChanged(this);
    };
    this.SetDownStroke = function (Value) {
      this.FDownStroke.Assign(Value);
      this.DoStrokeChanged(this);
    };
    this.SetFill = function (Value) {
      this.FFill.Assign(Value);
      this.DoFillChanged(this);
    };
    this.SetFont = function (Value) {
      this.FFont.Assign(Value);
      this.DoFontChanged(this);
    };
    this.SetHoverFill = function (Value) {
      this.FHoverFill.Assign(Value);
      this.DoFillChanged(this);
    };
    this.SetHoverFont = function (Value) {
      this.FHoverFont.Assign(Value);
      this.DoFontChanged(this);
    };
    this.SetHoverStroke = function (Value) {
      this.FHoverStroke.Assign(Value);
      this.DoStrokeChanged(this);
    };
    this.SetSelectedFill = function (Value) {
      this.FSelectedFill.Assign(Value);
      this.DoFillChanged(this);
    };
    this.SetSelectedFont = function (Value) {
      this.FSelectedFont.Assign(Value);
      this.DoFontChanged(this);
    };
    this.SetSelectedStroke = function (Value) {
      this.FSelectedStroke.Assign(Value);
      this.DoStrokeChanged(this);
    };
    this.SetStroke = function (Value) {
      this.FStroke.Assign(Value);
      this.DoStrokeChanged(this);
    };
    this.SetRounding = function (Value) {
      if (this.FRounding !== Value) {
        this.FRounding = Value;
        this.DoChanged(this);
      };
    };
    this.SetTextAlignHorizontal = function (Value) {
      if (this.FTextAlignHorizontal !== Value) {
        this.FTextAlignHorizontal = Value;
        this.DoChanged(this);
      };
    };
    this.SetTextAlignVertical = function (Value) {
      if (this.FTextAlignVertical !== Value) {
        this.FTextAlignVertical = Value;
        this.DoChanged(this);
      };
    };
    this.SetSelectionLine = function (Value) {
      if (this.FSelectionLine !== Value) {
        this.FSelectionLine = Value;
        this.DoChanged(this);
      };
    };
    this.SetSelectionLineWidth = function (Value) {
      if (this.FSelectionLineWidth !== Value) {
        this.FSelectionLineWidth = Value;
        this.DoChanged(this);
      };
    };
    this.SetDisabledFill = function (Value) {
      this.FDisabledFill.Assign(Value);
      this.DoFillChanged(this);
    };
    this.SetDisabledFont = function (Value) {
      this.FDisabledFont.Assign(Value);
      this.DoFontChanged(this);
    };
    this.SetDisabledStroke = function (Value) {
      this.FDisabledStroke.Assign(Value);
      this.DoStrokeChanged(this);
    };
    this.DoChanged = function (Sender) {
      if (this.FOnChanged != null) this.FOnChanged(this);
    };
    this.DoFillChanged = function (Sender) {
      this.DoChanged(Sender);
    };
    this.DoFontChanged = function (Sender) {
      this.DoChanged(Sender);
    };
    this.DoStrokeChanged = function (Sender) {
      this.DoChanged(Sender);
    };
    this.Create$1 = function (AOwner) {
      this.FOwner = AOwner;
      this.FSelectionLine = false;
      this.FSelectionLineWidth = 4;
      this.FRounding = 6;
      this.FFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16777215,8421504,-1,-1]);
      this.FFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,12632256,1.0]);
      this.FHoverFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor("#4edbfa"),8421504,-1,-1]);
      this.FHoverFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FHoverStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor("#1BADF8"),1.0]);
      this.FDownFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor("#1BADF8"),8421504,-1,-1]);
      this.FDownFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FDownStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor("#4edbfa"),1.0]);
      this.FSelectedFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor("#1BADF8"),8421504,-1,-1]);
      this.FSelectedFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FSelectedStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor("#1BADF8"),1.0]);
      this.FDisabledFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16777215,8421504,-1,-1]);
      this.FDisabledFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FDisabledFont.SetColor(10789024);
      this.FDisabledStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,10789024,1.0]);
      this.FFill.FOnChanged = rtl.createCallback(this,"DoFillChanged");
      this.FFont.FOnChanged = rtl.createCallback(this,"DoFontChanged");
      this.FStroke.FOnChanged = rtl.createCallback(this,"DoStrokeChanged");
      this.FDisabledFill.FOnChanged = rtl.createCallback(this,"DoFillChanged");
      this.FDisabledFont.FOnChanged = rtl.createCallback(this,"DoFontChanged");
      this.FDisabledStroke.FOnChanged = rtl.createCallback(this,"DoStrokeChanged");
      this.FHoverFill.FOnChanged = rtl.createCallback(this,"DoFillChanged");
      this.FHoverFont.FOnChanged = rtl.createCallback(this,"DoFontChanged");
      this.FHoverStroke.FOnChanged = rtl.createCallback(this,"DoStrokeChanged");
      this.FDownFill.FOnChanged = rtl.createCallback(this,"DoFillChanged");
      this.FDownFont.FOnChanged = rtl.createCallback(this,"DoFontChanged");
      this.FDownStroke.FOnChanged = rtl.createCallback(this,"DoStrokeChanged");
      this.FSelectedFill.FOnChanged = rtl.createCallback(this,"DoFillChanged");
      this.FSelectedFont.FOnChanged = rtl.createCallback(this,"DoFontChanged");
      this.FSelectedStroke.FOnChanged = rtl.createCallback(this,"DoStrokeChanged");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FFill");
      rtl.free(this,"FFont");
      rtl.free(this,"FStroke");
      rtl.free(this,"FHoverFill");
      rtl.free(this,"FHoverFont");
      rtl.free(this,"FHoverStroke");
      rtl.free(this,"FDownFill");
      rtl.free(this,"FDownFont");
      rtl.free(this,"FDownStroke");
      rtl.free(this,"FSelectedFill");
      rtl.free(this,"FSelectedFont");
      rtl.free(this,"FSelectedStroke");
      rtl.free(this,"FDisabledFill");
      rtl.free(this,"FDisabledFont");
      rtl.free(this,"FDisabledStroke");
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCEditorButtonAppearance.isPrototypeOf(Source)) {
        this.FSelectionLine = rtl.as(Source,$mod.TTMSFNCEditorButtonAppearance).FSelectionLine;
        this.FSelectionLineWidth = rtl.as(Source,$mod.TTMSFNCEditorButtonAppearance).FSelectionLineWidth;
        this.FRounding = rtl.as(Source,$mod.TTMSFNCEditorButtonAppearance).FRounding;
        this.FFill.Assign(rtl.as(Source,$mod.TTMSFNCEditorButtonAppearance).FFill);
        this.FFont.Assign(rtl.as(Source,$mod.TTMSFNCEditorButtonAppearance).FFont);
        this.FStroke.Assign(rtl.as(Source,$mod.TTMSFNCEditorButtonAppearance).FStroke);
        this.FHoverFill.Assign(rtl.as(Source,$mod.TTMSFNCEditorButtonAppearance).FHoverFill);
        this.FHoverFont.Assign(rtl.as(Source,$mod.TTMSFNCEditorButtonAppearance).FHoverFont);
        this.FHoverStroke.Assign(rtl.as(Source,$mod.TTMSFNCEditorButtonAppearance).FHoverStroke);
        this.FDownFill.Assign(rtl.as(Source,$mod.TTMSFNCEditorButtonAppearance).FDownFill);
        this.FDownFont.Assign(rtl.as(Source,$mod.TTMSFNCEditorButtonAppearance).FDownFont);
        this.FDownStroke.Assign(rtl.as(Source,$mod.TTMSFNCEditorButtonAppearance).FDownStroke);
        this.FSelectedFill.Assign(rtl.as(Source,$mod.TTMSFNCEditorButtonAppearance).FSelectedFill);
        this.FSelectedFont.Assign(rtl.as(Source,$mod.TTMSFNCEditorButtonAppearance).FSelectedFont);
        this.FSelectedStroke.Assign(rtl.as(Source,$mod.TTMSFNCEditorButtonAppearance).FSelectedStroke);
        this.FDisabledFill.Assign(rtl.as(Source,$mod.TTMSFNCEditorButtonAppearance).FDisabledFill);
        this.FDisabledFont.Assign(rtl.as(Source,$mod.TTMSFNCEditorButtonAppearance).FDisabledFont);
        this.FDisabledStroke.Assign(rtl.as(Source,$mod.TTMSFNCEditorButtonAppearance).FDisabledStroke);
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    var $r = this.$rtti;
    $r.addProperty("Fill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFill","SetFill");
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
    $r.addProperty("DisabledFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FDisabledFill","SetDisabledFill");
    $r.addProperty("DisabledFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FDisabledFont","SetDisabledFont");
    $r.addProperty("DisabledStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FDisabledStroke","SetDisabledStroke");
    $r.addProperty("HoverFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FHoverFill","SetHoverFill");
    $r.addProperty("HoverFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FHoverFont","SetHoverFont");
    $r.addProperty("HoverStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FHoverStroke","SetHoverStroke");
    $r.addProperty("DownFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FDownFill","SetDownFill");
    $r.addProperty("DownFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FDownFont","SetDownFont");
    $r.addProperty("DownStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FDownStroke","SetDownStroke");
    $r.addProperty("SelectedFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FSelectedFill","SetSelectedFill");
    $r.addProperty("SelectedFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FSelectedFont","SetSelectedFont");
    $r.addProperty("SelectedStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FSelectedStroke","SetSelectedStroke");
    $r.addProperty("Font",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FFont","SetFont");
    $r.addProperty("Rounding",2,rtl.longint,"FRounding","SetRounding");
    $r.addProperty("TextAlignHorizontal",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FTextAlignHorizontal","SetTextAlignHorizontal",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter});
    $r.addProperty("TextAlignVertical",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FTextAlignVertical","SetTextAlignVertical",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter});
    $r.addProperty("SelectionLine",2,rtl.boolean,"FSelectionLine","SetSelectionLine");
    $r.addProperty("SelectionLineWidth",2,rtl.double,"FSelectionLineWidth","SetSelectionLineWidth");
  });
  rtl.createClass(this,"TTMSFNCEditorButton",this.TTMSFNCCustomEditorButton,function () {
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Appearance",2,$mod.$rtti["TTMSFNCEditorButtonAppearance"],"FAppearance","SetAppearance");
    $r.addProperty("DisabledBitmap",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FDisabledBitmap","SetDisabledBitmap");
    $r.addProperty("GroupName",2,rtl.string,"FGroupName","SetGroupName");
    $r.addProperty("Text",2,rtl.string,"FText","SetText");
    $r.addProperty("Toggle",2,rtl.boolean,"FToggle","SetToggle");
    $r.addProperty("Selected",2,rtl.boolean,"FSelected","SetSelected");
    $r.addProperty("Bitmap",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FBitmap","SetBitmap");
    $r.addProperty("BitmapMargins",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCMargins"],"FBitmapMargins","SetBitmapMargins");
    $r.addProperty("ButtonPosition",2,$mod.$rtti["TTMSFNCEditorButtonPosition"],"FButtonPosition","SetButtonPosition",4,{Default: $mod.TTMSFNCEditorButtonPosition.ebpAlone});
    $r.addProperty("ModalResult",0,rtl.longint,"FModalResult","FModalResult",4,{Default: 0});
    $r.addProperty("Hint",2,rtl.string,"FHint","SetHint");
    $r.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",4,{Default: false});
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnButtonClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnButtonClick","FOnButtonClick");
    $r.addProperty("OnHandleAcceleratorKey",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnHandleAcceleratorKey","FOnHandleAcceleratorKey");
    $r.addProperty("DownBitmap",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FDownBitmap","SetDownBitmap");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
},["TypInfo","SysUtils","WEBLib.TMSFNCUtils","Math","WEBLib.Graphics"]);
rtl.module("WEBLib.TMSFNCEditorPanel",["System","Classes","Types","WEBLib.TMSFNCTypes","WEBLib.Controls","WEBLib.StdCtrls","WEBLib.TMSFNCCustomControl","WEBLib.TMSFNCGraphics","WEBLib.TMSFNCGraphicsTypes"],function () {
  "use strict";
  var $mod = this;
  this.MAJ_VER = 1;
  this.MIN_VER = 0;
  this.REL_VER = 0;
  this.BLD_VER = 0;
  this.$rtti.$Class("TTMSFNCCustomEditorPanel");
  this.TTMSFNCEditorPanelPosition = {"0": "eppAlone", eppAlone: 0, "1": "eppLeft", eppLeft: 1, "2": "eppTop", eppTop: 2, "3": "eppCenter", eppCenter: 3, "4": "eppRight", eppRight: 4, "5": "eppBottom", eppBottom: 5};
  this.$rtti.$Enum("TTMSFNCEditorPanelPosition",{minvalue: 0, maxvalue: 5, ordtype: 1, enumtype: this.TTMSFNCEditorPanelPosition});
  rtl.createClass(this,"TTMSFNCEditorPanelAppearance",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FOwner = null;
      this.FFill = null;
      this.FSelectedFill = null;
      this.FSelectedStroke = null;
      this.FStroke = null;
      this.FRounding = 0;
      this.FOnChanged = null;
      this.FStrokeSides = {};
    };
    this.$final = function () {
      this.FOwner = undefined;
      this.FFill = undefined;
      this.FSelectedFill = undefined;
      this.FSelectedStroke = undefined;
      this.FStroke = undefined;
      this.FOnChanged = undefined;
      this.FStrokeSides = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetFill = function (Value) {
      this.FFill.Assign(Value);
      this.DoFillChanged(this);
    };
    this.SetSelectedFill = function (Value) {
      this.FSelectedFill.Assign(Value);
      this.DoFillChanged(this);
    };
    this.SetSelectedStroke = function (Value) {
      this.FSelectedStroke.Assign(Value);
      this.DoStrokeChanged(this);
    };
    this.SetStroke = function (Value) {
      this.FStroke.Assign(Value);
      this.DoStrokeChanged(this);
    };
    this.SetRounding = function (Value) {
      if (this.FRounding !== Value) {
        this.FRounding = Value;
        this.DoChanged(this);
      };
    };
    this.SetStrokeSides = function (Value) {
      if (rtl.neSet(this.FStrokeSides,Value)) {
        this.FStrokeSides = rtl.refSet(Value);
        this.DoStrokeChanged(this);
      };
    };
    this.DoChanged = function (Sender) {
      if (this.FOnChanged != null) this.FOnChanged(this);
    };
    this.DoFillChanged = function (Sender) {
      this.DoChanged(Sender);
    };
    this.DoStrokeChanged = function (Sender) {
      this.DoChanged(Sender);
    };
    this.Create$1 = function (AOwner) {
      this.FOwner = AOwner;
      this.FRounding = 0;
      this.FStrokeSides = rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsRight,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsTop,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsBottom);
      this.FFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16777215,8421504,-1,-1]);
      this.FStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,12632256,1.0]);
      this.FSelectedFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor("#1BADF8"),8421504,-1,-1]);
      this.FSelectedStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor("#1BADF8"),1.0]);
      this.FFill.FOnChanged = rtl.createCallback(this,"DoFillChanged");
      this.FStroke.FOnChanged = rtl.createCallback(this,"DoStrokeChanged");
      this.FSelectedFill.FOnChanged = rtl.createCallback(this,"DoFillChanged");
      this.FSelectedStroke.FOnChanged = rtl.createCallback(this,"DoStrokeChanged");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FFill");
      rtl.free(this,"FStroke");
      rtl.free(this,"FSelectedFill");
      rtl.free(this,"FSelectedStroke");
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCEditorPanelAppearance.isPrototypeOf(Source)) {
        this.FRounding = rtl.as(Source,$mod.TTMSFNCEditorPanelAppearance).FRounding;
        this.FFill.Assign(rtl.as(Source,$mod.TTMSFNCEditorPanelAppearance).FFill);
        this.FStroke.Assign(rtl.as(Source,$mod.TTMSFNCEditorPanelAppearance).FStroke);
        this.FSelectedFill.Assign(rtl.as(Source,$mod.TTMSFNCEditorPanelAppearance).FSelectedFill);
        this.FSelectedStroke.Assign(rtl.as(Source,$mod.TTMSFNCEditorPanelAppearance).FSelectedStroke);
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    var $r = this.$rtti;
    $r.addProperty("Fill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFill","SetFill");
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
    $r.addProperty("SelectedFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FSelectedFill","SetSelectedFill");
    $r.addProperty("SelectedStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FSelectedStroke","SetSelectedStroke");
    $r.addProperty("Rounding",2,rtl.longint,"FRounding","SetRounding");
    $r.addProperty("StrokeSides",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsSides"],"FStrokeSides","SetStrokeSides");
  });
  rtl.createClass(this,"TTMSFNCCustomEditorPanel",pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$init.call(this);
      this.FAppearance = null;
      this.FPanelPosition = 0;
      this.FPanelPositionCorners = {};
      this.FSelected = false;
    };
    this.$final = function () {
      this.FAppearance = undefined;
      this.FPanelPositionCorners = undefined;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$final.call(this);
    };
    this.SetAppearance = function (Value) {
      this.FAppearance.Assign(Value);
      this.Invalidate();
    };
    this.SetPanelPosition = function (Value) {
      if (this.FPanelPosition !== Value) {
        this.FPanelPosition = Value;
        this.SetPanelPositionCorners();
        this.Invalidate();
      };
    };
    this.SetPanelPositionCorners = function () {
      var $tmp = this.FPanelPosition;
      if ($tmp === $mod.TTMSFNCEditorPanelPosition.eppLeft) {
        this.FPanelPositionCorners = rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft)}
       else if ($tmp === $mod.TTMSFNCEditorPanelPosition.eppCenter) {
        this.FPanelPositionCorners = {}}
       else if ($tmp === $mod.TTMSFNCEditorPanelPosition.eppRight) {
        this.FPanelPositionCorners = rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight)}
       else if ($tmp === $mod.TTMSFNCEditorPanelPosition.eppTop) {
        this.FPanelPositionCorners = rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight)}
       else if ($tmp === $mod.TTMSFNCEditorPanelPosition.eppBottom) {
        this.FPanelPositionCorners = rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight)}
       else {
        this.FPanelPositionCorners = rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight);
      };
    };
    this.SetSelected = function (Value) {
      if (this.FSelected !== Value) {
        this.FSelected = Value;
        this.Invalidate();
      };
    };
    this.ChangeDPIScale = function (M, D) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ChangeDPIScale.apply(this,arguments);
      this.BeginUpdate();
      this.FAppearance.SetRounding(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FAppearance.FRounding,M,D));
      this.EndUpdate();
    };
    this.DoAppearanceChanged = function (Sender) {
      this.Invalidate();
    };
    this.Draw = function (AGraphics, ARect) {
      var drect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rounding = 0;
      if (!this.FSelected) {
        AGraphics.FFill.Assign(this.FAppearance.FFill);
        AGraphics.FStroke.Assign(this.FAppearance.FStroke);
      } else {
        AGraphics.FFill.Assign(this.FAppearance.FSelectedFill);
        AGraphics.FStroke.Assign(this.FAppearance.FSelectedStroke);
      };
      drect.$assign(ARect);
      rounding = Math.min(this.FAppearance.FRounding,Math.round(this.GetHeight() / 2));
      AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
      AGraphics.DrawRoundRectangle$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(drect),rounding,rtl.refSet(this.FPanelPositionCorners),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
    };
    this.DrawBackground = function (AGraphics, ARect) {
    };
    this.UpdateControlAfterResize = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.UpdateControlAfterResize.call(this);
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Create$1.apply(this,arguments);
      this.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
      this.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
      this.FAppearance = $mod.TTMSFNCEditorPanelAppearance.$create("Create$1",[this]);
      this.FAppearance.FOnChanged = rtl.createCallback(this,"DoAppearanceChanged");
      this.FPanelPositionCorners = rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight);
      this.FPanelPosition = $mod.TTMSFNCEditorPanelPosition.eppAlone;
      this.SetWidth(200);
      this.SetHeight(200);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FAppearance");
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Destroy.call(this);
    };
    this.Assign = function (Source) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Assign.apply(this,arguments);
    };
    this.BeginUpdate = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBase.BeginUpdate.call(this);
    };
    this.EndUpdate = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBase.EndUpdate.call(this);
      this.Invalidate();
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCEditorPanel",this.TTMSFNCCustomEditorPanel,function () {
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Appearance",2,$mod.$rtti["TTMSFNCEditorPanelAppearance"],"FAppearance","SetAppearance");
    $r.addProperty("PanelPosition",2,$mod.$rtti["TTMSFNCEditorPanelPosition"],"FPanelPosition","SetPanelPosition",4,{Default: $mod.TTMSFNCEditorPanelPosition.eppAlone});
    $r.addProperty("Selected",2,rtl.boolean,"FSelected","SetSelected");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
},["TypInfo","WEBLib.Forms","SysUtils","WEBLib.TMSFNCUtils","Math","WEBLib.Graphics"]);
rtl.module("WEBLib.TreeNodes",["System","Classes","Types","SysUtils","Web"],function () {
  "use strict";
  var $mod = this;
  this.$rtti.$Class("TTreeNode");
  this.$rtti.$Class("TTreeNodes");
  rtl.createClass(this,"TDbgList",pas.Classes.TList,function () {
    this.GetItemsEx = function (Index) {
      var Result = null;
      if (Index >= this.GetCount()) {
        throw pas.SysUtils.Exception.$create("Create$1",["Index out of bounds in list read access"]);
      };
      if (Index < this.GetCount()) {
        Result = rtl.getObject(this.Get(Index))}
       else Result = null;
      return Result;
    };
    this.SetItemsEx = function (Index, Value) {
      if (Index >= this.GetCount()) {
        throw pas.SysUtils.Exception.$create("Create$1",["Index out of bounds in list write access"]);
      };
      if (Index < this.GetCount()) this.Put(Index,Value);
    };
    this.AssignList = function (ListA) {
      var I = 0;
      this.Clear();
      for (var $l = 0, $end = ListA.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.Add(ListA.Get(I));
      };
    };
  });
  this.TNodeType = {"0": "ntText", ntText: 0, "1": "ntCheckbox", ntCheckbox: 1, "2": "ntRadioButton", ntRadioButton: 2};
  this.$rtti.$Enum("TNodeType",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TNodeType});
  this.$rtti.$Pointer("PNodeInfo",{reftype: this.$rtti["TNodeInfo"]});
  rtl.recNewT(this,"TNodeInfo",function () {
    this.SelectedIndex = 0;
    this.StateIndex = 0;
    this.OverlayIndex = 0;
    this.Data = null;
    this.Count = 0;
    this.Text = "";
    this.NodeType = 0;
    this.Checked = false;
    this.ImageURL = "";
    this.ImageCollapsedURL = "";
    this.URL = "";
    this.Tag = 0;
    this.Hint = "";
    this.IsExpanded = false;
    this.$eq = function (b) {
      return (this.SelectedIndex === b.SelectedIndex) && (this.StateIndex === b.StateIndex) && (this.OverlayIndex === b.OverlayIndex) && (this.Data === b.Data) && (this.Count === b.Count) && (this.Text === b.Text) && (this.NodeType === b.NodeType) && (this.Checked === b.Checked) && (this.ImageURL === b.ImageURL) && (this.ImageCollapsedURL === b.ImageCollapsedURL) && (this.URL === b.URL) && (this.Tag === b.Tag) && (this.Hint === b.Hint) && (this.IsExpanded === b.IsExpanded);
    };
    this.$assign = function (s) {
      this.SelectedIndex = s.SelectedIndex;
      this.StateIndex = s.StateIndex;
      this.OverlayIndex = s.OverlayIndex;
      this.Data = s.Data;
      this.Count = s.Count;
      this.Text = s.Text;
      this.NodeType = s.NodeType;
      this.Checked = s.Checked;
      this.ImageURL = s.ImageURL;
      this.ImageCollapsedURL = s.ImageCollapsedURL;
      this.URL = s.URL;
      this.Tag = s.Tag;
      this.Hint = s.Hint;
      this.IsExpanded = s.IsExpanded;
      return this;
    };
    var $r = $mod.$rtti.$Record("TNodeInfo",{},this);
    $r.addField("SelectedIndex",rtl.longint);
    $r.addField("StateIndex",rtl.longint);
    $r.addField("OverlayIndex",rtl.longint);
    $r.addField("Data",rtl.pointer);
    $r.addField("Count",rtl.longint);
    $r.addField("Text",rtl.string);
    $r.addField("NodeType",$mod.$rtti["TNodeType"]);
    $r.addField("Checked",rtl.boolean);
    $r.addField("ImageURL",rtl.string);
    $r.addField("ImageCollapsedURL",rtl.string);
    $r.addField("URL",rtl.string);
    $r.addField("Tag",rtl.longint);
    $r.addField("Hint",rtl.string);
    $r.addField("IsExpanded",rtl.boolean);
  });
  rtl.recNewT(this,"TNodeDataInfo",function () {
    this.SelectedIndex = 0;
    this.StateIndex = 0;
    this.OverlayIndex = 0;
    this.Data = null;
    this.Count = 0;
    this.NodeType = 0;
    this.Checked = false;
    this.Tag = 0;
    this.IsExpanded = false;
    this.TextLen = 0;
    this.HintLen = 0;
    this.URLLen = 0;
    this.ImageURLLen = 0;
    this.ImageCollapsedURLLen = 0;
    this.$eq = function (b) {
      return (this.SelectedIndex === b.SelectedIndex) && (this.StateIndex === b.StateIndex) && (this.OverlayIndex === b.OverlayIndex) && (this.Data === b.Data) && (this.Count === b.Count) && (this.NodeType === b.NodeType) && (this.Checked === b.Checked) && (this.Tag === b.Tag) && (this.IsExpanded === b.IsExpanded) && (this.TextLen === b.TextLen) && (this.HintLen === b.HintLen) && (this.URLLen === b.URLLen) && (this.ImageURLLen === b.ImageURLLen) && (this.ImageCollapsedURLLen === b.ImageCollapsedURLLen);
    };
    this.$assign = function (s) {
      this.SelectedIndex = s.SelectedIndex;
      this.StateIndex = s.StateIndex;
      this.OverlayIndex = s.OverlayIndex;
      this.Data = s.Data;
      this.Count = s.Count;
      this.NodeType = s.NodeType;
      this.Checked = s.Checked;
      this.Tag = s.Tag;
      this.IsExpanded = s.IsExpanded;
      this.TextLen = s.TextLen;
      this.HintLen = s.HintLen;
      this.URLLen = s.URLLen;
      this.ImageURLLen = s.ImageURLLen;
      this.ImageCollapsedURLLen = s.ImageCollapsedURLLen;
      return this;
    };
    var $r = $mod.$rtti.$Record("TNodeDataInfo",{},this);
    $r.addField("SelectedIndex",rtl.longint);
    $r.addField("StateIndex",rtl.longint);
    $r.addField("OverlayIndex",rtl.longint);
    $r.addField("Data",rtl.pointer);
    $r.addField("Count",rtl.longint);
    $r.addField("NodeType",$mod.$rtti["TNodeType"]);
    $r.addField("Checked",rtl.boolean);
    $r.addField("Tag",rtl.longint);
    $r.addField("IsExpanded",rtl.boolean);
    $r.addField("TextLen",rtl.byte);
    $r.addField("HintLen",rtl.byte);
    $r.addField("URLLen",rtl.byte);
    $r.addField("ImageURLLen",rtl.byte);
    $r.addField("ImageCollapsedURLLen",rtl.byte);
  });
  this.$rtti.$ClassRef("TTreeNodeClass",{instancetype: this.$rtti["TTreeNode"]});
  rtl.createClass(this,"TTreeNode",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FOwner = null;
      this.FText = "";
      this.FData = null;
      this.FDeleting = false;
      this.FIsExpanded = false;
      this.FFirstChild = null;
      this.FNextSibling = null;
      this.FPrevSibling = null;
      this.FParentNode = null;
      this.FShowText = false;
      this.FImageCollapsedURL = "";
      this.FImageURL = "";
      this.FNodeType = 0;
      this.FURL = "";
      this.FChecked = false;
      this.FTag = 0;
      this.FHint = "";
      this.FSelected = false;
    };
    this.$final = function () {
      this.FOwner = undefined;
      this.FData = undefined;
      this.FFirstChild = undefined;
      this.FNextSibling = undefined;
      this.FPrevSibling = undefined;
      this.FParentNode = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.GetLevel = function () {
      var Result = 0;
      var Node = null;
      Result = 0;
      Node = this.GetParent();
      while (Node !== null) {
        Result += 1;
        Node = Node.GetParent();
      };
      return Result;
    };
    this.GetParent = function () {
      var Result = null;
      Result = this.FParentNode;
      return Result;
    };
    this.GetIndex = function () {
      var Result = 0;
      var Node = null;
      Result = -1;
      Node = this;
      while (Node != null) {
        Result += 1;
        Node = Node.GetPrevSibling();
      };
      return Result;
    };
    this.GetItem = function (Index) {
      var Result = null;
      Result = this.GetFirstChild();
      while ((Result !== null) && (Index > 0)) {
        Result = this.GetNextChild(Result);
        Index -= 1;
      };
      if (Result === null) throw pas.SysUtils.Exception.$create("Create$1",["Invalid index"]);
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      var Node = null;
      Result = 0;
      Node = this.GetFirstChild();
      while (Node != null) {
        Result += 1;
        Node = Node.GetNextChild(Node);
      };
      return Result;
    };
    this.SetData = function (Value) {
      if (!this.FDeleting && (Value !== this.FData)) {
        this.FData = Value;
      };
    };
    this.SetItem = function (Index, Value) {
      this.GetItem(Index).Assign(Value);
    };
    this.SetText = function (S) {
      if (!this.FDeleting && (S !== this.FText)) {
        this.FText = S;
      };
    };
    this.GetHasChildren = function () {
      var Result = false;
      Result = this.FFirstChild != null;
      return Result;
    };
    this.SetShowText = function (Value) {
      this.FShowText = Value;
    };
    this.SetChecked = function (Value) {
      this.FChecked = Value;
    };
    this.SetImageCollapsedURL = function (Value) {
      this.FImageCollapsedURL = Value;
    };
    this.SetImageURL = function (Value) {
      this.FImageURL = Value;
    };
    this.SetNodeType = function (Value) {
      this.FNodeType = Value;
    };
    this.SetURL = function (Value) {
      this.FURL = Value;
    };
    this.SetTag = function (Value) {
      this.FTag = Value;
    };
    this.SetHint = function (Value) {
      this.FHint = Value;
    };
    this.SetIsExpanded = function (Value) {
      if (this.FIsExpanded !== Value) {
        this.FIsExpanded = Value;
        if (this.FOwner != null) if (this.FOwner.FOnExpandedChange != null) this.FOwner.FOnExpandedChange(this.FOwner,this);
      };
    };
    this.SetSelected = function (Value) {
      if (this.FSelected !== Value) {
        this.FSelected = Value;
        this.FOwner.SelectionChange(this,Value);
      };
    };
    this.GetAbsoluteIndex = function () {
      var Result = 0;
      var Node = null;
      if (this.IsFirstNode()) {
        Result = 0}
       else {
        Result = -1;
        Node = this;
        while (Node !== null) {
          Result += 1;
          Node = Node.GetPrev();
        };
      };
      return Result;
    };
    this.CompareCount = function (CompareMe) {
      var Result = false;
      var Count = 0;
      var Node = null;
      Count = 0;
      Result = false;
      Node = this.GetFirstChild();
      while (Node !== null) {
        Count += 1;
        Node = Node.GetNextChild(Node);
        if (Count > CompareMe) return Result;
      };
      if (Count === CompareMe) Result = true;
      return Result;
    };
    this.IsEqual = function (Node) {
      var Result = false;
      Result = (this.FText === Node.FText) && (this.FData === Node.FData);
      return Result;
    };
    this.Select = function () {
      this.FSelected = true;
    };
    this.UnSelect = function () {
      this.FSelected = false;
    };
    this.IndexOf = function (Value) {
      var Result = 0;
      var Node = null;
      Result = -1;
      Node = this.GetFirstChild();
      while (Node !== null) {
        Result += 1;
        if (Node === Value) break;
        Node = this.GetNextChild(Node);
      };
      if (Node === null) Result = -1;
      return Result;
    };
    this.Create$1 = function (AOwner) {
      pas.System.TObject.Create.call(this);
      this.FOwner = AOwner;
      this.FShowText = true;
      this.FNodeType = $mod.TNodeType.ntText;
      this.FChecked = false;
      this.FIsExpanded = false;
      this.FTag = 0;
      return this;
    };
    this.Destroy = function () {
      var N = null;
      var PN = null;
      var NN = null;
      var i = 0;
      this.FDeleting = true;
      this.DeleteChildren();
      N = this.GetParent();
      if ((((N !== null) && !N.FDeleting) || (N === null)) && !this.FOwner.FDeleting && (this.FOwner != null) && (this.FOwner.FOwner != null) && !(pas.Classes.TComponentStateItem.csDestroying in this.FOwner.FOwner.FComponentState)) {
        PN = this.GetPrevSibling();
        NN = this.GetNextSibling();
        if (!(NN != null)) {
          if (this.IsFirstNode()) {
            this.FOwner.FFirstNode = null}
           else if ((this.GetParent() != null) && this.IsFirstChild()) {
            this.GetParent().FFirstChild = null}
           else {
            if (PN != null) PN.FNextSibling = null;
          };
        } else if (!(PN != null)) {
          if (this.IsFirstNode()) {
            this.FOwner.FFirstNode = NN;
            NN.FPrevSibling = PN;
          } else if ((this.GetParent() != null) && this.IsFirstChild()) this.GetParent().FFirstChild = NN;
        } else {
          PN.FNextSibling = NN;
          NN.FPrevSibling = PN;
        };
      };
      if (!(this.GetParent() != null)) {
        i = this.FOwner.FNodeList.IndexOf(this);
        if (i >= 0) {
          this.FOwner.FNodeList.Delete(i);
        };
      };
      this.SetData(null);
      pas.System.TObject.Destroy.call(this);
    };
    this.AddFirstChild = function (S) {
      var Result = null;
      Result = this.AddFirstChild$1(S,null);
      return Result;
    };
    this.AddFirstChild$1 = function (S, Data) {
      var Result = null;
      if (!(this.FFirstChild != null)) {
        Result = this.FOwner.InsertNode(this,null,true)}
       else Result = this.FOwner.InsertNode(null,this.FFirstChild,true);
      Result.SetText(S);
      Result.SetData(Data);
      return Result;
    };
    this.AddChild = function (S) {
      var Result = null;
      Result = this.AddChild$1(S,null);
      return Result;
    };
    this.AddChild$1 = function (S, Data) {
      var Result = null;
      var N = null;
      N = this.GetLastChild();
      if (N != null) {
        Result = this.FOwner.InsertNode(null,N,false)}
       else Result = this.FOwner.InsertNode(this,null,false);
      Result.SetText(S);
      Result.SetData(Data);
      return Result;
    };
    this.Assign = function (Source) {
      var Node = null;
      if (!this.FDeleting && $mod.TTreeNode.isPrototypeOf(Source)) {
        Node = Source;
        this.SetText(Node.FText);
        this.SetData(Node.FData);
        this.SetShowText(Node.FShowText);
        this.SetNodeType(Node.FNodeType);
        this.SetChecked(Node.FChecked);
        this.SetURL(Node.FURL);
        this.SetHint(Node.FHint);
        this.SetImageURL(Node.FImageURL);
        this.SetImageCollapsedURL(Node.FImageCollapsedURL);
        this.SetTag(Node.FTag);
        this.FIsExpanded = Node.FIsExpanded;
      } else pas.Classes.TPersistent.Assign.call(this,Source);
    };
    this.Expand = function (Recurse) {
      var i = 0;
      this.SetIsExpanded(true);
      if (Recurse) {
        for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
          i = $l;
          this.GetItem(i).Expand(Recurse);
        };
      };
    };
    this.Collapse = function (Recurse) {
      var i = 0;
      this.SetIsExpanded(false);
      if (Recurse) {
        for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
          i = $l;
          this.GetItem(i).Collapse(Recurse);
        };
      };
    };
    this.Delete = function () {
      if (!this.FDeleting) this.Free();
    };
    this.DeleteChildren = function () {
      var ChildList = null;
      var N = null;
      var i = 0;
      ChildList = $mod.TDbgList.$create("Create$1");
      N = this.GetFirstChild();
      if (N !== null) {
        do {
          ChildList.Add(N);
          N = N.GetNextSibling();
        } while (!(N === null));
      };
      for (var $l = ChildList.GetCount() - 1; $l >= 0; $l--) {
        i = $l;
        N = ChildList.GetItemsEx(i);
        N = rtl.freeLoc(N);
        ChildList.GetItemsEx(i).Delete();
      };
      ChildList = rtl.freeLoc(ChildList);
    };
    this.GetFirstChild = function () {
      var Result = null;
      Result = this.FFirstChild;
      return Result;
    };
    this.GetLastChild = function () {
      var Result = null;
      var Node = null;
      Result = this.GetFirstChild();
      if (Result !== null) {
        Node = Result;
        do {
          Result = Node;
          Node = Result.GetNextSibling();
        } while (!(Node === null));
      };
      return Result;
    };
    this.GetNextChild = function (Value) {
      var Result = null;
      if (Value !== null) {
        Result = Value.GetNextSibling()}
       else Result = null;
      return Result;
    };
    this.GetNextSibling = function () {
      var Result = null;
      Result = this.FNextSibling;
      return Result;
    };
    this.GetPrevChild = function (Value) {
      var Result = null;
      if (Value !== null) {
        Result = Value.GetPrevSibling()}
       else Result = null;
      return Result;
    };
    this.GetPrevSibling = function () {
      var Result = null;
      Result = this.FPrevSibling;
      return Result;
    };
    this.HasAsParent = function (Value) {
      var Result = false;
      if (Value !== null) {
        if (this.GetParent() === null) {
          Result = false}
         else if (this.GetParent() === Value) {
          Result = true}
         else Result = this.GetParent().HasAsParent(Value);
      } else Result = true;
      return Result;
    };
    this.IsFirstNode = function () {
      var Result = false;
      Result = this === this.FOwner.FFirstNode;
      return Result;
    };
    this.IsFirstChild = function () {
      var Result = false;
      Result = this.IsFirstNode() || ((this.GetParent() != null) && (this.GetParent().GetFirstChild() === this));
      return Result;
    };
    this.GetNext = function () {
      var Result = null;
      var p = null;
      Result = null;
      if (this.GetCount() > 0) {
        Result = this.GetItem(0)}
       else {
        Result = this.GetNextSibling();
        if (!(Result != null)) {
          p = this;
          do {
            p = p.GetParent();
            if (p != null) Result = p.GetNextSibling();
          } while (!(!(p != null) || (Result != null)));
        };
      };
      return Result;
    };
    this.GetPrev = function () {
      var Result = null;
      var cn = null;
      Result = this.GetPrevSibling();
      if (Result != null) {
        cn = Result;
        do {
          if (cn.GetCount() > 0) {
            Result = cn.GetItem(cn.GetCount() - 1);
            cn = Result;
          };
        } while (!(cn.GetCount() === 0));
      } else Result = this.GetParent();
      return Result;
    };
  });
  this.$rtti.$MethodVar("TSelectNodeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",this.$rtti["TTreeNode"]],["IsSelected",rtl.boolean]]), methodkind: 0});
  this.$rtti.$MethodVar("TNodeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",this.$rtti["TTreeNode"]]]), methodkind: 0});
  rtl.createClass(this,"TTreeNodes",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FOwner = null;
      this.FFirstNode = null;
      this.FNodeList = null;
      this.FDeleting = false;
      this.FReading = false;
      this.FOnChange = null;
      this.FOnExpandedChange = null;
      this.FOnSelectionChange = null;
    };
    this.$final = function () {
      this.FOwner = undefined;
      this.FFirstNode = undefined;
      this.FNodeList = undefined;
      this.FOnChange = undefined;
      this.FOnExpandedChange = undefined;
      this.FOnSelectionChange = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.GetNodeFromIndex = function (Index) {
      var Result = null;
      var i = 0;
      var idx = 0;
      var child = null;
      Result = null;
      idx = 0;
      for (var $l = 0, $end = this.FNodeList.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        child = this.FNodeList.GetItemsEx(i);
        do {
          if (Index === idx) {
            Result = child;
            return Result;
          };
          child = child.GetNext();
          idx += 1;
        } while (!(child === null));
      };
      return Result;
    };
    this.GetSiblingCount = function () {
      var Result = 0;
      Result = this.FNodeList.GetCount();
      return Result;
    };
    this.GetSiblingFromIndex = function (Index) {
      var Result = null;
      Result = null;
      if ((Index >= 0) && (Index < this.FNodeList.GetCount())) Result = this.FNodeList.GetItemsEx(Index);
      return Result;
    };
    this.SetItem = function (Index, Value) {
      if ((Index >= 0) && (Index < this.FNodeList.GetCount())) this.GetNodeFromIndex(Index).Assign(Value);
    };
    this.GetCount = function () {
      var $Self = this;
      var Result = 0;
      var i = 0;
      function GetChildCount(tn) {
        var Result = 0;
        var j = 0;
        Result = tn.GetCount();
        for (var $l = 0, $end = tn.GetCount() - 1; $l <= $end; $l++) {
          j = $l;
          Result = Result + GetChildCount(tn.GetItem(j));
        };
        return Result;
      };
      Result = this.FNodeList.GetCount();
      for (var $l = 0, $end = this.FNodeList.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        Result = Result + GetChildCount(this.FNodeList.GetItemsEx(i));
      };
      return Result;
    };
    this.InsertNode = function (ParentNode, DesNode, InsertBefore) {
      var Result = null;
      var N = null;
      Result = null;
      if (!(DesNode != null)) {
        if (ParentNode != null) {
          N = ParentNode.GetLastChild();
          if (N != null) {
            this.InsertNode(null,N,false);
            return Result;
          } else {
            Result = this.CreateNode();
            ParentNode.FFirstChild = Result;
            Result.FParentNode = ParentNode;
            return Result;
          };
        } else {
          if (!(this.FFirstNode != null)) {
            Result = this.CreateNode();
            this.FFirstNode = Result;
            this.FNodeList.Add(Result);
          };
        };
      } else {
        Result = this.CreateNode();
        if (InsertBefore) {
          if (this.IsVeryFirstNode(DesNode)) {
            this.FFirstNode = Result;
            Result.FNextSibling = DesNode;
            DesNode.FPrevSibling = Result;
            this.FNodeList.Insert(0,Result);
          } else {
            if (DesNode.IsFirstChild() && (DesNode.GetParent() != null)) {
              DesNode.GetParent().FFirstChild = Result;
              Result.FNextSibling = DesNode;
              DesNode.FPrevSibling = Result;
              Result.FParentNode = DesNode.GetParent();
            } else {
              Result.FPrevSibling = DesNode.FPrevSibling;
              Result.FNextSibling = DesNode;
              DesNode.FPrevSibling = Result;
              Result.FParentNode = DesNode.GetParent();
              if (Result.FPrevSibling != null) Result.FPrevSibling.FNextSibling = Result;
            };
          };
        } else {
          Result.FNextSibling = DesNode.FNextSibling;
          Result.FPrevSibling = DesNode;
          DesNode.FNextSibling = Result;
          if (Result.FNextSibling != null) Result.FNextSibling.FPrevSibling = Result;
          Result.FParentNode = DesNode.GetParent();
          if (!(DesNode.GetParent() != null)) this.FNodeList.Add(Result);
        };
      };
      return Result;
    };
    this.IsVeryFirstNode = function (Node) {
      var Result = false;
      Result = (Node != null) && (Node === this.FFirstNode);
      return Result;
    };
    this.SelectionChange = function (Node, IsSelected) {
      if (this.FOnSelectionChange != null) this.FOnSelectionChange(this,Node,IsSelected);
    };
    this.CreateNode = function () {
      var Result = null;
      var LClass = null;
      LClass = $mod.TTreeNode;
      Result = LClass.$create("Create$1",[this]);
      return Result;
    };
    this.Create$1 = function (AOwner) {
      pas.System.TObject.Create.call(this);
      this.FOwner = AOwner;
      this.FFirstNode = null;
      this.FNodeList = $mod.TDbgList.$create("Create$1");
      return this;
    };
    this.Destroy = function () {
      this.FDeleting = true;
      this.Clear();
      rtl.free(this,"FNodeList");
      pas.System.TObject.Destroy.call(this);
    };
    this.AddFirst = function (S) {
      var Result = null;
      Result = this.AddFirst$1(null,S);
      return Result;
    };
    this.AddFirst$1 = function (Data, S) {
      var Result = null;
      if (!(this.FFirstNode != null)) {
        Result = this.InsertNode(null,null,true);
      } else {
        Result = this.InsertNode(null,this.FFirstNode,true);
      };
      Result.SetText(S);
      Result.SetData(Data);
      return Result;
    };
    this.Add = function (Sibling, S) {
      var Result = null;
      Result = this.Add$1(Sibling,S,null);
      return Result;
    };
    this.Add$1 = function (Sibling, S, Data) {
      var Result = null;
      Result = this.InsertNode(Sibling,this.GetLastNode(),false);
      Result.SetText(S);
      Result.SetData(Data);
      return Result;
    };
    this.Add$2 = function (S) {
      var Result = null;
      Result = this.Add$3(S,null);
      return Result;
    };
    this.Add$3 = function (S, Data) {
      var Result = null;
      Result = this.InsertNode(null,this.GetLastNode(),false);
      Result.SetText(S);
      Result.SetData(Data);
      return Result;
    };
    this.AddChild = function (Parent, S) {
      var Result = null;
      if (Parent === null) {
        Result = this.Add$3(S,null)}
       else Result = this.AddChild$1(Parent,S,null);
      return Result;
    };
    this.AddChild$1 = function (Parent, S, Data) {
      var Result = null;
      Result = null;
      if (Parent != null) {
        Result = Parent.AddChild$1(S,Data)}
       else Result = this.Add$3(S,Data);
      return Result;
    };
    this.AddChildFirst = function (Parent, S) {
      var Result = null;
      Result = this.AddChildFirst$1(Parent,S,null);
      return Result;
    };
    this.AddChildFirst$1 = function (Parent, S, Data) {
      var Result = null;
      Result = null;
      if (Parent != null) Result = Parent.AddFirstChild$1(S,Data);
      return Result;
    };
    this.Assign = function (Source) {
      if ($mod.TTreeNodes.isPrototypeOf(Source)) {
        this.Clear();
      } else pas.Classes.TPersistent.Assign.call(this,Source);
    };
    this.BeginUpdate = function () {
    };
    this.EndUpdate = function () {
    };
    this.Clear = function () {
      var i = 0;
      for (var $l = this.FNodeList.GetCount() - 1; $l >= 0; $l--) {
        i = $l;
        this.FNodeList.GetItemsEx(i).Delete();
      };
      this.FNodeList.Clear();
    };
    this.Delete = function (Node) {
      Node.Delete();
    };
    this.GetFirstNode = function () {
      var Result = null;
      Result = this.FFirstNode;
      return Result;
    };
    this.GetLastNode = function () {
      var Result = null;
      Result = this.FFirstNode;
      if (Result != null) while (Result.GetNextSibling() !== null) Result = Result.GetNextSibling();
      return Result;
    };
    this.Insert = function (Sibling, S) {
      var Result = null;
      Result = this.InsertObject(Sibling,S,null);
      return Result;
    };
    this.InsertObject = function (Sibling, S, Data) {
      var Result = null;
      Result = this.InsertNode(null,Sibling,true);
      if (Result != null) {
        Result.SetText(S);
        Result.SetData(Data);
      };
      return Result;
    };
    this.Changed = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
  });
},["Math"]);
rtl.module("WEBLib.Buttons",["System","Classes","SysUtils","WEBLib.Controls","Web","WEBLib.Graphics","WEBLib.StdCtrls","WEBLib.ComCtrls","WEBLib.ExtCtrls","WEBLib.Forms","WEBLib.Menus"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.TButtonLayout = {"0": "blGlyphLeft", blGlyphLeft: 0, "1": "blGlyphRight", blGlyphRight: 1, "2": "blGlyphTop", blGlyphTop: 2, "3": "blGlyphBottom", blGlyphBottom: 3};
  this.$rtti.$Enum("TButtonLayout",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TButtonLayout});
  rtl.createClass(this,"TCustomSpeedButton",pas["WEBLib.Menus"].TWebCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Menus"].TWebCustomControl.$init.call(this);
      this.FMaterialGlyph = "";
      this.FColor$1 = 0;
      this.FIntColor = 0;
      this.FDown = false;
      this.FFlat = false;
      this.FGroupIndex = 0;
      this.FAllowAllUp = false;
      this.FGlyph = null;
      this.FLayout = 0;
      this.FGlyphURL = "";
      this.FMaterialGlyphSize = 0;
      this.FMaterialGlyphColor = 0;
      this.FMaterialGlyphType = 0;
      this.FGlyphSize = 0;
    };
    this.$final = function () {
      this.FGlyph = undefined;
      pas["WEBLib.Menus"].TWebCustomControl.$final.call(this);
    };
    this.SetMaterialGlyph = function (AValue) {
      if (this.FMaterialGlyph !== AValue) {
        this.FMaterialGlyph = AValue;
        this.UpdateElement();
      };
    };
    this.SetColorEx = function (AValue) {
      if (this.FColor$1 !== AValue) {
        this.FColor$1 = AValue;
        this.FIntColor = AValue;
        this.UpdateElement();
      };
    };
    this.SetIntColor = function (AValue) {
      if (this.FIntColor !== AValue) {
        this.FIntColor = AValue;
        this.UpdateElement();
      };
    };
    this.SetGroupIndex = function (AValue) {
      this.FGroupIndex = AValue;
    };
    this.SetDown = function (AValue) {
      if (this.FDown !== AValue) {
        this.FDown = AValue;
        this.UpdateElement();
      };
    };
    this.SetFlat = function (Value) {
      if (this.FFlat !== Value) {
        this.FFlat = Value;
        this.RecreateElement();
      };
    };
    this.SetGlyph = function (Value) {
      this.FGlyph.Assign(Value);
      this.UpdateElement();
    };
    this.SetGlyphURL = function (Value) {
      if (this.FGlyphURL !== Value) {
        this.FGlyphURL = Value;
        this.RecreateElement();
      };
    };
    this.SetMaterialGlyphSize = function (Value) {
      if ((Value > 0) && (Value < 100)) {
        this.FMaterialGlyphSize = Value;
        this.UpdateElement();
      };
    };
    this.SetMaterialGyphColor = function (Value) {
      if (this.FMaterialGlyphColor !== Value) {
        this.FMaterialGlyphColor = Value;
        this.UpdateElement();
      };
    };
    this.SetMaterialGlyphType = function (Value) {
      if (this.FMaterialGlyphType !== Value) {
        this.FMaterialGlyphType = Value;
        this.UpdateElement();
      };
    };
    this.SetGlyphSize = function (Value) {
      if (this.FGlyphSize !== Value) {
        this.FGlyphSize = Value;
        this.UpdateElement();
      };
    };
    this.SetEnabled = function (Value) {
      pas["WEBLib.Controls"].TControl.SetEnabled.apply(this,arguments);
      this.UpdateElement();
    };
    this.SetCaption = function (AValue) {
      if (this.FCaption !== AValue) {
        pas["WEBLib.Controls"].TCustomControl.SetCaption.call(this,AValue);
        this.UpdateElement();
      };
    };
    this.CreateElement = function () {
      var Result = null;
      if (this.FFlat) {
        Result = document.createElement("SPAN")}
       else {
        Result = document.createElement("BUTTON");
        Result.setAttribute("type","BUTTON");
      };
      return Result;
    };
    this.UpdateElement = function () {
      var s = "";
      var inactive = "";
      var noptr = "";
      var icn = "";
      var imgsrc = "";
      var gs = "";
      var matclr = "";
      var cap = "";
      var acc = "";
      pas["WEBLib.Controls"].TControl.UpdateElement.call(this);
      if (!this.IsUpdating() && (this.FMaterialGlyph !== "")) this.AddControlLink("googlematerial","https://fonts.googleapis.com/icon?family=Material+Icons");
      if (this.GetElementHandle() != null) {
        this.GetElementHandle().style.setProperty("vertical-align","middle");
        this.GetElementHandle().style.setProperty("overflow","hidden");
        this.GetElementHandle().style.setProperty("padding","0px");
        this.GetElementHandle().style.setProperty("text-align","center");
        this.GetElementHandle().style.setProperty("min-width","32px");
        if (this.FFlat && this.FVisible) {
          this.GetElementHandle().style.setProperty("display","flex");
          this.GetElementHandle().style.setProperty("justify-content","center");
        };
        s = "";
        inactive = "";
        noptr = "";
        if (!this.FEnabled) inactive = " md-light md-inactive";
        noptr = "pointer-events:none";
        if (this.FMaterialGlyph !== "") {
          matclr = "";
          if (this.FMaterialGlyphColor !== -1) {
            if (this.FEnabled) {
              matclr = ";color:" + pas["WEBLib.Graphics"].ColorToHTML(this.FMaterialGlyphColor)}
             else matclr = ";color:" + pas["WEBLib.Graphics"].ColorToHTML(0xA0A0A0);
          };
          icn = '<i class="' + pas["WEBLib.Controls"].GetMaterialClass(this.FMaterialGlyphType) + inactive + '" translate="no" style="' + noptr + ";font-size:" + pas.SysUtils.IntToStr(this.FMaterialGlyphSize) + "px" + matclr + '">' + this.FMaterialGlyph + "</i>";
        };
        if (this.FGlyph.GetData() !== "") {
          imgsrc = "data:image/jpeg;base64," + pas["WEBLib.WebTools"].HexImageDecodeAsBase64(this.FGlyph.GetData())}
         else if (this.FGlyph.FFilename !== "") {
          imgsrc = this.FGlyph.FFilename}
         else if (this.FGlyphURL !== "") imgsrc = this.FGlyphURL;
        gs = "";
        if (this.FGlyphSize !== 0) gs = "width:" + pas.SysUtils.TIntegerHelper.ToString$1.call({p: this, get: function () {
            return this.p.FGlyphSize;
          }, set: function (v) {
            this.p.FGlyphSize = v;
          }}) + "px";
        if (imgsrc !== "") icn = '<img style="' + noptr + ";vertical-align:middle;" + gs + '" src="' + imgsrc + '">';
        if ((this.GetElementHandle().childElementCount === 0) || !this.GetIsLinked()) cap = pas["WEBLib.WebTools"].ProcessAccelerator(this.FCaption,{get: function () {
            return acc;
          }, set: function (v) {
            acc = v;
          }});
        if (acc !== "") this.GetElementHandle().setAttribute("accesskey",acc);
        if (this.FTabStop) {
          this.GetElementHandle().setAttribute("tabindex",pas.SysUtils.IntToStr(this.FTabOrder))}
         else this.GetElementHandle().setAttribute("tabindex","-1");
        var $tmp = this.FLayout;
        if ($tmp === $mod.TButtonLayout.blGlyphLeft) {
          s = '<table border="0" align="center" style="' + noptr + '"><tr><td style="border:none">' + icn + '</td><td style="border:none">' + cap + "</td></tr></table>"}
         else if ($tmp === $mod.TButtonLayout.blGlyphRight) {
          s = '<table border="0" align="center" style="' + noptr + '"><tr><td style="border:none">' + cap + '</td><td style="border:none">' + icn + "</td></tr></table>"}
         else if ($tmp === $mod.TButtonLayout.blGlyphTop) {
          s = '<table border="0" align="center" style="' + noptr + '"><tr><td style="border:none">' + icn + '</td></tr><tr><td style="border:none">' + cap + "</td></tr></table>"}
         else if ($tmp === $mod.TButtonLayout.blGlyphBottom) s = '<table border="0" align="center" style="' + noptr + '"><tr><td style="border:none">' + cap + '</td></tr><tr><td style="border:none">' + icn + "</td></tr></table>";
        this.GetElementHandle().innerHTML = s;
        pas["WEBLib.Controls"].SetHTMLElementFont(this.GetElementHandle().firstChild,this.FFont,!((this.FElementClassName === "") && (this.FElementFont === pas["WEBLib.Controls"].TElementFont.efProperty)));
        if (!this.IsEnabled()) {
          this.GetElementHandle().style.removeProperty("color")}
         else if ((this.FElementFont === pas["WEBLib.Controls"].TElementFont.efProperty) && (this.FElementClassName === "")) {
          this.GetElementHandle().style.setProperty("color",pas["WEBLib.Graphics"].ColorToHTML(this.FFont.FColor));
          if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) this.GetElementHandle().firstChild.style.setProperty("color",pas["WEBLib.Graphics"].ColorToHTML(this.FFont.FColor));
        };
      };
    };
    this.UpdateElementVisual = function () {
      var clr = 0;
      pas["WEBLib.Controls"].TCustomControl.UpdateElementVisual.call(this);
      if (this.GetElementHandle() != null) {
        if (this.FDown) {
          clr = 8421504}
         else clr = this.FIntColor;
        if ((clr !== -1) && (this.FElementClassName === "")) {
          this.GetElementHandle().style.setProperty("background-color",pas["WEBLib.Graphics"].ColorToHTML(clr))}
         else this.GetElementHandle().style.setProperty("background-color","");
        if (this.GetElementHandle().firstChild != null) pas["WEBLib.Controls"].SetHTMLElementFont(this.GetElementHandle().firstChild,this.FFont,!((this.FElementClassName === "") && (this.FElementFont === pas["WEBLib.Controls"].TElementFont.efProperty)));
        if (!this.IsEnabled()) {
          this.GetElementHandle().style.removeProperty("color")}
         else if ((this.FElementFont === pas["WEBLib.Controls"].TElementFont.efProperty) && (this.FElementClassName === "")) {
          this.GetElementHandle().style.setProperty("color",pas["WEBLib.Graphics"].ColorToHTML(this.FFont.FColor));
          if ((pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) && (this.GetElementHandle().firstChild != null)) this.GetElementHandle().firstChild.style.setProperty("color",pas["WEBLib.Graphics"].ColorToHTML(this.FFont.FColor));
        };
      };
    };
    this.UpdateGroup = function () {
      var i = 0;
      if (this.FParent != null) {
        for (var $l = 0, $end = this.FParent.GetControlsCount() - 1; $l <= $end; $l++) {
          i = $l;
          if ((this.FParent.GetControls(i) !== this) && $mod.TSpeedButton.isPrototypeOf(this.FParent.GetControls(i)) && (rtl.as(this.FParent.GetControls(i),$mod.TSpeedButton).FGroupIndex === this.FGroupIndex)) rtl.as(this.FParent.GetControls(i),$mod.TSpeedButton).SetDown(false);
        };
      };
    };
    this.DoMouseLeave = function () {
      var frm = null;
      pas["WEBLib.Controls"].TControl.DoMouseLeave.call(this);
      frm = pas["WEBLib.Forms"].GetParentForm(this);
      if ((frm != null) && (frm.FCSSLibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap) && this.FShowHint && (this.FHint !== "")) return;
      this.SetIntColor(this.FColor$1);
    };
    this.DoMouseEnter = function () {
      var frm = null;
      pas["WEBLib.Controls"].TControl.DoMouseEnter.call(this);
      frm = pas["WEBLib.Forms"].GetParentForm(this);
      if ((frm != null) && (frm.FCSSLibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap) && this.FShowHint && (this.FHint !== "")) return;
      if (this.FEnabled) this.SetIntColor(12632256);
    };
    this.MouseUp = function (Button, Shift, X, Y) {
      pas["WEBLib.Controls"].TControl.MouseUp.apply(this,arguments);
      if (this.FEnabled) this.SetIntColor(12632256);
    };
    this.MouseDown = function (Button, Shift, X, Y) {
      pas["WEBLib.Controls"].TControl.MouseDown.apply(this,arguments);
      if (!this.FEnabled) return;
      this.SetIntColor(8421504);
      if (this.FGroupIndex > 0) {
        if (this.FDown && this.FAllowAllUp) {
          this.SetDown(false)}
         else {
          this.SetDown(true);
          this.UpdateGroup();
        };
      };
    };
    this.GlyphChanged = function (Sender) {
      this.UpdateElement();
    };
    this.InitCSSLibrary = function (ALibrary) {
      if (ALibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap) {
        this.SetElementClassName("btn btn-light");
        this.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
        this.SetHeightStyle(pas["WEBLib.Controls"].TSizeStyle.ssAuto);
      };
    };
    this.Destroy = function () {
      rtl.free(this,"FGlyph");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.FColor$1 = -1;
      this.FIntColor = -1;
      this.FGroupIndex = 0;
      this.FDown = false;
      this.FFlat = false;
      this.FGlyph = pas["WEBLib.Graphics"].TURLPicture.$create("Create");
      this.FGlyph.FOnChange = rtl.createCallback(this,"GlyphChanged");
      this.FGlyph.FOnDataChange = rtl.createCallback(this,"GlyphChanged");
      this.FLayout = $mod.TButtonLayout.blGlyphLeft;
      this.FMaterialGlyphSize = 18;
      this.FMaterialGlyphColor = -1;
      this.FMaterialGlyphType = pas["WEBLib.Controls"].TMaterialGlyphType.mgNormal;
    };
    this.CanFocus = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TSpeedButton",this.TCustomSpeedButton,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("AllowAllUp",0,rtl.boolean,"FAllowAllUp","FAllowAllUp");
    $r.addProperty("Caption",2,rtl.string,"FCaption","SetCaption");
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor$1","SetColorEx",4,{Default: -1});
    $r.addProperty("Down",2,rtl.boolean,"FDown","SetDown");
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Flat",2,rtl.boolean,"FFlat","SetFlat",4,{Default: false});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("Glyph",2,pas["WEBLib.Graphics"].$rtti["TURLPicture"],"FGlyph","SetGlyph");
    $r.addProperty("GlyphURL",2,rtl.string,"FGlyphURL","SetGlyphURL");
    $r.addProperty("GlyphSize",2,rtl.longint,"FGlyphSize","SetGlyphSize",4,{Default: 0});
    $r.addProperty("GroupIndex",2,rtl.longint,"FGroupIndex","SetGroupIndex");
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Hint",2,rtl.string,"FHint","SetHint");
    $r.addProperty("Layout",0,$mod.$rtti["TButtonLayout"],"FLayout","FLayout",4,{Default: $mod.TButtonLayout.blGlyphLeft});
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("MaterialGlyph",2,rtl.string,"FMaterialGlyph","SetMaterialGlyph");
    $r.addProperty("MaterialGlyphColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FMaterialGlyphColor","SetMaterialGyphColor",4,{Default: -1});
    $r.addProperty("MaterialGlyphSize",2,rtl.longint,"FMaterialGlyphSize","SetMaterialGlyphSize",4,{Default: 18});
    $r.addProperty("MaterialGlyphType",2,pas["WEBLib.Controls"].$rtti["TMaterialGlyphType"],"FMaterialGlyphType","SetMaterialGlyphType",4,{Default: pas["WEBLib.Controls"].TMaterialGlyphType.mgNormal});
    $r.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",4,{Default: true});
    $r.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti["TPopupMenu"],"FPopupMenu","FPopupMenu");
    $r.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",4,{Default: false});
    $r.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder");
    $r.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",4,{Default: true});
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnKeyDown",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyDown","FOnKeyDown");
    $r.addProperty("OnKeyPress",0,pas["WEBLib.Controls"].$rtti["TKeyPressEvent"],"FOnKeyPress","FOnKeyPress");
    $r.addProperty("OnKeyUp",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyUp","FOnKeyUp");
    $r.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseDown","FOnMouseDown");
    $r.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseUp","FOnMouseUp");
    $r.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti["TMouseMoveEvent"],"FOnMouseMove","FOnMouseMove");
    $r.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseLeave","FOnMouseLeave");
    $r.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseEnter","FOnMouseEnter");
    $r.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnEnter","FOnEnter");
    $r.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnExit","FOnExit");
  });
  rtl.createClass(this,"TWebSpeedButton",this.TSpeedButton,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TCustomBitBtn",pas["WEBLib.Controls"].TCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Controls"].TCustomControl.$init.call(this);
      this.FMaterialGlyph = "";
      this.FLayout = 0;
      this.FFlat = false;
      this.FGlyph = null;
      this.FColor$1 = 0;
      this.FIntColor = 0;
      this.FAlignment = 0;
      this.FGlyphURL = "";
      this.FMaterialGlyphSize = 0;
      this.FMaterialGlyphColor = 0;
      this.FMaterialGlyphType = 0;
      this.FGlyphSize = 0;
      this.FModalResult = 0;
      this.FDefault = false;
      this.FCancel = false;
    };
    this.$final = function () {
      this.FGlyph = undefined;
      pas["WEBLib.Controls"].TCustomControl.$final.call(this);
    };
    this.SetFlat = function (Value) {
      if (this.FFlat !== Value) {
        this.FFlat = Value;
        this.RecreateElement();
      };
    };
    this.SetGlyph = function (Value) {
      this.FGlyph.Assign(Value);
      this.UpdateElement();
    };
    this.SetLayout = function (Value) {
      if (this.FLayout !== Value) {
        this.FLayout = Value;
        this.UpdateElement();
      };
    };
    this.SetMaterialGlyph = function (Value) {
      if (this.FMaterialGlyph !== Value) {
        this.FMaterialGlyph = Value;
        this.UpdateElement();
      };
    };
    this.SetColorEx = function (Value) {
      if (this.FColor$1 !== Value) {
        this.FColor$1 = Value;
        this.SetColor(Value);
        this.UpdateElement();
      };
    };
    this.SetIntColor = function (Value) {
      this.FIntColor = Value;
    };
    this.SetAlignment = function (Value) {
      if (this.FAlignment !== Value) {
        this.FAlignment = Value;
        this.UpdateElement();
      };
    };
    this.SetGlyphURL = function (Value) {
      if (this.FGlyphURL !== Value) {
        this.FGlyphURL = Value;
        this.UpdateElement();
      };
    };
    this.SetMaterialGlyphSize = function (Value) {
      if ((Value > 0) && (Value < 100)) {
        this.FMaterialGlyphSize = Value;
        this.UpdateElement();
      };
    };
    this.SetMaterialGyphColor = function (Value) {
      if (this.FMaterialGlyphColor !== Value) {
        this.FMaterialGlyphColor = Value;
        this.UpdateElement();
      };
    };
    this.SetMaterialGlyphType = function (Value) {
      if (this.FMaterialGlyphType !== Value) {
        this.FMaterialGlyphType = Value;
        this.UpdateElement();
      };
    };
    this.SetGlyphSize = function (Value) {
      if (this.FGlyphSize !== Value) {
        this.FGlyphSize = Value;
        this.UpdateElement();
      };
    };
    this.SetCaption = function (AValue) {
      if (this.FCaption !== AValue) {
        pas["WEBLib.Controls"].TCustomControl.SetCaption.call(this,AValue);
        this.UpdateElement();
      };
    };
    this.CreateElement = function () {
      var Result = null;
      if (this.FFlat) {
        Result = document.createElement("SPAN")}
       else {
        Result = document.createElement("BUTTON");
        Result.setAttribute("type","BUTTON");
      };
      return Result;
    };
    this.UpdateElement = function () {
      var s = "";
      var inactive = "";
      var noptr = "";
      var matgl = "";
      var imgsrc = "";
      var matclr = "";
      var cap = "";
      var acc = "";
      var gs = "";
      pas["WEBLib.Controls"].TControl.UpdateElement.call(this);
      if (this.GetElementHandle() != null) {
        if ((this.FColor$1 !== -1) && !this.FFlat) {
          this.GetElementHandle().style.setProperty("background-color",pas["WEBLib.Graphics"].ColorToHTML(this.FColor$1))}
         else this.GetElementHandle().style.setProperty("background-color","");
        this.GetElementHandle().style.setProperty("vertical-align","middle");
        if (this.FVisible) this.GetElementHandle().style.setProperty("display","table");
        this.GetElementHandle().style.setProperty("overflow","hidden");
        this.GetElementHandle().style.setProperty("padding","0px");
        var $tmp = this.FAlignment;
        if ($tmp === pas.Classes.TAlignment.taLeftJustify) {
          this.GetElementHandle().style.setProperty("text-align","left")}
         else if ($tmp === pas.Classes.TAlignment.taCenter) {
          this.GetElementHandle().style.setProperty("text-align","center")}
         else if ($tmp === pas.Classes.TAlignment.taRightJustify) this.GetElementHandle().style.setProperty("text-align","right");
        s = "";
        inactive = "";
        noptr = "";
        matgl = "";
        if (!this.FEnabled) inactive = " md-light md-inactive";
        noptr = "pointer-events:none";
        if (this.FMaterialGlyph !== "") {
          matclr = "";
          if (this.FMaterialGlyphColor !== -1) matclr = ";color:" + pas["WEBLib.Graphics"].ColorToHTML(this.FMaterialGlyphColor);
          matgl = '<i class="' + pas["WEBLib.Controls"].GetMaterialClass(this.FMaterialGlyphType) + inactive + '" translate="no" style="vertical-align:middle;' + noptr + ";font-size:" + pas.SysUtils.IntToStr(this.FMaterialGlyphSize) + "px" + matclr + '">' + this.FMaterialGlyph + "</i>";
        };
        if ((this.GetElementHandle().childElementCount === 0) || !this.GetIsLinked()) cap = pas["WEBLib.WebTools"].ProcessAccelerator(this.FCaption,{get: function () {
            return acc;
          }, set: function (v) {
            acc = v;
          }});
        if (acc !== "") this.GetElementHandle().setAttribute("accesskey",acc);
        if (cap !== "") s = '<span style="' + noptr + '">' + cap + "</span>";
        gs = "";
        if (this.FGlyphSize !== 0) gs = "width:" + pas.SysUtils.TIntegerHelper.ToString$1.call({p: this, get: function () {
            return this.p.FGlyphSize;
          }, set: function (v) {
            this.p.FGlyphSize = v;
          }}) + "px;";
        if (this.FGlyph.GetData() !== "") {
          imgsrc = "data:image/jpeg;base64," + pas["WEBLib.WebTools"].HexImageDecodeAsBase64(this.FGlyph.GetData())}
         else if (this.FGlyph.FFilename !== "") {
          imgsrc = this.FGlyph.FFilename}
         else if (this.FGlyphURL !== "") imgsrc = this.FGlyphURL;
        var $tmp1 = this.FLayout;
        if ($tmp1 === $mod.TButtonLayout.blGlyphLeft) {
          if (matgl !== "") {
            if (cap !== "") {
              s = matgl + "&nbsp;" + s}
             else s = matgl;
          };
          if (imgsrc !== "") s = '<img style="vertical-align:middle;' + gs + '" src="' + imgsrc + '">&nbsp;' + s;
        } else if ($tmp1 === $mod.TButtonLayout.blGlyphRight) {
          if (matgl !== "") {
            if (cap !== "") {
              s = s + "&nbsp;" + matgl}
             else s = matgl;
          };
          if (imgsrc !== "") s = s + '&nbsp;<img style="' + gs + '" src="' + imgsrc + '">';
        } else if ($tmp1 === $mod.TButtonLayout.blGlyphTop) {
          if (matgl !== "") {
            if (cap !== "") {
              s = matgl + "<br>" + s}
             else s = matgl;
          };
          if (imgsrc !== "") s = '<img style="' + gs + '" src="' + imgsrc + '"><br>' + s;
        } else if ($tmp1 === $mod.TButtonLayout.blGlyphBottom) {
          if (matgl !== "") {
            if (cap !== "") {
              s = s + "<br>" + matgl}
             else s = matgl;
          };
          if (imgsrc !== "") s = s + '<br><img style="' + gs + '" src="' + imgsrc + '">';
        };
        this.GetElementHandle().innerHTML = s;
        pas["WEBLib.Controls"].SetHTMLElementFont(this.GetElementHandle(),this.FFont,!((this.FElementClassName === "") && (this.FElementFont === pas["WEBLib.Controls"].TElementFont.efProperty)));
      };
    };
    this.UpdateElementVisual = function () {
      pas["WEBLib.Controls"].TCustomControl.UpdateElementVisual.call(this);
      if (this.GetElementHandle() != null) {
        this.GetElementHandle().style.removeProperty("outline");
        this.GetElementHandle().style.removeProperty("user-select");
      };
    };
    this.Click = function () {
      var frm = null;
      pas["WEBLib.Controls"].TControl.Click.call(this);
      if (this.FModalResult !== 0) {
        frm = pas["WEBLib.Forms"].GetParentForm(this);
        if (frm != null) frm.SetModalResult(this.FModalResult);
      };
    };
    this.GlyphChanged = function (Sender) {
      this.UpdateElement();
    };
    this.HandleKeyPreview = function (Key) {
      pas["WEBLib.Controls"].TControl.HandleKeyPreview.apply(this,arguments);
      if (this.FDefault && (Key === 13)) {
        this.Click();
      };
      if (this.FCancel && (Key === 27)) {
        this.Click();
      };
    };
    this.InitCSSLibrary = function (ALibrary) {
      if (ALibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap) {
        this.SetElementClassName("btn btn-light");
        this.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
        this.SetHeightStyle(pas["WEBLib.Controls"].TSizeStyle.ssAuto);
      };
    };
    this.Destroy = function () {
      rtl.free(this,"FGlyph");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.FColor$1 = -1;
      this.FIntColor = -1;
      this.FFlat = false;
      this.SetWidth(80);
      this.SetHeight(25);
      this.FAlignment = pas.Classes.TAlignment.taCenter;
      this.FGlyph = pas["WEBLib.Graphics"].TURLPicture.$create("Create");
      this.FGlyph.FOnChange = rtl.createCallback(this,"GlyphChanged");
      this.FGlyph.FOnDataChange = rtl.createCallback(this,"GlyphChanged");
      this.FGlyphSize = 0;
      this.FMaterialGlyphSize = 18;
      this.FMaterialGlyphColor = -1;
      this.FMaterialGlyphType = pas["WEBLib.Controls"].TMaterialGlyphType.mgNormal;
      this.FModalResult = 0;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TBitBtn",this.TCustomBitBtn,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Alignment",2,pas.Classes.$rtti["TAlignment"],"FAlignment","SetAlignment",4,{Default: pas.Classes.TAlignment.taCenter});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("Cancel",0,rtl.boolean,"FCancel","FCancel",4,{Default: false});
    $r.addProperty("Caption",2,rtl.string,"FCaption","SetCaption");
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor$1","SetColorEx");
    $r.addProperty("Default",0,rtl.boolean,"FDefault","FDefault",4,{Default: false});
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("Flat",2,rtl.boolean,"FFlat","SetFlat",4,{Default: false});
    $r.addProperty("Glyph",2,pas["WEBLib.Graphics"].$rtti["TURLPicture"],"FGlyph","SetGlyph");
    $r.addProperty("GlyphURL",2,rtl.string,"FGlyphURL","SetGlyphURL");
    $r.addProperty("GlyphSize",2,rtl.longint,"FGlyphSize","SetGlyphSize",4,{Default: 0});
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Hint",2,rtl.string,"FHint","SetHint");
    $r.addProperty("Layout",2,$mod.$rtti["TButtonLayout"],"FLayout","SetLayout",4,{Default: $mod.TButtonLayout.blGlyphLeft});
    $r.addProperty("MaterialGlyph",2,rtl.string,"FMaterialGlyph","SetMaterialGlyph");
    $r.addProperty("MaterialGlyphColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FMaterialGlyphColor","SetMaterialGyphColor",4,{Default: -1});
    $r.addProperty("MaterialGlyphSize",2,rtl.longint,"FMaterialGlyphSize","SetMaterialGlyphSize",4,{Default: 18});
    $r.addProperty("MaterialGlyphType",2,pas["WEBLib.Controls"].$rtti["TMaterialGlyphType"],"FMaterialGlyphType","SetMaterialGlyphType",4,{Default: pas["WEBLib.Controls"].TMaterialGlyphType.mgNormal});
    $r.addProperty("ModalResult",0,rtl.longint,"FModalResult","FModalResult",4,{Default: 0});
    $r.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",4,{Default: true});
    $r.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",4,{Default: false});
    $r.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder");
    $r.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",4,{Default: true});
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnKeyDown",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyDown","FOnKeyDown");
    $r.addProperty("OnKeyPress",0,pas["WEBLib.Controls"].$rtti["TKeyPressEvent"],"FOnKeyPress","FOnKeyPress");
    $r.addProperty("OnKeyUp",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyUp","FOnKeyUp");
    $r.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseDown","FOnMouseDown");
    $r.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseUp","FOnMouseUp");
    $r.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti["TMouseMoveEvent"],"FOnMouseMove","FOnMouseMove");
    $r.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseLeave","FOnMouseLeave");
    $r.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseEnter","FOnMouseEnter");
    $r.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnEnter","FOnEnter");
    $r.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnExit","FOnExit");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
  });
  rtl.createClass(this,"TWebBitBtn",this.TBitBtn,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TCustomToolBar",pas["WEBLib.Controls"].TCustomControl,function () {
    this.CreateElement = function () {
      var Result = null;
      var el = null;
      Result = document.createElement("SPAN");
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        el = document.createElement("DIV");
        el.style.setProperty("z-index","10");
        el.style.setProperty("width","100%");
        el.style.setProperty("height","100%");
        el.style.setProperty("webkit-user-select","none");
        el.style.setProperty("moz-user-select","none");
        el.style.setProperty("khtml-user-select","none");
        el.style.setProperty("ms-user-select","none");
        el.style.setProperty("user-select","none");
        el.style.setProperty("position","absolute");
        Result.appendChild(el);
      };
      return Result;
    };
    this.UpdateElement = function () {
      pas["WEBLib.Controls"].TControl.UpdateElement.call(this);
      if (this.GetElementHandle() != null) {
        this.GetElementHandle().style.setProperty("display","flex");
        this.GetElementHandle().style.setProperty("flex-wrap","wrap");
        this.GetElementHandle().style.setProperty("padding","2px");
      };
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.SetColor(0xCFCFCF);
      this.FControlStyle = rtl.unionSet(this.FControlStyle,rtl.createSet(pas["WEBLib.Controls"].TControlStyleValue.csAcceptsControls));
      this.SetWidth(300);
      this.SetHeight(32);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TToolBar",this.TCustomToolBar,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor",4,{Default: 13619151});
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Hint",2,rtl.string,"FHint","SetHint");
    $r.addProperty("Left",3,rtl.longint,"GetLeft","SetLeft");
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",4,{Default: false});
    $r.addProperty("Top",3,rtl.longint,"GetTop","SetTop");
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
  });
  rtl.createClass(this,"TWebToolBar",this.TToolBar,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.TRichEditBtn = {"0": "reFont", reFont: 0, "1": "reFontSize", reFontSize: 1, "2": "reBold", reBold: 2, "3": "reItalic", reItalic: 3, "4": "reUnderline", reUnderline: 4, "5": "reStrikeThrough", reStrikeThrough: 5, "6": "reAlignLeft", reAlignLeft: 6, "7": "reAlignCenter", reAlignCenter: 7, "8": "reAlignRight", reAlignRight: 8, "9": "reUnorderedList", reUnorderedList: 9, "10": "reOrderedList", reOrderedList: 10, "11": "reForegroundColor", reForegroundColor: 11, "12": "reBackgroundColor", reBackgroundColor: 12, "13": "reHyperlink", reHyperlink: 13, "14": "reImageInsert", reImageInsert: 14, "15": "reLineSpacing", reLineSpacing: 15};
  this.$rtti.$Enum("TRichEditBtn",{minvalue: 0, maxvalue: 15, ordtype: 1, enumtype: this.TRichEditBtn});
  this.$rtti.$Set("TRichEditButtonSet",{comptype: this.$rtti["TRichEditBtn"]});
  rtl.createClass(this,"TRichEditToolBar",this.TToolBar,function () {
    this.$init = function () {
      $mod.TToolBar.$init.call(this);
      this.FBold = null;
      this.FItalic = null;
      this.FUnderline = null;
      this.FStrikeThrough = null;
      this.FAlignLeft = null;
      this.FAlignCenter = null;
      this.FAlignRight = null;
      this.FUList = null;
      this.FOList = null;
      this.FURL = null;
      this.FRichEdit = null;
      this.FFnt = null;
      this.FFntSize = null;
      this.FFgClr = null;
      this.FBkClr = null;
      this.FImage = null;
      this.FLineSpacing = null;
      this.FOnSpeedButtonClick = null;
      this.FTextColor = 0;
      this.FBackgroundColor = 0;
      this.FVisibleButtons = {};
      this.FHints = null;
      this.FBtnID = "";
      this.FFilePicker = null;
      this.FPtrFileLoad = null;
    };
    this.$final = function () {
      this.FBold = undefined;
      this.FItalic = undefined;
      this.FUnderline = undefined;
      this.FStrikeThrough = undefined;
      this.FAlignLeft = undefined;
      this.FAlignCenter = undefined;
      this.FAlignRight = undefined;
      this.FUList = undefined;
      this.FOList = undefined;
      this.FURL = undefined;
      this.FRichEdit = undefined;
      this.FFnt = undefined;
      this.FFntSize = undefined;
      this.FFgClr = undefined;
      this.FBkClr = undefined;
      this.FImage = undefined;
      this.FLineSpacing = undefined;
      this.FOnSpeedButtonClick = undefined;
      this.FVisibleButtons = undefined;
      this.FHints = undefined;
      this.FFilePicker = undefined;
      $mod.TToolBar.$final.call(this);
    };
    this.SetRichEdit = function (AValue) {
      if (AValue != null) {
        this.FRichEdit = AValue;
        this.FRichEdit.FOwner$1 = this;
        this.FRichEdit.FOnAttributesChanged = rtl.createCallback(this,"HandleAttributeChanged");
      };
    };
    this.GetRichEdit = function () {
      var Result = null;
      Result = this.FRichEdit;
      return Result;
    };
    this.SetTextColor = function (Value) {
      this.FTextColor = Value;
      this.FFgClr.SetColor$1(Value);
    };
    this.SetBackgroundColor = function (Value) {
      this.FBackgroundColor = Value;
      this.FBkClr.SetColor$1(Value);
    };
    this.SetVisibleButtons = function (Value) {
      this.FVisibleButtons = rtl.refSet(Value);
      this.UpdateButtons();
    };
    this.SetHints = function (Value) {
      this.FHints.Assign(Value);
    };
    this.HandleDoFileLoad = function (Event) {
      var $Self = this;
      var Result = false;
      function InsertImage(DataURL) {
        $Self.GetRichEdit().InsertImage(DataURL);
      };
      if (1 < 0) InsertImage("");
      var file = this.FFilePicker.files[0];
          var reader  = new FileReader();
      
          reader.addEventListener("load", function () {
              InsertImage(reader.result);
          }, false);
      
          if (file)
              reader.readAsDataURL(file);
      Result = true;
      return Result;
    };
    this.Notification = function (AComponent, Operation) {
      pas.Classes.TComponent.Notification.apply(this,arguments);
      if ((Operation === pas.Classes.TOperation.opRemove) && (AComponent === this.FRichEdit)) {
        this.FRichEdit = null;
      };
    };
    this.CreateButton = function (btn, BtnID, Glyph, Hint) {
      btn.set($mod.TSpeedButton.$create("Create$2",[BtnID]));
      btn.get().SetName(BtnID);
      btn.get().SetFlat(true);
      btn.get().SetElementPosition(pas["WEBLib.Controls"].TElementPosition.epRelative);
      btn.get().SetParent(this);
      btn.get().SetMaterialGlyph(Glyph);
      btn.get().SetTop(0);
      btn.get().SetWidth(32);
      btn.get().SetHeight(24);
      btn.get().SetHint(Hint);
      btn.get().SetShowHint(Hint !== "");
      btn.get().SetEnabled(true);
      btn.get().FOnClick = rtl.createCallback(this,"HandleSpeedButtonClick");
    };
    this.HandleSpeedButtonClick = function (Sender) {
      var BID = "";
      if (this.GetRichEdit() != null) {
        BID = Sender.GetID();
        if (BID === (this.FBtnID + "_bold")) {
          if (pas["WEBLib.Graphics"].TFontStyle.fsBold in this.GetRichEdit().FSelAttributes.FStyle) {
            this.GetRichEdit().FSelAttributes.SetStyle(rtl.diffSet(this.GetRichEdit().FSelAttributes.FStyle,rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsBold)))}
           else this.GetRichEdit().FSelAttributes.SetStyle(rtl.unionSet(this.GetRichEdit().FSelAttributes.FStyle,rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsBold)));
        } else if (BID === (this.FBtnID + "_italic")) {
          if (pas["WEBLib.Graphics"].TFontStyle.fsItalic in this.GetRichEdit().FSelAttributes.FStyle) {
            this.GetRichEdit().FSelAttributes.SetStyle(rtl.diffSet(this.GetRichEdit().FSelAttributes.FStyle,rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsItalic)))}
           else this.GetRichEdit().FSelAttributes.SetStyle(rtl.unionSet(this.GetRichEdit().FSelAttributes.FStyle,rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsItalic)));
        } else if (BID === (this.FBtnID + "_underline")) {
          if (pas["WEBLib.Graphics"].TFontStyle.fsUnderline in this.GetRichEdit().FSelAttributes.FStyle) {
            this.GetRichEdit().FSelAttributes.SetStyle(rtl.diffSet(this.GetRichEdit().FSelAttributes.FStyle,rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsUnderline)))}
           else this.GetRichEdit().FSelAttributes.SetStyle(rtl.unionSet(this.GetRichEdit().FSelAttributes.FStyle,rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsUnderline)));
        } else if (BID === (this.FBtnID + "_strikethrough")) {
          if (pas["WEBLib.Graphics"].TFontStyle.fsStrikeOut in this.GetRichEdit().FSelAttributes.FStyle) {
            this.GetRichEdit().FSelAttributes.SetStyle(rtl.diffSet(this.GetRichEdit().FSelAttributes.FStyle,rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsStrikeOut)))}
           else this.GetRichEdit().FSelAttributes.SetStyle(rtl.unionSet(this.GetRichEdit().FSelAttributes.FStyle,rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsStrikeOut)));
        } else if (BID === (this.FBtnID + "_alignleft")) {
          this.GetRichEdit().FSelAttributes.SetAlignment(pas.Classes.TAlignment.taLeftJustify)}
         else if (BID === (this.FBtnID + "_aligncenter")) {
          this.GetRichEdit().FSelAttributes.SetAlignment(pas.Classes.TAlignment.taCenter)}
         else if (BID === (this.FBtnID + "_alignright")) {
          this.GetRichEdit().FSelAttributes.SetAlignment(pas.Classes.TAlignment.taRightJustify)}
         else if (BID === (this.FBtnID + "_olist")) {
          this.GetRichEdit().FSelAttributes.SetOrderedList(!this.GetRichEdit().FSelAttributes.FOrderedList)}
         else if (BID === (this.FBtnID + "_ulist")) {
          this.GetRichEdit().FSelAttributes.SetUnOrderedList(!this.GetRichEdit().FSelAttributes.FUnOrderedList)}
         else if (BID === (this.FBtnID + "_url")) {
          this.GetRichEdit().FSelAttributes.Link()}
         else if (BID === (this.FBtnID + "_image")) this.FFilePicker.click();
      };
      if (this.FOnSpeedButtonClick != null) this.FOnSpeedButtonClick(Sender);
    };
    this.FgSelect = function (Sender) {
      if (this.GetRichEdit() != null) this.GetRichEdit().FSelAttributes.SetColor(this.FFgClr.GetColor());
    };
    this.BkSelect = function (Sender) {
      if (this.GetRichEdit() != null) this.GetRichEdit().FSelAttributes.SetBackColor(this.FBkClr.GetColor());
    };
    this.FntChange = function (Sender) {
      if (this.GetRichEdit() != null) this.GetRichEdit().FSelAttributes.SetName(this.FFnt.FItems.Get(this.FFnt.GetItemIndex()));
    };
    this.FntSizeChange = function (Sender) {
      if (this.GetRichEdit() != null) this.GetRichEdit().FSelAttributes.SetHeight(this.FFntSize.GetItemIndex() + 1);
    };
    this.LineSpacingChange = function (Sender) {
      var spacing = 0.0;
      var $tmp = this.FLineSpacing.GetItemIndex();
      if ($tmp === 0) {
        spacing = 1}
       else if ($tmp === 1) {
        spacing = 1.5}
       else if ($tmp === 2) spacing = 2;
      this.FRichEdit.SetSelectionSpacing(spacing);
    };
    this.UpdateButtons = function () {
      if (this.IsUpdating()) return;
      this.FBold.SetVisible($mod.TRichEditBtn.reBold in this.FVisibleButtons);
      this.FItalic.SetVisible($mod.TRichEditBtn.reItalic in this.FVisibleButtons);
      this.FUnderline.SetVisible($mod.TRichEditBtn.reUnderline in this.FVisibleButtons);
      this.FStrikeThrough.SetVisible($mod.TRichEditBtn.reStrikeThrough in this.FVisibleButtons);
      this.FAlignLeft.SetVisible($mod.TRichEditBtn.reAlignLeft in this.FVisibleButtons);
      this.FAlignCenter.SetVisible($mod.TRichEditBtn.reAlignCenter in this.FVisibleButtons);
      this.FAlignRight.SetVisible($mod.TRichEditBtn.reAlignRight in this.FVisibleButtons);
      this.FUList.SetVisible($mod.TRichEditBtn.reUnorderedList in this.FVisibleButtons);
      this.FOList.SetVisible($mod.TRichEditBtn.reOrderedList in this.FVisibleButtons);
      this.FFnt.SetVisible($mod.TRichEditBtn.reFont in this.FVisibleButtons);
      this.FFntSize.SetVisible($mod.TRichEditBtn.reFontSize in this.FVisibleButtons);
      this.FFgClr.SetVisible($mod.TRichEditBtn.reForegroundColor in this.FVisibleButtons);
      this.FBkClr.SetVisible($mod.TRichEditBtn.reBackgroundColor in this.FVisibleButtons);
      this.FURL.SetVisible($mod.TRichEditBtn.reHyperlink in this.FVisibleButtons);
      this.FImage.SetVisible($mod.TRichEditBtn.reImageInsert in this.FVisibleButtons);
      this.FLineSpacing.SetVisible($mod.TRichEditBtn.reLineSpacing in this.FVisibleButtons);
      if (this.FElementPosition === pas["WEBLib.Controls"].TElementPosition.epRelative) {
        if (this.GetElementHandle() != null) {
          this.GetElementHandle().style.setProperty("display","flex");
          this.GetElementHandle().style.setProperty("flex-wrap","wrap");
          this.GetElementHandle().style.setProperty("padding","2px");
        };
      };
      while (this.FHints.GetCount() < 14) this.FHints.Add("");
      this.FBold.SetHint(this.FHints.Get(0));
      this.FItalic.SetHint(this.FHints.Get(1));
      this.FUnderline.SetHint(this.FHints.Get(2));
      this.FStrikeThrough.SetHint(this.FHints.Get(3));
      this.FFgClr.SetHint(this.FHints.Get(4));
      this.FBkClr.SetHint(this.FHints.Get(5));
      this.FAlignLeft.SetHint(this.FHints.Get(6));
      this.FAlignCenter.SetHint(this.FHints.Get(7));
      this.FAlignRight.SetHint(this.FHints.Get(8));
      this.FUList.SetHint(this.FHints.Get(9));
      this.FOList.SetHint(this.FHints.Get(10));
      this.FURL.SetHint(this.FHints.Get(11));
      this.FImage.SetHint(this.FHints.Get(12));
      this.FLineSpacing.SetHint(this.FHints.Get(13));
    };
    this.UpdateElement = function () {
      $mod.TCustomToolBar.UpdateElement.call(this);
      if (this.GetElementHandle() != null) {
        this.GetElementHandle().style.setProperty("height","32px");
      };
    };
    this.Loaded = function () {
      pas["WEBLib.Controls"].TCustomControl.Loaded.call(this);
      this.UpdateButtons();
      this.InitButtons();
    };
    this.HandleAttributeChanged = function (Sender, Attributes) {
      this.FFnt.SetItemIndex(Math.max(0,this.FFnt.FItems.IndexOf(Attributes.FontName)));
      this.FFntSize.SetItemIndex(Math.max(0,this.FFntSize.FItems.IndexOf(Attributes.FontSize)));
      this.FBold.SetDown(Attributes.IsBold);
      this.FItalic.SetDown(Attributes.IsItalic);
      this.FUnderline.SetDown(Attributes.IsUnderline);
      this.FStrikeThrough.SetDown(Attributes.IsStrikeOut);
      this.FAlignLeft.SetDown(Attributes.IsLeft);
      this.FAlignRight.SetDown(Attributes.IsRight);
      this.FAlignCenter.SetDown(Attributes.IsCenter);
      if (Attributes.FontColor !== "") {
        this.FFgClr.SetColor$1(pas["WEBLib.Graphics"].HexToColor(Attributes.FontColor));
      };
      if (Attributes.BkColor !== "") {
        this.FBkClr.SetColor$1(pas["WEBLib.Graphics"].RGBToColor(Attributes.BkColor));
      };
    };
    this.GetChildren = function (Proc, Root) {
    };
    this.InitButtons = function () {
      var $Self = this;
      var Result = false;
      function HandleTimeOut() {
        var i = 0;
        for (var $l = 0, $end = $Self.GetControlsCount() - 1; $l <= $end; $l++) {
          i = $l;
          $Self.GetControls(i).UpdateElement();
        };
      };
      Result = true;
      if (!this.GetIsLinked()) return Result;
      if (1 < 0) HandleTimeOut();
      setTimeout(function() {HandleTimeOut();}, 10);
      return Result;
    };
    this.SetParent = function (AValue) {
      pas["WEBLib.Controls"].TControl.SetParent.apply(this,arguments);
      if (!(pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) this.InitButtons();
    };
    this.CreateInitialize = function () {
      $mod.TCustomToolBar.CreateInitialize.call(this);
      this.FVisibleButtons = rtl.createSet($mod.TRichEditBtn.reFont,$mod.TRichEditBtn.reFontSize,$mod.TRichEditBtn.reBold,$mod.TRichEditBtn.reItalic,$mod.TRichEditBtn.reUnderline,$mod.TRichEditBtn.reStrikeThrough,$mod.TRichEditBtn.reAlignLeft,$mod.TRichEditBtn.reAlignCenter,$mod.TRichEditBtn.reAlignRight,$mod.TRichEditBtn.reUnorderedList,$mod.TRichEditBtn.reOrderedList,$mod.TRichEditBtn.reForegroundColor,$mod.TRichEditBtn.reBackgroundColor,$mod.TRichEditBtn.reHyperlink,$mod.TRichEditBtn.reImageInsert,$mod.TRichEditBtn.reLineSpacing);
      this.SetRichEdit(null);
      this.SetWidth(540);
      this.SetHeight(32);
      this.FPtrFileLoad = rtl.createCallback(this,"HandleDoFileLoad");
      this.FControlStyle = rtl.diffSet(this.FControlStyle,rtl.createSet(pas["WEBLib.Controls"].TControlStyleValue.csAcceptsControls));
      this.FTextColor = 0;
      this.FBackgroundColor = 16777215;
      this.FBtnID = pas["WEBLib.Controls"].FindUniqueName("RETBBtn");
      this.FHints = pas.Classes.TStringList.$create("Create$1");
      this.FHints.Add("Bold");
      this.FHints.Add("Italic");
      this.FHints.Add("Underline");
      this.FHints.Add("Strike Throught");
      this.FHints.Add("Text Color");
      this.FHints.Add("Background Color");
      this.FHints.Add("Align left");
      this.FHints.Add("Align center");
      this.FHints.Add("Align right");
      this.FHints.Add("Numbered list");
      this.FHints.Add("List");
      this.FHints.Add("Hyperlink");
      this.FHints.Add("Insert image");
      this.FHints.Add("Line spacing");
      this.FLineSpacing = pas["WEBLib.StdCtrls"].TLineSpacingPicker.$create("Create$1",[this]);
      this.FLineSpacing.SetName(this.FBtnID + "_linespacing");
      this.FLineSpacing.SetElementPosition(pas["WEBLib.Controls"].TElementPosition.epRelative);
      this.FLineSpacing.SetParent(this);
      this.FLineSpacing.SetWidth(40);
      this.FLineSpacing.SetItemIndex(0);
      this.FLineSpacing.SetShowHint(true);
      this.FLineSpacing.SetHint(this.FHints.Get(13));
      this.FLineSpacing.FOnChange = rtl.createCallback(this,"LineSpacingChange");
      this.FFilePicker = document.createElement("INPUT");
      this.FFilePicker.setAttribute("type","file");
      this.FFilePicker.style.setProperty("visibility","hidden");
      this.FFilePicker.addEventListener("change",this.FPtrFileLoad);
      this.GetElementHandle().appendChild(this.FFilePicker);
      this.CreateButton({p: this, get: function () {
          return this.p.FImage;
        }, set: function (v) {
          this.p.FImage = v;
        }},this.FBtnID + "_image","&#xE3f4;",this.FHints.Get(12));
      this.CreateButton({p: this, get: function () {
          return this.p.FURL;
        }, set: function (v) {
          this.p.FURL = v;
        }},this.FBtnID + "_url","&#xE250;",this.FHints.Get(11));
      this.CreateButton({p: this, get: function () {
          return this.p.FUList;
        }, set: function (v) {
          this.p.FUList = v;
        }},this.FBtnID + "_ulist","&#xE241;",this.FHints.Get(10));
      this.CreateButton({p: this, get: function () {
          return this.p.FOList;
        }, set: function (v) {
          this.p.FOList = v;
        }},this.FBtnID + "_olist","&#xE242;",this.FHints.Get(9));
      this.CreateButton({p: this, get: function () {
          return this.p.FAlignRight;
        }, set: function (v) {
          this.p.FAlignRight = v;
        }},this.FBtnID + "_alignright","&#xE237;",this.FHints.Get(8));
      this.CreateButton({p: this, get: function () {
          return this.p.FAlignCenter;
        }, set: function (v) {
          this.p.FAlignCenter = v;
        }},this.FBtnID + "_aligncenter","&#xE234;",this.FHints.Get(7));
      this.CreateButton({p: this, get: function () {
          return this.p.FAlignLeft;
        }, set: function (v) {
          this.p.FAlignLeft = v;
        }},this.FBtnID + "_alignleft","&#xE236;",this.FHints.Get(6));
      this.FBkClr = pas["WEBLib.StdCtrls"].TWebColorPicker.$create("Create$1",[this]);
      this.FBkClr.SetName(this.FBtnID + "_bkclr");
      this.FBkClr.SetElementPosition(pas["WEBLib.Controls"].TElementPosition.epRelative);
      this.FBkClr.SetParent(this);
      this.FBkClr.SetHint(this.FHints.Get(5));
      this.FBkClr.SetWidth(32);
      this.FBkClr.SetHeight(24);
      this.FBkClr.SetColor$1(16777215);
      this.FBkClr.FOnSelect = rtl.createCallback(this,"BkSelect");
      this.FBkClr.SetShowHint(true);
      this.FFgClr = pas["WEBLib.StdCtrls"].TWebColorPicker.$create("Create$1",[this]);
      this.FFgClr.SetName(this.FBtnID + "_fgclr");
      this.FFgClr.SetElementPosition(pas["WEBLib.Controls"].TElementPosition.epRelative);
      this.FFgClr.SetParent(this);
      this.FFgClr.SetHint(this.FHints.Get(4));
      this.FFgClr.SetWidth(32);
      this.FFgClr.SetHeight(24);
      this.FFgClr.SetColor$1(0);
      this.FFgClr.FOnSelect = rtl.createCallback(this,"FgSelect");
      this.FFgClr.SetShowHint(true);
      this.CreateButton({p: this, get: function () {
          return this.p.FStrikeThrough;
        }, set: function (v) {
          this.p.FStrikeThrough = v;
        }},this.FBtnID + "_strikethrough","&#xE257;",this.FHints.Get(3));
      this.CreateButton({p: this, get: function () {
          return this.p.FUnderline;
        }, set: function (v) {
          this.p.FUnderline = v;
        }},this.FBtnID + "_underline","&#xE249;",this.FHints.Get(2));
      this.CreateButton({p: this, get: function () {
          return this.p.FItalic;
        }, set: function (v) {
          this.p.FItalic = v;
        }},this.FBtnID + "_italic","&#xE23F;",this.FHints.Get(1));
      this.CreateButton({p: this, get: function () {
          return this.p.FBold;
        }, set: function (v) {
          this.p.FBold = v;
        }},this.FBtnID + "_bold","&#xE238;",this.FHints.Get(0));
      this.FFntSize = pas["WEBLib.StdCtrls"].TFontSizePicker.$create("Create$1",[this]);
      this.FFntSize.SetName(this.FBtnID + "_fontsize");
      this.FFntSize.SetElementPosition(pas["WEBLib.Controls"].TElementPosition.epRelative);
      this.FFntSize.SetParent(this);
      this.FFntSize.SetWidth(50);
      this.FFntSize.SetPickerMode(pas["WEBLib.StdCtrls"].TFontSizePickerMode.fmRelativeSize);
      this.FFntSize.SetItemIndex(0);
      this.FFntSize.FOnChange = rtl.createCallback(this,"FntSizeChange");
      this.FFnt = pas["WEBLib.StdCtrls"].TFontPicker.$create("Create$1",[this]);
      this.FFnt.SetElementPosition(pas["WEBLib.Controls"].TElementPosition.epRelative);
      this.FFnt.SetName(this.FBtnID + "_fontname");
      this.FFnt.SetParent(this);
      this.FFnt.SetWidth(150);
      this.FFnt.SetItemIndex(0);
      this.FFnt.FOnChange = rtl.createCallback(this,"FntChange");
    };
    this.Destroy = function () {
      rtl.free(this,"FHints");
      if (this.FRichEdit != null) this.FRichEdit.FOnAttributesChanged = null;
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("BackgroundColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FBackgroundColor","SetBackgroundColor",4,{Default: 16777215});
    $r.addProperty("Hints",2,pas.Classes.$rtti["TStrings"],"FHints","SetHints");
    $r.addProperty("RichEdit",3,pas["WEBLib.ComCtrls"].$rtti["TRichEdit"],"GetRichEdit","SetRichEdit");
    $r.addProperty("TextColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FTextColor","SetTextColor",4,{Default: 0});
    $r.addProperty("VisibleButtons",2,$mod.$rtti["TRichEditButtonSet"],"FVisibleButtons","SetVisibleButtons");
    $r.addProperty("OnSpeedButtonClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnSpeedButtonClick","FOnSpeedButtonClick");
  });
  rtl.createClass(this,"TWebRichEditToolBar",this.TRichEditToolBar,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.TToggleButtonStyle = {"0": "tsRectangular", tsRectangular: 0, "1": "tsRounded", tsRounded: 1};
  this.$rtti.$Enum("TToggleButtonStyle",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TToggleButtonStyle});
  rtl.createClass(this,"TToggleButton",pas["WEBLib.Controls"].TCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Controls"].TCustomControl.$init.call(this);
      this.FChecked = false;
      this.FLabel = null;
      this.FInput = null;
      this.FSlider = null;
      this.FStyle = 0;
    };
    this.$final = function () {
      this.FLabel = undefined;
      this.FInput = undefined;
      this.FSlider = undefined;
      pas["WEBLib.Controls"].TCustomControl.$final.call(this);
    };
    this.SetStyle = function (Value) {
      if (this.FStyle !== Value) {
        this.FStyle = Value;
        this.UpdateElement();
      };
    };
    this.GetChecked = function () {
      var Result = false;
      if (this.GetContainer() != null) this.FChecked = this.FInput.checked;
      Result = this.FChecked;
      return Result;
    };
    this.SetChecked = function (Value) {
      this.FChecked = Value;
      this.UpdateElement();
    };
    this.HandleDoClick = function (Event) {
      var Result = false;
      this.FElementEvent = Event;
      this.StopPropagation();
      if (Event.target === this.FInput) {
        if (this.FOnClick != null) this.FOnClick(this);
      };
      Result = true;
      this.FElementEvent = null;
      return Result;
    };
    this.UpdateElement = function () {
      pas["WEBLib.Controls"].TControl.UpdateElement.call(this);
      if (!this.IsUpdating() && (this.FLabel != null)) {
        this.UpdateCSS();
        this.InjectCSS();
        this.FLabel.setAttribute("class",this.FName + "_switch");
        this.FInput.checked = this.FChecked;
        if (this.FStyle === $mod.TToggleButtonStyle.tsRectangular) {
          this.FSlider.setAttribute("class",this.FName + "_slider")}
         else this.FSlider.setAttribute("class",this.FName + "_slider round");
      };
    };
    this.UpdateCSS = function () {
      var css = "";
      var wpx = "";
      var hpx = "";
      var hwpx = "";
      var wspx = "";
      var hspx = "";
      wpx = pas.SysUtils.TIntegerHelper.ToString$1.call({p: this.GetWidth(), get: function () {
          return this.p;
        }, set: function (v) {
          this.p = v;
        }}) + "px";
      hpx = pas.SysUtils.TIntegerHelper.ToString$1.call({p: this.GetHeight(), get: function () {
          return this.p;
        }, set: function (v) {
          this.p = v;
        }}) + "px";
      hwpx = pas.SysUtils.TIntegerHelper.ToString$1.call({a: rtl.trunc(this.GetWidth() / 2), get: function () {
          return this.a;
        }, set: function (v) {
          this.a = v;
        }}) + "px";
      wspx = pas.SysUtils.TIntegerHelper.ToString$1.call({a: rtl.trunc(this.GetWidth() / 2) - 8, get: function () {
          return this.a;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }}) + "px";
      hspx = pas.SysUtils.TIntegerHelper.ToString$1.call({a: this.GetHeight() - 8, get: function () {
          return this.a;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }}) + "px";
      css = "." + this.FName + "_switch {" + "position: relative;" + "display: inline-block;" + "width: " + wpx + ";" + "height: " + hpx + ";" + "}" + ".switch input {display:none;}" + "." + this.FName + "_slider {" + "position: absolute;" + "cursor: pointer;" + "top: 0;" + "left: 0;" + "right: 0;" + "bottom: 0;" + "background-color: #ccc;" + "-webkit-transition: .4s;" + "transition: .4s;" + "}" + "." + this.FName + "_slider:before {" + "position: absolute;" + 'content: "";' + "height: " + hspx + ";" + "width: " + wspx + ";" + "left: 4px;" + "bottom: 4px;" + "background-color: white;" + "-webkit-transition: .4s;" + "transition: .4s;" + "}" + "input:checked + ." + this.FName + "_slider {" + "background-color: #2196F3;" + "}" + "input:focus + ." + this.FName + "_slider {" + "box-shadow: 0 0 1px #2196F3;" + "}" + "input:checked + ." + this.FName + "_slider:before {" + "-webkit-transform: translateX(" + hwpx + ");" + "-ms-transform: translateX(" + hwpx + ");" + "transform: translateX(" + hwpx + ");" + "}" + "/* Rounded sliders */" + "." + this.FName + "_slider.round {" + "border-radius: " + wspx + ";" + "}" + "." + this.FName + "_slider.round:before {" + "border-radius: 50%;" + "}";
      this.AddInstanceStyle(css);
    };
    this.CreateElement = function () {
      var Result = null;
      Result = document.createElement("span");
      this.FLabel = document.createElement("label");
      this.FInput = document.createElement("input");
      this.FSlider = document.createElement("span");
      this.FInput.setAttribute("type","checkbox");
      this.FInput.style.setProperty("display","none");
      Result.appendChild(this.FLabel);
      this.FLabel.appendChild(this.FInput);
      this.FLabel.appendChild(this.FSlider);
      return Result;
    };
    this.Loaded = function () {
      pas["WEBLib.Controls"].TCustomControl.Loaded.call(this);
    };
    this.Resize = function () {
      pas["WEBLib.Controls"].TCustomControl.Resize.call(this);
      this.UpdateCSS();
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.SetWidth(48);
      this.SetHeight(24);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("Checked",3,rtl.boolean,"GetChecked","SetChecked");
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Style",2,$mod.$rtti["TToggleButtonStyle"],"FStyle","SetStyle",4,{Default: $mod.TToggleButtonStyle.tsRectangular});
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseDown","FOnMouseDown");
    $r.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseUp","FOnMouseUp");
    $r.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti["TMouseMoveEvent"],"FOnMouseMove","FOnMouseMove");
    $r.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseLeave","FOnMouseLeave");
    $r.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseEnter","FOnMouseEnter");
    $r.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnEnter","FOnEnter");
    $r.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnExit","FOnExit");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
  });
  rtl.createClass(this,"TWebToggleButton",this.TToggleButton,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  $mod.$implcode = function () {
    rtl.createClass($impl,"TRichEditorCracker",pas["WEBLib.ComCtrls"].TRichEdit,function () {
      rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
      rtl.addIntf(this,pas.System.IUnknown);
    });
  };
},["WEBLib.WebTools","Math"]);
rtl.module("WEBLib.ComCtrls",["System","Classes","SysUtils","Web","WEBLib.Controls","WEBLib.Graphics","WEBLib.ExtCtrls","WEBLib.TreeNodes","WEBLib.Menus"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.$rtti.$Class("TCustomRichEdit");
  rtl.createClass(this,"TTextAttributes",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.RichEdit = null;
      this.FAlignment = 0;
      this.FIsBold = false;
      this.FIsItalic = false;
      this.FIsUnderline = false;
      this.FIsStrikeOut = false;
      this.FBackColor = 0;
      this.FColor = 0;
      this.FHeight = 0;
      this.FName = "";
      this.FOrderedList = false;
      this.FSize = 0;
      this.FStyle = {};
      this.FUnOrderedList = false;
    };
    this.$final = function () {
      this.RichEdit = undefined;
      this.FStyle = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetAlignment = function (Value) {
      this.FAlignment = Value;
      var $tmp = this.FAlignment;
      if ($tmp === pas.Classes.TAlignment.taLeftJustify) {
        this.RichEdit.DoEditAction("justifyleft")}
       else if ($tmp === pas.Classes.TAlignment.taCenter) {
        this.RichEdit.DoEditAction("justifycenter")}
       else if ($tmp === pas.Classes.TAlignment.taRightJustify) this.RichEdit.DoEditAction("justifyright");
    };
    this.SetBackColor = function (Value) {
      this.FColor = Value;
      this.RichEdit.DoEditAction$1("hiliteColor",pas["WEBLib.Graphics"].ColorToHTML(Value));
    };
    this.SetColor = function (Value) {
      this.FColor = Value;
      this.RichEdit.DoEditAction$1("foreColor",pas["WEBLib.Graphics"].ColorToHTML(Value));
    };
    this.SetHeight = function (Value) {
      var eh = null;
      var fs = "";
      if ((Value > 0) && (Value < 8)) {
        this.FSize = Value;
        this.FHeight = Value;
        fs = pas.SysUtils.IntToStr(Value);
        this.RichEdit.DoEditAction$1("fontSize",fs);
        fs = this.FontSizeToEM(Value);
        eh = this.RichEdit.GetElementHandle();
        var selection = window.getSelection();
        if (selection.rangeCount > 0) {
          var range = selection.getRangeAt(0);
          const selectedElements = eh.querySelectorAll('*');
          selectedElements.forEach(element => {
            if (range.intersectsNode(element)) {
              if (element.tagName == "LI") {
                element.style.setProperty("font-size",fs);
              }
            }
          });
        };
      };
    };
    this.SetName = function (Value) {
      this.FName = Value;
      this.RichEdit.DoEditAction$1("fontName",Value);
    };
    this.SetOrderedList = function (Value) {
      if (this.FOrderedList !== Value) this.RichEdit.DoEditAction("insertorderedlist");
      this.FOrderedList = Value;
    };
    this.SetSize = function (Value) {
      if ((Value > 0) && (Value < 8)) {
        this.FSize = Value;
        this.FHeight = Value;
        this.RichEdit.DoEditAction$1("fontSize",pas.SysUtils.IntToStr(Value));
        var selection = window.getSelection();
      };
    };
    this.SetStyle = function (Value) {
      this.FStyle = rtl.refSet(Value);
      if ((pas["WEBLib.Graphics"].TFontStyle.fsBold in this.FStyle) && !this.FIsBold) {
        this.RichEdit.DoEditAction("bold");
        this.FIsBold = true;
      };
      if (!(pas["WEBLib.Graphics"].TFontStyle.fsBold in this.FStyle) && this.FIsBold) {
        this.RichEdit.DoEditAction("bold");
        this.FIsBold = false;
      };
      if ((pas["WEBLib.Graphics"].TFontStyle.fsItalic in this.FStyle) && !this.FIsItalic) {
        this.RichEdit.DoEditAction("italic");
        this.FIsItalic = true;
      };
      if (!(pas["WEBLib.Graphics"].TFontStyle.fsItalic in this.FStyle) && this.FIsItalic) {
        this.RichEdit.DoEditAction("italic");
        this.FIsItalic = false;
      };
      if ((pas["WEBLib.Graphics"].TFontStyle.fsUnderline in this.FStyle) && !this.FIsUnderline) {
        this.RichEdit.DoEditAction("underline");
        this.FIsUnderline = true;
      };
      if (!(pas["WEBLib.Graphics"].TFontStyle.fsUnderline in this.FStyle) && this.FIsUnderline) {
        this.RichEdit.DoEditAction("underline");
        this.FIsUnderline = false;
      };
      if ((pas["WEBLib.Graphics"].TFontStyle.fsStrikeOut in this.FStyle) && !this.FIsStrikeOut) {
        this.RichEdit.DoEditAction("strikethrough");
        this.FIsStrikeOut = true;
      };
      if (!(pas["WEBLib.Graphics"].TFontStyle.fsStrikeOut in this.FStyle) && this.FIsStrikeOut) {
        this.RichEdit.DoEditAction("strikethrough");
        this.FIsStrikeOut = false;
      };
    };
    this.SetUnOrderedList = function (Value) {
      if (this.FUnOrderedList !== Value) this.RichEdit.DoEditAction("insertunorderedlist");
      this.FUnOrderedList = Value;
    };
    this.AssignTo = function (Dest) {
      if (pas["WEBLib.Graphics"].TFont.isPrototypeOf(Dest)) {
        Dest.SetColor(this.FColor);
        Dest.SetName(this.FName);
        Dest.SetStyle(rtl.refSet(this.FStyle));
        Dest.SetSize(this.FSize);
      } else if ($mod.TTextAttributes.isPrototypeOf(Dest)) {
        Dest.SetColor(this.FColor);
        Dest.SetName(this.FName);
        Dest.SetStyle(rtl.refSet(this.FStyle));
      } else pas.Classes.TPersistent.AssignTo.call(this,Dest);
    };
    this.FontSizeToEM = function (Value) {
      var Result = "";
      Result = "0.63";
      var $tmp = Value;
      if ($tmp === 1) {
        Result = "0.63em"}
       else if ($tmp === 2) {
        Result = "0.82em"}
       else if ($tmp === 3) {
        Result = "1.0em"}
       else if ($tmp === 4) {
        Result = "1.13em"}
       else if ($tmp === 5) {
        Result = "1.5em"}
       else if ($tmp === 6) {
        Result = "2em"}
       else if ($tmp === 7) Result = "3em";
      return Result;
    };
    this.Create$1 = function (AOwner) {
      pas.System.TObject.Create.call(this);
      this.RichEdit = AOwner;
      this.FAlignment = pas.Classes.TAlignment.taLeftJustify;
      this.FIsBold = false;
      this.FIsItalic = false;
      this.FIsUnderline = false;
      this.FIsStrikeOut = false;
      this.FOrderedList = false;
      this.FUnOrderedList = false;
      return this;
    };
    this.Assign = function (Source) {
      if (pas["WEBLib.Graphics"].TFont.isPrototypeOf(Source)) {
        this.SetColor(Source.FColor);
        this.SetName(Source.FName);
        this.SetStyle(rtl.refSet(Source.FStyle));
        this.SetSize(Source.FSize);
      } else if ($mod.TTextAttributes.isPrototypeOf(Source)) {
        this.SetColor(Source.FColor);
        this.SetName(Source.FName);
        this.SetStyle(rtl.refSet(Source.FStyle));
        this.SetSize(Source.FSize);
      } else pas.Classes.TPersistent.Assign.call(this,Source);
    };
    this.Cut = function () {
      this.RichEdit.DoEditAction("cut");
    };
    this.Copy = function () {
      this.RichEdit.DoEditAction("copy");
    };
    this.Paste = function () {
      this.RichEdit.DoEditAction("paste");
    };
    this.Image = function () {
      this.RichEdit.DoImageAction();
    };
    this.Link = function () {
      this.RichEdit.DoLinkAction();
    };
  });
  rtl.recNewT(this,"TSelAttributes",function () {
    this.FontName = "";
    this.FontSize = "";
    this.FontColor = "";
    this.BkColor = "";
    this.IsBold = false;
    this.IsItalic = false;
    this.IsStrikeOut = false;
    this.IsUnderline = false;
    this.IsLeft = false;
    this.IsRight = false;
    this.IsCenter = false;
    this.$eq = function (b) {
      return (this.FontName === b.FontName) && (this.FontSize === b.FontSize) && (this.FontColor === b.FontColor) && (this.BkColor === b.BkColor) && (this.IsBold === b.IsBold) && (this.IsItalic === b.IsItalic) && (this.IsStrikeOut === b.IsStrikeOut) && (this.IsUnderline === b.IsUnderline) && (this.IsLeft === b.IsLeft) && (this.IsRight === b.IsRight) && (this.IsCenter === b.IsCenter);
    };
    this.$assign = function (s) {
      this.FontName = s.FontName;
      this.FontSize = s.FontSize;
      this.FontColor = s.FontColor;
      this.BkColor = s.BkColor;
      this.IsBold = s.IsBold;
      this.IsItalic = s.IsItalic;
      this.IsStrikeOut = s.IsStrikeOut;
      this.IsUnderline = s.IsUnderline;
      this.IsLeft = s.IsLeft;
      this.IsRight = s.IsRight;
      this.IsCenter = s.IsCenter;
      return this;
    };
    var $r = $mod.$rtti.$Record("TSelAttributes",{},this);
    $r.addField("FontName",rtl.string);
    $r.addField("FontSize",rtl.string);
    $r.addField("FontColor",rtl.string);
    $r.addField("BkColor",rtl.string);
    $r.addField("IsBold",rtl.boolean);
    $r.addField("IsItalic",rtl.boolean);
    $r.addField("IsStrikeOut",rtl.boolean);
    $r.addField("IsUnderline",rtl.boolean);
    $r.addField("IsLeft",rtl.boolean);
    $r.addField("IsRight",rtl.boolean);
    $r.addField("IsCenter",rtl.boolean);
  });
  this.$rtti.$MethodVar("TAttributesChangeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Attributes",this.$rtti["TSelAttributes"]]]), methodkind: 0});
  rtl.createClass(this,"TCustomRichEdit",pas["WEBLib.Menus"].TWebCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Menus"].TWebCustomControl.$init.call(this);
      this.FOwner$1 = null;
      this.FLines = null;
      this.FSelAttributes = null;
      this.FAutoSize = false;
      this.FOnSelectionChange = null;
      this.FShowFocus$1 = false;
      this.FInsertLineBreaks = false;
      this.FWantTabs = false;
      this.FReadOnly = false;
      this.FOnChange = null;
      this.FOnAttributesChanged = null;
      this.FWantImages = false;
    };
    this.$final = function () {
      this.FOwner$1 = undefined;
      this.FLines = undefined;
      this.FSelAttributes = undefined;
      this.FOnSelectionChange = undefined;
      this.FOnChange = undefined;
      this.FOnAttributesChanged = undefined;
      pas["WEBLib.Menus"].TWebCustomControl.$final.call(this);
    };
    this.GetText = function () {
      var Result = "";
      if (this.GetElementHandle() != null) this.FLines.SetTextStr(this.GetElementHandle().innerHTML);
      Result = this.FLines.GetTextStr();
      return Result;
    };
    this.GetPlainText = function () {
      var Result = "";
      Result = "";
      if (this.GetElementHandle() != null) Result = this.GetElementHandle().innerText;
      return Result;
    };
    this.SetText = function (Value) {
      this.FLines.SetTextStr(Value);
      this.UpdateElement();
    };
    this.SetSelAttributes = function (Value) {
      this.FSelAttributes.Assign(Value);
    };
    this.SetAutoSize = function (Value) {
      if (this.FAutoSize !== Value) {
        this.FAutoSize = Value;
        this.UpdateElement();
      };
    };
    this.SetReadOnly = function (Value) {
      if (this.FReadOnly !== Value) {
        this.FReadOnly = Value;
        if (this.GetElementHandle() != null) {
          if (this.FReadOnly) {
            this.GetElementHandle().contentEditable = "false"}
           else this.GetElementHandle().contentEditable = "true";
        };
      };
    };
    this.GetLines = function () {
      var Result = null;
      Result = this.FLines;
      return Result;
    };
    this.GetSelStart = function () {
      var Result = 0;
      var res = 0;
      var el = null;
      el = this.GetElementHandle();
      const selection = window.getSelection();
      const range = selection.getRangeAt(0);
      const preSelectionRange = range.cloneRange();
      preSelectionRange.selectNodeContents(el);
      preSelectionRange.setEnd(range.startContainer, range.startOffset);
      res = preSelectionRange.toString().length;
      Result = res;
      return Result;
    };
    this.SetSelStart = function (Value) {
      var el = null;
      el = this.GetElementHandle();
      const range = document.createRange();
          const sel = window.getSelection();
      
          var i = 0;
          while (i < el.childNodes.length) {
            if (Value <=el.childNodes[i].textContent.length) {
              range.setStart(el.childNodes[i], Value);
            }
            else {
               Value = Value - el.childNodes[i].textContent.length;
            }
            i++;
          }
          range.collapse(true);
          sel.removeAllRanges();
          sel.addRange(range);
    };
    this.CreateElement = function () {
      var Result = null;
      Result = document.createElement("DIV");
      Result.style.setProperty("white-space","normal");
      return Result;
    };
    this.ElementIFrameHandle = function () {
      var Result = null;
      Result = null;
      if (this.GetElementHandle() != null) {
        Result = document;
      };
      return Result;
    };
    this.UpdateElement = function () {
      var i = 0;
      var s = "";
      pas["WEBLib.Controls"].TControl.UpdateElement.call(this);
      if (this.ElementIFrameHandle() != null) ;
      if (this.GetElementHandle() != null) {
        s = "";
        for (var $l = 0, $end = this.FLines.GetCount() - 1; $l <= $end; $l++) {
          i = $l;
          if (i > 0) s = s + "<br>";
          s = s + this.FLines.Get(i);
        };
        this.GetElementHandle().innerHTML = s;
        if (this.FReadOnly) {
          this.GetElementHandle().contentEditable = "false"}
         else this.GetElementHandle().contentEditable = "true";
        this.GetElementHandle().style.setProperty("overflow","auto");
        this.GetElementHandle().style.setProperty("padding","3px");
        if (this.FBorderStyle === pas["WEBLib.Controls"].TBorderStyle.bsSingle) {
          this.GetElementHandle().style.setProperty("border","1px solid silver")}
         else this.GetElementHandle().style.setProperty("border","");
      };
    };
    this.Loaded = function () {
      var doc = null;
      var el = null;
      pas["WEBLib.Controls"].TCustomControl.Loaded.call(this);
      if (this.ElementIFrameHandle() != null) {
        doc = this.ElementIFrameHandle();
        el = this.GetElementHandle();
        el.onclick = rtl.createSafeCallback(this,"HandleDoClick");
        el.ondblclick = rtl.createSafeCallback(this,"HandleDoDblClick");
        el.addEventListener("mousedown",rtl.createSafeCallback(this,"HandleDoMouseDown"));
        el.addEventListener("mouseup",rtl.createSafeCallback(this,"HandleDoMouseUp"));
        el.addEventListener("mousemove",rtl.createSafeCallback(this,"HandleDoMouseMove"));
        el.addEventListener("keydown",rtl.createSafeCallback(this,"HandleDoKeyDown"));
        el.addEventListener("keyup",rtl.createSafeCallback(this,"HandleDoKeyUp"));
        el.addEventListener("keypress",rtl.createSafeCallback(this,"HandleDoKeyPress"));
        el.onfocus = rtl.createSafeCallback(this,"HandleDoEnter");
        el.onblur = rtl.createSafeCallback(this,"HandleDoExit");
        doc.onselectionchange = rtl.createSafeCallback(this,"HandleDoSelectionChange");
      };
    };
    this.SetShowFocus$1 = function (Value) {
      if (this.FShowFocus$1 !== Value) {
        this.FShowFocus$1 = Value;
        this.UpdateElement();
      };
    };
    this.CanShowFocus = function () {
      var Result = false;
      Result = this.FShowFocus$1;
      return Result;
    };
    this.DoHandleInput = function (Event) {
      this.DoChange();
    };
    this.DoHandlePaste = function (Event) {
      if (this.FWantImages) return;
      var pastedData = Event.clipboardData.getData('text');
      var regex = /^[a-zA-Z0-9@  `!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/;
      if (regex.test(pastedData) !== true) {
              Event.preventDefault();
      };
    };
    this.HandleDoSelectionChange = function (Event) {
      var Result = false;
      var Attr = $mod.TSelAttributes.$new();
      if (this.FOwner$1 != null) {
        rtl.as(this.FOwner$1,pas["WEBLib.Buttons"].TRichEditToolBar).SetTextColor(0x1);
        rtl.as(this.FOwner$1,pas["WEBLib.Buttons"].TRichEditToolBar).SetBackgroundColor(0x1);
      };
      Attr.$assign(this.GetSelectionAttributes(document.getSelection()));
      this.FSelAttributes.SetStyle({});
      if (Attr.IsBold) this.FSelAttributes.SetStyle(rtl.unionSet(this.FSelAttributes.FStyle,rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsBold)));
      if (Attr.IsItalic) this.FSelAttributes.SetStyle(rtl.unionSet(this.FSelAttributes.FStyle,rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsItalic)));
      if (Attr.IsUnderline) this.FSelAttributes.SetStyle(rtl.unionSet(this.FSelAttributes.FStyle,rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsUnderline)));
      if (Attr.IsStrikeOut) this.FSelAttributes.SetStyle(rtl.unionSet(this.FSelAttributes.FStyle,rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsStrikeOut)));
      if (this.FOnSelectionChange != null) this.FOnSelectionChange(this);
      Result = true;
      return Result;
    };
    this.HandleDoKeyDown = function (Event) {
      var Result = false;
      var AEvent = null;
      Result = false;
      AEvent = Event;
      if ((AEvent.ctrlKey === true) && (AEvent.key === "Control") && this.FReadOnly) {
        this.GetElementHandle().contentEditable = "false";
      };
      if ((this.GetKeyCode(AEvent.key,true) === 13) && this.FInsertLineBreaks) {
        this.InsertHTML("<br>")}
       else if ((this.GetKeyCode(AEvent.key,true) === 9) && this.FWantTabs) {
        this.InsertHTML("<span style=white-space:pre>&#9;</span>")}
       else {
        Result = true;
      };
      pas["WEBLib.Controls"].TControl.HandleDoKeyDown.apply(this,arguments);
      return Result;
    };
    this.HandleDoKeyUp = function (Event) {
      var Result = false;
      var AEvent = null;
      Result = false;
      AEvent = Event;
      if ((AEvent.ctrlKey === false) && (AEvent.key === "Control") && !this.FReadOnly) {
        this.GetElementHandle().contentEditable = "true";
      };
      pas["WEBLib.Controls"].TControl.HandleDoKeyUp.apply(this,arguments);
      return Result;
    };
    this.SetLines = function (ALines) {
      this.FLines.Assign(ALines);
    };
    this.DoLinesChange = function (Sender) {
      this.UpdateElement();
    };
    this.DoChange = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.BindEvents = function () {
      pas["WEBLib.Controls"].TCustomControl.BindEvents.call(this);
      this.GetContainer().addEventListener("input",rtl.createSafeCallback(this,"DoHandleInput"));
      this.GetContainer().addEventListener("paste",rtl.createSafeCallback(this,"DoHandlePaste"));
    };
    this.GetSelectionAttributes = function (selnode) {
      var Result = $mod.TSelAttributes.$new();
      var el = null;
      var fn = "";
      var fs = "";
      var fc = "";
      var fbk = "";
      var found = false;
      var Attr = $mod.TSelAttributes.$new();
      el = null;
      if (selnode.focusNode) {
        el = selnode.focusNode.parentElement;
      };
      do {
        found = false;
        if (el != null) {
          if (el.tagName === "B") {
            found = true;
            Attr.IsBold = true;
          };
          if (el.tagName === "I") {
            found = true;
            Attr.IsItalic = true;
          };
          if (el.tagName === "U") {
            found = true;
            Attr.IsUnderline = true;
          };
          if (el.tagName === "STRIKE") {
            found = true;
            Attr.IsStrikeOut = true;
          };
          if (el.tagName === "SPAN") {
            fbk = el.style.getPropertyValue("background-color");
            if (fbk == null) {
            fbk = ''; };
            Attr.BkColor = fbk;
            found = true;
          };
          if (el.tagName === "DIV") {
            fbk = el.style.getPropertyValue("text-align");
            if (fbk == null) {
            fbk = ''; };
            if (fbk === "center") Attr.IsCenter = true;
            if (fbk === "right") Attr.IsRight = true;
            if (fbk === "left") Attr.IsLeft = true;
            found = true;
          };
          if (el.tagName === "FONT") {
            fn = el.getAttribute("face");
            if (fn == null) {
            fn = ''; };
            fs = el.getAttribute("size");
            if (fs == null) {
            fs = ''; };
            fc = el.getAttribute("color");
            if (fc == null) {
            fc = ''; };
            fbk = el.style.getPropertyValue("background-color");
            if (fbk == null) {
            fbk = ''; };
            found = true;
            Attr.FontName = fn;
            Attr.FontColor = fc;
            if (fs !== "") {
              if (fs === "7") fs = "36";
              if (fs === "6") fs = "24";
              if (fs === "5") fs = "18";
              if (fs === "4") fs = "14";
              if (fs === "3") fs = "10";
              if (fs === "2") fs = "9";
              if (fs === "1") fs = "8";
            };
            Attr.FontSize = fs;
            Attr.BkColor = fbk;
          };
          el = el.parentElement;
          if (el === this.GetElementHandle()) found = false;
        };
      } while (found);
      Result.$assign(Attr);
      if (this.FOnAttributesChanged != null) this.FOnAttributesChanged(this,$mod.TSelAttributes.$clone(Attr));
      return Result;
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.FLines = pas.Classes.TStringList.$create("Create$1");
      this.FLines.FOnChange = rtl.createCallback(this,"DoLinesChange");
      this.FSelAttributes = $mod.TTextAttributes.$create("Create$1",[this]);
      this.FShowFocus$1 = true;
      this.FWantImages = true;
      this.FInsertLineBreaks = false;
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        this.SetWidth(400);
        this.SetHeight(300);
      };
    };
    this.Destroy = function () {
      rtl.free(this,"FLines");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.GetContent = function () {
      var Result = "";
      Result = this.GetText();
      return Result;
    };
    this.GetSelection = function () {
      var Result = "";
      var res = "";
      res = "";
      // window.getSelection() gives you a Selection object representing the range of text selected by the user or the current position of the caret.
      if (window.getSelection) {
        res = window.getSelection().toString();
      };
      Result = res;
      return Result;
    };
    this.DoSelectAction = function (StartPosition, EndPosition) {
      var s = "";
      var sstart = 0;
      var send = 0;
      var el = null;
      var range = null;
      var textNodes = null;
      var textNode = null;
      var i = 0;
      var foundStart = false;
      var charCount = 0;
      var endCharCount = 0;
      var sel = null;
      s = this.GetID();
      sstart = StartPosition;
      send = EndPosition;
      el = document.getElementById(s);
      if (el != null) {
        range = document.createRange();
        range.selectNodeContents(el);
        textNodes = pas.Classes.TList.$create("Create$1");
        $impl.GetTextNodes(el,textNodes);
        foundStart = false;
        charCount = 0;
        endCharCount = 0;
        for (var $l = 0, $end = textNodes.GetCount() - 1; $l <= $end; $l++) {
          i = $l;
          textNode = textNodes.Get(i);
          endCharCount = charCount + textNode.nodeValue.length;
          if (!foundStart && (sstart >= charCount) && ((sstart < endCharCount) || ((sstart === endCharCount) && (i <= textNodes.GetCount())))) {
            range.setStart(textNode,sstart - charCount);
            foundStart = true;
          };
          if (foundStart && (send <= endCharCount)) {
            range.setEnd(textNode,send - charCount);
            break;
          };
          charCount = endCharCount;
        };
        sel = document.getSelection();
        sel.removeAllRanges();
        sel.addRange(range);
        textNodes = rtl.freeLoc(textNodes);
      };
    };
    this.DoEditAction = function (ActionString) {
      if (this.ElementIFrameHandle() != null) {
        this.ElementIFrameHandle().execCommand(ActionString,false);
      };
    };
    this.DoEditAction$1 = function (ActionString, Data) {
      if (this.ElementIFrameHandle() != null) {
        this.ElementIFrameHandle().execCommand(ActionString,false,Data);
      };
    };
    this.SelectText = function (StartPosition, EndPosition) {
      this.DoSelectAction(StartPosition,EndPosition);
    };
    this.SetSelectionSpacing = function (ASpacing) {
      var $Self = this;
      var sel = null;
      var range = null;
      var node = null;
      var pNode = null;
      var i = 0;
      var lh = "";
      function getNextNode(anode) {
        var Result = null;
        if (anode.firstChild != null) {
          Result = anode.firstChild}
         else while (anode != null) {
          if (anode.nextSibling != null) {
            Result = anode.nextSibling;
            break;
          };
          anode = anode.parentNode;
        };
        return Result;
      };
      sel = document.getSelection();
      if (!(sel != null)) return;
      lh = pas["WEBLib.Utils"].FormatProp("%g",pas.System.VarRecs(3,ASpacing));
      for (var $l = 0, $end = sel.rangeCount - 1; $l <= $end; $l++) {
        i = $l;
        range = sel.getRangeAt(i);
        node = range.startContainer;
        if (node.nodeName === "#text") {
          pNode = node.parentNode;
          if (pNode.nodeName === "DIV") pNode.style.setProperty("line-height",lh);
        };
        while (node !== range.endContainer) {
          node = getNextNode(node);
          if (node.nodeName === "DIV") node.style.setProperty("line-height",lh);
        };
      };
    };
    this.DoImageAction = function () {
      var url = "";
      if (this.GetElementHandle() != null) {
        url = window.prompt("Enter Image URL:","http://");
        if (pas.System.Assigned(url)) {
          if ((url !== "") && (url !== "http://") && (url !== "https://")) this.DoEditAction$1("insertImage",url);
        };
      };
    };
    this.DoLinkAction = function () {
      var url = "";
      if (this.GetElementHandle() != null) {
        url = window.prompt("Enter URL:","http://");
        if (pas.System.Assigned(url)) {
          if ((url !== "") && (url !== "http://") && (url !== "https://")) this.DoEditAction$1("createLink",url);
        };
      };
    };
    this.AppendHTML = function (HTML) {
      var sel = null;
      var range = null;
      var el = null;
      var frag = null;
      var node = null;
      var lastNode = null;
      sel = null;
      if (this.Focused()) {
        sel = document.getSelection();
        range = sel.getRangeAt(0);
        range.deleteContents();
      } else {
        range = document.createRange();
        node = this.GetElementHandle().firstChild;
        lastNode = node;
        while (node != null) {
          node = node.nextSibling;
          if (node != null) lastNode = node;
        };
        if (lastNode != null) {
          range.setStartAfter(lastNode);
          range.setEndAfter(lastNode);
        } else {
          range.setStart(this.GetElementHandle(),0);
          range.setEnd(this.GetElementHandle(),0);
        };
      };
      el = document.createElement("div");
      el.innerHTML = HTML;
      frag = document.createDocumentFragment();
      node = el.firstChild;
      while (node === el.firstChild) {
        lastNode = frag.appendChild(node);
        range.insertNode(frag);
      };
      if (lastNode != null) {
        range = range.cloneRange();
        range.setStartAfter(lastNode);
        range.collapse();
        if (sel != null) {
          sel.removeAllRanges();
          sel.addRange(range);
        };
      };
    };
    this.AppendLineBreak = function () {
      this.AppendHTML("<BR>");
    };
    this.InsertHTML = function (HTML) {
      var sel = null;
      var range = null;
      var el = null;
      var frag = null;
      var node = null;
      var lastNode = null;
      sel = null;
      if (this.Focused()) {
        sel = document.getSelection();
        range = sel.getRangeAt(0);
        range.deleteContents();
      } else {
        range = document.createRange();
        range.setStart(this.GetElementHandle(),0);
        range.setEnd(this.GetElementHandle(),0);
      };
      el = document.createElement("div");
      el.innerHTML = HTML;
      frag = document.createDocumentFragment();
      node = el.firstChild;
      while (node === el.firstChild) {
        lastNode = frag.appendChild(node);
        range.insertNode(frag);
      };
      if (lastNode != null) {
        range = range.cloneRange();
        range.setStartAfter(lastNode);
        range.collapse();
        if (sel != null) {
          sel.removeAllRanges();
          sel.addRange(range);
        };
      };
    };
    this.InsertLineBreak = function () {
      this.InsertHTML("<BR>");
    };
    this.InsertImage = function (DataURL) {
      this.DoEditAction$1("insertImage",DataURL);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TRichEdit",this.TCustomRichEdit,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("AutoSize",2,rtl.boolean,"FAutoSize","SetAutoSize",4,{Default: false});
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor");
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("BorderStyle",2,pas["WEBLib.Controls"].$rtti["TBorderStyle"],"FBorderStyle","SetBorderStyle",4,{Default: pas["WEBLib.Controls"].TBorderStyle.bsSingle});
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("InsertLineBreaks",0,rtl.boolean,"FInsertLineBreaks","FInsertLineBreaks",4,{Default: false});
    $r.addProperty("Lines",3,pas.Classes.$rtti["TStrings"],"GetLines","SetLines");
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("ReadOnly",2,rtl.boolean,"FReadOnly","SetReadOnly",4,{Default: false});
    $r.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti["TPopupMenu"],"FPopupMenu","FPopupMenu");
    $r.addProperty("WantTabs",0,rtl.boolean,"FWantTabs","FWantTabs",4,{Default: false});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChange","FOnChange");
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnSelectionChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnSelectionChange","FOnSelectionChange");
    $r.addProperty("OnKeyDown",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyDown","FOnKeyDown");
    $r.addProperty("OnKeyPress",0,pas["WEBLib.Controls"].$rtti["TKeyPressEvent"],"FOnKeyPress","FOnKeyPress");
    $r.addProperty("OnKeyUp",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyUp","FOnKeyUp");
    $r.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseDown","FOnMouseDown");
    $r.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseUp","FOnMouseUp");
    $r.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti["TMouseMoveEvent"],"FOnMouseMove","FOnMouseMove");
    $r.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseLeave","FOnMouseLeave");
    $r.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseEnter","FOnMouseEnter");
    $r.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnEnter","FOnEnter");
    $r.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnExit","FOnExit");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
  });
  rtl.createClass(this,"TWebRichEdit",this.TRichEdit,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTabSet",pas["WEBLib.Menus"].TWebCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Menus"].TWebCustomControl.$init.call(this);
      this.FItems = null;
      this.FItemIndex = 0;
      this.FSelectedColor = 0;
      this.FOnChange = null;
      this.FSelectedTextColor = 0;
      this.FElementTabActiveClassName = "";
      this.FElementTabClassName = "";
      this.FElementTabItemClassName = "";
      this.FUseHash = false;
    };
    this.$final = function () {
      this.FItems = undefined;
      this.FOnChange = undefined;
      pas["WEBLib.Menus"].TWebCustomControl.$final.call(this);
    };
    this.SetSelectedColor = function (Value) {
      if (this.FSelectedColor !== Value) {
        this.FSelectedColor = Value;
        this.DoUpdateList();
      };
    };
    this.SetSelectedTextColor = function (Value) {
      if (this.FSelectedColor !== Value) {
        this.FSelectedTextColor = Value;
        this.DoUpdateList();
      };
    };
    this.CreateElement = function () {
      var Result = null;
      Result = document.createElement("SPAN");
      return Result;
    };
    this.HandleDoClick = function (Event) {
      var Result = false;
      var sid = "";
      var cid = "";
      var i = 0;
      var el = null;
      el = Event.target;
      sid = "";
      if (el.hasAttribute("id")) sid = el.getAttribute("id");
      if (sid !== "") {
        cid = this.GetID();
        if (cid === "") cid = this.FName;
        sid = pas.SysUtils.StringReplace(sid,cid + "_","",{});
        if (pas.SysUtils.TryStrToInt(sid,{get: function () {
            return i;
          }, set: function (v) {
            i = v;
          }})) {
          this.FItemIndex = i;
          this.DoUpdateList();
        };
        pas["WEBLib.Controls"].TControl.HandleDoClick.apply(this,arguments);
      };
      Result = true;
      return Result;
    };
    this.HandleDoChange = function (Event) {
      var Result = false;
      if (this.FOnChange != null) this.FOnChange(this);
      Result = true;
      return Result;
    };
    this.HandleDoItemMouseOut = function (Event) {
      var Result = false;
      var el = null;
      Result = true;
      el = Event.relatedTarget;
      if (el != null) {
        if (el.nodeName === "A") el.style.setProperty("background-color","");
      };
      return Result;
    };
    this.HandleDoItemMouseOver = function (Event) {
      var Result = false;
      var el = null;
      Result = true;
      el = Event.relatedTarget;
      if (el != null) {
        if (el.nodeName === "A") el.style.setProperty("background-color","lightgray");
      };
      return Result;
    };
    this.BindEvents = function () {
      pas["WEBLib.Controls"].TCustomControl.BindEvents.call(this);
      if (this.GetElementHandle() != null) {
        this.GetElementHandle().onchange = rtl.createSafeCallback(this,"HandleDoChange");
      };
    };
    this.SetItems = function (AItems) {
      this.FItems.Assign(AItems);
    };
    this.SetItemIndex = function (AIndex) {
      if (this.FItemIndex !== AIndex) {
        this.FItemIndex = AIndex;
        this.DoUpdateList();
      };
    };
    this.DoUpdateList = function () {
      var i = 0;
      var s = "";
      var cid = "";
      var ul = null;
      var li = null;
      var a = null;
      if (!(this.GetContainer() != null)) return;
      while (this.GetContainer().firstChild != null) this.GetContainer().removeChild(this.GetContainer().firstChild);
      this.GetContainer().setAttribute("class","");
      ul = document.createElement("UL");
      ul.setAttribute("class",this.FElementClassName);
      if (this.FElementClassName !== "") {
        ul.setAttribute("role","tablist")}
       else {
        ul.style.setProperty("list-style-type","none");
        ul.style.setProperty("margin","0");
        ul.style.setProperty("padding","0");
        ul.style.setProperty("display","inline-block");
      };
      this.GetContainer().appendChild(ul);
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        s = this.FItems.Get(i);
        li = document.createElement("LI");
        if (this.FElementClassName !== "") {
          if (this.FElementTabItemClassName === "") {
            li.setAttribute("class","nav-item")}
           else li.setAttribute("class",this.FElementTabItemClassName);
        } else {
          li.style.setProperty("float","left");
          li.style.setProperty("border-bottom","1px solid lightgray");
        };
        pas["WEBLib.Controls"].SetHTMLElementFont(li,this.FFont,!((this.FElementClassName === "") && (this.FElementFont === pas["WEBLib.Controls"].TElementFont.efProperty)));
        if (this.FDragMode === pas["WEBLib.Controls"].TDragMode.dmAutomatic) li.setAttribute("draggable","true");
        ul.appendChild(li);
        if (!this.FEnabled) {
          a = document.createElement("SPAN")}
         else {
          a = document.createElement("A");
          if (this.FUseHash) a.setAttribute("href","#" + s);
        };
        a.innerHTML = s;
        cid = this.GetID();
        if (cid === "") cid = this.FName;
        a.setAttribute("id",cid + "_" + pas.SysUtils.IntToStr(i));
        if (this.FElementClassName !== "") {
          if (this.FItemIndex === i) {
            if (this.FElementTabActiveClassName === "") {
              a.setAttribute("class","nav-link active")}
             else a.setAttribute("class",this.FElementTabActiveClassName);
          } else {
            if (this.FElementTabClassName === "") {
              a.setAttribute("class","nav-link")}
             else a.setAttribute("class",this.FElementTabClassName);
          };
          a.setAttribute("role","tab");
          a.setAttribute("data-toggle","tab");
          a.setAttribute("aria-controls",s);
          if (this.FItemIndex === i) {
            a.setAttribute("aria-selected","true")}
           else a.setAttribute("aria-selected","false");
          if (this.FDragMode === pas["WEBLib.Controls"].TDragMode.dmAutomatic) a.setAttribute("draggable","false");
        } else {
          a.style.setProperty("display","block");
          a.style.setProperty("text-align","center");
          a.style.setProperty("padding","3px 15px");
          a.style.setProperty("text-decoration","none");
          a.style.setProperty("min-width","50px");
          a.style.setProperty("color","inherit");
          a.style.setProperty("font-family","inherit");
          a.style.setProperty("font-style","inherit");
          a.style.setProperty("font-size","inherit");
          if (!this.FEnabled) a.style.setProperty("pointer-events","none");
          if (this.FDragMode === pas["WEBLib.Controls"].TDragMode.dmAutomatic) a.setAttribute("draggable","false");
          if (this.FItemIndex === i) {
            if (this.FSelectedColor !== -1) a.style.setProperty("background-color",pas["WEBLib.Graphics"].ColorToHTML(this.FSelectedColor));
            if (this.FSelectedTextColor !== -1) a.style.setProperty("color",pas["WEBLib.Graphics"].ColorToHTML(this.FSelectedTextColor));
          };
        };
        li.appendChild(a);
      };
      if (!this.GetIsLinked() && (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState)) this.RenderDesigning("TWebTabSet",this.GetContainer(),this,this.FItems.GetCount() === 0,"");
      this.UpdateElement();
    };
    this.Loaded = function () {
      pas["WEBLib.Controls"].TCustomControl.Loaded.call(this);
      this.DoUpdateList();
    };
    this.ItemsChanged = function (Sender) {
      this.DoUpdateList();
    };
    this.EnableDrag = function () {
      var $Self = this;
      function AddDraggableAttribute(AElement) {
        var I = 0;
        for (var $l = 0, $end = AElement.children.length - 1; $l <= $end; $l++) {
          I = $l;
          if (AElement.children.item(I).tagName === "LI") {
            AElement.children.item(I).setAttribute("draggable","true");
            AddDraggableAttribute(AElement.children.item(I));
          } else if (AElement.children.item(I).tagName === "A") {
            AElement.children.item(I).setAttribute("draggable","false")}
           else AddDraggableAttribute(AElement.children.item(I));
        };
      };
      if (!(this.GetContainer() != null)) return;
      AddDraggableAttribute(this.GetContainer());
    };
    this.DisableDrag = function () {
      var $Self = this;
      function RemoveDraggableAttribute(AElement) {
        var I = 0;
        for (var $l = 0, $end = AElement.children.length - 1; $l <= $end; $l++) {
          I = $l;
          if (AElement.children.item(I).tagName === "LI") {
            AElement.children.item(I).removeAttribute("draggable");
            RemoveDraggableAttribute(AElement.children.item(I));
          } else if (AElement.children.item(I).tagName === "A") {
            AElement.children.item(I).removeAttribute("draggable")}
           else RemoveDraggableAttribute(AElement.children.item(I));
        };
      };
      if (!(this.GetContainer() != null)) return;
      RemoveDraggableAttribute(this.GetContainer());
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.FItems = pas.Classes.TStringList.$create("Create$1");
      this.FItems.FOnChange = rtl.createCallback(this,"ItemsChanged");
      this.FItemIndex = 0;
      this.FSelectedColor = 12632256;
      this.FSelectedTextColor = 0;
      this.FUseHash = true;
    };
    this.Destroy = function () {
      rtl.free(this,"FItems");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.EndUpdate = function () {
      pas["WEBLib.Controls"].TCustomControl.EndUpdate.call(this);
      this.DoUpdateList();
    };
    this.Clear = function () {
      this.FItems.Clear();
    };
    this.SelectNextTab = function (GoForward) {
      if (GoForward) {
        if (this.FItemIndex < (this.FItems.GetCount() - 1)) {
          this.SetItemIndex(this.FItemIndex + 1)}
         else this.SetItemIndex(0);
      } else {
        if (this.FItemIndex > 0) {
          this.SetItemIndex(this.FItemIndex - 1)}
         else this.SetItemIndex(this.FItems.GetCount() - 1);
      };
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor");
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementTabClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementTabClassName","FElementTabClassName");
    $r.addProperty("ElementTabActiveClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementTabActiveClassName","FElementTabActiveClassName");
    $r.addProperty("ElementTabItemClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementTabItemClassName","FElementTabItemClassName");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Hint",2,rtl.string,"FHint","SetHint");
    $r.addProperty("ItemIndex",2,rtl.longint,"FItemIndex","SetItemIndex");
    $r.addProperty("Items",2,pas.Classes.$rtti["TStringList"],"FItems","SetItems");
    $r.addProperty("Left",3,rtl.longint,"GetLeft","SetLeft");
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",4,{Default: true});
    $r.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti["TPopupMenu"],"FPopupMenu","FPopupMenu");
    $r.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",4,{Default: false});
    $r.addProperty("SelectedColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FSelectedColor","SetSelectedColor",4,{Default: 12632256});
    $r.addProperty("SelectedTextColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FSelectedTextColor","SetSelectedTextColor",4,{Default: 0});
    $r.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder");
    $r.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",4,{Default: true});
    $r.addProperty("Top",3,rtl.longint,"GetTop","SetTop");
    $r.addProperty("UseHash",0,rtl.boolean,"FUseHash","FUseHash",4,{Default: true});
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChange","FOnChange");
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnKeyDown",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyDown","FOnKeyDown");
    $r.addProperty("OnKeyPress",0,pas["WEBLib.Controls"].$rtti["TKeyPressEvent"],"FOnKeyPress","FOnKeyPress");
    $r.addProperty("OnKeyUp",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyUp","FOnKeyUp");
    $r.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseDown","FOnMouseDown");
    $r.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseUp","FOnMouseUp");
    $r.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti["TMouseMoveEvent"],"FOnMouseMove","FOnMouseMove");
    $r.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseLeave","FOnMouseLeave");
    $r.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseEnter","FOnMouseEnter");
    $r.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnEnter","FOnEnter");
    $r.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnExit","FOnExit");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
  });
  rtl.createClass(this,"TWebTabSet",this.TTabSet,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTabSheet",pas["WEBLib.ExtCtrls"].TCustomPanel,function () {
    this.$init = function () {
      pas["WEBLib.ExtCtrls"].TCustomPanel.$init.call(this);
      this.FTabVisible = false;
      this.FTabEnabled = false;
      this.FPosUpdating = false;
      this.FOnShow = null;
      this.FOnHide = null;
      this.FMaterialGlyph = "";
      this.FMaterialGlyphColor = 0;
      this.FMaterialGlyphType = 0;
      this.FMaterialGlyphSize = 0;
    };
    this.$final = function () {
      this.FOnShow = undefined;
      this.FOnHide = undefined;
      pas["WEBLib.ExtCtrls"].TCustomPanel.$final.call(this);
    };
    this.SetTabVisible = function (Value) {
      if (this.FTabVisible !== Value) {
        this.FTabVisible = Value;
        if (this.FParent != null) {
          if ($mod.TPageControl.isPrototypeOf(this.FParent)) rtl.as(this.FParent,$mod.TPageControl).DoUpdateList();
        };
      };
    };
    this.SetTabEnabled = function (Value) {
      if (this.FTabEnabled !== Value) {
        this.FTabEnabled = Value;
        if (this.FParent != null) {
          if ($mod.TPageControl.isPrototypeOf(this.FParent)) rtl.as(this.FParent,$mod.TPageControl).DoUpdateList();
        };
      };
    };
    this.GetPageIndex = function () {
      var Result = 0;
      var i = 0;
      var j = 0;
      var FPageControl = null;
      Result = -1;
      if ($mod.TPageControl.isPrototypeOf(this.FParent)) {
        FPageControl = rtl.as(this.FParent,$mod.TPageControl);
        j = 0;
        for (var $l = 0, $end = FPageControl.GetControlsCount() - 1; $l <= $end; $l++) {
          i = $l;
          if ($mod.TTabSheet.isPrototypeOf(FPageControl.GetControls(i))) {
            if (FPageControl.GetControls(i) === this) {
              Result = j;
            } else j += 1;
          };
        };
      };
      return Result;
    };
    this.SetPageIndex = function (Value) {
    };
    this.SetMaterialGlyph = function (Value) {
      if (this.FMaterialGlyph !== Value) {
        this.FMaterialGlyph = Value;
        if ($mod.TPageControl.isPrototypeOf(this.FParent)) rtl.as(this.FParent,$mod.TPageControl).DoUpdateList();
      };
    };
    this.SetMaterialGlyphColor = function (Value) {
      if (this.FMaterialGlyphColor !== Value) {
        this.FMaterialGlyphColor = Value;
        if ($mod.TPageControl.isPrototypeOf(this.FParent)) rtl.as(this.FParent,$mod.TPageControl).DoUpdateList();
      };
    };
    this.SetMaterialGlyphSize = function (Value) {
      if (this.FMaterialGlyphSize !== Value) {
        this.FMaterialGlyphSize = Value;
        if ($mod.TPageControl.isPrototypeOf(this.FParent)) rtl.as(this.FParent,$mod.TPageControl).DoUpdateList();
      };
    };
    this.SetMaterialGlyphType = function (Value) {
      if (this.FMaterialGlyphType !== Value) {
        this.FMaterialGlyphType = Value;
        if ($mod.TPageControl.isPrototypeOf(this.FParent)) rtl.as(this.FParent,$mod.TPageControl).DoUpdateList();
      };
    };
    this.SetCaption = function (AValue) {
      pas["WEBLib.ExtCtrls"].TCustomPanel.SetCaption.apply(this,arguments);
      if (this.FParent != null) {
        if ($mod.TPageControl.isPrototypeOf(this.FParent)) rtl.as(this.FParent,$mod.TPageControl).DoUpdateList();
      };
    };
    this.SetParent = function (AValue) {
      if ($mod.TTabSheet.isPrototypeOf(AValue)) {
        if ($mod.TPageControl.isPrototypeOf(rtl.as(AValue,$mod.TTabSheet).FParent)) AValue = rtl.as(AValue,$mod.TTabSheet).FParent;
      };
      pas["WEBLib.Controls"].TControl.SetParent.call(this,AValue);
      if (this.FParent != null) {
        if ($mod.TPageControl.isPrototypeOf(this.FParent)) {
          rtl.as(this.FParent,$mod.TPageControl).DoUpdateList();
        };
      };
    };
    this.ResetUpdate = function () {
      pas["WEBLib.ExtCtrls"].TCustomPanel.EndUpdate.call(this);
    };
    this.CreateInitialize = function () {
      pas["WEBLib.ExtCtrls"].TCustomPanel.CreateInitialize.call(this);
      this.FEnablePropagation = true;
      this.FControlStyle = rtl.unionSet(this.FControlStyle,rtl.createSet(pas["WEBLib.Controls"].TControlStyleValue.csAcceptsControls));
      this.SetColor(16777215);
      this.SetTabVisible(true);
      this.SetTabEnabled(true);
      this.SetShowCaption(false);
      this.FPosUpdating = false;
      this.FMaterialGlyphSize = 18;
      this.FMaterialGlyphType = pas["WEBLib.Controls"].TMaterialGlyphType.mgNormal;
      this.FMaterialGlyphColor = -1;
    };
    this.EndUpdate = function () {
      pas["WEBLib.ExtCtrls"].TCustomPanel.EndUpdate.call(this);
      if (this.FParent != null) {
        if ($mod.TPageControl.isPrototypeOf(this.FParent)) rtl.as(this.FParent,$mod.TPageControl).DoUpdateList();
      };
    };
    this.SetBounds = function (X, Y, AWidth, AHeight) {
      pas["WEBLib.ExtCtrls"].TCustomPanel.SetBounds.apply(this,arguments);
      if ($mod.TPageControl.isPrototypeOf(this.FParent) && !this.FPosUpdating) {
        this.FPosUpdating = true;
        rtl.as(this.FParent,$mod.TPageControl).DoUpdateList();
        this.FPosUpdating = false;
      };
    };
    this.Destroy = function () {
      var p = null;
      p = null;
      if (this.FParent != null) {
        if ($mod.TPageControl.isPrototypeOf(this.FParent)) {
          p = rtl.as(this.FParent,$mod.TPageControl);
        };
      };
      pas["WEBLib.ExtCtrls"].TCustomPanel.Destroy.call(this);
      if (p != null) {
        p.DoUpdateList();
        p.SetTabIndex(0);
      };
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Alignment",2,pas.Classes.$rtti["TAlignment"],"FAlignment","SetAlignment",4,{Default: pas.Classes.TAlignment.taCenter});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("BorderColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FBorderColor","SetBorderColor",4,{Default: 12632256});
    $r.addProperty("BorderStyle",2,pas["WEBLib.Controls"].$rtti["TBorderStyle"],"FBorderStyle","SetBorderStyle",4,{Default: pas["WEBLib.Controls"].TBorderStyle.bsSingle});
    $r.addProperty("Caption",2,rtl.string,"FCaption","SetCaption");
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor");
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("ElementBodyClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementBodyClassName","FElementBodyClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("MaterialGlyph",2,rtl.string,"FMaterialGlyph","SetMaterialGlyph");
    $r.addProperty("MaterialGlyphColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FMaterialGlyphColor","SetMaterialGlyphColor",4,{Default: -1});
    $r.addProperty("MaterialGlyphSize",2,rtl.longint,"FMaterialGlyphSize","SetMaterialGlyphSize",4,{Default: 18});
    $r.addProperty("MaterialGlyphType",2,pas["WEBLib.Controls"].$rtti["TMaterialGlyphType"],"FMaterialGlyphType","SetMaterialGlyphType",4,{Default: pas["WEBLib.Controls"].TMaterialGlyphType.mgNormal});
    $r.addProperty("Padding",2,pas["WEBLib.Controls"].$rtti["TPadding"],"FPadding","SetPadding");
    $r.addProperty("PageIndex",7,rtl.longint,"GetPageIndex","SetPageIndex");
    $r.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",4,{Default: true});
    $r.addProperty("Role",3,rtl.string,"GetRole","SetRole");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("TabVisible",2,rtl.boolean,"FTabVisible","SetTabVisible",4,{Default: true});
    $r.addProperty("TabEnabled",2,rtl.boolean,"FTabEnabled","SetTabEnabled",4,{Default: true});
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnHide",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnHide","FOnHide");
    $r.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseDown","FOnMouseDown");
    $r.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti["TMouseMoveEvent"],"FOnMouseMove","FOnMouseMove");
    $r.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseUp","FOnMouseUp");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnShow",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnShow","FOnShow");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
  });
  rtl.createClass(this,"TWebTabSheet",this.TTabSheet,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TPageControl",pas["WEBLib.Menus"].TWebCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Menus"].TWebCustomControl.$init.call(this);
      this.FDesignTime$1 = false;
      this.FPrevTabIndex = 0;
      this.FItems = null;
      this.FTabIndex = 0;
      this.FSelectedColor = 0;
      this.FOnChange = null;
      this.FSelectedTextColor = 0;
      this.FDisabledTextColor = 0;
      this.FShowTabs = false;
      this.FOldVisible = false;
      this.FUseHash = false;
      this.FElementTabActiveClassName = "";
      this.FElementTabClassName = "";
      this.FElementTabItemClassName = "";
    };
    this.$final = function () {
      this.FItems = undefined;
      this.FOnChange = undefined;
      pas["WEBLib.Menus"].TWebCustomControl.$final.call(this);
    };
    this.SetSelectedColor = function (AValue) {
      if (this.FSelectedColor !== AValue) {
        this.FSelectedColor = AValue;
        this.DoUpdateList();
      };
    };
    this.SetItems = function (AItems) {
      this.FItems.Assign(AItems);
    };
    this.SetTabIndex = function (AIndex) {
      if (pas.Classes.TComponentStateItem.csLoading in this.FComponentState) this.FTabIndex = AIndex;
      if ((this.FTabIndex !== AIndex) && (AIndex >= 0) && (AIndex < this.PageCount())) {
        this.FTabIndex = AIndex;
        this.FPrevTabIndex = this.FTabIndex;
        this.DoUpdateList();
      };
    };
    this.GetActivePage = function () {
      var Result = null;
      var pi = 0;
      Result = null;
      pi = this.GetActivePageIndex();
      if (pi >= 0) Result = this.GetPage(pi);
      return Result;
    };
    this.GetActivePageIndex = function () {
      var Result = 0;
      Result = -1;
      if ((this.PageCount() >= 0) && (this.FTabIndex >= 0) && (this.FTabIndex < this.PageCount())) Result = this.FTabIndex;
      return Result;
    };
    this.SetActivePageIndex = function (Value) {
      if ((Value >= 0) && (Value < this.PageCount())) this.SetTabIndex(Value);
    };
    this.SetSelectedTextColor = function (Value) {
      if (this.FSelectedTextColor !== Value) {
        this.FSelectedTextColor = Value;
        this.DoUpdateList();
      };
    };
    this.SetActivePage = function (Value) {
      var i = 0;
      for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.GetControls(i) === Value) {
          this.SetActivePageIndex(i);
          break;
        };
      };
    };
    this.SetShowTabs = function (Value) {
      if (this.FShowTabs !== Value) {
        this.FShowTabs = Value;
        this.DoUpdateList();
      };
    };
    this.SetDisabledTextColor = function (Value) {
      if (this.FDisabledTextColor !== Value) {
        this.FDisabledTextColor = Value;
        this.DoUpdateList();
      };
    };
    this.GetPage = function (Index) {
      var Result = null;
      var c = 0;
      var i = 0;
      c = -1;
      Result = null;
      for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
        i = $l;
        if ($mod.TTabSheet.isPrototypeOf(this.GetControls(i))) c += 1;
        if (c === Index) {
          Result = rtl.as(this.GetControls(i),$mod.TTabSheet);
          break;
        };
      };
      return Result;
    };
    this.CreateElement = function () {
      var Result = null;
      Result = document.createElement("SPAN");
      return Result;
    };
    this.HandleDoClick = function (Event) {
      var Result = false;
      var sid = "";
      var cid = "";
      var i = 0;
      var el = null;
      var ts = null;
      el = Event.target;
      sid = "";
      if (el.hasAttribute("id")) sid = el.getAttribute("id");
      if (sid !== "") {
        cid = this.GetID();
        if (cid === "") cid = this.FName;
        sid = pas.SysUtils.StringReplace(sid,cid + "_","",{});
        if (pas.SysUtils.TryStrToInt(sid,{get: function () {
            return i;
          }, set: function (v) {
            i = v;
          }})) {
          if (this.FTabIndex !== -1) {
            ts = this.GetPage(this.FTabIndex);
            if ((ts != null) && (ts.FOnHide != null)) ts.FOnHide(ts);
          };
          this.FTabIndex = i;
          this.DoUpdateList();
          if (this.FTabIndex !== -1) {
            ts = this.GetPage(this.FTabIndex);
            if ((ts != null) && (ts.FOnShow != null)) ts.FOnShow(ts);
          };
        };
        pas["WEBLib.Controls"].TControl.HandleDoClick.apply(this,arguments);
      };
      Result = true;
      return Result;
    };
    this.HandleDoChange = function (Event) {
      var Result = false;
      if (this.FPrevTabIndex !== this.FTabIndex) {
        this.FPrevTabIndex = this.FTabIndex;
        if (this.FOnChange != null) this.FOnChange(this);
      };
      Result = true;
      return Result;
    };
    this.HandleDoItemMouseOut = function (Event) {
      var Result = false;
      var el = null;
      Result = true;
      el = Event.relatedTarget;
      if (el != null) {
        if (el.nodeName === "A") el.style.setProperty("background-color","");
      };
      return Result;
    };
    this.HandleDoItemMouseOver = function (Event) {
      var Result = false;
      var el = null;
      Result = true;
      el = Event.relatedTarget;
      if (el != null) {
        if (el.nodeName === "A") el.style.setProperty("background-color","lightgray");
      };
      return Result;
    };
    this.CanAcceptChild = function (AValue) {
      var Result = null;
      Result = pas["WEBLib.Controls"].TControl.CanAcceptChild.apply(this,arguments);
      if ((AValue != null) && !$mod.TTabSheet.isPrototypeOf(AValue)) {
        Result = this.FParent;
      };
      return Result;
    };
    this.BindEvents = function () {
      pas["WEBLib.Controls"].TCustomControl.BindEvents.call(this);
      if (this.GetElementHandle() != null) {
        this.GetElementHandle().onclick = rtl.createSafeCallback(this,"HandleDoChange");
      };
    };
    this.GetChildren = function (Proc, Root) {
      var i = 0;
      for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
        i = $l;
        if ($mod.TTabSheet.isPrototypeOf(this.GetControls(i))) {
          Proc(this.GetControls(i));
        };
      };
    };
    this.UpdateElement = function () {
      pas["WEBLib.Controls"].TControl.UpdateElement.call(this);
    };
    this.DoUpdateList = function () {
      var i = 0;
      var vistabindex = 0;
      var ena = null;
      var s = "";
      var cid = "";
      var shidden = "";
      var n = null;
      var ul = null;
      var li = null;
      var a = null;
      var tabs = null;
      var tab = null;
      var LLabel = null;
      var LHasLabel = false;
      var matclr = "";
      var icn = "";
      var noptr = "";
      var inactive = "";
      var th = 0;
      if (!(this.GetContainer() != null)) return;
      if (!(this.GetElementHandle() != null) || this.IsUpdating()) return;
      tab = null;
      if (this.GetControlsCount() > 0) {
        this.SetBorderStyle(pas["WEBLib.Controls"].TBorderStyle.bsNone);
        LLabel = this.GetElementHandle().firstChild;
        LHasLabel = (LLabel != null) && (LLabel.tagName === "DIV") && (LLabel.getAttribute("data-design") === "1");
        if (LHasLabel) {
          this.GetElementHandle().removeChild(this.GetElementHandle().firstChild);
          this.GetElementHandle().style.removeProperty("border");
        };
        tabs = pas.Classes.TStringList.$create("Create$1");
        shidden = "{#hidden#}";
        vistabindex = this.FTabIndex;
        for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
          i = $l;
          if ((pas.Classes.TComponentStateItem.csDestroying in this.GetControls(i).FComponentState) && (i <= this.FTabIndex)) vistabindex += 1;
          if ($mod.TTabSheet.isPrototypeOf(this.GetControls(i)) && !(pas.Classes.TComponentStateItem.csDestroying in this.GetControls(i).FComponentState)) {
            tab = this.GetControls(i);
            icn = "";
            if (tab.FTabEnabled) {
              ena = this}
             else ena = null;
            if (tab.FTabVisible) {
              if (tab.FMaterialGlyph !== "") {
                matclr = "";
                inactive = "";
                if (!tab.FEnabled) inactive = " md-light md-inactive";
                if (tab.FMaterialGlyphColor !== -1) matclr = ";color:" + pas["WEBLib.Graphics"].ColorToHTML(tab.FMaterialGlyphColor);
                noptr = "pointer-events:none";
                icn = '<i class="' + pas["WEBLib.Controls"].GetMaterialClass(tab.FMaterialGlyphType) + inactive + '" translate="no" style="' + noptr + ";font-size:" + pas.SysUtils.IntToStr(tab.FMaterialGlyphSize) + "px" + matclr + '">' + tab.FMaterialGlyph + "</i>&nbsp;";
              };
              tabs.AddObject(icn + tab.FCaption,ena);
            } else tabs.AddObject(shidden,ena);
            tab.BeginUpdate();
            if (vistabindex === i) {
              tab.SetAlign(pas["WEBLib.Controls"].TAlign.alClient)}
             else tab.SetAlign(pas["WEBLib.Controls"].TAlign.alNone);
            tab.SetAlignWithMargins(true);
            tab.FMargins.SetLeft(0);
            tab.FMargins.SetRight(0);
            tab.FMargins.SetBottom(0);
            tab.SetVisible(vistabindex === i);
            tab.ResetUpdate();
            if (vistabindex === i) tab.GetElementHandle().parentElement.insertBefore(tab.GetElementHandle(),null);
            tab.GetElementHandle().style.setProperty("background-color",pas["WEBLib.Graphics"].ColorToHTML(tab.FColor));
          };
        };
        cid = this.GetID();
        if (cid === "") cid = this.FName;
        for (var $l1 = 0, $end1 = this.GetContainer().childNodes.length - 1; $l1 <= $end1; $l1++) {
          i = $l1;
          n = this.GetContainer().childNodes.item(i);
          if ((n != null) && (n.getAttribute("id") === (cid + "_UL"))) this.GetContainer().removeChild(n);
        };
        this.GetContainer().setAttribute("class","");
        if (!this.FEnabled) {
          this.GetElementHandle().style.setProperty("pointer-events","none")}
         else this.GetElementHandle().style.setProperty("pointer-events","auto");
        if (this.FShowTabs) {
          ul = document.createElement("UL");
          ul.setAttribute("class",this.FElementClassName);
          ul.setAttribute("id",cid + "_UL");
          if (this.FElementClassName !== "") {
            ul.setAttribute("role","tablist")}
           else {
            ul.style.setProperty("list-style-type","none");
            ul.style.setProperty("margin","0");
            ul.style.setProperty("padding","0");
            ul.style.setProperty("display","inline-block");
          };
          this.GetContainer().appendChild(ul);
        };
        for (var $l2 = 0, $end2 = tabs.GetCount() - 1; $l2 <= $end2; $l2++) {
          i = $l2;
          s = tabs.Get(i);
          if ((s !== shidden) && this.FShowTabs) {
            if (s === "") s = "tab" + pas.SysUtils.IntToStr(i);
            li = document.createElement("LI");
            if (this.FElementClassName !== "") {
              if (this.FElementTabItemClassName === "") {
                li.setAttribute("class","nav-item")}
               else li.setAttribute("class",this.FElementTabItemClassName);
            } else {
              li.style.setProperty("float","left");
              if (this.FBorderStyle !== pas["WEBLib.Controls"].TBorderStyle.bsNone) li.style.setProperty("border-bottom","1px solid lightgray");
            };
            if (tabs.GetObject(i) === null) {
              li.style.setProperty("pointer-events","none");
              li.style.setProperty("color",pas["WEBLib.Graphics"].ColorToHTML(this.FDisabledTextColor));
            };
            if (this.FDragMode === pas["WEBLib.Controls"].TDragMode.dmAutomatic) li.setAttribute("draggable","true");
            pas["WEBLib.Controls"].SetHTMLElementFont(li,this.FFont,!((this.FElementClassName === "") && (this.FElementFont === pas["WEBLib.Controls"].TElementFont.efProperty)));
            ul.appendChild(li);
            if (!this.FEnabled) {
              a = document.createElement("SPAN")}
             else {
              a = document.createElement("A");
              if (this.FUseHash) a.setAttribute("href","#" + s);
            };
            if (this.FDragMode === pas["WEBLib.Controls"].TDragMode.dmAutomatic) a.setAttribute("draggable","false");
            a.innerHTML = s;
            a.setAttribute("id",cid + "_" + pas.SysUtils.IntToStr(i));
            if (this.FElementClassName !== "") {
              if (this.FTabIndex === i) {
                if (this.FElementTabActiveClassName === "") {
                  a.setAttribute("class","nav-link active")}
                 else a.setAttribute("class",this.FElementTabActiveClassName);
              } else {
                if (this.FElementTabClassName === "") {
                  a.setAttribute("class","nav-link")}
                 else a.setAttribute("class",this.FElementTabClassName);
              };
              a.setAttribute("role","tab");
              a.setAttribute("data-toggle","tab");
              a.setAttribute("aria-controls",s);
              if (this.FTabIndex === i) {
                a.setAttribute("aria-selected","true")}
               else a.setAttribute("aria-selected","false");
            } else {
              a.style.setProperty("display","block");
              a.style.setProperty("text-align","center");
              a.style.setProperty("padding","3px 15px");
              a.style.setProperty("text-decoration","none");
              a.style.setProperty("min-width","50px");
              a.style.setProperty("color","inherit");
              a.style.setProperty("font-family","inherit");
              a.style.setProperty("font-style","inherit");
              a.style.setProperty("font-size","inherit");
              if (this.FTabIndex === i) {
                if (this.FSelectedColor !== -1) a.style.setProperty("background-color",pas["WEBLib.Graphics"].ColorToHTML(this.FSelectedColor));
                if (this.FSelectedTextColor !== -1) a.style.setProperty("color",pas["WEBLib.Graphics"].ColorToHTML(this.FSelectedTextColor));
              };
            };
            li.appendChild(a);
          };
        };
        for (var $l3 = 0, $end3 = this.GetControlsCount() - 1; $l3 <= $end3; $l3++) {
          i = $l3;
          if ($mod.TTabSheet.isPrototypeOf(this.GetControls(i))) {
            if (this.FShowTabs) {
              th = Math.round(ul.offsetHeight) - 1}
             else th = 0;
            this.GetControls(i).FMargins.SetTop(th);
            this.GetControls(i).GetElementHandle().style.setProperty("white-space","");
          };
        };
        tabs = rtl.freeLoc(tabs);
      } else {
        if (!this.GetIsLinked()) {
          this.ClearChildElements();
          if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
            this.RenderDesigning("TWebPageControl",this.GetContainer(),this,true,"");
          };
        };
      };
      this.DoUpdateResize();
      if (tab != null) {
        tab.SetAlign(pas["WEBLib.Controls"].TAlign.alNone);
        tab.SetAlign(pas["WEBLib.Controls"].TAlign.alClient);
      };
      this.UpdateElement();
      if (!this.GetIsLinked() && (this.GetControlsCount() === 0)) {
        this.GetElementHandle().style.setProperty("border","1px solid lightgray");
      };
    };
    this.DoUpdateResize = function () {
      var i = 0;
      var vistabindex = 0;
      for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
        i = $l;
        if ($mod.TTabSheet.isPrototypeOf(this.GetControls(i))) this.GetControls(i).SetVisible(false);
      };
      for (var $l1 = 0, $end1 = this.GetControlsCount() - 1; $l1 <= $end1; $l1++) {
        i = $l1;
        if ($mod.TTabSheet.isPrototypeOf(this.GetControls(i))) {
          this.GetControls(i).SetVisible(true);
          this.GetControls(i).SetAlign(pas["WEBLib.Controls"].TAlign.alNone);
          this.GetControls(i).SetAlign(pas["WEBLib.Controls"].TAlign.alClient);
          this.GetControls(i).SetVisible(false);
        };
      };
      vistabindex = this.FTabIndex;
      for (var $l2 = 0, $end2 = this.GetControlsCount() - 1; $l2 <= $end2; $l2++) {
        i = $l2;
        if ((pas.Classes.TComponentStateItem.csDestroying in this.GetControls(i).FComponentState) && (i <= this.FTabIndex)) vistabindex += 1;
        if ($mod.TTabSheet.isPrototypeOf(this.GetControls(i))) {
          this.GetControls(i).SetVisible(vistabindex === i);
        };
      };
    };
    this.Loaded = function () {
      pas["WEBLib.Controls"].TCustomControl.Loaded.call(this);
      this.DoUpdateList();
      this.SetTabIndex(this.FTabIndex);
      this.FOldVisible = this.FVisible;
    };
    this.VisibleChanged = function () {
      pas["WEBLib.Controls"].TControl.VisibleChanged.call(this);
      if (this.FOldVisible !== this.FVisible) {
        this.DoUpdateList();
        this.FOldVisible = this.FVisible;
      };
    };
    this.ItemsChanged = function (Sender) {
      var i = 0;
      var ts = null;
      if ((this.PageCount() === 0) && (this.FItems.GetCount() > 0) && (this.GetElementHandle().childElementCount > 0)) {
        this.GetElementHandle().removeChild(this.GetElementHandle().firstChild);
      };
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.PageCount() <= i) {
          ts = $mod.TTabSheet.$create("Create$1",[this.FOwner]);
          ts.SetParent(this);
          ts.SetName(this.FName + "sheet" + pas.SysUtils.IntToStr(i + 1));
        };
        this.GetPage(i).SetCaption(this.FItems.Get(i));
      };
      for (var $l1 = this.PageCount() - 1; $l1 >= 0; $l1--) {
        i = $l1;
        if (i >= this.FItems.GetCount()) {
          ts = this.GetPage(i);
          ts = rtl.freeLoc(ts);
        };
      };
      this.DoUpdateList();
    };
    this.SetParent = function (AValue) {
      var ts = null;
      var frm = null;
      pas["WEBLib.Controls"].TControl.SetParent.apply(this,arguments);
      if (this.FDesignTime$1) {
        frm = pas["WEBLib.Forms"].GetParentForm(this);
        this.FDesignTime$1 = false;
        ts = $mod.TWebTabSheet.$create("Create$1",[frm]);
        ts.SetParent(this);
        ts.SetCaption("Page1");
        ts.SetName(this.GetUniqueName());
        ts = $mod.TWebTabSheet.$create("Create$1",[frm]);
        ts.SetParent(this);
        ts.SetCaption("Page2");
        ts.SetName(this.GetUniqueName());
      };
      this.DoUpdateList();
    };
    this.GetUniqueName = function () {
      var Result = "";
      var i = 0;
      var id = 0;
      var found = false;
      var AName = "";
      id = 1;
      AName = this.FName + "sheet";
      do {
        Result = AName + pas.SysUtils.IntToStr(id);
        found = true;
        for (var $l = 0, $end = this.FOwner.GetComponentCount() - 1; $l <= $end; $l++) {
          i = $l;
          if (this.FOwner.GetComponent(i).FName === Result) {
            found = false;
            id += 1;
            break;
          };
        };
      } while (!found);
      return Result;
    };
    this.EnableDrag = function () {
      var $Self = this;
      function AddDraggableAttribute(AElement) {
        var I = 0;
        var tn = "";
        for (var $l = 0, $end = AElement.children.length - 1; $l <= $end; $l++) {
          I = $l;
          tn = AElement.children.item(I).tagName;
          if (tn === "LI") {
            AElement.children.item(I).setAttribute("draggable","true");
            AddDraggableAttribute(AElement.children.item(I));
          } else if (tn === "A") {
            AElement.children.item(I).setAttribute("draggable","false")}
           else if (tn === "UL") AddDraggableAttribute(AElement.children.item(I));
        };
      };
      if (!(this.GetContainer() != null)) return;
      AddDraggableAttribute(this.GetContainer());
    };
    this.DisableDrag = function () {
      var $Self = this;
      function RemoveDraggableAttribute(AElement) {
        var I = 0;
        var tn = "";
        for (var $l = 0, $end = AElement.children.length - 1; $l <= $end; $l++) {
          I = $l;
          tn = AElement.children.item(I).tagName;
          if (tn === "LI") {
            AElement.children.item(I).removeAttribute("draggable");
            RemoveDraggableAttribute(AElement.children.item(I));
          } else if (tn === "A") {
            AElement.children.item(I).removeAttribute("draggable")}
           else if (tn === "UL") RemoveDraggableAttribute(AElement.children.item(I));
        };
      };
      if (!(this.GetContainer() != null)) return;
      RemoveDraggableAttribute(this.GetContainer());
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.FDesignTime$1 = (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) && !((pas.Classes.TComponentStateItem.csReading in this.FOwner.FComponentState) || (pas.Classes.TComponentStateItem.csLoading in this.FOwner.FComponentState));
      this.FControlStyle = rtl.unionSet(this.FControlStyle,rtl.createSet(pas["WEBLib.Controls"].TControlStyleValue.csAcceptsControls));
      this.SetBorderStyle(pas["WEBLib.Controls"].TBorderStyle.bsNone);
      this.FItems = pas.Classes.TStringList.$create("Create$1");
      this.FItems.FOnChange = rtl.createCallback(this,"ItemsChanged");
      this.FTabIndex = 0;
      this.FPrevTabIndex = this.FTabIndex;
      this.FShowTabs = true;
      this.FUseHash = true;
      this.SetTabStop(false);
      this.FSelectedColor = 12632256;
      this.FSelectedTextColor = 0;
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        this.SetWidth(400);
        this.SetHeight(300);
      };
      this.FEnablePropagation = true;
      this.FOldVisible = true;
    };
    this.Destroy = function () {
      rtl.free(this,"FItems");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.Clear = function () {
      this.FItems.Clear();
    };
    this.EndUpdate = function () {
      pas["WEBLib.Controls"].TCustomControl.EndUpdate.call(this);
      this.DoUpdateList();
    };
    this.SelectNextPage = function (GoForward) {
      if (GoForward) {
        if (this.FTabIndex < (this.PageCount() - 1)) {
          this.SetTabIndex(this.FTabIndex + 1)}
         else this.SetTabIndex(0);
      } else {
        if (this.FTabIndex > 0) {
          this.SetTabIndex(this.FTabIndex - 1)}
         else this.SetTabIndex(this.PageCount() - 1);
      };
    };
    this.PageCount = function () {
      var Result = 0;
      var i = 0;
      Result = 0;
      for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
        i = $l;
        if ($mod.TTabSheet.isPrototypeOf(this.GetControls(i))) Result += 1;
      };
      return Result;
    };
    this.PageIndexFromElement = function (AElement) {
      var Result = 0;
      var sid = "";
      var cid = "";
      var i = 0;
      Result = -1;
      sid = "";
      if (AElement.tagName === "LI") AElement = AElement.firstChild;
      if (AElement.hasAttribute("id")) sid = AElement.getAttribute("id");
      if (sid !== "") {
        cid = this.GetID();
        if (cid === "") cid = this.FName;
        sid = pas.SysUtils.StringReplace(sid,cid + "_","",{});
        if (pas.SysUtils.TryStrToInt(sid,{get: function () {
            return i;
          }, set: function (v) {
            i = v;
          }})) Result = i;
      };
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("BorderStyle",2,pas["WEBLib.Controls"].$rtti["TBorderStyle"],"FBorderStyle","SetBorderStyle",4,{Default: pas["WEBLib.Controls"].TBorderStyle.bsNone});
    $r.addProperty("ChildOrder",2,rtl.longint,"FChildOrder","SetChildOrderEx",4,{Default: 0});
    $r.addProperty("DisabledTextColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FDisabledTextColor","SetDisabledTextColor",4,{Default: 8421504});
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementTabClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementTabClassName","FElementTabClassName");
    $r.addProperty("ElementTabActiveClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementTabActiveClassName","FElementTabActiveClassName");
    $r.addProperty("ElementTabItemClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementTabItemClassName","FElementTabItemClassName");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Hint",2,rtl.string,"FHint","SetHint");
    $r.addProperty("TabIndex",2,rtl.longint,"FTabIndex","SetTabIndex");
    $r.addProperty("Left",3,rtl.longint,"GetLeft","SetLeft");
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",4,{Default: true});
    $r.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti["TPopupMenu"],"FPopupMenu","FPopupMenu");
    $r.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",4,{Default: false});
    $r.addProperty("ShowTabs",2,rtl.boolean,"FShowTabs","SetShowTabs",4,{Default: true});
    $r.addProperty("SelectedColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FSelectedColor","SetSelectedColor",4,{Default: 12632256});
    $r.addProperty("SelectedTextColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FSelectedTextColor","SetSelectedTextColor",4,{Default: 0});
    $r.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder");
    $r.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",4,{Default: true});
    $r.addProperty("Top",3,rtl.longint,"GetTop","SetTop");
    $r.addProperty("UseHash",0,rtl.boolean,"FUseHash","FUseHash",4,{Default: true});
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChange","FOnChange");
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnKeyDown",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyDown","FOnKeyDown");
    $r.addProperty("OnKeyPress",0,pas["WEBLib.Controls"].$rtti["TKeyPressEvent"],"FOnKeyPress","FOnKeyPress");
    $r.addProperty("OnKeyUp",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyUp","FOnKeyUp");
    $r.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseDown","FOnMouseDown");
    $r.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseUp","FOnMouseUp");
    $r.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti["TMouseMoveEvent"],"FOnMouseMove","FOnMouseMove");
    $r.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseLeave","FOnMouseLeave");
    $r.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseEnter","FOnMouseEnter");
    $r.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnEnter","FOnEnter");
    $r.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnExit","FOnExit");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
  });
  rtl.createClass(this,"TWebPageControl",this.TPageControl,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.TProgressBarStyle = {"0": "pbstNormal", pbstNormal: 0, "1": "pbstMarquee", pbstMarquee: 1, "2": "pbstDiv", pbstDiv: 2};
  this.$rtti.$Enum("TProgressBarStyle",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TProgressBarStyle});
  this.TProgressBarValue = {"0": "pbvNone", pbvNone: 0, "1": "pbvPercentage", pbvPercentage: 1, "2": "pbvAbsolute", pbvAbsolute: 2};
  this.$rtti.$Enum("TProgressBarValue",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TProgressBarValue});
  rtl.createClass(this,"TProgressBar",pas["WEBLib.Menus"].TWebCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Menus"].TWebCustomControl.$init.call(this);
      this.FMax = 0;
      this.FMin = 0;
      this.FPosition = 0;
      this.FStyle = 0;
      this.FElementBarClassName = "";
      this.FValue = 0;
      this.FValueColor = 0;
    };
    this.SetStyle = function (Value) {
      if (this.FStyle !== Value) {
        this.FStyle = Value;
        if (this.GetElementHandle() != null) {
          this.CreateProgressElement(this.GetElementHandle());
          this.DoUpdate();
        };
      };
    };
    this.SetElementBarClassName = function (Value) {
      this.FElementBarClassName = Value;
      this.DoUpdate();
    };
    this.SetValue = function (Value) {
      this.FValue = Value;
      this.DoUpdate();
    };
    this.SetValueColor = function (Value) {
      if (this.FValueColor !== Value) {
        this.FValueColor = Value;
        this.UpdateElementVisual();
      };
    };
    this.CreateElement = function () {
      var Result = null;
      Result = document.createElement("SPAN");
      this.CreateProgressElement(Result);
      return Result;
    };
    this.SetMax = function (AValue) {
      this.FMax = AValue;
      this.DoUpdate();
    };
    this.SetMin = function (AValue) {
      this.FMin = AValue;
      this.DoUpdate();
    };
    this.SetPosition = function (AValue) {
      if ((AValue >= this.FMin) && (AValue <= this.FMax)) {
        this.FPosition = AValue;
        this.DoUpdate();
      };
    };
    this.DoUpdate = function () {
      var pvalue = 0;
      var maxvalue = 0;
      var el = null;
      var pos = 0;
      if (!(this.GetContainer() != null)) return;
      if (this.FMax !== this.FMin) {
        pos = Math.round(((this.FPosition - this.FMin) / (this.FMax - this.FMin)) * 100)}
       else pos = 0;
      if (this.GetIsLinked()) {
        if (this.GetElementHandle().tagName === "DIV") {
          if (this.GetElementHandle().getAttribute("role") === "progressbar") {
            this.GetElementHandle().style.setProperty("width",pas.SysUtils.IntToStr(pos) + "%")}
           else this.GetElementHandle().innerHTML = pas.SysUtils.IntToStr(pos);
        } else this.GetElementHandle().setAttribute("value",pas.SysUtils.IntToStr(pos));
        return;
      };
      if (this.FStyle === $mod.TProgressBarStyle.pbstDiv) {
        el = this.GetElementHandle().firstChild;
        if (this.FElementClassName !== "") {
          el.setAttribute("class",this.FElementClassName);
          this.GetElementHandle().removeAttribute("class");
        };
        el.style.setProperty("height",pas.SysUtils.IntToStr(this.GetHeight()) + "px");
        if (this.FWidthStyle === pas["WEBLib.Controls"].TSizeStyle.ssAbsolute) el.style.setProperty("width",pas.SysUtils.IntToStr(this.GetWidth()) + "px");
        el = el.firstChild;
        el.style.setProperty("background-color","#3397FD");
        if (this.FElementBarClassName !== "") el.setAttribute("class",this.FElementBarClassName);
        el.setAttribute("role","progressbar");
        el.style.setProperty("width",pas.SysUtils.IntToStr(pos) + "%");
        var $tmp = this.FValue;
        if ($tmp === $mod.TProgressBarValue.pbvPercentage) {
          el.innerHTML = pas.SysUtils.IntToStr(pos) + "%"}
         else if ($tmp === $mod.TProgressBarValue.pbvAbsolute) {
          el.innerHTML = pas.SysUtils.IntToStr(this.FPosition)}
         else if ($tmp === $mod.TProgressBarValue.pbvNone) el.innerHTML = "&nbsp;";
      } else {
        el = this.GetElementHandle().firstChild;
        el.style.setProperty("width","100%");
        el.style.setProperty("height","100%");
        pvalue = this.FPosition - this.FMin;
        maxvalue = this.FMax - this.FMin;
        el.setAttribute("max",pas.SysUtils.IntToStr(maxvalue));
        if (this.FStyle === $mod.TProgressBarStyle.pbstNormal) {
          el.setAttribute("value",pas.SysUtils.IntToStr(pvalue))}
         else el.removeAttribute("value");
      };
    };
    this.UpdateElementVisual = function () {
      var el = null;
      pas["WEBLib.Controls"].TCustomControl.UpdateElementVisual.call(this);
      if (this.FValueColor !== -1) {
        if (this.FStyle === $mod.TProgressBarStyle.pbstDiv) {
          el = this.GetElementHandle().firstChild;
          el = el.firstChild;
          el.style.setProperty("background-color",pas["WEBLib.Graphics"].ColorToHTML(this.FValueColor));
        } else {
          el = this.GetElementHandle().firstChild;
          el.style.setProperty("accent-color",pas["WEBLib.Graphics"].ColorToHTML(this.FValueColor));
        };
      };
    };
    this.CreateProgressElement = function (AElement) {
      var d = null;
      while (AElement.firstChild != null) AElement.removeChild(AElement.firstChild);
      if (this.FStyle === $mod.TProgressBarStyle.pbstDiv) {
        d = document.createElement("DIV");
        d.appendChild(document.createElement("DIV"));
      } else d = document.createElement("PROGRESS");
      AElement.appendChild(d);
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.FMax = 100;
      this.FMin = 0;
      this.FPosition = 0;
      this.FStyle = $mod.TProgressBarStyle.pbstNormal;
      this.FValueColor = -1;
    };
    this.AfterLoadDFMValues = function () {
      pas.Classes.TComponent.AfterLoadDFMValues.call(this);
      this.DoUpdate();
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("ElementBarClassName",2,rtl.string,"FElementBarClassName","SetElementBarClassName");
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Left",3,rtl.longint,"GetLeft","SetLeft");
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("Max",2,rtl.longint,"FMax","SetMax");
    $r.addProperty("Min",2,rtl.longint,"FMin","SetMin");
    $r.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti["TPopupMenu"],"FPopupMenu","FPopupMenu");
    $r.addProperty("Position",2,rtl.longint,"FPosition","SetPosition");
    $r.addProperty("Style",2,$mod.$rtti["TProgressBarStyle"],"FStyle","SetStyle");
    $r.addProperty("Top",3,rtl.longint,"GetTop","SetTop");
    $r.addProperty("Value",2,$mod.$rtti["TProgressBarValue"],"FValue","SetValue");
    $r.addProperty("ValueColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FValueColor","SetValueColor",4,{Default: -1});
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
  });
  rtl.createClass(this,"TWebProgressBar",this.TProgressBar,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.$rtti.$MethodVar("TTreeViewNodeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Node",pas["WEBLib.TreeNodes"].$rtti["TTreeNode"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTreeViewNodeStateEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Node",pas["WEBLib.TreeNodes"].$rtti["TTreeNode"]],["AState",rtl.boolean]]), methodkind: 0});
  this.$rtti.$MethodVar("TTreeViewNodeAllowEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Node",pas["WEBLib.TreeNodes"].$rtti["TTreeNode"]],["Allow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTreeViewNodeRenderEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Node",pas["WEBLib.TreeNodes"].$rtti["TTreeNode"]],["AElement",pas["WEBLib.Controls"].$rtti["TJSHTMLElementRecord"]]]), methodkind: 0});
  rtl.createClass(this,"TTreeView",pas["WEBLib.Menus"].TWebCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Menus"].TWebCustomControl.$init.call(this);
      this.FItems = null;
      this.FSelected = null;
      this.FOnCollapsing = null;
      this.FOnExpanding = null;
      this.FOnCollapsed = null;
      this.FOnExpanded = null;
      this.FOnClickNode = null;
      this.FOnDblClickNode = null;
      this.FOnRenderNode = null;
      this.FAutoExpand = false;
      this.FOnChange = null;
      this.FOnChanging = null;
      this.FElementNodeSelectedClassName = "";
      this.FElementNodeClassName = "";
      this.FOnClickRadio = null;
      this.FOnClickCheckBox = null;
    };
    this.$final = function () {
      this.FItems = undefined;
      this.FSelected = undefined;
      this.FOnCollapsing = undefined;
      this.FOnExpanding = undefined;
      this.FOnCollapsed = undefined;
      this.FOnExpanded = undefined;
      this.FOnClickNode = undefined;
      this.FOnDblClickNode = undefined;
      this.FOnRenderNode = undefined;
      this.FOnChange = undefined;
      this.FOnChanging = undefined;
      this.FOnClickRadio = undefined;
      this.FOnClickCheckBox = undefined;
      pas["WEBLib.Menus"].TWebCustomControl.$final.call(this);
    };
    this.SetItems = function (Value) {
      this.FItems.Assign(Value);
    };
    this.GetSelected = function () {
      var Result = null;
      Result = this.FSelected;
      return Result;
    };
    this.SetSelected = function (Value) {
      var el = null;
      if (this.FSelected != null) {
        this.FSelected.UnSelect();
        el = this.GetNodeElement(this.FSelected);
        if (el != null) {
          el.classList.toggle("TVSELECTED");
          if (this.FElementNodeSelectedClassName !== "") el.classList.toggle(this.FElementNodeSelectedClassName);
        };
      };
      this.FSelected = Value;
      if (this.FSelected != null) this.FSelected.Select();
      el = this.GetNodeElement(this.FSelected);
      if (el != null) {
        el.classList.toggle("TVSELECTED");
        if (this.FElementNodeSelectedClassName !== "") el.classList.toggle(this.FElementNodeSelectedClassName);
      };
    };
    this.SetElementNodeClassName = function (Value) {
      if (this.FElementNodeClassName !== Value) {
        this.FElementNodeClassName = Value;
        this.UpdateElement();
      };
    };
    this.SetElementNodeSelectedClassName = function (Value) {
      if (this.FElementNodeSelectedClassName !== Value) {
        this.FElementNodeSelectedClassName = Value;
        this.UpdateElement();
      };
    };
    this.GetTopItem = function () {
      var Result = null;
      var el = null;
      var tn = null;
      var h = 0.0;
      Result = null;
      if (this.FItems.GetSiblingCount() === 0) return Result;
      h = this.GetElementHandle().getBoundingClientRect().top;
      tn = this.FItems.GetSiblingFromIndex(0);
      while (tn != null) {
        el = this.GetNodeElement(tn);
        if (el.getBoundingClientRect().top >= h) {
          Result = tn;
          break;
        };
        tn = tn.GetNext();
      };
      return Result;
    };
    this.SetTopItem = function (Value) {
      var el = null;
      var h = 0.0;
      var ch = 0.0;
      if (!(Value != null)) throw pas.SysUtils.Exception.$create("Create$1",["Value is not assigned"]);
      el = this.GetNodeElement(Value);
      h = el.getBoundingClientRect().top + this.GetElementHandle().scrollTop;
      ch = this.GetElementHandle().getBoundingClientRect().top;
      this.GetElementHandle().scrollTop = Math.round(h - ch);
    };
    this.DoRenderNode = function (ANode, AElement) {
      var LElementRec = pas["WEBLib.Controls"].TJSHTMLElementRecord.$new();
      if (this.FOnRenderNode != null) {
        LElementRec.element = AElement;
        this.FOnRenderNode(this,ANode,pas["WEBLib.Controls"].TJSHTMLElementRecord.$clone(LElementRec));
      };
    };
    this.RenderControl = function (ANode, AElementName) {
      var Result = "";
      var chk = "";
      var rname = "";
      var l = 0;
      chk = "";
      if (ANode.FChecked) chk = " checked";
      rname = AElementName;
      l = rname.length;
      if (pas.System.Pos("_",rname) > 0) {
        while (rname.charAt(l - 1) !== "_") {
          l -= 1;
        };
        rname = pas.System.Copy(rname,1,l - 1);
      };
      var $tmp = ANode.FNodeType;
      if ($tmp === pas["WEBLib.TreeNodes"].TNodeType.ntCheckbox) {
        Result = '<input type="checkbox"' + chk + "></input>&nbsp;" + ANode.FText}
       else if ($tmp === pas["WEBLib.TreeNodes"].TNodeType.ntRadioButton) {
        Result = '<input type="radio"' + chk + ' name="' + rname + '"></input>&nbsp;' + ANode.FText}
       else if ($tmp === pas["WEBLib.TreeNodes"].TNodeType.ntText) Result = ANode.FText;
      return Result;
    };
    this.RenderNode = function (ANode, AElementName) {
      var Result = null;
      Result = document.createElement("SPAN");
      if (AElementName !== "") Result.setAttribute("id",AElementName);
      Result.innerHTML = this.RenderControl(ANode,AElementName);
      Result.classList.add("TVNODE");
      if (this.FElementNodeClassName !== "") Result.classList.add(this.FElementNodeClassName);
      if (this.GetSelected() != null) {
        if (this.GetSelected() === ANode) {
          Result.classList.add("TVSELECTED");
          if (this.FElementNodeSelectedClassName !== "") Result.classList.add(this.FElementNodeSelectedClassName);
        };
      };
      if (ANode.FHint !== "") Result.setAttribute("title",ANode.FHint);
      return Result;
    };
    this.RenderNodes = function () {
      var $Self = this;
      function RenderChildNode(LinkElement, ANode, AElementName) {
        var sp = null;
        var nd = null;
        sp = document.createElement("SPAN");
        if (AElementName !== "") sp.setAttribute("id",AElementName);
        sp.addEventListener("click",rtl.createSafeCallback($Self,"HandleNode"));
        sp.addEventListener("dblclick",rtl.createSafeCallback($Self,"HandleDblClick"));
        nd = document.createElement("SPAN");
        if ($Self.FAutoExpand) nd.style.setProperty("pointer-events","none");
        nd.innerHTML = $Self.RenderControl(ANode,AElementName);
        nd.classList.add("TVNODE");
        if ($Self.FElementNodeClassName !== "") nd.classList.add($Self.FElementNodeClassName);
        if (!$Self.FAutoExpand) nd.classList.add("TVNOCURSOR");
        if ($Self.GetSelected() != null) {
          if ($Self.GetSelected() === ANode) {
            nd.classList.add("TVSELECTED");
            if ($Self.FElementNodeSelectedClassName !== "") nd.classList.add($Self.FElementNodeSelectedClassName);
          };
        };
        if (ANode.FHint !== "") nd.setAttribute("title",ANode.FHint);
        LinkElement.appendChild(sp);
        sp.appendChild(nd);
        if (ANode.FIsExpanded) {
          sp.setAttribute("class","TVCARET TVCARET-DOWN")}
         else sp.setAttribute("class","TVCARET");
        $Self.DoRenderNode(ANode,nd);
      };
      function FillChilds(ParentElement, ParentName, ANode) {
        var i = 0;
        var ul = null;
        var nd = null;
        var li = null;
        var nn = "";
        ul = document.createElement("UL");
        ul.setAttribute("class","TVUL");
        ul.setAttribute("id",ParentName);
        if ($Self.FDragMode === pas["WEBLib.Controls"].TDragMode.dmAutomatic) ul.setAttribute("draggable","true");
        ParentElement.appendChild(ul);
        if (!(ANode != null)) {
          for (var $l = 0, $end = $Self.FItems.GetSiblingCount() - 1; $l <= $end; $l++) {
            i = $l;
            nn = ParentName + "_" + pas.SysUtils.IntToStr(i);
            li = document.createElement("LI");
            if ($Self.FDragMode === pas["WEBLib.Controls"].TDragMode.dmAutomatic) li.setAttribute("draggable","true");
            ul.appendChild(li);
            if ($Self.FItems.GetSiblingFromIndex(i).GetCount() > 0) {
              RenderChildNode(li,$Self.FItems.GetSiblingFromIndex(i),nn);
              FillChilds(li,nn,$Self.FItems.GetSiblingFromIndex(i));
            } else {
              nd = $Self.RenderNode($Self.FItems.GetSiblingFromIndex(i),nn);
              li.appendChild(nd);
              $Self.DoRenderNode($Self.FItems.GetSiblingFromIndex(i),nd);
              nd.addEventListener("click",rtl.createSafeCallback($Self,"HandleClick"));
              nd.addEventListener("dblclick",rtl.createSafeCallback($Self,"HandleDblClick"));
            };
          };
        } else {
          if (ANode.FIsExpanded) {
            ul.setAttribute("class","TVNESTED TVUL TVACTIVE")}
           else ul.setAttribute("class","TVNESTED TVUL");
          for (var $l1 = 0, $end1 = ANode.GetCount() - 1; $l1 <= $end1; $l1++) {
            i = $l1;
            nn = ParentName + "_" + pas.SysUtils.IntToStr(i);
            li = document.createElement("LI");
            if ($Self.FDragMode === pas["WEBLib.Controls"].TDragMode.dmAutomatic) li.setAttribute("draggable","true");
            ul.appendChild(li);
            if (ANode.GetItem(i).GetCount() > 0) {
              RenderChildNode(li,ANode.GetItem(i),nn);
              FillChilds(li,nn,ANode.GetItem(i));
            } else {
              nd = $Self.RenderNode(ANode.GetItem(i),nn);
              li.appendChild(nd);
              $Self.DoRenderNode(ANode.GetItem(i),nd);
              nd.addEventListener("click",rtl.createSafeCallback($Self,"HandleClick"));
              nd.addEventListener("dblclick",rtl.createSafeCallback($Self,"HandleDblClick"));
            };
          };
        };
      };
      if (!(this.GetElementHandle() != null)) return;
      while (this.GetElementHandle().childNodes.length > 0) this.GetElementHandle().removeChild(this.GetElementHandle().firstChild);
      FillChilds(this.GetElementHandle(),this.FormPrefix() + this.FName,null);
      this.GetElementHandle().style.setProperty("overflow","auto");
    };
    this.CreateNodes = function () {
      var Result = null;
      Result = pas["WEBLib.TreeNodes"].TTreeNodes.$create("Create$1",[this]);
      return Result;
    };
    this.CreateElement = function () {
      var Result = null;
      var tn = null;
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        this.BeginUpdate();
        tn = this.FItems.Add$2('<font color="#E5413C" style="font-size:10pt">&#x25FC;</font> Item 1');
        this.FItems.AddChild(tn,"Child Item 1");
        tn = this.FItems.Add$2('<font color="#F39527" style="font-size:10pt">&#x25FC;</font> Item 2');
        this.FItems.AddChild(tn,"Child Item 2");
        tn = this.FItems.Add$2('<font color="#BDC6CB" style="font-size:10pt">&#x25FC;</font> Item 3');
        this.FItems.AddChild(tn,"Child Item 3");
        this.EndUpdate();
      };
      Result = document.createElement("DIV");
      return Result;
    };
    this.DoNodesChanged = function (Sender) {
    };
    this.DoExpandedChanged = function (Sender, ANode) {
      var el = null;
      var su = null;
      var i = 0;
      if (ANode.GetCount() > 0) {
        el = this.GetNodeElement(ANode);
        if ((el != null) && (el.parentElement != null) && (el.parentElement.parentElement != null)) {
          su = el.parentElement.parentElement.querySelector(".TVNESTED");
          if (su != null) {
            if (ANode.FIsExpanded) {
              su.classList.add("TVACTIVE")}
             else su.classList.remove("TVACTIVE");
            el.parentElement.classList.toggle("TVCARET-DOWN");
          };
        };
        if (this.FAutoExpand) {
          for (var $l = 0, $end = ANode.GetCount() - 1; $l <= $end; $l++) {
            i = $l;
            if (ANode.GetItem(i).GetCount() > 0) {
              ANode.GetItem(i).SetIsExpanded(ANode.FIsExpanded);
            };
          };
        };
      };
    };
    this.DoSelectionChanged = function (Sender, ANode, IsSelected) {
      if (IsSelected) {
        this.SetSelected(ANode)}
       else this.SetSelected(null);
    };
    this.HandleNode = function (Event) {
      var Result = false;
      var el = null;
      var chk = null;
      var n = null;
      var Allow = false;
      var IsInput = false;
      el = Event.srcElement;
      IsInput = el.tagName === "INPUT";
      while ((el != null) && (el.tagName !== "SPAN")) el = el.parentElement;
      if (IsInput) el = el.parentElement;
      Allow = true;
      if ((el != null) && el.hasAttribute("id")) {
        n = this.GetNodeFromID(el.getAttribute("id"));
        if (IsInput && (n.FNodeType in rtl.createSet(pas["WEBLib.TreeNodes"].TNodeType.ntCheckbox,pas["WEBLib.TreeNodes"].TNodeType.ntRadioButton))) {
          chk = el.firstChild.firstChild;
          if (chk.tagName === "INPUT") {
            if (chk.getAttribute("type") === "radio") {
              this.ClickRadio(n,chk.checked)}
             else this.ClickCheck(n,chk.checked);
            n.SetChecked(chk.checked);
            Allow = false;
          };
        };
        if (n.FIsExpanded) {
          if (this.FOnCollapsing != null) this.FOnCollapsing(this,n,{get: function () {
              return Allow;
            }, set: function (v) {
              Allow = v;
            }});
        } else {
          if (this.FOnExpanding != null) this.FOnExpanding(this,n,{get: function () {
              return Allow;
            }, set: function (v) {
              Allow = v;
            }});
        };
        if (Allow) {
          n.SetIsExpanded(!n.FIsExpanded);
          if (n.FIsExpanded) {
            if (this.FOnExpanded != null) this.FOnExpanded(this,n);
          } else {
            if (this.FOnCollapsed != null) this.FOnCollapsed(this,n);
          };
        };
        this.DoChangeSelection(n);
        if (this.FOnClickNode != null) this.FOnClickNode(this,n);
        Result = true;
        if (!IsInput) Event.preventDefault();
      } else {
        if (el != null) {
          el = el.parentElement;
          if (el.hasAttribute("id")) {
            n = this.GetNodeFromID(el.getAttribute("id"));
            this.DoChangeSelection(n);
            if (this.FOnClickNode != null) this.FOnClickNode(this,n);
            Result = true;
            Event.preventDefault();
          };
        };
      };
      return Result;
    };
    this.HandleClick = function (Event) {
      var Result = false;
      var n = null;
      var el = null;
      var chk = null;
      Result = true;
      el = Event.srcElement;
      while ((el != null) && (el.tagName !== "SPAN")) el = el.parentElement;
      if (el != null) {
        if (el.hasAttribute("id")) {
          n = this.GetNodeFromID(el.getAttribute("id"));
          if (n.FNodeType in rtl.createSet(pas["WEBLib.TreeNodes"].TNodeType.ntCheckbox,pas["WEBLib.TreeNodes"].TNodeType.ntRadioButton)) {
            chk = el.firstChild;
            if (chk.tagName === "INPUT") {
              if (chk.getAttribute("type") === "radio") {
                this.ClickRadio(n,chk.checked)}
               else this.ClickCheck(n,chk.checked);
              n.SetChecked(chk.checked);
            };
          };
          if (this.FOnClick != null) this.FOnClick(this);
          if (n != null) {
            this.DoChangeSelection(n);
            if (this.FOnClickNode != null) this.FOnClickNode(this,n);
          };
        };
      };
      return Result;
    };
    this.HandleDblClick = function (Event) {
      var Result = false;
      var n = null;
      var c = null;
      var el = null;
      var Allow = false;
      Result = true;
      el = Event.srcElement;
      while ((el != null) && (el.tagName !== "SPAN")) el = el.parentElement;
      if (el != null) {
        if (!el.hasAttribute("id")) el = el.parentElement;
        if (el.hasAttribute("id")) {
          n = this.GetNodeFromID(el.getAttribute("id"));
          if (this.FOnDblClick != null) this.FOnDblClick(this);
          if (n != null) {
            this.DoChangeSelection(n);
            Allow = true;
            c = n.GetFirstChild();
            if (c != null) {
              if (n.FIsExpanded) {
                if (this.FOnCollapsing != null) this.FOnCollapsing(this,n,{get: function () {
                    return Allow;
                  }, set: function (v) {
                    Allow = v;
                  }});
              } else {
                if (this.FOnExpanding != null) this.FOnExpanding(this,n,{get: function () {
                    return Allow;
                  }, set: function (v) {
                    Allow = v;
                  }});
              };
              if (Allow) {
                n.SetIsExpanded(!n.FIsExpanded);
                if (n.FIsExpanded) {
                  if (this.FOnExpanded != null) this.FOnExpanded(this,n);
                } else if (!n.FIsExpanded) {
                  if (this.FOnCollapsed != null) this.FOnCollapsed(this,n);
                };
              };
            };
            if ((n != null) && (this.FOnDblClickNode != null)) this.FOnDblClickNode(this,n);
          };
        };
      };
      Event.stopPropagation();
      Result = true;
      return Result;
    };
    this.ClickCheck = function (ANode, AState) {
      if (this.FOnClickCheckBox != null) this.FOnClickCheckBox(this,ANode,AState);
    };
    this.ClickRadio = function (ANode, AState) {
      if (this.FOnClickRadio != null) this.FOnClickRadio(this,ANode,AState);
    };
    this.KeyDown = function (Key, Shift) {
      var tn = null;
      var sn = null;
      var ln = null;
      var c = null;
      var Allow = false;
      tn = this.GetSelected();
      if (Key.get() === 36) {
        if (this.FItems.GetSiblingFromIndex(0) != null) this.DoChangeSelection(this.FItems.GetSiblingFromIndex(0));
      };
      if ((Key.get() === 35) && (this.FItems.GetSiblingCount() > 0)) {
        tn = this.FItems.GetSiblingFromIndex(this.FItems.GetSiblingCount() - 1);
        while (tn.FIsExpanded) {
          if (tn.GetCount() > 0) tn = tn.GetItem(tn.GetCount() - 1);
        };
        this.DoChangeSelection(tn);
      };
      if (Key.get() === 40) {
        if (tn != null) {
          if (tn.FIsExpanded && (tn.GetCount() > 0)) {
            tn = tn.GetFirstChild();
          } else tn = tn.GetNextSibling();
          if (!(tn != null)) {
            tn = this.GetSelected();
            sn = tn;
            while (!(sn.GetNextSibling() != null) && (sn.GetParent() != null)) {
              sn = sn.GetParent();
              if (sn != null) ln = sn.GetNextSibling();
              if (ln != null) {
                tn = ln;
              };
            };
          };
          if (tn != null) this.DoChangeSelection(tn);
        };
      };
      if (Key.get() === 38) {
        if (tn != null) {
          tn = tn.GetPrevSibling();
          if (tn != null) {
            sn = tn;
            while ((sn != null) && sn.FIsExpanded && (sn.GetCount() > 0)) {
              sn = sn.GetItem(tn.GetCount() - 1);
              if (sn != null) tn = sn;
            };
            this.DoChangeSelection(tn);
          } else {
            tn = this.GetSelected().GetParent();
            if (tn != null) this.DoChangeSelection(tn);
          };
        };
      };
      if (Key.get() === 39) {
        if (tn != null) {
          c = tn.GetFirstChild();
          if (c != null) {
            Allow = true;
            if (this.FOnExpanding != null) this.FOnExpanding(this,this.GetSelected(),{get: function () {
                return Allow;
              }, set: function (v) {
                Allow = v;
              }});
            if (Allow) {
              this.GetSelected().SetIsExpanded(true);
              if (this.FOnExpanded != null) this.FOnExpanded(this,this.GetSelected());
            };
          };
        };
      };
      if (Key.get() === 37) {
        if (tn != null) {
          c = tn.GetFirstChild();
          if (c != null) {
            Allow = true;
            if (this.FOnCollapsing != null) this.FOnCollapsing(this,this.GetSelected(),{get: function () {
                return Allow;
              }, set: function (v) {
                Allow = v;
              }});
            if (Allow) {
              this.GetSelected().SetIsExpanded(false);
              if (this.FOnCollapsed != null) this.FOnCollapsed(this,this.GetSelected());
            };
          };
        };
      };
      if (Key.get() in rtl.createSet(37,39,40,38)) {
        Key.set(0);
        return;
      };
      pas["WEBLib.Controls"].TControl.KeyDown.apply(this,arguments);
    };
    this.DoChangeSelection = function (NewNode) {
      var Allow = false;
      Allow = true;
      if ((this.FOnChanging != null) && (NewNode !== this.GetSelected())) this.FOnChanging(this,NewNode,{get: function () {
          return Allow;
        }, set: function (v) {
          Allow = v;
        }});
      if (Allow && (this.GetSelected() !== NewNode)) {
        this.SetSelected(NewNode);
        if (this.FOnChange != null) this.FOnChange(this,NewNode);
      };
    };
    this.EnableDrag = function () {
      var $Self = this;
      function AddDraggableAttribute(AElement) {
        var I = 0;
        for (var $l = 0, $end = AElement.children.length - 1; $l <= $end; $l++) {
          I = $l;
          if (AElement.children.item(I).tagName === "LI") {
            AElement.children.item(I).setAttribute("draggable","true");
            AddDraggableAttribute(AElement.children.item(I));
          } else AddDraggableAttribute(AElement.children.item(I));
        };
      };
      if (!(this.GetContainer() != null)) return;
      AddDraggableAttribute(this.GetContainer());
    };
    this.DisableDrag = function () {
      var $Self = this;
      function RemoveDraggableAttribute(AElement) {
        var I = 0;
        for (var $l = 0, $end = AElement.children.length - 1; $l <= $end; $l++) {
          I = $l;
          if (AElement.children.item(I).tagName === "LI") {
            AElement.children.item(I).removeAttribute("draggable");
            RemoveDraggableAttribute(AElement.children.item(I));
          } else RemoveDraggableAttribute(AElement.children.item(I));
        };
      };
      if (!(this.GetContainer() != null)) return;
      RemoveDraggableAttribute(this.GetContainer());
    };
    this.FormPrefix = function () {
      var Result = "";
      var frm = null;
      Result = "";
      frm = pas["WEBLib.Forms"].GetParentForm(this);
      if (frm != null) Result = frm.$classname;
      return Result;
    };
    this.InitCSSLibrary = function (ALibrary) {
      if (ALibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap) {
        this.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
      };
    };
    this.UpdateElementVisual = function () {
      pas["WEBLib.Controls"].TCustomControl.UpdateElementVisual.call(this);
      this.GetElementHandle().style.setProperty("overflow","auto");
    };
    this.CreateInitialize = function () {
      var css = "";
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.FSelected = null;
      this.FItems = this.CreateNodes();
      this.FItems.FOnChange = rtl.createCallback(this,"DoNodesChanged");
      this.FItems.FOnExpandedChange = rtl.createCallback(this,"DoExpandedChanged");
      this.FItems.FOnSelectionChange = rtl.createCallback(this,"DoSelectionChanged");
      css = ".TVUL {" + " list-style-type: none;" + " margin: 0;" + " padding-left: 15px;" + "}" + "\r\n" + " .TVCARET {" + "  cursor: pointer;" + "  user-select: none;" + "}" + "\r\n" + ".TVCARET::before {" + 'content: "\\25B6";' + "display: inline-block;" + "margin-right: 6px;" + "}" + "\r\n" + ".TVCARET-DOWN::before {" + "transform: rotate(90deg);" + "}" + "\r\n" + ".TVNESTED {" + "  display: none;" + "}" + "\r\n" + ".TVACTIVE {" + "  display: block;" + "}" + "\r\n" + ".TVNODE {" + " padding: 3px;" + " display: inline-block;" + "}" + "\r\n" + ".TVNOCURSOR {" + " cursor: initial;" + "}" + "\r\n" + ".TVSELECTED {" + "  background-color: #0000ff;" + "  color: #ffffff;" + "}";
      this.AddControlStyle(css);
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        this.SetWidth(200);
        this.SetHeight(200);
      };
    };
    this.Destroy = function () {
      rtl.free(this,"FItems");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.BeginUpdate = function () {
      pas["WEBLib.Controls"].TControl.BeginUpdate.call(this);
    };
    this.EndUpdate = function () {
      pas["WEBLib.Controls"].TCustomControl.EndUpdate.call(this);
      if (!this.IsUpdating()) {
        this.SetSelected(null);
        this.RenderNodes();
      };
    };
    this.GetNodeFromID = function (AId) {
      var Result = null;
      var s = "";
      var sl = null;
      var n = null;
      var i = 0;
      var j = 0;
      var e = 0;
      Result = null;
      s = AId;
      s = pas.System.Copy(s,((this.FormPrefix() + this.FName)).length + 2,s.length);
      if (s !== "") {
        sl = pas.Classes.TStringList.$create("Create$1");
        sl.SetDelimiter("_");
        sl.FStrictDelimiter = true;
        sl.SetDelimitedText(s);
        n = null;
        for (var $l = 0, $end = sl.GetCount() - 1; $l <= $end; $l++) {
          i = $l;
          pas.System.val$6(sl.Get(i),{get: function () {
              return j;
            }, set: function (v) {
              j = v;
            }},{get: function () {
              return e;
            }, set: function (v) {
              e = v;
            }});
          if (i === 0) {
            n = this.FItems.GetSiblingFromIndex(j)}
           else n = n.GetItem(j);
        };
        sl = rtl.freeLoc(sl);
        Result = n;
      };
      return Result;
    };
    this.GetNodeElement = function (ANode) {
      var Result = null;
      var s = "";
      var tn = null;
      Result = null;
      tn = ANode;
      if (!(tn != null)) return Result;
      s = "";
      do {
        if (s === "") {
          s = pas.SysUtils.IntToStr(tn.GetIndex())}
         else s = pas.SysUtils.IntToStr(tn.GetIndex()) + "_" + s;
        tn = tn.GetParent();
      } while (tn != null);
      s = this.FormPrefix() + this.FName + "_" + s;
      Result = document.getElementById(s);
      if (Result != null) {
        if (Result.classList.contains("TVCARET")) Result = Result.firstChild;
      };
      return Result;
    };
    this.Select = function (ANode) {
      this.SetSelected(ANode);
    };
    this.FullExpand = function () {
      var i = 0;
      for (var $l = 0, $end = this.FItems.GetSiblingCount() - 1; $l <= $end; $l++) {
        i = $l;
        this.FItems.GetSiblingFromIndex(i).Expand(true);
      };
    };
    this.FullCollapse = function () {
      var i = 0;
      for (var $l = 0, $end = this.FItems.GetSiblingCount() - 1; $l <= $end; $l++) {
        i = $l;
        this.FItems.GetSiblingFromIndex(i).Collapse(true);
      };
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("AutoExpand",0,rtl.boolean,"FAutoExpand","FAutoExpand");
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("ElementNodeClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementNodeClassName","SetElementNodeClassName");
    $r.addProperty("ElementNodeSelectedClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementNodeSelectedClassName","SetElementNodeSelectedClassName");
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Items",2,pas["WEBLib.TreeNodes"].$rtti["TTreeNodes"],"FItems","SetItems");
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",4,{Default: true});
    $r.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti["TPopupMenu"],"FPopupMenu","FPopupMenu");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnClickCheckBox",0,$mod.$rtti["TTreeViewNodeStateEvent"],"FOnClickCheckBox","FOnClickCheckBox");
    $r.addProperty("OnClickRadio",0,$mod.$rtti["TTreeViewNodeStateEvent"],"FOnClickRadio","FOnClickRadio");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnClickNode",0,$mod.$rtti["TTreeViewNodeEvent"],"FOnClickNode","FOnClickNode");
    $r.addProperty("OnDblClickNode",0,$mod.$rtti["TTreeViewNodeEvent"],"FOnDblClickNode","FOnDblClickNode");
    $r.addProperty("OnRenderNode",0,$mod.$rtti["TTreeViewNodeRenderEvent"],"FOnRenderNode","FOnRenderNode");
    $r.addProperty("OnChange",0,$mod.$rtti["TTreeViewNodeEvent"],"FOnChange","FOnChange");
    $r.addProperty("OnChanging",0,$mod.$rtti["TTreeViewNodeAllowEvent"],"FOnChanging","FOnChanging");
    $r.addProperty("OnCollapsed",0,$mod.$rtti["TTreeViewNodeEvent"],"FOnCollapsed","FOnCollapsed");
    $r.addProperty("OnCollapsing",0,$mod.$rtti["TTreeViewNodeAllowEvent"],"FOnCollapsing","FOnCollapsing");
    $r.addProperty("OnExpanded",0,$mod.$rtti["TTreeViewNodeEvent"],"FOnExpanded","FOnExpanded");
    $r.addProperty("OnExpanding",0,$mod.$rtti["TTreeViewNodeAllowEvent"],"FOnExpanding","FOnExpanding");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
  });
  rtl.createClass(this,"TWebTreeView",this.TTreeView,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  $mod.$implcode = function () {
    rtl.createClass($impl,"TTreeNodeEx",pas["WEBLib.TreeNodes"].TTreeNode,function () {
    });
    rtl.createClass($impl,"TTreeNodesEx",pas["WEBLib.TreeNodes"].TTreeNodes,function () {
    });
    $impl.GetTextNodes = function (node, nodes) {
      var children = null;
      var i = 0;
      var j = 0;
      var childlist = null;
      if (node.nodeType === 3) {
        nodes.Add(node)}
       else {
        children = node.childNodes;
        childlist = pas.Classes.TList.$create("Create$1");
        for (var $l = 0, $end = children.length - 1; $l <= $end; $l++) {
          i = $l;
          $impl.GetTextNodes(children.item(i),childlist);
          for (var $l1 = 0, $end1 = childlist.GetCount() - 1; $l1 <= $end1; $l1++) {
            j = $l1;
            nodes.Add(childlist.Get(j));
          };
        };
        childlist = rtl.freeLoc(childlist);
      };
    };
  };
},["WEBLib.Buttons","WEBLib.Forms","WEBLib.Utils"]);
rtl.module("WEBLib.TMSFNCEditorsTools",["System","Classes","Types","WEBLib.TMSFNCTypes","WEBLib.TMSFNCGraphicsTypes","WEBLib.Graphics","WEBLib.TMSFNCEditorButton","WEBLib.TMSFNCEditorListView","WEBLib.TMSFNCEditorPanel","WEBLib.StdCtrls","WEBLib.Controls","WEBLib.ComCtrls","JS","Web"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.MAJ_VER = 1;
  this.MIN_VER = 0;
  this.REL_VER = 0;
  this.BLD_VER = 0;
  this.EDITORBUTTONROUNDING = 5;
  this.EDITORPRIMCOLOR = 0xbe7700;
  this.EDITORSTROKECOLORLIGHT = 0xECDECE;
  this.EDITORSTROKECOLORDARK = 0x6B5E4F;
  this.EDITORCOUNTERCOLOR = 0x77be;
  this.EDITOROKFONTCOLOR = 16777215;
  this.EDITORAUTOCOLOR = -1;
  this.EDITORFONTCOLORLIGHT = 0x555555;
  this.EDITORFONTCOLORDARK = 0xAAAAAA;
  this.EDITORFONTCOLORDISABLED = 0x787878;
  this.EDITORMAINBACKCOLORLIGHT = 16777215;
  this.EDITORMAINBACKCOLORDARK = 0x2C2A2A;
  this.EDITORSUBBACKCOLORLIGHT = 16119285;
  this.EDITORSUBBACKCOLORDARK = 0x433E3E;
  this.TTMSFNCEditorDesignerTheme = {"0": "edtDefault", edtDefault: 0, "1": "edtLight", edtLight: 1, "2": "edtDark", edtDark: 2};
  this.$rtti.$Enum("TTMSFNCEditorDesignerTheme",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCEditorDesignerTheme});
  this.IsLightTheme = function () {
    var Result = false;
    var s = "";
    if ($mod.TMSFNCDesignerTheme !== $mod.TTMSFNCEditorDesignerTheme.edtDefault) {
      Result = $mod.TMSFNCDesignerTheme === $mod.TTMSFNCEditorDesignerTheme.edtLight;
      return Result;
    };
    Result = true;
    if ($impl.NoIDERunning()) return Result;
    s = pas["WEBLib.Forms"].Application.IDETheme();
    if (s === "vscode-light") {
      Result = true}
     else Result = false;
    return Result;
  };
  this.EditorDarkerShadeColor = function (AColor, AFactor, ATimes) {
    var Result = 0;
    var r = 0;
    var g = 0;
    var b = 0;
    var I = 0;
    r = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.GetColorRed(AColor);
    g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.GetColorGreen(AColor);
    b = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.GetColorBlue(AColor);
    for (var $l = 0, $end = ATimes; $l <= $end; $l++) {
      I = $l;
      r = Math.max(0,Math.round(r - ((r / 255) * AFactor)));
      g = Math.max(0,Math.round(g - ((g / 255) * AFactor)));
      b = Math.max(0,Math.round(b - ((b / 255) * AFactor)));
    };
    Result = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor("#" + pas.SysUtils.IntToHex(r,2) + pas.SysUtils.IntToHex(g,2) + pas.SysUtils.IntToHex(b,2));
    return Result;
  };
  this.EditorLighterShadeColor = function (AColor, AFactor, ATimes) {
    var Result = 0;
    var r = 0;
    var g = 0;
    var b = 0;
    var I = 0;
    r = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.GetColorRed(AColor);
    g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.GetColorGreen(AColor);
    b = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.GetColorBlue(AColor);
    for (var $l = 0, $end = ATimes; $l <= $end; $l++) {
      I = $l;
      r = Math.min(255,Math.round(r + ((r / 255) * AFactor)));
      g = Math.min(255,Math.round(g + ((g / 255) * AFactor)));
      b = Math.min(255,Math.round(b + ((b / 255) * AFactor)));
    };
    Result = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor("#" + pas.SysUtils.IntToHex(r,2) + pas.SysUtils.IntToHex(g,2) + pas.SysUtils.IntToHex(b,2));
    return Result;
  };
  this.SetTMSFNCDesignerTheme = function (ATheme) {
    $mod.TMSFNCDesignerTheme = ATheme;
  };
  this.GetTMSFNCDesignerTheme = function () {
    var Result = 0;
    Result = $mod.TMSFNCDesignerTheme;
    return Result;
  };
  this.SetEditorOKButtonAppearance = function (AButton, APrimaryColor, ARounding, AFontColor) {
    if (AButton != null) {
      AButton.FAppearance.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
      AButton.FAppearance.FHoverStroke.SetColor(APrimaryColor);
      AButton.FAppearance.FDownStroke.SetColor(APrimaryColor);
      AButton.FAppearance.FFill.SetColor(APrimaryColor);
      AButton.FAppearance.FHoverFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient);
      AButton.FAppearance.FHoverFill.SetColor(APrimaryColor);
      AButton.FAppearance.FDisabledStroke.SetColor(APrimaryColor);
      if ($mod.IsLightTheme()) {
        AButton.FAppearance.FDisabledFill.SetColor(16119285);
        AButton.FAppearance.FDisabledFont.SetColor(5592405);
      } else {
        AButton.FAppearance.FDisabledFill.SetColor(4406846);
        AButton.FAppearance.FDisabledFont.SetColor(11184810);
      };
      AButton.FAppearance.FHoverFill.SetColorTo($mod.EditorDarkerShadeColor(APrimaryColor,10,1));
      AButton.FAppearance.FDownFill.SetColor($mod.EditorLighterShadeColor(APrimaryColor,10,1));
      AButton.FAppearance.FFont.SetStyle(rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsBold));
      AButton.FAppearance.FHoverFont.SetStyle(rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsBold));
      AButton.FAppearance.FDownFont.SetStyle(rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsBold));
      AButton.FAppearance.FFont.SetColor(AFontColor);
      AButton.FAppearance.FHoverFont.SetColor(AFontColor);
      AButton.FAppearance.FDownFont.SetColor(AFontColor);
      AButton.FAppearance.SetRounding(ARounding);
    };
  };
  this.SetEditorCancelButtonAppearance = function (AButton, APrimaryColor, ARounding, AFontColor, ABackGroundColor) {
    var fc = 0;
    if (AButton != null) {
      if (AFontColor === -1) {
        if ($mod.IsLightTheme()) {
          fc = 5592405}
         else fc = 11184810;
      } else fc = AFontColor;
      AButton.FAppearance.FHoverFont.SetColor(APrimaryColor);
      AButton.FAppearance.FDownFont.SetColor(16777215);
      AButton.FAppearance.FHoverStroke.SetColor(APrimaryColor);
      AButton.FAppearance.FDownStroke.SetColor(APrimaryColor);
      AButton.FAppearance.FDownFill.SetColor($mod.EditorLighterShadeColor(APrimaryColor,10,1));
      AButton.FAppearance.FFont.SetColor(fc);
      AButton.FAppearance.FFill.SetColor(ABackGroundColor);
      AButton.FAppearance.FHoverFill.SetColor(ABackGroundColor);
      AButton.FAppearance.SetRounding(ARounding);
    };
  };
  this.SetEditorTabButtonAppearance = function (AButton, APrimaryColor, ARounding, AFontColor, ABackGroundColor) {
    var lc = 0;
    AButton.FAppearance.SetSelectionLine(true);
    AButton.FAppearance.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
    AButton.FAppearance.FHoverStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
    AButton.FAppearance.FDownStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
    AButton.FAppearance.FDisabledFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
    AButton.FAppearance.FDisabledStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
    AButton.FAppearance.FHoverFont.SetColor(APrimaryColor);
    AButton.FAppearance.FHoverFill.SetColor(APrimaryColor);
    lc = $mod.EditorLighterShadeColor(APrimaryColor,20,1);
    AButton.FAppearance.FDownFont.SetColor(lc);
    AButton.FAppearance.FDownFill.SetColor(lc);
    AButton.FAppearance.FSelectedFont.SetColor(lc);
    AButton.FAppearance.FSelectedFill.SetColor(lc);
    AButton.FAppearance.FSelectedStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
    AButton.FAppearance.FDisabledFont.SetColor(7895160);
    AButton.FAppearance.SetRounding(ARounding);
    if (AFontColor === -1) {
      if ($mod.IsLightTheme()) {
        AButton.FAppearance.FFont.SetColor(5592405)}
       else AButton.FAppearance.FFont.SetColor(11184810);
    } else {
      AButton.FAppearance.FFont.SetColor(AFontColor);
    };
    if (ABackGroundColor === -1) {
      if ($mod.IsLightTheme()) {
        AButton.FAppearance.FFill.SetColor(16777215)}
       else AButton.FAppearance.FFill.SetColor(2894378);
    } else {
      AButton.FAppearance.FFill.SetColor(ABackGroundColor);
    };
  };
  this.SetEditorSubTabButtonAppearance = function (AButton, APrimaryColor, ARounding, AFontColor, ABackGroundColor) {
    var bc = 0;
    if (ABackGroundColor === -1) {
      if ($mod.IsLightTheme()) {
        bc = 16119285}
       else bc = 4406846;
      $mod.SetEditorTabButtonAppearance(AButton,APrimaryColor,ARounding,AFontColor,bc);
    } else $mod.SetEditorTabButtonAppearance(AButton,APrimaryColor,ARounding,AFontColor,ABackGroundColor);
  };
  this.SetEditorIconButtonAppearance = function (AButton, APrimaryColor, ARounding, AFontColor, ABackGroundColor) {
    var fc = 0;
    if (AButton != null) {
      if (AFontColor === -1) {
        if ($mod.IsLightTheme()) {
          fc = 5592405}
         else fc = 11184810;
      } else fc = AFontColor;
      AButton.FAppearance.SetRounding(ARounding);
      AButton.FAppearance.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
      AButton.FAppearance.FDisabledFont.SetColor(7895160);
      AButton.FAppearance.FDisabledStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
      AButton.FAppearance.FDisabledFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
      AButton.FAppearance.FHoverStroke.SetColor(APrimaryColor);
      AButton.FAppearance.FDownStroke.SetColor(APrimaryColor);
      AButton.FAppearance.FHoverFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
      AButton.FAppearance.FHoverFill.SetColor(ABackGroundColor);
      AButton.FAppearance.FDownFill.SetColor($mod.EditorDarkerShadeColor(APrimaryColor,10,1));
      AButton.FAppearance.FFill.SetColor(ABackGroundColor);
      AButton.FAppearance.FFont.SetColor(fc);
      AButton.FAppearance.FHoverFont.SetColor(APrimaryColor);
    };
  };
  this.SetEditorBitmapListAppearance = function (ABitmapListView, APrimaryColor, ARounding, AFontColor, ABackGroundColor) {
    var dc = 0;
    var fc = 0;
    if (ABitmapListView != null) {
      if (AFontColor === -1) {
        if ($mod.IsLightTheme()) {
          fc = 5592405}
         else fc = 11184810;
      } else fc = AFontColor;
      ABitmapListView.FAppearance.SetItemVerticalSpacing(ARounding);
      ABitmapListView.FAppearance.SetItemHorizontalSpacing(ARounding);
      ABitmapListView.FAppearance.SetItemRounding(ARounding);
      ABitmapListView.FAppearance.SetItemImageRounding(ARounding);
      ABitmapListView.FAppearance.FItemStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
      ABitmapListView.FAppearance.FItemHoverFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
      ABitmapListView.FAppearance.FItemHoverStroke.SetColor(APrimaryColor);
      ABitmapListView.FAppearance.FItemHoverFont.SetColor(APrimaryColor);
      ABitmapListView.FAppearance.FItemDownStroke.SetColor(APrimaryColor);
      dc = $mod.EditorLighterShadeColor(APrimaryColor,10,1);
      ABitmapListView.FAppearance.FItemDownFill.SetColor(dc);
      ABitmapListView.FAppearance.FItemSelectedStroke.SetColor($mod.EditorLighterShadeColor(dc,10,1));
      ABitmapListView.FAppearance.FItemSelectedFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient);
      ABitmapListView.FAppearance.FItemSelectedFill.SetColor(APrimaryColor);
      ABitmapListView.FAppearance.FItemSelectedFill.SetColorTo($mod.EditorDarkerShadeColor(APrimaryColor,10,1));
      ABitmapListView.FAppearance.FItemSelectedFont.SetColor(16777215);
      ABitmapListView.FAppearance.FItemFill.SetColor(ABackGroundColor);
      ABitmapListView.FAppearance.FItemFont.SetColor(fc);
      ABitmapListView.FAppearance.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
      ABitmapListView.FAppearance.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
    };
  };
  this.SetEditorListAppearance = function (AEditorList, APrimaryColor, ARounding, AFontColor, ABackGroundColor) {
    var dc = 0;
    var fc = 0;
    if (AEditorList != null) {
      if (AFontColor === -1) {
        if ($mod.IsLightTheme()) {
          fc = 5592405}
         else fc = 11184810;
      } else fc = AFontColor;
      AEditorList.FAppearance.SetItemVerticalSpacing(ARounding);
      AEditorList.FAppearance.SetItemHorizontalSpacing(ARounding);
      AEditorList.FAppearance.SetItemRounding(ARounding);
      AEditorList.FAppearance.SetItemImageRounding(ARounding);
      AEditorList.FAppearance.FItemStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
      AEditorList.FAppearance.FItemHoverFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
      AEditorList.FAppearance.FItemHoverStroke.SetColor(APrimaryColor);
      AEditorList.FAppearance.FItemHoverFont.SetColor(APrimaryColor);
      AEditorList.FAppearance.FItemDownStroke.SetColor(APrimaryColor);
      dc = $mod.EditorLighterShadeColor(APrimaryColor,10,1);
      AEditorList.FAppearance.FItemDownFill.SetColor(dc);
      AEditorList.FAppearance.FItemSelectedStroke.SetColor($mod.EditorLighterShadeColor(dc,10,1));
      AEditorList.FAppearance.FItemSelectedFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient);
      AEditorList.FAppearance.FItemSelectedFill.SetColor(APrimaryColor);
      AEditorList.FAppearance.FItemSelectedFill.SetColorTo($mod.EditorDarkerShadeColor(APrimaryColor,10,1));
      AEditorList.FAppearance.FItemSelectedFont.SetColor(16777215);
      AEditorList.FAppearance.FItemFill.SetColor(ABackGroundColor);
      AEditorList.FAppearance.FItemFont.SetColor(fc);
      if (ABackGroundColor !== -1) {
        AEditorList.FAppearance.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        AEditorList.FAppearance.FFill.SetColor(ABackGroundColor);
      } else AEditorList.FAppearance.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
      AEditorList.FAppearance.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
    };
  };
  this.SetEditorBackPanelAppearance = function (APanel, ABackGroundColor, AStrokeColor, ARounding) {
    if (APanel != null) {
      APanel.FAppearance.SetRounding(ARounding);
      if (ABackGroundColor === -1) {
        if ($mod.IsLightTheme()) {
          APanel.FAppearance.FFill.SetColor(16777215);
        } else {
          APanel.FAppearance.FFill.SetColor(2894378);
        };
      } else APanel.FAppearance.FFill.SetColor(ABackGroundColor);
      if (AStrokeColor === -1) {
        if ($mod.IsLightTheme()) {
          APanel.FAppearance.FStroke.SetColor(15523534)}
         else APanel.FAppearance.FStroke.SetColor(7036495);
      } else APanel.FAppearance.FStroke.SetColor(AStrokeColor);
    };
  };
  this.SetEditorSubPanelAppearance = function (APanel, ABackGroundColor, AStrokeColor, ARounding) {
    if (APanel != null) {
      APanel.FAppearance.SetRounding(ARounding);
      if (ABackGroundColor === -1) {
        if ($mod.IsLightTheme()) {
          APanel.FAppearance.FFill.SetColor(16119285)}
         else APanel.FAppearance.FFill.SetColor(4406846);
      } else APanel.FAppearance.FFill.SetColor(ABackGroundColor);
      if (AStrokeColor === -1) {
        if ($mod.IsLightTheme()) {
          APanel.FAppearance.FStroke.SetColor(16119285)}
         else APanel.FAppearance.FStroke.SetColor(4406846);
      } else APanel.FAppearance.FStroke.SetColor(AStrokeColor);
    };
  };
  this.SetEditorLabelAppearance = function (ALabel, AFontColor) {
    if (ALabel != null) {
      if (AFontColor === -1) {
        if ($mod.IsLightTheme()) {
          ALabel.FFont.SetColor(5592405);
        } else {
          ALabel.FFont.SetColor(11184810);
        };
      } else {
        ALabel.FFont.SetColor(11184810);
      };
    };
  };
  this.SetEditorCheckBoxAppearance = function (ACheckBox, AFontColor) {
    if (ACheckBox != null) {
      if (AFontColor === -1) {
        if ($mod.IsLightTheme()) {
          ACheckBox.FFont.SetColor(5592405);
        } else {
          ACheckBox.FFont.SetColor(11184810);
        };
      } else {
        ACheckBox.FFont.SetColor(AFontColor);
      };
    };
  };
  this.SetEditorEditAppearance = function (AEdit, AFontColor, ABackGroundColor, AStrokeColor) {
    var fc = 0;
    var bc = 0;
    if (AFontColor === -1) {
      if ($mod.IsLightTheme()) {
        fc = 5592405}
       else fc = 11184810;
    } else fc = AFontColor;
    if (ABackGroundColor === -1) {
      if ($mod.IsLightTheme()) {
        bc = 16777215}
       else bc = 2894378;
    } else bc = ABackGroundColor;
    AEdit.SetColor(bc);
    AEdit.FFont.SetColor(fc);
  };
  this.GetEditorDefaultFontColor = function () {
    var Result = 0;
    if ($mod.IsLightTheme()) {
      Result = 5592405}
     else Result = 11184810;
    return Result;
  };
  this.SetEditorMemoAppearance = function (AMemo, AFontColor, ABackGroundColor, AStrokeColor) {
    var fc = 0;
    var bc = 0;
    if (AFontColor === -1) {
      if ($mod.IsLightTheme()) {
        fc = 5592405}
       else fc = 11184810;
    } else fc = AFontColor;
    if (ABackGroundColor === -1) {
      if ($mod.IsLightTheme()) {
        bc = 16777215}
       else bc = 2894378;
    } else bc = ABackGroundColor;
    AMemo.SetColor(bc);
    AMemo.FFont.SetColor(fc);
  };
  this.SetEditorDateTimeEditAppearance = function (ADateTimeEdit, AFontColor, ABackGroundColor, AStrokeColor) {
    var fc = 0;
    var bc = 0;
    if (AFontColor === -1) {
      if ($mod.IsLightTheme()) {
        fc = 5592405}
       else fc = 11184810;
    } else fc = AFontColor;
    if (ABackGroundColor === -1) {
      if ($mod.IsLightTheme()) {
        bc = 16777215}
       else bc = 2894378;
    } else bc = ABackGroundColor;
    ADateTimeEdit.SetColor(bc);
    ADateTimeEdit.FFont.SetColor(fc);
  };
  this.TMSFNCDesignerTheme = this.TTMSFNCEditorDesignerTheme.edtDefault;
  $mod.$implcode = function () {
    $impl.NoIDERunning = function () {
      var Result = false;
      if (pas["WEBLib.Forms"].Application.IDETheme() !== "") {
        Result = false;
        return Result;
      };
      Result = true;
      return Result;
    };
  };
},["WEBLib.TMSFNCGraphics","WEBLib.TMSFNCUtils","Math","SysUtils","WEBLib.Forms"]);
rtl.module("WEBLib.TMSFNCBitmapEditor",["System","Classes","WEBLib.TMSFNCCustomComponent","WEBLib.TMSFNCCustomControl","WEBLib.Controls","WEBLib.TMSFNCTypes","WEBLib.StdCtrls","WEBLib.ExtCtrls","WEBLib.TMSFNCBitmapContainer","WEBLib.Forms","WEBLib.TMSFNCGraphics","WEBLib.TMSFNCGraphicsTypes","WEBLib.TMSFNCEditorButton","WEBLib.TMSFNCEditorPanel","Types"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.MAJ_VER = 1;
  this.MIN_VER = 0;
  this.REL_VER = 1;
  this.BLD_VER = 0;
  this.$rtti.$Class("TTMSFNCBitmapEditor");
  rtl.createClass(this,"TTMSFNCBitmapEditorComboBox",pas["WEBLib.StdCtrls"].TComboBox,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCBitmapEditor",pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.$init.call(this);
      this.frm = null;
      this.FPanel = null;
      this.FTopPanel = null;
      this.FBitmap = null;
      this.FCopyBitmap = null;
      this.FButtonOk = null;
      this.FButtonCancel = null;
      this.FButtonOpen = null;
      this.FButtonClear = null;
      this.FImage = null;
      this.FBitmapContainer = null;
      this.FModified = false;
    };
    this.$final = function () {
      this.frm = undefined;
      this.FPanel = undefined;
      this.FTopPanel = undefined;
      this.FBitmap = undefined;
      this.FCopyBitmap = undefined;
      this.FButtonOk = undefined;
      this.FButtonCancel = undefined;
      this.FButtonOpen = undefined;
      this.FButtonClear = undefined;
      this.FImage = undefined;
      this.FBitmapContainer = undefined;
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.$final.call(this);
    };
    this.SetBitmap = function (Value) {
      this.FBitmap = Value;
    };
    this.SetBitmapContainer = function (Value) {
      this.FBitmapContainer = Value;
    };
    this.GetInstance = function () {
      var Result = 0;
      Result = pas["WEBLib.TMSFNCTypes"].HInstance();
      return Result;
    };
    this.DoCopyBitmapChange = function (Sender) {
      this.FModified = true;
      if (this.FImage != null) this.FImage.Invalidate();
    };
    this.RegisterRuntimeClasses = function () {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClass($mod.TTMSFNCBitmapEditor);
    };
    this.Notification = function (AComponent, AOperation) {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.Notification.apply(this,arguments);
      if ((AOperation === pas.Classes.TOperation.opRemove) && (AComponent === this.FBitmapContainer)) this.FBitmapContainer = null;
    };
    this.BuildEditor = function (AParent) {
      if (AParent != null) {
        this.FTopPanel = pas["WEBLib.TMSFNCEditorPanel"].TTMSFNCEditorPanel.$create("Create$1",[AParent]);
        this.FTopPanel.SetPanelPosition(pas["WEBLib.TMSFNCEditorPanel"].TTMSFNCEditorPanelPosition.eppCenter);
        this.FTopPanel.SetAlign(pas["WEBLib.Controls"].TAlign.alTop);
        this.FTopPanel.SetTop(0);
        this.FTopPanel.SetParent(AParent);
        pas["WEBLib.TMSFNCEditorsTools"].SetEditorBackPanelAppearance(this.FTopPanel,-1,-1,5);
        this.FButtonClear = pas["WEBLib.TMSFNCEditorButton"].TTMSFNCEditorButton.$create("Create$1",[this.FTopPanel]);
        this.FButtonClear.SetParent(this.FTopPanel);
        this.FButtonClear.SetText($impl.TranslateTextEx(rtl.getResStr($mod,"sTMSFNCBitmapEditorClear")));
        this.FButtonClear.SetAlign(pas["WEBLib.Controls"].TAlign.alLeft);
        this.FButtonClear.SetLeft(30);
        this.FButtonClear.FMargins.SetRight(5);
        this.FButtonClear.FMargins.SetTop(5);
        this.FButtonClear.FMargins.SetBottom(5);
        this.FButtonClear.FMargins.SetLeft(5);
        this.FButtonClear.FOnClick = rtl.createCallback(this,"DoClearFile");
        pas["WEBLib.TMSFNCEditorsTools"].SetEditorTabButtonAppearance(this.FButtonClear,12482304,5,-1,-1);
        this.FButtonOpen = pas["WEBLib.TMSFNCEditorButton"].TTMSFNCEditorButton.$create("Create$1",[this.FTopPanel]);
        this.FButtonOpen.SetParent(this.FTopPanel);
        this.FButtonOpen.SetText($impl.TranslateTextEx(rtl.getResStr($mod,"sTMSFNCBitmapEditorOpen")));
        this.FButtonOpen.SetAlign(pas["WEBLib.Controls"].TAlign.alLeft);
        this.FButtonOpen.SetLeft(10);
        this.FButtonOpen.FMargins.SetRight(0);
        this.FButtonOpen.FMargins.SetTop(5);
        this.FButtonOpen.FMargins.SetBottom(5);
        this.FButtonOpen.FMargins.SetLeft(5);
        this.FButtonOpen.FOnClick = rtl.createCallback(this,"DoOpenFile");
        pas["WEBLib.TMSFNCEditorsTools"].SetEditorTabButtonAppearance(this.FButtonOpen,12482304,5,-1,-1);
        this.FTopPanel.SetHeight(37);
        this.FImage = pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$create("Create$1",[AParent]);
        this.FImage.SetParent(AParent);
        this.FImage.SetControlAlignment(pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlAlignment.caClient);
        this.FImage.DisableBackground();
        this.FImage.FOnClick = rtl.createCallback(this,"DoOpenFile");
        if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
          this.FImage.SetColor(16119285);
        } else {
          this.FImage.SetColor(4406846);
        };
        this.FImage.DisableStroke();
        this.FImage.FOnAfterDraw = rtl.createCallback(this,"DoAfterDraw");
        this.FPanel = pas["WEBLib.TMSFNCEditorPanel"].TTMSFNCEditorPanel.$create("Create$1",[AParent]);
        this.FPanel.SetPanelPosition(pas["WEBLib.TMSFNCEditorPanel"].TTMSFNCEditorPanelPosition.eppCenter);
        this.FPanel.SetAlign(pas["WEBLib.Controls"].TAlign.alBottom);
        this.FPanel.SetParent(AParent);
        this.FPanel.SetHeight(37);
        pas["WEBLib.TMSFNCEditorsTools"].SetEditorBackPanelAppearance(this.FPanel,-1,-1,5);
        this.FButtonCancel = pas["WEBLib.TMSFNCEditorButton"].TTMSFNCEditorButton.$create("Create$1",[this.FPanel]);
        this.FButtonCancel.FModalResult = 2;
        this.FButtonCancel.SetParent(this.FPanel);
        this.FButtonCancel.SetText($impl.TranslateTextEx(rtl.getResStr($mod,"sTMSFNCBitmapEditorCancel")));
        this.FButtonCancel.SetAlign(pas["WEBLib.Controls"].TAlign.alRight);
        this.FButtonCancel.SetLeft(99);
        this.FButtonCancel.SetAlignWithMargins(true);
        this.FButtonCancel.FMargins.SetRight(5);
        this.FButtonCancel.FMargins.SetTop(5);
        this.FButtonCancel.FMargins.SetBottom(5);
        this.FButtonCancel.FMargins.SetLeft(5);
        this.FButtonCancel.FOnClick = rtl.createCallback(this,"DoButtonCancelClick");
        pas["WEBLib.TMSFNCEditorsTools"].SetEditorCancelButtonAppearance(this.FButtonCancel,12482304,5,-1,-1);
        this.FButtonOk = pas["WEBLib.TMSFNCEditorButton"].TTMSFNCEditorButton.$create("Create$1",[this.FPanel]);
        this.FButtonOk.FModalResult = 1;
        this.FButtonOk.SetParent(this.FPanel);
        this.FButtonOk.SetText($impl.TranslateTextEx(rtl.getResStr($mod,"sTMSFNCBitmapEditorOK")));
        this.FButtonOk.SetAlign(pas["WEBLib.Controls"].TAlign.alRight);
        this.FButtonOk.SetLeft(99);
        this.FButtonOk.SetAlignWithMargins(true);
        this.FButtonOk.FMargins.SetRight(0);
        this.FButtonOk.FMargins.SetTop(5);
        this.FButtonOk.FMargins.SetBottom(5);
        this.FButtonOk.FMargins.SetLeft(5);
        this.FButtonOk.FOnClick = rtl.createCallback(this,"DoButtonOKClick");
        pas["WEBLib.TMSFNCEditorsTools"].SetEditorOKButtonAppearance(this.FButtonOk,12482304,5,16777215);
      };
    };
    this.DoAfterDraw = function (Sender, AGraphics, ARect) {
      if (this.FCopyBitmap != null) {
        pas["WEBLib.TMSFNCTypes"].InflateRectEx(ARect,-5,-5);
        AGraphics.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),this.FCopyBitmap,true,false,true,false);
      };
    };
    this.DoOpenFile = function (Sender) {
      var $Self = this;
      var od = null;
      var I = 0;
      var str = "";
      if (!(this.FImage != null)) return;
      od = pas["WEBLib.Dialogs"].TOpenDialog.$create("Create$1",[$Self]);
      od.Execute$1(function (AFileName) {
        for (var $l = 0, $end = od.FFiles.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          od.FFiles.GetItem$1(I).GetFileAsBase64$1(function (AValue) {
            str = "data:" + od.FFiles.GetItem$1(I).FMimeType + ";base64," + AValue;
            $Self.FCopyBitmap.LoadFromResource(str);
            $Self.FImage.Invalidate();
          });
        };
      });
    };
    this.DoFormKeyDown = function (Sender, Key, Shift) {
      if (Key.get() === 27) {
        this.frm.Close();
      } else if (Key.get() === 13) {
        this.frm.SetModalResult(1);
        this.frm.Close();
      };
    };
    this.ApplyCSS = function (ACSS) {
    };
    this.DoButtonOKClick = function (Sender) {
      if (this.frm != null) this.frm.SetModalResult(1);
    };
    this.DoButtonCancelClick = function (Sender) {
      if (this.frm != null) this.frm.SetModalResult(2);
    };
    this.DoClearFile = function (Sender) {
      this.FCopyBitmap.Assign(null);
      this.FImage.Invalidate();
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.Create$1.apply(this,arguments);
      this.FModified = false;
      this.FCopyBitmap = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      this.FCopyBitmap.FOnChange = rtl.createCallback(this,"DoCopyBitmapChange");
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FCopyBitmap;
        }, set: function (v) {
          this.p.FCopyBitmap = v;
        }});
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.Execute = function (AProc) {
      var $Self = this;
      this.FCopyBitmap.Assign(this.FBitmap);
      this.frm = $mod.TTMSFNCBitmapEditorForm.$create("CreateDialogNew$1",[$Self,"Bitmap Editor"]);
      this.frm.SetWidth(400);
      this.frm.SetHeight(500);
      this.frm.FOnKeyDown = rtl.createCallback($Self,"DoFormKeyDown");
      this.frm.SetPosition(pas["WEBLib.Forms"].TPosition.poScreenCenter);
      pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.ScaleForCurrentDPI(this.frm);
      this.frm.ShowModal$1(function (AResult) {
        if ((AResult === 1) && ($Self.FBitmap != null)) {
          $Self.FBitmap.Assign(null);
          $Self.FBitmap.Assign($Self.FCopyBitmap);
        };
        $Self.frm = null;
        if (AProc != null) AProc(AResult);
      });
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCBitmapEditor.isPrototypeOf(Source)) this.FBitmap = rtl.as(Source,$mod.TTMSFNCBitmapEditor).FBitmap;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Bitmap",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FBitmap","SetBitmap");
    $r.addProperty("BitmapContainer",2,pas["WEBLib.TMSFNCBitmapContainer"].$rtti["TTMSFNCBitmapContainer"],"FBitmapContainer","SetBitmapContainer");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
  rtl.createClass(this,"TTMSFNCBitmapEditorForm",pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomDesignerForm,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomDesignerForm.$init.call(this);
      this.FBitmapEditor = null;
    };
    this.$final = function () {
      this.FBitmapEditor = undefined;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomDesignerForm.$final.call(this);
    };
    this.Loaded = function () {
      var css = "";
      pas["WEBLib.Forms"].TCustomForm.Loaded.call(this);
      css = pas["WEBLib.Forms"].Application.IDECSS();
      if (css !== "") {
        this.AddCSS("IDECSS",css);
        this.SetElementClassName("IDEBkg");
        this.FCaptionElement.setAttribute("class","IDECaption IDEFont");
        if (this.FBitmapEditor != null) this.FBitmapEditor.ApplyCSS(css);
      };
    };
    this.LoadDFMValues = function () {
      pas["WEBLib.Forms"].TCustomForm.LoadDFMValues.call(this);
      if (this.FBitmapEditor != null) {
        this.FBitmapEditor.BuildEditor(this);
        this.SetActiveControl(this.FBitmapEditor.FTopPanel);
      };
    };
    this.CreateDialogNew$1 = function (ABitmapEditor, ACaption) {
      this.FBitmapEditor = ABitmapEditor;
      pas["WEBLib.Forms"].TCustomForm.CreateDialogNew.call(this,ACaption);
      return this;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  $mod.$resourcestrings = {sTMSFNCBitmapEditorOK: {org: "OK"}, sTMSFNCBitmapEditorCancel: {org: "Cancel"}, sTMSFNCBitmapEditorOpen: {org: "&Open"}, sTMSFNCBitmapEditorSave: {org: "&Save"}, sTMSFNCBitmapEditorClear: {org: "&Clear"}};
  $mod.$implcode = function () {
    $impl.TranslateTextEx = function (AText) {
      var Result = "";
      Result = AText;
      return Result;
    };
  };
},["WEBLib.TMSFNCUtils","WEBLib.Graphics","SysUtils","WEBLib.Dialogs","WEBLib.TMSFNCEditorsTools","WEBLib.WebTools"]);
rtl.module("WEBLib.TMSFNCURLBitmapContainer",["System","Classes","WEBLib.TMSFNCBitmapContainer","WEBLib.TMSFNCTypes"],function () {
  "use strict";
  var $mod = this;
  this.$rtti.$Class("TTMSFNCURLBitmapContainer");
  rtl.createClass(this,"TTMSFNCURLBitmapItem",pas["WEBLib.TMSFNCBitmapContainer"].TTMSFNCBitmapItem,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCBitmapContainer"].TTMSFNCBitmapItem.$init.call(this);
      this.FURL = "";
      this.FLoaded = false;
    };
    this.SetURL = function (Value) {
      if (this.FURL !== Value) {
        this.FURL = Value;
        this.FLoaded = false;
      };
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCURLBitmapItem.isPrototypeOf(Source)) {
        this.FName = rtl.as(Source,$mod.TTMSFNCURLBitmapItem).FName;
        this.FTag = rtl.as(Source,$mod.TTMSFNCURLBitmapItem).FTag;
        this.FBitmap.Assign(rtl.as(Source,$mod.TTMSFNCURLBitmapItem).FBitmap);
        this.SetURL(rtl.as(Source,$mod.TTMSFNCURLBitmapItem).FURL);
      } else if (pas["WEBLib.TMSFNCBitmapContainer"].TTMSFNCBitmapItem.isPrototypeOf(Source)) {
        this.FName = rtl.as(Source,pas["WEBLib.TMSFNCBitmapContainer"].TTMSFNCBitmapItem).FName;
        this.FTag = rtl.as(Source,pas["WEBLib.TMSFNCBitmapContainer"].TTMSFNCBitmapItem).FTag;
        this.FBitmap.Assign(rtl.as(Source,pas["WEBLib.TMSFNCBitmapContainer"].TTMSFNCBitmapItem).FBitmap);
      } else pas["WEBLib.TMSFNCBitmapContainer"].TTMSFNCBitmapItem.Assign.apply(this,arguments);
    };
    var $r = this.$rtti;
    $r.addProperty("URL",2,rtl.string,"FURL","SetURL");
  });
  rtl.createClass(this,"TTMSFNCURLBitmapCollection",pas["WEBLib.TMSFNCBitmapContainer"].TTMSFNCBitmapCollection,function () {
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItemEx(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      pas.Classes.TCollection.SetItem.call(this,Index,Value);
    };
    this.GetBitmapItemClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCURLBitmapItem;
      return Result;
    };
    this.Add$2 = function () {
      var Result = null;
      Result = pas["WEBLib.TMSFNCBitmapContainer"].TTMSFNCBitmapCollection.Add$1.call(this);
      return Result;
    };
    this.Insert$2 = function (index) {
      var Result = null;
      Result = pas["WEBLib.TMSFNCBitmapContainer"].TTMSFNCBitmapCollection.Insert$1.call(this,index);
      return Result;
    };
  });
  this.$rtti.$MethodVar("TTMSFNCURLBitmapContainerDownloadCompleteEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ItemIndex",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCURLBitmapContainerDownloadProgressEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ItemIndex",rtl.longint],["Position",rtl.nativeint],["TotalSize",rtl.nativeint]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCURLBitmapContainer",pas["WEBLib.TMSFNCBitmapContainer"].TTMSFNCBitmapContainer,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCBitmapContainer"].TTMSFNCBitmapContainer.$init.call(this);
      this.FDefaultBitmap = null;
      this.FOnDownloadComplete = null;
      this.FOnDownloadProgress = null;
      this.FOnInternalDownloadComplete = null;
    };
    this.$final = function () {
      this.FDefaultBitmap = undefined;
      this.FOnDownloadComplete = undefined;
      this.FOnDownloadProgress = undefined;
      this.FOnInternalDownloadComplete = undefined;
      pas["WEBLib.TMSFNCBitmapContainer"].TTMSFNCBitmapContainer.$final.call(this);
    };
    this.SetDefaultBitmap = function (Value) {
      this.FDefaultBitmap.Assign(Value);
    };
    this.GetItems$1 = function () {
      var Result = null;
      Result = this.GetItems();
      return Result;
    };
    this.SetItems$1 = function (Value) {
      this.GetItems().Assign(Value);
    };
    this.DoProgress = function () {
    };
    this.DoComplete = function () {
    };
    this.ThreadTerminated = function (Sender) {
    };
    this.CreateItems = function () {
      var Result = null;
      Result = $mod.TTMSFNCURLBitmapCollection.$create("Create$3",[this]);
      return Result;
    };
    this.DoDownloadComplete = function (ItemIndex) {
      if (this.FOnInternalDownloadComplete != null) this.FOnInternalDownloadComplete(this,ItemIndex);
      if (this.FOnDownloadComplete != null) this.FOnDownloadComplete(this,ItemIndex);
      this.Changed();
    };
    this.DoDownloadProgress = function (ItemIndex, Position, TotalSize) {
      if (this.FOnDownloadProgress != null) this.FOnDownloadProgress(this,ItemIndex,Position,TotalSize);
    };
    this.RegisterRuntimeClasses = function () {
      pas.Classes.RegisterClass($mod.TTMSFNCURLBitmapContainer);
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCBitmapContainer"].TTMSFNCBitmapContainer.Create$1.apply(this,arguments);
      this.FDefaultBitmap = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FDefaultBitmap");
      pas["WEBLib.TMSFNCBitmapContainer"].TTMSFNCBitmapContainer.Destroy.call(this);
    };
    this.FindBitmap$1 = function (s) {
      var Result = null;
      var it = null;
      var I = 0;
      Result = null;
      it = null;
      s = pas.SysUtils.UpperCase(s);
      I = 1;
      while (I <= this.GetItems$1().GetCount()) {
        if (pas.SysUtils.UpperCase(this.GetItems$1().GetItem$1(I - 1).FName) === s) {
          it = this.GetItems$1().GetItem$1(I - 1);
          break;
        };
        I += 1;
      };
      if (it != null) Result = it.FBitmap;
      if (pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(Result)) Result = this.FDefaultBitmap;
      return Result;
    };
    this.FindBitmapByURL = function (AURL) {
      var Result = null;
      var s = "";
      var i = 0;
      Result = null;
      s = pas.SysUtils.UpperCase(AURL);
      i = 1;
      while (i <= this.GetItems$1().GetCount()) {
        if (pas.SysUtils.UpperCase(this.GetItems$1().GetItem$1(i - 1).FURL) === s) {
          Result = this.GetItems$1().GetItem$1(i - 1).FBitmap;
          break;
        };
        i += 1;
      };
      return Result;
    };
    this.Download = function (URL) {
      var Result = null;
      this.DoProgress();
      return Result;
    };
    this.AddFromURL = function (URL, BitmapName) {
      pas["WEBLib.TMSFNCBitmapContainer"].TTMSFNCBitmapContainer.AddFromURL.apply(this,arguments);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainerGetItem);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Items",3,$mod.$rtti["TTMSFNCURLBitmapCollection"],"GetItems$1","SetItems$1");
    $r.addProperty("DefaultBitmap",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FDefaultBitmap","SetDefaultBitmap");
    $r.addProperty("OnDownloadComplete",0,$mod.$rtti["TTMSFNCURLBitmapContainerDownloadCompleteEvent"],"FOnDownloadComplete","FOnDownloadComplete");
    $r.addProperty("OnDownloadProgress",0,$mod.$rtti["TTMSFNCURLBitmapContainerDownloadProgressEvent"],"FOnDownloadProgress","FOnDownloadProgress");
  });
},["SysUtils","WEBLib.TMSFNCUtils"]);
rtl.module("WEBLib.TMSFNCEditorListView",["System","Classes","Types","WEBLib.TMSFNCTypes","WEBLib.Controls","WEBLib.StdCtrls","WEBLib.TMSFNCGraphics","WEBLib.TMSFNCGraphicsTypes","WEBLib.TMSFNCBitmapEditor","WEBLib.Forms","WEBLib.TMSFNCCustomControl"],function () {
  "use strict";
  var $mod = this;
  this.MAJ_VER = 1;
  this.MIN_VER = 1;
  this.REL_VER = 0;
  this.BLD_VER = 0;
  this.TTMSFNCListEditorItemRectType = {"0": "eirtNone", eirtNone: 0, "1": "eirtItem", eirtItem: 1, "2": "eirtImage", eirtImage: 2, "3": "eirtName", eirtName: 3, "4": "eirtNoteText", eirtNoteText: 4, "5": "eirtAccessory", eirtAccessory: 5};
  this.$rtti.$Enum("TTMSFNCListEditorItemRectType",{minvalue: 0, maxvalue: 5, ordtype: 1, enumtype: this.TTMSFNCListEditorItemRectType});
  this.$rtti.$Class("TTMSFNCEditorListView");
  rtl.createClass(this,"TTMSFNCEditorListViewAppearance",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FOwner = null;
      this.FItemDownStroke = null;
      this.FItemFont = null;
      this.FItemSelectedFill = null;
      this.FItemHoverFont = null;
      this.FEditFont = null;
      this.FItemFill = null;
      this.FItemSelectedStroke = null;
      this.FItemHoverFill = null;
      this.FItemStroke = null;
      this.FItemDownFont = null;
      this.FItemHoverStroke = null;
      this.FOnChanged = null;
      this.FFill = null;
      this.FItemDownFill = null;
      this.FItemSelectedFont = null;
      this.FStroke = null;
      this.FItemVerticalSpacing = 0.0;
      this.FItemRounding = 0;
      this.FItemImageHoverStroke = null;
      this.FItemImageDownFill = null;
      this.FItemImageDownStroke = null;
      this.FItemImageSelectedFill = null;
      this.FItemImageFill = null;
      this.FItemImageSelectedStroke = null;
      this.FItemImageHoverFill = null;
      this.FItemImageStroke = null;
      this.FItemImageRounding = 0;
      this.FUseImageAppearance = false;
      this.FItemHorizontalSpacing = 0.0;
      this.FItemHorizontalTextMargin = 0.0;
      this.FItemDisabledFill = null;
      this.FItemDisabledStroke = null;
      this.FItemDisabledFont = null;
      this.FSplitter = null;
      this.FSplitterMarginLeft = 0;
      this.FSplitterMarginRight = 0;
      this.FDrawItemImageStroke = false;
    };
    this.$final = function () {
      this.FOwner = undefined;
      this.FItemDownStroke = undefined;
      this.FItemFont = undefined;
      this.FItemSelectedFill = undefined;
      this.FItemHoverFont = undefined;
      this.FEditFont = undefined;
      this.FItemFill = undefined;
      this.FItemSelectedStroke = undefined;
      this.FItemHoverFill = undefined;
      this.FItemStroke = undefined;
      this.FItemDownFont = undefined;
      this.FItemHoverStroke = undefined;
      this.FOnChanged = undefined;
      this.FFill = undefined;
      this.FItemDownFill = undefined;
      this.FItemSelectedFont = undefined;
      this.FStroke = undefined;
      this.FItemImageHoverStroke = undefined;
      this.FItemImageDownFill = undefined;
      this.FItemImageDownStroke = undefined;
      this.FItemImageSelectedFill = undefined;
      this.FItemImageFill = undefined;
      this.FItemImageSelectedStroke = undefined;
      this.FItemImageHoverFill = undefined;
      this.FItemImageStroke = undefined;
      this.FItemDisabledFill = undefined;
      this.FItemDisabledStroke = undefined;
      this.FItemDisabledFont = undefined;
      this.FSplitter = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetEditFont = function (Value) {
      this.FEditFont.Assign(Value);
      this.DoEditFontChanged(this);
    };
    this.SetItemDownFill = function (Value) {
      this.FItemDownFill.Assign(Value);
      this.DoItemFillChanged(this);
    };
    this.SetItemDownFont = function (Value) {
      this.FItemDownFont.Assign(Value);
      this.DoItemFontChanged(this);
    };
    this.SetItemDownStroke = function (Value) {
      this.FItemDownStroke.Assign(Value);
      this.DoItemStrokeChanged(this);
    };
    this.SetItemFill = function (Value) {
      this.FItemFill.Assign(Value);
      this.DoItemFillChanged(this);
    };
    this.SetItemFont = function (Value) {
      this.FItemFont.Assign(Value);
      this.DoItemFontChanged(this);
    };
    this.SetItemHoverFill = function (Value) {
      this.FItemHoverFill.Assign(Value);
      this.DoItemFillChanged(this);
    };
    this.SetItemHoverFont = function (Value) {
      this.FItemHoverFont.Assign(Value);
      this.DoItemFontChanged(this);
    };
    this.SetItemHoverStroke = function (Value) {
      this.FItemHoverStroke.Assign(Value);
      this.DoItemStrokeChanged(this);
    };
    this.SetItemSelectedFill = function (Value) {
      this.FItemSelectedFill.Assign(Value);
      this.DoItemFillChanged(this);
    };
    this.SetItemSelectedFont = function (Value) {
      this.FItemSelectedFont.Assign(Value);
      this.DoItemFontChanged(this);
    };
    this.SetItemSelectedStroke = function (Value) {
      this.FItemSelectedStroke.Assign(Value);
      this.DoItemFillChanged(this);
    };
    this.SetItemStroke = function (Value) {
      this.FItemStroke.Assign(Value);
      this.DoItemStrokeChanged(this);
    };
    this.SetStroke = function (Value) {
      this.FStroke.Assign(Value);
      this.DoStrokeChanged(this);
    };
    this.SetItemVerticalSpacing = function (Value) {
      if (this.FItemVerticalSpacing !== Value) {
        this.FItemVerticalSpacing = Value;
        this.DoChanged(this);
      };
    };
    this.SetItemRounding = function (Value) {
      if (this.FItemRounding !== Value) {
        this.FItemRounding = Value;
        this.DoChanged(this);
      };
    };
    this.SetItemImageDownFill = function (Value) {
      this.FItemImageDownFill.Assign(Value);
      this.DoItemImageFillChanged(this);
    };
    this.SetItemImageDownStroke = function (Value) {
      this.FItemImageDownStroke.Assign(Value);
      this.DoItemImageStrokeChanged(this);
    };
    this.SetItemImageFill = function (Value) {
      this.FItemImageFill.Assign(Value);
      this.DoItemImageFillChanged(this);
    };
    this.SetItemImageHoverFill = function (Value) {
      this.FItemImageHoverFill.Assign(Value);
      this.DoItemImageFillChanged(this);
    };
    this.SetItemImageHoverStroke = function (Value) {
      this.FItemImageHoverStroke.Assign(Value);
      this.DoItemImageStrokeChanged(this);
    };
    this.SetItemImageSelectedFill = function (Value) {
      this.FItemImageSelectedFill.Assign(Value);
      this.DoItemImageFillChanged(this);
    };
    this.SetItemImageSelectedStroke = function (Value) {
      this.FItemImageSelectedStroke.Assign(Value);
      this.DoItemImageStrokeChanged(this);
    };
    this.SetItemImageStroke = function (Value) {
      this.FItemImageStroke.Assign(Value);
      this.DoItemImageStrokeChanged(this);
    };
    this.SetItemImageRounding = function (Value) {
      if (this.FItemImageRounding !== Value) {
        this.FItemImageRounding = Value;
        this.DoImageChanged(this);
      };
    };
    this.SetUseImageAppearance = function (Value) {
      if (this.FUseImageAppearance !== Value) {
        this.FUseImageAppearance = Value;
        this.DoChanged(this);
      };
    };
    this.SetItemHorizontalSpacing = function (Value) {
      if (this.FItemHorizontalSpacing !== Value) {
        this.FItemHorizontalSpacing = Value;
        this.DoChanged(this);
      };
    };
    this.SetItemHorizontalTextMargin = function (Value) {
      if (this.FItemHorizontalTextMargin !== Value) {
        this.FItemHorizontalTextMargin = Value;
        this.DoChanged(this);
      };
    };
    this.IsItemHorizontalSpacingStored = function () {
      var Result = false;
      Result = this.FItemHorizontalSpacing !== 0;
      return Result;
    };
    this.IsItemHorizontalTextMarginStored = function () {
      var Result = false;
      Result = this.FItemHorizontalTextMargin !== 5;
      return Result;
    };
    this.IsItemVerticalSpacingStored = function () {
      var Result = false;
      Result = this.FItemVerticalSpacing !== 0;
      return Result;
    };
    this.SetItemDisabledFill = function (Value) {
      this.FItemDisabledFill.Assign(Value);
      this.DoItemFillChanged(this);
    };
    this.SetItemDisabledFont = function (Value) {
      this.FItemDisabledFont.Assign(Value);
      this.DoItemFontChanged(this);
    };
    this.SetItemDisabledStroke = function (Value) {
      this.FItemDisabledStroke.Assign(Value);
      this.DoItemStrokeChanged(this);
    };
    this.SetSplitter = function (Value) {
      this.FSplitter.Assign(Value);
      this.DoStrokeChanged(this);
    };
    this.SetSplitterMarginLeft = function (Value) {
      if (this.FSplitterMarginLeft !== Value) {
        this.FSplitterMarginLeft = Value;
        this.DoChanged(this);
      };
    };
    this.SetSplitterMarginRight = function (Value) {
      if (this.FSplitterMarginRight !== Value) {
        this.FSplitterMarginRight = Value;
        this.DoChanged(this);
      };
    };
    this.SetDrawItemImageStroke = function (Value) {
      if (this.FDrawItemImageStroke !== Value) {
        this.FDrawItemImageStroke = Value;
        this.DoChanged(this);
      };
    };
    this.DoChanged = function (Sender) {
      if (this.FOnChanged != null) this.FOnChanged(this);
    };
    this.DoImageChanged = function (Sender) {
      this.DoChanged(this);
    };
    this.DoFillChanged = function (Sender) {
      this.DoChanged(Sender);
    };
    this.DoEditFontChanged = function (Sender) {
      this.DoChanged(Sender);
    };
    this.DoStrokeChanged = function (Sender) {
      this.DoChanged(Sender);
    };
    this.DoItemFillChanged = function (Sender) {
      this.DoChanged(Sender);
    };
    this.DoItemFontChanged = function (Sender) {
      this.DoChanged(Sender);
    };
    this.DoItemStrokeChanged = function (Sender) {
      this.DoChanged(Sender);
    };
    this.DoItemImageFillChanged = function (Sender) {
      this.DoImageChanged(Sender);
    };
    this.DoItemImageStrokeChanged = function (Sender) {
      this.DoImageChanged(Sender);
    };
    this.Create$1 = function (AOwner) {
      this.FOwner = AOwner;
      this.FItemVerticalSpacing = 0;
      this.FItemHorizontalSpacing = 0;
      this.FItemHorizontalTextMargin = 5;
      this.FItemRounding = 0;
      this.FItemImageRounding = 0;
      this.FDrawItemImageStroke = true;
      this.FSplitterMarginLeft = 4;
      this.FSplitterMarginRight = 4;
      this.FFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16777215,8421504,-1,-1]);
      this.FStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,12632256,1.0]);
      this.FEditFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FItemFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16777215,8421504,-1,-1]);
      this.FItemFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FItemStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,12632256,1.0]);
      this.FItemHoverFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor("#4edbfa"),8421504,-1,-1]);
      this.FItemHoverFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FItemHoverStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor("#1BADF8"),1.0]);
      this.FItemDownFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor("#1BADF8"),8421504,-1,-1]);
      this.FItemDownFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FItemDownStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor("#4edbfa"),1.0]);
      this.FItemDisabledFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16777215,8421504,-1,-1]);
      this.FItemDisabledFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FItemDisabledFont.SetColor(pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor("#7a7a7a"));
      this.FItemDisabledStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone,pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor("#7a7a7a"),1.0]);
      this.FItemSelectedFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor("#1BADF8"),8421504,-1,-1]);
      this.FItemSelectedFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FItemSelectedStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor("#1BADF8"),1.0]);
      this.FItemImageFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16777215,8421504,-1,-1]);
      this.FItemImageStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,12632256,1.0]);
      this.FItemImageHoverFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor("#4edbfa"),8421504,-1,-1]);
      this.FItemImageHoverStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor("#1BADF8"),1.0]);
      this.FItemImageDownFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor("#1BADF8"),8421504,-1,-1]);
      this.FItemImageDownStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor("#4edbfa"),1.0]);
      this.FItemImageSelectedFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor("#1BADF8"),8421504,-1,-1]);
      this.FItemImageSelectedStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor("#1BADF8"),1.0]);
      this.FSplitter = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor("#1BADF8"),1.0]);
      this.FFill.FOnChanged = rtl.createCallback(this,"DoFillChanged");
      this.FStroke.FOnChanged = rtl.createCallback(this,"DoStrokeChanged");
      this.FEditFont.FOnChanged = rtl.createCallback(this,"DoEditFontChanged");
      this.FItemFill.FOnChanged = rtl.createCallback(this,"DoItemFillChanged");
      this.FItemFont.FOnChanged = rtl.createCallback(this,"DoItemFontChanged");
      this.FItemStroke.FOnChanged = rtl.createCallback(this,"DoItemStrokeChanged");
      this.FItemHoverFill.FOnChanged = rtl.createCallback(this,"DoItemFillChanged");
      this.FItemHoverFont.FOnChanged = rtl.createCallback(this,"DoItemFontChanged");
      this.FItemHoverStroke.FOnChanged = rtl.createCallback(this,"DoItemStrokeChanged");
      this.FItemDownFill.FOnChanged = rtl.createCallback(this,"DoItemFillChanged");
      this.FItemDownFont.FOnChanged = rtl.createCallback(this,"DoItemFontChanged");
      this.FItemDownStroke.FOnChanged = rtl.createCallback(this,"DoItemStrokeChanged");
      this.FItemSelectedFill.FOnChanged = rtl.createCallback(this,"DoItemFillChanged");
      this.FItemSelectedFont.FOnChanged = rtl.createCallback(this,"DoItemFontChanged");
      this.FItemSelectedStroke.FOnChanged = rtl.createCallback(this,"DoItemStrokeChanged");
      this.FItemDisabledFill.FOnChanged = rtl.createCallback(this,"DoItemFillChanged");
      this.FItemDisabledFont.FOnChanged = rtl.createCallback(this,"DoItemFontChanged");
      this.FItemDisabledStroke.FOnChanged = rtl.createCallback(this,"DoItemStrokeChanged");
      this.FItemImageFill.FOnChanged = rtl.createCallback(this,"DoItemImageFillChanged");
      this.FItemImageStroke.FOnChanged = rtl.createCallback(this,"DoItemImageStrokeChanged");
      this.FItemImageHoverFill.FOnChanged = rtl.createCallback(this,"DoItemImageFillChanged");
      this.FItemImageHoverStroke.FOnChanged = rtl.createCallback(this,"DoItemImageStrokeChanged");
      this.FItemImageDownFill.FOnChanged = rtl.createCallback(this,"DoItemImageFillChanged");
      this.FItemImageDownStroke.FOnChanged = rtl.createCallback(this,"DoItemImageStrokeChanged");
      this.FItemImageSelectedFill.FOnChanged = rtl.createCallback(this,"DoItemImageFillChanged");
      this.FItemImageSelectedStroke.FOnChanged = rtl.createCallback(this,"DoItemImageStrokeChanged");
      this.FSplitter.FOnChanged = rtl.createCallback(this,"DoStrokeChanged");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FFill");
      rtl.free(this,"FStroke");
      rtl.free(this,"FEditFont");
      rtl.free(this,"FItemFill");
      rtl.free(this,"FItemFont");
      rtl.free(this,"FItemStroke");
      rtl.free(this,"FItemHoverFill");
      rtl.free(this,"FItemHoverFont");
      rtl.free(this,"FItemHoverStroke");
      rtl.free(this,"FItemDownFill");
      rtl.free(this,"FItemDownFont");
      rtl.free(this,"FItemDownStroke");
      rtl.free(this,"FItemSelectedFill");
      rtl.free(this,"FItemSelectedFont");
      rtl.free(this,"FItemSelectedStroke");
      rtl.free(this,"FItemDisabledFill");
      rtl.free(this,"FItemDisabledFont");
      rtl.free(this,"FItemDisabledStroke");
      rtl.free(this,"FSplitter");
      rtl.free(this,"FItemImageFill");
      rtl.free(this,"FItemImageStroke");
      rtl.free(this,"FItemImageHoverFill");
      rtl.free(this,"FItemImageHoverStroke");
      rtl.free(this,"FItemImageDownFill");
      rtl.free(this,"FItemImageDownStroke");
      rtl.free(this,"FItemImageSelectedFill");
      rtl.free(this,"FItemImageSelectedStroke");
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCEditorListViewAppearance.isPrototypeOf(Source)) {
        this.FUseImageAppearance = rtl.as(Source,$mod.TTMSFNCEditorListViewAppearance).FUseImageAppearance;
        this.FItemRounding = rtl.as(Source,$mod.TTMSFNCEditorListViewAppearance).FItemRounding;
        this.FItemImageRounding = rtl.as(Source,$mod.TTMSFNCEditorListViewAppearance).FItemImageRounding;
        this.FDrawItemImageStroke = rtl.as(Source,$mod.TTMSFNCEditorListViewAppearance).FDrawItemImageStroke;
        this.FItemVerticalSpacing = rtl.as(Source,$mod.TTMSFNCEditorListViewAppearance).FItemVerticalSpacing;
        this.FItemHorizontalSpacing = rtl.as(Source,$mod.TTMSFNCEditorListViewAppearance).FItemHorizontalSpacing;
        this.FFill.Assign(rtl.as(Source,$mod.TTMSFNCEditorListViewAppearance).FFill);
        this.FStroke.Assign(rtl.as(Source,$mod.TTMSFNCEditorListViewAppearance).FStroke);
        this.FEditFont.Assign(rtl.as(Source,$mod.TTMSFNCEditorListViewAppearance).FEditFont);
        this.FItemFill.Assign(rtl.as(Source,$mod.TTMSFNCEditorListViewAppearance).FItemFill);
        this.FItemFont.Assign(rtl.as(Source,$mod.TTMSFNCEditorListViewAppearance).FItemFont);
        this.FItemStroke.Assign(rtl.as(Source,$mod.TTMSFNCEditorListViewAppearance).FItemStroke);
        this.FItemHoverFill.Assign(rtl.as(Source,$mod.TTMSFNCEditorListViewAppearance).FItemHoverFill);
        this.FItemHoverFont.Assign(rtl.as(Source,$mod.TTMSFNCEditorListViewAppearance).FItemHoverFont);
        this.FItemHoverStroke.Assign(rtl.as(Source,$mod.TTMSFNCEditorListViewAppearance).FItemHoverStroke);
        this.FItemDownFill.Assign(rtl.as(Source,$mod.TTMSFNCEditorListViewAppearance).FItemDownFill);
        this.FItemDownFont.Assign(rtl.as(Source,$mod.TTMSFNCEditorListViewAppearance).FItemDownFont);
        this.FItemDownStroke.Assign(rtl.as(Source,$mod.TTMSFNCEditorListViewAppearance).FItemDownStroke);
        this.FItemSelectedFill.Assign(rtl.as(Source,$mod.TTMSFNCEditorListViewAppearance).FItemSelectedFill);
        this.FItemSelectedFont.Assign(rtl.as(Source,$mod.TTMSFNCEditorListViewAppearance).FItemSelectedFont);
        this.FItemSelectedStroke.Assign(rtl.as(Source,$mod.TTMSFNCEditorListViewAppearance).FItemSelectedStroke);
        this.FItemDisabledFill.Assign(rtl.as(Source,$mod.TTMSFNCEditorListViewAppearance).FItemDisabledFill);
        this.FItemDisabledFont.Assign(rtl.as(Source,$mod.TTMSFNCEditorListViewAppearance).FItemDisabledFont);
        this.FItemDisabledStroke.Assign(rtl.as(Source,$mod.TTMSFNCEditorListViewAppearance).FItemDisabledStroke);
        this.FSplitter.Assign(rtl.as(Source,$mod.TTMSFNCEditorListViewAppearance).FSplitter);
        this.FSplitterMarginLeft = rtl.as(Source,$mod.TTMSFNCEditorListViewAppearance).FSplitterMarginLeft;
        this.FSplitterMarginRight = rtl.as(Source,$mod.TTMSFNCEditorListViewAppearance).FSplitterMarginRight;
        this.FItemImageFill.Assign(rtl.as(Source,$mod.TTMSFNCEditorListViewAppearance).FItemImageFill);
        this.FItemImageStroke.Assign(rtl.as(Source,$mod.TTMSFNCEditorListViewAppearance).FItemImageStroke);
        this.FItemImageHoverFill.Assign(rtl.as(Source,$mod.TTMSFNCEditorListViewAppearance).FItemImageHoverFill);
        this.FItemImageHoverStroke.Assign(rtl.as(Source,$mod.TTMSFNCEditorListViewAppearance).FItemImageHoverStroke);
        this.FItemImageDownFill.Assign(rtl.as(Source,$mod.TTMSFNCEditorListViewAppearance).FItemImageDownFill);
        this.FItemImageDownStroke.Assign(rtl.as(Source,$mod.TTMSFNCEditorListViewAppearance).FItemImageDownStroke);
        this.FItemImageSelectedFill.Assign(rtl.as(Source,$mod.TTMSFNCEditorListViewAppearance).FItemImageSelectedFill);
        this.FItemImageSelectedStroke.Assign(rtl.as(Source,$mod.TTMSFNCEditorListViewAppearance).FItemImageSelectedStroke);
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    var $r = this.$rtti;
    $r.addProperty("Fill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFill","SetItemFill");
    $r.addProperty("EditFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FEditFont","SetEditFont");
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
    $r.addProperty("ItemHoverFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FItemHoverFill","SetItemHoverFill");
    $r.addProperty("ItemHoverFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FItemHoverFont","SetItemHoverFont");
    $r.addProperty("ItemHoverStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FItemHoverStroke","SetItemHoverStroke");
    $r.addProperty("ItemDownFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FItemDownFill","SetItemDownFill");
    $r.addProperty("ItemDownFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FItemDownFont","SetItemDownFont");
    $r.addProperty("ItemDownStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FItemDownStroke","SetItemDownStroke");
    $r.addProperty("ItemSelectedFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FItemSelectedFill","SetItemSelectedFill");
    $r.addProperty("ItemSelectedFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FItemSelectedFont","SetItemSelectedFont");
    $r.addProperty("ItemSelectedStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FItemSelectedStroke","SetItemSelectedStroke");
    $r.addProperty("ItemDisabledFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FItemDisabledFill","SetItemDisabledFill");
    $r.addProperty("ItemDisabledFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FItemDisabledFont","SetItemDisabledFont");
    $r.addProperty("ItemDisabledStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FItemDisabledStroke","SetItemDisabledStroke");
    $r.addProperty("ItemFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FItemFill","SetItemFill");
    $r.addProperty("ItemFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FItemFont","SetItemFont");
    $r.addProperty("ItemStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FItemStroke","SetItemStroke");
    $r.addProperty("ItemImageHoverFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FItemImageHoverFill","SetItemImageHoverFill");
    $r.addProperty("ItemImageHoverStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FItemImageHoverStroke","SetItemImageHoverStroke");
    $r.addProperty("ItemImageDownFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FItemImageDownFill","SetItemImageDownFill");
    $r.addProperty("ItemImageDownStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FItemImageDownStroke","SetItemImageDownStroke");
    $r.addProperty("ItemImageSelectedFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FItemImageSelectedFill","SetItemImageSelectedFill");
    $r.addProperty("ItemImageSelectedStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FItemImageSelectedStroke","SetItemImageSelectedStroke");
    $r.addProperty("ItemImageFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FItemImageFill","SetItemImageFill");
    $r.addProperty("ItemImageStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FItemImageStroke","SetItemImageStroke");
    $r.addProperty("ItemVerticalSpacing",14,rtl.double,"FItemVerticalSpacing","SetItemVerticalSpacing",4,{stored: "IsItemVerticalSpacingStored"});
    $r.addProperty("ItemHorizontalTextMargin",14,rtl.double,"FItemHorizontalTextMargin","SetItemHorizontalTextMargin",4,{stored: "IsItemHorizontalTextMarginStored"});
    $r.addProperty("ItemHorizontalSpacing",14,rtl.double,"FItemHorizontalSpacing","SetItemHorizontalSpacing",4,{stored: "IsItemHorizontalSpacingStored"});
    $r.addProperty("ItemRounding",2,rtl.longint,"FItemRounding","SetItemRounding");
    $r.addProperty("ItemImageRounding",2,rtl.longint,"FItemImageRounding","SetItemImageRounding");
    $r.addProperty("UseImageAppearance",2,rtl.boolean,"FUseImageAppearance","SetUseImageAppearance");
    $r.addProperty("Splitter",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FSplitter","SetSplitter");
    $r.addProperty("SplitterMarginLeft",2,rtl.longint,"FSplitterMarginLeft","SetSplitterMarginLeft",4,{Default: 4});
    $r.addProperty("SplitterMarginRight",2,rtl.longint,"FSplitterMarginRight","SetSplitterMarginRight",4,{Default: 4});
    $r.addProperty("DrawItemImageStroke",2,rtl.boolean,"FDrawItemImageStroke","SetDrawItemImageStroke",4,{Default: true});
  });
  rtl.createClass(this,"TTMSFNCEditorListItem",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FNameText = "";
      this.FAccelPos = 0;
      this.FDrawRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FControlRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FAccessoryRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FImgRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FNameRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FNameTextRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FNoteRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FNoteTextRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FBitmap = null;
      this.FTag = 0;
      this.FName = "";
      this.FDataObject = null;
      this.FNoteText = "";
      this.FOnChanged = null;
      this.FItemHeight = 0.0;
      this.FSelected = false;
      this.FFontColor = 0;
      this.FSelectedFontColor = 0;
      this.FControlAlignment = 0;
      this.FControl = null;
      this.FControlPosition = 0;
      this.FDataString = "";
      this.FIsSplitter = false;
      this.FEnabled = false;
      this.FHorizontalNoteAlign = 0;
      this.FHorizontalNameAlign = 0;
      this.FAccessoryBitmap = null;
      this.FAccessoryClickable = false;
    };
    this.$final = function () {
      this.FDrawRect = undefined;
      this.FControlRect = undefined;
      this.FAccessoryRect = undefined;
      this.FImgRect = undefined;
      this.FNameRect = undefined;
      this.FNameTextRect = undefined;
      this.FNoteRect = undefined;
      this.FNoteTextRect = undefined;
      this.FBitmap = undefined;
      this.FDataObject = undefined;
      this.FOnChanged = undefined;
      this.FControl = undefined;
      this.FAccessoryBitmap = undefined;
      pas.Classes.TCollectionItem.$final.call(this);
    };
    this.SetBitmap = function (Value) {
      this.FBitmap.Assign(Value);
    };
    this.SetDataObject = function (Value) {
      if (this.FDataObject !== Value) {
        this.FDataObject = Value;
        this.DoChanged();
      };
    };
    this.SetNoteText = function (Value) {
      if (this.FNoteText !== Value) {
        this.FNoteText = Value;
        this.DoChanged();
      };
    };
    this.SetName = function (Value) {
      if (this.FName !== Value) {
        this.FName = Value;
        this.DoChanged();
      };
    };
    this.DoChanged = function () {
      if (this.FOnChanged != null) this.FOnChanged(this);
      if ($mod.TTMSFNCEditorListCollection.isPrototypeOf(this.FCollection)) {
        if (rtl.as(this.FCollection,$mod.TTMSFNCEditorListCollection) != null) rtl.as(this.FCollection,$mod.TTMSFNCEditorListCollection).DoChanged();
      };
    };
    this.DoSelectItemChanged = function (AIndex, AItem, ASelected) {
      if ($mod.TTMSFNCEditorListCollection.isPrototypeOf(this.FCollection) && (rtl.as(this.FCollection,$mod.TTMSFNCEditorListCollection).FOwner$1 != null) && $mod.TTMSFNCEditorListView.isPrototypeOf(rtl.as(this.FCollection,$mod.TTMSFNCEditorListCollection).FOwner$1)) {
        rtl.as(rtl.as(this.FCollection,$mod.TTMSFNCEditorListCollection).FOwner$1,$mod.TTMSFNCEditorListView).DoSelectItemChanged(AIndex,AItem,ASelected);
      };
    };
    this.SetItemHeight = function (Value) {
      if (this.FItemHeight !== Value) {
        this.FItemHeight = Value;
        this.DoChanged();
      };
    };
    this.SetSelected = function (Value) {
      if (this.FSelected !== Value) {
        this.FSelected = Value;
        this.DoSelectItemChanged(this.GetIndex(),this,this.FSelected);
      };
    };
    this.SetFontColor = function (Value) {
      if (this.FFontColor !== Value) {
        this.FFontColor = Value;
        this.DoChanged();
      };
    };
    this.SetSelectedFontColor = function (Value) {
      if (this.FSelectedFontColor !== Value) {
        this.FSelectedFontColor = Value;
        this.DoChanged();
      };
    };
    this.SetControl = function (Value) {
      if (this.FControl !== Value) {
        this.FControl = Value;
        this.DoChanged();
      };
    };
    this.SetControlAlignment = function (Value) {
      if (this.FControlAlignment !== Value) {
        this.FControlAlignment = Value;
        this.DoChanged();
      };
    };
    this.SetControlPosition = function (Value) {
      if (this.FControlPosition !== Value) {
        this.FControlPosition = Value;
        this.DoChanged();
      };
    };
    this.SetDataString = function (Value) {
      if (this.FDataString !== Value) {
        this.FDataString = Value;
        this.DoChanged();
      };
    };
    this.SetIsSplitter = function (Value) {
      if (this.FIsSplitter !== Value) {
        this.FIsSplitter = Value;
        this.DoChanged();
      };
    };
    this.SetEnabled = function (Value) {
      if (this.FEnabled !== Value) {
        this.FEnabled = Value;
        this.DoChanged();
      };
    };
    this.IsItemHeightStored = function () {
      var Result = false;
      Result = this.FItemHeight !== 60;
      return Result;
    };
    this.SetHorizontalNameAlign = function (Value) {
      if (this.FHorizontalNameAlign !== Value) {
        this.FHorizontalNameAlign = Value;
        this.DoChanged();
      };
    };
    this.SetHorizontalNoteAlign = function (Value) {
      if (this.FHorizontalNoteAlign !== Value) {
        this.FHorizontalNoteAlign = Value;
        this.DoChanged();
      };
    };
    this.SetAccessoryBitmap = function (Value) {
      this.FAccessoryBitmap.Assign(Value);
    };
    this.SetAccessoryClickable = function (Value) {
      this.FAccessoryClickable = Value;
    };
    this.Create$1 = function (ACollection) {
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      this.FControl = null;
      this.FControlAlignment = pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlAlignment.caNone;
      this.FControlPosition = pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlPosition.cpCenterCenter;
      this.FDrawRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(-1,-1,-1,-1));
      this.FControlRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(-1,-1,-1,-1));
      this.FAccessoryRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(-1,-1,-1,-1));
      this.FImgRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(-1,-1,-1,-1));
      this.FNameRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(-1,-1,-1,-1));
      this.FNoteRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(-1,-1,-1,-1));
      this.FBitmap = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      this.FBitmap.FOnChange = rtl.createCallback(this,"DoBitmapChanged");
      this.FAccessoryBitmap = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      this.FAccessoryBitmap.FOnChange = rtl.createCallback(this,"DoBitmapChanged");
      this.FName = "";
      this.FFontColor = -1;
      this.FSelectedFontColor = -1;
      this.FHorizontalNameAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading;
      this.FHorizontalNoteAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading;
      this.FSelected = false;
      this.FIsSplitter = false;
      this.FEnabled = true;
      if ((this.FCollection != null) && $mod.TTMSFNCEditorListCollection.isPrototypeOf(this.FCollection) && (rtl.as(this.FCollection,$mod.TTMSFNCEditorListCollection).FOwner$1 != null) && $mod.TTMSFNCEditorListView.isPrototypeOf(rtl.as(this.FCollection,$mod.TTMSFNCEditorListCollection).FOwner$1)) {
        this.FItemHeight = rtl.as(rtl.as(this.FCollection,$mod.TTMSFNCEditorListCollection).FOwner$1,$mod.TTMSFNCEditorListView).FDefaultItemHeight;
      } else this.FItemHeight = 60;
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FAccessoryBitmap");
      rtl.free(this,"FBitmap");
      pas.Classes.TCollectionItem.Destroy.call(this);
    };
    this.DoBitmapChanged = function (Sender) {
      this.DoChanged();
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCEditorListItem.isPrototypeOf(Source)) {
        this.FName = rtl.as(Source,$mod.TTMSFNCEditorListItem).FName;
        this.FTag = rtl.as(Source,$mod.TTMSFNCEditorListItem).FTag;
        this.FBitmap.Assign(rtl.as(Source,$mod.TTMSFNCEditorListItem).FBitmap);
        this.FAccessoryBitmap.Assign(rtl.as(Source,$mod.TTMSFNCEditorListItem).FAccessoryBitmap);
        this.FDataObject = rtl.as(Source,$mod.TTMSFNCEditorListItem).FDataObject;
        this.FItemHeight = rtl.as(Source,$mod.TTMSFNCEditorListItem).FItemHeight;
      } else if (pas["WEBLib.TMSFNCURLBitmapContainer"].TTMSFNCURLBitmapItem.isPrototypeOf(Source)) {
        this.FName = rtl.as(Source,pas["WEBLib.TMSFNCURLBitmapContainer"].TTMSFNCURLBitmapItem).FName;
        this.FTag = rtl.as(Source,pas["WEBLib.TMSFNCURLBitmapContainer"].TTMSFNCURLBitmapItem).FTag;
        this.FBitmap.Assign(rtl.as(Source,pas["WEBLib.TMSFNCURLBitmapContainer"].TTMSFNCURLBitmapItem).FBitmap);
        this.FNoteText = rtl.as(Source,pas["WEBLib.TMSFNCURLBitmapContainer"].TTMSFNCURLBitmapItem).FURL;
      } else if (pas["WEBLib.TMSFNCBitmapContainer"].TTMSFNCBitmapItem.isPrototypeOf(Source)) {
        this.FName = rtl.as(Source,pas["WEBLib.TMSFNCBitmapContainer"].TTMSFNCBitmapItem).FName;
        this.FTag = rtl.as(Source,pas["WEBLib.TMSFNCBitmapContainer"].TTMSFNCBitmapItem).FTag;
        this.FBitmap.Assign(rtl.as(Source,pas["WEBLib.TMSFNCBitmapContainer"].TTMSFNCBitmapItem).FBitmap);
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    var $r = this.$rtti;
    $r.addProperty("Control",2,pas["WEBLib.Controls"].$rtti["TControl"],"FControl","SetControl");
    $r.addProperty("ControlAlignment",2,pas["WEBLib.TMSFNCCustomControl"].$rtti["TTMSFNCControlAlignment"],"FControlAlignment","SetControlAlignment",4,{Default: pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlAlignment.caNone});
    $r.addProperty("ControlPosition",2,pas["WEBLib.TMSFNCCustomControl"].$rtti["TTMSFNCControlPosition"],"FControlPosition","SetControlPosition",4,{Default: pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlPosition.cpCenterCenter});
    $r.addProperty("Bitmap",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FBitmap","SetBitmap");
    $r.addProperty("AccessoryBitmap",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FAccessoryBitmap","SetAccessoryBitmap");
    $r.addProperty("Name",2,rtl.string,"FName","SetName");
    $r.addProperty("DataObject",2,pas.System.$rtti["TObject"],"FDataObject","SetDataObject");
    $r.addProperty("DataString",2,rtl.string,"FDataString","SetDataString");
    $r.addProperty("NoteText",2,rtl.string,"FNoteText","SetNoteText");
    $r.addProperty("Tag",0,rtl.nativeint,"FTag","FTag");
    $r.addProperty("OnChanged",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChanged","FOnChanged");
    $r.addProperty("ItemHeight",14,rtl.double,"FItemHeight","SetItemHeight",4,{stored: "IsItemHeightStored"});
    $r.addProperty("FontColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FFontColor","SetFontColor");
    $r.addProperty("SelectedFontColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FSelectedFontColor","SetSelectedFontColor");
    $r.addProperty("Selected",2,rtl.boolean,"FSelected","SetSelected",4,{Default: false});
    $r.addProperty("IsSplitter",2,rtl.boolean,"FIsSplitter","SetIsSplitter",4,{Default: false});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("HorizontalNameAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FHorizontalNameAlign","SetHorizontalNameAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading});
    $r.addProperty("HorizontalNoteAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FHorizontalNoteAlign","SetHorizontalNoteAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading});
    $r.addProperty("AccessoryClickable",2,rtl.boolean,"FAccessoryClickable","SetAccessoryClickable",4,{Default: false});
  });
  this.$rtti.$DynArray("TTMSFNCEditorListItemArray",{eltype: this.$rtti["TTMSFNCEditorListItem"]});
  rtl.createClass(this,"TTMSFNCEditorListCollection",pas.Classes.TOwnedCollection,function () {
    this.$init = function () {
      pas.Classes.TOwnedCollection.$init.call(this);
      this.FOwner$1 = null;
      this.FOnChanged = null;
    };
    this.$final = function () {
      this.FOwner$1 = undefined;
      this.FOnChanged = undefined;
      pas.Classes.TOwnedCollection.$final.call(this);
    };
    this.GetItemEx = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItemEx = function (Index, Value) {
      pas.Classes.TCollection.SetItem.call(this,Index,Value);
    };
    this.GetEditorListItemClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCEditorListItem;
      return Result;
    };
    this.DoChanged = function () {
      if (this.FOnChanged != null) this.FOnChanged(this);
    };
    this.CheckComponentRemove = function (AComponent) {
      var I = 0;
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (AComponent === this.GetItemEx(I).FControl) this.GetItemEx(I).SetControl(null);
      };
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,this.GetEditorListItemClass());
      this.FOwner$1 = AOwner;
      return this;
    };
    this.Assign = function (Source) {
      pas.Classes.TCollection.Assign.apply(this,arguments);
      this.DoChanged();
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,index);
      return Result;
    };
  });
  rtl.recNewT(this,"TTMSFNCEditorListItemDrawingParams",function () {
    this.ItemRounding = 0;
    this.NameText = "";
    this.NoteText = "";
    this.$new = function () {
      var r = Object.create(this);
      r.DrawRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.NameRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.AccessoryRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.ImageRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.NoteRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      return r;
    };
    this.$eq = function (b) {
      return (this.ItemRounding === b.ItemRounding) && this.DrawRect.$eq(b.DrawRect) && this.NameRect.$eq(b.NameRect) && this.AccessoryRect.$eq(b.AccessoryRect) && this.ImageRect.$eq(b.ImageRect) && this.NoteRect.$eq(b.NoteRect) && (this.NameText === b.NameText) && (this.NoteText === b.NoteText);
    };
    this.$assign = function (s) {
      this.ItemRounding = s.ItemRounding;
      this.DrawRect.$assign(s.DrawRect);
      this.NameRect.$assign(s.NameRect);
      this.AccessoryRect.$assign(s.AccessoryRect);
      this.ImageRect.$assign(s.ImageRect);
      this.NoteRect.$assign(s.NoteRect);
      this.NameText = s.NameText;
      this.NoteText = s.NoteText;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCEditorListItemDrawingParams",{},this);
    $r.addField("ItemRounding",rtl.longint);
    $r.addField("DrawRect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]);
    $r.addField("NameRect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]);
    $r.addField("AccessoryRect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]);
    $r.addField("ImageRect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]);
    $r.addField("NoteRect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]);
    $r.addField("NameText",rtl.string);
    $r.addField("NoteText",rtl.string);
  });
  rtl.recNewT(this,"TTMSFNCEditorListItemTextDrawingParams",function () {
    this.Text = "";
    this.$new = function () {
      var r = Object.create(this);
      r.DrawRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.TextRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      return r;
    };
    this.$eq = function (b) {
      return this.DrawRect.$eq(b.DrawRect) && this.TextRect.$eq(b.TextRect) && (this.Text === b.Text);
    };
    this.$assign = function (s) {
      this.DrawRect.$assign(s.DrawRect);
      this.TextRect.$assign(s.TextRect);
      this.Text = s.Text;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCEditorListItemTextDrawingParams",{},this);
    $r.addField("DrawRect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]);
    $r.addField("TextRect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]);
    $r.addField("Text",rtl.string);
  });
  rtl.recNewT(this,"TTMSFNCEditorListItemImageDrawingParams",function () {
    this.Bitmap = null;
    this.ImageStroke = false;
    this.ImageStrokeRounding = 0;
    this.DeflateImageX = 0;
    this.DeflateImageY = 0;
    this.$new = function () {
      var r = Object.create(this);
      r.ImageRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      return r;
    };
    this.$eq = function (b) {
      return this.ImageRect.$eq(b.ImageRect) && (this.Bitmap === b.Bitmap) && (this.ImageStroke === b.ImageStroke) && (this.ImageStrokeRounding === b.ImageStrokeRounding) && (this.DeflateImageX === b.DeflateImageX) && (this.DeflateImageY === b.DeflateImageY);
    };
    this.$assign = function (s) {
      this.ImageRect.$assign(s.ImageRect);
      this.Bitmap = s.Bitmap;
      this.ImageStroke = s.ImageStroke;
      this.ImageStrokeRounding = s.ImageStrokeRounding;
      this.DeflateImageX = s.DeflateImageX;
      this.DeflateImageY = s.DeflateImageY;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCEditorListItemImageDrawingParams",{},this);
    $r.addField("ImageRect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]);
    $r.addField("Bitmap",pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"]);
    $r.addField("ImageStroke",rtl.boolean);
    $r.addField("ImageStrokeRounding",rtl.longint);
    $r.addField("DeflateImageX",rtl.longint);
    $r.addField("DeflateImageY",rtl.longint);
  });
  rtl.recNewT(this,"TTMSFNCEditorListItemAccessoryDrawingParams",function () {
    this.Bitmap = null;
    this.$new = function () {
      var r = Object.create(this);
      r.AccessoryRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      return r;
    };
    this.$eq = function (b) {
      return this.AccessoryRect.$eq(b.AccessoryRect) && (this.Bitmap === b.Bitmap);
    };
    this.$assign = function (s) {
      this.AccessoryRect.$assign(s.AccessoryRect);
      this.Bitmap = s.Bitmap;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCEditorListItemAccessoryDrawingParams",{},this);
    $r.addField("AccessoryRect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]);
    $r.addField("Bitmap",pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"]);
  });
  this.$rtti.$MethodVar("TTMSFNCEditorListOnDoubleClickEditorListItem",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AIndex",rtl.longint],["AItem",this.$rtti["TTMSFNCEditorListItem"]],["X",rtl.double],["Y",rtl.double]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCEditorListOnSelectItemChanged",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AIndex",rtl.longint],["AItem",this.$rtti["TTMSFNCEditorListItem"]],["ASelected",rtl.boolean]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCOnBeforeDrawListItem",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["AItem",this.$rtti["TTMSFNCEditorListItem"]],["AItemDrawingParams",this.$rtti["TTMSFNCEditorListItemDrawingParams"],1],["AAllow",rtl.boolean,1],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCOnAfterDrawListItem",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["AItem",this.$rtti["TTMSFNCEditorListItem"]],["AItemDrawingParams",this.$rtti["TTMSFNCEditorListItemDrawingParams"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCOnBeforeDrawListItemText",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["AItem",this.$rtti["TTMSFNCEditorListItem"]],["ATextDrawingParams",this.$rtti["TTMSFNCEditorListItemTextDrawingParams"],1],["AAllow",rtl.boolean,1],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCOnAfterDrawListItemText",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["AItem",this.$rtti["TTMSFNCEditorListItem"]],["ATextDrawingParams",this.$rtti["TTMSFNCEditorListItemTextDrawingParams"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCOnBeforeDrawListItemImage",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["AItem",this.$rtti["TTMSFNCEditorListItem"]],["AImageDrawingParams",this.$rtti["TTMSFNCEditorListItemImageDrawingParams"],1],["AAllow",rtl.boolean,1],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCOnAfterDrawListItemImage",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["AItem",this.$rtti["TTMSFNCEditorListItem"]],["AImageDrawingParams",this.$rtti["TTMSFNCEditorListItemImageDrawingParams"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCOnBeforeDrawListItemAccessory",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["AItem",this.$rtti["TTMSFNCEditorListItem"]],["AAccessoryDrawingParams",this.$rtti["TTMSFNCEditorListItemAccessoryDrawingParams"],1],["AAllow",rtl.boolean,1],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCOnAfterDrawListItemAccessory",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["AItem",this.$rtti["TTMSFNCEditorListItem"]],["AAccessoryDrawingParams",this.$rtti["TTMSFNCEditorListItemAccessoryDrawingParams"]]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCEditorListView",pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$init.call(this);
      this.FAcceleratorList = [];
      this.FItemsChanged = false;
      this.FLastSelectedItemIndex = 0;
      this.FKeyIndex = 0;
      this.FBitmapEditor = null;
      this.FEdit = null;
      this.FEditMode = false;
      this.FEditType = 0;
      this.FEditIndex = 0;
      this.FPrevText = "";
      this.FIntUpdateBlock = false;
      this.FUpdateBlock = false;
      this.FItems = null;
      this.FDefaultItemHeight = 0.0;
      this.FImgMargin = 0.0;
      this.FHoverIndex = 0;
      this.FDragStart = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      this.FMouseDown = false;
      this.FDownIndex = 0;
      this.FAddItemIndex = 0;
      this.FAddItemRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FOnItemsChanged = null;
      this.FOnDoubleClickItem = null;
      this.FOnAddNewItem = null;
      this.FOnItemSelectedChanged = null;
      this.FAppearance = null;
      this.FDrawNoteText = false;
      this.FItemsReadOnly = false;
      this.FMultiSelect = false;
      this.FCanUnselectItems = false;
      this.FImageSize = 0;
      this.FAccessoryWidth = 0;
      this.FOnBeforeDrawListItem = null;
      this.FOnAfterDrawListItem = null;
      this.FOnAfterDrawListItemNote = null;
      this.FOnBeforeDrawListItemName = null;
      this.FOnAfterDrawListItemName = null;
      this.FOnBeforeDrawListItemNote = null;
      this.FOnAfterDrawListItemImage = null;
      this.FOnBeforeDrawListItemImage = null;
      this.FOnBeforeDrawListItemAccessory = null;
      this.FOnAfterDrawListItemAccessory = null;
    };
    this.$final = function () {
      this.FAcceleratorList = undefined;
      this.FBitmapEditor = undefined;
      this.FEdit = undefined;
      this.FItems = undefined;
      this.FDragStart = undefined;
      this.FAddItemRect = undefined;
      this.FOnItemsChanged = undefined;
      this.FOnDoubleClickItem = undefined;
      this.FOnAddNewItem = undefined;
      this.FOnItemSelectedChanged = undefined;
      this.FAppearance = undefined;
      this.FOnBeforeDrawListItem = undefined;
      this.FOnAfterDrawListItem = undefined;
      this.FOnAfterDrawListItemNote = undefined;
      this.FOnBeforeDrawListItemName = undefined;
      this.FOnAfterDrawListItemName = undefined;
      this.FOnBeforeDrawListItemNote = undefined;
      this.FOnAfterDrawListItemImage = undefined;
      this.FOnBeforeDrawListItemImage = undefined;
      this.FOnBeforeDrawListItemAccessory = undefined;
      this.FOnAfterDrawListItemAccessory = undefined;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$final.call(this);
    };
    this.GetItems = function () {
      var Result = null;
      Result = this.FItems;
      return Result;
    };
    this.SetItems = function (Value) {
      this.FItems.Assign(Value);
      this.UpdateList();
    };
    this.SetDefaultItemHeight = function (Value) {
      if (this.FDefaultItemHeight !== Value) {
        this.FDefaultItemHeight = Value;
        this.UpdateList();
      };
    };
    this.GetItemIndex = function (X, Y) {
      var Result = 0;
      var I = 0;
      Result = -1;
      if ((this.FAddItemRect.Top < Y) && (this.FAddItemRect.Bottom > Y)) {
        Result = this.FAddItemIndex}
       else {
        for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          if ((this.FItems.GetItemEx(I).FDrawRect.Top < Y) && (this.FItems.GetItemEx(I).FDrawRect.Bottom > Y)) {
            Result = I;
            break;
          };
        };
      };
      return Result;
    };
    this.GetItemRectType = function (X, Y, AIndex) {
      var Result = 0;
      if (AIndex < 0) AIndex = this.GetItemIndex(X,Y);
      if (AIndex >= 0) {
        if (pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.PointInRect(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(X,Y)),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.FItems.GetItemEx(AIndex).FImgRect))) {
          Result = $mod.TTMSFNCListEditorItemRectType.eirtImage;
        } else if (pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.PointInRect(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(X,Y)),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.FItems.GetItemEx(AIndex).FAccessoryRect))) {
          Result = $mod.TTMSFNCListEditorItemRectType.eirtAccessory;
        } else if (pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.PointInRect(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(X,Y)),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.FItems.GetItemEx(AIndex).FNameRect))) {
          Result = $mod.TTMSFNCListEditorItemRectType.eirtName;
        } else if (pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.PointInRect(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(X,Y)),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.FItems.GetItemEx(AIndex).FNoteRect))) {
          Result = $mod.TTMSFNCListEditorItemRectType.eirtNoteText;
        } else Result = $mod.TTMSFNCListEditorItemRectType.eirtItem;
      } else Result = $mod.TTMSFNCListEditorItemRectType.eirtNone;
      return Result;
    };
    this.AssignBitmap = function (AItem) {
      this.FBitmapEditor.SetBitmap(AItem.FBitmap);
      this.FEditIndex = AItem.GetIndex();
      this.FBitmapEditor.Execute(rtl.createCallback(this,"AssignBitmapCallBack"));
    };
    this.SetAppearance = function (Value) {
      this.FAppearance.Assign(Value);
      this.Invalidate();
    };
    this.SetDrawNoteText = function (Value) {
      if (this.FDrawNoteText !== Value) {
        this.FDrawNoteText = Value;
        this.UpdateList();
      };
    };
    this.SetItemsReadOnly = function (Value) {
      if (this.FItemsReadOnly !== Value) {
        this.FItemsReadOnly = Value;
        this.UpdateList();
      };
    };
    this.SetMultiSelect = function (Value) {
      if (this.FMultiSelect !== Value) {
        this.FMultiSelect = Value;
        if (!this.FMultiSelect) this.UnselectAllItems();
        this.Invalidate();
      };
    };
    this.AssignBitmapCallBack = function (AValue) {
      if ((AValue === 1) && (this.FEditIndex >= 0)) {
        this.FItems.GetItemEx(this.FEditIndex).FBitmap.Assign(this.FBitmapEditor.FBitmap);
      };
      this.FEditIndex = -1;
      this.Invalidate();
    };
    this.SetImgMargin = function (Value) {
      if (this.FImgMargin !== Value) this.FImgMargin = Value;
    };
    this.SetImageSize = function (Value) {
      if (this.FImageSize !== Value) {
        this.FImageSize = Value;
      };
    };
    this.SetAccessoryWidth = function (Value) {
      if (this.FAccessoryWidth !== Value) {
        this.FAccessoryWidth = Math.min(0,Value);
      };
    };
    this.IsDefaultItemHeightStored = function () {
      var Result = false;
      Result = this.FDefaultItemHeight !== 60;
      return Result;
    };
    this.GetShowAccelChar = function () {
      var Result = false;
      Result = this.FShowAcceleratorChar;
      return Result;
    };
    this.SetShowAccelChar = function (Value) {
      var sac = false;
      sac = this.GetShowAccelChar();
      if (sac !== Value) {
        this.SetShowAcceleratorChar(Value);
        this.UpdateList();
      };
    };
    this.Notification = function (AComponent, Operation) {
      pas["WEBLib.Menus"].TWebCustomControl.Notification.apply(this,arguments);
      if ((Operation === pas.Classes.TOperation.opRemove) && !(pas.Classes.TComponentStateItem.csDestroying in this.FComponentState)) this.GetItems().CheckComponentRemove(AComponent);
    };
    this.ChangeDPIScale = function (M, D) {
      var I = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ChangeDPIScale.apply(this,arguments);
      this.BeginUpdate();
      this.FAppearance.FItemFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FAppearance.FItemFont.FHeight,M,D));
      this.FAppearance.FItemHoverFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FAppearance.FItemHoverFont.FHeight,M,D));
      this.FAppearance.FItemDownFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FAppearance.FItemDownFont.FHeight,M,D));
      this.FAppearance.FItemSelectedFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FAppearance.FItemSelectedFont.FHeight,M,D));
      this.FAppearance.FItemImageRounding = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FAppearance.FItemImageRounding,M,D);
      this.FAppearance.FItemRounding = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FAppearance.FItemRounding,M,D);
      this.FAppearance.FEditFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FAppearance.FEditFont.FHeight,M,D));
      this.FAppearance.FItemVerticalSpacing = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FAppearance.FItemVerticalSpacing,M,D);
      this.FAppearance.FItemHorizontalSpacing = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FAppearance.FItemHorizontalSpacing,M,D);
      this.FAppearance.FItemHorizontalTextMargin = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FAppearance.FItemHorizontalTextMargin,M,D);
      this.FAppearance.FSplitterMarginLeft = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FAppearance.FSplitterMarginLeft,M,D);
      this.FAppearance.FSplitterMarginRight = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FAppearance.FSplitterMarginRight,M,D);
      this.FDefaultItemHeight = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FDefaultItemHeight,M,D);
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.FItems.GetItemEx(I).FItemHeight = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FItems.GetItemEx(I).FItemHeight,M,D);
      };
      this.EndUpdate();
    };
    this.MultiSelected = function () {
      var Result = false;
      var I = 0;
      var sec = false;
      Result = false;
      sec = false;
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (this.FItems.GetItemEx(I).FSelected) {
          if (!sec) {
            sec = true}
           else {
            Result = true;
            break;
          };
        };
      };
      return Result;
    };
    this.MoveItems = function (X, Y) {
      var mi = 0;
      var di = 0;
      var I = 0;
      var c = false;
      c = false;
      di = this.FDownIndex;
      mi = this.GetItemIndex(X,Y);
      if (mi === -1) {
        mi = this.FItems.GetCount() - 1;
      };
      if (di !== -1) {
        this.FItems.GetItemEx(di).SetIndex(mi);
        di = mi;
        c = true;
      };
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (this.FItems.GetItemEx(I).FSelected && (di !== I)) {
          if (mi >= (this.FItems.GetCount() - 1)) {
            mi = this.FItems.GetCount() - 1}
           else mi += 1;
          this.FItems.GetItemEx(I).SetIndex(mi);
          c = true;
        };
      };
      if (c) this.DoItemsChanged(this);
    };
    this.DeleteSelectedItems = function () {
      var I = 0;
      if (this.FEditMode) this.EndEditMode(false);
      this.FIntUpdateBlock = true;
      for (var $l = this.FItems.GetCount() - 1; $l >= 0; $l--) {
        I = $l;
        if (this.FItems.GetItemEx(I).FSelected) this.FItems.Delete(I);
      };
      this.FIntUpdateBlock = false;
      this.UpdateList();
    };
    this.DoEditKeyDown = function (Sender, Key, Shift) {
      if (this.FEditMode) {
        if (Key.get() === 13) {
          this.EndEditMode(true);
          Key.set(0);
        } else if (Key.get() === 27) {
          this.EndEditMode(false);
          Key.set(0);
        };
      };
    };
    this.HandleKeyDown = function (Key, Shift) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleKeyDown.apply(this,arguments);
    };
    this.HandleKeyUp = function (Key, Shift) {
      var rp = false;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleKeyUp.apply(this,arguments);
      rp = false;
      if (Key.get() === 45) {
        this.DoAddNewItem();
        rp = true;
      } else if (Key.get() === 46) {
        this.DeleteSelectedItems();
        this.SetHeight(this.GetListHeight());
        rp = true;
      } else if (Key.get() === 38) {
        if ((pas.Classes.TShiftState$a.ssShift in Shift) && this.FMultiSelect) {
          if (this.FKeyIndex === -1) {
            if (this.FLastSelectedItemIndex === -1) {
              this.SelectItemInt(0)}
             else if (this.FLastSelectedItemIndex > (this.FItems.GetCount() - 1)) {
              this.SelectItemInt(this.FItems.GetCount() - 1)}
             else if (this.FItems.GetItemEx(this.FLastSelectedItemIndex).FSelected) {
              this.FKeyIndex = this.FLastSelectedItemIndex - 1}
             else this.FKeyIndex = this.FLastSelectedItemIndex;
          };
          if ((this.FKeyIndex >= 0) && (this.FKeyIndex < this.FItems.GetCount())) {
            if (this.FKeyIndex > this.FLastSelectedItemIndex) {
              this.FItems.GetItemEx(this.FKeyIndex).SetSelected(false)}
             else this.FItems.GetItemEx(this.FKeyIndex).SetSelected(true);
          };
          this.FKeyIndex = Math.max(0,this.FKeyIndex - 1);
        } else this.SelectItemInt(this.FLastSelectedItemIndex - 1);
        rp = true;
      } else if (Key.get() === 40) {
        if ((pas.Classes.TShiftState$a.ssShift in Shift) && this.FMultiSelect) {
          if (this.FKeyIndex === -1) {
            if (this.FLastSelectedItemIndex === -1) {
              this.SelectItemInt(0)}
             else if (this.FLastSelectedItemIndex > (this.FItems.GetCount() - 1)) {
              this.SelectItemInt(this.FItems.GetCount() - 1)}
             else if (this.FItems.GetItemEx(this.FLastSelectedItemIndex).FSelected) {
              this.FKeyIndex = this.FLastSelectedItemIndex + 1}
             else this.FKeyIndex = this.FLastSelectedItemIndex;
          };
          if ((this.FKeyIndex >= 0) && (this.FKeyIndex < this.FItems.GetCount())) {
            if (this.FKeyIndex < this.FLastSelectedItemIndex) {
              this.FItems.GetItemEx(this.FKeyIndex).SetSelected(false)}
             else this.FItems.GetItemEx(this.FKeyIndex).SetSelected(true);
          };
          this.FKeyIndex = Math.min(this.FItems.GetCount() - 1,this.FKeyIndex + 1);
        } else this.SelectItemInt(this.FLastSelectedItemIndex + 1);
        rp = true;
      } else if (pas.Classes.TShiftState$a.ssCtrl in Shift) {
        var $tmp = Key.get();
        if ($tmp === 65) {
          this.SelectAllItems();
          rp = true;
        } else if ($tmp === 68) {
          this.UnselectAllItems();
          rp = true;
        };
      };
      if (rp) this.Invalidate();
    };
    this.HandleKeyPress = function (Key) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleKeyPress.apply(this,arguments);
    };
    this.HandleMouseDown = function (Button, Shift, X, Y) {
      var di = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseDown.apply(this,arguments);
      this.FKeyIndex = -1;
      if (!this.FEditMode) {
        this.FMouseDown = true;
        this.FDragStart.$assign(pas["WEBLib.TMSFNCTypes"].PointF(X,Y));
        di = this.GetItemIndex(X,Y);
        if (di !== this.FDownIndex) {
          this.FDownIndex = di;
          this.Invalidate();
        };
      };
    };
    this.HandleMouseEnter = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseEnter.call(this);
    };
    this.HandleMouseLeave = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseLeave.call(this);
      this.FHoverIndex = -1;
      this.FDownIndex = -1;
      this.Invalidate();
    };
    this.HandleMouseMove = function (Shift, X, Y) {
      var hi = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseMove.apply(this,arguments);
      hi = this.GetItemIndex(X,Y);
      if (hi !== this.FHoverIndex) {
        this.FHoverIndex = hi;
        this.Invalidate();
      };
    };
    this.HandleMouseUp = function (Button, Shift, X, Y) {
      var si = 0;
      var irt = 0;
      var I = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseUp.apply(this,arguments);
      if (this.FEditMode) {
        this.EndEditMode(true)}
       else if (this.FMouseDown && (this.FDownIndex !== -1)) {
        if ((Y < (this.FDragStart.Y + 5)) && (Y > (this.FDragStart.Y - 5))) {
          si = this.GetItemIndex(X,Y);
          if (si === this.FAddItemIndex) {
            this.DoAddNewItem()}
           else if (si >= 0) {
            if ((pas.Classes.TShiftState$a.ssShift in Shift) && this.FMultiSelect) {
              if (this.FLastSelectedItemIndex < 0) {
                this.FLastSelectedItemIndex = 0}
               else if (this.FLastSelectedItemIndex > (this.FItems.GetCount() - 1)) this.FLastSelectedItemIndex = this.FItems.GetCount() - 1;
              for (var $l = Math.min(si,this.FLastSelectedItemIndex), $end = Math.max(si,this.FLastSelectedItemIndex); $l <= $end; $l++) {
                I = $l;
                this.FItems.GetItemEx(I).SetSelected(true);
              };
              this.FLastSelectedItemIndex = si;
            } else {
              irt = this.GetItemRectType(X,Y,si);
              if (Button === pas["WEBLib.Controls"].TMouseButton.mbRight) irt = $mod.TTMSFNCListEditorItemRectType.eirtName;
              if (this.FItemsReadOnly && (irt in rtl.createSet($mod.TTMSFNCListEditorItemRectType.eirtName,$mod.TTMSFNCListEditorItemRectType.eirtNoteText))) irt = $mod.TTMSFNCListEditorItemRectType.eirtItem;
              var $tmp = irt;
              if ($tmp === $mod.TTMSFNCListEditorItemRectType.eirtItem) {
                this.DoItemClicked(this.FItems.GetItemEx(si),rtl.refSet(Shift))}
               else if ($tmp === $mod.TTMSFNCListEditorItemRectType.eirtImage) {
                this.DoItemImageClicked(this.FItems.GetItemEx(si))}
               else if (($tmp === $mod.TTMSFNCListEditorItemRectType.eirtName) || ($tmp === $mod.TTMSFNCListEditorItemRectType.eirtNoteText)) {
                this.DoItemTextClicked(this.FItems.GetItemEx(si),irt,rtl.refSet(Shift))}
               else if ($tmp === $mod.TTMSFNCListEditorItemRectType.eirtAccessory) this.DoItemAccessoryClicked(this.FItems.GetItemEx(si));
            };
          };
          this.Invalidate();
        } else {
          this.MoveItems(X,Y);
        };
      };
      this.FDownIndex = -1;
      this.FDragStart.$assign(pas["WEBLib.TMSFNCTypes"].PointF(-1,-1));
      this.FMouseDown = false;
    };
    this.HandleDblClick = function (X, Y) {
      var ci = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleDblClick.apply(this,arguments);
      ci = this.GetItemIndex(X,Y);
      if ((ci >= 0) && (this.FItems.GetItemEx(ci) != null)) this.DoDblClickItem(ci,this.FItems.GetItemEx(ci),X,Y);
    };
    this.CreateItems = function () {
      var Result = null;
      Result = $mod.TTMSFNCEditorListCollection.$create("Create$3",[this]);
      return Result;
    };
    this.SetItemRect = function (AIndex, X, Y) {
      if (this.FItems.GetItemEx(AIndex).FIsSplitter) {
        this.FItems.GetItemEx(AIndex).FDrawRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.FAppearance.FSplitterMarginLeft,Y,this.GetWidth() - this.FAppearance.FSplitterMarginRight,Y + this.FAppearance.FSplitter.FWidth))}
       else this.FItems.GetItemEx(AIndex).FDrawRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.FAppearance.FItemHorizontalSpacing,Y,this.GetWidth() - this.FAppearance.FItemHorizontalSpacing,Y + this.FItems.GetItemEx(AIndex).FItemHeight));
    };
    this.SetControlPosition = function (AIndex) {
      var $Self = this;
      var cr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var l = 0;
      var t = 0;
      var w = 0;
      var h = 0;
      function GetAvailableControlRect() {
        var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
        var bmpR = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
        var accR = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
        Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(-1,-1,-1,-1));
        if ((AIndex >= 0) && (AIndex < $Self.FItems.GetCount())) {
          Result.$assign($Self.FItems.GetItemEx(AIndex).FDrawRect);
          bmpR.$assign($Self.FItems.GetItemEx(AIndex).FImgRect);
          accR.$assign($Self.FItems.GetItemEx(AIndex).FAccessoryRect);
          Result.Left = $Self.FItems.GetItemEx(AIndex).FImgRect.Right;
          Result.Right = $Self.FItems.GetItemEx(AIndex).FAccessoryRect.Left;
        };
        return Result;
      };
      this.GetItems().GetItemEx(AIndex).FControlRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(-1,-1,-1,-1));
      if ((this.GetItems().GetItemEx(AIndex) != null) && (this.GetItems().GetItemEx(AIndex).FControl != null)) {
        cr.$assign(GetAvailableControlRect());
        l = Math.round(cr.Left);
        t = Math.round(cr.Top);
        w = Math.round(Math.min(this.GetItems().GetItemEx(AIndex).FControl.GetWidth(),cr.Right - cr.Left));
        h = Math.round(Math.min(this.GetItems().GetItemEx(AIndex).FControl.GetHeight(),cr.Bottom - cr.Top));
        var $tmp = this.GetItems().GetItemEx(AIndex).FControlAlignment;
        if ($tmp === pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlAlignment.caNone) {
          var $tmp1 = this.GetItems().GetItemEx(AIndex).FControlPosition;
          if (($tmp1 === pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlPosition.cpCenterLeft) || ($tmp1 === pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlPosition.cpCenterCenter) || ($tmp1 === pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlPosition.cpCenterRight)) {
            t = Math.round((cr.Bottom - cr.Top - h) / 2);
          } else if (($tmp1 === pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlPosition.cpBottomLeft) || ($tmp1 === pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlPosition.cpBottomCenter) || ($tmp1 === pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlPosition.cpBottomRight)) {
            t = Math.round(cr.Bottom - h);
          };
          var $tmp2 = this.GetItems().GetItemEx(AIndex).FControlPosition;
          if (($tmp2 === pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlPosition.cpTopCenter) || ($tmp2 === pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlPosition.cpCenterCenter) || ($tmp2 === pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlPosition.cpBottomCenter)) {
            l = Math.round((cr.Right - cr.Left - w) / 2);
          } else if (($tmp2 === pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlPosition.cpTopRight) || ($tmp2 === pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlPosition.cpCenterRight) || ($tmp2 === pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlPosition.cpBottomRight)) {
            l = Math.round(cr.Right - w);
          };
          this.GetItems().GetItemEx(AIndex).FControl.SetBounds(l,t,w,h);
          this.GetItems().GetItemEx(AIndex).FControlRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(l,t,l + w,t + h));
        } else if ($tmp === pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlAlignment.caClient) {
          this.GetItems().GetItemEx(AIndex).FControl.SetBounds(l,t,Math.round(cr.Right - cr.Left),Math.round(cr.Bottom - cr.Top));
          this.GetItems().GetItemEx(AIndex).FControlRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(l,t,Math.round(cr.Right),Math.round(cr.Bottom)));
        } else if ($tmp === pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlAlignment.caTop) {
          this.GetItems().GetItemEx(AIndex).FControl.SetBounds(l,t,Math.round(cr.Right - cr.Left),h);
          this.GetItems().GetItemEx(AIndex).FControlRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(l,t,Math.round(cr.Right),t + h));
        } else if ($tmp === pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlAlignment.caBottom) {
          this.GetItems().GetItemEx(AIndex).FControl.SetBounds(l,Math.round(cr.Bottom - h),Math.round(cr.Right - cr.Left),h);
          this.GetItems().GetItemEx(AIndex).FControlRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(l,Math.round(cr.Bottom - h),Math.round(cr.Right),Math.round(cr.Bottom)));
        } else if ($tmp === pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlAlignment.caLeft) {
          this.GetItems().GetItemEx(AIndex).FControl.SetBounds(l,t,w,Math.round(cr.Bottom - cr.Top));
          this.GetItems().GetItemEx(AIndex).FControlRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(l,t,l + w,Math.round(cr.Bottom)));
        } else if ($tmp === pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlAlignment.caRight) {
          this.GetItems().GetItemEx(AIndex).FControl.SetBounds(Math.round(cr.Right - w),t,w,h);
          this.GetItems().GetItemEx(AIndex).FControlRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Math.round(cr.Right - w),t,Math.round(cr.Right),Math.round(cr.Bottom)));
        };
      };
    };
    this.SetItemImageRect = function (AIndex) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var s = 0.0;
      var w = 0.0;
      var h = 0.0;
      var hoff = 0.0;
      if ((AIndex >= 0) && (AIndex < this.FItems.GetCount())) {
        r.$assign(this.FItems.GetItemEx(AIndex).FDrawRect);
        if (this.FImageSize === 0) {
          r.Right = r.Left;
          this.FItems.GetItemEx(AIndex).FImgRect.$assign(r);
        } else {
          w = r.Right - this.FImgMargin - (r.Left + this.FImgMargin);
          h = r.Bottom - this.FImgMargin - (r.Top + this.FImgMargin);
          if (this.FImageSize === -1) {
            s = Math.min(w,h)}
           else s = Math.min(this.FImageSize,w);
          hoff = Math.max(this.FImgMargin,(r.Bottom - this.FImgMargin - (r.Top + this.FImgMargin) - s) / 2);
          this.FItems.GetItemEx(AIndex).FImgRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + this.FImgMargin,r.Top + hoff,r.Left + this.FImgMargin + s,Math.min(r.Bottom - this.FImgMargin,r.Top + hoff + s)));
        };
      };
    };
    this.SetAccessoryRect = function (AIndex) {
      var R = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var bmpR = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if ((AIndex >= 0) && (AIndex < this.FItems.GetCount())) {
        R.$assign(this.GetItems().GetItemEx(AIndex).FDrawRect);
        bmpR.$assign(this.GetItems().GetItemEx(AIndex).FImgRect);
        if (bmpR.Right > 0) R.Left = bmpR.Right;
        R.Left = Math.max(R.Left,R.Right - this.FAccessoryWidth);
        this.GetItems().GetItemEx(AIndex).FAccessoryRect.$assign(R);
      };
    };
    this.SetItemNameRect = function (AIndex) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var g = null;
      var noteTxt = "";
      var txtHeight = 0.0;
      var txtNameWidth = 0.0;
      var txtNoteWidth = 0.0;
      var h = 0.0;
      var NameLeft = 0.0;
      var NameRight = 0.0;
      var NoteLeft = 0.0;
      var NoteRight = 0.0;
      if ((AIndex >= 0) && (AIndex < this.FItems.GetCount())) {
        r.$assign(this.FItems.GetItemEx(AIndex).FDrawRect);
        r.Right = this.FItems.GetItemEx(AIndex).FAccessoryRect.Left - this.FAppearance.FItemHorizontalTextMargin;
        r.Left = this.FItems.GetItemEx(AIndex).FImgRect.Right + this.FAppearance.FItemHorizontalTextMargin;
        if (this.FItems.GetItemEx(AIndex).FControl != null) {
          var $tmp = this.FItems.GetItemEx(AIndex).FControlAlignment;
          if ($tmp === pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlAlignment.caNone) {
            var $tmp1 = this.FItems.GetItemEx(AIndex).FControlPosition;
            if (($tmp1 === pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlPosition.cpTopLeft) || ($tmp1 === pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlPosition.cpTopCenter) || ($tmp1 === pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlPosition.cpTopRight)) {
              r.Top = this.FItems.GetItemEx(AIndex).FControlRect.Bottom;
            } else if (($tmp1 === pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlPosition.cpBottomLeft) || ($tmp1 === pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlPosition.cpBottomCenter) || ($tmp1 === pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlPosition.cpBottomRight)) {
              r.Bottom = this.FItems.GetItemEx(AIndex).FControlRect.Top;
            } else if ($tmp1 === pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlPosition.cpCenterLeft) {
              r.Left = this.FItems.GetItemEx(AIndex).FControlRect.Right;
            } else if (($tmp1 === pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlPosition.cpCenterCenter) || ($tmp1 === pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlPosition.cpCenterRight)) {
              r.Right = this.FItems.GetItemEx(AIndex).FControlRect.Left;
            };
          } else if ($tmp === pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlAlignment.caLeft) {
            r.Left = this.FItems.GetItemEx(AIndex).FControlRect.Right;
          } else if ($tmp === pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlAlignment.caRight) {
            r.Right = this.FItems.GetItemEx(AIndex).FControlRect.Left;
          } else if ($tmp === pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlAlignment.caTop) {
            r.Top = this.FItems.GetItemEx(AIndex).FControlRect.Bottom;
          } else if ($tmp === pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlAlignment.caBottom) {
            r.Bottom = this.FItems.GetItemEx(AIndex).FControlRect.Top;
          } else {
            this.FItems.GetItemEx(AIndex).FNameRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(-1,-1,-1,-1));
            this.FItems.GetItemEx(AIndex).FNoteRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(-1,-1,-1,-1));
            return;
          };
        };
        txtHeight = -this.FAppearance.FItemFont.FHeight;
        txtNameWidth = 0;
        txtNoteWidth = 0;
        noteTxt = this.FItems.GetItemEx(AIndex).FNoteText;
        if ((noteTxt === "") && (this.FItems.GetItemEx(AIndex).FDataString !== "")) noteTxt = this.FItems.GetItemEx(AIndex).FDataString;
        if (this.GetCanvas() != null) {
          g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("Create$1",[this.GetCanvas(),false]);
          try {
            g.FFont.Assign(this.FAppearance.FItemFont);
            txtHeight = g.CalculateTextHeight$1("Hg");
            if (this.FItems.GetItemEx(AIndex).FNameText !== "") txtNameWidth = g.CalculateTextWidth$1(this.FItems.GetItemEx(AIndex).FNameText) + this.ScalePaintValue$1(3.0);
            if (noteTxt !== "") txtNoteWidth = g.CalculateTextWidth$1(noteTxt) + this.ScalePaintValue$1(3.0);
          } finally {
            g = rtl.freeLoc(g);
          };
        };
        var $tmp2 = this.FItems.GetItemEx(AIndex).FHorizontalNameAlign;
        if ($tmp2 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter) {
          NameLeft = Math.max(r.Left,r.Left + ((r.Right - r.Left - txtNameWidth) / 2));
          NameRight = Math.min(r.Right,NameLeft + txtNameWidth);
        } else if ($tmp2 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaTrailing) {
          NameRight = r.Right;
          NameLeft = Math.max(r.Left,NameRight - txtNameWidth);
        } else {
          NameLeft = r.Left;
          NameRight = Math.min(r.Right,NameLeft + txtNameWidth);
        };
        var $tmp3 = this.FItems.GetItemEx(AIndex).FHorizontalNoteAlign;
        if ($tmp3 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter) {
          NoteLeft = Math.max(r.Left,r.Left + ((r.Right - r.Left - txtNoteWidth) / 2));
          NoteRight = Math.min(r.Right,NoteLeft + txtNoteWidth);
        } else if ($tmp3 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaTrailing) {
          NoteRight = r.Right;
          NoteLeft = Math.max(r.Left,NoteRight - txtNoteWidth);
        } else {
          NoteLeft = r.Left;
          NoteRight = Math.min(r.Right,NoteLeft + txtNoteWidth);
        };
        h = r.Bottom - r.Top;
        if (this.FDrawNoteText) {
          if ((NoteLeft < NameRight) && (this.FItems.GetItemEx(AIndex).FHorizontalNameAlign === this.FItems.GetItemEx(AIndex).FHorizontalNoteAlign)) {
            h = (r.Bottom - r.Top) / 2;
            this.FItems.GetItemEx(AIndex).FNoteTextRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(NoteLeft,r.Top + h + ((h - txtHeight) / 2),NoteRight,r.Top + h + ((h - txtHeight) / 2) + txtHeight));
          } else this.FItems.GetItemEx(AIndex).FNoteTextRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(NoteLeft,r.Top + ((h - txtHeight) / 2),NoteRight,r.Top + ((h - txtHeight) / 2) + txtHeight));
          this.FItems.GetItemEx(AIndex).FNoteRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,this.FItems.GetItemEx(AIndex).FNoteTextRect.Top,r.Right,this.FItems.GetItemEx(AIndex).FNoteTextRect.Bottom));
        } else {
          this.FItems.GetItemEx(AIndex).FNoteRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(-1,-1,-1,-1));
          this.FItems.GetItemEx(AIndex).FNoteTextRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(-1,-1,-1,-1));
        };
        this.FItems.GetItemEx(AIndex).FNameTextRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(NameLeft,r.Top + ((h - txtHeight) / 2),NameRight,r.Top + ((h - txtHeight) / 2) + txtHeight));
        this.FItems.GetItemEx(AIndex).FNameRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,this.FItems.GetItemEx(AIndex).FNameTextRect.Top,r.Right,this.FItems.GetItemEx(AIndex).FNameTextRect.Bottom));
        if (this.FDrawNoteText && !(NoteLeft < NameRight)) {
          this.FItems.GetItemEx(AIndex).FNoteRect.Left = NameRight + this.ScalePaintValue(4);
          this.FItems.GetItemEx(AIndex).FNameRect.Right = NoteLeft - this.ScalePaintValue(4);
        };
      };
    };
    this.InitializeItems = function () {
      var i = 0;
      var y = 0.0;
      y = this.FAppearance.FItemVerticalSpacing;
      this.FAcceleratorList = rtl.arraySetLength(this.FAcceleratorList,"\x00",this.FItems.GetCount());
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        this.SetItemAcceleratorKey(i);
        this.SetItemRect(i,0,y);
        this.SetItemImageRect(i);
        this.SetAccessoryRect(i);
        this.SetControlPosition(i);
        this.SetItemNameRect(i);
        y = this.FItems.GetItemEx(i).FDrawRect.Bottom + this.FAppearance.FItemVerticalSpacing;
      };
      this.SetHeight(Math.round(Math.max(this.GetHeight(),y)));
    };
    this.UpdateControlAfterResize = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.UpdateControlAfterResize.call(this);
      this.UpdateList();
    };
    this.DoAppearanceChanged = function (Sender) {
      this.Invalidate();
    };
    this.DoAddNewItem = function () {
      if (this.FOnAddNewItem != null) this.FOnAddNewItem(this);
    };
    this.DoDblClickItem = function (AIndex, AItem, X, Y) {
      if (this.FOnDoubleClickItem != null) this.FOnDoubleClickItem(this,AIndex,AItem,X,Y);
    };
    this.DoItemsChanged = function (Sender) {
      if (this.FIntUpdateBlock || this.FUpdateBlock) {
        this.FItemsChanged = true;
        return;
      };
      if (this.FOnItemsChanged != null) this.FOnItemsChanged(this);
      this.UpdateList();
    };
    this.DoSelectItemChanged = function (AIndex, AItem, ASelected) {
      if (this.FOnItemSelectedChanged != null) this.FOnItemSelectedChanged(this,AIndex,AItem,ASelected);
    };
    this.Draw = function (AGraphics, ARect) {
      this.DrawItems(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),this.FItems);
    };
    this.DrawBackground = function (AGraphics, ARect) {
      AGraphics.FFill.Assign(this.FAppearance.FFill);
      AGraphics.FStroke.Assign(this.FAppearance.FStroke);
      AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
    };
    this.DrawAccessory = function (AGraphics, ARect, AItem) {
      var a = false;
      var dd = false;
      var adp = $mod.TTMSFNCEditorListItemAccessoryDrawingParams.$new();
      if (ARect.Right > ARect.Left) {
        a = true;
        dd = true;
        adp.AccessoryRect.$assign(ARect);
        adp.Bitmap = AItem.FAccessoryBitmap;
        this.DoBeforeDrawListItemAccessory(AGraphics,AItem,adp,{get: function () {
            return a;
          }, set: function (v) {
            a = v;
          }},{get: function () {
            return dd;
          }, set: function (v) {
            dd = v;
          }});
        if (a) {
          if (dd) {
            if (!pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(adp.Bitmap)) AGraphics.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(adp.AccessoryRect),adp.Bitmap,true,false,true,false);
          };
          this.DoAfterDrawListItemAccessory(AGraphics,AItem,adp);
        };
      };
    };
    this.DrawBitmap = function (AGraphics, ARect, AItem) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var bdp = $mod.TTMSFNCEditorListItemImageDrawingParams.$new();
      var a = false;
      var dd = false;
      if (ARect.Right > 0) {
        if (this.FAppearance.FUseImageAppearance) {
          if (AItem.FSelected) {
            AGraphics.FFill.Assign(this.FAppearance.FItemImageSelectedFill);
            AGraphics.FStroke.Assign(this.FAppearance.FItemImageSelectedStroke);
          } else if (AItem.GetIndex() === this.FDownIndex) {
            AGraphics.FFill.Assign(this.FAppearance.FItemImageDownFill);
            AGraphics.FStroke.Assign(this.FAppearance.FItemImageDownStroke);
          } else if (AItem.GetIndex() === this.FHoverIndex) {
            AGraphics.FFill.Assign(this.FAppearance.FItemImageHoverFill);
            AGraphics.FStroke.Assign(this.FAppearance.FItemImageHoverStroke);
          } else {
            AGraphics.FFill.Assign(this.FAppearance.FItemImageFill);
            AGraphics.FStroke.Assign(this.FAppearance.FItemImageStroke);
          };
        };
        a = true;
        dd = true;
        bdp.ImageRect.$assign(ARect);
        bdp.Bitmap = AItem.FBitmap;
        bdp.ImageStroke = this.FAppearance.FDrawItemImageStroke;
        bdp.ImageStrokeRounding = this.FAppearance.FItemImageRounding;
        bdp.DeflateImageX = 2;
        bdp.DeflateImageY = 2;
        this.DoBeforeDrawListItemImage(AGraphics,AItem,bdp,{get: function () {
            return a;
          }, set: function (v) {
            a = v;
          }},{get: function () {
            return dd;
          }, set: function (v) {
            dd = v;
          }});
        if (a) {
          if (dd) {
            r.$assign(bdp.ImageRect);
            if (bdp.ImageStroke) {
              AGraphics.DrawRoundRectangle$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),Math.round(Math.min(bdp.ImageStrokeRounding,(r.Bottom - r.Top) / 2)),rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
              pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,-bdp.DeflateImageX,-bdp.DeflateImageY);
            };
            AGraphics.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),bdp.Bitmap,true,false,true,false);
          };
          this.DoAfterDrawListItemImage(AGraphics,AItem,bdp);
        };
      };
    };
    this.DrawItems = function (AGraphics, ARect, AItemCollection) {
      var I = 0;
      for (var $l = 0, $end = AItemCollection.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.DrawListItem(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(AItemCollection.GetItemEx(I).FDrawRect),I,AItemCollection.GetItemEx(I));
      };
    };
    this.DrawListItem = function (AGraphics, ARect, AIndex, AItem) {
      var a = false;
      var dd = false;
      var idp = $mod.TTMSFNCEditorListItemDrawingParams.$new();
      if (((ARect.Right - ARect.Left) > 0) && ((ARect.Bottom - ARect.Top) > 0)) {
        if (AItem.FIsSplitter) {
          AGraphics.FStroke.Assign(this.FAppearance.FSplitter);
        } else if (!AItem.FEnabled) {
          AGraphics.FFill.Assign(this.FAppearance.FItemDisabledFill);
          AGraphics.FFont.Assign(this.FAppearance.FItemDisabledFont);
          AGraphics.FStroke.Assign(this.FAppearance.FItemDisabledStroke);
        } else if (AItem.FSelected) {
          AGraphics.FFill.Assign(this.FAppearance.FItemSelectedFill);
          AGraphics.FFont.Assign(this.FAppearance.FItemSelectedFont);
          AGraphics.FStroke.Assign(this.FAppearance.FItemSelectedStroke);
        } else if (AIndex === this.FDownIndex) {
          AGraphics.FFill.Assign(this.FAppearance.FItemDownFill);
          AGraphics.FFont.Assign(this.FAppearance.FItemDownFont);
          AGraphics.FStroke.Assign(this.FAppearance.FItemDownStroke);
        } else if (AIndex === this.FHoverIndex) {
          AGraphics.FFill.Assign(this.FAppearance.FItemHoverFill);
          AGraphics.FFont.Assign(this.FAppearance.FItemHoverFont);
          AGraphics.FStroke.Assign(this.FAppearance.FItemHoverStroke);
        } else {
          AGraphics.FFill.Assign(this.FAppearance.FItemFill);
          AGraphics.FFont.Assign(this.FAppearance.FItemFont);
          AGraphics.FStroke.Assign(this.FAppearance.FItemStroke);
        };
        if (AItem.FSelected && (AItem.FSelectedFontColor !== -1)) {
          AGraphics.FFont.SetColor(AItem.FSelectedFontColor)}
         else if (AItem.FFontColor !== -1) AGraphics.FFont.SetColor(AItem.FFontColor);
        a = true;
        dd = true;
        idp.DrawRect.$assign(AItem.FDrawRect);
        idp.NameRect.$assign(AItem.FNameRect);
        idp.ImageRect.$assign(AItem.FImgRect);
        idp.AccessoryRect.$assign(AItem.FAccessoryRect);
        idp.NoteRect.$assign(AItem.FNoteRect);
        idp.NameText = AItem.FNameText;
        idp.NoteText = AItem.FNoteText;
        idp.ItemRounding = Math.round(Math.min(this.FAppearance.FItemRounding,(AItem.FDrawRect.Bottom - AItem.FDrawRect.Top) / 2));
        this.DoBeforeDrawListItem(AGraphics,AItem,idp,{get: function () {
            return a;
          }, set: function (v) {
            a = v;
          }},{get: function () {
            return dd;
          }, set: function (v) {
            dd = v;
          }});
        if (a) {
          if (dd) {
            if (AItem.FIsSplitter) {
              this.DrawSplitter(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(idp.DrawRect))}
             else {
              AGraphics.DrawRoundRectangle$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(idp.DrawRect),idp.ItemRounding,rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
              if (((idp.ImageRect.Right - idp.ImageRect.Left) > 0) && ((idp.ImageRect.Bottom - idp.ImageRect.Top) > 0)) this.DrawBitmap(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(idp.ImageRect),AItem);
              this.DrawAccessory(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(AItem.FAccessoryRect),AItem);
              this.DrawName(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(idp.NameRect),AItem);
              this.DrawNote(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(idp.NoteRect),AItem);
            };
          };
          this.DoAfterDrawListItem(AGraphics,AItem,$mod.TTMSFNCEditorListItemDrawingParams.$clone(idp));
        };
      };
    };
    this.DrawSplitter = function (AGraphics, ARect) {
      AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Left,ARect.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Right,ARect.Top)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
    };
    this.DrawName = function (AGraphics, ARect, AItem) {
      var accelStart = 0.0;
      var accelWidth = 0.0;
      var tdp = $mod.TTMSFNCEditorListItemTextDrawingParams.$new();
      var a = false;
      var dd = false;
      accelStart = 0;
      accelWidth = 0;
      tdp.DrawRect.$assign(AItem.FNameRect);
      tdp.TextRect.$assign(AItem.FNameTextRect);
      tdp.Text = AItem.FNameText;
      a = true;
      dd = true;
      this.DoBeforeDrawListItemName(AGraphics,AItem,tdp,{get: function () {
          return a;
        }, set: function (v) {
          a = v;
        }},{get: function () {
          return dd;
        }, set: function (v) {
          dd = v;
        }});
      if (a) {
        if (dd) {
          if (((tdp.TextRect.Right - tdp.TextRect.Left) > 0) && ((tdp.TextRect.Bottom - tdp.TextRect.Top) > 0)) {
            if (AItem.FAccelPos > 0) {
              if (AItem.FAccelPos > 1) accelStart = AGraphics.CalculateTextWidth$1(pas.System.Copy(tdp.Text,0,AItem.FAccelPos - 1));
              accelWidth = AGraphics.CalculateTextWidth$1(tdp.Text.charAt(AItem.FAccelPos - 1));
            };
          };
          AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(tdp.TextRect),tdp.Text,false,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,true,false,-1,-1);
          if (AItem.FAccelPos >= 0) {
            AGraphics.FStroke.SetWidth(pas.System.Trunc(this.ScalePaintValue$1(1.0)));
            AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
            AGraphics.FStroke.SetColor(AGraphics.FFont.FColor);
            AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(AItem.FNameTextRect.Left + accelStart,AItem.FNameTextRect.Bottom)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(AItem.FNameTextRect.Left + accelStart + accelWidth,AItem.FNameTextRect.Bottom)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
          };
        };
        this.DoAfterDrawListItemName(AGraphics,AItem,$mod.TTMSFNCEditorListItemTextDrawingParams.$clone(tdp));
      };
    };
    this.DrawNote = function (AGraphics, ARect, AItem) {
      var tdp = $mod.TTMSFNCEditorListItemTextDrawingParams.$new();
      var a = false;
      var dd = false;
      if (this.FDrawNoteText) {
        tdp.DrawRect.$assign(AItem.FNoteRect);
        tdp.TextRect.$assign(AItem.FNoteTextRect);
        if ((AItem.FNoteText === "") && (AItem.FDataString !== "")) {
          tdp.Text = AItem.FDataString}
         else tdp.Text = AItem.FNoteText;
        a = true;
        dd = true;
        this.DoBeforeDrawListItemNote(AGraphics,AItem,tdp,{get: function () {
            return a;
          }, set: function (v) {
            a = v;
          }},{get: function () {
            return dd;
          }, set: function (v) {
            dd = v;
          }});
        if (a) {
          if (dd) AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(tdp.TextRect),tdp.Text,false,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,true,false,-1,-1);
          this.DoAfterDrawListItemNote(AGraphics,AItem,$mod.TTMSFNCEditorListItemTextDrawingParams.$clone(tdp));
        };
      };
    };
    this.SelectItem = function (AIndex) {
      this.UnselectAllItems();
      this.FLastSelectedItemIndex = AIndex;
      this.FKeyIndex = -1;
      if ((AIndex >= 0) && (AIndex < this.FItems.GetCount())) {
        this.FItems.GetItemEx(AIndex).SetSelected(true);
      };
      this.Invalidate();
    };
    this.SelectItemInt = function (AIndex) {
      if ((AIndex >= 0) && (AIndex < this.FItems.GetCount())) {
        this.UnselectAllItems();
        this.FLastSelectedItemIndex = AIndex;
        this.FKeyIndex = -1;
        this.FItems.GetItemEx(AIndex).SetSelected(true);
      };
    };
    this.GetSelectedItems = function () {
      var Result = [];
      var I = 0;
      Result = rtl.arraySetLength(Result,null,0);
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (this.FItems.GetItemEx(I).FSelected) {
          Result = rtl.arraySetLength(Result,null,rtl.length(Result) + 1);
          Result[rtl.length(Result) - 1] = this.FItems.GetItemEx(I);
        };
      };
      return Result;
    };
    this.SetItemAcceleratorKey = function (AIndex) {
      var c = "\x00";
      var posIdx = 0;
      var txt = "";
      if ((AIndex >= 0) && (AIndex < this.FItems.GetCount())) {
        c = "\x00";
        posIdx = -1;
        txt = this.FItems.GetItemEx(AIndex).FName;
        if (this.GetShowAccelChar() && (pas.System.Pos("&",txt) > 0)) {
          if (this.FItems.GetItemEx(AIndex).FEnabled) {
            posIdx = pas.System.Pos("&",txt);
            c = pas.SysUtils.LowerCase(txt).charAt((posIdx + 1) - 1);
          };
          txt = pas.SysUtils.StringReplace(txt,"&","",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
        };
        this.FItems.GetItemEx(AIndex).FNameText = txt;
        this.FAcceleratorList[AIndex] = c;
        this.FItems.GetItemEx(AIndex).FAccelPos = posIdx;
      };
    };
    this.DoItemAccessoryClicked = function (AItem) {
    };
    this.DoItemImageClicked = function (AItem) {
      this.AssignBitmap(AItem);
    };
    this.DoItemClicked = function (AItem, Shift) {
      var sel = false;
      sel = AItem.FSelected;
      if (!(pas.Classes.TShiftState$a.ssCtrl in Shift) || !this.FMultiSelect) this.UnselectAllItems();
      this.FLastSelectedItemIndex = AItem.GetIndex();
      if (!this.FCanUnselectItems) {
        AItem.SetSelected(true)}
       else AItem.SetSelected(!sel);
    };
    this.DoItemTextClicked = function (AItem, AItemRectType, Shift) {
      this.FEditIndex = AItem.GetIndex();
      this.FEditType = AItemRectType;
      if (!(pas.Classes.TShiftState$a.ssCtrl in Shift)) this.UnselectAllItems();
      AItem.SetSelected(true);
      this.StartEditMode();
    };
    this.DoBeforeDrawListItem = function (AGraphics, AItem, AItemDrawingParams, AAllow, ADefaultDraw) {
      if (this.FOnBeforeDrawListItem != null) this.FOnBeforeDrawListItem(this,AGraphics,AItem,AItemDrawingParams,AAllow,ADefaultDraw);
    };
    this.DoAfterDrawListItem = function (AGraphics, AItem, AItemDrawingParams) {
      if (this.FOnAfterDrawListItem != null) this.FOnAfterDrawListItem(this,AGraphics,AItem,$mod.TTMSFNCEditorListItemDrawingParams.$clone(AItemDrawingParams));
    };
    this.DoBeforeDrawListItemName = function (AGraphics, AItem, ATextDrawingParams, AAllow, ADefaultDraw) {
      if (this.FOnBeforeDrawListItemName != null) this.FOnBeforeDrawListItemName(this,AGraphics,AItem,ATextDrawingParams,AAllow,ADefaultDraw);
    };
    this.DoAfterDrawListItemName = function (AGraphics, AItem, ATextDrawingParams) {
      if (this.FOnAfterDrawListItemName != null) this.FOnAfterDrawListItemName(this,AGraphics,AItem,$mod.TTMSFNCEditorListItemTextDrawingParams.$clone(ATextDrawingParams));
    };
    this.DoBeforeDrawListItemNote = function (AGraphics, AItem, ATextDrawingParams, AAllow, ADefaultDraw) {
      if (this.FOnBeforeDrawListItemNote != null) this.FOnBeforeDrawListItemNote(this,AGraphics,AItem,ATextDrawingParams,AAllow,ADefaultDraw);
    };
    this.DoAfterDrawListItemNote = function (AGraphics, AItem, ATextDrawingParams) {
      if (this.FOnAfterDrawListItemNote != null) this.FOnAfterDrawListItemNote(this,AGraphics,AItem,$mod.TTMSFNCEditorListItemTextDrawingParams.$clone(ATextDrawingParams));
    };
    this.DoBeforeDrawListItemImage = function (AGraphics, AItem, AImageDrawingParams, AAllow, ADefaultDraw) {
      if (this.FOnBeforeDrawListItemImage != null) this.FOnBeforeDrawListItemImage(this,AGraphics,AItem,AImageDrawingParams,AAllow,ADefaultDraw);
    };
    this.DoAfterDrawListItemImage = function (AGraphics, AItem, AImageDrawingParams) {
      if (this.FOnAfterDrawListItemImage != null) this.FOnAfterDrawListItemImage(this,AGraphics,AItem,$mod.TTMSFNCEditorListItemImageDrawingParams.$clone(AImageDrawingParams));
    };
    this.DoBeforeDrawListItemAccessory = function (AGraphics, AItem, AAccessoryDrawingParams, AAllow, ADefaultDraw) {
      if (this.FOnBeforeDrawListItemAccessory != null) this.FOnBeforeDrawListItemAccessory(this,AGraphics,AItem,AAccessoryDrawingParams,AAllow,ADefaultDraw);
    };
    this.DoAfterDrawListItemAccessory = function (AGraphics, AItem, AAccessoryDrawingParams) {
      if (this.FOnAfterDrawListItemAccessory != null) this.FOnAfterDrawListItemAccessory(this,AGraphics,AItem,$mod.TTMSFNCEditorListItemAccessoryDrawingParams.$clone(AAccessoryDrawingParams));
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Create$1.apply(this,arguments);
      this.FUpdateBlock = true;
      this.SetShowAccelChar(false);
      this.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
      this.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
      this.FMultiSelect = true;
      this.FCanUnselectItems = true;
      this.FItems = this.CreateItems();
      this.FItems.FOnChanged = rtl.createCallback(this,"DoItemsChanged");
      this.FItemsChanged = false;
      this.FDefaultItemHeight = 60;
      this.FImgMargin = 5;
      this.FImageSize = -1;
      this.FAccessoryWidth = 20;
      this.FHoverIndex = -1;
      this.FDownIndex = -1;
      this.FLastSelectedItemIndex = -1;
      this.FAddItemIndex = -10;
      this.FAddItemRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(-1,-1,-1,-1));
      this.FEdit = pas["WEBLib.StdCtrls"].TEdit.$create("Create$1",[this]);
      this.FEdit.SetParent(this);
      this.FEdit.SetVisible(false);
      this.FEdit.FOnKeyDown = rtl.createCallback(this,"DoEditKeyDown");
      this.FBitmapEditor = pas["WEBLib.TMSFNCBitmapEditor"].TTMSFNCBitmapEditor.$create("Create$1",[this]);
      this.FAppearance = $mod.TTMSFNCEditorListViewAppearance.$create("Create$1",[this]);
      this.FAppearance.FOnChanged = rtl.createCallback(this,"DoAppearanceChanged");
      this.SetWidth(300);
      this.SetHeight(400);
      this.FUpdateBlock = false;
      this.UpdateList();
      return this;
    };
    this.Destroy = function () {
      this.FAcceleratorList = rtl.arraySetLength(this.FAcceleratorList,"\x00",0);
      rtl.free(this,"FAppearance");
      rtl.free(this,"FItems");
      rtl.free(this,"FEdit");
      rtl.free(this,"FBitmapEditor");
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Destroy.call(this);
    };
    this.Assign = function (Source) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Assign.apply(this,arguments);
    };
    this.BeginUpdate = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBase.BeginUpdate.call(this);
      this.FUpdateBlock = true;
    };
    this.EndUpdate = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBase.EndUpdate.call(this);
      this.FUpdateBlock = false;
      this.UpdateList();
    };
    this.GetListHeight = function () {
      var Result = 0;
      var I = 0;
      var s = 0.0;
      s = 0;
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        s = s + this.FItems.GetItemEx(I).FItemHeight;
      };
      Result = Math.round(s);
      return Result;
    };
    this.UpdateList = function () {
      if (!this.FUpdateBlock && !this.FIntUpdateBlock) {
        this.InitializeItems();
        if (this.FItemsChanged) {
          this.FItemsChanged = false;
          this.DoItemsChanged(this);
        };
        this.Invalidate();
      };
    };
    this.UnselectAllItems = function () {
      var I = 0;
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.FItems.GetItemEx(I).FSelected = false;
      };
    };
    this.SelectAllItems = function () {
      var I = 0;
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.FItems.GetItemEx(I).SetSelected(true);
      };
      this.FKeyIndex = -1;
    };
    this.StartEditMode = function () {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (!this.FItemsReadOnly) {
        this.FEditMode = true;
        this.FEdit.FFont.Assign(this.FAppearance.FEditFont);
        if (this.FEditType === $mod.TTMSFNCListEditorItemRectType.eirtName) {
          this.FEdit.SetText(this.FItems.GetItemEx(this.FEditIndex).FName);
          r.$assign(this.FItems.GetItemEx(this.FEditIndex).FNameRect);
        } else if (this.FEditType === $mod.TTMSFNCListEditorItemRectType.eirtNoteText) {
          this.FEdit.SetText(this.FItems.GetItemEx(this.FEditIndex).FNoteText);
          r.$assign(this.FItems.GetItemEx(this.FEditIndex).FNoteRect);
        };
        this.FPrevText = this.FEdit.GetText();
        this.FEdit.SetVisible(true);
        this.FEdit.SetFocus();
        this.FEdit.SetLeft(Math.round(r.Left));
        this.FEdit.SetTop(Math.round(r.Top + ((r.Bottom - r.Top - this.FEdit.GetHeight()) / 2)));
        this.FEdit.SetWidth(Math.round(r.Right - r.Left));
      };
    };
    this.EndEditMode = function (Execute) {
      var I = 0;
      var c = 0;
      var s = "";
      if (!Execute) {
        s = this.FPrevText}
       else s = this.FEdit.GetText();
      if (this.FEditType === $mod.TTMSFNCListEditorItemRectType.eirtName) {
        if (Execute && (this.FPrevText !== this.FEdit.GetText()) && this.MultiSelected()) {
          c = 1;
          this.FItems.GetItemEx(this.FEditIndex).SetName(s + pas.SysUtils.IntToStr(c));
          for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
            I = $l;
            if (this.FItems.GetItemEx(I).FSelected && (I !== this.FEditIndex) && (this.FEditType === $mod.TTMSFNCListEditorItemRectType.eirtName)) {
              c += 1;
              this.FItems.GetItemEx(I).SetName(s + pas.SysUtils.IntToStr(c));
            };
          };
        } else this.FItems.GetItemEx(this.FEditIndex).SetName(s);
      } else if (this.FEditType === $mod.TTMSFNCListEditorItemRectType.eirtNoteText) this.FItems.GetItemEx(this.FEditIndex).SetNoteText(s);
      this.FEditMode = false;
      this.FEdit.SetVisible(false);
      this.FEditIndex = -1;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $mod.$rtti.$DynArray("TTMSFNCEditorListView.FAcceleratorList$a",{eltype: rtl.char});
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
  rtl.createClass(this,"TTMSFNCBitmapEditorListView",this.TTMSFNCEditorListView,function () {
    this.DeleteSelectedItems = function () {
      $mod.TTMSFNCEditorListView.DeleteSelectedItems.call(this);
    };
    this.SelectItem = function (AIndex) {
      $mod.TTMSFNCEditorListView.SelectItem.apply(this,arguments);
    };
    this.GetSelectedItems = function () {
      var Result = [];
      Result = $mod.TTMSFNCEditorListView.GetSelectedItems.call(this);
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("DrawNoteText",2,rtl.boolean,"FDrawNoteText","SetDrawNoteText",4,{Default: false});
    $r.addProperty("Appearance",2,$mod.$rtti["TTMSFNCEditorListViewAppearance"],"FAppearance","SetAppearance");
    $r.addProperty("Items",3,$mod.$rtti["TTMSFNCEditorListCollection"],"GetItems","SetItems");
    $r.addProperty("DefaultItemHeight",14,rtl.double,"FDefaultItemHeight","SetDefaultItemHeight",4,{stored: "IsDefaultItemHeightStored"});
    $r.addProperty("ItemsReadOnly",2,rtl.boolean,"FItemsReadOnly","SetItemsReadOnly",4,{Default: false});
    $r.addProperty("OnAddNewItem",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnAddNewItem","FOnAddNewItem");
    $r.addProperty("OnItemsChanged",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnItemsChanged","FOnItemsChanged");
    $r.addProperty("OnDoubleClickItem",0,$mod.$rtti["TTMSFNCEditorListOnDoubleClickEditorListItem"],"FOnDoubleClickItem","FOnDoubleClickItem");
    $r.addProperty("OnItemSelectedChanged",0,$mod.$rtti["TTMSFNCEditorListOnSelectItemChanged"],"FOnItemSelectedChanged","FOnItemSelectedChanged");
  });
  rtl.createClass(this,"TTMSFNCEditorList",this.TTMSFNCEditorListView,function () {
    this.SetItemImageRect = function (AIndex) {
      this.FItems.GetItemEx(AIndex).FImgRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,-1,4,-1));
    };
    this.Create$1 = function (AOwner) {
      $mod.TTMSFNCEditorListView.Create$1.apply(this,arguments);
      this.FImageSize = 0;
      return this;
    };
    this.GetSelectedItems = function () {
      var Result = [];
      Result = $mod.TTMSFNCEditorListView.GetSelectedItems.call(this);
      return Result;
    };
    this.SelectItem = function (AIndex) {
      $mod.TTMSFNCEditorListView.SelectItem.apply(this,arguments);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("DrawNoteText",2,rtl.boolean,"FDrawNoteText","SetDrawNoteText",4,{Default: false});
    $r.addProperty("DrawDataString",2,rtl.boolean,"FDrawNoteText","SetDrawNoteText",4,{Default: false});
    $r.addProperty("Appearance",2,$mod.$rtti["TTMSFNCEditorListViewAppearance"],"FAppearance","SetAppearance");
    $r.addProperty("Items",3,$mod.$rtti["TTMSFNCEditorListCollection"],"GetItems","SetItems");
    $r.addProperty("DefaultItemHeight",14,rtl.double,"FDefaultItemHeight","SetDefaultItemHeight",4,{stored: "IsDefaultItemHeightStored"});
    $r.addProperty("ItemsReadOnly",2,rtl.boolean,"FItemsReadOnly","SetItemsReadOnly",4,{Default: false});
    $r.addProperty("LastSelectedItemIndex",0,rtl.longint,"FLastSelectedItemIndex","",4,{Default: -1});
    $r.addProperty("MultiSelect",2,rtl.boolean,"FMultiSelect","SetMultiSelect",4,{Default: true});
    $r.addProperty("CanUnselectItems",0,rtl.boolean,"FCanUnselectItems","FCanUnselectItems",4,{Default: true});
    $r.addProperty("OnAddNewItem",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnAddNewItem","FOnAddNewItem");
    $r.addProperty("OnItemsChanged",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnItemsChanged","FOnItemsChanged");
    $r.addProperty("OnDoubleClickItem",0,$mod.$rtti["TTMSFNCEditorListOnDoubleClickEditorListItem"],"FOnDoubleClickItem","FOnDoubleClickItem");
    $r.addProperty("OnItemSelectedChanged",0,$mod.$rtti["TTMSFNCEditorListOnSelectItemChanged"],"FOnItemSelectedChanged","FOnItemSelectedChanged");
  });
},["TypInfo","SysUtils","WEBLib.TMSFNCUtils","Math","WEBLib.Graphics","WEBLib.TMSFNCBitmapContainer","WEBLib.TMSFNCURLBitmapContainer"]);
rtl.module("WEBLib.DB",["System","Classes","DB","JSONDataset"],function () {
  "use strict";
  var $mod = this;
  rtl.createClass(this,"TWebDataSource",pas.DB.TDataSource,function () {
    rtl.addIntf(this,pas.System.IUnknown);
  });
});
rtl.module("WEBLib.TMSFNCDataBindingEditor",["System","Classes","WEBLib.TMSFNCCustomComponent","WEBLib.TMSFNCDataBinding","WEBLib.TMSFNCCustomControl","WEBLib.Controls","WEBLib.TMSFNCTypes","WEBLib.StdCtrls","WEBLib.Graphics","WEBLib.ExtCtrls","WEBLib.Forms","WEBLib.TMSFNCGraphics","WEBLib.TMSFNCGraphicsTypes","WEBLib.TMSFNCEditorButton","WEBLib.TMSFNCEditorPanel","WEBLib.TMSFNCEditorListView","Types"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.$rtti.$Class("TTMSFNCDataBindingEditor");
  rtl.createClass(this,"TTMSFNCDataBindingEditorComboBox",pas["WEBLib.StdCtrls"].TComboBox,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCDataBindingEditorComboBoxSub",pas["WEBLib.StdCtrls"].TComboBox,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.$rtti.$DynArray("TTMSFNCDataBindingTRectFArray",{eltype: pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]});
  this.$rtti.$DynArray("TTMSFNCDataBindingStringArray",{eltype: rtl.string});
  this.$rtti.$DynArray("TTMSFNCDataBindingTComboArray",{eltype: this.$rtti["TTMSFNCDataBindingEditorComboBoxSub"]});
  rtl.recNewT(this,"TTMSFNCDataBindingEditorBuildItem",function () {
    this.BindComponentText = "";
    this.FieldNameText = "";
    this.PropertyNameText = "";
    this.ColumnsPropertyNameText = "";
    this.ColumnsSubPropertyNameText = "";
    this.Item = null;
    this.$new = function () {
      var r = Object.create(this);
      r.BindComponentRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.FieldNameRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.PropertyNameRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.ColumnsPropertyNameRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.ColumnsSubPropertyNameRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.SubPropertyNamesRects = [];
      r.SubFieldNamesRects = [];
      r.SubPropertyNamesTexts = [];
      r.SubFieldNamesTexts = [];
      r.SubPropertyNamesCombos = [];
      r.SubFieldNamesCombos = [];
      return r;
    };
    this.$eq = function (b) {
      return this.BindComponentRect.$eq(b.BindComponentRect) && (this.BindComponentText === b.BindComponentText) && this.FieldNameRect.$eq(b.FieldNameRect) && (this.FieldNameText === b.FieldNameText) && this.PropertyNameRect.$eq(b.PropertyNameRect) && (this.PropertyNameText === b.PropertyNameText) && this.ColumnsPropertyNameRect.$eq(b.ColumnsPropertyNameRect) && (this.ColumnsPropertyNameText === b.ColumnsPropertyNameText) && this.ColumnsSubPropertyNameRect.$eq(b.ColumnsSubPropertyNameRect) && (this.ColumnsSubPropertyNameText === b.ColumnsSubPropertyNameText) && (this.Item === b.Item) && (this.SubPropertyNamesRects === b.SubPropertyNamesRects) && (this.SubFieldNamesRects === b.SubFieldNamesRects) && (this.SubPropertyNamesTexts === b.SubPropertyNamesTexts) && (this.SubFieldNamesTexts === b.SubFieldNamesTexts) && (this.SubPropertyNamesCombos === b.SubPropertyNamesCombos) && (this.SubFieldNamesCombos === b.SubFieldNamesCombos);
    };
    this.$assign = function (s) {
      this.BindComponentRect.$assign(s.BindComponentRect);
      this.BindComponentText = s.BindComponentText;
      this.FieldNameRect.$assign(s.FieldNameRect);
      this.FieldNameText = s.FieldNameText;
      this.PropertyNameRect.$assign(s.PropertyNameRect);
      this.PropertyNameText = s.PropertyNameText;
      this.ColumnsPropertyNameRect.$assign(s.ColumnsPropertyNameRect);
      this.ColumnsPropertyNameText = s.ColumnsPropertyNameText;
      this.ColumnsSubPropertyNameRect.$assign(s.ColumnsSubPropertyNameRect);
      this.ColumnsSubPropertyNameText = s.ColumnsSubPropertyNameText;
      this.Item = s.Item;
      this.SubPropertyNamesRects = rtl.arrayRef(s.SubPropertyNamesRects);
      this.SubFieldNamesRects = rtl.arrayRef(s.SubFieldNamesRects);
      this.SubPropertyNamesTexts = rtl.arrayRef(s.SubPropertyNamesTexts);
      this.SubFieldNamesTexts = rtl.arrayRef(s.SubFieldNamesTexts);
      this.SubPropertyNamesCombos = rtl.arrayRef(s.SubPropertyNamesCombos);
      this.SubFieldNamesCombos = rtl.arrayRef(s.SubFieldNamesCombos);
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCDataBindingEditorBuildItem",{},this);
    $r.addField("BindComponentRect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]);
    $r.addField("BindComponentText",rtl.string);
    $r.addField("FieldNameRect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]);
    $r.addField("FieldNameText",rtl.string);
    $r.addField("PropertyNameRect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]);
    $r.addField("PropertyNameText",rtl.string);
    $r.addField("ColumnsPropertyNameRect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]);
    $r.addField("ColumnsPropertyNameText",rtl.string);
    $r.addField("ColumnsSubPropertyNameRect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]);
    $r.addField("ColumnsSubPropertyNameText",rtl.string);
    $r.addField("Item",pas["WEBLib.TMSFNCDataBinding"].$rtti["TTMSFNCDataBinderItem"]);
    $r.addField("SubPropertyNamesRects",$mod.$rtti["TTMSFNCDataBindingTRectFArray"]);
    $r.addField("SubFieldNamesRects",$mod.$rtti["TTMSFNCDataBindingTRectFArray"]);
    $r.addField("SubPropertyNamesTexts",$mod.$rtti["TTMSFNCDataBindingStringArray"]);
    $r.addField("SubFieldNamesTexts",$mod.$rtti["TTMSFNCDataBindingStringArray"]);
    $r.addField("SubPropertyNamesCombos",$mod.$rtti["TTMSFNCDataBindingTComboArray"]);
    $r.addField("SubFieldNamesCombos",$mod.$rtti["TTMSFNCDataBindingTComboArray"]);
  });
  this.TTMSFNCDataBindingEditorMode = {"0": "dbemView", dbemView: 0, "1": "dbemEdit", dbemEdit: 1};
  this.$rtti.$Enum("TTMSFNCDataBindingEditorMode",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCDataBindingEditorMode});
  rtl.createClass(this,"TTMSFNCDataBindingEditor",pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.$init.call(this);
      this.FCachedComponentScreenShot = null;
      this.FBlockUpdate = false;
      this.FBlockChange = false;
      this.FMode = 0;
      this.FBuildItem = $mod.TTMSFNCDataBindingEditorBuildItem.$new();
      this.FListBox = null;
      this.frm = null;
      this.FPanel = null;
      this.FTopPanel = null;
      this.FButtonOk = null;
      this.FButtonCancel = null;
      this.FButtonEdit = null;
      this.FButtonDelete = null;
      this.FButtonAdd = null;
      this.FButtonDuplicate = null;
      this.FVScrlBox = null;
      this.FPreview = null;
      this.FDataBinder = null;
      this.FCheckBoxActive = null;
      this.FComboBoxBindType = null;
      this.FComboboxBindComponent = null;
      this.FComboBoxFieldName = null;
      this.FComboBoxPropertyName = null;
      this.FComboBoxColumnsPropertyName = null;
      this.FComboBoxColumnsSubPropertyName = null;
      this.FComboBoxDataSource = null;
      this.FSubAdd = null;
      this.FSubDelete = null;
      this.FObject = null;
      this.FComponentEvent = null;
    };
    this.$final = function () {
      this.FCachedComponentScreenShot = undefined;
      this.FBuildItem = undefined;
      this.FListBox = undefined;
      this.frm = undefined;
      this.FPanel = undefined;
      this.FTopPanel = undefined;
      this.FButtonOk = undefined;
      this.FButtonCancel = undefined;
      this.FButtonEdit = undefined;
      this.FButtonDelete = undefined;
      this.FButtonAdd = undefined;
      this.FButtonDuplicate = undefined;
      this.FVScrlBox = undefined;
      this.FPreview = undefined;
      this.FDataBinder = undefined;
      this.FCheckBoxActive = undefined;
      this.FComboBoxBindType = undefined;
      this.FComboboxBindComponent = undefined;
      this.FComboBoxFieldName = undefined;
      this.FComboBoxPropertyName = undefined;
      this.FComboBoxColumnsPropertyName = undefined;
      this.FComboBoxColumnsSubPropertyName = undefined;
      this.FComboBoxDataSource = undefined;
      this.FSubAdd = undefined;
      this.FSubDelete = undefined;
      this.FObject = undefined;
      this.FComponentEvent = undefined;
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.$final.call(this);
    };
    this.GetInstance = function () {
      var Result = 0;
      Result = pas["WEBLib.TMSFNCTypes"].HInstance();
      return Result;
    };
    this.RegisterRuntimeClasses = function () {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClass($mod.TTMSFNCDataBindingEditor);
    };
    this.MakeComponentScreenShot = function () {
      if (this.FCachedComponentScreenShot != null) {
        rtl.free(this,"FCachedComponentScreenShot");
        this.FCachedComponentScreenShot = null;
      };
      if ((this.FBuildItem.Item != null) && (this.FBuildItem.Item.GetObject() != null) && pas["WEBLib.Controls"].TControl.isPrototypeOf(this.FBuildItem.Item.GetObject())) {
        if (pas["WEBLib.Controls"].TCustomControl.isPrototypeOf(this.FBuildItem.Item.GetObject())) {
          this.FComponentEvent = rtl.as(this.FBuildItem.Item.GetObject(),pas["WEBLib.Controls"].TCustomControl).FOnScreenShot;
          rtl.as(this.FBuildItem.Item.GetObject(),pas["WEBLib.Controls"].TCustomControl).FOnScreenShot = rtl.createCallback(this,"DoScreenShot");
        };
        this.FCachedComponentScreenShot = rtl.as(this.FBuildItem.Item.GetObject(),pas["WEBLib.Controls"].TControl).MakeScreenshot();
      };
    };
    this.DoScreenShot = function (Sender, ABitmap) {
      if (pas["WEBLib.Controls"].TCustomControl.isPrototypeOf(Sender)) rtl.as(Sender,pas["WEBLib.Controls"].TCustomControl).FOnScreenShot = this.FComponentEvent;
      if (this.FPreview != null) this.FPreview.Invalidate();
    };
    this.Notification = function (AComponent, AOperation) {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.Notification.apply(this,arguments);
      if (AOperation === pas.Classes.TOperation.opRemove) {
        if (AComponent === this.FDataBinder) this.FDataBinder = null;
        if (AComponent === this.FObject) this.FObject = null;
      };
    };
    this.BuildEditor = function (AParent) {
      var sl = null;
      var I = 0;
      if (AParent != null) {
        this.FTopPanel = pas["WEBLib.TMSFNCEditorPanel"].TTMSFNCEditorPanel.$create("Create$1",[AParent]);
        this.FTopPanel.SetAlign(pas["WEBLib.Controls"].TAlign.alTop);
        this.FTopPanel.SetTop(0);
        this.FTopPanel.SetParent(AParent);
        this.FTopPanel.SetHeight(37);
        this.FTopPanel.SetPanelPosition(pas["WEBLib.TMSFNCEditorPanel"].TTMSFNCEditorPanelPosition.eppTop);
        pas["WEBLib.TMSFNCEditorsTools"].SetEditorBackPanelAppearance(this.FTopPanel,-1,-1,5);
        this.FButtonEdit = pas["WEBLib.TMSFNCEditorButton"].TTMSFNCEditorButton.$create("Create$1",[this.FTopPanel]);
        this.FButtonEdit.SetParent(this.FTopPanel);
        this.FButtonEdit.SetText($impl.TranslateTextEx(rtl.getResStr($mod,"sTMSFNCDataBindingEditorEditMode")));
        this.FButtonEdit.SetAlign(pas["WEBLib.Controls"].TAlign.alRight);
        this.FButtonEdit.SetAlignWithMargins(true);
        this.FButtonEdit.FMargins.SetRight(5);
        this.FButtonEdit.FMargins.SetTop(5);
        this.FButtonEdit.FMargins.SetBottom(5);
        this.FButtonEdit.FMargins.SetLeft(5);
        this.FButtonEdit.FOnClick = rtl.createCallback(this,"DoEdit");
        this.FButtonEdit.SetWidth(100);
        this.FButtonEdit.SetToggle(true);
        this.FButtonEdit.SetEnabled(false);
        pas["WEBLib.TMSFNCEditorsTools"].SetEditorTabButtonAppearance(this.FButtonEdit,12482304,5,-1,-1);
        this.FButtonAdd = pas["WEBLib.TMSFNCEditorButton"].TTMSFNCEditorButton.$create("Create$1",[this.FTopPanel]);
        this.FButtonAdd.SetParent(this.FTopPanel);
        this.FButtonAdd.SetWidth(50);
        this.FButtonAdd.SetText($impl.TranslateTextEx(rtl.getResStr($mod,"sTMSFNCDataBindingEditorAdd")));
        this.FButtonAdd.SetAlignWithMargins(true);
        this.FButtonAdd.FMargins.SetRight(5);
        this.FButtonAdd.FMargins.SetTop(5);
        this.FButtonAdd.FMargins.SetBottom(5);
        this.FButtonAdd.FMargins.SetLeft(5);
        this.FButtonAdd.FOnClick = rtl.createCallback(this,"DoAdd");
        pas["WEBLib.TMSFNCEditorsTools"].SetEditorIconButtonAppearance(this.FButtonAdd,12482304,5,-1,-1);
        this.FButtonAdd.FAppearance.FFont.SetStyle(rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsBold));
        this.FButtonDelete = pas["WEBLib.TMSFNCEditorButton"].TTMSFNCEditorButton.$create("Create$1",[this.FTopPanel]);
        this.FButtonDelete.SetParent(this.FTopPanel);
        this.FButtonDelete.SetWidth(50);
        this.FButtonDelete.SetText($impl.TranslateTextEx(rtl.getResStr($mod,"sTMSFNCDataBindingEditorDelete")));
        this.FButtonDelete.SetAlignWithMargins(true);
        this.FButtonDelete.FMargins.SetRight(5);
        this.FButtonDelete.FMargins.SetTop(5);
        this.FButtonDelete.FMargins.SetBottom(5);
        this.FButtonDelete.FMargins.SetLeft(0);
        this.FButtonDelete.FOnClick = rtl.createCallback(this,"DoDelete");
        pas["WEBLib.TMSFNCEditorsTools"].SetEditorIconButtonAppearance(this.FButtonDelete,12482304,5,-1,-1);
        this.FButtonDelete.FAppearance.FFont.SetStyle(rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsBold));
        this.FButtonDuplicate = pas["WEBLib.TMSFNCEditorButton"].TTMSFNCEditorButton.$create("Create$1",[this.FTopPanel]);
        this.FButtonDuplicate.SetParent(this.FTopPanel);
        this.FButtonDuplicate.SetWidth(75);
        this.FButtonDuplicate.SetText($impl.TranslateTextEx(rtl.getResStr($mod,"sTMSFNCDataBindingEditorDuplicate")));
        this.FButtonDuplicate.SetAlignWithMargins(true);
        this.FButtonDuplicate.FMargins.SetRight(5);
        this.FButtonDuplicate.FMargins.SetTop(5);
        this.FButtonDuplicate.FMargins.SetBottom(5);
        this.FButtonDuplicate.FMargins.SetLeft(0);
        this.FButtonDuplicate.FOnClick = rtl.createCallback(this,"DoDuplicate");
        pas["WEBLib.TMSFNCEditorsTools"].SetEditorIconButtonAppearance(this.FButtonDuplicate,12482304,5,-1,-1);
        this.FButtonDuplicate.FAppearance.FFont.SetStyle(rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsBold));
        this.FButtonAdd.SetAlign(pas["WEBLib.Controls"].TAlign.alLeft);
        this.FButtonDelete.SetAlign(pas["WEBLib.Controls"].TAlign.alLeft);
        this.FButtonDuplicate.SetAlign(pas["WEBLib.Controls"].TAlign.alLeft);
        this.FVScrlBox = pas["WEBLib.ExtCtrls"].TScrollBox.$create("Create$1",[AParent]);
        this.FVScrlBox.SetAlign(pas["WEBLib.Controls"].TAlign.alLeft);
        this.FVScrlBox.SetTop(0);
        this.FVScrlBox.SetParent(AParent);
        this.FVScrlBox.SetWidth(300);
        this.FVScrlBox.SetBorderStyle(pas["WEBLib.Controls"].TBorderStyle.bsNone);
        if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
          this.FVScrlBox.SetColor(16119285)}
         else this.FVScrlBox.SetColor(4406846);
        this.FListBox = pas["WEBLib.TMSFNCEditorListView"].TTMSFNCEditorList.$create("Create$1",[this.FVScrlBox]);
        this.FListBox.SetParent(this.FVScrlBox);
        this.FListBox.SetAlign(pas["WEBLib.Controls"].TAlign.alTop);
        this.FListBox.SetMultiSelect(false);
        this.FListBox.SetDefaultItemHeight(28);
        pas["WEBLib.TMSFNCEditorsTools"].SetEditorListAppearance(this.FListBox,12482304,5,-1,-1);
        this.FListBox.SetItemsReadOnly(true);
        this.FListBox.FOnItemSelectedChanged = rtl.createCallback(this,"DoListBoxItemSelectedChange");
        this.FPreview = pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$create("Create$1",[AParent]);
        this.FPreview.SetParent(AParent);
        this.FPreview.SetControlAlignment(pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlAlignment.caClient);
        this.FPreview.DisableBackground();
        if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
          this.FPreview.SetColor(16119285)}
         else this.FPreview.SetColor(4406846);
        this.FPreview.FOnAfterDraw = rtl.createCallback(this,"DoAfterDraw");
        this.FPanel = pas["WEBLib.TMSFNCEditorPanel"].TTMSFNCEditorPanel.$create("Create$1",[AParent]);
        this.FPanel.SetAlign(pas["WEBLib.Controls"].TAlign.alBottom);
        this.FPanel.SetHeight(37);
        this.FPanel.SetParent(AParent);
        this.FPanel.SetPanelPosition(pas["WEBLib.TMSFNCEditorPanel"].TTMSFNCEditorPanelPosition.eppBottom);
        pas["WEBLib.TMSFNCEditorsTools"].SetEditorBackPanelAppearance(this.FPanel,-1,-1,5);
        this.FButtonCancel = pas["WEBLib.TMSFNCEditorButton"].TTMSFNCEditorButton.$create("Create$1",[this.FPanel]);
        this.FButtonCancel.FModalResult = 2;
        this.FButtonCancel.SetParent(this.FPanel);
        this.FButtonCancel.SetText($impl.TranslateTextEx(rtl.getResStr($mod,"sTMSFNCDataBindingEditorCancel")));
        this.FButtonCancel.SetAlign(pas["WEBLib.Controls"].TAlign.alRight);
        this.FButtonCancel.SetLeft(100);
        this.FButtonCancel.SetAlignWithMargins(true);
        this.FButtonCancel.FMargins.SetRight(5);
        this.FButtonCancel.FMargins.SetTop(5);
        this.FButtonCancel.FMargins.SetBottom(5);
        this.FButtonCancel.FMargins.SetLeft(5);
        this.FButtonCancel.FOnClick = rtl.createCallback(this,"DoButtonCancelClick");
        pas["WEBLib.TMSFNCEditorsTools"].SetEditorCancelButtonAppearance(this.FButtonCancel,12482304,5,-1,-1);
        this.FButtonOk = pas["WEBLib.TMSFNCEditorButton"].TTMSFNCEditorButton.$create("Create$1",[this.FPanel]);
        this.FButtonOk.FModalResult = 1;
        this.FButtonOk.SetParent(this.FPanel);
        this.FButtonOk.SetText($impl.TranslateTextEx(rtl.getResStr($mod,"sTMSFNCDataBindingEditorOK")));
        this.FButtonOk.SetAlign(pas["WEBLib.Controls"].TAlign.alRight);
        this.FButtonOk.SetLeft(99);
        this.FButtonOk.SetAlignWithMargins(true);
        this.FButtonOk.FMargins.SetRight(0);
        this.FButtonOk.FMargins.SetTop(5);
        this.FButtonOk.FMargins.SetBottom(5);
        this.FButtonOk.FMargins.SetLeft(5);
        this.FButtonOk.FOnClick = rtl.createCallback(this,"DoButtonOKClick");
        pas["WEBLib.TMSFNCEditorsTools"].SetEditorOKButtonAppearance(this.FButtonOk,12482304,5,16777215);
        this.FComboBoxBindType = pas["WEBLib.StdCtrls"].TComboBox.$create("Create$1",[AParent]);
        this.FComboBoxBindType.SetParent(AParent);
        this.FComboBoxBindType.SetStyle(pas["WEBLib.StdCtrls"].TComboBoxStyle.csDropDownList);
        this.FComboBoxBindType.FItems.Add("Single Value");
        this.FComboBoxBindType.FItems.Add("List");
        this.FComboBoxBindType.FItems.Add("Column List");
        this.FComboBoxBindType.FItems.Add("Grid");
        this.FComboBoxBindType.FOnChange = rtl.createCallback(this,"DoBindTypeChanged");
        this.FComboBoxDataSource = pas["WEBLib.StdCtrls"].TComboBox.$create("Create$1",[AParent]);
        this.FComboBoxDataSource.SetParent(AParent);
        sl = pas.Classes.TStringList.$create("Create$1");
        try {
          if (this.FDataBinder != null) this.FDataBinder.GetDataSources(sl);
          sl.Insert(0,"");
          this.FComboBoxDataSource.FItems.Assign(sl);
        } finally {
          sl = rtl.freeLoc(sl);
        };
        this.FComboBoxDataSource.SetStyle(pas["WEBLib.StdCtrls"].TComboBoxStyle.csDropDownList);
        this.FComboBoxDataSource.FOnChange = rtl.createCallback(this,"DoDataSourceChanged");
        this.FCheckBoxActive = pas["WEBLib.StdCtrls"].TCheckBox.$create("Create$1",[AParent]);
        this.FCheckBoxActive.SetParent(AParent);
        this.FCheckBoxActive.SetCaption($impl.TranslateTextEx(rtl.getResStr($mod,"sTMSFNCDataBindingEditorActive")));
        this.FCheckBoxActive.FOnClick = rtl.createCallback(this,"DoActiveChanged");
        if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
          this.FCheckBoxActive.FFont.SetColor(5592405)}
         else this.FCheckBoxActive.FFont.SetColor(11184810);
        pas["WEBLib.TMSFNCEditorsTools"].SetEditorCheckBoxAppearance(this.FCheckBoxActive,-1);
        this.FCheckBoxActive.SetWidth(60);
        this.FComboBoxFieldName = $mod.TTMSFNCDataBindingEditorComboBox.$create("Create$1",[AParent]);
        this.FComboBoxFieldName.FOnChange = rtl.createCallback(this,"DoFieldNameChanged");
        this.FComboBoxPropertyName = $mod.TTMSFNCDataBindingEditorComboBox.$create("Create$1",[AParent]);
        this.FComboBoxPropertyName.FOnChange = rtl.createCallback(this,"DoPropertyNameChanged");
        this.FComboBoxColumnsPropertyName = $mod.TTMSFNCDataBindingEditorComboBox.$create("Create$1",[AParent]);
        this.FComboBoxColumnsPropertyName.FOnChange = rtl.createCallback(this,"DoColumnsPropertyNameChanged");
        this.FComboBoxColumnsSubPropertyName = $mod.TTMSFNCDataBindingEditorComboBox.$create("Create$1",[AParent]);
        this.FComboBoxColumnsSubPropertyName.FOnChange = rtl.createCallback(this,"DoColumnsSubPropertyNameChanged");
        this.FComboBoxPropertyName = $mod.TTMSFNCDataBindingEditorComboBox.$create("Create$1",[AParent]);
        this.FComboBoxPropertyName.FOnChange = rtl.createCallback(this,"DoPropertyNameChanged");
        this.FComboboxBindComponent = pas["WEBLib.StdCtrls"].TComboBox.$create("Create$1",[AParent]);
        this.FComboboxBindComponent.FOnChange = rtl.createCallback(this,"DoBindComponentChanged");
        this.FComboboxBindComponent.SetStyle(pas["WEBLib.StdCtrls"].TComboBoxStyle.csDropDownList);
        this.FSubAdd = pas["WEBLib.TMSFNCEditorButton"].TTMSFNCEditorButton.$create("Create$1",[this.FPreview]);
        this.FSubAdd.SetWidth(30);
        this.FSubAdd.SetText($impl.TranslateTextEx(rtl.getResStr($mod,"sTMSFNCDataBindingEditorAdd")));
        this.FSubAdd.FOnClick = rtl.createCallback(this,"DoSubAdd");
        pas["WEBLib.TMSFNCEditorsTools"].SetEditorIconButtonAppearance(this.FSubAdd,12482304,5,-1,-1);
        this.FSubAdd.FAppearance.FFont.SetStyle(rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsBold));
        this.FSubDelete = pas["WEBLib.TMSFNCEditorButton"].TTMSFNCEditorButton.$create("Create$1",[this.FPreview]);
        this.FSubDelete.SetWidth(30);
        this.FSubDelete.SetText($impl.TranslateTextEx(rtl.getResStr($mod,"sTMSFNCDataBindingEditorDelete")));
        this.FSubDelete.FOnClick = rtl.createCallback(this,"DoSubDelete");
        pas["WEBLib.TMSFNCEditorsTools"].SetEditorIconButtonAppearance(this.FSubDelete,12482304,5,-1,-1);
        this.FSubDelete.FAppearance.FFont.SetStyle(rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsBold));
        this.FillControls();
        this.FBlockUpdate = true;
        if (this.FListBox.GetItems().GetCount() > 0) {
          for (var $l = 0, $end = this.FListBox.GetItems().GetCount() - 1; $l <= $end; $l++) {
            I = $l;
            if (this.FListBox.GetItems().GetItemEx(I).FDataObject.GetObject() === this.FObject) {
              this.FListBox.SelectItem(I);
              break;
            };
          };
        };
        this.FBlockUpdate = false;
        this.BuildItem(true);
      };
    };
    this.BuildItem = function (AUpdate) {
      var x = 0.0;
      var xm = 0.0;
      var y = 0.0;
      var sc = 0.0;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rt = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var str = "";
      var it = null;
      var g = null;
      var fa = [];
      var pa = [];
      var fb = [];
      var pb = [];
      var fc = [];
      var pc = [];
      var I = 0;
      var cbo = null;
      this.FBuildItem.BindComponentRect.$assign(pas["WEBLib.TMSFNCTypes"].EmptyRect());
      this.FBuildItem.BindComponentText = "";
      this.FBuildItem.FieldNameRect.$assign(pas["WEBLib.TMSFNCTypes"].EmptyRect());
      this.FBuildItem.FieldNameText = "";
      this.FBuildItem.PropertyNameRect.$assign(pas["WEBLib.TMSFNCTypes"].EmptyRect());
      this.FBuildItem.PropertyNameText = "";
      this.FBuildItem.ColumnsPropertyNameRect.$assign(pas["WEBLib.TMSFNCTypes"].EmptyRect());
      this.FBuildItem.ColumnsPropertyNameText = "";
      this.FBuildItem.ColumnsSubPropertyNameRect.$assign(pas["WEBLib.TMSFNCTypes"].EmptyRect());
      this.FBuildItem.ColumnsSubPropertyNameText = "";
      if (AUpdate) {
        fa = rtl.arraySetLength(fa,pas["WEBLib.TMSFNCTypes"].TRectF,0);
        fb = rtl.arraySetLength(fb,"",0);
        fc = rtl.arraySetLength(fc,null,0);
        pa = rtl.arraySetLength(pa,pas["WEBLib.TMSFNCTypes"].TRectF,0);
        pb = rtl.arraySetLength(pb,"",0);
        pc = rtl.arraySetLength(pc,null,0);
        this.FBuildItem.SubPropertyNamesRects = rtl.arrayRef(pa);
        this.FBuildItem.SubPropertyNamesTexts = rtl.arrayRef(pb);
        this.FBuildItem.SubPropertyNamesCombos = rtl.arrayRef(pc);
        this.FBuildItem.SubFieldNamesRects = rtl.arrayRef(fa);
        this.FBuildItem.SubFieldNamesTexts = rtl.arrayRef(fb);
        this.FBuildItem.SubFieldNamesCombos = rtl.arrayRef(fc);
      };
      this.FBuildItem.Item = null;
      if (AUpdate) {
        for (var $l = this.FPreview.GetComponentCount() - 1; $l >= 0; $l--) {
          I = $l;
          if ($mod.TTMSFNCDataBindingEditorComboBoxSub.isPrototypeOf(this.FPreview.GetComponent(I))) {
            cbo = this.FPreview.GetComponent(I);
            cbo = rtl.freeLoc(cbo);
          };
        };
      };
      if ((this.FListBox.FLastSelectedItemIndex >= 0) && (this.FListBox.FLastSelectedItemIndex <= (this.FListBox.GetItems().GetCount() - 1))) {
        it = this.FListBox.GetItems().GetItemEx(this.FListBox.FLastSelectedItemIndex).FDataObject;
        this.FCheckBoxActive.SetChecked(it.FActive);
        this.FBlockChange = true;
        this.FComboBoxBindType.SetItemIndex(it.FBindType);
        this.FComboBoxDataSource.SetItemIndex(this.FComboBoxDataSource.FItems.IndexOfObject(it.GetDataSource()));
        this.FBlockChange = false;
        g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[1,1,false,true]);
        g.BeginScene();
        try {
          if (this.frm != null) {
            sc = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetDPIScale(this.frm,96)}
           else sc = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetDPIScale(this,96);
          g.FFont.SetHeight(Math.round(sc * -11));
          if (it.GetObject() != null) {
            if (pas.Classes.TComponent.isPrototypeOf(it.GetObject()) && (rtl.as(it.GetObject(),pas.Classes.TComponent).FName !== "")) {
              str = "Bind component: " + rtl.as(it.GetObject(),pas.Classes.TComponent).FName}
             else str = "Bind component: " + it.GetObject().$classname;
          } else str = "Bind component not assigned!";
          x = 20;
          y = 10;
          r.$assign(g.CalculateText(str,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,400,10000)),true,false));
          rt.$assign(pas["WEBLib.TMSFNCTypes"].RectF(x,y,x + (r.Right - r.Left) + 6,y + (r.Bottom - r.Top) + 6));
          this.FBuildItem.BindComponentRect.$assign(rt);
          this.FBuildItem.BindComponentText = str;
          this.FBuildItem.Item = it;
          if (it.FBindType !== pas["WEBLib.TMSFNCDataBinding"].TTMSFNCDataBinderBindType.dbbtGrid) {
            y = y + 40;
            x = x + 40;
            if (it.FFieldName !== "") {
              str = "Field name: " + it.FFieldName}
             else if (it.FHTMLTemplate !== "") {
              str = "HTML template: " + it.FHTMLTemplate}
             else str = "Field name: " + "[Not bound]";
            r.$assign(g.CalculateText(str,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,400,10000)),true,false));
            rt.$assign(pas["WEBLib.TMSFNCTypes"].RectF(x,y,x + (r.Right - r.Left) + 6,y + (r.Bottom - r.Top) + 6));
            this.FBuildItem.FieldNameRect.$assign(rt);
            this.FBuildItem.FieldNameText = str;
            if (it.FColumnsPropertyName !== "") {
              str = "Columns property name: " + it.FColumnsPropertyName}
             else str = "Columns property name: " + "[Not bound]";
            r.$assign(g.CalculateText(str,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,400,10000)),true,false));
            rt.$assign(pas["WEBLib.TMSFNCTypes"].RectF(x,y,x + (r.Right - r.Left) + 6,y + (r.Bottom - r.Top) + 6));
            this.FBuildItem.ColumnsPropertyNameRect.$assign(rt);
            this.FBuildItem.ColumnsPropertyNameText = str;
            if (it.FColumnsSubPropertyName !== "") {
              str = "Columns sub property name: " + it.FColumnsSubPropertyName}
             else str = "Columns sub property name: " + "[Not bound]";
            r.$assign(g.CalculateText(str,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,400,10000)),true,false));
            rt.$assign(pas["WEBLib.TMSFNCTypes"].RectF(rt.Right + 20,(y + ((rt.Bottom - rt.Top) / 2)) - (((r.Bottom - r.Top) + 6) / 2),rt.Right + 20 + (r.Right - r.Left) + 6,y + ((rt.Bottom - rt.Top) / 2) + (((r.Bottom - r.Top) + 6) / 2)));
            this.FBuildItem.ColumnsSubPropertyNameRect.$assign(rt);
            this.FBuildItem.ColumnsSubPropertyNameText = str;
            var $tmp = it.FBindType;
            if ($tmp === pas["WEBLib.TMSFNCDataBinding"].TTMSFNCDataBinderBindType.dbbtSingleValue) {
              if (it.FPropertyName !== "") {
                str = "Property name: " + it.FPropertyName}
               else str = "Property name: " + "[Not bound]";
            } else if (($tmp === pas["WEBLib.TMSFNCDataBinding"].TTMSFNCDataBinderBindType.dbbtList) || ($tmp === pas["WEBLib.TMSFNCDataBinding"].TTMSFNCDataBinderBindType.dbbtColumnList)) {
              if (it.FPropertyName !== "") {
                str = "List property name: " + it.FPropertyName}
               else str = "List property name: " + "[Not bound]";
            };
            r.$assign(g.CalculateText(str,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,400,10000)),true,false));
            var $tmp1 = it.FBindType;
            if (($tmp1 === pas["WEBLib.TMSFNCDataBinding"].TTMSFNCDataBinderBindType.dbbtSingleValue) || ($tmp1 === pas["WEBLib.TMSFNCDataBinding"].TTMSFNCDataBinderBindType.dbbtList)) {
              rt.$assign(this.FBuildItem.FieldNameRect);
              rt.$assign(pas["WEBLib.TMSFNCTypes"].RectF(rt.Right + 20,(y + ((rt.Bottom - rt.Top) / 2)) - (((r.Bottom - r.Top) + 6) / 2),rt.Right + 20 + (r.Right - r.Left) + 6,y + ((rt.Bottom - rt.Top) / 2) + (((r.Bottom - r.Top) + 6) / 2)));
              x = rt.Left;
            } else if ($tmp1 === pas["WEBLib.TMSFNCDataBinding"].TTMSFNCDataBinderBindType.dbbtColumnList) {
              rt.$assign(this.FBuildItem.ColumnsSubPropertyNameRect);
              rt.$assign(pas["WEBLib.TMSFNCTypes"].RectF(x,rt.Bottom + 10,x + (r.Right - r.Left) + 6,rt.Bottom + 10 + (r.Bottom - r.Top) + 6));
            };
            this.FBuildItem.PropertyNameRect.$assign(rt);
            this.FBuildItem.PropertyNameText = str;
            if (AUpdate) {
              fa = rtl.arraySetLength(fa,pas["WEBLib.TMSFNCTypes"].TRectF,it.FSubFieldNames.GetCount());
              fb = rtl.arraySetLength(fb,"",it.FSubFieldNames.GetCount());
              fc = rtl.arraySetLength(fc,null,it.FSubFieldNames.GetCount());
              pa = rtl.arraySetLength(pa,pas["WEBLib.TMSFNCTypes"].TRectF,it.FSubPropertyNames.GetCount());
              pb = rtl.arraySetLength(pb,"",it.FSubPropertyNames.GetCount());
              pc = rtl.arraySetLength(pc,null,it.FSubPropertyNames.GetCount());
            } else {
              fa = this.FBuildItem.SubFieldNamesRects;
              fb = this.FBuildItem.SubFieldNamesTexts;
              fc = this.FBuildItem.SubFieldNamesCombos;
              pa = this.FBuildItem.SubPropertyNamesRects;
              pb = this.FBuildItem.SubPropertyNamesTexts;
              pc = this.FBuildItem.SubPropertyNamesCombos;
            };
            xm = 0;
            y = rt.Bottom + 50;
            for (var $l1 = 0, $end = it.FSubFieldNames.GetCount() - 1; $l1 <= $end; $l1++) {
              I = $l1;
              if (it.FSubFieldNames.GetItemEx(I).FValue !== "") {
                str = "Field name: " + it.FSubFieldNames.GetItemEx(I).FValue}
               else if (it.FSubFieldNames.GetItemEx(I).FHTMLTemplate !== "") {
                str = "HTML template: " + it.FSubFieldNames.GetItemEx(I).FHTMLTemplate}
               else str = "Field name: " + "[Not bound]";
              fb[I] = str;
              r.$assign(g.CalculateText(str,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,400,10000)),true,false));
              fa[I].$assign(pas["WEBLib.TMSFNCTypes"].RectF(x,y,x + (r.Right - r.Left) + 6,y + (r.Bottom - r.Top) + 6));
              xm = Math.max(fa[I].Right - fa[I].Left,xm);
              y = y + (fa[I].Bottom - fa[I].Top) + 10;
              if (AUpdate) fc[I] = $mod.TTMSFNCDataBindingEditorComboBoxSub.$create("Create$1",[this.FPreview]);
              fc[I].FTag$1 = I;
              fc[I].SetBounds(Math.round(fa[I].Left),Math.round(fa[I].Top),Math.round(fa[I].Right - fa[I].Left),Math.round(fa[I].Bottom - fa[I].Top));
              fc[I].FOnChange = rtl.createCallback(this,"DoComboSubFieldChanged");
            };
            if (xm > 0) xm = xm + 20;
            y = rt.Bottom + 50;
            for (var $l2 = 0, $end1 = it.FSubPropertyNames.GetCount() - 1; $l2 <= $end1; $l2++) {
              I = $l2;
              if (it.FSubPropertyNames.GetItemEx(I).FValue !== "") {
                str = "Property name: " + it.FSubPropertyNames.GetItemEx(I).FValue}
               else str = "Property name: " + "[Not bound]";
              pb[I] = str;
              r.$assign(g.CalculateText(str,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,400,10000)),true,false));
              pa[I].$assign(pas["WEBLib.TMSFNCTypes"].RectF(x + xm,y,x + xm + (r.Right - r.Left) + 6,y + (r.Bottom - r.Top) + 6));
              y = y + (pa[I].Bottom - pa[I].Top) + 10;
              if (AUpdate) pc[I] = $mod.TTMSFNCDataBindingEditorComboBoxSub.$create("Create$1",[this.FPreview]);
              pc[I].FTag$1 = I;
              pc[I].SetBounds(Math.round(pa[I].Left),Math.round(pa[I].Top),Math.round(pa[I].Right - pa[I].Left),Math.round(pa[I].Bottom - pa[I].Top));
              pc[I].FOnChange = rtl.createCallback(this,"DoComboSubPropertyChanged");
            };
            this.FBuildItem.SubPropertyNamesRects = rtl.arrayRef(pa);
            this.FBuildItem.SubPropertyNamesTexts = rtl.arrayRef(pb);
            this.FBuildItem.SubPropertyNamesCombos = rtl.arrayRef(pc);
            this.FBuildItem.SubFieldNamesRects = rtl.arrayRef(fa);
            this.FBuildItem.SubFieldNamesTexts = rtl.arrayRef(fb);
            this.FBuildItem.SubFieldNamesCombos = rtl.arrayRef(fc);
          };
        } finally {
          g.EndScene();
          g = rtl.freeLoc(g);
        };
      };
      this.MakeComponentScreenShot();
      this.FPreview.Invalidate();
    };
    this.FillControls = function () {
      var I = 0;
      var it = null;
      var li = null;
      var s = "";
      if (this.FDataBinder != null) {
        this.FBlockUpdate = true;
        this.FListBox.GetItems().Clear();
        this.FListBox.BeginUpdate();
        for (var $l = 0, $end = this.FDataBinder.GetItems().GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          it = this.FDataBinder.GetItems().GetItemEx(I);
          s = it.FName;
          if ((it.GetObject() != null) && (s === "")) {
            if (pas.Classes.TComponent.isPrototypeOf(it.GetObject()) && (rtl.as(it.GetObject(),pas.Classes.TComponent).FName !== "")) {
              s = rtl.as(it.GetObject(),pas.Classes.TComponent).FName}
             else s = it.GetObject().$classname;
          };
          li = this.FListBox.GetItems().Add$1();
          if (s === "") s = "[Empty Object]";
          li.SetName(s);
          li.SetDataObject(it);
        };
        this.FListBox.EndUpdate();
        this.FBlockUpdate = false;
      };
    };
    this.FillEditControls = function (AUpdate) {
      var $Self = this;
      var I = 0;
      var c = null;
      var str = "";
      var idx = 0;
      var slc = null;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var f = null;
      var cbo = null;
      function FillPropertyNames(obj, pp, cbo, IncludePublic) {
        var k = 0;
        var j = 0;
        var a = [];
        var propNames = [];
        var o = null;
        var oi = null;
        if (pp !== "") {
          a = pas["WEBLib.TMSFNCDataBinding"].TTMSFNCDataBinder.GetPropertyList(obj);
          for (var $l = 0, $end = rtl.length(a) - 1; $l <= $end; $l++) {
            k = $l;
            if ((a[k] != null) && (pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.GetPropInfoName(a[k]) === pp)) {
              if (pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.GetPropInfoType(a[k]) === pas.System.TTypeKind.tkClass) {
                o = pas.TypInfo.GetObjectProp(obj,pp);
                if (o != null) {
                  if (pas.Classes.TCollection.isPrototypeOf(o)) {
                    oi = rtl.as(o,pas.Classes.TCollection).FItemClass.$create("Create$1",[null]);
                    try {
                      propNames = pas["WEBLib.TMSFNCDataBinding"].TTMSFNCDataBinder.GetPropertyNames(oi,IncludePublic);
                      for (var $l1 = 0, $end1 = rtl.length(propNames) - 1; $l1 <= $end1; $l1++) {
                        j = $l1;
                        cbo.Add(propNames[j]);
                      };
                    } finally {
                      oi = rtl.freeLoc(oi);
                    };
                  } else {
                    propNames = pas["WEBLib.TMSFNCDataBinding"].TTMSFNCDataBinder.GetPropertyNames(o,IncludePublic);
                    for (var $l2 = 0, $end2 = rtl.length(propNames) - 1; $l2 <= $end2; $l2++) {
                      j = $l2;
                      cbo.Add(propNames[j]);
                    };
                  };
                  break;
                };
              };
            };
          };
        } else {
          propNames = pas["WEBLib.TMSFNCDataBinding"].TTMSFNCDataBinder.GetPropertyNames(obj,IncludePublic);
          for (var $l3 = 0, $end3 = rtl.length(propNames) - 1; $l3 <= $end3; $l3++) {
            k = $l3;
            cbo.Add(propNames[k]);
          };
        };
      };
      function FillFieldNames(ds, cbo) {
        if ((ds != null) && (ds.FDataSet != null)) ds.FDataSet.GetFieldNames(cbo);
      };
      if (this.FBlockUpdate) return;
      this.FBlockChange = true;
      if (this.FMode === $mod.TTMSFNCDataBindingEditorMode.dbemEdit) {
        if (this.FBuildItem.Item != null) {
          this.FComboboxBindComponent.SetParent(this.FPreview)}
         else this.FComboboxBindComponent.SetParent(null);
        if (((this.FBuildItem.Item != null) && (this.FBuildItem.Item.FBindType !== pas["WEBLib.TMSFNCDataBinding"].TTMSFNCDataBinderBindType.dbbtGrid)) || !(this.FBuildItem.Item != null)) {
          if (this.FBuildItem.Item != null) {
            this.FComboBoxPropertyName.SetParent(this.FPreview)}
           else this.FComboBoxPropertyName.SetParent(null);
          if ((this.FBuildItem.Item != null) && (this.FBuildItem.Item.FBindType in rtl.createSet(pas["WEBLib.TMSFNCDataBinding"].TTMSFNCDataBinderBindType.dbbtSingleValue,pas["WEBLib.TMSFNCDataBinding"].TTMSFNCDataBinderBindType.dbbtList))) {
            this.FComboBoxFieldName.SetParent(this.FPreview)}
           else this.FComboBoxFieldName.SetParent(null);
          if ((this.FBuildItem.Item != null) && (this.FBuildItem.Item.FBindType in rtl.createSet(pas["WEBLib.TMSFNCDataBinding"].TTMSFNCDataBinderBindType.dbbtColumnList))) {
            this.FComboBoxColumnsPropertyName.SetParent(this.FPreview);
            this.FComboBoxColumnsSubPropertyName.SetParent(this.FPreview);
          } else {
            this.FComboBoxColumnsPropertyName.SetParent(null);
            this.FComboBoxColumnsSubPropertyName.SetParent(null);
          };
          if ((this.FBuildItem.Item != null) && (this.FBuildItem.Item.FBindType in rtl.createSet(pas["WEBLib.TMSFNCDataBinding"].TTMSFNCDataBinderBindType.dbbtList,pas["WEBLib.TMSFNCDataBinding"].TTMSFNCDataBinderBindType.dbbtColumnList))) {
            for (var $l = 0, $end = rtl.length(this.FBuildItem.SubFieldNamesCombos) - 1; $l <= $end; $l++) {
              I = $l;
              this.FBuildItem.SubFieldNamesCombos[I].SetParent(this.FPreview);
            };
            for (var $l1 = 0, $end1 = rtl.length(this.FBuildItem.SubPropertyNamesCombos) - 1; $l1 <= $end1; $l1++) {
              I = $l1;
              this.FBuildItem.SubPropertyNamesCombos[I].SetParent(this.FPreview);
            };
          };
          if ((this.FBuildItem.Item != null) && (this.FBuildItem.Item.FBindType in rtl.createSet(pas["WEBLib.TMSFNCDataBinding"].TTMSFNCDataBinderBindType.dbbtList,pas["WEBLib.TMSFNCDataBinding"].TTMSFNCDataBinderBindType.dbbtColumnList))) {
            this.FSubAdd.SetParent(this.FPreview);
            if ((rtl.length(this.FBuildItem.SubPropertyNamesRects) > 0) || (rtl.length(this.FBuildItem.SubFieldNamesRects) > 0)) {
              this.FSubDelete.SetParent(this.FPreview)}
             else this.FSubDelete.SetParent(null);
            if (rtl.length(this.FBuildItem.SubPropertyNamesRects) > 0) {
              r.$assign(this.FBuildItem.SubPropertyNamesRects[rtl.length(this.FBuildItem.SubPropertyNamesRects) - 1])}
             else if (rtl.length(this.FBuildItem.SubFieldNamesRects) > 0) {
              r.$assign(this.FBuildItem.SubFieldNamesRects[rtl.length(this.FBuildItem.SubFieldNamesRects) - 1])}
             else r.$assign(this.FBuildItem.PropertyNameRect);
            this.FSubAdd.SetBounds(Math.round(r.Right + 20),Math.round(r.Top),Math.round(this.FSubAdd.GetWidth()),Math.round(this.FSubAdd.GetHeight()));
            this.FSubDelete.SetBounds(Math.round(r.Right + 30 + this.FSubAdd.GetWidth()),Math.round(r.Top),Math.round(this.FSubDelete.GetWidth()),Math.round(this.FSubDelete.GetHeight()));
          };
        };
        if (AUpdate) {
          if (this.FComboBoxPropertyName.FParent != null) this.FComboBoxPropertyName.FItems.Clear();
          if (this.FComboBoxColumnsPropertyName.FParent != null) this.FComboBoxColumnsPropertyName.FItems.Clear();
          if (this.FComboBoxColumnsSubPropertyName.FParent != null) this.FComboBoxColumnsSubPropertyName.FItems.Clear();
          if (this.FComboBoxFieldName.FParent != null) this.FComboBoxFieldName.FItems.Clear();
          if (this.FComboboxBindComponent.FParent != null) this.FComboboxBindComponent.FItems.Clear();
          this.FButtonEdit.SetText(rtl.getResStr($mod,"sTMSFNCDataBindingEditorCloseEditMode"));
          f = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetOwnerForm($Self);
          if (f != null) {
            idx = -1;
            if (this.FComboboxBindComponent.FParent != null) this.FComboboxBindComponent.FItems.Add("");
            for (var $l2 = 0, $end2 = f.GetComponentCount() - 1; $l2 <= $end2; $l2++) {
              I = $l2;
              c = f.GetComponent(I);
              if (c.FName !== "") {
                str = c.FName}
               else str = c.$classname;
              if (this.FComboboxBindComponent.FParent != null) this.FComboboxBindComponent.FItems.AddObject(str,c);
              if ((this.FBuildItem.Item != null) && (c === this.FBuildItem.Item.GetBindComponent())) idx = I;
            };
            if (this.FComboboxBindComponent.FParent != null) this.FComboboxBindComponent.SetItemIndex(idx + 1);
          };
          slc = pas.Classes.TStringList.$create("Create$1");
          try {
            if (this.FBuildItem.Item != null) FillPropertyNames(this.FBuildItem.Item.GetBindComponent(),"",slc,true);
            slc.Insert(0,"");
            if (this.FComboBoxPropertyName.FParent != null) this.FComboBoxPropertyName.FItems.Assign(slc);
            if (this.FComboBoxColumnsPropertyName.FParent != null) this.FComboBoxColumnsPropertyName.FItems.Assign(slc);
            slc.Clear();
            if (this.FBuildItem.Item != null) FillPropertyNames(this.FBuildItem.Item.GetBindComponent(),this.FBuildItem.Item.FPropertyName,slc,true);
            slc.Insert(0,"");
            for (var $l3 = 0, $end3 = rtl.length(this.FBuildItem.SubPropertyNamesCombos) - 1; $l3 <= $end3; $l3++) {
              I = $l3;
              if (this.FBuildItem.SubPropertyNamesCombos[I].FParent != null) {
                this.FBuildItem.SubPropertyNamesCombos[I].FItems.Assign(slc);
                this.FBuildItem.SubPropertyNamesCombos[I].SetItemIndex(-1);
                this.FBuildItem.SubPropertyNamesCombos[I].SetText(this.FBuildItem.Item.FSubPropertyNames.GetItemEx(I).FValue);
                this.FBuildItem.SubPropertyNamesCombos[I].SetItemIndex(this.FBuildItem.SubPropertyNamesCombos[I].FItems.IndexOf(this.FBuildItem.SubPropertyNamesCombos[I].GetText()));
              };
            };
            slc.Clear();
            if (this.FBuildItem.Item != null) FillPropertyNames(this.FBuildItem.Item.GetBindComponent(),this.FBuildItem.Item.FColumnsPropertyName,slc,true);
            slc.Insert(0,"");
            if (this.FComboBoxColumnsSubPropertyName.FParent != null) this.FComboBoxColumnsSubPropertyName.FItems.Assign(slc);
            slc.Clear();
            if (this.FBuildItem.Item != null) FillFieldNames(this.FBuildItem.Item.GetDataSource(),slc);
            for (var $l4 = 0, $end4 = rtl.length(this.FBuildItem.SubFieldNamesCombos) - 1; $l4 <= $end4; $l4++) {
              I = $l4;
              if (this.FBuildItem.SubFieldNamesCombos[I].FParent != null) {
                this.FBuildItem.SubFieldNamesCombos[I].FItems.Assign(slc);
                this.FBuildItem.SubFieldNamesCombos[I].SetItemIndex(-1);
                if (this.FBuildItem.Item.FSubFieldNames.GetItemEx(I).FHTMLTemplate !== "") {
                  this.FBuildItem.SubFieldNamesCombos[I].SetText(this.FBuildItem.Item.FSubFieldNames.GetItemEx(I).FHTMLTemplate)}
                 else {
                  this.FBuildItem.SubFieldNamesCombos[I].SetText(this.FBuildItem.Item.FSubFieldNames.GetItemEx(I).FValue);
                  this.FBuildItem.SubFieldNamesCombos[I].SetItemIndex(this.FBuildItem.SubFieldNamesCombos[I].FItems.IndexOf(this.FBuildItem.SubFieldNamesCombos[I].GetText()));
                };
              };
            };
            slc.Insert(0,"");
            if (this.FComboBoxFieldName.FParent != null) this.FComboBoxFieldName.FItems.Assign(slc);
          } finally {
            slc = rtl.freeLoc(slc);
          };
        };
        if (this.FComboBoxColumnsPropertyName.FParent != null) {
          this.FComboBoxColumnsPropertyName.SetItemIndex(-1);
          this.FComboBoxColumnsPropertyName.SetText(this.FBuildItem.Item.FColumnsPropertyName);
          this.FComboBoxColumnsPropertyName.SetItemIndex(this.FComboBoxColumnsPropertyName.FItems.IndexOf(this.FComboBoxColumnsPropertyName.GetText()));
        };
        if (this.FComboBoxColumnsSubPropertyName.FParent != null) {
          this.FComboBoxColumnsSubPropertyName.SetItemIndex(-1);
          this.FComboBoxColumnsSubPropertyName.SetText(this.FBuildItem.Item.FColumnsSubPropertyName);
          this.FComboBoxColumnsSubPropertyName.SetItemIndex(this.FComboBoxColumnsSubPropertyName.FItems.IndexOf(this.FComboBoxColumnsSubPropertyName.GetText()));
        };
        if (this.FComboBoxPropertyName.FParent != null) {
          this.FComboBoxPropertyName.SetItemIndex(-1);
          this.FComboBoxPropertyName.SetText(this.FBuildItem.Item.FPropertyName);
          this.FComboBoxPropertyName.SetItemIndex(this.FComboBoxPropertyName.FItems.IndexOf(this.FComboBoxPropertyName.GetText()));
        };
        if (this.FComboBoxFieldName.FParent != null) {
          this.FComboBoxFieldName.SetItemIndex(-1);
          if (this.FBuildItem.Item.FHTMLTemplate !== "") {
            this.FComboBoxFieldName.SetText(this.FBuildItem.Item.FHTMLTemplate)}
           else {
            this.FComboBoxFieldName.SetText(this.FBuildItem.Item.FFieldName);
            this.FComboBoxFieldName.SetItemIndex(this.FComboBoxFieldName.FItems.IndexOf(this.FComboBoxFieldName.GetText()));
          };
        };
        this.FComboboxBindComponent.SetBounds(Math.round(this.FBuildItem.BindComponentRect.Left),Math.round(this.FBuildItem.BindComponentRect.Top),Math.round(this.FBuildItem.BindComponentRect.Right - this.FBuildItem.BindComponentRect.Left),Math.round(this.FBuildItem.BindComponentRect.Bottom - this.FBuildItem.BindComponentRect.Top));
        this.FComboBoxFieldName.SetBounds(Math.round(this.FBuildItem.FieldNameRect.Left),Math.round(this.FBuildItem.FieldNameRect.Top),Math.round(this.FBuildItem.FieldNameRect.Right - this.FBuildItem.FieldNameRect.Left),Math.round(this.FBuildItem.FieldNameRect.Bottom - this.FBuildItem.FieldNameRect.Top));
        this.FComboBoxPropertyName.SetBounds(Math.round(this.FBuildItem.PropertyNameRect.Left),Math.round(this.FBuildItem.PropertyNameRect.Top),Math.round(this.FBuildItem.PropertyNameRect.Right - this.FBuildItem.PropertyNameRect.Left),Math.round(this.FBuildItem.PropertyNameRect.Bottom - this.FBuildItem.PropertyNameRect.Top));
        this.FComboBoxColumnsPropertyName.SetBounds(Math.round(this.FBuildItem.ColumnsPropertyNameRect.Left),Math.round(this.FBuildItem.ColumnsPropertyNameRect.Top),Math.round(this.FBuildItem.ColumnsPropertyNameRect.Right - this.FBuildItem.ColumnsPropertyNameRect.Left),Math.round(this.FBuildItem.ColumnsPropertyNameRect.Bottom - this.FBuildItem.ColumnsPropertyNameRect.Top));
        this.FComboBoxColumnsSubPropertyName.SetBounds(Math.round(this.FBuildItem.ColumnsSubPropertyNameRect.Left),Math.round(this.FBuildItem.ColumnsSubPropertyNameRect.Top),Math.round(this.FBuildItem.ColumnsSubPropertyNameRect.Right - this.FBuildItem.ColumnsSubPropertyNameRect.Left),Math.round(this.FBuildItem.ColumnsSubPropertyNameRect.Bottom - this.FBuildItem.ColumnsSubPropertyNameRect.Top));
      } else {
        this.FButtonEdit.SetText(rtl.getResStr($mod,"sTMSFNCDataBindingEditorEditMode"));
        this.FComboboxBindComponent.SetParent(null);
        this.FComboBoxFieldName.SetParent(null);
        this.FComboBoxPropertyName.SetParent(null);
        this.FComboBoxColumnsPropertyName.SetParent(null);
        this.FComboBoxColumnsSubPropertyName.SetParent(null);
        this.FSubAdd.SetParent(null);
        this.FSubDelete.SetParent(null);
        for (var $l5 = this.FPreview.GetComponentCount() - 1; $l5 >= 0; $l5--) {
          I = $l5;
          if ($mod.TTMSFNCDataBindingEditorComboBoxSub.isPrototypeOf(this.FPreview.GetComponent(I))) {
            cbo = this.FPreview.GetComponent(I);
            cbo.SetParent(null);
          };
        };
      };
      this.FBlockChange = false;
    };
    this.DoResizeForm = function (Sender) {
      if ((this.FCheckBoxActive != null) && (this.FComboBoxBindType != null)) {
        this.FCheckBoxActive.SetBounds((this.FPreview.GetLeft() + this.FPreview.GetWidth()) - this.FCheckBoxActive.GetWidth() - 10,this.FPreview.GetTop() + 10,this.FCheckBoxActive.GetWidth(),this.FCheckBoxActive.GetHeight());
        this.FComboBoxBindType.SetBounds(this.FCheckBoxActive.GetLeft() - this.FComboBoxBindType.GetWidth() - 10,this.FPreview.GetTop() + 10,this.FComboBoxBindType.GetWidth(),this.FComboBoxBindType.GetHeight());
        this.FComboBoxDataSource.SetBounds(this.FComboBoxBindType.GetLeft() - this.FComboBoxDataSource.GetWidth() - 10,this.FPreview.GetTop() + 10,this.FComboBoxDataSource.GetWidth(),this.FComboBoxDataSource.GetHeight());
      };
    };
    this.DoEdit = function (Sender) {
      var $tmp = this.FMode;
      if ($tmp === $mod.TTMSFNCDataBindingEditorMode.dbemView) {
        this.FMode = $mod.TTMSFNCDataBindingEditorMode.dbemEdit}
       else if ($tmp === $mod.TTMSFNCDataBindingEditorMode.dbemEdit) this.FMode = $mod.TTMSFNCDataBindingEditorMode.dbemView;
      this.FillEditControls(true);
    };
    this.DoAdd = function (Sender) {
      if (this.FDataBinder.GetItemByObject(null,"") != null) {
        pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.Message('Please select and edit/remove the "[Empty Object]" item, before adding a new item');
        return;
      };
      if (this.FDataBinder != null) this.FDataBinder.GetItems().Add$1();
      this.FillControls();
      this.FBlockUpdate = true;
      if (this.FListBox.GetItems().GetCount() > 0) this.FListBox.SelectItem(this.FListBox.GetItems().GetCount() - 1);
      this.FBlockUpdate = false;
      this.BuildItem(true);
      this.FMode = $mod.TTMSFNCDataBindingEditorMode.dbemEdit;
      this.FillEditControls(true);
    };
    this.DoDuplicate = function (Sender) {
      if (this.FDataBinder.GetItemByObject(null,"") != null) {
        pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.Message('Please select and edit/remove the "[Empty Object]" item, before adding a new item');
        return;
      };
      if (!(this.FBuildItem.Item != null)) {
        this.DoAdd(Sender);
        return;
      };
      if (this.FDataBinder != null) this.FDataBinder.GetItems().Add$1().Assign(this.FBuildItem.Item);
      this.FillControls();
      this.FBlockUpdate = true;
      if (this.FListBox.GetItems().GetCount() > 0) this.FListBox.SelectItem(this.FListBox.GetItems().GetCount() - 1);
      this.FBlockUpdate = false;
      this.BuildItem(true);
      this.FMode = $mod.TTMSFNCDataBindingEditorMode.dbemEdit;
      this.FillEditControls(true);
    };
    this.DoDelete = function (Sender) {
      var io = 0;
      if ((this.FListBox.FLastSelectedItemIndex >= 0) && (this.FListBox.FLastSelectedItemIndex <= (this.FListBox.GetItems().GetCount() - 1)) && (this.FListBox.GetItems().GetItemEx(this.FListBox.FLastSelectedItemIndex).FSelected === true)) {
        io = this.FListBox.FLastSelectedItemIndex;
        this.FDataBinder.GetItems().Delete(this.FListBox.FLastSelectedItemIndex);
        this.FillControls();
        this.FBlockUpdate = true;
        if (this.FListBox.GetItems().GetCount() > 0) {
          if ((io - 1) >= 0) {
            this.FListBox.SelectItem(io - 1)}
           else this.FListBox.SelectItem(io);
        } else this.FListBox.UnselectAllItems();
        this.FBlockUpdate = false;
        this.BuildItem(true);
        this.FillEditControls(true);
      };
    };
    this.DoSubAdd = function (Sender) {
      if (this.FBuildItem.Item != null) {
        this.FBuildItem.Item.FSubFieldNames.Add$1();
        this.FBuildItem.Item.FSubPropertyNames.Add$1();
        this.BuildItem(true);
        this.FillEditControls(true);
      };
    };
    this.DoSubDelete = function (Sender) {
      if (this.FBuildItem.Item != null) {
        if (this.FBuildItem.Item.FSubFieldNames.GetCount() > 0) this.FBuildItem.Item.FSubFieldNames.Delete(this.FBuildItem.Item.FSubFieldNames.GetCount() - 1);
        if (this.FBuildItem.Item.FSubPropertyNames.GetCount() > 0) this.FBuildItem.Item.FSubPropertyNames.Delete(this.FBuildItem.Item.FSubPropertyNames.GetCount() - 1);
        this.BuildItem(true);
        this.FillEditControls(true);
      };
    };
    this.DoActiveChanged = function (Sender) {
      if (this.FBuildItem.Item != null) {
        this.FBuildItem.Item.SetActive(this.FCheckBoxActive.GetChecked());
        this.MakeComponentScreenShot();
        this.FPreview.Invalidate();
      };
    };
    this.DoBindTypeChanged = function (Sender) {
      if (this.FBlockChange) return;
      if (this.FBuildItem.Item != null) this.FBuildItem.Item.SetBindType(this.FComboBoxBindType.GetItemIndex());
      this.BuildItem(false);
      this.FillEditControls(false);
    };
    this.DoDataSourceChanged = function (Sender) {
      var obj = null;
      if (this.FBlockChange) return;
      if (this.FBuildItem.Item != null) {
        if ((this.FComboBoxDataSource.GetItemIndex() >= 0) && (this.FComboBoxDataSource.GetItemIndex() <= (this.FComboBoxDataSource.FItems.GetCount() - 1))) {
          obj = this.FComboBoxDataSource.FItems.GetObject(this.FComboBoxDataSource.GetItemIndex());
          if (pas.DB.TDataSource.isPrototypeOf(obj)) {
            this.FBuildItem.Item.SetDataSource(rtl.as(obj,pas.DB.TDataSource))}
           else this.FBuildItem.Item.SetDataSource(null);
        };
      };
      this.BuildItem(false);
      this.FillEditControls(true);
    };
    this.DoListBoxChange = function (Sender) {
      this.BuildItem(true);
      this.FillEditControls(true);
    };
    this.DoListBoxItemSelectedChange = function (Sender, AIndex, AItem, ASelected) {
      if (rtl.length(this.FListBox.GetSelectedItems()) > 0) {
        this.FButtonEdit.SetEnabled(true)}
       else {
        this.FMode = $mod.TTMSFNCDataBindingEditorMode.dbemView;
        this.FButtonEdit.SetSelected(false);
        this.FButtonEdit.SetEnabled(false);
      };
      if (ASelected) this.DoListBoxChange(Sender);
    };
    this.DoBindComponentChanged = function (Sender) {
      var I = 0;
      if (this.FBlockChange) return;
      if (this.FBuildItem.Item != null) {
        this.FBuildItem.Item.SetActive(false);
        if ((this.FComboboxBindComponent.GetItemIndex() >= 0) && (this.FComboboxBindComponent.GetItemIndex() <= (this.FComboboxBindComponent.FItems.GetCount() - 1))) this.FBuildItem.Item.SetObject(this.FComboboxBindComponent.FItems.GetObject(this.FComboboxBindComponent.GetItemIndex()));
        this.BuildItem(false);
        this.FillControls();
        this.FBlockUpdate = true;
        if (this.FListBox.GetItems().GetCount() > 0) {
          for (var $l = 0, $end = this.FListBox.GetItems().GetCount() - 1; $l <= $end; $l++) {
            I = $l;
            if (this.FListBox.GetItems().GetItemEx(I).FDataObject.GetObject() === this.FBuildItem.Item.GetObject()) {
              this.FListBox.SelectItem(I);
              break;
            };
          };
        };
        this.FBlockUpdate = false;
        this.FillEditControls(true);
      };
    };
    this.DoPropertyNameChanged = function (Sender) {
      if (this.FBlockChange) return;
      if (this.FBuildItem.Item != null) {
        this.FBuildItem.Item.SetPropertyName(this.FComboBoxPropertyName.GetText());
        this.BuildItem(false);
        this.FillEditControls(false);
      };
    };
    this.DoFieldNameChanged = function (Sender) {
      var s = "";
      if (this.FBlockChange) return;
      if (this.FBuildItem.Item != null) {
        s = this.FComboBoxFieldName.GetText();
        if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.IsHTML(s)) {
          this.FBuildItem.Item.SetHTMLTemplate(s);
          this.FBuildItem.Item.SetFieldName("");
        } else {
          this.FBuildItem.Item.SetHTMLTemplate("");
          this.FBuildItem.Item.SetFieldName(s);
        };
        this.BuildItem(false);
        this.FillEditControls(false);
      };
    };
    this.DoComboSubPropertyChanged = function (Sender) {
      var i = 0;
      if (this.FBlockChange) return;
      if ((this.FBuildItem.Item != null) && $mod.TTMSFNCDataBindingEditorComboBoxSub.isPrototypeOf(Sender)) {
        i = rtl.as(Sender,$mod.TTMSFNCDataBindingEditorComboBoxSub).FTag$1;
        if ((i >= 0) && (i <= (this.FBuildItem.Item.FSubPropertyNames.GetCount() - 1))) {
          this.FBuildItem.Item.FSubPropertyNames.GetItemEx(rtl.as(Sender,$mod.TTMSFNCDataBindingEditorComboBoxSub).FTag$1).SetValue(rtl.as(Sender,$mod.TTMSFNCDataBindingEditorComboBoxSub).GetText());
          this.BuildItem(false);
          this.FillEditControls(false);
        };
      };
    };
    this.DoComboSubFieldChanged = function (Sender) {
      var i = 0;
      var s = "";
      if (this.FBlockChange) return;
      if ((this.FBuildItem.Item != null) && $mod.TTMSFNCDataBindingEditorComboBoxSub.isPrototypeOf(Sender)) {
        i = rtl.as(Sender,$mod.TTMSFNCDataBindingEditorComboBoxSub).FTag$1;
        if ((i >= 0) && (i <= (this.FBuildItem.Item.FSubFieldNames.GetCount() - 1))) {
          s = rtl.as(Sender,$mod.TTMSFNCDataBindingEditorComboBoxSub).GetText();
          if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.IsHTML(s)) {
            this.FBuildItem.Item.FSubFieldNames.GetItemEx(i).SetHTMLTemplate(s);
            this.FBuildItem.Item.FSubFieldNames.GetItemEx(i).SetValue("");
          } else {
            this.FBuildItem.Item.FSubFieldNames.GetItemEx(i).SetHTMLTemplate("");
            this.FBuildItem.Item.FSubFieldNames.GetItemEx(i).SetValue(s);
          };
          this.BuildItem(false);
          this.FillEditControls(false);
        };
      };
    };
    this.DoColumnsPropertyNameChanged = function (Sender) {
      if (this.FBlockChange) return;
      if (this.FBuildItem.Item != null) {
        this.FBuildItem.Item.SetColumnsPropertyName(this.FComboBoxColumnsPropertyName.GetText());
        this.BuildItem(false);
        this.FillEditControls(false);
      };
    };
    this.DoColumnsSubPropertyNameChanged = function (Sender) {
      if (this.FBlockChange) return;
      if (this.FBuildItem.Item != null) {
        this.FBuildItem.Item.SetColumnsSubPropertyName(this.FComboBoxColumnsSubPropertyName.GetText());
        this.BuildItem(false);
        this.FillEditControls(false);
      };
    };
    this.DoAfterDraw = function (Sender, AGraphics, ARect) {
      var $Self = this;
      var bcr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var fnr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var pnr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var cnr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var cnsr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var bmpr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var bmp = null;
      var x = 0.0;
      var y = 0.0;
      var I = 0;
      var str = "";
      var c = 0;
      var sc = 0.0;
      function DrawSplittedText(ATextRect, AText) {
        var sl = null;
        var rc = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
        var rt = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
        var rtt = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
        var x = 0.0;
        var ft = 0;
        var fk = 0;
        var K = 0;
        var spc = 0.0;
        if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.IsHTML(AText)) {
          AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ATextRect),AText,true,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,false,false,-1,-1);
          return;
        };
        ft = AGraphics.FFont.FColor;
        fk = AGraphics.FFill.FKind;
        sl = pas.Classes.TStringList.$create("Create$1");
        try {
          x = ATextRect.Left;
          pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.Split(":",AText,sl,false);
          spc = Math.round(sc * 6);
          if (sl.GetCount() > 0) spc = spc / sl.GetCount();
          for (var $l = 0, $end = sl.GetCount() - 1; $l <= $end; $l++) {
            K = $l;
            rc.$assign(AGraphics.CalculateText$1(sl.Get(K)));
            rt.$assign(pas["WEBLib.TMSFNCTypes"].RectF(x,ATextRect.Top,x + (rc.Right - rc.Left) + spc,ATextRect.Bottom));
            if (K > 0) {
              AGraphics.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
              AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(rt.Left,rt.Top,rt.Right + spc,rt.Bottom)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
              AGraphics.FFont.SetColor(16777215);
            };
            rtt.$assign(rt);
            AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rtt),sl.Get(K),true,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,false,false,-1,-1);
            x = rt.Right + spc;
          };
        } finally {
          sl = rtl.freeLoc(sl);
          AGraphics.FFont.SetColor(ft);
          AGraphics.FFill.SetKind(fk);
        };
      };
      if (this.FBuildItem.Item != null) {
        sc = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetDPIScale(this.frm,96);
        c = 12482304;
        AGraphics.FFont.SetHeight(Math.round(-11 * sc));
        AGraphics.FStroke.SetColor(c);
        AGraphics.FFill.SetColor(c);
        AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
        AGraphics.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
        AGraphics.FFont.SetColor(c);
        y = 0;
        if (this.FBuildItem.Item.FBindType === pas["WEBLib.TMSFNCDataBinding"].TTMSFNCDataBinderBindType.dbbtGrid) {
          bcr.$assign(this.FBuildItem.BindComponentRect);
          if (this.FMode === $mod.TTMSFNCDataBindingEditorMode.dbemView) {
            AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(bcr),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
            DrawSplittedText(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(bcr),this.FBuildItem.BindComponentText);
          };
          y = bcr.Bottom;
        } else {
          if (this.FBuildItem.Item.FBindType in rtl.createSet(pas["WEBLib.TMSFNCDataBinding"].TTMSFNCDataBinderBindType.dbbtSingleValue,pas["WEBLib.TMSFNCDataBinding"].TTMSFNCDataBinderBindType.dbbtList)) {
            bcr.$assign(this.FBuildItem.BindComponentRect);
            fnr.$assign(this.FBuildItem.FieldNameRect);
            pnr.$assign(this.FBuildItem.PropertyNameRect);
            AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(bcr.Left,bcr.Top + ((bcr.Bottom - bcr.Top) / 2))),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(bcr.Left - Math.round(sc * 10),bcr.Top + ((bcr.Bottom - bcr.Top) / 2))),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
            AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(bcr.Left - Math.round(sc * 10),bcr.Top + ((bcr.Bottom - bcr.Top) / 2))),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(bcr.Left - Math.round(sc * 10),fnr.Top + ((fnr.Bottom - fnr.Top) / 2))),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
            AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(bcr.Left - Math.round(sc * 10),fnr.Top + ((fnr.Bottom - fnr.Top) / 2))),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(fnr.Left,fnr.Top + ((fnr.Bottom - fnr.Top) / 2))),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
            AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(fnr.Right,fnr.Top + ((fnr.Bottom - fnr.Top) / 2))),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(pnr.Left,pnr.Top + ((pnr.Bottom - pnr.Top) / 2))),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
            if (this.FMode === $mod.TTMSFNCDataBindingEditorMode.dbemView) {
              AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(bcr),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
              AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(fnr),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
              AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pnr),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
              DrawSplittedText(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(bcr),this.FBuildItem.BindComponentText);
              DrawSplittedText(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(fnr),this.FBuildItem.FieldNameText);
              DrawSplittedText(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pnr),this.FBuildItem.PropertyNameText);
            };
          } else {
            bcr.$assign(this.FBuildItem.BindComponentRect);
            cnr.$assign(this.FBuildItem.ColumnsPropertyNameRect);
            cnsr.$assign(this.FBuildItem.ColumnsSubPropertyNameRect);
            pnr.$assign(this.FBuildItem.PropertyNameRect);
            AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(bcr.Left,bcr.Top + ((bcr.Bottom - bcr.Top) / 2))),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(bcr.Left - Math.round(sc * 10),bcr.Top + ((bcr.Bottom - bcr.Top) / 2))),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
            AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(bcr.Left - Math.round(sc * 10),bcr.Top + ((bcr.Bottom - bcr.Top) / 2))),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(bcr.Left - Math.round(sc * 10),cnr.Top + ((cnr.Bottom - cnr.Top) / 2))),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
            AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(bcr.Left - Math.round(sc * 10),bcr.Top + ((bcr.Bottom - bcr.Top) / 2))),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(bcr.Left - Math.round(sc * 10),pnr.Top + ((pnr.Bottom - pnr.Top) / 2))),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
            AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(bcr.Left - Math.round(sc * 10),bcr.Top + ((bcr.Bottom - bcr.Top) / 2))),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(bcr.Left - Math.round(sc * 10),cnsr.Top + ((cnsr.Bottom - cnsr.Top) / 2))),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
            AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(bcr.Left - Math.round(sc * 10),cnr.Top + ((cnr.Bottom - cnr.Top) / 2))),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(cnr.Left,cnr.Top + ((cnr.Bottom - cnr.Top) / 2))),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
            AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(bcr.Left - Math.round(sc * 10),pnr.Top + ((pnr.Bottom - pnr.Top) / 2))),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(pnr.Left,pnr.Top + ((pnr.Bottom - pnr.Top) / 2))),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
            AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(cnr.Right,cnr.Top + ((cnr.Bottom - cnr.Top) / 2))),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(cnsr.Left,cnsr.Top + ((cnsr.Bottom - cnsr.Top) / 2))),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
            if (this.FMode === $mod.TTMSFNCDataBindingEditorMode.dbemView) {
              AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(bcr),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
              AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(cnr),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
              AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(cnsr),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
              AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pnr),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
              DrawSplittedText(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(bcr),this.FBuildItem.BindComponentText);
              DrawSplittedText(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(cnr),this.FBuildItem.ColumnsPropertyNameText);
              DrawSplittedText(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(cnsr),this.FBuildItem.ColumnsSubPropertyNameText);
              DrawSplittedText(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pnr),this.FBuildItem.PropertyNameText);
            };
          };
          x = 40;
          for (var $l = 0, $end = rtl.length(this.FBuildItem.SubFieldNamesRects) - 1; $l <= $end; $l++) {
            I = $l;
            r.$assign(this.FBuildItem.SubFieldNamesRects[I]);
            str = this.FBuildItem.SubFieldNamesTexts[I];
            if (this.FMode === $mod.TTMSFNCDataBindingEditorMode.dbemView) {
              AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
              DrawSplittedText(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),str);
            };
            y = Math.max(r.Bottom,y);
            x = Math.max(r.Right,x);
          };
          if (((rtl.length(this.FBuildItem.SubFieldNamesRects) > 0) || (rtl.length(this.FBuildItem.SubPropertyNamesRects) > 0)) && (this.FBuildItem.Item.FBindType in rtl.createSet(pas["WEBLib.TMSFNCDataBinding"].TTMSFNCDataBinderBindType.dbbtColumnList,pas["WEBLib.TMSFNCDataBinding"].TTMSFNCDataBinderBindType.dbbtList))) {
            AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(pnr.Right,pnr.Top + ((pnr.Bottom - pnr.Top) / 2))),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(pnr.Right + Math.round(sc * 10),pnr.Top + ((pnr.Bottom - pnr.Top) / 2))),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
            AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(pnr.Right + Math.round(sc * 10),pnr.Top + ((pnr.Bottom - pnr.Top) / 2))),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(pnr.Right + Math.round(sc * 10),pnr.Top + ((pnr.Bottom - pnr.Top) / 2) + Math.round(sc * 30))),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
          };
          if (rtl.length(this.FBuildItem.SubFieldNamesRects) > 0) {
            AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,pnr.Top + ((pnr.Bottom - pnr.Top) / 2) + Math.round(sc * 30))),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(Math.max(pnr.Right + Math.round(sc * 10),x),pnr.Top + ((pnr.Bottom - pnr.Top) / 2) + Math.round(sc * 30))),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
            AGraphics.DrawText(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,pnr.Bottom + Math.round(sc * 25))),"Sub field names",0,true,false,-1,-1);
          };
          if (rtl.length(this.FBuildItem.SubPropertyNamesRects) > 0) AGraphics.DrawText(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(x + Math.round(sc * 20),pnr.Bottom + Math.round(sc * 25))),"Sub property names",0,true,false,-1,-1);
          x = 0;
          for (var $l1 = 0, $end1 = rtl.length(this.FBuildItem.SubPropertyNamesRects) - 1; $l1 <= $end1; $l1++) {
            I = $l1;
            r.$assign(this.FBuildItem.SubPropertyNamesRects[I]);
            str = this.FBuildItem.SubPropertyNamesTexts[I];
            if (this.FMode === $mod.TTMSFNCDataBindingEditorMode.dbemView) {
              AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
              DrawSplittedText(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),str);
            };
            y = Math.max(r.Bottom,y);
            x = Math.max(r.Right,x);
          };
          if (rtl.length(this.FBuildItem.SubPropertyNamesRects) > 0) {
            AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(pnr.Left,pnr.Top + ((pnr.Bottom - pnr.Top) / 2) + Math.round(sc * 30))),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(pnr.Right + Math.round(sc * 10),pnr.Top + ((pnr.Bottom - pnr.Top) / 2) + Math.round(sc * 30))),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
            AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(pnr.Right + Math.round(sc * 10),pnr.Top + ((pnr.Bottom - pnr.Top) / 2) + Math.round(sc * 30))),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(x,pnr.Top + ((pnr.Bottom - pnr.Top) / 2) + Math.round(sc * 30))),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
          };
        };
        if (y === 0) y = Math.max(fnr.Bottom,pnr.Bottom);
        y = y + Math.round(sc * 10);
      };
    };
    this.DoFormKeyDown = function (Sender, Key, Shift) {
      if (Key.get() === 27) {
        this.frm.Close();
      } else if (Key.get() === 13) {
        this.frm.SetModalResult(1);
        this.frm.Close();
      };
    };
    this.ApplyCSS = function (ACSS) {
    };
    this.DoButtonOKClick = function (Sender) {
      if (this.frm != null) this.frm.SetModalResult(1);
    };
    this.DoButtonCancelClick = function (Sender) {
      if (this.frm != null) this.frm.SetModalResult(2);
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.Create$1.apply(this,arguments);
      return this;
    };
    this.Destroy = function () {
      if (this.FCachedComponentScreenShot != null) {
        rtl.free(this,"FCachedComponentScreenShot");
        this.FCachedComponentScreenShot = null;
      };
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.Execute = function (AProc) {
      var $Self = this;
      this.frm = $mod.TTMSFNCDataBindingEditorForm.$create("CreateDialogNew$1",[$Self,"Database Binding Editor"]);
      this.frm.SetWidth(1000);
      this.frm.SetHeight(500);
      this.frm.FOnKeyDown = rtl.createCallback($Self,"DoFormKeyDown");
      this.frm.FOnResize = rtl.createCallback($Self,"DoResizeForm");
      this.frm.SetPosition(pas["WEBLib.Forms"].TPosition.poScreenCenter);
      if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
        this.frm.SetColor(16119285)}
       else this.frm.SetColor(4406846);
      pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.ScaleForCurrentDPI(this.frm);
      this.frm.ShowModal$1(function (AResult) {
        $Self.frm = null;
        if (AProc != null) AProc(AResult);
      });
    };
    this.Assign = function (Source) {
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("DataBinder",0,pas["WEBLib.TMSFNCDataBinding"].$rtti["TTMSFNCDataBinder"],"FDataBinder","FDataBinder");
    $r.addProperty("Object",0,pas.System.$rtti["TObject"],"FObject","FObject");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
  rtl.createClass(this,"TTMSFNCDataBindingEditorForm",pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomDesignerForm,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomDesignerForm.$init.call(this);
      this.FDataBindingEditor = null;
    };
    this.$final = function () {
      this.FDataBindingEditor = undefined;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomDesignerForm.$final.call(this);
    };
    this.Loaded = function () {
      var css = "";
      pas["WEBLib.Forms"].TCustomForm.Loaded.call(this);
      css = pas["WEBLib.Forms"].Application.IDECSS();
      if (css !== "") {
        this.AddCSS("IDECSS",css);
        this.SetElementClassName("IDEBkg");
        this.FCaptionElement.setAttribute("class","IDECaption IDEFont");
        if (this.FDataBindingEditor != null) this.FDataBindingEditor.ApplyCSS(css);
      };
    };
    this.LoadDFMValues = function () {
      pas["WEBLib.Forms"].TCustomForm.LoadDFMValues.call(this);
      if (this.FDataBindingEditor != null) {
        this.FDataBindingEditor.BuildEditor(this);
        this.SetActiveControl(this.FDataBindingEditor.FTopPanel);
      };
    };
    this.CreateDialogNew$1 = function (ADataBindingEditor, ACaption) {
      this.FDataBindingEditor = ADataBindingEditor;
      pas["WEBLib.Forms"].TCustomForm.CreateDialogNew.call(this,ACaption);
      return this;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  $mod.$resourcestrings = {sTMSFNCDataBindingEditorOK: {org: "OK"}, sTMSFNCDataBindingEditorCancel: {org: "Cancel"}, sTMSFNCDataBindingEditorEditMode: {org: "&Edit Mode"}, sTMSFNCDataBindingEditorCloseEditMode: {org: "&Close Edit Mode"}, sTMSFNCDataBindingEditorActive: {org: "Active"}, sTMSFNCDataBindingEditorAdd: {org: "Add"}, sTMSFNCDataBindingEditorDelete: {org: "Delete"}, sTMSFNCDataBindingEditorDuplicate: {org: "Duplicate"}};
  $mod.$implcode = function () {
    $impl.TranslateTextEx = function (AText) {
      var Result = "";
      Result = AText;
      return Result;
    };
  };
},["Math","TypInfo","WEBLib.TMSFNCPersistence","WEBLib.TMSFNCUtils","SysUtils","WEBLib.Dialogs","WEBLib.TMSFNCEditorsTools","WEBLib.WebTools","DB","WEBLib.DB"]);
rtl.module("WEBLib.TMSFNCDataBinding",["System","Classes","WEBLib.TMSFNCPersistence","WEBLib.TMSFNCTypes","WEBLib.TMSFNCCustomComponent","WEBLib.Controls","TypInfo","Generics.Collections","DB"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.MAJ_VER = 1;
  this.MIN_VER = 0;
  this.REL_VER = 0;
  this.BLD_VER = 2;
  rtl.createInterface(this,"ITMSFNCDataBinderBase","{778B63C9-34E3-4B65-A6B8-85E3EB1D17C3}",["DataBeginUpdate","DataEndUpdate"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("DataBeginUpdate",0,[]);
    $r.addMethod("DataEndUpdate",0,[]);
  });
  rtl.createInterface(this,"ITMSFNCDataBinderGrid","{D23BDEAA-49B1-451A-9401-0D0D11A9957A}",["SetDataColumnCount","SetDataRowCount","ClearData","GetDataRowCount","SetDataValue","SetDataHeader","DataInsertRow"],this.ITMSFNCDataBinderBase,function () {
    var $r = this.$rtti;
    $r.addMethod("SetDataColumnCount",0,[["AValue",rtl.longint]]);
    $r.addMethod("SetDataRowCount",0,[["AValue",rtl.longint]]);
    $r.addMethod("ClearData",0,[]);
    $r.addMethod("GetDataRowCount",1,[],2,rtl.longint);
    $r.addMethod("SetDataValue",0,[["AColumn",rtl.longint],["ARow",rtl.longint],["AValue",rtl.string]]);
    $r.addMethod("SetDataHeader",0,[["AColumn",rtl.longint],["AValue",rtl.string]]);
    $r.addMethod("DataInsertRow",0,[["AInsertPosition",rtl.longint]]);
  });
  rtl.createInterface(this,"ITMSFNCDataBinderSelection","{F7D3F4D2-F202-48C0-9036-3F03E642F1E5}",["DataGetItemIndex","DataSetItemIndex"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("DataGetItemIndex",1,[],2,rtl.longint);
    $r.addMethod("DataSetItemIndex",0,[["AValue",rtl.longint]]);
  });
  this.TTMSFNCDataBinderNotificationType = {"0": "dbntUpdate", dbntUpdate: 0, "1": "dbntEdit", dbntEdit: 1, "2": "dbntPost", dbntPost: 2, "3": "dbntValueChanged", dbntValueChanged: 3, "4": "dbntSetActiveRecord", dbntSetActiveRecord: 4};
  this.$rtti.$Enum("TTMSFNCDataBinderNotificationType",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TTMSFNCDataBinderNotificationType});
  rtl.createInterface(this,"ITMSFNCDataBinderNotification","{3CEED28B-A125-4B26-B765-72785F2B0180}",["GetObject","SetObject","Notify"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("GetObject",1,[],2,pas.System.$rtti["TObject"]);
    $r.addMethod("SetObject",0,[["Value",pas.System.$rtti["TObject"],2]]);
    $r.addMethod("Notify",0,[["AType",$mod.$rtti["TTMSFNCDataBinderNotificationType"]]]);
    $r.addProperty("Object",3,pas.System.$rtti["TObject"],"GetObject","SetObject",2);
  });
  rtl.createInterface(this,"ITMSFNCDataBinderNotificationManager","{AFAFFAD9-AA33-4063-9BCB-6A17EC97D5C1}",["Notify"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("Notify",0,[["AControl",pas.System.$rtti["TObject"]],["AType",$mod.$rtti["TTMSFNCDataBinderNotificationType"]]]);
  });
  rtl.createInterface(this,"ITMSFNCDataBinderNotificationManagerReference","{AFAFFAD9-AA33-4063-9BCB-6A17EC97D5C1}",["AddManager","RemoveManager"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("AddManager",0,[["AManager",$mod.$rtti["ITMSFNCDataBinderNotificationManager"]]]);
    $r.addMethod("RemoveManager",0,[]);
  });
  rtl.createClass(this,"TTMSFNCDataBinderNotificationManager",pas.Classes.TList,function () {
    this.$init = function () {
      pas.Classes.TList.$init.call(this);
      this.FOwnerInterface = null;
    };
    this.$final = function () {
      rtl.setIntfP(this,"FOwnerInterface",null);
      pas.Classes.TList.$final.call(this);
    };
    this._AddRef = function () {
      var Result = 0;
      if (this.FOwnerInterface !== null) {
        Result = this.FOwnerInterface._AddRef()}
       else Result = -1;
      return Result;
    };
    this._Release = function () {
      var Result = 0;
      if (this.FOwnerInterface !== null) {
        Result = this.FOwnerInterface._Release()}
       else Result = -1;
      return Result;
    };
    this.HasObject = function (AObject) {
      var Result = false;
      var I = 0;
      var ifn = null;
      try {
        Result = false;
        for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          ifn = rtl.setIntfL(ifn,rtl.getObject(this.Get(I)));
          if (ifn.GetObject() === AObject) {
            Result = true;
            break;
          };
        };
      } finally {
        rtl._Release(ifn);
      };
      return Result;
    };
    var E_NOINTERFACE = 0x80004002;
    this.QueryInterface = function (IID, Obj) {
      var Result = 0;
      if (this.GetInterface(IID,Obj)) {
        Result = 0}
       else Result = -2147467262;
      return Result;
    };
    this.Notify$1 = function (AObject, AType) {
      var I = 0;
      var ifn = null;
      try {
        for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          ifn = rtl.setIntfL(ifn,rtl.getObject(this.Get(I)));
          if (ifn.GetObject() === AObject) ifn.Notify(AType);
        };
      } finally {
        rtl._Release(ifn);
      };
    };
    rtl.addIntf(this,$mod.ITMSFNCDataBinderNotificationManager,{Notify: "Notify$1"});
  });
  this.$rtti.$Class("TTMSFNCDataBinder");
  this.$rtti.$Class("TTMSFNCDataBinderItem");
  this.TTMSFNCDataBinderDataLinkMode = {"0": "dlmActiveChanged", dlmActiveChanged: 0, "1": "dlmDataSetChanged", dlmDataSetChanged: 1, "2": "dlmDataSetScrolled", dlmDataSetScrolled: 2, "3": "dlmRecordChanged", dlmRecordChanged: 3, "4": "dlmUpdateData", dlmUpdateData: 4};
  this.$rtti.$Enum("TTMSFNCDataBinderDataLinkMode",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TTMSFNCDataBinderDataLinkMode});
  rtl.createClass(this,"TTMSFNCDataBinderDataLink",pas.DB.TDataLink,function () {
    this.$init = function () {
      pas.DB.TDataLink.$init.call(this);
      this.FDataBinderItem = null;
    };
    this.$final = function () {
      this.FDataBinderItem = undefined;
      pas.DB.TDataLink.$final.call(this);
    };
    this.ActiveChanged = function () {
      this.FDataBinderItem.UpdateDataLink($mod.TTMSFNCDataBinderDataLinkMode.dlmActiveChanged,-1,null);
    };
    this.DataSetChanged = function () {
      this.FDataBinderItem.UpdateDataLink($mod.TTMSFNCDataBinderDataLinkMode.dlmDataSetChanged,-1,null);
    };
    this.DataSetScrolled = function (Distance) {
      this.FDataBinderItem.UpdateDataLink($mod.TTMSFNCDataBinderDataLinkMode.dlmDataSetScrolled,Distance,null);
    };
    this.RecordChanged = function (Field) {
      if (Field != null) this.FDataBinderItem.UpdateDataLink($mod.TTMSFNCDataBinderDataLinkMode.dlmRecordChanged,-1,Field);
    };
    this.UpdateData = function () {
      this.FDataBinderItem.UpdateDataLink($mod.TTMSFNCDataBinderDataLinkMode.dlmUpdateData,-1,null);
    };
    this.Create$2 = function (ADataBinderItem) {
      this.FDataBinderItem = ADataBinderItem;
      this.FVisualControl = true;
      return this;
    };
    this.Destroy = function () {
      pas.DB.TDataLink.Destroy.call(this);
    };
  });
  this.TTMSFNCDataBinderBindType = {"0": "dbbtSingleValue", dbbtSingleValue: 0, "1": "dbbtList", dbbtList: 1, "2": "dbbtColumnList", dbbtColumnList: 2, "3": "dbbtGrid", dbbtGrid: 3};
  this.$rtti.$Enum("TTMSFNCDataBinderBindType",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TTMSFNCDataBinderBindType});
  rtl.createClass(this,"TTMSFNCDataBinderPropertyName",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FDataBinderItem = null;
      this.FValue = "";
    };
    this.$final = function () {
      this.FDataBinderItem = undefined;
      pas.Classes.TCollectionItem.$final.call(this);
    };
    this.SetValue = function (Value) {
      if (this.FValue !== Value) {
        this.FValue = Value;
        if (this.FDataBinderItem != null) this.FDataBinderItem.UpdateDataLink($mod.TTMSFNCDataBinderDataLinkMode.dlmActiveChanged,-1,null);
      };
    };
    this.Create$1 = function (ACollection) {
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      this.FDataBinderItem = rtl.as(this.FCollection,$mod.TTMSFNCDataBinderPropertyNames).FOwner$1;
      return this;
    };
    this.Destroy = function () {
      pas.Classes.TCollectionItem.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataBinderPropertyName.isPrototypeOf(Source)) {
        this.FValue = rtl.as(Source,$mod.TTMSFNCDataBinderPropertyName).FValue;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Value",2,rtl.string,"FValue","SetValue");
  });
  rtl.createClass(this,"TTMSFNCDataBinderPropertyNames",pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$init.call(this);
      this.FOwner$1 = null;
    };
    this.$final = function () {
      this.FOwner$1 = undefined;
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$final.call(this);
    };
    this.GetItemEx = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItemEx = function (Index, Value) {
      pas.Classes.TCollection.SetItem.call(this,Index,Value);
    };
    this.GetDataBinderPropertyNameClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCDataBinderPropertyName;
      return Result;
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,this.GetDataBinderPropertyNameClass());
      this.FOwner$1 = AOwner;
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,index);
      return Result;
    };
  });
  rtl.createClass(this,"TTMSFNCDataBinderFieldName",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FDataBinderItem = null;
      this.FValue = "";
      this.FHTMLTemplate = "";
    };
    this.$final = function () {
      this.FDataBinderItem = undefined;
      pas.Classes.TCollectionItem.$final.call(this);
    };
    this.SetValue = function (Value) {
      if (this.FValue !== Value) {
        this.FValue = Value;
        if (this.FDataBinderItem != null) this.FDataBinderItem.UpdateDataLink($mod.TTMSFNCDataBinderDataLinkMode.dlmActiveChanged,-1,null);
      };
    };
    this.SetHTMLTemplate = function (Value) {
      if (this.FHTMLTemplate !== Value) {
        this.FHTMLTemplate = Value;
        if (this.FDataBinderItem != null) this.FDataBinderItem.UpdateDataLink($mod.TTMSFNCDataBinderDataLinkMode.dlmActiveChanged,-1,null);
      };
    };
    this.Create$1 = function (ACollection) {
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      this.FDataBinderItem = rtl.as(this.FCollection,$mod.TTMSFNCDataBinderFieldNames).FOwner$1;
      return this;
    };
    this.Destroy = function () {
      pas.Classes.TCollectionItem.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataBinderFieldName.isPrototypeOf(Source)) {
        this.FValue = rtl.as(Source,$mod.TTMSFNCDataBinderFieldName).FValue;
        this.FHTMLTemplate = rtl.as(Source,$mod.TTMSFNCDataBinderFieldName).FHTMLTemplate;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Value",2,rtl.string,"FValue","SetValue");
    $r.addProperty("HTMLTemplate",2,rtl.string,"FHTMLTemplate","SetHTMLTemplate");
  });
  rtl.createClass(this,"TTMSFNCDataBinderFieldNames",pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$init.call(this);
      this.FOwner$1 = null;
    };
    this.$final = function () {
      this.FOwner$1 = undefined;
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$final.call(this);
    };
    this.GetItemEx = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItemEx = function (Index, Value) {
      pas.Classes.TCollection.SetItem.call(this,Index,Value);
    };
    this.GetDataBinderFieldNameClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCDataBinderFieldName;
      return Result;
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,this.GetDataBinderFieldNameClass());
      this.FOwner$1 = AOwner;
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,index);
      return Result;
    };
  });
  this.TTMSFNCDataBinderFindType = {"0": "bftDontCare", bftDontCare: 0, "1": "bftClass", bftClass: 1, "2": "bftString", bftString: 2};
  this.$rtti.$Enum("TTMSFNCDataBinderFindType",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCDataBinderFindType});
  rtl.createClass(this,"TTMSFNCDataBinderControlValueMonitor",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FActive = false;
      this.FBinderItem = null;
    };
    this.$final = function () {
      this.FBinderItem = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function (ABinderItem) {
      pas.System.TObject.Create.call(this);
      this.FActive = false;
      this.FBinderItem = ABinderItem;
      return this;
    };
    this.Destroy = function () {
      this.StopMonitoring();
      pas.System.TObject.Destroy.call(this);
    };
    this.StartMonitoring = function () {
    };
    this.StopMonitoring = function () {
    };
  });
  rtl.createClass(this,"TTMSFNCDataBinderEditLinkMonitor",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FActive = false;
      this.FBinderItem = null;
    };
    this.$final = function () {
      this.FBinderItem = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function (ABinderItem) {
      pas.System.TObject.Create.call(this);
      this.FActive = false;
      this.FBinderItem = ABinderItem;
      return this;
    };
    this.Destroy = function () {
      this.StopMonitoring();
      pas.System.TObject.Destroy.call(this);
    };
    this.StartMonitoring = function () {
    };
    this.StopMonitoring = function () {
    };
  });
  rtl.createClass(this,"TTMSFNCDataBinderItem",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FControlValueMonitor = null;
      this.FEditLinkMonitor = null;
      this.FOwnerInterface = null;
      this.FDirty = false;
      this.FUpdating = false;
      this.FDataBinder = null;
      this.FDataLink = null;
      this.FActive = false;
      this.FBindType = 0;
      this.FObject = null;
      this.FPropertyName = "";
      this.FFieldName = "";
      this.FSubPropertyNames = null;
      this.FSubFieldNames = null;
      this.FColumnsPropertyName = "";
      this.FColumnsSubPropertyName = "";
      this.FBufferCount = 0;
      this.FBooleanStringValue = "";
      this.FHTMLTemplate = "";
      this.FName = "";
    };
    this.$final = function () {
      this.FControlValueMonitor = undefined;
      this.FEditLinkMonitor = undefined;
      rtl.setIntfP(this,"FOwnerInterface",null);
      this.FDataBinder = undefined;
      this.FDataLink = undefined;
      this.FObject = undefined;
      this.FSubPropertyNames = undefined;
      this.FSubFieldNames = undefined;
      pas.Classes.TCollectionItem.$final.call(this);
    };
    this.GetField = function () {
      var Result = null;
      Result = null;
      if (this.CheckDataSet()) {
        if (this.FFieldName !== "") Result = this.FDataLink.GetDataset().FieldByName(this.FFieldName);
      };
      return Result;
    };
    this.GetDataSource = function () {
      var Result = null;
      Result = this.FDataLink.FDataSource;
      return Result;
    };
    this.SetDataSource = function (Value) {
      if (Value === this.FDataLink.FDataSource) return;
      this.FDataLink.SetDataSource(Value);
      if (!(this.FDataLink.FDataSource != null)) {
        this.FSubFieldNames.Clear();
        this.FSubPropertyNames.Clear();
        this.FFieldName = "";
        this.UpdateDataLink($mod.TTMSFNCDataBinderDataLinkMode.dlmActiveChanged,-1,null);
      };
      if (Value !== null) Value.FreeNotification(this.FDataBinder);
    };
    this.SetActive = function (Value) {
      if (this.FActive !== Value) {
        this.FActive = Value;
        this.UpdateDataLink($mod.TTMSFNCDataBinderDataLinkMode.dlmActiveChanged,-1,null);
      };
    };
    this.SetBindType = function (Value) {
      if (this.FBindType !== Value) {
        this.FBindType = Value;
        this.UpdateDataLink($mod.TTMSFNCDataBinderDataLinkMode.dlmActiveChanged,-1,null);
      };
    };
    this.SetObject = function (Value) {
      var m = null;
      var $ir = rtl.createIntfRefs();
      try {
        if ((this.FObject != null) && !(Value != null)) {
          $impl.FManager.Remove(this);
          if (!$impl.FManager.HasObject(this.FObject) && pas.SysUtils.Supports$3(this.FObject,$mod.ITMSFNCDataBinderNotificationManagerReference.$guid,{get: function () {
              return m;
            }, set: function (v) {
              m = v;
            }})) m.RemoveManager();
        };
        if ((this.FObject != null) && (this.FObject !== Value)) this.DestroyMonitors();
        this.FObject = Value;
        if (this.FObject != null) {
          $impl.FManager.Add(this);
          if (pas.SysUtils.Supports$3(this.FObject,$mod.ITMSFNCDataBinderNotificationManagerReference.$guid,{get: function () {
              return m;
            }, set: function (v) {
              m = v;
            }})) m.AddManager($ir.ref(1,rtl.queryIntfT($impl.FManager,$mod.ITMSFNCDataBinderNotificationManager)));
        };
        this.UpdateDataLink($mod.TTMSFNCDataBinderDataLinkMode.dlmActiveChanged,-1,null);
      } finally {
        $ir.free();
        rtl._Release(m);
      };
    };
    this.SetPropertyName = function (Value) {
      if (this.FPropertyName !== Value) {
        this.FPropertyName = Value;
        this.UpdateDataLink($mod.TTMSFNCDataBinderDataLinkMode.dlmActiveChanged,-1,null);
      };
    };
    this.SetFieldName = function (Value) {
      if (this.FFieldName !== Value) {
        this.FFieldName = Value;
        this.DestroyMonitors();
        this.UpdateDataLink($mod.TTMSFNCDataBinderDataLinkMode.dlmUpdateData,-1,null);
      };
    };
    this.SetColumnsPropertyName = function (Value) {
      if (this.FColumnsPropertyName !== Value) {
        this.FColumnsPropertyName = Value;
        this.UpdateDataLink($mod.TTMSFNCDataBinderDataLinkMode.dlmActiveChanged,-1,null);
      };
    };
    this.SetColumnsSubPropertyName = function (Value) {
      if (this.FColumnsSubPropertyName !== Value) {
        this.FColumnsSubPropertyName = Value;
        this.UpdateDataLink($mod.TTMSFNCDataBinderDataLinkMode.dlmActiveChanged,-1,null);
      };
    };
    this.SetBufferCount = function (Value) {
      if (this.FBufferCount !== Value) {
        this.FBufferCount = Value;
        if (this.FDataLink != null) this.FDataLink.SetBufferCount(this.FBufferCount);
        this.UpdateDataLink($mod.TTMSFNCDataBinderDataLinkMode.dlmActiveChanged,-1,null);
      };
    };
    this.GetBindComponent = function () {
      var Result = null;
      Result = null;
      if ((this.FObject != null) && pas.Classes.TComponent.isPrototypeOf(this.FObject)) Result = this.FObject;
      return Result;
    };
    this.SetBindComponent = function (Value) {
      this.SetObject(Value);
    };
    this.SetBooleanStringValue = function (Value) {
      if (this.FBooleanStringValue !== Value) {
        this.FBooleanStringValue = Value;
        this.UpdateDataLink($mod.TTMSFNCDataBinderDataLinkMode.dlmActiveChanged,-1,null);
      };
    };
    this.SetHTMLTemplate = function (Value) {
      if (this.FHTMLTemplate !== Value) {
        this.FHTMLTemplate = Value;
        this.UpdateDataLink($mod.TTMSFNCDataBinderDataLinkMode.dlmActiveChanged,-1,null);
      };
    };
    this.GetObjectInstance = function () {
      var Result = null;
      Result = this.GetObject();
      return Result;
    };
    this.SetObjectInstance = function (Value) {
      this.SetObject(Value);
    };
    this.GetObject = function () {
      var Result = null;
      Result = this.FObject;
      return Result;
    };
    this.GetControlValueMonitor = function () {
      var Result = null;
      if (!(this.FControlValueMonitor != null) && !this.FDataBinder.HasEditLinkMonitor(this.GetObject()) && !this.FDataBinder.HasControlValueMonitor(this.GetObject())) {
        this.FControlValueMonitor = $mod.TTMSFNCDataBinderControlValueMonitor.$create("Create$1",[this]);
        this.FControlValueMonitor.StartMonitoring();
      };
      Result = this.FControlValueMonitor;
      return Result;
    };
    this.GetEditLinkMonitor = function () {
      var Result = null;
      if (!(this.FEditLinkMonitor != null) && !this.FDataBinder.HasEditLinkMonitor(this.GetObject())) {
        this.FEditLinkMonitor = $mod.TTMSFNCDataBinderEditLinkMonitor.$create("Create$1",[this]);
        this.FEditLinkMonitor.StartMonitoring();
      };
      Result = this.FEditLinkMonitor;
      return Result;
    };
    this.Reset = function () {
    };
    this.SetIsReadOnly = function (AValue) {
    };
    this.Modified = function () {
      this.FDirty = true;
    };
    this.GetCanModify = function () {
      var Result = false;
      var f = null;
      Result = false;
      f = this.GetField();
      if (f != null) Result = f.GetCanModify();
      return Result;
    };
    this.IsValidChar = function (AChar) {
      var Result = false;
      var f = null;
      Result = false;
      f = this.GetField();
      if (f != null) {
        if (AChar === "\x00") {
          Result = f.GetCanModify()}
         else Result = f.IsValidChar(AChar);
      };
      return Result;
    };
    this.IsRequired = function () {
      var Result = false;
      var f = null;
      Result = false;
      f = this.GetField();
      if (f != null) Result = f.FRequired;
      return Result;
    };
    this.GetComponent = function () {
      var Result = null;
      Result = null;
      if ((this.GetObject() != null) && pas.Classes.TComponent.isPrototypeOf(this.GetObject())) Result = rtl.as(this.GetObject(),pas.Classes.TComponent);
      return Result;
    };
    this.DestroyMonitors = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FControlValueMonitor;
        }, set: function (v) {
          this.p.FControlValueMonitor = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FEditLinkMonitor;
        }, set: function (v) {
          this.p.FEditLinkMonitor = v;
        }});
    };
    this.DoChanged = function (Sender) {
      this.UpdateDataLink($mod.TTMSFNCDataBinderDataLinkMode.dlmActiveChanged,-1,null);
    };
    this.Notify = function (AType) {
      var bs = null;
      var r = 0;
      try {
        if (this.CheckDataSet() && !this.FUpdating && !$impl.FGlobalUpdating) {
          var $tmp = AType;
          if ($tmp === $mod.TTMSFNCDataBinderNotificationType.dbntSetActiveRecord) {
            this.FUpdating = true;
            try {
              if (pas.SysUtils.Supports$3(this.GetObject(),$mod.ITMSFNCDataBinderSelection.$guid,{get: function () {
                  return bs;
                }, set: function (v) {
                  bs = v;
                }})) {
                r = bs.DataGetItemIndex() + 1;
                if (r >= 1) this.FDataLink.FDataSource.FDataSet.SetRecNo(r);
              };
            } finally {
              this.FUpdating = false;
            };
          } else if ($tmp === $mod.TTMSFNCDataBinderNotificationType.dbntUpdate) {
            this.UpdateDataLink($mod.TTMSFNCDataBinderDataLinkMode.dlmUpdateData,-1,null)}
           else if ($tmp === $mod.TTMSFNCDataBinderNotificationType.dbntEdit) {
            this.DataSetEdit()}
           else if ($tmp === $mod.TTMSFNCDataBinderNotificationType.dbntValueChanged) {
            this.WriteValueToField()}
           else if ($tmp === $mod.TTMSFNCDataBinderNotificationType.dbntPost) this.DataSetPost();
        };
      } finally {
        rtl._Release(bs);
      };
    };
    this.HasControlValueMonitor = function () {
      var Result = false;
      Result = this.FControlValueMonitor != null;
      return Result;
    };
    this.HasEditLinkMonitor = function () {
      var Result = false;
      Result = this.FEditLinkMonitor != null;
      return Result;
    };
    this.TryGetObjectStringValue = function (AObject, AValue) {
      var Result = false;
      var p = null;
      Result = false;
      AValue.set("");
      if (!(AObject != null)) return Result;
      p = this.InternalFindProperty(AObject,"Text",$mod.TTMSFNCDataBinderFindType.bftString,true);
      if ((p != null) && !pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsWriteOnly(p)) {
        AValue.set(pas.TypInfo.GetStrProp$1(AObject,p));
        Result = true;
        return Result;
      };
      p = this.InternalFindProperty(AObject,"AsString",$mod.TTMSFNCDataBinderFindType.bftString,true);
      if ((p != null) && !pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsWriteOnly(p)) {
        AValue.set(pas.TypInfo.GetStrProp$1(AObject,p));
        Result = true;
      };
      return Result;
    };
    this.TrySetObjectStringValue = function (AObject, AValue) {
      var Result = false;
      var p = null;
      Result = false;
      if (!(AObject != null)) return Result;
      p = this.InternalFindProperty(AObject,"Text",$mod.TTMSFNCDataBinderFindType.bftString,true);
      if ((p != null) && !pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsReadOnly(p)) {
        pas.TypInfo.SetStrProp$1(AObject,p,AValue);
        Result = true;
        return Result;
      };
      p = this.InternalFindProperty(AObject,"AsString",$mod.TTMSFNCDataBinderFindType.bftString,true);
      if ((p != null) && !pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsReadOnly(p)) {
        pas.TypInfo.SetStrProp$1(AObject,p,AValue);
        Result = true;
      };
      return Result;
    };
    this.HTMLDBReplace = function (AValue, ADataset) {
      var Result = "";
      var beforetag = "";
      var aftertag = "";
      var fld = "";
      var dbfld = "";
      var i = 0;
      var j = 0;
      var AField = null;
      beforetag = "";
      while (pas.System.Pos("<#",AValue) > 0) {
        i = pas.System.Pos("<#",AValue);
        beforetag = beforetag + pas.System.Copy(AValue,1,i - 1);
        aftertag = pas.System.Copy(AValue,i,AValue.length);
        j = pas.System.Pos(">",aftertag);
        fld = pas.System.Copy(aftertag,1,j - 1);
        pas.System.Delete({get: function () {
            return fld;
          }, set: function (v) {
            fld = v;
          }},1,2);
        pas.System.Delete({get: function () {
            return AValue;
          }, set: function (v) {
            AValue = v;
          }},1,(i + j) - 1);
        dbfld = "";
        if (ADataset != null) {
          if (ADataset.GetActive()) {
            AField = ADataset.FindField(fld);
            if (AField != null) {
              if (AField.$class.IsBlob()) {
                if (AField.FOnGetText != null) {
                  dbfld = AField.GetDisplayText()}
                 else dbfld = AField.GetAsString();
              } else dbfld = AField.GetDisplayText();
            };
          } else dbfld = "(" + fld + ")";
        } else dbfld = "(" + fld + ")";
        beforetag = beforetag + dbfld;
      };
      Result = beforetag + AValue;
      return Result;
    };
    this.GetDisplayName = function () {
      var Result = "";
      if (this.FName !== "") {
        Result = this.FName}
       else Result = "";
      return Result;
    };
    this.InternalFindProperty = function (AObject, AName, AFindType, IncludePublic) {
      var Result = null;
      var ci = null;
      var a = [];
      var p = null;
      var pName = "";
      var I = 0;
      var k = 0;
      Result = null;
      if (!(AObject != null)) return Result;
      ci = AObject.$rtti;
      try {
        a = pas.TypInfo.GetPropList(ci,pas.System.tkProperties,true);
        for (var $l = 0, $end = rtl.length(a) - 1; $l <= $end; $l++) {
          I = $l;
          p = a[I];
          pName = pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.GetPropInfoName(p);
          k = pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.GetPropInfoType(p);
          if ((pas.SysUtils.UpperCase(pName) === pas.SysUtils.UpperCase(AName)) && ((AFindType === $mod.TTMSFNCDataBinderFindType.bftDontCare) || ((AFindType === $mod.TTMSFNCDataBinderFindType.bftClass) && (k === pas.System.TTypeKind.tkClass)) || ((AFindType === $mod.TTMSFNCDataBinderFindType.bftString) && (k in rtl.createSet(pas.System.TTypeKind.tkChar,pas.System.TTypeKind.tkString))))) {
            Result = p;
            break;
          };
        };
      } finally {
      };
      return Result;
    };
    this.FindProperty = function (AObject, AName, AIndex, AFindType) {
      var Result = null;
      var sl = null;
      var I = 0;
      var p = null;
      var o = null;
      o = AObject.get();
      Result = null;
      if (!(o != null)) return Result;
      sl = pas.Classes.TStringList.$create("Create$1");
      try {
        pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.Split(".",AName,sl,false);
        for (var $l = 0, $end = sl.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          p = this.InternalFindProperty(o,sl.Get(I),AFindType,true);
          if (p != null) {
            if ((I === 0) && (sl.GetCount() > 1) && (pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.GetPropInfoType(p) === pas.System.TTypeKind.tkClass)) {
              o = pas.TypInfo.GetObjectProp$2(o,p);
              if (pas.Classes.TCollection.isPrototypeOf(o)) {
                if ((AIndex >= 0) && (AIndex <= (rtl.as(o,pas.Classes.TCollection).GetCount() - 1))) {
                  o = rtl.as(o,pas.Classes.TCollection).GetItem(AIndex)}
                 else o = rtl.as(o,pas.Classes.TCollection).Add();
              };
            } else {
              Result = p;
              break;
            };
          };
        };
        AObject.set(o);
      } finally {
        sl = rtl.freeLoc(sl);
      };
      return Result;
    };
    this.DoBeforeWriteFieldToProperty = function (AObject, AItem, APropertyInfo, APropertyName, APropertyKind, AField, AAllow) {
      if (this.FDataBinder != null) this.FDataBinder.DoBeforeWriteFieldToProperty(AObject,AItem,APropertyInfo,APropertyName,APropertyKind,AField,AAllow);
    };
    this.DoAfterWriteFieldToProperty = function (AObject, AItem, APropertyInfo, APropertyName, APropertyKind, AField) {
      if (this.FDataBinder != null) this.FDataBinder.DoAfterWriteFieldToProperty(AObject,AItem,APropertyInfo,APropertyName,APropertyKind,AField);
    };
    this.DoBeforeWritePropertyToField = function (AObject, AItem, APropertyInfo, APropertyName, APropertyKind, AField, AAllow) {
      if (this.FDataBinder != null) this.FDataBinder.DoBeforeWritePropertyToField(AObject,AItem,APropertyInfo,APropertyName,APropertyKind,AField,AAllow);
    };
    this.DoAfterWritePropertyToField = function (AObject, AItem, APropertyInfo, APropertyName, APropertyKind, AField) {
      if (this.FDataBinder != null) this.FDataBinder.DoAfterWritePropertyToField(AObject,AItem,APropertyInfo,APropertyName,APropertyKind,AField);
    };
    this.DoBeforeWriteHTMLTemplateToProperty = function (AObject, AItem, APropertyInfo, APropertyName, APropertyKind, AHTMLTemplate, AAllow) {
      if (this.FDataBinder != null) this.FDataBinder.DoBeforeWriteHTMLTemplateToProperty(AObject,AItem,APropertyInfo,APropertyName,APropertyKind,AHTMLTemplate,AAllow);
    };
    this.DoAfterWriteHTMLTemplateToProperty = function (AObject, AItem, APropertyInfo, APropertyName, APropertyKind, AHTMLTemplate) {
      if (this.FDataBinder != null) this.FDataBinder.DoAfterWriteHTMLTemplateToProperty(AObject,AItem,APropertyInfo,APropertyName,APropertyKind,AHTMLTemplate);
    };
    this.WriteFieldToProperty = function (AObject, APropInfo, AField) {
      var a = false;
      var pName = "";
      var cn = "";
      var k = 0;
      var p = null;
      var o = null;
      var i = 0;
      var s = "";
      var dt = 0.0;
      var ui = 0;
      var ob = null;
      var bt = null;
      var ms = null;
      var sl = null;
      var useDisplayText = false;
      if (!(AField != null) || !(AObject != null) || !(APropInfo != null)) return;
      o = AObject;
      p = APropInfo;
      pName = pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.GetPropInfoName(p);
      k = pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.GetPropInfoType(p);
      a = true;
      this.DoBeforeWriteFieldToProperty(o,this,p,pName,k,AField,{get: function () {
          return a;
        }, set: function (v) {
          a = v;
        }});
      if (!a) return;
      try {
        var $tmp = k;
        if ($tmp === pas.System.TTypeKind.tkClass) {
          cn = pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.GetPropInfoTypeName(p);
          ob = pas.TypInfo.GetObjectProp(AObject,pName);
          if (!(ob != null)) return;
          if (pas.Classes.TStrings.isPrototypeOf(ob)) {
            var $tmp1 = AField.FDataType;
            if (($tmp1 === pas.DB.TFieldType.ftString) || ($tmp1 === pas.DB.TFieldType.ftWideString) || ($tmp1 === pas.DB.TFieldType.ftFixedChar) || ($tmp1 === pas.DB.TFieldType.ftFixedWideChar)) {
              if (AField.FOnGetText != null) {
                rtl.as(ob,pas.Classes.TStrings).SetTextStr(AField.GetDisplayText())}
               else rtl.as(ob,pas.Classes.TStrings).SetTextStr(AField.GetAsString())}
             else if (($tmp1 === pas.DB.TFieldType.ftMemo) || ($tmp1 === pas.DB.TFieldType.ftFmtMemo) || ($tmp1 === pas.DB.TFieldType.ftWideMemo) || ($tmp1 === pas.DB.TFieldType.ftOraClob)) {
              if (AField.FOnGetText != null) {
                rtl.as(ob,pas.Classes.TStrings).SetTextStr(AField.GetDisplayText())}
               else rtl.as(ob,pas.Classes.TStrings).SetTextStr(AField.GetAsString())}
             else if (($tmp1 === pas.DB.TFieldType.ftBlob) || ($tmp1 === pas.DB.TFieldType.ftOraBlob)) {
              rtl.as(ob,pas.Classes.TStrings).SetTextStr(AField.GetAsString());
            } else {
              rtl.as(ob,pas.Classes.TStrings).SetTextStr(AField.GetDisplayText());
            };
          } else if (pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsGenericList(ob.$class.ClassType(),"String")) {
            var $tmp2 = AField.FDataType;
            if (($tmp2 === pas.DB.TFieldType.ftString) || ($tmp2 === pas.DB.TFieldType.ftWideString) || ($tmp2 === pas.DB.TFieldType.ftMemo) || ($tmp2 === pas.DB.TFieldType.ftWideMemo)) {
              ob.Clear();
              sl = pas.Classes.TStringList.$create("Create$1");
              try {
                if (AField.FOnGetText != null) {
                  sl.SetTextStr(AField.GetDisplayText())}
                 else sl.SetTextStr(AField.GetAsString());
                for (var $l = 0, $end = sl.GetCount() - 1; $l <= $end; $l++) {
                  i = $l;
                  ob.Add(sl.Get(i));
                };
              } finally {
                sl = rtl.freeLoc(sl);
              };
            };
          } else if (pas.Classes.TPersistent.isPrototypeOf(ob)) {
            var $tmp3 = AField.FDataType;
            if (($tmp3 === pas.DB.TFieldType.ftString) || ($tmp3 === pas.DB.TFieldType.ftWideString) || ($tmp3 === pas.DB.TFieldType.ftMemo) || ($tmp3 === pas.DB.TFieldType.ftWideMemo) || ($tmp3 === pas.DB.TFieldType.ftFixedChar)) {
              if (AField.FOnGetText != null) {
                this.TrySetObjectStringValue(ob,AField.GetDisplayText())}
               else this.TrySetObjectStringValue(ob,AField.GetAsString())}
             else {
              this.TrySetObjectStringValue(ob,AField.GetDisplayText());
            };
          };
        } else if ($tmp === pas.System.TTypeKind.tkInteger) {
          if (!pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsReadOnly(p)) {
            useDisplayText = (AField.FOnGetText != null) && (AField.FDataType in rtl.createSet(pas.DB.TFieldType.ftString,pas.DB.TFieldType.ftWideString,pas.DB.TFieldType.ftFixedChar,pas.DB.TFieldType.ftFixedWideChar));
            var $tmp4 = AField.FDataType;
            if (($tmp4 === pas.DB.TFieldType.ftSmallint) || ($tmp4 === pas.DB.TFieldType.ftInteger) || ($tmp4 === pas.DB.TFieldType.ftWord)) {
              pas.TypInfo.SetOrdProp$1(o,p,AField.GetAsInteger())}
             else if ($tmp4 === pas.DB.TFieldType.ftAutoInc) {
              pas.TypInfo.SetOrdProp$1(o,p,AField.GetAsInteger())}
             else if ($tmp4 === pas.DB.TFieldType.ftLongWord) {
              pas.TypInfo.SetOrdProp$1(o,p,AField.GetAsInteger());
            } else if ($tmp4 === pas.DB.TFieldType.ftShortint) {
              pas.TypInfo.SetOrdProp$1(o,p,AField.GetAsInteger())}
             else if ($tmp4 === pas.DB.TFieldType.ftByte) {
              pas.TypInfo.SetOrdProp$1(o,p,AField.GetAsInteger())}
             else if ($tmp4 === pas.DB.TFieldType.ftBoolean) {
              pas.TypInfo.SetOrdProp$1(o,p,AField.GetAsBoolean() + 0)}
             else if (($tmp4 === pas.DB.TFieldType.ftFloat) || ($tmp4 === pas.DB.TFieldType.ftCurrency) || ($tmp4 === pas.DB.TFieldType.ftBCD) || ($tmp4 === pas.DB.TFieldType.ftFMTBcd) || ($tmp4 === pas.DB.TFieldType.ftExtended) || ($tmp4 === pas.DB.TFieldType.ftSingle)) {
              pas.TypInfo.SetOrdProp$1(o,p,Math.round(AField.GetAsFloat()))}
             else if (($tmp4 === pas.DB.TFieldType.ftString) || ($tmp4 === pas.DB.TFieldType.ftWideString) || ($tmp4 === pas.DB.TFieldType.ftFixedChar) || ($tmp4 === pas.DB.TFieldType.ftFixedWideChar)) {
              if (useDisplayText) {
                pas.TypInfo.SetOrdProp$1(o,p,pas.SysUtils.StrToIntDef(AField.GetDisplayText(),0))}
               else pas.TypInfo.SetOrdProp$1(o,p,pas.SysUtils.StrToIntDef(AField.GetAsString(),0))}
             else {
              pas.TypInfo.SetOrdProp$1(o,p,AField.GetAsInteger());
            };
          };
        } else if (($tmp === pas.System.TTypeKind.tkChar) || ($tmp === pas.System.TTypeKind.tkString)) {
          if (!pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsReadOnly(p)) {
            useDisplayText = AField.FOnGetText != null;
            var $tmp5 = AField.FDataType;
            if (($tmp5 === pas.DB.TFieldType.ftString) || ($tmp5 === pas.DB.TFieldType.ftWideString) || ($tmp5 === pas.DB.TFieldType.ftFixedChar) || ($tmp5 === pas.DB.TFieldType.ftFixedWideChar)) {
              if (useDisplayText) {
                pas.TypInfo.SetStrProp$1(o,p,AField.GetDisplayText())}
               else pas.TypInfo.SetStrProp$1(o,p,AField.GetAsString())}
             else if (($tmp5 === pas.DB.TFieldType.ftMemo) || ($tmp5 === pas.DB.TFieldType.ftFmtMemo) || ($tmp5 === pas.DB.TFieldType.ftWideMemo)) {
              if (AField.FOnGetText != null) {
                pas.TypInfo.SetStrProp$1(o,p,AField.GetDisplayText())}
               else pas.TypInfo.SetStrProp$1(o,p,AField.GetAsString())}
             else if ($tmp5 === pas.DB.TFieldType.ftOraClob) {
              pas.TypInfo.SetStrProp$1(o,p,AField.GetAsString())}
             else if ($tmp5 === pas.DB.TFieldType.ftGuid) {
              if (useDisplayText) {
                pas.TypInfo.SetStrProp$1(o,p,AField.GetDisplayText())}
               else pas.TypInfo.SetStrProp$1(o,p,AField.GetAsString())}
             else {
              pas.TypInfo.SetStrProp$1(o,p,AField.GetDisplayText());
            };
          };
        } else if ($tmp === pas.System.TTypeKind.tkEnumeration) {
          if (pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.GetPropInfoDataTypeInfo(p) === rtl.boolean) {
            if (!pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsReadOnly(p)) {
              var $tmp6 = AField.FDataType;
              if ($tmp6 === pas.DB.TFieldType.ftBoolean) {
                pas.TypInfo.SetOrdProp$1(o,p,AField.GetAsBoolean() + 0)}
               else if (($tmp6 === pas.DB.TFieldType.ftString) || ($tmp6 === pas.DB.TFieldType.ftWideString) || ($tmp6 === pas.DB.TFieldType.ftFixedChar)) {
                if (AField.FOnGetText != null) {
                  s = pas.SysUtils.Trim(pas.SysUtils.UpperCase(AField.GetDisplayText()))}
                 else s = pas.SysUtils.Trim(pas.SysUtils.UpperCase(AField.GetAsString()));
                if (this.FBooleanStringValue !== "") {
                  pas.TypInfo.SetOrdProp$1(o,p,(s === pas.SysUtils.UpperCase(this.FBooleanStringValue)) + 0)}
                 else pas.TypInfo.SetOrdProp$1(o,p,((s === "TRUE") || (s === "T") || (s === "YES") || (s === "Y") || (s === "1")) + 0);
              } else if (($tmp6 === pas.DB.TFieldType.ftInteger) || ($tmp6 === pas.DB.TFieldType.ftSmallint) || ($tmp6 === pas.DB.TFieldType.ftWord) || ($tmp6 === pas.DB.TFieldType.ftShortint) || ($tmp6 === pas.DB.TFieldType.ftByte)) {
                pas.TypInfo.SetOrdProp$1(o,p,(AField.GetAsInteger() !== 0) + 0)}
               else if ($tmp6 === pas.DB.TFieldType.ftLongWord) {
                pas.TypInfo.SetOrdProp$1(o,p,(AField.GetAsInteger() !== 0) + 0);
              } else {
                pas.TypInfo.SetOrdProp$1(o,p,AField.GetAsBoolean() + 0);
              };
            };
          } else {
            if (!pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsReadOnly(p)) {
              var $tmp7 = AField.FDataType;
              if (($tmp7 === pas.DB.TFieldType.ftString) || ($tmp7 === pas.DB.TFieldType.ftWideString) || ($tmp7 === pas.DB.TFieldType.ftFixedChar)) {
                if (AField.FOnGetText != null) {
                  s = pas.SysUtils.Trim(AField.GetDisplayText())}
                 else s = pas.SysUtils.Trim(AField.GetAsString());
                i = pas.TypInfo.GetEnumValue(pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.GetPropInfoDataTypeInfo(p),s);
                if (i >= 0) {
                  pas.TypInfo.SetOrdProp$1(o,p,i)}
                 else pas.TypInfo.SetOrdProp$1(o,p,0);
              } else if (($tmp7 === pas.DB.TFieldType.ftInteger) || ($tmp7 === pas.DB.TFieldType.ftSmallint) || ($tmp7 === pas.DB.TFieldType.ftWord) || ($tmp7 === pas.DB.TFieldType.ftShortint) || ($tmp7 === pas.DB.TFieldType.ftByte)) {
                pas.TypInfo.SetOrdProp$1(o,p,AField.GetAsInteger())}
               else if ($tmp7 === pas.DB.TFieldType.ftLongWord) {
                pas.TypInfo.SetOrdProp$1(o,p,AField.GetAsInteger());
              } else {
                pas.TypInfo.SetOrdProp$1(o,p,AField.GetAsInteger());
              };
            };
          };
        } else if ($tmp === pas.System.TTypeKind.tkBool) {
          if (!pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsReadOnly(p)) {
            var $tmp8 = AField.FDataType;
            if ($tmp8 === pas.DB.TFieldType.ftBoolean) {
              pas.TypInfo.SetOrdProp$1(o,p,AField.GetAsBoolean() + 0)}
             else if (($tmp8 === pas.DB.TFieldType.ftString) || ($tmp8 === pas.DB.TFieldType.ftWideString)) {
              if (AField.FOnGetText != null) {
                s = pas.SysUtils.Trim(pas.SysUtils.UpperCase(AField.GetDisplayText()))}
               else s = pas.SysUtils.Trim(pas.SysUtils.UpperCase(AField.GetAsString()));
              pas.TypInfo.SetOrdProp$1(o,p,((s === "TRUE") || (s === "T") || (s === "YES") || (s === "Y") || (s === "1")) + 0);
            } else if (($tmp8 === pas.DB.TFieldType.ftInteger) || ($tmp8 === pas.DB.TFieldType.ftSmallint) || ($tmp8 === pas.DB.TFieldType.ftWord)) {
              pas.TypInfo.SetOrdProp$1(o,p,(AField.GetAsInteger() !== 0) + 0)}
             else if ($tmp8 === pas.DB.TFieldType.ftLongWord) {
              pas.TypInfo.SetOrdProp$1(o,p,(AField.GetAsInteger() !== 0) + 0);
            } else {
              pas.TypInfo.SetOrdProp$1(o,p,AField.GetAsBoolean() + 0);
            };
          };
        } else if ($tmp === pas.System.TTypeKind.tkDouble) {
          if (!pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsReadOnly(p)) {
            cn = pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.GetPropInfoTypeName(p);
            if ((pas.SysUtils.CompareText(cn,"TDateTime") === 0) || (pas.SysUtils.CompareText(cn,"TDate") === 0) || (pas.SysUtils.CompareText(cn,"TTime") === 0)) {
              var $tmp9 = AField.FDataType;
              if ($tmp9 === pas.DB.TFieldType.ftDate) {
                pas.TypInfo.SetFloatProp$1(o,p,AField.GetAsDateTime())}
               else if ($tmp9 === pas.DB.TFieldType.ftTime) {
                pas.TypInfo.SetFloatProp$1(o,p,AField.GetAsDateTime())}
               else if (($tmp9 === pas.DB.TFieldType.ftDateTime) || ($tmp9 === pas.DB.TFieldType.ftTimeStamp)) {
                pas.TypInfo.SetFloatProp$1(o,p,AField.GetAsDateTime())}
               else if (($tmp9 === pas.DB.TFieldType.ftString) || ($tmp9 === pas.DB.TFieldType.ftWideString)) {
                if (AField.FOnGetText != null) {
                  dt = pas.SysUtils.StrToDateTimeDef(AField.GetDisplayText(),0)}
                 else dt = pas.SysUtils.StrToDateTimeDef(AField.GetAsString(),0);
                pas.TypInfo.SetFloatProp$1(o,p,dt);
              } else if (($tmp9 === pas.DB.TFieldType.ftFloat) || ($tmp9 === pas.DB.TFieldType.ftExtended)) {
                pas.TypInfo.SetFloatProp$1(o,p,AField.GetAsFloat())}
               else {
                pas.TypInfo.SetFloatProp$1(o,p,AField.GetAsFloat());
              };
            } else {
              var $tmp10 = AField.FDataType;
              if (($tmp10 === pas.DB.TFieldType.ftFloat) || ($tmp10 === pas.DB.TFieldType.ftCurrency) || ($tmp10 === pas.DB.TFieldType.ftBCD) || ($tmp10 === pas.DB.TFieldType.ftFMTBcd) || ($tmp10 === pas.DB.TFieldType.ftExtended) || ($tmp10 === pas.DB.TFieldType.ftSingle)) {
                pas.TypInfo.SetFloatProp$1(o,p,AField.GetAsFloat())}
               else if (($tmp10 === pas.DB.TFieldType.ftInteger) || ($tmp10 === pas.DB.TFieldType.ftSmallint) || ($tmp10 === pas.DB.TFieldType.ftWord)) {
                pas.TypInfo.SetFloatProp$1(o,p,AField.GetAsInteger())}
               else if ($tmp10 === pas.DB.TFieldType.ftLongWord) {
                pas.TypInfo.SetFloatProp$1(o,p,AField.GetAsFloat());
              } else if ($tmp10 === pas.DB.TFieldType.ftLargeint) {
                pas.TypInfo.SetFloatProp$1(o,p,AField.GetAsLargeInt())}
               else {
                pas.TypInfo.SetFloatProp$1(o,p,AField.GetAsFloat());
              };
            };
          };
        } else if ($tmp === pas.System.TTypeKind.tkSet) {
          if (!pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsReadOnly(p)) {
            var $tmp11 = AField.FDataType;
            if (($tmp11 === pas.DB.TFieldType.ftInteger) || ($tmp11 === pas.DB.TFieldType.ftSmallint) || ($tmp11 === pas.DB.TFieldType.ftWord)) {
              pas.TypInfo.SetOrdProp$1(o,p,AField.GetAsInteger())}
             else if ($tmp11 === pas.DB.TFieldType.ftLongWord) {
              pas.TypInfo.SetOrdProp$1(o,p,AField.GetAsInteger());
            } else if (($tmp11 === pas.DB.TFieldType.ftString) || ($tmp11 === pas.DB.TFieldType.ftWideString)) {}
            else {
              pas.TypInfo.SetOrdProp$1(o,p,AField.GetAsInteger());
            };
          };
        };
        this.DoAfterWriteFieldToProperty(o,this,p,pName,k,AField);
      } catch ($e) {
        if (pas.SysUtils.Exception.isPrototypeOf($e)) {
          var E = $e;
        } else throw $e
      };
    };
    this.WritePropertyToField = function (AObject, APropInfo, AField) {
      var a = false;
      var pName = "";
      var cn = "";
      var k = 0;
      var p = null;
      var o = null;
      var b = false;
      var ob = null;
      var bt = null;
      var ms = null;
      var i = 0;
      var s = "";
      var d = 0.0;
      var dt = 0.0;
      var ii = 0;
      var ui = 0;
      var useText = false;
      if (!(AField != null) || !(AObject != null) || !(APropInfo != null)) return;
      if (!AField.GetCanModify()) return;
      o = AObject;
      p = APropInfo;
      pName = pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.GetPropInfoName(p);
      k = pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.GetPropInfoType(p);
      a = true;
      this.DoBeforeWritePropertyToField(o,this,p,pName,k,AField,{get: function () {
          return a;
        }, set: function (v) {
          a = v;
        }});
      if (!a) return;
      try {
        var $tmp = k;
        if ($tmp === pas.System.TTypeKind.tkClass) {
          cn = pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.GetPropInfoTypeName(p);
          ob = pas.TypInfo.GetObjectProp(AObject,pName);
          if (!(ob != null)) return;
          if (pas.Classes.TStrings.isPrototypeOf(ob)) {
            useText = AField.FOnSetText != null;
            var $tmp1 = AField.FDataType;
            if (($tmp1 === pas.DB.TFieldType.ftString) || ($tmp1 === pas.DB.TFieldType.ftWideString) || ($tmp1 === pas.DB.TFieldType.ftFixedChar) || ($tmp1 === pas.DB.TFieldType.ftFixedWideChar)) {
              if (rtl.as(ob,pas.Classes.TStrings).GetCount() > 0) {
                s = rtl.as(ob,pas.Classes.TStrings).Get(0)}
               else s = "";
              if (useText) {
                AField.SetEditText(s)}
               else AField.SetAsString(s);
            } else if (($tmp1 === pas.DB.TFieldType.ftMemo) || ($tmp1 === pas.DB.TFieldType.ftFmtMemo) || ($tmp1 === pas.DB.TFieldType.ftWideMemo) || ($tmp1 === pas.DB.TFieldType.ftOraClob)) {
              if (useText) {
                AField.SetEditText(rtl.as(ob,pas.Classes.TStrings).GetTextStr())}
               else AField.SetAsString(rtl.as(ob,pas.Classes.TStrings).GetTextStr())}
             else {
              if (useText) {
                AField.SetEditText(rtl.as(ob,pas.Classes.TStrings).GetTextStr())}
               else AField.SetAsString(rtl.as(ob,pas.Classes.TStrings).GetTextStr());
            };
          } else if (pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsGenericList(ob.$class.ClassType(),"String")) {
            useText = AField.FOnSetText != null;
            var $tmp2 = AField.FDataType;
            if (($tmp2 === pas.DB.TFieldType.ftString) || ($tmp2 === pas.DB.TFieldType.ftWideString)) {
              s = "";
              for (var $l = 0, $end = ob.FLength - 1; $l <= $end; $l++) {
                i = $l;
                if (i > 0) s = s + ",";
                s = s + ob.GetItem(i);
              };
              if (useText) {
                AField.SetEditText(s)}
               else AField.SetAsString(s);
            } else if (($tmp2 === pas.DB.TFieldType.ftMemo) || ($tmp2 === pas.DB.TFieldType.ftWideMemo)) {
              s = "";
              for (var $l1 = 0, $end1 = ob.FLength - 1; $l1 <= $end1; $l1++) {
                i = $l1;
                if (i > 0) s = s + "\r\n";
                s = s + ob.GetItem(i);
              };
              if (useText) {
                AField.SetEditText(s)}
               else AField.SetAsString(s);
            };
          } else if (pas.Classes.TPersistent.isPrototypeOf(ob)) {
            if (this.TryGetObjectStringValue(ob,{get: function () {
                return s;
              }, set: function (v) {
                s = v;
              }})) {
              useText = AField.FOnSetText != null;
              var $tmp3 = AField.FDataType;
              if (($tmp3 === pas.DB.TFieldType.ftString) || ($tmp3 === pas.DB.TFieldType.ftWideString) || ($tmp3 === pas.DB.TFieldType.ftFixedChar)) {
                if (useText) {
                  AField.SetEditText(s)}
                 else AField.SetAsString(s)}
               else if (($tmp3 === pas.DB.TFieldType.ftMemo) || ($tmp3 === pas.DB.TFieldType.ftWideMemo)) {
                AField.SetAsString(s)}
               else {
                if (s !== "") {
                  if (useText) {
                    AField.SetEditText(s)}
                   else AField.SetAsString(s);
                };
              };
            };
          };
        } else if ($tmp === pas.System.TTypeKind.tkInteger) {
          if (!pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsWriteOnly(p)) {
            i = pas.TypInfo.GetOrdProp$1(o,p);
            useText = AField.FOnSetText != null;
            var $tmp4 = AField.FDataType;
            if (($tmp4 === pas.DB.TFieldType.ftInteger) || ($tmp4 === pas.DB.TFieldType.ftSmallint) || ($tmp4 === pas.DB.TFieldType.ftWord) || ($tmp4 === pas.DB.TFieldType.ftAutoInc)) {
              if (useText) {
                AField.SetEditText(pas.SysUtils.IntToStr(i))}
               else AField.SetAsInteger(i)}
             else if ($tmp4 === pas.DB.TFieldType.ftLargeint) {
              if (useText) {
                AField.SetEditText(pas.SysUtils.IntToStr(i))}
               else AField.SetAsLargeInt(i)}
             else if ($tmp4 === pas.DB.TFieldType.ftLongWord) {
              if (useText) {
                AField.SetEditText(pas.SysUtils.IntToStr(i))}
               else AField.SetAsInteger(i);
            } else if (($tmp4 === pas.DB.TFieldType.ftFloat) || ($tmp4 === pas.DB.TFieldType.ftCurrency) || ($tmp4 === pas.DB.TFieldType.ftBCD) || ($tmp4 === pas.DB.TFieldType.ftFMTBcd)) {
              if (useText) {
                AField.SetEditText(pas.SysUtils.IntToStr(i))}
               else AField.SetAsFloat(i)}
             else if ($tmp4 === pas.DB.TFieldType.ftBoolean) {
              if (useText) {
                AField.SetEditText(pas.SysUtils.BoolToStr(i !== 0,true))}
               else AField.SetAsBoolean(i !== 0)}
             else if (($tmp4 === pas.DB.TFieldType.ftString) || ($tmp4 === pas.DB.TFieldType.ftWideString)) {
              if (useText) {
                AField.SetEditText(pas.SysUtils.IntToStr(i))}
               else AField.SetAsString(pas.SysUtils.IntToStr(i))}
             else {
              if (useText) {
                AField.SetEditText(pas.SysUtils.IntToStr(i))}
               else AField.SetAsInteger(i);
            };
          };
        } else if (($tmp === pas.System.TTypeKind.tkChar) || ($tmp === pas.System.TTypeKind.tkString)) {
          if (!pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsWriteOnly(p)) {
            s = pas.TypInfo.GetStrProp$1(o,p);
            useText = AField.FOnSetText != null;
            var $tmp5 = AField.FDataType;
            if (($tmp5 === pas.DB.TFieldType.ftString) || ($tmp5 === pas.DB.TFieldType.ftWideString) || ($tmp5 === pas.DB.TFieldType.ftFixedChar) || ($tmp5 === pas.DB.TFieldType.ftFixedWideChar)) {
              if (useText) {
                AField.SetEditText(s)}
               else AField.SetAsString(s)}
             else if (($tmp5 === pas.DB.TFieldType.ftMemo) || ($tmp5 === pas.DB.TFieldType.ftFmtMemo) || ($tmp5 === pas.DB.TFieldType.ftWideMemo)) {
              if (useText) {
                AField.SetEditText(s)}
               else AField.SetAsString(s)}
             else if ($tmp5 === pas.DB.TFieldType.ftGuid) {
              if (useText) {
                AField.SetEditText(s)}
               else AField.SetAsString(s)}
             else if (($tmp5 === pas.DB.TFieldType.ftInteger) || ($tmp5 === pas.DB.TFieldType.ftSmallint) || ($tmp5 === pas.DB.TFieldType.ftWord)) {
              if (useText) {
                AField.SetEditText(s)}
               else AField.SetAsInteger(pas.SysUtils.StrToIntDef(s,0))}
             else if ($tmp5 === pas.DB.TFieldType.ftLongWord) {
              if (useText) {
                AField.SetEditText(s)}
               else AField.SetAsInteger(pas.SysUtils.StrToIntDef(s,0));
            } else if (($tmp5 === pas.DB.TFieldType.ftFloat) || ($tmp5 === pas.DB.TFieldType.ftCurrency)) {
              if (useText) {
                AField.SetEditText(s)}
               else AField.SetAsFloat(pas.SysUtils.StrToFloatDef(s,0))}
             else if ($tmp5 === pas.DB.TFieldType.ftBoolean) {
              if (useText) {
                AField.SetEditText(s)}
               else AField.SetAsBoolean((pas.SysUtils.UpperCase(s) === "TRUE") || (s === "1"))}
             else {
              if (useText) {
                AField.SetEditText(s)}
               else AField.SetAsString(s);
            };
          };
        } else if ($tmp === pas.System.TTypeKind.tkEnumeration) {
          if (pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.GetPropInfoDataTypeInfo(p) === rtl.boolean) {
            if (!pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsWriteOnly(p)) {
              b = pas.TypInfo.GetOrdProp$1(o,p) != 0;
              useText = AField.FOnSetText != null;
              var $tmp6 = AField.FDataType;
              if ($tmp6 === pas.DB.TFieldType.ftBoolean) {
                if (useText) {
                  AField.SetEditText(pas.SysUtils.BoolToStr(b,true))}
                 else AField.SetAsBoolean(b)}
               else if (($tmp6 === pas.DB.TFieldType.ftString) || ($tmp6 === pas.DB.TFieldType.ftWideString)) {
                if (this.FBooleanStringValue !== "") {
                  if (b) {
                    s = this.FBooleanStringValue}
                   else s = "";
                } else s = pas.SysUtils.BoolToStr(b,true);
                if (useText) {
                  AField.SetEditText(s)}
                 else AField.SetAsString(s);
              } else if (($tmp6 === pas.DB.TFieldType.ftInteger) || ($tmp6 === pas.DB.TFieldType.ftSmallint) || ($tmp6 === pas.DB.TFieldType.ftWord)) {
                if (useText) {
                  AField.SetEditText(pas.SysUtils.IntToStr(b + 0))}
                 else AField.SetAsInteger(b + 0)}
               else if ($tmp6 === pas.DB.TFieldType.ftLongWord) {
                if (useText) {
                  AField.SetEditText(pas.SysUtils.IntToStr(b + 0))}
                 else AField.SetAsInteger(b + 0);
              } else {
                if (useText) {
                  AField.SetEditText(pas.SysUtils.BoolToStr(b,true))}
                 else AField.SetAsBoolean(b);
              };
            };
          } else {
            if (!pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsWriteOnly(p)) {
              i = pas.TypInfo.GetOrdProp$1(o,p);
              useText = AField.FOnSetText != null;
              var $tmp7 = AField.FDataType;
              if (($tmp7 === pas.DB.TFieldType.ftString) || ($tmp7 === pas.DB.TFieldType.ftWideString)) {
                s = pas.TypInfo.GetEnumName(pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.GetPropInfoDataTypeInfo(p),i);
                if (useText) {
                  AField.SetEditText(s)}
                 else AField.SetAsString(s);
              } else if ($tmp7 === pas.DB.TFieldType.ftLongWord) {
                if (useText) {
                  AField.SetEditText(pas.SysUtils.IntToStr(i))}
                 else AField.SetAsInteger(i);
              } else {
                if (useText) {
                  AField.SetEditText(pas.SysUtils.IntToStr(i))}
                 else AField.SetAsInteger(i);
              };
            };
          };
        } else if ($tmp === pas.System.TTypeKind.tkBool) {
          if (!pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsWriteOnly(p)) {
            b = pas.TypInfo.GetOrdProp$1(o,p) != 0;
            useText = AField.FOnSetText != null;
            var $tmp8 = AField.FDataType;
            if ($tmp8 === pas.DB.TFieldType.ftBoolean) {
              if (useText) {
                AField.SetEditText(pas.SysUtils.BoolToStr(b,true))}
               else AField.SetAsBoolean(b)}
             else if (($tmp8 === pas.DB.TFieldType.ftString) || ($tmp8 === pas.DB.TFieldType.ftWideString)) {
              if (useText) {
                AField.SetEditText(pas.SysUtils.BoolToStr(b,true))}
               else AField.SetAsString(pas.SysUtils.BoolToStr(b,true))}
             else if (($tmp8 === pas.DB.TFieldType.ftInteger) || ($tmp8 === pas.DB.TFieldType.ftSmallint) || ($tmp8 === pas.DB.TFieldType.ftWord)) {
              if (useText) {
                AField.SetEditText(pas.SysUtils.IntToStr(b + 0))}
               else AField.SetAsInteger(b + 0)}
             else if ($tmp8 === pas.DB.TFieldType.ftLongWord) {
              if (useText) {
                AField.SetEditText(pas.SysUtils.IntToStr(b + 0))}
               else AField.SetAsInteger(b + 0);
            } else {
              if (useText) {
                AField.SetEditText(pas.SysUtils.BoolToStr(b,true))}
               else AField.SetAsBoolean(b);
            };
          };
        } else if ($tmp === pas.System.TTypeKind.tkDouble) {
          if (!pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsWriteOnly(p)) {
            d = pas.TypInfo.GetFloatProp$1(o,p);
            useText = AField.FOnSetText != null;
            cn = pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.GetPropInfoTypeName(p);
            if ((pas.SysUtils.CompareText(cn,"TDateTime") === 0) || (pas.SysUtils.CompareText(cn,"TDate") === 0) || (pas.SysUtils.CompareText(cn,"TTime") === 0)) {
              dt = d;
              var $tmp9 = AField.FDataType;
              if (($tmp9 === pas.DB.TFieldType.ftDate) || ($tmp9 === pas.DB.TFieldType.ftDateTime)) {
                if (useText) {
                  AField.SetEditText(pas.SysUtils.DateTimeToStr(dt,false))}
                 else AField.SetAsDateTime(dt)}
               else if ($tmp9 === pas.DB.TFieldType.ftTime) {
                if (useText) {
                  AField.SetEditText(pas.SysUtils.TimeToStr(pas.System.Frac(dt)))}
                 else AField.SetAsDateTime(pas.System.Frac(dt))}
               else if ($tmp9 === pas.DB.TFieldType.ftTimeStamp) {
                if (useText) {
                  AField.SetEditText(pas.SysUtils.DateTimeToStr(dt,false))}
                 else AField.SetAsDateTime(dt)}
               else if (($tmp9 === pas.DB.TFieldType.ftString) || ($tmp9 === pas.DB.TFieldType.ftWideString)) {
                if (useText) {
                  AField.SetEditText(pas.SysUtils.DateTimeToStr(dt,false))}
                 else AField.SetAsString(pas.SysUtils.DateTimeToStr(dt,false))}
               else {
                if (useText) {
                  AField.SetEditText(pas.SysUtils.FloatToStr(dt))}
                 else AField.SetAsFloat(dt);
              };
            } else {
              var $tmp10 = AField.FDataType;
              if (($tmp10 === pas.DB.TFieldType.ftFloat) || ($tmp10 === pas.DB.TFieldType.ftCurrency) || ($tmp10 === pas.DB.TFieldType.ftBCD) || ($tmp10 === pas.DB.TFieldType.ftFMTBcd)) {
                if (useText) {
                  AField.SetEditText(pas.SysUtils.FloatToStr(d))}
                 else AField.SetAsFloat(d)}
               else if (($tmp10 === pas.DB.TFieldType.ftInteger) || ($tmp10 === pas.DB.TFieldType.ftSmallint) || ($tmp10 === pas.DB.TFieldType.ftWord)) {
                if (useText) {
                  AField.SetEditText(pas.SysUtils.IntToStr(Math.round(d)))}
                 else AField.SetAsInteger(Math.round(d))}
               else if ($tmp10 === pas.DB.TFieldType.ftLongWord) {
                if (useText) {
                  AField.SetEditText(pas.SysUtils.IntToStr(Math.round(d)))}
                 else AField.SetAsInteger(Math.round(d));
              } else if ($tmp10 === pas.DB.TFieldType.ftLargeint) {
                if (useText) {
                  AField.SetEditText(pas.SysUtils.IntToStr(Math.round(d)))}
                 else AField.SetAsLargeInt(Math.round(d))}
               else if (($tmp10 === pas.DB.TFieldType.ftString) || ($tmp10 === pas.DB.TFieldType.ftWideString)) {
                if (useText) {
                  AField.SetEditText(pas.SysUtils.FloatToStr(d))}
                 else AField.SetAsString(pas.SysUtils.FloatToStr(d))}
               else {
                if (useText) {
                  AField.SetEditText(pas.SysUtils.FloatToStr(d))}
                 else AField.SetAsFloat(d);
              };
            };
          };
        } else if ($tmp === pas.System.TTypeKind.tkSet) {
          if (!pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsWriteOnly(p)) {
            i = pas.TypInfo.GetOrdProp$1(o,p);
            useText = AField.FOnSetText != null;
            var $tmp11 = AField.FDataType;
            if (($tmp11 === pas.DB.TFieldType.ftInteger) || ($tmp11 === pas.DB.TFieldType.ftSmallint) || ($tmp11 === pas.DB.TFieldType.ftWord)) {
              if (useText) {
                AField.SetEditText(pas.SysUtils.IntToStr(i))}
               else AField.SetAsInteger(i)}
             else if ($tmp11 === pas.DB.TFieldType.ftLongWord) {
              if (useText) {
                AField.SetEditText(pas.SysUtils.IntToStr(i))}
               else AField.SetAsInteger(i);
            } else if (($tmp11 === pas.DB.TFieldType.ftString) || ($tmp11 === pas.DB.TFieldType.ftWideString)) {
              if (useText) {
                AField.SetEditText(pas.SysUtils.IntToStr(i))}
               else AField.SetAsString(pas.SysUtils.IntToStr(i))}
             else {
              if (useText) {
                AField.SetEditText(pas.SysUtils.IntToStr(i))}
               else AField.SetAsInteger(i);
            };
          };
        };
        this.DoAfterWritePropertyToField(o,this,p,pName,k,AField);
      } catch ($e) {
        if (pas.SysUtils.Exception.isPrototypeOf($e)) {
          var E = $e;
        } else throw $e
      };
    };
    this.WriteHTMLTemplateToProperty = function (AObject, APropInfo, AHTMLTemplate) {
      var a = false;
      var pName = "";
      var k = 0;
      var p = null;
      var o = null;
      var s = "";
      var t = "";
      if ((AHTMLTemplate === "") || !(AObject != null) || !(APropInfo != null)) return;
      o = AObject;
      p = APropInfo;
      pName = pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.GetPropInfoName(p);
      k = pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.GetPropInfoType(p);
      a = true;
      t = AHTMLTemplate;
      this.DoBeforeWriteHTMLTemplateToProperty(o,this,p,pName,k,{get: function () {
          return t;
        }, set: function (v) {
          t = v;
        }},{get: function () {
          return a;
        }, set: function (v) {
          a = v;
        }});
      if (a) {
        var $tmp = k;
        if (($tmp === pas.System.TTypeKind.tkChar) || ($tmp === pas.System.TTypeKind.tkString)) {
          s = this.HTMLDBReplace(t,this.FDataLink.GetDataset());
          if (!pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsReadOnly(p)) pas.TypInfo.SetStrProp$1(o,p,s);
        };
        this.DoAfterWriteHTMLTemplateToProperty(o,this,p,pName,k,t);
      };
    };
    this.ClearProperty = function (AObject, APropInfo) {
      var pName = "";
      var cn = "";
      var k = 0;
      var p = null;
      var o = null;
      var i = 0;
      var s = "";
      var b = false;
      var d = 0.0;
      var dt = 0.0;
      var ii = 0;
      var ob = null;
      var bt = null;
      var pic = null;
      if (!(AObject != null) || !(APropInfo != null)) return;
      o = AObject;
      p = APropInfo;
      pName = pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.GetPropInfoName(p);
      k = pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.GetPropInfoType(p);
      try {
        var $tmp = k;
        if ($tmp === pas.System.TTypeKind.tkClass) {
          ob = pas.TypInfo.GetObjectProp$2(o,p);
          if (ob != null) {
            cn = pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.GetPropInfoTypeName(p);
            if (pas.Classes.TCollection.isPrototypeOf(ob)) {
              rtl.as(ob,pas.Classes.TCollection).Clear();
            } else if (pas.Classes.TStrings.isPrototypeOf(ob)) {
              rtl.as(ob,pas.Classes.TStrings).Clear();
            } else if (pas.Classes.TStream.isPrototypeOf(ob)) {
              rtl.as(ob,pas.Classes.TStream).SetSize64(0);
              rtl.as(ob,pas.Classes.TStream).SetPosition(0);
            } else if (pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.isPrototypeOf(ob)) {
              bt = rtl.as(ob,pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap);
              bt.Assign(null);
            } else if (pas["WEBLib.Graphics"].TBitmap.isPrototypeOf(ob)) {
              pic = rtl.as(ob,pas["WEBLib.Graphics"].TBitmap);
              pic.Assign(null);
            } else if (pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsGenericList(ob.$class.ClassType(),"String")) {
              ob.Clear();
            } else if (pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsGenericList(ob.$class.ClassType(),"Integer")) {
              ob.Clear();
            } else if (pas.Classes.TPersistent.isPrototypeOf(ob)) ;
          };
        } else if ($tmp === pas.System.TTypeKind.tkInteger) {
          if (pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsReadOnly(p)) return;
          i = 0;
          pas.TypInfo.SetOrdProp$1(o,p,i);
        } else if (($tmp === pas.System.TTypeKind.tkChar) || ($tmp === pas.System.TTypeKind.tkString)) {
          if (pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsReadOnly(p)) return;
          s = "";
          pas.TypInfo.SetStrProp$1(o,p,s);
        } else if ($tmp === pas.System.TTypeKind.tkEnumeration) {
          if (pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsReadOnly(p)) return;
          if (pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.GetPropInfoDataTypeInfo(p) === rtl.boolean) {
            b = false;
            pas.TypInfo.SetOrdProp$1(o,p,b + 0);
          } else {
            i = 0;
            pas.TypInfo.SetOrdProp$1(o,p,i);
          };
        } else if ($tmp === pas.System.TTypeKind.tkBool) {
          if (pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsReadOnly(p)) return;
          b = false;
          pas.TypInfo.SetOrdProp$1(o,p,b + 0);
        } else if ($tmp === pas.System.TTypeKind.tkDouble) {
          if (pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsReadOnly(p)) return;
          cn = pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.GetPropInfoTypeName(p);
          if ((pas.SysUtils.CompareText(cn,"TDateTime") === 0) || (pas.SysUtils.CompareText(cn,"TDate") === 0) || (pas.SysUtils.CompareText(cn,"TTime") === 0)) {
            dt = 0;
            pas.TypInfo.SetFloatProp$1(o,p,dt);
          } else {
            d = 0.0;
            pas.TypInfo.SetFloatProp$1(o,p,d);
          };
        } else if ($tmp === pas.System.TTypeKind.tkSet) {
          if (pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsReadOnly(p)) return;
          i = 0;
          pas.TypInfo.SetOrdProp$1(o,p,i);
        } else if (($tmp === pas.System.TTypeKind.tkArray) || ($tmp === pas.System.TTypeKind.tkDynArray)) {
          if (pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsReadOnly(p)) return;
        } else if ($tmp === pas.System.TTypeKind.tkRecord) {
          if (pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsReadOnly(p)) return;
        } else if ($tmp === pas.System.TTypeKind.tkInterface) {
          if (pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsReadOnly(p)) return;
          pas.TypInfo.SetInterfaceProp$1(o,p,null);
        };
      } catch ($e) {
        if (pas.SysUtils.Exception.isPrototypeOf($e)) {
          var E = $e;
        } else throw $e
      };
    };
    this._AddRef = function () {
      var Result = 0;
      if (this.FOwnerInterface !== null) {
        Result = this.FOwnerInterface._AddRef()}
       else Result = -1;
      return Result;
    };
    this._Release = function () {
      var Result = 0;
      if (this.FOwnerInterface !== null) {
        Result = this.FOwnerInterface._Release()}
       else Result = -1;
      return Result;
    };
    var E_NOINTERFACE = 0x80004002;
    this.QueryInterface = function (IID, Obj) {
      var Result = 0;
      if (this.GetInterface(IID,Obj)) {
        Result = 0}
       else Result = -2147467262;
      return Result;
    };
    this.Create$1 = function (ACollection) {
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      this.FDirty = false;
      this.FActive = true;
      this.FBufferCount = 0;
      this.FDataBinder = rtl.as(this.FCollection,$mod.TTMSFNCDataBinderItems).FOwner$1;
      this.FDataLink = $mod.TTMSFNCDataBinderDataLink.$create("Create$2",[this]);
      this.FSubPropertyNames = $mod.TTMSFNCDataBinderPropertyNames.$create("Create$3",[this]);
      this.FSubFieldNames = $mod.TTMSFNCDataBinderFieldNames.$create("Create$3",[this]);
      if ((this.FDataBinder != null) && (this.FDataBinder.GetDataSource() != null)) this.SetDataSource(this.FDataBinder.GetDataSource());
      return this;
    };
    this.Destroy = function () {
      this.DestroyMonitors();
      if ((this.FDataBinder != null) && !this.FDataBinder.IsDestroying()) {
        this.SetObject(null)}
       else {
        this.FObject = null;
        $impl.FManager.Remove(this);
      };
      this.FDataBinder = null;
      rtl.free(this,"FSubPropertyNames");
      rtl.free(this,"FSubFieldNames");
      rtl.free(this,"FDataLink");
      pas.Classes.TCollectionItem.Destroy.call(this);
    };
    this.Assign = function (Source) {
      this.FActive = rtl.as(Source,$mod.TTMSFNCDataBinderItem).FActive;
      this.FSubPropertyNames.Assign(rtl.as(Source,$mod.TTMSFNCDataBinderItem).FSubPropertyNames);
      this.FSubFieldNames.Assign(rtl.as(Source,$mod.TTMSFNCDataBinderItem).FSubFieldNames);
      this.FBindType = rtl.as(Source,$mod.TTMSFNCDataBinderItem).FBindType;
      this.FFieldName = rtl.as(Source,$mod.TTMSFNCDataBinderItem).FFieldName;
      this.FHTMLTemplate = rtl.as(Source,$mod.TTMSFNCDataBinderItem).FHTMLTemplate;
      this.FPropertyName = rtl.as(Source,$mod.TTMSFNCDataBinderItem).FPropertyName;
      this.FObject = rtl.as(Source,$mod.TTMSFNCDataBinderItem).GetObject();
      this.FColumnsPropertyName = rtl.as(Source,$mod.TTMSFNCDataBinderItem).FColumnsPropertyName;
      this.SetDataSource(rtl.as(Source,$mod.TTMSFNCDataBinderItem).GetDataSource());
    };
    this.CheckDataSet = function () {
      var Result = false;
      Result = this.FActive && (this.FDataLink.GetDataset() != null) && this.FDataLink.GetDataset().GetActive();
      return Result;
    };
    this.GetRecordCount = function () {
      var Result = 0;
      Result = 0;
      if (!this.CheckDataSet()) return Result;
      if (this.GetDataSource().FState === pas.DB.TDataSetState.dsSetKey) {
        Result = 1}
       else {
        Result = this.GetDataSource().FDataSet.GetRecordCount();
        if (this.FDataLink.GetDataset().FState in rtl.createSet(pas.DB.TDataSetState.dsInsert)) Result = Result + 1;
      };
      return Result;
    };
    this.HasDirty = function () {
      var Result = false;
      var I = 0;
      Result = false;
      if (this.FDataBinder != null) {
        for (var $l = 0, $end = this.FDataBinder.ItemCount() - 1; $l <= $end; $l++) {
          I = $l;
          if (this.FDataBinder.GetItems().GetItemEx(I).FDirty) {
            Result = true;
            break;
          };
        };
      };
      return Result;
    };
    this.UpdateDataLink = function (AMode, ADistance, AField) {
      var $Self = this;
      var p = null;
      var pcol = null;
      var psub = null;
      var f = null;
      var h = "";
      var k = 0;
      var o = null;
      var oc = null;
      var no = null;
      var its = null;
      var sl = null;
      var gls = null;
      var gli = null;
      var itv = null;
      var it = null;
      var cit = null;
      var col = null;
      var colit = null;
      var I = 0;
      var J = 0;
      var L = 0;
      var cb = pas.DB.TBookmark.$new();
      var ai = 0;
      var dbb = null;
      var dbg = null;
      var em = false;
      var um = false;
      var elm = null;
      var cvm = null;
      function UpdateItem(AItem) {
        var kj = 0;
        for (var $l = 0, $end = $Self.FSubPropertyNames.GetCount() - 1; $l <= $end; $l++) {
          kj = $l;
          if ((kj >= 0) && (kj <= ($Self.FSubFieldNames.GetCount() - 1))) {
            f = null;
            if ($Self.FSubFieldNames.GetItemEx(kj).FValue !== "") f = $Self.FDataLink.GetDataset().FieldByName($Self.FSubFieldNames.GetItemEx(kj).FValue);
            if (f != null) {
              itv = AItem;
              psub = $Self.FindProperty({get: function () {
                  return itv;
                }, set: function (v) {
                  itv = v;
                }},$Self.FSubPropertyNames.GetItemEx(kj).FValue,kj,$mod.TTMSFNCDataBinderFindType.bftDontCare);
              if (psub != null) $Self.WriteFieldToProperty(itv,psub,f);
            } else if ($Self.FSubFieldNames.GetItemEx(kj).FHTMLTemplate !== "") {
              itv = AItem;
              psub = $Self.FindProperty({get: function () {
                  return itv;
                }, set: function (v) {
                  itv = v;
                }},$Self.FSubPropertyNames.GetItemEx(kj).FValue,kj,$mod.TTMSFNCDataBinderFindType.bftDontCare);
              if (psub != null) $Self.WriteHTMLTemplateToProperty(itv,psub,$Self.FSubFieldNames.GetItemEx(kj).FHTMLTemplate);
            };
          } else if ($Self.FFieldName !== "") {
            f = $Self.FDataLink.GetDataset().FieldByName($Self.FFieldName);
            if (f != null) {
              itv = AItem;
              psub = $Self.FindProperty({get: function () {
                  return itv;
                }, set: function (v) {
                  itv = v;
                }},$Self.FSubPropertyNames.GetItemEx(kj).FValue,kj,$mod.TTMSFNCDataBinderFindType.bftDontCare);
              if (psub != null) $Self.WriteFieldToProperty(itv,psub,f);
            };
          } else if ($Self.FHTMLTemplate !== "") {
            itv = AItem;
            psub = $Self.FindProperty({get: function () {
                return itv;
              }, set: function (v) {
                itv = v;
              }},$Self.FSubPropertyNames.GetItemEx(kj).FValue,kj,$mod.TTMSFNCDataBinderFindType.bftDontCare);
            if (psub != null) $Self.WriteHTMLTemplateToProperty(itv,psub,$Self.FHTMLTemplate);
          };
        };
      };
      function DoBeginUpdate() {
        try {
          $Self.FUpdating = true;
          $impl.FGlobalUpdating = true;
          if (pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.isPrototypeOf(no)) {
            rtl.as(no,pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent).BeginUpdate()}
           else if (pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.isPrototypeOf(no)) {
            rtl.as(no,pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl).BeginUpdate()}
           else if (pas.SysUtils.Supports$3(no,$mod.ITMSFNCDataBinderGrid.$guid,{get: function () {
              return dbg;
            }, set: function (v) {
              dbg = v;
            }})) {
            dbg.DataBeginUpdate()}
           else if (pas.SysUtils.Supports$3(no,$mod.ITMSFNCDataBinderBase.$guid,{get: function () {
              return dbb;
            }, set: function (v) {
              dbb = v;
            }})) dbb.DataBeginUpdate();
        } finally {
          rtl._Release(dbg);
          rtl._Release(dbb);
        };
      };
      function DoEndUpdate() {
        try {
          if (pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.isPrototypeOf(no)) {
            rtl.as(no,pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent).EndUpdate()}
           else if (pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.isPrototypeOf(no)) {
            rtl.as(no,pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl).EndUpdate()}
           else if (pas.SysUtils.Supports$3(no,$mod.ITMSFNCDataBinderGrid.$guid,{get: function () {
              return dbg;
            }, set: function (v) {
              dbg = v;
            }})) {
            dbg.DataEndUpdate()}
           else if (pas.SysUtils.Supports$3(no,$mod.ITMSFNCDataBinderBase.$guid,{get: function () {
              return dbb;
            }, set: function (v) {
              dbb = v;
            }})) dbb.DataEndUpdate();
          $Self.FUpdating = false;
          $impl.FGlobalUpdating = false;
        } finally {
          rtl._Release(dbg);
          rtl._Release(dbb);
        };
      };
      function SetActiveItemIndex() {
        var bs = null;
        try {
          if (pas.SysUtils.Supports$3(no,$mod.ITMSFNCDataBinderSelection.$guid,{get: function () {
              return bs;
            }, set: function (v) {
              bs = v;
            }})) {
            if (!$Self.DataSetIsInserting()) {
              bs.DataSetItemIndex($Self.FDataLink.FDataSource.FDataSet.GetRecNo() - 1)}
             else bs.DataSetItemIndex(bs.DataGetItemIndex());
          };
        } finally {
          rtl._Release(bs);
        };
      };
      function GetActiveItemIndex() {
        var Result = 0;
        var bs = null;
        try {
          Result = -1;
          if (!$Self.DataSetIsInserting()) {
            Result = $Self.FDataLink.FDataSource.FDataSet.GetRecNo() - 1}
           else {
            if (pas.SysUtils.Supports$3(no,$mod.ITMSFNCDataBinderSelection.$guid,{get: function () {
                return bs;
              }, set: function (v) {
                bs = v;
              }})) Result = bs.DataGetItemIndex();
          };
        } finally {
          rtl._Release(bs);
        };
        return Result;
      };
      try {
        if (this.FUpdating || $impl.FGlobalUpdating) return;
        if ((pas.Classes.TComponentStateItem.csDestroying in this.FDataBinder.FComponentState) || (this.FDataBinder.FUpdateCount$1 > 0)) return;
        if (!(this.GetObject() != null)) return;
        if ((this.FPropertyName === "") && (this.FBindType !== $mod.TTMSFNCDataBinderBindType.dbbtGrid)) return;
        p = null;
        no = this.GetObject();
        if (!(this.FBindType === $mod.TTMSFNCDataBinderBindType.dbbtGrid)) {
          p = this.FindProperty({get: function () {
              return no;
            }, set: function (v) {
              no = v;
            }},this.FPropertyName,-1,$mod.TTMSFNCDataBinderFindType.bftDontCare);
          if (!(p != null)) return;
        };
        DoBeginUpdate();
        try {
          if (this.CheckDataSet() && this.FDataBinder.FActive) {
            if (this.FDataLink.FReadOnly && (AMode === $mod.TTMSFNCDataBinderDataLinkMode.dlmUpdateData)) {
              DoEndUpdate();
              return;
            };
            em = (this.FDataLink.GetDataset().FState in rtl.createSet(pas.DB.TDataSetState.dsEdit,pas.DB.TDataSetState.dsInsert)) && (AMode === $mod.TTMSFNCDataBinderDataLinkMode.dlmDataSetChanged);
            um = (this.FDataLink.GetDataset().FState in rtl.createSet(pas.DB.TDataSetState.dsEdit,pas.DB.TDataSetState.dsInsert)) && (AMode === $mod.TTMSFNCDataBinderDataLinkMode.dlmUpdateData) && this.FDirty;
            ai = GetActiveItemIndex();
            var $tmp = this.FBindType;
            if ($tmp === $mod.TTMSFNCDataBinderBindType.dbbtSingleValue) {
              elm = this.GetEditLinkMonitor();
              if ((elm != null) && !elm.FActive) elm.StartMonitoring();
              cvm = this.GetControlValueMonitor();
              if ((cvm != null) && !cvm.FActive) cvm.StartMonitoring();
              if (this.FFieldName !== "") {
                f = this.FDataLink.GetDataset().FieldByName(this.FFieldName);
                if (f != null) {
                  if (um) {
                    this.WritePropertyToField(no,p,f);
                    this.FDirty = false;
                  } else if (em) {
                    this.ClearProperty(no,p)}
                   else this.WriteFieldToProperty(no,p,f);
                };
              } else if ((this.FHTMLTemplate !== "") && (AMode !== $mod.TTMSFNCDataBinderDataLinkMode.dlmUpdateData)) this.WriteHTMLTemplateToProperty(no,p,this.FHTMLTemplate);
            } else if ($tmp === $mod.TTMSFNCDataBinderBindType.dbbtColumnList) {
              var $tmp1 = AMode;
              if (($tmp1 === $mod.TTMSFNCDataBinderDataLinkMode.dlmDataSetChanged) || ($tmp1 === $mod.TTMSFNCDataBinderDataLinkMode.dlmActiveChanged)) {
                k = pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.GetPropInfoType(p);
                var $tmp2 = k;
                if ($tmp2 === pas.System.TTypeKind.tkClass) {
                  o = pas.TypInfo.GetObjectProp$2(no,p);
                  pcol = this.FindProperty({get: function () {
                      return no;
                    }, set: function (v) {
                      no = v;
                    }},this.FColumnsPropertyName,-1,$mod.TTMSFNCDataBinderFindType.bftDontCare);
                  oc = null;
                  if (pcol != null) oc = pas.TypInfo.GetObjectProp$2(no,pcol);
                  if (oc != null) {
                    its = null;
                    if ((o != null) && pas.Classes.TCollection.isPrototypeOf(o)) {
                      its = rtl.as(o,pas.Classes.TCollection);
                      if (em) {
                        if (ai > -1) {
                          its.Insert(ai);
                          SetActiveItemIndex();
                        };
                        DoEndUpdate();
                        return;
                      };
                      its.Clear();
                    };
                    if (pas.Classes.TCollection.isPrototypeOf(oc)) {
                      col = rtl.as(oc,pas.Classes.TCollection);
                      col.Clear();
                      for (var $l = 0, $end = this.FDataLink.GetDataset().GetfieldCount() - 1; $l <= $end; $l++) {
                        I = $l;
                        colit = col.Add();
                        f = this.FDataLink.GetDataset().FFieldList.GetField(I);
                        if (f != null) {
                          if (this.FColumnsSubPropertyName !== "") {
                            psub = this.FindProperty({get: function () {
                                return colit;
                              }, set: function (v) {
                                colit = v;
                              }},this.FColumnsSubPropertyName,-1,$mod.TTMSFNCDataBinderFindType.bftString);
                            if (psub != null) pas.TypInfo.SetStrProp$1(colit,psub,f.FFieldName);
                          };
                        };
                      };
                      if (its != null) {
                        this.FDataLink.GetDataset().DisableControls();
                        cb.$assign(this.FDataLink.GetDataset().GetBookmark());
                        this.FDataLink.GetDataset().First();
                        try {
                          while (!this.FDataLink.GetDataset().GetEOF()) {
                            it = its.Add();
                            cit = it;
                            for (var $l1 = 0, $end1 = this.FDataLink.GetDataset().GetfieldCount() - 1; $l1 <= $end1; $l1++) {
                              I = $l1;
                              f = this.FDataLink.GetDataset().FFieldList.GetField(I);
                              if (f != null) {
                                for (var $l2 = 0, $end2 = this.FSubPropertyNames.GetCount() - 1; $l2 <= $end2; $l2++) {
                                  J = $l2;
                                  itv = cit;
                                  psub = this.FindProperty({get: function () {
                                      return itv;
                                    }, set: function (v) {
                                      itv = v;
                                    }},this.FSubPropertyNames.GetItemEx(J).FValue,-1,$mod.TTMSFNCDataBinderFindType.bftDontCare);
                                  if (psub != null) this.WriteFieldToProperty(itv,psub,f);
                                };
                              };
                            };
                            this.FDataLink.GetDataset().Next();
                          };
                        } finally {
                          this.FDataLink.GetDataset().GotoBookmark(cb);
                          this.FDataLink.GetDataset().FreeBookmark(pas.DB.TBookmark.$clone(cb));
                          this.FDataLink.GetDataset().EnableControls();
                        };
                        SetActiveItemIndex();
                      };
                    };
                  };
                };
              } else if ($tmp1 === $mod.TTMSFNCDataBinderDataLinkMode.dlmDataSetScrolled) {
                SetActiveItemIndex()}
               else if ($tmp1 === $mod.TTMSFNCDataBinderDataLinkMode.dlmRecordChanged) {
                k = pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.GetPropInfoType(p);
                var $tmp3 = k;
                if ($tmp3 === pas.System.TTypeKind.tkClass) {
                  o = pas.TypInfo.GetObjectProp$2(no,p);
                  pcol = this.FindProperty({get: function () {
                      return no;
                    }, set: function (v) {
                      no = v;
                    }},this.FColumnsPropertyName,-1,$mod.TTMSFNCDataBinderFindType.bftDontCare);
                  oc = null;
                  if (pcol != null) oc = pas.TypInfo.GetObjectProp$2(no,pcol);
                  if (oc != null) {
                    its = null;
                    if ((o != null) && pas.Classes.TCollection.isPrototypeOf(o)) its = rtl.as(o,pas.Classes.TCollection);
                    if (pas.Classes.TCollection.isPrototypeOf(oc)) {
                      col = rtl.as(oc,pas.Classes.TCollection);
                      for (var $l3 = 0, $end3 = this.FDataLink.GetDataset().GetfieldCount() - 1; $l3 <= $end3; $l3++) {
                        I = $l3;
                        if ((I >= 0) && (I <= (col.GetCount() - 1))) {
                          colit = col.GetItem(I);
                          f = this.FDataLink.GetDataset().FFieldList.GetField(I);
                          if (f != null) {
                            if (this.FColumnsSubPropertyName !== "") {
                              psub = this.FindProperty({get: function () {
                                  return colit;
                                }, set: function (v) {
                                  colit = v;
                                }},this.FColumnsSubPropertyName,0,$mod.TTMSFNCDataBinderFindType.bftString);
                              if (psub != null) pas.TypInfo.SetStrProp$1(colit,psub,f.FFieldName);
                            };
                          };
                        };
                      };
                      if (its != null) {
                        try {
                          if ((ai >= 0) && (ai <= (its.GetCount() - 1))) {
                            it = its.GetItem(ai);
                            cit = it;
                            for (var $l4 = 0, $end4 = this.FDataLink.GetDataset().GetfieldCount() - 1; $l4 <= $end4; $l4++) {
                              I = $l4;
                              f = this.FDataLink.GetDataset().FFieldList.GetField(I);
                              if (f != null) {
                                for (var $l5 = 0, $end5 = this.FSubPropertyNames.GetCount() - 1; $l5 <= $end5; $l5++) {
                                  J = $l5;
                                  itv = cit;
                                  psub = this.FindProperty({get: function () {
                                      return itv;
                                    }, set: function (v) {
                                      itv = v;
                                    }},this.FSubPropertyNames.GetItemEx(J).FValue,I,$mod.TTMSFNCDataBinderFindType.bftDontCare);
                                  if (psub != null) this.WriteFieldToProperty(itv,psub,f);
                                };
                              };
                            };
                          };
                        } finally {
                        };
                      };
                    };
                  };
                };
              } else if ($tmp1 === $mod.TTMSFNCDataBinderDataLinkMode.dlmUpdateData) this.FDirty = false;
            } else if ($tmp === $mod.TTMSFNCDataBinderBindType.dbbtGrid) {
              var $tmp4 = AMode;
              if (($tmp4 === $mod.TTMSFNCDataBinderDataLinkMode.dlmDataSetChanged) || ($tmp4 === $mod.TTMSFNCDataBinderDataLinkMode.dlmActiveChanged)) {
                if (pas.SysUtils.Supports$3(no,$mod.ITMSFNCDataBinderGrid.$guid,{get: function () {
                    return dbg;
                  }, set: function (v) {
                    dbg = v;
                  }})) {
                  if (em) {
                    if (ai > -1) {
                      dbg.DataInsertRow(ai);
                      SetActiveItemIndex();
                    };
                    DoEndUpdate();
                    return;
                  };
                  dbg.SetDataColumnCount(this.FDataLink.GetDataset().GetfieldCount());
                  dbg.SetDataRowCount(this.GetRecordCount());
                  for (var $l6 = 0, $end6 = this.FDataLink.GetDataset().GetfieldCount() - 1; $l6 <= $end6; $l6++) {
                    I = $l6;
                    f = this.FDataLink.GetDataset().FFieldList.GetField(I);
                    if (f != null) dbg.SetDataHeader(I,f.FFieldName);
                  };
                  this.FDataLink.GetDataset().DisableControls();
                  cb.$assign(this.FDataLink.GetDataset().GetBookmark());
                  this.FDataLink.GetDataset().First();
                  try {
                    L = 0;
                    while (!this.FDataLink.GetDataset().GetEOF()) {
                      for (var $l7 = 0, $end7 = this.FDataLink.GetDataset().GetfieldCount() - 1; $l7 <= $end7; $l7++) {
                        I = $l7;
                        f = this.FDataLink.GetDataset().FFieldList.GetField(I);
                        if (f != null) dbg.SetDataValue(I,L,f.GetDisplayText());
                      };
                      this.FDataLink.GetDataset().Next();
                      L += 1;
                    };
                  } finally {
                    this.FDataLink.GetDataset().GotoBookmark(cb);
                    this.FDataLink.GetDataset().FreeBookmark(pas.DB.TBookmark.$clone(cb));
                    this.FDataLink.GetDataset().EnableControls();
                  };
                  SetActiveItemIndex();
                };
              } else if ($tmp4 === $mod.TTMSFNCDataBinderDataLinkMode.dlmDataSetScrolled) {
                SetActiveItemIndex()}
               else if ($tmp4 === $mod.TTMSFNCDataBinderDataLinkMode.dlmRecordChanged) {
                if (pas.SysUtils.Supports$3(no,$mod.ITMSFNCDataBinderGrid.$guid,{get: function () {
                    return dbg;
                  }, set: function (v) {
                    dbg = v;
                  }})) {
                  dbg.SetDataColumnCount(this.FDataLink.GetDataset().GetfieldCount());
                  for (var $l8 = 0, $end8 = this.FDataLink.GetDataset().GetfieldCount() - 1; $l8 <= $end8; $l8++) {
                    I = $l8;
                    f = this.FDataLink.GetDataset().FFieldList.GetField(I);
                    if (f != null) dbg.SetDataHeader(I,f.FFieldName);
                  };
                  try {
                    if ((ai >= 0) && (ai <= (dbg.GetDataRowCount() - 1))) {
                      for (var $l9 = 0, $end9 = this.FDataLink.GetDataset().GetfieldCount() - 1; $l9 <= $end9; $l9++) {
                        I = $l9;
                        f = this.FDataLink.GetDataset().FFieldList.GetField(I);
                        if (f != null) dbg.SetDataValue(I,ai,f.GetDisplayText());
                      };
                    };
                  } finally {
                  };
                };
              } else if ($tmp4 === $mod.TTMSFNCDataBinderDataLinkMode.dlmUpdateData) this.FDirty = false;
            } else if ($tmp === $mod.TTMSFNCDataBinderBindType.dbbtList) {
              var $tmp5 = AMode;
              if (($tmp5 === $mod.TTMSFNCDataBinderDataLinkMode.dlmDataSetChanged) || ($tmp5 === $mod.TTMSFNCDataBinderDataLinkMode.dlmActiveChanged)) {
                if ((this.FSubFieldNames.GetCount() > 0) || (this.FFieldName !== "") || (this.FHTMLTemplate !== "")) {
                  k = pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.GetPropInfoType(p);
                  var $tmp6 = k;
                  if ($tmp6 === pas.System.TTypeKind.tkClass) {
                    o = pas.TypInfo.GetObjectProp$2(no,p);
                    if (o != null) {
                      its = null;
                      sl = null;
                      gls = null;
                      gli = null;
                      if (pas.Classes.TCollection.isPrototypeOf(o)) {
                        its = rtl.as(o,pas.Classes.TCollection);
                        if (em) {
                          if (ai > -1) {
                            its.Insert(ai);
                            SetActiveItemIndex();
                          };
                          DoEndUpdate();
                          return;
                        };
                        its.Clear();
                      } else if (pas.Classes.TStrings.isPrototypeOf(o)) {
                        sl = rtl.as(o,pas.Classes.TStrings);
                        if (em) {
                          if (ai > -1) {
                            sl.Insert(ai,"");
                            SetActiveItemIndex();
                          };
                          DoEndUpdate();
                          return;
                        };
                        sl.Clear();
                      } else if (pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsGenericList(o.$class.ClassType(),"String")) {
                        gls = o;
                        if (em) {
                          if (ai > -1) {
                            gls.Insert(ai,"");
                            SetActiveItemIndex();
                          };
                          DoEndUpdate();
                          return;
                        };
                        gls.Clear();
                      } else if (pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsGenericList(o.$class.ClassType(),"Integer")) {
                        gli = o;
                        if (em) {
                          if (ai > -1) {
                            gli.Insert(ai,0);
                            SetActiveItemIndex();
                          };
                          DoEndUpdate();
                          return;
                        };
                        gli.Clear();
                      };
                      this.FDataLink.GetDataset().DisableControls();
                      cb.$assign(this.FDataLink.GetDataset().GetBookmark());
                      this.FDataLink.GetDataset().First();
                      try {
                        while (!this.FDataLink.GetDataset().GetEOF()) {
                          if (its != null) {
                            it = its.Add();
                            UpdateItem(it);
                          } else if ((this.FSubFieldNames.GetCount() > 0) || (this.FFieldName !== "") || (this.FHTMLTemplate !== "")) {
                            f = null;
                            if ((this.FSubFieldNames.GetCount() > 0) && (this.FSubFieldNames.GetItemEx(0).FValue !== "")) {
                              f = this.FDataLink.GetDataset().FieldByName(this.FSubFieldNames.GetItemEx(0).FValue)}
                             else if (this.FFieldName !== "") f = this.FDataLink.GetDataset().FieldByName(this.FFieldName);
                            if (f != null) {
                              if (sl != null) {
                                sl.Add(f.GetAsString())}
                               else if (gls != null) {
                                gls.Add(f.GetAsString())}
                               else if (gli != null) gli.Add(f.GetAsInteger());
                            } else {
                              if ((this.FSubFieldNames.GetCount() > 0) && (this.FSubFieldNames.GetItemEx(0).FHTMLTemplate !== "")) {
                                h = this.HTMLDBReplace(this.FSubFieldNames.GetItemEx(0).FHTMLTemplate,this.FDataLink.GetDataset())}
                               else h = this.HTMLDBReplace(this.FHTMLTemplate,this.FDataLink.GetDataset());
                              if (sl != null) {
                                sl.Add(h)}
                               else if (gls != null) gls.Add(h);
                            };
                          };
                          this.FDataLink.GetDataset().Next();
                        };
                      } finally {
                        this.FDataLink.GetDataset().GotoBookmark(cb);
                        this.FDataLink.GetDataset().FreeBookmark(pas.DB.TBookmark.$clone(cb));
                        this.FDataLink.GetDataset().EnableControls();
                      };
                      SetActiveItemIndex();
                    };
                  };
                };
              } else if ($tmp5 === $mod.TTMSFNCDataBinderDataLinkMode.dlmDataSetScrolled) {
                SetActiveItemIndex()}
               else if ($tmp5 === $mod.TTMSFNCDataBinderDataLinkMode.dlmRecordChanged) {
                if ((this.FSubFieldNames.GetCount() > 0) || (this.FFieldName !== "") || (this.FHTMLTemplate !== "")) {
                  k = pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.GetPropInfoType(p);
                  var $tmp7 = k;
                  if ($tmp7 === pas.System.TTypeKind.tkClass) {
                    o = pas.TypInfo.GetObjectProp$2(no,p);
                    if (o != null) {
                      its = null;
                      sl = null;
                      gls = null;
                      gli = null;
                      if (pas.Classes.TCollection.isPrototypeOf(o)) {
                        its = rtl.as(o,pas.Classes.TCollection)}
                       else if (pas.Classes.TStrings.isPrototypeOf(o)) {
                        sl = rtl.as(o,pas.Classes.TStrings)}
                       else if (pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsGenericList(o.$class.ClassType(),"String")) {
                        gls = o}
                       else if (pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsGenericList(o.$class.ClassType(),"Integer")) gli = o;
                      try {
                        if (its != null) {
                          if ((ai >= 0) && (ai <= (its.GetCount() - 1))) {
                            it = its.GetItem(ai);
                            UpdateItem(it);
                          };
                        } else if ((this.FSubFieldNames.GetCount() > 0) || (this.FFieldName !== "") || (this.FHTMLTemplate !== "")) {
                          if ((this.FSubFieldNames.GetCount() > 0) && (this.FSubFieldNames.GetItemEx(0).FValue !== "")) {
                            f = this.FDataLink.GetDataset().FieldByName(this.FSubFieldNames.GetItemEx(0).FValue)}
                           else f = this.FDataLink.GetDataset().FieldByName(this.FFieldName);
                          if (f != null) {
                            if (sl != null) {
                              if ((ai >= 0) && (ai <= (sl.GetCount() - 1))) sl.Put(ai,f.GetAsString());
                            } else if (gls != null) {
                              if ((ai >= 0) && (ai <= (gls.FLength - 1))) gls.SetItem(ai,f.GetAsString());
                            } else if (gli != null) {
                              if ((ai >= 0) && (ai <= (gli.FLength - 1))) gli.SetItem(ai,f.GetAsInteger());
                            };
                          } else {
                            h = this.HTMLDBReplace(this.FHTMLTemplate,this.FDataLink.GetDataset());
                            if (sl != null) {
                              if ((ai >= 0) && (ai <= (sl.GetCount() - 1))) sl.Put(ai,h);
                            } else if (gls != null) {
                              if ((ai >= 0) && (ai <= (gls.FLength - 1))) gls.SetItem(ai,h);
                            };
                          };
                        };
                      } finally {
                      };
                    };
                  };
                };
              } else if ($tmp5 === $mod.TTMSFNCDataBinderDataLinkMode.dlmUpdateData) this.FDirty = false;
            };
          } else {
            var $tmp8 = this.FBindType;
            if ($tmp8 === $mod.TTMSFNCDataBinderBindType.dbbtSingleValue) {
              this.ClearProperty(no,p)}
             else if ($tmp8 === $mod.TTMSFNCDataBinderBindType.dbbtColumnList) {
              k = pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.GetPropInfoType(p);
              var $tmp9 = k;
              if ($tmp9 === pas.System.TTypeKind.tkClass) {
                o = pas.TypInfo.GetObjectProp$2(no,p);
                pcol = this.FindProperty({get: function () {
                    return no;
                  }, set: function (v) {
                    no = v;
                  }},this.FColumnsPropertyName,-1,$mod.TTMSFNCDataBinderFindType.bftDontCare);
                oc = null;
                if (pcol != null) oc = pas.TypInfo.GetObjectProp$2(no,pcol);
                if ((o != null) && pas.Classes.TCollection.isPrototypeOf(o)) {
                  its = rtl.as(o,pas.Classes.TCollection);
                  its.Clear();
                };
                if ((oc != null) && pas.Classes.TCollection.isPrototypeOf(oc)) {
                  col = rtl.as(oc,pas.Classes.TCollection);
                  col.Clear();
                };
              };
            } else if ($tmp8 === $mod.TTMSFNCDataBinderBindType.dbbtGrid) {
              if (pas.SysUtils.Supports$3(no,$mod.ITMSFNCDataBinderGrid.$guid,{get: function () {
                  return dbg;
                }, set: function (v) {
                  dbg = v;
                }})) dbg.ClearData();
            } else if ($tmp8 === $mod.TTMSFNCDataBinderBindType.dbbtList) {
              k = pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.GetPropInfoType(p);
              var $tmp10 = k;
              if ($tmp10 === pas.System.TTypeKind.tkClass) {
                o = pas.TypInfo.GetObjectProp$2(no,p);
                if (o != null) {
                  if (pas.Classes.TCollection.isPrototypeOf(o)) {
                    col = rtl.as(o,pas.Classes.TCollection);
                    col.Clear();
                  } else if (pas.Classes.TStrings.isPrototypeOf(o)) {
                    sl = rtl.as(o,pas.Classes.TStrings);
                    sl.Clear();
                  } else if (pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsGenericList(o.$class.ClassType(),"String")) {
                    gls = o;
                    gls.Clear();
                  } else if (pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.IsGenericList(o.$class.ClassType(),"Integer")) {
                    gli = o;
                    gli.Clear();
                  };
                };
              };
            };
          };
        } finally {
          DoEndUpdate();
        };
      } finally {
        rtl._Release(dbg);
      };
    };
    this.WriteValueToField = function () {
      if (this.CheckDataSet() && (this.DataSetIsEditing() || this.DataSetIsInserting())) {
        this.FDirty = true;
        this.UpdateDataLink($mod.TTMSFNCDataBinderDataLinkMode.dlmUpdateData,-1,null);
      };
    };
    this.DataSetLocate = function (AKeyFieldNames, AKeyValues) {
      var Result = false;
      Result = false;
      if (this.CheckDataSet()) Result = this.FDataLink.GetDataset().Locate(AKeyFieldNames,AKeyValues,{});
      return Result;
    };
    this.DataSetIsEditing = function () {
      var Result = false;
      Result = false;
      if (this.CheckDataSet()) Result = this.FDataLink.GetDataset().FState === pas.DB.TDataSetState.dsEdit;
      return Result;
    };
    this.DataSetIsInserting = function () {
      var Result = false;
      Result = false;
      if (this.CheckDataSet()) Result = this.FDataLink.GetDataset().FState === pas.DB.TDataSetState.dsInsert;
      return Result;
    };
    this.NotifyValueChanged = function () {
      this.Notify($mod.TTMSFNCDataBinderNotificationType.dbntValueChanged);
    };
    this.NotifyEdit = function () {
      this.Notify($mod.TTMSFNCDataBinderNotificationType.dbntEdit);
    };
    this.NotifyPost = function () {
      this.Notify($mod.TTMSFNCDataBinderNotificationType.dbntPost);
    };
    this.NotifyUpdate = function () {
      this.Notify($mod.TTMSFNCDataBinderNotificationType.dbntUpdate);
    };
    this.NotifySetActiveRecord = function () {
      this.Notify($mod.TTMSFNCDataBinderNotificationType.dbntSetActiveRecord);
    };
    this.DataSetEdit = function () {
      if (this.CheckDataSet() && !this.DataSetIsEditing()) this.FDataLink.GetDataset().Edit();
    };
    this.DataSetPost = function () {
      if (this.CheckDataSet() && this.DataSetIsEditing()) {
        if (!this.HasDirty()) this.FDataLink.GetDataset().Post();
      };
    };
    this.DataSetInsert = function () {
      if (this.CheckDataSet()) this.FDataLink.GetDataset().Insert$1();
    };
    this.DataSetDelete = function () {
      if (this.CheckDataSet()) this.FDataLink.GetDataset().Delete();
    };
    this.DataSetCancel = function () {
      if (this.CheckDataSet()) this.FDataLink.GetDataset().Cancel();
    };
    this.DataSetEnableControls = function () {
      if (this.CheckDataSet()) this.FDataLink.GetDataset().EnableControls();
    };
    this.DataSetDisableControls = function () {
      if (this.CheckDataSet()) this.FDataLink.GetDataset().DisableControls();
    };
    this.BeginUpdate = function () {
      this.FUpdating = true;
    };
    this.EndUpdate = function () {
      this.FUpdating = false;
    };
    this.DataSetCanModify = function () {
      var Result = false;
      Result = false;
      if (this.CheckDataSet()) Result = this.FDataLink.GetDataset().GetCanModify();
      return Result;
    };
    rtl.addIntf(this,$mod.ITMSFNCDataBinderNotification);
    var $r = this.$rtti;
    $r.addProperty("BindComponent",3,pas.Classes.$rtti["TComponent"],"GetBindComponent","SetBindComponent");
    $r.addProperty("PropertyName",2,rtl.string,"FPropertyName","SetPropertyName");
    $r.addProperty("ColumnsPropertyName",2,rtl.string,"FColumnsPropertyName","SetColumnsPropertyName");
    $r.addProperty("ColumnsSubPropertyName",2,rtl.string,"FColumnsSubPropertyName","SetColumnsSubPropertyName");
    $r.addProperty("SubPropertyNames",0,$mod.$rtti["TTMSFNCDataBinderPropertyNames"],"FSubPropertyNames","FSubPropertyNames");
    $r.addProperty("SubFieldNames",0,$mod.$rtti["TTMSFNCDataBinderFieldNames"],"FSubFieldNames","FSubFieldNames");
    $r.addProperty("DataSource",3,pas.DB.$rtti["TDataSource"],"GetDataSource","SetDataSource");
    $r.addProperty("Active",2,rtl.boolean,"FActive","SetActive",4,{Default: true});
    $r.addProperty("BindType",2,$mod.$rtti["TTMSFNCDataBinderBindType"],"FBindType","SetBindType",4,{Default: $mod.TTMSFNCDataBinderBindType.dbbtSingleValue});
    $r.addProperty("FieldName",2,rtl.string,"FFieldName","SetFieldName");
    $r.addProperty("HTMLTemplate",2,rtl.string,"FHTMLTemplate","SetHTMLTemplate");
    $r.addProperty("BooleanStringValue",2,rtl.string,"FBooleanStringValue","SetBooleanStringValue");
    $r.addProperty("Name",0,rtl.string,"FName","FName");
  });
  rtl.createClass(this,"TTMSFNCDataBinderItems",pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$init.call(this);
      this.FOwner$1 = null;
    };
    this.$final = function () {
      this.FOwner$1 = undefined;
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$final.call(this);
    };
    this.GetItemEx = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItemEx = function (Index, Value) {
      pas.Classes.TCollection.SetItem.call(this,Index,Value);
    };
    this.GetDataBinderItemClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCDataBinderItem;
      return Result;
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,this.GetDataBinderItemClass());
      this.FOwner$1 = AOwner;
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,index);
      return Result;
    };
  });
  this.$rtti.$DynArray("TTMSFNCDataBinderStringArray",{eltype: rtl.string});
  this.$rtti.$DynArray("TTMSFNCDataBinderPropertyList",{eltype: pas.TypInfo.$rtti["TTypeMemberProperty"]});
  this.$rtti.$MethodVar("TTMSFNCDataBinderBeforeWriteFieldToPropertyEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AObject",pas.System.$rtti["TObject"]],["AItem",this.$rtti["TTMSFNCDataBinderItem"]],["APropertyInfo",pas.TypInfo.$rtti["TTypeMemberProperty"]],["APropertyName",rtl.string],["APropertyKind",pas.System.$rtti["TTypeKind"]],["AField",pas.DB.$rtti["TField"]],["AAllow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataBinderAfterWriteFieldToPropertyEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AObject",pas.System.$rtti["TObject"]],["AItem",this.$rtti["TTMSFNCDataBinderItem"]],["APropertyInfo",pas.TypInfo.$rtti["TTypeMemberProperty"]],["APropertyName",rtl.string],["APropertyKind",pas.System.$rtti["TTypeKind"]],["AField",pas.DB.$rtti["TField"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataBinderBeforeWritePropertyToFieldEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AObject",pas.System.$rtti["TObject"]],["AItem",this.$rtti["TTMSFNCDataBinderItem"]],["APropertyInfo",pas.TypInfo.$rtti["TTypeMemberProperty"]],["APropertyName",rtl.string],["APropertyKind",pas.System.$rtti["TTypeKind"]],["AField",pas.DB.$rtti["TField"]],["AAllow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataBinderAfterWritePropertyToFieldEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AObject",pas.System.$rtti["TObject"]],["AItem",this.$rtti["TTMSFNCDataBinderItem"]],["APropertyInfo",pas.TypInfo.$rtti["TTypeMemberProperty"]],["APropertyName",rtl.string],["APropertyKind",pas.System.$rtti["TTypeKind"]],["AField",pas.DB.$rtti["TField"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataBinderBeforeWriteHTMLTemplateToPropertyEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AObject",pas.System.$rtti["TObject"]],["AItem",this.$rtti["TTMSFNCDataBinderItem"]],["APropertyInfo",pas.TypInfo.$rtti["TTypeMemberProperty"]],["APropertyName",rtl.string],["APropertyKind",pas.System.$rtti["TTypeKind"]],["AHTMLTemplate",rtl.string,1],["AAllow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataBinderAfterWriteHTMLTemplateToPropertyEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AObject",pas.System.$rtti["TObject"]],["AItem",this.$rtti["TTMSFNCDataBinderItem"]],["APropertyInfo",pas.TypInfo.$rtti["TTypeMemberProperty"]],["APropertyName",rtl.string],["APropertyKind",pas.System.$rtti["TTypeKind"]],["AHTMLTemplate",rtl.string]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCDataBinder",pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.$init.call(this);
      this.FDataSource = null;
      this.FUpdateCount$1 = 0;
      this.FItems = null;
      this.FActive = false;
      this.FOnAfterWriteFieldToProperty = null;
      this.FOnBeforeWriteFieldToProperty = null;
      this.FOnAfterWritePropertyToField = null;
      this.FOnBeforeWritePropertyToField = null;
      this.FOnAfterWriteHTMLTemplateToProperty = null;
      this.FOnBeforeWriteHTMLTemplateToProperty = null;
    };
    this.$final = function () {
      this.FDataSource = undefined;
      this.FItems = undefined;
      this.FOnAfterWriteFieldToProperty = undefined;
      this.FOnBeforeWriteFieldToProperty = undefined;
      this.FOnAfterWritePropertyToField = undefined;
      this.FOnBeforeWritePropertyToField = undefined;
      this.FOnAfterWriteHTMLTemplateToProperty = undefined;
      this.FOnBeforeWriteHTMLTemplateToProperty = undefined;
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.$final.call(this);
    };
    this.SetItems = function (Value) {
      this.FItems.Assign(Value);
    };
    this.GetItems = function () {
      var Result = null;
      Result = this.FItems;
      return Result;
    };
    this.SetActive = function (Value) {
      var I = 0;
      if (this.FActive !== Value) {
        this.FActive = Value;
        for (var $l = 0, $end = this.ItemCount() - 1; $l <= $end; $l++) {
          I = $l;
          this.GetItems().GetItemEx(I).FActive = this.FActive;
        };
        this.UpdateDataLinks();
      };
    };
    this.GetItemByName = function (AName) {
      var Result = null;
      var I = 0;
      Result = null;
      for (var $l = 0, $end = this.GetItems().GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if ((this.GetItems().GetItemEx(I).FName !== "") && (this.GetItems().GetItemEx(I).FName === AName)) {
          Result = this.GetItems().GetItemEx(I);
          break;
        };
      };
      return Result;
    };
    this.GetItemByObject = function (AObject, APropertyName) {
      var Result = null;
      var I = 0;
      Result = null;
      for (var $l = 0, $end = this.GetItems().GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if ((this.GetItems().GetItemEx(I).GetObject() === AObject) && ((this.GetItems().GetItemEx(I).FPropertyName === APropertyName) || (APropertyName === ""))) {
          Result = this.GetItems().GetItemEx(I);
          break;
        };
      };
      return Result;
    };
    this.GetDataSource = function () {
      var Result = null;
      Result = this.FDataSource;
      return Result;
    };
    this.SetDataSource = function (Value) {
      var I = 0;
      if (this.FDataSource !== Value) {
        this.FDataSource = Value;
        if (this.FDataSource != null) {
          for (var $l = 0, $end = this.ItemCount() - 1; $l <= $end; $l++) {
            I = $l;
            if (this.GetItems().GetItemEx(I).GetDataSource() === null) this.GetItems().GetItemEx(I).SetDataSource(this.FDataSource);
          };
        };
      };
    };
    this.GetDocURL = function () {
      var Result = "";
      Result = pas["WEBLib.TMSFNCTypes"].TTMSFNCBaseDocURL + "tmsfnccore/components/ttmsfncdatabinding/";
      return Result;
    };
    this.GetInstance = function () {
      var Result = 0;
      Result = pas["WEBLib.TMSFNCTypes"].HInstance();
      return Result;
    };
    this.GetVersion = function () {
      var Result = "";
      Result = this.$class.GetVersionNumber(1,0,0,2);
      return Result;
    };
    this.CreateItems = function () {
      var Result = null;
      Result = $mod.TTMSFNCDataBinderItems.$create("Create$3",[this]);
      return Result;
    };
    this.DoBeforeWriteFieldToProperty = function (AObject, AItem, APropertyInfo, APropertyName, APropertyKind, AField, AAllow) {
      if (this.FOnBeforeWriteFieldToProperty != null) this.FOnBeforeWriteFieldToProperty(this,AObject,AItem,APropertyInfo,APropertyName,APropertyKind,AField,AAllow);
    };
    this.DoAfterWriteFieldToProperty = function (AObject, AItem, APropertyInfo, APropertyName, APropertyKind, AField) {
      if (this.FOnAfterWriteFieldToProperty != null) this.FOnAfterWriteFieldToProperty(this,AObject,AItem,APropertyInfo,APropertyName,APropertyKind,AField);
    };
    this.DoBeforeWritePropertyToField = function (AObject, AItem, APropertyInfo, APropertyName, APropertyKind, AField, AAllow) {
      if (this.FOnBeforeWritePropertyToField != null) this.FOnBeforeWritePropertyToField(this,AObject,AItem,APropertyInfo,APropertyName,APropertyKind,AField,AAllow);
    };
    this.DoAfterWritePropertyToField = function (AObject, AItem, APropertyInfo, APropertyName, APropertyKind, AField) {
      if (this.FOnAfterWritePropertyToField != null) this.FOnAfterWritePropertyToField(this,AObject,AItem,APropertyInfo,APropertyName,APropertyKind,AField);
    };
    this.DoBeforeWriteHTMLTemplateToProperty = function (AObject, AItem, APropertyInfo, APropertyName, APropertyKind, AHTMLTemplate, AAllow) {
      if (this.FOnBeforeWriteHTMLTemplateToProperty != null) this.FOnBeforeWriteHTMLTemplateToProperty(this,AObject,AItem,APropertyInfo,APropertyName,APropertyKind,AHTMLTemplate,AAllow);
    };
    this.DoAfterWriteHTMLTemplateToProperty = function (AObject, AItem, APropertyInfo, APropertyName, APropertyKind, AHTMLTemplate) {
      if (this.FOnAfterWriteHTMLTemplateToProperty != null) this.FOnAfterWriteHTMLTemplateToProperty(this,AObject,AItem,APropertyInfo,APropertyName,APropertyKind,AHTMLTemplate);
    };
    this.RegisterRuntimeClasses = function () {
      pas.Classes.RegisterClass($mod.TTMSFNCDataBinder);
    };
    this.UpdateDataLinks = function () {
      var I = 0;
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.FItems.GetItemEx(I).UpdateDataLink($mod.TTMSFNCDataBinderDataLinkMode.dlmActiveChanged,-1,null);
      };
    };
    this.Notification = function (AComponent, AOperation) {
      var i = 0;
      if ((AOperation === pas.Classes.TOperation.opRemove) && !(pas.Classes.TComponentStateItem.csDestroying in this.FComponentState)) {
        if (this.FDataSource === AComponent) this.FDataSource = null;
        i = this.FItems.GetCount() - 1;
        while (i >= 0) {
          if (this.FItems.GetItemEx(i).GetDataSource() === AComponent) this.FItems.GetItemEx(i).SetDataSource(null);
          if (this.FItems.GetItemEx(i).GetObject() === AComponent) this.FItems.GetItemEx(i).SetObject(null);
          i -= 1;
        };
      };
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.Notification.apply(this,arguments);
    };
    this.Create$5 = function () {
      this.Create$1(null);
      return this;
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.Create$1.apply(this,arguments);
      this.FItems = this.CreateItems();
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FItems");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.BeginUpdate = function () {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.BeginUpdate.call(this);
      this.FUpdateCount$1 += 1;
    };
    this.EndUpdate = function () {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.EndUpdate.call(this);
      this.FUpdateCount$1 -= 1;
      if (this.FUpdateCount$1 === 0) this.UpdateDataLinks();
    };
    this.ItemCount = function () {
      var Result = 0;
      Result = this.GetItems().GetCount();
      return Result;
    };
    this.HasEditLinkMonitor = function (AObject) {
      var Result = false;
      var I = 0;
      Result = false;
      for (var $l = 0, $end = this.ItemCount() - 1; $l <= $end; $l++) {
        I = $l;
        if ((this.GetItems().GetItemEx(I).GetObject() === AObject) && this.GetItems().GetItemEx(I).HasEditLinkMonitor()) {
          Result = true;
          break;
        };
      };
      return Result;
    };
    this.HasControlValueMonitor = function (AObject) {
      var Result = false;
      var I = 0;
      Result = false;
      for (var $l = 0, $end = this.ItemCount() - 1; $l <= $end; $l++) {
        I = $l;
        if ((this.GetItems().GetItemEx(I).GetObject() === AObject) && this.GetItems().GetItemEx(I).HasControlValueMonitor()) {
          Result = true;
          break;
        };
      };
      return Result;
    };
    this.GetDataSources = function (AStrings) {
      var f = null;
      var i = 0;
      var K = 0;
      f = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetOwnerForm(this);
      if (f != null) {
        for (var $l = 0, $end = f.GetComponentCount() - 1; $l <= $end; $l++) {
          i = $l;
          if (pas["WEBLib.Forms"].TFrame.isPrototypeOf(f.GetComponent(i))) {
            for (var $l1 = 0, $end1 = rtl.as(f.GetComponent(i),pas["WEBLib.Forms"].TFrame).GetComponentCount() - 1; $l1 <= $end1; $l1++) {
              K = $l1;
              if (pas.DB.TDataSource.isPrototypeOf(rtl.as(f.GetComponent(i),pas["WEBLib.Forms"].TFrame).GetComponent(K))) {
                AStrings.AddObject(rtl.as(f.GetComponent(i),pas["WEBLib.Forms"].TFrame).GetComponent(K).FName,rtl.as(f.GetComponent(i),pas["WEBLib.Forms"].TFrame).GetComponent(K));
              };
            };
          } else {
            if (pas.DB.TDataSource.isPrototypeOf(f.GetComponent(i))) {
              AStrings.AddObject(f.GetComponent(i).FName,f.GetComponent(i));
            };
          };
        };
      };
    };
    this.GetPropertyList = function (AObject) {
      var Result = [];
      Result = this.GetPropertyList$1(AObject,false);
      return Result;
    };
    this.GetPropertyNames = function (AObject, IncludePublic) {
      var Result = [];
      var ci = null;
      var a = [];
      var I = 0;
      Result = rtl.arraySetLength(Result,"",0);
      if (AObject != null) {
        ci = AObject.$rtti;
        a = pas.TypInfo.GetPropList(ci,pas.System.tkProperties,true);
        Result = rtl.arraySetLength(Result,"",rtl.length(a));
        for (var $l = 0, $end = rtl.length(a) - 1; $l <= $end; $l++) {
          I = $l;
          Result[I] = pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.GetPropInfoName(a[I]);
        };
      };
      return Result;
    };
    this.GetPropertyList$1 = function (AObject, IncludePublic) {
      var Result = [];
      var ci = null;
      var p = null;
      var a = [];
      var I = 0;
      Result = rtl.arraySetLength(Result,null,0);
      if (!(AObject != null)) return Result;
      ci = AObject.$rtti;
      a = pas.TypInfo.GetPropList(ci,pas.System.tkProperties,true);
      for (var $l = 0, $end = rtl.length(a) - 1; $l <= $end; $l++) {
        I = $l;
        Result = rtl.arraySetLength(Result,null,rtl.length(Result) + 1);
        Result[rtl.length(Result) - 1] = a[I];
      };
      return Result;
    };
    this.BlobFieldToBitmap = function (AField, ABitmap) {
      if (!(AField != null)) return;
      if (!(AField.FDataSet != null)) return;
      ABitmap.LoadFromURL(AField.GetAsString(),null);
    };
    this.BitmapToBlobField = function (AField, ABitmap) {
      if (!(AField != null)) return;
      if (!(AField.FDataSet != null)) return;
    };
    this.NotifyEdit = function () {
      var I = 0;
      for (var $l = 0, $end = this.ItemCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.GetItems().GetItemEx(I).NotifyEdit();
      };
    };
    this.NotifyValueChanged = function () {
      var I = 0;
      for (var $l = 0, $end = this.ItemCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.GetItems().GetItemEx(I).NotifyValueChanged();
      };
    };
    this.NotifyPost = function () {
      var I = 0;
      for (var $l = 0, $end = this.ItemCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.GetItems().GetItemEx(I).NotifyPost();
      };
    };
    this.NotifyUpdate = function () {
      var I = 0;
      for (var $l = 0, $end = this.ItemCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.GetItems().GetItemEx(I).NotifyUpdate();
      };
    };
    this.NotifySetActiveRecord = function () {
      var I = 0;
      for (var $l = 0, $end = this.ItemCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.GetItems().GetItemEx(I).NotifySetActiveRecord();
      };
    };
    this.IsConnected = function (AObject) {
      var Result = false;
      var I = 0;
      Result = false;
      for (var $l = 0, $end = this.ItemCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (this.GetItems().GetItemEx(I).GetObject() === AObject) {
          Result = true;
          break;
        };
      };
      return Result;
    };
    this.ConnectSingleHTMLTemplate = function (AObject, ADataSource, APropertyName, AHTMLTemplate) {
      var Result = null;
      Result = this.Connect(AObject,ADataSource,APropertyName,"",AHTMLTemplate,null,null,null,$mod.TTMSFNCDataBinderBindType.dbbtSingleValue);
      return Result;
    };
    this.ConnectSingle = function (AObject, ADataSource, APropertyName, AFieldName) {
      var Result = null;
      Result = this.Connect(AObject,ADataSource,APropertyName,AFieldName,"",null,null,null,$mod.TTMSFNCDataBinderBindType.dbbtSingleValue);
      return Result;
    };
    this.ConnectListHTMLTemplate = function (AObject, ADataSource, APropertyName, ASubPropertyNames, ASubHTMLTemplates) {
      var Result = null;
      Result = this.Connect(AObject,ADataSource,APropertyName,"","",rtl.arrayRef(ASubPropertyNames),[],rtl.arrayRef(ASubHTMLTemplates),$mod.TTMSFNCDataBinderBindType.dbbtList);
      return Result;
    };
    this.ConnectList = function (AObject, ADataSource, APropertyName, ASubPropertyNames, ASubFieldNames) {
      var Result = null;
      Result = this.Connect(AObject,ADataSource,APropertyName,"","",rtl.arrayRef(ASubPropertyNames),rtl.arrayRef(ASubFieldNames),[],$mod.TTMSFNCDataBinderBindType.dbbtList);
      return Result;
    };
    this.ConnectListHTMLTemplate$1 = function (AObject, ADataSource, APropertyName, AHTMLTemplate) {
      var Result = null;
      Result = this.Connect(AObject,ADataSource,APropertyName,"",AHTMLTemplate,[],[],[],$mod.TTMSFNCDataBinderBindType.dbbtList);
      return Result;
    };
    this.ConnectList$1 = function (AObject, ADataSource, APropertyName, AFieldName) {
      var Result = null;
      Result = this.Connect(AObject,ADataSource,APropertyName,AFieldName,"",[],[],[],$mod.TTMSFNCDataBinderBindType.dbbtList);
      return Result;
    };
    this.ConnectColumnList = function (AObject, ADataSource, AListPropertyName, AColumnsPropertyName, AColumnsSubPropertyName, AListSubPropertyName) {
      var Result = null;
      Result = this.FItems.Add$1();
      Result.SetDataSource(ADataSource);
      Result.SetBindType($mod.TTMSFNCDataBinderBindType.dbbtColumnList);
      Result.SetColumnsPropertyName(AColumnsPropertyName);
      Result.SetColumnsSubPropertyName(AColumnsSubPropertyName);
      Result.SetObject(AObject);
      Result.SetPropertyName(AListPropertyName);
      Result.FSubPropertyNames.Add$1().SetValue(AListSubPropertyName);
      return Result;
    };
    this.Connect = function (AObject, ADataSource, APropertyName, AFieldName, AHTMLTemplate, ASubPropertyNames, ASubFieldNames, ASubHTMLTemplates, ABindType) {
      var Result = null;
      var I = 0;
      Result = this.FItems.Add$1();
      Result.SetDataSource(ADataSource);
      Result.SetBindType(ABindType);
      Result.SetFieldName(AFieldName);
      Result.SetObject(AObject);
      Result.SetPropertyName(APropertyName);
      Result.SetHTMLTemplate(AHTMLTemplate);
      if (rtl.length(ASubPropertyNames) > 0) {
        for (var $l = 0, $end = rtl.length(ASubPropertyNames) - 1; $l <= $end; $l++) {
          I = $l;
          Result.FSubPropertyNames.Add$1().SetValue(ASubPropertyNames[I]);
        };
      };
      if (rtl.length(ASubFieldNames) > 0) {
        for (var $l1 = 0, $end1 = rtl.length(ASubFieldNames) - 1; $l1 <= $end1; $l1++) {
          I = $l1;
          Result.FSubFieldNames.Add$1().SetValue(ASubFieldNames[I]);
        };
      };
      if (rtl.length(ASubHTMLTemplates) > 0) {
        for (var $l2 = 0, $end2 = rtl.length(ASubHTMLTemplates) - 1; $l2 <= $end2; $l2++) {
          I = $l2;
          Result.FSubFieldNames.Add$1().SetHTMLTemplate(ASubHTMLTemplates[I]);
        };
      };
      return Result;
    };
    this.ConnectGrid = function (AObject, ADatasource) {
      var Result = null;
      Result = this.FItems.Add$1();
      Result.SetDataSource(ADatasource);
      Result.SetBindType($mod.TTMSFNCDataBinderBindType.dbbtGrid);
      Result.SetObject(AObject);
      return Result;
    };
    this.StartEditor = function (AObject) {
      var $Self = this;
      var e = null;
      e = pas["WEBLib.TMSFNCDataBindingEditor"].TTMSFNCDataBindingEditor.$create("Create$1",[$Self]);
      try {
        e.FDataBinder = $Self;
        e.FObject = AObject;
        e.Execute(function (AResult) {
          e = rtl.freeLoc(e);
        });
      } finally {
      };
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("DataSource",3,pas.DB.$rtti["TDataSource"],"GetDataSource","SetDataSource");
    $r.addProperty("Items",3,$mod.$rtti["TTMSFNCDataBinderItems"],"GetItems","SetItems");
    $r.addProperty("Version",1,rtl.string,"GetVersion","");
    $r.addProperty("Active",2,rtl.boolean,"FActive","SetActive",4,{Default: false});
    $r.addProperty("OnBeforeWriteFieldToProperty",0,$mod.$rtti["TTMSFNCDataBinderBeforeWriteFieldToPropertyEvent"],"FOnBeforeWriteFieldToProperty","FOnBeforeWriteFieldToProperty");
    $r.addProperty("OnAfterWriteFieldToProperty",0,$mod.$rtti["TTMSFNCDataBinderAfterWriteFieldToPropertyEvent"],"FOnAfterWriteFieldToProperty","FOnAfterWriteFieldToProperty");
    $r.addProperty("OnBeforeWritePropertyToField",0,$mod.$rtti["TTMSFNCDataBinderBeforeWritePropertyToFieldEvent"],"FOnBeforeWritePropertyToField","FOnBeforeWritePropertyToField");
    $r.addProperty("OnAfterWritePropertyToField",0,$mod.$rtti["TTMSFNCDataBinderAfterWritePropertyToFieldEvent"],"FOnAfterWritePropertyToField","FOnAfterWritePropertyToField");
    $r.addProperty("OnBeforeWriteHTMLTemplateToProperty",0,$mod.$rtti["TTMSFNCDataBinderBeforeWriteHTMLTemplateToPropertyEvent"],"FOnBeforeWriteHTMLTemplateToProperty","FOnBeforeWriteHTMLTemplateToProperty");
    $r.addProperty("OnAfterWriteHTMLTemplateToProperty",0,$mod.$rtti["TTMSFNCDataBinderAfterWriteHTMLTemplateToPropertyEvent"],"FOnAfterWriteHTMLTemplateToProperty","FOnAfterWriteHTMLTemplateToProperty");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
  $mod.$implcode = function () {
    $impl.FGlobalUpdating = false;
    $impl.FManager = null;
    $impl.DataBinderNotificationManager = function () {
      var Result = null;
      Result = $impl.FManager;
      return Result;
    };
  };
  $mod.$init = function () {
    if (!($impl.FManager != null)) $impl.FManager = $mod.TTMSFNCDataBinderNotificationManager.$create("Create$1");
  };
},["WEBLib.Graphics","WEBLib.Forms","WEBLib.TMSFNCUtils","WEBLib.TMSFNCCustomControl","SysUtils","WEBLib.TMSFNCGraphics","WEBLib.TMSFNCGraphicsTypes","WEBLib.TMSFNCDataBindingEditor"]);
rtl.module("WEBLib.TMSFNCCustomControl",["System","Classes","WEBLib.Controls","WEBLib.TMSFNCGraphics","WEBLib.Graphics","WEBLib.TMSFNCStyles","WEBLib.TMSFNCPersistence","WEBLib.TMSFNCUndo","WEBLib.TMSFNCDataBinding","Types","WEBLib.TMSFNCGraphicsTypes","WEBLib.TMSFNCTypes","TypInfo","WEBLib.Forms","WEBLib.Menus"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.FPC_FULLVERSION = 0;
  rtl.createClass(this,"TTMSFNCCustomDesignerForm",pas["WEBLib.Forms"].TForm,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.$rtti.$Class("TTMSFNCCustomControl");
  this.TTMSFNCControlAlignment = {"0": "caNone", caNone: 0, "1": "caTop", caTop: 1, "2": "caBottom", caBottom: 2, "3": "caLeft", caLeft: 3, "4": "caRight", caRight: 4, "5": "caClient", caClient: 5};
  this.$rtti.$Enum("TTMSFNCControlAlignment",{minvalue: 0, maxvalue: 5, ordtype: 1, enumtype: this.TTMSFNCControlAlignment});
  this.TTMSFNCControlPosition = {"0": "cpTopLeft", cpTopLeft: 0, "1": "cpTopCenter", cpTopCenter: 1, "2": "cpTopRight", cpTopRight: 2, "3": "cpCenterLeft", cpCenterLeft: 3, "4": "cpCenterCenter", cpCenterCenter: 4, "5": "cpCenterRight", cpCenterRight: 5, "6": "cpBottomLeft", cpBottomLeft: 6, "7": "cpBottomCenter", cpBottomCenter: 7, "8": "cpBottomRight", cpBottomRight: 8};
  this.$rtti.$Enum("TTMSFNCControlPosition",{minvalue: 0, maxvalue: 8, ordtype: 1, enumtype: this.TTMSFNCControlPosition});
  rtl.createClass(this,"TTMSFNCCustomControlDropFiles",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FFiles = null;
    };
    this.$final = function () {
      this.FFiles = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.GetFiles = function () {
      var Result = null;
      if (!(this.FFiles != null)) this.FFiles = pas.Classes.TStringList.$create("Create$1");
      Result = this.FFiles;
      return Result;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FFiles;
        }, set: function (v) {
          this.p.FFiles = v;
        }});
    };
  });
  rtl.createClass(this,"TTMSFNCCustomControlBaseCommon",pas["WEBLib.Menus"].TWebCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Menus"].TWebCustomControl.$init.call(this);
      this.FResourceScaleFactor = 0.0;
      this.FPaintScaleFactor = 0.0;
      this.FDesigntimeFormPixelsPerInch = 0;
      this.FAllowFocus = false;
      this.FShortCutHint = "";
      this.FAcceptDropFiles = false;
      this.FAllowGetChildren = false;
      this.FAdaptToStyle = false;
      this.FAdaptedToStyle = false;
      this.FTransparent = false;
      this.FBufferedPainting = false;
      this.FNativeCanvas = false;
      this.FAntiAliasing = false;
      this.FOptimizedHTMLDrawing = false;
      this.FShowAcceleratorChar = false;
      this.FTextQuality = 0;
      this.FOnInternalDblClick = null;
      this.FOnInternalMouseDown = null;
      this.FOnInternalMouseMove = null;
      this.FOnInternalMouseUp = null;
    };
    this.$final = function () {
      this.FOnInternalDblClick = undefined;
      this.FOnInternalMouseDown = undefined;
      this.FOnInternalMouseMove = undefined;
      this.FOnInternalMouseUp = undefined;
      pas["WEBLib.Menus"].TWebCustomControl.$final.call(this);
    };
    this.GetAllowFocus = function () {
      var Result = false;
      Result = this.FAllowFocus;
      return Result;
    };
    this.GetShortCutHint = function () {
      var Result = "";
      Result = this.FShortCutHint;
      return Result;
    };
    this.GetControlAlignment = function () {
      var Result = 0;
      Result = $mod.TTMSFNCControlAlignment.caNone;
      var $tmp = this.FAlign;
      if ($tmp === pas["WEBLib.Controls"].TAlign.alNone) {
        Result = $mod.TTMSFNCControlAlignment.caNone}
       else if ($tmp === pas["WEBLib.Controls"].TAlign.alTop) {
        Result = $mod.TTMSFNCControlAlignment.caTop}
       else if ($tmp === pas["WEBLib.Controls"].TAlign.alBottom) {
        Result = $mod.TTMSFNCControlAlignment.caBottom}
       else if ($tmp === pas["WEBLib.Controls"].TAlign.alLeft) {
        Result = $mod.TTMSFNCControlAlignment.caLeft}
       else if ($tmp === pas["WEBLib.Controls"].TAlign.alRight) {
        Result = $mod.TTMSFNCControlAlignment.caRight}
       else if ($tmp === pas["WEBLib.Controls"].TAlign.alClient) Result = $mod.TTMSFNCControlAlignment.caClient;
      return Result;
    };
    this.SetAcceptDropFiles = function (Value) {
      if (this.FAcceptDropFiles !== Value) {
        this.FAcceptDropFiles = Value;
      };
    };
    this.SetAllowFocus = function (Value) {
      this.FAllowFocus = Value;
    };
    this.SetControlAlignment = function (Value) {
      var $tmp = Value;
      if ($tmp === $mod.TTMSFNCControlAlignment.caNone) {
        this.SetAlign(pas["WEBLib.Controls"].TAlign.alNone)}
       else if ($tmp === $mod.TTMSFNCControlAlignment.caTop) {
        this.SetAlign(pas["WEBLib.Controls"].TAlign.alTop)}
       else if ($tmp === $mod.TTMSFNCControlAlignment.caBottom) {
        this.SetAlign(pas["WEBLib.Controls"].TAlign.alBottom)}
       else if ($tmp === $mod.TTMSFNCControlAlignment.caLeft) {
        this.SetAlign(pas["WEBLib.Controls"].TAlign.alLeft)}
       else if ($tmp === $mod.TTMSFNCControlAlignment.caRight) {
        this.SetAlign(pas["WEBLib.Controls"].TAlign.alRight)}
       else if ($tmp === $mod.TTMSFNCControlAlignment.caClient) this.SetAlign(pas["WEBLib.Controls"].TAlign.alClient);
    };
    this.SetAntiAliasing = function (Value) {
      if (this.FAntiAliasing !== Value) {
        this.FAntiAliasing = Value;
        this.Invalidate();
      };
    };
    this.SetOptimizedHTMLDrawing = function (Value) {
      if (this.FOptimizedHTMLDrawing !== Value) {
        this.FOptimizedHTMLDrawing = Value;
        this.Invalidate();
      };
    };
    this.SetShowAcceleratorChar = function (Value) {
      if (this.FShowAcceleratorChar !== Value) {
        this.FShowAcceleratorChar = Value;
        this.Invalidate();
      };
    };
    this.SetNativeCanvas = function (Value) {
      if (this.FNativeCanvas !== Value) {
        this.FNativeCanvas = Value;
        this.Invalidate();
      };
    };
    this.SetTextQuality = function (Value) {
      if (this.FTextQuality !== Value) {
        this.FTextQuality = Value;
        this.Invalidate();
      };
    };
    this.SetShortCutHint = function (Value) {
      this.FShortCutHint = Value;
    };
    this.GetVersion = function () {
      var Result = "";
      Result = "";
      return Result;
    };
    this.GetDocURL = function () {
      var Result = "";
      Result = pas["WEBLib.TMSFNCTypes"].TTMSFNCBaseDocURL;
      return Result;
    };
    this.GetTipsURL = function () {
      var Result = "";
      Result = pas["WEBLib.TMSFNCTypes"].TTMSFNCBaseTipsURL;
      return Result;
    };
    this.HandleDesignHitTest = function (APoint) {
      var Result = false;
      Result = false;
      return Result;
    };
    this.GetClientMousePos = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      Result.$assign(this.ConvertScreenToClient(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetMousePos())));
      return Result;
    };
    this.ConvertScreenToClient = function (APoint) {
      var Result = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var p = pas.Types.TPoint.$new();
      p.$assign(this.ScreenToClient(pas.Types.Point(Math.round(APoint.X),Math.round(APoint.Y))));
      Result.$assign(pas["WEBLib.TMSFNCTypes"].PointF(p.x,p.y));
      return Result;
    };
    this.ConvertClientToScreen = function (APoint) {
      var Result = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var p = pas.Types.TPoint.$new();
      p.$assign(this.ClientToScreen(pas.Types.Point(Math.round(APoint.X),Math.round(APoint.Y))));
      Result.$assign(pas["WEBLib.TMSFNCTypes"].PointF(p.x,p.y));
      return Result;
    };
    this.GetDragObjectScreenShot = function () {
      var Result = null;
      Result = null;
      return Result;
    };
    this.GetAdaptToStyle = function () {
      var Result = false;
      Result = this.FAdaptToStyle;
      return Result;
    };
    this.SetEnabled = function (Value) {
      pas["WEBLib.Controls"].TControl.SetEnabled.apply(this,arguments);
      this.Invalidate();
    };
    this.CalcFactor = function () {
      this.FResourceScaleFactor = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetDPIScale(this,96);
      this.FPaintScaleFactor = this.FResourceScaleFactor;
    };
    this.ChangeDPIScale = function (M, D) {
    };
    this.SetDefaultGraphicColors = function () {
      var c = 0;
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleBackgroundFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultPopupFillColor = c}
       else pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultPopupFillColor = 16777215;
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleBackgroundStrokeColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultPopupStrokeColor = c}
       else pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultPopupStrokeColor = 12632256;
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleDefaultButtonFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultButtonFillColor = c}
       else pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultButtonFillColor = pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(225,225,225);
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleLineFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultButtonStrokeColor = c}
       else pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultButtonStrokeColor = 11119017;
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleTextFontColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultTextFontColor = c}
       else pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultTextFontColor = 0;
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleSelectionFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultSelectionFillColor = c;
        pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultButtonFillColorFocused = pas["WEBLib.TMSFNCGraphicsTypes"].Blend(c,pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultButtonFillColor,25);
        pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultButtonStrokeColorFocused = pas["WEBLib.TMSFNCGraphicsTypes"].Blend(c,pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultButtonStrokeColor,30);
      } else {
        pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultSelectionFillColor = 0;
        pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultButtonFillColorFocused = pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(229,241,251);
        pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultButtonStrokeColorFocused = pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(60,127,177);
      };
      pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultButtonStrokeColorDisabled = 11119017;
      pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultButtonFillColorDisabled = 13882323;
    };
    this.SetAdaptToStyle = function (Value) {
      this.FAdaptToStyle = Value;
      this.InitializeStyle();
    };
    this.CancelHint = function () {
    };
    this.BeginDrag$1 = function () {
    };
    this.InitializeStyle = function () {
      this.SetDefaultGraphicColors();
      this.DestroyGraphicElements();
      if (this.GetAdaptToStyle()) {
        this.FAdaptedToStyle = true;
        this.ApplyStyle();
      } else if (this.FAdaptedToStyle) {
        this.ResetToDefaultStyle();
        this.FAdaptedToStyle = false;
      };
      this.Invalidate();
    };
    this.ApplyStyle = function () {
    };
    this.ResetToDefaultStyle = function () {
    };
    this.HandleMouseLeave = function () {
    };
    this.HandleMouseEnter = function () {
    };
    this.HandleMouseDown = function (Button, Shift, X, Y) {
    };
    this.HandleMouseMove = function (Shift, X, Y) {
    };
    this.HandleDblClick = function (X, Y) {
    };
    this.HandleMouseUp = function (Button, Shift, X, Y) {
    };
    this.HandleKeyPress = function (Key) {
    };
    this.HandleKeyDown = function (Key, Shift) {
    };
    this.HandleDialogKey = function (Key, Shift) {
    };
    this.HandleKeyUp = function (Key, Shift) {
    };
    this.HandleMouseWheel = function (Shift, WheelDelta, Handled) {
    };
    this.HandleDragOver = function (Source, Point, Accept) {
    };
    this.HandleDragDrop = function (Source, Point) {
    };
    this.Create$1 = function (AOwner) {
      var ppi = 0;
      pas["WEBLib.Controls"].TControl.Create$1.apply(this,arguments);
      ppi = 96;
      this.FDesigntimeFormPixelsPerInch = ppi;
      this.FPaintScaleFactor = 1.0;
      this.FResourceScaleFactor = 1.0;
      this.SetDefaultGraphicColors();
      this.FAdaptToStyle = false;
      this.FAdaptedToStyle = false;
      this.FAcceptDropFiles = false;
      this.FTransparent = false;
      this.FNativeCanvas = false;
      this.FBufferedPainting = false;
      this.FAntiAliasing = true;
      this.FOptimizedHTMLDrawing = true;
      this.FShowAcceleratorChar = true;
      this.FTextQuality = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextQuality.gtqAntiAliasing;
      this.FAllowFocus = true;
      return this;
    };
    this.Destroy = function () {
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.SetControlMargins = function (ALeft, ATop, ARight, ABottom) {
      this.SetAlignWithMargins(true);
      this.FMargins.SetLeft(Math.round(ALeft));
      this.FMargins.SetTop(Math.round(ATop));
      this.FMargins.SetRight(Math.round(ARight));
      this.FMargins.SetBottom(Math.round(ABottom));
    };
    this.GetControlMargins = function (ALeft, ATop, ARight, ABottom) {
      if (!this.FAlignWithMargins) return;
      ALeft.set(this.FMargins.FLeft);
      ATop.set(this.FMargins.FTop);
      ARight.set(this.FMargins.FRight);
      ABottom.set(this.FMargins.FBottom);
    };
    this.ScaleResourceValue = function (Value) {
      var Result = 0;
      Result = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(Value,Math.round(this.FResourceScaleFactor * 100),100);
      return Result;
    };
    this.ScaleResourceValue$1 = function (Value) {
      var Result = 0.0;
      Result = Value * this.FResourceScaleFactor;
      return Result;
    };
    this.ScalePaintValue = function (Value) {
      var Result = 0;
      Result = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(Value,Math.round(this.FPaintScaleFactor * 100),100);
      return Result;
    };
    this.ScalePaintValue$1 = function (Value) {
      var Result = 0.0;
      Result = Value * this.FPaintScaleFactor;
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCCustomControlBase",this.TTMSFNCCustomControlBaseCommon,function () {
    this.$init = function () {
      $mod.TTMSFNCCustomControlBaseCommon.$init.call(this);
      this.FStored = false;
      this.FHitTest = false;
    };
    this.MouseWheel = function (Shift, WheelDelta, Handled) {
      pas["WEBLib.Controls"].TControl.MouseWheel.apply(this,arguments);
      this.HandleMouseWheel(rtl.refSet(Shift),WheelDelta,Handled);
    };
    this.DoMouseLeave = function () {
      pas["WEBLib.Controls"].TControl.DoMouseLeave.call(this);
      this.HandleMouseLeave();
    };
    this.DoMouseEnter = function () {
      pas["WEBLib.Controls"].TControl.DoMouseEnter.call(this);
      this.HandleMouseEnter();
    };
    this.GetLocalRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,this.GetWidth(),this.GetHeight()));
      return Result;
    };
    this.GetHintString = function () {
      var Result = "";
      Result = "";
      return Result;
    };
    this.HasHint = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    this.MouseDown = function (Button, Shift, X, Y) {
      pas["WEBLib.Controls"].TControl.MouseDown.apply(this,arguments);
      this.HandleMouseDown(Button,rtl.refSet(Shift),X,Y);
      if (this.FOnInternalMouseDown != null) this.FOnInternalMouseDown(this);
    };
    this.MouseMove = function (Shift, X, Y) {
      pas["WEBLib.Controls"].TControl.MouseMove.apply(this,arguments);
      this.HandleMouseMove(rtl.refSet(Shift),X,Y);
      if (this.FOnInternalMouseMove != null) this.FOnInternalMouseMove(this);
    };
    this.MouseUp = function (Button, Shift, X, Y) {
      pas["WEBLib.Controls"].TControl.MouseUp.apply(this,arguments);
      this.HandleMouseUp(Button,rtl.refSet(Shift),X,Y);
      if (this.FOnInternalMouseUp != null) this.FOnInternalMouseUp(this);
    };
    this.DragOver = function (Source, X, Y, State, Accept) {
      pas["WEBLib.Controls"].TControl.DragOver.apply(this,arguments);
      this.HandleDragOver(Source,pas["WEBLib.TMSFNCTypes"].PointF(X,Y),Accept);
    };
    this.KeyDown = function (Key, Shift) {
      pas["WEBLib.Controls"].TControl.KeyDown.apply(this,arguments);
      this.HandleDialogKey(Key,rtl.refSet(Shift));
      this.HandleKeyDown(Key,rtl.refSet(Shift));
      if (Key.get() === 9) ;
    };
    this.KeyPress = function (Key) {
      pas["WEBLib.Controls"].TControl.KeyPress.apply(this,arguments);
      this.HandleKeyPress(Key);
    };
    this.KeyUp = function (Key, Shift) {
      pas["WEBLib.Controls"].TControl.KeyUp.apply(this,arguments);
      this.HandleKeyUp(Key,rtl.refSet(Shift));
    };
    this.DblClick = function () {
      var pf = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      pas["WEBLib.Controls"].TControl.DblClick.call(this);
      pf.$assign(this.ConvertScreenToClient(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetMousePos())));
      this.HandleDblClick(pf.X,pf.Y);
      if (this.FOnInternalDblClick != null) this.FOnInternalDblClick(this);
    };
    this.Create$1 = function (AOwner) {
      $mod.TTMSFNCCustomControlBaseCommon.Create$1.apply(this,arguments);
      this.FHitTest = true;
      this.FStored = true;
      this.FControlStyle = rtl.unionSet(this.FControlStyle,rtl.createSet(pas["WEBLib.Controls"].TControlStyleValue.csAcceptsControls));
      return this;
    };
    this.BeginUpdate = function () {
      pas["WEBLib.Controls"].TControl.BeginUpdate.call(this);
    };
    this.EndUpdate = function () {
      pas["WEBLib.Controls"].TCustomControl.EndUpdate.call(this);
    };
    this.DragDrop = function (Source, X, Y) {
      pas["WEBLib.Controls"].TControl.DragDrop.apply(this,arguments);
      this.HandleDragDrop(Source,pas["WEBLib.TMSFNCTypes"].PointF(X,Y));
    };
    this.CanFocus = function () {
      var Result = false;
      Result = pas["WEBLib.Controls"].TControl.CanFocus.call(this);
      Result = Result && this.GetAllowFocus();
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.$rtti.$MethodVar("TTMSFNCCustomControlBeforeDrawEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCustomControlAfterDrawEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCustomControlCanSavePropertyEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AObject",pas.System.$rtti["TObject"]],["APropertyName",rtl.string],["APropertyType",pas.System.$rtti["TTypeKind"]],["ACanSave",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCustomControlCanLoadPropertyEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AObject",pas.System.$rtti["TObject"]],["APropertyName",rtl.string],["APropertyType",pas.System.$rtti["TTypeKind"]],["ACanLoad",rtl.boolean,1]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCCustomControl",this.TTMSFNCCustomControlBase,function () {
    this.FBlockPersistenceInterface = false;
    this.$init = function () {
      $mod.TTMSFNCCustomControlBase.$init.call(this);
      this.FBlockInvalidate = false;
      this.FAppearancePersisting = false;
      this.FExporting = false;
      this.FExportRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FOnBeforeDraw = null;
      this.FOnAfterDraw = null;
      this.FOnCanSaveProperty = null;
      this.FOnCanLoadProperty = null;
      this.FFill = null;
      this.FManager = null;
      this.FStroke = null;
      this.FDataPointer = null;
      this.FDataBoolean = false;
      this.FDataString = "";
      this.FDataObject = null;
      this.FDataInteger = 0;
      this.FUndoManager = null;
    };
    this.$final = function () {
      this.FExportRect = undefined;
      this.FOnBeforeDraw = undefined;
      this.FOnAfterDraw = undefined;
      this.FOnCanSaveProperty = undefined;
      this.FOnCanLoadProperty = undefined;
      this.FFill = undefined;
      rtl.setIntfP(this,"FManager",null);
      this.FStroke = undefined;
      this.FDataObject = undefined;
      this.FUndoManager = undefined;
      $mod.TTMSFNCCustomControlBase.$final.call(this);
    };
    this.GetUndoManager = function () {
      var Result = null;
      if (!(this.FUndoManager != null)) this.FUndoManager = pas["WEBLib.TMSFNCUndo"].TTMSFNCUndoManager.$create("Create$2",[this]);
      Result = this.FUndoManager;
      return Result;
    };
    this.SetFill = function (Value) {
      this.FFill.Assign(Value);
    };
    this.SetStroke = function (Value) {
      this.FStroke.Assign(Value);
    };
    this.GetVersionNumber = function (AMaj, AMin, ARel, ABld) {
      var Result = "";
      Result = "";
      return Result;
    };
    this.DataGetItemIndex = function () {
      var Result = 0;
      Result = -1;
      return Result;
    };
    this.DataSetItemIndex = function (AValue) {
    };
    this.IsAppearanceProperty = function (AObject, APropertyName, APropertyType) {
      var Result = false;
      var Prop = null;
      var pName = "";
      var cn = "";
      Result = false;
      Prop = pas.TypInfo.GetPropInfo$2(AObject,APropertyName);
      if (Prop != null) {
        pName = pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.GetPropInfoName(Prop);
        cn = pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.GetPropInfoTypeName(Prop);
        Result = (cn === "TAlphaColor") || (cn === "TColor") || (cn === "TGraphicsColor") || (cn === "TTMSFNCGraphicsFill") || (cn === "TTMSFNCGraphicsStroke") || (pas.System.Pos("Appearance",pName) > 0);
        Result = Result || (APropertyName === "Fill") || (APropertyName === "Stroke") || (APropertyName === "Font");
      };
      return Result;
    };
    this.CanSaveProperty = function (AObject, APropertyName, APropertyType) {
      var Result = false;
      if ((AObject === this) && !this.FBlockPersistenceInterface) {
        Result = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.IndexOfTextInArray(APropertyName,pas["WEBLib.TMSFNCPersistence"].ExcludePropertyList) === -1}
       else Result = true;
      if (this.FAppearancePersisting) Result = Result && this.IsAppearanceProperty(AObject,APropertyName,APropertyType);
      this.DoCanSaveProperty(AObject,APropertyName,APropertyType,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.CanLoadProperty = function (AObject, APropertyName, APropertyType) {
      var Result = false;
      if ((AObject === this) && !this.FBlockPersistenceInterface) {
        Result = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.IndexOfTextInArray(APropertyName,pas["WEBLib.TMSFNCPersistence"].ExcludePropertyList) === -1}
       else Result = true;
      this.DoCanLoadProperty(AObject,APropertyName,APropertyType,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.GetVersion = function () {
      var Result = "";
      Result = "";
      return Result;
    };
    this.LocalToScreenEx = function (APoint) {
      var Result = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var pt = pas.Types.TPoint.$new();
      pt.$assign(this.ClientToScreen(pas.Types.Point(Math.round(APoint.X),Math.round(APoint.Y))));
      Result.$assign(pas["WEBLib.TMSFNCTypes"].PointF(pt.x,pt.y));
      return Result;
    };
    this.ScreenToLocalEx = function (APoint) {
      var Result = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var pt = pas.Types.TPoint.$new();
      pt.$assign(this.ScreenToClient(pas.Types.Point(Math.round(APoint.X),Math.round(APoint.Y))));
      Result.$assign(pas["WEBLib.TMSFNCTypes"].PointF(pt.x,pt.y));
      return Result;
    };
    this.GetContentRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(this.GetControlRect());
      return Result;
    };
    this.GetControlRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (this.IsExporting()) {
        Result.$assign(this.FExportRect)}
       else Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,this.GetWidth(),this.GetHeight()));
      return Result;
    };
    this.GetLocalRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (this.IsExporting()) {
        Result.$assign(this.FExportRect)}
       else Result.$assign($mod.TTMSFNCCustomControlBase.GetLocalRect.call(this));
      return Result;
    };
    this.IsExporting = function () {
      var Result = false;
      Result = this.FExporting;
      return Result;
    };
    this.SetColor = function (AValue) {
      pas["WEBLib.Controls"].TControl.SetColor.apply(this,arguments);
      if (this.FFill != null) this.FFill.SetColor(AValue);
      this.Invalidate();
    };
    this.ChangeDPIScale = function (M, D) {
      $mod.TTMSFNCCustomControlBaseCommon.ChangeDPIScale.apply(this,arguments);
      if (!this.IsLoading()) {
        this.CreateCheckBoxBitmaps();
        this.CreateRadioButtonBitmaps();
      };
    };
    this.RegisterRuntimeClasses = function () {
    };
    this.Export = function (AGraphics, ARect) {
      this.FExporting = true;
      this.SetExportRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect));
      this.BeforeExport();
      this.DrawBackground(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect));
      this.Draw(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect));
      this.FExporting = false;
      this.AfterExport();
    };
    this.SetExportRect = function (ARect) {
      this.FExportRect.$assign(ARect);
    };
    this.ApplyExportScale = function (AScale) {
    };
    this.ResetExportScale = function () {
    };
    this.BeforeExport = function () {
    };
    this.AfterExport = function () {
    };
    this.ApplyStyle = function () {
      var c = 0;
      $mod.TTMSFNCCustomControlBaseCommon.ApplyStyle.call(this);
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleBackgroundFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) this.FFill.SetColor(c);
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleLineFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) this.FStroke.SetColor(c);
    };
    this.DoExit = function () {
      pas["WEBLib.Controls"].TControl.DoExit.call(this);
      this.NotifyDataBinderUpdate();
    };
    this.AddManager = function (AManager) {
      rtl._AddRef(AManager);
      try {
        rtl.setIntfP(this,"FManager",AManager);
      } finally {
        rtl._Release(AManager);
      };
    };
    this.RemoveManager = function () {
      rtl.setIntfP(this,"FManager",null);
    };
    this.ResetToDefaultStyle = function () {
      $mod.TTMSFNCCustomControlBaseCommon.ResetToDefaultStyle.call(this);
      this.FFill.SetColor(16777215);
      this.FStroke.SetColor(12632256);
    };
    this.DestroyGraphicElements = function () {
      if ($impl.FDownBtn != null) {
        rtl.free($impl,"FDownBtn");
        $impl.FDownBtn = null;
      };
      if ($impl.FNormalBtn != null) {
        rtl.free($impl,"FNormalBtn");
        $impl.FNormalBtn = null;
      };
      if ($impl.FDownFocusBtn != null) {
        rtl.free($impl,"FDownFocusBtn");
        $impl.FDownFocusBtn = null;
      };
      if ($impl.FNormalFocusBtn != null) {
        rtl.free($impl,"FNormalFocusBtn");
        $impl.FNormalFocusBtn = null;
      };
      if ($impl.FNormalDisabledBtn != null) {
        rtl.free($impl,"FNormalDisabledBtn");
        $impl.FNormalDisabledBtn = null;
      };
      if ($impl.FCheckedChk != null) {
        rtl.free($impl,"FCheckedChk");
        $impl.FCheckedChk = null;
      };
      if ($impl.FCheckedFocusChk != null) {
        rtl.free($impl,"FCheckedFocusChk");
        $impl.FCheckedFocusChk = null;
      };
      if ($impl.FUnCheckedDisabledChk != null) {
        rtl.free($impl,"FUnCheckedDisabledChk");
        $impl.FUnCheckedDisabledChk = null;
      };
      if ($impl.FCheckedDisabledChk != null) {
        rtl.free($impl,"FCheckedDisabledChk");
        $impl.FCheckedDisabledChk = null;
      };
      if ($impl.FUnCheckedChk != null) {
        rtl.free($impl,"FUnCheckedChk");
        $impl.FUnCheckedChk = null;
      };
      if ($impl.FUnCheckedFocusChk != null) {
        rtl.free($impl,"FUnCheckedFocusChk");
        $impl.FUnCheckedFocusChk = null;
      };
      if ($impl.FCheckedRd != null) {
        rtl.free($impl,"FCheckedRd");
        $impl.FCheckedRd = null;
      };
      if ($impl.FCheckedFocusRd != null) {
        rtl.free($impl,"FCheckedFocusRd");
        $impl.FCheckedFocusRd = null;
      };
      if ($impl.FUnCheckedRd != null) {
        rtl.free($impl,"FUnCheckedRd");
        $impl.FUnCheckedRd = null;
      };
      if ($impl.FUnCheckedFocusRd != null) {
        rtl.free($impl,"FUnCheckedFocusRd");
        $impl.FUnCheckedFocusRd = null;
      };
      if ($impl.FUnCheckedDisabledRd != null) {
        rtl.free($impl,"FUnCheckedDisabledRd");
        $impl.FUnCheckedDisabledRd = null;
      };
      if ($impl.FCheckedDisabledRd != null) {
        rtl.free($impl,"FCheckedDisabledRd");
        $impl.FCheckedDisabledRd = null;
      };
    };
    this.UpdateControlAfterResize = function () {
    };
    this.CreateCheckBoxBitmaps = function () {
      var g = null;
      var bmp = null;
      var sc = 0.0;
      sc = this.FResourceScaleFactor;
      if ($impl.FCheckedFocusChk != null) {
        rtl.free($impl,"FCheckedFocusChk");
        $impl.FCheckedFocusChk = null;
      };
      if ($impl.FUnCheckedChk != null) {
        rtl.free($impl,"FUnCheckedChk");
        $impl.FUnCheckedChk = null;
      };
      if ($impl.FCheckedChk != null) {
        rtl.free($impl,"FCheckedChk");
        $impl.FCheckedChk = null;
      };
      if ($impl.FUnCheckedFocusChk != null) {
        rtl.free($impl,"FUnCheckedFocusChk");
        $impl.FUnCheckedFocusChk = null;
      };
      if ($impl.FUnCheckedDisabledChk != null) {
        rtl.free($impl,"FUnCheckedDisabledChk");
        $impl.FUnCheckedDisabledChk = null;
      };
      if ($impl.FCheckedDisabledChk != null) {
        rtl.free($impl,"FCheckedDisabledChk");
        $impl.FCheckedDisabledChk = null;
      };
      bmp = pas["WEBLib.Graphics"].TBitmap.$create("Create$3");
      g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("Create$1",[bmp.GetCanvas(),false]);
      try {
        bmp.SetSize(Math.round(16 * sc),Math.round(16 * sc));
        $impl.FUnCheckedChk = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
        $impl.FUnCheckedChk.FOnChange = rtl.createCallback(this,"DoBitmapChanged");
        g.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        g.FFill.SetColor(16777215);
        g.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
        g.FStroke.SetColor(16777215);
        g.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bmp.GetWidth(),bmp.GetHeight())),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        g.DrawCheckBox(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bmp.GetWidth(),bmp.GetHeight())),false,false,true,1.0);
        $impl.FUnCheckedChk.Assign(bmp);
        $impl.FCheckedChk = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
        $impl.FCheckedChk.FOnChange = rtl.createCallback(this,"DoBitmapChanged");
        g.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        g.FFill.SetColor(16777215);
        g.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
        g.FStroke.SetColor(16777215);
        g.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bmp.GetWidth(),bmp.GetHeight())),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        g.DrawCheckBox(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bmp.GetWidth(),bmp.GetHeight())),true,false,true,1.0);
        $impl.FCheckedChk.Assign(bmp);
        $impl.FUnCheckedFocusChk = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
        $impl.FUnCheckedFocusChk.FOnChange = rtl.createCallback(this,"DoBitmapChanged");
        g.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        g.FFill.SetColor(16777215);
        g.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
        g.FStroke.SetColor(16777215);
        g.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bmp.GetWidth(),bmp.GetHeight())),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        g.DrawCheckBox(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bmp.GetWidth(),bmp.GetHeight())),false,true,true,1.0);
        $impl.FUnCheckedFocusChk.Assign(bmp);
        $impl.FCheckedFocusChk = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
        $impl.FCheckedFocusChk.FOnChange = rtl.createCallback(this,"DoBitmapChanged");
        g.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        g.FFill.SetColor(16777215);
        g.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
        g.FStroke.SetColor(16777215);
        g.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bmp.GetWidth(),bmp.GetHeight())),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        g.DrawCheckBox(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bmp.GetWidth(),bmp.GetHeight())),true,true,true,1.0);
        $impl.FCheckedFocusChk.Assign(bmp);
        $impl.FUnCheckedDisabledChk = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
        $impl.FUnCheckedDisabledChk.FOnChange = rtl.createCallback(this,"DoBitmapChanged");
        g.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        g.FFill.SetColor(16777215);
        g.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
        g.FStroke.SetColor(16777215);
        g.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bmp.GetWidth(),bmp.GetHeight())),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        g.DrawCheckBox(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bmp.GetWidth(),bmp.GetHeight())),false,false,false,1.0);
        $impl.FUnCheckedDisabledChk.Assign(bmp);
        $impl.FCheckedDisabledChk = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
        $impl.FCheckedDisabledChk.FOnChange = rtl.createCallback(this,"DoBitmapChanged");
        g.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        g.FFill.SetColor(16777215);
        g.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
        g.FStroke.SetColor(16777215);
        g.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bmp.GetWidth(),bmp.GetHeight())),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        g.DrawCheckBox(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bmp.GetWidth(),bmp.GetHeight())),true,false,false,1.0);
        $impl.FCheckedDisabledChk.Assign(bmp);
      } finally {
        g = rtl.freeLoc(g);
        bmp = rtl.freeLoc(bmp);
      };
    };
    this.CreateRadioButtonBitmaps = function () {
      var g = null;
      var bmp = null;
      var sc = 0.0;
      sc = this.FResourceScaleFactor;
      if ($impl.FCheckedFocusRd != null) {
        rtl.free($impl,"FCheckedFocusRd");
        $impl.FCheckedFocusRd = null;
      };
      if ($impl.FUnCheckedRd != null) {
        rtl.free($impl,"FUnCheckedRd");
        $impl.FUnCheckedRd = null;
      };
      if ($impl.FCheckedRd != null) {
        rtl.free($impl,"FCheckedRd");
        $impl.FCheckedRd = null;
      };
      if ($impl.FUnCheckedFocusRd != null) {
        rtl.free($impl,"FUnCheckedFocusRd");
        $impl.FUnCheckedFocusRd = null;
      };
      if ($impl.FUnCheckedDisabledRd != null) {
        rtl.free($impl,"FUnCheckedDisabledRd");
        $impl.FUnCheckedDisabledRd = null;
      };
      if ($impl.FCheckedDisabledRd != null) {
        rtl.free($impl,"FCheckedDisabledRd");
        $impl.FCheckedDisabledRd = null;
      };
      bmp = pas["WEBLib.Graphics"].TBitmap.$create("Create$3");
      g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("Create$1",[bmp.GetCanvas(),false]);
      try {
        bmp.SetSize(Math.round(16 * sc),Math.round(16 * sc));
        $impl.FUnCheckedRd = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
        $impl.FUnCheckedRd.FOnChange = rtl.createCallback(this,"DoBitmapChanged");
        g.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        g.FFill.SetColor(16777215);
        g.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
        g.FStroke.SetColor(16777215);
        g.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bmp.GetWidth(),bmp.GetHeight())),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        g.DrawRadioButton(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bmp.GetWidth(),bmp.GetHeight())),false,false,true,1.0);
        $impl.FUnCheckedRd.Assign(bmp);
        $impl.FCheckedRd = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
        $impl.FCheckedRd.FOnChange = rtl.createCallback(this,"DoBitmapChanged");
        g.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        g.FFill.SetColor(16777215);
        g.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
        g.FStroke.SetColor(16777215);
        g.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bmp.GetWidth(),bmp.GetHeight())),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        g.DrawRadioButton(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bmp.GetWidth(),bmp.GetHeight())),true,false,true,1.0);
        $impl.FCheckedRd.Assign(bmp);
        $impl.FUnCheckedFocusRd = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
        $impl.FUnCheckedFocusRd.FOnChange = rtl.createCallback(this,"DoBitmapChanged");
        g.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        g.FFill.SetColor(16777215);
        g.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
        g.FStroke.SetColor(16777215);
        g.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bmp.GetWidth(),bmp.GetHeight())),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        g.DrawRadioButton(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bmp.GetWidth(),bmp.GetHeight())),false,true,true,1.0);
        $impl.FUnCheckedFocusRd.Assign(bmp);
        $impl.FCheckedFocusRd = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
        $impl.FCheckedFocusRd.FOnChange = rtl.createCallback(this,"DoBitmapChanged");
        g.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        g.FFill.SetColor(16777215);
        g.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
        g.FStroke.SetColor(16777215);
        g.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bmp.GetWidth(),bmp.GetHeight())),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        g.DrawRadioButton(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bmp.GetWidth(),bmp.GetHeight())),true,true,true,1.0);
        $impl.FCheckedFocusRd.Assign(bmp);
        $impl.FUnCheckedDisabledRd = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
        $impl.FUnCheckedDisabledRd.FOnChange = rtl.createCallback(this,"DoBitmapChanged");
        g.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        g.FFill.SetColor(16777215);
        g.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
        g.FStroke.SetColor(16777215);
        g.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bmp.GetWidth(),bmp.GetHeight())),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        g.DrawRadioButton(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bmp.GetWidth(),bmp.GetHeight())),false,false,false,1.0);
        $impl.FUnCheckedDisabledRd.Assign(bmp);
        $impl.FCheckedDisabledRd = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
        $impl.FCheckedDisabledRd.FOnChange = rtl.createCallback(this,"DoBitmapChanged");
        g.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        g.FFill.SetColor(16777215);
        g.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
        g.FStroke.SetColor(16777215);
        g.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bmp.GetWidth(),bmp.GetHeight())),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        g.DrawRadioButton(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bmp.GetWidth(),bmp.GetHeight())),true,false,false,1.0);
        $impl.FCheckedDisabledRd.Assign(bmp);
      } finally {
        g = rtl.freeLoc(g);
        bmp = rtl.freeLoc(bmp);
      };
    };
    this.CreateButtonBitmaps = function (AWidth, AHeight) {
      var g = null;
      var bmp = null;
      var sc = 0.0;
      sc = this.FResourceScaleFactor;
      if ($impl.FDownBtn != null) {
        rtl.free($impl,"FDownBtn");
        $impl.FDownBtn = null;
      };
      if ($impl.FNormalBtn != null) {
        rtl.free($impl,"FNormalBtn");
        $impl.FNormalBtn = null;
      };
      if ($impl.FDownFocusBtn != null) {
        rtl.free($impl,"FDownFocusBtn");
        $impl.FDownFocusBtn = null;
      };
      if ($impl.FNormalFocusBtn != null) {
        rtl.free($impl,"FNormalFocusBtn");
        $impl.FNormalFocusBtn = null;
      };
      if ($impl.FNormalDisabledBtn != null) {
        rtl.free($impl,"FNormalDisabledBtn");
        $impl.FNormalDisabledBtn = null;
      };
      bmp = pas["WEBLib.Graphics"].TBitmap.$create("Create$3");
      g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("Create$1",[bmp.GetCanvas(),false]);
      try {
        bmp.SetSize(Math.round(AWidth * sc),Math.round(AHeight * sc));
        $impl.FNormalBtn = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
        $impl.FNormalBtn.FOnChange = rtl.createCallback(this,"DoBitmapChanged");
        g.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        g.FFill.SetColor(16777215);
        g.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
        g.FStroke.SetColor(16777215);
        g.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bmp.GetWidth(),bmp.GetHeight())),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        g.DrawButton(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bmp.GetWidth(),bmp.GetHeight())),false,false,true,this.GetAdaptToStyle(),1.0);
        $impl.FNormalBtn.Assign(bmp);
        $impl.FDownBtn = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
        $impl.FDownBtn.FOnChange = rtl.createCallback(this,"DoBitmapChanged");
        g.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        g.FFill.SetColor(16777215);
        g.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
        g.FStroke.SetColor(16777215);
        g.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bmp.GetWidth(),bmp.GetHeight())),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        g.DrawButton(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bmp.GetWidth(),bmp.GetHeight())),true,false,true,this.GetAdaptToStyle(),1.0);
        $impl.FDownBtn.Assign(bmp);
        $impl.FNormalFocusBtn = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
        $impl.FNormalFocusBtn.FOnChange = rtl.createCallback(this,"DoBitmapChanged");
        g.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        g.FFill.SetColor(16777215);
        g.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
        g.FStroke.SetColor(16777215);
        g.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bmp.GetWidth(),bmp.GetHeight())),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        g.DrawButton(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bmp.GetWidth(),bmp.GetHeight())),true,true,true,this.GetAdaptToStyle(),1.0);
        $impl.FNormalFocusBtn.Assign(bmp);
        $impl.FDownFocusBtn = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
        $impl.FDownFocusBtn.FOnChange = rtl.createCallback(this,"DoBitmapChanged");
        g.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        g.FFill.SetColor(16777215);
        g.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
        g.FStroke.SetColor(16777215);
        g.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bmp.GetWidth(),bmp.GetHeight())),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        g.DrawButton(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bmp.GetWidth(),bmp.GetHeight())),false,true,true,this.GetAdaptToStyle(),1.0);
        $impl.FDownFocusBtn.Assign(bmp);
        $impl.FNormalDisabledBtn = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
        $impl.FNormalDisabledBtn.FOnChange = rtl.createCallback(this,"DoBitmapChanged");
        g.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        g.FFill.SetColor(16777215);
        g.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
        g.FStroke.SetColor(16777215);
        g.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bmp.GetWidth(),bmp.GetHeight())),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        g.DrawButton(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bmp.GetWidth(),bmp.GetHeight())),false,false,false,this.GetAdaptToStyle(),1.0);
        $impl.FNormalDisabledBtn.Assign(bmp);
      } finally {
        g = rtl.freeLoc(g);
        bmp = rtl.freeLoc(bmp);
      };
    };
    this.DoBeforeDraw = function (AGraphics, ARect, ADefaultDraw) {
      if (this.FOnBeforeDraw != null) this.FOnBeforeDraw(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),ADefaultDraw);
    };
    this.DoAfterDraw = function (AGraphics, ARect) {
      if (this.FOnAfterDraw != null) this.FOnAfterDraw(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect));
    };
    this.DoCanSaveProperty = function (AObject, APropertyName, APropertyType, ACanSave) {
      if (this.FOnCanSaveProperty != null) this.FOnCanSaveProperty(this,AObject,APropertyName,APropertyType,ACanSave);
    };
    this.DoCanLoadProperty = function (AObject, APropertyName, APropertyType, ACanLoad) {
      if (this.FOnCanLoadProperty != null) this.FOnCanLoadProperty(this,AObject,APropertyName,APropertyType,ACanLoad);
    };
    this.DrawBackground = function (AGraphics, ARect) {
      AGraphics.FFill.Assign(this.FFill);
      AGraphics.FFill.SetColor(this.FColor);
      AGraphics.FStroke.Assign(this.FStroke);
      AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
    };
    this.StrokeChanged = function (Sender) {
      this.Invalidate();
    };
    this.FillChanged = function (Sender) {
      if ((this.FFill.FKind !== pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone) && (this.FFill.FKind !== pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkTexture) && (this.FFill.FColor !== -1)) {
        this.SetColor(this.FFill.FColor)}
       else this.SetColor(-1);
      this.Invalidate();
    };
    this.Draw = function (AGraphics, ARect) {
    };
    this.DrawControl = function () {
      var g = null;
      var gbmp = null;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var df = false;
      var bmp = null;
      if (this.FBufferedPainting) {
        g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[this.GetWidth(),this.GetHeight(),this.FNativeCanvas,true]);
        g.BeginScene();
      } else g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("Create$1",[this.GetCanvas(),this.FNativeCanvas]);
      g.FOptimizedHTMLDrawing = this.FOptimizedHTMLDrawing;
      g.GetContext().SetSize(this.GetWidth(),this.GetHeight());
      g.GetContext().SetAntiAliasing(this.FAntiAliasing);
      g.GetContext().SetShowAcceleratorChar(this.FShowAcceleratorChar);
      g.GetContext().SetTextQuality(this.FTextQuality);
      try {
        r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,this.GetWidth(),this.GetHeight()));
        df = true;
        this.DoBeforeDraw(g,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),{get: function () {
            return df;
          }, set: function (v) {
            df = v;
          }});
        if (df) {
          this.DrawBackground(g,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r));
          this.Draw(g,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r));
          this.DoAfterDraw(g,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r));
        };
        if (this.FBufferedPainting) g.EndScene();
        g.GetContext().Render();
        if (this.FBufferedPainting) {
          bmp = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
          try {
            bmp.Assign(g.FBitmap);
            gbmp = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("Create$1",[this.GetCanvas(),false]);
            try {
              gbmp.GetContext().SetSize(this.GetWidth(),this.GetHeight());
              gbmp.GetContext().SetAntiAliasing(this.FAntiAliasing);
              gbmp.GetContext().SetShowAcceleratorChar(this.FShowAcceleratorChar);
              gbmp.GetContext().SetTextQuality(this.FTextQuality);
              gbmp.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),bmp,true,false,true,false);
            } finally {
              gbmp = rtl.freeLoc(gbmp);
            };
          } finally {
            bmp = rtl.freeLoc(bmp);
          };
        };
      } finally {
        g = rtl.freeLoc(g);
      };
    };
    this.DoBitmapChanged = function (Sender) {
      if (this.FBlockInvalidate) return;
      this.FBlockInvalidate = true;
      this.Invalidate();
      this.FBlockInvalidate = false;
    };
    this.CaptureEx = function () {
      this.Capture();
    };
    this.ReleaseCaptureEx = function () {
      this.ReleaseCapture();
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCCustomControl.isPrototypeOf(Source)) {
        this.FFill.Assign(rtl.as(Source,$mod.TTMSFNCCustomControl).FFill);
        this.FStroke.Assign(rtl.as(Source,$mod.TTMSFNCCustomControl).FStroke);
      } else pas["WEBLib.Controls"].TControl.Assign.apply(this,arguments);
    };
    this.Create$1 = function (AOwner) {
      $mod.TTMSFNCCustomControlBase.Create$1.apply(this,arguments);
      this.SetColor(16777215);
      this.FLinkTouchEvents = true;
      this.FAllowTouch = false;
      this.SetTabStop(true);
      this.FFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16777215,8421504,-1,-1]);
      this.FStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,12632256,1.0]);
      this.FFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      if (!this.IsDesignerForm()) this.RegisterRuntimeClasses();
      return this;
    };
    this.Destroy = function () {
      if (this.FUndoManager != null) {
        rtl.free(this,"FUndoManager");
        this.FUndoManager = null;
      };
      rtl.free(this,"FFill");
      rtl.free(this,"FStroke");
      $mod.TTMSFNCCustomControlBaseCommon.Destroy.call(this);
    };
    this.GetCheckBoxBitmap = function (AChecked, AFocused, AEnabled) {
      var Result = null;
      if (!($impl.FCheckedChk != null) || !($impl.FCheckedFocusChk != null) || !($impl.FUnCheckedChk != null) || !($impl.FUnCheckedFocusChk != null) || !($impl.FCheckedDisabledChk != null) || !($impl.FUnCheckedDisabledChk != null)) this.CreateCheckBoxBitmaps();
      if (AChecked) {
        if (AEnabled) {
          if (AFocused) {
            Result = $impl.FCheckedFocusChk}
           else Result = $impl.FCheckedChk;
        } else Result = $impl.FCheckedDisabledChk;
      } else {
        if (AEnabled) {
          if (AFocused) {
            Result = $impl.FUnCheckedFocusChk}
           else Result = $impl.FUnCheckedChk;
        } else Result = $impl.FUnCheckedDisabledChk;
      };
      return Result;
    };
    this.GetRadioButtonBitmap = function (AChecked, AFocused, AEnabled) {
      var Result = null;
      if (!($impl.FCheckedRd != null) || !($impl.FCheckedFocusRd != null) || !($impl.FUnCheckedRd != null) || !($impl.FUnCheckedFocusRd != null) || !($impl.FCheckedDisabledRd != null) || !($impl.FUnCheckedDisabledRd != null)) this.CreateRadioButtonBitmaps();
      if (AChecked) {
        if (AEnabled) {
          if (AFocused) {
            Result = $impl.FCheckedFocusRd}
           else Result = $impl.FCheckedRd;
        } else Result = $impl.FCheckedDisabledRd;
      } else {
        if (AEnabled) {
          if (AFocused) {
            Result = $impl.FUnCheckedFocusRd}
           else Result = $impl.FUnCheckedRd;
        } else Result = $impl.FUnCheckedDisabledRd;
      };
      return Result;
    };
    this.GetButtonBitmap = function (AWidth, AHeight, ADown, AFocused, AEnabled) {
      var Result = null;
      this.CreateButtonBitmaps(AWidth,AHeight);
      if (ADown) {
        if (AEnabled) {
          if (AFocused) {
            Result = $impl.FDownFocusBtn}
           else Result = $impl.FDownBtn;
        } else Result = $impl.FNormalDisabledBtn;
      } else {
        if (AEnabled) {
          if (AFocused) {
            Result = $impl.FNormalFocusBtn}
           else Result = $impl.FNormalBtn;
        } else Result = $impl.FNormalDisabledBtn;
      };
      return Result;
    };
    this.IsDesignTime = function () {
      var Result = false;
      Result = false;
      if (this.FOwner != null) Result = this.IsDesigning() && !((pas.Classes.TComponentStateItem.csReading in this.FOwner.FComponentState) || (pas.Classes.TComponentStateItem.csLoading in this.FOwner.FComponentState));
      return Result;
    };
    this.IsLoading = function () {
      var Result = false;
      Result = false;
      if (this.FOwner != null) Result = pas.Classes.TComponentStateItem.csLoading in this.FOwner.FComponentState;
      return Result;
    };
    this.IsReading = function () {
      var Result = false;
      Result = false;
      if (this.FOwner != null) Result = pas.Classes.TComponentStateItem.csReading in this.FOwner.FComponentState;
      return Result;
    };
    this.IsDesigning = function () {
      var Result = false;
      Result = (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) || (pas["WEBLib.Forms"].VSIDE != null);
      return Result;
    };
    this.IsDesignerForm = function () {
      var Result = false;
      var frm = null;
      frm = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetOwnerForm(this);
      Result = this.IsDesigning();
      if (frm != null) Result = Result || $mod.TTMSFNCCustomDesignerForm.isPrototypeOf(frm);
      return Result;
    };
    this.IsDestroying = function () {
      var Result = false;
      Result = pas.Classes.TComponentStateItem.csDestroying in this.FComponentState;
      return Result;
    };
    this.NotifyDataBinderEdit = function () {
      if (this.FManager != null) this.FManager.Notify(this,pas["WEBLib.TMSFNCDataBinding"].TTMSFNCDataBinderNotificationType.dbntEdit);
    };
    this.NotifyDataBinderValueChanged = function () {
      if (this.FManager != null) this.FManager.Notify(this,pas["WEBLib.TMSFNCDataBinding"].TTMSFNCDataBinderNotificationType.dbntValueChanged);
    };
    this.NotifyDataBinderPost = function () {
      if (this.FManager != null) this.FManager.Notify(this,pas["WEBLib.TMSFNCDataBinding"].TTMSFNCDataBinderNotificationType.dbntPost);
    };
    this.NotifyDataBinderUpdate = function () {
      if (this.FManager != null) this.FManager.Notify(this,pas["WEBLib.TMSFNCDataBinding"].TTMSFNCDataBinderNotificationType.dbntUpdate);
    };
    this.NotifyDataBinderSetActiveRecord = function () {
      if (this.FManager != null) this.FManager.Notify(this,pas["WEBLib.TMSFNCDataBinding"].TTMSFNCDataBinderNotificationType.dbntSetActiveRecord);
    };
    this.SaveSettingsToFile = function (AFileName, AAppearanceOnly) {
      this.FAppearancePersisting = AAppearanceOnly;
      pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.SaveSettingsToFile(this,AFileName);
      this.FAppearancePersisting = false;
    };
    this.LoadSettingsFromFile = function (AFileName) {
      this.BeginUpdate();
      pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.LoadSettingsFromFile(this,AFileName);
      this.EndUpdate();
      this.Invalidate();
    };
    this.SaveSettingsToStream = function (AStream, AAppearanceOnly) {
      this.FAppearancePersisting = AAppearanceOnly;
      pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.SaveSettingsToStream(this,AStream);
      this.FAppearancePersisting = false;
    };
    this.LoadSettingsFromStream = function (AStream) {
      this.BeginUpdate();
      pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.LoadSettingsFromStream(this,AStream);
      this.EndUpdate();
      this.Invalidate();
    };
    this.DisableBackground = function () {
      this.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
      this.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
      this.SetColor(-1);
    };
    this.EnableBackground = function () {
      this.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
    };
    this.DisableFill = function () {
      this.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
    };
    this.EnableFill = function () {
      this.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
    };
    this.DisableStroke = function () {
      this.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
    };
    this.EnableStroke = function () {
      this.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
    };
    this.Resize = function () {
      pas["WEBLib.Controls"].TCustomControl.Resize.call(this);
      this.UpdateControlAfterResize();
    };
    this.Paint = function () {
      pas["WEBLib.Controls"].TCustomControl.Paint.call(this);
      this.DrawControl();
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("AdaptToStyle",3,rtl.boolean,"GetAdaptToStyle","SetAdaptToStyle",4,{Default: false});
    $r.addProperty("AllowFocus",3,rtl.boolean,"GetAllowFocus","SetAllowFocus",4,{Default: true});
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("BiDiMode",2,pas["WEBLib.Controls"].$rtti["TBiDiMode"],"FBiDiMode","SetBiDiMode",4,{Default: pas["WEBLib.Controls"].TBiDiMode.bdLeftToRight});
    $r.addProperty("BorderStyle",2,pas["WEBLib.Controls"].$rtti["TBorderStyle"],"FBorderStyle","SetBorderStyle",4,{Default: pas["WEBLib.Controls"].TBorderStyle.bsSingle});
    $r.addProperty("Center",0,pas["WEBLib.Controls"].$rtti["TCenter"],"FCenter","");
    $r.addProperty("ChildOrder",2,rtl.longint,"FChildOrder","SetChildOrderEx",4,{Default: 0});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor");
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("DoubleBuffered",0,rtl.boolean,"FDoubleBuffered","FDoubleBuffered",4,{Default: false});
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Hint",2,rtl.string,"FHint","SetHint");
    $r.addProperty("Left",3,rtl.longint,"GetLeft","SetLeft");
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti["TPopupMenu"],"FPopupMenu","FPopupMenu");
    $r.addProperty("ParentDoubleBuffered",0,rtl.boolean,"FParentDoubleBuffered","FParentDoubleBuffered",4,{Default: true});
    $r.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",4,{Default: true});
    $r.addProperty("Role",3,rtl.string,"GetRole","SetRole");
    $r.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",4,{Default: true});
    $r.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",4,{Default: false});
    $r.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder");
    $r.addProperty("Top",3,rtl.longint,"GetTop","SetTop");
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnEnter","FOnEnter");
    $r.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnExit","FOnExit");
    $r.addProperty("OnKeyDown",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyDown","FOnKeyDown");
    $r.addProperty("OnKeyPress",0,pas["WEBLib.Controls"].$rtti["TKeyPressEvent"],"FOnKeyPress","FOnKeyPress");
    $r.addProperty("OnKeyUp",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyUp","FOnKeyUp");
    $r.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseDown","FOnMouseDown");
    $r.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseEnter","FOnMouseEnter");
    $r.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseLeave","FOnMouseLeave");
    $r.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti["TMouseMoveEvent"],"FOnMouseMove","FOnMouseMove");
    $r.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseUp","FOnMouseUp");
    $r.addProperty("OnMouseWheel",0,pas["WEBLib.Controls"].$rtti["TMouseWheelEvent"],"FOnMouseWheel","FOnMouseWheel");
    $r.addProperty("OnMouseWheelUp",0,pas["WEBLib.Controls"].$rtti["TMouseWheelUpDownEvent"],"FOnMouseWheelUp","FOnMouseWheelUp");
    $r.addProperty("OnMouseWheelDown",0,pas["WEBLib.Controls"].$rtti["TMouseWheelUpDownEvent"],"FOnMouseWheelDown","FOnMouseWheelDown");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnResize",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnResize","FOnResize");
    $r.addProperty("ShowAcceleratorChar",2,rtl.boolean,"FShowAcceleratorChar","SetShowAcceleratorChar",4,{Default: true});
    $r.addProperty("OnBeforeDraw",0,$mod.$rtti["TTMSFNCCustomControlBeforeDrawEvent"],"FOnBeforeDraw","FOnBeforeDraw");
    $r.addProperty("OnAfterDraw",0,$mod.$rtti["TTMSFNCCustomControlAfterDrawEvent"],"FOnAfterDraw","FOnAfterDraw");
    $r.addProperty("OnCanSaveProperty",0,$mod.$rtti["TTMSFNCCustomControlCanSavePropertyEvent"],"FOnCanSaveProperty","FOnCanSaveProperty");
    $r.addProperty("OnCanLoadProperty",0,$mod.$rtti["TTMSFNCCustomControlCanLoadPropertyEvent"],"FOnCanLoadProperty","FOnCanLoadProperty");
  });
  this.$rtti.$ClassRef("TTMSFNCCustomControlClass",{instancetype: this.$rtti["TTMSFNCCustomControl"]});
  rtl.createClass(this,"TTMSFNCControl",this.TTMSFNCCustomControl,function () {
    this.RegisterRuntimeClasses = function () {
      $mod.TTMSFNCCustomControl.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClass($mod.TTMSFNCControl);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.IsSourceDropFiles = function (ASource) {
    var Result = false;
    Result = $mod.TTMSFNCCustomControlDropFiles.isPrototypeOf(ASource);
    return Result;
  };
  this.AsSourceDropFiles = function (ASource) {
    var Result = null;
    Result = rtl.as(ASource,$mod.TTMSFNCCustomControlDropFiles);
    return Result;
  };
  $mod.$implcode = function () {
    $impl.FCheckedChk = null;
    $impl.FUnCheckedChk = null;
    $impl.FCheckedFocusChk = null;
    $impl.FUnCheckedFocusChk = null;
    $impl.FCheckedDisabledChk = null;
    $impl.FUnCheckedDisabledChk = null;
    $impl.FCheckedRd = null;
    $impl.FUnCheckedRd = null;
    $impl.FCheckedFocusRd = null;
    $impl.FUnCheckedFocusRd = null;
    $impl.FCheckedDisabledRd = null;
    $impl.FUnCheckedDisabledRd = null;
    $impl.FDownBtn = null;
    $impl.FNormalBtn = null;
    $impl.FDownFocusBtn = null;
    $impl.FNormalFocusBtn = null;
    $impl.FNormalDisabledBtn = null;
  };
},["WEBLib.TMSFNCUtils","SysUtils","WEBLib.StdCtrls"]);
rtl.module("WEBLib.TMSFNCDataGridCore",["System","Classes","Types","Generics.Collections","WEBLib.TMSFNCTypes","WEBLib.TMSFNCUndo","WEBLib.TMSFNCCustomControl","WEBLib.TMSFNCPersistence","SysUtils"],function () {
  "use strict";
  var $mod = this;
  this.TTMSFNCDataGridRowType = {"0": "grtDefault", grtDefault: 0, "1": "grtSummary", grtSummary: 1, "2": "grtNode", grtNode: 2, "3": "grtFilter", grtFilter: 3};
  this.$rtti.$Enum("TTMSFNCDataGridRowType",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TTMSFNCDataGridRowType});
  this.$rtti.$Set("TTMSFNCDataGridRowTypes",{comptype: this.$rtti["TTMSFNCDataGridRowType"]});
  this.TTMSFNCDataGridRowNodeState = {"0": "grnsCollapsed", grnsCollapsed: 0, "1": "grnsExpanded", grnsExpanded: 1};
  this.$rtti.$Enum("TTMSFNCDataGridRowNodeState",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCDataGridRowNodeState});
  rtl.createClass(this,"TTMSFNCDataGridIntegerDictionary",pas["Generics.Collections"].TDictionary$$$G$$generics$collections$$Longint$$Longint,function () {
  });
  rtl.createClass(this,"TTMSFNCDataGridBooleanDictionary",pas["Generics.Collections"].TDictionary$$$G$$generics$collections$$Longint$$Boolean,function () {
  });
  rtl.createClass(this,"TTMSFNCDataGridDoubleDictionary",pas["Generics.Collections"].TDictionary$$$G$$generics$collections$$Longint$$Double,function () {
  });
  this.TTMSFNCDataGridLogMessageType = {"0": "glmInfo", glmInfo: 0, "1": "glmWarning", glmWarning: 1, "2": "glmError", glmError: 2};
  this.$rtti.$Enum("TTMSFNCDataGridLogMessageType",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCDataGridLogMessageType});
  this.$rtti.$MethodVar("TTMSFNCDataGridLogMessageEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AMessage",rtl.string],["AMessageType",this.$rtti["TTMSFNCDataGridLogMessageType"]]]), methodkind: 0});
  this.TTMSFNCDataGridRowViewMode = {"0": "grvmTotalRows", grvmTotalRows: 0, "1": "grvmControl", grvmControl: 1};
  this.$rtti.$Enum("TTMSFNCDataGridRowViewMode",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCDataGridRowViewMode});
  this.TTMSFNCDataGridColumnViewMode = {"0": "gcvmTotalColumns", gcvmTotalColumns: 0, "1": "gcvmControl", gcvmControl: 1};
  this.$rtti.$Enum("TTMSFNCDataGridColumnViewMode",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCDataGridColumnViewMode});
  rtl.recNewT(this,"TTMSFNCDataGridCellCoord",function () {
    this.FColumn = 0;
    this.FRow = 0;
    this.$eq = function (b) {
      return (this.FColumn === b.FColumn) && (this.FRow === b.FRow);
    };
    this.$assign = function (s) {
      this.FColumn = s.FColumn;
      this.FRow = s.FRow;
      return this;
    };
    this.GetRow = function () {
      var Result = 0;
      Result = this.FRow;
      return Result;
    };
    this.GetColumn = function () {
      var Result = 0;
      Result = this.FColumn;
      return Result;
    };
    this.SetRow = function (Value) {
      this.FRow = Value;
    };
    this.SetColumn = function (Value) {
      this.FColumn = Value;
    };
    this.GetToString = function () {
      var Result = "";
      Result = pas.SysUtils.IntToStr(this.GetColumn()) + ":" + pas.SysUtils.IntToStr(this.GetRow());
      return Result;
    };
    this.IsEqualTo = function (ACell) {
      var Result = false;
      Result = (this.GetColumn() === ACell.GetColumn()) && (this.GetRow() === ACell.GetRow());
      return Result;
    };
    this.FromString = function (AValue) {
      var Result = $mod.TTMSFNCDataGridCellCoord.$new();
      var p = 0;
      var cs = "";
      var rs = "";
      var c = 0;
      var r = 0;
      Result.$assign($mod.MakeCell(-1,-1));
      p = pas.System.Pos(":",AValue);
      if (p > 0) {
        cs = pas.System.Copy(AValue,1,p - 1);
        cs = pas.SysUtils.Trim(cs);
        rs = pas.System.Copy(AValue,p + 1,AValue.length - p);
        rs = pas.SysUtils.Trim(rs);
        if (pas.SysUtils.TryStrToInt(cs,{get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }}) && pas.SysUtils.TryStrToInt(rs,{get: function () {
            return r;
          }, set: function (v) {
            r = v;
          }})) {
          Result.$assign($mod.MakeCell(c,r));
        };
      };
      return Result;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCDataGridCellCoord",{},this);
    $r.addMethod("IsEqualTo",1,[["ACell",$r]],2,rtl.boolean);
    $r.addProperty("Column",3,rtl.longint,"GetColumn","SetColumn",2);
    $r.addProperty("Row",3,rtl.longint,"GetRow","SetRow",2);
    $r.addProperty("ToString",1,rtl.string,"GetToString","",2);
    $r.addMethod("FromString",5,[["AValue",rtl.string]],2,$r,1);
  });
  rtl.recNewT(this,"TTMSFNCDataGridCellCoordRange",function () {
    this.$new = function () {
      var r = Object.create(this);
      r.StartCell = $mod.TTMSFNCDataGridCellCoord.$new();
      r.StopCell = $mod.TTMSFNCDataGridCellCoord.$new();
      return r;
    };
    this.$eq = function (b) {
      return this.StartCell.$eq(b.StartCell) && this.StopCell.$eq(b.StopCell);
    };
    this.$assign = function (s) {
      this.StartCell.$assign(s.StartCell);
      this.StopCell.$assign(s.StopCell);
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCDataGridCellCoordRange",{},this);
    $r.addField("StartCell",$mod.$rtti["TTMSFNCDataGridCellCoord"]);
    $r.addField("StopCell",$mod.$rtti["TTMSFNCDataGridCellCoord"]);
  });
  this.TTMSFNCDataGridSortDirection = {"0": "gsdNone", gsdNone: 0, "1": "gsdAscending", gsdAscending: 1, "2": "gsdDescending", gsdDescending: 2};
  this.$rtti.$Enum("TTMSFNCDataGridSortDirection",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCDataGridSortDirection});
  this.TTMSFNCDataGridSortFormat = {"0": "gsfAutomatic", gsfAutomatic: 0, "1": "gsfAlphabetic", gsfAlphabetic: 1, "2": "gsfNumeric", gsfNumeric: 2, "3": "gsfDateTime", gsfDateTime: 3, "4": "gsfBoolean", gsfBoolean: 4, "5": "gsfCustom", gsfCustom: 5};
  this.$rtti.$Enum("TTMSFNCDataGridSortFormat",{minvalue: 0, maxvalue: 5, ordtype: 1, enumtype: this.TTMSFNCDataGridSortFormat});
  this.TTMSFNCDataGridExportState = {"0": "gesExportStart", gesExportStart: 0, "1": "gesExportNewRow", gesExportNewRow: 1, "2": "gesExportDone", gesExportDone: 2, "3": "gesExportSelectedRow", gesExportSelectedRow: 3, "4": "gesExportFail", gesExportFail: 4, "5": "gesExportNextRow", gesExportNextRow: 5, "6": "gesExportFindRow", gesExportFindRow: 6};
  this.$rtti.$Enum("TTMSFNCDataGridExportState",{minvalue: 0, maxvalue: 6, ordtype: 1, enumtype: this.TTMSFNCDataGridExportState});
  this.TTMSFNCDataGridImportState = {"0": "gisImportStart", gisImportStart: 0, "1": "gisImportNewRow", gisImportNewRow: 1, "2": "gisImportDone", gisImportDone: 2, "3": "gisImportSelectedRow", gisImportSelectedRow: 3};
  this.$rtti.$Enum("TTMSFNCDataGridImportState",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TTMSFNCDataGridImportState});
  this.TTMSFNCDataGridStretchingMode = {"0": "gstmIndex", gstmIndex: 0, "1": "gstmAll", gstmAll: 1, "2": "gstmProportional", gstmProportional: 2};
  this.$rtti.$Enum("TTMSFNCDataGridStretchingMode",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCDataGridStretchingMode});
  this.TTMSFNCDataGridStretchingRange = {"0": "gstrNormal", gstrNormal: 0, "1": "gstrAll", gstrAll: 1};
  this.$rtti.$Enum("TTMSFNCDataGridStretchingRange",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCDataGridStretchingRange});
  this.$rtti.$RefToProcVar("TTMSFNCDataGridLoopRowsCallback",{procsig: rtl.newTIProcSig([["ARow",rtl.longint]])});
  this.$rtti.$RefToProcVar("TTMSFNCDataGridLoopColumnsCallback",{procsig: rtl.newTIProcSig([["AColumn",rtl.longint]])});
  rtl.createClass(this,"TTMSFNCDataGridCore",pas.Classes.TInterfacedPersistent,function () {
    this.FBlockPersistenceInterface = false;
    this.$init = function () {
      pas.Classes.TInterfacedPersistent.$init.call(this);
      this.FUndoManager = null;
      this.FAppearancePersisting = false;
      this.FColumnCount = 0;
      this.FColumnOrderDictionary = null;
      this.FRowOrderDictionary = null;
      this.FColumnReverseOrderDictionary = null;
      this.FRowReverseOrderDictionary = null;
      this.FColumnWidthDictionary = null;
      this.FRowHeightDictionary = null;
      this.FColumnPositionDictionary = null;
      this.FRowPositionDictionary = null;
      this.FDefaultColumnWidth = 0.0;
      this.FDefaultRowHeight = 0.0;
      this.FExportRectSet = false;
      this.FFilteredRowDictionary = null;
      this.FFixedBottomRowCount = 0;
      this.FFixedRightColumnCount = 0;
      this.FFixedRowCount = 0;
      this.FFixedColumnCount = 0;
      this.FFreezeRowCount = 0;
      this.FFreezeColumnCount = 0;
      this.FHiddenColumnDictionary = null;
      this.FHiddenRowDictionary = null;
      this.FIsExporting = false;
      this.FLocalRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FExportRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FSaveLocalRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FMergedColumnDictionary = null;
      this.FMergedRowDictionary = null;
      this.FName = "";
      this.FOnCanLoadProperty = null;
      this.FOnCanSaveProperty = null;
      this.FOnLogMessage = null;
      this.FOnNotifyEditor = null;
      this.FRowCount = 0;
      this.FStartColumn = 0;
      this.FStopColumn = 0;
      this.FStartRow = 0;
      this.FStopRow = 0;
      this.FTotalColumnWidth = 0.0;
      this.FTotalFixedBottomRowHeight = 0.0;
      this.FTotalFixedColumnWidth = 0.0;
      this.FTotalFixedRightColumnWidth = 0.0;
      this.FTotalFixedRowHeight = 0.0;
      this.FTotalRowHeight = 0.0;
      this.FUpdateCount = 0;
      this.FRowViewMode = 0;
      this.FColumnViewMode = 0;
      this.FTotalRowOffset = 0.0;
      this.FTotalColumnOffset = 0.0;
      this.FBlockWidthChange = false;
      this.FBlockVisibilityChange = false;
      this.FCumulativeRowHeights = [];
      this.FCumulativeColumnWidths = [];
    };
    this.$final = function () {
      this.FUndoManager = undefined;
      this.FColumnOrderDictionary = undefined;
      this.FRowOrderDictionary = undefined;
      this.FColumnReverseOrderDictionary = undefined;
      this.FRowReverseOrderDictionary = undefined;
      this.FColumnWidthDictionary = undefined;
      this.FRowHeightDictionary = undefined;
      this.FColumnPositionDictionary = undefined;
      this.FRowPositionDictionary = undefined;
      this.FFilteredRowDictionary = undefined;
      this.FHiddenColumnDictionary = undefined;
      this.FHiddenRowDictionary = undefined;
      this.FLocalRect = undefined;
      this.FExportRect = undefined;
      this.FSaveLocalRect = undefined;
      this.FMergedColumnDictionary = undefined;
      this.FMergedRowDictionary = undefined;
      this.FOnCanLoadProperty = undefined;
      this.FOnCanSaveProperty = undefined;
      this.FOnLogMessage = undefined;
      this.FOnNotifyEditor = undefined;
      this.FCumulativeRowHeights = undefined;
      this.FCumulativeColumnWidths = undefined;
      pas.Classes.TInterfacedPersistent.$final.call(this);
    };
    this.GetColumnOrder = function (AColumn) {
      var Result = 0;
      if (this.GetColumnOrderDictionary().ContainsKey(AColumn)) {
        Result = this.GetColumnOrderDictionary().GetItem(AColumn)}
       else {
        this.SetColumnOrder(AColumn,AColumn);
        Result = AColumn;
      };
      return Result;
    };
    this.GetColumnOrderDictionary = function () {
      var Result = null;
      if (!(this.FColumnOrderDictionary != null)) this.FColumnOrderDictionary = $mod.TTMSFNCDataGridIntegerDictionary.$create("Create$1",[0]);
      Result = this.FColumnOrderDictionary;
      return Result;
    };
    this.GetColumnPosition = function (AColumn) {
      var Result = 0.0;
      var I = 0;
      if (this.GetColumnPositionDictionary().ContainsKey(AColumn)) {
        Result = this.GetColumnPositionDictionary().GetItem(AColumn)}
       else {
        Result = 0;
        if (AColumn > rtl.trunc(this.FColumnCount / 2)) {
          for (var $l = this.FColumnCount - 1, $end = AColumn; $l >= $end; $l--) {
            I = $l;
            Result = Result + this.GetColumnWidth(I);
          };
          Result = this.FTotalColumnWidth - Result;
        } else {
          for (var $l1 = 0, $end1 = AColumn - 1; $l1 <= $end1; $l1++) {
            I = $l1;
            Result = Result + this.GetColumnWidth(I);
          };
        };
        this.SetColumnPosition(AColumn,Result);
      };
      return Result;
    };
    this.GetColumnPositionDictionary = function () {
      var Result = null;
      if (!(this.FColumnPositionDictionary != null)) this.FColumnPositionDictionary = $mod.TTMSFNCDataGridDoubleDictionary.$create("Create$1",[0]);
      Result = this.FColumnPositionDictionary;
      return Result;
    };
    this.GetColumnReverseOrder = function (AColumn) {
      var Result = 0;
      if (this.GetColumnReverseOrderDictionary().ContainsKey(AColumn)) {
        Result = this.GetColumnReverseOrderDictionary().GetItem(AColumn)}
       else Result = AColumn;
      return Result;
    };
    this.GetColumnReverseOrderDictionary = function () {
      var Result = null;
      if (!(this.FColumnReverseOrderDictionary != null)) this.FColumnReverseOrderDictionary = $mod.TTMSFNCDataGridIntegerDictionary.$create("Create$1",[0]);
      Result = this.FColumnReverseOrderDictionary;
      return Result;
    };
    this.GetColumnWidth = function (AColumn) {
      var Result = 0.0;
      if (this.GetColumnWidthDictionary().ContainsKey(AColumn)) {
        Result = this.GetColumnWidthDictionary().GetItem(AColumn)}
       else Result = this.FDefaultColumnWidth;
      if (this.IsColumnHidden(AColumn)) Result = 0;
      return Result;
    };
    this.GetColumnWidthDIP = function (AColumn) {
      var Result = 0.0;
      Result = this.UnscaleValue(this.GetColumnWidth(AColumn));
      return Result;
    };
    this.GetColumnWidthDictionary = function () {
      var Result = null;
      if (!(this.FColumnWidthDictionary != null)) this.FColumnWidthDictionary = $mod.TTMSFNCDataGridDoubleDictionary.$create("Create$1",[0]);
      Result = this.FColumnWidthDictionary;
      return Result;
    };
    this.GetFilteredRow = function (ARow) {
      var Result = false;
      if (this.GetFilteredRowDictionary().ContainsKey(ARow)) {
        Result = this.GetFilteredRowDictionary().GetItem(ARow)}
       else Result = false;
      return Result;
    };
    this.GetFilteredRowDictionary = function () {
      var Result = null;
      if (!(this.FFilteredRowDictionary != null)) this.FFilteredRowDictionary = $mod.TTMSFNCDataGridBooleanDictionary.$create("Create$1",[0]);
      Result = this.FFilteredRowDictionary;
      return Result;
    };
    this.GetHasRowOrder = function (ARow) {
      var Result = false;
      Result = this.GetRowOrderDictionary().ContainsKey(ARow);
      return Result;
    };
    this.GetHeight = function () {
      var Result = 0.0;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.$assign(this.FLocalRect);
      Result = r.Bottom - r.Top;
      return Result;
    };
    this.GetHiddenColumn = function (AColumn) {
      var Result = false;
      if (this.GetHiddenColumnDictionary().ContainsKey(AColumn)) {
        Result = this.GetHiddenColumnDictionary().GetItem(AColumn)}
       else Result = false;
      return Result;
    };
    this.GetHiddenColumnDictionary = function () {
      var Result = null;
      if (!(this.FHiddenColumnDictionary != null)) this.FHiddenColumnDictionary = $mod.TTMSFNCDataGridBooleanDictionary.$create("Create$1",[0]);
      Result = this.FHiddenColumnDictionary;
      return Result;
    };
    this.GetHiddenColumnWidth = function (AColumn) {
      var Result = 0.0;
      if (this.GetColumnWidthDictionary().ContainsKey(AColumn)) {
        Result = this.GetColumnWidthDictionary().GetItem(AColumn)}
       else Result = this.FDefaultColumnWidth;
      return Result;
    };
    this.GetHiddenRow = function (ARow) {
      var Result = false;
      if (this.GetHiddenRowDictionary().ContainsKey(ARow)) {
        Result = this.GetHiddenRowDictionary().GetItem(ARow)}
       else Result = false;
      return Result;
    };
    this.GetHiddenRowDictionary = function () {
      var Result = null;
      if (!(this.FHiddenRowDictionary != null)) this.FHiddenRowDictionary = $mod.TTMSFNCDataGridBooleanDictionary.$create("Create$1",[0]);
      Result = this.FHiddenRowDictionary;
      return Result;
    };
    this.GetHiddenRowHeight = function (ARow) {
      var Result = 0.0;
      if (this.GetRowHeightDictionary().ContainsKey(ARow)) {
        Result = this.GetRowHeightDictionary().GetItem(ARow)}
       else Result = this.FDefaultRowHeight;
      return Result;
    };
    this.GetMergedColumn = function (AColumn) {
      var Result = false;
      if (this.GetMergedColumnDictionary().ContainsKey(AColumn)) {
        Result = this.GetMergedColumnDictionary().GetItem(AColumn)}
       else Result = false;
      return Result;
    };
    this.GetMergedColumnDictionary = function () {
      var Result = null;
      if (!(this.FMergedColumnDictionary != null)) this.FMergedColumnDictionary = $mod.TTMSFNCDataGridBooleanDictionary.$create("Create$1",[0]);
      Result = this.FMergedColumnDictionary;
      return Result;
    };
    this.GetMergedRow = function (ARow) {
      var Result = false;
      if (this.GetMergedRowDictionary().ContainsKey(ARow)) {
        Result = this.GetMergedRowDictionary().GetItem(ARow)}
       else Result = false;
      return Result;
    };
    this.GetMergedRowDictionary = function () {
      var Result = null;
      if (!(this.FMergedRowDictionary != null)) this.FMergedRowDictionary = $mod.TTMSFNCDataGridBooleanDictionary.$create("Create$1",[0]);
      Result = this.FMergedRowDictionary;
      return Result;
    };
    this.GetRowHeight = function (ARow) {
      var Result = 0.0;
      if (this.GetRowHeightDictionary().ContainsKey(ARow)) {
        Result = this.GetRowHeightDictionary().GetItem(ARow)}
       else Result = this.FDefaultRowHeight;
      if (this.IsRowHidden(ARow)) Result = 0;
      return Result;
    };
    this.GetRowHeightDIP = function (ARow) {
      var Result = 0.0;
      Result = this.UnscaleValue(this.GetRowHeight(ARow));
      return Result;
    };
    this.GetRowHeightDictionary = function () {
      var Result = null;
      if (!(this.FRowHeightDictionary != null)) this.FRowHeightDictionary = $mod.TTMSFNCDataGridDoubleDictionary.$create("Create$1",[0]);
      Result = this.FRowHeightDictionary;
      return Result;
    };
    this.GetRowOrder = function (ARow) {
      var Result = 0;
      if (this.GetRowOrderDictionary().ContainsKey(ARow)) {
        Result = this.GetRowOrderDictionary().GetItem(ARow)}
       else {
        this.SetRowOrder(ARow,ARow);
        Result = ARow;
      };
      return Result;
    };
    this.GetRowOrderDictionary = function () {
      var Result = null;
      if (!(this.FRowOrderDictionary != null)) this.FRowOrderDictionary = $mod.TTMSFNCDataGridIntegerDictionary.$create("Create$1",[0]);
      Result = this.FRowOrderDictionary;
      return Result;
    };
    this.GetRowPosition = function (ARow) {
      var Result = 0.0;
      var I = 0;
      if (this.GetRowPositionDictionary().ContainsKey(ARow)) {
        Result = this.GetRowPositionDictionary().GetItem(ARow)}
       else {
        Result = 0;
        if (ARow > rtl.trunc(this.FRowCount / 2)) {
          for (var $l = this.FRowCount - 1, $end = ARow; $l >= $end; $l--) {
            I = $l;
            Result = Result + this.GetRowHeight(I);
          };
          Result = this.FTotalRowHeight - Result;
        } else {
          for (var $l1 = 0, $end1 = ARow - 1; $l1 <= $end1; $l1++) {
            I = $l1;
            Result = Result + this.GetRowHeight(I);
          };
        };
        this.SetRowPosition(ARow,Result);
      };
      return Result;
    };
    this.GetRowPositionDictionary = function () {
      var Result = null;
      if (!(this.FRowPositionDictionary != null)) this.FRowPositionDictionary = $mod.TTMSFNCDataGridDoubleDictionary.$create("Create$1",[0]);
      Result = this.FRowPositionDictionary;
      return Result;
    };
    this.GetRowReverseOrder = function (ARow) {
      var Result = 0;
      if (this.GetRowReverseOrderDictionary().ContainsKey(ARow)) {
        Result = this.GetRowReverseOrderDictionary().GetItem(ARow)}
       else Result = ARow;
      return Result;
    };
    this.GetRowReverseOrderDictionary = function () {
      var Result = null;
      if (!(this.FRowReverseOrderDictionary != null)) this.FRowReverseOrderDictionary = $mod.TTMSFNCDataGridIntegerDictionary.$create("Create$1",[0]);
      Result = this.FRowReverseOrderDictionary;
      return Result;
    };
    this.GetWidth = function () {
      var Result = 0.0;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.$assign(this.FLocalRect);
      Result = r.Right - r.Left;
      return Result;
    };
    this.IsDefaultColumnWidthStored = function () {
      var Result = false;
      Result = this.FDefaultColumnWidth !== 75;
      return Result;
    };
    this.IsDefaultRowHeightStored = function () {
      var Result = false;
      Result = this.FDefaultRowHeight !== 30;
      return Result;
    };
    this.SetColumnCount = function (Value) {
      if (this.FColumnCount !== Value) {
        this.FColumnCount = Value;
        this.SynchronizeColumns(false);
        this.DoUpdate();
      };
    };
    this.SetColumnPosition = function (AColumn, Value) {
      if (!this.IsColumnValid(AColumn)) return;
      if (this.GetColumnPositionDictionary().ContainsKey(AColumn)) {
        if (Value === -1) {
          this.GetColumnPositionDictionary().Remove(AColumn)}
         else this.GetColumnPositionDictionary().SetItem(AColumn,Math.max(0,Value));
      } else if (Value !== -1) this.GetColumnPositionDictionary().Add(AColumn,Math.max(0,Value));
    };
    this.SetColumnWidth = function (AColumn, Value) {
      if (!this.IsColumnValid(AColumn)) return;
      if (this.GetColumnWidthDictionary().ContainsKey(AColumn)) {
        if (Value === this.FDefaultColumnWidth) {
          this.GetColumnWidthDictionary().Remove(AColumn)}
         else this.GetColumnWidthDictionary().SetItem(AColumn,Math.max(0,Value));
      } else if (Value !== this.FDefaultColumnWidth) this.GetColumnWidthDictionary().Add(AColumn,Math.max(0,Value));
      if (!this.FBlockWidthChange) this.WidthChanged(AColumn);
      this.DoUpdate();
    };
    this.SetColumnWidthDIP = function (AColumn, Value) {
      this.SetColumnWidth(AColumn,this.ScaleValue(Value));
    };
    this.SetDefaultColumnWidth = function (Value) {
      if (this.FDefaultColumnWidth !== Value) {
        this.FDefaultColumnWidth = Value;
        this.DoUpdate();
      };
    };
    this.SetDefaultRowHeight = function (Value) {
      if (this.FDefaultRowHeight !== Value) {
        this.FDefaultRowHeight = Value;
        this.DoUpdate();
      };
    };
    this.SetFilteredRow = function (ARow, Value) {
      if (!this.IsRowValid(ARow)) return;
      if (this.GetFilteredRowDictionary().ContainsKey(ARow)) {
        if (Value === false) {
          this.GetFilteredRowDictionary().Remove(ARow)}
         else this.GetFilteredRowDictionary().SetItem(ARow,Value);
      } else if (Value !== false) this.GetFilteredRowDictionary().Add(ARow,Value);
    };
    this.SetFixedBottomRowCount = function (Value) {
      if (this.FFixedBottomRowCount !== Value) {
        this.FFixedBottomRowCount = Value;
        this.DoUpdate();
      };
    };
    this.SetFixedColumnCount = function (Value) {
      if (this.FFixedColumnCount !== Value) {
        this.FFixedColumnCount = Value;
        this.UpdateFixedColumnCount();
        this.DoUpdate();
      };
    };
    this.SetFixedRightColumnCount = function (Value) {
      if (this.FFixedRightColumnCount !== Value) {
        this.FFixedRightColumnCount = Value;
        this.DoUpdate();
      };
    };
    this.SetFixedRowCount = function (Value) {
      if (this.FFixedRowCount !== Value) {
        this.FFixedRowCount = Value;
        this.DoUpdate();
      };
    };
    this.SetFreezeColumnCount = function (Value) {
      if (this.FFreezeColumnCount !== Value) {
        this.FFreezeColumnCount = Value;
        this.DoUpdate();
      };
    };
    this.SetFreezeRowCount = function (Value) {
      if (this.FFreezeRowCount !== Value) {
        this.FFreezeRowCount = Value;
        this.DoUpdate();
      };
    };
    this.SetHeight = function (Value) {
      this.FLocalRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.FLocalRect.Left,this.FLocalRect.Top,this.FLocalRect.Right,this.FLocalRect.Top + Value));
    };
    this.SetHiddenColumn = function (AColumn, Value) {
      if (!this.IsColumnValid(AColumn)) return;
      if (this.GetHiddenColumnDictionary().ContainsKey(AColumn)) {
        if (Value === false) {
          this.GetHiddenColumnDictionary().Remove(AColumn)}
         else this.GetHiddenColumnDictionary().SetItem(AColumn,Value);
      } else if (Value !== false) this.GetHiddenColumnDictionary().Add(AColumn,Value);
      if (!this.FBlockVisibilityChange) this.VisibilityChanged(AColumn);
      this.DoUpdate();
    };
    this.SetHiddenRow = function (ARow, Value) {
      if (!this.IsRowValid(ARow)) return;
      if (this.GetHiddenRowDictionary().ContainsKey(ARow)) {
        if (Value === false) {
          this.GetHiddenRowDictionary().Remove(ARow)}
         else this.GetHiddenRowDictionary().SetItem(ARow,Value);
      } else if (Value !== false) this.GetHiddenRowDictionary().Add(ARow,Value);
      this.DoUpdate();
    };
    this.SetMergedColumn = function (AColumn, Value) {
      if (!this.IsColumnValid(AColumn)) return;
      if (this.GetMergedColumnDictionary().ContainsKey(AColumn)) {
        if (Value === false) {
          this.GetMergedColumnDictionary().Remove(AColumn)}
         else this.GetMergedColumnDictionary().SetItem(AColumn,Value);
      } else if (Value !== false) this.GetMergedColumnDictionary().Add(AColumn,Value);
    };
    this.SetMergedRow = function (ARow, Value) {
      if (!this.IsRowValid(ARow)) return;
      if (this.GetMergedRowDictionary().ContainsKey(ARow)) {
        if (Value === false) {
          this.GetMergedRowDictionary().Remove(ARow)}
         else this.GetMergedRowDictionary().SetItem(ARow,Value);
      } else if (Value !== false) this.GetMergedRowDictionary().Add(ARow,Value);
    };
    this.SetRowCount = function (Value) {
      if (this.FRowCount !== Value) {
        this.FRowCount = Value;
        this.DoUpdate();
      };
    };
    this.SetRowHeight = function (ARow, Value) {
      if (!this.IsRowValid(ARow)) return;
      if (this.GetRowHeightDictionary().ContainsKey(ARow)) {
        if (Value === this.FDefaultRowHeight) {
          this.GetRowHeightDictionary().Remove(ARow)}
         else this.GetRowHeightDictionary().SetItem(ARow,Math.max(0,Value));
      } else if (Value !== this.FDefaultRowHeight) this.GetRowHeightDictionary().Add(ARow,Math.max(0,Value));
      this.DoUpdate();
    };
    this.SetRowHeightDIP = function (ARow, Value) {
      this.SetRowHeight(ARow,this.ScaleValue(Value));
    };
    this.SetRowPosition = function (ARow, Value) {
      if (!this.IsRowValid(ARow)) return;
      if (this.GetRowPositionDictionary().ContainsKey(ARow)) {
        if (Value === -1) {
          this.GetRowPositionDictionary().Remove(ARow)}
         else this.GetRowPositionDictionary().SetItem(ARow,Math.max(0,Value));
      } else if (Value !== -1) this.GetRowPositionDictionary().Add(ARow,Math.max(0,Value));
    };
    this.SetWidth = function (Value) {
      this.FLocalRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.FLocalRect.Left,this.FLocalRect.Top,this.FLocalRect.Left + Value,this.FLocalRect.Bottom));
    };
    this.SetRowViewMode = function (Value) {
      if (this.FRowViewMode !== Value) {
        this.FRowViewMode = Value;
        this.DoUpdate();
      };
    };
    this.SetColumnViewMode = function (Value) {
      if (this.FColumnViewMode !== Value) {
        this.FColumnViewMode = Value;
        this.DoUpdate();
      };
    };
    this.GetUndoManager = function () {
      var Result = null;
      if (!(this.FUndoManager != null)) this.FUndoManager = pas["WEBLib.TMSFNCUndo"].TTMSFNCUndoManager.$create("Create$2",[this]);
      Result = this.FUndoManager;
      return Result;
    };
    this.CanRegisterRuntimeClasses = function () {
      var Result = false;
      Result = true;
      return Result;
    };
    this.FormatArray = function (AArray) {
      var Result = "";
      var I = 0;
      var sl = null;
      Result = "";
      sl = pas.Classes.TStringList.$create("Create$1");
      try {
        sl.SetLineBreak("");
        for (var $l = 0, $end = rtl.length(AArray) - 1; $l <= $end; $l++) {
          I = $l;
          sl.Add(pas.SysUtils.TIntegerHelper.ToString$1.call({a: I, p: AArray, get: function () {
              return this.p[this.a];
            }, set: function (v) {
              this.p[this.a] = v;
            }}));
        };
        Result = sl.GetDelimitedText();
      } finally {
        sl = rtl.freeLoc(sl);
      };
      return Result;
    };
    this.FormatNumberRange = function (AStartNumber, ACount) {
      var Result = "";
      var I = 0;
      var sl = null;
      Result = "";
      sl = pas.Classes.TStringList.$create("Create$1");
      try {
        sl.SetLineBreak("");
        for (var $l = AStartNumber, $end = (AStartNumber + ACount) - 1; $l <= $end; $l++) {
          I = $l;
          sl.Add(pas.SysUtils.TIntegerHelper.ToString$1.call({get: function () {
              return I;
            }, set: function (v) {
              I = v;
            }}));
        };
        Result = sl.GetDelimitedText();
      } finally {
        sl = rtl.freeLoc(sl);
      };
      return Result;
    };
    this.GetContentClipRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(this.GetContentRect());
      if (this.FRowViewMode === $mod.TTMSFNCDataGridRowViewMode.grvmTotalRows) Result.Bottom = Result.Top + Math.min(this.FTotalRowHeight,Result.Bottom - Result.Top);
      if (this.FColumnViewMode === $mod.TTMSFNCDataGridColumnViewMode.gcvmTotalColumns) Result.Right = Result.Left + Math.min(this.FTotalColumnWidth,Result.Right - Result.Left);
      return Result;
    };
    this.GetContentRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(this.LocalRect());
      return Result;
    };
    this.GetFilteredRowCount = function () {
      var Result = 0;
      var k = 0;
      Result = 0;
      var $in = this.GetFilteredRowDictionary().GetKeys().GetEnumerator$1();
      try {
        while ($in.MoveNext$1()) {
          k = $in.GetCurrent();
          if (this.IsRowValid(k)) Result += 1;
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      Result = this.FRowCount - Result;
      return Result;
    };
    this.GetHiddenColumnCount = function () {
      var Result = 0;
      var k = 0;
      Result = 0;
      var $in = this.GetHiddenColumnDictionary().GetKeys().GetEnumerator$1();
      try {
        while ($in.MoveNext$1()) {
          k = $in.GetCurrent();
          if (this.IsColumnValid(k)) Result += 1;
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return Result;
    };
    this.GetHiddenRowCount = function () {
      var Result = 0;
      var k = 0;
      Result = 0;
      var $in = this.GetHiddenRowDictionary().GetKeys().GetEnumerator$1();
      try {
        while ($in.MoveNext$1()) {
          k = $in.GetCurrent();
          if (this.IsRowValid(k) && !this.IsRowFilteredDisplay(k)) Result += 1;
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      var $in1 = this.GetFilteredRowDictionary().GetKeys().GetEnumerator$1();
      try {
        while ($in1.MoveNext$1()) {
          k = $in1.GetCurrent();
          if (this.IsRowValid(k) && this.IsRowFilteredDisplay(k)) Result += 1;
        }
      } finally {
        $in1 = rtl.freeLoc($in1)
      };
      return Result;
    };
    this.GetHorizontalScrollPosition = function () {
      var Result = 0.0;
      Result = 0;
      return Result;
    };
    this.GetStartColumn = function () {
      var Result = 0;
      Result = this.FStartColumn;
      return Result;
    };
    this.GetStartRow = function () {
      var Result = 0;
      Result = this.FStartRow;
      return Result;
    };
    this.GetStopColumn = function () {
      var Result = 0;
      Result = this.FStopColumn;
      return Result;
    };
    this.GetStopRow = function () {
      var Result = 0;
      Result = this.FStopRow;
      return Result;
    };
    this.GetTotalColumnWidth = function () {
      var Result = 0.0;
      Result = this.FTotalColumnWidth;
      return Result;
    };
    this.GetTotalRowHeight = function () {
      var Result = 0.0;
      Result = this.FTotalRowHeight;
      return Result;
    };
    this.GetUpdateCount = function () {
      var Result = 0;
      Result = this.FUpdateCount;
      return Result;
    };
    this.GetVerticalScrollPosition = function () {
      var Result = 0.0;
      Result = 0;
      return Result;
    };
    this.GetVisibleColumnCount = function () {
      var Result = 0;
      Result = (this.GetStopColumn() - this.GetStartColumn()) + this.FFixedRightColumnCount + this.FFixedColumnCount + this.FFreezeColumnCount + 1;
      return Result;
    };
    this.GetVisibleRowCount = function () {
      var Result = 0;
      Result = (this.GetStopRow() - this.GetStartRow()) + this.FFixedBottomRowCount + this.FFixedRowCount + this.FFreezeRowCount + 1;
      return Result;
    };
    this.IsRowFilteredDisplay = function (ARow) {
      var Result = false;
      Result = this.IsRowFiltered(ARow);
      return Result;
    };
    this.IsBlocked = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    this.LocalRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (this.FIsExporting && this.FExportRectSet) {
        Result.$assign(this.FExportRect)}
       else Result.$assign(this.FLocalRect);
      if (pas["WEBLib.TMSFNCTypes"].RectIsEmpty(Result) && (this.FName !== "Root")) Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,this.FTotalColumnWidth,this.FTotalRowHeight));
      return Result;
    };
    this.OnlyLastFullVisibleColumn = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    this.OnlyLastFullVisibleRow = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    this.DecUpdateCount = function () {
      this.FUpdateCount -= 1;
    };
    this.DoCanLoadProperty = function (AObject, APropertyName, APropertyType, ACanLoad) {
      if (this.FOnCanLoadProperty != null) this.FOnCanLoadProperty(this,AObject,APropertyName,APropertyType,ACanLoad);
    };
    this.DoCanSaveProperty = function (AObject, APropertyName, APropertyType, ACanSave) {
      if (this.FOnCanSaveProperty != null) this.FOnCanSaveProperty(this,AObject,APropertyName,APropertyType,ACanSave);
    };
    this.DoUpdate = function () {
      this.InvalidateCumulativeCache();
      this.Update();
    };
    this.IncUpdateCount = function () {
      this.FUpdateCount += 1;
    };
    this.InternalClear = function () {
      this.GetColumnReverseOrderDictionary().Clear();
      this.GetRowReverseOrderDictionary().Clear();
      this.GetColumnOrderDictionary().Clear();
      this.GetRowOrderDictionary().Clear();
      this.GetMergedColumnDictionary().Clear();
      this.GetMergedRowDictionary().Clear();
      this.GetFilteredRowDictionary().Clear();
      this.GetColumnWidthDictionary().Clear();
      this.GetRowHeightDictionary().Clear();
      this.GetRowPositionDictionary().Clear();
      this.GetColumnPositionDictionary().Clear();
      this.GetHiddenColumnDictionary().Clear();
      this.GetHiddenRowDictionary().Clear();
    };
    this.RegisterRuntimeClasses = function () {
    };
    this.SetColumnOrder = function (AColumn, Value) {
      this.GetColumnOrderDictionary().AddOrSetValue(AColumn,Value);
      this.GetColumnReverseOrderDictionary().AddOrSetValue(Value,AColumn);
    };
    this.SetRowOrder = function (ARow, Value) {
      this.GetRowOrderDictionary().AddOrSetValue(ARow,Value);
      this.GetRowReverseOrderDictionary().AddOrSetValue(Value,ARow);
    };
    this.SynchronizeColumns = function (ACollectionUpdate) {
      this.DoNotifyEditor();
    };
    this.UpdateFixedColumnCount = function () {
    };
    this.InvalidateCumulativeCache = function () {
      this.FCumulativeRowHeights = rtl.arraySetLength(this.FCumulativeRowHeights,0.0,0);
      this.FCumulativeColumnWidths = rtl.arraySetLength(this.FCumulativeColumnWidths,0.0,0);
    };
    this.UpdateCumulativeCache = function () {
      var i = 0;
      var accum = 0.0;
      if (rtl.length(this.FCumulativeRowHeights) === 0) {
        this.FCumulativeRowHeights = rtl.arraySetLength(this.FCumulativeRowHeights,0.0,this.FRowCount);
        accum = 0;
        for (var $l = 0, $end = this.FRowCount - 1; $l <= $end; $l++) {
          i = $l;
          this.FCumulativeRowHeights[i] = accum;
          accum = accum + this.GetRowHeight(i);
        };
      };
      if (rtl.length(this.FCumulativeColumnWidths) === 0) {
        this.FCumulativeColumnWidths = rtl.arraySetLength(this.FCumulativeColumnWidths,0.0,this.FColumnCount);
        accum = 0;
        for (var $l1 = 0, $end1 = this.FColumnCount - 1; $l1 <= $end1; $l1++) {
          i = $l1;
          this.FCumulativeColumnWidths[i] = accum;
          accum = accum + this.GetColumnWidth(i);
        };
      };
    };
    this.WidthChanged = function (AColumn) {
    };
    this.VisibilityChanged = function (AColumn) {
    };
    this.Create$1 = function (AHost) {
      this.FRowViewMode = $mod.TTMSFNCDataGridRowViewMode.grvmTotalRows;
      this.FColumnViewMode = $mod.TTMSFNCDataGridColumnViewMode.gcvmTotalColumns;
      this.FFreezeRowCount = 0;
      this.FFreezeColumnCount = 0;
      this.FFixedRowCount = 1;
      this.FFixedColumnCount = 0;
      this.FFixedBottomRowCount = 0;
      this.FFixedRightColumnCount = 0;
      this.FDefaultRowHeight = 30;
      this.FDefaultColumnWidth = 75;
      this.FColumnCount = 4;
      this.FRowCount = 24;
      if (this.CanRegisterRuntimeClasses()) this.RegisterRuntimeClasses();
      return this;
    };
    this.Destroy = function () {
      this.FOnNotifyEditor = null;
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FRowReverseOrderDictionary;
        }, set: function (v) {
          this.p.FRowReverseOrderDictionary = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FColumnReverseOrderDictionary;
        }, set: function (v) {
          this.p.FColumnReverseOrderDictionary = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FRowOrderDictionary;
        }, set: function (v) {
          this.p.FRowOrderDictionary = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FColumnOrderDictionary;
        }, set: function (v) {
          this.p.FColumnOrderDictionary = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FMergedColumnDictionary;
        }, set: function (v) {
          this.p.FMergedColumnDictionary = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FMergedRowDictionary;
        }, set: function (v) {
          this.p.FMergedRowDictionary = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FFilteredRowDictionary;
        }, set: function (v) {
          this.p.FFilteredRowDictionary = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FHiddenColumnDictionary;
        }, set: function (v) {
          this.p.FHiddenColumnDictionary = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FHiddenRowDictionary;
        }, set: function (v) {
          this.p.FHiddenRowDictionary = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FColumnPositionDictionary;
        }, set: function (v) {
          this.p.FColumnPositionDictionary = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FRowPositionDictionary;
        }, set: function (v) {
          this.p.FRowPositionDictionary = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FColumnWidthDictionary;
        }, set: function (v) {
          this.p.FColumnWidthDictionary = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FRowHeightDictionary;
        }, set: function (v) {
          this.p.FRowHeightDictionary = v;
        }});
      if (this.FUndoManager != null) {
        rtl.free(this,"FUndoManager");
        this.FUndoManager = null;
      };
      pas.System.TObject.Destroy.call(this);
    };
    this.CanLoadProperty = function (AObject, APropertyName, APropertyType) {
      var Result = false;
      if ((AObject === this) && !this.FBlockPersistenceInterface) {
        Result = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.IndexOfTextInArray(APropertyName,pas["WEBLib.TMSFNCPersistence"].ExcludePropertyList) === -1}
       else Result = true;
      this.DoCanLoadProperty(AObject,APropertyName,APropertyType,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.CanSaveProperty = function (AObject, APropertyName, APropertyType) {
      var Result = false;
      if ((AObject === this) && !this.FBlockPersistenceInterface) {
        Result = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.IndexOfTextInArray(APropertyName,pas["WEBLib.TMSFNCPersistence"].ExcludePropertyList) === -1}
       else Result = true;
      if (this.FAppearancePersisting) Result = Result && this.IsAppearanceProperty(AObject,APropertyName,APropertyType);
      this.DoCanSaveProperty(AObject,APropertyName,APropertyType,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.DisplayToRealCell = function (ACell) {
      var Result = $mod.TTMSFNCDataGridCellCoord.$new();
      Result.$assign($mod.MakeCell(this.GetColumnReverseOrder(ACell.GetColumn()),this.GetRowReverseOrder(ACell.GetRow())));
      return Result;
    };
    this.DisplayToRealColumn = function (AColumn) {
      var Result = 0;
      Result = this.GetColumnReverseOrder(AColumn);
      return Result;
    };
    this.DisplayToRealRow = function (ARow) {
      var Result = 0;
      Result = this.GetRowReverseOrder(ARow);
      return Result;
    };
    this.GetIsDestroying = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    this.GetIsLoading = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    this.GetLocalRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(this.FLocalRect);
      return Result;
    };
    this.GetTotalFixedBottomRowHeight = function () {
      var Result = 0.0;
      var I = 0;
      Result = 0;
      for (var $l = this.FRowCount - 1, $end = this.FRowCount - this.FFixedBottomRowCount; $l >= $end; $l--) {
        I = $l;
        Result = Result + this.GetRowHeight(I);
      };
      return Result;
    };
    this.GetTotalFixedColumnWidth = function (AIncludeFreeze) {
      var Result = 0.0;
      var I = 0;
      var c = 0;
      Result = 0;
      if (AIncludeFreeze) {
        c = (this.FFixedColumnCount + this.FFreezeColumnCount) - 1}
       else c = this.FFixedColumnCount - 1;
      for (var $l = 0, $end = c; $l <= $end; $l++) {
        I = $l;
        Result = Result + this.GetColumnWidth(I);
      };
      return Result;
    };
    this.GetTotalFixedRightColumnWidth = function () {
      var Result = 0.0;
      var I = 0;
      Result = 0;
      for (var $l = this.FColumnCount - 1, $end = this.FColumnCount - this.FFixedRightColumnCount; $l >= $end; $l--) {
        I = $l;
        Result = Result + this.GetColumnWidth(I);
      };
      return Result;
    };
    this.GetTotalFixedRowHeight = function (AIncludeFreeze) {
      var Result = 0.0;
      var I = 0;
      var r = 0;
      Result = 0;
      if (AIncludeFreeze) {
        r = (this.FFixedRowCount + this.FFreezeRowCount) - 1}
       else r = this.FFixedRowCount - 1;
      for (var $l = 0, $end = r; $l <= $end; $l++) {
        I = $l;
        Result = Result + this.GetRowHeight(I);
      };
      return Result;
    };
    this.IsAppearanceProperty = function (AObject, APropertyName, APropertyType) {
      var Result = false;
      var Prop = null;
      var pName = "";
      var cn = "";
      Result = false;
      Prop = pas.TypInfo.GetPropInfo$2(AObject,APropertyName);
      if (Prop != null) {
        pName = pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.GetPropInfoName(Prop);
        cn = pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.GetPropInfoTypeName(Prop);
        Result = (cn === "TAlphaColor") || (cn === "TColor") || (cn === "TGraphicsColor") || (cn === "TTMSFNCGraphicsFill") || (cn === "TTMSFNCGraphicsStroke") || (pas.System.Pos("Appearance",pName) > 0);
        Result = Result || (APropertyName === "Fill") || (APropertyName === "Stroke") || (APropertyName === "Font");
      };
      return Result;
    };
    this.IsCellDisabled = function (ACell) {
      var Result = false;
      Result = this.IsCellFixed($mod.TTMSFNCDataGridCellCoord.$clone(ACell)) || !this.IsCellDisplayed($mod.TTMSFNCDataGridCellCoord.$clone(ACell));
      return Result;
    };
    this.IsCellFixed = function (ACell) {
      var Result = false;
      Result = false;
      if (this.IsCellValid($mod.TTMSFNCDataGridCellCoord.$clone(ACell))) {
        Result = (ACell.GetRow() < this.FFixedRowCount) || (ACell.GetRow() > (this.FRowCount - 1 - this.FFixedBottomRowCount)) || (ACell.GetColumn() < this.FFixedColumnCount) || (ACell.GetColumn() > (this.FColumnCount - 1 - this.FFixedRightColumnCount));
      };
      return Result;
    };
    this.IsCellFixedColumn = function (ACell) {
      var Result = false;
      Result = false;
      if (this.IsCellValid($mod.TTMSFNCDataGridCellCoord.$clone(ACell))) Result = (ACell.GetColumn() < this.FFixedColumnCount) || (ACell.GetColumn() > (this.FColumnCount - 1 - this.FFixedRightColumnCount));
      return Result;
    };
    this.IsCellFixedRoot = function (ACell) {
      var Result = false;
      Result = false;
      if (this.IsCellValid($mod.TTMSFNCDataGridCellCoord.$clone(ACell))) {
        Result = ((ACell.GetColumn() < this.FFixedColumnCount) && ((ACell.GetRow() < this.FFixedRowCount) || (ACell.GetRow() > (this.FRowCount - 1 - this.FFixedBottomRowCount)))) || ((ACell.GetColumn() > (this.FColumnCount - 1 - this.FFixedRightColumnCount)) && ((ACell.GetRow() < this.FFixedRowCount) || (ACell.GetRow() > (this.FRowCount - 1 - this.FFixedBottomRowCount))));
      };
      return Result;
    };
    this.IsCellFixedRow = function (ACell) {
      var Result = false;
      Result = false;
      if (this.IsCellValid($mod.TTMSFNCDataGridCellCoord.$clone(ACell))) Result = (ACell.GetRow() < this.FFixedRowCount) || (ACell.GetRow() > (this.FRowCount - 1 - this.FFixedBottomRowCount));
      return Result;
    };
    this.IsCellFreezeRow = function (ACell) {
      var Result = false;
      Result = false;
      if (this.IsCellValid($mod.TTMSFNCDataGridCellCoord.$clone(ACell))) Result = (ACell.GetRow() >= this.FFixedRowCount) && (ACell.GetRow() < (this.FFixedRowCount + this.FFreezeRowCount));
      return Result;
    };
    this.IsCellFreezeColumn = function (ACell) {
      var Result = false;
      Result = false;
      if (this.IsCellValid($mod.TTMSFNCDataGridCellCoord.$clone(ACell))) Result = (ACell.GetColumn() >= this.FFixedColumnCount) && (ACell.GetColumn() < (this.FFixedColumnCount + this.FFreezeColumnCount));
      return Result;
    };
    this.IsCellFreeze = function (ACell) {
      var Result = false;
      Result = false;
      if (this.IsCellValid($mod.TTMSFNCDataGridCellCoord.$clone(ACell))) {
        if ((ACell.GetColumn() >= this.FFixedColumnCount) && (ACell.GetColumn() < (this.FFixedColumnCount + this.FFreezeColumnCount))) {
          Result = ACell.GetRow() >= this.FFixedRowCount}
         else if ((ACell.GetRow() >= this.FFixedRowCount) && (ACell.GetRow() < (this.FFixedRowCount + this.FFreezeRowCount))) Result = ACell.GetColumn() >= this.FFixedColumnCount;
      };
      return Result;
    };
    this.IsCellFreezeFixed = function (ACell) {
      var Result = false;
      Result = false;
      if (this.IsCellValid($mod.TTMSFNCDataGridCellCoord.$clone(ACell))) {
        if ((ACell.GetColumn() < this.FFixedColumnCount) || (ACell.GetColumn() > (this.FColumnCount - 1 - this.FFixedRightColumnCount))) {
          Result = (ACell.GetRow() >= this.FFixedRowCount) && (ACell.GetRow() < (this.FFixedRowCount + this.FFreezeRowCount))}
         else if ((ACell.GetRow() < this.FFixedRowCount) || (ACell.GetRow() > (this.FRowCount - 1 - this.FFixedBottomRowCount))) Result = (ACell.GetColumn() >= this.FFixedColumnCount) && (ACell.GetColumn() < (this.FFixedColumnCount + this.FFreezeColumnCount));
      };
      return Result;
    };
    this.IsCellFreezeRoot = function (ACell) {
      var Result = false;
      Result = false;
      if (this.IsCellValid($mod.TTMSFNCDataGridCellCoord.$clone(ACell))) {
        Result = (ACell.GetColumn() >= this.FFixedColumnCount) && (ACell.GetColumn() < (this.FFixedColumnCount + this.FFreezeColumnCount));
        Result = Result && (ACell.GetRow() >= this.FFixedRowCount) && (ACell.GetRow() < (this.FFixedRowCount + this.FFreezeRowCount));
      };
      return Result;
    };
    this.IsCellValid = function (ACell) {
      var Result = false;
      Result = this.IsCellValid$1(ACell.GetColumn(),ACell.GetRow());
      return Result;
    };
    this.IsCellValid$1 = function (AColumn, ARow) {
      var Result = false;
      Result = (AColumn >= 0) && (AColumn <= (this.FColumnCount - 1)) && (ARow >= 0) && (ARow <= (this.FRowCount - 1));
      return Result;
    };
    this.IsCellVisible = function (ACell) {
      var Result = false;
      Result = this.IsRowVisible(ACell.GetRow()) && this.IsColumnVisible(ACell.GetColumn());
      return Result;
    };
    this.IsColumnFixed = function (AColumn) {
      var Result = false;
      Result = false;
      if (this.IsColumnValid(AColumn)) Result = (AColumn < this.FFixedColumnCount) || (AColumn > (this.FColumnCount - 1 - this.FFixedRightColumnCount));
      return Result;
    };
    this.IsColumnFreeze = function (AColumn) {
      var Result = false;
      Result = false;
      if (this.IsColumnValid(AColumn)) Result = (AColumn >= this.FFixedColumnCount) && (AColumn < (this.FFixedColumnCount + this.FFreezeColumnCount));
      return Result;
    };
    this.IsColumnHidden = function (AColumn) {
      var Result = false;
      Result = this.GetHiddenColumn(AColumn);
      return Result;
    };
    this.IsColumnMerged = function (AColumn) {
      var Result = false;
      Result = this.GetMergedColumn(AColumn);
      return Result;
    };
    this.IsColumnValid = function (AColumn) {
      var Result = false;
      Result = (AColumn >= 0) && (AColumn <= (this.FColumnCount - 1));
      return Result;
    };
    this.IsColumnVisible = function (AColumn) {
      var Result = false;
      if (this.IsColumnFixed(AColumn) || this.IsColumnFreeze(AColumn)) {
        Result = true}
       else Result = (AColumn >= this.GetStartColumn()) && (AColumn <= this.GetStopColumn());
      Result = Result && this.IsColumnDisplayed(AColumn);
      return Result;
    };
    this.IsRowFiltered = function (ARow) {
      var Result = false;
      Result = this.GetFilteredRow(ARow);
      return Result;
    };
    this.IsRowFixed = function (ARow) {
      var Result = false;
      Result = false;
      if (this.IsRowValid(ARow)) Result = (ARow < this.FFixedRowCount) || (ARow > (this.FRowCount - 1 - this.FFixedBottomRowCount));
      return Result;
    };
    this.IsRowFreeze = function (ARow) {
      var Result = false;
      Result = false;
      if (this.IsRowValid(ARow)) Result = (ARow >= this.FFixedRowCount) && (ARow < (this.FFixedRowCount + this.FFreezeRowCount));
      return Result;
    };
    this.IsRowHidden = function (ARow) {
      var Result = false;
      Result = this.GetHiddenRow(ARow) || this.IsRowFilteredDisplay(ARow);
      return Result;
    };
    this.IsRowMerged = function (ARow) {
      var Result = false;
      Result = this.GetMergedRow(ARow);
      return Result;
    };
    this.IsRowValid = function (ARow) {
      var Result = false;
      Result = (ARow >= 0) && (ARow <= (this.FRowCount - 1));
      return Result;
    };
    this.IsRowVisible = function (ARow) {
      var Result = false;
      if (this.IsRowFixed(ARow) || this.IsRowFreeze(ARow)) {
        Result = true}
       else Result = (ARow >= this.GetStartRow()) && (ARow <= this.GetStopRow());
      Result = Result && this.IsRowDisplayed(ARow);
      return Result;
    };
    this.RealToDisplayCell = function (ACell) {
      var Result = $mod.TTMSFNCDataGridCellCoord.$new();
      Result.$assign($mod.MakeCell(this.GetColumnOrder(ACell.GetColumn()),this.GetRowOrder(ACell.GetRow())));
      return Result;
    };
    this.RealToDisplayColumn = function (AColumn) {
      var Result = 0;
      Result = this.GetColumnOrder(AColumn);
      return Result;
    };
    this.RealToDisplayRow = function (ARow) {
      var Result = 0;
      Result = this.GetRowOrder(ARow);
      return Result;
    };
    this.StretchColumns = function (AMode, ARange, AIndex, ANewWidth) {
      var Result = false;
      var tw = 0.0;
      var i = 0;
      var cw = 0.0;
      var t = 0.0;
      var vc = 0;
      var stc = 0;
      var sec = 0;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var totalOriginal = 0.0;
      Result = false;
      this.BeginUpdate();
      try {
        if (ANewWidth > -1) {
          tw = ANewWidth}
         else {
          r.$assign(this.GetContentRect());
          tw = r.Right - r.Left;
          if (tw < 0) return Result;
        };
        if (ARange === $mod.TTMSFNCDataGridStretchingRange.gstrAll) {
          stc = 0;
          sec = this.FColumnCount - 1;
        } else {
          stc = this.FFixedColumnCount;
          sec = this.FColumnCount - 1 - this.FFixedRightColumnCount;
        };
        if ((AMode === $mod.TTMSFNCDataGridStretchingMode.gstmIndex) && (AIndex === -1)) {
          AIndex = sec;
          while (this.IsColumnHidden(AIndex) && (AIndex > stc)) AIndex -= 1;
        };
        for (var $l = 0, $end = stc - 1; $l <= $end; $l++) {
          i = $l;
          tw = tw - this.GetColumnWidth(i);
        };
        for (var $l1 = this.FColumnCount - 1, $end1 = sec + 1; $l1 >= $end1; $l1--) {
          i = $l1;
          tw = tw - this.GetColumnWidth(i);
        };
        vc = 0;
        totalOriginal = 0;
        for (var $l2 = stc, $end2 = sec; $l2 <= $end2; $l2++) {
          i = $l2;
          if (!this.IsColumnHidden(i)) {
            vc += 1;
            if (AMode === $mod.TTMSFNCDataGridStretchingMode.gstmProportional) totalOriginal = totalOriginal + this.GetColumnWidth(i);
            if ((i !== AIndex) && (AIndex !== -1) && (AMode === $mod.TTMSFNCDataGridStretchingMode.gstmIndex)) tw = tw - this.GetColumnWidth(i);
          };
        };
        if (vc <= 0) return Result;
        if (AMode === $mod.TTMSFNCDataGridStretchingMode.gstmProportional) {
          if (totalOriginal <= 0) return Result;
          for (var $l3 = stc, $end3 = sec; $l3 <= $end3; $l3++) {
            i = $l3;
            if (!this.IsColumnHidden(i)) this.SetColumnWidth(i,(this.GetColumnWidth(i) / totalOriginal) * tw);
          };
          Result = true;
          return Result;
        };
        if (AMode === $mod.TTMSFNCDataGridStretchingMode.gstmAll) {
          if (vc > 0) {
            cw = tw / vc;
            t = 0;
            for (var $l4 = stc, $end4 = sec; $l4 <= $end4; $l4++) {
              i = $l4;
              if (!this.IsColumnHidden(i)) {
                if (i === sec) {
                  this.SetColumnWidth(i,pas.System.Int(tw - t))}
                 else this.SetColumnWidth(i,pas.System.Int(cw));
                t = t + pas.System.Int(cw);
              };
            };
            Result = true;
          };
        } else {
          if ((AIndex >= 0) && (AIndex < this.FColumnCount) && !this.IsColumnHidden(AIndex)) {
            cw = tw;
            if (cw > 0) {
              this.SetColumnWidth(AIndex,cw)}
             else this.SetColumnWidth(AIndex,this.FDefaultColumnWidth);
            Result = cw > 0;
          };
        };
      } finally {
        this.EndUpdate();
      };
      return Result;
    };
    this.StretchRows = function (AMode, ARange, AIndex, ANewHeight) {
      var Result = false;
      var th = 0.0;
      var t = 0.0;
      var i = 0;
      var rh = 0.0;
      var vr = 0;
      var str = 0;
      var ser = 0;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var totalOriginal = 0.0;
      Result = false;
      this.BeginUpdate();
      try {
        if (ANewHeight > -1) {
          th = ANewHeight}
         else {
          r.$assign(this.GetContentRect());
          th = r.Bottom - r.Top;
          if (th < 0) return Result;
        };
        if (ARange === $mod.TTMSFNCDataGridStretchingRange.gstrAll) {
          str = 0;
          ser = this.FRowCount - 1;
        } else {
          str = this.FFixedRowCount;
          ser = this.FRowCount - 1 - this.FFixedBottomRowCount;
        };
        if ((AMode === $mod.TTMSFNCDataGridStretchingMode.gstmIndex) && (AIndex === -1)) {
          AIndex = ser;
          while (this.IsRowHidden(AIndex) && (AIndex > str)) AIndex -= 1;
        };
        for (var $l = 0, $end = str - 1; $l <= $end; $l++) {
          i = $l;
          th = th - this.GetRowHeight(i);
        };
        for (var $l1 = this.FRowCount - 1, $end1 = ser + 1; $l1 >= $end1; $l1--) {
          i = $l1;
          th = th - this.GetRowHeight(i);
        };
        vr = 0;
        totalOriginal = 0;
        for (var $l2 = str, $end2 = ser; $l2 <= $end2; $l2++) {
          i = $l2;
          if (!this.IsRowHidden(i)) {
            vr += 1;
            if (AMode === $mod.TTMSFNCDataGridStretchingMode.gstmProportional) totalOriginal = totalOriginal + this.GetRowHeight(i);
            if ((i !== AIndex) && (AIndex !== -1) && (AMode === $mod.TTMSFNCDataGridStretchingMode.gstmIndex)) th = th - this.GetRowHeight(i);
          };
        };
        if (vr <= 0) return Result;
        if (AMode === $mod.TTMSFNCDataGridStretchingMode.gstmProportional) {
          if (totalOriginal <= 0) return Result;
          for (var $l3 = str, $end3 = ser; $l3 <= $end3; $l3++) {
            i = $l3;
            if (!this.IsRowHidden(i)) this.SetRowHeight(i,(this.GetRowHeight(i) / totalOriginal) * th);
          };
          Result = true;
          return Result;
        };
        if (AMode === $mod.TTMSFNCDataGridStretchingMode.gstmAll) {
          if (vr > 0) {
            rh = th / vr;
            t = 0;
            for (var $l4 = str, $end4 = ser; $l4 <= $end4; $l4++) {
              i = $l4;
              if (!this.IsRowHidden(i)) {
                if (i === ser) {
                  this.SetRowHeight(i,pas.System.Int(th - t))}
                 else this.SetRowHeight(i,pas.System.Int(rh));
                t = t + pas.System.Int(rh);
              };
            };
            Result = true;
          };
          return Result;
        };
        if (AMode === $mod.TTMSFNCDataGridStretchingMode.gstmIndex) {
          if ((AIndex >= 0) && (AIndex < this.FRowCount) && !this.IsRowHidden(AIndex)) {
            rh = th;
            if (rh > 0) {
              this.SetRowHeight(AIndex,rh)}
             else this.SetRowHeight(AIndex,this.FDefaultRowHeight);
            Result = rh > 0;
          };
          return Result;
        };
      } finally {
        this.EndUpdate();
      };
      return Result;
    };
    this.AfterExport = function () {
      this.FIsExporting = false;
      this.FLocalRect.$assign(this.FSaveLocalRect);
      this.FExportRectSet = false;
      this.Update();
    };
    this.Assign = function (Source) {
      this.BeginUpdate();
      try {
        if ($mod.TTMSFNCDataGridCore.isPrototypeOf(Source)) {
          this.FRowViewMode = rtl.as(Source,$mod.TTMSFNCDataGridCore).FRowViewMode;
          this.FColumnViewMode = rtl.as(Source,$mod.TTMSFNCDataGridCore).FColumnViewMode;
          this.FColumnCount = rtl.as(Source,$mod.TTMSFNCDataGridCore).FColumnCount;
          pas.SysUtils.FreeAndNil({p: this, get: function () {
              return this.p.FColumnOrderDictionary;
            }, set: function (v) {
              this.p.FColumnOrderDictionary = v;
            }});
          this.FColumnOrderDictionary = $mod.TTMSFNCDataGridIntegerDictionary.$create("Create$2",[rtl.as(Source,$mod.TTMSFNCDataGridCore).GetColumnOrderDictionary()]);
          pas.SysUtils.FreeAndNil({p: this, get: function () {
              return this.p.FColumnPositionDictionary;
            }, set: function (v) {
              this.p.FColumnPositionDictionary = v;
            }});
          this.FColumnPositionDictionary = $mod.TTMSFNCDataGridDoubleDictionary.$create("Create$2",[rtl.as(Source,$mod.TTMSFNCDataGridCore).GetColumnPositionDictionary()]);
          pas.SysUtils.FreeAndNil({p: this, get: function () {
              return this.p.FColumnReverseOrderDictionary;
            }, set: function (v) {
              this.p.FColumnReverseOrderDictionary = v;
            }});
          this.FColumnReverseOrderDictionary = $mod.TTMSFNCDataGridIntegerDictionary.$create("Create$2",[rtl.as(Source,$mod.TTMSFNCDataGridCore).GetColumnReverseOrderDictionary()]);
          pas.SysUtils.FreeAndNil({p: this, get: function () {
              return this.p.FColumnWidthDictionary;
            }, set: function (v) {
              this.p.FColumnWidthDictionary = v;
            }});
          this.FColumnWidthDictionary = $mod.TTMSFNCDataGridDoubleDictionary.$create("Create$2",[rtl.as(Source,$mod.TTMSFNCDataGridCore).GetColumnWidthDictionary()]);
          this.FDefaultColumnWidth = rtl.as(Source,$mod.TTMSFNCDataGridCore).FDefaultColumnWidth;
          this.FDefaultRowHeight = rtl.as(Source,$mod.TTMSFNCDataGridCore).FDefaultRowHeight;
          pas.SysUtils.FreeAndNil({p: this, get: function () {
              return this.p.FFilteredRowDictionary;
            }, set: function (v) {
              this.p.FFilteredRowDictionary = v;
            }});
          this.FFilteredRowDictionary = $mod.TTMSFNCDataGridBooleanDictionary.$create("Create$2",[rtl.as(Source,$mod.TTMSFNCDataGridCore).GetFilteredRowDictionary()]);
          this.FFixedBottomRowCount = rtl.as(Source,$mod.TTMSFNCDataGridCore).FFixedBottomRowCount;
          this.FFixedColumnCount = rtl.as(Source,$mod.TTMSFNCDataGridCore).FFixedColumnCount;
          this.FFixedRightColumnCount = rtl.as(Source,$mod.TTMSFNCDataGridCore).FFixedRightColumnCount;
          this.FFixedRowCount = rtl.as(Source,$mod.TTMSFNCDataGridCore).FFixedRowCount;
          this.FFreezeColumnCount = rtl.as(Source,$mod.TTMSFNCDataGridCore).FFreezeColumnCount;
          this.FFreezeRowCount = rtl.as(Source,$mod.TTMSFNCDataGridCore).FFreezeRowCount;
          pas.SysUtils.FreeAndNil({p: this, get: function () {
              return this.p.FHiddenColumnDictionary;
            }, set: function (v) {
              this.p.FHiddenColumnDictionary = v;
            }});
          this.FHiddenColumnDictionary = $mod.TTMSFNCDataGridBooleanDictionary.$create("Create$2",[rtl.as(Source,$mod.TTMSFNCDataGridCore).GetHiddenColumnDictionary()]);
          pas.SysUtils.FreeAndNil({p: this, get: function () {
              return this.p.FHiddenRowDictionary;
            }, set: function (v) {
              this.p.FHiddenRowDictionary = v;
            }});
          this.FHiddenRowDictionary = $mod.TTMSFNCDataGridBooleanDictionary.$create("Create$2",[rtl.as(Source,$mod.TTMSFNCDataGridCore).GetHiddenRowDictionary()]);
          pas.SysUtils.FreeAndNil({p: this, get: function () {
              return this.p.FMergedColumnDictionary;
            }, set: function (v) {
              this.p.FMergedColumnDictionary = v;
            }});
          this.FMergedColumnDictionary = $mod.TTMSFNCDataGridBooleanDictionary.$create("Create$2",[rtl.as(Source,$mod.TTMSFNCDataGridCore).GetMergedColumnDictionary()]);
          pas.SysUtils.FreeAndNil({p: this, get: function () {
              return this.p.FMergedRowDictionary;
            }, set: function (v) {
              this.p.FMergedRowDictionary = v;
            }});
          this.FMergedRowDictionary = $mod.TTMSFNCDataGridBooleanDictionary.$create("Create$2",[rtl.as(Source,$mod.TTMSFNCDataGridCore).GetMergedRowDictionary()]);
          this.FRowCount = rtl.as(Source,$mod.TTMSFNCDataGridCore).FRowCount;
          pas.SysUtils.FreeAndNil({p: this, get: function () {
              return this.p.FRowOrderDictionary;
            }, set: function (v) {
              this.p.FRowOrderDictionary = v;
            }});
          this.FRowOrderDictionary = $mod.TTMSFNCDataGridIntegerDictionary.$create("Create$2",[rtl.as(Source,$mod.TTMSFNCDataGridCore).GetRowOrderDictionary()]);
          pas.SysUtils.FreeAndNil({p: this, get: function () {
              return this.p.FRowPositionDictionary;
            }, set: function (v) {
              this.p.FRowPositionDictionary = v;
            }});
          this.FRowPositionDictionary = $mod.TTMSFNCDataGridDoubleDictionary.$create("Create$2",[rtl.as(Source,$mod.TTMSFNCDataGridCore).GetRowPositionDictionary()]);
          pas.SysUtils.FreeAndNil({p: this, get: function () {
              return this.p.FRowReverseOrderDictionary;
            }, set: function (v) {
              this.p.FRowReverseOrderDictionary = v;
            }});
          this.FRowReverseOrderDictionary = $mod.TTMSFNCDataGridIntegerDictionary.$create("Create$2",[rtl.as(Source,$mod.TTMSFNCDataGridCore).GetRowReverseOrderDictionary()]);
          pas.SysUtils.FreeAndNil({p: this, get: function () {
              return this.p.FRowHeightDictionary;
            }, set: function (v) {
              this.p.FRowHeightDictionary = v;
            }});
          this.FRowHeightDictionary = $mod.TTMSFNCDataGridDoubleDictionary.$create("Create$2",[rtl.as(Source,$mod.TTMSFNCDataGridCore).GetRowHeightDictionary()]);
        } else pas.Classes.TPersistent.Assign.apply(this,arguments);
      } finally {
        this.EndUpdate();
      };
    };
    this.BeforeExport = function () {
      this.FIsExporting = true;
      this.FSaveLocalRect.$assign(this.FLocalRect);
      this.Update();
    };
    this.BeginUpdate = function () {
      this.FUpdateCount += 1;
    };
    this.Clear = function () {
      this.BeginUpdate();
      try {
        this.InternalClear();
      } finally {
        this.EndUpdate();
      };
    };
    this.ClearColumnInfo = function (AColumn) {
      this.BeginUpdate();
      try {
        if (AColumn === -1) {
          this.GetColumnReverseOrderDictionary().Clear();
          this.GetColumnOrderDictionary().Clear();
          this.GetMergedColumnDictionary().Clear();
          this.GetColumnWidthDictionary().Clear();
          this.GetColumnPositionDictionary().Clear();
          this.GetHiddenColumnDictionary().Clear();
        } else {
          this.GetColumnReverseOrderDictionary().Remove(AColumn);
          this.GetColumnOrderDictionary().Remove(AColumn);
          this.GetMergedColumnDictionary().Remove(AColumn);
          this.GetColumnWidthDictionary().Remove(AColumn);
          this.GetColumnPositionDictionary().Remove(AColumn);
          this.GetHiddenColumnDictionary().Remove(AColumn);
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.ClearRowInfo = function (ARow) {
      this.BeginUpdate();
      try {
        if (ARow === -1) {
          this.GetRowReverseOrderDictionary().Clear();
          this.GetRowOrderDictionary().Clear();
          this.GetMergedRowDictionary().Clear();
          this.GetFilteredRowDictionary().Clear();
          this.GetRowHeightDictionary().Clear();
          this.GetRowPositionDictionary().Clear();
          this.GetHiddenRowDictionary().Clear();
        } else {
          this.GetRowReverseOrderDictionary().Remove(ARow);
          this.GetRowOrderDictionary().Remove(ARow);
          this.GetMergedRowDictionary().Remove(ARow);
          this.GetFilteredRowDictionary().Remove(ARow);
          this.GetRowHeightDictionary().Remove(ARow);
          this.GetRowPositionDictionary().Remove(ARow);
          this.GetHiddenRowDictionary().Remove(ARow);
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.DoNotifyEditor = function () {
      if (this.FOnNotifyEditor != null) this.FOnNotifyEditor(this);
    };
    this.EndUpdate = function () {
      this.FUpdateCount -= 1;
      if (this.GetUpdateCount() === 0) this.DoUpdate();
    };
    this.ExportNotification = function (AState, ARow) {
      var $tmp = AState;
      if ($tmp === $mod.TTMSFNCDataGridExportState.gesExportStart) {
        this.BeforeExport()}
       else if ($tmp === $mod.TTMSFNCDataGridExportState.gesExportDone) this.AfterExport();
    };
    this.HideColumn = function (AColumn) {
      this.SetHiddenColumn(AColumn,true);
      this.DoNotifyEditor();
    };
    this.HideRow = function (ARow) {
      this.SetHiddenRow(ARow,true);
      this.DoNotifyEditor();
    };
    this.ImportNotification = function (AState, ARow) {
    };
    this.LoadSettingsFromFile = function (AFileName) {
      this.BeginUpdate();
      pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.LoadSettingsFromFile(this,AFileName);
      this.EndUpdate();
    };
    this.LoadSettingsFromStream = function (AStream) {
      this.BeginUpdate();
      pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.LoadSettingsFromStream(this,AStream);
      this.EndUpdate();
    };
    this.LogMessage = function (AMessage, AMessageType) {
      var m = "";
      if (this.FOnLogMessage != null) {
        this.FOnLogMessage(this,AMessage,AMessageType)}
       else {
        var $tmp = AMessageType;
        if ($tmp === $mod.TTMSFNCDataGridLogMessageType.glmInfo) {
          m = "[INFO] " + AMessage}
         else if ($tmp === $mod.TTMSFNCDataGridLogMessageType.glmWarning) {
          m = "[WARNING] " + AMessage}
         else if ($tmp === $mod.TTMSFNCDataGridLogMessageType.glmError) m = "[ERROR] " + AMessage;
        pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.Log(m);
      };
    };
    this.LoopThroughColumns = function (ALoopCallback, AIncludeFixed) {
      var I = 0;
      var c = 0;
      var ce = 0;
      if (AIncludeFixed) {
        c = 0;
        ce = this.FColumnCount - 1;
      } else {
        c = this.FFixedColumnCount;
        ce = this.FColumnCount - 1 - this.FFixedRightColumnCount;
      };
      for (var $l = c, $end = ce; $l <= $end; $l++) {
        I = $l;
        ALoopCallback(I);
      };
    };
    this.LoopThroughRows = function (ALoopCallback, AIncludeFixed) {
      var I = 0;
      var r = 0;
      var re = 0;
      if (AIncludeFixed) {
        r = 0;
        re = this.FRowCount - 1;
      } else {
        r = this.FFixedRowCount;
        re = this.FRowCount - 1 - this.FFixedBottomRowCount;
      };
      for (var $l = r, $end = re; $l <= $end; $l++) {
        I = $l;
        ALoopCallback(I);
      };
    };
    this.SaveSettingsToFile = function (AFileName, AAppearanceOnly) {
      this.FAppearancePersisting = AAppearanceOnly;
      pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.SaveSettingsToFile(this,AFileName);
      this.FAppearancePersisting = false;
    };
    this.SaveSettingsToStream = function (AStream, AAppearanceOnly) {
      this.FAppearancePersisting = AAppearanceOnly;
      pas["WEBLib.TMSFNCPersistence"].TTMSFNCPersistence.SaveSettingsToStream(this,AStream);
      this.FAppearancePersisting = false;
    };
    this.SetExportRect = function (ARect) {
      this.FExportRect.$assign(ARect);
      this.FExportRectSet = true;
    };
    this.SetLocalRect = function (ARect) {
      this.FLocalRect.$assign(ARect);
    };
    this.UnhideAll = function () {
      this.GetHiddenColumnDictionary().Clear();
      this.GetHiddenRowDictionary().Clear();
      this.DoUpdate();
    };
    this.UnhideAllColumns = function () {
      this.GetHiddenColumnDictionary().Clear();
      this.DoUpdate();
    };
    this.UnhideAllRows = function () {
      this.GetHiddenRowDictionary().Clear();
      this.DoUpdate();
    };
    this.UnhideColumn = function (AColumn) {
      this.SetHiddenColumn(AColumn,false);
      this.DoNotifyEditor();
    };
    this.UnhideRow = function (ARow) {
      this.SetHiddenRow(ARow,false);
      this.DoNotifyEditor();
    };
    this.Update = function () {
      if (!this.IsBlocked()) this.UpdateColumnRowCalculations();
    };
    this.UpdateColumnRowCalculations = function () {
      var cr = 0;
      var cc = 0;
      var r = 0.0;
      var c = 0.0;
      var k = 0;
      if ((this.GetUpdateCount() > 0) || this.GetIsDestroying()) return;
      this.GetRowPositionDictionary().Clear();
      cr = this.FRowCount - this.GetHiddenRowCount();
      r = 0;
      var $in = this.GetRowHeightDictionary().GetKeys().GetEnumerator$1();
      try {
        while ($in.MoveNext$1()) {
          k = $in.GetCurrent();
          if (this.IsRowValid(k) && !this.IsRowHidden(k)) {
            r = r + this.GetRowHeight(k);
            cr -= 1;
          };
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      r = r + (cr * this.FDefaultRowHeight);
      this.GetColumnPositionDictionary().Clear();
      cc = this.FColumnCount - this.GetHiddenColumnCount();
      c = 0;
      var $in1 = this.GetColumnWidthDictionary().GetKeys().GetEnumerator$1();
      try {
        while ($in1.MoveNext$1()) {
          k = $in1.GetCurrent();
          if (this.IsColumnValid(k) && !this.IsColumnHidden(k)) {
            c = c + this.GetColumnWidth(k);
            cc -= 1;
          };
        }
      } finally {
        $in1 = rtl.freeLoc($in1)
      };
      c = c + (cc * this.FDefaultColumnWidth);
      this.FTotalColumnWidth = c;
      this.FTotalRowHeight = r;
      this.FTotalFixedRowHeight = this.GetTotalFixedRowHeight(true);
      this.FTotalFixedColumnWidth = this.GetTotalFixedColumnWidth(true);
      this.FTotalFixedBottomRowHeight = this.GetTotalFixedBottomRowHeight();
      this.FTotalFixedRightColumnWidth = this.GetTotalFixedRightColumnWidth();
    };
    this.UpdateVisualRange = function () {
      var c = 0;
      var r = 0;
      var xval = 0.0;
      var yval = 0.0;
      var tr = 0.0;
      var br = 0.0;
      var lc = 0.0;
      var rc = 0.0;
      var rowh = 0.0;
      var colw = 0.0;
      var cw = 0.0;
      var ch = 0.0;
      var vpos = 0.0;
      var hpos = 0.0;
      var cr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var low = 0;
      var high = 0;
      var mid = 0;
      var startColIndex = 0;
      var startRowIndex = 0;
      var colOffset = 0.0;
      var rowOffset = 0.0;
      if ((this.GetUpdateCount() > 0) || this.GetIsDestroying()) return;
      this.UpdateCumulativeCache();
      hpos = this.GetHorizontalScrollPosition();
      vpos = this.GetVerticalScrollPosition();
      cr.$assign(this.GetContentRect());
      cw = cr.Right - cr.Left;
      ch = cr.Bottom - cr.Top;
      this.FStartColumn = -1;
      this.FStopColumn = -1;
      this.FStartRow = -1;
      this.FStopRow = -1;
      if (this.FColumnCount === 0) return;
      if (this.FRowCount === 0) return;
      lc = this.GetTotalFixedColumnWidth(true);
      rc = this.GetTotalFixedRightColumnWidth();
      tr = this.GetTotalFixedRowHeight(true);
      br = this.GetTotalFixedBottomRowHeight();
      startColIndex = this.FFixedColumnCount + this.FFreezeColumnCount;
      low = startColIndex;
      high = this.FColumnCount - 1 - this.FFixedRightColumnCount;
      if (startColIndex < rtl.length(this.FCumulativeColumnWidths)) {
        colOffset = this.FCumulativeColumnWidths[startColIndex]}
       else colOffset = 0;
      while (low <= high) {
        mid = rtl.trunc((low + high) / 2);
        if (((this.FCumulativeColumnWidths[mid] - colOffset) + this.GetColumnWidth(mid)) > hpos) {
          if ((mid === startColIndex) || ((this.FCumulativeColumnWidths[mid] - colOffset) <= hpos)) {
            this.FStartColumn = mid;
            this.FTotalColumnOffset = lc + (this.FCumulativeColumnWidths[mid] - colOffset);
            break;
          };
          high = mid - 1;
        } else low = mid + 1;
      };
      if ((this.FStartColumn < startColIndex) || (this.FStartColumn >= this.FColumnCount)) this.FStartColumn = startColIndex;
      if ((this.FStartColumn < 0) || (this.FStartColumn >= this.FColumnCount)) this.FStartColumn = -1;
      if (this.FStartColumn !== -1) {
        while ((this.FStartColumn < this.FColumnCount) && this.IsColumnHidden(this.FStartColumn)) this.FStartColumn += 1;
      };
      if ((this.FStartColumn < 0) || (this.FStartColumn >= this.FColumnCount)) this.FStartColumn = -1;
      if (this.FStartColumn > -1) {
        xval = this.FCumulativeColumnWidths[this.FStartColumn] - colOffset - hpos;
        for (var $l = this.FStartColumn, $end = this.FColumnCount - 1 - this.FFixedRightColumnCount; $l <= $end; $l++) {
          c = $l;
          if (this.IsColumnHidden(c)) continue;
          colw = this.GetColumnWidth(c);
          if (this.OnlyLastFullVisibleColumn()) {
            if ((c < (this.FColumnCount - 1 - this.FFixedRightColumnCount)) && ((xval + colw + lc + this.GetColumnWidth(c + 1)) > (cw - rc))) {
              this.FStopColumn = c;
              break;
            };
          } else {
            if ((xval + colw + lc) > (cw - rc)) {
              this.FStopColumn = c;
              break;
            };
          };
          xval = xval + colw;
        };
      };
      if ((this.FStartColumn > -1) && (this.FStopColumn === -1)) this.FStopColumn = this.FColumnCount - 1 - this.FFixedRightColumnCount;
      if (this.FStopColumn !== -1) {
        while ((this.FStopColumn > this.FStartColumn) && this.IsColumnHidden(this.FStopColumn)) this.FStopColumn -= 1;
      };
      startRowIndex = this.FFixedRowCount + this.FFreezeRowCount;
      low = startRowIndex;
      high = this.FRowCount - 1 - this.FFixedBottomRowCount;
      if (startRowIndex < rtl.length(this.FCumulativeRowHeights)) {
        rowOffset = this.FCumulativeRowHeights[startRowIndex]}
       else rowOffset = 0;
      while (low <= high) {
        mid = rtl.trunc((low + high) / 2);
        if (((this.FCumulativeRowHeights[mid] - rowOffset) + this.GetRowHeight(mid)) > vpos) {
          if ((mid === startRowIndex) || ((this.FCumulativeRowHeights[mid] - rowOffset) <= vpos)) {
            this.FStartRow = mid;
            this.FTotalRowOffset = tr + (this.FCumulativeRowHeights[mid] - rowOffset);
            break;
          };
          high = mid - 1;
        } else low = mid + 1;
      };
      if ((this.FStartRow < startRowIndex) || (this.FStartRow >= this.FRowCount)) this.FStartRow = startRowIndex;
      if ((this.FStartRow < 0) || (this.FStartRow >= this.FRowCount)) this.FStartRow = -1;
      if (this.FStartRow !== -1) {
        while ((this.FStartRow < this.FRowCount) && this.IsRowHidden(this.FStartRow)) this.FStartRow += 1;
      };
      if ((this.FStartRow < 0) || (this.FStartRow >= this.FRowCount)) this.FStartRow = -1;
      if (this.FStartRow > -1) {
        yval = this.FCumulativeRowHeights[this.FStartRow] - rowOffset - vpos;
        for (var $l1 = this.FStartRow, $end1 = this.FRowCount - 1 - this.FFixedBottomRowCount; $l1 <= $end1; $l1++) {
          r = $l1;
          if (this.IsRowHidden(r)) continue;
          rowh = this.GetRowHeight(r);
          if (this.OnlyLastFullVisibleRow()) {
            if ((r < (this.FRowCount - 1 - this.FFixedBottomRowCount)) && ((yval + rowh + tr + this.GetRowHeight(r + 1)) > (ch - br))) {
              this.FStopRow = r;
              break;
            };
          } else {
            if ((yval + rowh + tr) > (ch - br)) {
              this.FStopRow = r;
              break;
            };
          };
          yval = yval + rowh;
        };
      };
      if ((this.FStartRow > -1) && (this.FStopRow === -1)) this.FStopRow = this.FRowCount - 1 - this.FFixedBottomRowCount;
      if (this.FStopRow !== -1) {
        while ((this.FStopRow > this.FStartRow) && this.IsRowHidden(this.FStopRow)) this.FStopRow -= 1;
      };
      this.FStopRow = Math.max(this.FStartRow,this.FStopRow);
      this.FStopColumn = Math.max(this.FStartColumn,this.FStopColumn);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("ColumnCount",2,rtl.longint,"FColumnCount","SetColumnCount",4,{Default: 4});
    $r.addProperty("ColumnOrderDictionary",1,$mod.$rtti["TTMSFNCDataGridIntegerDictionary"],"GetColumnOrderDictionary","");
    $r.addProperty("ColumnPositionDictionary",1,$mod.$rtti["TTMSFNCDataGridDoubleDictionary"],"GetColumnPositionDictionary","");
    $r.addProperty("ColumnReverseOrderDictionary",1,$mod.$rtti["TTMSFNCDataGridIntegerDictionary"],"GetColumnReverseOrderDictionary","");
    $r.addProperty("ColumnWidthDictionary",1,$mod.$rtti["TTMSFNCDataGridDoubleDictionary"],"GetColumnWidthDictionary","");
    $r.addProperty("DefaultColumnWidth",14,rtl.double,"FDefaultColumnWidth","SetDefaultColumnWidth",4,{stored: "IsDefaultColumnWidthStored"});
    $r.addProperty("DefaultRowHeight",14,rtl.double,"FDefaultRowHeight","SetDefaultRowHeight",4,{stored: "IsDefaultRowHeightStored"});
    $r.addProperty("FilteredRowDictionary",1,$mod.$rtti["TTMSFNCDataGridBooleanDictionary"],"GetFilteredRowDictionary","");
    $r.addProperty("FixedBottomRowCount",2,rtl.longint,"FFixedBottomRowCount","SetFixedBottomRowCount",4,{Default: 0});
    $r.addProperty("FixedColumnCount",2,rtl.longint,"FFixedColumnCount","SetFixedColumnCount",4,{Default: 0});
    $r.addProperty("FixedRightColumnCount",2,rtl.longint,"FFixedRightColumnCount","SetFixedRightColumnCount",4,{Default: 0});
    $r.addProperty("FixedRowCount",2,rtl.longint,"FFixedRowCount","SetFixedRowCount",4,{Default: 1});
    $r.addProperty("FreezeColumnCount",2,rtl.longint,"FFreezeColumnCount","SetFreezeColumnCount",4,{Default: 0});
    $r.addProperty("FreezeRowCount",2,rtl.longint,"FFreezeRowCount","SetFreezeRowCount",4,{Default: 0});
    $r.addProperty("HiddenColumnDictionary",1,$mod.$rtti["TTMSFNCDataGridBooleanDictionary"],"GetHiddenColumnDictionary","");
    $r.addProperty("HiddenRowDictionary",1,$mod.$rtti["TTMSFNCDataGridBooleanDictionary"],"GetHiddenRowDictionary","");
    $r.addProperty("MergedColumnDictionary",1,$mod.$rtti["TTMSFNCDataGridBooleanDictionary"],"GetMergedColumnDictionary","");
    $r.addProperty("MergedRowDictionary",1,$mod.$rtti["TTMSFNCDataGridBooleanDictionary"],"GetMergedRowDictionary","");
    $r.addProperty("RowCount",2,rtl.longint,"FRowCount","SetRowCount",4,{Default: 24});
    $r.addProperty("RowHeightDictionary",1,$mod.$rtti["TTMSFNCDataGridDoubleDictionary"],"GetRowHeightDictionary","");
    $r.addProperty("RowOrderDictionary",1,$mod.$rtti["TTMSFNCDataGridIntegerDictionary"],"GetRowOrderDictionary","");
    $r.addProperty("RowPositionDictionary",1,$mod.$rtti["TTMSFNCDataGridDoubleDictionary"],"GetRowPositionDictionary","");
    $r.addProperty("RowReverseOrderDictionary",1,$mod.$rtti["TTMSFNCDataGridIntegerDictionary"],"GetRowReverseOrderDictionary","");
    $r.addProperty("RowViewMode",2,$mod.$rtti["TTMSFNCDataGridRowViewMode"],"FRowViewMode","SetRowViewMode",4,{Default: $mod.TTMSFNCDataGridRowViewMode.grvmTotalRows});
    $r.addProperty("ColumnViewMode",2,$mod.$rtti["TTMSFNCDataGridColumnViewMode"],"FColumnViewMode","SetColumnViewMode",4,{Default: $mod.TTMSFNCDataGridColumnViewMode.gcvmTotalColumns});
  });
  this.AllRowTypes = rtl.createSet(this.TTMSFNCDataGridRowType.grtDefault,this.TTMSFNCDataGridRowType.grtSummary,this.TTMSFNCDataGridRowType.grtNode,this.TTMSFNCDataGridRowType.grtFilter);
  this.MakeCell = function (AColumn, ARow) {
    var Result = $mod.TTMSFNCDataGridCellCoord.$new();
    Result.SetColumn(AColumn);
    Result.SetRow(ARow);
    return Result;
  };
  this.MakeCellRange = function (AStartColumn, AStartRow, AStopColumn, AStopRow) {
    var Result = $mod.TTMSFNCDataGridCellCoordRange.$new();
    Result.StartCell.$assign($mod.MakeCell(AStartColumn,AStartRow));
    Result.StopCell.$assign($mod.MakeCell(AStopColumn,AStopRow));
    return Result;
  };
},["TypInfo","DateUtils","WEBLib.Controls","WEBLib.TMSFNCDataGridCell","WEBLib.Forms","Math","WEBLib.TMSFNCUtils"]);
rtl.module("WEBLib.TMSFNCImage",["System","Classes","WEBLib.TMSFNCCustomControl","WEBLib.TMSFNCBitmapContainer","WEBLib.TMSFNCTypes","WEBLib.TMSFNCGraphics","WEBLib.TMSFNCGraphicsTypes"],function () {
  "use strict";
  var $mod = this;
  this.MAJ_VER = 1;
  this.MIN_VER = 0;
  this.REL_VER = 0;
  this.BLD_VER = 1;
  rtl.createClass(this,"TTMSFNCCustomImage",pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$init.call(this);
      this.FBitmap = null;
      this.FBitmapContainer = null;
      this.FStretch = false;
      this.FBitmaps = null;
      this.FCropping = false;
      this.FCenter$1 = false;
      this.FAutoSize = false;
      this.FAspectRatio = false;
      this.FOnBitmapChanged = null;
      this.FBitmapMargins = null;
      this.FDottedDesigntimeRectangle = false;
    };
    this.$final = function () {
      this.FBitmap = undefined;
      this.FBitmapContainer = undefined;
      this.FBitmaps = undefined;
      this.FOnBitmapChanged = undefined;
      this.FBitmapMargins = undefined;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$final.call(this);
    };
    this.SetBitmapContainer = function (Value) {
      this.FBitmapContainer = Value;
      this.ApplyAutoSize();
      this.Invalidate();
    };
    this.SetBitmaps = function (Value) {
      this.FBitmaps.Assign(Value);
      this.Invalidate();
    };
    this.SetBitmap = function (Value) {
      this.FBitmap.Assign(Value);
      this.Invalidate();
    };
    this.GetBitmapContainer = function () {
      var Result = null;
      Result = this.FBitmapContainer;
      return Result;
    };
    this.SetBitmapMargins = function (Value) {
      this.FBitmapMargins.Assign(Value);
    };
    this.GetVersion = function () {
      var Result = "";
      Result = this.$class.GetVersionNumber(1,0,0,1);
      return Result;
    };
    this.ApplyAutoSize = function () {
      var bmp = null;
      bmp = this.GetBitmap();
      if (bmp != null) {
        if (this.FAutoSize && !pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(bmp)) {
          this.SetWidth(Math.round(bmp.GetWidth() + this.FBitmapMargins.FLeft + this.FBitmapMargins.FRight));
          this.SetHeight(Math.round(bmp.GetHeight() + this.FBitmapMargins.FTop + this.FBitmapMargins.FBottom));
        };
      };
    };
    this.BitmapMarginsChanged = function (Sender) {
      this.ApplyAutoSize();
      this.Invalidate();
    };
    this.Notification = function (AComponent, Operation) {
      pas["WEBLib.Menus"].TWebCustomControl.Notification.apply(this,arguments);
      if ((Operation === pas.Classes.TOperation.opRemove) && (AComponent === this.FBitmapContainer)) this.FBitmapContainer = null;
    };
    this.BitmapChanged = function (Sender) {
      if (this.FOnBitmapChanged != null) this.FOnBitmapChanged(this);
      this.ApplyAutoSize();
      this.Invalidate();
    };
    this.SetStretch = function (Value) {
      this.FStretch = Value;
      this.Invalidate();
    };
    this.SetCropping = function (Value) {
      this.FCropping = Value;
      this.Invalidate();
    };
    this.SetCenter = function (Value) {
      this.FCenter$1 = Value;
      this.Invalidate();
    };
    this.SetAS = function (Value) {
      this.FAutoSize = Value;
      this.ApplyAutoSize();
      this.Invalidate();
    };
    this.SetAspectRatio = function (Value) {
      this.FAspectRatio = Value;
      this.Invalidate();
    };
    this.Clear = function () {
      this.FBitmaps.Clear();
    };
    this.GetPaintRectangle = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var bmp = null;
      var rdest = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var w = 0.0;
      var h = 0.0;
      var x = 0.0;
      var y = 0.0;
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,0,0));
      bmp = this.GetBitmap();
      if (bmp != null) {
        x = this.FBitmapMargins.FLeft;
        y = this.FBitmapMargins.FTop;
        w = 0;
        h = 0;
        pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.GetAspectSize({get: function () {
            return w;
          }, set: function (v) {
            w = v;
          }},{get: function () {
            return h;
          }, set: function (v) {
            h = v;
          }},bmp.GetWidth(),bmp.GetHeight(),this.GetWidth() - this.FBitmapMargins.FLeft - this.FBitmapMargins.FRight,this.GetHeight() - this.FBitmapMargins.FTop - this.FBitmapMargins.FBottom,this.FAspectRatio,this.FStretch,this.FCropping);
        if (this.FCenter$1 || this.FCropping) {
          x = (this.GetWidth() - w) / 2;
          y = (this.GetHeight() - h) / 2;
        };
        rdest.$assign(pas["WEBLib.TMSFNCTypes"].RectF(x,y,x + w,y + h));
        Result.$assign(rdest);
      };
      return Result;
    };
    this.GetBitmap = function () {
      var Result = null;
      if (!pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(this.FBitmap)) {
        Result = this.FBitmap}
       else Result = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.GetScaledBitmap(this.FBitmaps,0,this.FBitmapContainer);
      return Result;
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Create$1.apply(this,arguments);
      this.FDottedDesigntimeRectangle = true;
      if (this.IsDesignTime()) this.DisableBackground();
      this.FBitmapMargins = pas["WEBLib.TMSFNCTypes"].TTMSFNCMargins.$create("Create$1");
      this.FBitmapMargins.FOnChange = rtl.createCallback(this,"BitmapMarginsChanged");
      this.FCenter$1 = true;
      this.FStretch = false;
      this.FAspectRatio = true;
      this.FCropping = false;
      this.FBitmaps = pas["WEBLib.TMSFNCTypes"].TTMSFNCScaledBitmaps.$create("Create$3",[this]);
      this.FBitmaps.FOnChange = rtl.createCallback(this,"BitmapChanged");
      this.FBitmap = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      this.FBitmap.FOnChange = rtl.createCallback(this,"BitmapChanged");
      this.SetWidth(100);
      this.SetHeight(100);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FBitmap");
      rtl.free(this,"FBitmaps");
      rtl.free(this,"FBitmapMargins");
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Destroy.call(this);
    };
    this.Draw = function (AGraphics, ARect) {
      var bmp = null;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Draw.apply(this,arguments);
      if ((pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) && this.FDottedDesigntimeRectangle) {
        AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskDot);
        AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
      };
      bmp = this.GetBitmap();
      if (bmp != null) {
        ARect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARect.Left + this.FBitmapMargins.FLeft,ARect.Top + this.FBitmapMargins.FTop,ARect.Right - this.FBitmapMargins.FRight,ARect.Bottom - this.FBitmapMargins.FBottom));
        AGraphics.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),bmp,this.FAspectRatio,this.FStretch,this.FCenter$1,this.FCropping);
      };
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCImage",this.TTMSFNCCustomImage,function () {
    this.RegisterRuntimeClasses = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClass($mod.TTMSFNCImage);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("AspectRatio",2,rtl.boolean,"FAspectRatio","SetAspectRatio",4,{Default: true});
    $r.addProperty("Bitmap",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FBitmap","SetBitmap");
    $r.addProperty("BitmapMargins",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCMargins"],"FBitmapMargins","SetBitmapMargins");
    $r.addProperty("Version",1,rtl.string,"GetVersion","");
    $r.addProperty("Bitmaps",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCScaledBitmaps"],"FBitmaps","SetBitmaps");
    $r.addProperty("BitmapContainer",3,pas["WEBLib.TMSFNCBitmapContainer"].$rtti["TTMSFNCBitmapContainer"],"GetBitmapContainer","SetBitmapContainer");
    $r.addProperty("Stretch",2,rtl.boolean,"FStretch","SetStretch",4,{Default: false});
    $r.addProperty("Cropping",2,rtl.boolean,"FCropping","SetCropping",4,{Default: false});
    $r.addProperty("Center",2,rtl.boolean,"FCenter$1","SetCenter",4,{Default: true});
    $r.addProperty("AutoSize",2,rtl.boolean,"FAutoSize","SetAS",4,{Default: false});
    $r.addProperty("Fill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFill","SetFill");
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
},["WEBLib.Controls","WEBLib.Graphics","WEBLib.TMSFNCUtils"]);
rtl.module("WEBLib.TMSFNCHTMLText",["System","Classes","WEBLib.TMSFNCCustomControl","WEBLib.TMSFNCBitmapContainer","WEBLib.TMSFNCGraphics","WEBLib.TMSFNCGraphicsTypes","WEBLib.TMSFNCTypes","WEBLib.Controls"],function () {
  "use strict";
  var $mod = this;
  this.MAJ_VER = 1;
  this.MIN_VER = 1;
  this.REL_VER = 0;
  this.BLD_VER = 7;
  this.$rtti.$MethodVar("TTMSFNCHTMLTextAnchorClickEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AAnchor",rtl.string]]), methodkind: 0});
  this.$rtti.$Class("TTMSFNCHTMLText");
  rtl.createClass(this,"TTMSFNCHTMLText",pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$init.call(this);
      this.FDisableAdjustSize = false;
      this.FBitmapContainer = null;
      this.FOnAnchorClick = null;
      this.FURLColor = 0;
      this.FShadowOffset = 0;
      this.FShadowColor = 0;
      this.FDisplayHTML = false;
      this.FURLUnderline = false;
      this.FText = "";
      this.FFont$1 = null;
      this.FWordWrapping = false;
      this.FAutoSize = false;
      this.FVerticalTextAlign = 0;
      this.FHorizontalTextAlign = 0;
      this.FAutoOpenURL = false;
      this.FAutoSizeSpacing = 0.0;
      this.FAutoHeight = false;
      this.FAutoWidth = false;
      this.FTrimming = 0;
      this.FOnInternalFontChanged = null;
      this.FTextIndentMargins = null;
    };
    this.$final = function () {
      this.FBitmapContainer = undefined;
      this.FOnAnchorClick = undefined;
      this.FFont$1 = undefined;
      this.FOnInternalFontChanged = undefined;
      this.FTextIndentMargins = undefined;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$final.call(this);
    };
    this.SetShadowOffset = function (Value) {
      if (this.FShadowOffset !== Value) {
        this.FShadowOffset = Value;
        this.Invalidate();
      };
    };
    this.SetURLColor = function (Value) {
      if (this.FURLColor !== Value) {
        this.FURLColor = Value;
        this.Invalidate();
      };
    };
    this.SetShadowColor = function (Value) {
      if (this.FShadowColor !== Value) {
        this.FShadowColor = Value;
        this.Invalidate();
      };
    };
    this.SetBitmapContainer = function (Value) {
      this.FBitmapContainer = Value;
      this.ApplyAutoSize();
    };
    this.SetDisplayHTML = function (Value) {
      if (this.FDisplayHTML !== Value) {
        this.FDisplayHTML = Value;
        this.ApplyAutoSize();
        this.Invalidate();
      };
    };
    this.SetURLUnderline = function (Value) {
      if (this.FURLUnderline !== Value) {
        this.FURLUnderline = Value;
        this.Invalidate();
      };
    };
    this.SetFnt = function (Value) {
      this.FFont$1.AssignSource(Value);
    };
    this.SetWordWrapping = function (Value) {
      if (this.FWordWrapping !== Value) {
        this.FWordWrapping = Value;
        this.ApplyAutoSize();
        this.Invalidate();
      };
    };
    this.SetAS = function (Value) {
      if (this.FAutoSize !== Value) {
        this.FAutoSize = Value;
        this.ApplyAutoSize();
        this.Invalidate();
      };
    };
    this.SetHorizontalTextAlign = function (Value) {
      if (this.FHorizontalTextAlign !== Value) {
        this.FHorizontalTextAlign = Value;
        this.ApplyAutoSize();
        this.Invalidate();
      };
    };
    this.SetVerticalTextAlign = function (Value) {
      if (this.FVerticalTextAlign !== Value) {
        this.FVerticalTextAlign = Value;
        this.ApplyAutoSize();
        this.Invalidate();
      };
    };
    this.IsAutoSizeSpacingStored = function () {
      var Result = false;
      Result = this.FAutoSizeSpacing !== 0;
      return Result;
    };
    this.SetAutoSizeSpacing = function (Value) {
      if (this.FAutoSizeSpacing !== Value) {
        this.FAutoSizeSpacing = Value;
        this.ApplyAutoSize();
        this.Invalidate();
      };
    };
    this.GetBitmapContainer = function () {
      var Result = null;
      Result = this.FBitmapContainer;
      return Result;
    };
    this.SetAutoHeight = function (Value) {
      if (this.FAutoHeight !== Value) {
        this.FAutoHeight = Value;
        this.ApplyAutoSize();
        this.Invalidate();
      };
    };
    this.SetAutoWidth = function (Value) {
      if (this.FAutoWidth !== Value) {
        this.FAutoWidth = Value;
        this.ApplyAutoSize();
        this.Invalidate();
      };
    };
    this.SetTrimming = function (Value) {
      if (this.FTrimming !== Value) {
        this.FTrimming = Value;
        this.Invalidate();
      };
    };
    this.SetTextIndentMargins = function (Value) {
      if (this.FTextIndentMargins !== Value) this.FTextIndentMargins.Assign(Value);
    };
    this.SetText = function (Value) {
      if (this.FText !== Value) {
        this.FText = Value;
        this.ApplyAutoSize();
        this.Invalidate();
      };
    };
    this.GetVersion = function () {
      var Result = "";
      Result = this.$class.GetVersionNumber(1,1,0,7);
      return Result;
    };
    this.CanDrawDesignTime = function () {
      var Result = false;
      Result = true;
      return Result;
    };
    this.ChangeDPIScale = function (M, D) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ChangeDPIScale.apply(this,arguments);
      this.BeginUpdate();
      this.FFont$1.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FFont$1.FHeight,M,D));
      this.FAutoSizeSpacing = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FAutoSizeSpacing,M,D);
      this.ApplyAutoSize();
      this.EndUpdate();
    };
    this.RegisterRuntimeClasses = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClass($mod.TTMSFNCHTMLText);
    };
    this.ApplyStyle = function () {
      var c = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ApplyStyle.call(this);
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleBackgroundFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) this.FFill.SetColor(c);
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleBackgroundStrokeColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) this.FStroke.SetColor(c);
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleTextFontColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) this.FFont$1.SetColor(c);
    };
    this.ResetToDefaultStyle = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ResetToDefaultStyle.call(this);
      this.FFill.SetColor(16777215);
      this.FStroke.SetColor(12632256);
      this.FFont$1.SetColor(0);
    };
    this.ApplyAutoSize = function () {
      var R = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (!this.FDisableAdjustSize && !(pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) {
        this.FDisableAdjustSize = true;
        try {
          if (this.FAutoSize && (this.FText !== "")) {
            R.$assign(this.GetTextRect());
            if (this.FAutoHeight && this.FAutoWidth) {
              this.SetBounds(this.GetLeft(),this.GetTop(),Math.round((R.Right - R.Left) + (R.Left * 2) + (this.FFont$1.FSize / 3)),Math.round((R.Bottom - R.Top) + (R.Top * 2)))}
             else if (this.FAutoWidth) {
              this.SetBounds(this.GetLeft(),this.GetTop(),Math.round((R.Right - R.Left) + (R.Left * 2) + (this.FFont$1.FSize / 3)),this.GetHeight())}
             else if (this.FAutoHeight) this.SetBounds(this.GetLeft(),this.GetTop(),this.GetWidth(),Math.round((R.Bottom - R.Top) + (R.Top * 2)));
          };
        } finally {
          this.FDisableAdjustSize = false;
        };
      };
    };
    this.FillChanged$1 = function (Sender) {
      this.Invalidate();
    };
    this.DoFontChanged = function (Sender) {
      if (this.FOnInternalFontChanged != null) this.FOnInternalFontChanged(this);
      this.Invalidate();
    };
    this.StrokeChanged$1 = function (Sender) {
      this.Invalidate();
    };
    this.DoTextIndentMarginsChange = function (Sender) {
      this.Invalidate();
    };
    this.Notification = function (AComponent, Operation) {
      pas["WEBLib.Menus"].TWebCustomControl.Notification.apply(this,arguments);
      if ((Operation === pas.Classes.TOperation.opRemove) && (AComponent === this.FBitmapContainer)) this.FBitmapContainer = null;
    };
    this.HandleMouseDown = function (Button, Shift, X, Y) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseDown.apply(this,arguments);
      this.DoMouseDown(Button,rtl.refSet(Shift),X,Y);
    };
    this.HandleMouseMove = function (Shift, X, Y) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseMove.apply(this,arguments);
      this.DoMouseMove(rtl.refSet(Shift),X,Y);
    };
    this.DoAnchorClick = function (Anchor) {
      if (this.FOnAnchorClick != null) {
        this.FOnAnchorClick(this,Anchor)}
       else if (this.FAutoOpenURL) pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.OpenURL(Anchor);
    };
    this.DrawHTMLText = function (AGraphics) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      AGraphics.FFont.AssignSource(this.FFont$1);
      if (!this.FEnabled) AGraphics.FFont.SetColor(10789024);
      AGraphics.FURLColor = this.FURLColor;
      AGraphics.FURLUnderline = this.FURLUnderline;
      if (this.FAutoSize) {
        if (this.FAutoWidth && this.FAutoHeight) {
          r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.FAutoSizeSpacing,this.FAutoSizeSpacing,this.GetWidth() - this.FAutoSizeSpacing,this.GetHeight() - this.FAutoSizeSpacing))}
         else if (this.FAutoWidth) {
          r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.FAutoSizeSpacing,0,this.GetWidth() - this.FAutoSizeSpacing,this.GetHeight()))}
         else if (this.FAutoHeight) r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,this.FAutoSizeSpacing,this.GetWidth(),this.GetHeight() - this.FAutoSizeSpacing));
      } else r.$assign(this.GetRect());
      AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FText,this.FWordWrapping,this.FHorizontalTextAlign,this.FVerticalTextAlign,this.FTrimming,0,-1,-1,this.FDisplayHTML,false,-1,-1);
    };
    this.SetEnabled = function (Value) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.SetEnabled.apply(this,arguments);
      this.Invalidate();
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Create$1.apply(this,arguments);
      this.FURLColor = 16711680;
      this.FTrimming = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone;
      this.FURLUnderline = true;
      this.FDisplayHTML = true;
      this.FShadowOffset = 1;
      this.FAutoOpenURL = true;
      this.FShadowColor = 8421504;
      this.FWordWrapping = false;
      this.FAutoSize = false;
      this.FAutoHeight = true;
      this.FAutoWidth = true;
      this.FHorizontalTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      this.FVerticalTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      this.FFont$1 = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FFont$1.FOnChanged = rtl.createCallback(this,"DoFontChanged");
      this.FAutoSizeSpacing = 0;
      this.FTextIndentMargins = pas["WEBLib.TMSFNCTypes"].TTMSFNCMargins.$create("Create$1");
      this.FTextIndentMargins.FOnChange = rtl.createCallback(this,"DoTextIndentMarginsChange");
      this.FStroke.SetColor(-1);
      if (this.IsDesignTime()) {
        this.SetText("TTMSFNCHTMLText");
        this.DisableBackground();
      };
      this.SetWidth(100);
      this.SetHeight(50);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FTextIndentMargins");
      rtl.free(this,"FFont$1");
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Destroy.call(this);
    };
    this.GetTextRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var g = null;
      var R = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var w = 0.0;
      var h = 0.0;
      g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[1,1,false,true]);
      g.FOptimizedHTMLDrawing = this.FOptimizedHTMLDrawing;
      g.FBitmapContainer = this.GetBitmapContainer();
      try {
        if (g.BeginScene()) {
          g.FFont.AssignSource(this.FFont$1);
          if (this.FWordWrapping) {
            R.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,this.GetWidth(),10000))}
           else R.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,10000,10000));
          Result.$assign(g.CalculateText(this.FText,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(R),this.FWordWrapping,this.FDisplayHTML));
          w = Result.Right - Result.Left;
          h = Result.Bottom - Result.Top;
          Result.Right = Result.Left + w + (this.FAutoSizeSpacing * 2);
          Result.Bottom = Result.Top + h + (this.FAutoSizeSpacing * 2);
          g.EndScene();
        };
      } finally {
        g = rtl.freeLoc(g);
      };
      return Result;
    };
    this.GetRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(this.GetLocalRect());
      Result.Left = Result.Left + this.FTextIndentMargins.FLeft;
      Result.Top = Result.Top + this.FTextIndentMargins.FTop;
      Result.Right = Result.Right - this.FTextIndentMargins.FRight;
      Result.Bottom = Result.Bottom - this.FTextIndentMargins.FBottom;
      return Result;
    };
    this.Assign = function (Source) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Assign.apply(this,arguments);
      if ($mod.TTMSFNCHTMLText.isPrototypeOf(Source)) {
        this.FTrimming = rtl.as(Source,$mod.TTMSFNCHTMLText).FTrimming;
        this.FAutoSize = rtl.as(Source,$mod.TTMSFNCHTMLText).FAutoSize;
        this.FAutoWidth = rtl.as(Source,$mod.TTMSFNCHTMLText).FAutoWidth;
        this.FAutoHeight = rtl.as(Source,$mod.TTMSFNCHTMLText).FAutoHeight;
        this.FAutoSizeSpacing = rtl.as(Source,$mod.TTMSFNCHTMLText).FAutoSizeSpacing;
        this.FAutoOpenURL = rtl.as(Source,$mod.TTMSFNCHTMLText).FAutoOpenURL;
        this.FDisplayHTML = rtl.as(Source,$mod.TTMSFNCHTMLText).FDisplayHTML;
        this.FFont$1.AssignSource(rtl.as(Source,$mod.TTMSFNCHTMLText).FFont$1);
        this.FHorizontalTextAlign = rtl.as(Source,$mod.TTMSFNCHTMLText).FHorizontalTextAlign;
        this.FShadowColor = rtl.as(Source,$mod.TTMSFNCHTMLText).FShadowColor;
        this.FShadowOffset = rtl.as(Source,$mod.TTMSFNCHTMLText).FShadowOffset;
        this.FText = rtl.as(Source,$mod.TTMSFNCHTMLText).FText;
        this.FURLColor = rtl.as(Source,$mod.TTMSFNCHTMLText).FURLColor;
        this.FURLUnderline = rtl.as(Source,$mod.TTMSFNCHTMLText).FURLUnderline;
        this.FVerticalTextAlign = rtl.as(Source,$mod.TTMSFNCHTMLText).FVerticalTextAlign;
        this.FWordWrapping = rtl.as(Source,$mod.TTMSFNCHTMLText).FWordWrapping;
      };
    };
    this.DoMouseMove = function (Shift, X, Y) {
      var g = null;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var a = "";
      if (this.IsHTML()) {
        g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[1,1,false,true]);
        g.FOptimizedHTMLDrawing = this.FOptimizedHTMLDrawing;
        g.FBitmapContainer = this.GetBitmapContainer();
        try {
          if (g.BeginScene()) {
            g.FFont.AssignSource(this.FFont$1);
            if (this.FAutoSize) {
              if (this.FAutoWidth && this.FAutoHeight) {
                r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.FAutoSizeSpacing,this.FAutoSizeSpacing,this.GetWidth() - this.FAutoSizeSpacing,this.GetHeight() - this.FAutoSizeSpacing))}
               else if (this.FAutoWidth) {
                r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.FAutoSizeSpacing,0,this.GetWidth() - this.FAutoSizeSpacing,this.GetHeight()))}
               else if (this.FAutoHeight) r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,this.FAutoSizeSpacing,this.GetWidth(),this.GetHeight() - this.FAutoSizeSpacing));
            } else r.$assign(this.GetRect());
            a = g.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FText,this.FWordWrapping,this.FHorizontalTextAlign,this.FVerticalTextAlign,this.FTrimming,0,-1,-1,true,true,X,Y);
            if (a !== "") {
              this.SetControlCursor(21)}
             else this.SetControlCursor(0);
            g.EndScene();
          };
        } finally {
          g = rtl.freeLoc(g);
        };
      };
    };
    this.DoMouseDown = function (Button, Shift, X, Y) {
      var Anchor = "";
      var g = null;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (this.IsHTML()) {
        g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[1,1,false,true]);
        g.FOptimizedHTMLDrawing = this.FOptimizedHTMLDrawing;
        g.FBitmapContainer = this.GetBitmapContainer();
        try {
          if (g.BeginScene()) {
            g.FFont.AssignSource(this.FFont$1);
            if (this.FAutoSize) {
              if (this.FAutoWidth && this.FAutoHeight) {
                r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.FAutoSizeSpacing,this.FAutoSizeSpacing,this.GetWidth() - this.FAutoSizeSpacing,this.GetHeight() - this.FAutoSizeSpacing))}
               else if (this.FAutoWidth) {
                r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.FAutoSizeSpacing,0,this.GetWidth() - this.FAutoSizeSpacing,this.GetHeight()))}
               else if (this.FAutoHeight) r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,this.FAutoSizeSpacing,this.GetWidth(),this.GetHeight() - this.FAutoSizeSpacing));
            } else r.$assign(this.GetRect());
            Anchor = g.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FText,this.FWordWrapping,this.FHorizontalTextAlign,this.FVerticalTextAlign,this.FTrimming,0,-1,-1,true,true,X,Y);
            if (Anchor !== "") this.DoAnchorClick(Anchor);
            g.EndScene();
          };
        } finally {
          g = rtl.freeLoc(g);
        };
      };
    };
    this.UpdateControlAfterResize = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.UpdateControlAfterResize.call(this);
      this.ApplyAutoSize();
    };
    this.IsHTML = function () {
      var Result = false;
      if (!this.FDisplayHTML) {
        Result = false}
       else Result = (pas.System.Pos("</",this.FText) > 0) || (pas.System.Pos("/>",this.FText) > 0) || (pas.System.Pos("<BR>",pas.SysUtils.UpperCase(this.FText)) > 0);
      return Result;
    };
    this.Draw = function (AGraphics, ARect) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Draw.apply(this,arguments);
      AGraphics.FBitmapContainer = this.GetBitmapContainer();
      this.DrawHTMLText(AGraphics);
      if (this.IsDesignTime() && this.CanDrawDesignTime()) AGraphics.DrawFocusRectangle$3(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),0,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("AutoSize",2,rtl.boolean,"FAutoSize","SetAS");
    $r.addProperty("AutoHeight",2,rtl.boolean,"FAutoHeight","SetAutoHeight");
    $r.addProperty("AutoWidth",2,rtl.boolean,"FAutoWidth","SetAutoWidth");
    $r.addProperty("TextIndentMargins",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCMargins"],"FTextIndentMargins","SetTextIndentMargins");
    $r.addProperty("AutoSizeSpacing",2,rtl.double,"FAutoSizeSpacing","SetAutoSizeSpacing");
    $r.addProperty("AutoOpenURL",0,rtl.boolean,"FAutoOpenURL","FAutoOpenURL");
    $r.addProperty("BitmapContainer",3,pas["WEBLib.TMSFNCBitmapContainer"].$rtti["TTMSFNCBitmapContainer"],"GetBitmapContainer","SetBitmapContainer");
    $r.addProperty("DisplayHTML",2,rtl.boolean,"FDisplayHTML","SetDisplayHTML");
    $r.addProperty("Font",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FFont$1","SetFnt");
    $r.addProperty("HorizontalTextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FHorizontalTextAlign","SetHorizontalTextAlign");
    $r.addProperty("Trimming",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextTrimming"],"FTrimming","SetTrimming");
    $r.addProperty("ShadowColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FShadowColor","SetShadowColor");
    $r.addProperty("ShadowOffset",2,rtl.longint,"FShadowOffset","SetShadowOffset");
    $r.addProperty("Fill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFill","SetFill");
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
    $r.addProperty("Text",2,rtl.string,"FText","SetText");
    $r.addProperty("URLColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FURLColor","SetURLColor");
    $r.addProperty("URLUnderline",2,rtl.boolean,"FURLUnderline","SetURLUnderline");
    $r.addProperty("VerticalTextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FVerticalTextAlign","SetVerticalTextAlign");
    $r.addProperty("Version",1,rtl.string,"GetVersion","");
    $r.addProperty("WordWrapping",2,rtl.boolean,"FWordWrapping","SetWordWrapping");
    $r.addProperty("OnAnchorClick",0,$mod.$rtti["TTMSFNCHTMLTextAnchorClickEvent"],"FOnAnchorClick","FOnAnchorClick");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
},["SysUtils","WEBLib.TMSFNCUtils","WEBLib.TMSFNCStyles","WEBLib.Graphics"]);
rtl.module("WEBLib.TMSFNCButton",["System","Classes","WEBLib.StdCtrls","WEBLib.TMSFNCTypes","WEBLib.TMSFNCImage","WEBLib.Controls","WEBLib.TMSFNCHTMLText","WEBLib.TMSFNCBitmapContainer","WEBLib.TMSFNCGraphics","WEBLib.TMSFNCGraphicsTypes"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.MAJ_VER = 1;
  this.MIN_VER = 0;
  this.REL_VER = 1;
  this.BLD_VER = 3;
  rtl.createClass(this,"TTMSFNCButton",pas["WEBLib.StdCtrls"].TWebButton,function () {
    this.$init = function () {
      pas["WEBLib.StdCtrls"].TWebButton.$init.call(this);
      this.FFontChanged = false;
      this.FBlockFontChanged = false;
      this.FOldFontColor = 0;
      this.FOldImageWidth = 0;
      this.FOldImageHeight = 0;
      this.FImage = null;
      this.FText = null;
      this.FShowImage = false;
      this.FBitmapContainer = null;
      this.FBitmap = null;
      this.FBitmapName = "";
      this.FBitmapSize = 0;
      this.FShowText = false;
    };
    this.$final = function () {
      this.FImage = undefined;
      this.FText = undefined;
      this.FBitmapContainer = undefined;
      this.FBitmap = undefined;
      pas["WEBLib.StdCtrls"].TWebButton.$final.call(this);
    };
    this.SetBitmap = function (Value) {
      var shp = null;
      this.FBitmap.Assign(Value);
      shp = this.FImage;
      if (shp != null) shp.FBitmap.Assign(Value);
    };
    this.SetBitmapContainer = function (Value) {
      var shp = null;
      var t = null;
      this.FBitmapContainer = Value;
      shp = this.FImage;
      if (shp != null) shp.SetBitmapContainer(Value);
      t = this.FText;
      if (t != null) t.SetBitmapContainer(Value);
    };
    this.SetBitmapName = function (Value) {
      var shp = null;
      this.FBitmapName = Value;
      shp = this.FImage;
      if (shp != null) {
        shp.FBitmaps.Clear();
        shp.FBitmaps.AddBitmapName(Value,1.0);
      };
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) this.SetShowImage(Value !== "");
    };
    this.SetShowImage = function (Value) {
      var shp = null;
      this.FShowImage = Value;
      shp = this.FImage;
      if (shp != null) {
        this.UpdateInnerHTML();
      };
    };
    this.GetVersion = function () {
      var Result = "";
      var vn = 0;
      vn = pas["WEBLib.TMSFNCUtils"].MakeLong(pas["WEBLib.TMSFNCUtils"].MakeWord(3,1),pas["WEBLib.TMSFNCUtils"].MakeWord(0,1));
      Result = pas.SysUtils.IntToStr((pas["WEBLib.TMSFNCUtils"].Hiword(vn) >> 8) & 0xFF) + "." + pas.SysUtils.IntToStr(pas["WEBLib.TMSFNCUtils"].Hiword(vn) & 0xFF) + "." + pas.SysUtils.IntToStr((pas["WEBLib.TMSFNCUtils"].LoWord(vn) >> 8) & 0xFF) + "." + pas.SysUtils.IntToStr(pas["WEBLib.TMSFNCUtils"].LoWord(vn) & 0xFF);
      return Result;
    };
    this.SetShowText = function (Value) {
      var shp = null;
      this.FShowText = Value;
      shp = this.FText;
      if (shp != null) {
        this.UpdateInnerHTML();
      };
    };
    this.GetFont = function () {
      var Result = null;
      Result = this.FText.FFont$1;
      return Result;
    };
    this.SetFnt = function (Value) {
      this.FText.FFont$1.Assign(Value);
    };
    this.GetWordWrapping = function () {
      var Result = false;
      Result = this.FText.FWordWrapping;
      return Result;
    };
    this.SetWordWrapping = function (Value) {
      this.FText.SetWordWrapping(Value);
      this.UpdateInnerHTML();
    };
    this.GetImageAlign = function () {
      var Result = 0;
      Result = this.FImage.FAlign;
      return Result;
    };
    this.GetTextAlign = function () {
      var Result = 0;
      Result = this.FText.FAlign;
      return Result;
    };
    this.SetImageAlign = function (Value) {
      if (Value === pas["WEBLib.Controls"].TAlign.alClient) {
        this.FOldImageWidth = this.FImage.GetWidth();
        this.FOldImageHeight = this.FImage.GetHeight();
      };
      this.FImage.SetAlign(Value);
      this.SetBitmapSize(this.FBitmapSize);
      if (Value !== pas["WEBLib.Controls"].TAlign.alClient) {
        this.FImage.SetWidth(this.FOldImageWidth);
        this.FImage.SetHeight(this.FOldImageHeight);
      };
      this.UpdateInnerHTML();
    };
    this.SetTextAlign = function (Value) {
      this.FText.SetAlign(Value);
    };
    this.SetBitmapSize = function (Value) {
      this.FBitmapSize = Value;
      this.FImage.SetWidth(Value);
      this.FImage.SetHeight(Value);
      this.FOldImageWidth = this.FImage.GetWidth();
      this.FOldImageHeight = this.FImage.GetHeight();
      this.UpdateInnerHTML();
    };
    this.GetBitmapContainer = function () {
      var Result = null;
      Result = this.FBitmapContainer;
      return Result;
    };
    this.GetText = function () {
      var Result = "";
      var htmltxt = null;
      Result = "";
      htmltxt = this.FText;
      if (htmltxt != null) Result = htmltxt.FText;
      return Result;
    };
    this.ReadOldFontColor = function (Reader) {
      var c = 0;
      c = Reader.ReadInteger();
      this.FOldFontColor = c;
    };
    this.WriteOldFontColor = function (Writer) {
      Writer.WriteInteger$1(this.FOldFontColor);
    };
    this.DoTextFontChanged = function (Sender) {
      if (this.FBlockFontChanged) return;
      this.FFontChanged = true;
    };
    this.DefineProperties = function (Filer) {
      pas.Classes.TComponent.DefineProperties.apply(this,arguments);
      Filer.DefineProperty("OldFontColor",rtl.createCallback(this,"ReadOldFontColor"),rtl.createCallback(this,"WriteOldFontColor"),this.FOldFontColor !== -1);
    };
    this.SetText = function (Value) {
      var htmltxt = null;
      htmltxt = this.FText;
      if (htmltxt != null) htmltxt.SetText(Value);
      this.UpdateInnerHTML();
    };
    this.Notification = function (AComponent, Operation) {
      pas["WEBLib.Menus"].TWebCustomControl.Notification.apply(this,arguments);
      if ((Operation === pas.Classes.TOperation.opRemove) && (AComponent === this.FBitmapContainer)) this.FBitmapContainer = null;
    };
    this.BitmapChanged = function (Sender) {
      var shp = null;
      shp = this.FImage;
      if (shp != null) shp.FBitmap.Assign(this.FBitmap);
      this.UpdateInnerHTML();
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) this.SetShowImage(!pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(this.FBitmap));
    };
    this.SetEnabled = function (Value) {
      pas["WEBLib.Controls"].TControl.SetEnabled.apply(this,arguments);
      if (Value) {
        if (this.FOldFontColor !== -1) {
          this.FText.FFont$1.SetColor(this.FOldFontColor);
          this.FOldFontColor = -1;
        };
      } else {
        if (this.FOldFontColor === -1) this.FOldFontColor = this.FText.FFont$1.FColor;
        this.FText.FFont$1.SetColor(10789024);
      };
      this.Invalidate();
    };
    this.UpdateElementData = function () {
      pas["WEBLib.StdCtrls"].TButton.UpdateElementData.call(this);
      this.UpdateInnerHTML();
    };
    this.UpdateInnerHTML = function () {
      if (this.GetElementHandle() != null) this.GetElementHandle().innerHTML = this.GetHTMLCaption();
    };
    this.ParseHTMLFontTag = function (ATxt) {
      var startPos = 0;
      var endPos = 0;
      var fontTag = "";
      var spanTag = "";
      var family = "";
      var size = "";
      var bgColor = "";
      var color = "";
      while (pas.StrUtils.ContainsText(ATxt.get(),"<font")) {
        startPos = this.PosTag("<font",ATxt.get());
        fontTag = pas.System.Copy(ATxt.get(),startPos,ATxt.get().length - startPos);
        endPos = this.PosTag(">",fontTag);
        fontTag = pas.System.Copy(fontTag,1,endPos);
        family = this.GetAttributeValue("face",fontTag);
        if (family.length > 0) family = "font-family:" + family + ";";
        size = this.GetAttributeValue("size",fontTag);
        if (size.length > 0) size = "font-size:" + size + "px;";
        color = this.GetAttributeValue(" color",fontTag);
        if (color.length > 0) {
          if (pas.System.Pos("gc",color) === 1) color = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.ColorToHTML(pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.TextToColor(color));
          color = "color:" + color + ";";
        };
        bgColor = this.GetAttributeValue("bgcolor",fontTag);
        if (bgColor.length > 0) {
          if (pas.System.Pos("gc",bgColor) === 1) bgColor = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.ColorToHTML(pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.TextToColor(bgColor));
          bgColor = "background-color:" + bgColor + ";";
        };
        spanTag = '<span style="' + family + size + color + bgColor + '">';
        ATxt.set(pas.SysUtils.StringReplace(ATxt.get(),fontTag,spanTag,rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll)));
      };
      ATxt.set(pas.SysUtils.StringReplace(ATxt.get(),"</font>","</span>",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll)));
    };
    this.ParseHTMLImgTag = function (ATxt) {
      var startPos = 0;
      var endPos = 0;
      var attr = "";
      var imgSrc = "";
      var parsed = "";
      var tmp = "";
      var b = null;
      startPos = this.PosTag("<img",ATxt.get());
      if (startPos > 0) {
        parsed = pas.System.Copy(ATxt.get(),startPos + 4,ATxt.get().length - startPos);
        tmp = parsed;
        this.ParseHTMLImgTag({get: function () {
            return parsed;
          }, set: function (v) {
            parsed = v;
          }});
        ATxt.set(pas.SysUtils.StringReplace(ATxt.get(),tmp,parsed,rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll)));
        endPos = this.PosTag(">",parsed);
        parsed = pas.System.Copy(parsed,1,endPos);
        attr = this.GetAttributeValue("src",parsed);
        if (attr !== "") {
          if (this.FBitmapContainer != null) {
            b = this.FBitmapContainer.FindBitmap$1(attr);
            if (b != null) {
              imgSrc = b.Image().src;
              if (imgSrc !== "") ATxt.set(pas.SysUtils.StringReplace(ATxt.get(),attr,imgSrc,rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll)));
            };
          };
        };
      };
    };
    this.PosTag = function (ATag, ATxt) {
      var Result = 0;
      ATag = pas.SysUtils.UpperCase(ATag);
      ATxt = pas.SysUtils.UpperCase(ATxt);
      Result = pas.System.Pos(ATag,ATxt);
      return Result;
    };
    this.GetHTMLCaption = function () {
      var Result = "";
      var img = "";
      var txt = "";
      var wordw = "";
      var disabled = "";
      var imgwh = 0;
      var bmph = 0;
      var bmpw = 0;
      var htmltxt = null;
      var bmp = null;
      var el = null;
      Result = "";
      img = "";
      txt = "";
      disabled = "";
      if (!this.FEnabled) disabled = "disabled";
      wordw = "";
      if (!this.GetWordWrapping()) {
        wordw = "text-overflow:clip; overflow:hidden; white-space:nowrap;"}
       else wordw = "white-space:break-spaces";
      bmpw = 0;
      bmph = 0;
      el = this.GetElementHandle();
      function property(e, p) {
            return parseInt(window.getComputedStyle(e, null).getPropertyValue(p));
          }
      
          var paddingTop = property(el, 'padding-top');
          var paddingBottom = property(el, 'padding-bottom');
          var paddingLeft = property(el, 'padding-left');
          var paddingRight = property(el, 'padding-right');
          bmpw = el.clientHeight - paddingTop - paddingBottom;
          bmph = el.clientWidth - paddingLeft - paddingRight;
      imgwh = 0;
      if (this.FShowImage) imgwh = this.FBitmapSize;
      htmltxt = this.FText;
      if (htmltxt != null) {
        txt = htmltxt.FText;
        this.ParseHTMLFontTag({get: function () {
            return txt;
          }, set: function (v) {
            txt = v;
          }});
        this.ParseHTMLImgTag({get: function () {
            return txt;
          }, set: function (v) {
            txt = v;
          }});
      };
      bmp = this.FImage.GetBitmap();
      if (bmp != null) img = bmp.Image().src;
      var $tmp = this.FImage.FAlign;
      if ($tmp === pas["WEBLib.Controls"].TAlign.alClient) {
        img = '<img id="test_id" src="' + img + '" style="max-width:' + pas.SysUtils.IntToStr(bmpw) + "px; max-height:" + pas.SysUtils.IntToStr(bmph) + 'px; width:auto; height:auto; display:inline-block;" />';
        txt = '<span style="display:inline-block; vertical-align:middle; width:calc(100% - ' + pas.SysUtils.IntToStr(imgwh) + "px); " + wordw + disabled + '">' + txt + "</span>";
      } else if (($tmp === pas["WEBLib.Controls"].TAlign.alLeft) || ($tmp === pas["WEBLib.Controls"].TAlign.alRight)) {
        bmpw = Math.min(this.FBitmapSize,bmpw);
        img = '<img id="test_id" src="' + img + '" style="max-width:' + pas.SysUtils.IntToStr(this.FBitmapSize) + "px; max-height:" + pas.SysUtils.IntToStr(bmpw) + 'px; width:auto; height:auto; display:inline-block; vertical-align: middle;" />';
        txt = '<span style="display:inline-block; vertical-align:middle; width:calc(100% - ' + pas.SysUtils.IntToStr(imgwh) + "px); " + wordw + disabled + '">' + txt + "</span>";
      } else if (($tmp === pas["WEBLib.Controls"].TAlign.alTop) || ($tmp === pas["WEBLib.Controls"].TAlign.alBottom)) {
        bmph = Math.min(this.FBitmapSize,bmph);
        img = '<img src="' + img + '" style="max-width:' + pas.SysUtils.IntToStr(bmph) + "px; max-height:" + pas.SysUtils.IntToStr(this.FBitmapSize) + 'px; width:auto; height:auto; display:inline-block;" />';
        txt = '<div style="position:relative; height:calc(100% - ' + pas.SysUtils.IntToStr(imgwh) + 'px)"><span style="position:absolute; left:50%; top:50%; transform:translate(-50%, -50%);' + wordw + disabled + '">' + txt + "</span></div>";
      } else if ($tmp === pas["WEBLib.Controls"].TAlign.alNone) txt = '<span style="display:inline-block; vertical-align:middle; width:100%; ' + wordw + disabled + '">' + txt + "</span>";
      var $tmp1 = this.FImage.FAlign;
      if (($tmp1 === pas["WEBLib.Controls"].TAlign.alLeft) || ($tmp1 === pas["WEBLib.Controls"].TAlign.alTop)) {
        if (this.FShowImage) Result = img;
        if (this.FShowText) Result = Result + txt;
      } else if (($tmp1 === pas["WEBLib.Controls"].TAlign.alRight) || ($tmp1 === pas["WEBLib.Controls"].TAlign.alBottom)) {
        if (this.FShowText) Result = txt;
        if (this.FShowImage) Result = Result + img;
      } else if ($tmp1 === pas["WEBLib.Controls"].TAlign.alClient) {
        if (this.FShowImage) Result = img;
      } else if ($tmp1 === pas["WEBLib.Controls"].TAlign.alNone) {
        if (this.FShowText) Result = txt;
      };
      return Result;
    };
    this.GetAttributeValue = function (AAttribute, ATxt) {
      var Result = "";
      var posStart = 0;
      var posEnd = 0;
      var tmp = "";
      Result = "";
      posStart = this.PosTag(AAttribute,ATxt);
      if (posStart > 0) {
        tmp = pas.System.Copy(ATxt,posStart + AAttribute.length + 2,ATxt.length - posStart);
        posEnd = this.PosTag('"',tmp);
        Result = pas.System.Copy(tmp,1,posEnd - 1);
      };
      return Result;
    };
    this.Loaded = function () {
      pas["WEBLib.Controls"].TCustomControl.Loaded.call(this);
    };
    this.HTMLText = function () {
      var Result = null;
      Result = this.FText;
      return Result;
    };
    this.Image = function () {
      var Result = null;
      Result = this.FImage;
      return Result;
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.Controls"].TControl.Create$1.apply(this,arguments);
      this.FImage = pas["WEBLib.TMSFNCImage"].TTMSFNCImage.$create("Create$1",[this]);
      this.FImage.FTransparent = true;
      this.FImage.DisableBackground();
      this.FImage.FHitTest = false;
      this.FImage.SetAllowFocus(false);
      this.FImage.SetAlign(pas["WEBLib.Controls"].TAlign.alLeft);
      this.FImage.FMargins.SetLeft(2);
      this.FImage.FMargins.SetRight(2);
      this.FImage.FMargins.SetTop(2);
      this.FImage.FMargins.SetBottom(2);
      this.FImage.SetWidth(30);
      this.FImage.FStored = false;
      this.FImage.SetParent(null);
      this.FBitmapSize = 30;
      this.FText = pas["WEBLib.TMSFNCHTMLText"].TTMSFNCHTMLText.$create("Create$1",[this]);
      this.FText.FOnInternalFontChanged = rtl.createCallback(this,"DoTextFontChanged");
      this.FText.SetAllowFocus(false);
      this.FText.FTransparent = true;
      this.FText.DisableBackground();
      this.FText.FHitTest = false;
      this.FText.SetAlign(pas["WEBLib.Controls"].TAlign.alClient);
      this.FText.FMargins.SetLeft(2);
      this.FText.FMargins.SetRight(2);
      this.FText.FMargins.SetTop(2);
      this.FText.FMargins.SetBottom(2);
      this.FText.SetParent(this);
      this.FText.FStored = false;
      this.FOldFontColor = -1;
      this.FShowImage = false;
      this.FShowText = true;
      this.FBitmap = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      this.FBitmap.FOnChange = rtl.createCallback(this,"BitmapChanged");
      this.SetWidth(100);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FBitmap");
      rtl.free(this,"FImage");
      rtl.free(this,"FText");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("ImageAlign",3,pas["WEBLib.Controls"].$rtti["TAlign"],"GetImageAlign","SetImageAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alLeft});
    $r.addProperty("TextAlign",3,pas["WEBLib.Controls"].$rtti["TAlign"],"GetTextAlign","SetTextAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alClient});
    $r.addProperty("BitmapContainer",3,pas["WEBLib.TMSFNCBitmapContainer"].$rtti["TTMSFNCBitmapContainer"],"GetBitmapContainer","SetBitmapContainer");
    $r.addProperty("Bitmap",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FBitmap","SetBitmap");
    $r.addProperty("BitmapName",2,rtl.string,"FBitmapName","SetBitmapName");
    $r.addProperty("BitmapSize",2,rtl.longint,"FBitmapSize","SetBitmapSize",4,{Default: 30});
    $r.addProperty("ShowImage",2,rtl.boolean,"FShowImage","SetShowImage",4,{Default: false});
    $r.addProperty("ShowText",2,rtl.boolean,"FShowText","SetShowText",4,{Default: true});
    $r.addProperty("Version",1,rtl.string,"GetVersion","");
    $r.addProperty("Font",3,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"GetFont","SetFnt");
    $r.addProperty("WordWrapping",3,rtl.boolean,"GetWordWrapping","SetWordWrapping",4,{Default: false});
    $r.addProperty("Text",3,rtl.string,"GetText","SetText");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
  $mod.$implcode = function () {
    rtl.createClass($impl,"TTMSFNCImageOpen",pas["WEBLib.TMSFNCImage"].TTMSFNCImage,function () {
      rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
      rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
      rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
      rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
      rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
      rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
      rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
      rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
      rtl.addIntf(this,pas.System.IUnknown);
    });
    rtl.createClass($impl,"TTMSFNCHTMLTextOpen",pas["WEBLib.TMSFNCHTMLText"].TTMSFNCHTMLText,function () {
      rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
      rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
      rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
      rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
      rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
      rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
      rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
      rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
      rtl.addIntf(this,pas.System.IUnknown);
    });
  };
},["WEBLib.TMSFNCUtils","WEBLib.Forms","SysUtils","Web","Math","StrUtils"]);
rtl.module("TMS.TMSFNCValue",["System","Classes","SysUtils","RTTI","Math"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.MAJ_VER = 1;
  this.MIN_VER = 0;
  this.REL_VER = 0;
  this.BLD_VER = 1;
  rtl.createHelper(this,"TTMSFNCValueHelper",null,function () {
    this.Equals = function (Value, AFormatSettings) {
      var Result = false;
      Result = $mod.CompareFNCValue$1(this.get(),Value,pas.SysUtils.TFormatSettings.$clone(AFormatSettings),pas.System.TTypeKind.tkUnknown) === 0;
      return Result;
    };
  });
  this.TValueToFNCValue = function (AValue) {
    var Result = undefined;
    Result = AValue.AsJSValue();
    return Result;
  };
  this.FNCValueToTValue = function (AValue) {
    var Result = pas.RTTI.TValue.$new();
    if (pas.System.Assigned(AValue)) {
      Result.$assign(pas.RTTI.TValue.FromJSValue(AValue))}
     else Result.$assign(pas.RTTI.TValue.Empty());
    return Result;
  };
  this.TypeOfValue = function (AValue) {
    var Result = 0;
    var v = pas.RTTI.TValue.$new();
    Result = pas.System.TTypeKind.tkUnknown;
    v.$assign($mod.FNCValueToTValue(AValue));
    if (v.GetIsEmpty()) return Result;
    Result = v.GetTypeKind();
    return Result;
  };
  this.ValueIsEmpty = function (AValue) {
    var Result = false;
    var v = pas.RTTI.TValue.$new();
    v.$assign($mod.FNCValueToTValue(AValue));
    Result = v.GetIsEmpty();
    return Result;
  };
  this.ValueIsFloat = function (AValue) {
    var Result = false;
    Result = $mod.TypeOfValue(AValue) in rtl.createSet(pas.System.TTypeKind.tkDouble);
    return Result;
  };
  this.ValueIsDateTime = function (AValue) {
    var Result = false;
    Result = $mod.ValueIsDateTime$1(AValue,pas.SysUtils.TFormatSettings.$clone(pas.SysUtils.FormatSettings));
    return Result;
  };
  this.ValueIsDateTime$1 = function (AValue, AFormatSettings) {
    var Result = false;
    var dt = 0.0;
    Result = $mod.ValueIsDateTimeType(AValue) || ($mod.ValueIsString(AValue) && pas.SysUtils.TryStrToDateTime$1($mod.ValueToString(AValue),{get: function () {
        return dt;
      }, set: function (v) {
        dt = v;
      }},AFormatSettings));
    return Result;
  };
  this.ValueIsDateTimeType = function (AValue) {
    var Result = false;
    Result = $mod.ValueIsFloat(AValue);
    return Result;
  };
  this.ValueIsInteger = function (AValue) {
    var Result = false;
    Result = $mod.TypeOfValue(AValue) in rtl.createSet(pas.System.TTypeKind.tkEnumeration,pas.System.TTypeKind.tkInteger,pas.System.TTypeKind.tkBool);
    return Result;
  };
  this.ValueIsString = function (AValue) {
    var Result = false;
    Result = $mod.TypeOfValue(AValue) in rtl.createSet(pas.System.TTypeKind.tkString);
    return Result;
  };
  this.ValueToBoolean = function (AValue) {
    var Result = false;
    Result = $mod.ValueToBoolean$1(AValue,pas.SysUtils.TFormatSettings.$clone(pas.SysUtils.FormatSettings));
    return Result;
  };
  this.ValueToBoolean$1 = function (AValue, AFormatSettings) {
    var Result = false;
    Result = $mod.ValueToInteger$1(AValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)) !== 0;
    return Result;
  };
  this.ValueToDateTime = function (AValue) {
    var Result = 0.0;
    Result = $mod.ValueToDateTime$1(AValue,pas.SysUtils.TFormatSettings.$clone(pas.SysUtils.FormatSettings));
    return Result;
  };
  this.ValueToDateTime$1 = function (AValue, AFormatSettings) {
    var Result = 0.0;
    var I64 = 0;
    var I = 0;
    var D = 0.0;
    var v = pas.RTTI.TValue.$new();
    var B = false;
    var dt = 0.0;
    Result = 0.0;
    v.$assign($mod.FNCValueToTValue(AValue));
    if (v.GetIsEmpty()) return Result;
    var $tmp = v.GetTypeKind();
    if ($tmp === pas.System.TTypeKind.tkEnumeration) {
      if (v.TryAsType$$$G$$rtti$$Boolean({get: function () {
          return B;
        }, set: function (v) {
          B = v;
        }},true)) Result = (B ? 1 : 0);
    } else if ($tmp === pas.System.TTypeKind.tkInteger) {
      if (v.TryAsType$$$G$$rtti$$Longint({get: function () {
          return I;
        }, set: function (v) {
          I = v;
        }},true)) Result = I;
    } else if ($tmp === pas.System.TTypeKind.tkDouble) {
      if (v.TryAsType$$$G$$rtti$$Double({get: function () {
          return D;
        }, set: function (v) {
          D = v;
        }},true)) Result = D;
    } else if ($tmp === pas.System.TTypeKind.tkBool) {
      if (v.TryAsType$$$G$$rtti$$Boolean({get: function () {
          return B;
        }, set: function (v) {
          B = v;
        }},true)) Result = (B ? 1 : 0);
    } else if ($tmp === pas.System.TTypeKind.tkString) {
      if (pas.SysUtils.TryStrToInt(pas.SysUtils.Trim(v.AsString()),{get: function () {
          return I;
        }, set: function (v) {
          I = v;
        }})) {
        Result = I}
       else if (pas.SysUtils.TryStrToInt64(pas.SysUtils.Trim(v.AsString()),{get: function () {
          return I64;
        }, set: function (v) {
          I64 = v;
        }})) {
        Result = I64}
       else if (pas.SysUtils.TryStrToFloat$3(pas.SysUtils.Trim(v.AsString()),{get: function () {
          return D;
        }, set: function (v) {
          D = v;
        }},AFormatSettings)) {
        Result = D}
       else if (pas.SysUtils.TryStrToDateTime$1(pas.SysUtils.Trim(v.AsString()),{get: function () {
          return dt;
        }, set: function (v) {
          dt = v;
        }},AFormatSettings)) {
        Result = dt}
       else if (pas.SysUtils.TryStrToBool(pas.SysUtils.Trim(v.AsString()),{get: function () {
          return B;
        }, set: function (v) {
          B = v;
        }})) Result = (B ? 1 : 0);
    };
    return Result;
  };
  this.ValueToFloat = function (AValue) {
    var Result = 0.0;
    Result = $mod.ValueToFloat$1(AValue,pas.SysUtils.TFormatSettings.$clone(pas.SysUtils.FormatSettings));
    return Result;
  };
  this.ValueToFloat$1 = function (AValue, AFormatSettings) {
    var Result = 0.0;
    var I64 = 0;
    var I = 0;
    var D = 0.0;
    var v = pas.RTTI.TValue.$new();
    var B = false;
    Result = 0.0;
    v.$assign($mod.FNCValueToTValue(AValue));
    if (v.GetIsEmpty()) return Result;
    var $tmp = v.GetTypeKind();
    if ($tmp === pas.System.TTypeKind.tkEnumeration) {
      if (v.TryAsType$$$G$$rtti$$Boolean({get: function () {
          return B;
        }, set: function (v) {
          B = v;
        }},true)) Result = (B ? 1 : 0);
    } else if ($tmp === pas.System.TTypeKind.tkInteger) {
      if (v.TryAsType$$$G$$rtti$$Longint({get: function () {
          return I;
        }, set: function (v) {
          I = v;
        }},true)) Result = I;
    } else if ($tmp === pas.System.TTypeKind.tkDouble) {
      if (v.TryAsType$$$G$$rtti$$Double({get: function () {
          return D;
        }, set: function (v) {
          D = v;
        }},true)) Result = D;
    } else if ($tmp === pas.System.TTypeKind.tkBool) {
      if (v.TryAsType$$$G$$rtti$$Boolean({get: function () {
          return B;
        }, set: function (v) {
          B = v;
        }},true)) Result = (B ? 1 : 0);
    } else if ($tmp === pas.System.TTypeKind.tkString) {
      if (pas.SysUtils.TryStrToInt(v.AsString(),{get: function () {
          return I;
        }, set: function (v) {
          I = v;
        }})) {
        Result = I}
       else if (pas.SysUtils.TryStrToInt64(v.AsString(),{get: function () {
          return I64;
        }, set: function (v) {
          I64 = v;
        }})) {
        Result = I64}
       else if (pas.SysUtils.TryStrToFloat$3(v.AsString(),{get: function () {
          return D;
        }, set: function (v) {
          D = v;
        }},AFormatSettings)) {
        Result = D}
       else if (pas.SysUtils.TryStrToBool(v.AsString(),{get: function () {
          return B;
        }, set: function (v) {
          B = v;
        }})) Result = (B ? 1 : 0);
    };
    return Result;
  };
  this.ValueToInt64 = function (AValue) {
    var Result = 0;
    Result = $mod.ValueToInt64$1(AValue,pas.SysUtils.TFormatSettings.$clone(pas.SysUtils.FormatSettings));
    return Result;
  };
  this.ValueToInt64$1 = function (AValue, AFormatSettings) {
    var Result = 0;
    var I64 = 0;
    var I = 0;
    var D = 0.0;
    var v = pas.RTTI.TValue.$new();
    var B = false;
    Result = 0;
    v.$assign($mod.FNCValueToTValue(AValue));
    if (v.GetIsEmpty()) return Result;
    var $tmp = v.GetTypeKind();
    if ($tmp === pas.System.TTypeKind.tkEnumeration) {
      if (v.TryAsType$$$G$$rtti$$Boolean({get: function () {
          return B;
        }, set: function (v) {
          B = v;
        }},true)) Result = (B ? 1 : 0);
    } else if ($tmp === pas.System.TTypeKind.tkInteger) {
      if (v.TryAsType$$$G$$rtti$$Longint({get: function () {
          return I;
        }, set: function (v) {
          I = v;
        }},true)) Result = I;
    } else if ($tmp === pas.System.TTypeKind.tkDouble) {
      if (v.TryAsType$$$G$$rtti$$Double({get: function () {
          return D;
        }, set: function (v) {
          D = v;
        }},true)) Result = Math.round(D);
    } else if ($tmp === pas.System.TTypeKind.tkBool) {
      if (v.TryAsType$$$G$$rtti$$Boolean({get: function () {
          return B;
        }, set: function (v) {
          B = v;
        }},true)) Result = (B ? 1 : 0);
    } else if ($tmp === pas.System.TTypeKind.tkString) {
      if (pas.SysUtils.TryStrToInt(v.AsString(),{get: function () {
          return I;
        }, set: function (v) {
          I = v;
        }})) {
        Result = I}
       else if (pas.SysUtils.TryStrToInt64(v.AsString(),{get: function () {
          return I64;
        }, set: function (v) {
          I64 = v;
        }})) {
        Result = I64}
       else if (pas.SysUtils.TryStrToFloat$3(v.AsString(),{get: function () {
          return D;
        }, set: function (v) {
          D = v;
        }},AFormatSettings)) {
        Result = Math.round(D)}
       else if (pas.SysUtils.TryStrToBool(v.AsString(),{get: function () {
          return B;
        }, set: function (v) {
          B = v;
        }})) Result = (B ? 1 : 0);
    };
    return Result;
  };
  this.ValueToInteger = function (AValue) {
    var Result = 0;
    Result = $mod.ValueToInteger$1(AValue,pas.SysUtils.TFormatSettings.$clone(pas.SysUtils.FormatSettings));
    return Result;
  };
  this.ValueToInteger$1 = function (AValue, AFormatSettings) {
    var Result = 0;
    var v = 0;
    Result = 0;
    v = $mod.ValueToInt64$1(AValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings));
    if ((v <= 2147483647) && (v >= -2147483647)) Result = v;
    return Result;
  };
  this.ValueToString = function (AValue) {
    var Result = "";
    Result = $mod.ValueToString$1(AValue,pas.SysUtils.TFormatSettings.$clone(pas.SysUtils.FormatSettings));
    return Result;
  };
  this.ValueToString$1 = function (AValue, AFormatSettings) {
    var Result = "";
    var D = 0.0;
    var v = pas.RTTI.TValue.$new();
    var I = 0;
    var B = false;
    var l = null;
    Result = "";
    v.$assign($mod.FNCValueToTValue(AValue));
    if (v.GetIsEmpty()) return Result;
    var $tmp = v.GetTypeKind();
    if ($tmp === pas.System.TTypeKind.tkEnumeration) {
      if (v.TryAsType$$$G$$rtti$$Boolean({get: function () {
          return B;
        }, set: function (v) {
          B = v;
        }},true)) Result = pas.SysUtils.BoolToStr(B,true);
    } else if ($tmp === pas.System.TTypeKind.tkInteger) {
      if (v.TryAsType$$$G$$rtti$$Longint({get: function () {
          return I;
        }, set: function (v) {
          I = v;
        }},true)) Result = pas.SysUtils.IntToStr(I);
    } else if ($tmp === pas.System.TTypeKind.tkDouble) {
      if (v.TryAsType$$$G$$rtti$$Double({get: function () {
          return D;
        }, set: function (v) {
          D = v;
        }},true)) {
        Result = pas.SysUtils.FloatToStr$1(D,AFormatSettings);
      };
    } else if ($tmp === pas.System.TTypeKind.tkBool) {
      if (v.TryAsType$$$G$$rtti$$Boolean({get: function () {
          return B;
        }, set: function (v) {
          B = v;
        }},true)) Result = pas.SysUtils.BoolToStr(B,true);
    } else if ($tmp === pas.System.TTypeKind.tkString) {
      Result = v.AsString()}
     else if ($tmp === pas.System.TTypeKind.tkClass) {
      if (v.TryAsType$$$G$$rtti$$TStrings({get: function () {
          return l;
        }, set: function (v) {
          l = v;
        }},true)) {
        Result = l.GetTextStr()}
       else Result = v.ToString();
    } else {
      Result = v.ToString();
    };
    return Result;
  };
  this.IsFNCValueEqual = function (AValue1, AValue2, ATypeKind) {
    var Result = false;
    Result = $mod.CompareFNCValue$1(AValue1,AValue2,pas.SysUtils.TFormatSettings.$clone(pas.SysUtils.FormatSettings),ATypeKind) === 0;
    return Result;
  };
  this.IsFNCValueEqual$1 = function (AValue1, AValue2, AFormatSettings, ATypeKind) {
    var Result = false;
    Result = $mod.CompareFNCValue$1(AValue1,AValue2,pas.SysUtils.TFormatSettings.$clone(AFormatSettings),ATypeKind) === 0;
    return Result;
  };
  this.CompareFNCValue = function (AValue1, AValue2, ATypeKind) {
    var Result = 0;
    Result = $mod.CompareFNCValue$1(AValue1,AValue2,pas.SysUtils.TFormatSettings.$clone(pas.SysUtils.FormatSettings),ATypeKind);
    return Result;
  };
  this.CompareFNCValue$1 = function (AValue1, AValue2, AFormatSettings, ATypeKind) {
    var Result = 0;
    var v1 = pas.RTTI.TValue.$new();
    var v2 = pas.RTTI.TValue.$new();
    var d1 = 0.0;
    var d2 = 0.0;
    var I641 = 0;
    var I642 = 0;
    var i1 = 0;
    var i2 = 0;
    var dt1 = 0.0;
    var dt2 = 0.0;
    if ($mod.ValueIsEmpty(AValue1) && $mod.ValueIsEmpty(AValue2)) {
      Result = 0}
     else if ($mod.ValueIsEmpty(AValue1)) {
      Result = -1}
     else if ($mod.ValueIsEmpty(AValue2)) {
      Result = 1}
     else {
      if ($impl.ValueIsBoolean(AValue1) && $impl.ValueIsBoolean(AValue2)) {
        if ($mod.ValueToBoolean(AValue1) === $mod.ValueToBoolean(AValue2)) {
          Result = 0}
         else if ($mod.ValueToBoolean(AValue1)) {
          Result = 1}
         else Result = -1;
      } else if ($mod.ValueIsInteger(AValue1) && $mod.ValueIsInteger(AValue2)) {
        Result = pas.Math.CompareValue$1($mod.ValueToInt64$1(AValue1,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),$mod.ValueToInt64$1(AValue2,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)))}
       else if ($mod.ValueIsFloat(AValue1) && $mod.ValueIsFloat(AValue2)) {
        if ($mod.ValueIsDateTime$1(AValue1,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)) && $mod.ValueIsDateTime$1(AValue2,pas.SysUtils.TFormatSettings.$clone(AFormatSettings))) {
          Result = pas.DateUtils.CompareDateTime($mod.ValueToFloat$1(AValue1,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),$mod.ValueToFloat$1(AValue2,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)))}
         else Result = pas.Math.CompareValue$3($mod.ValueToFloat$1(AValue1,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),$mod.ValueToFloat$1(AValue2,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),0.0);
      } else if ($mod.ValueIsString(AValue1) && $mod.ValueIsString(AValue2)) {
        v1.$assign($mod.FNCValueToTValue(AValue1));
        v2.$assign($mod.FNCValueToTValue(AValue2));
        if (pas.SysUtils.TryStrToFloat$3(v1.AsString(),{get: function () {
            return d1;
          }, set: function (v) {
            d1 = v;
          }},AFormatSettings) && pas.SysUtils.TryStrToFloat$3(v2.AsString(),{get: function () {
            return d2;
          }, set: function (v) {
            d2 = v;
          }},AFormatSettings)) {
          Result = pas.Math.CompareValue$3(d1,d2,0.0)}
         else if (pas.SysUtils.TryStrToInt64(v1.AsString(),{get: function () {
            return I641;
          }, set: function (v) {
            I641 = v;
          }}) && pas.SysUtils.TryStrToInt64(v2.AsString(),{get: function () {
            return I642;
          }, set: function (v) {
            I642 = v;
          }})) {
          Result = pas.Math.CompareValue$1(I641,I642)}
         else if (pas.SysUtils.TryStrToInt(v1.AsString(),{get: function () {
            return i1;
          }, set: function (v) {
            i1 = v;
          }}) && pas.SysUtils.TryStrToInt(v2.AsString(),{get: function () {
            return i2;
          }, set: function (v) {
            i2 = v;
          }})) {
          Result = pas.Math.CompareValue(i1,i2)}
         else if (pas.SysUtils.TryStrToDateTime$1(v1.AsString(),{get: function () {
            return dt1;
          }, set: function (v) {
            dt1 = v;
          }},AFormatSettings) && pas.SysUtils.TryStrToDateTime$1(v2.AsString(),{get: function () {
            return dt2;
          }, set: function (v) {
            dt2 = v;
          }},AFormatSettings)) {
          Result = pas.DateUtils.CompareDateTime(dt1,dt2)}
         else Result = pas.SysUtils.CompareStr($mod.ValueToString(AValue1),$mod.ValueToString(AValue2));
      } else {
        v1.$assign($mod.FNCValueToTValue(AValue1));
        v2.$assign($mod.FNCValueToTValue(AValue2));
        Result = pas.SysUtils.CompareStr(v1.ToString(),v2.ToString());
      };
    };
    return Result;
  };
  this.TextToFNCValue = function (AValueText) {
    var Result = undefined;
    Result = $mod.TextToFNCValue$1(AValueText,pas.SysUtils.TFormatSettings.$clone(pas.SysUtils.FormatSettings));
    return Result;
  };
  this.TextToFNCValue$1 = function (AValueText, AFormatSettings) {
    var Result = undefined;
    var v = undefined;
    var d = 0.0;
    var dt = 0.0;
    var i64 = 0;
    var i = 0;
    var b = false;
    if (pas.SysUtils.TryStrToInt(pas.SysUtils.Trim(AValueText),{get: function () {
        return i;
      }, set: function (v) {
        i = v;
      }})) {
      v = i}
     else if (pas.SysUtils.TryStrToInt64(pas.SysUtils.Trim(AValueText),{get: function () {
        return i64;
      }, set: function (v) {
        i64 = v;
      }})) {
      v = i64}
     else if (pas.SysUtils.TryStrToFloat$3(pas.SysUtils.Trim(AValueText),{get: function () {
        return d;
      }, set: function (v) {
        d = v;
      }},AFormatSettings)) {
      v = d}
     else if (pas.SysUtils.TryStrToDateTime$1(pas.SysUtils.Trim(AValueText),{get: function () {
        return dt;
      }, set: function (v) {
        dt = v;
      }},AFormatSettings)) {
      v = dt}
     else if (pas.SysUtils.TryStrToBool(pas.SysUtils.Trim(AValueText),{get: function () {
        return b;
      }, set: function (v) {
        b = v;
      }})) {
      v = b}
     else v = AValueText;
    Result = v;
    return Result;
  };
  this.FNCValueToString = function (AValue) {
    var Result = "";
    Result = $mod.FNCValueToString$1(AValue,pas.SysUtils.TFormatSettings.$clone(pas.SysUtils.FormatSettings));
    return Result;
  };
  this.FNCValueToString$1 = function (AValue, AFormatSettings) {
    var Result = "";
    var v = pas.RTTI.TValue.$new();
    var d = 0.0;
    var dt = 0.0;
    var i64 = 0;
    var i = 0;
    var b = false;
    Result = "";
    if ($impl.ValueIsBoolean(AValue)) {
      Result = pas.SysUtils.BoolToStr($mod.ValueToBoolean$1(AValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),true)}
     else if ($mod.ValueIsInteger(AValue)) {
      Result = pas.SysUtils.IntToStr($mod.ValueToInt64$1(AValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)))}
     else if ($mod.ValueIsFloat(AValue)) {
      if ($mod.ValueIsDateTime$1(AValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings))) {
        Result = pas.SysUtils.DateTimeToStr($mod.ValueToDateTime$1(AValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),false)}
       else Result = pas.SysUtils.FloatToStr$1($mod.ValueToFloat$1(AValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),AFormatSettings);
    } else if ($mod.ValueIsString(AValue)) {
      v.$assign($mod.FNCValueToTValue(AValue));
      if (pas.SysUtils.TryStrToDate$1(pas.SysUtils.Trim(v.AsString()),{get: function () {
          return dt;
        }, set: function (v) {
          dt = v;
        }},AFormatSettings)) {
        Result = pas.SysUtils.DateToStr$1(dt,AFormatSettings)}
       else if (pas.SysUtils.TryStrToTime$1(pas.SysUtils.Trim(v.AsString()),{get: function () {
          return dt;
        }, set: function (v) {
          dt = v;
        }},pas.SysUtils.TFormatSettings.$clone(AFormatSettings))) {
        Result = pas.SysUtils.TimeToStr$1(dt,AFormatSettings)}
       else if (pas.SysUtils.TryStrToDateTime$1(pas.SysUtils.Trim(v.AsString()),{get: function () {
          return dt;
        }, set: function (v) {
          dt = v;
        }},AFormatSettings)) {
        Result = pas.SysUtils.DateTimeToStr$1(dt,AFormatSettings,false)}
       else if (pas.SysUtils.TryStrToFloat$3(pas.SysUtils.Trim(v.AsString()),{get: function () {
          return d;
        }, set: function (v) {
          d = v;
        }},AFormatSettings)) {
        Result = pas.SysUtils.FloatToStr$1(d,AFormatSettings)}
       else if (pas.SysUtils.TryStrToInt64(pas.SysUtils.Trim(v.AsString()),{get: function () {
          return i64;
        }, set: function (v) {
          i64 = v;
        }})) {
        Result = pas.SysUtils.IntToStr(i64)}
       else if (pas.SysUtils.TryStrToInt(pas.SysUtils.Trim(v.AsString()),{get: function () {
          return i;
        }, set: function (v) {
          i = v;
        }})) {
        Result = pas.SysUtils.IntToStr(i)}
       else if (pas.SysUtils.TryStrToBool(pas.SysUtils.Trim(v.AsString()),{get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }})) {
        Result = pas.SysUtils.BoolToStr(b,false)}
       else Result = v.ToString();
    };
    return Result;
  };
  this.GetEmptyFNCValue = function () {
    var Result = undefined;
    Result = $mod.TValueToFNCValue(pas.RTTI.TValue.$clone(pas.RTTI.TValue.Empty()));
    return Result;
  };
  $mod.$implcode = function () {
    $impl.ValueIsBoolean = function (AValue) {
      var Result = false;
      Result = $mod.TypeOfValue(AValue) in rtl.createSet(pas.System.TTypeKind.tkEnumeration,pas.System.TTypeKind.tkBool);
      return Result;
    };
  };
},["TypInfo","DateUtils"]);
rtl.module("TMS.TMSFNCFilterBuilder",["System","Classes","TMS.TMSFNCValue","Generics.Collections","SysUtils","RTTI"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.MAJ_VER = 1;
  this.MIN_VER = 0;
  this.REL_VER = 0;
  this.BLD_VER = 4;
  this.TTMSFNCFilterBuilderDataType = {"0": "fdtAutomatic", fdtAutomatic: 0, "1": "fdtText", fdtText: 1, "2": "fdtBoolean", fdtBoolean: 2, "3": "fdtDateTime", fdtDateTime: 3, "4": "fdtDate", fdtDate: 4, "5": "fdtTime", fdtTime: 5, "6": "fdtFloat", fdtFloat: 6, "7": "fdtNumber", fdtNumber: 7, "8": "fdtOther", fdtOther: 8};
  this.$rtti.$Enum("TTMSFNCFilterBuilderDataType",{minvalue: 0, maxvalue: 8, ordtype: 1, enumtype: this.TTMSFNCFilterBuilderDataType});
  this.TTMSFNCFilterBuilderGroupOperator = {"0": "fgoAND", fgoAND: 0, "1": "fgoOR", fgoOR: 1};
  this.$rtti.$Enum("TTMSFNCFilterBuilderGroupOperator",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCFilterBuilderGroupOperator});
  this.TTMSFNCFilterBuilderExpressionOperator = {"0": "feoStartsWith", feoStartsWith: 0, "1": "feoEndsWith", feoEndsWith: 1, "2": "feoContains", feoContains: 2, "3": "feoEqual", feoEqual: 3, "4": "feoNotEqual", feoNotEqual: 4, "5": "feoEmpty", feoEmpty: 5, "6": "feoNotEmpty", feoNotEmpty: 6, "7": "feoLargerThan", feoLargerThan: 7, "8": "feoSmallerThan", feoSmallerThan: 8, "9": "feoLargerThanOrEqual", feoLargerThanOrEqual: 9, "10": "feoSmallerThanOrEqual", feoSmallerThanOrEqual: 10};
  this.$rtti.$Enum("TTMSFNCFilterBuilderExpressionOperator",{minvalue: 0, maxvalue: 10, ordtype: 1, enumtype: this.TTMSFNCFilterBuilderExpressionOperator});
  this.DefaultTextOperators = rtl.createSet(this.TTMSFNCFilterBuilderExpressionOperator.feoEqual,this.TTMSFNCFilterBuilderExpressionOperator.feoNotEqual,this.TTMSFNCFilterBuilderExpressionOperator.feoNotEmpty,this.TTMSFNCFilterBuilderExpressionOperator.feoEmpty,this.TTMSFNCFilterBuilderExpressionOperator.feoContains,this.TTMSFNCFilterBuilderExpressionOperator.feoStartsWith,this.TTMSFNCFilterBuilderExpressionOperator.feoEndsWith);
  this.DefaultNumberOperators = rtl.createSet(this.TTMSFNCFilterBuilderExpressionOperator.feoNotEmpty,this.TTMSFNCFilterBuilderExpressionOperator.feoEmpty,this.TTMSFNCFilterBuilderExpressionOperator.feoEqual,this.TTMSFNCFilterBuilderExpressionOperator.feoNotEqual,this.TTMSFNCFilterBuilderExpressionOperator.feoLargerThan,this.TTMSFNCFilterBuilderExpressionOperator.feoLargerThanOrEqual,this.TTMSFNCFilterBuilderExpressionOperator.feoSmallerThan,this.TTMSFNCFilterBuilderExpressionOperator.feoSmallerThanOrEqual);
  this.INFINITE = 0xFFFFFFFF;
  rtl.createClass(this,"TTMSFNCFilterBuilderCustomUILanguage",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FCaption = "";
      this.FClose = "";
      this.FAndOperatorText = "";
      this.FOrOperatorText = "";
      this.FOnInternalChanged = null;
      this.FSmallerThanOrEqualOperatorText = "";
      this.FLargerThanOperatorText = "";
      this.FEqualOperatorText = "";
      this.FSmallerThanOperatorText = "";
      this.FNotEqualOperatorText = "";
      this.FEmptyOperatorText = "";
      this.FLargerThanOrEqualOperatorText = "";
      this.FNotEmptyOperatorText = "";
      this.FStartsWithOperatorText = "";
      this.FEndsWithOperatorText = "";
      this.FContainsOperatorText = "";
      this.FNotContainsOperatorText = "";
      this.FCancel = "";
      this.FApply = "";
      this.FClear = "";
      this.FAddGroup = "";
      this.FAddExpression = "";
      this.FFalseText = "";
      this.FTrueText = "";
      this.FOperatorHint = "";
      this.FNotHint = "";
      this.FAddHint = "";
      this.FValueHint = "";
      this.FRemoveHint = "";
      this.FColumnNameHint = "";
      this.FOK = "";
    };
    this.$final = function () {
      this.FOnInternalChanged = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.IsCaptionStored = function () {
      var Result = false;
      Result = this.FCaption !== rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageCaption");
      return Result;
    };
    this.IsCloseStored = function () {
      var Result = false;
      Result = this.FClose !== rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageClose");
      return Result;
    };
    this.IsAndOperatorTextStored = function () {
      var Result = false;
      Result = this.FAndOperatorText !== rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageAndOperatorText");
      return Result;
    };
    this.IsOrOperatorTextStored = function () {
      var Result = false;
      Result = this.FOrOperatorText !== rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageOrOperatorText");
      return Result;
    };
    this.IsEmptyOperatorTextStored = function () {
      var Result = false;
      Result = this.FEmptyOperatorText !== rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageEmptyOperatorText");
      return Result;
    };
    this.TrueOperatorTextStored = function () {
      var Result = false;
      Result = this.FTrueText !== rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageTrue");
      return Result;
    };
    this.FalseOperatorTextStored = function () {
      var Result = false;
      Result = this.FFalseText !== rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageFalse");
      return Result;
    };
    this.IsEqualOperatorTextStored = function () {
      var Result = false;
      Result = this.FEqualOperatorText !== rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageEqualOperatorText");
      return Result;
    };
    this.IsLargerThanOrEqualOperatorTextStored = function () {
      var Result = false;
      Result = this.FLargerThanOrEqualOperatorText !== rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageLargerThanOrEqualOperatorText");
      return Result;
    };
    this.IsLargerThanOperatorTextStored = function () {
      var Result = false;
      Result = this.FLargerThanOperatorText !== rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageLargerThanOperatorText");
      return Result;
    };
    this.IsSmallerThanOrEqualOperatorTextStored = function () {
      var Result = false;
      Result = this.FSmallerThanOrEqualOperatorText !== rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageSmallerThanOrEqualOperatorText");
      return Result;
    };
    this.IsSmallerThanOperatorTextStored = function () {
      var Result = false;
      Result = this.FSmallerThanOperatorText !== rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageSmallerThanOperatorText");
      return Result;
    };
    this.IsNotEmptyOperatorTextStored = function () {
      var Result = false;
      Result = this.FNotEmptyOperatorText !== rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageNotEmptyOperatorText");
      return Result;
    };
    this.IsNotEqualOperatorTextStored = function () {
      var Result = false;
      Result = this.FNotEqualOperatorText !== rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageNotEqualOperatorText");
      return Result;
    };
    this.IsContainsOperatorTextStored = function () {
      var Result = false;
      Result = this.FContainsOperatorText !== rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageContainsOperatorText");
      return Result;
    };
    this.IsEndsWithOperatorTextStored = function () {
      var Result = false;
      Result = this.FEndsWithOperatorText !== rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageEndsWithOperatorText");
      return Result;
    };
    this.IsNotContainsOperatorTextStored = function () {
      var Result = false;
      Result = this.FNotContainsOperatorText !== rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageNotContainsOperatorText");
      return Result;
    };
    this.IsStartsWithOperatorTextStored = function () {
      var Result = false;
      Result = this.FStartsWithOperatorText !== rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageStartsWithOperatorText");
      return Result;
    };
    this.IsApplyStored = function () {
      var Result = false;
      Result = this.FApply !== rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageApply");
      return Result;
    };
    this.IsCancelStored = function () {
      var Result = false;
      Result = this.FCancel !== rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageCancel");
      return Result;
    };
    this.IsClearStored = function () {
      var Result = false;
      Result = this.FClear !== rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageClear");
      return Result;
    };
    this.IsAddExpressionStored = function () {
      var Result = false;
      Result = this.FAddExpression !== rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageAddExpression");
      return Result;
    };
    this.IsAddGroupStored = function () {
      var Result = false;
      Result = this.FAddGroup !== rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageAddGroup");
      return Result;
    };
    this.IsAddHintStored = function () {
      var Result = false;
      Result = this.FAddHint !== rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageAddHint");
      return Result;
    };
    this.IsColumnNameHintStored = function () {
      var Result = false;
      Result = this.FColumnNameHint !== rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageColumnNameHint");
      return Result;
    };
    this.IsNotHintStored = function () {
      var Result = false;
      Result = this.FNotHint !== rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageNotHint");
      return Result;
    };
    this.IsOperatorHintStored = function () {
      var Result = false;
      Result = this.FOperatorHint !== rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageOperatorHint");
      return Result;
    };
    this.IsRemoveHintStored = function () {
      var Result = false;
      Result = this.FRemoveHint !== rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageRemoveHint");
      return Result;
    };
    this.IsValueHintStored = function () {
      var Result = false;
      Result = this.FValueHint !== rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageValueHint");
      return Result;
    };
    this.IsOKStored = function () {
      var Result = false;
      Result = this.FOK !== rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageOk");
      return Result;
    };
    this.DoChanged = function () {
      if (this.FOnInternalChanged != null) this.FOnInternalChanged(this);
    };
    this.Create$1 = function () {
      this.FApply = rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageApply");
      this.FOK = rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageOk");
      this.FClear = rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageClear");
      this.FCancel = rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageCancel");
      this.FClose = rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageClose");
      this.FCaption = rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageCaption");
      this.FAndOperatorText = rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageAndOperatorText");
      this.FOrOperatorText = rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageOrOperatorText");
      this.FEmptyOperatorText = rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageEmptyOperatorText");
      this.FEqualOperatorText = rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageEqualOperatorText");
      this.FLargerThanOrEqualOperatorText = rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageLargerThanOrEqualOperatorText");
      this.FLargerThanOperatorText = rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageLargerThanOperatorText");
      this.FSmallerThanOrEqualOperatorText = rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageSmallerThanOrEqualOperatorText");
      this.FSmallerThanOperatorText = rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageSmallerThanOperatorText");
      this.FNotEmptyOperatorText = rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageNotEmptyOperatorText");
      this.FNotEqualOperatorText = rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageNotEqualOperatorText");
      this.FStartsWithOperatorText = rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageStartsWithOperatorText");
      this.FEndsWithOperatorText = rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageEndsWithOperatorText");
      this.FContainsOperatorText = rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageContainsOperatorText");
      this.FNotContainsOperatorText = rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageNotContainsOperatorText");
      this.FAddExpression = rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageAddExpression");
      this.FAddGroup = rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageAddGroup");
      this.FTrueText = rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageTrue");
      this.FFalseText = rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageFalse");
      this.FAddHint = rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageAddHint");
      this.FRemoveHint = rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageRemoveHint");
      this.FNotHint = rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageNotHint");
      this.FColumnNameHint = rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageColumnNameHint");
      this.FOperatorHint = rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageOperatorHint");
      this.FValueHint = rtl.getResStr($mod,"sTMSFNCFilterBuilderUILanguageValueHint");
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCFilterBuilderCustomUILanguage.isPrototypeOf(Source)) {
        this.FClose = rtl.as(Source,$mod.TTMSFNCFilterBuilderCustomUILanguage).FClose;
        this.FApply = rtl.as(Source,$mod.TTMSFNCFilterBuilderCustomUILanguage).FApply;
        this.FOK = rtl.as(Source,$mod.TTMSFNCFilterBuilderCustomUILanguage).FOK;
        this.FCaption = rtl.as(Source,$mod.TTMSFNCFilterBuilderCustomUILanguage).FCaption;
        this.FAndOperatorText = rtl.as(Source,$mod.TTMSFNCFilterBuilderCustomUILanguage).FAndOperatorText;
        this.FOrOperatorText = rtl.as(Source,$mod.TTMSFNCFilterBuilderCustomUILanguage).FOrOperatorText;
        this.FEmptyOperatorText = rtl.as(Source,$mod.TTMSFNCFilterBuilderCustomUILanguage).FEmptyOperatorText;
        this.FEqualOperatorText = rtl.as(Source,$mod.TTMSFNCFilterBuilderCustomUILanguage).FEqualOperatorText;
        this.FLargerThanOrEqualOperatorText = rtl.as(Source,$mod.TTMSFNCFilterBuilderCustomUILanguage).FLargerThanOrEqualOperatorText;
        this.FLargerThanOperatorText = rtl.as(Source,$mod.TTMSFNCFilterBuilderCustomUILanguage).FLargerThanOperatorText;
        this.FSmallerThanOrEqualOperatorText = rtl.as(Source,$mod.TTMSFNCFilterBuilderCustomUILanguage).FSmallerThanOrEqualOperatorText;
        this.FSmallerThanOperatorText = rtl.as(Source,$mod.TTMSFNCFilterBuilderCustomUILanguage).FSmallerThanOperatorText;
        this.FNotEmptyOperatorText = rtl.as(Source,$mod.TTMSFNCFilterBuilderCustomUILanguage).FNotEmptyOperatorText;
        this.FNotEqualOperatorText = rtl.as(Source,$mod.TTMSFNCFilterBuilderCustomUILanguage).FNotEqualOperatorText;
        this.FStartsWithOperatorText = rtl.as(Source,$mod.TTMSFNCFilterBuilderCustomUILanguage).FStartsWithOperatorText;
        this.FEndsWithOperatorText = rtl.as(Source,$mod.TTMSFNCFilterBuilderCustomUILanguage).FEndsWithOperatorText;
        this.FContainsOperatorText = rtl.as(Source,$mod.TTMSFNCFilterBuilderCustomUILanguage).FContainsOperatorText;
        this.FNotContainsOperatorText = rtl.as(Source,$mod.TTMSFNCFilterBuilderCustomUILanguage).FNotContainsOperatorText;
        this.FTrueText = rtl.as(Source,$mod.TTMSFNCFilterBuilderCustomUILanguage).FTrueText;
        this.FFalseText = rtl.as(Source,$mod.TTMSFNCFilterBuilderCustomUILanguage).FFalseText;
        this.FAddHint = rtl.as(Source,$mod.TTMSFNCFilterBuilderCustomUILanguage).FAddHint;
        this.FRemoveHint = rtl.as(Source,$mod.TTMSFNCFilterBuilderCustomUILanguage).FRemoveHint;
        this.FNotHint = rtl.as(Source,$mod.TTMSFNCFilterBuilderCustomUILanguage).FNotHint;
        this.FColumnNameHint = rtl.as(Source,$mod.TTMSFNCFilterBuilderCustomUILanguage).FColumnNameHint;
        this.FOperatorHint = rtl.as(Source,$mod.TTMSFNCFilterBuilderCustomUILanguage).FOperatorHint;
        this.FValueHint = rtl.as(Source,$mod.TTMSFNCFilterBuilderCustomUILanguage).FValueHint;
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
  });
  rtl.createClass(this,"TTMSFNCFilterBuilderParseFormat",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FUpdateCount = 0;
      this.FModified = false;
      this.FAndOperator = "";
      this.FOrOperator = "";
      this.FSmallerThanOrEqualOperator = "";
      this.FLargerThanOperator = "";
      this.FEqualOperator = "";
      this.FSmallerThanOperator = "";
      this.FNotEqualOperator = "";
      this.FEmptyOperator = "";
      this.FLargerThanOrEqualOperator = "";
      this.FNotEmptyOperator = "";
      this.FStartsWithOperator = "";
      this.FEndsWithOperator = "";
      this.FContainsOperator = "";
      this.FColumnFormat = "";
      this.FGroupFormat = "";
      this.FOnInternalChanged = null;
      this.FSingleCharWildCard = "";
      this.FMultiCharWildCard = "";
      this.FStringDelimiter = "";
      this.FNotOperator = "";
      this.FEqualStrOperator = "";
    };
    this.$final = function () {
      this.FOnInternalChanged = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.IsAndOperatorStored = function () {
      var Result = false;
      Result = this.FAndOperator !== "AND";
      return Result;
    };
    this.IsOrOperatorStored = function () {
      var Result = false;
      Result = this.FOrOperator !== "OR";
      return Result;
    };
    this.IsEmptyOperatorStored = function () {
      var Result = false;
      Result = this.FEmptyOperator !== "IS NULL";
      return Result;
    };
    this.IsEqualOperatorStored = function () {
      var Result = false;
      Result = this.FEqualOperator !== "= #VALUE";
      return Result;
    };
    this.IsLargerThanOrEqualOperatorStored = function () {
      var Result = false;
      Result = this.FLargerThanOrEqualOperator !== ">= #VALUE";
      return Result;
    };
    this.IsLargerThanOperatorStored = function () {
      var Result = false;
      Result = this.FLargerThanOperator !== "> #VALUE";
      return Result;
    };
    this.IsSmallerThanOrEqualOperatorStored = function () {
      var Result = false;
      Result = this.FSmallerThanOrEqualOperator !== "<= #VALUE";
      return Result;
    };
    this.IsSmallerThanOperatorStored = function () {
      var Result = false;
      Result = this.FSmallerThanOperator !== "< #VALUE";
      return Result;
    };
    this.IsNotEmptyOperatorStored = function () {
      var Result = false;
      Result = this.FNotEmptyOperator !== "IS NOT NULL";
      return Result;
    };
    this.IsNotEqualOperatorStored = function () {
      var Result = false;
      Result = this.FNotEqualOperator !== "<> #VALUE";
      return Result;
    };
    this.IsContainsOperatorStored = function () {
      var Result = false;
      Result = this.FContainsOperator !== ("LIKE " + pas.SysUtils.QuotedStr("%#VALUE%","'"));
      return Result;
    };
    this.IsEndsWithOperatorStored = function () {
      var Result = false;
      Result = this.FEndsWithOperator !== ("LIKE " + pas.SysUtils.QuotedStr("%#VALUE","'"));
      return Result;
    };
    this.IsStartsWithOperatorStored = function () {
      var Result = false;
      Result = this.FStartsWithOperator !== ("LIKE " + pas.SysUtils.QuotedStr("#VALUE%","'"));
      return Result;
    };
    this.IsColumnFormatStored = function () {
      var Result = false;
      Result = this.FColumnFormat !== "[#COLUMN]";
      return Result;
    };
    this.IsGroupFormatStored = function () {
      var Result = false;
      Result = this.FGroupFormat !== "(#GROUP)";
      return Result;
    };
    this.IsMultiCharWildCardStored = function () {
      var Result = false;
      Result = this.FMultiCharWildCard !== "%";
      return Result;
    };
    this.IsSingleCharWildCardStored = function () {
      var Result = false;
      Result = this.FSingleCharWildCard !== "_";
      return Result;
    };
    this.IsStringDelimiterStored = function () {
      var Result = false;
      Result = this.FStringDelimiter !== "'";
      return Result;
    };
    this.SetAndOperator = function (Value) {
      this.FAndOperator = Value;
      this.DoInternalChanged();
    };
    this.SetColumnFormat = function (Value) {
      this.FColumnFormat = Value;
      this.DoInternalChanged();
    };
    this.SetContainsOperator = function (Value) {
      this.FContainsOperator = Value;
      this.DoInternalChanged();
    };
    this.SetEmptyOperator = function (Value) {
      this.FEmptyOperator = Value;
      this.DoInternalChanged();
    };
    this.SetEndsWithOperator = function (Value) {
      this.FEndsWithOperator = Value;
      this.DoInternalChanged();
    };
    this.SetEqualOperator = function (Value) {
      this.FEqualOperator = Value;
      this.DoInternalChanged();
    };
    this.SetGroupFormat = function (Value) {
      this.FGroupFormat = Value;
      this.DoInternalChanged();
    };
    this.SetLargerThanOperator = function (Value) {
      this.FLargerThanOperator = Value;
      this.DoInternalChanged();
    };
    this.SetLargerThanOrEqualOperator = function (Value) {
      this.FLargerThanOrEqualOperator = Value;
      this.DoInternalChanged();
    };
    this.SetMultiCharWildCard = function (Value) {
      this.FMultiCharWildCard = Value;
      this.DoInternalChanged();
    };
    this.SetNotEmptyOperator = function (Value) {
      this.FNotEmptyOperator = Value;
      this.DoInternalChanged();
    };
    this.SetNotEqualOperator = function (Value) {
      this.FNotEqualOperator = Value;
      this.DoInternalChanged();
    };
    this.SetOrOperator = function (Value) {
      this.FOrOperator = Value;
      this.DoInternalChanged();
    };
    this.SetSingleCharWildCard = function (Value) {
      this.FSingleCharWildCard = Value;
      this.DoInternalChanged();
    };
    this.SetSmallerThanOperator = function (Value) {
      this.FSmallerThanOperator = Value;
      this.DoInternalChanged();
    };
    this.SetSmallerThanOrEqualOperator = function (Value) {
      this.FSmallerThanOrEqualOperator = Value;
      this.DoInternalChanged();
    };
    this.SetStartsWithOperator = function (Value) {
      this.FStartsWithOperator = Value;
      this.DoInternalChanged();
    };
    this.SetStringDelimiter = function (Value) {
      this.FStringDelimiter = Value;
      this.DoInternalChanged();
    };
    this.IsNotOperatorStored = function () {
      var Result = false;
      Result = this.FNotOperator !== "NOT";
      return Result;
    };
    this.SetNotOperator = function (Value) {
      this.FNotOperator = Value;
    };
    this.IsEqualStrOperatorStored = function () {
      var Result = false;
      Result = this.FEqualStrOperator !== ("LIKE " + pas.SysUtils.QuotedStr("#VALUE","'"));
      return Result;
    };
    this.SetEqualStrOperator = function (Value) {
      this.FEqualStrOperator = Value;
      this.DoInternalChanged();
    };
    this.DoInternalChanged = function () {
      if (this.FUpdateCount > 0) {
        this.FModified = true;
        return;
      };
      if (this.FOnInternalChanged != null) this.FOnInternalChanged(this);
    };
    this.Create$1 = function () {
      this.FUpdateCount = 0;
      this.FStringDelimiter = "'";
      this.FSingleCharWildCard = "_";
      this.FMultiCharWildCard = "%";
      this.FAndOperator = "AND";
      this.FOrOperator = "OR";
      this.FNotOperator = "NOT";
      this.FGroupFormat = "(#GROUP)";
      this.FColumnFormat = "[#COLUMN]";
      this.FContainsOperator = "LIKE " + this.FStringDelimiter + this.FMultiCharWildCard + "#VALUE" + this.FMultiCharWildCard + this.FStringDelimiter;
      this.FStartsWithOperator = "LIKE " + this.FStringDelimiter + "#VALUE" + this.FMultiCharWildCard + this.FStringDelimiter;
      this.FEndsWithOperator = "LIKE " + this.FStringDelimiter + this.FMultiCharWildCard + "#VALUE" + this.FStringDelimiter;
      this.FEmptyOperator = "IS NULL";
      this.FNotEmptyOperator = "IS NOT NULL";
      this.FEqualOperator = "= #VALUE";
      this.FEqualStrOperator = "LIKE " + this.FStringDelimiter + "#VALUE" + this.FStringDelimiter;
      this.FNotEqualOperator = "<> #VALUE";
      this.FLargerThanOrEqualOperator = ">= #VALUE";
      this.FLargerThanOperator = "> #VALUE";
      this.FSmallerThanOrEqualOperator = "<= #VALUE";
      this.FSmallerThanOperator = "< #VALUE";
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCFilterBuilderParseFormat.isPrototypeOf(Source)) {
        this.FAndOperator = rtl.as(Source,$mod.TTMSFNCFilterBuilderParseFormat).FAndOperator;
        this.FColumnFormat = rtl.as(Source,$mod.TTMSFNCFilterBuilderParseFormat).FColumnFormat;
        this.FContainsOperator = rtl.as(Source,$mod.TTMSFNCFilterBuilderParseFormat).FContainsOperator;
        this.FEmptyOperator = rtl.as(Source,$mod.TTMSFNCFilterBuilderParseFormat).FEmptyOperator;
        this.FEndsWithOperator = rtl.as(Source,$mod.TTMSFNCFilterBuilderParseFormat).FEndsWithOperator;
        this.FEqualOperator = rtl.as(Source,$mod.TTMSFNCFilterBuilderParseFormat).FEqualOperator;
        this.FLargerThanOrEqualOperator = rtl.as(Source,$mod.TTMSFNCFilterBuilderParseFormat).FLargerThanOrEqualOperator;
        this.FLargerThanOperator = rtl.as(Source,$mod.TTMSFNCFilterBuilderParseFormat).FLargerThanOperator;
        this.FGroupFormat = rtl.as(Source,$mod.TTMSFNCFilterBuilderParseFormat).FGroupFormat;
        this.FSmallerThanOrEqualOperator = rtl.as(Source,$mod.TTMSFNCFilterBuilderParseFormat).FSmallerThanOrEqualOperator;
        this.FSmallerThanOperator = rtl.as(Source,$mod.TTMSFNCFilterBuilderParseFormat).FSmallerThanOperator;
        this.FNotEmptyOperator = rtl.as(Source,$mod.TTMSFNCFilterBuilderParseFormat).FNotEmptyOperator;
        this.FNotEqualOperator = rtl.as(Source,$mod.TTMSFNCFilterBuilderParseFormat).FNotEqualOperator;
        this.FOrOperator = rtl.as(Source,$mod.TTMSFNCFilterBuilderParseFormat).FOrOperator;
        this.FMultiCharWildCard = rtl.as(Source,$mod.TTMSFNCFilterBuilderParseFormat).FMultiCharWildCard;
        this.FSingleCharWildCard = rtl.as(Source,$mod.TTMSFNCFilterBuilderParseFormat).FSingleCharWildCard;
        this.FStartsWithOperator = rtl.as(Source,$mod.TTMSFNCFilterBuilderParseFormat).FStartsWithOperator;
        this.FStringDelimiter = rtl.as(Source,$mod.TTMSFNCFilterBuilderParseFormat).FStringDelimiter;
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    this.BeginUpdate = function () {
      this.FUpdateCount += 1;
    };
    this.EndUpdate = function () {
      this.FUpdateCount -= 1;
      if (this.FUpdateCount <= 0) {
        this.FUpdateCount = 0;
        if (this.FModified) this.DoInternalChanged();
        this.FModified = false;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("AndOperator",14,rtl.string,"FAndOperator","SetAndOperator",4,{stored: "IsAndOperatorStored"});
    $r.addProperty("OrOperator",14,rtl.string,"FOrOperator","SetOrOperator",4,{stored: "IsOrOperatorStored"});
    $r.addProperty("NotOperator",14,rtl.string,"FNotOperator","SetNotOperator",4,{stored: "IsNotOperatorStored"});
    $r.addProperty("EqualOperator",14,rtl.string,"FEqualOperator","SetEqualOperator",4,{stored: "IsEqualOperatorStored"});
    $r.addProperty("EqualStrOperator",14,rtl.string,"FEqualStrOperator","SetEqualStrOperator",4,{stored: "IsEqualStrOperatorStored"});
    $r.addProperty("NotEqualOperator",14,rtl.string,"FNotEqualOperator","SetNotEqualOperator",4,{stored: "IsNotEqualOperatorStored"});
    $r.addProperty("SmallerThanOperator",14,rtl.string,"FSmallerThanOperator","SetSmallerThanOperator",4,{stored: "IsSmallerThanOperatorStored"});
    $r.addProperty("SmallerThanOrEqualOperator",14,rtl.string,"FSmallerThanOrEqualOperator","SetSmallerThanOrEqualOperator",4,{stored: "IsSmallerThanOrEqualOperatorStored"});
    $r.addProperty("LargerThanOperator",14,rtl.string,"FLargerThanOperator","SetLargerThanOperator",4,{stored: "IsLargerThanOperatorStored"});
    $r.addProperty("LargerThanOrEqualOperator",14,rtl.string,"FLargerThanOrEqualOperator","SetLargerThanOrEqualOperator",4,{stored: "IsLargerThanOrEqualOperatorStored"});
    $r.addProperty("EmptyOperator",14,rtl.string,"FEmptyOperator","SetEmptyOperator",4,{stored: "IsEmptyOperatorStored"});
    $r.addProperty("NotEmptyOperator",14,rtl.string,"FNotEmptyOperator","SetNotEmptyOperator",4,{stored: "IsNotEmptyOperatorStored"});
    $r.addProperty("StartsWithOperator",14,rtl.string,"FStartsWithOperator","SetStartsWithOperator",4,{stored: "IsStartsWithOperatorStored"});
    $r.addProperty("EndsWithOperator",14,rtl.string,"FEndsWithOperator","SetEndsWithOperator",4,{stored: "IsEndsWithOperatorStored"});
    $r.addProperty("ContainsOperator",14,rtl.string,"FContainsOperator","SetContainsOperator",4,{stored: "IsContainsOperatorStored"});
    $r.addProperty("ColumnFormat",14,rtl.string,"FColumnFormat","SetColumnFormat",4,{stored: "IsColumnFormatStored"});
    $r.addProperty("GroupFormat",14,rtl.string,"FGroupFormat","SetGroupFormat",4,{stored: "IsGroupFormatStored"});
    $r.addProperty("StringDelimiter",14,rtl.string,"FStringDelimiter","SetStringDelimiter",4,{stored: "IsStringDelimiterStored"});
    $r.addProperty("MultiCharWildCard",14,rtl.string,"FMultiCharWildCard","SetMultiCharWildCard",4,{stored: "IsMultiCharWildCardStored"});
    $r.addProperty("SingleCharWildCard",14,rtl.string,"FSingleCharWildCard","SetSingleCharWildCard",4,{stored: "IsSingleCharWildCardStored"});
  });
  rtl.createInterface(this,"ITMSFNCFilterUILanguage","{4329CE04-4BBA-485C-9502-90D3CF597020}",["GetFilterUILanguage"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("GetFilterUILanguage",1,[],2,$mod.$rtti["TTMSFNCFilterBuilderCustomUILanguage"]);
  });
  this.$rtti.$Class("TTMSFNCFilterBuilderColumns");
  rtl.recNewT(this,"TTMSFNCFilterBuilderColumnProperties",function () {
    this.Name = "";
    this.DisplayName = "";
    this.DataType = 0;
    this.$eq = function (b) {
      return (this.Name === b.Name) && (this.DisplayName === b.DisplayName) && (this.DataType === b.DataType);
    };
    this.$assign = function (s) {
      this.Name = s.Name;
      this.DisplayName = s.DisplayName;
      this.DataType = s.DataType;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCFilterBuilderColumnProperties",{},this);
    $r.addField("Name",rtl.string);
    $r.addField("DisplayName",rtl.string);
    $r.addField("DataType",$mod.$rtti["TTMSFNCFilterBuilderDataType"]);
  });
  rtl.createClass(this,"TTMSFNCFilterBuilderColumn",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FColumns = null;
      this.FName = "";
      this.FDisplayName = "";
      this.FDataType = 0;
      this.FOnInternalChanged = null;
      this.FDataPointer = null;
      this.FDataBoolean = false;
      this.FDataString = "";
      this.FDataObject = null;
      this.FDataInteger = 0;
    };
    this.$final = function () {
      this.FColumns = undefined;
      this.FOnInternalChanged = undefined;
      this.FDataObject = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetDataType = function (Value) {
      if (this.FDataType !== Value) {
        this.FDataType = Value;
        this.DoChanged();
      };
    };
    this.SetName = function (Value) {
      if (this.FName !== Value) {
        this.FName = Value;
        this.DoChanged();
      };
    };
    this.GetDisplayName = function () {
      var Result = "";
      if (this.FDisplayName !== "") {
        Result = this.FDisplayName}
       else Result = this.FName;
      return Result;
    };
    this.SetDisplayName = function (Value) {
      if (this.FDisplayName !== Value) {
        this.FDisplayName = Value;
        this.DoChanged();
      };
    };
    this.DoChanged = function () {
      if (this.FColumns != null) this.FColumns.DoChanged();
    };
    this.DoListChanged = function (Sender) {
      this.DoChanged();
    };
    this.DoRemoveColumn = function () {
      if (this.FColumns != null) this.FColumns.DoColumnRemove(this);
    };
    this.DoColumnNameChange = function () {
      if (this.FColumns != null) this.FColumns.DoColumnNameChange(this);
    };
    this.GetIndex = function () {
      var Result = 0;
      Result = -1;
      if (this.FColumns != null) Result = this.FColumns.GetColumnIndex(this);
      return Result;
    };
    this.Create$1 = function (AColumns) {
      this.FColumns = AColumns;
      this.FName = "Name" + pas.SysUtils.TIntegerHelper.ToString$1.call({a: this.GetIndex(), get: function () {
          return this.a;
        }, set: function (v) {
          this.a = v;
        }});
      this.FDisplayName = "";
      this.FDataType = $mod.TTMSFNCFilterBuilderDataType.fdtAutomatic;
      return this;
    };
    this.Destroy = function () {
      this.DoRemoveColumn();
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCFilterBuilderColumn.isPrototypeOf(Source)) {
        this.FName = rtl.as(Source,$mod.TTMSFNCFilterBuilderColumn).FName;
        this.FDisplayName = rtl.as(Source,$mod.TTMSFNCFilterBuilderColumn).GetDisplayName();
        this.FDataType = rtl.as(Source,$mod.TTMSFNCFilterBuilderColumn).FDataType;
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    var $r = this.$rtti;
    $r.addProperty("Name",2,rtl.string,"FName","SetName");
    $r.addProperty("DisplayName",3,rtl.string,"GetDisplayName","SetDisplayName");
    $r.addProperty("DataType",2,$mod.$rtti["TTMSFNCFilterBuilderDataType"],"FDataType","SetDataType",4,{Default: $mod.TTMSFNCFilterBuilderDataType.fdtAutomatic});
  });
  this.$rtti.$ClassRef("TTMSFNCFilterBuilderColumnClass",{instancetype: this.$rtti["TTMSFNCFilterBuilderColumn"]});
  this.$rtti.$MethodVar("TTMSFNCFilterBuilderColumnEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",this.$rtti["TTMSFNCFilterBuilderColumn"]]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCFilterBuilderColumns",pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn,function () {
    this.$init = function () {
      pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn.$init.call(this);
      this.FOnInternalChanged = null;
      this.FOnInternalColumnRemove = null;
      this.FOnInternalColumnNameChange = null;
    };
    this.$final = function () {
      this.FOnInternalChanged = undefined;
      this.FOnInternalColumnRemove = undefined;
      this.FOnInternalColumnNameChange = undefined;
      pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn.$final.call(this);
    };
    this.DoColumnRemove = function (AColumn) {
      if (this.FOnInternalColumnRemove != null) this.FOnInternalColumnRemove(this,AColumn);
    };
    this.DoColumnNameChange = function (AColumn) {
      if (this.FOnInternalColumnNameChange != null) this.FOnInternalColumnNameChange(this,AColumn);
    };
    this.DoChanged = function () {
      if (this.FOnInternalChanged != null) this.FOnInternalChanged(this);
    };
    this.Create$7 = function (AOwner) {
      pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn.Create$4.call(this,true);
      return this;
    };
    this.Assign = function (Source) {
      var I = 0;
      var c = null;
      if ($mod.TTMSFNCFilterBuilderColumns.isPrototypeOf(Source)) {
        this.Clear();
        for (var $l = 0, $end = rtl.as(Source,$mod.TTMSFNCFilterBuilderColumns).FLength - 1; $l <= $end; $l++) {
          I = $l;
          c = this.Add$1(null);
          c.Assign(rtl.as(Source,$mod.TTMSFNCFilterBuilderColumns).GetItem(I));
        };
      };
    };
    this.GetColumnIndex = function (AColumn) {
      var Result = 0;
      var I = 0;
      Result = -1;
      for (var $l = 0, $end = this.FLength - 1; $l <= $end; $l++) {
        I = $l;
        if (AColumn === this.GetItem(I)) {
          Result = I;
          break;
        };
      };
      return Result;
    };
    this.Add$1 = function (AColumnClass) {
      var Result = null;
      var c = null;
      if (AColumnClass != null) {
        c = AColumnClass.$create("Create$1",[this])}
       else c = $mod.TTMSFNCFilterBuilderColumn.$create("Create$1",[this]);
      pas["Generics.Collections"].TList$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn.Add.call(this,c);
      Result = c;
      return Result;
    };
    this.AddColumn = function (AName, ADataType, ADisplayName) {
      var Result = null;
      Result = this.Add$1(null);
      Result.FName = AName;
      Result.FDataType = ADataType;
      Result.FDisplayName = ADisplayName;
      return Result;
    };
  });
  this.TTMSFNCFilterBuilderFormatType = {"0": "fftDelphiDataSet", fftDelphiDataSet: 0, "1": "fftUniversalFilterExpressions", fftUniversalFilterExpressions: 1, "2": "fftCustom", fftCustom: 2};
  this.$rtti.$Enum("TTMSFNCFilterBuilderFormatType",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCFilterBuilderFormatType});
  this.$rtti.$Class("TTMSFNCCustomFilterBuilder");
  this.$rtti.$Class("TTMSFNCFilterBuilderGroup");
  this.$rtti.$Class("TTMSFNCFilterBuilderExpressions");
  this.$rtti.$MethodVar("TTMSFNCGetFilterBuilderEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFilterBuilder",this.$rtti["TTMSFNCCustomFilterBuilder"],1]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCFilterBuilderExpression",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FBackupColName = "";
      this.FExpressionOperator = 0;
      this.FValidExpression = false;
      this.FValue = undefined;
      this.FValueText = "";
      this.FColumn = null;
      this.FDataPointer = null;
      this.FDataBoolean = false;
      this.FDataString = "";
      this.FDataObject = null;
      this.FDataInteger = 0;
      this.FFilterExpressions = null;
      this.FIsInverted = false;
      this.FCaseSensitive = false;
      this.FOnGetFilterBuilder = null;
    };
    this.$final = function () {
      this.FColumn = undefined;
      this.FDataObject = undefined;
      this.FFilterExpressions = undefined;
      this.FOnGetFilterBuilder = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetExpressionOperator = function (AValue) {
      if (this.FExpressionOperator !== AValue) {
        this.FExpressionOperator = AValue;
        this.DoChanged();
      };
    };
    this.SetColumn = function (AValue) {
      if (this.FColumn !== AValue) {
        this.FColumn = AValue;
        this.DoChanged();
      };
    };
    this.GetInternalExpression = function (ADisplayNames) {
      var Result = "";
      var b = null;
      var dt = 0;
      var fs = pas.SysUtils.TFormatSettings.$new();
      var pf = null;
      var colName = "";
      var exp = "";
      Result = "";
      b = this.GetBuilder();
      if (!(this.FColumn != null) && (this.FBackupColName !== "")) this.UpdateColumn();
      if (this.FColumn != null) {
        if (ADisplayNames) {
          colName = this.FColumn.GetDisplayName()}
         else colName = this.FColumn.FName;
        dt = this.FColumn.FDataType;
      } else {
        colName = this.FBackupColName;
        dt = $mod.TTMSFNCFilterBuilderDataType.fdtAutomatic;
      };
      if (b != null) {
        exp = b.GetExpressionText(colName,dt,this.FExpressionOperator,this.FValueText,this.FValue,this.FIsInverted)}
       else {
        fs.$assign(pas.SysUtils.TFormatSettings.Create());
        pf = $mod.TTMSFNCFilterBuilderParseFormat.$create("Create$1");
        try {
          exp = $impl.GetInternalExpressionText(colName,dt,this.FExpressionOperator,this.FValueText,this.FValue,this.FIsInverted,pas.SysUtils.TFormatSettings.$clone(fs),pf,true);
        } finally {
          pf = rtl.freeLoc(pf);
        };
      };
      if (b != null) b.DoGetExpressionText(this,{get: function () {
          return exp;
        }, set: function (v) {
          exp = v;
        }});
      Result = exp;
      return Result;
    };
    this.GetExpression = function () {
      var Result = "";
      Result = this.GetInternalExpression(false);
      return Result;
    };
    this.UpdateColumn = function () {
      var b = null;
      if (!(this.FColumn != null)) {
        b = this.GetBuilder();
        if ((b != null) && (this.FBackupColName !== "")) this.FColumn = b.GetColumnByName(this.FBackupColName);
      };
    };
    this.GetParentGroup = function () {
      var Result = null;
      Result = null;
      if ((this.FFilterExpressions != null) && (this.FFilterExpressions.FParentGroup != null)) Result = this.FFilterExpressions.FParentGroup;
      return Result;
    };
    this.GetIndex = function () {
      var Result = 0;
      Result = -1;
      if (this.FFilterExpressions != null) Result = this.FFilterExpressions.GetExpressionIndex(this);
      return Result;
    };
    this.SetValue = function (AValue) {
      this.FValueText = pas["TMS.TMSFNCValue"].ValueToString(AValue);
      this.FValue = AValue;
      this.DoChanged();
    };
    this.SetInverted = function (AValue) {
      if (this.FIsInverted !== AValue) {
        this.FIsInverted = AValue;
        this.DoChanged();
      };
    };
    this.SetCaseSensitive = function (Value) {
      if (this.FCaseSensitive !== Value) {
        this.FCaseSensitive = Value;
        this.DoChanged();
      };
    };
    this.InternalValidateExpression = function (AInput, ADataType) {
      var Result = false;
      var b = null;
      var eof = $mod.TTMSFNCFilterBuilderExpressionOperatorFormat.$new();
      var inp = undefined;
      var val = undefined;
      var inpTxt = "";
      var valTxt = "";
      var fs = pas.SysUtils.TFormatSettings.$new();
      var isText = false;
      var StrStartIdx = 0;
      var dt = 0.0;
      var f = 0.0;
      var i = 0;
      Result = false;
      StrStartIdx = $impl.GetStringStartIndex();
      b = this.GetBuilder();
      if (b != null) {
        fs.$assign(b.GetFormatSettings());
        eof.$assign(b.GetExpressionOperatorFormat());
      } else {
        fs.$assign(pas.SysUtils.TFormatSettings.Create());
        eof.$assign($impl.GetDefaultExpressionOperatorFormat(true));
      };
      inp = AInput;
      inpTxt = pas["TMS.TMSFNCValue"].ValueToString(AInput);
      val = this.FValue;
      if ((ADataType in rtl.createSet($mod.TTMSFNCFilterBuilderDataType.fdtText)) || (this.FExpressionOperator in rtl.createSet($mod.TTMSFNCFilterBuilderExpressionOperator.feoContains,$mod.TTMSFNCFilterBuilderExpressionOperator.feoStartsWith,$mod.TTMSFNCFilterBuilderExpressionOperator.feoEndsWith))) {
        if (this.FValueText !== "") {
          valTxt = this.FValueText}
         else valTxt = pas["TMS.TMSFNCValue"].ValueToString(val);
      } else if ((ADataType in rtl.createSet($mod.TTMSFNCFilterBuilderDataType.fdtDateTime,$mod.TTMSFNCFilterBuilderDataType.fdtDate,$mod.TTMSFNCFilterBuilderDataType.fdtTime)) && pas["TMS.TMSFNCValue"].ValueIsDateTime(AInput)) {
        inpTxt = pas.SysUtils.DateTimeToStr$1(pas["TMS.TMSFNCValue"].ValueToDateTime(AInput),fs,false);
        if (!pas["TMS.TMSFNCValue"].ValueIsDateTimeType(inp)) {
          dt = 4294967295;
          pas.SysUtils.TryStrToDateTime(inpTxt,{get: function () {
              return dt;
            }, set: function (v) {
              dt = v;
            }});
          if (dt !== 4294967295) inp = dt;
        };
        valTxt = pas.SysUtils.DateTimeToStr$1(pas["TMS.TMSFNCValue"].ValueToDateTime(this.FValue),fs,false);
      } else if (ADataType === $mod.TTMSFNCFilterBuilderDataType.fdtFloat) {
        if (!pas["TMS.TMSFNCValue"].ValueIsFloat(inp)) {
          f = 4294967295;
          pas.SysUtils.TryStrToFloat$3(inpTxt,{get: function () {
              return f;
            }, set: function (v) {
              f = v;
            }},fs);
          if (f !== 4294967295) inp = f;
        };
      } else if (ADataType === $mod.TTMSFNCFilterBuilderDataType.fdtNumber) {
        if (!pas["TMS.TMSFNCValue"].ValueIsInteger(inp)) {
          i = 2147483647;
          pas.SysUtils.TryStrToInt(inpTxt,{get: function () {
              return i;
            }, set: function (v) {
              i = v;
            }});
          if (i !== 2147483647) inp = i;
        };
      } else if (ADataType === $mod.TTMSFNCFilterBuilderDataType.fdtAutomatic) {
        if (pas["TMS.TMSFNCValue"].ValueIsString(AInput)) inp = $mod.ParseValueTextToFNCValue(pas["TMS.TMSFNCValue"].ValueToString(AInput),ADataType,pas.SysUtils.TFormatSettings.$clone(fs));
        if (pas["TMS.TMSFNCValue"].ValueIsDateTime(AInput)) inpTxt = pas.SysUtils.DateTimeToStr$1(pas["TMS.TMSFNCValue"].ValueToDateTime(AInput),fs,false);
        if (pas["TMS.TMSFNCValue"].ValueIsString(this.FValue)) val = $mod.ParseValueTextToFNCValue(pas["TMS.TMSFNCValue"].ValueToString(this.FValue),ADataType,pas.SysUtils.TFormatSettings.$clone(fs));
        if (this.FValueText !== "") {
          valTxt = this.FValueText}
         else valTxt = pas["TMS.TMSFNCValue"].ValueToString(val);
      };
      isText = (ADataType === $mod.TTMSFNCFilterBuilderDataType.fdtText) || ((ADataType === $mod.TTMSFNCFilterBuilderDataType.fdtAutomatic) && pas["TMS.TMSFNCValue"].ValueIsString(inp)) || ((ADataType in rtl.createSet($mod.TTMSFNCFilterBuilderDataType.fdtDateTime,$mod.TTMSFNCFilterBuilderDataType.fdtDate,$mod.TTMSFNCFilterBuilderDataType.fdtTime)) && (pas.StrUtils.ContainsText(valTxt,eof.SingleCharWildCard) || pas.StrUtils.ContainsText(valTxt,eof.MultiCharWildCard))) || (pas.SysUtils.TStringHelper.StartsWith.call({get: function () {
          return valTxt;
        }, set: function (v) {
          valTxt = v;
        }},eof.StringDelimiter) && pas.SysUtils.TStringHelper.EndsWith.call({get: function () {
          return valTxt;
        }, set: function (v) {
          valTxt = v;
        }},eof.StringDelimiter));
      if (pas.SysUtils.TStringHelper.StartsWith.call({get: function () {
          return valTxt;
        }, set: function (v) {
          valTxt = v;
        }},eof.StringDelimiter) && pas.SysUtils.TStringHelper.EndsWith.call({get: function () {
          return valTxt;
        }, set: function (v) {
          valTxt = v;
        }},eof.StringDelimiter)) {
        valTxt = pas.SysUtils.TStringHelper.Remove$1.call({get: function () {
            return valTxt;
          }, set: function (v) {
            valTxt = v;
          }},StrStartIdx,eof.StringDelimiter.length);
        valTxt = pas.SysUtils.TStringHelper.Remove$1.call({get: function () {
            return valTxt;
          }, set: function (v) {
            valTxt = v;
          }},valTxt.length - eof.StringDelimiter.length,eof.StringDelimiter.length);
      };
      if (!this.FCaseSensitive) {
        inpTxt = pas.SysUtils.UpperCase(inpTxt);
        valTxt = pas.SysUtils.UpperCase(valTxt);
      };
      var $tmp = this.FExpressionOperator;
      if ($tmp === $mod.TTMSFNCFilterBuilderExpressionOperator.feoStartsWith) {
        Result = $mod.MatchStrings(valTxt + eof.MultiCharWildCard,inpTxt,eof.MultiCharWildCard,eof.SingleCharWildCard);
      } else if ($tmp === $mod.TTMSFNCFilterBuilderExpressionOperator.feoEndsWith) {
        Result = $mod.MatchStrings(eof.MultiCharWildCard + valTxt,inpTxt,eof.MultiCharWildCard,eof.SingleCharWildCard);
      } else if ($tmp === $mod.TTMSFNCFilterBuilderExpressionOperator.feoContains) {
        Result = $mod.MatchStrings(eof.MultiCharWildCard + valTxt + eof.MultiCharWildCard,inpTxt,eof.MultiCharWildCard,eof.SingleCharWildCard);
      } else if ($tmp === $mod.TTMSFNCFilterBuilderExpressionOperator.feoEqual) {
        if (isText && (pas.StrUtils.ContainsText(valTxt,eof.SingleCharWildCard) || pas.StrUtils.ContainsText(valTxt,eof.MultiCharWildCard))) {
          Result = $mod.MatchStrings(valTxt,inpTxt,eof.MultiCharWildCard,eof.SingleCharWildCard)}
         else Result = pas["TMS.TMSFNCValue"].IsFNCValueEqual$1(inp,val,pas.SysUtils.TFormatSettings.$clone(fs),pas.System.TTypeKind.tkUnknown);
      } else if ($tmp === $mod.TTMSFNCFilterBuilderExpressionOperator.feoNotEqual) {
        if (isText && (pas.StrUtils.ContainsText(valTxt,eof.SingleCharWildCard) || pas.StrUtils.ContainsText(valTxt,eof.MultiCharWildCard))) {
          Result = !$mod.MatchStrings(valTxt,inpTxt,eof.MultiCharWildCard,eof.SingleCharWildCard)}
         else Result = !pas["TMS.TMSFNCValue"].IsFNCValueEqual$1(inp,val,pas.SysUtils.TFormatSettings.$clone(fs),pas.System.TTypeKind.tkUnknown);
      } else if ($tmp === $mod.TTMSFNCFilterBuilderExpressionOperator.feoEmpty) {
        Result = pas["TMS.TMSFNCValue"].ValueIsEmpty(inp)}
       else if ($tmp === $mod.TTMSFNCFilterBuilderExpressionOperator.feoNotEmpty) {
        Result = !pas["TMS.TMSFNCValue"].ValueIsEmpty(inp)}
       else if ($tmp === $mod.TTMSFNCFilterBuilderExpressionOperator.feoLargerThan) {
        Result = pas["TMS.TMSFNCValue"].CompareFNCValue$1(inp,val,pas.SysUtils.TFormatSettings.$clone(fs),pas.System.TTypeKind.tkUnknown) > 0;
      } else if ($tmp === $mod.TTMSFNCFilterBuilderExpressionOperator.feoSmallerThan) {
        Result = pas["TMS.TMSFNCValue"].CompareFNCValue$1(inp,val,pas.SysUtils.TFormatSettings.$clone(fs),pas.System.TTypeKind.tkUnknown) < 0}
       else if ($tmp === $mod.TTMSFNCFilterBuilderExpressionOperator.feoLargerThanOrEqual) {
        Result = pas["TMS.TMSFNCValue"].CompareFNCValue$1(inp,val,pas.SysUtils.TFormatSettings.$clone(fs),pas.System.TTypeKind.tkUnknown) >= 0}
       else if ($tmp === $mod.TTMSFNCFilterBuilderExpressionOperator.feoSmallerThanOrEqual) Result = pas["TMS.TMSFNCValue"].CompareFNCValue$1(inp,val,pas.SysUtils.TFormatSettings.$clone(fs),pas.System.TTypeKind.tkUnknown) <= 0;
      if (this.FIsInverted) Result = !Result;
      return Result;
    };
    this.DoChanged = function () {
      if (this.FFilterExpressions != null) this.FFilterExpressions.DoChanged();
    };
    this.CheckExpression = function () {
      this.FValidExpression = ((this.FColumn != null) || (this.FBackupColName !== "")) && !pas["TMS.TMSFNCValue"].ValueIsEmpty(this.FValue);
    };
    this.GenerateExpression = function (AExpression, ADataSet) {
      var b = null;
      var ei = $mod.TTMSFNCFilterBuilderExpressionInformation.$new();
      if (AExpression === "") {
        this.RemoveExpression();
        return;
      };
      b = this.GetBuilder();
      if (b != null) {
        ei.$assign(b.GetExpressionInformation(AExpression))}
       else {
        ei.$assign($impl.GetInternalExpressionInformation(AExpression,$mod.TTMSFNCFilterBuilderParseFormatInfo.$clone($impl.GetDefaultParseFormatInfo(ADataSet)),$mod.TTMSFNCFilterBuilderExpressionOperatorFormat.$clone($impl.GetDefaultExpressionOperatorFormat(ADataSet)),ADataSet));
        ei.Value = $mod.ParseValueTextToFNCValue(ei.ValueText,$mod.TTMSFNCFilterBuilderDataType.fdtAutomatic,pas.SysUtils.TFormatSettings.$clone(pas.SysUtils.TFormatSettings.Create()));
      };
      if (ei.IsGroup) {
        if (this.GetParentGroup() != null) this.GetParentGroup().ChangeExpressionToGroup(AExpression,this);
        return;
      };
      this.FValueText = ei.ValueText;
      this.FValue = ei.Value;
      this.FBackupColName = ei.ColumnName;
      this.FColumn = ei.Column;
      this.FExpressionOperator = ei.ExpressionOperator;
      this.FIsInverted = ei.Inverted;
      if (b != null) b.DoFilterExpressionTextParsed(this,AExpression);
    };
    this.RemoveExpression = function () {
      if ((this.FFilterExpressions != null) && (this.FFilterExpressions.FParentGroup != null)) this.FFilterExpressions.FParentGroup.RemoveExpression(this);
    };
    this.GetBuilder = function () {
      var Result = null;
      Result = null;
      if ((this.FFilterExpressions != null) && (this.FFilterExpressions.FParentGroup != null)) Result = this.FFilterExpressions.FParentGroup.GetBuilder();
      this.DoGetFilterBuilder({get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.DoGetFilterBuilder = function (AFilterBuilder) {
      if (this.FOnGetFilterBuilder != null) this.FOnGetFilterBuilder(this,AFilterBuilder);
    };
    this.Create$1 = function (AFilterExpressions) {
      pas.System.TObject.Create.call(this);
      this.FFilterExpressions = AFilterExpressions;
      this.FColumn = null;
      this.FValue = "";
      this.FValueText = "";
      this.FIsInverted = false;
      this.FCaseSensitive = false;
      this.FExpressionOperator = $mod.TTMSFNCFilterBuilderExpressionOperator.feoNotEmpty;
      return this;
    };
    this.Destroy = function () {
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      var b = null;
      if ($mod.TTMSFNCFilterBuilderExpression.isPrototypeOf(Source)) {
        b = this.GetBuilder();
        if ((b != null) && (rtl.as(Source,$mod.TTMSFNCFilterBuilderExpression).FColumn != null)) this.FColumn = b.GetColumnByName(rtl.as(Source,$mod.TTMSFNCFilterBuilderExpression).FColumn.FName);
        if (!(this.FColumn != null)) this.FBackupColName = rtl.as(Source,$mod.TTMSFNCFilterBuilderExpression).FBackupColName;
        this.FValue = rtl.as(Source,$mod.TTMSFNCFilterBuilderExpression).FValue;
        this.FValueText = rtl.as(Source,$mod.TTMSFNCFilterBuilderExpression).FValueText;
        this.FIsInverted = rtl.as(Source,$mod.TTMSFNCFilterBuilderExpression).FIsInverted;
        this.FExpressionOperator = rtl.as(Source,$mod.TTMSFNCFilterBuilderExpression).FExpressionOperator;
        this.FCaseSensitive = rtl.as(Source,$mod.TTMSFNCFilterBuilderExpression).FCaseSensitive;
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    this.SetColumnByName = function (AName) {
      var b = null;
      b = this.GetBuilder();
      if (b != null) this.FColumn = b.GetColumnByName(AName);
      this.FBackupColName = AName;
      this.DoChanged();
    };
    this.ValidateExpression = function (AInput) {
      var Result = false;
      Result = this.InternalValidateExpression(AInput,$mod.TTMSFNCFilterBuilderDataType.fdtAutomatic);
      return Result;
    };
    this.GetColumnName = function () {
      var Result = "";
      if (this.FColumn != null) {
        Result = this.FColumn.FName}
       else Result = this.FBackupColName;
      return Result;
    };
    this.GetColumnDisplayName = function () {
      var Result = "";
      if (this.FColumn != null) {
        Result = this.FColumn.GetDisplayName()}
       else Result = this.FBackupColName;
      return Result;
    };
    this.GetValueDataType = function () {
      var Result = 0;
      Result = $mod.TTMSFNCFilterBuilderDataType.fdtAutomatic;
      this.UpdateColumn();
      if (this.FColumn != null) Result = this.FColumn.FDataType;
      return Result;
    };
    var $r = this.$rtti;
    $r.addProperty("Column",2,$mod.$rtti["TTMSFNCFilterBuilderColumn"],"FColumn","SetColumn");
    $r.addProperty("ExpressionOperator",2,$mod.$rtti["TTMSFNCFilterBuilderExpressionOperator"],"FExpressionOperator","SetExpressionOperator",4,{Default: $mod.TTMSFNCFilterBuilderExpressionOperator.feoNotEmpty});
    $r.addProperty("Value",2,rtl.jsvalue,"FValue","SetValue");
    $r.addProperty("IsInverted",2,rtl.boolean,"FIsInverted","SetInverted");
    $r.addProperty("CaseSensitive",2,rtl.boolean,"FCaseSensitive","SetCaseSensitive",4,{Default: false});
    $r.addProperty("OnGetFilterBuilder",0,$mod.$rtti["TTMSFNCGetFilterBuilderEvent"],"FOnGetFilterBuilder","FOnGetFilterBuilder");
  });
  rtl.createClass(this,"TTMSFNCFilterBuilderExpressions",pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression,function () {
    this.$init = function () {
      pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression.$init.call(this);
      this.FParentGroup = null;
      this.FOnInternalChanged = null;
    };
    this.$final = function () {
      this.FParentGroup = undefined;
      this.FOnInternalChanged = undefined;
      pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression.$final.call(this);
    };
    this.GetBuilder = function () {
      var Result = null;
      Result = null;
      if (this.FParentGroup != null) Result = this.FParentGroup.GetBuilder();
      return Result;
    };
    this.DoChanged = function () {
      if (this.FOnInternalChanged != null) this.FOnInternalChanged(this);
    };
    this.Add$1 = function (AExpression) {
      var Result = null;
      Result = this.Add$3();
      if ((AExpression !== "") && !$impl.IsGroup(AExpression,this.GetBuilder())) Result.GenerateExpression(AExpression,false);
      this.DoExpressionAdded(Result);
      return Result;
    };
    this.Add$2 = function (AExpression) {
      var Result = null;
      pas["Generics.Collections"].TList$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression.Add.call(this,AExpression);
      Result = AExpression;
      return Result;
    };
    this.DoExpressionAdded = function (AExpression) {
      var b = null;
      b = this.GetBuilder();
      if (b != null) b.DoOnExpressionAdded(AExpression);
    };
    this.Create$7 = function (AOwner) {
      pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression.Create$4.call(this,true);
      this.FParentGroup = null;
      if ($mod.TTMSFNCFilterBuilderGroup.isPrototypeOf(AOwner)) this.FParentGroup = AOwner;
      return this;
    };
    this.Add$3 = function () {
      var Result = null;
      var i = null;
      i = $mod.TTMSFNCFilterBuilderExpression.$create("Create$1",[this]);
      pas["Generics.Collections"].TList$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression.Add.call(this,i);
      Result = i;
      return Result;
    };
    this.Add$4 = function (AColumnName, AExpressionOperator, AValue, AInverted, ACaseSensitive) {
      var Result = null;
      var b = null;
      var c = null;
      b = this.GetBuilder();
      c = null;
      if (b != null) c = b.GetDataColumn(AColumnName);
      Result = this.Add$5(c,AExpressionOperator,AValue,AInverted,ACaseSensitive);
      return Result;
    };
    this.Add$5 = function (AColumn, AExpressionOperator, AValue, AInverted, ACaseSensitive) {
      var Result = null;
      Result = this.Add$3();
      Result.FColumn = AColumn;
      Result.FBackupColName = AColumn.GetDisplayName();
      Result.FExpressionOperator = AExpressionOperator;
      Result.FValueText = pas["TMS.TMSFNCValue"].ValueToString(AValue);
      Result.FValue = AValue;
      Result.FIsInverted = AInverted;
      Result.FCaseSensitive = ACaseSensitive;
      this.DoExpressionAdded(Result);
      return Result;
    };
    this.Add$6 = function (AColumnName, AValue) {
      var Result = null;
      Result = this.Add$4(AColumnName,$mod.TTMSFNCFilterBuilderExpressionOperator.feoEqual,AValue,false,false);
      return Result;
    };
    this.Add$7 = function (AColumn, AValue) {
      var Result = null;
      Result = this.Add$5(AColumn,$mod.TTMSFNCFilterBuilderExpressionOperator.feoEqual,AValue,false,false);
      return Result;
    };
    this.GetExpressionIndex = function (AExpression) {
      var Result = 0;
      var I = 0;
      Result = -1;
      for (var $l = 0, $end = this.FLength - 1; $l <= $end; $l++) {
        I = $l;
        if (AExpression === this.GetItem(I)) {
          Result = I;
          break;
        };
      };
      return Result;
    };
    this.Assign = function (Source) {
      var I = 0;
      var it = null;
      if ($mod.TTMSFNCFilterBuilderExpressions.isPrototypeOf(Source)) {
        this.Clear();
        for (var $l = 0, $end = rtl.as(Source,$mod.TTMSFNCFilterBuilderExpressions).FLength - 1; $l <= $end; $l++) {
          I = $l;
          it = this.Add$3();
          it.Assign(rtl.as(Source,$mod.TTMSFNCFilterBuilderExpressions).GetItem(I));
        };
      };
    };
  });
  this.$rtti.$Class("TTMSFNCFilterBuilderGroups");
  rtl.createClass(this,"TTMSFNCFilterBuilderGroup",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FUpdateCount = 0;
      this.FBuilder = null;
      this.FGroupOperator = 0;
      this.FOwnerGroups = null;
      this.FGroups = null;
      this.FExpressions = null;
      this.FOnInternalChanged = null;
      this.FDataPointer = null;
      this.FDataBoolean = false;
      this.FDataString = "";
      this.FDataObject = null;
      this.FDataInteger = 0;
      this.FOnGetFilterBuilder = null;
    };
    this.$final = function () {
      this.FBuilder = undefined;
      this.FOwnerGroups = undefined;
      this.FGroups = undefined;
      this.FExpressions = undefined;
      this.FOnInternalChanged = undefined;
      this.FDataObject = undefined;
      this.FOnGetFilterBuilder = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetGroupOperator = function (AValue) {
      if (this.FGroupOperator !== AValue) {
        this.FGroupOperator = AValue;
        this.DoChanged();
      };
    };
    this.SetGroups = function (AValue) {
      this.FGroups.Assign(AValue);
      this.DoChanged();
    };
    this.SetExpressions = function (AValue) {
      this.FExpressions.Assign(AValue);
      this.DoChanged();
    };
    this.RemoveExpression = function (AExpression) {
      this.FExpressions.Delete(AExpression.GetIndex());
    };
    this.RemoveGroup = function (AGroup) {
      this.FGroups.Delete(AGroup.GetIndex());
    };
    this.RemoveThisGroup = function () {
      if ((this.FGroups != null) && (this.FGroups.FParentGroup != null)) this.FGroups.FParentGroup.RemoveGroup(this);
    };
    this.ChangeExpressionToGroup = function (AExpressionText, AExpression) {
      this.RemoveExpression(AExpression);
      if (AExpressionText !== "") {
        this.ParseExpression($impl.RemoveGroupOperators$1(AExpressionText,this.GetBuilder()));
      };
    };
    this.PopulateGroup = function (AGroups, AExpressions) {
      var I = 0;
      this.FGroups.Clear();
      this.FExpressions.Clear();
      for (var $l = 0, $end = rtl.length(AGroups) - 1; $l <= $end; $l++) {
        I = $l;
        this.FGroups.Add$3(AGroups[I]);
        AGroups[I].FOwnerGroups = this.FGroups;
      };
      for (var $l1 = 0, $end1 = rtl.length(AExpressions) - 1; $l1 <= $end1; $l1++) {
        I = $l1;
        this.FExpressions.Add$2(AExpressions[I]);
        AExpressions[I].FFilterExpressions = this.FExpressions;
      };
    };
    this.GetInternalFilterText = function (ADisplayNames) {
      var Result = "";
      var t = "";
      var o = "";
      var I = 0;
      var b = null;
      var pf = $mod.TTMSFNCFilterBuilderParseFormatInfo.$new();
      var exp = "";
      var gr = "";
      b = this.GetBuilder();
      if (b != null) {
        pf.$assign($impl.GetParseFormatInfo(b.FParseFormat))}
       else pf.$assign($impl.GetDefaultParseFormatInfo(true));
      var $tmp = this.FGroupOperator;
      if ($tmp === $mod.TTMSFNCFilterBuilderGroupOperator.fgoAND) {
        o = pf.AndOperator}
       else {
        o = pf.OrOperator;
      };
      t = "";
      for (var $l = 0, $end = this.FGroups.FLength - 1; $l <= $end; $l++) {
        I = $l;
        gr = this.FGroups.GetItem(I).GetInternalFilterText(true);
        if ((I > 0) && (gr !== "")) t = t + " " + o + " ";
        t = t + pf.ParenthesisOpen + gr + pf.ParenthesisClose;
      };
      for (var $l1 = 0, $end1 = this.FExpressions.FLength - 1; $l1 <= $end1; $l1++) {
        I = $l1;
        exp = this.FExpressions.GetItem(I).GetInternalExpression(ADisplayNames);
        if ((t !== "") && (exp !== "")) t = t + " " + o + " ";
        t = t + exp;
      };
      if (b != null) {
        if (this === b.FFilter) {
          if (ADisplayNames) {
            b.DoGetDisplayFilterText(b.FFilter,{get: function () {
                return t;
              }, set: function (v) {
                t = v;
              }})}
           else b.DoGetFilterText(b.FFilter,{get: function () {
              return t;
            }, set: function (v) {
              t = v;
            }});
        } else b.DoGetGroupText(this,{get: function () {
            return t;
          }, set: function (v) {
            t = v;
          }});
      };
      Result = t;
      return Result;
    };
    this.GetFilterText = function () {
      var Result = "";
      Result = this.GetInternalFilterText(false);
      return Result;
    };
    this.DoChanged = function () {
      if (this.FOwnerGroups != null) this.FOwnerGroups.DoChanged();
      if (this.FOnInternalChanged != null) this.FOnInternalChanged(this);
    };
    this.DoInternalGroupsChanged = function (Sender) {
      this.DoChanged();
    };
    this.DoInternalExpressionsChanged = function (Sender) {
      this.DoChanged();
    };
    this.ParseExpression = function (AExpression) {
      var $Self = this;
      var b = null;
      var ExpArr = [];
      var gftext = "";
      var iftext = "";
      var J = 0;
      var OrOp = false;
      var pfi = $mod.TTMSFNCFilterBuilderParseFormatInfo.$new();
      function IsOperator(Token) {
        var Result = false;
        Result = pas.SysUtils.TStringHelper.Equals$1.call({a: $impl.SetUpperCase(Token), get: function () {
            return this.a;
          }, set: function (v) {
            this.a = v;
          }},$impl.SetUpperCase(pfi.AndOperator)) || pas.SysUtils.TStringHelper.Equals$1.call({a: $impl.SetUpperCase(Token), get: function () {
            return this.a;
          }, set: function (v) {
            this.a = v;
          }},$impl.SetUpperCase(pfi.OrOperator));
        return Result;
      };
      if (AExpression === "") {
        this.RemoveThisGroup();
        return;
      };
      this.BeginUpdate();
      this.FGroups.Clear();
      this.FExpressions.Clear();
      if (pas.SysUtils.Trim(AExpression) !== "") {
        b = this.GetBuilder();
        if (b != null) {
          pfi.$assign($impl.GetParseFormatInfo(b.FParseFormat))}
         else pfi.$assign($impl.GetDefaultParseFormatInfo(true));
        OrOp = false;
        ExpArr = $impl.SplitExpression(AExpression,$mod.TTMSFNCFilterBuilderParseFormatInfo.$clone(pfi));
        if ((rtl.length(ExpArr) === 1) && pas.SysUtils.TStringHelper.StartsWith.call({a: 0, p: ExpArr, get: function () {
            return this.p[this.a];
          }, set: function (v) {
            this.p[this.a] = v;
          }},pfi.ParenthesisOpen) && pas.SysUtils.TStringHelper.EndsWith.call({a: 0, p: ExpArr, get: function () {
            return this.p[this.a];
          }, set: function (v) {
            this.p[this.a] = v;
          }},pfi.ParenthesisClose)) ExpArr = $impl.SplitExpression($impl.RemoveGroupOperators(AExpression,$mod.TTMSFNCFilterBuilderParseFormatInfo.$clone(pfi)),$mod.TTMSFNCFilterBuilderParseFormatInfo.$clone(pfi));
        iftext = "";
        for (var $l = 0, $end = rtl.length(ExpArr) - 1; $l <= $end; $l++) {
          J = $l;
          if (pas.SysUtils.TStringHelper.StartsWith.call({a: J, p: ExpArr, get: function () {
              return this.p[this.a];
            }, set: function (v) {
              this.p[this.a] = v;
            }},pfi.ParenthesisOpen) && pas.SysUtils.TStringHelper.EndsWith.call({a: J, p: ExpArr, get: function () {
              return this.p[this.a];
            }, set: function (v) {
              this.p[this.a] = v;
            }},pfi.ParenthesisClose)) {
            if (iftext !== "") {
              this.FExpressions.Add$1(pas.SysUtils.Trim(iftext));
              iftext = "";
            };
            gftext = $impl.RemoveGroupOperators$1(ExpArr[J],b);
            this.FGroups.Add$1(gftext);
          } else if (IsOperator(ExpArr[J])) {
            if (iftext !== "") {
              this.FExpressions.Add$1(pas.SysUtils.Trim(iftext));
              iftext = "";
            };
            OrOp = $impl.SetUpperCase(ExpArr[J]) === $impl.SetUpperCase(pfi.OrOperator);
          } else if (pas.SysUtils.Trim(ExpArr[J]) !== "") iftext = iftext + " " + pas.SysUtils.Trim(ExpArr[J]);
        };
        if (iftext !== "") this.FExpressions.Add$1(pas.SysUtils.Trim(iftext));
        if (OrOp) {
          this.FGroupOperator = $mod.TTMSFNCFilterBuilderGroupOperator.fgoOR}
         else this.FGroupOperator = $mod.TTMSFNCFilterBuilderGroupOperator.fgoAND;
        this.EndUpdate();
      };
    };
    this.GetIndex = function () {
      var Result = 0;
      Result = -1;
      if (this.FGroups != null) Result = this.FGroups.GetGroupIndex(this);
      return Result;
    };
    this.BeginUpdate = function () {
      this.FUpdateCount += 1;
    };
    this.EndUpdate = function () {
      this.FUpdateCount -= 1;
      if (this.FUpdateCount <= 0) {
        this.FUpdateCount = 0;
      };
    };
    this.InitializeCreate = function (AGroupOperator) {
      this.FGroupOperator = AGroupOperator;
      this.FGroups = $mod.TTMSFNCFilterBuilderGroups.$create("Create$7",[this]);
      this.FGroups.FOnInternalChanged = rtl.createCallback(this,"DoInternalGroupsChanged");
      this.FExpressions = $mod.TTMSFNCFilterBuilderExpressions.$create("Create$7",[this]);
      this.FExpressions.FOnInternalChanged = rtl.createCallback(this,"DoInternalExpressionsChanged");
    };
    this.GetBuilder = function () {
      var Result = null;
      Result = this.FBuilder;
      if ((this.FOwnerGroups != null) && (this.FOwnerGroups.FParentGroup != null)) Result = this.FOwnerGroups.FParentGroup.GetBuilder();
      this.DoGetFilterBuilder({get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.DoGetFilterBuilder = function (AFilterBuilder) {
      if (this.FOnGetFilterBuilder != null) this.FOnGetFilterBuilder(this,AFilterBuilder);
    };
    this.Create$1 = function (AGroups) {
      this.FBuilder = null;
      this.FOwnerGroups = AGroups;
      this.InitializeCreate($mod.TTMSFNCFilterBuilderGroupOperator.fgoAND);
      return this;
    };
    this.Create$2 = function (ABuilder) {
      this.FBuilder = ABuilder;
      this.FOwnerGroups = null;
      this.InitializeCreate($mod.TTMSFNCFilterBuilderGroupOperator.fgoAND);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FGroups");
      rtl.free(this,"FExpressions");
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCFilterBuilderGroup.isPrototypeOf(Source)) {
        this.FGroupOperator = rtl.as(Source,$mod.TTMSFNCFilterBuilderGroup).FGroupOperator;
        this.FGroups.Assign(rtl.as(Source,$mod.TTMSFNCFilterBuilderGroup).FGroups);
        this.FExpressions.Assign(rtl.as(Source,$mod.TTMSFNCFilterBuilderGroup).FExpressions);
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    this.GetGroupOperatorText = function () {
      var Result = "";
      var b = null;
      Result = "";
      b = this.GetBuilder();
      if (b != null) Result = b.GetOperatorText(this.FGroupOperator);
      return Result;
    };
    this.ValidateFilter = function (AInputData) {
      var $Self = this;
      var Result = false;
      var ex = false;
      var isValid = false;
      var expres = false;
      var b = null;
      var colIdx = 0;
      var I = 0;
      var val = undefined;
      var dt = 0;
      function ExitValidation(AIsValid) {
        var Result = false;
        Result = false;
        isValid = AIsValid;
        var $tmp = $Self.FGroupOperator;
        if ($tmp === $mod.TTMSFNCFilterBuilderGroupOperator.fgoAND) {
          Result = !AIsValid}
         else if ($tmp === $mod.TTMSFNCFilterBuilderGroupOperator.fgoOR) Result = AIsValid;
        return Result;
      };
      isValid = true;
      b = this.GetBuilder();
      for (var $l = 0, $end = this.FGroups.FLength - 1; $l <= $end; $l++) {
        I = $l;
        expres = this.FGroups.GetItem(I).ValidateFilter(rtl.arrayRef(AInputData));
        ex = ExitValidation(expres);
        if (b != null) b.DoValidateGroup(this.FGroups.GetItem(I),rtl.arrayRef(AInputData),{get: function () {
            return expres;
          }, set: function (v) {
            expres = v;
          }},{get: function () {
            return ex;
          }, set: function (v) {
            ex = v;
          }});
        if (ex) {
          Result = isValid;
          return Result;
        };
      };
      for (var $l1 = 0, $end1 = this.FExpressions.FLength - 1; $l1 <= $end1; $l1++) {
        I = $l1;
        colIdx = -1;
        dt = $mod.TTMSFNCFilterBuilderDataType.fdtAutomatic;
        if (b != null) {
          this.FExpressions.GetItem(I).UpdateColumn();
          val = pas["TMS.TMSFNCValue"].TValueToFNCValue(pas.RTTI.TValue.$clone(pas.RTTI.TValue.Empty()));
          if (this.FExpressions.GetItem(I).FColumn != null) {
            colIdx = this.FExpressions.GetItem(I).FColumn.GetIndex();
            if (colIdx < b.FDataColumns.FLength) val = AInputData[colIdx];
            dt = this.FExpressions.GetItem(I).FColumn.FDataType;
          };
        };
        if (colIdx >= 0) {
          expres = this.FExpressions.GetItem(I).InternalValidateExpression(val,dt);
          ex = ExitValidation(expres);
          if (b != null) b.DoValidateExpression(this.FExpressions.GetItem(I),val,{get: function () {
              return expres;
            }, set: function (v) {
              expres = v;
            }},{get: function () {
              return ex;
            }, set: function (v) {
              ex = v;
            }});
        } else ex = ExitValidation(false);
        if (ex) {
          Result = isValid;
          return Result;
        };
      };
      Result = isValid;
      return Result;
    };
    this.AddExpression = function () {
      var Result = null;
      Result = this.FExpressions.Add$3();
      return Result;
    };
    this.AddExpression$1 = function (AColumnName, AExpressionOperator, AValue, AInverted, ACaseSensitive) {
      var Result = null;
      Result = this.FExpressions.Add$4(AColumnName,AExpressionOperator,AValue,AInverted,ACaseSensitive);
      return Result;
    };
    this.AddExpression$2 = function (AColumn, AExpressionOperator, AValue, AInverted, ACaseSensitive) {
      var Result = null;
      Result = this.FExpressions.Add$5(AColumn,AExpressionOperator,AValue,AInverted,ACaseSensitive);
      return Result;
    };
    this.AddExpression$3 = function (AColumnName, AValue) {
      var Result = null;
      Result = this.FExpressions.Add$6(AColumnName,AValue);
      return Result;
    };
    this.AddExpression$4 = function (AColumn, AValue) {
      var Result = null;
      Result = this.FExpressions.Add$7(AColumn,AValue);
      return Result;
    };
    this.AddGroup = function (AGroupOperator) {
      var Result = null;
      Result = this.FGroups.Add$2();
      Result.FGroupOperator = AGroupOperator;
      return Result;
    };
    this.AddANDGroup = function () {
      var Result = null;
      Result = this.AddGroup($mod.TTMSFNCFilterBuilderGroupOperator.fgoAND);
      return Result;
    };
    this.AddORGroup = function () {
      var Result = null;
      Result = this.AddGroup($mod.TTMSFNCFilterBuilderGroupOperator.fgoOR);
      return Result;
    };
    this.Clear = function () {
      var b = null;
      b = this.FBuilder;
      if ((b != null) && (this === b.FFilter)) {
        b.ClearFilter()}
       else {
        this.FGroups.Clear();
        this.FExpressions.Clear();
      };
    };
  });
  rtl.createClass(this,"TTMSFNCFilterBuilderFilter",this.TTMSFNCFilterBuilderGroup,function () {
  });
  rtl.createClass(this,"TTMSFNCFilterBuilderGroups",pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup,function () {
    this.$init = function () {
      pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup.$init.call(this);
      this.FBuilder = null;
      this.FParentGroup = null;
      this.FOnInternalChanged = null;
    };
    this.$final = function () {
      this.FBuilder = undefined;
      this.FParentGroup = undefined;
      this.FOnInternalChanged = undefined;
      pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup.$final.call(this);
    };
    this.DoInternalGroupsChanged = function (Sender) {
      this.DoChanged();
    };
    this.DoInternalExpressionsChanged = function (Sender) {
      this.DoChanged();
    };
    this.DoChanged = function () {
      if (this.FOnInternalChanged != null) this.FOnInternalChanged(this);
    };
    this.GetGroupIndex = function (AGroup) {
      var Result = 0;
      var I = 0;
      Result = -1;
      for (var $l = 0, $end = this.FLength - 1; $l <= $end; $l++) {
        I = $l;
        if (AGroup === this.GetItem(I)) {
          Result = I;
          break;
        };
      };
      return Result;
    };
    this.Add$1 = function (AExpression) {
      var Result = null;
      Result = this.Add$2();
      if (AExpression !== "") Result.ParseExpression(AExpression);
      return Result;
    };
    this.Create$7 = function (AOwner) {
      pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup.Create$4.call(this,true);
      this.FBuilder = null;
      this.FParentGroup = null;
      if ($mod.TTMSFNCCustomFilterBuilder.isPrototypeOf(AOwner)) {
        this.FBuilder = AOwner}
       else if ($mod.TTMSFNCFilterBuilderGroup.isPrototypeOf(AOwner)) this.FParentGroup = AOwner;
      return this;
    };
    this.Destroy = function () {
      pas["Generics.Collections"].TList$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup.Destroy.call(this);
    };
    this.Add$2 = function () {
      var Result = null;
      var g = null;
      g = $mod.TTMSFNCFilterBuilderGroup.$create("Create$1",[this]);
      g.FOwnerGroups = this;
      pas["Generics.Collections"].TList$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup.Add.call(this,g);
      Result = g;
      return Result;
    };
    this.Add$3 = function (AGroup) {
      var Result = null;
      AGroup.FOwnerGroups = this;
      pas["Generics.Collections"].TList$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup.Add.call(this,AGroup);
      Result = AGroup;
      return Result;
    };
    this.GetBuilder = function () {
      var Result = null;
      Result = this.FBuilder;
      if (this.FParentGroup != null) Result = this.FParentGroup.GetBuilder();
      return Result;
    };
    this.Assign = function (Source) {
      var I = 0;
      var g = null;
      if ($mod.TTMSFNCFilterBuilderGroups.isPrototypeOf(Source)) {
        this.Clear();
        for (var $l = 0, $end = rtl.as(Source,$mod.TTMSFNCFilterBuilderGroups).FLength - 1; $l <= $end; $l++) {
          I = $l;
          g = this.Add$2();
          g.Assign(rtl.as(Source,$mod.TTMSFNCFilterBuilderGroups).GetItem(I));
        };
      };
    };
  });
  this.$rtti.$MethodVar("TTMSFNCFilterBuilderFilterEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFilterText",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCFilterBuilderGetColumnDataEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumnData",this.$rtti["TTMSFNCFilterBuilderColumns"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCFilterBuilderGetGroupTextEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGroup",this.$rtti["TTMSFNCFilterBuilderGroup"]],["AText",rtl.string,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCFilterBuilderGetExpressionTextEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AExpression",this.$rtti["TTMSFNCFilterBuilderExpression"]],["AText",rtl.string,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCFilterBuilderExpressionTextParsedEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AExpression",this.$rtti["TTMSFNCFilterBuilderExpression"]],["AText",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCFilterBuilderFilterTextParsedEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFilter",this.$rtti["TTMSFNCFilterBuilderGroup"]],["AText",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCFilterBuilderGetFormatSettingsEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFormatSettings",pas.SysUtils.$rtti["TFormatSettings"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCFilterBuilderParseErrorEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFilterText",rtl.string],["AErrorPosition",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCFilterBuilderValidateGroupEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGroup",this.$rtti["TTMSFNCFilterBuilderGroup"]],["AInputData",pas.System.$rtti["TArray<System.JSValue>"]],["AValidationResult",rtl.boolean,1],["AExitValidation",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCFilterBuilderValidateFilterEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AInputData",pas.System.$rtti["TArray<System.JSValue>"]],["AValidationResult",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCFilterBuilderValidateExpressionEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AExpression",this.$rtti["TTMSFNCFilterBuilderExpression"]],["AInputValue",rtl.jsvalue],["AValidationResult",rtl.boolean,1],["AExitValidation",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCFilterBuilderFilterAllowEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AAllow",rtl.boolean,1]]), methodkind: 0});
  rtl.recNewT(this,"TTMSFNCFilterBuilderParseFormatInfo",function () {
    this.ParenthesisOpen = "";
    this.ParenthesisClose = "";
    this.ColumnOpen = "";
    this.ColumnClose = "";
    this.AndOperator = "";
    this.OrOperator = "";
    this.NotOperator = "";
    this.$eq = function (b) {
      return (this.ParenthesisOpen === b.ParenthesisOpen) && (this.ParenthesisClose === b.ParenthesisClose) && (this.ColumnOpen === b.ColumnOpen) && (this.ColumnClose === b.ColumnClose) && (this.AndOperator === b.AndOperator) && (this.OrOperator === b.OrOperator) && (this.NotOperator === b.NotOperator);
    };
    this.$assign = function (s) {
      this.ParenthesisOpen = s.ParenthesisOpen;
      this.ParenthesisClose = s.ParenthesisClose;
      this.ColumnOpen = s.ColumnOpen;
      this.ColumnClose = s.ColumnClose;
      this.AndOperator = s.AndOperator;
      this.OrOperator = s.OrOperator;
      this.NotOperator = s.NotOperator;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCFilterBuilderParseFormatInfo",{},this);
    $r.addField("ParenthesisOpen",rtl.string);
    $r.addField("ParenthesisClose",rtl.string);
    $r.addField("ColumnOpen",rtl.string);
    $r.addField("ColumnClose",rtl.string);
    $r.addField("AndOperator",rtl.string);
    $r.addField("OrOperator",rtl.string);
    $r.addField("NotOperator",rtl.string);
  });
  rtl.recNewT(this,"TTMSFNCFilterBuilderExpressionOperatorFormat",function () {
    this.MultiCharWildCard = "";
    this.SingleCharWildCard = "";
    this.StartsWithOpen = "";
    this.StartsWithClose = "";
    this.EndsWithOpen = "";
    this.EndsWithClose = "";
    this.ContainsOpen = "";
    this.ContainsClose = "";
    this.NotContainsClose = "";
    this.EqualOpen = "";
    this.EqualClose = "";
    this.EqualStrOpen = "";
    this.EqualStrClose = "";
    this.NotEqualOpen = "";
    this.NotEqualClose = "";
    this.Empty = "";
    this.NotEmpty = "";
    this.LargerThanOpen = "";
    this.LargerThanClose = "";
    this.SmallerThanOpen = "";
    this.SmallerThanClose = "";
    this.LargerThanOrEqualOpen = "";
    this.LargerThanOrEqualClose = "";
    this.SmallerThanOrEqualOpen = "";
    this.SmallerThanOrEqualClose = "";
    this.StringDelimiter = "";
    this.$eq = function (b) {
      return (this.MultiCharWildCard === b.MultiCharWildCard) && (this.SingleCharWildCard === b.SingleCharWildCard) && (this.StartsWithOpen === b.StartsWithOpen) && (this.StartsWithClose === b.StartsWithClose) && (this.EndsWithOpen === b.EndsWithOpen) && (this.EndsWithClose === b.EndsWithClose) && (this.ContainsOpen === b.ContainsOpen) && (this.ContainsClose === b.ContainsClose) && (this.NotContainsClose === b.NotContainsClose) && (this.EqualOpen === b.EqualOpen) && (this.EqualClose === b.EqualClose) && (this.EqualStrOpen === b.EqualStrOpen) && (this.EqualStrClose === b.EqualStrClose) && (this.NotEqualOpen === b.NotEqualOpen) && (this.NotEqualClose === b.NotEqualClose) && (this.Empty === b.Empty) && (this.NotEmpty === b.NotEmpty) && (this.LargerThanOpen === b.LargerThanOpen) && (this.LargerThanClose === b.LargerThanClose) && (this.SmallerThanOpen === b.SmallerThanOpen) && (this.SmallerThanClose === b.SmallerThanClose) && (this.LargerThanOrEqualOpen === b.LargerThanOrEqualOpen) && (this.LargerThanOrEqualClose === b.LargerThanOrEqualClose) && (this.SmallerThanOrEqualOpen === b.SmallerThanOrEqualOpen) && (this.SmallerThanOrEqualClose === b.SmallerThanOrEqualClose) && (this.StringDelimiter === b.StringDelimiter);
    };
    this.$assign = function (s) {
      this.MultiCharWildCard = s.MultiCharWildCard;
      this.SingleCharWildCard = s.SingleCharWildCard;
      this.StartsWithOpen = s.StartsWithOpen;
      this.StartsWithClose = s.StartsWithClose;
      this.EndsWithOpen = s.EndsWithOpen;
      this.EndsWithClose = s.EndsWithClose;
      this.ContainsOpen = s.ContainsOpen;
      this.ContainsClose = s.ContainsClose;
      this.NotContainsClose = s.NotContainsClose;
      this.EqualOpen = s.EqualOpen;
      this.EqualClose = s.EqualClose;
      this.EqualStrOpen = s.EqualStrOpen;
      this.EqualStrClose = s.EqualStrClose;
      this.NotEqualOpen = s.NotEqualOpen;
      this.NotEqualClose = s.NotEqualClose;
      this.Empty = s.Empty;
      this.NotEmpty = s.NotEmpty;
      this.LargerThanOpen = s.LargerThanOpen;
      this.LargerThanClose = s.LargerThanClose;
      this.SmallerThanOpen = s.SmallerThanOpen;
      this.SmallerThanClose = s.SmallerThanClose;
      this.LargerThanOrEqualOpen = s.LargerThanOrEqualOpen;
      this.LargerThanOrEqualClose = s.LargerThanOrEqualClose;
      this.SmallerThanOrEqualOpen = s.SmallerThanOrEqualOpen;
      this.SmallerThanOrEqualClose = s.SmallerThanOrEqualClose;
      this.StringDelimiter = s.StringDelimiter;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCFilterBuilderExpressionOperatorFormat",{},this);
    $r.addField("MultiCharWildCard",rtl.string);
    $r.addField("SingleCharWildCard",rtl.string);
    $r.addField("StartsWithOpen",rtl.string);
    $r.addField("StartsWithClose",rtl.string);
    $r.addField("EndsWithOpen",rtl.string);
    $r.addField("EndsWithClose",rtl.string);
    $r.addField("ContainsOpen",rtl.string);
    $r.addField("ContainsClose",rtl.string);
    $r.addField("NotContainsClose",rtl.string);
    $r.addField("EqualOpen",rtl.string);
    $r.addField("EqualClose",rtl.string);
    $r.addField("EqualStrOpen",rtl.string);
    $r.addField("EqualStrClose",rtl.string);
    $r.addField("NotEqualOpen",rtl.string);
    $r.addField("NotEqualClose",rtl.string);
    $r.addField("Empty",rtl.string);
    $r.addField("NotEmpty",rtl.string);
    $r.addField("LargerThanOpen",rtl.string);
    $r.addField("LargerThanClose",rtl.string);
    $r.addField("SmallerThanOpen",rtl.string);
    $r.addField("SmallerThanClose",rtl.string);
    $r.addField("LargerThanOrEqualOpen",rtl.string);
    $r.addField("LargerThanOrEqualClose",rtl.string);
    $r.addField("SmallerThanOrEqualOpen",rtl.string);
    $r.addField("SmallerThanOrEqualClose",rtl.string);
    $r.addField("StringDelimiter",rtl.string);
  });
  rtl.recNewT(this,"TTMSFNCFilterBuilderExpressionCheckInfo",function () {
    this.IsValid = false;
    this.ErrorParenthesis = 0;
    this.ErrorOperatorPosition = 0;
    this.ErrorOperatorMismatch = 0;
    this.ErrorInvalidExpression = 0;
    this.$eq = function (b) {
      return (this.IsValid === b.IsValid) && (this.ErrorParenthesis === b.ErrorParenthesis) && (this.ErrorOperatorPosition === b.ErrorOperatorPosition) && (this.ErrorOperatorMismatch === b.ErrorOperatorMismatch) && (this.ErrorInvalidExpression === b.ErrorInvalidExpression);
    };
    this.$assign = function (s) {
      this.IsValid = s.IsValid;
      this.ErrorParenthesis = s.ErrorParenthesis;
      this.ErrorOperatorPosition = s.ErrorOperatorPosition;
      this.ErrorOperatorMismatch = s.ErrorOperatorMismatch;
      this.ErrorInvalidExpression = s.ErrorInvalidExpression;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCFilterBuilderExpressionCheckInfo",{},this);
    $r.addField("IsValid",rtl.boolean);
    $r.addField("ErrorParenthesis",rtl.longint);
    $r.addField("ErrorOperatorPosition",rtl.longint);
    $r.addField("ErrorOperatorMismatch",rtl.longint);
    $r.addField("ErrorInvalidExpression",rtl.longint);
  });
  rtl.recNewT(this,"TTMSFNCFilterBuilderExpressionInformation",function () {
    this.IsEmpty = false;
    this.IsGroup = false;
    this.Column = null;
    this.ColumnName = "";
    this.ExpressionOperator = 0;
    this.Value = undefined;
    this.ValueText = "";
    this.Inverted = false;
    this.$eq = function (b) {
      return (this.IsEmpty === b.IsEmpty) && (this.IsGroup === b.IsGroup) && (this.Column === b.Column) && (this.ColumnName === b.ColumnName) && (this.ExpressionOperator === b.ExpressionOperator) && (this.Value === b.Value) && (this.ValueText === b.ValueText) && (this.Inverted === b.Inverted);
    };
    this.$assign = function (s) {
      this.IsEmpty = s.IsEmpty;
      this.IsGroup = s.IsGroup;
      this.Column = s.Column;
      this.ColumnName = s.ColumnName;
      this.ExpressionOperator = s.ExpressionOperator;
      this.Value = s.Value;
      this.ValueText = s.ValueText;
      this.Inverted = s.Inverted;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCFilterBuilderExpressionInformation",{},this);
    $r.addField("IsEmpty",rtl.boolean);
    $r.addField("IsGroup",rtl.boolean);
    $r.addField("Column",$mod.$rtti["TTMSFNCFilterBuilderColumn"]);
    $r.addField("ColumnName",rtl.string);
    $r.addField("ExpressionOperator",$mod.$rtti["TTMSFNCFilterBuilderExpressionOperator"]);
    $r.addField("Value",rtl.jsvalue);
    $r.addField("ValueText",rtl.string);
    $r.addField("Inverted",rtl.boolean);
  });
  rtl.createClass(this,"TTMSFNCCustomFilterBuilder",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FUpdateCount = 0;
      this.FFilter = null;
      this.FParseFormat = null;
      this.FDataColumns = null;
      this.FOnChanged = null;
      this.FOnGetFormatSettings = null;
      this.FOnParseErrorParenthesis = null;
      this.FOnParseErrorInvalidExpression = null;
      this.FOnParseErrorOperatorMismatch = null;
      this.FOnParseErrorOperatorPosition = null;
      this.FOnParseError = null;
      this.FOnColumnsChanged = null;
      this.FOnParseFormatChanged = null;
      this.FOnGetFilterText = null;
      this.FOnGetGroupText = null;
      this.FOnGetExpressionText = null;
      this.FOnExpressionTextParsed = null;
      this.FOnFilterTextParsed = null;
      this.FOnValidateExpression = null;
      this.FOnValidateFilter = null;
      this.FOnValidateGroup = null;
      this.FOnBeforeClearFilter = null;
      this.FOnAfterClearFilter = null;
      this.FDataPointer = null;
      this.FDataBoolean = false;
      this.FDataString = "";
      this.FDataObject = null;
      this.FDataInteger = 0;
      this.FFormatType = 0;
      this.FOnGetDisplayFilterText = null;
      this.FOnInternalChanged = null;
      this.FOnExpressionAdded = null;
    };
    this.$final = function () {
      this.FFilter = undefined;
      this.FParseFormat = undefined;
      this.FDataColumns = undefined;
      this.FOnChanged = undefined;
      this.FOnGetFormatSettings = undefined;
      this.FOnParseErrorParenthesis = undefined;
      this.FOnParseErrorInvalidExpression = undefined;
      this.FOnParseErrorOperatorMismatch = undefined;
      this.FOnParseErrorOperatorPosition = undefined;
      this.FOnParseError = undefined;
      this.FOnColumnsChanged = undefined;
      this.FOnParseFormatChanged = undefined;
      this.FOnGetFilterText = undefined;
      this.FOnGetGroupText = undefined;
      this.FOnGetExpressionText = undefined;
      this.FOnExpressionTextParsed = undefined;
      this.FOnFilterTextParsed = undefined;
      this.FOnValidateExpression = undefined;
      this.FOnValidateFilter = undefined;
      this.FOnValidateGroup = undefined;
      this.FOnBeforeClearFilter = undefined;
      this.FOnAfterClearFilter = undefined;
      this.FDataObject = undefined;
      this.FOnGetDisplayFilterText = undefined;
      this.FOnInternalChanged = undefined;
      this.FOnExpressionAdded = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.DoOnDataColumnNameChange = function (Sender, AColumn) {
      var $Self = this;
      function ChangeNameExpressionCol(AExpression) {
        if ((AExpression.FColumn != null) && (AExpression.FColumn === AColumn)) AExpression.FBackupColName = AColumn.GetDisplayName();
      };
      function ChangeNameGroupExprCol(AGroup) {
        var I = 0;
        for (var $l = 0, $end = AGroup.FGroups.FLength - 1; $l <= $end; $l++) {
          I = $l;
          ChangeNameGroupExprCol(AGroup.FGroups.GetItem(I));
        };
        for (var $l1 = 0, $end1 = AGroup.FExpressions.FLength - 1; $l1 <= $end1; $l1++) {
          I = $l1;
          ChangeNameExpressionCol(AGroup.FExpressions.GetItem(I));
        };
      };
      ChangeNameGroupExprCol(this.FFilter);
    };
    this.DoOnDataColumnRemove = function (Sender, AColumn) {
      var $Self = this;
      function RemoveExpressionCol(AExpression) {
        if ((AExpression.FColumn != null) && (AExpression.FColumn === AColumn)) AExpression.SetColumn(null);
      };
      function RemoveGroupExprCol(AGroup) {
        var I = 0;
        for (var $l = 0, $end = AGroup.FGroups.FLength - 1; $l <= $end; $l++) {
          I = $l;
          RemoveGroupExprCol(AGroup.FGroups.GetItem(I));
        };
        for (var $l1 = 0, $end1 = AGroup.FExpressions.FLength - 1; $l1 <= $end1; $l1++) {
          I = $l1;
          RemoveExpressionCol(AGroup.FExpressions.GetItem(I));
        };
      };
      RemoveGroupExprCol(this.FFilter);
    };
    this.GetFilterText = function () {
      var Result = "";
      Result = this.FFilter.GetFilterText();
      return Result;
    };
    this.SetFilter = function (Value) {
      this.FFilter.Assign(Value);
      this.DoInternalFilterChanged(this.FFilter);
    };
    this.SetParseFormat = function (Value) {
      this.FParseFormat.Assign(Value);
      this.DoInternalFormatChanged(this.FParseFormat);
    };
    this.SetDataColumns = function (Value) {
      this.FDataColumns.Assign(Value);
      this.DoInternalColumnsChanged(this.FDataColumns);
    };
    this.InternalCheckExpression = function (AExpression) {
      var $Self = this;
      var Result = $mod.TTMSFNCFilterBuilderExpressionCheckInfo.$new();
      var pfi = $mod.TTMSFNCFilterBuilderParseFormatInfo.$new();
      var ExpArr = [];
      var part = "";
      var prevPart = "";
      var original = "";
      var I = 0;
      var parCnt = 0;
      var colCnt = 0;
      var newGroup = false;
      var firstOperator = false;
      var operatorStack = null;
      var gop = 0;
      function IsOperator(Token) {
        var Result = false;
        Result = pas.SysUtils.TStringHelper.Equals$1.call({a: $impl.SetUpperCase(Token), get: function () {
            return this.a;
          }, set: function (v) {
            this.a = v;
          }},$impl.SetUpperCase($Self.FParseFormat.FAndOperator)) || pas.SysUtils.TStringHelper.Equals$1.call({a: $impl.SetUpperCase(Token), get: function () {
            return this.a;
          }, set: function (v) {
            this.a = v;
          }},$impl.SetUpperCase($Self.FParseFormat.FOrOperator));
        return Result;
      };
      function GetOperator(Token) {
        var Result = 0;
        if (pas.SysUtils.TStringHelper.Equals$1.call({a: $impl.SetUpperCase(Token), get: function () {
            return this.a;
          }, set: function (v) {
            this.a = v;
          }},$impl.SetUpperCase($Self.FParseFormat.FAndOperator))) {
          Result = $mod.TTMSFNCFilterBuilderGroupOperator.fgoAND}
         else Result = $mod.TTMSFNCFilterBuilderGroupOperator.fgoOR;
        return Result;
      };
      Result.IsValid = true;
      Result.ErrorParenthesis = -1;
      Result.ErrorOperatorPosition = -1;
      Result.ErrorOperatorMismatch = -1;
      Result.ErrorInvalidExpression = -1;
      if (pas.SysUtils.Trim(AExpression) === "") return Result;
      pfi.$assign($impl.GetParseFormatInfo(null));
      part = "";
      prevPart = "";
      original = "";
      operatorStack = pas["Generics.Collections"].TStack$$$G$$generics$collections$$TTMSFNCFilterBuilderGroupOperator.$create("Create");
      newGroup = false;
      firstOperator = true;
      parCnt = 0;
      colCnt = 0;
      try {
        ExpArr = $impl.CustomSplit(AExpression,[pfi.ParenthesisOpen,pfi.ParenthesisClose,pfi.ColumnOpen,pfi.ColumnClose," "],true);
        for (var $l = 0, $end = rtl.length(ExpArr) - 1; $l <= $end; $l++) {
          I = $l;
          if (pas.SysUtils.Trim(ExpArr[I]) !== "") {
            part = pas.SysUtils.Trim(ExpArr[I]);
            if (pas.SysUtils.TStringHelper.StartsWith.call({get: function () {
                return part;
              }, set: function (v) {
                part = v;
              }},pfi.ParenthesisOpen) && (colCnt === 0)) {
              parCnt += 1;
              newGroup = true;
            } else if ((part === pfi.ParenthesisClose) && (colCnt === 0)) {
              if (IsOperator(prevPart)) {
                Result.IsValid = false;
                Result.ErrorOperatorPosition = original.length;
                return Result;
              };
              parCnt -= 1;
              if (parCnt < 0) {
                Result.IsValid = false;
                Result.ErrorParenthesis = original.length;
                return Result;
              } else if (operatorStack.GetCount() > 1) operatorStack.Pop();
            } else if (part === pfi.ColumnOpen) {
              colCnt += 1}
             else if (part === pfi.ColumnClose) {
              colCnt -= 1}
             else if (IsOperator(part)) {
              gop = GetOperator(part);
              if (newGroup) {
                operatorStack.Push(gop);
                newGroup = false;
              } else if (firstOperator) {
                operatorStack.Push(gop);
                firstOperator = false;
              } else if (gop !== operatorStack.Peek()) {
                Result.IsValid = false;
                Result.ErrorOperatorMismatch = original.length;
                return Result;
              };
            };
            prevPart = part;
          };
          original = original + ExpArr[I];
        };
      } finally {
        operatorStack = rtl.freeLoc(operatorStack);
      };
      if (IsOperator(prevPart)) {
        Result.IsValid = false;
        Result.ErrorParenthesis = original.length;
        return Result;
      };
      if (parCnt !== 0) {
        Result.IsValid = false;
        Result.ErrorOperatorPosition = original.length;
        return Result;
      };
      if (colCnt > 0) {
        Result.IsValid = false;
        Result.ErrorInvalidExpression = original.length;
        return Result;
      };
      return Result;
    };
    this.SetFilterText = function (Value) {
      this.ParseExpression(Value);
    };
    this.SetFormatType = function (Value) {
      this.FFormatType = Value;
      var $tmp = this.FFormatType;
      if ($tmp === $mod.TTMSFNCFilterBuilderFormatType.fftDelphiDataSet) {
        this.SetDelphiDataSetFormat("'","_","%")}
       else if ($tmp === $mod.TTMSFNCFilterBuilderFormatType.fftUniversalFilterExpressions) this.SetUniversalFilterExpressionsFormat('"',"?","*");
    };
    this.GetDisplayFilterText = function () {
      var Result = "";
      Result = this.FFilter.GetInternalFilterText(true);
      return Result;
    };
    this.SetDisplayFilterText = function (Value) {
      this.ParseExpression(Value);
    };
    this.GetDataColumn = function (AName) {
      var Result = null;
      Result = this.GetColumnByName(AName);
      if (!(Result != null)) Result = this.AddDataColumn$1(AName,$mod.TTMSFNCFilterBuilderDataType.fdtAutomatic,"");
      return Result;
    };
    this.GetDataColumnType = function (AName) {
      var Result = 0;
      var c = null;
      Result = $mod.TTMSFNCFilterBuilderDataType.fdtAutomatic;
      c = this.GetDataColumn(AName);
      if (c != null) Result = c.FDataType;
      return Result;
    };
    this.SetDataColumnType = function (AName, Value) {
      var c = null;
      c = this.GetDataColumn(AName);
      if (c != null) c.SetDataType(Value);
    };
    this.GetDataColumnDisplayName = function (AName) {
      var Result = "";
      var c = null;
      Result = "";
      c = this.GetDataColumn(AName);
      if (c != null) {
        Result = c.GetDisplayName();
        if (Result === "") Result = c.FName;
      };
      return Result;
    };
    this.SetDataColumnDisplayName = function (AName, Value) {
      var c = null;
      c = this.GetDataColumn(AName);
      if (c != null) c.SetDisplayName(Value);
    };
    this.GetIsEmpty = function () {
      var Result = false;
      if (this.FFilter != null) {
        Result = (this.FFilter.FGroups.FLength === 0) && (this.FFilter.FExpressions.FLength === 0)}
       else Result = false;
      return Result;
    };
    this.GetExpressionOperatorFormat = function () {
      var Result = $mod.TTMSFNCFilterBuilderExpressionOperatorFormat.$new();
      var spl = [];
      var splTxt = "";
      Result.MultiCharWildCard = pas.SysUtils.Trim(this.FParseFormat.FMultiCharWildCard);
      Result.SingleCharWildCard = pas.SysUtils.Trim(this.FParseFormat.FSingleCharWildCard);
      Result.StringDelimiter = pas.SysUtils.Trim(this.FParseFormat.FStringDelimiter);
      splTxt = $impl.SetUpperCase(this.FParseFormat.FStartsWithOperator);
      spl = pas.SysUtils.TStringHelper.Split$8.call({get: function () {
          return splTxt;
        }, set: function (v) {
          splTxt = v;
        }},["#VALUE"]);
      if (rtl.length(spl) > 0) {
        Result.StartsWithOpen = pas.SysUtils.Trim(spl[0])}
       else Result.StartsWithOpen = "";
      if (rtl.length(spl) > 1) {
        Result.StartsWithClose = pas.SysUtils.Trim(spl[1])}
       else Result.StartsWithClose = "";
      splTxt = $impl.SetUpperCase(this.FParseFormat.FEndsWithOperator);
      spl = pas.SysUtils.TStringHelper.Split$8.call({get: function () {
          return splTxt;
        }, set: function (v) {
          splTxt = v;
        }},["#VALUE"]);
      if (rtl.length(spl) > 0) {
        Result.EndsWithOpen = pas.SysUtils.Trim(spl[0])}
       else Result.EndsWithOpen = "";
      if (rtl.length(spl) > 1) {
        Result.EndsWithClose = pas.SysUtils.Trim(spl[1])}
       else Result.EndsWithClose = "";
      splTxt = $impl.SetUpperCase(this.FParseFormat.FContainsOperator);
      spl = pas.SysUtils.TStringHelper.Split$8.call({get: function () {
          return splTxt;
        }, set: function (v) {
          splTxt = v;
        }},["#VALUE"]);
      if (rtl.length(spl) > 0) {
        Result.ContainsOpen = pas.SysUtils.Trim(spl[0])}
       else Result.ContainsOpen = "";
      if (rtl.length(spl) > 1) {
        Result.ContainsClose = pas.SysUtils.Trim(spl[1])}
       else Result.ContainsClose = "";
      splTxt = $impl.SetUpperCase(this.FParseFormat.FEqualOperator);
      spl = pas.SysUtils.TStringHelper.Split$8.call({get: function () {
          return splTxt;
        }, set: function (v) {
          splTxt = v;
        }},["#VALUE"]);
      if (rtl.length(spl) > 0) {
        Result.EqualOpen = pas.SysUtils.Trim(spl[0])}
       else Result.EqualOpen = "";
      if (rtl.length(spl) > 1) {
        Result.EqualClose = pas.SysUtils.Trim(spl[1])}
       else Result.EqualClose = "";
      splTxt = $impl.SetUpperCase(this.FParseFormat.FEqualStrOperator);
      spl = pas.SysUtils.TStringHelper.Split$8.call({get: function () {
          return splTxt;
        }, set: function (v) {
          splTxt = v;
        }},["#VALUE"]);
      if (rtl.length(spl) > 0) {
        Result.EqualStrOpen = pas.SysUtils.Trim(spl[0])}
       else Result.EqualStrOpen = "";
      if (rtl.length(spl) > 1) {
        Result.EqualStrClose = pas.SysUtils.Trim(spl[1])}
       else Result.EqualStrClose = "";
      splTxt = $impl.SetUpperCase(this.FParseFormat.FNotEqualOperator);
      spl = pas.SysUtils.TStringHelper.Split$8.call({get: function () {
          return splTxt;
        }, set: function (v) {
          splTxt = v;
        }},["#VALUE"]);
      if (rtl.length(spl) > 0) {
        Result.NotEqualOpen = pas.SysUtils.Trim(spl[0])}
       else Result.NotEqualOpen = "";
      if (rtl.length(spl) > 1) {
        Result.NotEqualClose = pas.SysUtils.Trim(spl[1])}
       else Result.NotEqualClose = "";
      splTxt = $impl.SetUpperCase(pas.SysUtils.Trim(this.FParseFormat.FEmptyOperator));
      Result.Empty = splTxt;
      splTxt = $impl.SetUpperCase(pas.SysUtils.Trim(this.FParseFormat.FNotEmptyOperator));
      Result.NotEmpty = splTxt;
      splTxt = $impl.SetUpperCase(this.FParseFormat.FLargerThanOperator);
      spl = pas.SysUtils.TStringHelper.Split$8.call({get: function () {
          return splTxt;
        }, set: function (v) {
          splTxt = v;
        }},["#VALUE"]);
      if (rtl.length(spl) > 0) {
        Result.LargerThanOpen = pas.SysUtils.Trim(spl[0])}
       else Result.LargerThanOpen = "";
      if (rtl.length(spl) > 1) {
        Result.LargerThanClose = pas.SysUtils.Trim(spl[1])}
       else Result.LargerThanClose = "";
      splTxt = $impl.SetUpperCase(this.FParseFormat.FSmallerThanOperator);
      spl = pas.SysUtils.TStringHelper.Split$8.call({get: function () {
          return splTxt;
        }, set: function (v) {
          splTxt = v;
        }},["#VALUE"]);
      if (rtl.length(spl) > 0) {
        Result.SmallerThanOpen = pas.SysUtils.Trim(spl[0])}
       else Result.SmallerThanOpen = "";
      if (rtl.length(spl) > 1) {
        Result.SmallerThanClose = pas.SysUtils.Trim(spl[1])}
       else Result.SmallerThanClose = "";
      splTxt = $impl.SetUpperCase(this.FParseFormat.FLargerThanOrEqualOperator);
      spl = pas.SysUtils.TStringHelper.Split$8.call({get: function () {
          return splTxt;
        }, set: function (v) {
          splTxt = v;
        }},["#VALUE"]);
      if (rtl.length(spl) > 0) {
        Result.LargerThanOrEqualOpen = pas.SysUtils.Trim(spl[0])}
       else Result.LargerThanOrEqualOpen = "";
      if (rtl.length(spl) > 1) {
        Result.LargerThanOrEqualClose = pas.SysUtils.Trim(spl[1])}
       else Result.LargerThanOrEqualClose = "";
      splTxt = $impl.SetUpperCase(this.FParseFormat.FSmallerThanOrEqualOperator);
      spl = pas.SysUtils.TStringHelper.Split$8.call({get: function () {
          return splTxt;
        }, set: function (v) {
          splTxt = v;
        }},["#VALUE"]);
      if (rtl.length(spl) > 0) {
        Result.SmallerThanOrEqualOpen = pas.SysUtils.Trim(spl[0])}
       else Result.SmallerThanOrEqualOpen = "";
      if (rtl.length(spl) > 1) {
        Result.SmallerThanOrEqualClose = pas.SysUtils.Trim(spl[1])}
       else Result.SmallerThanOrEqualClose = "";
      return Result;
    };
    this.DoInternalFilterChanged = function (Sender) {
      this.DoInternalChanged();
    };
    this.DoInternalColumnsChanged = function (Sender) {
      this.DoInternalChanged();
      if (this.FUpdateCount === 0) {
        this.DoColumnsChanged();
      };
    };
    this.DoInternalFormatChanged = function (Sender) {
      if (this.FUpdateCount === 0) this.DoParseFormatChanged();
    };
    this.DoInternalChanged = function () {
      if (this.FOnInternalChanged != null) this.FOnInternalChanged(this);
      if (this.FUpdateCount === 0) this.DoChanged();
    };
    this.DoChanged = function () {
      if (this.FOnChanged != null) this.FOnChanged(this);
    };
    this.DoColumnsChanged = function () {
      if (this.FOnColumnsChanged != null) this.FOnColumnsChanged(this);
    };
    this.DoParseFormatChanged = function () {
      if (this.FOnParseFormatChanged != null) this.FOnParseFormatChanged(this);
    };
    this.DoParseErrorParenthesis = function (AFilterText, AErrorPosition) {
      if (this.FOnParseErrorParenthesis != null) this.FOnParseErrorParenthesis(this,AFilterText,AErrorPosition);
    };
    this.DoParseErrorOperatorPosition = function (AFilterText, AErrorPosition) {
      if (this.FOnParseErrorOperatorPosition != null) this.FOnParseErrorOperatorPosition(this,AFilterText,AErrorPosition);
    };
    this.DoParseErrorOperatorMismatch = function (AFilterText, AErrorPosition) {
      if (this.FOnParseErrorOperatorMismatch != null) this.FOnParseErrorOperatorMismatch(this,AFilterText,AErrorPosition);
    };
    this.DoParseErrorInvalidExpression = function (AFilterText, AErrorPosition) {
      if (this.FOnParseErrorInvalidExpression != null) this.FOnParseErrorInvalidExpression(this,AFilterText,AErrorPosition);
    };
    this.DoParseError = function (AFilterText) {
      if (this.FOnParseError != null) this.FOnParseError(this,AFilterText);
    };
    this.DoGetFormatSettings = function (AFormatSettings) {
      if (this.FOnGetFormatSettings != null) this.FOnGetFormatSettings(this,AFormatSettings);
    };
    this.DoGetFilterText = function (AFilter, AText) {
      if (this.FOnGetFilterText != null) this.FOnGetFilterText(this,AFilter,AText);
    };
    this.DoGetDisplayFilterText = function (AFilter, AText) {
      if (this.FOnGetDisplayFilterText != null) this.FOnGetDisplayFilterText(this,AFilter,AText);
    };
    this.DoGetGroupText = function (AGroup, AText) {
      if (this.FOnGetGroupText != null) this.FOnGetGroupText(this,AGroup,AText);
    };
    this.DoGetExpressionText = function (AExpression, AText) {
      if (this.FOnGetExpressionText != null) this.FOnGetExpressionText(this,AExpression,AText);
    };
    this.DoFilterExpressionTextParsed = function (AExpression, AExpressionText) {
      if (this.FOnExpressionTextParsed != null) this.FOnExpressionTextParsed(this,AExpression,AExpressionText);
    };
    this.DoFilterTextParsed = function (AFilter, AExpressionText) {
      if (this.FOnFilterTextParsed != null) this.FOnFilterTextParsed(this,AFilter,AExpressionText);
    };
    this.DoValidateGroup = function (AGroup, AInputData, AValidationResult, AExitValidation) {
      if (this.FOnValidateGroup != null) this.FOnValidateGroup(this,AGroup,rtl.arrayRef(AInputData),AValidationResult,AExitValidation);
    };
    this.DoValidateFilter = function (AInputData, AValidationResult) {
      if (this.FOnValidateFilter != null) this.FOnValidateFilter(this,rtl.arrayRef(AInputData),AValidationResult);
    };
    this.DoValidateExpression = function (AExpression, AInputValue, AValidationResult, AExitValidation) {
      if (this.FOnValidateExpression != null) this.FOnValidateExpression(this,AExpression,AInputValue,AValidationResult,AExitValidation);
    };
    this.DoBeforeClearFilter = function (AAllow) {
      if (this.FOnBeforeClearFilter != null) this.FOnBeforeClearFilter(this,AAllow);
    };
    this.DoAfterClearFilter = function () {
      if (this.FOnAfterClearFilter != null) this.FOnAfterClearFilter(this);
    };
    this.SetDelphiDataSetFormat = function (AStringDelimiter, ASingleWildCard, AMultiCharWildCard) {
      $mod.SetFilterFormatDelphiDataSet(this.FParseFormat,AStringDelimiter,AStringDelimiter,AMultiCharWildCard);
    };
    this.SetUniversalFilterExpressionsFormat = function (AStringDelimiter, ASingleWildCard, AMultiCharWildCard) {
      $mod.SetFilterFormatUniversalFilterExpressions(this.FParseFormat,AStringDelimiter,ASingleWildCard,AMultiCharWildCard);
    };
    this.HandleValidationErrors = function (AText, ACheckInfo) {
      if (!ACheckInfo.IsValid) {
        if (ACheckInfo.ErrorParenthesis >= 0) this.DoParseErrorParenthesis(AText,ACheckInfo.ErrorParenthesis);
        if (ACheckInfo.ErrorOperatorPosition >= 0) this.DoParseErrorOperatorPosition(AText,ACheckInfo.ErrorOperatorPosition);
        if (ACheckInfo.ErrorOperatorMismatch >= 0) this.DoParseErrorOperatorMismatch(AText,ACheckInfo.ErrorOperatorMismatch);
        if (ACheckInfo.ErrorInvalidExpression >= 0) this.DoParseErrorInvalidExpression(AText,ACheckInfo.ErrorInvalidExpression);
        this.DoParseError(AText);
      };
    };
    this.DoOnExpressionAdded = function (AExpression) {
      this.DoInternalFilterChanged(this.FFilter);
      this.DoExpressionAdded(AExpression);
    };
    this.DoExpressionAdded = function (AExpression) {
      if (this.FOnExpressionAdded != null) this.FOnExpressionAdded(this,AExpression,AExpression.GetExpression());
    };
    this.Create$1 = function () {
      this.FUpdateCount = 0;
      this.FParseFormat = $mod.TTMSFNCFilterBuilderParseFormat.$create("Create$1");
      this.FParseFormat.FOnInternalChanged = rtl.createCallback(this,"DoInternalFormatChanged");
      this.FDataColumns = $mod.TTMSFNCFilterBuilderColumns.$create("Create$7",[this]);
      this.FDataColumns.FOnInternalChanged = rtl.createCallback(this,"DoInternalColumnsChanged");
      this.FDataColumns.FOnInternalColumnNameChange = rtl.createCallback(this,"DoOnDataColumnNameChange");
      this.FDataColumns.FOnInternalColumnRemove = rtl.createCallback(this,"DoOnDataColumnRemove");
      this.FFormatType = $mod.TTMSFNCFilterBuilderFormatType.fftDelphiDataSet;
      this.FFilter = $mod.TTMSFNCFilterBuilderGroup.$create("Create$2",[this]);
      this.FFilter.FDataString = "Main Filter";
      this.FFilter.FBuilder = this;
      this.FFilter.FOnInternalChanged = rtl.createCallback(this,"DoInternalFilterChanged");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FFilter");
      rtl.free(this,"FParseFormat");
      rtl.free(this,"FDataColumns");
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCCustomFilterBuilder.isPrototypeOf(Source)) {
        this.FDataColumns.Assign(rtl.as(Source,$mod.TTMSFNCCustomFilterBuilder).FDataColumns);
        this.FParseFormat.Assign(rtl.as(Source,$mod.TTMSFNCCustomFilterBuilder).FParseFormat);
        this.FFormatType = rtl.as(Source,$mod.TTMSFNCCustomFilterBuilder).FFormatType;
        this.FFilter.Assign(rtl.as(Source,$mod.TTMSFNCCustomFilterBuilder).FFilter);
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    this.GetExpressionInformation = function (AExpression) {
      var Result = $mod.TTMSFNCFilterBuilderExpressionInformation.$new();
      var fs = pas.SysUtils.TFormatSettings.$new();
      var pf = $mod.TTMSFNCFilterBuilderParseFormatInfo.$new();
      var eof = $mod.TTMSFNCFilterBuilderExpressionOperatorFormat.$new();
      var dt = 0;
      var st = "";
      var StrStartIdx = 0;
      pf.$assign($impl.GetParseFormatInfo(this.FParseFormat));
      eof.$assign(this.GetExpressionOperatorFormat());
      Result.$assign($impl.GetInternalExpressionInformation(AExpression,$mod.TTMSFNCFilterBuilderParseFormatInfo.$clone(pf),$mod.TTMSFNCFilterBuilderExpressionOperatorFormat.$clone(eof),this.FFormatType === $mod.TTMSFNCFilterBuilderFormatType.fftDelphiDataSet));
      if (Result.ColumnName !== "") {
        Result.Column = this.GetColumnByName(Result.ColumnName);
        if (!(Result.Column != null)) Result.Column = this.GetColumnByDisplayName(Result.ColumnName);
      };
      if (Result.Column != null) {
        dt = Result.Column.FDataType}
       else dt = $mod.TTMSFNCFilterBuilderDataType.fdtAutomatic;
      StrStartIdx = $impl.GetStringStartIndex();
      if (((dt === $mod.TTMSFNCFilterBuilderDataType.fdtText) || ((this.FFormatType === $mod.TTMSFNCFilterBuilderFormatType.fftDelphiDataSet) && (dt in rtl.createSet($mod.TTMSFNCFilterBuilderDataType.fdtDateTime,$mod.TTMSFNCFilterBuilderDataType.fdtDate,$mod.TTMSFNCFilterBuilderDataType.fdtTime)))) && pas.SysUtils.TStringHelper.StartsWith.call({a: pas.SysUtils.Trim(Result.ValueText), get: function () {
          return this.a;
        }, set: function (v) {
          this.a = v;
        }},eof.StringDelimiter) && pas.SysUtils.TStringHelper.EndsWith.call({a: pas.SysUtils.Trim(Result.ValueText), get: function () {
          return this.a;
        }, set: function (v) {
          this.a = v;
        }},eof.StringDelimiter)) {
        st = pas.SysUtils.TStringHelper.Remove$1.call({a: pas.SysUtils.Trim(Result.ValueText), get: function () {
            return this.a;
          }, set: function (v) {
            this.a = v;
          }},StrStartIdx,eof.StringDelimiter.length);
        Result.ValueText = pas.SysUtils.TStringHelper.Remove$1.call({get: function () {
            return st;
          }, set: function (v) {
            st = v;
          }},st.length - eof.StringDelimiter.length,eof.StringDelimiter.length);
      };
      fs.$assign(this.GetFormatSettings());
      Result.Value = $mod.ParseValueTextToFNCValue(Result.ValueText,dt,pas.SysUtils.TFormatSettings.$clone(fs));
      return Result;
    };
    this.GetExpressionText = function (AColumnName, ADataType, AExpressionOperator, AValueText, AValue, AInverted) {
      var Result = "";
      Result = $impl.GetInternalExpressionText(AColumnName,ADataType,AExpressionOperator,AValueText,AValue,AInverted,pas.SysUtils.TFormatSettings.$clone(this.GetFormatSettings()),this.FParseFormat,this.FFormatType === $mod.TTMSFNCFilterBuilderFormatType.fftDelphiDataSet);
      return Result;
    };
    this.GetExpressionText$1 = function (AColumnName, ADataType, AExpressionOperator, AValueText, AInverted) {
      var Result = "";
      Result = $impl.GetInternalExpressionText(AColumnName,ADataType,AExpressionOperator,AValueText,pas["TMS.TMSFNCValue"].TValueToFNCValue(pas.RTTI.TValue.$clone(pas.RTTI.TValue.Empty())),AInverted,pas.SysUtils.TFormatSettings.$clone(this.GetFormatSettings()),this.FParseFormat,this.FFormatType === $mod.TTMSFNCFilterBuilderFormatType.fftDelphiDataSet);
      return Result;
    };
    this.DeleteGroup = function (AGroup) {
      var Result = false;
      var g = null;
      var idx = 0;
      Result = false;
      if (AGroup === this.FFilter) {
        this.ClearFilter();
        Result = true;
      } else {
        g = AGroup.FOwnerGroups;
        if (g != null) {
          idx = g.IndexOf(AGroup);
          if (idx >= 0) {
            g.Delete(idx);
            Result = true;
          };
        };
      };
      return Result;
    };
    this.DeleteExpression = function (AExpression) {
      var Result = false;
      var fe = null;
      var idx = 0;
      Result = false;
      fe = AExpression.FFilterExpressions;
      if (fe != null) {
        idx = fe.IndexOf(AExpression);
        if (idx >= 0) {
          fe.Delete(idx);
          Result = true;
        };
      };
      return Result;
    };
    this.GetFormatSettings = function () {
      var Result = pas.SysUtils.TFormatSettings.$new();
      var fs = pas.SysUtils.TFormatSettings.$new();
      fs.$assign(pas.SysUtils.TFormatSettings.Create());
      this.DoGetFormatSettings(fs);
      Result.$assign(fs);
      return Result;
    };
    this.GetColumnByName = function (AColumnName) {
      var Result = null;
      var I = 0;
      Result = null;
      for (var $l = 0, $end = this.FDataColumns.FLength - 1; $l <= $end; $l++) {
        I = $l;
        if ($impl.SetUpperCase(this.FDataColumns.GetItem(I).FName) === $impl.SetUpperCase(AColumnName)) {
          Result = this.FDataColumns.GetItem(I);
          break;
        } else if ($impl.SetUpperCase(this.FDataColumns.GetItem(I).GetDisplayName()) === $impl.SetUpperCase(AColumnName)) Result = this.FDataColumns.GetItem(I);
      };
      return Result;
    };
    this.GetColumnByDisplayName = function (AColumnDisplayName) {
      var Result = null;
      var I = 0;
      Result = null;
      for (var $l = 0, $end = this.FDataColumns.FLength - 1; $l <= $end; $l++) {
        I = $l;
        if ($impl.SetUpperCase(this.FDataColumns.GetItem(I).GetDisplayName()) === $impl.SetUpperCase(AColumnDisplayName)) {
          Result = this.FDataColumns.GetItem(I);
          break;
        };
      };
      return Result;
    };
    this.GetOperatorText = function (AGroupOperator) {
      var Result = "";
      Result = $mod.GetGroupOperatorText(AGroupOperator,this.FParseFormat);
      return Result;
    };
    this.GetOperatorText$1 = function (AExpressionOperator) {
      var Result = "";
      var $tmp = AExpressionOperator;
      if ($tmp === $mod.TTMSFNCFilterBuilderExpressionOperator.feoStartsWith) {
        Result = pas.SysUtils.Trim(this.FParseFormat.FStartsWithOperator)}
       else if ($tmp === $mod.TTMSFNCFilterBuilderExpressionOperator.feoEndsWith) {
        Result = pas.SysUtils.Trim(this.FParseFormat.FEndsWithOperator)}
       else if ($tmp === $mod.TTMSFNCFilterBuilderExpressionOperator.feoContains) {
        Result = pas.SysUtils.Trim(this.FParseFormat.FContainsOperator)}
       else if ($tmp === $mod.TTMSFNCFilterBuilderExpressionOperator.feoEqual) {
        Result = pas.SysUtils.Trim(this.FParseFormat.FEqualOperator)}
       else if ($tmp === $mod.TTMSFNCFilterBuilderExpressionOperator.feoNotEqual) {
        Result = pas.SysUtils.Trim(this.FParseFormat.FNotEqualOperator)}
       else if ($tmp === $mod.TTMSFNCFilterBuilderExpressionOperator.feoEmpty) {
        Result = pas.SysUtils.Trim(this.FParseFormat.FEmptyOperator)}
       else if ($tmp === $mod.TTMSFNCFilterBuilderExpressionOperator.feoNotEmpty) {
        Result = pas.SysUtils.Trim(this.FParseFormat.FNotEmptyOperator)}
       else if ($tmp === $mod.TTMSFNCFilterBuilderExpressionOperator.feoLargerThan) {
        Result = pas.SysUtils.Trim(this.FParseFormat.FLargerThanOperator)}
       else if ($tmp === $mod.TTMSFNCFilterBuilderExpressionOperator.feoSmallerThan) {
        Result = pas.SysUtils.Trim(this.FParseFormat.FSmallerThanOperator)}
       else if ($tmp === $mod.TTMSFNCFilterBuilderExpressionOperator.feoLargerThanOrEqual) {
        Result = pas.SysUtils.Trim(this.FParseFormat.FLargerThanOrEqualOperator)}
       else if ($tmp === $mod.TTMSFNCFilterBuilderExpressionOperator.feoSmallerThanOrEqual) Result = pas.SysUtils.Trim(this.FParseFormat.FSmallerThanOrEqualOperator);
      return Result;
    };
    this.PopulateFilter = function (AGroups, AExpressions) {
      var Result = null;
      this.FFilter.PopulateGroup(rtl.arrayRef(AGroups),rtl.arrayRef(AExpressions));
      Result = this.FFilter;
      return Result;
    };
    this.PopulateFilterGroups = function (AGroups) {
      var Result = null;
      Result = this.PopulateFilter(rtl.arrayRef(AGroups),[]);
      return Result;
    };
    this.PopulateFilterExpressions = function (AExpressions) {
      var Result = null;
      Result = this.PopulateFilter([],rtl.arrayRef(AExpressions));
      return Result;
    };
    this.isExpressionValid = function (AExpression) {
      var Result = false;
      var gi = $mod.TTMSFNCFilterBuilderExpressionCheckInfo.$new();
      gi.$assign(this.InternalCheckExpression(AExpression));
      Result = gi.IsValid;
      this.HandleValidationErrors(AExpression,$mod.TTMSFNCFilterBuilderExpressionCheckInfo.$clone(gi));
      return Result;
    };
    this.ValidateFilterRow = function (AInputData) {
      var Result = false;
      Result = this.FFilter.ValidateFilter(rtl.arrayRef(AInputData));
      this.DoValidateFilter(rtl.arrayRef(AInputData),{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.ValidateFilterArray = function (AInputArray, AByRow) {
      var Result = [];
      var col = 0;
      var row = 0;
      var MaxRowLength = 0;
      var AInput = [];
      MaxRowLength = 0;
      if (AByRow) {
        Result = rtl.arraySetLength(Result,false,rtl.length(AInputArray));
        for (var $l = 0, $end = rtl.length(AInputArray) - 1; $l <= $end; $l++) {
          row = $l;
          Result[row] = this.ValidateFilterRow(rtl.arrayRef(AInputArray[row]));
        };
      } else {
        if (rtl.length(AInputArray) !== this.FDataColumns.FLength) {
          throw pas.SysUtils.Exception.$create("Create$1",["Number of Input Columns not equal to the Data Columns."]);
        };
        for (var $l1 = 0, $end1 = rtl.length(AInputArray) - 1; $l1 <= $end1; $l1++) {
          col = $l1;
          if (MaxRowLength < rtl.length(AInputArray[col])) MaxRowLength = rtl.length(AInputArray[col]);
        };
        Result = rtl.arraySetLength(Result,false,MaxRowLength);
        AInput = rtl.arraySetLength(AInput,undefined,this.FDataColumns.FLength);
        for (var $l2 = 0, $end2 = MaxRowLength - 1; $l2 <= $end2; $l2++) {
          row = $l2;
          for (var $l3 = 0, $end3 = rtl.length(AInputArray) - 1; $l3 <= $end3; $l3++) {
            col = $l3;
            if ((row < rtl.length(AInputArray[col])) && (col < rtl.length(AInputArray))) {
              AInput[col] = AInputArray[col][row]}
             else AInput[col] = null;
          };
          Result[row] = this.ValidateFilterRow(rtl.arrayRef(AInput));
        };
        AInput = rtl.arraySetLength(AInput,undefined,0);
      };
      return Result;
    };
    this.AddDataColumn = function () {
      var Result = null;
      Result = this.FDataColumns.Add$1(null);
      return Result;
    };
    this.AddDataColumn$1 = function (AName, ADataType, ADisplayName) {
      var Result = null;
      Result = this.FDataColumns.AddColumn(AName,ADataType,ADisplayName);
      return Result;
    };
    this.ParseExpression = function (AFilterText) {
      var Result = false;
      this.BeginUpdate();
      this.ClearFilter();
      Result = this.isExpressionValid(AFilterText);
      if (Result) {
        if (AFilterText !== "") this.FFilter.ParseExpression(AFilterText);
        this.DoFilterTextParsed(this.FFilter,AFilterText);
      };
      this.EndUpdate();
      return Result;
    };
    this.ClearFilter = function () {
      var a = false;
      a = true;
      this.DoBeforeClearFilter({get: function () {
          return a;
        }, set: function (v) {
          a = v;
        }});
      if (a) {
        this.BeginUpdate();
        this.FFilter.FGroups.Clear();
        this.FFilter.FExpressions.Clear();
        this.DoInternalFilterChanged(this.FFilter);
        this.EndUpdate();
        this.DoAfterClearFilter();
      };
    };
    this.BeginUpdate = function () {
      this.FUpdateCount += 1;
    };
    this.EndUpdate = function () {
      this.FUpdateCount -= 1;
      if (this.FUpdateCount <= 0) {
        this.FUpdateCount = 0;
      };
    };
  });
  rtl.createClass(this,"TTMSFNCFilterBuilder",this.TTMSFNCCustomFilterBuilder,function () {
    var $r = this.$rtti;
    $r.addProperty("ParseFormat",2,$mod.$rtti["TTMSFNCFilterBuilderParseFormat"],"FParseFormat","SetParseFormat");
    $r.addProperty("FilterText",3,rtl.string,"GetFilterText","SetFilterText");
    $r.addProperty("DisplayFilterText",3,rtl.string,"GetDisplayFilterText","SetDisplayFilterText");
    $r.addProperty("Filter",2,$mod.$rtti["TTMSFNCFilterBuilderGroup"],"FFilter","SetFilter");
    $r.addProperty("DataColumns",2,$mod.$rtti["TTMSFNCFilterBuilderColumns"],"FDataColumns","SetDataColumns");
    $r.addProperty("FormatType",2,$mod.$rtti["TTMSFNCFilterBuilderFormatType"],"FFormatType","SetFormatType",4,{Default: $mod.TTMSFNCFilterBuilderFormatType.fftDelphiDataSet});
    $r.addProperty("OnChanged",0,pas.Classes.$rtti["TNotifyEvent"],"FOnChanged","FOnChanged");
    $r.addProperty("OnColumnsChanged",0,pas.Classes.$rtti["TNotifyEvent"],"FOnColumnsChanged","FOnColumnsChanged");
    $r.addProperty("OnParseFormatChanged",0,pas.Classes.$rtti["TNotifyEvent"],"FOnParseFormatChanged","FOnParseFormatChanged");
    $r.addProperty("OnGetFormatSettings",0,$mod.$rtti["TTMSFNCFilterBuilderGetFormatSettingsEvent"],"FOnGetFormatSettings","FOnGetFormatSettings");
    $r.addProperty("OnParseErrorParenthesis",0,$mod.$rtti["TTMSFNCFilterBuilderParseErrorEvent"],"FOnParseErrorParenthesis","FOnParseErrorParenthesis");
    $r.addProperty("OnParseErrorOperatorPosition",0,$mod.$rtti["TTMSFNCFilterBuilderParseErrorEvent"],"FOnParseErrorOperatorPosition","FOnParseErrorOperatorPosition");
    $r.addProperty("OnParseErrorOperatorMismatch",0,$mod.$rtti["TTMSFNCFilterBuilderParseErrorEvent"],"FOnParseErrorOperatorMismatch","FOnParseErrorOperatorMismatch");
    $r.addProperty("OnParseErrorInvalidExpression",0,$mod.$rtti["TTMSFNCFilterBuilderParseErrorEvent"],"FOnParseErrorInvalidExpression","FOnParseErrorInvalidExpression");
    $r.addProperty("OnParseError",0,$mod.$rtti["TTMSFNCFilterBuilderFilterEvent"],"FOnParseError","FOnParseError");
    $r.addProperty("OnGetFilterText",0,$mod.$rtti["TTMSFNCFilterBuilderGetGroupTextEvent"],"FOnGetFilterText","FOnGetFilterText");
    $r.addProperty("OnGetGroupText",0,$mod.$rtti["TTMSFNCFilterBuilderGetGroupTextEvent"],"FOnGetGroupText","FOnGetGroupText");
    $r.addProperty("OnGetExpressionText",0,$mod.$rtti["TTMSFNCFilterBuilderGetExpressionTextEvent"],"FOnGetExpressionText","FOnGetExpressionText");
    $r.addProperty("OnExpressionTextParsed",0,$mod.$rtti["TTMSFNCFilterBuilderExpressionTextParsedEvent"],"FOnExpressionTextParsed","FOnExpressionTextParsed");
    $r.addProperty("OnFilterTextParsed",0,$mod.$rtti["TTMSFNCFilterBuilderFilterTextParsedEvent"],"FOnFilterTextParsed","FOnFilterTextParsed");
    $r.addProperty("OnValidateGroup",0,$mod.$rtti["TTMSFNCFilterBuilderValidateGroupEvent"],"FOnValidateGroup","FOnValidateGroup");
    $r.addProperty("OnValidateFilter",0,$mod.$rtti["TTMSFNCFilterBuilderValidateFilterEvent"],"FOnValidateFilter","FOnValidateFilter");
    $r.addProperty("OnValidateExpression",0,$mod.$rtti["TTMSFNCFilterBuilderValidateExpressionEvent"],"FOnValidateExpression","FOnValidateExpression");
    $r.addProperty("OnExpressionAdded",0,$mod.$rtti["TTMSFNCFilterBuilderExpressionTextParsedEvent"],"FOnExpressionAdded","FOnExpressionAdded");
  });
  rtl.recNewT(this,"TTMSFNCFilterBuilderTestValidateInput",function () {
    this.Name = "";
    this.DataType = 0;
    this.Value = undefined;
    this.$eq = function (b) {
      return (this.Name === b.Name) && (this.DataType === b.DataType) && (this.Value === b.Value);
    };
    this.$assign = function (s) {
      this.Name = s.Name;
      this.DataType = s.DataType;
      this.Value = s.Value;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCFilterBuilderTestValidateInput",{},this);
    $r.addField("Name",rtl.string);
    $r.addField("DataType",$mod.$rtti["TTMSFNCFilterBuilderDataType"]);
    $r.addField("Value",rtl.jsvalue);
  });
  this.MatchStrings = function (aPattern, AExpression, AMultiCharWildCard, ASingleCharWildCard) {
    var Result = false;
    var PIndex = 0;
    var EIndex = 0;
    var PLen = 0;
    var ELen = 0;
    var LastStarP = 0;
    var LastStarE = 0;
    PIndex = 1;
    EIndex = 1;
    PLen = aPattern.length;
    ELen = AExpression.length;
    LastStarP = 0;
    LastStarE = 0;
    while (EIndex <= ELen) {
      if ((PIndex <= PLen) && ((aPattern.charAt(PIndex - 1) === AExpression.charAt(EIndex - 1)) || ((ASingleCharWildCard !== "") && (aPattern.charAt(PIndex - 1) === ASingleCharWildCard)))) {
        PIndex += 1;
        EIndex += 1;
      } else if ((PIndex <= PLen) && (AMultiCharWildCard !== "") && (aPattern.charAt(PIndex - 1) === AMultiCharWildCard)) {
        LastStarP = PIndex;
        LastStarE = EIndex;
        PIndex += 1;
      } else if (LastStarP > 0) {
        PIndex = LastStarP + 1;
        LastStarE += 1;
        EIndex = LastStarE;
      } else {
        return false;
      };
    };
    while ((PIndex <= PLen) && (aPattern.charAt(PIndex - 1) === AMultiCharWildCard)) PIndex += 1;
    Result = PIndex > PLen;
    return Result;
  };
  this.CreateExpression = function (AColumn, AExpressionOperator, AValue, AInverted) {
    var Result = null;
    Result = $mod.TTMSFNCFilterBuilderExpression.$create("Create$1",[null]);
    Result.FColumn = AColumn;
    Result.FExpressionOperator = AExpressionOperator;
    Result.FValueText = pas["TMS.TMSFNCValue"].ValueToString(AValue);
    Result.FValue = AValue;
    return Result;
  };
  this.CreateExpression$1 = function (AColumnName, AExpressionOperator, AValue, AInverted) {
    var Result = null;
    Result = $mod.TTMSFNCFilterBuilderExpression.$create("Create$1",[null]);
    Result.FBackupColName = AColumnName;
    Result.FExpressionOperator = AExpressionOperator;
    Result.FValueText = pas["TMS.TMSFNCValue"].ValueToString(AValue);
    Result.FValue = AValue;
    Result.FIsInverted = AInverted;
    return Result;
  };
  this.CreateORGroup = function (AGroups, AExpressions) {
    var Result = null;
    Result = $mod.TTMSFNCFilterBuilderGroup.$create("Create");
    Result.InitializeCreate($mod.TTMSFNCFilterBuilderGroupOperator.fgoOR);
    Result.PopulateGroup(rtl.arrayRef(AGroups),rtl.arrayRef(AExpressions));
    return Result;
  };
  this.CreateANDGroup = function (AGroups, AExpressions) {
    var Result = null;
    Result = $mod.TTMSFNCFilterBuilderGroup.$create("Create");
    Result.InitializeCreate($mod.TTMSFNCFilterBuilderGroupOperator.fgoAND);
    Result.PopulateGroup(rtl.arrayRef(AGroups),rtl.arrayRef(AExpressions));
    return Result;
  };
  this.ParseValueTextToFNCValue = function (AText, ADataType, AFormatSettings) {
    var Result = undefined;
    var dt = 0.0;
    var d = 0.0;
    var i = 0;
    var b = false;
    var parsed = false;
    if (ADataType === $mod.TTMSFNCFilterBuilderDataType.fdtOther) {
      Result = AText;
      return Result;
    };
    parsed = false;
    dt = 0;
    d = 4294967295;
    i = 4294967295;
    b = false;
    if (ADataType in rtl.createSet($mod.TTMSFNCFilterBuilderDataType.fdtDateTime,$mod.TTMSFNCFilterBuilderDataType.fdtDate,$mod.TTMSFNCFilterBuilderDataType.fdtTime)) {
      parsed = pas.SysUtils.TryStrToDateTime$1(pas.SysUtils.Trim(AText),{get: function () {
          return dt;
        }, set: function (v) {
          dt = v;
        }},AFormatSettings);
      if (parsed) Result = dt;
    };
    if (ADataType === $mod.TTMSFNCFilterBuilderDataType.fdtNumber) {
      parsed = pas.SysUtils.TryStrToInt64(pas.SysUtils.Trim(AText),{get: function () {
          return i;
        }, set: function (v) {
          i = v;
        }});
      if (parsed) Result = i;
    };
    if (ADataType === $mod.TTMSFNCFilterBuilderDataType.fdtFloat) {
      parsed = pas.SysUtils.TryStrToFloat$3(pas.SysUtils.Trim(AText),{get: function () {
          return d;
        }, set: function (v) {
          d = v;
        }},AFormatSettings);
      if (parsed) Result = d;
    };
    if (ADataType === $mod.TTMSFNCFilterBuilderDataType.fdtBoolean) {
      parsed = pas.SysUtils.TryStrToBool(pas.SysUtils.Trim(AText),{get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }});
      if (parsed) Result = b;
    };
    if (ADataType === $mod.TTMSFNCFilterBuilderDataType.fdtText) {
      Result = AText;
    } else if (!parsed) {
      Result = pas["TMS.TMSFNCValue"].TextToFNCValue$1(AText,pas.SysUtils.TFormatSettings.$clone(AFormatSettings));
    };
    return Result;
  };
  this.GetFilterBuilderTextForExpressionOperator = function (AExpressionOperator, AUILanguage) {
    var Result = "";
    var la = null;
    if (AUILanguage != null) {
      la = AUILanguage}
     else la = $mod.TTMSFNCFilterBuilderCustomUILanguage.$create("Create$1");
    try {
      var $tmp = AExpressionOperator;
      if ($tmp === $mod.TTMSFNCFilterBuilderExpressionOperator.feoStartsWith) {
        Result = la.FStartsWithOperatorText}
       else if ($tmp === $mod.TTMSFNCFilterBuilderExpressionOperator.feoEndsWith) {
        Result = la.FEndsWithOperatorText}
       else if ($tmp === $mod.TTMSFNCFilterBuilderExpressionOperator.feoContains) {
        Result = la.FContainsOperatorText}
       else if ($tmp === $mod.TTMSFNCFilterBuilderExpressionOperator.feoEqual) {
        Result = la.FEqualOperatorText}
       else if ($tmp === $mod.TTMSFNCFilterBuilderExpressionOperator.feoNotEqual) {
        Result = la.FNotEqualOperatorText}
       else if ($tmp === $mod.TTMSFNCFilterBuilderExpressionOperator.feoEmpty) {
        Result = la.FEmptyOperatorText}
       else if ($tmp === $mod.TTMSFNCFilterBuilderExpressionOperator.feoNotEmpty) {
        Result = la.FNotEmptyOperatorText}
       else if ($tmp === $mod.TTMSFNCFilterBuilderExpressionOperator.feoLargerThan) {
        Result = la.FLargerThanOperatorText}
       else if ($tmp === $mod.TTMSFNCFilterBuilderExpressionOperator.feoSmallerThan) {
        Result = la.FSmallerThanOperatorText}
       else if ($tmp === $mod.TTMSFNCFilterBuilderExpressionOperator.feoLargerThanOrEqual) {
        Result = la.FLargerThanOrEqualOperatorText}
       else if ($tmp === $mod.TTMSFNCFilterBuilderExpressionOperator.feoSmallerThanOrEqual) {
        Result = la.FSmallerThanOrEqualOperatorText}
       else {
        Result = "UNKNOWN OPERATOR";
      };
    } finally {
      if (!(AUILanguage != null)) pas.SysUtils.FreeAndNil({get: function () {
          return la;
        }, set: function (v) {
          la = v;
        }});
    };
    return Result;
  };
  this.GetFilterBuilderExpressionOperatorFoundForText = function (AText, AExpressionOperator, AUILanguage) {
    var Result = false;
    var la = null;
    if (AUILanguage != null) {
      la = AUILanguage}
     else la = $mod.TTMSFNCFilterBuilderCustomUILanguage.$create("Create$1");
    Result = true;
    if (pas.SysUtils.Trim(AText) === la.FStartsWithOperatorText) {
      AExpressionOperator.set($mod.TTMSFNCFilterBuilderExpressionOperator.feoStartsWith)}
     else if (pas.SysUtils.Trim(AText) === pas.SysUtils.Trim(la.FEndsWithOperatorText)) {
      AExpressionOperator.set($mod.TTMSFNCFilterBuilderExpressionOperator.feoEndsWith)}
     else if (pas.SysUtils.Trim(AText) === pas.SysUtils.Trim(la.FContainsOperatorText)) {
      AExpressionOperator.set($mod.TTMSFNCFilterBuilderExpressionOperator.feoContains)}
     else if (pas.SysUtils.Trim(AText) === pas.SysUtils.Trim(la.FEqualOperatorText)) {
      AExpressionOperator.set($mod.TTMSFNCFilterBuilderExpressionOperator.feoEqual)}
     else if (pas.SysUtils.Trim(AText) === pas.SysUtils.Trim(la.FNotEqualOperatorText)) {
      AExpressionOperator.set($mod.TTMSFNCFilterBuilderExpressionOperator.feoNotEqual)}
     else if (pas.SysUtils.Trim(AText) === pas.SysUtils.Trim(la.FEmptyOperatorText)) {
      AExpressionOperator.set($mod.TTMSFNCFilterBuilderExpressionOperator.feoEmpty)}
     else if (pas.SysUtils.Trim(AText) === pas.SysUtils.Trim(la.FNotEmptyOperatorText)) {
      AExpressionOperator.set($mod.TTMSFNCFilterBuilderExpressionOperator.feoNotEmpty)}
     else if (pas.SysUtils.Trim(AText) === pas.SysUtils.Trim(la.FLargerThanOperatorText)) {
      AExpressionOperator.set($mod.TTMSFNCFilterBuilderExpressionOperator.feoLargerThan)}
     else if (pas.SysUtils.Trim(AText) === pas.SysUtils.Trim(la.FSmallerThanOperatorText)) {
      AExpressionOperator.set($mod.TTMSFNCFilterBuilderExpressionOperator.feoSmallerThan)}
     else if (pas.SysUtils.Trim(AText) === pas.SysUtils.Trim(la.FLargerThanOrEqualOperatorText)) {
      AExpressionOperator.set($mod.TTMSFNCFilterBuilderExpressionOperator.feoLargerThanOrEqual)}
     else if (pas.SysUtils.Trim(AText) === pas.SysUtils.Trim(la.FSmallerThanOrEqualOperatorText)) {
      AExpressionOperator.set($mod.TTMSFNCFilterBuilderExpressionOperator.feoSmallerThanOrEqual)}
     else Result = false;
    return Result;
  };
  this.GetFilterBuilderExpressionText = function (AColumnName, ADataType, AExpressionOperator, AValueText, AValue, AInverted, AFormatSettings, AParseFormat, AIsDataSet) {
    var Result = "";
    var f = "";
    var o = "";
    var v = "";
    var sd = "";
    var inv = false;
    var d = 0.0;
    v = "";
    inv = AInverted;
    sd = AParseFormat.FStringDelimiter;
    if (!pas["TMS.TMSFNCValue"].ValueIsEmpty(AValue) && pas["TMS.TMSFNCValue"].ValueIsString(AValue) && (pas["TMS.TMSFNCValue"].ValueToString(AValue) !== "")) {
      if (!(AExpressionOperator in rtl.createSet($mod.TTMSFNCFilterBuilderExpressionOperator.feoEmpty,$mod.TTMSFNCFilterBuilderExpressionOperator.feoNotEmpty))) {
        var $tmp = ADataType;
        if ($tmp === $mod.TTMSFNCFilterBuilderDataType.fdtNumber) {
          v = pas.SysUtils.TNativeIntHelper.ToString$1.call({a: pas["TMS.TMSFNCValue"].ValueToInt64$1(AValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)), get: function () {
              return this.a;
            }, set: function (v) {
              this.a = v;
            }})}
         else if ($tmp === $mod.TTMSFNCFilterBuilderDataType.fdtFloat) {
          v = pas.SysUtils.FloatToStr$1(pas["TMS.TMSFNCValue"].ValueToFloat$1(AValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),AFormatSettings)}
         else if ($tmp === $mod.TTMSFNCFilterBuilderDataType.fdtDateTime) {
          v = pas.SysUtils.DateTimeToStr$1(pas["TMS.TMSFNCValue"].ValueToDateTime$1(AValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),AFormatSettings,false)}
         else if ($tmp === $mod.TTMSFNCFilterBuilderDataType.fdtDate) {
          v = pas.SysUtils.DateToStr$1(pas["TMS.TMSFNCValue"].ValueToDateTime$1(AValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),AFormatSettings)}
         else if ($tmp === $mod.TTMSFNCFilterBuilderDataType.fdtTime) {
          v = pas.SysUtils.TimeToStr$1(pas["TMS.TMSFNCValue"].ValueToDateTime$1(AValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),AFormatSettings)}
         else if ($tmp === $mod.TTMSFNCFilterBuilderDataType.fdtBoolean) {
          v = pas.SysUtils.BoolToStr(pas["TMS.TMSFNCValue"].ValueToBoolean$1(AValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),true)}
         else if ($tmp === $mod.TTMSFNCFilterBuilderDataType.fdtText) {
          if ((AValueText !== "") && !pas["TMS.TMSFNCValue"].ValueIsEmpty(AValue)) {
            v = AValueText}
           else v = pas["TMS.TMSFNCValue"].ValueToString(AValue);
        } else {
          v = pas["TMS.TMSFNCValue"].ValueToString(AValue);
        };
      };
    } else {
      v = AValueText;
      if (pas.SysUtils.TryStrToFloat$3(AValueText,{get: function () {
          return d;
        }, set: function (v) {
          d = v;
        }},AFormatSettings)) {
        var $tmp1 = ADataType;
        if ($tmp1 === $mod.TTMSFNCFilterBuilderDataType.fdtDateTime) {
          v = pas.SysUtils.DateTimeToStr$1(d,AFormatSettings,false)}
         else if ($tmp1 === $mod.TTMSFNCFilterBuilderDataType.fdtDate) {
          v = pas.SysUtils.DateToStr$1(d,AFormatSettings)}
         else if ($tmp1 === $mod.TTMSFNCFilterBuilderDataType.fdtTime) v = pas.SysUtils.TimeToStr$1(d,AFormatSettings);
      };
    };
    o = "";
    var $tmp2 = AExpressionOperator;
    if ($tmp2 === $mod.TTMSFNCFilterBuilderExpressionOperator.feoNotEmpty) {
      o = AParseFormat.FNotEmptyOperator}
     else if ($tmp2 === $mod.TTMSFNCFilterBuilderExpressionOperator.feoEmpty) {
      o = AParseFormat.FEmptyOperator}
     else if ($tmp2 === $mod.TTMSFNCFilterBuilderExpressionOperator.feoContains) {
      o = AParseFormat.FContainsOperator}
     else if ($tmp2 === $mod.TTMSFNCFilterBuilderExpressionOperator.feoStartsWith) {
      o = AParseFormat.FStartsWithOperator}
     else if ($tmp2 === $mod.TTMSFNCFilterBuilderExpressionOperator.feoEndsWith) {
      o = AParseFormat.FEndsWithOperator}
     else if ($tmp2 === $mod.TTMSFNCFilterBuilderExpressionOperator.feoEqual) {
      if ((AParseFormat.FEqualStrOperator !== "") && ((ADataType === $mod.TTMSFNCFilterBuilderDataType.fdtText) || ((ADataType === $mod.TTMSFNCFilterBuilderDataType.fdtAutomatic) && (pas.System.Pos(AParseFormat.FMultiCharWildCard,v) > 0)) || (pas.System.Pos(AParseFormat.FSingleCharWildCard,v) > 0) || (pas.SysUtils.TStringHelper.StartsWith.call({get: function () {
          return v;
        }, set: function (w) {
          v = w;
        }},sd) && pas.SysUtils.TStringHelper.EndsWith.call({get: function () {
          return v;
        }, set: function (w) {
          v = w;
        }},sd)))) {
        o = AParseFormat.FEqualStrOperator}
       else o = AParseFormat.FEqualOperator;
    } else if ($tmp2 === $mod.TTMSFNCFilterBuilderExpressionOperator.feoNotEqual) {
      if ((ADataType === $mod.TTMSFNCFilterBuilderDataType.fdtText) || ((((ADataType === $mod.TTMSFNCFilterBuilderDataType.fdtAutomatic) && (pas.System.Pos(AParseFormat.FMultiCharWildCard,v) > 0)) || (pas.System.Pos(AParseFormat.FSingleCharWildCard,v) > 0)) && (AParseFormat.FEqualStrOperator !== ""))) {
        inv = true;
        o = AParseFormat.FEqualStrOperator;
      } else o = AParseFormat.FNotEqualOperator;
    } else if ($tmp2 === $mod.TTMSFNCFilterBuilderExpressionOperator.feoLargerThan) {
      o = AParseFormat.FLargerThanOperator}
     else if ($tmp2 === $mod.TTMSFNCFilterBuilderExpressionOperator.feoLargerThanOrEqual) {
      o = AParseFormat.FLargerThanOrEqualOperator}
     else if ($tmp2 === $mod.TTMSFNCFilterBuilderExpressionOperator.feoSmallerThan) {
      o = AParseFormat.FSmallerThanOperator}
     else if ($tmp2 === $mod.TTMSFNCFilterBuilderExpressionOperator.feoSmallerThanOrEqual) o = AParseFormat.FSmallerThanOrEqualOperator;
    if (pas.System.Pos(AParseFormat.FColumnFormat,o) > 0) {
      f = pas.SysUtils.TStringHelper.Replace$2.call({get: function () {
          return o;
        }, set: function (v) {
          o = v;
        }},"#COLUMN",AColumnName);
    } else {
      f = pas.SysUtils.TStringHelper.Replace$2.call({p: AParseFormat, get: function () {
          return this.p.FColumnFormat;
        }, set: function (v) {
          this.p.FColumnFormat = v;
        }},"#COLUMN",AColumnName);
      f = f + " " + o;
    };
    if (inv) f = AParseFormat.FNotOperator + " " + f;
    if (((ADataType === $mod.TTMSFNCFilterBuilderDataType.fdtText) || (AIsDataSet && (ADataType in rtl.createSet($mod.TTMSFNCFilterBuilderDataType.fdtDateTime,$mod.TTMSFNCFilterBuilderDataType.fdtDate,$mod.TTMSFNCFilterBuilderDataType.fdtTime)))) && !(pas.SysUtils.TStringHelper.StartsWith.call({get: function () {
        return v;
      }, set: function (w) {
        v = w;
      }},sd) && pas.SysUtils.TStringHelper.EndsWith.call({get: function () {
        return v;
      }, set: function (w) {
        v = w;
      }},sd)) && (pas.System.Pos(sd,o) === 0)) {
      f = pas.SysUtils.TStringHelper.Replace$2.call({get: function () {
          return f;
        }, set: function (v) {
          f = v;
        }},"#VALUE",sd + v + sd)}
     else if ((ADataType in rtl.createSet($mod.TTMSFNCFilterBuilderDataType.fdtAutomatic,$mod.TTMSFNCFilterBuilderDataType.fdtText)) && pas.SysUtils.TStringHelper.StartsWith.call({get: function () {
        return v;
      }, set: function (w) {
        v = w;
      }},sd) && pas.SysUtils.TStringHelper.EndsWith.call({get: function () {
        return v;
      }, set: function (w) {
        v = w;
      }},sd) && (pas.System.Pos(sd + "#VALUE" + sd,o) > 0)) {
      f = pas.SysUtils.TStringHelper.Replace$2.call({get: function () {
          return f;
        }, set: function (v) {
          f = v;
        }},sd + "#VALUE" + sd,v)}
     else f = pas.SysUtils.TStringHelper.Replace$2.call({get: function () {
        return f;
      }, set: function (v) {
        f = v;
      }},"#VALUE",v);
    Result = f;
    return Result;
  };
  this.CheckFilterBuilderExpression = function (AExpression, AParseFormat, AIsDataSet) {
    var Result = $mod.TTMSFNCFilterBuilderExpressionCheckInfo.$new();
    var pfi = $mod.TTMSFNCFilterBuilderParseFormatInfo.$new();
    var ExpArr = [];
    var part = "";
    var prevPart = "";
    var original = "";
    var I = 0;
    var parCnt = 0;
    var colCnt = 0;
    var newGroup = false;
    var firstOperator = false;
    var operatorStack = null;
    var gop = 0;
    function IsOperator(Token) {
      var Result = false;
      Result = pas.SysUtils.TStringHelper.Equals$1.call({a: $impl.SetUpperCase(Token), get: function () {
          return this.a;
        }, set: function (v) {
          this.a = v;
        }},$impl.SetUpperCase(AParseFormat.FAndOperator)) || pas.SysUtils.TStringHelper.Equals$1.call({a: $impl.SetUpperCase(Token), get: function () {
          return this.a;
        }, set: function (v) {
          this.a = v;
        }},$impl.SetUpperCase(AParseFormat.FOrOperator));
      return Result;
    };
    function GetOperator(Token) {
      var Result = 0;
      if (pas.SysUtils.TStringHelper.Equals$1.call({a: $impl.SetUpperCase(Token), get: function () {
          return this.a;
        }, set: function (v) {
          this.a = v;
        }},$impl.SetUpperCase(AParseFormat.FAndOperator))) {
        Result = $mod.TTMSFNCFilterBuilderGroupOperator.fgoAND}
       else Result = $mod.TTMSFNCFilterBuilderGroupOperator.fgoOR;
      return Result;
    };
    Result.IsValid = true;
    Result.ErrorParenthesis = -1;
    Result.ErrorOperatorPosition = -1;
    Result.ErrorOperatorMismatch = -1;
    Result.ErrorInvalidExpression = -1;
    if (pas.SysUtils.Trim(AExpression) === "") return Result;
    pfi.$assign($impl.GetParseFormatInfo(AParseFormat));
    part = "";
    prevPart = "";
    original = "";
    operatorStack = pas["Generics.Collections"].TStack$$$G$$generics$collections$$TTMSFNCFilterBuilderGroupOperator.$create("Create");
    newGroup = false;
    firstOperator = true;
    parCnt = 0;
    colCnt = 0;
    try {
      ExpArr = $impl.CustomSplit(AExpression,[pfi.ParenthesisOpen,pfi.ParenthesisClose,pfi.ColumnOpen,pfi.ColumnClose," "],true);
      for (var $l = 0, $end = rtl.length(ExpArr) - 1; $l <= $end; $l++) {
        I = $l;
        if (pas.SysUtils.Trim(ExpArr[I]) !== "") {
          part = pas.SysUtils.Trim(ExpArr[I]);
          if (pas.SysUtils.TStringHelper.StartsWith.call({get: function () {
              return part;
            }, set: function (v) {
              part = v;
            }},pfi.ParenthesisOpen) && (colCnt === 0)) {
            parCnt += 1;
            newGroup = true;
          } else if ((part === pfi.ParenthesisClose) && (colCnt === 0)) {
            if (IsOperator(prevPart)) {
              Result.IsValid = false;
              Result.ErrorOperatorPosition = original.length;
              return Result;
            };
            parCnt -= 1;
            if (parCnt < 0) {
              Result.IsValid = false;
              Result.ErrorParenthesis = original.length;
              return Result;
            } else if (operatorStack.GetCount() > 1) operatorStack.Pop();
          } else if (part === pfi.ColumnOpen) {
            colCnt += 1}
           else if (part === pfi.ColumnClose) {
            colCnt -= 1}
           else if (IsOperator(part)) {
            gop = GetOperator(part);
            if (newGroup) {
              operatorStack.Push(gop);
              newGroup = false;
            } else if (firstOperator) {
              operatorStack.Push(gop);
              firstOperator = false;
            } else if (gop !== operatorStack.Peek()) {
              Result.IsValid = false;
              Result.ErrorOperatorMismatch = original.length;
              return Result;
            };
          };
          prevPart = part;
        };
        original = original + ExpArr[I];
      };
    } finally {
      operatorStack = rtl.freeLoc(operatorStack);
    };
    if (IsOperator(prevPart)) {
      Result.IsValid = false;
      Result.ErrorParenthesis = original.length;
      return Result;
    };
    if (parCnt !== 0) {
      Result.IsValid = false;
      Result.ErrorOperatorPosition = original.length;
      return Result;
    };
    if (colCnt > 0) {
      Result.IsValid = false;
      Result.ErrorInvalidExpression = original.length;
      return Result;
    };
    return Result;
  };
  this.SetFilterFormatUniversalFilterExpressions = function (AParseFormat, AStringDelimiter, ASingleWildCard, AMultiCharWildCard) {
    AParseFormat.BeginUpdate();
    AParseFormat.FStringDelimiter = AStringDelimiter;
    AParseFormat.FSingleCharWildCard = ASingleWildCard;
    AParseFormat.FMultiCharWildCard = AMultiCharWildCard;
    AParseFormat.FAndOperator = "&";
    AParseFormat.FColumnFormat = "[#COLUMN]";
    AParseFormat.FContainsOperator = "= " + AStringDelimiter + AMultiCharWildCard + "#VALUE" + AMultiCharWildCard + AStringDelimiter;
    AParseFormat.FStartsWithOperator = "= " + AStringDelimiter + "#VALUE" + AMultiCharWildCard + AStringDelimiter;
    AParseFormat.FEndsWithOperator = "= " + AStringDelimiter + AMultiCharWildCard + "#VALUE" + AStringDelimiter;
    AParseFormat.FEmptyOperator = "= " + AStringDelimiter + AStringDelimiter;
    AParseFormat.FNotEmptyOperator = "= " + AStringDelimiter + AMultiCharWildCard + AStringDelimiter;
    AParseFormat.FEqualOperator = "= #VALUE";
    AParseFormat.FEqualStrOperator = "= " + AStringDelimiter + "#VALUE" + AStringDelimiter;
    AParseFormat.FLargerThanOrEqualOperator = ">= #VALUE";
    AParseFormat.FLargerThanOperator = "> #VALUE";
    AParseFormat.FGroupFormat = "(#GROUP)";
    AParseFormat.FSmallerThanOrEqualOperator = "<= #VALUE";
    AParseFormat.FSmallerThanOperator = "< #VALUE";
    AParseFormat.FNotEqualOperator = "!= #VALUE";
    AParseFormat.FOrOperator = "|";
    AParseFormat.FNotOperator = "NOT";
    AParseFormat.EndUpdate();
  };
  this.SetFilterFormatDelphiDataSet = function (AParseFormat, AStringDelimiter, ASingleWildCard, AMultiCharWildCard) {
    AParseFormat.BeginUpdate();
    AParseFormat.FStringDelimiter = AStringDelimiter;
    AParseFormat.FSingleCharWildCard = ASingleWildCard;
    AParseFormat.FMultiCharWildCard = AMultiCharWildCard;
    AParseFormat.FGroupFormat = "(#GROUP)";
    AParseFormat.FAndOperator = "AND";
    AParseFormat.FColumnFormat = "[#COLUMN]";
    AParseFormat.FContainsOperator = "LIKE " + AStringDelimiter + AMultiCharWildCard + "#VALUE" + AMultiCharWildCard + AStringDelimiter;
    AParseFormat.FStartsWithOperator = "LIKE " + AStringDelimiter + "#VALUE" + AMultiCharWildCard + AStringDelimiter;
    AParseFormat.FEndsWithOperator = "LIKE " + AStringDelimiter + AMultiCharWildCard + "#VALUE" + AStringDelimiter;
    AParseFormat.FEmptyOperator = "IS NULL";
    AParseFormat.FNotEmptyOperator = "IS NOT NULL";
    AParseFormat.FEqualOperator = "= #VALUE";
    AParseFormat.FEqualStrOperator = "LIKE " + AStringDelimiter + "#VALUE" + AStringDelimiter;
    AParseFormat.FLargerThanOrEqualOperator = ">= #VALUE";
    AParseFormat.FLargerThanOperator = "> #VALUE";
    AParseFormat.FSmallerThanOrEqualOperator = "<= #VALUE";
    AParseFormat.FSmallerThanOperator = "< #VALUE";
    AParseFormat.FNotEqualOperator = "<> #VALUE";
    AParseFormat.FOrOperator = "OR";
    AParseFormat.FNotOperator = "NOT";
    AParseFormat.EndUpdate();
  };
  this.GetGroupOperatorText = function (AGroupOperator, AParseFormat) {
    var Result = "";
    var $tmp = AGroupOperator;
    if ($tmp === $mod.TTMSFNCFilterBuilderGroupOperator.fgoAND) {
      Result = AParseFormat.FAndOperator}
     else if ($tmp === $mod.TTMSFNCFilterBuilderGroupOperator.fgoOR) Result = AParseFormat.FOrOperator;
    return Result;
  };
  this.TMSFNCFilterBuilder = function () {
    var Result = null;
    if ($impl.FTMSFNCFilterBuilder === null) $impl.FTMSFNCFilterBuilder = $mod.TTMSFNCFilterBuilder.$create("Create$1");
    Result = $impl.FTMSFNCFilterBuilder;
    return Result;
  };
  $mod.$resourcestrings = {sTMSFNCFilterBuilderUILanguageClose: {org: "Close"}, sTMSFNCFilterBuilderUILanguageApply: {org: "Apply"}, sTMSFNCFilterBuilderUILanguageOk: {org: "OK"}, sTMSFNCFilterBuilderUILanguageClear: {org: "Clear"}, sTMSFNCFilterBuilderUILanguageCancel: {org: "Cancel"}, sTMSFNCFilterBuilderUILanguageCaption: {org: "Filter"}, sTMSFNCFilterBuilderUILanguageAndOperatorText: {org: "AND"}, sTMSFNCFilterBuilderUILanguageOrOperatorText: {org: "OR"}, sTMSFNCFilterBuilderUILanguageEmptyOperatorText: {org: "is Empty"}, sTMSFNCFilterBuilderUILanguageEqualOperatorText: {org: "equals"}, sTMSFNCFilterBuilderUILanguageEqualOperatorNumber: {org: "="}, sTMSFNCFilterBuilderUILanguageNotEqualOperatorNumber: {org: "<>"}, sTMSFNCFilterBuilderUILanguageLargerThanOrEqualOperatorText: {org: ">="}, sTMSFNCFilterBuilderUILanguageLargerThanOperatorText: {org: ">"}, sTMSFNCFilterBuilderUILanguageSmallerThanOrEqualOperatorText: {org: "<="}, sTMSFNCFilterBuilderUILanguageSmallerThanOperatorText: {org: "<"}, sTMSFNCFilterBuilderUILanguageNotEmptyOperatorText: {org: "is Not Empty"}, sTMSFNCFilterBuilderUILanguageNotEqualOperatorText: {org: "is Not Equal"}, sTMSFNCFilterBuilderUILanguageStartsWithOperatorText: {org: "starts with"}, sTMSFNCFilterBuilderUILanguageEndsWithOperatorText: {org: "ends with"}, sTMSFNCFilterBuilderUILanguageContainsOperatorText: {org: "contains"}, sTMSFNCFilterBuilderUILanguageNotContainsOperatorText: {org: "does Not Contain"}, sTMSFNCFilterBuilderUILanguageAddExpression: {org: "Add Expression"}, sTMSFNCFilterBuilderUILanguageAddGroup: {org: "Add Group"}, sTMSFNCFilterBuilderUILanguageAddHint: {org: "Add Condition"}, sTMSFNCFilterBuilderUILanguageRemoveHint: {org: "Remove Condition"}, sTMSFNCFilterBuilderUILanguageNotHint: {org: "Invert Expression"}, sTMSFNCFilterBuilderUILanguageColumnNameHint: {org: "Set Column Name"}, sTMSFNCFilterBuilderUILanguageOperatorHint: {org: "Set Operator"}, sTMSFNCFilterBuilderUILanguageValueHint: {org: "Set Value"}, sTMSFNCFilterBuilderUILanguageTrue: {org: "True"}, sTMSFNCFilterBuilderUILanguageFalse: {org: "False"}};
  $mod.$implcode = function () {
    $impl.FTMSFNCFilterBuilder = null;
    $impl.GetStringStartIndex = function () {
      var Result = 0;
      Result = 0;
      return Result;
    };
    $impl.SetUpperCase = function (AText) {
      var Result = "";
      Result = pas.SysUtils.UpperCase(AText);
      return Result;
    };
    $impl.CustomSplit = function (AString, ADelimiters, AKeepDelimiterChars) {
      var Result = [];
      var posUpdated = false;
      var I = 0;
      var stIdx = 0;
      var curPos = 0;
      var lastPos = 0;
      var delCnt = 0;
      stIdx = 1;
      curPos = stIdx;
      delCnt = 0;
      lastPos = 0;
      Result = rtl.arraySetLength(Result,"",0);
      while (curPos <= AString.length) {
        posUpdated = false;
        for (var $l = 0, $end = rtl.length(ADelimiters) - 1; $l <= $end; $l++) {
          I = $l;
          delCnt = 1;
          if ((ADelimiters[I].length > 0) && (AString.charAt(curPos - 1) === ADelimiters[I].charAt(stIdx - 1))) {
            if (ADelimiters[I].length > 1) {
              delCnt = ADelimiters[I].length;
              if (pas.SysUtils.TStringHelper.Substring$1.call({get: function () {
                  return AString;
                }, set: function (v) {
                  rtl.raiseE("EPropReadOnly");
                }},curPos,delCnt) !== ADelimiters[I]) break;
            };
            if ((curPos - lastPos) > delCnt) {
              Result = rtl.arraySetLength(Result,"",rtl.length(Result) + 1);
              Result[rtl.length(Result) - 1] = pas.SysUtils.TStringHelper.Substring$1.call({get: function () {
                  return AString;
                }, set: function (v) {
                  rtl.raiseE("EPropReadOnly");
                }},lastPos,curPos - lastPos - delCnt);
              lastPos = curPos - delCnt;
            };
            if (AKeepDelimiterChars) {
              Result = rtl.arraySetLength(Result,"",rtl.length(Result) + 1);
              Result[rtl.length(Result) - 1] = pas.SysUtils.TStringHelper.Substring$1.call({get: function () {
                  return AString;
                }, set: function (v) {
                  rtl.raiseE("EPropReadOnly");
                }},lastPos,curPos - lastPos);
            };
            lastPos = curPos;
            curPos += delCnt;
            posUpdated = true;
            break;
          };
        };
        if (!posUpdated) curPos += 1;
      };
      if (lastPos < AString.length) {
        Result = rtl.arraySetLength(Result,"",rtl.length(Result) + 1);
        Result[rtl.length(Result) - 1] = pas.SysUtils.TStringHelper.Substring$1.call({get: function () {
            return AString;
          }, set: function (v) {
            rtl.raiseE("EPropReadOnly");
          }},lastPos,(curPos + delCnt) - lastPos);
      };
      return Result;
    };
    $impl.GetDefaultParseFormatInfo = function (ADataSet) {
      var Result = $mod.TTMSFNCFilterBuilderParseFormatInfo.$new();
      Result.ParenthesisOpen = "(";
      Result.ParenthesisClose = ")";
      Result.ColumnOpen = "[";
      Result.ColumnClose = "]";
      Result.AndOperator = "AND";
      Result.OrOperator = "OR";
      Result.NotOperator = "NOT";
      return Result;
    };
    $impl.GetDefaultExpressionOperatorFormat = function (ADataSet) {
      var Result = $mod.TTMSFNCFilterBuilderExpressionOperatorFormat.$new();
      if (ADataSet) {
        Result.StringDelimiter = "'";
        Result.MultiCharWildCard = "%";
        Result.SingleCharWildCard = "_";
        Result.StartsWithOpen = "LIKE '";
        Result.StartsWithClose = "%'";
        Result.EndsWithOpen = "LIKE '%";
        Result.EndsWithClose = "'";
        Result.ContainsOpen = "LIKE '%";
        Result.ContainsClose = "%'";
        Result.NotContainsClose = "%'";
        Result.EqualOpen = "= ";
        Result.EqualClose = "";
        Result.EqualStrOpen = "LIKE '";
        Result.EqualStrClose = "'";
        Result.NotEqualOpen = "<>";
        Result.NotEqualClose = "";
        Result.Empty = "is NULL";
        Result.NotEmpty = "is not NULL";
        Result.LargerThanOpen = ">";
        Result.LargerThanClose = "";
        Result.SmallerThanOpen = "<";
        Result.SmallerThanClose = "";
        Result.LargerThanOrEqualOpen = ">=";
        Result.LargerThanOrEqualClose = "";
        Result.SmallerThanOrEqualOpen = "<=";
        Result.SmallerThanOrEqualClose = "";
      } else {
        Result.StringDelimiter = '"';
        Result.MultiCharWildCard = "*";
        Result.SingleCharWildCard = "?";
        Result.StartsWithOpen = '= "';
        Result.StartsWithClose = '*"';
        Result.EndsWithOpen = '= "*';
        Result.EndsWithClose = '"';
        Result.ContainsOpen = '= "*';
        Result.ContainsClose = '*"';
        Result.NotContainsClose = '*"';
        Result.EqualOpen = "=";
        Result.EqualClose = "";
        Result.EqualStrOpen = "=";
        Result.EqualStrClose = "";
        Result.NotEqualOpen = "<>";
        Result.NotEqualClose = "";
        Result.Empty = '= ""';
        Result.NotEmpty = '="*"';
        Result.LargerThanOpen = ">";
        Result.LargerThanClose = "";
        Result.SmallerThanOpen = "<";
        Result.SmallerThanClose = "";
        Result.LargerThanOrEqualOpen = ">=";
        Result.LargerThanOrEqualClose = "";
        Result.SmallerThanOrEqualOpen = "<=";
        Result.SmallerThanOrEqualClose = "";
        Result.SingleCharWildCard = "?";
        Result.MultiCharWildCard = "*";
        Result.StringDelimiter = '"';
      };
      return Result;
    };
    $impl.GetParseFormatInfo = function (AParseFormat) {
      var Result = $mod.TTMSFNCFilterBuilderParseFormatInfo.$new();
      var par = [];
      var col = [];
      if (AParseFormat != null) {
        par = pas.SysUtils.TStringHelper.Split$8.call({p: AParseFormat, get: function () {
            return this.p.FGroupFormat;
          }, set: function (v) {
            this.p.FGroupFormat = v;
          }},["#GROUP"]);
        col = pas.SysUtils.TStringHelper.Split$8.call({p: AParseFormat, get: function () {
            return this.p.FColumnFormat;
          }, set: function (v) {
            this.p.FColumnFormat = v;
          }},["#COLUMN"]);
        Result.ParenthesisOpen = par[0];
        if (rtl.length(par) > 1) Result.ParenthesisClose = par[1];
        Result.ColumnOpen = col[0];
        if (rtl.length(col) > 1) Result.ColumnClose = col[1];
        Result.AndOperator = AParseFormat.FAndOperator;
        Result.OrOperator = AParseFormat.FOrOperator;
        Result.NotOperator = AParseFormat.FNotOperator;
        par = [];
        col = [];
      } else {
        Result.$assign($impl.GetDefaultParseFormatInfo(true));
      };
      return Result;
    };
    $impl.SplitExpression = function (ASplitExpression, AParseFormat) {
      var Result = [];
      var sp = [];
      var I = 0;
      var st = "";
      var ParCnt = 0;
      var ColCnt = 0;
      function AddTextExpression() {
        sp = rtl.arraySetLength(sp,"",rtl.length(sp) + 1);
        sp[rtl.length(sp) - 1] = st;
        st = "";
      };
      Result = [];
      sp = [];
      ParCnt = 0;
      ColCnt = 0;
      try {
        for (var $l = 1, $end = ASplitExpression.length; $l <= $end; $l++) {
          I = $l;
          if (ASplitExpression.charAt(I - 1) === AParseFormat.ParenthesisClose) {
            st = st + ASplitExpression.charAt(I - 1);
            if (ColCnt === 0) {
              ParCnt -= 1;
              if (ParCnt === 0) AddTextExpression();
            };
          } else if (ASplitExpression.charAt(I - 1) === AParseFormat.ParenthesisOpen) {
            if (ColCnt > 0) {
              st = st + ASplitExpression.charAt(I - 1)}
             else {
              ParCnt += 1;
              if (ParCnt > 0) st = st + ASplitExpression.charAt(I - 1);
            };
          } else if (ASplitExpression.charAt(I - 1) === AParseFormat.ColumnClose) {
            ColCnt -= 1;
            st = st + ASplitExpression.charAt(I - 1);
            if ((ColCnt === 0) && (ParCnt === 0)) AddTextExpression();
          } else if (ASplitExpression.charAt(I - 1) === AParseFormat.ColumnOpen) {
            ColCnt += 1;
            st = st + ASplitExpression.charAt(I - 1);
          } else if (ASplitExpression.charAt(I - 1) === " ") {
            if ((ParCnt > 0) || (ColCnt > 0)) {
              st = st + ASplitExpression.charAt(I - 1)}
             else if (pas.SysUtils.Trim(st) !== "") AddTextExpression();
          } else st = st + ASplitExpression.charAt(I - 1);
        };
        if (st !== "") AddTextExpression();
        Result = rtl.arrayRef(sp);
      } finally {
        sp = [];
      };
      return Result;
    };
    $impl.SplitExpressionCheckGroup = function (ASplitExpression, AParseFormat, ACheckIsGroup) {
      var Result = [];
      var I = 0;
      var AndCnt = 0;
      var OrCnt = 0;
      var ExpCnt = 0;
      Result = [];
      ACheckIsGroup.set(false);
      if (pas.SysUtils.Trim(ASplitExpression) !== "") {
        Result = $impl.SplitExpression(ASplitExpression,$mod.TTMSFNCFilterBuilderParseFormatInfo.$clone(AParseFormat));
        AndCnt = 0;
        OrCnt = 0;
        ExpCnt = 0;
        for (var $l = 0, $end = rtl.length(Result) - 1; $l <= $end; $l++) {
          I = $l;
          if (Result[I] === AParseFormat.AndOperator) {
            AndCnt += 1}
           else if (Result[I] === AParseFormat.OrOperator) {
            OrCnt += 1}
           else if (pas.SysUtils.TStringHelper.StartsWith.call({a: I, p: Result, get: function () {
              return this.p[this.a];
            }, set: function (v) {
              this.p[this.a] = v;
            }},AParseFormat.ParenthesisOpen)) ExpCnt += 1;
        };
        ACheckIsGroup.set((ExpCnt > 0) || (AndCnt > 0) || (OrCnt > 0));
      };
      return Result;
    };
    $impl.IsGroup = function (AExpression, ABuilder) {
      var Result = false;
      var b = false;
      var pf = $mod.TTMSFNCFilterBuilderParseFormatInfo.$new();
      if (ABuilder != null) {
        pf.$assign($impl.GetParseFormatInfo(ABuilder.FParseFormat))}
       else pf.$assign($impl.GetParseFormatInfo(null));
      $impl.SplitExpressionCheckGroup(AExpression,$mod.TTMSFNCFilterBuilderParseFormatInfo.$clone(pf),{get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }});
      Result = b;
      return Result;
    };
    $impl.RemoveGroupOperators = function (AGroupExpression, AParseFormat) {
      var Result = "";
      if (pas.SysUtils.TStringHelper.StartsWith.call({get: function () {
          return AGroupExpression;
        }, set: function (v) {
          AGroupExpression = v;
        }},AParseFormat.ParenthesisOpen) && pas.SysUtils.TStringHelper.EndsWith.call({get: function () {
          return AGroupExpression;
        }, set: function (v) {
          AGroupExpression = v;
        }},AParseFormat.ParenthesisClose)) {
        Result = pas.SysUtils.TStringHelper.Remove$1.call({get: function () {
            return AGroupExpression;
          }, set: function (v) {
            AGroupExpression = v;
          }},0,AParseFormat.ParenthesisOpen.length);
        Result = pas.SysUtils.TStringHelper.Remove$1.call({get: function () {
            return Result;
          }, set: function (v) {
            Result = v;
          }},Result.length - AParseFormat.ParenthesisClose.length,AParseFormat.ParenthesisClose.length);
      };
      return Result;
    };
    $impl.RemoveGroupOperators$1 = function (AGroupExpression, ABuilder) {
      var Result = "";
      var pf = $mod.TTMSFNCFilterBuilderParseFormatInfo.$new();
      if (ABuilder != null) {
        pf.$assign($impl.GetParseFormatInfo(ABuilder.FParseFormat))}
       else pf.$assign($impl.GetDefaultParseFormatInfo(true));
      Result = $impl.RemoveGroupOperators(AGroupExpression,$mod.TTMSFNCFilterBuilderParseFormatInfo.$clone(pf));
      return Result;
    };
    $impl.GetInternalExpressionInformation = function (AExpression, AParseFormat, AExpressionOperatorFormat, AIsDataSet) {
      var Result = $mod.TTMSFNCFilterBuilderExpressionInformation.$new();
      var op = 0;
      var opTxt = "";
      var ExpArr = [];
      var I = 0;
      var arrStartIdx = 0;
      function RemoveColumnOperators(AColumnText) {
        var Result = "";
        Result = AColumnText;
        if (pas.SysUtils.TStringHelper.StartsWith.call({get: function () {
            return AColumnText;
          }, set: function (v) {
            AColumnText = v;
          }},AParseFormat.ColumnOpen) && pas.SysUtils.TStringHelper.EndsWith.call({get: function () {
            return AColumnText;
          }, set: function (v) {
            AColumnText = v;
          }},AParseFormat.ColumnClose)) {
          Result = pas.SysUtils.TStringHelper.Remove$1.call({get: function () {
              return AColumnText;
            }, set: function (v) {
              AColumnText = v;
            }},0,AParseFormat.ColumnOpen.length);
          Result = pas.SysUtils.TStringHelper.Remove$1.call({get: function () {
              return Result;
            }, set: function (v) {
              Result = v;
            }},Result.length - AParseFormat.ColumnClose.length,AParseFormat.ColumnClose.length);
        };
        return Result;
      };
      function GetOperatorAndValue(AText) {
        var StrStartIdx = 0;
        var st = "";
        var upTxt = "";
        var iof = $mod.TTMSFNCFilterBuilderExpressionOperatorFormat.$new();
        iof.$assign(AExpressionOperatorFormat);
        StrStartIdx = $impl.GetStringStartIndex();
        op = $mod.TTMSFNCFilterBuilderExpressionOperator.feoNotEmpty;
        st = "";
        upTxt = $impl.SetUpperCase(AText);
        if (upTxt === iof.Empty) {
          op = $mod.TTMSFNCFilterBuilderExpressionOperator.feoEmpty;
          st = "";
        } else if (upTxt === iof.NotEmpty) {
          op = $mod.TTMSFNCFilterBuilderExpressionOperator.feoNotEmpty;
          st = "";
        } else if ((pas.SysUtils.TStringHelper.StartsWith.call({get: function () {
            return upTxt;
          }, set: function (v) {
            upTxt = v;
          }},iof.ContainsOpen) || (iof.ContainsOpen === "")) && (pas.SysUtils.TStringHelper.EndsWith.call({get: function () {
            return upTxt;
          }, set: function (v) {
            upTxt = v;
          }},iof.ContainsClose) || (iof.ContainsClose === "")) && !((iof.ContainsOpen === "") && (iof.ContainsClose === ""))) {
          op = $mod.TTMSFNCFilterBuilderExpressionOperator.feoContains;
          st = pas.SysUtils.TStringHelper.Remove$1.call({get: function () {
              return AText;
            }, set: function (v) {
              AText = v;
            }},StrStartIdx,iof.ContainsOpen.length);
          st = pas.SysUtils.TStringHelper.Remove$1.call({get: function () {
              return st;
            }, set: function (v) {
              st = v;
            }},st.length - iof.ContainsClose.length,iof.ContainsClose.length);
        } else if ((pas.SysUtils.TStringHelper.StartsWith.call({get: function () {
            return upTxt;
          }, set: function (v) {
            upTxt = v;
          }},iof.StartsWithOpen) || (iof.StartsWithOpen === "")) && (pas.SysUtils.TStringHelper.EndsWith.call({get: function () {
            return upTxt;
          }, set: function (v) {
            upTxt = v;
          }},iof.StartsWithClose) || (iof.StartsWithClose === "")) && !((iof.StartsWithOpen === "") && (iof.StartsWithClose === ""))) {
          op = $mod.TTMSFNCFilterBuilderExpressionOperator.feoStartsWith;
          st = pas.SysUtils.TStringHelper.Remove$1.call({get: function () {
              return AText;
            }, set: function (v) {
              AText = v;
            }},StrStartIdx,iof.StartsWithOpen.length);
          st = pas.SysUtils.TStringHelper.Remove$1.call({get: function () {
              return st;
            }, set: function (v) {
              st = v;
            }},st.length - iof.StartsWithClose.length,iof.StartsWithClose.length);
        } else if ((pas.SysUtils.TStringHelper.StartsWith.call({get: function () {
            return upTxt;
          }, set: function (v) {
            upTxt = v;
          }},iof.EndsWithOpen) || (iof.EndsWithOpen === "")) && (pas.SysUtils.TStringHelper.EndsWith.call({get: function () {
            return upTxt;
          }, set: function (v) {
            upTxt = v;
          }},iof.EndsWithClose) || (iof.EndsWithClose === "")) && !((iof.EndsWithOpen === "") && (iof.EndsWithClose === ""))) {
          op = $mod.TTMSFNCFilterBuilderExpressionOperator.feoEndsWith;
          st = pas.SysUtils.TStringHelper.Remove$1.call({get: function () {
              return AText;
            }, set: function (v) {
              AText = v;
            }},StrStartIdx,iof.EndsWithOpen.length);
          st = pas.SysUtils.TStringHelper.Remove$1.call({get: function () {
              return st;
            }, set: function (v) {
              st = v;
            }},st.length - iof.EndsWithClose.length,iof.EndsWithClose.length);
        } else if ((pas.SysUtils.TStringHelper.StartsWith.call({get: function () {
            return upTxt;
          }, set: function (v) {
            upTxt = v;
          }},iof.NotEqualOpen) || (iof.NotEqualOpen === "")) && (pas.SysUtils.TStringHelper.EndsWith.call({get: function () {
            return upTxt;
          }, set: function (v) {
            upTxt = v;
          }},iof.NotEqualClose) || (iof.NotEqualClose === "")) && !((iof.NotEqualOpen === "") && (iof.NotEqualClose === ""))) {
          op = $mod.TTMSFNCFilterBuilderExpressionOperator.feoNotEqual;
          st = pas.SysUtils.TStringHelper.Remove$1.call({get: function () {
              return AText;
            }, set: function (v) {
              AText = v;
            }},StrStartIdx,iof.NotEqualOpen.length);
          st = pas.SysUtils.Trim(pas.SysUtils.TStringHelper.Remove$1.call({get: function () {
              return st;
            }, set: function (v) {
              st = v;
            }},st.length - iof.NotEqualClose.length,iof.NotEqualClose.length));
        } else if ((pas.SysUtils.TStringHelper.StartsWith.call({get: function () {
            return upTxt;
          }, set: function (v) {
            upTxt = v;
          }},iof.LargerThanOrEqualOpen) || (iof.LargerThanOrEqualOpen === "")) && (pas.SysUtils.TStringHelper.EndsWith.call({get: function () {
            return upTxt;
          }, set: function (v) {
            upTxt = v;
          }},iof.LargerThanOrEqualClose) || (iof.LargerThanOrEqualClose === "")) && !((iof.LargerThanOrEqualOpen === "") && (iof.LargerThanOrEqualClose === ""))) {
          op = $mod.TTMSFNCFilterBuilderExpressionOperator.feoLargerThanOrEqual;
          st = pas.SysUtils.TStringHelper.Remove$1.call({get: function () {
              return AText;
            }, set: function (v) {
              AText = v;
            }},StrStartIdx,iof.LargerThanOrEqualOpen.length);
          st = pas.SysUtils.Trim(pas.SysUtils.TStringHelper.Remove$1.call({get: function () {
              return st;
            }, set: function (v) {
              st = v;
            }},st.length - iof.LargerThanOrEqualClose.length,iof.LargerThanOrEqualClose.length));
        } else if ((pas.SysUtils.TStringHelper.StartsWith.call({get: function () {
            return upTxt;
          }, set: function (v) {
            upTxt = v;
          }},iof.LargerThanOpen) || (iof.LargerThanOpen === "")) && (pas.SysUtils.TStringHelper.EndsWith.call({get: function () {
            return upTxt;
          }, set: function (v) {
            upTxt = v;
          }},iof.LargerThanClose) || (iof.LargerThanClose === "")) && !((iof.LargerThanOpen === "") && (iof.LargerThanClose === ""))) {
          op = $mod.TTMSFNCFilterBuilderExpressionOperator.feoLargerThan;
          st = pas.SysUtils.TStringHelper.Remove$1.call({get: function () {
              return AText;
            }, set: function (v) {
              AText = v;
            }},StrStartIdx,iof.LargerThanOpen.length);
          st = pas.SysUtils.Trim(pas.SysUtils.TStringHelper.Remove$1.call({get: function () {
              return st;
            }, set: function (v) {
              st = v;
            }},st.length - iof.LargerThanClose.length,iof.LargerThanClose.length));
        } else if ((pas.SysUtils.TStringHelper.StartsWith.call({get: function () {
            return upTxt;
          }, set: function (v) {
            upTxt = v;
          }},iof.SmallerThanOrEqualOpen) || (iof.SmallerThanOrEqualOpen === "")) && (pas.SysUtils.TStringHelper.EndsWith.call({get: function () {
            return upTxt;
          }, set: function (v) {
            upTxt = v;
          }},iof.SmallerThanOrEqualClose) || (iof.SmallerThanOrEqualClose === "")) && !((iof.SmallerThanOrEqualOpen === "") && (iof.SmallerThanOrEqualClose === ""))) {
          op = $mod.TTMSFNCFilterBuilderExpressionOperator.feoSmallerThanOrEqual;
          st = pas.SysUtils.TStringHelper.Remove$1.call({get: function () {
              return AText;
            }, set: function (v) {
              AText = v;
            }},StrStartIdx,iof.SmallerThanOrEqualOpen.length);
          st = pas.SysUtils.Trim(pas.SysUtils.TStringHelper.Remove$1.call({get: function () {
              return st;
            }, set: function (v) {
              st = v;
            }},st.length - iof.SmallerThanOrEqualClose.length,iof.SmallerThanOrEqualClose.length));
        } else if ((pas.SysUtils.TStringHelper.StartsWith.call({get: function () {
            return upTxt;
          }, set: function (v) {
            upTxt = v;
          }},iof.SmallerThanOpen) || (iof.SmallerThanOpen === "")) && (pas.SysUtils.TStringHelper.EndsWith.call({get: function () {
            return upTxt;
          }, set: function (v) {
            upTxt = v;
          }},iof.SmallerThanClose) || (iof.SmallerThanClose === "")) && !((iof.SmallerThanOpen === "") && (iof.SmallerThanClose === ""))) {
          op = $mod.TTMSFNCFilterBuilderExpressionOperator.feoSmallerThan;
          st = pas.SysUtils.TStringHelper.Remove$1.call({get: function () {
              return AText;
            }, set: function (v) {
              AText = v;
            }},StrStartIdx,iof.SmallerThanOpen.length);
          st = pas.SysUtils.Trim(pas.SysUtils.TStringHelper.Remove$1.call({get: function () {
              return st;
            }, set: function (v) {
              st = v;
            }},st.length - iof.SmallerThanClose.length,iof.SmallerThanClose.length));
        } else if ((pas.SysUtils.TStringHelper.StartsWith.call({get: function () {
            return upTxt;
          }, set: function (v) {
            upTxt = v;
          }},iof.EqualStrOpen) || (iof.EqualStrOpen === "")) && (pas.SysUtils.TStringHelper.EndsWith.call({get: function () {
            return upTxt;
          }, set: function (v) {
            upTxt = v;
          }},iof.EqualStrClose) || (iof.EqualStrClose === "")) && !((iof.EqualStrOpen === "") && (iof.EqualStrClose === ""))) {
          op = $mod.TTMSFNCFilterBuilderExpressionOperator.feoEqual;
          st = pas.SysUtils.TStringHelper.Remove$1.call({get: function () {
              return AText;
            }, set: function (v) {
              AText = v;
            }},StrStartIdx,iof.EqualStrOpen.length);
          st = pas.SysUtils.TStringHelper.Remove$1.call({get: function () {
              return st;
            }, set: function (v) {
              st = v;
            }},st.length - iof.EqualStrClose.length,iof.EqualStrClose.length);
        } else if ((pas.SysUtils.TStringHelper.StartsWith.call({get: function () {
            return upTxt;
          }, set: function (v) {
            upTxt = v;
          }},iof.EqualOpen) || (iof.EqualOpen === "")) && (pas.SysUtils.TStringHelper.EndsWith.call({get: function () {
            return upTxt;
          }, set: function (v) {
            upTxt = v;
          }},iof.EqualClose) || (iof.EqualClose === "")) && !((iof.EqualOpen === "") && (iof.EqualClose === ""))) {
          op = $mod.TTMSFNCFilterBuilderExpressionOperator.feoEqual;
          st = pas.SysUtils.TStringHelper.Remove$1.call({get: function () {
              return AText;
            }, set: function (v) {
              AText = v;
            }},StrStartIdx,iof.EqualOpen.length);
          st = pas.SysUtils.Trim(pas.SysUtils.TStringHelper.Remove$1.call({get: function () {
              return st;
            }, set: function (v) {
              st = v;
            }},st.length - iof.EqualClose.length,iof.EqualClose.length));
        };
        if (pas.SysUtils.TStringHelper.StartsWith.call({a: pas.SysUtils.Trim(st), get: function () {
            return this.a;
          }, set: function (v) {
            this.a = v;
          }},iof.StringDelimiter) && pas.SysUtils.TStringHelper.EndsWith.call({a: pas.SysUtils.Trim(st), get: function () {
            return this.a;
          }, set: function (v) {
            this.a = v;
          }},iof.StringDelimiter)) st = pas.SysUtils.Trim(st);
        Result.ExpressionOperator = op;
        Result.ValueText = st;
      };
      Result.IsGroup = true;
      Result.Column = null;
      Result.ColumnName = "";
      Result.ExpressionOperator = $mod.TTMSFNCFilterBuilderExpressionOperator.feoNotEmpty;
      Result.Value = pas["TMS.TMSFNCValue"].TValueToFNCValue(pas.RTTI.TValue.$clone(pas.RTTI.TValue.Empty()));
      Result.ValueText = "";
      Result.Inverted = false;
      ExpArr = $impl.SplitExpressionCheckGroup(AExpression,$mod.TTMSFNCFilterBuilderParseFormatInfo.$clone(AParseFormat),{p: Result, get: function () {
          return this.p.IsGroup;
        }, set: function (v) {
          this.p.IsGroup = v;
        }});
      if (rtl.length(ExpArr) === 0) {
        Result.IsEmpty = true;
        return Result;
      } else Result.IsEmpty = false;
      if (Result.IsGroup || (rtl.length(ExpArr) === 0)) return Result;
      if (rtl.length(ExpArr) === 1) ExpArr = $impl.CustomSplit(AExpression,[AExpressionOperatorFormat.EqualOpen,AExpressionOperatorFormat.ContainsOpen,AExpressionOperatorFormat.EndsWithOpen,AExpressionOperatorFormat.StartsWithOpen,AExpressionOperatorFormat.SmallerThanOpen,AExpressionOperatorFormat.LargerThanOpen],true);
      Result.Inverted = $impl.SetUpperCase(ExpArr[0]) === $impl.SetUpperCase(AParseFormat.NotOperator);
      if (Result.Inverted) {
        arrStartIdx = 1}
       else arrStartIdx = 0;
      for (var $l = arrStartIdx, $end = rtl.length(ExpArr) - 1; $l <= $end; $l++) {
        I = $l;
        if (((AParseFormat.ColumnOpen.length > 0) || (AParseFormat.ColumnOpen.length > 0)) && pas.SysUtils.TStringHelper.StartsWith.call({a: I, p: ExpArr, get: function () {
            return this.p[this.a];
          }, set: function (v) {
            this.p[this.a] = v;
          }},AParseFormat.ColumnOpen) && pas.SysUtils.TStringHelper.EndsWith.call({a: I, p: ExpArr, get: function () {
            return this.p[this.a];
          }, set: function (v) {
            this.p[this.a] = v;
          }},AParseFormat.ColumnClose)) {
          Result.ColumnName = RemoveColumnOperators(ExpArr[I])}
         else if (AIsDataSet && (I === arrStartIdx)) {
          Result.ColumnName = ExpArr[I]}
         else {
          if ((opTxt !== "") && !pas.StrUtils.MatchStr(ExpArr[I],[AExpressionOperatorFormat.EqualOpen,AExpressionOperatorFormat.ContainsOpen,AExpressionOperatorFormat.EndsWithOpen,AExpressionOperatorFormat.StartsWithOpen,AExpressionOperatorFormat.SmallerThanOpen,AExpressionOperatorFormat.LargerThanOpen])) opTxt = opTxt + " ";
          opTxt = opTxt + ExpArr[I];
        };
      };
      GetOperatorAndValue(opTxt);
      return Result;
    };
    $impl.GetInternalExpressionText = function (AColumnName, ADataType, AExpressionOperator, AValueText, AValue, AInverted, AFormatSettings, AParseFormat, AIsDataSet) {
      var Result = "";
      Result = $mod.GetFilterBuilderExpressionText(AColumnName,ADataType,AExpressionOperator,AValueText,AValue,AInverted,pas.SysUtils.TFormatSettings.$clone(AFormatSettings),AParseFormat,AIsDataSet);
      return Result;
    };
  };
  $mod.$init = function () {
    pas.Classes.RegisterClasses([$mod.TTMSFNCFilterBuilderGroup,$mod.TTMSFNCFilterBuilderExpression,$mod.TTMSFNCFilterBuilderColumn]);
  };
},["StrUtils","DateUtils"]);
rtl.module("WEBLib.TMSFNCDataGridUtil",["System","Classes","Types","SysUtils"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.TTMSFNCGridAutoType = {"0": "atNumeric", atNumeric: 0, "1": "atFloat", atFloat: 1, "2": "atString", atString: 2, "3": "atDate", atDate: 3, "4": "atTime", atTime: 4, "5": "atScientific", atScientific: 5};
  this.$rtti.$Enum("TTMSFNCGridAutoType",{minvalue: 0, maxvalue: 5, ordtype: 1, enumtype: this.TTMSFNCGridAutoType});
  this.CharPos = function (ch, s) {
    var Result = 0;
    var i = 0;
    Result = 0;
    for (var $l = 1, $end = s.length; $l <= $end; $l++) {
      i = $l;
      if (s.charAt(i - 1) === ch) {
        Result = i;
        break;
      };
    };
    return Result;
  };
  this.CRToLF = function (s) {
    var Result = "";
    var i = 0;
    var res = "";
    res = "";
    for (var $l = 1, $end = s.length; $l <= $end; $l++) {
      i = $l;
      if (s.charAt(i - 1) !== "\r") {
        res = res + s.charAt(i - 1)}
       else res = res + "\n";
    };
    Result = res;
    return Result;
  };
  this.CSVQuotes = function (S) {
    var Result = "";
    var i = 0;
    Result = "";
    for (var $l = 1, $end = S.length; $l <= $end; $l++) {
      i = $l;
      Result = Result + S.charAt(i - 1);
      if (S.charAt(i - 1) === '"') Result = Result + '"';
    };
    return Result;
  };
  this.DoubleToSingleChar = function (ch, s) {
    var Result = "";
    var Res = "";
    var i = 0;
    if ((s === "") || ($mod.CharPos(ch,s) === 0)) {
      Result = s;
      return Result;
    };
    Res = "";
    i = 1;
    do {
      Res = Res + s.charAt(i - 1);
      if ((s.charAt(i - 1) === ch) && (s.charAt((i + 1) - 1) === ch)) i += 1;
      i += 1;
    } while (!(i > s.length));
    Result = Res;
    return Result;
  };
  this.FileToLf = function (s, multiline) {
    var Result = "";
    var i = 0;
    if (pas.System.Pos("\b",s) > 0) for (var $l = 1, $end = s.length; $l <= $end; $l++) {
      i = $l;
      if (s.charAt(i - 1) === "\t") s = rtl.setCharAt(s,i - 1,"\r");
      if (s.charAt(i - 1) === "\b") s = rtl.setCharAt(s,i - 1,"\n");
      if (s.charAt(i - 1) === "\x01") s = rtl.setCharAt(s,i - 1,"\x00");
    };
    if (!multiline) {
      Result = $mod.GetNextLine({get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},multiline)}
     else Result = s;
    return Result;
  };
  this.FixNonBreaking = function (su) {
    var Result = "";
    while (pas.System.Pos(" ",su) > 0) {
      $impl.TagReplaceString(" ","&nbsp;",{get: function () {
          return su;
        }, set: function (v) {
          su = v;
        }});
    };
    Result = su;
    return Result;
  };
  this.GetNextLine = function (s, multiline) {
    var Result = "";
    var vp = 0;
    vp = -1;
    if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos($impl.LINEFEED,s.get(),{get: function () {
        return vp;
      }, set: function (v) {
        vp = v;
      }}) > 0) {
      Result = pas.System.Copy(s.get(),1,vp - 1);
      pas.System.Delete(s,1,vp);
      if (s.get() !== "") if (s.get().charAt(0) === "\n") pas.System.Delete(s,1,1);
      if (!multiline) s.set("");
    } else {
      Result = s.get();
      s.set("");
    };
    return Result;
  };
  this.GetToken = function (s, separator) {
    var Result = "";
    var sp = 0;
    Result = "";
    sp = pas.System.Pos(separator,s.get());
    if (sp > 0) {
      Result = pas.System.Copy(s.get(),1,sp - 1);
      pas.System.Delete(s,1,sp);
    };
    return Result;
  };
  this.HTMLLineBreaks = function (s) {
    var Result = "";
    var i = 0;
    var res = "";
    res = "";
    if (pas.System.Pos("\r",s) === 0) {
      res = s}
     else for (var $l = 1, $end = s.length; $l <= $end; $l++) {
      i = $l;
      if (s.charAt(i - 1) !== "\r") {
        res = res + s.charAt(i - 1)}
       else res = res + "<br>";
    };
    Result = res;
    return Result;
  };
  this.IsType = function (s) {
    var Result = 0;
    var i = 0;
    var isI = false;
    var isF = false;
    var isS = false;
    var th = 0;
    var de = 0;
    var mi = 0;
    var isE = false;
    Result = $mod.TTMSFNCGridAutoType.atString;
    if (s === "") return Result;
    isI = true;
    isF = true;
    isS = true;
    isE = false;
    th = -1;
    de = 0;
    mi = 0;
    for (var $l = 1, $end = s.length; $l <= $end; $l++) {
      i = $l;
      if (!$impl.CheckSignedNum(s.charAt(i - 1))) isI = false;
      if ((s.charAt(i - 1) === "e") || (s.charAt(i - 1) === "E")) {
        if (isE) isS = false;
        isE = true;
      };
      if ((i > 1) && (s.charAt(i - 1) === "-")) {
        isI = false;
        isF = false;
      };
      if ((i === 1) && ((s.charAt(i - 1) === "e") || (s.charAt(i - 1) === "E"))) isS = false;
      if ((i === s.length) && ((s.charAt(i - 1) === "e") || (s.charAt(i - 1) === "E") || (s.charAt(i - 1) === "+") || (s.charAt(i - 1) === "-"))) isS = false;
      if (!($impl.CheckNum(s.charAt(i - 1)) || (s.charAt(i - 1) === "-") || (s.charAt(i - 1) === pas.SysUtils.FormatSettings.ThousandSeparator) || (s.charAt(i - 1) === pas.SysUtils.FormatSettings.DecimalSeparator))) isF = false;
      if (!($impl.CheckSignedFloatNum(s.charAt(i - 1)) && (s.charAt(i - 1) !== pas.SysUtils.FormatSettings.ThousandSeparator))) isS = false;
      if ((s.charAt(i - 1) === pas.SysUtils.FormatSettings.ThousandSeparator) && ((i - th) < 4) && (th !== -1)) {
        isF = false;
      };
      if (s.charAt(i - 1) === pas.SysUtils.FormatSettings.ThousandSeparator) {
        th = i;
      };
      if (s.charAt(i - 1) === pas.SysUtils.FormatSettings.DecimalSeparator) de += 1;
      if (s.charAt(i - 1) === "-") mi += 1;
    };
    if (isI) {
      Result = $mod.TTMSFNCGridAutoType.atNumeric}
     else {
      if (isF && !isE) Result = $mod.TTMSFNCGridAutoType.atFloat;
      if (isS && isE) {
        if (mi === 2) mi = 1;
        Result = $mod.TTMSFNCGridAutoType.atScientific;
      };
    };
    if ((mi > 1) || (de > 1)) Result = $mod.TTMSFNCGridAutoType.atString;
    return Result;
  };
  this.IsURL = function (s) {
    var Result = false;
    var su = "";
    su = pas.SysUtils.UpperCase(s);
    Result = (pas.System.Pos("HTTP://",su) === 1) || (pas.System.Pos("HTTPS://",su) === 1) || (pas.System.Pos("FTP://",su) === 1) || (pas.System.Pos("NNTP://",su) === 1) || (pas.System.Pos("MAILTO:",su) === 1);
    return Result;
  };
  this.LFToFile = function (s) {
    var Result = "";
    var i = 0;
    if (pas.System.Pos("\r",s) > 0) for (var $l = 1, $end = s.length; $l <= $end; $l++) {
      i = $l;
      if (s.charAt(i - 1) === "\r") s = rtl.setCharAt(s,i - 1,"\t");
      if (s.charAt(i - 1) === "\n") s = rtl.setCharAt(s,i - 1,"\b");
      if (s.charAt(i - 1) === "\x00") s = rtl.setCharAt(s,i - 1,"\x01");
    };
    Result = s;
    return Result;
  };
  this.LinesInText = function (s, multiline) {
    var Result = 0;
    var vp = 0;
    Result = 1;
    if (!multiline) return Result;
    vp = -1;
    while (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos($impl.LINEFEED,s,{get: function () {
        return vp;
      }, set: function (v) {
        vp = v;
      }}) > 0) {
      Result += 1;
      pas.System.Delete({get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},1,vp);
    };
    return Result;
  };
  this.NumChar = function (p, s) {
    var Result = 0;
    var Res = 0;
    var vp = 0;
    Res = 0;
    vp = -1;
    while (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos(p,s,{get: function () {
        return vp;
      }, set: function (v) {
        vp = v;
      }}) > 0) {
      pas.System.Delete({get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},1,vp);
      Res += 1;
    };
    Result = Res;
    return Result;
  };
  this.NumSingleChar = function (p, s) {
    var Result = 0;
    var Res = 0;
    var sp = 0;
    Res = 0;
    sp = -1;
    while ($mod.SinglePos(p,s,{get: function () {
        return sp;
      }, set: function (v) {
        sp = v;
      }}) > 0) {
      pas.System.Delete({get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},1,sp);
      Res += 1;
    };
    Result = Res;
    return Result;
  };
  this.SinglePos = function (p, s, sp) {
    var Result = 0;
    var i = 0;
    var QuoteCount = 0;
    i = 1;
    QuoteCount = 0;
    while (i <= s.length) {
      if (s.charAt(i - 1) === p) {
        if (i < s.length) {
          QuoteCount += 1}
         else if (i === s.length) {
          Result = i;
          sp.set(i);
          return Result;
        };
      } else {
        if (pas.System.Odd(QuoteCount)) {
          Result = i - 1;
          sp.set(i - 1);
          return Result;
        } else QuoteCount = 0;
      };
      i += 1;
    };
    Result = 0;
    sp.set(0);
    return Result;
  };
  this.VarCharPos = function (ch, s, Res) {
    var Result = 0;
    var i = 0;
    Result = 0;
    for (var $l = 1, $end = s.length; $l <= $end; $l++) {
      i = $l;
      if (s.charAt(i - 1) === ch) {
        Res.set(i);
        Result = i;
        break;
      };
    };
    return Result;
  };
  this.CSVToLineFeeds = function (s) {
    var res = "";
    var i = 0;
    if ($mod.CharPos("\x0B",s.get()) === 0) return;
    res = "";
    for (var $l = 1, $end = s.get().length; $l <= $end; $l++) {
      i = $l;
      if (s.get().charAt(i - 1) === "\x0B") {
        res = res + "\r\n"}
       else res = res + s.get().charAt(i - 1);
    };
    s.set(res);
  };
  this.LineFeedsToCSV = function (s) {
    var vp = 0;
    vp = -1;
    while (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos("\r\n",s.get(),{get: function () {
        return vp;
      }, set: function (v) {
        vp = v;
      }}) > 0) {
      pas.System.Delete(s,vp,1);
      s.set(rtl.setCharAt(s.get(),vp - 1,"\x0B"));
    };
    s.set('"' + s.get() + '"');
  };
  this.LineFeedsToCSVNQ = function (s) {
    var vp = 0;
    vp = -1;
    while (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos("\r\n",s.get(),{get: function () {
        return vp;
      }, set: function (v) {
        vp = v;
      }}) > 0) pas.System.Delete(s,vp,1);
  };
  $mod.$implcode = function () {
    $impl.LINEFEED = "\r";
    $impl.IsNumber = function (ch) {
      var Result = false;
      Result = ch.charCodeAt() in rtl.createSet(null,0x30,0x39);
      return Result;
    };
    $impl.CheckNum = function (ch) {
      var Result = false;
      Result = $impl.IsNumber(ch);
      return Result;
    };
    $impl.CheckSignedNum = function (ch) {
      var Result = false;
      Result = $impl.IsNumber(ch) || (ch === "-");
      return Result;
    };
    $impl.CheckExpNum = function (ch) {
      var Result = false;
      Result = $impl.IsNumber(ch) || (ch === "e") || (ch === "E");
      return Result;
    };
    $impl.CheckFloatNum = function (ch) {
      var Result = false;
      Result = $impl.IsNumber(ch) || (ch === pas.SysUtils.FormatSettings.ThousandSeparator) || (ch === pas.SysUtils.FormatSettings.DecimalSeparator) || (ch === "e") || (ch === "E");
      return Result;
    };
    $impl.CheckSignedDottedNum = function (ch) {
      var Result = false;
      Result = $impl.IsNumber(ch) || (ch === ".") || (ch === "-") || (ch === "e") || (ch === "E") || (ch === "+");
      return Result;
    };
    $impl.CheckSignedFloatNum = function (ch) {
      var Result = false;
      Result = $impl.CheckFloatNum(ch) || (ch === "+") || (ch === "-");
      return Result;
    };
    $impl.IPos = function (su, s) {
      var Result = 0;
      Result = pas.System.Pos(pas.SysUtils.UpperCase(su),pas.SysUtils.UpperCase(s));
      return Result;
    };
    $impl.TagReplaceString = function (Srch, Repl, Dest) {
      var Result = false;
      var i = 0;
      i = $impl.IPos(Srch,Dest.get());
      if (i > 0) {
        Result = true;
        pas.System.Delete(Dest,i,Srch.length);
        Dest.set(pas.System.Copy(Dest.get(),1,i - 1) + Repl + pas.System.Copy(Dest.get(),i,Dest.get().length));
      } else Result = false;
      return Result;
    };
  };
},["WEBLib.TMSFNCUtils"]);
rtl.module("WEBLib.TMSFNCDataGridData",["System","Classes","SysUtils","WEBLib.TMSFNCTypes","WEBLib.TMSFNCDataBinding","WEBLib.TMSFNCCustomComponent","WEBLib.TMSFNCDataGridCore","WEBLib.TMSFNCDataGridCell","WEBLib.TMSFNCPersistence","WEBLib.TMSFNCJSONReader","WEBLib.TMSFNCJSONWriter","TMS.TMSFNCFilterBuilder","Generics.Collections","RTTI","Generics.Defaults","Types","WEBLib.JSON"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.$rtti.$Class("TTMSFNCDataGridData");
  rtl.createClass(this,"TTMSFNCDataGridDataDictionary",pas["Generics.Collections"].TObjectDictionary$$$G$$generics$collections$$Longint$$TTMSFNCDataGridRowItem,function () {
  });
  this.$rtti.$Class("TTMSFNCDataGridDataGroupDictionary");
  rtl.createClass(this,"TTMSFNCDataGridDataGroup",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FRow = 0;
      this.FSummaryRow = 0;
      this.FGroupDictionary = null;
    };
    this.$final = function () {
      this.FGroupDictionary = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.GetGroupDictionary = function () {
      var Result = null;
      if (!(this.FGroupDictionary != null)) this.FGroupDictionary = $mod.TTMSFNCDataGridDataGroupDictionary.$create("Create$5",[rtl.createSet(pas["Generics.Collections"].TDictionaryOwnership.doOwnsValues)]);
      Result = this.FGroupDictionary;
      return Result;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FGroupDictionary;
        }, set: function (v) {
          this.p.FGroupDictionary = v;
        }});
      pas.System.TObject.Destroy.call(this);
    };
    var $r = this.$rtti;
    $r.addProperty("GroupDictionary",1,$mod.$rtti["TTMSFNCDataGridDataGroupDictionary"],"GetGroupDictionary","");
    $r.addProperty("Row",0,rtl.longint,"FRow","FRow");
    $r.addProperty("SummaryRow",0,rtl.longint,"FSummaryRow","FSummaryRow");
  });
  this.TTMSFNCDataGridDataFormattingType = {"0": "gdftDefault", gdftDefault: 0, "1": "gdftBoolean", gdftBoolean: 1, "2": "gdftDateTime", gdftDateTime: 2, "3": "gdftDate", gdftDate: 3, "4": "gdftTime", gdftTime: 4, "5": "gdftFloat", gdftFloat: 5, "6": "gdftNumber", gdftNumber: 6};
  this.$rtti.$Enum("TTMSFNCDataGridDataFormattingType",{minvalue: 0, maxvalue: 6, ordtype: 1, enumtype: this.TTMSFNCDataGridDataFormattingType});
  rtl.recNewT(this,"TTMSFNCDataGridDataFormatting",function () {
    this.Format = "";
    this.Type = 0;
    this.BooleanTrueText = "";
    this.BooleanFalseText = "";
    this.$eq = function (b) {
      return (this.Format === b.Format) && (this.Type === b.Type) && (this.BooleanTrueText === b.BooleanTrueText) && (this.BooleanFalseText === b.BooleanFalseText);
    };
    this.$assign = function (s) {
      this.Format = s.Format;
      this.Type = s.Type;
      this.BooleanTrueText = s.BooleanTrueText;
      this.BooleanFalseText = s.BooleanFalseText;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCDataGridDataFormatting",{},this);
    $r.addField("Format",rtl.string);
    $r.addField("Type",$mod.$rtti["TTMSFNCDataGridDataFormattingType"]);
    $r.addField("BooleanTrueText",rtl.string);
    $r.addField("BooleanFalseText",rtl.string);
  });
  rtl.createClass(this,"TTMSFNCDataGridDataGroupDictionary",pas["Generics.Collections"].TObjectDictionary$$$G$$generics$collections$$String$$TTMSFNCDataGridDataGroup,function () {
  });
  rtl.recNewT(this,"TTMSFNCDataGridDataSortOptions",function () {
    this.CaseSensitive = false;
    this.Direction = 0;
    this.Format = 0;
    this.$new = function () {
      var r = Object.create(this);
      r.FormatSettings = pas.SysUtils.TFormatSettings.$new();
      return r;
    };
    this.$eq = function (b) {
      return (this.CaseSensitive === b.CaseSensitive) && (this.Direction === b.Direction) && (this.Format === b.Format) && this.FormatSettings.$eq(b.FormatSettings);
    };
    this.$assign = function (s) {
      this.CaseSensitive = s.CaseSensitive;
      this.Direction = s.Direction;
      this.Format = s.Format;
      this.FormatSettings.$assign(s.FormatSettings);
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCDataGridDataSortOptions",{},this);
    $r.addField("CaseSensitive",rtl.boolean);
    $r.addField("Direction",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridSortDirection"]);
    $r.addField("Format",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridSortFormat"]);
    $r.addField("FormatSettings",pas.SysUtils.$rtti["TFormatSettings"]);
  });
  rtl.recNewT(this,"TTMSFNCDataGridDataGroupOptions",function () {
    this.AutoSort = false;
    this.HeaderHeight = 0.0;
    this.HideColumns = false;
    this.MergeDelimiter = "";
    this.MergeHeader = false;
    this.MergeSummary = false;
    this.Summary = false;
    this.SummaryHeight = 0.0;
    this.SummaryInHeader = false;
    this.UseFirstRowAsHeader = false;
    this.$eq = function (b) {
      return (this.AutoSort === b.AutoSort) && (this.HeaderHeight === b.HeaderHeight) && (this.HideColumns === b.HideColumns) && (this.MergeDelimiter === b.MergeDelimiter) && (this.MergeHeader === b.MergeHeader) && (this.MergeSummary === b.MergeSummary) && (this.Summary === b.Summary) && (this.SummaryHeight === b.SummaryHeight) && (this.SummaryInHeader === b.SummaryInHeader) && (this.UseFirstRowAsHeader === b.UseFirstRowAsHeader);
    };
    this.$assign = function (s) {
      this.AutoSort = s.AutoSort;
      this.HeaderHeight = s.HeaderHeight;
      this.HideColumns = s.HideColumns;
      this.MergeDelimiter = s.MergeDelimiter;
      this.MergeHeader = s.MergeHeader;
      this.MergeSummary = s.MergeSummary;
      this.Summary = s.Summary;
      this.SummaryHeight = s.SummaryHeight;
      this.SummaryInHeader = s.SummaryInHeader;
      this.UseFirstRowAsHeader = s.UseFirstRowAsHeader;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCDataGridDataGroupOptions",{},this);
    $r.addField("AutoSort",rtl.boolean);
    $r.addField("HeaderHeight",rtl.double);
    $r.addField("HideColumns",rtl.boolean);
    $r.addField("MergeDelimiter",rtl.string);
    $r.addField("MergeHeader",rtl.boolean);
    $r.addField("MergeSummary",rtl.boolean);
    $r.addField("Summary",rtl.boolean);
    $r.addField("SummaryHeight",rtl.double);
    $r.addField("SummaryInHeader",rtl.boolean);
    $r.addField("UseFirstRowAsHeader",rtl.boolean);
  });
  this.TTMSFNCDataGridDataCalculationFormatType = {"0": "gcfNumber", gcfNumber: 0, "1": "gcfFloat", gcfFloat: 1};
  this.$rtti.$Enum("TTMSFNCDataGridDataCalculationFormatType",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCDataGridDataCalculationFormatType});
  rtl.recNewT(this,"TTMSFNCDataGridDataColumnCalculationOptions",function () {
    this.CalculationFormatType = 0;
    this.CalculationFormat = "";
    this.MergeSummary = false;
    this.SummaryInHeader = false;
    this.$eq = function (b) {
      return (this.CalculationFormatType === b.CalculationFormatType) && (this.CalculationFormat === b.CalculationFormat) && (this.MergeSummary === b.MergeSummary) && (this.SummaryInHeader === b.SummaryInHeader);
    };
    this.$assign = function (s) {
      this.CalculationFormatType = s.CalculationFormatType;
      this.CalculationFormat = s.CalculationFormat;
      this.MergeSummary = s.MergeSummary;
      this.SummaryInHeader = s.SummaryInHeader;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCDataGridDataColumnCalculationOptions",{},this);
    $r.addField("CalculationFormatType",$mod.$rtti["TTMSFNCDataGridDataCalculationFormatType"]);
    $r.addField("CalculationFormat",rtl.string);
    $r.addField("MergeSummary",rtl.boolean);
    $r.addField("SummaryInHeader",rtl.boolean);
  });
  rtl.recNewT(this,"TTMSFNCDataGridDataRowCalculationOptions",function () {
    this.CalculationFormatType = 0;
    this.CalculationFormat = "";
    this.$eq = function (b) {
      return (this.CalculationFormatType === b.CalculationFormatType) && (this.CalculationFormat === b.CalculationFormat);
    };
    this.$assign = function (s) {
      this.CalculationFormatType = s.CalculationFormatType;
      this.CalculationFormat = s.CalculationFormat;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCDataGridDataRowCalculationOptions",{},this);
    $r.addField("CalculationFormatType",$mod.$rtti["TTMSFNCDataGridDataCalculationFormatType"]);
    $r.addField("CalculationFormat",rtl.string);
  });
  rtl.recNewT(this,"TTMSFNCDataGridDataInputOutputOptions",function () {
    this.AlwaysQuotes = false;
    this.Delimiter = "\x00";
    this.MaxRows = 0;
    this.QuoteEmptyCells = false;
    this.StartColumn = 0;
    this.StartRow = 0;
    this.TrimSpaces = false;
    this.$eq = function (b) {
      return (this.AlwaysQuotes === b.AlwaysQuotes) && (this.Delimiter === b.Delimiter) && (this.MaxRows === b.MaxRows) && (this.QuoteEmptyCells === b.QuoteEmptyCells) && (this.StartColumn === b.StartColumn) && (this.StartRow === b.StartRow) && (this.TrimSpaces === b.TrimSpaces);
    };
    this.$assign = function (s) {
      this.AlwaysQuotes = s.AlwaysQuotes;
      this.Delimiter = s.Delimiter;
      this.MaxRows = s.MaxRows;
      this.QuoteEmptyCells = s.QuoteEmptyCells;
      this.StartColumn = s.StartColumn;
      this.StartRow = s.StartRow;
      this.TrimSpaces = s.TrimSpaces;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCDataGridDataInputOutputOptions",{},this);
    $r.addField("AlwaysQuotes",rtl.boolean);
    $r.addField("Delimiter",rtl.char);
    $r.addField("MaxRows",rtl.longint);
    $r.addField("QuoteEmptyCells",rtl.boolean);
    $r.addField("StartColumn",rtl.longint);
    $r.addField("StartRow",rtl.longint);
    $r.addField("TrimSpaces",rtl.boolean);
  });
  this.$rtti.$RefToProcVar("TTMSFNCDataGridDataCustomColumnCalculationCallback",{procsig: rtl.newTIProcSig([["AColumn",rtl.longint],["ALevel",rtl.longint],["AFromRow",rtl.longint],["AToRow",rtl.longint]],rtl.double)});
  this.$rtti.$MethodVar("TTMSFNCDataGridDataCustomColumnCalculationEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["ALevel",rtl.longint],["AFromRow",rtl.longint],["AToRow",rtl.longint]],rtl.double), methodkind: 1});
  this.$rtti.$RefToProcVar("TTMSFNCDataGridDataCustomCompareCallback",{procsig: rtl.newTIProcSig([["AColumn",rtl.longint],["ARow1",rtl.longint],["ARow2",rtl.longint],["AData1",rtl.jsvalue],["AData2",rtl.jsvalue],["ALevel",rtl.longint],["AHandled",rtl.boolean,1]],rtl.longint)});
  this.$rtti.$MethodVar("TTMSFNCDataGridDataCustomCompareEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["ARow1",rtl.longint],["ARow2",rtl.longint],["AData1",rtl.jsvalue],["AData2",rtl.jsvalue],["ALevel",rtl.longint]],rtl.longint), methodkind: 1});
  this.$rtti.$RefToProcVar("TTMSFNCDataGridDataCustomRowCalculationCallback",{procsig: rtl.newTIProcSig([["ARow",rtl.longint],["AFromColumn",rtl.longint],["AToColumn",rtl.longint]],rtl.double)});
  this.$rtti.$MethodVar("TTMSFNCDataGridDataCustomRowCalculationEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ARow",rtl.longint],["AFromColumn",rtl.longint],["AToColumn",rtl.longint]],rtl.double), methodkind: 1});
  this.$rtti.$MethodVar("TTMSFNCDataGridDataGetCellDataEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["AData",rtl.jsvalue,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridDataGetCellDataPropertiesEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["ACellItem",pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCellItem"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridDataGetCellDisplayValueEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["AData",rtl.jsvalue],["AValue",rtl.string,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridDataGetCellFormattingEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["AData",rtl.jsvalue],["AFormatting",this.$rtti["TTMSFNCDataGridDataFormatting"],1],["AConvertSettings",pas.SysUtils.$rtti["TFormatSettings"],1],["ACanFormat",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$RefToProcVar("TTMSFNCDataGridDataGetColumnCalculationOptionsCallback",{procsig: rtl.newTIProcSig([["AColumn",rtl.longint],["ALevel",rtl.longint],["AOptions",this.$rtti["TTMSFNCDataGridDataColumnCalculationOptions"],1]])});
  this.$rtti.$MethodVar("TTMSFNCDataGridDataGetColumnCalculationOptionsEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["ALevel",rtl.longint],["AOptions",this.$rtti["TTMSFNCDataGridDataColumnCalculationOptions"],1]]), methodkind: 0});
  this.$rtti.$RefToProcVar("TTMSFNCDataGridDataGetCustomGroupCallback",{procsig: rtl.newTIProcSig([["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["AData",rtl.jsvalue],["ALevel",rtl.longint],["AGroup",rtl.string,1]])});
  this.$rtti.$MethodVar("TTMSFNCDataGridDataGetCustomGroupEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["AData",rtl.jsvalue],["ALevel",rtl.longint],["AGroup",rtl.string,1]]), methodkind: 0});
  this.$rtti.$RefToProcVar("TTMSFNCDataGridDataGetGroupOptionsCallback",{procsig: rtl.newTIProcSig([["AColumns",pas.System.$rtti["TArray<System.Longint>"]],["ALevel",rtl.longint],["AOptions",this.$rtti["TTMSFNCDataGridDataGroupOptions"],1]])});
  this.$rtti.$MethodVar("TTMSFNCDataGridDataGetGroupOptionsEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumns",pas.System.$rtti["TArray<System.Longint>"]],["ALevel",rtl.longint],["AOptions",this.$rtti["TTMSFNCDataGridDataGroupOptions"],1]]), methodkind: 0});
  this.$rtti.$RefToProcVar("TTMSFNCDataGridDataGetRowCalculationOptionsCallback",{procsig: rtl.newTIProcSig([["ARow",rtl.longint],["AOptions",this.$rtti["TTMSFNCDataGridDataRowCalculationOptions"],1]])});
  this.$rtti.$MethodVar("TTMSFNCDataGridDataGetRowCalculationOptionsEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ARow",rtl.longint],["AOptions",this.$rtti["TTMSFNCDataGridDataRowCalculationOptions"],1]]), methodkind: 0});
  this.$rtti.$RefToProcVar("TTMSFNCDataGridDataGetSortOptionsCallback",{procsig: rtl.newTIProcSig([["AColumn",rtl.longint],["ALevel",rtl.longint],["AOptions",this.$rtti["TTMSFNCDataGridDataSortOptions"],1]])});
  this.$rtti.$MethodVar("TTMSFNCDataGridDataGetSortOptionsEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["ALevel",rtl.longint],["AOptions",this.$rtti["TTMSFNCDataGridDataSortOptions"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridDataRowCollapseEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ARow",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridDataRowExpandEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ARow",rtl.longint]]), methodkind: 0});
  this.TTMSFNCDataGridDataSwapDirection = {"0": "gswdBoth", gswdBoth: 0, "1": "gswdFromOnly", gswdFromOnly: 1, "2": "gswdToOnly", gswdToOnly: 2};
  this.$rtti.$Enum("TTMSFNCDataGridDataSwapDirection",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCDataGridDataSwapDirection});
  this.TTMSFNCDataGridDataCellMergeType = {"0": "gcmtInvalid", gcmtInvalid: 0, "1": "gcmtNormal", gcmtNormal: 1, "2": "gcmtFixed", gcmtFixed: 2, "3": "gcmtFreeze", gcmtFreeze: 3, "4": "gcmtFixedRoot", gcmtFixedRoot: 4, "5": "gcmtFreezeRoot", gcmtFreezeRoot: 5};
  this.$rtti.$Enum("TTMSFNCDataGridDataCellMergeType",{minvalue: 0, maxvalue: 5, ordtype: 1, enumtype: this.TTMSFNCDataGridDataCellMergeType});
  rtl.createClass(this,"TTMSFNCDataGridDataFileStringList",pas.Classes.TStringList,function () {
    this.$init = function () {
      pas.Classes.TStringList.$init.call(this);
      this.fp = 0;
      this.cache = "";
    };
    this.GetEOF = function () {
      var Result = false;
      Result = this.fp >= this.GetCount();
      return Result;
    };
    this.Reset = function () {
      this.fp = 0;
      this.cache = "";
    };
    this.ReadLn = function (s) {
      s.set(this.Get(this.fp));
      this.fp += 1;
    };
    this.Write = function (s) {
      this.cache = this.cache + s;
    };
    this.WriteLn = function (s) {
      this.Add(this.cache + s);
      this.cache = "";
    };
  });
  this.TTMSFNCDataGridDataCalculationMethod = {"0": "gcmSum", gcmSum: 0, "1": "gcmAverage", gcmAverage: 1, "2": "gcmMin", gcmMin: 2, "3": "gcmMax", gcmMax: 3, "4": "gcmCount", gcmCount: 4, "5": "gcmCustom", gcmCustom: 5, "6": "gcmDistinct", gcmDistinct: 6, "7": "gcmStandardDeviation", gcmStandardDeviation: 7};
  this.$rtti.$Enum("TTMSFNCDataGridDataCalculationMethod",{minvalue: 0, maxvalue: 7, ordtype: 1, enumtype: this.TTMSFNCDataGridDataCalculationMethod});
  this.TTMSFNCDataGridDataColumnCalculationType = {"0": "gctNormal", gctNormal: 0, "1": "gctGroup", gctGroup: 1};
  this.$rtti.$Enum("TTMSFNCDataGridDataColumnCalculationType",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCDataGridDataColumnCalculationType});
  rtl.recNewT(this,"TTMSFNCDataGridDataColumnCalculation",function () {
    this.Type = 0;
    this.Method = 0;
    this.OptionsCallback = null;
    this.CustomCalculationCallback = null;
    this.FromRow = 0;
    this.ToRow = 0;
    this.OutputRow = 0;
    this.$eq = function (b) {
      return (this.Type === b.Type) && (this.Method === b.Method) && rtl.eqCallback(this.OptionsCallback,b.OptionsCallback) && rtl.eqCallback(this.CustomCalculationCallback,b.CustomCalculationCallback) && (this.FromRow === b.FromRow) && (this.ToRow === b.ToRow) && (this.OutputRow === b.OutputRow);
    };
    this.$assign = function (s) {
      this.Type = s.Type;
      this.Method = s.Method;
      this.OptionsCallback = s.OptionsCallback;
      this.CustomCalculationCallback = s.CustomCalculationCallback;
      this.FromRow = s.FromRow;
      this.ToRow = s.ToRow;
      this.OutputRow = s.OutputRow;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCDataGridDataColumnCalculation",{},this);
    $r.addField("Type",$mod.$rtti["TTMSFNCDataGridDataColumnCalculationType"]);
    $r.addField("Method",$mod.$rtti["TTMSFNCDataGridDataCalculationMethod"]);
    $r.addField("OptionsCallback",$mod.$rtti["TTMSFNCDataGridDataGetColumnCalculationOptionsCallback"]);
    $r.addField("CustomCalculationCallback",$mod.$rtti["TTMSFNCDataGridDataCustomColumnCalculationCallback"]);
    $r.addField("FromRow",rtl.longint);
    $r.addField("ToRow",rtl.longint);
    $r.addField("OutputRow",rtl.longint);
  });
  rtl.recNewT(this,"TTMSFNCDataGridDataRowCalculation",function () {
    this.Method = 0;
    this.OptionsCallback = null;
    this.CustomCalculationCallback = null;
    this.FromColumn = 0;
    this.ToColumn = 0;
    this.OutputColumn = 0;
    this.$eq = function (b) {
      return (this.Method === b.Method) && rtl.eqCallback(this.OptionsCallback,b.OptionsCallback) && rtl.eqCallback(this.CustomCalculationCallback,b.CustomCalculationCallback) && (this.FromColumn === b.FromColumn) && (this.ToColumn === b.ToColumn) && (this.OutputColumn === b.OutputColumn);
    };
    this.$assign = function (s) {
      this.Method = s.Method;
      this.OptionsCallback = s.OptionsCallback;
      this.CustomCalculationCallback = s.CustomCalculationCallback;
      this.FromColumn = s.FromColumn;
      this.ToColumn = s.ToColumn;
      this.OutputColumn = s.OutputColumn;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCDataGridDataRowCalculation",{},this);
    $r.addField("Method",$mod.$rtti["TTMSFNCDataGridDataCalculationMethod"]);
    $r.addField("OptionsCallback",$mod.$rtti["TTMSFNCDataGridDataGetRowCalculationOptionsCallback"]);
    $r.addField("CustomCalculationCallback",$mod.$rtti["TTMSFNCDataGridDataCustomRowCalculationCallback"]);
    $r.addField("FromColumn",rtl.longint);
    $r.addField("ToColumn",rtl.longint);
    $r.addField("OutputColumn",rtl.longint);
  });
  this.$rtti.$MethodVar("TTMSFNCDataGridDataAfterSetColumnCalculationEvent",{procsig: rtl.newTIProcSig([["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["AColumnCalculation",this.$rtti["TTMSFNCDataGridDataColumnCalculation"]],["AName",rtl.string],["AValue",rtl.string,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridDataAfterSetRowCalculationEvent",{procsig: rtl.newTIProcSig([["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["ARowCalculation",this.$rtti["TTMSFNCDataGridDataRowCalculation"]],["AName",rtl.string],["AValue",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridDataBeforeSetColumnCalculationEvent",{procsig: rtl.newTIProcSig([["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["AColumnCalculation",this.$rtti["TTMSFNCDataGridDataColumnCalculation"]],["AName",rtl.string],["AValue",rtl.string,1],["ACanSet",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridDataBeforeSetRowCalculationEvent",{procsig: rtl.newTIProcSig([["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["ARowCalculation",this.$rtti["TTMSFNCDataGridDataRowCalculation"]],["AName",rtl.string],["AValue",rtl.string],["ACanSet",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$DynArray("TTMSFNCDataGridDataColumnCalculationArray",{eltype: this.$rtti["TTMSFNCDataGridDataColumnCalculation"]});
  rtl.createClass(this,"TTMSFNCDataGridDataColumnCalculationDictionary",pas["Generics.Collections"].TObjectDictionary$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$,function () {
  });
  this.$rtti.$DynArray("TTMSFNCDataGridDataRowCalculationArray",{eltype: this.$rtti["TTMSFNCDataGridDataRowCalculation"]});
  rtl.createClass(this,"TTMSFNCDataGridDataRowCalculationDictionary",pas["Generics.Collections"].TObjectDictionary$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$,function () {
  });
  rtl.recNewT(this,"TTMSFNCDataGridDataSortCellInfo",function () {
    this.Data = undefined;
    this.Column = 0;
    this.$new = function () {
      var r = Object.create(this);
      r.Options = $mod.TTMSFNCDataGridDataSortOptions.$new();
      return r;
    };
    this.$eq = function (b) {
      return (this.Data === b.Data) && (this.Column === b.Column) && this.Options.$eq(b.Options);
    };
    this.$assign = function (s) {
      this.Data = s.Data;
      this.Column = s.Column;
      this.Options.$assign(s.Options);
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCDataGridDataSortCellInfo",{},this);
    $r.addField("Data",rtl.jsvalue);
    $r.addField("Column",rtl.longint);
    $r.addField("Options",$mod.$rtti["TTMSFNCDataGridDataSortOptions"]);
  });
  rtl.recNewT(this,"TTMSFNCDataGridDataSortInfo",function () {
    this.Row = 0;
    this.$new = function () {
      var r = Object.create(this);
      r.Data = [];
      return r;
    };
    this.$eq = function (b) {
      return (this.Row === b.Row) && (this.Data === b.Data);
    };
    this.$assign = function (s) {
      this.Row = s.Row;
      this.Data = rtl.arrayRef(s.Data);
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCDataGridDataSortInfo",{},this);
    $r.addField("Row",rtl.longint);
    $r.addField("Data",pas.System.$rtti["TArray<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataSortCellInfo>"]);
  });
  rtl.recNewT(this,"TTMSFNCDataGridDataGroupInfo",function () {
    this.$new = function () {
      var r = Object.create(this);
      r.Columns = [];
      r.SubColumns = [];
      r.SortColumns = [];
      r.SortDirections = [];
      return r;
    };
    this.$eq = function (b) {
      return (this.Columns === b.Columns) && (this.SubColumns === b.SubColumns) && (this.SortColumns === b.SortColumns) && (this.SortDirections === b.SortDirections);
    };
    this.$assign = function (s) {
      this.Columns = rtl.arrayRef(s.Columns);
      this.SubColumns = rtl.arrayRef(s.SubColumns);
      this.SortColumns = rtl.arrayRef(s.SortColumns);
      this.SortDirections = rtl.arrayRef(s.SortDirections);
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCDataGridDataGroupInfo",{},this);
    $r.addField("Columns",pas.System.$rtti["TArray<System.Longint>"]);
    $r.addField("SubColumns",pas.System.$rtti["TArray<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataGroupInfo>"]);
    $r.addField("SortColumns",pas.System.$rtti["TArray<System.Longint>"]);
    $r.addField("SortDirections",pas.System.$rtti["TArray<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridSortDirection>"]);
  });
  this.TTMSFNCDataGridDataFilterCells = {"0": "gfcNormal", gfcNormal: 0, "1": "gfcStripHTML", gfcStripHTML: 1, "2": "gfcRow", gfcRow: 2};
  this.$rtti.$Enum("TTMSFNCDataGridDataFilterCells",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCDataGridDataFilterCells});
  this.TTMSFNCDataGridDataFilterOperation = {"0": "gfoSHORT", gfoSHORT: 0, "1": "gfoNONE", gfoNONE: 1, "2": "gfoAND", gfoAND: 2, "3": "gfoXOR", gfoXOR: 3, "4": "gfoOR", gfoOR: 4};
  this.$rtti.$Enum("TTMSFNCDataGridDataFilterOperation",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TTMSFNCDataGridDataFilterOperation});
  this.TTMSFNCDataGridDataFilterMethod = {"0": "gfmExpression", gfmExpression: 0, "1": "gfmLiteral", gfmLiteral: 1};
  this.$rtti.$Enum("TTMSFNCDataGridDataFilterMethod",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCDataGridDataFilterMethod});
  this.TTMSFNCDataGridDataFilterType = {"0": "gftStartsWith", gftStartsWith: 0, "1": "gftEndsWith", gftEndsWith: 1, "2": "gftContains", gftContains: 2, "3": "gftNotContains", gftNotContains: 3, "4": "gftEqual", gftEqual: 4, "5": "gftNotEqual", gftNotEqual: 5, "6": "gftEmpty", gftEmpty: 6, "7": "gftNotEmpty", gftNotEmpty: 7, "8": "gftLargerThan", gftLargerThan: 8, "9": "gftSmallerThan", gftSmallerThan: 9, "10": "gftLargerOrEqualThan", gftLargerOrEqualThan: 10, "11": "gftSmallerOrEqualThan", gftSmallerOrEqualThan: 11};
  this.$rtti.$Enum("TTMSFNCDataGridDataFilterType",{minvalue: 0, maxvalue: 11, ordtype: 1, enumtype: this.TTMSFNCDataGridDataFilterType});
  this.$rtti.$Enum("TTMSFNCDataGridDataFilterTextType",{minvalue: 0, maxvalue: 7, ordtype: 1, enumtype: this.TTMSFNCDataGridDataFilterType});
  this.$rtti.$Enum("TTMSFNCDataGridDataFilterNumberType",{minvalue: 4, maxvalue: 11, ordtype: 1, enumtype: this.TTMSFNCDataGridDataFilterType});
  this.TTMSFNCDataGridDataSearchType = {"0": "gstStartsWith", gstStartsWith: 0, "1": "gstEndsWith", gstEndsWith: 1, "2": "gstContains", gstContains: 2, "3": "gstEqual", gstEqual: 3, "4": "gstNotEqual", gstNotEqual: 4, "5": "gstNotContains", gstNotContains: 5};
  this.$rtti.$Enum("TTMSFNCDataGridDataSearchType",{minvalue: 0, maxvalue: 5, ordtype: 1, enumtype: this.TTMSFNCDataGridDataSearchType});
  this.$rtti.$DynArray("TTMSFNCDataGridDataStringArray",{eltype: rtl.string});
  rtl.createClass(this,"TTMSFNCDataGridDataFilterData",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FCaseSensitive = false;
      this.FColumn = 0;
      this.FCondition = "";
      this.FData = 0;
      this.FDataBoolean = false;
      this.FDataInteger = 0;
      this.FDataObject = null;
      this.FDataPointer = null;
      this.FDataString = "";
      this.FEnabled = false;
      this.FMethod = 0;
      this.FOperation = 0;
      this.FPrefix = "";
      this.FSuffix = "";
      this.FType = 0;
    };
    this.$final = function () {
      this.FDataObject = undefined;
      pas.Classes.TCollectionItem.$final.call(this);
    };
    this.GetFilterCondition = function () {
      var Result = "";
      var s = "";
      s = this.FCondition;
      if (pas.System.Pos('"',s) > 0) {
        Result = s}
       else {
        var $tmp = this.FType;
        if ($tmp === $mod.TTMSFNCDataGridDataFilterType.gftEqual) {
          Result = s}
         else if ($tmp === $mod.TTMSFNCDataGridDataFilterType.gftEmpty) {
          Result = ""}
         else if ($tmp === $mod.TTMSFNCDataGridDataFilterType.gftNotEmpty) {
          Result = "!"}
         else if ($tmp === $mod.TTMSFNCDataGridDataFilterType.gftStartsWith) {
          Result = s + "*"}
         else if ($tmp === $mod.TTMSFNCDataGridDataFilterType.gftEndsWith) {
          Result = "*" + s}
         else if ($tmp === $mod.TTMSFNCDataGridDataFilterType.gftContains) {
          Result = "*" + s + "*"}
         else if ($tmp === $mod.TTMSFNCDataGridDataFilterType.gftNotContains) {
          Result = "!*" + s + "*"}
         else if ($tmp === $mod.TTMSFNCDataGridDataFilterType.gftNotEqual) {
          Result = "!" + s}
         else if ($tmp === $mod.TTMSFNCDataGridDataFilterType.gftLargerThan) {
          Result = ">" + s}
         else if ($tmp === $mod.TTMSFNCDataGridDataFilterType.gftSmallerThan) {
          Result = "<" + s}
         else if ($tmp === $mod.TTMSFNCDataGridDataFilterType.gftLargerOrEqualThan) {
          Result = ">=" + s}
         else if ($tmp === $mod.TTMSFNCDataGridDataFilterType.gftSmallerOrEqualThan) Result = "<=" + s;
      };
      return Result;
    };
    this.SetFilterCondition = function (Value) {
      var c = "";
      var t = 0;
      c = "";
      t = $mod.TTMSFNCDataGridDataFilterType.gftEqual;
      $mod.StripFilterCondition(Value,{get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }},{get: function () {
          return t;
        }, set: function (v) {
          t = v;
        }});
      this.SetCondition(c);
      this.SetType(t);
    };
    this.GetDataReference = function () {
      var Result = null;
      var o = null;
      Result = null;
      if ((this.FCollection != null) && $mod.TTMSFNCDataGridDataFilter.isPrototypeOf(this.FCollection)) {
        o = rtl.as(this.FCollection,$mod.TTMSFNCDataGridDataFilter).Owner();
        if ((o != null) && $mod.TTMSFNCDataGridData.isPrototypeOf(o)) Result = rtl.as(o,$mod.TTMSFNCDataGridData);
      };
      return Result;
    };
    this.SetCaseSensitive = function (Value) {
      if (this.FCaseSensitive !== Value) {
        this.FCaseSensitive = Value;
        this.UpdateFilter();
      };
    };
    this.SetColumn = function (Value) {
      if (this.FColumn !== Value) {
        this.FColumn = Value;
        this.UpdateFilter();
      };
    };
    this.SetCondition = function (Value) {
      if (this.FCondition !== Value) {
        this.FCondition = Value;
        this.UpdateFilter();
      };
    };
    this.SetData = function (Value) {
      if (this.FData !== Value) {
        this.FData = Value;
        this.UpdateFilter();
      };
    };
    this.SetEnabled = function (Value) {
      if (this.FEnabled !== Value) {
        this.FEnabled = Value;
        this.UpdateFilter();
      };
    };
    this.SetMethod = function (Value) {
      if (this.FMethod !== Value) {
        this.FMethod = Value;
        this.UpdateFilter();
      };
    };
    this.SetOperation = function (Value) {
      if (this.FOperation !== Value) {
        this.FOperation = Value;
        this.UpdateFilter();
      };
    };
    this.SetPrefix = function (Value) {
      if (this.FPrefix !== Value) {
        this.FPrefix = Value;
        this.UpdateFilter();
      };
    };
    this.SetSuffix = function (Value) {
      if (this.FSuffix !== Value) {
        this.FSuffix = Value;
        this.UpdateFilter();
      };
    };
    this.SetType = function (Value) {
      if (this.FType !== Value) {
        this.FType = Value;
        this.UpdateFilter();
      };
    };
    this.IsConditionStored = function () {
      var Result = false;
      Result = this.FCondition !== "";
      return Result;
    };
    this.IsPrefixStored = function () {
      var Result = false;
      Result = this.FPrefix !== "";
      return Result;
    };
    this.IsSuffixStored = function () {
      var Result = false;
      Result = this.FSuffix !== "";
      return Result;
    };
    this.UpdateFilter = function () {
      if ((this.FCollection != null) && $mod.TTMSFNCDataGridDataFilter.isPrototypeOf(this.FCollection)) rtl.as(this.FCollection,$mod.TTMSFNCDataGridDataFilter).UpdateFilter();
    };
    this.Create$1 = function (ACollection) {
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      this.FCaseSensitive = false;
      this.FMethod = $mod.TTMSFNCDataGridDataFilterMethod.gfmExpression;
      this.FData = $mod.TTMSFNCDataGridDataFilterCells.gfcNormal;
      this.FType = $mod.TTMSFNCDataGridDataFilterType.gftEqual;
      this.FEnabled = true;
      this.FColumn = 0;
      this.FOperation = $mod.TTMSFNCDataGridDataFilterOperation.gfoNONE;
      this.FPrefix = "";
      this.FSuffix = "";
      return this;
    };
    this.Destroy = function () {
      var c = null;
      c = this.FCollection;
      pas.Classes.TCollectionItem.Destroy.call(this);
      if ((c != null) && $mod.TTMSFNCDataGridDataFilter.isPrototypeOf(c)) rtl.as(c,$mod.TTMSFNCDataGridDataFilter).UpdateFilter();
    };
    this.And = function (AColumn, ACondition, ACaseSensitive) {
      var Result = null;
      Result = null;
      if ($mod.TTMSFNCDataGridDataFilter.isPrototypeOf(this.FCollection)) Result = rtl.as(this.FCollection,$mod.TTMSFNCDataGridDataFilter).Add$1(AColumn,ACondition,$mod.TTMSFNCDataGridDataFilterOperation.gfoAND,ACaseSensitive);
      return Result;
    };
    this.And$1 = function (AColumn, AType, AValue, ACaseSensitive) {
      var Result = null;
      Result = null;
      if ($mod.TTMSFNCDataGridDataFilter.isPrototypeOf(this.FCollection)) Result = rtl.as(this.FCollection,$mod.TTMSFNCDataGridDataFilter).Add$2(AColumn,AType,AValue,$mod.TTMSFNCDataGridDataFilterOperation.gfoAND,ACaseSensitive);
      return Result;
    };
    this.Or = function (AColumn, ACondition, ACaseSensitive) {
      var Result = null;
      Result = null;
      if ($mod.TTMSFNCDataGridDataFilter.isPrototypeOf(this.FCollection)) Result = rtl.as(this.FCollection,$mod.TTMSFNCDataGridDataFilter).Add$1(AColumn,ACondition,$mod.TTMSFNCDataGridDataFilterOperation.gfoOR,ACaseSensitive);
      return Result;
    };
    this.Or$1 = function (AColumn, AType, AValue, ACaseSensitive) {
      var Result = null;
      Result = null;
      if ($mod.TTMSFNCDataGridDataFilter.isPrototypeOf(this.FCollection)) Result = rtl.as(this.FCollection,$mod.TTMSFNCDataGridDataFilter).Add$2(AColumn,AType,AValue,$mod.TTMSFNCDataGridDataFilterOperation.gfoOR,ACaseSensitive);
      return Result;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridDataFilterData.isPrototypeOf(Source)) {
        this.FCaseSensitive = rtl.as(Source,$mod.TTMSFNCDataGridDataFilterData).FCaseSensitive;
        this.FColumn = rtl.as(Source,$mod.TTMSFNCDataGridDataFilterData).FColumn;
        this.FCondition = rtl.as(Source,$mod.TTMSFNCDataGridDataFilterData).FCondition;
        this.FType = rtl.as(Source,$mod.TTMSFNCDataGridDataFilterData).FType;
        this.FData = rtl.as(Source,$mod.TTMSFNCDataGridDataFilterData).FData;
        this.FEnabled = rtl.as(Source,$mod.TTMSFNCDataGridDataFilterData).FEnabled;
        this.FMethod = rtl.as(Source,$mod.TTMSFNCDataGridDataFilterData).FMethod;
        this.FOperation = rtl.as(Source,$mod.TTMSFNCDataGridDataFilterData).FOperation;
        this.FPrefix = rtl.as(Source,$mod.TTMSFNCDataGridDataFilterData).FPrefix;
        this.FSuffix = rtl.as(Source,$mod.TTMSFNCDataGridDataFilterData).FSuffix;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Type",2,$mod.$rtti["TTMSFNCDataGridDataFilterType"],"FType","SetType",4,{Default: $mod.TTMSFNCDataGridDataFilterType.gftEqual});
    $r.addProperty("CaseSensitive",2,rtl.boolean,"FCaseSensitive","SetCaseSensitive",4,{Default: false});
    $r.addProperty("Column",2,rtl.longint,"FColumn","SetColumn",4,{Default: 0});
    $r.addProperty("Condition",14,rtl.string,"FCondition","SetCondition",4,{stored: "IsConditionStored"});
    $r.addProperty("Data",2,$mod.$rtti["TTMSFNCDataGridDataFilterCells"],"FData","SetData",4,{Default: $mod.TTMSFNCDataGridDataFilterCells.gfcNormal});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Method",2,$mod.$rtti["TTMSFNCDataGridDataFilterMethod"],"FMethod","SetMethod",4,{Default: $mod.TTMSFNCDataGridDataFilterMethod.gfmExpression});
    $r.addProperty("Operation",2,$mod.$rtti["TTMSFNCDataGridDataFilterOperation"],"FOperation","SetOperation",4,{Default: $mod.TTMSFNCDataGridDataFilterOperation.gfoNONE});
    $r.addProperty("Prefix",14,rtl.string,"FPrefix","SetPrefix",4,{stored: "IsPrefixStored"});
    $r.addProperty("Suffix",14,rtl.string,"FSuffix","SetSuffix",4,{stored: "IsSuffixStored"});
  });
  rtl.createClass(this,"TTMSFNCDataGridDataFilterItem",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FDoubleQuotes = false;
    };
    this.Create$1 = function () {
      this.FDoubleQuotes = false;
      return this;
    };
  });
  rtl.createClass(this,"TTMSFNCDataGridDataFilterCommonItem",this.TTMSFNCDataGridDataFilterItem,function () {
    this.Create$1 = function () {
      $mod.TTMSFNCDataGridDataFilterItem.Create$1.call(this);
      this.FDoubleQuotes = false;
      return this;
    };
  });
  rtl.createClass(this,"TTMSFNCDataGridDataFilterUniqueItem",this.TTMSFNCDataGridDataFilterItem,function () {
    this.Create$1 = function () {
      $mod.TTMSFNCDataGridDataFilterItem.Create$1.call(this);
      this.FDoubleQuotes = false;
      return this;
    };
  });
  rtl.createClass(this,"TTMSFNCDataGridDataFilterCommonDoubleQuotedItem",this.TTMSFNCDataGridDataFilterItem,function () {
    this.Create$1 = function () {
      $mod.TTMSFNCDataGridDataFilterItem.Create$1.call(this);
      this.FDoubleQuotes = true;
      return this;
    };
  });
  rtl.createClass(this,"TTMSFNCDataGridDataFilterUniqueDoubleQuotedItem",this.TTMSFNCDataGridDataFilterItem,function () {
    this.Create$1 = function () {
      $mod.TTMSFNCDataGridDataFilterItem.Create$1.call(this);
      this.FDoubleQuotes = true;
      return this;
    };
  });
  rtl.createClass(this,"TTMSFNCDataGridDataFilter",pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$init.call(this);
      this.FCommonDoubleQuotedItem = null;
      this.FCommonItem = null;
      this.FUniqueDoubleQuotedItem = null;
      this.FUniqueItem = null;
      this.FOnUpdateFilter = null;
    };
    this.$final = function () {
      this.FCommonDoubleQuotedItem = undefined;
      this.FCommonItem = undefined;
      this.FUniqueDoubleQuotedItem = undefined;
      this.FUniqueItem = undefined;
      this.FOnUpdateFilter = undefined;
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$final.call(this);
    };
    this.GetColumnFilter = function (AColumn) {
      var Result = null;
      var i = 0;
      for (var $l = 1, $end = this.GetCount(); $l <= $end; $l++) {
        i = $l;
        if (this.GetItem$1(i - 1).FColumn === AColumn) {
          Result = this.GetItem$1(i - 1);
          return Result;
        };
      };
      Result = this.Add$3();
      Result.FColumn = AColumn;
      this.UpdateFilter();
      return Result;
    };
    this.GetCommonDoubleQuotedItem = function () {
      var Result = null;
      if (!(this.FCommonDoubleQuotedItem != null)) this.FCommonDoubleQuotedItem = $mod.TTMSFNCDataGridDataFilterCommonDoubleQuotedItem.$create("Create$1");
      Result = this.FCommonDoubleQuotedItem;
      return Result;
    };
    this.GetCommonItem = function () {
      var Result = null;
      if (!(this.FCommonItem != null)) this.FCommonItem = $mod.TTMSFNCDataGridDataFilterCommonItem.$create("Create$1");
      Result = this.FCommonItem;
      return Result;
    };
    this.GetFilterText = function () {
      var Result = "";
      var I = 0;
      var FilterItem = null;
      var DataRef = null;
      var ColumnName = "";
      var Condition = "";
      var OpStr = "";
      Result = "";
      DataRef = null;
      if (this.GetCount() > 0) DataRef = this.GetItem$1(0).GetDataReference();
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        FilterItem = this.GetItem$1(I);
        if (!FilterItem.FEnabled) continue;
        if (Result !== "") {
          var $tmp = FilterItem.FOperation;
          if ($tmp === $mod.TTMSFNCDataGridDataFilterOperation.gfoOR) {
            OpStr = " | "}
           else if ($tmp === $mod.TTMSFNCDataGridDataFilterOperation.gfoAND) {
            OpStr = " & "}
           else if ($tmp === $mod.TTMSFNCDataGridDataFilterOperation.gfoXOR) {
            OpStr = " ^ "}
           else {
            OpStr = " & ";
          };
          Result = Result + OpStr;
        };
        if (DataRef != null) {
          ColumnName = DataRef.GetColumnFilterName(FilterItem.FColumn);
          Result = Result + "[" + ColumnName + "] ";
        };
        var $tmp1 = FilterItem.FType;
        if ($tmp1 === $mod.TTMSFNCDataGridDataFilterType.gftEqual) {
          Result = Result + "= "}
         else if ($tmp1 === $mod.TTMSFNCDataGridDataFilterType.gftNotEqual) {
          Result = Result + "<> "}
         else if ($tmp1 === $mod.TTMSFNCDataGridDataFilterType.gftLargerThan) {
          Result = Result + "> "}
         else if ($tmp1 === $mod.TTMSFNCDataGridDataFilterType.gftSmallerThan) {
          Result = Result + "< "}
         else if ($tmp1 === $mod.TTMSFNCDataGridDataFilterType.gftLargerOrEqualThan) {
          Result = Result + ">= "}
         else if ($tmp1 === $mod.TTMSFNCDataGridDataFilterType.gftSmallerOrEqualThan) {
          Result = Result + "<= "}
         else if ($tmp1 === $mod.TTMSFNCDataGridDataFilterType.gftEmpty) {
          Result = Result + "= "}
         else if ($tmp1 === $mod.TTMSFNCDataGridDataFilterType.gftNotEmpty) {
          Result = Result + "<> "}
         else {
          Result = Result + "= ";
        };
        Condition = FilterItem.FCondition;
        if ((FilterItem.FType in rtl.createSet($mod.TTMSFNCDataGridDataFilterType.gftStartsWith,$mod.TTMSFNCDataGridDataFilterType.gftEndsWith,$mod.TTMSFNCDataGridDataFilterType.gftContains,$mod.TTMSFNCDataGridDataFilterType.gftNotContains)) || (pas.System.Pos("*",Condition) > 0) || (pas.SysUtils.Trim(Condition) !== "")) {
          if (pas.System.Pos('"',Condition) === 0) Condition = '"' + Condition + '"';
        };
        var $tmp2 = FilterItem.FType;
        if ($tmp2 === $mod.TTMSFNCDataGridDataFilterType.gftStartsWith) {
          Condition = '"' + FilterItem.FCondition + '*"'}
         else if ($tmp2 === $mod.TTMSFNCDataGridDataFilterType.gftEndsWith) {
          Condition = '"*' + FilterItem.FCondition + '"'}
         else if ($tmp2 === $mod.TTMSFNCDataGridDataFilterType.gftContains) {
          Condition = '"*' + FilterItem.FCondition + '*"'}
         else if ($tmp2 === $mod.TTMSFNCDataGridDataFilterType.gftNotContains) {
          Condition = '"!*' + FilterItem.FCondition + '*"'}
         else if ($tmp2 === $mod.TTMSFNCDataGridDataFilterType.gftEmpty) {
          Condition = '""'}
         else if ($tmp2 === $mod.TTMSFNCDataGridDataFilterType.gftNotEmpty) Condition = '""';
        Result = Result + Condition;
      };
      return Result;
    };
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.GetItem.call(this,Index);
      return Result;
    };
    this.GetUniqueDoubleQuotedItem = function () {
      var Result = null;
      if (!(this.FUniqueDoubleQuotedItem != null)) this.FUniqueDoubleQuotedItem = $mod.TTMSFNCDataGridDataFilterUniqueDoubleQuotedItem.$create("Create$1");
      Result = this.FUniqueDoubleQuotedItem;
      return Result;
    };
    this.GetUniqueItem = function () {
      var Result = null;
      if (!(this.FUniqueItem != null)) this.FUniqueItem = $mod.TTMSFNCDataGridDataFilterUniqueItem.$create("Create$1");
      Result = this.FUniqueItem;
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      pas.Classes.TCollection.SetItem.call(this,Index,Value);
    };
    this.ClearCollection = function () {
      pas.Classes.TCollection.Clear.call(this);
    };
    this.UpdateFilter = function () {
      if (this.FOnUpdateFilter != null) this.FOnUpdateFilter(this);
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FCommonItem;
        }, set: function (v) {
          this.p.FCommonItem = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FUniqueItem;
        }, set: function (v) {
          this.p.FUniqueItem = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FCommonDoubleQuotedItem;
        }, set: function (v) {
          this.p.FCommonDoubleQuotedItem = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FUniqueDoubleQuotedItem;
        }, set: function (v) {
          this.p.FUniqueDoubleQuotedItem = v;
        }});
      pas.Classes.TCollection.Destroy.call(this);
    };
    this.Add$1 = function (AColumn, ACondition, AOperation, ACaseSensitive) {
      var Result = null;
      Result = this.Add$3();
      Result.FColumn = AColumn;
      Result.FCondition = ACondition;
      Result.FOperation = AOperation;
      Result.FCaseSensitive = ACaseSensitive;
      this.UpdateFilter();
      return Result;
    };
    this.Add$2 = function (AColumn, AType, AValue, AOperation, ACaseSensitive) {
      var Result = null;
      Result = this.Add$3();
      Result.FColumn = AColumn;
      Result.FOperation = AOperation;
      Result.FType = AType;
      Result.FCondition = $mod.TTMSFNCDataGridData.ValueToString(AValue);
      Result.FCaseSensitive = ACaseSensitive;
      this.UpdateFilter();
      return Result;
    };
    this.Add$3 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      if (this.GetCount() === 1) {
        Result.FOperation = $mod.TTMSFNCDataGridDataFilterOperation.gfoNONE}
       else Result.FOperation = $mod.TTMSFNCDataGridDataFilterOperation.gfoAND;
      return Result;
    };
    this.First = function () {
      var Result = null;
      Result = null;
      if (this.GetCount() > 0) Result = this.GetItem$1(0);
      return Result;
    };
    this.HasFilter = function (AColumn) {
      var Result = false;
      var i = 0;
      Result = false;
      for (var $l = 1, $end = this.GetCount(); $l <= $end; $l++) {
        i = $l;
        if (this.GetItem$1(i - 1).FColumn === AColumn) {
          Result = true;
          break;
        };
      };
      return Result;
    };
    this.Insert$1 = function (AIndex) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,AIndex);
      return Result;
    };
    this.Last = function () {
      var Result = null;
      Result = null;
      if (this.GetCount() > 0) Result = this.GetItem$1(this.GetCount() - 1);
      return Result;
    };
    this.Clear$1 = function () {
      var p = null;
      p = this.Owner();
      if ((p != null) && $mod.TTMSFNCDataGridData.isPrototypeOf(p)) rtl.as(p,$mod.TTMSFNCDataGridData).ClearFilter();
    };
    this.Parse = function (AColumn, AFilterText) {
      var sl = null;
      var sls = null;
      var I = 0;
      var f = "";
      var fc = "";
      var K = 0;
      var t = 0;
      this.Clear$1();
      sl = pas.Classes.TStringList.$create("Create$1");
      try {
        pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.Split("|",AFilterText,sl,false);
        for (var $l = 0, $end = sl.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          f = sl.Get(I);
          f = pas.SysUtils.Trim(f);
          if (f !== "") {
            sls = pas.Classes.TStringList.$create("Create$1");
            try {
              pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.Split("&",f,sls,false);
              if (sls.GetCount() === 1) {
                $mod.StripFilterCondition(f,{get: function () {
                    return f;
                  }, set: function (v) {
                    f = v;
                  }},{get: function () {
                    return t;
                  }, set: function (v) {
                    t = v;
                  }});
                if (sl.GetCount() > 0) {
                  this.Add$2(AColumn,t,f,$mod.TTMSFNCDataGridDataFilterOperation.gfoOR,false)}
                 else this.Add$2(AColumn,t,f,$mod.TTMSFNCDataGridDataFilterOperation.gfoNONE,false);
              } else {
                for (var $l1 = 0, $end1 = sls.GetCount() - 1; $l1 <= $end1; $l1++) {
                  K = $l1;
                  fc = sls.Get(K);
                  fc = pas.SysUtils.Trim(fc);
                  if (fc !== "") {
                    $mod.StripFilterCondition(fc,{get: function () {
                        return fc;
                      }, set: function (v) {
                        fc = v;
                      }},{get: function () {
                        return t;
                      }, set: function (v) {
                        t = v;
                      }});
                    if (sls.GetCount() > 0) {
                      this.Add$2(AColumn,t,fc,$mod.TTMSFNCDataGridDataFilterOperation.gfoAND,false)}
                     else this.Add$2(AColumn,t,fc,$mod.TTMSFNCDataGridDataFilterOperation.gfoNONE,false);
                  };
                };
              };
            } finally {
              sls = rtl.freeLoc(sls);
            };
          };
        };
      } finally {
        sl = rtl.freeLoc(sl);
      };
    };
    this.RemoveColumnFilter = function (AColumn) {
      var i = 0;
      i = this.GetCount();
      while (i > 0) {
        i -= 1;
        if (this.GetItem$1(i).FColumn === AColumn) this.Delete(i);
      };
    };
  });
  this.TTMSFNCDataGridDataFindParameter = {"0": "gfnMatchCase", gfnMatchCase: 0, "1": "gfnMatchFull", gfnMatchFull: 1, "2": "gfnMatchRegular", gfnMatchRegular: 2, "3": "gfnDirectionLeftRight", gfnDirectionLeftRight: 3, "4": "gfnMatchStart", gfnMatchStart: 4, "5": "gfnFindInCurrentRow", gfnFindInCurrentRow: 5, "6": "gfnFindInCurrentColumn", gfnFindInCurrentColumn: 6, "7": "gfnIncludeFixed", gfnIncludeFixed: 7, "8": "gfnAutoGoto", gfnAutoGoto: 8, "9": "gfnIgnoreHTMLTags", gfnIgnoreHTMLTags: 9, "10": "gfnBackward", gfnBackward: 10, "11": "gfnIncludeHiddenColumns", gfnIncludeHiddenColumns: 11, "12": "gfnFindInPresetColumn", gfnFindInPresetColumn: 12, "13": "gfnFindInPresetRow", gfnFindInPresetRow: 13, "14": "gfnSelectedCells", gfnSelectedCells: 14, "15": "gfnIncludeHiddenRows", gfnIncludeHiddenRows: 15};
  this.$rtti.$Enum("TTMSFNCDataGridDataFindParameter",{minvalue: 0, maxvalue: 15, ordtype: 1, enumtype: this.TTMSFNCDataGridDataFindParameter});
  this.$rtti.$Set("TTMSFNCDataGridDataFindParameters",{comptype: this.$rtti["TTMSFNCDataGridDataFindParameter"]});
  rtl.createClass(this,"TTMSFNCDataGridDataIOOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FAlwaysQuotes = false;
      this.FDelimiter = "\x00";
      this.FExportScale = 0.0;
      this.FMaxRows = 0;
      this.FOpenAfterCreation = false;
      this.FQuoteEmptyCells = false;
      this.FStartColumn = 0;
      this.FStartRow = 0;
      this.FTrimSpaces = false;
    };
    this.IsExportScaleStored = function () {
      var Result = false;
      Result = this.FExportScale !== 1.0;
      return Result;
    };
    this.Create$1 = function () {
      this.FDelimiter = "\x00";
      this.FMaxRows = -1;
      this.FStartRow = 0;
      this.FStartColumn = 0;
      this.FAlwaysQuotes = false;
      this.FQuoteEmptyCells = true;
      this.FOpenAfterCreation = true;
      this.FTrimSpaces = false;
      this.FExportScale = 1.0;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridDataIOOptions.isPrototypeOf(Source)) {
        this.FDelimiter = rtl.as(Source,$mod.TTMSFNCDataGridDataIOOptions).FDelimiter;
        this.FMaxRows = rtl.as(Source,$mod.TTMSFNCDataGridDataIOOptions).FMaxRows;
        this.FStartColumn = rtl.as(Source,$mod.TTMSFNCDataGridDataIOOptions).FStartColumn;
        this.FStartRow = rtl.as(Source,$mod.TTMSFNCDataGridDataIOOptions).FStartRow;
        this.FAlwaysQuotes = rtl.as(Source,$mod.TTMSFNCDataGridDataIOOptions).FAlwaysQuotes;
        this.FQuoteEmptyCells = rtl.as(Source,$mod.TTMSFNCDataGridDataIOOptions).FQuoteEmptyCells;
        this.FOpenAfterCreation = rtl.as(Source,$mod.TTMSFNCDataGridDataIOOptions).FOpenAfterCreation;
        this.FTrimSpaces = rtl.as(Source,$mod.TTMSFNCDataGridDataIOOptions).FTrimSpaces;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("AlwaysQuotes",0,rtl.boolean,"FAlwaysQuotes","FAlwaysQuotes",4,{Default: false});
    $r.addProperty("Delimiter",0,rtl.char,"FDelimiter","FDelimiter",4,{Default: "\x00"});
    $r.addProperty("ExportScale",12,rtl.double,"FExportScale","FExportScale",4,{stored: "IsExportScaleStored"});
    $r.addProperty("MaxRows",0,rtl.longint,"FMaxRows","FMaxRows",4,{Default: -1});
    $r.addProperty("OpenAfterCreation",0,rtl.boolean,"FOpenAfterCreation","FOpenAfterCreation",4,{Default: true});
    $r.addProperty("QuoteEmptyCells",0,rtl.boolean,"FQuoteEmptyCells","FQuoteEmptyCells",4,{Default: true});
    $r.addProperty("StartColumn",0,rtl.longint,"FStartColumn","FStartColumn",4,{Default: 0});
    $r.addProperty("StartRow",0,rtl.longint,"FStartRow","FStartRow",4,{Default: 0});
    $r.addProperty("TrimSpaces",0,rtl.boolean,"FTrimSpaces","FTrimSpaces",4,{Default: false});
  });
  rtl.createClass(this,"TTMSFNCDataGridDataURLOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FAutoDetect = false;
      this.FAutoOpen = false;
      this.FOnChangeRebuild = null;
    };
    this.$final = function () {
      this.FOnChangeRebuild = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetAutoDetect = function (Value) {
      if (this.FAutoDetect !== Value) {
        this.FAutoDetect = Value;
        if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
      };
    };
    this.Create$1 = function () {
      this.FAutoDetect = false;
      this.FAutoOpen = true;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridDataURLOptions.isPrototypeOf(Source)) {
        this.FAutoDetect = rtl.as(Source,$mod.TTMSFNCDataGridDataURLOptions).FAutoDetect;
        this.FAutoOpen = rtl.as(Source,$mod.TTMSFNCDataGridDataURLOptions).FAutoOpen;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("AutoOpen",0,rtl.boolean,"FAutoOpen","FAutoOpen",4,{Default: true});
    $r.addProperty("AutoDetect",2,rtl.boolean,"FAutoDetect","SetAutoDetect",4,{Default: false});
  });
  this.$rtti.$ClassRef("TTMSFNCDataGridDataIOOptionsClass",{instancetype: this.$rtti["TTMSFNCDataGridDataIOOptions"]});
  rtl.createClass(this,"TTMSFNCDataGridDataSortingOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FDirection = 0;
      this.FCaseSensitive = false;
      this.FFormat = 0;
      this.FRow = 0;
      this.FEnabled = false;
      this.FOnChangeRebuild = null;
    };
    this.$final = function () {
      this.FOnChangeRebuild = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetEnabled = function (Value) {
      if (this.FEnabled !== Value) {
        this.FEnabled = Value;
        if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
      };
    };
    this.Create$1 = function () {
      this.FDirection = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortDirection.gsdAscending;
      this.FCaseSensitive = true;
      this.FFormat = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortFormat.gsfAutomatic;
      this.FRow = 0;
      this.FEnabled = false;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridDataSortingOptions.isPrototypeOf(Source)) {
        this.FDirection = rtl.as(Source,$mod.TTMSFNCDataGridDataSortingOptions).FDirection;
        this.FCaseSensitive = rtl.as(Source,$mod.TTMSFNCDataGridDataSortingOptions).FCaseSensitive;
        this.FFormat = rtl.as(Source,$mod.TTMSFNCDataGridDataSortingOptions).FFormat;
        this.FRow = rtl.as(Source,$mod.TTMSFNCDataGridDataSortingOptions).FRow;
        this.FEnabled = rtl.as(Source,$mod.TTMSFNCDataGridDataSortingOptions).FEnabled;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("CaseSensitive",0,rtl.boolean,"FCaseSensitive","FCaseSensitive",4,{Default: true});
    $r.addProperty("Direction",0,pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridSortDirection"],"FDirection","FDirection",4,{Default: pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortDirection.gsdAscending});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: false});
    $r.addProperty("Format",0,pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridSortFormat"],"FFormat","FFormat",4,{Default: pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortFormat.gsfAutomatic});
    $r.addProperty("Row",0,rtl.longint,"FRow","FRow",4,{Default: 0});
  });
  rtl.createClass(this,"TTMSFNCDataGridDataGroupingOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FAutoSort = false;
      this.FCalculationFormat = "";
      this.FHeaderHeight = 0.0;
      this.FHideColumns = false;
      this.FMergeDelimiter = "";
      this.FMergeHeader = false;
      this.FMergeSummary = false;
      this.FSummary = false;
      this.FSummaryHeight = 0.0;
      this.FSummaryInHeader = false;
      this.FUseFirstRowAsHeader = false;
      this.FCalculationFormatType = 0;
    };
    this.IsCalculationFormatStored = function () {
      var Result = false;
      Result = this.FCalculationFormat !== "%g";
      return Result;
    };
    this.IsHeaderHeightStored = function () {
      var Result = false;
      Result = this.FHeaderHeight !== 30;
      return Result;
    };
    this.IsMergeDelimiterStored = function () {
      var Result = false;
      Result = this.FMergeDelimiter !== " ; ";
      return Result;
    };
    this.IsSummaryHeightStored = function () {
      var Result = false;
      Result = this.FSummaryHeight !== 30;
      return Result;
    };
    this.Create$1 = function () {
      this.FCalculationFormatType = $mod.TTMSFNCDataGridDataCalculationFormatType.gcfNumber;
      this.FSummary = true;
      this.FMergeHeader = true;
      this.FMergeSummary = false;
      this.FSummaryInHeader = false;
      this.FHideColumns = false;
      this.FCalculationFormat = "%g";
      this.FAutoSort = true;
      this.FUseFirstRowAsHeader = true;
      this.FMergeDelimiter = " ; ";
      this.FHeaderHeight = 30;
      this.FSummaryHeight = 30;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridDataGroupingOptions.isPrototypeOf(Source)) {
        this.FSummary = rtl.as(Source,$mod.TTMSFNCDataGridDataGroupingOptions).FSummary;
        this.FSummaryInHeader = rtl.as(Source,$mod.TTMSFNCDataGridDataGroupingOptions).FSummaryInHeader;
        this.FMergeSummary = rtl.as(Source,$mod.TTMSFNCDataGridDataGroupingOptions).FMergeSummary;
        this.FMergeHeader = rtl.as(Source,$mod.TTMSFNCDataGridDataGroupingOptions).FMergeHeader;
        this.FHideColumns = rtl.as(Source,$mod.TTMSFNCDataGridDataGroupingOptions).FHideColumns;
        this.FCalculationFormat = rtl.as(Source,$mod.TTMSFNCDataGridDataGroupingOptions).FCalculationFormat;
        this.FAutoSort = rtl.as(Source,$mod.TTMSFNCDataGridDataGroupingOptions).FAutoSort;
        this.FUseFirstRowAsHeader = rtl.as(Source,$mod.TTMSFNCDataGridDataGroupingOptions).FUseFirstRowAsHeader;
        this.FMergeDelimiter = rtl.as(Source,$mod.TTMSFNCDataGridDataGroupingOptions).FMergeDelimiter;
        this.FCalculationFormatType = rtl.as(Source,$mod.TTMSFNCDataGridDataGroupingOptions).FCalculationFormatType;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("AutoSort",0,rtl.boolean,"FAutoSort","FAutoSort",4,{Default: true});
    $r.addProperty("CalculationFormat",12,rtl.string,"FCalculationFormat","FCalculationFormat",4,{stored: "IsCalculationFormatStored"});
    $r.addProperty("CalculationFormatType",0,$mod.$rtti["TTMSFNCDataGridDataCalculationFormatType"],"FCalculationFormatType","FCalculationFormatType",4,{Default: $mod.TTMSFNCDataGridDataCalculationFormatType.gcfNumber});
    $r.addProperty("HeaderHeight",12,rtl.double,"FHeaderHeight","FHeaderHeight",4,{stored: "IsHeaderHeightStored"});
    $r.addProperty("HideColumns",0,rtl.boolean,"FHideColumns","FHideColumns",4,{Default: false});
    $r.addProperty("MergeDelimiter",12,rtl.string,"FMergeDelimiter","FMergeDelimiter",4,{stored: "IsMergeDelimiterStored"});
    $r.addProperty("MergeHeader",0,rtl.boolean,"FMergeHeader","FMergeHeader",4,{Default: true});
    $r.addProperty("MergeSummary",0,rtl.boolean,"FMergeSummary","FMergeSummary",4,{Default: false});
    $r.addProperty("Summary",0,rtl.boolean,"FSummary","FSummary",4,{Default: true});
    $r.addProperty("SummaryHeight",12,rtl.double,"FSummaryHeight","FSummaryHeight",4,{stored: "IsSummaryHeightStored"});
    $r.addProperty("SummaryInHeader",0,rtl.boolean,"FSummaryInHeader","FSummaryInHeader",4,{Default: false});
    $r.addProperty("UseFirstRowAsHeader",0,rtl.boolean,"FUseFirstRowAsHeader","FUseFirstRowAsHeader",4,{Default: true});
  });
  rtl.createClass(this,"TTMSFNCDataGridDataCalculationOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FIncludeHiddenRows = false;
      this.FIncludeHiddenColumns = false;
    };
    this.Create$1 = function () {
      this.FIncludeHiddenRows = true;
      this.FIncludeHiddenColumns = true;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridDataCalculationOptions.isPrototypeOf(Source)) {
        this.FIncludeHiddenRows = rtl.as(Source,$mod.TTMSFNCDataGridDataCalculationOptions).FIncludeHiddenRows;
        this.FIncludeHiddenColumns = rtl.as(Source,$mod.TTMSFNCDataGridDataCalculationOptions).FIncludeHiddenColumns;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("IncludeHiddenRows",0,rtl.boolean,"FIncludeHiddenRows","FIncludeHiddenRows",4,{Default: true});
    $r.addProperty("IncludeHiddenColumns",0,rtl.boolean,"FIncludeHiddenColumns","FIncludeHiddenColumns",4,{Default: true});
  });
  this.TTMSFNCDataGridDataFilterRows = {"0": "gfrNormal", gfrNormal: 0, "1": "gfrAll", gfrAll: 1};
  this.$rtti.$Enum("TTMSFNCDataGridDataFilterRows",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCDataGridDataFilterRows});
  this.TTMSFNCDataGridDataFilterControl = {"0": "gfcButton", gfcButton: 0, "1": "gfcEditor", gfcEditor: 1};
  this.$rtti.$Enum("TTMSFNCDataGridDataFilterControl",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCDataGridDataFilterControl});
  this.$rtti.$Set("TTMSFNCDataGridDataFilterControls",{comptype: this.$rtti["TTMSFNCDataGridDataFilterControl"]});
  this.$rtti.$MethodVar("TTMSFNCDataGridDataFilterActionApplyEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ARow",rtl.longint],["AMatches",rtl.boolean]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridDataFilterActionRemoveEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ARow",rtl.longint]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCDataGridDataFilterAction",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FDataPointer = null;
      this.FDataBoolean = false;
      this.FDataString = "";
      this.FDataObject = null;
      this.FDataInteger = 0;
      this.FEnabled = false;
      this.FName = "";
      this.FOnApply = null;
      this.FOnRemove = null;
      this.FOnClear = null;
    };
    this.$final = function () {
      this.FDataObject = undefined;
      this.FOnApply = undefined;
      this.FOnRemove = undefined;
      this.FOnClear = undefined;
      pas.Classes.TCollectionItem.$final.call(this);
    };
    this.GetDisplayName = function () {
      var Result = "";
      if (this.FName === "") {
        Result = "Action " + pas.SysUtils.IntToStr(this.GetIndex())}
       else Result = this.FName;
      return Result;
    };
    this.Create$1 = function (ACollection) {
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      this.FEnabled = true;
      return this;
    };
    this.Destroy = function () {
      pas.Classes.TCollectionItem.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridDataFilterAction.isPrototypeOf(Source)) {
        this.FEnabled = rtl.as(Source,$mod.TTMSFNCDataGridDataFilterAction).FEnabled;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Enabled",0,rtl.boolean,"FEnabled","FEnabled",4,{Default: true});
    $r.addProperty("Name",0,rtl.string,"FName","FName");
    $r.addProperty("OnApply",0,$mod.$rtti["TTMSFNCDataGridDataFilterActionApplyEvent"],"FOnApply","FOnApply");
    $r.addProperty("OnRemove",0,$mod.$rtti["TTMSFNCDataGridDataFilterActionRemoveEvent"],"FOnRemove","FOnRemove");
    $r.addProperty("OnClear",0,pas.Classes.$rtti["TNotifyEvent"],"FOnClear","FOnClear");
  });
  this.$rtti.$ClassRef("TTMSFNCDataGridDataFilterActionClass",{instancetype: this.$rtti["TTMSFNCDataGridDataFilterAction"]});
  rtl.createClass(this,"TTMSFNCDataGridDataFilterActions",pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection,function () {
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      this.SetItem(Index,Value);
    };
    this.GetFilterActionClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCDataGridDataFilterAction;
      return Result;
    };
    this.FilterActionByName = function (AName) {
      var Result = null;
      var i = 0;
      Result = null;
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.GetItem$1(i).FName === AName) {
          Result = this.GetItem$1(i);
          break;
        };
      };
      return Result;
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,this.GetFilterActionClass());
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      return Result;
    };
  });
  this.$rtti.$ClassRef("TTMSFNCDataGridDataFilterActionsClass",{instancetype: this.$rtti["TTMSFNCDataGridDataFilterActions"]});
  this.TTMSFNCDataGridDataFilteringAction = {"0": "gdfaHideRow", gdfaHideRow: 0, "1": "gdfaExecuteActions", gdfaExecuteActions: 1, "2": "gdfaApplyAppearance", gdfaApplyAppearance: 2};
  this.$rtti.$Enum("TTMSFNCDataGridDataFilteringAction",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCDataGridDataFilteringAction});
  this.$rtti.$Set("TTMSFNCDataGridDataFilteringActions",{comptype: this.$rtti["TTMSFNCDataGridDataFilteringAction"]});
  this.$rtti.$MethodVar("TTMSFNCDataGridFilterRowChangedEvent",{procsig: rtl.newTIProcSig([["AOldRow",rtl.longint],["ANewRow",rtl.longint]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCDataGridDataFilteringOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FControls = {};
      this.FDropDownHeight = 0;
      this.FDropDownWidth = 0;
      this.FEnabled = false;
      this.FHideEmptyGroups = false;
      this.FMultiColumn = false;
      this.FOnChangeRebuild = null;
      this.FRow = 0;
      this.FRows = 0;
      this.FAdvanced = false;
      this.FActions = {};
      this.FOnFilterRowChanged = null;
    };
    this.$final = function () {
      this.FControls = undefined;
      this.FOnChangeRebuild = undefined;
      this.FActions = undefined;
      this.FOnFilterRowChanged = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetControls = function (Value) {
      if (rtl.neSet(this.FControls,Value)) {
        this.FControls = rtl.refSet(Value);
        if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
      };
    };
    this.SetEnabled = function (Value) {
      if (this.FEnabled !== Value) {
        this.FEnabled = Value;
        if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
      };
    };
    this.SetRow = function (Value) {
      var olr = 0;
      if (this.FRow !== Value) {
        olr = this.FRow;
        this.FRow = Value;
        if (this.FOnFilterRowChanged != null) this.FOnFilterRowChanged(olr,this.FRow);
        if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
      };
    };
    this.SetAdvanced = function (Value) {
      if (this.FAdvanced !== Value) {
        this.FAdvanced = Value;
        if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
      };
    };
    this.Create$1 = function () {
      this.FActions = rtl.createSet($mod.TTMSFNCDataGridDataFilteringAction.gdfaHideRow);
      this.FRows = $mod.TTMSFNCDataGridDataFilterRows.gfrNormal;
      this.FControls = rtl.createSet($mod.TTMSFNCDataGridDataFilterControl.gfcButton);
      this.FEnabled = false;
      this.FRow = 0;
      this.FDropDownWidth = 200;
      this.FDropDownHeight = 280;
      this.FMultiColumn = false;
      this.FHideEmptyGroups = false;
      this.FAdvanced = false;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridDataFilteringOptions.isPrototypeOf(Source)) {
        this.FRows = rtl.as(Source,$mod.TTMSFNCDataGridDataFilteringOptions).FRows;
        this.FEnabled = rtl.as(Source,$mod.TTMSFNCDataGridDataFilteringOptions).FEnabled;
        this.FRow = rtl.as(Source,$mod.TTMSFNCDataGridDataFilteringOptions).FRow;
        this.FDropDownWidth = rtl.as(Source,$mod.TTMSFNCDataGridDataFilteringOptions).FDropDownWidth;
        this.FDropDownHeight = rtl.as(Source,$mod.TTMSFNCDataGridDataFilteringOptions).FDropDownHeight;
        this.FMultiColumn = rtl.as(Source,$mod.TTMSFNCDataGridDataFilteringOptions).FMultiColumn;
        this.FHideEmptyGroups = rtl.as(Source,$mod.TTMSFNCDataGridDataFilteringOptions).FHideEmptyGroups;
        this.FControls = rtl.refSet(rtl.as(Source,$mod.TTMSFNCDataGridDataFilteringOptions).FControls);
        this.FAdvanced = rtl.as(Source,$mod.TTMSFNCDataGridDataFilteringOptions).FAdvanced;
        this.FActions = rtl.refSet(rtl.as(Source,$mod.TTMSFNCDataGridDataFilteringOptions).FActions);
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Actions",0,$mod.$rtti["TTMSFNCDataGridDataFilteringActions"],"FActions","FActions",4,{Default: rtl.createSet($mod.TTMSFNCDataGridDataFilteringAction.gdfaHideRow)});
    $r.addProperty("Advanced",2,rtl.boolean,"FAdvanced","SetAdvanced",4,{Default: false});
    $r.addProperty("Controls",2,$mod.$rtti["TTMSFNCDataGridDataFilterControls"],"FControls","SetControls",4,{Default: rtl.createSet($mod.TTMSFNCDataGridDataFilterControl.gfcButton)});
    $r.addProperty("DropDownHeight",0,rtl.longint,"FDropDownHeight","FDropDownHeight",4,{Default: 280});
    $r.addProperty("DropDownWidth",0,rtl.longint,"FDropDownWidth","FDropDownWidth",4,{Default: 200});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: false});
    $r.addProperty("HideEmptyGroups",0,rtl.boolean,"FHideEmptyGroups","FHideEmptyGroups",4,{Default: false});
    $r.addProperty("MultiColumn",0,rtl.boolean,"FMultiColumn","FMultiColumn",4,{Default: false});
    $r.addProperty("Row",2,rtl.longint,"FRow","SetRow",4,{Default: 0});
    $r.addProperty("Rows",0,$mod.$rtti["TTMSFNCDataGridDataFilterRows"],"FRows","FRows",4,{Default: $mod.TTMSFNCDataGridDataFilterRows.gfrNormal});
  });
  rtl.createClass(this,"TTMSFNCDataGridDataFindOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FRow = 0;
      this.FColumn = 0;
    };
    this.Create$1 = function () {
      this.FRow = 0;
      this.FColumn = 0;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridDataFindOptions.isPrototypeOf(Source)) {
        this.FRow = rtl.as(Source,$mod.TTMSFNCDataGridDataFindOptions).FRow;
        this.FColumn = rtl.as(Source,$mod.TTMSFNCDataGridDataFindOptions).FColumn;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Column",0,rtl.longint,"FColumn","FColumn",4,{Default: 0});
    $r.addProperty("Row",0,rtl.longint,"FRow","FRow",4,{Default: 0});
  });
  rtl.createClass(this,"TTMSFNCDataGridDataOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FCalculations = null;
      this.FFiltering = null;
      this.FFind = null;
      this.FGrouping = null;
      this.FIO = null;
      this.FOnChange = null;
      this.FOnChangeRebuild = null;
      this.FSorting = null;
      this.FURL = null;
      this.FOnFilterRowChanged = null;
    };
    this.$final = function () {
      this.FCalculations = undefined;
      this.FFiltering = undefined;
      this.FFind = undefined;
      this.FGrouping = undefined;
      this.FIO = undefined;
      this.FOnChange = undefined;
      this.FOnChangeRebuild = undefined;
      this.FSorting = undefined;
      this.FURL = undefined;
      this.FOnFilterRowChanged = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetCalculations = function (Value) {
      if (this.FCalculations !== Value) this.FCalculations.Assign(Value);
    };
    this.SetFiltering = function (Value) {
      if (this.FFiltering !== Value) this.FFiltering.Assign(Value);
    };
    this.SetFind = function (Value) {
      if (this.FFind !== Value) this.FFind.Assign(Value);
    };
    this.SetGrouping = function (Value) {
      if (this.FGrouping !== Value) this.FGrouping.Assign(Value);
    };
    this.SetIO = function (Value) {
      if (this.FIO !== Value) this.FIO.Assign(Value);
    };
    this.SetSorting = function (Value) {
      if (this.FSorting !== Value) this.FSorting.Assign(Value);
    };
    this.SetURL = function (Value) {
      if (this.FURL !== Value) this.FURL.Assign(Value);
    };
    this.GetIOOptionsClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCDataGridDataIOOptions;
      return Result;
    };
    this.DoFilteringOptionsChange = function (Sender) {
      if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
    };
    this.DoFilteringOptionsRowChanged = function (AOldRow, ANewRow) {
      if (this.FOnFilterRowChanged != null) this.FOnFilterRowChanged(AOldRow,ANewRow);
    };
    this.DoSortingOptionsChange = function (Sender) {
      if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
    };
    this.DoURLOptionsChange = function (Sender) {
      if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
    };
    this.Create$1 = function () {
      this.FIO = this.GetIOOptionsClass().$create("Create$1");
      this.FSorting = $mod.TTMSFNCDataGridDataSortingOptions.$create("Create$1");
      this.FSorting.FOnChangeRebuild = rtl.createCallback(this,"DoSortingOptionsChange");
      this.FGrouping = $mod.TTMSFNCDataGridDataGroupingOptions.$create("Create$1");
      this.FFiltering = $mod.TTMSFNCDataGridDataFilteringOptions.$create("Create$1");
      this.FFiltering.FOnChangeRebuild = rtl.createCallback(this,"DoFilteringOptionsChange");
      this.FFiltering.FOnFilterRowChanged = rtl.createCallback(this,"DoFilteringOptionsRowChanged");
      this.FFind = $mod.TTMSFNCDataGridDataFindOptions.$create("Create$1");
      this.FCalculations = $mod.TTMSFNCDataGridDataCalculationOptions.$create("Create$1");
      this.FURL = $mod.TTMSFNCDataGridDataURLOptions.$create("Create$1");
      this.FURL.FOnChangeRebuild = rtl.createCallback(this,"DoURLOptionsChange");
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridDataOptions.isPrototypeOf(Source)) {
        this.FSorting.Assign(rtl.as(Source,$mod.TTMSFNCDataGridDataOptions).FSorting);
        this.FIO.Assign(rtl.as(Source,$mod.TTMSFNCDataGridDataOptions).FIO);
        this.FFiltering.Assign(rtl.as(Source,$mod.TTMSFNCDataGridDataOptions).FFiltering);
        this.FGrouping.Assign(rtl.as(Source,$mod.TTMSFNCDataGridDataOptions).FGrouping);
        this.FFind.Assign(rtl.as(Source,$mod.TTMSFNCDataGridDataOptions).FFind);
      };
    };
    this.Destroy = function () {
      rtl.free(this,"FFind");
      rtl.free(this,"FIO");
      rtl.free(this,"FGrouping");
      rtl.free(this,"FFiltering");
      rtl.free(this,"FCalculations");
      rtl.free(this,"FSorting");
      rtl.free(this,"FURL");
      pas.System.TObject.Destroy.call(this);
    };
    var $r = this.$rtti;
    $r.addProperty("Calculations",2,$mod.$rtti["TTMSFNCDataGridDataCalculationOptions"],"FCalculations","SetCalculations");
    $r.addProperty("Filtering",2,$mod.$rtti["TTMSFNCDataGridDataFilteringOptions"],"FFiltering","SetFiltering");
    $r.addProperty("Find",2,$mod.$rtti["TTMSFNCDataGridDataFindOptions"],"FFind","SetFind");
    $r.addProperty("Grouping",2,$mod.$rtti["TTMSFNCDataGridDataGroupingOptions"],"FGrouping","SetGrouping");
    $r.addProperty("IO",2,$mod.$rtti["TTMSFNCDataGridDataIOOptions"],"FIO","SetIO");
    $r.addProperty("Sorting",2,$mod.$rtti["TTMSFNCDataGridDataSortingOptions"],"FSorting","SetSorting");
    $r.addProperty("URL",2,$mod.$rtti["TTMSFNCDataGridDataURLOptions"],"FURL","SetURL");
  });
  this.$rtti.$ClassRef("TTMSFNCDataGridDataOptionsClass",{instancetype: this.$rtti["TTMSFNCDataGridDataOptions"]});
  this.TTMSFNCDataGridDataAdapterGroupMode = {"0": "agmNone", agmNone: 0, "1": "agmNormal", agmNormal: 1, "2": "agmAdapter", agmAdapter: 2};
  this.$rtti.$Enum("TTMSFNCDataGridDataAdapterGroupMode",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCDataGridDataAdapterGroupMode});
  this.TTMSFNCDataGridDataAdapterSortMode = {"0": "asmNone", asmNone: 0, "1": "asmNormal", asmNormal: 1, "2": "asmAdapter", asmAdapter: 2};
  this.$rtti.$Enum("TTMSFNCDataGridDataAdapterSortMode",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCDataGridDataAdapterSortMode});
  this.TTMSFNCDataGridDataAdapterScrollMode = {"0": "ascmNone", ascmNone: 0, "1": "ascmNormal", ascmNormal: 1, "2": "ascmKeepSelection", ascmKeepSelection: 2};
  this.$rtti.$Enum("TTMSFNCDataGridDataAdapterScrollMode",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCDataGridDataAdapterScrollMode});
  this.TTMSFNCDataGridDataAdapterFilterMode = {"0": "afmNone", afmNone: 0, "1": "afmNormal", afmNormal: 1, "2": "afmAdapter", afmAdapter: 2};
  this.$rtti.$Enum("TTMSFNCDataGridDataAdapterFilterMode",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCDataGridDataAdapterFilterMode});
  rtl.createClass(this,"TTMSFNCDataGridDataAdapter",pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.$init.call(this);
      this.FActive = false;
      this.FBlockAdd = false;
      this.FDataInstance = null;
      this.FStreamedActive = false;
    };
    this.$final = function () {
      this.FDataInstance = undefined;
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.$final.call(this);
    };
    this.GetDataInstance = function () {
      var Result = null;
      Result = this.FDataInstance;
      return Result;
    };
    this.SetActive = function (Value) {
      this.FActive = Value;
      if (pas.Classes.TComponentStateItem.csReading in this.FComponentState) {
        this.FStreamedActive = Value;
      } else {
        if (!(this.GetDataInstance() != null)) return;
        this.Initialize();
      };
    };
    this.SetDataInstance = function (Value) {
      if (this.FDataInstance !== Value) {
        this.FDataInstance = Value;
        if (this.FBlockAdd) return;
        this.FBlockAdd = true;
        if (this.FDataInstance != null) {
          this.FDataInstance.SetAdapter(this);
          this.Initialize();
        };
        this.FBlockAdd = false;
      };
    };
    this.GetInstance = function () {
      var Result = 0;
      Result = pas["WEBLib.TMSFNCTypes"].HInstance();
      return Result;
    };
    this.Loaded = function () {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.Loaded.call(this);
      if (this.FStreamedActive) this.SetActive(true);
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.Create$1.apply(this,arguments);
      this.FActive = true;
      return this;
    };
    this.Create$6 = function () {
      this.Create$1(null);
      return this;
    };
    this.Destroy = function () {
      if (this.FDataInstance != null) this.FDataInstance.FAdapter = null;
      this.FDataInstance = null;
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Active",2,rtl.boolean,"FActive","SetActive",4,{Default: true});
  });
  this.$rtti.$MethodVar("TTMSFNCDataGridDataCellDataEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["ARow",rtl.longint],["AValue",rtl.jsvalue,1]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCDataGridSortIndex",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FDirection = 0;
      this.FColumn = 0;
    };
    this.Create$1 = function (AColumn, ADirection) {
      this.FColumn = AColumn;
      this.FDirection = ADirection;
      return this;
    };
  });
  rtl.createClass(this,"TTMSFNCDataGridSortIndexList",pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCDataGridSortIndex,function () {
    this.Add$1 = function (AColumn, ADirection) {
      var Result = null;
      Result = $mod.TTMSFNCDataGridSortIndex.$create("Create$1",[AColumn,ADirection]);
      pas["Generics.Collections"].TList$$$G$$generics$collections$$TTMSFNCDataGridSortIndex.Add.call(this,Result);
      return Result;
    };
    this.Find = function (AColumn, ASortIndex) {
      var Result = false;
      var I = 0;
      Result = false;
      ASortIndex.set(null);
      for (var $l = 0, $end = this.FLength - 1; $l <= $end; $l++) {
        I = $l;
        if (this.GetItem(I).FColumn === AColumn) {
          ASortIndex.set(this.GetItem(I));
          Result = true;
          break;
        };
      };
      return Result;
    };
    this.Toggle = function (AColumn) {
      var idx = null;
      if (this.Find(AColumn,{get: function () {
          return idx;
        }, set: function (v) {
          idx = v;
        }})) {
        var $tmp = idx.FDirection;
        if ($tmp === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortDirection.gsdAscending) {
          idx.FDirection = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortDirection.gsdDescending}
         else if ($tmp === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortDirection.gsdDescending) idx.FDirection = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortDirection.gsdAscending;
      };
    };
  });
  this.$rtti.$DynArray("TTMSFNCDataGridDataJSONNamesArray",{eltype: rtl.string});
  rtl.createClass(this,"TTMSFNCDataGridDataTempData",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FCell = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      this.FData = null;
    };
    this.$final = function () {
      this.FCell = undefined;
      this.FData = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function (ACell, AData) {
      this.FCell.$assign(ACell);
      this.FData = AData;
      return this;
    };
    this.Destroy = function () {
      this.FData = null;
      this.FCell.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(-1,-1));
      pas.System.TObject.Destroy.call(this);
    };
  });
  rtl.createClass(this,"TTMSFNCDataGridDataTempDataList",pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCDataGridDataTempData,function () {
    this.Find = function (ACell) {
      var Result = null;
      var I = 0;
      Result = null;
      for (var $l = 0, $end = this.FLength - 1; $l <= $end; $l++) {
        I = $l;
        if (this.GetItem(I).FCell.IsEqualTo(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell))) {
          Result = this.GetItem(I).FData;
          break;
        };
      };
      return Result;
    };
  });
  this.TTMSFNCDataGridDataAutoFillDirection = {"0": "gafdAuto", gafdAuto: 0, "1": "gafdDown", gafdDown: 1, "2": "gafdUp", gafdUp: 2, "3": "gafdRight", gafdRight: 3, "4": "gafdLeft", gafdLeft: 4};
  this.$rtti.$Enum("TTMSFNCDataGridDataAutoFillDirection",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TTMSFNCDataGridDataAutoFillDirection});
  this.TTMSFNCDataGridDataAutoFillType = {"0": "gaftBoolean", gaftBoolean: 0, "1": "gaftNumericFloat", gaftNumericFloat: 1, "2": "gaftNumericInteger", gaftNumericInteger: 2, "3": "gaftDateTime", gaftDateTime: 3, "4": "gaftAlphabetic", gaftAlphabetic: 4, "5": "gaftUnknown", gaftUnknown: 5};
  this.$rtti.$Enum("TTMSFNCDataGridDataAutoFillType",{minvalue: 0, maxvalue: 5, ordtype: 1, enumtype: this.TTMSFNCDataGridDataAutoFillType});
  this.TTMSFNCDataGridDataAutoFillStepKind = {"0": "gaskNone", gaskNone: 0, "1": "gaskInt", gaskInt: 1, "2": "gaskFloat", gaskFloat: 2, "3": "gaskDate", gaskDate: 3};
  this.$rtti.$Enum("TTMSFNCDataGridDataAutoFillStepKind",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TTMSFNCDataGridDataAutoFillStepKind});
  rtl.recNewT(this,"TTMSFNCDataGridDataCustomListIndexEntry",function () {
    this.Key = "";
    this.Index = 0;
    this.$eq = function (b) {
      return (this.Key === b.Key) && (this.Index === b.Index);
    };
    this.$assign = function (s) {
      this.Key = s.Key;
      this.Index = s.Index;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCDataGridDataCustomListIndexEntry",{},this);
    $r.addField("Key",rtl.string);
    $r.addField("Index",rtl.longint);
  });
  this.TTMSFNCDataGridDataDatePatternType = {"0": "gdptDaily", gdptDaily: 0, "1": "gdptWeekly", gdptWeekly: 1, "2": "gdptMonthly", gdptMonthly: 2, "3": "gdptYearly", gdptYearly: 3};
  this.$rtti.$Enum("TTMSFNCDataGridDataDatePatternType",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TTMSFNCDataGridDataDatePatternType});
  rtl.recNewT(this,"TTMSFNCDataGridDataAutoFillLaneModel",function () {
    this.TrendEnabled = false;
    this.TrendIntercept = 0.0;
    this.TrendSlope = 0.0;
    this.TrendCount = 0;
    this.TextNumEnabled = false;
    this.TextNumPrefix = "";
    this.TextNumSuffix = "";
    this.TextNumStart = 0;
    this.TextNumStep = 0;
    this.TextNumWidth = 0;
    this.SeedCount = 0;
    this.HasEmptySeed = false;
    this.CustomListEnabled = false;
    this.CustomListStep = 0;
    this.CustomListKey = "";
    this.CustomListBaseIndex = 0;
    this.CustomListFromEvent = false;
    this.EventCustomListCount = 0;
    this.DatePatternEnabled = false;
    this.DatePatternType = 0;
    this.DatePatternStep = 0;
    this.DatePatternBaseDate = 0.0;
    this.LaneFillType = 0;
    this.LaneStep = 0.0;
    this.$new = function () {
      var r = Object.create(this);
      r.SeedValues = [];
      r.EventCustomListValues = [];
      return r;
    };
    this.$eq = function (b) {
      return (this.TrendEnabled === b.TrendEnabled) && (this.TrendIntercept === b.TrendIntercept) && (this.TrendSlope === b.TrendSlope) && (this.TrendCount === b.TrendCount) && (this.TextNumEnabled === b.TextNumEnabled) && (this.TextNumPrefix === b.TextNumPrefix) && (this.TextNumSuffix === b.TextNumSuffix) && (this.TextNumStart === b.TextNumStart) && (this.TextNumStep === b.TextNumStep) && (this.TextNumWidth === b.TextNumWidth) && (this.SeedCount === b.SeedCount) && (this.SeedValues === b.SeedValues) && (this.HasEmptySeed === b.HasEmptySeed) && (this.CustomListEnabled === b.CustomListEnabled) && (this.CustomListStep === b.CustomListStep) && (this.CustomListKey === b.CustomListKey) && (this.CustomListBaseIndex === b.CustomListBaseIndex) && (this.CustomListFromEvent === b.CustomListFromEvent) && (this.EventCustomListValues === b.EventCustomListValues) && (this.EventCustomListCount === b.EventCustomListCount) && (this.DatePatternEnabled === b.DatePatternEnabled) && (this.DatePatternType === b.DatePatternType) && (this.DatePatternStep === b.DatePatternStep) && (this.DatePatternBaseDate === b.DatePatternBaseDate) && (this.LaneFillType === b.LaneFillType) && (this.LaneStep === b.LaneStep);
    };
    this.$assign = function (s) {
      this.TrendEnabled = s.TrendEnabled;
      this.TrendIntercept = s.TrendIntercept;
      this.TrendSlope = s.TrendSlope;
      this.TrendCount = s.TrendCount;
      this.TextNumEnabled = s.TextNumEnabled;
      this.TextNumPrefix = s.TextNumPrefix;
      this.TextNumSuffix = s.TextNumSuffix;
      this.TextNumStart = s.TextNumStart;
      this.TextNumStep = s.TextNumStep;
      this.TextNumWidth = s.TextNumWidth;
      this.SeedCount = s.SeedCount;
      this.SeedValues = rtl.arrayRef(s.SeedValues);
      this.HasEmptySeed = s.HasEmptySeed;
      this.CustomListEnabled = s.CustomListEnabled;
      this.CustomListStep = s.CustomListStep;
      this.CustomListKey = s.CustomListKey;
      this.CustomListBaseIndex = s.CustomListBaseIndex;
      this.CustomListFromEvent = s.CustomListFromEvent;
      this.EventCustomListValues = rtl.arrayRef(s.EventCustomListValues);
      this.EventCustomListCount = s.EventCustomListCount;
      this.DatePatternEnabled = s.DatePatternEnabled;
      this.DatePatternType = s.DatePatternType;
      this.DatePatternStep = s.DatePatternStep;
      this.DatePatternBaseDate = s.DatePatternBaseDate;
      this.LaneFillType = s.LaneFillType;
      this.LaneStep = s.LaneStep;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCDataGridDataAutoFillLaneModel",{},this);
    $r.addField("TrendEnabled",rtl.boolean);
    $r.addField("TrendIntercept",rtl.double);
    $r.addField("TrendSlope",rtl.double);
    $r.addField("TrendCount",rtl.longint);
    $r.addField("TextNumEnabled",rtl.boolean);
    $r.addField("TextNumPrefix",rtl.string);
    $r.addField("TextNumSuffix",rtl.string);
    $r.addField("TextNumStart",rtl.nativeint);
    $r.addField("TextNumStep",rtl.nativeint);
    $r.addField("TextNumWidth",rtl.longint);
    $r.addField("SeedCount",rtl.longint);
    $r.addField("SeedValues",pas.System.$rtti["TArray<System.JSValue>"]);
    $r.addField("HasEmptySeed",rtl.boolean);
    $r.addField("CustomListEnabled",rtl.boolean);
    $r.addField("CustomListStep",rtl.longint);
    $r.addField("CustomListKey",rtl.string);
    $r.addField("CustomListBaseIndex",rtl.longint);
    $r.addField("CustomListFromEvent",rtl.boolean);
    $r.addField("EventCustomListValues",pas.System.$rtti["TArray<System.String>"]);
    $r.addField("EventCustomListCount",rtl.longint);
    $r.addField("DatePatternEnabled",rtl.boolean);
    $r.addField("DatePatternType",$mod.$rtti["TTMSFNCDataGridDataDatePatternType"]);
    $r.addField("DatePatternStep",rtl.longint);
    $r.addField("DatePatternBaseDate",pas.System.$rtti["TDateTime"]);
    $r.addField("LaneFillType",$mod.$rtti["TTMSFNCDataGridDataAutoFillType"]);
    $r.addField("LaneStep",rtl.double);
  });
  rtl.recNewT(this,"TTMSFNCDataGridDataAutoFillParams",function () {
    this.FillType = 0;
    this.Step = undefined;
    this.LaneCount = 0;
    this.$new = function () {
      var r = Object.create(this);
      r.Lanes = [];
      return r;
    };
    this.$eq = function (b) {
      return (this.FillType === b.FillType) && (this.Step === b.Step) && (this.LaneCount === b.LaneCount) && (this.Lanes === b.Lanes);
    };
    this.$assign = function (s) {
      this.FillType = s.FillType;
      this.Step = s.Step;
      this.LaneCount = s.LaneCount;
      this.Lanes = rtl.arrayRef(s.Lanes);
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCDataGridDataAutoFillParams",{},this);
    $r.addField("FillType",$mod.$rtti["TTMSFNCDataGridDataAutoFillType"]);
    $r.addField("Step",rtl.jsvalue);
    $r.addField("LaneCount",rtl.longint);
    $r.addField("Lanes",pas.System.$rtti["TArray<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataAutoFillLaneModel>"]);
  });
  this.$rtti.$MethodVar("TTMSFNCDataGridDataAutoFillCalculateValueEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["SourceCells",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoordRange"]],["SourceValues",pas.System.$rtti["TArray<System.JSValue>"]],["TargetCells",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoordRange"]],["FillIndex",rtl.longint],["Direction",this.$rtti["TTMSFNCDataGridDataAutoFillDirection"]],["NewValue",rtl.jsvalue,1],["Handled",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridDataBeforeApplyAutoFillEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["SourceCells",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoordRange"]],["SourceValues",pas.System.$rtti["TArray<System.JSValue>"]],["TargetCells",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoordRange"]],["TargetCell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["Direction",this.$rtti["TTMSFNCDataGridDataAutoFillDirection"]],["NewValue",rtl.jsvalue,1],["Accept",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridDataAfterApplyAutoFillEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["SourceCells",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoordRange"]],["SourceValues",pas.System.$rtti["TArray<System.JSValue>"]],["TargetCells",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoordRange"]],["TargetCell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["Direction",this.$rtti["TTMSFNCDataGridDataAutoFillDirection"]],["OldValue",rtl.jsvalue],["NewValue",rtl.jsvalue]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridDataAutoFillGetCustomListEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["BaseValue",rtl.string],["Values",pas.System.$rtti["TArray<System.String>"],1],["Handled",rtl.boolean,1]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCDataGridData",pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCore,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCore.$init.call(this);
      this.FAutoFillCustomLists = null;
      this.FAutoFillCustomListIndex = null;
      this.FAutoFillEnforceUniqueValues = false;
      this.FOnAutoFillCalculateValue = null;
      this.FOnBeforeApplyAutoFill = null;
      this.FOnAfterApplyAutoFill = null;
      this.FOnAutoFillGetCustomList = null;
      this.FFilterBuilder = null;
      this.FTempDataList = null;
      this.FFilterApplied = false;
      this.FAdapter = null;
      this.FBlockAdd = false;
      this.FDataDictionary = null;
      this.FColumnCalculationDictionary = null;
      this.FExpandAll = 0;
      this.FFilter = null;
      this.FFindCache = "";
      this.FFindCell = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      this.FFindParameters = {};
      this.FGroupDictionary = null;
      this.FGroupInfo = $mod.TTMSFNCDataGridDataGroupInfo.$new();
      this.FOnCustomColumnCalculation = null;
      this.FOnCustomCompare = null;
      this.FOnCustomRowCalculation = null;
      this.FOnGetCellData = null;
      this.FOnGetCellDataProperties = null;
      this.FOnGetCellDisplayValue = null;
      this.FOnGetCellFormatting = null;
      this.FOnGetColumnCalculationOptions = null;
      this.FOnGetCustomGroup = null;
      this.FOnGetGroupOptions = null;
      this.FOnGetRowCalculationOptions = null;
      this.FOnGetSortOptions = null;
      this.FOnLoadCellData = null;
      this.FOnRowCollapse = null;
      this.FOnRowExpand = null;
      this.FOnSaveCellData = null;
      this.FOptions = null;
      this.FRowCalculationDictionary = null;
      this.FSortIndexList = null;
      this.FUpdateGrouping = 0;
      this.FOnAfterSetRowCalculation = null;
      this.FOnAfterSetColumnCalculation = null;
      this.FOnBeforeSetRowCalculation = null;
      this.FOnBeforeSetColumnCalculation = null;
      this.FFilterActions = null;
    };
    this.$final = function () {
      this.FAutoFillCustomLists = undefined;
      this.FAutoFillCustomListIndex = undefined;
      this.FOnAutoFillCalculateValue = undefined;
      this.FOnBeforeApplyAutoFill = undefined;
      this.FOnAfterApplyAutoFill = undefined;
      this.FOnAutoFillGetCustomList = undefined;
      this.FFilterBuilder = undefined;
      this.FTempDataList = undefined;
      this.FAdapter = undefined;
      this.FDataDictionary = undefined;
      this.FColumnCalculationDictionary = undefined;
      this.FFilter = undefined;
      this.FFindCell = undefined;
      this.FFindParameters = undefined;
      this.FGroupDictionary = undefined;
      this.FGroupInfo = undefined;
      this.FOnCustomColumnCalculation = undefined;
      this.FOnCustomCompare = undefined;
      this.FOnCustomRowCalculation = undefined;
      this.FOnGetCellData = undefined;
      this.FOnGetCellDataProperties = undefined;
      this.FOnGetCellDisplayValue = undefined;
      this.FOnGetCellFormatting = undefined;
      this.FOnGetColumnCalculationOptions = undefined;
      this.FOnGetCustomGroup = undefined;
      this.FOnGetGroupOptions = undefined;
      this.FOnGetRowCalculationOptions = undefined;
      this.FOnGetSortOptions = undefined;
      this.FOnLoadCellData = undefined;
      this.FOnRowCollapse = undefined;
      this.FOnRowExpand = undefined;
      this.FOnSaveCellData = undefined;
      this.FOptions = undefined;
      this.FRowCalculationDictionary = undefined;
      this.FSortIndexList = undefined;
      this.FOnAfterSetRowCalculation = undefined;
      this.FOnAfterSetColumnCalculation = undefined;
      this.FOnBeforeSetRowCalculation = undefined;
      this.FOnBeforeSetColumnCalculation = undefined;
      this.FFilterActions = undefined;
      pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCore.$final.call(this);
    };
    this.GetCellData = function (AColumn, ARow) {
      var Result = null;
      var c = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var d = null;
      c.SetColumn(AColumn);
      c.SetRow(ARow);
      Result = null;
      d = this.GetTempDataList().Find(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow)));
      if (d != null) {
        Result = d}
       else {
        if (this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c))) Result = this.GetCellDataForRow(this.GetRowData(c.GetRow()),c.GetColumn(),c.GetRow(),false);
      };
      return Result;
    };
    this.GetDataDictionary = function () {
      var Result = null;
      if (!(this.FDataDictionary != null)) this.FDataDictionary = $mod.TTMSFNCDataGridDataDictionary.$create("Create$5",[rtl.createSet(pas["Generics.Collections"].TDictionaryOwnership.doOwnsValues)]);
      Result = this.FDataDictionary;
      return Result;
    };
    this.GetCellDataExtended = function (AColumn, ARow) {
      var Result = null;
      var c = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var cd = null;
      c.SetColumn(AColumn);
      c.SetRow(ARow);
      Result = null;
      if (this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c))) {
        cd = this.GetCellDataForRow(this.GetRowData(c.GetRow()),c.GetColumn(),c.GetRow(),true);
        if (pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd)) Result = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd);
      };
      return Result;
    };
    this.GetCell = function (AColumn, ARow) {
      var Result = undefined;
      var cd = null;
      cd = this.GetCellData(AColumn,ARow);
      Result = this.FetchData(cd,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow)));
      return Result;
    };
    this.GetColumnCalculation = function (AColumn, AName) {
      var Result = [];
      var l = null;
      Result = [];
      if (!this.IsColumnValid(AColumn)) return Result;
      if (this.GetColumnCalculationDictionary().ContainsKey(AColumn)) {
        l = this.GetColumnCalculationDictionary().GetItem(AColumn);
        if ((l != null) && l.ContainsKey(AName)) Result = rtl.arrayRef(l.GetItem(AName));
      };
      return Result;
    };
    this.GetColumnCalculationDictionary = function () {
      var Result = null;
      if (!(this.FColumnCalculationDictionary != null)) this.FColumnCalculationDictionary = $mod.TTMSFNCDataGridDataColumnCalculationDictionary.$create("Create$5",[rtl.createSet(pas["Generics.Collections"].TDictionaryOwnership.doOwnsValues)]);
      Result = this.FColumnCalculationDictionary;
      return Result;
    };
    this.GetControl = function (AColumn, ARow) {
      var Result = null;
      var cd = null;
      Result = null;
      cd = this.GetCellData(AColumn,ARow);
      if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd)) Result = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FControl;
      return Result;
    };
    this.GetFilter = function () {
      var Result = null;
      if (!(this.FFilter != null)) this.FFilter = $mod.TTMSFNCDataGridDataFilter.$create("Create$2",[this,$mod.TTMSFNCDataGridDataFilterData]);
      Result = this.FFilter;
      return Result;
    };
    this.GetFloat = function (AColumn, ARow) {
      var Result = 0.0;
      var fmt = pas.SysUtils.TFormatSettings.$new();
      var f = $mod.TTMSFNCDataGridDataFormatting.$new();
      var v = undefined;
      var cl = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var a = false;
      Result = 0.0;
      cl.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow));
      if (this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cl))) {
        v = this.GetCell(AColumn,ARow);
        f.$assign($mod.DefaultFormatting());
        fmt.$assign(pas.SysUtils.FormatSettings);
        a = true;
        this.DoGetCellFormatting(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cl),v,f,fmt,{get: function () {
            return a;
          }, set: function (v) {
            a = v;
          }});
        if (a) {
          Result = this.$class.ValueToFloat$1(v,pas.SysUtils.TFormatSettings.$clone(fmt))}
         else Result = this.$class.ValueToFloat$1(v,pas.SysUtils.TFormatSettings.$clone(pas.SysUtils.FormatSettings));
      };
      return Result;
    };
    this.GetGroupDictionary = function () {
      var Result = null;
      if (!(this.FGroupDictionary != null)) this.FGroupDictionary = $mod.TTMSFNCDataGridDataGroupDictionary.$create("Create$5",[rtl.createSet(pas["Generics.Collections"].TDictionaryOwnership.doOwnsValues)]);
      Result = this.FGroupDictionary;
      return Result;
    };
    this.GetHasCellData = function (AColumn, ARow) {
      var Result = false;
      var c = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var d = null;
      var r = null;
      c.SetColumn(AColumn);
      c.SetRow(ARow);
      Result = false;
      if (this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c))) {
        if (this.GetDataDictionary().TryGetValue(c.GetRow(),{get: function () {
            return r;
          }, set: function (v) {
            r = v;
          }})) {
          if ((r != null) && r.GetData().TryGetValue(c.GetColumn(),{get: function () {
              return d;
            }, set: function (v) {
              d = v;
            }})) Result = d != null;
        };
      };
      return Result;
    };
    this.GetHasMergeInfo = function (AColumn, ARow) {
      var Result = false;
      var cd = null;
      Result = false;
      cd = this.GetCellData(AColumn,ARow);
      if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd)) Result = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).HasMergeInfo();
      return Result;
    };
    this.GetInt = function (AColumn, ARow) {
      var Result = 0;
      var fmt = pas.SysUtils.TFormatSettings.$new();
      var f = $mod.TTMSFNCDataGridDataFormatting.$new();
      var v = undefined;
      var cl = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var a = false;
      Result = 0;
      cl.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow));
      if (this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cl))) {
        v = this.GetCell(AColumn,ARow);
        f.$assign($mod.DefaultFormatting());
        fmt.$assign(pas.SysUtils.FormatSettings);
        a = true;
        this.DoGetCellFormatting(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cl),v,f,fmt,{get: function () {
            return a;
          }, set: function (v) {
            a = v;
          }});
        if (a) {
          Result = this.$class.ValueToInt64$1(v,pas.SysUtils.TFormatSettings.$clone(fmt))}
         else Result = this.$class.ValueToInt64$1(v,pas.SysUtils.TFormatSettings.$clone(pas.SysUtils.FormatSettings));
      };
      return Result;
    };
    this.GetManagedObject = function (AColumn, ARow) {
      var Result = null;
      var cd = null;
      Result = null;
      cd = this.GetCellData(AColumn,ARow);
      if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd)) Result = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FManagedObject;
      return Result;
    };
    this.GetMergeInfo = function (AColumn, ARow) {
      var Result = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellMergeInfo.$new();
      var cd = null;
      Result.$assign(pas["WEBLib.TMSFNCDataGridCell"].DefaultMergeInfo());
      cd = this.GetCellData(AColumn,ARow);
      if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd)) Result.$assign(pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FMergeInfo);
      return Result;
    };
    this.GetObj = function (AColumn, ARow) {
      var Result = null;
      var cd = null;
      Result = null;
      cd = this.GetCellData(AColumn,ARow);
      if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd)) Result = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FObject;
      return Result;
    };
    this.GetRowCalculation = function (ARow, AName) {
      var Result = [];
      var l = null;
      Result = [];
      if (!this.IsRowValid(ARow)) return Result;
      if (this.GetRowCalculationDictionary().ContainsKey(ARow)) {
        l = this.GetRowCalculationDictionary().GetItem(ARow);
        if ((l != null) && l.ContainsKey(AName)) Result = rtl.arrayRef(l.GetItem(AName));
      };
      return Result;
    };
    this.GetRowCalculationDictionary = function () {
      var Result = null;
      if (!(this.FRowCalculationDictionary != null)) this.FRowCalculationDictionary = $mod.TTMSFNCDataGridDataRowCalculationDictionary.$create("Create$5",[rtl.createSet(pas["Generics.Collections"].TDictionaryOwnership.doOwnsValues)]);
      Result = this.FRowCalculationDictionary;
      return Result;
    };
    this.GetRowNodeChildCount = function (ARow) {
      var Result = 0;
      var ri = null;
      Result = -1;
      ri = this.GetRowData(ARow);
      if (ri != null) Result = ri.FNodeChildCount;
      return Result;
    };
    this.GetRowNodeLevel = function (ARow) {
      var Result = 0;
      var ri = null;
      Result = -1;
      ri = this.GetRowData(ARow);
      if (ri != null) Result = ri.FNodeLevel;
      return Result;
    };
    this.GetRowNodeState = function (ARow) {
      var Result = 0;
      var ri = null;
      Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowNodeState.grnsExpanded;
      ri = this.GetRowData(ARow);
      if (ri != null) Result = ri.FNodeState;
      return Result;
    };
    this.GetRowText = function (ARow) {
      var Result = "";
      var I = 0;
      var sl = null;
      var o = $mod.TTMSFNCDataGridDataInputOutputOptions.$new();
      Result = "";
      if (!this.IsRowValid(ARow)) return Result;
      sl = pas.Classes.TStringList.$create("Create$1");
      try {
        o.$assign(this.GetIOOptions());
        if (o.Delimiter === "\x00") {
          sl.SetDelimiter(",")}
         else sl.SetDelimiter(o.Delimiter);
        for (var $l = 0, $end = this.FColumnCount - 1; $l <= $end; $l++) {
          I = $l;
          sl.Add(this.GetString(I,ARow));
        };
        Result = sl.GetDelimitedText();
      } finally {
        sl = rtl.freeLoc(sl);
      };
      return Result;
    };
    this.GetRowType = function (ARow) {
      var Result = 0;
      var ri = null;
      Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowType.grtDefault;
      ri = this.GetRowData(ARow);
      if (ri != null) Result = ri.FType;
      return Result;
    };
    this.GetSortIndexList = function () {
      var Result = null;
      if (!(this.FSortIndexList != null)) this.FSortIndexList = $mod.TTMSFNCDataGridSortIndexList.$create("Create$4",[true]);
      Result = this.FSortIndexList;
      return Result;
    };
    this.GetStoredCell = function (AColumn, ARow) {
      var Result = undefined;
      var cd = null;
      Result = null;
      cd = this.GetCellData(AColumn,ARow);
      if (cd != null) Result = cd.FValue;
      return Result;
    };
    this.GetString = function (AColumn, ARow) {
      var Result = "";
      Result = this.FormatDisplayValue(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow)),this.GetCell(AColumn,ARow));
      return Result;
    };
    this.GetStrippedCell = function (AColumn, ARow) {
      var Result = "";
      Result = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.HTMLStrip(this.GetString(AColumn,ARow));
      return Result;
    };
    this.GetHasColumnCalculation = function (AColumn, AName) {
      var Result = false;
      var l = null;
      var cma = [];
      Result = false;
      if (this.GetColumnCalculationDictionary().TryGetValue(AColumn,{get: function () {
          return l;
        }, set: function (v) {
          l = v;
        }})) if ((l != null) && l.TryGetValue(AName,{get: function () {
          return cma;
        }, set: function (v) {
          cma = v;
        }})) Result = rtl.length(cma) > 0;
      return Result;
    };
    this.GetHasRowCalculation = function (ARow, AName) {
      var Result = false;
      var l = null;
      var cma = [];
      Result = false;
      if (this.GetRowCalculationDictionary().TryGetValue(ARow,{get: function () {
          return l;
        }, set: function (v) {
          l = v;
        }})) if ((l != null) && l.TryGetValue(AName,{get: function () {
          return cma;
        }, set: function (v) {
          cma = v;
        }})) Result = rtl.length(cma) > 0;
      return Result;
    };
    this.GetTempDataList = function () {
      var Result = null;
      if (!(this.FTempDataList != null)) this.FTempDataList = $mod.TTMSFNCDataGridDataTempDataList.$create("Create$4",[true]);
      Result = this.FTempDataList;
      return Result;
    };
    this.SetAdapter = function (Value) {
      if (this.FAdapter !== Value) {
        this.FAdapter = Value;
        if (this.FBlockAdd) return;
        this.FBlockAdd = true;
        if (this.FAdapter != null) {
          this.FAdapter.SetDataInstance(this);
          this.FAdapter.Initialize();
        };
        this.FBlockAdd = false;
      };
    };
    this.SetCell = function (AColumn, ARow, Value) {
      var cd = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      cd = this.GetCellData(AColumn,ARow);
      if (cd != null) {
        cd.SetValue(Value);
        if ((this.FAdapter != null) && $mod.TTMSFNCDataGridDataAdapter.isPrototypeOf(this.FAdapter)) rtl.as(this.FAdapter,$mod.TTMSFNCDataGridDataAdapter).SetCellData(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow)),Value);
        this.DoUpdate();
      };
    };
    this.SetColumnCalculation = function (AColumn, AName, Value) {
      var l = null;
      if (!this.IsColumnValid(AColumn)) return;
      if (this.GetColumnCalculationDictionary().ContainsKey(AColumn)) {
        l = this.GetColumnCalculationDictionary().GetItem(AColumn)}
       else {
        l = pas["Generics.Collections"].TDictionary$$$G$$generics$collections$$String$$TTMSFNCDataGridDataColumnCalculationArray.$create("Create$1",[0]);
        this.GetColumnCalculationDictionary().Add(AColumn,l);
      };
      if (l != null) {
        if (l.ContainsKey(AName)) {
          if (rtl.length(Value) === 0) {
            l.Remove(AName);
            if (l.GetCount() === 0) this.GetColumnCalculationDictionary().Remove(AColumn);
          } else l.SetItem(AName,Value);
        } else if (rtl.length(Value) > 0) l.Add(AName,Value);
      };
      this.UpdateColumnCalculation(AColumn,AName);
    };
    this.SetControl = function (AColumn, ARow, Value) {
      var cd = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      cd = this.GetCellDataExtended(AColumn,ARow);
      if (cd != null) {
        this.RemoveCellControlFromCache(AColumn,ARow);
        if ((cd.FControl != null) && (cd.FControl !== Value)) cd.FControl.SetParent(null);
        cd.FControl = Value;
        if (Value != null) Value.SetParent(null);
        this.DoUpdate();
      };
    };
    this.SetFloat = function (AColumn, ARow, Value) {
      this.SetCell(AColumn,ARow,Value);
    };
    this.SetInt = function (AColumn, ARow, Value) {
      this.SetCell(AColumn,ARow,Value);
    };
    this.SetManagedObject = function (AColumn, ARow, Value) {
      var cd = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      cd = this.GetCellDataExtended(AColumn,ARow);
      if (cd != null) {
        cd.FManagedObject = Value;
        this.DoUpdate();
      };
    };
    this.SetMergeInfo = function (AColumn, ARow, Value) {
      var cd = null;
      cd = this.GetCellDataExtended(AColumn,ARow);
      if (cd != null) {
        cd.FMergeInfo.$assign(Value);
        this.DoUpdate();
      };
    };
    this.SetObj = function (AColumn, ARow, Value) {
      var cd = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      cd = this.GetCellDataExtended(AColumn,ARow);
      if (cd != null) {
        cd.FObject = Value;
        this.DoUpdate();
      };
    };
    this.SetOptions = function (Value) {
      this.FOptions.Assign(Value);
    };
    this.SetRowCalculation = function (ARow, AName, Value) {
      var l = null;
      if (!this.IsRowValid(ARow)) return;
      if (this.GetRowCalculationDictionary().ContainsKey(ARow)) {
        l = this.GetRowCalculationDictionary().GetItem(ARow)}
       else {
        l = pas["Generics.Collections"].TDictionary$$$G$$generics$collections$$String$$TTMSFNCDataGridDataRowCalculationArray.$create("Create$1",[0]);
        this.GetRowCalculationDictionary().Add(ARow,l);
      };
      if (l != null) {
        if (l.ContainsKey(AName)) {
          if (rtl.length(Value) === 0) {
            l.Remove(AName);
            if (l.GetCount() === 0) this.GetRowCalculationDictionary().Remove(ARow);
          } else l.SetItem(AName,Value);
        } else if (rtl.length(Value) > 0) l.Add(AName,Value);
      };
      this.UpdateRowCalculation(ARow,AName);
    };
    this.SetRowNodeChildCount = function (ARow, Value) {
      var ri = null;
      if (!this.IsRowValid(ARow)) return;
      ri = this.GetRowData(ARow);
      if (ri != null) ri.FNodeChildCount = Value;
    };
    this.SetRowNodeLevel = function (ARow, Value) {
      var ri = null;
      if (!this.IsRowValid(ARow)) return;
      ri = this.GetRowData(ARow);
      if (ri != null) ri.FNodeLevel = Value;
    };
    this.SetRowNodeState = function (ARow, Value) {
      var ri = null;
      if (!this.IsRowValid(ARow)) return;
      ri = this.GetRowData(ARow);
      if (ri != null) ri.FNodeState = Value;
    };
    this.SetRowText = function (ARow, Value) {
      var sl = null;
      var I = 0;
      var sc = 0;
      var del = "\x00";
      var o = $mod.TTMSFNCDataGridDataInputOutputOptions.$new();
      if (!this.IsRowValid(ARow)) return;
      sl = pas.Classes.TStringList.$create("Create$1");
      try {
        o.$assign(this.GetIOOptions());
        del = o.Delimiter;
        pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.Split(del,Value,sl,false);
        if (del === "\x00") {
          if (sl.GetCount() > 1) {
            del = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetBestDelimiter(sl.Get(0),sl.Get(1),false)}
           else if (sl.GetCount() > 0) del = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetBestDelimiter(sl.Get(0),"",false);
          pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.Split(del,Value,sl,false);
        };
        sc = o.StartColumn;
        for (var $l = sc, $end = (sc + sl.GetCount()) - 1; $l <= $end; $l++) {
          I = $l;
          this.SetCell(I,ARow,sl.Get(I - sc));
        };
      } finally {
        sl = rtl.freeLoc(sl);
      };
    };
    this.SetRowType = function (ARow, Value) {
      var ri = null;
      if (!this.IsRowValid(ARow)) return;
      ri = this.GetRowData(ARow);
      if (ri != null) ri.FType = Value;
    };
    this.SetString = function (AColumn, ARow, Value) {
      this.SetCell(AColumn,ARow,Value);
    };
    this.GetFilterBuilder = function () {
      var Result = null;
      if (!(this.FFilterBuilder != null)) {
        this.FFilterBuilder = pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilder.$create("Create$1");
        this.FFilterBuilder.SetFormatType(pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderFormatType.fftUniversalFilterExpressions);
      };
      if (this.FFilterBuilder != null) {
        this.FFilterBuilder.SetFormatType(pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderFormatType.fftUniversalFilterExpressions);
        if (this.FAdapter != null) {
          var $tmp = this.FAdapter.FilterMode();
          if ($tmp === $mod.TTMSFNCDataGridDataAdapterFilterMode.afmAdapter) this.FFilterBuilder.SetFormatType(pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderFormatType.fftDelphiDataSet);
        };
      };
      Result = this.FFilterBuilder;
      return Result;
    };
    this.SetFilterActions = function (Value) {
      this.FFilterActions.Assign(Value);
    };
    this.GetHasFilter = function () {
      var Result = false;
      Result = false;
      if (this.FFilterApplied) {
        if (this.FOptions.FFiltering.FAdvanced) {
          Result = !this.GetFilterBuilder().GetIsEmpty()}
         else Result = this.GetFilter().GetCount() !== 0;
      };
      return Result;
    };
    this.NormalizeCustomListValue = function (S) {
      var Result = "";
      Result = pas.SysUtils.UpperCase(pas.SysUtils.Trim(S));
      return Result;
    };
    this.RebuildCustomListIndexForKey = function (AKey, AValues) {
      var i = 0;
      var norm = "";
      var existing = $mod.TTMSFNCDataGridDataCustomListIndexEntry.$new();
      var entry = $mod.TTMSFNCDataGridDataCustomListIndexEntry.$new();
      this.RemoveCustomListIndexForKey(AKey);
      for (var $l = 0, $end = rtl.length(AValues) - 1; $l <= $end; $l++) {
        i = $l;
        norm = this.NormalizeCustomListValue(AValues[i]);
        if (norm === "") continue;
        if (this.FAutoFillCustomListIndex.TryGetValue(norm,existing)) {
          if (this.FAutoFillEnforceUniqueValues && !pas.SysUtils.SameText(existing.Key,AKey)) throw pas.SysUtils.Exception.$create("CreateFmt",['AutoFill custom list value "%s" already exists in list "%s".',pas.System.VarRecs(18,AValues[i],18,existing.Key)]);
        };
        entry.Key = AKey;
        entry.Index = i;
        this.FAutoFillCustomListIndex.AddOrSetValue(norm,entry);
      };
    };
    this.RemoveCustomListIndexForKey = function (AKey) {
      var keysToRemove = [];
      var k = "";
      var entry = $mod.TTMSFNCDataGridDataCustomListIndexEntry.$new();
      var n = 0;
      n = 0;
      keysToRemove = rtl.arraySetLength(keysToRemove,"",0);
      var $in = this.FAutoFillCustomListIndex.GetKeys().GetEnumerator$1();
      try {
        while ($in.MoveNext$1()) {
          k = $in.GetCurrent();
          entry.$assign(this.FAutoFillCustomListIndex.GetItem(k));
          if (pas.SysUtils.SameText(entry.Key,AKey)) {
            keysToRemove = rtl.arraySetLength(keysToRemove,"",n + 1);
            keysToRemove[n] = k;
            n += 1;
          };
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      for (var $in1 = keysToRemove, $l = 0, $end = rtl.length($in1) - 1; $l <= $end; $l++) {
        k = $in1[$l];
        this.FAutoFillCustomListIndex.Remove(k);
      };
    };
    this.TryGetCustomListFromEvent = function (ABaseValue, AValues) {
      var Result = false;
      var handled = false;
      AValues.set(rtl.arraySetLength(AValues.get(),"",0));
      if (!(this.FOnAutoFillGetCustomList != null)) return false;
      handled = false;
      this.DoAutoFillGetCustomList(ABaseValue,AValues,{get: function () {
          return handled;
        }, set: function (v) {
          handled = v;
        }});
      Result = handled && (rtl.length(AValues.get()) > 0);
      return Result;
    };
    this.TryFindIndexInArray = function (ABaseValue, AValues, AIndex) {
      var Result = false;
      var i = 0;
      AIndex.set(-1);
      for (var $l = 0, $end = rtl.length(AValues) - 1; $l <= $end; $l++) {
        i = $l;
        if (pas.SysUtils.SameText(ABaseValue,AValues[i])) {
          AIndex.set(i);
          return true;
        };
      };
      Result = false;
      return Result;
    };
    this.CalculateCustomListValueLaneAware = function (ABaseValue, AFillIndex, AStep, AFormatSettings, ALane, ASeedPosInLane) {
      var $Self = this;
      var Result = "";
      var stepInt = 0;
      var caseType = 0;
      var listValues = [];
      var baseIdx = 0;
      var newIdx = 0;
      var n = 0;
      var i = 0;
      var calculation = 0;
      function DetectCasePattern(S) {
        var Result = 0;
        if (S.length === 0) return 0;
        if ((S === pas.SysUtils.UpperCase(S)) && (S !== pas.SysUtils.LowerCase(S))) return 1;
        if ((S === pas.SysUtils.LowerCase(S)) && (S !== pas.SysUtils.UpperCase(S))) return 2;
        if ((S.charAt(0) === pas.System.upcase(S.charAt(0))) && (S.length > 1) && (pas.System.Copy$1(S,2) === pas.SysUtils.LowerCase(pas.System.Copy$1(S,2)))) return 3;
        Result = 0;
        return Result;
      };
      function ApplyCasePattern(S, CaseType) {
        var Result = "";
        var $tmp = CaseType;
        if ($tmp === 1) {
          Result = pas.SysUtils.UpperCase(S)}
         else if ($tmp === 2) {
          Result = pas.SysUtils.LowerCase(S)}
         else if ($tmp === 3) {
          Result = pas.SysUtils.UpperCase(S.charAt(0)) + pas.SysUtils.LowerCase(pas.System.Copy$1(S,2))}
         else {
          Result = S;
        };
        return Result;
      };
      Result = ABaseValue;
      stepInt = AStep;
      if (stepInt === 0) stepInt = 1;
      if (ALane.CustomListEnabled && ALane.CustomListFromEvent) {
        if (ALane.EventCustomListCount > 0) {
          baseIdx = -1;
          for (var $l = 0, $end = ALane.EventCustomListCount - 1; $l <= $end; $l++) {
            i = $l;
            if (pas.SysUtils.SameText(ABaseValue,ALane.EventCustomListValues[i])) {
              baseIdx = i;
              break;
            };
          };
          if (baseIdx < 0) baseIdx = 0;
          n = ALane.EventCustomListCount;
          calculation = baseIdx + (stepInt * AFillIndex);
          newIdx = calculation % n;
          if (newIdx < 0) newIdx += n;
          return ALane.EventCustomListValues[newIdx];
        };
        return ABaseValue;
      };
      if (ALane.CustomListEnabled && !ALane.CustomListFromEvent && (ALane.CustomListKey !== "")) {
        if (this.FAutoFillCustomLists.TryGetValue(ALane.CustomListKey,{get: function () {
            return listValues;
          }, set: function (v) {
            listValues = v;
          }}) && (rtl.length(listValues) > 0)) {
          baseIdx = ALane.CustomListBaseIndex;
          if ((baseIdx < 0) && !this.TryFindIndexInArray(ABaseValue,listValues,{get: function () {
              return baseIdx;
            }, set: function (v) {
              baseIdx = v;
            }})) baseIdx = 0;
          n = rtl.length(listValues);
          newIdx = (baseIdx + (stepInt * AFillIndex)) % n;
          if (newIdx < 0) newIdx += n;
          return listValues[newIdx];
        };
      };
      caseType = DetectCasePattern(ABaseValue);
      Result = this.CalculateBuiltInDayMonthListValue(ABaseValue,AFillIndex,stepInt,AFormatSettings);
      if (!pas.SysUtils.SameText(Result,ABaseValue)) {
        Result = ApplyCasePattern(Result,caseType)}
       else Result = ABaseValue;
      return Result;
    };
    this.CalculateBuiltInDayMonthListValue = function (ABaseValue, AFillIndex, AStep, AFormatSettings) {
      var Result = "";
      var baseIndex = 0;
      var newIndex = 0;
      var i = 0;
      var stepInt = 0;
      Result = ABaseValue;
      stepInt = AStep;
      if (stepInt === 0) stepInt = 1;
      baseIndex = -1;
      for (i = 1; i <= 7; i++) {
        if (pas.SysUtils.SameText(ABaseValue,AFormatSettings.LongDayNames[i - 1])) {
          baseIndex = i - 1;
          break;
        };
      };
      if (baseIndex >= 0) {
        newIndex = (baseIndex + (stepInt * AFillIndex)) % 7;
        if (newIndex < 0) newIndex = newIndex + 7;
        return AFormatSettings.LongDayNames[(newIndex + 1) - 1];
      };
      baseIndex = -1;
      for (i = 1; i <= 7; i++) {
        if (pas.SysUtils.SameText(ABaseValue,AFormatSettings.ShortDayNames[i - 1])) {
          baseIndex = i - 1;
          break;
        };
      };
      if (baseIndex >= 0) {
        newIndex = (baseIndex + (stepInt * AFillIndex)) % 7;
        if (newIndex < 0) newIndex = newIndex + 7;
        return AFormatSettings.ShortDayNames[(newIndex + 1) - 1];
      };
      baseIndex = -1;
      for (i = 1; i <= 7; i++) {
        if (pas.SysUtils.SameText(ABaseValue,$impl.EnglishLongDayNames[i - 1])) {
          baseIndex = i - 1;
          break;
        };
      };
      if (baseIndex >= 0) {
        newIndex = (baseIndex + (stepInt * AFillIndex)) % 7;
        if (newIndex < 0) newIndex = newIndex + 7;
        return $impl.EnglishLongDayNames[(newIndex + 1) - 1];
      };
      baseIndex = -1;
      for (i = 1; i <= 7; i++) {
        if (pas.SysUtils.SameText(ABaseValue,$impl.EnglishShortDayNames[i - 1])) {
          baseIndex = i - 1;
          break;
        };
      };
      if (baseIndex >= 0) {
        newIndex = (baseIndex + (stepInt * AFillIndex)) % 7;
        if (newIndex < 0) newIndex = newIndex + 7;
        return $impl.EnglishShortDayNames[(newIndex + 1) - 1];
      };
      baseIndex = -1;
      for (i = 1; i <= 12; i++) {
        if (pas.SysUtils.SameText(ABaseValue,AFormatSettings.LongMonthNames[i - 1])) {
          baseIndex = i - 1;
          break;
        };
      };
      if (baseIndex >= 0) {
        newIndex = (baseIndex + (stepInt * AFillIndex)) % 12;
        if (newIndex < 0) newIndex = newIndex + 12;
        return AFormatSettings.LongMonthNames[(newIndex + 1) - 1];
      };
      baseIndex = -1;
      for (i = 1; i <= 12; i++) {
        if (pas.SysUtils.SameText(ABaseValue,AFormatSettings.ShortMonthNames[i - 1])) {
          baseIndex = i - 1;
          break;
        };
      };
      if (baseIndex >= 0) {
        newIndex = (baseIndex + (stepInt * AFillIndex)) % 12;
        if (newIndex < 0) newIndex = newIndex + 12;
        return AFormatSettings.ShortMonthNames[(newIndex + 1) - 1];
      };
      baseIndex = -1;
      for (i = 1; i <= 12; i++) {
        if (pas.SysUtils.SameText(ABaseValue,$impl.EnglishLongMonthNames[i - 1])) {
          baseIndex = i - 1;
          break;
        };
      };
      if (baseIndex >= 0) {
        newIndex = (baseIndex + (stepInt * AFillIndex)) % 12;
        if (newIndex < 0) newIndex = newIndex + 12;
        return $impl.EnglishLongMonthNames[(newIndex + 1) - 1];
      };
      baseIndex = -1;
      for (i = 1; i <= 12; i++) {
        if (pas.SysUtils.SameText(ABaseValue,$impl.EnglishShortMonthNames[i - 1])) {
          baseIndex = i - 1;
          break;
        };
      };
      if (baseIndex >= 0) {
        newIndex = (baseIndex + (stepInt * AFillIndex)) % 12;
        if (newIndex < 0) newIndex = newIndex + 12;
        return $impl.EnglishShortMonthNames[(newIndex + 1) - 1];
      };
      Result = ABaseValue;
      return Result;
    };
    this.DoAutoFillCalculateValue = function (SourceCells, SourceValues, TargetCells, FillIndex, Direction, NewValue, Handled) {
      if (this.FOnAutoFillCalculateValue != null) this.FOnAutoFillCalculateValue(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoordRange.$clone(SourceCells),rtl.arrayRef(SourceValues),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoordRange.$clone(TargetCells),FillIndex,Direction,NewValue,Handled);
    };
    this.DoBeforeApplyAutoFill = function (SourceCells, SourceValues, TargetCells, TargetCell, Direction, NewValue, Accept) {
      if (this.FOnBeforeApplyAutoFill != null) this.FOnBeforeApplyAutoFill(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoordRange.$clone(SourceCells),rtl.arrayRef(SourceValues),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoordRange.$clone(TargetCells),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(TargetCell),Direction,NewValue,Accept);
    };
    this.DoAfterApplyAutoFill = function (SourceCells, SourceValues, TargetCells, TargetCell, Direction, OldValue, NewValue) {
      if (this.FOnAfterApplyAutoFill != null) this.FOnAfterApplyAutoFill(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoordRange.$clone(SourceCells),rtl.arrayRef(SourceValues),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoordRange.$clone(TargetCells),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(TargetCell),Direction,OldValue,NewValue);
    };
    this.DoAutoFillGetCustomList = function (BaseValue, Values, Handled) {
      if (this.FOnAutoFillGetCustomList != null) this.FOnAutoFillGetCustomList(this,BaseValue,Values,Handled);
    };
    this.GetDataRowCount = function () {
      var Result = 0;
      Result = this.FRowCount - this.FFixedRowCount - this.FFixedBottomRowCount;
      return Result;
    };
    this.SetDataColumnCount = function (AValue) {
      this.SetColumnCount(AValue + this.FFixedColumnCount + this.FFixedRightColumnCount);
    };
    this.SetDataRowCount = function (AValue) {
      this.SetRowCount(this.FFixedRowCount + this.FFixedBottomRowCount + AValue);
    };
    this.SetDataValue = function (AColumn, ARow, AValue) {
      this.SetCell(AColumn + this.FFixedColumnCount,ARow + this.FFixedRowCount,AValue);
    };
    this.SetDataHeader = function (AColumn, AValue) {
      this.SetCell(AColumn + this.FFixedColumnCount,0,AValue);
    };
    this.DataBeginUpdate = function () {
      this.BeginUpdate();
    };
    this.DataEndUpdate = function () {
      this.EndUpdate();
    };
    this.DataInsertRow = function (AInsertPosition) {
      this.InsertRow(AInsertPosition);
    };
    this.DataClearData = function () {
      this.Clear();
    };
    this.CalculateCustomListValue = function (ABaseValue, AFillIndex, AStep, AFormatSettings) {
      var $Self = this;
      var Result = "";
      var baseIndex = 0;
      var newIndex = 0;
      var i = 0;
      var stepInt = 0;
      function DetectCasePattern(S) {
        var Result = 0;
        if (S.length === 0) return 0;
        if ((S === pas.SysUtils.UpperCase(S)) && (S !== pas.SysUtils.LowerCase(S))) return 1;
        if ((S === pas.SysUtils.LowerCase(S)) && (S !== pas.SysUtils.UpperCase(S))) return 2;
        if ((S.charAt(0) === pas.System.upcase(S.charAt(0))) && (S.length > 1) && (pas.System.Copy$1(S,2) === pas.SysUtils.LowerCase(pas.System.Copy$1(S,2)))) return 3;
        Result = 0;
        return Result;
      };
      function ApplyCasePattern(S, CaseType) {
        var Result = "";
        var $tmp = CaseType;
        if ($tmp === 1) {
          Result = pas.SysUtils.UpperCase(S)}
         else if ($tmp === 2) {
          Result = pas.SysUtils.LowerCase(S)}
         else if ($tmp === 3) {
          Result = pas.SysUtils.UpperCase(S.charAt(0)) + pas.SysUtils.LowerCase(pas.System.Copy$1(S,2))}
         else {
          Result = S;
        };
        return Result;
      };
      Result = ABaseValue;
      stepInt = AStep;
      baseIndex = -1;
      for (i = 1; i <= 7; i++) {
        if (pas.SysUtils.SameText(ABaseValue,AFormatSettings.LongDayNames[i - 1])) {
          baseIndex = i - 1;
          break;
        };
      };
      if (baseIndex >= 0) {
        newIndex = (baseIndex + (stepInt * AFillIndex)) % 7;
        if (newIndex < 0) newIndex = newIndex + 7;
        Result = AFormatSettings.LongDayNames[(newIndex + 1) - 1];
        Result = ApplyCasePattern(Result,DetectCasePattern(ABaseValue));
        return Result;
      };
      baseIndex = -1;
      for (i = 1; i <= 7; i++) {
        if (pas.SysUtils.SameText(ABaseValue,AFormatSettings.ShortDayNames[i - 1])) {
          baseIndex = i - 1;
          break;
        };
      };
      if (baseIndex >= 0) {
        newIndex = (baseIndex + (stepInt * AFillIndex)) % 7;
        if (newIndex < 0) newIndex = newIndex + 7;
        Result = AFormatSettings.ShortDayNames[(newIndex + 1) - 1];
        Result = ApplyCasePattern(Result,DetectCasePattern(ABaseValue));
        return Result;
      };
      baseIndex = -1;
      for (i = 1; i <= 7; i++) {
        if (pas.SysUtils.SameText(ABaseValue,$impl.EnglishLongDayNames[i - 1])) {
          baseIndex = i - 1;
          break;
        };
      };
      if (baseIndex >= 0) {
        newIndex = (baseIndex + (stepInt * AFillIndex)) % 7;
        if (newIndex < 0) newIndex = newIndex + 7;
        Result = $impl.EnglishLongDayNames[(newIndex + 1) - 1];
        Result = ApplyCasePattern(Result,DetectCasePattern(ABaseValue));
        return Result;
      };
      baseIndex = -1;
      for (i = 1; i <= 7; i++) {
        if (pas.SysUtils.SameText(ABaseValue,$impl.EnglishShortDayNames[i - 1])) {
          baseIndex = i - 1;
          break;
        };
      };
      if (baseIndex >= 0) {
        newIndex = (baseIndex + (stepInt * AFillIndex)) % 7;
        if (newIndex < 0) newIndex = newIndex + 7;
        Result = $impl.EnglishShortDayNames[(newIndex + 1) - 1];
        Result = ApplyCasePattern(Result,DetectCasePattern(ABaseValue));
        return Result;
      };
      baseIndex = -1;
      for (i = 1; i <= 12; i++) {
        if (pas.SysUtils.SameText(ABaseValue,AFormatSettings.LongMonthNames[i - 1])) {
          baseIndex = i - 1;
          break;
        };
      };
      if (baseIndex >= 0) {
        newIndex = (baseIndex + (stepInt * AFillIndex)) % 12;
        if (newIndex < 0) newIndex = newIndex + 12;
        Result = AFormatSettings.LongMonthNames[(newIndex + 1) - 1];
        Result = ApplyCasePattern(Result,DetectCasePattern(ABaseValue));
        return Result;
      };
      baseIndex = -1;
      for (i = 1; i <= 12; i++) {
        if (pas.SysUtils.SameText(ABaseValue,AFormatSettings.ShortMonthNames[i - 1])) {
          baseIndex = i - 1;
          break;
        };
      };
      if (baseIndex >= 0) {
        newIndex = (baseIndex + (stepInt * AFillIndex)) % 12;
        if (newIndex < 0) newIndex = newIndex + 12;
        Result = AFormatSettings.ShortMonthNames[(newIndex + 1) - 1];
        Result = ApplyCasePattern(Result,DetectCasePattern(ABaseValue));
        return Result;
      };
      baseIndex = -1;
      for (i = 1; i <= 12; i++) {
        if (pas.SysUtils.SameText(ABaseValue,$impl.EnglishLongMonthNames[i - 1])) {
          baseIndex = i - 1;
          break;
        };
      };
      if (baseIndex >= 0) {
        newIndex = (baseIndex + (stepInt * AFillIndex)) % 12;
        if (newIndex < 0) newIndex = newIndex + 12;
        Result = $impl.EnglishLongMonthNames[(newIndex + 1) - 1];
        Result = ApplyCasePattern(Result,DetectCasePattern(ABaseValue));
        return Result;
      };
      baseIndex = -1;
      for (i = 1; i <= 12; i++) {
        if (pas.SysUtils.SameText(ABaseValue,$impl.EnglishShortMonthNames[i - 1])) {
          baseIndex = i - 1;
          break;
        };
      };
      if (baseIndex >= 0) {
        newIndex = (baseIndex + (stepInt * AFillIndex)) % 12;
        if (newIndex < 0) newIndex = newIndex + 12;
        Result = $impl.EnglishShortMonthNames[(newIndex + 1) - 1];
        Result = ApplyCasePattern(Result,DetectCasePattern(ABaseValue));
      };
      return Result;
    };
    this.CalculateAutoFillValue = function (ASourceValue, ASourceCells, ASourceValues, ATargetCells, AParams, AFillIndex, ALaneIndex, ASeedPosInLane, ADirection, AFormatSettings) {
      var $Self = this;
      var Result = undefined;
      var fmt = pas.SysUtils.TFormatSettings.$new();
      var effectiveIndex = 0;
      var intVal = 0;
      var floatVal = 0.0;
      var dateVal = 0.0;
      var stepInt = 0;
      var stepFloat = 0.0;
      var stepDate = 0.0;
      var stepKind = 0;
      var k = 0;
      var y = 0.0;
      var baseNum = 0;
      var outNum = 0;
      var nextIndex = 0;
      var stepForCustomList = 0;
      var timeStepApplied = false;
      var seed0 = "";
      var seed1 = "";
      var dt0 = 0.0;
      var dt1 = 0.0;
      var handled = false;
      var stepDT = 0.0;
      var tmpValue = undefined;
      function FormatNumberWithWidth(N, Width) {
        var Result = "";
        if (Width > 1) {
          Result = pas.SysUtils.Format("%.*d",pas.System.VarRecs(0,Width,19,N))}
         else Result = pas.SysUtils.IntToStr(N);
        return Result;
      };
      function FormatDatePreservingOriginal(AOriginal, ANewDate, fmt) {
        var Result = "";
        var hasSlash = false;
        var hasDash = false;
        var hasSpace = false;
        var hasComma = false;
        var hasColon = false;
        var shortYear = false;
        var timeOnly = false;
        var hasSeconds = false;
        var colonCount = 0;
        var i = 0;
        hasSlash = pas.System.Pos("/",AOriginal) > 0;
        hasDash = pas.System.Pos("-",AOriginal) > 0;
        hasSpace = pas.System.Pos(" ",AOriginal) > 0;
        hasComma = pas.System.Pos(",",AOriginal) > 0;
        hasColon = pas.System.Pos(":",AOriginal) > 0;
        shortYear = (pas.System.Pos("/2",AOriginal) === 0) && (pas.System.Pos("-2",AOriginal) === 0);
        timeOnly = hasColon && !hasSlash && !hasDash;
        colonCount = 0;
        for (var $l = 1, $end = AOriginal.length; $l <= $end; $l++) {
          i = $l;
          if (AOriginal.charAt(i - 1) === ":") colonCount += 1;
        };
        hasSeconds = colonCount >= 2;
        if (timeOnly) {
          if (hasSeconds) {
            Result = pas.SysUtils.FormatDateTime("hh:nn:ss",ANewDate)}
           else Result = pas.SysUtils.FormatDateTime("hh:nn",ANewDate);
        } else if (hasSlash && shortYear) {
          Result = pas.SysUtils.FormatDateTime("m/d/yy",ANewDate)}
         else if (hasSlash) {
          Result = pas.SysUtils.FormatDateTime("m/d/yyyy",ANewDate)}
         else if (hasDash) {
          Result = pas.SysUtils.FormatDateTime("yyyy-mm-dd",ANewDate)}
         else if (hasSpace && hasComma) {
          Result = pas.SysUtils.FormatDateTime("mmmm d, yyyy",ANewDate)}
         else if (hasSpace) {
          Result = pas.SysUtils.FormatDateTime("mmm d yyyy",ANewDate)}
         else Result = pas.SysUtils.DateTimeToStr$1(ANewDate,fmt,false);
        return Result;
      };
      function IsTimeOnlyString(S) {
        var Result = false;
        var colonPos = 0;
        var secondColonPos = 0;
        var hourPart = "";
        var minPart = "";
        var h = 0;
        var m = 0;
        Result = false;
        colonPos = pas.System.Pos(":",S);
        if (colonPos < 1) return Result;
        if ((pas.System.Pos("/",S) > 0) || (pas.System.Pos("-",S) > 0)) return Result;
        hourPart = pas.SysUtils.Trim(pas.System.Copy(S,1,colonPos - 1));
        secondColonPos = pas.System.Pos$1(":",S,colonPos + 1);
        if (secondColonPos > 0) {
          minPart = pas.SysUtils.Trim(pas.System.Copy(S,colonPos + 1,secondColonPos - colonPos - 1))}
         else minPart = pas.SysUtils.Trim(pas.System.Copy(S,colonPos + 1,2147483647));
        if (pas.SysUtils.TryStrToInt(hourPart,{get: function () {
            return h;
          }, set: function (v) {
            h = v;
          }}) && pas.SysUtils.TryStrToInt(minPart,{get: function () {
            return m;
          }, set: function (v) {
            m = v;
          }})) Result = (h >= 0) && (h <= 23) && (m >= 0) && (m <= 59);
        return Result;
      };
      function TryParseTimeString(S, DT) {
        var Result = false;
        var colonPos = 0;
        var secondColonPos = 0;
        var hourPart = "";
        var minPart = "";
        var secPart = "";
        var h = 0;
        var m = 0;
        var sec = 0;
        Result = false;
        colonPos = pas.System.Pos(":",S);
        if (colonPos < 1) return Result;
        hourPart = pas.SysUtils.Trim(pas.System.Copy(S,1,colonPos - 1));
        secondColonPos = pas.System.Pos$1(":",S,colonPos + 1);
        if (secondColonPos > 0) {
          minPart = pas.SysUtils.Trim(pas.System.Copy(S,colonPos + 1,secondColonPos - colonPos - 1));
          secPart = pas.SysUtils.Trim(pas.System.Copy(S,secondColonPos + 1,2147483647));
        } else {
          minPart = pas.SysUtils.Trim(pas.System.Copy(S,colonPos + 1,2147483647));
          secPart = "0";
        };
        if (pas.SysUtils.TryStrToInt(hourPart,{get: function () {
            return h;
          }, set: function (v) {
            h = v;
          }}) && pas.SysUtils.TryStrToInt(minPart,{get: function () {
            return m;
          }, set: function (v) {
            m = v;
          }}) && pas.SysUtils.TryStrToInt(secPart,{get: function () {
            return sec;
          }, set: function (v) {
            sec = v;
          }})) {
          if ((h >= 0) && (h <= 23) && (m >= 0) && (m <= 59) && (sec >= 0) && (sec <= 59)) {
            DT.set(pas.SysUtils.EncodeTime(h,m,sec,0));
            Result = true;
          };
        };
        return Result;
      };
      Result = ASourceValue;
      fmt.$assign(AFormatSettings);
      effectiveIndex = AFillIndex;
      tmpValue = ASourceValue;
      handled = false;
      this.DoAutoFillCalculateValue(ASourceCells,ASourceValues,ATargetCells,AFillIndex,ADirection,{get: function () {
          return tmpValue;
        }, set: function (v) {
          tmpValue = v;
        }},{get: function () {
          return handled;
        }, set: function (v) {
          handled = v;
        }});
      if (handled) return tmpValue;
      if (this.$class.ValueIsString(ASourceValue) && IsTimeOnlyString(this.$class.ValueToString$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(fmt)))) {
        if (TryParseTimeString(this.$class.ValueToString$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(fmt)),{get: function () {
            return dateVal;
          }, set: function (v) {
            dateVal = v;
          }})) {
          timeStepApplied = false;
          if ((ALaneIndex >= 0) && (ALaneIndex < rtl.length(AParams.Lanes)) && (AParams.Lanes[ALaneIndex].LaneFillType === $mod.TTMSFNCDataGridDataAutoFillType.gaftDateTime)) {
            dateVal = dateVal + (AParams.Lanes[ALaneIndex].LaneStep * effectiveIndex);
            timeStepApplied = true;
          } else if (AParams.FillType === $mod.TTMSFNCDataGridDataAutoFillType.gaftDateTime) {
            if (this.$class.ValueIsFloat(AParams.Step)) {
              dateVal = dateVal + (this.$class.ValueToFloat(AParams.Step) * effectiveIndex);
              timeStepApplied = true;
            } else if (this.$class.ValueIsString(AParams.Step)) {
              if (TryParseTimeString(this.$class.ValueToString$1(AParams.Step,pas.SysUtils.TFormatSettings.$clone(fmt)),{get: function () {
                  return stepDT;
                }, set: function (v) {
                  stepDT = v;
                }})) {
                dateVal = dateVal + (stepDT * effectiveIndex);
                timeStepApplied = true;
              } else if (pas.SysUtils.TryStrToDateTime$1(this.$class.ValueToString$1(AParams.Step,pas.SysUtils.TFormatSettings.$clone(fmt)),{get: function () {
                  return stepDT;
                }, set: function (v) {
                  stepDT = v;
                }},fmt)) {
                dateVal = dateVal + (stepDT * effectiveIndex);
                timeStepApplied = true;
              };
            };
          };
          if (!timeStepApplied && (ALaneIndex >= 0) && (ALaneIndex < rtl.length(AParams.Lanes)) && (rtl.length(AParams.Lanes[ALaneIndex].SeedValues) >= 2)) {
            seed0 = this.$class.ValueToString$1(AParams.Lanes[ALaneIndex].SeedValues[0],pas.SysUtils.TFormatSettings.$clone(fmt));
            seed1 = this.$class.ValueToString$1(AParams.Lanes[ALaneIndex].SeedValues[1],pas.SysUtils.TFormatSettings.$clone(fmt));
            if (IsTimeOnlyString(seed0) && IsTimeOnlyString(seed1) && TryParseTimeString(seed0,{get: function () {
                return dt0;
              }, set: function (v) {
                dt0 = v;
              }}) && TryParseTimeString(seed1,{get: function () {
                return dt1;
              }, set: function (v) {
                dt1 = v;
              }})) dateVal = dateVal + ((dt1 - dt0) * effectiveIndex);
          };
          return FormatDatePreservingOriginal(this.$class.ValueToString$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(fmt)),dateVal,fmt);
        };
      };
      stepKind = $mod.TTMSFNCDataGridDataAutoFillStepKind.gaskNone;
      stepInt = 0;
      stepFloat = 0;
      stepDate = 0;
      if (this.$class.ValueIsInteger(AParams.Step)) {
        stepInt = this.$class.ValueToInteger(AParams.Step);
        stepKind = $mod.TTMSFNCDataGridDataAutoFillStepKind.gaskInt;
      } else if (this.$class.ValueIsFloat(AParams.Step)) {
        stepFloat = this.$class.ValueToFloat(AParams.Step);
        stepKind = $mod.TTMSFNCDataGridDataAutoFillStepKind.gaskFloat;
      } else if (this.$class.ValueIsString(AParams.Step) && pas.SysUtils.TryStrToDateTime$1(this.$class.ValueToString$1(AParams.Step,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),{get: function () {
          return dateVal;
        }, set: function (v) {
          dateVal = v;
        }},fmt)) {
        stepDate = dateVal;
        stepKind = $mod.TTMSFNCDataGridDataAutoFillStepKind.gaskDate;
      };
      if ((ALaneIndex >= 0) && (ALaneIndex < rtl.length(AParams.Lanes))) {
        if (AParams.Lanes[ALaneIndex].TextNumEnabled) {
          baseNum = AParams.Lanes[ALaneIndex].TextNumStart + (ASeedPosInLane * AParams.Lanes[ALaneIndex].TextNumStep);
          outNum = baseNum + (effectiveIndex * AParams.Lanes[ALaneIndex].TextNumStep);
          return AParams.Lanes[ALaneIndex].TextNumPrefix + FormatNumberWithWidth(outNum,AParams.Lanes[ALaneIndex].TextNumWidth) + AParams.Lanes[ALaneIndex].TextNumSuffix;
        };
        if (AParams.Lanes[ALaneIndex].CustomListEnabled) {
          stepForCustomList = AParams.Lanes[ALaneIndex].CustomListStep;
          if ((AParams.Lanes[ALaneIndex].SeedCount > 1) && AParams.Lanes[ALaneIndex].HasEmptySeed) {
            nextIndex = (ASeedPosInLane + effectiveIndex) % AParams.Lanes[ALaneIndex].SeedCount;
            if (nextIndex < 0) nextIndex = nextIndex + AParams.Lanes[ALaneIndex].SeedCount;
            if (nextIndex < rtl.length(AParams.Lanes[ALaneIndex].SeedValues)) {
              tmpValue = AParams.Lanes[ALaneIndex].SeedValues[nextIndex];
              if (this.$class.ValueIsEmpty(tmpValue) || (this.$class.ValueIsString(tmpValue) && (this.$class.ValueToString$1(tmpValue,pas.SysUtils.TFormatSettings.$clone(fmt)) === ""))) return tmpValue;
              if (this.$class.ValueIsString(tmpValue)) return this.CalculateCustomListValueLaneAware(this.$class.ValueToString$1(tmpValue,pas.SysUtils.TFormatSettings.$clone(fmt)),rtl.trunc(((effectiveIndex + AParams.Lanes[ALaneIndex].SeedCount) - 1) / AParams.Lanes[ALaneIndex].SeedCount),stepForCustomList,fmt,AParams.Lanes[ALaneIndex],ASeedPosInLane);
            };
          };
          if (this.$class.ValueIsString(ASourceValue) && (this.$class.ValueToString$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(fmt)) !== "")) {
            return this.CalculateCustomListValueLaneAware(this.$class.ValueToString$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(fmt)),effectiveIndex,stepForCustomList,fmt,AParams.Lanes[ALaneIndex],ASeedPosInLane)}
           else if ((rtl.length(AParams.Lanes[ALaneIndex].SeedValues) > 0) && this.$class.ValueIsString(AParams.Lanes[ALaneIndex].SeedValues[0]) && (this.$class.ValueToString$1(AParams.Lanes[ALaneIndex].SeedValues[0],pas.SysUtils.TFormatSettings.$clone(fmt)) !== "")) {
            return this.CalculateCustomListValueLaneAware(this.$class.ValueToString$1(AParams.Lanes[ALaneIndex].SeedValues[0],pas.SysUtils.TFormatSettings.$clone(fmt)),effectiveIndex,stepForCustomList,fmt,AParams.Lanes[ALaneIndex],ASeedPosInLane)}
           else return this.CalculateCustomListValueLaneAware(this.$class.ValueToString$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(fmt)),effectiveIndex,stepForCustomList,fmt,AParams.Lanes[ALaneIndex],ASeedPosInLane);
        };
        if (AParams.Lanes[ALaneIndex].LaneFillType in rtl.createSet($mod.TTMSFNCDataGridDataAutoFillType.gaftNumericInteger,$mod.TTMSFNCDataGridDataAutoFillType.gaftNumericFloat)) {
          if (this.$class.ValueIsInteger(ASourceValue)) {
            intVal = this.$class.ValueToInteger(ASourceValue);
            intVal = intVal + Math.round(AParams.Lanes[ALaneIndex].LaneStep * effectiveIndex);
            return intVal;
          };
          if (this.$class.ValueIsFloat(ASourceValue)) {
            floatVal = this.$class.ValueToFloat(ASourceValue);
            floatVal = floatVal + (AParams.Lanes[ALaneIndex].LaneStep * effectiveIndex);
            return floatVal;
          };
          if (this.$class.ValueIsString(ASourceValue) && (pas.System.Pos(":",this.$class.ValueToString$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(fmt))) === 0)) {
            if (pas.SysUtils.TryStrToFloat$3(this.$class.ValueToString$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(fmt)),{get: function () {
                return floatVal;
              }, set: function (v) {
                floatVal = v;
              }},fmt)) {
              floatVal = floatVal + (AParams.Lanes[ALaneIndex].LaneStep * effectiveIndex);
              if (AParams.Lanes[ALaneIndex].LaneFillType === $mod.TTMSFNCDataGridDataAutoFillType.gaftNumericInteger) {
                return pas.SysUtils.IntToStr(Math.round(floatVal))}
               else return pas.SysUtils.FloatToStr$1(floatVal,fmt);
            };
          };
        };
        if (AParams.Lanes[ALaneIndex].LaneFillType === $mod.TTMSFNCDataGridDataAutoFillType.gaftDateTime) {
          if (this.$class.ValueIsDateTime(ASourceValue)) {
            dateVal = this.$class.ValueToDateTime$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(fmt));
            if (AParams.Lanes[ALaneIndex].DatePatternEnabled) {
              dateVal = this.AddDatePattern(dateVal,AParams.Lanes[ALaneIndex].DatePatternType,AParams.Lanes[ALaneIndex].DatePatternStep,effectiveIndex)}
             else dateVal = dateVal + (AParams.Lanes[ALaneIndex].LaneStep * effectiveIndex);
            return dateVal;
          };
          if (this.$class.ValueIsString(ASourceValue)) {
            if (IsTimeOnlyString(this.$class.ValueToString$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(fmt))) && TryParseTimeString(this.$class.ValueToString$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(fmt)),{get: function () {
                return dateVal;
              }, set: function (v) {
                dateVal = v;
              }})) {
              if (AParams.Lanes[ALaneIndex].DatePatternEnabled) {
                dateVal = this.AddDatePattern(dateVal,AParams.Lanes[ALaneIndex].DatePatternType,AParams.Lanes[ALaneIndex].DatePatternStep,effectiveIndex)}
               else dateVal = dateVal + (AParams.Lanes[ALaneIndex].LaneStep * effectiveIndex);
              return FormatDatePreservingOriginal(this.$class.ValueToString$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(fmt)),dateVal,fmt);
            };
            if (pas.SysUtils.TryStrToDateTime$1(this.$class.ValueToString$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(fmt)),{get: function () {
                return dateVal;
              }, set: function (v) {
                dateVal = v;
              }},fmt)) {
              if (AParams.Lanes[ALaneIndex].DatePatternEnabled) {
                dateVal = this.AddDatePattern(dateVal,AParams.Lanes[ALaneIndex].DatePatternType,AParams.Lanes[ALaneIndex].DatePatternStep,effectiveIndex)}
               else dateVal = dateVal + (AParams.Lanes[ALaneIndex].LaneStep * effectiveIndex);
              return FormatDatePreservingOriginal(this.$class.ValueToString$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(fmt)),dateVal,fmt);
            };
          };
        };
      };
      var $tmp = AParams.FillType;
      if ($tmp === $mod.TTMSFNCDataGridDataAutoFillType.gaftUnknown) {
        if ((ALaneIndex >= 0) && (ALaneIndex < rtl.length(AParams.Lanes)) && (AParams.Lanes[ALaneIndex].LaneFillType !== $mod.TTMSFNCDataGridDataAutoFillType.gaftUnknown)) {
          var $tmp1 = AParams.Lanes[ALaneIndex].LaneFillType;
          if ($tmp1 === $mod.TTMSFNCDataGridDataAutoFillType.gaftNumericInteger) {
            if (this.$class.ValueIsInteger(ASourceValue)) {
              intVal = this.$class.ValueToInteger(ASourceValue);
              intVal = intVal + Math.round(AParams.Lanes[ALaneIndex].LaneStep * effectiveIndex);
              return intVal;
            };
            if (this.$class.ValueIsString(ASourceValue) && pas.SysUtils.TryStrToInt(this.$class.ValueToString$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),{get: function () {
                return intVal;
              }, set: function (v) {
                intVal = v;
              }})) {
              intVal = intVal + Math.round(AParams.Lanes[ALaneIndex].LaneStep * effectiveIndex);
              return pas.SysUtils.IntToStr(intVal);
            };
          } else if ($tmp1 === $mod.TTMSFNCDataGridDataAutoFillType.gaftNumericFloat) {
            if (this.$class.ValueIsFloat(ASourceValue) || this.$class.ValueIsInteger(ASourceValue)) {
              floatVal = this.$class.ValueToFloat(ASourceValue);
              floatVal = floatVal + (AParams.Lanes[ALaneIndex].LaneStep * effectiveIndex);
              return floatVal;
            };
            if (this.$class.ValueIsString(ASourceValue) && (pas.System.Pos(":",this.$class.ValueToString$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings))) === 0) && pas.SysUtils.TryStrToFloat$3(this.$class.ValueToString$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),{get: function () {
                return floatVal;
              }, set: function (v) {
                floatVal = v;
              }},fmt)) {
              floatVal = floatVal + (AParams.Lanes[ALaneIndex].LaneStep * effectiveIndex);
              return pas.SysUtils.FloatToStr$1(floatVal,fmt);
            };
          } else if ($tmp1 === $mod.TTMSFNCDataGridDataAutoFillType.gaftDateTime) {
            if (this.$class.ValueIsDateTime(ASourceValue)) {
              dateVal = this.$class.ValueToDateTime$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(fmt));
              if (AParams.Lanes[ALaneIndex].DatePatternEnabled) {
                dateVal = this.AddDatePattern(dateVal,AParams.Lanes[ALaneIndex].DatePatternType,AParams.Lanes[ALaneIndex].DatePatternStep,effectiveIndex)}
               else dateVal = dateVal + (AParams.Lanes[ALaneIndex].LaneStep * effectiveIndex);
              return dateVal;
            };
            if (this.$class.ValueIsString(ASourceValue)) {
              if (IsTimeOnlyString(this.$class.ValueToString$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings))) && TryParseTimeString(this.$class.ValueToString$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),{get: function () {
                  return dateVal;
                }, set: function (v) {
                  dateVal = v;
                }})) {
                if (AParams.Lanes[ALaneIndex].DatePatternEnabled) {
                  dateVal = this.AddDatePattern(dateVal,AParams.Lanes[ALaneIndex].DatePatternType,AParams.Lanes[ALaneIndex].DatePatternStep,effectiveIndex)}
                 else dateVal = dateVal + (AParams.Lanes[ALaneIndex].LaneStep * effectiveIndex);
                return FormatDatePreservingOriginal(this.$class.ValueToString$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),dateVal,fmt);
              };
              if (pas.SysUtils.TryStrToDateTime$1(this.$class.ValueToString$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),{get: function () {
                  return dateVal;
                }, set: function (v) {
                  dateVal = v;
                }},fmt)) {
                if (AParams.Lanes[ALaneIndex].DatePatternEnabled) {
                  dateVal = this.AddDatePattern(dateVal,AParams.Lanes[ALaneIndex].DatePatternType,AParams.Lanes[ALaneIndex].DatePatternStep,effectiveIndex)}
                 else dateVal = dateVal + (AParams.Lanes[ALaneIndex].LaneStep * effectiveIndex);
                return FormatDatePreservingOriginal(this.$class.ValueToString$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),dateVal,fmt);
              };
            };
          };
        };
        return ASourceValue;
      } else if ($tmp === $mod.TTMSFNCDataGridDataAutoFillType.gaftBoolean) {
        if (this.$class.ValueIsBoolean(ASourceValue)) {
          if ((effectiveIndex % 2) === 1) {
            return !this.$class.ValueToBoolean(ASourceValue)}
           else return this.$class.ValueToBoolean(ASourceValue);
        };
        return ASourceValue;
      } else if ($tmp === $mod.TTMSFNCDataGridDataAutoFillType.gaftNumericInteger) {
        if ((ALaneIndex >= 0) && (ALaneIndex < rtl.length(AParams.Lanes)) && (AParams.Lanes[ALaneIndex].LaneFillType in rtl.createSet($mod.TTMSFNCDataGridDataAutoFillType.gaftNumericInteger,$mod.TTMSFNCDataGridDataAutoFillType.gaftNumericFloat))) {
          if (this.$class.ValueIsInteger(ASourceValue)) {
            intVal = this.$class.ValueToInteger(ASourceValue);
            intVal = intVal + Math.round(AParams.Lanes[ALaneIndex].LaneStep * effectiveIndex);
            return intVal;
          };
          if (this.$class.ValueIsString(ASourceValue) && pas.SysUtils.TryStrToInt(this.$class.ValueToString$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),{get: function () {
              return intVal;
            }, set: function (v) {
              intVal = v;
            }})) {
            intVal = intVal + Math.round(AParams.Lanes[ALaneIndex].LaneStep * effectiveIndex);
            return pas.SysUtils.IntToStr(intVal);
          };
        };
        if (this.$class.ValueIsInteger(ASourceValue)) {
          intVal = this.$class.ValueToInteger(ASourceValue);
          var $tmp2 = stepKind;
          if ($tmp2 === $mod.TTMSFNCDataGridDataAutoFillStepKind.gaskInt) {
            intVal = intVal + (stepInt * effectiveIndex)}
           else if ($tmp2 === $mod.TTMSFNCDataGridDataAutoFillStepKind.gaskFloat) intVal = intVal + Math.round(stepFloat * effectiveIndex);
          return intVal;
        };
        if (this.$class.ValueIsString(ASourceValue) && pas.SysUtils.TryStrToInt(this.$class.ValueToString$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),{get: function () {
            return intVal;
          }, set: function (v) {
            intVal = v;
          }})) {
          var $tmp3 = stepKind;
          if ($tmp3 === $mod.TTMSFNCDataGridDataAutoFillStepKind.gaskInt) {
            intVal = intVal + (stepInt * effectiveIndex)}
           else if ($tmp3 === $mod.TTMSFNCDataGridDataAutoFillStepKind.gaskFloat) intVal = intVal + Math.round(stepFloat * effectiveIndex);
          return pas.SysUtils.IntToStr(intVal);
        };
        return ASourceValue;
      } else if ($tmp === $mod.TTMSFNCDataGridDataAutoFillType.gaftNumericFloat) {
        if ((ALaneIndex >= 0) && (ALaneIndex < rtl.length(AParams.Lanes)) && AParams.Lanes[ALaneIndex].TrendEnabled) {
          k = ASeedPosInLane + 1 + effectiveIndex;
          y = AParams.Lanes[ALaneIndex].TrendIntercept + (AParams.Lanes[ALaneIndex].TrendSlope * k);
          if (this.$class.ValueIsString(ASourceValue)) {
            return pas.SysUtils.FloatToStr$1(y,fmt)}
           else return y;
        };
        if ((ALaneIndex >= 0) && (ALaneIndex < rtl.length(AParams.Lanes)) && (AParams.Lanes[ALaneIndex].LaneFillType in rtl.createSet($mod.TTMSFNCDataGridDataAutoFillType.gaftNumericInteger,$mod.TTMSFNCDataGridDataAutoFillType.gaftNumericFloat))) {
          if (this.$class.ValueIsFloat(ASourceValue)) {
            floatVal = this.$class.ValueToFloat(ASourceValue);
            floatVal = floatVal + (AParams.Lanes[ALaneIndex].LaneStep * effectiveIndex);
            return floatVal;
          };
          if (this.$class.ValueIsInteger(ASourceValue)) {
            floatVal = this.$class.ValueToInteger(ASourceValue);
            floatVal = floatVal + (AParams.Lanes[ALaneIndex].LaneStep * effectiveIndex);
            return floatVal;
          };
          if (this.$class.ValueIsString(ASourceValue) && (pas.System.Pos(":",this.$class.ValueToString$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings))) === 0) && pas.SysUtils.TryStrToFloat$3(this.$class.ValueToString$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),{get: function () {
              return floatVal;
            }, set: function (v) {
              floatVal = v;
            }},fmt)) {
            floatVal = floatVal + (AParams.Lanes[ALaneIndex].LaneStep * effectiveIndex);
            return pas.SysUtils.FloatToStr$1(floatVal,fmt);
          };
        };
        if (this.$class.ValueIsFloat(ASourceValue)) {
          floatVal = this.$class.ValueToFloat(ASourceValue);
          var $tmp4 = stepKind;
          if ($tmp4 === $mod.TTMSFNCDataGridDataAutoFillStepKind.gaskInt) {
            floatVal = floatVal + (stepInt * effectiveIndex)}
           else if ($tmp4 === $mod.TTMSFNCDataGridDataAutoFillStepKind.gaskFloat) floatVal = floatVal + (stepFloat * effectiveIndex);
          return floatVal;
        };
        if (this.$class.ValueIsInteger(ASourceValue)) {
          floatVal = this.$class.ValueToInteger(ASourceValue);
          var $tmp5 = stepKind;
          if ($tmp5 === $mod.TTMSFNCDataGridDataAutoFillStepKind.gaskInt) {
            floatVal = floatVal + (stepInt * effectiveIndex)}
           else if ($tmp5 === $mod.TTMSFNCDataGridDataAutoFillStepKind.gaskFloat) floatVal = floatVal + (stepFloat * effectiveIndex);
          return floatVal;
        };
        if (this.$class.ValueIsString(ASourceValue) && (pas.System.Pos(":",this.$class.ValueToString$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings))) === 0) && pas.SysUtils.TryStrToFloat$3(this.$class.ValueToString$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),{get: function () {
            return floatVal;
          }, set: function (v) {
            floatVal = v;
          }},fmt)) {
          var $tmp6 = stepKind;
          if ($tmp6 === $mod.TTMSFNCDataGridDataAutoFillStepKind.gaskInt) {
            floatVal = floatVal + (stepInt * effectiveIndex)}
           else if ($tmp6 === $mod.TTMSFNCDataGridDataAutoFillStepKind.gaskFloat) floatVal = floatVal + (stepFloat * effectiveIndex);
          return pas.SysUtils.FloatToStr$1(floatVal,fmt);
        };
        return ASourceValue;
      } else if ($tmp === $mod.TTMSFNCDataGridDataAutoFillType.gaftDateTime) {
        if (this.$class.ValueIsDateTime(ASourceValue)) {
          dateVal = this.$class.ValueToDateTime$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(fmt));
          if ((ALaneIndex >= 0) && (ALaneIndex < rtl.length(AParams.Lanes)) && AParams.Lanes[ALaneIndex].DatePatternEnabled) {
            dateVal = this.AddDatePattern(dateVal,AParams.Lanes[ALaneIndex].DatePatternType,AParams.Lanes[ALaneIndex].DatePatternStep,effectiveIndex)}
           else if ((ALaneIndex >= 0) && (ALaneIndex < rtl.length(AParams.Lanes)) && (AParams.Lanes[ALaneIndex].LaneFillType === $mod.TTMSFNCDataGridDataAutoFillType.gaftDateTime)) {
            dateVal = dateVal + (AParams.Lanes[ALaneIndex].LaneStep * effectiveIndex)}
           else {
            var $tmp7 = stepKind;
            if ($tmp7 === $mod.TTMSFNCDataGridDataAutoFillStepKind.gaskInt) {
              dateVal = dateVal + (stepInt * effectiveIndex)}
             else if ($tmp7 === $mod.TTMSFNCDataGridDataAutoFillStepKind.gaskFloat) {
              dateVal = dateVal + (stepFloat * effectiveIndex)}
             else if ($tmp7 === $mod.TTMSFNCDataGridDataAutoFillStepKind.gaskDate) dateVal = dateVal + (stepDate * effectiveIndex);
          };
          return dateVal;
        };
        if (this.$class.ValueIsString(ASourceValue)) {
          if (IsTimeOnlyString(this.$class.ValueToString$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings))) && TryParseTimeString(this.$class.ValueToString$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),{get: function () {
              return dateVal;
            }, set: function (v) {
              dateVal = v;
            }})) {
            if ((ALaneIndex >= 0) && (ALaneIndex < rtl.length(AParams.Lanes)) && AParams.Lanes[ALaneIndex].DatePatternEnabled) {
              dateVal = this.AddDatePattern(dateVal,AParams.Lanes[ALaneIndex].DatePatternType,AParams.Lanes[ALaneIndex].DatePatternStep,effectiveIndex)}
             else if ((ALaneIndex >= 0) && (ALaneIndex < rtl.length(AParams.Lanes)) && (AParams.Lanes[ALaneIndex].LaneFillType === $mod.TTMSFNCDataGridDataAutoFillType.gaftDateTime)) {
              dateVal = dateVal + (AParams.Lanes[ALaneIndex].LaneStep * effectiveIndex)}
             else {
              var $tmp8 = stepKind;
              if ($tmp8 === $mod.TTMSFNCDataGridDataAutoFillStepKind.gaskInt) {
                dateVal = dateVal + (stepInt * effectiveIndex)}
               else if ($tmp8 === $mod.TTMSFNCDataGridDataAutoFillStepKind.gaskFloat) {
                dateVal = dateVal + (stepFloat * effectiveIndex)}
               else if ($tmp8 === $mod.TTMSFNCDataGridDataAutoFillStepKind.gaskDate) dateVal = dateVal + (stepDate * effectiveIndex);
            };
            return FormatDatePreservingOriginal(this.$class.ValueToString$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),dateVal,fmt);
          };
          if (pas.SysUtils.TryStrToDateTime$1(this.$class.ValueToString$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),{get: function () {
              return dateVal;
            }, set: function (v) {
              dateVal = v;
            }},fmt)) {
            if ((ALaneIndex >= 0) && (ALaneIndex < rtl.length(AParams.Lanes)) && AParams.Lanes[ALaneIndex].DatePatternEnabled) {
              dateVal = this.AddDatePattern(dateVal,AParams.Lanes[ALaneIndex].DatePatternType,AParams.Lanes[ALaneIndex].DatePatternStep,effectiveIndex)}
             else if ((ALaneIndex >= 0) && (ALaneIndex < rtl.length(AParams.Lanes)) && (AParams.Lanes[ALaneIndex].LaneFillType === $mod.TTMSFNCDataGridDataAutoFillType.gaftDateTime)) {
              dateVal = dateVal + (AParams.Lanes[ALaneIndex].LaneStep * effectiveIndex)}
             else {
              var $tmp9 = stepKind;
              if ($tmp9 === $mod.TTMSFNCDataGridDataAutoFillStepKind.gaskInt) {
                dateVal = dateVal + (stepInt * effectiveIndex)}
               else if ($tmp9 === $mod.TTMSFNCDataGridDataAutoFillStepKind.gaskFloat) {
                dateVal = dateVal + (stepFloat * effectiveIndex)}
               else if ($tmp9 === $mod.TTMSFNCDataGridDataAutoFillStepKind.gaskDate) dateVal = dateVal + (stepDate * effectiveIndex);
            };
            return FormatDatePreservingOriginal(this.$class.ValueToString$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),dateVal,fmt);
          };
        };
        return ASourceValue;
      } else if ($tmp === $mod.TTMSFNCDataGridDataAutoFillType.gaftAlphabetic) {
        if (!this.$class.ValueIsString(ASourceValue)) return ASourceValue;
        if ((ALaneIndex >= 0) && (ALaneIndex < rtl.length(AParams.Lanes)) && AParams.Lanes[ALaneIndex].TextNumEnabled) {
          baseNum = AParams.Lanes[ALaneIndex].TextNumStart + (ASeedPosInLane * AParams.Lanes[ALaneIndex].TextNumStep);
          outNum = baseNum + (effectiveIndex * AParams.Lanes[ALaneIndex].TextNumStep);
          return AParams.Lanes[ALaneIndex].TextNumPrefix + FormatNumberWithWidth(outNum,AParams.Lanes[ALaneIndex].TextNumWidth) + AParams.Lanes[ALaneIndex].TextNumSuffix;
        };
        stepForCustomList = 1;
        if ((ALaneIndex >= 0) && (ALaneIndex < rtl.length(AParams.Lanes)) && AParams.Lanes[ALaneIndex].CustomListEnabled) {
          stepForCustomList = AParams.Lanes[ALaneIndex].CustomListStep}
         else if (this.$class.ValueIsInteger(AParams.Step)) stepForCustomList = this.$class.ValueToInteger(AParams.Step);
        if ((ALaneIndex >= 0) && (ALaneIndex < rtl.length(AParams.Lanes))) {
          Result = this.CalculateCustomListValueLaneAware(this.$class.ValueToString$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),effectiveIndex,stepForCustomList,fmt,AParams.Lanes[ALaneIndex],ASeedPosInLane)}
         else Result = this.CalculateBuiltInDayMonthListValue(this.$class.ValueToString$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),effectiveIndex,stepForCustomList,fmt);
        if ((ALaneIndex >= 0) && (ALaneIndex < rtl.length(AParams.Lanes)) && AParams.Lanes[ALaneIndex].CustomListEnabled) {
          return Result}
         else if (!pas.SysUtils.SameText(this.$class.ValueToString$1(Result,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),this.$class.ValueToString$1(ASourceValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)))) return Result;
        if ((ALaneIndex >= 0) && (ALaneIndex < rtl.length(AParams.Lanes)) && (AParams.Lanes[ALaneIndex].SeedCount > 0)) {
          nextIndex = (ASeedPosInLane + effectiveIndex) % AParams.Lanes[ALaneIndex].SeedCount;
          if (nextIndex < 0) nextIndex = nextIndex + AParams.Lanes[ALaneIndex].SeedCount;
          return AParams.Lanes[ALaneIndex].SeedValues[nextIndex];
        };
        return ASourceValue;
      };
      return Result;
    };
    this.CalculateFillIndex = function (ARow, ACol, ASourceRange, ATargetRange, ADirection) {
      var Result = 0;
      var $tmp = ADirection;
      if ($tmp === $mod.TTMSFNCDataGridDataAutoFillDirection.gafdDown) {
        Result = ARow - ASourceRange.StopCell.GetRow()}
       else if ($tmp === $mod.TTMSFNCDataGridDataAutoFillDirection.gafdUp) {
        Result = ARow - ASourceRange.StartCell.GetRow()}
       else if ($tmp === $mod.TTMSFNCDataGridDataAutoFillDirection.gafdRight) {
        Result = ACol - ASourceRange.StopCell.GetColumn()}
       else if ($tmp === $mod.TTMSFNCDataGridDataAutoFillDirection.gafdLeft) {
        Result = ACol - ASourceRange.StartCell.GetColumn()}
       else {
        Result = 0;
      };
      return Result;
    };
    this.DetectDatePattern = function (ADate1, ADate2, APatternType, AStep) {
      var Result = false;
      var y1 = 0;
      var m1 = 0;
      var d1 = 0;
      var y2 = 0;
      var m2 = 0;
      var d2 = 0;
      var dayDiff = 0;
      var monthDiff = 0;
      var yearDiff = 0;
      Result = false;
      APatternType.set($mod.TTMSFNCDataGridDataDatePatternType.gdptDaily);
      AStep.set(1);
      pas.SysUtils.DecodeDate(ADate1,{get: function () {
          return y1;
        }, set: function (v) {
          y1 = v;
        }},{get: function () {
          return m1;
        }, set: function (v) {
          m1 = v;
        }},{get: function () {
          return d1;
        }, set: function (v) {
          d1 = v;
        }});
      pas.SysUtils.DecodeDate(ADate2,{get: function () {
          return y2;
        }, set: function (v) {
          y2 = v;
        }},{get: function () {
          return m2;
        }, set: function (v) {
          m2 = v;
        }},{get: function () {
          return d2;
        }, set: function (v) {
          d2 = v;
        }});
      yearDiff = y2 - y1;
      monthDiff = ((y2 - y1) * 12) + (m2 - m1);
      dayDiff = pas.DateUtils.DaysBetween(ADate1,ADate2);
      if ((yearDiff !== 0) && (m1 === m2) && (d1 === d2)) {
        APatternType.set($mod.TTMSFNCDataGridDataDatePatternType.gdptYearly);
        AStep.set(yearDiff);
        return true;
      };
      if ((monthDiff !== 0) && (d1 === d2)) {
        APatternType.set($mod.TTMSFNCDataGridDataDatePatternType.gdptMonthly);
        AStep.set(monthDiff);
        return true;
      };
      if ((dayDiff > 0) && ((dayDiff % 7) === 0)) {
        APatternType.set($mod.TTMSFNCDataGridDataDatePatternType.gdptWeekly);
        AStep.set(rtl.trunc(dayDiff / 7));
        return true;
      };
      if (dayDiff > 0) {
        APatternType.set($mod.TTMSFNCDataGridDataDatePatternType.gdptDaily);
        AStep.set(dayDiff);
        return true;
      };
      return Result;
    };
    this.AddDatePattern = function (ABaseDate, APatternType, AStep, AMultiplier) {
      var Result = 0.0;
      var y = 0;
      var m = 0;
      var d = 0;
      var newY = 0;
      var newM = 0;
      Result = ABaseDate;
      var $tmp = APatternType;
      if ($tmp === $mod.TTMSFNCDataGridDataDatePatternType.gdptDaily) {
        Result = ABaseDate + (AStep * AMultiplier)}
       else if ($tmp === $mod.TTMSFNCDataGridDataDatePatternType.gdptWeekly) {
        Result = ABaseDate + (7 * AStep * AMultiplier)}
       else if ($tmp === $mod.TTMSFNCDataGridDataDatePatternType.gdptMonthly) {
        pas.SysUtils.DecodeDate(ABaseDate,{get: function () {
            return y;
          }, set: function (v) {
            y = v;
          }},{get: function () {
            return m;
          }, set: function (v) {
            m = v;
          }},{get: function () {
            return d;
          }, set: function (v) {
            d = v;
          }});
        newM = m + (AStep * AMultiplier);
        newY = y;
        while (newM > 12) {
          newY += 1;
          newM -= 12;
        };
        while (newM < 1) {
          newY -= 1;
          newM += 12;
        };
        try {
          Result = pas.SysUtils.EncodeDate(newY,newM,d);
        } catch ($e) {
          Result = pas.SysUtils.EncodeDate(newY,newM,pas.DateUtils.DaysInAMonth(newY,newM));
        };
      } else if ($tmp === $mod.TTMSFNCDataGridDataDatePatternType.gdptYearly) {
        pas.SysUtils.DecodeDate(ABaseDate,{get: function () {
            return y;
          }, set: function (v) {
            y = v;
          }},{get: function () {
            return m;
          }, set: function (v) {
            m = v;
          }},{get: function () {
            return d;
          }, set: function (v) {
            d = v;
          }});
        newY = y + (AStep * AMultiplier);
        try {
          Result = pas.SysUtils.EncodeDate(newY,m,d);
        } catch ($e) {
          Result = pas.SysUtils.EncodeDate(newY,m,28);
        };
      };
      return Result;
    };
    this.LaneIndexForTarget = function (ATargetRow, ATargetCol, ASourceRange, ADirection) {
      var Result = 0;
      var sourceWidth = 0;
      var sourceHeight = 0;
      sourceWidth = (ASourceRange.StopCell.GetColumn() - ASourceRange.StartCell.GetColumn()) + 1;
      sourceHeight = (ASourceRange.StopCell.GetRow() - ASourceRange.StartCell.GetRow()) + 1;
      var $tmp = ADirection;
      if (($tmp === $mod.TTMSFNCDataGridDataAutoFillDirection.gafdDown) || ($tmp === $mod.TTMSFNCDataGridDataAutoFillDirection.gafdUp)) {
        Result = (ATargetCol - ASourceRange.StartCell.GetColumn()) % sourceWidth;
        if (Result < 0) Result = Result + sourceWidth;
      } else {
        Result = (ATargetRow - ASourceRange.StartCell.GetRow()) % sourceHeight;
        if (Result < 0) Result = Result + sourceHeight;
      };
      return Result;
    };
    this.ResolveAutoFillDirection = function (ASourceStart, ASourceEnd, ATargetStart, ATargetEnd, ADirection) {
      var Result = 0;
      var sourceWidth = 0;
      var sourceHeight = 0;
      var extendsRight = false;
      var extendsLeft = false;
      var extendsDown = false;
      var extendsUp = false;
      Result = ADirection;
      if (Result !== $mod.TTMSFNCDataGridDataAutoFillDirection.gafdAuto) return Result;
      sourceWidth = (ASourceEnd.GetColumn() - ASourceStart.GetColumn()) + 1;
      sourceHeight = (ASourceEnd.GetRow() - ASourceStart.GetRow()) + 1;
      extendsRight = (ATargetEnd.GetColumn() > ASourceEnd.GetColumn()) || (ATargetStart.GetColumn() > ASourceEnd.GetColumn());
      extendsLeft = (ATargetStart.GetColumn() < ASourceStart.GetColumn()) || (ATargetEnd.GetColumn() < ASourceStart.GetColumn());
      extendsDown = (ATargetEnd.GetRow() > ASourceEnd.GetRow()) || (ATargetStart.GetRow() > ASourceEnd.GetRow());
      extendsUp = (ATargetStart.GetRow() < ASourceStart.GetRow()) || (ATargetEnd.GetRow() < ASourceStart.GetRow());
      if (sourceHeight > sourceWidth) {
        if (extendsDown) return $mod.TTMSFNCDataGridDataAutoFillDirection.gafdDown;
        if (extendsUp) return $mod.TTMSFNCDataGridDataAutoFillDirection.gafdUp;
        if (extendsRight) return $mod.TTMSFNCDataGridDataAutoFillDirection.gafdRight;
        if (extendsLeft) return $mod.TTMSFNCDataGridDataAutoFillDirection.gafdLeft;
      } else if (sourceWidth > sourceHeight) {
        if (extendsRight) return $mod.TTMSFNCDataGridDataAutoFillDirection.gafdRight;
        if (extendsLeft) return $mod.TTMSFNCDataGridDataAutoFillDirection.gafdLeft;
        if (extendsDown) return $mod.TTMSFNCDataGridDataAutoFillDirection.gafdDown;
        if (extendsUp) return $mod.TTMSFNCDataGridDataAutoFillDirection.gafdUp;
      } else {
        if (extendsDown) return $mod.TTMSFNCDataGridDataAutoFillDirection.gafdDown;
        if (extendsUp) return $mod.TTMSFNCDataGridDataAutoFillDirection.gafdUp;
        if (extendsRight) return $mod.TTMSFNCDataGridDataAutoFillDirection.gafdRight;
        if (extendsLeft) return $mod.TTMSFNCDataGridDataAutoFillDirection.gafdLeft;
      };
      Result = $mod.TTMSFNCDataGridDataAutoFillDirection.gafdDown;
      return Result;
    };
    this.CompareRows = function (AColumn, ALevel, V1, V2, ACustomCompareCallback) {
      var $Self = this;
      var Result = 0;
      var f = 0;
      var fmt = pas.SysUtils.TFormatSettings.$new();
      var sf = 0;
      var sl = "";
      var sr = "";
      var fl = 0.0;
      var fr = 0.0;
      var dtl = 0.0;
      var dtr = 0.0;
      var il = 0;
      var ir = 0;
      var bl = false;
      var br = false;
      var vc1 = undefined;
      var vc2 = undefined;
      var vc1v = pas.RTTI.TValue.$new();
      var vc2v = pas.RTTI.TValue.$new();
      var csi1 = 0;
      var csi2 = 0;
      var cs1 = 0;
      var I = 0;
      var cs = false;
      var dr = 0;
      var h = false;
      var r = 0;
      var I64val = 0;
      var Ival = 0;
      var Dval = 0.0;
      var dt = 0.0;
      function CompareB(l, r) {
        var Result = 0;
        if ((l + 0) < (r + 0)) {
          Result = -1}
         else if ((l + 0) > (r + 0)) {
          Result = 1}
         else Result = 0;
        return Result;
      };
      Result = 0;
      csi1 = -1;
      for (var $l = 0, $end = rtl.length(V1.Data) - 1; $l <= $end; $l++) {
        I = $l;
        if (V1.Data[I].Column === AColumn) {
          csi1 = I;
          break;
        };
      };
      csi2 = -1;
      for (var $l1 = 0, $end1 = rtl.length(V2.Data) - 1; $l1 <= $end1; $l1++) {
        I = $l1;
        if (V2.Data[I].Column === AColumn) {
          csi2 = I;
          break;
        };
      };
      if ((csi1 >= 0) && (csi1 <= (rtl.length(V1.Data) - 1)) && (csi2 >= 0) && (csi2 <= (rtl.length(V2.Data) - 1))) {
        f = V1.Data[csi1].Options.Format;
        fmt.$assign(V1.Data[csi1].Options.FormatSettings);
        cs = V1.Data[csi1].Options.CaseSensitive;
        dr = V1.Data[csi1].Options.Direction;
        vc1 = V1.Data[csi1].Data;
        vc2 = V2.Data[csi2].Data;
        h = false;
        if (ACustomCompareCallback != null) {
          r = ACustomCompareCallback(AColumn,V1.Row,V2.Row,vc1,vc2,ALevel,{get: function () {
              return h;
            }, set: function (v) {
              h = v;
            }});
          if (h) Result = r;
        };
        if (!h) {
          sf = $impl.TTMSFNCDataGridDataInternalSortFormat.gisfCustom;
          var $tmp = f;
          if ($tmp === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortFormat.gsfAutomatic) {
            if (this.$class.ValueIsBoolean(vc1) && this.$class.ValueIsBoolean(vc2)) {
              sf = $impl.TTMSFNCDataGridDataInternalSortFormat.gisfBoolean}
             else if (this.$class.ValueIsFloat(vc1) && (this.$class.ValueIsFloat(vc2) || this.$class.ValueIsInteger(vc2))) {
              sf = $impl.TTMSFNCDataGridDataInternalSortFormat.gisfNumericFloat}
             else if (this.$class.ValueIsInteger(vc1) && (this.$class.ValueIsInteger(vc2) || this.$class.ValueIsFloat(vc2))) {
              sf = $impl.TTMSFNCDataGridDataInternalSortFormat.gisfNumericInteger}
             else if (this.$class.ValueIsString(vc1) && this.$class.ValueIsString(vc2)) {
              vc1v.$assign($mod.CellValueToTValue(vc1));
              vc2v.$assign($mod.CellValueToTValue(vc2));
              if (pas.SysUtils.TryStrToInt(vc1v.AsString(),{get: function () {
                  return Ival;
                }, set: function (v) {
                  Ival = v;
                }}) && pas.SysUtils.TryStrToInt(vc2v.AsString(),{get: function () {
                  return Ival;
                }, set: function (v) {
                  Ival = v;
                }})) {
                sf = $impl.TTMSFNCDataGridDataInternalSortFormat.gisfNumericInteger}
               else if (pas.SysUtils.TryStrToInt64(vc1v.AsString(),{get: function () {
                  return I64val;
                }, set: function (v) {
                  I64val = v;
                }}) && pas.SysUtils.TryStrToInt64(vc2v.AsString(),{get: function () {
                  return I64val;
                }, set: function (v) {
                  I64val = v;
                }})) {
                sf = $impl.TTMSFNCDataGridDataInternalSortFormat.gisfNumericInteger}
               else if (pas.SysUtils.TryStrToFloat$3(vc1v.AsString(),{get: function () {
                  return Dval;
                }, set: function (v) {
                  Dval = v;
                }},fmt) && pas.SysUtils.TryStrToFloat$3(vc2v.AsString(),{get: function () {
                  return Dval;
                }, set: function (v) {
                  Dval = v;
                }},fmt)) {
                sf = $impl.TTMSFNCDataGridDataInternalSortFormat.gisfNumericFloat}
               else if (pas.SysUtils.TryStrToDateTime$1(vc1v.AsString(),{get: function () {
                  return dt;
                }, set: function (v) {
                  dt = v;
                }},fmt) && pas.SysUtils.TryStrToDateTime$1(vc2v.AsString(),{get: function () {
                  return dt;
                }, set: function (v) {
                  dt = v;
                }},fmt)) {
                sf = $impl.TTMSFNCDataGridDataInternalSortFormat.gisfDateTime}
               else if (pas.DateUtils.TryISO8601ToDate(vc1v.AsString(),{get: function () {
                  return dt;
                }, set: function (v) {
                  dt = v;
                }},true) && pas.DateUtils.TryISO8601ToDate(vc2v.AsString(),{get: function () {
                  return dt;
                }, set: function (v) {
                  dt = v;
                }},true)) {
                sf = $impl.TTMSFNCDataGridDataInternalSortFormat.gisfDateTime}
               else sf = $impl.TTMSFNCDataGridDataInternalSortFormat.gisfAlphabetic;
            };
          } else if ($tmp === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortFormat.gsfBoolean) {
            sf = $impl.TTMSFNCDataGridDataInternalSortFormat.gisfBoolean}
           else if ($tmp === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortFormat.gsfAlphabetic) {
            sf = $impl.TTMSFNCDataGridDataInternalSortFormat.gisfAlphabetic}
           else if ($tmp === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortFormat.gsfNumeric) {
            sf = $impl.TTMSFNCDataGridDataInternalSortFormat.gisfNumericFloat}
           else if ($tmp === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortFormat.gsfDateTime) {
            sf = $impl.TTMSFNCDataGridDataInternalSortFormat.gisfDateTime}
           else if ($tmp === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortFormat.gsfCustom) sf = $impl.TTMSFNCDataGridDataInternalSortFormat.gisfCustom;
          var $tmp1 = sf;
          if ($tmp1 === $impl.TTMSFNCDataGridDataInternalSortFormat.gisfAlphabetic) {
            if (cs) {
              sl = this.$class.ValueToString(vc1);
              sr = this.$class.ValueToString(vc2);
            } else {
              sl = pas.SysUtils.UpperCase(this.$class.ValueToString(vc1));
              sr = pas.SysUtils.UpperCase(this.$class.ValueToString(vc2));
            };
            Result = pas.SysUtils.CompareStr(sl,sr);
          } else if ($tmp1 === $impl.TTMSFNCDataGridDataInternalSortFormat.gisfDateTime) {
            dtl = this.$class.ValueToDateTime$1(vc1,pas.SysUtils.TFormatSettings.$clone(fmt));
            dtr = this.$class.ValueToDateTime$1(vc2,pas.SysUtils.TFormatSettings.$clone(fmt));
            Result = pas.DateUtils.CompareDateTime(dtl,dtr);
          } else if ($tmp1 === $impl.TTMSFNCDataGridDataInternalSortFormat.gisfNumericFloat) {
            fl = this.$class.ValueToFloat$1(vc1,pas.SysUtils.TFormatSettings.$clone(fmt));
            fr = this.$class.ValueToFloat$1(vc2,pas.SysUtils.TFormatSettings.$clone(fmt));
            if (sf === $impl.TTMSFNCDataGridDataInternalSortFormat.gisfNumericFloat) {
              Result = pas.Math.CompareValue$3(fl,fr,0.0)}
             else Result = pas.DateUtils.CompareDateTime(fl,fr);
          } else if ($tmp1 === $impl.TTMSFNCDataGridDataInternalSortFormat.gisfNumericInteger) {
            il = this.$class.ValueToInt64$1(vc1,pas.SysUtils.TFormatSettings.$clone(fmt));
            ir = this.$class.ValueToInt64$1(vc2,pas.SysUtils.TFormatSettings.$clone(fmt));
            Result = pas.Math.CompareValue$1(il,ir);
          } else if ($tmp1 === $impl.TTMSFNCDataGridDataInternalSortFormat.gisfBoolean) {
            bl = this.$class.ValueToBoolean$1(vc1,pas.SysUtils.TFormatSettings.$clone(fmt));
            br = this.$class.ValueToBoolean$1(vc2,pas.SysUtils.TFormatSettings.$clone(fmt));
            Result = CompareB(bl,br);
          } else if ($tmp1 === $impl.TTMSFNCDataGridDataInternalSortFormat.gisfCustom) Result = this.DoCustomCompare(AColumn,V1.Row,V2.Row,vc1,vc2,ALevel);
        };
        if (Result === 0) {
          csi1 += 1;
          csi2 += 1;
          if ((csi1 > 0) && (csi1 <= (rtl.length(V1.Data) - 1)) && (csi2 > 0) && (csi2 <= (rtl.length(V2.Data) - 1))) {
            cs1 = V1.Data[csi1].Column;
            Result = this.CompareRows(cs1,ALevel,$mod.TTMSFNCDataGridDataSortInfo.$clone(V1),$mod.TTMSFNCDataGridDataSortInfo.$clone(V2),ACustomCompareCallback);
          };
        } else {
          if (dr === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortDirection.gsdDescending) Result = Result * -1;
        };
      };
      return Result;
    };
    this.CreateCellDataForRow = function (ARowData, AColumn, ARow, AExtended) {
      var Result = null;
      Result = null;
      if ((ARowData != null) && this.IsColumnValid(AColumn)) {
        if (AExtended || this.NeedsItemExtended(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow)))) {
          Result = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemExtended.$create("Create$1",[null])}
         else Result = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItem.$create("Create$1",[null]);
        ARowData.GetData().AddOrSetValue(AColumn,Result);
      };
      return Result;
    };
    this.CreateRowData = function (ARow) {
      var Result = null;
      Result = null;
      if (this.IsRowValid(ARow)) {
        Result = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridRowItem.$create("Create");
        Result.Init();
        this.GetDataDictionary().AddOrSetValue(ARow,Result);
      };
      return Result;
    };
    this.DoCustomColumnCalculation = function (AColumn, ALevel, AFromRow, AToRow) {
      var Result = 0.0;
      Result = 0;
      if (this.FOnCustomColumnCalculation != null) Result = this.FOnCustomColumnCalculation(this,AColumn,ALevel,AFromRow,AToRow);
      return Result;
    };
    this.DoCustomCompare = function (AColumn, ARow1, ARow2, AData1, AData2, ALevel) {
      var Result = 0;
      Result = 0;
      if (this.FOnCustomCompare != null) Result = this.FOnCustomCompare(this,AColumn,ARow1,ARow2,AData1,AData2,ALevel);
      return Result;
    };
    this.DoCustomRowCalculation = function (ARow, AFromColumn, AToColumn) {
      var Result = 0.0;
      Result = 0;
      if (this.FOnCustomRowCalculation != null) Result = this.FOnCustomRowCalculation(this,ARow,AFromColumn,AToColumn);
      return Result;
    };
    this.FetchData = function (ACellData, ACell) {
      var Result = undefined;
      var v = undefined;
      Result = null;
      if ((ACellData != null) && this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell))) {
        v = ACellData.FValue;
        this.DoGetCellData(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),{get: function () {
            return v;
          }, set: function (w) {
            v = w;
          }});
        Result = v;
        this.DoGetCellDataProperties(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),ACellData);
      };
      return Result;
    };
    this.FormatDisplayValue = function (ACell, AValue) {
      var Result = "";
      var s = "";
      var fmt = pas.SysUtils.TFormatSettings.$new();
      var f = $mod.TTMSFNCDataGridDataFormatting.$new();
      var dt = 0.0;
      var d = 0.0;
      var a = false;
      var b = false;
      Result = "";
      if (this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell))) {
        f.$assign($mod.DefaultFormatting());
        fmt.$assign(pas.SysUtils.FormatSettings);
        a = !this.IsCellFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
        this.DoGetCellFormatting(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AValue,f,fmt,{get: function () {
            return a;
          }, set: function (v) {
            a = v;
          }});
        s = "";
        if (!this.$class.ValueIsEmpty(AValue)) {
          if (a) {
            try {
              var $tmp = f.Type;
              if ($tmp === $mod.TTMSFNCDataGridDataFormattingType.gdftDefault) {
                if (f.Format !== "") {
                  s = pas.SysUtils.Format(f.Format,pas.System.VarRecs(18,this.$class.ValueToString(AValue)))}
                 else s = this.$class.ValueToString(AValue);
              } else if ($tmp === $mod.TTMSFNCDataGridDataFormattingType.gdftBoolean) {
                b = this.$class.ValueToBoolean$1(AValue,pas.SysUtils.TFormatSettings.$clone(fmt));
                if ((f.BooleanTrueText !== "") && (f.BooleanFalseText !== "")) {
                  s = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.IfElse$$$G$$WEBLib$TMSFNCUtils$$String(b,f.BooleanTrueText,f.BooleanFalseText)}
                 else s = pas.SysUtils.BoolToStr(b,true);
              } else if (($tmp === $mod.TTMSFNCDataGridDataFormattingType.gdftDateTime) || ($tmp === $mod.TTMSFNCDataGridDataFormattingType.gdftDate) || ($tmp === $mod.TTMSFNCDataGridDataFormattingType.gdftTime)) {
                dt = this.$class.ValueToDateTime$1(AValue,pas.SysUtils.TFormatSettings.$clone(fmt));
                if (f.Format !== "") {
                  s = pas.SysUtils.FormatDateTime$1(f.Format,dt,fmt)}
                 else {
                  var $tmp1 = f.Type;
                  if ($tmp1 === $mod.TTMSFNCDataGridDataFormattingType.gdftDateTime) {
                    s = pas.SysUtils.DateTimeToStr$1(dt,fmt,false)}
                   else if ($tmp1 === $mod.TTMSFNCDataGridDataFormattingType.gdftDate) {
                    s = pas.SysUtils.DateToStr$1(dt,fmt)}
                   else if ($tmp1 === $mod.TTMSFNCDataGridDataFormattingType.gdftTime) s = pas.SysUtils.TimeToStr$1(dt,fmt);
                };
              } else if ($tmp === $mod.TTMSFNCDataGridDataFormattingType.gdftFloat) {
                d = this.$class.ValueToFloat$1(AValue,pas.SysUtils.TFormatSettings.$clone(fmt));
                if (f.Format !== "") {
                  s = pas.SysUtils.FormatFloat(f.Format,d)}
                 else s = pas.SysUtils.FloatToStr$1(d,fmt);
              } else if ($tmp === $mod.TTMSFNCDataGridDataFormattingType.gdftNumber) {
                d = this.$class.ValueToFloat$1(AValue,pas.SysUtils.TFormatSettings.$clone(fmt));
                if (f.Format !== "") {
                  if (pas.System.Pos("%",f.Format) > 0) {
                    s = pas.SysUtils.Format(f.Format,pas.System.VarRecs(3,d))}
                   else s = pas.SysUtils.FormatFloat(f.Format,d);
                } else s = pas.SysUtils.FloatToStr$1(d,fmt);
              };
            } finally {
            };
          } else s = this.$class.ValueToString(AValue);
        };
        Result = s;
      };
      return Result;
    };
    this.ScaleValue = function (Value) {
      var Result = 0.0;
      Result = Value;
      return Result;
    };
    this.UnscaleValue = function (Value) {
      var Result = 0.0;
      Result = Value;
      return Result;
    };
    this.ScaleValue$1 = function (Value) {
      var Result = 0;
      Result = Value;
      return Result;
    };
    this.UnscaleValue$1 = function (Value) {
      var Result = 0;
      Result = Value;
      return Result;
    };
    this.GetAutoFillDirection = function (ACurrentCell, AOriginalSelection) {
      var Result = 0;
      var distDown = 0;
      var distUp = 0;
      var distRight = 0;
      var distLeft = 0;
      var maxVertDist = 0;
      var maxHorizDist = 0;
      var sourceWidth = 0;
      var sourceHeight = 0;
      Result = $mod.TTMSFNCDataGridDataAutoFillDirection.gafdAuto;
      distDown = ACurrentCell.GetRow() - AOriginalSelection.StopCell.GetRow();
      distUp = AOriginalSelection.StartCell.GetRow() - ACurrentCell.GetRow();
      distRight = ACurrentCell.GetColumn() - AOriginalSelection.StopCell.GetColumn();
      distLeft = AOriginalSelection.StartCell.GetColumn() - ACurrentCell.GetColumn();
      sourceWidth = (AOriginalSelection.StopCell.GetColumn() - AOriginalSelection.StartCell.GetColumn()) + 1;
      sourceHeight = (AOriginalSelection.StopCell.GetRow() - AOriginalSelection.StartCell.GetRow()) + 1;
      maxVertDist = Math.max(distDown,distUp);
      maxHorizDist = Math.max(distRight,distLeft);
      if (sourceHeight > sourceWidth) {
        if (maxVertDist > 0) {
          if (distDown >= distUp) {
            Result = $mod.TTMSFNCDataGridDataAutoFillDirection.gafdDown}
           else Result = $mod.TTMSFNCDataGridDataAutoFillDirection.gafdUp;
        } else if (maxHorizDist > 0) {
          if (distRight >= distLeft) {
            Result = $mod.TTMSFNCDataGridDataAutoFillDirection.gafdRight}
           else Result = $mod.TTMSFNCDataGridDataAutoFillDirection.gafdLeft;
        };
      } else if (sourceWidth > sourceHeight) {
        if (maxHorizDist > 0) {
          if (distRight >= distLeft) {
            Result = $mod.TTMSFNCDataGridDataAutoFillDirection.gafdRight}
           else Result = $mod.TTMSFNCDataGridDataAutoFillDirection.gafdLeft;
        } else if (maxVertDist > 0) {
          if (distDown >= distUp) {
            Result = $mod.TTMSFNCDataGridDataAutoFillDirection.gafdDown}
           else Result = $mod.TTMSFNCDataGridDataAutoFillDirection.gafdUp;
        };
      } else {
        if ((maxVertDist >= maxHorizDist) && (maxVertDist > 0)) {
          if (distDown >= distUp) {
            Result = $mod.TTMSFNCDataGridDataAutoFillDirection.gafdDown}
           else Result = $mod.TTMSFNCDataGridDataAutoFillDirection.gafdUp;
        } else if (maxHorizDist > 0) {
          if (distRight >= distLeft) {
            Result = $mod.TTMSFNCDataGridDataAutoFillDirection.gafdRight}
           else Result = $mod.TTMSFNCDataGridDataAutoFillDirection.gafdLeft;
        };
      };
      return Result;
    };
    this.GetBoolean = function (AColumn, ARow) {
      var Result = false;
      var cd = null;
      Result = false;
      cd = this.GetCellData(AColumn,ARow);
      if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd)) Result = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FBooleanValue;
      return Result;
    };
    this.GetCellDataForRow = function (ARowData, AColumn, ARow, AExtended) {
      var Result = null;
      var c = null;
      var cc = null;
      Result = null;
      if ((ARowData != null) && this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow)))) {
        ARowData.GetData().TryGetValue(AColumn,{get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }});
        if (!(c != null)) {
          Result = this.CreateCellDataForRow(ARowData,AColumn,ARow,AExtended)}
         else Result = c;
        if ((c != null) && !pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(c) && (AExtended || this.NeedsItemExtended(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow))))) {
          cc = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItem.$create("Create$1",[null]);
          try {
            cc.Assign(c);
            ARowData.GetData().Remove(AColumn);
            Result = this.CreateCellDataForRow(ARowData,AColumn,ARow,AExtended);
            Result.Assign(cc);
          } finally {
            cc = rtl.freeLoc(cc);
          };
        };
        if ((Result != null) && Result.FInvalid && !this.GetIsLoading()) {
          Result.FInvalid = false;
          this.CreateDisplayValue(Result,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow)),this.FetchData(Result,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow))));
        };
      };
      return Result;
    };
    this.GetColumnCalculationOptions = function () {
      var Result = $mod.TTMSFNCDataGridDataColumnCalculationOptions.$new();
      Result.MergeSummary = this.FOptions.FGrouping.FMergeSummary;
      Result.SummaryInHeader = this.FOptions.FGrouping.FSummaryInHeader;
      Result.CalculationFormat = this.FOptions.FGrouping.FCalculationFormat;
      Result.CalculationFormatType = this.FOptions.FGrouping.FCalculationFormatType;
      return Result;
    };
    this.GetColumnFilterName = function (AColumn) {
      var Result = "";
      Result = this.GetString(AColumn,0);
      if (Result === "") Result = "Column " + pas.SysUtils.IntToStr(AColumn);
      return Result;
    };
    this.GetColumnDataName = function (AColumn) {
      var Result = "";
      if (this.FAdapter != null) {
        Result = this.FAdapter.GetColumnDataName(AColumn)}
       else Result = pas.SysUtils.IntToStr(AColumn);
      return Result;
    };
    this.GetColumnFilterIndex = function (AName) {
      var Result = 0;
      var I = 0;
      var s = "";
      Result = -1;
      for (var $l = 0, $end = this.FColumnCount - 1; $l <= $end; $l++) {
        I = $l;
        s = this.GetColumnFilterName(I);
        if (s === AName) {
          Result = I;
          break;
        };
      };
      return Result;
    };
    this.GetFilterActionsClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCDataGridDataFilterActions;
      return Result;
    };
    this.GetGroupOptions = function () {
      var Result = $mod.TTMSFNCDataGridDataGroupOptions.$new();
      Result.Summary = this.FOptions.FGrouping.FSummary;
      Result.SummaryInHeader = this.FOptions.FGrouping.FSummaryInHeader;
      Result.MergeSummary = this.FOptions.FGrouping.FMergeSummary;
      Result.MergeHeader = this.FOptions.FGrouping.FMergeHeader;
      Result.MergeDelimiter = this.FOptions.FGrouping.FMergeDelimiter;
      Result.HideColumns = this.FOptions.FGrouping.FHideColumns;
      Result.UseFirstRowAsHeader = this.FOptions.FGrouping.FUseFirstRowAsHeader;
      Result.HeaderHeight = this.FOptions.FGrouping.FHeaderHeight;
      Result.SummaryHeight = this.FOptions.FGrouping.FSummaryHeight;
      Result.AutoSort = this.FOptions.FGrouping.FAutoSort;
      return Result;
    };
    this.GetIOOptions = function () {
      var Result = $mod.TTMSFNCDataGridDataInputOutputOptions.$new();
      Result.Delimiter = this.FOptions.FIO.FDelimiter;
      Result.StartColumn = this.FOptions.FIO.FStartColumn;
      Result.StartRow = this.FOptions.FIO.FStartRow;
      Result.AlwaysQuotes = this.FOptions.FIO.FAlwaysQuotes;
      Result.QuoteEmptyCells = this.FOptions.FIO.FQuoteEmptyCells;
      Result.MaxRows = this.FOptions.FIO.FMaxRows;
      Result.TrimSpaces = this.FOptions.FIO.FTrimSpaces;
      return Result;
    };
    this.GetOptionsClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCDataGridDataOptions;
      return Result;
    };
    this.GetRowCalculationOptions = function () {
      var Result = $mod.TTMSFNCDataGridDataRowCalculationOptions.$new();
      Result.CalculationFormat = this.FOptions.FGrouping.FCalculationFormat;
      Result.CalculationFormatType = this.FOptions.FGrouping.FCalculationFormatType;
      return Result;
    };
    this.GetRowData = function (ARow) {
      var Result = null;
      Result = null;
      if (this.IsRowValid(ARow)) {
        this.GetDataDictionary().TryGetValue(ARow,{get: function () {
            return Result;
          }, set: function (v) {
            Result = v;
          }});
        if (!(Result != null)) Result = this.CreateRowData(ARow);
      };
      return Result;
    };
    this.GetSelection = function () {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoordRange.$new();
      Result.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCellRange(-1,-1,-1,-1));
      return Result;
    };
    this.GetSortOptions = function () {
      var Result = $mod.TTMSFNCDataGridDataSortOptions.$new();
      Result.Format = this.FOptions.FSorting.FFormat;
      Result.Direction = this.FOptions.FSorting.FDirection;
      Result.CaseSensitive = this.FOptions.FSorting.FCaseSensitive;
      Result.FormatSettings.$assign(pas.SysUtils.FormatSettings);
      return Result;
    };
    this.DetectAlphabeticPattern = function (AFirst, ASecond, AFormatSettings) {
      var Result = 0;
      var firstIndex = 0;
      var secondIndex = 0;
      var i = 0;
      Result = 0;
      firstIndex = -1;
      secondIndex = -1;
      for (i = 1; i <= 7; i++) {
        if (pas.SysUtils.SameText(AFirst,AFormatSettings.LongDayNames[i - 1])) firstIndex = i - 1;
        if (pas.SysUtils.SameText(ASecond,AFormatSettings.LongDayNames[i - 1])) secondIndex = i - 1;
      };
      if ((firstIndex >= 0) && (secondIndex >= 0)) {
        Result = ((secondIndex - firstIndex) + 7) % 7;
        if (Result === 0) Result = 1;
        return Result;
      };
      firstIndex = -1;
      secondIndex = -1;
      for (i = 1; i <= 7; i++) {
        if (pas.SysUtils.SameText(AFirst,AFormatSettings.ShortDayNames[i - 1])) firstIndex = i - 1;
        if (pas.SysUtils.SameText(ASecond,AFormatSettings.ShortDayNames[i - 1])) secondIndex = i - 1;
      };
      if ((firstIndex >= 0) && (secondIndex >= 0)) {
        Result = ((secondIndex - firstIndex) + 7) % 7;
        if (Result === 0) Result = 1;
        return Result;
      };
      firstIndex = -1;
      secondIndex = -1;
      for (i = 1; i <= 12; i++) {
        if (pas.SysUtils.SameText(AFirst,AFormatSettings.LongMonthNames[i - 1])) firstIndex = i - 1;
        if (pas.SysUtils.SameText(ASecond,AFormatSettings.LongMonthNames[i - 1])) secondIndex = i - 1;
      };
      if ((firstIndex >= 0) && (secondIndex >= 0)) {
        Result = ((secondIndex - firstIndex) + 12) % 12;
        if (Result === 0) Result = 1;
        return Result;
      };
      firstIndex = -1;
      secondIndex = -1;
      for (i = 1; i <= 12; i++) {
        if (pas.SysUtils.SameText(AFirst,AFormatSettings.ShortMonthNames[i - 1])) firstIndex = i - 1;
        if (pas.SysUtils.SameText(ASecond,AFormatSettings.ShortMonthNames[i - 1])) secondIndex = i - 1;
      };
      if ((firstIndex >= 0) && (secondIndex >= 0)) {
        Result = ((secondIndex - firstIndex) + 12) % 12;
        if (Result === 0) Result = 1;
      };
      return Result;
    };
    this.DetectSingleValuePattern = function (AValue, AFormatSettings, AStep, AFillType) {
      var Result = false;
      var i = 0;
      Result = false;
      for (i = 1; i <= 7; i++) {
        if (pas.SysUtils.SameText(AValue,AFormatSettings.LongDayNames[i - 1])) {
          AStep.set(1);
          AFillType.set($mod.TTMSFNCDataGridDataAutoFillType.gaftAlphabetic);
          Result = true;
          return Result;
        };
      };
      for (i = 1; i <= 7; i++) {
        if (pas.SysUtils.SameText(AValue,AFormatSettings.ShortDayNames[i - 1])) {
          AStep.set(1);
          AFillType.set($mod.TTMSFNCDataGridDataAutoFillType.gaftAlphabetic);
          Result = true;
          return Result;
        };
      };
      for (i = 1; i <= 12; i++) {
        if (pas.SysUtils.SameText(AValue,AFormatSettings.LongMonthNames[i - 1])) {
          AStep.set(1);
          AFillType.set($mod.TTMSFNCDataGridDataAutoFillType.gaftAlphabetic);
          Result = true;
          return Result;
        };
      };
      for (i = 1; i <= 12; i++) {
        if (pas.SysUtils.SameText(AValue,AFormatSettings.ShortMonthNames[i - 1])) {
          AStep.set(1);
          AFillType.set($mod.TTMSFNCDataGridDataAutoFillType.gaftAlphabetic);
          Result = true;
          return Result;
        };
      };
      return Result;
    };
    this.HasMergedCells = function (AColumns, AFromRow, AToRow) {
      var Result = false;
      var J = 0;
      var M = 0;
      Result = false;
      for (var $l = 0, $end = rtl.length(AColumns) - 1; $l <= $end; $l++) {
        J = $l;
        for (var $l1 = AFromRow, $end1 = AToRow; $l1 <= $end1; $l1++) {
          M = $l1;
          if (this.IsCellMerged(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumns[J],M)))) {
            Result = true;
            return Result;
          };
        };
      };
      return Result;
    };
    this.InternalColumnCustomCalculation = function (AColumn, ALevel, ACustomCalculationCallback, AFromRow, AToRow) {
      var Result = 0.0;
      if ((AFromRow === -1) || (AToRow === -1)) {
        AFromRow = this.FFixedRowCount;
        AToRow = this.FRowCount - 1 - this.FFixedBottomRowCount;
      };
      if (ACustomCalculationCallback != null) {
        Result = ACustomCalculationCallback(AColumn,ALevel,AFromRow,AToRow)}
       else Result = this.DoCustomColumnCalculation(AColumn,ALevel,AFromRow,AToRow);
      return Result;
    };
    this.InternalFind = function (AStartCell, AText, AParameters) {
      var $Self = this;
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var MaxCol = 0;
      var MinCol = 0;
      var MaxRow = 0;
      var MinRow = 0;
      var i = 0;
      var j = 0;
      var sel = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoordRange.$new();
      function GetNodeFromRow(r) {
        var Result = 0;
        var k = 0;
        var l = 0;
        k = $Self.FFixedRowCount;
        l = $Self.FFixedRowCount;
        while (k < ($Self.FRowCount - 1)) {
          if ($Self.IsRowNode(k)) l = l + $Self.RowSpan(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell($Self.FFixedColumnCount,k)));
          if (l >= r) {
            break}
           else k += 1;
        };
        Result = k;
        return Result;
      };
      Result.SetColumn(-1);
      Result.SetRow(-1);
      if (!($mod.TTMSFNCDataGridDataFindParameter.gfnMatchCase in AParameters)) {
        this.FFindCache = pas.SysUtils.UpperCase(AText)}
       else this.FFindCache = AText;
      this.FFindParameters = rtl.refSet(AParameters);
      if ((this.FColumnCount === this.FFixedColumnCount) || (this.FColumnCount === 0)) return Result;
      if ((this.FRowCount === this.FFixedRowCount) || (this.FRowCount === 0)) return Result;
      if ($mod.TTMSFNCDataGridDataFindParameter.gfnIncludeFixed in AParameters) {
        MaxCol = this.FColumnCount - 1;
        MaxRow = this.FRowCount - 1;
        MinCol = 0;
        MinRow = 0;
      } else {
        MaxCol = this.FColumnCount - 1 - this.FFixedRightColumnCount;
        MaxRow = this.FRowCount - 1 - this.FFixedBottomRowCount;
        MinCol = this.FFixedColumnCount;
        MinRow = this.FFixedRowCount;
      };
      if ($mod.TTMSFNCDataGridDataFindParameter.gfnSelectedCells in AParameters) {
        sel.$assign(this.GetSelection());
        MaxCol = sel.StopCell.GetColumn();
        MaxRow = sel.StopCell.GetRow();
        MinCol = sel.StartCell.GetColumn();
        MinRow = sel.StartCell.GetRow();
      };
      if ((AStartCell.GetColumn() === -1) && (AStartCell.GetRow() === -1)) {
        if ($mod.TTMSFNCDataGridDataFindParameter.gfnBackward in AParameters) {
          AStartCell.SetColumn(MaxCol);
          AStartCell.SetRow(MaxRow);
        } else {
          AStartCell.SetColumn(MinCol);
          AStartCell.SetRow(MinRow);
        };
      } else {
        if ($mod.TTMSFNCDataGridDataFindParameter.gfnDirectionLeftRight in AParameters) {
          if ($mod.TTMSFNCDataGridDataFindParameter.gfnBackward in AParameters) {
            if (AStartCell.GetColumn() >= MinCol) {
              AStartCell.SetColumn(AStartCell.GetColumn() - 1)}
             else {
              if (AStartCell.GetRow() >= MinRow) {
                AStartCell.SetRow(AStartCell.GetRow() - 1)}
               else {
                AStartCell.SetColumn(MaxCol);
                AStartCell.SetRow(MaxRow);
              };
            };
          } else {
            if (AStartCell.GetColumn() <= MaxCol) {
              AStartCell.SetColumn(AStartCell.GetColumn() + 1)}
             else {
              if (AStartCell.GetRow() <= MaxRow) {
                AStartCell.SetRow(AStartCell.GetRow() + 1)}
               else {
                AStartCell.SetColumn(MinCol);
                AStartCell.SetRow(MinRow);
              };
            };
          };
        } else {
          if ($mod.TTMSFNCDataGridDataFindParameter.gfnBackward in AParameters) {
            if (AStartCell.GetRow() >= MinRow) {
              AStartCell.SetRow(AStartCell.GetRow() - 1)}
             else {
              if (AStartCell.GetColumn() >= MinCol) {
                AStartCell.SetColumn(AStartCell.GetColumn() - 1)}
               else {
                AStartCell.SetColumn(MaxCol);
                AStartCell.SetRow(MaxRow);
              };
            };
          } else {
            if (AStartCell.GetRow() <= MaxRow) {
              AStartCell.SetRow(AStartCell.GetRow() + 1)}
             else {
              if (AStartCell.GetColumn() <= MaxCol) {
                AStartCell.SetColumn(AStartCell.GetColumn() + 1)}
               else {
                AStartCell.SetColumn(MinCol);
                AStartCell.SetRow(MinRow);
              };
            };
          };
        };
      };
      i = AStartCell.GetColumn();
      j = AStartCell.GetRow();
      if ($mod.TTMSFNCDataGridDataFindParameter.gfnFindInCurrentRow in AParameters) {
        j = this.GetStartRow();
        MaxRow = j;
        MinRow = j;
      };
      if ($mod.TTMSFNCDataGridDataFindParameter.gfnFindInPresetRow in AParameters) {
        j = this.FOptions.FFind.FRow;
        MaxRow = j;
        MinRow = j;
      };
      if ($mod.TTMSFNCDataGridDataFindParameter.gfnFindInCurrentColumn in AParameters) {
        i = this.GetStartColumn();
        MaxCol = i;
        MinCol = i;
      };
      if ($mod.TTMSFNCDataGridDataFindParameter.gfnFindInPresetColumn in AParameters) {
        i = this.FOptions.FFind.FColumn;
        MaxCol = i;
        MinCol = i;
      };
      AStartCell.SetColumn(i);
      AStartCell.SetRow(j);
      if ($mod.TTMSFNCDataGridDataFindParameter.gfnDirectionLeftRight in AParameters) {
        while ((j <= MaxRow) && (j >= MinRow)) {
          while ((i <= MaxCol) && (i >= MinCol)) {
            if (this.MatchCell(i,j)) {
              this.FFindCell.SetColumn(i);
              this.FFindCell.SetRow(j);
              Result.$assign(this.FFindCell);
              if ($mod.TTMSFNCDataGridDataFindParameter.gfnAutoGoto in AParameters) this.GoToCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Result),true);
              return Result;
            };
            if ($mod.TTMSFNCDataGridDataFindParameter.gfnBackward in AParameters) {
              i -= 1}
             else i += 1;
          };
          if ($mod.TTMSFNCDataGridDataFindParameter.gfnFindInCurrentColumn in AParameters) {
            i = this.GetStartColumn()}
           else {
            if ($mod.TTMSFNCDataGridDataFindParameter.gfnBackward in AParameters) {
              i = MaxCol}
             else i = MinCol;
          };
          if ($mod.TTMSFNCDataGridDataFindParameter.gfnBackward in AParameters) {
            j -= 1}
           else j += 1;
        };
      } else {
        while ((i <= MaxCol) && (i >= MinCol)) {
          while ((j <= MaxRow) && (j >= MinRow)) {
            if (this.MatchCell(i,j)) {
              this.FFindCell.SetColumn(i);
              this.FFindCell.SetRow(j);
              Result.$assign(this.FFindCell);
              if ($mod.TTMSFNCDataGridDataFindParameter.gfnAutoGoto in AParameters) this.GoToCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Result),true);
              return Result;
            };
            if ($mod.TTMSFNCDataGridDataFindParameter.gfnBackward in AParameters) {
              j -= 1}
             else j += 1;
          };
          if ($mod.TTMSFNCDataGridDataFindParameter.gfnFindInCurrentRow in AParameters) {
            j = this.GetStartRow()}
           else {
            if ($mod.TTMSFNCDataGridDataFindParameter.gfnBackward in AParameters) {
              j = MaxRow}
             else j = MinRow;
          };
          if ($mod.TTMSFNCDataGridDataFindParameter.gfnBackward in AParameters) {
            i -= 1}
           else i += 1;
        };
      };
      return Result;
    };
    this.InternalGroup = function (AGroupDictionary, AGroupInfo, ALevel, AFromRow, AToRow, ACustomGroupCallback, ACustomCompareCallback, AGroupOptionsCallback, ASortOptionsCallback) {
      var $Self = this;
      var Result = 0;
      var I = 0;
      var k = "";
      var vh = "";
      var grp = null;
      var agrp = null;
      var grpi = $mod.TTMSFNCDataGridDataGroupInfo.$new();
      var opt = $mod.TTMSFNCDataGridDataGroupOptions.$new();
      function GetGroupMergedValue(ARow) {
        var Result = "";
        var K = 0;
        var v = "";
        var c = 0;
        var d = undefined;
        Result = "";
        for (var $l = 0, $end = rtl.length(AGroupInfo.Columns) - 1; $l <= $end; $l++) {
          K = $l;
          c = AGroupInfo.Columns[K];
          v = $Self.GetString(c,ARow);
          d = $Self.GetCell(c,ARow);
          if (opt.UseFirstRowAsHeader) {
            vh = $Self.GetString(c,0);
            if (vh !== "") v = $Self.GetString(c,0) + ": " + v;
          };
          if (ACustomGroupCallback != null) {
            ACustomGroupCallback(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,ARow)),d,ALevel,{get: function () {
                return v;
              }, set: function (w) {
                v = w;
              }})}
           else $Self.DoGetCustomGroup(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,ARow)),d,ALevel,{get: function () {
              return v;
            }, set: function (w) {
              v = w;
            }});
          Result = Result + v;
          if (K < (rtl.length(AGroupInfo.Columns) - 1)) Result = Result + opt.MergeDelimiter;
        };
        return Result;
      };
      function FinishGroup() {
        if (agrp != null) {
          if (opt.Summary && !opt.SummaryInHeader && (agrp != null)) {
            if ($Self.CanInsertRow(I)) {
              $Self.InsertRow(I)}
             else $Self.AddRow();
            $Self.SetRowType(I,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowType.grtSummary);
            $Self.SetRowHeight(I,opt.SummaryHeight);
            $Self.SetRowNodeChildCount(agrp.FRow,I - agrp.FRow - 1);
            $Self.SetRowNodeLevel(I,ALevel);
            agrp.FSummaryRow = I;
            if (opt.MergeSummary) $Self.MergeCells($Self.FFixedColumnCount,I,$Self.FColumnCount - $Self.FFixedRightColumnCount - $Self.FFixedColumnCount,1);
            I += 1;
            AToRow += 1;
            Result += 1;
          } else $Self.SetRowNodeChildCount(agrp.FRow,I - agrp.FRow - 1);
        };
      };
      function SubGroup() {
        var rt = 0;
        if ((rtl.length(AGroupInfo.SubColumns) > 0) && (agrp != null)) {
          grpi.Columns = AGroupInfo.SubColumns[0].Columns;
          grpi.SubColumns = AGroupInfo.SubColumns[0].SubColumns;
          grpi.SortColumns = AGroupInfo.SubColumns[0].SortColumns;
          grpi.SortDirections = AGroupInfo.SubColumns[0].SortDirections;
          rt = $Self.InternalGroup(agrp.GetGroupDictionary(),$mod.TTMSFNCDataGridDataGroupInfo.$clone(grpi),ALevel + 1,agrp.FRow + 1,I - 1,ACustomGroupCallback,ACustomCompareCallback,AGroupOptionsCallback,ASortOptionsCallback);
          I = I + rt;
          AToRow = AToRow + rt;
          Result = Result + rt;
        };
      };
      Result = 0;
      if (rtl.length(AGroupInfo.Columns) === 0) {
        this.LogMessage("No columns available for grouping.",pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridLogMessageType.glmInfo);
        return Result;
      };
      for (var $l = 0, $end = rtl.length(AGroupInfo.Columns) - 1; $l <= $end; $l++) {
        I = $l;
        if (!this.IsColumnValid(AGroupInfo.Columns[I])) {
          this.LogMessage("Column(s) [" + this.FormatArray(AGroupInfo.Columns) + "] cannot be grouped.",pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridLogMessageType.glmInfo);
          return Result;
        };
      };
      if (this.FAdapter != null) {
        var $tmp = this.FAdapter.GroupMode();
        if (($tmp === $mod.TTMSFNCDataGridDataAdapterGroupMode.agmAdapter) || ($tmp === $mod.TTMSFNCDataGridDataAdapterGroupMode.agmNone)) throw pas.SysUtils.Exception.$create("Create$1",[rtl.getResStr($mod,"sTMSFNCDataGridDataGroupingError")]);
      };
      this.BeginUpdate();
      this.FUpdateGrouping += 1;
      try {
        opt.$assign(this.GetGroupOptions());
        if (AGroupOptionsCallback != null) {
          AGroupOptionsCallback(AGroupInfo.Columns,ALevel,opt)}
         else this.DoGetGroupOptions(AGroupInfo.Columns,ALevel,opt);
        agrp = null;
        this.GetSortIndexList().Clear();
        for (var $l1 = 0, $end1 = rtl.length(AGroupInfo.Columns) - 1; $l1 <= $end1; $l1++) {
          I = $l1;
          if (rtl.length(AGroupInfo.SortColumns) > 0) {
            if (I <= (rtl.length(AGroupInfo.SortDirections) - 1)) {
              this.GetSortIndexList().Add$1(AGroupInfo.SortColumns[I],AGroupInfo.SortDirections[I])}
             else this.GetSortIndexList().Add$1(AGroupInfo.SortColumns[I],this.FOptions.FSorting.FDirection);
          } else {
            if (I <= (rtl.length(AGroupInfo.SortDirections) - 1)) {
              this.GetSortIndexList().Add$1(AGroupInfo.Columns[I],AGroupInfo.SortDirections[I])}
             else this.GetSortIndexList().Add$1(AGroupInfo.Columns[I],this.FOptions.FSorting.FDirection);
          };
        };
        if ((AToRow - AFromRow) > 1) {
          if (rtl.length(AGroupInfo.SortColumns) > 0) {
            this.InternalSort(AGroupInfo.SortColumns,AGroupInfo.SortDirections,ALevel,AFromRow,AToRow,ACustomCompareCallback,ASortOptionsCallback)}
           else if (opt.AutoSort) this.InternalSort(AGroupInfo.Columns,AGroupInfo.SortDirections,ALevel,AFromRow,AToRow,ACustomCompareCallback,ASortOptionsCallback);
        };
        I = AFromRow;
        while (I <= AToRow) {
          k = GetGroupMergedValue(I);
          if (!AGroupDictionary.TryGetValue(k,{get: function () {
              return grp;
            }, set: function (v) {
              grp = v;
            }})) {
            SubGroup();
            FinishGroup();
            this.InsertRow(I);
            this.SetRowHeight(I,opt.HeaderHeight);
            AToRow += 1;
            Result += 1;
            if (opt.MergeHeader && ((!opt.SummaryInHeader && opt.Summary) || !opt.Summary)) this.MergeCells(this.FFixedColumnCount,I,this.FColumnCount - this.FFixedRightColumnCount - this.FFixedColumnCount,1);
            this.SetCell(this.FFixedColumnCount,I,k);
            this.SetRowType(I,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowType.grtNode);
            this.SetRowNodeLevel(I,ALevel);
            grp = $mod.TTMSFNCDataGridDataGroup.$create("Create");
            grp.FSummaryRow = -1;
            grp.FRow = I;
            AGroupDictionary.Add(k,grp);
            agrp = grp;
          } else this.SetRowNodeLevel(I,ALevel + 1);
          I += 1;
        };
        SubGroup();
        FinishGroup();
        if (opt.HideColumns) {
          for (var $l2 = 0, $end2 = rtl.length(AGroupInfo.Columns) - 1; $l2 <= $end2; $l2++) {
            I = $l2;
            this.HideColumn(AGroupInfo.Columns[I]);
          };
        };
        if (this.FFilterApplied) this.InternalFilterGroups(AGroupDictionary);
      } finally {
        this.FGroupInfo.$assign(AGroupInfo);
        this.FUpdateGrouping -= 1;
        this.EndUpdate();
      };
      return Result;
    };
    this.MatchCell = function (AColumn, ARow) {
      var Result = false;
      var res1 = false;
      var res2 = false;
      var ct = "";
      var cs = "";
      var ic = 0;
      var s = "";
      if (!($mod.TTMSFNCDataGridDataFindParameter.gfnIncludeHiddenColumns in this.FFindParameters) && this.IsColumnHidden(AColumn)) {
        Result = false;
        return Result;
      };
      if (!($mod.TTMSFNCDataGridDataFindParameter.gfnIncludeHiddenRows in this.FFindParameters) && this.IsRowHidden(ARow)) {
        Result = false;
        return Result;
      };
      s = this.FFindCache;
      res2 = true;
      cs = this.GetString(AColumn,ARow);
      if (!($mod.TTMSFNCDataGridDataFindParameter.gfnMatchCase in this.FFindParameters)) {
        ct = pas.SysUtils.UpperCase(cs)}
       else ct = cs;
      if ($mod.TTMSFNCDataGridDataFindParameter.gfnIgnoreHTMLTags in this.FFindParameters) {
        ct = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.HTMLStrip(ct);
        ct = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.UnFixMarkup(ct,true,false);
      };
      if ((s === '""') || (s === "")) {
        Result = ct === "";
        return Result;
      };
      ic = pas.System.Pos(s,ct);
      if ($mod.TTMSFNCDataGridDataFindParameter.gfnMatchStart in this.FFindParameters) {
        res1 = ic === 1}
       else res1 = ic > 0;
      if ($mod.TTMSFNCDataGridDataFindParameter.gfnMatchFull in this.FFindParameters) res2 = s === ct;
      if ($mod.TTMSFNCDataGridDataFindParameter.gfnMatchRegular in this.FFindParameters) {
        Result = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MatchStrEx(s,ct,$mod.TTMSFNCDataGridDataFindParameter.gfnMatchCase in this.FFindParameters)}
       else Result = res1 && res2;
      return Result;
    };
    this.NeedsItemExtended = function (ACell) {
      var Result = false;
      Result = false;
      if (this.FAdapter != null) Result = rtl.as(this.FAdapter,$mod.TTMSFNCDataGridDataAdapter).NeedsItemExtended(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
      return Result;
    };
    this.DetectDayMonthPattern = function (AFirst, ASecond, AFormatSettings, AStep) {
      var Result = false;
      var firstIndex = 0;
      var secondIndex = 0;
      var i = 0;
      Result = false;
      firstIndex = -1;
      secondIndex = -1;
      for (i = 1; i <= 7; i++) {
        if (pas.SysUtils.SameText(AFirst,AFormatSettings.LongDayNames[i - 1])) firstIndex = i - 1;
        if (pas.SysUtils.SameText(ASecond,AFormatSettings.LongDayNames[i - 1])) secondIndex = i - 1;
      };
      if ((firstIndex >= 0) && (secondIndex >= 0)) {
        AStep.set(((secondIndex - firstIndex) + 7) % 7);
        if (this.$class.ValueToInteger(AStep.get()) === 0) AStep.set(1);
        Result = true;
        return Result;
      };
      firstIndex = -1;
      secondIndex = -1;
      for (i = 1; i <= 7; i++) {
        if (pas.SysUtils.SameText(AFirst,AFormatSettings.ShortDayNames[i - 1])) firstIndex = i - 1;
        if (pas.SysUtils.SameText(ASecond,AFormatSettings.ShortDayNames[i - 1])) secondIndex = i - 1;
      };
      if ((firstIndex >= 0) && (secondIndex >= 0)) {
        AStep.set(((secondIndex - firstIndex) + 7) % 7);
        if (this.$class.ValueToInteger(AStep.get()) === 0) AStep.set(1);
        Result = true;
        return Result;
      };
      firstIndex = -1;
      secondIndex = -1;
      for (i = 1; i <= 7; i++) {
        if (pas.SysUtils.SameText(AFirst,$impl.EnglishLongDayNames[i - 1])) firstIndex = i - 1;
        if (pas.SysUtils.SameText(ASecond,$impl.EnglishLongDayNames[i - 1])) secondIndex = i - 1;
      };
      if ((firstIndex >= 0) && (secondIndex >= 0)) {
        AStep.set(((secondIndex - firstIndex) + 7) % 7);
        if (this.$class.ValueToInteger(AStep.get()) === 0) AStep.set(1);
        Result = true;
        return Result;
      };
      firstIndex = -1;
      secondIndex = -1;
      for (i = 1; i <= 7; i++) {
        if (pas.SysUtils.SameText(AFirst,$impl.EnglishShortDayNames[i - 1])) firstIndex = i - 1;
        if (pas.SysUtils.SameText(ASecond,$impl.EnglishShortDayNames[i - 1])) secondIndex = i - 1;
      };
      if ((firstIndex >= 0) && (secondIndex >= 0)) {
        AStep.set(((secondIndex - firstIndex) + 7) % 7);
        if (this.$class.ValueToInteger(AStep.get()) === 0) AStep.set(1);
        Result = true;
        return Result;
      };
      firstIndex = -1;
      secondIndex = -1;
      for (i = 1; i <= 12; i++) {
        if (pas.SysUtils.SameText(AFirst,AFormatSettings.LongMonthNames[i - 1])) firstIndex = i - 1;
        if (pas.SysUtils.SameText(ASecond,AFormatSettings.LongMonthNames[i - 1])) secondIndex = i - 1;
      };
      if ((firstIndex >= 0) && (secondIndex >= 0)) {
        AStep.set(((secondIndex - firstIndex) + 12) % 12);
        if (this.$class.ValueToInteger(AStep.get()) === 0) AStep.set(1);
        Result = true;
        return Result;
      };
      firstIndex = -1;
      secondIndex = -1;
      for (i = 1; i <= 12; i++) {
        if (pas.SysUtils.SameText(AFirst,AFormatSettings.ShortMonthNames[i - 1])) firstIndex = i - 1;
        if (pas.SysUtils.SameText(ASecond,AFormatSettings.ShortMonthNames[i - 1])) secondIndex = i - 1;
      };
      if ((firstIndex >= 0) && (secondIndex >= 0)) {
        AStep.set(((secondIndex - firstIndex) + 12) % 12);
        if (this.$class.ValueToInteger(AStep.get()) === 0) AStep.set(1);
        Result = true;
        return Result;
      };
      firstIndex = -1;
      secondIndex = -1;
      for (i = 1; i <= 12; i++) {
        if (pas.SysUtils.SameText(AFirst,$impl.EnglishLongMonthNames[i - 1])) firstIndex = i - 1;
        if (pas.SysUtils.SameText(ASecond,$impl.EnglishLongMonthNames[i - 1])) secondIndex = i - 1;
      };
      if ((firstIndex >= 0) && (secondIndex >= 0)) {
        AStep.set(((secondIndex - firstIndex) + 12) % 12);
        if (this.$class.ValueToInteger(AStep.get()) === 0) AStep.set(1);
        Result = true;
        return Result;
      };
      firstIndex = -1;
      secondIndex = -1;
      for (i = 1; i <= 12; i++) {
        if (pas.SysUtils.SameText(AFirst,$impl.EnglishShortMonthNames[i - 1])) firstIndex = i - 1;
        if (pas.SysUtils.SameText(ASecond,$impl.EnglishShortMonthNames[i - 1])) secondIndex = i - 1;
      };
      if ((firstIndex >= 0) && (secondIndex >= 0)) {
        AStep.set(((secondIndex - firstIndex) + 12) % 12);
        if (this.$class.ValueToInteger(AStep.get()) === 0) AStep.set(1);
        Result = true;
      };
      return Result;
    };
    this.DetectSingleDayMonthName = function (AValue, AFormatSettings, ABaseIndex) {
      var Result = false;
      var i = 0;
      Result = false;
      ABaseIndex.set(-1);
      for (i = 1; i <= 7; i++) {
        if (pas.SysUtils.SameText(AValue,AFormatSettings.LongDayNames[i - 1])) {
          ABaseIndex.set(i - 1);
          return true;
        };
      };
      for (i = 1; i <= 7; i++) {
        if (pas.SysUtils.SameText(AValue,AFormatSettings.ShortDayNames[i - 1])) {
          ABaseIndex.set(i - 1);
          return true;
        };
      };
      for (i = 1; i <= 7; i++) {
        if (pas.SysUtils.SameText(AValue,$impl.EnglishLongDayNames[i - 1])) {
          ABaseIndex.set(i - 1);
          return true;
        };
      };
      for (i = 1; i <= 7; i++) {
        if (pas.SysUtils.SameText(AValue,$impl.EnglishShortDayNames[i - 1])) {
          ABaseIndex.set(i - 1);
          return true;
        };
      };
      for (i = 1; i <= 12; i++) {
        if (pas.SysUtils.SameText(AValue,AFormatSettings.LongMonthNames[i - 1])) {
          ABaseIndex.set(i - 1);
          return true;
        };
      };
      for (i = 1; i <= 12; i++) {
        if (pas.SysUtils.SameText(AValue,AFormatSettings.ShortMonthNames[i - 1])) {
          ABaseIndex.set(i - 1);
          return true;
        };
      };
      for (i = 1; i <= 12; i++) {
        if (pas.SysUtils.SameText(AValue,$impl.EnglishLongMonthNames[i - 1])) {
          ABaseIndex.set(i - 1);
          return true;
        };
      };
      for (i = 1; i <= 12; i++) {
        if (pas.SysUtils.SameText(AValue,$impl.EnglishShortMonthNames[i - 1])) {
          ABaseIndex.set(i - 1);
          return true;
        };
      };
      return Result;
    };
    this.AnalyzeAutoFillPattern = function (ASourceRange, ASourceValues, AParams, ADirection, AFormatSettings) {
      var $Self = this;
      var row = 0;
      var col = 0;
      var idx = 0;
      var sourceWidth = 0;
      var sourceHeight = 0;
      var lane = 0;
      var i = 0;
      var laneValues = [];
      var nums = [];
      var intercept = 0.0;
      var slope = 0.0;
      var v = undefined;
      var v1 = undefined;
      var v2 = undefined;
      var f = $mod.TTMSFNCDataGridDataFormatting.$new();
      var a = false;
      var tv1 = pas.RTTI.TValue.$new();
      var tv2 = pas.RTTI.TValue.$new();
      var D1 = 0.0;
      var D2 = 0.0;
      var I1 = 0;
      var I2 = 0;
      var dt1 = 0.0;
      var dt2 = 0.0;
      var p1 = "";
      var p2 = "";
      var s1 = "";
      var s2 = "";
      var n1 = 0;
      var n2 = 0;
      var w1 = 0;
      var w2 = 0;
      var tmpStep = undefined;
      var baseSeed = undefined;
      var baseStr = "";
      var norm = "";
      var entry = $mod.TTMSFNCDataGridDataCustomListIndexEntry.$new();
      var evList = [];
      var allLanesSingleValue = false;
      function IsTimeOnlyString(S) {
        var Result = false;
        var colonPos = 0;
        var secondColonPos = 0;
        var hourPart = "";
        var minPart = "";
        var h = 0;
        var m = 0;
        Result = false;
        colonPos = pas.System.Pos(":",S);
        if (colonPos < 1) return Result;
        if ((pas.System.Pos("/",S) > 0) || (pas.System.Pos("-",S) > 0)) return Result;
        hourPart = pas.SysUtils.Trim(pas.System.Copy(S,1,colonPos - 1));
        secondColonPos = pas.System.Pos$1(":",S,colonPos + 1);
        if (secondColonPos > 0) {
          minPart = pas.SysUtils.Trim(pas.System.Copy(S,colonPos + 1,secondColonPos - colonPos - 1))}
         else minPart = pas.SysUtils.Trim(pas.System.Copy(S,colonPos + 1,2147483647));
        if (pas.SysUtils.TryStrToInt(hourPart,{get: function () {
            return h;
          }, set: function (v) {
            h = v;
          }}) && pas.SysUtils.TryStrToInt(minPart,{get: function () {
            return m;
          }, set: function (v) {
            m = v;
          }})) Result = (h >= 0) && (h <= 23) && (m >= 0) && (m <= 59);
        return Result;
      };
      function TryParseTimeString(S, DT) {
        var Result = false;
        var colonPos = 0;
        var secondColonPos = 0;
        var hourPart = "";
        var minPart = "";
        var secPart = "";
        var h = 0;
        var m = 0;
        var sec = 0;
        Result = false;
        colonPos = pas.System.Pos(":",S);
        if (colonPos < 1) return Result;
        hourPart = pas.SysUtils.Trim(pas.System.Copy(S,1,colonPos - 1));
        secondColonPos = pas.System.Pos$1(":",S,colonPos + 1);
        if (secondColonPos > 0) {
          minPart = pas.SysUtils.Trim(pas.System.Copy(S,colonPos + 1,secondColonPos - colonPos - 1));
          secPart = pas.SysUtils.Trim(pas.System.Copy(S,secondColonPos + 1,2147483647));
        } else {
          minPart = pas.SysUtils.Trim(pas.System.Copy(S,colonPos + 1,2147483647));
          secPart = "0";
        };
        if (pas.SysUtils.TryStrToInt(hourPart,{get: function () {
            return h;
          }, set: function (v) {
            h = v;
          }}) && pas.SysUtils.TryStrToInt(minPart,{get: function () {
            return m;
          }, set: function (v) {
            m = v;
          }}) && pas.SysUtils.TryStrToInt(secPart,{get: function () {
            return sec;
          }, set: function (v) {
            sec = v;
          }})) {
          if ((h >= 0) && (h <= 23) && (m >= 0) && (m <= 59) && (sec >= 0) && (sec <= 59)) {
            DT.set(pas.SysUtils.EncodeTime(h,m,sec,0));
            Result = true;
          };
        };
        return Result;
      };
      function TryGetNumericValue(V, D) {
        var Result = false;
        var s = "";
        Result = false;
        if ($Self.$class.ValueIsFloat(V)) {
          D.set($Self.$class.ValueToFloat(V));
          return true;
        };
        if ($Self.$class.ValueIsInteger(V)) {
          D.set($Self.$class.ValueToInteger(V));
          return true;
        };
        if ($Self.$class.ValueIsString(V)) {
          s = $Self.$class.ValueToString$1(V,pas.SysUtils.TFormatSettings.$clone(AFormatSettings));
          if (pas.System.Pos(":",s) > 0) return false;
          return pas.SysUtils.TryStrToFloat$3(s,D,AFormatSettings);
        };
        return Result;
      };
      function TryLaneNumericArray(LV, Arr) {
        var Result = false;
        var j = 0;
        var d = 0.0;
        Arr.set(rtl.arraySetLength(Arr.get(),0.0,rtl.length(LV)));
        for (var $l = 0, $end = rtl.length(LV) - 1; $l <= $end; $l++) {
          j = $l;
          if (!TryGetNumericValue(LV[j],{get: function () {
              return d;
            }, set: function (v) {
              d = v;
            }})) return false;
          Arr.get()[j] = d;
        };
        Result = rtl.length(Arr.get()) > 0;
        return Result;
      };
      function LinearTrend_1BasedX(V, AIntercept, ASlope) {
        var n = 0;
        var ii = 0;
        var sumX = 0.0;
        var sumY = 0.0;
        var sumXX = 0.0;
        var sumXY = 0.0;
        var x = 0.0;
        var denom = 0.0;
        n = rtl.length(V);
        if (n <= 0) {
          AIntercept.set(0);
          ASlope.set(0);
          return;
        };
        sumX = 0;
        sumY = 0;
        sumXX = 0;
        sumXY = 0;
        for (var $l = 0, $end = n - 1; $l <= $end; $l++) {
          ii = $l;
          x = ii + 1;
          sumX = sumX + x;
          sumY = sumY + V[ii];
          sumXX = sumXX + (x * x);
          sumXY = sumXY + (x * V[ii]);
        };
        denom = (n * sumXX) - (sumX * sumX);
        if (pas.Math.SameValue(denom,0.0,0.0)) {
          ASlope.set(0);
          AIntercept.set(sumY / n);
          return;
        };
        ASlope.set(((n * sumXY) - (sumX * sumY)) / denom);
        AIntercept.set((sumY - (ASlope.get() * sumX)) / n);
      };
      function TryParseTextWithTrailingNumber(S, Prefix, Suffix, Num, Width) {
        var Result = false;
        Result = false;
        return Result;
      };
      function AnyLaneTrend() {
        var Result = false;
        var l = 0;
        for (var $l = 0, $end = AParams.LaneCount - 1; $l <= $end; $l++) {
          l = $l;
          if (AParams.Lanes[l].TrendEnabled) return true;
        };
        Result = false;
        return Result;
      };
      function AnyLaneTextNum() {
        var Result = false;
        var l = 0;
        for (var $l = 0, $end = AParams.LaneCount - 1; $l <= $end; $l++) {
          l = $l;
          if (AParams.Lanes[l].TextNumEnabled) return true;
        };
        Result = false;
        return Result;
      };
      function DefaultAutoFillParams() {
        var Result = $mod.TTMSFNCDataGridDataAutoFillParams.$new();
        Result.FillType = $mod.TTMSFNCDataGridDataAutoFillType.gaftUnknown;
        Result.Step = 0;
        Result.LaneCount = 0;
        Result.Lanes = rtl.arraySetLength(Result.Lanes,$mod.TTMSFNCDataGridDataAutoFillLaneModel,0);
        return Result;
      };
      sourceWidth = (ASourceRange.StopCell.GetColumn() - ASourceRange.StartCell.GetColumn()) + 1;
      sourceHeight = (ASourceRange.StopCell.GetRow() - ASourceRange.StartCell.GetRow()) + 1;
      v = this.GetCell(ASourceRange.StartCell.GetColumn(),ASourceRange.StartCell.GetRow());
      f.$assign($mod.DefaultFormatting());
      a = true;
      this.DoGetCellFormatting(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ASourceRange.StartCell),v,f,AFormatSettings,{get: function () {
          return a;
        }, set: function (v) {
          a = v;
        }});
      ASourceValues.set(rtl.arraySetLength(ASourceValues.get(),undefined,sourceWidth * sourceHeight));
      idx = 0;
      for (var $l = ASourceRange.StartCell.GetRow(), $end = ASourceRange.StopCell.GetRow(); $l <= $end; $l++) {
        row = $l;
        for (var $l1 = ASourceRange.StartCell.GetColumn(), $end1 = ASourceRange.StopCell.GetColumn(); $l1 <= $end1; $l1++) {
          col = $l1;
          ASourceValues.get()[idx] = this.GetCell(col,row);
          idx += 1;
        };
      };
      AParams.$assign(DefaultAutoFillParams());
      AParams.FillType = $mod.TTMSFNCDataGridDataAutoFillType.gaftUnknown;
      AParams.Step = 1;
      if (ADirection in rtl.createSet($mod.TTMSFNCDataGridDataAutoFillDirection.gafdDown,$mod.TTMSFNCDataGridDataAutoFillDirection.gafdUp)) {
        AParams.LaneCount = sourceWidth}
       else AParams.LaneCount = sourceHeight;
      AParams.Lanes = rtl.arraySetLength(AParams.Lanes,$mod.TTMSFNCDataGridDataAutoFillLaneModel,AParams.LaneCount);
      for (var $l2 = 0, $end2 = AParams.LaneCount - 1; $l2 <= $end2; $l2++) {
        lane = $l2;
        if (ADirection in rtl.createSet($mod.TTMSFNCDataGridDataAutoFillDirection.gafdDown,$mod.TTMSFNCDataGridDataAutoFillDirection.gafdUp)) {
          laneValues = rtl.arraySetLength(laneValues,undefined,sourceHeight);
          for (var $l3 = 0, $end3 = sourceHeight - 1; $l3 <= $end3; $l3++) {
            i = $l3;
            laneValues[i] = this.GetCell(ASourceRange.StartCell.GetColumn() + lane,ASourceRange.StartCell.GetRow() + i);
          };
        } else {
          laneValues = rtl.arraySetLength(laneValues,undefined,sourceWidth);
          for (var $l4 = 0, $end4 = sourceWidth - 1; $l4 <= $end4; $l4++) {
            i = $l4;
            laneValues[i] = this.GetCell(ASourceRange.StartCell.GetColumn() + i,ASourceRange.StartCell.GetRow() + lane);
          };
        };
        AParams.Lanes[lane].SeedCount = rtl.length(laneValues);
        AParams.Lanes[lane].SeedValues = rtl.arraySetLength(AParams.Lanes[lane].SeedValues,undefined,rtl.length(laneValues));
        AParams.Lanes[lane].HasEmptySeed = false;
        for (var $l5 = 0, $end5 = rtl.length(laneValues) - 1; $l5 <= $end5; $l5++) {
          i = $l5;
          AParams.Lanes[lane].SeedValues[i] = laneValues[i];
          if (this.$class.ValueIsEmpty(laneValues[i]) || (this.$class.ValueIsString(laneValues[i]) && (this.$class.ValueToString$1(laneValues[i],pas.SysUtils.TFormatSettings.$clone(AFormatSettings)) === ""))) AParams.Lanes[lane].HasEmptySeed = true;
        };
        AParams.Lanes[lane].CustomListKey = "";
        AParams.Lanes[lane].CustomListBaseIndex = -1;
        AParams.Lanes[lane].CustomListFromEvent = false;
        AParams.Lanes[lane].EventCustomListValues = rtl.arraySetLength(AParams.Lanes[lane].EventCustomListValues,"",0);
        AParams.Lanes[lane].EventCustomListCount = 0;
        AParams.Lanes[lane].LaneFillType = $mod.TTMSFNCDataGridDataAutoFillType.gaftUnknown;
        AParams.Lanes[lane].LaneStep = 0;
        if (rtl.length(laneValues) === 1) {
          if (this.$class.ValueIsDateTimeType(laneValues[0])) {
            AParams.Lanes[lane].LaneFillType = $mod.TTMSFNCDataGridDataAutoFillType.gaftDateTime;
            AParams.Lanes[lane].LaneStep = 1;
          } else if (this.$class.ValueIsString(laneValues[0])) {
            baseStr = this.$class.ValueToString$1(laneValues[0],pas.SysUtils.TFormatSettings.$clone(AFormatSettings));
            if (this.DetectSingleDayMonthName(baseStr,AFormatSettings,{get: function () {
                return i;
              }, set: function (v) {
                i = v;
              }})) {
              AParams.Lanes[lane].CustomListEnabled = true;
              AParams.Lanes[lane].CustomListStep = 1;
              AParams.Lanes[lane].CustomListBaseIndex = i;
              AParams.Lanes[lane].LaneFillType = $mod.TTMSFNCDataGridDataAutoFillType.gaftAlphabetic;
            } else if (((pas.System.Pos(":",baseStr) > 0) || !pas.SysUtils.TryStrToFloat$3(baseStr,{get: function () {
                return D1;
              }, set: function (v) {
                D1 = v;
              }},AFormatSettings)) && pas.SysUtils.TryStrToDateTime$1(baseStr,{get: function () {
                return dt1;
              }, set: function (v) {
                dt1 = v;
              }},AFormatSettings)) {
              AParams.Lanes[lane].LaneFillType = $mod.TTMSFNCDataGridDataAutoFillType.gaftDateTime;
              AParams.Lanes[lane].LaneStep = 1;
            };
          };
        } else if (rtl.length(laneValues) >= 2) {
          if (this.$class.ValueIsDateTimeType(laneValues[0]) && this.$class.ValueIsDateTimeType(laneValues[1])) {
            AParams.Lanes[lane].LaneFillType = $mod.TTMSFNCDataGridDataAutoFillType.gaftDateTime;
            AParams.Lanes[lane].LaneStep = this.$class.ValueToDateTime$1(laneValues[1],pas.SysUtils.TFormatSettings.$clone(AFormatSettings)) - this.$class.ValueToDateTime$1(laneValues[0],pas.SysUtils.TFormatSettings.$clone(AFormatSettings));
            if (this.DetectDatePattern(this.$class.ValueToDateTime$1(laneValues[0],pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),this.$class.ValueToDateTime$1(laneValues[1],pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),{p: AParams.Lanes[lane], get: function () {
                return this.p.DatePatternType;
              }, set: function (v) {
                this.p.DatePatternType = v;
              }},{p: AParams.Lanes[lane], get: function () {
                return this.p.DatePatternStep;
              }, set: function (v) {
                this.p.DatePatternStep = v;
              }})) {
              AParams.Lanes[lane].DatePatternEnabled = true;
              AParams.Lanes[lane].DatePatternBaseDate = this.$class.ValueToDateTime$1(laneValues[0],pas.SysUtils.TFormatSettings.$clone(AFormatSettings));
            };
          } else if ((this.$class.ValueIsFloat(laneValues[0]) || this.$class.ValueIsInteger(laneValues[0])) && (this.$class.ValueIsFloat(laneValues[1]) || this.$class.ValueIsInteger(laneValues[1]))) {
            if (this.$class.ValueIsInteger(laneValues[0]) && this.$class.ValueIsInteger(laneValues[1])) {
              AParams.Lanes[lane].LaneFillType = $mod.TTMSFNCDataGridDataAutoFillType.gaftNumericInteger}
             else AParams.Lanes[lane].LaneFillType = $mod.TTMSFNCDataGridDataAutoFillType.gaftNumericFloat;
            AParams.Lanes[lane].LaneStep = this.$class.ValueToFloat(laneValues[1]) - this.$class.ValueToFloat(laneValues[0]);
          } else if (this.$class.ValueIsString(laneValues[0]) && this.$class.ValueIsString(laneValues[1])) {
            s1 = this.$class.ValueToString$1(laneValues[0],pas.SysUtils.TFormatSettings.$clone(AFormatSettings));
            s2 = this.$class.ValueToString$1(laneValues[1],pas.SysUtils.TFormatSettings.$clone(AFormatSettings));
            if (IsTimeOnlyString(s1) && IsTimeOnlyString(s2) && TryParseTimeString(s1,{get: function () {
                return dt1;
              }, set: function (v) {
                dt1 = v;
              }}) && TryParseTimeString(s2,{get: function () {
                return dt2;
              }, set: function (v) {
                dt2 = v;
              }})) {
              AParams.Lanes[lane].LaneFillType = $mod.TTMSFNCDataGridDataAutoFillType.gaftDateTime;
              AParams.Lanes[lane].LaneStep = dt2 - dt1;
            } else if ((pas.System.Pos(":",s1) === 0) && (pas.System.Pos(":",s2) === 0) && pas.SysUtils.TryStrToFloat$3(s1,{get: function () {
                return D1;
              }, set: function (v) {
                D1 = v;
              }},AFormatSettings) && pas.SysUtils.TryStrToFloat$3(s2,{get: function () {
                return D2;
              }, set: function (v) {
                D2 = v;
              }},AFormatSettings)) {
              AParams.Lanes[lane].LaneFillType = $mod.TTMSFNCDataGridDataAutoFillType.gaftNumericFloat;
              AParams.Lanes[lane].LaneStep = D2 - D1;
            } else if (pas.SysUtils.TryStrToInt(s1,{get: function () {
                return I1;
              }, set: function (v) {
                I1 = v;
              }}) && pas.SysUtils.TryStrToInt(s2,{get: function () {
                return I2;
              }, set: function (v) {
                I2 = v;
              }})) {
              AParams.Lanes[lane].LaneFillType = $mod.TTMSFNCDataGridDataAutoFillType.gaftNumericInteger;
              AParams.Lanes[lane].LaneStep = I2 - I1;
            } else if (pas.SysUtils.TryStrToDateTime$1(s1,{get: function () {
                return dt1;
              }, set: function (v) {
                dt1 = v;
              }},AFormatSettings) && pas.SysUtils.TryStrToDateTime$1(s2,{get: function () {
                return dt2;
              }, set: function (v) {
                dt2 = v;
              }},AFormatSettings)) {
              AParams.Lanes[lane].LaneFillType = $mod.TTMSFNCDataGridDataAutoFillType.gaftDateTime;
              AParams.Lanes[lane].LaneStep = dt2 - dt1;
              if (this.DetectDatePattern(dt1,dt2,{p: AParams.Lanes[lane], get: function () {
                  return this.p.DatePatternType;
                }, set: function (v) {
                  this.p.DatePatternType = v;
                }},{p: AParams.Lanes[lane], get: function () {
                  return this.p.DatePatternStep;
                }, set: function (v) {
                  this.p.DatePatternStep = v;
                }})) {
                AParams.Lanes[lane].DatePatternEnabled = true;
                AParams.Lanes[lane].DatePatternBaseDate = dt1;
              };
            };
          };
        };
        if ((rtl.length(laneValues) >= 2) && this.$class.ValueIsString(laneValues[0]) && this.$class.ValueIsString(laneValues[1])) {
          tmpStep = 1;
          if (this.DetectDayMonthPattern(this.$class.ValueToString$1(laneValues[0],pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),this.$class.ValueToString$1(laneValues[1],pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),AFormatSettings,{get: function () {
              return tmpStep;
            }, set: function (v) {
              tmpStep = v;
            }})) {
            AParams.Lanes[lane].CustomListEnabled = true;
            AParams.Lanes[lane].CustomListStep = this.$class.ValueToInteger(tmpStep);
          } else if ((this.$class.ValueToString$1(laneValues[1],pas.SysUtils.TFormatSettings.$clone(AFormatSettings)) === "") && this.DetectSingleDayMonthName(this.$class.ValueToString$1(laneValues[0],pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),AFormatSettings,{get: function () {
              return i;
            }, set: function (v) {
              i = v;
            }})) {
            AParams.Lanes[lane].CustomListEnabled = true;
            AParams.Lanes[lane].CustomListStep = 1;
            AParams.Lanes[lane].CustomListBaseIndex = i;
          };
        } else if ((rtl.length(laneValues) >= 2) && this.$class.ValueIsString(laneValues[0]) && !this.$class.ValueIsString(laneValues[1]) && this.$class.ValueIsEmpty(laneValues[1]) && this.DetectSingleDayMonthName(this.$class.ValueToString$1(laneValues[0],pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),AFormatSettings,{get: function () {
            return i;
          }, set: function (v) {
            i = v;
          }})) {
          AParams.Lanes[lane].CustomListEnabled = true;
          AParams.Lanes[lane].CustomListStep = 1;
          AParams.Lanes[lane].CustomListBaseIndex = i;
        };
        if ((rtl.length(laneValues) >= 3) && TryLaneNumericArray(laneValues,{get: function () {
            return nums;
          }, set: function (v) {
            nums = v;
          }})) {
          LinearTrend_1BasedX(nums,{get: function () {
              return intercept;
            }, set: function (v) {
              intercept = v;
            }},{get: function () {
              return slope;
            }, set: function (v) {
              slope = v;
            }});
          AParams.Lanes[lane].TrendEnabled = true;
          AParams.Lanes[lane].TrendIntercept = intercept;
          AParams.Lanes[lane].TrendSlope = slope;
          AParams.Lanes[lane].TrendCount = rtl.length(laneValues);
          continue;
        };
        if ((rtl.length(laneValues) >= 2) && this.$class.ValueIsString(laneValues[0]) && this.$class.ValueIsString(laneValues[1])) {
          if (TryParseTextWithTrailingNumber(this.$class.ValueToString$1(laneValues[0],pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),{get: function () {
              return p1;
            }, set: function (v) {
              p1 = v;
            }},{get: function () {
              return s1;
            }, set: function (v) {
              s1 = v;
            }},{get: function () {
              return n1;
            }, set: function (v) {
              n1 = v;
            }},{get: function () {
              return w1;
            }, set: function (v) {
              w1 = v;
            }}) && TryParseTextWithTrailingNumber(this.$class.ValueToString$1(laneValues[1],pas.SysUtils.TFormatSettings.$clone(AFormatSettings)),{get: function () {
              return p2;
            }, set: function (v) {
              p2 = v;
            }},{get: function () {
              return s2;
            }, set: function (v) {
              s2 = v;
            }},{get: function () {
              return n2;
            }, set: function (v) {
              n2 = v;
            }},{get: function () {
              return w2;
            }, set: function (v) {
              w2 = v;
            }}) && (p1 === p2) && (s1 === s2)) {
            AParams.Lanes[lane].TextNumEnabled = true;
            AParams.Lanes[lane].TextNumPrefix = p1;
            AParams.Lanes[lane].TextNumSuffix = s1;
            AParams.Lanes[lane].TextNumStart = n1;
            AParams.Lanes[lane].TextNumStep = n2 - n1;
            AParams.Lanes[lane].TextNumWidth = Math.max(w1,w2);
            continue;
          };
        };
        if (!AParams.Lanes[lane].CustomListEnabled && (rtl.length(laneValues) > 0)) {
          var $tmp = ADirection;
          if (($tmp === $mod.TTMSFNCDataGridDataAutoFillDirection.gafdDown) || ($tmp === $mod.TTMSFNCDataGridDataAutoFillDirection.gafdRight)) {
            baseSeed = laneValues[rtl.length(laneValues) - 1]}
           else if (($tmp === $mod.TTMSFNCDataGridDataAutoFillDirection.gafdUp) || ($tmp === $mod.TTMSFNCDataGridDataAutoFillDirection.gafdLeft)) {
            baseSeed = laneValues[0]}
           else {
            baseSeed = laneValues[0];
          };
          if (this.$class.ValueIsString(baseSeed)) {
            baseStr = this.$class.ValueToString$1(baseSeed,pas.SysUtils.TFormatSettings.$clone(AFormatSettings));
            if (this.TryGetCustomListFromEvent(baseStr,{get: function () {
                return evList;
              }, set: function (v) {
                evList = v;
              }}) && this.TryFindIndexInArray(baseStr,evList,{get: function () {
                return i;
              }, set: function (v) {
                i = v;
              }})) {
              AParams.Lanes[lane].CustomListEnabled = true;
              AParams.Lanes[lane].CustomListStep = 1;
              AParams.Lanes[lane].CustomListFromEvent = true;
              AParams.Lanes[lane].CustomListBaseIndex = i;
              AParams.Lanes[lane].EventCustomListValues = rtl.arrayCopy(0,evList,0);
              AParams.Lanes[lane].EventCustomListCount = rtl.length(evList);
            } else {
              norm = this.NormalizeCustomListValue(baseStr);
              if ((norm !== "") && this.FAutoFillCustomListIndex.TryGetValue(norm,entry)) {
                AParams.Lanes[lane].CustomListEnabled = true;
                AParams.Lanes[lane].CustomListStep = 1;
                AParams.Lanes[lane].CustomListFromEvent = false;
                AParams.Lanes[lane].CustomListKey = entry.Key;
                AParams.Lanes[lane].CustomListBaseIndex = entry.Index;
              };
            };
          };
        };
      };
      if (AnyLaneTrend()) {
        AParams.FillType = $mod.TTMSFNCDataGridDataAutoFillType.gaftNumericFloat;
        AParams.Step = 1;
        return;
      };
      if (AnyLaneTextNum()) {
        AParams.FillType = $mod.TTMSFNCDataGridDataAutoFillType.gaftAlphabetic;
        AParams.Step = 1;
        return;
      };
      if (rtl.length(ASourceValues.get()) === 1) {
        v1 = ASourceValues.get()[0];
        if (this.$class.ValueIsBoolean(v1)) {
          AParams.FillType = $mod.TTMSFNCDataGridDataAutoFillType.gaftBoolean}
         else if (this.$class.ValueIsDateTimeType(v1)) {
          AParams.FillType = $mod.TTMSFNCDataGridDataAutoFillType.gaftDateTime;
          AParams.Step = 1;
        } else if (this.$class.ValueIsString(v1)) {
          s1 = this.$class.ValueToString$1(v1,pas.SysUtils.TFormatSettings.$clone(AFormatSettings));
          if (((pas.System.Pos(":",s1) > 0) || !pas.SysUtils.TryStrToFloat$3(s1,{get: function () {
              return D1;
            }, set: function (v) {
              D1 = v;
            }},AFormatSettings)) && pas.SysUtils.TryStrToDateTime$1(s1,{get: function () {
              return dt1;
            }, set: function (v) {
              dt1 = v;
            }},AFormatSettings)) {
            AParams.FillType = $mod.TTMSFNCDataGridDataAutoFillType.gaftDateTime;
            AParams.Step = 1;
          };
        };
        return;
      };
      if (AParams.LaneCount > 1) {
        allLanesSingleValue = true;
        for (var $l6 = 0, $end6 = AParams.LaneCount - 1; $l6 <= $end6; $l6++) {
          lane = $l6;
          if (AParams.Lanes[lane].SeedCount > 1) {
            allLanesSingleValue = false;
            break;
          };
        };
        if (allLanesSingleValue) {
          AParams.FillType = $mod.TTMSFNCDataGridDataAutoFillType.gaftUnknown;
          return;
        };
      };
      v1 = ASourceValues.get()[0];
      v2 = ASourceValues.get()[1];
      if (this.$class.ValueIsBoolean(v1) && this.$class.ValueIsBoolean(v2)) {
        AParams.FillType = $mod.TTMSFNCDataGridDataAutoFillType.gaftBoolean}
       else if (this.$class.ValueIsDateTimeType(v1) && this.$class.ValueIsDateTimeType(v2)) {
        dt1 = this.$class.ValueToDateTime$1(v1,pas.SysUtils.TFormatSettings.$clone(AFormatSettings));
        dt2 = this.$class.ValueToDateTime$1(v2,pas.SysUtils.TFormatSettings.$clone(AFormatSettings));
        AParams.FillType = $mod.TTMSFNCDataGridDataAutoFillType.gaftDateTime;
        AParams.Step = dt2 - dt1;
        if (this.DetectDatePattern(dt1,dt2,{p: AParams.Lanes[0], get: function () {
            return this.p.DatePatternType;
          }, set: function (v) {
            this.p.DatePatternType = v;
          }},{p: AParams.Lanes[0], get: function () {
            return this.p.DatePatternStep;
          }, set: function (v) {
            this.p.DatePatternStep = v;
          }})) {
          AParams.Lanes[0].DatePatternEnabled = true;
          AParams.Lanes[0].DatePatternBaseDate = dt1;
        };
      } else if ((this.$class.ValueIsFloat(v1) || this.$class.ValueIsInteger(v1)) && (this.$class.ValueIsFloat(v2) || this.$class.ValueIsInteger(v2))) {
        tv1.$assign($mod.CellValueToTValue(v1));
        tv2.$assign($mod.CellValueToTValue(v2));
        AParams.FillType = $mod.TTMSFNCDataGridDataAutoFillType.gaftNumericFloat;
        AParams.Step = tv2.AsExtended() - tv1.AsExtended();
      } else if (this.$class.ValueIsString(v1) && this.$class.ValueIsString(v2)) {
        s1 = this.$class.ValueToString$1(v1,pas.SysUtils.TFormatSettings.$clone(AFormatSettings));
        s2 = this.$class.ValueToString$1(v2,pas.SysUtils.TFormatSettings.$clone(AFormatSettings));
        if (IsTimeOnlyString(s1) && IsTimeOnlyString(s2) && TryParseTimeString(s1,{get: function () {
            return dt1;
          }, set: function (v) {
            dt1 = v;
          }}) && TryParseTimeString(s2,{get: function () {
            return dt2;
          }, set: function (v) {
            dt2 = v;
          }})) {
          AParams.FillType = $mod.TTMSFNCDataGridDataAutoFillType.gaftDateTime;
          AParams.Step = dt2 - dt1;
        } else if ((pas.System.Pos(":",s1) === 0) && (pas.System.Pos(":",s2) === 0) && pas.SysUtils.TryStrToFloat$3(s1,{get: function () {
            return D1;
          }, set: function (v) {
            D1 = v;
          }},AFormatSettings) && pas.SysUtils.TryStrToFloat$3(s2,{get: function () {
            return D2;
          }, set: function (v) {
            D2 = v;
          }},AFormatSettings)) {
          AParams.FillType = $mod.TTMSFNCDataGridDataAutoFillType.gaftNumericFloat;
          AParams.Step = D2 - D1;
        } else if (pas.SysUtils.TryStrToInt(s1,{get: function () {
            return I1;
          }, set: function (v) {
            I1 = v;
          }}) && pas.SysUtils.TryStrToInt(s2,{get: function () {
            return I2;
          }, set: function (v) {
            I2 = v;
          }})) {
          AParams.FillType = $mod.TTMSFNCDataGridDataAutoFillType.gaftNumericInteger;
          AParams.Step = I2 - I1;
        } else if (pas.SysUtils.TryStrToDateTime$1(s1,{get: function () {
            return dt1;
          }, set: function (v) {
            dt1 = v;
          }},AFormatSettings) && pas.SysUtils.TryStrToDateTime$1(s2,{get: function () {
            return dt2;
          }, set: function (v) {
            dt2 = v;
          }},AFormatSettings)) {
          AParams.FillType = $mod.TTMSFNCDataGridDataAutoFillType.gaftDateTime;
          AParams.Step = dt2 - dt1;
          if (this.DetectDatePattern(dt1,dt2,{p: AParams.Lanes[0], get: function () {
              return this.p.DatePatternType;
            }, set: function (v) {
              this.p.DatePatternType = v;
            }},{p: AParams.Lanes[0], get: function () {
              return this.p.DatePatternStep;
            }, set: function (v) {
              this.p.DatePatternStep = v;
            }})) {
            AParams.Lanes[0].DatePatternEnabled = true;
            AParams.Lanes[0].DatePatternBaseDate = dt1;
          };
        } else if (this.DetectDayMonthPattern(s1,s2,AFormatSettings,{p: AParams, get: function () {
            return this.p.Step;
          }, set: function (v) {
            this.p.Step = v;
          }})) {
          AParams.FillType = $mod.TTMSFNCDataGridDataAutoFillType.gaftAlphabetic}
         else AParams.FillType = $mod.TTMSFNCDataGridDataAutoFillType.gaftAlphabetic;
      } else AParams.FillType = $mod.TTMSFNCDataGridDataAutoFillType.gaftUnknown;
    };
    this.ApplyFilteringOnActions = function (AMatchFilter, ARow) {
      var fa = null;
      var a = 0;
      for (var $l = 0, $end = this.FFilterActions.GetCount() - 1; $l <= $end; $l++) {
        a = $l;
        fa = this.FFilterActions.GetItem$1(a);
        if (fa.FEnabled && (fa.FOnApply != null)) fa.FOnApply(this,ARow,AMatchFilter);
      };
    };
    this.RemoveFilteringOnActions = function () {
      var a = 0;
      var fa = null;
      var I = 0;
      for (var $l = 0, $end = this.FFilterActions.GetCount() - 1; $l <= $end; $l++) {
        a = $l;
        fa = this.FFilterActions.GetItem$1(a);
        if (fa.FEnabled && (fa.FOnClear != null)) fa.FOnClear(this);
        if (fa.FEnabled && (fa.FOnRemove != null)) {
          for (var $l1 = this.FFixedRowCount, $end1 = this.FRowCount - this.FFixedBottomRowCount - 1; $l1 <= $end1; $l1++) {
            I = $l1;
            if (this.IsRowNormal(I)) fa.FOnRemove(this,I);
          };
        };
      };
    };
    this.BeginUsingCellData = function (ACell, AData) {
      this.GetTempDataList().Add($mod.TTMSFNCDataGridDataTempData.$create("Create$1",[pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AData]));
    };
    var LinkTypes = ["HTTP://","HTTPS://","WWW.","MAILTO:","FILE://","FTP://"];
    this.CreateDisplayValue = function (ACellData, ACell, AValue) {
      var $Self = this;
      var s = "";
      function MakeHTMLHyperlink(Value) {
        var Result = "";
        var lstart = 0;
        var lend = 0;
        var i = 0;
        var k = 0;
        var link = "";
        var HTMLValue = "";
        Result = Value;
        if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.IsHTML(Result)) return Result;
        for (k = 0; k <= 5; k++) {
          lstart = pas.System.Pos(LinkTypes[k],pas.SysUtils.UpperCase(Result));
          if (lstart > 0) {
            HTMLValue = pas.SysUtils.StringReplace(Result,"<","&lt;",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
            HTMLValue = pas.SysUtils.StringReplace(HTMLValue,">","&gt;",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
            Result = HTMLValue;
            lstart = pas.System.Pos(LinkTypes[k],pas.SysUtils.UpperCase(HTMLValue));
            lend = HTMLValue.length;
            for (var $l = lstart, $end = lend; $l <= $end; $l++) {
              i = $l;
              if (!pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.CharInSet(HTMLValue.charAt(i - 1),pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.AlphaCharSet()) && !pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.CharInSet(HTMLValue.charAt(i - 1),pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.NumericCharSet()) && !pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.CharInSet(HTMLValue.charAt(i - 1),["/","\\","_","-",":","?","!",".","=","&","%","(",")","{","}","@"])) {
                lend = i - 1;
                break;
              };
            };
            link = pas.System.Copy(HTMLValue,lstart,(1 + lend) - lstart);
            pas.System.Insert('<a href="' + link + '">',{get: function () {
                return Result;
              }, set: function (v) {
                Result = v;
              }},lstart);
            pas.System.Insert("</a>",{get: function () {
                return Result;
              }, set: function (v) {
                Result = v;
              }},11 + (2 * link.length) + lstart);
            break;
          };
        };
        return Result;
      };
      if ((ACellData != null) && this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell))) {
        s = this.FormatDisplayValue(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AValue);
        if (this.FOptions.FURL.FAutoDetect) s = MakeHTMLHyperlink(s);
        this.DoGetCellDisplayValue(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AValue,{get: function () {
            return s;
          }, set: function (v) {
            s = v;
          }});
        ACellData.FDisplayValue = s;
      };
    };
    this.CustomReadProperty = function (AObject, APropertyName, APropertyKind, AReader, ACanRead) {
      var r = 0;
      var c = 0;
      var ri = null;
      var ci = null;
      var rd = null;
      var vl = undefined;
      var vr = undefined;
      if (ACanRead.get() && (APropertyName === "DataDictionary")) {
        rd = pas["WEBLib.TMSFNCPersistence"].TTMSFNCReader.$create("Create$2",[AReader]);
        try {
          ACanRead.set(false);
          AReader.ReadBeginArray();
          if (!AReader.HasNext()) {
            this.GetDataDictionary().Clear()}
           else {
            while (AReader.HasNext()) {
              if (!AReader.IsNull()) {
                AReader.ReadBeginObject();
                AReader.ReadName();
                r = AReader.ReadInteger();
                if (r > (this.FRowCount - 1)) this.SetRowCount(this.FRowCount + 1);
                ri = this.GetRowData(r);
                AReader.ReadName();
                rd.Read$1(ri);
                AReader.ReadName();
                AReader.ReadBeginArray();
                while (AReader.HasNext()) {
                  if (!AReader.IsNull()) {
                    AReader.ReadBeginObject();
                    AReader.ReadName();
                    c = AReader.ReadInteger();
                    if (c > (this.FColumnCount - 1)) this.SetColumnCount(this.FColumnCount + 1);
                    ci = this.GetCellDataExtended(c,r);
                    AReader.ReadName();
                    rd.Read$1(ci);
                    AReader.ReadName();
                    vr = null;
                    if (AReader.HasDouble()) {
                      vr = AReader.ReadDouble()}
                     else if (AReader.HasInt64()) {
                      vr = AReader.ReadInt64()}
                     else if (AReader.HasBoolean()) {
                      vr = AReader.ReadBoolean()}
                     else if (AReader.HasString()) {
                      vr = AReader.ReadString()}
                     else AReader.ReadNull();
                    vl = vr;
                    this.SetCell(c,r,vl);
                    AReader.ReadEndObject();
                  } else AReader.SkipValue();
                };
                AReader.ReadEndArray();
                AReader.ReadEndObject();
              } else AReader.SkipValue();
            };
          };
          AReader.ReadEndArray();
        } finally {
          rd = rtl.freeLoc(rd);
        };
      };
    };
    this.CustomWriteProperty = function (AObject, APropertyName, APropertyKind, AWriter, ACanWrite) {
      var r = 0;
      var c = 0;
      var ri = null;
      var ci = null;
      var v = undefined;
      var vr = undefined;
      var wr = null;
      if (ACanWrite.get() && (APropertyName === "DataDictionary")) {
        ACanWrite.set(false);
        this.ExportNotification(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridExportState.gesExportStart,-1);
        wr = pas["WEBLib.TMSFNCPersistence"].TTMSFNCWriter.$create("Create$2",[AWriter]);
        try {
          AWriter.WriteName(APropertyName);
          AWriter.WriteBeginArray();
          for (var $l = 0, $end = this.FRowCount - 1; $l <= $end; $l++) {
            r = $l;
            this.ExportNotification(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridExportState.gesExportNewRow,r);
            ri = this.GetRowData(r);
            AWriter.WriteBeginObject();
            AWriter.WriteName("Row");
            AWriter.WriteInteger(r);
            AWriter.WriteName("RowInfo");
            wr.Write(ri);
            AWriter.WriteName("CellInfo");
            AWriter.WriteBeginArray();
            for (var $l1 = 0, $end1 = this.FColumnCount - 1; $l1 <= $end1; $l1++) {
              c = $l1;
              ci = this.GetCellData(c,r);
              AWriter.WriteBeginObject();
              AWriter.WriteName("Column");
              AWriter.WriteInteger(c);
              AWriter.WriteName("Properties");
              wr.Write(ci);
              AWriter.WriteName("Data");
              v = this.GetCell(c,r);
              vr = v;
              if (pas.JS.isUndefined(vr) || pas.JS.isNull(vr)) {
                AWriter.WriteNull()}
               else if (rtl.isNumber(vr)) {
                if (pas.System.Frac(rtl.getNumber(vr)) === 0) {
                  AWriter.WriteInteger(rtl.trunc(vr))}
                 else AWriter.WriteDouble(rtl.getNumber(vr));
              } else if (pas.JS.isBoolean(vr)) {
                AWriter.WriteBoolean(!(vr == false))}
               else if (rtl.isString(vr)) {
                AWriter.WriteString("" + vr)}
               else AWriter.WriteNull();
              AWriter.WriteEndObject();
            };
            AWriter.WriteEndArray();
            AWriter.WriteEndObject();
          };
          AWriter.WriteEndArray();
        } finally {
          wr = rtl.freeLoc(wr);
          this.ExportNotification(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridExportState.gesExportDone,-1);
        };
      };
    };
    this.CopyColumnDataTo = function (AColumn, ADestinationColumn, ADestination) {
      var I = 0;
      for (var $l = 0, $end = this.FRowCount - 1; $l <= $end; $l++) {
        I = $l;
        ADestination.SetCell(ADestinationColumn,I,this.GetCell(AColumn,I));
      };
    };
    this.DeleteCellData = function (ACell) {
      var r = null;
      if (this.GetDataDictionary().TryGetValue(ACell.GetRow(),{get: function () {
          return r;
        }, set: function (v) {
          r = v;
        }})) {
        if ((r != null) && r.HasData()) r.GetData().Remove(ACell.GetColumn());
      };
    };
    this.DeleteColumnData = function (AColumn) {
      var co = 0;
      co = this.GetColumnReverseOrder(AColumn);
      this.SetColumnOrder(co,-1);
      this.GetColumnWidthDictionary().Remove(AColumn);
      this.GetColumnPositionDictionary().Remove(AColumn);
      this.GetHiddenColumnDictionary().Remove(AColumn);
      this.GetColumnCalculationDictionary().Remove(AColumn);
      this.GetMergedColumnDictionary().Remove(AColumn);
    };
    this.DeleteRowData = function (ARow) {
      var ro = 0;
      ro = this.GetRowReverseOrder(ARow);
      this.SetRowOrder(ro,-1);
      this.GetRowHeightDictionary().Remove(ARow);
      this.GetRowPositionDictionary().Remove(ARow);
      this.GetHiddenRowDictionary().Remove(ARow);
      this.GetMergedRowDictionary().Remove(ARow);
      this.GetFilteredRowDictionary().Remove(ARow);
      this.GetDataDictionary().Remove(ARow);
    };
    this.DoAfterSetColumnCalculation = function (ACell, AColumnCalculation, AName, AValue) {
      if (this.FOnAfterSetColumnCalculation != null) this.FOnAfterSetColumnCalculation(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),$mod.TTMSFNCDataGridDataColumnCalculation.$clone(AColumnCalculation),AName,{get: function () {
          return AValue;
        }, set: function (v) {
          AValue = v;
        }});
    };
    this.DoAfterSetRowCalculation = function (ACell, ARowCalculation, AName, AValue) {
      if (this.FOnAfterSetRowCalculation != null) this.FOnAfterSetRowCalculation(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),$mod.TTMSFNCDataGridDataRowCalculation.$clone(ARowCalculation),AName,AValue);
    };
    this.DoBeforeSetColumnCalculation = function (ACell, AColumnCalculation, AName, AValue, ACanSet) {
      if (this.FOnBeforeSetColumnCalculation != null) this.FOnBeforeSetColumnCalculation(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),$mod.TTMSFNCDataGridDataColumnCalculation.$clone(AColumnCalculation),AName,AValue,ACanSet);
    };
    this.DoBeforeSetRowCalculation = function (ACell, ARowCalculation, AName, AValue, ACanSet) {
      if (this.FOnBeforeSetRowCalculation != null) this.FOnBeforeSetRowCalculation(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),$mod.TTMSFNCDataGridDataRowCalculation.$clone(ARowCalculation),AName,AValue.get(),ACanSet);
    };
    this.DoGetCellData = function (ACell, AData) {
      if (this.FAdapter != null) this.FAdapter.GetCellData(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AData);
      if (this.FOnGetCellData != null) this.FOnGetCellData(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AData);
    };
    this.DoGetCellDataProperties = function (ACell, ACellItem) {
      if (this.FAdapter != null) this.FAdapter.GetCellDataProperties(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),ACellItem);
      if (this.FOnGetCellDataProperties != null) this.FOnGetCellDataProperties(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),ACellItem);
    };
    this.DoGetCellDisplayValue = function (ACell, AData, AValue) {
      if (this.FOnGetCellDisplayValue != null) this.FOnGetCellDisplayValue(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AData,AValue);
    };
    this.DoGetCellFormatting = function (ACell, AData, AFormatting, AConvertSettings, ACanFormat) {
      if (this.FAdapter != null) this.FAdapter.GetCellFormatting(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AData,AFormatting,AConvertSettings,ACanFormat);
      if (this.FOnGetCellFormatting != null) this.FOnGetCellFormatting(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AData,AFormatting,AConvertSettings,ACanFormat);
    };
    this.DoGetColumnCalculationOptions = function (AColumn, ALevel, AOptions) {
      if (this.FOnGetColumnCalculationOptions != null) this.FOnGetColumnCalculationOptions(this,AColumn,ALevel,AOptions);
    };
    this.DoGetCustomGroup = function (ACell, AData, ALevel, AGroup) {
      if (this.FOnGetCustomGroup != null) this.FOnGetCustomGroup(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AData,ALevel,AGroup);
    };
    this.DoGetGroupOptions = function (AColumns, ALevel, AOptions) {
      if (this.FOnGetGroupOptions != null) this.FOnGetGroupOptions(this,rtl.arrayRef(AColumns),ALevel,AOptions);
    };
    this.DoGetRowCalculationOptions = function (ARow, ALevel, AOptions) {
      if (this.FOnGetRowCalculationOptions != null) this.FOnGetRowCalculationOptions(this,ARow,AOptions);
    };
    this.DoGetSortOptions = function (AColumn, ALevel, AOptions) {
      if (this.FOnGetSortOptions != null) this.FOnGetSortOptions(this,AColumn,ALevel,AOptions);
    };
    this.DoLoadCellData = function (AColumn, ARow, AValue) {
      if (this.FOnLoadCellData != null) this.FOnLoadCellData(this,AColumn,ARow,AValue);
    };
    this.DoRowCollapse = function (ARow) {
      if (this.FAdapter != null) this.FAdapter.RowCollapse(ARow);
      if (this.FOnRowCollapse != null) this.FOnRowCollapse(this,ARow);
    };
    this.DoRowExpand = function (ARow) {
      if (this.FAdapter != null) this.FAdapter.RowExpand(ARow);
      if (this.FOnRowExpand != null) this.FOnRowExpand(this,ARow);
    };
    this.DoSaveCellData = function (AColumn, ARow, AValue) {
      if (this.FOnSaveCellData != null) this.FOnSaveCellData(this,AColumn,ARow,AValue);
    };
    this.GetSourceCellForFill = function (ATargetRow, ATargetCol, ASourceRange, ATargetRange, ADirection, ASourceRow, ASourceCol) {
      var sourceWidth = 0;
      var sourceHeight = 0;
      sourceWidth = (ASourceRange.StopCell.GetColumn() - ASourceRange.StartCell.GetColumn()) + 1;
      sourceHeight = (ASourceRange.StopCell.GetRow() - ASourceRange.StartCell.GetRow()) + 1;
      var $tmp = ADirection;
      if (($tmp === $mod.TTMSFNCDataGridDataAutoFillDirection.gafdDown) || ($tmp === $mod.TTMSFNCDataGridDataAutoFillDirection.gafdUp)) {
        ASourceCol.set(ASourceRange.StartCell.GetColumn() + ((ATargetCol - ASourceRange.StartCell.GetColumn()) % sourceWidth));
        var $tmp1 = ADirection;
        if ($tmp1 === $mod.TTMSFNCDataGridDataAutoFillDirection.gafdDown) {
          ASourceRow.set(ASourceRange.StopCell.GetRow())}
         else if ($tmp1 === $mod.TTMSFNCDataGridDataAutoFillDirection.gafdUp) ASourceRow.set(ASourceRange.StartCell.GetRow());
      } else if (($tmp === $mod.TTMSFNCDataGridDataAutoFillDirection.gafdLeft) || ($tmp === $mod.TTMSFNCDataGridDataAutoFillDirection.gafdRight)) {
        ASourceRow.set(ASourceRange.StartCell.GetRow() + ((ATargetRow - ASourceRange.StartCell.GetRow()) % sourceHeight));
        var $tmp2 = ADirection;
        if ($tmp2 === $mod.TTMSFNCDataGridDataAutoFillDirection.gafdRight) {
          ASourceCol.set(ASourceRange.StopCell.GetColumn())}
         else if ($tmp2 === $mod.TTMSFNCDataGridDataAutoFillDirection.gafdLeft) ASourceCol.set(ASourceRange.StartCell.GetColumn());
      };
    };
    this.EndUsingCellData = function () {
      var d = null;
      d = this.GetTempDataList().Last();
      if (d != null) this.GetTempDataList().Remove(d);
    };
    this.InternalAutoFill = function (ASourceStart, ASourceEnd, ATargetStart, ATargetEnd, ADirection) {
      var sourceRange = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoordRange.$new();
      var targetRange = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoordRange.$new();
      var row = 0;
      var col = 0;
      var sourceRow = 0;
      var sourceCol = 0;
      var sourceValue = undefined;
      var newValue = undefined;
      var sourceValues = [];
      var params = $mod.TTMSFNCDataGridDataAutoFillParams.$new();
      var fillIndex = 0;
      var laneIndex = 0;
      var seedPosInLane = 0;
      var laneSeedCount = 0;
      var dir = 0;
      var oldValue = undefined;
      var accept = false;
      var targetCell = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var fmt = pas.SysUtils.TFormatSettings.$new();
      sourceRange.StartCell.$assign(ASourceStart);
      sourceRange.StopCell.$assign(ASourceEnd);
      targetRange.StartCell.$assign(ATargetStart);
      targetRange.StopCell.$assign(ATargetEnd);
      dir = this.ResolveAutoFillDirection(ASourceStart,ASourceEnd,ATargetStart,ATargetEnd,ADirection);
      fmt.$assign(pas.SysUtils.FormatSettings);
      this.AnalyzeAutoFillPattern(sourceRange,{get: function () {
          return sourceValues;
        }, set: function (v) {
          sourceValues = v;
        }},params,dir,fmt);
      this.BeginUpdate();
      try {
        for (var $l = targetRange.StartCell.GetRow(), $end = targetRange.StopCell.GetRow(); $l <= $end; $l++) {
          row = $l;
          for (var $l1 = targetRange.StartCell.GetColumn(), $end1 = targetRange.StopCell.GetColumn(); $l1 <= $end1; $l1++) {
            col = $l1;
            if ((row >= sourceRange.StartCell.GetRow()) && (row <= sourceRange.StopCell.GetRow()) && (col >= sourceRange.StartCell.GetColumn()) && (col <= sourceRange.StopCell.GetColumn())) continue;
            this.GetSourceCellForFill(row,col,sourceRange,targetRange,dir,{get: function () {
                return sourceRow;
              }, set: function (v) {
                sourceRow = v;
              }},{get: function () {
                return sourceCol;
              }, set: function (v) {
                sourceCol = v;
              }});
            if ((sourceRow >= sourceRange.StartCell.GetRow()) && (sourceRow <= sourceRange.StopCell.GetRow()) && (sourceCol >= sourceRange.StartCell.GetColumn()) && (sourceCol <= sourceRange.StopCell.GetColumn())) {
              sourceValue = this.GetCell(sourceCol,sourceRow);
              fillIndex = this.CalculateFillIndex(row,col,sourceRange,targetRange,dir);
              laneIndex = this.LaneIndexForTarget(row,col,sourceRange,dir);
              laneSeedCount = 0;
              if ((laneIndex >= 0) && (laneIndex < rtl.length(params.Lanes))) laneSeedCount = params.Lanes[laneIndex].SeedCount;
              if (laneSeedCount <= 0) {
                seedPosInLane = 0}
               else {
                var $tmp = dir;
                if (($tmp === $mod.TTMSFNCDataGridDataAutoFillDirection.gafdDown) || ($tmp === $mod.TTMSFNCDataGridDataAutoFillDirection.gafdRight)) {
                  seedPosInLane = laneSeedCount - 1}
                 else if (($tmp === $mod.TTMSFNCDataGridDataAutoFillDirection.gafdUp) || ($tmp === $mod.TTMSFNCDataGridDataAutoFillDirection.gafdLeft)) {
                  seedPosInLane = 0}
                 else {
                  seedPosInLane = 0;
                };
              };
              newValue = this.CalculateAutoFillValue(sourceValue,sourceRange,sourceValues,targetRange,params,fillIndex,laneIndex,seedPosInLane,dir,fmt);
              oldValue = this.GetCell(col,row);
              accept = true;
              targetCell.SetColumn(col);
              targetCell.SetRow(row);
              this.DoBeforeApplyAutoFill(sourceRange,sourceValues,targetRange,targetCell,dir,{get: function () {
                  return newValue;
                }, set: function (v) {
                  newValue = v;
                }},{get: function () {
                  return accept;
                }, set: function (v) {
                  accept = v;
                }});
              if (accept) {
                this.SetCell(col,row,newValue);
                this.DoAfterApplyAutoFill(sourceRange,sourceValues,targetRange,targetCell,dir,oldValue,newValue);
              };
            };
          };
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.FillGridData = function (ADoFixed, ARandom, ARandomNumber) {
      var i = 0;
      var j = 0;
      var ro = 0;
      var co = 0;
      var re = 0;
      var ce = 0;
      var v = 0;
      this.BeginUpdate();
      try {
        if (ADoFixed) {
          ro = 0;
          co = 0;
          re = this.FRowCount - 1;
          ce = this.FColumnCount - 1;
        } else {
          ro = this.FFixedRowCount;
          co = this.FFixedColumnCount;
          re = this.FRowCount - 1 - this.FFixedBottomRowCount;
          ce = this.FColumnCount - 1 - this.FFixedRightColumnCount;
        };
        for (var $l = ro, $end = re; $l <= $end; $l++) {
          i = $l;
          for (var $l1 = co, $end1 = ce; $l1 <= $end1; $l1++) {
            j = $l1;
            if (ARandom) {
              v = pas.System.Random(ARandomNumber);
              this.SetCell(j,i,v);
            } else this.SetCell(j,i,pas.SysUtils.IntToStr(j) + ":" + pas.SysUtils.IntToStr(i));
          };
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.InternalClear = function () {
      pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCore.InternalClear.call(this);
      this.GetRowCalculationDictionary().Clear();
      this.GetColumnCalculationDictionary().Clear();
      this.GetDataDictionary().Clear();
      this.GetGroupDictionary().Clear();
    };
    this.InternalColumnCalculation = function (ACalculations, AGroup, ALevel) {
      var j = 0;
      var k = 0;
      var I = "";
      var str = "";
      var s = "";
      var l = null;
      var cm = $mod.TTMSFNCDataGridDataColumnCalculation.$new();
      var cma = [];
      var opt = $mod.TTMSFNCDataGridDataColumnCalculationOptions.$new();
      var fr = 0;
      var frto = 0;
      var outr = 0;
      var cr = 0;
      var a = false;
      var $in = ACalculations.GetKeys().GetEnumerator$1();
      try {
        while ($in.MoveNext$1()) {
          k = $in.GetCurrent();
          l = ACalculations.GetItem(k);
          var $in1 = l.GetKeys().GetEnumerator$1();
          try {
            while ($in1.MoveNext$1()) {
              I = $in1.GetCurrent();
              s = "";
              outr = -1;
              cr = k;
              cma = rtl.arrayRef(l.GetItem(I));
              for (var $l = 0, $end = rtl.length(cma) - 1; $l <= $end; $l++) {
                j = $l;
                cm.$assign(cma[j]);
                opt.$assign(this.GetColumnCalculationOptions());
                if (cm.OptionsCallback != null) {
                  cm.OptionsCallback(k,ALevel,opt)}
                 else this.DoGetColumnCalculationOptions(k,ALevel,opt);
                if ((cm.Type === $mod.TTMSFNCDataGridDataColumnCalculationType.gctGroup) && opt.MergeSummary && !opt.SummaryInHeader) cr = this.FFixedColumnCount;
                if ((cm.FromRow !== -1) && (cm.ToRow !== -1)) {
                  fr = cm.FromRow;
                  frto = cm.ToRow;
                } else {
                  fr = this.FFixedRowCount;
                  frto = this.FRowCount - this.FFixedBottomRowCount - 1;
                };
                var $tmp = opt.CalculationFormatType;
                if ($tmp === $mod.TTMSFNCDataGridDataCalculationFormatType.gcfNumber) {
                  var $tmp1 = cm.Method;
                  if ($tmp1 === $mod.TTMSFNCDataGridDataCalculationMethod.gcmSum) {
                    str = pas.SysUtils.Format(opt.CalculationFormat,pas.System.VarRecs(3,this.ColumnSum(k,fr,frto)))}
                   else if ($tmp1 === $mod.TTMSFNCDataGridDataCalculationMethod.gcmAverage) {
                    str = pas.SysUtils.Format(opt.CalculationFormat,pas.System.VarRecs(3,this.ColumnAverage(k,fr,frto)))}
                   else if ($tmp1 === $mod.TTMSFNCDataGridDataCalculationMethod.gcmCount) {
                    str = pas.SysUtils.Format(opt.CalculationFormat,pas.System.VarRecs(3,this.ColumnCounting(k,fr,frto)))}
                   else if ($tmp1 === $mod.TTMSFNCDataGridDataCalculationMethod.gcmMin) {
                    str = pas.SysUtils.Format(opt.CalculationFormat,pas.System.VarRecs(3,this.ColumnMin(k,fr,frto)))}
                   else if ($tmp1 === $mod.TTMSFNCDataGridDataCalculationMethod.gcmMax) {
                    str = pas.SysUtils.Format(opt.CalculationFormat,pas.System.VarRecs(3,this.ColumnMax(k,fr,frto)))}
                   else if ($tmp1 === $mod.TTMSFNCDataGridDataCalculationMethod.gcmCustom) {
                    str = pas.SysUtils.Format(opt.CalculationFormat,pas.System.VarRecs(3,this.InternalColumnCustomCalculation(k,ALevel,cm.CustomCalculationCallback,fr,frto)))}
                   else if ($tmp1 === $mod.TTMSFNCDataGridDataCalculationMethod.gcmDistinct) {
                    str = pas.SysUtils.Format(opt.CalculationFormat,pas.System.VarRecs(3,this.ColumnDistinct(k,fr,frto)))}
                   else if ($tmp1 === $mod.TTMSFNCDataGridDataCalculationMethod.gcmStandardDeviation) str = pas.SysUtils.Format(opt.CalculationFormat,pas.System.VarRecs(3,this.ColumnStandardDeviation(k,fr,frto)));
                } else if ($tmp === $mod.TTMSFNCDataGridDataCalculationFormatType.gcfFloat) {
                  var $tmp2 = cm.Method;
                  if ($tmp2 === $mod.TTMSFNCDataGridDataCalculationMethod.gcmSum) {
                    str = pas.SysUtils.FormatFloat(opt.CalculationFormat,this.ColumnSum(k,fr,frto))}
                   else if ($tmp2 === $mod.TTMSFNCDataGridDataCalculationMethod.gcmAverage) {
                    str = pas.SysUtils.FormatFloat(opt.CalculationFormat,this.ColumnAverage(k,fr,frto))}
                   else if ($tmp2 === $mod.TTMSFNCDataGridDataCalculationMethod.gcmCount) {
                    str = pas.SysUtils.FormatFloat(opt.CalculationFormat,this.ColumnCounting(k,fr,frto))}
                   else if ($tmp2 === $mod.TTMSFNCDataGridDataCalculationMethod.gcmMin) {
                    str = pas.SysUtils.FormatFloat(opt.CalculationFormat,this.ColumnMin(k,fr,frto))}
                   else if ($tmp2 === $mod.TTMSFNCDataGridDataCalculationMethod.gcmMax) {
                    str = pas.SysUtils.FormatFloat(opt.CalculationFormat,this.ColumnMax(k,fr,frto))}
                   else if ($tmp2 === $mod.TTMSFNCDataGridDataCalculationMethod.gcmCustom) {
                    str = pas.SysUtils.FormatFloat(opt.CalculationFormat,this.InternalColumnCustomCalculation(k,ALevel,cm.CustomCalculationCallback,fr,frto))}
                   else if ($tmp2 === $mod.TTMSFNCDataGridDataCalculationMethod.gcmDistinct) {
                    str = pas.SysUtils.FormatFloat(opt.CalculationFormat,this.ColumnDistinct(k,fr,frto))}
                   else if ($tmp2 === $mod.TTMSFNCDataGridDataCalculationMethod.gcmStandardDeviation) str = pas.SysUtils.FormatFloat(opt.CalculationFormat,this.ColumnStandardDeviation(k,fr,frto));
                };
                s = s + str;
                outr = cm.OutputRow;
                if ((cm.Type === $mod.TTMSFNCDataGridDataColumnCalculationType.gctGroup) && (outr === -1) && (AGroup != null)) {
                  if (opt.SummaryInHeader) {
                    outr = AGroup.FRow}
                   else outr = AGroup.FSummaryRow;
                };
              };
              if (outr !== -1) {
                a = true;
                this.DoBeforeSetColumnCalculation(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(cr,outr)),$mod.TTMSFNCDataGridDataColumnCalculation.$clone(cm),I,{get: function () {
                    return s;
                  }, set: function (v) {
                    s = v;
                  }},{get: function () {
                    return a;
                  }, set: function (v) {
                    a = v;
                  }});
                if (a) {
                  this.SetCell(cr,outr,s);
                  this.DoAfterSetColumnCalculation(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(cr,outr)),$mod.TTMSFNCDataGridDataColumnCalculation.$clone(cm),I,s);
                };
              } else if (this.FFixedBottomRowCount > 0) {
                a = true;
                this.DoBeforeSetColumnCalculation(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(cr,this.FRowCount - this.FFixedBottomRowCount)),$mod.TTMSFNCDataGridDataColumnCalculation.$clone(cm),I,{get: function () {
                    return s;
                  }, set: function (v) {
                    s = v;
                  }},{get: function () {
                    return a;
                  }, set: function (v) {
                    a = v;
                  }});
                if (a) {
                  this.SetCell(cr,this.FRowCount - this.FFixedBottomRowCount,s);
                  this.DoAfterSetColumnCalculation(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(cr,this.FRowCount - this.FFixedBottomRowCount)),$mod.TTMSFNCDataGridDataColumnCalculation.$clone(cm),I,s);
                };
              };
            }
          } finally {
            $in1 = rtl.freeLoc($in1)
          };
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.InternalColumnCalculation$1 = function (AColumns, AOutputRow, AFromRow, AToRow, AMethod, ACalculationOptionsCallback, ACustomCalculationCallback) {
      var d = null;
      d = $impl.GetColumnCalculations(rtl.arrayRef(AColumns),AOutputRow,AFromRow,AToRow,AMethod,$mod.TTMSFNCDataGridDataColumnCalculationType.gctNormal,ACalculationOptionsCallback,ACustomCalculationCallback);
      try {
        this.InternalColumnCalculation(d,null,0);
      } finally {
        d = rtl.freeLoc(d);
      };
    };
    this.InternalDeleteRows = function (ARow, ACount) {
      var r = 0;
      var pr = 0;
      this.BeginUpdate();
      try {
        pr = -1;
        if (this.FUpdateGrouping === 0) pr = this.GetParentRow(ARow);
        for (var $l = ARow, $end = (ARow + ACount) - 1; $l <= $end; $l++) {
          r = $l;
          this.DeleteRowData(r);
        };
        for (var $l1 = ARow + ACount, $end1 = this.FRowCount - 1; $l1 <= $end1; $l1++) {
          r = $l1;
          this.MoveRowData(r,r - ACount);
        };
        this.ShiftRowOrder(ARow + ACount,-ACount);
        this.SetRowCount(this.FRowCount - ACount);
        if (this.FUpdateGrouping === 0) {
          while (pr !== -1) {
            this.SetRowNodeChildCount(pr,this.GetRowNodeChildCount(pr) - ACount);
            pr = this.GetParentRow(pr);
          };
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.InternalFilterGroups = function (AGroupDictionary) {
      var ks = "";
      var grp = null;
      var cc = 0;
      var K = 0;
      var r = 0;
      var mf = false;
      if (AGroupDictionary != null) {
        var $in = AGroupDictionary.GetKeys().GetEnumerator$1();
        try {
          while ($in.MoveNext$1()) {
            ks = $in.GetCurrent();
            grp = AGroupDictionary.GetItem(ks);
            if (grp != null) {
              cc = this.GetRowNodeChildCount(grp.FRow);
              r = 0;
              for (var $l = grp.FRow + 1, $end = grp.FRow + cc; $l <= $end; $l++) {
                K = $l;
                if (this.IsRowNormal(K)) {
                  mf = this.MatchFilter(K);
                  if ($mod.TTMSFNCDataGridDataFilteringAction.gdfaExecuteActions in this.FOptions.FFiltering.FActions) this.ApplyFilteringOnActions(mf,K);
                  if (!mf) {
                    this.SetFilteredRow(K,true)}
                   else r += 1;
                };
              };
              if ((r === 0) && this.FOptions.FFiltering.FHideEmptyGroups) {
                this.SetFilteredRow(grp.FRow,true);
                if (grp.FSummaryRow !== -1) this.SetFilteredRow(grp.FSummaryRow,true);
              };
              this.InternalFilterGroups(grp.GetGroupDictionary());
            };
          }
        } finally {
          $in = rtl.freeLoc($in)
        };
      };
    };
    this.InternalGroupCalculation = function (AColumns, AOutputRow, AFromRow, AToRow, AMethod, ACalculationOptionsCallback, ACustomCalculationCallback) {
      var d = null;
      d = $impl.GetColumnCalculations(rtl.arrayRef(AColumns),AOutputRow,AFromRow,AToRow,AMethod,$mod.TTMSFNCDataGridDataColumnCalculationType.gctGroup,ACalculationOptionsCallback,ACustomCalculationCallback);
      try {
        this.InternalGroupCalculation$1(this.GetGroupDictionary(),d,0);
      } finally {
        d = rtl.freeLoc(d);
      };
    };
    this.InternalGroupCalculation$1 = function (AGroupDictionary, ACalculations, ALevel) {
      var m = 0;
      var grp = null;
      var k = "";
      var dck = "";
      var d = null;
      var l = null;
      var cm = $mod.TTMSFNCDataGridDataColumnCalculation.$new();
      var cmau = [];
      var cma = [];
      var I = 0;
      var cc = 0;
      if (AGroupDictionary.GetCount() === 0) return;
      this.BeginUpdate();
      try {
        var $in = AGroupDictionary.GetKeys().GetEnumerator$1();
        try {
          while ($in.MoveNext$1()) {
            k = $in.GetCurrent();
            grp = AGroupDictionary.GetItem(k);
            if (grp != null) {
              cc = this.GetRowNodeChildCount(grp.FRow);
              d = $mod.TTMSFNCDataGridDataColumnCalculationDictionary.$create("Create$5",[rtl.createSet(pas["Generics.Collections"].TDictionaryOwnership.doOwnsValues)]);
              try {
                var $in1 = ACalculations.GetKeys().GetEnumerator$1();
                try {
                  while ($in1.MoveNext$1()) {
                    I = $in1.GetCurrent();
                    l = ACalculations.GetItem(I);
                    var $in2 = l.GetKeys().GetEnumerator$1();
                    try {
                      while ($in2.MoveNext$1()) {
                        dck = $in2.GetCurrent();
                        cma = rtl.arrayRef(l.GetItem(dck));
                        cmau = rtl.arraySetLength(cmau,$mod.TTMSFNCDataGridDataColumnCalculation,0);
                        for (var $l = 0, $end = rtl.length(cma) - 1; $l <= $end; $l++) {
                          m = $l;
                          cm.$assign(cma[m]);
                          if (cm.Type === $mod.TTMSFNCDataGridDataColumnCalculationType.gctGroup) {
                            cmau = rtl.arraySetLength(cmau,$mod.TTMSFNCDataGridDataColumnCalculation,rtl.length(cmau) + 1);
                            if ((cm.FromRow === -1) || (cm.ToRow === -1)) {
                              cm.FromRow = grp.FRow + 1;
                              cm.ToRow = grp.FRow + cc;
                            };
                            cmau[rtl.length(cmau) - 1].$assign(cm);
                          };
                        };
                      }
                    } finally {
                      $in2 = rtl.freeLoc($in2)
                    };
                    if (rtl.length(cmau) > 0) {
                      l = pas["Generics.Collections"].TDictionary$$$G$$generics$collections$$String$$TTMSFNCDataGridDataColumnCalculationArray.$create("Create$1",[0]);
                      l.AddOrSetValue(dck,cmau);
                      d.AddOrSetValue(I,l);
                    };
                  }
                } finally {
                  $in1 = rtl.freeLoc($in1)
                };
                this.InternalColumnCalculation(d,grp,ALevel);
              } finally {
                d = rtl.freeLoc(d);
              };
              this.InternalGroupCalculation$1(grp.GetGroupDictionary(),ACalculations,ALevel + 1);
            };
          }
        } finally {
          $in = rtl.freeLoc($in)
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.InternalLoadFromCSV = function (AFileName, AEncoding) {
      var $Self = this;
      var ms = null;
      function InternalInputFromCSV() {
        ms.SetPosition(0);
        $Self.InternalLoadFromCSVStream(ms,AEncoding);
      };
      ms = pas.Classes.TMemoryStream.$create("Create");
      ms.LoadFromFile(AFileName,function () {
        InternalInputFromCSV();
        ms = rtl.freeLoc(ms);
      },null);
    };
    this.InternalLoadFromCSVStream = function (AStream, AEncoding) {
      var buffer = "";
      var celltext = "";
      var s = 0;
      var z = 0;
      var strtCol = 0;
      var strtRow = 0;
      var del = "\x00";
      var delimiterpos = 0;
      var quotepos = 0;
      var lr = null;
      var NewRows = 0;
      var sl = null;
      var hasquote = false;
      var io = $mod.TTMSFNCDataGridDataInputOutputOptions.$new();
      var v = undefined;
      sl = $mod.TTMSFNCDataGridDataFileStringList.$create("Create$1");
      pas.Classes.TStringsHelper.LoadFromStream$1.call(sl,AStream,AEncoding);
      if (sl.GetEOF()) {
        throw pas.SysUtils.Exception.$create("Create$1",[rtl.getResStr($mod,"sTMSFNCDataGridDataEmptyFileError")]);
        sl = rtl.freeLoc(sl);
        return;
      };
      io.$assign(this.GetIOOptions());
      strtCol = io.StartColumn;
      strtRow = io.StartRow;
      z = strtRow;
      lr = pas.Classes.TStringList.$create("Create$1");
      del = io.Delimiter;
      this.BeginUpdate();
      try {
        if (del === "\x00") {
          if (sl.GetCount() > 1) {
            del = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetBestDelimiter(sl.Get(0),sl.Get(1),false)}
           else if (sl.GetCount() > 0) del = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetBestDelimiter(sl.Get(0),"",false);
        };
        sl.Reset();
        NewRows = 0;
        while (!sl.GetEOF() && ((io.MaxRows <= 0) || (NewRows < io.MaxRows))) {
          sl.ReadLn({get: function () {
              return buffer;
            }, set: function (v) {
              buffer = v;
            }});
          NewRows += 1;
          s = strtCol;
          if (z >= (this.FRowCount - this.FFixedBottomRowCount)) this.SetRowCount(z + 1000);
          delimiterpos = -1;
          while (pas["WEBLib.TMSFNCDataGridUtil"].VarCharPos(del,buffer,{get: function () {
              return delimiterpos;
            }, set: function (v) {
              delimiterpos = v;
            }}) > 0) {
            if (io.TrimSpaces) {
              while ((buffer.length > 1) && (buffer.charAt(0) === " ")) {
                pas.System.Delete({get: function () {
                    return buffer;
                  }, set: function (v) {
                    buffer = v;
                  }},1,1);
                delimiterpos -= 1;
              };
            };
            hasquote = buffer.charAt(0) === '"';
            if (hasquote) {
              pas.System.Delete({get: function () {
                  return buffer;
                }, set: function (v) {
                  buffer = v;
                }},1,1);
              quotepos = -1;
              if (pas["WEBLib.TMSFNCDataGridUtil"].SinglePos('"',buffer,{get: function () {
                  return quotepos;
                }, set: function (v) {
                  quotepos = v;
                }}) > 0) {
                celltext = pas.System.Copy(buffer,1,quotepos - 1);
                celltext = pas["WEBLib.TMSFNCDataGridUtil"].DoubleToSingleChar('"',celltext);
                pas.System.Delete({get: function () {
                    return buffer;
                  }, set: function (v) {
                    buffer = v;
                  }},1,quotepos);
              } else celltext = "";
              pas["WEBLib.TMSFNCDataGridUtil"].VarCharPos(del,buffer,{get: function () {
                  return delimiterpos;
                }, set: function (v) {
                  delimiterpos = v;
                }});
            } else celltext = pas.System.Copy(buffer,1,delimiterpos - 1);
            pas["WEBLib.TMSFNCDataGridUtil"].CSVToLineFeeds({get: function () {
                return celltext;
              }, set: function (v) {
                celltext = v;
              }});
            s += 1;
            if (s >= this.FColumnCount) this.SetColumnCount(s);
            v = celltext;
            this.DoLoadCellData(s - 1,z,{get: function () {
                return v;
              }, set: function (w) {
                v = w;
              }});
            this.SetCell(s - 1,z,v);
            pas.System.Delete({get: function () {
                return buffer;
              }, set: function (v) {
                buffer = v;
              }},1,delimiterpos);
          };
          if (buffer.length > 0) {
            if (io.TrimSpaces) {
              while ((buffer.length > 1) && (buffer.charAt(0) === " ")) pas.System.Delete({get: function () {
                  return buffer;
                }, set: function (v) {
                  buffer = v;
                }},1,1);
            };
            hasquote = buffer.charAt(0) === '"';
            if (hasquote) pas.System.Delete({get: function () {
                return buffer;
              }, set: function (v) {
                buffer = v;
              }},1,1);
            if (buffer.length > 0) {
              if (hasquote && (buffer.charAt(buffer.length - 1) === '"')) pas.System.Delete({get: function () {
                  return buffer;
                }, set: function (v) {
                  buffer = v;
                }},buffer.length,1);
            };
            if (hasquote) {
              celltext = pas["WEBLib.TMSFNCDataGridUtil"].DoubleToSingleChar('"',buffer)}
             else celltext = buffer;
            pas["WEBLib.TMSFNCDataGridUtil"].CSVToLineFeeds({get: function () {
                return celltext;
              }, set: function (v) {
                celltext = v;
              }});
            s += 1;
            if (s > this.FColumnCount) this.SetColumnCount(s);
            v = celltext;
            this.DoLoadCellData(s - 1,z,{get: function () {
                return v;
              }, set: function (w) {
                v = w;
              }});
            this.SetCell(s - 1,z,v);
          };
          z += 1;
        };
        this.SetRowCount(z + this.FFixedBottomRowCount);
      } finally {
        this.EndUpdate();
        sl = rtl.freeLoc(sl);
        lr = rtl.freeLoc(lr);
      };
    };
    this.InternalLoadFromFile = function (AFileName, AEncoding) {
      var $Self = this;
      var ms = null;
      function InternalInputFromFile() {
        ms.SetPosition(0);
        $Self.InternalLoadFromFileStream(ms,AEncoding);
      };
      ms = pas.Classes.TMemoryStream.$create("Create");
      ms.LoadFromFile(AFileName,function () {
        InternalInputFromFile();
        ms = rtl.freeLoc(ms);
      },null);
    };
    this.InternalLoadFromFileStream = function (AStream, AEncoding) {
      var X = 0;
      var Y = 0;
      var CW = 0;
      var ss = "";
      var ss1 = "";
      var strtCol = 0;
      var strtRow = 0;
      var seppos = 0;
      var sl = null;
      var io = $mod.TTMSFNCDataGridDataInputOutputOptions.$new();
      var v = undefined;
      sl = $mod.TTMSFNCDataGridDataFileStringList.$create("Create$1");
      pas.Classes.TStringsHelper.LoadFromStream$1.call(sl,AStream,AEncoding);
      if (sl.GetEOF()) {
        throw pas.SysUtils.Exception.$create("Create$1",[rtl.getResStr($mod,"sTMSFNCDataGridDataEmptyFileError")]);
        sl = rtl.freeLoc(sl);
        return;
      };
      io.$assign(this.GetIOOptions());
      strtCol = io.StartColumn;
      strtRow = io.StartRow;
      ss = "";
      sl.ReadLn({get: function () {
          return ss;
        }, set: function (v) {
          ss = v;
        }});
      if (ss !== "") {
        ss1 = pas.System.Copy(ss,1,pas["WEBLib.TMSFNCDataGridUtil"].CharPos(",",ss) - 1);
        this.SetColumnCount($impl.MStrToInt(ss1) + strtCol);
        ss1 = pas.System.Copy(ss,pas["WEBLib.TMSFNCDataGridUtil"].CharPos(",",ss) + 1,ss.length);
        this.SetRowCount($impl.MStrToInt(ss1) + strtRow);
      };
      if ((this.FColumnCount === 0) || (this.FRowCount === 0)) {
        sl = rtl.freeLoc(sl);
        throw pas.SysUtils.Exception.$create("Create$1",[rtl.getResStr($mod,"sTMSFNCDataGridDataCorruptFileError")]);
      };
      this.BeginUpdate();
      try {
        this.SetCell(this.FColumnCount - 1,this.FRowCount - 1,"");
        while (!sl.GetEOF()) {
          sl.ReadLn({get: function () {
              return ss;
            }, set: function (v) {
              ss = v;
            }});
          if (pas.System.Pos("cw",ss) === 1) {
            seppos = pas["WEBLib.TMSFNCDataGridUtil"].CharPos(",",ss);
            ss1 = pas.System.Copy(ss,4,seppos - 4);
            ss = pas.System.Copy(ss,seppos + 1,255);
            CW = $impl.MStrToInt(ss1);
            if ((CW >= 0) && (CW < this.FColumnCount)) this.SetColumnWidth(CW,$impl.MStrToInt(ss));
          } else {
            ss1 = $impl.GetToken({get: function () {
                return ss;
              }, set: function (v) {
                ss = v;
              }},",");
            X = $impl.MStrToInt(ss1);
            ss1 = $impl.GetToken({get: function () {
                return ss;
              }, set: function (v) {
                ss = v;
              }},",");
            Y = $impl.MStrToInt(ss1);
            if ((X < this.FColumnCount) && (Y < this.FRowCount)) {
              ss = $impl.FileToLF(ss,true);
              v = ss;
              this.DoLoadCellData(X,Y,{get: function () {
                  return v;
                }, set: function (w) {
                  v = w;
                }});
              this.SetCell(X,Y,v);
            };
          };
        };
      } finally {
        sl = rtl.freeLoc(sl);
        this.EndUpdate();
      };
    };
    this.InternalLoadFromJSON = function (AFileName, AEncoding, ARowDataName, AColumnDataName, AColumnNames) {
      var $Self = this;
      var ms = null;
      function InternalInputFromJSON() {
        ms.SetPosition(0);
        $Self.InternalLoadFromJSONStream(ms,AEncoding,ARowDataName,AColumnDataName,rtl.arrayRef(AColumnNames));
      };
      ms = pas.Classes.TMemoryStream.$create("Create");
      try {
        ms.LoadFromFile(AFileName,function () {
          InternalInputFromJSON();
          ms = rtl.freeLoc(ms);
        },null);
      } finally {
      };
    };
    this.InternalLoadFromJSONStream = function (AStream, AEncoding, ARowDataName, AColumnDataName, AColumnNames) {
      var SL = null;
      SL = pas.Classes.TStringList.$create("Create$1");
      try {
        AStream.SetPosition(0);
        pas.Classes.TStringsHelper.LoadFromStream$1.call(SL,AStream,AEncoding);
        this.InternalLoadFromJSONText(SL.GetTextStr(),ARowDataName,AColumnDataName,rtl.arrayRef(AColumnNames));
      } finally {
        SL = rtl.freeLoc(SL);
      };
    };
    this.InternalLoadFromJSONText = function (AText, ARowDataName, AColumnDataName, AColumnNames) {
      var $Self = this;
      var j = null;
      var jc = null;
      var jo = null;
      var ja = null;
      var I = 0;
      var io = $mod.TTMSFNCDataGridDataInputOutputOptions.$new();
      var z = 0;
      var s = 0;
      var NewRows = 0;
      var strtCol = 0;
      var strtRow = 0;
      function ParseValue(pv, AColumnName) {
        var v = undefined;
        var vc = undefined;
        s += 1;
        if (s >= $Self.FColumnCount) $Self.SetColumnCount(s);
        if (!(pv != null)) return;
        if (pas["WEBLib.JSON"].TJSONObject.isPrototypeOf(pv)) {
          v = pv.ToString()}
         else {
          if (pas["WEBLib.JSON"].TJSONString.isPrototypeOf(pv)) {
            v = pv.GetStrValue()}
           else v = pv.ToString();
        };
        if ((AColumnName !== "") && (strtRow > 0)) {
          vc = AColumnName;
          $Self.DoLoadCellData(s - 1,0,{get: function () {
              return vc;
            }, set: function (v) {
              vc = v;
            }});
          $Self.SetCell(s - 1,0,vc);
        };
        $Self.DoLoadCellData(s - 1,z,{get: function () {
            return v;
          }, set: function (w) {
            v = w;
          }});
        $Self.SetCell(s - 1,z,v);
      };
      function ParseCell(pj) {
        var pjc = null;
        var K = 0;
        var nm = "";
        s = strtCol;
        if (rtl.length(AColumnNames) === 0) {
          if (pas["WEBLib.JSON"].TJSONObject.isPrototypeOf(pj)) {
            for (var $l = 0, $end = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONObjectSize(rtl.as(pj,pas["WEBLib.JSON"].TJSONObject)) - 1; $l <= $end; $l++) {
              K = $l;
              pjc = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONObjectItem(rtl.as(pj,pas["WEBLib.JSON"].TJSONObject),K);
              nm = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONObjectName(rtl.as(pj,pas["WEBLib.JSON"].TJSONObject),K);
              ParseValue(pjc,nm);
            };
          } else ParseValue(pj,"");
        } else {
          for (var $l1 = 0, $end1 = rtl.length(AColumnNames) - 1; $l1 <= $end1; $l1++) {
            K = $l1;
            pjc = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.FindJSONValue(pj,AColumnNames[K]);
            if (pjc != null) {
              ParseValue(pjc,AColumnNames[K])}
             else ParseValue(pj,AColumnNames[K]);
          };
        };
      };
      function ParseRow(sj) {
        var sjc = null;
        var sjo = null;
        var sja = null;
        var K = 0;
        if ((io.MaxRows <= 0) || (NewRows < io.MaxRows)) {
          NewRows += 1;
          if (z >= ($Self.FRowCount - $Self.FFixedBottomRowCount)) $Self.SetRowCount(z + 1000);
          sjc = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.FindJSONValue(sj,AColumnDataName);
          if (sjc != null) {
            if (pas["WEBLib.JSON"].TJSONArray.isPrototypeOf(sjc)) {
              sja = rtl.as(sjc,pas["WEBLib.JSON"].TJSONArray);
              for (var $l = 0, $end = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONArraySize(sja) - 1; $l <= $end; $l++) {
                K = $l;
                sjo = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONArrayItem(sja,K);
                ParseCell(sjo);
              };
            } else ParseCell(sjc);
          } else {
            if (pas["WEBLib.JSON"].TJSONArray.isPrototypeOf(sj)) {
              sja = rtl.as(sj,pas["WEBLib.JSON"].TJSONArray);
              for (var $l1 = 0, $end1 = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONArraySize(sja) - 1; $l1 <= $end1; $l1++) {
                K = $l1;
                sjo = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONArrayItem(sja,K);
                ParseCell(sjo);
              };
            } else ParseCell(sj);
          };
          z += 1;
        };
      };
      this.BeginUpdate();
      try {
        NewRows = 0;
        io.$assign(this.GetIOOptions());
        strtCol = io.StartColumn;
        strtRow = io.StartRow;
        z = strtRow;
        j = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.ParseJSON(AText);
        if (j != null) try {
          if (pas["WEBLib.JSON"].TJSONArray.isPrototypeOf(j)) {
            jc = rtl.as(j,pas["WEBLib.JSON"].TJSONArray)}
           else jc = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.FindJSONValue(j,ARowDataName);
          if (jc != null) {
            if (pas["WEBLib.JSON"].TJSONArray.isPrototypeOf(jc)) {
              ja = rtl.as(jc,pas["WEBLib.JSON"].TJSONArray);
              for (var $l = 0, $end = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONArraySize(ja) - 1; $l <= $end; $l++) {
                I = $l;
                jo = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONArrayItem(ja,I);
                ParseRow(jo);
              };
            } else ParseRow(jc);
          } else {
            ParseRow(j);
          };
        } finally {
          j = rtl.freeLoc(j);
        };
      } finally {
        this.SetRowCount(z + this.FFixedBottomRowCount);
        this.EndUpdate();
      };
    };
    this.InternalLoadFromXML = function (AFileName, AEncoding) {
      var $Self = this;
      var ms = null;
      function InternalInputFromXML() {
        ms.SetPosition(0);
        $Self.InternalLoadFromXMLStream(ms,AEncoding);
      };
      ms = pas.Classes.TMemoryStream.$create("Create");
      ms.LoadFromFile(AFileName,function () {
        InternalInputFromXML();
        ms = rtl.freeLoc(ms);
      },null);
    };
    this.InternalLoadFromXMLStream = function (AStream, AEncoding) {
      var $Self = this;
      var xmldoc = null;
      var r = 0;
      var c = 0;
      var fc = 0;
      var fr = 0;
      var parentNode = null;
      var eNode = null;
      var I = 0;
      var sl = null;
      var slt = null;
      var txt = "";
      var io = $mod.TTMSFNCDataGridDataInputOutputOptions.$new();
      function LoadChildNodes(ANode) {
        var J = 0;
        var idx = 0;
        var v = undefined;
        var n = "";
        for (var $l = 0, $end = $impl.TJSNodeListHelper.GetCount.call(ANode.childNodes) - 1; $l <= $end; $l++) {
          J = $l;
          if ($impl.TJSNodeListHelper.GetCount.call(ANode.childNodes.item(J).childNodes) > 1) {
            LoadChildNodes(ANode.childNodes.item(J));
          } else if ($impl.TJSNodeListHelper.GetCount.call(ANode.childNodes.item(J).childNodes) === 1) {
            eNode = ANode.childNodes.item(J);
            idx = sl.IndexOf(eNode.nodeName);
            if (idx === -1) {
              sl.Add(eNode.nodeName);
              idx = sl.GetCount() - 1;
              n = eNode.nodeName;
              v = n;
              $Self.DoLoadCellData(idx + fc,fr - 1,{get: function () {
                  return v;
                }, set: function (w) {
                  v = w;
                }});
              $Self.SetCell(idx + fc,fr - 1,n);
            };
            v = eNode.childNodes.item(0).nodeValue;
            $Self.DoLoadCellData(idx + fc,r,{get: function () {
                return v;
              }, set: function (w) {
                v = w;
              }});
            $Self.SetCell(idx + fc,r,v);
          };
        };
        if ($impl.TJSNodeListHelper.GetCount.call(ANode.childNodes) > 0) r = r + 1;
      };
      slt = pas.Classes.TStringList.$create("Create$1");
      pas.Classes.TStringsHelper.LoadFromStream$1.call(slt,AStream,AEncoding);
      if (slt.GetCount() === 0) {
        throw pas.SysUtils.Exception.$create("Create$1",[rtl.getResStr($mod,"sTMSFNCDataGridDataEmptyFileError")]);
        slt = rtl.freeLoc(slt);
        return;
      };
      txt = slt.GetTextStr();
      this.BeginUpdate();
      try {
        var parser = new DOMParser();
        xmldoc = parser.parseFromString(txt, 'text/xml');
        parentNode = xmldoc.documentElement;
        io.$assign(this.GetIOOptions());
        fc = io.StartColumn;
        fr = io.StartRow;
        r = fr;
        sl = pas.Classes.TStringList.$create("Create$1");
        try {
          for (var $l = 0, $end = $impl.TJSNodeListHelper.GetCount.call(parentNode.childNodes) - 1; $l <= $end; $l++) {
            I = $l;
            LoadChildNodes(parentNode.childNodes.item(I));
          };
        } finally {
          c = sl.GetCount() + fc;
          sl = rtl.freeLoc(sl);
        };
        this.SetColumnCount(c);
        this.SetRowCount(r);
      } finally {
        this.EndUpdate();
        slt = rtl.freeLoc(slt);
      };
    };
    this.InternalRowCalculation = function (ACalculations) {
      var k = 0;
      var I = "";
      var str = "";
      var s = "";
      var l = null;
      var cm = $mod.TTMSFNCDataGridDataRowCalculation.$new();
      var cma = [];
      var opt = $mod.TTMSFNCDataGridDataRowCalculationOptions.$new();
      var fr = 0;
      var frto = 0;
      var outc = 0;
      var J = 0;
      var a = false;
      var $in = ACalculations.GetKeys().GetEnumerator$1();
      try {
        while ($in.MoveNext$1()) {
          k = $in.GetCurrent();
          l = ACalculations.GetItem(k);
          var $in1 = l.GetKeys().GetEnumerator$1();
          try {
            while ($in1.MoveNext$1()) {
              I = $in1.GetCurrent();
              s = "";
              outc = -1;
              cma = rtl.arrayRef(l.GetItem(I));
              for (var $l = 0, $end = rtl.length(cma) - 1; $l <= $end; $l++) {
                J = $l;
                cm.$assign(cma[J]);
                opt.$assign(this.GetRowCalculationOptions());
                if (cm.OptionsCallback != null) {
                  cm.OptionsCallback(k,opt)}
                 else this.DoGetRowCalculationOptions(k,0,opt);
                if ((cm.FromColumn !== -1) && (cm.ToColumn !== -1)) {
                  fr = cm.FromColumn;
                  frto = cm.ToColumn;
                } else {
                  fr = this.FFixedColumnCount;
                  frto = this.FColumnCount - this.FFixedRightColumnCount - 1;
                };
                var $tmp = opt.CalculationFormatType;
                if ($tmp === $mod.TTMSFNCDataGridDataCalculationFormatType.gcfNumber) {
                  var $tmp1 = cm.Method;
                  if ($tmp1 === $mod.TTMSFNCDataGridDataCalculationMethod.gcmSum) {
                    str = pas.SysUtils.Format(opt.CalculationFormat,pas.System.VarRecs(3,this.RowSum(k,fr,frto)))}
                   else if ($tmp1 === $mod.TTMSFNCDataGridDataCalculationMethod.gcmAverage) {
                    str = pas.SysUtils.Format(opt.CalculationFormat,pas.System.VarRecs(3,this.RowAverage(k,fr,frto)))}
                   else if ($tmp1 === $mod.TTMSFNCDataGridDataCalculationMethod.gcmCount) {
                    str = pas.SysUtils.Format(opt.CalculationFormat,pas.System.VarRecs(3,this.RowCounting(k,fr,frto)))}
                   else if ($tmp1 === $mod.TTMSFNCDataGridDataCalculationMethod.gcmMin) {
                    str = pas.SysUtils.Format(opt.CalculationFormat,pas.System.VarRecs(3,this.RowMin(k,fr,frto)))}
                   else if ($tmp1 === $mod.TTMSFNCDataGridDataCalculationMethod.gcmMax) {
                    str = pas.SysUtils.Format(opt.CalculationFormat,pas.System.VarRecs(3,this.RowMax(k,fr,frto)))}
                   else if ($tmp1 === $mod.TTMSFNCDataGridDataCalculationMethod.gcmCustom) {
                    str = pas.SysUtils.Format(opt.CalculationFormat,pas.System.VarRecs(3,this.RowCustomCalculation(k,cm.CustomCalculationCallback,fr,frto)))}
                   else if ($tmp1 === $mod.TTMSFNCDataGridDataCalculationMethod.gcmDistinct) {
                    str = pas.SysUtils.Format(opt.CalculationFormat,pas.System.VarRecs(3,this.RowDistinct(k,fr,frto)))}
                   else if ($tmp1 === $mod.TTMSFNCDataGridDataCalculationMethod.gcmStandardDeviation) str = pas.SysUtils.Format(opt.CalculationFormat,pas.System.VarRecs(3,this.RowStandardDeviation(k,fr,frto)));
                } else if ($tmp === $mod.TTMSFNCDataGridDataCalculationFormatType.gcfFloat) {
                  var $tmp2 = cm.Method;
                  if ($tmp2 === $mod.TTMSFNCDataGridDataCalculationMethod.gcmSum) {
                    str = pas.SysUtils.FormatFloat(opt.CalculationFormat,this.RowSum(k,fr,frto))}
                   else if ($tmp2 === $mod.TTMSFNCDataGridDataCalculationMethod.gcmAverage) {
                    str = pas.SysUtils.FormatFloat(opt.CalculationFormat,this.RowAverage(k,fr,frto))}
                   else if ($tmp2 === $mod.TTMSFNCDataGridDataCalculationMethod.gcmCount) {
                    str = pas.SysUtils.FormatFloat(opt.CalculationFormat,this.RowCounting(k,fr,frto))}
                   else if ($tmp2 === $mod.TTMSFNCDataGridDataCalculationMethod.gcmMin) {
                    str = pas.SysUtils.FormatFloat(opt.CalculationFormat,this.RowMin(k,fr,frto))}
                   else if ($tmp2 === $mod.TTMSFNCDataGridDataCalculationMethod.gcmMax) {
                    str = pas.SysUtils.FormatFloat(opt.CalculationFormat,this.RowMax(k,fr,frto))}
                   else if ($tmp2 === $mod.TTMSFNCDataGridDataCalculationMethod.gcmCustom) {
                    str = pas.SysUtils.FormatFloat(opt.CalculationFormat,this.RowCustomCalculation(k,cm.CustomCalculationCallback,fr,frto))}
                   else if ($tmp2 === $mod.TTMSFNCDataGridDataCalculationMethod.gcmDistinct) {
                    str = pas.SysUtils.FormatFloat(opt.CalculationFormat,this.RowDistinct(k,fr,frto))}
                   else if ($tmp2 === $mod.TTMSFNCDataGridDataCalculationMethod.gcmStandardDeviation) str = pas.SysUtils.FormatFloat(opt.CalculationFormat,this.RowStandardDeviation(k,fr,frto));
                };
                s = s + str;
                outc = cm.OutputColumn;
              };
              if (outc !== -1) {
                a = true;
                this.DoBeforeSetRowCalculation(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(outc,k)),$mod.TTMSFNCDataGridDataRowCalculation.$clone(cm),I,{get: function () {
                    return str;
                  }, set: function (v) {
                    str = v;
                  }},{get: function () {
                    return a;
                  }, set: function (v) {
                    a = v;
                  }});
                if (a) {
                  this.SetCell(outc,k,str);
                  this.DoAfterSetRowCalculation(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(outc,k)),$mod.TTMSFNCDataGridDataRowCalculation.$clone(cm),I,str);
                };
              } else if (this.FFixedRightColumnCount > 0) {
                a = true;
                this.DoBeforeSetRowCalculation(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(this.FColumnCount - this.FFixedRightColumnCount,k)),$mod.TTMSFNCDataGridDataRowCalculation.$clone(cm),I,{get: function () {
                    return str;
                  }, set: function (v) {
                    str = v;
                  }},{get: function () {
                    return a;
                  }, set: function (v) {
                    a = v;
                  }});
                if (a) {
                  this.SetCell(this.FColumnCount - this.FFixedRightColumnCount,k,str);
                  this.DoAfterSetRowCalculation(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(this.FColumnCount - this.FFixedRightColumnCount,k)),$mod.TTMSFNCDataGridDataRowCalculation.$clone(cm),I,str);
                };
              };
            }
          } finally {
            $in1 = rtl.freeLoc($in1)
          };
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.InternalRowCalculation$1 = function (ARows, AOutputColumn, AFromColumn, AToColumn, AMethod, ACalculationOptionsCallback, ACustomCalculationCallback) {
      var d = null;
      d = $impl.GetRowCalculations(rtl.arrayRef(ARows),AOutputColumn,AFromColumn,AToColumn,AMethod,ACalculationOptionsCallback,ACustomCalculationCallback);
      try {
        this.InternalRowCalculation(d);
      } finally {
        d = rtl.freeLoc(d);
      };
    };
    this.InternalSaveToCSV = function (AFileName, AEncoding) {
      var $Self = this;
      var ms = null;
      function InternalOutputToCSV() {
        ms.SetPosition(0);
        $Self.InternalSaveToCSVStream(ms,AEncoding);
      };
      ms = pas.Classes.TMemoryStream.$create("Create");
      try {
        InternalOutputToCSV();
        pas["WEBLib.TMSFNCTypes"].TTMSFNCMemoryStream.SaveToFile.call(ms,AFileName);
        if (this.FOptions.FIO.FOpenAfterCreation) pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.OpenFile(AFileName,null);
      } finally {
        ms = rtl.freeLoc(ms);
      };
    };
    this.InternalSaveToCSVStream = function (AStream, AEncoding) {
      var z = 0;
      var s = 0;
      var rs = 0;
      var CellText = "";
      var Delim = "\x00";
      var dblquotes = false;
      var sl = null;
      var io = $mod.TTMSFNCDataGridDataInputOutputOptions.$new();
      var v = undefined;
      var FirstCellInRow = false;
      sl = $mod.TTMSFNCDataGridDataFileStringList.$create("Create$1");
      io.$assign(this.GetIOOptions());
      this.ExportNotification(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridExportState.gesExportStart,io.StartRow);
      try {
        if (io.Delimiter === "\x00") {
          Delim = ","}
         else Delim = io.Delimiter;
        sl.SetLineBreak("\r\n");
        for (var $l = io.StartRow, $end = this.FRowCount - 1; $l <= $end; $l++) {
          z = $l;
          if (this.IsRowDisplayed(z)) {
            this.ExportNotification(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridExportState.gesExportNextRow,z);
            FirstCellInRow = true;
            for (var $l1 = io.StartColumn, $end1 = this.FColumnCount - 1; $l1 <= $end1; $l1++) {
              s = $l1;
              if (this.IsColumnDisplayed(s)) {
                if (!FirstCellInRow) sl.Write(Delim);
                rs = s;
                v = this.GetCell(rs,z);
                this.DoSaveCellData(rs,z,{get: function () {
                    return v;
                  }, set: function (w) {
                    v = w;
                  }});
                CellText = this.$class.ValueToString(v);
                CellText = pas["WEBLib.TMSFNCDataGridUtil"].CSVQuotes(CellText);
                dblquotes = false;
                if (io.AlwaysQuotes || ((pas.System.Pos(Delim,CellText) === 0) && (pas.System.Pos('"',CellText) > 0))) {
                  CellText = '"' + CellText + '"';
                  dblquotes = true;
                };
                if (CellText === "") {
                  if (io.QuoteEmptyCells) CellText = '""';
                };
                if ((pas.System.Pos(Delim,CellText) > 0) || (pas["WEBLib.TMSFNCDataGridUtil"].LinesInText(CellText,true) > 1)) {
                  if (!dblquotes) {
                    pas["WEBLib.TMSFNCDataGridUtil"].LineFeedsToCSV({get: function () {
                        return CellText;
                      }, set: function (v) {
                        CellText = v;
                      }})}
                   else pas["WEBLib.TMSFNCDataGridUtil"].LineFeedsToCSVNQ({get: function () {
                      return CellText;
                    }, set: function (v) {
                      CellText = v;
                    }});
                };
                sl.Write(CellText);
                FirstCellInRow = false;
              };
            };
            sl.WriteLn("");
          };
        };
        pas.Classes.TStringsHelper.SaveToStream$1.call(sl,AStream,AEncoding);
      } finally {
        sl = rtl.freeLoc(sl);
        this.ExportNotification(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridExportState.gesExportDone,-1);
      };
    };
    this.InternalSaveToFile = function (AFileName, AEncoding) {
      var $Self = this;
      var ms = null;
      function InternalOutputToFile() {
        ms.SetPosition(0);
        $Self.InternalSaveToFileStream(ms,AEncoding);
      };
      ms = pas.Classes.TMemoryStream.$create("Create");
      try {
        InternalOutputToFile();
        pas["WEBLib.TMSFNCTypes"].TTMSFNCMemoryStream.SaveToFile.call(ms,AFileName);
        if (this.FOptions.FIO.FOpenAfterCreation) pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.OpenFile(AFileName,null);
      } finally {
        ms = rtl.freeLoc(ms);
      };
    };
    this.InternalSaveToFileStream = function (AStream, AEncoding) {
      var i = 0;
      var j = 0;
      var ss = "";
      var CellText = "";
      var sl = null;
      var io = $mod.TTMSFNCDataGridDataInputOutputOptions.$new();
      var v = undefined;
      sl = pas.Classes.TStringList.$create("Create$1");
      io.$assign(this.GetIOOptions());
      this.ExportNotification(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridExportState.gesExportStart,io.StartRow);
      try {
        ss = pas.SysUtils.IntToStr(this.FColumnCount) + "," + pas.SysUtils.IntToStr(this.FRowCount);
        sl.Add(ss);
        for (var $l = io.StartColumn, $end = this.FColumnCount - 1; $l <= $end; $l++) {
          i = $l;
          ss = "cw " + pas.SysUtils.IntToStr(i) + "," + pas.SysUtils.FloatToStr(this.GetColumnWidth(i));
          sl.Add(ss);
        };
        for (var $l1 = io.StartRow, $end1 = this.FRowCount - 1; $l1 <= $end1; $l1++) {
          i = $l1;
          this.ExportNotification(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridExportState.gesExportNewRow,i);
          for (var $l2 = io.StartColumn, $end2 = this.FColumnCount - 1; $l2 <= $end2; $l2++) {
            j = $l2;
            v = this.GetCell(j,i);
            this.DoSaveCellData(j,i,{get: function () {
                return v;
              }, set: function (w) {
                v = w;
              }});
            CellText = this.$class.ValueToString(v);
            if (CellText !== "") {
              ss = pas.SysUtils.IntToStr(j) + "," + pas.SysUtils.IntToStr(i) + "," + pas["WEBLib.TMSFNCDataGridUtil"].LFToFile(CellText);
              sl.Add(ss);
            };
          };
        };
        pas.Classes.TStringsHelper.SaveToStream$1.call(sl,AStream,AEncoding);
      } finally {
        sl = rtl.freeLoc(sl);
        this.ExportNotification(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridExportState.gesExportDone,-1);
      };
    };
    this.InternalSort = function (AColumns, ADirections, ALevel, AFromRow, AToRow, ACustomCompareCallback, ASortOptionsCallback) {
      var $Self = this;
      var acol = 0;
      var R = 0;
      var K = 0;
      var minr = 0;
      var maxr = 0;
      var I = 0;
      var c = 0;
      var a = [];
      var ac = [];
      var d = $mod.TTMSFNCDataGridDataSortInfo.$new();
      var cd = $mod.TTMSFNCDataGridDataSortCellInfo.$new();
      var soa = [];
      var so = $mod.TTMSFNCDataGridDataSortOptions.$new();
      var $ir = rtl.createIntfRefs();
      try {
        if (rtl.length(AColumns) === 0) {
          this.LogMessage("No columns available for sorting.",pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridLogMessageType.glmInfo);
          return;
        };
        for (var $l = 0, $end = rtl.length(AColumns) - 1; $l <= $end; $l++) {
          I = $l;
          if (!this.IsColumnValid(AColumns[I])) {
            this.LogMessage("Column(s) [" + this.FormatArray(rtl.arrayRef(AColumns)) + "] cannot be sorted.",pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridLogMessageType.glmInfo);
            return;
          };
        };
        minr = AFromRow;
        maxr = AToRow;
        if (maxr <= minr) {
          this.LogMessage("Rows cannot be sorted, please make sure that there is more than 1 sortable row",pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridLogMessageType.glmInfo);
          return;
        };
        if (this.FAdapter != null) {
          var $tmp = this.FAdapter.SortMode();
          if ($tmp === $mod.TTMSFNCDataGridDataAdapterSortMode.asmNone) {
            return}
           else if ($tmp === $mod.TTMSFNCDataGridDataAdapterSortMode.asmAdapter) {
            this.FAdapter.SortData();
            return;
          };
        };
        if (this.HasMergedCells(rtl.arrayRef(AColumns),AFromRow,AToRow)) {
          this.LogMessage("Column(s) [" + this.FormatArray(rtl.arrayRef(AColumns)) + "] cannot be sorted, please split merged cells first.",pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridLogMessageType.glmInfo);
          return;
        };
        acol = 0;
        c = AColumns[acol];
        this.BeginUpdate();
        try {
          a = rtl.arraySetLength(a,$mod.TTMSFNCDataGridDataSortInfo,(maxr - minr) + 1);
          soa = rtl.arraySetLength(soa,$mod.TTMSFNCDataGridDataSortOptions,rtl.length(AColumns));
          for (var $l1 = 0, $end1 = rtl.length(AColumns) - 1; $l1 <= $end1; $l1++) {
            I = $l1;
            so.$assign(this.GetSortOptions());
            if (I <= (rtl.length(ADirections) - 1)) so.Direction = ADirections[I];
            if (ASortOptionsCallback != null) {
              ASortOptionsCallback(AColumns[I],ALevel,so)}
             else this.DoGetSortOptions(AColumns[I],ALevel,so);
            soa[I].$assign(so);
          };
          R = 0;
          for (var $l2 = minr, $end2 = maxr; $l2 <= $end2; $l2++) {
            I = $l2;
            ac = rtl.arraySetLength(ac,$mod.TTMSFNCDataGridDataSortCellInfo,rtl.length(AColumns));
            for (var $l3 = 0, $end3 = rtl.length(AColumns) - 1; $l3 <= $end3; $l3++) {
              K = $l3;
              cd.Data = this.GetCell(AColumns[K],I);
              cd.Column = AColumns[K];
              cd.Options.$assign(soa[K]);
              ac[K].$assign(cd);
            };
            d.Data = rtl.arrayRef(ac);
            d.Row = I;
            a[R].$assign(d);
            R += 1;
          };
          if (rtl.length(a) > 0) {
            this.QuickSort$$$G$$WEBLib$TMSFNCDataGridData$$TTMSFNCDataGridDataSortInfo({get: function () {
                return a;
              }, set: function (v) {
                a = v;
              }},$ir.ref(1,pas["Generics.Defaults"].TComparer$$$G$$generics$defaults$$TTMSFNCDataGridDataSortInfo.Construct(function (V1, V2) {
              var Result = 0;
              Result = $Self.CompareRows(c,ALevel,$mod.TTMSFNCDataGridDataSortInfo.$clone(V1),$mod.TTMSFNCDataGridDataSortInfo.$clone(V2),ACustomCompareCallback);
              return Result;
            })),0,rtl.length(a) - 1,function (Values, L, R) {
              var tl = $mod.TTMSFNCDataGridDataSortInfo.$new();
              var tr = $mod.TTMSFNCDataGridDataSortInfo.$new();
              var ll = 0;
              var rr = 0;
              tl.$assign(Values.get()[L]);
              ll = tl.Row;
              tr.$assign(Values.get()[R]);
              rr = tr.Row;
              tr.Row = ll;
              tl.Row = rr;
              Values.get()[L].$assign(tr);
              Values.get()[R].$assign(tl);
              $Self.SwapRow(tl.Row,tr.Row);
            });
          };
        } finally {
          this.EndUpdate();
        };
      } finally {
        $ir.free();
      };
    };
    this.MoveCellData = function (AFromCell, AToCell) {
      this.SwapCellData(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(AFromCell),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(AToCell),$mod.TTMSFNCDataGridDataSwapDirection.gswdToOnly);
    };
    this.MoveColumnData = function (AFromColumn, AToColumn) {
      var pb = pas["Generics.Collections"].TPair$$$G$$generics$collections$$Longint$$Boolean.$new();
      var pd = pas["Generics.Collections"].TPair$$$G$$generics$collections$$Longint$$Double.$new();
      var ps = null;
      var pc = pas["Generics.Collections"].TPair$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$.$new();
      var R = 0;
      var f = null;
      if (this.GetColumnWidthDictionary().ContainsKey(AFromColumn)) {
        pd.$assign(this.GetColumnWidthDictionary().ExtractPair(AFromColumn));
        this.SetColumnWidth(AToColumn,pd.Value);
        this.GetColumnPositionDictionary().Remove(AFromColumn);
        this.GetColumnWidthDictionary().Remove(AFromColumn);
      };
      if (this.GetHiddenColumnDictionary().ContainsKey(AFromColumn)) {
        pb.$assign(this.GetHiddenColumnDictionary().ExtractPair(AFromColumn));
        this.SetHiddenColumn(AToColumn,pb.Value);
        this.GetHiddenColumnDictionary().Remove(AFromColumn);
      };
      if (this.GetColumnCalculationDictionary().ContainsKey(AFromColumn)) {
        pc.$assign(this.GetColumnCalculationDictionary().ExtractPair(AFromColumn));
        this.GetColumnCalculationDictionary().AddOrSetValue(AToColumn,pc.Value);
        this.GetColumnCalculationDictionary().Remove(AFromColumn);
      };
      if (this.GetMergedColumnDictionary().ContainsKey(AFromColumn)) {
        pb.$assign(this.GetMergedColumnDictionary().ExtractPair(AFromColumn));
        this.SetMergedColumn(AToColumn,pb.Value);
        this.GetMergedColumnDictionary().Remove(AFromColumn);
      };
      ps = null;
      if (this.GetSortIndexList().Find(AFromColumn,{get: function () {
          return ps;
        }, set: function (v) {
          ps = v;
        }})) ps.FColumn = AToColumn;
      if (this.GetFilter().HasFilter(AFromColumn)) {
        f = this.GetFilter().GetColumnFilter(AFromColumn);
        f.SetColumn(AToColumn);
      };
      for (var $l = this.FRowCount - 1; $l >= 0; $l--) {
        R = $l;
        this.MoveCellData(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AFromColumn,R)),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AToColumn,R)));
      };
      if (!this.GetColumnOrderDictionary().ContainsKey(AFromColumn)) this.SetColumnOrder(AFromColumn,AFromColumn);
    };
    this.MoveRowData = function (AFromRow, AToRow) {
      var pb = pas["Generics.Collections"].TPair$$$G$$generics$collections$$Longint$$Boolean.$new();
      var fr = pas["Generics.Collections"].TPair$$$G$$generics$collections$$Longint$$Boolean.$new();
      var pd = pas["Generics.Collections"].TPair$$$G$$generics$collections$$Longint$$Double.$new();
      var pr = pas["Generics.Collections"].TPair$$$G$$generics$collections$$Longint$$TTMSFNCDataGridRowItem.$new();
      var rc = pas["Generics.Collections"].TPair$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$.$new();
      if (this.GetRowHeightDictionary().ContainsKey(AFromRow)) {
        pd.$assign(this.GetRowHeightDictionary().ExtractPair(AFromRow));
        this.SetRowHeight(AToRow,pd.Value);
        this.GetRowPositionDictionary().Remove(AFromRow);
        this.GetRowHeightDictionary().Remove(AFromRow);
      };
      if (this.GetHiddenRowDictionary().ContainsKey(AFromRow)) {
        pb.$assign(this.GetHiddenRowDictionary().ExtractPair(AFromRow));
        this.SetHiddenRow(AToRow,pb.Value);
        this.GetHiddenRowDictionary().Remove(AFromRow);
      };
      if (this.GetFilteredRowDictionary().ContainsKey(AFromRow)) {
        fr.$assign(this.GetFilteredRowDictionary().ExtractPair(AFromRow));
        this.SetFilteredRow(AToRow,fr.Value);
        this.GetFilteredRowDictionary().Remove(AFromRow);
      };
      if (this.GetMergedRowDictionary().ContainsKey(AFromRow)) {
        pb.$assign(this.GetMergedRowDictionary().ExtractPair(AFromRow));
        this.SetMergedRow(AToRow,pb.Value);
        this.GetMergedRowDictionary().Remove(AFromRow);
      };
      if (this.GetRowCalculationDictionary().ContainsKey(AFromRow)) {
        rc.$assign(this.GetRowCalculationDictionary().ExtractPair(AFromRow));
        this.GetRowCalculationDictionary().AddOrSetValue(AToRow,rc.Value);
        this.GetRowCalculationDictionary().Remove(AFromRow);
      };
      if (this.GetDataDictionary().ContainsKey(AFromRow)) {
        pr.$assign(this.GetDataDictionary().ExtractPair(AFromRow));
        this.GetDataDictionary().AddOrSetValue(AToRow,pr.Value);
        this.GetDataDictionary().Remove(AFromRow);
      };
      if (!this.GetRowOrderDictionary().ContainsKey(AFromRow)) this.SetRowOrder(AFromRow,AFromRow);
    };
    this.RegisterRuntimeClasses = function () {
      pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCore.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClasses([pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItem,pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemExtended,$mod.TTMSFNCDataGridDataGroup,$mod.TTMSFNCDataGridDataFilterData]);
    };
    this.RemoveCellControlFromCache = function (AColumn, ARow) {
    };
    this.SetBoolean = function (AColumn, ARow, Value) {
      var cd = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      cd = this.GetCellDataExtended(AColumn,ARow);
      if (cd != null) {
        cd.FBooleanValue = Value;
        this.DoUpdate();
      };
    };
    this.ShiftColumnOrder = function (AStartColumn, AShift) {
      var k = 0;
      var v = 0;
      var $in = this.GetColumnOrderDictionary().GetKeys().GetEnumerator$1();
      try {
        while ($in.MoveNext$1()) {
          k = $in.GetCurrent();
          if ((this.GetColumnOrderDictionary().GetItem(k) !== -1) && (this.GetColumnOrderDictionary().GetItem(k) >= AStartColumn)) {
            v = this.GetColumnOrderDictionary().GetItem(k);
            this.GetColumnOrderDictionary().SetItem(k,v + AShift);
            this.GetColumnReverseOrderDictionary().AddOrSetValue(v + AShift,k);
          };
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.ShiftRowOrder = function (AStartRow, AShift) {
      var $Self = this;
      var k = 0;
      var v = 0;
      function ShiftGroups(AGroupDictionary) {
        var ks = "";
        var grp = null;
        if (AGroupDictionary != null) {
          var $in = AGroupDictionary.GetKeys().GetEnumerator$1();
          try {
            while ($in.MoveNext$1()) {
              ks = $in.GetCurrent();
              grp = AGroupDictionary.GetItem(ks);
              if (grp != null) {
                if (grp.FRow >= AStartRow) grp.FRow = grp.FRow + AShift;
                if (grp.FSummaryRow >= AStartRow) grp.FSummaryRow = grp.FSummaryRow + AShift;
                ShiftGroups(grp.GetGroupDictionary());
              };
            }
          } finally {
            $in = rtl.freeLoc($in)
          };
        };
      };
      var $in = this.GetRowOrderDictionary().GetKeys().GetEnumerator$1();
      try {
        while ($in.MoveNext$1()) {
          k = $in.GetCurrent();
          if ((this.GetRowOrderDictionary().GetItem(k) !== -1) && (this.GetRowOrderDictionary().GetItem(k) >= AStartRow)) {
            v = this.GetRowOrderDictionary().GetItem(k);
            this.GetRowOrderDictionary().SetItem(k,v + AShift);
            this.GetRowReverseOrderDictionary().AddOrSetValue(v + AShift,k);
          };
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      ShiftGroups(this.GetGroupDictionary());
    };
    this.SwapCellData = function (AFromCell, AToCell, ASwapDirection) {
      var p = pas["Generics.Collections"].TPair$$$G$$generics$collections$$Longint$$TTMSFNCDataGridCellItem.$new();
      var pt = pas["Generics.Collections"].TPair$$$G$$generics$collections$$Longint$$TTMSFNCDataGridCellItem.$new();
      var r = null;
      var rt = null;
      var v = null;
      var vt = null;
      v = null;
      r = null;
      if (this.GetDataDictionary().TryGetValue(AFromCell.GetRow(),{get: function () {
          return r;
        }, set: function (v) {
          r = v;
        }})) {
        if (r != null) {
          p.$assign(r.GetData().ExtractPair(AFromCell.GetColumn()));
          v = p.Value;
        };
      };
      if (!(r != null)) r = this.GetRowData(AFromCell.GetRow());
      vt = null;
      rt = null;
      if (this.GetDataDictionary().TryGetValue(AToCell.GetRow(),{get: function () {
          return rt;
        }, set: function (v) {
          rt = v;
        }})) {
        if (rt != null) {
          pt.$assign(rt.GetData().ExtractPair(AToCell.GetColumn()));
          vt = pt.Value;
        };
      };
      if (!(rt != null)) rt = this.GetRowData(AToCell.GetRow());
      if ((rt != null) && (ASwapDirection in rtl.createSet($mod.TTMSFNCDataGridDataSwapDirection.gswdBoth,$mod.TTMSFNCDataGridDataSwapDirection.gswdToOnly))) {
        rt.GetData().AddOrSetValue(AToCell.GetColumn(),v)}
       else if (v != null) v = rtl.freeLoc(v);
      if ((r != null) && (ASwapDirection in rtl.createSet($mod.TTMSFNCDataGridDataSwapDirection.gswdBoth,$mod.TTMSFNCDataGridDataSwapDirection.gswdFromOnly))) {
        r.GetData().AddOrSetValue(AFromCell.GetColumn(),vt)}
       else if (vt != null) vt = rtl.freeLoc(vt);
    };
    this.SwapColumnData = function (AFromColumn, AToColumn) {
      var cw = 0.0;
      var cwt = 0.0;
      var hc = false;
      var hct = false;
      var mc = false;
      var mct = false;
      var co = 0;
      var cot = 0;
      var cov = 0;
      var cotv = 0;
      var cm = pas["Generics.Collections"].TPair$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$.$new();
      var cmt = pas["Generics.Collections"].TPair$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataColumnCalculationArray$.$new();
      var sd = null;
      var sdt = null;
      var r = 0;
      var f = null;
      var ft = null;
      cw = this.GetHiddenColumnWidth(AFromColumn);
      cwt = this.GetHiddenColumnWidth(AToColumn);
      this.FBlockWidthChange = true;
      this.SetColumnWidth(AFromColumn,cwt);
      this.SetColumnWidth(AToColumn,cw);
      this.FBlockWidthChange = false;
      hc = this.GetHiddenColumn(AFromColumn);
      hct = this.GetHiddenColumn(AToColumn);
      this.FBlockVisibilityChange = true;
      this.SetHiddenColumn(AFromColumn,hct);
      this.SetHiddenColumn(AToColumn,hc);
      this.FBlockVisibilityChange = false;
      if (this.GetColumnCalculationDictionary().ContainsKey(AFromColumn)) {
        cm.$assign(this.GetColumnCalculationDictionary().ExtractPair(AFromColumn));
        cmt.$assign(this.GetColumnCalculationDictionary().ExtractPair(AToColumn));
        this.GetColumnCalculationDictionary().AddOrSetValue(AToColumn,cm.Value);
        this.GetColumnCalculationDictionary().AddOrSetValue(AFromColumn,cmt.Value);
      };
      mc = this.GetMergedColumn(AFromColumn);
      mct = this.GetMergedColumn(AToColumn);
      this.SetMergedColumn(AFromColumn,mct);
      this.SetMergedColumn(AToColumn,mc);
      sd = null;
      if (this.GetSortIndexList().Find(AFromColumn,{get: function () {
          return sd;
        }, set: function (v) {
          sd = v;
        }})) sd.FColumn = AToColumn;
      sdt = null;
      if (this.GetSortIndexList().Find(AToColumn,{get: function () {
          return sdt;
        }, set: function (v) {
          sdt = v;
        }})) sdt.FColumn = AFromColumn;
      f = null;
      if (this.GetFilter().HasFilter(AFromColumn)) f = this.GetFilter().GetColumnFilter(AFromColumn);
      ft = null;
      if (this.GetFilter().HasFilter(AToColumn)) ft = this.GetFilter().GetColumnFilter(AToColumn);
      if (f != null) f.SetColumn(AToColumn);
      if (ft != null) ft.SetColumn(AFromColumn);
      for (var $l = 0, $end = this.FRowCount - 1; $l <= $end; $l++) {
        r = $l;
        this.SwapCellData(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AFromColumn,r)),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AToColumn,r)),$mod.TTMSFNCDataGridDataSwapDirection.gswdBoth);
      };
      co = this.GetColumnReverseOrder(AFromColumn);
      cot = this.GetColumnReverseOrder(AToColumn);
      cov = this.GetColumnOrder(co);
      cotv = this.GetColumnOrder(cot);
      this.SetColumnOrder(co,cotv);
      this.SetColumnOrder(cot,cov);
    };
    this.SwapRowData = function (AFromRow, AToRow) {
      var rh = 0.0;
      var rht = 0.0;
      var hr = false;
      var hrt = false;
      var mr = false;
      var mrt = false;
      var ro = 0;
      var rot = 0;
      var rov = 0;
      var rotv = 0;
      var r = pas["Generics.Collections"].TPair$$$G$$generics$collections$$Longint$$TTMSFNCDataGridRowItem.$new();
      var rt = pas["Generics.Collections"].TPair$$$G$$generics$collections$$Longint$$TTMSFNCDataGridRowItem.$new();
      var rm = pas["Generics.Collections"].TPair$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$.$new();
      var rmt = pas["Generics.Collections"].TPair$$$G$$generics$collections$$Longint$$TDictionary$System$String$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridDataRowCalculationArray$.$new();
      var fr = false;
      var frt = false;
      rh = this.GetHiddenRowHeight(AFromRow);
      rht = this.GetHiddenRowHeight(AToRow);
      this.SetRowHeight(AFromRow,rht);
      this.SetRowHeight(AToRow,rh);
      hr = this.GetHiddenRow(AFromRow);
      hrt = this.GetHiddenRow(AToRow);
      this.SetHiddenRow(AFromRow,hrt);
      this.SetHiddenRow(AToRow,hr);
      fr = this.GetFilteredRow(AFromRow);
      frt = this.GetFilteredRow(AToRow);
      this.SetFilteredRow(AFromRow,frt);
      this.SetFilteredRow(AToRow,fr);
      if (this.GetRowCalculationDictionary().ContainsKey(AFromRow)) {
        rm.$assign(this.GetRowCalculationDictionary().ExtractPair(AFromRow));
        rmt.$assign(this.GetRowCalculationDictionary().ExtractPair(AToRow));
        this.GetRowCalculationDictionary().AddOrSetValue(AToRow,rm.Value);
        this.GetRowCalculationDictionary().AddOrSetValue(AFromRow,rmt.Value);
      };
      mr = this.GetMergedRow(AFromRow);
      mrt = this.GetMergedRow(AToRow);
      this.SetMergedRow(AFromRow,mrt);
      this.SetMergedRow(AToRow,mr);
      r.$assign(this.GetDataDictionary().ExtractPair(AFromRow));
      rt.$assign(this.GetDataDictionary().ExtractPair(AToRow));
      this.GetDataDictionary().AddOrSetValue(AToRow,r.Value);
      this.GetDataDictionary().AddOrSetValue(AFromRow,rt.Value);
      ro = this.GetRowReverseOrder(AFromRow);
      rot = this.GetRowReverseOrder(AToRow);
      rov = this.GetRowOrder(ro);
      rotv = this.GetRowOrder(rot);
      this.SetRowOrder(ro,rotv);
      this.SetRowOrder(rot,rov);
    };
    this.UpdateFixedColumnCount = function () {
      pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCore.UpdateFixedColumnCount.call(this);
      if (this.FAdapter != null) this.FAdapter.Initialize();
    };
    this.UpdateFilterBuilderColumns = function () {
      var I = 0;
      var r = 0;
      var v = undefined;
      var f = $mod.TTMSFNCDataGridDataFormatting.$new();
      var fmt = pas.SysUtils.TFormatSettings.$new();
      var c = false;
      var cl = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var cdt = 0;
      var I64val = 0;
      var Ival = 0;
      var Dval = 0.0;
      var dt = 0.0;
      var vl = pas.RTTI.TValue.$new();
      if (this.GetIsDestroying()) return;
      this.GetFilterBuilder().FDataColumns.Clear();
      if (this.FAdapter != null) {
        var $tmp = this.FAdapter.FilterMode();
        if ($tmp === $mod.TTMSFNCDataGridDataAdapterFilterMode.afmNone) {
          return}
         else if ($tmp === $mod.TTMSFNCDataGridDataAdapterFilterMode.afmAdapter) {
          this.FAdapter.UpdateFilterBuilderColumns();
          return;
        };
      };
      for (var $l = 0, $end = this.FColumnCount - 1; $l <= $end; $l++) {
        I = $l;
        r = this.FFixedRowCount;
        while (!this.IsRowNormal(r) && (r < this.FRowCount)) r += 1;
        cl.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(I,r));
        v = this.GetCell(I,r);
        f.$assign($mod.DefaultFormatting());
        fmt.$assign(pas.SysUtils.FormatSettings);
        c = true;
        this.DoGetCellFormatting(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cl),v,f,fmt,{get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }});
        cdt = pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtAutomatic;
        if (c) {
          var $tmp1 = f.Type;
          if ($tmp1 === $mod.TTMSFNCDataGridDataFormattingType.gdftBoolean) {
            cdt = pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtBoolean}
           else if ($tmp1 === $mod.TTMSFNCDataGridDataFormattingType.gdftDateTime) {
            cdt = pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtDateTime}
           else if ($tmp1 === $mod.TTMSFNCDataGridDataFormattingType.gdftDate) {
            cdt = pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtDate}
           else if ($tmp1 === $mod.TTMSFNCDataGridDataFormattingType.gdftTime) {
            cdt = pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtTime}
           else if ($tmp1 === $mod.TTMSFNCDataGridDataFormattingType.gdftFloat) {
            cdt = pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtFloat}
           else if ($tmp1 === $mod.TTMSFNCDataGridDataFormattingType.gdftNumber) {
            cdt = pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtNumber}
           else if ($tmp1 === $mod.TTMSFNCDataGridDataFormattingType.gdftDefault) {
            if (this.$class.ValueIsBoolean(v)) {
              cdt = pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtBoolean}
             else if (this.$class.ValueIsInteger(v)) {
              cdt = pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtNumber}
             else if (this.$class.ValueIsFloat(v)) {
              cdt = pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtFloat}
             else if (this.$class.ValueIsString(v)) {
              vl.$assign($mod.CellValueToTValue(v));
              if (pas.SysUtils.TryStrToInt(vl.AsString(),{get: function () {
                  return Ival;
                }, set: function (v) {
                  Ival = v;
                }})) {
                cdt = pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtNumber}
               else if (pas.SysUtils.TryStrToInt64(vl.AsString(),{get: function () {
                  return I64val;
                }, set: function (v) {
                  I64val = v;
                }})) {
                cdt = pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtNumber}
               else if (pas.SysUtils.TryStrToFloat$3(vl.AsString(),{get: function () {
                  return Dval;
                }, set: function (v) {
                  Dval = v;
                }},fmt)) {
                cdt = pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtFloat}
               else if (pas.SysUtils.TryStrToDateTime(vl.AsString(),{get: function () {
                  return dt;
                }, set: function (v) {
                  dt = v;
                }})) {
                cdt = pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtDateTime}
               else if (pas.DateUtils.TryISO8601ToDate(vl.AsString(),{get: function () {
                  return dt;
                }, set: function (v) {
                  dt = v;
                }},true)) cdt = pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtDateTime;
            };
          };
        };
        this.GetFilterBuilder().FDataColumns.AddColumn(this.GetColumnDataName(I),cdt,this.GetColumnFilterName(I)).FDataInteger = I;
      };
    };
    this.Assign = function (Source) {
      var r = null;
      var ri = null;
      var k = 0;
      this.BeginUpdate();
      try {
        pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCore.Assign.apply(this,arguments);
        if ($mod.TTMSFNCDataGridData.isPrototypeOf(Source)) {
          this.FAdapter = rtl.as(Source,$mod.TTMSFNCDataGridData).FAdapter;
          pas.SysUtils.FreeAndNil({p: this, get: function () {
              return this.p.FDataDictionary;
            }, set: function (v) {
              this.p.FDataDictionary = v;
            }});
          var $in = rtl.as(Source,$mod.TTMSFNCDataGridData).GetDataDictionary().GetKeys().GetEnumerator$1();
          try {
            while ($in.MoveNext$1()) {
              k = $in.GetCurrent();
              r = rtl.as(Source,$mod.TTMSFNCDataGridData).GetDataDictionary().GetItem(k);
              if (r != null) {
                ri = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridRowItem.$create("Create");
                ri.Assign$1(r,this);
                this.GetDataDictionary().AddOrSetValue(k,ri);
              };
            }
          } finally {
            $in = rtl.freeLoc($in)
          };
          pas.SysUtils.FreeAndNil({p: this, get: function () {
              return this.p.FColumnCalculationDictionary;
            }, set: function (v) {
              this.p.FColumnCalculationDictionary = v;
            }});
          this.FColumnCalculationDictionary = $mod.TTMSFNCDataGridDataColumnCalculationDictionary.$create("Create$2",[rtl.as(Source,$mod.TTMSFNCDataGridData).GetColumnCalculationDictionary()]);
          pas.SysUtils.FreeAndNil({p: this, get: function () {
              return this.p.FRowCalculationDictionary;
            }, set: function (v) {
              this.p.FRowCalculationDictionary = v;
            }});
          this.FRowCalculationDictionary = $mod.TTMSFNCDataGridDataRowCalculationDictionary.$create("Create$2",[rtl.as(Source,$mod.TTMSFNCDataGridData).GetRowCalculationDictionary()]);
          this.GetFilter().Assign(rtl.as(Source,$mod.TTMSFNCDataGridData).GetFilter());
          this.FOptions.Assign(rtl.as(Source,$mod.TTMSFNCDataGridData).FOptions);
          pas.SysUtils.FreeAndNil({p: this, get: function () {
              return this.p.FSortIndexList;
            }, set: function (v) {
              this.p.FSortIndexList = v;
            }});
          this.FSortIndexList = $mod.TTMSFNCDataGridSortIndexList.$create("Create$6",[rtl.as(Source,$mod.TTMSFNCDataGridData).GetSortIndexList(),true]);
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.Create$1 = function (AHost) {
      pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCore.Create$1.call(this,AHost);
      this.FGroupInfo.$assign($mod.DefaultGroupInfo());
      this.FFindCache = "";
      this.FFindParameters = {};
      this.FFindCell.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(-1,-1));
      this.FOptions = this.GetOptionsClass().$create("Create$1");
      if ((AHost != null) && pas.Classes.TPersistent.isPrototypeOf(AHost)) {
        this.FFilterActions = this.GetFilterActionsClass().$create("Create$3",[rtl.as(AHost,pas.Classes.TPersistent)])}
       else this.FFilterActions = this.GetFilterActionsClass().$create("Create$3",[this]);
      this.FAutoFillCustomLists = pas["Generics.Collections"].TDictionary$$$G$$generics$collections$$String$$TArray$System$String$.$create("Create$1",[0]);
      this.FAutoFillCustomListIndex = pas["Generics.Collections"].TDictionary$$$G$$generics$collections$$String$$TTMSFNCDataGridDataCustomListIndexEntry.$create("Create$1",[0]);
      this.FAutoFillEnforceUniqueValues = true;
      return this;
    };
    this.Destroy = function () {
      this.FAdapter = null;
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FAutoFillCustomListIndex;
        }, set: function (v) {
          this.p.FAutoFillCustomListIndex = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FAutoFillCustomLists;
        }, set: function (v) {
          this.p.FAutoFillCustomLists = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FFilterActions;
        }, set: function (v) {
          this.p.FFilterActions = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FTempDataList;
        }, set: function (v) {
          this.p.FTempDataList = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FColumnCalculationDictionary;
        }, set: function (v) {
          this.p.FColumnCalculationDictionary = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FRowCalculationDictionary;
        }, set: function (v) {
          this.p.FRowCalculationDictionary = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FFilter;
        }, set: function (v) {
          this.p.FFilter = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FFilterBuilder;
        }, set: function (v) {
          this.p.FFilterBuilder = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FDataDictionary;
        }, set: function (v) {
          this.p.FDataDictionary = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FGroupDictionary;
        }, set: function (v) {
          this.p.FGroupDictionary = v;
        }});
      rtl.free(this,"FOptions");
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FSortIndexList;
        }, set: function (v) {
          this.p.FSortIndexList = v;
        }});
      pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCore.Destroy.call(this);
    };
    this.TypeOfValue = function (AValue) {
      var Result = 0;
      var v = pas.RTTI.TValue.$new();
      Result = pas.System.TTypeKind.tkUnknown;
      v.$assign($mod.CellValueToTValue(AValue));
      if (v.GetIsEmpty()) return Result;
      Result = v.GetTypeKind();
      return Result;
    };
    this.ValueIsBoolean = function (AValue) {
      var Result = false;
      Result = this.TypeOfValue(AValue) in rtl.createSet(pas.System.TTypeKind.tkEnumeration,pas.System.TTypeKind.tkBool);
      return Result;
    };
    this.ValueIsEmpty = function (AValue) {
      var Result = false;
      var v = pas.RTTI.TValue.$new();
      v.$assign($mod.CellValueToTValue(AValue));
      Result = v.GetIsEmpty();
      return Result;
    };
    this.ValueIsFloat = function (AValue) {
      var Result = false;
      Result = this.TypeOfValue(AValue) in rtl.createSet(pas.System.TTypeKind.tkDouble);
      return Result;
    };
    this.ValueIsDateTimeType = function (AValue) {
      var Result = false;
      var v = pas.RTTI.TValue.$new();
      Result = false;
      v.$assign($mod.CellValueToTValue(AValue));
      if (v.GetIsEmpty()) return Result;
      Result = this.ValueIsFloat(AValue);
      return Result;
    };
    this.ValueIsDateTime = function (AValue) {
      var Result = false;
      Result = this.ValueIsDateTime$1(AValue,pas.SysUtils.TFormatSettings.$clone(pas.SysUtils.FormatSettings));
      return Result;
    };
    this.ValueIsDateTime$1 = function (AValue, AFormatSettings) {
      var Result = false;
      var dt = 0.0;
      Result = this.ValueIsDateTimeType(AValue) || (this.ValueIsString(AValue) && pas.SysUtils.TryStrToDateTime$1(this.ValueToString(AValue),{get: function () {
          return dt;
        }, set: function (v) {
          dt = v;
        }},AFormatSettings));
      return Result;
    };
    this.ValueIsInteger = function (AValue) {
      var Result = false;
      Result = this.TypeOfValue(AValue) in rtl.createSet(pas.System.TTypeKind.tkInteger);
      return Result;
    };
    this.ValueIsString = function (AValue) {
      var Result = false;
      Result = this.TypeOfValue(AValue) in rtl.createSet(pas.System.TTypeKind.tkString);
      return Result;
    };
    this.ValueToBoolean = function (AValue) {
      var Result = false;
      Result = this.ValueToBoolean$1(AValue,pas.SysUtils.TFormatSettings.$clone(pas.SysUtils.FormatSettings));
      return Result;
    };
    this.ValueToBoolean$1 = function (AValue, AFormatSettings) {
      var Result = false;
      Result = this.ValueToInteger$1(AValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings)) !== 0;
      return Result;
    };
    this.ValueToDateTime = function (AValue) {
      var Result = 0.0;
      Result = this.ValueToDateTime$1(AValue,pas.SysUtils.TFormatSettings.$clone(pas.SysUtils.FormatSettings));
      return Result;
    };
    this.ValueToDateTime$1 = function (AValue, AFormatSettings) {
      var Result = 0.0;
      var I64 = 0;
      var I = 0;
      var D = 0.0;
      var v = pas.RTTI.TValue.$new();
      var B = false;
      var dt = 0.0;
      Result = 0.0;
      v.$assign($mod.CellValueToTValue(AValue));
      if (v.GetIsEmpty()) return Result;
      var $tmp = v.GetTypeKind();
      if ($tmp === pas.System.TTypeKind.tkEnumeration) {
        if (v.TryAsType$$$G$$rtti$$Boolean({get: function () {
            return B;
          }, set: function (v) {
            B = v;
          }},true)) Result = (B ? 1 : 0);
      } else if ($tmp === pas.System.TTypeKind.tkInteger) {
        if (v.TryAsType$$$G$$rtti$$Longint({get: function () {
            return I;
          }, set: function (v) {
            I = v;
          }},true)) Result = I;
      } else if ($tmp === pas.System.TTypeKind.tkDouble) {
        if (v.TryAsType$$$G$$rtti$$Double({get: function () {
            return D;
          }, set: function (v) {
            D = v;
          }},true)) Result = D;
      } else if ($tmp === pas.System.TTypeKind.tkBool) {
        if (v.TryAsType$$$G$$rtti$$Boolean({get: function () {
            return B;
          }, set: function (v) {
            B = v;
          }},true)) Result = (B ? 1 : 0);
      } else if ($tmp === pas.System.TTypeKind.tkString) {
        if (pas.SysUtils.TryStrToInt(v.AsString(),{get: function () {
            return I;
          }, set: function (v) {
            I = v;
          }})) {
          Result = I}
         else if (pas.SysUtils.TryStrToInt64(v.AsString(),{get: function () {
            return I64;
          }, set: function (v) {
            I64 = v;
          }})) {
          Result = I64}
         else if (pas.SysUtils.TryStrToFloat$3(v.AsString(),{get: function () {
            return D;
          }, set: function (v) {
            D = v;
          }},AFormatSettings)) {
          Result = D}
         else if (pas.SysUtils.TryStrToDateTime$1(v.AsString(),{get: function () {
            return dt;
          }, set: function (v) {
            dt = v;
          }},AFormatSettings)) {
          Result = dt}
         else if (pas.DateUtils.TryISO8601ToDate(v.AsString(),{get: function () {
            return dt;
          }, set: function (v) {
            dt = v;
          }},true)) {
          Result = dt}
         else if (pas.SysUtils.TryStrToBool(v.AsString(),{get: function () {
            return B;
          }, set: function (v) {
            B = v;
          }})) Result = (B ? 1 : 0);
      };
      return Result;
    };
    this.ValueToFloat = function (AValue) {
      var Result = 0.0;
      Result = this.ValueToFloat$1(AValue,pas.SysUtils.TFormatSettings.$clone(pas.SysUtils.FormatSettings));
      return Result;
    };
    this.ValueToFloat$1 = function (AValue, AFormatSettings) {
      var Result = 0.0;
      var I64 = 0;
      var I = 0;
      var D = 0.0;
      var v = pas.RTTI.TValue.$new();
      var B = false;
      Result = 0.0;
      v.$assign($mod.CellValueToTValue(AValue));
      if (v.GetIsEmpty()) return Result;
      var $tmp = v.GetTypeKind();
      if ($tmp === pas.System.TTypeKind.tkEnumeration) {
        if (v.TryAsType$$$G$$rtti$$Boolean({get: function () {
            return B;
          }, set: function (v) {
            B = v;
          }},true)) Result = (B ? 1 : 0);
      } else if ($tmp === pas.System.TTypeKind.tkInteger) {
        if (v.TryAsType$$$G$$rtti$$Longint({get: function () {
            return I;
          }, set: function (v) {
            I = v;
          }},true)) Result = I;
      } else if ($tmp === pas.System.TTypeKind.tkDouble) {
        if (v.TryAsType$$$G$$rtti$$Double({get: function () {
            return D;
          }, set: function (v) {
            D = v;
          }},true)) Result = D;
      } else if ($tmp === pas.System.TTypeKind.tkBool) {
        if (v.TryAsType$$$G$$rtti$$Boolean({get: function () {
            return B;
          }, set: function (v) {
            B = v;
          }},true)) Result = (B ? 1 : 0);
      } else if ($tmp === pas.System.TTypeKind.tkString) {
        if (pas.SysUtils.TryStrToInt(v.AsString(),{get: function () {
            return I;
          }, set: function (v) {
            I = v;
          }})) {
          Result = I}
         else if (pas.SysUtils.TryStrToInt64(v.AsString(),{get: function () {
            return I64;
          }, set: function (v) {
            I64 = v;
          }})) {
          Result = I64}
         else if (pas.SysUtils.TryStrToFloat$3(v.AsString(),{get: function () {
            return D;
          }, set: function (v) {
            D = v;
          }},AFormatSettings)) {
          Result = D}
         else if (pas.SysUtils.TryStrToBool(v.AsString(),{get: function () {
            return B;
          }, set: function (v) {
            B = v;
          }})) Result = (B ? 1 : 0);
      };
      return Result;
    };
    this.ValueToInt64 = function (AValue) {
      var Result = 0;
      Result = this.ValueToInt64$1(AValue,pas.SysUtils.TFormatSettings.$clone(pas.SysUtils.FormatSettings));
      return Result;
    };
    this.ValueToInt64$1 = function (AValue, AFormatSettings) {
      var Result = 0;
      var I64 = 0;
      var I = 0;
      var D = 0.0;
      var v = pas.RTTI.TValue.$new();
      var B = false;
      Result = 0;
      v.$assign($mod.CellValueToTValue(AValue));
      if (v.GetIsEmpty()) return Result;
      var $tmp = v.GetTypeKind();
      if ($tmp === pas.System.TTypeKind.tkEnumeration) {
        if (v.TryAsType$$$G$$rtti$$Boolean({get: function () {
            return B;
          }, set: function (v) {
            B = v;
          }},true)) Result = (B ? 1 : 0);
      } else if ($tmp === pas.System.TTypeKind.tkInteger) {
        if (v.TryAsType$$$G$$rtti$$Longint({get: function () {
            return I;
          }, set: function (v) {
            I = v;
          }},true)) Result = I;
      } else if ($tmp === pas.System.TTypeKind.tkDouble) {
        if (v.TryAsType$$$G$$rtti$$Double({get: function () {
            return D;
          }, set: function (v) {
            D = v;
          }},true)) Result = Math.round(D);
      } else if ($tmp === pas.System.TTypeKind.tkBool) {
        if (v.TryAsType$$$G$$rtti$$Boolean({get: function () {
            return B;
          }, set: function (v) {
            B = v;
          }},true)) Result = (B ? 1 : 0);
      } else if ($tmp === pas.System.TTypeKind.tkString) {
        if (pas.SysUtils.TryStrToInt(v.AsString(),{get: function () {
            return I;
          }, set: function (v) {
            I = v;
          }})) {
          Result = I}
         else if (pas.SysUtils.TryStrToInt64(v.AsString(),{get: function () {
            return I64;
          }, set: function (v) {
            I64 = v;
          }})) {
          Result = I64}
         else if (pas.SysUtils.TryStrToFloat$3(v.AsString(),{get: function () {
            return D;
          }, set: function (v) {
            D = v;
          }},AFormatSettings)) {
          Result = Math.round(D)}
         else if (pas.SysUtils.TryStrToBool(v.AsString(),{get: function () {
            return B;
          }, set: function (v) {
            B = v;
          }})) Result = (B ? 1 : 0);
      };
      return Result;
    };
    this.ValueToInteger = function (AValue) {
      var Result = 0;
      Result = this.ValueToInteger$1(AValue,pas.SysUtils.TFormatSettings.$clone(pas.SysUtils.FormatSettings));
      return Result;
    };
    this.ValueToInteger$1 = function (AValue, AFormatSettings) {
      var Result = 0;
      var v = 0;
      Result = 0;
      v = this.ValueToInt64$1(AValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings));
      if ((v <= 2147483647) && (v >= -2147483647)) Result = v;
      return Result;
    };
    this.ValueToString = function (AValue) {
      var Result = "";
      Result = this.ValueToString$1(AValue,pas.SysUtils.TFormatSettings.$clone(pas.SysUtils.FormatSettings));
      return Result;
    };
    this.ValueToString$1 = function (AValue, AFormatSettings) {
      var Result = "";
      var I64 = 0;
      var D = 0.0;
      var v = pas.RTTI.TValue.$new();
      var I = 0;
      var B = false;
      var l = null;
      Result = "";
      v.$assign($mod.CellValueToTValue(AValue));
      if (v.GetIsEmpty()) return Result;
      var $tmp = v.GetTypeKind();
      if ($tmp === pas.System.TTypeKind.tkEnumeration) {
        if (v.TryAsType$$$G$$rtti$$Boolean({get: function () {
            return B;
          }, set: function (v) {
            B = v;
          }},true)) Result = pas.SysUtils.BoolToStr(B,true);
      } else if ($tmp === pas.System.TTypeKind.tkInteger) {
        if (v.TryAsType$$$G$$rtti$$Longint({get: function () {
            return I;
          }, set: function (v) {
            I = v;
          }},true)) Result = pas.SysUtils.IntToStr(I);
      } else if ($tmp === pas.System.TTypeKind.tkDouble) {
        if (v.TryAsType$$$G$$rtti$$Double({get: function () {
            return D;
          }, set: function (v) {
            D = v;
          }},true)) {
          if (v.FTypeInfo.name === "TDateTime") {
            Result = pas.SysUtils.DateTimeToStr$1(D,AFormatSettings,false)}
           else if (v.FTypeInfo.name === "TDate") {
            Result = pas.SysUtils.DateToStr$1(D,AFormatSettings)}
           else if (v.FTypeInfo.name === "TTime") {
            Result = pas.SysUtils.TimeToStr$1(D,AFormatSettings)}
           else Result = pas.SysUtils.FloatToStr$1(D,AFormatSettings);
        };
      } else if ($tmp === pas.System.TTypeKind.tkBool) {
        if (v.TryAsType$$$G$$rtti$$Boolean({get: function () {
            return B;
          }, set: function (v) {
            B = v;
          }},true)) Result = pas.SysUtils.BoolToStr(B,true);
      } else if ($tmp === pas.System.TTypeKind.tkString) {
        Result = v.AsString()}
       else if ($tmp === pas.System.TTypeKind.tkClass) {
        if (v.TryAsType$$$G$$rtti$$TStrings({get: function () {
            return l;
          }, set: function (v) {
            l = v;
          }},true)) {
          Result = l.GetTextStr()}
         else Result = v.ToString();
      } else {
        Result = v.ToString();
      };
      return Result;
    };
    this.BaseCell = function (ACell) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var mi = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellMergeInfo.$new();
      Result.$assign(ACell);
      if (this.GetHasMergeInfo(ACell.GetColumn(),ACell.GetRow())) {
        mi.$assign(this.GetMergeInfo(ACell.GetColumn(),ACell.GetRow()));
        Result.SetColumn(ACell.GetColumn() - mi.ColumnOffset);
        Result.SetRow(ACell.GetRow() - mi.RowOffset);
      };
      return Result;
    };
    this.CanDeleteColumn = function (AColumn) {
      var Result = false;
      Result = !this.IsColumnMerged(AColumn) && this.IsColumnValid(AColumn);
      return Result;
    };
    this.CanDeleteRow = function (ARow) {
      var Result = false;
      Result = !this.IsRowMerged(ARow) && this.IsRowValid(ARow) && this.IsRowNormal(ARow);
      return Result;
    };
    this.CanInsertColumn = function (AColumn) {
      var Result = false;
      Result = !this.IsColumnMerged(AColumn) && this.IsColumnValid(AColumn);
      return Result;
    };
    this.CanInsertRow = function (ARow) {
      var Result = false;
      Result = !this.IsRowMerged(ARow) && this.IsRowValid(ARow);
      return Result;
    };
    this.CanMergeCells = function (AColumn, ARow, AColumnCount, ARowCount) {
      var Result = false;
      var c = 0;
      var r = 0;
      var t = 0;
      Result = true;
      t = this.GetCellMergeType(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow)));
      if (t === $mod.TTMSFNCDataGridDataCellMergeType.gcmtInvalid) {
        Result = false;
        return Result;
      };
      for (var $l = AColumn, $end = (AColumn + AColumnCount) - 1; $l <= $end; $l++) {
        c = $l;
        for (var $l1 = ARow, $end1 = (ARow + ARowCount) - 1; $l1 <= $end1; $l1++) {
          r = $l1;
          if (!this.IsCellValid$1(c,r) || (t !== this.GetCellMergeType(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r))))) {
            Result = false;
            return Result;
          };
        };
      };
      return Result;
    };
    this.CanMoveColumn = function (AFromColumn, AToColumn) {
      var Result = false;
      Result = !this.IsColumnMerged(AFromColumn) && !this.IsColumnMerged(AToColumn) && (AFromColumn !== AToColumn) && this.IsColumnValid(AFromColumn) && this.IsColumnValid(AToColumn);
      return Result;
    };
    this.CanMoveRow = function (AFromRow, AToRow) {
      var Result = false;
      Result = !this.IsRowMerged(AFromRow) && !this.IsRowMerged(AToRow) && (AFromRow !== AToRow) && this.IsRowValid(AFromRow) && this.IsRowValid(AToRow) && this.IsRowNormal(AFromRow) && this.IsRowNormal(AToRow);
      return Result;
    };
    this.CanSwapColumn = function (AFromColumn, AToColumn) {
      var Result = false;
      Result = !this.IsColumnMerged(AFromColumn) && !this.IsColumnMerged(AToColumn) && (AFromColumn !== AToColumn) && this.IsColumnValid(AFromColumn) && this.IsColumnValid(AToColumn);
      return Result;
    };
    this.CanSwapRow = function (AFromRow, AToRow) {
      var Result = false;
      Result = !this.IsRowMerged(AFromRow) && !this.IsRowMerged(AToRow) && (AFromRow !== AToRow) && this.IsRowValid(AFromRow) && this.IsRowValid(AToRow) && this.IsRowNormal(AFromRow) && this.IsRowNormal(AToRow);
      return Result;
    };
    this.ColumnAverage = function (AColumn, AFromRow, AToRow) {
      var Result = 0.0;
      var c = 0.0;
      if ((AFromRow === -1) || (AToRow === -1)) {
        AFromRow = this.FFixedRowCount;
        AToRow = this.FRowCount - 1 - this.FFixedBottomRowCount;
      };
      c = this.ColumnCounting(AColumn,AFromRow,AToRow);
      if (c > 0) {
        Result = this.ColumnSum(AColumn,AFromRow,AToRow) / c}
       else Result = 0;
      return Result;
    };
    this.ColumnCounting = function (AColumn, AFromRow, AToRow) {
      var Result = 0.0;
      var i = 0;
      Result = 0;
      if ((AFromRow === -1) || (AToRow === -1)) {
        AFromRow = this.FFixedRowCount;
        AToRow = this.FRowCount - 1 - this.FFixedBottomRowCount;
      };
      for (var $l = AFromRow, $end = AToRow; $l <= $end; $l++) {
        i = $l;
        if (this.IsCellBase(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,i))) && (this.GetRowType(i) === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowType.grtDefault) && ((!this.FOptions.FCalculations.FIncludeHiddenRows && !this.IsRowHidden(i)) || this.FOptions.FCalculations.FIncludeHiddenRows)) Result = Result + 1;
      };
      return Result;
    };
    this.ColumnCustomCalculation = function (AColumn, ACustomCalculationCallback, AFromRow, AToRow) {
      var Result = 0.0;
      Result = this.InternalColumnCustomCalculation(AColumn,0,ACustomCalculationCallback,AFromRow,AToRow);
      return Result;
    };
    this.ColumnDistinct = function (AColumn, AFromRow, AToRow) {
      var Result = 0.0;
      var sl = null;
      var i = 0;
      if ((AFromRow === -1) || (AToRow === -1)) {
        AFromRow = this.FFixedRowCount;
        AToRow = this.FRowCount - 1 - this.FFixedBottomRowCount;
      };
      sl = pas.Classes.TStringList.$create("Create$1");
      try {
        sl.FDuplicates = pas.Types.TDuplicates.dupIgnore;
        sl.SetSorted(true);
        sl.SetCaseSensitive(false);
        for (var $l = AFromRow, $end = AToRow; $l <= $end; $l++) {
          i = $l;
          if (this.IsCellBase(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,i))) && (this.GetRowType(i) === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowType.grtDefault) && ((!this.FOptions.FCalculations.FIncludeHiddenRows && !this.IsRowHidden(i)) || this.FOptions.FCalculations.FIncludeHiddenRows)) sl.Add(this.GetString(AColumn,i));
        };
        Result = sl.GetCount();
      } finally {
        sl = rtl.freeLoc(sl);
      };
      return Result;
    };
    this.ColumnMax = function (AColumn, AFromRow, AToRow) {
      var Result = 0.0;
      var m = 0.0;
      var f = 0.0;
      var i = 0;
      if ((AFromRow === -1) || (AToRow === -1)) {
        AFromRow = this.FFixedRowCount;
        AToRow = this.FRowCount - 1 - this.FFixedBottomRowCount;
      };
      m = this.GetFloat(AColumn,AFromRow);
      for (var $l = AFromRow, $end = AToRow; $l <= $end; $l++) {
        i = $l;
        if (this.IsCellBase(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,i))) && (this.GetRowType(i) === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowType.grtDefault) && ((!this.FOptions.FCalculations.FIncludeHiddenRows && !this.IsRowHidden(i)) || this.FOptions.FCalculations.FIncludeHiddenRows)) {
          try {
            f = this.GetFloat(AColumn,i);
            if (m < f) m = f;
          } catch ($e) {
          };
        };
      };
      Result = m;
      return Result;
    };
    this.ColumnMin = function (AColumn, AFromRow, AToRow) {
      var Result = 0.0;
      var m = 0.0;
      var f = 0.0;
      var i = 0;
      if ((AFromRow === -1) || (AToRow === -1)) {
        AFromRow = this.FFixedRowCount;
        AToRow = this.FRowCount - 1 - this.FFixedBottomRowCount;
      };
      m = this.GetFloat(AColumn,AFromRow);
      for (var $l = AFromRow, $end = AToRow; $l <= $end; $l++) {
        i = $l;
        if (this.IsCellBase(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,i))) && (this.GetRowType(i) === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowType.grtDefault) && ((!this.FOptions.FCalculations.FIncludeHiddenRows && !this.IsRowHidden(i)) || this.FOptions.FCalculations.FIncludeHiddenRows)) {
          try {
            f = this.GetFloat(AColumn,i);
            if (m > f) m = f;
          } catch ($e) {
          };
        };
      };
      Result = m;
      return Result;
    };
    this.ColumnSpan = function (ACell) {
      var Result = 0;
      Result = 0;
      if (this.GetHasMergeInfo(ACell.GetColumn(),ACell.GetRow())) Result = this.GetMergeInfo(ACell.GetColumn(),ACell.GetRow()).ColumnSpan;
      return Result;
    };
    this.ColumnStandardDeviation = function (AColumn, AFromRow, AToRow) {
      var Result = 0.0;
      var m = 0.0;
      var d = 0.0;
      var i = 0;
      var rr = 0;
      if ((AFromRow === -1) || (AToRow === -1)) {
        AFromRow = this.FFixedRowCount;
        AToRow = this.FRowCount - 1 - this.FFixedBottomRowCount;
      };
      m = this.ColumnAverage(AColumn,AFromRow,AToRow);
      d = 0;
      rr = 0;
      for (var $l = AFromRow, $end = AToRow; $l <= $end; $l++) {
        i = $l;
        if (this.IsCellBase(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,i))) && (this.GetRowType(i) === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowType.grtDefault) && ((!this.FOptions.FCalculations.FIncludeHiddenRows && !this.IsRowHidden(i)) || this.FOptions.FCalculations.FIncludeHiddenRows)) {
          d = d + pas.System.Sqr$1(this.GetFloat(AColumn,i) - m);
          rr += 1;
        };
      };
      Result = Math.sqrt(d / (rr + 1));
      return Result;
    };
    this.ColumnSum = function (AColumn, AFromRow, AToRow) {
      var Result = 0.0;
      var i = 0;
      var sum = 0.0;
      if ((AFromRow === -1) || (AToRow === -1)) {
        AFromRow = this.FFixedRowCount;
        AToRow = this.FRowCount - 1 - this.FFixedBottomRowCount;
      };
      sum = 0;
      for (var $l = AFromRow, $end = AToRow; $l <= $end; $l++) {
        i = $l;
        if (this.IsCellBase(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,i))) && (this.GetRowType(i) === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowType.grtDefault) && ((!this.FOptions.FCalculations.FIncludeHiddenRows && !this.IsRowHidden(i)) || this.FOptions.FCalculations.FIncludeHiddenRows)) {
          try {
            sum = sum + this.GetFloat(AColumn,i);
          } catch ($e) {
          };
        };
      };
      Result = sum;
      return Result;
    };
    this.Find = function (AText) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      Result.$assign(this.Find$1(AText,{}));
      return Result;
    };
    this.Find$1 = function (AText, AParameters) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      Result.$assign(this.Find$2(AText,rtl.refSet(AParameters),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(-1,-1))));
      return Result;
    };
    this.Find$2 = function (AText, AParameters, AStartCell) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      Result.$assign(this.InternalFind(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(AStartCell),AText,rtl.refSet(AParameters)));
      return Result;
    };
    this.FindAll = function (AText, AParameters, AResults) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var StartCell = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var pt = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      StartCell.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(-1,-1));
      AResults.set(0);
      Result.$assign(this.InternalFind(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(StartCell),AText,rtl.refSet(AParameters)));
      if ($mod.TTMSFNCDataGridDataFindParameter.gfnAutoGoto in this.FFindParameters) this.FFindParameters = rtl.diffSet(this.FFindParameters,rtl.createSet($mod.TTMSFNCDataGridDataFindParameter.gfnAutoGoto));
      if ((Result.GetColumn() !== -1) && (Result.GetRow() !== -1)) {
        AResults.set(AResults.get() + 1);
        do {
          pt.$assign(this.FindNext$1());
          if ((pt.GetColumn() !== -1) && (pt.GetRow() !== -1)) AResults.set(AResults.get() + 1);
        } while (!(pt.GetColumn() === -1));
      };
      return Result;
    };
    this.FindFirst = function (AText, AParameters) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      this.FFindCell.$assign(this.Find$2(AText,rtl.refSet(AParameters),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(-1,-1))));
      Result.$assign(this.FFindCell);
      return Result;
    };
    this.FindNext = function (ADown) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      if (ADown) {
        this.FFindParameters = rtl.diffSet(this.FFindParameters,rtl.createSet($mod.TTMSFNCDataGridDataFindParameter.gfnBackward))}
       else this.FFindParameters = rtl.unionSet(this.FFindParameters,rtl.createSet($mod.TTMSFNCDataGridDataFindParameter.gfnBackward));
      Result.$assign(this.FindNext$1());
      return Result;
    };
    this.FindNext$1 = function () {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      this.FFindCell.$assign(this.Find$2(this.FFindCache,rtl.refSet(this.FFindParameters),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FFindCell)));
      Result.$assign(this.FFindCell);
      return Result;
    };
    this.GetCellKind = function (ACell) {
      var Result = 0;
      Result = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckCell;
      if (this.IsCellFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell)) || this.IsCellFreeze(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell))) {
        if (this.IsCellFixedRoot(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell))) {
          Result = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFixedRootCell}
         else if (this.IsCellFreezeRoot(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell))) {
          Result = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFreezeRootCell}
         else if ((ACell.GetRow() >= this.FFixedRowCount) && ((ACell.GetColumn() < this.FFixedColumnCount) || (ACell.GetColumn() >= (this.FColumnCount - this.FFixedRightColumnCount)))) {
          if (this.IsCellFreezeFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell))) {
            Result = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFreezeFixedColumnCell}
           else Result = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFixedColumnCell;
        } else if ((ACell.GetColumn() >= this.FFixedColumnCount) && ((ACell.GetRow() < this.FFixedRowCount) || (ACell.GetRow() >= (this.FRowCount - this.FFixedBottomRowCount)))) {
          if (this.IsCellFreezeFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell))) {
            Result = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFreezeFixedRowCell}
           else Result = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFixedRowCell;
        } else if ((ACell.GetRow() >= this.FFixedRowCount) && (ACell.GetRow() < (this.FRowCount - this.FFixedBottomRowCount)) && (ACell.GetColumn() >= this.FFixedColumnCount) && (ACell.GetColumn() < (this.FFixedColumnCount + this.FFreezeColumnCount))) {
          Result = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFreezeColumnCell}
         else if ((ACell.GetColumn() >= this.FFixedColumnCount) && (ACell.GetColumn() < (this.FColumnCount - this.FFixedRightColumnCount)) && (ACell.GetRow() >= this.FFixedRowCount) && (ACell.GetRow() < (this.FFixedRowCount + this.FFreezeRowCount))) Result = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFreezeRowCell;
      };
      return Result;
    };
    this.GetCellMergeType = function (ACell) {
      var Result = 0;
      Result = $mod.TTMSFNCDataGridDataCellMergeType.gcmtInvalid;
      if (this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell))) {
        if (this.IsCellFreezeFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell)) || this.IsCellFixedRoot(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell))) {
          Result = $mod.TTMSFNCDataGridDataCellMergeType.gcmtFixedRoot}
         else if (this.IsCellFreezeRoot(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell))) {
          Result = $mod.TTMSFNCDataGridDataCellMergeType.gcmtFreezeRoot}
         else if (this.IsCellFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell))) {
          Result = $mod.TTMSFNCDataGridDataCellMergeType.gcmtFixed}
         else Result = $mod.TTMSFNCDataGridDataCellMergeType.gcmtNormal;
      };
      return Result;
    };
    this.GetCellSize = function (ACell) {
      var Result = pas["WEBLib.TMSFNCTypes"].TSizeF.$new();
      var c = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var cs = 0;
      var rs = 0;
      var k = 0;
      var totalw = 0.0;
      var totalh = 0.0;
      c.$assign(this.BaseCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell)));
      cs = this.ColumnSpan(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c));
      rs = this.RowSpan(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c));
      totalw = 0;
      if (cs > 0) {
        for (var $l = c.GetColumn(), $end = (c.GetColumn() + cs) - 1; $l <= $end; $l++) {
          k = $l;
          totalw = totalw + this.GetColumnWidth(k);
        };
      } else totalw = this.GetColumnWidth(c.GetColumn());
      totalh = 0;
      if (rs > 0) {
        for (var $l1 = c.GetRow(), $end1 = (c.GetRow() + rs) - 1; $l1 <= $end1; $l1++) {
          k = $l1;
          totalh = totalh + this.GetRowHeight(k);
        };
      } else totalh = this.GetRowHeight(c.GetRow());
      Result.cx = totalw;
      Result.cy = totalh;
      return Result;
    };
    this.GetMaxLevel = function () {
      var Result = 0;
      var K = 0;
      Result = 0;
      var $in = this.GetDataDictionary().GetKeys().GetEnumerator$1();
      try {
        while ($in.MoveNext$1()) {
          K = $in.GetCurrent();
          if (this.GetDataDictionary().GetItem(K) != null) Result = Math.max(Result,this.GetDataDictionary().GetItem(K).FNodeLevel);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      return Result;
    };
    this.GetParentRow = function (ARow) {
      var Result = 0;
      var R = 0;
      var lvl = 0;
      Result = -1;
      if (!this.IsRowValid(ARow)) return Result;
      lvl = this.GetRowNodeLevel(ARow);
      for (var $l = ARow - 1, $end = this.FFixedRowCount; $l >= $end; $l--) {
        R = $l;
        if (this.IsRowNode(R) && ((this.GetRowNodeLevel(R) + 1) === lvl)) {
          Result = R;
          return Result;
        };
      };
      return Result;
    };
    this.GetRootRow = function (ARow) {
      var Result = 0;
      var R = 0;
      Result = -1;
      if (!this.IsRowValid(ARow)) return Result;
      for (var $l = ARow - 1, $end = this.FFixedRowCount; $l >= $end; $l--) {
        R = $l;
        if (this.IsRowNode(R) && (this.GetRowNodeLevel(R) === 0)) {
          Result = R;
          return Result;
        };
      };
      return Result;
    };
    this.HasRowData = function (ARow) {
      var Result = false;
      var r = null;
      Result = false;
      if (this.IsRowValid(ARow)) {
        if (this.GetDataDictionary().TryGetValue(ARow,{get: function () {
            return r;
          }, set: function (v) {
            r = v;
          }})) Result = r != null;
      };
      return Result;
    };
    this.IsCellBase = function (ACell) {
      var Result = false;
      var c = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      c.$assign(this.BaseCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell)));
      Result = (c.GetColumn() === ACell.GetColumn()) && (c.GetRow() === ACell.GetRow());
      return Result;
    };
    this.IsCellDisplayed = function (ACell) {
      var Result = false;
      var c = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var cs = 0;
      var rs = 0;
      var k = 0;
      var ch = false;
      var rh = false;
      c.$assign(this.BaseCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell)));
      cs = this.ColumnSpan(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c));
      rs = this.RowSpan(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c));
      ch = !this.IsColumnHidden(c.GetColumn());
      if ((cs > 0) && !ch) {
        for (var $l = c.GetColumn() + 1, $end = (c.GetColumn() + cs) - 1; $l <= $end; $l++) {
          k = $l;
          if (!this.IsColumnHidden(k)) {
            ch = true;
            break;
          };
        };
      };
      rh = !this.IsRowHidden(c.GetRow());
      if ((rs > 0) && !rh) {
        for (var $l1 = c.GetRow() + 1, $end1 = (c.GetRow() + rs) - 1; $l1 <= $end1; $l1++) {
          k = $l1;
          if (!this.IsRowHidden(k)) {
            rh = true;
            break;
          };
        };
      };
      Result = ch && rh;
      return Result;
    };
    this.IsCellHidden = function (ACell) {
      var Result = false;
      Result = !this.IsCellDisplayed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
      return Result;
    };
    this.IsCellMerged = function (ACell) {
      var Result = false;
      var c = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      c.$assign(this.BaseCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell)));
      Result = this.GetHasMergeInfo(c.GetColumn(),c.GetRow());
      return Result;
    };
    this.IsColumnDisplayed = function (AColumn) {
      var Result = false;
      Result = !this.IsColumnHidden(AColumn);
      return Result;
    };
    this.IsGrouped = function () {
      var Result = false;
      Result = this.GetGroupDictionary().GetCount() > 0;
      return Result;
    };
    this.IsRowDisplayed = function (ARow) {
      var Result = false;
      Result = !this.IsRowHidden(ARow);
      return Result;
    };
    this.IsRowFilteredDisplay = function (ARow) {
      var Result = false;
      Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCore.IsRowFilteredDisplay.call(this,ARow);
      Result = Result && ($mod.TTMSFNCDataGridDataFilteringAction.gdfaHideRow in this.FOptions.FFiltering.FActions);
      return Result;
    };
    this.IsRowFilter = function (ARow) {
      var Result = false;
      Result = false;
      if (this.HasRowData(ARow)) Result = this.GetRowData(ARow).FType === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowType.grtFilter;
      return Result;
    };
    this.IsRowNode = function (ARow) {
      var Result = false;
      Result = false;
      if (this.HasRowData(ARow)) Result = this.GetRowData(ARow).FType === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowType.grtNode;
      return Result;
    };
    this.IsRowNormal = function (ARow) {
      var Result = false;
      Result = true;
      if (this.HasRowData(ARow)) Result = this.GetRowData(ARow).FType === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowType.grtDefault;
      return Result;
    };
    this.IsRowSummary = function (ARow) {
      var Result = false;
      Result = false;
      if (this.HasRowData(ARow)) Result = this.GetRowData(ARow).FType === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowType.grtSummary;
      return Result;
    };
    this.MatchFilter = function (ARow) {
      var Result = false;
      var i = 0;
      var vp = 0;
      var s = "";
      var su = "";
      var cond = "";
      var temp = false;
      var APrefix = "";
      var ASuffix = "";
      var prfx = "";
      var f = null;
      var c = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var fbc = null;
      var cl = 0;
      var a = [];
      Result = true;
      if (this.FOptions.FFiltering.FAdvanced) {
        if (!this.GetFilterBuilder().GetIsEmpty()) {
          a = rtl.arraySetLength(a,undefined,this.GetFilterBuilder().FDataColumns.FLength);
          for (var $l = 0, $end = this.GetFilterBuilder().FDataColumns.FLength - 1; $l <= $end; $l++) {
            i = $l;
            fbc = this.FFilterBuilder.FDataColumns.GetItem(i);
            cl = fbc.FDataInteger;
            a[i] = this.GetCell(cl,ARow);
          };
          Result = this.GetFilterBuilder().ValidateFilterRow(rtl.arrayRef(a));
        };
      } else {
        for (var $l1 = 1, $end1 = this.FFilter.GetCount(); $l1 <= $end1; $l1++) {
          i = $l1;
          f = this.FFilter.GetItem$1(i - 1);
          if (f.FEnabled) {
            prfx = "";
            APrefix = f.FPrefix;
            ASuffix = f.FSuffix;
            c.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(f.FColumn,ARow));
            c.$assign(this.BaseCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c)));
            var $tmp = this.FFilter.GetItem$1(i - 1).FData;
            if ($tmp === $mod.TTMSFNCDataGridDataFilterCells.gfcNormal) {
              s = this.GetString(c.GetColumn(),c.GetRow())}
             else if ($tmp === $mod.TTMSFNCDataGridDataFilterCells.gfcStripHTML) {
              s = this.GetStrippedCell(c.GetColumn(),c.GetRow());
              s = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.UnFixMarkup(s,true,false);
            } else if ($tmp === $mod.TTMSFNCDataGridDataFilterCells.gfcRow) s = this.GetRowText(ARow);
            s = pas.SysUtils.Trim(s);
            cond = f.GetFilterCondition();
            if (f.FData === $mod.TTMSFNCDataGridDataFilterCells.gfcRow) {
              temp = pas.System.Pos(pas.SysUtils.UpperCase(cond),pas.SysUtils.UpperCase(s)) > 0}
             else {
              if (APrefix !== "") if (pas.System.Pos(APrefix,s) === 1) pas.System.Delete({get: function () {
                  return s;
                }, set: function (v) {
                  s = v;
                }},1,f.FPrefix.length);
              if (ASuffix !== "") if (pas.System.Pos(ASuffix,s) === ((1 + s.length) - ASuffix.length)) pas.System.Delete({get: function () {
                  return s;
                }, set: function (v) {
                  s = v;
                }},(1 + s.length) - ASuffix.length,s.length);
              temp = true;
              try {
                var $tmp1 = f.FMethod;
                if ($tmp1 === $mod.TTMSFNCDataGridDataFilterMethod.gfmExpression) {
                  temp = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MatchStrEx(cond,s,f.FCaseSensitive)}
                 else if ($tmp1 === $mod.TTMSFNCDataGridDataFilterMethod.gfmLiteral) {
                  if (pas.System.Pos("|",cond) > 0) {
                    temp = false;
                    while (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos("|",cond,{get: function () {
                        return vp;
                      }, set: function (v) {
                        vp = v;
                      }}) > 0) {
                      su = pas.System.Copy(cond,1,vp - 1);
                      temp = temp || (su === s);
                      pas.System.Delete({get: function () {
                          return cond;
                        }, set: function (v) {
                          cond = v;
                        }},1,vp);
                      su = cond;
                    };
                    temp = temp || (su === s);
                  } else if (cond === '""') {
                    temp = s === ""}
                   else temp = cond === s;
                };
              } catch ($e) {
                temp = false;
              };
            };
            var $tmp2 = this.FFilter.GetItem$1(i - 1).FOperation;
            if ($tmp2 === $mod.TTMSFNCDataGridDataFilterOperation.gfoSHORT) {
              Result = temp;
              if (!Result) break;
            } else if ($tmp2 === $mod.TTMSFNCDataGridDataFilterOperation.gfoNONE) {
              Result = temp}
             else if ($tmp2 === $mod.TTMSFNCDataGridDataFilterOperation.gfoAND) {
              Result = Result && temp}
             else if ($tmp2 === $mod.TTMSFNCDataGridDataFilterOperation.gfoOR) {
              Result = Result || temp}
             else if ($tmp2 === $mod.TTMSFNCDataGridDataFilterOperation.gfoXOR) Result = Result ^ temp;
          };
        };
      };
      return Result;
    };
    this.Replace = function (AOriginalValue, ANewValue) {
      var Result = 0;
      Result = this.Replace$1(AOriginalValue,ANewValue,{});
      return Result;
    };
    this.Replace$1 = function (AOriginalValue, ANewValue, AParameters) {
      var Result = 0;
      var fs = false;
      var c = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var prc = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var ov = "";
      var nv = "";
      var nr = 0;
      var p = {};
      fs = true;
      c.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(-1,-1));
      nr = 0;
      this.BeginUpdate();
      try {
        while (fs || ((c.GetColumn() !== -1) && (c.GetRow() !== -1))) {
          p = rtl.refSet(AParameters);
          p = rtl.diffSet(p,rtl.createSet($mod.TTMSFNCDataGridDataFindParameter.gfnAutoGoto));
          prc.$assign(c);
          c.$assign(this.Find$2(AOriginalValue,rtl.refSet(p),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c)));
          if ((c.GetColumn() !== -1) && (c.GetRow() !== -1)) {
            ov = this.GetString(c.GetColumn(),c.GetRow());
            nv = pas.SysUtils.StringReplace(ov,AOriginalValue,ANewValue,rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll,pas.SysUtils.TStringReplaceFlag.rfIgnoreCase));
            this.SetCell(c.GetColumn(),c.GetRow(),nv);
            nr += 1;
          };
          fs = false;
        };
        if ($mod.TTMSFNCDataGridDataFindParameter.gfnAutoGoto in AParameters) this.GoToCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(prc),true);
        Result = nr;
      } finally {
        this.EndUpdate();
      };
      return Result;
    };
    this.RowAverage = function (ARow, AFromColumn, AToColumn) {
      var Result = 0.0;
      var c = 0.0;
      if ((AFromColumn === -1) || (AToColumn === -1)) {
        AFromColumn = this.FFixedColumnCount;
        AToColumn = this.FColumnCount - 1 - this.FFixedRightColumnCount;
      };
      c = this.RowCounting(ARow,AFromColumn,AToColumn);
      if (c > 0) {
        Result = this.RowSum(ARow,AFromColumn,AToColumn) / c}
       else Result = 0;
      return Result;
    };
    this.RowCounting = function (ARow, AFromColumn, AToColumn) {
      var Result = 0.0;
      var i = 0;
      Result = 0;
      if ((AFromColumn === -1) || (AToColumn === -1)) {
        AFromColumn = this.FFixedColumnCount;
        AToColumn = this.FColumnCount - 1 - this.FFixedRightColumnCount;
      };
      for (var $l = AFromColumn, $end = AToColumn; $l <= $end; $l++) {
        i = $l;
        if (this.IsCellBase(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(i,ARow))) && ((!this.FOptions.FCalculations.FIncludeHiddenColumns && !this.IsColumnHidden(i)) || this.FOptions.FCalculations.FIncludeHiddenColumns)) Result = Result + 1;
      };
      return Result;
    };
    this.RowCustomCalculation = function (ARow, ACustomCalculationCallback, AFromColumn, AToColumn) {
      var Result = 0.0;
      if ((AFromColumn === -1) || (AToColumn === -1)) {
        AFromColumn = this.FFixedColumnCount;
        AToColumn = this.FColumnCount - 1 - this.FFixedRightColumnCount;
      };
      if (ACustomCalculationCallback != null) {
        Result = ACustomCalculationCallback(ARow,AFromColumn,AToColumn)}
       else Result = this.DoCustomRowCalculation(ARow,AFromColumn,AToColumn);
      return Result;
    };
    this.RowDistinct = function (ARow, AFromColumn, AToColumn) {
      var Result = 0.0;
      var sl = null;
      var i = 0;
      if ((AFromColumn === -1) || (AToColumn === -1)) {
        AFromColumn = this.FFixedColumnCount;
        AToColumn = this.FColumnCount - 1 - this.FFixedRightColumnCount;
      };
      sl = pas.Classes.TStringList.$create("Create$1");
      try {
        sl.FDuplicates = pas.Types.TDuplicates.dupIgnore;
        sl.SetSorted(true);
        sl.SetCaseSensitive(false);
        for (var $l = AFromColumn, $end = AToColumn; $l <= $end; $l++) {
          i = $l;
          if (this.IsCellBase(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(i,ARow))) && ((!this.FOptions.FCalculations.FIncludeHiddenColumns && !this.IsColumnHidden(i)) || this.FOptions.FCalculations.FIncludeHiddenColumns)) sl.Add(this.GetString(i,ARow));
        };
        Result = sl.GetCount();
      } finally {
        sl = rtl.freeLoc(sl);
      };
      return Result;
    };
    this.RowMax = function (ARow, AFromColumn, AToColumn) {
      var Result = 0.0;
      var m = 0.0;
      var f = 0.0;
      var i = 0;
      if ((AFromColumn === -1) || (AToColumn === -1)) {
        AFromColumn = this.FFixedColumnCount;
        AToColumn = this.FColumnCount - 1 - this.FFixedRightColumnCount;
      };
      m = this.GetFloat(AFromColumn,ARow);
      for (var $l = AFromColumn, $end = AToColumn; $l <= $end; $l++) {
        i = $l;
        if (this.IsCellBase(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(i,ARow))) && ((!this.FOptions.FCalculations.FIncludeHiddenColumns && !this.IsColumnHidden(i)) || this.FOptions.FCalculations.FIncludeHiddenColumns)) {
          try {
            f = this.GetFloat(i,ARow);
            if (m < f) m = f;
          } catch ($e) {
          };
        };
      };
      Result = m;
      return Result;
    };
    this.RowMin = function (ARow, AFromColumn, AToColumn) {
      var Result = 0.0;
      var m = 0.0;
      var f = 0.0;
      var i = 0;
      if ((AFromColumn === -1) || (AToColumn === -1)) {
        AFromColumn = this.FFixedColumnCount;
        AToColumn = this.FColumnCount - 1 - this.FFixedRightColumnCount;
      };
      m = this.GetFloat(AFromColumn,ARow);
      for (var $l = AFromColumn, $end = AToColumn; $l <= $end; $l++) {
        i = $l;
        if (this.IsCellBase(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(i,ARow))) && ((!this.FOptions.FCalculations.FIncludeHiddenColumns && !this.IsColumnHidden(i)) || this.FOptions.FCalculations.FIncludeHiddenColumns)) {
          try {
            f = this.GetFloat(i,ARow);
            if (m > f) m = f;
          } catch ($e) {
          };
        };
      };
      Result = m;
      return Result;
    };
    this.RowSpan = function (ACell) {
      var Result = 0;
      Result = 0;
      if (this.GetHasMergeInfo(ACell.GetColumn(),ACell.GetRow())) Result = this.GetMergeInfo(ACell.GetColumn(),ACell.GetRow()).RowSpan;
      return Result;
    };
    this.RowStandardDeviation = function (ARow, AFromColumn, AToColumn) {
      var Result = 0.0;
      var m = 0.0;
      var d = 0.0;
      var i = 0;
      var rr = 0;
      if ((AFromColumn === -1) || (AToColumn === -1)) {
        AFromColumn = this.FFixedColumnCount;
        AToColumn = this.FColumnCount - 1 - this.FFixedRightColumnCount;
      };
      m = this.RowAverage(ARow,AFromColumn,AToColumn);
      d = 0;
      rr = 0;
      for (var $l = AFromColumn, $end = AToColumn; $l <= $end; $l++) {
        i = $l;
        if (this.IsCellBase(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(i,ARow))) && ((!this.FOptions.FCalculations.FIncludeHiddenColumns && !this.IsColumnHidden(i)) || this.FOptions.FCalculations.FIncludeHiddenColumns)) {
          d = d + pas.System.Sqr$1(this.GetFloat(i,ARow) - m);
          rr += 1;
        };
      };
      Result = Math.sqrt(d / (rr + 1));
      return Result;
    };
    this.RowSum = function (ARow, AFromColumn, AToColumn) {
      var Result = 0.0;
      var i = 0;
      var sum = 0.0;
      if ((AFromColumn === -1) || (AToColumn === -1)) {
        AFromColumn = this.FFixedColumnCount;
        AToColumn = this.FColumnCount - 1 - this.FFixedRightColumnCount;
      };
      sum = 0;
      for (var $l = AFromColumn, $end = AToColumn; $l <= $end; $l++) {
        i = $l;
        if (this.IsCellBase(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(i,ARow))) && ((!this.FOptions.FCalculations.FIncludeHiddenColumns && !this.IsColumnHidden(i)) || this.FOptions.FCalculations.FIncludeHiddenColumns)) {
          try {
            sum = sum + this.GetFloat(i,ARow);
          } catch ($e) {
          };
        };
      };
      Result = sum;
      return Result;
    };
    this.AutoFillCustomListsClear = function () {
      this.FAutoFillCustomLists.Clear();
      this.FAutoFillCustomListIndex.Clear();
    };
    this.AutoFillCustomListRemove = function (AKey) {
      if (this.FAutoFillCustomLists.ContainsKey(AKey)) {
        this.FAutoFillCustomLists.Remove(AKey);
        this.RemoveCustomListIndexForKey(AKey);
      };
    };
    this.AutoFillCustomListSet = function (AKey, AValues) {
      var L = [];
      var i = 0;
      L = rtl.arraySetLength(L,"",rtl.length(AValues));
      for (var $l = 0, $end = rtl.length(AValues) - 1; $l <= $end; $l++) {
        i = $l;
        L[i] = AValues[i];
      };
      this.FAutoFillCustomLists.AddOrSetValue(AKey,L);
      this.RebuildCustomListIndexForKey(AKey,L);
    };
    this.AutoFillCustomListTryGet = function (AKey, AValues) {
      var Result = false;
      Result = this.FAutoFillCustomLists.TryGetValue(AKey,AValues);
      return Result;
    };
    this.AutoFillCustomListsCount = function () {
      var Result = 0;
      Result = this.FAutoFillCustomLists.GetCount();
      return Result;
    };
    this.AddColumn = function () {
      var cc = 0;
      this.BeginUpdate();
      try {
        cc = this.FColumnCount;
        this.SetColumnCount(this.FColumnCount + 1);
        this.SetColumnOrder(cc,this.FColumnCount - 1);
      } finally {
        this.EndUpdate();
      };
    };
    this.AddNodeRow = function (ARow, AChildCount, ALevel, AMerge) {
      this.SetNodeRow(ARow,AChildCount,ALevel,AMerge);
    };
    this.AddRow = function () {
      var rr = 0;
      this.BeginUpdate();
      try {
        rr = this.FRowCount;
        this.SetRowCount(this.FRowCount + 1);
        this.SetRowOrder(rr,this.FRowCount - 1);
      } finally {
        this.EndUpdate();
      };
    };
    this.ApplyFilter = function () {
      var i = 0;
      var mf = false;
      this.UpdateFilterBuilderColumns();
      if (this.FAdapter != null) {
        var $tmp = this.FAdapter.FilterMode();
        if ($tmp === $mod.TTMSFNCDataGridDataAdapterFilterMode.afmNone) {
          return}
         else if ($tmp === $mod.TTMSFNCDataGridDataAdapterFilterMode.afmAdapter) {
          if ($mod.TTMSFNCDataGridDataFilteringAction.gdfaHideRow in this.FOptions.FFiltering.FActions) {
            this.FAdapter.ApplyFilter()}
           else throw pas.SysUtils.Exception.$create("Create$1",[rtl.getResStr($mod,"sTMSFNCDataGridDataFilterActionsError")]);
          return;
        };
      };
      this.BeginUpdate();
      try {
        if (this.IsGrouped()) {
          this.InternalFilterGroups(this.GetGroupDictionary())}
         else {
          for (var $l = this.FFixedRowCount, $end = this.FRowCount - this.FFixedBottomRowCount - 1; $l <= $end; $l++) {
            i = $l;
            if (this.IsRowNormal(i)) {
              mf = this.MatchFilter(i);
              if ($mod.TTMSFNCDataGridDataFilteringAction.gdfaExecuteActions in this.FOptions.FFiltering.FActions) this.ApplyFilteringOnActions(mf,i);
              if (!mf) this.SetFilteredRow(i,true);
            };
          };
        };
      } finally {
        this.FFilterApplied = true;
        this.EndUpdate();
      };
    };
    this.AutoFill = function (ASourceStart, ASourceEnd, ATargetStart, ATargetEnd, ADirection) {
      this.InternalAutoFill(ASourceStart,ASourceEnd,ATargetStart,ATargetEnd,ADirection);
    };
    this.AutoNumberColumn = function (AColumn, AStartRow, AStartValue) {
      var i = 0;
      for (var $l = AStartRow, $end = this.FRowCount - 1; $l <= $end; $l++) {
        i = $l;
        this.SetCell(AColumn,i,AStartValue);
        AStartValue += 1;
      };
    };
    this.AutoNumberRow = function (ARow, AStartColumn, AStartValue) {
      var i = 0;
      for (var $l = AStartColumn, $end = this.FColumnCount - 1; $l <= $end; $l++) {
        i = $l;
        this.SetCell(i,ARow,AStartValue);
        AStartValue += 1;
      };
    };
    this.ClearCells = function (ACellRange) {
      var i = 0;
      var j = 0;
      var c = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      this.BeginUpdate();
      try {
        for (var $l = ACellRange.StartCell.GetRow(), $end = ACellRange.StopCell.GetRow(); $l <= $end; $l++) {
          i = $l;
          for (var $l1 = ACellRange.StartCell.GetColumn(), $end1 = ACellRange.StopCell.GetColumn(); $l1 <= $end1; $l1++) {
            j = $l1;
            c.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(j,i));
            if (this.IsCellMerged(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c))) this.SplitCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c));
            this.DeleteCellData(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c));
          };
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.ClearData = function () {
      this.BeginUpdate();
      try {
        this.GetDataDictionary().Clear();
      } finally {
        this.EndUpdate();
      };
    };
    this.ClearDataForColumn = function (AColumn, ARowTypes) {
      var I = 0;
      var b = false;
      this.BeginUpdate();
      try {
        for (var $l = 0, $end = this.FRowCount - 1; $l <= $end; $l++) {
          I = $l;
          b = this.GetRowType(I) in ARowTypes;
          if (b && this.GetHasCellData(AColumn,I)) this.DeleteCellData(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,I)));
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.ClearDataForRow = function (ARow, ARowTypes) {
      var I = 0;
      var b = false;
      this.BeginUpdate();
      try {
        b = this.GetRowType(ARow) in ARowTypes;
        if (b) {
          for (var $l = 0, $end = this.FColumnCount - 1; $l <= $end; $l++) {
            I = $l;
            if (this.GetHasCellData(I,ARow)) this.DeleteCellData(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(I,ARow)));
          };
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.ClearFilter = function () {
      if (this.FAdapter != null) {
        var $tmp = this.FAdapter.FilterMode();
        if ($tmp === $mod.TTMSFNCDataGridDataAdapterFilterMode.afmNone) {
          return}
         else if ($tmp === $mod.TTMSFNCDataGridDataAdapterFilterMode.afmAdapter) {
          this.GetFilter().ClearCollection();
          this.GetFilterBuilder().ClearFilter();
          this.FAdapter.ClearFilter();
          return;
        };
      };
      this.FFilterApplied = false;
      this.GetFilter().ClearCollection();
      this.GetFilterBuilder().ClearFilter();
      this.RemoveFilter();
    };
    this.ClearFind = function () {
      this.FFindCache = "";
      this.FFindCell.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(-1,-1));
      this.FFindParameters = {};
    };
    this.ClearNodeRow = function (ARow) {
      var R = 0;
      var C = 0;
      this.BeginUpdate();
      try {
        this.SetRowType(ARow,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowType.grtDefault);
        this.SetRowNodeLevel(ARow,0);
        C = this.GetRowNodeChildCount(ARow);
        this.SetRowNodeChildCount(ARow,0);
        this.SetRowNodeState(ARow,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowNodeState.grnsExpanded);
        for (var $l = ARow + 1, $end = ARow + C; $l <= $end; $l++) {
          R = $l;
          this.SetRowNodeLevel(R,0);
        };
        this.SplitCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(this.FFixedColumnCount,ARow)));
      } finally {
        this.EndUpdate();
      };
    };
    this.CollapseAllNodes = function () {
      var k = 0;
      this.BeginUpdate();
      try {
        var $in = this.GetDataDictionary().GetKeys().GetEnumerator$1();
        try {
          while ($in.MoveNext$1()) {
            k = $in.GetCurrent();
            if ((this.GetDataDictionary().GetItem(k) != null) && (this.GetDataDictionary().GetItem(k).FType === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowType.grtNode) && this.IsRowValid(k)) this.CollapseNode(k);
          }
        } finally {
          $in = rtl.freeLoc($in)
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.CollapseNode = function (ARow) {
      var I = 0;
      if (!this.IsRowNode(ARow)) {
        this.LogMessage("Row " + pas.SysUtils.TIntegerHelper.ToString$1.call({get: function () {
            return ARow;
          }, set: function (v) {
            ARow = v;
          }}) + " cannot be collapsed.",pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridLogMessageType.glmInfo);
        return;
      };
      this.SetRowNodeState(ARow,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowNodeState.grnsCollapsed);
      this.BeginUpdate();
      try {
        for (var $l = ARow + 1, $end = ARow + this.GetRowNodeChildCount(ARow); $l <= $end; $l++) {
          I = $l;
          this.HideRow(I);
        };
        this.DoRowCollapse(ARow);
      } finally {
        this.EndUpdate();
      };
    };
    this.ColumnCalculation = function (AColumn, AMethod, ACalculationOptionsCallback, ACustomCalculationCallback) {
      this.ColumnCalculation$1([AColumn],AMethod,ACalculationOptionsCallback,ACustomCalculationCallback);
    };
    this.ColumnCalculation$1 = function (AColumns, AMethod, ACalculationOptionsCallback, ACustomCalculationCallback) {
      this.InternalColumnCalculation$1(rtl.arrayRef(AColumns),-1,-1,-1,AMethod,ACalculationOptionsCallback,ACustomCalculationCallback);
    };
    this.CopyColumnTo = function (AColumn, ADataInstance, AIndex) {
      var c = 0;
      ADataInstance.BeginUpdate();
      try {
        if (AIndex === -1) {
          ADataInstance.AddColumn();
          c = ADataInstance.FColumnCount - 1;
        } else {
          ADataInstance.InsertColumn(AIndex);
          c = AIndex;
        };
        this.CopyColumnDataTo(AColumn,c,ADataInstance);
      } finally {
        ADataInstance.EndUpdate();
      };
    };
    this.DeleteColumn = function (AColumn) {
      this.DeleteColumns(AColumn,1);
    };
    this.DeleteColumns = function (AColumn, ACount) {
      var c = 0;
      var r = 0;
      var b = false;
      b = true;
      for (var $l = AColumn, $end = (AColumn + ACount) - 1; $l <= $end; $l++) {
        c = $l;
        if (!this.CanDeleteColumn(c)) {
          b = false;
          break;
        };
      };
      if (b) {
        this.BeginUpdate();
        try {
          for (var $l1 = AColumn, $end1 = (AColumn + ACount) - 1; $l1 <= $end1; $l1++) {
            c = $l1;
            for (var $l2 = 0, $end2 = this.FRowCount - 1; $l2 <= $end2; $l2++) {
              r = $l2;
              this.DeleteCellData(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r)));
            };
            this.DeleteColumnData(c);
          };
          for (var $l3 = AColumn + ACount, $end3 = this.FColumnCount - 1; $l3 <= $end3; $l3++) {
            c = $l3;
            this.MoveColumnData(c,c - ACount);
          };
          this.ShiftColumnOrder(AColumn + ACount,-ACount);
          this.SetColumnCount(this.FColumnCount - ACount);
        } finally {
          this.EndUpdate();
        };
      } else this.LogMessage("Columns [" + this.FormatNumberRange(AColumn,ACount) + "] cannot be deleted.",pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridLogMessageType.glmWarning);
    };
    this.DeleteRow = function (ARow) {
      this.DeleteRows(ARow,1);
    };
    this.DeleteRows = function (ARow, ACount) {
      var r = 0;
      var b = false;
      b = true;
      for (var $l = ARow, $end = (ARow + ACount) - 1; $l <= $end; $l++) {
        r = $l;
        if (!this.CanDeleteRow(r)) {
          b = false;
          break;
        };
      };
      if (b) {
        this.InternalDeleteRows(ARow,ACount)}
       else this.LogMessage("Rows [" + this.FormatNumberRange(ARow,ACount) + "] cannot be deleted.",pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridLogMessageType.glmWarning);
    };
    this.ExpandAllNodes = function () {
      var k = 0;
      this.BeginUpdate();
      this.FExpandAll += 1;
      try {
        var $in = this.GetDataDictionary().GetKeys().GetEnumerator$1();
        try {
          while ($in.MoveNext$1()) {
            k = $in.GetCurrent();
            if ((this.GetDataDictionary().GetItem(k) != null) && (this.GetDataDictionary().GetItem(k).FType === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowType.grtNode) && this.IsRowValid(k)) this.ExpandNode(k);
          }
        } finally {
          $in = rtl.freeLoc($in)
        };
      } finally {
        this.FExpandAll -= 1;
        this.EndUpdate();
      };
    };
    this.ExpandNode = function (ARow) {
      var I = 0;
      var p = 0;
      var lvl = 0;
      if (!this.IsRowNode(ARow)) {
        this.LogMessage("Row " + pas.SysUtils.TIntegerHelper.ToString$1.call({get: function () {
            return ARow;
          }, set: function (v) {
            ARow = v;
          }}) + " cannot be expanded.",pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridLogMessageType.glmInfo);
        return;
      };
      if (this.FExpandAll === 0) {
        p = this.GetParentRow(ARow);
        if (p !== -1) {
          if (this.GetRowNodeState(p) === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowNodeState.grnsCollapsed) {
            this.LogMessage("Expand parent node first",pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridLogMessageType.glmInfo);
            return;
          };
        };
      };
      this.SetRowNodeState(ARow,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowNodeState.grnsExpanded);
      lvl = this.GetRowNodeLevel(ARow);
      this.BeginUpdate();
      try {
        for (var $l = ARow + 1, $end = ARow + this.GetRowNodeChildCount(ARow); $l <= $end; $l++) {
          I = $l;
          if (this.GetRowNodeLevel(I) === (lvl + 1)) this.UnhideRow(I);
          if (this.IsRowNode(I) && (this.GetRowNodeState(I) === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowNodeState.grnsExpanded)) this.ExpandNode(I);
        };
        this.DoRowExpand(ARow);
      } finally {
        this.EndUpdate();
      };
    };
    this.GoToCell = function (ACell, ASelect) {
    };
    this.Group = function (AColumn) {
      this.Group$1([AColumn],null,null,null,null,null);
    };
    this.Group$1 = function (AColumns, ASortColumns, ACustomGroupCallback, ACustomCompareCallback, AGroupOptionsCallback, ASortOptionsCallback) {
      var grpi = $mod.TTMSFNCDataGridDataGroupInfo.$new();
      grpi.Columns = rtl.arrayRef(AColumns);
      grpi.SortColumns = rtl.arrayRef(ASortColumns);
      this.Group$2($mod.TTMSFNCDataGridDataGroupInfo.$clone(grpi),ACustomGroupCallback,ACustomCompareCallback,AGroupOptionsCallback,ASortOptionsCallback);
    };
    this.Group$2 = function (AGroupInfo, ACustomGroupCallback, ACustomCompareCallback, AGroupOptionsCallback, ASortOptionsCallback) {
      var c = [];
      var I = 0;
      if (this.GetGroupDictionary().GetCount() > 0) {
        this.LogMessage("Grouping already applied, please ungroup first.",pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridLogMessageType.glmInfo);
        return;
      };
      c = rtl.arraySetLength(c,0,this.FColumnCount);
      for (var $l = this.FFixedColumnCount, $end = this.FColumnCount - 1 - this.FFixedRightColumnCount; $l <= $end; $l++) {
        I = $l;
        c[I] = I;
      };
      if (this.HasMergedCells(rtl.arrayRef(c),this.FFixedRowCount,this.FRowCount - 1 - this.FFixedBottomRowCount)) {
        this.LogMessage("Grouping cannot be executed, please split merged cells first.",pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridLogMessageType.glmInfo);
        return;
      };
      this.InternalGroup(this.GetGroupDictionary(),$mod.TTMSFNCDataGridDataGroupInfo.$clone(AGroupInfo),0,this.FFixedRowCount,this.FRowCount - 1 - this.FFixedBottomRowCount,ACustomGroupCallback,ACustomCompareCallback,AGroupOptionsCallback,ASortOptionsCallback);
    };
    this.GroupAverage = function (AColumn, ACalculationOptionsCallback) {
      this.GroupAverage$1([AColumn],ACalculationOptionsCallback);
    };
    this.GroupAverage$1 = function (AColumns, ACalculationOptionsCallback) {
      this.InternalGroupCalculation(rtl.arrayRef(AColumns),-1,-1,-1,$mod.TTMSFNCDataGridDataCalculationMethod.gcmAverage,ACalculationOptionsCallback,null);
    };
    this.GroupCalculation = function (AColumn, AMethod, ACalculationOptionsCallback, ACustomCalculationCallback) {
      this.GroupCalculation$1([AColumn],AMethod,ACalculationOptionsCallback,ACustomCalculationCallback);
    };
    this.GroupCalculation$1 = function (AColumns, AMethod, ACalculationOptionsCallback, ACustomCalculationCallback) {
      this.InternalGroupCalculation(rtl.arrayRef(AColumns),-1,-1,-1,AMethod,ACalculationOptionsCallback,ACustomCalculationCallback);
    };
    this.GroupCount = function (AColumn, ACalculationOptionsCallback) {
      this.GroupCount$1([AColumn],ACalculationOptionsCallback);
    };
    this.GroupCount$1 = function (AColumns, ACalculationOptionsCallback) {
      this.InternalGroupCalculation(rtl.arrayRef(AColumns),-1,-1,-1,$mod.TTMSFNCDataGridDataCalculationMethod.gcmCount,ACalculationOptionsCallback,null);
    };
    this.GroupCustomCalculation = function (AColumn, ACalculationOptionsCallback, ACustomCalculationCallback) {
      this.GroupCustomCalculation$1([AColumn],ACalculationOptionsCallback,ACustomCalculationCallback);
    };
    this.GroupCustomCalculation$1 = function (AColumns, ACalculationOptionsCallback, ACustomCalculationCallback) {
      this.InternalGroupCalculation(rtl.arrayRef(AColumns),-1,-1,-1,$mod.TTMSFNCDataGridDataCalculationMethod.gcmCustom,ACalculationOptionsCallback,ACustomCalculationCallback);
    };
    this.GroupDistinct = function (AColumn, ACalculationOptionsCallback) {
      this.GroupDistinct$1([AColumn],ACalculationOptionsCallback);
    };
    this.GroupDistinct$1 = function (AColumns, ACalculationOptionsCallback) {
      this.InternalGroupCalculation(rtl.arrayRef(AColumns),-1,-1,-1,$mod.TTMSFNCDataGridDataCalculationMethod.gcmDistinct,ACalculationOptionsCallback,null);
    };
    this.GroupMax = function (AColumn, ACalculationOptionsCallback) {
      this.GroupMax$1([AColumn],ACalculationOptionsCallback);
    };
    this.GroupMax$1 = function (AColumns, ACalculationOptionsCallback) {
      this.InternalGroupCalculation(rtl.arrayRef(AColumns),-1,-1,-1,$mod.TTMSFNCDataGridDataCalculationMethod.gcmMax,ACalculationOptionsCallback,null);
    };
    this.GroupMin = function (AColumn, ACalculationOptionsCallback) {
      this.GroupMin$1([AColumn],ACalculationOptionsCallback);
    };
    this.GroupMin$1 = function (AColumns, ACalculationOptionsCallback) {
      this.InternalGroupCalculation(rtl.arrayRef(AColumns),-1,-1,-1,$mod.TTMSFNCDataGridDataCalculationMethod.gcmMin,ACalculationOptionsCallback,null);
    };
    this.GroupSort = function (AColumn, ADirection) {
      this.GroupSort$1([AColumn],[ADirection],null,null);
    };
    this.GroupSort$1 = function (AColumns, ADirections, ACustomCompareCallback, ASortOptionsCallback) {
      var $Self = this;
      var I = 0;
      function InternalGroupSort(d) {
        var k = "";
        var grp = null;
        var rst = 0;
        var lvl = 0;
        var rstp = 0;
        var $in = d.GetKeys().GetEnumerator$1();
        try {
          while ($in.MoveNext$1()) {
            k = $in.GetCurrent();
            grp = d.GetItem(k);
            if (grp != null) {
              if ((grp.GetGroupDictionary() != null) && (grp.GetGroupDictionary().GetCount() > 0)) {
                InternalGroupSort(grp.GetGroupDictionary())}
               else if ($Self.IsRowNode(grp.FRow)) {
                rst = grp.FRow + 1;
                rstp = grp.FRow + $Self.GetRowNodeChildCount(grp.FRow);
                lvl = $Self.GetRowNodeLevel(grp.FRow);
                if ((rstp - rst) > 0) $Self.InternalSort(rtl.arrayRef(AColumns),rtl.arrayRef(ADirections),lvl,rst,rstp,ACustomCompareCallback,ASortOptionsCallback);
              };
            };
          }
        } finally {
          $in = rtl.freeLoc($in)
        };
      };
      this.GetSortIndexList().Clear();
      for (var $l = 0, $end = rtl.length(AColumns) - 1; $l <= $end; $l++) {
        I = $l;
        if (I <= (rtl.length(ADirections) - 1)) {
          this.GetSortIndexList().Add$1(AColumns[I],ADirections[I])}
         else this.GetSortIndexList().Add$1(AColumns[I],this.FOptions.FSorting.FDirection);
      };
      this.BeginUpdate();
      try {
        InternalGroupSort(this.GetGroupDictionary());
      } finally {
        this.EndUpdate();
      };
    };
    this.GroupSortIndexed = function () {
      var c = [];
      var idx = null;
      var d = [];
      var $in = this.GetSortIndexList().GetEnumerator$1();
      try {
        while ($in.MoveNext()) {
          idx = $in.DoGetCurrent();
          c = rtl.arraySetLength(c,0,rtl.length(c) + 1);
          c[rtl.length(c) - 1] = idx.FColumn;
          d = rtl.arraySetLength(d,0,rtl.length(d) + 1);
          d[rtl.length(d) - 1] = idx.FDirection;
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      this.GroupSort$1(rtl.arrayRef(c),rtl.arrayRef(d),null,null);
    };
    this.GroupStandardDeviation = function (AColumn, ACalculationOptionsCallback) {
      this.GroupStandardDeviation$1([AColumn],ACalculationOptionsCallback);
    };
    this.GroupStandardDeviation$1 = function (AColumns, ACalculationOptionsCallback) {
      this.InternalGroupCalculation(rtl.arrayRef(AColumns),-1,-1,-1,$mod.TTMSFNCDataGridDataCalculationMethod.gcmStandardDeviation,ACalculationOptionsCallback,null);
    };
    this.GroupSum = function (AColumn, ACalculationOptionsCallback) {
      this.GroupSum$1([AColumn],ACalculationOptionsCallback);
    };
    this.GroupSum$1 = function (AColumns, ACalculationOptionsCallback) {
      this.InternalGroupCalculation(rtl.arrayRef(AColumns),-1,-1,-1,$mod.TTMSFNCDataGridDataCalculationMethod.gcmSum,ACalculationOptionsCallback,null);
    };
    this.InsertColumn = function (AColumn) {
      if ((this.FFixedRightColumnCount === 0) && (AColumn === this.FColumnCount)) {
        this.AddColumn()}
       else this.InsertColumns(AColumn,1);
    };
    this.InsertColumns = function (AColumn, ACount) {
      var c = 0;
      var cc = 0;
      var i = 0;
      if (this.CanInsertColumn(AColumn)) {
        this.BeginUpdate();
        try {
          cc = this.FColumnCount;
          this.SetColumnCount(this.FColumnCount + ACount);
          for (var $l = cc - 1, $end = AColumn; $l >= $end; $l--) {
            c = $l;
            this.MoveColumnData(c,c + ACount);
          };
          this.ShiftColumnOrder(AColumn,ACount);
          i = 0;
          for (var $l1 = AColumn, $end1 = (AColumn + ACount) - 1; $l1 <= $end1; $l1++) {
            c = $l1;
            this.SetColumnOrder(cc + i,c);
            i += 1;
          };
        } finally {
          this.EndUpdate();
        };
      } else this.LogMessage("Columns [" + this.FormatNumberRange(AColumn,ACount) + "] cannot be inserted.",pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridLogMessageType.glmWarning);
    };
    this.InsertRow = function (ARow) {
      if ((this.FFixedBottomRowCount === 0) && (ARow === this.FRowCount)) {
        this.AddRow()}
       else this.InsertRows(ARow,1);
    };
    this.InsertRows = function (ARow, ACount) {
      var r = 0;
      var pr = 0;
      var rr = 0;
      var I = 0;
      var lvl = 0;
      if (this.CanInsertRow(ARow)) {
        this.BeginUpdate();
        try {
          pr = -1;
          if (this.FUpdateGrouping === 0) pr = this.GetParentRow(ARow);
          rr = this.FRowCount;
          this.SetRowCount(this.FRowCount + ACount);
          for (var $l = rr - 1, $end = ARow; $l >= $end; $l--) {
            r = $l;
            this.MoveRowData(r,r + ACount);
          };
          this.ShiftRowOrder(ARow,ACount);
          I = 0;
          for (var $l1 = ARow, $end1 = (ARow + ACount) - 1; $l1 <= $end1; $l1++) {
            r = $l1;
            this.SetRowOrder(rr + I,r);
            I += 1;
          };
          if (this.FUpdateGrouping === 0) {
            if (pr !== -1) {
              lvl = this.GetRowNodeLevel(pr);
              for (var $l2 = ARow, $end2 = (ARow + ACount) - 1; $l2 <= $end2; $l2++) {
                rr = $l2;
                this.SetRowNodeLevel(rr,lvl + 1);
              };
              while (pr !== -1) {
                this.SetRowNodeChildCount(pr,this.GetRowNodeChildCount(pr) + ACount);
                pr = this.GetParentRow(pr);
              };
            };
          };
        } finally {
          this.EndUpdate();
        };
      } else this.LogMessage("Rows [" + this.FormatNumberRange(ARow,ACount) + "] cannot be inserted.",pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridLogMessageType.glmWarning);
    };
    this.LinearFill = function (ADoFixed) {
      this.FillGridData(ADoFixed,false,100);
    };
    this.LoadFromCSVData = function (AFileName) {
      this.InternalLoadFromCSV(AFileName,pas.SysUtils.TEncoding.GetDefault());
    };
    this.LoadFromCSVData$1 = function (AFileName, AEncoding) {
      this.InternalLoadFromCSV(AFileName,AEncoding);
    };
    this.LoadFromCSVStreamData = function (AStream) {
      this.InternalLoadFromCSVStream(AStream,pas.SysUtils.TEncoding.GetDefault());
    };
    this.LoadFromCSVStreamData$1 = function (AStream, AEncoding) {
      this.InternalLoadFromCSVStream(AStream,AEncoding);
    };
    this.LoadFromFileData = function (AFileName) {
      this.InternalLoadFromFile(AFileName,pas.SysUtils.TEncoding.GetDefault());
    };
    this.LoadFromFileData$1 = function (AFileName, AEncoding) {
      this.InternalLoadFromFile(AFileName,AEncoding);
    };
    this.LoadFromFileStreamData = function (AStream) {
      this.InternalLoadFromFileStream(AStream,pas.SysUtils.TEncoding.GetDefault());
    };
    this.LoadFromFileStreamData$1 = function (AStream, AEncoding) {
      this.InternalLoadFromFileStream(AStream,AEncoding);
    };
    this.LoadFromJSONData = function (AFileName, AEncoding, ARowDataName, AColumnDataName, AColumnNames) {
      this.InternalLoadFromJSON(AFileName,AEncoding,ARowDataName,AColumnDataName,rtl.arrayRef(AColumnNames));
    };
    this.LoadFromJSONData$1 = function (AFileName, ARowDataName, AColumnDataName, AColumnNames) {
      this.InternalLoadFromJSON(AFileName,pas.SysUtils.TEncoding.GetDefault(),ARowDataName,AColumnDataName,rtl.arrayRef(AColumnNames));
    };
    this.LoadFromJSONStreamData = function (AStream, AEncoding, ARowDataName, AColumnDataName, AColumnNames) {
      this.InternalLoadFromJSONStream(AStream,AEncoding,ARowDataName,AColumnDataName,rtl.arrayRef(AColumnNames));
    };
    this.LoadFromJSONStreamData$1 = function (AStream, ARowDataName, AColumnDataName, AColumnNames) {
      this.InternalLoadFromJSONStream(AStream,pas.SysUtils.TEncoding.GetDefault(),ARowDataName,AColumnDataName,rtl.arrayRef(AColumnNames));
    };
    this.LoadFromJSONTextData = function (AText, ARowDataName, AColumnDataName, AColumnNames) {
      this.InternalLoadFromJSONText(AText,ARowDataName,AColumnDataName,rtl.arrayRef(AColumnNames));
    };
    this.LoadFromXMLData = function (AFileName) {
      this.InternalLoadFromXML(AFileName,pas.SysUtils.TEncoding.GetDefault());
    };
    this.LoadFromXMLData$1 = function (AFileName, AEncoding) {
      this.InternalLoadFromXML(AFileName,AEncoding);
    };
    this.LoadFromXMLStreamData = function (AStream) {
      this.InternalLoadFromXMLStream(AStream,pas.SysUtils.TEncoding.GetDefault());
    };
    this.LoadFromXMLStreamData$1 = function (AStream, AEncoding) {
      this.InternalLoadFromXMLStream(AStream,AEncoding);
    };
    this.LoadSampleData = function () {
      var I = 0;
      var J = 0;
      var K = 0;
      var L = 0;
      var s = "";
      var p = "";
      var d = 0.0;
      this.BeginUpdate();
      try {
        for (var $l = 0, $end = this.FFixedRowCount - 1; $l <= $end; $l++) {
          I = $l;
          if (I > 0) {
            p = "Sub "}
           else p = "";
          K = 0;
          L = 0;
          for (var $l1 = this.FFixedColumnCount, $end1 = this.FColumnCount - 1; $l1 <= $end1; $l1++) {
            J = $l1;
            var $tmp = L;
            if ($tmp === 0) {
              s = p + "ID"}
             else if ($tmp === 1) {
              s = p + "Name"}
             else if ($tmp === 2) {
              s = p + "Joined"}
             else if ($tmp === 3) {
              s = p + "Status"}
             else {
              K += 1;
              s = p + "Number " + pas.SysUtils.IntToStr(K);
            };
            this.SetCell(J,I,s);
            L += 1;
          };
        };
        for (var $l2 = this.FFixedRowCount, $end2 = this.FRowCount - 1; $l2 <= $end2; $l2++) {
          I = $l2;
          L = 0;
          for (var $l3 = this.FFixedColumnCount, $end3 = this.FColumnCount - 1; $l3 <= $end3; $l3++) {
            J = $l3;
            s = "";
            var $tmp1 = L;
            if ($tmp1 === 0) {
              s = "00" + pas.SysUtils.TIntegerHelper.ToString$1.call({get: function () {
                  return I;
                }, set: function (v) {
                  I = v;
                }})}
             else if ($tmp1 === 1) {
              var $tmp2 = pas.System.Random(120) % 5;
              if ($tmp2 === 0) {
                s = "David"}
               else if ($tmp2 === 1) {
                s = "Laura"}
               else if ($tmp2 === 2) {
                s = "Isaac"}
               else if ($tmp2 === 3) {
                s = "Marie"}
               else {
                s = "Leon";
              };
              var $tmp3 = pas.System.Random(120) % 5;
              if ($tmp3 === 0) {
                s = s + " Kleermakers"}
               else if ($tmp3 === 1) {
                s = s + " Tailor"}
               else if ($tmp3 === 2) {
                s = s + " Terzi"}
               else if ($tmp3 === 3) {
                s = s + " Sastre"}
               else {
                s = s + " Schneider";
              };
            } else if ($tmp1 === 2) {
              d = Math.round(pas.SysUtils.Now()) - pas.System.Random(5475);
              s = pas.SysUtils.DateToStr(d);
            } else if ($tmp1 === 3) {
              var $tmp4 = pas.System.Random(120) % 5;
              if ($tmp4 === 0) {
                s = "Flight"}
               else if ($tmp4 === 1) {
                s = "On Leave"}
               else if ($tmp4 === 2) {
                s = "Abroad"}
               else {
                s = "Office";
              };
            } else {
              s = pas.SysUtils.TIntegerHelper.ToString$1.call({a: pas.System.Random(100), get: function () {
                  return this.a;
                }, set: function (v) {
                  this.a = v;
                }});
            };
            this.SetCell(J,I,s);
            L += 1;
          };
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.MergeCells = function (AColumn, ARow, AColumnCount, ARowCount) {
      var i = 0;
      var j = 0;
      var hasExistingMerge = false;
      var mi = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellMergeInfo.$new();
      var minColumn = 0;
      var maxColumn = 0;
      var minRow = 0;
      var maxRow = 0;
      hasExistingMerge = false;
      minColumn = AColumn;
      maxColumn = (AColumn + AColumnCount) - 1;
      minRow = ARow;
      maxRow = (ARow + ARowCount) - 1;
      for (var $l = AColumn, $end = maxColumn; $l <= $end; $l++) {
        i = $l;
        for (var $l1 = ARow, $end1 = maxRow; $l1 <= $end1; $l1++) {
          j = $l1;
          if (this.GetHasMergeInfo(i,j)) {
            hasExistingMerge = true;
            mi.$assign(this.GetMergeInfo(i,j));
            minColumn = Math.min(minColumn,i - mi.ColumnOffset);
            maxColumn = Math.max(maxColumn,((i - mi.ColumnOffset) + mi.ColumnSpan) - 1);
            minRow = Math.min(minRow,j - mi.RowOffset);
            maxRow = Math.max(maxRow,((j - mi.RowOffset) + mi.RowSpan) - 1);
          };
        };
      };
      if (hasExistingMerge || this.CanMergeCells(AColumn,ARow,AColumnCount,ARowCount)) {
        this.BeginUpdate();
        try {
          for (var $l2 = minColumn, $end2 = maxColumn; $l2 <= $end2; $l2++) {
            i = $l2;
            for (var $l3 = minRow, $end3 = maxRow; $l3 <= $end3; $l3++) {
              j = $l3;
              this.SetMergeInfo(i,j,pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellMergeInfo.$new());
              this.SetMergedColumn(i,false);
              this.SetMergedRow(j,false);
            };
          };
          for (var $l4 = minColumn, $end4 = maxColumn; $l4 <= $end4; $l4++) {
            i = $l4;
            this.SetMergedColumn(i,true);
            for (var $l5 = minRow, $end5 = maxRow; $l5 <= $end5; $l5++) {
              j = $l5;
              this.SetMergedRow(j,true);
              this.SetMergeInfo(i,j,pas["WEBLib.TMSFNCDataGridCell"].CreateMergeInfo(i - minColumn,j - minRow,(maxColumn - minColumn) + 1,(maxRow - minRow) + 1));
            };
          };
        } finally {
          this.EndUpdate();
        };
      } else this.LogMessage("Cells with Columns [" + this.FormatNumberRange(AColumn,AColumnCount) + "] and Rows [" + this.FormatNumberRange(ARow,ARowCount) + "] cannot be merged.",pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridLogMessageType.glmWarning);
    };
    this.MergeColumn = function (AColumn) {
      this.MergeColumns(AColumn,1);
    };
    this.MergeColumns = function (AColumn, ACount) {
      this.MergeCells(AColumn,this.FFixedRowCount,ACount,this.FRowCount - this.FFixedBottomRowCount);
    };
    this.MergeRange = function (ARange) {
      this.MergeCells(ARange.StartCell.GetColumn(),ARange.StartCell.GetRow(),(ARange.StopCell.GetColumn() - ARange.StartCell.GetColumn()) + 1,(ARange.StopCell.GetRow() - ARange.StartCell.GetRow()) + 1);
    };
    this.MergeRow = function (ARow) {
      this.MergeRows(ARow,1);
    };
    this.MergeRows = function (ARow, ACount) {
      this.MergeCells(this.FFixedColumnCount,ARow,this.FColumnCount - this.FFixedRightColumnCount,ACount);
    };
    this.MoveColumn = function (AFromColumn, AToColumn) {
      var I = 0;
      if (this.CanMoveColumn(AFromColumn,AToColumn)) {
        this.BeginUpdate();
        try {
          if (AToColumn > AFromColumn) {
            for (var $l = AFromColumn, $end = AToColumn - 1; $l <= $end; $l++) {
              I = $l;
              this.SwapColumn(I,I + 1);
            };
          } else {
            for (var $l1 = AFromColumn, $end1 = AToColumn + 1; $l1 >= $end1; $l1--) {
              I = $l1;
              this.SwapColumn(I - 1,I);
            };
          };
        } finally {
          this.EndUpdate();
        };
      } else this.LogMessage("Columns [" + pas.SysUtils.TIntegerHelper.ToString$1.call({get: function () {
          return AFromColumn;
        }, set: function (v) {
          AFromColumn = v;
        }}) + ", " + pas.SysUtils.TIntegerHelper.ToString$1.call({get: function () {
          return AToColumn;
        }, set: function (v) {
          AToColumn = v;
        }}) + "] cannot be moved.",pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridLogMessageType.glmWarning);
    };
    this.MoveRow = function (AFromRow, AToRow) {
      var I = 0;
      if (this.CanMoveRow(AFromRow,AToRow)) {
        this.BeginUpdate();
        try {
          if (AToRow > AFromRow) {
            for (var $l = AFromRow, $end = AToRow - 1; $l <= $end; $l++) {
              I = $l;
              this.SwapRow(I,I + 1);
            };
          } else {
            for (var $l1 = AFromRow, $end1 = AToRow + 1; $l1 >= $end1; $l1--) {
              I = $l1;
              this.SwapRow(I - 1,I);
            };
          };
        } finally {
          this.EndUpdate();
        };
      } else this.LogMessage("Rows [" + pas.SysUtils.TIntegerHelper.ToString$1.call({get: function () {
          return AFromRow;
        }, set: function (v) {
          AFromRow = v;
        }}) + ", " + pas.SysUtils.TIntegerHelper.ToString$1.call({get: function () {
          return AToRow;
        }, set: function (v) {
          AToRow = v;
        }}) + "] cannot be moved.",pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridLogMessageType.glmWarning);
    };
    this.RandomFill = function (ADoFixed, ARandomNumber) {
      this.FillGridData(ADoFixed,true,ARandomNumber);
    };
    this.RefreshData = function (ACell, AUpdate) {
      this.RefreshData$1(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoordRange.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCellRange(ACell.GetColumn(),ACell.GetRow(),ACell.GetColumn(),ACell.GetRow())),AUpdate);
    };
    this.RefreshData$1 = function (ACellRange, AUpdate) {
      var c = 0;
      var r = 0;
      var ri = null;
      var ci = null;
      if (AUpdate) this.BeginUpdate();
      try {
        for (var $l = ACellRange.StartCell.GetRow(), $end = ACellRange.StopCell.GetRow(); $l <= $end; $l++) {
          r = $l;
          if (this.GetDataDictionary().TryGetValue(r,{get: function () {
              return ri;
            }, set: function (v) {
              ri = v;
            }})) {
            if (ri != null) {
              for (var $l1 = ACellRange.StartCell.GetColumn(), $end1 = ACellRange.StopCell.GetColumn(); $l1 <= $end1; $l1++) {
                c = $l1;
                if (ri.GetData().TryGetValue(c,{get: function () {
                    return ci;
                  }, set: function (v) {
                    ci = v;
                  }})) {
                  if (ci != null) ci.FInvalid = true;
                };
              };
            };
          };
        };
      } finally {
        if (AUpdate) this.EndUpdate();
      };
    };
    this.RefreshData$2 = function (AUpdate) {
      this.RefreshData$1(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoordRange.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCellRange(0,0,this.FColumnCount - 1,this.FRowCount - 1)),AUpdate);
    };
    this.RemoveFilter = function () {
      this.BeginUpdate();
      try {
        if (($mod.TTMSFNCDataGridDataFilteringAction.gdfaExecuteActions in this.FOptions.FFiltering.FActions) && (this.GetFilteredRowDictionary().GetCount() > 0)) this.RemoveFilteringOnActions();
        this.GetFilteredRowDictionary().Clear();
      } finally {
        this.EndUpdate();
      };
    };
    this.RemoveNodeRow = function (ARow) {
      this.ClearNodeRow(ARow);
    };
    this.RowCalculation = function (ARow, AMethod, ACalculationOptionsCallback, ACustomCalculationCallback) {
      this.RowCalculation$1([ARow],AMethod,ACalculationOptionsCallback,ACustomCalculationCallback);
    };
    this.RowCalculation$1 = function (ARows, AMethod, ACalculationOptionsCallback, ACustomCalculationCallback) {
      this.InternalRowCalculation$1(rtl.arrayRef(ARows),-1,-1,-1,AMethod,ACalculationOptionsCallback,ACustomCalculationCallback);
    };
    this.SaveToCSVData = function (AFileName) {
      this.InternalSaveToCSV(AFileName,pas.SysUtils.TEncoding.GetDefault());
    };
    this.SaveToCSVData$1 = function (AFileName, AEncoding) {
      this.InternalSaveToCSV(AFileName,AEncoding);
    };
    this.SaveToCSVStreamData = function (AStream) {
      this.InternalSaveToCSVStream(AStream,pas.SysUtils.TEncoding.GetDefault());
    };
    this.SaveToCSVStreamData$1 = function (AStream, AEncoding) {
      this.InternalSaveToCSVStream(AStream,AEncoding);
    };
    this.SaveToFileData = function (AFileName) {
      this.InternalSaveToFile(AFileName,pas.SysUtils.TEncoding.GetDefault());
    };
    this.SaveToFileData$1 = function (AFileName, AEncoding) {
      this.InternalSaveToFile(AFileName,AEncoding);
    };
    this.SaveToFileStreamData = function (AStream) {
      this.InternalSaveToFileStream(AStream,pas.SysUtils.TEncoding.GetDefault());
    };
    this.SaveToFileStreamData$1 = function (AStream, AEncoding) {
      this.InternalSaveToFileStream(AStream,AEncoding);
    };
    this.SetNodeRow = function (ARow, AChildCount, ALevel, AMerge) {
      var R = 0;
      if (this.GetRowType(ARow) === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowType.grtNode) {
        this.LogMessage("Row is already configured as node",pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridLogMessageType.glmInfo);
        return;
      };
      for (var $l = ARow + 1, $end = ARow + AChildCount; $l <= $end; $l++) {
        R = $l;
        if (this.GetRowType(R) !== pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowType.grtDefault) {
          this.LogMessage("Row cannot be configured as node, one or more rows already contain node information",pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridLogMessageType.glmInfo);
          return;
        };
      };
      this.BeginUpdate();
      try {
        this.SetRowType(ARow,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowType.grtNode);
        this.SetRowNodeLevel(ARow,ALevel);
        this.SetRowNodeChildCount(ARow,AChildCount);
        for (var $l1 = ARow + 1, $end1 = ARow + AChildCount; $l1 <= $end1; $l1++) {
          R = $l1;
          this.SetRowNodeLevel(R,ALevel + 1);
        };
        this.SetRowNodeState(ARow,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowNodeState.grnsExpanded);
        if (AMerge) this.MergeCells(this.FFixedColumnCount,ARow,this.FColumnCount - this.FFixedRightColumnCount - this.FFixedColumnCount,1);
      } finally {
        this.EndUpdate();
      };
    };
    this.Sort = function (AColumn, ADirection) {
      this.Sort$2([AColumn],[ADirection],null,null);
    };
    this.Sort$1 = function (AColumn, ADirection, AFromRow, AToRow) {
      this.GetSortIndexList().Clear();
      this.GetSortIndexList().Add$1(AColumn,ADirection);
      this.InternalSort([AColumn],[ADirection],0,AFromRow,AToRow,null,null);
    };
    this.Sort$2 = function (AColumns, ADirections, ACustomCompareCallback, ASortOptionsCallback) {
      var I = 0;
      this.GetSortIndexList().Clear();
      for (var $l = 0, $end = rtl.length(AColumns) - 1; $l <= $end; $l++) {
        I = $l;
        if (I <= (rtl.length(ADirections) - 1)) {
          this.GetSortIndexList().Add$1(AColumns[I],ADirections[I])}
         else this.GetSortIndexList().Add$1(AColumns[I],this.FOptions.FSorting.FDirection);
      };
      this.InternalSort(rtl.arrayRef(AColumns),rtl.arrayRef(ADirections),0,this.FFixedRowCount,this.FRowCount - 1 - this.FFixedBottomRowCount,ACustomCompareCallback,ASortOptionsCallback);
    };
    this.Sort$3 = function (AColumns, ADirections, AFromRow, AToRow, ACustomCompareCallback, ASortOptionsCallback) {
      var I = 0;
      this.GetSortIndexList().Clear();
      for (var $l = 0, $end = rtl.length(AColumns) - 1; $l <= $end; $l++) {
        I = $l;
        if (I <= (rtl.length(ADirections) - 1)) {
          this.GetSortIndexList().Add$1(AColumns[I],ADirections[I])}
         else this.GetSortIndexList().Add$1(AColumns[I],this.FOptions.FSorting.FDirection);
      };
      this.InternalSort(rtl.arrayRef(AColumns),rtl.arrayRef(ADirections),0,AFromRow,AToRow,ACustomCompareCallback,ASortOptionsCallback);
    };
    this.SortIndexed = function () {
      var c = [];
      var idx = null;
      var d = [];
      var $in = this.GetSortIndexList().GetEnumerator$1();
      try {
        while ($in.MoveNext()) {
          idx = $in.DoGetCurrent();
          c = rtl.arraySetLength(c,0,rtl.length(c) + 1);
          c[rtl.length(c) - 1] = idx.FColumn;
          d = rtl.arraySetLength(d,0,rtl.length(d) + 1);
          d[rtl.length(d) - 1] = idx.FDirection;
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
      this.Sort$2(rtl.arrayRef(c),rtl.arrayRef(d),null,null);
    };
    this.SplitCell = function (ACell) {
      var fc = 0;
      var fr = 0;
      var tc = 0;
      var tr = 0;
      var mi = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellMergeInfo.$new();
      var i = 0;
      var j = 0;
      if (this.GetHasMergeInfo(ACell.GetColumn(),ACell.GetRow())) {
        this.BeginUpdate();
        try {
          mi.$assign(this.GetMergeInfo(ACell.GetColumn(),ACell.GetRow()));
          fc = ACell.GetColumn() - mi.ColumnOffset;
          fr = ACell.GetRow() - mi.RowOffset;
          tc = fc + mi.ColumnSpan;
          tr = fr + mi.RowSpan;
          for (var $l = fc, $end = tc - 1; $l <= $end; $l++) {
            i = $l;
            this.SetMergedColumn(i,false);
            for (var $l1 = fr, $end1 = tr - 1; $l1 <= $end1; $l1++) {
              j = $l1;
              this.SetMergedRow(j,false);
              this.SetMergeInfo(i,j,pas["WEBLib.TMSFNCDataGridCell"].DefaultMergeInfo());
            };
          };
        } finally {
          this.EndUpdate();
        };
      } else this.LogMessage("Cell " + pas.SysUtils.TIntegerHelper.ToString$1.call({p: ACell.GetColumn(), get: function () {
          return this.p;
        }, set: function (v) {
          this.p = v;
        }}) + ":" + pas.SysUtils.TIntegerHelper.ToString$1.call({p: ACell.GetRow(), get: function () {
          return this.p;
        }, set: function (v) {
          this.p = v;
        }}) + " cannot be split.",pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridLogMessageType.glmWarning);
    };
    this.SwapCells = function (AFromCell, AToCell) {
      this.SwapCellData(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(AFromCell),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(AToCell),$mod.TTMSFNCDataGridDataSwapDirection.gswdBoth);
    };
    this.SwapColumn = function (AFromColumn, AToColumn) {
      if (this.CanSwapColumn(AFromColumn,AToColumn)) {
        this.BeginUpdate();
        try {
          this.SwapColumnData(AFromColumn,AToColumn);
        } finally {
          this.EndUpdate();
        };
      } else this.LogMessage("Columns [" + pas.SysUtils.TIntegerHelper.ToString$1.call({get: function () {
          return AFromColumn;
        }, set: function (v) {
          AFromColumn = v;
        }}) + ", " + pas.SysUtils.TIntegerHelper.ToString$1.call({get: function () {
          return AToColumn;
        }, set: function (v) {
          AToColumn = v;
        }}) + "] cannot be swapped.",pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridLogMessageType.glmWarning);
    };
    this.SwapRow = function (AFromRow, AToRow) {
      if (this.CanSwapRow(AFromRow,AToRow)) {
        this.BeginUpdate();
        try {
          this.SwapRowData(AFromRow,AToRow);
        } finally {
          this.EndUpdate();
        };
      } else this.LogMessage("Rows [" + pas.SysUtils.TIntegerHelper.ToString$1.call({get: function () {
          return AFromRow;
        }, set: function (v) {
          AFromRow = v;
        }}) + ", " + pas.SysUtils.TIntegerHelper.ToString$1.call({get: function () {
          return AToRow;
        }, set: function (v) {
          AToRow = v;
        }}) + "] cannot be swapped.",pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridLogMessageType.glmWarning);
    };
    this.ToggleNode = function (ARow) {
      if (!this.IsRowNode(ARow)) {
        this.LogMessage("Row " + pas.SysUtils.TIntegerHelper.ToString$1.call({get: function () {
            return ARow;
          }, set: function (v) {
            ARow = v;
          }}) + " cannot be toggled.",pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridLogMessageType.glmInfo);
        return;
      };
      if (this.GetRowNodeState(ARow) === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowNodeState.grnsCollapsed) {
        this.ExpandNode(ARow)}
       else this.CollapseNode(ARow);
    };
    this.Ungroup = function () {
      var $Self = this;
      var I = 0;
      var l = null;
      var cl = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var R = 0;
      function AddGroups(AGroupDictionary) {
        var k = "";
        var $in = AGroupDictionary.GetKeys().GetEnumerator$1();
        try {
          while ($in.MoveNext$1()) {
            k = $in.GetCurrent();
            l.Add(AGroupDictionary.GetItem(k).FRow);
            if (AGroupDictionary.GetItem(k).FSummaryRow !== -1) l.Add(AGroupDictionary.GetItem(k).FSummaryRow);
            AddGroups(AGroupDictionary.GetItem(k).GetGroupDictionary());
          }
        } finally {
          $in = rtl.freeLoc($in)
        };
      };
      var $ir = rtl.createIntfRefs();
      try {
        if (this.GetGroupDictionary().GetCount() === 0) {
          this.LogMessage("No Grouping active, please group first.",pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridLogMessageType.glmInfo);
          return;
        };
        this.BeginUpdate();
        this.FUpdateGrouping += 1;
        l = pas["Generics.Collections"].TList$$$G$$generics$collections$$Longint.$create("Create$1");
        try {
          AddGroups(this.GetGroupDictionary());
          l.Sort$1($ir.ref(1,pas["Generics.Defaults"].TComparer$$$G$$generics$defaults$$Longint.Construct(function (V1, V2) {
            var Result = 0;
            Result = pas.Math.CompareValue(V1,V2) * -1;
            return Result;
          })));
          var $in = l.GetEnumerator$1();
          try {
            while ($in.MoveNext()) {
              I = $in.DoGetCurrent();
              cl.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(this.FFixedColumnCount,I));
              if (this.IsCellMerged(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cl))) this.SplitCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cl));
              for (var $l = I + 1, $end = I + this.GetRowNodeChildCount(I); $l <= $end; $l++) {
                R = $l;
                this.SetRowNodeLevel(R,0);
                this.SetRowNodeState(R,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowNodeState.grnsExpanded);
                this.UnhideRow(R);
              };
              this.InternalDeleteRows(I,1);
            }
          } finally {
            $in = rtl.freeLoc($in)
          };
          this.UnhideAllColumns();
          this.GetGroupDictionary().Clear();
        } finally {
          this.FGroupInfo.$assign($mod.DefaultGroupInfo());
          this.FUpdateGrouping -= 1;
          l = rtl.freeLoc(l);
          this.EndUpdate();
        };
      } finally {
        $ir.free();
      };
    };
    this.UpdateCalculations = function () {
      this.BeginUpdate();
      try {
        this.UpdateColumnCalculations();
        this.UpdateRowCalculations();
      } finally {
        this.EndUpdate();
      };
    };
    this.UpdateColumnCalculation = function (AColumn, AName) {
      var cma = [];
      var cmau = [];
      var I = 0;
      var l = null;
      var d = null;
      if (this.GetHasColumnCalculation(AColumn,AName)) {
        cma = rtl.arrayRef(this.GetColumnCalculation(AColumn,AName));
        d = $mod.TTMSFNCDataGridDataColumnCalculationDictionary.$create("Create$5",[rtl.createSet(pas["Generics.Collections"].TDictionaryOwnership.doOwnsValues)]);
        try {
          cmau = rtl.arraySetLength(cmau,$mod.TTMSFNCDataGridDataColumnCalculation,0);
          for (var $l = 0, $end = rtl.length(cma) - 1; $l <= $end; $l++) {
            I = $l;
            if (cma[I].Type === $mod.TTMSFNCDataGridDataColumnCalculationType.gctNormal) {
              cmau = rtl.arraySetLength(cmau,$mod.TTMSFNCDataGridDataColumnCalculation,rtl.length(cmau) + 1);
              cmau[rtl.length(cmau) - 1].$assign(cma[I]);
            };
          };
          if (rtl.length(cmau) > 0) {
            l = pas["Generics.Collections"].TDictionary$$$G$$generics$collections$$String$$TTMSFNCDataGridDataColumnCalculationArray.$create("Create$1",[0]);
            l.AddOrSetValue(AName,cmau);
            d.AddOrSetValue(AColumn,l);
            this.InternalColumnCalculation(d,null,0);
          };
          d.Clear();
          cmau = rtl.arraySetLength(cmau,$mod.TTMSFNCDataGridDataColumnCalculation,0);
          for (var $l1 = 0, $end1 = rtl.length(cma) - 1; $l1 <= $end1; $l1++) {
            I = $l1;
            if (cma[I].Type === $mod.TTMSFNCDataGridDataColumnCalculationType.gctGroup) {
              cmau = rtl.arraySetLength(cmau,$mod.TTMSFNCDataGridDataColumnCalculation,rtl.length(cmau) + 1);
              cmau[rtl.length(cmau) - 1].$assign(cma[I]);
            };
          };
          if (rtl.length(cmau) > 0) {
            l = pas["Generics.Collections"].TDictionary$$$G$$generics$collections$$String$$TTMSFNCDataGridDataColumnCalculationArray.$create("Create$1",[0]);
            l.AddOrSetValue(AName,cmau);
            d.AddOrSetValue(AColumn,l);
            this.InternalGroupCalculation$1(this.GetGroupDictionary(),d,0);
          };
        } finally {
          d = rtl.freeLoc(d);
        };
      };
    };
    this.UpdateColumnCalculations = function () {
      var k = 0;
      var I = "";
      var l = null;
      this.BeginUpdate();
      try {
        var $in = this.GetColumnCalculationDictionary().GetKeys().GetEnumerator$1();
        try {
          while ($in.MoveNext$1()) {
            k = $in.GetCurrent();
            l = this.GetColumnCalculationDictionary().GetItem(k);
            if (l != null) {
              var $in1 = l.GetKeys().GetEnumerator$1();
              try {
                while ($in1.MoveNext$1()) {
                  I = $in1.GetCurrent();
                  this.UpdateColumnCalculation(k,I);
                }
              } finally {
                $in1 = rtl.freeLoc($in1)
              };
            };
          }
        } finally {
          $in = rtl.freeLoc($in)
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.UpdateRowCalculation = function (ARow, AName) {
      var cma = [];
      var l = null;
      var d = null;
      if (this.GetHasRowCalculation(ARow,AName)) {
        cma = rtl.arrayRef(this.GetRowCalculation(ARow,AName));
        d = $mod.TTMSFNCDataGridDataRowCalculationDictionary.$create("Create$5",[rtl.createSet(pas["Generics.Collections"].TDictionaryOwnership.doOwnsValues)]);
        l = pas["Generics.Collections"].TDictionary$$$G$$generics$collections$$String$$TTMSFNCDataGridDataRowCalculationArray.$create("Create$1",[0]);
        try {
          l.AddOrSetValue(AName,cma);
          d.AddOrSetValue(ARow,l);
          this.InternalRowCalculation(d);
        } finally {
          d = rtl.freeLoc(d);
        };
      };
    };
    this.UpdateRowCalculations = function () {
      var k = 0;
      var I = "";
      var l = null;
      this.BeginUpdate();
      try {
        var $in = this.GetRowCalculationDictionary().GetKeys().GetEnumerator$1();
        try {
          while ($in.MoveNext$1()) {
            k = $in.GetCurrent();
            l = this.GetRowCalculationDictionary().GetItem(k);
            if (l != null) {
              var $in1 = l.GetKeys().GetEnumerator$1();
              try {
                while ($in1.MoveNext$1()) {
                  I = $in1.GetCurrent();
                  this.UpdateRowCalculation(k,I);
                }
              } finally {
                $in1 = rtl.freeLoc($in1)
              };
            };
          }
        } finally {
          $in = rtl.freeLoc($in)
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.QuickSort$$$G$$WEBLib$TMSFNCDataGridData$$TTMSFNCDataGridDataSortInfo = function (Values, Comparer, L, R, SwapMethod) {
      var I = 0;
      var J = 0;
      var K = 0;
      var pivot = $mod.TTMSFNCDataGridDataSortInfo.$new();
      if (L < R) {
        do {
          if ((R - L) === 1) {
            if (Comparer.Compare(Values.get()[L],Values.get()[R]) > 0) SwapMethod(Values,L,R);
            break;
          };
          I = L;
          J = R;
          K = L + ((R - L) >>> 1);
          pivot.$assign(Values.get()[K]);
          do {
            while (Comparer.Compare(Values.get()[I],pivot) < 0) I += 1;
            while (Comparer.Compare(Values.get()[J],pivot) > 0) J -= 1;
            if (I <= J) {
              if (I !== J) SwapMethod(Values,I,J);
              I += 1;
              J -= 1;
            };
          } while (!(I > J));
          if ((J - L) > (R - I)) {
            if (I < R) this.QuickSort$$$G$$WEBLib$TMSFNCDataGridData$$TTMSFNCDataGridDataSortInfo(Values,Comparer,I,R,SwapMethod);
            R = J;
          } else {
            if (L < J) this.QuickSort$$$G$$WEBLib$TMSFNCDataGridData$$TTMSFNCDataGridDataSortInfo(Values,Comparer,L,J,SwapMethod);
            L = I;
          };
        } while (!(L >= R));
      };
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderGrid,{ClearData: "DataClearData"});
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCCustomReadWriteIO);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("DataDictionary",1,$mod.$rtti["TTMSFNCDataGridDataDictionary"],"GetDataDictionary","");
    $r.addProperty("Filter",1,$mod.$rtti["TTMSFNCDataGridDataFilter"],"GetFilter","");
    $r.addProperty("GroupDictionary",1,$mod.$rtti["TTMSFNCDataGridDataGroupDictionary"],"GetGroupDictionary","");
    $r.addProperty("Options",2,$mod.$rtti["TTMSFNCDataGridDataOptions"],"FOptions","SetOptions");
  });
  this.CellValueToTValue = function (AValue) {
    var Result = pas.RTTI.TValue.$new();
    if (pas.System.Assigned(AValue)) {
      Result.$assign(pas.RTTI.TValue.FromJSValue(AValue))}
     else Result.$assign(pas.RTTI.TValue.Empty());
    return Result;
  };
  this.CreateColumnCalculation = function (AMethod, AType, ACalculationOptionsCallback, ACustomCalculationCallback, AFromRow, AToRow, AOutputRow) {
    var Result = $mod.TTMSFNCDataGridDataColumnCalculation.$new();
    Result.Type = AType;
    Result.OutputRow = AOutputRow;
    Result.Method = AMethod;
    Result.OptionsCallback = ACalculationOptionsCallback;
    Result.CustomCalculationCallback = ACustomCalculationCallback;
    Result.FromRow = AFromRow;
    Result.ToRow = AToRow;
    return Result;
  };
  this.CreateCustomColumnCalculation = function (ACustomCalculationCallback, AFromRow, AToRow, AOutputRow) {
    var Result = $mod.TTMSFNCDataGridDataColumnCalculation.$new();
    Result.$assign($mod.CreateColumnCalculation($mod.TTMSFNCDataGridDataCalculationMethod.gcmCustom,$mod.TTMSFNCDataGridDataColumnCalculationType.gctNormal,null,ACustomCalculationCallback,AFromRow,AToRow,AOutputRow));
    return Result;
  };
  this.CreateCustomRowCalculation = function (ACustomCalculationCallback, AFromColumn, AToColumn, AOutputColumn) {
    var Result = $mod.TTMSFNCDataGridDataRowCalculation.$new();
    Result.$assign($mod.CreateRowCalculation($mod.TTMSFNCDataGridDataCalculationMethod.gcmCustom,null,ACustomCalculationCallback,AFromColumn,AToColumn,AOutputColumn));
    return Result;
  };
  this.CreateGroupAndSortInfo = function (AColumnsLevel0, ASortColumnsLevel0) {
    var Result = $mod.TTMSFNCDataGridDataGroupInfo.$new();
    Result.$assign($mod.DefaultGroupInfo());
    Result.Columns = rtl.arrayRef(AColumnsLevel0);
    Result.SortColumns = rtl.arrayRef(ASortColumnsLevel0);
    return Result;
  };
  this.CreateGroupAndSortInfo$1 = function (AColumnsLevel0, ASortColumnsLevel0, AColumnsLevel1, ASortColumnsLevel1) {
    var Result = $mod.TTMSFNCDataGridDataGroupInfo.$new();
    Result.$assign($mod.DefaultGroupInfo());
    Result.Columns = rtl.arrayRef(AColumnsLevel0);
    Result.SortColumns = rtl.arrayRef(ASortColumnsLevel0);
    Result.SubColumns = rtl.arraySetLength(Result.SubColumns,$mod.TTMSFNCDataGridDataGroupInfo,1);
    Result.SubColumns[0].Columns = rtl.arrayRef(AColumnsLevel1);
    Result.SubColumns[0].SortColumns = rtl.arrayRef(ASortColumnsLevel1);
    return Result;
  };
  this.CreateGroupAndSortInfo$2 = function (AColumnsLevel0, ASortColumnsLevel0, AColumnsLevel1, ASortColumnsLevel1, AColumnsLevel2, ASortColumnsLevel2) {
    var Result = $mod.TTMSFNCDataGridDataGroupInfo.$new();
    Result.$assign($mod.DefaultGroupInfo());
    Result.Columns = rtl.arrayRef(AColumnsLevel0);
    Result.SortColumns = rtl.arrayRef(ASortColumnsLevel0);
    Result.SubColumns = rtl.arraySetLength(Result.SubColumns,$mod.TTMSFNCDataGridDataGroupInfo,1);
    Result.SubColumns[0].Columns = rtl.arrayRef(AColumnsLevel1);
    Result.SubColumns[0].SortColumns = rtl.arrayRef(ASortColumnsLevel1);
    Result.SubColumns[0].SubColumns = rtl.arraySetLength(Result.SubColumns[0].SubColumns,$mod.TTMSFNCDataGridDataGroupInfo,1);
    Result.SubColumns[0].SubColumns[0].Columns = rtl.arrayRef(AColumnsLevel2);
    Result.SubColumns[0].SubColumns[0].SortColumns = rtl.arrayRef(ASortColumnsLevel2);
    return Result;
  };
  this.CreateGroupColumnCalculation = function (AMethod, ACalculationOptionsCallback, ACustomCalculationCallback, AFromRow, AToRow, AOutputRow) {
    var Result = $mod.TTMSFNCDataGridDataColumnCalculation.$new();
    Result.$assign($mod.CreateColumnCalculation(AMethod,$mod.TTMSFNCDataGridDataColumnCalculationType.gctGroup,ACalculationOptionsCallback,ACustomCalculationCallback,AFromRow,AToRow,AOutputRow));
    return Result;
  };
  this.CreateGroupInfo = function (AColumnsLevel0) {
    var Result = $mod.TTMSFNCDataGridDataGroupInfo.$new();
    Result.$assign($mod.DefaultGroupInfo());
    Result.Columns = rtl.arrayRef(AColumnsLevel0);
    return Result;
  };
  this.CreateGroupInfo$1 = function (AColumnsLevel0, AColumnsLevel1) {
    var Result = $mod.TTMSFNCDataGridDataGroupInfo.$new();
    Result.$assign($mod.DefaultGroupInfo());
    Result.Columns = rtl.arrayRef(AColumnsLevel0);
    Result.SubColumns = rtl.arraySetLength(Result.SubColumns,$mod.TTMSFNCDataGridDataGroupInfo,1);
    Result.SubColumns[0].Columns = rtl.arrayRef(AColumnsLevel1);
    return Result;
  };
  this.CreateGroupInfo$2 = function (AColumnsLevel0, AColumnsLevel1, AColumnsLevel2) {
    var Result = $mod.TTMSFNCDataGridDataGroupInfo.$new();
    Result.$assign($mod.DefaultGroupInfo());
    Result.Columns = rtl.arrayRef(AColumnsLevel0);
    Result.SubColumns = rtl.arraySetLength(Result.SubColumns,$mod.TTMSFNCDataGridDataGroupInfo,1);
    Result.SubColumns[0].Columns = rtl.arrayRef(AColumnsLevel1);
    Result.SubColumns[0].SubColumns = rtl.arraySetLength(Result.SubColumns[0].SubColumns,$mod.TTMSFNCDataGridDataGroupInfo,1);
    Result.SubColumns[0].SubColumns[0].Columns = rtl.arrayRef(AColumnsLevel2);
    return Result;
  };
  this.CreateNormalColumnCalculation = function (AMethod, ACalculationOptionsCallback, ACustomCalculationCallback, AFromRow, AToRow, AOutputRow) {
    var Result = $mod.TTMSFNCDataGridDataColumnCalculation.$new();
    Result.$assign($mod.CreateColumnCalculation(AMethod,$mod.TTMSFNCDataGridDataColumnCalculationType.gctNormal,ACalculationOptionsCallback,ACustomCalculationCallback,AFromRow,AToRow,AOutputRow));
    return Result;
  };
  this.CreateRowCalculation = function (AMethod, ACalculationOptionsCallback, ACustomCalculationCallback, AFromColumn, AToColumn, AOutputColumn) {
    var Result = $mod.TTMSFNCDataGridDataRowCalculation.$new();
    Result.OutputColumn = AOutputColumn;
    Result.Method = AMethod;
    Result.OptionsCallback = ACalculationOptionsCallback;
    Result.CustomCalculationCallback = ACustomCalculationCallback;
    Result.FromColumn = AFromColumn;
    Result.ToColumn = AToColumn;
    return Result;
  };
  this.DefaultColumnCalculationOptions = function () {
    var Result = $mod.TTMSFNCDataGridDataColumnCalculationOptions.$new();
    Result.MergeSummary = false;
    Result.SummaryInHeader = false;
    Result.CalculationFormat = "%g";
    Result.CalculationFormatType = $mod.TTMSFNCDataGridDataCalculationFormatType.gcfNumber;
    return Result;
  };
  this.DefaultFormatting = function () {
    var Result = $mod.TTMSFNCDataGridDataFormatting.$new();
    Result.Format = "";
    Result.Type = $mod.TTMSFNCDataGridDataFormattingType.gdftDefault;
    Result.BooleanTrueText = "";
    Result.BooleanFalseText = "";
    return Result;
  };
  this.DefaultGroupInfo = function () {
    var Result = $mod.TTMSFNCDataGridDataGroupInfo.$new();
    Result.Columns = [];
    Result.SubColumns = [];
    Result.SortColumns = [];
    Result.SortDirections = [];
    return Result;
  };
  this.DefaultGroupOptions = function () {
    var Result = $mod.TTMSFNCDataGridDataGroupOptions.$new();
    Result.Summary = true;
    Result.SummaryInHeader = false;
    Result.MergeSummary = false;
    Result.MergeHeader = true;
    Result.MergeDelimiter = " ; ";
    Result.HideColumns = false;
    Result.UseFirstRowAsHeader = true;
    Result.HeaderHeight = 30;
    Result.SummaryHeight = 30;
    Result.AutoSort = true;
    return Result;
  };
  this.DefaultIOOptions = function () {
    var Result = $mod.TTMSFNCDataGridDataInputOutputOptions.$new();
    Result.Delimiter = "\x00";
    Result.StartColumn = 0;
    Result.StartRow = 0;
    Result.MaxRows = -1;
    Result.AlwaysQuotes = false;
    Result.QuoteEmptyCells = true;
    Result.TrimSpaces = false;
    return Result;
  };
  this.DefaultRowCalculationOptions = function () {
    var Result = $mod.TTMSFNCDataGridDataRowCalculationOptions.$new();
    Result.CalculationFormat = "%g";
    Result.CalculationFormatType = $mod.TTMSFNCDataGridDataCalculationFormatType.gcfNumber;
    return Result;
  };
  this.DefaultSortOptions = function () {
    var Result = $mod.TTMSFNCDataGridDataSortOptions.$new();
    Result.Direction = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortDirection.gsdAscending;
    Result.CaseSensitive = true;
    Result.Format = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortFormat.gsfAutomatic;
    Result.FormatSettings.$assign(pas.SysUtils.FormatSettings);
    return Result;
  };
  this.GetObjectValue = function (AObject, AProperty) {
    var Result = undefined;
    var AContext = pas.RTTI.TRTTIContext.$new();
    var rt = null;
    var prop = null;
    var prop2 = null;
    var propv = pas.RTTI.TValue.$new();
    var prop2v = pas.RTTI.TValue.$new();
    var idx = 0;
    var sl = null;
    var s = "";
    if (!(AObject != null)) {
      Result = $mod.TValueToCellValue(pas.RTTI.TValue.$clone(pas.RTTI.TValue.Empty()));
      return Result;
    };
    AContext.$assign(pas.RTTI.TRTTIContext.Create());
    try {
      propv.$assign(pas.RTTI.TValue.Empty());
      rt = AContext.GetType(AObject.$class.ClassInfo());
      if (AProperty !== "") {
        prop = rt.GetProperty(AProperty);
        if ((prop != null) && prop.GetIsReadable()) {
          propv.$assign(prop.GetValue(AObject));
          Result = $mod.TValueToCellValue(pas.RTTI.TValue.$clone(propv));
        };
        return Result;
      };
      prop = rt.GetProperty("Value");
      if (!(prop != null)) prop = rt.GetProperty("Position");
      if ((prop != null) && prop.GetIsReadable()) {
        propv.$assign(prop.GetValue(AObject));
        Result = $mod.TValueToCellValue(pas.RTTI.TValue.$clone(propv));
        return Result;
      };
      prop = rt.GetProperty("Date");
      if (!(prop != null)) prop = rt.GetProperty("SelectedDate");
      if ((prop != null) && prop.GetIsReadable()) {
        propv.$assign(prop.GetValue(AObject));
        Result = $mod.TValueToCellValue(pas.RTTI.TValue.$clone(propv));
        return Result;
      };
      prop = rt.GetProperty("SelectedColor");
      if ((prop != null) && prop.GetIsReadable()) {
        propv.$assign(prop.GetValue(AObject));
        Result = $mod.TValueToCellValue(pas.RTTI.TValue.$clone(propv));
        return Result;
      };
      prop = rt.GetProperty("ItemIndex");
      prop2 = rt.GetProperty("Items");
      if ((prop != null) && prop.GetIsReadable()) {
        propv.$assign(prop.GetValue(AObject));
        if ((prop2 != null) && prop2.GetIsReadable()) {
          prop2v.$assign(prop2.GetValue(AObject));
          if (prop2v.IsType$1$$$G$$rtti$$TStrings(true) && propv.IsType$1$$$G$$rtti$$Longint(true)) {
            idx = propv.AsInteger();
            sl = prop2v.AsType$$$G$$rtti$$TStrings();
            if ((idx >= 0) && (idx <= (sl.GetCount() - 1))) {
              s = sl.Get(idx)}
             else s = "";
            Result = s;
            return Result;
          };
        };
      };
      prop = rt.GetProperty("Checked");
      if ((prop != null) && prop.GetIsReadable()) {
        propv.$assign(prop.GetValue(AObject));
        Result = $mod.TValueToCellValue(pas.RTTI.TValue.$clone(propv));
        return Result;
      };
      prop = rt.GetProperty("Text");
      if ((prop != null) && prop.GetIsReadable()) {
        propv.$assign(prop.GetValue(AObject));
        Result = $mod.TValueToCellValue(pas.RTTI.TValue.$clone(propv));
        return Result;
      };
    } finally {
      AContext.Free();
    };
    return Result;
  };
  this.TValueToCellValue = function (AValue) {
    var Result = undefined;
    Result = AValue.AsJSValue();
    return Result;
  };
  this.SetObjectValue = function (AObject, AValue, AProperty) {
    var AContext = pas.RTTI.TRTTIContext.$new();
    var rt = null;
    var prop = null;
    var prop2 = null;
    var propv2 = pas.RTTI.TValue.$new();
    var sl = null;
    var idx = 0;
    var val = pas.RTTI.TValue.$new();
    var i = 0;
    var d = 0.0;
    var b = false;
    var cl = 0;
    var v = "";
    var s = "";
    var dt = 0.0;
    var fmt = pas.SysUtils.TFormatSettings.$new();
    if (!(AObject != null)) return;
    fmt.$assign(pas.SysUtils.FormatSettings);
    AContext.$assign(pas.RTTI.TRTTIContext.Create());
    try {
      rt = AContext.GetType(AObject.$class.ClassInfo());
      if (AProperty !== "") {
        prop = rt.GetProperty(AProperty);
        if ((prop != null) && prop.GetIsWritable()) prop.SetValue(AObject,$mod.CellValueToTValue(AValue));
        return;
      };
      prop = rt.GetProperty("ItemIndex");
      prop2 = rt.GetProperty("Items");
      if ((prop != null) && prop.GetIsWritable()) {
        if ((prop2 != null) && prop2.GetIsWritable()) {
          propv2.$assign(prop2.GetValue(AObject));
          if (propv2.IsType$1$$$G$$rtti$$TStrings(true)) {
            sl = propv2.AsType$$$G$$rtti$$TStrings();
            idx = sl.IndexOf($mod.TTMSFNCDataGridData.ValueToString$1(AValue,pas.SysUtils.TFormatSettings.$clone(fmt)));
            val.$assign($mod.CellValueToTValue(idx));
            prop.SetValue(AObject,val);
          };
        } else {
          if (prop.GetValue(AObject).IsType$1$$$G$$rtti$$Longint(true)) {
            i = $mod.TTMSFNCDataGridData.ValueToInteger$1(AValue,pas.SysUtils.TFormatSettings.$clone(fmt));
            val.$assign($mod.CellValueToTValue(i));
            prop.SetValue(AObject,val);
          };
        };
        return;
      };
      prop = rt.GetProperty("Value");
      if (!(prop != null)) prop = rt.GetProperty("Position");
      if ((prop != null) && prop.GetIsWritable()) {
        if (prop.GetValue(AObject).IsType$1$$$G$$rtti$$Longint(true)) {
          i = $mod.TTMSFNCDataGridData.ValueToInteger$1(AValue,pas.SysUtils.TFormatSettings.$clone(fmt));
          val.$assign($mod.CellValueToTValue(i));
          prop.SetValue(AObject,val);
          return;
        } else if (prop.GetValue(AObject).IsType$1$$$G$$rtti$$Double(true)) {
          d = $mod.TTMSFNCDataGridData.ValueToFloat$1(AValue,pas.SysUtils.TFormatSettings.$clone(fmt));
          val.$assign($mod.CellValueToTValue(d));
          prop.SetValue(AObject,val);
          return;
        } else if (prop.GetValue(AObject).IsType$1$$$G$$rtti$$String(true)) {
          s = $mod.TTMSFNCDataGridData.ValueToString$1(AValue,pas.SysUtils.TFormatSettings.$clone(fmt));
          val.$assign($mod.CellValueToTValue(s));
          prop.SetValue(AObject,val);
        };
      };
      prop = rt.GetProperty("Date");
      if (!(prop != null)) prop = rt.GetProperty("SelectedDate");
      if ((prop != null) && prop.GetIsWritable() && prop.GetValue(AObject).IsType$1$$$G$$rtti$$Double(true)) {
        dt = $mod.TTMSFNCDataGridData.ValueToDateTime$1(AValue,pas.SysUtils.TFormatSettings.$clone(fmt));
        val.$assign($mod.CellValueToTValue(dt));
        prop.SetValue(AObject,val);
        return;
      };
      prop = rt.GetProperty("SelectedColor");
      if ((prop != null) && prop.GetIsWritable() && prop.GetValue(AObject).IsType$1$$$G$$rtti$$NativeInt(true)) {
        cl = $mod.TTMSFNCDataGridData.ValueToInt64$1(AValue,pas.SysUtils.TFormatSettings.$clone(fmt));
        val.$assign($mod.CellValueToTValue(cl));
        prop.SetValue(AObject,val);
        return;
      };
      prop = rt.GetProperty("Checked");
      if ((prop != null) && prop.GetIsWritable()) {
        b = $mod.TTMSFNCDataGridData.ValueToBoolean$1(AValue,pas.SysUtils.TFormatSettings.$clone(fmt));
        val.$assign($mod.CellValueToTValue(b));
        prop.SetValue(AObject,val);
        return;
      };
      prop = rt.GetProperty("Text");
      if ((prop != null) && prop.GetIsWritable()) {
        v = $mod.TTMSFNCDataGridData.ValueToString$1(AValue,pas.SysUtils.TFormatSettings.$clone(fmt));
        val.$assign($mod.CellValueToTValue(v));
        prop.SetValue(AObject,val);
        return;
      };
    } finally {
      AContext.Free();
    };
  };
  this.StripFilterCondition = function (ACondition, AValue, AType) {
    AValue.set(ACondition);
    if (pas.System.Pos('"',AValue.get()) > 0) {
      AType.set($mod.TTMSFNCDataGridDataFilterType.gftEqual)}
     else {
      if (AValue.get() === "") {
        AType.set($mod.TTMSFNCDataGridDataFilterType.gftEmpty)}
       else if (AValue.get() === "!") {
        AType.set($mod.TTMSFNCDataGridDataFilterType.gftNotEmpty)}
       else if (pas.SysUtils.TStringHelper.StartsWith.call(AValue,"*") && pas.SysUtils.TStringHelper.EndsWith.call(AValue,"*")) {
        AType.set($mod.TTMSFNCDataGridDataFilterType.gftContains)}
       else if (pas.SysUtils.TStringHelper.StartsWith.call(AValue,"!*") && pas.SysUtils.TStringHelper.EndsWith.call(AValue,"*")) {
        AType.set($mod.TTMSFNCDataGridDataFilterType.gftNotContains)}
       else if (pas.SysUtils.TStringHelper.StartsWith.call(AValue,"*")) {
        AType.set($mod.TTMSFNCDataGridDataFilterType.gftEndsWith)}
       else if (pas.SysUtils.TStringHelper.EndsWith.call(AValue,"*")) {
        AType.set($mod.TTMSFNCDataGridDataFilterType.gftStartsWith)}
       else if (pas.SysUtils.TStringHelper.StartsWith.call(AValue,"!")) {
        AType.set($mod.TTMSFNCDataGridDataFilterType.gftNotEqual)}
       else if (pas.SysUtils.TStringHelper.StartsWith.call(AValue,">=")) {
        AType.set($mod.TTMSFNCDataGridDataFilterType.gftLargerOrEqualThan)}
       else if (pas.SysUtils.TStringHelper.StartsWith.call(AValue,"<=")) {
        AType.set($mod.TTMSFNCDataGridDataFilterType.gftSmallerOrEqualThan)}
       else if (pas.SysUtils.TStringHelper.StartsWith.call(AValue,">")) {
        AType.set($mod.TTMSFNCDataGridDataFilterType.gftLargerThan)}
       else if (pas.SysUtils.TStringHelper.StartsWith.call(AValue,"<")) {
        AType.set($mod.TTMSFNCDataGridDataFilterType.gftSmallerThan)}
       else AType.set($mod.TTMSFNCDataGridDataFilterType.gftEqual);
      AValue.set(pas.SysUtils.StringReplace(AValue.get(),"!","",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll)));
      AValue.set(pas.SysUtils.StringReplace(AValue.get(),">","",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll)));
      AValue.set(pas.SysUtils.StringReplace(AValue.get(),"<","",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll)));
      AValue.set(pas.SysUtils.StringReplace(AValue.get(),"*","",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll)));
      AValue.set(pas.SysUtils.StringReplace(AValue.get(),"=","",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll)));
    };
    AValue.set(pas.SysUtils.Trim(AValue.get()));
  };
  this.$rtti.$RefToProcVar("TTMSFNCDataGridDataSortSwapMethod<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataSortInfo>",{procsig: rtl.newTIProcSig([["Values",pas.System.$rtti["TArray<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataSortInfo>"],1],["L",rtl.longint],["R",rtl.longint]])});
  $mod.$resourcestrings = {sTMSFNCDataGridDataFilterActionsError: {org: "The selected filtering actions are only possible when LoadMode = almAllRecords"}, sTMSFNCDataGridDataGroupingError: {org: "Grouping is only possible when LoadMode = almAllRecords."}, sTMSFNCDataGridDataEmptyFileError: {org: "File is empty"}, sTMSFNCDataGridDataCorruptFileError: {org: "File contains no data or corrupt file"}};
  $mod.$implcode = function () {
    $impl.TTMSFNCDataGridDataInternalSortFormat = {"0": "gisfAlphabetic", gisfAlphabetic: 0, "1": "gisfNumericFloat", gisfNumericFloat: 1, "2": "gisfNumericInteger", gisfNumericInteger: 2, "3": "gisfDateTime", gisfDateTime: 3, "4": "gisfBoolean", gisfBoolean: 4, "5": "gisfCustom", gisfCustom: 5};
    $mod.$rtti.$Enum("TTMSFNCDataGridDataInternalSortFormat",{minvalue: 0, maxvalue: 5, ordtype: 1, enumtype: $impl.TTMSFNCDataGridDataInternalSortFormat});
    rtl.createHelper($impl,"TJSNodeListHelper",null,function () {
      this.FindNode = function (ANodeName) {
        var Result = null;
        var Index = 0;
        Index = $impl.TJSNodeListHelper.IndexOf.call(this,ANodeName);
        if (Index >= 0) {
          Result = this.item(Index)}
         else Result = null;
        return Result;
      };
      this.IndexOf = function (Name) {
        var Result = 0;
        var n = null;
        for (var $l = 0, $end = $impl.TJSNodeListHelper.GetCount.call(this) - 1; $l <= $end; $l++) {
          Result = $l;
          n = this.item(Result);
          if (n.nodeName === Name) return Result;
        };
        Result = -1;
        return Result;
      };
      this.GetCount = function () {
        var Result = 0;
        Result = this.length;
        return Result;
      };
    });
    $mod.$rtti.$StaticArray("EnglishShortDayNames$a",{dims: [7], eltype: rtl.string});
    $impl.EnglishShortDayNames = ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];
    $mod.$rtti.$StaticArray("EnglishLongDayNames$a",{dims: [7], eltype: rtl.string});
    $impl.EnglishLongDayNames = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
    $mod.$rtti.$StaticArray("EnglishShortMonthNames$a",{dims: [12], eltype: rtl.string});
    $impl.EnglishShortMonthNames = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
    $mod.$rtti.$StaticArray("EnglishLongMonthNames$a",{dims: [12], eltype: rtl.string});
    $impl.EnglishLongMonthNames = ["January","February","March","April","May","June","July","August","September","October","November","December"];
    $impl.CleanupSep = function (value) {
      var Result = "";
      var i = 0;
      var s = "";
      s = "";
      for (var $l = 1, $end = value.length; $l <= $end; $l++) {
        i = $l;
        if (value.charAt(i - 1) === pas.SysUtils.FormatSettings.ThousandSeparator) continue;
        if (value.charAt(i - 1) === pas.SysUtils.FormatSettings.DecimalSeparator) {
          s = s + "."}
         else s = s + value.charAt(i - 1);
      };
      Result = s;
      return Result;
    };
    $impl.GetColumnCalculations = function (AColumns, AOutputRow, AFromRow, AToRow, AMethod, AType, ACalculationOptionsCallback, ACustomCalculationCallback) {
      var Result = null;
      var I = 0;
      var l = null;
      Result = $mod.TTMSFNCDataGridDataColumnCalculationDictionary.$create("Create$5",[rtl.createSet(pas["Generics.Collections"].TDictionaryOwnership.doOwnsValues)]);
      for (var $l = 0, $end = rtl.length(AColumns) - 1; $l <= $end; $l++) {
        I = $l;
        l = pas["Generics.Collections"].TDictionary$$$G$$generics$collections$$String$$TTMSFNCDataGridDataColumnCalculationArray.$create("Create$1",[0]);
        l.AddOrSetValue("ROOT",[$mod.TTMSFNCDataGridDataColumnCalculation.$clone($mod.CreateColumnCalculation(AMethod,AType,ACalculationOptionsCallback,ACustomCalculationCallback,AFromRow,AToRow,AOutputRow))]);
        Result.AddOrSetValue(AColumns[I],l);
      };
      return Result;
    };
    $impl.GetRowCalculations = function (ARows, AOutputColumn, AFromColumn, AToColumn, AMethod, ACalculationOptionsCallback, ACustomCalculationCallback) {
      var Result = null;
      var I = 0;
      var l = null;
      Result = $mod.TTMSFNCDataGridDataRowCalculationDictionary.$create("Create$5",[rtl.createSet(pas["Generics.Collections"].TDictionaryOwnership.doOwnsValues)]);
      for (var $l = 0, $end = rtl.length(ARows) - 1; $l <= $end; $l++) {
        I = $l;
        l = pas["Generics.Collections"].TDictionary$$$G$$generics$collections$$String$$TTMSFNCDataGridDataRowCalculationArray.$create("Create$1",[0]);
        l.AddOrSetValue("ROOT",[$mod.TTMSFNCDataGridDataRowCalculation.$clone($mod.CreateRowCalculation(AMethod,ACalculationOptionsCallback,ACustomCalculationCallback,AFromColumn,AToColumn,AOutputColumn))]);
        Result.AddOrSetValue(ARows[I],l);
      };
      return Result;
    };
    $impl.GetNextLine = function (s, multiline) {
      var Result = "";
      var vp = 0;
      vp = -1;
      if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos("\n",s.get(),{get: function () {
          return vp;
        }, set: function (v) {
          vp = v;
        }}) > 0) {
        Result = pas.System.Copy(s.get(),1,vp - 1);
        pas.System.Delete(s,1,vp);
        if (s.get() !== "") if (s.get().charAt(0) === "\n") pas.System.Delete(s,1,1);
        if (!multiline) s.set("");
      } else {
        Result = s.get();
        s.set("");
      };
      return Result;
    };
    $impl.FileToLF = function (s, multiline) {
      var Result = "";
      var i = 0;
      if (pas.System.Pos("\b",s) > 0) for (var $l = 1, $end = s.length; $l <= $end; $l++) {
        i = $l;
        if (s.charAt(i - 1) === "\t") s = rtl.setCharAt(s,i - 1,"\r");
        if (s.charAt(i - 1) === "\b") s = rtl.setCharAt(s,i - 1,"\n");
        if (s.charAt(i - 1) === "\x01") s = rtl.setCharAt(s,i - 1,"\x00");
      };
      if (!multiline) {
        Result = $impl.GetNextLine({get: function () {
            return s;
          }, set: function (v) {
            s = v;
          }},multiline)}
       else Result = s;
      return Result;
    };
    $impl.MStrToInt = function (s) {
      var Result = 0;
      var code = 0;
      var i = 0;
      pas.System.val$6(s,{get: function () {
          return i;
        }, set: function (v) {
          i = v;
        }},{get: function () {
          return code;
        }, set: function (v) {
          code = v;
        }});
      Result = i;
      return Result;
    };
    $impl.GetToken = function (s, separator) {
      var Result = "";
      var sp = 0;
      Result = "";
      sp = pas.System.Pos(separator,s.get());
      if (sp > 0) {
        Result = pas.System.Copy(s.get(),1,sp - 1);
        pas.System.Delete(s,1,sp);
      };
      return Result;
    };
  };
},["Math","Variants","DateUtils","WEBLib.TMSFNCUtils","WEBLib.TMSFNCGraphicsTypes","WEBLib.TMSFNCDataGridUtil","TypInfo","Web","JS","StrUtils"]);
rtl.module("WEBLib.TMSFNCScrollBar",["System","Classes","WEBLib.TMSFNCCustomControl","WEBLib.ExtCtrls","WEBLib.TMSFNCTypes","WEBLib.TMSFNCGraphics","WEBLib.Controls","WEBLib.TMSFNCGraphicsTypes"],function () {
  "use strict";
  var $mod = this;
  this.$rtti.$Class("TTMSFNCCustomScrollBar");
  rtl.createClass(this,"TTMSFNCScrollBarAppearance",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FOwner = null;
      this.FScrollButtonSize = 0.0;
      this.FThumbButtonSize = 0.0;
      this.FOnChange = null;
      this.FFixedThumb = false;
      this.FArrowColor = 0;
      this.FThumbStroke = null;
      this.FThumbButtonRightDownStroke = null;
      this.FThumbFill = null;
      this.FThumbButtonLeftFill = null;
      this.FScrollButtonLeftHoverFill = null;
      this.FScrollButtonLeftStroke = null;
      this.FScrollButtonRightFill = null;
      this.FThumbButtonLeftHoverFill = null;
      this.FThumbButtonLeftStroke = null;
      this.FScrollButtonLeftHoverStroke = null;
      this.FThumbButtonRightFill = null;
      this.FScrollButtonRightHoverFill = null;
      this.FScrollButtonRightStroke = null;
      this.FThumbButtonLeftHoverStroke = null;
      this.FScrollButtonLeftDownFill = null;
      this.FThumbButtonRightHoverFill = null;
      this.FThumbButtonRightStroke = null;
      this.FScrollButtonRightHoverStroke = null;
      this.FThumbButtonLeftDownFill = null;
      this.FScrollButtonLeftDownStroke = null;
      this.FThumbButtonRightHoverStroke = null;
      this.FScrollButtonRightDownFill = null;
      this.FThumbButtonLeftDownStroke = null;
      this.FThumbButtonRightDownFill = null;
      this.FScrollButtonRightDownStroke = null;
      this.FScrollButtonLeftFill = null;
    };
    this.$final = function () {
      this.FOwner = undefined;
      this.FOnChange = undefined;
      this.FThumbStroke = undefined;
      this.FThumbButtonRightDownStroke = undefined;
      this.FThumbFill = undefined;
      this.FThumbButtonLeftFill = undefined;
      this.FScrollButtonLeftHoverFill = undefined;
      this.FScrollButtonLeftStroke = undefined;
      this.FScrollButtonRightFill = undefined;
      this.FThumbButtonLeftHoverFill = undefined;
      this.FThumbButtonLeftStroke = undefined;
      this.FScrollButtonLeftHoverStroke = undefined;
      this.FThumbButtonRightFill = undefined;
      this.FScrollButtonRightHoverFill = undefined;
      this.FScrollButtonRightStroke = undefined;
      this.FThumbButtonLeftHoverStroke = undefined;
      this.FScrollButtonLeftDownFill = undefined;
      this.FThumbButtonRightHoverFill = undefined;
      this.FThumbButtonRightStroke = undefined;
      this.FScrollButtonRightHoverStroke = undefined;
      this.FThumbButtonLeftDownFill = undefined;
      this.FScrollButtonLeftDownStroke = undefined;
      this.FThumbButtonRightHoverStroke = undefined;
      this.FScrollButtonRightDownFill = undefined;
      this.FThumbButtonLeftDownStroke = undefined;
      this.FThumbButtonRightDownFill = undefined;
      this.FScrollButtonRightDownStroke = undefined;
      this.FScrollButtonLeftFill = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetThumbButtonSize = function (Value) {
      if (this.FThumbButtonSize !== Value) {
        this.FThumbButtonSize = Value;
        this.Changed();
      };
    };
    this.SetFixedThumb = function (Value) {
      if (this.FFixedThumb !== Value) {
        this.FFixedThumb = Value;
        this.Changed();
      };
    };
    this.SetArrowColor = function (Value) {
      if (this.FArrowColor !== Value) {
        this.FArrowColor = Value;
        this.Changed();
      };
    };
    this.SetScrollButtonLeftDownFill = function (Value) {
      this.FScrollButtonLeftDownFill.Assign(Value);
    };
    this.SetScrollButtonLeftDownStroke = function (Value) {
      this.FScrollButtonLeftDownStroke.Assign(Value);
    };
    this.SetScrollButtonLeftFill = function (Value) {
      this.FScrollButtonLeftFill.Assign(Value);
    };
    this.SetScrollButtonLeftHoverFill = function (Value) {
      this.FScrollButtonLeftHoverFill.Assign(Value);
    };
    this.SetScrollButtonLeftHoverStroke = function (Value) {
      this.FScrollButtonLeftHoverStroke.Assign(Value);
    };
    this.SetScrollButtonLeftStroke = function (Value) {
      this.FScrollButtonLeftStroke.Assign(Value);
    };
    this.SetScrollButtonRightDownFill = function (Value) {
      this.FScrollButtonRightDownFill.Assign(Value);
    };
    this.SetScrollButtonRightDownStroke = function (Value) {
      this.FScrollButtonRightDownStroke.Assign(Value);
    };
    this.SetScrollButtonRightFill = function (Value) {
      this.FScrollButtonRightFill.Assign(Value);
    };
    this.SetScrollButtonRightHoverFill = function (Value) {
      this.FScrollButtonRightHoverFill.Assign(Value);
    };
    this.SetScrollButtonRightHoverStroke = function (Value) {
      this.FScrollButtonRightHoverStroke.Assign(Value);
    };
    this.SetScrollButtonRightStroke = function (Value) {
      this.FScrollButtonRightStroke.Assign(Value);
    };
    this.SetScrollButtonSize = function (Value) {
      if (this.FScrollButtonSize !== Value) {
        this.FScrollButtonSize = Value;
        this.Changed();
      };
    };
    this.SetThumbButtonLeftDownFill = function (Value) {
      this.FThumbButtonLeftDownFill.Assign(Value);
    };
    this.SetThumbButtonLeftDownStroke = function (Value) {
      this.FThumbButtonLeftDownStroke.Assign(Value);
    };
    this.SetThumbButtonLeftFill = function (Value) {
      this.FThumbButtonLeftFill.Assign(Value);
    };
    this.SetThumbButtonLeftHoverFill = function (Value) {
      this.FThumbButtonLeftHoverFill.Assign(Value);
    };
    this.SetThumbButtonLeftHoverStroke = function (Value) {
      this.FThumbButtonLeftHoverStroke.Assign(Value);
    };
    this.SetThumbButtonLeftStroke = function (Value) {
      this.FThumbButtonLeftStroke.Assign(Value);
    };
    this.SetThumbButtonRightDownFill = function (Value) {
      this.FThumbButtonRightDownFill.Assign(Value);
    };
    this.SetThumbButtonRightDownStroke = function (Value) {
      this.FThumbButtonRightDownStroke.Assign(Value);
    };
    this.SetThumbButtonRightFill = function (Value) {
      this.FThumbButtonRightFill.Assign(Value);
    };
    this.SetThumbButtonRightHoverFill = function (Value) {
      this.FThumbButtonRightHoverFill.Assign(Value);
    };
    this.SetThumbButtonRightHoverStroke = function (Value) {
      this.FThumbButtonRightHoverStroke.Assign(Value);
    };
    this.SetThumbButtonRightStroke = function (Value) {
      this.FThumbButtonRightStroke.Assign(Value);
    };
    this.SetThumbFill = function (Value) {
      this.FThumbFill.Assign(Value);
    };
    this.SetThumbStroke = function (Value) {
      this.FThumbStroke.Assign(Value);
    };
    this.IsScrollButtonSizeStored = function () {
      var Result = false;
      Result = this.FScrollButtonSize !== 18;
      return Result;
    };
    this.IsThumbButtonSizeStored = function () {
      var Result = false;
      Result = this.FThumbButtonSize !== 18;
      return Result;
    };
    this.Changed = function () {
      this.FOwner.Changed();
    };
    this.FillChanged = function (Sender) {
      this.Changed();
    };
    this.StrokeChanged = function (Sender) {
      this.Changed();
    };
    this.Create$1 = function (AOwner) {
      this.FOwner = AOwner;
      this.FThumbFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(225,225,225),8421504,-1,-1]);
      this.FThumbFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FThumbButtonLeftFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(225,225,225),8421504,-1,-1]);
      this.FThumbButtonLeftFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FThumbButtonRightFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(225,225,225),8421504,-1,-1]);
      this.FThumbButtonRightFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FThumbButtonLeftHoverFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(229,241,251),8421504,-1,-1]);
      this.FThumbButtonLeftHoverFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FThumbButtonRightHoverFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(229,241,251),8421504,-1,-1]);
      this.FThumbButtonRightHoverFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FThumbButtonLeftDownFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,pas["WEBLib.TMSFNCGraphicsTypes"].Darker(pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(229,241,251),40),8421504,-1,-1]);
      this.FThumbButtonLeftDownFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FThumbButtonRightDownFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,pas["WEBLib.TMSFNCGraphicsTypes"].Darker(pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(229,241,251),40),8421504,-1,-1]);
      this.FThumbButtonRightDownFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FScrollButtonLeftFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(225,225,225),8421504,-1,-1]);
      this.FScrollButtonLeftFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FScrollButtonRightFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(225,225,225),8421504,-1,-1]);
      this.FScrollButtonRightFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FScrollButtonLeftHoverFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(229,241,251),8421504,-1,-1]);
      this.FScrollButtonLeftHoverFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FScrollButtonRightHoverFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(229,241,251),8421504,-1,-1]);
      this.FScrollButtonRightHoverFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FScrollButtonLeftDownFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,pas["WEBLib.TMSFNCGraphicsTypes"].Darker(pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(229,241,251),40),8421504,-1,-1]);
      this.FScrollButtonLeftDownFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FScrollButtonRightDownFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,pas["WEBLib.TMSFNCGraphicsTypes"].Darker(pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(229,241,251),40),8421504,-1,-1]);
      this.FScrollButtonRightDownFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FThumbStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,pas["WEBLib.TMSFNCGraphicsTypes"].Darker(11119017,40),1.0]);
      this.FThumbStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FThumbButtonLeftStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,pas["WEBLib.TMSFNCGraphicsTypes"].Darker(11119017,40),1.0]);
      this.FThumbButtonLeftStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FThumbButtonRightStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,pas["WEBLib.TMSFNCGraphicsTypes"].Darker(11119017,40),1.0]);
      this.FThumbButtonRightStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FThumbButtonLeftHoverStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(60,127,177),1.0]);
      this.FThumbButtonLeftHoverStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FThumbButtonRightHoverStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(60,127,177),1.0]);
      this.FThumbButtonRightHoverStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FThumbButtonLeftDownStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(60,127,177),1.0]);
      this.FThumbButtonLeftDownStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FThumbButtonRightDownStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(60,127,177),1.0]);
      this.FThumbButtonRightDownStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FScrollButtonLeftStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,pas["WEBLib.TMSFNCGraphicsTypes"].Darker(11119017,40),1.0]);
      this.FScrollButtonLeftStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FScrollButtonRightStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,pas["WEBLib.TMSFNCGraphicsTypes"].Darker(11119017,40),1.0]);
      this.FScrollButtonRightStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FScrollButtonLeftHoverStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(60,127,177),1.0]);
      this.FScrollButtonLeftHoverStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FScrollButtonRightHoverStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(60,127,177),1.0]);
      this.FScrollButtonRightHoverStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FScrollButtonLeftDownStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(60,127,177),1.0]);
      this.FScrollButtonLeftDownStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FScrollButtonRightDownStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(60,127,177),1.0]);
      this.FScrollButtonRightDownStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FArrowColor = 0;
      this.FFixedThumb = false;
      this.FThumbButtonSize = 18;
      this.FScrollButtonSize = 18;
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FThumbFill");
      rtl.free(this,"FScrollButtonLeftFill");
      rtl.free(this,"FScrollButtonRightFill");
      rtl.free(this,"FScrollButtonLeftHoverFill");
      rtl.free(this,"FScrollButtonRightHoverFill");
      rtl.free(this,"FScrollButtonLeftDownFill");
      rtl.free(this,"FScrollButtonRightDownFill");
      rtl.free(this,"FThumbButtonLeftFill");
      rtl.free(this,"FThumbButtonRightFill");
      rtl.free(this,"FThumbButtonLeftHoverFill");
      rtl.free(this,"FThumbButtonRightHoverFill");
      rtl.free(this,"FThumbButtonLeftDownFill");
      rtl.free(this,"FThumbButtonRightDownFill");
      rtl.free(this,"FThumbStroke");
      rtl.free(this,"FScrollButtonLeftStroke");
      rtl.free(this,"FScrollButtonRightStroke");
      rtl.free(this,"FScrollButtonLeftHoverStroke");
      rtl.free(this,"FScrollButtonRightHoverStroke");
      rtl.free(this,"FScrollButtonLeftDownStroke");
      rtl.free(this,"FScrollButtonRightDownStroke");
      rtl.free(this,"FThumbButtonLeftStroke");
      rtl.free(this,"FThumbButtonRightStroke");
      rtl.free(this,"FThumbButtonLeftHoverStroke");
      rtl.free(this,"FThumbButtonRightHoverStroke");
      rtl.free(this,"FThumbButtonLeftDownStroke");
      rtl.free(this,"FThumbButtonRightDownStroke");
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCScrollBarAppearance.isPrototypeOf(Source)) {
        this.FThumbFill.Assign(rtl.as(Source,$mod.TTMSFNCScrollBarAppearance).FThumbFill);
        this.FScrollButtonSize = rtl.as(Source,$mod.TTMSFNCScrollBarAppearance).FScrollButtonSize;
        this.FThumbButtonSize = rtl.as(Source,$mod.TTMSFNCScrollBarAppearance).FThumbButtonSize;
        this.FThumbStroke.Assign(rtl.as(Source,$mod.TTMSFNCScrollBarAppearance).FThumbStroke);
        this.FThumbButtonLeftFill.Assign(rtl.as(Source,$mod.TTMSFNCScrollBarAppearance).FThumbButtonLeftFill);
        this.FThumbButtonLeftHoverFill.Assign(rtl.as(Source,$mod.TTMSFNCScrollBarAppearance).FThumbButtonLeftHoverFill);
        this.FThumbButtonLeftDownFill.Assign(rtl.as(Source,$mod.TTMSFNCScrollBarAppearance).FThumbButtonLeftDownFill);
        this.FThumbButtonRightFill.Assign(rtl.as(Source,$mod.TTMSFNCScrollBarAppearance).FThumbButtonRightFill);
        this.FThumbButtonRightDownFill.Assign(rtl.as(Source,$mod.TTMSFNCScrollBarAppearance).FThumbButtonRightDownFill);
        this.FThumbButtonRightHoverFill.Assign(rtl.as(Source,$mod.TTMSFNCScrollBarAppearance).FThumbButtonRightHoverFill);
        this.FScrollButtonLeftFill.Assign(rtl.as(Source,$mod.TTMSFNCScrollBarAppearance).FScrollButtonLeftFill);
        this.FScrollButtonLeftHoverFill.Assign(rtl.as(Source,$mod.TTMSFNCScrollBarAppearance).FScrollButtonLeftHoverFill);
        this.FScrollButtonLeftDownFill.Assign(rtl.as(Source,$mod.TTMSFNCScrollBarAppearance).FScrollButtonLeftDownFill);
        this.FScrollButtonRightFill.Assign(rtl.as(Source,$mod.TTMSFNCScrollBarAppearance).FScrollButtonRightFill);
        this.FScrollButtonRightDownFill.Assign(rtl.as(Source,$mod.TTMSFNCScrollBarAppearance).FScrollButtonRightDownFill);
        this.FScrollButtonRightHoverFill.Assign(rtl.as(Source,$mod.TTMSFNCScrollBarAppearance).FScrollButtonRightHoverFill);
        this.FThumbButtonLeftStroke.Assign(rtl.as(Source,$mod.TTMSFNCScrollBarAppearance).FThumbButtonLeftStroke);
        this.FThumbButtonLeftHoverStroke.Assign(rtl.as(Source,$mod.TTMSFNCScrollBarAppearance).FThumbButtonLeftHoverStroke);
        this.FThumbButtonLeftDownStroke.Assign(rtl.as(Source,$mod.TTMSFNCScrollBarAppearance).FThumbButtonLeftDownStroke);
        this.FThumbButtonRightStroke.Assign(rtl.as(Source,$mod.TTMSFNCScrollBarAppearance).FThumbButtonRightStroke);
        this.FThumbButtonRightDownStroke.Assign(rtl.as(Source,$mod.TTMSFNCScrollBarAppearance).FThumbButtonRightDownStroke);
        this.FThumbButtonRightHoverStroke.Assign(rtl.as(Source,$mod.TTMSFNCScrollBarAppearance).FThumbButtonRightHoverStroke);
        this.FScrollButtonLeftStroke.Assign(rtl.as(Source,$mod.TTMSFNCScrollBarAppearance).FScrollButtonLeftStroke);
        this.FScrollButtonLeftHoverStroke.Assign(rtl.as(Source,$mod.TTMSFNCScrollBarAppearance).FScrollButtonLeftHoverStroke);
        this.FScrollButtonLeftDownStroke.Assign(rtl.as(Source,$mod.TTMSFNCScrollBarAppearance).FScrollButtonLeftDownStroke);
        this.FScrollButtonRightStroke.Assign(rtl.as(Source,$mod.TTMSFNCScrollBarAppearance).FScrollButtonRightStroke);
        this.FScrollButtonRightDownStroke.Assign(rtl.as(Source,$mod.TTMSFNCScrollBarAppearance).FScrollButtonRightDownStroke);
        this.FScrollButtonRightHoverStroke.Assign(rtl.as(Source,$mod.TTMSFNCScrollBarAppearance).FScrollButtonRightHoverStroke);
        this.Changed();
      };
    };
    this.GetThumbButtonSize = function () {
      var Result = 0.0;
      if (this.FFixedThumb) {
        Result = 0}
       else Result = this.FThumbButtonSize;
      return Result;
    };
    var $r = this.$rtti;
    $r.addProperty("ThumbFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FThumbFill","SetThumbFill");
    $r.addProperty("ScrollButtonLeftFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FScrollButtonLeftFill","SetScrollButtonLeftFill");
    $r.addProperty("ScrollButtonRightFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FScrollButtonRightFill","SetScrollButtonRightFill");
    $r.addProperty("ScrollButtonLeftHoverFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FScrollButtonLeftHoverFill","SetScrollButtonLeftHoverFill");
    $r.addProperty("ScrollButtonRightHoverFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FScrollButtonRightHoverFill","SetScrollButtonRightHoverFill");
    $r.addProperty("ScrollButtonLeftDownFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FScrollButtonLeftDownFill","SetScrollButtonLeftDownFill");
    $r.addProperty("ScrollButtonRightDownFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FScrollButtonRightDownFill","SetScrollButtonRightDownFill");
    $r.addProperty("ThumbButtonLeftFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FThumbButtonLeftFill","SetThumbButtonLeftFill");
    $r.addProperty("ThumbButtonRightFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FThumbButtonRightFill","SetThumbButtonRightFill");
    $r.addProperty("ThumbButtonLeftHoverFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FThumbButtonLeftHoverFill","SetThumbButtonLeftHoverFill");
    $r.addProperty("ThumbButtonRightHoverFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FThumbButtonRightHoverFill","SetThumbButtonRightHoverFill");
    $r.addProperty("ThumbButtonLeftDownFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FThumbButtonLeftDownFill","SetThumbButtonLeftDownFill");
    $r.addProperty("ThumbButtonRightDownFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FThumbButtonRightDownFill","SetThumbButtonRightDownFill");
    $r.addProperty("ThumbStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FThumbStroke","SetThumbStroke");
    $r.addProperty("ScrollButtonLeftStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FScrollButtonLeftStroke","SetScrollButtonLeftStroke");
    $r.addProperty("ScrollButtonRightStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FScrollButtonRightStroke","SetScrollButtonRightStroke");
    $r.addProperty("ScrollButtonLeftHoverStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FScrollButtonLeftHoverStroke","SetScrollButtonLeftHoverStroke");
    $r.addProperty("ScrollButtonRightHoverStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FScrollButtonRightHoverStroke","SetScrollButtonRightHoverStroke");
    $r.addProperty("ScrollButtonLeftDownStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FScrollButtonLeftDownStroke","SetScrollButtonLeftDownStroke");
    $r.addProperty("ScrollButtonRightDownStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FScrollButtonRightDownStroke","SetScrollButtonRightDownStroke");
    $r.addProperty("ThumbButtonLeftStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FThumbButtonLeftStroke","SetThumbButtonLeftStroke");
    $r.addProperty("ThumbButtonRightStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FThumbButtonRightStroke","SetThumbButtonRightStroke");
    $r.addProperty("ThumbButtonLeftHoverStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FThumbButtonLeftHoverStroke","SetThumbButtonLeftHoverStroke");
    $r.addProperty("ThumbButtonRightHoverStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FThumbButtonRightHoverStroke","SetThumbButtonRightHoverStroke");
    $r.addProperty("ThumbButtonLeftDownStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FThumbButtonLeftDownStroke","SetThumbButtonLeftDownStroke");
    $r.addProperty("ThumbButtonRightDownStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FThumbButtonRightDownStroke","SetThumbButtonRightDownStroke");
    $r.addProperty("ThumbButtonSize",14,rtl.double,"FThumbButtonSize","SetThumbButtonSize",4,{stored: "IsThumbButtonSizeStored"});
    $r.addProperty("ScrollButtonSize",14,rtl.double,"FScrollButtonSize","SetScrollButtonSize",4,{stored: "IsScrollButtonSizeStored"});
    $r.addProperty("FixedThumb",2,rtl.boolean,"FFixedThumb","SetFixedThumb",4,{Default: false});
    $r.addProperty("ArrowColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FArrowColor","SetArrowColor",4,{Default: 0});
    $r.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChange","FOnChange");
  });
  this.TTMSFNCScrollBarMode = {"0": "sbmNone", sbmNone: 0, "1": "sbmScroll", sbmScroll: 1, "2": "sbmChangePageSize", sbmChangePageSize: 2};
  this.$rtti.$Enum("TTMSFNCScrollBarMode",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCScrollBarMode});
  this.TTMSFNCScrollBarHoveredButton = {"0": "shbNone", shbNone: 0, "1": "shbScrollMin", shbScrollMin: 1, "2": "shbScrollMax", shbScrollMax: 2, "3": "shbThumbMin", shbThumbMin: 3, "4": "shbThumbMax", shbThumbMax: 4};
  this.$rtti.$Enum("TTMSFNCScrollBarHoveredButton",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TTMSFNCScrollBarHoveredButton});
  this.TTMSFNCScrollBarDownButton = {"0": "sdbNone", sdbNone: 0, "1": "sdbScrollMin", sdbScrollMin: 1, "2": "sdbScrollMax", sdbScrollMax: 2, "3": "sdbThumbMin", sdbThumbMin: 3, "4": "sdbThumbMax", sdbThumbMax: 4};
  this.$rtti.$Enum("TTMSFNCScrollBarDownButton",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TTMSFNCScrollBarDownButton});
  this.TTMSFNCScrollButtonChange = {"0": "sbcNone", sbcNone: 0, "1": "sbcSmallSubstract", sbcSmallSubstract: 1, "2": "sbcSmallAdd", sbcSmallAdd: 2, "3": "sbcLargeSubstract", sbcLargeSubstract: 3, "4": "sbcLargeAdd", sbcLargeAdd: 4};
  this.$rtti.$Enum("TTMSFNCScrollButtonChange",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TTMSFNCScrollButtonChange});
  this.$rtti.$MethodVar("TTMSFNCScrollBarValueChanged",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Value",rtl.double]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCScrollBarPageSizeChanged",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["PageSize",rtl.double]]), methodkind: 0});
  this.TTMSFNCScrollBarKind = {"0": "sbkHorizontal", sbkHorizontal: 0, "1": "sbkVertical", sbkVertical: 1};
  this.$rtti.$Enum("TTMSFNCScrollBarKind",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCScrollBarKind});
  rtl.createClass(this,"TTMSFNCCustomScrollBar",pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$init.call(this);
      this.FBlockChange = false;
      this.FNeedsChange = false;
      this.FSavedPageSize = 0.0;
      this.FDesignTime$1 = false;
      this.FMinThumb = false;
      this.FMaxThumb = false;
      this.FMx = 0.0;
      this.FMy = 0.0;
      this.FCx = 0.0;
      this.FCy = 0.0;
      this.FTimer = null;
      this.FTime = 0;
      this.FScrollBarMode = 0;
      this.FScrollButtonChange = 0;
      this.FHoveredButton = 0;
      this.FDownButton = 0;
      this.FKind = 0;
      this.FValue = 0.0;
      this.FTempValue = 0.0;
      this.FMin = 0.0;
      this.FMax = 0.0;
      this.FPageSize = 0.0;
      this.FSmallChange = 0.0;
      this.FLargeChange = 0.0;
      this.FAppearance = null;
      this.FOnValueChange = null;
      this.FOnPageSizeChanged = null;
      this.FTracking = false;
    };
    this.$final = function () {
      this.FTimer = undefined;
      this.FAppearance = undefined;
      this.FOnValueChange = undefined;
      this.FOnPageSizeChanged = undefined;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$final.call(this);
    };
    this.SetAppearance = function (Value) {
      if (this.FAppearance !== Value) {
        this.FAppearance.Assign(Value);
        this.Changed();
      };
    };
    this.SetKind = function (Value) {
      if (this.FKind !== Value) {
        this.FKind = Value;
        this.SetBounds(this.GetLeft(),this.GetTop(),this.GetHeight(),this.GetWidth());
        this.Changed();
      };
    };
    this.SetMax = function (Value) {
      if (this.FMax !== Value) {
        this.FMax = Value;
        this.Changed();
      };
    };
    this.SetMin = function (Value) {
      if (this.FMin !== Value) {
        this.FMin = Value;
        this.Changed();
      };
    };
    this.SetValue = function (Value) {
      if (this.FBlockChange) return;
      if (this.FValue !== Value) {
        this.FValue = Math.min(Math.max(Value,this.FMin),this.FMax - this.FPageSize);
        this.FTempValue = this.FValue;
        if (this.FOnValueChange != null) {
          this.FBlockChange = true;
          this.FOnValueChange(this,this.FValue);
          this.FBlockChange = false;
        };
        this.Changed();
      };
    };
    this.SetPageSize = function (Value) {
      if (this.FBlockChange) return;
      if (this.FPageSize !== Value) {
        this.FPageSize = Math.max(Math.min(this.GetRange(),Value),0);
        if (this.FOnPageSizeChanged != null) {
          this.FBlockChange = true;
          this.FOnPageSizeChanged(this,this.FPageSize);
          this.FBlockChange = false;
        };
        this.Changed();
      };
    };
    this.IsLargeChangeStored = function () {
      var Result = false;
      Result = this.FLargeChange !== 20;
      return Result;
    };
    this.IsMaxStored = function () {
      var Result = false;
      Result = this.FMax !== 100;
      return Result;
    };
    this.IsMinStored = function () {
      var Result = false;
      Result = this.FMin !== 0;
      return Result;
    };
    this.IsPageSizeStored = function () {
      var Result = false;
      Result = this.FPageSize !== 20;
      return Result;
    };
    this.IsSmallChangeStored = function () {
      var Result = false;
      Result = this.FSmallChange !== 1;
      return Result;
    };
    this.IsValueStored = function () {
      var Result = false;
      Result = this.FValue !== 0;
      return Result;
    };
    this.SetTracking = function (Value) {
      if (this.FTracking !== Value) {
        this.FTracking = Value;
        this.Changed();
      };
    };
    this.ChangeDPIScale = function (M, D) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ChangeDPIScale.apply(this,arguments);
      this.BeginUpdate();
      this.FAppearance.FScrollButtonSize = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FAppearance.FScrollButtonSize,M,D);
      this.FAppearance.FThumbButtonSize = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FAppearance.FThumbButtonSize,M,D);
      this.EndUpdate();
    };
    this.ApplyStyle = function () {
      var c = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ApplyStyle.call(this);
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleBackgroundFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FAppearance.FThumbFill.SetColor(c);
        this.FAppearance.FThumbButtonLeftFill.SetColor(c);
        this.FAppearance.FThumbButtonRightFill.SetColor(c);
        this.FAppearance.FScrollButtonLeftFill.SetColor(c);
        this.FAppearance.FScrollButtonRightFill.SetColor(c);
      };
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleLineFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FAppearance.FThumbStroke.SetColor(c);
        this.FAppearance.FThumbButtonLeftStroke.SetColor(c);
        this.FAppearance.FThumbButtonRightStroke.SetColor(c);
        this.FAppearance.FScrollButtonLeftStroke.SetColor(c);
        this.FAppearance.FScrollButtonRightStroke.SetColor(c);
        this.FAppearance.FThumbButtonLeftHoverStroke.SetColor(c);
        this.FAppearance.FThumbButtonRightHoverStroke.SetColor(c);
        this.FAppearance.FScrollButtonLeftHoverStroke.SetColor(c);
        this.FAppearance.FScrollButtonRightHoverStroke.SetColor(c);
        this.FAppearance.FThumbButtonLeftDownStroke.SetColor(c);
        this.FAppearance.FThumbButtonRightDownStroke.SetColor(c);
        this.FAppearance.FScrollButtonLeftDownStroke.SetColor(c);
        this.FAppearance.FScrollButtonRightDownStroke.SetColor(c);
      };
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleSelectionFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FAppearance.FThumbButtonLeftHoverFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Blend(this.FFill.FColor,c,70));
        this.FAppearance.FThumbButtonRightHoverFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Blend(this.FFill.FColor,c,70));
        this.FAppearance.FScrollButtonLeftHoverFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Blend(this.FFill.FColor,c,70));
        this.FAppearance.FScrollButtonRightHoverFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Blend(this.FFill.FColor,c,70));
        this.FAppearance.FThumbButtonLeftDownFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Blend(this.FFill.FColor,c,50));
        this.FAppearance.FThumbButtonRightDownFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Blend(this.FFill.FColor,c,50));
        this.FAppearance.FScrollButtonLeftDownFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Blend(this.FFill.FColor,c,50));
        this.FAppearance.FScrollButtonRightDownFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Blend(this.FFill.FColor,c,50));
        this.FAppearance.SetArrowColor(c);
      };
    };
    this.ResetToDefaultStyle = function () {
      var ia = null;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ResetToDefaultStyle.call(this);
      ia = $mod.TTMSFNCScrollBarAppearance.$create("Create$1",[null]);
      try {
        this.FAppearance.Assign(ia);
      } finally {
        ia = rtl.freeLoc(ia);
      };
    };
    this.HandleKeyDown = function (Key, Shift) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleKeyDown.apply(this,arguments);
      var $tmp = Key.get();
      if (($tmp === 38) || ($tmp === 37)) {
        this.SetValue(this.FValue - this.FSmallChange)}
       else if (($tmp === 40) || ($tmp === 39)) {
        this.SetValue(this.FValue + this.FSmallChange)}
       else if ($tmp === 36) {
        this.SetValue(this.FMin)}
       else if ($tmp === 35) {
        this.SetValue(this.FMax)}
       else if ($tmp === 33) {
        this.SetValue(this.FValue - this.FLargeChange)}
       else if ($tmp === 34) this.SetValue(this.FValue + this.FLargeChange);
    };
    this.HandleMouseDown = function (Button, Shift, X, Y) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseDown.apply(this,arguments);
      if (this.FParent != null) this.CaptureEx();
      this.FCx = Math.abs((X - this.GetThumbRectangle().Left) + this.GetScrollRectangle().Left);
      this.FCy = Math.abs((Y - this.GetThumbRectangle().Top) + this.GetScrollRectangle().Top);
      this.FMx = X;
      this.FMy = Y;
      this.FSavedPageSize = this.FPageSize;
      this.FTime = 0;
      this.FTimer.SetEnabled(true);
      if (this.MouseOnThumbButtons(X,Y)) {
        this.FScrollBarMode = $mod.TTMSFNCScrollBarMode.sbmChangePageSize;
        this.FMinThumb = pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetMinThumbButton(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y));
        this.FMaxThumb = pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetMaxThumbButton(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y));
      } else if (this.MouseOnThumb(X,Y)) {
        this.FScrollBarMode = $mod.TTMSFNCScrollBarMode.sbmScroll}
       else if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetMinScrollButton(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y))) {
        this.FScrollButtonChange = $mod.TTMSFNCScrollButtonChange.sbcSmallSubstract}
       else if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetMaxScrollButton(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y))) {
        this.FScrollButtonChange = $mod.TTMSFNCScrollButtonChange.sbcSmallAdd}
       else if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetScrollAreaMin(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y))) {
        this.FScrollButtonChange = $mod.TTMSFNCScrollButtonChange.sbcLargeSubstract}
       else if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetScrollAreaMax(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y))) this.FScrollButtonChange = $mod.TTMSFNCScrollButtonChange.sbcLargeAdd;
      if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetMinThumbButton(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y)) && !(this.FDownButton === $mod.TTMSFNCScrollBarDownButton.sdbThumbMin)) {
        this.FDownButton = $mod.TTMSFNCScrollBarDownButton.sdbThumbMin;
        this.Changed();
      } else if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetMaxThumbButton(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y)) && !(this.FDownButton === $mod.TTMSFNCScrollBarDownButton.sdbThumbMax)) {
        this.FDownButton = $mod.TTMSFNCScrollBarDownButton.sdbThumbMax;
        this.Changed();
      } else if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetMinScrollButton(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y)) && !(this.FDownButton === $mod.TTMSFNCScrollBarDownButton.sdbScrollMin)) {
        this.FDownButton = $mod.TTMSFNCScrollBarDownButton.sdbScrollMin;
        this.Changed();
      } else if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetMaxScrollButton(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y)) && !(this.FDownButton === $mod.TTMSFNCScrollBarDownButton.sdbScrollMax)) {
        this.FDownButton = $mod.TTMSFNCScrollBarDownButton.sdbScrollMax;
        this.Changed();
      };
    };
    this.HandleMouseMove = function (Shift, X, Y) {
      var pos = 0.0;
      var v = 0.0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseMove.apply(this,arguments);
      if (this.FScrollBarMode === $mod.TTMSFNCScrollBarMode.sbmChangePageSize) {
        var $tmp = this.FKind;
        if ($tmp === $mod.TTMSFNCScrollBarKind.sbkHorizontal) {
          this.SetControlCursor(9)}
         else if ($tmp === $mod.TTMSFNCScrollBarKind.sbkVertical) this.SetControlCursor(7);
        var $tmp1 = this.FKind;
        if ($tmp1 === $mod.TTMSFNCScrollBarKind.sbkHorizontal) {
          pos = (this.GetRange() / (this.GetScrollRectangle().Right - this.GetScrollRectangle().Left)) * (X - this.FMx)}
         else if ($tmp1 === $mod.TTMSFNCScrollBarKind.sbkVertical) {
          pos = (this.GetRange() / (this.GetScrollRectangle().Bottom - this.GetScrollRectangle().Top)) * (Y - this.FMy)}
         else {
          pos = 0;
        };
        if (this.FMinThumb) {
          if ((this.FValue - this.FMin) > 0) {
            this.SetPageSize(this.FSavedPageSize - (pos * (this.GetRange() / (this.FValue - this.FMin))))}
           else this.SetPageSize(this.FSavedPageSize - pos);
        } else if (this.FMaxThumb) {
          if ((this.FValue - this.FMin) < this.GetRange()) {
            this.SetPageSize(this.FSavedPageSize + (pos * (this.GetRange() / (this.FMax - this.FValue))))}
           else this.SetPageSize(this.FSavedPageSize + pos);
        };
      } else if (this.FScrollBarMode === $mod.TTMSFNCScrollBarMode.sbmScroll) {
        var $tmp2 = this.FKind;
        if ($tmp2 === $mod.TTMSFNCScrollBarKind.sbkHorizontal) {
          pos = X - this.FCx}
         else if ($tmp2 === $mod.TTMSFNCScrollBarKind.sbkVertical) {
          pos = Y - this.FCy}
         else {
          pos = 0;
        };
        v = this.GetValue$1(pos);
        if (this.FTracking) {
          this.SetValue(v)}
         else {
          this.FTempValue = v;
          this.Changed();
        };
      } else if (this.MouseOnThumbButtons(X,Y)) {
        var $tmp3 = this.FKind;
        if ($tmp3 === $mod.TTMSFNCScrollBarKind.sbkHorizontal) {
          this.SetControlCursor(9)}
         else if ($tmp3 === $mod.TTMSFNCScrollBarKind.sbkVertical) this.SetControlCursor(7);
      } else {
        this.SetControlCursor(0);
      };
      if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetMinThumbButton(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y)) && !(this.FHoveredButton === $mod.TTMSFNCScrollBarHoveredButton.shbThumbMin)) {
        this.FHoveredButton = $mod.TTMSFNCScrollBarHoveredButton.shbThumbMin;
        this.Changed();
      } else if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetMaxThumbButton(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y)) && !(this.FHoveredButton === $mod.TTMSFNCScrollBarHoveredButton.shbThumbMax)) {
        this.FHoveredButton = $mod.TTMSFNCScrollBarHoveredButton.shbThumbMax;
        this.Changed();
      } else if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetMinScrollButton(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y)) && !(this.FHoveredButton === $mod.TTMSFNCScrollBarHoveredButton.shbScrollMin)) {
        this.FHoveredButton = $mod.TTMSFNCScrollBarHoveredButton.shbScrollMin;
        this.Changed();
      } else if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetMaxScrollButton(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y)) && !(this.FHoveredButton === $mod.TTMSFNCScrollBarHoveredButton.shbScrollMax)) {
        this.FHoveredButton = $mod.TTMSFNCScrollBarHoveredButton.shbScrollMax;
        this.Changed();
      } else if (!pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetMaxThumbButton(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y)) && !pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetMinThumbButton(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y)) && !pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetMaxScrollButton(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y)) && !pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetMinScrollButton(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y)) && (this.FHoveredButton !== $mod.TTMSFNCScrollBarHoveredButton.shbNone)) {
        this.FHoveredButton = $mod.TTMSFNCScrollBarHoveredButton.shbNone;
        this.Changed();
      };
    };
    this.HandleMouseUp = function (Button, Shift, X, Y) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseUp.apply(this,arguments);
      if (this.FParent != null) this.ReleaseCaptureEx();
      if ((this.FScrollBarMode === $mod.TTMSFNCScrollBarMode.sbmScroll) && !this.FTracking) this.SetValue(this.FTempValue);
      if (this.FScrollBarMode === $mod.TTMSFNCScrollBarMode.sbmNone) {
        if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetMinScrollButton(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y))) {
          this.SetValue(this.FValue - this.FSmallChange)}
         else if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetMaxScrollButton(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y))) {
          this.SetValue(this.FValue + this.FSmallChange)}
         else if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetScrollAreaMin(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y))) {
          this.SetValue(this.FValue - this.FLargeChange)}
         else if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetScrollAreaMax(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y))) this.SetValue(this.FValue + this.FLargeChange);
      };
      this.FDownButton = $mod.TTMSFNCScrollBarDownButton.sdbNone;
      this.FMinThumb = false;
      this.FMaxThumb = false;
      this.FTimer.SetEnabled(false);
      this.FTime = 0;
      this.FScrollBarMode = $mod.TTMSFNCScrollBarMode.sbmNone;
      this.SetControlCursor(0);
      this.FScrollButtonChange = $mod.TTMSFNCScrollButtonChange.sbcNone;
      this.Changed();
    };
    this.HandleMouseLeave = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseLeave.call(this);
      this.FTimer.SetEnabled(false);
      this.FTime = 0;
      this.FScrollBarMode = $mod.TTMSFNCScrollBarMode.sbmNone;
      this.FScrollButtonChange = $mod.TTMSFNCScrollButtonChange.sbcNone;
      this.FMinThumb = false;
      this.FMaxThumb = false;
      this.FDownButton = $mod.TTMSFNCScrollBarDownButton.sdbNone;
      this.FHoveredButton = $mod.TTMSFNCScrollBarHoveredButton.shbNone;
      this.Changed();
    };
    this.HandleMouseEnter = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseEnter.call(this);
    };
    this.HandleMouseWheel = function (Shift, WheelDelta, Handled) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseWheel.apply(this,arguments);
      if (WheelDelta < 0) {
        this.SetValue(this.FValue + this.FLargeChange)}
       else this.SetValue(this.FValue - this.FLargeChange);
    };
    this.Changed = function () {
      this.Invalidate();
    };
    this.AppearanceChanged = function (Sender) {
      this.Changed();
    };
    this.TimerChanged = function (Sender) {
      this.FTime += 1;
      if (this.FTime >= 4) {
        if (this.FScrollButtonChange === $mod.TTMSFNCScrollButtonChange.sbcSmallSubstract) {
          this.SetValue(this.FValue - this.FSmallChange);
          this.Changed();
        } else if (this.FScrollButtonChange === $mod.TTMSFNCScrollButtonChange.sbcSmallAdd) {
          this.SetValue(this.FValue + this.FSmallChange);
          this.Changed();
        } else if (this.FScrollButtonChange === $mod.TTMSFNCScrollButtonChange.sbcLargeSubstract) {
          this.SetValue(this.FValue - this.FLargeChange);
          this.Changed();
        } else if (this.FScrollButtonChange === $mod.TTMSFNCScrollButtonChange.sbcLargeAdd) {
          this.SetValue(this.FValue + this.FLargeChange);
          this.Changed();
        };
      };
    };
    this.GetCalculationRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(this.GetLocalRect());
      return Result;
    };
    this.GetDocURL = function () {
      var Result = "";
      Result = pas["WEBLib.TMSFNCTypes"].TTMSFNCBaseDocURL + "tmsfncuipack";
      return Result;
    };
    this.GetMinScrollButton = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.$assign(this.GetCalculationRect());
      var $tmp = this.FKind;
      if ($tmp === $mod.TTMSFNCScrollBarKind.sbkHorizontal) {
        Result.$assign(pas["WEBLib.TMSFNCTypes"].MakeRectF(r.Left,r.Top,this.FAppearance.FScrollButtonSize,r.Bottom - r.Top))}
       else if ($tmp === $mod.TTMSFNCScrollBarKind.sbkVertical) Result.$assign(pas["WEBLib.TMSFNCTypes"].MakeRectF(r.Left,r.Top,r.Right - r.Left,this.FAppearance.FScrollButtonSize));
      return Result;
    };
    this.GetMaxScrollButton = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.$assign(this.GetCalculationRect());
      var $tmp = this.FKind;
      if ($tmp === $mod.TTMSFNCScrollBarKind.sbkHorizontal) {
        Result.$assign(pas["WEBLib.TMSFNCTypes"].MakeRectF(r.Right - this.FAppearance.FScrollButtonSize,r.Top,this.FAppearance.FScrollButtonSize,r.Bottom - r.Top))}
       else if ($tmp === $mod.TTMSFNCScrollBarKind.sbkVertical) Result.$assign(pas["WEBLib.TMSFNCTypes"].MakeRectF(r.Left,r.Bottom - this.FAppearance.FScrollButtonSize,r.Right - r.Left,this.FAppearance.FScrollButtonSize));
      return Result;
    };
    this.GetMinThumbButton = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.$assign(this.GetThumbRectangle());
      var $tmp = this.FKind;
      if ($tmp === $mod.TTMSFNCScrollBarKind.sbkHorizontal) {
        Result.$assign(pas["WEBLib.TMSFNCTypes"].MakeRectF(r.Left,r.Top,this.FAppearance.GetThumbButtonSize(),r.Bottom - r.Top))}
       else if ($tmp === $mod.TTMSFNCScrollBarKind.sbkVertical) Result.$assign(pas["WEBLib.TMSFNCTypes"].MakeRectF(r.Left,r.Top,r.Right - r.Left,this.FAppearance.GetThumbButtonSize()));
      return Result;
    };
    this.GetMaxThumbButton = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.$assign(this.GetThumbRectangle());
      var $tmp = this.FKind;
      if ($tmp === $mod.TTMSFNCScrollBarKind.sbkHorizontal) {
        Result.$assign(pas["WEBLib.TMSFNCTypes"].MakeRectF((r.Left + (r.Right - r.Left)) - this.FAppearance.GetThumbButtonSize(),r.Top,this.FAppearance.GetThumbButtonSize(),r.Bottom - r.Top))}
       else if ($tmp === $mod.TTMSFNCScrollBarKind.sbkVertical) Result.$assign(pas["WEBLib.TMSFNCTypes"].MakeRectF(r.Left,(r.Top + (r.Bottom - r.Top)) - this.FAppearance.GetThumbButtonSize(),r.Right - r.Left,this.FAppearance.GetThumbButtonSize()));
      return Result;
    };
    this.GetScrollRectangle = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var $tmp = this.FKind;
      if ($tmp === $mod.TTMSFNCScrollBarKind.sbkHorizontal) {
        Result.Left = this.GetMinScrollButton().Left + (this.GetMinScrollButton().Right - this.GetMinScrollButton().Left);
        Result.Top = this.GetMinScrollButton().Top;
        Result.Bottom = Result.Top + (this.GetMinScrollButton().Bottom - this.GetMinScrollButton().Top);
        Result.Right = this.GetMaxScrollButton().Left;
      } else if ($tmp === $mod.TTMSFNCScrollBarKind.sbkVertical) {
        Result.Left = this.GetMinScrollButton().Left;
        Result.Top = this.GetMinScrollButton().Top + (this.GetMinScrollButton().Bottom - this.GetMinScrollButton().Top);
        Result.Bottom = this.GetMaxScrollButton().Top;
        Result.Right = Result.Left + (this.GetMinScrollButton().Right - this.GetMinScrollButton().Left);
      };
      return Result;
    };
    this.GetScrollSize = function () {
      var Result = 0.0;
      var $tmp = this.FKind;
      if ($tmp === $mod.TTMSFNCScrollBarKind.sbkHorizontal) {
        Result = this.GetScrollRectangle().Right - this.GetScrollRectangle().Left - (this.GetThumbRectangle().Right - this.GetThumbRectangle().Left)}
       else if ($tmp === $mod.TTMSFNCScrollBarKind.sbkVertical) {
        Result = this.GetScrollRectangle().Bottom - this.GetScrollRectangle().Top - (this.GetThumbRectangle().Bottom - this.GetThumbRectangle().Top)}
       else {
        Result = 0;
      };
      return Result;
    };
    this.GetScrollAreaMin = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var scr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var thr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      scr.$assign(this.GetScrollRectangle());
      thr.$assign(this.GetThumbRectangle());
      var $tmp = this.FKind;
      if ($tmp === $mod.TTMSFNCScrollBarKind.sbkHorizontal) {
        Result.Left = scr.Left;
        Result.Top = scr.Top;
        Result.Right = Result.Left + (thr.Left - scr.Left);
        Result.Bottom = Result.Top + (scr.Bottom - scr.Top);
      } else if ($tmp === $mod.TTMSFNCScrollBarKind.sbkVertical) {
        Result.Left = scr.Left;
        Result.Top = scr.Top;
        Result.Right = Result.Left + (scr.Right - scr.Left);
        Result.Bottom = Result.Top + (thr.Top - scr.Top);
      };
      return Result;
    };
    this.GetScrollAreaMax = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var scr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var thr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      scr.$assign(this.GetScrollRectangle());
      thr.$assign(this.GetThumbRectangle());
      var $tmp = this.FKind;
      if ($tmp === $mod.TTMSFNCScrollBarKind.sbkHorizontal) {
        Result.Left = thr.Left + (thr.Right - thr.Left);
        Result.Top = scr.Top;
        Result.Right = ((Result.Left + (scr.Right - scr.Left)) - (thr.Right - thr.Left) - thr.Left) + scr.Left;
        Result.Bottom = Result.Top + (scr.Bottom - scr.Top);
      } else if ($tmp === $mod.TTMSFNCScrollBarKind.sbkVertical) {
        Result.Left = scr.Left;
        Result.Top = thr.Top + (thr.Bottom - thr.Top);
        Result.Right = Result.Left + (scr.Right - scr.Left);
        Result.Bottom = ((Result.Top + (scr.Bottom - scr.Top)) - (thr.Bottom - thr.Top) - thr.Top) + scr.Top;
      };
      return Result;
    };
    this.GetThumbRectangle = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var scr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var s = 0.0;
      scr.$assign(this.GetScrollRectangle());
      var $tmp = this.FKind;
      if ($tmp === $mod.TTMSFNCScrollBarKind.sbkHorizontal) {
        s = ((scr.Right - scr.Left) / this.GetRange()) * this.FPageSize;
        Result.Left = scr.Left + this.GetValue();
        Result.Top = scr.Top;
        Result.Right = Result.Left + Math.max((this.FAppearance.GetThumbButtonSize() * 2) + this.ScalePaintValue(10),s);
        Result.Bottom = Result.Top + (scr.Bottom - scr.Top);
      } else if ($tmp === $mod.TTMSFNCScrollBarKind.sbkVertical) {
        s = ((scr.Bottom - scr.Top) / this.GetRange()) * this.FPageSize;
        Result.Left = scr.Left;
        Result.Top = scr.Top + this.GetValue();
        Result.Right = Result.Left + (scr.Right - scr.Left);
        Result.Bottom = Result.Top + Math.max((this.FAppearance.GetThumbButtonSize() * 2) + this.ScalePaintValue(10),s);
      };
      return Result;
    };
    this.GetValue = function () {
      var Result = 0.0;
      var s = 0.0;
      var scr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result = 0;
      scr.$assign(this.GetScrollRectangle());
      var $tmp = this.FKind;
      if ($tmp === $mod.TTMSFNCScrollBarKind.sbkHorizontal) {
        s = scr.Right - scr.Left - Math.max((this.FAppearance.GetThumbButtonSize() * 2) + 10,((scr.Right - scr.Left) / this.GetRange()) * this.FPageSize)}
       else if ($tmp === $mod.TTMSFNCScrollBarKind.sbkVertical) {
        s = scr.Bottom - scr.Top - Math.max((this.FAppearance.GetThumbButtonSize() * 2) + 10,((scr.Bottom - scr.Top) / this.GetRange()) * this.FPageSize)}
       else {
        s = 0;
      };
      if (s <= 0) return Result;
      if ((this.FMax - this.FMin) > 0) {
        if (this.FTracking) {
          Result = Math.min(((this.FValue - this.FMin) / (this.FMax - this.FMin - this.FPageSize)) * s,s)}
         else Result = Math.min(((this.FTempValue - this.FMin) / (this.FMax - this.FMin - this.FPageSize)) * s,s);
      } else Result = this.FMin;
      return Result;
    };
    this.GetValue$1 = function (XYPos) {
      var Result = 0.0;
      var v = 0.0;
      var s = 0.0;
      var scr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      scr.$assign(this.GetScrollRectangle());
      var $tmp = this.FKind;
      if ($tmp === $mod.TTMSFNCScrollBarKind.sbkHorizontal) {
        s = scr.Right - scr.Left - Math.max((this.FAppearance.GetThumbButtonSize() * 2) + 10,((scr.Right - scr.Left) / this.GetRange()) * this.FPageSize)}
       else if ($tmp === $mod.TTMSFNCScrollBarKind.sbkVertical) {
        s = scr.Bottom - scr.Top - Math.max((this.FAppearance.GetThumbButtonSize() * 2) + 10,((scr.Bottom - scr.Top) / this.GetRange()) * this.FPageSize)}
       else {
        s = 0;
      };
      if (((this.FMax - this.FMin) > 0) && (s > 0)) {
        v = ((XYPos / s) * (this.FMax - this.FMin - this.FPageSize)) + this.FMin;
        Result = Math.max(Math.min(v,this.FMax - this.FPageSize),this.FMin);
      } else Result = 0;
      return Result;
    };
    this.GetRange = function () {
      var Result = 0.0;
      Result = Math.max(2,this.FMax - this.FMin);
      return Result;
    };
    this.MouseOnThumbButtons = function (X, Y) {
      var Result = false;
      Result = pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetMinThumbButton(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y)) || pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetMaxThumbButton(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y));
      Result = Result && !this.FAppearance.FFixedThumb;
      return Result;
    };
    this.MouseOnThumb = function (X, Y) {
      var Result = false;
      Result = pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetThumbRectangle(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y));
      return Result;
    };
    this.DrawScrollButtons = function (g) {
      var flmin = null;
      var flmax = null;
      var stmin = null;
      var stmax = null;
      if (this.FAppearance.FScrollButtonSize <= 0) return;
      flmin = this.FAppearance.FScrollButtonLeftFill;
      flmax = this.FAppearance.FScrollButtonRightFill;
      stmin = this.FAppearance.FScrollButtonLeftStroke;
      stmax = this.FAppearance.FScrollButtonRightStroke;
      if (this.FDownButton === $mod.TTMSFNCScrollBarDownButton.sdbScrollMin) {
        flmin = this.FAppearance.FScrollButtonLeftDownFill;
        stmin = this.FAppearance.FScrollButtonLeftDownStroke;
      } else if (this.FHoveredButton === $mod.TTMSFNCScrollBarHoveredButton.shbScrollMin) {
        flmin = this.FAppearance.FScrollButtonLeftHoverFill;
        stmin = this.FAppearance.FScrollButtonLeftHoverStroke;
      };
      g.FFill.Assign(flmin);
      g.FStroke.Assign(stmin);
      g.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.GetMinScrollButton()),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
      if (this.FDownButton === $mod.TTMSFNCScrollBarDownButton.sdbScrollMax) {
        flmax = this.FAppearance.FScrollButtonRightDownFill;
        stmax = this.FAppearance.FScrollButtonRightDownStroke;
      } else if (this.FHoveredButton === $mod.TTMSFNCScrollBarHoveredButton.shbScrollMax) {
        flmax = this.FAppearance.FScrollButtonRightHoverFill;
        stmax = this.FAppearance.FScrollButtonRightHoverStroke;
      };
      g.FFill.Assign(flmax);
      g.FStroke.Assign(stmax);
      g.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.GetMaxScrollButton()),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
      this.DrawArrow(g,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.GetMinScrollButton()),true);
      this.DrawArrow(g,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.GetMaxScrollButton()),false);
    };
    this.DrawThumb = function (g) {
      g.FFill.Assign(this.FAppearance.FThumbFill);
      g.FStroke.Assign(this.FAppearance.FThumbStroke);
      g.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.GetThumbRectangle()),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
      if (!this.FAppearance.FFixedThumb) this.DrawThumbButtons(g);
    };
    this.DrawThumbButtons = function (g) {
      var flmin = null;
      var flmax = null;
      var stmin = null;
      var stmax = null;
      if (this.FAppearance.FThumbButtonSize <= 0) return;
      flmin = this.FAppearance.FThumbButtonLeftFill;
      flmax = this.FAppearance.FThumbButtonRightFill;
      stmin = this.FAppearance.FThumbButtonLeftStroke;
      stmax = this.FAppearance.FThumbButtonRightStroke;
      if (this.FDownButton === $mod.TTMSFNCScrollBarDownButton.sdbThumbMin) {
        flmin = this.FAppearance.FThumbButtonLeftDownFill;
        stmin = this.FAppearance.FThumbButtonLeftDownStroke;
      } else if (this.FHoveredButton === $mod.TTMSFNCScrollBarHoveredButton.shbThumbMin) {
        flmin = this.FAppearance.FThumbButtonLeftHoverFill;
        stmin = this.FAppearance.FThumbButtonLeftHoverStroke;
      };
      g.FFill.Assign(flmin);
      g.FStroke.Assign(stmin);
      g.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.GetMinThumbButton()),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
      if (this.FDownButton === $mod.TTMSFNCScrollBarDownButton.sdbThumbMax) {
        flmax = this.FAppearance.FThumbButtonRightDownFill;
        stmax = this.FAppearance.FThumbButtonRightDownStroke;
      } else if (this.FHoveredButton === $mod.TTMSFNCScrollBarHoveredButton.shbThumbMax) {
        flmax = this.FAppearance.FThumbButtonRightHoverFill;
        stmax = this.FAppearance.FThumbButtonRightHoverStroke;
      };
      g.FFill.Assign(flmax);
      g.FStroke.Assign(stmax);
      g.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.GetMaxThumbButton()),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
      this.DrawArrow(g,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.GetMinThumbButton()),true);
      this.DrawArrow(g,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.GetMaxThumbButton()),false);
    };
    this.DrawArrow = function (g, r, ALeft) {
      g.FStroke.SetColor(this.FAppearance.FArrowColor);
      if (this.FKind === $mod.TTMSFNCScrollBarKind.sbkVertical) {
        pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,0,-4);
        if (!ALeft) {
          g.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + ((r.Right - r.Left) / 2),r.Top + (((r.Bottom - r.Top) / 3) * 2))),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + ((r.Right - r.Left) / 3),r.Top + ((r.Bottom - r.Top) / 3))),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
          g.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + ((r.Right - r.Left) / 2),r.Top + (((r.Bottom - r.Top) / 3) * 2))),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + (((r.Right - r.Left) / 3) * 2),r.Top + ((r.Bottom - r.Top) / 3))),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
        } else {
          g.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + ((r.Right - r.Left) / 2),r.Top + ((r.Bottom - r.Top) / 3))),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + ((r.Right - r.Left) / 3),r.Top + (((r.Bottom - r.Top) / 3) * 2))),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
          g.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + ((r.Right - r.Left) / 2),r.Top + ((r.Bottom - r.Top) / 3))),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + (((r.Right - r.Left) / 3) * 2),r.Top + (((r.Bottom - r.Top) / 3) * 2))),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
        };
      } else {
        pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,-4,0);
        if (!ALeft) {
          g.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + ((r.Right - r.Left) / 3),r.Top + ((r.Bottom - r.Top) / 3))),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + (((r.Right - r.Left) / 3) * 2),r.Top + ((r.Bottom - r.Top) / 2))),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
          g.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + ((r.Right - r.Left) / 3),r.Top + (((r.Bottom - r.Top) / 3) * 2))),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + (((r.Right - r.Left) / 3) * 2),r.Top + ((r.Bottom - r.Top) / 2))),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
        } else {
          g.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + (((r.Right - r.Left) / 3) * 2),r.Top + ((r.Bottom - r.Top) / 3))),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + ((r.Right - r.Left) / 3),r.Top + ((r.Bottom - r.Top) / 2))),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
          g.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + (((r.Right - r.Left) / 3) * 2),r.Top + (((r.Bottom - r.Top) / 3) * 2))),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + ((r.Right - r.Left) / 3),r.Top + ((r.Bottom - r.Top) / 2))),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
        };
      };
    };
    this.Draw = function (AGraphics, ARect) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Draw.apply(this,arguments);
      this.DrawThumb(AGraphics);
      this.DrawScrollButtons(AGraphics);
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Create$1.apply(this,arguments);
      this.FTracking = true;
      this.FDesignTime$1 = this.IsDesignTime();
      if (this.FDesignTime$1) {
        this.FFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(225,225,225),40));
        this.FStroke.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Darker(11119017,40));
      };
      this.SetHeight(121);
      this.SetWidth(18);
      this.FKind = $mod.TTMSFNCScrollBarKind.sbkVertical;
      this.FValue = 0;
      this.FMin = 0;
      this.FMax = 100;
      this.FSmallChange = 1;
      this.FLargeChange = 20;
      this.FAppearance = $mod.TTMSFNCScrollBarAppearance.$create("Create$1",[this]);
      this.FAppearance.FOnChange = rtl.createCallback(this,"AppearanceChanged");
      this.FPageSize = 20;
      this.FTimer = pas["WEBLib.ExtCtrls"].TTimer.$create("Create$1",[null]);
      this.FTimer.FOnTimer = rtl.createCallback(this,"TimerChanged");
      this.FTimer.SetInterval(100);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FAppearance");
      rtl.free(this,"FTimer");
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCScrollBar.isPrototypeOf(Source)) {
        this.FKind = rtl.as(Source,$mod.TTMSFNCScrollBar).FKind;
        this.FValue = rtl.as(Source,$mod.TTMSFNCScrollBar).FValue;
        this.FMin = rtl.as(Source,$mod.TTMSFNCScrollBar).FMin;
        this.FMax = rtl.as(Source,$mod.TTMSFNCScrollBar).FMax;
        this.FPageSize = rtl.as(Source,$mod.TTMSFNCScrollBar).FPageSize;
        this.FSmallChange = rtl.as(Source,$mod.TTMSFNCScrollBar).FSmallChange;
        this.FLargeChange = rtl.as(Source,$mod.TTMSFNCScrollBar).FLargeChange;
        this.FAppearance.Assign(rtl.as(Source,$mod.TTMSFNCScrollBar).FAppearance);
        this.FTracking = rtl.as(Source,$mod.TTMSFNCScrollBar).FTracking;
        this.Changed();
      };
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCScrollBar",this.TTMSFNCCustomScrollBar,function () {
    this.RegisterRuntimeClasses = function () {
      pas.Classes.RegisterClass($mod.TTMSFNCScrollBar);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Fill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFill","SetFill");
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
    $r.addProperty("Appearance",2,$mod.$rtti["TTMSFNCScrollBarAppearance"],"FAppearance","SetAppearance");
    $r.addProperty("Kind",2,$mod.$rtti["TTMSFNCScrollBarKind"],"FKind","SetKind",4,{Default: $mod.TTMSFNCScrollBarKind.sbkVertical});
    $r.addProperty("LargeChange",12,rtl.double,"FLargeChange","FLargeChange",4,{stored: "IsLargeChangeStored"});
    $r.addProperty("Max",14,rtl.double,"FMax","SetMax",4,{stored: "IsMaxStored"});
    $r.addProperty("Tracking",2,rtl.boolean,"FTracking","SetTracking",4,{Default: true});
    $r.addProperty("Min",14,rtl.double,"FMin","SetMin",4,{stored: "IsMinStored"});
    $r.addProperty("PageSize",14,rtl.double,"FPageSize","SetPageSize",4,{stored: "IsPageSizeStored"});
    $r.addProperty("Value",14,rtl.double,"FValue","SetValue",4,{stored: "IsValueStored"});
    $r.addProperty("SmallChange",12,rtl.double,"FSmallChange","FSmallChange",4,{stored: "IsSmallChangeStored"});
    $r.addProperty("OnValueChanged",0,$mod.$rtti["TTMSFNCScrollBarValueChanged"],"FOnValueChange","FOnValueChange");
    $r.addProperty("OnPageSizeChanged",0,$mod.$rtti["TTMSFNCScrollBarPageSizeChanged"],"FOnPageSizeChanged","FOnPageSizeChanged");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
},["Math","SysUtils","WEBLib.TMSFNCStyles","WEBLib.TMSFNCUtils"]);
rtl.module("WEBLib.TMSFNCTreeViewBase",["System","Classes","WEBLib.TMSFNCCustomControl","WEBLib.TMSFNCScrollBar","WEBLib.StdCtrls","WEBLib.Controls","WEBLib.TMSFNCTypes"],function () {
  "use strict";
  var $mod = this;
  this.SWIPECOUNT = 300;
  this.DOWNCOUNT = 100;
  this.$rtti.$Class("TTMSFNCTreeViewBase");
  rtl.createClass(this,"TTMSFNCTreeViewDoubleListItem",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FOwner = null;
      this.FValue = 0.0;
      this.FCellVal = 0;
    };
    this.$final = function () {
      this.FOwner = undefined;
      pas.Classes.TCollectionItem.$final.call(this);
    };
    this.SetCellData = function (Value) {
      this.FValue = Value;
    };
    this.Create$1 = function (ACollection) {
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      if (this.FCollection != null) this.FOwner = rtl.as(this.FCollection,$mod.TTMSFNCTreeViewDoubleList).FOwner$1;
      return this;
    };
    var $r = this.$rtti;
    $r.addProperty("Value",2,rtl.double,"FValue","SetCellData");
    $r.addProperty("CellVal",0,rtl.longint,"FCellVal","FCellVal");
  });
  rtl.createClass(this,"TTMSFNCTreeViewDoubleList",pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$init.call(this);
      this.FOwner$1 = null;
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FOwner$1 = undefined;
      this.FOnChange = undefined;
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$final.call(this);
    };
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      this.SetItem(Index,Value);
    };
    this.IndexOf = function (ACellVal) {
      var Result = 0;
      var r = 0;
      Result = -1;
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        r = $l;
        if (this.GetItem$1(r).FCellVal === ACellVal) {
          Result = r;
          return Result;
        };
      };
      return Result;
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,$mod.TTMSFNCTreeViewDoubleListItem);
      this.FOwner$1 = AOwner;
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      return Result;
    };
  });
  this.TTMSFNCTreeViewScrollMode = {"0": "smPixelScrolling", smPixelScrolling: 0, "1": "smNodeScrolling", smNodeScrolling: 1};
  this.$rtti.$Enum("TTMSFNCTreeViewScrollMode",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCTreeViewScrollMode});
  this.TTMSFNCTreeViewScrollUpdate = {"0": "suContinuous", suContinuous: 0, "1": "suOnce", suOnce: 1};
  this.$rtti.$Enum("TTMSFNCTreeViewScrollUpdate",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCTreeViewScrollUpdate});
  this.TTMSFNCTreeViewStretchingMode = {"0": "stmIndex", stmIndex: 0, "1": "stmAll", stmAll: 1};
  this.$rtti.$Enum("TTMSFNCTreeViewStretchingMode",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCTreeViewStretchingMode});
  rtl.createClass(this,"TTMSFNCTreeViewBase",pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$init.call(this);
      this.FSaveHScrollPos = 0.0;
      this.FSaveVScrollPos = 0.0;
      this.FTotalRowHeight = 0.0;
      this.FNodeListBuild = false;
      this.FTotalColumnWidth = 0.0;
      this.FStartOffset = 0.0;
      this.FStartCol = 0;
      this.FStopCol = 0;
      this.FStartRow = 0;
      this.FStopRow = 0;
      this.FStartX = 0.0;
      this.FStopX = 0.0;
      this.FStartY = 0.0;
      this.FStopY = 0.0;
      this.FBlockScrollingUpdate = false;
      this.FUpdateCount$1 = 0;
      this.FVerticalScrollBar = null;
      this.FHorizontalScrollBar = null;
      this.FCustomVerticalScrollBar = null;
      this.FCustomHorizontalScrollBar = null;
      this.FRowCount = 0;
      this.FColumnCount = 0;
      this.FColumnW = null;
      this.FColumnP = null;
      this.FDefaultRowHeight = 0.0;
      this.FDefaultColumnWidth = 0.0;
      this.FVerticalScrollBarVisible = false;
      this.FHorizontalScrollBarVisible = false;
      this.FScrollMode = 0;
      this.FIsMouseDown = false;
      this.FDelayedLoading = false;
      this.FStretchScrollBars = false;
      this.FBlockUpdateNodeList = false;
      this.FBlockUpdateNode = false;
      this.FBlockRemoveNode = 0;
      this.FBlockUserInput = false;
      this.FBlockMouseClick = false;
      this.FCustomScrollBars = false;
      this.FScrollUpdate = 0;
      this.FDefaultColumnMinWidth = 0.0;
      this.FColumnMinW = null;
    };
    this.$final = function () {
      this.FVerticalScrollBar = undefined;
      this.FHorizontalScrollBar = undefined;
      this.FCustomVerticalScrollBar = undefined;
      this.FCustomHorizontalScrollBar = undefined;
      this.FColumnW = undefined;
      this.FColumnP = undefined;
      this.FColumnMinW = undefined;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$final.call(this);
    };
    this.SetColumnCount = function (Value) {
      if (this.FColumnCount !== Value) this.FColumnCount = Value;
    };
    this.SetRowCount = function (Value) {
      if (this.FRowCount !== Value) this.FRowCount = Value;
    };
    this.SetDefaultColumnWidth = function (Value) {
      if (this.FDefaultColumnWidth !== Value) this.FDefaultColumnWidth = Value;
    };
    this.SetDefaultRowHeight = function (Value) {
      if (this.FDefaultRowHeight !== Value) this.FDefaultRowHeight = Value;
    };
    this.SetHorizontalScrollBarVisible = function (Value) {
      if (this.FHorizontalScrollBarVisible !== Value) {
        this.FHorizontalScrollBarVisible = Value;
        this.UpdateTreeViewCache();
      };
    };
    this.SetVerticalScrollBarVisible = function (Value) {
      if (this.FVerticalScrollBarVisible !== Value) {
        this.FVerticalScrollBarVisible = Value;
        this.UpdateTreeViewCache();
      };
    };
    this.SetScrollMode = function (Value) {
      if (this.FScrollMode !== Value) {
        this.FScrollMode = Value;
        this.UpdateTreeViewDisplay();
      };
    };
    this.SetColWidths = function (Col, Value) {
      var idx = 0;
      var c = null;
      idx = this.FColumnW.IndexOf(Col);
      if ((idx >= 0) && (idx <= (this.FColumnW.GetCount() - 1))) {
        if (Value === this.FDefaultColumnWidth) {
          this.FColumnW.Delete(idx)}
         else {
          this.FColumnW.GetItem$1(idx).SetCellData(Math.max(0,Value));
          this.FColumnW.GetItem$1(idx).FCellVal = Col;
        };
      } else if (Value !== this.FDefaultColumnWidth) {
        c = this.FColumnW.Add$1();
        c.SetCellData(Math.max(0,Value));
        c.FCellVal = Col;
      };
    };
    this.SetColumnP = function (Value) {
      this.FColumnP.Assign(Value);
    };
    this.SetColumnW = function (Value) {
      this.FColumnW.Assign(Value);
    };
    this.GetColWidths = function (Col) {
      var Result = 0.0;
      var idx = 0;
      idx = this.FColumnW.IndexOf(Col);
      if (idx !== -1) {
        Result = this.FColumnW.GetItem$1(idx).FValue}
       else Result = this.FDefaultColumnWidth;
      return Result;
    };
    this.GetColPos = function (Col) {
      var Result = 0.0;
      var idx = 0;
      idx = this.FColumnP.IndexOf(Col);
      if (idx !== -1) {
        Result = this.FColumnP.GetItem$1(idx).FValue}
       else Result = -1;
      return Result;
    };
    this.SetColPos = function (Col, Value) {
      var idx = 0;
      var c = null;
      idx = this.FColumnP.IndexOf(Col);
      if ((idx >= 0) && (idx <= (this.FColumnP.GetCount() - 1))) {
        if (Value === -1) {
          this.FColumnP.Delete(idx)}
         else {
          this.FColumnP.GetItem$1(idx).SetCellData(Math.max(0,Value));
          this.FColumnP.GetItem$1(idx).FCellVal = Col;
        };
      } else if (Value !== -1) {
        c = this.FColumnP.Add$1();
        c.SetCellData(Math.max(0,Value));
        c.FCellVal = Col;
      };
    };
    this.SetStretchScrollBars = function (Value) {
      if (this.FStretchScrollBars !== Value) {
        this.FStretchScrollBars = Value;
        this.UpdateTreeViewDisplay();
      };
    };
    this.SetCustomScrollBars = function (Value) {
      if (this.FCustomScrollBars !== Value) {
        this.FCustomScrollBars = Value;
        this.UpdateTreeViewCache();
      };
    };
    this.SetScrollUpdate = function (Value) {
      if (this.FScrollUpdate !== Value) {
        this.FScrollUpdate = Value;
        if (this.FCustomVerticalScrollBar != null) this.FCustomVerticalScrollBar.SetTracking(this.FScrollUpdate === $mod.TTMSFNCTreeViewScrollUpdate.suContinuous);
        if (this.FCustomHorizontalScrollBar != null) this.FCustomHorizontalScrollBar.SetTracking(this.FScrollUpdate === $mod.TTMSFNCTreeViewScrollUpdate.suContinuous);
        this.UpdateTreeViewCache();
      };
    };
    this.GetColMinWidths = function (Col) {
      var Result = 0.0;
      var idx = 0;
      idx = this.FColumnMinW.IndexOf(Col);
      if (idx !== -1) {
        Result = this.FColumnMinW.GetItem$1(idx).FValue}
       else Result = this.FDefaultColumnMinWidth;
      return Result;
    };
    this.SetColMinWidths = function (Col, Value) {
      var idx = 0;
      var c = null;
      idx = this.FColumnMinW.IndexOf(Col);
      if ((idx >= 0) && (idx <= (this.FColumnMinW.GetCount() - 1))) {
        if (Value === this.FDefaultColumnMinWidth) {
          this.FColumnMinW.Delete(idx)}
         else {
          this.FColumnMinW.GetItem$1(idx).SetCellData(Math.max(0,Value));
          this.FColumnMinW.GetItem$1(idx).FCellVal = Col;
        };
      } else if (Value !== this.FDefaultColumnMinWidth) {
        c = this.FColumnMinW.Add$1();
        c.SetCellData(Math.max(0,Value));
        c.FCellVal = Col;
      };
    };
    this.SetDefaultColumnMinWidth = function (Value) {
      if (this.FDefaultColumnMinWidth !== Value) this.FDefaultColumnMinWidth = Value;
    };
    this.SetColumnMinW = function (Value) {
      this.FColumnMinW.Assign(Value);
    };
    this.UpdateTreeView = function () {
      this.SaveScrollPosition();
      this.UpdateNodesCache(true,true);
      this.RestoreScrollPosition();
      this.UpdateGroupsCache();
      this.UpdateColumnsCache();
    };
    this.IncUpdateCount$1 = function () {
      this.FUpdateCount$1 += 1;
    };
    this.DecUpdateCount$1 = function () {
      this.FUpdateCount$1 -= 1;
    };
    this.UpdateVisualRange = function () {
      var c = 0;
      var r = 0;
      var xval = 0.0;
      var yval = 0.0;
      var yoffs = 0.0;
      var cw = 0.0;
      var ch = 0.0;
      var vpos = 0.0;
      var hpos = 0.0;
      var cr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rh = 0.0;
      hpos = this.GetHorizontalScrollPosition();
      vpos = this.GetVerticalScrollPosition();
      yoffs = this.GetVScrollOffset();
      cr.$assign(this.GetContentRect());
      xval = -hpos;
      yval = -vpos;
      cw = cr.Right - cr.Left;
      ch = cr.Bottom - cr.Top;
      this.FStartCol = -1;
      this.FStartRow = -1;
      this.FStopCol = -1;
      this.FStopRow = -1;
      this.FStartX = cr.Left;
      this.FStopX = cr.Left;
      this.FStartY = cr.Top;
      this.FStopY = cr.Top;
      this.FStartOffset = 0;
      for (var $l = 0, $end = this.FColumnCount - 1; $l <= $end; $l++) {
        c = $l;
        xval = xval + this.GetColWidths(c);
        if ((xval > 0) && (this.FStartCol === -1)) {
          this.FStartCol = c;
          this.FStartX = this.FStartX + pas.System.Int(xval - this.GetColWidths(c));
        };
        if ((xval >= cw) && (this.FStopCol === -1)) {
          this.FStopCol = c;
          this.FStopX = this.FStopX + pas.System.Int(xval);
        };
        if ((this.FStartCol > -1) && (this.FStopCol > -1)) break;
      };
      for (var $l1 = 0, $end1 = this.FRowCount - 1; $l1 <= $end1; $l1++) {
        r = $l1;
        rh = this.GetRowHeight(r);
        yval = yval + rh;
        if ((yval > -yoffs) && (this.FStartRow === -1)) {
          this.FStartRow = r;
          this.FStartOffset = yval - rh;
          this.FStartY = this.FStartY + pas.System.Int(this.FStartOffset);
        };
        if ((yval >= ch) && (this.FStopRow === -1)) {
          this.FStopRow = r;
          this.FStopY = this.FStopY + pas.System.Int(yval);
        };
        if ((this.FStartRow > -1) && (this.FStopRow > -1)) break;
      };
      if ((this.FStartRow > -1) && (this.FStopRow === -1)) this.FStopRow = this.FRowCount - 1;
      if ((this.FStartCol > -1) && (this.FStopCol === -1)) this.FStopCol = this.FColumnCount - 1;
    };
    this.StretchColumns = function (AMode, AIndex, ANewWidth) {
      var Result = false;
      var tw = 0.0;
      var i = 0;
      var cw = 0.0;
      var t = 0.0;
      var vc = 0;
      var stc = 0;
      var sec = 0;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var horz = null;
      var vert = null;
      Result = false;
      horz = this.HorizontalScrollBar();
      vert = this.VerticalScrollBar();
      if (!(vert != null) || !(horz != null)) return Result;
      this.IncUpdateCount$1();
      try {
        if (ANewWidth > -1) {
          tw = ANewWidth}
         else {
          r.$assign(this.GetContentRect());
          tw = r.Right - r.Left;
          if (tw < 0) return Result;
        };
        stc = 0;
        sec = this.FColumnCount - 1;
        if ((AMode === $mod.TTMSFNCTreeViewStretchingMode.stmIndex) && (AIndex === -1)) {
          AIndex = sec;
          while (!this.IsColumnVisible(AIndex) && (AIndex > stc)) AIndex -= 1;
        };
        vc = 0;
        for (var $l = 0, $end = stc - 1; $l <= $end; $l++) {
          i = $l;
          if (this.IsColumnVisible(i)) tw = tw - this.GetColWidths(i);
        };
        for (var $l1 = this.FColumnCount - 1, $end1 = sec + 1; $l1 >= $end1; $l1--) {
          i = $l1;
          if (this.IsColumnVisible(i)) tw = tw - this.GetColWidths(i);
        };
        for (var $l2 = stc, $end2 = sec; $l2 <= $end2; $l2++) {
          i = $l2;
          if (this.IsColumnVisible(i)) {
            vc += 1;
            if ((i !== AIndex) && (AIndex !== -1) && (AMode === $mod.TTMSFNCTreeViewStretchingMode.stmIndex)) tw = tw - this.GetColWidths(i);
          };
        };
        if (AMode === $mod.TTMSFNCTreeViewStretchingMode.stmAll) {
          if (vc > 0) {
            cw = tw / vc;
            t = 0;
            for (var $l3 = stc, $end3 = sec; $l3 <= $end3; $l3++) {
              i = $l3;
              if (this.IsColumnVisible(i)) {
                if (i === sec) {
                  this.SetColWidths(i,Math.max(this.GetColMinWidths(i),pas.System.Int(tw - t)))}
                 else {
                  this.SetColWidths(i,Math.max(this.GetColMinWidths(i),pas.System.Int(cw)));
                  t = t + pas.System.Int(cw);
                };
              };
            };
            Result = true;
          };
        } else {
          if ((AIndex >= 0) && (AIndex < this.FColumnCount) && this.IsColumnVisible(AIndex)) {
            cw = tw;
            if (cw > 0) {
              this.SetColWidths(AIndex,Math.max(this.GetColMinWidths(AIndex),cw))}
             else this.SetColWidths(AIndex,this.FDefaultColumnWidth);
            Result = cw > 0;
          };
        };
      } finally {
        this.DecUpdateCount$1();
      };
      return Result;
    };
    this.StretchColumn = function (AStretchAll, ACol, ANewWidth) {
      if (AStretchAll) {
        this.StretchColumns($mod.TTMSFNCTreeViewStretchingMode.stmAll,-1,ANewWidth)}
       else this.StretchColumns($mod.TTMSFNCTreeViewStretchingMode.stmIndex,ACol,ANewWidth);
    };
    this.Scroll = function (AHorizontalPos, AVerticalPos) {
      this.FBlockScrollingUpdate = true;
      this.SetHScrollValue(AHorizontalPos);
      this.SetVScrollValue(AVerticalPos);
      this.FBlockScrollingUpdate = false;
      this.UpdateDisplay();
    };
    this.UpdateDisplay = function () {
    };
    this.VScrollChanged = function (Sender) {
      if (this.FBlockScrollingUpdate) return;
      if (!this.FIsMouseDown) this.StopAnimationTimer();
      this.VerticalScrollPositionChanged();
    };
    this.HScrollChanged = function (Sender) {
      if (this.FBlockScrollingUpdate) return;
      if (!this.FIsMouseDown) this.StopAnimationTimer();
      this.HorizontalScrollPositionChanged();
    };
    this.HCustomScrollChanged = function (Sender, AValue) {
      if (this.FBlockScrollingUpdate || !this.FCustomScrollBars) return;
      if (!this.FIsMouseDown) this.StopAnimationTimer();
      this.HorizontalScrollPositionChanged();
      this.SetHScrollValue(this.GetHScrollValue());
    };
    this.VCustomScrollChanged = function (Sender, AValue) {
      if (this.FBlockScrollingUpdate || !this.FCustomScrollBars) return;
      if (!this.FIsMouseDown) this.StopAnimationTimer();
      this.VerticalScrollPositionChanged();
      this.SetVScrollValue(this.GetVScrollValue());
    };
    this.UpdateScrollBars = function (AUpdate, ACalculate) {
      var vs = null;
      var hs = null;
      var vsc = null;
      var hsc = null;
      var w = 0.0;
      var h = 0.0;
      var cw = 0.0;
      var ch = 0.0;
      var cr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var vmgr = null;
      var hmgr = null;
      if ((this.FUpdateCount$1 > 0) || (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState)) return;
      this.FBlockScrollingUpdate = true;
      if (ACalculate) {
        this.UpdateAutoSizing();
        this.UpdateColumnRowCalculations(true);
      };
      vs = this.VerticalScrollBar();
      hs = this.HorizontalScrollBar();
      vsc = this.CustomVerticalScrollBar();
      hsc = this.CustomHorizontalScrollBar();
      if ((vs != null) && (hs != null) && (vsc != null) && (hsc != null)) {
        if (AUpdate) {
          cr.$assign(this.GetCalculationRect())}
         else cr.$assign(this.GetContentRect());
        cw = cr.Right - cr.Left;
        ch = cr.Bottom - cr.Top;
        w = this.GetTotalColumnWidth();
        h = this.GetTotalRowHeight();
        hs.SetVisible((w > 0) && (pas["WEBLib.TMSFNCTypes"].CompareValueEx(w,cw,0) === 1) && this.FHorizontalScrollBarVisible && !this.ColumnStretchingActive() && !this.FCustomScrollBars);
        vs.SetVisible((h > 0) && (pas["WEBLib.TMSFNCTypes"].CompareValueEx(h,ch,0) === 1) && this.FVerticalScrollBarVisible && !this.FCustomScrollBars);
        hsc.SetVisible((w > 0) && (pas["WEBLib.TMSFNCTypes"].CompareValueEx(w,cw,0) === 1) && this.FHorizontalScrollBarVisible && !this.ColumnStretchingActive() && this.FCustomScrollBars);
        vsc.SetVisible((h > 0) && (pas["WEBLib.TMSFNCTypes"].CompareValueEx(h,ch,0) === 1) && this.FVerticalScrollBarVisible && this.FCustomScrollBars);
        if (vsc.FVisible && this.FCustomScrollBars) {
          vsc.SetParent(this)}
         else vsc.SetParent(null);
        if (hsc.FVisible && this.FCustomScrollBars) {
          hsc.SetParent(this)}
         else hsc.SetParent(null);
        if (vs.FVisible && !this.FCustomScrollBars) {
          vs.SetParent(this)}
         else vs.SetParent(null);
        if (hs.FVisible && !this.FCustomScrollBars) {
          hs.SetParent(this)}
         else hs.SetParent(null);
        vmgr = pas["WEBLib.TMSFNCTypes"].TTMSFNCMargins.$create("Create$1");
        hmgr = pas["WEBLib.TMSFNCTypes"].TTMSFNCMargins.$create("Create$1");
        if (this.FCustomScrollBars) {
          if (vsc.FVisible && this.FStretchScrollBars) {
            hmgr.SetRight(vsc.GetWidth() + 1)}
           else hmgr.SetRight(1);
        } else {
          if (vs.FVisible && this.FStretchScrollBars) {
            hmgr.SetRight(vs.GetWidth() + 1)}
           else hmgr.SetRight(1);
        };
        vmgr.SetTop(1);
        vmgr.SetRight(1);
        hmgr.SetBottom(1);
        hmgr.SetLeft(1);
        if (this.FCustomScrollBars) {
          if (hsc.FVisible) {
            vmgr.SetBottom(hsc.GetHeight() + 1)}
           else vmgr.SetBottom(1);
        } else {
          if (hs.FVisible) {
            vmgr.SetBottom(hs.GetHeight() + 1)}
           else vmgr.SetBottom(1);
        };
        if (!this.FStretchScrollBars) {
          cr.$assign(this.GetCalculationRect());
          hmgr.SetLeft(hmgr.FLeft + cr.Left);
          hmgr.SetRight(hmgr.FRight + (this.GetWidth() - cr.Right));
          vmgr.SetTop(vmgr.FTop + cr.Top);
          vmgr.SetBottom(vmgr.FBottom + (this.GetHeight() - cr.Bottom));
        };
        hs.SetLeft(Math.round(hmgr.FLeft));
        hs.SetTop(Math.round(this.GetHeight() - hmgr.FBottom - hs.GetHeight()));
        vs.SetLeft(Math.round(this.GetWidth() - vmgr.FRight - vs.GetWidth()));
        vs.SetTop(Math.round(vmgr.FTop));
        hs.SetWidth(Math.round(Math.max(0,this.GetWidth() - hmgr.FRight - hmgr.FLeft)));
        vs.SetHeight(Math.round(Math.max(0,this.GetHeight() - vmgr.FBottom - vmgr.FTop)));
        vs.SetHeight(Math.round(Math.max(0,this.GetHeight() - vmgr.FBottom - vmgr.FTop)));
        hsc.SetLeft(Math.round(hmgr.FLeft));
        hsc.SetTop(Math.round(this.GetHeight() - hmgr.FBottom - hsc.GetHeight()));
        vsc.SetLeft(Math.round(this.GetWidth() - vmgr.FRight - vsc.GetWidth()));
        vsc.SetTop(Math.round(vmgr.FTop));
        hsc.SetWidth(Math.round(Math.max(0,this.GetWidth() - hmgr.FRight - hmgr.FLeft)));
        vsc.SetHeight(Math.round(Math.max(0,this.GetHeight() - vmgr.FBottom - vmgr.FTop)));
        hmgr = rtl.freeLoc(hmgr);
        vmgr = rtl.freeLoc(vmgr);
        cr.$assign(this.GetContentRect());
        cw = cr.Right - cr.Left;
        ch = cr.Bottom - cr.Top;
        if (this.FScrollMode === $mod.TTMSFNCTreeViewScrollMode.smNodeScrolling) {
          vs.SetPageSize(Math.round(Math.max(0,this.GetRowViewPortSize())));
          vs.SetMax(Math.max(vs.GetPageSize(),this.FRowCount));
        } else {
          vs.SetPageSize(Math.round(Math.max(0,Math.min(h,ch))));
          vs.SetMax(Math.round(Math.max(vs.GetPageSize(),h)));
          vs.FSmallChange = Math.round(this.FDefaultRowHeight);
          vs.FLargeChange = Math.max(1,vs.GetPageSize());
          vs.SetPosition(Math.min(vs.GetPosition(),vs.FMax));
        };
        if (this.FScrollMode === $mod.TTMSFNCTreeViewScrollMode.smNodeScrolling) {
          hs.SetPageSize(Math.round(Math.max(0,this.GetColumnViewPortSize())));
          hs.SetMax(Math.max(hs.GetPageSize(),this.FColumnCount));
        } else {
          hs.SetPageSize(Math.round(Math.max(0,Math.min(w,cw))));
          hs.SetMax(Math.round(Math.max(hs.GetPageSize(),w)));
          hs.SetPosition(Math.min(hs.GetPosition(),hs.FMax));
        };
        if (this.FScrollMode === $mod.TTMSFNCTreeViewScrollMode.smNodeScrolling) {
          vsc.SetPageSize(this.GetRowViewPortSize());
          vsc.SetMax(this.FRowCount);
        } else {
          vsc.SetPageSize(Math.min(h,ch));
          vsc.SetMax(h);
          vsc.FSmallChange = Math.round(this.FDefaultRowHeight);
          vsc.SetValue(Math.min(vsc.FValue,vsc.FMax - vsc.FPageSize));
        };
        if (this.FScrollMode === $mod.TTMSFNCTreeViewScrollMode.smNodeScrolling) {
          hsc.SetPageSize(this.GetColumnViewPortSize());
          hsc.SetMax(this.FColumnCount);
        } else {
          hsc.SetPageSize(Math.min(w,cw));
          hsc.SetMax(w);
          hsc.SetValue(Math.min(hsc.FValue,hsc.FMax - hsc.FPageSize));
        };
      };
      this.FBlockScrollingUpdate = false;
      if (AUpdate) this.UpdateScrollBars(false,false);
    };
    this.UpdateTreeViewCache = function () {
      if ((this.FUpdateCount$1 > 0) || this.FBlockUpdateNode || (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState) || (pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) return;
      this.ResetNodes(true);
      this.UpdateCalculations();
      this.UpdateColumns();
      this.UpdateScrollBars(true,true);
      this.UpdateNodesCache(true,true);
      this.UpdateGroupsCache();
      this.UpdateColumnsCache();
    };
    this.UpdateTreeViewDisplay = function () {
      this.UpdateScrollBars(true,true);
      this.UpdateDisplay();
    };
    this.Loaded = function () {
      pas["WEBLib.Controls"].TCustomControl.Loaded.call(this);
      this.UpdateTreeViewCache();
    };
    this.SetHScrollValue = function (AValue) {
      if (this.FCustomScrollBars) {
        if (this.CustomHorizontalScrollBar().FPageSize > 0) this.CustomHorizontalScrollBar().SetValue(Math.min(this.CustomHorizontalScrollBar().FMax - this.CustomHorizontalScrollBar().FPageSize,Math.max(0,AValue)));
      } else {
        this.HorizontalScrollBar().SetPosition(Math.round(Math.min(this.HorizontalScrollBar().FMax - this.HorizontalScrollBar().GetPageSize(),Math.max(0,AValue))));
      };
    };
    this.SetVScrollValue = function (AValue) {
      if (this.FCustomScrollBars) {
        if (this.CustomVerticalScrollBar().FPageSize > 0) this.CustomVerticalScrollBar().SetValue(Math.min(this.CustomVerticalScrollBar().FMax - this.CustomVerticalScrollBar().FPageSize,Math.max(0,AValue)));
      } else {
        this.VerticalScrollBar().SetPosition(Math.round(Math.min(this.VerticalScrollBar().FMax - this.VerticalScrollBar().GetPageSize(),Math.max(0,AValue))));
      };
    };
    this.UpdateControlAfterResize = function () {
      if ((this.FUpdateCount$1 > 0) || (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState) || (pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) return;
      this.ResetNodes(true);
      this.SaveScrollPosition();
      this.UpdateNodesCache(true,true);
      this.UpdateGroupsCache();
      this.UpdateColumnsCache();
      this.RestoreScrollPosition();
    };
    this.CanScrollDown = function () {
      var Result = false;
      Result = this.GetVerticalScrollPosition() < (this.GetTotalRowHeight() - this.GetVViewPortSize());
      return Result;
    };
    this.CanScrollUp = function () {
      var Result = false;
      Result = this.GetVerticalScrollPosition() > 0;
      return Result;
    };
    this.ScrollLimitation = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    this.IsColumnVisible = function (ACol) {
      var Result = false;
      Result = true;
      return Result;
    };
    this.GetRowHeight = function (ARow) {
      var Result = 0.0;
      Result = 0;
      return Result;
    };
    this.GetCalculationRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(this.GetLocalRect());
      return Result;
    };
    this.GetContentRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.GetContentRect.call(this));
      if (this.FCustomScrollBars) {
        if (this.CustomHorizontalScrollBar().FVisible) Result.Bottom = Result.Bottom - this.CustomHorizontalScrollBar().GetHeight() - 1;
        if (this.CustomVerticalScrollBar().FVisible) Result.Right = Result.Right - this.CustomVerticalScrollBar().GetWidth() - 1;
      } else {
        if (this.HorizontalScrollBar().FVisible) Result.Bottom = Result.Bottom - this.HorizontalScrollBar().GetHeight() - 1;
        if (this.VerticalScrollBar().FVisible) Result.Right = Result.Right - this.VerticalScrollBar().GetWidth() - 1;
      };
      return Result;
    };
    this.GetContentClipRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(this.GetContentRect());
      return Result;
    };
    this.GetHScrollValue = function () {
      var Result = 0.0;
      if (this.FCustomScrollBars) {
        Result = Math.min(this.CustomHorizontalScrollBar().FMax - this.CustomHorizontalScrollBar().FPageSize,Math.max(0,this.CustomHorizontalScrollBar().FValue))}
       else {
        Result = Math.round(Math.min(this.HorizontalScrollBar().FMax - this.HorizontalScrollBar().GetPageSize(),Math.max(0,this.HorizontalScrollBar().GetPosition())));
      };
      return Result;
    };
    this.GetVScrollValue = function () {
      var Result = 0.0;
      if (this.FCustomScrollBars) {
        Result = Math.min(this.CustomVerticalScrollBar().FMax - this.CustomVerticalScrollBar().FPageSize,Math.max(0,this.CustomVerticalScrollBar().FValue))}
       else {
        Result = Math.round(Math.min(this.VerticalScrollBar().FMax - this.VerticalScrollBar().GetPageSize(),Math.max(0,this.VerticalScrollBar().GetPosition())));
      };
      return Result;
    };
    this.GetVViewPortSize = function () {
      var Result = 0.0;
      if (this.FCustomScrollBars) {
        Result = this.CustomVerticalScrollBar().FPageSize}
       else {
        Result = this.VerticalScrollBar().GetPageSize();
      };
      return Result;
    };
    this.GetHViewPortSize = function () {
      var Result = 0.0;
      if (this.FCustomScrollBars) {
        Result = this.CustomHorizontalScrollBar().FPageSize}
       else {
        Result = this.HorizontalScrollBar().GetPageSize();
      };
      return Result;
    };
    this.GetVScrollOffset = function () {
      var Result = 0.0;
      Result = 0;
      return Result;
    };
    this.GetColumnViewPortSize = function () {
      var Result = 0.0;
      var I = 0;
      var cnt = 0;
      var w = 0.0;
      var cw = 0.0;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.$assign(this.GetContentRect());
      cw = r.Right - r.Left;
      Result = 0;
      w = 0;
      cnt = 0;
      for (var $l = this.FColumnCount - 1; $l >= 0; $l--) {
        I = $l;
        w = w + this.GetColWidths(I);
        if (w > cw) {
          Result = Math.max(1,cnt);
          break;
        };
        cnt += 1;
      };
      return Result;
    };
    this.GetRowViewPortSize = function () {
      var Result = 0.0;
      var I = 0;
      var cnt = 0;
      var h = 0.0;
      var ch = 0.0;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.$assign(this.GetContentRect());
      ch = r.Bottom - r.Top;
      Result = 0;
      h = 0;
      cnt = 0;
      for (var $l = this.FRowCount - 1; $l >= 0; $l--) {
        I = $l;
        h = h + this.GetRowHeight(I);
        if (h > ch) {
          Result = Math.max(1,cnt);
          break;
        };
        cnt += 1;
      };
      return Result;
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Create$1.apply(this,arguments);
      this.FDelayedLoading = false;
      this.FStretchScrollBars = true;
      this.FScrollUpdate = $mod.TTMSFNCTreeViewScrollUpdate.suContinuous;
      this.FCustomVerticalScrollBar = pas["WEBLib.TMSFNCScrollBar"].TTMSFNCScrollBar.$create("Create$1",[this]);
      this.FCustomVerticalScrollBar.SetParent(this);
      this.FCustomHorizontalScrollBar = pas["WEBLib.TMSFNCScrollBar"].TTMSFNCScrollBar.$create("Create$1",[this]);
      this.FCustomHorizontalScrollBar.SetParent(this);
      this.FVerticalScrollBar = pas["WEBLib.StdCtrls"].TScrollBar.$create("Create$1",[this]);
      this.FVerticalScrollBar.SetParent(this);
      this.FHorizontalScrollBar = pas["WEBLib.StdCtrls"].TScrollBar.$create("Create$1",[this]);
      this.FHorizontalScrollBar.SetParent(this);
      this.FCustomVerticalScrollBar.FAppearance.SetThumbButtonSize(0);
      this.FCustomHorizontalScrollBar.FAppearance.SetThumbButtonSize(0);
      this.FCustomHorizontalScrollBar.SetKind(pas["WEBLib.TMSFNCScrollBar"].TTMSFNCScrollBarKind.sbkHorizontal);
      this.FVerticalScrollBar.FDoubleBuffered = false;
      this.FHorizontalScrollBar.FDoubleBuffered = false;
      this.FVerticalScrollBar.SetKind(pas["WEBLib.Controls"].TScrollBarKind.sbVertical);
      this.FVerticalScrollBar.SetVisible(true);
      this.FHorizontalScrollBar.SetVisible(true);
      this.FCustomVerticalScrollBar.SetVisible(false);
      this.FCustomHorizontalScrollBar.SetVisible(false);
      this.FVerticalScrollBar.FOnChange = rtl.createCallback(this,"VScrollChanged");
      this.FHorizontalScrollBar.FOnChange = rtl.createCallback(this,"HScrollChanged");
      this.FCustomHorizontalScrollBar.FOnValueChange = rtl.createCallback(this,"HCustomScrollChanged");
      this.FCustomVerticalScrollBar.FOnValueChange = rtl.createCallback(this,"VCustomScrollChanged");
      this.FVerticalScrollBarVisible = true;
      this.FHorizontalScrollBarVisible = true;
      this.FScrollMode = $mod.TTMSFNCTreeViewScrollMode.smPixelScrolling;
      this.FColumnW = $mod.TTMSFNCTreeViewDoubleList.$create("Create$3",[this]);
      this.FColumnMinW = $mod.TTMSFNCTreeViewDoubleList.$create("Create$3",[this]);
      this.FColumnP = $mod.TTMSFNCTreeViewDoubleList.$create("Create$3",[this]);
      this.FDefaultRowHeight = 25;
      this.FDefaultColumnWidth = 75;
      this.FDefaultColumnMinWidth = 0;
      this.FColumnCount = 0;
      this.FRowCount = 0;
      this.FVerticalScrollBarVisible = true;
      this.FHorizontalScrollBarVisible = true;
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FColumnP");
      rtl.free(this,"FColumnMinW");
      rtl.free(this,"FColumnW");
      rtl.free(this,"FCustomVerticalScrollBar");
      rtl.free(this,"FCustomHorizontalScrollBar");
      rtl.free(this,"FVerticalScrollBar");
      rtl.free(this,"FHorizontalScrollBar");
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Destroy.call(this);
    };
    this.Assign = function (Source) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Assign.apply(this,arguments);
      if ($mod.TTMSFNCTreeViewBase.isPrototypeOf(Source)) {
        this.FScrollMode = rtl.as(Source,$mod.TTMSFNCTreeViewBase).FScrollMode;
        this.FStretchScrollBars = rtl.as(Source,$mod.TTMSFNCTreeViewBase).FStretchScrollBars;
      };
    };
    this.Resize = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Resize.call(this);
      this.UpdateControlAfterResize();
    };
    this.BeginUpdate = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBase.BeginUpdate.call(this);
      this.FUpdateCount$1 += 1;
    };
    this.EndUpdate = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBase.EndUpdate.call(this);
      this.FUpdateCount$1 -= 1;
      if (this.FUpdateCount$1 === 0) this.UpdateTreeViewCache();
    };
    this.SaveScrollPosition = function () {
      this.FSaveHScrollPos = this.GetHScrollValue();
      this.FSaveVScrollPos = this.GetVScrollValue();
    };
    this.RestoreScrollPosition = function () {
      this.Scroll(this.FSaveHScrollPos,this.FSaveVScrollPos);
    };
    this.AutoSizeColumn = function (ACol) {
      this.AutoSizeColumnInternal(ACol,true,true);
    };
    this.GetVerticalScrollPosition = function () {
      var Result = 0.0;
      var vVal = 0.0;
      vVal = this.GetVScrollValue();
      if (this.FScrollMode === $mod.TTMSFNCTreeViewScrollMode.smNodeScrolling) ;
      Result = vVal;
      return Result;
    };
    this.GetHorizontalScrollPosition = function () {
      var Result = 0.0;
      var hVal = 0.0;
      var scrollh = 0.0;
      hVal = this.GetHScrollValue();
      if (this.FScrollMode === $mod.TTMSFNCTreeViewScrollMode.smNodeScrolling) {
        scrollh = this.GetColPos(Math.round(hVal));
        hVal = scrollh;
      };
      Result = hVal;
      return Result;
    };
    this.HorizontalScrollBar = function () {
      var Result = null;
      Result = this.FHorizontalScrollBar;
      return Result;
    };
    this.VerticalScrollBar = function () {
      var Result = null;
      Result = this.FVerticalScrollBar;
      return Result;
    };
    this.CustomHorizontalScrollBar = function () {
      var Result = null;
      Result = this.FCustomHorizontalScrollBar;
      return Result;
    };
    this.CustomVerticalScrollBar = function () {
      var Result = null;
      Result = this.FCustomVerticalScrollBar;
      return Result;
    };
    this.StartCol = function () {
      var Result = 0;
      Result = this.FStartCol;
      return Result;
    };
    this.StopCol = function () {
      var Result = 0;
      Result = this.FStopCol;
      return Result;
    };
    this.StartX = function () {
      var Result = 0.0;
      Result = this.FStartX;
      return Result;
    };
    this.StopX = function () {
      var Result = 0.0;
      Result = this.FStopX;
      return Result;
    };
    this.StartRow = function () {
      var Result = 0;
      Result = this.FStartRow;
      return Result;
    };
    this.StartOffset = function () {
      var Result = 0.0;
      Result = this.FStartOffset;
      return Result;
    };
    this.StopRow = function () {
      var Result = 0;
      Result = this.FStopRow;
      return Result;
    };
    this.StartY = function () {
      var Result = 0.0;
      Result = this.FStartY;
      return Result;
    };
    this.StopY = function () {
      var Result = 0.0;
      Result = this.FStopY;
      return Result;
    };
    this.GetColumnWidth = function (AColumn) {
      var Result = 0.0;
      Result = this.GetColWidths(AColumn);
      return Result;
    };
    this.GetColumnPosition = function (AColumn) {
      var Result = 0.0;
      Result = this.GetColPos(AColumn);
      return Result;
    };
    this.GetTotalColumnNodeWidth = function () {
      var Result = 0.0;
      Result = this.FTotalColumnWidth;
      return Result;
    };
    this.GetTotalColumnWidth = function () {
      var Result = 0.0;
      Result = this.FTotalColumnWidth;
      return Result;
    };
    this.GetTotalRowHeight = function () {
      var Result = 0.0;
      Result = this.FTotalRowHeight;
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
},["Math","WEBLib.TMSFNCUtils","SysUtils","WEBLib.Forms"]);
rtl.module("WEBLib.TMSFNCTreeViewData",["System","Classes","WEBLib.TMSFNCTypes","WEBLib.TMSFNCGraphicsTypes","WEBLib.TMSFNCBitmapContainer","WEBLib.TMSFNCTreeViewBase","contnrs"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.MAXLEVELDEPTH = 100;
  this.MAXNODECOUNT = 2000000;
  this.$rtti.$Class("TTMSFNCTreeViewCacheItem");
  this.$rtti.$Class("TTMSFNCTreeViewData");
  this.$rtti.$Class("TTMSFNCTreeViewGroup");
  this.$rtti.$Class("TTMSFNCTreeViewColumn");
  this.$rtti.$Class("TTMSFNCTreeViewNode");
  this.TTMSFNCTreeViewNodeScrollPosition = {"0": "tvnspTop", tvnspTop: 0, "1": "tvnspBottom", tvnspBottom: 1, "2": "tvnspMiddle", tvnspMiddle: 2};
  this.$rtti.$Enum("TTMSFNCTreeViewNodeScrollPosition",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCTreeViewNodeScrollPosition});
  rtl.recNewT(this,"TTMSFNCTreeViewVirtualNodeRemoveData",function () {
    this.RowIndex = 0;
    this.Count = 0;
    this.ParentNode = 0;
    this.$eq = function (b) {
      return (this.RowIndex === b.RowIndex) && (this.Count === b.Count) && (this.ParentNode === b.ParentNode);
    };
    this.$assign = function (s) {
      this.RowIndex = s.RowIndex;
      this.Count = s.Count;
      this.ParentNode = s.ParentNode;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCTreeViewVirtualNodeRemoveData",{},this);
    $r.addField("RowIndex",rtl.longint);
    $r.addField("Count",rtl.longint);
    $r.addField("ParentNode",rtl.longint);
  });
  this.$rtti.$DynArray("TTMSFNCArrayTRectF",{eltype: pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]});
  this.$rtti.$DynArray("TTMSFNCArrayBoolean",{eltype: rtl.boolean});
  rtl.createClass(this,"TTMSFNCTreeViewVirtualNode",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FTreeView = null;
      this.FLevel = 0;
      this.FAddedToVisibleList = false;
      this.FChildren = 0;
      this.FParentNode = 0;
      this.FExpanded = false;
      this.FTotalChildren = 0;
      this.FIndex = 0;
      this.FRow = 0;
      this.FHeight = 0.0;
      this.FCalculated = false;
      this.FCache = null;
      this.FTextRects = [];
      this.FBitmapRects = [];
      this.FExpandRects = [];
      this.FCheckRects = [];
      this.FCheckStates = [];
      this.FNode = null;
      this.FExtended = false;
      this.FExtraRects = [];
      this.FTitleRects = [];
      this.FTitleHeight = 0.0;
      this.FTitleExtraRects = [];
      this.FDataPointer = null;
      this.FDataBoolean = false;
      this.FDataString = "";
      this.FDataObject = null;
      this.FDataInteger = 0;
    };
    this.$final = function () {
      this.FTreeView = undefined;
      this.FCache = undefined;
      this.FTextRects = undefined;
      this.FBitmapRects = undefined;
      this.FExpandRects = undefined;
      this.FCheckRects = undefined;
      this.FCheckStates = undefined;
      this.FNode = undefined;
      this.FExtraRects = undefined;
      this.FTitleRects = undefined;
      this.FTitleExtraRects = undefined;
      this.FDataObject = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.GetText = function (AColumn) {
      var Result = "";
      Result = "";
      if (this.FTreeView != null) Result = this.FTreeView.GetVirtualNodeText(this,AColumn);
      return Result;
    };
    this.GetTitle = function (AColumn) {
      var Result = "";
      Result = "";
      if (this.FTreeView != null) Result = this.FTreeView.GetVirtualNodeTitle(this,AColumn);
      return Result;
    };
    this.GetTitleExpanded = function (AColumn) {
      var Result = false;
      Result = true;
      if (this.FTreeView != null) Result = this.FTreeView.GetVirtualNodeTitleExpanded(this,AColumn);
      return Result;
    };
    this.GetParent = function () {
      var Result = null;
      Result = null;
      if (this.FTreeView != null) Result = this.FTreeView.GetParentVirtualNode(this);
      return Result;
    };
    this.GetChildCount = function () {
      var Result = 0;
      Result = 0;
      if (this.FTreeView != null) Result = this.FTreeView.GetVirtualNodeChildCount(this);
      return Result;
    };
    this.GetPrevious = function () {
      var Result = null;
      Result = null;
      if (this.FTreeView != null) Result = this.FTreeView.GetPreviousVirtualNode(this);
      return Result;
    };
    this.GetNext = function () {
      var Result = null;
      Result = null;
      if (this.FTreeView != null) Result = this.FTreeView.GetNextVirtualNode(this);
      return Result;
    };
    this.GetPreviousChild = function (ANode) {
      var Result = null;
      Result = null;
      if (this.FTreeView != null) Result = this.FTreeView.GetPreviousChildVirtualNode(this,ANode);
      return Result;
    };
    this.GetNextChild = function (ANode) {
      var Result = null;
      Result = null;
      if (this.FTreeView != null) Result = this.FTreeView.GetNextChildVirtualNode(this,ANode);
      return Result;
    };
    this.GetNextSibling = function () {
      var Result = null;
      Result = null;
      if (this.FTreeView != null) Result = this.FTreeView.GetNextSiblingVirtualNode(this);
      return Result;
    };
    this.GetPreviousSibling = function () {
      var Result = null;
      Result = null;
      if (this.FTreeView != null) Result = this.FTreeView.GetPreviousSiblingVirtualNode(this);
      return Result;
    };
    this.GetFirstChild = function () {
      var Result = null;
      Result = null;
      if (this.FTreeView != null) Result = this.FTreeView.GetFirstChildVirtualNode(this);
      return Result;
    };
    this.GetLastChild = function () {
      var Result = null;
      Result = null;
      if (this.FTreeView != null) Result = this.FTreeView.GetLastChildVirtualNode(this);
      return Result;
    };
    this.RemoveChildren = function () {
      if (this.FTreeView != null) this.FTreeView.RemoveVirtualNodeChildren(this);
    };
    this.Expand = function (ARecurse) {
      if (this.FTreeView != null) this.FTreeView.ExpandVirtualNode(this,ARecurse);
    };
    this.Collapse = function (ARecurse) {
      if (this.FTreeView != null) this.FTreeView.CollapseVirtualNode(this,ARecurse);
    };
    this.CopyFrom = function (Source) {
      if (Source != null) {
        this.FChildren = rtl.as(Source,$mod.TTMSFNCTreeViewVirtualNode).FChildren;
        this.FTotalChildren = rtl.as(Source,$mod.TTMSFNCTreeViewVirtualNode).FTotalChildren;
        this.FExpanded = rtl.as(Source,$mod.TTMSFNCTreeViewVirtualNode).FExpanded;
        this.FExtended = rtl.as(Source,$mod.TTMSFNCTreeViewVirtualNode).FExtended;
        this.FLevel = rtl.as(Source,$mod.TTMSFNCTreeViewVirtualNode).FLevel;
        this.FRow = rtl.as(Source,$mod.TTMSFNCTreeViewVirtualNode).FRow;
        this.FCalculated = rtl.as(Source,$mod.TTMSFNCTreeViewVirtualNode).FCalculated;
        this.FHeight = rtl.as(Source,$mod.TTMSFNCTreeViewVirtualNode).FHeight;
        this.FParentNode = rtl.as(Source,$mod.TTMSFNCTreeViewVirtualNode).FParentNode;
        this.FIndex = rtl.as(Source,$mod.TTMSFNCTreeViewVirtualNode).FIndex;
        this.FTextRects = rtl.as(Source,$mod.TTMSFNCTreeViewVirtualNode).FTextRects;
        this.FExtraRects = rtl.as(Source,$mod.TTMSFNCTreeViewVirtualNode).FExtraRects;
        this.FBitmapRects = rtl.as(Source,$mod.TTMSFNCTreeViewVirtualNode).FBitmapRects;
        this.FCheckRects = rtl.as(Source,$mod.TTMSFNCTreeViewVirtualNode).FCheckRects;
        this.FExpandRects = rtl.as(Source,$mod.TTMSFNCTreeViewVirtualNode).FExpandRects;
        this.FCheckStates = rtl.as(Source,$mod.TTMSFNCTreeViewVirtualNode).FCheckStates;
        this.FNode = rtl.as(Source,$mod.TTMSFNCTreeViewVirtualNode).FNode;
      };
    };
    this.Create$1 = function (ATreeView) {
      this.FTreeView = ATreeView;
      return this;
    };
    this.Destroy = function () {
      this.FCache = null;
      this.FNode = null;
      pas.System.TObject.Destroy.call(this);
    };
  });
  this.TTMSFNCTreeViewCacheItemKind = {"0": "ikNode", ikNode: 0, "1": "ikColumnTop", ikColumnTop: 1, "2": "ikColumnBottom", ikColumnBottom: 2, "3": "ikGroupTop", ikGroupTop: 3, "4": "ikGroupBottom", ikGroupBottom: 4};
  this.$rtti.$Enum("TTMSFNCTreeViewCacheItemKind",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TTMSFNCTreeViewCacheItemKind});
  rtl.createClass(this,"TTMSFNCTreeViewCacheItem",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FDrawRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FKind = 0;
      this.FGroup = 0;
      this.FColumn = 0;
      this.FNode = null;
      this.FRow = 0;
      this.FCol = 0;
      this.FStartColumn = 0;
      this.FEndColumn = 0;
    };
    this.$final = function () {
      this.FRect = undefined;
      this.FDrawRect = undefined;
      this.FNode = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.CreateNode = function (ARect, ANode) {
      var Result = null;
      Result = $mod.TTMSFNCTreeViewCacheItem.$create("Create");
      Result.FKind = $mod.TTMSFNCTreeViewCacheItemKind.ikNode;
      Result.FRect.$assign(ARect);
      Result.FNode = ANode;
      return Result;
    };
    this.CreateColumnTop = function (ARect, AColumn) {
      var Result = null;
      Result = $mod.TTMSFNCTreeViewCacheItem.$create("Create");
      Result.FKind = $mod.TTMSFNCTreeViewCacheItemKind.ikColumnTop;
      Result.FColumn = AColumn;
      Result.FRect.$assign(ARect);
      return Result;
    };
    this.CreateGroupTop = function (ARect, AGroup, AStartColumn, AEndColumn) {
      var Result = null;
      Result = $mod.TTMSFNCTreeViewCacheItem.$create("Create");
      Result.FKind = $mod.TTMSFNCTreeViewCacheItemKind.ikGroupTop;
      Result.FGroup = AGroup;
      Result.FStartColumn = AStartColumn;
      Result.FEndColumn = AEndColumn;
      Result.FRect.$assign(ARect);
      return Result;
    };
    this.CreateColumnBottom = function (ARect, AColumn) {
      var Result = null;
      Result = $mod.TTMSFNCTreeViewCacheItem.$create("Create");
      Result.FKind = $mod.TTMSFNCTreeViewCacheItemKind.ikColumnBottom;
      Result.FColumn = AColumn;
      Result.FRect.$assign(ARect);
      return Result;
    };
    this.CreateGroupBottom = function (ARect, AGroup, AStartColumn, AEndColumn) {
      var Result = null;
      Result = $mod.TTMSFNCTreeViewCacheItem.$create("Create");
      Result.FKind = $mod.TTMSFNCTreeViewCacheItemKind.ikGroupBottom;
      Result.FGroup = AGroup;
      Result.FStartColumn = AStartColumn;
      Result.FEndColumn = AEndColumn;
      Result.FRect.$assign(ARect);
      return Result;
    };
    this.Destroy = function () {
      this.FNode = null;
      pas.System.TObject.Destroy.call(this);
    };
  });
  rtl.createClass(this,"TTMSFNCTreeViewCacheItemList",pas.Classes.TList,function () {
    this.GetItem = function (Index) {
      var Result = null;
      Result = rtl.getObject(this.Get(Index));
      return Result;
    };
    this.SetItem = function (Index, Value) {
      this.Put(Index,Value);
    };
  });
  rtl.createClass(this,"TTMSFNCTreeViewIntegerList",pas.Classes.TList,function () {
    this.GetItem = function (Index) {
      var Result = 0;
      Result = rtl.trunc(this.Get(Index));
      return Result;
    };
    this.SetItem = function (Index, Value) {
      this.Put(Index,Value);
    };
  });
  this.$rtti.$DynArray("TTMSFNCTreeViewVirtualNodeArray",{eltype: this.$rtti["TTMSFNCTreeViewVirtualNode"]});
  this.TTMSFNCTreeViewColumnEditorType = {"0": "tcetEdit", tcetEdit: 0, "1": "tcetComboBox", tcetComboBox: 1, "2": "tcetMemo", tcetMemo: 2, "3": "tcetNone", tcetNone: 3};
  this.$rtti.$Enum("TTMSFNCTreeViewColumnEditorType",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TTMSFNCTreeViewColumnEditorType});
  this.TTMSFNCTreeViewNodesSortMode = {"0": "nsmAscending", nsmAscending: 0, "1": "nsmDescending", nsmDescending: 1};
  this.$rtti.$Enum("TTMSFNCTreeViewNodesSortMode",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCTreeViewNodesSortMode});
  this.TTMSFNCTreeViewNodesSortKind = {"0": "nskNone", nskNone: 0, "1": "nskAscending", nskAscending: 1, "2": "nskDescending", nskDescending: 2};
  this.$rtti.$Enum("TTMSFNCTreeViewNodesSortKind",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCTreeViewNodesSortKind});
  this.TTMSFNCTreeViewColumnSorting = {"0": "tcsNone", tcsNone: 0, "1": "tcsNormal", tcsNormal: 1, "2": "tcsRecursive", tcsRecursive: 2, "3": "tcsNormalCaseSensitive", tcsNormalCaseSensitive: 3, "4": "tcsRecursiveCaseSensitive", tcsRecursiveCaseSensitive: 4};
  this.$rtti.$Enum("TTMSFNCTreeViewColumnSorting",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TTMSFNCTreeViewColumnSorting});
  rtl.createClass(this,"TTMSFNCTreeViewColumnFiltering",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FColumn = null;
      this.FEnabled = false;
      this.FMultiColumn = false;
      this.FDropDownHeight = 0;
      this.FDropDownWidth = 0;
      this.FButtonSize = 0.0;
    };
    this.$final = function () {
      this.FColumn = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetEnabled = function (Value) {
      if (this.FEnabled !== Value) {
        this.FEnabled = Value;
        if (this.FColumn != null) this.FColumn.UpdateColumn();
      };
    };
    this.IsButtonSizeStored = function () {
      var Result = false;
      Result = this.FButtonSize !== 15;
      return Result;
    };
    this.SetButtonSize = function (Value) {
      if (this.FButtonSize !== Value) {
        this.FButtonSize = Value;
        if (this.FColumn != null) this.FColumn.UpdateColumn();
      };
    };
    this.Create$1 = function (AColumn) {
      this.FColumn = AColumn;
      this.FEnabled = false;
      this.FDropDownWidth = 100;
      this.FDropDownHeight = 120;
      this.FMultiColumn = false;
      this.FButtonSize = 15;
      return this;
    };
    this.Destroy = function () {
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCTreeViewColumnFiltering.isPrototypeOf(Source)) {
        this.FEnabled = rtl.as(Source,$mod.TTMSFNCTreeViewColumnFiltering).FEnabled;
        this.FDropDownWidth = rtl.as(Source,$mod.TTMSFNCTreeViewColumnFiltering).FDropDownWidth;
        this.FDropDownHeight = rtl.as(Source,$mod.TTMSFNCTreeViewColumnFiltering).FDropDownHeight;
        this.FMultiColumn = rtl.as(Source,$mod.TTMSFNCTreeViewColumnFiltering).FMultiColumn;
        this.FButtonSize = rtl.as(Source,$mod.TTMSFNCTreeViewColumnFiltering).FButtonSize;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: false});
    $r.addProperty("DropDownWidth",0,rtl.longint,"FDropDownWidth","FDropDownWidth",4,{Default: 100});
    $r.addProperty("DropDownHeight",0,rtl.longint,"FDropDownHeight","FDropDownHeight",4,{Default: 120});
    $r.addProperty("MultiColumn",0,rtl.boolean,"FMultiColumn","FMultiColumn",4,{Default: false});
    $r.addProperty("ButtonSize",14,rtl.double,"FButtonSize","SetButtonSize",4,{stored: "IsButtonSizeStored"});
  });
  this.TTMSFNCTreeViewFilterOperation = {"0": "tfoSHORT", tfoSHORT: 0, "1": "tfoNONE", tfoNONE: 1, "2": "tfoAND", tfoAND: 2, "3": "tfoXOR", tfoXOR: 3, "4": "tfoOR", tfoOR: 4};
  this.$rtti.$Enum("TTMSFNCTreeViewFilterOperation",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TTMSFNCTreeViewFilterOperation});
  rtl.createClass(this,"TTMSFNCTreeViewFilterData",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FColumn = 0;
      this.FCondition = "";
      this.FCaseSensitive = false;
      this.FSuffix = "";
      this.FPrefix = "";
      this.FOperation = 0;
    };
    this.Create$1 = function (ACollection) {
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      this.FCaseSensitive = true;
      return this;
    };
    this.Assign = function (Source) {
      var ASrcFilterData = null;
      ASrcFilterData = rtl.as(Source,$mod.TTMSFNCTreeViewFilterData);
      if (ASrcFilterData != null) {
        this.FColumn = ASrcFilterData.FColumn;
        this.FCondition = ASrcFilterData.FCondition;
        this.FCaseSensitive = ASrcFilterData.FCaseSensitive;
        this.FPrefix = ASrcFilterData.FPrefix;
        this.FSuffix = ASrcFilterData.FSuffix;
        this.FOperation = ASrcFilterData.FOperation;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Column",0,rtl.smallint,"FColumn","FColumn");
    $r.addProperty("Condition",0,rtl.string,"FCondition","FCondition");
    $r.addProperty("CaseSensitive",0,rtl.boolean,"FCaseSensitive","FCaseSensitive",4,{Default: true});
    $r.addProperty("Prefix",0,rtl.string,"FPrefix","FPrefix");
    $r.addProperty("Suffix",0,rtl.string,"FSuffix","FSuffix");
    $r.addProperty("Operation",0,$mod.$rtti["TTMSFNCTreeViewFilterOperation"],"FOperation","FOperation");
  });
  rtl.createClass(this,"TTMSFNCTreeViewFilter",pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$init.call(this);
      this.FOwner$1 = null;
    };
    this.$final = function () {
      this.FOwner$1 = undefined;
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$final.call(this);
    };
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.GetItem.call(this,Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      pas.Classes.TCollection.SetItem.call(this,Index,Value);
    };
    this.GetColFilter = function (Col) {
      var Result = null;
      var i = 0;
      for (var $l = 1, $end = this.GetCount(); $l <= $end; $l++) {
        i = $l;
        if (this.GetItem$1(i - 1).FColumn === Col) {
          Result = this.GetItem$1(i - 1);
          return Result;
        };
      };
      Result = this.Add$1();
      Result.FColumn = Col;
      return Result;
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,$mod.TTMSFNCTreeViewFilterData);
      this.FOwner$1 = AOwner;
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      if (this.GetCount() === 1) {
        Result.FOperation = $mod.TTMSFNCTreeViewFilterOperation.tfoNONE}
       else Result.FOperation = $mod.TTMSFNCTreeViewFilterOperation.tfoAND;
      return Result;
    };
    this.Insert$1 = function (index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,index);
      return Result;
    };
    this.HasFilter = function (Col) {
      var Result = false;
      var i = 0;
      Result = false;
      for (var $l = 1, $end = this.GetCount(); $l <= $end; $l++) {
        i = $l;
        if (this.GetItem$1(i - 1).FColumn === Col) {
          Result = true;
          break;
        };
      };
      return Result;
    };
    this.RemoveColumnFilter = function (Col) {
      var i = 0;
      i = this.GetCount();
      while (i > 0) {
        i -= 1;
        if (this.GetItem$1(i).FColumn === Col) this.Delete(i);
      };
    };
  });
  rtl.createClass(this,"TTMSFNCTreeViewColumn",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FSortKind = 0;
      this.FTag = 0;
      this.FDataString = "";
      this.FDataObject = null;
      this.FDataInteger = 0;
      this.FTreeView = null;
      this.FText = "";
      this.FName = "";
      this.FDBKey = "";
      this.FDataBoolean = false;
      this.FWordWrapping = false;
      this.FVerticalTextAlign = 0;
      this.FTrimming = 0;
      this.FHorizontalTextAlign = 0;
      this.FWidth = 0.0;
      this.FVisible = false;
      this.FUseDefaultAppearance = false;
      this.FBottomFill = null;
      this.FBottomStroke = null;
      this.FTopFill = null;
      this.FTopStroke = null;
      this.FTopFont = null;
      this.FBottomFont = null;
      this.FFont = null;
      this.FFill = null;
      this.FStroke = null;
      this.FEditorType = 0;
      this.FDisabledFontColor = 0;
      this.FSelectedFontColor = 0;
      this.FEditorItems = null;
      this.FCustomEditor = false;
      this.FSorting = 0;
      this.FSortIndex = 0;
      this.FFiltering = null;
      this.FDataPointer = null;
      this.FTitleTrimming = 0;
      this.FTitleHorizontalTextAlign = 0;
      this.FTitleWordWrapping = false;
      this.FTitleVerticalTextAlign = 0;
      this.FDisabledTitleFontColor = 0;
      this.FSelectedTitleFontColor = 0;
      this.FTitleFont = null;
      this.FExpanded = false;
      this.FExpandable = false;
      this.FExpandingButtonSize = 0.0;
      this.FHTMLTemplate = "";
      this.FMinimumWidth = 0.0;
    };
    this.$final = function () {
      this.FDataObject = undefined;
      this.FTreeView = undefined;
      this.FBottomFill = undefined;
      this.FBottomStroke = undefined;
      this.FTopFill = undefined;
      this.FTopStroke = undefined;
      this.FTopFont = undefined;
      this.FBottomFont = undefined;
      this.FFont = undefined;
      this.FFill = undefined;
      this.FStroke = undefined;
      this.FEditorItems = undefined;
      this.FFiltering = undefined;
      this.FTitleFont = undefined;
      pas.Classes.TCollectionItem.$final.call(this);
    };
    this.SetText = function (Value) {
      if (this.FText !== Value) {
        this.FText = Value;
        this.UpdateColumn();
      };
    };
    this.SetName = function (Value) {
      if (this.FName !== Value) {
        this.FName = Value;
      };
    };
    this.SetHorizontalTextAlign = function (Value) {
      if (this.FHorizontalTextAlign !== Value) {
        this.FHorizontalTextAlign = Value;
        this.UpdateColumn();
      };
    };
    this.SetTrimming = function (Value) {
      if (this.FTrimming !== Value) {
        this.FTrimming = Value;
        this.UpdateColumn();
      };
    };
    this.SetVerticalTextAlign = function (Value) {
      if (this.FVerticalTextAlign !== Value) {
        this.FVerticalTextAlign = Value;
        this.UpdateColumn();
      };
    };
    this.SetWordWrapping = function (Value) {
      if (this.FWordWrapping !== Value) {
        this.FWordWrapping = Value;
        this.UpdateColumn();
      };
    };
    this.SetWidth = function (Value) {
      if (this.FWidth !== Value) {
        this.FWidth = Value;
        this.UpdateColumn();
      };
    };
    this.SetVisible = function (Value) {
      if (this.FVisible !== Value) {
        this.FVisible = Value;
        this.UpdateColumn();
      };
    };
    this.SetUseDefaultAppearance = function (Value) {
      if (this.FUseDefaultAppearance !== Value) {
        this.FUseDefaultAppearance = Value;
        this.UpdateColumn();
      };
    };
    this.SetBottomFill = function (Value) {
      if (this.FBottomFill !== Value) this.FBottomFill.Assign(Value);
    };
    this.SetBottomStroke = function (Value) {
      if (this.FBottomStroke !== Value) this.FBottomStroke.Assign(Value);
    };
    this.SetTopFill = function (Value) {
      if (this.FTopFill !== Value) this.FTopFill.Assign(Value);
    };
    this.SetTopStroke = function (Value) {
      if (this.FTopStroke !== Value) this.FTopStroke.Assign(Value);
    };
    this.SetBottomFont = function (Value) {
      if (this.FBottomFont !== Value) this.FBottomFont.Assign(Value);
    };
    this.SetTopFont = function (Value) {
      if (this.FTopFont !== Value) this.FTopFont.Assign(Value);
    };
    this.SetFill = function (Value) {
      if (this.FFill !== Value) this.FFill.Assign(Value);
    };
    this.SetFont = function (Value) {
      if (this.FFont !== Value) this.FFont.Assign(Value);
    };
    this.SetStroke = function (Value) {
      if (this.FStroke !== Value) this.FStroke.Assign(Value);
    };
    this.SetEditorType = function (Value) {
      if (this.FEditorType !== Value) this.FEditorType = Value;
    };
    this.SetDisabledFontColor = function (Value) {
      if (this.FDisabledFontColor !== Value) {
        this.FDisabledFontColor = Value;
        this.Changed$1(this);
      };
    };
    this.SetSelectedFontColor = function (Value) {
      if (this.FSelectedFontColor !== Value) {
        this.FSelectedFontColor = Value;
        this.Changed$1(this);
      };
    };
    this.SetEditorItems = function (Value) {
      this.FEditorItems.Assign(Value);
    };
    this.SetSorting = function (Value) {
      if (this.FSorting !== Value) {
        this.FSorting = Value;
        this.Changed$1(this);
      };
    };
    this.SetSortKind = function (Value) {
      if (this.FSortKind !== Value) {
        this.FSortKind = Value;
        this.Changed$1(this);
      };
    };
    this.SetSortIndex = function (Value) {
      if (this.FSortIndex !== Value) {
        this.FSortIndex = Value;
        this.Changed$1(this);
      };
    };
    this.SetFiltering = function (Value) {
      if (this.FFiltering !== Value) this.FFiltering.Assign(Value);
    };
    this.SetTitleHorizontalTextAlign = function (Value) {
      if (this.FTitleHorizontalTextAlign !== Value) {
        this.FTitleHorizontalTextAlign = Value;
        this.UpdateColumn();
      };
    };
    this.SetTitleTrimming = function (Value) {
      if (this.FTitleTrimming !== Value) {
        this.FTitleTrimming = Value;
        this.UpdateColumn();
      };
    };
    this.SetTitleVerticalTextAlign = function (Value) {
      if (this.FTitleVerticalTextAlign !== Value) {
        this.FTitleVerticalTextAlign = Value;
        this.UpdateColumn();
      };
    };
    this.SetTitleWordWrapping = function (Value) {
      if (this.FTitleWordWrapping !== Value) {
        this.FTitleWordWrapping = Value;
        this.UpdateColumn();
      };
    };
    this.SetDisabledTitleFontColor = function (Value) {
      if (this.FDisabledTitleFontColor !== Value) {
        this.FDisabledTitleFontColor = Value;
        this.UpdateColumn();
      };
    };
    this.SetSelectedTitleFontColor = function (Value) {
      if (this.FSelectedTitleFontColor !== Value) {
        this.FSelectedTitleFontColor = Value;
        this.Changed$1(this);
      };
    };
    this.SetTitleFont = function (Value) {
      if (this.FTitleFont !== Value) this.FTitleFont.Assign(Value);
    };
    this.SetExpanded = function (Value) {
      if (this.FExpanded !== Value) {
        this.FExpanded = Value;
        this.UpdateColumn();
      };
    };
    this.SetExpandable = function (Value) {
      if (this.FExpandable !== Value) {
        this.FExpandable = Value;
        this.UpdateColumn();
      };
    };
    this.IsExpandingButtonSizeStored = function () {
      var Result = false;
      Result = this.FExpandingButtonSize !== 15;
      return Result;
    };
    this.SetExpandingButtonSize = function (Value) {
      this.FExpandingButtonSize = Value;
    };
    this.SetHTMLTemplate = function (Value) {
      if (this.FHTMLTemplate !== Value) {
        this.FHTMLTemplate = Value;
        if (this.FTreeView != null) this.FTreeView.UpdateTreeView();
      };
    };
    this.SetMinimumWidth = function (Value) {
      if (this.FMinimumWidth !== Value) {
        this.FMinimumWidth = Value;
        this.UpdateColumn();
      };
    };
    this.UpdateColumn = function () {
      var t = null;
      t = this.TreeView();
      if (t != null) {
        t.UpdateColumns();
        t.UpdateTreeViewCache();
      };
    };
    this.Changed$1 = function (Sender) {
      this.UpdateColumn();
    };
    this.GetText = function () {
      var Result = "";
      Result = this.FText;
      if (Result === "") {
        Result = this.FName;
        if (Result === "") Result = $mod.TranslateTextEx(rtl.getResStr($mod,"sTMSFNCTreeViewColumn")) + " " + pas.SysUtils.IntToStr(this.GetIndex());
      };
      return Result;
    };
    this.GetColumnText = function () {
      var Result = "";
      Result = this.FText;
      if ((Result === "") || (pas.System.Pos("</",Result) > 0) || (pas.System.Pos("/>",Result) > 0) || (pas.System.Pos("<BR>",pas.SysUtils.UpperCase(Result)) > 0)) {
        Result = this.FName;
        if (Result === "") Result = $mod.TranslateTextEx(rtl.getResStr($mod,"sTMSFNCTreeViewColumn")) + " " + pas.SysUtils.IntToStr(this.GetIndex());
      };
      return Result;
    };
    this.GetDisplayName = function () {
      var Result = "";
      if (this.FName !== "") {
        Result = this.FName}
       else Result = "";
      return Result;
    };
    this.TreeView = function () {
      var Result = null;
      Result = this.FTreeView;
      return Result;
    };
    this.Create$1 = function (ACollection) {
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      if (this.FCollection != null) this.FTreeView = rtl.as(this.FCollection,$mod.TTMSFNCTreeViewColumns).TreeView();
      this.FSorting = $mod.TTMSFNCTreeViewColumnSorting.tcsNone;
      this.FExpandingButtonSize = 15;
      this.FExpanded = true;
      this.FSortIndex = -1;
      this.FSortKind = $mod.TTMSFNCTreeViewNodesSortKind.nskNone;
      this.FFiltering = $mod.TTMSFNCTreeViewColumnFiltering.$create("Create$1",[this]);
      this.FEditorType = $mod.TTMSFNCTreeViewColumnEditorType.tcetNone;
      this.FWordWrapping = false;
      this.FTrimming = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone;
      this.FCustomEditor = false;
      this.FHorizontalTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading;
      this.FVerticalTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      this.FTitleWordWrapping = false;
      this.FTitleTrimming = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone;
      this.FTitleHorizontalTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading;
      this.FTitleVerticalTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      this.FEditorItems = pas.Classes.TStringList.$create("Create$1");
      if (this.FCollection != null) this.FText = $mod.TranslateTextEx(rtl.getResStr($mod,"sTMSFNCTreeViewColumn")) + " " + pas.SysUtils.IntToStr(this.FCollection.GetCount() - 1);
      this.FName = pas.SysUtils.StringReplace(this.FText," ","",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
      this.FWidth = 100;
      this.FVisible = true;
      this.FUseDefaultAppearance = true;
      this.FBottomFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone,16777215,8421504,-1,-1]);
      this.FBottomStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,11119017,1.0]);
      this.FTopFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone,16777215,8421504,-1,-1]);
      this.FTopStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,11119017,1.0]);
      this.FFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,-1,8421504,-1,-1]);
      this.FStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,11119017,1.0]);
      this.FSelectedFontColor = 16777215;
      this.FDisabledFontColor = 12632256;
      this.FSelectedTitleFontColor = 16777215;
      this.FDisabledTitleFontColor = 12632256;
      this.FFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FTitleFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FTopFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FBottomFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FBottomFill.FOnChanged = rtl.createCallback(this,"Changed$1");
      this.FTopFill.FOnChanged = rtl.createCallback(this,"Changed$1");
      this.FBottomStroke.FOnChanged = rtl.createCallback(this,"Changed$1");
      this.FTopStroke.FOnChanged = rtl.createCallback(this,"Changed$1");
      this.FStroke.FOnChanged = rtl.createCallback(this,"Changed$1");
      this.FFill.FOnChanged = rtl.createCallback(this,"Changed$1");
      this.FFont.FOnChanged = rtl.createCallback(this,"Changed$1");
      this.FTitleFont.FOnChanged = rtl.createCallback(this,"Changed$1");
      this.FTopFont.FOnChanged = rtl.createCallback(this,"Changed$1");
      this.FBottomFont.FOnChanged = rtl.createCallback(this,"Changed$1");
      this.UpdateColumn();
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FFiltering");
      rtl.free(this,"FEditorItems");
      rtl.free(this,"FTopFill");
      rtl.free(this,"FTopStroke");
      rtl.free(this,"FTopFont");
      rtl.free(this,"FBottomFill");
      rtl.free(this,"FBottomStroke");
      rtl.free(this,"FBottomFont");
      rtl.free(this,"FFill");
      rtl.free(this,"FStroke");
      rtl.free(this,"FFont");
      rtl.free(this,"FTitleFont");
      pas.Classes.TCollectionItem.Destroy.call(this);
      this.UpdateColumn();
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCTreeViewColumn.isPrototypeOf(Source)) {
        this.FTag = rtl.as(Source,$mod.TTMSFNCTreeViewColumn).FTag;
        this.FText = rtl.as(Source,$mod.TTMSFNCTreeViewColumn).FText;
        this.FName = rtl.as(Source,$mod.TTMSFNCTreeViewColumn).FName;
        this.FTrimming = rtl.as(Source,$mod.TTMSFNCTreeViewColumn).FTrimming;
        this.FWordWrapping = rtl.as(Source,$mod.TTMSFNCTreeViewColumn).FWordWrapping;
        this.FHorizontalTextAlign = rtl.as(Source,$mod.TTMSFNCTreeViewColumn).FHorizontalTextAlign;
        this.FVerticalTextAlign = rtl.as(Source,$mod.TTMSFNCTreeViewColumn).FVerticalTextAlign;
        this.FTitleTrimming = rtl.as(Source,$mod.TTMSFNCTreeViewColumn).FTitleTrimming;
        this.FTitleWordWrapping = rtl.as(Source,$mod.TTMSFNCTreeViewColumn).FTitleWordWrapping;
        this.FTitleHorizontalTextAlign = rtl.as(Source,$mod.TTMSFNCTreeViewColumn).FTitleHorizontalTextAlign;
        this.FTitleVerticalTextAlign = rtl.as(Source,$mod.TTMSFNCTreeViewColumn).FTitleVerticalTextAlign;
        this.FWidth = rtl.as(Source,$mod.TTMSFNCTreeViewColumn).FWidth;
        this.FVisible = rtl.as(Source,$mod.TTMSFNCTreeViewColumn).FVisible;
        this.FUseDefaultAppearance = rtl.as(Source,$mod.TTMSFNCTreeViewColumn).FUseDefaultAppearance;
        this.FFill.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewColumn).FFill);
        this.FDisabledFontColor = rtl.as(Source,$mod.TTMSFNCTreeViewColumn).FDisabledFontColor;
        this.FSelectedFontColor = rtl.as(Source,$mod.TTMSFNCTreeViewColumn).FSelectedFontColor;
        this.FDisabledTitleFontColor = rtl.as(Source,$mod.TTMSFNCTreeViewColumn).FDisabledTitleFontColor;
        this.FSelectedTitleFontColor = rtl.as(Source,$mod.TTMSFNCTreeViewColumn).FSelectedTitleFontColor;
        this.FTitleFont.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewColumn).FTitleFont);
        this.FFont.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewColumn).FFont);
        this.FStroke.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewColumn).FStroke);
        this.FBottomFill.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewColumn).FBottomFill);
        this.FBottomFont.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewColumn).FBottomFont);
        this.FBottomStroke.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewColumn).FBottomStroke);
        this.FTopFill.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewColumn).FTopFill);
        this.FTopStroke.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewColumn).FTopStroke);
        this.FTopFont.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewColumn).FTopFont);
        this.FEditorType = rtl.as(Source,$mod.TTMSFNCTreeViewColumn).FEditorType;
        this.FEditorItems.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewColumn).FEditorItems);
        this.FCustomEditor = rtl.as(Source,$mod.TTMSFNCTreeViewColumn).FCustomEditor;
        this.FSorting = rtl.as(Source,$mod.TTMSFNCTreeViewColumn).FSorting;
        this.FFiltering.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewColumn).FFiltering);
        this.FExpandingButtonSize = rtl.as(Source,$mod.TTMSFNCTreeViewColumn).FExpandingButtonSize;
        this.FHTMLTemplate = rtl.as(Source,$mod.TTMSFNCTreeViewColumn).FHTMLTemplate;
      };
    };
    this.UpdateWidth = function (AWidth) {
      this.FWidth = AWidth;
    };
    this.Sort = function (ARecurse, ACaseSensitive, ASortingMode) {
      var t = null;
      t = this.TreeView();
      if (t != null) t.FNodes.Sort$1(this.GetIndex(),ARecurse,ACaseSensitive,ASortingMode,true);
    };
    var $r = this.$rtti;
    $r.addProperty("EditorType",2,$mod.$rtti["TTMSFNCTreeViewColumnEditorType"],"FEditorType","SetEditorType",4,{Default: $mod.TTMSFNCTreeViewColumnEditorType.tcetNone});
    $r.addProperty("EditorItems",2,pas.Classes.$rtti["TStringList"],"FEditorItems","SetEditorItems");
    $r.addProperty("CustomEditor",0,rtl.boolean,"FCustomEditor","FCustomEditor",4,{Default: false});
    $r.addProperty("Name",2,rtl.string,"FName","SetName");
    $r.addProperty("Text",2,rtl.string,"FText","SetText");
    $r.addProperty("Tag",0,rtl.nativeint,"FTag","FTag",4,{Default: 0});
    $r.addProperty("HorizontalTextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FHorizontalTextAlign","SetHorizontalTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading});
    $r.addProperty("VerticalTextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FVerticalTextAlign","SetVerticalTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter});
    $r.addProperty("WordWrapping",2,rtl.boolean,"FWordWrapping","SetWordWrapping",4,{Default: false});
    $r.addProperty("Trimming",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextTrimming"],"FTrimming","SetTrimming",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone});
    $r.addProperty("MinimumWidth",2,rtl.double,"FMinimumWidth","SetMinimumWidth");
    $r.addProperty("Width",2,rtl.double,"FWidth","SetWidth");
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("UseDefaultAppearance",2,rtl.boolean,"FUseDefaultAppearance","SetUseDefaultAppearance",4,{Default: true});
    $r.addProperty("Fill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFill","SetFill");
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
    $r.addProperty("Font",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FFont","SetFont");
    $r.addProperty("SelectedFontColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FSelectedFontColor","SetSelectedFontColor",4,{Default: 16777215});
    $r.addProperty("DisabledFontColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FDisabledFontColor","SetDisabledFontColor",4,{Default: 12632256});
    $r.addProperty("TopFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FTopFill","SetTopFill");
    $r.addProperty("TopStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FTopStroke","SetTopStroke");
    $r.addProperty("TopFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FTopFont","SetTopFont");
    $r.addProperty("BottomFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FBottomFill","SetBottomFill");
    $r.addProperty("BottomStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FBottomStroke","SetBottomStroke");
    $r.addProperty("BottomFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FBottomFont","SetBottomFont");
    $r.addProperty("Sorting",2,$mod.$rtti["TTMSFNCTreeViewColumnSorting"],"FSorting","SetSorting",4,{Default: $mod.TTMSFNCTreeViewColumnSorting.tcsNone});
    $r.addProperty("Filtering",2,$mod.$rtti["TTMSFNCTreeViewColumnFiltering"],"FFiltering","SetFiltering");
    $r.addProperty("HTMLTemplate",2,rtl.string,"FHTMLTemplate","SetHTMLTemplate");
  });
  rtl.createClass(this,"TTMSFNCTreeViewColumns",pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$init.call(this);
      this.FTreeView = null;
    };
    this.$final = function () {
      this.FTreeView = undefined;
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$final.call(this);
    };
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      this.SetItem(Index,Value);
    };
    this.GetItemClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCTreeViewColumn;
      return Result;
    };
    this.TreeView = function () {
      var Result = null;
      Result = this.FTreeView;
      return Result;
    };
    this.Create$3 = function (ATreeView) {
      pas.Classes.TOwnedCollection.Create$2.call(this,ATreeView,this.GetItemClass());
      this.FTreeView = ATreeView;
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      return Result;
    };
  });
  this.$rtti.$Class("TTMSFNCTreeViewNodes");
  this.TTMSFNCTreeViewNodeCheckType = {"0": "tvntNone", tvntNone: 0, "1": "tvntCheckBox", tvntCheckBox: 1, "2": "tvntRadioButton", tvntRadioButton: 2};
  this.$rtti.$Enum("TTMSFNCTreeViewNodeCheckType",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCTreeViewNodeCheckType});
  rtl.createClass(this,"TTMSFNCTreeViewNodeValue",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FTag = 0;
      this.FDataString = "";
      this.FDataObject = null;
      this.FDataInteger = 0;
      this.FTreeView = null;
      this.FNode = null;
      this.FText = "";
      this.FDBKey = "";
      this.FDataBoolean = false;
      this.FCheckType = 0;
      this.FChecked = false;
      this.FCollapsedIcon = null;
      this.FCollapsedIconLarge = null;
      this.FExpandedIcon = null;
      this.FExpandedIconLarge = null;
      this.FCollapsedIconName = "";
      this.FCollapsedIconLargeName = "";
      this.FExpandedIconName = "";
      this.FExpandedIconLargeName = "";
      this.FDataPointer = null;
      this.FTitle = "";
      this.FTitleExpanded = false;
      this.FHTMLTemplateItems = null;
    };
    this.$final = function () {
      this.FDataObject = undefined;
      this.FTreeView = undefined;
      this.FNode = undefined;
      this.FCollapsedIcon = undefined;
      this.FCollapsedIconLarge = undefined;
      this.FExpandedIcon = undefined;
      this.FExpandedIconLarge = undefined;
      this.FHTMLTemplateItems = undefined;
      pas.Classes.TCollectionItem.$final.call(this);
    };
    this.SetText = function (Value) {
      if (this.FText !== Value) {
        this.FText = Value;
        this.UpdateNodeValue();
      };
    };
    this.UpdateNodeValue = function () {
      var c = null;
      var n = null;
      c = this.TreeView();
      n = this.Node();
      if ((c != null) && (n != null)) c.UpdateNode(n.FVirtualNode);
    };
    this.SetChecked = function (Value) {
      var chkst = [];
      var I = 0;
      var chk = false;
      var t = null;
      var n = null;
      if (this.FChecked !== Value) {
        this.FChecked = Value;
        t = this.TreeView();
        n = this.Node();
        if ((t != null) && (n != null) && (n.FVirtualNode != null)) {
          chkst = rtl.arraySetLength(chkst,false,0);
          for (var $l = 0, $end = t.FColumnCount - 1; $l <= $end; $l++) {
            I = $l;
            chk = false;
            this.TreeView().DoIsNodeChecked(this.Node().FVirtualNode,I,{get: function () {
                return chk;
              }, set: function (v) {
                chk = v;
              }});
            chkst = rtl.arraySetLength(chkst,false,rtl.length(chkst) + 1);
            chkst[rtl.length(chkst) - 1] = chk;
          };
          this.TreeView().UpdateNodeCheckStates(this.Node().FVirtualNode,rtl.arrayRef(chkst));
        };
        this.UpdateNodeValue();
      };
    };
    this.SetCheckType = function (Value) {
      if (this.FCheckType !== Value) {
        this.FCheckType = Value;
        this.UpdateNodeValue();
      };
    };
    this.SetCollapsedIconLarge = function (Value) {
      if (this.FCollapsedIconLarge !== Value) {
        this.FCollapsedIconLarge.Assign(Value);
        this.UpdateNodeValue();
      };
    };
    this.SetCollapsedIcon = function (Value) {
      if (this.FCollapsedIcon !== Value) {
        this.FCollapsedIcon.Assign(Value);
        this.UpdateNodeValue();
      };
    };
    this.SetExpandedIconLarge = function (Value) {
      if (this.FExpandedIconLarge !== Value) {
        this.FExpandedIconLarge.Assign(Value);
        this.UpdateNodeValue();
      };
    };
    this.SetExpandedIcon = function (Value) {
      if (this.FExpandedIcon !== Value) {
        this.FExpandedIcon.Assign(Value);
        this.UpdateNodeValue();
      };
    };
    this.SetCollapsedIconLargeName = function (Value) {
      if (this.FCollapsedIconLargeName !== Value) {
        this.FCollapsedIconLargeName = Value;
        this.UpdateNodeValue();
      };
    };
    this.SetCollapsedIconName = function (Value) {
      if (this.FCollapsedIconName !== Value) {
        this.FCollapsedIconName = Value;
        this.UpdateNodeValue();
      };
    };
    this.SetExpandedIconLargeName = function (Value) {
      if (this.FExpandedIconLargeName !== Value) {
        this.FExpandedIconLargeName = Value;
        this.UpdateNodeValue();
      };
    };
    this.SetExpandedIconName = function (Value) {
      if (this.FExpandedIconName !== Value) {
        this.FExpandedIconName = Value;
        this.UpdateNodeValue();
      };
    };
    this.GetBitmapContainer = function () {
      var Result = null;
      Result = null;
      if (this.FTreeView != null) Result = this.FTreeView.GetBitmapContainer();
      return Result;
    };
    this.SetTitle = function (Value) {
      if (this.FTitle !== Value) {
        this.FTitle = Value;
        this.UpdateNodeValue();
      };
    };
    this.SetTitleExpanded = function (Value) {
      if (this.FTitleExpanded !== Value) {
        this.FTitleExpanded = Value;
        this.UpdateNodeValue();
      };
    };
    this.SetHTMLTemplateItems = function (Value) {
      if (this.FHTMLTemplateItems !== Value) {
        this.FHTMLTemplateItems.Assign(Value);
        this.UpdateNodeValue();
      };
    };
    this.BitmapChanged = function (Sender) {
      this.UpdateNodeValue();
    };
    this.TemplateItemsChanged = function (Sender) {
      this.UpdateNodeValue();
    };
    this.TreeView = function () {
      var Result = null;
      Result = this.FTreeView;
      return Result;
    };
    this.Node = function () {
      var Result = null;
      Result = this.FNode;
      return Result;
    };
    this.GetText = function () {
      var Result = "";
      var ht = "";
      var s = "";
      s = this.FText;
      if (this.FTreeView != null) {
        ht = this.FTreeView.GetHTMLTemplate(this.GetIndex());
        this.FTreeView.DoGetHTMLTemplate(this,this.GetIndex(),{get: function () {
            return ht;
          }, set: function (v) {
            ht = v;
          }});
        if (ht !== "") s = this.FTreeView.HTMLReplace(ht,this);
      };
      Result = s;
      return Result;
    };
    this.Create$1 = function (ACollection) {
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      if (this.FCollection != null) {
        this.FTreeView = rtl.as(this.FCollection,$mod.TTMSFNCTreeViewNodeValues).TreeView();
        this.FNode = rtl.as(this.FCollection,$mod.TTMSFNCTreeViewNodeValues).Node();
      };
      this.FChecked = false;
      this.FTitleExpanded = true;
      this.FCheckType = $mod.TTMSFNCTreeViewNodeCheckType.tvntNone;
      this.FCollapsedIcon = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      this.FCollapsedIcon.FOnChange = rtl.createCallback(this,"BitmapChanged");
      this.FExpandedIcon = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      this.FExpandedIcon.FOnChange = rtl.createCallback(this,"BitmapChanged");
      this.FCollapsedIconLarge = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      this.FCollapsedIconLarge.FOnChange = rtl.createCallback(this,"BitmapChanged");
      this.FExpandedIconLarge = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      this.FExpandedIconLarge.FOnChange = rtl.createCallback(this,"BitmapChanged");
      this.FHTMLTemplateItems = pas.Classes.TStringList.$create("Create$1");
      this.FHTMLTemplateItems.FOnChange = rtl.createCallback(this,"TemplateItemsChanged");
      this.UpdateNodeValue();
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FHTMLTemplateItems");
      rtl.free(this,"FCollapsedIcon");
      rtl.free(this,"FCollapsedIconLarge");
      rtl.free(this,"FExpandedIcon");
      rtl.free(this,"FExpandedIconLarge");
      pas.Classes.TCollectionItem.Destroy.call(this);
      this.UpdateNodeValue();
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCTreeViewNodeValue.isPrototypeOf(Source)) {
        this.FTag = rtl.as(Source,$mod.TTMSFNCTreeViewNodeValue).FTag;
        this.FText = rtl.as(Source,$mod.TTMSFNCTreeViewNodeValue).FText;
        this.FTitleExpanded = rtl.as(Source,$mod.TTMSFNCTreeViewNodeValue).FTitleExpanded;
        this.FTitle = rtl.as(Source,$mod.TTMSFNCTreeViewNodeValue).FTitle;
        this.FCheckType = rtl.as(Source,$mod.TTMSFNCTreeViewNodeValue).FCheckType;
        this.FChecked = rtl.as(Source,$mod.TTMSFNCTreeViewNodeValue).FChecked;
        this.FCollapsedIcon.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewNodeValue).FCollapsedIcon);
        this.FCollapsedIconLarge.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewNodeValue).FCollapsedIconLarge);
        this.FExpandedIcon.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewNodeValue).FExpandedIcon);
        this.FExpandedIconLarge.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewNodeValue).FExpandedIconLarge);
        this.FCollapsedIconName = rtl.as(Source,$mod.TTMSFNCTreeViewNodeValue).FCollapsedIconName;
        this.FCollapsedIconLargeName = rtl.as(Source,$mod.TTMSFNCTreeViewNodeValue).FCollapsedIconLargeName;
        this.FExpandedIconName = rtl.as(Source,$mod.TTMSFNCTreeViewNodeValue).FExpandedIconName;
        this.FExpandedIconLargeName = rtl.as(Source,$mod.TTMSFNCTreeViewNodeValue).FExpandedIconLargeName;
        this.FHTMLTemplateItems.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewNodeValue).FHTMLTemplateItems);
        this.AssignData(Source);
      };
    };
    this.AssignData = function (Source) {
      if ($mod.TTMSFNCTreeViewNodeValue.isPrototypeOf(Source)) {
        this.FDataString = rtl.as(Source,$mod.TTMSFNCTreeViewNodeValue).FDataString;
        this.FDataPointer = rtl.as(Source,$mod.TTMSFNCTreeViewNodeValue).FDataPointer;
        this.FDataBoolean = rtl.as(Source,$mod.TTMSFNCTreeViewNodeValue).FDataBoolean;
        this.FDataObject = rtl.as(Source,$mod.TTMSFNCTreeViewNodeValue).FDataObject;
        this.FDataInteger = rtl.as(Source,$mod.TTMSFNCTreeViewNodeValue).FDataInteger;
        this.FDBKey = rtl.as(Source,$mod.TTMSFNCTreeViewNodeValue).FDBKey;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Tag",0,rtl.nativeint,"FTag","FTag",4,{Default: 0});
    $r.addProperty("Text",2,rtl.string,"FText","SetText");
    $r.addProperty("CollapsedIconName",2,rtl.string,"FCollapsedIconName","SetCollapsedIconName");
    $r.addProperty("CollapsedIconLargeName",2,rtl.string,"FCollapsedIconLargeName","SetCollapsedIconLargeName");
    $r.addProperty("ExpandedIconName",2,rtl.string,"FExpandedIconName","SetExpandedIconName");
    $r.addProperty("ExpandedIconLargeName",2,rtl.string,"FExpandedIconLargeName","SetExpandedIconLargeName");
    $r.addProperty("CollapsedIcon",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FCollapsedIcon","SetCollapsedIcon");
    $r.addProperty("CollapsedIconLarge",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FCollapsedIconLarge","SetCollapsedIconLarge");
    $r.addProperty("ExpandedIcon",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FExpandedIcon","SetExpandedIcon");
    $r.addProperty("ExpandedIconLarge",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FExpandedIconLarge","SetExpandedIconLarge");
    $r.addProperty("Checked",2,rtl.boolean,"FChecked","SetChecked",4,{Default: false});
    $r.addProperty("CheckType",2,$mod.$rtti["TTMSFNCTreeViewNodeCheckType"],"FCheckType","SetCheckType",4,{Default: $mod.TTMSFNCTreeViewNodeCheckType.tvntNone});
    $r.addProperty("HTMLTemplateItems",2,pas.Classes.$rtti["TStringList"],"FHTMLTemplateItems","SetHTMLTemplateItems");
  });
  rtl.createClass(this,"TTMSFNCTreeViewNodeValues",pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$init.call(this);
      this.FTreeView = null;
      this.FNode = null;
    };
    this.$final = function () {
      this.FTreeView = undefined;
      this.FNode = undefined;
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$final.call(this);
    };
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      this.SetItem(Index,Value);
    };
    this.GetItemClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCTreeViewNodeValue;
      return Result;
    };
    this.TreeView = function () {
      var Result = null;
      Result = this.FTreeView;
      return Result;
    };
    this.Node = function () {
      var Result = null;
      Result = this.FNode;
      return Result;
    };
    this.UpdateChecked = function (AIndex, AValue) {
      if (this.FTreeView != null) this.FTreeView.FUpdateCount$1 = this.FTreeView.FUpdateCount$1 + 1;
      this.GetItem$1(AIndex).SetChecked(AValue);
      if (this.FTreeView != null) this.FTreeView.FUpdateCount$1 = this.FTreeView.FUpdateCount$1 - 1;
    };
    this.Create$3 = function (ATreeView, ANode) {
      pas.Classes.TOwnedCollection.Create$2.call(this,ATreeView,this.GetItemClass());
      this.FTreeView = ATreeView;
      this.FNode = ANode;
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      return Result;
    };
  });
  this.$rtti.$DynArray("TTMSFNCTreeViewNodeTextValues",{eltype: rtl.string});
  this.$rtti.$DynArray("TTMSFNCTreeViewNodeCheckStates",{eltype: rtl.boolean});
  this.$rtti.$DynArray("TTMSFNCTreeViewNodeCheckTypes",{eltype: this.$rtti["TTMSFNCTreeViewNodeCheckType"]});
  this.$rtti.$DynArray("TTMSFNCTreeViewNodeIcons",{eltype: pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"]});
  this.$rtti.$DynArray("TTMSFNCTreeViewNodeIconNames",{eltype: rtl.string});
  rtl.createClass(this,"TTMSFNCTreeViewNode",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FTag = 0;
      this.FDataString = "";
      this.FDataObject = null;
      this.FDataInteger = 0;
      this.FTreeView = null;
      this.FValues = null;
      this.FDBKey = "";
      this.FDataBoolean = false;
      this.FNodes = null;
      this.FVirtualNode = null;
      this.FExpanded = false;
      this.FEnabled = false;
      this.FExtended = false;
      this.FDataPointer = null;
    };
    this.$final = function () {
      this.FDataObject = undefined;
      this.FTreeView = undefined;
      this.FValues = undefined;
      this.FNodes = undefined;
      this.FVirtualNode = undefined;
      pas.Classes.TCollectionItem.$final.call(this);
    };
    this.SetValues = function (Value) {
      if (this.FValues !== Value) {
        this.FValues.Assign(Value);
        this.UpdateNode();
      };
    };
    this.SetNodes = function (Value) {
      if (this.FNodes !== Value) {
        this.FNodes.Assign(Value);
        this.UpdateNode();
      };
    };
    this.SetExpanded = function (Value) {
      if (this.FExpanded !== Value) {
        this.FExpanded = Value;
        if (this.FTreeView != null) this.FTreeView.ToggleNode(this);
      };
    };
    this.SetEnabled = function (Value) {
      if (this.FEnabled !== Value) {
        this.FEnabled = Value;
        this.UpdateNode();
      };
    };
    this.SetExtended = function (Value) {
      if (this.FExtended !== Value) {
        this.FExtended = Value;
        this.UpdateNode();
      };
    };
    this.GetChecked = function (AColumn) {
      var Result = false;
      var v = null;
      Result = false;
      v = this.GetValueForColumn(AColumn);
      if (v != null) Result = v.FChecked;
      return Result;
    };
    this.SetChecked = function (AColumn, Value) {
      var v = null;
      v = this.GetValueForColumn(AColumn);
      if (v != null) v.SetChecked(Value);
    };
    this.GetCheckType = function (AColumn) {
      var Result = 0;
      var v = null;
      Result = $mod.TTMSFNCTreeViewNodeCheckType.tvntNone;
      v = this.GetValueForColumn(AColumn);
      if (v != null) Result = v.FCheckType;
      return Result;
    };
    this.GetCollapsedIcon = function (AColumn, ALarge) {
      var Result = null;
      var v = null;
      Result = null;
      v = this.GetValueForColumn(AColumn);
      if (v != null) {
        if (ALarge) {
          Result = v.FCollapsedIconLarge}
         else Result = v.FCollapsedIcon;
      };
      return Result;
    };
    this.GetCollapsedIconName = function (AColumn, ALarge) {
      var Result = "";
      var v = null;
      Result = "";
      v = this.GetValueForColumn(AColumn);
      if (v != null) {
        if (ALarge) {
          Result = v.FCollapsedIconLargeName}
         else Result = v.FCollapsedIconName;
      };
      return Result;
    };
    this.GetExpandedIcon = function (AColumn, ALarge) {
      var Result = null;
      var v = null;
      Result = null;
      v = this.GetValueForColumn(AColumn);
      if (v != null) {
        if (ALarge) {
          Result = v.FExpandedIconLarge}
         else Result = v.FExpandedIcon;
      };
      return Result;
    };
    this.GetExpandedIconName = function (AColumn, ALarge) {
      var Result = "";
      var v = null;
      Result = "";
      v = this.GetValueForColumn(AColumn);
      if (v != null) {
        if (ALarge) {
          Result = v.FExpandedIconLargeName}
         else Result = v.FExpandedIconName;
      };
      return Result;
    };
    this.GetText = function (AColumn) {
      var Result = "";
      var v = null;
      Result = "";
      v = this.GetValueForColumn(AColumn);
      if (v != null) Result = v.FText;
      return Result;
    };
    this.SetCheckType = function (AColumn, Value) {
      var v = null;
      v = this.GetValueForColumn(AColumn);
      if (v != null) v.SetCheckType(Value);
    };
    this.SetCollapsedIcon = function (AColumn, ALarge, Value) {
      var v = null;
      v = this.GetValueForColumn(AColumn);
      if (v != null) {
        if (ALarge) {
          v.FCollapsedIconLarge.Assign(Value)}
         else v.FCollapsedIcon.Assign(Value);
      };
    };
    this.SetCollapsedIconName = function (AColumn, ALarge, Value) {
      var v = null;
      v = this.GetValueForColumn(AColumn);
      if (v != null) {
        if (ALarge) {
          v.SetCollapsedIconLargeName(Value)}
         else v.SetCollapsedIconName(Value);
      };
    };
    this.SetExpandedIcon = function (AColumn, ALarge, Value) {
      var v = null;
      v = this.GetValueForColumn(AColumn);
      if (v != null) {
        if (ALarge) {
          v.FExpandedIconLarge.Assign(Value)}
         else v.FExpandedIcon.Assign(Value);
      };
    };
    this.SetExpandedIconName = function (AColumn, ALarge, Value) {
      var v = null;
      v = this.GetValueForColumn(AColumn);
      if (v != null) {
        if (ALarge) {
          v.SetExpandedIconLargeName(Value)}
         else v.SetExpandedIconName(Value);
      };
    };
    this.SetText = function (AColumn, Value) {
      var v = null;
      v = this.GetValueForColumn(AColumn);
      if (v != null) v.SetText(Value);
    };
    this.GetStrippedHTMLText = function (AColumn) {
      var Result = "";
      Result = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.HTMLStrip(this.GetText(AColumn));
      return Result;
    };
    this.UpdateNode = function () {
      var c = null;
      c = this.TreeView();
      if (c != null) {
        if (this.FTreeView.FNodeListBuild) {
          c.UpdateNode(this.FVirtualNode)}
         else c.UpdateTreeViewCache();
      };
    };
    this.GetValueForColumn = function (AColumn) {
      var Result = null;
      var I = 0;
      Result = null;
      if ((AColumn >= 0) && (AColumn <= (this.FValues.GetCount() - 1))) {
        Result = this.FValues.GetItem$1(AColumn);
        return Result;
      };
      this.FTreeView.FBlockUpdateNode = true;
      for (var $l = 0, $end = AColumn; $l <= $end; $l++) {
        I = $l;
        if (I > (this.FValues.GetCount() - 1)) Result = this.FValues.Add$1();
      };
      this.FTreeView.FBlockUpdateNode = false;
      return Result;
    };
    this.CreateNodes = function () {
      var Result = null;
      Result = $mod.TTMSFNCTreeViewNodes.$create("Create$3",[this.FTreeView,this]);
      return Result;
    };
    this.CreateNodeValues = function () {
      var Result = null;
      Result = $mod.TTMSFNCTreeViewNodeValues.$create("Create$3",[this.FTreeView,this]);
      return Result;
    };
    this.SetIndex = function (Value) {
      var $Self = this;
      function InsertSubNodes(ANodes) {
        var I = 0;
        for (var $l = 0, $end = ANodes.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          $Self.FTreeView.InsertItemInternal(ANodes.GetItem$1(I));
          InsertSubNodes(ANodes.GetItem$1(I).FNodes);
        };
      };
      pas.Classes.TCollectionItem.SetIndex.apply(this,arguments);
      if (this.FTreeView != null) {
        if (this.FTreeView.FNodeListBuild) {
          this.FTreeView.RemoveItemInternal($Self,true);
          this.FTreeView.InsertItemInternal($Self);
          InsertSubNodes(this.FNodes);
        } else this.FTreeView.UpdateTreeViewCache();
      };
    };
    this.ValuesChanged = function (Sender) {
      this.UpdateNode();
    };
    this.TreeView = function () {
      var Result = null;
      Result = this.FTreeView;
      return Result;
    };
    this.GetParent = function () {
      var Result = null;
      Result = null;
      if (this.FTreeView != null) Result = this.FTreeView.GetParentNode(this);
      return Result;
    };
    this.GetChildCount = function () {
      var Result = 0;
      Result = 0;
      if (this.FTreeView != null) Result = this.FTreeView.GetNodeChildCount(this);
      return Result;
    };
    this.GetPrevious = function () {
      var Result = null;
      Result = null;
      if (this.FTreeView != null) Result = this.FTreeView.GetPreviousNode(this);
      return Result;
    };
    this.GetNext = function () {
      var Result = null;
      Result = null;
      if (this.FTreeView != null) Result = this.FTreeView.GetNextNode(this);
      return Result;
    };
    this.GetPreviousChild = function (ANode) {
      var Result = null;
      Result = null;
      if (this.FTreeView != null) Result = this.FTreeView.GetPreviousChildNode(this,ANode);
      return Result;
    };
    this.GetNextChild = function (ANode) {
      var Result = null;
      Result = null;
      if (this.FTreeView != null) Result = this.FTreeView.GetNextChildNode(this,ANode);
      return Result;
    };
    this.GetNextSibling = function () {
      var Result = null;
      Result = null;
      if (this.FTreeView != null) Result = this.FTreeView.GetNextSiblingNode(this);
      return Result;
    };
    this.GetPreviousSibling = function () {
      var Result = null;
      Result = null;
      if (this.FTreeView != null) Result = this.FTreeView.GetPreviousSiblingNode(this);
      return Result;
    };
    this.GetFirstChild = function () {
      var Result = null;
      Result = null;
      if (this.FTreeView != null) Result = this.FTreeView.GetFirstChildNode(this);
      return Result;
    };
    this.GetLastChild = function () {
      var Result = null;
      Result = null;
      if (this.FTreeView != null) Result = this.FTreeView.GetLastChildNode(this);
      return Result;
    };
    var TabChar = "\t";
    this.SaveToString = function (ATextOnly) {
      var Result = "";
      var vn = null;
      var I = 0;
      if (!(this.FTreeView != null)) return Result;
      vn = this.FVirtualNode;
      Result = "";
      for (var $l = 0, $end = vn.FLevel - 1; $l <= $end; $l++) {
        I = $l;
        Result = Result + TabChar;
      };
      for (var $l1 = 0, $end1 = this.FTreeView.FColumnCount - 1; $l1 <= $end1; $l1++) {
        I = $l1;
        if (ATextOnly) {
          if (I === (this.FTreeView.FColumnCount - 1)) {
            Result = Result + this.GetStrippedHTMLText(I)}
           else Result = Result + this.GetStrippedHTMLText(I) + "{1}";
        } else {
          if (I === (this.FTreeView.FColumnCount - 1)) {
            Result = Result + this.GetText(I)}
           else Result = Result + this.GetText(I) + "{1}";
        };
      };
      if (!ATextOnly) Result = Result + "{0}";
      for (var $l2 = 0, $end2 = this.FTreeView.FColumnCount - 1; $l2 <= $end2; $l2++) {
        I = $l2;
        if (!ATextOnly) {
          Result = Result + pas.SysUtils.IntToStr(this.GetCheckType(I)) + ";";
          Result = Result + pas.SysUtils.BoolToStr(this.GetChecked(I),false) + ";";
          Result = Result + this.GetExpandedIconName(I,false) + ";";
          Result = Result + this.GetExpandedIconName(I,true) + ";";
          Result = Result + this.GetCollapsedIconName(I,false) + ";";
          Result = Result + this.GetCollapsedIconName(I,true) + ";";
          Result = Result + pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.SaveBitmapToHexStr(this.GetExpandedIcon(I,false)) + ";";
          Result = Result + pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.SaveBitmapToHexStr(this.GetExpandedIcon(I,true)) + ";";
          Result = Result + pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.SaveBitmapToHexStr(this.GetCollapsedIcon(I,false)) + ";";
          if (I === (this.FValues.GetCount() - 1)) {
            Result = Result + pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.SaveBitmapToHexStr(this.GetCollapsedIcon(I,true))}
           else Result = Result + pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.SaveBitmapToHexStr(this.GetCollapsedIcon(I,true)) + "|";
        };
      };
      if (!ATextOnly) {
        Result = Result + "{0}";
        Result = Result + pas.SysUtils.BoolToStr(this.FExtended,false) + "{0}";
        Result = Result + pas.SysUtils.BoolToStr(this.FEnabled,false);
      };
      return Result;
    };
    this.LoadFromString = function (AString) {
      var k = 0;
      var l = 0;
      var a = null;
      var c = null;
      var s = null;
      var y = 0;
      var st = "";
      var ps = 0;
      var subst = "";
      a = pas.Classes.TStringList.$create("Create$1");
      try {
        st = AString;
        while (st !== "") {
          ps = pas.System.Pos("{0}",st);
          if (ps === 0) {
            a.Add(st);
            break;
          };
          subst = pas.System.Copy(st,1,ps - 1);
          a.Add(subst);
          pas.System.Delete({get: function () {
              return st;
            }, set: function (v) {
              st = v;
            }},1,(ps - 1) + "{0}".length);
        };
        for (var $l = 0, $end = a.GetCount() - 1; $l <= $end; $l++) {
          k = $l;
          if (a.Get(k) !== "") {
            if (k === 0) {
              c = pas.Classes.TStringList.$create("Create$1");
              try {
                st = a.Get(k);
                while (st !== "") {
                  ps = pas.System.Pos("{1}",st);
                  if (ps === 0) {
                    c.Add(st);
                    break;
                  };
                  subst = pas.System.Copy(st,1,ps - 1);
                  c.Add(subst);
                  pas.System.Delete({get: function () {
                      return st;
                    }, set: function (v) {
                      st = v;
                    }},1,(ps - 1) + "{0}".length);
                };
                for (var $l1 = 0, $end1 = c.GetCount() - 1; $l1 <= $end1; $l1++) {
                  l = $l1;
                  if (c.Get(l) !== "") this.SetText(l,c.Get(l));
                };
              } finally {
                c = rtl.freeLoc(c);
              };
            } else if (k === 1) {
              c = pas.Classes.TStringList.$create("Create$1");
              try {
                pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.Split("|",a.Get(k),c,false);
                for (var $l2 = 0, $end2 = c.GetCount() - 1; $l2 <= $end2; $l2++) {
                  l = $l2;
                  s = pas.Classes.TStringList.$create("Create$1");
                  try {
                    pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.Split(";",c.Get(l),s,false);
                    for (var $l3 = 0, $end3 = s.GetCount() - 1; $l3 <= $end3; $l3++) {
                      y = $l3;
                      if (s.Get(y) !== "") {
                        if (y === 0) {
                          this.SetCheckType(l,pas.SysUtils.StrToInt(s.Get(y)))}
                         else if (y === 1) {
                          this.SetChecked(l,pas.SysUtils.StrToBool(s.Get(y)))}
                         else if (y === 2) {
                          this.SetExpandedIconName(l,false,s.Get(y))}
                         else if (y === 3) {
                          this.SetExpandedIconName(l,true,s.Get(y))}
                         else if (y === 4) {
                          this.SetCollapsedIconName(l,false,s.Get(y))}
                         else if (y === 5) {
                          this.SetCollapsedIconName(l,true,s.Get(y))}
                         else if ((y === 6) || (y === 7) || (y === 8) || (y === 9)) {
                          if (y === 6) {
                            pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.LoadBitmapFromHexStr(s.Get(y),this.GetExpandedIcon(l,false))}
                           else if (y === 7) {
                            pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.LoadBitmapFromHexStr(s.Get(y),this.GetExpandedIcon(l,true))}
                           else if (y === 8) {
                            pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.LoadBitmapFromHexStr(s.Get(y),this.GetCollapsedIcon(l,false))}
                           else pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.LoadBitmapFromHexStr(s.Get(y),this.GetCollapsedIcon(l,true));
                        };
                      };
                    };
                  } finally {
                    s = rtl.freeLoc(s);
                  };
                };
              } finally {
                c = rtl.freeLoc(c);
              };
            } else if (k === 2) {
              this.SetExtended(pas.SysUtils.StrToBool(a.Get(k)))}
             else if (k === 3) this.SetEnabled(pas.SysUtils.StrToBool(a.Get(k)));
          };
        };
      } finally {
        a = rtl.freeLoc(a);
      };
    };
    this.RemoveChildren = function () {
      this.FNodes.Clear();
    };
    this.Expand = function (ARecurse) {
      if (this.FTreeView != null) this.FTreeView.ExpandNode(this,ARecurse);
    };
    this.Collapse = function (ARecurse) {
      if (this.FTreeView != null) this.FTreeView.CollapseNode(this,ARecurse);
    };
    this.MoveTo = function (ADestination, AIndex) {
      if (this.FTreeView != null) this.FTreeView.MoveNode(this,ADestination,AIndex);
    };
    this.CopyTo = function (ADestination, AIndex) {
      if (this.FTreeView != null) this.FTreeView.CopyNode(this,ADestination,AIndex);
    };
    this.SetTextValues = function (ATextValues) {
      var I = 0;
      for (var $l = 0, $end = rtl.length(ATextValues) - 1; $l <= $end; $l++) {
        I = $l;
        this.SetText(I,ATextValues[I]);
      };
    };
    this.SetCheckStates = function (ACheckStates) {
      var I = 0;
      for (var $l = 0, $end = rtl.length(ACheckStates) - 1; $l <= $end; $l++) {
        I = $l;
        this.SetChecked(I,ACheckStates[I]);
      };
    };
    this.SetCheckTypes = function (ACheckTypes) {
      var I = 0;
      for (var $l = 0, $end = rtl.length(ACheckTypes) - 1; $l <= $end; $l++) {
        I = $l;
        this.SetCheckType(I,ACheckTypes[I]);
      };
    };
    this.SetCollapsedIcons = function (AIcons, ALarge) {
      var I = 0;
      for (var $l = 0, $end = rtl.length(AIcons) - 1; $l <= $end; $l++) {
        I = $l;
        this.SetCollapsedIcon(I,ALarge,AIcons[I]);
      };
    };
    this.SetExpandedIcons = function (AIcons, ALarge) {
      var I = 0;
      for (var $l = 0, $end = rtl.length(AIcons) - 1; $l <= $end; $l++) {
        I = $l;
        this.SetExpandedIcon(I,ALarge,AIcons[I]);
      };
    };
    this.SetCollapsedIconNames = function (AIconNames, ALarge) {
      var I = 0;
      for (var $l = 0, $end = rtl.length(AIconNames) - 1; $l <= $end; $l++) {
        I = $l;
        this.SetCollapsedIconName(I,ALarge,AIconNames[I]);
      };
    };
    this.SetExpandedIconNames = function (AIconNames, ALarge) {
      var I = 0;
      for (var $l = 0, $end = rtl.length(AIconNames) - 1; $l <= $end; $l++) {
        I = $l;
        this.SetExpandedIconName(I,ALarge,AIconNames[I]);
      };
    };
    this.Create$1 = function (ACollection) {
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      if (this.FCollection != null) this.FTreeView = rtl.as(this.FCollection,$mod.TTMSFNCTreeViewNodes).TreeView();
      this.FValues = this.CreateNodeValues();
      this.FExpanded = false;
      this.FExtended = false;
      this.FEnabled = true;
      this.FNodes = this.CreateNodes();
      if (this.FTreeView != null) {
        if (this.FTreeView.FNodeListBuild) {
          this.FTreeView.InsertItemInternal(this)}
         else this.FTreeView.UpdateTreeViewCache();
      };
      return this;
    };
    this.Destroy = function () {
      var ru = $mod.TTMSFNCTreeViewVirtualNodeRemoveData.$new();
      ru.RowIndex = -1;
      ru.Count = 0;
      ru.ParentNode = -1;
      if (this.FTreeView != null) {
        if (this.FTreeView.FNodeListBuild && !(this.FTreeView.FBlockRemoveNode > 0)) ru.$assign(this.FTreeView.RemoveItemInternal(this,false));
      };
      this.FVirtualNode = null;
      if (this.FTreeView != null) this.FTreeView.FBlockRemoveNode = this.FTreeView.FBlockRemoveNode + 1;
      rtl.free(this,"FNodes");
      if (this.FTreeView != null) this.FTreeView.FBlockRemoveNode = this.FTreeView.FBlockRemoveNode - 1;
      rtl.free(this,"FValues");
      pas.Classes.TCollectionItem.Destroy.call(this);
      if (ru.RowIndex !== -1) this.FTreeView.UpdateNodesInternal($mod.TTMSFNCTreeViewVirtualNodeRemoveData.$clone(ru));
      if (this.FTreeView != null) this.FTreeView.UpdateTreeViewCache();
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCTreeViewNode.isPrototypeOf(Source)) {
        this.FTag = rtl.as(Source,$mod.TTMSFNCTreeViewNode).FTag;
        this.FValues.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewNode).FValues);
        this.FExpanded = rtl.as(Source,$mod.TTMSFNCTreeViewNode).FExpanded;
        this.FExtended = rtl.as(Source,$mod.TTMSFNCTreeViewNode).FExtended;
        this.FEnabled = rtl.as(Source,$mod.TTMSFNCTreeViewNode).FEnabled;
        this.FNodes.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewNode).FNodes);
        this.AssignData(Source);
        if (this.FTreeView != null) {
          if (this.FExpanded) {
            this.FTreeView.ExpandNode(this,false)}
           else this.FTreeView.CollapseNode(this,false);
        };
      };
    };
    this.AssignData = function (Source) {
      if ($mod.TTMSFNCTreeViewNode.isPrototypeOf(Source)) {
        this.FDataString = rtl.as(Source,$mod.TTMSFNCTreeViewNode).FDataString;
        this.FDataBoolean = rtl.as(Source,$mod.TTMSFNCTreeViewNode).FDataBoolean;
        this.FDataObject = rtl.as(Source,$mod.TTMSFNCTreeViewNode).FDataObject;
        this.FDataInteger = rtl.as(Source,$mod.TTMSFNCTreeViewNode).FDataInteger;
        this.FDataPointer = rtl.as(Source,$mod.TTMSFNCTreeViewNode).FDataPointer;
        this.FDBKey = rtl.as(Source,$mod.TTMSFNCTreeViewNode).FDBKey;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Values",2,$mod.$rtti["TTMSFNCTreeViewNodeValues"],"FValues","SetValues");
    $r.addProperty("Expanded",2,rtl.boolean,"FExpanded","SetExpanded",4,{Default: false});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Extended",2,rtl.boolean,"FExtended","SetExtended",4,{Default: false});
    $r.addProperty("Tag",0,rtl.nativeint,"FTag","FTag");
    $r.addProperty("Nodes",2,$mod.$rtti["TTMSFNCTreeViewNodes"],"FNodes","SetNodes");
  });
  rtl.createClass(this,"TTMSFNCTreeViewNodes",pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$init.call(this);
      this.FTreeView = null;
      this.FNode = null;
    };
    this.$final = function () {
      this.FTreeView = undefined;
      this.FNode = undefined;
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$final.call(this);
    };
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      this.SetItem(Index,Value);
    };
    this.GetItemClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCTreeViewNode;
      return Result;
    };
    this.Compare = function (ANode1, ANode2, AColumn, ACaseSensitive, ASortingMode) {
      var Result = 0;
      var td = null;
      Result = 0;
      td = this.TreeView();
      if (!(td != null)) return Result;
      if (!ACaseSensitive) {
        Result = pas.SysUtils.AnsiCompareStr(pas.SysUtils.UpperCase(ANode1.GetStrippedHTMLText(AColumn)),pas.SysUtils.UpperCase(ANode2.GetStrippedHTMLText(AColumn)))}
       else Result = pas.SysUtils.AnsiCompareStr(ANode1.GetStrippedHTMLText(AColumn),ANode2.GetStrippedHTMLText(AColumn));
      var $tmp = ASortingMode;
      if ($tmp === $mod.TTMSFNCTreeViewNodesSortMode.nsmDescending) Result = Result * -1;
      td.DoNodeCompare(ANode1,ANode2,AColumn,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.QuickSort = function (L, R, AColumn, ACaseSensitive, ASortingMode) {
      var $Self = this;
      var I = 0;
      var J = 0;
      var p = 0;
      var SortList = null;
      function ExchangeItems(Index1, Index2) {
        var Save = undefined;
        Save = SortList.Get(Index1);
        SortList.Put(Index1,SortList.Get(Index2));
        SortList.Put(Index2,Save);
      };
      SortList = $Self.FItems;
      do {
        I = L;
        J = R;
        p = (L + R) >>> 1;
        do {
          while (this.Compare(this.GetItem$1(I),this.GetItem$1(p),AColumn,ACaseSensitive,ASortingMode) < 0) I += 1;
          while (this.Compare(this.GetItem$1(J),this.GetItem$1(p),AColumn,ACaseSensitive,ASortingMode) > 0) J -= 1;
          if (I <= J) {
            ExchangeItems(I,J);
            if (p === I) {
              p = J}
             else if (p === J) p = I;
            I += 1;
            J -= 1;
          };
        } while (!(I > J));
        if (L < J) this.QuickSort(L,J,AColumn,ACaseSensitive,ASortingMode);
        L = I;
      } while (!(I >= R));
    };
    this.TreeView = function () {
      var Result = null;
      Result = this.FTreeView;
      return Result;
    };
    this.Node = function () {
      var Result = null;
      Result = this.FNode;
      return Result;
    };
    this.Create$3 = function (ATreeView, ANode) {
      pas.Classes.TOwnedCollection.Create$2.call(this,ATreeView,this.GetItemClass());
      this.FTreeView = ATreeView;
      this.FNode = ANode;
      return this;
    };
    this.Destroy = function () {
      this.FNode = null;
      pas.Classes.TCollection.Destroy.call(this);
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      return Result;
    };
    this.Sort$1 = function (AColumn, ARecurse, ACaseSensitive, ASortingMode, AClearNodeList) {
      var td = null;
      var I = 0;
      td = this.TreeView();
      if (td != null) {
        td.FSortMode = ASortingMode;
        td.BeginUpdate();
        if (AClearNodeList) td.ClearNodeList();
        this.BeginUpdate();
        if (this.GetCount() > 0) {
          this.QuickSort(0,this.GetCount() - 1,AColumn,ACaseSensitive,ASortingMode);
          if (ARecurse) {
            for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
              I = $l;
              this.GetItem$1(I).FNodes.Sort$1(AColumn,ARecurse,ACaseSensitive,ASortingMode,AClearNodeList);
            };
          };
        };
        this.EndUpdate();
        td.EndUpdate();
      };
    };
  });
  rtl.createClass(this,"TTMSFNCTreeViewGroup",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FTag = 0;
      this.FDataString = "";
      this.FDataObject = null;
      this.FDataInteger = 0;
      this.FTreeView = null;
      this.FText = "";
      this.FStartColumn = 0;
      this.FEndColumn = 0;
      this.FName = "";
      this.FDBKey = "";
      this.FDataBoolean = false;
      this.FBottomFill = null;
      this.FBottomStroke = null;
      this.FTopFill = null;
      this.FTopStroke = null;
      this.FTopFont = null;
      this.FBottomFont = null;
      this.FUseDefaultAppearance = false;
      this.FDataPointer = null;
    };
    this.$final = function () {
      this.FDataObject = undefined;
      this.FTreeView = undefined;
      this.FBottomFill = undefined;
      this.FBottomStroke = undefined;
      this.FTopFill = undefined;
      this.FTopStroke = undefined;
      this.FTopFont = undefined;
      this.FBottomFont = undefined;
      pas.Classes.TCollectionItem.$final.call(this);
    };
    this.SetText = function (Value) {
      if (this.FText !== Value) {
        this.FText = Value;
        this.UpdateGroup();
      };
    };
    this.SetStartColumn = function (Value) {
      if (this.FStartColumn !== Value) {
        this.FStartColumn = Value;
        this.UpdateGroup();
      };
    };
    this.SetEndColumn = function (Value) {
      if (this.FEndColumn !== Value) {
        this.FEndColumn = Value;
        this.UpdateGroup();
      };
    };
    this.SetName = function (Value) {
      if (this.FName !== Value) {
        this.FName = Value;
      };
    };
    this.SetBottomFill = function (Value) {
      if (this.FBottomFill !== Value) this.FBottomFill.Assign(Value);
    };
    this.SetBottomStroke = function (Value) {
      if (this.FBottomStroke !== Value) this.FBottomStroke.Assign(Value);
    };
    this.SetTopFill = function (Value) {
      if (this.FTopFill !== Value) this.FTopFill.Assign(Value);
    };
    this.SetTopStroke = function (Value) {
      if (this.FTopStroke !== Value) this.FTopStroke.Assign(Value);
    };
    this.SetBottomFont = function (Value) {
      if (this.FBottomFont !== Value) this.FBottomFont.Assign(Value);
    };
    this.SetTopFont = function (Value) {
      if (this.FTopFont !== Value) this.FTopFont.Assign(Value);
    };
    this.SetUseDefaultAppearance = function (Value) {
      if (this.FUseDefaultAppearance !== Value) {
        this.FUseDefaultAppearance = Value;
        this.Changed$1(this);
      };
    };
    this.UpdateGroup = function () {
      var c = null;
      c = this.TreeView();
      if (c != null) {
        c.UpdateColumns();
        c.UpdateTreeViewCache();
      };
    };
    this.Changed$1 = function (Sender) {
      this.UpdateGroup();
    };
    this.TreeView = function () {
      var Result = null;
      Result = this.FTreeView;
      return Result;
    };
    this.Create$1 = function (ACollection) {
      var grp = null;
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      if (this.FCollection != null) {
        this.FTreeView = rtl.as(this.FCollection,$mod.TTMSFNCTreeViewGroups).TreeView();
        this.FText = $mod.TranslateTextEx(rtl.getResStr($mod,"sTMSFNCTreeViewGroup")) + " " + pas.SysUtils.IntToStr(this.FTreeView.FGroups.GetCount() - 1);
        if (this.FTreeView.FGroups.GetCount() < 2) {
          this.FStartColumn = 0;
          this.FEndColumn = 0;
        } else {
          grp = this.FTreeView.FGroups.GetItem$1(this.FTreeView.FGroups.GetCount() - 2);
          this.FStartColumn = grp.FStartColumn + 1;
          this.FEndColumn = this.FStartColumn;
        };
      };
      this.FUseDefaultAppearance = true;
      this.FBottomFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone,16777215,8421504,-1,-1]);
      this.FBottomStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,11119017,1.0]);
      this.FTopFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone,16777215,8421504,-1,-1]);
      this.FTopStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,8421504,1.0]);
      this.FTopFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FBottomFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FBottomFill.FOnChanged = rtl.createCallback(this,"Changed$1");
      this.FTopFill.FOnChanged = rtl.createCallback(this,"Changed$1");
      this.FBottomStroke.FOnChanged = rtl.createCallback(this,"Changed$1");
      this.FTopStroke.FOnChanged = rtl.createCallback(this,"Changed$1");
      this.FTopFont.FOnChange = rtl.createCallback(this,"Changed$1");
      this.FBottomFont.FOnChange = rtl.createCallback(this,"Changed$1");
      this.UpdateGroup();
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FTopFill");
      rtl.free(this,"FTopStroke");
      rtl.free(this,"FTopFont");
      rtl.free(this,"FBottomFill");
      rtl.free(this,"FBottomStroke");
      rtl.free(this,"FBottomFont");
      pas.Classes.TCollectionItem.Destroy.call(this);
      this.UpdateGroup();
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCTreeViewGroup.isPrototypeOf(Source)) {
        this.FTag = rtl.as(Source,$mod.TTMSFNCTreeViewGroup).FTag;
        this.FText = rtl.as(Source,$mod.TTMSFNCTreeViewGroup).FText;
        this.FStartColumn = rtl.as(Source,$mod.TTMSFNCTreeViewGroup).FStartColumn;
        this.FEndColumn = rtl.as(Source,$mod.TTMSFNCTreeViewGroup).FEndColumn;
        this.FUseDefaultAppearance = rtl.as(Source,$mod.TTMSFNCTreeViewGroup).FUseDefaultAppearance;
        this.FBottomFill.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewGroup).FBottomFill);
        this.FBottomFont.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewGroup).FBottomFont);
        this.FBottomStroke.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewGroup).FBottomStroke);
        this.FTopFill.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewGroup).FTopFill);
        this.FTopStroke.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewGroup).FTopStroke);
        this.FTopFont.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewGroup).FTopFont);
      };
    };
    this.GetText = function () {
      var Result = "";
      Result = this.FText;
      if (Result === "") {
        Result = this.FName;
        if (Result === "") Result = $mod.TranslateTextEx(rtl.getResStr($mod,"sTMSFNCTreeViewGroup")) + " " + pas.SysUtils.IntToStr(this.GetIndex());
      };
      return Result;
    };
    var $r = this.$rtti;
    $r.addProperty("Name",2,rtl.string,"FName","SetName");
    $r.addProperty("Text",2,rtl.string,"FText","SetText");
    $r.addProperty("StartColumn",2,rtl.longint,"FStartColumn","SetStartColumn",4,{Default: 0});
    $r.addProperty("EndColumn",2,rtl.longint,"FEndColumn","SetEndColumn",4,{Default: 0});
    $r.addProperty("Tag",0,rtl.nativeint,"FTag","FTag",4,{Default: 0});
    $r.addProperty("UseDefaultAppearance",2,rtl.boolean,"FUseDefaultAppearance","SetUseDefaultAppearance",4,{Default: true});
    $r.addProperty("TopFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FTopFill","SetTopFill");
    $r.addProperty("TopStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FTopStroke","SetTopStroke");
    $r.addProperty("TopFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FTopFont","SetTopFont");
    $r.addProperty("BottomFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FBottomFill","SetBottomFill");
    $r.addProperty("BottomStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FBottomStroke","SetBottomStroke");
    $r.addProperty("BottomFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FBottomFont","SetBottomFont");
  });
  rtl.createClass(this,"TTMSFNCTreeViewGroups",pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$init.call(this);
      this.FTreeView = null;
    };
    this.$final = function () {
      this.FTreeView = undefined;
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$final.call(this);
    };
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      this.SetItem(Index,Value);
    };
    this.GetItemClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCTreeViewGroup;
      return Result;
    };
    this.TreeView = function () {
      var Result = null;
      Result = this.FTreeView;
      return Result;
    };
    this.Create$3 = function (ATreeView) {
      pas.Classes.TOwnedCollection.Create$2.call(this,ATreeView,this.GetItemClass());
      this.FTreeView = ATreeView;
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      return Result;
    };
  });
  this.TTMSFNCTreeViewNodeTextMode = {"0": "tntmDrawing", tntmDrawing: 0, "1": "tntmEditing", tntmEditing: 1};
  this.$rtti.$Enum("TTMSFNCTreeViewNodeTextMode",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCTreeViewNodeTextMode});
  rtl.createClass(this,"TTMSFNCTreeViewNodeStructure",pas.contnrs.TObjectList,function () {
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      this.SetItem(Index,Value);
    };
  });
  rtl.createClass(this,"TTMSFNCTreeViewVisibleNodes",pas.Classes.TList,function () {
    this.GetItem = function (Index) {
      var Result = null;
      Result = rtl.getObject(this.Get(Index));
      return Result;
    };
    this.SetItem = function (Index, Value) {
      this.Put(Index,Value);
    };
  });
  rtl.recNewT(this,"TTMSFNCTreeViewDisplayGroup",function () {
    this.StartColumn = 0;
    this.EndColumn = 0;
    this.$eq = function (b) {
      return (this.StartColumn === b.StartColumn) && (this.EndColumn === b.EndColumn);
    };
    this.$assign = function (s) {
      this.StartColumn = s.StartColumn;
      this.EndColumn = s.EndColumn;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCTreeViewDisplayGroup",{},this);
    $r.addField("StartColumn",rtl.longint);
    $r.addField("EndColumn",rtl.longint);
  });
  rtl.createClass(this,"TTMSFNCTreeViewDisplayGroups",pas.Classes.TList,function () {
    this.GetItem = function (Index) {
      var Result = $mod.TTMSFNCTreeViewDisplayGroup.$new();
      Result.$assign(rtl.getObject(this.Get(Index)));
      return Result;
    };
    this.SetItem = function (Index, Value) {
      this.Put(Index,Value);
    };
  });
  rtl.createClass(this,"TTMSFNCTreeViewData",pas["WEBLib.TMSFNCTreeViewBase"].TTMSFNCTreeViewBase,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCTreeViewBase"].TTMSFNCTreeViewBase.$init.call(this);
      this.FFilterApplied = false;
      this.FBlockUpdate = false;
      this.FNodeStructure = null;
      this.FVisibleNodes = null;
      this.FColumns = null;
      this.FGroups = null;
      this.FNodes = null;
      this.FBitmapContainer = null;
      this.FDisplayGroups = null;
      this.FFilter = null;
      this.FSortMode = 0;
    };
    this.$final = function () {
      this.FNodeStructure = undefined;
      this.FVisibleNodes = undefined;
      this.FColumns = undefined;
      this.FGroups = undefined;
      this.FNodes = undefined;
      this.FBitmapContainer = undefined;
      this.FDisplayGroups = undefined;
      this.FFilter = undefined;
      pas["WEBLib.TMSFNCTreeViewBase"].TTMSFNCTreeViewBase.$final.call(this);
    };
    this.SetColumns = function (Value) {
      this.FColumns.Assign(Value);
    };
    this.SetGroups = function (Value) {
      this.FGroups.Assign(Value);
    };
    this.SetNodes = function (Value) {
      this.FNodes.Assign(Value);
    };
    this.GetBitmapContainer = function () {
      var Result = null;
      Result = this.FBitmapContainer;
      return Result;
    };
    this.SetBitmapContainer = function (Value) {
      this.FBitmapContainer = Value;
      this.Invalidate();
    };
    this.Notification = function (AComponent, Operation) {
      pas["WEBLib.Menus"].TWebCustomControl.Notification.apply(this,arguments);
      if ((AComponent === this.FBitmapContainer) && (Operation === pas.Classes.TOperation.opRemove)) this.FBitmapContainer = null;
    };
    this.CreateColumns = function () {
      var Result = null;
      Result = $mod.TTMSFNCTreeViewColumns.$create("Create$3",[this]);
      return Result;
    };
    this.CreateGroups = function () {
      var Result = null;
      Result = $mod.TTMSFNCTreeViewGroups.$create("Create$3",[this]);
      return Result;
    };
    this.CreateNodes = function () {
      var Result = null;
      Result = $mod.TTMSFNCTreeViewNodes.$create("Create$3",[this,null]);
      return Result;
    };
    this.GetInsertPosition = function (ANode, ARoot, AInsert) {
      var Result = 0;
      var prev = null;
      var I = 0;
      var r = 0;
      var n = null;
      Result = -1;
      if (!(ANode != null)) return Result;
      if (ANode.FRow === 0) {
        Result = 0;
        return Result;
      };
      if (AInsert) {
        prev = this.GetNodeFromNodeStructure(ANode.FRow - 1)}
       else prev = this.GetNodeFromNodeStructure(ANode.FRow);
      if (ARoot) {
        while ((prev != null) && (prev.FParentNode >= 0) && (prev.FParentNode <= (this.FNodeStructure.GetCount() - 1))) {
          n = this.GetNodeFromNodeStructure(prev.FParentNode);
          if (n !== prev) {
            prev = n}
           else break;
        };
      };
      if (prev != null) {
        for (var $l = 0, $end = this.FVisibleNodes.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          if (AInsert) {
            r = ANode.FRow + 1}
           else r = ANode.FRow;
          if (this.FVisibleNodes.GetItem(I).FRow === r) {
            Result = I;
            break;
          };
        };
      };
      return Result;
    };
    this.GetNodeFromNodeStructure = function (AIndex) {
      var Result = null;
      Result = null;
      if ((AIndex >= 0) && (AIndex <= (this.FNodeStructure.GetCount() - 1))) Result = this.FNodeStructure.GetItem$1(AIndex);
      return Result;
    };
    this.MatchFilter = function (ANode) {
      var Result = false;
      var i = 0;
      var s = "";
      var temp = false;
      Result = true;
      for (var $l = 1, $end = this.FFilter.GetCount(); $l <= $end; $l++) {
        i = $l;
        var $with = this.FFilter.GetItem$1(i - 1);
        s = "";
        this.DoGetNodeText(ANode,$with.FColumn,$mod.TTMSFNCTreeViewNodeTextMode.tntmDrawing,{get: function () {
            return s;
          }, set: function (v) {
            s = v;
          }});
        s = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.HTMLStrip(s);
        s = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.UnFixMarkup(s,true,false);
        s = pas.SysUtils.Trim(s);
        if ($with.FPrefix !== "") if (pas.System.Pos($with.FPrefix,s) === 1) pas.System.Delete({get: function () {
            return s;
          }, set: function (v) {
            s = v;
          }},1,this.FFilter.GetItem$1(i - 1).FPrefix.length);
        if ($with.FSuffix !== "") if (pas.System.Pos($with.FSuffix,s) === ((1 + s.length) - $with.FSuffix.length)) pas.System.Delete({get: function () {
            return s;
          }, set: function (v) {
            s = v;
          }},(1 + s.length) - $with.FSuffix.length,s.length);
        try {
          temp = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MatchStrEx($with.FCondition,s,$with.FCaseSensitive);
        } catch ($e) {
          temp = false;
        };
        var $tmp = this.FFilter.GetItem$1(i - 1).FOperation;
        if ($tmp === $mod.TTMSFNCTreeViewFilterOperation.tfoSHORT) {
          Result = temp;
          if (!Result) break;
        } else if ($tmp === $mod.TTMSFNCTreeViewFilterOperation.tfoNONE) {
          Result = temp}
         else if ($tmp === $mod.TTMSFNCTreeViewFilterOperation.tfoAND) {
          Result = Result && temp}
         else if ($tmp === $mod.TTMSFNCTreeViewFilterOperation.tfoOR) {
          Result = Result || temp}
         else if ($tmp === $mod.TTMSFNCTreeViewFilterOperation.tfoXOR) Result = Result ^ temp;
      };
      return Result;
    };
    this.BuildNodeList = function () {
      var v = null;
      var c = 0;
      if (this.FNodeListBuild) return;
      this.FNodeStructure.Clear();
      this.FVisibleNodes.Clear();
      v = $mod.TTMSFNCTreeViewVirtualNode.$create("Create$1",[this]);
      this.FTotalRowHeight = 1;
      this.SetRowCount(0);
      c = 0;
      this.BuildInternalNodeList(v,"ROOT",-1,-1,-1,true,{get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }});
      this.SetRowCount(this.FVisibleNodes.GetCount());
      this.FNodeListBuild = this.FNodeStructure.GetCount() > 0;
    };
    this.UpdateColumns = function () {
      var I = 0;
      var c = null;
      var g = null;
      var grp = $mod.TTMSFNCTreeViewDisplayGroup.$new();
      if ((this.FUpdateCount$1 > 0) || (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState)) return;
      this.FDisplayGroups.Clear();
      for (var $l = 0, $end = this.FGroups.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        g = this.FGroups.GetItem$1(I);
        grp.StartColumn = Math.max(0,Math.min(g.FStartColumn,this.FColumns.GetCount() - 1));
        grp.EndColumn = Math.max(0,Math.min(g.FEndColumn,this.FColumns.GetCount() - 1));
        this.FDisplayGroups.Add($mod.TTMSFNCTreeViewDisplayGroup.$clone(grp));
      };
      for (var $l1 = 0, $end1 = this.FColumns.GetCount() - 1; $l1 <= $end1; $l1++) {
        I = $l1;
        c = this.FColumns.GetItem$1(I);
        if (c.FVisible) {
          this.SetColWidths(I,c.FWidth);
          this.SetColMinWidths(I,c.FMinimumWidth);
        } else {
          this.SetColWidths(I,0);
          this.SetColMinWidths(I,0);
        };
      };
    };
    this.BuildInternalNodeList = function (ANode, AID, AParentNode, ANodeIndex, ALevel, AParentExpanded, ATotalChildren) {
      var I = 0;
      var nd = 0;
      var vi = false;
      var v = null;
      var exp = false;
      var tot = 0;
      var chk = false;
      var ext = false;
      var chkst = [];
      var p = null;
      var l = [];
      ANode.FRow = this.FNodeStructure.GetCount();
      ANode.FParentNode = AParentNode;
      ANode.FIndex = ANodeIndex;
      ANode.FLevel = ALevel;
      if (AID !== "ROOT") this.GetNodeForNodeData(ANode);
      nd = 0;
      if (ALevel < 100) this.DoGetNumberOfNodes(ANode,{get: function () {
          return nd;
        }, set: function (v) {
          nd = v;
        }});
      ANode.FChildren = nd;
      ANode.FCalculated = false;
      ANode.FHeight = this.GetDefaultRowHeight(ANode);
      exp = false;
      if (AID !== "ROOT") this.DoIsNodeExpanded(ANode,{get: function () {
          return exp;
        }, set: function (v) {
          exp = v;
        }});
      ANode.FExpanded = exp;
      ext = false;
      this.DoIsNodeExtended(ANode,{get: function () {
          return ext;
        }, set: function (v) {
          ext = v;
        }});
      this.UpdateNodeExtended(ANode,ext);
      chkst = rtl.arraySetLength(chkst,false,0);
      if (AID !== "ROOT") {
        for (var $l = 0, $end = this.FColumnCount - 1; $l <= $end; $l++) {
          I = $l;
          chk = false;
          this.DoIsNodeChecked(ANode,I,{get: function () {
              return chk;
            }, set: function (v) {
              chk = v;
            }});
          chkst = rtl.arraySetLength(chkst,false,rtl.length(chkst) + 1);
          chkst[rtl.length(chkst) - 1] = chk;
        };
        ANode.FCheckStates = rtl.arrayRef(chkst);
      };
      if (this.FFilterApplied) {
        vi = this.MatchFilter(ANode)}
       else vi = true;
      if (AID !== "ROOT") this.DoIsNodeVisible(ANode,{get: function () {
          return vi;
        }, set: function (v) {
          vi = v;
        }});
      tot = nd;
      if (AID !== "ROOT") {
        this.FNodeStructure.Add$1(ANode);
        if ((AParentExpanded || (ANode.FLevel === 0)) && vi) {
          if (this.FFilterApplied) {
            p = ANode.GetParent();
            l = [];
            while (p != null) {
              if (!p.FAddedToVisibleList) {
                l = rtl.arraySetLength(l,null,rtl.length(l) + 1);
                l[rtl.length(l) - 1] = p;
              };
              p = p.GetParent();
            };
            for (var $l1 = rtl.length(l) - 1; $l1 >= 0; $l1--) {
              I = $l1;
              this.FVisibleNodes.Add(l[I]);
              l[I].FAddedToVisibleList = true;
            };
          };
          this.FVisibleNodes.Add(ANode);
          ANode.FAddedToVisibleList = true;
        };
      };
      for (var $l2 = 0, $end1 = nd - 1; $l2 <= $end1; $l2++) {
        I = $l2;
        if (this.FNodeStructure.GetCount() === 2000000) break;
        v = $mod.TTMSFNCTreeViewVirtualNode.$create("Create$1",[this]);
        if (AID === "ROOT") {
          this.BuildInternalNodeList(v,"",AParentNode,I,0,exp,{get: function () {
              return tot;
            }, set: function (v) {
              tot = v;
            }})}
         else this.BuildInternalNodeList(v,"",ANode.FRow,I,ANode.FLevel + 1,exp,{get: function () {
            return tot;
          }, set: function (v) {
            tot = v;
          }});
      };
      ATotalChildren.set(ATotalChildren.get() + tot);
      if (AID !== "ROOT") {
        ANode.FTotalChildren = tot}
       else ANode = rtl.freeLoc(ANode);
    };
    this.GetNodeForNodeData = function (ANode) {
      var col = null;
      var p = null;
      var it = null;
      if (ANode != null) {
        p = this.GetNodeFromNodeStructure(ANode.FParentNode);
        if ((p != null) && (p.FNode != null)) {
          col = p.FNode.FNodes}
         else col = this.FNodes;
      } else return;
      if (col != null) {
        if ((ANode.FIndex >= 0) && (ANode.FIndex <= (col.GetCount() - 1))) {
          it = col.GetItem$1(ANode.FIndex);
          ANode.FNode = it;
          it.FVirtualNode = ANode;
        };
      };
    };
    this.DoGetNumberOfNodes = function (ANode, ANumberOfNodes) {
      if (ANode.FNode != null) {
        ANumberOfNodes.set(ANode.FNode.FNodes.GetCount())}
       else ANumberOfNodes.set(this.FNodes.GetCount());
    };
    this.DoGetColumnTrimming = function (AColumn, AKind, ATrimming) {
    };
    this.DoGetColumnHorizontalTextAlign = function (AColumn, AKind, AHorizontalTextAlign) {
    };
    this.DoGetColumnVerticalTextAlign = function (AColumn, AKind, AVerticalTextAlign) {
    };
    this.DoGetColumnWordWrapping = function (AColumn, AKind, AWordWrapping) {
    };
    this.DoGetNodeSides = function (ANode, ASides) {
    };
    this.DoGetNodeText = function (ANode, AColumn, AMode, AText) {
      var it = null;
      it = ANode.FNode;
      if ((it != null) && (it.FValues != null)) {
        if ((AColumn >= 0) && (AColumn <= (it.FValues.GetCount() - 1))) AText.set(it.FValues.GetItem$1(AColumn).GetText());
      };
    };
    this.DoGetNodeData = function (ANode) {
    };
    this.DoGetNodeTitle = function (ANode, AColumn, AMode, ATitle) {
      var it = null;
      it = ANode.FNode;
      if ((it != null) && (it.FValues != null)) {
        if ((AColumn >= 0) && (AColumn <= (it.FValues.GetCount() - 1))) ATitle.set(it.FValues.GetItem$1(AColumn).FTitle);
      };
    };
    this.DoGetNodeTitleExpanded = function (ANode, AColumn, AExpanded) {
      var it = null;
      it = ANode.FNode;
      if ((it != null) && (it.FValues != null)) {
        if ((AColumn >= 0) && (AColumn <= (it.FValues.GetCount() - 1))) AExpanded.set(it.FValues.GetItem$1(AColumn).FTitleExpanded);
      };
    };
    this.DoGetNodeTrimming = function (ANode, AColumn, ATrimming) {
    };
    this.DoGetNodeHorizontalTextAlign = function (ANode, AColumn, AHorizontalTextAlign) {
    };
    this.DoGetNodeVerticalTextAlign = function (ANode, AColumn, AVerticalTextAlign) {
    };
    this.DoGetNodeWordWrapping = function (ANode, AColumn, AWordWrapping) {
    };
    this.DoGetNodeTitleTrimming = function (ANode, AColumn, ATrimming) {
    };
    this.DoGetNodeTitleHorizontalTextAlign = function (ANode, AColumn, AHorizontalTextAlign) {
    };
    this.DoGetNodeTitleVerticalTextAlign = function (ANode, AColumn, AVerticalTextAlign) {
    };
    this.DoGetNodeTitleWordWrapping = function (ANode, AColumn, AWordWrapping) {
    };
    this.DoGetNodeExtraSize = function (ANode, AColumn, AExtraSize) {
    };
    this.DoGetNodeTitleExtraSize = function (ANode, AColumn, ATitleExtraSize) {
    };
    this.DoGetNodeCheckType = function (ANode, AColumn, ACheckType) {
      var it = null;
      it = ANode.FNode;
      if (it != null) {
        if ((AColumn >= 0) && (AColumn <= (it.FValues.GetCount() - 1))) ACheckType.set(it.FValues.GetItem$1(AColumn).FCheckType);
      };
    };
    this.DoGetNodeIcon = function (ANode, AColumn, ALarge, AIcon) {
      var it = null;
      var v = null;
      it = ANode.FNode;
      if (it != null) {
        if ((AColumn >= 0) && (AColumn <= (it.FValues.GetCount() - 1))) {
          v = it.FValues.GetItem$1(AColumn);
          if (ANode.FExpanded) {
            if (ALarge) {
              if ((this.GetBitmapContainer() != null) && (v.FExpandedIconLargeName !== "")) AIcon.set(this.GetBitmapContainer().FindBitmap$1(v.FExpandedIconLargeName));
              if (!(AIcon.get() != null)) AIcon.set(v.FExpandedIconLarge);
            } else {
              if ((this.GetBitmapContainer() != null) && (v.FExpandedIconName !== "")) AIcon.set(this.GetBitmapContainer().FindBitmap$1(v.FExpandedIconName));
              if (!(AIcon.get() != null)) AIcon.set(v.FExpandedIcon);
            };
          } else {
            if (ALarge) {
              if ((this.GetBitmapContainer() != null) && (v.FCollapsedIconLargeName !== "")) AIcon.set(this.GetBitmapContainer().FindBitmap$1(v.FCollapsedIconLargeName));
              if (!(AIcon.get() != null)) AIcon.set(v.FCollapsedIconLarge);
            } else {
              if ((this.GetBitmapContainer() != null) && (v.FCollapsedIconName !== "")) AIcon.set(this.GetBitmapContainer().FindBitmap$1(v.FCollapsedIconName));
              if (!(AIcon.get() != null)) AIcon.set(v.FCollapsedIcon);
            };
          };
        };
      };
    };
    this.DoGetNodeIconSize = function (ANode, AColumn, ALarge, AIcon, AIconWidth, AIconHeight) {
    };
    this.DoGetNodeSelectedColor = function (ANode, AColor) {
    };
    this.DoGetNodeDisabledColor = function (ANode, AColor) {
    };
    this.DoGetNodeColor = function (ANode, AColor) {
    };
    this.DoGetNodeSelectedTextColor = function (ANode, AColumn, ATextColor) {
    };
    this.DoGetNodeDisabledTextColor = function (ANode, AColumn, ATextColor) {
    };
    this.DoGetNodeSelectedTitleColor = function (ANode, AColumn, ATitleColor) {
    };
    this.DoGetNodeDisabledTitleColor = function (ANode, AColumn, ATitleColor) {
    };
    this.DoGetNodeTextColor = function (ANode, AColumn, ATextColor) {
    };
    this.DoGetNodeTitleColor = function (ANode, AColumn, ATitleColor) {
    };
    this.DoIsNodeExpanded = function (ANode, AExpanded) {
      var it = null;
      it = ANode.FNode;
      if (it != null) AExpanded.set(it.FExpanded);
    };
    this.DoIsNodeExtended = function (ANode, AExtended) {
      var it = null;
      it = ANode.FNode;
      if (it != null) AExtended.set(it.FExtended);
    };
    this.DoIsNodeChecked = function (ANode, AColumn, AChecked) {
      var it = null;
      it = ANode.FNode;
      if (it != null) {
        if ((AColumn >= 0) && (AColumn <= (it.FValues.GetCount() - 1))) AChecked.set(it.FValues.GetItem$1(AColumn).FChecked);
      };
    };
    this.DoIsNodeVisible = function (ANode, AVisible) {
    };
    this.DoIsNodeEnabled = function (ANode, AEnabled) {
      var it = null;
      it = ANode.FNode;
      if (it != null) AEnabled.set(it.FEnabled);
    };
    this.DoNodeCompare = function (ANode1, ANode2, AColumn, ACompareResult) {
    };
    this.DoGetHTMLTemplateValue = function (ANodeValue, AName, AValue) {
    };
    this.DoGetHTMLTemplate = function (ANodeValue, AColumnIndex, AHTMLTemplate) {
    };
    this.ToggleCheckNodeInternal = function (ANode, AColumn, ARecurse) {
      var chk = false;
      if ((pas.Classes.TComponentStateItem.csDestroying in this.FComponentState) || !(ANode != null) || !this.FNodeListBuild) return;
      if ((AColumn >= 0) && (AColumn <= (rtl.length(ANode.FCheckStates) - 1))) {
        chk = ANode.FCheckStates[AColumn];
        if (chk) {
          this.UnCheckNodeInternal(ANode,AColumn,ARecurse)}
         else this.CheckNodeInternal(ANode,AColumn,ARecurse);
      };
    };
    this.CheckNodeInternal = function (ANode, AColumn, ARecurse) {
      var chkt = 0;
      var pn = null;
      var n = null;
      var st = 0;
      var stp = 0;
      var I = 0;
      var v = null;
      if (!(ANode != null)) return;
      if ((AColumn >= 0) && (AColumn <= (rtl.length(ANode.FCheckStates) - 1))) {
        ANode.FCheckStates[AColumn] = true;
        this.UpdateCheckState(ANode,AColumn,ANode.FCheckStates[AColumn]);
      };
      if (ANode.FNode != null) {
        if ((AColumn >= 0) && (AColumn <= (ANode.FNode.FValues.GetCount() - 1))) ANode.FNode.FValues.UpdateChecked(AColumn,true);
      };
      chkt = $mod.TTMSFNCTreeViewNodeCheckType.tvntNone;
      this.DoGetNodeCheckType(ANode,AColumn,{get: function () {
          return chkt;
        }, set: function (v) {
          chkt = v;
        }});
      if (chkt === $mod.TTMSFNCTreeViewNodeCheckType.tvntRadioButton) {
        pn = this.GetNodeFromNodeStructure(ANode.FParentNode);
        if (pn != null) {
          st = pn.FRow + 1;
          stp = st + pn.FTotalChildren;
        } else {
          st = 0;
          stp = this.FNodeStructure.GetCount();
        };
        while (st < stp) {
          n = this.GetNodeFromNodeStructure(st);
          if (n != null) {
            if (n !== ANode) {
              chkt = $mod.TTMSFNCTreeViewNodeCheckType.tvntNone;
              this.DoGetNodeCheckType(n,AColumn,{get: function () {
                  return chkt;
                }, set: function (v) {
                  chkt = v;
                }});
              if (chkt === $mod.TTMSFNCTreeViewNodeCheckType.tvntRadioButton) {
                if ((AColumn >= 0) && (AColumn <= (rtl.length(n.FCheckStates) - 1))) {
                  n.FCheckStates[AColumn] = false;
                  this.UpdateCheckState(n,AColumn,n.FCheckStates[AColumn]);
                };
                if (n.FNode != null) {
                  if ((AColumn >= 0) && (AColumn <= (n.FNode.FValues.GetCount() - 1))) n.FNode.FValues.UpdateChecked(AColumn,false);
                };
              };
            };
            st = st + n.FTotalChildren + 1;
          } else break;
        };
      };
      if (ARecurse) {
        for (var $l = ANode.FRow + 1, $end = ANode.FRow + ANode.FTotalChildren; $l <= $end; $l++) {
          I = $l;
          v = this.GetNodeFromNodeStructure(I);
          if (v != null) this.CheckNodeInternal(v,AColumn,ARecurse);
        };
      };
      this.Invalidate();
    };
    this.UpdateCheckState = function (ANode, AColumn, AChecked) {
    };
    this.UnCheckNodeInternal = function (ANode, AColumn, ARecurse) {
      var chkt = 0;
      var I = 0;
      var v = null;
      if ((pas.Classes.TComponentStateItem.csDestroying in this.FComponentState) || !(ANode != null) || !this.FNodeListBuild) return;
      chkt = $mod.TTMSFNCTreeViewNodeCheckType.tvntNone;
      this.DoGetNodeCheckType(ANode,AColumn,{get: function () {
          return chkt;
        }, set: function (v) {
          chkt = v;
        }});
      if (chkt === $mod.TTMSFNCTreeViewNodeCheckType.tvntCheckBox) {
        if ((AColumn >= 0) && (AColumn <= (rtl.length(ANode.FCheckStates) - 1))) {
          ANode.FCheckStates[AColumn] = false;
          this.UpdateCheckState(ANode,AColumn,ANode.FCheckStates[AColumn]);
        };
        if (ANode.FNode != null) {
          if ((AColumn >= 0) && (AColumn <= (ANode.FNode.FValues.GetCount() - 1))) ANode.FNode.FValues.UpdateChecked(AColumn,false);
        };
      };
      if (ARecurse) {
        for (var $l = ANode.FRow + 1, $end = ANode.FRow + ANode.FTotalChildren; $l <= $end; $l++) {
          I = $l;
          v = this.GetNodeFromNodeStructure(I);
          if (v != null) this.UnCheckNodeInternal(v,AColumn,ARecurse);
        };
      };
      this.Invalidate();
    };
    this.ExpandNodeInternal = function (ANode, ARecurse) {
      var I = 0;
      var v = null;
      var n = null;
      if ((pas.Classes.TComponentStateItem.csDestroying in this.FComponentState) || !(ANode != null)) return;
      if (ANode.FExpanded) {
        if (ARecurse) {
          n = ANode.GetFirstChild();
          while (n != null) {
            this.ExpandNodeInternal(n,ARecurse);
            n = n.GetNextSibling();
          };
        };
        return;
      };
      ANode.FExpanded = true;
      this.UpdateNodeExpanded(ANode,true);
      if (ARecurse) {
        for (var $l = ANode.FRow + 1, $end = ANode.FRow + ANode.FTotalChildren; $l <= $end; $l++) {
          I = $l;
          v = this.GetNodeFromNodeStructure(I);
          if (v != null) this.UpdateNodeExpanded(v,true);
        };
      };
      this.UpdateVisibleNodes(ANode);
      if (!this.FBlockUpdate) {
        this.ResetNodes(false);
        this.UpdateTreeView();
        this.Invalidate();
      };
    };
    this.CollapseNodeInternal = function (ANode, ARecurse) {
      var I = 0;
      var v = null;
      var n = null;
      if (!(ANode != null) || !this.FNodeListBuild || (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState)) return;
      if (!ANode.FExpanded) {
        if (ARecurse) {
          n = ANode.GetFirstChild();
          while (n != null) {
            this.CollapseNodeInternal(n,ARecurse);
            n = n.GetNextSibling();
          };
        };
        return;
      };
      ANode.FExpanded = false;
      this.UpdateNodeExpanded(ANode,false);
      if (ARecurse) {
        for (var $l = ANode.FRow + 1, $end = ANode.FRow + ANode.FTotalChildren; $l <= $end; $l++) {
          I = $l;
          v = this.GetNodeFromNodeStructure(I);
          if (v != null) this.UpdateNodeExpanded(v,false);
        };
      };
      this.UpdateVisibleNodes(ANode);
      if (!this.FBlockUpdate) {
        this.ResetNodes(false);
        this.UpdateTreeView();
        this.Invalidate();
      };
    };
    this.RemoveNodeInternal = function (ANode, AUpdateNodes) {
      var Result = $mod.TTMSFNCTreeViewVirtualNodeRemoveData.$new();
      var I = 0;
      var R = 0;
      var pi = 0;
      var subv = null;
      var pv = null;
      var rs = null;
      var cnt = 0;
      var exp = false;
      var ext = false;
      var chkst = [];
      var K = 0;
      var chk = false;
      if ((pas.Classes.TComponentStateItem.csDestroying in this.FComponentState) || !this.FNodeListBuild || !(ANode != null)) return Result;
      cnt = this.FNodeStructure.GetCount();
      pv = this.GetNodeFromNodeStructure(ANode.FParentNode);
      while (pv != null) {
        this.UpdateNodeTotalChildren(pv,pv.FTotalChildren - 1 - ANode.FTotalChildren);
        if (pv.FRow === ANode.FParentNode) this.UpdateNodeChildren(pv,pv.FChildren - 1);
        pi = pv.FParentNode;
        pv = this.GetNodeFromNodeStructure(pi);
      };
      for (var $l = ANode.FTotalChildren - 1; $l >= 0; $l--) {
        I = $l;
        R = I + ANode.FRow + 1;
        subv = this.GetNodeFromNodeStructure(R);
        if (subv != null) {
          if (this.FVisibleNodes.IndexOf(subv) > -1) {
            this.FVisibleNodes.Remove(subv);
            this.FTotalRowHeight = this.FTotalRowHeight - subv.FHeight;
            this.SetRowCount(this.FRowCount - 1);
          };
          this.FNodeStructure.Remove$1(subv);
          this.RemoveNodeFromSelection(subv);
        };
      };
      R = ANode.FRow;
      pi = ANode.FParentNode;
      if (this.FVisibleNodes.IndexOf(ANode) > -1) {
        this.FVisibleNodes.Remove(ANode);
        this.FTotalRowHeight = this.FTotalRowHeight - ANode.FHeight;
        this.SetRowCount(this.FRowCount - 1);
      };
      this.UpdateNodeChildren(ANode,ANode.FChildren - 1);
      this.UpdateNodeTotalChildren(ANode,ANode.FTotalChildren - 1);
      this.ClearFocusedNode(ANode);
      this.FNodeStructure.Remove$1(ANode);
      this.RemoveNodeFromSelection(ANode);
      cnt = cnt - this.FNodeStructure.GetCount();
      Result.Count = cnt;
      Result.RowIndex = R;
      Result.ParentNode = pi;
      if (AUpdateNodes) {
        for (var $l1 = R, $end = this.FNodeStructure.GetCount() - 1; $l1 <= $end; $l1++) {
          I = $l1;
          rs = this.GetNodeFromNodeStructure(I);
          if (rs != null) {
            this.UpdateNodeRow(rs,rs.FRow - cnt);
            if (rs.FParentNode > pi) this.UpdateNodeParentNode(rs,rs.FParentNode - cnt);
            if (rs.FParentNode === pi) this.UpdateNodeIndex(rs,rs.FIndex - 1);
            this.GetNodeForNodeData(rs);
            exp = false;
            this.DoIsNodeExpanded(rs,{get: function () {
                return exp;
              }, set: function (v) {
                exp = v;
              }});
            this.UpdateNodeExpanded(rs,exp);
            ext = false;
            this.DoIsNodeExtended(rs,{get: function () {
                return ext;
              }, set: function (v) {
                ext = v;
              }});
            this.UpdateNodeExtended(rs,ext);
            chkst = rtl.arraySetLength(chkst,false,0);
            for (var $l2 = 0, $end1 = this.FColumnCount - 1; $l2 <= $end1; $l2++) {
              K = $l2;
              chk = false;
              this.DoIsNodeChecked(rs,K,{get: function () {
                  return chk;
                }, set: function (v) {
                  chk = v;
                }});
              chkst = rtl.arraySetLength(chkst,false,rtl.length(chkst) + 1);
              chkst[rtl.length(chkst) - 1] = chk;
            };
            this.UpdateNodeCheckStates(rs,rtl.arrayRef(chkst));
          };
        };
        if (!this.FBlockUpdate) {
          this.ResetNodes(false);
          this.UpdateTreeView();
          this.Invalidate();
        };
      };
      return Result;
    };
    this.UpdateNodesInternal = function (ANodeRemoveData) {
      var cnt = 0;
      var I = 0;
      var pi = 0;
      var R = 0;
      var rs = null;
      var ext = false;
      var exp = false;
      var chkst = [];
      var K = 0;
      var chk = false;
      cnt = ANodeRemoveData.Count;
      pi = ANodeRemoveData.ParentNode;
      R = ANodeRemoveData.RowIndex;
      for (var $l = R, $end = this.FNodeStructure.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        rs = this.GetNodeFromNodeStructure(I);
        if (rs != null) {
          this.UpdateNodeRow(rs,rs.FRow - cnt);
          if (rs.FParentNode > pi) this.UpdateNodeParentNode(rs,rs.FParentNode - cnt);
          if (rs.FParentNode === pi) this.UpdateNodeIndex(rs,rs.FIndex - 1);
          this.GetNodeForNodeData(rs);
          exp = false;
          this.DoIsNodeExpanded(rs,{get: function () {
              return exp;
            }, set: function (v) {
              exp = v;
            }});
          this.UpdateNodeExpanded(rs,exp);
          ext = false;
          this.DoIsNodeExtended(rs,{get: function () {
              return ext;
            }, set: function (v) {
              ext = v;
            }});
          this.UpdateNodeExtended(rs,ext);
          chkst = rtl.arraySetLength(chkst,false,0);
          for (var $l1 = 0, $end1 = this.FColumnCount - 1; $l1 <= $end1; $l1++) {
            K = $l1;
            chk = false;
            this.DoIsNodeChecked(rs,K,{get: function () {
                return chk;
              }, set: function (v) {
                chk = v;
              }});
            chkst = rtl.arraySetLength(chkst,false,rtl.length(chkst) + 1);
            chkst[rtl.length(chkst) - 1] = chk;
          };
          this.UpdateNodeCheckStates(rs,rtl.arrayRef(chkst));
        };
      };
      if (!this.FBlockUpdate) {
        this.ResetNodes(false);
        this.UpdateTreeView();
        this.Invalidate();
      };
    };
    this.InsertNodeInternal = function (AParentNode, AIndex, AInsertIndex, ANode) {
      var I = 0;
      var pi = 0;
      var pv = null;
      var rs = null;
      var cnt = 0;
      var vi = false;
      var chk = false;
      var chkst = [];
      var ins = 0;
      var exp = false;
      var ext = false;
      var K = 0;
      if (!this.FNodeListBuild || (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState)) return;
      if (!(ANode != null)) {
        ANode = rtl.freeLoc(ANode);
        return;
      };
      cnt = this.FNodeStructure.GetCount();
      if (AParentNode != null) {
        pi = AParentNode.FRow;
        if ((pi >= 0) && (pi <= (this.FNodeStructure.GetCount() - 1))) {
          pv = this.GetNodeFromNodeStructure(pi);
          while (pv != null) {
            this.UpdateNodeTotalChildren(pv,pv.FTotalChildren + 1);
            if (pv.FRow === AParentNode.FRow) this.UpdateNodeChildren(pv,pv.FChildren + 1);
            pi = pv.FParentNode;
            pv = this.GetNodeFromNodeStructure(pi);
          };
        };
      };
      this.UpdateNodeIndex(ANode,AIndex);
      this.UpdateNodeRow(ANode,AInsertIndex);
      if (AParentNode != null) {
        this.UpdateNodeParentNode(ANode,AParentNode.FRow);
        this.UpdateNodeLevel(ANode,AParentNode.FLevel + 1);
      } else {
        this.UpdateNodeParentNode(ANode,-1);
        this.UpdateNodeLevel(ANode,0);
      };
      this.UpdateNodeHeight(ANode,this.GetDefaultRowHeight(ANode));
      this.GetNodeForNodeData(ANode);
      exp = false;
      this.DoIsNodeExpanded(ANode,{get: function () {
          return exp;
        }, set: function (v) {
          exp = v;
        }});
      this.UpdateNodeExpanded(ANode,exp);
      ext = false;
      this.DoIsNodeExtended(ANode,{get: function () {
          return ext;
        }, set: function (v) {
          ext = v;
        }});
      this.UpdateNodeExtended(ANode,ext);
      chkst = rtl.arraySetLength(chkst,false,0);
      for (var $l = 0, $end = this.FColumnCount - 1; $l <= $end; $l++) {
        I = $l;
        chk = false;
        this.DoIsNodeChecked(ANode,I,{get: function () {
            return chk;
          }, set: function (v) {
            chk = v;
          }});
        chkst = rtl.arraySetLength(chkst,false,rtl.length(chkst) + 1);
        chkst[rtl.length(chkst) - 1] = chk;
      };
      this.UpdateNodeCheckStates(ANode,rtl.arrayRef(chkst));
      if ((ANode.FRow >= 0) && (ANode.FRow < this.FNodeStructure.GetCount())) {
        this.FNodeStructure.Insert$1(ANode.FRow,ANode)}
       else this.FNodeStructure.Add$1(ANode);
      vi = true;
      if (AParentNode != null) this.DoIsNodeVisible(AParentNode,{get: function () {
          return vi;
        }, set: function (v) {
          vi = v;
        }});
      cnt = cnt - this.FNodeStructure.GetCount();
      for (var $l1 = ANode.FRow + 1, $end1 = this.FNodeStructure.GetCount() - 1; $l1 <= $end1; $l1++) {
        I = $l1;
        rs = this.GetNodeFromNodeStructure(I);
        if (rs != null) {
          this.UpdateNodeRow(rs,rs.FRow - cnt);
          if (rs.FParentNode > ANode.FParentNode) this.UpdateNodeParentNode(rs,rs.FParentNode - cnt);
          if (rs.FParentNode === ANode.FParentNode) this.UpdateNodeIndex(rs,rs.FIndex + 1);
          this.GetNodeForNodeData(rs);
          exp = false;
          this.DoIsNodeExpanded(rs,{get: function () {
              return exp;
            }, set: function (v) {
              exp = v;
            }});
          this.UpdateNodeExpanded(rs,exp);
          ext = false;
          this.DoIsNodeExtended(rs,{get: function () {
              return ext;
            }, set: function (v) {
              ext = v;
            }});
          this.UpdateNodeExtended(rs,ext);
          chkst = rtl.arraySetLength(chkst,false,0);
          for (var $l2 = 0, $end2 = this.FColumnCount - 1; $l2 <= $end2; $l2++) {
            K = $l2;
            chk = false;
            this.DoIsNodeChecked(rs,K,{get: function () {
                return chk;
              }, set: function (v) {
                chk = v;
              }});
            chkst = rtl.arraySetLength(chkst,false,rtl.length(chkst) + 1);
            chkst[rtl.length(chkst) - 1] = chk;
          };
          this.UpdateNodeCheckStates(rs,rtl.arrayRef(chkst));
        };
      };
      if (!(AParentNode != null) || ((AParentNode != null) && AParentNode.FExpanded && vi)) {
        if (!(AParentNode != null)) {
          this.SetRowCount(this.FRowCount + 1);
          this.FTotalRowHeight = this.FTotalRowHeight + this.GetDefaultRowHeight(ANode);
          ins = this.GetInsertPosition(ANode,true,true);
          if ((ins >= 0) && (ins < this.FVisibleNodes.GetCount())) {
            this.FVisibleNodes.Insert(ins,ANode)}
           else this.FVisibleNodes.Add(ANode);
        } else {
          this.UpdateNodeExpanded(AParentNode,false);
          this.UpdateVisibleNodes(AParentNode);
          this.UpdateNodeExpanded(AParentNode,true);
          this.UpdateVisibleNodes(AParentNode);
        };
      };
      this.ResetNodes(false);
      this.UpdateTreeView();
      this.Invalidate();
    };
    this.UpdateVisibleNodes = function (ANode) {
      var add = false;
      var R = 0;
      var I = 0;
      var C = 0;
      var idx = 0;
      var subv = null;
      var en = false;
      var vi = false;
      var visub = false;
      add = ANode.FExpanded;
      if (add) {
        idx = this.GetInsertPosition(ANode,ANode.FParentNode === -1,false);
        en = true;
        this.DoIsNodeEnabled(ANode,{get: function () {
            return en;
          }, set: function (v) {
            en = v;
          }});
        vi = true;
        this.DoIsNodeVisible(ANode,{get: function () {
            return vi;
          }, set: function (v) {
            vi = v;
          }});
        if ((idx !== -1) && vi && en) {
          I = 0;
          C = idx + 1;
          while (I < ANode.FTotalChildren) {
            R = I + ANode.FRow + 1;
            subv = this.GetNodeFromNodeStructure(R);
            if ((subv != null) && (((this.MatchFilter(subv) || subv.FAddedToVisibleList) && this.FFilterApplied) || !this.FFilterApplied)) {
              visub = true;
              this.DoIsNodeVisible(subv,{get: function () {
                  return visub;
                }, set: function (v) {
                  visub = v;
                }});
              if (visub) {
                if ((C >= 0) && (C < this.FVisibleNodes.GetCount())) {
                  this.FVisibleNodes.Insert(C,subv)}
                 else this.FVisibleNodes.Add(subv);
                if (subv.FChildren === 0) subv.FExpanded = true;
                this.FTotalRowHeight = this.FTotalRowHeight + subv.FHeight;
                this.SetRowCount(this.FRowCount + 1);
                C += 1;
              };
              if (!subv.FExpanded || !visub) I = I + subv.FTotalChildren;
            };
            I += 1;
          };
        };
      } else {
        for (var $l = 0, $end = ANode.FTotalChildren - 1; $l <= $end; $l++) {
          I = $l;
          R = I + ANode.FRow + 1;
          subv = this.GetNodeFromNodeStructure(R);
          if (subv != null) {
            this.UpdateNodeCalculated(subv,false);
            if (this.FVisibleNodes.IndexOf(subv) > -1) {
              this.FVisibleNodes.Remove(subv);
              if (subv.FChildren === 0) subv.FExpanded = false;
              this.FTotalRowHeight = this.FTotalRowHeight - subv.FHeight;
              this.SetRowCount(this.FRowCount - 1);
            };
          };
        };
      };
    };
    this.ToggleNodeInternal = function (ANode, ARecurse) {
      if ((pas.Classes.TComponentStateItem.csDestroying in this.FComponentState) || !(ANode != null) || !this.FNodeListBuild) return;
      if (ANode.FExpanded) {
        this.CollapseNodeInternal(ANode,ARecurse)}
       else this.ExpandNodeInternal(ANode,ARecurse);
    };
    this.InsertItemInternal = function (AItem) {
      var pn = null;
      if ((pas.Classes.TComponentStateItem.csDestroying in this.FComponentState) || !(AItem != null) || !this.FNodeListBuild) return;
      pn = AItem.FCollection.Node();
      if (pn != null) {
        this.InsertVirtualNode(AItem.GetIndex(),pn.FVirtualNode)}
       else this.InsertVirtualNode(AItem.GetIndex(),null);
    };
    this.RemoveItemInternal = function (AItem, AUpdate) {
      var Result = $mod.TTMSFNCTreeViewVirtualNodeRemoveData.$new();
      Result.RowIndex = -1;
      Result.Count = 0;
      Result.ParentNode = -1;
      if ((pas.Classes.TComponentStateItem.csDestroying in this.FComponentState) || !(AItem != null) || !this.FNodeListBuild) return Result;
      Result.$assign(this.RemoveNodeInternal(AItem.FVirtualNode,AUpdate));
      return Result;
    };
    this.GetNodesSpacing = function (ANode) {
      var Result = 0.0;
      Result = 0;
      return Result;
    };
    this.GetDefaultRowHeight = function (ANode) {
      var Result = 0.0;
      Result = this.FDefaultRowHeight + this.GetNodesSpacing(ANode);
      return Result;
    };
    this.GetVisibleNodeForIndex = function (AIndex) {
      var Result = null;
      Result = null;
      if ((AIndex >= 0) && (AIndex <= (this.FVisibleNodes.GetCount() - 1))) Result = this.FVisibleNodes.GetItem(AIndex);
      return Result;
    };
    this.ToggleNode = function (ANode) {
      if (ANode != null) this.ToggleVirtualNode(ANode.FVirtualNode,false);
    };
    this.UpdateNodeCalculated = function (ANode, ACalculated) {
      ANode.FCalculated = ACalculated;
    };
    this.UpdateNodeHeight = function (ANode, AHeight) {
      ANode.FHeight = AHeight;
    };
    this.UpdateNodeTitleHeight = function (ANode, AHeight) {
      ANode.FTitleHeight = AHeight;
    };
    this.UpdateNodeCheckStates = function (ANode, ACheckStates) {
      ANode.FCheckStates = rtl.arrayRef(ACheckStates);
    };
    this.UpdateNodeBitmapRects = function (ANode, ABitmapRects) {
      ANode.FBitmapRects = rtl.arrayRef(ABitmapRects);
    };
    this.UpdateNodeCheckRects = function (ANode, ACheckRects) {
      ANode.FCheckRects = rtl.arrayRef(ACheckRects);
    };
    this.UpdateNodeExpandRects = function (ANode, AExpandRects) {
      ANode.FExpandRects = rtl.arrayRef(AExpandRects);
    };
    this.UpdateNodeTextRects = function (ANode, ATextRects) {
      ANode.FTextRects = rtl.arrayRef(ATextRects);
    };
    this.UpdateNodeTitleRects = function (ANode, ATitleRects) {
      ANode.FTitleRects = rtl.arrayRef(ATitleRects);
    };
    this.UpdateNodeExtraRects = function (ANode, AExtraRects) {
      ANode.FExtraRects = rtl.arrayRef(AExtraRects);
    };
    this.UpdateNodeTitleExtraRects = function (ANode, ATitleExtraRects) {
      ANode.FTitleExtraRects = rtl.arrayRef(ATitleExtraRects);
    };
    this.UpdateNodeCacheReference = function (ANode, ACache) {
      ANode.FCache = ACache;
    };
    this.UpdateNodeExpanded = function (ANode, AExpanded) {
      ANode.FExpanded = AExpanded;
      if (ANode.FNode != null) ANode.FNode.FExpanded = AExpanded;
    };
    this.UpdateNodeExtended = function (ANode, AExtended) {
      ANode.FExtended = AExtended;
    };
    this.UpdateNodeTotalChildren = function (ANode, ATotalChildren) {
      ANode.FTotalChildren = ATotalChildren;
    };
    this.UpdateNodeChildren = function (ANode, AChildren) {
      ANode.FChildren = AChildren;
    };
    this.UpdateNodeIndex = function (ANode, AIndex) {
      ANode.FIndex = AIndex;
    };
    this.UpdateNodeRow = function (ANode, ARow) {
      ANode.FRow = ARow;
    };
    this.UpdateNodeLevel = function (ANode, ALevel) {
      ANode.FLevel = ALevel;
    };
    this.UpdateNodeParentNode = function (ANode, AParentNode) {
      ANode.FParentNode = AParentNode;
    };
    this.UpdateNode = function (ANode) {
      if (!(ANode != null) || (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState) || !this.FNodeListBuild) return;
      if (this.FBlockUpdateNode) return;
      ANode.FCalculated = false;
      if (this.FUpdateCount$1 > 0) return;
      this.UpdateNodesCache(true,false);
      this.Invalidate();
    };
    this.CustomizeScrollPosition = function (ANode, APosition, ATopPosition) {
    };
    this.HTMLReplace = function (AValue, ANodeValue) {
      var Result = "";
      var beforetag = "";
      var aftertag = "";
      var nm = "";
      var vl = "";
      var i = 0;
      var j = 0;
      Result = "";
      if (!(ANodeValue != null)) return Result;
      beforetag = "";
      while ((pas.System.Pos("<#",AValue) > 0) && (pas.System.Pos(">",AValue) > 0)) {
        i = pas.System.Pos("<#",AValue);
        beforetag = beforetag + pas.System.Copy(AValue,1,i - 1);
        aftertag = pas.System.Copy(AValue,i,AValue.length);
        j = pas.System.Pos(">",aftertag);
        nm = pas.System.Copy(aftertag,1,j - 1);
        pas.System.Delete({get: function () {
            return nm;
          }, set: function (v) {
            nm = v;
          }},1,2);
        pas.System.Delete({get: function () {
            return AValue;
          }, set: function (v) {
            AValue = v;
          }},1,(i + j) - 1);
        vl = ANodeValue.FHTMLTemplateItems.GetValue(nm);
        this.DoGetHTMLTemplateValue(ANodeValue,nm,{get: function () {
            return vl;
          }, set: function (v) {
            vl = v;
          }});
        beforetag = beforetag + vl;
      };
      Result = beforetag + AValue;
      return Result;
    };
    this.GetHTMLTemplate = function (AColumnIndex) {
      var Result = "";
      Result = "";
      return Result;
    };
    this.Assign = function (Source) {
      pas["WEBLib.TMSFNCTreeViewBase"].TTMSFNCTreeViewBase.Assign.apply(this,arguments);
      if ($mod.TTMSFNCTreeViewData.isPrototypeOf(Source)) {
        this.FColumns.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewData).FColumns);
        this.FGroups.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewData).FGroups);
        this.FNodes.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewData).FNodes);
      };
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCTreeViewBase"].TTMSFNCTreeViewBase.Create$1.apply(this,arguments);
      this.FFilter = $mod.TTMSFNCTreeViewFilter.$create("Create$3",[this]);
      this.FNodeStructure = $mod.TTMSFNCTreeViewNodeStructure.$create("Create$2");
      this.FVisibleNodes = $mod.TTMSFNCTreeViewVisibleNodes.$create("Create$1");
      this.FDisplayGroups = $mod.TTMSFNCTreeViewDisplayGroups.$create("Create$1");
      this.FNodes = this.CreateNodes();
      this.FColumns = this.CreateColumns();
      this.FGroups = this.CreateGroups();
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FFilter");
      rtl.free(this,"FDisplayGroups");
      rtl.free(this,"FNodeStructure");
      rtl.free(this,"FVisibleNodes");
      rtl.free(this,"FNodes");
      rtl.free(this,"FGroups");
      rtl.free(this,"FColumns");
      pas["WEBLib.TMSFNCTreeViewBase"].TTMSFNCTreeViewBase.Destroy.call(this);
    };
    this.IsColumnVisible = function (ACol) {
      var Result = false;
      Result = pas["WEBLib.TMSFNCTreeViewBase"].TTMSFNCTreeViewBase.IsColumnVisible.call(this,ACol);
      if ((ACol >= 0) && (ACol <= (this.FColumns.GetCount() - 1))) Result = this.FColumns.GetItem$1(ACol).FVisible;
      return Result;
    };
    this.FindColumnByName = function (AName) {
      var Result = null;
      var I = 0;
      var res = null;
      Result = null;
      for (var $l = 0, $end = this.FColumnCount - 1; $l <= $end; $l++) {
        I = $l;
        if ((I >= 0) && (I <= (this.FColumns.GetCount() - 1))) {
          res = this.FColumns.GetItem$1(I);
          if (res.FName === AName) {
            Result = res;
            break;
          };
        };
      };
      return Result;
    };
    this.FindGroupByName = function (AName) {
      var Result = null;
      var I = 0;
      var grp = null;
      Result = null;
      for (var $l = 0, $end = this.FGroups.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        grp = this.FGroups.GetItem$1(I);
        if (grp.FName === AName) {
          Result = grp;
          break;
        };
      };
      return Result;
    };
    this.FindColumnIndexByName = function (AName) {
      var Result = 0;
      var res = null;
      Result = -1;
      res = this.FindColumnByName(AName);
      if (res != null) Result = res.GetIndex();
      return Result;
    };
    this.FindGroupIndexByName = function (AName) {
      var Result = 0;
      var grp = null;
      Result = -1;
      grp = this.FindGroupByName(AName);
      if (grp != null) Result = grp.GetIndex();
      return Result;
    };
    this.BeforeExport = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.BeforeExport.call(this);
      this.ClearNodeList();
    };
    this.AfterExport = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.AfterExport.call(this);
      this.ClearNodeList();
    };
    this.ClearColumns = function () {
      this.BeginUpdate();
      this.FColumns.Clear();
      this.EndUpdate();
    };
    this.ClearNodes = function () {
      this.BeginUpdate();
      this.FNodeListBuild = false;
      this.FNodes.Clear();
      this.ClearFocusedNode(null);
      this.EndUpdate();
    };
    this.ClearNodeList = function () {
      this.BeginUpdate();
      this.FNodeListBuild = false;
      this.ClearFocusedNode(null);
      this.EndUpdate();
    };
    this.RemoveVirtualNode = function (ANode) {
      this.RemoveNodeInternal(ANode,true);
    };
    this.RemoveNode = function (ANode) {
      if (ANode != null) {
        ANode = rtl.freeLoc(ANode);
      };
    };
    this.ExpandNode = function (ANode, ARecurse) {
      if (ANode != null) this.ExpandVirtualNode(ANode.FVirtualNode,ARecurse);
    };
    this.MoveNode = function (ANode, ADestinationNode, AIndex) {
      var n = null;
      var np = null;
      if (!(ANode != null)) return;
      if (ADestinationNode !== ANode) {
        if (ADestinationNode != null) {
          np = ADestinationNode.GetParent();
          while (np != null) {
            if (np === ANode) return;
            np = np.GetParent();
          };
        };
        this.BeginUpdate();
        n = $mod.TTMSFNCTreeViewNode.$create("Create$1",[null]);
        if (ADestinationNode != null) {
          ANode.SetCollection(ADestinationNode.FNodes)}
         else ANode.SetCollection(this.FNodes);
        if (ADestinationNode != null) {
          if ((AIndex >= 0) && (AIndex <= (ADestinationNode.FNodes.GetCount() - 1))) {
            ANode.SetIndex(AIndex)}
           else ANode.SetIndex(ADestinationNode.FNodes.GetCount() - 1);
        } else {
          if ((AIndex >= 0) && (AIndex <= (this.FNodes.GetCount() - 1))) {
            ANode.SetIndex(AIndex)}
           else ANode.SetIndex(this.FNodes.GetCount() - 1);
        };
        n = rtl.freeLoc(n);
        this.EndUpdate();
      };
    };
    this.CopyNode = function (ANode, ADestinationNode, AIndex) {
      var n = null;
      var nw = null;
      if (ADestinationNode !== ANode) {
        this.BeginUpdate();
        n = $mod.TTMSFNCTreeViewNode.$create("Create$1",[null]);
        n.Assign(ANode);
        if (ADestinationNode != null) {
          nw = ADestinationNode.FNodes.Add$1()}
         else nw = this.FNodes.Add$1();
        nw.Assign(n);
        n = rtl.freeLoc(n);
        if (ADestinationNode != null) {
          if ((AIndex >= 0) && (AIndex <= (ADestinationNode.FNodes.GetCount() - 1))) nw.SetIndex(AIndex);
        } else {
          if ((AIndex >= 0) && (AIndex <= (this.FNodes.GetCount() - 1))) nw.SetIndex(AIndex);
        };
        this.EndUpdate();
      };
    };
    this.ExpandAll = function () {
      var $Self = this;
      function ExpandNodes(n) {
        var I = 0;
        for (var $l = 0, $end = n.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          n.GetItem$1(I).FExpanded = true;
          ExpandNodes(n.GetItem$1(I).FNodes);
        };
      };
      ExpandNodes(this.FNodes);
      this.ExpandAllVirtual();
    };
    this.CollapseAll = function () {
      var $Self = this;
      function CollapseNodes(n) {
        var I = 0;
        for (var $l = 0, $end = n.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          n.GetItem$1(I).FExpanded = false;
          CollapseNodes(n.GetItem$1(I).FNodes);
        };
      };
      CollapseNodes(this.FNodes);
      this.CollapseAllVirtual();
    };
    this.ExpandAllVirtual = function () {
      var I = 0;
      var v = null;
      this.FVisibleNodes.Clear();
      this.FTotalRowHeight = 1;
      this.SetRowCount(0);
      for (var $l = 0, $end = this.FNodeStructure.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        v = this.GetNodeFromNodeStructure(I);
        if ((v != null) && (((this.MatchFilter(v) || v.FAddedToVisibleList) && this.FFilterApplied) || !this.FFilterApplied)) {
          this.UpdateNodeExpanded(v,true);
          this.FVisibleNodes.Add(v);
          this.FTotalRowHeight = this.FTotalRowHeight + v.FHeight;
          this.SetRowCount(this.FRowCount + 1);
        };
      };
      this.ResetNodes(true);
      this.UpdateTreeView();
      this.Invalidate();
    };
    this.CollapseAllVirtual = function () {
      var I = 0;
      var v = null;
      this.FVisibleNodes.Clear();
      this.FTotalRowHeight = 1;
      this.SetRowCount(0);
      for (var $l = 0, $end = this.FNodeStructure.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        v = this.GetNodeFromNodeStructure(I);
        if (v != null) {
          this.UpdateNodeExpanded(v,false);
          if (v.FParentNode === -1) {
            this.FVisibleNodes.Add(v);
            this.FTotalRowHeight = this.FTotalRowHeight + v.FHeight;
            this.SetRowCount(this.FRowCount + 1);
          };
        };
      };
      this.ResetNodes(true);
      this.UpdateTreeView();
      this.Invalidate();
    };
    this.ApplyFilter = function () {
      this.FFilterApplied = true;
      this.ClearNodeList();
    };
    this.RemoveFilter = function () {
      this.FFilterApplied = false;
      this.ClearNodeList();
    };
    this.RemoveFilters = function () {
      this.FFilter.Clear();
      this.RemoveFilter();
    };
    this.CollapseNode = function (ANode, ARecurse) {
      if (ANode != null) this.CollapseVirtualNode(ANode.FVirtualNode,ARecurse);
    };
    this.ToggleVirtualNode = function (ANode, ARecurse) {
      this.ToggleNodeInternal(ANode,ARecurse);
    };
    this.ExpandVirtualNode = function (ANode, ARecurse) {
      this.ExpandNodeInternal(ANode,ARecurse);
    };
    this.CollapseVirtualNode = function (ANode, ARecurse) {
      this.CollapseNodeInternal(ANode,ARecurse);
    };
    this.CheckNode = function (ANode, AColumn, ARecurse) {
      if (ANode != null) this.CheckNodeInternal(ANode.FVirtualNode,AColumn,ARecurse);
    };
    this.UnCheckNode = function (ANode, AColumn, ARecurse) {
      if (ANode != null) this.UnCheckNodeInternal(ANode.FVirtualNode,AColumn,ARecurse);
    };
    this.ToggleCheckNode = function (ANode, AColumn, ARecurse) {
      if (ANode != null) this.ToggleCheckNodeInternal(ANode.FVirtualNode,AColumn,ARecurse);
    };
    this.CheckVirtualNode = function (ANode, AColumn, ARecurse) {
      this.CheckNodeInternal(ANode,AColumn,ARecurse);
    };
    this.UnCheckVirtualNode = function (ANode, AColumn, ARecurse) {
      this.UnCheckNodeInternal(ANode,AColumn,ARecurse);
    };
    this.ToggleCheckVirtualNode = function (ANode, AColumn, ARecurse) {
      this.ToggleCheckNodeInternal(ANode,AColumn,ARecurse);
    };
    this.SetNodeTextValues = function (ANode, ATextValues) {
      if (ANode != null) ANode.SetTextValues(rtl.arrayRef(ATextValues));
    };
    this.SetNodeCheckStates = function (ANode, ACheckStates) {
      if (ANode != null) ANode.SetCheckStates(rtl.arrayRef(ACheckStates));
    };
    this.SetNodeCheckTypes = function (ANode, ACheckTypes) {
      if (ANode != null) ANode.SetCheckTypes(rtl.arrayRef(ACheckTypes));
    };
    this.SetNodeCollapsedIcons = function (ANode, AIcons, ALarge) {
      if (ANode != null) ANode.SetCollapsedIcons(rtl.arrayRef(AIcons),ALarge);
    };
    this.SetNodeExpandedIcons = function (ANode, AIcons, ALarge) {
      if (ANode != null) ANode.SetExpandedIcons(rtl.arrayRef(AIcons),ALarge);
    };
    this.SetNodeCollapsedIconNames = function (ANode, AIconNames, ALarge) {
      if (ANode != null) ANode.SetCollapsedIconNames(rtl.arrayRef(AIconNames),ALarge);
    };
    this.SetNodeExpandedIconNames = function (ANode, AIconNames, ALarge) {
      if (ANode != null) ANode.SetExpandedIconNames(rtl.arrayRef(AIconNames),ALarge);
    };
    this.RemoveVirtualNodeChildren = function (ANode) {
      var I = 0;
      var s = null;
      if (ANode != null) {
        for (var $l = ANode.FTotalChildren - 1; $l >= 0; $l--) {
          I = $l;
          s = this.GetNodeFromNodeStructure(ANode.FRow + I);
          if (s != null) this.RemoveVirtualNode(s);
        };
      };
    };
    this.RemoveNodeChildren = function (ANode) {
      if (ANode != null) ANode.FNodes.Clear();
    };
    this.ScrollToNode = function (ANode, AScrollIfNotVisible, AScrollPosition, AForceScroll) {
      if (ANode != null) this.ScrollToVirtualNode(ANode.FVirtualNode,AScrollIfNotVisible,AScrollPosition,AForceScroll);
    };
    this.ScrollToVirtualNode = function (ANode, AScrollIfNotVisible, AScrollPosition, AForceScroll) {
      var v = 0.0;
      if (!(ANode != null)) return;
      if (this.IsVariableNodeHeight()) {
        while (!ANode.FCalculated && (ANode.FExpanded || (ANode.FChildren === 0))) {
          v = this.GetVerticalScrollPosition();
          this.ScrollToVirtualNodeInternal(ANode,AScrollIfNotVisible,AScrollPosition,AForceScroll);
          if (v === this.GetVerticalScrollPosition()) break;
        };
      };
      this.ScrollToVirtualNodeInternal(ANode,AScrollIfNotVisible,AScrollPosition,AForceScroll);
    };
    this.ScrollToVirtualNodeInternal = function (ANode, AScrollIfNotVisible, AScrollPosition, AForceScroll) {
      var I = 0;
      var yp = 0.0;
      var ps = 0.0;
      var v = null;
      yp = 0;
      if (ANode != null) {
        for (var $l = 0, $end = this.FVisibleNodes.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          v = this.FVisibleNodes.GetItem(I);
          if (v != null) {
            if (v.FRow === ANode.FRow) break;
            if (v.FCalculated) {
              yp = yp + v.FHeight}
             else yp = yp + this.GetDefaultRowHeight(v);
          };
        };
        ps = yp;
        var $tmp = AScrollPosition;
        if ($tmp === $mod.TTMSFNCTreeViewNodeScrollPosition.tvnspBottom) {
          yp = (yp - this.GetVViewPortSize()) + ANode.FHeight}
         else if ($tmp === $mod.TTMSFNCTreeViewNodeScrollPosition.tvnspMiddle) yp = (yp - (this.GetVViewPortSize() / 2)) + (ANode.FHeight / 2);
        this.CustomizeScrollPosition(ANode,{get: function () {
            return yp;
          }, set: function (v) {
            yp = v;
          }},{get: function () {
            return ps;
          }, set: function (v) {
            ps = v;
          }});
        if (AScrollIfNotVisible) {
          if ((ps < Math.abs(this.GetVScrollValue())) || ((ps + ANode.FHeight) > (Math.abs(this.GetVScrollValue()) + this.GetVViewPortSize())) || AForceScroll) this.Scroll(this.GetHScrollValue(),yp);
        } else {
          this.Scroll(this.GetHScrollValue(),yp);
        };
      };
    };
    this.ScrollToVirtualNodeRow = function (ARow, AScrollIfNotVisible, AScrollPosition, AForceScroll) {
      var n = null;
      n = this.GetNodeForRow(ARow);
      if (n != null) this.ScrollToVirtualNode(n,AScrollIfNotVisible,AScrollPosition,AForceScroll);
    };
    this.ScrollToTop = function () {
      this.VerticalScrollBar().SetPosition(0);
    };
    this.ScrollToBottom = function () {
      this.VerticalScrollBar().SetPosition(this.VerticalScrollBar().FMax);
    };
    this.GetNodeForRow = function (ARow) {
      var Result = null;
      Result = null;
      if ((ARow >= 0) && (ARow <= (this.FNodeStructure.GetCount() - 1))) Result = this.FNodeStructure.GetItem$1(ARow);
      return Result;
    };
    this.AddNode = function (AParentNode) {
      var Result = null;
      if (AParentNode != null) {
        Result = AParentNode.FNodes.Add$1()}
       else Result = this.FNodes.Add$1();
      return Result;
    };
    this.AddVirtualNode = function (AParentNode) {
      var Result = null;
      var p = null;
      var idx = 0;
      Result = null;
      if ((pas.Classes.TComponentStateItem.csDestroying in this.FComponentState) || !this.FNodeListBuild) return Result;
      if (AParentNode != null) {
        idx = AParentNode.FChildren;
      } else {
        p = null;
        if (this.FNodeStructure.GetCount() > 0) {
          p = this.GetNodeFromNodeStructure(this.FNodeStructure.GetCount() - 1);
          while ((p != null) && (p.FParentNode >= 0) && (p.FParentNode <= (this.FNodeStructure.GetCount() - 1))) p = this.GetNodeFromNodeStructure(p.FParentNode);
        };
        idx = p.FIndex + 1;
      };
      Result = this.InsertVirtualNode(idx,AParentNode);
      return Result;
    };
    this.GetParentVirtualNode = function (ANode) {
      var Result = null;
      Result = null;
      if (ANode != null) Result = this.GetNodeFromNodeStructure(ANode.FParentNode);
      return Result;
    };
    this.GetParentNode = function (ANode) {
      var Result = null;
      var v = null;
      Result = null;
      if (ANode != null) {
        v = this.GetParentVirtualNode(ANode.FVirtualNode);
        if (v != null) Result = v.FNode;
      };
      return Result;
    };
    this.GetVirtualNodeChildCount = function (ANode) {
      var Result = 0;
      Result = 0;
      if (ANode != null) Result = ANode.FChildren;
      return Result;
    };
    this.GetTotalVirtualNodeCount = function () {
      var Result = 0;
      var n = null;
      Result = 0;
      n = this.GetFirstRootVirtualNode();
      while (n != null) {
        Result = Result + n.FTotalChildren + 1;
        n = n.GetNextSibling();
      };
      return Result;
    };
    this.GetTotalNodeCount = function () {
      var Result = 0;
      Result = this.GetTotalVirtualNodeCount();
      return Result;
    };
    this.GetNodeText = function (ANode, AColumn) {
      var Result = "";
      Result = this.GetVirtualNodeText(ANode.FVirtualNode,AColumn);
      return Result;
    };
    this.GetVirtualNodeText = function (ANode, AColumn) {
      var Result = "";
      Result = "";
      if (ANode != null) {
        Result = "";
        this.DoGetNodeText(ANode,AColumn,$mod.TTMSFNCTreeViewNodeTextMode.tntmDrawing,{get: function () {
            return Result;
          }, set: function (v) {
            Result = v;
          }});
      };
      return Result;
    };
    this.GetNodeTitle = function (ANode, AColumn) {
      var Result = "";
      Result = this.GetVirtualNodeTitle(ANode.FVirtualNode,AColumn);
      return Result;
    };
    this.GetVirtualNodeTitle = function (ANode, AColumn) {
      var Result = "";
      Result = "";
      if (ANode != null) {
        Result = "";
        this.DoGetNodeTitle(ANode,AColumn,$mod.TTMSFNCTreeViewNodeTextMode.tntmDrawing,{get: function () {
            return Result;
          }, set: function (v) {
            Result = v;
          }});
      };
      return Result;
    };
    this.GetVirtualNodeTitleExpanded = function (ANode, AColumn) {
      var Result = false;
      Result = true;
      if (ANode != null) {
        Result = true;
        this.DoGetNodeTitleExpanded(ANode,AColumn,{get: function () {
            return Result;
          }, set: function (v) {
            Result = v;
          }});
      };
      return Result;
    };
    this.FindVirtualNodeByRow = function (ARow) {
      var Result = null;
      var n = null;
      Result = null;
      n = this.GetFirstRootVirtualNode();
      while (n != null) {
        if (n.FRow === ARow) {
          Result = n;
          break;
        };
        n = n.GetNext();
      };
      return Result;
    };
    this.FindNodeByRow = function (ARow) {
      var Result = null;
      var v = null;
      Result = null;
      v = this.FindVirtualNodeByRow(ARow);
      if (v != null) Result = v.FNode;
      return Result;
    };
    this.FindVirtualNodeByDBKey = function (ADBKey) {
      var Result = null;
      var n = null;
      Result = null;
      n = this.GetFirstRootVirtualNode();
      while (n != null) {
        if ((n.FNode != null) && (n.FNode.FDBKey === ADBKey)) {
          Result = n;
          break;
        };
        n = n.GetNext();
      };
      return Result;
    };
    this.FindNodeByDBKey = function (ADBKey) {
      var Result = null;
      var v = null;
      Result = null;
      v = this.FindVirtualNodeByDBKey(ADBKey);
      if (v != null) Result = v.FNode;
      return Result;
    };
    this.FindVirtualNodeByTextAndColumn = function (AText, AColumn, ARecurse, ACaseSensitive) {
      var Result = null;
      var n = null;
      var t = "";
      Result = null;
      n = this.GetFirstRootVirtualNode();
      while (n != null) {
        t = "";
        this.DoGetNodeText(n,AColumn,$mod.TTMSFNCTreeViewNodeTextMode.tntmDrawing,{get: function () {
            return t;
          }, set: function (v) {
            t = v;
          }});
        if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MatchStrEx(AText,t,ACaseSensitive)) {
          Result = n;
          break;
        };
        if (ARecurse) {
          n = n.GetNext()}
         else n = n.GetNextSibling();
      };
      return Result;
    };
    this.FindNodeByTextAndColumn = function (AText, AColumn, ARecurse, ACaseSensitive) {
      var Result = null;
      var v = null;
      Result = null;
      v = this.FindVirtualNodeByTextAndColumn(AText,AColumn,ARecurse,ACaseSensitive);
      if (v != null) Result = v.FNode;
      return Result;
    };
    this.GetNodeChildCount = function (ANode) {
      var Result = 0;
      Result = 0;
      if (ANode != null) Result = this.GetVirtualNodeChildCount(ANode.FVirtualNode);
      return Result;
    };
    this.GetPreviousNode = function (ANode) {
      var Result = null;
      var v = null;
      Result = null;
      if (ANode != null) {
        v = this.GetPreviousVirtualNode(ANode.FVirtualNode);
        if (v != null) Result = v.FNode;
      };
      return Result;
    };
    this.GetNextNode = function (ANode) {
      var Result = null;
      var v = null;
      Result = null;
      if (ANode != null) {
        v = this.GetNextVirtualNode(ANode.FVirtualNode);
        if (v != null) Result = v.FNode;
      };
      return Result;
    };
    this.GetPreviousChildNode = function (ANode, AStartNode) {
      var Result = null;
      var v = null;
      Result = null;
      if ((ANode != null) && (AStartNode != null)) {
        v = this.GetPreviousChildVirtualNode(ANode.FVirtualNode,AStartNode.FVirtualNode);
        if (v != null) Result = v.FNode;
      };
      return Result;
    };
    this.GetNextChildNode = function (ANode, AStartNode) {
      var Result = null;
      var v = null;
      Result = null;
      if ((ANode != null) && (AStartNode != null)) {
        v = this.GetNextChildVirtualNode(ANode.FVirtualNode,AStartNode.FVirtualNode);
        if (v != null) Result = v.FNode;
      };
      return Result;
    };
    this.GetNextSiblingNode = function (ANode) {
      var Result = null;
      var v = null;
      Result = null;
      if (ANode != null) {
        v = this.GetNextSiblingVirtualNode(ANode.FVirtualNode);
        if (v != null) Result = v.FNode;
      };
      return Result;
    };
    this.GetPreviousSiblingNode = function (ANode) {
      var Result = null;
      var v = null;
      Result = null;
      if (ANode != null) {
        v = this.GetPreviousSiblingVirtualNode(ANode.FVirtualNode);
        if (v != null) Result = v.FNode;
      };
      return Result;
    };
    this.GetFirstChildNode = function (ANode) {
      var Result = null;
      var v = null;
      Result = null;
      if (ANode != null) {
        v = this.GetFirstChildVirtualNode(ANode.FVirtualNode);
        if (v != null) Result = v.FNode;
      };
      return Result;
    };
    this.GetLastChildNode = function (ANode) {
      var Result = null;
      var v = null;
      Result = null;
      if (ANode != null) {
        v = this.GetLastChildVirtualNode(ANode.FVirtualNode);
        if (v != null) Result = v.FNode;
      };
      return Result;
    };
    this.GetPreviousVirtualNode = function (ANode) {
      var Result = null;
      Result = null;
      if (ANode != null) Result = this.GetNodeFromNodeStructure(ANode.FRow - 1);
      return Result;
    };
    this.GetNextVirtualNode = function (ANode) {
      var Result = null;
      Result = null;
      if (ANode != null) Result = this.GetNodeFromNodeStructure(ANode.FRow + 1);
      return Result;
    };
    this.GetPreviousChildVirtualNode = function (ANode, AStartNode) {
      var Result = null;
      Result = this.GetPreviousSiblingVirtualNode(AStartNode);
      return Result;
    };
    this.GetNextChildVirtualNode = function (ANode, AStartNode) {
      var Result = null;
      Result = this.GetNextSiblingVirtualNode(AStartNode);
      return Result;
    };
    this.GetNextSiblingVirtualNode = function (ANode) {
      var Result = null;
      var res = null;
      res = ANode;
      do {
        res = this.GetNextVirtualNode(res);
        Result = res;
      } while (!((Result === null) || ((Result != null) && (Result.FParentNode === ANode.FParentNode))));
      return Result;
    };
    this.GetPreviousSiblingVirtualNode = function (ANode) {
      var Result = null;
      var res = null;
      res = ANode;
      do {
        res = this.GetPreviousVirtualNode(res);
        Result = res;
      } while (!((Result === null) || ((Result != null) && (Result.FParentNode === ANode.FParentNode))));
      return Result;
    };
    this.GetFirstChildVirtualNode = function (ANode) {
      var Result = null;
      Result = null;
      if ((ANode != null) && (ANode.FChildren > 0)) Result = this.GetNodeFromNodeStructure(ANode.FRow + 1);
      return Result;
    };
    this.GetLastChildVirtualNode = function (ANode) {
      var Result = null;
      var v = null;
      Result = this.GetFirstChildVirtualNode(ANode);
      if (Result != null) {
        v = Result;
        do {
          Result = v;
          v = this.GetNextSiblingVirtualNode(v);
        } while (!(v === null));
      };
      return Result;
    };
    this.GetFirstRootNode = function () {
      var Result = null;
      var n = null;
      Result = null;
      n = this.GetFirstRootVirtualNode();
      if (n != null) Result = n.FNode;
      return Result;
    };
    this.GetLastRootNode = function () {
      var Result = null;
      var n = null;
      Result = null;
      n = this.GetLastRootVirtualNode();
      if (n != null) Result = n.FNode;
      return Result;
    };
    this.GetLastNode = function () {
      var Result = null;
      var n = null;
      Result = null;
      n = this.GetLastVirtualNode();
      if (n != null) Result = n.FNode;
      return Result;
    };
    this.GetFirstRootVirtualNode = function () {
      var Result = null;
      Result = null;
      if (this.FNodeStructure.GetCount() > 0) Result = this.FNodeStructure.GetItem$1(0);
      return Result;
    };
    this.GetLastRootVirtualNode = function () {
      var Result = null;
      Result = null;
      if (this.FNodeStructure.GetCount() > 0) {
        Result = this.FNodeStructure.GetItem$1(this.FNodeStructure.GetCount() - 1);
        while ((Result != null) && (Result.FParentNode > -1)) Result = this.FNodeStructure.GetItem$1(Result.FRow - 1);
      };
      return Result;
    };
    this.GetLastVirtualNode = function () {
      var Result = null;
      Result = null;
      if (this.FNodeStructure.GetCount() > 0) Result = this.FNodeStructure.GetItem$1(this.FNodeStructure.GetCount() - 1);
      return Result;
    };
    this.GetRootNodeByIndex = function (AIndex) {
      var Result = null;
      var n = null;
      Result = null;
      n = this.GetRootVirtualNodeByIndex(AIndex);
      if (n != null) Result = n.FNode;
      return Result;
    };
    this.GetRootVirtualNodeByIndex = function (AIndex) {
      var Result = null;
      var I = 0;
      Result = null;
      for (var $l = 0, $end = this.FNodeStructure.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (this.FNodeStructure.GetItem$1(I).FIndex === AIndex) {
          Result = this.FNodeStructure.GetItem$1(I);
          break;
        };
      };
      return Result;
    };
    this.InsertNode = function (AIndex, AParentNode) {
      var Result = null;
      if (AParentNode != null) {
        Result = AParentNode.FNodes.Insert$1(AIndex)}
       else Result = this.FNodes.Insert$1(AIndex);
      return Result;
    };
    this.InsertVirtualNode = function (AIndex, AParentNode) {
      var Result = null;
      var v = null;
      var p = null;
      var n = null;
      var c = null;
      var I = 0;
      var idx = 0;
      Result = null;
      if ((pas.Classes.TComponentStateItem.csDestroying in this.FComponentState) || !this.FNodeListBuild) return Result;
      v = $mod.TTMSFNCTreeViewVirtualNode.$create("Create$1",[this]);
      if (AParentNode != null) {
        idx = -1;
        I = AParentNode.FRow + 1;
        while (I <= (AParentNode.FRow + AParentNode.FTotalChildren)) {
          n = this.GetNodeFromNodeStructure(I);
          if (n != null) {
            if ((n.FIndex === AIndex) && (n.FParentNode === AParentNode.FRow)) {
              idx = n.FRow;
              break;
            };
            I = I + n.FChildren + 1;
          } else break;
        };
        if (idx === -1) {
          this.InsertNodeInternal(AParentNode,AIndex,AParentNode.FRow + AParentNode.FTotalChildren + 1,v)}
         else this.InsertNodeInternal(AParentNode,AIndex,idx,v);
      } else {
        p = null;
        if (this.FNodeStructure.GetCount() > 0) {
          p = this.GetNodeFromNodeStructure(this.FNodeStructure.GetCount() - 1);
          while ((p != null) && (p.FParentNode >= 0) && (p.FParentNode <= (this.FNodeStructure.GetCount() - 1))) p = this.GetNodeFromNodeStructure(p.FParentNode);
        };
        if (p != null) {
          if (AIndex > p.FIndex) {
            this.InsertNodeInternal(null,AIndex,p.FRow + p.FTotalChildren + 1,v)}
           else {
            n = null;
            I = 0;
            while (!(n != null)) {
              c = this.GetNodeFromNodeStructure(I);
              if (c != null) {
                if (c.FIndex === AIndex) {
                  n = c;
                  break;
                } else I = I + c.FTotalChildren + 1;
              } else break;
            };
            if (n != null) this.InsertNodeInternal(null,AIndex,n.FRow,v);
          };
        } else this.InsertNodeInternal(null,0,0,v);
      };
      Result = v;
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.TranslateTextEx = function (AText) {
    var Result = "";
    Result = AText;
    return Result;
  };
  $mod.$resourcestrings = {sTMSFNCTreeViewGroup: {org: "Group"}, sTMSFNCTreeViewColumn: {org: "Column"}};
  $mod.$implcode = function () {
    rtl.createClass($impl,"TShadowedCollection",pas.Classes.TPersistent,function () {
      this.$init = function () {
        pas.Classes.TPersistent.$init.call(this);
        this.FItemClass = null;
        this.FItems = null;
      };
      this.$final = function () {
        this.FItemClass = undefined;
        this.FItems = undefined;
        pas.Classes.TPersistent.$final.call(this);
      };
    });
  };
},["SysUtils","Math","WEBLib.TMSFNCUtils","WEBLib.Graphics"]);
rtl.module("WEBLib.TMSFNCPopup",["System","Classes","WEBLib.Controls","WEBLib.TMSFNCCustomComponent","WEBLib.TMSFNCGraphics","WEBLib.Graphics","WEBLib.TMSFNCTypes","WEBLib.TMSFNCGraphicsTypes","WEBLib.Forms","WEBLib.ExtCtrls","Types","Web"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.MAJ_VER = 1;
  this.MIN_VER = 0;
  this.REL_VER = 0;
  this.BLD_VER = 9;
  this.TTMSFNCPopupPlacement = {"0": "ppBottom", ppBottom: 0, "1": "ppTop", ppTop: 1, "2": "ppLeft", ppLeft: 2, "3": "ppRight", ppRight: 3, "4": "ppCenter", ppCenter: 4, "5": "ppBottomCenter", ppBottomCenter: 5, "6": "ppTopCenter", ppTopCenter: 6, "7": "ppLeftCenter", ppLeftCenter: 7, "8": "ppRightCenter", ppRightCenter: 8, "9": "ppAbsolute", ppAbsolute: 9, "10": "ppMouse", ppMouse: 10, "11": "ppMouseCenter", ppMouseCenter: 11, "12": "ppAboveMouse", ppAboveMouse: 12, "13": "ppAboveMouseCenter", ppAboveMouseCenter: 13};
  this.$rtti.$Enum("TTMSFNCPopupPlacement",{minvalue: 0, maxvalue: 13, ordtype: 1, enumtype: this.TTMSFNCPopupPlacement});
  this.$rtti.$MethodVar("TTMSFNCPopupPaint",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]]]), methodkind: 0});
  this.$rtti.$Class("TTMSFNCCustomPopupForm");
  this.$rtti.$ClassRef("TTMSFNCCustomPopupFormClass",{instancetype: this.$rtti["TTMSFNCCustomPopupForm"]});
  this.$rtti.$Class("TTMSFNCCustomPopup");
  rtl.createClass(this,"TCustomPaintedForm",pas["WEBLib.Forms"].TCustomForm,function () {
    this.$init = function () {
      pas["WEBLib.Forms"].TCustomForm.$init.call(this);
      this.FPaintBox = null;
    };
    this.$final = function () {
      this.FPaintBox = undefined;
      pas["WEBLib.Forms"].TCustomForm.$final.call(this);
    };
    this.GetCanvas$1 = function () {
      var Result = null;
      this.CreateCanvas();
      Result = this.FPaintBox.GetCanvas();
      return Result;
    };
    this.DoPaint = function (Sender) {
      this.Paint();
    };
    this.Paint = function () {
      pas["WEBLib.Forms"].TCustomForm.Paint.call(this);
      if (this.FOnPaint != null) this.FOnPaint(this);
    };
    this.CreateCanvas = function () {
      if (!(this.FPaintBox != null)) {
        this.FPaintBox = pas["WEBLib.ExtCtrls"].TPaintBox.$create("Create$1",[this]);
        this.FPaintBox.SetParent(this);
        this.FPaintBox.SetAlign(pas["WEBLib.Controls"].TAlign.alClient);
        this.FPaintBox.FOnPaint = rtl.createCallback(this,"DoPaint");
      };
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCCustomPopupForm",this.TCustomPaintedForm,function () {
    this.$init = function () {
      $mod.TCustomPaintedForm.$init.call(this);
      this.FPreferedDisplayIndex = 0;
      this.FHintWindow = false;
      this.FTimer = null;
      this.FFirstShow = false;
      this.FOwner$1 = null;
      this.FShowModal = false;
      this.FPlacement = 0;
      this.FRealPlacement = 0;
      this.FPlacementControl = null;
      this.FOffset = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      this.FSize = pas["WEBLib.TMSFNCTypes"].TSizeF.$new();
      this.FPlacementRectangle = null;
      this.FScreenPlacementRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FPlacementChanged = false;
      this.FDragWithParent = false;
      this.FOnBeforeClose = null;
      this.FOnBeforeShow = null;
      this.FScreenContentRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FContentPadding = null;
      this.FContentControl = null;
      this.FOnRealPlacementChanged = null;
      this.FOnPopupPaint = null;
    };
    this.$final = function () {
      this.FTimer = undefined;
      this.FOwner$1 = undefined;
      this.FPlacementControl = undefined;
      this.FOffset = undefined;
      this.FSize = undefined;
      this.FPlacementRectangle = undefined;
      this.FScreenPlacementRect = undefined;
      this.FOnBeforeClose = undefined;
      this.FOnBeforeShow = undefined;
      this.FScreenContentRect = undefined;
      this.FContentPadding = undefined;
      this.FContentControl = undefined;
      this.FOnRealPlacementChanged = undefined;
      this.FOnPopupPaint = undefined;
      $mod.TCustomPaintedForm.$final.call(this);
    };
    this.SetOffset = function (Value) {
      if ((this.FOffset.X !== Value.X) || (this.FOffset.Y !== Value.Y)) {
        this.FOffset.$assign(Value);
        this.ApplyPlacement();
      };
    };
    this.SetSize = function (Value) {
      if ((this.FSize.cx !== Value.cx) || (this.FSize.cy !== Value.cy)) {
        this.FSize.$assign(Value);
        this.ApplyPlacement();
      };
    };
    this.TimerProc = function (Sender) {
      if ((this.FVisible || this.FHintWindow) && (this.FFirstShow || this.FDragWithParent)) this.ApplyPlacement();
      if ((this.FVisible || this.FHintWindow) && this.FFirstShow) {
        this.FFirstShow = false;
      };
    };
    this.SetPlacementRectangle = function (Value) {
      this.FPlacementRectangle.Assign(Value);
    };
    this.SetPlacement = function (Value) {
      if (this.FPlacement !== Value) {
        this.FPlacement = Value;
        this.ApplyPlacement();
      };
    };
    this.SetPlacementControl = function (Value) {
      if (this.FPlacementControl !== Value) {
        if (this.FPlacementControl !== null) this.FPlacementControl.RemoveFreeNotification(this);
        this.FPlacementControl = Value;
        if (this.FPlacementControl !== null) this.FPlacementControl.FreeNotification(this);
      };
    };
    this.SetDragWithParent = function (Value) {
      this.FDragWithParent = Value;
    };
    this.SetContentPadding = function (Value) {
      this.FContentPadding.Assign(Value);
    };
    this.SetContentControl = function (Value) {
      if (this.FContentControl !== Value) {
        if (this.FContentControl !== null) this.FContentControl.RemoveFreeNotification(this);
        this.FContentControl = Value;
        if (this.FContentControl !== null) {
          this.FContentControl.FreeNotification(this);
          try {
            this.FContentControl.SetParent(this);
            this.FContentControl.SetAlign(pas["WEBLib.Controls"].TAlign.alNone);
            this.FContentControl.SetVisible(true);
          } finally {
          };
        };
      };
    };
    this.GetPopup = function () {
      var Result = null;
      Result = null;
      if ($mod.TTMSFNCCustomPopup.isPrototypeOf(this.FOwner$1)) Result = rtl.as(this.FOwner$1,$mod.TTMSFNCCustomPopup);
      return Result;
    };
    this.DoBeforeShow = function () {
      this.FHintWindow = false;
      if (this.FOnBeforeShow != null) this.FOnBeforeShow(this);
      this.FFirstShow = true;
      if (!(this.FTimer != null)) this.FTimer = pas["WEBLib.ExtCtrls"].TTimer.$create("Create$1",[this]);
      this.FTimer.SetInterval(20);
      this.FTimer.FOnTimer = rtl.createCallback(this,"TimerProc");
      this.FTimer.SetEnabled(true);
    };
    this.DoBeforeClose = function () {
      if (this.FOnBeforeClose != null) this.FOnBeforeClose(this);
    };
    this.UpdateBounds = function (LRect) {
      this.SetBounds(Math.round(LRect.Left),Math.round(LRect.Top),Math.round(LRect.Right - LRect.Left),Math.round(LRect.Bottom - LRect.Top));
    };
    this.DoClose = function (CloseAction) {
      CloseAction.set(pas["WEBLib.Forms"].TCloseAction.caFree);
      pas["WEBLib.Forms"].TCustomForm.DoClose.apply(this,arguments);
      if (CloseAction.get() !== pas["WEBLib.Forms"].TCloseAction.caNone) {
        if (this.FTimer != null) this.FTimer.SetEnabled(false);
      };
    };
    this.DoApplyPlacement = function () {
      var $Self = this;
      var Pos = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var pt = pas.Types.TPoint.$new();
      var AbsolutePos = pas.Types.TPoint.$new();
      var LRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var LPlacement = 0;
      var LOffset = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var LStep = 0;
      var LSoGood = false;
      var SourceSize = pas["WEBLib.TMSFNCTypes"].TSizeF.$new();
      var PlacementByTarget = false;
      function UpdateRectByScreen(R, cs) {
        var Result = false;
        var WorkareaRect = pas.Types.TRect.$new();
        var WorkareaRectF = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
        var W = 0.0;
        var H = 0.0;
        var P = pas.Types.TPoint.$new();
        Result = true;
        R.Left = Math.round(R.Left);
        R.Top = Math.round(R.Top);
        R.Right = Math.round(R.Right);
        R.Bottom = Math.round(R.Bottom);
        WorkareaRect.Left = 0;
        WorkareaRect.Top = 0;
        WorkareaRect.Right = pas["WEBLib.Forms"].WinWidth();
        WorkareaRect.Bottom = pas["WEBLib.Forms"].WinHeight();
        WorkareaRectF.$assign(pas["WEBLib.TMSFNCTypes"].RectF(WorkareaRect.Left - $Self.FContentPadding.FLeft,WorkareaRect.Top - $Self.FContentPadding.FTop,WorkareaRect.Right + $Self.FContentPadding.FRight,WorkareaRect.Bottom + $Self.FContentPadding.FBottom));
        if (!(pas.Classes.TComponentStateItem.csDesigning in cs)) {
          W = R.Right - R.Left;
          H = R.Bottom - R.Top;
          if (R.Left > WorkareaRectF.Left) {
            if (R.Left > (WorkareaRectF.Right - W)) {
              R.Left = WorkareaRectF.Right - W;
              if (LPlacement === $mod.TTMSFNCPopupPlacement.ppRight) {
                LPlacement = $mod.TTMSFNCPopupPlacement.ppLeft;
                Result = false;
              };
              if (LPlacement === $mod.TTMSFNCPopupPlacement.ppRightCenter) {
                LPlacement = $mod.TTMSFNCPopupPlacement.ppLeftCenter;
                Result = false;
              };
            };
          } else {
            R.Left = WorkareaRectF.Left;
            if (LPlacement === $mod.TTMSFNCPopupPlacement.ppLeft) {
              LPlacement = $mod.TTMSFNCPopupPlacement.ppRight;
              Result = false;
            };
            if (LPlacement === $mod.TTMSFNCPopupPlacement.ppLeftCenter) {
              LPlacement = $mod.TTMSFNCPopupPlacement.ppRightCenter;
              Result = false;
            };
          };
          if (R.Top > WorkareaRectF.Top) {
            if (R.Top > (WorkareaRectF.Bottom - H)) {
              R.Top = WorkareaRectF.Bottom - H;
              if (LPlacement === $mod.TTMSFNCPopupPlacement.ppBottom) {
                LPlacement = $mod.TTMSFNCPopupPlacement.ppTop;
                Result = false;
              };
              if (LPlacement === $mod.TTMSFNCPopupPlacement.ppBottomCenter) {
                LPlacement = $mod.TTMSFNCPopupPlacement.ppTopCenter;
                Result = false;
              };
            };
          } else {
            R.Top = WorkareaRectF.Top;
            if (LPlacement === $mod.TTMSFNCPopupPlacement.ppTop) {
              LPlacement = $mod.TTMSFNCPopupPlacement.ppBottom;
              Result = false;
            };
            if (LPlacement === $mod.TTMSFNCPopupPlacement.ppTopCenter) {
              LPlacement = $mod.TTMSFNCPopupPlacement.ppBottomCenter;
              Result = false;
            };
          };
          R.Right = R.Left + W;
          R.Bottom = R.Top + H;
        };
        return Result;
      };
      this.FPlacementChanged = false;
      LOffset.$assign(this.FOffset);
      LPlacement = this.FPlacement;
      LStep = 0;
      do {
        LRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.FPlacementRectangle.FLeft,this.FPlacementRectangle.FTop,this.FPlacementRectangle.FRight,this.FPlacementRectangle.FBottom));
        if ((this.FPlacementControl !== null) && this.FPlacementRectangle.Empty()) LRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,this.FPlacementControl.GetWidth(),this.FPlacementControl.GetHeight()));
        if ((this.FPlacementControl === null) && this.FPlacementRectangle.Empty() && !(LPlacement in rtl.createSet($mod.TTMSFNCPopupPlacement.ppAbsolute,$mod.TTMSFNCPopupPlacement.ppMouse,$mod.TTMSFNCPopupPlacement.ppMouseCenter,$mod.TTMSFNCPopupPlacement.ppAboveMouse,$mod.TTMSFNCPopupPlacement.ppAboveMouseCenter))) ;
        this.FScreenPlacementRect.$assign(LRect);
        if (LPlacement in rtl.createSet($mod.TTMSFNCPopupPlacement.ppTop,$mod.TTMSFNCPopupPlacement.ppTopCenter)) {
          pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(LRect,0,this.FContentPadding.FBottom - LOffset.Y)}
         else pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(LRect,0,LOffset.Y - this.FContentPadding.FTop);
        if (LPlacement in rtl.createSet($mod.TTMSFNCPopupPlacement.ppLeft,$mod.TTMSFNCPopupPlacement.ppLeftCenter)) {
          pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(LRect,this.FContentPadding.FRight - LOffset.X,0)}
         else pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(LRect,LOffset.X - this.FContentPadding.FLeft,0);
        PlacementByTarget = !(LPlacement in rtl.createSet($mod.TTMSFNCPopupPlacement.ppAbsolute,$mod.TTMSFNCPopupPlacement.ppMouse,$mod.TTMSFNCPopupPlacement.ppMouseCenter,$mod.TTMSFNCPopupPlacement.ppAboveMouse,$mod.TTMSFNCPopupPlacement.ppAboveMouseCenter));
        SourceSize.$assign(this.FSize);
        var $tmp = LPlacement;
        if ($tmp === $mod.TTMSFNCPopupPlacement.ppBottom) {
          pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(LRect,0,LRect.Bottom - LRect.Top)}
         else if ($tmp === $mod.TTMSFNCPopupPlacement.ppTop) {
          pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(LRect,0,-SourceSize.cy)}
         else if ($tmp === $mod.TTMSFNCPopupPlacement.ppLeft) {
          pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(LRect,-SourceSize.cx,0)}
         else if ($tmp === $mod.TTMSFNCPopupPlacement.ppRight) {
          pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(LRect,LRect.Right - LRect.Left,0)}
         else if ($tmp === $mod.TTMSFNCPopupPlacement.ppCenter) {
          pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(LRect,(LRect.Right - LRect.Left - SourceSize.cx) / 2,(LRect.Bottom - LRect.Top - SourceSize.cy) / 2)}
         else if ($tmp === $mod.TTMSFNCPopupPlacement.ppBottomCenter) {
          pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(LRect,(LRect.Right - LRect.Left - SourceSize.cx) / 2,LRect.Bottom - LRect.Top)}
         else if ($tmp === $mod.TTMSFNCPopupPlacement.ppTopCenter) {
          pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(LRect,(LRect.Right - LRect.Left - SourceSize.cx) / 2,-SourceSize.cy)}
         else if ($tmp === $mod.TTMSFNCPopupPlacement.ppLeftCenter) {
          pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(LRect,-SourceSize.cx,(LRect.Bottom - LRect.Top - SourceSize.cy) / 2)}
         else if ($tmp === $mod.TTMSFNCPopupPlacement.ppRightCenter) {
          pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(LRect,LRect.Right - LRect.Left,(LRect.Bottom - LRect.Top - SourceSize.cy) / 2)}
         else if ($tmp === $mod.TTMSFNCPopupPlacement.ppAbsolute) {
          if (this.FPlacementRectangle.Empty()) {
            LRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.FPlacementRectangle.GetRect().Left,this.FPlacementRectangle.GetRect().Top,this.FPlacementRectangle.GetRect().Left + SourceSize.cx,this.FPlacementRectangle.GetRect().Top + SourceSize.cy))}
           else LRect.$assign(this.FPlacementRectangle.GetRect());
        } else if (($tmp === $mod.TTMSFNCPopupPlacement.ppMouse) || ($tmp === $mod.TTMSFNCPopupPlacement.ppMouseCenter) || ($tmp === $mod.TTMSFNCPopupPlacement.ppAboveMouse) || ($tmp === $mod.TTMSFNCPopupPlacement.ppAboveMouseCenter)) {
          Pos.$assign(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetMousePos());
          LRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Pos.X,Pos.Y,Pos.X + SourceSize.cx,Pos.Y + SourceSize.cy));
          if (LPlacement === $mod.TTMSFNCPopupPlacement.ppMouseCenter) pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(LRect,-SourceSize.cx / 2,-SourceSize.cy / 2);
          if (LPlacement === $mod.TTMSFNCPopupPlacement.ppAboveMouseCenter) pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(LRect,-SourceSize.cx / 2,-SourceSize.cy - 5);
          if (LPlacement === $mod.TTMSFNCPopupPlacement.ppAboveMouse) pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(LRect,0,-SourceSize.cy - 5);
        };
        if (PlacementByTarget) {
          AbsolutePos.$assign(pas.Types.Point(Math.round(LRect.Left),Math.round(LRect.Top)));
          if (this.FPlacementControl !== null) {
            AbsolutePos.$assign(this.FPlacementControl.ClientToScreen(AbsolutePos));
            pt.$assign(pas.Types.Point(Math.round(this.FScreenPlacementRect.Left),Math.round(this.FScreenPlacementRect.Top)));
            pt.$assign(this.FPlacementControl.ClientToScreen(pt));
            this.FScreenPlacementRect.Left = pt.x;
            this.FScreenPlacementRect.Top = pt.y;
            pt.$assign(pas.Types.Point(Math.round(this.FScreenPlacementRect.Right),Math.round(this.FScreenPlacementRect.Bottom)));
            pt.$assign(this.FPlacementControl.ClientToScreen(pt));
            this.FScreenPlacementRect.Right = pt.x;
            this.FScreenPlacementRect.Bottom = pt.y;
          };
          LRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(AbsolutePos.x,AbsolutePos.y,AbsolutePos.x + this.FSize.cx,AbsolutePos.y + this.FSize.cy));
        };
        LSoGood = UpdateRectByScreen(LRect,rtl.refSet(this.FComponentState));
        LStep += 1;
      } while (!(LSoGood || (LStep > 1)));
      this.FScreenContentRect.$assign(LRect);
      this.FScreenContentRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.FScreenContentRect.Left + this.FContentPadding.FLeft,this.FScreenContentRect.Top + this.FContentPadding.FTop,this.FScreenContentRect.Right - this.FContentPadding.FRight,this.FScreenContentRect.Bottom - this.FContentPadding.FBottom));
      this.FRealPlacement = LPlacement;
      this.UpdateBounds(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(LRect));
    };
    this.Loaded = function () {
      pas["WEBLib.Forms"].TCustomForm.Loaded.call(this);
      if (this.FPlacementChanged) this.ApplyPlacement();
    };
    this.Updated = function () {
      pas.Classes.TComponent.Updated.call(this);
      if (this.FPlacementChanged) this.ApplyPlacement();
    };
    this.HandleFocusedControl = function () {
      if (this.GetPopup() != null) this.GetPopup().HandleFocusedControl();
    };
    this.GetPopupParent = function () {
      var Result = null;
      Result = null;
      if ((this.FOwner$1 != null) && $mod.TTMSFNCCustomPopup.isPrototypeOf(this.FOwner$1)) Result = rtl.as(this.FOwner$1,$mod.TTMSFNCCustomPopup).GetParent();
      return Result;
    };
    this.Notification = function (AComponent, Operation) {
      pas.Classes.TComponent.Notification.apply(this,arguments);
      if (Operation === pas.Classes.TOperation.opRemove) {
        if (AComponent === this.FPlacementControl) {
          this.FPlacementControl = null;
          this.ApplyPlacement();
        };
        if (AComponent === this.FContentControl) this.FContentControl = null;
      };
    };
    this.DoRealPlacementChanged = function () {
      if (this.FOnRealPlacementChanged != null) this.FOnRealPlacementChanged(this);
    };
    this.CreateNew = function (AOwner, Dummy) {
      var $Self = this;
      function FindUniqueFormName(Name) {
        var Result = "";
        var I = 0;
        I = 0;
        Result = Name;
        while ((pas["WEBLib.Controls"].FindGlobalComponent(Result) !== null) || ((AOwner !== null) && (AOwner.FindComponent(Result) !== null))) {
          I += 1;
          Result = pas.SysUtils.Format("%s_%d",pas.System.VarRecs(18,Name,0,I));
        };
        return Result;
      };
      this.SetName(FindUniqueFormName("CustomPopupForm"));
      pas["WEBLib.Forms"].TCustomForm.CreateNew.apply(this,arguments);
      this.FPreferedDisplayIndex = -1;
      this.FOwner$1 = AOwner;
      this.FDragWithParent = true;
      this.FPlacementRectangle = pas["WEBLib.TMSFNCTypes"].TTMSFNCMargins.$create("Create$1");
      this.FContentPadding = pas["WEBLib.TMSFNCTypes"].TTMSFNCMargins.$create("Create$1");
      this.FSize.cx = 320;
      this.FSize.cy = 200;
      this.FPlacement = $mod.TTMSFNCPopupPlacement.ppBottom;
      this.FRealPlacement = this.FPlacement;
      this.SetVisible(false);
      try {
        this.SetBorder(pas["WEBLib.Forms"].TFormBorderStyle.fbNone);
        this.SetPosition(pas["WEBLib.Forms"].TPosition.poDesigned);
      } finally {
      };
      return this;
    };
    this.Create$8 = function (AOwner, APlacementControl) {
      this.CreateNew(AOwner,0);
      try {
        if (APlacementControl !== null) this.FPlacementControl = APlacementControl;
        if (this.FPlacementControl !== null) this.FPlacementControl.FreeNotification(this);
      } finally {
      };
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FTimer;
        }, set: function (v) {
          this.p.FTimer = v;
        }});
      if (this.FPlacementControl !== null) {
        this.FPlacementControl.RemoveFreeNotification(this);
        this.FPlacementControl = null;
      };
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FContentPadding;
        }, set: function (v) {
          this.p.FContentPadding = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FPlacementRectangle;
        }, set: function (v) {
          this.p.FPlacementRectangle = v;
        }});
      pas["WEBLib.Forms"].TCustomForm.Destroy.call(this);
    };
    this.ApplyPlacement = function () {
      var OldRect = pas.Types.TRect.$new();
      var NewRect = pas.Types.TRect.$new();
      var OldRealPlacement = 0;
      OldRect.$assign(pas.Types.Rect(this.GetLeft(),this.GetTop(),this.GetLeft() + this.GetWidth(),this.GetTop() + this.GetHeight()));
      OldRealPlacement = this.FRealPlacement;
      this.DoApplyPlacement();
      NewRect.$assign(pas.Types.Rect(this.GetLeft(),this.GetTop(),this.GetLeft() + this.GetWidth(),this.GetTop() + this.GetHeight()));
      if ((NewRect.Left !== OldRect.Left) || (NewRect.Top !== OldRect.Top) || (NewRect.Bottom !== OldRect.Bottom) || (NewRect.Right !== OldRect.Right) || (OldRealPlacement !== this.FRealPlacement)) this.DoRealPlacementChanged();
    };
    this.KeyDown = function (Key, Shift) {
      pas["WEBLib.Controls"].TControl.KeyDown.apply(this,arguments);
      if (rtl.neSet(Shift,{})) return;
      var $tmp = Key.get();
      if (($tmp === 27) || ($tmp === 115)) this.Close();
    };
    this.CloseQuery = function () {
      var Result = false;
      Result = pas["WEBLib.Forms"].TCustomForm.CloseQuery.call(this);
      if (Result && !(pas.Classes.TComponentStateItem.csDestroying in this.FComponentState)) this.DoBeforeClose();
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCCustomPopup",pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.$init.call(this);
      this.FCloseTime = 0;
      this.FCheckTime = false;
      this.FDestroyingPopup = false;
      this.FOwner$1 = null;
      this.FCustomOwner = null;
      this.FPlacementControl = null;
      this.FPopupForm = null;
      this.FStaysOpen = false;
      this.FPlacement = 0;
      this.FPlacementRectangle = null;
      this.FHorizontalOffset = 0.0;
      this.FVerticalOffset = 0.0;
      this.FDragWithParent = false;
      this.FModalResult = 0;
      this.FModal = false;
      this.FOnClosePopup = null;
      this.FOnPopup = null;
      this.FPopupFormSize = pas["WEBLib.TMSFNCTypes"].TSizeF.$new();
      this.FContentControl = null;
      this.FDropDownHeight = 0.0;
      this.FDropDownWidth = 0.0;
      this.FFocusable = false;
      this.FFocusedControl = null;
      this.FOnPopupPaint = null;
      this.FOnPopupShown = null;
      this.FIsOpen = false;
      this.FFillColor = 0;
      this.FStrokeColor = 0;
      this.FTransparent = false;
    };
    this.$final = function () {
      this.FOwner$1 = undefined;
      this.FCustomOwner = undefined;
      this.FPlacementControl = undefined;
      this.FPopupForm = undefined;
      this.FPlacementRectangle = undefined;
      this.FOnClosePopup = undefined;
      this.FOnPopup = undefined;
      this.FPopupFormSize = undefined;
      this.FContentControl = undefined;
      this.FFocusedControl = undefined;
      this.FOnPopupPaint = undefined;
      this.FOnPopupShown = undefined;
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.$final.call(this);
    };
    this.SetIsOpen = function (Value) {
      var b = false;
      if (this.FIsOpen !== Value) {
        b = false;
        b = (pas["WEBLib.Forms"].VSIDE != null);
        if (!b && (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState)) {
          this.FIsOpen = false;
          return;
        };
        if (Value) {
          this.DoCreatePopup(false)}
         else {
          if (this.HasPopupForm()) {
            this.FPopupForm.Close()}
           else this.FIsOpen = Value;
        };
      };
    };
    this.SetPlacementRectangle = function (Value) {
      this.FPlacementRectangle.Assign(Value);
    };
    this.SetModalResult = function (Value) {
      this.FModalResult = Value;
      if (this.FPopupForm != null) this.FPopupForm.SetModalResult(this.FModalResult);
    };
    this.SetPlacementControl = function (Value) {
      if (this.FPlacementControl !== Value) {
        if (this.FPlacementControl !== null) this.FPlacementControl.RemoveFreeNotification(this);
        this.FPlacementControl = Value;
        if (this.HasPopupForm()) this.FPopupForm.SetPlacementControl(this.FPlacementControl);
        if (this.FPlacementControl !== null) this.FPlacementControl.FreeNotification(this);
      };
    };
    this.SetPlacement = function (Value) {
      if (this.FPlacement !== Value) {
        this.FPlacement = Value;
        if (this.HasPopupForm()) this.FPopupForm.SetPlacement(this.FPlacement);
      };
    };
    this.SetDragWithParent = function (Value) {
      if (this.FDragWithParent !== Value) {
        this.FDragWithParent = Value;
        if (this.HasPopupForm()) this.FPopupForm.SetDragWithParent(this.FDragWithParent);
      };
    };
    this.BeforeShowProc = function (Sender) {
      this.FIsOpen = true;
      this.DoPopup();
    };
    this.BeforeCloseProc = function (Sender) {
      this.FIsOpen = false;
    };
    this.CloseProc = function (Sender, CloseAction) {
      this.ClosePopup();
    };
    this.ShowProc = function (Sender) {
      if ((this.FPopupForm != null) && this.FPopupForm.FShowModal) this.HandleFocusedControl();
      this.DoPopupShown();
    };
    this.DeactivateProc = function (Sender) {
      if (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState) return;
      if ((this.FPopupForm != null) && !this.FPopupForm.FShowModal && !this.FStaysOpen) {
        this.FPopupForm.SetVisible(false);
        this.FPopupForm.Close();
        this.FCloseTime = $impl.GetTickCountX();
        this.FCheckTime = true;
      };
    };
    this.SetPopupFormSize = function (Value) {
      if ((this.FPopupFormSize.cx !== Value.cx) || (this.FPopupFormSize.cy !== Value.cy)) {
        this.FPopupFormSize.$assign(Value);
        this.UpdatePopupSize();
      };
    };
    this.UpdatePopupSize = function () {
      var LSize = pas["WEBLib.TMSFNCTypes"].TSizeF.$new();
      if (this.FPopupForm !== null) {
        if (this.FPopupFormSize.cx > 0) {
          LSize.cx = this.FPopupFormSize.cx}
         else LSize.cx = this.FDropDownWidth;
        if (this.FPopupFormSize.cy > 0) {
          LSize.cy = this.FPopupFormSize.cy}
         else LSize.cy = this.FDropDownHeight;
        this.FPopupForm.SetSize(LSize);
      };
    };
    this.SetContentControl = function (Value) {
      if (Value === null) {
        if (this.FContentControl != null) this.FContentControl.SetVisible(true);
      };
      this.FContentControl = Value;
      if (this.FContentControl != null) {
        this.FContentControl.SetVisible(false);
        this.SetDropDownWidth(this.FContentControl.GetWidth());
        this.SetDropDownHeight(this.FContentControl.GetHeight());
      };
    };
    this.SetDropDownHeight = function (Value) {
      if (this.FDropDownHeight !== Value) {
        this.FDropDownHeight = Value;
        if (this.FPopupForm != null) this.FPopupForm.SetHeight(Math.round(Value));
      };
    };
    this.SetDropDownWidth = function (Value) {
      if (this.FDropDownWidth !== Value) {
        this.FDropDownWidth = Value;
        if (this.FPopupForm != null) this.FPopupForm.SetWidth(Math.round(Value));
      };
    };
    this.GetInstance = function () {
      var Result = 0;
      Result = pas["WEBLib.TMSFNCTypes"].HInstance();
      return Result;
    };
    this.GetDocURL = function () {
      var Result = "";
      Result = "https://download.tmssoftware.com/doc/tmsfncuipack/components/ttmsfncpopup";
      return Result;
    };
    this.GetVersion = function () {
      var Result = "";
      Result = this.$class.GetVersionNumber(1,0,0,9);
      return Result;
    };
    this.SetAdaptToStyle = function (Value) {
      var ia = null;
      var $ir = rtl.createIntfRefs();
      try {
        pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.SetAdaptToStyle.apply(this,arguments);
        if (this.FContentControl != null) {
          if (pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(this.FContentControl,pas.System.IUnknown)),rtl.getIntfGUIDR(pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle),{get: function () {
              return ia;
            }, set: function (v) {
              ia = v;
            }})) ia.SetAdaptToStyle(this.FAdaptToStyle);
        };
      } finally {
        $ir.free();
        rtl._Release(ia);
      };
    };
    this.ShowPopup = function (AModal) {
      if (AModal) {
        this.FModalResult = this.FPopupForm.ShowModal()}
       else {
        this.FPopupForm.Show$1();
        this.HandleFocusedControl();
      };
    };
    this.HandleFocusedControl = function () {
      var frm = null;
      if ((this.FPopupForm != null) && (this.FFocusedControl != null)) {
        if (!this.FPopupForm.FShowModal) {
          frm = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetParentForm(this.FFocusedControl);
          if ((frm != null) && (frm !== this.FPopupForm)) {
            frm.SetFocus();
          };
        };
        if (pas["WEBLib.Controls"].TControl.isPrototypeOf(this.FFocusedControl)) {
          if (rtl.as(this.FFocusedControl,pas["WEBLib.Controls"].TControl).CanFocus()) rtl.as(this.FFocusedControl,pas["WEBLib.Controls"].TControl).SetFocus();
        };
      };
    };
    this.FormPaint = function (Sender) {
      var g = null;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var fc = 0;
      var sc = 0;
      if (this.FPopupForm != null) {
        g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("Create$1",[this.FPopupForm.GetCanvas$1(),false]);
        try {
          if (g.BeginScene()) {
            if (this.FTransparent) {
              fc = 0xFFFFFE;
              sc = 0xFFFFFE;
            } else {
              fc = this.FFillColor;
              sc = this.FStrokeColor;
            };
            g.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
            g.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
            if (fc !== -1) {
              g.FFill.SetColor(fc)}
             else g.FFill.SetColor(pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultPopupFillColor);
            if (sc !== -1) {
              g.FStroke.SetColor(sc)}
             else g.FStroke.SetColor(pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultPopupStrokeColor);
            r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,this.FPopupForm.GetWidth(),this.FPopupForm.GetHeight()));
            g.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
            if (this.FOnPopupPaint != null) this.FOnPopupPaint(this,g,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r));
            g.EndScene();
          };
        } finally {
          g = rtl.freeLoc(g);
        };
      };
    };
    this.DoPopupPaint = function (Sender, AGraphics, ARect) {
      if (this.FOnPopupPaint != null) this.FOnPopupPaint(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect));
    };
    this.Notification = function (AComponent, Operation) {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.Notification.apply(this,arguments);
      if (Operation === pas.Classes.TOperation.opRemove) {
        if (AComponent === this.FContentControl) this.FContentControl = null;
        if (AComponent === this.FFocusedControl) this.FFocusedControl = null;
        if (AComponent === this.FPopupForm) this.FPopupForm = null;
        if (AComponent === this.FPlacementControl) {
          this.FPlacementControl = null;
          if (this.HasPopupForm()) this.FPopupForm.SetPlacementControl(null);
        };
      };
    };
    this.MChanged = function (Sender) {
      if (this.FPopupForm !== null) this.FPopupForm.SetPlacementRectangle(this.FPlacementRectangle);
    };
    this.DoClosePopup = function () {
      if (this.FOnClosePopup != null) this.FOnClosePopup(this);
    };
    this.DoPopup = function () {
      if (this.FOnPopup != null) this.FOnPopup(this);
    };
    this.DoPopupShown = function () {
      if (this.FOnPopupShown != null) this.FOnPopupShown(this);
    };
    this.ClosePopup = function () {
      var p = null;
      if (!this.HasPopupForm() || this.FDestroyingPopup) return;
      this.FDestroyingPopup = true;
      if (this.FModal && (this.FModalResult === 0)) {
        this.SetModalResult(2);
        return;
      };
      this.FIsOpen = false;
      if (this.FContentControl != null) {
        p = this.GetParent();
        this.FContentControl.SetVisible(false);
        if ((p != null) && pas["WEBLib.Controls"].TWinControl.isPrototypeOf(p)) {
          this.FContentControl.SetParent(rtl.as(p,pas["WEBLib.Controls"].TWinControl))}
         else this.FContentControl.SetParent(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetParentForm(this));
      };
      if (!(pas.Classes.TComponentStateItem.csDestroying in this.FComponentState)) {
        if (this.HasPopupForm()) {
          if ($mod.TTMSFNCNonFocusablePopup.isPrototypeOf(this)) rtl.free(this,"FPopupForm");
          this.DoClosePopup();
          this.FPopupForm = null;
        };
      };
      this.FDestroyingPopup = false;
    };
    this.DoCreatePopup = function (AShowModal) {
      var ia = null;
      var $ir = rtl.createIntfRefs();
      try {
        if ((($impl.GetTickCountX() - this.FCloseTime) < 200) && this.FCheckTime) {
          this.FCheckTime = false;
          return;
        };
        if (this.FIsOpen) return;
        if (this.HasPopupForm()) this.FPopupForm.Close();
        this.FPopupForm = this.CreatePopupForm();
        try {
          try {
            this.FPopupForm.SetFormStyle(pas["WEBLib.Forms"].TFormStyle.fsStayOnTop);
            this.FPopupForm.FOnPaint = rtl.createCallback(this,"FormPaint");
            this.FPopupForm.FOnPopupPaint = rtl.createCallback(this,"DoPopupPaint");
            this.FPopupForm.FreeNotification(this);
            this.FPopupForm.SetPlacement(this.FPlacement);
            this.FPopupForm.SetOffset(pas["WEBLib.TMSFNCTypes"].PointF(this.FHorizontalOffset,this.FVerticalOffset));
            this.FPopupForm.SetPlacementRectangle(this.FPlacementRectangle);
            this.FPopupForm.SetDragWithParent(this.FDragWithParent);
            this.UpdatePopupSize();
            this.FPopupForm.FOnDeactivate = rtl.createCallback(this,"DeactivateProc");
            this.FPopupForm.FOnBeforeShow = rtl.createCallback(this,"BeforeShowProc");
            this.FPopupForm.FOnBeforeClose = rtl.createCallback(this,"BeforeCloseProc");
            this.FPopupForm.FOnClose = rtl.createCallback(this,"CloseProc");
            this.FPopupForm.FOnShow = rtl.createCallback(this,"ShowProc");
            this.FPopupForm.FShowModal = AShowModal;
            this.FPopupForm.SetContentControl(this.FContentControl);
            if (pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(this.FContentControl,pas.System.IUnknown)),rtl.getIntfGUIDR(pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle),{get: function () {
                return ia;
              }, set: function (v) {
                ia = v;
              }})) ia.SetAdaptToStyle(this.FAdaptToStyle);
            if (this.FContentControl != null) this.FContentControl.SetAlign(pas["WEBLib.Controls"].TAlign.alClient);
          } finally {
          };
        } catch ($e) {
          pas.SysUtils.FreeAndNil({p: this, get: function () {
              return this.p.FPopupForm;
            }, set: function (v) {
              this.p.FPopupForm = v;
            }});
          throw $e;
        };
        if (!(pas.Classes.TComponentStateItem.csDestroying in this.FComponentState)) this.FPopupForm.DoBeforeShow();
        this.ShowPopup(AShowModal);
        if (this.FOnPopupPaint != null) this.FPopupForm.Paint();
      } finally {
        $ir.free();
        rtl._Release(ia);
      };
    };
    this.DestroyPopupForm = function () {
      if (this.FPopupForm != null) rtl.free(this,"FPopupForm");
    };
    this.GetPopupFormClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCCustomPopupForm;
      return Result;
    };
    this.GetParent = function () {
      var Result = null;
      Result = this.FPlacementControl;
      if (!(Result != null) && pas["WEBLib.Controls"].TControl.isPrototypeOf(this.FOwner$1)) Result = rtl.as(this.FOwner$1,pas["WEBLib.Controls"].TControl);
      return Result;
    };
    this.CreatePopupForm = function () {
      var Result = null;
      var NewForm = null;
      var cls = null;
      NewForm = null;
      try {
        cls = this.GetPopupFormClass();
        NewForm = cls.$create("Create$8",[this,this.FPlacementControl]);
      } catch ($e) {
        pas.SysUtils.FreeAndNil({get: function () {
            return NewForm;
          }, set: function (v) {
            NewForm = v;
          }});
        throw $e;
      };
      Result = NewForm;
      return Result;
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.Create$1.call(this,AOwner);
      this.FOwner$1 = AOwner;
      this.FPlacement = $mod.TTMSFNCPopupPlacement.ppBottom;
      this.FFocusable = true;
      this.FStaysOpen = false;
      this.FPlacementRectangle = pas["WEBLib.TMSFNCTypes"].TTMSFNCMargins.$create("Create$1");
      this.FPlacementRectangle.FOnChange = rtl.createCallback(this,"MChanged");
      this.FFillColor = -1;
      this.FStrokeColor = -1;
      this.FTransparent = false;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCCustomPopup.isPrototypeOf(Source)) {
        this.FModalResult = rtl.as(Source,$mod.TTMSFNCCustomPopup).FModalResult;
        this.FPopupFormSize.$assign(rtl.as(Source,$mod.TTMSFNCCustomPopup).FPopupFormSize);
        this.FDragWithParent = rtl.as(Source,$mod.TTMSFNCCustomPopup).FDragWithParent;
        this.FStaysOpen = rtl.as(Source,$mod.TTMSFNCCustomPopup).FStaysOpen;
        this.FDropDownHeight = rtl.as(Source,$mod.TTMSFNCCustomPopup).FDropDownHeight;
        this.FDropDownWidth = rtl.as(Source,$mod.TTMSFNCCustomPopup).FDropDownWidth;
        this.FHorizontalOffset = rtl.as(Source,$mod.TTMSFNCCustomPopup).FHorizontalOffset;
        this.FPlacementControl = rtl.as(Source,$mod.TTMSFNCCustomPopup).FPlacementControl;
        this.FPlacement = rtl.as(Source,$mod.TTMSFNCCustomPopup).FPlacement;
        this.FPlacementRectangle.Assign(rtl.as(Source,$mod.TTMSFNCCustomPopup).FPlacementRectangle);
        this.FVerticalOffset = rtl.as(Source,$mod.TTMSFNCCustomPopup).FVerticalOffset;
        this.FFocusedControl = rtl.as(Source,$mod.TTMSFNCCustomPopup).FFocusedControl;
        this.FContentControl = rtl.as(Source,$mod.TTMSFNCCustomPopup).FContentControl;
      };
    };
    this.Destroy = function () {
      this.FContentControl = null;
      this.ClosePopup();
      if (this.HasPopupForm()) {
        pas.SysUtils.FreeAndNil({p: this, get: function () {
            return this.p.FPopupForm;
          }, set: function (v) {
            this.p.FPopupForm = v;
          }});
      };
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FPlacementRectangle;
        }, set: function (v) {
          this.p.FPlacementRectangle = v;
        }});
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.HasPopupForm = function () {
      var Result = false;
      Result = this.FPopupForm !== null;
      return Result;
    };
    this.PointInPopup = function (APoint) {
      var Result = false;
      Result = false;
      if (this.FPopupForm != null) Result = pas["WEBLib.TMSFNCTypes"].PtInRectEx(pas["WEBLib.TMSFNCTypes"].RectF(this.FPopupForm.GetLeft(),this.FPopupForm.GetTop(),this.FPopupForm.GetLeft() + this.FPopupForm.GetWidth(),this.FPopupForm.GetTop() + this.FPopupForm.GetHeight()),APoint);
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCPopup",this.TTMSFNCCustomPopup,function () {
    this.RegisterRuntimeClasses = function () {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClass($mod.TTMSFNCPopup);
    };
    this.PopupModal = function () {
      var Result = 0;
      var LStaysOpen = false;
      Result = 0;
      if (this.FIsOpen) return Result;
      if (this.HasPopupForm()) this.FPopupForm.Close();
      LStaysOpen = this.FStaysOpen;
      try {
        this.FStaysOpen = true;
        this.Popup(true);
        Result = this.FModalResult;
        this.SetIsOpen(false);
      } finally {
        this.FStaysOpen = LStaysOpen;
      };
      return Result;
    };
    this.Popup = function (AShowModal) {
      this.DoCreatePopup(AShowModal);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("StaysOpen",0,rtl.boolean,"FStaysOpen","FStaysOpen",4,{Default: false});
    $r.addProperty("DropDownHeight",2,rtl.double,"FDropDownHeight","SetDropDownHeight");
    $r.addProperty("DropDownWidth",2,rtl.double,"FDropDownWidth","SetDropDownWidth");
    $r.addProperty("HorizontalOffset",0,rtl.double,"FHorizontalOffset","FHorizontalOffset");
    $r.addProperty("Placement",2,$mod.$rtti["TTMSFNCPopupPlacement"],"FPlacement","SetPlacement",4,{Default: $mod.TTMSFNCPopupPlacement.ppBottom});
    $r.addProperty("PlacementRectangle",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCMargins"],"FPlacementRectangle","SetPlacementRectangle");
    $r.addProperty("PlacementControl",2,pas["WEBLib.Controls"].$rtti["TControl"],"FPlacementControl","SetPlacementControl");
    $r.addProperty("VerticalOffset",0,rtl.double,"FVerticalOffset","FVerticalOffset");
    $r.addProperty("FocusedControl",0,pas["WEBLib.Controls"].$rtti["TControl"],"FFocusedControl","FFocusedControl");
    $r.addProperty("ContentControl",2,pas["WEBLib.Controls"].$rtti["TControl"],"FContentControl","SetContentControl");
    $r.addProperty("OnClosePopup",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClosePopup","FOnClosePopup");
    $r.addProperty("OnPopupPaint",0,$mod.$rtti["TTMSFNCPopupPaint"],"FOnPopupPaint","FOnPopupPaint");
    $r.addProperty("OnPopup",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnPopup","FOnPopup");
    $r.addProperty("OnPopupShown",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnPopupShown","FOnPopupShown");
    $r.addProperty("Version",1,rtl.string,"GetVersion","");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
  rtl.createClass(this,"TTMSFNCCustomNonFocusablePopupForm",this.TTMSFNCCustomPopupForm,function () {
    this.UpdateBounds = function (LRect) {
      $mod.TTMSFNCCustomPopupForm.UpdateBounds.apply(this,arguments);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCCustomNonFocusablePopup",this.TTMSFNCCustomPopup,function () {
    this.ActivatePreviousWindow = function () {
    };
    this.ShowPopup = function (AModal) {
      $mod.TTMSFNCCustomPopup.ShowPopup.apply(this,arguments);
      this.FIsOpen = true;
    };
    this.GetPopupFormClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCCustomNonFocusablePopupForm;
      return Result;
    };
    this.Create$1 = function (AOwner) {
      $mod.TTMSFNCCustomPopup.Create$1.apply(this,arguments);
      this.FStaysOpen = true;
      return this;
    };
    this.Destroy = function () {
      $mod.TTMSFNCCustomPopup.Destroy.call(this);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCNonFocusablePopup",this.TTMSFNCCustomNonFocusablePopup,function () {
    this.Deactivate = function () {
      this.ClosePopup();
    };
    this.Activate = function () {
      this.DoCreatePopup(false);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("ContentControl",2,pas["WEBLib.Controls"].$rtti["TControl"],"FContentControl","SetContentControl");
    $r.addProperty("Placement",2,$mod.$rtti["TTMSFNCPopupPlacement"],"FPlacement","SetPlacement",4,{Default: $mod.TTMSFNCPopupPlacement.ppBottom});
    $r.addProperty("PlacementRectangle",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCMargins"],"FPlacementRectangle","SetPlacementRectangle");
    $r.addProperty("PlacementControl",2,pas["WEBLib.Controls"].$rtti["TControl"],"FPlacementControl","SetPlacementControl");
  });
  $mod.$implcode = function () {
    $impl.GetTickCountX = function () {
      var Result = 0;
      var h = 0;
      var m = 0;
      var s = 0;
      var ms = 0;
      pas.SysUtils.DecodeTime(pas.SysUtils.Now(),{get: function () {
          return h;
        }, set: function (v) {
          h = v;
        }},{get: function () {
          return m;
        }, set: function (v) {
          m = v;
        }},{get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},{get: function () {
          return ms;
        }, set: function (v) {
          ms = v;
        }});
      Result = ms + (s * 1000) + (m * 60 * 1000) + (h * 60 * 60 * 1000);
      return Result;
    };
    rtl.createClass($impl,"TDPIControlProtected",pas["WEBLib.Controls"].TControl,function () {
      rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
      rtl.addIntf(this,pas.System.IUnknown);
    });
  };
},["SysUtils","WEBLib.TMSFNCUtils","Math","WEBLib.TMSFNCStyles"]);
rtl.module("WEBLib.TMSFNCCustomTreeView",["System","Classes","SysUtils","WEBLib.TMSFNCTreeViewData","WEBLib.TMSFNCCustomComponent","WEBLib.TMSFNCGraphics","WEBLib.TMSFNCPopup","WEBLib.TMSFNCImage","Types","WEBLib.TMSFNCTypes","WEBLib.Controls","WEBLib.ExtCtrls","WEBLib.StdCtrls","WEBLib.TMSFNCGraphicsTypes","contnrs","Web","WEBLib.JSON"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.TTMSFNCTreeViewDocURL = pas["WEBLib.TMSFNCTypes"].TTMSFNCBaseDocURL + "tmsfncuipack/components/ttmsfnctreeview/";
  this.MAJ_VER = 1;
  this.MIN_VER = 2;
  this.REL_VER = 2;
  this.BLD_VER = 3;
  this.CLP_FMT = "#TREEVIEW#";
  this.ENDOFLINE = "\r\n";
  this.DRAGMARGIN = 10;
  this.CACHEWIDTH = 1000;
  this.CACHEHEIGHT = 1000;
  this.SCROLLINGDELAY = 0;
  this.TTMSFNCTreeViewColorExtended = 0xF4F4F4;
  this.TTMSFNCTreeViewColorSelection = 0xF8AD1B;
  this.$rtti.$Class("TTMSFNCCustomTreeView");
  rtl.createClass(this,"TTMSFNCTreeViewCache",pas.contnrs.TObjectList,function () {
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      this.SetItem(Index,Value);
    };
  });
  rtl.createClass(this,"TTMSFNCTreeViewNodeCache",this.TTMSFNCTreeViewCache,function () {
  });
  rtl.createClass(this,"TTMSFNCTreeViewColumnsCache",this.TTMSFNCTreeViewCache,function () {
  });
  rtl.createClass(this,"TTMSFNCTreeViewColumnsTopCache",this.TTMSFNCTreeViewColumnsCache,function () {
  });
  rtl.createClass(this,"TTMSFNCTreeViewColumnsBottomCache",this.TTMSFNCTreeViewColumnsCache,function () {
  });
  rtl.createClass(this,"TTMSFNCTreeViewGroupsCache",this.TTMSFNCTreeViewCache,function () {
  });
  rtl.createClass(this,"TTMSFNCTreeViewGroupsTopCache",this.TTMSFNCTreeViewGroupsCache,function () {
  });
  rtl.createClass(this,"TTMSFNCTreeViewGroupsBottomCache",this.TTMSFNCTreeViewGroupsCache,function () {
  });
  rtl.createClass(this,"TTMSFNCTreeViewDisplayList",pas.Classes.TList,function () {
    this.GetItem = function (Index) {
      var Result = null;
      Result = rtl.getObject(this.Get(Index));
      return Result;
    };
    this.SetItem = function (Index, Value) {
      this.Put(Index,Value);
    };
  });
  rtl.createClass(this,"TTMSFNCTreeViewNodeDisplayList",this.TTMSFNCTreeViewDisplayList,function () {
  });
  rtl.createClass(this,"TTMSFNCTreeViewColumnsDisplayList",this.TTMSFNCTreeViewDisplayList,function () {
  });
  rtl.createClass(this,"TTMSFNCTreeViewColumnsTopDisplayList",this.TTMSFNCTreeViewColumnsDisplayList,function () {
  });
  rtl.createClass(this,"TTMSFNCTreeViewColumnsBottomDisplayList",this.TTMSFNCTreeViewColumnsDisplayList,function () {
  });
  rtl.createClass(this,"TTMSFNCTreeViewGroupsDisplayList",this.TTMSFNCTreeViewDisplayList,function () {
  });
  rtl.createClass(this,"TTMSFNCTreeViewGroupsTopDisplayList",this.TTMSFNCTreeViewGroupsDisplayList,function () {
  });
  rtl.createClass(this,"TTMSFNCTreeViewGroupsBottomDisplayList",this.TTMSFNCTreeViewGroupsDisplayList,function () {
  });
  this.TTMSFNCTreeViewColumnsLayout = {"0": "tclTop", tclTop: 0, "1": "tclBottom", tclBottom: 1};
  this.$rtti.$Enum("TTMSFNCTreeViewColumnsLayout",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCTreeViewColumnsLayout});
  this.$rtti.$Set("TTMSFNCTreeViewColumnsLayouts",{comptype: this.$rtti["TTMSFNCTreeViewColumnsLayout"]});
  this.TTMSFNCTreeViewGroupLayout = {"0": "tglTop", tglTop: 0, "1": "tglBottom", tglBottom: 1};
  this.$rtti.$Enum("TTMSFNCTreeViewGroupLayout",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCTreeViewGroupLayout});
  this.$rtti.$Set("TTMSFNCTreeViewGroupsLayouts",{comptype: this.$rtti["TTMSFNCTreeViewGroupLayout"]});
  this.TTMSFNCTreeViewNodeHeightMode = {"0": "tnhmFixed", tnhmFixed: 0, "1": "tnhmVariable", tnhmVariable: 1};
  this.$rtti.$Enum("TTMSFNCTreeViewNodeHeightMode",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCTreeViewNodeHeightMode});
  this.TTMSFNCTreeViewSelectionArea = {"0": "tsaDefault", tsaDefault: 0, "1": "tsaFull", tsaFull: 1, "2": "tsaFromLevel", tsaFromLevel: 2, "3": "tsaFromText", tsaFromText: 3};
  this.$rtti.$Enum("TTMSFNCTreeViewSelectionArea",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TTMSFNCTreeViewSelectionArea});
  rtl.createClass(this,"TTMSFNCTreeViewNodesAppearance",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FTreeView = null;
      this.FFill = null;
      this.FStroke = null;
      this.FFont = null;
      this.FDisabledFill = null;
      this.FSelectedFill = null;
      this.FDisabledStroke = null;
      this.FSelectedStroke = null;
      this.FSelectionArea = 0;
      this.FExpandColumn = 0;
      this.FExpandWidth = 0.0;
      this.FExpandHeight = 0.0;
      this.FLevelIndent = 0.0;
      this.FHeightMode = 0;
      this.FFixedHeight = 0.0;
      this.FVariableMinimumHeight = 0.0;
      this.FSelectedFontColor = 0;
      this.FDisabledFontColor = 0;
      this.FExtendedFontColor = 0;
      this.FExtendedSelectedFontColor = 0;
      this.FExtendedDisabledFontColor = 0;
      this.FExtendedDisabledFill = null;
      this.FExtendedFont = null;
      this.FExtendedSelectedFill = null;
      this.FExtendedDisabledStroke = null;
      this.FExtendedSelectedStroke = null;
      this.FExtendedFill = null;
      this.FExtendedStroke = null;
      this.FShowLines = false;
      this.FExpandNodeIcon = null;
      this.FCollapseNodeIcon = null;
      this.FExpandNodeIconLarge = null;
      this.FCollapseNodeIconLarge = null;
      this.FColumnStroke = null;
      this.FLineStroke = null;
      this.FShowFocus = false;
      this.FSpacing = 0.0;
      this.FDisabledTitleFontColor = 0;
      this.FSelectedTitleFontColor = 0;
      this.FTitleFont = null;
    };
    this.$final = function () {
      this.FTreeView = undefined;
      this.FFill = undefined;
      this.FStroke = undefined;
      this.FFont = undefined;
      this.FDisabledFill = undefined;
      this.FSelectedFill = undefined;
      this.FDisabledStroke = undefined;
      this.FSelectedStroke = undefined;
      this.FExtendedDisabledFill = undefined;
      this.FExtendedFont = undefined;
      this.FExtendedSelectedFill = undefined;
      this.FExtendedDisabledStroke = undefined;
      this.FExtendedSelectedStroke = undefined;
      this.FExtendedFill = undefined;
      this.FExtendedStroke = undefined;
      this.FExpandNodeIcon = undefined;
      this.FCollapseNodeIcon = undefined;
      this.FExpandNodeIconLarge = undefined;
      this.FCollapseNodeIconLarge = undefined;
      this.FColumnStroke = undefined;
      this.FLineStroke = undefined;
      this.FTitleFont = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetFill = function (Value) {
      if (this.FFill !== Value) this.FFill.Assign(Value);
    };
    this.SetStroke = function (Value) {
      if (this.FStroke !== Value) this.FStroke.Assign(Value);
    };
    this.SetFont = function (Value) {
      if (this.FFont !== Value) this.FFont.Assign(Value);
    };
    this.SetDisabledFill = function (Value) {
      if (this.FDisabledFill !== Value) this.FDisabledFill.Assign(Value);
    };
    this.SetDisabledStroke = function (Value) {
      if (this.FDisabledStroke !== Value) this.FDisabledStroke.Assign(Value);
    };
    this.SetSelectedFill = function (Value) {
      if (this.FSelectedFill !== Value) this.FSelectedFill.Assign(Value);
    };
    this.SetSelectedStroke = function (Value) {
      if (this.FSelectedStroke !== Value) this.FSelectedStroke.Assign(Value);
    };
    this.SetSelectionArea = function (Value) {
      if (this.FSelectionArea !== Value) {
        this.FSelectionArea = Value;
        this.FTreeView.Invalidate();
      };
    };
    this.SetExtendedFill = function (Value) {
      if (this.FExtendedFill !== Value) this.FExtendedFill.Assign(Value);
    };
    this.SetExtendedStroke = function (Value) {
      if (this.FExtendedStroke !== Value) this.FExtendedStroke.Assign(Value);
    };
    this.SetExtendedFont = function (Value) {
      if (this.FExtendedFont !== Value) this.FExtendedFont.Assign(Value);
    };
    this.SetExtendedDisabledFill = function (Value) {
      if (this.FExtendedDisabledFill !== Value) this.FExtendedDisabledFill.Assign(Value);
    };
    this.SetExtendedDisabledStroke = function (Value) {
      if (this.FExtendedDisabledStroke !== Value) this.FExtendedDisabledStroke.Assign(Value);
    };
    this.SetExtendedSelectedFill = function (Value) {
      if (this.FExtendedSelectedFill !== Value) this.FExtendedSelectedFill.Assign(Value);
    };
    this.SetExtendedSelectedStroke = function (Value) {
      if (this.FExtendedSelectedStroke !== Value) this.FExtendedSelectedStroke.Assign(Value);
    };
    this.SetExpandColumn = function (Value) {
      if (this.FExpandColumn !== Value) {
        this.FExpandColumn = Value;
        this.Changed(this);
      };
    };
    this.SetExpandWidth = function (Value) {
      if (this.FExpandWidth !== Value) {
        this.FExpandWidth = Value;
        this.Changed(this);
      };
    };
    this.SetExpandHeight = function (Value) {
      if (this.FExpandHeight !== Value) {
        this.FExpandHeight = Value;
        this.Changed(this);
      };
    };
    this.SetLevelIndent = function (Value) {
      if (this.FLevelIndent !== Value) {
        this.FLevelIndent = Value;
        this.Changed(this);
      };
    };
    this.SetFixedHeight = function (Value) {
      if (this.FFixedHeight !== Value) {
        this.FFixedHeight = Value;
        this.Changed(this);
      };
    };
    this.SetVariableMinimumHeight = function (Value) {
      if (this.FVariableMinimumHeight !== Value) {
        this.FVariableMinimumHeight = Value;
        this.Changed(this);
      };
    };
    this.SetSelectedFontColor = function (Value) {
      if (this.FSelectedFontColor !== Value) {
        this.FSelectedFontColor = Value;
        this.Changed(this);
      };
    };
    this.SetDisabledFontColor = function (Value) {
      if (this.FDisabledFontColor !== Value) {
        this.FDisabledFontColor = Value;
        this.Changed(this);
      };
    };
    this.SetExtendedFontColor = function (Value) {
      if (this.FExtendedFontColor !== Value) {
        this.FExtendedFontColor = Value;
        this.Changed(this);
      };
    };
    this.SetExtendedSelectedFontColor = function (Value) {
      if (this.FExtendedSelectedFontColor !== Value) {
        this.FExtendedSelectedFontColor = Value;
        this.Changed(this);
      };
    };
    this.SetExtendedDisabledFontColor = function (Value) {
      if (this.FExtendedDisabledFontColor !== Value) {
        this.FExtendedDisabledFontColor = Value;
        this.Changed(this);
      };
    };
    this.SetHeightMode = function (Value) {
      if (this.FHeightMode !== Value) {
        this.FHeightMode = Value;
        this.Changed(this);
      };
    };
    this.SetShowLines = function (Value) {
      if (this.FShowLines !== Value) {
        this.FShowLines = Value;
        this.Changed(this);
      };
    };
    this.SetCollapseNodeIcon = function (Value) {
      if (this.FCollapseNodeIcon !== Value) {
        this.FCollapseNodeIcon.Assign(Value);
        this.Changed(this);
      };
    };
    this.SetExpandNodeIcon = function (Value) {
      if (this.FExpandNodeIcon !== Value) {
        this.FExpandNodeIcon.Assign(Value);
        this.Changed(this);
      };
    };
    this.SetCollapseNodeIconLarge = function (Value) {
      if (this.FCollapseNodeIconLarge !== Value) {
        this.FCollapseNodeIconLarge.Assign(Value);
        this.Changed(this);
      };
    };
    this.SetExpandNodeIconLarge = function (Value) {
      if (this.FExpandNodeIconLarge !== Value) {
        this.FExpandNodeIconLarge.Assign(Value);
        this.Changed(this);
      };
    };
    this.SetColumnStroke = function (Value) {
      if (this.FColumnStroke !== Value) this.FColumnStroke.Assign(Value);
    };
    this.SetLineStroke = function (Value) {
      if (this.FLineStroke !== Value) this.FLineStroke.Assign(Value);
    };
    this.SetShowFocus = function (Value) {
      if (this.FShowFocus !== Value) {
        this.FShowFocus = Value;
        this.FTreeView.Invalidate();
      };
    };
    this.IsSpacingStored = function () {
      var Result = false;
      Result = this.FSpacing !== 0;
      return Result;
    };
    this.SetSpacing = function (Value) {
      if (this.FSpacing !== Value) {
        this.FSpacing = Value;
        this.Changed(this);
      };
    };
    this.SetDisabledTitleFontColor = function (Value) {
      if (this.FDisabledTitleFontColor !== Value) {
        this.FDisabledTitleFontColor = Value;
        this.FTreeView.Invalidate();
      };
    };
    this.SetSelectedTitleFontColor = function (Value) {
      if (this.FSelectedTitleFontColor !== Value) {
        this.FSelectedTitleFontColor = Value;
        this.FTreeView.Invalidate();
      };
    };
    this.SetTitleFont = function (Value) {
      if (this.FTitleFont !== Value) this.FTitleFont.Assign(Value);
    };
    this.Changed = function (Sender) {
      this.FTreeView.UpdateTreeViewCache();
    };
    this.BitmapChanged = function (Sender) {
      this.FTreeView.UpdateTreeViewCache();
    };
    this.Create$1 = function (ATreeView) {
      this.FTreeView = ATreeView;
      this.FShowFocus = true;
      this.FSelectionArea = $mod.TTMSFNCTreeViewSelectionArea.tsaFromText;
      this.FExpandColumn = 0;
      this.FExpandWidth = 15;
      this.FExpandHeight = 15;
      this.FFixedHeight = 25;
      this.FVariableMinimumHeight = 25;
      this.FShowLines = true;
      this.FHeightMode = $mod.TTMSFNCTreeViewNodeHeightMode.tnhmFixed;
      this.FLevelIndent = 20;
      this.FSpacing = 0;
      this.FSelectedFontColor = 16777215;
      this.FDisabledFontColor = 12632256;
      this.FSelectedTitleFontColor = 16777215;
      this.FDisabledTitleFontColor = 12632256;
      this.FExtendedFontColor = 0;
      this.FExtendedSelectedFontColor = 16777215;
      this.FExtendedDisabledFontColor = 12632256;
      this.FColumnStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,-1,1.0]);
      this.FLineStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskDot,11119017,1.0]);
      this.FFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,-1,8421504,-1,-1]);
      this.FStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone,11119017,1.0]);
      this.FSelectedFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16297243,8421504,-1,-1]);
      this.FSelectedStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,16297243,1.0]);
      this.FDisabledFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,11119017,8421504,-1,-1]);
      this.FDisabledStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone,11119017,1.0]);
      this.FExtendedFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16053492,8421504,-1,-1]);
      this.FExtendedStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,11119017,1.0]);
      this.FExtendedSelectedFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16297243,8421504,-1,-1]);
      this.FExtendedSelectedStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone,11119017,1.0]);
      this.FExtendedDisabledFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,11119017,8421504,-1,-1]);
      this.FExtendedDisabledStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone,11119017,1.0]);
      this.FExpandNodeIcon = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource$1($mod.TTMSFNCTREEVIEWEXPAND,pas["WEBLib.TMSFNCTypes"].HInstance());
      this.FExpandNodeIcon.FOnChange = rtl.createCallback(this,"BitmapChanged");
      this.FCollapseNodeIcon = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource$1($mod.TTMSFNCTREEVIEWCOLLAPSE,pas["WEBLib.TMSFNCTypes"].HInstance());
      this.FCollapseNodeIcon.FOnChange = rtl.createCallback(this,"BitmapChanged");
      this.FExpandNodeIconLarge = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource$1($mod.TTMSFNCTREEVIEWEXPANDLARGE,pas["WEBLib.TMSFNCTypes"].HInstance());
      this.FExpandNodeIconLarge.FOnChange = rtl.createCallback(this,"BitmapChanged");
      this.FCollapseNodeIconLarge = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource$1($mod.TTMSFNCTREEVIEWCOLLAPSELARGE,pas["WEBLib.TMSFNCTypes"].HInstance());
      this.FCollapseNodeIconLarge.FOnChange = rtl.createCallback(this,"BitmapChanged");
      this.FFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      if ((this.FTreeView != null) && this.FTreeView.IsDesignTime()) this.FFont.SetColor(0);
      this.FTitleFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      if ((this.FTreeView != null) && this.FTreeView.IsDesignTime()) this.FTitleFont.SetColor(0);
      this.FFill.FOnChanged = rtl.createCallback(this,"Changed");
      this.FStroke.FOnChanged = rtl.createCallback(this,"Changed");
      this.FSelectedFill.FOnChanged = rtl.createCallback(this,"Changed");
      this.FSelectedStroke.FOnChanged = rtl.createCallback(this,"Changed");
      this.FDisabledFill.FOnChanged = rtl.createCallback(this,"Changed");
      this.FDisabledStroke.FOnChanged = rtl.createCallback(this,"Changed");
      this.FExtendedFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FExtendedFill.FOnChanged = rtl.createCallback(this,"Changed");
      this.FExtendedStroke.FOnChanged = rtl.createCallback(this,"Changed");
      this.FExtendedSelectedFill.FOnChanged = rtl.createCallback(this,"Changed");
      this.FExtendedSelectedStroke.FOnChanged = rtl.createCallback(this,"Changed");
      this.FExtendedDisabledFill.FOnChanged = rtl.createCallback(this,"Changed");
      this.FExtendedDisabledStroke.FOnChanged = rtl.createCallback(this,"Changed");
      this.FFont.FOnChanged = rtl.createCallback(this,"Changed");
      this.FExtendedFont.FOnChanged = rtl.createCallback(this,"Changed");
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCTreeViewNodesAppearance.isPrototypeOf(Source)) {
        this.FFill.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewNodesAppearance).FFill);
        this.FStroke.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewNodesAppearance).FStroke);
        this.FFont.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewNodesAppearance).FFont);
        this.FTitleFont.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewNodesAppearance).FTitleFont);
        this.FSelectedFill.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewNodesAppearance).FSelectedFill);
        this.FSelectedStroke.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewNodesAppearance).FSelectedStroke);
        this.FDisabledFill.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewNodesAppearance).FDisabledFill);
        this.FDisabledStroke.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewNodesAppearance).FDisabledStroke);
        this.FExtendedFill.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewNodesAppearance).FExtendedFill);
        this.FExtendedStroke.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewNodesAppearance).FExtendedStroke);
        this.FExtendedFont.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewNodesAppearance).FExtendedFont);
        this.FExtendedSelectedFill.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewNodesAppearance).FExtendedSelectedFill);
        this.FExtendedSelectedStroke.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewNodesAppearance).FExtendedSelectedStroke);
        this.FExtendedDisabledFill.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewNodesAppearance).FExtendedDisabledFill);
        this.FExtendedDisabledStroke.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewNodesAppearance).FExtendedDisabledStroke);
        this.FExpandColumn = rtl.as(Source,$mod.TTMSFNCTreeViewNodesAppearance).FExpandColumn;
        this.FExpandWidth = rtl.as(Source,$mod.TTMSFNCTreeViewNodesAppearance).FExpandWidth;
        this.FExpandHeight = rtl.as(Source,$mod.TTMSFNCTreeViewNodesAppearance).FExpandHeight;
        this.FFixedHeight = rtl.as(Source,$mod.TTMSFNCTreeViewNodesAppearance).FFixedHeight;
        this.FVariableMinimumHeight = rtl.as(Source,$mod.TTMSFNCTreeViewNodesAppearance).FVariableMinimumHeight;
        this.FSelectedFontColor = rtl.as(Source,$mod.TTMSFNCTreeViewNodesAppearance).FSelectedFontColor;
        this.FDisabledFontColor = rtl.as(Source,$mod.TTMSFNCTreeViewNodesAppearance).FDisabledFontColor;
        this.FSelectedTitleFontColor = rtl.as(Source,$mod.TTMSFNCTreeViewNodesAppearance).FSelectedTitleFontColor;
        this.FDisabledTitleFontColor = rtl.as(Source,$mod.TTMSFNCTreeViewNodesAppearance).FDisabledTitleFontColor;
        this.FExtendedFontColor = rtl.as(Source,$mod.TTMSFNCTreeViewNodesAppearance).FExtendedFontColor;
        this.FExtendedSelectedFontColor = rtl.as(Source,$mod.TTMSFNCTreeViewNodesAppearance).FExtendedSelectedFontColor;
        this.FExtendedDisabledFontColor = rtl.as(Source,$mod.TTMSFNCTreeViewNodesAppearance).FExtendedDisabledFontColor;
        this.FLevelIndent = rtl.as(Source,$mod.TTMSFNCTreeViewNodesAppearance).FLevelIndent;
        this.FSpacing = rtl.as(Source,$mod.TTMSFNCTreeViewNodesAppearance).FSpacing;
        this.FHeightMode = rtl.as(Source,$mod.TTMSFNCTreeViewNodesAppearance).FHeightMode;
        this.FShowLines = rtl.as(Source,$mod.TTMSFNCTreeViewNodesAppearance).FShowLines;
        this.FShowFocus = rtl.as(Source,$mod.TTMSFNCTreeViewNodesAppearance).FShowFocus;
        this.FColumnStroke.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewNodesAppearance).FColumnStroke);
        this.FLineStroke.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewNodesAppearance).FLineStroke);
      };
    };
    this.Destroy = function () {
      rtl.free(this,"FLineStroke");
      rtl.free(this,"FColumnStroke");
      rtl.free(this,"FExpandNodeIconLarge");
      rtl.free(this,"FCollapseNodeIconLarge");
      rtl.free(this,"FExpandNodeIcon");
      rtl.free(this,"FCollapseNodeIcon");
      rtl.free(this,"FFill");
      rtl.free(this,"FStroke");
      rtl.free(this,"FFont");
      rtl.free(this,"FTitleFont");
      rtl.free(this,"FSelectedFill");
      rtl.free(this,"FSelectedStroke");
      rtl.free(this,"FDisabledFill");
      rtl.free(this,"FDisabledStroke");
      rtl.free(this,"FExtendedFill");
      rtl.free(this,"FExtendedStroke");
      rtl.free(this,"FExtendedFont");
      rtl.free(this,"FExtendedSelectedFill");
      rtl.free(this,"FExtendedSelectedStroke");
      rtl.free(this,"FExtendedDisabledFill");
      rtl.free(this,"FExtendedDisabledStroke");
      pas.System.TObject.Destroy.call(this);
    };
    var $r = this.$rtti;
    $r.addProperty("ShowFocus",2,rtl.boolean,"FShowFocus","SetShowFocus",4,{Default: true});
    $r.addProperty("ExpandColumn",2,rtl.longint,"FExpandColumn","SetExpandColumn",4,{Default: 0});
    $r.addProperty("ExpandWidth",2,rtl.double,"FExpandWidth","SetExpandWidth");
    $r.addProperty("ExpandHeight",2,rtl.double,"FExpandHeight","SetExpandHeight");
    $r.addProperty("LevelIndent",2,rtl.double,"FLevelIndent","SetLevelIndent");
    $r.addProperty("Spacing",14,rtl.double,"FSpacing","SetSpacing",4,{stored: "IsSpacingStored"});
    $r.addProperty("FixedHeight",2,rtl.double,"FFixedHeight","SetFixedHeight");
    $r.addProperty("VariableMinimumHeight",2,rtl.double,"FVariableMinimumHeight","SetVariableMinimumHeight");
    $r.addProperty("HeightMode",2,$mod.$rtti["TTMSFNCTreeViewNodeHeightMode"],"FHeightMode","SetHeightMode",4,{Default: $mod.TTMSFNCTreeViewNodeHeightMode.tnhmFixed});
    $r.addProperty("ShowLines",2,rtl.boolean,"FShowLines","SetShowLines",4,{Default: true});
    $r.addProperty("Fill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFill","SetFill");
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
    $r.addProperty("ColumnStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FColumnStroke","SetColumnStroke");
    $r.addProperty("LineStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FLineStroke","SetLineStroke");
    $r.addProperty("Font",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FFont","SetFont");
    $r.addProperty("TitleFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FTitleFont","SetTitleFont");
    $r.addProperty("SelectedFontColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FSelectedFontColor","SetSelectedFontColor",4,{Default: 16777215});
    $r.addProperty("DisabledFontColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FDisabledFontColor","SetDisabledFontColor",4,{Default: 12632256});
    $r.addProperty("SelectedTitleFontColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FSelectedTitleFontColor","SetSelectedTitleFontColor",4,{Default: 16777215});
    $r.addProperty("DisabledTitleFontColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FDisabledTitleFontColor","SetDisabledTitleFontColor",4,{Default: 12632256});
    $r.addProperty("ExtendedFontColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FExtendedFontColor","SetExtendedFontColor",4,{Default: 0});
    $r.addProperty("ExtendedSelectedFontColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FExtendedSelectedFontColor","SetExtendedSelectedFontColor",4,{Default: 16777215});
    $r.addProperty("ExtendedDisabledFontColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FExtendedDisabledFontColor","SetExtendedDisabledFontColor",4,{Default: 12632256});
    $r.addProperty("SelectedFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FSelectedFill","SetSelectedFill");
    $r.addProperty("SelectedStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FSelectedStroke","SetSelectedStroke");
    $r.addProperty("SelectionArea",2,$mod.$rtti["TTMSFNCTreeViewSelectionArea"],"FSelectionArea","SetSelectionArea",4,{Default: $mod.TTMSFNCTreeViewSelectionArea.tsaFromText});
    $r.addProperty("DisabledFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FDisabledFill","SetDisabledFill");
    $r.addProperty("DisabledStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FDisabledStroke","SetDisabledStroke");
    $r.addProperty("ExtendedFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FExtendedFill","SetExtendedFill");
    $r.addProperty("ExtendedStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FExtendedStroke","SetExtendedStroke");
    $r.addProperty("ExtendedFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FExtendedFont","SetExtendedFont");
    $r.addProperty("ExtendedSelectedFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FExtendedSelectedFill","SetExtendedSelectedFill");
    $r.addProperty("ExtendedSelectedStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FExtendedSelectedStroke","SetExtendedSelectedStroke");
    $r.addProperty("ExtendedDisabledFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FExtendedDisabledFill","SetExtendedDisabledFill");
    $r.addProperty("ExtendedDisabledStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FExtendedDisabledStroke","SetExtendedDisabledStroke");
    $r.addProperty("ExpandNodeIcon",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FExpandNodeIcon","SetExpandNodeIcon");
    $r.addProperty("CollapseNodeIcon",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FCollapseNodeIcon","SetCollapseNodeIcon");
    $r.addProperty("ExpandNodeIconLarge",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FExpandNodeIconLarge","SetExpandNodeIconLarge");
    $r.addProperty("CollapseNodeIconLarge",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FCollapseNodeIconLarge","SetCollapseNodeIconLarge");
  });
  rtl.createClass(this,"TTMSFNCTreeViewColumnsAppearance",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FTreeView = null;
      this.FLayouts = {};
      this.FStretch = false;
      this.FStretchColumn = 0;
      this.FStretchAll = false;
      this.FBottomSize = 0.0;
      this.FTopSize = 0.0;
      this.FBottomFill = null;
      this.FBottomStroke = null;
      this.FTopFill = null;
      this.FTopStroke = null;
      this.FTopFont = null;
      this.FBottomFont = null;
      this.FTopVerticalTextAlign = 0;
      this.FTopHorizontalTextAlign = 0;
      this.FBottomHorizontalTextAlign = 0;
      this.FBottomVerticalTextAlign = 0;
      this.FTopVerticalText = false;
      this.FBottomVerticalText = false;
      this.FFillEmptySpaces = false;
      this.FSortIndicatorColor = 0;
      this.FOptimizedColumnDisplay = false;
    };
    this.$final = function () {
      this.FTreeView = undefined;
      this.FLayouts = undefined;
      this.FBottomFill = undefined;
      this.FBottomStroke = undefined;
      this.FTopFill = undefined;
      this.FTopStroke = undefined;
      this.FTopFont = undefined;
      this.FBottomFont = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetLayouts = function (Value) {
      if (rtl.neSet(this.FLayouts,Value)) {
        this.FLayouts = rtl.refSet(Value);
        this.FTreeView.UpdateTreeViewCache();
      };
    };
    this.SetStretch = function (Value) {
      if (this.FStretch !== Value) {
        this.FStretch = Value;
        this.FTreeView.UpdateColumns();
        this.FTreeView.UpdateTreeViewCache();
      };
    };
    this.SetStretchAll = function (Value) {
      if (this.FStretchAll !== Value) {
        this.FStretchAll = Value;
        this.FTreeView.UpdateColumns();
        this.FTreeView.UpdateTreeViewCache();
      };
    };
    this.SetStretchColumn = function (Value) {
      if (this.FStretchColumn !== Value) {
        this.FStretchColumn = Value;
        this.FTreeView.UpdateColumns();
        this.FTreeView.UpdateTreeViewCache();
      };
    };
    this.SetBottomSize = function (Value) {
      if (this.FBottomSize !== Value) {
        this.FBottomSize = Value;
        this.FTreeView.UpdateTreeViewCache();
      };
    };
    this.SetTopSize = function (Value) {
      if (this.FTopSize !== Value) {
        this.FTopSize = Value;
        this.Changed(this);
      };
    };
    this.SetBottomFill = function (Value) {
      if (this.FBottomFill !== Value) this.FBottomFill.Assign(Value);
    };
    this.SetBottomStroke = function (Value) {
      if (this.FBottomStroke !== Value) this.FBottomStroke.Assign(Value);
    };
    this.SetTopFill = function (Value) {
      if (this.FTopFill !== Value) this.FTopFill.Assign(Value);
    };
    this.SetTopStroke = function (Value) {
      if (this.FTopStroke !== Value) this.FTopStroke.Assign(Value);
    };
    this.SetBottomFont = function (Value) {
      if (this.FBottomFont !== Value) this.FBottomFont.Assign(Value);
    };
    this.SetTopFont = function (Value) {
      if (this.FTopFont !== Value) this.FTopFont.Assign(Value);
    };
    this.SetTopVerticalText = function (Value) {
      if (this.FTopVerticalText !== Value) {
        this.FTopVerticalText = Value;
        this.Changed(this);
      };
    };
    this.SetBottomVerticalText = function (Value) {
      if (this.FBottomVerticalText !== Value) {
        this.FBottomVerticalText = Value;
        this.Changed(this);
      };
    };
    this.SetFillEmptySpaces = function (Value) {
      if (this.FFillEmptySpaces !== Value) {
        this.FFillEmptySpaces = Value;
        this.FTreeView.Invalidate();
      };
    };
    this.SetSortIndicatorColor = function (Value) {
      if (this.FSortIndicatorColor !== Value) {
        this.FSortIndicatorColor = Value;
        this.FTreeView.Invalidate();
      };
    };
    this.SetOptimizedColumnDisplay = function (Value) {
      if (this.FOptimizedColumnDisplay !== Value) {
        this.FOptimizedColumnDisplay = Value;
        this.FTreeView.UpdateColumns();
        this.FTreeView.UpdateTreeViewCache();
      };
    };
    this.Changed = function (Sender) {
      this.FTreeView.UpdateTreeViewCache();
    };
    this.Create$1 = function (ATreeView) {
      this.FTreeView = ATreeView;
      this.FSortIndicatorColor = 11829830;
      this.FLayouts = rtl.createSet($mod.TTMSFNCTreeViewColumnsLayout.tclTop);
      this.FFillEmptySpaces = true;
      this.FOptimizedColumnDisplay = true;
      this.FStretch = true;
      this.FStretchAll = true;
      this.FStretchColumn = -1;
      this.FBottomSize = 25;
      this.FTopVerticalText = false;
      this.FStretchAll = true;
      this.FBottomVerticalText = false;
      this.FTopSize = 25;
      this.FTopHorizontalTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      this.FTopVerticalTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      this.FBottomHorizontalTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      this.FBottomVerticalTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      this.FBottomFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16777215,8421504,-1,-1]);
      this.FBottomStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,11119017,1.0]);
      this.FTopFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16777215,8421504,-1,-1]);
      this.FTopStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,11119017,1.0]);
      this.FTopFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FTopFont.SetColor(0);
      this.FBottomFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FBottomFont.SetColor(0);
      this.FBottomFill.FOnChanged = rtl.createCallback(this,"Changed");
      this.FTopFill.FOnChanged = rtl.createCallback(this,"Changed");
      this.FBottomStroke.FOnChanged = rtl.createCallback(this,"Changed");
      this.FTopStroke.FOnChanged = rtl.createCallback(this,"Changed");
      this.FTopFont.FOnChanged = rtl.createCallback(this,"Changed");
      this.FBottomFont.FOnChanged = rtl.createCallback(this,"Changed");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FTopFont");
      rtl.free(this,"FBottomFont");
      rtl.free(this,"FBottomFill");
      rtl.free(this,"FTopFill");
      rtl.free(this,"FBottomStroke");
      rtl.free(this,"FTopStroke");
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCTreeViewColumnsAppearance.isPrototypeOf(Source)) {
        this.FSortIndicatorColor = rtl.as(Source,$mod.TTMSFNCTreeViewColumnsAppearance).FSortIndicatorColor;
        this.FLayouts = rtl.refSet(rtl.as(Source,$mod.TTMSFNCTreeViewColumnsAppearance).FLayouts);
        this.FTopSize = rtl.as(Source,$mod.TTMSFNCTreeViewColumnsAppearance).FTopSize;
        this.FBottomSize = rtl.as(Source,$mod.TTMSFNCTreeViewColumnsAppearance).FBottomSize;
        this.FBottomFill.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewColumnsAppearance).FBottomFill);
        this.FBottomFont.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewColumnsAppearance).FBottomFont);
        this.FBottomStroke.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewColumnsAppearance).FBottomStroke);
        this.FTopFill.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewColumnsAppearance).FTopFill);
        this.FTopStroke.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewColumnsAppearance).FTopStroke);
        this.FTopFont.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewColumnsAppearance).FTopFont);
        this.FStretch = rtl.as(Source,$mod.TTMSFNCTreeViewColumnsAppearance).FStretch;
        this.FOptimizedColumnDisplay = rtl.as(Source,$mod.TTMSFNCTreeViewColumnsAppearance).FOptimizedColumnDisplay;
        this.FStretchColumn = rtl.as(Source,$mod.TTMSFNCTreeViewColumnsAppearance).FStretchColumn;
        this.FStretchAll = rtl.as(Source,$mod.TTMSFNCTreeViewColumnsAppearance).FStretchAll;
        this.FTopVerticalText = rtl.as(Source,$mod.TTMSFNCTreeViewColumnsAppearance).FTopVerticalText;
        this.FBottomVerticalText = rtl.as(Source,$mod.TTMSFNCTreeViewColumnsAppearance).FBottomVerticalText;
        this.FFillEmptySpaces = rtl.as(Source,$mod.TTMSFNCTreeViewColumnsAppearance).FFillEmptySpaces;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Layouts",2,$mod.$rtti["TTMSFNCTreeViewColumnsLayouts"],"FLayouts","SetLayouts",4,{Default: rtl.createSet($mod.TTMSFNCTreeViewColumnsLayout.tclTop)});
    $r.addProperty("Stretch",2,rtl.boolean,"FStretch","SetStretch",4,{Default: true});
    $r.addProperty("StretchColumn",2,rtl.longint,"FStretchColumn","SetStretchColumn",4,{Default: -1});
    $r.addProperty("StretchAll",2,rtl.boolean,"FStretchAll","SetStretchAll",4,{Default: true});
    $r.addProperty("TopSize",2,rtl.double,"FTopSize","SetTopSize");
    $r.addProperty("BottomSize",2,rtl.double,"FBottomSize","SetBottomSize");
    $r.addProperty("TopFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FTopFont","SetTopFont");
    $r.addProperty("BottomFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FBottomFont","SetBottomFont");
    $r.addProperty("TopFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FTopFill","SetTopFill");
    $r.addProperty("BottomFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FBottomFill","SetBottomFill");
    $r.addProperty("TopStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FTopStroke","SetTopStroke");
    $r.addProperty("BottomStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FBottomStroke","SetBottomStroke");
    $r.addProperty("TopVerticalText",2,rtl.boolean,"FTopVerticalText","SetTopVerticalText",4,{Default: false});
    $r.addProperty("BottomVerticalText",2,rtl.boolean,"FBottomVerticalText","SetBottomVerticalText",4,{Default: false});
    $r.addProperty("FillEmptySpaces",2,rtl.boolean,"FFillEmptySpaces","SetFillEmptySpaces",4,{Default: true});
    $r.addProperty("SortIndicatorColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FSortIndicatorColor","SetSortIndicatorColor",4,{Default: 11829830});
    $r.addProperty("OptimizedColumnDisplay",2,rtl.boolean,"FOptimizedColumnDisplay","SetOptimizedColumnDisplay",4,{Default: true});
  });
  this.TTMSFNCTreeViewColumnEmptySpace = {"0": "tcesTopLeft", tcesTopLeft: 0, "1": "tcesTopRight", tcesTopRight: 1, "2": "tcesBottomLeft", tcesBottomLeft: 2, "3": "tcesBottomRight", tcesBottomRight: 3};
  this.$rtti.$Enum("TTMSFNCTreeViewColumnEmptySpace",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TTMSFNCTreeViewColumnEmptySpace});
  this.TTMSFNCTreeViewGroupEmptySpace = {"0": "tgesTopLeft", tgesTopLeft: 0, "1": "tgesTopRight", tgesTopRight: 1, "2": "tgesBottomLeft", tgesBottomLeft: 2, "3": "tgesBottomRight", tgesBottomRight: 3};
  this.$rtti.$Enum("TTMSFNCTreeViewGroupEmptySpace",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TTMSFNCTreeViewGroupEmptySpace});
  rtl.createClass(this,"TTMSFNCTreeViewGroupsAppearance",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FTreeView = null;
      this.FLayouts = {};
      this.FBottomSize = 0.0;
      this.FTopSize = 0.0;
      this.FBottomFill = null;
      this.FBottomStroke = null;
      this.FTopFill = null;
      this.FTopStroke = null;
      this.FTopFont = null;
      this.FBottomFont = null;
      this.FBottomHorizontalTextAlign = 0;
      this.FTopVerticalTextAlign = 0;
      this.FTopHorizontalTextAlign = 0;
      this.FBottomVerticalTextAlign = 0;
      this.FTopVerticalText = false;
      this.FBottomVerticalText = false;
      this.FFillEmptySpaces = false;
    };
    this.$final = function () {
      this.FTreeView = undefined;
      this.FLayouts = undefined;
      this.FBottomFill = undefined;
      this.FBottomStroke = undefined;
      this.FTopFill = undefined;
      this.FTopStroke = undefined;
      this.FTopFont = undefined;
      this.FBottomFont = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetLayouts = function (Value) {
      if (rtl.neSet(this.FLayouts,Value)) {
        this.FLayouts = rtl.refSet(Value);
        this.FTreeView.UpdateTreeViewCache();
      };
    };
    this.SetBottomSize = function (Value) {
      if (this.FBottomSize !== Value) {
        this.FBottomSize = Value;
        this.FTreeView.UpdateTreeViewCache();
      };
    };
    this.SetTopSize = function (Value) {
      if (this.FTopSize !== Value) {
        this.FTopSize = Value;
        this.FTreeView.UpdateTreeViewCache();
      };
    };
    this.SetBottomFill = function (Value) {
      if (this.FBottomFill !== Value) this.FBottomFill.Assign(Value);
    };
    this.SetBottomStroke = function (Value) {
      if (this.FBottomStroke !== Value) this.FBottomStroke.Assign(Value);
    };
    this.SetTopFill = function (Value) {
      if (this.FTopFill !== Value) this.FTopFill.Assign(Value);
    };
    this.SetTopStroke = function (Value) {
      if (this.FTopStroke !== Value) this.FTopStroke.Assign(Value);
    };
    this.SetBottomFont = function (Value) {
      if (this.FBottomFont !== Value) this.FBottomFont.Assign(Value);
    };
    this.SetTopFont = function (Value) {
      if (this.FTopFont !== Value) this.FTopFont.Assign(Value);
    };
    this.SetBottomHorizontalTextAlign = function (Value) {
      if (this.FBottomHorizontalTextAlign !== Value) {
        this.FBottomHorizontalTextAlign = Value;
        this.Changed(this);
      };
    };
    this.SetBottomVerticalTextAlign = function (Value) {
      if (this.FBottomVerticalTextAlign !== Value) {
        this.FBottomVerticalTextAlign = Value;
        this.Changed(this);
      };
    };
    this.SetTopHorizontalTextAlign = function (Value) {
      if (this.FTopHorizontalTextAlign !== Value) {
        this.FTopHorizontalTextAlign = Value;
        this.Changed(this);
      };
    };
    this.SetTopVerticalTextAlign = function (Value) {
      if (this.FTopVerticalTextAlign !== Value) {
        this.FTopVerticalTextAlign = Value;
        this.Changed(this);
      };
    };
    this.SetTopVerticalText = function (Value) {
      if (this.FTopVerticalText !== Value) {
        this.FTopVerticalText = Value;
        this.Changed(this);
      };
    };
    this.SetBottomVerticalText = function (Value) {
      if (this.FBottomVerticalText !== Value) {
        this.FBottomVerticalText = Value;
        this.Changed(this);
      };
    };
    this.SetFillEmptySpaces = function (Value) {
      if (this.FFillEmptySpaces !== Value) {
        this.FFillEmptySpaces = Value;
        this.FTreeView.Invalidate();
      };
    };
    this.Changed = function (Sender) {
      this.FTreeView.UpdateTreeViewCache();
    };
    this.Create$1 = function (ATreeView) {
      this.FTreeView = ATreeView;
      this.FLayouts = rtl.createSet($mod.TTMSFNCTreeViewGroupLayout.tglTop);
      this.FFillEmptySpaces = true;
      this.FTopSize = 50;
      this.FBottomSize = 50;
      this.FTopVerticalText = false;
      this.FBottomVerticalText = false;
      this.FTopHorizontalTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      this.FTopVerticalTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      this.FBottomHorizontalTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      this.FBottomVerticalTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      this.FBottomFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16777215,8421504,-1,-1]);
      this.FBottomStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,11119017,1.0]);
      this.FTopFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16777215,8421504,-1,-1]);
      this.FTopStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,11119017,1.0]);
      this.FTopFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FTopFont.SetColor(0);
      this.FBottomFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FBottomFont.SetColor(0);
      this.FBottomFill.FOnChanged = rtl.createCallback(this,"Changed");
      this.FTopFill.FOnChanged = rtl.createCallback(this,"Changed");
      this.FBottomStroke.FOnChanged = rtl.createCallback(this,"Changed");
      this.FTopStroke.FOnChanged = rtl.createCallback(this,"Changed");
      this.FTopFont.FOnChanged = rtl.createCallback(this,"Changed");
      this.FBottomFont.FOnChanged = rtl.createCallback(this,"Changed");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FBottomFont");
      rtl.free(this,"FTopFont");
      rtl.free(this,"FBottomFill");
      rtl.free(this,"FBottomStroke");
      rtl.free(this,"FTopFill");
      rtl.free(this,"FTopStroke");
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCTreeViewGroupsAppearance.isPrototypeOf(Source)) {
        this.FLayouts = rtl.refSet(rtl.as(Source,$mod.TTMSFNCTreeViewGroupsAppearance).FLayouts);
        this.FTopSize = rtl.as(Source,$mod.TTMSFNCTreeViewGroupsAppearance).FTopSize;
        this.FBottomSize = rtl.as(Source,$mod.TTMSFNCTreeViewGroupsAppearance).FBottomSize;
        this.FBottomFill.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewGroupsAppearance).FBottomFill);
        this.FBottomFont.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewGroupsAppearance).FBottomFont);
        this.FBottomStroke.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewGroupsAppearance).FBottomStroke);
        this.FTopFill.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewGroupsAppearance).FTopFill);
        this.FTopStroke.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewGroupsAppearance).FTopStroke);
        this.FTopFont.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewGroupsAppearance).FTopFont);
        this.FTopHorizontalTextAlign = rtl.as(Source,$mod.TTMSFNCTreeViewGroupsAppearance).FTopHorizontalTextAlign;
        this.FTopVerticalTextAlign = rtl.as(Source,$mod.TTMSFNCTreeViewGroupsAppearance).FTopVerticalTextAlign;
        this.FBottomHorizontalTextAlign = rtl.as(Source,$mod.TTMSFNCTreeViewGroupsAppearance).FBottomHorizontalTextAlign;
        this.FBottomVerticalTextAlign = rtl.as(Source,$mod.TTMSFNCTreeViewGroupsAppearance).FBottomVerticalTextAlign;
        this.FTopVerticalText = rtl.as(Source,$mod.TTMSFNCTreeViewGroupsAppearance).FTopVerticalText;
        this.FBottomVerticalText = rtl.as(Source,$mod.TTMSFNCTreeViewGroupsAppearance).FBottomVerticalText;
        this.FFillEmptySpaces = rtl.as(Source,$mod.TTMSFNCTreeViewGroupsAppearance).FFillEmptySpaces;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Layouts",2,$mod.$rtti["TTMSFNCTreeViewGroupsLayouts"],"FLayouts","SetLayouts",4,{Default: rtl.createSet($mod.TTMSFNCTreeViewGroupLayout.tglTop)});
    $r.addProperty("TopSize",2,rtl.double,"FTopSize","SetTopSize");
    $r.addProperty("BottomSize",2,rtl.double,"FBottomSize","SetBottomSize");
    $r.addProperty("TopFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FTopFill","SetTopFill");
    $r.addProperty("BottomFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FBottomFill","SetBottomFill");
    $r.addProperty("TopFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FTopFont","SetTopFont");
    $r.addProperty("BottomFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FBottomFont","SetBottomFont");
    $r.addProperty("TopStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FTopStroke","SetTopStroke");
    $r.addProperty("BottomStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FBottomStroke","SetBottomStroke");
    $r.addProperty("TopHorizontalTextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FTopHorizontalTextAlign","SetTopHorizontalTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter});
    $r.addProperty("TopVerticalTextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FTopVerticalTextAlign","SetTopVerticalTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter});
    $r.addProperty("BottomHorizontalTextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FBottomHorizontalTextAlign","SetBottomHorizontalTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter});
    $r.addProperty("BottomVerticalTextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FBottomVerticalTextAlign","SetBottomVerticalTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter});
    $r.addProperty("TopVerticalText",2,rtl.boolean,"FTopVerticalText","SetTopVerticalText",4,{Default: false});
    $r.addProperty("BottomVerticalText",2,rtl.boolean,"FBottomVerticalText","SetBottomVerticalText",4,{Default: false});
    $r.addProperty("FillEmptySpaces",2,rtl.boolean,"FFillEmptySpaces","SetFillEmptySpaces",4,{Default: true});
  });
  this.$rtti.$MethodVar("TTMSFNCTreeViewBeforeDrawSortIndicatorEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AColumn",rtl.longint],["ASortIndex",rtl.longint],["ASortKind",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewNodesSortKind"]],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewAfterDrawSortIndicatorEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AColumn",rtl.longint],["ASortIndex",rtl.longint],["ASortKind",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewNodesSortKind"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewNodeCompareEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Node1",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewNode"]],["Node2",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewNode"]],["AColumn",rtl.longint],["ACompareResult",rtl.longint,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewBeforeSizeColumnEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["AColumnSize",rtl.double],["ANewColumnSize",rtl.double,1],["AAllow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewAfterSizeColumnEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["AColumnSize",rtl.double]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewBeforeDrawColumnEmptySpaceEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["ASpace",this.$rtti["TTMSFNCTreeViewColumnEmptySpace"]],["AAllow",rtl.boolean,1],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewAfterDrawColumnEmptySpaceEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["ASpace",this.$rtti["TTMSFNCTreeViewColumnEmptySpace"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewBeforeDrawGroupEmptySpaceEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["ASpace",this.$rtti["TTMSFNCTreeViewGroupEmptySpace"]],["AAllow",rtl.boolean,1],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewAfterDrawGroupEmptySpaceEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["ASpace",this.$rtti["TTMSFNCTreeViewGroupEmptySpace"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewNeedFilterDropDownDataEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["AValues",pas.Classes.$rtti["TStrings"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewBeforeDrawColumnEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AColumn",rtl.longint],["AAllow",rtl.boolean,1],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewAfterDrawColumnEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AColumn",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewBeforeDrawColumnHeaderEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AColumn",rtl.longint],["AKind",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewCacheItemKind"]],["AAllow",rtl.boolean,1],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewAfterDrawColumnHeaderEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AColumn",rtl.longint],["AKind",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewCacheItemKind"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewBeforeDrawGroupEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AGroup",rtl.longint],["AStartColumn",rtl.longint],["AEndColumn",rtl.longint],["AKind",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewCacheItemKind"]],["AAllow",rtl.boolean,1],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewAfterDrawGroupEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AGroup",rtl.longint],["AStartColumn",rtl.longint],["AEndColumn",rtl.longint],["AKind",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewCacheItemKind"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewBeforeDrawNodeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AAllow",rtl.boolean,1],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewAfterDrawNodeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewGetNumberOfNodesEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["ANumberOfNodes",rtl.longint,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewGetColumnTextEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["AKind",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewCacheItemKind"]],["AText",rtl.string,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewBeforeDrawColumnTextEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AColumn",rtl.longint],["AKind",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewCacheItemKind"]],["AText",rtl.string],["AAllow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewAfterDrawColumnTextEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AColumn",rtl.longint],["AKind",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewCacheItemKind"]],["AText",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewGetGroupTextEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGroup",rtl.longint],["AKind",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewCacheItemKind"]],["AText",rtl.string,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewBeforeDrawGroupTextEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AGroup",rtl.longint],["AStartColumn",rtl.longint],["AEndColumn",rtl.longint],["AKind",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewCacheItemKind"]],["AText",rtl.string],["AAllow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewAfterDrawGroupTextEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AGroup",rtl.longint],["AStartColumn",rtl.longint],["AEndColumn",rtl.longint],["AKind",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewCacheItemKind"]],["AText",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewNodeAnchorClickEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AColumn",rtl.longint],["AAnchor",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewNodeTitleAnchorClickEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AColumn",rtl.longint],["AAnchor",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewNodeChangedEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewGetNodeTextEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AColumn",rtl.longint],["AMode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewNodeTextMode"]],["AText",rtl.string,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewGetNodeDataEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewGetNodeTitleEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AColumn",rtl.longint],["AMode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewNodeTextMode"]],["ATitle",rtl.string,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewGetNodeTitleExpandedEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AColumn",rtl.longint],["AExpanded",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewGetNodeSidesEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["ASides",pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsSides"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewGetNodeRoundingEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["ARounding",rtl.longint,1],["ACorners",pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsCorners"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewGetNodeTrimmingEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AColumn",rtl.longint],["ATrimming",pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextTrimming"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewGetNodeHorizontalTextAlignEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AColumn",rtl.longint],["AHorizontalTextAlign",pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewGetNodeVerticalTextAlignEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AColumn",rtl.longint],["AVerticalTextAlign",pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewGetNodeWordWrappingEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AColumn",rtl.longint],["AWordWrapping",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewGetNodeExtraSizeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AColumn",rtl.longint],["AExtraSize",rtl.double,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewGetNodeTitleExtraSizeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AColumn",rtl.longint],["ATitleExtraSize",rtl.double,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewGetColumnTrimmingEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["AKind",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewCacheItemKind"]],["ATrimming",pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextTrimming"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewGetColumnHorizontalTextAlignEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["AKind",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewCacheItemKind"]],["AHorizontalTextAlign",pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewGetColumnVerticalTextAlignEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["AKind",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewCacheItemKind"]],["AVerticalTextAlign",pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewGetColumnWordWrappingEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["AKind",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewCacheItemKind"]],["AWordWrapping",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewGetNodeIconEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AColumn",rtl.longint],["ALarge",rtl.boolean],["AIcon",pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewGetNodeIconSizeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AColumn",rtl.longint],["ALarge",rtl.boolean],["AIcon",pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"]],["AIconWidth",rtl.double,1],["AIconHeight",rtl.double,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewFocusedNodeChangedEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewGetNodeHeightEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AColumn",rtl.longint],["AHeight",rtl.double,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewBeforeDrawNodeTextEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AColumn",rtl.longint],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AText",rtl.string],["AAllow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewAfterDrawNodeTextEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AColumn",rtl.longint],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AText",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewBeforeDrawNodeTitleEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AColumn",rtl.longint],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["ATitle",rtl.string],["AAllow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewAfterDrawNodeTitleEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AColumn",rtl.longint],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["ATitle",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewBeforeDrawNodeExpandEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AColumn",rtl.longint],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AExpand",pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"]],["AAllow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewAfterDrawNodeExpandEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AColumn",rtl.longint],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AExpand",pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewBeforeDrawNodeIconEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AColumn",rtl.longint],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AIcon",pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"]],["AAllow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewAfterDrawNodeIconEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AColumn",rtl.longint],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AIcon",pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewBeforeDrawNodeExtraEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AColumn",rtl.longint],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AAllow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewAfterDrawNodeExtraEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AColumn",rtl.longint],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewDrawNodeExtraEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AColumn",rtl.longint],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewBeforeDrawNodeTitleExtraEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AColumn",rtl.longint],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AAllow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewAfterDrawNodeTitleExtraEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AColumn",rtl.longint],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewDrawNodeTitleExtraEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AColumn",rtl.longint],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewBeforeDrawNodeCheckEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AColumn",rtl.longint],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["ACheck",pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"]],["AAllow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewAfterDrawNodeCheckEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AColumn",rtl.longint],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["ACheck",pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewGetNodeColorEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AColor",pas["WEBLib.Graphics"].$rtti["TColor"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewGetNodeCheckTypeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AColumn",rtl.longint],["ACheckType",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewNodeCheckType"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewGetNodeTextColorEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AColumn",rtl.longint],["ATextColor",pas["WEBLib.Graphics"].$rtti["TColor"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewGetNodeTitleColorEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AColumn",rtl.longint],["ATitleColor",pas["WEBLib.Graphics"].$rtti["TColor"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewIsNodeExtendedEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AExtended",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewColumnAnchorClickEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["AAnchor",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewCustomizeFilterListBoxEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["AListBox",pas["WEBLib.StdCtrls"].$rtti["TListBox"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewIsNodeDeletableEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["ADeletable",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewIsNodeCheckedEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AColumn",rtl.longint],["AChecked",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewIsNodeExpandedEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AExpanded",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewIsNodeVisibleEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AVisible",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewIsNodeEnabledEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AEnabled",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewBeforeUpdateNodeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AColumn",rtl.longint],["AText",rtl.string,1],["ACanUpdate",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewAfterUpdateNodeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AColumn",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewBeforeCollapseNodeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["ACanCollapse",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewAfterCollapseNodeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewBeforeExpandNodeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["ACanExpand",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewAfterExpandNodeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewBeforeCheckNodeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AColumn",rtl.longint],["ACanCheck",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewAfterCheckNodeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AColumn",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewBeforeUnCheckNodeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AColumn",rtl.longint],["ACanUnCheck",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewAfterUnCheckNodeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AColumn",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewBeforeSelectAllNodesEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACanSelect",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewAfterSelectAllNodesEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewBeforeSelectNodeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["ACanSelect",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewAfterSelectNodeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewBeforeUnSelectNodeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["ACanUnSelect",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewAfterUnSelectNodeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewNodeClickEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewNodeValueClickEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AColumn",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewNodeMouseEnterEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewNodeMouseLeaveEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewScrollEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["APosition",rtl.double]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewBeforeAddJSONNodeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AJSONValue",pas["WEBLib.JSON"].$rtti["TJSONValue"]],["AAddNode",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewAfterAddJSONNodeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewNode"]],["AJSONValue",pas["WEBLib.JSON"].$rtti["TJSONValue"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewGetHTMLTemplateValueEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANodeValue",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewNodeValue"]],["AName",rtl.string],["AValue",rtl.string,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewGetHTMLTemplateEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANodeValue",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewNodeValue"]],["AColumnIndex",rtl.longint],["AHTMLTemplate",rtl.string,1]]), methodkind: 0});
  this.$rtti.$ClassRef("TTMSFNCTreeViewInplaceEditorClass",{instancetype: pas["WEBLib.Controls"].$rtti["TWinControl"]});
  this.$rtti.$MethodVar("TTMSFNCTreeViewCustomizeInplaceEditorEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AColumn",rtl.longint],["AInplaceEditor",pas["WEBLib.Controls"].$rtti["TWinControl"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewGetInplaceEditorRectEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AColumn",rtl.longint],["AInplaceEditor",pas["WEBLib.Controls"].$rtti["TWinControl"]],["AInplaceEditorRect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewGetInplaceEditorEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AColumn",rtl.longint],["AInplaceEditorClass",this.$rtti["TTMSFNCTreeViewInplaceEditorClass"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewBeforeOpenInplaceEditorEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AColumn",rtl.longint],["ACanOpen",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewAfterOpenInplaceEditorEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AColumn",rtl.longint],["AInplaceEditor",pas["WEBLib.Controls"].$rtti["TWinControl"]],["AInplaceEditorRect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewCloseInplaceEditorEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AColumn",rtl.longint],["AInplaceEditor",pas["WEBLib.Controls"].$rtti["TWinControl"]],["ACancelled",rtl.boolean],["ACanClose",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewBeforeReorderNodeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFromNode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AToNode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["ACanReorder",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewAfterReorderNodeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFromNode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AToNode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewBeforeSortNodesEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ASortColumn",rtl.longint],["ASortMode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewNodesSortMode"]],["ACanSort",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewAfterSortNodesEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ASortColumn",rtl.longint],["ASortMode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewNodesSortMode"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewBeforeDropNodeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFromNode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AToNode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["ACanDrop",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewAfterDropNodeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFromNode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AToNode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewBeforeCopyToClipboardEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACanCopy",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewBeforeCutToClipboardEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACanCut",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewBeforePasteFromClipboardEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACanPaste",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewAfterCopyToClipboardEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewAfterCutToClipboardEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewAfterPasteFromClipboardEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewFilterSelectEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["ACondition",rtl.string,1]]), methodkind: 0});
  this.TTMSFNCTreeViewMouseEditMode = {"0": "tmemDoubleClick", tmemDoubleClick: 0, "1": "tmemSingleClick", tmemSingleClick: 1, "2": "tmemSingleClickOnSelectedNode", tmemSingleClickOnSelectedNode: 2};
  this.$rtti.$Enum("TTMSFNCTreeViewMouseEditMode",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCTreeViewMouseEditMode});
  this.TTMSFNCTreeViewClipboardMode = {"0": "tcmNone", tcmNone: 0, "1": "tcmTextOnly", tcmTextOnly: 1, "2": "tcmFull", tcmFull: 2};
  this.$rtti.$Enum("TTMSFNCTreeViewClipboardMode",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCTreeViewClipboardMode});
  this.TTMSFNCTreeViewDragDropMode = {"0": "tdmNone", tdmNone: 0, "1": "tdmMove", tdmMove: 1, "2": "tdmCopy", tdmCopy: 2};
  this.$rtti.$Enum("TTMSFNCTreeViewDragDropMode",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCTreeViewDragDropMode});
  this.TMultiSelectStyles = {"0": "msControlSelect", msControlSelect: 0, "1": "msShiftSelect", msShiftSelect: 1, "2": "msVisibleOnly", msVisibleOnly: 2, "3": "msSiblingOnly", msSiblingOnly: 3};
  this.$rtti.$Enum("TMultiSelectStyles",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TMultiSelectStyles});
  this.$rtti.$Set("TMultiSelectStyle",{comptype: this.$rtti["TMultiSelectStyles"]});
  this.$rtti.$Class("TTMSFNCTreeViewInteraction");
  rtl.createClass(this,"TTMSFNCTreeViewLookup",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FOwner = null;
      this.FEnabled = false;
      this.FCaseSensitive = false;
      this.FIncremental = false;
      this.FColumn = 0;
      this.FAutoSelect = false;
      this.FRootNodesOnly = false;
      this.FAutoExpand = false;
      this.FVisibleNodesOnly = false;
    };
    this.$final = function () {
      this.FOwner = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.Create$1 = function (AOwner) {
      this.FOwner = AOwner;
      this.FEnabled = true;
      this.FCaseSensitive = false;
      this.FIncremental = true;
      this.FColumn = -1;
      this.FAutoSelect = true;
      this.FAutoExpand = false;
      this.FRootNodesOnly = false;
      this.FVisibleNodesOnly = false;
      return this;
    };
    this.Destroy = function () {
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCTreeViewLookup.isPrototypeOf(Source)) {
        this.FEnabled = rtl.as(Source,$mod.TTMSFNCTreeViewLookup).FEnabled;
        this.FCaseSensitive = rtl.as(Source,$mod.TTMSFNCTreeViewLookup).FCaseSensitive;
        this.FIncremental = rtl.as(Source,$mod.TTMSFNCTreeViewLookup).FIncremental;
        this.FColumn = rtl.as(Source,$mod.TTMSFNCTreeViewLookup).FColumn;
        this.FAutoSelect = rtl.as(Source,$mod.TTMSFNCTreeViewLookup).FAutoSelect;
        this.FAutoExpand = rtl.as(Source,$mod.TTMSFNCTreeViewLookup).FAutoExpand;
        this.FRootNodesOnly = rtl.as(Source,$mod.TTMSFNCTreeViewLookup).FRootNodesOnly;
        this.FVisibleNodesOnly = rtl.as(Source,$mod.TTMSFNCTreeViewLookup).FVisibleNodesOnly;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("CaseSensitive",0,rtl.boolean,"FCaseSensitive","FCaseSensitive",4,{Default: false});
    $r.addProperty("Enabled",0,rtl.boolean,"FEnabled","FEnabled",4,{Default: true});
    $r.addProperty("Incremental",0,rtl.boolean,"FIncremental","FIncremental",4,{Default: true});
    $r.addProperty("Column",0,rtl.longint,"FColumn","FColumn",4,{Default: -1});
    $r.addProperty("RootNodesOnly",0,rtl.boolean,"FRootNodesOnly","FRootNodesOnly",4,{Default: false});
    $r.addProperty("VisibleNodesOnly",0,rtl.boolean,"FVisibleNodesOnly","FVisibleNodesOnly",4,{Default: false});
    $r.addProperty("AutoExpand",0,rtl.boolean,"FAutoExpand","FAutoExpand",4,{Default: false});
    $r.addProperty("AutoSelect",0,rtl.boolean,"FAutoSelect","FAutoSelect",4,{Default: true});
  });
  rtl.createClass(this,"TTMSFNCTreeViewInteraction",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FTreeView = null;
      this.FMultiSelect = false;
      this.FTouchScrolling = false;
      this.FReadOnly = false;
      this.FColumnSizing = false;
      this.FColumnAutoSizeOnDblClick = false;
      this.FExtendedSelectable = false;
      this.FSelectionFollowsFocus = false;
      this.FKeyboardEdit = false;
      this.FMouseEditMode = 0;
      this.FExtendedEditable = false;
      this.FClipboardMode = 0;
      this.FReorder = false;
      this.FDragDropMode = 0;
      this.FLookup = null;
      this.FExpandCollapseOnDblClick = false;
      this.FAutoOpenURL = false;
      this.FURLDetectionOnMouseMove = false;
      this.FMouseWheelDelta = 0.0;
      this.FAnimationFactor = 0.0;
      this.FMultiSelectStyle = {};
    };
    this.$final = function () {
      this.FTreeView = undefined;
      this.FLookup = undefined;
      this.FMultiSelectStyle = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetMultiSelect = function (Value) {
      if (this.FMultiSelect !== Value) this.FMultiSelect = Value;
    };
    this.SetTouchScrolling = function (Value) {
      if (this.FTouchScrolling !== Value) this.FTouchScrolling = Value;
    };
    this.SetReadOnly = function (Value) {
      if (this.FReadOnly !== Value) this.FReadOnly = Value;
    };
    this.SetColumnSizing = function (Value) {
      if (this.FColumnSizing !== Value) {
        this.FColumnSizing = Value;
        if ((this.FTreeView != null) && this.FColumnSizing) this.FTreeView.FColumnsAppearance.SetStretchAll(false);
      };
    };
    this.SetColumnAutoSizeOnDblClick = function (Value) {
      if (this.FColumnAutoSizeOnDblClick !== Value) this.FColumnAutoSizeOnDblClick = Value;
    };
    this.SetExtendedSelectable = function (Value) {
      if (this.FExtendedSelectable !== Value) this.FExtendedSelectable = Value;
    };
    this.SetSelectionFollowsFocus = function (Value) {
      if (this.FSelectionFollowsFocus !== Value) this.FSelectionFollowsFocus = Value;
    };
    this.SetMouseEditMode = function (Value) {
      if (this.FMouseEditMode !== Value) this.FMouseEditMode = Value;
    };
    this.SetExtendedEditable = function (Value) {
      if (this.FExtendedEditable !== Value) this.FExtendedEditable = Value;
    };
    this.SetDragDropMode = function (Value) {
      if (this.FDragDropMode !== Value) this.FDragDropMode = Value;
    };
    this.SetReorder = function (Value) {
      if (this.FReorder !== Value) this.FReorder = Value;
    };
    this.SetLookup = function (Value) {
      if (this.FLookup !== Value) this.FLookup.Assign(Value);
    };
    this.SetExpandCollapseOnDblClick = function (Value) {
      if (this.FExpandCollapseOnDblClick !== Value) this.FExpandCollapseOnDblClick = Value;
    };
    this.SetURLDetectionOnMouseMove = function (Value) {
      if (this.FURLDetectionOnMouseMove !== Value) {
        this.FURLDetectionOnMouseMove = Value;
      };
    };
    this.IsMouseWheelDeltaStored = function () {
      var Result = false;
      Result = this.FMouseWheelDelta !== 1;
      return Result;
    };
    this.SetMouseWheelDelta = function (Value) {
      this.FMouseWheelDelta = Value;
    };
    this.IsAnimationFactorStored = function () {
      var Result = false;
      Result = this.FAnimationFactor !== 2.5;
      return Result;
    };
    this.SetMultiSelectStyle = function (Value) {
      if (rtl.neSet(Value,this.FMultiSelectStyle)) {
        this.FMultiSelectStyle = rtl.refSet(Value);
      };
    };
    this.Create$1 = function (ATreeView) {
      this.FTreeView = ATreeView;
      this.FAutoOpenURL = true;
      this.FAnimationFactor = 2.5;
      this.FMouseWheelDelta = 1;
      this.FClipboardMode = $mod.TTMSFNCTreeViewClipboardMode.tcmNone;
      this.FExpandCollapseOnDblClick = true;
      this.FReorder = false;
      this.FDragDropMode = $mod.TTMSFNCTreeViewDragDropMode.tdmNone;
      this.FReadOnly = false;
      this.FURLDetectionOnMouseMove = true;
      this.FSelectionFollowsFocus = true;
      this.FTouchScrolling = true;
      this.FKeyboardEdit = true;
      this.FExtendedSelectable = false;
      this.FMultiSelect = false;
      this.FColumnSizing = false;
      this.FExtendedEditable = false;
      this.FColumnAutoSizeOnDblClick = false;
      this.FMouseEditMode = $mod.TTMSFNCTreeViewMouseEditMode.tmemSingleClickOnSelectedNode;
      this.FLookup = $mod.TTMSFNCTreeViewLookup.$create("Create$1",[this]);
      this.FMultiSelectStyle = rtl.createSet($mod.TMultiSelectStyles.msControlSelect,$mod.TMultiSelectStyles.msShiftSelect);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FLookup");
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCTreeViewInteraction.isPrototypeOf(Source)) {
        this.FMultiSelect = rtl.as(Source,$mod.TTMSFNCTreeViewInteraction).FMultiSelect;
        this.FTouchScrolling = rtl.as(Source,$mod.TTMSFNCTreeViewInteraction).FTouchScrolling;
        this.FReadOnly = rtl.as(Source,$mod.TTMSFNCTreeViewInteraction).FReadOnly;
        this.FColumnSizing = rtl.as(Source,$mod.TTMSFNCTreeViewInteraction).FColumnSizing;
        this.FColumnAutoSizeOnDblClick = rtl.as(Source,$mod.TTMSFNCTreeViewInteraction).FColumnAutoSizeOnDblClick;
        this.FExtendedSelectable = rtl.as(Source,$mod.TTMSFNCTreeViewInteraction).FExtendedSelectable;
        this.FSelectionFollowsFocus = rtl.as(Source,$mod.TTMSFNCTreeViewInteraction).FSelectionFollowsFocus;
        this.FKeyboardEdit = rtl.as(Source,$mod.TTMSFNCTreeViewInteraction).FKeyboardEdit;
        this.FMouseEditMode = rtl.as(Source,$mod.TTMSFNCTreeViewInteraction).FMouseEditMode;
        this.FExtendedEditable = rtl.as(Source,$mod.TTMSFNCTreeViewInteraction).FExtendedEditable;
        this.FClipboardMode = rtl.as(Source,$mod.TTMSFNCTreeViewInteraction).FClipboardMode;
        this.FReorder = rtl.as(Source,$mod.TTMSFNCTreeViewInteraction).FReorder;
        this.FDragDropMode = rtl.as(Source,$mod.TTMSFNCTreeViewInteraction).FDragDropMode;
        this.FLookup.Assign(rtl.as(Source,$mod.TTMSFNCTreeViewInteraction).FLookup);
        this.FExpandCollapseOnDblClick = rtl.as(Source,$mod.TTMSFNCTreeViewInteraction).FExpandCollapseOnDblClick;
        this.FAutoOpenURL = rtl.as(Source,$mod.TTMSFNCTreeViewInteraction).FAutoOpenURL;
        this.FURLDetectionOnMouseMove = rtl.as(Source,$mod.TTMSFNCTreeViewInteraction).FURLDetectionOnMouseMove;
        this.FMouseWheelDelta = rtl.as(Source,$mod.TTMSFNCTreeViewInteraction).FMouseWheelDelta;
        this.FAnimationFactor = rtl.as(Source,$mod.TTMSFNCTreeViewInteraction).FAnimationFactor;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("AnimationFactor",12,rtl.double,"FAnimationFactor","FAnimationFactor",4,{stored: "IsAnimationFactorStored"});
    $r.addProperty("AutoOpenURL",0,rtl.boolean,"FAutoOpenURL","FAutoOpenURL",4,{Default: true});
    $r.addProperty("MultiSelect",2,rtl.boolean,"FMultiSelect","SetMultiSelect",4,{Default: false});
    $r.addProperty("MultiSelectStyle",2,$mod.$rtti["TMultiSelectStyle"],"FMultiSelectStyle","SetMultiSelectStyle",4,{Default: rtl.createSet($mod.TMultiSelectStyles.msControlSelect,$mod.TMultiSelectStyles.msShiftSelect)});
    $r.addProperty("ExtendedSelectable",2,rtl.boolean,"FExtendedSelectable","SetExtendedSelectable",4,{Default: false});
    $r.addProperty("ExtendedEditable",2,rtl.boolean,"FExtendedEditable","SetExtendedEditable",4,{Default: false});
    $r.addProperty("MouseEditMode",2,$mod.$rtti["TTMSFNCTreeViewMouseEditMode"],"FMouseEditMode","SetMouseEditMode",4,{Default: $mod.TTMSFNCTreeViewMouseEditMode.tmemSingleClickOnSelectedNode});
    $r.addProperty("MouseWheelDelta",14,rtl.double,"FMouseWheelDelta","SetMouseWheelDelta",4,{stored: "IsMouseWheelDeltaStored"});
    $r.addProperty("TouchScrolling",2,rtl.boolean,"FTouchScrolling","SetTouchScrolling",4,{Default: true});
    $r.addProperty("KeyboardEdit",0,rtl.boolean,"FKeyboardEdit","FKeyboardEdit",4,{Default: true});
    $r.addProperty("ReadOnly",2,rtl.boolean,"FReadOnly","SetReadOnly",4,{Default: false});
    $r.addProperty("ExpandCollapseOnDblClick",2,rtl.boolean,"FExpandCollapseOnDblClick","SetExpandCollapseOnDblClick",4,{Default: true});
    $r.addProperty("ColumnSizing",2,rtl.boolean,"FColumnSizing","SetColumnSizing",4,{Default: false});
    $r.addProperty("ColumnAutoSizeOnDblClick",2,rtl.boolean,"FColumnAutoSizeOnDblClick","SetColumnAutoSizeOnDblClick",4,{Default: false});
    $r.addProperty("ClipboardMode",0,$mod.$rtti["TTMSFNCTreeViewClipboardMode"],"FClipboardMode","FClipboardMode",4,{Default: $mod.TTMSFNCTreeViewClipboardMode.tcmNone});
    $r.addProperty("Reorder",2,rtl.boolean,"FReorder","SetReorder",4,{Default: false});
    $r.addProperty("DragDropMode",2,$mod.$rtti["TTMSFNCTreeViewDragDropMode"],"FDragDropMode","SetDragDropMode",4,{Default: $mod.TTMSFNCTreeViewDragDropMode.tdmNone});
    $r.addProperty("Lookup",2,$mod.$rtti["TTMSFNCTreeViewLookup"],"FLookup","SetLookup");
    $r.addProperty("URLDetectionOnMouseMove",2,rtl.boolean,"FURLDetectionOnMouseMove","SetURLDetectionOnMouseMove",4,{Default: true});
  });
  rtl.recNewT(this,"TTMSFNCTreeViewSceneDrawingScale",function () {
    this.SceneScale = 0.0;
    this.$new = function () {
      var r = Object.create(this);
      r.DrawingScale = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      return r;
    };
    this.$eq = function (b) {
      return (this.SceneScale === b.SceneScale) && this.DrawingScale.$eq(b.DrawingScale);
    };
    this.$assign = function (s) {
      this.SceneScale = s.SceneScale;
      this.DrawingScale.$assign(s.DrawingScale);
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCTreeViewSceneDrawingScale",{},this);
    $r.addField("SceneScale",rtl.double);
    $r.addField("DrawingScale",pas["WEBLib.TMSFNCTypes"].$rtti["TPointF"]);
  });
  rtl.createClass(this,"TTMSFNCTreeViewSelectedNodes",pas.Classes.TList,function () {
    this.GetItem = function (Index) {
      var Result = null;
      Result = rtl.getObject(this.Get(Index));
      return Result;
    };
    this.SetItem = function (Index, Value) {
      this.Put(Index,Value);
    };
  });
  this.$rtti.$DynArray("TTMSFNCTreeViewNodeArray",{eltype: pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewNode"]});
  rtl.recNewT(this,"TTMSFNCTreeViewNodeCheck",function () {
    this.AColumn = 0;
    this.ANode = null;
    this.$eq = function (b) {
      return (this.AColumn === b.AColumn) && (this.ANode === b.ANode);
    };
    this.$assign = function (s) {
      this.AColumn = s.AColumn;
      this.ANode = s.ANode;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCTreeViewNodeCheck",{},this);
    $r.addField("AColumn",rtl.longint);
    $r.addField("ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]);
  });
  rtl.recNewT(this,"TTMSFNCTreeViewNodeIcon",function () {
    this.AColumn = 0;
    this.ANode = null;
    this.$eq = function (b) {
      return (this.AColumn === b.AColumn) && (this.ANode === b.ANode);
    };
    this.$assign = function (s) {
      this.AColumn = s.AColumn;
      this.ANode = s.ANode;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCTreeViewNodeIcon",{},this);
    $r.addField("AColumn",rtl.longint);
    $r.addField("ANode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]);
  });
  rtl.recNewT(this,"TTMSFNCTreeViewNodeAnchor",function () {
    this.AAnchor = "";
    this.AColumn = 0;
    this.$eq = function (b) {
      return (this.AAnchor === b.AAnchor) && (this.AColumn === b.AColumn);
    };
    this.$assign = function (s) {
      this.AAnchor = s.AAnchor;
      this.AColumn = s.AColumn;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCTreeViewNodeAnchor",{},this);
    $r.addField("AAnchor",rtl.string);
    $r.addField("AColumn",rtl.longint);
  });
  rtl.createClass(this,"TTMSFNCTreeViewComboBox",pas["WEBLib.StdCtrls"].TComboBox,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCTreeViewMemo",pas["WEBLib.StdCtrls"].TMemo,function () {
    this.$init = function () {
      pas["WEBLib.StdCtrls"].TMemo.$init.call(this);
      this.FTreeView = null;
    };
    this.$final = function () {
      this.FTreeView = undefined;
      pas["WEBLib.StdCtrls"].TMemo.$final.call(this);
    };
    this.KeyDown = function (Key, Shift) {
      pas["WEBLib.Controls"].TControl.KeyDown.apply(this,arguments);
      if ((this.FTreeView != null) && this.FTreeView.FInplaceEditorActive) {
        var $tmp = Key.get();
        if ($tmp === 27) {
          this.FTreeView.CloseInplaceEditor(true,true);
          Key.set(0);
        } else if ($tmp === 113) {
          this.FTreeView.CloseInplaceEditor(false,true);
          Key.set(0);
        };
      };
    };
    this.DoExit = function () {
      pas["WEBLib.Controls"].TControl.DoExit.call(this);
      if ((this.FTreeView != null) && this.FTreeView.FInplaceEditorActive) this.FTreeView.CloseInplaceEditor(false,false);
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.Controls"].TControl.Create$1.apply(this,arguments);
      if ($mod.TTMSFNCCustomTreeView.isPrototypeOf(AOwner)) this.FTreeView = rtl.as(AOwner,$mod.TTMSFNCCustomTreeView);
      return this;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCTreeViewEdit",pas["WEBLib.StdCtrls"].TEdit,function () {
    this.$init = function () {
      pas["WEBLib.StdCtrls"].TEdit.$init.call(this);
      this.FTreeView = null;
    };
    this.$final = function () {
      this.FTreeView = undefined;
      pas["WEBLib.StdCtrls"].TEdit.$final.call(this);
    };
    this.KeyDown = function (Key, Shift) {
      pas["WEBLib.Controls"].TControl.KeyDown.apply(this,arguments);
      if ((this.FTreeView != null) && this.FTreeView.FInplaceEditorActive) {
        var $tmp = Key.get();
        if ($tmp === 27) {
          this.FTreeView.CloseInplaceEditor(true,true);
          Key.set(0);
        } else if (($tmp === 113) || ($tmp === 13)) {
          this.FTreeView.CloseInplaceEditor(false,true);
          Key.set(0);
        };
      };
    };
    this.DoExit = function () {
      pas["WEBLib.Controls"].TControl.DoExit.call(this);
      if ((this.FTreeView != null) && this.FTreeView.FInplaceEditorActive) this.FTreeView.CloseInplaceEditor(false,false);
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.Controls"].TControl.Create$1.apply(this,arguments);
      if ($mod.TTMSFNCCustomTreeView.isPrototypeOf(AOwner)) this.FTreeView = rtl.as(AOwner,$mod.TTMSFNCCustomTreeView);
      return this;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCTreeViewCopyNodes",pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodes,function () {
  });
  this.$rtti.$MethodVar("TTMSFNCTreeViewDragOverEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Source",pas.System.$rtti["TObject"]],["Point",pas["WEBLib.TMSFNCTypes"].$rtti["TPointF"]],["Accept",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewDragDropEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Source",pas.System.$rtti["TObject"]],["Point",pas["WEBLib.TMSFNCTypes"].$rtti["TPointF"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewColumnSortEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["ASortMode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewNodesSortMode"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewLookupEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ALookupString",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTreeViewReorderEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFromNode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]],["AToNode",pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewVirtualNode"]]]), methodkind: 0});
  this.TTMSFNCTreeViewExportState = {"0": "tvesExportStart", tvesExportStart: 0, "1": "tvesExportNewRow", tvesExportNewRow: 1, "2": "tvesExportDone", tvesExportDone: 2, "3": "tvesExportSelRow", tvesExportSelRow: 3, "4": "tvesExportFail", tvesExportFail: 4, "5": "tvesExportNextRow", tvesExportNextRow: 5, "6": "tvesExportFindRow", tvesExportFindRow: 6};
  this.$rtti.$Enum("TTMSFNCTreeViewExportState",{minvalue: 0, maxvalue: 6, ordtype: 1, enumtype: this.TTMSFNCTreeViewExportState});
  rtl.createClass(this,"TTMSFNCTreeViewAdapter",pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.$init.call(this);
      this.FBlockAdd = false;
      this.FTreeView = null;
      this.FActive = false;
    };
    this.$final = function () {
      this.FTreeView = undefined;
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.$final.call(this);
    };
    this.SetActive = function (Value) {
      this.FActive = Value;
      if (!(this.FTreeView != null)) return;
      this.Initialize();
    };
    this.SetTreeView = function (Value) {
      if (this.FTreeView !== Value) {
        this.FTreeView = Value;
        if (this.FBlockAdd) return;
        this.FBlockAdd = true;
        if (this.FTreeView != null) {
          this.FTreeView.SetAdapter(this);
          this.Initialize();
        };
        this.FBlockAdd = false;
      };
    };
    this.GetInstance = function () {
      var Result = 0;
      Result = pas["WEBLib.TMSFNCTypes"].HInstance();
      return Result;
    };
    this.GetNumberOfNodes = function (ANode, ANumberOfNodes) {
    };
    this.Notification = function (AComponent, Operation) {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.Notification.apply(this,arguments);
      if ((Operation === pas.Classes.TOperation.opRemove) && (AComponent === this.FTreeView)) this.FTreeView = null;
    };
    this.UpdateBounds = function () {
    };
    this.Initialize = function () {
    };
    this.ScrollTreeView = function (ADelta) {
    };
    this.SelectNode = function (ANode) {
    };
    this.GetNodeText = function (ACol, ANode, AText) {
    };
    this.ExportNotification = function (AState, ARow) {
    };
    this.GetColumnDisplayName = function (ACol) {
      var Result = "";
      Result = "";
      return Result;
    };
    this.Create$1 = function (AOwner) {
      var I = 0;
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.Create$1.apply(this,arguments);
      this.FActive = false;
      if (this.IsDesignTime() && (AOwner != null) && pas["WEBLib.Forms"].TCustomForm.isPrototypeOf(AOwner)) {
        for (var $l = 0, $end = AOwner.GetComponentCount() - 1; $l <= $end; $l++) {
          I = $l;
          if ($mod.TTMSFNCCustomTreeView.isPrototypeOf(AOwner.GetComponent(I))) {
            this.SetTreeView(rtl.as(AOwner.GetComponent(I),$mod.TTMSFNCCustomTreeView));
            break;
          };
        };
      };
      return this;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Active",2,rtl.boolean,"FActive","SetActive",4,{Default: false});
    $r.addProperty("TreeView",2,$mod.$rtti["TTMSFNCCustomTreeView"],"FTreeView","SetTreeView");
  });
  rtl.createClass(this,"TTMSFNCTreeViewViewJSONOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FValueHTMLTemplate = "";
      this.FExpandNodes = false;
      this.FNameHTMLTemplate = "";
      this.FOnChange = null;
      this.FStretchColumn = 0;
      this.FArrayItemPrefix = "";
      this.FArrayItemSuffix = "";
    };
    this.$final = function () {
      this.FOnChange = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.Changed = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Create$1 = function () {
      this.FExpandNodes = true;
      this.FStretchColumn = 1;
      this.FNameHTMLTemplate = "<#NAME>";
      this.FValueHTMLTemplate = "<#VALUE>";
      this.FArrayItemPrefix = "";
      this.FArrayItemSuffix = "";
      return this;
    };
    this.Destroy = function () {
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCTreeViewViewJSONOptions.isPrototypeOf(Source)) {
        this.FExpandNodes = rtl.as(Source,$mod.TTMSFNCTreeViewViewJSONOptions).FExpandNodes;
        this.FStretchColumn = rtl.as(Source,$mod.TTMSFNCTreeViewViewJSONOptions).FStretchColumn;
        this.FNameHTMLTemplate = rtl.as(Source,$mod.TTMSFNCTreeViewViewJSONOptions).FNameHTMLTemplate;
        this.FValueHTMLTemplate = rtl.as(Source,$mod.TTMSFNCTreeViewViewJSONOptions).FValueHTMLTemplate;
        this.FArrayItemPrefix = rtl.as(Source,$mod.TTMSFNCTreeViewViewJSONOptions).FArrayItemPrefix;
        this.FArrayItemSuffix = rtl.as(Source,$mod.TTMSFNCTreeViewViewJSONOptions).FArrayItemSuffix;
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    var $r = this.$rtti;
    $r.addProperty("ExpandNodes",0,rtl.boolean,"FExpandNodes","FExpandNodes",4,{Default: true});
    $r.addProperty("StretchColumn",0,rtl.longint,"FStretchColumn","FStretchColumn",4,{Default: 1});
    $r.addProperty("NameHTMLTemplate",0,rtl.string,"FNameHTMLTemplate","FNameHTMLTemplate");
    $r.addProperty("ValueHTMLTemplate",0,rtl.string,"FValueHTMLTemplate","FValueHTMLTemplate");
    $r.addProperty("ArrayItemPrefix",0,rtl.string,"FArrayItemPrefix","FArrayItemPrefix");
    $r.addProperty("ArrayItemSuffix",0,rtl.string,"FArrayItemSuffix","FArrayItemSuffix");
  });
  rtl.createClass(this,"TTMSFNCCustomTreeView",pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.$init.call(this);
      this.FPrevDSP = null;
      this.FOldTopRow = 0;
      this.FCompactMode = false;
      this.FVerticalOffset = 0.0;
      this.FVerticalOffsetTo = 0.0;
      this.FAccepted = false;
      this.FLookupString = "";
      this.FY = 0.0;
      this.FDragY = 0.0;
      this.FSaveDragY = 0.0;
      this.FX = 0.0;
      this.FDragBitmap = null;
      this.FReorderMode = false;
      this.FDragMode$1 = false;
      this.FDragModeStarted = false;
      this.FSortColumn = 0;
      this.FClosing = false;
      this.FInplaceEditorClosed = false;
      this.FColumnSize = 0.0;
      this.FCloseWithDialogKey = false;
      this.FFilterPopup = null;
      this.FFilterListBox = null;
      this.FFilterTimer = null;
      this.FInplaceEditorClass = null;
      this.FInplaceEditor = null;
      this.FOldInplaceEditor = null;
      this.FInplaceEditorActive = false;
      this.FSizeColumn = 0;
      this.FDownColumnValue = 0;
      this.FDownColumn = 0;
      this.FDownColumnFilter = 0;
      this.FDownColumnExpand = 0;
      this.FUpdateNodeColumn = 0;
      this.FUpdateNode = null;
      this.FCopyNodes = null;
      this.FDoubleSelection = false;
      this.FDragTimer = null;
      this.FDragRow = 0;
      this.FDownNode = null;
      this.FFocusedNode = null;
      this.FDragNode = null;
      this.FDblClicked = false;
      this.FDoNodeAnchor = $mod.TTMSFNCTreeViewNodeAnchor.$new();
      this.FDoNodeTitleAnchor = $mod.TTMSFNCTreeViewNodeAnchor.$new();
      this.FDoNodeCheck = $mod.TTMSFNCTreeViewNodeCheck.$new();
      this.FDoNodeExpand = false;
      this.FDoNodeExtra = false;
      this.FDoNodeTitleExtra = false;
      this.FScrolling = false;
      this.FMouseUp = false;
      this.FAnimateVerticalPos = false;
      this.FAnimateHorizontalPos = false;
      this.FAnimateVerticalOffset = false;
      this.FAnimating = false;
      this.FSpX = 0.0;
      this.FSpY = 0.0;
      this.FScrollX = 0.0;
      this.FScrollY = 0.0;
      this.FDownX = 0.0;
      this.FDownY = 0.0;
      this.FMouseX = 0.0;
      this.FMouseY = 0.0;
      this.FSizeX = 0.0;
      this.FScrollVTo = 0.0;
      this.FScrollHTo = 0.0;
      this.FTimeStart = 0.0;
      this.FTimeStop = 0.0;
      this.FAnimateTimer = null;
      this.FNodeCache = null;
      this.FColumnsTopCache = null;
      this.FColumnsBottomCache = null;
      this.FGroupsTopCache = null;
      this.FGroupsBottomCache = null;
      this.FNodeDisplay = null;
      this.FColumnsTopDisplay = null;
      this.FColumnsBottomDisplay = null;
      this.FGroupsTopDisplay = null;
      this.FGroupsBottomDisplay = null;
      this.FNodesAppearance = null;
      this.FColumnsCaching = false;
      this.FGroupsCaching = false;
      this.FColumnStretchingActive = false;
      this.FColumnStretchingApplied = false;
      this.FGroupsAppearance = null;
      this.FColumnsAppearance = null;
      this.FOnAfterDrawGroup = null;
      this.FOnNodeCompare = null;
      this.FOnBeforeSizeColumn = null;
      this.FOnAfterSizeColumn = null;
      this.FOnBeforeDrawColumn = null;
      this.FOnBeforeDrawColumnHeader = null;
      this.FOnAfterDrawColumnHeader = null;
      this.FOnBeforeDrawNode = null;
      this.FOnAfterDrawColumn = null;
      this.FOnBeforeDrawGroup = null;
      this.FOnAfterDrawNode = null;
      this.FOnBeforeDrawNodeText = null;
      this.FOnBeforeDrawNodeTitle = null;
      this.FOnGetNodeHeight = null;
      this.FOnAfterDrawColumnText = null;
      this.FOnBeforeDrawGroupText = null;
      this.FOnAfterDrawNodeText = null;
      this.FOnAfterDrawNodeTitle = null;
      this.FOnAfterDrawGroupText = null;
      this.FOnBeforeDrawColumnText = null;
      this.FInteraction = null;
      this.FOnAfterUpdateNode = null;
      this.FOnBeforeUpdateNode = null;
      this.FOnAfterUnCheckNode = null;
      this.FOnBeforeUnCheckNode = null;
      this.FOnAfterCheckNode = null;
      this.FOnBeforeCheckNode = null;
      this.FOnAfterExpandNode = null;
      this.FOnBeforeExpandNode = null;
      this.FOnAfterCollapseNode = null;
      this.FOnBeforeCollapseNode = null;
      this.FOnBeforeSelectNode = null;
      this.FOnAfterSelectNode = null;
      this.FOnBeforeSelectAllNodes = null;
      this.FOnAfterSelectAllNodes = null;
      this.FOnNodeClick = null;
      this.FOnNodeValueClick = null;
      this.FOnNodeDblClick = null;
      this.FOnGetNodeText = null;
      this.FOnGetNodeTitle = null;
      this.FOnGetColumnText = null;
      this.FOnGetGroupText = null;
      this.FOnNodeAnchorClick = null;
      this.FOnVScroll = null;
      this.FOnHScroll = null;
      this.FOnBeforeDrawColumnEmptySpace = null;
      this.FOnAfterDrawColumnEmptySpace = null;
      this.FOnBeforeDrawGroupEmptySpace = null;
      this.FOnAfterDrawGroupEmptySpace = null;
      this.FOnGetNumberOfNodes = null;
      this.FOnIsNodeExpanded = null;
      this.FOnIsNodeEnabled = null;
      this.FOnIsNodeVisible = null;
      this.FSelectedNodes = null;
      this.FOnGetNodeDisabledColor = null;
      this.FOnGetNodeTextColor = null;
      this.FOnGetNodeTitleColor = null;
      this.FOnGetNodeSelectedColor = null;
      this.FOnGetNodeColor = null;
      this.FOnGetNodeDisabledTextColor = null;
      this.FOnGetNodeSelectedTextColor = null;
      this.FOnGetNodeDisabledTitleColor = null;
      this.FOnGetNodeSelectedTitleColor = null;
      this.FOnIsNodeExtended = null;
      this.FOnGetNodeIcon = null;
      this.FOnGetColumnWordWrapping = null;
      this.FOnGetColumnVerticalTextAlign = null;
      this.FOnGetColumnTrimming = null;
      this.FOnGetColumnHorizontalTextAlign = null;
      this.FOnGetNodeWordWrapping = null;
      this.FOnGetNodeVerticalTextAlign = null;
      this.FOnGetNodeTrimming = null;
      this.FOnGetNodeHorizontalTextAlign = null;
      this.FOnIsNodeChecked = null;
      this.FOnBeforeDrawNodeIcon = null;
      this.FOnBeforeDrawNodeExpand = null;
      this.FOnAfterDrawNodeIcon = null;
      this.FOnAfterDrawNodeExpand = null;
      this.FOnGetNodeCheckType = null;
      this.FOnAfterDrawNodeCheck = null;
      this.FOnBeforeDrawNodeCheck = null;
      this.FColumnStroke = null;
      this.FOnAfterDrawNodeColumn = null;
      this.FOnBeforeDrawNodeColumn = null;
      this.FOnBeforeUnSelectNode = null;
      this.FOnAfterUnSelectNode = null;
      this.FOnAfterOpenInplaceEditor = null;
      this.FOnGetInplaceEditor = null;
      this.FOnCloseInplaceEditor = null;
      this.FOnBeforeOpenInplaceEditor = null;
      this.FOnNodeChanged = null;
      this.FOnCustomizeInplaceEditor = null;
      this.FOnGetInplaceEditorRect = null;
      this.FOnBeforeReorderNode = null;
      this.FOnAfterReorderNode = null;
      this.FOnAfterDropNode = null;
      this.FOnBeforeDropNode = null;
      this.FOnAfterCutToClipboard = null;
      this.FOnBeforePasteFromClipboard = null;
      this.FOnBeforeCopyToClipboard = null;
      this.FOnAfterPasteFromClipboard = null;
      this.FOnBeforeCutToClipboard = null;
      this.FOnAfterCopyToClipboard = null;
      this.FOnNeedFilterDropDownData = null;
      this.FOnFilterSelect = null;
      this.FOnCustomReorder = null;
      this.FOnCustomDragDrop = null;
      this.FOnCustomDragOver = null;
      this.FOnCustomCopyToClipboard = null;
      this.FOnCustomCutToClipboard = null;
      this.FOnCustomPasteFromClipboard = null;
      this.FOnCustomColumnSort = null;
      this.FOnCustomLookup = null;
      this.FOnBeforeDrawSortIndicator = null;
      this.FOnAfterDrawSortIndicator = null;
      this.FAdapter = null;
      this.FOnGetNodeSides = null;
      this.FOnGetNodeExtraSize = null;
      this.FOnGetNodeTitleExtraSize = null;
      this.FOnAfterDrawNodeExtra = null;
      this.FOnBeforeDrawNodeExtra = null;
      this.FOnDrawNodeExtra = null;
      this.FOnGetNodeTitleTrimming = null;
      this.FOnGetNodeTitleHorizontalTextAlign = null;
      this.FOnGetNodeTitleWordWrapping = null;
      this.FOnGetNodeTitleVerticalTextAlign = null;
      this.FOnNodeTitleAnchorClick = null;
      this.FOnGetNodeExpanded = null;
      this.FOnBeforeDrawNodeTitleExtra = null;
      this.FOnAfterDrawNodeTitleExtra = null;
      this.FOnDrawNodeTitleExtra = null;
      this.FOnNodeMouseEnter = null;
      this.FOnNodeMouseLeave = null;
      this.FOnGetNodeIconSize = null;
      this.FOnColumnAnchorClick = null;
      this.FOnFocusedNodeChanged = null;
      this.FOnGetNodeData = null;
      this.FOnAfterSortNodes = null;
      this.FOnBeforeSortNodes = null;
      this.FGlobalFont = null;
      this.FOnGetNodeRounding = null;
      this.FOnGetNodeDisabledStrokeColor = null;
      this.FOnGetNodeSelectedStrokeColor = null;
      this.FOnGetNodeStrokeColor = null;
      this.FOnGetHTMLTemplateValue = null;
      this.FOnGetHTMLTemplate = null;
      this.FOnCustomizeFilterListBox = null;
      this.FPrecalculateItems = false;
      this.FDefaultViewJSONOptions = null;
      this.FOnAfterAddJSONNode = null;
      this.FOnBeforeAddJSONNode = null;
      this.FCheckStartSize = 0;
    };
    this.$final = function () {
      this.FPrevDSP = undefined;
      this.FDragBitmap = undefined;
      this.FFilterPopup = undefined;
      this.FFilterListBox = undefined;
      this.FFilterTimer = undefined;
      this.FInplaceEditorClass = undefined;
      this.FInplaceEditor = undefined;
      this.FOldInplaceEditor = undefined;
      this.FUpdateNode = undefined;
      this.FCopyNodes = undefined;
      this.FDragTimer = undefined;
      this.FDownNode = undefined;
      this.FFocusedNode = undefined;
      this.FDragNode = undefined;
      this.FDoNodeAnchor = undefined;
      this.FDoNodeTitleAnchor = undefined;
      this.FDoNodeCheck = undefined;
      this.FAnimateTimer = undefined;
      this.FNodeCache = undefined;
      this.FColumnsTopCache = undefined;
      this.FColumnsBottomCache = undefined;
      this.FGroupsTopCache = undefined;
      this.FGroupsBottomCache = undefined;
      this.FNodeDisplay = undefined;
      this.FColumnsTopDisplay = undefined;
      this.FColumnsBottomDisplay = undefined;
      this.FGroupsTopDisplay = undefined;
      this.FGroupsBottomDisplay = undefined;
      this.FNodesAppearance = undefined;
      this.FGroupsAppearance = undefined;
      this.FColumnsAppearance = undefined;
      this.FOnAfterDrawGroup = undefined;
      this.FOnNodeCompare = undefined;
      this.FOnBeforeSizeColumn = undefined;
      this.FOnAfterSizeColumn = undefined;
      this.FOnBeforeDrawColumn = undefined;
      this.FOnBeforeDrawColumnHeader = undefined;
      this.FOnAfterDrawColumnHeader = undefined;
      this.FOnBeforeDrawNode = undefined;
      this.FOnAfterDrawColumn = undefined;
      this.FOnBeforeDrawGroup = undefined;
      this.FOnAfterDrawNode = undefined;
      this.FOnBeforeDrawNodeText = undefined;
      this.FOnBeforeDrawNodeTitle = undefined;
      this.FOnGetNodeHeight = undefined;
      this.FOnAfterDrawColumnText = undefined;
      this.FOnBeforeDrawGroupText = undefined;
      this.FOnAfterDrawNodeText = undefined;
      this.FOnAfterDrawNodeTitle = undefined;
      this.FOnAfterDrawGroupText = undefined;
      this.FOnBeforeDrawColumnText = undefined;
      this.FInteraction = undefined;
      this.FOnAfterUpdateNode = undefined;
      this.FOnBeforeUpdateNode = undefined;
      this.FOnAfterUnCheckNode = undefined;
      this.FOnBeforeUnCheckNode = undefined;
      this.FOnAfterCheckNode = undefined;
      this.FOnBeforeCheckNode = undefined;
      this.FOnAfterExpandNode = undefined;
      this.FOnBeforeExpandNode = undefined;
      this.FOnAfterCollapseNode = undefined;
      this.FOnBeforeCollapseNode = undefined;
      this.FOnBeforeSelectNode = undefined;
      this.FOnAfterSelectNode = undefined;
      this.FOnBeforeSelectAllNodes = undefined;
      this.FOnAfterSelectAllNodes = undefined;
      this.FOnNodeClick = undefined;
      this.FOnNodeValueClick = undefined;
      this.FOnNodeDblClick = undefined;
      this.FOnGetNodeText = undefined;
      this.FOnGetNodeTitle = undefined;
      this.FOnGetColumnText = undefined;
      this.FOnGetGroupText = undefined;
      this.FOnNodeAnchorClick = undefined;
      this.FOnVScroll = undefined;
      this.FOnHScroll = undefined;
      this.FOnBeforeDrawColumnEmptySpace = undefined;
      this.FOnAfterDrawColumnEmptySpace = undefined;
      this.FOnBeforeDrawGroupEmptySpace = undefined;
      this.FOnAfterDrawGroupEmptySpace = undefined;
      this.FOnGetNumberOfNodes = undefined;
      this.FOnIsNodeExpanded = undefined;
      this.FOnIsNodeEnabled = undefined;
      this.FOnIsNodeVisible = undefined;
      this.FSelectedNodes = undefined;
      this.FOnGetNodeDisabledColor = undefined;
      this.FOnGetNodeTextColor = undefined;
      this.FOnGetNodeTitleColor = undefined;
      this.FOnGetNodeSelectedColor = undefined;
      this.FOnGetNodeColor = undefined;
      this.FOnGetNodeDisabledTextColor = undefined;
      this.FOnGetNodeSelectedTextColor = undefined;
      this.FOnGetNodeDisabledTitleColor = undefined;
      this.FOnGetNodeSelectedTitleColor = undefined;
      this.FOnIsNodeExtended = undefined;
      this.FOnGetNodeIcon = undefined;
      this.FOnGetColumnWordWrapping = undefined;
      this.FOnGetColumnVerticalTextAlign = undefined;
      this.FOnGetColumnTrimming = undefined;
      this.FOnGetColumnHorizontalTextAlign = undefined;
      this.FOnGetNodeWordWrapping = undefined;
      this.FOnGetNodeVerticalTextAlign = undefined;
      this.FOnGetNodeTrimming = undefined;
      this.FOnGetNodeHorizontalTextAlign = undefined;
      this.FOnIsNodeChecked = undefined;
      this.FOnBeforeDrawNodeIcon = undefined;
      this.FOnBeforeDrawNodeExpand = undefined;
      this.FOnAfterDrawNodeIcon = undefined;
      this.FOnAfterDrawNodeExpand = undefined;
      this.FOnGetNodeCheckType = undefined;
      this.FOnAfterDrawNodeCheck = undefined;
      this.FOnBeforeDrawNodeCheck = undefined;
      this.FColumnStroke = undefined;
      this.FOnAfterDrawNodeColumn = undefined;
      this.FOnBeforeDrawNodeColumn = undefined;
      this.FOnBeforeUnSelectNode = undefined;
      this.FOnAfterUnSelectNode = undefined;
      this.FOnAfterOpenInplaceEditor = undefined;
      this.FOnGetInplaceEditor = undefined;
      this.FOnCloseInplaceEditor = undefined;
      this.FOnBeforeOpenInplaceEditor = undefined;
      this.FOnNodeChanged = undefined;
      this.FOnCustomizeInplaceEditor = undefined;
      this.FOnGetInplaceEditorRect = undefined;
      this.FOnBeforeReorderNode = undefined;
      this.FOnAfterReorderNode = undefined;
      this.FOnAfterDropNode = undefined;
      this.FOnBeforeDropNode = undefined;
      this.FOnAfterCutToClipboard = undefined;
      this.FOnBeforePasteFromClipboard = undefined;
      this.FOnBeforeCopyToClipboard = undefined;
      this.FOnAfterPasteFromClipboard = undefined;
      this.FOnBeforeCutToClipboard = undefined;
      this.FOnAfterCopyToClipboard = undefined;
      this.FOnNeedFilterDropDownData = undefined;
      this.FOnFilterSelect = undefined;
      this.FOnCustomReorder = undefined;
      this.FOnCustomDragDrop = undefined;
      this.FOnCustomDragOver = undefined;
      this.FOnCustomCopyToClipboard = undefined;
      this.FOnCustomCutToClipboard = undefined;
      this.FOnCustomPasteFromClipboard = undefined;
      this.FOnCustomColumnSort = undefined;
      this.FOnCustomLookup = undefined;
      this.FOnBeforeDrawSortIndicator = undefined;
      this.FOnAfterDrawSortIndicator = undefined;
      this.FAdapter = undefined;
      this.FOnGetNodeSides = undefined;
      this.FOnGetNodeExtraSize = undefined;
      this.FOnGetNodeTitleExtraSize = undefined;
      this.FOnAfterDrawNodeExtra = undefined;
      this.FOnBeforeDrawNodeExtra = undefined;
      this.FOnDrawNodeExtra = undefined;
      this.FOnGetNodeTitleTrimming = undefined;
      this.FOnGetNodeTitleHorizontalTextAlign = undefined;
      this.FOnGetNodeTitleWordWrapping = undefined;
      this.FOnGetNodeTitleVerticalTextAlign = undefined;
      this.FOnNodeTitleAnchorClick = undefined;
      this.FOnGetNodeExpanded = undefined;
      this.FOnBeforeDrawNodeTitleExtra = undefined;
      this.FOnAfterDrawNodeTitleExtra = undefined;
      this.FOnDrawNodeTitleExtra = undefined;
      this.FOnNodeMouseEnter = undefined;
      this.FOnNodeMouseLeave = undefined;
      this.FOnGetNodeIconSize = undefined;
      this.FOnColumnAnchorClick = undefined;
      this.FOnFocusedNodeChanged = undefined;
      this.FOnGetNodeData = undefined;
      this.FOnAfterSortNodes = undefined;
      this.FOnBeforeSortNodes = undefined;
      this.FGlobalFont = undefined;
      this.FOnGetNodeRounding = undefined;
      this.FOnGetNodeDisabledStrokeColor = undefined;
      this.FOnGetNodeSelectedStrokeColor = undefined;
      this.FOnGetNodeStrokeColor = undefined;
      this.FOnGetHTMLTemplateValue = undefined;
      this.FOnGetHTMLTemplate = undefined;
      this.FOnCustomizeFilterListBox = undefined;
      this.FDefaultViewJSONOptions = undefined;
      this.FOnAfterAddJSONNode = undefined;
      this.FOnBeforeAddJSONNode = undefined;
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.$final.call(this);
    };
    this.SetNodesAppearance = function (Value) {
      if (this.FNodesAppearance !== Value) this.FNodesAppearance.Assign(Value);
    };
    this.SetGroupsAppearance = function (Value) {
      if (this.FGroupsAppearance !== Value) this.FGroupsAppearance.Assign(Value);
    };
    this.SetColumnsAppearance = function (Value) {
      if (this.FColumnsAppearance !== Value) this.FColumnsAppearance.Assign(Value);
    };
    this.SetInteraction = function (Value) {
      if (this.FInteraction !== Value) this.FInteraction.Assign(Value);
    };
    this.GetFocusedNode = function () {
      var Result = null;
      var n = null;
      Result = null;
      n = this.FFocusedNode;
      if (n != null) Result = n.FNode;
      return Result;
    };
    this.GetFocusedVirtualNode = function () {
      var Result = null;
      Result = this.FFocusedNode;
      return Result;
    };
    this.GetSelNode = function (AIndex) {
      var Result = null;
      var v = null;
      Result = null;
      v = this.GetSelVirtualNode(AIndex);
      if (v != null) Result = v.FNode;
      return Result;
    };
    this.GetSelVirtualNode = function (AIndex) {
      var Result = null;
      Result = null;
      if ((AIndex >= 0) && (AIndex <= (this.SelectedVirtualNodeCount() - 1))) Result = this.FSelectedNodes.GetItem(AIndex);
      return Result;
    };
    this.SetColumnStroke = function (Value) {
      if (this.FColumnStroke !== Value) this.FColumnStroke.Assign(Value);
    };
    this.SetFocusedNode = function (Value) {
      if (Value != null) {
        this.SetFocusedVirtualNode(Value.FVirtualNode)}
       else this.SetFocusedVirtualNode(null);
    };
    this.SetFocusedVirtualNode = function (Value) {
      this.FFocusedNode = Value;
      this.Invalidate();
    };
    this.SetSortColumn = function (Value) {
      if (this.FSortColumn !== Value) {
        this.FSortColumn = Value;
        this.Invalidate();
      };
    };
    this.HandleFilterTimer = function (Sender) {
      var fd = null;
      var cnd = "";
      var i = 0;
      var filtercol = 0;
      if (this.FFilterListBox != null) {
        filtercol = this.FFilterListBox.FTag$1;
        if ((filtercol >= 0) && (filtercol <= (this.FColumns.GetCount() - 1))) {
          if (this.FColumns.GetItem$1(filtercol).FFiltering.FMultiColumn) {
            for (var $l = this.FFilter.GetCount() - 1; $l >= 0; $l--) {
              i = $l;
              if (this.FFilter.GetItem$1(i).FColumn === filtercol) this.FFilter.Delete(i);
            };
          } else this.FFilter.Clear();
          fd = this.FFilter.Add$1();
          fd.FColumn = filtercol;
          cnd = "";
          if ((this.FFilterListBox.GetItemIndex() >= 0) && (this.FFilterListBox.GetItemIndex() <= (this.FFilterListBox.FItems.GetCount() - 1))) cnd = this.FFilterListBox.FItems.Get(this.FFilterListBox.GetItemIndex());
          if (pas.System.Pos(" ",cnd) > 0) cnd = '"' + cnd + '"';
          this.FFilterPopup.SetIsOpen(false);
          if (cnd === rtl.getResStr($mod,"sTMSFNCTreeViewFilterAll")) {
            this.RemoveFilters();
          } else {
            this.DoFilterSelect(fd.FColumn,{get: function () {
                return cnd;
              }, set: function (v) {
                cnd = v;
              }});
            fd.FCondition = cnd;
            this.ApplyFilter();
          };
        };
      };
      this.FFilterTimer.SetEnabled(false);
    };
    this.SetAdapter = function (Value) {
      if (Value != null) Value.SetTreeView(this);
      this.FAdapter = Value;
    };
    this.SetSelectedNode = function (Value) {
      if (Value != null) {
        this.SetSelectedVirtualNode(Value.FVirtualNode)}
       else this.SetSelectedVirtualNode(null);
    };
    this.SetSelectedVirtualNode = function (Value) {
      this.SetFocusedVirtualNode(Value);
      this.SelectVirtualNode(Value);
    };
    this.SetCompactMode = function (Value) {
      if (this.FCompactMode !== Value) {
        this.FCompactMode = Value;
        this.UpdateTreeView();
      };
    };
    this.GetSelectedVirtualNodeRow = function () {
      var Result = 0;
      var n = null;
      Result = -1;
      n = this.GetFocusedVirtualNode();
      if (n != null) Result = n.FRow;
      return Result;
    };
    this.GetTopRow = function () {
      var Result = 0;
      Result = this.GetFirstVisibleVirtualNodeRow();
      return Result;
    };
    this.SetTopRow = function (Value) {
      this.ScrollToVirtualNodeRow(Value,true,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeScrollPosition.tvnspTop,true);
    };
    this.GetBottomRow = function () {
      var Result = 0;
      Result = this.GetLastVisibleVirtualNodeRow();
      return Result;
    };
    this.SetGlobalFont = function (Value) {
      this.FGlobalFont.Assign(Value);
    };
    this.SetDefaultViewJSONOptions = function (Value) {
      this.FDefaultViewJSONOptions = Value;
    };
    this.DataGetItemIndex = function () {
      var Result = 0;
      Result = this.GetSelectedVirtualNodeRow();
      return Result;
    };
    this.DataSetItemIndex = function (AValue) {
      this.ScrollToVirtualNodeRow(AValue,true,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeScrollPosition.tvnspTop,false);
      this.SelectVirtualNodeByRow(AValue);
    };
    this.ChangeDPIScale = function (M, D) {
      var I = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ChangeDPIScale.apply(this,arguments);
      this.BeginUpdate();
      this.CreateCheckBoxBitmaps();
      this.CreateRadioButtonBitmaps();
      this.FNodesAppearance.SetLevelIndent(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FNodesAppearance.FLevelIndent,M,D));
      this.FNodesAppearance.SetExpandWidth(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FNodesAppearance.FExpandWidth,M,D));
      this.FNodesAppearance.SetExpandHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FNodesAppearance.FExpandHeight,M,D));
      this.FColumnsAppearance.SetTopSize(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FColumnsAppearance.FTopSize,M,D));
      this.FColumnsAppearance.SetBottomSize(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FColumnsAppearance.FBottomSize,M,D));
      this.FGroupsAppearance.SetTopSize(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FGroupsAppearance.FTopSize,M,D));
      this.FGroupsAppearance.SetBottomSize(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FGroupsAppearance.FBottomSize,M,D));
      this.FColumnsAppearance.FBottomFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FColumnsAppearance.FBottomFont.FHeight,M,D));
      this.FColumnsAppearance.FTopFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FColumnsAppearance.FTopFont.FHeight,M,D));
      this.FGroupsAppearance.FBottomFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FGroupsAppearance.FBottomFont.FHeight,M,D));
      this.FGroupsAppearance.FTopFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FGroupsAppearance.FTopFont.FHeight,M,D));
      this.FNodesAppearance.FExtendedFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FNodesAppearance.FExtendedFont.FHeight,M,D));
      this.FNodesAppearance.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FNodesAppearance.FFont.FHeight,M,D));
      this.FNodesAppearance.SetFixedHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FNodesAppearance.FFixedHeight,M,D));
      this.FNodesAppearance.SetVariableMinimumHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FNodesAppearance.FVariableMinimumHeight,M,D));
      for (var $l = 0, $end = this.FColumns.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.FColumns.GetItem$1(I).SetWidth(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FColumns.GetItem$1(I).FWidth,M,D));
        this.FColumns.GetItem$1(I).SetMinimumWidth(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FColumns.GetItem$1(I).FMinimumWidth,M,D));
        this.FColumns.GetItem$1(I).FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FColumns.GetItem$1(I).FFont.FHeight,M,D));
        this.FColumns.GetItem$1(I).FTitleFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FColumns.GetItem$1(I).FTitleFont.FHeight,M,D));
        this.FColumns.GetItem$1(I).FTopFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FColumns.GetItem$1(I).FTopFont.FHeight,M,D));
        this.FColumns.GetItem$1(I).FBottomFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FColumns.GetItem$1(I).FBottomFont.FHeight,M,D));
        this.FColumns.GetItem$1(I).SetExpandingButtonSize(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FColumns.GetItem$1(I).FExpandingButtonSize,M,D));
        this.FColumns.GetItem$1(I).FFiltering.SetButtonSize(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FColumns.GetItem$1(I).FFiltering.FButtonSize,M,D));
        this.FColumns.GetItem$1(I).FFiltering.FDropDownWidth = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FColumns.GetItem$1(I).FFiltering.FDropDownWidth,M,D);
        this.FColumns.GetItem$1(I).FFiltering.FDropDownHeight = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FColumns.GetItem$1(I).FFiltering.FDropDownHeight,M,D);
      };
      this.EndUpdate();
    };
    this.RegisterRuntimeClasses = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClass($mod.TTMSFNCCustomTreeView);
    };
    this.ApplyStyle = function () {
      var c = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ApplyStyle.call(this);
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleBackgroundFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) this.FFill.SetColor(c);
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleLineFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FStroke.SetColor(c);
        this.FColumnsAppearance.FTopStroke.SetColor(c);
        this.FColumnsAppearance.FBottomStroke.SetColor(c);
        this.FGroupsAppearance.FTopStroke.SetColor(c);
        this.FGroupsAppearance.FBottomStroke.SetColor(c);
        this.FNodesAppearance.FExtendedFill.SetColor(c);
        this.FNodesAppearance.FExtendedStroke.SetColor(c);
      };
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleHeaderFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FColumnsAppearance.FTopFill.SetColor(c);
        this.FColumnsAppearance.FTopFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        this.FColumnsAppearance.FBottomFill.SetColor(c);
        this.FColumnsAppearance.FBottomFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        this.FGroupsAppearance.FTopFill.SetColor(c);
        this.FGroupsAppearance.FTopFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        this.FGroupsAppearance.FBottomFill.SetColor(c);
        this.FGroupsAppearance.FBottomFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      };
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleHeaderFillColorTo({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FColumnsAppearance.FTopFill.SetColorTo(c);
        this.FColumnsAppearance.FTopFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient);
        this.FColumnsAppearance.FBottomFill.SetColorTo(c);
        this.FColumnsAppearance.FBottomFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient);
        this.FGroupsAppearance.FTopFill.SetColorTo(c);
        this.FGroupsAppearance.FTopFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient);
        this.FGroupsAppearance.FBottomFill.SetColorTo(c);
        this.FGroupsAppearance.FBottomFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient);
      };
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleSelectionFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FNodesAppearance.FSelectedFill.SetColor(c);
        this.FNodesAppearance.FSelectedStroke.SetColor(c);
      };
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleTextFontColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FNodesAppearance.FFont.SetColor(c);
        this.FNodesAppearance.SetExtendedFontColor(c);
        this.FColumnsAppearance.FTopFont.SetColor(c);
        this.FColumnsAppearance.FBottomFont.SetColor(c);
        this.FGroupsAppearance.FTopFont.SetColor(c);
        this.FGroupsAppearance.FBottomFont.SetColor(c);
      };
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleAlternativeTextFontColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FNodesAppearance.SetSelectedFontColor(c);
        this.FNodesAppearance.SetSelectedTitleFontColor(c);
      };
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleBackgroundFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) this.FFill.SetColor(c);
    };
    this.DoEnter = function () {
      pas["WEBLib.Controls"].TControl.DoEnter.call(this);
      this.Invalidate();
    };
    this.DoExit = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.DoExit.call(this);
      this.Invalidate();
    };
    this.UpdateControlAfterResize = function () {
      pas["WEBLib.TMSFNCTreeViewBase"].TTMSFNCTreeViewBase.UpdateControlAfterResize.call(this);
      if (this.FAdapter != null) this.FAdapter.UpdateBounds();
    };
    this.ResetToDefaultStyle = function () {
      this.BeginUpdate();
      pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.SetFontSize(this.FColumnsAppearance.FTopFont,14,1);
      this.FColumnsAppearance.FTopFont.SetStyle(rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsBold));
      this.FColumnsAppearance.FTopFill.SetColor(0xF9F2EE);
      this.FColumnsAppearance.FTopFont.SetColor(0x454545);
      this.FNodesAppearance.FSelectedFill.SetColor(0xFCF8F6);
      this.FNodesAppearance.FSelectedStroke.SetColor(0xEF9B2D);
      this.FNodesAppearance.FFont.SetColor(0x7A7A7A);
      this.FNodesAppearance.SetSelectedFontColor(0x454545);
      this.FNodesAppearance.FSelectedStroke.SetColor(0xEF9B2D);
      this.FNodesAppearance.SetShowFocus(false);
      this.FNodesAppearance.SetExpandWidth(this.ScalePaintValue(18));
      this.FNodesAppearance.SetExpandHeight(this.ScalePaintValue(18));
      this.FNodesAppearance.SetShowFocus(false);
      this.FNodesAppearance.FSelectedStroke.SetWidth(pas.System.Trunc(this.ScalePaintValue$1(2.0)));
      this.FColumnsAppearance.SetTopSize(this.ScalePaintValue(36));
      this.FColumnsAppearance.FTopStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
      this.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FFill.SetColor(16777215);
      this.FStroke.SetColor(11119017);
      this.FNodesAppearance.FExtendedFill.SetColor(16053492);
      this.FColumnsAppearance.FBottomFill.SetColor(this.FColumnsAppearance.FTopFill.FColor);
      this.FColumnsAppearance.FTopStroke.SetColor(11119017);
      this.FColumnsAppearance.FBottomStroke.SetColor(11119017);
      this.FColumnsAppearance.FBottomFont.SetColor(this.FColumnsAppearance.FTopFont.FColor);
      this.FGroupsAppearance.FTopFill.SetColor(16777215);
      this.FGroupsAppearance.FBottomFill.SetColor(16777215);
      this.FGroupsAppearance.FTopStroke.SetColor(11119017);
      this.FGroupsAppearance.FBottomStroke.SetColor(11119017);
      this.FGroupsAppearance.FTopFont.SetColor(0);
      this.FGroupsAppearance.FBottomFont.SetColor(0);
      this.FColumnsAppearance.FTopFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FColumnsAppearance.FBottomFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
      this.FColumnsAppearance.FBottomStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FGroupsAppearance.FTopFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
      this.FGroupsAppearance.FBottomFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
      this.FGroupsAppearance.FTopStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FGroupsAppearance.FBottomStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FNodesAppearance.SetExtendedFontColor(this.FColumnsAppearance.FTopFont.FColor);
      this.FColumnsAppearance.FBottomFont.SetColor(this.FColumnsAppearance.FTopFont.FColor);
      this.FGroupsAppearance.FTopFont.SetColor(this.FColumnsAppearance.FTopFont.FColor);
      this.FGroupsAppearance.FBottomFont.SetColor(this.FColumnsAppearance.FTopFont.FColor);
      this.EndUpdate();
    };
    this.Notification = function (AComponent, Operation) {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.Notification.apply(this,arguments);
      if ((AComponent === this.FAdapter) && (Operation === pas.Classes.TOperation.opRemove)) this.FAdapter = null;
    };
    this.InitializeColumnSorting = function (AColumn, ASortMode) {
      var I = 0;
      this.FUpdateCount$1 = this.FUpdateCount$1 + 1;
      this.FSortColumn = AColumn;
      for (var $l = 0, $end = this.FColumns.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        var $tmp = ASortMode;
        if ($tmp === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodesSortMode.nsmAscending) {
          this.FColumns.GetItem$1(I).SetSortKind(pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodesSortKind.nskAscending)}
         else if ($tmp === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodesSortMode.nsmDescending) this.FColumns.GetItem$1(I).SetSortKind(pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodesSortKind.nskDescending);
      };
      this.FUpdateCount$1 = this.FUpdateCount$1 - 1;
    };
    this.AutoSizeColumnInternal = function (ACol, AUpdate, ACallEventHandlers) {
      var I = 0;
      var rcalc = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var v = null;
      var g = null;
      var strc = "";
      var strt = "";
      var ww = false;
      var wwt = false;
      var maxw = 0.0;
      var c = false;
      var colps = 0.0;
      var def = false;
      var col = null;
      var hs = 0.0;
      if (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState) return;
      if ((ACol >= 0) && (ACol <= (this.FColumnCount - 1)) && !this.FColumnsAppearance.FStretch && this.FNodeListBuild) {
        hs = this.GetHorizontalScrollPosition();
        maxw = 0;
        colps = this.GetColPos(ACol);
        g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[1,1,false,true]);
        g.FBitmapContainer = this.GetBitmapContainer();
        g.FOptimizedHTMLDrawing = this.FOptimizedHTMLDrawing;
        try {
          if (g.BeginScene()) {
            def = true;
            col = null;
            if ((ACol >= 0) && (ACol <= (this.FColumns.GetCount() - 1))) {
              col = this.FColumns.GetItem$1(ACol);
              if (!col.FUseDefaultAppearance) def = false;
            };
            if ($mod.TTMSFNCTreeViewColumnsLayout.tclTop in this.FColumnsAppearance.FLayouts) {
              strc = this.GetColumnText(ACol);
              this.DoGetColumnText(ACol,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikColumnTop,{get: function () {
                  return strc;
                }, set: function (v) {
                  strc = v;
                }});
              if (def) {
                g.FFont.Assign(this.FColumnsAppearance.FTopFont)}
               else g.FFont.Assign(col.FTopFont);
              rcalc.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,10000,10000));
              rcalc.$assign(g.CalculateText(strc,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rcalc),false,true));
              rcalc.Right = rcalc.Right + this.ScalePaintValue(4);
              if ((rcalc.Right - rcalc.Left) > maxw) maxw = rcalc.Right - rcalc.Left;
            };
            if ($mod.TTMSFNCTreeViewColumnsLayout.tclBottom in this.FColumnsAppearance.FLayouts) {
              strc = this.GetColumnText(ACol);
              this.DoGetColumnText(ACol,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikColumnBottom,{get: function () {
                  return strc;
                }, set: function (v) {
                  strc = v;
                }});
              if (def) {
                g.FFont.Assign(this.FColumnsAppearance.FBottomFont)}
               else g.FFont.Assign(col.FBottomFont);
              rcalc.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,10000,10000));
              rcalc.$assign(g.CalculateText(strc,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rcalc),false,true));
              rcalc.Right = rcalc.Right + this.ScalePaintValue(4);
              if ((rcalc.Right - rcalc.Left) > maxw) maxw = rcalc.Right - rcalc.Left;
            };
            for (var $l = this.StartRow(), $end = this.StopRow(); $l <= $end; $l++) {
              I = $l;
              v = this.GetVisibleNodeForIndex(I);
              if (v != null) {
                strc = "";
                this.DoGetNodeText(v,ACol,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeTextMode.tntmDrawing,{get: function () {
                    return strc;
                  }, set: function (v) {
                    strc = v;
                  }});
                ww = false;
                if ((ACol >= 0) && (ACol <= (this.FColumns.GetCount() - 1))) ww = this.FColumns.GetItem$1(ACol).FWordWrapping;
                this.DoGetNodeWordWrapping(v,ACol,{get: function () {
                    return ww;
                  }, set: function (v) {
                    ww = v;
                  }});
                rcalc.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,10000,10000));
                rcalc.$assign(g.CalculateText(strc,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rcalc),false,true));
                rcalc.Right = rcalc.Right + this.ScalePaintValue(4);
                if (ACol <= (rtl.length(v.FBitmapRects) - 1)) rcalc.Right = ((rcalc.Right + v.FBitmapRects[ACol].Right + hs) - colps) + this.ScalePaintValue(3);
                if ((rcalc.Right - rcalc.Left) > maxw) maxw = rcalc.Right - rcalc.Left;
                strt = "";
                this.DoGetNodeTitle(v,ACol,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeTextMode.tntmDrawing,{get: function () {
                    return strt;
                  }, set: function (v) {
                    strt = v;
                  }});
                wwt = false;
                if ((ACol >= 0) && (ACol <= (this.FColumns.GetCount() - 1))) wwt = this.FColumns.GetItem$1(ACol).FTitleWordWrapping;
                this.DoGetNodeTitleWordWrapping(v,ACol,{get: function () {
                    return wwt;
                  }, set: function (v) {
                    wwt = v;
                  }});
                rcalc.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,10000,10000));
                rcalc.$assign(g.CalculateText(strt,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rcalc),false,true));
                rcalc.Right = rcalc.Right + this.ScalePaintValue(4);
                if (ACol <= (rtl.length(v.FBitmapRects) - 1)) rcalc.Right = ((rcalc.Right + v.FBitmapRects[ACol].Right + hs) - colps) + this.ScalePaintValue(3);
                if ((rcalc.Right - rcalc.Left) > maxw) maxw = rcalc.Right - rcalc.Left;
              };
            };
            g.EndScene();
          };
        } finally {
          g = rtl.freeLoc(g);
        };
        maxw = pas.System.Int(maxw);
        c = true;
        if (ACallEventHandlers) this.DoBeforeSizeColumn(ACol,this.GetColWidths(ACol),{get: function () {
            return maxw;
          }, set: function (v) {
            maxw = v;
          }},{get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }});
        if (c) {
          this.SetColWidths(ACol,maxw);
          if (ACallEventHandlers) this.DoAfterSizeColumn(ACol,maxw);
          if (AUpdate) {
            this.UpdateTreeView();
            this.Invalidate();
          };
        };
      };
    };
    this.DoNodeCompare = function (ANode1, ANode2, AColumn, ACompareResult) {
      if (this.FOnNodeCompare != null) this.FOnNodeCompare(this,ANode1,ANode2,AColumn,ACompareResult);
    };
    this.SetFonts = function (ASetType) {
      this.BeginUpdate();
      this.FGlobalFont.ApplyChange(this.FNodesAppearance.FFont,ASetType);
      this.FGlobalFont.ApplyChange(this.FNodesAppearance.FExtendedFont,ASetType);
      this.FGlobalFont.ApplyChange(this.FNodesAppearance.FTitleFont,ASetType);
      this.FGlobalFont.ApplyChange(this.FColumnsAppearance.FTopFont,ASetType);
      this.FGlobalFont.ApplyChange(this.FColumnsAppearance.FBottomFont,ASetType);
      this.FGlobalFont.ApplyChange(this.FGroupsAppearance.FTopFont,ASetType);
      this.FGlobalFont.ApplyChange(this.FGroupsAppearance.FBottomFont,ASetType);
      if (ASetType === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCAppearanceGlobalFontType.aftColor) {
        this.FNodesAppearance.SetSelectedFontColor(this.FGlobalFont.FColor);
        this.FNodesAppearance.SetExtendedFontColor(this.FGlobalFont.FColor);
        this.FNodesAppearance.SetSelectedTitleFontColor(this.FGlobalFont.FColor);
      };
      this.EndUpdate();
    };
    this.ExportNotification = function (AState, ARow) {
    };
    this.DoBeforeSortNodes = function (ASortColumn, ASortMode, ACanSort) {
      if (this.FOnBeforeSortNodes != null) this.FOnBeforeSortNodes(this,ASortColumn,ASortMode,ACanSort);
    };
    this.DoAfterSortNodes = function (ASortColumn, ASortMode) {
      if (this.FOnAfterSortNodes != null) this.FOnAfterSortNodes(this,ASortColumn,ASortMode);
    };
    this.DoBeforeDrawSortIndicator = function (AGraphics, ARect, AColumn, ASortIndex, ASortKind, ADefaultDraw) {
      if (this.FOnBeforeDrawSortIndicator != null) this.FOnBeforeDrawSortIndicator(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AColumn,ASortIndex,ASortKind,ADefaultDraw);
    };
    this.DoAfterDrawSortIndicator = function (AGraphics, ARect, AColumn, ASortIndex, ASortKind) {
      if (this.FOnAfterDrawSortIndicator != null) this.FOnAfterDrawSortIndicator(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AColumn,ASortIndex,ASortKind);
    };
    this.DoBeforeCutToClipboard = function (ACanCut) {
      if (this.FOnBeforeCutToClipboard != null) this.FOnBeforeCutToClipboard(this,ACanCut);
    };
    this.DoBeforeCopyToClipboard = function (ACanCopy) {
      if (this.FOnBeforeCopyToClipboard != null) this.FOnBeforeCopyToClipboard(this,ACanCopy);
    };
    this.DoBeforePasteFromClipboard = function (ACanPaste) {
      if (this.FOnBeforePasteFromClipboard != null) this.FOnBeforePasteFromClipboard(this,ACanPaste);
    };
    this.DoAfterCutToClipboard = function () {
      if (this.FOnAfterCutToClipboard != null) this.FOnAfterCutToClipboard(this);
    };
    this.DoAfterCopyToClipboard = function () {
      if (this.FOnAfterCopyToClipboard != null) this.FOnAfterCopyToClipboard(this);
    };
    this.DoAfterPasteFromClipboard = function () {
      if (this.FOnAfterPasteFromClipboard != null) this.FOnAfterPasteFromClipboard(this);
    };
    this.DoBeforeReorderNode = function (AFromNode, AToNode, ACanReorder) {
      if (this.FOnBeforeReorderNode != null) this.FOnBeforeReorderNode(this,AFromNode,AToNode,ACanReorder);
    };
    this.DoAfterReorderNode = function (AFromNode, AToNode) {
      if (this.FOnAfterReorderNode != null) this.FOnAfterReorderNode(this,AFromNode,AToNode);
    };
    this.DoBeforeDropNode = function (AFromNode, AToNode, ACanDrop) {
      if (this.FOnBeforeDropNode != null) this.FOnBeforeDropNode(this,AFromNode,AToNode,ACanDrop);
    };
    this.DoAfterDropNode = function (AFromNode, AToNode) {
      if (this.FOnAfterDropNode != null) this.FOnAfterDropNode(this,AFromNode,AToNode);
    };
    this.DoBeforeDrawColumnEmptySpace = function (AGraphics, ARect, ASpace, AAllow, ADefaultDraw) {
      if (this.FOnBeforeDrawColumnEmptySpace != null) this.FOnBeforeDrawColumnEmptySpace(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),ASpace,AAllow,ADefaultDraw);
    };
    this.DoAfterDrawColumnEmptySpace = function (AGraphics, ARect, ASpace) {
      if (this.FOnAfterDrawColumnEmptySpace != null) this.FOnAfterDrawColumnEmptySpace(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),ASpace);
    };
    this.DoBeforeDrawGroupEmptySpace = function (AGraphics, ARect, ASpace, AAllow, ADefaultDraw) {
      if (this.FOnBeforeDrawGroupEmptySpace != null) this.FOnBeforeDrawGroupEmptySpace(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),ASpace,AAllow,ADefaultDraw);
    };
    this.DoAfterDrawGroupEmptySpace = function (AGraphics, ARect, ASpace) {
      if (this.FOnAfterDrawGroupEmptySpace != null) this.FOnAfterDrawGroupEmptySpace(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),ASpace);
    };
    this.DoBeforeDrawColumnHeader = function (AGraphics, ARect, AColumn, AKind, AAllow, ADefaultDraw) {
      if (this.FOnBeforeDrawColumnHeader != null) this.FOnBeforeDrawColumnHeader(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AColumn,AKind,AAllow,ADefaultDraw);
    };
    this.DoAfterDrawColumnHeader = function (AGraphics, ARect, AColumn, AKind) {
      if (this.FOnAfterDrawColumnHeader != null) this.FOnAfterDrawColumnHeader(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AColumn,AKind);
    };
    this.DoBeforeDrawColumn = function (AGraphics, ARect, AColumn, AAllow, ADefaultDraw) {
      if (this.FOnBeforeDrawColumn != null) this.FOnBeforeDrawColumn(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AColumn,AAllow,ADefaultDraw);
    };
    this.DoAfterDrawColumn = function (AGraphics, ARect, AColumn) {
      if (this.FOnAfterDrawColumn != null) this.FOnAfterDrawColumn(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AColumn);
    };
    this.DoBeforeDrawNodeColumn = function (AGraphics, ARect, AColumn, AAllow, ADefaultDraw) {
      if (this.FOnBeforeDrawNodeColumn != null) this.FOnBeforeDrawNodeColumn(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AColumn,AAllow,ADefaultDraw);
    };
    this.DoAfterDrawNodeColumn = function (AGraphics, ARect, AColumn) {
      if (this.FOnAfterDrawNodeColumn != null) this.FOnAfterDrawNodeColumn(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AColumn);
    };
    this.DoBeforeDrawGroup = function (AGraphics, ARect, AGroup, AStartColumn, AEndColumn, AKind, AAllow, ADefaultDraw) {
      if (this.FOnBeforeDrawGroup != null) this.FOnBeforeDrawGroup(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AGroup,AStartColumn,AEndColumn,AKind,AAllow,ADefaultDraw);
    };
    this.DoAfterDrawGroup = function (AGraphics, ARect, AGroup, AStartColumn, AEndColumn, AKind) {
      if (this.FOnAfterDrawGroup != null) this.FOnAfterDrawGroup(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AGroup,AStartColumn,AEndColumn,AKind);
    };
    this.DoBeforeDrawNode = function (AGraphics, ARect, ANode, AAllow, ADefaultDraw) {
      if (this.FOnBeforeDrawNode != null) this.FOnBeforeDrawNode(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),ANode,AAllow,ADefaultDraw);
    };
    this.DoAfterDrawNode = function (AGraphics, ARect, ANode) {
      if (this.FOnAfterDrawNode != null) this.FOnAfterDrawNode(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),ANode);
    };
    this.DoCustomizeFilterListBox = function (AColumn, AListBox) {
      if (this.FOnCustomizeFilterListBox != null) this.FOnCustomizeFilterListBox(this,AColumn,AListBox);
    };
    this.DoGetColumnText = function (AColumn, AKind, AText) {
      if (this.FOnGetColumnText != null) this.FOnGetColumnText(this,AColumn,AKind,AText);
    };
    this.DoBeforeDrawColumnText = function (AGraphics, ARect, AColumn, AKind, AText, AAllow) {
      if (this.FOnBeforeDrawColumnText != null) this.FOnBeforeDrawColumnText(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AColumn,AKind,AText,AAllow);
    };
    this.DoAfterDrawColumnText = function (AGraphics, ARect, AColumn, AKind, AText) {
      if (this.FOnAfterDrawColumnText != null) this.FOnAfterDrawColumnText(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AColumn,AKind,AText);
    };
    this.DoGetGroupText = function (AGroup, AKind, AText) {
      if (this.FOnGetGroupText != null) this.FOnGetGroupText(this,AGroup,AKind,AText);
    };
    this.DoBeforeDrawGroupText = function (AGraphics, ARect, AGroup, AStartColumn, AEndColumn, AKind, AText, AAllow) {
      if (this.FOnBeforeDrawGroupText != null) this.FOnBeforeDrawGroupText(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AGroup,AStartColumn,AEndColumn,AKind,AText,AAllow);
    };
    this.DoAfterDrawGroupText = function (AGraphics, ARect, AGroup, AStartColumn, AEndColumn, AKind, AText) {
      if (this.FOnAfterDrawGroupText != null) this.FOnAfterDrawGroupText(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AGroup,AStartColumn,AEndColumn,AKind,AText);
    };
    this.DoNodeClick = function (ANode) {
      if (this.FOnNodeClick != null) this.FOnNodeClick(this,ANode);
    };
    this.DoNodeValueClick = function (ANode, AColumn) {
      if (this.FOnNodeValueClick != null) this.FOnNodeValueClick(this,ANode,AColumn);
    };
    this.DoNodeMouseLeave = function (ANode) {
      if (this.FOnNodeMouseLeave != null) this.FOnNodeMouseLeave(this,ANode);
    };
    this.DoNodeMouseEnter = function (ANode) {
      if (this.FOnNodeMouseEnter != null) this.FOnNodeMouseEnter(this,ANode);
    };
    this.DoNodeDblClick = function (ANode) {
      if (this.FOnNodeDblClick != null) this.FOnNodeDblClick(this,ANode);
    };
    this.DoGetNumberOfNodes = function (ANode, ANumberOfNodes) {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.DoGetNumberOfNodes.apply(this,arguments);
      if (this.FAdapter != null) this.FAdapter.GetNumberOfNodes(ANode,ANumberOfNodes);
      if (this.FOnGetNumberOfNodes != null) {
        this.FUpdateCount$1 = this.FUpdateCount$1 + 1;
        this.FNodeListBuild = false;
        this.FNodes.Clear();
        this.FUpdateCount$1 = this.FUpdateCount$1 - 1;
        this.FOnGetNumberOfNodes(this,ANode,ANumberOfNodes);
      };
    };
    this.DoGetNodeText = function (ANode, AColumn, AMode, AText) {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.DoGetNodeText.apply(this,arguments);
      if (this.FAdapter != null) this.FAdapter.GetNodeText(AColumn,ANode,AText);
      if (this.FOnGetNodeText != null) this.FOnGetNodeText(this,ANode,AColumn,AMode,AText);
    };
    this.DoGetNodeData = function (ANode) {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.DoGetNodeData.apply(this,arguments);
      if (this.FOnGetNodeData != null) this.FOnGetNodeData(this,ANode);
    };
    this.DoGetNodeTitle = function (ANode, AColumn, AMode, ATitle) {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.DoGetNodeTitle.apply(this,arguments);
      if (this.FOnGetNodeTitle != null) this.FOnGetNodeTitle(this,ANode,AColumn,AMode,ATitle);
    };
    this.DoGetNodeTitleExpanded = function (ANode, AColumn, AExpanded) {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.DoGetNodeTitleExpanded.apply(this,arguments);
      if (this.FOnGetNodeExpanded != null) this.FOnGetNodeExpanded(this,ANode,AColumn,AExpanded);
    };
    this.DoGetNodeTrimming = function (ANode, AColumn, ATrimming) {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.DoGetNodeTrimming.apply(this,arguments);
      if (this.FOnGetNodeTrimming != null) this.FOnGetNodeTrimming(this,ANode,AColumn,ATrimming);
    };
    this.DoGetNodeHorizontalTextAlign = function (ANode, AColumn, AHorizontalTextAlign) {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.DoGetNodeHorizontalTextAlign.apply(this,arguments);
      if (this.FOnGetNodeHorizontalTextAlign != null) this.FOnGetNodeHorizontalTextAlign(this,ANode,AColumn,AHorizontalTextAlign);
    };
    this.DoGetNodeVerticalTextAlign = function (ANode, AColumn, AVerticalTextAlign) {
      if (this.FOnGetNodeVerticalTextAlign != null) this.FOnGetNodeVerticalTextAlign(this,ANode,AColumn,AVerticalTextAlign);
    };
    this.DoGetNodeWordWrapping = function (ANode, AColumn, AWordWrapping) {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.DoGetNodeWordWrapping.apply(this,arguments);
      if (this.FOnGetNodeWordWrapping != null) this.FOnGetNodeWordWrapping(this,ANode,AColumn,AWordWrapping);
    };
    this.DoGetNodeTitleTrimming = function (ANode, AColumn, ATrimming) {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.DoGetNodeTitleTrimming.apply(this,arguments);
      if (this.FOnGetNodeTitleTrimming != null) this.FOnGetNodeTitleTrimming(this,ANode,AColumn,ATrimming);
    };
    this.DoGetNodeTitleHorizontalTextAlign = function (ANode, AColumn, AHorizontalTextAlign) {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.DoGetNodeTitleHorizontalTextAlign.apply(this,arguments);
      if (this.FOnGetNodeTitleHorizontalTextAlign != null) this.FOnGetNodeTitleHorizontalTextAlign(this,ANode,AColumn,AHorizontalTextAlign);
    };
    this.DoGetNodeTitleVerticalTextAlign = function (ANode, AColumn, AVerticalTextAlign) {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.DoGetNodeTitleVerticalTextAlign.apply(this,arguments);
      if (this.FOnGetNodeTitleVerticalTextAlign != null) this.FOnGetNodeTitleVerticalTextAlign(this,ANode,AColumn,AVerticalTextAlign);
    };
    this.DoGetNodeTitleWordWrapping = function (ANode, AColumn, AWordWrapping) {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.DoGetNodeTitleWordWrapping.apply(this,arguments);
      if (this.FOnGetNodeTitleWordWrapping != null) this.FOnGetNodeTitleWordWrapping(this,ANode,AColumn,AWordWrapping);
    };
    this.DoGetNodeExtraSize = function (ANode, AColumn, AExtraSize) {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.DoGetNodeExtraSize.apply(this,arguments);
      if (this.FOnGetNodeExtraSize != null) this.FOnGetNodeExtraSize(this,ANode,AColumn,AExtraSize);
    };
    this.DoGetNodeTitleExtraSize = function (ANode, AColumn, ATitleExtraSize) {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.DoGetNodeTitleExtraSize.apply(this,arguments);
      if (this.FOnGetNodeTitleExtraSize != null) this.FOnGetNodeTitleExtraSize(this,ANode,AColumn,ATitleExtraSize);
    };
    this.DoGetColumnTrimming = function (AColumn, AKind, ATrimming) {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.DoGetColumnTrimming.apply(this,arguments);
      if (this.FOnGetColumnTrimming != null) this.FOnGetColumnTrimming(this,AColumn,AKind,ATrimming);
    };
    this.DoGetColumnHorizontalTextAlign = function (AColumn, AKind, AHorizontalTextAlign) {
      if (this.FOnGetColumnHorizontalTextAlign != null) this.FOnGetColumnHorizontalTextAlign(this,AColumn,AKind,AHorizontalTextAlign);
    };
    this.DoGetColumnVerticalTextAlign = function (AColumn, AKind, AVerticalTextAlign) {
      if (this.FOnGetColumnVerticalTextAlign != null) this.FOnGetColumnVerticalTextAlign(this,AColumn,AKind,AVerticalTextAlign);
    };
    this.DoGetColumnWordWrapping = function (AColumn, AKind, AWordWrapping) {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.DoGetColumnWordWrapping.apply(this,arguments);
      if (this.FOnGetColumnWordWrapping != null) this.FOnGetColumnWordWrapping(this,AColumn,AKind,AWordWrapping);
    };
    this.DoGetNodeCheckType = function (ANode, AColumn, ACheckType) {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.DoGetNodeCheckType.apply(this,arguments);
      if (this.FOnGetNodeCheckType != null) this.FOnGetNodeCheckType(this,ANode,AColumn,ACheckType);
    };
    this.DoGetNodeHeight = function (ANode, AColumn, AHeight) {
      if (this.FOnGetNodeHeight != null) this.FOnGetNodeHeight(this,ANode,AColumn,AHeight);
    };
    this.DoGetNodeIcon = function (ANode, AColumn, ALarge, AIcon) {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.DoGetNodeIcon.apply(this,arguments);
      if (this.FOnGetNodeIcon != null) this.FOnGetNodeIcon(this,ANode,AColumn,ALarge,AIcon);
    };
    this.DoGetNodeIconSize = function (ANode, AColumn, ALarge, AIcon, AIconWidth, AIconHeight) {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.DoGetNodeIconSize.apply(this,arguments);
      if (this.FOnGetNodeIconSize != null) this.FOnGetNodeIconSize(this,ANode,AColumn,ALarge,AIcon,AIconWidth,AIconHeight);
    };
    this.DoGetNodeSelectedColor = function (ANode, AColor) {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.DoGetNodeSelectedColor.apply(this,arguments);
      if (this.FOnGetNodeSelectedStrokeColor != null) this.FOnGetNodeSelectedStrokeColor(this,ANode,AColor);
    };
    this.DoGetNodeSelectedStrokeColor = function (ANode, AColor) {
      if (this.FOnGetNodeSelectedColor != null) this.FOnGetNodeSelectedStrokeColor(this,ANode,AColor);
    };
    this.DoGetNodeSides = function (ANode, ASides) {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.DoGetNodeSides.apply(this,arguments);
      if (this.FOnGetNodeSides != null) this.FOnGetNodeSides(this,ANode,ASides);
    };
    this.DoGetNodeRounding = function (ANode, ARounding, ACorners) {
      if (this.FOnGetNodeRounding != null) this.FOnGetNodeRounding(this,ANode,ARounding,ACorners);
    };
    this.DoGetNodeDisabledColor = function (ANode, AColor) {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.DoGetNodeDisabledColor.apply(this,arguments);
      if (this.FOnGetNodeDisabledColor != null) this.FOnGetNodeDisabledColor(this,ANode,AColor);
    };
    this.DoGetNodeDisabledStrokeColor = function (ANode, AColor) {
      if (this.FOnGetNodeDisabledStrokeColor != null) this.FOnGetNodeDisabledStrokeColor(this,ANode,AColor);
    };
    this.DoGetNodeColor = function (ANode, AColor) {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.DoGetNodeColor.apply(this,arguments);
      if (this.FOnGetNodeColor != null) this.FOnGetNodeColor(this,ANode,AColor);
    };
    this.DoGetNodeStrokeColor = function (ANode, AColor) {
      if (this.FOnGetNodeStrokeColor != null) this.FOnGetNodeStrokeColor(this,ANode,AColor);
    };
    this.DoGetNodeSelectedTextColor = function (ANode, AColumn, ATextColor) {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.DoGetNodeSelectedTextColor.apply(this,arguments);
      if (this.FOnGetNodeSelectedTextColor != null) this.FOnGetNodeSelectedTextColor(this,ANode,AColumn,ATextColor);
    };
    this.DoGetNodeDisabledTextColor = function (ANode, AColumn, ATextColor) {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.DoGetNodeDisabledTextColor.apply(this,arguments);
      if (this.FOnGetNodeDisabledTextColor != null) this.FOnGetNodeDisabledTextColor(this,ANode,AColumn,ATextColor);
    };
    this.DoGetNodeTextColor = function (ANode, AColumn, ATextColor) {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.DoGetNodeTextColor.apply(this,arguments);
      if (this.FOnGetNodeTextColor != null) this.FOnGetNodeTextColor(this,ANode,AColumn,ATextColor);
    };
    this.DoGetNodeSelectedTitleColor = function (ANode, AColumn, ATitleColor) {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.DoGetNodeSelectedTitleColor.apply(this,arguments);
      if (this.FOnGetNodeSelectedTitleColor != null) this.FOnGetNodeSelectedTitleColor(this,ANode,AColumn,ATitleColor);
    };
    this.DoGetNodeDisabledTitleColor = function (ANode, AColumn, ATitleColor) {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.DoGetNodeDisabledTitleColor.apply(this,arguments);
      if (this.FOnGetNodeDisabledTitleColor != null) this.FOnGetNodeDisabledTitleColor(this,ANode,AColumn,ATitleColor);
    };
    this.DoGetNodeTitleColor = function (ANode, AColumn, ATitleColor) {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.DoGetNodeTitleColor.apply(this,arguments);
      if (this.FOnGetNodeTitleColor != null) this.FOnGetNodeTitleColor(this,ANode,AColumn,ATitleColor);
    };
    this.DoIsNodeExpanded = function (ANode, AExpanded) {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.DoIsNodeExpanded.apply(this,arguments);
      if (this.FOnIsNodeExpanded != null) this.FOnIsNodeExpanded(this,ANode,AExpanded);
    };
    this.DoIsNodeExtended = function (ANode, AExtended) {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.DoIsNodeExtended.apply(this,arguments);
      if (this.FOnIsNodeExtended != null) this.FOnIsNodeExtended(this,ANode,AExtended);
    };
    this.DoIsNodeChecked = function (ANode, AColumn, AChecked) {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.DoIsNodeChecked.apply(this,arguments);
      if (this.FOnIsNodeChecked != null) this.FOnIsNodeChecked(this,ANode,AColumn,AChecked);
    };
    this.DoIsNodeVisible = function (ANode, AVisible) {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.DoIsNodeVisible.apply(this,arguments);
      if (this.FOnIsNodeVisible != null) this.FOnIsNodeVisible(ANode,ANode,AVisible);
    };
    this.DoIsNodeEnabled = function (ANode, AEnabled) {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.DoIsNodeEnabled.apply(this,arguments);
      if (this.FOnIsNodeEnabled != null) this.FOnIsNodeEnabled(this,ANode,AEnabled);
    };
    this.DoBeforeDrawNodeText = function (AGraphics, ARect, AColumn, ANode, AText, AAllow) {
      if (this.FOnBeforeDrawNodeText != null) this.FOnBeforeDrawNodeText(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AColumn,ANode,AText,AAllow);
    };
    this.DoAfterDrawNodeText = function (AGraphics, ARect, AColumn, ANode, AText) {
      if (this.FOnAfterDrawNodeText != null) this.FOnAfterDrawNodeText(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AColumn,ANode,AText);
    };
    this.DoBeforeDrawNodeTitle = function (AGraphics, ARect, AColumn, ANode, ATitle, AAllow) {
      if (this.FOnBeforeDrawNodeTitle != null) this.FOnBeforeDrawNodeTitle(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AColumn,ANode,ATitle,AAllow);
    };
    this.DoAfterDrawNodeTitle = function (AGraphics, ARect, AColumn, ANode, ATitle) {
      if (this.FOnAfterDrawNodeTitle != null) this.FOnAfterDrawNodeTitle(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AColumn,ANode,ATitle);
    };
    this.DoBeforeDrawNodeIcon = function (AGraphics, ARect, AColumn, ANode, AIcon, AAllow) {
      if (this.FOnBeforeDrawNodeIcon != null) this.FOnBeforeDrawNodeIcon(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AColumn,ANode,AIcon,AAllow);
    };
    this.DoAfterDrawNodeIcon = function (AGraphics, ARect, AColumn, ANode, AIcon) {
      if (this.FOnAfterDrawNodeIcon != null) this.FOnAfterDrawNodeIcon(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AColumn,ANode,AIcon);
    };
    this.DoBeforeDrawNodeExtra = function (AGraphics, ARect, AColumn, ANode, AAllow) {
      if (this.FOnBeforeDrawNodeExtra != null) this.FOnBeforeDrawNodeExtra(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AColumn,ANode,AAllow);
    };
    this.DoDrawNodeExtra = function (AGraphics, ARect, AColumn, ANode) {
      if (this.FOnDrawNodeExtra != null) this.FOnDrawNodeExtra(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AColumn,ANode);
    };
    this.DoAfterDrawNodeExtra = function (AGraphics, ARect, AColumn, ANode) {
      if (this.FOnAfterDrawNodeExtra != null) this.FOnAfterDrawNodeExtra(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AColumn,ANode);
    };
    this.DoBeforeDrawNodeTitleExtra = function (AGraphics, ARect, AColumn, ANode, AAllow) {
      if (this.FOnBeforeDrawNodeTitleExtra != null) this.FOnBeforeDrawNodeTitleExtra(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AColumn,ANode,AAllow);
    };
    this.DoDrawNodeTitleExtra = function (AGraphics, ARect, AColumn, ANode) {
      if (this.FOnDrawNodeTitleExtra != null) this.FOnDrawNodeTitleExtra(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AColumn,ANode);
    };
    this.DoAfterDrawNodeTitleExtra = function (AGraphics, ARect, AColumn, ANode) {
      if (this.FOnAfterDrawNodeTitleExtra != null) this.FOnAfterDrawNodeTitleExtra(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AColumn,ANode);
    };
    this.DoBeforeDrawNodeCheck = function (AGraphics, ARect, AColumn, ANode, ACheck, AAllow) {
      if (this.FOnBeforeDrawNodeCheck != null) this.FOnBeforeDrawNodeCheck(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AColumn,ANode,ACheck,AAllow);
    };
    this.DoAfterDrawNodeCheck = function (AGraphics, ARect, AColumn, ANode, ACheck) {
      if (this.FOnAfterDrawNodeCheck != null) this.FOnAfterDrawNodeCheck(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AColumn,ANode,ACheck);
    };
    this.DoBeforeDrawNodeExpand = function (AGraphics, ARect, AColumn, ANode, AExpand, AAllow) {
      if (this.FOnBeforeDrawNodeExpand != null) this.FOnBeforeDrawNodeExpand(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AColumn,ANode,AExpand,AAllow);
    };
    this.DoAfterDrawNodeExpand = function (AGraphics, ARect, AColumn, ANode, AExpand) {
      if (this.FOnAfterDrawNodeExpand != null) this.FOnAfterDrawNodeExpand(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AColumn,ANode,AExpand);
    };
    this.DoBeforeSelectNode = function (ANode, ACanSelect) {
      if (this.FOnBeforeSelectNode != null) this.FOnBeforeSelectNode(this,ANode,ACanSelect);
    };
    this.DoBeforeSelectAllNodes = function (ACanSelect) {
      if (this.FOnBeforeSelectAllNodes != null) this.FOnBeforeSelectAllNodes(this,ACanSelect);
    };
    this.DoBeforeUnSelectNode = function (ANode, ACanUnSelect) {
      if (this.FOnBeforeUnSelectNode != null) this.FOnBeforeUnSelectNode(this,ANode,ACanUnSelect);
    };
    this.DoCustomizeInplaceEditor = function (ANode, AColumn, AInplaceEditor) {
      if (this.FOnCustomizeInplaceEditor != null) this.FOnCustomizeInplaceEditor(this,ANode,AColumn,AInplaceEditor);
    };
    this.DoBeforeSizeColumn = function (AColumn, AColumnSize, ANewColumnSize, AAllow) {
      if (this.FOnBeforeSizeColumn != null) this.FOnBeforeSizeColumn(this,AColumn,AColumnSize,ANewColumnSize,AAllow);
    };
    this.DoAfterSizeColumn = function (AColumn, AColumnSize) {
      if (this.FOnAfterSizeColumn != null) this.FOnAfterSizeColumn(this,AColumn,AColumnSize);
    };
    this.DoBeforeUpdateNode = function (ANode, AColumn, AText, ACanUpdate) {
      if (this.FOnBeforeUpdateNode != null) this.FOnBeforeUpdateNode(this,ANode,AColumn,AText,ACanUpdate);
    };
    this.DoNodeChanged = function (ANode) {
      if (this.FOnNodeChanged != null) this.FOnNodeChanged(this,ANode);
    };
    this.DoAfterUpdateNode = function (ANode, AColumn) {
      if (this.FOnAfterUpdateNode != null) this.FOnAfterUpdateNode(this,ANode,AColumn);
    };
    this.DoUpdateNodeText = function (ANode, AColumn, AText) {
    };
    this.DoUpdateNodeTitle = function (ANode, AColumn, ATitle) {
    };
    this.DoBeforeExpandNode = function (ANode, ACanExpand) {
      if (this.FOnBeforeExpandNode != null) this.FOnBeforeExpandNode(this,ANode,ACanExpand);
    };
    this.DoAfterExpandNode = function (ANode) {
      if (this.FOnAfterExpandNode != null) this.FOnAfterExpandNode(this,ANode);
    };
    this.DoBeforeCollapseNode = function (ANode, ACanCollapse) {
      if (this.FOnBeforeCollapseNode != null) this.FOnBeforeCollapseNode(this,ANode,ACanCollapse);
    };
    this.DoAfterCollapseNode = function (ANode) {
      if (this.FOnAfterCollapseNode != null) this.FOnAfterCollapseNode(this,ANode);
    };
    this.DoBeforeCheckNode = function (ANode, AColumn, ACanCheck) {
      if (this.FOnBeforeCheckNode != null) this.FOnBeforeCheckNode(this,ANode,AColumn,ACanCheck);
    };
    this.DoAfterCheckNode = function (ANode, AColumn) {
      if (this.FOnAfterCheckNode != null) this.FOnAfterCheckNode(this,ANode,AColumn);
    };
    this.DoBeforeUnCheckNode = function (ANode, AColumn, ACanUnCheck) {
      if (this.FOnBeforeUnCheckNode != null) this.FOnBeforeUnCheckNode(this,ANode,AColumn,ACanUnCheck);
    };
    this.DoAfterUnCheckNode = function (ANode, AColumn) {
      if (this.FOnAfterUnCheckNode != null) this.FOnAfterUnCheckNode(this,ANode,AColumn);
    };
    this.DoNodeAnchorClick = function (ANode, AColumn, AAnchor) {
      if (this.FOnNodeAnchorClick != null) {
        this.FOnNodeAnchorClick(this,ANode,AColumn,AAnchor)}
       else if (this.FInteraction.FAutoOpenURL) pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.OpenURL(AAnchor);
    };
    this.DoNodeTitleAnchorClick = function (ANode, AColumn, AAnchor) {
      if (this.FOnNodeTitleAnchorClick != null) {
        this.FOnNodeTitleAnchorClick(this,ANode,AColumn,AAnchor)}
       else if (this.FInteraction.FAutoOpenURL) pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.OpenURL(AAnchor);
    };
    this.DoColumnAnchorClick = function (AColumn, AAnchor) {
      if (this.FOnColumnAnchorClick != null) {
        this.FOnColumnAnchorClick(this,AColumn,AAnchor)}
       else if (this.FInteraction.FAutoOpenURL) pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.OpenURL(AAnchor);
    };
    this.DoGetHTMLTemplateValue = function (ANodeValue, AName, AValue) {
      if (this.FOnGetHTMLTemplateValue != null) this.FOnGetHTMLTemplateValue(this,ANodeValue,AName,AValue);
    };
    this.DoGetHTMLTemplate = function (ANodeValue, AColumnIndex, AHTMLTemplate) {
      if (this.FOnGetHTMLTemplate != null) this.FOnGetHTMLTemplate(this,ANodeValue,AColumnIndex,AHTMLTemplate);
    };
    this.DoBeforeAddJSONNode = function (AJSONValue, AAddNode) {
      if (this.FOnBeforeAddJSONNode != null) this.FOnBeforeAddJSONNode(this,AJSONValue,AAddNode);
    };
    this.DoAfterAddJSONNode = function (ANode, AJSONValue) {
      if (this.FOnAfterAddJSONNode != null) this.FOnAfterAddJSONNode(this,ANode,AJSONValue);
    };
    this.DoBeforeOpenInplaceEditor = function (ANode, AColumn, ACanOpen) {
      if (this.FOnBeforeOpenInplaceEditor != null) this.FOnBeforeOpenInplaceEditor(this,ANode,AColumn,ACanOpen);
    };
    this.DoAfterOpenInplaceEditor = function (ANode, AColumn, AInplaceEditor, AInplaceEditorRect) {
      if (this.FOnAfterOpenInplaceEditor != null) this.FOnAfterOpenInplaceEditor(this,ANode,AColumn,AInplaceEditor,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(AInplaceEditorRect));
    };
    this.DoCloseInplaceEditor = function (ANode, AColumn, AInplaceEditor, ACancelled, ACanClose) {
      if (this.FOnCloseInplaceEditor != null) this.FOnCloseInplaceEditor(this,ANode,AColumn,AInplaceEditor,ACancelled,ACanClose);
    };
    this.UpdateInplaceEditorPosition = function () {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rt = pas.Types.TRect.$new();
      if ((this.FUpdateCount$1 > 0) || (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState)) return;
      if ((this.FUpdateNode != null) && (this.FUpdateNodeColumn !== -1) && (this.FInplaceEditor != null) && this.FInplaceEditorActive) {
        if ((this.FUpdateNode.FRow >= this.StartRow()) && (this.FUpdateNode.FRow <= this.StopRow())) {
          r.$assign(this.GetInplaceEditorRect(this.FUpdateNode,this.FUpdateNodeColumn));
          this.FInplaceEditor.SetParent(this);
          this.FInplaceEditor.SetVisible(false);
          if (this.FInplaceEditor != null) {
            rt.$assign(pas.Types.Rect(Math.round(r.Left),Math.round(r.Top),Math.round(r.Right),Math.round(r.Bottom)));
            this.FInplaceEditor.SetBoundsRect(rt);
            this.FInplaceEditor.SetBoundsRect(pas.Types.Rect(rt.Left,rt.Top + rtl.trunc((rt.Bottom - rt.Top - this.FInplaceEditor.GetHeight()) / 2),rt.Right,rt.Top + rtl.trunc((rt.Bottom - rt.Top - this.FInplaceEditor.GetHeight()) / 2) + this.FInplaceEditor.GetHeight()));
            this.FInplaceEditor.SetVisible(true);
          };
        } else this.FInplaceEditor.SetParent(null);
      };
    };
    this.DoGetInplaceEditor = function (ANode, AColumn, AInplaceEditorClass) {
      if (this.FOnGetInplaceEditor != null) this.FOnGetInplaceEditor(this,ANode,AColumn,AInplaceEditorClass);
    };
    this.CloseInplaceEditor = function (ACancel, AFlagClose) {
      var str = "";
      var b = false;
      var c = false;
      var n = "";
      if (this.FClosing) {
        if (AFlagClose) this.FInplaceEditorClosed = true;
        return;
      };
      this.FClosing = true;
      if ((this.FUpdateNode != null) && (this.FUpdateNodeColumn !== -1) && (this.FInplaceEditor != null)) {
        if (!ACancel) {
          try {
            n = "";
            if (pas["WEBLib.StdCtrls"].TEdit.isPrototypeOf(this.FInplaceEditor)) {
              str = rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TEdit).GetText()}
             else if (pas["WEBLib.StdCtrls"].TComboBox.isPrototypeOf(this.FInplaceEditor)) {
              str = rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TComboBox).GetText()}
             else if (pas["WEBLib.StdCtrls"].TMemo.isPrototypeOf(this.FInplaceEditor)) str = rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TMemo).GetText();
            n = str;
          } finally {
          };
        };
        c = true;
        this.DoCloseInplaceEditor(this.FUpdateNode,this.FUpdateNodeColumn,this.FInplaceEditor,ACancel,{get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }});
        if (c) {
          b = true;
          this.DoBeforeUpdateNode(this.FUpdateNode,this.FUpdateNodeColumn,{get: function () {
              return n;
            }, set: function (v) {
              n = v;
            }},{get: function () {
              return b;
            }, set: function (v) {
              b = v;
            }});
          if (b && !ACancel) {
            this.FUpdateCount$1 = this.FUpdateCount$1 + 1;
            if (this.FUpdateNode.FNode != null) this.FUpdateNode.FNode.SetText(this.FUpdateNodeColumn,n);
            this.DoUpdateNodeText(this.FUpdateNode,this.FUpdateNodeColumn,n);
            this.FUpdateCount$1 = this.FUpdateCount$1 - 1;
            this.DoAfterUpdateNode(this.FUpdateNode,this.FUpdateNodeColumn);
            this.DoNodeChanged(this.FUpdateNode);
          };
          this.FInplaceEditor.SetParent(null);
          if (this.FOldInplaceEditor != null) rtl.free(this,"FOldInplaceEditor");
          this.FOldInplaceEditor = this.FInplaceEditor;
          this.FInplaceEditor = null;
          this.FInplaceEditorActive = false;
        };
        this.ResetNodes(false);
        this.UpdateTreeView();
        this.Invalidate();
        if (this.CanFocus()) this.SetFocus();
      };
      this.FClosing = false;
      if (AFlagClose) this.FInplaceEditorClosed = true;
    };
    this.DoFocusedNodeChanged = function (ANode) {
      if (this.FOnFocusedNodeChanged != null) this.FOnFocusedNodeChanged(this,ANode);
    };
    this.DoAfterSelectNode = function (ANode) {
      if (this.FAdapter != null) this.FAdapter.SelectNode(ANode);
      if (this.FOnAfterSelectNode != null) this.FOnAfterSelectNode(this,ANode);
    };
    this.DoAfterSelectAllNodes = function () {
      if (this.FOnAfterSelectAllNodes != null) this.FOnAfterSelectAllNodes(this);
    };
    this.DoAfterUnSelectNode = function (ANode) {
      if (this.FOnAfterUnSelectNode != null) this.FOnAfterUnSelectNode(this,ANode);
    };
    this.DoHScroll = function (APosition) {
      if (this.FOnHScroll != null) this.FOnHScroll(this,APosition);
    };
    this.DoVScroll = function (APosition) {
      if (this.FAdapter != null) this.FAdapter.ScrollTreeView(this.GetFirstVisibleVirtualNodeRow() - this.FOldTopRow);
      if (this.FOnVScroll != null) this.FOnVScroll(this,APosition);
    };
    this.ResetNodes = function (AUpdateAll) {
      var I = 0;
      var v = null;
      var st = 0;
      var stp = 0;
      if (this.FVisibleNodes != null) {
        if (AUpdateAll) {
          st = 0;
          stp = this.FRowCount - 1;
        } else {
          st = this.StartRow();
          stp = this.StopRow();
        };
        for (var $l = st, $end = stp; $l <= $end; $l++) {
          I = $l;
          v = this.GetVisibleNodeForIndex(I);
          if (v != null) {
            this.FTotalRowHeight = (this.FTotalRowHeight - v.FHeight) + this.GetDefaultRowHeight(v);
            this.UpdateNodeHeight(v,this.GetDefaultRowHeight(v));
            this.UpdateNodeCalculated(v,false);
          };
        };
      };
    };
    this.CreateDragBitmap = function () {
      var g = null;
      var dr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = "";
      if (!(this.FDragNode != null)) return;
      this.DestroyDragBitmap();
      dr.$assign(this.FDragNode.FCache.FDrawRect);
      this.FDragBitmap = pas["WEBLib.TMSFNCImage"].TTMSFNCImage.$create("Create$1",[this]);
      this.FDragBitmap.SetWidth(Math.round((dr.Right - dr.Left) / this.FResourceScaleFactor));
      this.FDragBitmap.SetHeight(Math.round((dr.Bottom - dr.Top) / this.FResourceScaleFactor));
      this.FDragBitmap.SetLeft(Math.round(dr.Left / this.FResourceScaleFactor));
      this.FDragBitmap.SetTop(Math.round(dr.Top / this.FResourceScaleFactor));
      g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[Math.round(this.FDragBitmap.GetWidth() * this.FResourceScaleFactor),Math.round(this.FDragBitmap.GetHeight() * this.FResourceScaleFactor),false,true]);
      g.FBitmapContainer = this.GetBitmapContainer();
      g.FOptimizedHTMLDrawing = this.FOptimizedHTMLDrawing;
      try {
        if (g.BeginScene()) {
          this.DrawNode(g,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,dr.Right - dr.Left,dr.Bottom - dr.Top)),this.FDragNode,false,-dr.Left,-dr.Top);
          g.EndScene();
        };
        r = g.FBitmap.GetBase64Image();
        this.FDragBitmap.FBitmaps.AddBitmapFromResource(r,1.0);
      } finally {
        g = rtl.freeLoc(g);
      };
      this.FDragBitmap.SetParent(this);
    };
    this.DestroyDragBitmap = function () {
      if (this.FDragBitmap != null) {
        this.FDragBitmap.SetParent(null);
        rtl.free(this,"FDragBitmap");
        this.FDragBitmap = null;
      };
    };
    this.HandleSelectNode = function (ANode, ATriggerEvents, AKeyBoard, AMultiSelect, AColumn) {
      var I = 0;
      var it = null;
      var en = false;
      if (!AMultiSelect) {
        for (var $l = this.FSelectedNodes.GetCount() - 1; $l >= 0; $l--) {
          I = $l;
          it = this.FSelectedNodes.GetItem(I);
          if (it !== ANode) {
            en = true;
            if (ATriggerEvents) this.DoBeforeUnSelectNode(it,{get: function () {
                return en;
              }, set: function (v) {
                en = v;
              }});
            if (en) {
              if (this.FSelectedNodes.IndexOf(it) > -1) this.FSelectedNodes.Remove(it);
              if (ATriggerEvents) this.DoAfterUnSelectNode(it);
            };
          };
        };
      };
      if (ANode != null) {
        if ((this.FSelectedNodes.IndexOf(ANode) > -1) || ((this.FDownNode != null) && (this.FDownNode.FParentNode !== ANode.FParentNode) && ($mod.TMultiSelectStyles.msSiblingOnly in this.FInteraction.FMultiSelectStyle) && AMultiSelect)) {
          en = true;
          if (ATriggerEvents) this.DoBeforeUnSelectNode(ANode,{get: function () {
              return en;
            }, set: function (v) {
              en = v;
            }});
          if (en) {
            if (this.FSelectedNodes.IndexOf(ANode) > -1) this.FSelectedNodes.Remove(ANode);
            if (ATriggerEvents) this.DoAfterUnSelectNode(ANode);
          };
        } else {
          if (((this.FDownNode != null) && ((this.FDownNode.FParentNode === ANode.FParentNode) || !AMultiSelect)) || !($mod.TMultiSelectStyles.msSiblingOnly in this.FInteraction.FMultiSelectStyle)) {
            if ((this.FVisibleNodes.IndexOf(ANode) > -1) || !($mod.TMultiSelectStyles.msVisibleOnly in this.FInteraction.FMultiSelectStyle)) {
              en = true;
              if (ATriggerEvents) this.DoBeforeSelectNode(ANode,{get: function () {
                  return en;
                }, set: function (v) {
                  en = v;
                }});
              if (en) {
                this.FSelectedNodes.Add(ANode);
                if (ATriggerEvents) this.DoAfterSelectNode(ANode);
              };
            };
          };
        };
        if (!AKeyBoard && ATriggerEvents) {
          this.DoNodeClick(ANode);
          this.DoNodeValueClick(ANode,AColumn);
        };
      };
    };
    this.Animate = function (Sender) {
      var dx = 0.0;
      var dy = 0.0;
      var posx = 0.0;
      var posy = 0.0;
      var dvo = 0.0;
      var posvo = 0.0;
      var animh = false;
      var animv = false;
      var animvo = false;
      posy = this.GetVScrollValue();
      posx = this.GetHScrollValue();
      posvo = this.FVerticalOffset;
      animv = false;
      animh = false;
      animvo = false;
      if (this.FInteraction.FAnimationFactor > 0) {
        dx = Math.abs(this.FScrollHTo - posx) / Math.max(1,Math.abs(this.FSpX) * this.FInteraction.FAnimationFactor);
        dy = Math.abs(this.FScrollVTo - posy) / Math.max(1,Math.abs(this.FSpY) * this.FInteraction.FAnimationFactor);
        dvo = Math.abs(this.FVerticalOffsetTo - posvo) / this.FInteraction.FAnimationFactor;
        if (this.FAnimateVerticalPos) animv = $impl.AnimateDouble({get: function () {
            return posy;
          }, set: function (v) {
            posy = v;
          }},{p: this, get: function () {
            return this.p.FScrollVTo;
          }, set: function (v) {
            this.p.FScrollVTo = v;
          }},dy,0.01);
        if (this.FAnimateHorizontalPos) animh = $impl.AnimateDouble({get: function () {
            return posx;
          }, set: function (v) {
            posx = v;
          }},{p: this, get: function () {
            return this.p.FScrollHTo;
          }, set: function (v) {
            this.p.FScrollHTo = v;
          }},dx,0.01);
        if (this.FAnimateVerticalOffset) animvo = $impl.AnimateDouble({get: function () {
            return posvo;
          }, set: function (v) {
            posvo = v;
          }},{p: this, get: function () {
            return this.p.FVerticalOffsetTo;
          }, set: function (v) {
            this.p.FVerticalOffsetTo = v;
          }},dvo,0.01);
      };
      this.FAnimating = animv || animh;
      if (this.FAnimating) {
        this.Scroll(posx,posy)}
       else if (animvo) {
        this.FVerticalOffset = posvo;
        this.UpdateDisplay();
      } else {
        this.FVerticalOffset = this.FVerticalOffsetTo;
        this.UpdateDisplay();
        this.FAnimateVerticalPos = false;
        this.FAnimateTimer.SetEnabled(false);
        this.FAnimateHorizontalPos = false;
      };
    };
    this.ColumnStrokeChanged = function (Sender) {
      this.Invalidate();
    };
    this.DragTime = function (Sender) {
      var contentr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (this.FReorderMode || (this.FDragMode$1 && this.FDragModeStarted && this.AlternativeDragDrop())) {
        contentr.$assign(this.GetNodesRect());
        if (this.FY >= contentr.Bottom) {
          this.FDragRow = this.FDragRow + 1;
          this.ScrollToVirtualNode(this.GetNodeForRow(this.FDragRow),false,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeScrollPosition.tvnspTop,false);
        } else if (this.FY <= contentr.Top) {
          this.FDragRow = this.FDragRow - 1;
          this.ScrollToVirtualNode(this.GetNodeForRow(this.FDragRow),false,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeScrollPosition.tvnspTop,false);
        };
      };
    };
    this.StopAnimationTimer = function () {
      this.FAnimateTimer.SetEnabled(false);
      this.FAnimating = false;
    };
    this.HandleNodeToggle = function (ANode) {
      var e = false;
      if ((ANode != null) && (ANode.FChildren > 0)) {
        if (ANode.FExpanded) {
          e = true;
          this.FBlockUpdateNode = true;
          this.DoBeforeCollapseNode(ANode,{get: function () {
              return e;
            }, set: function (v) {
              e = v;
            }});
          this.FBlockUpdateNode = false;
          if (e) {
            this.ToggleNodeInternal(ANode,false);
            this.DoAfterCollapseNode(ANode);
          };
        } else {
          e = true;
          this.FBlockUpdateNode = true;
          this.DoBeforeExpandNode(ANode,{get: function () {
              return e;
            }, set: function (v) {
              e = v;
            }});
          this.FBlockUpdateNode = false;
          if (e) {
            this.ToggleNodeInternal(ANode,false);
            this.DoAfterExpandNode(ANode);
          };
        };
      };
    };
    this.HandleNodeExtra = function (ANode) {
    };
    this.HandleNodeTitleExtra = function (ANode) {
    };
    this.HandleNodeToggleCheck = function (ANode, AColumn) {
      var chk = false;
      var e = false;
      var chkt = 0;
      if (ANode != null) {
        if ((AColumn >= 0) && (AColumn <= (rtl.length(ANode.FCheckStates) - 1))) {
          chk = ANode.FCheckStates[AColumn];
          if (chk) {
            chkt = pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeCheckType.tvntNone;
            this.DoGetNodeCheckType(ANode,AColumn,{get: function () {
                return chkt;
              }, set: function (v) {
                chkt = v;
              }});
            if (chkt === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeCheckType.tvntCheckBox) {
              e = true;
              this.DoBeforeUnCheckNode(ANode,AColumn,{get: function () {
                  return e;
                }, set: function (v) {
                  e = v;
                }});
              if (e) {
                this.ToggleCheckNodeInternal(ANode,AColumn,false);
                this.DoAfterUnCheckNode(ANode,AColumn);
              };
            };
          } else {
            e = true;
            this.DoBeforeCheckNode(ANode,AColumn,{get: function () {
                return e;
              }, set: function (v) {
                e = v;
              }});
            if (e) {
              this.ToggleCheckNodeInternal(ANode,AColumn,false);
              this.DoAfterCheckNode(ANode,AColumn);
            };
          };
        };
      };
    };
    this.HandleNodeExpand = function (ANode, ARecurse) {
      var e = false;
      if (ANode != null) {
        if (!ANode.FExpanded && (ANode.FChildren > 0)) {
          e = true;
          this.FBlockUpdateNode = true;
          this.DoBeforeExpandNode(ANode,{get: function () {
              return e;
            }, set: function (v) {
              e = v;
            }});
          this.FBlockUpdateNode = false;
          if (e) {
            this.ToggleNodeInternal(ANode,ARecurse);
            this.DoAfterExpandNode(ANode);
          };
        };
      };
    };
    this.HandleNodeCollapse = function (ANode, ARecurse) {
      var e = false;
      if (ANode != null) {
        if (ANode.FExpanded && (ANode.FChildren > 0)) {
          e = true;
          this.FBlockUpdateNode = true;
          this.DoBeforeCollapseNode(ANode,{get: function () {
              return e;
            }, set: function (v) {
              e = v;
            }});
          this.FBlockUpdateNode = false;
          if (e) {
            this.ToggleNodeInternal(ANode,ARecurse);
            this.DoAfterCollapseNode(ANode);
          };
        };
      };
    };
    this.HandleCustomKeys = function (AKey) {
    };
    this.OffsetNodeRects = function (ANode, AX, AY, ARect) {
      var C = 0;
      var nr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.$assign(this.GetNodesRect());
      pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(ARect,AX + r.Left,AY + r.Top);
      for (var $l = 0, $end = this.FColumnCount - 1; $l <= $end; $l++) {
        C = $l;
        if ((C >= 0) && (C <= (rtl.length(ANode.FTitleRects) - 1))) {
          nr.$assign(ANode.FTitleRects[C]);
          pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(nr,AX + r.Left,AY + r.Top);
          ANode.FTitleRects[C].$assign(nr);
        };
        if ((C >= 0) && (C <= (rtl.length(ANode.FTextRects) - 1))) {
          nr.$assign(ANode.FTextRects[C]);
          pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(nr,AX + r.Left,AY + r.Top);
          ANode.FTextRects[C].$assign(nr);
        };
        if ((C >= 0) && (C <= (rtl.length(ANode.FExtraRects) - 1))) {
          nr.$assign(ANode.FExtraRects[C]);
          pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(nr,AX + r.Left,AY + r.Top);
          ANode.FExtraRects[C].$assign(nr);
        };
        if ((C >= 0) && (C <= (rtl.length(ANode.FTitleExtraRects) - 1))) {
          nr.$assign(ANode.FTitleExtraRects[C]);
          pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(nr,AX + r.Left,AY + r.Top);
          ANode.FTitleExtraRects[C].$assign(nr);
        };
        if ((C >= 0) && (C <= (rtl.length(ANode.FBitmapRects) - 1))) {
          nr.$assign(ANode.FBitmapRects[C]);
          pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(nr,AX + r.Left,AY + r.Top);
          ANode.FBitmapRects[C].$assign(nr);
        };
        if ((C >= 0) && (C <= (rtl.length(ANode.FExpandRects) - 1))) {
          nr.$assign(ANode.FExpandRects[C]);
          pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(nr,AX + r.Left,AY + r.Top);
          ANode.FExpandRects[C].$assign(nr);
        };
        if ((C >= 0) && (C <= (rtl.length(ANode.FCheckRects) - 1))) {
          nr.$assign(ANode.FCheckRects[C]);
          pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(nr,AX + r.Left,AY + r.Top);
          ANode.FCheckRects[C].$assign(nr);
        };
      };
    };
    this.BuildDisplay = function (ACache, ADisplay) {
      var x = 0.0;
      var y = 0.0;
      var I = 0;
      var cache = null;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rrt = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rrb = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rg = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var grt = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var grb = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var n = null;
      if ((this.FUpdateCount$1 > 0) || (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState) || !(ACache != null) || !(ADisplay != null)) return;
      ADisplay.Clear();
      x = -this.GetHorizontalScrollPosition();
      y = -this.GetVerticalScrollPosition();
      if (this.CanApplyVerticalOffset()) y = y + this.FVerticalOffset;
      r.$assign(this.GetNodesRect());
      grt.$assign(this.GetGroupsTopRect());
      grb.$assign(this.GetGroupsBottomRect());
      rrt.$assign(this.GetColumnsTopRect());
      rrb.$assign(this.GetColumnsBottomRect());
      for (var $l = 0, $end = ACache.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        cache = ACache.GetItem$1(I);
        rg.$assign(cache.FRect);
        var $tmp = cache.FKind;
        if ($tmp === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikNode) {
          n = cache.FNode;
          if (n != null) this.OffsetNodeRects(n,pas.System.Int(x),pas.System.Int(y),rg);
        } else if ($tmp === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikGroupTop) {
          pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(rg,pas.System.Int(x) + grt.Left,grt.Top)}
         else if ($tmp === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikGroupBottom) {
          pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(rg,pas.System.Int(x) + grb.Left,grb.Top - 1)}
         else if ($tmp === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikColumnTop) {
          pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(rg,pas.System.Int(x) + rrt.Left,rrt.Top)}
         else if ($tmp === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikColumnBottom) pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(rg,pas.System.Int(x) + rrb.Left,rrb.Top - 1);
        cache.FDrawRect.$assign(rg);
        var $tmp1 = cache.FKind;
        if ($tmp1 === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikNode) {
          if (pas["WEBLib.TMSFNCTypes"].RectIntersectsWithEx(rg,r)) ADisplay.Add(cache);
        } else if ($tmp1 === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikColumnTop) {
          if (pas["WEBLib.TMSFNCTypes"].RectIntersectsWithEx(rg,rrt)) ADisplay.Add(cache);
        } else if ($tmp1 === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikColumnBottom) {
          if (pas["WEBLib.TMSFNCTypes"].RectIntersectsWithEx(rg,rrb)) ADisplay.Add(cache);
        } else if ($tmp1 === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikGroupTop) {
          if (pas["WEBLib.TMSFNCTypes"].RectIntersectsWithEx(rg,grt)) ADisplay.Add(cache);
        } else if ($tmp1 === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikGroupBottom) {
          if (pas["WEBLib.TMSFNCTypes"].RectIntersectsWithEx(rg,grb)) ADisplay.Add(cache);
        };
      };
    };
    this.UpdateCalculations = function () {
      if ((this.FUpdateCount$1 > 0) || (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState) || (pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) return;
      this.FOldTopRow = this.GetFirstVisibleVirtualNodeRow();
      this.SetColumnCount(this.FColumns.GetCount());
      if (this.FNodesAppearance.FHeightMode === $mod.TTMSFNCTreeViewNodeHeightMode.tnhmFixed) {
        this.SetDefaultRowHeight(this.FNodesAppearance.FFixedHeight)}
       else this.SetDefaultRowHeight(this.FNodesAppearance.FVariableMinimumHeight);
      if ((this.FUpdateCount$1 === 0) && !this.FBlockUpdateNodeList && !((pas.Classes.TComponentStateItem.csDestroying in this.FComponentState) || (pas.Classes.TComponentStateItem.csReading in this.FComponentState) || (pas.Classes.TComponentStateItem.csLoading in this.FComponentState))) this.BuildNodeList();
    };
    this.ResetColumnWidths = function () {
      var I = 0;
      var cl = null;
      this.BeginUpdate();
      try {
        for (var $l = 0, $end = this.FColumnCount - 1; $l <= $end; $l++) {
          I = $l;
          cl = this.FColumns.GetItem$1(I);
          if (cl != null) {
            this.SetColWidths(I,Math.max(cl.FMinimumWidth,cl.FWidth))}
           else this.SetColWidths(I,this.FDefaultColumnWidth);
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.UpdateAutoSizing = function () {
      if (pas.Classes.TComponentStateItem.csReading in this.FComponentState) return;
      this.IncUpdateCount$1();
      try {
        if (this.FColumnsAppearance.FStretch) {
          if (this.FColumnsAppearance.FStretchAll) {
            this.FColumnStretchingActive = this.StretchColumns(pas["WEBLib.TMSFNCTreeViewBase"].TTMSFNCTreeViewStretchingMode.stmAll,-1,-1)}
           else this.FColumnStretchingActive = this.StretchColumns(pas["WEBLib.TMSFNCTreeViewBase"].TTMSFNCTreeViewStretchingMode.stmIndex,this.FColumnsAppearance.FStretchColumn,-1);
          this.FColumnStretchingApplied = true;
        } else if (this.FColumnStretchingApplied) {
          this.FColumnStretchingActive = false;
          this.FColumnStretchingApplied = false;
          this.ResetColumnWidths();
        };
      } finally {
        this.DecUpdateCount$1();
      };
    };
    this.UpdateColumnRowCalculations = function (AUpdateTotalRowHeight) {
      var I = 0;
      var r = 0.0;
      var c = 0.0;
      var lm = 0.0;
      var tm = 0.0;
      var rm = 0.0;
      var bm = 0.0;
      this.FColumnP.Clear();
      c = 0;
      this.SetColPos(0,c);
      for (var $l = 0, $end = this.FColumnCount - 1; $l <= $end; $l++) {
        I = $l;
        c = c + this.GetColWidths(I);
        this.SetColPos(I + 1,c);
      };
      this.FTotalColumnWidth = c;
      if (AUpdateTotalRowHeight) {
        lm = 0;
        tm = 0;
        rm = 0;
        bm = 0;
        this.GetNodeMargins({get: function () {
            return lm;
          }, set: function (v) {
            lm = v;
          }},{get: function () {
            return tm;
          }, set: function (v) {
            tm = v;
          }},{get: function () {
            return rm;
          }, set: function (v) {
            rm = v;
          }},{get: function () {
            return bm;
          }, set: function (v) {
            bm = v;
          }});
        r = 0;
        for (var $l1 = 0, $end1 = this.FRowCount - 1; $l1 <= $end1; $l1++) {
          I = $l1;
          r = r + this.GetRowHeight(I);
        };
        this.FTotalRowHeight = r + 1 + tm + bm;
      };
    };
    this.UpdateColumnsCache = function () {
      this.UpdateColumnCache(this.FColumnsTopCache);
      this.UpdateColumnCache(this.FColumnsBottomCache);
      this.UpdateColumnsDisplay();
    };
    this.UpdateColumnCache = function (ACache) {
      var w = 0.0;
      var h = 0.0;
      var bmpw = 0.0;
      var bmph = 0.0;
      var bw = 0.0;
      var bh = 0.0;
      var rt = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var c = 0;
      var dx = 0.0;
      var offsetx = 0.0;
      var extrax = 0.0;
      var ac = 0;
      var rc = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var cnt = 0;
      if ((this.FUpdateCount$1 > 0) || (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState) || !(ACache != null)) return;
      ACache.Clear();
      if ($mod.TTMSFNCTreeViewColumnsTopCache.isPrototypeOf(ACache) && (!($mod.TTMSFNCTreeViewColumnsLayout.tclTop in this.FColumnsAppearance.FLayouts) || (this.FColumnsAppearance.FTopSize <= 0))) return;
      if ($mod.TTMSFNCTreeViewColumnsBottomCache.isPrototypeOf(ACache) && (!($mod.TTMSFNCTreeViewColumnsLayout.tclBottom in this.FColumnsAppearance.FLayouts) || (this.FColumnsAppearance.FBottomSize <= 0))) return;
      w = this.GetTotalColumnWidth();
      if ($mod.TTMSFNCTreeViewColumnsTopCache.isPrototypeOf(ACache)) {
        h = this.GetColumnsTopSize() + 1}
       else h = this.GetColumnsBottomSize() + 1;
      extrax = this.GetColumnsExtraSize();
      offsetx = 0;
      bmpw = 0;
      bmph = 0;
      ac = 0;
      c = 0;
      dx = 0;
      cnt = this.FColumnCount - 1;
      while (bmpw < w) {
        bw = w;
        while (bmph < h) {
          bh = h;
          rt.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bw,bh));
          dx = rt.Left + offsetx;
          for (var $l = ac, $end = cnt; $l <= $end; $l++) {
            c = $l;
            rc.Top = pas.System.Int(rt.Top) + 0.5;
            rc.Bottom = pas.System.Int(rt.Bottom) - 0.5;
            rc.Left = pas.System.Int(dx) + 0.5;
            dx = dx + this.GetColWidths(c) + extrax;
            if (c === cnt) {
              rc.Right = pas.System.Int(dx) - 0.5}
             else rc.Right = pas.System.Int(dx) + 0.5;
            pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(rc,bmpw,bmph);
            if ($mod.TTMSFNCTreeViewColumnsTopCache.isPrototypeOf(ACache)) {
              ACache.Add$1(pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItem.CreateColumnTop(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rc),c))}
             else ACache.Add$1(pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItem.CreateColumnBottom(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rc),c));
            if (dx > (rt.Right - rt.Left)) break;
          };
          bmph = bmph + bh;
        };
        bmpw = bmpw + bw;
        bmph = 0;
        ac = c;
        offsetx = -this.GetColWidths(c) - (bw - dx);
      };
    };
    this.UpdateGroupsCache = function () {
      this.UpdateGroupCache(this.FGroupsTopCache);
      this.UpdateGroupCache(this.FGroupsBottomCache);
      this.UpdateGroupsDisplay();
    };
    this.UpdateGroupCache = function (ACache) {
      var h = 0.0;
      var I = 0;
      var grp = pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewDisplayGroup.$new();
      var x = 0.0;
      var y = 0.0;
      var bw = 0.0;
      var bh = 0.0;
      var rt = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rc = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var cache = null;
      if ((this.FUpdateCount$1 > 0) || (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState) || (this.FColumnCount === 0) || (this.FDisplayGroups.GetCount() === 0) || !(ACache != null)) return;
      ACache.Clear();
      if ($mod.TTMSFNCTreeViewGroupsTopCache.isPrototypeOf(ACache) && (!($mod.TTMSFNCTreeViewGroupLayout.tglTop in this.FGroupsAppearance.FLayouts) || (this.FGroupsAppearance.FTopSize <= 0))) return;
      if ($mod.TTMSFNCTreeViewGroupsBottomCache.isPrototypeOf(ACache) && (!($mod.TTMSFNCTreeViewGroupLayout.tglBottom in this.FGroupsAppearance.FLayouts) || (this.FGroupsAppearance.FBottomSize <= 0))) return;
      if ($mod.TTMSFNCTreeViewGroupsTopCache.isPrototypeOf(ACache)) {
        h = this.GetGroupsTopSize() + 1}
       else h = this.GetGroupsBottomSize() + 1;
      for (var $l = 0, $end = this.FDisplayGroups.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        grp.$assign(this.FDisplayGroups.GetItem(I));
        y = 0;
        x = pas.System.Int(this.GetColPos(grp.StartColumn));
        bh = h;
        bw = pas.System.Int(this.GetColPos(grp.EndColumn + 1) - x);
        if ((bw <= 0) || (bh <= 0)) continue;
        rt.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bw,bh));
        rc.Top = pas.System.Int(rt.Top) + 0.5;
        rc.Bottom = pas.System.Int(rt.Bottom) - 0.5;
        rc.Left = pas.System.Int(rt.Left) + 0.5;
        rc.Right = pas.System.Int(rt.Right) + 0.5;
        pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(rc,x,y);
        if ($mod.TTMSFNCTreeViewGroupsTopCache.isPrototypeOf(ACache)) {
          cache = pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItem.CreateGroupTop(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rc),I,grp.StartColumn,grp.EndColumn)}
         else cache = pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItem.CreateGroupBottom(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rc),I,grp.StartColumn,grp.EndColumn);
        ACache.Add$1(cache);
      };
    };
    this.UpdateNodesCache = function (AUpdateNodes, AResetNodes) {
      if (this.FBlockUpdateNode) return;
      this.UpdateScrollBars(true,false);
      this.UpdateVisualRange();
      this.UpdateNodeCache();
      this.UpdateScrollBars(true,false);
      if (AUpdateNodes) {
        if (AResetNodes) this.ResetNodes(false);
        this.UpdateAutoSizing();
        this.UpdateColumnRowCalculations(false);
        this.UpdateNodesCache(false,false);
        this.UpdateVisualRange();
      } else {
        this.UpdateNodeDisplay();
        this.UpdateInplaceEditorPosition();
      };
    };
    this.UpdateNodeCache = function () {
      var g = null;
      var vs = 0.0;
      var stty = 0.0;
      var I = 0;
      var v = null;
      if ((this.FUpdateCount$1 > 0) || (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState) || !(this.FNodeCache != null)) return;
      this.FNodeCache.Clear();
      if (this.FColumnCount > 0) {
        g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[1,1,false,true]);
        g.FBitmapContainer = this.GetBitmapContainer();
        g.FOptimizedHTMLDrawing = this.FOptimizedHTMLDrawing;
        try {
          if (g.BeginScene()) {
            vs = this.GetVerticalScrollPosition();
            stty = vs + this.StartOffset();
            for (var $l = this.StartRow(), $end = this.StopRow(); $l <= $end; $l++) {
              I = $l;
              v = this.GetVisibleNodeForIndex(I);
              if (v != null) {
                if (this.ConfigureNode(g,I,v,{get: function () {
                    return stty;
                  }, set: function (v) {
                    stty = v;
                  }})) break;
              };
            };
            this.CustomizeNodeCache(g,stty);
            g.EndScene();
          };
        } finally {
          g = rtl.freeLoc(g);
        };
      };
    };
    this.CustomizeNodeCache = function (AGraphics, AStartY) {
    };
    this.UpdateDisplay = function () {
      pas["WEBLib.TMSFNCTreeViewBase"].TTMSFNCTreeViewBase.UpdateDisplay.call(this);
      this.UpdateNodesCache(false,false);
      this.UpdateGroupsDisplay();
      this.UpdateColumnsDisplay();
      this.Invalidate();
    };
    this.UpdateTreeViewCache = function () {
      if ((this.FUpdateCount$1 > 0) || this.IsDestroying()) return;
      pas["WEBLib.TMSFNCTreeViewBase"].TTMSFNCTreeViewBase.UpdateTreeViewCache.call(this);
      this.Invalidate();
    };
    this.BuildNodeList = function () {
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.BuildNodeList.call(this);
      this.PrecalculateNodes();
    };
    this.UpdateColumnsDisplay = function () {
      this.BuildDisplay(this.FColumnsTopCache,this.FColumnsTopDisplay);
      this.BuildDisplay(this.FColumnsBottomCache,this.FColumnsBottomDisplay);
    };
    this.UpdateGroupsDisplay = function () {
      this.BuildDisplay(this.FGroupsTopCache,this.FGroupsTopDisplay);
      this.BuildDisplay(this.FGroupsBottomCache,this.FGroupsBottomDisplay);
    };
    this.UpdateNodeDisplay = function () {
      this.BuildDisplay(this.FNodeCache,this.FNodeDisplay);
    };
    this.PrecalculateNodes = function () {
      var g = null;
      var vs = 0.0;
      var stty = 0.0;
      var I = 0;
      var v = null;
      if ((this.FUpdateCount$1 > 0) || (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState) || !this.FPrecalculateItems) return;
      if (this.FColumnCount > 0) {
        g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[1,1,false,true]);
        g.FBitmapContainer = this.GetBitmapContainer();
        g.FOptimizedHTMLDrawing = this.FOptimizedHTMLDrawing;
        try {
          if (g.BeginScene()) {
            vs = this.GetVerticalScrollPosition();
            stty = vs + this.StartOffset();
            for (var $l = this.StartRow(), $end = this.FRowCount - 1; $l <= $end; $l++) {
              I = $l;
              v = this.GetVisibleNodeForIndex(I);
              if (v != null) this.ConfigureNode(g,I,v,{get: function () {
                  return stty;
                }, set: function (v) {
                  stty = v;
                }});
            };
            g.EndScene();
          };
        } finally {
          g = rtl.freeLoc(g);
        };
      };
    };
    this.VerticalScrollPositionChanged = function () {
      this.FBlockScrollingUpdate = true;
      this.UpdateDisplay();
      this.FBlockScrollingUpdate = false;
      this.DoVScroll(this.GetVScrollValue());
    };
    this.Scroll = function (AHorizontalPos, AVerticalPos) {
      var h = 0.0;
      var v = 0.0;
      h = this.GetHorizontalScrollPosition();
      v = this.GetVerticalScrollPosition();
      pas["WEBLib.TMSFNCTreeViewBase"].TTMSFNCTreeViewBase.Scroll.apply(this,arguments);
      if (h !== AHorizontalPos) this.DoHScroll(AHorizontalPos);
      if (v !== AVerticalPos) this.DoVScroll(AVerticalPos);
    };
    this.HorizontalScrollPositionChanged = function () {
      this.FBlockScrollingUpdate = true;
      this.UpdateDisplay();
      this.FBlockScrollingUpdate = false;
      this.DoHScroll(this.GetHScrollValue());
    };
    this.DrawNode = function (AGraphics, ARect, ANode, ACaching, AOffsetX, AOffsetY) {
    };
    this.DrawGroup = function (AGraphics, ARect, AGroup, AStartColumn, AEndColumn, AKind) {
    };
    this.DrawColumn = function (AGraphics, ARect, AColumn, AKind) {
    };
    this.DrawNodes = function (AGraphics) {
      this.DrawDisplay(AGraphics,this.FNodeDisplay);
    };
    this.DrawColumns = function (AGraphics) {
      this.DrawDisplay(AGraphics,this.FColumnsTopDisplay);
      this.DrawDisplay(AGraphics,this.FColumnsBottomDisplay);
    };
    this.DrawNodeColumns = function (AGraphics) {
    };
    this.DrawGroups = function (AGraphics) {
      this.DrawDisplay(AGraphics,this.FGroupsTopDisplay);
      this.DrawDisplay(AGraphics,this.FGroupsBottomDisplay);
    };
    this.DrawBorders = function (AGraphics) {
    };
    this.DrawEmptySpaces = function (AGraphics) {
    };
    this.DrawDisplay = function (AGraphics, ADisplay) {
      var I = 0;
      var cache = null;
      var st = null;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (ADisplay.GetCount() === 0) return;
      st = AGraphics.SaveState(false);
      if ($mod.TTMSFNCTreeViewNodeDisplayList.isPrototypeOf(ADisplay)) {
        r.$assign(this.GetContentClipRect());
        r.Right = r.Right + 1;
      } else if ($mod.TTMSFNCTreeViewGroupsTopDisplayList.isPrototypeOf(ADisplay)) {
        r.$assign(this.GetGroupsTopRect());
        r.Bottom = r.Bottom + 1;
      } else if ($mod.TTMSFNCTreeViewGroupsBottomDisplayList.isPrototypeOf(ADisplay)) {
        r.$assign(this.GetGroupsBottomRect());
        r.Top = r.Top - 1;
      } else if ($mod.TTMSFNCTreeViewColumnsTopDisplayList.isPrototypeOf(ADisplay)) {
        r.$assign(this.GetColumnsTopRect());
        r.Bottom = r.Bottom + 1;
      } else if ($mod.TTMSFNCTreeViewColumnsBottomDisplayList.isPrototypeOf(ADisplay)) {
        r.$assign(this.GetColumnsBottomRect());
        r.Top = r.Top - 1;
      };
      AGraphics.ClipRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r));
      for (var $l = 0, $end = ADisplay.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        cache = ADisplay.GetItem(I);
        if ($mod.TTMSFNCTreeViewNodeDisplayList.isPrototypeOf(ADisplay)) {
          if (cache.FNode != null) this.DrawNode(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(cache.FDrawRect),cache.FNode,false,0,0);
        } else if ($mod.TTMSFNCTreeViewColumnsDisplayList.isPrototypeOf(ADisplay)) {
          this.DrawColumn(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(cache.FDrawRect),cache.FColumn,cache.FKind)}
         else if ($mod.TTMSFNCTreeViewGroupsDisplayList.isPrototypeOf(ADisplay)) this.DrawGroup(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(cache.FDrawRect),cache.FGroup,cache.FStartColumn,cache.FEndColumn,cache.FKind);
      };
      AGraphics.RestoreState(st,false);
    };
    this.HandleDragStart = function (X, Y) {
    };
    this.HandleDragOver = function (Source, Point, Accept) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleDragOver.apply(this,arguments);
      if (this.FBlockUserInput || (this.FOnDragOver != null)) return;
      if (!this.AlternativeDragDrop()) {
        this.FDragMode$1 = false;
        this.FDragModeStarted = false;
        this.FIsMouseDown = false;
      };
      if (this.FOnCustomDragOver != null) {
        this.FOnCustomDragOver(this,Source,pas["WEBLib.TMSFNCTypes"].TPointF.$clone(Point),Accept)}
       else {
        Accept.set((this.FInteraction.FDragDropMode !== $mod.TTMSFNCTreeViewDragDropMode.tdmNone) && $mod.TTMSFNCCustomTreeView.isPrototypeOf(Source) && (rtl.as(Source,$mod.TTMSFNCCustomTreeView).FDragNode != null));
        Accept.set(Accept.get() && pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetNodesRect(),Point));
      };
      this.FAccepted = Accept.get();
    };
    this.HandleDragDrop = function (Source, Point) {
      var dn = null;
      var dragn = null;
      var b = false;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleDragDrop.apply(this,arguments);
      if (this.FBlockUserInput || (this.FOnDragDrop != null)) return;
      if (this.FOnCustomDragDrop != null) {
        this.FOnCustomDragDrop(this,Source,pas["WEBLib.TMSFNCTypes"].TPointF.$clone(Point))}
       else {
        if (this.FAccepted && (Source != null) && $mod.TTMSFNCCustomTreeView.isPrototypeOf(Source) && (rtl.as(Source,$mod.TTMSFNCCustomTreeView).FInteraction.FDragDropMode !== $mod.TTMSFNCTreeViewDragDropMode.tdmNone)) {
          dragn = rtl.as(Source,$mod.TTMSFNCCustomTreeView).FDragNode;
          if (dragn != null) {
            dn = this.XYToNode(Point.X,Point.Y,0);
            if ((dn !== dragn) && (dragn.FNode != null) && pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetNodesRect(),Point)) {
              b = true;
              this.DoBeforeDropNode(dragn,dn,{get: function () {
                  return b;
                }, set: function (v) {
                  b = v;
                }});
              if (b) {
                this.BeginUpdate();
                rtl.as(Source,$mod.TTMSFNCCustomTreeView).BeginUpdate();
                if ((dn != null) && (dn.FNode != null)) {
                  var $tmp = rtl.as(Source,$mod.TTMSFNCCustomTreeView).FInteraction.FDragDropMode;
                  if ($tmp === $mod.TTMSFNCTreeViewDragDropMode.tdmMove) {
                    dragn.FNode.MoveTo(dn.FNode,dn.FNode.GetIndex())}
                   else if ($tmp === $mod.TTMSFNCTreeViewDragDropMode.tdmCopy) dragn.FNode.CopyTo(dn.FNode,dn.FNode.GetIndex());
                } else {
                  this.FNodes.Add$1().Assign(dragn.FNode);
                  var $tmp1 = rtl.as(Source,$mod.TTMSFNCCustomTreeView).FInteraction.FDragDropMode;
                  if ($tmp1 === $mod.TTMSFNCTreeViewDragDropMode.tdmMove) dragn.FNode.TreeView().RemoveNode(dragn.FNode);
                  dragn = this.FNodes.GetItem$1(this.FNodes.GetCount() - 1).FVirtualNode;
                };
                rtl.as(Source,$mod.TTMSFNCCustomTreeView).FDragNode = null;
                rtl.as(Source,$mod.TTMSFNCCustomTreeView).EndUpdate();
                this.EndUpdate();
                this.DoAfterDropNode(dragn,dn);
              };
            };
          };
        };
      };
    };
    this.HandleMouseDown = function (Button, Shift, X, Y) {
      var dc = null;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseDown.apply(this,arguments);
      if ((Button === pas["WEBLib.Controls"].TMouseButton.mbRight) || this.FBlockUserInput || this.FBlockMouseClick) return;
      if (!this.FDblClicked) this.CaptureEx();
      this.FDragMode$1 = false;
      this.FDragModeStarted = false;
      this.FReorderMode = false;
      this.FDragNode = null;
      if (!this.FDblClicked) {
        if (this.CanFocus()) this.SetFocus();
        if (this.FInplaceEditorActive) this.CloseInplaceEditor(false,false);
      };
      dc = this.XYToCacheItem(X,Y,0);
      this.FDownNode = null;
      if (dc != null) {
        this.FDownNode = dc.FNode;
        if (this.FSelectedNodes.IndexOf(this.FDownNode) > -1) {
          this.FDragNode = this.FDownNode;
          this.FDragMode$1 = (this.FDownNode != null) && (this.FInteraction.FDragDropMode !== $mod.TTMSFNCTreeViewDragDropMode.tdmNone) && !this.FDblClicked && !this.XYToNodeExpand(this.FDownNode,X,Y) && !this.XYToNodeExtra(this.FDownNode,X,Y) && !this.XYToNodeTitleExtra(this.FDownNode,X,Y) && !(this.XYToNodeCheck(this.FDownNode,X,Y).ANode != null);
          this.FReorderMode = (this.FDownNode != null) && this.FInteraction.FReorder && !this.FDragMode$1 && !this.FDblClicked && !this.XYToNodeExpand(this.FDownNode,X,Y) && !this.XYToNodeExtra(this.FDownNode,X,Y) && !this.XYToNodeTitleExtra(this.FDownNode,X,Y) && !(this.XYToNodeCheck(this.FDownNode,X,Y).ANode != null);
          this.FDragMode$1 = this.FDragMode$1 && !((pas.Classes.TShiftState$a.ssCtrl in Shift) || (pas.Classes.TShiftState$a.ssShift in Shift));
          this.FReorderMode = this.FReorderMode && !((pas.Classes.TShiftState$a.ssCtrl in Shift) || (pas.Classes.TShiftState$a.ssShift in Shift));
          if (this.FReorderMode) {
            this.CreateDragBitmap();
            this.FSaveDragY = this.FDragBitmap.GetTop();
          };
        };
      };
      if (this.FDragMode$1) {
        if (this.CanStartDragFromMouseDown()) {
          this.FDragModeStarted = true;
          this.HandleDragStart(X,Y);
          this.BeginDrag$1();
        };
        this.FIsMouseDown = !this.FDblClicked;
      } else {
        if (this.FDownNode != null) {
          this.FDoNodeExpand = this.XYToNodeExpand(this.FDownNode,X,Y);
          this.FDoNodeCheck.$assign(this.XYToNodeCheck(this.FDownNode,X,Y));
          this.FDoNodeAnchor.$assign(this.XYToNodeAnchor(this.FDownNode,X,Y));
          this.FDoNodeTitleAnchor.$assign(this.XYToNodeTitleAnchor(this.FDownNode,X,Y));
          this.FDoNodeExtra = this.XYToNodeExtra(this.FDownNode,X,Y);
          this.FDoNodeTitleExtra = this.XYToNodeTitleExtra(this.FDownNode,X,Y);
        };
        this.FSizeColumn = -1;
        if (this.FInteraction.FColumnSizing) {
          this.FSizeColumn = this.XYToColumnSize(X,Y);
          if ((this.FSizeColumn >= 0) && (this.FSizeColumn <= (this.FColumnCount - 1))) this.FColumnSize = this.GetColWidths(this.FSizeColumn);
        };
        this.FDownColumn = this.XYToColumn(X,Y,false);
        this.FDownColumnValue = this.XYToColumn(X,Y,true);
        this.FDownColumnFilter = this.XYToColumnFilter(X,Y);
        this.FDownColumnExpand = this.XYToColumnExpand(X,Y);
        this.FIsMouseDown = !this.FDblClicked;
        this.FTimeStart = $impl.GetTickCountX();
        this.FTimeStop = this.FTimeStart;
        this.FScrollVTo = this.GetVScrollValue();
        this.FScrollHTo = this.GetHScrollValue();
        this.FScrollX = X;
        this.FScrollY = Y;
        this.FDownX = X;
        this.FDownY = Y;
        this.FMouseX = X;
        this.FMouseY = Y;
        this.FSizeX = X;
        this.FDragY = Y;
        this.FVerticalOffset = 0;
        this.FVerticalOffsetTo = 0;
        this.FMouseUp = false;
        this.FDoubleSelection = !this.FAnimateTimer.FEnabled;
        this.FScrolling = false;
      };
      this.FDblClicked = false;
    };
    this.HandleMouseMove = function (Shift, X, Y) {
      var f = 0.0;
      var it = null;
      var doscroll = false;
      var dsp = null;
      var sc = 0;
      var c = false;
      var colsz = 0.0;
      var newcolsz = 0.0;
      var newposy = 0.0;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var n = null;
      var su = false;
      var sd = false;
      var a = "";
      var crs = 0;
      var cl = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseMove.apply(this,arguments);
      if (this.FBlockUserInput || (this.FAnimating && !this.FIsMouseDown)) return;
      this.FY = Y;
      this.FX = X;
      if (this.FIsMouseDown && this.FDragMode$1 && this.CanStartDragFromMouseMove() && ((Math.abs(this.FY - this.FDownY) > 10) || (Math.abs(this.FX - this.FDownX) > 10))) {
        if (!this.FDragModeStarted) this.HandleDragStart(X,Y);
        this.FDragModeStarted = true;
        if (this.AlternativeDragDrop()) {
          this.HandleAlternativeDragOver(X,Y)}
         else this.BeginDrag$1();
        return;
      };
      if (this.FReorderMode && (this.FDragBitmap != null) && this.FInteraction.FReorder) {
        r.$assign(this.GetContentClipRect());
        newposy = this.FSaveDragY + (this.FY - this.FDragY);
        if ((newposy <= ((r.Top + (r.Bottom - r.Top)) - this.FDragBitmap.GetHeight())) && (newposy >= r.Top)) {
          this.FDragBitmap.SetTop(Math.round(Math.max(r.Top,Math.min((r.Top + (r.Bottom - r.Top)) - this.FDragBitmap.GetHeight(),newposy))));
          this.FSaveDragY = this.FDragBitmap.GetTop();
          this.FDragTimer.SetEnabled(false);
          if ((newposy > r.Top) && (newposy < (r.Top + (r.Right - r.Left)))) {
            n = this.XYToNode((r.Right - r.Left) / 2,newposy,0);
            if (n != null) this.FDragRow = n.FRow;
          };
        } else if (newposy > ((r.Top + (r.Bottom - r.Top)) - this.FDragBitmap.GetHeight())) {
          this.FDragBitmap.SetTop(Math.round((r.Top + (r.Bottom - r.Top)) - this.FDragBitmap.GetHeight()));
          this.FSaveDragY = newposy;
          this.FDragTimer.SetEnabled(true);
        } else if (newposy < r.Top) {
          this.FDragBitmap.SetTop(Math.round(r.Top));
          this.FSaveDragY = newposy;
          this.FDragTimer.SetEnabled(true);
        };
        this.FDragY = this.FY;
        return;
      };
      if ((this.FSizeColumn >= 0) && (this.FSizeColumn <= (this.FColumnCount - 1))) {
        c = true;
        colsz = this.FColumnSize;
        this.FColumnSize = colsz + (X - this.FSizeX);
        newcolsz = Math.max(0,this.FColumnSize);
        this.FSizeX = X;
        this.DoBeforeSizeColumn(this.FSizeColumn,colsz,{get: function () {
            return newcolsz;
          }, set: function (v) {
            newcolsz = v;
          }},{get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }});
        if (c) {
          this.SetColWidths(this.FSizeColumn,newcolsz);
          if ((this.FSizeColumn >= 0) && (this.FSizeColumn <= (this.FColumns.GetCount() - 1))) this.FColumns.GetItem$1(this.FSizeColumn).UpdateWidth(newcolsz);
          this.DoAfterSizeColumn(this.FSizeColumn,newcolsz);
          this.ResetNodes(true);
          this.UpdateTreeView();
          this.Invalidate();
        };
        return;
      };
      if (this.FIsMouseDown && !(this.FDoNodeAnchor.AAnchor !== "") && !(this.FDoNodeTitleAnchor.AAnchor !== "")) {
        doscroll = !this.FDoNodeExpand && !(this.FDoNodeCheck.ANode != null);
        if (doscroll) {
          f = 1;
          var $tmp = this.FScrollMode;
          if ($tmp === pas["WEBLib.TMSFNCTreeViewBase"].TTMSFNCTreeViewScrollMode.smNodeScrolling) f = 0.1;
          c = true;
          if (this.ScrollLimitation() && (Math.abs(Y - this.FMouseY) < 15)) c = Math.abs(X - this.FMouseX) < 5;
          c = c && !(this.XYToColumn(X,Y,false) !== -1);
          if ((this.FScrolling || (Math.abs(this.FMouseX - X) > 3) || (Math.abs(this.FMouseY - Y) > 3)) && this.FInteraction.FTouchScrolling && c) {
            this.FDragTimer.SetEnabled(false);
            if ((Math.abs(X - this.FDownX) > 0) || (Math.abs(Y - this.FDownY) > 0)) {
              this.FScrolling = true;
              this.FDoubleSelection = false;
              if (this.FIsMouseDown && !this.FMouseUp) {
                su = this.CanScrollUp();
                sd = this.CanScrollDown();
                if ((su && ((Y - this.FDownY) > 0)) || (sd && ((Y - this.FDownY) < 0) && (this.FVerticalOffset === 0))) {
                  this.FVerticalOffset = 0;
                  this.Scroll(this.GetHScrollValue() - ((X - this.FDownX) * f),this.GetVScrollValue() - ((Y - this.FDownY) * f));
                } else if (this.CanApplyVerticalOffset()) {
                  this.FVerticalOffset = Math.min(75,Math.max(-75,this.FVerticalOffset + (Y - this.FDownY)));
                  this.UpdateDisplay();
                } else this.Scroll(this.GetHScrollValue() - ((X - this.FDownX) * f),this.GetVScrollValue());
                this.FDownY = Y;
                this.FDownX = X;
              };
            };
          };
        };
      } else {
        it = null;
        dsp = this.XYToCacheItem(X,Y,0);
        if (dsp != null) it = dsp.FNode;
        crs = 0;
        if ((it != null) && (dsp != null)) {
          if (this.FInteraction.FURLDetectionOnMouseMove && ((this.XYToNodeAnchor(it,X,Y).AAnchor !== "") || (this.XYToNodeTitleAnchor(it,X,Y).AAnchor !== ""))) crs = 21;
        } else {
          if (this.FInteraction.FColumnSizing) {
            sc = this.XYToColumnSize(X,Y);
            if ((sc >= 0) && (sc <= (this.FColumnCount - 1))) crs = 9;
          };
        };
        cl = -1;
        a = this.XYToColumnAnchor(X,Y,{get: function () {
            return cl;
          }, set: function (v) {
            cl = v;
          }});
        if (a !== "") crs = 21;
        if (crs !== this.FCursor) this.SetControlCursor(crs);
        if (this.FPrevDSP !== dsp) {
          if ((this.FPrevDSP != null) && (this.FPrevDSP.FNode != null)) this.DoNodeMouseLeave(this.FPrevDSP.FNode);
          if ((dsp != null) && (dsp.FNode != null)) this.DoNodeMouseEnter(dsp.FNode);
        };
        this.FPrevDSP = dsp;
      };
    };
    this.HandleDblClick = function (X, Y) {
      var pf = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var c = null;
      var col = 0;
      var en = false;
      var ext = false;
      var t = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleDblClick.apply(this,arguments);
      if (this.FBlockUserInput) return;
      this.FDblClicked = true;
      pf.$assign(pas["WEBLib.TMSFNCTypes"].PointF(X,Y));
      this.FDownNode = null;
      c = this.XYToNode(pf.X,pf.Y,0);
      if (c != null) {
        if (!this.XYToNodeExpand(c,pf.X,pf.Y) && !(this.XYToNodeCheck(c,pf.X,pf.Y).ANode != null)) {
          this.FDownNode = c;
          if (this.FDownNode != null) {
            en = true;
            this.DoIsNodeEnabled(this.FDownNode,{get: function () {
                return en;
              }, set: function (v) {
                en = v;
              }});
            if (en) {
              ext = false;
              this.DoIsNodeExtended(this.FDownNode,{get: function () {
                  return ext;
                }, set: function (v) {
                  ext = v;
                }});
              if (!this.FCompactMode && ((ext && this.FInteraction.FExtendedSelectable && this.FInteraction.FExtendedEditable) || !ext) && (this.FInteraction.FMouseEditMode === $mod.TTMSFNCTreeViewMouseEditMode.tmemDoubleClick) && !this.FInteraction.FReadOnly) {
                t = this.XYToNodeTextColumn(this.FDownNode,pf.X,pf.Y);
                if (t !== -1) this.HandleNodeEditing(this.FDownNode,t);
              } else if (this.FInteraction.FExpandCollapseOnDblClick) this.HandleNodeToggle(this.FDownNode);
            };
            this.DoNodeDblClick(this.FDownNode);
          };
        };
      } else {
        col = this.XYToColumnSize(pf.X,pf.Y);
        if (this.FInteraction.FColumnAutoSizeOnDblClick) this.AutoSizeColumn(col);
      };
      this.FIsMouseDown = false;
      this.FMouseUp = true;
      this.FScrolling = false;
      this.FDoNodeExpand = false;
      this.FDoNodeExtra = false;
      this.FDoNodeTitleExtra = false;
      this.FDoNodeAnchor.AAnchor = "";
      this.FDoNodeAnchor.AColumn = -1;
      this.FDoNodeTitleAnchor.AAnchor = "";
      this.FDoNodeTitleAnchor.AColumn = -1;
      this.FDownColumn = -1;
      this.FDownColumnValue = -1;
      this.FDownColumnFilter = -1;
      this.FDownColumnExpand = -1;
      this.FReorderMode = false;
      this.FDragMode$1 = false;
      this.FDragModeStarted = false;
    };
    this.DoNeedFilterDropDownData = function (AColumn, AValues) {
      if (this.FOnNeedFilterDropDownData != null) this.FOnNeedFilterDropDownData(this,AColumn,AValues);
    };
    this.DoFilterSelect = function (AColumn, ACondition) {
      if (this.FOnFilterSelect != null) this.FOnFilterSelect(this,AColumn,ACondition);
    };
    this.HandleFilter = function (AColumn) {
      var sl = null;
      var pt = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var n = null;
      var s = "";
      var topr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var fr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var szd = 0.0;
      var colw = 0.0;
      var colp = 0.0;
      if ((AColumn >= 0) && (AColumn <= (this.FColumns.GetCount() - 1)) && this.FColumns.GetItem$1(AColumn).FFiltering.FEnabled) {
        colw = this.GetColWidths(AColumn);
        if (colw >= 0) {
          colp = this.GetColPos(AColumn);
          sl = pas.Classes.TStringList.$create("Create$1");
          try {
            sl.FDuplicates = pas.Types.TDuplicates.dupIgnore;
            sl.SetSorted(true);
            sl.Add(rtl.getResStr($mod,"sTMSFNCTreeViewFilterAll"));
            n = this.GetFirstRootVirtualNode();
            while (n != null) {
              s = "";
              this.DoGetNodeText(n,AColumn,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeTextMode.tntmDrawing,{get: function () {
                  return s;
                }, set: function (v) {
                  s = v;
                }});
              s = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.HTMLStrip(s);
              if (s !== "") sl.Add(s);
              n = n.GetNext();
            };
            this.DoNeedFilterDropDownData(AColumn,sl);
            this.FFilterListBox.SetParent(this);
            this.FFilterListBox.FItems.Assign(sl);
            this.FFilterListBox.SetItemIndex(-1);
            pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.SetFontSize(this.FFilterListBox.FFont,16,1);
            this.FFilterListBox.FTag$1 = AColumn;
            this.DoCustomizeFilterListBox(AColumn,this.FFilterListBox);
            this.FFilterListBox.SetParent(null);
          } finally {
            sl = rtl.freeLoc(sl);
          };
          this.FFilterPopup.SetPlacementControl(this);
          topr.$assign(this.GetColumnsTopRect());
          topr.Left = topr.Left - this.GetHorizontalScrollPosition();
          r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(topr.Left + colp,topr.Top,topr.Left + colp + colw,topr.Bottom));
          szd = this.FColumns.GetItem$1(AColumn).FFiltering.FButtonSize;
          fr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Math.round(r.Right - szd - this.ScalePaintValue(4)),Math.round(r.Top + ((r.Bottom - r.Top - szd) / 2)),Math.round(r.Right - this.ScalePaintValue(4)),Math.round(r.Top + ((r.Bottom - r.Top - szd) / 2) + szd)));
          pt.$assign(this.LocalToScreenEx(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF((fr.Left + (fr.Right - fr.Left)) - szd - this.ScalePaintValue(2),fr.Top + (((fr.Bottom - fr.Top) + szd) / 2)))));
          this.FFilterPopup.FPlacementRectangle.SetLeft(pt.X);
          this.FFilterPopup.FPlacementRectangle.SetTop(pt.Y);
          this.FFilterListBox.SetWidth(this.FColumns.GetItem$1(AColumn).FFiltering.FDropDownWidth);
          this.FFilterListBox.SetHeight(this.FColumns.GetItem$1(AColumn).FFiltering.FDropDownHeight);
          this.FFilterPopup.SetDropDownHeight(this.FColumns.GetItem$1(AColumn).FFiltering.FDropDownHeight);
          this.FFilterPopup.SetDropDownWidth(this.FColumns.GetItem$1(AColumn).FFiltering.FDropDownWidth);
          this.FFilterPopup.FPlacementRectangle.SetRight(pt.X + this.FFilterPopup.FDropDownWidth);
          this.FFilterPopup.FPlacementRectangle.SetBottom(pt.Y + this.FFilterPopup.FDropDownHeight);
          this.FFilterPopup.SetContentControl(this.FFilterListBox);
          this.FFilterPopup.FFocusedControl = this.FFilterListBox;
          this.FFilterPopup.Popup(false);
        };
      };
    };
    this.HandleExpand = function (AColumn) {
    };
    this.HandleMouseUp = function (Button, Shift, X, Y) {
      var f = 0.0;
      var a = $mod.TTMSFNCTreeViewNodeAnchor.$new();
      var cl = 0;
      var ha = "";
      var en = false;
      var d = false;
      var dosel = false;
      var ext = false;
      var I = 0;
      var t = 0;
      var dn = null;
      var prev = null;
      var b = false;
      var sz = 0;
      var cs = false;
      var add = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseUp.apply(this,arguments);
      if ((Button === pas["WEBLib.Controls"].TMouseButton.mbRight) || this.FBlockUserInput) return;
      this.ReleaseCaptureEx();
      if (this.FDragMode$1 && this.FDragModeStarted && this.AlternativeDragDrop()) {
        this.HandleAlternativeDragDrop(X,Y);
        this.DestroyDragBitmap();
        this.SetControlCursor(0);
      };
      sz = this.FSizeColumn;
      this.FSizeColumn = -1;
      this.FDragTimer.SetEnabled(false);
      if (!this.FIsMouseDown) return;
      if (this.FReorderMode && this.FInteraction.FReorder) {
        dn = this.XYToNode(X,Y,0);
        if (this.FOnCustomReorder != null) {
          this.FOnCustomReorder(this,this.FDragNode,dn)}
         else {
          if ((dn != null) && (dn !== this.FDragNode) && (dn.FNode != null) && (this.FDragNode.FNode != null)) {
            b = true;
            this.DoBeforeReorderNode(this.FDragNode,dn,{get: function () {
                return b;
              }, set: function (v) {
                b = v;
              }});
            if (b) {
              if (this.FDragNode.FLevel === dn.FLevel) {
                if (dn.FNode.GetParent() === null) {
                  this.FDragNode.FNode.SetIndex(dn.FNode.GetIndex())}
                 else this.FDragNode.FNode.MoveTo(dn.FNode.GetParent(),dn.FNode.GetIndex());
              };
              this.DoAfterReorderNode(this.FDragNode,dn);
            };
          };
        };
        this.DestroyDragBitmap();
        this.FDragNode = null;
      };
      f = 1;
      var $tmp = this.FScrollMode;
      if ($tmp === pas["WEBLib.TMSFNCTreeViewBase"].TTMSFNCTreeViewScrollMode.smNodeScrolling) f = 0.1;
      this.FIsMouseDown = false;
      this.FMouseUp = true;
      this.FScrolling = false;
      if (this.FDownColumnFilter !== -1) {
        this.HandleFilter(this.FDownColumnFilter)}
       else if (this.FDownColumnExpand !== -1) {
        this.HandleExpand(this.FDownColumnExpand)}
       else if ((this.FDownColumn !== -1) && (sz === -1)) {
        if ((this.FDownColumn >= 0) && (this.FDownColumn <= (this.FColumnCount - 1))) {
          if (this.FColumns.GetItem$1(this.FDownColumn).FSorting !== pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewColumnSorting.tcsNone) {
            var $tmp1 = this.FColumns.GetItem$1(this.FDownColumn).FSortKind;
            if (($tmp1 === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodesSortKind.nskNone) || ($tmp1 === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodesSortKind.nskAscending)) {
              this.InitializeColumnSorting(this.FDownColumn,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodesSortMode.nsmDescending);
              if (this.FOnCustomColumnSort != null) {
                this.FOnCustomColumnSort(this,this.FDownColumn,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodesSortMode.nsmDescending)}
               else {
                cs = true;
                this.DoBeforeSortNodes(this.FDownColumn,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodesSortMode.nsmDescending,{get: function () {
                    return cs;
                  }, set: function (v) {
                    cs = v;
                  }});
                if (cs) {
                  this.FNodes.Sort$1(this.FDownColumn,this.FColumns.GetItem$1(this.FDownColumn).FSorting in rtl.createSet(pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewColumnSorting.tcsRecursive,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewColumnSorting.tcsRecursiveCaseSensitive),this.FColumns.GetItem$1(this.FDownColumn).FSorting in rtl.createSet(pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewColumnSorting.tcsNormalCaseSensitive,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewColumnSorting.tcsRecursiveCaseSensitive),pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodesSortMode.nsmDescending,true);
                  this.DoAfterSortNodes(this.FDownColumn,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodesSortMode.nsmDescending);
                };
              };
            } else if ($tmp1 === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodesSortKind.nskDescending) {
              this.InitializeColumnSorting(this.FDownColumn,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodesSortMode.nsmAscending);
              if (this.FOnCustomColumnSort != null) {
                this.FOnCustomColumnSort(this,this.FDownColumn,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodesSortMode.nsmAscending)}
               else {
                cs = true;
                this.DoBeforeSortNodes(this.FDownColumn,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodesSortMode.nsmAscending,{get: function () {
                    return cs;
                  }, set: function (v) {
                    cs = v;
                  }});
                if (cs) {
                  this.FNodes.Sort$1(this.FDownColumn,this.FColumns.GetItem$1(this.FDownColumn).FSorting in rtl.createSet(pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewColumnSorting.tcsRecursive,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewColumnSorting.tcsRecursiveCaseSensitive),this.FColumns.GetItem$1(this.FDownColumn).FSorting in rtl.createSet(pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewColumnSorting.tcsNormalCaseSensitive,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewColumnSorting.tcsRecursiveCaseSensitive),pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodesSortMode.nsmAscending,true);
                  this.DoAfterSortNodes(this.FDownColumn,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodesSortMode.nsmAscending);
                };
              };
            };
          };
          cl = -1;
          ha = this.XYToColumnAnchor(X,Y,{get: function () {
              return cl;
            }, set: function (v) {
              cl = v;
            }});
          if (ha !== "") this.DoColumnAnchorClick(this.FDownColumn,ha);
        };
      } else if (!this.FReorderMode && !this.FDragModeStarted) {
        if (!this.FDoNodeExpand && !this.FDoNodeExtra && !this.FDoNodeTitleExtra && !(this.FDoNodeCheck.ANode != null) && !(this.FDoNodeAnchor.AAnchor !== "") && !(this.FDoNodeTitleAnchor.AAnchor !== "")) {
          if (!this.FDoubleSelection && this.FInteraction.FTouchScrolling) {
            this.FTimeStop = $impl.GetTickCountX();
            if ((this.FVerticalOffset === 0) && ((this.FTimeStop - this.FTimeStart) < 300) && ((this.FTimeStop - this.FTimeStart) > 0)) {
              this.FSpY = Math.abs(Y - this.FScrollY) / (this.FTimeStop - this.FTimeStart);
              if (this.FSpY > 0) {
                if ((Y - this.FScrollY) > 0) {
                  this.FScrollVTo = Math.max(0,Math.min(this.VerticalScrollBar().FMax - this.GetVViewPortSize(),this.FScrollVTo - Math.round(Math.abs(Y - this.FScrollY) * this.FSpY * f * 3)))}
                 else this.FScrollVTo = Math.max(0,Math.min(this.VerticalScrollBar().FMax - this.GetVViewPortSize(),this.FScrollVTo + Math.round(Math.abs(Y - this.FScrollY) * this.FSpY * f * 3)));
                this.FAnimateVerticalPos = true;
                this.FAnimateTimer.SetEnabled(true);
              };
              this.FSpX = Math.abs(X - this.FScrollX) / (this.FTimeStop - this.FTimeStart);
              if (this.FSpX > 0) {
                if ((X - this.FScrollX) > 0) {
                  this.FScrollHTo = Math.max(0,Math.min(this.HorizontalScrollBar().FMax - this.GetHViewPortSize(),this.FScrollHTo - Math.round(Math.abs(X - this.FScrollX) * this.FSpX * f * 3)))}
                 else this.FScrollHTo = Math.max(0,Math.min(this.HorizontalScrollBar().FMax - this.GetHViewPortSize(),this.FScrollHTo + Math.round(Math.abs(X - this.FScrollX) * this.FSpX * f * 3)));
                this.FAnimateHorizontalPos = true;
                this.FAnimateTimer.SetEnabled(true);
              };
            } else if (this.CanApplyVerticalOffset()) {
              if (this.NeedsReload(this.FVerticalOffset)) this.StartReload();
              this.StartVerticalOffsetAnimation();
            };
          } else {
            if ((this.FDownNode != null) && !this.FBlockMouseClick) {
              en = this.IsVirtualNodeSelectable(this.FDownNode);
              prev = this.FFocusedNode;
              dosel = en;
              if (en) {
                if ((pas.Classes.TShiftState$a.ssShift in Shift) && ($mod.TMultiSelectStyles.msShiftSelect in this.FInteraction.FMultiSelectStyle)) {
                  if (this.FFocusedNode != null) {
                    if (($mod.TMultiSelectStyles.msSiblingOnly in this.FInteraction.FMultiSelectStyle) && (this.FFocusedNode.FParentNode !== this.FDownNode.FParentNode)) {
                      add = 0}
                     else add = 1;
                    if (this.FFocusedNode.FRow <= this.FDownNode.FRow) {
                      for (var $l = this.FFocusedNode.FRow + add, $end = this.FDownNode.FRow; $l <= $end; $l++) {
                        I = $l;
                        this.HandleSelectNode(this.GetNodeFromNodeStructure(I),true,false,(pas.Classes.TShiftState$a.ssShift in Shift) && this.FInteraction.FMultiSelect,this.FDownColumnValue);
                      };
                    } else {
                      for (var $l1 = this.FFocusedNode.FRow - add, $end1 = this.FDownNode.FRow; $l1 >= $end1; $l1--) {
                        I = $l1;
                        this.HandleSelectNode(this.GetNodeFromNodeStructure(I),true,false,(pas.Classes.TShiftState$a.ssShift in Shift) && this.FInteraction.FMultiSelect,this.FDownColumnValue);
                      };
                    };
                  };
                } else {
                  if (($mod.TMultiSelectStyles.msSiblingOnly in this.FInteraction.FMultiSelectStyle) && (this.FFocusedNode != null) && (this.FDownNode.FParentNode !== this.FFocusedNode.FParentNode) && (this.FSelectedNodes.GetCount() > 0)) {
                    this.FSelectedNodes.Clear();
                  } else if (((!(pas.Classes.TShiftState$a.ssCtrl in Shift) && !(pas.Classes.TShiftState$a.ssCtrl in Shift)) || !($mod.TMultiSelectStyles.msControlSelect in this.FInteraction.FMultiSelectStyle)) && (this.FSelectedNodes.GetCount() > 0)) this.UnSelectVirtualNode(this.FDownNode);
                  this.HandleSelectNode(this.FDownNode,true,false,((pas.Classes.TShiftState$a.ssCtrl in Shift) || (pas.Classes.TShiftState$a.ssCtrl in Shift)) && ($mod.TMultiSelectStyles.msControlSelect in this.FInteraction.FMultiSelectStyle) && this.FInteraction.FMultiSelect,this.FDownColumnValue);
                };
              };
              if (dosel) {
                if (this.FFocusedNode !== this.FDownNode) {
                  this.FFocusedNode = this.FDownNode;
                  this.DoFocusedNodeChanged(this.FFocusedNode);
                };
                this.NotifyDataBinderSetActiveRecord();
              };
              if (!this.FCompactMode && ((this.FInteraction.FMouseEditMode === $mod.TTMSFNCTreeViewMouseEditMode.tmemSingleClick) || ((this.FInteraction.FMouseEditMode === $mod.TTMSFNCTreeViewMouseEditMode.tmemSingleClickOnSelectedNode) && (this.FDownNode === prev))) && !this.FInteraction.FReadOnly) {
                if (this.FDownNode != null) {
                  ext = false;
                  this.DoIsNodeExtended(this.FDownNode,{get: function () {
                      return ext;
                    }, set: function (v) {
                      ext = v;
                    }});
                  d = true;
                  this.DoIsNodeEnabled(this.FDownNode,{get: function () {
                      return d;
                    }, set: function (v) {
                      d = v;
                    }});
                  a.$assign(this.XYToNodeTitleAnchor(this.FDownNode,X,Y));
                  if (a.AAnchor !== "") this.DoNodeTitleAnchorClick(this.FDownNode,a.AColumn,a.AAnchor);
                  a.$assign(this.XYToNodeAnchor(this.FDownNode,X,Y));
                  if (d && (a.AAnchor !== "")) {
                    this.DoNodeAnchorClick(this.FDownNode,a.AColumn,a.AAnchor);
                  } else if (((ext && this.FInteraction.FExtendedSelectable && this.FInteraction.FExtendedEditable) || !ext) && d) {
                    t = this.XYToNodeTextColumn(this.FDownNode,X,Y);
                    if ((t !== -1) && this.FDownNode.GetTitleExpanded(t)) {
                      this.HandleNodeEditing(this.FDownNode,t);
                    };
                  };
                };
              };
              this.Invalidate();
            };
          };
        } else if (!this.FCompactMode) {
          if (this.FDoNodeExpand) {
            this.HandleNodeToggle(this.FDownNode)}
           else if (this.FDoNodeExtra) {
            this.HandleNodeExtra(this.FDownNode)}
           else if (this.FDoNodeTitleExtra) {
            this.HandleNodeTitleExtra(this.FDownNode)}
           else if ((this.FDoNodeCheck.ANode != null) && !this.FInteraction.FReadOnly) {
            this.HandleNodeToggleCheck(this.FDownNode,this.FDoNodeCheck.AColumn)}
           else {
            a.$assign(this.XYToNodeAnchor(this.FDownNode,X,Y));
            if (a.AAnchor !== "") this.DoNodeAnchorClick(this.FDownNode,a.AColumn,a.AAnchor);
            a.$assign(this.XYToNodeTitleAnchor(this.FDownNode,X,Y));
            if (a.AAnchor !== "") this.DoNodeTitleAnchorClick(this.FDownNode,a.AColumn,a.AAnchor);
          };
        };
      };
      this.FDoNodeExpand = false;
      this.FDoNodeExtra = false;
      this.FDoNodeTitleExtra = false;
      this.FDoNodeAnchor.AAnchor = "";
      this.FDoNodeAnchor.AColumn = -1;
      this.FDoNodeTitleAnchor.AAnchor = "";
      this.FDoNodeTitleAnchor.AColumn = -1;
      this.FDownColumn = -1;
      this.FDownColumnValue = -1;
      this.FDownColumnFilter = -1;
      this.FDownColumnExpand = -1;
      this.FReorderMode = false;
      this.FDragMode$1 = false;
      this.FDragModeStarted = false;
    };
    this.StartVerticalOffsetAnimation = function () {
      this.FAnimateVerticalOffset = true;
      this.FAnimateTimer.SetEnabled(true);
    };
    this.ClearFocusedNode = function (ANode) {
      if ((ANode === this.FFocusedNode) || (ANode === null)) this.FFocusedNode = null;
    };
    this.SetVerticalOffset = function (AVerticalOffset) {
      this.FVerticalOffsetTo = AVerticalOffset;
    };
    this.HandleKeyPress = function (Key) {
      var k = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleKeyPress.apply(this,arguments);
      if (this.FBlockUserInput) return;
      k = Key.get().charCodeAt();
      if (this.FInteraction.FLookup.FEnabled) {
        if (k in rtl.createSet(27,45,46,38,40,37,39,36,35,33,34,9,0)) {
          this.FLookupString = ""}
         else {
          if (this.FInteraction.FLookup.FIncremental) {
            this.FLookupString = this.FLookupString + Key.get()}
           else this.FLookupString = Key.get();
          if (this.FOnCustomLookup != null) {
            this.FOnCustomLookup(this,this.FLookupString)}
           else {
            this.LookupNode(this.FLookupString,this.FInteraction.FLookup.FRootNodesOnly,this.FInteraction.FLookup.FColumn,this.FInteraction.FLookup.FCaseSensitive,this.FInteraction.FLookup.FAutoSelect,this.FInteraction.FLookup.FAutoExpand);
          };
        };
      };
    };
    this.HandleKeyDown = function (Key, Shift) {
      var sel = null;
      var prevsel = null;
      var fsel = null;
      var sa = false;
      var spc = false;
      var donext = false;
      var doprev = false;
      var r = 0;
      var I = 0;
      var b = false;
      var a = false;
      var n = null;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleKeyDown.apply(this,arguments);
      if (this.FInplaceEditorClosed || this.FBlockUserInput) return;
      if (Key.get() in rtl.createSet(27,45,46,38,40,37,39,36,35,33,34,9,106,109,107,111)) this.FLookupString = "";
      if ((pas.Classes.TShiftState$a.ssCtrl in Shift) || (pas.Classes.TShiftState$a.ssCtrl in Shift)) {
        var $tmp = Key.get();
        if ($tmp === 65) {
          if (this.FInteraction.FMultiSelect) {
            sa = true;
            this.DoBeforeSelectAllNodes({get: function () {
                return sa;
              }, set: function (v) {
                sa = v;
              }});
            if (sa) {
              this.SelectAllNodes();
              this.DoAfterSelectAllNodes();
            };
          };
          return;
        } else if ($tmp === 88) {
          if (this.FInteraction.FClipboardMode !== $mod.TTMSFNCTreeViewClipboardMode.tcmNone) {
            b = true;
            this.DoBeforeCutToClipboard({get: function () {
                return b;
              }, set: function (v) {
                b = v;
              }});
            if (b) {
              this.CutToClipboard(this.FInteraction.FClipboardMode === $mod.TTMSFNCTreeViewClipboardMode.tcmTextOnly);
              this.DoAfterCutToClipboard();
            };
          };
          return;
        } else if ($tmp === 67) {
          if (this.FInteraction.FClipboardMode !== $mod.TTMSFNCTreeViewClipboardMode.tcmNone) {
            b = true;
            this.DoBeforeCopyToClipboard({get: function () {
                return b;
              }, set: function (v) {
                b = v;
              }});
            if (b) {
              this.CopyToClipboard(this.FInteraction.FClipboardMode === $mod.TTMSFNCTreeViewClipboardMode.tcmTextOnly);
              this.DoAfterCopyToClipboard();
            };
          };
          return;
        } else if ($tmp === 86) {
          if (this.FInteraction.FClipboardMode !== $mod.TTMSFNCTreeViewClipboardMode.tcmNone) {
            b = true;
            this.DoBeforePasteFromClipboard({get: function () {
                return b;
              }, set: function (v) {
                b = v;
              }});
            if (b) {
              this.PasteFromClipboard();
              this.DoAfterPasteFromClipboard();
            };
          };
          return;
        };
      };
      sel = this.GetFocusedVirtualNode();
      donext = false;
      doprev = false;
      var $tmp1 = Key.get();
      if (($tmp1 === 18) || ($tmp1 === 17) || ($tmp1 === 16)) {
        sel = null}
       else if ($tmp1 === 33) {
        doprev = true;
        if (sel != null) {
          r = sel.FRow - (this.StopRow() - this.StartRow());
          sel = this.GetNodeFromNodeStructure(r);
          if (sel != null) {
            if (!this.IsVirtualNodeSelectable(sel)) sel = this.GetPreviousFocusableNode(sel);
          };
          if (!(sel != null)) sel = this.GetNextFocusableNode(null);
        };
      } else if ($tmp1 === 34) {
        donext = true;
        if (sel != null) {
          r = sel.FRow + (this.StopRow() - this.StartRow());
          sel = this.GetNodeFromNodeStructure(r);
          if (sel != null) {
            if (!this.IsVirtualNodeSelectable(sel)) sel = this.GetNextFocusableNode(sel);
          };
          if (!(sel != null)) sel = this.GetPreviousFocusableNode(null);
        };
      } else if ($tmp1 === 36) {
        sel = this.GetNextFocusableNode(null);
        doprev = true;
      } else if ($tmp1 === 35) {
        sel = this.GetPreviousFocusableNode(null);
        doprev = true;
      } else if ($tmp1 === 40) {
        if (!this.FInteraction.FMultiSelect || (this.FInteraction.FMultiSelect && !(($mod.TMultiSelectStyles.msSiblingOnly in this.FInteraction.FMultiSelectStyle) && (pas.Classes.TShiftState$a.ssCtrl in Shift)))) {
          sel = this.GetNextFocusableNode(sel);
          donext = true;
        };
      } else if ($tmp1 === 38) {
        if (!($mod.TMultiSelectStyles.msSiblingOnly in this.FInteraction.FMultiSelectStyle) || !this.FInteraction.FMultiSelect || !(pas.Classes.TShiftState$a.ssCtrl in Shift)) {
          sel = this.GetPreviousFocusableNode(sel);
          doprev = true;
        };
      } else if (($tmp1 === 37) || ($tmp1 === 109) || ($tmp1 === 111)) {
        this.HandleNodeCollapse(sel,Key.get() === 111)}
       else if (($tmp1 === 39) || ($tmp1 === 107) || ($tmp1 === 106)) {
        this.HandleNodeExpand(sel,Key.get() === 106)}
       else if ($tmp1 === 32) this.DoNodeClick(sel);
      var $tmp2 = Key.get();
      if (($tmp2 === 37) || ($tmp2 === 39)) this.HandleCustomKeys(Key.get());
      spc = false;
      if (Key.get() === 32) spc = true;
      if (sel != null) {
        if ((this.FInteraction.FSelectionFollowsFocus && (donext || doprev)) || (spc && ((pas.Classes.TShiftState$a.ssCtrl in Shift) || (pas.Classes.TShiftState$a.ssCtrl in Shift)))) {
          if (pas.Classes.TShiftState$a.ssShift in Shift) {
            if (this.FSelectedNodes.GetCount() > 1) {
              prevsel = this.FSelectedNodes.GetItem(this.FSelectedNodes.GetCount() - 1);
              fsel = this.FSelectedNodes.GetItem(0);
              if ((doprev && (sel.FRow < prevsel.FRow) && (sel.FRow >= fsel.FRow)) || (donext && (sel.FRow > prevsel.FRow) && (sel.FRow <= fsel.FRow))) {
                if (prevsel.FRow <= sel.FRow) {
                  for (var $l = prevsel.FRow, $end = sel.FRow; $l <= $end; $l++) {
                    I = $l;
                    n = this.GetNodeFromNodeStructure(I);
                    if (n != null) {
                      if (n !== sel) {
                        a = true;
                        this.DoBeforeUnSelectNode(n,{get: function () {
                            return a;
                          }, set: function (v) {
                            a = v;
                          }});
                        if (a) {
                          this.UnSelectVirtualNode(n);
                          this.DoAfterUnSelectNode(n);
                        };
                      } else this.UnSelectVirtualNode(n);
                    };
                  };
                } else {
                  for (var $l1 = prevsel.FRow, $end1 = sel.FRow; $l1 >= $end1; $l1--) {
                    I = $l1;
                    n = this.GetNodeFromNodeStructure(I);
                    if (n != null) {
                      if (n !== sel) {
                        a = true;
                        this.DoBeforeUnSelectNode(n,{get: function () {
                            return a;
                          }, set: function (v) {
                            a = v;
                          }});
                        if (a) {
                          this.UnSelectVirtualNode(n);
                          this.DoAfterUnSelectNode(n);
                        };
                      } else this.UnSelectVirtualNode(n);
                    };
                  };
                };
              };
            };
          } else if (!(pas.Classes.TShiftState$a.ssCtrl in Shift) && !(pas.Classes.TShiftState$a.ssCtrl in Shift) && (donext || doprev) && (this.FSelectedNodes.GetCount() > 0)) {
            a = true;
            this.DoBeforeUnSelectNode(sel,{get: function () {
                return a;
              }, set: function (v) {
                a = v;
              }});
            if (a) {
              this.UnSelectVirtualNode(sel);
              this.DoAfterUnSelectNode(sel);
            };
          };
          if (pas.Classes.TShiftState$a.ssShift in Shift) {
            if (this.FFocusedNode != null) {
              if (this.FFocusedNode.FRow <= sel.FRow) {
                for (var $l2 = this.FFocusedNode.FRow + 1, $end2 = sel.FRow; $l2 <= $end2; $l2++) {
                  I = $l2;
                  this.HandleSelectNode(this.GetNodeFromNodeStructure(I),true,true,(pas.Classes.TShiftState$a.ssShift in Shift) && this.FInteraction.FMultiSelect,-1);
                };
              } else {
                for (var $l3 = this.FFocusedNode.FRow - 1, $end3 = sel.FRow; $l3 >= $end3; $l3--) {
                  I = $l3;
                  this.HandleSelectNode(this.GetNodeFromNodeStructure(I),true,true,(pas.Classes.TShiftState$a.ssShift in Shift) && this.FInteraction.FMultiSelect,-1);
                };
              };
            };
          } else this.HandleSelectNode(sel,true,true,((pas.Classes.TShiftState$a.ssCtrl in Shift) || (pas.Classes.TShiftState$a.ssCtrl in Shift)) && this.FInteraction.FMultiSelect,-1);
        } else if (spc) this.HandleNodeToggleCheck(sel,0);
        if (this.FFocusedNode !== sel) {
          this.FFocusedNode = sel;
          this.DoFocusedNodeChanged(this.FFocusedNode);
          this.NotifyDataBinderSetActiveRecord();
        };
        if (donext) {
          this.ScrollToVirtualNode(this.FFocusedNode,true,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeScrollPosition.tvnspBottom,false)}
         else this.ScrollToVirtualNode(this.FFocusedNode,true,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeScrollPosition.tvnspTop,false);
        this.Invalidate();
      };
    };
    this.HandleDialogKey = function (Key, Shift) {
      var n = null;
      var c = 0;
      var ext = false;
      if (this.FInplaceEditorClosed || this.FBlockUserInput) {
        pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleDialogKey.apply(this,arguments);
        return;
      };
      if (((this.FInplaceEditor != null) && this.FInplaceEditorActive && ((Key.get() === 27) || (Key.get() === 9) || (Key.get() === 113) || (pas["WEBLib.StdCtrls"].TEdit.isPrototypeOf(this.FInplaceEditor) && (Key.get() === 13)))) || (pas["WEBLib.StdCtrls"].TMemo.isPrototypeOf(this.FInplaceEditor) && (Key.get() === 13) && !(pas.Classes.TShiftState$a.ssCtrl in Shift))) {
        this.FCloseWithDialogKey = true;
        this.CloseInplaceEditor(Key.get() === 27,false);
        if (Key.get() === 9) {
          if (this.FFocusedNode != null) {
            if (pas.Classes.TShiftState$a.ssShift in Shift) {
              ext = false;
              this.DoIsNodeExtended(this.FFocusedNode,{get: function () {
                  return ext;
                }, set: function (v) {
                  ext = v;
                }});
              if ((this.FUpdateNodeColumn > this.GetFirstEditableColumn()) && !ext) {
                this.HandleNodeEditing(this.FFocusedNode,this.GetPreviousEditableColumn(this.FUpdateNodeColumn));
                this.Invalidate();
                Key.set(0);
              } else {
                n = this.GetPreviousFocusableNode(this.FFocusedNode);
                if (n != null) {
                  ext = false;
                  this.DoIsNodeExtended(n,{get: function () {
                      return ext;
                    }, set: function (v) {
                      ext = v;
                    }});
                  if ((ext && this.FInteraction.FExtendedEditable) || !ext) {
                    if (!ext) {
                      c = this.GetLastEditableColumn()}
                     else c = 0;
                    if (this.FFocusedNode !== n) {
                      this.FFocusedNode = n;
                      this.DoFocusedNodeChanged(this.FFocusedNode);
                    };
                    this.SelectVirtualNode(n);
                    this.ScrollToVirtualNode(n,true,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeScrollPosition.tvnspTop,false);
                    this.NotifyDataBinderSetActiveRecord();
                    this.HandleNodeEditing(n,c);
                    this.Invalidate();
                    Key.set(0);
                  };
                };
              };
            } else {
              ext = false;
              this.DoIsNodeExtended(this.FFocusedNode,{get: function () {
                  return ext;
                }, set: function (v) {
                  ext = v;
                }});
              if ((this.FUpdateNodeColumn < this.GetLastEditableColumn()) && !ext) {
                this.EditVirtualNode(this.FFocusedNode,this.GetNextEditableColumn(this.FUpdateNodeColumn));
                Key.set(0);
              } else {
                n = this.GetNextFocusableNode(this.FFocusedNode);
                if (n != null) {
                  ext = false;
                  this.DoIsNodeExtended(n,{get: function () {
                      return ext;
                    }, set: function (v) {
                      ext = v;
                    }});
                  if ((ext && this.FInteraction.FExtendedEditable) || !ext) {
                    c = this.GetFirstEditableColumn();
                    if (this.FFocusedNode !== n) {
                      this.FFocusedNode = n;
                      this.DoFocusedNodeChanged(this.FFocusedNode);
                    };
                    this.SelectVirtualNode(n);
                    this.ScrollToVirtualNode(n,true,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeScrollPosition.tvnspBottom,false);
                    this.NotifyDataBinderSetActiveRecord();
                    this.HandleNodeEditing(n,c);
                    this.Invalidate();
                    Key.set(0);
                  };
                };
              };
            };
          };
        };
      };
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleDialogKey.apply(this,arguments);
    };
    this.HandleFilterListClick = function (Sender) {
      this.FFilterTimer.SetEnabled(true);
    };
    this.HandleKeyUp = function (Key, Shift) {
      var en = false;
      var ext = false;
      var c = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleKeyUp.apply(this,arguments);
      if (this.FBlockUserInput) return;
      if (this.FInplaceEditorClosed) {
        this.FInplaceEditorClosed = false;
        return;
      };
      if (this.FCloseWithDialogKey) {
        this.FCloseWithDialogKey = false;
        return;
      };
      if (this.FFocusedNode != null) {
        if (!this.FCompactMode && this.FInteraction.FKeyboardEdit && !this.FInteraction.FReadOnly && rtl.eqSet(Shift,{})) {
          var $tmp = Key.get();
          if (($tmp === 113) || ($tmp === 13)) {
            en = true;
            this.DoIsNodeEnabled(this.FFocusedNode,{get: function () {
                return en;
              }, set: function (v) {
                en = v;
              }});
            if (en) {
              ext = false;
              this.DoIsNodeExtended(this.FFocusedNode,{get: function () {
                  return ext;
                }, set: function (v) {
                  ext = v;
                }});
              if ((ext && this.FInteraction.FExtendedSelectable && this.FInteraction.FExtendedEditable) || !ext) {
                c = this.GetFirstEditableColumn();
                if ((c !== -1) && this.FFocusedNode.GetTitleExpanded(c)) this.HandleNodeEditing(this.FFocusedNode,c);
              };
            };
          };
        };
      };
    };
    this.HandleMouseWheel = function (Shift, WheelDelta, Handled) {
      var vpos = 0.0;
      var hpos = 0.0;
      var sz = 0.0;
      var R = 0;
      var nd = null;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseWheel.apply(this,arguments);
      if (Handled.get()) return;
      if (this.FBlockUserInput) return;
      vpos = this.GetVScrollValue();
      hpos = this.GetHScrollValue();
      if (WheelDelta > 0) {
        R = this.StartRow() - 1}
       else R = this.StartRow();
      nd = this.GetVisibleNodeForIndex(R);
      if (nd != null) {
        if (WheelDelta > 0) {
          sz = nd.FHeight * this.FInteraction.FMouseWheelDelta;
          this.Scroll(hpos,vpos - sz);
        } else {
          sz = nd.FHeight * this.FInteraction.FMouseWheelDelta;
          this.Scroll(hpos,vpos + sz);
        };
      } else this.Scroll(hpos,0);
      Handled.set(true);
    };
    this.HandleNodeEditing = function (ANode, AColumn) {
      var $Self = this;
      var c = null;
      var ins = false;
      var n = "";
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rtr = pas.Types.TRect.$new();
      function CreateCaretPos(ALine, APos) {
        var Result = pas.Types.TPoint.$new();
        Result.x = ALine;
        Result.y = APos;
        return Result;
      };
      if ((ANode != null) && (AColumn >= 0) && (AColumn <= (this.FColumns.GetCount() - 1))) {
        c = this.FColumns.GetItem$1(AColumn);
        this.FInplaceEditorClass = null;
        if (!c.FCustomEditor) {
          var $tmp = c.FEditorType;
          if ($tmp === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewColumnEditorType.tcetEdit) {
            this.FInplaceEditorClass = $mod.TTMSFNCTreeViewEdit}
           else if ($tmp === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewColumnEditorType.tcetComboBox) {
            this.FInplaceEditorClass = $mod.TTMSFNCTreeViewComboBox}
           else if ($tmp === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewColumnEditorType.tcetMemo) {
            this.FInplaceEditorClass = $mod.TTMSFNCTreeViewMemo}
           else if ($tmp === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewColumnEditorType.tcetNone) return;
        };
        ins = true;
        this.DoBeforeOpenInplaceEditor(ANode,AColumn,{get: function () {
            return ins;
          }, set: function (v) {
            ins = v;
          }});
        if (ins) {
          this.DoGetInplaceEditor(ANode,AColumn,{p: this, get: function () {
              return this.p.FInplaceEditorClass;
            }, set: function (v) {
              this.p.FInplaceEditorClass = v;
            }});
          if (this.FInplaceEditor != null) {
            if (this.FOldInplaceEditor != null) rtl.free(this,"FOldInplaceEditor");
            this.FOldInplaceEditor = this.FInplaceEditor;
            this.FInplaceEditor = null;
          };
          if (this.FInplaceEditorClass != null) {
            this.FInplaceEditor = this.FInplaceEditorClass.$create("Create$1",[$Self])}
           else this.FInplaceEditor = pas["WEBLib.StdCtrls"].TEdit.$create("Create$1",[$Self]);
          r.$assign(this.GetInplaceEditorRect(ANode,AColumn));
          if (this.FInplaceEditor != null) {
            this.FUpdateNode = ANode;
            this.FUpdateNodeColumn = AColumn;
            this.FInplaceEditor.SetShowFocus(false);
            this.FInplaceEditor.SetParent($Self);
            this.FInplaceEditor.SetVisible(false);
            rtr.$assign(pas.Types.Rect(Math.round(r.Left),Math.round(r.Top),Math.round(r.Right),Math.round(r.Bottom)));
            this.FInplaceEditor.SetBoundsRect(rtr);
            this.FInplaceEditor.SetBoundsRect(pas.Types.Rect(rtr.Left,rtr.Top + rtl.trunc((rtr.Bottom - rtr.Top - this.FInplaceEditor.GetHeight()) / 2),rtr.Right,rtr.Top + rtl.trunc((rtr.Bottom - rtr.Top - this.FInplaceEditor.GetHeight()) / 2) + this.FInplaceEditor.GetHeight()));
            this.FInplaceEditor.SetVisible(true);
            if ((c.FEditorType === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewColumnEditorType.tcetComboBox) && !c.FCustomEditor && pas["WEBLib.StdCtrls"].TComboBox.isPrototypeOf(this.FInplaceEditor)) {
              rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TComboBox).FItems.Assign(c.FEditorItems);
              rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TComboBox).SetStyle(pas["WEBLib.StdCtrls"].TComboBoxStyle.csDropDownList);
            };
            this.CustomizeInplaceEditor(this.FInplaceEditor,ANode,c);
            try {
              n = "";
              this.DoGetNodeText(ANode,AColumn,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeTextMode.tntmEditing,{get: function () {
                  return n;
                }, set: function (v) {
                  n = v;
                }});
              if (pas["WEBLib.StdCtrls"].TComboBox.isPrototypeOf(this.FInplaceEditor)) rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TComboBox).SetItemIndex(rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TComboBox).FItems.IndexOf(n));
              if (pas["WEBLib.StdCtrls"].TEdit.isPrototypeOf(this.FInplaceEditor)) rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TEdit).SetText(n);
              if (pas["WEBLib.StdCtrls"].TMemo.isPrototypeOf(this.FInplaceEditor)) rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TMemo).SetText(n);
            } finally {
            };
            if (this.FInplaceEditor.CanFocus()) this.FInplaceEditor.SetFocus();
            if (pas["WEBLib.StdCtrls"].TEdit.isPrototypeOf(this.FInplaceEditor)) rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TEdit).SetSelStart(rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TEdit).GetText().length);
            if (pas["WEBLib.StdCtrls"].TMemo.isPrototypeOf(this.FInplaceEditor)) {
              rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TMemo).SetSelLength(0);
              if (rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TMemo).FLines.GetCount() > 0) {
                rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TMemo).FCaretPosition.$assign(CreateCaretPos(rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TMemo).FLines.GetCount() - 1,rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TMemo).FLines.Get(rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TMemo).FLines.GetCount() - 1).length))}
               else rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TMemo).FCaretPosition.$assign(CreateCaretPos(0,0));
            };
            this.FInplaceEditorActive = true;
            this.Invalidate();
          };
          this.DoAfterOpenInplaceEditor(ANode,AColumn,this.FInplaceEditor,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r));
        };
      };
    };
    this.CustomizeInplaceEditor = function (AInplaceEditor, ANode, AColumn) {
      if (!(ANode != null) || !(AColumn != null) || !(AInplaceEditor != null)) return;
      this.DoCustomizeInplaceEditor(ANode,AColumn.GetIndex(),this.FInplaceEditor);
    };
    this.StartReload = function () {
      this.FVerticalOffsetTo = this.GetReloadOffset();
      this.StartVerticalOffsetAnimation();
    };
    this.ConfigureNodeRect = function (AIndex, ANode, ARect) {
    };
    this.GetDefaultRowHeight = function (ANode) {
      var Result = 0.0;
      var loff = 0.0;
      var toff = 0.0;
      var roff = 0.0;
      var boff = 0.0;
      Result = pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.GetDefaultRowHeight.call(this,ANode);
      loff = 0;
      toff = 0;
      roff = 0;
      boff = 0;
      this.GetNodeOffset(ANode,{get: function () {
          return loff;
        }, set: function (v) {
          loff = v;
        }},{get: function () {
          return toff;
        }, set: function (v) {
          toff = v;
        }},{get: function () {
          return roff;
        }, set: function (v) {
          roff = v;
        }},{get: function () {
          return boff;
        }, set: function (v) {
          boff = v;
        }});
      Result = Result + toff + boff;
      return Result;
    };
    this.GetNodeOffset = function (ANode, ALeft, ATop, ARight, ABottom) {
    };
    this.GetNodeMargins = function (ALeft, ATop, ARight, ABottom) {
    };
    this.HandleAlternativeDragOver = function (X, Y) {
    };
    this.HandleAlternativeDragDrop = function (X, Y) {
    };
    this.InternalSelectVirtualNode = function (ANode) {
    };
    this.CanStartDragFromMouseDown = function () {
      var Result = false;
      Result = true;
      return Result;
    };
    this.CanStartDragFromMouseMove = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    this.AlternativeDragDrop = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    this.GetNodesSpacing = function (ANode) {
      var Result = 0.0;
      Result = this.FNodesAppearance.FSpacing;
      return Result;
    };
    this.IsAnimating = function () {
      var Result = false;
      Result = (this.FAnimateTimer.FEnabled === true) && this.FAnimating;
      return Result;
    };
    this.GetNodesRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(this.GetContentRect());
      return Result;
    };
    this.CanApplyVerticalOffset = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    this.GetReloadOffset = function () {
      var Result = 0.0;
      Result = 0;
      return Result;
    };
    this.NeedsReload = function (AVerticalOffset) {
      var Result = false;
      Result = false;
      return Result;
    };
    this.IsVariableNodeHeight = function () {
      var Result = false;
      Result = this.FNodesAppearance.FHeightMode === $mod.TTMSFNCTreeViewNodeHeightMode.tnhmVariable;
      return Result;
    };
    this.GetDragObjectScreenShot = function () {
      var Result = null;
      this.CreateDragBitmap();
      Result = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      if (this.FDragBitmap != null) {
        Result.Assign(this.FDragBitmap.GetBitmap());
        rtl.free(this,"FDragBitmap");
        this.FDragBitmap = null;
      };
      return Result;
    };
    this.ColumnStretchingActive = function () {
      var Result = false;
      Result = this.FColumnStretchingActive;
      return Result;
    };
    this.GetBufStart = function (ABuffer, ALevel) {
      var Result = "";
      var Pos = 0;
      Pos = 1;
      ALevel.set(0);
      while (pas["WEBLib.TMSFNCTypes"].CharInArray(ABuffer.charAt(Pos - 1),[" ","\t"])) {
        Pos += 1;
        ALevel.set(ALevel.get() + 1);
      };
      Result = pas.System.Copy(ABuffer,Pos,(ABuffer.length - Pos) + 1);
      return Result;
    };
    this.GetFirstEditableColumn = function () {
      var Result = 0;
      var I = 0;
      Result = -1;
      for (var $l = 0, $end = this.FColumns.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if ((this.FColumns.GetItem$1(I).FEditorType !== pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewColumnEditorType.tcetNone) || this.FColumns.GetItem$1(I).FCustomEditor) {
          Result = I;
          break;
        };
      };
      return Result;
    };
    this.GetLastEditableColumn = function () {
      var Result = 0;
      var I = 0;
      Result = -1;
      for (var $l = this.FColumns.GetCount() - 1; $l >= 0; $l--) {
        I = $l;
        if ((this.FColumns.GetItem$1(I).FEditorType !== pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewColumnEditorType.tcetNone) || this.FColumns.GetItem$1(I).FCustomEditor) {
          Result = I;
          break;
        };
      };
      return Result;
    };
    this.GetPreviousEditableColumn = function (AColumn) {
      var Result = 0;
      var I = 0;
      Result = -1;
      if ((AColumn > 0) && (AColumn <= (this.FColumns.GetCount() - 1))) {
        for (var $l = AColumn - 1; $l >= 0; $l--) {
          I = $l;
          if ((this.FColumns.GetItem$1(I).FEditorType !== pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewColumnEditorType.tcetNone) || this.FColumns.GetItem$1(I).FCustomEditor) {
            Result = I;
            break;
          };
        };
      };
      return Result;
    };
    this.GetNextEditableColumn = function (AColumn) {
      var Result = 0;
      var I = 0;
      Result = -1;
      if ((AColumn >= 0) && (AColumn < (this.FColumns.GetCount() - 1))) {
        for (var $l = AColumn + 1, $end = this.FColumns.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          if ((this.FColumns.GetItem$1(I).FEditorType !== pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewColumnEditorType.tcetNone) || this.FColumns.GetItem$1(I).FCustomEditor) {
            Result = I;
            break;
          };
        };
      };
      return Result;
    };
    this.GetInplaceEditorRect = function (ANode, AColumn) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var cr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var sts = 0;
      var c = 0;
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,0,0));
      if (!(ANode != null)) return Result;
      sts = this.GetFirstVisibleColumn();
      c = AColumn - sts;
      if ((c >= 0) && (c <= (rtl.length(ANode.FTextRects) - 1))) {
        r.$assign(ANode.FTextRects[c]);
        cr.$assign(this.GetContentClipRect());
        Result.$assign(r);
        Result.Top = Math.max(Result.Top,cr.Top);
        Result.Bottom = Math.min(Result.Bottom,cr.Bottom);
        Result.Left = Math.max(Result.Left,cr.Left);
        Result.Right = Math.min(Result.Right,cr.Right);
        Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.Math.Floor(Result.Left),pas.Math.Floor(Result.Top),pas.Math.Floor(Result.Right),pas.Math.Floor(Result.Bottom)));
        if (this.FOnGetInplaceEditorRect != null) this.FOnGetInplaceEditorRect(this,ANode,AColumn,this.FInplaceEditor,Result);
      };
      return Result;
    };
    this.GetNextFocusableNode = function (ANode) {
      var Result = null;
      var en = false;
      if (ANode != null) {
        Result = this.GetNextVirtualNode(ANode)}
       else Result = this.GetFirstRootVirtualNode();
      en = this.IsVirtualNodeSelectable(Result);
      while ((Result != null) && !en) {
        Result = this.GetNextVirtualNode(Result);
        en = this.IsVirtualNodeSelectable(Result);
      };
      return Result;
    };
    this.GetPreviousFocusableNode = function (ANode) {
      var Result = null;
      var en = false;
      if (ANode != null) {
        Result = this.GetPreviousVirtualNode(ANode)}
       else Result = this.GetLastVirtualNode();
      en = this.IsVirtualNodeSelectable(Result);
      while ((Result != null) && !en) {
        Result = this.GetPreviousVirtualNode(Result);
        en = this.IsVirtualNodeSelectable(Result);
      };
      return Result;
    };
    this.GetVersion = function () {
      var Result = "";
      Result = this.$class.GetVersionNumber(1,2,2,3);
      return Result;
    };
    this.GetFirstVisibleColumn = function () {
      var Result = 0;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var I = 0;
      Result = 0;
      if (!this.FColumnsAppearance.FOptimizedColumnDisplay) return Result;
      r.$assign(this.GetNodesRect());
      for (var $l = 0, $end = this.FColumns.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if ((this.GetColPos(I) + this.GetColWidths(I)) >= (r.Left + this.GetHorizontalScrollPosition())) {
          Result = I;
          break;
        };
      };
      return Result;
    };
    this.GetLastVisibleColumn = function () {
      var Result = 0;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var I = 0;
      Result = this.FColumns.GetCount() - 1;
      if (!this.FColumnsAppearance.FOptimizedColumnDisplay) return Result;
      r.$assign(this.GetNodesRect());
      for (var $l = Result; $l >= 0; $l--) {
        I = $l;
        if (this.GetColPos(I) <= (r.Right + this.GetHorizontalScrollPosition())) {
          Result = I;
          break;
        };
      };
      return Result;
    };
    this.ConfigureNode = function (AGraphics, AIndex, ANode, AStartY) {
      var Result = false;
      var rt = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var bw = 0.0;
      var bh = 0.0;
      var x = 0.0;
      var y = 0.0;
      var rc = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var cache = null;
      var C = 0;
      var cr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var urc = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var vs = 0.0;
      var v = null;
      var lvlw = 0.0;
      var rcalc = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rcalctw = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rcalct = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var strc = "";
      var strt = "";
      var texp = false;
      var cx = 0.0;
      var cw = 0.0;
      var maxh = 0.0;
      var st = 0;
      var stp = 0;
      var bmpn = null;
      var bmpw = 0.0;
      var bmph = 0.0;
      var expw = 0.0;
      var exph = 0.0;
      var ww = false;
      var wwt = false;
      var colw = 0.0;
      var chk = 0;
      var ext = false;
      var chksz = 0.0;
      var cl = null;
      var expr = [];
      var bmpr = [];
      var txtr = [];
      var titr = [];
      var chkr = [];
      var extr = [];
      var textr = [];
      var vl = 0.0;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var sz = 0.0;
      var szt = 0.0;
      var th = 0.0;
      var loff = 0.0;
      var toff = 0.0;
      var roff = 0.0;
      var boff = 0.0;
      var lm = 0.0;
      var tm = 0.0;
      var rm = 0.0;
      var bm = 0.0;
      this.DoGetNodeData(ANode);
      loff = 0;
      toff = 0;
      roff = 0;
      boff = 0;
      this.GetNodeOffset(ANode,{get: function () {
          return loff;
        }, set: function (v) {
          loff = v;
        }},{get: function () {
          return toff;
        }, set: function (v) {
          toff = v;
        }},{get: function () {
          return roff;
        }, set: function (v) {
          roff = v;
        }},{get: function () {
          return boff;
        }, set: function (v) {
          boff = v;
        }});
      lm = 0;
      tm = 0;
      rm = 0;
      bm = 0;
      this.GetNodeMargins({get: function () {
          return lm;
        }, set: function (v) {
          lm = v;
        }},{get: function () {
          return tm;
        }, set: function (v) {
          tm = v;
        }},{get: function () {
          return rm;
        }, set: function (v) {
          rm = v;
        }},{get: function () {
          return bm;
        }, set: function (v) {
          bm = v;
        }});
      vs = this.GetVerticalScrollPosition();
      cr.$assign(this.GetNodesRect());
      v = ANode;
      bw = this.GetTotalColumnNodeWidth() - rm - lm;
      lvlw = this.FNodesAppearance.FLevelIndent * v.FLevel;
      if (this.FNodesAppearance.FExpandColumn === this.GetFirstVisibleColumn()) {
        x = lvlw;
        bw = bw - lvlw;
      } else x = 0;
      maxh = 0;
      y = AStartY.get();
      bh = 0;
      x = x + lm;
      y = y + tm;
      rt.$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.System.Int(x),pas.System.Int(y),pas.System.Int(x + bw),pas.System.Int(y + bh)));
      if (this.HorizontalScrollBar().FVisible || this.FColumnsAppearance.FStretch) {
        if (AIndex === 0) {
          rc.$assign(pas["WEBLib.TMSFNCTypes"].RectF(rt.Left + 1.5,rt.Top + 1.5,rt.Right - 1.5,rt.Bottom + 0.5))}
         else if (AIndex === (this.FRowCount - 1)) {
          rc.$assign(pas["WEBLib.TMSFNCTypes"].RectF(rt.Left + 1.5,rt.Top + 0.5,rt.Right - 1.5,rt.Bottom + 0.5))}
         else rc.$assign(pas["WEBLib.TMSFNCTypes"].RectF(rt.Left + 1.5,rt.Top + 0.5,rt.Right - 1.5,rt.Bottom + 0.5));
      } else {
        if (AIndex === 0) {
          rc.$assign(pas["WEBLib.TMSFNCTypes"].RectF(rt.Left + 1.5,rt.Top + 1.5,rt.Right - 0.5,rt.Bottom + 0.5))}
         else if (AIndex === (this.FRowCount - 1)) {
          rc.$assign(pas["WEBLib.TMSFNCTypes"].RectF(rt.Left + 1.5,rt.Top + 0.5,rt.Right - 0.5,rt.Bottom + 0.5))}
         else rc.$assign(pas["WEBLib.TMSFNCTypes"].RectF(rt.Left + 1.5,rt.Top + 0.5,rt.Right - 0.5,rt.Bottom + 0.5));
      };
      this.ConfigureNodeRect(AIndex,ANode,rc);
      if (v.FCalculated) {
        bh = v.FHeight}
       else {
        this.UpdateNodeCalculated(v,true);
        if (this.FNodesAppearance.FHeightMode === $mod.TTMSFNCTreeViewNodeHeightMode.tnhmVariable) {
          st = this.GetFirstVisibleColumn();
          stp = this.GetLastVisibleColumn();
          ext = false;
          this.DoIsNodeExtended(v,{get: function () {
              return ext;
            }, set: function (v) {
              ext = v;
            }});
          if (ext) stp = Math.min(st,stp);
          for (var $l = st, $end = stp; $l <= $end; $l++) {
            C = $l;
            colw = this.GetColWidths(C);
            if ((colw > 0) || ext) {
              strc = "";
              this.DoGetNodeText(v,C,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeTextMode.tntmDrawing,{get: function () {
                  return strc;
                }, set: function (v) {
                  strc = v;
                }});
              strt = "";
              this.DoGetNodeTitle(v,C,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeTextMode.tntmDrawing,{get: function () {
                  return strt;
                }, set: function (v) {
                  strt = v;
                }});
              texp = true;
              this.DoGetNodeTitleExpanded(v,C,{get: function () {
                  return texp;
                }, set: function (v) {
                  texp = v;
                }});
              if (this.FCompactMode) {
                strt = "";
                strc = "";
                texp = false;
              };
              cx = this.GetColPos(C);
              if (C === st) cx = cx + rc.Left;
              if (ext) {
                cw = cx + bw}
               else cw = cx + this.GetColWidths(C);
              if (C === st) cw = cw - rc.Left;
              if ((this.FNodesAppearance.FExpandColumn === C) && (C > st)) cx = cx + lvlw;
              cw = cw - loff - roff - rm - lm;
              if (C === this.FNodesAppearance.FExpandColumn) {
                expw = this.FNodesAppearance.FExpandWidth + this.ScalePaintValue(4);
                exph = this.FNodesAppearance.FExpandHeight + this.ScalePaintValue(4);
                cx = cx + expw;
                if (exph > maxh) maxh = exph;
              };
              chk = pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeCheckType.tvntNone;
              this.DoGetNodeCheckType(v,C,{get: function () {
                  return chk;
                }, set: function (v) {
                  chk = v;
                }});
              if (chk !== pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeCheckType.tvntNone) {
                chksz = this.ScalePaintValue(this.FCheckStartSize);
                cx = cx + Math.max(0,chksz + 4);
                if (chksz > maxh) maxh = chksz;
              };
              bmpn = null;
              this.DoGetNodeIcon(v,C,false,{get: function () {
                  return bmpn;
                }, set: function (v) {
                  bmpn = v;
                }});
              if (!(bmpn != null) && pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.IsHighDPIScale(null,-1)) this.DoGetNodeIcon(v,C,true,{get: function () {
                  return bmpn;
                }, set: function (v) {
                  bmpn = v;
                }});
              if ((bmpn != null) && (bmpn.GetWidth() > 0) && (bmpn.GetHeight() > 0)) {
                bmpw = bmpn.GetWidth() + this.ScalePaintValue(4);
                bmph = bmpn.GetHeight() + this.ScalePaintValue(4);
                this.DoGetNodeIconSize(v,C,pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.IsHighDPIScale(null,-1),bmpn,{get: function () {
                    return bmpw;
                  }, set: function (v) {
                    bmpw = v;
                  }},{get: function () {
                    return bmph;
                  }, set: function (v) {
                    bmph = v;
                  }});
                cx = cx + bmpw;
                if (bmph > maxh) maxh = bmph;
              };
              ww = false;
              wwt = false;
              if ((C >= 0) && (C <= (this.FColumns.GetCount() - 1))) {
                ww = this.FColumns.GetItem$1(C).FWordWrapping;
                wwt = this.FColumns.GetItem$1(C).FTitleWordWrapping;
              };
              this.DoGetNodeWordWrapping(v,C,{get: function () {
                  return ww;
                }, set: function (v) {
                  ww = v;
                }});
              this.DoGetNodeTitleWordWrapping(v,C,{get: function () {
                  return wwt;
                }, set: function (v) {
                  wwt = v;
                }});
              sz = 0;
              this.DoGetNodeExtraSize(v,C,{get: function () {
                  return sz;
                }, set: function (v) {
                  sz = v;
                }});
              szt = 0;
              this.DoGetNodeTitleExtraSize(v,C,{get: function () {
                  return szt;
                }, set: function (v) {
                  szt = v;
                }});
              rcalc.$assign(pas["WEBLib.TMSFNCTypes"].RectF(cx,0,cw - sz,10000));
              pas["WEBLib.TMSFNCTypes"].InflateRectEx(rcalc,this.ScalePaintValue(-2),0);
              rcalctw.$assign(pas["WEBLib.TMSFNCTypes"].RectF(cx,0,cw - szt,10000));
              pas["WEBLib.TMSFNCTypes"].InflateRectEx(rcalctw,this.ScalePaintValue(-2),0);
              cl = null;
              if ((C >= 0) && (C <= (this.FColumnCount - 1))) cl = this.FColumns.GetItem$1(C);
              if ((cl != null) && !cl.FUseDefaultAppearance && !ext) {
                AGraphics.FFont.Assign(cl.FFont)}
               else {
                if (ext) {
                  AGraphics.FFont.Assign(this.FNodesAppearance.FExtendedFont)}
                 else AGraphics.FFont.Assign(this.FNodesAppearance.FFont);
              };
              if (texp) {
                rcalc.$assign(AGraphics.CalculateText(strc,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rcalc),ww,true));
                rcalc.Bottom = rcalc.Bottom + this.ScalePaintValue(4);
                vl = rcalc.Bottom - rcalc.Top;
              } else vl = 0;
              if (strt !== "") {
                if ((cl != null) && !cl.FUseDefaultAppearance) {
                  AGraphics.FFont.Assign(cl.FTitleFont)}
                 else AGraphics.FFont.Assign(this.FNodesAppearance.FTitleFont);
                rcalct.$assign(AGraphics.CalculateText(strt,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rcalctw),wwt,true));
                rcalct.Bottom = rcalct.Bottom + this.ScalePaintValue(4);
                th = rcalct.Bottom - rcalct.Top;
              } else th = 0;
              this.UpdateNodeTitleHeight(v,Math.max(szt,th));
              vl = vl + v.FTitleHeight;
              this.DoGetNodeHeight(v,C,{get: function () {
                  return vl;
                }, set: function (v) {
                  vl = v;
                }});
              if (vl > maxh) maxh = vl;
            };
          };
          bh = Math.max(this.GetDefaultRowHeight(v),maxh + toff + boff + this.GetNodesSpacing(v));
          this.UpdateNodeHeight(v,pas.System.Int(bh));
          this.FTotalRowHeight = (this.FTotalRowHeight - this.GetDefaultRowHeight(v)) + v.FHeight;
        } else {
          bh = this.GetDefaultRowHeight(v);
          this.UpdateNodeHeight(v,bh);
        };
      };
      AStartY.set(AStartY.get() + pas.System.Int(bh));
      rc.Bottom = rc.Bottom + pas.System.Int(bh);
      rc.Bottom = rc.Bottom - this.GetNodesSpacing(ANode);
      urc.$assign(rc);
      urc.Left = urc.Left + loff;
      urc.Top = urc.Top + toff;
      urc.Right = urc.Right + roff;
      urc.Bottom = urc.Bottom + boff;
      extr = rtl.arraySetLength(extr,pas["WEBLib.TMSFNCTypes"].TRectF,0);
      textr = rtl.arraySetLength(textr,pas["WEBLib.TMSFNCTypes"].TRectF,0);
      txtr = rtl.arraySetLength(txtr,pas["WEBLib.TMSFNCTypes"].TRectF,0);
      titr = rtl.arraySetLength(titr,pas["WEBLib.TMSFNCTypes"].TRectF,0);
      bmpr = rtl.arraySetLength(bmpr,pas["WEBLib.TMSFNCTypes"].TRectF,0);
      expr = rtl.arraySetLength(expr,pas["WEBLib.TMSFNCTypes"].TRectF,0);
      chkr = rtl.arraySetLength(chkr,pas["WEBLib.TMSFNCTypes"].TRectF,0);
      st = this.GetFirstVisibleColumn();
      stp = this.GetLastVisibleColumn();
      ext = false;
      this.DoIsNodeExtended(v,{get: function () {
          return ext;
        }, set: function (v) {
          ext = v;
        }});
      if (ext) stp = Math.min(st,stp);
      for (var $l1 = st, $end1 = stp; $l1 <= $end1; $l1++) {
        C = $l1;
        colw = this.GetColumnWidth(C);
        cx = this.GetColumnPosition(C);
        if (C === st) cx = cx + urc.Left;
        if (ext) {
          cw = cx + bw}
         else cw = cx + colw;
        if (C === st) cw = cw - urc.Left;
        if ((this.FNodesAppearance.FExpandColumn === C) && (C > st)) cx = cx + lvlw;
        if (ext) cw = cw + lvlw;
        cw = cw - rm - roff;
        expw = 0;
        exph = 0;
        if (C === this.FNodesAppearance.FExpandColumn) {
          expw = this.FNodesAppearance.FExpandWidth + this.ScalePaintValue(4);
          exph = this.FNodesAppearance.FExpandHeight + this.ScalePaintValue(4);
        };
        expr = rtl.arraySetLength(expr,pas["WEBLib.TMSFNCTypes"].TRectF,rtl.length(expr) + 1);
        expr[rtl.length(expr) - 1].$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.System.Int(cx + this.ScalePaintValue(2)),pas.System.Int(urc.Top + ((urc.Bottom - urc.Top - exph) / 2) + this.ScalePaintValue(2)),pas.System.Int((cx + expw) - this.ScalePaintValue(2)),pas.System.Int((urc.Top + ((urc.Bottom - urc.Top - exph) / 2) + exph) - this.ScalePaintValue(2))));
        cx = cx + expw;
        chk = pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeCheckType.tvntNone;
        chksz = 0;
        this.DoGetNodeCheckType(v,C,{get: function () {
            return chk;
          }, set: function (v) {
            chk = v;
          }});
        if (chk !== pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeCheckType.tvntNone) {
          chksz = this.ScalePaintValue(this.FCheckStartSize);
        };
        chkr = rtl.arraySetLength(chkr,pas["WEBLib.TMSFNCTypes"].TRectF,rtl.length(chkr) + 1);
        chkr[rtl.length(chkr) - 1].$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.System.Int(cx + this.ScalePaintValue(4)),pas.System.Int(urc.Top + ((urc.Bottom - urc.Top - chksz) / 2) + this.ScalePaintValue(2)),pas.System.Int(cx + chksz),pas.System.Int((urc.Top + ((urc.Bottom - urc.Top - chksz) / 2) + chksz) - this.ScalePaintValue(2))));
        cx = cx + Math.max(0,chksz + 4);
        bmpn = null;
        this.DoGetNodeIcon(v,C,false,{get: function () {
            return bmpn;
          }, set: function (v) {
            bmpn = v;
          }});
        if (!(bmpn != null) && pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.IsHighDPIScale(null,-1)) this.DoGetNodeIcon(v,C,true,{get: function () {
            return bmpn;
          }, set: function (v) {
            bmpn = v;
          }});
        bmpw = 0;
        bmph = 0;
        if ((bmpn != null) && (bmpn.GetWidth() > 0) && (bmpn.GetHeight() > 0)) {
          bmpw = bmpn.GetWidth() + this.ScalePaintValue(4);
          bmph = bmpn.GetHeight() + this.ScalePaintValue(4);
          this.DoGetNodeIconSize(v,C,pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.IsHighDPIScale(null,-1),bmpn,{get: function () {
              return bmpw;
            }, set: function (v) {
              bmpw = v;
            }},{get: function () {
              return bmph;
            }, set: function (v) {
              bmph = v;
            }});
        };
        bmpr = rtl.arraySetLength(bmpr,pas["WEBLib.TMSFNCTypes"].TRectF,rtl.length(bmpr) + 1);
        bmpr[rtl.length(bmpr) - 1].$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.System.Int(cx + this.ScalePaintValue(2)),pas.System.Int(urc.Top + ((urc.Bottom - urc.Top - bmph) / 2) + this.ScalePaintValue(2)),pas.System.Int((cx + bmpw) - this.ScalePaintValue(2)),pas.System.Int((urc.Top + ((urc.Bottom - urc.Top - bmph) / 2) + bmph) - this.ScalePaintValue(2))));
        cx = cx + bmpw;
        sz = 0;
        this.DoGetNodeExtraSize(v,C,{get: function () {
            return sz;
          }, set: function (v) {
            sz = v;
          }});
        szt = 0;
        this.DoGetNodeTitleExtraSize(v,C,{get: function () {
            return szt;
          }, set: function (v) {
            szt = v;
          }});
        if (((v.GetTitle(C) !== "") || (v.FTitleHeight > 0)) && (v.GetText(C) !== "") && v.GetTitleExpanded(C)) {
          r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(cx,urc.Top,cw - szt,urc.Top + v.FTitleHeight));
          titr = rtl.arraySetLength(titr,pas["WEBLib.TMSFNCTypes"].TRectF,rtl.length(titr) + 1);
          titr[rtl.length(titr) - 1].$assign(r);
          textr = rtl.arraySetLength(textr,pas["WEBLib.TMSFNCTypes"].TRectF,rtl.length(textr) + 1);
          textr[rtl.length(textr) - 1].$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Right,urc.Top,r.Right + szt,urc.Top + szt));
          r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(cx,r.Bottom,cw - sz,urc.Bottom));
          txtr = rtl.arraySetLength(txtr,pas["WEBLib.TMSFNCTypes"].TRectF,rtl.length(txtr) + 1);
          txtr[rtl.length(txtr) - 1].$assign(r);
        } else {
          r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(cx,urc.Top + ((urc.Bottom - urc.Top - (rc.Bottom - rc.Top)) / 2),cw - szt,urc.Top + ((urc.Bottom - urc.Top - (rc.Bottom - rc.Top)) / 2) + (rc.Bottom - rc.Top)));
          titr = rtl.arraySetLength(titr,pas["WEBLib.TMSFNCTypes"].TRectF,rtl.length(titr) + 1);
          titr[rtl.length(titr) - 1].$assign(r);
          textr = rtl.arraySetLength(textr,pas["WEBLib.TMSFNCTypes"].TRectF,rtl.length(textr) + 1);
          textr[rtl.length(textr) - 1].$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Right,urc.Top,r.Right + szt,urc.Top + szt));
          r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(cx,urc.Top + ((urc.Bottom - urc.Top - (rc.Bottom - rc.Top)) / 2),cw - sz,urc.Top + ((urc.Bottom - urc.Top - (rc.Bottom - rc.Top)) / 2) + (rc.Bottom - rc.Top)));
          txtr = rtl.arraySetLength(txtr,pas["WEBLib.TMSFNCTypes"].TRectF,rtl.length(txtr) + 1);
          txtr[rtl.length(txtr) - 1].$assign(r);
        };
        extr = rtl.arraySetLength(extr,pas["WEBLib.TMSFNCTypes"].TRectF,rtl.length(extr) + 1);
        extr[rtl.length(extr) - 1].$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Right,r.Top,r.Right + sz,r.Bottom));
      };
      this.UpdateNodeExtraRects(v,rtl.arrayRef(extr));
      this.UpdateNodeTitleExtraRects(v,rtl.arrayRef(textr));
      this.UpdateNodeTextRects(v,rtl.arrayRef(txtr));
      this.UpdateNodeTitleRects(v,rtl.arrayRef(titr));
      this.UpdateNodeBitmapRects(v,rtl.arrayRef(bmpr));
      this.UpdateNodeExpandRects(v,rtl.arrayRef(expr));
      this.UpdateNodeCheckRects(v,rtl.arrayRef(chkr));
      cache = pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItem.CreateNode(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rc),v);
      this.FNodeCache.Add$1(cache);
      this.UpdateNodeCacheReference(v,cache);
      Result = (y - vs) > (cr.Bottom - cr.Top);
      return Result;
    };
    this.XYToColumnAnchorCache = function (AX, AY, ACache, AIndex) {
      var Result = "";
      var I = 0;
      var txtr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var a = "";
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var str = "";
      var g = null;
      var c = null;
      var col = null;
      var def = false;
      var trim = 0;
      var ha = 0;
      var va = 0;
      var ww = false;
      var szt = 0.0;
      var szd = 0.0;
      var szr = 0.0;
      Result = "";
      AIndex.set(-1);
      g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[1,1,false,true]);
      g.BeginScene();
      try {
        g.FBitmapContainer = this.GetBitmapContainer();
        for (var $l = 0, $end = ACache.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          c = ACache.GetItem$1(I);
          col = null;
          def = false;
          if ((c.FColumn >= 0) && (c.FColumn <= (this.FColumns.GetCount() - 1))) col = this.FColumns.GetItem$1(c.FColumn);
          r.$assign(c.FDrawRect);
          szt = 0;
          if (col != null) {
            if (col.FFiltering.FEnabled) {
              szd = col.FFiltering.FButtonSize;
              szt = szt + szd + this.ScalePaintValue(4);
            };
            if (col.FExpandable) {
              szr = col.FExpandingButtonSize;
              szt = szt + szr + this.ScalePaintValue(6);
            };
            if ((col.FSortKind !== pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodesSortKind.nskNone) && (this.FSortColumn === c.FColumn)) {
              szr = this.ScalePaintValue(8);
              szt = szt + szr + this.ScalePaintValue(6);
            };
          };
          if (def) {
            var $tmp = c.FKind;
            if ($tmp === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikColumnTop) {
              g.FFont.Assign(this.FColumnsAppearance.FTopFont)}
             else if ($tmp === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikColumnBottom) g.FFont.Assign(this.FColumnsAppearance.FBottomFont);
          } else if (col != null) {
            var $tmp1 = c.FKind;
            if ($tmp1 === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikColumnTop) {
              g.FFont.Assign(col.FTopFont)}
             else if ($tmp1 === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikColumnBottom) g.FFont.Assign(col.FBottomFont);
          };
          str = this.GetColumnText(c.FColumn);
          this.DoGetColumnText(c.FColumn,c.FKind,{get: function () {
              return str;
            }, set: function (v) {
              str = v;
            }});
          ha = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading;
          va = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
          ww = false;
          trim = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone;
          if (col != null) {
            ha = col.FHorizontalTextAlign;
            va = col.FVerticalTextAlign;
            ww = col.FWordWrapping;
            trim = col.FTrimming;
          };
          this.DoGetColumnTrimming(c.FColumn,c.FKind,{get: function () {
              return trim;
            }, set: function (v) {
              trim = v;
            }});
          this.DoGetColumnWordWrapping(c.FColumn,c.FKind,{get: function () {
              return ww;
            }, set: function (v) {
              ww = v;
            }});
          this.DoGetColumnHorizontalTextAlign(c.FColumn,c.FKind,{get: function () {
              return ha;
            }, set: function (v) {
              ha = v;
            }});
          this.DoGetColumnVerticalTextAlign(c.FColumn,c.FKind,{get: function () {
              return va;
            }, set: function (v) {
              va = v;
            }});
          txtr.$assign(r);
          pas["WEBLib.TMSFNCTypes"].InflateRectEx(txtr,this.ScalePaintValue(-2),this.ScalePaintValue(-2));
          txtr.Right = Math.max(txtr.Left,txtr.Right - szt);
          if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(txtr,pas["WEBLib.TMSFNCTypes"].PointF(AX,AY))) {
            var $tmp2 = c.FKind;
            if ($tmp2 === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikColumnTop) {
              if (col != null) {
                g.FFont.Assign(col.FTopFont)}
               else g.FFont.Assign(this.FColumnsAppearance.FTopFont);
              if (this.FColumnsAppearance.FTopVerticalText) {
                a = g.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(txtr),str,ww,ha,va,trim,-90,-1,-1,true,true,AX,AY)}
               else a = g.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(txtr),str,ww,ha,va,trim,0,-1,-1,true,true,AX,AY);
            } else if ($tmp2 === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikColumnBottom) {
              if (col != null) {
                g.FFont.Assign(col.FBottomFont)}
               else g.FFont.Assign(this.FColumnsAppearance.FBottomFont);
              if (this.FColumnsAppearance.FBottomVerticalText) {
                a = g.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(txtr),str,ww,ha,va,trim,90,-1,-1,true,true,AX,AY)}
               else a = g.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(txtr),str,ww,ha,va,trim,0,-1,-1,true,true,AX,AY);
            };
            if (a !== "") {
              Result = a;
              AIndex.set(c.FColumn);
              break;
            };
          };
        };
      } finally {
        g.EndScene();
        g = rtl.freeLoc(g);
      };
      return Result;
    };
    this.GetDocURL = function () {
      var Result = "";
      Result = $mod.TTMSFNCTreeViewDocURL;
      return Result;
    };
    this.GetRowHeight = function (ARow) {
      var Result = 0.0;
      var v = null;
      v = this.GetVisibleNodeForIndex(ARow);
      Result = this.GetDefaultRowHeight(v);
      if ((v != null) && v.FCalculated) Result = v.FHeight;
      return Result;
    };
    this.GetColumnText = function (AColumn) {
      var Result = "";
      Result = pas["WEBLib.TMSFNCTreeViewData"].TranslateTextEx(rtl.getResStr(pas["WEBLib.TMSFNCTreeViewData"],"sTMSFNCTreeViewColumn")) + " " + pas.SysUtils.IntToStr(AColumn);
      if ((AColumn >= 0) && (AColumn <= (this.FColumnCount - 1))) {
        Result = this.FColumns.GetItem$1(AColumn).FText;
        if (Result === "") Result = this.FColumns.GetItem$1(AColumn).FName;
        if (Result === "") Result = pas["WEBLib.TMSFNCTreeViewData"].TranslateTextEx(rtl.getResStr(pas["WEBLib.TMSFNCTreeViewData"],"sTMSFNCTreeViewColumn")) + " " + pas.SysUtils.IntToStr(AColumn);
      };
      if (this.FAdapter != null) Result = this.FAdapter.GetColumnDisplayName(AColumn);
      return Result;
    };
    this.GetGroupText = function (AGroup) {
      var Result = "";
      Result = pas["WEBLib.TMSFNCTreeViewData"].TranslateTextEx(rtl.getResStr(pas["WEBLib.TMSFNCTreeViewData"],"sTMSFNCTreeViewGroup")) + " " + pas.SysUtils.IntToStr(AGroup);
      if ((AGroup >= 0) && (AGroup <= (this.FGroups.GetCount() - 1))) Result = this.FGroups.GetItem$1(AGroup).GetText();
      return Result;
    };
    this.GetColumnsTopSize = function () {
      var Result = 0.0;
      Result = 0;
      if (($mod.TTMSFNCTreeViewColumnsLayout.tclTop in this.FColumnsAppearance.FLayouts) && (this.FColumnCount > 0)) Result = this.FColumnsAppearance.FTopSize;
      return Result;
    };
    this.GetColumnsExtraSize = function () {
      var Result = 0.0;
      Result = 0;
      return Result;
    };
    this.GetColumnsBottomSize = function () {
      var Result = 0.0;
      Result = 0;
      if (($mod.TTMSFNCTreeViewColumnsLayout.tclBottom in this.FColumnsAppearance.FLayouts) && (this.FColumnCount > 0)) Result = this.FColumnsAppearance.FBottomSize;
      return Result;
    };
    this.GetGroupsTopSize = function () {
      var Result = 0.0;
      Result = 0;
      if (($mod.TTMSFNCTreeViewGroupLayout.tglTop in this.FGroupsAppearance.FLayouts) && (this.FDisplayGroups.GetCount() > 0) && (this.FColumnCount > 0)) Result = this.FGroupsAppearance.FTopSize;
      return Result;
    };
    this.GetGroupsBottomSize = function () {
      var Result = 0.0;
      Result = 0;
      if (($mod.TTMSFNCTreeViewGroupLayout.tglBottom in this.FGroupsAppearance.FLayouts) && (this.FDisplayGroups.GetCount() > 0) && (this.FColumnCount > 0)) Result = this.FGroupsAppearance.FBottomSize;
      return Result;
    };
    this.GetContentClipRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(pas["WEBLib.TMSFNCTreeViewBase"].TTMSFNCTreeViewBase.GetContentClipRect.call(this));
      Result.Bottom = Result.Top + Math.min(this.GetTotalRowHeight(),Result.Bottom - Result.Top);
      Result.Right = Result.Left + Math.min(this.GetTotalColumnWidth(),Result.Right - Result.Left);
      Result.Left = Result.Left + 1;
      Result.Right = Result.Right - 1;
      return Result;
    };
    this.GetContentRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(pas["WEBLib.TMSFNCTreeViewBase"].TTMSFNCTreeViewBase.GetContentRect.call(this));
      Result.Top = Result.Top + this.GetColumnsTopSize() + this.GetGroupsTopSize();
      Result.Bottom = Result.Bottom - this.GetColumnsBottomSize() - this.GetGroupsBottomSize();
      return Result;
    };
    this.GetCalculationRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(pas["WEBLib.TMSFNCTreeViewBase"].TTMSFNCTreeViewBase.GetCalculationRect.call(this));
      Result.Top = Result.Top + this.GetColumnsTopSize() + this.GetGroupsTopSize();
      Result.Bottom = Result.Bottom - this.GetColumnsBottomSize() - this.GetGroupsBottomSize();
      Result.Right = Result.Left + Math.max(0,Result.Right - Result.Left);
      Result.Bottom = Result.Top + Math.max(0,Result.Bottom - Result.Top);
      return Result;
    };
    this.GetGroupsTopRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(this.GetColumnsTopRect());
      Result.Bottom = Result.Top;
      Result.Top = Result.Top - this.GetGroupsTopSize();
      return Result;
    };
    this.GetGroupsBottomRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(this.GetColumnsBottomRect());
      Result.Top = Result.Bottom;
      Result.Bottom = Result.Top + this.GetGroupsBottomSize();
      return Result;
    };
    this.GetColumnsTopRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var nr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      nr.$assign(pas["WEBLib.TMSFNCTreeViewBase"].TTMSFNCTreeViewBase.GetContentRect.call(this));
      Result.Left = nr.Left;
      Result.Top = nr.Top + this.GetGroupsTopSize();
      Result.Right = nr.Right + this.GetColumnsExtraSize();
      Result.Bottom = nr.Top + this.GetGroupsTopSize() + this.GetColumnsTopSize();
      return Result;
    };
    this.GetColumnTopLeftEmptyRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var ptr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var nr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      ptr.$assign(this.GetColumnsTopRect());
      nr.$assign(this.GetLocalRect());
      Result.Top = ptr.Top;
      Result.Left = nr.Left;
      Result.Right = ptr.Left;
      Result.Bottom = ptr.Bottom;
      return Result;
    };
    this.GetColumnBottomLeftEmptyRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var ptr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var nr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      ptr.$assign(this.GetColumnsBottomRect());
      nr.$assign(this.GetLocalRect());
      Result.Top = ptr.Top;
      Result.Left = nr.Left;
      Result.Right = ptr.Left;
      Result.Bottom = ptr.Bottom;
      return Result;
    };
    this.GetColumnBottomRightEmptyRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var ptr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var nr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      ptr.$assign(this.GetColumnsBottomRect());
      nr.$assign(this.GetLocalRect());
      Result.Top = ptr.Top;
      Result.Left = ptr.Right;
      Result.Right = nr.Right - 1;
      Result.Bottom = ptr.Bottom;
      return Result;
    };
    this.GetColumnTopRightEmptyRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var ptr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var nr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      ptr.$assign(this.GetColumnsTopRect());
      nr.$assign(this.GetLocalRect());
      Result.Top = ptr.Top;
      Result.Left = ptr.Right;
      Result.Right = nr.Right - 1;
      Result.Bottom = ptr.Bottom;
      return Result;
    };
    this.GetGroupTopLeftEmptyRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var ptr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var nr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      ptr.$assign(this.GetGroupsTopRect());
      nr.$assign(this.GetLocalRect());
      Result.Top = ptr.Top;
      Result.Left = nr.Left;
      Result.Right = ptr.Left;
      Result.Bottom = ptr.Bottom;
      return Result;
    };
    this.GetGroupBottomLeftEmptyRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var ptr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var nr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      ptr.$assign(this.GetGroupsBottomRect());
      nr.$assign(this.GetLocalRect());
      Result.Top = ptr.Top;
      Result.Left = nr.Left;
      Result.Right = ptr.Left;
      Result.Bottom = nr.Bottom;
      return Result;
    };
    this.GetGroupBottomRightEmptyRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var ptr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var nr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      ptr.$assign(this.GetGroupsBottomRect());
      nr.$assign(this.GetLocalRect());
      Result.Top = ptr.Top;
      Result.Left = ptr.Right;
      Result.Right = nr.Right;
      Result.Bottom = ptr.Bottom;
      return Result;
    };
    this.GetGroupTopRightEmptyRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var ptr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var nr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      ptr.$assign(this.GetGroupsTopRect());
      nr.$assign(this.GetLocalRect());
      Result.Top = ptr.Top;
      Result.Left = ptr.Right;
      Result.Right = nr.Right;
      Result.Bottom = ptr.Bottom;
      return Result;
    };
    this.GetColumnsBottomRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var nr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      nr.$assign(pas["WEBLib.TMSFNCTreeViewBase"].TTMSFNCTreeViewBase.GetContentRect.call(this));
      Result.Left = nr.Left;
      Result.Top = nr.Bottom - this.GetGroupsBottomSize() - this.GetColumnsBottomSize();
      Result.Right = nr.Right + this.GetColumnsExtraSize();
      Result.Bottom = nr.Bottom - this.GetGroupsBottomSize();
      return Result;
    };
    this.GetCacheWidth = function () {
      var Result = 0;
      Result = 1000;
      return Result;
    };
    this.GetCacheHeight = function () {
      var Result = 0;
      Result = 1000;
      return Result;
    };
    this.XYToCacheItem = function (X, Y, OffsetX) {
      var Result = null;
      var I = 0;
      var dsp = null;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result = null;
      if (!(this.FNodeDisplay != null)) return Result;
      if (!pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetContentClipRect(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y))) return Result;
      for (var $l = 0, $end = this.FNodeDisplay.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        dsp = this.FNodeDisplay.GetItem(I);
        r.$assign(dsp.FDrawRect);
        r.Left = r.Left + OffsetX;
        r.Right = r.Right + OffsetX;
        if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(r,pas["WEBLib.TMSFNCTypes"].PointF(X,Y))) {
          Result = dsp;
          break;
        };
      };
      return Result;
    };
    this.GetFirstVisibleCacheItem = function () {
      var Result = null;
      Result = null;
      if (this.FNodeDisplay.GetCount() > 0) Result = this.FNodeDisplay.GetItem(0);
      return Result;
    };
    this.IsReorderActive = function () {
      var Result = false;
      Result = this.FReorderMode && this.FInteraction.FReorder;
      return Result;
    };
    this.IsDragDropActive = function () {
      var Result = false;
      Result = this.FDragMode$1 && (this.FInteraction.FDragDropMode !== $mod.TTMSFNCTreeViewDragDropMode.tdmNone);
      return Result;
    };
    this.GetHTMLTemplate = function (AColumnIndex) {
      var Result = "";
      if ((AColumnIndex >= 0) && (AColumnIndex < this.FColumns.GetCount())) {
        Result = this.FColumns.GetItem$1(AColumnIndex).FHTMLTemplate}
       else Result = "";
      return Result;
    };
    this.Create$1 = function (AOwner) {
      var s = 0.0;
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.Create$1.apply(this,arguments);
      this.FColumnStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,-1,1.0]);
      this.FColumnStroke.FOnChanged = rtl.createCallback(this,"ColumnStrokeChanged");
      this.FSizeColumn = -1;
      this.FGroupsCaching = false;
      this.FColumnsCaching = false;
      this.FSelectedNodes = $mod.TTMSFNCTreeViewSelectedNodes.$create("Create$1");
      this.FNodeCache = $mod.TTMSFNCTreeViewNodeCache.$create("Create$2");
      this.FColumnsTopCache = $mod.TTMSFNCTreeViewColumnsTopCache.$create("Create$2");
      this.FGroupsTopCache = $mod.TTMSFNCTreeViewGroupsTopCache.$create("Create$2");
      this.FColumnsBottomCache = $mod.TTMSFNCTreeViewColumnsBottomCache.$create("Create$2");
      this.FGroupsBottomCache = $mod.TTMSFNCTreeViewGroupsBottomCache.$create("Create$2");
      this.FNodeDisplay = $mod.TTMSFNCTreeViewNodeDisplayList.$create("Create$1");
      this.FColumnsTopDisplay = $mod.TTMSFNCTreeViewColumnsTopDisplayList.$create("Create$1");
      this.FGroupsTopDisplay = $mod.TTMSFNCTreeViewGroupsTopDisplayList.$create("Create$1");
      this.FColumnsBottomDisplay = $mod.TTMSFNCTreeViewColumnsBottomDisplayList.$create("Create$1");
      this.FGroupsBottomDisplay = $mod.TTMSFNCTreeViewGroupsBottomDisplayList.$create("Create$1");
      this.FNodesAppearance = $mod.TTMSFNCTreeViewNodesAppearance.$create("Create$1",[this]);
      this.FColumnsAppearance = $mod.TTMSFNCTreeViewColumnsAppearance.$create("Create$1",[this]);
      this.FGroupsAppearance = $mod.TTMSFNCTreeViewGroupsAppearance.$create("Create$1",[this]);
      this.FInteraction = $mod.TTMSFNCTreeViewInteraction.$create("Create$1",[this]);
      this.FDragTimer = pas["WEBLib.ExtCtrls"].TTimer.$create("Create$1",[this]);
      this.FDragTimer.SetInterval(10);
      this.FDragTimer.SetEnabled(false);
      this.FDragTimer.FOnTimer = rtl.createCallback(this,"DragTime");
      this.FAnimateTimer = pas["WEBLib.ExtCtrls"].TTimer.$create("Create$1",[this]);
      this.FAnimateTimer.SetInterval(1);
      this.FAnimateTimer.SetEnabled(false);
      this.FAnimateTimer.FOnTimer = rtl.createCallback(this,"Animate");
      this.FCopyNodes = $mod.TTMSFNCTreeViewCopyNodes.$create("Create$3",[null,null]);
      this.FFilterListBox = pas["WEBLib.StdCtrls"].TListBox.$create("Create$1",[this]);
      this.FFilterListBox.FTag$1 = -1;
      this.FFilterListBox.FOnClick = rtl.createCallback(this,"HandleFilterListClick");
      this.FGlobalFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCAppearanceGlobalFont.$create("Create$1",[this]);
      this.FFilterTimer = pas["WEBLib.ExtCtrls"].TTimer.$create("Create$1",[this]);
      this.FFilterTimer.FOnTimer = rtl.createCallback(this,"HandleFilterTimer");
      this.FFilterTimer.SetInterval(100);
      this.FFilterTimer.SetEnabled(false);
      this.FFilterPopup = pas["WEBLib.TMSFNCPopup"].TTMSFNCPopup.$create("Create$1",[this]);
      this.FFilterPopup.SetPlacement(pas["WEBLib.TMSFNCPopup"].TTMSFNCPopupPlacement.ppAbsolute);
      this.FPrecalculateItems = false;
      this.SetWidth(300);
      this.SetHeight(280);
      this.FDefaultViewJSONOptions = $mod.TTMSFNCTreeViewViewJSONOptions.$create("Create$1");
      s = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetDPIScale(this,96);
      if (s === 1) {
        this.FCheckStartSize = 19}
       else if ((s === 1.25) || (s === 1.75)) {
        this.FCheckStartSize = 16}
       else this.FCheckStartSize = 17;
      if (this.IsDesignTime()) this.InitSample();
      return this;
    };
    this.Destroy = function () {
      if (this.FOldInplaceEditor != null) rtl.free(this,"FOldInplaceEditor");
      rtl.free(this,"FDefaultViewJSONOptions");
      rtl.free(this,"FGlobalFont");
      rtl.free(this,"FCopyNodes");
      rtl.free(this,"FFilterTimer");
      rtl.free(this,"FFilterListBox");
      rtl.free(this,"FFilterPopup");
      if (this.FDragBitmap != null) {
        rtl.free(this,"FDragBitmap");
        this.FDragBitmap = null;
      };
      rtl.free(this,"FColumnStroke");
      rtl.free(this,"FAnimateTimer");
      rtl.free(this,"FNodesAppearance");
      rtl.free(this,"FGroupsAppearance");
      rtl.free(this,"FInteraction");
      rtl.free(this,"FColumnsAppearance");
      rtl.free(this,"FGroupsTopDisplay");
      rtl.free(this,"FColumnsTopDisplay");
      rtl.free(this,"FGroupsBottomDisplay");
      rtl.free(this,"FColumnsBottomDisplay");
      rtl.free(this,"FSelectedNodes");
      rtl.free(this,"FNodeDisplay");
      rtl.free(this,"FNodeCache");
      rtl.free(this,"FGroupsTopCache");
      rtl.free(this,"FColumnsTopCache");
      rtl.free(this,"FGroupsBottomCache");
      rtl.free(this,"FColumnsBottomCache");
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.Destroy.call(this);
    };
    this.Assign = function (Source) {
      this.BeginUpdate();
      pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewData.Assign.apply(this,arguments);
      if ($mod.TTMSFNCCustomTreeView.isPrototypeOf(Source)) {
        this.FNodesAppearance.Assign(rtl.as(Source,$mod.TTMSFNCCustomTreeView).FNodesAppearance);
        this.FColumnsAppearance.Assign(rtl.as(Source,$mod.TTMSFNCCustomTreeView).FColumnsAppearance);
        this.FGroupsAppearance.Assign(rtl.as(Source,$mod.TTMSFNCCustomTreeView).FGroupsAppearance);
        this.FInteraction.Assign(rtl.as(Source,$mod.TTMSFNCCustomTreeView).FInteraction);
      };
      this.EndUpdate();
    };
    this.Draw = function (AGraphics, ARect) {
      var st = null;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Draw.apply(this,arguments);
      if (this.FUpdateCount$1 > 0) return;
      AGraphics.FBitmapContainer = this.GetBitmapContainer();
      this.DrawEmptySpaces(AGraphics);
      st = AGraphics.SaveState(false);
      AGraphics.ClipRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.GetContentClipRect()));
      this.DrawNodeColumns(AGraphics);
      AGraphics.RestoreState(st,false);
      this.DrawNodes(AGraphics);
      this.DrawColumns(AGraphics);
      this.DrawGroups(AGraphics);
      this.DrawBorders(AGraphics);
    };
    this.InitSample = function () {
      var pManagers = null;
      var pSpecialists = null;
      var pAssistants = null;
      var pSub = null;
      var c = null;
      var I = 0;
      var n = "";
      this.BeginUpdate();
      this.SetWidth(this.ScalePaintValue(350));
      this.ClearNodeList();
      this.FColumns.Clear();
      this.FNodes.Clear();
      this.ResetToDefaultStyle();
      this.FNodesAppearance.SetExpandWidth(this.ScalePaintValue(18));
      this.FNodesAppearance.SetExpandHeight(this.ScalePaintValue(18));
      this.FColumnsAppearance.SetTopSize(this.ScalePaintValue(36));
      this.FColumnsAppearance.FTopStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
      this.FNodesAppearance.FSelectedStroke.SetWidth(pas.System.Trunc(this.ScalePaintValue$1(2.0)));
      c = this.FColumns.Add$1();
      c.SetText("Name");
      c.SetHorizontalTextAlign(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading);
      c = this.FColumns.Add$1();
      c.SetText("Unit");
      c.SetHorizontalTextAlign(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaTrailing);
      c.SetWidth(this.ScalePaintValue(90));
      c = this.FColumns.Add$1();
      c.SetText("Status");
      c.SetHorizontalTextAlign(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter);
      c.SetWidth(this.ScalePaintValue(80));
      pManagers = this.AddNode(null);
      pManagers.SetText(0,"Managers");
      pSpecialists = this.AddNode(null);
      pSpecialists.SetText(0,"Specialists");
      pAssistants = this.AddNode(null);
      pAssistants.SetText(0,"Assistants");
      for (I = 0; I <= 7; I++) {
        if (I < 3) {
          pSub = this.AddNode(pManagers)}
         else if (I < 5) {
          pSub = this.AddNode(pSpecialists)}
         else pSub = this.AddNode(pAssistants);
        var $tmp = pas.System.Random(125) % 7;
        if ($tmp === 0) {
          n = "Liam"}
         else if ($tmp === 1) {
          n = "Fatma"}
         else if ($tmp === 2) {
          n = "Yusuf"}
         else if ($tmp === 3) {
          n = "Marie"}
         else if ($tmp === 4) {
          n = "Isabella"}
         else if ($tmp === 5) {
          n = "Omar"}
         else {
          n = "Arthur";
        };
        var $tmp1 = pas.System.Random(125) % 7;
        if ($tmp1 === 0) {
          n = n + " Andersson"}
         else if ($tmp1 === 1) {
          n = n + " Wang"}
         else if ($tmp1 === 2) {
          n = n + " Smith"}
         else if ($tmp1 === 3) {
          n = n + " Peeters"}
         else if ($tmp1 === 4) {
          n = n + " Gonzales"}
         else if ($tmp1 === 5) {
          n = n + " Moyo"}
         else {
          n = n + " Ali";
        };
        pSub.SetText(0,n);
        var $tmp2 = pas.System.Random(120) % 7;
        if ($tmp2 === 1) {
          pSub.SetText(1,"Research")}
         else if ($tmp2 === 2) {
          pSub.SetText(1,"Finance")}
         else if ($tmp2 === 3) {
          pSub.SetText(1,"Manufactering")}
         else if ($tmp2 === 4) {
          pSub.SetText(1,"Sales")}
         else if ($tmp2 === 5) {
          pSub.SetText(1,"HR")}
         else if ($tmp2 === 6) {
          pSub.SetText(1,"Marketing")}
         else {
          pSub.SetText(1,"Customers");
        };
        var $tmp3 = pas.System.Random(120) % 5;
        if ($tmp3 === 0) {
          pSub.SetText(2,"Flight")}
         else if ($tmp3 === 1) {
          pSub.SetText(2,"On Leave")}
         else if ($tmp3 === 2) {
          pSub.SetText(2,"Abroad")}
         else {
          pSub.SetText(2,"Office");
        };
      };
      pManagers.SetExpanded(true);
      pSpecialists.SetExpanded(true);
      this.FGlobalFont.SetName("Segoe UI");
      this.FColumnsAppearance.SetStretchAll(false);
      this.FColumnsAppearance.SetStretch(true);
      this.FColumnsAppearance.SetStretchColumn(0);
      this.EndUpdate();
    };
    this.CutToClipboard = function (ATextOnly) {
      var I = 0;
      var n = null;
      var nv = null;
      if (this.FOnCustomCutToClipboard != null) {
        this.FOnCustomCutToClipboard(this)}
       else {
        this.BeginUpdate();
        this.CopyToClipboard(ATextOnly);
        for (var $l = this.SelectedNodeCount() - 1; $l >= 0; $l--) {
          I = $l;
          n = this.GetSelNode(I);
          if (n != null) {
            this.RemoveNode(n)}
           else {
            nv = this.GetSelVirtualNode(I);
            this.RemoveVirtualNode(nv);
          };
        };
        this.EndUpdate();
      };
    };
    this.CopyToClipboard = function (ATextOnly) {
      var s = "";
      var I = 0;
      var K = 0;
      var n = null;
      var v = null;
      var cl = null;
      if (this.FOnCustomCopyToClipboard != null) {
        this.FOnCustomCopyToClipboard(this)}
       else {
        cl = pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewIntegerList.$create("Create$1");
        try {
          s = "";
          for (var $l = 0, $end = this.SelectedVirtualNodeCount() - 1; $l <= $end; $l++) {
            I = $l;
            n = this.GetSelVirtualNode(I);
            if ((n != null) && (cl.IndexOf(n.FRow) === -1)) {
              if (n.FNode != null) s = s + n.FNode.SaveToString(ATextOnly) + $mod.ENDOFLINE;
              cl.Add(n.FRow);
            };
            if (n != null) {
              for (var $l1 = n.FRow + 1, $end1 = n.FRow + n.FTotalChildren; $l1 <= $end1; $l1++) {
                K = $l1;
                v = this.GetNodeFromNodeStructure(K);
                if ((v != null) && (v.FNode != null) && (cl.IndexOf(v.FRow) === -1)) {
                  s = s + v.FNode.SaveToString(ATextOnly) + $mod.ENDOFLINE;
                  cl.Add(v.FRow);
                };
              };
            };
          };
          if (s !== "") pas["WEBLib.TMSFNCUtils"].TTMSFNCClipBoard.SetText($mod.CLP_FMT + s);
        } finally {
          cl = rtl.freeLoc(cl);
        };
      };
    };
    this.PasteFromClipboard = function () {
      var s = "";
      var a = null;
      var ANode = null;
      var ANextNode = null;
      var ALevel = 0;
      var I = 0;
      var off = 0;
      var CurrStr = "";
      if (this.FOnCustomPasteFromClipboard != null) {
        this.FOnCustomPasteFromClipboard(this)}
       else {
        if (pas["WEBLib.TMSFNCUtils"].TTMSFNCClipBoard.HasFormat(pas["WEBLib.TMSFNCUtils"].TTMSFNCClipBoardFormat.cfText)) {
          s = pas["WEBLib.TMSFNCUtils"].TTMSFNCClipBoard.GetText();
          if (pas.System.Pos($mod.CLP_FMT,s) > 0) {
            a = pas.Classes.TStringList.$create("Create$1");
            try {
              s = pas.SysUtils.StringReplace(s,$mod.CLP_FMT,"",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
              a.SetTextStr(s);
              try {
                ANode = null;
                off = 0;
                for (var $l = 0, $end = a.GetCount() - 1; $l <= $end; $l++) {
                  I = $l;
                  ALevel = -1;
                  CurrStr = this.GetBufStart(a.Get(I),{get: function () {
                      return ALevel;
                    }, set: function (v) {
                      ALevel = v;
                    }});
                  if (ANode === null) {
                    ANode = this.AddNode(this.GetFocusedNode());
                    off = ALevel;
                    if (this.GetFocusedNode() != null) off = off - this.GetFocusedNode().FVirtualNode.FLevel;
                  } else if ((ANode.FVirtualNode != null) && (ANode.FVirtualNode.FLevel === (ALevel - off))) {
                    ANode = this.AddNode(ANode.GetParent())}
                   else if ((ANode.FVirtualNode != null) && (ANode.FVirtualNode.FLevel === (ALevel - 1 - off))) {
                    ANode = this.AddNode(ANode)}
                   else if ((ANode.FVirtualNode != null) && (ANode.FVirtualNode.FLevel > (ALevel - off))) {
                    ANextNode = ANode.GetParent();
                    while ((ANextNode != null) && (ANextNode.FVirtualNode != null) && (ANextNode.FVirtualNode.FLevel > (ALevel - off))) ANextNode = ANextNode.GetParent();
                    ANode = this.AddNode(ANextNode.GetParent());
                  };
                  if (ANode != null) ANode.LoadFromString(CurrStr);
                };
              } finally {
              };
            } finally {
              a = rtl.freeLoc(a);
            };
          };
        };
      };
    };
    this.Sort = function (AColumn, ARecurse, ACaseSensitive, ASortingMode, AClearNodeList) {
      this.FNodes.Sort$1(AColumn,ARecurse,ACaseSensitive,ASortingMode,AClearNodeList);
    };
    this.ClearSorting = function () {
      var I = 0;
      this.BeginUpdate();
      this.FSortColumn = -1;
      for (var $l = 0, $end = this.FColumns.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.FColumns.GetItem$1(I).SetSortKind(pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodesSortKind.nskNone);
        this.FColumns.GetItem$1(I).SetSortIndex(-1);
      };
      this.EndUpdate();
    };
    this.LoadFromStream = function (AStream, AEncoding) {
      var List = null;
      var ANode = null;
      var NextNode = null;
      var ALevel = 0;
      var i = 0;
      var CurrStr = "";
      List = pas.Classes.TStringList.$create("Create$1");
      this.BeginUpdate();
      this.ClearNodeList();
      try {
        try {
          this.ClearNodes();
          pas.Classes.TStringsHelper.LoadFromStream$1.call(List,AStream,AEncoding);
          ANode = null;
          for (var $l = 0, $end = List.GetCount() - 1; $l <= $end; $l++) {
            i = $l;
            ALevel = -1;
            CurrStr = this.GetBufStart(List.Get(i),{get: function () {
                return ALevel;
              }, set: function (v) {
                ALevel = v;
              }});
            if (ANode === null) {
              ANode = this.AddNode(null)}
             else if ((ANode.FVirtualNode != null) && (ANode.FVirtualNode.FLevel === ALevel)) {
              ANode = this.AddNode(ANode.GetParent())}
             else if ((ANode.FVirtualNode != null) && (ANode.FVirtualNode.FLevel === (ALevel - 1))) {
              ANode = this.AddNode(ANode)}
             else if ((ANode.FVirtualNode != null) && (ANode.FVirtualNode.FLevel > ALevel)) {
              NextNode = ANode.GetParent();
              while ((NextNode != null) && (NextNode.FVirtualNode != null) && (NextNode.FVirtualNode.FLevel > ALevel)) NextNode = NextNode.GetParent();
              ANode = this.AddNode(NextNode.GetParent());
            };
            if (ANode != null) ANode.LoadFromString(CurrStr);
            this.BuildNodeList();
          };
        } finally {
          this.EndUpdate();
          List = rtl.freeLoc(List);
        };
      } catch ($e) {
      };
    };
    this.ViewJSON = function (AFileName, AViewOptions) {
      var $Self = this;
      var ms = null;
      function InternalInputFromJSON() {
        ms.SetPosition(0);
        $Self.ViewJSONFromStream(ms,AViewOptions);
      };
      ms = pas.Classes.TMemoryStream.$create("Create");
      try {
        ms.LoadFromFile(AFileName,function () {
          InternalInputFromJSON();
          ms = rtl.freeLoc(ms);
        },null);
      } finally {
      };
    };
    this.ViewJSONFromStream = function (AStream, AViewOptions) {
      var SL = null;
      SL = pas.Classes.TStringList.$create("Create$1");
      try {
        AStream.SetPosition(0);
        pas.Classes.TStringsHelper.LoadFromStream.call(SL,AStream);
        this.ViewJSONFromText(SL.GetTextStr(),AViewOptions);
      } finally {
        SL = rtl.freeLoc(SL);
      };
    };
    this.ViewJSONFromText = function (AText, AViewOptions) {
      var $Self = this;
      var j = null;
      var col = null;
      var NameIndex = 0;
      var ValueIndex = 0;
      function SetJSONNodeText(ANode, AName, ATextType, AJSONValue, AValue) {
        if (ANode.FValues.GetCount() === 0) ANode.FValues.Add$1();
        var $tmp = ATextType;
        if ($tmp === $impl.TTMSFNCTreeViewJSONType.jtValue) {
          ANode.SetText(NameIndex,AName);
          ANode.FValues.GetItem$1(NameIndex).FHTMLTemplateItems.Add("NAME=" + AName);
          ANode.SetText(ValueIndex,AValue);
          ANode.FValues.GetItem$1(ValueIndex).FHTMLTemplateItems.Add("VALUE=" + AValue);
          ANode.FTag = 1;
        } else if ($tmp === $impl.TTMSFNCTreeViewJSONType.jtArraySize) {
          ANode.SetText(NameIndex,AName + " [" + AValue + "]");
          ANode.FValues.GetItem$1(NameIndex).FHTMLTemplateItems.Add("NAME=" + AName + " [" + AValue + "]");
          ANode.FTag = 2;
        } else if ($tmp === $impl.TTMSFNCTreeViewJSONType.jtObjectSize) {
          ANode.SetText(NameIndex,AName + " {" + AValue + "}");
          ANode.FValues.GetItem$1(NameIndex).FHTMLTemplateItems.Add("NAME=" + AName + " {" + AValue + "}");
          ANode.FTag = 3;
        } else if ($tmp === $impl.TTMSFNCTreeViewJSONType.jtArrayIndex) {
          ANode.SetText(NameIndex,AViewOptions.FArrayItemPrefix + AName + AViewOptions.FArrayItemSuffix);
          ANode.FValues.GetItem$1(NameIndex).FHTMLTemplateItems.Add("NAME=" + AViewOptions.FArrayItemPrefix + AName + AViewOptions.FArrayItemSuffix);
          ANode.FTag = 4;
        };
        $Self.DoAfterAddJSONNode(ANode,AJSONValue);
      };
      function ParseNode(nj, ANode) {
        var I = 0;
        var K = 0;
        var c = 0;
        var jv = null;
        var njav = null;
        var jav = null;
        var n = null;
        var sn = null;
        var nja = null;
        var ja = null;
        var name = "";
        var add = false;
        if (pas["WEBLib.JSON"].TJSONArray.isPrototypeOf(nj)) {
          add = true;
          $Self.DoBeforeAddJSONNode(nj,{get: function () {
              return add;
            }, set: function (v) {
              add = v;
            }});
          if (add) {
            if (ANode != null) {
              n = ANode.FNodes.Add$1()}
             else n = $Self.FNodes.Add$1();
            nja = rtl.as(nj,pas["WEBLib.JSON"].TJSONArray);
            c = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONArraySize(nja);
            SetJSONNodeText(n,name,$impl.TTMSFNCTreeViewJSONType.jtArraySize,nj,pas.SysUtils.IntToStr(c));
            for (var $l = 0, $end = c - 1; $l <= $end; $l++) {
              K = $l;
              njav = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONArrayItem(nja,K);
              if (pas["WEBLib.JSON"].TJSONObject.isPrototypeOf(njav)) {
                sn = n.FNodes.Add$1();
                SetJSONNodeText(sn,pas.SysUtils.IntToStr(K),$impl.TTMSFNCTreeViewJSONType.jtArrayIndex,nj,"");
                sn.SetText(0,pas.SysUtils.IntToStr(K));
                ParseNode(njav,sn);
              } else {
                SetJSONNodeText(n.FNodes.Add$1(),pas.SysUtils.IntToStr(K),$impl.TTMSFNCTreeViewJSONType.jtValue,njav,njav.GetStrValue());
              };
            };
          };
        } else if (pas["WEBLib.JSON"].TJSONObject.isPrototypeOf(nj)) {
          for (var $l1 = 0, $end1 = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONObjectSize(rtl.as(nj,pas["WEBLib.JSON"].TJSONObject)) - 1; $l1 <= $end1; $l1++) {
            I = $l1;
            name = "";
            name = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONObjectName(rtl.as(nj,pas["WEBLib.JSON"].TJSONObject),I);
            jv = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONObjectItem(rtl.as(nj,pas["WEBLib.JSON"].TJSONObject),I);
            add = true;
            $Self.DoBeforeAddJSONNode(jv,{get: function () {
                return add;
              }, set: function (v) {
                add = v;
              }});
            if (add) {
              if (ANode != null) {
                n = ANode.FNodes.Add$1()}
               else n = $Self.FNodes.Add$1();
              if (jv != null) {
                if (pas["WEBLib.JSON"].TJSONArray.isPrototypeOf(jv)) {
                  ja = rtl.as(jv,pas["WEBLib.JSON"].TJSONArray);
                  c = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONArraySize(ja);
                  SetJSONNodeText(n,name,$impl.TTMSFNCTreeViewJSONType.jtArraySize,jv,pas.SysUtils.IntToStr(c));
                  for (var $l2 = 0, $end2 = c - 1; $l2 <= $end2; $l2++) {
                    K = $l2;
                    jav = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONArrayItem(ja,K);
                    if (pas["WEBLib.JSON"].TJSONObject.isPrototypeOf(jav)) {
                      sn = n.FNodes.Add$1();
                      SetJSONNodeText(sn,pas.SysUtils.IntToStr(K),$impl.TTMSFNCTreeViewJSONType.jtArrayIndex,jv,"");
                      ParseNode(jav,sn);
                    } else {
                      SetJSONNodeText(n.FNodes.Add$1(),pas.SysUtils.IntToStr(K),$impl.TTMSFNCTreeViewJSONType.jtValue,jav,jav.GetStrValue());
                    };
                  };
                } else if (pas["WEBLib.JSON"].TJSONObject.isPrototypeOf(jv)) {
                  SetJSONNodeText(n,name,$impl.TTMSFNCTreeViewJSONType.jtObjectSize,jv,pas.SysUtils.IntToStr(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetJSONObjectSize(rtl.as(jv,pas["WEBLib.JSON"].TJSONObject))));
                  ParseNode(jv,n);
                } else SetJSONNodeText(n,name,$impl.TTMSFNCTreeViewJSONType.jtValue,jv,jv.GetStrValue());
              };
            };
          };
        } else {
          if (ANode != null) {
            SetJSONNodeText(ANode,name,$impl.TTMSFNCTreeViewJSONType.jtValue,nj,nj.GetStrValue())}
           else SetJSONNodeText($Self.FNodes.Add$1(),name,$impl.TTMSFNCTreeViewJSONType.jtValue,nj,nj.GetStrValue());
        };
      };
      NameIndex = 0;
      ValueIndex = 1;
      this.BeginUpdate();
      if (AViewOptions === null) AViewOptions = this.FDefaultViewJSONOptions;
      this.FNodes.Clear();
      this.FColumns.Clear();
      col = this.FColumns.Add$1();
      col.SetText("Object");
      col.SetTrimming(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttCharacter);
      col.FFont.SetStyle(rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsBold));
      col = this.FColumns.Add$1();
      col.SetText("Value");
      this.FColumns.GetItem$1(NameIndex).SetHTMLTemplate(AViewOptions.FNameHTMLTemplate);
      this.FColumns.GetItem$1(ValueIndex).SetHTMLTemplate(AViewOptions.FValueHTMLTemplate);
      j = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.ParseJSON(AText);
      if (j != null) try {
        ParseNode(j,null);
      } finally {
        j = rtl.freeLoc(j);
      };
      this.EndUpdate();
      if (AViewOptions.FExpandNodes) this.ExpandAll();
      if (AViewOptions.FStretchColumn > -1) {
        this.BeginUpdate();
        this.FColumnsAppearance.SetStretchAll(false);
        this.FColumnsAppearance.SetStretchColumn(AViewOptions.FStretchColumn);
        this.FColumnsAppearance.SetStretch(false);
        this.AutoSizeColumn(0);
        this.FColumns.GetItem$1(0).SetWidth(this.GetColWidths(0));
        this.FColumnsAppearance.SetStretch(true);
        this.EndUpdate();
      };
    };
    this.RemoveSelectedVirtualNodes = function () {
      var I = 0;
      var n = null;
      this.FBlockUpdate = true;
      for (var $l = this.SelectedVirtualNodeCount() - 1; $l >= 0; $l--) {
        I = $l;
        n = this.GetSelVirtualNode(I);
        this.FSelectedNodes.Remove(n);
        this.RemoveVirtualNode(n);
      };
      this.FBlockUpdate = false;
      this.ResetNodes(false);
      this.UpdateTreeView();
      this.Invalidate();
    };
    this.RemoveSelectedNodes = function () {
      var I = 0;
      var n = null;
      this.FBlockUpdate = true;
      for (var $l = this.SelectedNodeCount() - 1; $l >= 0; $l--) {
        I = $l;
        n = this.GetSelNode(I);
        this.FSelectedNodes.Remove(n.FVirtualNode);
        this.RemoveNode(n);
      };
      this.FBlockUpdate = false;
      this.ResetNodes(false);
      this.UpdateTreeView();
      this.Invalidate();
    };
    this.UnSelectAllNodes = function () {
      this.UnSelectAllVirtualNodes();
    };
    this.SelectAllNodes = function () {
      this.SelectAllVirtualNodes();
    };
    this.UnSelectAllVirtualNodes = function () {
      this.FSelectedNodes.Clear();
      this.Invalidate();
    };
    this.SelectAllVirtualNodes = function () {
      var I = 0;
      var n = null;
      var en = false;
      this.FSelectedNodes.Clear();
      for (var $l = 0, $end = this.FVisibleNodes.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        n = this.FVisibleNodes.GetItem(I);
        if (n != null) {
          en = this.IsVirtualNodeSelectable(n);
          if (en) this.FSelectedNodes.Add(n);
        };
      };
      this.Invalidate();
    };
    this.SelectNode = function (ANode) {
      if (ANode != null) {
        this.SelectVirtualNode(ANode.FVirtualNode)}
       else this.SelectVirtualNode(null);
    };
    this.SelectVirtualNodeByRow = function (ARow) {
      this.SelectVirtualNode(this.GetNodeForRow(ARow));
    };
    this.SelectVirtualNode = function (ANode) {
      var en = false;
      this.FSelectedNodes.Clear();
      if (ANode != null) {
        en = this.IsVirtualNodeSelectable(ANode);
        if (en) {
          this.FSelectedNodes.Add(ANode);
          this.FFocusedNode = ANode;
          this.InternalSelectVirtualNode(ANode);
        };
      };
      this.Invalidate();
    };
    this.SelectNodes = function (ANodes) {
      var I = 0;
      var v = null;
      var en = false;
      this.FSelectedNodes.Clear();
      for (var $l = 0, $end = rtl.length(ANodes) - 1; $l <= $end; $l++) {
        I = $l;
        v = ANodes[I];
        if (v != null) {
          en = this.IsVirtualNodeSelectable(v.FVirtualNode);
          if (en) this.FSelectedNodes.Add(v.FVirtualNode);
        };
      };
      this.Invalidate();
    };
    this.SelectVirtualNodes = function (ANodes) {
      var I = 0;
      var v = null;
      var en = false;
      this.FSelectedNodes.Clear();
      for (var $l = 0, $end = rtl.length(ANodes) - 1; $l <= $end; $l++) {
        I = $l;
        v = ANodes[I];
        if (v != null) {
          en = this.IsVirtualNodeSelectable(v);
          if (en) this.FSelectedNodes.Add(v);
        };
      };
      this.Invalidate();
    };
    this.UnSelectNode = function (ANode) {
      if (ANode != null) this.UnSelectVirtualNode(ANode.FVirtualNode);
    };
    this.UnSelectVirtualNode = function (ANode) {
      this.FSelectedNodes.Remove(ANode);
      this.Invalidate();
    };
    this.UnSelectNodes = function (ANodes) {
      var I = 0;
      var v = null;
      for (var $l = 0, $end = rtl.length(ANodes) - 1; $l <= $end; $l++) {
        I = $l;
        v = ANodes[I];
        if (v != null) this.FSelectedNodes.Remove(v.FVirtualNode);
      };
      this.Invalidate();
    };
    this.UnSelectVirtualNodes = function (ANodes) {
      var I = 0;
      var v = null;
      for (var $l = 0, $end = rtl.length(ANodes) - 1; $l <= $end; $l++) {
        I = $l;
        v = ANodes[I];
        this.FSelectedNodes.Remove(v);
      };
      this.Invalidate();
    };
    this.RemoveNodeFromSelection = function (ANode) {
      this.FSelectedNodes.Remove(ANode);
    };
    this.AddNodeToSelection = function (ANode) {
      this.FSelectedNodes.Add(ANode);
    };
    this.EditNode = function (ANode, AColumn) {
      if (ANode != null) this.EditVirtualNode(ANode.FVirtualNode,AColumn);
    };
    this.EditVirtualNode = function (ANode, AColumn) {
      this.HandleNodeEditing(ANode,AColumn);
      this.Invalidate();
    };
    this.StopEditing = function () {
      if (this.FInplaceEditorActive) this.CloseInplaceEditor(false,false);
    };
    this.CancelEditing = function () {
      if (this.FInplaceEditorActive) this.CloseInplaceEditor(true,false);
    };
    this.Clear = function () {
      this.BeginUpdate();
      this.ClearNodes();
      this.ClearColumns();
      this.ClearSorting();
      this.EndUpdate();
    };
    this.GetVisibleNodeCount = function () {
      var Result = 0;
      var f = null;
      var l = null;
      Result = 0;
      f = this.GetFirstVisibleVirtualNode();
      l = this.GetLastVisibleVirtualNode();
      if ((f != null) && (l != null)) Result = (l.FRow - f.FRow) + 1;
      return Result;
    };
    this.GetFirstVisibleVirtualNode = function () {
      var Result = null;
      Result = null;
      if (this.FNodeDisplay.GetCount() > 0) Result = this.FNodeDisplay.GetItem(0).FNode;
      return Result;
    };
    this.GetLastVisibleVirtualNode = function () {
      var Result = null;
      Result = null;
      if (this.FNodeDisplay.GetCount() > 0) Result = this.FNodeDisplay.GetItem(this.FNodeDisplay.GetCount() - 1).FNode;
      return Result;
    };
    this.GetFirstVisibleVirtualNodeRow = function () {
      var Result = 0;
      var n = null;
      n = this.GetFirstVisibleVirtualNode();
      Result = 0;
      if (n != null) Result = n.FRow;
      return Result;
    };
    this.GetLastVisibleVirtualNodeRow = function () {
      var Result = 0;
      var n = null;
      n = this.GetLastVisibleVirtualNode();
      Result = 0;
      if (n != null) Result = n.FRow;
      return Result;
    };
    this.GetNodesFromClipboard = function () {
      var Result = null;
      var s = "";
      var a = null;
      var ANode = null;
      var ANextNode = null;
      var ALevel = 0;
      var I = 0;
      var off = 0;
      var CurrStr = "";
      var tempt = null;
      if (pas["WEBLib.TMSFNCUtils"].TTMSFNCClipBoard.HasFormat(pas["WEBLib.TMSFNCUtils"].TTMSFNCClipBoardFormat.cfText)) {
        s = pas["WEBLib.TMSFNCUtils"].TTMSFNCClipBoard.GetText();
        if (pas.System.Pos($mod.CLP_FMT,s) > 0) {
          tempt = $mod.TTMSFNCCustomTreeView.$create("Create$1",[null]);
          a = pas.Classes.TStringList.$create("Create$1");
          try {
            s = pas.SysUtils.StringReplace(s,$mod.CLP_FMT,"",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
            a.SetTextStr(s);
            try {
              ANode = null;
              off = 0;
              for (var $l = 0, $end = a.GetCount() - 1; $l <= $end; $l++) {
                I = $l;
                ALevel = -1;
                CurrStr = this.GetBufStart(a.Get(I),{get: function () {
                    return ALevel;
                  }, set: function (v) {
                    ALevel = v;
                  }});
                if (ANode === null) {
                  ANode = tempt.AddNode(null);
                  off = ALevel;
                } else if ((ANode.FVirtualNode != null) && (ANode.FVirtualNode.FLevel === (ALevel - off))) {
                  ANode = tempt.AddNode(ANode.GetParent())}
                 else if ((ANode.FVirtualNode != null) && (ANode.FVirtualNode.FLevel === (ALevel - 1 - off))) {
                  ANode = tempt.AddNode(ANode)}
                 else if ((ANode.FVirtualNode != null) && (ANode.FVirtualNode.FLevel > (ALevel - off))) {
                  ANextNode = ANode.GetParent();
                  while ((ANextNode != null) && (ANextNode.FVirtualNode != null) && (ANextNode.FVirtualNode.FLevel > (ALevel - off))) ANextNode = ANextNode.GetParent();
                  ANode = tempt.AddNode(ANextNode.GetParent());
                };
                if (ANode != null) ANode.LoadFromString(CurrStr);
              };
            } finally {
            };
          } finally {
            this.FCopyNodes.Assign(tempt.FNodes);
            a = rtl.freeLoc(a);
            tempt = rtl.freeLoc(tempt);
          };
        };
      };
      Result = this.FCopyNodes;
      return Result;
    };
    this.IsEditing = function () {
      var Result = false;
      Result = this.FInplaceEditorActive;
      return Result;
    };
    this.LookupNode = function (ALookupString, ARootNodesOnly, AColumn, ACaseSensitive, AAutoSelect, AAutoExpand) {
      var Result = null;
      var v = "";
      var n = null;
      var fvn = null;
      var lvn = null;
      var s = "";
      var sr = 0;
      var er = 0;
      var m = 0;
      var C = 0;
      var fnd = false;
      Result = null;
      v = ALookupString;
      if (!ACaseSensitive) v = pas.SysUtils.UpperCase(v);
      if (ARootNodesOnly) {
        n = this.GetFirstRootVirtualNode();
        while (n != null) {
          fvn = this.GetFirstVisibleVirtualNode();
          lvn = this.GetLastVisibleVirtualNode();
          if (!this.FInteraction.FLookup.FVisibleNodesOnly || (this.FInteraction.FLookup.FVisibleNodesOnly && (fvn != null) && (lvn != null) && (n.FRow <= lvn.FRow) && (n.FRow >= fvn.FRow))) {
            if ((AColumn >= 0) && (AColumn <= (this.FColumns.GetCount() - 1))) {
              s = "";
              this.DoGetNodeText(n,AColumn,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeTextMode.tntmDrawing,{get: function () {
                  return s;
                }, set: function (v) {
                  s = v;
                }});
              s = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.HTMLStrip(s);
              if (!ACaseSensitive) s = pas.SysUtils.UpperCase(s);
              if (pas.System.Pos(v,s) === 1) {
                Result = n;
                break;
              };
            } else {
              fnd = false;
              for (var $l = 0, $end = this.FColumns.GetCount() - 1; $l <= $end; $l++) {
                C = $l;
                s = "";
                this.DoGetNodeText(n,C,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeTextMode.tntmDrawing,{get: function () {
                    return s;
                  }, set: function (v) {
                    s = v;
                  }});
                s = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.HTMLStrip(s);
                if (!ACaseSensitive) s = pas.SysUtils.UpperCase(s);
                if (pas.System.Pos(v,s) === 1) {
                  Result = n;
                  fnd = true;
                  break;
                };
              };
              if (fnd) break;
            };
          };
          n = n.GetNextSibling();
        };
      } else {
        sr = 0;
        er = this.FNodeStructure.GetCount() - 1;
        for (var $l1 = sr, $end1 = er; $l1 <= $end1; $l1++) {
          m = $l1;
          n = this.GetNodeFromNodeStructure(m);
          if (n != null) {
            fvn = this.GetFirstVisibleVirtualNode();
            lvn = this.GetLastVisibleVirtualNode();
            if (!this.FInteraction.FLookup.FVisibleNodesOnly || (this.FInteraction.FLookup.FVisibleNodesOnly && (fvn != null) && (lvn != null) && (n.FRow <= lvn.FRow) && (n.FRow >= fvn.FRow))) {
              if ((AColumn >= 0) && (AColumn <= (this.FColumns.GetCount() - 1))) {
                s = "";
                this.DoGetNodeText(n,AColumn,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeTextMode.tntmDrawing,{get: function () {
                    return s;
                  }, set: function (v) {
                    s = v;
                  }});
                s = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.HTMLStrip(s);
                if (!ACaseSensitive) s = pas.SysUtils.UpperCase(s);
                if (pas.System.Pos(v,s) === 1) {
                  Result = n;
                  break;
                };
              } else {
                fnd = false;
                for (var $l2 = 0, $end2 = this.FColumns.GetCount() - 1; $l2 <= $end2; $l2++) {
                  C = $l2;
                  s = "";
                  this.DoGetNodeText(n,C,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeTextMode.tntmDrawing,{get: function () {
                      return s;
                    }, set: function (v) {
                      s = v;
                    }});
                  s = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.HTMLStrip(s);
                  if (!ACaseSensitive) s = pas.SysUtils.UpperCase(s);
                  if (pas.System.Pos(v,s) === 1) {
                    Result = n;
                    fnd = true;
                    break;
                  };
                };
                if (fnd) break;
              };
            };
          };
        };
      };
      if (Result != null) {
        if (AAutoExpand) {
          n = Result.GetParent();
          while ((n != null) && (n.FLevel > 0)) {
            if (!n.FExpanded) n.Expand(false);
            n = n.GetParent();
          };
          if (n != null) n.Expand(false);
        };
        if (AAutoSelect) {
          if (this.IsVirtualNodeSelectable(Result)) {
            this.SelectVirtualNode(Result);
            this.NotifyDataBinderSetActiveRecord();
          };
          this.ScrollToVirtualNode(Result,true,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeScrollPosition.tvnspTop,false);
        };
      };
      return Result;
    };
    this.GetInplaceEditor = function () {
      var Result = null;
      Result = this.FInplaceEditor;
      return Result;
    };
    this.IsNodeSelectable = function (ANode) {
      var Result = false;
      Result = true;
      if (ANode != null) Result = this.IsVirtualNodeSelectable(ANode.FVirtualNode);
      return Result;
    };
    this.IsVirtualNodeSelectable = function (ANode) {
      var Result = false;
      var ext = false;
      Result = true;
      if (ANode != null) {
        this.DoIsNodeEnabled(ANode,{get: function () {
            return Result;
          }, set: function (v) {
            Result = v;
          }});
        ext = false;
        this.DoIsNodeExtended(ANode,{get: function () {
            return ext;
          }, set: function (v) {
            ext = v;
          }});
        if ((ext && !this.FInteraction.FExtendedSelectable) || !(this.FVisibleNodes.IndexOf(ANode) > -1)) Result = false;
      };
      return Result;
    };
    this.XYToColumnAnchor = function (AX, AY, AIndex) {
      var Result = "";
      Result = this.XYToColumnAnchorCache(AX,AY,this.FColumnsTopCache,AIndex);
      if ((Result === "") && (AIndex.get() === -1)) Result = this.XYToColumnAnchorCache(AX,AY,this.FColumnsBottomCache,AIndex);
      return Result;
    };
    this.XYToNode = function (X, Y, OffsetX) {
      var Result = null;
      var dsp = null;
      Result = null;
      dsp = this.XYToCacheItem(X,Y,OffsetX);
      if (dsp != null) Result = dsp.FNode;
      return Result;
    };
    this.XYToNodeAnchor = function (ANode, X, Y) {
      var Result = $mod.TTMSFNCTreeViewNodeAnchor.$new();
      var I = 0;
      var txtr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var a = "";
      var str = "";
      var g = null;
      var c = null;
      var ha = 0;
      var va = 0;
      var ww = false;
      var trim = 0;
      var ext = false;
      var st = 0;
      var stp = 0;
      Result.AAnchor = "";
      Result.AColumn = -1;
      if (ANode != null) {
        st = this.GetFirstVisibleColumn();
        stp = this.GetLastVisibleColumn();
        for (var $l = st, $end = stp; $l <= $end; $l++) {
          I = $l;
          if (((I - st) >= 0) && ((I - st) <= (rtl.length(ANode.FTextRects) - 1))) {
            txtr.$assign(ANode.FTextRects[I - st]);
            pas["WEBLib.TMSFNCTypes"].InflateRectEx(txtr,this.ScalePaintValue(-2),this.ScalePaintValue(-2));
            if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(txtr,pas["WEBLib.TMSFNCTypes"].PointF(X,Y))) {
              c = null;
              if (I <= (this.FColumns.GetCount() - 1)) c = this.FColumns.GetItem$1(I);
              ext = false;
              ha = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading;
              va = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
              ww = false;
              trim = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone;
              if (c != null) {
                ha = c.FHorizontalTextAlign;
                va = c.FVerticalTextAlign;
                ww = c.FWordWrapping;
                trim = c.FTrimming;
              };
              this.DoIsNodeExtended(ANode,{get: function () {
                  return ext;
                }, set: function (v) {
                  ext = v;
                }});
              this.DoGetNodeTrimming(ANode,I,{get: function () {
                  return trim;
                }, set: function (v) {
                  trim = v;
                }});
              this.DoGetNodeWordWrapping(ANode,I,{get: function () {
                  return ww;
                }, set: function (v) {
                  ww = v;
                }});
              this.DoGetNodeHorizontalTextAlign(ANode,I,{get: function () {
                  return ha;
                }, set: function (v) {
                  ha = v;
                }});
              this.DoGetNodeVerticalTextAlign(ANode,I,{get: function () {
                  return va;
                }, set: function (v) {
                  va = v;
                }});
              str = "";
              this.DoGetNodeText(ANode,I,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeTextMode.tntmDrawing,{get: function () {
                  return str;
                }, set: function (v) {
                  str = v;
                }});
              g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[1,1,false,true]);
              g.BeginScene();
              if ((c != null) && !c.FUseDefaultAppearance && !ext) {
                g.FFont.Assign(c.FFont)}
               else {
                if (ext) {
                  g.FFont.Assign(this.FNodesAppearance.FExtendedFont)}
                 else g.FFont.Assign(this.FNodesAppearance.FFont);
              };
              g.FBitmapContainer = this.GetBitmapContainer();
              g.FOptimizedHTMLDrawing = this.FOptimizedHTMLDrawing;
              try {
                a = g.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(txtr),str,ww,ha,va,trim,0,-1,-1,true,true,X,Y);
              } finally {
                g.EndScene();
                g = rtl.freeLoc(g);
              };
              if (a !== "") {
                Result.AAnchor = a;
                Result.AColumn = I;
                break;
              };
            };
          };
        };
      };
      return Result;
    };
    this.XYToNodeTitleAnchor = function (ANode, X, Y) {
      var Result = $mod.TTMSFNCTreeViewNodeAnchor.$new();
      var I = 0;
      var titr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var a = "";
      var str = "";
      var g = null;
      var c = null;
      var ha = 0;
      var va = 0;
      var ww = false;
      var trim = 0;
      var st = 0;
      var stp = 0;
      Result.AAnchor = "";
      Result.AColumn = -1;
      if (ANode != null) {
        st = this.GetFirstVisibleColumn();
        stp = this.GetLastVisibleColumn();
        for (var $l = st, $end = stp; $l <= $end; $l++) {
          I = $l;
          if (((I - st) >= 0) && ((I - st) <= (rtl.length(ANode.FTitleRects) - 1))) {
            titr.$assign(ANode.FTitleRects[I - st]);
            pas["WEBLib.TMSFNCTypes"].InflateRectEx(titr,this.ScalePaintValue(-2),this.ScalePaintValue(-2));
            if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(titr,pas["WEBLib.TMSFNCTypes"].PointF(X,Y))) {
              c = null;
              if (I <= (this.FColumns.GetCount() - 1)) c = this.FColumns.GetItem$1(I);
              ha = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading;
              va = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
              ww = false;
              trim = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone;
              if (c != null) {
                ha = c.FTitleHorizontalTextAlign;
                va = c.FTitleVerticalTextAlign;
                ww = c.FTitleWordWrapping;
                trim = c.FTitleTrimming;
              };
              this.DoGetNodeTitleTrimming(ANode,I,{get: function () {
                  return trim;
                }, set: function (v) {
                  trim = v;
                }});
              this.DoGetNodeTitleWordWrapping(ANode,I,{get: function () {
                  return ww;
                }, set: function (v) {
                  ww = v;
                }});
              this.DoGetNodeTitleHorizontalTextAlign(ANode,I,{get: function () {
                  return ha;
                }, set: function (v) {
                  ha = v;
                }});
              this.DoGetNodeTitleVerticalTextAlign(ANode,I,{get: function () {
                  return va;
                }, set: function (v) {
                  va = v;
                }});
              str = "";
              this.DoGetNodeTitle(ANode,I,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeTextMode.tntmDrawing,{get: function () {
                  return str;
                }, set: function (v) {
                  str = v;
                }});
              g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[1,1,false,true]);
              g.BeginScene();
              if ((c != null) && !c.FUseDefaultAppearance) {
                g.FFont.Assign(c.FTitleFont)}
               else g.FFont.Assign(this.FNodesAppearance.FTitleFont);
              g.FBitmapContainer = this.GetBitmapContainer();
              g.FOptimizedHTMLDrawing = this.FOptimizedHTMLDrawing;
              try {
                a = g.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(titr),str,ww,ha,va,trim,0,-1,-1,true,true,X,Y);
              } finally {
                g.EndScene();
                g = rtl.freeLoc(g);
              };
              if (a !== "") {
                Result.AAnchor = a;
                Result.AColumn = I;
                break;
              };
            };
          };
        };
      };
      return Result;
    };
    this.XYToNodeExpand = function (ANode, X, Y) {
      var Result = false;
      var nrt = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var en = false;
      var c = 0;
      Result = false;
      if ((ANode != null) && (ANode.FChildren > 0)) {
        en = true;
        this.DoIsNodeEnabled(ANode,{get: function () {
            return en;
          }, set: function (v) {
            en = v;
          }});
        if (en) {
          c = this.GetFirstVisibleColumn();
          if (((this.FNodesAppearance.FExpandColumn - c) >= 0) && ((this.FNodesAppearance.FExpandColumn - c) <= (rtl.length(ANode.FExpandRects) - 1))) {
            nrt.$assign(ANode.FExpandRects[this.FNodesAppearance.FExpandColumn - c]);
            Result = pas["WEBLib.TMSFNCTypes"].PtInRectEx(nrt,pas["WEBLib.TMSFNCTypes"].PointF(X,Y));
          };
        };
      };
      return Result;
    };
    this.XYToNodeExtra = function (ANode, X, Y) {
      var Result = false;
      var nrt = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var en = false;
      var I = 0;
      var st = 0;
      var stp = 0;
      Result = false;
      en = true;
      this.DoIsNodeEnabled(ANode,{get: function () {
          return en;
        }, set: function (v) {
          en = v;
        }});
      if ((ANode != null) && en) {
        st = this.GetFirstVisibleColumn();
        stp = this.GetLastVisibleColumn();
        for (var $l = st, $end = stp; $l <= $end; $l++) {
          I = $l;
          if (((I - st) >= 0) && ((I - st) <= (rtl.length(ANode.FExtraRects) - 1))) {
            nrt.$assign(ANode.FExtraRects[I - st]);
            if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(nrt,pas["WEBLib.TMSFNCTypes"].PointF(X,Y))) {
              Result = true;
              break;
            };
          };
        };
      };
      return Result;
    };
    this.XYToNodeTitleExtra = function (ANode, X, Y) {
      var Result = false;
      var nrt = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var en = false;
      var I = 0;
      var st = 0;
      var stp = 0;
      Result = false;
      en = true;
      this.DoIsNodeEnabled(ANode,{get: function () {
          return en;
        }, set: function (v) {
          en = v;
        }});
      if ((ANode != null) && en) {
        st = this.GetFirstVisibleColumn();
        stp = this.GetLastVisibleColumn();
        for (var $l = st, $end = stp; $l <= $end; $l++) {
          I = $l;
          if (((I - st) >= 0) && ((I - st) <= (rtl.length(ANode.FTitleExtraRects) - 1))) {
            nrt.$assign(ANode.FTitleExtraRects[I - st]);
            if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(nrt,pas["WEBLib.TMSFNCTypes"].PointF(X,Y))) {
              Result = true;
              break;
            };
          };
        };
      };
      return Result;
    };
    this.XYToNodeCheck = function (ANode, X, Y) {
      var Result = $mod.TTMSFNCTreeViewNodeCheck.$new();
      var nrt = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var en = false;
      var I = 0;
      var st = 0;
      var stp = 0;
      Result.AColumn = -1;
      Result.ANode = null;
      en = true;
      this.DoIsNodeEnabled(ANode,{get: function () {
          return en;
        }, set: function (v) {
          en = v;
        }});
      if ((ANode != null) && en) {
        st = this.GetFirstVisibleColumn();
        stp = this.GetLastVisibleColumn();
        for (var $l = st, $end = stp; $l <= $end; $l++) {
          I = $l;
          if (((I - st) >= 0) && ((I - st) <= (rtl.length(ANode.FCheckRects) - 1))) {
            nrt.$assign(ANode.FCheckRects[I - st]);
            if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(nrt,pas["WEBLib.TMSFNCTypes"].PointF(X,Y))) {
              Result.ANode = ANode;
              Result.AColumn = I;
              break;
            };
          };
        };
      };
      return Result;
    };
    this.XYToNodeIcon = function (ANode, X, Y) {
      var Result = $mod.TTMSFNCTreeViewNodeIcon.$new();
      var nrt = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var en = false;
      var I = 0;
      var st = 0;
      var stp = 0;
      Result.AColumn = -1;
      Result.ANode = null;
      en = true;
      this.DoIsNodeEnabled(ANode,{get: function () {
          return en;
        }, set: function (v) {
          en = v;
        }});
      if ((ANode != null) && en) {
        st = this.GetFirstVisibleColumn();
        stp = this.GetLastVisibleColumn();
        for (var $l = st, $end = stp; $l <= $end; $l++) {
          I = $l;
          if (((I - st) >= 0) && ((I - st) <= (rtl.length(ANode.FBitmapRects) - 1))) {
            nrt.$assign(ANode.FBitmapRects[I - st]);
            if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(nrt,pas["WEBLib.TMSFNCTypes"].PointF(X,Y))) {
              Result.ANode = ANode;
              Result.AColumn = I;
              break;
            };
          };
        };
      };
      return Result;
    };
    this.XYToNodeTextColumn = function (ANode, X, Y) {
      var Result = 0;
      var nrt = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var I = 0;
      var st = 0;
      var stp = 0;
      Result = -1;
      if (ANode != null) {
        st = this.GetFirstVisibleColumn();
        stp = this.GetLastVisibleColumn();
        for (var $l = st, $end = stp; $l <= $end; $l++) {
          I = $l;
          if (((I - st) >= 0) && ((I - st) <= (rtl.length(ANode.FTextRects) - 1))) {
            nrt.$assign(ANode.FTextRects[I - st]);
            if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(nrt,pas["WEBLib.TMSFNCTypes"].PointF(X,Y))) {
              Result = I;
              break;
            };
          };
        };
      };
      return Result;
    };
    this.XYToColumnSize = function (X, Y) {
      var Result = 0;
      var I = 0;
      var topr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var colw = 0.0;
      var colp = 0.0;
      Result = -1;
      topr.$assign(this.GetColumnsTopRect());
      topr.Left = topr.Left - this.GetHorizontalScrollPosition();
      for (var $l = this.FColumnCount - 1; $l >= 0; $l--) {
        I = $l;
        if ((I >= 0) && (I <= (this.FColumns.GetCount() - 1)) && this.FColumns.GetItem$1(I).FVisible) {
          colw = this.GetColWidths(I);
          if ((colw >= 0) && (I >= 0) && (I <= (this.FColumns.GetCount() - 1)) && this.FColumns.GetItem$1(I).FVisible) {
            colp = this.GetColPos(I);
            r.$assign(pas["WEBLib.TMSFNCTypes"].RectF((topr.Left + colp + colw) - this.ScalePaintValue(4),topr.Top,topr.Left + colp + colw + this.ScalePaintValue(4),topr.Bottom));
            if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(r,pas["WEBLib.TMSFNCTypes"].PointF(X,Y))) {
              Result = I;
              break;
            };
          };
        };
      };
      return Result;
    };
    this.XYToColumn = function (X, Y, AIncludeRows) {
      var Result = 0;
      var I = 0;
      var topr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var colw = 0.0;
      var colp = 0.0;
      Result = -1;
      if (AIncludeRows) {
        topr.$assign(pas["WEBLib.TMSFNCTreeViewBase"].TTMSFNCTreeViewBase.GetContentRect.call(this))}
       else topr.$assign(this.GetColumnsTopRect());
      topr.Left = topr.Left - this.GetHorizontalScrollPosition();
      for (var $l = this.FColumnCount - 1; $l >= 0; $l--) {
        I = $l;
        if ((I >= 0) && (I <= (this.FColumns.GetCount() - 1)) && this.FColumns.GetItem$1(I).FVisible) {
          colw = this.GetColWidths(I) + this.GetColumnsExtraSize();
          if (colw >= 0) {
            colp = this.GetColPos(I);
            r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(topr.Left + colp,topr.Top,topr.Left + colp + colw,topr.Bottom));
            if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(r,pas["WEBLib.TMSFNCTypes"].PointF(X,Y))) {
              Result = I;
              break;
            };
          };
        };
      };
      return Result;
    };
    this.XYToColumnFilter = function (X, Y) {
      var Result = 0;
      var I = 0;
      var topr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var dr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var szd = 0.0;
      var colw = 0.0;
      var colp = 0.0;
      Result = -1;
      topr.$assign(this.GetColumnsTopRect());
      topr.Left = topr.Left - this.GetHorizontalScrollPosition();
      for (var $l = this.FColumnCount - 1; $l >= 0; $l--) {
        I = $l;
        if ((I >= 0) && (I <= (this.FColumns.GetCount() - 1)) && this.FColumns.GetItem$1(I).FFiltering.FEnabled && this.FColumns.GetItem$1(I).FVisible) {
          colw = this.GetColWidths(I) + this.GetColumnsExtraSize();
          if (colw >= 0) {
            colp = this.GetColPos(I);
            r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(topr.Left + colp,topr.Top,topr.Left + colp + colw,topr.Bottom));
            szd = this.FColumns.GetItem$1(I).FFiltering.FButtonSize;
            dr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Math.round(r.Right - szd - this.ScalePaintValue(4)),Math.round(r.Top + ((r.Bottom - r.Top - szd) / 2)),Math.round(r.Right - this.ScalePaintValue(4)),Math.round(r.Top + ((r.Bottom - r.Top - szd) / 2) + szd)));
            if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(dr,pas["WEBLib.TMSFNCTypes"].PointF(X,Y))) {
              Result = I;
              break;
            };
          };
        };
      };
      return Result;
    };
    this.XYToColumnExpand = function (X, Y) {
      var Result = 0;
      var I = 0;
      var topr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var dr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var sr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var szd = 0.0;
      var colw = 0.0;
      var colp = 0.0;
      var f = 0.0;
      Result = -1;
      topr.$assign(this.GetColumnsTopRect());
      topr.Left = topr.Left - this.GetHorizontalScrollPosition();
      for (var $l = this.FColumnCount - 1; $l >= 0; $l--) {
        I = $l;
        if ((I >= 0) && (I <= (this.FColumns.GetCount() - 1)) && this.FColumns.GetItem$1(I).FExpandable && this.FColumns.GetItem$1(I).FVisible) {
          colw = this.GetColWidths(I) + this.GetColumnsExtraSize();
          if (colw >= 0) {
            colp = this.GetColPos(I);
            r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(topr.Left + colp,topr.Top,topr.Left + colp + colw,topr.Bottom));
            szd = this.FColumns.GetItem$1(I).FExpandingButtonSize;
            if (this.FColumns.GetItem$1(I).FFiltering.FEnabled) {
              f = this.FColumns.GetItem$1(I).FFiltering.FButtonSize;
              dr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Math.round(r.Right - f - this.ScalePaintValue(4)),Math.round(r.Top + ((r.Bottom - r.Top - f) / 2)),Math.round(r.Right - this.ScalePaintValue(4)),Math.round(r.Top + ((r.Bottom - r.Top - f) / 2) + f)));
              sr.$assign(r);
              sr.Right = dr.Left;
            } else sr.$assign(r);
            dr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Math.round(sr.Right - szd - this.ScalePaintValue(6)),Math.round(sr.Top + ((sr.Bottom - sr.Top - szd) / 2)),Math.round(sr.Right - this.ScalePaintValue(6)),Math.round(sr.Top + ((sr.Bottom - sr.Top - szd) / 2) + szd)));
            if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(dr,pas["WEBLib.TMSFNCTypes"].PointF(X,Y))) {
              Result = I;
              break;
            };
          };
        };
      };
      return Result;
    };
    this.SelectedNodeCount = function () {
      var Result = 0;
      Result = this.SelectedVirtualNodeCount();
      return Result;
    };
    this.SelectedVirtualNodeCount = function () {
      var Result = 0;
      Result = this.FSelectedNodes.GetCount();
      return Result;
    };
    this.IsNodeSelected = function (ANode) {
      var Result = false;
      Result = false;
      if (ANode != null) Result = this.IsVirtualNodeSelected(ANode.FVirtualNode);
      return Result;
    };
    this.IsVirtualNodeSelected = function (ANode) {
      var Result = false;
      Result = this.FSelectedNodes.IndexOf(ANode) > -1;
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphicsTypes"].ITMSFNCAppearanceGlobalFont);
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCTreeViewPublished",this.TTMSFNCCustomTreeView,function () {
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphicsTypes"].ITMSFNCAppearanceGlobalFont);
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Fill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFill","SetFill");
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
    $r.addProperty("BitmapContainer",3,pas["WEBLib.TMSFNCBitmapContainer"].$rtti["TTMSFNCBitmapContainer"],"GetBitmapContainer","SetBitmapContainer");
    $r.addProperty("HorizontalScrollBarVisible",2,rtl.boolean,"FHorizontalScrollBarVisible","SetHorizontalScrollBarVisible",4,{Default: true});
    $r.addProperty("VerticalScrollBarVisible",2,rtl.boolean,"FVerticalScrollBarVisible","SetVerticalScrollBarVisible",4,{Default: true});
    $r.addProperty("Groups",2,pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewGroups"],"FGroups","SetGroups");
    $r.addProperty("GroupsAppearance",2,$mod.$rtti["TTMSFNCTreeViewGroupsAppearance"],"FGroupsAppearance","SetGroupsAppearance");
    $r.addProperty("ColumnStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FColumnStroke","SetColumnStroke");
    $r.addProperty("Columns",2,pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewColumns"],"FColumns","SetColumns");
    $r.addProperty("Nodes",2,pas["WEBLib.TMSFNCTreeViewData"].$rtti["TTMSFNCTreeViewNodes"],"FNodes","SetNodes");
    $r.addProperty("ColumnsAppearance",2,$mod.$rtti["TTMSFNCTreeViewColumnsAppearance"],"FColumnsAppearance","SetColumnsAppearance");
    $r.addProperty("NodesAppearance",2,$mod.$rtti["TTMSFNCTreeViewNodesAppearance"],"FNodesAppearance","SetNodesAppearance");
    $r.addProperty("Interaction",2,$mod.$rtti["TTMSFNCTreeViewInteraction"],"FInteraction","SetInteraction");
    $r.addProperty("StretchScrollBars",2,rtl.boolean,"FStretchScrollBars","SetStretchScrollBars",4,{Default: true});
    $r.addProperty("Version",1,rtl.string,"GetVersion","");
    $r.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti["TPopupMenu"],"FPopupMenu","FPopupMenu");
    $r.addProperty("GlobalFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCAppearanceGlobalFont"],"FGlobalFont","SetGlobalFont");
    $r.addProperty("OnCustomizeFilterListBox",0,$mod.$rtti["TTMSFNCTreeViewCustomizeFilterListBoxEvent"],"FOnCustomizeFilterListBox","FOnCustomizeFilterListBox");
    $r.addProperty("OnNeedFilterDropDownData",0,$mod.$rtti["TTMSFNCTreeViewNeedFilterDropDownDataEvent"],"FOnNeedFilterDropDownData","FOnNeedFilterDropDownData");
    $r.addProperty("OnFilterSelect",0,$mod.$rtti["TTMSFNCTreeViewFilterSelectEvent"],"FOnFilterSelect","FOnFilterSelect");
    $r.addProperty("OnBeforeDrawColumn",0,$mod.$rtti["TTMSFNCTreeViewBeforeDrawColumnEvent"],"FOnBeforeDrawColumn","FOnBeforeDrawColumn");
    $r.addProperty("OnAfterDrawColumn",0,$mod.$rtti["TTMSFNCTreeViewAfterDrawColumnEvent"],"FOnAfterDrawColumn","FOnAfterDrawColumn");
    $r.addProperty("OnBeforeDrawColumnHeader",0,$mod.$rtti["TTMSFNCTreeViewBeforeDrawColumnHeaderEvent"],"FOnBeforeDrawColumnHeader","FOnBeforeDrawColumnHeader");
    $r.addProperty("OnAfterDrawColumnHeader",0,$mod.$rtti["TTMSFNCTreeViewAfterDrawColumnHeaderEvent"],"FOnAfterDrawColumnHeader","FOnAfterDrawColumnHeader");
    $r.addProperty("OnBeforeDrawNodeColumn",0,$mod.$rtti["TTMSFNCTreeViewBeforeDrawColumnEvent"],"FOnBeforeDrawNodeColumn","FOnBeforeDrawNodeColumn");
    $r.addProperty("OnAfterDrawNodeColumn",0,$mod.$rtti["TTMSFNCTreeViewAfterDrawColumnEvent"],"FOnAfterDrawNodeColumn","FOnAfterDrawNodeColumn");
    $r.addProperty("OnBeforeSortNodes",0,$mod.$rtti["TTMSFNCTreeViewBeforeSortNodesEvent"],"FOnBeforeSortNodes","FOnBeforeSortNodes");
    $r.addProperty("OnAfterSortNodes",0,$mod.$rtti["TTMSFNCTreeViewAfterSortNodesEvent"],"FOnAfterSortNodes","FOnAfterSortNodes");
    $r.addProperty("OnBeforeDrawGroup",0,$mod.$rtti["TTMSFNCTreeViewBeforeDrawGroupEvent"],"FOnBeforeDrawGroup","FOnBeforeDrawGroup");
    $r.addProperty("OnAfterDrawGroup",0,$mod.$rtti["TTMSFNCTreeViewAfterDrawGroupEvent"],"FOnAfterDrawGroup","FOnAfterDrawGroup");
    $r.addProperty("OnBeforeDrawNode",0,$mod.$rtti["TTMSFNCTreeViewBeforeDrawNodeEvent"],"FOnBeforeDrawNode","FOnBeforeDrawNode");
    $r.addProperty("OnAfterDrawNode",0,$mod.$rtti["TTMSFNCTreeViewAfterDrawNodeEvent"],"FOnAfterDrawNode","FOnAfterDrawNode");
    $r.addProperty("OnBeforeDrawColumnText",0,$mod.$rtti["TTMSFNCTreeViewBeforeDrawColumnTextEvent"],"FOnBeforeDrawColumnText","FOnBeforeDrawColumnText");
    $r.addProperty("OnGetColumnText",0,$mod.$rtti["TTMSFNCTreeViewGetColumnTextEvent"],"FOnGetColumnText","FOnGetColumnText");
    $r.addProperty("OnNodeCompare",0,$mod.$rtti["TTMSFNCTreeViewNodeCompareEvent"],"FOnNodeCompare","FOnNodeCompare");
    $r.addProperty("OnAfterDrawColumnText",0,$mod.$rtti["TTMSFNCTreeViewAfterDrawColumnTextEvent"],"FOnAfterDrawColumnText","FOnAfterDrawColumnText");
    $r.addProperty("OnBeforeDrawGroupText",0,$mod.$rtti["TTMSFNCTreeViewBeforeDrawGroupTextEvent"],"FOnBeforeDrawGroupText","FOnBeforeDrawGroupText");
    $r.addProperty("OnGetGroupText",0,$mod.$rtti["TTMSFNCTreeViewGetGroupTextEvent"],"FOnGetGroupText","FOnGetGroupText");
    $r.addProperty("OnAfterDrawGroupText",0,$mod.$rtti["TTMSFNCTreeViewAfterDrawGroupTextEvent"],"FOnAfterDrawGroupText","FOnAfterDrawGroupText");
    $r.addProperty("OnBeforeDrawNodeText",0,$mod.$rtti["TTMSFNCTreeViewBeforeDrawNodeTextEvent"],"FOnBeforeDrawNodeText","FOnBeforeDrawNodeText");
    $r.addProperty("OnAfterDrawNodeIcon",0,$mod.$rtti["TTMSFNCTreeViewAfterDrawNodeIconEvent"],"FOnAfterDrawNodeIcon","FOnAfterDrawNodeIcon");
    $r.addProperty("OnAfterDrawNodeExpand",0,$mod.$rtti["TTMSFNCTreeViewAfterDrawNodeExpandEvent"],"FOnAfterDrawNodeExpand","FOnAfterDrawNodeExpand");
    $r.addProperty("OnBeforeDrawNodeIcon",0,$mod.$rtti["TTMSFNCTreeViewBeforeDrawNodeIconEvent"],"FOnBeforeDrawNodeIcon","FOnBeforeDrawNodeIcon");
    $r.addProperty("OnBeforeDrawNodeExpand",0,$mod.$rtti["TTMSFNCTreeViewBeforeDrawNodeExpandEvent"],"FOnBeforeDrawNodeExpand","FOnBeforeDrawNodeExpand");
    $r.addProperty("OnAfterDrawNodeCheck",0,$mod.$rtti["TTMSFNCTreeViewAfterDrawNodeCheckEvent"],"FOnAfterDrawNodeCheck","FOnAfterDrawNodeCheck");
    $r.addProperty("OnBeforeDrawNodeCheck",0,$mod.$rtti["TTMSFNCTreeViewBeforeDrawNodeCheckEvent"],"FOnBeforeDrawNodeCheck","FOnBeforeDrawNodeCheck");
    $r.addProperty("OnGetNodeCheckType",0,$mod.$rtti["TTMSFNCTreeViewGetNodeCheckTypeEvent"],"FOnGetNodeCheckType","FOnGetNodeCheckType");
    $r.addProperty("OnGetNodeText",0,$mod.$rtti["TTMSFNCTreeViewGetNodeTextEvent"],"FOnGetNodeText","FOnGetNodeText");
    $r.addProperty("OnGetNodeData",0,$mod.$rtti["TTMSFNCTreeViewGetNodeDataEvent"],"FOnGetNodeData","FOnGetNodeData");
    $r.addProperty("OnBeforeSizeColumn",0,$mod.$rtti["TTMSFNCTreeViewBeforeSizeColumnEvent"],"FOnBeforeSizeColumn","FOnBeforeSizeColumn");
    $r.addProperty("OnAfterSizeColumn",0,$mod.$rtti["TTMSFNCTreeViewAfterSizeColumnEvent"],"FOnAfterSizeColumn","FOnAfterSizeColumn");
    $r.addProperty("OnGetNodeTrimming",0,$mod.$rtti["TTMSFNCTreeViewGetNodeTrimmingEvent"],"FOnGetNodeTrimming","FOnGetNodeTrimming");
    $r.addProperty("OnGetNodeWordWrapping",0,$mod.$rtti["TTMSFNCTreeViewGetNodeWordWrappingEvent"],"FOnGetNodeWordWrapping","FOnGetNodeWordWrapping");
    $r.addProperty("OnGetNodeHorizontalTextAlign",0,$mod.$rtti["TTMSFNCTreeViewGetNodeHorizontalTextAlignEvent"],"FOnGetNodeHorizontalTextAlign","FOnGetNodeHorizontalTextAlign");
    $r.addProperty("OnGetNodeVerticalTextAlign",0,$mod.$rtti["TTMSFNCTreeViewGetNodeVerticalTextAlignEvent"],"FOnGetNodeVerticalTextAlign","FOnGetNodeVerticalTextAlign");
    $r.addProperty("OnGetColumnTrimming",0,$mod.$rtti["TTMSFNCTreeViewGetColumnTrimmingEvent"],"FOnGetColumnTrimming","FOnGetColumnTrimming");
    $r.addProperty("OnFocusedNodeChanged",0,$mod.$rtti["TTMSFNCTreeViewFocusedNodeChangedEvent"],"FOnFocusedNodeChanged","FOnFocusedNodeChanged");
    $r.addProperty("OnGetColumnWordWrapping",0,$mod.$rtti["TTMSFNCTreeViewGetColumnWordWrappingEvent"],"FOnGetColumnWordWrapping","FOnGetColumnWordWrapping");
    $r.addProperty("OnGetColumnHorizontalTextAlign",0,$mod.$rtti["TTMSFNCTreeViewGetColumnHorizontalTextAlignEvent"],"FOnGetColumnHorizontalTextAlign","FOnGetColumnHorizontalTextAlign");
    $r.addProperty("OnGetColumnVerticalTextAlign",0,$mod.$rtti["TTMSFNCTreeViewGetColumnVerticalTextAlignEvent"],"FOnGetColumnVerticalTextAlign","FOnGetColumnVerticalTextAlign");
    $r.addProperty("OnBeforeUnCheckNode",0,$mod.$rtti["TTMSFNCTreeViewBeforeUnCheckNodeEvent"],"FOnBeforeUnCheckNode","FOnBeforeUnCheckNode");
    $r.addProperty("OnAfterUnCheckNode",0,$mod.$rtti["TTMSFNCTreeViewAfterUnCheckNodeEvent"],"FOnAfterUnCheckNode","FOnAfterUnCheckNode");
    $r.addProperty("OnBeforeCheckNode",0,$mod.$rtti["TTMSFNCTreeViewBeforeCheckNodeEvent"],"FOnBeforeCheckNode","FOnBeforeCheckNode");
    $r.addProperty("OnAfterCheckNode",0,$mod.$rtti["TTMSFNCTreeViewAfterCheckNodeEvent"],"FOnAfterCheckNode","FOnAfterCheckNode");
    $r.addProperty("OnBeforeCollapseNode",0,$mod.$rtti["TTMSFNCTreeViewBeforeCollapseNodeEvent"],"FOnBeforeCollapseNode","FOnBeforeCollapseNode");
    $r.addProperty("OnAfterCollapseNode",0,$mod.$rtti["TTMSFNCTreeViewAfterCollapseNodeEvent"],"FOnAfterCollapseNode","FOnAfterCollapseNode");
    $r.addProperty("OnBeforeExpandNode",0,$mod.$rtti["TTMSFNCTreeViewBeforeExpandNodeEvent"],"FOnBeforeExpandNode","FOnBeforeExpandNode");
    $r.addProperty("OnAfterExpandNode",0,$mod.$rtti["TTMSFNCTreeViewAfterExpandNodeEvent"],"FOnAfterExpandNode","FOnAfterExpandNode");
    $r.addProperty("OnGetNodeIcon",0,$mod.$rtti["TTMSFNCTreeViewGetNodeIconEvent"],"FOnGetNodeIcon","FOnGetNodeIcon");
    $r.addProperty("OnGetNodeIconSize",0,$mod.$rtti["TTMSFNCTreeViewGetNodeIconSizeEvent"],"FOnGetNodeIconSize","FOnGetNodeIconSize");
    $r.addProperty("OnGetNumberOfNodes",0,$mod.$rtti["TTMSFNCTreeViewGetNumberOfNodesEvent"],"FOnGetNumberOfNodes","FOnGetNumberOfNodes");
    $r.addProperty("OnIsNodeExtended",0,$mod.$rtti["TTMSFNCTreeViewIsNodeExtendedEvent"],"FOnIsNodeExtended","FOnIsNodeExtended");
    $r.addProperty("OnIsNodeExpanded",0,$mod.$rtti["TTMSFNCTreeViewIsNodeExpandedEvent"],"FOnIsNodeExpanded","FOnIsNodeExpanded");
    $r.addProperty("OnAfterDrawNodeText",0,$mod.$rtti["TTMSFNCTreeViewAfterDrawNodeTextEvent"],"FOnAfterDrawNodeText","FOnAfterDrawNodeText");
    $r.addProperty("OnIsNodeChecked",0,$mod.$rtti["TTMSFNCTreeViewIsNodeCheckedEvent"],"FOnIsNodeChecked","FOnIsNodeChecked");
    $r.addProperty("OnNodeAnchorClick",0,$mod.$rtti["TTMSFNCTreeViewNodeAnchorClickEvent"],"FOnNodeAnchorClick","FOnNodeAnchorClick");
    $r.addProperty("OnBeforeUpdateNode",0,$mod.$rtti["TTMSFNCTreeViewBeforeUpdateNodeEvent"],"FOnBeforeUpdateNode","FOnBeforeUpdateNode");
    $r.addProperty("OnAfterUpdateNode",0,$mod.$rtti["TTMSFNCTreeViewAfterUpdateNodeEvent"],"FOnAfterUpdateNode","FOnAfterUpdateNode");
    $r.addProperty("OnBeforeSelectNode",0,$mod.$rtti["TTMSFNCTreeViewBeforeSelectNodeEvent"],"FOnBeforeSelectNode","FOnBeforeSelectNode");
    $r.addProperty("OnAfterSelectNode",0,$mod.$rtti["TTMSFNCTreeViewAfterSelectNodeEvent"],"FOnAfterSelectNode","FOnAfterSelectNode");
    $r.addProperty("OnBeforeSelectAllNodes",0,$mod.$rtti["TTMSFNCTreeViewBeforeSelectAllNodesEvent"],"FOnBeforeSelectAllNodes","FOnBeforeSelectAllNodes");
    $r.addProperty("OnAfterSelectAllNodes",0,$mod.$rtti["TTMSFNCTreeViewAfterSelectAllNodesEvent"],"FOnAfterSelectAllNodes","FOnAfterSelectAllNodes");
    $r.addProperty("OnNodeClick",0,$mod.$rtti["TTMSFNCTreeViewNodeClickEvent"],"FOnNodeClick","FOnNodeClick");
    $r.addProperty("OnNodeValueClick",0,$mod.$rtti["TTMSFNCTreeViewNodeValueClickEvent"],"FOnNodeValueClick","FOnNodeValueClick");
    $r.addProperty("OnNodeMouseLeave",0,$mod.$rtti["TTMSFNCTreeViewNodeMouseLeaveEvent"],"FOnNodeMouseLeave","FOnNodeMouseLeave");
    $r.addProperty("OnNodeMouseEnter",0,$mod.$rtti["TTMSFNCTreeViewNodeMouseEnterEvent"],"FOnNodeMouseEnter","FOnNodeMouseEnter");
    $r.addProperty("OnNodeDblClick",0,$mod.$rtti["TTMSFNCTreeViewNodeClickEvent"],"FOnNodeDblClick","FOnNodeDblClick");
    $r.addProperty("OnBeforeUnSelectNode",0,$mod.$rtti["TTMSFNCTreeViewBeforeUnSelectNodeEvent"],"FOnBeforeUnSelectNode","FOnBeforeUnSelectNode");
    $r.addProperty("OnAfterUnSelectNode",0,$mod.$rtti["TTMSFNCTreeViewAfterUnSelectNodeEvent"],"FOnAfterUnSelectNode","FOnAfterUnSelectNode");
    $r.addProperty("OnGetNodeSides",0,$mod.$rtti["TTMSFNCTreeViewGetNodeSidesEvent"],"FOnGetNodeSides","FOnGetNodeSides");
    $r.addProperty("OnBeforeOpenInplaceEditor",0,$mod.$rtti["TTMSFNCTreeViewBeforeOpenInplaceEditorEvent"],"FOnBeforeOpenInplaceEditor","FOnBeforeOpenInplaceEditor");
    $r.addProperty("OnCloseInplaceEditor",0,$mod.$rtti["TTMSFNCTreeViewCloseInplaceEditorEvent"],"FOnCloseInplaceEditor","FOnCloseInplaceEditor");
    $r.addProperty("OnAfterOpenInplaceEditor",0,$mod.$rtti["TTMSFNCTreeViewAfterOpenInplaceEditorEvent"],"FOnAfterOpenInplaceEditor","FOnAfterOpenInplaceEditor");
    $r.addProperty("OnGetInplaceEditor",0,$mod.$rtti["TTMSFNCTreeViewGetInplaceEditorEvent"],"FOnGetInplaceEditor","FOnGetInplaceEditor");
    $r.addProperty("OnCustomizeInplaceEditor",0,$mod.$rtti["TTMSFNCTreeViewCustomizeInplaceEditorEvent"],"FOnCustomizeInplaceEditor","FOnCustomizeInplaceEditor");
    $r.addProperty("OnGetInplaceEditorRect",0,$mod.$rtti["TTMSFNCTreeViewGetInplaceEditorRectEvent"],"FOnGetInplaceEditorRect","FOnGetInplaceEditorRect");
    $r.addProperty("OnNodeChanged",0,$mod.$rtti["TTMSFNCTreeViewNodeChangedEvent"],"FOnNodeChanged","FOnNodeChanged");
    $r.addProperty("OnHScroll",0,$mod.$rtti["TTMSFNCTreeViewScrollEvent"],"FOnHScroll","FOnHScroll");
    $r.addProperty("OnVScroll",0,$mod.$rtti["TTMSFNCTreeViewScrollEvent"],"FOnVScroll","FOnVScroll");
    $r.addProperty("OnBeforeDrawColumnEmptySpace",0,$mod.$rtti["TTMSFNCTreeViewBeforeDrawColumnEmptySpaceEvent"],"FOnBeforeDrawColumnEmptySpace","FOnBeforeDrawColumnEmptySpace");
    $r.addProperty("OnAfterDrawColumnEmptySpace",0,$mod.$rtti["TTMSFNCTreeViewAfterDrawColumnEmptySpaceEvent"],"FOnAfterDrawColumnEmptySpace","FOnAfterDrawColumnEmptySpace");
    $r.addProperty("OnBeforeDrawGroupEmptySpace",0,$mod.$rtti["TTMSFNCTreeViewBeforeDrawGroupEmptySpaceEvent"],"FOnBeforeDrawGroupEmptySpace","FOnBeforeDrawGroupEmptySpace");
    $r.addProperty("OnAfterDrawGroupEmptySpace",0,$mod.$rtti["TTMSFNCTreeViewAfterDrawGroupEmptySpaceEvent"],"FOnAfterDrawGroupEmptySpace","FOnAfterDrawGroupEmptySpace");
    $r.addProperty("OnIsNodeEnabled",0,$mod.$rtti["TTMSFNCTreeViewIsNodeEnabledEvent"],"FOnIsNodeEnabled","FOnIsNodeEnabled");
    $r.addProperty("OnGetNodeColor",0,$mod.$rtti["TTMSFNCTreeViewGetNodeColorEvent"],"FOnGetNodeColor","FOnGetNodeColor");
    $r.addProperty("OnGetNodeSelectedColor",0,$mod.$rtti["TTMSFNCTreeViewGetNodeColorEvent"],"FOnGetNodeSelectedStrokeColor","FOnGetNodeSelectedStrokeColor");
    $r.addProperty("OnGetNodeDisabledColor",0,$mod.$rtti["TTMSFNCTreeViewGetNodeColorEvent"],"FOnGetNodeDisabledColor","FOnGetNodeDisabledColor");
    $r.addProperty("OnGetNodeTextColor",0,$mod.$rtti["TTMSFNCTreeViewGetNodeTextColorEvent"],"FOnGetNodeTextColor","FOnGetNodeTextColor");
    $r.addProperty("OnGetNodeSelectedTextColor",0,$mod.$rtti["TTMSFNCTreeViewGetNodeTextColorEvent"],"FOnGetNodeSelectedTextColor","FOnGetNodeSelectedTextColor");
    $r.addProperty("OnGetNodeDisabledTextColor",0,$mod.$rtti["TTMSFNCTreeViewGetNodeTextColorEvent"],"FOnGetNodeDisabledTextColor","FOnGetNodeDisabledTextColor");
    $r.addProperty("OnGetNodeHeight",0,$mod.$rtti["TTMSFNCTreeViewGetNodeHeightEvent"],"FOnGetNodeHeight","FOnGetNodeHeight");
    $r.addProperty("OnBeforeReorderNode",0,$mod.$rtti["TTMSFNCTreeViewBeforeReorderNodeEvent"],"FOnBeforeReorderNode","FOnBeforeReorderNode");
    $r.addProperty("OnAfterReorderNode",0,$mod.$rtti["TTMSFNCTreeViewAfterReorderNodeEvent"],"FOnAfterReorderNode","FOnAfterReorderNode");
    $r.addProperty("OnBeforeDropNode",0,$mod.$rtti["TTMSFNCTreeViewBeforeDropNodeEvent"],"FOnBeforeDropNode","FOnBeforeDropNode");
    $r.addProperty("OnAfterDropNode",0,$mod.$rtti["TTMSFNCTreeViewAfterDropNodeEvent"],"FOnAfterDropNode","FOnAfterDropNode");
    $r.addProperty("OnBeforeCutToClipboard",0,$mod.$rtti["TTMSFNCTreeViewBeforeCutToClipboardEvent"],"FOnBeforeCutToClipboard","FOnBeforeCutToClipboard");
    $r.addProperty("OnBeforeCopyToClipboard",0,$mod.$rtti["TTMSFNCTreeViewBeforeCopyToClipboardEvent"],"FOnBeforeCopyToClipboard","FOnBeforeCopyToClipboard");
    $r.addProperty("OnBeforePasteFromClipboard",0,$mod.$rtti["TTMSFNCTreeViewBeforePasteFromClipboardEvent"],"FOnBeforePasteFromClipboard","FOnBeforePasteFromClipboard");
    $r.addProperty("OnAfterCutToClipboard",0,$mod.$rtti["TTMSFNCTreeViewAfterCutToClipboardEvent"],"FOnAfterCutToClipboard","FOnAfterCutToClipboard");
    $r.addProperty("OnAfterCopyToClipboard",0,$mod.$rtti["TTMSFNCTreeViewAfterCopyToClipboardEvent"],"FOnAfterCopyToClipboard","FOnAfterCopyToClipboard");
    $r.addProperty("OnAfterPasteFromClipboard",0,$mod.$rtti["TTMSFNCTreeViewAfterPasteFromClipboardEvent"],"FOnAfterPasteFromClipboard","FOnAfterPasteFromClipboard");
    $r.addProperty("OnBeforeDrawSortIndicator",0,$mod.$rtti["TTMSFNCTreeViewBeforeDrawSortIndicatorEvent"],"FOnBeforeDrawSortIndicator","FOnBeforeDrawSortIndicator");
    $r.addProperty("OnAfterDrawSortIndicator",0,$mod.$rtti["TTMSFNCTreeViewAfterDrawSortIndicatorEvent"],"FOnAfterDrawSortIndicator","FOnAfterDrawSortIndicator");
    $r.addProperty("OnColumnAnchorClick",0,$mod.$rtti["TTMSFNCTreeViewColumnAnchorClickEvent"],"FOnColumnAnchorClick","FOnColumnAnchorClick");
    $r.addProperty("OnBeforeAddJSONNode",0,$mod.$rtti["TTMSFNCTreeViewBeforeAddJSONNodeEvent"],"FOnBeforeAddJSONNode","FOnBeforeAddJSONNode");
    $r.addProperty("OnAfterAddJSONNode",0,$mod.$rtti["TTMSFNCTreeViewAfterAddJSONNodeEvent"],"FOnAfterAddJSONNode","FOnAfterAddJSONNode");
    $r.addProperty("DefaultViewJSONOptions",2,$mod.$rtti["TTMSFNCTreeViewViewJSONOptions"],"FDefaultViewJSONOptions","SetDefaultViewJSONOptions");
    $r.addProperty("OnGetHTMLTemplateValue",0,$mod.$rtti["TTMSFNCTreeViewGetHTMLTemplateValueEvent"],"FOnGetHTMLTemplateValue","FOnGetHTMLTemplateValue");
    $r.addProperty("OnGetHTMLTemplate",0,$mod.$rtti["TTMSFNCTreeViewGetHTMLTemplateEvent"],"FOnGetHTMLTemplate","FOnGetHTMLTemplate");
  });
  this.TTMSFNCTREEVIEWEXPAND = "data:image/PNG;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAIAAAAmzuBxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA" + "AJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNvyMY98AAAAySURBVChT" + "Y6iurcaPQCr+4wZYVHj5ekFZYEBdFUAJTISiAg4gEnBAIxVoAKoCH6qtBgAs4hCpNRg4EQAAAABJRU5ErkJggg" + "==";
  this.TTMSFNCTREEVIEWCOLLAPSE = "data:image/PNG;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAIAAAAmzuBxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUA" + "AAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNvyMY98AAAAmSURB" + "VChTY6iurcaPQCr+4wYDoMLL1wsZQQRJNAMroKIKfKi2GgCBNiGJV4wrvQAAAABJRU5ErkJggg==";
  this.TTMSFNCTREEVIEWEXPANDLARGE = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAIAAABL1vtsAAAAAXNSR0IArs4" + "c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50" + "Lm5ldCA0LjAuNvyMY98AAABDSURBVDhPY6iuraYQUc+I/2QBehnh5esFRFAOBhg1AgFoYwREAzEIop42R" + "mACZA2YYNQIBKCXEfgBtY2gBFFsRG01AN+TQqHfgmnlAAAAAElFTkSuQmCC";
  this.TTMSFNCTREEVIEWCOLLAPSELARGE = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAIAAABL1vtsAAAABGdBTUEAALGP" + "C/xhBQAAAAlwSFlzAAAOwgAADsIBFShKgAAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC42/Ixj3w" + "AAADRJREFUOE9jqK6tphBRz4j/ZIFRIxBg+Bvh5euFB0EVgQEtjSAejBqBAMPTCEoQxUbUVgMAPoCGIXvOpikAAAAASUVORK5CYII=";
  $mod.$resourcestrings = {sTMSFNCTreeViewFilterAll: {org: "(All)"}};
  $mod.$implcode = function () {
    rtl.createClass($impl,"TTMSFNCTreeViewGroupOpen",pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewGroup,function () {
    });
    rtl.createClass($impl,"TTMSFNCTreeViewNodeOpen",pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNode,function () {
    });
    rtl.createClass($impl,"TTMSFNCTreeViewColumnOpen",pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewColumn,function () {
    });
    rtl.createClass($impl,"TTMSFNCTreeViewVirtualNodeOpen",pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewVirtualNode,function () {
    });
    $impl.GetTickCountX = function () {
      var Result = 0;
      var h = 0;
      var m = 0;
      var s = 0;
      var ms = 0;
      pas.SysUtils.DecodeTime(pas.SysUtils.Now(),{get: function () {
          return h;
        }, set: function (v) {
          h = v;
        }},{get: function () {
          return m;
        }, set: function (v) {
          m = v;
        }},{get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},{get: function () {
          return ms;
        }, set: function (v) {
          ms = v;
        }});
      Result = ms + (s * 1000) + (m * 60 * 1000) + (h * 60 * 60 * 1000);
      return Result;
    };
    $impl.AnimateDouble = function (Start, Stop, Delta, Margin) {
      var Result = false;
      Result = true;
      if ((Start.get() > (Stop.get() - Margin)) && (Start.get() < (Stop.get() + Margin))) {
        Start.set(Stop.get());
        Result = false;
      } else {
        Delta = Math.max(Margin,Delta);
        if (Start.get() < Stop.get()) {
          Start.set(Start.get() + Delta)}
         else Start.set(Start.get() - Delta);
      };
      return Result;
    };
    $impl.TTMSFNCTreeViewJSONType = {"0": "jtValue", jtValue: 0, "1": "jtArraySize", jtArraySize: 1, "2": "jtObjectSize", jtObjectSize: 2, "3": "jtArrayIndex", jtArrayIndex: 3};
    $mod.$rtti.$Enum("TTMSFNCTreeViewJSONType",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: $impl.TTMSFNCTreeViewJSONType});
  };
  $mod.$init = function () {
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TTMSFNCTREEVIEWEXPAND);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TTMSFNCTREEVIEWEXPANDLARGE);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TTMSFNCTREEVIEWCOLLAPSE);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TTMSFNCTREEVIEWCOLLAPSELARGE);
  };
},["Math","WEBLib.TMSFNCTreeViewBase","WEBLib.TMSFNCUtils","WEBLib.TMSFNCStyles","WEBLib.Forms","WEBLib.Graphics"]);
rtl.module("WEBLib.TMSFNCCustomSelector",["System","Classes","WEBLib.TMSFNCTypes","WEBLib.TMSFNCGraphics","WEBLib.TMSFNCGraphicsTypes","WEBLib.TMSFNCCustomControl","WEBLib.Controls"],function () {
  "use strict";
  var $mod = this;
  this.MAJ_VER = 1;
  this.MIN_VER = 0;
  this.REL_VER = 1;
  this.BLD_VER = 0;
  this.$rtti.$Class("TTMSFNCCustomSelector");
  this.TTMSFNCCustomSelectorItemState = {"0": "isNormal", isNormal: 0, "1": "isHover", isHover: 1, "2": "isDown", isDown: 2, "3": "isSelected", isSelected: 3, "4": "isDisabled", isDisabled: 4};
  this.$rtti.$Enum("TTMSFNCCustomSelectorItemState",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TTMSFNCCustomSelectorItemState});
  rtl.createClass(this,"TTMSFNCCustomSelectorItem",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FOwner = null;
      this.FRowSpan = 0;
      this.FColumnSpan = 0;
      this.FVisible = false;
      this.FText = "";
      this.FEnabled = false;
      this.FSeparator = false;
      this.FSeparatorHeight = 0.0;
      this.FMargins = null;
      this.FCanDeselect = false;
      this.FCanSelect = false;
      this.FVerticalTextAlign = 0;
      this.FHorizontalTextAlign = 0;
      this.FHint = "";
      this.FDataBoolean = false;
      this.FDataString = "";
      this.FDataObject = null;
      this.FDataInteger = 0;
      this.FDataPointer = null;
    };
    this.$final = function () {
      this.FOwner = undefined;
      this.FMargins = undefined;
      this.FDataObject = undefined;
      pas.Classes.TCollectionItem.$final.call(this);
    };
    this.SetColumnSpan = function (Value) {
      if (this.FColumnSpan !== Value) {
        this.FColumnSpan = Value;
        this.FOwner.CalculateItems();
      };
    };
    this.SetRowSpan = function (Value) {
      if (this.FRowSpan !== Value) {
        this.FRowSpan = Value;
        this.FOwner.CalculateItems();
      };
    };
    this.SetVisible = function (Value) {
      if (this.FVisible !== Value) {
        this.FVisible = Value;
        this.FOwner.CalculateItems();
      };
    };
    this.SetText = function (Value) {
      if (this.FText !== Value) {
        this.FText = Value;
        this.FOwner.InvalidateItems();
      };
    };
    this.SetEnabled = function (Value) {
      if (this.FEnabled !== Value) {
        this.FEnabled = Value;
        this.FOwner.InvalidateItems();
      };
    };
    this.SetSeparator = function (Value) {
      if (this.FSeparator !== Value) {
        this.FSeparator = Value;
        this.FOwner.CalculateItems();
      };
    };
    this.SetSeparatorHeight = function (Value) {
      if (this.FSeparatorHeight !== Value) {
        this.FSeparatorHeight = Value;
        this.FOwner.InvalidateItems();
      };
    };
    this.SetMargins = function (Value) {
      this.FMargins.Assign(Value);
    };
    this.SetCanDeselect = function (Value) {
      this.FCanDeselect = Value;
    };
    this.SetCanSelect = function (Value) {
      this.FCanSelect = Value;
    };
    this.SetHorizontalTextAlign = function (Value) {
      if (this.FHorizontalTextAlign !== Value) {
        this.FHorizontalTextAlign = Value;
        this.FOwner.InvalidateItems();
      };
    };
    this.SetVerticalTextAlign = function (Value) {
      if (this.FVerticalTextAlign !== Value) {
        this.FVerticalTextAlign = Value;
        this.FOwner.InvalidateItems();
      };
    };
    this.IsSeparatorHeightStored = function () {
      var Result = false;
      Result = this.FSeparatorHeight !== 5;
      return Result;
    };
    this.MarginsChanged = function (Sender) {
      this.FOwner.CalculateItems();
    };
    this.Create$1 = function (ACollection) {
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      if (this.FCollection != null) this.FOwner = rtl.as(this.FCollection,$mod.TTMSFNCCustomSelectorItems).FOwner$1;
      this.FSeparator = false;
      this.FColumnSpan = 1;
      this.FCanDeselect = true;
      this.FCanSelect = true;
      this.FRowSpan = 1;
      this.FMargins = pas["WEBLib.TMSFNCTypes"].TTMSFNCMargins.$create("Create$1");
      this.FMargins.FOnChange = rtl.createCallback(this,"MarginsChanged");
      this.FEnabled = true;
      this.FSeparatorHeight = 5;
      this.FVisible = true;
      if (this.FOwner != null) this.FOwner.CalculateItems();
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCCustomSelectorItem.isPrototypeOf(Source)) {
        this.FRowSpan = rtl.as(Source,$mod.TTMSFNCCustomSelectorItem).FRowSpan;
        this.FColumnSpan = rtl.as(Source,$mod.TTMSFNCCustomSelectorItem).FColumnSpan;
        this.FVisible = rtl.as(Source,$mod.TTMSFNCCustomSelectorItem).FVisible;
        this.FText = rtl.as(Source,$mod.TTMSFNCCustomSelectorItem).FText;
        this.FEnabled = rtl.as(Source,$mod.TTMSFNCCustomSelectorItem).FEnabled;
        this.FSeparator = rtl.as(Source,$mod.TTMSFNCCustomSelectorItem).FSeparator;
        this.FSeparatorHeight = rtl.as(Source,$mod.TTMSFNCCustomSelectorItem).FSeparatorHeight;
        this.FMargins.Assign(rtl.as(Source,$mod.TTMSFNCCustomSelectorItem).FMargins);
        this.FCanDeselect = rtl.as(Source,$mod.TTMSFNCCustomSelectorItem).FCanDeselect;
        this.FCanSelect = rtl.as(Source,$mod.TTMSFNCCustomSelectorItem).FCanSelect;
        this.FHint = rtl.as(Source,$mod.TTMSFNCCustomSelectorItem).FHint;
      };
    };
    this.State = function () {
      var Result = 0;
      Result = $mod.TTMSFNCCustomSelectorItemState.isNormal;
      if (!this.FSeparator) {
        if (this.FEnabled) {
          if (this.GetIndex() === this.FOwner.FDownItemIndex) {
            Result = $mod.TTMSFNCCustomSelectorItemState.isDown}
           else if (this.GetIndex() === this.FOwner.FHoveredItemIndex) {
            Result = $mod.TTMSFNCCustomSelectorItemState.isHover}
           else if (this.GetIndex() === this.FOwner.FSelectedItemIndex) Result = $mod.TTMSFNCCustomSelectorItemState.isSelected;
        } else Result = $mod.TTMSFNCCustomSelectorItemState.isDisabled;
      };
      return Result;
    };
    this.Destroy = function () {
      rtl.free(this,"FMargins");
      pas.Classes.TCollectionItem.Destroy.call(this);
      if (this.FOwner != null) this.FOwner.CalculateItems();
    };
    var $r = this.$rtti;
    $r.addProperty("CanSelect",2,rtl.boolean,"FCanSelect","SetCanSelect",4,{Default: true});
    $r.addProperty("CanDeselect",2,rtl.boolean,"FCanDeselect","SetCanDeselect",4,{Default: true});
    $r.addProperty("ColumnSpan",2,rtl.longint,"FColumnSpan","SetColumnSpan",4,{Default: 1});
    $r.addProperty("RowSpan",2,rtl.longint,"FRowSpan","SetRowSpan",4,{Default: 1});
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Separator",2,rtl.boolean,"FSeparator","SetSeparator",4,{Default: false});
    $r.addProperty("SeparatorHeight",14,rtl.double,"FSeparatorHeight","SetSeparatorHeight",4,{stored: "IsSeparatorHeightStored"});
    $r.addProperty("Margins",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCMargins"],"FMargins","SetMargins");
    $r.addProperty("Text",2,rtl.string,"FText","SetText");
    $r.addProperty("HorizontalTextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FHorizontalTextAlign","SetHorizontalTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter});
    $r.addProperty("VerticalTextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FVerticalTextAlign","SetVerticalTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter});
    $r.addProperty("Hint",0,rtl.string,"FHint","FHint");
  });
  rtl.createClass(this,"TTMSFNCCustomSelectorItems",pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$init.call(this);
      this.FOwner$1 = null;
    };
    this.$final = function () {
      this.FOwner$1 = undefined;
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$final.call(this);
    };
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      this.SetItem(Index,Value);
    };
    this.CreateItemClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCCustomSelectorItem;
      return Result;
    };
    this.GetOwner = function () {
      var Result = null;
      Result = this.FOwner$1;
      return Result;
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,this.CreateItemClass());
      this.FOwner$1 = AOwner;
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      return Result;
    };
  });
  rtl.createClass(this,"TTMSFNCCustomSelectorAppearance",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FOwner = null;
      this.FStrokeHover = null;
      this.FFillDown = null;
      this.FVerticalSpacing = 0.0;
      this.FStrokeDown = null;
      this.FFillSelected = null;
      this.FHorizontalSpacing = 0.0;
      this.FStrokeSelected = null;
      this.FFill = null;
      this.FFillHover = null;
      this.FStroke = null;
      this.FFillDisabled = null;
      this.FStrokeDisabled = null;
      this.FSeparatorStroke = null;
      this.FFont = null;
    };
    this.$final = function () {
      this.FOwner = undefined;
      this.FStrokeHover = undefined;
      this.FFillDown = undefined;
      this.FStrokeDown = undefined;
      this.FFillSelected = undefined;
      this.FStrokeSelected = undefined;
      this.FFill = undefined;
      this.FFillHover = undefined;
      this.FStroke = undefined;
      this.FFillDisabled = undefined;
      this.FStrokeDisabled = undefined;
      this.FSeparatorStroke = undefined;
      this.FFont = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetFill = function (Value) {
      this.FFill.Assign(Value);
    };
    this.SetFillDown = function (Value) {
      this.FFillDown.Assign(Value);
    };
    this.SetFillHover = function (Value) {
      this.FFillHover.Assign(Value);
    };
    this.SetFillSelected = function (Value) {
      this.FFillSelected.Assign(Value);
    };
    this.SetHorizontalSpacing = function (Value) {
      if (this.FHorizontalSpacing !== Value) {
        this.FHorizontalSpacing = Value;
        this.Changed();
      };
    };
    this.SetStroke = function (Value) {
      this.FStroke.Assign(Value);
    };
    this.SetStrokeDown = function (Value) {
      this.FStrokeDown.Assign(Value);
    };
    this.SetStrokeHover = function (Value) {
      this.FStrokeHover.Assign(Value);
    };
    this.SetStrokeSelected = function (Value) {
      this.FStrokeSelected.Assign(Value);
    };
    this.SetVerticalSpacing = function (Value) {
      if (this.FVerticalSpacing !== Value) {
        this.FVerticalSpacing = Value;
        this.Changed();
      };
    };
    this.SetFillDisabled = function (Value) {
      this.FFillDisabled.Assign(Value);
    };
    this.SetStrokeDisabled = function (Value) {
      this.FStrokeDisabled.Assign(Value);
    };
    this.SetSeparatorStroke = function (Value) {
      this.FSeparatorStroke.Assign(Value);
    };
    this.SetFont = function (Value) {
      this.FFont.AssignSource(Value);
    };
    this.IsHorizontalSpacingStored = function () {
      var Result = false;
      Result = this.FHorizontalSpacing !== 4;
      return Result;
    };
    this.IsVerticalSpacingStored = function () {
      var Result = false;
      Result = this.FVerticalSpacing !== 4;
      return Result;
    };
    this.Changed = function () {
      this.FOwner.CalculateItems();
    };
    this.FontChanged = function (Sender) {
      this.FOwner.InvalidateItems();
    };
    this.FillChanged = function (Sender) {
      this.FOwner.InvalidateItems();
    };
    this.StrokeChanged = function (Sender) {
      this.FOwner.InvalidateItems();
    };
    this.Create$1 = function (AOwner) {
      this.FOwner = AOwner;
      this.FFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16777215,8421504,-1,-1]);
      this.FFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(13882323,50));
      this.FFillHover = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16777215,8421504,-1,-1]);
      this.FFillHover.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(10061943,50));
      this.FFillDown = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16777215,8421504,-1,-1]);
      this.FFillDown.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(9470064,50));
      this.FFillSelected = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16777215,8421504,-1,-1]);
      this.FFillSelected.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(9470064,50));
      this.FFillDisabled = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16777215,8421504,-1,-1]);
      this.FFillDisabled.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(8421504,50));
      this.FStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,12632256,1.0]);
      this.FStroke.SetColor(11119017);
      this.FStrokeHover = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,12632256,1.0]);
      this.FStrokeHover.SetColor(10061943);
      this.FStrokeDown = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,12632256,1.0]);
      this.FStrokeDown.SetColor(9470064);
      this.FStrokeSelected = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,12632256,1.0]);
      this.FStrokeSelected.SetColor(5197615);
      this.FStrokeDisabled = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,12632256,1.0]);
      this.FStrokeDisabled.SetColor(11119017);
      this.FSeparatorStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,12632256,1.0]);
      this.FSeparatorStroke.SetColor(11119017);
      this.FFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FFont.FOnChanged = rtl.createCallback(this,"FontChanged");
      this.FSeparatorStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FFont.FOnChanged = rtl.createCallback(this,"FontChanged");
      this.FFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FFillDown.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FFillHover.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FFillSelected.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FFillDisabled.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FStrokeHover.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FStrokeDown.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FStrokeDisabled.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FStrokeSelected.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FHorizontalSpacing = 4;
      this.FVerticalSpacing = 4;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCCustomSelectorAppearance.isPrototypeOf(Source)) {
        this.FFill.Assign(rtl.as(Source,$mod.TTMSFNCCustomSelectorAppearance).FFill);
        this.FFillHover.Assign(rtl.as(Source,$mod.TTMSFNCCustomSelectorAppearance).FFillHover);
        this.FFillSelected.Assign(rtl.as(Source,$mod.TTMSFNCCustomSelectorAppearance).FFillSelected);
        this.FFillDisabled.Assign(rtl.as(Source,$mod.TTMSFNCCustomSelectorAppearance).FFillDisabled);
        this.FFillDown.Assign(rtl.as(Source,$mod.TTMSFNCCustomSelectorAppearance).FFillDown);
        this.FStroke.Assign(rtl.as(Source,$mod.TTMSFNCCustomSelectorAppearance).FStroke);
        this.FStrokeHover.Assign(rtl.as(Source,$mod.TTMSFNCCustomSelectorAppearance).FStrokeHover);
        this.FStrokeSelected.Assign(rtl.as(Source,$mod.TTMSFNCCustomSelectorAppearance).FStrokeSelected);
        this.FStrokeDown.Assign(rtl.as(Source,$mod.TTMSFNCCustomSelectorAppearance).FStrokeDown);
        this.FStrokeDisabled.Assign(rtl.as(Source,$mod.TTMSFNCCustomSelectorAppearance).FStrokeDisabled);
        this.FVerticalSpacing = rtl.as(Source,$mod.TTMSFNCCustomSelectorAppearance).FVerticalSpacing;
        this.FHorizontalSpacing = rtl.as(Source,$mod.TTMSFNCCustomSelectorAppearance).FHorizontalSpacing;
        this.FSeparatorStroke.Assign(rtl.as(Source,$mod.TTMSFNCCustomSelectorAppearance).FSeparatorStroke);
        this.FFont.AssignSource(rtl.as(Source,$mod.TTMSFNCCustomSelectorAppearance).FFont);
      };
    };
    this.Destroy = function () {
      rtl.free(this,"FFont");
      rtl.free(this,"FFill");
      rtl.free(this,"FFillDown");
      rtl.free(this,"FFillSelected");
      rtl.free(this,"FFillHover");
      rtl.free(this,"FFillDisabled");
      rtl.free(this,"FSeparatorStroke");
      rtl.free(this,"FStroke");
      rtl.free(this,"FStrokeDown");
      rtl.free(this,"FStrokeSelected");
      rtl.free(this,"FStrokeHover");
      rtl.free(this,"FStrokeDisabled");
      pas.System.TObject.Destroy.call(this);
    };
    var $r = this.$rtti;
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
    $r.addProperty("Fill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFill","SetFill");
    $r.addProperty("StrokeHover",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStrokeHover","SetStrokeHover");
    $r.addProperty("FillHover",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFillHover","SetFillHover");
    $r.addProperty("StrokeDown",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStrokeDown","SetStrokeDown");
    $r.addProperty("FillDown",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFillDown","SetFillDown");
    $r.addProperty("StrokeSelected",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStrokeSelected","SetStrokeSelected");
    $r.addProperty("FillSelected",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFillSelected","SetFillSelected");
    $r.addProperty("StrokeDisabled",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStrokeDisabled","SetStrokeDisabled");
    $r.addProperty("FillDisabled",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFillDisabled","SetFillDisabled");
    $r.addProperty("VerticalSpacing",14,rtl.double,"FVerticalSpacing","SetVerticalSpacing",4,{stored: "IsVerticalSpacingStored"});
    $r.addProperty("HorizontalSpacing",14,rtl.double,"FHorizontalSpacing","SetHorizontalSpacing",4,{stored: "IsHorizontalSpacingStored"});
    $r.addProperty("SeparatorStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FSeparatorStroke","SetSeparatorStroke");
    $r.addProperty("Font",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FFont","SetFont");
  });
  rtl.recNewT(this,"TTMSFNCCustomSelectorPositionItem",function () {
    this.TileSet = false;
    this.$eq = function (b) {
      return this.TileSet === b.TileSet;
    };
    this.$assign = function (s) {
      this.TileSet = s.TileSet;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCCustomSelectorPositionItem",{},this);
    $r.addField("TileSet",rtl.boolean);
  });
  rtl.recNewT(this,"TTMSFNCCustomSelectorDisplayItem",function () {
    this.Item = null;
    this.PageIndex = 0;
    this.Column = 0;
    this.Row = 0;
    this.ColumnSpan = 0;
    this.RowSpan = 0;
    this.$new = function () {
      var r = Object.create(this);
      r.Rect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      return r;
    };
    this.$eq = function (b) {
      return this.Rect.$eq(b.Rect) && (this.Item === b.Item) && (this.PageIndex === b.PageIndex) && (this.Column === b.Column) && (this.Row === b.Row) && (this.ColumnSpan === b.ColumnSpan) && (this.RowSpan === b.RowSpan);
    };
    this.$assign = function (s) {
      this.Rect.$assign(s.Rect);
      this.Item = s.Item;
      this.PageIndex = s.PageIndex;
      this.Column = s.Column;
      this.Row = s.Row;
      this.ColumnSpan = s.ColumnSpan;
      this.RowSpan = s.RowSpan;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCCustomSelectorDisplayItem",{},this);
    $r.addField("Rect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]);
    $r.addField("Item",$mod.$rtti["TTMSFNCCustomSelectorItem"]);
    $r.addField("PageIndex",rtl.longint);
    $r.addField("Column",rtl.longint);
    $r.addField("Row",rtl.longint);
    $r.addField("ColumnSpan",rtl.longint);
    $r.addField("RowSpan",rtl.longint);
  });
  this.$rtti.$DynArray("TTMSFNCCustomSelectorItemPosArray$a",{eltype: this.$rtti["TTMSFNCCustomSelectorPositionItem"]});
  this.$rtti.$DynArray("TTMSFNCCustomSelectorItemPosArray",{eltype: this.$rtti["TTMSFNCCustomSelectorItemPosArray$a"]});
  this.$rtti.$MethodVar("TTMSFNCCustomSelectorItemSelected",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AItemIndex",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCustomSelectorItemDeselected",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AItemIndex",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCustomSelectorItemClick",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AItemIndex",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCustomSelectorItemBeforeDrawBackground",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AItemIndex",rtl.longint],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCustomSelectorItemAfterDrawBackground",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AItemIndex",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCustomSelectorItemBeforeDrawContent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AItemIndex",rtl.longint],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCustomSelectorItemAfterDrawContent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AItemIndex",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCustomSelectorItemBeforeDrawText",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AItemIndex",rtl.longint],["AText",rtl.string,1],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCustomSelectorItemAfterDrawText",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AItemIndex",rtl.longint],["AText",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCustomSelectorBeforeDraw",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCustomSelectorAfterDraw",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCCustomSelectorDisplayList",pas.Classes.TList,function () {
    this.GetItem = function (Index) {
      var Result = $mod.TTMSFNCCustomSelectorDisplayItem.$new();
      Result.$assign(rtl.getObject(this.Get(Index)));
      return Result;
    };
    this.SetItem = function (Index, Value) {
      var v = $mod.TTMSFNCCustomSelectorDisplayItem.$new();
      v.$assign(Value);
      this.Put(Index,v);
    };
  });
  rtl.createClass(this,"TTMSFNCCustomSelector",pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$init.call(this);
      this.FDisplayList = null;
      this.FUpdateCount$1 = 0;
      this.FItems = null;
      this.FRows = 0;
      this.FColumns = 0;
      this.FPageCount = 0;
      this.FAppearance = null;
      this.FSelectedItemIndex = 0;
      this.FFocusedItemIndex = 0;
      this.FHoveredItemIndex = 0;
      this.FDownItemIndex = 0;
      this.FOnItemBeforeDrawText = null;
      this.FOnAfterDraw$1 = null;
      this.FOnItemAfterDrawBackground = null;
      this.FOnItemSelected = null;
      this.FOnItemAfterDrawText = null;
      this.FOnBeforeDraw$1 = null;
      this.FOnItemBeforeDrawBackground = null;
      this.FOnItemDeselected = null;
      this.FOnItemClick = null;
      this.FOnItemBeforeDrawContent = null;
      this.FOnItemAfterDrawContent = null;
      this.FBlockChange = false;
      this.FClosedRemotely = false;
    };
    this.$final = function () {
      this.FDisplayList = undefined;
      this.FItems = undefined;
      this.FAppearance = undefined;
      this.FOnItemBeforeDrawText = undefined;
      this.FOnAfterDraw$1 = undefined;
      this.FOnItemAfterDrawBackground = undefined;
      this.FOnItemSelected = undefined;
      this.FOnItemAfterDrawText = undefined;
      this.FOnBeforeDraw$1 = undefined;
      this.FOnItemBeforeDrawBackground = undefined;
      this.FOnItemDeselected = undefined;
      this.FOnItemClick = undefined;
      this.FOnItemBeforeDrawContent = undefined;
      this.FOnItemAfterDrawContent = undefined;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$final.call(this);
    };
    this.SetItems = function (Value) {
      this.FItems.Assign(Value);
    };
    this.SetColumns = function (Value) {
      if (this.FColumns !== Value) {
        this.FColumns = Value;
        this.UpdateCalculations();
        this.CalculateItems();
      };
    };
    this.SetRows = function (Value) {
      if (this.FRows !== Value) {
        this.FRows = Value;
        this.UpdateCalculations();
        this.CalculateItems();
      };
    };
    this.SetAppearance = function (Value) {
      this.FAppearance.Assign(Value);
    };
    this.SetSelectedItemIndex = function (Value) {
      if (this.FSelectedItemIndex !== Value) {
        this.FSelectedItemIndex = Value;
        this.FFocusedItemIndex = Value;
        this.InvalidateItems();
      };
    };
    this.ChangeDPIScale = function (M, D) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ChangeDPIScale.apply(this,arguments);
      this.BeginUpdate();
      this.FAppearance.FVerticalSpacing = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FAppearance.FVerticalSpacing,M,D);
      this.FAppearance.FHorizontalSpacing = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FAppearance.FHorizontalSpacing,M,D);
      this.FAppearance.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FAppearance.FFont.FHeight,M,D));
      this.EndUpdate();
    };
    this.RegisterRuntimeClasses = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClass($mod.TTMSFNCCustomSelector);
    };
    this.GetDocURL = function () {
      var Result = "";
      Result = pas["WEBLib.TMSFNCTypes"].TTMSFNCBaseDocURL + "tmsfncuipack/components/" + pas.SysUtils.LowerCase(this.$classname);
      return Result;
    };
    this.GetHintString = function () {
      var Result = "";
      var it = null;
      Result = pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBase.GetHintString.call(this);
      if ((this.FHoveredItemIndex >= 0) && (this.FHoveredItemIndex <= (this.FItems.GetCount() - 1))) {
        it = this.FItems.GetItem$1(this.FHoveredItemIndex);
        Result = it.FHint;
      };
      return Result;
    };
    this.HasHint = function () {
      var Result = false;
      var it = null;
      Result = false;
      if ((this.FHoveredItemIndex >= 0) && (this.FHoveredItemIndex <= (this.FItems.GetCount() - 1))) {
        it = this.FItems.GetItem$1(this.FHoveredItemIndex);
        Result = it.FHint !== "";
      };
      return Result;
    };
    this.GetVersion = function () {
      var Result = "";
      Result = this.$class.GetVersionNumber(1,0,1,0);
      return Result;
    };
    this.GetDisplayItem = function (AItemIndex) {
      var Result = $mod.TTMSFNCCustomSelectorDisplayItem.$new();
      var I = 0;
      var it = null;
      Result.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,0,0));
      Result.Item = null;
      Result.PageIndex = -1;
      Result.Row = -1;
      Result.Column = -1;
      Result.ColumnSpan = -1;
      Result.RowSpan = -1;
      for (var $l = 0, $end = this.FDisplayList.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        it = this.FDisplayList.GetItem(I).Item;
        if ((it != null) && (it.GetIndex() === AItemIndex)) {
          Result.$assign(this.FDisplayList.GetItem(I));
          break;
        };
      };
      return Result;
    };
    this.GetNextSelectableItem = function () {
      var Result = 0;
      var I = 0;
      var it = null;
      Result = this.FFocusedItemIndex;
      for (var $l = 0, $end = this.FDisplayList.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        it = this.FDisplayList.GetItem(I).Item;
        if ((it != null) && it.FEnabled && !it.FSeparator && (it.GetIndex() > this.FFocusedItemIndex)) {
          Result = it.GetIndex();
          break;
        };
      };
      return Result;
    };
    this.GetPreviousSelectableItem = function () {
      var Result = 0;
      var I = 0;
      var it = null;
      Result = this.FFocusedItemIndex;
      for (var $l = this.FDisplayList.GetCount() - 1; $l >= 0; $l--) {
        I = $l;
        it = this.FDisplayList.GetItem(I).Item;
        if ((it != null) && it.FEnabled && !it.FSeparator && (it.GetIndex() < this.FFocusedItemIndex)) {
          Result = it.GetIndex();
          break;
        };
      };
      return Result;
    };
    this.GetNextSelectableRowItem = function () {
      var Result = 0;
      var I = 0;
      var it = null;
      var disp = $mod.TTMSFNCCustomSelectorDisplayItem.$new();
      Result = this.FFocusedItemIndex;
      if (Result === -1) {
        Result = this.GetNextSelectableItem();
        return Result;
      };
      disp.$assign(this.GetDisplayItem(this.FFocusedItemIndex));
      for (var $l = 0, $end = this.FDisplayList.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        it = this.FDisplayList.GetItem(I).Item;
        if ((it != null) && it.FEnabled && !it.FSeparator && (it.GetIndex() > this.FFocusedItemIndex) && (disp.Column >= this.FDisplayList.GetItem(I).Column) && (disp.Column <= (this.FDisplayList.GetItem(I).Column + (this.FDisplayList.GetItem(I).ColumnSpan - 1))) && (this.FDisplayList.GetItem(I).Row > disp.Row)) {
          Result = it.GetIndex();
          break;
        };
      };
      return Result;
    };
    this.GetPreviousSelectableRowItem = function () {
      var Result = 0;
      var I = 0;
      var it = null;
      var disp = $mod.TTMSFNCCustomSelectorDisplayItem.$new();
      Result = this.FFocusedItemIndex;
      if (Result === -1) {
        Result = this.GetPreviousSelectableItem();
        return Result;
      };
      disp.$assign(this.GetDisplayItem(this.FFocusedItemIndex));
      for (var $l = this.FDisplayList.GetCount() - 1; $l >= 0; $l--) {
        I = $l;
        it = this.FDisplayList.GetItem(I).Item;
        if ((it != null) && it.FEnabled && !it.FSeparator && (it.GetIndex() < this.FFocusedItemIndex) && (disp.Column >= this.FDisplayList.GetItem(I).Column) && (disp.Column <= (this.FDisplayList.GetItem(I).Column + (this.FDisplayList.GetItem(I).ColumnSpan - 1))) && (this.FDisplayList.GetItem(I).Row < disp.Row)) {
          Result = it.GetIndex();
          break;
        };
      };
      return Result;
    };
    this.GetFirstSelectableItem = function () {
      var Result = 0;
      var I = 0;
      var it = null;
      Result = this.FFocusedItemIndex;
      for (var $l = 0, $end = this.FDisplayList.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        it = this.FDisplayList.GetItem(I).Item;
        if ((it != null) && it.FEnabled && !it.FSeparator) {
          Result = it.GetIndex();
          break;
        };
      };
      return Result;
    };
    this.GetLastSelectableItem = function () {
      var Result = 0;
      var I = 0;
      var it = null;
      Result = this.FFocusedItemIndex;
      for (var $l = this.FDisplayList.GetCount() - 1; $l >= 0; $l--) {
        I = $l;
        it = this.FDisplayList.GetItem(I).Item;
        if ((it != null) && it.FEnabled && !it.FSeparator) {
          Result = it.GetIndex();
          break;
        };
      };
      return Result;
    };
    this.CreateItemsCollection = function () {
      var Result = null;
      Result = $mod.TTMSFNCCustomSelectorItems.$create("Create$3",[this]);
      return Result;
    };
    this.CalculateItems = function () {
      var $Self = this;
      var itposarr = [];
      var r = 0;
      var newr = 0;
      var c = 0;
      var newc = 0;
      var AItemIndex = 0;
      var AItem = null;
      var cspan = 0;
      var rspan = 0;
      var newcspan = 0;
      var newrspan = 0;
      var I = 0;
      var K = 0;
      var sepc = 0;
      var f = false;
      var APageIndex = 0;
      var hs = 0.0;
      var vs = 0.0;
      var iw = 0.0;
      var ih = 0.0;
      var w = 0.0;
      var h = 0.0;
      var exw = 0.0;
      var exh = 0.0;
      var tx = 0.0;
      var ty = 0.0;
      var pw = 0.0;
      var ph = 0.0;
      var offs = 0.0;
      var itd = $mod.TTMSFNCCustomSelectorDisplayItem.$new();
      function FindNewPos(AItem, ANewR, ANewC, AFound, ARows, ACurRow, AColumns, ACurCol, PosArr) {
        var i = 0;
        var k = 0;
        var cspan = 0;
        var rspan = 0;
        var J = 0;
        var L = 0;
        AFound.set(false);
        for (var $l = ANewR.get(), $end = ARows - 1; $l <= $end; $l++) {
          i = $l;
          for (var $l1 = ANewC.get(), $end1 = AColumns - 1; $l1 <= $end1; $l1++) {
            k = $l1;
            cspan = AItem.FColumnSpan;
            cspan = Math.min(cspan,$Self.FColumns - ANewC.get());
            rspan = AItem.FRowSpan;
            rspan = Math.min(rspan,$Self.FRows - ANewR.get());
            AFound.set(true);
            for (var $l2 = 0, $end2 = rspan - 1; $l2 <= $end2; $l2++) {
              J = $l2;
              for (var $l3 = 0, $end3 = cspan - 1; $l3 <= $end3; $l3++) {
                L = $l3;
                if (PosArr[i + J][k + L].TileSet) AFound.set(false);
              };
            };
            if (AFound.get()) break;
            ANewC.set(ANewC.get() + 1);
          };
          if (AFound.get()) break;
          ANewC.set(0);
          ANewR.set(ANewR.get() + 1);
        };
      };
      if ((pas.Classes.TComponentStateItem.csDestroying in this.FComponentState) || (this.FUpdateCount$1 > 0)) return;
      this.FDisplayList.Clear();
      if (this.FItems.GetCount() === 0) return;
      pw = this.GetCalculationWidth();
      ph = this.GetCalculationHeight();
      hs = this.FAppearance.FHorizontalSpacing;
      vs = this.FAppearance.FVerticalSpacing;
      w = pw - vs;
      iw = w;
      if (this.FColumns > 0) iw = (w - (this.FColumns * hs)) / this.FColumns;
      h = ph - vs - this.GetTotalSeparatorHeight();
      sepc = this.GetTotalSeparatorCount();
      ih = h;
      if ((this.FRows - sepc) > 0) ih = (h - ((this.FRows - sepc) * vs)) / (this.FRows - sepc);
      AItemIndex = 0;
      APageIndex = 0;
      offs = 0;
      while (AItemIndex <= (this.FItems.GetCount() - 1)) {
        c = 0;
        r = 0;
        itposarr = rtl.arraySetLength(itposarr,$mod.TTMSFNCCustomSelectorPositionItem,0,0);
        itposarr = rtl.arraySetLength(itposarr,$mod.TTMSFNCCustomSelectorPositionItem,this.FRows,this.FColumns);
        while (r < this.FRows) {
          while (c < this.FColumns) {
            if ((AItemIndex >= 0) && (AItemIndex <= (this.FItems.GetCount() - 1)) && (APageIndex === 0)) {
              AItem = this.FItems.GetItem$1(AItemIndex);
              if (!AItem.FVisible) {
                AItemIndex += 1;
                continue;
              };
              if (AItem.FSeparator) {
                cspan = this.FColumns;
                rspan = 1;
              } else {
                cspan = AItem.FColumnSpan;
                rspan = AItem.FRowSpan;
              };
              cspan = Math.min(cspan,this.FColumns - c);
              rspan = Math.min(rspan,this.FRows - r);
              exw = (iw * cspan) + (hs * (cspan - 1));
              if (AItem.FSeparator) {
                exh = AItem.FSeparatorHeight}
               else exh = (ih * rspan) + (vs * (rspan - 1));
              tx = (pw * APageIndex) + hs + (iw * c) + (hs * c);
              ty = offs + vs + (ih * r) + (vs * r) + this.GetTopOffset();
              itd.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(tx + AItem.FMargins.FLeft,ty + AItem.FMargins.FTop,(tx + exw) - AItem.FMargins.FRight,(ty + exh) - AItem.FMargins.FBottom));
              itd.Item = AItem;
              itd.PageIndex = APageIndex;
              itd.Column = c;
              itd.Row = r;
              itd.ColumnSpan = cspan;
              itd.RowSpan = rspan;
              this.FDisplayList.Add($mod.TTMSFNCCustomSelectorDisplayItem.$clone(itd));
              newcspan = c;
              newrspan = r;
              newcspan = (newcspan + cspan) - 1;
              newrspan = (newrspan + rspan) - 1;
              for (var $l = r, $end = newrspan; $l <= $end; $l++) {
                I = $l;
                for (var $l1 = c, $end1 = newcspan; $l1 <= $end1; $l1++) {
                  K = $l1;
                  itposarr[I][K].TileSet = true;
                };
              };
              if (AItem.FSeparator) offs = ((offs + AItem.FSeparatorHeight) - (ih * rspan)) + (vs * (rspan - 1));
            };
            AItemIndex += 1;
            c += 1;
            newc = c;
            newr = r;
            f = false;
            if ((AItemIndex >= 0) && (AItemIndex <= (this.FItems.GetCount() - 1))) FindNewPos(this.FItems.GetItem$1(AItemIndex),{get: function () {
                return newr;
              }, set: function (v) {
                newr = v;
              }},{get: function () {
                return newc;
              }, set: function (v) {
                newc = v;
              }},{get: function () {
                return f;
              }, set: function (v) {
                f = v;
              }},this.FRows,newr,this.FColumns,newc,rtl.arrayRef(itposarr));
            c = newc;
            r = newr;
            if ((c >= this.FColumns) || (r >= this.FRows)) break;
          };
          c = 0;
          r += 1;
          newc = c;
          newr = r;
          f = false;
          if ((AItemIndex >= 0) && (AItemIndex <= (this.FItems.GetCount() - 1))) FindNewPos(this.FItems.GetItem$1(AItemIndex),{get: function () {
              return newr;
            }, set: function (v) {
              newr = v;
            }},{get: function () {
              return newc;
            }, set: function (v) {
              newc = v;
            }},{get: function () {
              return f;
            }, set: function (v) {
              f = v;
            }},this.FRows,newr,this.FColumns,newc,rtl.arrayRef(itposarr));
          c = newc;
          r = newr;
          if (r >= this.FRows) break;
        };
        APageIndex += 1;
      };
      this.FPageCount = APageIndex;
      this.InvalidateItems();
    };
    this.UpdateCalculations = function () {
    };
    this.ApplyStyle = function () {
      var c = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ApplyStyle.call(this);
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleBackgroundFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) this.FFill.SetColor(c);
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleBackgroundStrokeColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) this.FStroke.SetColor(c);
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleDefaultButtonFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) this.FAppearance.FFill.SetColor(c);
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleSelectionFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FAppearance.FFillSelected.SetColor(c);
        this.FAppearance.FFillDown.SetColor(c);
        this.FAppearance.FFillHover.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Blend(c,this.FAppearance.FFill.FColor,25));
      };
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleDefaultButtonStrokeColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FAppearance.FStroke.SetColor(c);
        this.FAppearance.FStrokeSelected.SetColor(c);
        this.FAppearance.FStrokeDown.SetColor(c);
        this.FAppearance.FStrokeHover.SetColor(c);
      };
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleTextFontColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) this.FAppearance.FFont.SetColor(c);
    };
    this.ResetToDefaultStyle = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ResetToDefaultStyle.call(this);
      this.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FFill.SetColor(16777215);
      this.FStroke.SetColor(12632256);
      this.FAppearance.FFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(13882323,50));
      this.FAppearance.FFillHover.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(10061943,50));
      this.FAppearance.FFillDown.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(9470064,50));
      this.FAppearance.FFillSelected.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(9470064,50));
      this.FAppearance.FFillDisabled.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(8421504,50));
      this.FAppearance.FStroke.SetColor(11119017);
      this.FAppearance.FStrokeHover.SetColor(10061943);
      this.FAppearance.FStrokeDown.SetColor(9470064);
      this.FAppearance.FStrokeSelected.SetColor(5197615);
      this.FAppearance.FStrokeDisabled.SetColor(11119017);
      this.FAppearance.FFont.SetColor(0);
      this.FAppearance.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FAppearance.FFillHover.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FAppearance.FFillDown.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FAppearance.FFillSelected.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FAppearance.FFillDisabled.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FAppearance.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FAppearance.FStrokeHover.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FAppearance.FStrokeDown.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FAppearance.FStrokeSelected.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FAppearance.FStrokeDisabled.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FAppearance.FSeparatorStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
    };
    this.GetTopOffset = function () {
      var Result = 0.0;
      Result = 0;
      return Result;
    };
    this.GetCalculationWidth = function () {
      var Result = 0.0;
      Result = this.GetWidth();
      return Result;
    };
    this.GetCalculationHeight = function () {
      var Result = 0.0;
      Result = this.GetHeight() - this.GetTopOffset();
      return Result;
    };
    this.GetTotalSeparatorHeight = function () {
      var Result = 0.0;
      var I = 0;
      Result = 0;
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (this.FItems.GetItem$1(I).FSeparator) Result = Result + this.FItems.GetItem$1(I).FSeparatorHeight + this.FAppearance.FVerticalSpacing;
      };
      return Result;
    };
    this.GetTotalSeparatorCount = function () {
      var Result = 0;
      var I = 0;
      Result = 0;
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (this.FItems.GetItem$1(I).FSeparator) Result += 1;
      };
      return Result;
    };
    this.DoItemSelected = function (AItemIndex) {
      if (this.FOnItemSelected != null) this.FOnItemSelected(this,AItemIndex);
    };
    this.DoItemClick = function (AItemIndex) {
      if (this.FOnItemClick != null) this.FOnItemClick(this,AItemIndex);
    };
    this.DoItemDeselected = function (AItemIndex) {
      if (this.FOnItemDeselected != null) this.FOnItemDeselected(this,AItemIndex);
    };
    this.DoItemBeforeDrawBackground = function (AGraphics, ARect, AItemIndex, ADefaultDraw) {
      if (this.FOnItemBeforeDrawBackground != null) this.FOnItemBeforeDrawBackground(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AItemIndex,ADefaultDraw);
    };
    this.DoItemAfterDrawBackground = function (AGraphics, ARect, AItemIndex) {
      if (this.FOnItemAfterDrawBackground != null) this.FOnItemAfterDrawBackground(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AItemIndex);
    };
    this.DoItemBeforeDrawContent = function (AGraphics, ARect, AItemIndex, ADefaultDraw) {
      if (this.FOnItemBeforeDrawContent != null) this.FOnItemBeforeDrawContent(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AItemIndex,ADefaultDraw);
    };
    this.DoItemAfterDrawContent = function (AGraphics, ARect, AItemIndex) {
      if (this.FOnItemAfterDrawContent != null) this.FOnItemAfterDrawContent(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AItemIndex);
    };
    this.DoItemBeforeDrawText = function (AGraphics, ARect, AItemIndex, AText, ADefaultDraw) {
      if (this.FOnItemBeforeDrawText != null) this.FOnItemBeforeDrawText(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AItemIndex,AText,ADefaultDraw);
    };
    this.DoItemAfterDrawText = function (AGraphics, ARect, AItemIndex, AText) {
      if (this.FOnItemAfterDrawText != null) this.FOnItemAfterDrawText(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AItemIndex,AText);
    };
    this.DoBeforeDraw$1 = function (AGraphics, ARect, ADefaultDraw) {
      if (this.FOnBeforeDraw$1 != null) this.FOnBeforeDraw$1(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),ADefaultDraw);
    };
    this.DoAfterDraw$1 = function (AGraphics, ARect) {
      if (this.FOnAfterDraw$1 != null) this.FOnAfterDraw$1(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect));
    };
    this.DrawItems = function (AGraphics) {
      var I = 0;
      for (var $l = 0, $end = this.FDisplayList.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.DrawItem(AGraphics,$mod.TTMSFNCCustomSelectorDisplayItem.$clone(this.FDisplayList.GetItem(I)));
      };
    };
    this.Draw = function (AGraphics, ARect) {
      var a = false;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Draw.apply(this,arguments);
      a = true;
      this.DoBeforeDraw$1(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),{get: function () {
          return a;
        }, set: function (v) {
          a = v;
        }});
      if (a) {
        this.DrawItems(AGraphics);
        this.DoAfterDraw$1(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect));
      };
    };
    this.DrawItem = function (AGraphics, ADisplayItem) {
      this.DrawItemBackGround(AGraphics,$mod.TTMSFNCCustomSelectorDisplayItem.$clone(ADisplayItem));
      this.DrawItemContent(AGraphics,$mod.TTMSFNCCustomSelectorDisplayItem.$clone(ADisplayItem));
      this.DrawItemText(AGraphics,$mod.TTMSFNCCustomSelectorDisplayItem.$clone(ADisplayItem));
    };
    this.DrawItemBackGround = function (AGraphics, ADisplayItem) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var it = null;
      var a = false;
      var fr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      it = ADisplayItem.Item;
      if (it != null) {
        if (!it.FSeparator) {
          AGraphics.FFill.Assign(this.FAppearance.FFill);
          AGraphics.FStroke.Assign(this.FAppearance.FStroke);
          if (it.FEnabled) {
            if (it.GetIndex() === this.FDownItemIndex) {
              AGraphics.FFill.Assign(this.FAppearance.FFillDown);
              AGraphics.FStroke.Assign(this.FAppearance.FStrokeDown);
            } else if (it.GetIndex() === this.FHoveredItemIndex) {
              AGraphics.FFill.Assign(this.FAppearance.FFillHover);
              AGraphics.FStroke.Assign(this.FAppearance.FStrokeHover);
            } else if (it.GetIndex() === this.FSelectedItemIndex) {
              AGraphics.FFill.Assign(this.FAppearance.FFillSelected);
              AGraphics.FStroke.Assign(this.FAppearance.FStrokeSelected);
            };
          } else {
            AGraphics.FFill.Assign(this.FAppearance.FFillDisabled);
            AGraphics.FStroke.Assign(this.FAppearance.FStrokeDisabled);
          };
        } else AGraphics.FStroke.Assign(this.FAppearance.FSeparatorStroke);
        r.$assign(ADisplayItem.Rect);
        a = true;
        this.DoItemBeforeDrawBackground(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ADisplayItem.Rect),it.GetIndex(),{get: function () {
            return a;
          }, set: function (v) {
            a = v;
          }});
        if (a) {
          if (it.FSeparator) {
            AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,pas["WEBLib.TMSFNCTypes"].CenterPointEx(r).Y)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,pas["WEBLib.TMSFNCTypes"].CenterPointEx(r).Y)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown)}
           else {
            AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
            if (this.IsFocused() && (this.FFocusedItemIndex === it.GetIndex())) {
              fr.$assign(r);
              pas["WEBLib.TMSFNCTypes"].InflateRectEx(fr,this.ScalePaintValue(-2),this.ScalePaintValue(-2));
              AGraphics.DrawFocusRectangle$3(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(fr),0,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
            };
          };
          this.DoItemAfterDrawBackground(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ADisplayItem.Rect),it.GetIndex());
        };
      };
    };
    this.DrawItemContent = function (AGraphics, ADisplayItem) {
      var it = null;
      var a = false;
      it = ADisplayItem.Item;
      if (it != null) {
        a = true;
        this.DoItemBeforeDrawContent(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ADisplayItem.Rect),it.GetIndex(),{get: function () {
            return a;
          }, set: function (v) {
            a = v;
          }});
        if (a) this.DoItemAfterDrawContent(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ADisplayItem.Rect),it.GetIndex());
      };
    };
    this.DrawItemText = function (AGraphics, ADisplayItem) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var it = null;
      var str = "";
      var a = false;
      it = ADisplayItem.Item;
      if ((it != null) && (it.FText !== "")) {
        r.$assign(ADisplayItem.Rect);
        str = it.FText;
        a = true;
        pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,-2,-2);
        AGraphics.FFont.AssignSource(this.FAppearance.FFont);
        this.DoItemBeforeDrawText(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ADisplayItem.Rect),it.GetIndex(),{get: function () {
            return str;
          }, set: function (v) {
            str = v;
          }},{get: function () {
            return a;
          }, set: function (v) {
            a = v;
          }});
        if (a) {
          AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),str,false,it.FHorizontalTextAlign,it.FVerticalTextAlign,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,true,false,-1,-1);
          this.DoItemAfterDrawText(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ADisplayItem.Rect),it.GetIndex(),str);
        };
      };
    };
    this.HandleMouseDown = function (Button, Shift, X, Y) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseDown.apply(this,arguments);
      this.CaptureEx();
      this.FDownItemIndex = this.XYToItem(X,Y);
      this.InvalidateItems();
    };
    this.HandleMouseUp = function (Button, Shift, X, Y) {
      var s = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseUp.apply(this,arguments);
      this.ReleaseCaptureEx();
      s = this.XYToItem(X,Y);
      if ((s === this.FDownItemIndex) && (this.FDownItemIndex !== -1)) {
        this.ProcessSelection(s);
        if (s !== -1) this.DoItemClick(s);
      };
      this.FDownItemIndex = -1;
      this.FHoveredItemIndex = -1;
      this.InvalidateItems();
    };
    this.HandleMouseMove = function (Shift, X, Y) {
      var h = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseMove.apply(this,arguments);
      if (this.FDownItemIndex > -1) return;
      h = this.XYToItem(X,Y);
      if (h !== this.FHoveredItemIndex) {
        this.FHoveredItemIndex = h;
        this.CancelHint();
        this.InvalidateItems();
      };
    };
    this.HandleKeyDown = function (Key, Shift) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleKeyDown.apply(this,arguments);
      var $tmp = Key.get();
      if ($tmp === 38) {
        this.FFocusedItemIndex = this.GetPreviousSelectableRowItem();
        this.InvalidateItems();
      } else if ($tmp === 37) {
        this.FFocusedItemIndex = this.GetPreviousSelectableItem();
        this.InvalidateItems();
      } else if ($tmp === 40) {
        this.FFocusedItemIndex = this.GetNextSelectableRowItem();
        this.InvalidateItems();
      } else if ($tmp === 39) {
        this.FFocusedItemIndex = this.GetNextSelectableItem();
        this.InvalidateItems();
      } else if ($tmp === 36) {
        this.FFocusedItemIndex = this.GetFirstSelectableItem();
        this.InvalidateItems();
      } else if ($tmp === 35) {
        this.FFocusedItemIndex = this.GetLastSelectableItem();
        this.InvalidateItems();
      };
      if (Key.get() === 13) {
        this.FDownItemIndex = this.FFocusedItemIndex;
        this.InvalidateItems();
      };
    };
    this.HandleKeyUp = function (Key, Shift) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleKeyUp.apply(this,arguments);
      if (Key.get() === 13) {
        this.FDownItemIndex = -1;
        this.ProcessSelection(this.FFocusedItemIndex);
        this.InvalidateItems();
      };
    };
    this.HandleMouseLeave = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseLeave.call(this);
      this.FHoveredItemIndex = -1;
      this.InvalidateItems();
    };
    this.ProcessSelection = function (AItemIndex) {
      var it = null;
      var prev = 0;
      if ((AItemIndex >= 0) && (AItemIndex <= (this.FItems.GetCount() - 1))) {
        it = this.FItems.GetItem$1(AItemIndex);
        if (it.FCanSelect) {
          prev = this.FSelectedItemIndex;
          if (it.FCanDeselect && (it.GetIndex() === this.FSelectedItemIndex)) {
            this.FSelectedItemIndex = -1}
           else this.FSelectedItemIndex = it.GetIndex();
          if (this.FSelectedItemIndex !== -1) this.FFocusedItemIndex = this.FSelectedItemIndex;
          if (it.FCanDeselect && (prev !== -1)) this.DoItemDeselected(prev);
          if (this.FSelectedItemIndex !== -1) this.DoItemSelected(this.FSelectedItemIndex);
        };
      };
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Create$1.apply(this,arguments);
      this.FColumns = 4;
      this.FRows = 4;
      this.FItems = this.CreateItemsCollection();
      this.FDisplayList = $mod.TTMSFNCCustomSelectorDisplayList.$create("Create$1");
      this.FAppearance = $mod.TTMSFNCCustomSelectorAppearance.$create("Create$1",[this]);
      this.FSelectedItemIndex = -1;
      this.FFocusedItemIndex = -1;
      this.FHoveredItemIndex = -1;
      this.FDownItemIndex = -1;
      if (this.IsDesignTime()) this.InitializeDefault();
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FAppearance");
      rtl.free(this,"FDisplayList");
      rtl.free(this,"FItems");
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Destroy.call(this);
    };
    this.Assign = function (Source) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Assign.apply(this,arguments);
      if ($mod.TTMSFNCCustomSelector.isPrototypeOf(Source)) {
        this.FItems.Assign(rtl.as(Source,$mod.TTMSFNCCustomSelector).FItems);
        this.FAppearance.Assign(rtl.as(Source,$mod.TTMSFNCCustomSelector).FAppearance);
        this.FRows = rtl.as(Source,$mod.TTMSFNCCustomSelector).FRows;
        this.FColumns = rtl.as(Source,$mod.TTMSFNCCustomSelector).FColumns;
      };
    };
    this.BeginUpdate = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBase.BeginUpdate.call(this);
      this.FUpdateCount$1 += 1;
    };
    this.EndUpdate = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBase.EndUpdate.call(this);
      this.FUpdateCount$1 -= 1;
      if (this.FUpdateCount$1 === 0) this.CalculateItems();
    };
    this.InvalidateItems = function () {
      this.Invalidate();
    };
    this.UpdateControlAfterResize = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.UpdateControlAfterResize.call(this);
      this.CalculateItems();
    };
    this.InitializeDefault = function () {
    };
    this.XYToItem = function (X, Y) {
      var Result = 0;
      var I = 0;
      var it = null;
      Result = -1;
      for (var $l = 0, $end = this.FDisplayList.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.FDisplayList.GetItem(I).Rect,pas["WEBLib.TMSFNCTypes"].PointF(X,Y))) {
          it = this.FDisplayList.GetItem(I).Item;
          if ((it != null) && it.FEnabled && !it.FSeparator) {
            Result = it.GetIndex();
            break;
          };
        };
      };
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCDefaultSelector",this.TTMSFNCCustomSelector,function () {
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Fill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFill","SetFill");
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
    $r.addProperty("Version",1,rtl.string,"GetVersion","");
  });
  $mod.$init = function () {
    pas.Classes.RegisterClass($mod.TTMSFNCCustomSelector);
  };
},["Math","SysUtils","WEBLib.TMSFNCUtils","WEBLib.TMSFNCStyles"]);
rtl.module("WEBLib.TMSFNCCustomPicker",["System","Classes","WEBLib.TMSFNCCustomSelector","WEBLib.TMSFNCPersistence","WEBLib.TMSFNCGraphics","WEBLib.TMSFNCGraphicsTypes","WEBLib.TMSFNCCustomControl","WEBLib.TMSFNCPopup","WEBLib.TMSFNCTypes","WEBLib.Controls","WEBLib.StdCtrls","WEBLib.ExtCtrls"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.$rtti.$MethodVar("TTMSFNCCustomPickerBeforeDraw",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCustomPickerAfterDraw",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCCustomPicker",pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$init.call(this);
      this.FExitTimerClose = false;
      this.FDefaultStyle = false;
      this.FKeyDown = 0;
      this.FContent = "";
      this.FEdit = null;
      this.FTimer = null;
      this.FExitTimer = null;
      this.FControlExitTimer = null;
      this.FDown = false;
      this.FPopup = null;
      this.FSelector = null;
      this.FOnItemBeforeDrawText = null;
      this.FOnAfterDraw$1 = null;
      this.FOnItemAfterDrawBackground = null;
      this.FOnItemSelected = null;
      this.FOnItemAfterDrawText = null;
      this.FOnBeforeDraw$1 = null;
      this.FOnItemBeforeDrawBackground = null;
      this.FDropDownHeight = 0.0;
      this.FDropDownWidth = 0.0;
      this.FOnItemDeselected = null;
      this.FOnItemClick = null;
      this.FOnItemBeforeDrawContent = null;
      this.FOnItemAfterDrawContent = null;
      this.FOnPickerBeforeDraw = null;
      this.FOnPickerAfterDraw = null;
      this.FShowFocus$1 = false;
      this.FOnClosePopup = null;
      this.FOnPopup = null;
      this.FOnEditChange = null;
      this.FOldEnter = null;
      this.FOldExit = null;
      this.FEditable = false;
      this.FUpdateCount$1 = 0;
      this.FFont$1 = null;
      this.FPreventDropDown = false;
    };
    this.$final = function () {
      this.FEdit = undefined;
      this.FTimer = undefined;
      this.FExitTimer = undefined;
      this.FControlExitTimer = undefined;
      this.FPopup = undefined;
      this.FSelector = undefined;
      this.FOnItemBeforeDrawText = undefined;
      this.FOnAfterDraw$1 = undefined;
      this.FOnItemAfterDrawBackground = undefined;
      this.FOnItemSelected = undefined;
      this.FOnItemAfterDrawText = undefined;
      this.FOnBeforeDraw$1 = undefined;
      this.FOnItemBeforeDrawBackground = undefined;
      this.FOnItemDeselected = undefined;
      this.FOnItemClick = undefined;
      this.FOnItemBeforeDrawContent = undefined;
      this.FOnItemAfterDrawContent = undefined;
      this.FOnPickerBeforeDraw = undefined;
      this.FOnPickerAfterDraw = undefined;
      this.FOnClosePopup = undefined;
      this.FOnPopup = undefined;
      this.FOnEditChange = undefined;
      this.FOldEnter = undefined;
      this.FOldExit = undefined;
      this.FFont$1 = undefined;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$final.call(this);
    };
    this.CalcSize = function () {
    };
    this.GetAppearance = function () {
      var Result = null;
      Result = this.FSelector.FAppearance;
      return Result;
    };
    this.GetColumns = function () {
      var Result = 0;
      Result = this.FSelector.FColumns;
      return Result;
    };
    this.GetItems = function () {
      var Result = null;
      Result = this.FSelector.FItems;
      return Result;
    };
    this.GetRows = function () {
      var Result = 0;
      Result = this.FSelector.FRows;
      return Result;
    };
    this.GetSelectedItemIndex = function () {
      var Result = 0;
      Result = this.FSelector.FSelectedItemIndex;
      return Result;
    };
    this.SetAppearance = function (Value) {
      this.FSelector.FAppearance.Assign(Value);
    };
    this.SetColumns = function (Value) {
      this.FSelector.SetColumns(Value);
    };
    this.SetItems = function (Value) {
      this.FSelector.FItems.Assign(Value);
    };
    this.SetRows = function (Value) {
      this.FSelector.SetRows(Value);
    };
    this.SetSelectedItemIndex = function (Value) {
      this.FSelector.SetSelectedItemIndex(Value);
    };
    this.GetFill = function () {
      var Result = null;
      Result = this.FSelector.FFill;
      return Result;
    };
    this.GetStroke = function () {
      var Result = null;
      Result = this.FSelector.FStroke;
      return Result;
    };
    this.SetFill$1 = function (Value) {
      this.FSelector.FFill.Assign(Value);
    };
    this.SetStroke$1 = function (Value) {
      this.FSelector.FStroke.Assign(Value);
    };
    this.SetDropDownHeight = function (Value) {
      this.FDropDownHeight = Value;
      if (this.FPopup != null) this.FPopup.SetDropDownHeight(this.FDropDownHeight);
    };
    this.SetDropDownWidth = function (Value) {
      this.FDropDownWidth = Value;
      if (this.FPopup != null) this.FPopup.SetDropDownWidth(this.FDropDownWidth);
    };
    this.IsDropDownHeightStored = function () {
      var Result = false;
      Result = this.FDropDownHeight !== 135;
      return Result;
    };
    this.IsDropDownWidthStored = function () {
      var Result = false;
      Result = this.FDropDownWidth !== 135;
      return Result;
    };
    this.GetPopup = function () {
      var Result = null;
      Result = this.FPopup;
      return Result;
    };
    this.GetSelector = function () {
      var Result = null;
      Result = this.FSelector;
      return Result;
    };
    this.SetShowFocus$1 = function (Value) {
      if (this.FShowFocus$1 !== Value) {
        this.FShowFocus$1 = Value;
        this.Invalidate();
      };
    };
    this.SetContent = function (Value) {
      this.FContent = Value;
      this.UpdateEditText(Value);
    };
    this.SetDefaultStyle = function (Value) {
      if (this.FDefaultStyle !== Value) {
        this.FDefaultStyle = Value;
        this.Invalidate();
      };
    };
    this.SetFnt = function (Value) {
      this.FFont$1.Assign(Value);
    };
    this.DisableEnterEvent = function () {
      if (this.FOnEnter != null) this.FOldEnter = this.FOnEnter;
      this.FOnEnter = null;
    };
    this.DisableExitEvent = function () {
      if (this.FOnExit != null) this.FOldExit = this.FOnExit;
      this.FOnExit = null;
    };
    this.EnableExitEvent = function () {
      this.FOnExit = this.FOldExit;
    };
    this.EnableEnterEvent = function () {
      this.FOnEnter = this.FOldEnter;
    };
    this.ChangeDPIScale = function (M, D) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ChangeDPIScale.apply(this,arguments);
      this.BeginUpdate();
      this.FFont$1.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FFont$1.FHeight,M,D));
      this.FEdit.FMargins.SetRight(this.ScalePaintValue(17));
      this.SetDropDownHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FDropDownHeight,M,D));
      this.SetDropDownWidth(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FDropDownWidth,M,D));
      this.EndUpdate();
    };
    this.GetVersion = function () {
      var Result = "";
      Result = this.$class.GetVersionNumber(1,0,0,9);
      return Result;
    };
    this.GetContent = function () {
      var Result = "";
      if ((this.FEdit != null) && (this.FEdit.FParent != null) && this.FEditable) {
        Result = this.FEdit.GetText()}
       else Result = this.FContent;
      return Result;
    };
    this.GetDocURL = function () {
      var Result = "";
      Result = pas["WEBLib.TMSFNCTypes"].TTMSFNCBaseDocURL + "tmsfncuipack/components/" + pas.SysUtils.LowerCase(this.$classname);
      return Result;
    };
    this.SetEditable = function (Value) {
      if (this.FEditable !== Value) {
        this.FEditable = Value;
        if (this.FEdit != null) {
          if (this.FEditable) {
            this.FEdit.SetParent(this);
          } else this.FEdit.SetParent(null);
          this.FEdit.SetVisible(this.FEditable);
          this.UpdateEditText(this.GetContent());
          this.FPopup.FStaysOpen = this.FEditable;
        };
        this.Invalidate();
      };
    };
    this.ApplyStyle = function () {
      var c = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ApplyStyle.call(this);
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleBackgroundFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) this.GetFill().SetColor(c);
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleLineFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) this.GetStroke().SetColor(c);
      this.Invalidate();
    };
    this.SetAdaptToStyle = function (Value) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.SetAdaptToStyle.apply(this,arguments);
      if (this.FPopup != null) this.FPopup.SetAdaptToStyle(this.GetAdaptToStyle());
    };
    this.DoExit = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.DoExit.call(this);
      this.FControlExitTimer.SetEnabled(true);
      this.Invalidate();
    };
    this.DoEnter = function () {
      pas["WEBLib.Controls"].TControl.DoEnter.call(this);
      this.DisableEnterEvent();
      this.FTimer.SetEnabled(true);
      this.Invalidate();
    };
    this.DoEditExit = function (Sender) {
      this.FExitTimer.SetEnabled(true);
    };
    this.DoEditEnter = function (Sender) {
      if (!this.FPopup.FIsOpen) this.DoEnter();
    };
    this.UpdateEditText = function (AText) {
      if ((this.FEdit != null) && (this.FEdit.FParent != null) && this.FEditable) this.FEdit.SetText(AText);
    };
    this.DoItemSelected = function (Sender, AItemIndex) {
      this.UpdateEditText("");
      if (this.FOnItemSelected != null) this.FOnItemSelected(this,AItemIndex);
    };
    this.DoItemDeselected = function (Sender, AItemIndex) {
      if (this.FOnItemDeselected != null) this.FOnItemDeselected(this,AItemIndex);
    };
    this.DoItemClick = function (Sender, AItemIndex) {
      if (this.FOnItemClick != null) this.FOnItemClick(this,AItemIndex);
    };
    this.DoItemBeforeDrawBackground = function (Sender, AGraphics, ARect, AItemIndex, AAllowDraw) {
      if (this.FOnItemBeforeDrawBackground != null) this.FOnItemBeforeDrawBackground(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AItemIndex,AAllowDraw);
    };
    this.DoItemAfterDrawBackground = function (Sender, AGraphics, ARect, AItemIndex) {
      if (this.FOnItemAfterDrawBackground != null) this.FOnItemAfterDrawBackground(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AItemIndex);
    };
    this.DoItemBeforeDrawContent = function (Sender, AGraphics, ARect, AItemIndex, AAllowDraw) {
      if (this.FOnItemBeforeDrawContent != null) this.FOnItemBeforeDrawContent(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AItemIndex,AAllowDraw);
    };
    this.DoItemAfterDrawContent = function (Sender, AGraphics, ARect, AItemIndex) {
      if (this.FOnItemAfterDrawContent != null) this.FOnItemAfterDrawContent(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AItemIndex);
    };
    this.DoItemBeforeDrawText = function (Sender, AGraphics, ARect, AItemIndex, AText, AAllowDraw) {
      if (this.FOnItemBeforeDrawText != null) this.FOnItemBeforeDrawText(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AItemIndex,AText,AAllowDraw);
    };
    this.DoItemAfterDrawText = function (Sender, AGraphics, ARect, AItemIndex, AText) {
      if (this.FOnItemAfterDrawText != null) this.FOnItemAfterDrawText(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AItemIndex,AText);
    };
    this.DoBeforeDraw$1 = function (Sender, AGraphics, ARect, AAllowDraw) {
      if (this.FOnBeforeDraw$1 != null) this.FOnBeforeDraw$1(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AAllowDraw);
    };
    this.DoAfterDraw$1 = function (Sender, AGraphics, ARect) {
      if (this.FOnAfterDraw$1 != null) this.FOnAfterDraw$1(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect));
    };
    this.DoPickerBeforeDraw = function (AGraphics, ARect, ADefaultDraw) {
      if (this.FOnPickerBeforeDraw != null) this.FOnPickerBeforeDraw(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),ADefaultDraw);
    };
    this.DoPickerAfterDraw = function (AGraphics, ARect) {
      if (this.FOnPickerAfterDraw != null) this.FOnPickerAfterDraw(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect));
    };
    this.Draw = function (AGraphics, ARect) {
      var a = false;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rf = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Draw.apply(this,arguments);
      a = true;
      this.DoPickerBeforeDraw(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),{get: function () {
          return a;
        }, set: function (v) {
          a = v;
        }});
      if (a) {
        this.DrawBackground(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect));
        r.$assign(ARect);
        r.Right = r.Right - this.ScalePaintValue(15);
        this.DrawContent(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r));
        if (this.FShowFocus$1 && this.IsFocused()) {
          rf.$assign(ARect);
          pas["WEBLib.TMSFNCTypes"].InflateRectEx(rf,-1,-1);
          AGraphics.DrawFocusRectangle$3(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rf),0,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        };
        this.DoPickerAfterDraw(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect));
      };
    };
    this.SelectFirstValue = function () {
    };
    this.SelectLastValue = function () {
    };
    this.SelectNextValue = function () {
    };
    this.SelectPreviousValue = function () {
    };
    this.EditUp = function () {
    };
    this.EditDown = function () {
    };
    this.DoPopup = function (Sender) {
      if (this.FEditable && this.FExitTimer.FEnabled) this.FPreventDropDown = true;
      this.InitializePopup();
      if (this.FSelector != null) this.FSelector.CalculateItems();
      if (this.FOnPopup != null) this.FOnPopup(this);
    };
    this.DoClosePopup = function (Sender) {
      if (this.FOnClosePopup != null) this.FOnClosePopup(this);
    };
    this.EnterTimerChanged = function (Sender) {
      if (this.FEditable && !this.FExitTimerClose) {
        this.DisableExitEvent();
        this.FEdit.SetFocus();
        this.EnableExitEvent();
      };
      this.FExitTimerClose = false;
      this.FTimer.SetEnabled(false);
    };
    this.ExitTimerChanged = function (Sender) {
      var f = false;
      this.FExitTimer.SetEnabled(false);
      this.FExitTimerClose = true;
      f = true;
      if (this.FPopup.FFocusedControl != null) {
        if (pas["WEBLib.Controls"].TCustomControl.isPrototypeOf(this.FPopup.FFocusedControl)) f = !rtl.as(this.FPopup.FFocusedControl,pas["WEBLib.Controls"].TCustomControl).Focused();
      } else if (this.FPopup.FContentControl != null) {
        if (pas["WEBLib.Controls"].TCustomControl.isPrototypeOf(this.FPopup.FContentControl)) f = !rtl.as(this.FPopup.FContentControl,pas["WEBLib.Controls"].TCustomControl).Focused();
      };
      if (this.FPopup.FIsOpen && !this.FDown && f && !this.FPreventDropDown) {
        this.DropDown();
        this.DoExit();
        if (this.CanFocus() && (this.FOnExit != null)) this.FOnExit(this);
      } else if (!this.FPopup.FIsOpen && !this.FDown) {
        this.DoExit();
      };
      this.FPreventDropDown = false;
    };
    this.ControlExitTimerChanged = function (Sender) {
      this.FControlExitTimer.SetEnabled(false);
      if (!this.FEdit.IsFocused()) this.EnableEnterEvent();
    };
    this.EditChange = function (Sender) {
      this.SetContent(this.FEdit.GetText());
      this.DoEditChange();
      if (this.FOnEditChange != null) this.FOnEditChange(this);
    };
    this.DoEditChange = function () {
    };
    this.HandleDialogKey = function (Key, Shift) {
      if (rtl.neSet(Shift,{})) return;
      if (this.FEditable && this.FEdit.IsFocused()) {
        var $tmp = Key.get();
        if ($tmp === 115) {
          if (!(pas.Classes.TShiftState$a.ssAlt in Shift)) this.DropDown();
        };
      };
    };
    this.InitializePopup = function () {
      if (this.FPopup != null) {
        this.FPopup.SetAdaptToStyle(this.GetAdaptToStyle());
        if (!this.FDefaultStyle) {
          this.FPopup.FFillColor = this.GetFill().FColor;
          this.FPopup.FStrokeColor = this.GetStroke().FColor;
        } else {
          this.FPopup.FFillColor = -1;
          this.FPopup.FStrokeColor = -1;
        };
      };
      if (this.FSelector != null) this.FSelector.SetAdaptToStyle(this.GetAdaptToStyle());
    };
    this.FntChanged = function (Sender) {
      this.Invalidate();
    };
    this.CreateSelector = function () {
      var Result = null;
      Result = pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelector.$create("Create$1",[this]);
      return Result;
    };
    this.GetFocusedControl = function () {
      var Result = null;
      Result = null;
      return Result;
    };
    this.AssignEvents = function () {
      if (this.FSelector != null) {
        this.FSelector.FOnItemSelected = rtl.createCallback(this,"DoItemSelected");
        this.FSelector.FOnItemDeselected = rtl.createCallback(this,"DoItemDeselected");
        this.FSelector.FOnItemClick = rtl.createCallback(this,"DoItemClick");
        this.FSelector.FOnItemBeforeDrawBackground = rtl.createCallback(this,"DoItemBeforeDrawBackground");
        this.FSelector.FOnItemAfterDrawBackground = rtl.createCallback(this,"DoItemAfterDrawBackground");
        this.FSelector.FOnItemBeforeDrawContent = rtl.createCallback(this,"DoItemBeforeDrawContent");
        this.FSelector.FOnItemAfterDrawContent = rtl.createCallback(this,"DoItemAfterDrawContent");
        this.FSelector.FOnItemBeforeDrawText = rtl.createCallback(this,"DoItemBeforeDrawText");
        this.FSelector.FOnItemAfterDrawText = rtl.createCallback(this,"DoItemAfterDrawText");
        this.FSelector.FOnBeforeDraw$1 = rtl.createCallback(this,"DoBeforeDraw$1");
        this.FSelector.FOnAfterDraw$1 = rtl.createCallback(this,"DoAfterDraw$1");
      };
    };
    this.SetGraphicColors = function () {
      pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultPopupFillColor = this.GetFill().FColor;
      pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultPopupStrokeColor = this.GetStroke().FColor;
      pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultButtonFillColor = this.GetFill().FColor;
      pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultButtonStrokeColor = this.GetStroke().FColor;
      pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultTextFontColor = this.FFont$1.FColor;
      pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultSelectionFillColor = 11119017;
      pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultButtonFillColorFocused = pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(this.GetFill().FColor,20);
      pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultButtonStrokeColorFocused = pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(this.GetStroke().FColor,20);
      pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultButtonStrokeColorDisabled = 11119017;
      pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultButtonFillColorDisabled = 13882323;
    };
    this.DrawContent = function (AGraphics, ARect) {
      AGraphics.FFont.Assign(this.FFont$1);
      if (!this.FEnabled) AGraphics.FFont.SetColor(12632256);
    };
    this.DrawBackground = function (AGraphics, ARect) {
      if (!this.FDefaultStyle) {
        this.SetGraphicColors();
      };
      AGraphics.DrawDropDownButton(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),this.FDown,this.IsFocused(),true,false,this.GetAdaptToStyle() || !this.FDefaultStyle,this.FPaintScaleFactor);
      if (!this.FDefaultStyle) AGraphics.$class.SetDefaultGraphicColors();
    };
    this.HandleMouseDown = function (Button, Shift, X, Y) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseDown.apply(this,arguments);
      if (this.CanFocus()) this.SetFocus();
      if (Button === pas["WEBLib.Controls"].TMouseButton.mbLeft) {
        this.FDown = true;
        this.Invalidate();
        this.DropDown();
        if (this.FEditable) {
          this.DisableExitEvent();
          this.FEdit.SetFocus();
          this.EnableExitEvent();
        };
      };
    };
    this.HandleMouseUp = function (Button, Shift, X, Y) {
      this.FDown = false;
      this.Invalidate();
    };
    this.HandleKeyDown = function (Key, Shift) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleKeyDown.apply(this,arguments);
      if (pas.Classes.TShiftState$a.ssAlt in Shift) {
        var $tmp = Key.get();
        if (($tmp === 38) || ($tmp === 40)) {
          this.DropDown();
          return;
        };
      };
      var $tmp1 = Key.get();
      if ($tmp1 === 36) {
        this.SelectFirstValue()}
       else if ($tmp1 === 35) {
        this.SelectLastValue()}
       else if (($tmp1 === 38) || ($tmp1 === 37)) {
        this.SelectPreviousValue()}
       else if (($tmp1 === 40) || ($tmp1 === 39)) this.SelectNextValue();
      if (rtl.neSet(Shift,{})) return;
      var $tmp2 = Key.get();
      if (($tmp2 === 32) || ($tmp2 === 13) || ($tmp2 === 115)) this.DropDown();
    };
    this.EditKeyDown = function (Sender, Key, Shift) {
      if (this.FOnKeyDown != null) this.FOnKeyDown(Sender,Key,rtl.refSet(Shift));
      this.FKeyDown = Key.get();
    };
    this.EditKeyUp = function (Sender, Key, Shift) {
      if (this.FOnKeyUp != null) this.FOnKeyUp(Sender,Key,rtl.refSet(Shift));
    };
    this.EditKeyPress = function (Sender, Key) {
      var $Self = this;
      function EatKey() {
        Key.set("\x00");
      };
      if (this.FKeyDown in rtl.createSet(38,40)) {
        if (this.FKeyDown === 38) this.EditUp();
        if (this.FKeyDown === 40) this.EditDown();
        EatKey();
      };
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Create$1.apply(this,arguments);
      this.FExitTimerClose = false;
      this.FPreventDropDown = false;
      this.FFont$1 = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FFont$1.FOnChanged = rtl.createCallback(this,"FntChanged");
      this.FDefaultStyle = true;
      this.FTimer = pas["WEBLib.ExtCtrls"].TTimer.$create("Create$1",[this]);
      this.FTimer.SetInterval(1);
      this.FTimer.FOnTimer = rtl.createCallback(this,"EnterTimerChanged");
      this.FTimer.SetEnabled(false);
      this.FExitTimer = pas["WEBLib.ExtCtrls"].TTimer.$create("Create$1",[this]);
      this.FExitTimer.SetInterval(1);
      this.FExitTimer.FOnTimer = rtl.createCallback(this,"ExitTimerChanged");
      this.FExitTimer.SetEnabled(false);
      this.FControlExitTimer = pas["WEBLib.ExtCtrls"].TTimer.$create("Create$1",[this]);
      this.FControlExitTimer.SetInterval(1);
      this.FControlExitTimer.FOnTimer = rtl.createCallback(this,"ControlExitTimerChanged");
      this.FControlExitTimer.SetEnabled(false);
      this.FEdit = $impl.TTMSFNCCustomPickerEdit.$create("Create$1",[this]);
      this.FEdit.SetTabOrder(0);
      this.FEdit.SetTabStop(true);
      this.FEdit.FOnKeyDown = rtl.createCallback(this,"EditKeyDown");
      this.FEdit.FOnKeyUp = rtl.createCallback(this,"EditKeyUp");
      this.FEdit.FOnExit = rtl.createCallback(this,"DoEditExit");
      this.FEdit.FOnEnter = rtl.createCallback(this,"DoEditEnter");
      this.FEdit.SetAlignWithMargins(true);
      this.FEdit.FMargins.SetLeft(0);
      this.FEdit.FMargins.SetTop(0);
      this.FEdit.FMargins.SetRight(17);
      this.FEdit.FMargins.SetBottom(0);
      this.FEdit.SetAlign(pas["WEBLib.Controls"].TAlign.alClient);
      this.FEdit.FOnChange = rtl.createCallback(this,"EditChange");
      this.FEdit.FOnKeyPress = rtl.createCallback(this,"EditKeyPress");
      this.FDropDownWidth = 135;
      this.FDropDownHeight = 135;
      this.FShowFocus$1 = true;
      this.FSelector = this.CreateSelector();
      this.AssignEvents();
      this.FPopup = pas["WEBLib.TMSFNCPopup"].TTMSFNCPopup.$create("Create$1",[this]);
      this.FPopup.SetDragWithParent(true);
      this.FPopup.FFocusedControl = this.GetFocusedControl();
      this.FPopup.SetContentControl(this.FSelector);
      this.FPopup.SetDropDownWidth(this.FDropDownWidth);
      this.FPopup.SetDropDownHeight(this.FDropDownHeight);
      this.FPopup.FOnPopup = rtl.createCallback(this,"DoPopup");
      this.FPopup.FOnClosePopup = rtl.createCallback(this,"DoClosePopup");
      this.SetWidth(60);
      this.SetHeight(22);
      return this;
    };
    this.Destroy = function () {
      if (this.FFont$1 != null) pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FFont$1;
        }, set: function (v) {
          this.p.FFont$1 = v;
        }});
      if (this.FSelector != null) pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FSelector;
        }, set: function (v) {
          this.p.FSelector = v;
        }});
      if (this.FPopup != null) pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FPopup;
        }, set: function (v) {
          this.p.FPopup = v;
        }});
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Destroy.call(this);
    };
    this.DropDown = function () {
      this.DisableExitEvent();
      this.FPopup.SetPlacementControl(this);
      if (!this.FPopup.FIsOpen) {
        this.CalcSize();
        this.FPopup.SetIsOpen(true);
      } else this.FPopup.SetIsOpen(false);
      this.EnableExitEvent();
    };
    this.BeginUpdate = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBase.BeginUpdate.call(this);
      this.FUpdateCount$1 += 1;
      if (this.FSelector != null) this.FSelector.BeginUpdate();
    };
    this.EndUpdate = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBase.EndUpdate.call(this);
      this.FUpdateCount$1 -= 1;
      if (this.FSelector != null) this.FSelector.EndUpdate();
    };
    this.LoadSettingsFromFile = function (AFileName) {
      this.FDefaultStyle = false;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.LoadSettingsFromFile.apply(this,arguments);
      this.Invalidate();
    };
    this.LoadSettingsFromStream = function (AStream) {
      this.FDefaultStyle = false;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.LoadSettingsFromStream.apply(this,arguments);
      this.Invalidate();
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCDefaultPicker",this.TTMSFNCCustomPicker,function () {
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("DefaultStyle",2,rtl.boolean,"FDefaultStyle","SetDefaultStyle",4,{Default: true});
    $r.addProperty("Fill",3,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"GetFill","SetFill$1");
    $r.addProperty("Stroke",3,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"GetStroke","SetStroke$1");
    $r.addProperty("Font",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FFont$1","SetFnt");
    $r.addProperty("Version",1,rtl.string,"GetVersion","");
    $r.addProperty("OnPopup",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnPopup","FOnPopup");
    $r.addProperty("OnClosePopup",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClosePopup","FOnClosePopup");
  });
  $mod.$implcode = function () {
    rtl.createClass($impl,"TTMSFNCOpenCustomSelector",pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelector,function () {
      rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
      rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
      rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
      rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
      rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
      rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
      rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
      rtl.addIntf(this,pas.System.IUnknown);
    });
    rtl.createClass($impl,"TTMSFNCCustomPickerEdit",pas["WEBLib.StdCtrls"].TEdit,function () {
      rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
      rtl.addIntf(this,pas.System.IUnknown);
    });
  };
},["SysUtils","WEBLib.TMSFNCUtils","WEBLib.TMSFNCStyles"]);
rtl.module("WEBLib.TMSFNCControlPicker",["System","Classes","Types","WEBLib.Controls","WEBLib.TMSFNCCustomPicker","WEBLib.TMSFNCCustomSelector","WEBLib.TMSFNCGraphics","WEBLib.TMSFNCGraphicsTypes","WEBLib.TMSFNCTypes"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.MAJ_VER = 1;
  this.MIN_VER = 0;
  this.REL_VER = 1;
  this.BLD_VER = 2;
  rtl.createInterface(this,"ITMSFNCControlPickerBase","{FF82E121-0510-4FF1-8BB8-A40AA5219095}",["PickerGetContent"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("PickerGetContent",1,[],2,rtl.string);
  });
  rtl.createInterface(this,"ITMSFNCControlPickerItems","{D0FBAC5E-B2AA-46AE-AD21-91DF23AD4FCB}",["PickerSelectItem","PickerGetSelectedItem","PickerGetVisibleItemCount","PickerGetItemCount","PickerGetItemHeight","PickerSetItemHeight","PickerGetItemWidth","PickerSetItemWidth","PickerGetNextSelectableItem","PickerGetPreviousSelectableItem","PickerGetFirstSelectableItem","PickerGetLastSelectableItem"],this.ITMSFNCControlPickerBase,function () {
    var $r = this.$rtti;
    $r.addMethod("PickerSelectItem",0,[["AItemIndex",rtl.longint]]);
    $r.addMethod("PickerGetSelectedItem",1,[],2,rtl.longint);
    $r.addMethod("PickerGetVisibleItemCount",1,[],2,rtl.longint);
    $r.addMethod("PickerGetItemCount",1,[],2,rtl.longint);
    $r.addMethod("PickerGetItemHeight",1,[],2,rtl.double);
    $r.addMethod("PickerSetItemHeight",0,[["AValue",rtl.double]]);
    $r.addMethod("PickerGetItemWidth",1,[],2,rtl.double);
    $r.addMethod("PickerSetItemWidth",0,[["AValue",rtl.double]]);
    $r.addMethod("PickerGetNextSelectableItem",1,[["AItemIndex",rtl.longint]],2,rtl.longint);
    $r.addMethod("PickerGetPreviousSelectableItem",1,[["AItemIndex",rtl.longint]],2,rtl.longint);
    $r.addMethod("PickerGetFirstSelectableItem",1,[],2,rtl.longint);
    $r.addMethod("PickerGetLastSelectableItem",1,[],2,rtl.longint);
  });
  rtl.recNewT(this,"TTMSFNCControlPickerFilterItem",function () {
    this.ItemIndex = 0;
    this.ItemText = "";
    this.$eq = function (b) {
      return (this.ItemIndex === b.ItemIndex) && (this.ItemText === b.ItemText);
    };
    this.$assign = function (s) {
      this.ItemIndex = s.ItemIndex;
      this.ItemText = s.ItemText;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCControlPickerFilterItem",{},this);
    $r.addField("ItemIndex",rtl.longint);
    $r.addField("ItemText",rtl.string);
  });
  rtl.createInterface(this,"ITMSFNCControlPickerFull","{3AF9E5D7-2049-4809-920F-BA318E3D8E8D}",["PickerResetFilter","PickerApplyFilter","PickerLookupItem"],this.ITMSFNCControlPickerItems,function () {
    var $r = this.$rtti;
    $r.addMethod("PickerResetFilter",0,[]);
    $r.addMethod("PickerApplyFilter",0,[["ACondition",rtl.string],["ACaseSensitive",rtl.boolean]]);
    $r.addMethod("PickerLookupItem",1,[["ALookupString",rtl.string],["ACaseSensitive",rtl.boolean]],2,$mod.$rtti["TTMSFNCControlPickerFilterItem"]);
  });
  this.TTMSFNCControlPickerStyle = {"0": "csDropDown", csDropDown: 0, "1": "csDropDownList", csDropDownList: 1};
  this.$rtti.$Enum("TTMSFNCControlPickerStyle",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCControlPickerStyle});
  this.TTMSFNCControlPickerDropDownHeightMode = {"0": "chmDropDownHeight", chmDropDownHeight: 0, "1": "chmControl", chmControl: 1, "2": "chmItems", chmItems: 2, "3": "chmPickerHeight", chmPickerHeight: 3};
  this.$rtti.$Enum("TTMSFNCControlPickerDropDownHeightMode",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TTMSFNCControlPickerDropDownHeightMode});
  this.TTMSFNCControlPickerDropDownWidthMode = {"0": "cwmDropDownWidth", cwmDropDownWidth: 0, "1": "cwmControl", cwmControl: 1, "2": "cwmItems", cwmItems: 2, "3": "cwmPickerWidth", cwmPickerWidth: 3};
  this.$rtti.$Enum("TTMSFNCControlPickerDropDownWidthMode",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TTMSFNCControlPickerDropDownWidthMode});
  this.$rtti.$MethodVar("TTMSFNCCustomControlPickerItemSelectedEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AText",rtl.string],["AItemIndex",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCustomControlPickerOnAdjustDropDownSizeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ASize",rtl.double,1],["AAllow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCustomControlPickerOnSetContentEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AText",rtl.string,1],["AAllow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCustomControlPickerBeforeDrawContentEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AContent",rtl.string],["AAllow",rtl.boolean,1],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCustomControlPickerAfterDrawContentEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AContent",rtl.string]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCCustomControlPicker",pas["WEBLib.TMSFNCCustomPicker"].TTMSFNCDefaultPicker,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomPicker"].TTMSFNCDefaultPicker.$init.call(this);
      this.FAutoCloseUp = false;
      this.FAutoComplete = false;
      this.FAutoCompleteDelay = 0;
      this.FAutoCompleteNumChar = 0;
      this.FAutoDropDown = false;
      this.FCaseSensitive = false;
      this.FControl = null;
      this.FControlParent = null;
      this.FControlVisible = false;
      this.FControlAlign = 0;
      this.FControlLeft = 0.0;
      this.FControlTop = 0.0;
      this.FControlWidth = 0.0;
      this.FControlHeight = 0.0;
      this.FDropDownHeightMode = 0;
      this.FKeyDown$1 = 0;
      this.FFont$2 = null;
      this.FPrevString = "";
      this.FStyle = 0;
      this.FTick = 0;
      this.FWrapper = null;
      this.FOnAdjustDropDownHeight = null;
      this.FOnAfterDrawPickerContent = null;
      this.FOnBeforeDrawPickerContent = null;
      this.FOnItemSelected$1 = null;
      this.FOnSetContent = null;
      this.FDropDownWidthMode = 0;
      this.FOnAdjustDropDownWidth = null;
      this.FDropDownControlWidth = 0.0;
      this.FDropDownControlHeight = 0.0;
    };
    this.$final = function () {
      this.FControl = undefined;
      this.FControlParent = undefined;
      this.FFont$2 = undefined;
      this.FWrapper = undefined;
      this.FOnAdjustDropDownHeight = undefined;
      this.FOnAfterDrawPickerContent = undefined;
      this.FOnBeforeDrawPickerContent = undefined;
      this.FOnItemSelected$1 = undefined;
      this.FOnSetContent = undefined;
      this.FOnAdjustDropDownWidth = undefined;
      pas["WEBLib.TMSFNCCustomPicker"].TTMSFNCDefaultPicker.$final.call(this);
    };
    this.SetAutoCloseUp = function (Value) {
      this.FAutoCloseUp = Value;
    };
    this.SetAutoComplete = function (Value) {
      this.FAutoComplete = Value;
    };
    this.SetAutoCompleteDelay = function (Value) {
      this.FAutoCompleteDelay = Value;
    };
    this.SetAutoCompleteNumChar = function (Value) {
      if (Value > 0) {
        this.FAutoCompleteNumChar = Value}
       else this.FAutoCompleteNumChar = 1;
    };
    this.SetAutoDropDown = function (Value) {
      this.FAutoDropDown = Value;
    };
    this.SetControl = function (Value) {
      if (Value === this) return;
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        this.FControl = Value;
      } else {
        if (!(pas.Classes.TComponentStateItem.csLoading in this.FComponentState) && (this.FControl != null)) {
          this.FControl.SetParent(this.FControlParent);
          this.FControl.SetVisible(this.FControlVisible);
          this.FControl.SetAlign(this.FControlAlign);
          this.FControl.SetLeft(Math.round(this.FControlLeft));
          this.FControl.SetTop(Math.round(this.FControlTop));
          this.FControl.SetWidth(Math.round(this.FControlWidth));
          this.FControl.SetHeight(Math.round(this.FControlHeight));
        };
        this.FControl = Value;
        if (this.FControl != null) {
          this.FControlParent = this.FControl.FParent;
          this.FControlVisible = this.FControl.FVisible;
          this.FControlAlign = this.FControl.FAlign;
          this.FControl.SetAlign(pas["WEBLib.Controls"].TAlign.alNone);
          this.FControlLeft = this.FControl.GetLeft();
          this.FControlTop = this.FControl.GetTop();
          this.FControlWidth = this.FControl.GetWidth();
          this.FControlHeight = this.FControl.GetHeight();
          this.FControl.SetParent(this.FWrapper);
          this.FControl.SetVisible(true);
          this.FControl.SetLeft(0);
          this.FControl.SetTop(0);
        } else {
          this.FControlParent = null;
          this.FControlVisible = false;
          this.FControlAlign = pas["WEBLib.Controls"].TAlign.alNone;
          this.FControlLeft = 0;
          this.FControlTop = 0;
          this.FControlWidth = 0;
          this.FControlHeight = 0;
        };
        this.UpdatePickerContent();
        this.AdjustDropDownHeight();
        this.AdjustDropDownWidth();
      };
      this.Invalidate();
    };
    this.SetDropDownHeightMode = function (Value) {
      if (Value !== this.FDropDownHeightMode) {
        this.FDropDownHeightMode = Value;
        this.AdjustDropDownHeight();
      };
    };
    this.SetFnt$1 = function (Value) {
      this.FFont$2.AssignSource(Value);
    };
    this.SetItemHeight = function (Value) {
      var pi = null;
      var pf = null;
      var $ir = rtl.createIntfRefs();
      try {
        if (this.FControl != null) {
          if (pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCControlPickerItems),{get: function () {
              return pi;
            }, set: function (v) {
              pi = v;
            }})) {
            pi.PickerSetItemHeight(Value)}
           else if (pas.SysUtils.Supports$1($ir.ref(2,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCControlPickerFull),{get: function () {
              return pf;
            }, set: function (v) {
              pf = v;
            }})) pf.PickerSetItemHeight(Value);
        };
        this.AdjustDropDownHeight();
      } finally {
        $ir.free();
        rtl._Release(pi);
        rtl._Release(pf);
      };
    };
    this.SetItemIndex = function (Value) {
      var pi = null;
      var pf = null;
      var $ir = rtl.createIntfRefs();
      try {
        if ((this.FControl != null) && (Value >= 0) && (Value < this.GetCount())) {
          if (pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCControlPickerItems),{get: function () {
              return pi;
            }, set: function (v) {
              pi = v;
            }})) {
            pi.PickerSelectItem(Value)}
           else if (pas.SysUtils.Supports$1($ir.ref(2,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCControlPickerFull),{get: function () {
              return pf;
            }, set: function (v) {
              pf = v;
            }})) pf.PickerSelectItem(Value);
          this.UpdatePickerContent();
          this.DoPickerItemSelected(this.GetContent(),Value);
          this.Invalidate();
        };
      } finally {
        $ir.free();
        rtl._Release(pi);
        rtl._Release(pf);
      };
    };
    this.SetStyle = function (Value) {
      if (this.FStyle !== Value) {
        this.FStyle = Value;
        var $tmp = this.FStyle;
        if ($tmp === $mod.TTMSFNCControlPickerStyle.csDropDown) {
          this.SetEditable(true);
          this.GetPopup().FFocusedControl = this.FEdit;
          this.GetPopup().FStaysOpen = true;
        } else if ($tmp === $mod.TTMSFNCControlPickerStyle.csDropDownList) {
          this.SetEditable(false);
          if (this.FControl != null) this.GetPopup().FFocusedControl = this.FControl;
          this.GetPopup().FStaysOpen = false;
        };
      };
    };
    this.SetText = function (Value) {
      this.SetContent(Value);
    };
    this.SetCaseSensitive = function (Value) {
      this.FCaseSensitive = Value;
    };
    this.GetItemIndex = function () {
      var Result = 0;
      var pi = null;
      var pf = null;
      var $ir = rtl.createIntfRefs();
      try {
        Result = -1;
        if ((this.FControl != null) && pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCControlPickerItems),{get: function () {
            return pi;
          }, set: function (v) {
            pi = v;
          }})) {
          Result = pi.PickerGetSelectedItem()}
         else if ((this.FControl != null) && pas.SysUtils.Supports$1($ir.ref(2,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCControlPickerFull),{get: function () {
            return pf;
          }, set: function (v) {
            pf = v;
          }})) Result = pf.PickerGetSelectedItem();
      } finally {
        $ir.free();
        rtl._Release(pi);
        rtl._Release(pf);
      };
      return Result;
    };
    this.GetItemHeight = function () {
      var Result = 0.0;
      var pi = null;
      var pf = null;
      var $ir = rtl.createIntfRefs();
      try {
        Result = 0.0;
        if (this.FControl != null) {
          if (pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCControlPickerItems),{get: function () {
              return pi;
            }, set: function (v) {
              pi = v;
            }})) {
            Result = pi.PickerGetItemHeight()}
           else if (pas.SysUtils.Supports$1($ir.ref(2,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCControlPickerFull),{get: function () {
              return pf;
            }, set: function (v) {
              pf = v;
            }})) {
            Result = pf.PickerGetItemHeight()}
           else Result = this.FControlHeight;
        };
      } finally {
        $ir.free();
        rtl._Release(pi);
        rtl._Release(pf);
      };
      return Result;
    };
    this.GetText = function () {
      var Result = "";
      Result = this.GetContent();
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      var pi = null;
      var pf = null;
      var $ir = rtl.createIntfRefs();
      try {
        Result = 0;
        if (this.FControl != null) {
          if (pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCControlPickerItems),{get: function () {
              return pi;
            }, set: function (v) {
              pi = v;
            }})) {
            Result = pi.PickerGetItemCount()}
           else if (pas.SysUtils.Supports$1($ir.ref(2,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCControlPickerFull),{get: function () {
              return pf;
            }, set: function (v) {
              pf = v;
            }})) {
            Result = pf.PickerGetItemCount()}
           else Result = 1;
        };
      } finally {
        $ir.free();
        rtl._Release(pi);
        rtl._Release(pf);
      };
      return Result;
    };
    this.ApplyFilter = function (ACondition) {
      var pf = null;
      var $ir = rtl.createIntfRefs();
      try {
        if ((this.FControl != null) && pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCControlPickerFull),{get: function () {
            return pf;
          }, set: function (v) {
            pf = v;
          }})) pf.PickerApplyFilter(ACondition,this.FCaseSensitive);
      } finally {
        $ir.free();
        rtl._Release(pf);
      };
    };
    this.ClearFilter = function () {
      var pf = null;
      var $ir = rtl.createIntfRefs();
      try {
        if ((this.FControl != null) && pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCControlPickerFull),{get: function () {
            return pf;
          }, set: function (v) {
            pf = v;
          }})) pf.PickerResetFilter();
      } finally {
        $ir.free();
        rtl._Release(pf);
      };
    };
    this.LookupItem = function (ALookupString) {
      var Result = $mod.TTMSFNCControlPickerFilterItem.$new();
      var pf = null;
      var $ir = rtl.createIntfRefs();
      try {
        Result.ItemIndex = -1;
        Result.ItemText = "";
        if ((this.FControl != null) && pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCControlPickerFull),{get: function () {
            return pf;
          }, set: function (v) {
            pf = v;
          }})) Result.$assign(pf.PickerLookupItem(ALookupString,this.FCaseSensitive));
      } finally {
        $ir.free();
        rtl._Release(pf);
      };
      return Result;
    };
    this.SetDropDownWidthMode = function (Value) {
      if (Value !== this.FDropDownWidthMode) {
        this.FDropDownWidthMode = Value;
        this.AdjustDropDownWidth();
      };
    };
    this.GetItemWidth = function () {
      var Result = 0.0;
      var pi = null;
      var pf = null;
      var $ir = rtl.createIntfRefs();
      try {
        Result = 0.0;
        if (this.FControl != null) {
          if (pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCControlPickerItems),{get: function () {
              return pi;
            }, set: function (v) {
              pi = v;
            }})) {
            Result = pi.PickerGetItemWidth()}
           else if (pas.SysUtils.Supports$1($ir.ref(2,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCControlPickerFull),{get: function () {
              return pf;
            }, set: function (v) {
              pf = v;
            }})) {
            Result = pf.PickerGetItemWidth()}
           else Result = this.FControlWidth;
        };
      } finally {
        $ir.free();
        rtl._Release(pi);
        rtl._Release(pf);
      };
      return Result;
    };
    this.SetItemWidth = function (Value) {
      var pi = null;
      var pf = null;
      var $ir = rtl.createIntfRefs();
      try {
        if (this.FControl != null) {
          if (pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCControlPickerItems),{get: function () {
              return pi;
            }, set: function (v) {
              pi = v;
            }})) {
            pi.PickerSetItemWidth(Value)}
           else if (pas.SysUtils.Supports$1($ir.ref(2,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCControlPickerFull),{get: function () {
              return pf;
            }, set: function (v) {
              pf = v;
            }})) pf.PickerSetItemWidth(Value);
        };
        this.AdjustDropDownWidth();
      } finally {
        $ir.free();
        rtl._Release(pi);
        rtl._Release(pf);
      };
    };
    this.SetDropDownControlHeight = function (Value) {
      if (this.FDropDownControlHeight !== Value) {
        this.FDropDownControlHeight = Value;
        this.AdjustDropDownHeight();
      };
    };
    this.SetDropDownControlWidth = function (Value) {
      if (this.FDropDownControlWidth !== Value) {
        this.FDropDownControlWidth = Value;
        this.AdjustDropDownWidth();
      };
    };
    this.ChangeDPIScale = function (M, D) {
      pas["WEBLib.TMSFNCCustomPicker"].TTMSFNCCustomPicker.ChangeDPIScale.apply(this,arguments);
      this.BeginUpdate();
      this.FFont$2.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FFont$2.FHeight,M,D));
      this.FEdit.FFont.Assign(this.FFont$2);
      this.SetDropDownControlHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FDropDownControlHeight,M,D));
      this.SetDropDownControlWidth(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FDropDownControlWidth,M,D));
      this.FControlHeight = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FControlHeight,M,D);
      this.FControlWidth = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FControlWidth,M,D);
      this.EndUpdate();
    };
    this.Notification = function (AComponent, Operation) {
      pas["WEBLib.Menus"].TWebCustomControl.Notification.apply(this,arguments);
      if ((Operation === pas.Classes.TOperation.opRemove) && (AComponent === this.FControl)) this.FControl = null;
    };
    this.FontChange = function (Sender) {
      this.Invalidate();
    };
    this.Loaded = function () {
      pas["WEBLib.Controls"].TCustomControl.Loaded.call(this);
      this.AdjustDropDownHeight();
      this.SetControl(this.FControl);
    };
    this.DoPickerItemSelected = function (AText, AItemIndex) {
      if (this.FOnItemSelected$1 != null) this.FOnItemSelected$1(this,AText,AItemIndex);
    };
    this.DoAdjustDropDownHeight = function (AHeight, AAllow) {
      if (this.FOnAdjustDropDownHeight != null) this.FOnAdjustDropDownHeight(this,AHeight,AAllow);
    };
    this.DoAdjustDropDownWidth = function (AWidth, AAllow) {
      if (this.FOnAdjustDropDownWidth != null) this.FOnAdjustDropDownWidth(this,AWidth,AAllow);
    };
    this.DoAfterDrawPickerContent = function (AGraphics, ARect, AContent) {
      if (this.FOnAfterDrawPickerContent != null) this.FOnAfterDrawPickerContent(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AContent);
    };
    this.DoBeforeDrawPickerContent = function (AGraphics, ARect, AContent, AAllow, ADefaultDraw) {
      if (this.FOnBeforeDrawPickerContent != null) this.FOnBeforeDrawPickerContent(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AContent,AAllow,ADefaultDraw);
    };
    this.DoSetContent = function (AText, AAllow) {
      if (this.FOnSetContent != null) this.FOnSetContent(this,AText,AAllow);
    };
    this.DrawContent = function (AGraphics, ARect) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var a = false;
      var dd = false;
      pas["WEBLib.TMSFNCCustomPicker"].TTMSFNCCustomPicker.DrawContent.apply(this,arguments);
      if (!this.FEnabled) {
        AGraphics.FFont.SetColor(12632256)}
       else AGraphics.FFont.AssignSource(this.FFont$2);
      r.$assign(ARect);
      pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,-3,-3);
      a = true;
      dd = true;
      this.DoBeforeDrawPickerContent(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.GetContent(),{get: function () {
          return a;
        }, set: function (v) {
          a = v;
        }},{get: function () {
          return dd;
        }, set: function (v) {
          dd = v;
        }});
      if (a) {
        if (dd) AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.GetContent(),false,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,true,false,-1,-1);
        this.DoAfterDrawPickerContent(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.GetContent());
      };
    };
    this.InitializePopup = function () {
      pas["WEBLib.TMSFNCCustomPicker"].TTMSFNCCustomPicker.InitializePopup.call(this);
      if (this.FControl != null) {
        this.FControl.SetWidth(Math.round(this.FDropDownWidth));
        this.FControl.SetHeight(Math.round(this.FDropDownHeight));
      };
    };
    this.SelectFirstValue = function () {
      var idx = 0;
      var pi = null;
      var pf = null;
      var $ir = rtl.createIntfRefs();
      try {
        pas["WEBLib.TMSFNCCustomPicker"].TTMSFNCCustomPicker.SelectFirstValue.call(this);
        if (this.FControl != null) {
          idx = -1;
          if (pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCControlPickerItems),{get: function () {
              return pi;
            }, set: function (v) {
              pi = v;
            }})) {
            idx = pi.PickerGetFirstSelectableItem()}
           else if (pas.SysUtils.Supports$1($ir.ref(2,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCControlPickerFull),{get: function () {
              return pf;
            }, set: function (v) {
              pf = v;
            }})) idx = pf.PickerGetFirstSelectableItem();
          this.NotifyDataBinderEdit();
          this.SetItemIndex(idx);
          this.NotifyDataBinderValueChanged();
        };
      } finally {
        $ir.free();
        rtl._Release(pi);
        rtl._Release(pf);
      };
    };
    this.SelectLastValue = function () {
      var idx = 0;
      var pi = null;
      var pf = null;
      var $ir = rtl.createIntfRefs();
      try {
        pas["WEBLib.TMSFNCCustomPicker"].TTMSFNCCustomPicker.SelectLastValue.call(this);
        if (this.FControl != null) {
          idx = -1;
          if (pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCControlPickerItems),{get: function () {
              return pi;
            }, set: function (v) {
              pi = v;
            }})) {
            idx = pi.PickerGetLastSelectableItem()}
           else if (pas.SysUtils.Supports$1($ir.ref(2,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCControlPickerFull),{get: function () {
              return pf;
            }, set: function (v) {
              pf = v;
            }})) idx = pf.PickerGetLastSelectableItem();
          this.NotifyDataBinderEdit();
          this.SetItemIndex(idx);
          this.NotifyDataBinderValueChanged();
        };
      } finally {
        $ir.free();
        rtl._Release(pi);
        rtl._Release(pf);
      };
    };
    this.SelectNextValue = function () {
      var idx = 0;
      var pi = null;
      var pf = null;
      var $ir = rtl.createIntfRefs();
      try {
        pas["WEBLib.TMSFNCCustomPicker"].TTMSFNCCustomPicker.SelectNextValue.call(this);
        if (this.FControl != null) {
          idx = -1;
          if (pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCControlPickerItems),{get: function () {
              return pi;
            }, set: function (v) {
              pi = v;
            }})) {
            idx = pi.PickerGetNextSelectableItem(this.GetItemIndex())}
           else if (pas.SysUtils.Supports$1($ir.ref(2,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCControlPickerFull),{get: function () {
              return pf;
            }, set: function (v) {
              pf = v;
            }})) idx = pf.PickerGetNextSelectableItem(this.GetItemIndex());
          this.NotifyDataBinderEdit();
          this.SetItemIndex(idx);
          this.NotifyDataBinderValueChanged();
        };
      } finally {
        $ir.free();
        rtl._Release(pi);
        rtl._Release(pf);
      };
    };
    this.SelectPreviousValue = function () {
      var idx = 0;
      var pi = null;
      var pf = null;
      var $ir = rtl.createIntfRefs();
      try {
        pas["WEBLib.TMSFNCCustomPicker"].TTMSFNCCustomPicker.SelectPreviousValue.call(this);
        if (this.FControl != null) {
          idx = -1;
          if (pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCControlPickerItems),{get: function () {
              return pi;
            }, set: function (v) {
              pi = v;
            }})) {
            idx = pi.PickerGetPreviousSelectableItem(this.GetItemIndex())}
           else if (pas.SysUtils.Supports$1($ir.ref(2,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCControlPickerFull),{get: function () {
              return pf;
            }, set: function (v) {
              pf = v;
            }})) idx = pf.PickerGetPreviousSelectableItem(this.GetItemIndex());
          this.NotifyDataBinderEdit();
          this.SetItemIndex(idx);
          this.NotifyDataBinderValueChanged();
        };
      } finally {
        $ir.free();
        rtl._Release(pi);
        rtl._Release(pf);
      };
    };
    this.SetAdaptToStyle = function (Value) {
      var ia = null;
      var $ir = rtl.createIntfRefs();
      try {
        pas["WEBLib.TMSFNCCustomPicker"].TTMSFNCCustomPicker.SetAdaptToStyle.apply(this,arguments);
        if (this.FWrapper != null) this.FWrapper.SetAdaptToStyle(this.GetAdaptToStyle());
        if ((this.FControl != null) && pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR(pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle),{get: function () {
            return ia;
          }, set: function (v) {
            ia = v;
          }})) ia.SetAdaptToStyle(this.GetAdaptToStyle());
      } finally {
        $ir.free();
        rtl._Release(ia);
      };
    };
    this.AdjustDropDownHeight = function () {
      var h = 0.0;
      var a = false;
      if ((this.FControl != null) && (this.FDropDownHeightMode === $mod.TTMSFNCControlPickerDropDownHeightMode.chmItems)) {
        h = this.GetItemHeight() * this.GetVisibleItemCount();
      } else if ((this.FControl != null) && (this.FDropDownHeightMode === $mod.TTMSFNCControlPickerDropDownHeightMode.chmControl)) {
        h = this.FControlHeight;
      } else if (this.FDropDownHeightMode === $mod.TTMSFNCControlPickerDropDownHeightMode.chmPickerHeight) {
        h = this.GetHeight();
      } else h = this.FDropDownControlHeight;
      a = true;
      this.DoAdjustDropDownHeight({get: function () {
          return h;
        }, set: function (v) {
          h = v;
        }},{get: function () {
          return a;
        }, set: function (v) {
          a = v;
        }});
      if (a) this.SetDropDownHeight(h);
    };
    this.AdjustDropDownWidth = function () {
      var w = 0.0;
      var a = false;
      if ((this.FControl != null) && (this.FDropDownWidthMode === $mod.TTMSFNCControlPickerDropDownWidthMode.cwmItems)) {
        w = this.GetItemWidth() * this.GetVisibleItemCount();
      } else if ((this.FControl != null) && (this.FDropDownWidthMode === $mod.TTMSFNCControlPickerDropDownWidthMode.cwmControl)) {
        w = this.FControlWidth;
      } else if (this.FDropDownWidthMode === $mod.TTMSFNCControlPickerDropDownWidthMode.cwmPickerWidth) {
        w = this.GetWidth();
      } else w = this.FDropDownControlWidth;
      a = true;
      this.DoAdjustDropDownWidth({get: function () {
          return w;
        }, set: function (v) {
          w = v;
        }},{get: function () {
          return a;
        }, set: function (v) {
          a = v;
        }});
      if (a) this.SetDropDownWidth(w);
    };
    this.UpdateListBoxLookup = function (AText) {
      this.ClearFilter();
      this.ApplyFilter(AText);
      if (this.FAutoDropDown && (AText.length >= this.FAutoCompleteNumChar) && !this.GetPopup().FIsOpen && (this.GetVisibleItemCount() > 0)) this.DropDown();
    };
    this.DeleteFromEdit = function () {
      this.FPrevString = this.FEdit.GetText();
      if (this.FEdit.GetSelLength() === 0) {
        pas.System.Delete({p: this, get: function () {
            return this.p.FPrevString;
          }, set: function (v) {
            this.p.FPrevString = v;
          }},this.FEdit.GetSelStart(),1)}
       else pas.System.Delete({p: this, get: function () {
          return this.p.FPrevString;
        }, set: function (v) {
          this.p.FPrevString = v;
        }},Math.max(1,this.FEdit.GetSelStart() + 1),this.FEdit.GetSelLength());
      this.UpdateListBoxLookup(this.FPrevString);
      if ((this.FPrevString.length < this.FAutoCompleteNumChar) && this.GetPopup().FIsOpen) {
        this.DropDown();
        this.ClearFilter();
      };
    };
    this.EditKeyDown$1 = function (Sender, Key, Shift) {
      this.FKeyDown$1 = Key.get();
      if (this.FKeyDown$1 in rtl.createSet(38,40)) {
        if (this.FKeyDown$1 === 38) this.SelectPreviousValue();
        if (this.FKeyDown$1 === 40) this.SelectNextValue();
        Key.set(0);
      };
      if (this.FKeyDown$1 === 8) this.DeleteFromEdit();
    };
    this.EditKeyPress$1 = function (Sender, Key) {
      var $Self = this;
      var fi = $mod.TTMSFNCControlPickerFilterItem.$new();
      var selPos = 0;
      var selLen = 0;
      var kch = "\x00";
      function EatKey() {
        Key.set("\x00");
      };
      if (!(this.FControl != null)) return;
      kch = Key.get();
      if (this.FKeyDown$1 === 27) {
        if (this.FAutoCloseUp && this.GetPopup().FIsOpen) ;
        this.DropDown();
        return;
      };
      if (this.FKeyDown$1 === 13) {
        if (this.GetPopup().FIsOpen) {
          this.FEdit.SetSelStart(this.FEdit.GetText().length);
          this.FEdit.SetSelLength(0);
          this.ClearFilter();
        };
        this.UpdatePickerContent();
        this.DropDown();
        return;
      };
      if (this.FAutoComplete) {
        if (kch === "\x00") return;
        if (this.FEdit.GetSelLength() === this.FEdit.GetText().length) this.FPrevString = "";
        this.FPrevString = this.FPrevString + kch;
        if (this.FPrevString.length < this.FAutoCompleteNumChar) return;
        this.UpdateListBoxLookup(this.FPrevString);
        fi.$assign(this.LookupItem(this.FPrevString));
        if (fi.ItemIndex >= 0) {
          this.NotifyDataBinderEdit();
          this.SetItemIndex(fi.ItemIndex);
          this.NotifyDataBinderValueChanged();
          selPos = this.FPrevString.length;
          this.SetContent(fi.ItemText);
          this.FEdit.SetSelStart(selPos);
          selLen = this.FEdit.GetText().length - selPos;
          this.FEdit.SetSelLength(selLen);
          EatKey();
          if (this.FAutoCloseUp && (selLen === 0) && this.GetPopup().FIsOpen) this.DropDown();
        };
      };
    };
    this.KeyPress = function (Key) {
      var fi = $mod.TTMSFNCControlPickerFilterItem.$new();
      var kch = "\x00";
      var tick = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBase.KeyPress.apply(this,arguments);
      if (!(this.FControl != null)) return;
      kch = Key.get();
      if (this.FKeyDown$1 === 27) {
        if (this.GetPopup().FIsOpen) ;
        this.DropDown();
        return;
      };
      if (this.FAutoComplete) {
        if (this.FKeyDown$1 === 8) {
          pas.System.Delete({p: this, get: function () {
              return this.p.FPrevString;
            }, set: function (v) {
              this.p.FPrevString = v;
            }},this.FPrevString.length,1);
          if ((this.FPrevString.length === 1) && this.GetPopup().FIsOpen) {
            this.DropDown();
            this.ClearFilter();
          };
          return;
        };
        if (kch === "\x00") return;
        if (this.FAutoDropDown && !this.GetPopup().FIsOpen) this.DropDown();
        tick = this.FAutoCompleteDelay;
        if (($impl.GetTickCountX() - this.FTick) < tick) {
          this.FPrevString = this.FPrevString + kch}
         else {
          this.FTick = $impl.GetTickCountX();
          this.FPrevString = kch;
        };
      } else {
        if (kch === "\x00") return;
        this.FPrevString = kch;
      };
      fi.$assign(this.LookupItem(this.FPrevString));
      if (fi.ItemIndex >= 0) {
        this.NotifyDataBinderEdit();
        this.SetItemIndex(fi.ItemIndex);
        this.NotifyDataBinderValueChanged();
        this.SetContent(fi.ItemText);
        this.Invalidate();
        if (this.FAutoComplete && (this.GetContent() === this.FPrevString) && this.FAutoCloseUp && this.GetPopup().FIsOpen) this.DropDown();
      };
    };
    this.KeyDown = function (Key, Shift) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBase.KeyDown.apply(this,arguments);
      this.FKeyDown$1 = Key.get();
    };
    this.CreateSelector = function () {
      var Result = null;
      this.FWrapper = pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelector.$create("Create$1",[this]);
      if (this.FControl != null) {
        this.FControl.SetParent(this.FWrapper);
        this.UpdatePickerContent();
      };
      Result = this.FWrapper;
      return Result;
    };
    this.GetVisibleItemCount = function () {
      var Result = 0;
      var pi = null;
      var pf = null;
      var $ir = rtl.createIntfRefs();
      try {
        Result = 0;
        if (this.FControl != null) {
          if (pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCControlPickerItems),{get: function () {
              return pi;
            }, set: function (v) {
              pi = v;
            }})) {
            Result = pi.PickerGetVisibleItemCount()}
           else if (pas.SysUtils.Supports$1($ir.ref(2,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCControlPickerFull),{get: function () {
              return pf;
            }, set: function (v) {
              pf = v;
            }})) {
            Result = pf.PickerGetVisibleItemCount()}
           else Result = 1;
        };
      } finally {
        $ir.free();
        rtl._Release(pi);
        rtl._Release(pf);
      };
      return Result;
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomPicker"].TTMSFNCCustomPicker.Create$1.apply(this,arguments);
      this.SetWidth(150);
      this.FDropDownControlWidth = this.GetWidth();
      this.FDropDownControlHeight = 150;
      this.SetEditable(true);
      this.FPrevString = "";
      this.FAutoComplete = true;
      this.FAutoCloseUp = false;
      this.FAutoDropDown = false;
      this.FCaseSensitive = false;
      this.FAutoCompleteNumChar = 2;
      this.FAutoCompleteDelay = 500;
      this.FFont$2 = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FFont$2.FOnChanged = rtl.createCallback(this,"FontChange");
      this.FEdit.FOnKeyDown = rtl.createCallback(this,"EditKeyDown$1");
      this.FEdit.FOnKeyPress = rtl.createCallback(this,"EditKeyPress$1");
      this.FEdit.FFont.Assign(this.FFont$2);
      this.GetPopup().FFocusedControl = this.FEdit;
      this.GetPopup().FStaysOpen = true;
      this.FDropDownHeightMode = $mod.TTMSFNCControlPickerDropDownHeightMode.chmDropDownHeight;
      this.FDropDownWidthMode = $mod.TTMSFNCControlPickerDropDownWidthMode.cwmDropDownWidth;
      if (this.IsDesignTime()) this.SetText("TTMSFNCControlPicker");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FFont$2");
      pas["WEBLib.TMSFNCCustomPicker"].TTMSFNCCustomPicker.Destroy.call(this);
    };
    this.CallItemClicked = function (AItemIndex) {
      this.UpdatePickerContent();
      this.ClearFilter();
      this.NotifyDataBinderEdit();
      this.SetItemIndex(AItemIndex);
      this.NotifyDataBinderValueChanged();
      this.DropDown();
      this.Invalidate();
    };
    this.UpdatePickerContent = function () {
      var pb = null;
      var pi = null;
      var pf = null;
      var txt = "";
      var a = false;
      var $ir = rtl.createIntfRefs();
      try {
        txt = this.GetContent();
        if (pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCControlPickerBase),{get: function () {
            return pb;
          }, set: function (v) {
            pb = v;
          }})) {
          txt = pb.PickerGetContent()}
         else if (pas.SysUtils.Supports$1($ir.ref(2,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCControlPickerItems),{get: function () {
            return pi;
          }, set: function (v) {
            pi = v;
          }})) {
          txt = pi.PickerGetContent()}
         else if (pas.SysUtils.Supports$1($ir.ref(3,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCControlPickerFull),{get: function () {
            return pf;
          }, set: function (v) {
            pf = v;
          }})) txt = pf.PickerGetContent();
        a = true;
        this.DoSetContent({get: function () {
            return txt;
          }, set: function (v) {
            txt = v;
          }},{get: function () {
            return a;
          }, set: function (v) {
            a = v;
          }});
        if (a) this.SetContent(txt);
      } finally {
        $ir.free();
        rtl._Release(pb);
        rtl._Release(pi);
        rtl._Release(pf);
      };
    };
    this.UpdatePickerDropDownSize = function () {
      this.AdjustDropDownHeight();
      this.AdjustDropDownWidth();
    };
    this.UpdateDropDown = function () {
      this.UpdatePickerContent();
      this.DropDown();
      this.Invalidate();
    };
    this.DropDown = function () {
      this.AdjustDropDownHeight();
      this.AdjustDropDownWidth();
      this.GetPopup().SetWidth(Math.round(this.FDropDownWidth));
      this.GetPopup().SetHeight(Math.round(this.FDropDownHeight));
      pas["WEBLib.TMSFNCCustomPicker"].TTMSFNCCustomPicker.DropDown.call(this);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCControlPicker",this.TTMSFNCCustomControlPicker,function () {
    this.RegisterRuntimeClasses = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClass($mod.TTMSFNCControlPicker);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("AutoCloseUp",2,rtl.boolean,"FAutoCloseUp","SetAutoCloseUp",4,{Default: false});
    $r.addProperty("AutoDropDown",2,rtl.boolean,"FAutoDropDown","SetAutoDropDown",4,{Default: false});
    $r.addProperty("AutoComplete",2,rtl.boolean,"FAutoComplete","SetAutoComplete",4,{Default: true});
    $r.addProperty("AutoCompleteDelay",2,rtl.longint,"FAutoCompleteDelay","SetAutoCompleteDelay",4,{Default: 500});
    $r.addProperty("AutoCompleteNumChar",2,rtl.longint,"FAutoCompleteNumChar","SetAutoCompleteNumChar",4,{Default: 2});
    $r.addProperty("Control",2,pas["WEBLib.Controls"].$rtti["TControl"],"FControl","SetControl");
    $r.addProperty("CaseSensitive",2,rtl.boolean,"FCaseSensitive","SetCaseSensitive",4,{Default: false});
    $r.addProperty("DropDownControlHeight",2,rtl.double,"FDropDownControlHeight","SetDropDownControlHeight");
    $r.addProperty("DropDownControlWidth",2,rtl.double,"FDropDownControlWidth","SetDropDownControlWidth");
    $r.addProperty("DropDownHeightMode",2,$mod.$rtti["TTMSFNCControlPickerDropDownHeightMode"],"FDropDownHeightMode","SetDropDownHeightMode",4,{Default: $mod.TTMSFNCControlPickerDropDownHeightMode.chmDropDownHeight});
    $r.addProperty("DropDownWidthMode",2,$mod.$rtti["TTMSFNCControlPickerDropDownWidthMode"],"FDropDownWidthMode","SetDropDownWidthMode",4,{Default: $mod.TTMSFNCControlPickerDropDownWidthMode.cwmDropDownWidth});
    $r.addProperty("Font",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FFont$2","SetFnt$1");
    $r.addProperty("ItemIndex",3,rtl.longint,"GetItemIndex","SetItemIndex",4,{Default: -1});
    $r.addProperty("ItemHeight",3,rtl.double,"GetItemHeight","SetItemHeight");
    $r.addProperty("ItemWidth",3,rtl.double,"GetItemWidth","SetItemWidth");
    $r.addProperty("ShowFocus",2,rtl.boolean,"FShowFocus$1","SetShowFocus$1",4,{Default: true});
    $r.addProperty("Style",2,$mod.$rtti["TTMSFNCControlPickerStyle"],"FStyle","SetStyle",4,{Default: $mod.TTMSFNCControlPickerStyle.csDropDown});
    $r.addProperty("Text",3,rtl.string,"GetText","SetText");
    $r.addProperty("OnAdjustDropDownHeight",0,$mod.$rtti["TTMSFNCCustomControlPickerOnAdjustDropDownSizeEvent"],"FOnAdjustDropDownHeight","FOnAdjustDropDownHeight");
    $r.addProperty("OnAdjustDropDownWidth",0,$mod.$rtti["TTMSFNCCustomControlPickerOnAdjustDropDownSizeEvent"],"FOnAdjustDropDownWidth","FOnAdjustDropDownWidth");
    $r.addProperty("OnAfterDrawPickerContent",0,$mod.$rtti["TTMSFNCCustomControlPickerAfterDrawContentEvent"],"FOnAfterDrawPickerContent","FOnAfterDrawPickerContent");
    $r.addProperty("OnBeforeDrawPickerContent",0,$mod.$rtti["TTMSFNCCustomControlPickerBeforeDrawContentEvent"],"FOnBeforeDrawPickerContent","FOnBeforeDrawPickerContent");
    $r.addProperty("OnItemSelected",0,$mod.$rtti["TTMSFNCCustomControlPickerItemSelectedEvent"],"FOnItemSelected$1","FOnItemSelected$1");
    $r.addProperty("OnSetContent",0,$mod.$rtti["TTMSFNCCustomControlPickerOnSetContentEvent"],"FOnSetContent","FOnSetContent");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
  $mod.$implcode = function () {
    $impl.GetTickCountX = function () {
      var Result = 0;
      var h = 0;
      var m = 0;
      var s = 0;
      var ms = 0;
      pas.SysUtils.DecodeTime(pas.SysUtils.Now(),{get: function () {
          return h;
        }, set: function (v) {
          h = v;
        }},{get: function () {
          return m;
        }, set: function (v) {
          m = v;
        }},{get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},{get: function () {
          return ms;
        }, set: function (v) {
          ms = v;
        }});
      Result = ms + (s * 1000) + (m * 60 * 1000) + (h * 60 * 60 * 1000);
      return Result;
    };
    rtl.createClass($impl,"TControlOpen",pas["WEBLib.Controls"].TControl,function () {
      rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
      rtl.addIntf(this,pas.System.IUnknown);
    });
  };
},["Math","SysUtils","WEBLib.Graphics","WEBLib.TMSFNCStyles","WEBLib.TMSFNCUtils","WEBLib.StdCtrls"]);
rtl.module("WEBLib.TMSFNCTreeView",["System","Classes","WEBLib.TMSFNCCustomTreeView","WEBLib.TMSFNCGraphics","WEBLib.TMSFNCTreeViewData","WEBLib.TMSFNCTypes","WEBLib.TMSFNCGraphicsTypes","WEBLib.TMSFNCControlPicker"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  rtl.createClass(this,"TTMSFNCTreeView",pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCTreeViewPublished,function () {
    this.RegisterRuntimeClasses = function () {
      pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCCustomTreeView.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClasses([$mod.TTMSFNCTreeView,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewColumn,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNode,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeValue]);
    };
    this.DoAfterSelectNode = function (ANode) {
      pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCCustomTreeView.DoAfterSelectNode.apply(this,arguments);
      if ((this.FParent != null) && pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelector.isPrototypeOf(this.FParent) && (this.FParent.FOwner != null) && pas["WEBLib.TMSFNCControlPicker"].TTMSFNCControlPicker.isPrototypeOf(this.FParent.FOwner)) {
        rtl.as(this.FParent.FOwner,pas["WEBLib.TMSFNCControlPicker"].TTMSFNCControlPicker).UpdateDropDown();
      };
    };
    this.DrawBorders = function (AGraphics) {
      var rrt = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rrb = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var trl = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var grt = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var grb = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var nr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCCustomTreeView.DrawBorders.apply(this,arguments);
      grt.$assign(this.GetGroupsTopRect());
      grb.$assign(this.GetGroupsBottomRect());
      rrt.$assign(this.GetColumnsTopRect());
      rrb.$assign(this.GetColumnsBottomRect());
      nr.$assign(this.GetContentClipRect());
      trl.$assign(pas["WEBLib.TMSFNCTypes"].RectF(nr.Right + 1,rrt.Bottom,nr.Right + 1,rrb.Top));
      AGraphics.FStroke.Assign(this.FColumnsAppearance.FTopStroke);
      if (((trl.Right - trl.Left) > 0) && ((trl.Bottom - trl.Top) > 0)) {
        if (this.HorizontalScrollBar().FVisible || this.FColumnsAppearance.FStretch) {
          AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(trl.Right,trl.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(trl.Right,trl.Bottom)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmLeftDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmLeftUp)}
         else AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(trl.Right,trl.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(trl.Right,trl.Bottom)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightUp);
      };
      if (this.HorizontalScrollBar().FVisible || this.FColumnsAppearance.FStretch) {
        AGraphics.FStroke.Assign(this.FColumnsAppearance.FTopStroke);
        if ((pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCTreeViewColumnsLayout.tclTop in this.FColumnsAppearance.FLayouts) && (this.FColumnsAppearance.FTopSize > 0)) {
          AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(rrt.Left,rrt.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(rrt.Left,rrt.Bottom)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightUp);
          AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(rrt.Right,rrt.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(rrt.Right,rrt.Bottom)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmLeftDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmLeftUp);
        } else if (!((pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCTreeViewGroupLayout.tglTop in this.FGroupsAppearance.FLayouts) || (this.FGroupsAppearance.FTopSize <= 0) || (this.FDisplayGroups.GetCount() === 0)) && (this.FStroke.FKind !== pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone)) AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(rrt.Left,rrt.Bottom)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(rrt.Right,rrt.Bottom)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmLeftDown);
        AGraphics.FStroke.Assign(this.FColumnsAppearance.FBottomStroke);
        if ((pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCTreeViewColumnsLayout.tclBottom in this.FColumnsAppearance.FLayouts) && (this.FColumnsAppearance.FBottomSize > 0)) {
          AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(rrb.Left,rrb.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(rrb.Left,rrb.Bottom)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightUp);
          AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(rrb.Right,rrb.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(rrb.Right,rrb.Bottom)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmLeftDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmLeftUp);
        } else if ((!(pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCTreeViewGroupLayout.tglBottom in this.FGroupsAppearance.FLayouts) || (this.FGroupsAppearance.FBottomSize <= 0) || (this.FDisplayGroups.GetCount() === 0)) && (this.FStroke.FKind !== pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone)) AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(rrb.Left,rrb.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(rrb.Right,rrb.Top)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightUp,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmLeftUp);
        AGraphics.FStroke.Assign(this.FGroupsAppearance.FTopStroke);
        if ((pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCTreeViewGroupLayout.tglTop in this.FGroupsAppearance.FLayouts) && (this.FDisplayGroups.GetCount() > 0) && (this.FGroupsAppearance.FTopSize > 0)) {
          AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(grt.Left,grt.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(grt.Left,grt.Bottom)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightUp);
          AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(grt.Right,grt.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(grt.Right,grt.Bottom)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmLeftDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmLeftUp);
        };
        if ((!(pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCTreeViewColumnsLayout.tclTop in this.FColumnsAppearance.FLayouts) || (this.FColumnsAppearance.FTopSize <= 0)) && (this.FStroke.FKind !== pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone)) AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(grt.Left,grt.Bottom)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(grt.Right,grt.Bottom)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmLeftDown);
        AGraphics.FStroke.Assign(this.FGroupsAppearance.FBottomStroke);
        if ((pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCTreeViewGroupLayout.tglBottom in this.FGroupsAppearance.FLayouts) && (this.FDisplayGroups.GetCount() > 0) && (this.FGroupsAppearance.FBottomSize > 0)) {
          AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(grb.Left,grb.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(grb.Left,grb.Bottom)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightUp);
          AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(grb.Right,grb.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(grb.Right,grb.Bottom)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmLeftDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmLeftUp);
        };
        if ((!(pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCTreeViewColumnsLayout.tclBottom in this.FColumnsAppearance.FLayouts) || (this.FColumnsAppearance.FBottomSize <= 0)) && (this.FStroke.FKind !== pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone)) AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(grb.Left,grb.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(grb.Right,grb.Top)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightUp,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmLeftUp);
      };
    };
    this.DrawEmptySpaces = function (AGraphics) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var b = false;
      var df = false;
      pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCCustomTreeView.DrawEmptySpaces.apply(this,arguments);
      if (this.FColumnsAppearance.FFillEmptySpaces && !this.FStretchScrollBars) {
        if ((pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCTreeViewColumnsLayout.tclTop in this.FColumnsAppearance.FLayouts) && (this.FColumnsAppearance.FTopSize > 0)) {
          r.$assign(this.GetColumnTopRightEmptyRect());
          b = true;
          df = true;
          AGraphics.FFill.Assign(this.FColumnsAppearance.FTopFill);
          AGraphics.FStroke.Assign(this.FColumnsAppearance.FTopStroke);
          this.DoBeforeDrawColumnEmptySpace(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCTreeViewColumnEmptySpace.tcesTopRight,{get: function () {
              return b;
            }, set: function (v) {
              b = v;
            }},{get: function () {
              return df;
            }, set: function (v) {
              df = v;
            }});
          if (b) {
            if (df) AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShiftDownAndExpandWidth);
            this.DoAfterDrawColumnEmptySpace(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCTreeViewColumnEmptySpace.tcesTopRight);
          };
        };
        if ((pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCTreeViewColumnsLayout.tclBottom in this.FColumnsAppearance.FLayouts) && (this.FColumnsAppearance.FBottomSize > 0)) {
          r.$assign(this.GetColumnBottomRightEmptyRect());
          b = true;
          df = true;
          AGraphics.FFill.Assign(this.FColumnsAppearance.FBottomFill);
          AGraphics.FStroke.Assign(this.FColumnsAppearance.FBottomStroke);
          this.DoBeforeDrawColumnEmptySpace(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCTreeViewColumnEmptySpace.tcesBottomRight,{get: function () {
              return b;
            }, set: function (v) {
              b = v;
            }},{get: function () {
              return df;
            }, set: function (v) {
              df = v;
            }});
          if (b) {
            if (df) AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShiftUpAndExpandWidth);
            this.DoAfterDrawColumnEmptySpace(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCTreeViewColumnEmptySpace.tcesBottomRight);
          };
        };
      };
      if (this.FGroupsAppearance.FFillEmptySpaces && !this.FStretchScrollBars) {
        if ((pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCTreeViewGroupLayout.tglTop in this.FGroupsAppearance.FLayouts) && (this.FGroupsAppearance.FTopSize > 0)) {
          r.$assign(this.GetGroupTopRightEmptyRect());
          b = true;
          df = true;
          AGraphics.FFill.Assign(this.FGroupsAppearance.FTopFill);
          AGraphics.FStroke.Assign(this.FGroupsAppearance.FTopStroke);
          this.DoBeforeDrawGroupEmptySpace(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCTreeViewGroupEmptySpace.tgesTopRight,{get: function () {
              return b;
            }, set: function (v) {
              b = v;
            }},{get: function () {
              return df;
            }, set: function (v) {
              df = v;
            }});
          if (b) {
            if (df) AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShiftLeftDown);
            this.DoAfterDrawGroupEmptySpace(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCTreeViewGroupEmptySpace.tgesTopRight);
          };
        };
        if ((pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCTreeViewGroupLayout.tglBottom in this.FGroupsAppearance.FLayouts) && (this.FGroupsAppearance.FBottomSize > 0)) {
          r.$assign(this.GetGroupBottomRightEmptyRect());
          b = true;
          df = true;
          AGraphics.FFill.Assign(this.FGroupsAppearance.FBottomFill);
          AGraphics.FStroke.Assign(this.FGroupsAppearance.FBottomStroke);
          this.DoBeforeDrawGroupEmptySpace(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCTreeViewGroupEmptySpace.tgesBottomRight,{get: function () {
              return b;
            }, set: function (v) {
              b = v;
            }},{get: function () {
              return df;
            }, set: function (v) {
              df = v;
            }});
          if (b) {
            if (df) AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShiftLeftUp);
            this.DoAfterDrawGroupEmptySpace(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCTreeViewGroupEmptySpace.tgesBottomRight);
          };
        };
      };
    };
    this.DrawNodeColumns = function (AGraphics) {
      var b = false;
      var df = false;
      var I = 0;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var x = 0.0;
      var w = 0.0;
      var cr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var crcl = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var hs = 0.0;
      var c = null;
      pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCCustomTreeView.DrawNodeColumns.apply(this,arguments);
      cr.$assign(this.GetContentRect());
      crcl.$assign(this.GetContentClipRect());
      hs = this.GetHorizontalScrollPosition();
      for (var $l = 1, $end = this.FColumnCount - 1; $l <= $end; $l++) {
        I = $l;
        if ((I >= 0) && (I < (this.FColumns.GetCount() - 1))) {
          x = pas.System.Int(this.GetColPos(I)) - pas.System.Int(hs);
          w = pas.System.Int(this.GetColWidths(I));
          if ((this.FColumnStroke.FColor !== -1) && (this.FColumnStroke.FKind !== pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone)) {
            AGraphics.FStroke.Assign(this.FColumnStroke);
            b = true;
            df = true;
            r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(x,cr.Top,x + w,cr.Bottom));
            this.DoBeforeDrawColumn(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),I,{get: function () {
                return b;
              }, set: function (v) {
                b = v;
              }},{get: function () {
                return df;
              }, set: function (v) {
                df = v;
              }});
            if (b) {
              if (df) AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShiftRightAndShrinkHeight);
              this.DoAfterDrawColumn(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),I);
            };
          };
        };
      };
      if (this.FNodeStructure.GetCount() > 0) {
        for (var $l1 = 0, $end1 = this.FColumnCount - 1; $l1 <= $end1; $l1++) {
          I = $l1;
          if ((I >= 0) && (I <= (this.FColumns.GetCount() - 1))) {
            c = this.FColumns.GetItem$1(I);
            x = pas.System.Int(this.GetColPos(I)) - pas.System.Int(hs);
            w = pas.System.Int(this.GetColWidths(I));
            b = true;
            df = true;
            AGraphics.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
            AGraphics.FStroke.Assign(this.FNodesAppearance.FColumnStroke);
            if (!c.FUseDefaultAppearance) {
              AGraphics.FStroke.Assign(c.FStroke);
              AGraphics.FFill.Assign(c.FFill);
            };
            r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(x,crcl.Top,x + w,crcl.Bottom));
            this.DoBeforeDrawNodeColumn(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),I,{get: function () {
                return b;
              }, set: function (v) {
                b = v;
              }},{get: function () {
                return df;
              }, set: function (v) {
                df = v;
              }});
            if (b) {
              if (df) AGraphics.DrawRectangle$3(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsTop,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsRight,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsBottom),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShiftRightAndShrinkHeight);
              this.DoAfterDrawNodeColumn(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),I);
            };
          };
        };
      };
    };
    this.DrawNode = function (AGraphics, ARect, ANode, ACaching, AOffsetX, AOffsetY) {
      var str = "";
      var b = false;
      var df = false;
      var txtr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var titr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var I = 0;
      var bmp = null;
      var bmpnr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var extr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var AColor = 0;
      var AStrokeColor = 0;
      var sts = 0;
      var stp = 0;
      var bmpn = null;
      var ha = 0;
      var va = 0;
      var c = null;
      var ww = false;
      var trim = 0;
      var en = false;
      var colw = 0.0;
      var chk = 0;
      var chkr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var chkbmp = null;
      var ck = false;
      var ext = false;
      var lr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var dr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var bmpexr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var dexr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var sel = false;
      var cl = null;
      var rfoc = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var p = null;
      var lp = null;
      var n = null;
      var rsel = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var ns = 0.0;
      var dpi = false;
      var g = null;
      var bmpa = null;
      var bt = null;
      var s = {};
      var ro = 0;
      var corners = {};
      pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCCustomTreeView.DrawNode.apply(this,arguments);
      if (!(ANode != null) || ((this.FDragNode === ANode) && this.FDragModeStarted)) return;
      dpi = this.FResourceScaleFactor > 1.0;
      en = true;
      this.DoIsNodeEnabled(ANode,{get: function () {
          return en;
        }, set: function (v) {
          en = v;
        }});
      ext = false;
      this.DoIsNodeExtended(ANode,{get: function () {
          return ext;
        }, set: function (v) {
          ext = v;
        }});
      sel = this.IsVirtualNodeSelected(ANode);
      if (en) {
        if (sel) {
          if (ext) {
            AGraphics.FFill.Assign(this.FNodesAppearance.FExtendedSelectedFill);
            AGraphics.FStroke.Assign(this.FNodesAppearance.FExtendedSelectedStroke);
          } else {
            AGraphics.FFill.Assign(this.FNodesAppearance.FSelectedFill);
            AGraphics.FStroke.Assign(this.FNodesAppearance.FSelectedStroke);
          };
          AColor = AGraphics.FFill.FColor;
          AStrokeColor = AGraphics.FStroke.FColor;
          this.DoGetNodeSelectedColor(ANode,{get: function () {
              return AColor;
            }, set: function (v) {
              AColor = v;
            }});
          this.DoGetNodeSelectedStrokeColor(ANode,{get: function () {
              return AStrokeColor;
            }, set: function (v) {
              AStrokeColor = v;
            }});
          AGraphics.FFill.SetColor(AColor);
          AGraphics.FStroke.SetColor(AStrokeColor);
        } else {
          if (ext) {
            AGraphics.FFill.Assign(this.FNodesAppearance.FExtendedFill);
            AGraphics.FStroke.Assign(this.FNodesAppearance.FExtendedStroke);
          } else {
            AGraphics.FFill.Assign(this.FNodesAppearance.FFill);
            AGraphics.FStroke.Assign(this.FNodesAppearance.FStroke);
          };
          AColor = AGraphics.FFill.FColor;
          AStrokeColor = AGraphics.FStroke.FColor;
          this.DoGetNodeColor(ANode,{get: function () {
              return AColor;
            }, set: function (v) {
              AColor = v;
            }});
          this.DoGetNodeStrokeColor(ANode,{get: function () {
              return AStrokeColor;
            }, set: function (v) {
              AStrokeColor = v;
            }});
          AGraphics.FFill.SetColor(AColor);
          AGraphics.FStroke.SetColor(AStrokeColor);
        };
      } else {
        if (ext) {
          AGraphics.FFill.Assign(this.FNodesAppearance.FExtendedDisabledFill);
          AGraphics.FStroke.Assign(this.FNodesAppearance.FExtendedDisabledStroke);
        } else {
          AGraphics.FFill.Assign(this.FNodesAppearance.FDisabledFill);
          AGraphics.FStroke.Assign(this.FNodesAppearance.FDisabledStroke);
        };
        AColor = AGraphics.FFill.FColor;
        AStrokeColor = AGraphics.FStroke.FColor;
        this.DoGetNodeDisabledColor(ANode,{get: function () {
            return AColor;
          }, set: function (v) {
            AColor = v;
          }});
        this.DoGetNodeDisabledStrokeColor(ANode,{get: function () {
            return AStrokeColor;
          }, set: function (v) {
            AStrokeColor = v;
          }});
        AGraphics.FFill.SetColor(AColor);
        AGraphics.FStroke.SetColor(AStrokeColor);
      };
      df = true;
      b = true;
      this.DoBeforeDrawNode(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),ANode,{get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }},{get: function () {
          return df;
        }, set: function (v) {
          df = v;
        }});
      if (b) {
        if (df) {
          rsel.$assign(ARect);
          if (sel && !ext) {
            var $tmp = this.FNodesAppearance.FSelectionArea;
            if ($tmp === pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCTreeViewSelectionArea.tsaFull) {
              if ((this.FStroke.FKind !== pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone) && (this.FStroke.FColor !== -1)) {
                rsel.Left = 1}
               else rsel.Left = 0;
            } else if ($tmp === pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCTreeViewSelectionArea.tsaFromText) {
              if (rtl.length(ANode.FTextRects) > 0) rsel.Left = ANode.FTextRects[0].Left;
            };
          };
          s = rtl.refSet(pas["WEBLib.TMSFNCGraphicsTypes"].AllSides);
          ro = 0;
          corners = rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight);
          this.DoGetNodeSides(ANode,{get: function () {
              return s;
            }, set: function (v) {
              s = v;
            }});
          this.DoGetNodeRounding(ANode,{get: function () {
              return ro;
            }, set: function (v) {
              ro = v;
            }},{get: function () {
              return corners;
            }, set: function (v) {
              corners = v;
            }});
          if (ro > 0) {
            ro = Math.min(pas.System.Trunc(Math.min(rsel.Right - rsel.Left,rsel.Bottom - rsel.Top) / 2),ro);
            AGraphics.DrawRoundRectangle$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rsel),ro,rtl.refSet(corners),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmNone);
          } else AGraphics.DrawRectangle$3(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rsel),rtl.refSet(s),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmNone);
          if ((ANode === this.GetFocusedVirtualNode()) && this.IsFocused() && this.FNodesAppearance.FShowFocus) {
            rfoc.$assign(rsel);
            pas["WEBLib.TMSFNCTypes"].InflateRectEx(rfoc,this.ScalePaintValue(-2),this.ScalePaintValue(-2));
            AGraphics.DrawFocusRectangle$3(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rfoc),0,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
          };
        };
        if (!this.FCompactMode) {
          sts = this.GetFirstVisibleColumn();
          stp = this.GetLastVisibleColumn();
          if (ext) stp = Math.min(sts,stp);
          for (var $l = sts, $end = stp; $l <= $end; $l++) {
            I = $l;
            cl = null;
            if ((I >= 0) && (I <= (this.FColumns.GetCount() - 1))) cl = this.FColumns.GetItem$1(I);
            if (((I - sts) >= 0) && ((I - sts) <= (rtl.length(ANode.FExpandRects) - 1)) && this.FNodesAppearance.FShowLines && (I === this.FNodesAppearance.FExpandColumn) && (this.FNodesAppearance.FExpandWidth > 0)) {
              r.$assign(ANode.FExpandRects[I - sts]);
              pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(r,AOffsetX,AOffsetY);
              AGraphics.FStroke.Assign(this.FNodesAppearance.FLineStroke);
              if (this.FNodesAppearance.FLineStroke.FKind in rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskDash,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskDot,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskDashDot,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskDashDotDot)) AGraphics.StartSpecialPen();
              ns = this.FNodesAppearance.FLevelIndent;
              lr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + (this.FNodesAppearance.FExpandWidth / 2),ARect.Top,r.Left + (this.FNodesAppearance.FExpandWidth / 2) + (ns / 2),ARect.Bottom));
              AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(lr.Left,lr.Top + ((lr.Bottom - lr.Top) / 2))),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(lr.Right,lr.Top + ((lr.Bottom - lr.Top) / 2))),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
              if (this.FVisibleNodes.GetCount() > 1) {
                n = ANode;
                p = n.GetParent();
                dr.$assign(lr);
                while (p != null) {
                  if (((n === ANode) && (n.FIndex <= (p.FChildren - 1))) || ((n !== ANode) && (n.FIndex < (p.FChildren - 1)))) {
                    if (n.FIndex < (p.FChildren - 1)) {
                      AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(dr.Left,dr.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(dr.Left,dr.Bottom)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightUp)}
                     else AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(dr.Left,dr.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(dr.Left,dr.Top + ((dr.Bottom - dr.Top) / 2))),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightUp);
                  };
                  n = p;
                  p = n.GetParent();
                  pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(dr,-ns,0);
                };
                if ((this.FNodeStructure.GetCount() - ANode.FTotalChildren - 1) > 0) {
                  p = ANode.GetParent();
                  if (!(p != null)) {
                    if (ANode.FRow === (this.FNodeStructure.GetCount() - ANode.FTotalChildren - 1)) {
                      AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(dr.Left,dr.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(dr.Left,dr.Top + ((dr.Bottom - dr.Top) / 2))),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightUp);
                    } else if (ANode.FRow === 0) {
                      AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(dr.Left,dr.Top + ((dr.Bottom - dr.Top) / 2))),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(dr.Left,pas.System.Int(dr.Bottom) - 0.5)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightUp);
                    } else AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(dr.Left,dr.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(dr.Left,dr.Bottom)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightUp);
                  } else if (p != null) {
                    lp = p;
                    p = p.GetParent();
                    dr.$assign(lr);
                    pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(dr,-ns,0);
                    while (p != null) {
                      lp = p;
                      p = p.GetParent();
                      pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(dr,-ns,0);
                    };
                    if ((lp != null) && (lp.FRow < (this.FNodeStructure.GetCount() - lp.FTotalChildren - 1))) AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(dr.Left,dr.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(dr.Left,dr.Bottom)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightUp);
                  };
                };
              };
              if (this.FNodesAppearance.FLineStroke.FKind in rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskDash,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskDot,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskDashDot,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskDashDotDot)) AGraphics.StopSpecialPen();
            };
            if ((cl != null) && !cl.FUseDefaultAppearance && !ext) {
              AGraphics.FFont.Assign(cl.FFont)}
             else {
              if (ext) {
                AGraphics.FFont.Assign(this.FNodesAppearance.FExtendedFont)}
               else AGraphics.FFont.Assign(this.FNodesAppearance.FFont);
            };
            colw = this.GetColWidths(I);
            if ((colw > 0) || ext) {
              if (en) {
                if (sel) {
                  if (ext) {
                    AColor = this.FNodesAppearance.FExtendedSelectedFontColor}
                   else AColor = this.FNodesAppearance.FSelectedFontColor;
                  this.DoGetNodeSelectedTextColor(ANode,I,{get: function () {
                      return AColor;
                    }, set: function (v) {
                      AColor = v;
                    }});
                  AGraphics.FFont.SetColor(AColor);
                } else {
                  if ((cl != null) && !cl.FUseDefaultAppearance && !ext) {
                    AColor = cl.FFont.FColor}
                   else {
                    if (ext) {
                      AColor = this.FNodesAppearance.FExtendedFontColor}
                     else AColor = this.FNodesAppearance.FFont.FColor;
                  };
                  this.DoGetNodeTextColor(ANode,I,{get: function () {
                      return AColor;
                    }, set: function (v) {
                      AColor = v;
                    }});
                  AGraphics.FFont.SetColor(AColor);
                };
              } else {
                if (ext) {
                  AColor = this.FNodesAppearance.FExtendedDisabledFontColor}
                 else AColor = this.FNodesAppearance.FDisabledFontColor;
                this.DoGetNodeDisabledTextColor(ANode,I,{get: function () {
                    return AColor;
                  }, set: function (v) {
                    AColor = v;
                  }});
                AGraphics.FFont.SetColor(AColor);
              };
              if (((I - sts) >= 0) && ((I - sts) <= (rtl.length(ANode.FCheckRects) - 1)) && ((I - sts) <= (rtl.length(ANode.FCheckStates) - 1))) {
                chk = pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeCheckType.tvntNone;
                this.DoGetNodeCheckType(ANode,I,{get: function () {
                    return chk;
                  }, set: function (v) {
                    chk = v;
                  }});
                if (chk !== pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeCheckType.tvntNone) {
                  chkbmp = null;
                  ck = ANode.FCheckStates[I - sts];
                  this.DoIsNodeChecked(ANode,I,{get: function () {
                      return ck;
                    }, set: function (v) {
                      ck = v;
                    }});
                  var $tmp1 = chk;
                  if ($tmp1 === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeCheckType.tvntCheckBox) {
                    chkbmp = this.GetCheckBoxBitmap(ck,false,true)}
                   else if ($tmp1 === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeCheckType.tvntRadioButton) chkbmp = this.GetRadioButtonBitmap(ck,false,true);
                  if (chkbmp != null) {
                    chkr.$assign(ANode.FCheckRects[I - sts]);
                    pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(chkr,AOffsetX,AOffsetY);
                    b = true;
                    this.DoBeforeDrawNodeCheck(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(chkr),I,ANode,chkbmp,{get: function () {
                        return b;
                      }, set: function (v) {
                        b = v;
                      }});
                    if (b) {
                      AGraphics.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(chkr),chkbmp,true,false,true,false);
                      this.DoAfterDrawNodeCheck(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(chkr),I,ANode,chkbmp);
                    };
                  };
                };
              };
              if (((I - sts) >= 0) && ((I - sts) <= (rtl.length(ANode.FBitmapRects) - 1))) {
                bmpn = null;
                this.DoGetNodeIcon(ANode,I,false,{get: function () {
                    return bmpn;
                  }, set: function (v) {
                    bmpn = v;
                  }});
                if (!(bmpn != null) && dpi) this.DoGetNodeIcon(ANode,I,true,{get: function () {
                    return bmpn;
                  }, set: function (v) {
                    bmpn = v;
                  }});
                if ((bmpn != null) && !pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(bmpn)) {
                  bmpnr.$assign(ANode.FBitmapRects[I - sts]);
                  pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(bmpnr,AOffsetX,AOffsetY);
                  b = true;
                  this.DoBeforeDrawNodeIcon(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(bmpnr),I,ANode,bmpn,{get: function () {
                      return b;
                    }, set: function (v) {
                      b = v;
                    }});
                  if (b) {
                    AGraphics.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(bmpnr),bmpn,true,false,true,false);
                    this.DoAfterDrawNodeIcon(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(bmpnr),I,ANode,bmpn);
                  };
                };
              };
              if (((I - sts) >= 0) && ((I - sts) <= (rtl.length(ANode.FExpandRects) - 1)) && (ANode.FChildren > 0) && (I === this.FNodesAppearance.FExpandColumn) && (this.FNodesAppearance.FExpandWidth > 0)) {
                if (dpi) {
                  if (ANode.FExpanded) {
                    bmp = this.FNodesAppearance.FCollapseNodeIconLarge}
                   else bmp = this.FNodesAppearance.FExpandNodeIconLarge;
                } else {
                  if (ANode.FExpanded) {
                    bmp = this.FNodesAppearance.FCollapseNodeIcon}
                   else bmp = this.FNodesAppearance.FExpandNodeIcon;
                };
                bmpa = null;
                if (this.GetAdaptToStyle()) {
                  bmpa = pas["WEBLib.Graphics"].TBitmap.$create("Create$3");
                  bmpa.SetSize(bmp.GetWidth(),bmp.GetHeight());
                  g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("Create$1",[bmpa.GetCanvas(),false]);
                  try {
                    if (g.BeginScene()) {
                      g.FFill.SetColor(pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultSelectionFillColor);
                      g.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
                      g.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
                      g.FStroke.SetColor(pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultTextFontColor);
                      g.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,bmp.GetWidth(),bmp.GetHeight())),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
                      g.FStroke.SetWidth(this.ScalePaintValue(2));
                      if (!ANode.FExpanded) g.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(rtl.trunc(bmp.GetWidth() / 2),0)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(rtl.trunc(bmp.GetWidth() / 2),bmp.GetHeight())),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
                      g.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(0,rtl.trunc(bmp.GetHeight() / 2))),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(bmp.GetWidth(),rtl.trunc(bmp.GetHeight() / 2))),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
                      g.EndScene();
                    };
                  } finally {
                    g = rtl.freeLoc(g);
                  };
                };
                bmpexr.$assign(ANode.FExpandRects[I - sts]);
                pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(bmpexr,AOffsetX,AOffsetY);
                b = true;
                this.DoBeforeDrawNodeExpand(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(bmpexr),I,ANode,bmp,{get: function () {
                    return b;
                  }, set: function (v) {
                    b = v;
                  }});
                if (b) {
                  if (dpi) {
                    dexr.$assign(bmpexr);
                    pas["WEBLib.TMSFNCTypes"].InflateRectEx(dexr,this.ScalePaintValue(-2),this.ScalePaintValue(-2));
                  } else {
                    dexr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.System.Int(bmpexr.Left + ((bmpexr.Right - bmpexr.Left - bmp.GetWidth()) / 2)),pas.System.Int(bmpexr.Top + ((bmpexr.Bottom - bmpexr.Top - bmp.GetHeight()) / 2)),pas.System.Int(bmpexr.Left + ((bmpexr.Right - bmpexr.Left - bmp.GetWidth()) / 2)) + bmp.GetWidth(),pas.System.Int(bmpexr.Top + ((bmpexr.Bottom - bmpexr.Top - bmp.GetHeight()) / 2)) + bmp.GetHeight()));
                  };
                  if (this.GetAdaptToStyle() && (bmpa != null)) {
                    bt = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
                    try {
                      bt.Assign(bmpa);
                      AGraphics.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(dexr),bt,true,false,true,false);
                    } finally {
                      bt = rtl.freeLoc(bt);
                    };
                    bmpa = rtl.freeLoc(bmpa);
                    bmpa = null;
                  } else {
                    AGraphics.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(dexr),bmp,true,false,true,false);
                  };
                  this.DoAfterDrawNodeExpand(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(bmpexr),I,ANode,bmp);
                };
                if (bmpa != null) bmpa = rtl.freeLoc(bmpa);
              };
              if (((I - sts) >= 0) && ((I - sts) <= (rtl.length(ANode.FTextRects) - 1)) && ANode.GetTitleExpanded(I - sts)) {
                txtr.$assign(ANode.FTextRects[I - sts]);
                pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(txtr,AOffsetX,AOffsetY);
                pas["WEBLib.TMSFNCTypes"].InflateRectEx(txtr,this.ScalePaintValue(-2),0);
                c = null;
                if ((I >= 0) && (I <= (this.FColumns.GetCount() - 1))) c = this.FColumns.GetItem$1(I);
                ha = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading;
                va = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
                ww = false;
                trim = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone;
                if (c != null) {
                  ha = c.FHorizontalTextAlign;
                  va = c.FVerticalTextAlign;
                  ww = c.FWordWrapping;
                  trim = c.FTrimming;
                };
                this.DoGetNodeTrimming(ANode,I,{get: function () {
                    return trim;
                  }, set: function (v) {
                    trim = v;
                  }});
                this.DoGetNodeWordWrapping(ANode,I,{get: function () {
                    return ww;
                  }, set: function (v) {
                    ww = v;
                  }});
                this.DoGetNodeHorizontalTextAlign(ANode,I,{get: function () {
                    return ha;
                  }, set: function (v) {
                    ha = v;
                  }});
                this.DoGetNodeVerticalTextAlign(ANode,I,{get: function () {
                    return va;
                  }, set: function (v) {
                    va = v;
                  }});
                str = "";
                this.DoGetNodeText(ANode,I,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeTextMode.tntmDrawing,{get: function () {
                    return str;
                  }, set: function (v) {
                    str = v;
                  }});
                b = true;
                this.DoBeforeDrawNodeText(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(txtr),I,ANode,str,{get: function () {
                    return b;
                  }, set: function (v) {
                    b = v;
                  }});
                if (b) {
                  if ((this.FInplaceEditorActive && ((this.FUpdateNodeColumn !== I) || (this.GetFocusedVirtualNode() !== ANode))) || !this.FInplaceEditorActive) AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(txtr),str,ww,ha,va,trim,0,-1,-1,true,false,-1,-1);
                  this.DoAfterDrawNodeText(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(txtr),I,ANode,str);
                };
              };
              if ((cl != null) && !cl.FUseDefaultAppearance) {
                AGraphics.FFont.Assign(cl.FTitleFont)}
               else AGraphics.FFont.Assign(this.FNodesAppearance.FTitleFont);
              if (en) {
                if (sel) {
                  AColor = this.FNodesAppearance.FSelectedTitleFontColor;
                  this.DoGetNodeSelectedTitleColor(ANode,I,{get: function () {
                      return AColor;
                    }, set: function (v) {
                      AColor = v;
                    }});
                  AGraphics.FFont.SetColor(AColor);
                } else {
                  if ((cl != null) && !cl.FUseDefaultAppearance) {
                    AColor = cl.FTitleFont.FColor}
                   else AColor = this.FNodesAppearance.FTitleFont.FColor;
                  this.DoGetNodeTitleColor(ANode,I,{get: function () {
                      return AColor;
                    }, set: function (v) {
                      AColor = v;
                    }});
                  AGraphics.FFont.SetColor(AColor);
                };
              } else {
                AColor = this.FNodesAppearance.FDisabledTitleFontColor;
                this.DoGetNodeDisabledTitleColor(ANode,I,{get: function () {
                    return AColor;
                  }, set: function (v) {
                    AColor = v;
                  }});
                AGraphics.FFont.SetColor(AColor);
              };
              if (((I - sts) >= 0) && ((I - sts) <= (rtl.length(ANode.FTitleRects) - 1))) {
                titr.$assign(ANode.FTitleRects[I - sts]);
                pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(titr,AOffsetX,AOffsetY);
                pas["WEBLib.TMSFNCTypes"].InflateRectEx(titr,this.ScalePaintValue(-2),0);
                c = null;
                if ((I >= 0) && (I <= (this.FColumns.GetCount() - 1))) c = this.FColumns.GetItem$1(I);
                ha = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading;
                va = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
                ww = false;
                trim = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone;
                if (c != null) {
                  ha = c.FTitleHorizontalTextAlign;
                  va = c.FTitleVerticalTextAlign;
                  ww = c.FTitleWordWrapping;
                  trim = c.FTitleTrimming;
                };
                this.DoGetNodeTitleTrimming(ANode,I,{get: function () {
                    return trim;
                  }, set: function (v) {
                    trim = v;
                  }});
                this.DoGetNodeTitleWordWrapping(ANode,I,{get: function () {
                    return ww;
                  }, set: function (v) {
                    ww = v;
                  }});
                this.DoGetNodeTitleHorizontalTextAlign(ANode,I,{get: function () {
                    return ha;
                  }, set: function (v) {
                    ha = v;
                  }});
                this.DoGetNodeTitleVerticalTextAlign(ANode,I,{get: function () {
                    return va;
                  }, set: function (v) {
                    va = v;
                  }});
                str = "";
                this.DoGetNodeTitle(ANode,I,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeTextMode.tntmDrawing,{get: function () {
                    return str;
                  }, set: function (v) {
                    str = v;
                  }});
                b = true;
                this.DoBeforeDrawNodeTitle(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(titr),I,ANode,str,{get: function () {
                    return b;
                  }, set: function (v) {
                    b = v;
                  }});
                if (b) {
                  AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(titr),str,ww,ha,va,trim,0,-1,-1,true,false,-1,-1);
                  this.DoAfterDrawNodeTitle(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(titr),I,ANode,str);
                };
              };
              if (((I - sts) >= 0) && ((I - sts) <= (rtl.length(ANode.FExtraRects) - 1))) {
                extr.$assign(ANode.FExtraRects[I - sts]);
                pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(extr,AOffsetX,AOffsetY);
                b = true;
                this.DoBeforeDrawNodeExtra(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(extr),I,ANode,{get: function () {
                    return b;
                  }, set: function (v) {
                    b = v;
                  }});
                if (b) {
                  this.DoDrawNodeExtra(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(extr),I,ANode);
                  this.DoAfterDrawNodeExtra(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(extr),I,ANode);
                };
              };
              if (((I - sts) >= 0) && ((I - sts) <= (rtl.length(ANode.FTitleExtraRects) - 1))) {
                extr.$assign(ANode.FTitleExtraRects[I - sts]);
                pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(extr,AOffsetX,AOffsetY);
                b = true;
                this.DoBeforeDrawNodeTitleExtra(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(extr),I,ANode,{get: function () {
                    return b;
                  }, set: function (v) {
                    b = v;
                  }});
                if (b) {
                  this.DoDrawNodeTitleExtra(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(extr),I,ANode);
                  this.DoAfterDrawNodeTitleExtra(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(extr),I,ANode);
                };
              };
            };
          };
        };
        this.DoAfterDrawNode(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),ANode);
      };
    };
    this.DrawGroup = function (AGraphics, ARect, AGroup, AStartColumn, AEndColumn, AKind) {
      var b = false;
      var df = false;
      var str = "";
      var txtr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var grp = null;
      var def = false;
      grp = null;
      def = true;
      if ((AGroup >= 0) && (AGroup <= (this.FGroups.GetCount() - 1))) {
        grp = this.FGroups.GetItem$1(AGroup);
        if (!grp.FUseDefaultAppearance) {
          def = false;
          var $tmp = AKind;
          if ($tmp === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikGroupTop) {
            AGraphics.FStroke.Assign(grp.FTopStroke);
            AGraphics.FFill.Assign(grp.FTopFill);
          } else if ($tmp === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikGroupBottom) {
            AGraphics.FStroke.Assign(grp.FBottomStroke);
            AGraphics.FFill.Assign(grp.FBottomFill);
          };
        };
      };
      if (def) {
        var $tmp1 = AKind;
        if ($tmp1 === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikGroupTop) {
          AGraphics.FStroke.Assign(this.FGroupsAppearance.FTopStroke);
          AGraphics.FFill.Assign(this.FGroupsAppearance.FTopFill);
        } else if ($tmp1 === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikGroupBottom) {
          AGraphics.FStroke.Assign(this.FGroupsAppearance.FBottomStroke);
          AGraphics.FFill.Assign(this.FGroupsAppearance.FBottomFill);
        };
      };
      b = true;
      df = true;
      this.DoBeforeDrawGroup(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AGroup,AStartColumn,AEndColumn,AKind,{get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }},{get: function () {
          return df;
        }, set: function (v) {
          df = v;
        }});
      if (b) {
        if (df) AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmNone);
        if (def) {
          var $tmp2 = AKind;
          if ($tmp2 === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikGroupTop) {
            AGraphics.FFont.Assign(this.FGroupsAppearance.FTopFont)}
           else if ($tmp2 === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikGroupBottom) AGraphics.FFont.Assign(this.FGroupsAppearance.FBottomFont);
        } else if (grp != null) {
          var $tmp3 = AKind;
          if ($tmp3 === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikGroupTop) {
            AGraphics.FFont.Assign(grp.FTopFont)}
           else if ($tmp3 === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikGroupBottom) AGraphics.FFont.Assign(grp.FBottomFont);
        };
        txtr.$assign(ARect);
        pas["WEBLib.TMSFNCTypes"].InflateRectEx(txtr,this.ScalePaintValue(-2),this.ScalePaintValue(-2));
        str = this.GetGroupText(AGroup);
        this.DoGetGroupText(AGroup,AKind,{get: function () {
            return str;
          }, set: function (v) {
            str = v;
          }});
        b = true;
        this.DoBeforeDrawGroupText(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(txtr),AGroup,AStartColumn,AEndColumn,AKind,str,{get: function () {
            return b;
          }, set: function (v) {
            b = v;
          }});
        if (b) {
          var $tmp4 = AKind;
          if ($tmp4 === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikGroupTop) {
            if (this.FGroupsAppearance.FTopVerticalText) {
              AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(txtr),str,false,this.FGroupsAppearance.FTopHorizontalTextAlign,this.FGroupsAppearance.FTopVerticalTextAlign,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,-90,-1,-1,true,false,-1,-1)}
             else AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(txtr),str,false,this.FGroupsAppearance.FTopHorizontalTextAlign,this.FGroupsAppearance.FTopVerticalTextAlign,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,true,false,-1,-1);
          } else if ($tmp4 === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikGroupBottom) {
            if (this.FGroupsAppearance.FBottomVerticalText) {
              AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(txtr),str,false,this.FGroupsAppearance.FBottomHorizontalTextAlign,this.FGroupsAppearance.FBottomVerticalTextAlign,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,90,-1,-1,true,false,-1,-1)}
             else AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(txtr),str,false,this.FGroupsAppearance.FBottomHorizontalTextAlign,this.FGroupsAppearance.FBottomVerticalTextAlign,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,true,false,-1,-1);
          };
          this.DoAfterDrawGroupText(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(txtr),AGroup,AStartColumn,AEndColumn,AKind,str);
        };
        this.DoAfterDrawGroup(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AGroup,AStartColumn,AEndColumn,AKind);
      };
    };
    this.DrawColumn = function (AGraphics, ARect, AColumn, AKind) {
      var b = false;
      var str = "";
      var df = false;
      var txtr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var def = false;
      var col = null;
      var trim = 0;
      var ha = 0;
      var va = 0;
      var ww = false;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var sr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var dr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var szd = 0.0;
      var szr = 0.0;
      var szt = 0.0;
      pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCCustomTreeView.DrawColumn.apply(this,arguments);
      r.$assign(ARect);
      def = true;
      col = null;
      if ((AColumn >= 0) && (AColumn <= (this.FColumns.GetCount() - 1))) {
        col = this.FColumns.GetItem$1(AColumn);
        if (!col.FVisible) return;
        if (!col.FUseDefaultAppearance) {
          def = false;
          var $tmp = AKind;
          if ($tmp === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikColumnTop) {
            AGraphics.FStroke.Assign(col.FTopStroke);
            AGraphics.FFill.Assign(col.FTopFill);
          } else if ($tmp === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikColumnBottom) {
            AGraphics.FStroke.Assign(col.FBottomStroke);
            AGraphics.FFill.Assign(col.FBottomFill);
          };
        };
      };
      if (def) {
        var $tmp1 = AKind;
        if ($tmp1 === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikColumnTop) {
          AGraphics.FStroke.Assign(this.FColumnsAppearance.FTopStroke);
          AGraphics.FFill.Assign(this.FColumnsAppearance.FTopFill);
        } else if ($tmp1 === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikColumnBottom) {
          AGraphics.FStroke.Assign(this.FColumnsAppearance.FBottomStroke);
          AGraphics.FFill.Assign(this.FColumnsAppearance.FBottomFill);
        };
      };
      b = true;
      df = true;
      this.DoBeforeDrawColumnHeader(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),AColumn,AKind,{get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }},{get: function () {
          return df;
        }, set: function (v) {
          df = v;
        }});
      if (b) {
        if (df) AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmNone);
        sr.$assign(r);
        szt = 0;
        if (col != null) {
          if (col.FFiltering.FEnabled) {
            szd = col.FFiltering.FButtonSize;
            dr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Math.round(r.Right - szd - this.ScalePaintValue(4)),Math.round(r.Top + ((r.Bottom - r.Top - szd) / 2)),Math.round(r.Right - this.ScalePaintValue(4)),Math.round(r.Top + ((r.Bottom - r.Top - szd) / 2) + szd)));
            AGraphics.DrawDropDownButton(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(dr),false,false,true,true,this.GetAdaptToStyle(),this.FPaintScaleFactor);
            sr.Right = dr.Left;
            szt = szt + szd + this.ScalePaintValue(4);
          };
          if (col.FExpandable) {
            szr = col.FExpandingButtonSize;
            sr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Math.round(sr.Right - szr - this.ScalePaintValue(6)),Math.round(sr.Top + ((sr.Bottom - sr.Top - szr) / 2)),Math.round(sr.Right - this.ScalePaintValue(6)),Math.round(sr.Top + ((sr.Bottom - sr.Top - szr) / 2) + szr)));
            if (col.FExpanded) {
              AGraphics.DrawCompactButton(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(sr),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCompactState.gcsExpanded,false,false,true,false,this.FPaintScaleFactor)}
             else AGraphics.DrawCompactButton(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(sr),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCompactState.gcsCollapsed,false,false,true,false,this.FPaintScaleFactor);
            sr.Right = sr.Left;
            szt = szt + szr + this.ScalePaintValue(6);
          };
          if ((col.FSortKind !== pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodesSortKind.nskNone) && (this.FSortColumn === AColumn)) {
            szr = this.ScalePaintValue(8);
            sr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Math.round(sr.Right - szr - this.ScalePaintValue(6)),Math.round(sr.Top + ((sr.Bottom - sr.Top - szr) / 2)),Math.round(sr.Right - this.ScalePaintValue(6)),Math.round(sr.Top + ((sr.Bottom - sr.Top - szr) / 2) + szr)));
            this.DrawSortIndicator(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(sr),this.FColumnsAppearance.FSortIndicatorColor,AColumn,col.FSortIndex,col.FSortKind);
            szt = szt + szr + this.ScalePaintValue(6);
          };
        };
        if (def) {
          var $tmp2 = AKind;
          if ($tmp2 === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikColumnTop) {
            AGraphics.FFont.Assign(this.FColumnsAppearance.FTopFont)}
           else if ($tmp2 === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikColumnBottom) AGraphics.FFont.Assign(this.FColumnsAppearance.FBottomFont);
        } else if (col != null) {
          var $tmp3 = AKind;
          if ($tmp3 === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikColumnTop) {
            AGraphics.FFont.Assign(col.FTopFont)}
           else if ($tmp3 === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikColumnBottom) AGraphics.FFont.Assign(col.FBottomFont);
        };
        str = this.GetColumnText(AColumn);
        this.DoGetColumnText(AColumn,AKind,{get: function () {
            return str;
          }, set: function (v) {
            str = v;
          }});
        ha = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading;
        va = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
        ww = false;
        trim = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone;
        if (col != null) {
          ha = col.FHorizontalTextAlign;
          va = col.FVerticalTextAlign;
          ww = col.FWordWrapping;
          trim = col.FTrimming;
        };
        this.DoGetColumnTrimming(AColumn,AKind,{get: function () {
            return trim;
          }, set: function (v) {
            trim = v;
          }});
        this.DoGetColumnWordWrapping(AColumn,AKind,{get: function () {
            return ww;
          }, set: function (v) {
            ww = v;
          }});
        this.DoGetColumnHorizontalTextAlign(AColumn,AKind,{get: function () {
            return ha;
          }, set: function (v) {
            ha = v;
          }});
        this.DoGetColumnVerticalTextAlign(AColumn,AKind,{get: function () {
            return va;
          }, set: function (v) {
            va = v;
          }});
        b = true;
        txtr.$assign(r);
        pas["WEBLib.TMSFNCTypes"].InflateRectEx(txtr,this.ScalePaintValue(-3),this.ScalePaintValue(-3));
        txtr.Right = Math.max(txtr.Left,txtr.Right - szt);
        this.DoBeforeDrawColumnText(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(txtr),AColumn,AKind,str,{get: function () {
            return b;
          }, set: function (v) {
            b = v;
          }});
        if (b) {
          var $tmp4 = AKind;
          if ($tmp4 === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikColumnTop) {
            if (this.FColumnsAppearance.FTopVerticalText) {
              AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(txtr),str,ww,ha,va,trim,-90,-1,-1,true,false,-1,-1)}
             else AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(txtr),str,ww,ha,va,trim,0,-1,-1,true,false,-1,-1);
          } else if ($tmp4 === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewCacheItemKind.ikColumnBottom) {
            if (this.FColumnsAppearance.FBottomVerticalText) {
              AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(txtr),str,ww,ha,va,trim,90,-1,-1,true,false,-1,-1)}
             else AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(txtr),str,ww,ha,va,trim,0,-1,-1,true,false,-1,-1);
          };
          this.DoAfterDrawColumnText(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(txtr),AColumn,AKind,str);
        };
        this.DoAfterDrawColumnHeader(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AColumn,AKind);
      };
    };
    this.DrawSortIndicator = function (AGraphics, ARect, AColor, AColumn, ASortIndex, ASortKind) {
      var pth = null;
      var vertt = 0;
      var c = 0;
      var txtr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var b = false;
      c = AColor;
      AGraphics.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      AGraphics.FFill.SetColor(c);
      AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      AGraphics.FStroke.SetColor(c);
      b = true;
      this.DoBeforeDrawSortIndicator(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AColumn,ASortIndex,ASortKind,{get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }});
      if (b) {
        vertt = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
        txtr.$assign(ARect);
        pth = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPath.$create("Create$1");
        try {
          var $tmp = ASortKind;
          if ($tmp === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodesSortKind.nskAscending) {
            vertt = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaTrailing;
            pth.MoveTo(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Left + ((ARect.Right - ARect.Left) / 2),ARect.Top));
            pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Right,ARect.Bottom));
            pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Left,ARect.Bottom));
            txtr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARect.Left,ARect.Top + this.ScalePaintValue(2),ARect.Right,ARect.Bottom + this.ScalePaintValue(2)));
          } else if ($tmp === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodesSortKind.nskDescending) {
            vertt = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading;
            pth.MoveTo(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Left,ARect.Top));
            pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Right,ARect.Top));
            pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Left + ((ARect.Right - ARect.Left) / 2),ARect.Bottom));
            txtr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARect.Left,ARect.Top - this.ScalePaintValue(2),ARect.Right,ARect.Bottom - this.ScalePaintValue(2)));
          };
          pth.ClosePath();
          AGraphics.DrawPath(pth,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPathDrawMode.pdmPolygon);
          if (ASortIndex !== -1) {
            AGraphics.FFont.SetColor(16777215);
            pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.SetFontSize(AGraphics.FFont,9,1);
            AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(txtr),pas.SysUtils.IntToStr(ASortIndex),false,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,vertt,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,true,false,-1,-1);
          };
        } finally {
          pth = rtl.freeLoc(pth);
        };
        this.DoAfterDrawSortIndicator(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AColumn,ASortIndex,ASortKind);
      };
    };
    this.PickerGetContent = function () {
      var Result = "";
      var n = null;
      Result = "";
      if (this.SelectedVirtualNodeCount() > 0) {
        n = this.GetSelVirtualNode(0);
        Result = n.GetText(0);
      };
      return Result;
    };
    this.PickerSelectItem = function (AItemIndex) {
      var n = null;
      n = this.GetNodeFromNodeStructure(AItemIndex);
      if (n != null) {
        this.SelectVirtualNode(n);
        this.ScrollToVirtualNode(n,true,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeScrollPosition.tvnspTop,false);
      };
    };
    this.PickerGetSelectedItem = function () {
      var Result = 0;
      Result = this.GetSelectedVirtualNodeRow();
      return Result;
    };
    this.PickerGetVisibleItemCount = function () {
      var Result = 0;
      Result = this.GetVisibleNodeCount();
      return Result;
    };
    this.PickerGetItemCount = function () {
      var Result = 0;
      Result = this.GetTotalVirtualNodeCount();
      return Result;
    };
    this.PickerGetItemHeight = function () {
      var Result = 0.0;
      Result = this.FNodesAppearance.FFixedHeight;
      return Result;
    };
    this.PickerSetItemHeight = function (AValue) {
      this.FNodesAppearance.SetFixedHeight(AValue);
    };
    this.PickerGetItemWidth = function () {
      var Result = 0.0;
      if (this.FColumns.GetCount() > 0) {
        Result = this.GetWidth() / this.FColumns.GetCount()}
       else Result = 0;
      return Result;
    };
    this.PickerSetItemWidth = function (AValue) {
    };
    this.PickerGetNextSelectableItem = function (AItemIndex) {
      var Result = 0;
      var n = null;
      var nf = null;
      Result = -1;
      n = this.GetNodeFromNodeStructure(AItemIndex);
      if (n != null) {
        nf = this.GetNextFocusableNode(n);
        if (nf != null) Result = nf.FRow;
      };
      return Result;
    };
    this.PickerGetPreviousSelectableItem = function (AItemIndex) {
      var Result = 0;
      var n = null;
      var nf = null;
      Result = -1;
      n = this.GetNodeFromNodeStructure(AItemIndex);
      if (n != null) {
        nf = this.GetPreviousFocusableNode(n);
        if (nf != null) Result = nf.FRow;
      };
      return Result;
    };
    this.PickerGetFirstSelectableItem = function () {
      var Result = 0;
      Result = this.GetFirstVisibleVirtualNodeRow();
      return Result;
    };
    this.PickerGetLastSelectableItem = function () {
      var Result = 0;
      Result = this.GetLastVisibleVirtualNodeRow();
      return Result;
    };
    this.PickerResetFilter = function () {
      if (this.FFilter.GetCount() > 0) this.RemoveFilters();
    };
    this.PickerApplyFilter = function (ACondition, ACaseSensitive) {
      var f = null;
      f = this.FFilter.Add$1();
      f.FCondition = ACondition;
      f.FCaseSensitive = ACaseSensitive;
      this.ApplyFilter();
    };
    this.PickerLookupItem = function (ALookupString, ACaseSensitive) {
      var Result = pas["WEBLib.TMSFNCControlPicker"].TTMSFNCControlPickerFilterItem.$new();
      var vn = null;
      Result.ItemIndex = -1;
      Result.ItemText = "";
      vn = this.LookupNode(ALookupString + "*",false,-1,ACaseSensitive,true,true);
      if (vn != null) {
        Result.ItemIndex = vn.FRow;
        Result.ItemText = vn.GetText(0);
      };
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCControlPicker"].ITMSFNCControlPickerFull);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphicsTypes"].ITMSFNCAppearanceGlobalFont);
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
  $mod.$implcode = function () {
    rtl.createClass($impl,"TTMSFNCTreeViewColumnOpen",pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewColumn,function () {
    });
  };
},["Math","SysUtils","WEBLib.TMSFNCUtils","WEBLib.Graphics","WEBLib.TMSFNCCustomSelector"]);
rtl.module("WEBLib.TMSFNCListBox",["System","Classes","WEBLib.TMSFNCTreeView","WEBLib.TMSFNCStyles","WEBLib.TMSFNCPersistence","WEBLib.TMSFNCTreeViewData","WEBLib.TMSFNCCustomControl","WEBLib.TMSFNCTypes","WEBLib.TMSFNCGraphics","WEBLib.TMSFNCCustomTreeView","WEBLib.TMSFNCBitmapContainer","TypInfo","WEBLib.TMSFNCGraphicsTypes","WEBLib.TMSFNCControlPicker","Types"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.MAJ_VER = 1;
  this.MIN_VER = 0;
  this.REL_VER = 4;
  this.BLD_VER = 1;
  this.CLP_FMT = "#LISTBOX#";
  this.$rtti.$Class("TTMSFNCCustomListBox");
  this.$rtti.$Class("TTMSFNCListBoxInteraction");
  rtl.createClass(this,"TTMSFNCListBoxItem",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FTag = 0;
      this.FDataString = "";
      this.FDataObject = null;
      this.FDataInteger = 0;
      this.FListBox = null;
      this.FText = "";
      this.FDBKey = "";
      this.FChecked = false;
      this.FDataBoolean = false;
      this.FWordWrapping = false;
      this.FTrimming = 0;
      this.FTextAlign = 0;
      this.FSelectedTextColor = 0;
      this.FTextColor = 0;
      this.FDisabledTextColor = 0;
      this.FEnabled = false;
      this.FBitmapName = "";
      this.FBitmap = null;
      this.FHeight = 0.0;
      this.FDataPointer = null;
      this.FBitmapHeight = 0.0;
      this.FBitmapWidth = 0.0;
    };
    this.$final = function () {
      this.FDataObject = undefined;
      this.FListBox = undefined;
      this.FBitmap = undefined;
      pas.Classes.TCollectionItem.$final.call(this);
    };
    this.SetText = function (Value) {
      if (this.FText !== Value) {
        this.FText = Value;
        this.UpdateItem();
      };
    };
    this.SetHeight = function (Value) {
      if (this.FHeight !== Value) {
        this.FHeight = Value;
        this.UpdateItem();
      };
    };
    this.SetTrimming = function (Value) {
      if (this.FTrimming !== Value) {
        this.FTrimming = Value;
        this.UpdateItem();
      };
    };
    this.SetWordWrapping = function (Value) {
      if (this.FWordWrapping !== Value) {
        this.FWordWrapping = Value;
        this.UpdateItem();
      };
    };
    this.SetTextAlign = function (Value) {
      if (this.FTextAlign !== Value) {
        this.FTextAlign = Value;
        this.UpdateItem();
      };
    };
    this.SetSelectedTextColor = function (Value) {
      if (this.FSelectedTextColor !== Value) {
        this.FSelectedTextColor = Value;
        this.UpdateItem();
      };
    };
    this.SetTextColor = function (Value) {
      if (this.FTextColor !== Value) {
        this.FTextColor = Value;
        this.UpdateItem();
      };
    };
    this.SetDisabledTextColor = function (Value) {
      if (this.FDisabledTextColor !== Value) {
        this.FDisabledTextColor = Value;
        this.UpdateItem();
      };
    };
    this.SetEnabled = function (Value) {
      if (this.FEnabled !== Value) {
        this.FEnabled = Value;
        this.UpdateItem();
      };
    };
    this.SetBitmapName = function (Value) {
      if (this.FBitmapName !== Value) {
        this.FBitmapName = Value;
        this.UpdateItem();
      };
    };
    this.SetBitmap = function (Value) {
      if (this.FBitmap !== Value) {
        this.FBitmap.Assign(Value);
      };
    };
    this.SetChecked = function (Value) {
      var l = null;
      var n = null;
      if (this.FChecked !== Value) {
        this.FChecked = Value;
        l = this.ListBox();
        if (l != null) {
          n = l.GetNodeForItemIndex(this.GetIndex());
          if ((n != null) && (n.FCheckStates[0] !== this.FChecked)) {
            if (this.FChecked) {
              l.FTreeView.CheckVirtualNode(n,0,false)}
             else l.FTreeView.UnCheckVirtualNode(n,0,false);
          };
          if (l.FTreeView != null) l.FTreeView.Invalidate();
        };
      };
    };
    this.GetBitmapContainer = function () {
      var Result = null;
      var l = null;
      Result = null;
      l = this.ListBox();
      if (l != null) Result = l.GetBitmapContainer();
      return Result;
    };
    this.GetStrippedHTMLText = function () {
      var Result = "";
      Result = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.HTMLStrip(this.FText);
      return Result;
    };
    this.IsHeightStored = function () {
      var Result = false;
      Result = this.FHeight !== -1;
      return Result;
    };
    this.IsBitmapHeightStored = function () {
      var Result = false;
      Result = this.FBitmapHeight !== -1;
      return Result;
    };
    this.IsBitmapWidthStored = function () {
      var Result = false;
      Result = this.FBitmapWidth !== -1;
      return Result;
    };
    this.SetBitmapHeight = function (Value) {
      this.FBitmapHeight = Value;
    };
    this.SetBitmapWidth = function (Value) {
      this.FBitmapWidth = Value;
    };
    this.UpdateItem = function () {
      var l = null;
      l = this.ListBox();
      if (l != null) l.UpdateItems();
    };
    this.Changed$1 = function (Sender) {
      this.UpdateItem();
    };
    this.BitmapChanged = function (Sender) {
      this.UpdateItem();
    };
    this.ListBox = function () {
      var Result = null;
      Result = this.FListBox;
      return Result;
    };
    this.Create$1 = function (ACollection) {
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      if (this.FCollection != null) this.FListBox = rtl.as(this.FCollection,$mod.TTMSFNCListBoxItems).ListBox();
      this.FTextColor = 0;
      this.FHeight = -1;
      this.FBitmapWidth = -1;
      this.FBitmapHeight = -1;
      this.FEnabled = true;
      this.FSelectedTextColor = 16777215;
      this.FDisabledTextColor = 12632256;
      this.FWordWrapping = false;
      this.FTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading;
      this.FTrimming = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone;
      this.FBitmap = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      this.FBitmap.FOnChange = rtl.createCallback(this,"BitmapChanged");
      if (this.FListBox != null) this.Assign(this.FListBox.FDefaultItem);
      this.UpdateItem();
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FBitmap");
      pas.Classes.TCollectionItem.Destroy.call(this);
      this.UpdateItem();
    };
    this.SaveToString = function (ATextOnly) {
      var Result = "";
      var s = "";
      if (!(this.FListBox != null)) return Result;
      Result = "";
      Result = Result + this.FText;
      if (!ATextOnly) Result = Result + "{0}";
      if (!ATextOnly) {
        Result = Result + pas.SysUtils.BoolToStr(this.FChecked,false) + ";";
        Result = Result + this.FBitmapName + ";";
        Result = Result + pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.SaveBitmapToHexStr(this.FBitmap) + ";";
        Result = Result + s;
      };
      if (!ATextOnly) {
        Result = Result + "{0}";
        Result = Result + pas.SysUtils.BoolToStr(this.FEnabled,false);
      };
      return Result;
    };
    this.IsSelected = function () {
      var Result = false;
      var i = 0;
      Result = false;
      if (this.FListBox != null) {
        for (var $l = 0, $end = this.FListBox.SelectedItemCount() - 1; $l <= $end; $l++) {
          i = $l;
          if (this.FListBox.GetSelItem(i) === this) {
            Result = true;
            break;
          };
        };
      };
      return Result;
    };
    this.LoadFromString = function (AString) {
      var k = 0;
      var a = null;
      var s = null;
      var y = 0;
      var st = "";
      var ps = 0;
      var subst = "";
      a = pas.Classes.TStringList.$create("Create$1");
      try {
        st = AString;
        while (st !== "") {
          ps = pas.System.Pos("{0}",st);
          if (ps === 0) {
            a.Add(st);
            break;
          };
          subst = pas.System.Copy(st,1,ps - 1);
          a.Add(subst);
          pas.System.Delete({get: function () {
              return st;
            }, set: function (v) {
              st = v;
            }},1,(ps - 1) + "{0}".length);
        };
        for (var $l = 0, $end = a.GetCount() - 1; $l <= $end; $l++) {
          k = $l;
          if (a.Get(k) !== "") {
            if (k === 0) {
              this.SetText(a.Get(k))}
             else if (k === 1) {
              s = pas.Classes.TStringList.$create("Create$1");
              try {
                pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.Split(";",a.Get(k),s,false);
                for (var $l1 = 0, $end1 = s.GetCount() - 1; $l1 <= $end1; $l1++) {
                  y = $l1;
                  if (s.Get(y) !== "") {
                    if (y === 0) {
                      this.SetChecked(pas.SysUtils.StrToBool(s.Get(y)))}
                     else if (y === 1) {
                      this.SetBitmapName(s.Get(y))}
                     else if (y === 2) pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.LoadBitmapFromHexStr(s.Get(y),this.FBitmap);
                  };
                };
              } finally {
                s = rtl.freeLoc(s);
              };
            } else if (k === 2) this.SetEnabled(pas.SysUtils.StrToBool(a.Get(k)));
          };
        };
      } finally {
        a = rtl.freeLoc(a);
      };
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCListBoxItem.isPrototypeOf(Source)) {
        this.FTag = rtl.as(Source,$mod.TTMSFNCListBoxItem).FTag;
        this.FText = rtl.as(Source,$mod.TTMSFNCListBoxItem).FText;
        this.FTrimming = rtl.as(Source,$mod.TTMSFNCListBoxItem).FTrimming;
        this.FWordWrapping = rtl.as(Source,$mod.TTMSFNCListBoxItem).FWordWrapping;
        this.FTextAlign = rtl.as(Source,$mod.TTMSFNCListBoxItem).FTextAlign;
        this.FTextColor = rtl.as(Source,$mod.TTMSFNCListBoxItem).FTextColor;
        this.FSelectedTextColor = rtl.as(Source,$mod.TTMSFNCListBoxItem).FSelectedTextColor;
        this.FDisabledTextColor = rtl.as(Source,$mod.TTMSFNCListBoxItem).FDisabledTextColor;
        this.FEnabled = rtl.as(Source,$mod.TTMSFNCListBoxItem).FEnabled;
        this.FBitmapName = rtl.as(Source,$mod.TTMSFNCListBoxItem).FBitmapName;
        this.FBitmap.Assign(rtl.as(Source,$mod.TTMSFNCListBoxItem).FBitmap);
        this.FHeight = rtl.as(Source,$mod.TTMSFNCListBoxItem).FHeight;
        this.FBitmapHeight = rtl.as(Source,$mod.TTMSFNCListBoxItem).FBitmapHeight;
        this.FBitmapWidth = rtl.as(Source,$mod.TTMSFNCListBoxItem).FBitmapWidth;
        this.FDataPointer = rtl.as(Source,$mod.TTMSFNCListBoxItem).FDataPointer;
        this.FDataBoolean = rtl.as(Source,$mod.TTMSFNCListBoxItem).FDataBoolean;
        this.FDataObject = rtl.as(Source,$mod.TTMSFNCListBoxItem).FDataObject;
        this.FDataString = rtl.as(Source,$mod.TTMSFNCListBoxItem).FDataString;
        this.FDataInteger = rtl.as(Source,$mod.TTMSFNCListBoxItem).FDataInteger;
        this.AssignData(Source);
      };
    };
    this.AssignData = function (Source) {
      if ($mod.TTMSFNCListBoxItem.isPrototypeOf(Source)) {
        this.FDataString = rtl.as(Source,$mod.TTMSFNCListBoxItem).FDataString;
        this.FDataBoolean = rtl.as(Source,$mod.TTMSFNCListBoxItem).FDataBoolean;
        this.FDataObject = rtl.as(Source,$mod.TTMSFNCListBoxItem).FDataObject;
        this.FDataInteger = rtl.as(Source,$mod.TTMSFNCListBoxItem).FDataInteger;
        this.FDataPointer = rtl.as(Source,$mod.TTMSFNCListBoxItem).FDataPointer;
        this.FDBKey = rtl.as(Source,$mod.TTMSFNCListBoxItem).FDBKey;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Text",2,rtl.string,"FText","SetText");
    $r.addProperty("Bitmap",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FBitmap","SetBitmap");
    $r.addProperty("BitmapWidth",14,rtl.double,"FBitmapWidth","SetBitmapWidth",4,{stored: "IsBitmapWidthStored"});
    $r.addProperty("BitmapHeight",14,rtl.double,"FBitmapHeight","SetBitmapHeight",4,{stored: "IsBitmapHeightStored"});
    $r.addProperty("BitmapName",2,rtl.string,"FBitmapName","SetBitmapName");
    $r.addProperty("WordWrapping",2,rtl.boolean,"FWordWrapping","SetWordWrapping",4,{Default: false});
    $r.addProperty("Trimming",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextTrimming"],"FTrimming","SetTrimming",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone});
    $r.addProperty("TextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FTextAlign","SetTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading});
    $r.addProperty("TextColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FTextColor","SetTextColor",4,{Default: 0});
    $r.addProperty("SelectedTextColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FSelectedTextColor","SetSelectedTextColor",4,{Default: 16777215});
    $r.addProperty("DisabledTextColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FDisabledTextColor","SetDisabledTextColor",4,{Default: 12632256});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Height",14,rtl.double,"FHeight","SetHeight",4,{stored: "IsHeightStored"});
    $r.addProperty("Tag",0,rtl.nativeint,"FTag","FTag",4,{Default: 0});
  });
  this.TTMSFNCListBoxItemsSortMode = {"0": "ismAscending", ismAscending: 0, "1": "ismDescending", ismDescending: 1};
  this.$rtti.$Enum("TTMSFNCListBoxItemsSortMode",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCListBoxItemsSortMode});
  this.TTMSFNCListBoxItemsSortKind = {"0": "iskNone", iskNone: 0, "1": "iskAscending", iskAscending: 1, "2": "iskDescending", iskDescending: 2};
  this.$rtti.$Enum("TTMSFNCListBoxItemsSortKind",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCListBoxItemsSortKind});
  rtl.createClass(this,"TTMSFNCListBoxItems",pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$init.call(this);
      this.FListBox = null;
    };
    this.$final = function () {
      this.FListBox = undefined;
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$final.call(this);
    };
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      this.SetItem(Index,Value);
    };
    this.GetItemClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCListBoxItem;
      return Result;
    };
    this.Compare = function (AItem1, AItem2, ACaseSensitive, ASortingMode) {
      var Result = 0;
      var l = null;
      Result = 0;
      l = this.ListBox();
      if (!(l != null)) return Result;
      if (!ACaseSensitive) {
        Result = pas.SysUtils.AnsiCompareStr(pas.SysUtils.UpperCase(AItem1.GetStrippedHTMLText()),pas.SysUtils.UpperCase(AItem2.GetStrippedHTMLText()))}
       else Result = pas.SysUtils.AnsiCompareStr(AItem1.GetStrippedHTMLText(),AItem2.GetStrippedHTMLText());
      var $tmp = ASortingMode;
      if ($tmp === $mod.TTMSFNCListBoxItemsSortMode.ismDescending) Result = Result * -1;
      l.DoItemCompare(AItem1,AItem2,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.QuickSort = function (L, R, ACaseSensitive, ASortingMode) {
      var $Self = this;
      var I = 0;
      var J = 0;
      var p = 0;
      var SortList = null;
      function ExchangeItems(Index1, Index2) {
        var Save = undefined;
        Save = SortList.Get(Index1);
        SortList.Put(Index1,SortList.Get(Index2));
        SortList.Put(Index2,Save);
      };
      SortList = $Self.FItems;
      do {
        I = L;
        J = R;
        p = (L + R) >>> 1;
        do {
          while (this.Compare(this.GetItem$1(I),this.GetItem$1(p),ACaseSensitive,ASortingMode) < 0) I += 1;
          while (this.Compare(this.GetItem$1(J),this.GetItem$1(p),ACaseSensitive,ASortingMode) > 0) J -= 1;
          if (I <= J) {
            ExchangeItems(I,J);
            if (p === I) {
              p = J}
             else if (p === J) p = I;
            I += 1;
            J -= 1;
          };
        } while (!(I > J));
        if (L < J) this.QuickSort(L,J,ACaseSensitive,ASortingMode);
        L = I;
      } while (!(I >= R));
    };
    this.ListBox = function () {
      var Result = null;
      Result = this.FListBox;
      return Result;
    };
    this.Create$3 = function (AListBox) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AListBox,this.GetItemClass());
      this.FListBox = AListBox;
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Add$2 = function (AText) {
      var Result = null;
      var it = null;
      it = this.Add$1();
      it.SetText(AText);
      Result = it;
      return Result;
    };
    this.AddStrings = function (AItems, AClear) {
      var s = "";
      var l = null;
      l = this.ListBox();
      if (l != null) l.BeginUpdate();
      try {
        if (AClear) this.Clear$1();
        var $in = AItems.GetEnumerator();
        try {
          while ($in.MoveNext()) {
            s = $in.GetCurrent();
            this.Add$2(s);
          }
        } finally {
          $in = rtl.freeLoc($in)
        };
      } finally {
        if (l != null) l.EndUpdate();
      };
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      return Result;
    };
    this.Clear$1 = function () {
      var l = null;
      l = this.ListBox();
      if (l != null) l.BeginUpdate();
      pas.Classes.TCollection.Clear.call(this);
      if (l != null) l.EndUpdate();
    };
    this.Sort$1 = function (ACaseSensitive, ASortingMode) {
      var l = null;
      l = this.ListBox();
      if (l != null) {
        l.FSortMode = ASortingMode;
        l.BeginUpdate();
        this.BeginUpdate();
        if (this.GetCount() > 1) this.QuickSort(0,this.GetCount() - 1,ACaseSensitive,ASortingMode);
        this.EndUpdate();
        l.EndUpdate();
      };
    };
    this.FindItem = function (AText) {
      var Result = null;
      var I = 0;
      Result = null;
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (this.GetItem$1(I).FText === AText) {
          Result = this.GetItem$1(I);
          return Result;
        };
      };
      return Result;
    };
  });
  rtl.createClass(this,"TTMSFNCListBoxLookup",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FOwner = null;
    };
    this.$final = function () {
      this.FOwner = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.GetAutoSelect = function () {
      var Result = false;
      Result = false;
      if ((this.FOwner != null) && (this.FOwner.FListBox != null) && (this.FOwner.FListBox.FTreeView != null)) Result = this.FOwner.FListBox.FTreeView.FInteraction.FLookup.FAutoSelect;
      return Result;
    };
    this.GetCaseSensitive = function () {
      var Result = false;
      Result = false;
      if ((this.FOwner != null) && (this.FOwner.FListBox != null) && (this.FOwner.FListBox.FTreeView != null)) Result = this.FOwner.FListBox.FTreeView.FInteraction.FLookup.FCaseSensitive;
      return Result;
    };
    this.GetEnabled = function () {
      var Result = false;
      Result = false;
      if ((this.FOwner != null) && (this.FOwner.FListBox != null) && (this.FOwner.FListBox.FTreeView != null)) Result = this.FOwner.FListBox.FTreeView.FInteraction.FLookup.FEnabled;
      return Result;
    };
    this.GetIncremental = function () {
      var Result = false;
      Result = false;
      if ((this.FOwner != null) && (this.FOwner.FListBox != null) && (this.FOwner.FListBox.FTreeView != null)) Result = this.FOwner.FListBox.FTreeView.FInteraction.FLookup.FIncremental;
      return Result;
    };
    this.SetAutoSelect = function (Value) {
      if ((this.FOwner != null) && (this.FOwner.FListBox != null) && (this.FOwner.FListBox.FTreeView != null)) this.FOwner.FListBox.FTreeView.FInteraction.FLookup.FAutoSelect = Value;
    };
    this.SetCaseSensitive = function (Value) {
      if ((this.FOwner != null) && (this.FOwner.FListBox != null) && (this.FOwner.FListBox.FTreeView != null)) this.FOwner.FListBox.FTreeView.FInteraction.FLookup.FCaseSensitive = Value;
    };
    this.SetEnabled = function (Value) {
      if ((this.FOwner != null) && (this.FOwner.FListBox != null) && (this.FOwner.FListBox.FTreeView != null)) this.FOwner.FListBox.FTreeView.FInteraction.FLookup.FEnabled = Value;
    };
    this.SetIncremental = function (Value) {
      if ((this.FOwner != null) && (this.FOwner.FListBox != null) && (this.FOwner.FListBox.FTreeView != null)) this.FOwner.FListBox.FTreeView.FInteraction.FLookup.FIncremental = Value;
    };
    this.Create$1 = function (AOwner) {
      this.FOwner = AOwner;
      return this;
    };
    var $r = this.$rtti;
    $r.addProperty("CaseSensitive",3,rtl.boolean,"GetCaseSensitive","SetCaseSensitive",4,{Default: false});
    $r.addProperty("Enabled",3,rtl.boolean,"GetEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Incremental",3,rtl.boolean,"GetIncremental","SetIncremental",4,{Default: true});
    $r.addProperty("AutoSelect",3,rtl.boolean,"GetAutoSelect","SetAutoSelect",4,{Default: true});
  });
  rtl.createClass(this,"TTMSFNCListBoxFiltering",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FOwner = null;
    };
    this.$final = function () {
      this.FOwner = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.GetDropDownHeight = function () {
      var Result = 0;
      Result = 120;
      if ((this.FOwner != null) && (this.FOwner.FListBox != null) && (this.FOwner.FListBox.FTreeView != null) && (this.FOwner.FListBox.FTreeView.FColumns.GetCount() > 0)) Result = this.FOwner.FListBox.FTreeView.FColumns.GetItem$1(0).FFiltering.FDropDownHeight;
      return Result;
    };
    this.GetDropDownWidth = function () {
      var Result = 0;
      Result = 100;
      if ((this.FOwner != null) && (this.FOwner.FListBox != null) && (this.FOwner.FListBox.FTreeView != null) && (this.FOwner.FListBox.FTreeView.FColumns.GetCount() > 0)) Result = this.FOwner.FListBox.FTreeView.FColumns.GetItem$1(0).FFiltering.FDropDownWidth;
      return Result;
    };
    this.GetEnabled = function () {
      var Result = false;
      Result = false;
      if ((this.FOwner != null) && (this.FOwner.FListBox != null) && (this.FOwner.FListBox.FTreeView != null) && (this.FOwner.FListBox.FTreeView.FColumns.GetCount() > 0)) Result = this.FOwner.FListBox.FTreeView.FColumns.GetItem$1(0).FFiltering.FEnabled;
      return Result;
    };
    this.SetDropDownHeight = function (Value) {
      if ((this.FOwner != null) && (this.FOwner.FListBox != null) && (this.FOwner.FListBox.FTreeView != null) && (this.FOwner.FListBox.FTreeView.FColumns.GetCount() > 0)) this.FOwner.FListBox.FTreeView.FColumns.GetItem$1(0).FFiltering.FDropDownHeight = Value;
    };
    this.SetDropDownWidth = function (Value) {
      if ((this.FOwner != null) && (this.FOwner.FListBox != null) && (this.FOwner.FListBox.FTreeView != null) && (this.FOwner.FListBox.FTreeView.FColumns.GetCount() > 0)) this.FOwner.FListBox.FTreeView.FColumns.GetItem$1(0).FFiltering.FDropDownWidth = Value;
    };
    this.SetEnabled = function (Value) {
      if ((this.FOwner != null) && (this.FOwner.FListBox != null) && (this.FOwner.FListBox.FTreeView != null) && (this.FOwner.FListBox.FTreeView.FColumns.GetCount() > 0)) this.FOwner.FListBox.FTreeView.FColumns.GetItem$1(0).FFiltering.SetEnabled(Value);
    };
    this.Create$1 = function (AOwner) {
      this.FOwner = AOwner;
      return this;
    };
    var $r = this.$rtti;
    $r.addProperty("Enabled",3,rtl.boolean,"GetEnabled","SetEnabled",4,{Default: false});
    $r.addProperty("DropDownWidth",3,rtl.longint,"GetDropDownWidth","SetDropDownWidth",4,{Default: 100});
    $r.addProperty("DropDownHeight",3,rtl.longint,"GetDropDownHeight","SetDropDownHeight",4,{Default: 120});
  });
  this.TTMSFNCListBoxMouseEditMode = {"0": "lmemDoubleClick", lmemDoubleClick: 0, "1": "lmemSingleClick", lmemSingleClick: 1, "2": "lmemSingleClickOnSelectedItem", lmemSingleClickOnSelectedItem: 2};
  this.$rtti.$Enum("TTMSFNCListBoxMouseEditMode",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCListBoxMouseEditMode});
  this.TTMSFNCListBoxClipboardMode = {"0": "lcmNone", lcmNone: 0, "1": "lcmTextOnly", lcmTextOnly: 1, "2": "lcmFull", lcmFull: 2};
  this.$rtti.$Enum("TTMSFNCListBoxClipboardMode",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCListBoxClipboardMode});
  this.TTMSFNCListBoxDragDropMode = {"0": "ldmNone", ldmNone: 0, "1": "ldmMove", ldmMove: 1, "2": "ldmCopy", ldmCopy: 2};
  this.$rtti.$Enum("TTMSFNCListBoxDragDropMode",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCListBoxDragDropMode});
  this.TTMSFNCListBoxSorting = {"0": "lcsNone", lcsNone: 0, "1": "lcsNormal", lcsNormal: 1, "2": "lcsNormalCaseSensitive", lcsNormalCaseSensitive: 2};
  this.$rtti.$Enum("TTMSFNCListBoxSorting",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCListBoxSorting});
  rtl.createClass(this,"TTMSFNCListBoxInteraction",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FListBox = null;
      this.FLookup = null;
      this.FFiltering = null;
    };
    this.$final = function () {
      this.FListBox = undefined;
      this.FLookup = undefined;
      this.FFiltering = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.GetMultiSelect = function () {
      var Result = false;
      Result = false;
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) Result = this.FListBox.FTreeView.FInteraction.FMultiSelect;
      return Result;
    };
    this.SetMultiSelect = function (Value) {
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) this.FListBox.FTreeView.FInteraction.SetMultiSelect(Value);
    };
    this.GetClipboardMode = function () {
      var Result = 0;
      var i = 0;
      Result = $mod.TTMSFNCListBoxClipboardMode.lcmNone;
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) {
        i = this.FListBox.FTreeView.FInteraction.FClipboardMode;
        Result = i;
      };
      return Result;
    };
    this.GetDragDropMode = function () {
      var Result = 0;
      var i = 0;
      Result = $mod.TTMSFNCListBoxDragDropMode.ldmNone;
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) {
        i = this.FListBox.FTreeView.FInteraction.FDragDropMode;
        Result = i;
      };
      return Result;
    };
    this.GetReorder = function () {
      var Result = false;
      Result = false;
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) Result = this.FListBox.FTreeView.FInteraction.FReorder;
      return Result;
    };
    this.GetTouchScrolling = function () {
      var Result = false;
      Result = true;
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) Result = this.FListBox.FTreeView.FInteraction.FTouchScrolling;
      return Result;
    };
    this.SetDragDropMode = function (Value) {
      var i = 0;
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) {
        i = Value;
        this.FListBox.FTreeView.FInteraction.SetDragDropMode(i);
      };
    };
    this.SetFiltering = function (Value) {
      this.FFiltering.Assign(Value);
    };
    this.SetLookup = function (Value) {
      this.FLookup.Assign(Value);
    };
    this.SetReorder = function (Value) {
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) this.FListBox.FTreeView.FInteraction.SetReorder(Value);
    };
    this.SetTouchScrolling = function (Value) {
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) this.FListBox.FTreeView.FInteraction.SetTouchScrolling(Value);
    };
    this.SetClipboardMode = function (Value) {
      var i = 0;
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) {
        i = Value;
        this.FListBox.FTreeView.FInteraction.FClipboardMode = i;
      };
    };
    this.GetSorting = function () {
      var Result = 0;
      Result = $mod.TTMSFNCListBoxSorting.lcsNone;
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null) && (this.FListBox.FTreeView.FColumns.GetCount() > 0)) {
        var $tmp = this.FListBox.FTreeView.FColumns.GetItem$1(0).FSorting;
        if ($tmp === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewColumnSorting.tcsNone) {
          Result = $mod.TTMSFNCListBoxSorting.lcsNone}
         else if ($tmp === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewColumnSorting.tcsNormal) {
          Result = $mod.TTMSFNCListBoxSorting.lcsNormal}
         else if ($tmp === pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewColumnSorting.tcsNormalCaseSensitive) Result = $mod.TTMSFNCListBoxSorting.lcsNormalCaseSensitive;
      };
      return Result;
    };
    this.SetSorting = function (Value) {
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null) && (this.FListBox.FTreeView.FColumns.GetCount() > 0)) {
        var $tmp = Value;
        if ($tmp === $mod.TTMSFNCListBoxSorting.lcsNone) {
          this.FListBox.FTreeView.FColumns.GetItem$1(0).SetSorting(pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewColumnSorting.tcsNone)}
         else if ($tmp === $mod.TTMSFNCListBoxSorting.lcsNormal) {
          this.FListBox.FTreeView.FColumns.GetItem$1(0).SetSorting(pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewColumnSorting.tcsNormal)}
         else if ($tmp === $mod.TTMSFNCListBoxSorting.lcsNormalCaseSensitive) this.FListBox.FTreeView.FColumns.GetItem$1(0).SetSorting(pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewColumnSorting.tcsNormalCaseSensitive);
      };
    };
    this.Create$1 = function (AListBox) {
      this.FListBox = AListBox;
      this.FLookup = $mod.TTMSFNCListBoxLookup.$create("Create$1",[this]);
      this.FFiltering = $mod.TTMSFNCListBoxFiltering.$create("Create$1",[this]);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FLookup");
      rtl.free(this,"FFiltering");
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCListBoxInteraction.isPrototypeOf(Source)) {
        this.FLookup.Assign(rtl.as(Source,$mod.TTMSFNCListBoxInteraction).FLookup);
        this.FFiltering.Assign(rtl.as(Source,$mod.TTMSFNCListBoxInteraction).FFiltering);
      };
    };
    var $r = this.$rtti;
    $r.addProperty("MultiSelect",3,rtl.boolean,"GetMultiSelect","SetMultiSelect",4,{Default: false});
    $r.addProperty("TouchScrolling",3,rtl.boolean,"GetTouchScrolling","SetTouchScrolling",4,{Default: true});
    $r.addProperty("ClipboardMode",3,$mod.$rtti["TTMSFNCListBoxClipboardMode"],"GetClipboardMode","SetClipboardMode",4,{Default: $mod.TTMSFNCListBoxClipboardMode.lcmNone});
    $r.addProperty("Reorder",3,rtl.boolean,"GetReorder","SetReorder",4,{Default: false});
    $r.addProperty("DragDropMode",3,$mod.$rtti["TTMSFNCListBoxDragDropMode"],"GetDragDropMode","SetDragDropMode",4,{Default: $mod.TTMSFNCListBoxDragDropMode.ldmNone});
    $r.addProperty("Lookup",2,$mod.$rtti["TTMSFNCListBoxLookup"],"FLookup","SetLookup");
    $r.addProperty("Filtering",2,$mod.$rtti["TTMSFNCListBoxFiltering"],"FFiltering","SetFiltering");
    $r.addProperty("Sorting",3,$mod.$rtti["TTMSFNCListBoxSorting"],"GetSorting","SetSorting",4,{Default: $mod.TTMSFNCListBoxSorting.lcsNone});
  });
  this.TTMSFNCListBoxItemHeightMode = {"0": "lihmFixed", lihmFixed: 0, "1": "lihmVariable", lihmVariable: 1};
  this.$rtti.$Enum("TTMSFNCListBoxItemHeightMode",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCListBoxItemHeightMode});
  rtl.createClass(this,"TTMSFNCListBoxItemsAppearance",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FListBox = null;
    };
    this.$final = function () {
      this.FListBox = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.GetFont = function () {
      var Result = null;
      Result = null;
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) Result = this.FListBox.FTreeView.FNodesAppearance.FFont;
      return Result;
    };
    this.GetSelectedFill = function () {
      var Result = null;
      Result = null;
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) Result = this.FListBox.FTreeView.FNodesAppearance.FSelectedFill;
      return Result;
    };
    this.SetFont = function (Value) {
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) this.FListBox.FTreeView.FNodesAppearance.FFont.Assign(Value);
    };
    this.SetSelectedFill = function (Value) {
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) this.FListBox.FTreeView.FNodesAppearance.FSelectedFill.Assign(Value);
    };
    this.GetSelectedStroke = function () {
      var Result = null;
      Result = null;
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) Result = this.FListBox.FTreeView.FNodesAppearance.FSelectedStroke;
      return Result;
    };
    this.SetSelectedStroke = function (Value) {
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) this.FListBox.FTreeView.FNodesAppearance.FSelectedStroke.Assign(Value);
    };
    this.GetDisabledFill = function () {
      var Result = null;
      Result = null;
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) Result = this.FListBox.FTreeView.FNodesAppearance.FDisabledFill;
      return Result;
    };
    this.GetDisabledStroke = function () {
      var Result = null;
      Result = null;
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) Result = this.FListBox.FTreeView.FNodesAppearance.FDisabledStroke;
      return Result;
    };
    this.GetFill = function () {
      var Result = null;
      Result = null;
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) Result = this.FListBox.FTreeView.FNodesAppearance.FFill;
      return Result;
    };
    this.GetStroke = function () {
      var Result = null;
      Result = null;
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) Result = this.FListBox.FTreeView.FNodesAppearance.FStroke;
      return Result;
    };
    this.SetDisabledFill = function (Value) {
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) this.FListBox.FTreeView.FNodesAppearance.FDisabledFill.Assign(Value);
    };
    this.SetDisabledStroke = function (Value) {
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) this.FListBox.FTreeView.FNodesAppearance.FDisabledStroke.Assign(Value);
    };
    this.SetFill = function (Value) {
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) this.FListBox.FTreeView.FNodesAppearance.FFill.Assign(Value);
    };
    this.SetStroke = function (Value) {
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) this.FListBox.FTreeView.FNodesAppearance.FStroke.Assign(Value);
    };
    this.GetHeightMode = function () {
      var Result = 0;
      var i = 0;
      Result = $mod.TTMSFNCListBoxItemHeightMode.lihmFixed;
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) {
        i = this.FListBox.FTreeView.FNodesAppearance.FHeightMode;
        Result = i;
      };
      return Result;
    };
    this.SetHeightMode = function (Value) {
      var i = 0;
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) {
        i = Value;
        this.FListBox.FTreeView.FNodesAppearance.SetHeightMode(i);
      };
    };
    this.GetFixedHeight = function () {
      var Result = 0.0;
      Result = 0;
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) Result = this.FListBox.FTreeView.FNodesAppearance.FFixedHeight;
      return Result;
    };
    this.SetFixedHeight = function (Value) {
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) this.FListBox.FTreeView.FNodesAppearance.SetFixedHeight(Value);
    };
    this.GetShowFocus = function () {
      var Result = false;
      Result = true;
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) Result = this.FListBox.FTreeView.FNodesAppearance.FShowFocus;
      return Result;
    };
    this.SetShowFocus = function (Value) {
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) this.FListBox.FTreeView.FNodesAppearance.SetShowFocus(Value);
    };
    this.Create$1 = function (AListBox) {
      this.FListBox = AListBox;
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null) && this.FListBox.IsDesignTime()) {
        this.FListBox.FTreeView.FNodesAppearance.FDisabledFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
        this.FListBox.FTreeView.FNodesAppearance.FDisabledStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
      };
      return this;
    };
    var $r = this.$rtti;
    $r.addProperty("Font",3,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"GetFont","SetFont");
    $r.addProperty("Fill",3,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"GetFill","SetFill");
    $r.addProperty("Stroke",3,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"GetStroke","SetStroke");
    $r.addProperty("SelectedFill",3,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"GetSelectedFill","SetSelectedFill");
    $r.addProperty("SelectedStroke",3,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"GetSelectedStroke","SetSelectedStroke");
    $r.addProperty("DisabledFill",3,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"GetDisabledFill","SetDisabledFill");
    $r.addProperty("DisabledStroke",3,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"GetDisabledStroke","SetDisabledStroke");
    $r.addProperty("HeightMode",3,$mod.$rtti["TTMSFNCListBoxItemHeightMode"],"GetHeightMode","SetHeightMode",4,{Default: $mod.TTMSFNCListBoxItemHeightMode.lihmFixed});
    $r.addProperty("FixedHeight",3,rtl.double,"GetFixedHeight","SetFixedHeight");
    $r.addProperty("ShowFocus",3,rtl.boolean,"GetShowFocus","SetShowFocus",4,{Default: true});
  });
  this.$rtti.$DynArray("TTMSFNCListBoxItemArray",{eltype: rtl.longint});
  rtl.createClass(this,"TTMSFNCListBoxHeader",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FListBox = null;
    };
    this.$final = function () {
      this.FListBox = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.GetVisible = function () {
      var Result = false;
      Result = false;
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) Result = pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCTreeViewColumnsLayout.tclTop in this.FListBox.FTreeView.FColumnsAppearance.FLayouts;
      return Result;
    };
    this.SetVisible = function (Value) {
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) {
        if (Value) {
          this.FListBox.FTreeView.FColumnsAppearance.SetLayouts(rtl.createSet(pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCTreeViewColumnsLayout.tclTop))}
         else this.FListBox.FTreeView.FColumnsAppearance.SetLayouts({});
      };
    };
    this.GetText = function () {
      var Result = "";
      Result = "";
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null) && (this.FListBox.FTreeView.FColumns.GetCount() > 0)) Result = this.FListBox.FTreeView.FColumns.GetItem$1(0).FText;
      return Result;
    };
    this.SetText = function (Value) {
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null) && (this.FListBox.FTreeView.FColumns.GetCount() > 0)) this.FListBox.FTreeView.FColumns.GetItem$1(0).SetText(Value);
    };
    this.GetFill = function () {
      var Result = null;
      Result = null;
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) Result = this.FListBox.FTreeView.FColumnsAppearance.FTopFill;
      return Result;
    };
    this.GetHorizontalTextAlign = function () {
      var Result = 0;
      Result = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null) && (this.FListBox.FTreeView.FColumns.GetCount() > 0)) Result = this.FListBox.FTreeView.FColumns.GetItem$1(0).FHorizontalTextAlign;
      return Result;
    };
    this.GetSize = function () {
      var Result = 0.0;
      Result = 25;
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) Result = this.FListBox.FTreeView.FColumnsAppearance.FTopSize;
      return Result;
    };
    this.GetStroke = function () {
      var Result = null;
      Result = null;
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) Result = this.FListBox.FTreeView.FColumnsAppearance.FTopStroke;
      return Result;
    };
    this.SetFill = function (Value) {
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) this.FListBox.FTreeView.FColumnsAppearance.FTopFill.Assign(Value);
    };
    this.SetHorizontalTextAlign = function (Value) {
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null) && (this.FListBox.FTreeView.FColumns.GetCount() > 0)) this.FListBox.FTreeView.FColumns.GetItem$1(0).SetHorizontalTextAlign(Value);
    };
    this.SetSize = function (Value) {
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) this.FListBox.FTreeView.FColumnsAppearance.SetTopSize(Value);
    };
    this.SetStroke = function (Value) {
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) this.FListBox.FTreeView.FColumnsAppearance.FTopStroke.Assign(Value);
    };
    this.GetVerticalTextAlign = function () {
      var Result = 0;
      Result = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null) && (this.FListBox.FTreeView.FColumns.GetCount() > 0)) Result = this.FListBox.FTreeView.FColumns.GetItem$1(0).FVerticalTextAlign;
      return Result;
    };
    this.SetVerticalTextAlign = function (Value) {
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null) && (this.FListBox.FTreeView.FColumns.GetCount() > 0)) this.FListBox.FTreeView.FColumns.GetItem$1(0).SetVerticalTextAlign(Value);
    };
    this.GetFont = function () {
      var Result = null;
      Result = null;
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) Result = this.FListBox.FTreeView.FColumnsAppearance.FTopFont;
      return Result;
    };
    this.GetTrimming = function () {
      var Result = 0;
      Result = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone;
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null) && (this.FListBox.FTreeView.FColumns.GetCount() > 0)) Result = this.FListBox.FTreeView.FColumns.GetItem$1(0).FTrimming;
      return Result;
    };
    this.GetWordWrapping = function () {
      var Result = false;
      Result = false;
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null) && (this.FListBox.FTreeView.FColumns.GetCount() > 0)) Result = this.FListBox.FTreeView.FColumns.GetItem$1(0).FWordWrapping;
      return Result;
    };
    this.SetFont = function (Value) {
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) this.FListBox.FTreeView.FColumnsAppearance.FTopFont.Assign(Value);
    };
    this.SetTrimming = function (Value) {
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null) && (this.FListBox.FTreeView.FColumns.GetCount() > 0)) this.FListBox.FTreeView.FColumns.GetItem$1(0).SetTrimming(Value);
    };
    this.SetWordWrapping = function (Value) {
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null) && (this.FListBox.FTreeView.FColumns.GetCount() > 0)) this.FListBox.FTreeView.FColumns.GetItem$1(0).SetWordWrapping(Value);
    };
    this.GetSortIndicatorColor = function () {
      var Result = 0;
      Result = 16297243;
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) Result = this.FListBox.FTreeView.FColumnsAppearance.FSortIndicatorColor;
      return Result;
    };
    this.SetSortIndicatorColor = function (Value) {
      if ((this.FListBox != null) && (this.FListBox.FTreeView != null)) this.FListBox.FTreeView.FColumnsAppearance.SetSortIndicatorColor(Value);
    };
    this.Create$1 = function (AListBox) {
      this.FListBox = AListBox;
      return this;
    };
    var $r = this.$rtti;
    $r.addProperty("Visible",3,rtl.boolean,"GetVisible","SetVisible",4,{Default: false});
    $r.addProperty("Text",3,rtl.string,"GetText","SetText");
    $r.addProperty("Fill",3,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"GetFill","SetFill");
    $r.addProperty("Font",3,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"GetFont","SetFont");
    $r.addProperty("Stroke",3,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"GetStroke","SetStroke");
    $r.addProperty("HorizontalTextAlign",3,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"GetHorizontalTextAlign","SetHorizontalTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter});
    $r.addProperty("VerticalTextAlign",3,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"GetVerticalTextAlign","SetVerticalTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter});
    $r.addProperty("WordWrapping",3,rtl.boolean,"GetWordWrapping","SetWordWrapping",4,{Default: false});
    $r.addProperty("Trimming",3,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextTrimming"],"GetTrimming","SetTrimming",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone});
    $r.addProperty("Size",3,rtl.double,"GetSize","SetSize");
    $r.addProperty("SortIndicatorColor",3,pas["WEBLib.Graphics"].$rtti["TColor"],"GetSortIndicatorColor","SetSortIndicatorColor",4,{Default: 16297243});
  });
  rtl.createClass(this,"TTMSFNCListBoxCopyItems",this.TTMSFNCListBoxItems,function () {
  });
  this.$rtti.$MethodVar("TTMSFNCListBoxBeforeDrawSortIndicatorEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["ASortIndex",rtl.longint],["ASortKind",this.$rtti["TTMSFNCListBoxItemsSortKind"]],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCListBoxAfterDrawSortIndicatorEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["ASortIndex",rtl.longint],["ASortKind",this.$rtti["TTMSFNCListBoxItemsSortKind"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCListBoxNeedFilterDropDownDataEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AValues",pas.Classes.$rtti["TStrings"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCListBoxItemAnchorClickEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AItem",this.$rtti["TTMSFNCListBoxItem"]],["AAnchor",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCListBoxHeaderAnchorClickEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AAnchor",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCListBoxBeforeReorderItemEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFromItem",this.$rtti["TTMSFNCListBoxItem"]],["AToItem",this.$rtti["TTMSFNCListBoxItem"]],["ACanReorder",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCListBoxAfterReorderItemEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFromItem",this.$rtti["TTMSFNCListBoxItem"]],["AToItem",this.$rtti["TTMSFNCListBoxItem"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCListBoxBeforeDropItemEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFromItem",this.$rtti["TTMSFNCListBoxItem"]],["AToItem",this.$rtti["TTMSFNCListBoxItem"]],["ACanDrop",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCListBoxAfterDropItemEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFromItem",this.$rtti["TTMSFNCListBoxItem"]],["AToItem",this.$rtti["TTMSFNCListBoxItem"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCListBoxBeforeCopyToClipboardEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACanCopy",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCListBoxBeforeCutToClipboardEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACanCut",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCListBoxBeforePasteFromClipboardEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACanPaste",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCListBoxAfterCopyToClipboardEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCListBoxAfterCutToClipboardEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCListBoxAfterPasteFromClipboardEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCListBoxBeforeDrawItemTextEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AItem",this.$rtti["TTMSFNCListBoxItem"]],["AText",rtl.string],["AAllow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCListBoxAfterDrawItemTextEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AItem",this.$rtti["TTMSFNCListBoxItem"]],["AText",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCListBoxItemSelectedEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AItem",this.$rtti["TTMSFNCListBoxItem"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCListBoxItemClickEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AItem",this.$rtti["TTMSFNCListBoxItem"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCListBoxItemMouseEnterEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AItem",this.$rtti["TTMSFNCListBoxItem"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCListBoxItemMouseLeaveEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AItem",this.$rtti["TTMSFNCListBoxItem"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCListBoxScrollEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["APosition",rtl.double]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCListBoxGetItemHeightEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AItem",this.$rtti["TTMSFNCListBoxItem"]],["AHeight",rtl.double,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCListBoxBeforeDrawItemIconEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AItem",this.$rtti["TTMSFNCListBoxItem"]],["AIcon",pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"]],["AAllow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCListBoxAfterDrawItemIconEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AItem",this.$rtti["TTMSFNCListBoxItem"]],["AIcon",pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCListBoxBeforeDrawItemCheckEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AItem",this.$rtti["TTMSFNCListBoxItem"]],["ACheck",pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"]],["AAllow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCListBoxAfterDrawItemCheckEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AItem",this.$rtti["TTMSFNCListBoxItem"]],["ACheck",pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCListBoxBeforeDrawItemEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AItem",this.$rtti["TTMSFNCListBoxItem"]],["AAllow",rtl.boolean,1],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCListBoxAfterDrawItemEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AItem",this.$rtti["TTMSFNCListBoxItem"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCListBoxItemCompareEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Item1",this.$rtti["TTMSFNCListBoxItem"]],["Item2",this.$rtti["TTMSFNCListBoxItem"]],["ACompareResult",rtl.longint,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCListBoxFilterSelectEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACondition",rtl.string,1]]), methodkind: 0});
  this.TTMSFNCListBoxFilterOperation = {"0": "lfoSHORT", lfoSHORT: 0, "1": "lfoNONE", lfoNONE: 1, "2": "lfoAND", lfoAND: 2, "3": "lfoXOR", lfoXOR: 3, "4": "lfoOR", lfoOR: 4};
  this.$rtti.$Enum("TTMSFNCListBoxFilterOperation",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TTMSFNCListBoxFilterOperation});
  rtl.createClass(this,"TTMSFNCListBoxFilterData",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FCondition = "";
      this.FCaseSensitive = false;
      this.FSuffix = "";
      this.FPrefix = "";
      this.FOperation = 0;
    };
    this.Create$1 = function (ACollection) {
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      this.FCaseSensitive = true;
      return this;
    };
    this.Assign = function (Source) {
      var ASrcFilterData = null;
      ASrcFilterData = rtl.as(Source,$mod.TTMSFNCListBoxFilterData);
      if (ASrcFilterData != null) {
        this.FCondition = ASrcFilterData.FCondition;
        this.FCaseSensitive = ASrcFilterData.FCaseSensitive;
        this.FPrefix = ASrcFilterData.FPrefix;
        this.FSuffix = ASrcFilterData.FSuffix;
        this.FOperation = ASrcFilterData.FOperation;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Condition",0,rtl.string,"FCondition","FCondition");
    $r.addProperty("CaseSensitive",0,rtl.boolean,"FCaseSensitive","FCaseSensitive",4,{Default: true});
    $r.addProperty("Prefix",0,rtl.string,"FPrefix","FPrefix");
    $r.addProperty("Suffix",0,rtl.string,"FSuffix","FSuffix");
    $r.addProperty("Operation",0,$mod.$rtti["TTMSFNCListBoxFilterOperation"],"FOperation","FOperation");
  });
  rtl.createClass(this,"TTMSFNCListBoxFilter",pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$init.call(this);
      this.FOwner$1 = null;
    };
    this.$final = function () {
      this.FOwner$1 = undefined;
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$final.call(this);
    };
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.GetItem.call(this,Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      pas.Classes.TCollection.SetItem.call(this,Index,Value);
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,$mod.TTMSFNCListBoxFilterData);
      this.FOwner$1 = AOwner;
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      if (this.GetCount() === 1) {
        Result.FOperation = $mod.TTMSFNCListBoxFilterOperation.lfoNONE}
       else Result.FOperation = $mod.TTMSFNCListBoxFilterOperation.lfoAND;
      return Result;
    };
    this.Insert$1 = function (index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,index);
      return Result;
    };
  });
  this.$rtti.$DynArray("TTMSFNCListBoxFilteredItems",{eltype: this.$rtti["TTMSFNCListBoxItem"]});
  rtl.createClass(this,"TTMSFNCCustomListBox",pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$init.call(this);
      this.FUpdateCount$1 = 0;
      this.FSaveSelectedItemIndex = 0;
      this.FScrollToItem = false;
      this.FCopyItems = null;
      this.FAccepted = false;
      this.FItems = null;
      this.FTreeView = null;
      this.FDefaultItem = null;
      this.FItemsAppearance = null;
      this.FOnItemSelected = null;
      this.FInteraction = null;
      this.FHeader = null;
      this.FOnItemAnchorClick = null;
      this.FOnAfterCutToClipboard = null;
      this.FOnBeforePasteFromClipboard = null;
      this.FOnAfterReorderItem = null;
      this.FOnBeforeDropItem = null;
      this.FOnBeforeDrawItemText = null;
      this.FOnVScroll = null;
      this.FOnBeforeCopyToClipboard = null;
      this.FOnItemDblClick = null;
      this.FOnBeforeDrawItemCheck = null;
      this.FOnAfterDrawItemIcon = null;
      this.FOnBeforeDrawItem = null;
      this.FOnAfterPasteFromClipboard = null;
      this.FOnItemClick = null;
      this.FOnAfterDropItem = null;
      this.FOnAfterDrawItemText = null;
      this.FOnItemCompare = null;
      this.FOnBeforeCutToClipboard = null;
      this.FOnBeforeReorderItem = null;
      this.FOnNeedFilterDropDownData = null;
      this.FOnAfterCopyToClipboard = null;
      this.FOnFilterSelect = null;
      this.FOnAfterDrawItemCheck = null;
      this.FOnAfterDrawItem = null;
      this.FOnBeforeDrawItemIcon = null;
      this.FFilter = null;
      this.FOnBeforeDrawSortIndicator = null;
      this.FOnAfterDrawSortIndicator = null;
      this.FOnItemMouseLeave = null;
      this.FOnItemMouseEnter = null;
      this.FSortMode = 0;
      this.FOnHeaderAnchorClick = null;
      this.FGlobalFont = null;
    };
    this.$final = function () {
      this.FCopyItems = undefined;
      this.FItems = undefined;
      this.FTreeView = undefined;
      this.FDefaultItem = undefined;
      this.FItemsAppearance = undefined;
      this.FOnItemSelected = undefined;
      this.FInteraction = undefined;
      this.FHeader = undefined;
      this.FOnItemAnchorClick = undefined;
      this.FOnAfterCutToClipboard = undefined;
      this.FOnBeforePasteFromClipboard = undefined;
      this.FOnAfterReorderItem = undefined;
      this.FOnBeforeDropItem = undefined;
      this.FOnBeforeDrawItemText = undefined;
      this.FOnVScroll = undefined;
      this.FOnBeforeCopyToClipboard = undefined;
      this.FOnItemDblClick = undefined;
      this.FOnBeforeDrawItemCheck = undefined;
      this.FOnAfterDrawItemIcon = undefined;
      this.FOnBeforeDrawItem = undefined;
      this.FOnAfterPasteFromClipboard = undefined;
      this.FOnItemClick = undefined;
      this.FOnAfterDropItem = undefined;
      this.FOnAfterDrawItemText = undefined;
      this.FOnItemCompare = undefined;
      this.FOnBeforeCutToClipboard = undefined;
      this.FOnBeforeReorderItem = undefined;
      this.FOnNeedFilterDropDownData = undefined;
      this.FOnAfterCopyToClipboard = undefined;
      this.FOnFilterSelect = undefined;
      this.FOnAfterDrawItemCheck = undefined;
      this.FOnAfterDrawItem = undefined;
      this.FOnBeforeDrawItemIcon = undefined;
      this.FFilter = undefined;
      this.FOnBeforeDrawSortIndicator = undefined;
      this.FOnAfterDrawSortIndicator = undefined;
      this.FOnItemMouseLeave = undefined;
      this.FOnItemMouseEnter = undefined;
      this.FOnHeaderAnchorClick = undefined;
      this.FGlobalFont = undefined;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$final.call(this);
    };
    this.SetItems = function (Value) {
      this.FItems.Assign(Value);
    };
    this.SetDefaultItem = function (Value) {
      this.FDefaultItem.Assign(Value);
    };
    this.SetItemsAppearance = function (Value) {
      this.FItemsAppearance.Assign(Value);
    };
    this.GetItemIndex = function () {
      var Result = 0;
      Result = -1;
      if ((this.FTreeView != null) && (this.FTreeView.SelectedVirtualNodeCount() > 0) && (this.FTreeView.GetSelVirtualNode(0) != null)) Result = this.FTreeView.GetSelVirtualNode(0).FRow;
      return Result;
    };
    this.SetItemIndex = function (Value) {
      this.SelectItem(Value);
    };
    this.SetInteraction = function (Value) {
      this.FInteraction.Assign(Value);
    };
    this.GetBitmapContainer = function () {
      var Result = null;
      Result = null;
      if (this.FTreeView != null) Result = this.FTreeView.GetBitmapContainer();
      return Result;
    };
    this.SetBitmapContainer = function (Value) {
      this.FTreeView.SetBitmapContainer(Value);
    };
    this.SetHeader = function (Value) {
      this.FHeader.Assign(Value);
    };
    this.GetSelectedItem = function () {
      var Result = null;
      Result = null;
      if ((this.GetItemIndex() >= 0) && (this.GetItemIndex() <= (this.FItems.GetCount() - 1))) Result = this.FItems.GetItem$1(this.GetItemIndex());
      return Result;
    };
    this.SetSelectedItem = function (Value) {
      if (Value != null) this.SetItemIndex(Value.GetIndex());
    };
    this.GetSelItem = function (AIndex) {
      var Result = null;
      Result = null;
      if (this.FTreeView != null) Result = this.GetItemForNode(this.FTreeView.GetSelVirtualNode(AIndex));
      return Result;
    };
    this.GetVerticalScrollBarVisible = function () {
      var Result = false;
      Result = true;
      if (this.FTreeView != null) Result = this.FTreeView.FVerticalScrollBarVisible;
      return Result;
    };
    this.SetVerticalScrollBarVisible = function (Value) {
      if (this.FTreeView != null) this.FTreeView.SetVerticalScrollBarVisible(Value);
    };
    this.GetFill = function () {
      var Result = null;
      Result = null;
      if (this.FTreeView != null) Result = this.FTreeView.FFill;
      return Result;
    };
    this.GetStroke = function () {
      var Result = null;
      Result = null;
      if (this.FTreeView != null) Result = this.FTreeView.FStroke;
      return Result;
    };
    this.SetFill$1 = function (Value) {
      if (this.FTreeView != null) this.FTreeView.FFill.Assign(Value);
    };
    this.SetStroke$1 = function (Value) {
      if (this.FTreeView != null) this.FTreeView.FStroke.Assign(Value);
    };
    this.GetFilteredItems = function () {
      var Result = [];
      var I = 0;
      var li = null;
      for (var $l = 0, $end = this.FTreeView.FVisibleNodes.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        Result = rtl.arraySetLength(Result,null,rtl.length(Result) + 1);
        li = this.GetItemForNode(this.FTreeView.FVisibleNodes.GetItem(I));
        Result[rtl.length(Result) - 1] = li;
      };
      return Result;
    };
    this.SetGlobalFont = function (Value) {
      this.FGlobalFont.Assign(Value);
    };
    this.DataGetItemIndex = function () {
      var Result = 0;
      Result = this.GetItemIndex();
      return Result;
    };
    this.DataSetItemIndex = function (AValue) {
      this.SetItemIndex(AValue);
      this.FSaveSelectedItemIndex = AValue;
      this.FScrollToItem = true;
    };
    this.GetDocURL = function () {
      var Result = "";
      Result = pas["WEBLib.TMSFNCTypes"].TTMSFNCBaseDocURL + "tmsfncuipack/components/" + pas.SysUtils.LowerCase(this.$classname);
      return Result;
    };
    this.GetSubComponentArray = function () {
      var Result = [];
      Result = rtl.arraySetLength(Result,null,1);
      Result[0] = this.FTreeView;
      return Result;
    };
    this.IsAppearanceProperty = function (AObject, APropertyName, APropertyType) {
      var Result = false;
      Result = pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.IsAppearanceProperty.call(this,AObject,APropertyName,APropertyType);
      Result = Result || (APropertyName === "Header");
      return Result;
    };
    this.GetVersion = function () {
      var Result = "";
      Result = this.$class.GetVersionNumber(1,0,1,0);
      return Result;
    };
    this.CreateItems = function () {
      var Result = null;
      Result = $mod.TTMSFNCListBoxItems.$create("Create$3",[this]);
      return Result;
    };
    this.GetItemIndexForNode = function (ANode) {
      var Result = 0;
      Result = -1;
      if (ANode != null) Result = ANode.FRow;
      return Result;
    };
    this.GetItemForNode = function (ANode) {
      var Result = null;
      var i = 0;
      Result = null;
      i = this.GetItemIndexForNode(ANode);
      if ((i >= 0) && (i <= (this.FItems.GetCount() - 1))) Result = this.FItems.GetItem$1(i);
      return Result;
    };
    this.GetNodeForItemIndex = function (AItemIndex) {
      var Result = null;
      Result = null;
      if (this.FTreeView != null) Result = this.FTreeView.GetNodeForRow(AItemIndex);
      return Result;
    };
    this.Loaded = function () {
      pas["WEBLib.Controls"].TCustomControl.Loaded.call(this);
    };
    this.RegisterRuntimeClasses = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClass($mod.TTMSFNCCustomListBox);
    };
    this.ApplyStyle = function () {
      var I = 0;
      var c = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ApplyStyle.call(this);
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleTextFontColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FDefaultItem.SetTextColor(c);
        for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          this.FItems.GetItem$1(I).SetTextColor(c);
        };
      };
    };
    this.ResetToDefaultStyle = function () {
      var I = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ResetToDefaultStyle.call(this);
      this.FDefaultItem.SetTextColor(0x454545);
      this.FDefaultItem.SetSelectedTextColor(this.FDefaultItem.FTextColor);
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.FItems.GetItem$1(I).SetTextColor(0x454545);
        this.FItems.GetItem$1(I).SetSelectedTextColor(this.FDefaultItem.FTextColor);
      };
    };
    this.SetAdaptToStyle = function (Value) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.SetAdaptToStyle.apply(this,arguments);
      if (this.FTreeView != null) this.FTreeView.SetAdaptToStyle(this.GetAdaptToStyle());
    };
    this.UpdateItems = function () {
      var sel = null;
      if (this.IsDestroying()) return;
      if ((this.FTreeView != null) && (this.FUpdateCount$1 === 0)) {
        sel = this.GetSelectedItem();
        this.FTreeView.BeginUpdate();
        this.FTreeView.ClearNodeList();
        this.FTreeView.EndUpdate();
        this.SetSelectedItem(sel);
      };
    };
    this.DoGetNodeHeight = function (Sender, ANode, AColumn, AHeight) {
      if ((ANode.FRow >= 0) && (ANode.FRow <= (this.FItems.GetCount() - 1))) {
        if (this.FItems.GetItem$1(ANode.FRow).FHeight > -1) AHeight.set(this.FItems.GetItem$1(ANode.FRow).FHeight);
      };
    };
    this.DoGetNodeIcon = function (Sender, ANode, AColumn, ALarge, AIcon) {
      if ((ANode.FRow >= 0) && (ANode.FRow <= (this.FItems.GetCount() - 1))) {
        if ((this.GetBitmapContainer() != null) && (this.FItems.GetItem$1(ANode.FRow).FBitmapName !== "")) AIcon.set(this.GetBitmapContainer().FindBitmap$1(this.FItems.GetItem$1(ANode.FRow).FBitmapName));
        if (!(AIcon.get() != null)) AIcon.set(this.FItems.GetItem$1(ANode.FRow).FBitmap);
      };
    };
    this.DoGetNodeIconSize = function (Sender, ANode, AColumn, ALarge, AIcon, AIconWidth, AIconHeight) {
      var w = 0.0;
      var h = 0.0;
      if ((ANode.FRow >= 0) && (ANode.FRow <= (this.FItems.GetCount() - 1))) {
        w = this.FItems.GetItem$1(ANode.FRow).FBitmapWidth;
        if (w !== -1) AIconWidth.set(w);
        h = this.FItems.GetItem$1(ANode.FRow).FBitmapHeight;
        if (h !== -1) AIconHeight.set(h);
      };
    };
    this.DoGetNumberOfNodes = function (Sender, ANode, ANumberOfNodes) {
      if (ANode.FLevel === -1) ANumberOfNodes.set(this.FItems.GetCount());
    };
    this.DoGetNodeText = function (Sender, ANode, AColumn, AMode, AText) {
      if ((ANode.FRow >= 0) && (ANode.FRow <= (this.FItems.GetCount() - 1))) AText.set(this.FItems.GetItem$1(ANode.FRow).FText);
    };
    this.DoGetNodeTrimming = function (Sender, ANode, AColumn, ATrimming) {
      if ((ANode.FRow >= 0) && (ANode.FRow <= (this.FItems.GetCount() - 1))) ATrimming.set(this.FItems.GetItem$1(ANode.FRow).FTrimming);
    };
    this.DoGetNodeWordWrapping = function (Sender, ANode, AColumn, AWordWrapping) {
      if ((ANode.FRow >= 0) && (ANode.FRow <= (this.FItems.GetCount() - 1))) AWordWrapping.set(this.FItems.GetItem$1(ANode.FRow).FWordWrapping);
    };
    this.DoGetNodeHorizontalTextAlign = function (Sender, ANode, AColumn, AHorizontalTextAlign) {
      if ((ANode.FRow >= 0) && (ANode.FRow <= (this.FItems.GetCount() - 1))) AHorizontalTextAlign.set(this.FItems.GetItem$1(ANode.FRow).FTextAlign);
    };
    this.DoGetNodeVerticalTextAlign = function (Sender, ANode, AColumn, AVerticalTextAlign) {
      AVerticalTextAlign.set(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter);
    };
    this.DoGetNodeTextColor = function (Sender, ANode, AColumn, ATextColor) {
      if ((ANode.FRow >= 0) && (ANode.FRow <= (this.FItems.GetCount() - 1))) ATextColor.set(this.FItems.GetItem$1(ANode.FRow).FTextColor);
    };
    this.DoGetNodeSelectedTextColor = function (Sender, ANode, AColumn, ASelectedTextColor) {
      if ((ANode.FRow >= 0) && (ANode.FRow <= (this.FItems.GetCount() - 1))) ASelectedTextColor.set(this.FItems.GetItem$1(ANode.FRow).FSelectedTextColor);
    };
    this.DoGetNodeDisabledTextColor = function (Sender, ANode, AColumn, ADisabledTextColor) {
      if ((ANode.FRow >= 0) && (ANode.FRow <= (this.FItems.GetCount() - 1))) ADisabledTextColor.set(this.FItems.GetItem$1(ANode.FRow).FDisabledTextColor);
    };
    this.DoIsNodeEnabled = function (Sender, ANode, AEnabled) {
      if ((ANode.FRow >= 0) && (ANode.FRow <= (this.FItems.GetCount() - 1))) AEnabled.set(this.FItems.GetItem$1(ANode.FRow).FEnabled);
    };
    this.DoAfterSelectNode = function (Sender, ANode) {
      this.NotifyDataBinderSetActiveRecord();
      if (this.FOnItemSelected != null) this.FOnItemSelected(this,this.GetItemForNode(ANode));
      if ((this.FParent != null) && pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelector.isPrototypeOf(this.FParent) && (this.FParent.FOwner != null) && pas["WEBLib.TMSFNCControlPicker"].TTMSFNCControlPicker.isPrototypeOf(this.FParent.FOwner)) {
        rtl.as(this.FParent.FOwner,pas["WEBLib.TMSFNCControlPicker"].TTMSFNCControlPicker).UpdateDropDown();
      };
    };
    this.DoNeedFilterDropDownData = function (Sender, AColumn, AValues) {
      if (this.FOnNeedFilterDropDownData != null) this.FOnNeedFilterDropDownData(this,AValues);
    };
    this.DoFilterSelect = function (Sender, AColumn, ACondition) {
      if (this.FOnFilterSelect != null) this.FOnFilterSelect(this,ACondition);
    };
    this.DoBeforeDrawSortIndicator = function (Sender, AGraphics, ARect, AColumn, ASortIndex, ASortKind, ADefaultDraw) {
      var i = 0;
      var sk = 0;
      if (this.FOnBeforeDrawSortIndicator != null) {
        i = ASortKind;
        sk = i;
        this.FOnBeforeDrawSortIndicator(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),ASortIndex,sk,ADefaultDraw);
      };
    };
    this.DoAfterDrawSortIndicator = function (Sender, AGraphics, ARect, AColumn, ASortIndex, ASortKind) {
      var i = 0;
      var sk = 0;
      if (this.FOnAfterDrawSortIndicator != null) {
        i = ASortKind;
        sk = i;
        this.FOnAfterDrawSortIndicator(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),ASortIndex,sk);
      };
    };
    this.DoBeforeDrawNode = function (Sender, AGraphics, ARect, ANode, AAllow, ADefaultDraw) {
      if (this.FOnBeforeDrawItem != null) this.FOnBeforeDrawItem(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),this.GetItemForNode(ANode),AAllow,ADefaultDraw);
    };
    this.DoAfterDrawNode = function (Sender, AGraphics, ARect, ANode) {
      if (this.FOnAfterDrawItem != null) this.FOnAfterDrawItem(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),this.GetItemForNode(ANode));
    };
    this.DoItemCompare = function (AItem1, AItem2, ACompareResult) {
      if (this.FOnItemCompare != null) this.FOnItemCompare(this,AItem1,AItem2,ACompareResult);
    };
    this.DoBeforeDrawNodeText = function (Sender, AGraphics, ARect, AColumn, ANode, AText, AAllow) {
      if (this.FOnBeforeDrawItemText != null) this.FOnBeforeDrawItemText(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),this.GetItemForNode(ANode),AText,AAllow);
    };
    this.DoAfterDrawNodeText = function (Sender, AGraphics, ARect, AColumn, ANode, AText) {
      if (this.FOnAfterDrawItemText != null) this.FOnAfterDrawItemText(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),this.GetItemForNode(ANode),AText);
    };
    this.DoClick = function (Sender) {
      this.Click();
    };
    this.DoDblClick = function (Sender) {
      this.DblClick();
    };
    this.DoBeforeDrawNodeIcon = function (Sender, AGraphics, ARect, AColumn, ANode, AIcon, AAllow) {
      if (this.FOnBeforeDrawItemIcon != null) this.FOnBeforeDrawItemIcon(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),this.GetItemForNode(ANode),AIcon,AAllow);
    };
    this.DoAfterDrawNodeIcon = function (Sender, AGraphics, ARect, AColumn, ANode, AIcon) {
      if (this.FOnAfterDrawItemIcon != null) this.FOnAfterDrawItemIcon(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),this.GetItemForNode(ANode),AIcon);
    };
    this.DoBeforeDrawNodeCheck = function (Sender, AGraphics, ARect, AColumn, ANode, ACheck, AAllow) {
      if (this.FOnBeforeDrawItemCheck != null) this.FOnBeforeDrawItemCheck(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),this.GetItemForNode(ANode),ACheck,AAllow);
    };
    this.DoAfterDrawNodeCheck = function (Sender, AGraphics, ARect, AColumn, ANode, ACheck) {
      if (this.FOnAfterDrawItemCheck != null) this.FOnAfterDrawItemCheck(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),this.GetItemForNode(ANode),ACheck);
    };
    this.DoNodeAnchorClick = function (Sender, ANode, AColumn, AAnchor) {
      if (this.FOnItemAnchorClick != null) {
        this.FOnItemAnchorClick(this,this.GetItemForNode(ANode),AAnchor)}
       else pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.OpenURL(AAnchor);
    };
    this.DoColumnAnchorClick = function (Sender, AColumn, AAnchor) {
      if (this.FOnHeaderAnchorClick != null) {
        this.FOnHeaderAnchorClick(this,AAnchor)}
       else pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.OpenURL(AAnchor);
    };
    this.DoNodeClick = function (Sender, ANode) {
      if (this.FOnItemClick != null) this.FOnItemClick(this,this.GetItemForNode(ANode));
    };
    this.DoNodeMouseEnter = function (Sender, ANode) {
      if (this.FOnItemMouseEnter != null) this.FOnItemMouseEnter(this,this.GetItemForNode(ANode));
    };
    this.DoNodeMouseLeave = function (Sender, ANode) {
      if (this.FOnItemMouseLeave != null) this.FOnItemMouseLeave(this,this.GetItemForNode(ANode));
    };
    this.DoNodeDblClick = function (Sender, ANode) {
      if (this.FOnItemDblClick != null) this.FOnItemDblClick(this,this.GetItemForNode(ANode));
    };
    this.DoVScroll = function (Sender, APosition) {
      if (this.FOnVScroll != null) this.FOnVScroll(this,APosition);
    };
    this.DoTreeViewMouseWheelDown = function (Sender, Shift, MousePos, Handled) {
      if (this.FOnMouseWheelDown != null) this.FOnMouseWheelDown(this,rtl.refSet(Shift),pas.Types.TPoint.$clone(MousePos),Handled);
    };
    this.DoTreeViewMouseWheelUp = function (Sender, Shift, MousePos, Handled) {
      if (this.FOnMouseWheelUp != null) this.FOnMouseWheelUp(this,rtl.refSet(Shift),pas.Types.TPoint.$clone(MousePos),Handled);
    };
    this.DoTreeViewKeyDown = function (Sender, Key, Shift) {
      if (this.FOnKeyDown != null) this.FOnKeyDown(this,Key,rtl.refSet(Shift));
    };
    this.DoTreeViewKeyUp = function (Sender, Key, Shift) {
      if (this.FOnKeyUp != null) this.FOnKeyUp(this,Key,rtl.refSet(Shift));
    };
    this.DoTreeViewKeyPress = function (Sender, AChar) {
      if (this.FOnKeyPress != null) this.FOnKeyPress(this,AChar);
    };
    this.DoBeforeCutToClipboard = function (Sender, ACanCut) {
      if (this.FOnBeforeCutToClipboard != null) this.FOnBeforeCutToClipboard(this,ACanCut);
    };
    this.DoBeforeCopyToClipboard = function (Sender, ACanCopy) {
      if (this.FOnBeforeCopyToClipboard != null) this.FOnBeforeCopyToClipboard(this,ACanCopy);
    };
    this.DoBeforePasteFromClipboard = function (Sender, ACanPaste) {
      if (this.FOnBeforePasteFromClipboard != null) this.FOnBeforePasteFromClipboard(this,ACanPaste);
    };
    this.DoAfterCutToClipboard = function (Sender) {
      if (this.FOnAfterCutToClipboard != null) this.FOnAfterCutToClipboard(this);
    };
    this.DoAfterCopyToClipboard = function (Sender) {
      if (this.FOnAfterCopyToClipboard != null) this.FOnAfterCopyToClipboard(this);
    };
    this.DoAfterPasteFromClipboard = function (Sender) {
      if (this.FOnAfterPasteFromClipboard != null) this.FOnAfterPasteFromClipboard(this);
    };
    this.DoBeforeReorderItem = function (AFromItem, AToItem, ACanReorder) {
      if (this.FOnBeforeReorderItem != null) this.FOnBeforeReorderItem(this,AFromItem,AToItem,ACanReorder);
    };
    this.DoAfterReorderItem = function (AFromItem, AToItem) {
      if (this.FOnAfterReorderItem != null) this.FOnAfterReorderItem(this,AFromItem,AToItem);
    };
    this.DoBeforeDropItem = function (AFromItem, AToItem, ACanDrop) {
      if (this.FOnBeforeDropItem != null) this.FOnBeforeDropItem(this,AFromItem,AToItem,ACanDrop);
    };
    this.DoAfterDropItem = function (AFromItem, AToItem) {
      if (this.FOnAfterDropItem != null) this.FOnAfterDropItem(this,AFromItem,AToItem);
    };
    this.CustomizeTreeView = function (ATreeView) {
    };
    this.DoCustomDragOver = function (Sender, Source, Point, Accept) {
      Accept.set((this.FInteraction.GetDragDropMode() !== $mod.TTMSFNCListBoxDragDropMode.ldmNone) && pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCCustomTreeView.isPrototypeOf(Source) && (rtl.as(Source,pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCCustomTreeView).FDragNode != null));
      this.FAccepted = Accept.get();
    };
    this.DoCustomDragDrop = function (Sender, Source, Point) {
      var di = null;
      var dragi = null;
      var li = null;
      var dragn = null;
      var b = false;
      if (this.FAccepted && (Source != null) && pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCCustomTreeView.isPrototypeOf(Source) && $mod.TTMSFNCCustomListBox.isPrototypeOf(rtl.as(Source,pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCCustomTreeView).FParent) && (Source.FInteraction.FDragDropMode !== pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCTreeViewDragDropMode.tdmNone)) {
        dragn = rtl.as(Source,pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCCustomTreeView).FDragNode;
        if (dragn != null) {
          dragi = rtl.as(Source,pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCCustomTreeView).FParent.GetItemForNode(dragn);
          di = this.XYToItem(Point.X,Point.Y);
          if ((di !== dragi) && (dragi != null)) {
            b = true;
            this.DoBeforeDropItem(dragi,di,{get: function () {
                return b;
              }, set: function (v) {
                b = v;
              }});
            if (b) {
              this.BeginUpdate();
              rtl.as(Source,pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCCustomTreeView).FParent.BeginUpdate();
              if (di != null) {
                var $tmp = rtl.as(Source,pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCCustomTreeView).FParent.FInteraction.GetDragDropMode();
                if ($tmp === $mod.TTMSFNCListBoxDragDropMode.ldmMove) {
                  if (rtl.as(Source,pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCCustomTreeView).FParent === this) {
                    dragi.SetIndex(di.GetIndex());
                  } else {
                    li = this.FItems.Add$1();
                    li.Assign(dragi);
                    li.SetIndex(di.GetIndex());
                    rtl.as(Source,pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCCustomTreeView).FParent.FItems.Delete(dragi.GetIndex());
                  };
                } else if ($tmp === $mod.TTMSFNCListBoxDragDropMode.ldmCopy) {
                  li = this.FItems.Add$1();
                  li.Assign(dragi);
                  li.SetIndex(di.GetIndex());
                };
              } else {
                li = this.FItems.Add$1();
                li.Assign(dragi);
                var $tmp1 = rtl.as(Source,pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCCustomTreeView).FParent.FInteraction.GetDragDropMode();
                if ($tmp1 === $mod.TTMSFNCListBoxDragDropMode.ldmMove) rtl.as(Source,pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCCustomTreeView).FParent.FItems.Delete(dragi.GetIndex());
              };
              rtl.as(Source,pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCCustomTreeView).FDragNode = null;
              rtl.as(Source,pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCCustomTreeView).FParent.EndUpdate();
              this.EndUpdate();
              this.DoAfterDropItem(dragi,di);
            };
          };
        };
      };
    };
    this.DoCustomReorder = function (Sender, AFromNode, AToNode) {
      var it = null;
      var itt = null;
      var b = false;
      if (!(AFromNode != null) || !(AToNode != null)) return;
      b = true;
      it = this.GetItemForNode(AFromNode);
      itt = this.GetItemForNode(AToNode);
      this.DoBeforeReorderItem(it,itt,{get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }});
      if (b) {
        this.BeginUpdate();
        it.SetIndex(itt.GetIndex());
        this.EndUpdate();
        this.DoAfterReorderItem(it,itt);
      };
    };
    this.DoCopyToClipboard = function (Sender) {
      this.CopyToClipboard(this.FInteraction.GetClipboardMode() === $mod.TTMSFNCListBoxClipboardMode.lcmTextOnly);
    };
    this.DoCutToClipboard = function (Sender) {
      this.CutToClipboard(this.FInteraction.GetClipboardMode() === $mod.TTMSFNCListBoxClipboardMode.lcmTextOnly);
    };
    this.DoPasteFromClipboard = function (Sender) {
      this.PasteFromClipboard();
    };
    this.DoColumnSort = function (Sender, AColumn, ASortMode) {
      var i = 0;
      i = ASortMode;
      this.FItems.Sort$1(this.FInteraction.GetSorting() in rtl.createSet($mod.TTMSFNCListBoxSorting.lcsNormalCaseSensitive),i);
    };
    this.DoLookup = function (Sender, ALookupString) {
      this.LookupItem(ALookupString,this.FInteraction.FLookup.GetCaseSensitive(),this.FInteraction.FLookup.GetAutoSelect());
    };
    this.PickerGetContent = function () {
      var Result = "";
      Result = "";
      if (this.GetItemIndex() >= 0) Result = this.FItems.GetItem$1(this.GetItemIndex()).FText;
      return Result;
    };
    this.PickerSelectItem = function (AItemIndex) {
      if ((AItemIndex >= 0) && (AItemIndex <= (this.FItems.GetCount() - 1))) this.SetItemIndex(AItemIndex);
    };
    this.PickerGetSelectedItem = function () {
      var Result = 0;
      Result = this.GetItemIndex();
      return Result;
    };
    this.PickerGetVisibleItemCount = function () {
      var Result = 0;
      if (this.FTreeView != null) {
        Result = this.FTreeView.FVisibleNodes.GetCount()}
       else Result = 0;
      return Result;
    };
    this.PickerGetItemCount = function () {
      var Result = 0;
      Result = this.FItems.GetCount();
      return Result;
    };
    this.PickerGetItemHeight = function () {
      var Result = 0.0;
      Result = this.FItemsAppearance.GetFixedHeight();
      return Result;
    };
    this.PickerSetItemHeight = function (AValue) {
      this.FItemsAppearance.SetFixedHeight(AValue);
    };
    this.PickerGetItemWidth = function () {
      var Result = 0.0;
      Result = this.GetWidth();
      return Result;
    };
    this.PickerSetItemWidth = function (AValue) {
    };
    this.PickerGetNextSelectableItem = function (AItemIndex) {
      var Result = 0;
      if (AItemIndex < (this.FItems.GetCount() - 1)) {
        Result = AItemIndex + 1}
       else Result = AItemIndex;
      return Result;
    };
    this.PickerGetPreviousSelectableItem = function (AItemIndex) {
      var Result = 0;
      if (AItemIndex > 0) {
        Result = AItemIndex - 1}
       else Result = AItemIndex;
      return Result;
    };
    this.PickerGetFirstSelectableItem = function () {
      var Result = 0;
      if (this.FItems.GetCount() > 0) {
        Result = 0}
       else Result = -1;
      return Result;
    };
    this.PickerGetLastSelectableItem = function () {
      var Result = 0;
      if (this.FItems.GetCount() > 0) {
        Result = this.FItems.GetCount() - 1}
       else Result = -1;
      return Result;
    };
    this.PickerResetFilter = function () {
      this.RemoveFilter();
    };
    this.PickerApplyFilter = function (ACondition, ACaseSensitive) {
      this.ApplyFilter();
    };
    this.PickerLookupItem = function (ALookupString, ACaseSensitive) {
      var Result = pas["WEBLib.TMSFNCControlPicker"].TTMSFNCControlPickerFilterItem.$new();
      var it = null;
      it = this.LookupItem(ALookupString,ACaseSensitive,false);
      Result.ItemIndex = it.GetIndex();
      Result.ItemText = it.FText;
      return Result;
    };
    this.SetFonts = function (ASetType) {
      var I = 0;
      this.BeginUpdate();
      this.FGlobalFont.ApplyChange(this.FItemsAppearance.GetFont(),ASetType);
      this.FGlobalFont.ApplyChange(this.FHeader.GetFont(),ASetType);
      if (ASetType === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCAppearanceGlobalFontType.aftColor) {
        for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          this.FItems.GetItem$1(I).SetTextColor(this.FGlobalFont.FColor);
          this.FItems.GetItem$1(I).SetSelectedTextColor(this.FGlobalFont.FColor);
        };
      };
      this.EndUpdate();
    };
    this.Create$1 = function (AOwner) {
      var c = null;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Create$1.apply(this,arguments);
      this.FFilter = $mod.TTMSFNCListBoxFilter.$create("Create$3",[this]);
      this.FHeader = $mod.TTMSFNCListBoxHeader.$create("Create$1",[this]);
      this.FItemsAppearance = $mod.TTMSFNCListBoxItemsAppearance.$create("Create$1",[this]);
      this.FDefaultItem = $mod.TTMSFNCListBoxItem.$create("Create$1",[null]);
      this.FItems = this.CreateItems();
      this.FInteraction = $mod.TTMSFNCListBoxInteraction.$create("Create$1",[this]);
      this.FCopyItems = $mod.TTMSFNCListBoxCopyItems.$create("Create$3",[null]);
      this.FTreeView = pas["WEBLib.TMSFNCTreeView"].TTMSFNCTreeView.$create("Create$1",[this]);
      this.FTreeView.FStored = false;
      this.FTreeView.SetParent(this);
      this.FTreeView.FColumns.Clear();
      c = this.FTreeView.FColumns.Add$1();
      c.SetText("Header");
      c.SetHorizontalTextAlign(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter);
      this.FTreeView.ClearNodes();
      this.FTreeView.FColumnsAppearance.SetLayouts({});
      this.FTreeView.SetStretchScrollBars(true);
      this.FTreeView.FNodesAppearance.SetExpandColumn(-1);
      this.FTreeView.FNodesAppearance.SetLevelIndent(0);
      this.FTreeView.FNodesAppearance.SetShowLines(false);
      this.FTreeView.FNodesAppearance.SetExpandWidth(0);
      this.FTreeView.FNodesAppearance.SetExpandHeight(0);
      this.FTreeView.FNodesAppearance.SetSelectionArea(pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCTreeViewSelectionArea.tsaFull);
      this.FTreeView.FOnGetNumberOfNodes = rtl.createCallback(this,"DoGetNumberOfNodes");
      this.FTreeView.FOnGetNodeHeight = rtl.createCallback(this,"DoGetNodeHeight");
      this.FTreeView.FOnGetNodeIcon = rtl.createCallback(this,"DoGetNodeIcon");
      this.FTreeView.FOnGetNodeIconSize = rtl.createCallback(this,"DoGetNodeIconSize");
      this.FTreeView.FOnGetNodeTrimming = rtl.createCallback(this,"DoGetNodeTrimming");
      this.FTreeView.FOnGetNodeWordWrapping = rtl.createCallback(this,"DoGetNodeWordWrapping");
      this.FTreeView.FOnGetNodeTextColor = rtl.createCallback(this,"DoGetNodeTextColor");
      this.FTreeView.FOnGetNodeSelectedTextColor = rtl.createCallback(this,"DoGetNodeSelectedTextColor");
      this.FTreeView.FOnGetNodeDisabledTextColor = rtl.createCallback(this,"DoGetNodeDisabledTextColor");
      this.FTreeView.FOnGetNodeText = rtl.createCallback(this,"DoGetNodeText");
      this.FTreeView.FOnGetNodeHorizontalTextAlign = rtl.createCallback(this,"DoGetNodeHorizontalTextAlign");
      this.FTreeView.FOnGetNodeVerticalTextAlign = rtl.createCallback(this,"DoGetNodeVerticalTextAlign");
      this.FTreeView.FOnIsNodeEnabled = rtl.createCallback(this,"DoIsNodeEnabled");
      this.FTreeView.FOnAfterSelectNode = rtl.createCallback(this,"DoAfterSelectNode");
      this.FTreeView.FOnNeedFilterDropDownData = rtl.createCallback(this,"DoNeedFilterDropDownData");
      this.FTreeView.FOnFilterSelect = rtl.createCallback(this,"DoFilterSelect");
      this.FTreeView.FOnBeforeDrawNode = rtl.createCallback(this,"DoBeforeDrawNode");
      this.FTreeView.FOnAfterDrawNode = rtl.createCallback(this,"DoAfterDrawNode");
      this.FTreeView.FOnAfterDrawNodeIcon = rtl.createCallback(this,"DoAfterDrawNodeIcon");
      this.FTreeView.FOnBeforeDrawNodeIcon = rtl.createCallback(this,"DoBeforeDrawNodeIcon");
      this.FTreeView.FOnAfterDrawNodeCheck = rtl.createCallback(this,"DoAfterDrawNodeCheck");
      this.FTreeView.FOnBeforeDrawNodeCheck = rtl.createCallback(this,"DoBeforeDrawNodeCheck");
      this.FTreeView.FOnBeforeDrawNodeText = rtl.createCallback(this,"DoBeforeDrawNodeText");
      this.FTreeView.FOnAfterDrawNodeText = rtl.createCallback(this,"DoAfterDrawNodeText");
      this.FTreeView.FOnNodeAnchorClick = rtl.createCallback(this,"DoNodeAnchorClick");
      this.FTreeView.FOnBeforeDrawSortIndicator = rtl.createCallback(this,"DoBeforeDrawSortIndicator");
      this.FTreeView.FOnAfterDrawSortIndicator = rtl.createCallback(this,"DoAfterDrawSortIndicator");
      this.FTreeView.FOnNodeClick = rtl.createCallback(this,"DoNodeClick");
      this.FTreeView.FOnNodeMouseLeave = rtl.createCallback(this,"DoNodeMouseLeave");
      this.FTreeView.FOnNodeMouseEnter = rtl.createCallback(this,"DoNodeMouseEnter");
      this.FTreeView.FOnNodeDblClick = rtl.createCallback(this,"DoNodeDblClick");
      this.FTreeView.FOnVScroll = rtl.createCallback(this,"DoVScroll");
      this.FTreeView.FOnBeforeCutToClipboard = rtl.createCallback(this,"DoBeforeCutToClipboard");
      this.FTreeView.FOnBeforeCopyToClipboard = rtl.createCallback(this,"DoBeforeCopyToClipboard");
      this.FTreeView.FOnBeforePasteFromClipboard = rtl.createCallback(this,"DoBeforePasteFromClipboard");
      this.FTreeView.FOnAfterCutToClipboard = rtl.createCallback(this,"DoAfterCutToClipboard");
      this.FTreeView.FOnAfterCopyToClipboard = rtl.createCallback(this,"DoAfterCopyToClipboard");
      this.FTreeView.FOnAfterPasteFromClipboard = rtl.createCallback(this,"DoAfterPasteFromClipboard");
      this.FTreeView.FOnColumnAnchorClick = rtl.createCallback(this,"DoColumnAnchorClick");
      this.FTreeView.FOnMouseWheelDown = rtl.createCallback(this,"DoTreeViewMouseWheelDown");
      this.FTreeView.FOnMouseWheelUp = rtl.createCallback(this,"DoTreeViewMouseWheelUp");
      this.FTreeView.FOnKeyDown = rtl.createCallback(this,"DoTreeViewKeyDown");
      this.FTreeView.FOnKeyUp = rtl.createCallback(this,"DoTreeViewKeyUp");
      this.FTreeView.FOnKeyPress = rtl.createCallback(this,"DoTreeViewKeyPress");
      this.FTreeView.FOnCustomReorder = rtl.createCallback(this,"DoCustomReorder");
      this.FTreeView.FOnCustomDragOver = rtl.createCallback(this,"DoCustomDragOver");
      this.FTreeView.FOnCustomDragDrop = rtl.createCallback(this,"DoCustomDragDrop");
      this.FTreeView.FOnCustomCopyToClipboard = rtl.createCallback(this,"DoCopyToClipboard");
      this.FTreeView.FOnCustomCutToClipboard = rtl.createCallback(this,"DoCutToClipboard");
      this.FTreeView.FOnCustomPasteFromClipboard = rtl.createCallback(this,"DoPasteFromClipboard");
      this.FTreeView.FOnCustomColumnSort = rtl.createCallback(this,"DoColumnSort");
      this.FTreeView.FOnCustomLookup = rtl.createCallback(this,"DoLookup");
      this.FTreeView.FOnClick = rtl.createCallback(this,"DoClick");
      this.FTreeView.FOnDblClick = rtl.createCallback(this,"DoDblClick");
      this.CustomizeTreeView(this.FTreeView);
      this.FTreeView.SetAlign(pas["WEBLib.Controls"].TAlign.alClient);
      this.FGlobalFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCAppearanceGlobalFont.$create("Create$1",[this]);
      this.SetWidth(200);
      this.SetHeight(220);
      if (this.IsDesignTime()) this.InitSample();
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FGlobalFont");
      rtl.free(this,"FFilter");
      rtl.free(this,"FCopyItems");
      rtl.free(this,"FHeader");
      rtl.free(this,"FDefaultItem");
      rtl.free(this,"FInteraction");
      rtl.free(this,"FItems");
      rtl.free(this,"FTreeView");
      rtl.free(this,"FItemsAppearance");
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCCustomListBox.isPrototypeOf(Source)) this.FTreeView.Assign(rtl.as(Source,$mod.TTMSFNCCustomListBox).FTreeView);
    };
    this.AddItem = function (AText) {
      var Result = null;
      Result = this.FItems.Add$1();
      Result.SetText(AText);
      return Result;
    };
    this.XYToItem = function (X, Y) {
      var Result = null;
      var n = null;
      Result = null;
      if (this.FTreeView != null) {
        n = this.FTreeView.XYToNode(X,Y,0);
        if ((n != null) && (n.FRow >= 0) && (n.FRow <= (this.FItems.GetCount() - 1))) Result = this.FItems.GetItem$1(n.FRow);
      };
      return Result;
    };
    this.XYToItemIndex = function (X, Y) {
      var Result = 0;
      var it = null;
      Result = -1;
      it = this.XYToItem(X,Y);
      if (it != null) Result = it.GetIndex();
      return Result;
    };
    this.SelectedItemCount = function () {
      var Result = 0;
      Result = 0;
      if (this.FTreeView != null) Result = this.FTreeView.SelectedVirtualNodeCount();
      return Result;
    };
    this.GetItemsFromClipboard = function () {
      var Result = null;
      var s = "";
      var a = null;
      var AItem = null;
      var I = 0;
      var CurrStr = "";
      var templ = null;
      if (pas["WEBLib.TMSFNCUtils"].TTMSFNCClipBoard.HasFormat(pas["WEBLib.TMSFNCUtils"].TTMSFNCClipBoardFormat.cfText)) {
        s = pas["WEBLib.TMSFNCUtils"].TTMSFNCClipBoard.GetText();
        if (pas.System.Pos($mod.CLP_FMT,s) > 0) {
          templ = $mod.TTMSFNCCustomListBox.$create("Create$1",[null]);
          a = pas.Classes.TStringList.$create("Create$1");
          try {
            s = pas.SysUtils.StringReplace(s,$mod.CLP_FMT,"",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
            a.SetTextStr(s);
            try {
              for (var $l = 0, $end = a.GetCount() - 1; $l <= $end; $l++) {
                I = $l;
                CurrStr = a.Get(I);
                AItem = templ.AddItem("");
                AItem.LoadFromString(CurrStr);
              };
            } finally {
            };
          } finally {
            this.FCopyItems.Assign(templ.FItems);
            a = rtl.freeLoc(a);
            templ = rtl.freeLoc(templ);
          };
        };
      };
      Result = this.FCopyItems;
      return Result;
    };
    this.LookupItem = function (ALookupString, ACaseSensitive, AAutoSelect) {
      var Result = null;
      var v = "";
      var it = null;
      var i = 0;
      var s = "";
      Result = null;
      v = ALookupString;
      if (!ACaseSensitive) v = pas.SysUtils.UpperCase(v);
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        it = this.FItems.GetItem$1(i);
        s = it.GetStrippedHTMLText();
        if (!ACaseSensitive) s = pas.SysUtils.UpperCase(s);
        if (pas.System.Pos(v,s) === 1) {
          Result = it;
          break;
        };
      };
      if ((Result != null) && this.IsItemSelectable(Result) && AAutoSelect) {
        this.SelectItem(Result.GetIndex());
        this.ScrollToItem(Result.GetIndex());
      };
      return Result;
    };
    this.IsItemSelectable = function (AItem) {
      var Result = false;
      Result = true;
      if (AItem != null) {
        Result = AItem.FEnabled;
        if (!(this.FTreeView.FVisibleNodes.IndexOf(this.GetNodeForItemIndex(AItem.GetIndex())) > -1)) Result = false;
      };
      return Result;
    };
    this.RemoveItem = function (AItem) {
      if (AItem != null) this.FItems.Delete(AItem.GetIndex());
    };
    this.DoEnter = function () {
      pas["WEBLib.Controls"].TControl.DoEnter.call(this);
      if (this.FTreeView != null) {
        if (this.FTreeView.GetAllowFocus()) {
          this.FTreeView.SetFocus();
        };
        this.FTreeView.Invalidate();
      };
    };
    this.BeginUpdate = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBase.BeginUpdate.call(this);
      if (this.FTreeView != null) {
        if (this.FUpdateCount$1 === 0) this.FSaveSelectedItemIndex = this.GetItemIndex();
        this.FUpdateCount$1 += 1;
        this.FTreeView.BeginUpdate();
        this.FTreeView.ClearNodeList();
      };
    };
    this.EndUpdate = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBase.EndUpdate.call(this);
      if (this.FTreeView != null) {
        this.FUpdateCount$1 -= 1;
        this.FTreeView.EndUpdate();
        if (this.FUpdateCount$1 === 0) this.SetItemIndex(this.FSaveSelectedItemIndex);
      };
    };
    this.InitSample = function () {
      this.BeginUpdate();
      this.FItems.Clear$1();
      this.ResetToDefaultStyle();
      this.AddItem("Bugfix 376");
      this.AddItem("Bugfix 378");
      this.AddItem("Customer Update");
      this.AddItem("Install New server");
      this.AddItem("Meeting: Next Phase");
      this.AddItem("Release Planning");
      this.EndUpdate();
    };
    this.UnSelectAllItems = function () {
      if (this.FTreeView != null) this.FTreeView.UnSelectAllVirtualNodes();
    };
    this.LoadSettingsFromFile = function (AFileName) {
      var c = 0;
      var I = 0;
      c = this.FDefaultItem.FTextColor;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.LoadSettingsFromFile.apply(this,arguments);
      if ((c === this.FDefaultItem.FTextColor) && (c !== this.FItemsAppearance.GetFont().FColor)) {
        this.FDefaultItem.SetTextColor(this.FItemsAppearance.GetFont().FColor);
        for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          this.FItems.GetItem$1(I).SetTextColor(this.FDefaultItem.FTextColor);
        };
      };
    };
    this.LoadSettingsFromStream = function (AStream) {
      var c = 0;
      var I = 0;
      c = this.FDefaultItem.FTextColor;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.LoadSettingsFromStream.apply(this,arguments);
      if ((c === this.FDefaultItem.FTextColor) && (c !== this.FItemsAppearance.GetFont().FColor)) {
        this.FDefaultItem.SetTextColor(this.FItemsAppearance.GetFont().FColor);
        for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          this.FItems.GetItem$1(I).SetTextColor(this.FDefaultItem.FTextColor);
        };
      };
    };
    this.ScrollToItem = function (AItemIndex) {
      var t = null;
      if (this.FTreeView != null) {
        if ((AItemIndex >= 0) && (AItemIndex <= (this.FItems.GetCount() - 1))) {
          t = this.FTreeView;
          t.ScrollToVirtualNode(t.GetNodeForRow(AItemIndex),true,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeScrollPosition.tvnspTop,false);
        };
      };
    };
    this.SelectItem = function (AItemIndex) {
      var t = null;
      var n = null;
      if (this.FTreeView != null) {
        t = this.FTreeView;
        if ((AItemIndex >= 0) && (AItemIndex <= (this.FItems.GetCount() - 1))) {
          n = t.GetNodeForRow(AItemIndex);
          t.SelectVirtualNode(n);
          if (this.FScrollToItem) t.ScrollToVirtualNode(n,false,pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeScrollPosition.tvnspTop,false);
        } else t.SelectVirtualNode(null);
      };
      this.FScrollToItem = false;
    };
    this.SelectItems = function (AItemIndexes) {
      var t = null;
      var I = 0;
      var na = [];
      if (this.FTreeView != null) {
        t = this.FTreeView;
        na = rtl.arraySetLength(na,null,rtl.length(AItemIndexes));
        for (var $l = 0, $end = rtl.length(AItemIndexes) - 1; $l <= $end; $l++) {
          I = $l;
          na[I] = t.GetNodeForRow(AItemIndexes[I]);
        };
        t.SelectVirtualNodes(rtl.arrayRef(na));
      };
    };
    this.LoadFromStrings = function (AStrings) {
      var I = 0;
      this.BeginUpdate();
      this.FItems.Clear$1();
      for (var $l = 0, $end = AStrings.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.FItems.Add$1().SetText(AStrings.Get(I));
      };
      this.EndUpdate();
    };
    this.SaveToStrings = function (AStrings) {
      var I = 0;
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        AStrings.Add(this.FItems.GetItem$1(I).FText);
      };
    };
    this.CutToClipboard = function (ATextOnly) {
      var I = 0;
      this.BeginUpdate();
      this.CopyToClipboard(ATextOnly);
      for (var $l = this.SelectedItemCount() - 1; $l >= 0; $l--) {
        I = $l;
        this.RemoveItem(this.GetSelItem(I));
      };
      this.EndUpdate();
    };
    this.CopyToClipboard = function (ATextOnly) {
      var s = "";
      var I = 0;
      var it = null;
      var cl = null;
      cl = pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewIntegerList.$create("Create$1");
      try {
        s = "";
        for (var $l = 0, $end = this.SelectedItemCount() - 1; $l <= $end; $l++) {
          I = $l;
          it = this.GetSelItem(I);
          if ((it != null) && (cl.IndexOf(it.GetIndex()) === -1)) {
            s = s + it.SaveToString(ATextOnly) + pas["WEBLib.TMSFNCCustomTreeView"].ENDOFLINE;
            cl.Add(it.GetIndex());
          };
        };
        if (s !== "") pas["WEBLib.TMSFNCUtils"].TTMSFNCClipBoard.SetText($mod.CLP_FMT + s);
      } finally {
        cl = rtl.freeLoc(cl);
      };
    };
    this.PasteFromClipboard = function () {
      var s = "";
      var a = null;
      var AItem = null;
      var I = 0;
      var CurrStr = "";
      if (pas["WEBLib.TMSFNCUtils"].TTMSFNCClipBoard.HasFormat(pas["WEBLib.TMSFNCUtils"].TTMSFNCClipBoardFormat.cfText)) {
        s = pas["WEBLib.TMSFNCUtils"].TTMSFNCClipBoard.GetText();
        if (pas.System.Pos($mod.CLP_FMT,s) > 0) {
          a = pas.Classes.TStringList.$create("Create$1");
          try {
            s = pas.SysUtils.StringReplace(s,$mod.CLP_FMT,"",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
            a.SetTextStr(s);
            try {
              for (var $l = 0, $end = a.GetCount() - 1; $l <= $end; $l++) {
                I = $l;
                CurrStr = a.Get(I);
                AItem = this.AddItem("");
                AItem.LoadFromString(CurrStr);
              };
            } finally {
            };
          } finally {
            a = rtl.freeLoc(a);
          };
        };
      };
    };
    this.Sort = function (ACaseSensitive, ASortingMode) {
      this.FItems.Sort$1(ACaseSensitive,ASortingMode);
    };
    this.ClearSorting = function () {
      if (this.FTreeView != null) this.FTreeView.ClearSorting();
    };
    this.ApplyFilter = function () {
      var I = 0;
      var ft = null;
      var o = 0;
      if (this.FTreeView != null) {
        this.FTreeView.FFilter.Clear();
        for (var $l = 0, $end = this.FFilter.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          ft = this.FTreeView.FFilter.Add$1();
          ft.FColumn = 0;
          ft.FCondition = this.FFilter.GetItem$1(I).FCondition;
          ft.FCaseSensitive = this.FFilter.GetItem$1(I).FCaseSensitive;
          ft.FPrefix = this.FFilter.GetItem$1(I).FPrefix;
          ft.FSuffix = this.FFilter.GetItem$1(I).FSuffix;
          o = this.FFilter.GetItem$1(I).FOperation;
          ft.FOperation = o;
        };
        this.FTreeView.ApplyFilter();
      };
    };
    this.RemoveFilter = function () {
      if (this.FTreeView != null) this.FTreeView.RemoveFilter();
    };
    this.RemoveFilters = function () {
      if (this.FTreeView != null) this.FTreeView.RemoveFilters();
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCStylesManager);
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCControlPicker"].ITMSFNCControlPickerFull);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphicsTypes"].ITMSFNCAppearanceGlobalFont);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCListBox",this.TTMSFNCCustomListBox,function () {
    this.RegisterRuntimeClasses = function () {
      $mod.TTMSFNCCustomListBox.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClasses([$mod.TTMSFNCListBox,$mod.TTMSFNCListBoxItem]);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCStylesManager);
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCControlPicker"].ITMSFNCControlPickerFull);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphicsTypes"].ITMSFNCAppearanceGlobalFont);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Fill",3,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"GetFill","SetFill$1");
    $r.addProperty("Stroke",3,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"GetStroke","SetStroke$1");
    $r.addProperty("BitmapContainer",3,pas["WEBLib.TMSFNCBitmapContainer"].$rtti["TTMSFNCBitmapContainer"],"GetBitmapContainer","SetBitmapContainer");
    $r.addProperty("ItemsAppearance",2,$mod.$rtti["TTMSFNCListBoxItemsAppearance"],"FItemsAppearance","SetItemsAppearance");
    $r.addProperty("DefaultItem",2,$mod.$rtti["TTMSFNCListBoxItem"],"FDefaultItem","SetDefaultItem");
    $r.addProperty("Items",2,$mod.$rtti["TTMSFNCListBoxItems"],"FItems","SetItems");
    $r.addProperty("Header",2,$mod.$rtti["TTMSFNCListBoxHeader"],"FHeader","SetHeader");
    $r.addProperty("ItemIndex",3,rtl.longint,"GetItemIndex","SetItemIndex",4,{Default: -1});
    $r.addProperty("Interaction",2,$mod.$rtti["TTMSFNCListBoxInteraction"],"FInteraction","SetInteraction");
    $r.addProperty("OnItemSelected",0,$mod.$rtti["TTMSFNCListBoxItemSelectedEvent"],"FOnItemSelected","FOnItemSelected");
    $r.addProperty("Version",1,rtl.string,"GetVersion","");
    $r.addProperty("VerticalScrollBarVisible",3,rtl.boolean,"GetVerticalScrollBarVisible","SetVerticalScrollBarVisible",4,{Default: true});
    $r.addProperty("GlobalFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCAppearanceGlobalFont"],"FGlobalFont","SetGlobalFont");
    $r.addProperty("OnNeedFilterDropDownData",0,$mod.$rtti["TTMSFNCListBoxNeedFilterDropDownDataEvent"],"FOnNeedFilterDropDownData","FOnNeedFilterDropDownData");
    $r.addProperty("OnFilterSelect",0,$mod.$rtti["TTMSFNCListBoxFilterSelectEvent"],"FOnFilterSelect","FOnFilterSelect");
    $r.addProperty("OnBeforeDrawItem",0,$mod.$rtti["TTMSFNCListBoxBeforeDrawItemEvent"],"FOnBeforeDrawItem","FOnBeforeDrawItem");
    $r.addProperty("OnAfterDrawItem",0,$mod.$rtti["TTMSFNCListBoxAfterDrawItemEvent"],"FOnAfterDrawItem","FOnAfterDrawItem");
    $r.addProperty("OnItemCompare",0,$mod.$rtti["TTMSFNCListBoxItemCompareEvent"],"FOnItemCompare","FOnItemCompare");
    $r.addProperty("OnAfterDrawItemIcon",0,$mod.$rtti["TTMSFNCListBoxAfterDrawItemIconEvent"],"FOnAfterDrawItemIcon","FOnAfterDrawItemIcon");
    $r.addProperty("OnBeforeDrawItemIcon",0,$mod.$rtti["TTMSFNCListBoxBeforeDrawItemIconEvent"],"FOnBeforeDrawItemIcon","FOnBeforeDrawItemIcon");
    $r.addProperty("OnBeforeDrawItemText",0,$mod.$rtti["TTMSFNCListBoxBeforeDrawItemTextEvent"],"FOnBeforeDrawItemText","FOnBeforeDrawItemText");
    $r.addProperty("OnAfterDrawItemText",0,$mod.$rtti["TTMSFNCListBoxAfterDrawItemTextEvent"],"FOnAfterDrawItemText","FOnAfterDrawItemText");
    $r.addProperty("OnAfterDrawSortIndicator",0,$mod.$rtti["TTMSFNCListBoxAfterDrawSortIndicatorEvent"],"FOnAfterDrawSortIndicator","FOnAfterDrawSortIndicator");
    $r.addProperty("OnBeforeDrawSortIndicator",0,$mod.$rtti["TTMSFNCListBoxBeforeDrawSortIndicatorEvent"],"FOnBeforeDrawSortIndicator","FOnBeforeDrawSortIndicator");
    $r.addProperty("OnItemAnchorClick",0,$mod.$rtti["TTMSFNCListBoxItemAnchorClickEvent"],"FOnItemAnchorClick","FOnItemAnchorClick");
    $r.addProperty("OnItemClick",0,$mod.$rtti["TTMSFNCListBoxItemClickEvent"],"FOnItemClick","FOnItemClick");
    $r.addProperty("OnItemMouseLeave",0,$mod.$rtti["TTMSFNCListBoxItemMouseLeaveEvent"],"FOnItemMouseLeave","FOnItemMouseLeave");
    $r.addProperty("OnItemMouseEnter",0,$mod.$rtti["TTMSFNCListBoxItemMouseEnterEvent"],"FOnItemMouseEnter","FOnItemMouseEnter");
    $r.addProperty("OnItemDblClick",0,$mod.$rtti["TTMSFNCListBoxItemClickEvent"],"FOnItemDblClick","FOnItemDblClick");
    $r.addProperty("OnVScroll",0,$mod.$rtti["TTMSFNCListBoxScrollEvent"],"FOnVScroll","FOnVScroll");
    $r.addProperty("OnBeforeReorderItem",0,$mod.$rtti["TTMSFNCListBoxBeforeReorderItemEvent"],"FOnBeforeReorderItem","FOnBeforeReorderItem");
    $r.addProperty("OnAfterReorderItem",0,$mod.$rtti["TTMSFNCListBoxAfterReorderItemEvent"],"FOnAfterReorderItem","FOnAfterReorderItem");
    $r.addProperty("OnBeforeDropItem",0,$mod.$rtti["TTMSFNCListBoxBeforeDropItemEvent"],"FOnBeforeDropItem","FOnBeforeDropItem");
    $r.addProperty("OnAfterDropItem",0,$mod.$rtti["TTMSFNCListBoxAfterDropItemEvent"],"FOnAfterDropItem","FOnAfterDropItem");
    $r.addProperty("OnBeforeCutToClipboard",0,$mod.$rtti["TTMSFNCListBoxBeforeCutToClipboardEvent"],"FOnBeforeCutToClipboard","FOnBeforeCutToClipboard");
    $r.addProperty("OnBeforeCopyToClipboard",0,$mod.$rtti["TTMSFNCListBoxBeforeCopyToClipboardEvent"],"FOnBeforeCopyToClipboard","FOnBeforeCopyToClipboard");
    $r.addProperty("OnBeforePasteFromClipboard",0,$mod.$rtti["TTMSFNCListBoxBeforePasteFromClipboardEvent"],"FOnBeforePasteFromClipboard","FOnBeforePasteFromClipboard");
    $r.addProperty("OnAfterCutToClipboard",0,$mod.$rtti["TTMSFNCListBoxAfterCutToClipboardEvent"],"FOnAfterCutToClipboard","FOnAfterCutToClipboard");
    $r.addProperty("OnAfterCopyToClipboard",0,$mod.$rtti["TTMSFNCListBoxAfterCopyToClipboardEvent"],"FOnAfterCopyToClipboard","FOnAfterCopyToClipboard");
    $r.addProperty("OnAfterPasteFromClipboard",0,$mod.$rtti["TTMSFNCListBoxAfterPasteFromClipboardEvent"],"FOnAfterPasteFromClipboard","FOnAfterPasteFromClipboard");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
  $mod.$implcode = function () {
    rtl.createClass($impl,"TTMSFNCTreeViewOpen",pas["WEBLib.TMSFNCTreeView"].TTMSFNCTreeView,function () {
      rtl.addIntf(this,pas["WEBLib.TMSFNCControlPicker"].ITMSFNCControlPickerFull);
      rtl.addIntf(this,pas["WEBLib.TMSFNCGraphicsTypes"].ITMSFNCAppearanceGlobalFont);
      rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
      rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
      rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
      rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
      rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
      rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
      rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
      rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
      rtl.addIntf(this,pas.System.IUnknown);
    });
    rtl.createClass($impl,"TTMSFNCCustomTreeViewOpen",pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCCustomTreeView,function () {
      rtl.addIntf(this,pas["WEBLib.TMSFNCGraphicsTypes"].ITMSFNCAppearanceGlobalFont);
      rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
      rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
      rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
      rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
      rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
      rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
      rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
      rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
      rtl.addIntf(this,pas.System.IUnknown);
    });
    rtl.createClass($impl,"TTMSFNCCustomListBoxOpen",$mod.TTMSFNCCustomListBox,function () {
      rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCStylesManager);
      rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
      rtl.addIntf(this,pas["WEBLib.TMSFNCControlPicker"].ITMSFNCControlPickerFull);
      rtl.addIntf(this,pas["WEBLib.TMSFNCGraphicsTypes"].ITMSFNCAppearanceGlobalFont);
      rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
      rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
      rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
      rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
      rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
      rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
      rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
      rtl.addIntf(this,pas.System.IUnknown);
    });
    rtl.createClass($impl,"TShadowedCollection",pas.Classes.TPersistent,function () {
      this.$init = function () {
        pas.Classes.TPersistent.$init.call(this);
        this.FItemClass = null;
        this.FItems = null;
      };
      this.$final = function () {
        this.FItemClass = undefined;
        this.FItems = undefined;
        pas.Classes.TPersistent.$final.call(this);
      };
    });
  };
},["WEBLib.TMSFNCUtils","WEBLib.Controls","SysUtils","WEBLib.Graphics","WEBLib.TMSFNCCustomSelector"]);
rtl.module("WEBLib.TMSFNCBitmapSelector",["System","Classes","WEBLib.TMSFNCCustomSelector","WEBLib.TMSFNCTypes","WEBLib.TMSFNCBitmapContainer","WEBLib.TMSFNCGraphics"],function () {
  "use strict";
  var $mod = this;
  this.MAJ_VER = 1;
  this.MIN_VER = 0;
  this.REL_VER = 0;
  this.BLD_VER = 0;
  this.$rtti.$Class("TTMSFNCCustomBitmapSelector");
  this.TTMSFNCBitmapSelectorBitmapAlign = {"0": "baLeft", baLeft: 0, "1": "baCenter", baCenter: 1, "2": "baRight", baRight: 2};
  this.$rtti.$Enum("TTMSFNCBitmapSelectorBitmapAlign",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCBitmapSelectorBitmapAlign});
  rtl.createClass(this,"TTMSFNCBitmapSelectorItem",pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelectorItem,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelectorItem.$init.call(this);
      this.FOwner$1 = null;
      this.FBitmap = null;
      this.FBitmapAlign = 0;
      this.FBitmapName = "";
      this.FBitmapSize = 0.0;
    };
    this.$final = function () {
      this.FOwner$1 = undefined;
      this.FBitmap = undefined;
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelectorItem.$final.call(this);
    };
    this.SetBitmap = function (Value) {
      if (this.FBitmap !== Value) {
        this.FBitmap.Assign(Value);
        this.FOwner$1.InvalidateItems();
      };
    };
    this.SetBitmapAlign = function (Value) {
      if (this.FBitmapAlign !== Value) {
        this.FBitmapAlign = Value;
        this.FOwner$1.InvalidateItems();
      };
    };
    this.SetBitmapName = function (Value) {
      if (this.FBitmapName !== Value) {
        this.FBitmapName = Value;
        this.FOwner$1.InvalidateItems();
      };
    };
    this.SetBitmapSize = function (Value) {
      if (this.FBitmapSize !== Value) {
        this.FBitmapSize = Value;
        this.FOwner$1.InvalidateItems();
      };
    };
    this.GetBitmapContainer = function () {
      var Result = null;
      Result = this.FOwner$1.GetBitmapContainer();
      return Result;
    };
    this.IsBitmapSizeStored = function () {
      var Result = false;
      Result = this.FBitmapSize !== 0;
      return Result;
    };
    this.GetDisplayBitmap = function () {
      var Result = null;
      Result = null;
      if ((this.FBitmap != null) && !pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(this.FBitmap)) {
        Result = this.FBitmap}
       else if ((this.FOwner$1 != null) && (this.FOwner$1.GetBitmapContainer() != null) && (this.FBitmapName !== "")) Result = this.FOwner$1.GetBitmapContainer().FindBitmap$1(this.FBitmapName);
      return Result;
    };
    this.BitmapChanged = function (Sender) {
      this.FOwner$1.InvalidateItems();
    };
    this.Create$1 = function (ACollection) {
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelectorItem.Create$1.apply(this,arguments);
      if (this.FCollection != null) this.FOwner$1 = rtl.as(this.FCollection,$mod.TTMSFNCBitmapSelectorItems).FOwner$2;
      this.FBitmapAlign = $mod.TTMSFNCBitmapSelectorBitmapAlign.baCenter;
      this.FBitmapSize = 0;
      this.FBitmap = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      this.FBitmap.FOnChange = rtl.createCallback(this,"BitmapChanged");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FBitmap");
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelectorItem.Destroy.call(this);
    };
    this.Assign = function (Source) {
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelectorItem.Assign.apply(this,arguments);
      if ($mod.TTMSFNCBitmapSelectorItem.isPrototypeOf(Source)) {
        this.FBitmap.Assign(rtl.as(Source,$mod.TTMSFNCBitmapSelectorItem).FBitmap);
        this.FBitmapName = rtl.as(Source,$mod.TTMSFNCBitmapSelectorItem).FBitmapName;
        this.FBitmapSize = rtl.as(Source,$mod.TTMSFNCBitmapSelectorItem).FBitmapSize;
        this.FBitmapAlign = rtl.as(Source,$mod.TTMSFNCBitmapSelectorItem).FBitmapAlign;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Bitmap",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FBitmap","SetBitmap");
    $r.addProperty("BitmapName",2,rtl.string,"FBitmapName","SetBitmapName");
    $r.addProperty("BitmapAlign",2,$mod.$rtti["TTMSFNCBitmapSelectorBitmapAlign"],"FBitmapAlign","SetBitmapAlign",4,{Default: $mod.TTMSFNCBitmapSelectorBitmapAlign.baCenter});
    $r.addProperty("BitmapSize",14,rtl.double,"FBitmapSize","SetBitmapSize",4,{stored: "IsBitmapSizeStored"});
  });
  rtl.createClass(this,"TTMSFNCBitmapSelectorItems",pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelectorItems,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelectorItems.$init.call(this);
      this.FOwner$2 = null;
    };
    this.$final = function () {
      this.FOwner$2 = undefined;
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelectorItems.$final.call(this);
    };
    this.GetItem$2 = function (Index) {
      var Result = null;
      Result = this.GetItem$1(Index);
      return Result;
    };
    this.SetItem$2 = function (Index, Value) {
      this.SetItem$1(Index,Value);
    };
    this.CreateItemClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCBitmapSelectorItem;
      return Result;
    };
    this.Create$3 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelectorItems.Create$3.apply(this,arguments);
      this.FOwner$2 = rtl.as(AOwner,$mod.TTMSFNCCustomBitmapSelector);
      return this;
    };
    this.Add$2 = function () {
      var Result = null;
      Result = pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelectorItems.Add$1.call(this);
      return Result;
    };
    this.Insert$2 = function (Index) {
      var Result = null;
      Result = pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelectorItems.Insert$1.call(this,Index);
      return Result;
    };
  });
  this.$rtti.$MethodVar("TTMSFNCCustomSelectorBitmapSelected",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ABitmap",pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCustomSelectorBitmapDeselected",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ABitmap",pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"]]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCCustomBitmapSelector",pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCDefaultSelector,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCDefaultSelector.$init.call(this);
      this.FOnBitmapSelected = null;
      this.FOnBitmapDeselected = null;
      this.FBitmapContainer = null;
    };
    this.$final = function () {
      this.FOnBitmapSelected = undefined;
      this.FOnBitmapDeselected = undefined;
      this.FBitmapContainer = undefined;
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCDefaultSelector.$final.call(this);
    };
    this.GetSelectedBitmap = function () {
      var Result = null;
      Result = this.FindBitmapByItem(this.FSelectedItemIndex);
      return Result;
    };
    this.SetBitmapContainer = function (Value) {
      this.FBitmapContainer = Value;
      this.InvalidateItems();
    };
    this.GetItems = function () {
      var Result = null;
      Result = this.FItems;
      return Result;
    };
    this.SetItems$1 = function (Value) {
      this.GetItems().Assign(Value);
    };
    this.GetBitmapContainer = function () {
      var Result = null;
      Result = this.FBitmapContainer;
      return Result;
    };
    this.GetVersion = function () {
      var Result = "";
      Result = this.$class.GetVersionNumber(1,0,0,0);
      return Result;
    };
    this.Notification = function (AComponent, Operation) {
      pas["WEBLib.Menus"].TWebCustomControl.Notification.apply(this,arguments);
      if ((Operation === pas.Classes.TOperation.opRemove) && (AComponent === this.FBitmapContainer)) this.FBitmapContainer = null;
    };
    this.DoItemSelected = function (AItemIndex) {
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelector.DoItemSelected.apply(this,arguments);
      if (this.FOnBitmapSelected != null) this.FOnBitmapSelected(this,this.FindBitmapByItem(AItemIndex));
    };
    this.DoItemDeselected = function (AItemIndex) {
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelector.DoItemDeselected.apply(this,arguments);
      if (this.FOnBitmapDeselected != null) this.FOnBitmapDeselected(this,this.FindBitmapByItem(AItemIndex));
    };
    this.CreateItemsCollection = function () {
      var Result = null;
      Result = $mod.TTMSFNCBitmapSelectorItems.$create("Create$3",[this]);
      return Result;
    };
    this.DrawItemContent = function (AGraphics, ADisplayItem) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var it = null;
      var itbmp = null;
      var a = false;
      var sz = 0.0;
      var bmp = null;
      var bmpr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var w = 0.0;
      var h = 0.0;
      var bmpdr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      it = ADisplayItem.Item;
      if ((it != null) && $mod.TTMSFNCBitmapSelectorItem.isPrototypeOf(it)) {
        r.$assign(ADisplayItem.Rect);
        a = true;
        this.DoItemBeforeDrawContent(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),it.GetIndex(),{get: function () {
            return a;
          }, set: function (v) {
            a = v;
          }});
        if (a) {
          itbmp = rtl.as(it,$mod.TTMSFNCBitmapSelectorItem);
          bmp = itbmp.GetDisplayBitmap();
          if (bmp != null) {
            pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,-2,-2);
            sz = r.Bottom - r.Top;
            if (itbmp.FBitmapSize > 0) sz = itbmp.FBitmapSize;
            var $tmp = itbmp.FBitmapAlign;
            if ($tmp === $mod.TTMSFNCBitmapSelectorBitmapAlign.baLeft) {
              bmpr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top,r.Left + sz,r.Bottom))}
             else if ($tmp === $mod.TTMSFNCBitmapSelectorBitmapAlign.baCenter) {
              bmpr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + ((r.Right - r.Left - sz) / 2),r.Top,r.Left + ((r.Right - r.Left - sz) / 2) + sz,r.Bottom))}
             else if ($tmp === $mod.TTMSFNCBitmapSelectorBitmapAlign.baRight) bmpr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Right - sz,r.Top,r.Right,r.Bottom));
            w = 0;
            h = 0;
            $mod.GetAspectSize({get: function () {
                return w;
              }, set: function (v) {
                w = v;
              }},{get: function () {
                return h;
              }, set: function (v) {
                h = v;
              }},bmp.GetWidth(),bmp.GetHeight(),bmpr.Right - bmpr.Left,bmpr.Bottom - bmpr.Top,bmpr.Right - bmpr.Left,bmpr.Bottom - bmpr.Top,true,false,false);
            bmpdr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(bmpr.Left + ((bmpr.Right - bmpr.Left - w) / 2),bmpr.Top + ((bmpr.Bottom - bmpr.Top - h) / 2),bmpr.Left + ((bmpr.Right - bmpr.Left - w) / 2) + w,bmpr.Top + ((bmpr.Bottom - bmpr.Top - h) / 2) + h));
            bmpdr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Math.round(bmpdr.Left),Math.round(bmpdr.Top),Math.round(bmpdr.Right),Math.round(bmpdr.Bottom)));
            AGraphics.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(bmpdr),bmp,true,false,true,false);
          };
          this.DoItemAfterDrawContent(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),it.GetIndex());
        };
      };
    };
    this.DrawItemText = function (AGraphics, ADisplayItem) {
      var it = null;
      var bmp = null;
      var dps = pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelectorDisplayItem.$new();
      var sz = 0.0;
      if ((ADisplayItem.Item != null) && $mod.TTMSFNCBitmapSelectorItem.isPrototypeOf(ADisplayItem.Item)) {
        it = rtl.as(ADisplayItem.Item,$mod.TTMSFNCBitmapSelectorItem);
        bmp = it.GetDisplayBitmap();
        if (bmp != null) {
          dps.$assign(ADisplayItem);
          sz = dps.Rect.Bottom - dps.Rect.Top;
          if (it.FBitmapSize > 0) sz = it.FBitmapSize;
          var $tmp = it.FBitmapAlign;
          if ($tmp === $mod.TTMSFNCBitmapSelectorBitmapAlign.baLeft) {
            dps.Rect.Left = dps.Rect.Left + sz + 4}
           else if ($tmp === $mod.TTMSFNCBitmapSelectorBitmapAlign.baRight) dps.Rect.Right = dps.Rect.Right - sz - 4;
          pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelector.DrawItemText.call(this,AGraphics,pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelectorDisplayItem.$clone(dps));
        } else pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelector.DrawItemText.apply(this,arguments);
      } else pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelector.DrawItemText.apply(this,arguments);
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelector.Create$1.apply(this,arguments);
      this.SetWidth(135);
      this.SetHeight(135);
      return this;
    };
    this.LoadFromBitmapContainer = function () {
      var I = 0;
      var it = null;
      if (!(this.GetBitmapContainer() != null)) return;
      this.BeginUpdate();
      this.GetItems().Clear();
      for (var $l = 0, $end = this.GetBitmapContainer().GetItems().GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        it = this.GetItems().Add$2();
        it.SetBitmapName(this.GetBitmapContainer().GetItems().GetItemEx(I).FName);
      };
      this.EndUpdate();
    };
    this.FindItemByBitmap = function (ABitmap) {
      var Result = 0;
      var I = 0;
      var it = null;
      Result = -1;
      for (var $l = 0, $end = this.GetItems().GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        it = rtl.as(this.GetItems().GetItem$2(I),$mod.TTMSFNCBitmapSelectorItem);
        if (it.GetDisplayBitmap() === ABitmap) {
          Result = it.GetIndex();
          break;
        };
      };
      return Result;
    };
    this.FindBitmapByItem = function (AItem) {
      var Result = null;
      var I = 0;
      var it = null;
      Result = null;
      for (var $l = 0, $end = this.GetItems().GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        it = rtl.as(this.GetItems().GetItem$2(I),$mod.TTMSFNCBitmapSelectorItem);
        if (it.GetIndex() === AItem) {
          Result = it.GetDisplayBitmap();
          break;
        };
      };
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCBitmapSelector",this.TTMSFNCCustomBitmapSelector,function () {
    this.RegisterRuntimeClasses = function () {
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelector.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClasses([$mod.TTMSFNCBitmapSelector,$mod.TTMSFNCBitmapSelectorItem]);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Appearance",2,pas["WEBLib.TMSFNCCustomSelector"].$rtti["TTMSFNCCustomSelectorAppearance"],"FAppearance","SetAppearance");
    $r.addProperty("Rows",2,rtl.longint,"FRows","SetRows",4,{Default: 4});
    $r.addProperty("Columns",2,rtl.longint,"FColumns","SetColumns",4,{Default: 4});
    $r.addProperty("Items",3,$mod.$rtti["TTMSFNCBitmapSelectorItems"],"GetItems","SetItems$1");
    $r.addProperty("OnBitmapSelected",0,$mod.$rtti["TTMSFNCCustomSelectorBitmapSelected"],"FOnBitmapSelected","FOnBitmapSelected");
    $r.addProperty("OnBitmapDeselected",0,$mod.$rtti["TTMSFNCCustomSelectorBitmapDeselected"],"FOnBitmapDeselected","FOnBitmapDeselected");
    $r.addProperty("BitmapContainer",3,pas["WEBLib.TMSFNCBitmapContainer"].$rtti["TTMSFNCBitmapContainer"],"GetBitmapContainer","SetBitmapContainer");
    $r.addProperty("OnItemSelected",0,pas["WEBLib.TMSFNCCustomSelector"].$rtti["TTMSFNCCustomSelectorItemSelected"],"FOnItemSelected","FOnItemSelected");
    $r.addProperty("SelectedItemIndex",2,rtl.longint,"FSelectedItemIndex","SetSelectedItemIndex",4,{Default: -1});
    $r.addProperty("OnItemBeforeDrawBackground",0,pas["WEBLib.TMSFNCCustomSelector"].$rtti["TTMSFNCCustomSelectorItemBeforeDrawBackground"],"FOnItemBeforeDrawBackground","FOnItemBeforeDrawBackground");
    $r.addProperty("OnItemAfterDrawBackground",0,pas["WEBLib.TMSFNCCustomSelector"].$rtti["TTMSFNCCustomSelectorItemAfterDrawBackground"],"FOnItemAfterDrawBackground","FOnItemAfterDrawBackground");
    $r.addProperty("OnItemBeforeDrawContent",0,pas["WEBLib.TMSFNCCustomSelector"].$rtti["TTMSFNCCustomSelectorItemBeforeDrawContent"],"FOnItemBeforeDrawContent","FOnItemBeforeDrawContent");
    $r.addProperty("OnItemAfterDrawContent",0,pas["WEBLib.TMSFNCCustomSelector"].$rtti["TTMSFNCCustomSelectorItemAfterDrawContent"],"FOnItemAfterDrawContent","FOnItemAfterDrawContent");
    $r.addProperty("OnBeforeDraw",0,pas["WEBLib.TMSFNCCustomSelector"].$rtti["TTMSFNCCustomSelectorBeforeDraw"],"FOnBeforeDraw$1","FOnBeforeDraw$1");
    $r.addProperty("OnAfterDraw",0,pas["WEBLib.TMSFNCCustomSelector"].$rtti["TTMSFNCCustomSelectorAfterDraw"],"FOnAfterDraw$1","FOnAfterDraw$1");
    $r.addProperty("OnItemBeforeDrawText",0,pas["WEBLib.TMSFNCCustomSelector"].$rtti["TTMSFNCCustomSelectorItemBeforeDrawText"],"FOnItemBeforeDrawText","FOnItemBeforeDrawText");
    $r.addProperty("OnItemAfterDrawText",0,pas["WEBLib.TMSFNCCustomSelector"].$rtti["TTMSFNCCustomSelectorItemAfterDrawText"],"FOnItemAfterDrawText","FOnItemAfterDrawText");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
  this.GetAspectSize = function (w, h, ow, oh, nw, nh, crw, crh, asp, st, cr) {
    var arc = 0.0;
    var ar = 0.0;
    if (asp) {
      if ((ow > 0) && (oh > 0) && (nw > 0) && (nh > 0)) {
        if ((ow < nw) && (oh < nh) && !st) {
          w.set(ow);
          h.set(oh);
        } else {
          if ((ow / oh) < (nw / nh)) {
            h.set(nh);
            w.set((nh * ow) / oh);
          } else {
            w.set(nw);
            h.set((nw * oh) / ow);
          };
        };
      } else {
        w.set(0);
        h.set(0);
      };
    } else {
      if (st) {
        w.set(nw);
        h.set(nh);
      } else {
        w.set(ow);
        h.set(oh);
        if (cr) {
          if ((w.get() >= h.get()) && (w.get() > 0)) {
            h.set((crw / w.get()) * h.get());
            w.set(crw);
          } else if ((h.get() >= w.get()) && (h.get() > 0)) {
            w.set((crh / h.get()) * w.get());
            h.set(crh);
          };
          if (h.get() === 0) {
            ar = 1}
           else ar = w.get() / h.get();
          if (crh === 0) {
            arc = 1}
           else arc = crw / crh;
          if ((ar < 1) || (arc > ar)) {
            h.set(crw / ar);
            w.set(crw);
          } else {
            w.set(ar * crh);
            h.set(crh);
          };
        };
      };
    };
  };
},["WEBLib.TMSFNCUtils","Types"]);
rtl.module("WEBLib.TMSFNCToolBarRes",["System"],function () {
  "use strict";
  var $mod = this;
  this.TMSFNCTOOLBAREXPAND = "data:image/PNG;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOvwAADr8B" + "OAVTJAAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4zjOaXUAAAACVJREFUGFdj+P//P07MEBYW9h8Xxi8J" + "AjglYACnBAzglMAEDAwARZ1DA4NRF38AAAAASUVORK5CYII=";
  this.TMSFNCTOOLBAREXPANDLARGE = this.TMSFNCTOOLBAREXPAND;
  this.TMSFNCTOOLBAREXPAND2 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOvgAADr4" + "B6kKxwAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xNkRpr/UAAAA3SURBVBhXY3j69KktLgyS/I8LE5RsQxeE4jaQpCKIgSQIlgBi" + "RQYQADGgAqgSMABVkI2QYGAAANnukE/t/B6ZAAAAAElFTkSuQmCC";
  this.TMSFNCTOOLBAREXPAND2LARGE = this.TMSFNCTOOLBAREXPAND;
  this.TMSFNCTOOLBAROPTIONSMENU = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAJCAYAAAD+WDajAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOvwA" + "ADr8BOAVTJAAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4zjOaXUAAAACpJREFUKFNjwAvCwsL+48IM///jxvh1YhOEYZz2giVg" + "AKcEDOCUwAQMDAAqj1EKDJG5XAAAAABJRU5ErkJggg==";
  this.TMSFNCTOOLBAROPTIONSMENULARGE = this.TMSFNCTOOLBAROPTIONSMENU;
  this.TMSFNCTOOLBARQUICKMENU = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwgAADs" + "IBFShKgAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xNkRpr/UAAAAlSURBVBhXYwCC/9gwEAApKAMbJl4SnY0igCQIw3gkcUowMP" + "wHALBNZJw15C+yAAAAAElFTkSuQmCC";
  this.TMSFNCTOOLBARQUICKMENU2 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAA" + "AAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAAAL0lEQVQYV2P4jxswwCRBNAYGESCA" + "IQHCIAIEYAIgAGejC8D4YEBQEqvE/////wMA7H6pV7j5gXMAAAAASUVORK5CYII=";
  $mod.$init = function () {
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBAREXPAND);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBAREXPAND2);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBAROPTIONSMENU);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARQUICKMENU);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARQUICKMENU2);
  };
},["WEBLib.TMSFNCTypes"]);
rtl.module("WEBLib.TMSFNCEdit",["System","Classes","WEBLib.TMSFNCToolBar","WEBLib.TMSFNCToolBarRes","WEBLib.TMSFNCCustomControl","WEBLib.TMSFNCTypes","WEBLib.TMSFNCPopup","WEBLib.ExtCtrls","WEBLib.StdCtrls","WEBLib.Graphics","WEBLib.Controls","WEBLib.TMSFNCGraphicsTypes","WEBLib.TMSFNCBitmapContainer","Web"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.MAJ_VER = 1;
  this.MIN_VER = 0;
  this.REL_VER = 4;
  this.BLD_VER = 3;
  this.LOOKUPITEMHEIGHT = 18;
  this.TTMSFNCEditType = {"0": "etString", etString: 0, "1": "etNumeric", etNumeric: 1, "2": "etSignedNumeric", etSignedNumeric: 2, "3": "etFloat", etFloat: 3, "4": "etSignedFloat", etSignedFloat: 4, "5": "etUpperCase", etUpperCase: 5, "6": "etMixedCase", etMixedCase: 6, "7": "etLowerCase", etLowerCase: 7, "8": "etMoney", etMoney: 8, "9": "etHex", etHex: 9, "10": "etAlphaNumeric", etAlphaNumeric: 10, "11": "etValidChars", etValidChars: 11};
  this.$rtti.$Enum("TTMSFNCEditType",{minvalue: 0, maxvalue: 11, ordtype: 1, enumtype: this.TTMSFNCEditType});
  this.TTMSFNCEditPrecisionDisplay = {"0": "pdNormal", pdNormal: 0, "1": "pdShortest", pdShortest: 1};
  this.$rtti.$Enum("TTMSFNCEditPrecisionDisplay",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCEditPrecisionDisplay});
  this.$rtti.$Class("TTMSFNCEdit");
  rtl.createClass(this,"TTMSFNCEditLookupSettings",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FDisplayList = null;
      this.FValueList = null;
      this.FDisplayCount = 0;
      this.FColor = 0;
      this.FEnabled = false;
      this.FNumChars = 0;
      this.FCaseSensitive = false;
      this.FHistory = false;
      this.FMulti = false;
      this.FSeparator = "\x00";
      this.FAcceptOnTab = false;
      this.FWidth = 0;
      this.FHeight = 0;
      this.FUseValueList = false;
      this.FMinimumWidth = 0;
      this.FMinimumHeight = 0;
    };
    this.$final = function () {
      this.FDisplayList = undefined;
      this.FValueList = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetDisplayList = function (Value) {
      this.FDisplayList.Assign(Value);
    };
    this.SetValueList = function (Value) {
      this.FValueList.Assign(Value);
    };
    this.SetNumChars = function (Value) {
      if (Value > 0) this.FNumChars = Value;
    };
    this.SetHeight = function (Value) {
      this.FHeight = Value;
    };
    this.SetWidth = function (Value) {
      this.FWidth = Value;
    };
    this.SetMinimumHeight = function (Value) {
      this.FMinimumHeight = Value;
    };
    this.SetMinimumWidth = function (Value) {
      this.FMinimumWidth = Value;
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FUseValueList = true;
      this.FWidth = 0;
      this.FMinimumWidth = 0;
      this.FHeight = 0;
      this.FMinimumHeight = 0;
      this.FDisplayList = pas.Classes.TStringList.$create("Create$1");
      this.FDisplayList.SetSorted(true);
      this.FDisplayList.FDuplicates = pas.Types.TDuplicates.dupIgnore;
      this.FValueList = pas.Classes.TStringList.$create("Create$1");
      this.FColor = 16777215;
      this.FDisplayCount = 4;
      this.FNumChars = 2;
      this.FEnabled = false;
      this.FSeparator = ";";
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FValueList");
      rtl.free(this,"FDisplayList");
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCEditLookupSettings.isPrototypeOf(Source)) {
        this.FAcceptOnTab = rtl.as(Source,$mod.TTMSFNCEditLookupSettings).FAcceptOnTab;
        this.FCaseSensitive = rtl.as(Source,$mod.TTMSFNCEditLookupSettings).FCaseSensitive;
        this.FColor = rtl.as(Source,$mod.TTMSFNCEditLookupSettings).FColor;
        this.FDisplayCount = rtl.as(Source,$mod.TTMSFNCEditLookupSettings).FDisplayCount;
        this.FDisplayList.Assign(rtl.as(Source,$mod.TTMSFNCEditLookupSettings).FDisplayList);
        this.FEnabled = rtl.as(Source,$mod.TTMSFNCEditLookupSettings).FEnabled;
        this.FHistory = rtl.as(Source,$mod.TTMSFNCEditLookupSettings).FHistory;
        this.FNumChars = rtl.as(Source,$mod.TTMSFNCEditLookupSettings).FNumChars;
        this.FValueList.Assign(rtl.as(Source,$mod.TTMSFNCEditLookupSettings).FValueList);
        this.FMulti = rtl.as(Source,$mod.TTMSFNCEditLookupSettings).FMulti;
        this.FSeparator = rtl.as(Source,$mod.TTMSFNCEditLookupSettings).FSeparator;
        this.FWidth = rtl.as(Source,$mod.TTMSFNCEditLookupSettings).FWidth;
        this.FHeight = rtl.as(Source,$mod.TTMSFNCEditLookupSettings).FHeight;
        this.FMinimumWidth = rtl.as(Source,$mod.TTMSFNCEditLookupSettings).FMinimumWidth;
        this.FMinimumHeight = rtl.as(Source,$mod.TTMSFNCEditLookupSettings).FMinimumHeight;
        this.FUseValueList = rtl.as(Source,$mod.TTMSFNCEditLookupSettings).FUseValueList;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("CaseSensitive",0,rtl.boolean,"FCaseSensitive","FCaseSensitive",4,{Default: false});
    $r.addProperty("DisplayCount",0,rtl.longint,"FDisplayCount","FDisplayCount",4,{Default: 4});
    $r.addProperty("DisplayList",2,pas.Classes.$rtti["TStringList"],"FDisplayList","SetDisplayList");
    $r.addProperty("Enabled",0,rtl.boolean,"FEnabled","FEnabled",4,{Default: false});
    $r.addProperty("History",0,rtl.boolean,"FHistory","FHistory",4,{Default: false});
    $r.addProperty("NumChars",2,rtl.longint,"FNumChars","SetNumChars",4,{Default: 2});
    $r.addProperty("ValueList",2,pas.Classes.$rtti["TStringList"],"FValueList","SetValueList");
    $r.addProperty("Multi",0,rtl.boolean,"FMulti","FMulti",4,{Default: false});
    $r.addProperty("Separator",0,rtl.char,"FSeparator","FSeparator");
    $r.addProperty("Width",2,rtl.longint,"FWidth","SetWidth",4,{Default: 0});
    $r.addProperty("Height",2,rtl.longint,"FHeight","SetHeight",4,{Default: 0});
    $r.addProperty("MinimumWidth",2,rtl.longint,"FMinimumWidth","SetMinimumWidth",4,{Default: 0});
    $r.addProperty("MinimumHeight",2,rtl.longint,"FMinimumHeight","SetMinimumHeight",4,{Default: 0});
    $r.addProperty("UseValueList",0,rtl.boolean,"FUseValueList","FUseValueList",4,{Default: true});
  });
  this.$rtti.$MethodVar("TTMSFNCEditLookupSelectEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Value",rtl.string,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCEditLookupIndexSelectEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Index",rtl.longint],["Value",rtl.string,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCEditLookupNeedDataEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Value",rtl.string],["List",pas.Classes.$rtti["TStrings"]],["ItemIndex",rtl.longint,1]]), methodkind: 0});
  this.$rtti.$DynArray("TTMSFNCEditHexCharacterArray",{eltype: rtl.char});
  rtl.createClass(this,"TTMSFNCLookupListBoxItem",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FIdx = 0;
    };
    this.Create$1 = function (AIdx) {
      this.FIdx = AIdx;
      return this;
    };
  });
  rtl.createClass(this,"TTMSFNCLookupList",pas.Classes.TList,function () {
  });
  rtl.createClass(this,"TTMSFNCEdit",pas["WEBLib.StdCtrls"].TCustomEdit,function () {
    this.$init = function () {
      pas["WEBLib.StdCtrls"].TCustomEdit.$init.call(this);
      this.FLookupListBoxItems = null;
      this.FStyleElements = {};
      this.FAllowFocus = false;
      this.FLookupFormTimer = null;
      this.FKeyDown = 0;
      this.FShiftState = {};
      this.FEditType$1 = 0;
      this.FValidChars = "";
      this.FLookupList = null;
      this.FLookupListBox = null;
      this.FLookup = null;
      this.FOnLookupSelect = null;
      this.FOnLookupIndexSelect = null;
      this.FSigned = false;
      this.FPrefix = "";
      this.FSuffix = "";
      this.FIsModified = false;
      this.FLengthLimit = 0;
      this.FFullTextSearch = false;
      this.FAutoThousandSeparator = false;
      this.FPrecision = 0;
      this.FPrecisionDisplay = 0;
      this.FBlockChange = false;
      this.FAllowNumericNullValue = false;
      this.FAutoComplete = false;
      this.FOnCloseWithEscape = null;
      this.FOnLookupNeedData = null;
      this.FAutoClose = false;
      this.FOnLookupClose = null;
      this.FOnLookupOpen = null;
    };
    this.$final = function () {
      this.FLookupListBoxItems = undefined;
      this.FStyleElements = undefined;
      this.FLookupFormTimer = undefined;
      this.FShiftState = undefined;
      this.FLookupList = undefined;
      this.FLookupListBox = undefined;
      this.FLookup = undefined;
      this.FOnLookupSelect = undefined;
      this.FOnLookupIndexSelect = undefined;
      this.FOnCloseWithEscape = undefined;
      this.FOnLookupNeedData = undefined;
      this.FOnLookupClose = undefined;
      this.FOnLookupOpen = undefined;
      pas["WEBLib.StdCtrls"].TCustomEdit.$final.call(this);
    };
    this.CloseLookup = function () {
      if (this.CanFocus()) this.SetFocus();
      if (this.FLookupList != null) {
        if (this.FLookupList.FIsOpen) this.DoLookupClose();
        this.FLookupList.SetIsOpen(false);
      };
    };
    this.DoneLookup = function () {
      var idx = 0;
      var vp = 0;
      var NewValue = "";
      var LookupText = "";
      var NewText = "";
      var obj = null;
      if (!(this.FLookupListBox != null)) return;
      if (this.FLookupListBox.GetItemIndex() !== -1) {
        idx = -1;
        obj = this.FLookupListBox.FItems.GetObject(this.FLookupListBox.GetItemIndex());
        if (obj != null) idx = obj.FIdx;
        if ((idx >= 0) && (idx < this.FLookup.FValueList.GetCount()) && this.FLookup.FUseValueList) {
          NewValue = this.FLookup.FValueList.Get(idx)}
         else NewValue = this.FLookupListBox.FItems.Get(this.FLookupListBox.GetItemIndex());
        if (this.FOnLookupSelect != null) this.FOnLookupSelect(this,{get: function () {
            return NewValue;
          }, set: function (v) {
            NewValue = v;
          }});
        if (this.FOnLookupIndexSelect != null) this.FOnLookupIndexSelect(this,idx,{get: function () {
            return NewValue;
          }, set: function (v) {
            NewValue = v;
          }});
        if (this.FLookup.FMulti) {
          NewValue = NewValue + this.FLookup.FSeparator;
          LookupText = this.GetT();
          NewText = "";
          vp = -1;
          while (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos(this.FLookup.FSeparator,LookupText,{get: function () {
              return vp;
            }, set: function (v) {
              vp = v;
            }}) > 0) {
            NewText = NewText + pas.System.Copy(LookupText,1,vp);
            pas.System.Delete({get: function () {
                return LookupText;
              }, set: function (v) {
                LookupText = v;
              }},1,vp);
          };
          this.SetT(NewText + NewValue);
        } else this.SetT(NewValue);
        if (this.FLookup.FMulti) {
          this.SetSelStart(this.GetT().length)}
         else this.SelectAll();
        this.CloseLookup();
      };
    };
    this.UpdateAutoComplete = function () {
      var s = "";
      var ms = "";
      var i = 0;
      var vp = 0;
      if (!this.FAutoComplete) return;
      s = this.GetT();
      ms = "";
      if (s.length >= 1) {
        for (var $l = 1, $end = this.FLookup.FDisplayList.GetCount(); $l <= $end; $l++) {
          i = $l;
          if (this.FLookup.FCaseSensitive) {
            if (pas.System.Pos(s,this.FLookup.FDisplayList.Get(i - 1)) === 1) {
              ms = this.FLookup.FDisplayList.Get(i - 1);
              break;
            };
          } else {
            vp = pas.System.Pos(pas["WEBLib.TMSFNCTypes"].AnsiUpperCase(s),pas["WEBLib.TMSFNCTypes"].AnsiUpperCase(this.FLookup.FDisplayList.Get(i - 1)));
            if (vp === 1) {
              ms = this.FLookup.FDisplayList.Get(i - 1);
              break;
            };
          };
        };
        if (ms !== "") {
          this.SetT($impl.CleanString(ms));
          this.SetSelStart(s.length);
          this.SetSelLength(this.GetT().length - this.GetSelStart());
        };
      };
    };
    this.SetLookup = function (Value) {
      this.FLookup.Assign(Value);
    };
    this.AllowMin = function (ch) {
      var Result = false;
      Result = this.FSigned && (this.FEditType$1 in rtl.createSet($mod.TTMSFNCEditType.etFloat,$mod.TTMSFNCEditType.etSignedFloat,$mod.TTMSFNCEditType.etNumeric,$mod.TTMSFNCEditType.etSignedNumeric,$mod.TTMSFNCEditType.etMoney)) && (ch === "-");
      return Result;
    };
    this.FixedLength = function (s) {
      var Result = 0;
      var i = 0;
      s = $impl.StripThousandSep(s);
      i = pas.System.Pos(pas.SysUtils.FormatSettings.DecimalSeparator,s);
      if (i > 0) {
        Result = i}
       else Result = s.length + 1;
      if (this.FSigned && (this.FEditType$1 in rtl.createSet($mod.TTMSFNCEditType.etFloat,$mod.TTMSFNCEditType.etSignedFloat,$mod.TTMSFNCEditType.etNumeric,$mod.TTMSFNCEditType.etSignedNumeric,$mod.TTMSFNCEditType.etMoney)) && (pas.System.Pos("-",s) > 0)) Result = Result - 1;
      return Result;
    };
    this.SetPrefix = function (Value) {
      this.FPrefix = Value;
    };
    this.SetSuffix = function (Value) {
      this.FSuffix = Value;
    };
    this.SetModified = function (Value) {
      if (pas.Classes.TComponentStateItem.csLoading in this.FComponentState) return;
      if (this.FReadOnly) return;
      this.FIsModified = Value;
    };
    this.DecimalPos = function () {
      var Result = 0;
      var i = 0;
      i = pas.System.Pos(pas.SysUtils.FormatSettings.DecimalSeparator,this.GetT());
      if (i === 0) {
        Result = this.FPrefix.length + this.GetT().length + this.FSuffix.length + 1}
       else Result = this.FPrefix.length + i;
      return Result;
    };
    this.AutoSeparators = function () {
      var s = "";
      var si = "";
      var neg = "";
      var d = 0.0;
      var Diffl = 0;
      var OldSelStart = 0;
      var OldPrec = 0;
      s = this.GetT();
      Diffl = s.length;
      if (this.GetSelLength() === 0) {
        OldSelStart = this.GetSelStart()}
       else OldSelStart = this.GetSelStart() + this.GetSelLength();
      if (s === "") return;
      if (pas.System.Pos("-",s) === 1) {
        pas.System.Delete({get: function () {
            return s;
          }, set: function (v) {
            s = v;
          }},1,1);
        neg = "-";
      } else neg = "";
      if (pas.System.Pos(pas.SysUtils.FormatSettings.DecimalSeparator,s) > 0) {
        s = pas.System.Copy(s,pas.System.Pos(pas.SysUtils.FormatSettings.DecimalSeparator,s),255)}
       else s = "";
      d = pas.System.Trunc(Math.abs(this.GetFloat()));
      if (this.FAutoThousandSeparator) {
        si = pas.SysUtils.Format("%n",pas.System.VarRecs(3,d))}
       else si = pas.SysUtils.Format("%f",pas.System.VarRecs(3,d));
      si = pas.System.Copy(si,1,pas.System.Pos(pas.SysUtils.FormatSettings.DecimalSeparator,si) - 1);
      OldPrec = this.FPrecision;
      this.FPrecision = 0;
      this.FBlockChange = this.GetT() !== (this.FPrefix + neg + si + s + this.FSuffix);
      if (this.FBlockChange) {
        pas["WEBLib.StdCtrls"].TCustomEdit.SetText.call(this,this.FPrefix + neg + si + s + this.FSuffix);
      };
      this.FBlockChange = false;
      this.FPrecision = OldPrec;
      Diffl = this.GetT().length - Diffl;
      this.SetSelStart(OldSelStart + Diffl);
      this.SetSelLength(0);
    };
    this.GetFloat = function () {
      var Result = 0.0;
      var s = "";
      Result = 0;
      var $tmp = this.FEditType$1;
      if ($tmp === $mod.TTMSFNCEditType.etHex) {
        if (this.GetT() !== "") Result = $impl.HexToInt(this.GetT())}
       else if ($tmp === $mod.TTMSFNCEditType.etString) {
        Result = this.EStrToFloat(this.GetT());
      } else if (($tmp === $mod.TTMSFNCEditType.etNumeric) || ($tmp === $mod.TTMSFNCEditType.etFloat) || ($tmp === $mod.TTMSFNCEditType.etSignedFloat) || ($tmp === $mod.TTMSFNCEditType.etSignedNumeric)) {
        if (this.GetT() !== "") {
          s = this.GetT();
          if (s === "-") {
            Result = 0}
           else Result = this.EStrToFloat(s);
        }}
       else if ($tmp === $mod.TTMSFNCEditType.etMoney) if (this.GetT() !== "") {
        s = $impl.StripThousandSep(this.GetT());
        if (pas.System.Pos(pas.SysUtils.FormatSettings.DecimalSeparator,s) === s.length) pas.System.Delete({get: function () {
            return s;
          }, set: function (v) {
            s = v;
          }},pas.System.Pos(pas.SysUtils.FormatSettings.DecimalSeparator,s),1);
        if ((s === "") || (s === "-")) {
          Result = 0}
         else Result = this.EStrToFloat(s);
      };
      return Result;
    };
    this.SetFloat = function (Value) {
      var s = "";
      var $tmp = this.FEditType$1;
      if ($tmp === $mod.TTMSFNCEditType.etHex) {
        this.SetT(pas.SysUtils.IntToHex(pas.System.Trunc(Value),0))}
       else if (($tmp === $mod.TTMSFNCEditType.etNumeric) || ($tmp === $mod.TTMSFNCEditType.etSignedNumeric)) {
        if (this.FPrecision >= 0) {
          this.SetT(pas.SysUtils.Format("%." + pas.SysUtils.IntToStr(this.FPrecision) + "n",pas.System.VarRecs(3,Value)))}
         else this.SetT(pas.SysUtils.Format("%g",pas.System.VarRecs(3,Value)))}
       else if (($tmp === $mod.TTMSFNCEditType.etFloat) || ($tmp === $mod.TTMSFNCEditType.etSignedFloat) || ($tmp === $mod.TTMSFNCEditType.etString)) {
        if (this.FPrecision >= 0) {
          s = pas.SysUtils.Format("%." + pas.SysUtils.IntToStr(this.FPrecision) + "f",pas.System.VarRecs(3,Value));
          this.SetT(s);
        } else this.SetT(pas.SysUtils.Format("%g",pas.System.VarRecs(3,Value)))}
       else if ($tmp === $mod.TTMSFNCEditType.etMoney) {
        if (this.FPrecision >= 0) {
          this.SetT(pas.SysUtils.Format("%." + pas.SysUtils.IntToStr(this.FPrecision) + "f",pas.System.VarRecs(3,Value)))}
         else this.SetT(pas.SysUtils.Format("%g",pas.System.VarRecs(3,Value)));
        this.AutoSeparators();
      };
      this.SetModified(true);
    };
    this.SetAutoThousandSeparator = function (Value) {
      this.FAutoThousandSeparator = Value;
      if (this.FEditType$1 in rtl.createSet($mod.TTMSFNCEditType.etNumeric,$mod.TTMSFNCEditType.etSignedNumeric,$mod.TTMSFNCEditType.etMoney,$mod.TTMSFNCEditType.etFloat,$mod.TTMSFNCEditType.etSignedFloat)) this.AutoSeparators();
    };
    this.SetPrecision = function (Value) {
      var at = 0;
      if ((this.FPrecision !== Value) && (this.FEditType$1 in rtl.createSet($mod.TTMSFNCEditType.etFloat,$mod.TTMSFNCEditType.etSignedFloat,$mod.TTMSFNCEditType.etMoney,$mod.TTMSFNCEditType.etString))) {
        this.FPrecision = Value;
        if ((this.GetT() !== "") || !this.FAllowNumericNullValue) {
          at = $impl.IsType(this.GetT());
          if (at in rtl.createSet($impl.TTMSFNCEditAutoType.atFloat,$impl.TTMSFNCEditAutoType.atNumeric)) {
            this.SetFloat(this.GetFloat())}
           else this.SetFloat(0.0);
        };
      };
    };
    this.SetPrecisionDisplay = function (Value) {
      if (this.FPrecisionDisplay !== Value) {
        this.FPrecisionDisplay = Value;
        this.SetFloat(this.GetFloat());
      };
    };
    this.EStrToFloat = function (s) {
      var Result = 0.0;
      Result = 0;
      if (pas.System.Pos(pas.SysUtils.FormatSettings.ThousandSeparator,s) > 0) s = $impl.StripThousandSep(s);
      if ((this.FPrecision > 0) && (s.length > this.FPrecision)) if (s.charAt(s.length - this.FPrecision - 1) === pas.SysUtils.FormatSettings.ThousandSeparator.charAt(-1)) s = rtl.setCharAt(s,s.length - this.FPrecision - 1,pas.SysUtils.FormatSettings.DecimalSeparator.charAt(-1));
      try {
        pas.SysUtils.TryStrToFloat(s,{get: function () {
            return Result;
          }, set: function (v) {
            Result = v;
          }});
      } catch ($e) {
        Result = 0;
      };
      return Result;
    };
    this.GetInt = function () {
      var Result = 0;
      Result = 0;
      var $tmp = this.FEditType$1;
      if ($tmp === $mod.TTMSFNCEditType.etHex) {
        if (this.GetT() !== "") Result = $impl.HexToInt(this.GetT())}
       else if (($tmp === $mod.TTMSFNCEditType.etSignedNumeric) || ($tmp === $mod.TTMSFNCEditType.etNumeric) || ($tmp === $mod.TTMSFNCEditType.etSignedFloat) || ($tmp === $mod.TTMSFNCEditType.etFloat)) {
        Result = $impl.ValStr(this.GetT())}
       else if ($tmp === $mod.TTMSFNCEditType.etMoney) Result = $impl.ValStr($impl.StripThousandSep(this.GetT()));
      return Result;
    };
    this.SetInt = function (Value) {
      var $tmp = this.FEditType$1;
      if ($tmp === $mod.TTMSFNCEditType.etHex) {
        this.SetT(pas.SysUtils.IntToHex(Value,0))}
       else if (($tmp === $mod.TTMSFNCEditType.etSignedNumeric) || ($tmp === $mod.TTMSFNCEditType.etNumeric) || ($tmp === $mod.TTMSFNCEditType.etSignedFloat) || ($tmp === $mod.TTMSFNCEditType.etFloat)) {
        this.SetT(pas.SysUtils.IntToStr(Value))}
       else if ($tmp === $mod.TTMSFNCEditType.etMoney) {
        this.SetT(pas.SysUtils.IntToStr(Value));
        this.AutoSeparators();
      };
      this.SetModified(true);
    };
    this.SetEditType$1 = function (Value) {
      var at = 0;
      if (this.FEditType$1 !== Value) {
        this.FEditType$1 = Value;
        if (pas.Classes.TComponentStateItem.csLoading in this.FComponentState) return;
        if ((this.GetT() !== "") || !this.FAllowNumericNullValue) {
          at = $impl.IsType(this.GetT());
          var $tmp = this.FEditType$1;
          if ($tmp === $mod.TTMSFNCEditType.etHex) {
            if (!(at in rtl.createSet($impl.TTMSFNCEditAutoType.atNumeric,$impl.TTMSFNCEditAutoType.atHex))) this.SetInt(0)}
           else if (($tmp === $mod.TTMSFNCEditType.etNumeric) || ($tmp === $mod.TTMSFNCEditType.etSignedNumeric)) {
            if (at !== $impl.TTMSFNCEditAutoType.atNumeric) this.SetInt(0)}
           else if (($tmp === $mod.TTMSFNCEditType.etFloat) || ($tmp === $mod.TTMSFNCEditType.etSignedFloat) || ($tmp === $mod.TTMSFNCEditType.etMoney)) if (!(at in rtl.createSet($impl.TTMSFNCEditAutoType.atFloat,$impl.TTMSFNCEditAutoType.atNumeric))) this.SetFloat(0.0);
        };
        if (!(pas.Classes.TComponentStateItem.csLoading in this.FComponentState) && ((this.FEditType$1 === $mod.TTMSFNCEditType.etFloat) || (this.FEditType$1 === $mod.TTMSFNCEditType.etSignedFloat)) && (this.FPrecision === 0)) this.SetPrecision(pas.SysUtils.FormatSettings.CurrencyDecimals);
      };
      var $tmp1 = this.FEditType$1;
      if (($tmp1 === $mod.TTMSFNCEditType.etValidChars) || ($tmp1 === $mod.TTMSFNCEditType.etAlphaNumeric) || ($tmp1 === $mod.TTMSFNCEditType.etMoney) || ($tmp1 === $mod.TTMSFNCEditType.etString) || ($tmp1 === $mod.TTMSFNCEditType.etUpperCase) || ($tmp1 === $mod.TTMSFNCEditType.etMixedCase) || ($tmp1 === $mod.TTMSFNCEditType.etLowerCase)) {
        this.SetEditType(pas["WEBLib.StdCtrls"].TEditType.weString)}
       else if ($tmp1 === $mod.TTMSFNCEditType.etNumeric) {
        this.SetEditType(pas["WEBLib.StdCtrls"].TEditType.weNumeric)}
       else if ($tmp1 === $mod.TTMSFNCEditType.etSignedNumeric) {
        this.SetEditType(pas["WEBLib.StdCtrls"].TEditType.weSignedNumeric)}
       else if ($tmp1 === $mod.TTMSFNCEditType.etFloat) {
        this.SetEditType(pas["WEBLib.StdCtrls"].TEditType.weFloat)}
       else if ($tmp1 === $mod.TTMSFNCEditType.etSignedFloat) {
        this.SetEditType(pas["WEBLib.StdCtrls"].TEditType.weSignedFloat)}
       else if ($tmp1 === $mod.TTMSFNCEditType.etHex) this.SetEditType(pas["WEBLib.StdCtrls"].TEditType.weHex);
      this.SetCharCase(pas["WEBLib.StdCtrls"].TEditCharCase.wecNormal);
      var $tmp2 = this.FEditType$1;
      if ($tmp2 === $mod.TTMSFNCEditType.etUpperCase) {
        this.SetCharCase(pas["WEBLib.StdCtrls"].TEditCharCase.wecUpperCase)}
       else if ($tmp2 === $mod.TTMSFNCEditType.etMixedCase) {
        this.SetCharCase(pas["WEBLib.StdCtrls"].TEditCharCase.wecMixedCase)}
       else if ($tmp2 === $mod.TTMSFNCEditType.etLowerCase) this.SetCharCase(pas["WEBLib.StdCtrls"].TEditCharCase.wecLowerCase);
    };
    this.IsLookupListVisible = function () {
      var Result = false;
      Result = (this.FLookupList != null) && this.FLookupList.FIsOpen;
      return Result;
    };
    this.GetAllowFocus = function () {
      var Result = false;
      Result = this.FAllowFocus;
      return Result;
    };
    this.SetAllowFocus = function (Value) {
      this.FAllowFocus = Value;
    };
    this.SelectAfterDecimal = function () {
      var i = 0;
      i = pas.System.Pos(pas.SysUtils.FormatSettings.DecimalSeparator,this.GetT());
      if (i > 0) {
        this.SetSelStart(i + this.FPrefix.length)}
       else this.SetSelStart(this.FPrefix.length);
    };
    this.UpdateLookup = function () {
      var i = 0;
      var cnt = 0;
      var mw = 0;
      var mh = 0;
      var tw = 0;
      var vp = 0;
      var LookupText = "";
      var ismatch = false;
      var idx = 0;
      var obj = null;
      if (!(this.FLookup != null) || !this.FLookup.FEnabled || !(this.FLookupListBox != null)) return;
      if (this.FLookup.FMulti) {
        LookupText = this.GetT();
        vp = -1;
        while (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos(this.FLookup.FSeparator,LookupText,{get: function () {
            return vp;
          }, set: function (v) {
            vp = v;
          }}) > 0) pas.System.Delete({get: function () {
            return LookupText;
          }, set: function (v) {
            LookupText = v;
          }},1,vp);
      } else LookupText = this.GetT();
      if (LookupText.length >= this.FLookup.FNumChars) {
        mh = (18 * this.FLookup.FDisplayCount) + 4;
        this.FLookupListBox.SetParent(this);
        this.CleanupLookupList();
        this.FLookupListBox.FItems.Clear();
        for (var $l = 1, $end = this.FLookup.FDisplayList.GetCount(); $l <= $end; $l++) {
          i = $l;
          if (this.FLookup.FCaseSensitive) {
            if (pas.System.Pos(LookupText,this.FLookup.FDisplayList.Get(i - 1)) === 1) {
              obj = $mod.TTMSFNCLookupListBoxItem.$create("Create$1",[i - 1]);
              this.FLookupListBox.FItems.AddObject($impl.CleanString(this.FLookup.FDisplayList.Get(i - 1)),obj);
              this.FLookupListBoxItems.Add(obj);
            };
          } else {
            vp = pas.System.Pos(pas["WEBLib.TMSFNCTypes"].AnsiUpperCase(LookupText),pas["WEBLib.TMSFNCTypes"].AnsiUpperCase(this.FLookup.FDisplayList.Get(i - 1)));
            if (this.FFullTextSearch) {
              ismatch = vp > 0}
             else ismatch = vp === 1;
            if (ismatch) {
              obj = $mod.TTMSFNCLookupListBoxItem.$create("Create$1",[i - 1]);
              this.FLookupListBox.FItems.AddObject($impl.CleanString(this.FLookup.FDisplayList.Get(i - 1)),obj);
              this.FLookupListBoxItems.Add(obj);
            };
          };
        };
        idx = 0;
        this.DoLookupNeedData(LookupText,this.FLookupListBox.FItems,{get: function () {
            return idx;
          }, set: function (v) {
            idx = v;
          }});
        cnt = this.FLookupListBox.FItems.GetCount();
        if ((this.FLookup.FDisplayList.GetCount() > 0) && (this.FLookupListBox.FItems.GetCount() > 0)) this.FLookupListBox.SetItemIndex(idx);
        if (cnt < this.FLookup.FDisplayCount) mh = (cnt * 18) + 4;
        this.FLookupListBox.SetSorted(true);
        mw = 50;
        this.FLookupList.SetDropDownWidth(0);
        if (cnt > 0) {
          for (var $l1 = 1, $end1 = cnt; $l1 <= $end1; $l1++) {
            i = $l1;
            tw = 0;
            if (this.FLookupListBox.GetCanvas() != null) tw = Math.round(this.FLookupListBox.GetCanvas().TextWidth(this.FLookupListBox.FItems.Get(i - 1)));
            if (tw > mw) mw = tw;
          };
          mw = mw + 26;
        };
        if (this.FLookup.FWidth > 0) mw = this.FLookup.FWidth;
        if (this.FLookup.FHeight > 0) mh = this.FLookup.FHeight;
        this.FLookupList.SetPlacementControl(this);
        if (cnt > 0) {
          this.FLookupList.SetDropDownWidth(Math.max(this.FLookup.FMinimumWidth,mw));
          this.FLookupList.SetDropDownHeight(Math.max(this.FLookup.FMinimumHeight,mh));
          if (this.FLookupList.HasPopupForm()) {
            this.FLookupListBox.SetParent(this.FLookupList.FPopupForm);
            this.FLookupList.FPopupForm.SetWidth(Math.round(this.FLookupList.FDropDownWidth));
            this.FLookupList.FPopupForm.SetHeight(Math.round(this.FLookupList.FDropDownHeight));
          };
          if (!this.FLookupList.FIsOpen) this.DoLookupOpen();
          this.FLookupList.SetIsOpen(true);
          this.FLookupFormTimer.SetEnabled(this.FAutoClose);
        } else {
          if (this.FLookupList.FIsOpen) this.DoLookupClose();
          this.FLookupList.SetIsOpen(false);
        };
      } else {
        if (this.FLookupList.FIsOpen) this.DoLookupClose();
        this.FLookupList.SetIsOpen(false);
      };
    };
    this.GetVersionNumber = function (AMaj, AMin, ARel, ABld) {
      var Result = "";
      Result = "";
      return Result;
    };
    this.Validate = function (AValue) {
      var Result = false;
      var i = 0;
      var kch = "\x00";
      var isValid = false;
      pas["WEBLib.StdCtrls"].TCustomEdit.Validate.apply(this,arguments);
      Result = true;
      for (var $l = 1, $end = AValue.length; $l <= $end; $l++) {
        i = $l;
        kch = AValue.charAt(i - 1);
        isValid = true;
        var $tmp = this.FEditType$1;
        if ($tmp === $mod.TTMSFNCEditType.etNumeric) {
          if (!pas["WEBLib.TMSFNCTypes"].CharIsNumber(kch)) isValid = false;
        } else if ($tmp === $mod.TTMSFNCEditType.etFloat) {
          if (!(pas["WEBLib.TMSFNCTypes"].CharIsNumber(kch) || (kch === pas.SysUtils.FormatSettings.DecimalSeparator))) isValid = false;
        } else if (($tmp === $mod.TTMSFNCEditType.etSignedFloat) || ($tmp === $mod.TTMSFNCEditType.etSignedNumeric)) {
          if (!(pas["WEBLib.TMSFNCTypes"].CharInArray(kch,["-"]) || pas["WEBLib.TMSFNCTypes"].CharIsNumber(kch) || (kch === pas.SysUtils.FormatSettings.DecimalSeparator))) isValid = false;
        } else if ($tmp === $mod.TTMSFNCEditType.etMoney) {
          if (!(pas["WEBLib.TMSFNCTypes"].CharIsNumber(kch) || (kch === pas.SysUtils.FormatSettings.DecimalSeparator) || (kch === pas.SysUtils.FormatSettings.ThousandSeparator))) isValid = false;
        } else if ($tmp === $mod.TTMSFNCEditType.etHex) {
          if (!pas["WEBLib.TMSFNCTypes"].CharIsHex(kch)) isValid = false;
        } else if ($tmp === $mod.TTMSFNCEditType.etAlphaNumeric) {
          if (!pas["WEBLib.TMSFNCTypes"].CharIsLetterOrNumber(kch)) isValid = false;
        };
        if (!isValid) {
          Result = false;
          break;
        };
      };
      return Result;
    };
    this.GetVersion = function () {
      var Result = "";
      Result = this.$class.GetVersionNumber(1,0,4,3);
      return Result;
    };
    this.DoLookupFormTimer = function (Sender) {
      if (!(this.FLookupList != null) || !(this.FLookupListBox != null)) {
        this.FLookupFormTimer.SetEnabled(false);
        return;
      };
      if (this.FLookupList.FPopupForm != null) this.FLookupList.FPopupForm.ApplyPlacement();
      if (!this.FLookupList.FIsOpen || (!this.IsFocused() && !this.FLookupList.IsFocused() && !this.FLookupListBox.Focused())) {
        if (this.LookupList().FIsOpen) this.DoLookupClose();
        this.FLookupList.SetIsOpen(false);
        this.FLookupFormTimer.SetEnabled(false);
      };
    };
    this.GetT = function () {
      var Result = "";
      var s = "";
      s = pas["WEBLib.StdCtrls"].TCustomEdit.GetText.call(this);
      if ((this.FPrefix !== "") && (pas.System.Pos(pas["WEBLib.TMSFNCTypes"].AnsiUpperCase(this.FPrefix),pas["WEBLib.TMSFNCTypes"].AnsiUpperCase(s)) === 1)) pas.System.Delete({get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},1,this.FPrefix.length);
      if (this.FSuffix !== "") pas.System.Delete({get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},(s.length - this.FSuffix.length) + 1,this.FSuffix.length);
      Result = s;
      return Result;
    };
    this.GetCaretPosition = function () {
      var Result = 0;
      Result = this.GetSelStart();
      return Result;
    };
    this.CleanupLookupList = function () {
      var I = 0;
      var obj = null;
      if (!(this.FLookupListBoxItems != null)) return;
      for (var $l = 0, $end = this.FLookupListBoxItems.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        obj = rtl.getObject(this.FLookupListBoxItems.Get(I));
        if (obj != null) obj = rtl.freeLoc(obj);
      };
      this.FLookupListBoxItems.Clear();
    };
    this.SetCaretPosition = function (ACaretPosition) {
      this.SetSelStart(ACaretPosition);
      this.SetSelLength(0);
    };
    this.SetT = function (Value) {
      var fmt = "";
      var neg = "";
      var f = 0.0;
      var v = "";
      v = Value;
      if (!((v === "") && this.FAllowNumericNullValue)) {
        var $tmp = this.FEditType$1;
        if ($tmp === $mod.TTMSFNCEditType.etFloat) {
          if (!($impl.IsType(v) in rtl.createSet($impl.TTMSFNCEditAutoType.atFloat,$impl.TTMSFNCEditAutoType.atNumeric))) v = "0"}
         else if ($tmp === $mod.TTMSFNCEditType.etMoney) {
          if (!($impl.IsType(v) in rtl.createSet($impl.TTMSFNCEditAutoType.atFloat,$impl.TTMSFNCEditAutoType.atNumeric))) v = "0"}
         else if ($tmp === $mod.TTMSFNCEditType.etHex) {
          if (!($impl.IsType(v) in rtl.createSet($impl.TTMSFNCEditAutoType.atHex,$impl.TTMSFNCEditAutoType.atNumeric))) v = "0"}
         else if ($tmp === $mod.TTMSFNCEditType.etNumeric) if (!($impl.IsType(v) in rtl.createSet($impl.TTMSFNCEditAutoType.atNumeric))) v = "0";
        if (this.FPrecisionDisplay === $mod.TTMSFNCEditPrecisionDisplay.pdNormal) {
          if (((this.FPrecision >= 0) || (this.FEditType$1 === $mod.TTMSFNCEditType.etMoney)) && (v !== "")) {
            if ((this.FEditType$1 in rtl.createSet($mod.TTMSFNCEditType.etMoney)) && (this.FPrecision >= 0)) {
              if (pas.System.Pos("-",Value) > 0) {
                neg = "-"}
               else neg = "";
              fmt = "%." + pas.SysUtils.IntToStr(this.FPrecision) + "n";
              v = pas.SysUtils.Format(fmt,pas.System.VarRecs(3,this.EStrToFloat(v)));
            };
            if (this.FEditType$1 in rtl.createSet($mod.TTMSFNCEditType.etFloat,$mod.TTMSFNCEditType.etSignedFloat)) {
              fmt = "%." + pas.SysUtils.IntToStr(this.FPrecision) + "f";
              f = this.EStrToFloat(v);
              v = pas.SysUtils.Format(fmt,pas.System.VarRecs(3,f));
            };
          };
        } else {
          if (this.FEditType$1 in rtl.createSet($mod.TTMSFNCEditType.etFloat,$mod.TTMSFNCEditType.etMoney,$mod.TTMSFNCEditType.etSignedFloat)) {
            f = this.EStrToFloat(v);
            v = pas.SysUtils.Format("%g",pas.System.VarRecs(3,f));
          };
        };
      };
      if (this.FEditType$1 in rtl.createSet($mod.TTMSFNCEditType.etHex,$mod.TTMSFNCEditType.etUpperCase)) {
        v = pas["WEBLib.TMSFNCTypes"].AnsiUpperCase(v)}
       else if (this.FEditType$1 in rtl.createSet($mod.TTMSFNCEditType.etLowerCase)) v = pas["WEBLib.TMSFNCTypes"].AnsiLowerCase(v);
      pas["WEBLib.StdCtrls"].TCustomEdit.SetText.call(this,this.FPrefix + v + this.FSuffix);
      this.SetModified(false);
    };
    this.InsertText = function (AText) {
      var TmpS = "";
      var ss = 0;
      if (this.FReadOnly) return;
      TmpS = this.GetT();
      ss = this.GetSelStart();
      pas.System.Delete({get: function () {
          return TmpS;
        }, set: function (v) {
          TmpS = v;
        }},this.GetSelStart() + 1,this.GetSelLength());
      pas.System.Insert(AText,{get: function () {
          return TmpS;
        }, set: function (v) {
          TmpS = v;
        }},this.GetSelStart() + 1);
      if ((this.FMaxLength <= 0) || (TmpS.length <= this.FMaxLength)) {
        this.SetT(TmpS);
        this.SetCaretPosition(ss + AText.length);
      };
      this.SetSelLength(0);
    };
    this.ListKeyUp = function (Sender, Key, Shift) {
      if (Key.get() === 13) this.DoneLookup();
      if ((Key.get() === 9) && this.FLookup.FAcceptOnTab) this.DoneLookup();
    };
    this.ListMouseUp = function (Sender, Button, Shift, X, Y) {
      this.DoneLookup();
    };
    this.KeyPress = function (Key) {
      var $Self = this;
      var oldSelStart = 0;
      var oldprec = 0;
      var s = "";
      var cl = "";
      var st = "";
      var allowclip = false;
      var at = 0;
      var ismod = false;
      var d = 0;
      var kch = "\x00";
      var b = false;
      function ScanPrecision(s, inspos) {
        var Result = false;
        var mdist = 0;
        Result = false;
        inspos = inspos - $Self.FPrefix.length;
        if ($Self.FPrecision <= 0) return Result;
        if ((s.length - inspos) > $Self.FPrecision) {
          Result = false;
          return Result;
        };
        if (pas.System.Pos(pas.SysUtils.FormatSettings.DecimalSeparator,s) > 0) {
          mdist = s.length - pas.System.Pos(pas.SysUtils.FormatSettings.DecimalSeparator,s);
          if ((inspos >= pas.System.Pos(pas.SysUtils.FormatSettings.DecimalSeparator,s)) && (mdist >= $Self.FPrecision)) Result = true;
        };
        return Result;
      };
      function ScanDistance(s, inspos) {
        var Result = false;
        var mdist = 0;
        Result = false;
        inspos = inspos - $Self.FPrefix.length;
        mdist = s.length;
        if (pas.System.Pos(pas.SysUtils.FormatSettings.ThousandSeparator,s) === 0) {
          Result = false;
          return Result;
        };
        while (pas.System.Pos(pas.SysUtils.FormatSettings.ThousandSeparator,s) > 0) {
          if (Math.abs(pas.System.Pos(pas.SysUtils.FormatSettings.ThousandSeparator,s) - inspos) < mdist) mdist = Math.abs(pas.System.Pos(pas.SysUtils.FormatSettings.ThousandSeparator,s) - inspos);
          if (Math.abs(pas.System.Pos(pas.SysUtils.FormatSettings.ThousandSeparator,s) - inspos) < 3) {
            Result = true;
            break;
          };
          if (inspos > pas.System.Pos(pas.SysUtils.FormatSettings.ThousandSeparator,s)) inspos = inspos - pas.System.Pos(pas.SysUtils.FormatSettings.ThousandSeparator,s);
          pas.System.Delete({get: function () {
              return s;
            }, set: function (v) {
              s = v;
            }},1,pas.System.Pos(pas.SysUtils.FormatSettings.ThousandSeparator,s));
        };
        if (mdist > 3) {
          Result = true;
        };
        return Result;
      };
      function EatKey() {
        if (!($Self.FKeyDown in rtl.createSet(38,40))) Key.set("\x00");
      };
      if (!(this.FLookupListBox != null)) {
        pas["WEBLib.StdCtrls"].TCustomEdit.KeyPress.apply(this,arguments);
        return;
      };
      s = Key.get();
      kch = Key.get();
      if ((this.FKeyDown === 18) || (this.FKeyDown === 27)) {
        this.CloseLookup();
      };
      if ((this.FKeyDown === 8) && (this.FPrefix !== "")) if ((this.GetSelStart() <= this.FPrefix.length) && (this.GetSelLength() === 0)) return;
      if ((this.FLengthLimit > 0) && (this.FixedLength($Self.GetT()) > this.FLengthLimit) && (this.GetSelLength() === 0) && (this.GetSelStart() < this.DecimalPos()) && (this.FKeyDown !== 8) && (this.FKeyDown !== pas.SysUtils.FormatSettings.DecimalSeparator.charCodeAt(0 - 1)) && !this.AllowMin(kch)) {
        EatKey();
        return;
      };
      if (this.FKeyDown in rtl.createSet(36,35,9,37,39,33,34,46,8)) {
        if (this.FKeyDown === 8) {
          s = $Self.GetT();
          if (this.GetSelLength() === 0) {
            pas.System.Delete({get: function () {
                return s;
              }, set: function (v) {
                s = v;
              }},this.GetSelStart() - this.FPrefix.length,1)}
           else pas.System.Delete({get: function () {
              return s;
            }, set: function (v) {
              s = v;
            }},Math.max(1,this.GetSelStart() - this.FPrefix.length),this.GetSelLength());
          ismod = (s !== this.GetT()) || this.FIsModified;
          this.SetModified(ismod);
          pas["WEBLib.StdCtrls"].TCustomEdit.KeyPress.apply(this,arguments);
          if (this.FEditType$1 === $mod.TTMSFNCEditType.etMoney) this.AutoSeparators();
          if ((this.GetT() === "") && ((s !== "") || ismod)) {
            this.Change();
          };
          this.SetModified(ismod);
          this.UpdateLookup();
          return;
        } else {
          b = true;
          if (this.FKeyDown in rtl.createSet(36,35,9,37,39,33,34)) {
            b = false;
            if (this.FAutoComplete && (this.GetSelLength() > 0) && this.IsLookupListVisible()) this.CloseLookup();
          };
          if (b) {
            st = $Self.GetT();
            pas["WEBLib.StdCtrls"].TCustomEdit.KeyPress.apply(this,arguments);
            if ($Self.GetT() !== st) this.SetModified(true);
          } else pas["WEBLib.StdCtrls"].TCustomEdit.KeyPress.apply(this,arguments);
        };
        return;
      };
      if ((this.FKeyDown === 13) && this.IsLookupListVisible()) {
        pas["WEBLib.StdCtrls"].TCustomEdit.KeyPress.apply(this,arguments);
        this.DoneLookup();
        return;
      };
      if (this.FKeyDown in rtl.createSet(9,13,27)) {
        pas["WEBLib.StdCtrls"].TCustomEdit.KeyPress.apply(this,arguments);
        return;
      };
      if ((this.FKeyDown === 36) && this.IsLookupListVisible()) {
        if (this.FLookupListBox.FItems.GetCount() > 0) {
          this.FLookupListBox.SetItemIndex(0)}
         else this.FLookupListBox.SetItemIndex(-1);
        return;
      };
      if ((this.FKeyDown === 35) && this.IsLookupListVisible()) {
        if (this.FLookupListBox.FItems.GetCount() > 0) {
          this.FLookupListBox.SetItemIndex(this.FLookupListBox.FItems.GetCount() - 1)}
         else this.FLookupListBox.SetItemIndex(-1);
        return;
      };
      if ((this.FKeyDown === 34) && this.IsLookupListVisible()) {
        if (this.FLookupListBox.FItems.GetCount() > 0) {
          if ((this.FLookupListBox.GetItemIndex() + this.FLookup.FDisplayCount) < this.FLookupListBox.FItems.GetCount()) {
            this.FLookupListBox.SetItemIndex(this.FLookupListBox.GetItemIndex() + this.FLookup.FDisplayCount)}
           else this.FLookupListBox.SetItemIndex(this.FLookupListBox.FItems.GetCount() - 1);
        } else this.FLookupListBox.SetItemIndex(-1);
        return;
      };
      if ((this.FKeyDown === 33) && this.IsLookupListVisible()) {
        if (this.FLookupListBox.FItems.GetCount() > 0) {
          if (this.FLookupListBox.GetItemIndex() > this.FLookup.FDisplayCount) {
            this.FLookupListBox.SetItemIndex(this.FLookupListBox.GetItemIndex() - this.FLookup.FDisplayCount)}
           else this.FLookupListBox.SetItemIndex(0);
        } else this.FLookupListBox.SetItemIndex(-1);
        return;
      };
      if ((this.FKeyDown === 38) && this.IsLookupListVisible()) {
        if (this.FLookupListBox.FItems.GetCount() > 0) {
          if (this.FLookupListBox.GetItemIndex() > 0) this.FLookupListBox.SetItemIndex(this.FLookupListBox.GetItemIndex() - 1);
        } else this.FLookupListBox.SetItemIndex(-1);
        pas["WEBLib.StdCtrls"].TCustomEdit.KeyPress.apply(this,arguments);
        return;
      };
      if ((this.FKeyDown === 40) && this.IsLookupListVisible()) {
        if (this.FLookupListBox.FItems.GetCount() > 0) {
          if ((this.FLookupListBox.GetItemIndex() + 1) < this.FLookupListBox.FItems.GetCount()) this.FLookupListBox.SetItemIndex(this.FLookupListBox.GetItemIndex() + 1);
        } else this.FLookupListBox.SetItemIndex(-1);
        pas["WEBLib.StdCtrls"].TCustomEdit.KeyPress.apply(this,arguments);
        return;
      };
      if ((this.FKeyDown === 27) && this.IsLookupListVisible()) {
        this.CloseLookup();
        return;
      };
      if ((this.FKeyDown === 46) && (this.GetSelStart() >= this.FPrefix.length)) {
        s = $Self.GetT();
        if (this.GetSelLength() === 0) {
          pas.System.Delete({get: function () {
              return s;
            }, set: function (v) {
              s = v;
            }},(this.GetSelStart() - this.FPrefix.length) + 1,1)}
         else pas.System.Delete({get: function () {
            return s;
          }, set: function (v) {
            s = v;
          }},(this.GetSelStart() - this.FPrefix.length) + 1,this.GetSelLength());
        if ((this.FLengthLimit > 0) && ((this.FixedLength(s) - 1) > this.FLengthLimit)) {
          EatKey();
          return;
        };
        this.SetModified(true);
      };
      if ((this.FMaxLength > 0) && (this.GetSelLength() === 0) && (this.GetT().length >= this.FMaxLength)) return;
      if ((this.FPrefix !== "") && (this.GetSelStart() < this.FPrefix.length)) this.SetSelStart(this.FPrefix.length);
      if (rtl.eqSet(this.FShiftState,rtl.createSet(pas.Classes.TShiftState$a.ssCtrl))) {
        if (this.FKeyDown === 86) {
          cl = pas["WEBLib.TMSFNCUtils"].TTMSFNCClipBoard.GetText();
          at = $impl.IsType(cl);
          allowclip = true;
          var $tmp = this.FEditType$1;
          if ($tmp === $mod.TTMSFNCEditType.etNumeric) {
            allowclip = at === $impl.TTMSFNCEditAutoType.atNumeric}
           else if ($tmp === $mod.TTMSFNCEditType.etSignedNumeric) {
            allowclip = at === $impl.TTMSFNCEditAutoType.atNumeric}
           else if (($tmp === $mod.TTMSFNCEditType.etFloat) || ($tmp === $mod.TTMSFNCEditType.etSignedFloat)) {
            allowclip = at === $impl.TTMSFNCEditAutoType.atFloat}
           else if ($tmp === $mod.TTMSFNCEditType.etUpperCase) {
            cl = pas["WEBLib.TMSFNCTypes"].AnsiUpperCase(cl)}
           else if ($tmp === $mod.TTMSFNCEditType.etMixedCase) {
            cl = $impl.ShiftCase(cl)}
           else if ($tmp === $mod.TTMSFNCEditType.etLowerCase) {
            cl = pas["WEBLib.TMSFNCTypes"].AnsiLowerCase(cl)}
           else if ($tmp === $mod.TTMSFNCEditType.etMoney) {
            allowclip = at === $impl.TTMSFNCEditAutoType.atFloat}
           else if ($tmp === $mod.TTMSFNCEditType.etHex) allowclip = at in rtl.createSet($impl.TTMSFNCEditAutoType.atHex,$impl.TTMSFNCEditAutoType.atNumeric);
          if (allowclip) this.InsertText(cl);
          EatKey();
        } else if (this.FKeyDown === 65) {
          this.SelectAll();
          EatKey();
        } else {
          pas["WEBLib.StdCtrls"].TCustomEdit.KeyPress.apply(this,arguments);
          EatKey();
        };
        return;
      };
      var $tmp1 = this.FEditType$1;
      if ($tmp1 === $mod.TTMSFNCEditType.etString) {}
      else if ($tmp1 === $mod.TTMSFNCEditType.etNumeric) {
        if (!pas["WEBLib.TMSFNCTypes"].CharIsNumber(kch)) EatKey();
      } else if (($tmp1 === $mod.TTMSFNCEditType.etFloat) || ($tmp1 === $mod.TTMSFNCEditType.etSignedFloat)) {
        if (((kch === ",") && (pas.SysUtils.FormatSettings.DecimalSeparator !== ",")) || ((kch === ".") && (pas.SysUtils.FormatSettings.DecimalSeparator !== "."))) {
          EatKey();
          return;
        };
        if (pas["WEBLib.TMSFNCTypes"].CharIsNumber(kch) || (kch === ".") || (kch === ",") || (kch === pas.SysUtils.FormatSettings.DecimalSeparator) || (kch === pas.SysUtils.FormatSettings.ThousandSeparator) || ((this.FEditType$1 === $mod.TTMSFNCEditType.etSignedFloat) && (kch === "-"))) {
          if ((kch === pas.SysUtils.FormatSettings.DecimalSeparator) && (pas.System.Pos(pas.SysUtils.FormatSettings.DecimalSeparator,$Self.GetSelText()) === 0) && ((pas.System.Pos(pas.SysUtils.FormatSettings.DecimalSeparator,$Self.GetT()) > 0) || (this.FPrecision === 0))) {
            if (this.FPrecision > 0) this.SelectAfterDecimal();
            EatKey();
            return;
          };
          if ((kch === ",") && (pas.System.Pos(",",$Self.GetT()) > 0) && (pas.System.Pos(",",$Self.GetSelText()) === 0) && (kch !== pas.SysUtils.FormatSettings.ThousandSeparator)) {
            EatKey();
            return;
          };
          if ((kch === pas.SysUtils.FormatSettings.ThousandSeparator) || (kch === pas.SysUtils.FormatSettings.DecimalSeparator)) {
            if (ScanDistance($Self.GetT(),this.GetSelStart())) {
              EatKey();
              return;
            };
          };
          if (ScanPrecision($Self.GetT(),this.GetSelStart()) && (pas["WEBLib.TMSFNCTypes"].CharIsNumber(kch) || (kch === pas.SysUtils.FormatSettings.DecimalSeparator)) && (this.GetSelLength() === 0)) {
            if ((this.FPrecision > 0) && ((this.GetSelStart() - this.FPrefix.length) >= pas.System.Pos(pas.SysUtils.FormatSettings.DecimalSeparator,$Self.GetT())) && pas["WEBLib.TMSFNCTypes"].CharIsNumber(kch) && ((this.GetSelStart() - this.FPrefix.length) < $Self.GetT().length)) {
              oldSelStart = this.GetSelStart();
              this.SetText(pas.SysUtils.TStringHelper.Substring$1.call({p: this.GetT(), get: function () {
                  return this.p;
                }, set: function (v) {
                  this.p = v;
                }},0,this.GetSelStart()) + kch + pas.SysUtils.TStringHelper.Substring$1.call({p: this.GetT(), get: function () {
                  return this.p;
                }, set: function (v) {
                  this.p = v;
                }},this.GetSelStart() + 1,this.GetT().length));
              this.SetSelStart(oldSelStart + 1);
              EatKey();
              return;
            } else {
              EatKey();
              return;
            };
          };
          if ((this.GetSelStart() === 0) && ($Self.GetT() === "") && (kch === pas.SysUtils.FormatSettings.DecimalSeparator)) {
            this.SetText("0" + pas.SysUtils.FormatSettings.DecimalSeparator);
            this.SetSelStart(2);
            this.SetModified(true);
            EatKey();
            return;
          };
          if (this.FEditType$1 === $mod.TTMSFNCEditType.etSignedFloat) {
            if ((kch === "-") && (this.GetSelLength() === 0)) {
              s = $Self.GetT();
              oldprec = this.FPrecision;
              this.FPrecision = 0;
              oldSelStart = this.GetSelStart();
              if (pas.System.Pos("-",s) !== 0) {
                pas.System.Delete({get: function () {
                    return s;
                  }, set: function (v) {
                    s = v;
                  }},1,1);
                this.SetText(s + this.FSuffix);
                this.SetModified(true);
                if ((oldSelStart > 0) && (oldSelStart > this.FPrefix.length)) {
                  this.SetSelStart(oldSelStart - 1)}
                 else this.SetSelStart(this.FPrefix.length);
              } else {
                if ((this.GetFloat() !== 0) || (1 > 0)) {
                  this.SetText("-" + $Self.GetT() + this.FSuffix);
                  this.SetSelLength(0);
                  this.SetSelStart(oldSelStart + 1);
                  this.SetModified(true);
                };
              };
              this.FPrecision = oldprec;
              EatKey();
              return;
            };
          };
        } else EatKey();
      } else if ($tmp1 === $mod.TTMSFNCEditType.etSignedNumeric) {
        if (!(pas["WEBLib.TMSFNCTypes"].CharInArray(kch,["-"]) || pas["WEBLib.TMSFNCTypes"].CharIsNumber(kch))) EatKey();
        if ((pas.System.Pos(pas.SysUtils.FormatSettings.DecimalSeparator,this.GetT()) > 0) && (Key.get() === pas.SysUtils.FormatSettings.DecimalSeparator)) EatKey();
        if ((pas.System.Pos("-",this.GetT()) > 0) && (Key.get() === "-") && !(this.GetSelLength() === this.GetT().length)) EatKey();
        if ((kch === "-") && (this.GetSelLength() === 0)) {
          s = $Self.GetT();
          oldSelStart = this.GetSelStart();
          if (pas.System.Pos("-",s) !== 0) {
            pas.System.Delete({get: function () {
                return s;
              }, set: function (v) {
                s = v;
              }},1,1);
            this.SetText(s + this.FSuffix);
            this.SetModified(true);
            if ((oldSelStart > 0) && (oldSelStart > this.FPrefix.length)) {
              this.SetSelStart(oldSelStart - 1)}
             else this.SetSelStart(this.FPrefix.length);
          } else {
            if ((this.GetFloat() !== 0) || (1 > 0)) {
              this.SetText("-" + $Self.GetT() + this.FSuffix);
              this.SetSelLength(0);
              this.SetSelStart(oldSelStart + 1);
              this.SetModified(true);
            };
          };
          EatKey();
          return;
        };
      } else if ($tmp1 === $mod.TTMSFNCEditType.etUpperCase) {
        s = pas["WEBLib.TMSFNCTypes"].AnsiUpperCase(s);
        kch = s.charAt(0);
        Key.set(kch);
      } else if ($tmp1 === $mod.TTMSFNCEditType.etLowerCase) {
        s = pas["WEBLib.TMSFNCTypes"].AnsiLowerCase(s);
        kch = s.charAt(0);
        Key.set(kch);
      } else if ($tmp1 === $mod.TTMSFNCEditType.etMoney) {
        if ((kch === pas.SysUtils.FormatSettings.DecimalSeparator) && ((pas.System.Pos(pas.SysUtils.FormatSettings.DecimalSeparator,$Self.GetT()) > 0) || (this.FPrecision === 0))) {
          if (this.FPrecision > 0) {
            if (this.GetSelLength() === this.GetT().length) this.SetT("0,0");
            this.SelectAfterDecimal();
            EatKey();
          };
          this.FBlockChange = false;
          return;
        };
        if (pas["WEBLib.TMSFNCTypes"].CharIsNumber(kch) || (kch === "-") || (kch === pas.SysUtils.FormatSettings.DecimalSeparator)) {
          if ((kch === pas.SysUtils.FormatSettings.ThousandSeparator) || (kch === pas.SysUtils.FormatSettings.DecimalSeparator)) {
            if (ScanDistance($Self.GetT(),this.GetSelStart())) return;
          };
          if (ScanPrecision($Self.GetT(),this.GetSelStart()) && (pas["WEBLib.TMSFNCTypes"].CharIsNumber(kch) || (kch === pas.SysUtils.FormatSettings.DecimalSeparator)) && (this.GetSelLength() === 0)) {
            if ((this.FPrecision > 0) && ((this.GetSelStart() - this.FPrefix.length) >= pas.System.Pos(pas.SysUtils.FormatSettings.DecimalSeparator,$Self.GetT())) && pas["WEBLib.TMSFNCTypes"].CharIsNumber(kch) && ((this.GetSelStart() - this.FPrefix.length) < $Self.GetT().length)) {
              this.SetSelLength(1);
            } else {
              EatKey();
              return;
            };
          };
          if ((this.GetSelStart() === 0) && ($Self.GetT() === "") && (kch === pas.SysUtils.FormatSettings.DecimalSeparator)) {
            this.SetText("0" + pas.SysUtils.FormatSettings.DecimalSeparator);
            this.SetSelStart(2);
            this.SetModified(true);
            return;
          };
          if ((kch === "-") && (this.GetSelLength() === 0)) {
            s = $Self.GetT();
            oldprec = this.FPrecision;
            this.FPrecision = 0;
            oldSelStart = this.GetSelStart();
            if (pas.System.Pos("-",s) !== 0) {
              pas.System.Delete({get: function () {
                  return s;
                }, set: function (v) {
                  s = v;
                }},1,1);
              this.SetText(s + this.FSuffix);
              this.SetModified(true);
              if ((oldSelStart > 0) && (oldSelStart > this.FPrefix.length)) {
                this.SetSelStart(oldSelStart - 1)}
               else this.SetSelStart(this.FPrefix.length);
            } else {
              if ((this.GetFloat() !== 0) || (1 > 0)) {
                this.SetText("-" + $Self.GetT() + this.FSuffix);
                this.SetSelLength(0);
                this.SetSelStart(oldSelStart + 1);
                this.SetModified(true);
              };
            };
            this.FPrecision = oldprec;
            EatKey();
            return;
          };
        } else {
          EatKey();
          return;
        };
      } else if ($tmp1 === $mod.TTMSFNCEditType.etHex) {
        if (!pas["WEBLib.TMSFNCTypes"].CharIsHex(kch)) EatKey();
      } else if ($tmp1 === $mod.TTMSFNCEditType.etAlphaNumeric) {
        if (!pas["WEBLib.TMSFNCTypes"].CharIsLetterOrNumber(kch)) EatKey();
      } else if ($tmp1 === $mod.TTMSFNCEditType.etValidChars) {
        if (this.FValidChars !== "") if (pas.System.Pos(pas["WEBLib.TMSFNCTypes"].AnsiUpperCase(s),pas["WEBLib.TMSFNCTypes"].AnsiUpperCase(this.FValidChars)) === 0) EatKey();
      };
      s = $Self.GetT();
      pas["WEBLib.StdCtrls"].TCustomEdit.KeyPress.apply(this,arguments);
      if ($Self.GetT() !== s) this.SetModified(true);
      if (this.FEditType$1 in rtl.createSet($mod.TTMSFNCEditType.etFloat,$mod.TTMSFNCEditType.etSignedFloat,$mod.TTMSFNCEditType.etMoney)) {
        d = this.GetT().length - s.length;
        if (d > 1) this.SetCaretPosition(this.GetCaretPosition() + d);
      };
      if (rtl.eqSet(this.FShiftState,{})) this.UpdateLookup();
    };
    this.KeyDown = function (Key, Shift) {
      pas["WEBLib.Controls"].TControl.KeyDown.apply(this,arguments);
      this.FKeyDown = Key.get();
      this.FShiftState = rtl.refSet(Shift);
    };
    this.KeyUp = function (Key, Shift) {
      var oldSelStart = 0;
      var kch = "\x00";
      pas["WEBLib.Controls"].TControl.KeyUp.apply(this,arguments);
      if (Key.get() === 0) return;
      kch = String.fromCharCode(Key.get());
      if (!(Key.get() in rtl.createSet(113,13,38,40,27))) this.UpdateLookup();
      if ((Key.get() === 9) && this.IsLookupListVisible() && this.FLookup.FAcceptOnTab) this.DoneLookup();
      if (this.FEditType$1 === $mod.TTMSFNCEditType.etMixedCase) {
        oldSelStart = this.GetSelStart();
        this.SetT($impl.ShiftCase(this.GetT()));
        this.SetSelStart(oldSelStart);
      };
      if ((kch !== "") && (kch !== "\b")) this.UpdateAutoComplete();
    };
    this.DoLookupNeedData = function (Value, List, ItemIndex) {
      if (this.FOnLookupNeedData != null) this.FOnLookupNeedData(this,Value,List,ItemIndex);
    };
    this.DoLookupOpen = function () {
      if (this.FOnLookupOpen != null) this.FOnLookupOpen(this);
    };
    this.DoLookupClose = function () {
      if (this.FOnLookupClose != null) this.FOnLookupClose(this);
    };
    this.DoExit = function () {
      var TT = "";
      var OldModified = false;
      pas["WEBLib.Controls"].TControl.DoExit.call(this);
      if ((pas.Classes.TComponentStateItem.csLoading in this.FComponentState) || (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState)) return;
      if ((this.FPrecision >= 0) && (this.FEditType$1 in rtl.createSet($mod.TTMSFNCEditType.etFloat,$mod.TTMSFNCEditType.etSignedFloat,$mod.TTMSFNCEditType.etMoney))) {
        if ((this.GetT() !== "") || !this.FAllowNumericNullValue) {
          OldModified = this.FIsModified;
          this.SetFloat(this.GetFloat());
          this.SetModified(OldModified);
        };
      };
      if ((this.FEditType$1 in rtl.createSet($mod.TTMSFNCEditType.etNumeric,$mod.TTMSFNCEditType.etSignedNumeric)) && (this.GetT() === "") && !this.FAllowNumericNullValue) this.SetT("0");
      if ((this.FEditType$1 in rtl.createSet($mod.TTMSFNCEditType.etFloat,$mod.TTMSFNCEditType.etSignedFloat,$mod.TTMSFNCEditType.etMoney)) && (this.GetT() === "") && !this.FAllowNumericNullValue) this.SetFloat(0.0);
      TT = pas.SysUtils.Trim(this.GetT());
      if (this.FLookup.FEnabled && this.FLookup.FHistory && (TT !== "")) {
        if (this.FLookup.FDisplayList.IndexOf(TT) === -1) this.FLookup.FDisplayList.Add(TT);
      };
    };
    this.DoHandleChange = function (Event) {
      var Result = false;
      pas["WEBLib.StdCtrls"].TCustomEdit.DoHandleChange.apply(this,arguments);
      if (this.FEditType$1 === $mod.TTMSFNCEditType.etMoney) this.AutoSeparators();
      return Result;
    };
    this.LookupListbox = function () {
      var Result = null;
      Result = this.FLookupListBox;
      return Result;
    };
    this.LookupList = function () {
      var Result = null;
      Result = this.FLookupList;
      return Result;
    };
    this.CanFocus = function () {
      var Result = false;
      Result = pas["WEBLib.Controls"].TControl.CanFocus.call(this);
      Result = Result && this.GetAllowFocus();
      return Result;
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.Controls"].TControl.Create$1.apply(this,arguments);
      this.FAutoClose = true;
      this.FAllowFocus = true;
      this.SetAutoCompletion(pas["WEBLib.StdCtrls"].TAutoCompletion.acNone);
      this.FLookupFormTimer = pas["WEBLib.ExtCtrls"].TTimer.$create("Create$1",[this]);
      this.FLookupFormTimer.FOnTimer = rtl.createCallback(this,"DoLookupFormTimer");
      this.FLookupFormTimer.SetEnabled(false);
      this.FLookupFormTimer.SetInterval(1);
      this.FAutoThousandSeparator = true;
      this.FLengthLimit = 0;
      this.FAutoComplete = false;
      this.FLookup = $mod.TTMSFNCEditLookupSettings.$create("Create$1");
      this.FLookupListBoxItems = $mod.TTMSFNCLookupList.$create("Create$1");
      this.FLookupList = pas["WEBLib.TMSFNCPopup"].TTMSFNCPopup.$create("Create$1",[this]);
      this.FLookupList.FStaysOpen = true;
      this.FLookupListBox = pas["WEBLib.StdCtrls"].TListBox.$create("Create$1",[this]);
      this.FLookupListBox.SetItemHeight(18);
      this.FLookupListBox.FOnKeyUp = rtl.createCallback(this,"ListKeyUp");
      this.FLookupListBox.FOnMouseUp = rtl.createCallback(this,"ListMouseUp");
      this.FLookupListBox.SetVisible(false);
      this.FLookupListBox.SetAlign(pas["WEBLib.Controls"].TAlign.alClient);
      this.SetAutoSize(false);
      this.FLookupList.SetContentControl(this.FLookupListBox);
      this.FLookupList.FFocusedControl = this;
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FLookupFormTimer");
      rtl.free(this,"FLookup");
      this.CleanupLookupList();
      if (this.FLookupListBox != null) {
        rtl.free(this,"FLookupListBox");
        this.FLookupListBox = null;
      };
      rtl.free(this,"FLookupListBoxItems");
      if (this.FLookupList != null) {
        rtl.free(this,"FLookupList");
        this.FLookupList = null;
      };
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.DisplayLookup = function () {
      var i = 0;
      var cnt = 0;
      var mw = 0;
      var mh = 0;
      var tw = 0;
      var LookupText = "";
      var idx = 0;
      var obj = null;
      if (!(this.FLookup != null) || !this.FLookup.FEnabled || !(this.FLookupListBox != null)) return;
      mh = (18 * this.FLookup.FDisplayCount) + 4;
      this.FLookupListBox.SetParent(this);
      this.CleanupLookupList();
      this.FLookupListBox.FItems.Clear();
      for (var $l = 1, $end = this.FLookup.FDisplayList.GetCount(); $l <= $end; $l++) {
        i = $l;
        obj = $mod.TTMSFNCLookupListBoxItem.$create("Create$1",[i - 1]);
        this.FLookupListBox.FItems.AddObject($impl.CleanString(this.FLookup.FDisplayList.Get(i - 1)),obj);
        this.FLookupListBoxItems.Add(obj);
      };
      idx = 0;
      this.DoLookupNeedData(LookupText,this.FLookupListBox.FItems,{get: function () {
          return idx;
        }, set: function (v) {
          idx = v;
        }});
      cnt = this.FLookupListBox.FItems.GetCount();
      if ((this.FLookup.FDisplayList.GetCount() > 0) && (this.FLookupListBox.FItems.GetCount() > 0)) this.FLookupListBox.SetItemIndex(idx);
      if (cnt < this.FLookup.FDisplayCount) mh = (cnt * 18) + 4;
      this.FLookupListBox.SetSorted(true);
      mw = 50;
      this.FLookupList.SetDropDownWidth(0);
      if (cnt > 0) {
        for (var $l1 = 1, $end1 = cnt; $l1 <= $end1; $l1++) {
          i = $l1;
          tw = 0;
          if (this.FLookupListBox.GetCanvas() != null) tw = Math.round(this.FLookupListBox.GetCanvas().TextWidth(this.FLookupListBox.FItems.Get(i - 1)));
          if (tw > mw) mw = tw;
        };
        mw = mw + 26;
      };
      if (this.FLookup.FWidth > 0) mw = this.FLookup.FWidth;
      if (this.FLookup.FHeight > 0) mh = this.FLookup.FHeight;
      this.FLookupList.SetPlacementControl(this);
      if (cnt > 0) {
        this.FLookupList.SetDropDownWidth(Math.max(this.FLookup.FMinimumWidth,mw));
        this.FLookupList.SetDropDownHeight(Math.max(this.FLookup.FMinimumHeight,mh));
        if (this.FLookupList.HasPopupForm()) {
          this.FLookupListBox.SetParent(this.FLookupList.FPopupForm);
          this.FLookupList.FPopupForm.SetWidth(Math.round(this.FLookupList.FDropDownWidth));
          this.FLookupList.FPopupForm.SetHeight(Math.round(this.FLookupList.FDropDownHeight));
        };
        if (!this.FLookupList.FIsOpen) this.DoLookupOpen();
        this.FLookupList.SetIsOpen(true);
        this.FLookupFormTimer.SetEnabled(this.FAutoClose);
      } else {
        if (this.FLookupList.FIsOpen) this.DoLookupClose();
        this.FLookupList.SetIsOpen(false);
      };
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("AllowFocus",3,rtl.boolean,"GetAllowFocus","SetAllowFocus",4,{Default: true});
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("Alignment",2,pas.Classes.$rtti["TAlignment"],"FAlignment","SetAlignment");
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("AutoSelect",2,rtl.boolean,"FAutoSelect","SetAutoSelect",4,{Default: true});
    $r.addProperty("AutoSize",2,rtl.boolean,"FAutoSize","SetAutoSize",4,{Default: false});
    $r.addProperty("Hint",2,rtl.string,"FHint","SetHint");
    $r.addProperty("TextHint",2,rtl.string,"FTextHint","SetTextHint");
    $r.addProperty("BorderStyle",2,pas["WEBLib.Controls"].$rtti["TBorderStyle"],"FBorderStyle","SetBorderStyle",4,{Default: pas["WEBLib.Controls"].TBorderStyle.bsSingle});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor");
    $r.addProperty("DoubleBuffered",0,rtl.boolean,"FDoubleBuffered","FDoubleBuffered",4,{Default: false});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("HideSelection",2,rtl.boolean,"FHideSelection","SetHideSelection");
    $r.addProperty("MaxLength",2,rtl.longint,"FMaxLength","SetMaxLength",4,{Default: 0});
    $r.addProperty("PasswordChar",2,rtl.char,"FPasswordChar","SetPasswordChar",4,{Default: "\x00"});
    $r.addProperty("ReadOnly",2,rtl.boolean,"FReadOnly","SetReadOnly",4,{Default: false});
    $r.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",4,{Default: false});
    $r.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder");
    $r.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",4,{Default: true});
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChange","FOnChange");
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnEnter","FOnEnter");
    $r.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnExit","FOnExit");
    $r.addProperty("OnKeyDown",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyDown","FOnKeyDown");
    $r.addProperty("OnKeyPress",0,pas["WEBLib.Controls"].$rtti["TKeyPressEvent"],"FOnKeyPress","FOnKeyPress");
    $r.addProperty("OnKeyUp",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyUp","FOnKeyUp");
    $r.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseDown","FOnMouseDown");
    $r.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseEnter","FOnMouseEnter");
    $r.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseLeave","FOnMouseLeave");
    $r.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti["TMouseMoveEvent"],"FOnMouseMove","FOnMouseMove");
    $r.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseUp","FOnMouseUp");
    $r.addProperty("Text",3,rtl.string,"GetT","SetT");
    $r.addProperty("Version",1,rtl.string,"GetVersion","");
    $r.addProperty("AutoComplete",0,rtl.boolean,"FAutoComplete","FAutoComplete",4,{Default: false});
    $r.addProperty("EditType",2,$mod.$rtti["TTMSFNCEditType"],"FEditType$1","SetEditType$1",4,{Default: $mod.TTMSFNCEditType.etString});
    $r.addProperty("Lookup",2,$mod.$rtti["TTMSFNCEditLookupSettings"],"FLookup","SetLookup");
    $r.addProperty("ValidChars",0,rtl.string,"FValidChars","FValidChars");
    $r.addProperty("AllowNumericNullValue",0,rtl.boolean,"FAllowNumericNullValue","FAllowNumericNullValue",4,{Default: false});
    $r.addProperty("AutoThousandSeparator",2,rtl.boolean,"FAutoThousandSeparator","SetAutoThousandSeparator",4,{Default: true});
    $r.addProperty("FullTextSearch",0,rtl.boolean,"FFullTextSearch","FFullTextSearch",4,{Default: false});
    $r.addProperty("LengthLimit",0,rtl.smallint,"FLengthLimit","FLengthLimit",4,{Default: 0});
    $r.addProperty("Precision",2,rtl.smallint,"FPrecision","SetPrecision",4,{Default: 0});
    $r.addProperty("PrecisionDisplay",2,$mod.$rtti["TTMSFNCEditPrecisionDisplay"],"FPrecisionDisplay","SetPrecisionDisplay",4,{Default: $mod.TTMSFNCEditPrecisionDisplay.pdNormal});
    $r.addProperty("OnLookupSelect",0,$mod.$rtti["TTMSFNCEditLookupSelectEvent"],"FOnLookupSelect","FOnLookupSelect");
    $r.addProperty("OnLookupIndexSelect",0,$mod.$rtti["TTMSFNCEditLookupIndexSelectEvent"],"FOnLookupIndexSelect","FOnLookupIndexSelect");
    $r.addProperty("OnLookupNeedData",0,$mod.$rtti["TTMSFNCEditLookupNeedDataEvent"],"FOnLookupNeedData","FOnLookupNeedData");
    $r.addProperty("OnLookupOpen",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnLookupOpen","FOnLookupOpen");
    $r.addProperty("OnLookupClose",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnLookupClose","FOnLookupClose");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
  rtl.createClass(this,"TTMSFNCEditButton",pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$init.call(this);
      this.FBlockDropDown = false;
      this.FPopup = null;
      this.FEdit = null;
      this.FButton = null;
      this.FPopupControl = null;
      this.FOnButtonClick = null;
      this.FModalPopup = false;
      this.FBitmap = null;
      this.FBitmapName = "";
      this.FButtonSize = 0;
      this.FBitmapContainer = null;
    };
    this.$final = function () {
      this.FPopup = undefined;
      this.FEdit = undefined;
      this.FButton = undefined;
      this.FPopupControl = undefined;
      this.FOnButtonClick = undefined;
      this.FBitmap = undefined;
      this.FBitmapContainer = undefined;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$final.call(this);
    };
    this.SetPopupControl = function (Value) {
      this.FPopupControl = Value;
      this.FPopup.SetContentControl(this.FPopupControl);
    };
    this.GetText = function () {
      var Result = "";
      Result = this.FEdit.GetT();
      return Result;
    };
    this.GetBitmapContainer = function () {
      var Result = null;
      Result = this.FBitmapContainer;
      return Result;
    };
    this.SetBitmap = function (Value) {
      this.FBitmap = Value;
      if (this.FButton != null) {
        this.FButton.FBitmaps.Clear();
        this.FButton.FBitmaps.AddBitmap(Value,1.0);
      };
    };
    this.SetBitmapContainer = function (Value) {
      this.FBitmapContainer = Value;
      if (this.FButton != null) this.FButton.SetBitmapContainer(Value);
    };
    this.SetBitmapName = function (Value) {
      this.FBitmapName = Value;
      if (this.FButton != null) {
        this.FButton.FBitmaps.Clear();
        this.FButton.FBitmaps.AddBitmapName(Value,1.0);
      };
    };
    this.SetButtonSize = function (Value) {
      this.FButtonSize = Value;
      if (this.FButton != null) this.FButton.SetWidth(Value);
    };
    this.SetText = function (Value) {
      this.FEdit.SetT(Value);
    };
    this.ChangeDPIScale = function (M, D) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ChangeDPIScale.apply(this,arguments);
      this.SetButtonSize(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FButtonSize,M,D));
    };
    this.SetAdaptToStyle = function (Value) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.SetAdaptToStyle.apply(this,arguments);
      if (this.FButton != null) this.FButton.SetAdaptToStyle(this.GetAdaptToStyle());
    };
    this.BeforeDropDown = function () {
    };
    this.Loaded = function () {
      pas["WEBLib.Controls"].TCustomControl.Loaded.call(this);
      if ((this.FButton != null) && (this.FBitmapContainer != null) && (this.FBitmapName !== "")) {
        this.FButton.FBitmaps.Clear();
        this.FButton.FBitmaps.AddBitmapName(this.FBitmapName,1.0);
      };
    };
    this.EditKeyDown = function (Sender, Key, Shift) {
      if (this.FOnKeyDown != null) this.FOnKeyDown(this,Key,rtl.refSet(Shift));
      if (!(pas.Classes.TShiftState$a.ssAlt in Shift) && (Key.get() === 115)) {
        this.DropDown();
        return;
      };
    };
    this.EditKeyUp = function (Sender, Key, Shift) {
      if (this.FOnKeyUp != null) this.FOnKeyUp(this,Key,rtl.refSet(Shift));
    };
    this.PopupKeyDown = function (Sender, Key, Shift) {
      var $tmp = Key.get();
      if ($tmp === 13) {
        this.DropDown();
      };
    };
    this.Notification = function (AComponent, Operation) {
      if ((Operation === pas.Classes.TOperation.opRemove) && (AComponent === this.FPopupControl)) this.FPopupControl = null;
      if ((Operation === pas.Classes.TOperation.opRemove) && (AComponent === this.FBitmapContainer)) this.FBitmapContainer = null;
      pas["WEBLib.Menus"].TWebCustomControl.Notification.apply(this,arguments);
    };
    this.ButtonClick = function (Sender) {
      if (!this.FBlockDropDown) this.DropDown();
      this.FBlockDropDown = false;
      if (this.FOnButtonClick != null) this.FOnButtonClick(this);
    };
    this.BitmapChanged = function (Sender) {
      if (this.FButton != null) {
        this.FButton.FBitmaps.Clear();
        this.FButton.FBitmaps.AddBitmap(this.FBitmap,1.0);
      };
    };
    this.Create$1 = function (AOwner) {
      var res = "";
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Create$1.apply(this,arguments);
      this.FModalPopup = false;
      this.FButton = pas["WEBLib.TMSFNCToolBar"].TTMSFNCToolBarDropDownButton.$create("Create$1",[this]);
      this.FButton.SetTabStop(false);
      this.FButton.SetAllowFocus(false);
      this.FButton.FStored = false;
      this.FButton.SetWidth(18);
      this.FButton.FAppearance.SetRounding(0);
      this.FButton.SetAlign(pas["WEBLib.Controls"].TAlign.alRight);
      this.FButton.SetParent(this);
      this.FButton.FOnClick = rtl.createCallback(this,"ButtonClick");
      res = pas["WEBLib.TMSFNCToolBar"].TMSFNCTOOLBAREXPANDSVG;
      this.FButton.FBitmaps.AddBitmapFromResource$1(res,pas["WEBLib.TMSFNCTypes"].HInstance(),1.0);
      this.FButton.FDisabledBitmaps.AddBitmapFromResource$1(res,pas["WEBLib.TMSFNCTypes"].HInstance(),1.0);
      this.FButton.FHoverBitmaps.AddBitmapFromResource$1(res,pas["WEBLib.TMSFNCTypes"].HInstance(),1.0);
      this.FEdit = $mod.TTMSFNCEdit.$create("Create$1",[this]);
      this.FEdit.SetParent(this);
      this.FEdit.SetAlign(pas["WEBLib.Controls"].TAlign.alClient);
      this.FEdit.FOnKeyDown = rtl.createCallback(this,"EditKeyDown");
      this.FEdit.FOnKeyUp = rtl.createCallback(this,"EditKeyUp");
      this.FPopup = pas["WEBLib.TMSFNCPopup"].TTMSFNCPopup.$create("Create$1",[this]);
      this.FPopup.SetPlacement(pas["WEBLib.TMSFNCPopup"].TTMSFNCPopupPlacement.ppBottom);
      this.FPopup.FStored = false;
      this.FPopup.SetDragWithParent(true);
      this.FPopup.SetWidth(240);
      this.FPopup.SetHeight(160);
      this.FButtonSize = 18;
      this.FBitmap = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      this.FBitmap.FOnChange = rtl.createCallback(this,"BitmapChanged");
      this.SetWidth(118);
      this.SetHeight(22);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FButton");
      rtl.free(this,"FPopup");
      rtl.free(this,"FBitmap");
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Destroy.call(this);
    };
    this.DropDown = function () {
      if (this.FPopupControl != null) {
        this.FPopup.SetPlacementControl(this);
        if (!this.FPopup.FIsOpen) {
          this.BeforeDropDown();
          this.FPopup.Popup(this.FModalPopup);
        } else this.FPopup.SetIsOpen(false);
      };
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("BitmapContainer",3,pas["WEBLib.TMSFNCBitmapContainer"].$rtti["TTMSFNCBitmapContainer"],"GetBitmapContainer","SetBitmapContainer");
    $r.addProperty("Bitmap",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FBitmap","SetBitmap");
    $r.addProperty("BitmapName",2,rtl.string,"FBitmapName","SetBitmapName");
    $r.addProperty("ButtonSize",2,rtl.longint,"FButtonSize","SetButtonSize",4,{Default: 18});
    $r.addProperty("PopupControl",2,pas["WEBLib.Controls"].$rtti["TControl"],"FPopupControl","SetPopupControl");
    $r.addProperty("OnButtonClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnButtonClick","FOnButtonClick");
    $r.addProperty("Text",3,rtl.string,"GetText","SetText");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
  $mod.$implcode = function () {
    $impl.TTMSFNCEditAutoType = {"0": "atNumeric", atNumeric: 0, "1": "atFloat", atFloat: 1, "2": "atString", atString: 2, "3": "atDate", atDate: 3, "4": "atTime", atTime: 4, "5": "atHex", atHex: 5};
    $mod.$rtti.$Enum("TTMSFNCEditAutoType",{minvalue: 0, maxvalue: 5, ordtype: 1, enumtype: $impl.TTMSFNCEditAutoType});
    rtl.createClass($impl,"TTMSFNCPopupOpen",pas["WEBLib.TMSFNCPopup"].TTMSFNCPopup,function () {
      rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
      rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
      rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
      rtl.addIntf(this,pas.System.IUnknown);
    });
    $impl.CheckTerminator = function (ch) {
      var Result = false;
      Result = pas["WEBLib.TMSFNCTypes"].CharInArray(ch,[" ",",",".","/","\\",":","*","$","-","(",")","[","]",'"',"'","&"]);
      return Result;
    };
    $impl.ShiftCase = function (AName) {
      var Result = "";
      var I = 0;
      var L = 0;
      var NewName = "";
      var First = false;
      First = true;
      NewName = AName;
      L = AName.length;
      for (var $l = 1, $end = L; $l <= $end; $l++) {
        I = $l;
        if ($impl.CheckTerminator(NewName.charAt(I - 1))) {
          First = true}
         else if (First) {
          NewName = rtl.setCharAt(NewName,I - 1,pas["WEBLib.TMSFNCTypes"].AnsiUpperCase(AName).charAt(I - 1));
          First = false;
        } else NewName = rtl.setCharAt(NewName,I - 1,pas["WEBLib.TMSFNCTypes"].AnsiLowerCase(AName).charAt(I - 1));
        if ((pas.System.Copy(NewName,1,I) === "Mc") || (pas.System.Copy(NewName,1,I) === "Mac") || ((pas.System.Pos(" Mc",NewName) === (I - 2)) && (I > 2)) || ((I > (L - 3)) && ((pas.System.Copy(NewName,I - 1,2) === " I") || (pas.System.Copy(NewName,I - 2,3) === " II")))) First = true;
      };
      Result = NewName;
      return Result;
    };
    $impl.IsType = function (s) {
      var Result = 0;
      var i = 0;
      var isI = false;
      var isF = false;
      var isH = false;
      var th = 0;
      var de = 0;
      var mi = 0;
      Result = $impl.TTMSFNCEditAutoType.atString;
      isI = true;
      isF = true;
      isH = true;
      if (s === "") {
        isI = false;
        isF = false;
        isH = false;
      };
      th = -1;
      de = 0;
      mi = 0;
      for (var $l = 1, $end = s.length; $l <= $end; $l++) {
        i = $l;
        if (!pas["WEBLib.TMSFNCTypes"].CharIsNumber(s.charAt(i - 1))) isI = false;
        if (!pas["WEBLib.TMSFNCTypes"].CharIsNumber(s.charAt(i - 1)) && !pas["WEBLib.TMSFNCTypes"].CharInArray(s.charAt(i - 1),[".",","])) isF = false;
        if (!pas["WEBLib.TMSFNCTypes"].CharIsNumber(s.charAt(i - 1)) && !pas["WEBLib.TMSFNCTypes"].CharIsLetter(s.charAt(i - 1))) isH = false;
        if ((s.charAt(i - 1) === pas.SysUtils.FormatSettings.ThousandSeparator) && ((i - th) < 3)) isF = false;
        if (s.charAt(i - 1) === pas.SysUtils.FormatSettings.ThousandSeparator) th = i;
        if (s.charAt(i - 1) === pas.SysUtils.FormatSettings.DecimalSeparator) de += 1;
        if (s.charAt(i - 1) === "-") mi += 1;
      };
      if (isH && !isI) Result = $impl.TTMSFNCEditAutoType.atHex;
      if (isI) {
        Result = $impl.TTMSFNCEditAutoType.atNumeric}
       else {
        if (isF) Result = $impl.TTMSFNCEditAutoType.atFloat;
      };
      if ((mi > 1) || (de > 1)) Result = $impl.TTMSFNCEditAutoType.atString;
      return Result;
    };
    $impl.HexToInt = function (s) {
      var Result = 0;
      var i = 0;
      var r = 0;
      var m = 0;
      function CharVal(c) {
        var Result = 0;
        Result = 0;
        if ((c >= "0") && (c <= "9")) Result = c.charCodeAt() - 48;
        if ((c >= "A") && (c <= "F")) Result = (c.charCodeAt() - 65) + 10;
        if ((c >= "a") && (c <= "f")) Result = (c.charCodeAt() - 97) + 10;
        return Result;
      };
      r = 0;
      m = 1;
      for (var $l = s.length; $l >= 1; $l--) {
        i = $l;
        r = r + (m * CharVal(s.charAt(i - 1)));
        m = m << 4;
      };
      Result = r;
      return Result;
    };
    $impl.ValStr = function (s) {
      var Result = 0;
      var err = 0;
      pas.System.val$6(s,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }},{get: function () {
          return err;
        }, set: function (v) {
          err = v;
        }});
      return Result;
    };
    $impl.CleanString = function (s) {
      var Result = "";
      var i = 0;
      i = pas.System.Pos("\r",s);
      if (i > 0) pas.System.Delete({get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},i,1);
      i = pas.System.Pos("\n",s);
      if (i > 0) pas.System.Delete({get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},i,1);
      i = pas.System.Pos("\x0B",s);
      if (i > 0) pas.System.Delete({get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},i,1);
      Result = s;
      return Result;
    };
    $impl.StripThousandSep = function (s) {
      var Result = "";
      while (pas.System.Pos(pas.SysUtils.FormatSettings.ThousandSeparator,s) > 0) pas.System.Delete({get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},pas.System.Pos(pas.SysUtils.FormatSettings.ThousandSeparator,s),1);
      Result = s;
      return Result;
    };
    rtl.createClass($impl,"TTMSFNCControlOpen",pas["WEBLib.Controls"].TControl,function () {
      rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
      rtl.addIntf(this,pas.System.IUnknown);
    });
    rtl.createClass($impl,"TTMSFNCToolBarDropDownButtonOpen",pas["WEBLib.TMSFNCToolBar"].TTMSFNCToolBarDropDownButton,function () {
      rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
      rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
      rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
      rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
      rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
      rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
      rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
      rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
      rtl.addIntf(this,pas.System.IUnknown);
    });
  };
  $mod.$init = function () {
    pas.Classes.RegisterClass($mod.TTMSFNCEditButton);
  };
},["SysUtils","Types","WEBLib.TMSFNCUtils","Math"]);
rtl.module("WEBLib.TMSFNCColorWheelResources",["System"],function () {
  "use strict";
  var $mod = this;
  this.GetColorWheelResource = function () {
    var Result = "";
    Result = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAYAAAA8AXHiAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMjHxIGmVAACqeElEQVR4Xuz9BbhVZdjufQM2onR3SSPdId0h3d0p3VLSISkp3S3S3SIhKSmpgISUNDLn9" + "xvP5j3e3N+u59nv3vt9psdfFnOOcd/3uK9znec1FmvNFeH/i49aEUJxa0YIpawdIZS6foTQ+EYRQ+OboVXE0LG2EcPhjpHC4c7ohl7oi/4YhCEYgdH4FhMw2TlTnTvTGLMw15iLjR+wNEIo9ttp//3xv9qjVIRw8TIRQiUqRAxt+zJi6HC1SKG/ahFEvXfC4YZo+m443AKt0f69cPgrdEUP9H4/HP4aA/ENhmEUxnptPCZhCqY793vMwXxjLsJS" + "c6yIFLq72pxrI4ZWrreGTRFCRd4u698f/zM+CkYItSwcMTy8eMTww1IKXE6hKyl6FdQghDqoTyCNPwiHm6EV2n7IrdAZ3T7iVuiL/hiMoRiB0RiHifjOsdMwE7ONMQ8LscTYy82xCj+Ycx02WsPmSKHQNmvaGSHUa3eEULO3y/33x/+oj88jhBJmixCqkytiaGk+QiqkiEUVs4TClkEFha6s4NUIoBbqEkVDNI3MrdD6Y26Fr6JwK/RAb3yNgZ9" + "wKwzDKIz13HhMwhTMwCznzsECYy3GMmOvxBpz/YgN5t5sDVutZQd2W9s+a/zJWn+OGPr+sLWfjhCO9/Zy/v3x/+YjVYRQorQRQlUyRAzt+TxS6J8cCpVHwQooXGFFLKaYpRS1nAJXUuwqqKH4tQmhPhoTSTO0+pRboWNUboVu6BWNW6E/BmMoRmA0xmEivsM0x87EbMwzxkIsMeYKrDLHD1hnzo3m3oLt1rLLmvZa2wFr/Nlaj1jzMWs/ESn07J" + "RrORMhVPKCa3t7mf/++O/1SBYhVBijU0cKPUmnIJkUJqsC5VSovApWUOGKKGAJhSyjqOUVt7JCV1P0mqhLBA2JoglaROdWaB+DW6EresTkVvgaA/ENhmMUxmI8JmEqZmCWc+ZiARYbaxlWGnsNfjTXBnNuxjZr2Gkte6xpv7UdtMZD1nrUmo9b+ynXcMa1nHdNF13blQjhAVcjhPK/vex/f/zbPMLvxrbJCSKGtifRp6S0+WkUIoOCfK4w2RUot" + "0LlV7TCilcUJRWzLCoqbhVFrq7gtRW/PhoRRLNY4XBLtI0dDndAZ3SLw63QFwPicisMxQiMwThMxHden4aZmIP5zl2EpVhhzNVYa4715tqIrebeYQ27rGWvNR3Az9Z4BMes+aS1/+oazrmWC67pkmu76hqvu9abrvlmhHD2cIRwpLeb8e+Pf41H1AjhL2JGDB2Ipx9J5DM6mU1PpQBpFSKjgmTx2Z9DcfJwhAIK9oXiFVfE0opZXlEro6pC10Rd" + "hW9ACE3QgkBao308boWu8bkVeuPrBNwKQzAcozAW4zEZUzEDsxw7Fwuw2BjLsNKYa7DOHBuw2ZzbzL2T0PZYy34ctLbD1viLtZ6w5lPWfsY1nHctv7mmK67tumv8w7Xecs13XPtfEUM77kUI5Xq7Lf/++K99fBAhVOzjiKGz0Xzmxra58W1yYpud3MZ/pgDpFSKzz/hsCpNLgfIpVCEFK6pwJRWxrGJWUNQvFbe6QtdW9HpoRATNiKIl2ibkVui" + "ciFuhV2Juhf4YjKEYkYRbYRwm4jvPTcf3mIP5zluEpVhhrNVYa+z12GSurebcgd3WsM9afrKmQ9Z21BqPWetJa/7V2s+5houu5bJruurafneNNwnstmu+59of2INH74TePIkYOvgsQrjA223698d/3iP8boQIoXzvRQzv+kgMfGIzY9jUODY3AUEltdkpbXoan+EZFOFzxcihMLkVqIBCFVawYgpXSgHLKWQlBa2quDUVuY6CN1D8JmhOEK2JpB" + "2+Ssqt0CMZt8LXGJicW2E4RmEsJmAypmIGZmGuYxdiCZYbYxV+MOY6bDTHFnNtxy5z77WG/dZy0JoOW9sv1njCWk9b81lrv+AaLrmWK67pumu74Rr/dK13XPNfBPbQHvxtL57Zkxf25rU9CnGwf4/I/9Tjo1DCiO+GFkXiUO/bvMg2MarNjElQ8WxuIp/JyWx2Khufzmd4JkXIqiA5FSavAhVUqCKKVkLxyihiBcX8UlGro5Yi11PsRgrflAhao" + "i1hdEDnFNwqJbdCXwxIxa0wFCMxBuNScytM8fF0fI85mI9FzlmKFcZZjbXGXI/N5tiKHebcbe591vCTtRzCUes7bp2n8CuRnbP2i67hsmu55pr+cG23XONt13rPNT9w7Y/twVMCe25PXtmbN/YpHCkUDkV8OZHAEr7dxX9//J8eUUKVIn0UfviOjXvPxn2AKD6OZjNj2dT4NjexTU5usz/zmZ3e5mdWiGwKklth8hNUYUUqRkylFK6sIlZUzCqK" + "WkNx6yh0AzRW+OZE0Jog2uErYumCHp9xK3ydhlthCIan5Vb4FhMwGVMxE7MxzzELsQTLnbsKPxhrHTYaewu2m2uXOfea+4B1/Iwj1nTM2k5Y42lrPWvNF6z9kmu46lp+d003XNufrvGua73vmh+59if24Jm9eGlP/rE3IXsUfu9NOPzOq3Ao0rP7oQhPSr3dzX9/EFTsiFFDV9+xce+y//dt3oc2L7II+AQx/D2O1xLY3KQ2OaXNTmPTM9r8LAq" + "RQ0Hy+OwvoDhfKFRxBSutcOUVsLJiVlPUWopbV5EbKnhTtCSANsTQAZ0IpFs6boW+6bkVBmMoRmbgVhiHSZiC6fgeczDfMYuwDCudvwY/YoMxNxt7G3aaa4859+OgNRyylqPWdNzaTlnjGWs9b82/Wftl13DNtfzhmm65tjuu8S/X+sA1P3btT+3BC3vxyp6E7E04cshmvbZpL2zeU+J6HApFfHgqHOFG5Le7+//RR+xQ/UixQ+feYf/v2bwPbN" + "5HIuBjGxjFBkZFTB/H9VwiryezyalsdjqbnsnmZ1WInD7j8ypKQQUqqlAlFayswlVUwCoKWV1BaytufUVurODNFb4VIbTDV8TRJSO3Qm98nYlbYUhmboVR+BYTMBnTMBOzMQ8LsQTLnbMKPxhjPTYadwt2mGOX+fbigLl/toYj1nLMmk5a26/WeM5aL1jzJWu/6hp+dy03XdNt13bPNd53rY9c8xPX/twevLQX/9iTsE/CcJR/bNZLm/bM5j2xi" + "Y+4133ReO9sKMKfdd7u8v+HHmlCn0RMGN71ToJQ6F2foe/bwA9tYGQxEMUmfmoToxFbdBsZC/H8PbHnkzvmM8emt+mZbX52n+m5FSO/whRWoGIKVUrByilcJQWsqpA1FbWuAjdEU8VuofBtiKADQXRCt8/D4Z7om8WdIAZn5VYYiTEYl41bYQqmYxbmYoHXFmMZVmKNc3/EBmNtxjZj7zTPHuw350FzH7aGX3DCmk5Z2xlrPG+tv1nzFWu/7hpu" + "ENgt13THtf3lGh+61r9d8zPX/sIevLYXIXsSji4Co72yWdwqylOb99gmPrCZ97jXHe5181Uowu9rNfbvvd31/8UfyUM5IyYL/fSODXzPBn5gAz/yWfqxTfzEJkYltOg2MoaNjEVocWxmAh8n8VxKr6dxXEbnZHFuDoLKoxgFFaaIApVQqDIKVkHhvlTA6opZW1HrK24jhW6m4K3QjgA6EkMXAumB3tm5FQbm4FYYjlE5uRUmYDKmYSZmYx4WYSl" + "WOHY11mK9MTZhqzF3YLc59pnrJ3P+jKPWcMxaTlrTr9Z2zhovcrLL1nzN2n93DTcJ7LZruufaHrjGx671iWt+7tpf2YM39iIcRwTGEoExuFV0bvXp3zbvoU28bzPv2tQ/be4N7nWde13ZHYpwKefb3f9f9JE2VCJS6tCbd23g+8TwoU2MbBOj4FNCi4oYNjOmzYxNbHFtaHwbmpDYkvk4lefTeT2TTc/qnJzGyGesQgpTVIFKElRZBauocFUUsI" + "ZC1lHQBorbRJFbKHZrhW+PToTQjTB65uJW6J+bW2EoRubhVhiHSZiSl1thFuZigecWYxlWYo1zfsQGbDHWduw09l5z7DfXQRw29y/WcMJaTlvTWWu7YI2/WesVArtu7Tdcw5+u5a5r+su1PXKNf7vWZ675pWv/xx6E7EU4PreKy61iP7dZIjA6t4rKrT7lVlFu29SbNvcPm3yNuC5zr4tPQhEu5Hlbhf+FHoXD70bIEJofKV3o5Xs28QOb+KFN/" + "Bif2MioPluj2cyYNjMWscWxofGQgNAS2dQkNjW5Pz+zyek9n9lx2Z2T27n5jVHYmMUJqrRClVewygpXTQFrKWQ9BW2ksM0UuaVit1X0jgTQhSC6ozeh9MvHrfANhufnVvgWEwpwK0zDTMzGPCzCUqxwzGqsxXrnbsJW4+3AbmPvM89POGTOo+Y+bg2nrOWMNZ2ztovWeNlar1nzH9Z+yzXcdi33XNMD1/bYnjx1rS9c8yvX/sYehBNzq4TcKoEI" + "jMet4nCrWNwq5l828Q5xcatPuFXk6zb5is3+TTSeJ66zf4cinJ4hGiO+rcr/Ao8soRWRbOB7+MAmfmQTP8YnPluj2szoNjMmYhNcXJsa36YmJJzENjapjU1GbClsbhofZ/B8Fq/ncGwe5xR0fhFjlTBuGYWqoGBfKlwNBaytkPUVtLHiNkdrxW6v6J0IoCsx9CSOvuhfkFthaCFuhTGFuRUmYQqmYxbmYgEWYzlW4Qesc85GbDHGduwy5l4cMMf" + "P5jpizl/MfdIaTuOsNV2wtkvWeNVaf7fmm9b+p2u461ruu6ZHru2JvXjmWl/ah3/sQdgehJNp2JNwq8TcKiG3iq9hjysCY4vAmNwqOreK+rvNvWqTL9nsizb9HHH9Gg5HOhkORTi28G1V/id+pAp9EDFHeNk7NvE9m/gBPrKRH9vITxHNZsYgtlg2NA7i2dQExJbIxiaxscmIJ7nNTWlzUxNUWn9m8vesXsvluHyOL+S8osYpabxyxq9krqoKV1" + "MB6ypmQ0VtqrgtFbmNYndAZ8XvTgi9iaLfF9wK3xThVhhVlFthAiZjWjFuhdmYj0VYihVeW4212IBNzt2KncbaY9x9+Mkch8111JzHccoazljLeWv6zdqucLJr1vqHNd+y9juu4S/X8tA1PXZtT13jC9f62jWHXHs4tQhMya2Sc6ukGvYkIjARt0rAreJxqzi3bKYIjCECo3GrT7nVx+dt+hmbf0oRjovGX/Rdh6ZwrnfeVul/skf68PsR84ZWv" + "mMT37eJHyKyYkdBVBsazYbGsKGxEdemxie4hDY2MZLa3OQEl9IGp7LBn9ngtMSW3iZn9mc2z+X2Wn7HfeG84s4vbZzyxq1s/OrmqqWA9RWysYI2U9zWitxOsb9S+K4E0BN9CKI/kQzG0OLh8IgS3ArjMKkkt8IMzMJcLMASLMcq/IB1jt2ILdhujF3G2osDxv7ZHEdwzJwnzf2rNZyzlovWdMnarlrj79Z605pvW/s913DftTyyB09c23PX+Mq1" + "vnHN4XQiMC23+kzDnkoEpuRWyblVUm6VmFslFIHxRWBcbhWbW8XgVtEuENdZm37a5p9UhGPEdYS4fiauA9//TxmLEQuFlr9jI9+3kR8iss38xGZGRXQbGhOxiS6ujY1vYxMhic1NSnApbHAqG5yaaNLY5HQ2OQOhZbLRnyOHv+fxWkHHFHF8CeeVMU5F41Uxbg1z1TFnA/M3UdAWCttGgTsodmdF70YAvQihHwYSxzeluBVGleZWmFAmHP4O0zA" + "Ts8tyKyzCUqzw3Gr8iA3Y7Jxt2GmMPdhvzIPGPoxfzHXCnKfMfdYazlvLb9Z0xdquW+MNa71lzXes/S/X8NC1/O2anrm2F679tWsNueZwRm6VQQSm41ZpuFVqbpVSw55cw56UWyURgYm4VXxuFfeyzRWBMblVdG4VlVtF4VaRjyrGIeL6ibj2EdfuRW/L9T/BozqnKkZUNvJ9fGgzI9vMKIhqQ6Mjpk2Ng3g2NoGNTURsSZDMBqe0wals8GdIa5" + "PTI6ONzkxsWWx2VoLK6c98nivktaKOK+Wccs6vZKyqxqxljnrma2TuZtbQSmHbKXBHhe6i6D0Uvw8hfE0UgzCUWEaU41YYV55bYQpmVOBWmIsFWILlWIUfsM4xG7EVO5y7C/uM9ZMxf8YRcxw310lz/mruc9Zw0VouW9M1a/vdGm9a621rvmftD1zDY9fyxDU9d22vXPMb1xrOyq2yiMBM3Cojt0qvYU8rAj/jVqm4VQpulYxbJdGwJxKBCbhVP" + "G4Vh1vF5FbRT9j8XxThsGL8rCgHiGsvce0iru0a+mX/g8diaT1VafFnM9+3mR8isg2Ngqg2NTpi2tg4iGdzE9jcxEhqg5Pb4JTElhppbHQ6G53BRmcits9tdlabnY2r5bDhuZHfx4U9X9wxpR1b3nlfGqO68Wobu745GpuvublbW097Re6k2N0UvhcB9MMAgviGQIZV5FYYW4lbYTKmVeZWmIP5WPQlt8JKH6/Bj9iAzY7dhp3YY4z9OGjMw8b+" + "xRwncNqcZ819wRouWcsVa7pubTes8U9rvWvNf1n7Q9fwt2t55ppeurZ/XGPItYZzcKts3Cqrhv1zEZhJBGbgVum4VRoNe2pulVIEJheBSblVYm6VQMMeT8MeRwTG5FbRuVVUbhWFW0Xepzi7iWsHcW0lrk3E1f9/3O+QiFheo24j38eHNjMyPkFUmxrDpsZCXBsbHwmJLjGS2uTkNjkVPrPRaW10ehudkdgyI4sNz2bDsxNbTpue26bnJbYCKOL" + "vJbxW1jEVnVPFuTWMU9eYDY3d1Hwtzd3WGjpaUxfF7q7ovRX/a0IYhCHEMYJgxmBcFW6FKVXdCWJWNW6FhViC5ViFtVjv9U3Yih3O2Y19xvgJh4x51NjHccpcZ8x5ztwXreGytVyzpj+s7ZY13rHWe9b8wNofu4anruWFa3rl2t64xnBebpWbW+UUgdlFYDZu9Tm3yqxhzygC02vY03Krz7hVKm6VXMOeVAQmFoEJRWB8bhWXW8XiVjEOKsZ+4t" + "qjODsVaRtxbSGujcS1/n/AWAy+TlU5tOIdG/q+zfwQkW1oFES1qTEQy8bGRXybmxBJbHAypLDJqWzyZ0hLcBlsdiabnRlZbXh2Ysth03PZ9DyEls/GF7DxhVDUx6U8X87rlRxbzTm1jFHPWI2M28w8rczZzvxfWUtX6+ppjX0VfwAhDCaKYRhFKGOrcytMrsGtMLMmt8J8LMIyrMQa/IgN2Ixtjt2Fvc49gJ+NdcSYx3DSHKfNddacF8x9yRquW" + "svv1nTTtf9pjXet9b41P7L2J67huWt56Tr/cW1hn0zh/Br2fNwqD7fKxa1ycKtsIjCLCMzMrTJxq/TcKi23+kwEphKBKbhVMm6VhFsl1LDH17DHFYGxRGAMbhWVW0XhVpG3KtYm4lpPXGvDoQirZv+PFYvVQvMj2dD38KENjYwoiGpjYyCWzY2L+DY4IZLY5GRIYaNT2+g0SGezMxBCJnxu07Pa9Ow2PSdy2/i8BJff5he0+YWJ7QsFKI7S/l7e" + "8186prpjazu3vjGaGLOF8duYp4M5O5u/uzX1xtfWOZAIhhDECOIYjXG1uFVtboUZdbgV5mJhXW6F5ViNtVjv+U3Yih3Y7Zx9+MkYh4x1FMeNfcocZ8x13py/4Yo1XLOWP6zplrXdcc1/WetDa35s7U9dwwvX8to1hVxb+AsRWJhbFeRW+blVXg17bm6Vk1tl51ZZudXnGvZMGvYM3Codt0rDrVJzqxTcKpkITCICE4rA+CIwLreKxa1icKuo3Cr" + "KZsXaoGg/Kt4P4XCklcS1dOTbqv6//KgVKhGpVujlezb1A0S2qZ8gqo2NjliIa4PjI6FNTmKDkyEFUhNdGpudDhlteGYbngXZbHoOwsiFPDY/n80vYPMLEdsXClBUAYoRWglFKOPjip6r4vUajqvrnIbOb2q8lsZta46O5upi/p7W0sfa+lvnYEIYhpGEMZZYJtTjVpiGmfW5FeY34FZYhpVYg3XYiC3Y7phd2OucA/jZOEdwzJgnjf0rzpnvIi" + "6Z+6rr/91ablrTbWu7Z40PrPWRNT+x9ueu4ZVreeOawiVEYDFuVUTD/oWGvZAILMCt8nGrPNwql4Y9hwjMJgKzcKvM3CoDt0qnYU+jYU8tAlNwq2QiMAm3Ssit4mvY4+5SlO2KIwKjbiSudYq2VvFWh8PvrgiHIi1+FoqwKPfb6v6/9GgUyhmpXujNezb1A3yEKDY2KqLb3JiIi/g2OCGSKGgypLDRqZHGZqdDRkXPbNOzILuNz4ncNj+Pzc9v8" + "wsSW2EUUYSiilCc2EoqRGmFKEdslXxc1fO1vF7P8Y2c19wYrY3X3tidzNXNvL2soZ/1DLS+IdY6nChGYxyRTGzIrTC9EbfC3MbcCkuwHKubcCus9/EmbMNO7Hbsfhx07mH8YqwTxjyFM+Y4b67fzHnF3Net4Ya13LKmu9b2lzU+tNa/rfmZtb90Da9dS8g1hUtzq5IisLgILMqtinCrQhr2ghr2/CIwjwjMxa1ycqtsGvYsGvbMIjCDCEwnAtNw" + "q1TcKgW3SsatkojAhCIwvgiMIwJjisDo3Coqt4qyRvFWKuIy4lqs31rwJhRhbo63Vf7v/GgS+iRi49BP79rcD2zsR/gYUW1udMREHJscHwltchIks9EpkNpmp0E6ZLTpmW16FmSz8TltfG7kJbgCClAQhRWhqCIUI7YSClFKIcoQWjnFqKAYlf1Z3XO1vdbAcU0c38L5bYzTwbhdzNHDXH3M/bV1DLKmodY30nrHWv94TCaaaU25FWY341ZYhGV" + "Y2ZxbYR02YovntmMX9uKAc37GEWMcM9ZJ/Grsc+a4aK7L5rxm7j+s4aa13Had96ztgTU+ttan1vzc2l+5hjeuJVyeW5UTgWVEYCluVYJbFROBRUVgYW5VkFsV4FZ5uVVuEZhTBGbjVlm4VWZulYFbpdOwp+FWqTTsKbhVMhGYhFsl5FbxuFUcbhWTW0UXgZ+uUrzlirhEk7xQvzWPuOZsE4sfva32f79HxGbhXe/Y1PfxIT7GpzY3GmIijk2Oh4" + "RIYqOTIYXNTo00NjwdMtr0z5HVxmdHTpufG3kVoIACFMIXhFFUIYorREmFKI2yxFZeQSoqSCViq6IoNXxc13MNvd7Usa2c1875Xxmvq7F7mqevOQeY/xtrGW5do63zW+ueSCxTML0Ft2rJrbAQS1pxK6zGWqzHZmzDTuxxzH4cxGHn/mKMEzhtzLPGvmCOS+a6as7r5r5hDX9ay11rum9tj6zxb2t9Zs0vrf0f1xByLeFK3KoityrPrcpq2EuLw" + "JLcqji3KsqtvuBWhTTsBURgXhGYm1vl5FbZuVVWbvW5CMyoYU/HrdJwq9TcKgW3SsatknCrhNwqnoY9jgiMKQKjrVC8pYq4SDHnK+oc4vpevzV98dty/3d6tAnVf6dVKPSezf0QH+MTRLPBMRAb8Wx0AiRGMpudAqlteBqkQ0Yb/zmy2vwcyKUAeZBPEQoqQiF8oRDFFKIESilGGYIrpyAVFKQSsX2pKFUUpRqh1fJnPX9v7LXmjmvt+PbO62Sc" + "7sbsbeyvzTPQ3EOsZYR1jbHO8Zhs7VNbcyvMacOtsKgtt8JKrME6bMQWbMdu7MNPjj2Eo849jlPGOmPMc7hojsvmu4Y/zH3LGu5Yyz1remhtj63xqet5Yc2vrf2NawhX41ZVuFVlblVJBFbgVuW4VRluVUrDXkLDXoxbfSECC3GrAtwqn4Y9j4Y9l4Y9uwjMKgI/51YZuVU6DXsabpVKw55Cw55Mw55YBCYQgfFEYGxuFUMERlusiNwq8jxFnaW" + "Zn6nfmvomFOG78m+r/m/8aB+KHald6Ny77UQgIuMTRLXJMRAbcW10AiRGUpudAqmRxqanQ0ab/jmy2vjsyIU8ip1PAQqiMMEVQXHFKKEYpVBWQcorSEViq6woVVBVYaoTUU3Fqa049f3ZxHMtHNPGsR2d18UYPYzVx/j9zTPYvMOsYZT1fGt9E6z3O0x3Dd+351ZY2IFbYQVWd+RWWI/N2Iad2OO1/TiIw875BSeMcdpYZ3HB2JfMcdVcv5vzpr" + "lvu7a71nLfmh65nifW+Nx1vLTmf6w97BrCNTXs1TXsVblVFW5ViVtV1LCXF4FlRGApblWCWxXjVkW4VWERWFAE5uNWebhVLm6VnVtl1bBnFoEZNOzpRGAaEZhKBKbgVklFYGJulYBbxeVWsblVDG4VlVt9wq0if6+40/VbU0TipF9DEcbEeFv9f7tHxK9CV9/5ilviI0RBVBsdHbEQF/FtdiIkRXIbngppkM7GZ0RmZLX5OZBLAfIgnyIURGGFK" + "ILiilFSMUqjLFGUV5SK+FJhqipMNaKpoTi1FKcOIdVToIZo6u8tvdbOMV85vqtzexqrnzEHGn+IuUaYd4w1jLOmSdY41Zpnuo7ZmN+JW2EZVnYOh3/AOmzEFuzAbuzDT445hKM47txTOGOs88b8zdhXzHHNXDfMecvcd6zhL9fz0Jr+tran1vjCWl9bc8jaw/VEYB1uVYtb1eBW1TTsVUVgZRFYkVuV51ZlNeyluVVJDXtxEViEWxXmVgW5VT5u" + "lYdb5RKB2UVgVhGYmVtlEIHpuFUabpWKWyXnVkm5VSINe3xuFZdbxVqgiHNFIreKMkNxpyryZJE4gbi+Pf62/P9Gj66hSu905ZL4EB/jU0TrIqoRB/GRyKYnQXKksumfIR0y2vjMyILsCpALeRQhHwqisGIUUYziKKkgpVFOUSooSiV8qTBViaS64tRUnNqoq0D1ia2hIjVSpOb+bO259l7r7NjuzultjK+NNci4Q80x0lxjzT3BOr6zrunW+b1" + "1z8UC17Okm94Kq7EW67tzK2zDTuzx3AH8jCOOP4aTzj2Nc8a6aMxLxr5qjt/NddOct819zxoeWMsja3pibc+t8ZW1vrHmcCMR2JBb1edWdTXstUVgTW5VnVtV5VZfcqtKIrCChr0styotAktyq+LcqoiGvbCGvaCGPR+3ysOtcnGr7NwqC7fKzK0ycKt0GvbPuFVKDXtyEZhEw55Iwx5fBMYRgTFnK+ZMRZ2muN8p8kTFHicSR4fCEUb/G/3kde" + "9Qwkg9ww/f7cklERmf9OBWiInYiIeENj4JkiGljf8MaZHB5mdGFmRDTkXIg3wKURCFFaMIiitISZRWlHKooDCVFKYKqilODcWphToKVI/YGihSI0VqTGxNFaoF2vi4o+e7OKaHY/s4d4BxvjHecGOPNt84c0/CFGubgdnWO8/6F2GZa1uJH3pxK2zEVuzAbuzDTzjkmKM47pxTOGOM88b6zfVdMfZ13DDXn+a8a+6/rOGha/jbmp5Z+0trfG2tI" + "WsON+VWjTXsjURgA25Vj1vV4Va1uFUNDXs1EfilCKzErSpwq7LcqrSGvaQILC4Ci3CrwtyqILfKx63ycKucGvZs3CqLhj2zCEyvYU8rAj8TgSlFYDIRmFgEJhSB8URgbBEYQwRGnaK4kxR5vGKPFYmjuNbwP8IR+kd5q4Z/pUf/8LsR+4YWvdOXO+IjROljfsRALMRFgt7WiaRIidQ2Py0yIBOyKEJ25FSE3MiHgopRGEVQXFFKoozClENFhams" + "MFVQjehqoLYi1VWk+orUgGAao4liNVOsFoTUSsHa+fMrf+/mtV6O6+ecgc4dYpwRxh1jjvHmm2z+adbzvbXNwQJrXuI6lmO1a1yLDdiMbdiFvTiAn3EExxx7Er8695wxLuKyMa8Z+w9z3DTXHddxz9wPrOGxtTy1pufW9soa31hvuBW3aiECm4nAJtyqMbdqoGGvr2Gvy61qicAa3Koat6qiYa/MrSqKwHIisAy3KsmtinOrIhr2whr2ghr2fCI" + "wt4Y9pwjMJgKziMBMIjC9CEwrAlOLwBQiMKkITCwCE3CruCIwlgiMIQI/naDI3yr2aEUfIRKHEtfgaWHd0FtV/Cs8+ofyRRrAFfEhPu5vXkRHTMRB/K+5KpIiBVIhTT/XgUz4HNkUIidyI69iFERhFFGU4iipKGVQXmEqorLiVEV1BaqJ2opUlzDqK1RDNFGsporVXLFaEltrBWurYO3R2cfdPd/b6187drDzhhljlPG+NfZE80wx5wzzz7Keed" + "a3CEuteyXWuKZ12Oh6t2IHdmMffsJhr/2CE449jbPOvYBLxrpqzOvGvmGOP81115z3rf2RNfxtLc+s6aW1/WONYZ8U4bbcqjW3asmtmmvYm4rAJiKwIbeqz63qcqva3KqmCKyuYa/CrSpzq4rcqjy3KqNhLykCi4vAIiKwsAgswK3yisDcIjAnt8rGrT4XgZm4VTpulUYEpuJWyblVEm6VSATG51ZxuFVMERh9HNcao9gjFX2Y4n8TDkcaGA5F6" + "J/trSr+2x8RB4d3vTuYKyIyoiAaYiD2IC6KhEiC5EiFzwZaPzIis0JkRQ7kRl4FKYBCKKIoxVESpRWmHCoqTmVUVaDqqKlIdVBPoRooVCM0UaxmhNJCwVopWBu0U7QOitYRXdDD3/t6foDjvnH8cOePMc44Y042/lRzzTTvHOtYYF2LrXU5Vlv/WmxwfZuxDbuwFwfwM47gmGNO4oxzzuGiMS4b65ox/zD2LXPcMddf5nxo7sfW8NRaXljTa2t7" + "Y43hjtyqA7dqx63aiMBWIrAFt2rGrZpo2BtxqwYa9noisDa3qsmtqnOrKtyqsoa9oggsJwJLi8CS3Kq4CCzCrQpxqwLcKi+3ysWtcnCrrNwqM7fKyK3ScavPuFVKbpVMw56EWyXkVvFEYGxuFYNbRR2l2MMVfQjXcqHv9OdafTe+lcV/42NIqFikYaHQe0QbCPdjfIroiDWUeyIBEiMZUiK1daRFBmRGVmLPjlzIgwKKUghfoLj1lkRplFOciqi" + "sQFVRXZFqoo5C1UMDxWqEpgrWXMFaorWitVW09sTWUeE6KVxnYuumeL183M9zA70+1HEjnTfW+ROM9Z1xp5tjlnnnWcdCLLW2lda7Butcx0ZsxQ7Xuhv7cRCHPfcLTuC0Y8/ignMvGeMqfjfmTWPfNsddc9035yNzP7GG59byypr+sbawNYY7a9g7adg7isD23Kott2rNrVqKwOYa9qbcqhG3asCt6nGr2hr2mhr26iKwigisLAIriMBy3Ko0ty" + "rJrYpp2L/gVoW4VQENex4Ney5ulV3DnkXDnplbZdCwp9WwpxaBKbhVMg17Yg17Am4Vl1vFEoHRReCnLvJjFxVE1Xv9NPK9X4Ui9Pxv/7fEiKNCZ/Vu4Q8QGZ8gGneMiTiIj0RIiuRIZS1pkB6ZkAXZiT4n8iA/CirOFyiGEtZdGuVQQYEqoyqqK1RN1HFN9dBAsRqhKeE1d40t0Ubh2ilce4X7Cp0JrQu6KWAPBeyNr/19sKIO8/oox3/rvEnGm" + "WrMmcafY6755l5sLcuxyvrWWvMGbHY927ALe3EAh3AUx3HKMWdw3jm/OfcKrhvrhjFvGfuOOf4y10Nz/m3uZ9bwwlpeW1/I2sI9RGA3EdiFW3XiVl9xq/Ya9nYisA23asmtmnOrptyqkYa9gQisJwJrc6ua3Ko6t6rCrSpzqwoa9nLcqrQILKFhL6Zh/0IEFhSB+TXseURgThGYTcP+uQjMJALTi8A0GvZUIjC5CEzCrRJq2ONr2OModEwXFs2F" + "fGLTI9voD2ymu7dQxG7b38rjv/LxbfiLd8zxXtDD+TMKoiI6YiMeEiCJKE6GlPgM6ZARnxN9NuRAbuSz1oIojKIooTilUBYVFKgSqqC666mJOqinWA0UqxGaormitXStbdBO4TooXCd0du1dFbC7Ava0B70Vsa8iDvDnN54b7rUxjhvvnMnGmGas74091xwLzbnUGlZY0xqss9aN1r8VO7Ab+13nQRz28S84gdM469iLzrmEq8b43Vg3jXnb2Pf" + "M8cA6H5nzibmfW8Mra3ljTeE+IrA3t+rJrbpzq64a9s4i8CsR2IFbteNWbTTsLTXszblVUxHYiFs14Fb1uFVtblWTW1XnVlVEYCUNewURWFYElhKBJURgURFYWAQWFIH5RGBuEZhDBGYTgZlFYEYRmE4EfiYCU2rYk4nAxIqdwEXFdSGxbFR0C49q0R/bzA99NrzXnWt1CYUidP7srUr+Cx873QlOCB1411wfIDI+QTTERBzEJ+5ESIoUSI20yI" + "DM3DQrsiMX8qKANRdGURRHKYUqi/KopEhVUA01XVcd1EMDBWuEporWAq1cbxu0V7yOitcJXRSwmz3ooYi90Ech+9mP/sQ2UDGH+Hik58Y6ZoJjpzh3hjFmG2++sReZZ5l5V1nHWutaj83Wuw27XMteHMAhHMVxnPLaGZx37G+44tzrxrhhrD+NedfY983x0Fx/m/OZuV9awz/WErKm8Nfcqh+36qNh7yUCe3CrbtyqC7fqpGHvIALbicA23KoVt" + "2rBrZpyq0Ya9gYa9noa9toa9poisJoI/JJbVRKB5blVWW5VilsVF4FFuFUhEVhABOblVrlEYHYRmFUEZhKBGURgWhGYWgSmcEFJXUQQQfFtbBwLjmmx0XwmfMJmI8vwD+T3u524VodN/3V3iFNC+SOZ7z18hCiIiuBONDbiISGSIDlSIQ0nTYdMyIJsyIk8yG/dhVAExVCSMMugPCriS8Wqhhqo7frqoYGCNUJTtFC4VmjrutujowJ2RldF7G4f" + "eipib/RVyK/tyQDFHKiY3xDaMH+O8tw4r01y7FTnzHTuHOMsMOYSc63AGnOvs5aN1rcFO6x7N/bjIA7jGE7iV5xzzEVcds415/5hjFu4Y8x7xn5gjsfmemrOF+Z+ZU1vrCU8mFsN1LAPEIH9uFVfbtWbW/XgVt1EYFcR2JlbdeRW7TXsbblVKw17CxHYVAQ2EoENuFU9EVhbBNbgVtW41ZfcqiK3Ks+tynCrktyqGLcqwq0Kcqv83CqPCMzJrbJ" + "xqywiMKMIDIqWxgWksvDkFpzEYhNaaFyfBbHZf/A1pU81sR9rXj90K/6eW/BI7dwhtvz8rVr+8x8Rp4W2v0vMHyAyPkE0xEQcxEciJEUKThq4aVpkQGZkRQ7ktu58KIgvUBQlCLQ0yqEiviTKqqiB2qjrOhugkaI1RXO0Ury2aO/6O6KzAnZFd6LrZT96o69i9lfMgRikmN9gKLENt09jfDzenk12zHTHznLePOMsMuYy468y3w/mXo/N1rTNOn" + "dhLw64jkM4iuM45bmzOI/fHHvVOddxwxh/GuuuMe8b+5E5npjrmTlfmvsfawlZS3got/pGBA7iVgO51dca9r4a9t7cqie36s6tunKrTiKwo4a9vQhsKwJbicDm3Kopt2rErRpwq7rcqpaGvQa3qqphr6xhr6BhL8etSmvYS3CrotzqCw17QW6Vj1vl5lY5RGBWxcts4RksOK3FprZxKSwyqc+ARNwqvgiMIwJjisBo7jY+cSsb+SuiaM+1WnOtF" + "pveyuU/8/F9qHCk790J6us+wsccMypiIDbiISGSIDlSIQ3SI5P1ZkF25EJeFEBhFPUJUhylUBYVUNm1VUV11EJdhauPRmiK5orXEm0UsD06orO96IruCtlLIfugn73pr5gDMZjghtinYYo6QlFH2a+x/pzo71O8NsMxs50z3/mLjbPcmKvN8aP5NlrDFuywtt3Yb90HcRjHcBK/4pzXLuKyY6/hD+feMsYdY/1lzIfG/tuanprrhTlfmztkHeFR" + "3GoEtxrGrYZo2AeLwIHcqj+36set+nCrnhr27iKwqwjsLAI7cqv2IrANt2rJrZpr2Jtyq0bcqr4IrKthryUCq4vAKiKwkoa9gggsq2EvpWEvLgKLaNgLcav8Gva8iprL4rNbcBYbkckC09ugND77UrH25Gw+iT4ioQiMJwKDf1aJIQI/7UQMHbhWG67VUq/V1B1i4/+CO8Q5odHvmP8DREbwD97REBNxEB+JkDS4U8VnSIeMyIxsyIngEyMfxy2" + "EL1AMJVEG5V1bJVRBNdREHcKsj4ZoguYK2BJt0N4+dERnReyK7uilmH3sTT8MUNBB+EZRhyrqcPs1EqMVdizG2btJ/pzque+9PtexC5231BgrjfWDsdebZ5N5t1nLTuy1zgM4hKM4jtM4iwu45Jir+N05N5172xj3jHXfmI+M/cQcz831ypz/mDv8LVGN1bCP5lYjReBwETiUW33DrQZp2Ptr2PuJwD4isCe36s6tunKrztyqI7dqp2FvIwJbat" + "iba9ibiMCGIrC+CKwjAmuKwGoisIoIrCQCy4vAMiKwpAgspmH/QgQWtPB8FpvbInNYXFYLy0z1GVlqWnYafK0ohQhMyq0SicD4IjCOCIwpAqOJwE/aEkWrcPj95uHwO03EYYO+b1Xzn3jMDyWKtCD05D3r+BAf41NCj47YiIfgn5aSIPiibSqkQXoEd7BZEPSGuZAXBVAYRVECpVHO9VXEl6iKGqhNqPXQAE3QDC0Jsw3aoaP96Iyu6K6YvdBHQ" + "fthgH0ahG8UdqjCjrBnozBGcb9V3PHENsEeTsY0f5/l+XmOW+T4Zc5bbYy1xt2ALebaYe7d2G9dB3HEmo/hJH7FOc/9hiuOuYY/nHPLuXfwl7EeGvNvYz8zxwtzvTZnyNzhCSJwvIb9W241mluN4lYjNOxDReA3InAQt+rPrfpxqz7cqie36q5h78qtOonADiKwnQhsw61aiMBmIrAxt2ogAuuJwNoisIYIrCoCK4vACiKwrAgsLQKDzS9qoYUt" + "sICF5bUpuSg+O2vPwkqDrw2lF4FpRGAqDXtybpVEBCYQgXFFYCwRGL0dMbQmihbE0ZRrNeJa9W6EIzSM9lY9/38ei0NV3iHw9/ERoiAqYiIO4iMRkiL4p6bUHDYtMiAzsiEn8iA/CiFw4eKurRTKoAIqoQqqoxbx1kUDNEZTtCDQ1miHDvakE7qiO3opah/0U9QBGGy/hmCYwo4guFEYY//GKfAETLSPkzGF2Gb4c7aiL/D6EsetcM4aY6wz3iZ" + "jbzPfTuy1hgM4ZH1HcQKncRYXcMlrV/G7Y2867zbuGeOBsR4b84mxn5vjlbnemDM8hVtNFoETudV4bjWOW40RgaNE4AhuNYxbDeFWg7nVAA17Pw17HxHYU8PenVt1EYFficAO3Kott2rNrVpwq6YisDG3asCt6nKrWiKwOreqIgIricDyNr+MRZaysGIW9YUFFaL24G4qN7fKIQKzisDMIjCDCEwrAlNr2FOIwKQiMJEIjC8C44jAGCIwakuiaE" + "YcjYmkAdeqw7Vq/KffeyvistCedwn9A0TGp4jOTWMhLhIgMZIjFdIgPTIhC7IjF/KigOsqjKIogdIoh4r4EtV8MtVEHdRHIzRBc4JthbZoj072pgu6o5ei9kE/DFDYwRhi34ZhpOKOxlgFHmcfJ2ASwX2n0FPt6XSFnom5Pl7o+aVeX+X4tc7dYJwtxtxujt3m3I+D1nIEx3ASZ3Aev+EKrjvmBv50zl3n3jfGQ2P9bcxnxn5pjn/MFTJneDq3m" + "sqtvtOwT9KwTxCB47jVWG41mluN1LAP07APEYGDRWB/EdiPW/XhVj25VTdu1YVbfaVhb8+t2nKrVhr25tyqCbdqxK3qc6s63Komt6qmAF9aXEWLCiKitE0o4bOsqM+uwtyqAFHlFYG5RGDwFewsIjCTCExPVGk07ClFYDIRmFgEJhCBcUVgLBEYTQR+0oQ4iOqDupr4Wpr46ivfyuc/8lgaShhpVeif96zrQ3yMqIiB4DtY4yEhkiIFUiMtMojy" + "4J+gsiIH8iA/CiG40y2OUiiLCqjsk6kqaqA26qEhGqMZIbdEG7THV/anM7qhJ3oTZD8MwCDFHYJhGGkPRyvwWIxX5ImYbE+nKPQ0hZ6B7xV7NuZhsb8v99pqx/3onI3O32qcncbdY54D5j6Eo9Z0AqdxFhdwCde89gduOva2c+4594ExHhvrqTFfGPuVOd6YKzyLW33PrWaIwGkicAq3msytJnKr8Rr2sSJwtAgcKQKHcash3GoQt+rPrfpp2Ht" + "zqx7cqpsI7Kxh76hhby8C23Crlhr2Zhr2xhr2htyqroY92NQaFhVEQmWLqEDhZam7FOssLpe/4FaFRGB+EZhbBOYQgVlFYPCPuhmIKviWlNQiMLkITEJUCUVgPBEYWwTGEIHBT8x8XI9IaovDGuKwyutQhNIfvFXR/8NjbajOO9b2Pj7CJ8QfDTERB/GRGMkQfK/YZ0iHTMiC7Aj+SSovCqAwinLlEiiNcqiIL1ENNVEH9e1FIzRFC7RGO3Qk2s" + "7oih7oTZR90R+D7N03GIaRCjwaYxV5PCba08mYqtjTFXsmZin4HPs8l9gWKPoSH6/w3BrHrHfsZudtN9Zu7DP+QfMdtoZjOIkzOI/fcAXXccMxfzr2rnPum/+RMZ4Y65kxXxr7H3OEzRWeq2GfIwK/51YzudV0bjVFwz5ZBE4UgeO51VhuNZpbjeRWw7jVNxr2QSKwv4a9r4a9twjsIQK7isBOIrCDhr2dCGwtAluIwKYa9kbBZlpQHQup6aKrm" + "fxLyq7INsuJwNIisIRmr6g7mcIisIAIzCsCg3/EzSYCg29BySgC04nAz0RgSn1VMhEYfI95fBEYRwTGFIHR6ovDOkRSk1iqisPK4XCE8pXfquj//oi4PrT0XcL/AB/jU0RHLAQ/1JEQSZAcqZAGGZCZA2dFDuRGPhREEQRf/C2FsqiAyqiKGvahNuqhIZqgOVqhLToQdid0QXf0Ql9C7Y+B+MYeDsUIjFbksRiPiYo9GVPt73QFn4nZij7XXs/D" + "AoVfZM+XKv4qH6/12gbHbHHODufvMd4B4x/CUXOewGnrOYuLuIxrnvsDtxxzx/F/4aFz/zbnU2O9MOZrY4fMEV7ErRaIwHncai63mq1hnykCp4vAqdxqMreayK3Gc6uxGvbRGvYRInCoCPxGBA4UgV+LwL4isJcI7C4Cu4jAr0RgBxHYVgS2sqHNLaaJi2ho8nomru0zKLgrqioCK4vACiKwrAgsJQKLicAvRGBBEZhPBOYWgTlEYFZ3gZlFYHo" + "RmEYEpiKq5CIwiQhMIALjElUsERhdBH5aSxxWI5YvxWFFcVj2P/4TPZE46nsIfpw/CqIiBmIjPhIhKYLvx0+NdMiIz5ENwbf95EEBFEZRlEDp4Ot1qIgvUQ01URcN0BjN0AJtfPK1R0d0Rjf0RB8C/hoDMRhD7eUIjMJYjFfwiZis4FMx3T7PxGxFn4v5Cr/Ivi9W/KWKv9z+r/bnj57b5LVtjt3lvH3G+Ml4h81xDCfNfQbn8Ruu4Hfc9Npt3H" + "Psfec8cu4TYzw31itjvjF2eDlRLeVWi7nVQg37fBE4l1vN4lYzudV0bjVVwz5Zwz5RBI7nVmNF4CgROIJbDRWBg0XgQG7Vj1v1EYE9RWA3EdhZBHa0ue0sorXJA6tvZtJGFF2fVdYRgTVFYDUR+KUIDL4SXW6CYnCrEiKwqAgsLALzi8A8/RVPBGYTgZ+LwIxElVYEphaBwU/CJCWq4Of44onA2CIwhgiMWp37VCGWSkRTThyWevFWRv+Xx7ZQy" + "3c46/v4CFEQDTERBwmQGMmQEp8hPTK5vuA7X7MjN/KhIL5A8A/sJVEGFVAZVVEDtVEPDX3SBb1nc7QKPgERfCJ2Qlf04PS90Q8DMAhD7OdwjMIYjCPIiZis4FMxHd/b7zmYp/ALFH4Rltj/ZYq/AqvU4Qes9/Fmr2133G7H73fuz8Y6atwT5jqNs7hoLZdxzcd/4BbuOOYvxz50zt/OfWaMl+Z4bcyQscOrNOwruNUyEbiEWy3kVgu41TxuNVvD" + "PlMETheBU0TgZG41kVuNE4FjuNUobjWcWw3hVoO4VX9u1VcE9uZWPWx8VwvoZOIOFt/WZ04rnzHNWXITdtyQWwVfu6ktAmuIwKoisJIILE9UZURgSREYfGvJFyKwoL4qrwjMJQKzi8As+qpMIjB9e0UWgSlFYDJ9VeJG3EUExhGBMWsQhwiMIgI/Kk80ZcRhSXeHxRu/VdP//oi4Mzz8XbH9AYJ3uPkU0RELcZEQSZAcwY+opUEGZEZW5EAe5Ef" + "wPWZFUBylUc4nWEV8iWqoiTqoj8ZohpYIetH2+ApdOH139EJf9MdAfGNPh2EkxmAcJhDoZEzFdMWfiTn2fR4WYDEBLCWA5VihFquJ4AciWKsmG/y51XM7vbbXcT85/rDzfzHWSWOfwXnzXsJV/I6bnruNe4554NjHznni3OfGeGWsN8YMr+VWP2jYV3OrFdxqObdaqmFfpGFfIALnicDZ3Gomt5rOraZq2CdzqwncapyGfTS3GsmthmnYv9GwD+" + "RWX3OrPhbQ06TdTdbFRF9RcTsW2ZoFtxSBTblVI25VXwTWEYE1RWA1ERj8Y2xFEVhWBJYSgcWJqoi+qpAIzCcC84jAHPqqrJ0UVQRmEIFpiCqVviq5CEwiAhMQVVx9VSwRGJ2oPqlALGWJppQ4LEZYRfq9ldP//oi4J/wweJO3D/ExPkUMxPZJEg+JkBQpkBrpkBGfIxtyIi8KoDCKogTKoDwqoQqqozbqIfiicRM0t1+t0BYd0Ald0QN90A8Df" + "KIOxlCMwGh8iwmEOwlTMB0ziXI25mGBGizGUiJYTgSrsEZNfiCEH7GeGDapzzZ/7vL8PscddPwR5x7HaeOdNcdFXMY13MCfuOu1+455iL+d88zYL43xj7FCxgyv51Y/cqsfuNUaDftKEbhcBC4VgYu41QJuNY9bzeJWM0XgdA37FG41SQSO17B/q2EfLQJHiMChGvbBNmqASftZZGDhPXx2dGWPnVhjBxHYVgS2csfQnKiaiMDgny/qisBaRFXd" + "XWAVd4GVRGB5EVhGBJbQVxUVgYVFYAERmFdflVMEZhOBnxNVBn1VWhGYWgSmEIFJ9FUJ9VXxRGBsfVWMikRSjliI6sPihFVEn1XwzFs5vX0cCBePxGnfw0eIgqiIgTiIj0RIhpT4DOmRCVmQHbmRDwXxBYqhFMrakwqojKqoiTqoj0ZoipZog/b4Cl3QHb18kvZFfwzCEAzHKIwl+vGYiO8wDTPt/WzMxQJiXIylRLAcK7FGXdYSwjpsIIZNarS" + "FILb7c4+/H/D8Icf94ryTxjhjzPP4zXxX8Ttu4rbn7nn9AR479qlzXjj3tTHeGC+8hVtt4lYbNOzrROBabrWGW63kVsu51VJutUjDvkDDPlcEzhKBMzTs00TgdyJwoggcLwLHisBRNnG4CYeYZJAJ+lNvX7bYi912F4FdRGBHEdhOBLYWgS1EYFMR2EgE1heBdYiqpgisKgIri8AKIrCsvqqkCCwmAr8gquAnWvKJwFwiMLu+Kou+KlML7iECPy" + "OqlPqqZPqqREQVX18VR18VQwRGLU0sJYimKPEUDocj5eda+TO8VZXHT6ES77iG9xG8ReUniIZYCN6vKwESIzlSIQ3SIzOCH7jNgdzIj0IoguD7+ksj+I7ZivgS1VELdRH8w3xjNEcrn5TBF5M7oBO6Iriz7o2gZx2AwRiGkRgjGb7FBEzGVMzALDWYi/lYRJhLsRwriWEN1qrPOmwkiM0EsRXb1Wsnwe3150+eP+L144495byzxrlo3Mu4jhv4E" + "3dx32uPHPPEsc+d89K5/xgjbKzwdg37VhG4WQRu5FbruNVabrWGW63UsC8XgUtF4EIROF8EzhGBs7jVDBE4VQROFoETRGBwkaNNMMJCh1LuYKodwA77icDeIjD4GkxXEdhJBHYQgW3dBbYSgc1EYGMRGHyLSF0RWEsEVhOBXxJVRREYfA94KRFYXAQW0VcVEoH5RWBufVUOfVVWEZiZqNLrq9Loq1KJwGT6qsT6qgQiMA5RxdRXRStJLET1EVG9" + "X0CflZewcv7vwop4JLTtXdfyAYI31v0UwVtWxkI8JETw/l3JkRppkcEn1OfIhpzIgwIojKIogTIoj0qoihoIvjetHhqiCVqgNYJ/AuuIzuiOXuiL/hgkEYZgOEZhLMZjEqZguhp8jzmYh0VYQrDLsQpriHEt1qnTRmwmiq3YQRi71G03YezDz/5+1PMnHPOr48879zdjXcXv5rmJOz7+Cw+99rdjnjr2hXNeOzdkjPBuEbhLBO7gVlu51WYN+0Y" + "N+zoN+1oRuEYEruRWy7nVEhG4UATO41ZzROD3InC6CAwuapLBxxt0LMWOotbhbHWICBwkAvuLwL4isJcI7CYCO4vAjiIw+EfV1iKwBVE1cRfY0F1gPRFYWwRWF4FVhiiGCCwvAssQVQl9VVERGPxQZwF9VR4RmFMEZtNXZdZXZdBXpSWq4D2nkuurkojAhPqquPqqWCIwejHC+oJoiOqDvOIwlzjMvuCtrAjreOjwuz5RPsTH+BQxEBvxkAhJkQ" + "KpkQ4Z8TmC96DIhbwogC9QDCVRFhVQGVVRE3VQH8H3qjXj+C3RBu3xFbqiB3qjHwZgMIZiJMZgHIK0+E4NpmEmZmMuFmAx4S/DCqzBWuJch43qtQXbCGMHdhHHHvXbRxwHcMjHxzx3yjFnHX/BuZdx3Zg38Cfu4r7nHnn9CZ479pVz3jg3fEAE7uNWe7jVLm61QwRuE4FbuNVGbrWOW63lVqu51QputYxbLeZWCzTsc7nVLJsyw6BTDTiZWidQ6" + "jg2OEYEjhCBQ0XgYBE4QAT2E4G9RWAPouoy3+aJwPYisI0IbElUwTeyNRKB9UVgHaKqqa+qKgIrE1UFfVVZEVhSBBbTV32hryogAvOKwFz6qmz6qs9FYEZ9VTp9VWoRmIKokuqrgvf5jEdUsfVV0YsQS0GiyUc8uQkrO2Fl+fE/qOpkKG6kk6G/3nNdHyIKgrcFj4E4iI9ESIaU+AzpkQlZkB25kQ/B2wcUQXGUQjlUxJeohlqoiwZojOZohbbo" + "gM7ohp7og68xCEOCO28Ed+BjMR6TMAXT8T3mYD4W+aRfihVYjR+wTr02YjO2EeRO7CaQvdhPJD+p5c8EcgTHfXza8+cc85vjrzr/d9zCHfyFh/jba88c89Kxr50Tcm74Z271E7far2HfKwJ3i8Cd3Gobt9rMrTZyq3Ua9h807Ku51QputVQELuJW8w06x2CB9U6n8imsdJIIHC8Cx4rAUSJwuAj8RgQOFIFfi8A+IrCnvqqrCAy+9aMDUbXVV7U" + "Sgc1EYGOiaqCvqisCaxJVNX3Vl/qqir0Ji6hK6auCHz3/QgQGb5yRT1+VWwRmJ6os+qpM+qp0RPWZviqlviopUSXSV8XXV8UmqhiFiCU/YRHVhzn0WVkJK9ONUIRUH0SIcCqUMpJPmPcQ/GaMKIiGmIiDBAjegDcZUiEN0iMzsiIHgnfQyY9CKIISKI3gB3UrIfgRuOoIfrikHhqiCYLvtG2NduiILuiOXuiL4J/KBmMoRuhrR+NbTAx6XAS97k" + "zMxjwsxBIsxyq1+gE/YgM2E+hW7MBuAtyLA2p5EIeI5AiR/KKuJ/x5xnMXvH7ZsdecewN/4i4e4DGeeu25Y1459o1zwr9wqyMa9kMi8KAIPMCt9nKr3Rr2HRr2rRr2zSJwgwj8UcO+RsO+SgQGi11ioIUGmUehs1nfTBE4TQROFoETROC3InC0CBwhAoeKwMEisD9R9dVX9RKB3UVgF31VRxHYzl1gaxHYXF/VRF/VcLhNF4G19FXV9VVVRGBFf" + "VXwo+alRWAJoiqiryqkr8pPVLn1VTn0VVmJKpO+Kr2+Kg1RpdRXJdNXJSaq+PqqOPqqmEQVNQ/R5CSerESUWQOfXp+V+eMIEX4LpX6HG7+Pj/AJoiEW4iIBkiA5UiF479QMyIxsyIk8KIDCKIoSKIPyqISqqIHaqI9GaIqWaIP2+Apd0AO90Q8D8A2GYSTGYDwmYQqm43sEve98NVqEpViB1ViL9diErYxhB3ZhLw4Q60EcUtejOEYsx4nllBqf" + "9fFFz13x+u+OveX8O/gLD/G355557aVj/nFsyDnh4yLwGLc6wq0OcauD3Gq/CNwrAneJwB0icKsI3CQC14vAtRa92iArTLqUshexzvncao4I/F4ETheBU0TgJKIaLwLHiMCRIjD4x9Fv9FUDRGA/EdhbBPbQV3WZZhNFYHuiaqOvaqGvaioCGxFVfX1VbRFYg6iq6qsq6avKE1UZfVUJfVVRoiqsr8qvr8pDVDn1VVn1VZmJKoNmPXj34VRElVy" + "znlhflYCo4uqrYuqrgt9d80k24vmciDJo4NMSVqpPI0S4GBr/Dlf+AJHxCaIjFuIiIZIgOVIjLTLic2RDLgRvKlcAX6AYSqIMKqAyqqIm6qA+GqMZWqItOqATuqEn+uBrDLL/wT/0D8cojMUETEbw9cQZmIV5WIglWI5V+AHrsJExbMF27MIe7MdBKXQIR9X3GE4QzCmC+VWtz/nzkr9f8/oN/On4e3iAx3jquRd47Zg3jg3/yq1OcasT3OoYtz" + "qiYT/ErQ6KwP0icA+32iUCt4vALS5so5PXOTGw1FUsbzmrXCJLF4rAuSJwlgicIQKn6qsmbyIsEThWBI4SgcP1VUMWi0MR+LUI7KOv6iECu4rATvqqDvqqNiKwJVE101c1FoH1RWAdfVVNfVVVERi8IUYFfVUZfVVJzXoxfVVhfVUBzXrwdorB+3Vm06x/rq/KQFRpNeup9VXJiSqJZj2BviouUcXKRSzZiYaoImckrLSElZqwUo6PEPFKaPy7r" + "vcDRManiI7g9/zEQ0IkRQqkRjpkxOfIjlzIh4L4AsH7gZVC8E47FfElqiF424G6CH6gtzGCH5VrhbboiM7ohl7oi/4YjKEYgeAf/sdhIr7DNMzEHMzHIkawFEFPvBo/YgMCg9iGndiNfVLoJxzCURxT5xM4TYRncI5wLqr7ZR9f9/xNx9zBX859hCc+fo6XXvvHMWHHhs9xqzMa9lMa9hPc6hi3OsKtDnGrn7jVPhG4m1vtMMBWEwQWup7drWV1" + "q0XgChG4VAQGXyOZLwJni8CZInAaUX0nAieKwG+JKvgWjhEicKgIHERU/fVVfUVgT6Lqpq/qrK/qSFRt9VWt9FXNiaoxUQU/Ql5XXxW8AUY1fdWXRFWBqMrqq0oRVTGi+kJfVZCo8mrWc+mrshPV55r1jPqq4A34U2vWU+irkhBVQs16PKKKRVTRsxANUUVOR0SfEVYKfVZSwrpOWD6ZPsDH+BQxEBvxkAhJEfxGjc+QDhmRBdmRG/lQEEVQHKV" + "QDhURvPNOddRCPTREEzRHawQ/OvcVuqA7eqEfBmAwgu99G4kxGIdJmILgn9hmYS4WYDGWYRV+QNAjb8QWbMcudd2LA/gZR3AMJ7Q8p3EW5wn0otpfIpyr/vzD3//0/D3HPcBjPMULz732Wsgx4Usa9osi8LwIPMOtTnGrExr2Y9zqCLf6WcN+wAL2OmEXJW5nj1vY4kYRGNxV/CACV7oLXCYCF4vABSJwDlF9LwKDf/ScQlST9FXjROAYEThSBA" + "7VVwXfNjtABPbTV/XSV3UXgV30VR31Ve30Va2/scn6qiZE1ZCo6uqrahFVdc36l/qqikRVVrNeSl9VnKiKaNYL6qvyEVUuzXp2fVUWosqoWU9HVKmJKoVmPam+KqFmPZ5mPTZRRc9ENOmJh6g+SOnOMClhJSKsbceOvcupP8THiIoYiI34SIRkSInPEPyGjUzIghzIjXwohCII3iKzNMqhEqqgOmqjHhqiKVqgNdrjK3RBD/RGPwzENxiGUQi+F" + "248gu8ymYoZ6jUr+FcRLMQSrMBqrMV6bMI27MAe7MdBHMYvWp7jOIUzOM9ULuIyDVzBNQK64c87nvvL64+c8wTPffzKc2+8Fr4mAq9wq8vc6iK3Oq9hPyMCT2nYj2vYj1roIQcfpMT91LqbvQWN3lYRuEkErheBa/VVq0TgchG4RAQu1FfNE4Gz3AXO0FdN1VdNWuniRWDwXYwj9VXD9FXfENVAfVU/fVVvouqhr+pCVF8RVTt9VWuiaqFZb6qv" + "aqivqqdZr6Wvqk5UVTTrFfVV5YiqtGa9uL6qCFEV0qznI6rcRJVds56FqIJfE5JOs/4ZUaUkqqSa9UREFU+zHpuoYhDVp2mIh6g+TEZYicPHIsY6FiGi638PHyIKoiIG4iA+EiMZUiIN0iMTsiIHciM/CqEoSqA0yqMSqqAGaqMeGqEpWiJ4e4L26ISu6IE++BoDMQTDMQrfYgImYxpmYjbmYxGWYgXW4EdswGZsxy7sZR4HAgNBYCTHcBK/4hw" + "uSqzLuIrr9HCDiG7hro8feP1vPMNL/OO5kNfCf3Cr69zqKre6LAIvisBzIvBXEXjSQMeoMLDGn1nbARG4VwTuEoHbROBmotqgr/pRBK4RgStE4FJ91aKthCUCZ+urgu/7mSoCJxPVBH3VWH3VKKIarq8aQlQDieprfVVvouqhWe+qr+pEVO0168EbW7QgqqZE1UizXo+oamvWaxBVFaKqpFkvp1kvTVQlNOtFiKqQZj14Y/3cRJVDs56VqDIRVX" + "rN+mdElZKokmnWExFVfHeAsYkqBlFFTUVYRPVhYmJKEA5HjBOOEMkn13v4EFEQFcGvF46D+EiMZEiFNEiP4PcDZUUO5EF+FEbwNuQlELzBb3lUQlXUQB0E7yPWCME79LREG3RAJ3RDT/TB1xiEIRiB0fgWwXfyfodp+B5zMB+LsQzBP8X9gHXYiC3YgeCOfx9+wmH8ghM4jbO4ILUu4Qqu4wZu0cZtgvzLn4/8/Qme4xXeeC58m1vd0rDf0LBfF" + "4FXROAlERgMdpb6TlPeCbZ2lKgOach+EoH7ROBuEbhDBG7RV20UgetE4BqiWqmvWiYCFxHVfH3VHBE4k6im6au+01dNIKpv9VWj9VXDNetD9FWDiOprzXoffVXwo+BdNeud9FUdiKqNZr2lZr0pUTXSrAfvVFfbHWANzXpVoqpEVOU166WJqoRmvahmvRBR5des5yGqHO4As2rWMxFVeneAaYgqJVElcweYmKjiuwOMQ1QxiCpqcuJJQkRE9V7c" + "cDhSTMLySfYePkIURENMxEECJEbwizxTIQ3SIzOyIifyID8KoyhKogzKozKqIngrzTqoj8ZohpYI3rGnAzqhG3qiL/pjEIIfuRuBMRiHiZiC4Dt7v8ccLMBiLMcqKfQD1mMTtmIH9mA/DuIIjuEkfsU5/IYruIYbuEUft3GP+dzHYx8/8/xL/OPjsOfCd0XgbW51i1v9IQKvWcAVL1ykxnMs7VcReFIEBncHh0XgQRG4XwTuIaod+qqtInATUQX" + "/ePmDvmoVUS3TVy0mqgVENUdf9b2+ajpRfadZn0hU44hqtGZ9BFEN0awP0qz3J6q+mvWemvVuRNVJs95BXxW8t1NLzXozomqkWa+vWa9DVDU061WJqhJRldeslyGqkkRVVLNemKjyuwPMQ1Q5iSqrO8DMRJXeHWAaokpFVMncASYmqvjuAOMEvyGeqKISVRSi+oio3otFWNEIi4O/h48QBdEQ/Mb9uEiAxEiOVEiLDMiMrMiJPCiAwiiKkiiDCq" + "iMaqiJOmiAxmiGVmiLDuiMbgjeG6Mv+mMwhmIkxmAcgh9umYLpmIW5WIAlWI7VWIv12Ixt2Ingi+AH8DOO4jhO4Qwu4BKu4nf6uInbuIf7eMiInuCFj18j5OPwQ251n1vd41a3udVNT/5OcVdZ2SUReD5o3IjqlL7quAg8IgJ/JqrgK7J7ROBOotqmr9qkr1pPVGv1Vav0Vcs160v0VQv0VXOJapZmfTpRTdGsT9SsBz/PNkazPkKzPpSoBmnW+" + "xNVX6LqqVnvRlSdiaqDZr0tUbXSrDcjqsZEVZ+o6hBVTXeAVYmqMlGVdwdYhqhKElXwu2QKE1UBd4B5iConUWV1B5iZqDK4A0xDVKmIKpk7wMRElYCo4hBVTKKKmpB4iOojonovOmF9Qlg+4d7HR4iCaIiJuEiA4JelJ0cqpEUGZEY25ETw284KoDCKoSTKoAIqoxpqoi4aoDGaoRXaoiM6oxt6oS8GYDCGYiTGYDwmYQpmYBbmYiGWYAVWYy02" + "YDO2YRf24iccwlGcwGmcxQVcxjX8gcCA7uI+HuJvPflTvPTxPwg/Jaq/udVDDft9L9yhtlus7A8ReE0EXhaBF/RVZ0Vg8DWM40QVfAX2kL7qAFHt1Vft0ldtI6rgWyw26KvWEtVqzfpyolpCVAs163OJKvgJkOlENYWoJmnWxxHVGKIaQVRDiWqwZn2AZr0vUfXSrHcjqs5E1ZGo2hJVK3eAzYiqsTvA+u4A6xBVTXeAVYmqMlGVdwdYhqhKVlQ" + "8d4CFiaqAO8Dg9/flJKpsRJWZqDJkJyyiSkVUyYgqMVElSEFYRBWTqKLGIx6i+oio3v+EsCITFjd/Hx/hE0RDTMRFAgS/iT85UiEtgl9LnBnBL/zMibwogMIohuD3CpVFBVRGNdREXTRA8MbAzdEKbdERndEdvdAXAzAYwzASYxD8APEkBD+aNwOzMA8LsQTBdwCvRvC9dRuwGdsRfKPBPgT/hHcIv+AETuMcgq8UXEbQg99AkG738ACP8RQv8B" + "ohhF9o2IMnH1PZAzZ3l6j+1KjdEIFB1x/cVl68anCiOh185VVfdZSoDh2zCH3VXqLapVnfRlSbiWqDZv1HolqtWQ++Z3oJUS3UrM8jqlnuAGcQ1RSimqRZH0dUY9wBjtSsDyWqwUQ1gKj6ElUvd4DdiapzD5tKVG2JqpU7wGZEFbyldAOiqkNUNesRFlFVJqoK7gDLElXwG6+KEVVhoipQRFGJKmc+RSaqzESVIQthEVWqdMRAVImJKkFSwiKqm" + "EQVLTbxENVHnxJTZML6gLB8Ar6Pj/AJoiEm4iIBkiA5UiMtMiAzsiEngl8AWgCFUQwlURYV8CWC3+BRE3XRAE3QHMEbBbdF8BacndEdvdAXAxC8088wjMRYjMckTMUMBD+qNw8LsQQrsBo/YgOC77Xbjl3Yh59wGME/6Z3AaZzDRVzBddxE0JPfQ5B2f+M5XuENPYXf+OClCHwmAv8mqof6qqARC7r8G0R1XV91JfhimL7qHFGdJqoTmvVfiOoQ" + "Uf1EVHuJapdmfTtRBd9luEGz/iNRrSaqFUS1hKgWEtU8oprlDnAGUU0hqklENZ6oxhDVSKIaSlSD3QEOIKq+RNWLqLoTVeeuNpWognf5Dd5CujlRNW5q84mqDlHVrE1YRFWZqCoQVVmiKlla8YiqMFEVIKrgV9jmzK3IRJWZqDIQVRqiSvUZMRBVYqJKQFRxiComUUUjqk+I6qOPiekDwnqXsMJvwu/jI3yCaIiJuEiAJEiO1EiLDMiMbMiJvCi" + "AwiiGkiiLCvgS1VATddEATdAcrdAWHdEZ3dELfTEAgzEMIzEW4zEJUzEDszAPC7EEK7AaP2IDtmA7dmEffsJh/IITOI1zuIgruI6buI17eIi/8RyvEPwXDonA1yLwRZCPIvARt7ovAu+IwFv6qj9EYPCV1Uv6qgsi8Iy+6pS+6rgIPKKv+llftV+zvkdftUNftVUEbtJXrROBwU92rNJXLdOsL9ZXzReBczTr3+urpmnWv9OsTxCB32rWR+urhr" + "sDHKJZD95Z7mt3gH006z1EYFfNeid9VXt3gG30VcEb3zfVrDfUV9VzB1hbs169ajhcxR1gJX1VOX1Vac16cX1VEXeABTXr+URgbs16Dn1VFneAmTTr6dwBfuYOMKW+KmnicDiRZj1enHA4dsxwOHq0cPhTEfjxR+HwB++Hw+9GCoT1irBeEdYrwnpFWK8I6xVhvSKsV4T1irBehVMhLTIgM7IhJ/KiAAqjGEqiLCqgMqqhJuqiARqjOVqhLTqiM" + "7qjF/piAAZjGEZiDMZjEqZiBmZhHhZiCVZgNX7EBmzGduzCPvyEQ/gFJ3Aa53ARl3EdN3Ab9/AAj/EUL8Ivw68RQvgNt3qlYX8edPUa9kca9r807HcI6xZh/R582Z6wgn9sPE9YwbdKnHQXeIywjhDWQcLaT1i73QXucBcY/CTHRsJaR1g/ENZKwlpGWMGPas8nrDmENZOwphHW5HHERVjfEtYowhpOWEMIayBhfU1YvQmrB2F1Iazgje7bE1ab" + "ZsRFWE0JqyFhBb/JqhZhBb+HrwphVSSscoRVirCKE1bwi7YLElY+wspFWNkJKwthZSSsdIT1GWGlIKykhJWQsOIRVuyoxBWFuAgrMmF98C/Cek5YzwnreTgKoiEm4iIBEiM5UiEtMiAzsiEn8qAACqMYSqIMKqAyqqEm6qABGqMZWqEtOqIzuqEX+mIABmMoRmIMxmMSpmAGZmEuFmIJVmA11mIDNmMbdmEvfsIhHMUJnMZZXMBlXAs/C/+BW7i" + "L+3iIv/HUfy/9+Q9YlS6eWwVfe3gmBv8Wgw/F4D0xeNudYPCPi79fEIlnw+HfCOv88XD4V8I6+TNxHZDHhHWQsIKf3NhNWDvWi8S1xEVY65aH/+VHs1cS1tK54fAiwpo/PRyeTVgzCWsaYQXvHDdhhP6AsEYR1vD+4fA3hBW8NXS/bsRFWD0IqwthfUVY7QmrNWG1qK8PIayGhFWPsGoRVvXy+pUyxEVY5QirFGEVJ6wv8hAXYeUjrFyElZ2wsh" + "BWRsJKl0xfRFgpCCspYSUkrHiEFYuwohPWp4QV+V+E9Xf4PXyEKIiGmIiDBEiM5EiFtMiAzMiKnMiDAiiMoiiJMqiAyqiKmqiDBmiMZmiFtuiAzuiGXuiL/hiMoRiJMRiHSZiC6ZiFuViAJViO1ViL9diMbdiJPTiAn3EEx3EKZ3ABl3AVv+MmbuMu7vOsh3iC5/7+Gm98HA4R1WuiesGtnorBx+4EH2ja7wb/uKi/uqG/uq6/Cr6h6yJhndNf/" + "UpYJwjrF/3V4Z36LcLap7/aRVjbCSv4UewNhPXjYuJaoN8irKWEFbzX0jzCCt4pbgZhTSWsyYQ1nrDGDiIuwhpGWN/01G8RVj/C6t1Bv0VYXQgr+E1V7QirNWE1J6wmNYiLsOoSVi3CqkZYXxJWxaL6LcIqRVjFCesLwiqYlbgIKxdhZSeszwkrI2GlJazUhJWCsJIQVkLCikdYsQgr+nv6rX8R1iPCekRYjwjrEWE9IqxHhPWIsB4R1iPCekRY" + "j8JpkB6ZkRU5kQf5URhFURJlUB6VURU1UQf10RjN0BJt0QGd0A090Rf9MQhDMQJjMA4TMQXT8T3mYAEWYzlWkcEPWI9N2Iod2IP9OIgjOIaT+BXn8Buu4Br+EIK3cBv3SCv477GPA/96iX98rLHiWkT1iqiec6u/udUjbnWfW90Rg8E3cP3xazh8zd3gJY37hcPh8FmN+2mN+3HCOqpxP6Rx/4mw9mrcd2nctxNW8AYSGwhrLWGt1riv+F4zT1g" + "LvyMuwppFWDNGa+YJa5LGfTxhjSGs4A3shxHWYMIa0Im4CKsXYXVvqZknrI6NiIuwWhFWc8JqQlgNKhEXYdUkrODX/39JWBUIq2x+4iKsYoT1BWEVIKy86YmLsLIR1ueElYGw0sYnLsJKHoO4CCshYcUlrFiEFe1fhPUXYf0V/hBREBUxEQfxkRjJkAppkB6ZkRU5kAf5URhFUQJlUB6VUBU1UAf10QjN0BJt0AGd0BU90QdfYxCGYARG41tMxH" + "eYhu8xB/OxGMuwEmuwDhuxBTuwG/vwEw7jF5zAaZwlnwu4hCu4zqtu4Fb4DnHd8cwdcrrLte5xraD7usu1xF+IqF4T1QuiCr7l4bGm/QG3uicGb4vBm2Lwd251VQxe0l+d11+d2aeZ301chHVE4x78yPUBwgreMGKnO8JthLXJHeF6d4RrCSt4R7jl7giXENYCd4Rz3RHOIqzp7ginEFbwhvXj3BGO6RMOjyCsoe4IBxNW8Bup+rYhLsLq5o6wM" + "2F1JKy27ghbEVYzwmpMWA0Iq447wpqEVY2wKhciLsIqS1glcxAXYRXORFyElZewcqYkLsLKTFgZCCstYaUirOSElYSwEnxIXIQVi7Ai2qT38CGiICpiIA7iIxGSISXSID0yIStyIDfyoxCKogRKozwqoQpqoDbqoRGaoiXaoD06oSt6oA++xkAMwXCMwreYgMmYhpmYjXlYhKVYgTX4ERuwGduxC3vJ5AB+xhEcw0n8inO4GP5Tr/WnSLxFXLc4" + "103/v/kvEnvg+ceOeYaXPv7HcyGvhd8Q1Suiei4CnxDVI251n1vd5VZ/cqsb3Oq6GLwiBi+KweCHFH8Vg8GPWB/TXx3RuB/UuO/XX+3RuO9YqpknrOAd4NbN1swT1qqpmvnJmnnCCt7iee4od4qENZ2wpgwMhycS1rje7hR7EBdhDf0qHB7UPhzuT1h9WoTDPQmrG2F1qhf+l1+Q3bZ6ONyyCnERVuNy4XB9wqpDWDWLhMNVCasyYZXPHQ6XIay" + "ShFWUsAoTVoHPwuE8hJWTsLImIi7CyhA7HE5DWKkIK/nH4XBiwkpAWHEiElbo5rF3bdSH+BhREQOxER+JkAwp8RnSIROyIAdyIx8KoQhKoDTKoRKqoDpqox4aoilaoDXa4yt0QQ/0Rj8MxDcYhlEYi/GYjKmYobCzMA8LsQTLsRprsR6bsBU7sAf7cRCH8QtfOo5TOIPzpHQRl3VaV3CNvG7487bn/vLRIzzBc7zy3BuvhUPi7x9OFXzX3zOi+l" + "tv9VBv9Zfe6g63usWt/uBW18TgZTF4gVud5VanxeAJMfiL/uqQ/uonMbhPf7Vb475d476FsDbqr9a5I1xDWCs17svG67cIa747wjnDNPPfaOYJ67t+mnnC+pawRnfRzBPWkHbE1dqdImH1IayeDcPhroTVqRZxEVYbwmpZ0Z0iYTUirPrFw+HahFWDsKrkC4crEVb57MSVJRwuQVhF04XDhQgrP2HlSRoO5yCsrPGIi7DSE1aaT8PhlISVjLASv" + "xsOxY94jLCuj3/XJn2Aj/EpYiA24iERkiIFPkM6ZEQWZEdu5ENBFEFxlEI5VMSXqI5aqIuGaILmaI12+Apd0B290A8DMBjDMBJjMA6TMAXTMQtzsQCLsQwr8QPWYSO2YDt2EcpeHMDPOIJjOEFCp3CGV53HRbK6RF5X/fmH///ptbuOe4DHeIoXnnvttZDjwm+I6jVRvSCqp0T1mKgenBCJ3Oq23uomt/qdW13lVpfcDQZvBHFGDJ4Sg8fF4FEx" + "eEgMHhCDe/VXu/RX28TgZv3VBv3VWo37Gv1V8Eb0SzXuiwhrnsZ9tjvCmQM08/qrye4IJ3TXzBPWKHeEwwnrG437wObE1UQzT1jBr/HvSlhfEVb7L4mLsFqUJa5SmnnCqvcFcRV0p0hYVXIRF2GVI6zSGYmLsIqkJq4UxEVYuRMSF2FlIaxM0YmLsD4jrJQfEBdhJYo4nrCuENZVwroajoxPER2xEQ8JkRQpkBrpkBGfIztyIS8K4gsUQymURUV" + "8iWqoibpogMZojlZoi47ojG7ohb7oj8EYihEYjXGYiO8wDTMxB/OxiBCWYgVWYy02YBO2Yid2Yx8x/IRDOIJjZHQCp7TwZ8jqHC7477I/r3v+po/u4C/nPsITHwdfoHjptX8cw4a4lvh7SVTPiOoJUT0iqvsi8C63Cn50+obe6jq3usKtfuNW57jVr9zqJLcK3tntiBj8WQzuF4N79Fc7xeA2MbhJf7Vef7VWDK7SXy3XXy3RuC8Ug/P0V7M07j" + "MIa6r+apLGfbw7wrH6q5Ea9+AXX39DWAPcEfZrQFyE1b2mO8VqxOWOsF0Fd4qE1YKwmhQjLsKqR1i18hIXYX1JWBU/Jy7CKpXWnSJhFSGsgkncKRJWbsLKHou4CCsTYaWLTFyElfKdcCgpYUUIXRz/jk36AJHxCaIjFuIiIZIgOVIjLTLgc2RDLuRFARRGMZREGVRAZVRFTdRBfTRGM7REW3RAJ3RFT/TB1xik2EMwHKMwFhMwGVMxA7MwDwuxB" + "MuxCj9gncJvxBZsxy7swX5iOIhDOMKnjpHTCZzSyv9KXuf8ecn/r3nthmP+dM49PMBjPPXcC6+9dswbx4ZDeqrXRPWCqJ4S1WOiekhU90TgbRF4y53g79zqmt4qeC+kC9zqLLc67W7whBj8RQwe5lY/cat9c0WiGNwhBreKwU36q3Vi8AcxuEp/tUx/tZiwFojBufqr7zXu08XgFP3VRI37OMIao78aqXEf6o5wMGEN0Lj3dUfYi7C6a9w7E1ZH" + "wmrnjrBVSXeKhNXEHWGDAu4UCauWO8Jq2YjLHWHFDJp5wipFWMWSu1MkrIIJNPNx3SkSVnbC+vyTcDgjYaV7350iYaWMEAjrAo2dD7+Pj/AJoiEW4iIBkiA5UiENMiAzsiEn8qAACqMoSqAMyqMSqqIGaqM+GqEpWqIN2uMrdEEP9EY/DMA3GIaRGIPxmIQpmI7vMQfzFXkRlmIFVmMt1mOT4m/FDuzCXuI5gIM4REpH3B8ew3HSOqWlP+vji56" + "/4vXf/e2WMe7gLwRfoPjbc8+89tIx/zg25JzwGz3VK6J6TlRPiOoRUd0nqrsiMHh7mhsi8Dq3usKtfuNW57lV8P6Tp7jVcW51lFsd4lYHxOBeMbhLDG4Xg5vF4EYx+KMYXCMGV+qvlumvFonB+fqrOfqrmYQ1TQx+p7+aqHEPfj3/aP3VCP3VEI37IP1Vf417H3eEPQmrm8a9szvCDoTVVuPeyh1hM8JqrHFv4I6wDmHV1LhXI6zKhFXBHWGZVJ" + "p5wirmjvALwipAWHljauajuVMkrM8/0swTVlrCyhzhY8I6lTKSTXoPHyEKoiEm4iABEiMZUiEN0iMTsiIHciM/CqEISqA0yqESqqA6aqMeGqIJWqA12qEjuqA7eqEv+mMwhmKEIo7Gt5iA7zANMzEb87AQS7BcsVfhB/yIDdhMMluxA7sJYS/286mDOERSR0jrF/+d8OcZ/7/g9cuOvebcG/gTd/EAj/DUa88d88q5b5wTDmnUX+upXhLVM6L6m" + "6geEtVfIvCOCLxFVME7tl1zJxi83+RFvdU5bvUrtzrJrY5p2oM3lP9ZDB4Qg3u41U5utU0MbhaD68Vg8PvuVnOrFWJwiRhcKAbn6a+CX2g9UwwGv45/sv5qgsZ9rBgcpb8arr8aIgYH6q++1l/10bj30F911bh30rh3IKw2GveWGvdmhNVI417fHWEdwqqhca/qjrASYZXXuJdxR1iSsIq6IywcR79FWHncEeaMQlyEldkdYYZI/5uwLsSOFDp5" + "9z0b9SGiICpiIA7iIxGSISU+QzpkQhZkR27kQ0EUQXGUQjlUxJeohpqoiwZojGYK0wpt0QGd0Q090QdfYxC+wXCMwliMxyRMwXQi+B5zMB+LsBQrsFrRf8A6bFT8zdiGnQS0G3vDR4nriJ7riIb+sP8f/heJnfb8Ocf95m9X8buxbuEOgq+APfRc8PX7Z4556djXzgmRZ/iNRv2Vnuo5UT0lqkdE9YCo7onA20R1k6h+F4FXReAlorpAVGe51Wl" + "udYJb/cKtDnGrg9xqP7cKfkPUDjG4VQxuEoPruNUP3GqVGFwuBoNfYL1AfzVXDM4SgzPE4BT91ST91XgxOEYMjtRfDSOsb8TgQP1VP417b8Lqob/qor/6SuPeXn/VWn/VQuPeVH/VUH9VT+Nem7BqaNyruCOsRFjlNe6l3RGWIKwiGvdC7gjzE1ZujXsOd4RZ3wuHMkW8HkoV4T+8g3LE0PHD79qoD23Ux/gUMRAb8ZAISZECqZEOGfE5siMX8q" + "IAvkAxlERZVEBlVEVN1EF9NEIztEQbtMdX6IIe6I1+GIDBGEoIIzEG4zAR32EaZmIW5iryAizGMqzAGkVfi3XYSDhbsI0IdmAXOe3hWftI6wAO+fiY50766Kzjgg7ssjGu44bx/8RdH9/HI689cUzwL5CvnPPGuaxGI69RD97T6Jn4+5uoHhLVfaK6S1R/EtUNERi85fIVEfibO8Hz3OqM3uqU3ir4nSpH9VY/c6sD3Govt9rFrbZzqy3caoO7w" + "XXuBteIwZVicJkYXCwG54vBOWLwezE4XQx+p7+aKAbHicEx+qsR+quhYnCwGBygv+qrv+pFWN31V130Vx0Jq53+qrX+qjlhNdFfNdS419W419JfVddffalxr0hY5TTupTTuxQmriP6qkMY9H2Hl1rhnd0eYJeLbNwXxiBg6svJdG/UBIuNTREcsxENCJEFypEZaZMDnyIacyIMCKIyiKIEyKI9KqIoaqI16aIgmaIHWCtQOHdEZ3dALfdEfgzAE" + "wzEKYzFeQSdhCqbje8zBPEVeiCVYjpUKvgZrCWcdNmIzAWzlVTuwi6x28659+Nnfj3rthGN+dc55z/xmzKv4HTdxG395/iEeO+apY18457VzQ8YIh7jUa6J6oad6Kv6C95F8QFTBu+DeIapbIvCPlSKRqC4vEYki8JwI/JVbnRSBx7jVEW4V/B67/dxqD7faya22ado3i8ENYnAtt1rNrVZwq6XuBheJwflicLYYnCkGp4nB78TgBDH4rf5qtP5" + "qhBgcIgYH6a/666/6iMGeYrCb/qqz/qqjGGyrv2qlv2pOWI31Vw30V3UJq6b+qpr+6kuNewXCKqu/KqVxL0ZYX+ivCmrc8xJWLv1V9giT38rKI/RTiXds1PuIjE8QDTERFwmQGMmQCmmQHpmRFTmQG/lRCEVQHKVtfDlUxJeohlqoiwZojGZohbbogE7oih7ojX4KNwCDMRQjMBrfYgImK+pUzMD3mIv5irwQS7GcZFZijaKvxToetRGbyWkrWW" + "0XjMF/e338k+eO+OiY408596yxLiL4AsU13MCfuOu5+3jkmCeODb5/4qVz/zGG7OJaXOoVUT0jqidE9Yio7hPVXU51m6huiMDrIvAqUf0mAs8T1VkReIpbBb+37hdudYhb/cSt9nGr3dxqB7fayq02cat13OoHbrWKWy0Xg0vE4EIxOFcMzuJWM8TgVDE4SQxOEINj9VejxOBwMThEDA7UX30tBvuIwR76q676q05isL3+qo3+qqX+qhlhNdJf1" + "ddf1SGsmvqrqvqryhr3CvqrMvqrkhr3YoRVWH9VQOOel7ByRvg/vKNfaF+RSKH9ofds1EeIgqiIgTiIj0RIhpT4DOmRCVmQHbmRDwXxBYqhFMqiAiqjKmqiDuqjEZqiBdooUDt8hS7ojl7oi/4YhCEYroijMBbjMRHfYRqxzMRszMUChV6EpYq9HCuJZw3WKvw6ctqATUJxC3ltxx7/P/A2IIMO7KRnfsV5Y/+Gq/gdN3Eb97z2AI8d+9S4L5wb" + "fAfYG2OFQ1u4lru/F0T1lKj+JqqHnOovorpDVLeI6g991TUReFkEXhSB54jq12lc6zuu5U7wiDvBn90JHuBWe7nVLm61nVtt0bRv1LT/qGlfo2lfKQaXcavF3GoBt5rjbvB7MThdDE4Rg5O41Tj91RgxOFIMDhODg8XgADHYTwz2FoPd9VddCOsrMdhef9Vaf9VCf9VUf9VQf1VPf1VbDNbQX1XRX1UirPL6qzL6qxIa96L6q8L6q/yR3oRyR0j" + "3VlX/4RExvOfhezbqQ3yMTxEDsREPiZAUKZAa6ZARnyMbciIvCqAwiqIEyqC8za+EKqiOWqiHhmiC5miFtuiATuiKHorcG/0wAIMxFCMwWjG/xXhMwhSFnY6ZmKXA87AAi4hnKZYr+EoyWo0f+NWPZLWedwX/bfPxLs/vc8xBfztijOM4bdzgCxTBV8Au4xr+wJ+447Xgn7iD758IvkHnmXNfGuMfY4WMGX6znmu5+3uuUX/CqR4R1QOiukdUt4" + "nqJlH9TlRXieqSCLwgAs8S1WkReEIE/iICD3Org9xqP7faw612cqtt3Gozt9rArdZyq9XcagW3WsqtFmna54nBOWJwJreaxq2+41YTxeC3YnC0GBzBrYaKwcFisL8Y7CsGe+mvuonBzmKwoxhsp79qLQabi8Em+quG+qu6YrCWGKyuv6qiv6ooBsvpr0rrr4oTVhH9VcGI/5c3tw0eoZ293rVZHyAyPkV0xEJcJEASJEcqpEEGm5oZWZEDeZAfh" + "VAExVEaZVERX6IaaqIO6qMRmhFAS7RGe3yFLuiOXuiDrxVvIL7BMIzEaIxT0AmYjCkKOx0zMZt45mGBQi/CUsVezqdWYDVJreFba8lrgz+3+PtOr+91XNCBBS3+L8Y7afwzOI/frOEqfvfxTdzGPcc8cOxj5zxx7nNjvDLWG2OGQ1zqNZd66e7vmUb9bz3VQ6L6i6juENWf+qobs0UiUV0hqt/0VedF4BkReEoEHieq4NflH3In+JM7wX3uBHfr" + "rXborbbqrTZyq/V6qx+41SputZxbLRGDC7nVPG41i1vN0LRP5VaTxeB4MfitGBzFrYaLwSFicJAY/FoM9uFWPcVgVzHYSQx2EINtCaulGGwmBhvrrxoQVl0xWFN/VU1/9SVhVRSDZfVXpfRXxcVg0QhfvVXT/+ER2tbsHZv1Pj5CFERDTMRBfCRGMqTEZzY1PTIhC7IjF/KhIL5AMZREGZRHZVRFDdRGPUVpiCZojlZoiw7ohK4K1gO90Q8DMEg" + "Bh2A4RmGMYo7DREwmk6mYjpkKPBvzFHkBAS3EElJaxq9WkNUq8lrzLxIL/GstyazjkeuF8gbd4UZN/CZN/CautZlrbeZaW7jWFq61mWttDt/y2h0E36Dz0DnBtxc+M8ZLY702ZsjY4TdE9YpLvSCqpxr1x3qqB0QV/P6520R1k6j+IKqrRHWZqIJfMH1OBP4qAk+KwGMi8IgI/FkEHhCBe0XgLm61jVtt5lYbuNWP3GoNt1rJrZZxq8XcaoGmfY" + "6m/XsxON3d4BQxOIlbjdO0jykjEsXgMDH4jRgcIAb7uRvsLQZ7iMGuYvArMdheDLYRgy3FYFP9VSP9VX0xWEcM1tBfVdVfVRaD5fVXZfRXJQmrWIQGb9X0f35EslHv4UNEQVTEQGzERyIkRQqkRlpkxOfIhpzIgwIojKIogdI2vxwq4ktUQ03UQX00RjO0UKDWaIeO6Ixu6KlofdAPAzFYAYdiBEYRzFiMx0RFnYypCjsdM0lnFuYq8nxSWojFA" + "nEpaS3332p//ui5TT7a5vhdzt3nmeD+8TCOmeuk+c/gPH5D8C+Qv3v+Bv50zF3cd84j5z4xV/AN0q+MGfx4RzhEVP9wqZeLuRZR/a1Rf0RU98XfXaL6k6huEFXwC6WvENUlojovAs8Q1WkReEIE/iICD3OrgyJwP7faza12uBPcyq02cav13Gott1qtt1rBrZZyq4Xcaj63ms2tZnKradzqO241UQyOE4OjxeAIMTiUWw12NzhADPYVg73EYHcx" + "2JlbfSUG24nB1mKwhf6qqRhsKAbricHa+qsaYrCKGKwkBsvrr8pEevFWRv/3R8TQuu/ftWEf4GN8iuiIhbhIiCRIjlRIg/TIbHOzIgdyIx8KogiKoxTKogIqoypqKEZt1ENDNEFztEJbReqATuiC7uil8H3xNQbiG0UcihEYrZhjMV5BJ2Iy8UzBdMWdiVlENIdXzSOpBXxrEXkt9ecq/1/7NiC3OH6HZ/YY7wAOmeOoV48j+Pr9WVzEZVzz3B+" + "45ZjgO8D+MvcD5z42xlNjvTDma2OHzBMOib7XXOqF6Hvq7i/4LZkPiOovorpDVLeI6g+iukZUl4nqogg8R1S/EtVJEXicqI6KwJ+51QEN+z4RuEvDvv0rjXx7kdjGXSK3+oFbreJWy7nVEm61kFvN5VazuNUMTftUTftkMTiBW33LrUZxq+HcaogYHCQG+4vBPmKwJ7fq5m6wsxjsIAbbisFWYrC5GGwsBhuIwbpisBZhVReDX4rBivqrchFnvp" + "XR/8MjtLbOOzbsfXyET2xcNMREHMRHYiRDSnyGdMiELMiOXMiLAiiMoja+BEqjHCriS1RDTdRBfYVphKZogdZoh46K1Qld0QO9Fa4v+mOQAn6DYRipkKMxlnjGY6KiTsZU4pmuuDMwi5zm8Ky5pLWAfy3x8QrPrfHResdudt52Y+z2bPAFioPmO4xj1nESZ3AevyH4/onrXruBPx171zn3nfvIGE+M9cx8L439jzlYB9fiUi+J6vn3Gnl3f4+I6" + "j5R3SWq20R1k6h+J6qrRHVJX3VBX3WWqE6LwBMi8BeiOiwCD4rA/SJwjwjcKQK3cavN3GoDt/qRW63hViu51TJutZhbzedWc7jV99xqOreawq0mcavx3GqMpn2kpn2YGPyGWw3kVv24Ve+MIlEMdhWDncRgBzHYRgy2FIPNxGBjMVhfDNYRgzXFYDUxWPkdrhXhP/5r5SKEl8WLFFr17D0b9iE+RlTEQGzEQ0IkRQqkRlpksLmZkRU5kAf5UQhF" + "UBylUBYVFKEyqqIGaqMeGqKx4jRDS7RBe3ylWJ3RDT3QW+H6oT8GEcUQDFPIkRitmGMxXkEnYjIJTVHYabxqBkl9T1qzMQ+L/H+511Y77kd/2+j8rcbaadw95jmAQ444iuAfiE7jLC7gkueuIvgOsJu47Zx7zn1gjMfGemreF8YOfkDtjbnCIS71mku9IKqn00Siu7+HRPUXUd0hqltE9QdRXSeqK0T1m77qPFGdIapTIvA4UR0lqkMi8CcRuE8" + "E7uZWO7jVVg37pmYisbFIdCe42p3gCm61lFstdCc4j1vN5lYzudU0bvUdt5rIrcZxq9FicAS3GsqtBnOrAZr2vmKwlxjsLga7cKuO3Kq9GGwtBluIwaZisFFUkSgGa4vBGmKwSqS/w9UjvP9WRf/Pj4ihZXvetWkfIDI+tXHREQtxkQCJkQwpkQbpkQlZkB25kNdmF0BhFEUJlEY5VMSXClENNVEH9dEITRSnOVqhLdor1Ffogm7oSQh90E/x+m" + "MwhijiMIxUyNEENBbjFHQCGU3Cd/xqKllNF4zBf4HEFnp+qWNW+tsPzl1vnM2eDb5AEXwFbL+5D1rPYRzDSQT/xH0ewTfoXPH6ddxw7J+449z7xnhorODnh54Z+6U5XpsrRNbhN1zq1VSuRVRPJnEtd38PiOoeUd0mqptE9TtRXSWqy0R1kajOEdWv+qqT+qpjRHVEBP4sAg8Q1V4N+y4RuF0EbhGBG0XgOhH4A7daxa2WcavF3GoBt5rLrWZxq" + "xncaiq3msytJnCrb7nVKE37cE37EE37IDHYn1v15VY9uVU3btWZW3UUg23FYCsx2JxbNXE32FAM1hODtcRg9Yj/iV/dGzxCi/X3i8XhYnG4WBO/mGstFoeLxeFicbhYE7+Yay3mWou51iKutYhrLeJai7jWIk38Iq61iGst4lqL3CEu5FoLudZCd4gL3SEuDFdCFVRXjFqoiwZojKaK0wKt0Q4dCKYTuqK7ovVEH4XrhwGKNxhDiGcYRijkKIwh" + "oHEKOp6cJvKsyaQ1BTMw23MLvL7EcUEHtsYz64y1yfjbsNOcex1xAIes8SiO4zTO4gIuee0qfnds8A3St3HPGA+M9diYT4z93ByvzBX8/HY4JPr+4VIvudSz8VzrW67l7u++Rv2unupPorpBVNeJ6soArkVU54nqDFGd1ledIKpfiOqwCDxIVPuJao8I3CkCt4nAzSJwA7daW0skVheJ3GqpO8FF7gTnuxOcU0okcqvp3GqKpn2S3mo8txrDrUZ" + "yq2Hc6htuNZBbfc2t+mjae2jauyYSiWKwA7dqw61acqtmYrCxGGwgBjVPoVr/x6+2/8ceofmJIoUWPHnPpn2Ij/GpzYuO2IiHhEiC5EiFNEiPTMiC7DY5F/KiAAqjKEqgNFGUQ0VURlXUQG1FqYcGaIJmCtQSbdBOoTqgM7oqWHf0RB+F64f+5DJIAb/BUCIaoZCjMJqUvuVX48lqAu+ajEBiszw/z0eLHL/MuauMsdZ4G7wSfAVsh/l3Y791Hc" + "RhRx/DSQTfoHPOcxdxxTHX8Idzbjn3jjH+MtZDYwY//fjMGl6Y67U5Q+YOv+FSr7jUCy71lEs9JqoHRHVPo35HT3WLqP7gVNeI6jJRXSSqc0T1q77qpL7qGFEd0Vcd0lcdIKq9InC3CNwuArdyq00icL0I/EHDvkoELheBS0TgQm41j1vN5lYzudU0bvUdt5rIrb7lVqO51QhuNVTTPljTPkDT3k8M9uJW3blVF271Fbdqp2lvo2lvIQabisFGY" + "rBexBvhhhGi/Qfx/Kce4bkD3rFhHyAyPkE0xEQcxEciJLWhKZAaaZERmZEVOZAb+Wx4QXyBYiiJMiivCJVQBdVQE3UUpT4aooniNEdLtFGkduiITgTRFd0VrSf6KFw/9CegQQr4DYYq4nA+NZKcRpPVWN4V/DfJx1M9N9NHcx230HlBi7/SeMEXKNaZa5NXt2Gn9ey1zgM4hKM4jlM4iwu45JjgG6R/xw3n3jbGXWPdN2bwE5BPzBH8/PYrc/5j" + "blXkWlzqJVE9E31PhotEorpPVHeJ6k+iukFUvxPVVaK6RFQXiOosUZ3WV50gql+I6rC+6qAI3E9Ue0TgTqLaJgI3i8ANIvBHbrVGBK7kVsu41WK91QJuNZdbzdJbzeBWU7nVZG41nluN5VajuNVwbjWEWw3iVv25VV9u1ZNbddO0d9a0dxSD7cRgK27VnFs14VYNInR6q5r/jEdodv5IoZmh92zchzbtY0RFDMRGPCREEiRHKqSxsemRCVmQHbm" + "QF/lR2KYXQXGUQllUUIRKqIrqqKUgdVEfjRSmKZqjJdG0QXuF6ojO6Kpg3dGTgPooXD/0V7yBBDRYAYdgGEmNEIqjyGssJvj/lLcBOdvf5jt/sbGWG3u1V34070ZssZbgH4h2Yz8OOuMwjuEkfvXcOVzEZcdec84fuGWMO8b6y5gPrOuxOZ6a64W1vDZ3yBrCIS71mku9EH1PRd/jwSJxoEaeqO4Q1S2i+oOorhHVZaK6SFTnieqMvuqUZv04UR" + "0lqkP6qp9E4D4RuFsE7iCqrSJwE1GtF4FrudVqbrVCBC4tLhKLiEQROEfD/j23mu5OcIo7wYncahy3GqO3GsmthnGrb7jVQE17P27VW9PeQwx25VaduFUHbtWWW7XkVk0jvQo1iZDjrWr+8x4RQ9O2v2vTPkBkfIJoiIk4NjE+EiEpUiA10iIDMiOrTc6B3MiHgvgCRW18CZRGOVRUhMqoihqopdh10QCNFKcpmqOVIrVFe4XqiM4E0hXdFa2no" + "vVGXyL6WvEGktIgfvUNhvKu4L8xJDbe85N9NN2xs5w3zzPBPWTwBYpV5vsB6x2xybq2YZf17sUBBN+gcxTHcQpncd4xv+GKc64794Zx/rTGu8a8b22PzPHEXM+s6aW5/7GGkLWE33Cpl1zqOZd6QlSPvuZafUWiu7/bRHWTqH4nqqtEdYmoLhDVWaI6ra86SVTHiOoIUf0sAg8Q1V591S4RuF0EbhGBG4lqnYb9BxG4SgQuF4FLROBCbjWPW83m" + "VjO41TRu9R23msCtvuVWo7nVCG41lFsN5lYDuFVfbtWLW3XnVl241Vea9vaa9taa9hYRN72Vy3/BI/xd9kg27D18iCiIihiIjXhIiCRIblNTIg3SISOyIJuNzok8yI9CKIJiNr8kyqA8KirEl6iGGgpSG/XQQGEaoanitEAromiL9grVEZ0Uqwu6EVAPReutaH3Rj1f1J6mBfGsweQ3z5yh/H+e1SW87sJnOn2OsBcZdYo4VXg2+xPqj9WzEFuv" + "cgd3O2I+DOIxfEHz/6q9eO4eLjr2Ma879wxg3jXXbmPeM/cAcj8311JwvzP3KGt5YSzjEpV4T1Asu9YxL/U1UD4nqrx5cy93fnxr1G0R1naiuENVvRHWeqM4Q1SmiOk5UvxDVYRF4UF+1n6j2iMCd7gK3icDNInADUf0oAteIwJUicBlRLeZWC/KIRG41i1tN/5xrZdTIc6vx7gTHuhMcxa2Gc6sh3GqQ3qo/t+rDrXpyq27cqjO36vieSIwUDr" + "WN8NlbtfwXPML9I0UMTdjxrk37AJHxic2LhpiIg/hIhKRIgdQ2Ni0yIBOyIjty2ey8KIBCKGrji6MUyqC8IlTCl6imGDVRG/UUpQEaEU5TtFCgVmijSO3QgWS+Uqwu6KZgPYioFyn14Vd9yepr94wDMeRf/GuwmYa4iqG8ZrhAGyEOgy9QjOJao7nWGK41VhM/lmt9G95s3cE/ce/CXhxwfYdw1MfHcQpncN6xvznnCq4b44ax/jTmHWPfN8dDa" + "wze3uSZuV9aw2trCVlT+A2XekVQz0Xfk14ikageENU9orrt7u+mRv13PdU1orpMVBeJ6pw7wF+J6iRRHSOqo0T1swg8QFT7iGq3CNxBVFv1VZtE4DoRuFYErhaBKzTsS0XgIg37PA37HBH4vQicxq2+41YTudU4bjWGW43kVsO41WBuNZBbfc2tenOrHtyqK7fqxK06RFz9Vin/FY/QmFzvhMa+ec+mfYgoiIroiI14NjIBEiMZUuIzpLO5GfE5" + "siEHctvsfCiIwihq40ugFMqigiJUQhVUV/iaqK0o9dBAYRqhqeI0R0sCaoN2CtVBob4in87oqmDdeVVPkurNt/r6b4A/v/HccB+Ncex45wQt/jTjfW/suV5ZaM6l1hB8DX+Ntf1ovRux1Rk7sBv7cRCHEXyD9AmcdsxZXHDOJedexe/GumnM28a+Z60PzPXInE/MHbxB0ytreWNN4RBB/cOlXoq+Z6Lvb9H3qLNIJKq7RPUnUd3QqF/XU10lqku" + "c6gJRnSWq00R1gqh+IarD+qqDRLWfqPaIwJ36qm1EtUUEbhCBP4rAH7jVSqJaJgIXi8AFInCuCJzFrWZwq6ncajK3mpBMJLoTHM2tRnCroe4EB3Or/tyqL7fqxa266606R3odah8h0VuV/Nc9IoZGHnzXhn2AyPgE0RATcRAfCW1mEiRHKqRBepubCZ8jG3Iij83Oj4L4QmGLoQRKo6wiVEBlhaiC6qipILVRT1EaoBHxNFWc5mipQG0IqC3aK1" + "RHIurEq7qQVDe+1YO8er+VWOBfwxwzyjnfOneScaYad4Y5gq+AzTf/Yix31CrrXIv1rmEztmGXa9yLA/gZRz13HKdwxrHn8ZtzrxjjmvH+QPAGAXfM/Je5Hprzbyt5ag0vrOW1NYWsLfyGS73mUi+41FPR91j0PRB999qKRKK6RVR/ENU1orpMVBeJ6hxRnSGqU0R1nKiOatYP6at+Iqp9RLVbBO4gqq1EtUkErieqtfqq1SJwhQhcKgIXicD53" + "GpOeq6lYZ+uYZ8iAieJwPEJRSK3GsWthnOrIdxqILf6mlv14VY9uVXX/xa3+t8e4eEFIoWGukMcxrWGuUMcFv7UBkZHLMRFAiRGUhuaEqmRFhmQ2QZnQXbkQh4FLYBC+MLGF0NJlFaAsqiIygpRBdUJoSZqK0o9NFCYRgrTFM2JqIUCtSaitmivUB3I6Sue1Zm0uvqvl4/7eW6gj4Y6dqTzxnpmgrG+M+50c8zy6jzzL7Sepda30prXYB02Omsr" + "dmA39uMgDuMXnHDMaZzFBedeMsZVY/1uzBvGvm2Ou+a6b85H1vvEGoK3l3tlTf9Ym1zhWlzqJZd6zqWeENUjorov+u624FpEdZOofieqq0R1iaguENVZojpNVCeJ6heiOkJUPxPVAaLaq6/apa/aTlRbROBGfdU6ovpBBK4SgctF4BJutVAEzhOBs0XgTBE4TQR+x60mcqtx3GoMtxrBrYZxq8HcagC36setekd6EeoRIetbdfy3PSKGB+96x6Z" + "9gMiIgmiIYRNjIx4SIgmS29SU+AzpkBGZbXJW5EAum50XBVAIRWx8cZS0+aVRTvErojKqKEZ1xaiJ2gpSDw0IqJHCNEEzxWlBRK0UqA2vakdSHfhWR/Lq4s8e/t/3bUB+42/DnT/aWOOMO8krU80309xzrGOBoxZb63Ksdh1rsR6bXec2BN+/uhcH8DOOeO0Ygh9QO+Occ7hojMvGumbMP4x9yxzB++fcM+cD635sDU+t5YU1vbbWN9YYDnGp1w" + "T1QvQ91U89JqqHRPVXM67VmGsR1Q2iuk5UV4jqN6I6T1RniOoUUR3XrB91B3iIqA4S1T6i2qOv2klU24hqswjcQFQ/isA1InAlUS0TgYtF4AIROFcEzhKBM7jVVG41OZ5I1LB/G4NrReVaUbgWtxr0vkh8JxzqG3HjW1n8KzxC/XNFsmnv4UMb9zE+RXTERBwbGR+JkBTJbWoqpEF6ZLLBnyMbctro3MiLAja8MIqguKKXRBkFKIeKilAZVRSiO" + "moSUG0FqYv6BNNQYRorTFM0J6SW5NSarNryruC/Tj7u7vnePvra8YOdN8wYo4wZfIFiormmeHWGdcyyrnnWuQhLHb0Sa1zXOmx0zVuxA7uxDz95Pvj5oV9wwrGncda5F4xzCVeNed3YN8zxp7numvO+uR9aw9/W8syaXlrvP9YY8ukQfkNQr0Tfc9H3hEs90qTfJ6p7DTXy9blWXa5FVFeJ6hJRXSSqc0T1K1GdJKpjmvUjRPUzUR0gqr36qt2a" + "9R1EtVVftUkErieqtSJwNVGtIKqlInCRCJwvAucQ1fca9ukicIoInCgCx4nAMSJwJLcaxq2+cSc40J1g/wiZ36riX+HxL3eIfSa+Y9Pex0eIYvM+RXTEQlwksJmJkRQpkNrGpkV6ZLLBWZANOW10buRDQeUvjCI2vjhK2vwyKKcAFVCZgKqgmmLUIJRaqKso9RWlAQE1Vpgm5NSMZ7UgrVZoh688181HvRwXdGADnT/EOCOMOcb448052fzTEPw" + "D0RxHLrDmJVjuWla7xrVYj83Yhp3YiwP4GUdwzLEnnfMrzhnjorEuG/Ma/jDHTXPdNuc9cz+whsfW8tSanltb8Pa+b6w1HOJS/3CpF1zqmej7m0s95FJ/cam7RPVnLa5Vg2u5+7uiUf+NqM6Lv7NEdZqoThDVL0R1mKgOEtV+otqjr9pJVNuIaou+aoMIXKev+kFftYqolovAJSJwoQicJwJni8AZInCqCPxOBE4Qgd9yq9EfiURuNZRbDYo4+K" + "0i/hUfod4JI4V63H/Xxn2AyPjE5kVFTMRGPBuZEEmQDCmV9jOkRQYbnBlZkM1G50Qem50PBVHYphdBcZIoidIKUA4VFKESAX2JaopRQzFqEVEd1FOUBqTUiF81JqumvKsFAol19HwXr/dwfB/nDTDON54dbuzR5hvn1YmYYj0zrG+29c5z9CIsc20r8QPWEctGbMEO7Ebw80M/ee0QjuK4c04heIOA88b6zZhXjH3dPDdcU/AOYHfNHbx/4UNrC" + "d599Zm1vbTG19YasubwGy71iks951JPudRjonpQh2txqdtEdZOo/iCqa+7+LhPVRT3VOfF3hqhOEtVxojpKVIeI6iei2qev2k1UO4hqK1FtEoHriWqtvmq1CFxBVEtF4GKimk9Uc0TgLBE4XQROEYGTuNV4EThWwz5Kwz484vVw/whR3qrhX/kR6l4qUqirRr6rSOwqErtyrS76rS7E1UUkdhGJnUViZ+LqLBI7i8ROxNVJv9WJuL4irq+Iq6Nm" + "vqN+qyNxdSCuDsTVnrjaE1c74mpHXG2Jqw1xtSGu1sTVirhahasSUXXFqKkYtflUXXKqj4Z8qxF5NfNna/9v7/VOju3unKDFD+4fBxl3qFdGmm+suSdYy3eOmmad31v7XCxwTUuwnEBWYy3WG2UztmEn9nhuPw7iiGOP4aRzT+OcsS4a85Kxgzdo+t1cN81529z3rOGBtTyypifW9twaX1l78O734RCX+odLvSSoZ1zqb9H3iKjui767VbkWUd0" + "gqutEdZWoLhHVBaI6S1SnieoEUR1zB3iEqH4mqgP6qr2a9V1EtZ2otmjWN4rAdUT1g75qlQhcLgKX6KsWisB5InC2CJwpAqdxq+9E4EQROE7DPibS69CYCLnequDf5hEx1OnUOzbtfXyEKPjUBkZHLMS1kfGRCEmR3KamQhqks7kZkNkGZ0V25CKcPDY7HwqisE0vYtOLoyQBlUZZBShPLBUVobIiVEE1IqpBSrVIqg7fqkteDd9KrKXng4D8yt" + "+6OrenMfoZd6Dxh5hvhHnHOGKcNU2yxqnWPQOznTGfKBZhGVYSyRqsw0ZswXbsxj785JhDOOq84zhljDPGO4/fjH3FHNfM9Yc5g/cvDN4g8y9reWhNf1vbU2t8Ya2vrTlk7eE3BPWaS70QfU+51GMu9VA/9Zfou6OfulWeaxHVNaK6TFS/EdV5ojpDVKc41XGiOkpUh4jqJ6Lap6/aQ1Q7iWobUW0WgRuI6keiWiMCV+qrlhHVYhG4QATOFYGzi" + "GqGCJwqAieLwAki8NsI+9+W/9/wEW4ROWKo/dl3bdoHiIxPbF5UxEBsxLWRCZAYSW1oCqRW2DRIhww2+HNktcnZkctG50E+4imIwja9iE0vhhIEVMrml0V5BahARJUUoYogrEpO1VGTdwX/1SexJp5v4aM2ju3onC6e6WG8Psbt75XB5h1mDaOs6VtHTcB31hx8/8T3mEsQCwljCZYj+AbptViPzdiGndjjtf0Ifn77sHN+ce4JnDbWWWNewCVz" + "BG8v97s5b7q+P63hrrXct6ZH1vbEGp9b60tr/sfaw64h/A+XesmlnnOpJ0T1iEvd51J3ieq2fupmKY18Ca5FVJeI6gJRnSWqX4nqJFEdI6ojRPUzUR0gqr1EtYuothPVVs36JhG4jqjWEtVqEbiCqJYS1SIROF8EzhGB34vA6SJwigicGPF0eNl/4rtD/9UeoVZ1IoVavXrPpn2IyPjE5kVDDMRWwHhIgMQ2NBlSILWNTYN0NjcjPrfBWZEduQg" + "oj83OhwI2vBC+IKJiNr6EjS9FQGVQTgEqKEAlXlWZpKrwrWrkVdOf9fy/kdeaO6a1v7V3bifjdPNsb+N/bZ7gS6xDrGGEo8ZY33jrnWz9U50xE8F3gM3HIgJZhpVYg3XYiOAH1LZjF/bhJ8cewlHnHjPOKZwx5jljXzTHZXNdM+cf5r5lDcHb+95zXQ+s7bE1PrXWF9Yc/P6ON64hHOJSrwnqBZd6yqX+JqqHmvS/uNQdorpFVDeKisQvNPKFuB" + "ZRnSeqM0R1iqhOENUvRHXYHeBBd4D7iWoPUe0kqm1EtVlftYGofiSqNfqqVfqq5US1WAQuJKp5RDVbBM4UgVMjPQ9NjlDubdX/Oz1Czde+Y9Pex4f42OZ9imiIiTg2Mh4S2swkSIYUNjUV0ih2OmS0wZmR1SZnR04bnZt48qKADS9kw79AUSIqbuNL2vjSRFSWlMrzqwpkVUnnVQU1/L+u5xv6qKljWzqvnTGCe8jgCxQ9zdPXqwPM/421DLe2U" + "Y781tqD75/4DtOJYRbmOnshlhDJcqzGWqzHJmzFTuxxzH4cdM5h/GKMEzhtzLPGvmCO38x1xZzXzX3DGv60lrvWdN/aHlpj8OsVnlnzS2v/xzWEXEv4DZd6RVDPudQT0feYqB6IvnvFuRZR3SSq34nqWn6RmFcj7+7vnEb9V6I6SVTHOdURojpEVD8R1T6i2k1UO4hqq2Z9E1GtJ6q1RLVaX7WCqJaKwEX6qvlENVcEfi8Cp0eY9rba/x0f4Rbv" + "RQw12v2OTfsAH9m4j/EpotvAmIiD+DYyIZIQTTKkQCobm8bGpkMGZLbBWYgnG3La6Nw2Oi8KEFFBG16YiIqgmI0vYeNL8aoyJFVW11WevCr7s7r/1/ZaA8cFHVgL57cxVgdjdjZHd3P2NvfX1hL8A9FQ6xxp3WMVfjwmO2sqMczEbMwnjkVYhpVYQzDBD6gFPwG5BduxC3sdewA/I3j/nGPGOolfjX3OHBfNddmc18wdvL3vTau8bU33rO2BNT6" + "21qfW/Nzag98+9Ma1hEME9Q9BvRB9z7jU31zqoej7S/TdFX1/atJvENV1orpCVL8R1QV3f2c16qeJ6oT4+4WoDhPVQaI6QFR7iWoXUW3XrG8hqo1EtY6oftBXrSKq5US1RF+1kKjmEdXsiOvdBb77ttr/nR+hRjkjheo/edemfYCPbFwUREV0xYyJuIhvMxMiiQ1NhhQ2NTXS2Nh0yEAWmW1wFmSzyTkJKBfy2Oz8NrsgERWy4UWIqCiKk1NJsi" + "pNXuX+RWLlnFXByBWtorKSfkkCVYVTNXFYXRwGX16tFe5lDf2sZ6D1DXHkcAUfjeAbdCYSwRRMd/YszMVCAlmC5ViNtViPTdiKnY7ZjeDtTX5y7iEcNdZxY54y/hnznMdv5rxi7uvWcMNagjcov2ttwa9XeGitwS+HeWbtL1zDa9cSck3hN1zqFZd6zqWecqnHXOoBl7pHVHdE303R94fou0ZUl4nqIlGdI6pfieoUUR0nqqNEdYiofiKqfUS1m" + "6h2aNa3uQPcRFQbiOpHfdUazfpKolqmr1qsr1oQ8Ulo7n/hN/D9qz9CdfNECtX6+12b9oFNi4woiEow0RHLJsZFfBuZEElsZjKkIJxUSGNj0yGDzc1MIlmQzSbnsMm5CCgP8tnsAoRU0IZ/QU5FeFYx0irhvzI+rui5Kl6v4bi6zmvomabGaWnctl7paL4u5u5hHX2sLfgXyMHWO1SxRyr6WGeNx2RimIbgG6TnYD4WYRmxrMQa/Ijg57e3YDt2" + "Ya9zDuBnYxxB8PZyJ439qznOmuuClV0yd/D+0b9by01rum1t96zxvrU+suYn1v7cNbxyLf+4pnCIS/3DpV5yqWdc6m+CeqSfus+l7hLVn0R1I4dIFH1XieoSUV0gqrNE9StRnSCqY0R1hKh+JqoDRLWXqHYR1XbN+hai2khU64lqrb5qNVGtIKolke6HlkTI+La6/y8/QtVnRLJp79m0DxHZxkVBVMSwgbEQl3DiI6HNTIJkNjSFDU2FNMSTDul" + "tbiab+zmykkx2m5zTJucmorxElB8FSaoQ3/oCxVHa38t7vrLjqvtbbefWN04Tz7YwRxtzdfBqZ2vobj29re9rax3o6CEKPkLhg+8AG0cEkzDFCNMxizjmYiGCH1BbjlX4AeuxCVuxw7G7sc+5P+GQsY7iuLFPmeOMuYK39/3N3Fes4Zq1/GFNt6wt+P0df1nrQ2t+bO1PXecL1/LaNb1xbeE3XOo1l3pBVE9F32Oieij6/uJSd/RTt4jqD036tU" + "wiMb1IJKrzRHWGqE4R1XGiOkpUh4nqIFHtJ6o9RLVTs75N/G0mqg1E9aO+6of3uFakcGh5hH+Dr67/1z7CESJGCFVe+I5Ne8+mfYjINi4KohJODMSyiXER30YmRBKbmQwpCCiVTf0MaYkjvc3NZHMzIwvpZLPJOWxyLj6Vh5zy6bjyk1bwX1Efl/RcOR9Vcmw159QyRj1jNTJuM+O3Mmc7839lLV0d1dMa+ypw8P0TgxV8GEY5cywRTEDwDdLTM" + "BNzCGQ+FmEZViL4+e0fscHrm7ENu5y3Fwfws7EOG/MXnDDHaXOdNecFc1+yhqvWEvx6hZvW9qc13rXW+67ikbU/ca3PXctL1/SPawv7NAr/Q1CvRN9zLvWESz3iUvdF310udZtL3dSk/05UV9Nyrc+4VkqRSFS/EtVJojpGVEeI6meiOkBU+4hqN6faQVRbiWoTUa0nKrdioTURvntb0f+xHhFD5aa8Y9Pes2kfIrKNi4KoiGEDYyl6HMSzkQmR" + "2GYmJYjkSGlTP7OpaZGOiDLa3Mw293MCyobswjAnSeVGXvIqgCL+X8JrZR1X0fFVnFvDOHU828D4Tc3V0txtHRH8A1FnIuuusL0d/TUGKXbwHWAjFD/4/tVxRpiEKUQxHbMQ/IDaQizBcqzCD1iPTQjeP2eHc4J3/9pnjJ+MdwhHjX3cHCdxxpznzH3RGi5byzV78Ye13bLG29Z6z5ofWPtj1/DUtbxwTcGvF33jGsMhLvWaS73gUs+41N9c6iG" + "X+ouo7hDVn1zqBpe6TlRXiOq35FwrKddKpJF393dCo/4LUR0mqoNEtZ+o9hDVLqLaTlRbiGojUa0P3vT/f9RHuPo7EUOl3KiWIq6SxFWSuEoQVwniKq7nKq6hL0ZcRYmraDgBaSS2mUmR3IamtKGpfZamQTobm4GIMtnczKSUlV9lI6scvCv4L5BYYc8X91Fpx5Z3bmXPVDdW8AWK+uZp7NXm5m5tHe2tqRORdVPYXuiryAOc9Y2iD8MoAhiLCQ" + "QxGcHPD8004hzMxyIsRfAGAWvwIzY4ZjO2Yadz9yB4/8KDOGzsX8xxwlyncdYqL1jDb9ZyxZquW9sNa/zTWu9ac/D70x667uC3Pz5zzS9d2z+uMeTTKfyGS73iUs+51FOCeiz6Huin7hHVbaK6mVokcqlrRHWZqC4S1Tmi+pWoTrr7O65RP6qn+v+1d5/RUpTZGse7G5CcBSQKShIRkSAYBgczRlRUFFFEFBFFJIgwhIsgQxDJIjmIBEFykAySJ" + "MeD5HDIOWeovr/y8mHWXWu+3GuAkWL94Zzuqvfdez9P77fo06dqieVvEVPNZ6q5TDWbqaYz1Y/RdvFw1bmmNwFGg4eHJlGwZEjBPKkULg3SK15GZGaCrIp4C3IoZC7myIO8CnqbguZnooKKWpiBiqAoO92F4vrWPexV2r/3+76c5x623xOOedrxzxvrJWO+ao4q5qtm7hr2eJ+AtQn5MUHrE7aRI/5B6OaM9jnCz6+2Q0ejdEZ3puiJ3gh/A3IQ" + "owzBcIzEaI+Nw0RMwXTHzMIcY8zHImMuxjJzrDTXGnMmmHuDGDaLZZuYdoptlxj3yuKAmA+L/ZgcTsrltJzOye2iHMO7b8cDXeqyLnWBoc7qUqcsfcctfUd1qUPOp/Yz1R5LX2IeXYuptjLVJqb6hanWMdVqplqhUy1lqsVMtZCp5iWLB3OSBMHMaPdr31T/skWDcn2SKFgypFC0VEijcOlZIiMyK2AWBsqG7AqZSyFzs8ytyKegtzNPAUUtxEp" + "3sNSdFsWietfdCC1W1uMP2qe87x5zbAVjPGfMF439inleN++bRKvOZO8R8AN71iFoPcKGH9Bp7Khm+C+ityZ+W3RghE7oih5G7IW+GMAs32IoRmCUx8ZgAibbdypmYLYxfsICY/5s7KVYYa7V5lxr7vD2ChvFskVM28WWKMY9Yg3vn3ZQ7EfkcFwup+R0Vm7n5XhJroGc41cY6pIudV6XOqNLndSljln6DutSB3Wpfc6ndjuf2ul8als2XYupNj" + "LVeqZay1SrmGo5Uy1hqkU61QKdak60+1W5rqPt12XxPua6j7nKMldZ5irDXPfG0yEDA2VSwCzIpojZmSinQuZWyDzskxe36VP5UZClCutd4Z9iLFbCY2V89YB9H3LMo45/0jjPGLeiZyqZq7J5qxIs/AFR+BPI9wn5ob3rErYBGhH5H8RuQfTwA9JtjNIOHZmhM7ozR0/0Rvj724MwBMMwEqMxzn4TMQXTHDsTc4w1DwuNHV4/epm5wqvfrzF3g" + "hg2iGWTmLaKLby91S6x7hXzAfU4JIejcgnvX3tabuHdty/I9bKc415e8cu61AVd6qwudVqXOqFLHdWlDjHVAV1qD1PtYqodzqe2Op/alEHXsvwlMNUaplrJVMuYajFTLbgelr9/t8UjsWhQyrJYirlKxpMjJVukVrh0yKB4mRjoZgXMilsUMQcT5VLIPEyUVzHzsdTt+lYB9irs37v8fY/nStvvft+Vc9zDxnnco08b+3lzhW+xvspkVYj2FvHe" + "sWdNNvyAoHUQfgLsU0c2JnYztCR8ayZoiw4If0GtK3qgF5P0xQB8i6EYgVGeG4PxmOyYHxFeIHM2wsv7zscicywx13JzrjJ/eP+O9QjvPrSFmbaJcadYd4t5n9jD24sekctxOZ2U2xl1OK8Gl+QcyD8e6FKXdKnzutQZXeokUx239B1hqoOWvn1O0ncz1U6m2s5UW5hqY2pdK6WuldySyFQrmGpptMv1a6p/3YLiA2IMlFTBkiOloqVmjLQKlx4" + "ZGSWzAmZRwGzMkx05WSk38uhZefWu8E8hX9/pseK+KmXfso77m0fKGy98g6KCOZ4lzgtEepmJX7NX+BPItwn4LiFrOeIjRvuEuA0I/RnCD0i3MMrnaMMI7dERnRmjO3qiN/pjEIZgGL7HDxhn34mYgmnGmIk5xpxn7IVYbK5l5lxh7tViWCeWX8S0SWxbxbhDrLvEvEfs++VwSC5H5RTefTu8vftZuV6Q82Uvr7gaxC/rUhcZ6pwuddrSd0KXOq" + "pLHbb0HbD07bX07bL07UirazHVZqbawFQJSXWtWDxYeY2+pfB/2iyLkaBo+1hQ5GxSBroJKRQtlaKlRTqvxgyKl4lxblbArAp4i16Vg6VyOuvKzV75/FvQ30U8V8x+4RlYGcc+YJyHPPooMZ5k1mc8W5FI4Q+IKhPsDcJVs/c7hKxJ0PATYB87sj4+JXYTojdDSwZojbZG7IBO6MogPdALfTEA4fVzhiK8+tco+4zBeExy7I+YbqxZmGvs+eZYZ" + "L4lWG7uVWII7z6UIKYNYtssxm1i3clMu8W+Tw4H1OawnI7J7aQcz8j1nJwvyv2KGsQDhrrEUOd1qbO61Cld6rgudUSXOqhL7del9jBVoqVvu6Vvy02WxKTxYH3saLDuWnrz87fcggJlokGBK0kU6yakYKJUipZG0dIxUXpkYqLMyMJO2SyK2dkr568Wy+WIPMp+KxnykeU2UuUnZQG9opAFqbDl8A6n1kWcxBd1En+Xk/hiTuLvdhJf3El8+Omv" + "ErpWCV2rpK5VStcqrWuVjjclfAu0YoQ2aM8UHdEZ3dGTUXqjHwZhiMeG4XuE1y8c65gJmGyMaZhpzNn4yRzh7RV+NudSrBDDarGsE9MvYtskxi3MtF3MiWLfI4f9Xj6H5BTe3v24HE/J9aycL8j9shoEahG/oktd1KXO6VJndKmTutQxXeowUx1wPrWXqXYz1U6m2mbp2xw9Hay/Vn5M83ttwW2lokHeGUkUKxmSK1hKJkqtaGlZKJ3CZWSnTHr" + "WzayV1Z8c/s3jsds9X+jqGVhxx5ZS9LKK/zfP/J0YjxGlgj2eJdALxHrZnq/hDQJWI2QNvE/UDx39MZHr41OCNyF+M7REa6O2RQfG6ISu6IFe6IsBGIzvMAKj7DsG4x07CT9iujHDq9/PxXxzLTJneIOY5VgpljViSsAGZtos1m1i3iH2XXLYK5cDcjost2NyPCnX03I+pwoX1eCKWsQDXeqyLnVBlzqrS51iqBO61FFL3yFL335L3x7nU4lMtS" + "06KdjyZ/9A+Y/aglwpI0HOYbEgx5WkinUTE6VQsFRIw0hp9av0+lZG3IzQYrk9ns/zBe1fhMGKKXZJRS+j+OE7YA959hGiPOGV/jSBnrfnSwR7lXBVCPiWo6oT8z3d7APi1sEnRmlI9M/QlAFaoBUztEF7dERnJumGnuiNfhiIIZ4bhu8RXn11rGMnYLKxphp3Bmab4ycsMOfP5l4qhhViWSWmtWJbL8aNYt0i5u1iT5TDbrnsk9NBGR+R43GGO" + "iXns3I/rwaX1CJQk/gVXeqSLnWeoc7oUid1qWO61BFd6qClb2/sXLA70is++8/66MufuQXZnokGWRKSKFYyxUquT6Vkp9TOuNKwVnr9K7Ovs3ksl6/yMlx+xb3j1/8/ZidnDj0jl8Upt66Vx3KY13KYz3J4m+Xwdl0rv65VQNcq6CS+kJP4wk7iww9Hh5++LxKvS+z6aET4Jmhu1Jb4Am0ZowM6oSt6ILxAUx+El5cbjO8w3L4jMRrjjDEJU4w5" + "DTPNMcdc88y7EOHtrZaJJbw53xqxJYhxg1g3iXmr2HfIYZdc9sppv9wOy/GoXE/I+bTcz6nBBbW4rCZxtYlfZqgLutRZXeq0LnVClzqqSx2Krgv2/dGf/LzWtiBdpmiQflUsSB8kVaybWCoFUrFXWmT0d1YWy6GYtzLe7YpbSJGLerQ4y5VS/LKefVAX+ztRHiXOk/Z8hlAVCVaJcJUdVYWQbxH0HdQk7gdGqYNPCB7+gtpnDNAULZihFdqgPXN" + "0RHj9nG7oid7oh4EIL5A5FOHlfX9w7FhMMNZkTDX2DMw2V3j3ofnm/xlLxLJcTKvEFt5edL1Yw5sjbxH7NjnslMtuOe2T20E5HpHrMTmfVIkzanBejS6qSaA28UCXuqRLndelzuhSJ2OXgmORBfH4H/UZ9ethi6d5MBqk2J2ErZLpXeGf0GIZWOxmRcyumLkVNZ9HCjJY+AZFMc+UUPx7ifCAV3Y5e4U/gXyCQE/Z+zmCvYhXCPg6qjo6/ID0u8" + "SthQ8JXZfo9dEITYzcHC0Z4gu0RQd8ha7ogW/QBwMwGN9huGNGIrxA+ThMxBRjTzPHTMwx5zxzLxTDYkYK7/64AqvFuE6sv4h5k9i3ymGHXBKZaY/c9svxEEMdlfMJuZ9Sg7NqcUFNLqtN4GUYv6JLXdSlzkUTgzO/869oXbdbPJImGiTpFYvHlCyJ8iXTq5Ir7/+cgeVS1LyKm1+RCyv2XYp+D5OVJkL4A6K/MVl5ez5GoAqEepZgLxCukiMrE" + "/ENYlYj7DuoaaTaxA5/Qa0e4RviMyZoihZoZZY2aI+O6Ixu+Bq90Q8D8a19h2IERhljDMYbM7x/x1RzTDfXLMw193wxLBLLEjEtF9sqMa4Va4KYN4h9sxy2yWWnnHbLbZ8cD8j1sJyPyf2kGpxWi3NqclFtrqhRPIjFg0vRVrrU7/TLpP8pW/iOcBApkSyITkkZxC6mjSdV5mTKnpwUKciTioSp9Ynw7dV0TpXTWw4zOInPpGtldhJ/s5P4LLpW" + "Vifx2ZzE3+IkPruulUPXyhl/E9WJ+y6Ra+FDI9ZFfeI3QhNmaI6WaI226MAkX6ErwusXfuOxPuiPQRiC4Y4didHGGoeJxp6Caeaaac45mCeG8O6PP4tpqdhWiHG1WNeJ+Rexb5TDFrlsl1Oi3PbIcb9cD8r5iNyPq8EptTirJueD2PmLanQh+C2vpfAX2VIGkTJpgujMDEEsyKKY2RU1t+LmU+SCil1E0YtZMEsQ4F5i3E+Ucl7pDxPocUI9RbB" + "nCfcCAV/Ga8R8g6jVjFQDNQldG3WIXg8NmaAxmpqlBVohvEBTO4SXl+uMbvgavdAPA/GtY4ZihDFGYYwxx2OSOcLbW0035yxzzxXDfCwS02KxLRNjePftNWJOEPsGOWyWyzY57ZDbLv+V2SvXA3I+LPejanAiiF06HUTHMNRvcymhv/KWNogUzBxEf8xmicyluHkVOXyLtbCiF1X84kxWihBlCfKgV3r4AZ1HCfUkwZ4h3PN4iYivErMKUd9EdQ" + "K/S+xa+IjwddEAjRihCcLr57RkjtZoiw74Cl3QA9+gj336YxCGOHYYvscPxhyLCeaYbK6pmGHu2WIIby+6QFw/Y6kYV4h3NdaKfb0cNspli5y2yy1Rjrvluk/OB+V+mKEOB//PK+nd2P7XZonMEkTuzsFgeSyRtzu/KKTodyr+3V7RJQlRhiAPEKYcgR4m1ONe/U8RLfyA9ItEfJmYr6EqcasRuQZqErw26hC/HhqiMUM0RXiBplZog3boiM7oh" + "q8RXj+6LwY6Jry9wlCMMNYojDb2eEwy1xRzTscsMcwRyzwxLRTbYjEuE+tKMa8Re4IcNshlk5y2ym2HHBPlulfOB724rlbixvZ7bXktkWiaP4jtuUPx7/KKvocQpQlyH2HCT4CVJ9RjBKtAuGcIWJGQlfAqUcNfUHsL1Qn9HsFr4SPUZYIGaIQmTNEcLdEabdEBXyG8vG939LRfH/THIAwxxjCEdx/6wdhjzTEBk8051dwzMFss4c2RF4htkRiX" + "iHW5mFeJfa0c1stlo5w2B9E924PIJzuDv8q75tfQdms8kqFwEClbNIj+cLdzj5IEKUuYBwj0EKEeIdgThHuagM/hRWK+QtTXUJXA1QhdA+8TvjbqoB4jNERjNEULhNcvbIN2+NL3ndANX6MXwtsrDHDsYHyH4cYcidHmGGeuiZhi7mlimCmeOZgntoViXCzWZWJeIfbVQezUOrkkBJE7t8vtapo3tj9zyx9EkpeMRyreG0SH3e9/TOUIVZ5gj6E" + "C8Z4lYkViViJqZVQh8luoTvD3UIv4H6EuGjBEIzRBc7Rkktb4Jzr4Prx+dBd0R0/0cUx/DMQQYw3D98b+AWPNNd68kzFVDNPFMktMc8U3H4vEujiI9l0p9nU33ti89rcHg8jb5YNIs0eC6PonnPg+TcTnCfoiXiHu66hK6LdRg+jvozYTfIx6aMgUjRFev7AFPkcbtMOX6ISu+Nq+vdAXA4wxGN8ZczhGmmM0xplzovmnYGoQuzJDTHODSN15wb" + "+5h/KN7frYnrC0PPsr0SEvBNEJlZy/VGa2KoR+C9XxHvFr4SNGqIsGaIQmDNIMLdEa/0R7fOW5LuiOnujt2H4YaKxvMRQjzDEqiCaONee4INJjihgmBpE7roZ1Y/tP2560bL4RRFJXCSLpqgaRLtWCaJcaqBlEV9aOR3WtmK4V07ViulZM14rpWjFdKxb/Au3wJTqhK3o4pqdjexujPwYZc7DxQ7qY6+q0f6EtEvlvLj6dTNsMZuwAAAAASUVOR" + "K5CYII=";
    return Result;
  };
  this.GetColorWheelResource125 = function () {
    var Result = "";
    Result = "TTMSFNCCOLORWHEELPICTURE125";
    return Result;
  };
  this.GetColorWheelResource150 = function () {
    var Result = "";
    Result = "TTMSFNCCOLORWHEELPICTURE150";
    return Result;
  };
  this.GetColorWheelResource175 = function () {
    var Result = "";
    Result = "TTMSFNCCOLORWHEELPICTURE175";
    return Result;
  };
  this.GetColorWheelResource200 = function () {
    var Result = "";
    Result = "TTMSFNCCOLORWHEELPICTURE200";
    return Result;
  };
});
rtl.module("WEBLib.TMSFNCColorWheel",["System","WEBLib.ExtCtrls","WEBLib.Controls","Web","Classes","Types","WEBLib.Graphics","WEBLib.TMSFNCCustomControl","WEBLib.TMSFNCImage","WEBLib.TMSFNCGraphics","WEBLib.TMSFNCGraphicsTypes","WEBLib.TMSFNCTypes","WEBLib.TMSFNCEdit","WEBLib.TMSFNCStyles","WEBLib.TMSFNCUtils"],function () {
  "use strict";
  var $mod = this;
  this.MAJ_VER = 1;
  this.MIN_VER = 0;
  this.REL_VER = 1;
  this.BLD_VER = 0;
  rtl.createClass(this,"TTMSFNCRGBTrackBar",pas["WEBLib.ExtCtrls"].TWebTrackBar,function () {
    this.SetValue = function (Value) {
      this.SetPosition(Math.round(Value));
    };
    this.GetV = function () {
      var Result = 0.0;
      Result = this.GetPosition();
      return Result;
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.Controls"].TControl.Create$1.apply(this,arguments);
      this.SetMax(255);
      this.SetWidth(100);
      return this;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCImageColor",pas["WEBLib.TMSFNCImage"].TTMSFNCImage,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCImage"].TTMSFNCImage.$init.call(this);
      this.FDPIChanged = false;
      this.FMouseDown = false;
      this.FImageLoaded = false;
      this.FPixelColor = 0;
      this.FOnColorChanged = null;
      this.FX = 0.0;
      this.FY = 0.0;
      this.FImgDt = null;
      this.FOffS = 0;
      this.Fsc = 0.0;
    };
    this.$final = function () {
      this.FOnColorChanged = undefined;
      this.FImgDt = undefined;
      pas["WEBLib.TMSFNCImage"].TTMSFNCImage.$final.call(this);
    };
    this.SetPixelColor = function (Value) {
      if (this.FPixelColor !== Value) this.FPixelColor = Value;
    };
    this.SetX = function (Value) {
      if (this.FX !== Value) this.FX = Value;
    };
    this.SetY = function (Value) {
      if (this.FY !== Value) this.FY = Value;
    };
    this.SetCoordinates = function (AX, AY) {
      var a = 0.0;
      var b = 0.0;
      var angle = 0.0;
      var r = 0.0;
      var cp = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      cp.$assign(this.GetCenterPoint());
      r = this.GetRadius() - (1 * this.Fsc);
      a = Math.abs(cp.X - AY);
      b = Math.abs(cp.Y - AX);
      if (a === 0) a = 1;
      if (b === 0) b = 1;
      angle = (Math.atan(a / b) * 180) / Math.PI;
      if ((AX >= cp.X) && (AY <= cp.Y)) {
        angle = 360 - angle}
       else if ((AX <= cp.X) && (AY >= cp.Y)) {
        angle = 180 - angle}
       else if ((AX <= cp.X) && (AY <= cp.Y)) angle = 180 + angle;
      angle = pas.Math.DegToRad(angle);
      this.FX = (cp.X - 0.5) + (r * Math.cos(angle));
      this.FY = (cp.Y - 0.5) + (r * Math.sin(angle));
    };
    this.PtInColorWheel = function (X, Y) {
      var Result = false;
      Result = (pas.System.Sqr$1(X - (75 * this.GetDPIScale())) + pas.System.Sqr$1(Y - (75 * this.GetDPIScale()))) <= pas.System.Sqr$1(74 * this.GetDPIScale());
      return Result;
    };
    this.DoAfterDraw = function (AGraphics, ARect) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.DoAfterDraw.apply(this,arguments);
      if (this.FDPIChanged) {
        this.FDPIChanged = false;
        this.MapPixels();
      };
    };
    this.ChangeDPIScale = function (M, D) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ChangeDPIScale.apply(this,arguments);
      this.FDPIChanged = true;
    };
    this.ColorChanged = function () {
      if (this.FOnColorChanged != null) this.FOnColorChanged(this);
    };
    this.BitmapLoaded = function (Sender) {
      this.FImageLoaded = true;
    };
    this.HandleMouseDown = function (Button, Shift, X, Y) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseDown.apply(this,arguments);
      this.CaptureEx();
      this.FMouseDown = true;
      if (this.PtInColorWheel(X,Y)) {
        this.SetPixelColor(this.XYToColor(X,Y));
        this.ColorChanged();
        this.Invalidate();
      };
    };
    this.HandleMouseMove = function (Shift, X, Y) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseMove.apply(this,arguments);
      if (this.FMouseDown) {
        if (this.PtInColorWheel(X,Y)) {
          this.SetPixelColor(this.XYToColor(X,Y));
        } else {
          this.SetCoordinates(X,Y);
          this.SetPixelColor(this.XYToColor(this.FX,this.FY));
        };
        this.ColorChanged();
        this.Invalidate();
      };
    };
    this.HandleMouseUp = function (Button, Shift, X, Y) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseUp.apply(this,arguments);
      this.FMouseDown = false;
      this.ReleaseCaptureEx();
    };
    this.GetDPIScale = function () {
      var Result = 0.0;
      Result = this.FPaintScaleFactor;
      return Result;
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCImage"].TTMSFNCCustomImage.Create$1.apply(this,arguments);
      this.SetWidth(150);
      this.SetHeight(150);
      this.SetX((this.GetWidth() / 2) * this.GetDPIScale());
      this.SetY((this.GetHeight() / 2) * this.GetDPIScale());
      this.FImageLoaded = false;
      this.FDPIChanged = false;
      this.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
      this.FOnBitmapChanged = rtl.createCallback(this,"BitmapLoaded");
      return this;
    };
    this.Destroy = function () {
      this.UnmapPixels();
      pas["WEBLib.TMSFNCImage"].TTMSFNCCustomImage.Destroy.call(this);
    };
    this.Draw = function (AGraphics, ARect) {
      pas["WEBLib.TMSFNCImage"].TTMSFNCCustomImage.Draw.apply(this,arguments);
      if (this.FImageLoaded) {
        this.FImageLoaded = false;
        this.MapPixels();
      };
      AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      AGraphics.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
      AGraphics.FStroke.SetColor(0);
      AGraphics.DrawEllipse(this.FX - this.ScalePaintValue(5),this.FY - this.ScalePaintValue(5),this.FX + this.ScalePaintValue(5),this.FY + this.ScalePaintValue(5),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
      AGraphics.FStroke.SetColor(16777215);
      AGraphics.DrawEllipse(this.FX - this.ScalePaintValue(4),this.FY - this.ScalePaintValue(4),this.FX + this.ScalePaintValue(4),this.FY + this.ScalePaintValue(4),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
    };
    this.MapPixels = function () {
      if (this.GetWidth() !== 0) {
        this.Fsc = Math.round((this.GetCanvas().FElementCanvas.width / this.GetWidth()) * 100) / 100}
       else this.Fsc = 1.0;
      this.FImgDt = this.GetCanvas().FContext.getImageData(0,0,Math.round(this.GetWidth() * this.Fsc),Math.round(this.GetHeight() * this.Fsc));
    };
    this.UnmapPixels = function () {
    };
    this.XYToColor = function (X, Y) {
      var Result = 0;
      this.FOffS = (Math.round(X * this.Fsc) + (Math.round(Y * this.Fsc) * Math.round(this.GetWidth() * this.Fsc))) * 4;
      Result = pas["WEBLib.Graphics"].RGB(this.FImgDt.data[this.FOffS + 0],this.FImgDt.data[this.FOffS + 1],this.FImgDt.data[this.FOffS + 2]);
      return Result;
    };
    this.GetCenterPoint = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      Result.$assign(pas["WEBLib.TMSFNCTypes"].PointF(this.GetWidth() / 2,this.GetHeight() / 2));
      return Result;
    };
    this.GetRadius = function () {
      var Result = 0.0;
      Result = this.GetWidth() / 2;
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.recNewT(this,"TTMSFNCColorWheelHSColor",function () {
    this.Hue = 0.0;
    this.Saturation = 0.0;
    this.$eq = function (b) {
      return (this.Hue === b.Hue) && (this.Saturation === b.Saturation);
    };
    this.$assign = function (s) {
      this.Hue = s.Hue;
      this.Saturation = s.Saturation;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCColorWheelHSColor",{},this);
    $r.addField("Hue",rtl.double);
    $r.addField("Saturation",rtl.double);
  });
  this.$rtti.$MethodVar("TTMSFNCCustomColorWheelBeforeDrawSelectedColorPanelEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARectF",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["ASelectedColor",pas["WEBLib.Graphics"].$rtti["TColor"]],["AAllow",rtl.boolean,1],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCustomColorWheelAfterDrawSelectedColorPanelEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARectF",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["ASelectedColor",pas["WEBLib.Graphics"].$rtti["TColor"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCustomColorWheelSelectedColorChangedEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ASelectedColor",pas["WEBLib.Graphics"].$rtti["TColor"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCustomColorWheelRValueChangedEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AR",rtl.longint],["ASelectedColor",pas["WEBLib.Graphics"].$rtti["TColor"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCustomColorWheelGValueChangedEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AG",rtl.longint],["ASelectedColor",pas["WEBLib.Graphics"].$rtti["TColor"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCustomColorWheelBValueChangedEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AB",rtl.longint],["ASelectedColor",pas["WEBLib.Graphics"].$rtti["TColor"]]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCCustomColorWheel",pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$init.call(this);
      this.FImage = null;
      this.FREdit = null;
      this.FGEdit = null;
      this.FBEdit = null;
      this.FHEXEdit = null;
      this.FRTrackBar = null;
      this.FGTrackBar = null;
      this.FBTrackBar = null;
      this.FSelectedColor = 0;
      this.FGValue = 0;
      this.FRValue = 0;
      this.FBValue = 0;
      this.FHSColor = $mod.TTMSFNCColorWheelHSColor.$new();
      this.FOnBValueChanged = null;
      this.FOnGValueChanged = null;
      this.FOnAfterDrawSelectedColorPanel = null;
      this.FOnSelectedColorChanged = null;
      this.FOnRValueChanged = null;
      this.FOnBeforeDrawSelectedColorPanel = null;
      this.FFont$1 = null;
    };
    this.$final = function () {
      this.FImage = undefined;
      this.FREdit = undefined;
      this.FGEdit = undefined;
      this.FBEdit = undefined;
      this.FHEXEdit = undefined;
      this.FRTrackBar = undefined;
      this.FGTrackBar = undefined;
      this.FBTrackBar = undefined;
      this.FHSColor = undefined;
      this.FOnBValueChanged = undefined;
      this.FOnGValueChanged = undefined;
      this.FOnAfterDrawSelectedColorPanel = undefined;
      this.FOnSelectedColorChanged = undefined;
      this.FOnRValueChanged = undefined;
      this.FOnBeforeDrawSelectedColorPanel = undefined;
      this.FFont$1 = undefined;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$final.call(this);
    };
    this.SetSelectedColor = function (Value) {
      if (this.FSelectedColor !== Value) {
        this.FSelectedColor = Value;
        this.FRValue = this.ColorToRValue(this.FSelectedColor);
        this.FREdit.SetT(pas.SysUtils.IntToStr(this.FRValue));
        this.FGValue = this.ColorToGValue(this.FSelectedColor);
        this.FGEdit.SetT(pas.SysUtils.IntToStr(this.FGValue));
        this.FBValue = this.ColorToBValue(this.FSelectedColor);
        this.FBEdit.SetT(pas.SysUtils.IntToStr(this.FBValue));
        this.FHEXEdit.SetT(pas.SysUtils.IntToHex(this.FRValue,2) + pas.SysUtils.IntToHex(this.FGValue,2) + pas.SysUtils.IntToHex(this.FBValue,2));
        this.FRTrackBar.FOnChange = null;
        if (this.FRTrackBar.GetV() !== this.FRValue) {
          this.FRTrackBar.SetValue(this.FRValue);
          this.DoRValueChanged(this.FRValue,this.FSelectedColor);
        };
        this.FRTrackBar.FOnChange = rtl.createCallback(this,"RTrackBarChanged");
        this.FGTrackBar.FOnChange = null;
        if (this.FGTrackBar.GetV() !== this.FGValue) {
          this.FGTrackBar.SetValue(this.FGValue);
          this.DoGValueChanged(this.FGValue,this.FSelectedColor);
        };
        this.FGTrackBar.FOnChange = rtl.createCallback(this,"GTrackBarChanged");
        this.FBTrackBar.FOnChange = null;
        if (this.FBTrackBar.GetV() !== this.FBValue) {
          this.FBTrackBar.SetValue(this.FBValue);
          this.DoBValueChanged(this.FBValue,this.FSelectedColor);
        };
        this.FBTrackBar.FOnChange = rtl.createCallback(this,"BTrackBarChanged");
        this.FHSColor.$assign(this.RGBToHS(this.FRValue,this.FGValue,this.FBValue));
        this.SetIndicator();
        this.DoSelectedColorChanged(this.FSelectedColor);
        this.Invalidate();
      };
    };
    this.SetBValue = function (Value) {
      if (this.FBValue !== Value) {
        this.FBValue = Value;
        this.FBEdit.SetT(pas.SysUtils.IntToStr(Value));
        this.FHEXEdit.SetT(pas.SysUtils.IntToHex(this.FRValue,2) + pas.SysUtils.IntToHex(this.FGValue,2) + pas.SysUtils.IntToHex(this.FBValue,2));
        this.FBTrackBar.SetValue(this.FBValue);
        this.FSelectedColor = this.RGBToGraphicsColor(this.FRValue,this.FGValue,this.FBValue);
        this.FHSColor.$assign(this.RGBToHS(this.FRValue,this.FGValue,this.FBValue));
        this.SetIndicator();
        this.DoBValueChanged(this.FBValue,this.FSelectedColor);
        this.DoSelectedColorChanged(this.FSelectedColor);
        this.Invalidate();
      };
    };
    this.SetGValue = function (Value) {
      if (this.FGValue !== Value) {
        this.FGValue = Value;
        this.FGEdit.SetT(pas.SysUtils.IntToStr(Value));
        this.FHEXEdit.SetT(pas.SysUtils.IntToHex(this.FRValue,2) + pas.SysUtils.IntToHex(this.FGValue,2) + pas.SysUtils.IntToHex(this.FBValue,2));
        this.FGTrackBar.SetValue(this.FGValue);
        this.FSelectedColor = this.RGBToGraphicsColor(this.FRValue,this.FGValue,this.FBValue);
        this.FHSColor.$assign(this.RGBToHS(this.FRValue,this.FGValue,this.FBValue));
        this.SetIndicator();
        this.DoGValueChanged(this.FGValue,this.FSelectedColor);
        this.DoSelectedColorChanged(this.FSelectedColor);
        this.Invalidate();
      };
    };
    this.SetRValue = function (Value) {
      if (this.FRValue !== Value) {
        this.FRValue = Value;
        this.FREdit.SetT(pas.SysUtils.IntToStr(Value));
        this.FHEXEdit.SetT(pas.SysUtils.IntToHex(this.FRValue,2) + pas.SysUtils.IntToHex(this.FGValue,2) + pas.SysUtils.IntToHex(this.FBValue,2));
        this.FRTrackBar.SetValue(this.FRValue);
        this.FSelectedColor = this.RGBToGraphicsColor(this.FRValue,this.FGValue,this.FBValue);
        this.FHSColor.$assign(this.RGBToHS(this.FRValue,this.FGValue,this.FBValue));
        this.SetIndicator();
        this.DoRValueChanged(this.FRValue,this.FSelectedColor);
        this.DoSelectedColorChanged(this.FSelectedColor);
        this.Invalidate();
      };
    };
    this.SetHEXValue = function (Value) {
      var str = "";
      var r = 0;
      var g = 0;
      var b = 0;
      if (Value.length === 6) {
        str = pas.System.Copy(Value,1,2);
        r = pas.SysUtils.StrToInt("$" + str);
        str = pas.System.Copy(Value,3,2);
        g = pas.SysUtils.StrToInt("$" + str);
        str = pas.System.Copy(Value,5,2);
        b = pas.SysUtils.StrToInt("$" + str);
        this.SetSelectedColor(this.RGBToGraphicsColor(r,g,b));
        this.FHSColor.$assign(this.RGBToHS(r,g,b));
        this.SetIndicator();
      };
    };
    this.GetHEXValue = function () {
      var Result = "";
      Result = this.FHEXEdit.GetT();
      return Result;
    };
    this.IsHEXValueStored = function () {
      var Result = false;
      Result = this.GetHEXValue() !== "FFFFFF";
      return Result;
    };
    this.SetFnt = function (Value) {
      this.FFont$1.AssignSource(Value);
    };
    this.Loaded = function () {
      pas["WEBLib.Controls"].TCustomControl.Loaded.call(this);
    };
    this.ChangeDPIScale = function (M, D) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ChangeDPIScale.apply(this,arguments);
      this.FFont$1.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FFont$1.FHeight,M,D));
      this.SetIndicator();
    };
    this.Draw = function (AGraphics, ARect) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Draw.apply(this,arguments);
      this.DrawColorPanel(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect));
      this.DrawText(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect));
    };
    this.DrawColorPanel = function (AGraphics, ARect) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var b = false;
      var df = false;
      var h = 0.0;
      h = 35 + this.FREdit.GetHeight() + this.FBEdit.GetHeight() + this.FGEdit.GetHeight() + this.FHEXEdit.GetHeight();
      r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,this.ScalePaintValue(25),this.ScalePaintValue(25)));
      pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(r,this.ScalePaintValue(30) + this.FImage.GetWidth(),h);
      r.Right = this.FREdit.GetLeft() + this.FREdit.GetWidth();
      AGraphics.FFill.SetColor(this.FSelectedColor);
      b = true;
      df = true;
      this.DoBeforeDrawSelectedColorPanel(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FSelectedColor,{get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }},{get: function () {
          return df;
        }, set: function (v) {
          df = v;
        }});
      if (b) {
        if (df) AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        this.DoAfterDrawSelectedColorPanel(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FSelectedColor);
      };
    };
    this.DrawText = function (AGraphics, ARect) {
      AGraphics.FFont.AssignSource(this.FFont$1);
      AGraphics.DrawText(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(30 + this.FImage.GetWidth(),this.FREdit.GetTop() + 7)),"R",0,true,false,-1,-1);
      AGraphics.DrawText(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(30 + this.FImage.GetWidth(),this.FGEdit.GetTop() + 7)),"G",0,true,false,-1,-1);
      AGraphics.DrawText(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(30 + this.FImage.GetWidth(),this.FBEdit.GetTop() + 7)),"B",0,true,false,-1,-1);
      AGraphics.DrawText(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(30 + this.FImage.GetWidth(),this.FHEXEdit.GetTop() + 7)),"HEX",0,true,false,-1,-1);
    };
    this.RFieldKeyDown = function (Sender, Key, Shift) {
      var v = 0;
      if (Key.get() === 13) {
        v = this.FREdit.GetInt();
        if (v < 0) {
          v = 0}
         else if (v > 255) v = 255;
        if (v === this.FRValue) {
          this.FREdit.SetT(pas.SysUtils.IntToStr(v));
        } else {
          this.SetSelectedColor(this.RGBToGraphicsColor(v,this.FGValue,this.FBValue));
          this.FHSColor.$assign(this.RGBToHS(v,this.FGValue,this.FBValue));
          this.SetIndicator();
        };
      };
    };
    this.GFieldKeyDown = function (Sender, Key, Shift) {
      var v = 0;
      if (Key.get() === 13) {
        v = this.FGEdit.GetInt();
        if (v < 0) {
          v = 0}
         else if (v > 255) v = 255;
        if (v === this.FGValue) {
          this.FGEdit.SetT(pas.SysUtils.IntToStr(v));
        } else {
          this.SetSelectedColor(this.RGBToGraphicsColor(this.FRValue,v,this.FBValue));
          this.FHSColor.$assign(this.RGBToHS(this.FRValue,v,this.FBValue));
          this.SetIndicator();
        };
      };
    };
    this.BFieldKeyDown = function (Sender, Key, Shift) {
      var v = 0;
      if (Key.get() === 13) {
        v = this.FBEdit.GetInt();
        if (v < 0) {
          v = 0}
         else if (v > 255) v = 255;
        if (v === this.FBValue) {
          this.FBEdit.SetT(pas.SysUtils.IntToStr(v));
        } else {
          this.SetSelectedColor(this.RGBToGraphicsColor(this.FRValue,this.FGValue,v));
          this.FHSColor.$assign(this.RGBToHS(this.FRValue,this.FGValue,v));
          this.SetIndicator();
        };
      };
    };
    this.HEXFieldKeyDown = function (Sender, Key, Shift) {
      var str = "";
      var r = 0;
      var g = 0;
      var b = 0;
      if ((Key.get() === 13) && (this.FHEXEdit.GetT().length === 6)) {
        str = pas.System.Copy(this.FHEXEdit.GetT(),1,2);
        r = pas.SysUtils.StrToInt("$" + str);
        str = pas.System.Copy(this.FHEXEdit.GetT(),3,2);
        g = pas.SysUtils.StrToInt("$" + str);
        str = pas.System.Copy(this.FHEXEdit.GetT(),5,2);
        b = pas.SysUtils.StrToInt("$" + str);
        this.SetSelectedColor(this.RGBToGraphicsColor(r,g,b));
        this.FHSColor.$assign(this.RGBToHS(r,g,b));
        this.SetIndicator();
      };
    };
    this.DoBeforeDrawSelectedColorPanel = function (AGraphics, ARectF, ASelectedColor, AAllow, ADefaultDraw) {
      if (this.FOnBeforeDrawSelectedColorPanel != null) this.FOnBeforeDrawSelectedColorPanel(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF),ASelectedColor,AAllow,ADefaultDraw);
    };
    this.DoAfterDrawSelectedColorPanel = function (AGraphics, ARectF, ASelectedColor) {
      if (this.FOnAfterDrawSelectedColorPanel != null) this.FOnAfterDrawSelectedColorPanel(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF),ASelectedColor);
    };
    this.DoSelectedColorChanged = function (ASelectedColor) {
      if (this.FOnSelectedColorChanged != null) this.FOnSelectedColorChanged(this,ASelectedColor);
    };
    this.DoRValueChanged = function (AR, ASelectedColor) {
      if (this.FOnRValueChanged != null) this.FOnRValueChanged(this,AR,ASelectedColor);
    };
    this.DoGValueChanged = function (AG, ASelectedColor) {
      if (this.FOnGValueChanged != null) this.FOnGValueChanged(this,AG,ASelectedColor);
    };
    this.DoBValueChanged = function (AB, ASelectedColor) {
      if (this.FOnBValueChanged != null) this.FOnBValueChanged(this,AB,ASelectedColor);
    };
    this.ColorChanged = function (Sender) {
      this.SetSelectedColor(this.FImage.FPixelColor);
    };
    this.RTrackBarChanged = function (Sender) {
      this.SetRValue(Math.round(this.FRTrackBar.GetV()));
    };
    this.GTrackBarChanged = function (Sender) {
      this.SetGValue(Math.round(this.FGTrackBar.GetV()));
    };
    this.BTrackBarChanged = function (Sender) {
      this.SetBValue(Math.round(this.FBTrackBar.GetV()));
    };
    this.FillColorChanged = function (Sender) {
      this.FillChanged(this);
      this.FImage.FFill.SetColor(this.FColor);
    };
    this.ApplyStyle = function () {
      var c = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ApplyStyle.call(this);
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleBackgroundFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) this.FFill.SetColor(c);
    };
    this.ResetToDefaultStyle = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ResetToDefaultStyle.call(this);
      this.FFill.SetColor(16777215);
    };
    this.UpdateControlAfterResize = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.UpdateControlAfterResize.call(this);
      if (this.FImage != null) this.FImage.SetTop(Math.round((this.GetHeight() / 2) - (this.FImage.GetHeight() / 2)));
    };
    this.SetIndicator = function () {
      var angle = 0.0;
      var r = 0.0;
      var cp = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      cp.$assign(this.FImage.GetCenterPoint());
      r = this.FImage.GetRadius() - 0.5;
      angle = pas.Math.DegToRad(this.FHSColor.Hue);
      this.FImage.SetX(cp.X + (r * this.FHSColor.Saturation * Math.cos(angle)));
      this.FImage.SetY(cp.Y + (r * this.FHSColor.Saturation * Math.sin(angle)));
      this.FImage.Invalidate();
    };
    this.GetVersion = function () {
      var Result = "";
      Result = this.$class.GetVersionNumber(1,0,1,0);
      return Result;
    };
    this.RGBToHS = function (AR, AG, AB) {
      var Result = $mod.TTMSFNCColorWheelHSColor.$new();
      var minRGB = 0.0;
      var maxRGB = 0.0;
      var delta = 0.0;
      var h = 0.0;
      var s = 0.0;
      h = 0.0;
      maxRGB = Math.max(Math.max(AR,AG),AB);
      minRGB = Math.min(Math.min(AR,AG),AB);
      delta = maxRGB - minRGB;
      if (maxRGB === 0) {
        s = 0.0}
       else s = delta / maxRGB;
      if (delta === 0) {
        h = 0.0}
       else if (maxRGB === AR) {
        h = (AG - AB) / delta}
       else if (maxRGB === AG) {
        h = ((AB - AR) / delta) + 2}
       else if (maxRGB === AB) h = ((AR - AG) / delta) + 4;
      h = 60 * h;
      Result.Hue = h;
      Result.Saturation = s;
      return Result;
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Create$1.apply(this,arguments);
      this.SetWidth(350);
      this.SetHeight(175);
      this.FRValue = 255;
      this.FGValue = 255;
      this.FBValue = 255;
      this.FSelectedColor = 16777215;
      this.FFill.FOnChanged = rtl.createCallback(this,"FillColorChanged");
      this.FFont$1 = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FImage = $mod.TTMSFNCImageColor.$create("Create$1",[this]);
      this.FImage.SetParent(this);
      this.FImage.FBitmaps.AddBitmapFromResource$1(pas["WEBLib.TMSFNCColorWheelResources"].GetColorWheelResource(),pas["WEBLib.TMSFNCTypes"].HInstance(),1.0);
      this.FImage.SetTop(Math.round((this.GetHeight() / 2) - (this.FImage.GetHeight() / 2)));
      this.FImage.SetLeft(10);
      this.FImage.FOnColorChanged = rtl.createCallback(this,"ColorChanged");
      this.FImage.SetStretch(true);
      this.FREdit = pas["WEBLib.TMSFNCEdit"].TTMSFNCEdit.$create("Create$1",[this]);
      this.FREdit.SetParent(this);
      this.FREdit.SetWidth(35);
      this.FREdit.SetLeft(this.GetWidth() - this.FREdit.GetWidth() - 15);
      this.FREdit.SetTop(15);
      this.FREdit.SetEditType$1(pas["WEBLib.TMSFNCEdit"].TTMSFNCEditType.etNumeric);
      this.FREdit.FOnKeyDown = rtl.createCallback(this,"RFieldKeyDown");
      this.FREdit.SetMaxLength(3);
      this.FREdit.SetT("255");
      this.FGEdit = pas["WEBLib.TMSFNCEdit"].TTMSFNCEdit.$create("Create$1",[this]);
      this.FGEdit.SetParent(this);
      this.FGEdit.SetWidth(35);
      this.FGEdit.SetLeft(this.GetWidth() - this.FGEdit.GetWidth() - 15);
      this.FGEdit.SetTop(45);
      this.FGEdit.SetEditType$1(pas["WEBLib.TMSFNCEdit"].TTMSFNCEditType.etNumeric);
      this.FGEdit.FOnKeyDown = rtl.createCallback(this,"GFieldKeyDown");
      this.FGEdit.SetMaxLength(3);
      this.FGEdit.SetT("255");
      this.FBEdit = pas["WEBLib.TMSFNCEdit"].TTMSFNCEdit.$create("Create$1",[this]);
      this.FBEdit.SetParent(this);
      this.FBEdit.SetWidth(35);
      this.FBEdit.SetLeft(this.GetWidth() - this.FBEdit.GetWidth() - 15);
      this.FBEdit.SetTop(75);
      this.FBEdit.SetEditType$1(pas["WEBLib.TMSFNCEdit"].TTMSFNCEditType.etNumeric);
      this.FBEdit.FOnKeyDown = rtl.createCallback(this,"BFieldKeyDown");
      this.FBEdit.SetMaxLength(3);
      this.FBEdit.SetT("255");
      this.FHEXEdit = pas["WEBLib.TMSFNCEdit"].TTMSFNCEdit.$create("Create$1",[this]);
      this.FHEXEdit.SetParent(this);
      this.FHEXEdit.SetWidth(125);
      this.FHEXEdit.SetLeft(210);
      this.FHEXEdit.SetTop(105);
      this.FHEXEdit.SetEditType$1(pas["WEBLib.TMSFNCEdit"].TTMSFNCEditType.etHex);
      this.FHEXEdit.FOnKeyDown = rtl.createCallback(this,"HEXFieldKeyDown");
      this.FHEXEdit.SetMaxLength(6);
      this.FHEXEdit.SetT("FFFFFF");
      this.FRTrackBar = $mod.TTMSFNCRGBTrackBar.$create("Create$1",[this]);
      this.FRTrackBar.SetParent(this);
      this.FRTrackBar.SetLeft(195);
      this.FRTrackBar.SetTop(this.FREdit.GetTop() - 1);
      this.FRTrackBar.SetValue(255);
      this.FRTrackBar.FOnChange = rtl.createCallback(this,"RTrackBarChanged");
      this.FGTrackBar = $mod.TTMSFNCRGBTrackBar.$create("Create$1",[this]);
      this.FGTrackBar.SetParent(this);
      this.FGTrackBar.SetLeft(195);
      this.FGTrackBar.SetTop(this.FGEdit.GetTop() - 1);
      this.FGTrackBar.SetValue(255);
      this.FGTrackBar.FOnChange = rtl.createCallback(this,"GTrackBarChanged");
      this.FBTrackBar = $mod.TTMSFNCRGBTrackBar.$create("Create$1",[this]);
      this.FBTrackBar.SetParent(this);
      this.FBTrackBar.SetLeft(195);
      this.FBTrackBar.SetTop(this.FBEdit.GetTop() - 1);
      this.FBTrackBar.SetValue(255);
      this.FBTrackBar.FOnChange = rtl.createCallback(this,"BTrackBarChanged");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FImage");
      rtl.free(this,"FREdit");
      rtl.free(this,"FGEdit");
      rtl.free(this,"FBEdit");
      rtl.free(this,"FRTrackBar");
      rtl.free(this,"FGTrackBar");
      rtl.free(this,"FBTrackBar");
      rtl.free(this,"FFont$1");
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Destroy.call(this);
    };
    this.ColorToRValue = function (AColor) {
      var Result = 0;
      Result = AColor & 0xFF;
      return Result;
    };
    this.ColorToGValue = function (AColor) {
      var Result = 0;
      Result = Math.floor((AColor & 0xFF00) / 256);
      return Result;
    };
    this.ColorToBValue = function (AColor) {
      var Result = 0;
      Result = Math.floor((AColor & 0xFF0000) / 65536);
      return Result;
    };
    this.RGBToGraphicsColor = function (R, G, B) {
      var Result = 0;
      Result = pas["WEBLib.Graphics"].RGB(R,G,B);
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCColorWheel",this.TTMSFNCCustomColorWheel,function () {
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Font",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FFont$1","SetFnt");
    $r.addProperty("Fill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFill","SetFill");
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
    $r.addProperty("SelectedColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FSelectedColor","SetSelectedColor",4,{Default: 16777215});
    $r.addProperty("RValue",2,rtl.longint,"FRValue","SetRValue",4,{Default: 255});
    $r.addProperty("BValue",2,rtl.longint,"FBValue","SetBValue",4,{Default: 255});
    $r.addProperty("GValue",2,rtl.longint,"FGValue","SetGValue",4,{Default: 255});
    $r.addProperty("HEXValue",15,rtl.string,"GetHEXValue","SetHEXValue",4,{stored: "IsHEXValueStored"});
    $r.addProperty("OnBeforeDrawSelectedColorPanel",0,$mod.$rtti["TTMSFNCCustomColorWheelBeforeDrawSelectedColorPanelEvent"],"FOnBeforeDrawSelectedColorPanel","FOnBeforeDrawSelectedColorPanel");
    $r.addProperty("OnAfterDrawSelectedColorPanel",0,$mod.$rtti["TTMSFNCCustomColorWheelAfterDrawSelectedColorPanelEvent"],"FOnAfterDrawSelectedColorPanel","FOnAfterDrawSelectedColorPanel");
    $r.addProperty("OnSelectedColorChanged",0,$mod.$rtti["TTMSFNCCustomColorWheelSelectedColorChangedEvent"],"FOnSelectedColorChanged","FOnSelectedColorChanged");
    $r.addProperty("OnRValueChanged",0,$mod.$rtti["TTMSFNCCustomColorWheelRValueChangedEvent"],"FOnRValueChanged","FOnRValueChanged");
    $r.addProperty("OnGValueChanged",0,$mod.$rtti["TTMSFNCCustomColorWheelGValueChangedEvent"],"FOnGValueChanged","FOnGValueChanged");
    $r.addProperty("OnBValueChanged",0,$mod.$rtti["TTMSFNCCustomColorWheelBValueChangedEvent"],"FOnBValueChanged","FOnBValueChanged");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
},["Math","SysUtils","WEBLib.TMSFNCColorWheelResources"]);
rtl.module("WEBLib.TMSFNCColorSelector",["System","Classes","WEBLib.TMSFNCGraphics","WEBLib.TMSFNCCustomControl","WEBLib.TMSFNCCustomSelector","WEBLib.Controls","WEBLib.TMSFNCTypes","WEBLib.ExtCtrls","WEBLib.TMSFNCGraphicsTypes","WEBLib.StdCtrls","Types"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.MAJ_VER = 1;
  this.MIN_VER = 0;
  this.REL_VER = 0;
  this.BLD_VER = 1;
  this.TMSFNCColorSelectorColorSetCount = 15;
  this.$rtti.$StaticArray("TMSFNCColorSelectorColorSet$a",{dims: [16], eltype: pas["WEBLib.Graphics"].$rtti["TColor"]});
  this.TMSFNCColorSelectorColorSet = [0,128,32768,32896,8388608,8388736,8421376,12632256,8421504,255,65280,65535,16711680,16711935,16776960,16777215];
  this.TMSFNCColorSelectorExtendedColorSetCount = 39;
  this.$rtti.$StaticArray("TMSFNCColorSelectorExtendedColorSet$a",{dims: [40], eltype: pas["WEBLib.Graphics"].$rtti["TColor"]});
  this.TMSFNCColorSelectorExtendedColorSet = [0,0x993300,0x333300,0x3300,0x3366,8388608,0x333335,0x333333,0x80,0x66FF,0x8080,0x8000,0x808000,0xFF0000,0x996666,0x808080,0xFF,0x99FF,0xCC99,0x669933,0xCCCC33,0xFF6633,0x800080,0x999999,0xFF00FF,0xCCFF,0xFFFF,0xFF00,0xFFFF00,0xFFCC00,0x663399,0xC0C0C0,0xCC99FF,0x99CCFF,0x99FFFF,0xCCFFCC,0xFFFFCC,0xFFCC99,0xFF99CC,0xFFFFFF];
  this.$rtti.$Class("TTMSFNCCustomColorSelector");
  rtl.createClass(this,"TTMSFNCColorSelectorItem",pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelectorItem,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelectorItem.$init.call(this);
      this.FOwner$1 = null;
      this.FColor = 0;
    };
    this.$final = function () {
      this.FOwner$1 = undefined;
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelectorItem.$final.call(this);
    };
    this.SetColor = function (Value) {
      if (this.FColor !== Value) {
        this.FColor = Value;
        if (this.FOwner$1 != null) this.FOwner$1.InvalidateItems();
      };
    };
    this.Create$1 = function (ACollection) {
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelectorItem.Create$1.apply(this,arguments);
      if (this.FCollection != null) this.FOwner$1 = rtl.as(this.FCollection,$mod.TTMSFNCColorSelectorItems).FOwner$2;
      return this;
    };
    this.Assign = function (Source) {
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelectorItem.Assign.apply(this,arguments);
      if ($mod.TTMSFNCColorSelectorItem.isPrototypeOf(Source)) this.FColor = rtl.as(Source,$mod.TTMSFNCColorSelectorItem).FColor;
    };
    var $r = this.$rtti;
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor",4,{Default: -1});
  });
  rtl.createClass(this,"TTMSFNCColorSelectorItems",pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelectorItems,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelectorItems.$init.call(this);
      this.FOwner$2 = null;
    };
    this.$final = function () {
      this.FOwner$2 = undefined;
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelectorItems.$final.call(this);
    };
    this.GetItem$2 = function (Index) {
      var Result = null;
      Result = this.GetItem$1(Index);
      return Result;
    };
    this.SetItem$2 = function (Index, Value) {
      this.SetItem$1(Index,Value);
    };
    this.CreateItemClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCColorSelectorItem;
      return Result;
    };
    this.Create$3 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelectorItems.Create$3.apply(this,arguments);
      this.FOwner$2 = rtl.as(AOwner,$mod.TTMSFNCCustomColorSelector);
      return this;
    };
    this.Add$2 = function () {
      var Result = null;
      Result = pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelectorItems.Add$1.call(this);
      return Result;
    };
    this.Insert$2 = function (Index) {
      var Result = null;
      Result = pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelectorItems.Insert$1.call(this,Index);
      return Result;
    };
  });
  this.$rtti.$MethodVar("TTMSFNCCustomSelectorColorSelected",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColor",pas["WEBLib.Graphics"].$rtti["TColor"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCustomSelectorColorDeselected",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColor",pas["WEBLib.Graphics"].$rtti["TColor"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCustomSelectorColorClick",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColor",pas["WEBLib.Graphics"].$rtti["TColor"]]]), methodkind: 0});
  this.TTMSFNCCustomColorSelectorMode = {"0": "csmSimple", csmSimple: 0, "1": "csmExtended", csmExtended: 1, "2": "csmExtendedMore", csmExtendedMore: 2};
  this.$rtti.$Enum("TTMSFNCCustomColorSelectorMode",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCCustomColorSelectorMode});
  rtl.createClass(this,"TTMSFNCCustomColorSelector",pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCDefaultSelector,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCDefaultSelector.$init.call(this);
      this.w = 0.0;
      this.h = 0.0;
      this.FColorWheel = null;
      this.FPanel = null;
      this.FBackButton = null;
      this.FOnColorSelected = null;
      this.FOnColorDeselected = null;
      this.FMode = 0;
    };
    this.$final = function () {
      this.FColorWheel = undefined;
      this.FPanel = undefined;
      this.FBackButton = undefined;
      this.FOnColorSelected = undefined;
      this.FOnColorDeselected = undefined;
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCDefaultSelector.$final.call(this);
    };
    this.SetSelectedColor = function (Value) {
      var $tmp = this.FMode;
      if ($tmp === $mod.TTMSFNCCustomColorSelectorMode.csmExtendedMore) {
        if (this.GetItems().GetCount() > 0) this.GetItems().GetItem$2(this.GetItems().GetCount() - 1).SetColor(Value);
      };
      this.SetSelectedItemIndex(this.FindItemByColor(Value));
    };
    this.GetSelectedColor = function () {
      var Result = 0;
      Result = this.FindColorByItem(this.FSelectedItemIndex);
      return Result;
    };
    this.GetItems = function () {
      var Result = null;
      Result = this.FItems;
      return Result;
    };
    this.SetItems$1 = function (Value) {
      this.GetItems().Assign(Value);
    };
    this.SetMode = function (Value) {
      var s = 0.0;
      s = 1;
      if (this.FMode !== Value) {
        this.FMode = Value;
        var $tmp = this.FMode;
        if ($tmp === $mod.TTMSFNCCustomColorSelectorMode.csmSimple) {
          this.SetWidth(Math.round(s * 135));
          this.SetHeight(Math.round(s * 135));
        } else if ($tmp === $mod.TTMSFNCCustomColorSelectorMode.csmExtended) {
          this.SetWidth(Math.round(s * 200));
          this.SetHeight(Math.round(s * 135));
        } else if ($tmp === $mod.TTMSFNCCustomColorSelectorMode.csmExtendedMore) {
          this.SetWidth(Math.round(s * 200));
          this.SetHeight(Math.round(s * 175));
        };
        this.AddColors();
      };
    };
    this.GetVersion = function () {
      var Result = "";
      Result = this.$class.GetVersionNumber(1,0,1,0);
      return Result;
    };
    this.BackButtonClicked = function (Sender) {
      if (this.FPanel != null) {
        this.FPanel.SetVisible(false);
        this.FPanel.SetParent(null);
        this.SetWidth(Math.round(this.w));
        this.SetHeight(Math.round(this.h));
        this.WrapperSizeChanged(this.w,this.h);
        this.Invalidate();
      };
    };
    this.ColorWheelChange = function (Sender, AColor) {
      if (this.FBlockChange) return;
      this.FBlockChange = true;
      this.NotifyDataBinderEdit();
      this.SetSelectedItemIndex(-1);
      this.NotifyDataBinderValueChanged();
      this.GetItems().GetItem$2(this.GetItems().GetCount() - 1).SetColor($impl.AsColorWheel(this.FColorWheel).FSelectedColor);
      this.SetSelectedColor($impl.AsColorWheel(this.FColorWheel).FSelectedColor);
      this.DoItemSelected(this.FSelectedItemIndex);
      this.Invalidate();
      this.FBlockChange = false;
    };
    this.DoItemClick = function (AItemIndex) {
      var l = 0.0;
      var t = 0.0;
      var r = 0.0;
      var b = 0.0;
      var nw = 0.0;
      var nh = 0.0;
      if (this.FClosedRemotely) {
        this.FClosedRemotely = false;
        pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelector.DoItemClick.apply(this,arguments);
        return;
      };
      if ((this.FMode === $mod.TTMSFNCCustomColorSelectorMode.csmExtendedMore) && (this.FPanel != null) && (AItemIndex === (this.GetItems().GetCount() - 2))) {
        this.w = this.GetWidth();
        this.h = this.GetHeight();
        l = 0;
        t = 0;
        r = 0;
        b = 0;
        this.FColorWheel.GetControlMargins({get: function () {
            return l;
          }, set: function (v) {
            l = v;
          }},{get: function () {
            return t;
          }, set: function (v) {
            t = v;
          }},{get: function () {
            return r;
          }, set: function (v) {
            r = v;
          }},{get: function () {
            return b;
          }, set: function (v) {
            b = v;
          }});
        nh = this.ScalePaintValue(205) + this.FBackButton.GetHeight() + t + b;
        this.SetHeight(Math.round(nh));
        nw = this.ScalePaintValue(350);
        this.SetWidth(Math.round(nw));
        this.WrapperSizeChanged(nw,nh);
        this.FBlockChange = true;
        $impl.AsColorWheel(this.FColorWheel).SetSelectedColor(this.FindColorByItem(AItemIndex + 1));
        this.FBlockChange = false;
        this.FPanel.SetVisible(true);
        this.FPanel.SetParent(this);
      };
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelector.DoItemClick.apply(this,arguments);
    };
    this.WrapperSizeChanged = function (AWidth, AHeight) {
    };
    this.DoItemSelected = function (AItemIndex) {
      var c = 0;
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelector.DoItemSelected.apply(this,arguments);
      c = this.FindColorByItem(AItemIndex);
      if ((this.FColorWheel != null) && !this.FBlockChange) {
        this.FBlockChange = true;
        $impl.AsColorWheel(this.FColorWheel).SetSelectedColor(c);
        if ((this.FMode === $mod.TTMSFNCCustomColorSelectorMode.csmExtendedMore) && (this.GetItems().GetCount() > 0)) this.GetItems().GetItem$2(this.GetItems().GetCount() - 1).SetColor(c);
        this.FBlockChange = false;
      };
      if (this.FOnColorSelected != null) this.FOnColorSelected(this,c);
    };
    this.DoItemDeselected = function (AItemIndex) {
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelector.DoItemDeselected.apply(this,arguments);
      if (this.FOnColorDeselected != null) this.FOnColorDeselected(this,this.FindColorByItem(AItemIndex));
    };
    this.CreateItemsCollection = function () {
      var Result = null;
      Result = $mod.TTMSFNCColorSelectorItems.$create("Create$3",[this]);
      return Result;
    };
    this.DoItemBeforeDrawContent = function (AGraphics, ARect, AItemIndex, ADefaultDraw) {
      if (this.FMode === $mod.TTMSFNCCustomColorSelectorMode.csmExtendedMore) {
        if ((AItemIndex >= 0) && (AItemIndex <= (this.GetItems().GetCount() - 1))) ADefaultDraw.set(!this.GetItems().GetItem$2(AItemIndex).FDataBoolean);
      };
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelector.DoItemBeforeDrawContent.apply(this,arguments);
    };
    this.DrawItemContent = function (AGraphics, ADisplayItem) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var it = null;
      var a = false;
      it = ADisplayItem.Item;
      if ((it != null) && $mod.TTMSFNCColorSelectorItem.isPrototypeOf(it)) {
        r.$assign(ADisplayItem.Rect);
        a = true;
        this.DoItemBeforeDrawContent(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ADisplayItem.Rect),it.GetIndex(),{get: function () {
            return a;
          }, set: function (v) {
            a = v;
          }});
        if (a) {
          var $tmp = this.FMode;
          if ($tmp === $mod.TTMSFNCCustomColorSelectorMode.csmSimple) {
            pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,-5,-5)}
           else if (($tmp === $mod.TTMSFNCCustomColorSelectorMode.csmExtended) || ($tmp === $mod.TTMSFNCCustomColorSelectorMode.csmExtendedMore)) pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,-3,-3);
          AGraphics.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
          AGraphics.FFill.SetColor(rtl.as(it,$mod.TTMSFNCColorSelectorItem).FColor);
          AGraphics.FStroke.SetColor(AGraphics.FFill.FColor);
          AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
          this.DoItemAfterDrawContent(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ADisplayItem.Rect),it.GetIndex());
        };
      };
    };
    this.AddColors = function () {
      var I = 0;
      var it = null;
      this.BeginUpdate();
      this.GetItems().Clear();
      var $tmp = this.FMode;
      if ($tmp === $mod.TTMSFNCCustomColorSelectorMode.csmSimple) {
        this.SetColumns(4);
        this.SetRows(4);
        for (I = 0; I <= 15; I++) this.GetItems().Add$2().SetColor($mod.TMSFNCColorSelectorColorSet[I]);
      } else if ($tmp === $mod.TTMSFNCCustomColorSelectorMode.csmExtended) {
        this.SetColumns(8);
        this.SetRows(5);
        for (I = 0; I <= 39; I++) this.GetItems().Add$2().SetColor($mod.TMSFNCColorSelectorExtendedColorSet[I]);
      } else if ($tmp === $mod.TTMSFNCCustomColorSelectorMode.csmExtendedMore) {
        this.SetColumns(8);
        this.SetRows(7);
        for (I = 0; I <= 39; I++) this.GetItems().Add$2().SetColor($mod.TMSFNCColorSelectorExtendedColorSet[I]);
        it = this.GetItems().Insert$2(0);
        it.SetColor(0);
        it.SetColumnSpan(8);
        it.SetText("Automatic");
        it.FDataBoolean = true;
        it = this.GetItems().Add$2();
        it.SetColumnSpan(8);
        it.SetText("More Colors...");
        it.SetCanSelect(false);
        it.FDataBoolean = true;
        this.GetItems().Add$2().SetVisible(false);
      };
      this.EndUpdate();
    };
    this.ResetToDefaultStyle = function () {
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelector.ResetToDefaultStyle.call(this);
      this.BeginUpdate();
      this.FAppearance.FFont.SetColor(0x454545);
      this.FAppearance.FFill.SetColor(0xF9F2EE);
      this.FAppearance.FFillSelected.SetColor(0xF0BCA8);
      this.FAppearance.FStrokeSelected.SetColor(0xEF9B2D);
      this.FAppearance.FFillDown.SetColor(0xE6815A);
      this.FAppearance.FFillSelected.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FAppearance.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FAppearance.FFillDown.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FAppearance.FFillHover.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FAppearance.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FAppearance.FStrokeSelected.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FAppearance.FStrokeHover.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FAppearance.FStroke.SetColor(11119017);
      this.FAppearance.FStrokeHover.SetColor(this.FAppearance.FFillDown.FColor);
      this.FAppearance.FStrokeDown.Assign(this.FAppearance.FStroke);
      this.EndUpdate();
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelector.Create$1.apply(this,arguments);
      this.SetWidth(135);
      this.SetHeight(135);
      this.FMode = $mod.TTMSFNCCustomColorSelectorMode.csmSimple;
      this.FPanel = pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$create("Create$1",[this]);
      this.FPanel.SetVisible(false);
      this.FPanel.FStored = false;
      this.FPanel.SetControlAlignment(pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlAlignment.caClient);
      this.FBackButton = pas["WEBLib.StdCtrls"].TButton.$create("Create$1",[this.FPanel]);
      this.FBackButton.SetAlignWithMargins(true);
      this.FBackButton.FMargins.SetTop(3);
      this.FBackButton.FMargins.SetLeft(3);
      this.FBackButton.FMargins.SetBottom(3);
      this.FBackButton.FMargins.SetRight(3);
      this.FBackButton.SetCaption("Back");
      this.FBackButton.SetAlign(pas["WEBLib.Controls"].TAlign.alTop);
      this.FBackButton.SetParent(this.FPanel);
      this.FBackButton.FOnClick = rtl.createCallback(this,"BackButtonClicked");
      this.FColorWheel = pas["WEBLib.TMSFNCColorWheel"].TTMSFNCColorWheel.$create("Create$1",[this.FPanel]);
      $impl.AsColorWheel(this.FColorWheel).SetControlAlignment(pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlAlignment.caClient);
      $impl.AsColorWheel(this.FColorWheel).SetControlMargins(3,0,3,3);
      $impl.AsColorWheel(this.FColorWheel).SetParent(this.FPanel);
      $impl.AsColorWheel(this.FColorWheel).FOnSelectedColorChanged = rtl.createCallback(this,"ColorWheelChange");
      if (this.IsDesignTime()) this.InitSample();
      return this;
    };
    this.FindItemByColor = function (AColor) {
      var Result = 0;
      var I = 0;
      var it = null;
      Result = -1;
      for (var $l = 0, $end = this.GetItems().GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        it = rtl.as(this.GetItems().GetItem$2(I),$mod.TTMSFNCColorSelectorItem);
        if ((it.FColor === AColor) && it.FCanSelect) {
          Result = it.GetIndex();
          break;
        };
      };
      return Result;
    };
    this.FindColorByItem = function (AItem) {
      var Result = 0;
      var I = 0;
      var it = null;
      Result = -1;
      for (var $l = 0, $end = this.GetItems().GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        it = rtl.as(this.GetItems().GetItem$2(I),$mod.TTMSFNCColorSelectorItem);
        if (it.GetIndex() === AItem) {
          Result = it.FColor;
          break;
        };
      };
      return Result;
    };
    this.ColorWheelActive = function () {
      var Result = false;
      Result = (this.FPanel != null) && (this.FPanel.FParent != null) && this.FPanel.FVisible && (this.FColorWheel != null) && (this.FColorWheel.FParent != null) && this.FColorWheel.FVisible;
      return Result;
    };
    this.InitializeDefault = function () {
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelector.InitializeDefault.call(this);
      this.AddColors();
    };
    this.InitSample = function () {
      this.ResetToDefaultStyle();
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCColorSelector",this.TTMSFNCCustomColorSelector,function () {
    this.RegisterRuntimeClasses = function () {
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelector.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClasses([$mod.TTMSFNCColorSelector,$mod.TTMSFNCColorSelectorItem]);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Appearance",2,pas["WEBLib.TMSFNCCustomSelector"].$rtti["TTMSFNCCustomSelectorAppearance"],"FAppearance","SetAppearance");
    $r.addProperty("Rows",2,rtl.longint,"FRows","SetRows",4,{Default: 4});
    $r.addProperty("Columns",2,rtl.longint,"FColumns","SetColumns",4,{Default: 4});
    $r.addProperty("Items",3,$mod.$rtti["TTMSFNCColorSelectorItems"],"GetItems","SetItems$1");
    $r.addProperty("Mode",2,$mod.$rtti["TTMSFNCCustomColorSelectorMode"],"FMode","SetMode",4,{Default: $mod.TTMSFNCCustomColorSelectorMode.csmSimple});
    $r.addProperty("OnColorSelected",0,$mod.$rtti["TTMSFNCCustomSelectorColorSelected"],"FOnColorSelected","FOnColorSelected");
    $r.addProperty("OnColorDeselected",0,$mod.$rtti["TTMSFNCCustomSelectorColorDeselected"],"FOnColorDeselected","FOnColorDeselected");
    $r.addProperty("SelectedColor",3,pas["WEBLib.Graphics"].$rtti["TColor"],"GetSelectedColor","SetSelectedColor",4,{Default: -1});
    $r.addProperty("OnItemSelected",0,pas["WEBLib.TMSFNCCustomSelector"].$rtti["TTMSFNCCustomSelectorItemSelected"],"FOnItemSelected","FOnItemSelected");
    $r.addProperty("OnItemDeselected",0,pas["WEBLib.TMSFNCCustomSelector"].$rtti["TTMSFNCCustomSelectorItemDeselected"],"FOnItemDeselected","FOnItemDeselected");
    $r.addProperty("OnItemClick",0,pas["WEBLib.TMSFNCCustomSelector"].$rtti["TTMSFNCCustomSelectorItemClick"],"FOnItemClick","FOnItemClick");
    $r.addProperty("SelectedItemIndex",2,rtl.longint,"FSelectedItemIndex","SetSelectedItemIndex",4,{Default: -1});
    $r.addProperty("OnItemBeforeDrawBackground",0,pas["WEBLib.TMSFNCCustomSelector"].$rtti["TTMSFNCCustomSelectorItemBeforeDrawBackground"],"FOnItemBeforeDrawBackground","FOnItemBeforeDrawBackground");
    $r.addProperty("OnItemAfterDrawBackground",0,pas["WEBLib.TMSFNCCustomSelector"].$rtti["TTMSFNCCustomSelectorItemAfterDrawBackground"],"FOnItemAfterDrawBackground","FOnItemAfterDrawBackground");
    $r.addProperty("OnItemBeforeDrawContent",0,pas["WEBLib.TMSFNCCustomSelector"].$rtti["TTMSFNCCustomSelectorItemBeforeDrawContent"],"FOnItemBeforeDrawContent","FOnItemBeforeDrawContent");
    $r.addProperty("OnItemAfterDrawContent",0,pas["WEBLib.TMSFNCCustomSelector"].$rtti["TTMSFNCCustomSelectorItemAfterDrawContent"],"FOnItemAfterDrawContent","FOnItemAfterDrawContent");
    $r.addProperty("OnBeforeDraw",0,pas["WEBLib.TMSFNCCustomSelector"].$rtti["TTMSFNCCustomSelectorBeforeDraw"],"FOnBeforeDraw$1","FOnBeforeDraw$1");
    $r.addProperty("OnAfterDraw",0,pas["WEBLib.TMSFNCCustomSelector"].$rtti["TTMSFNCCustomSelectorAfterDraw"],"FOnAfterDraw$1","FOnAfterDraw$1");
    $r.addProperty("OnItemBeforeDrawText",0,pas["WEBLib.TMSFNCCustomSelector"].$rtti["TTMSFNCCustomSelectorItemBeforeDrawText"],"FOnItemBeforeDrawText","FOnItemBeforeDrawText");
    $r.addProperty("OnItemAfterDrawText",0,pas["WEBLib.TMSFNCCustomSelector"].$rtti["TTMSFNCCustomSelectorItemAfterDrawText"],"FOnItemAfterDrawText","FOnItemAfterDrawText");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
  $mod.$implcode = function () {
    $impl.AsColorWheel = function (AColorWheel) {
      var Result = null;
      Result = rtl.as(AColorWheel,pas["WEBLib.TMSFNCColorWheel"].TTMSFNCColorWheel);
      return Result;
    };
  };
},["SysUtils","WEBLib.TMSFNCUtils","WEBLib.TMSFNCColorWheel"]);
rtl.module("WEBLib.TMSFNCToolBar",["System","Classes","WEBLib.TMSFNCGraphics","WEBLib.TMSFNCPersistence","WEBLib.TMSFNCListBox","WEBLib.TMSFNCStyles","WEBLib.TMSFNCCustomControl","WEBLib.Controls","Types","WEBLib.TMSFNCBitmapSelector","WEBLib.TMSFNCPopup","WEBLib.TMSFNCTypes","WEBLib.TMSFNCBitmapContainer","WEBLib.StdCtrls","WEBLib.TMSFNCColorSelector","WEBLib.TMSFNCToolBarRes","WEBLib.TMSFNCGraphicsTypes","contnrs","WEBLib.Menus","WEBLib.ExtCtrls"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.MAJ_VER = 1;
  this.MIN_VER = 0;
  this.REL_VER = 2;
  this.BLD_VER = 6;
  this.TMSFNCTOOLBAREXPANDSVG = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdo" + "dD0iMTIiIHdpZHRoPSIxMCI+DQogIDxwYXRoIGQ9Ik0gMiA0IEwgNSA3IEwgOCA0IFoiIHN0eWxlPSJzdHJva2U6YmxhY2s7" + "c3Ryb2tlLXdpZHRoOjEiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgLz4NCjwvc3ZnPg==";
  this.$rtti.$Class("TTMSFNCCustomToolBar");
  this.$rtti.$Class("TTMSFNCCustomDockPanel");
  this.$rtti.$Class("TTMSFNCCustomToolBarSeparator");
  this.$rtti.$Class("TTMSFNCDefaultToolBarButton");
  this.$rtti.$Class("TTMSFNCToolBarButton");
  this.$rtti.$Class("TTMSFNCToolBarDropDownButton");
  rtl.createClass(this,"TTMSFNCToolBarCustomButtonAppearance",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FOwner = null;
      this.FHoverStroke = null;
      this.FDownFill = null;
      this.FNormalFill = null;
      this.FDownStroke = null;
      this.FDisabledFill = null;
      this.FNormalStroke = null;
      this.FDisabledStroke = null;
      this.FHoverFill = null;
      this.FCorners = {};
      this.FRounding = 0.0;
      this.FTransparent = false;
      this.FShowInnerStroke = false;
      this.FInnerStroke = null;
      this.FFlatStyle = false;
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FOwner = undefined;
      this.FHoverStroke = undefined;
      this.FDownFill = undefined;
      this.FNormalFill = undefined;
      this.FDownStroke = undefined;
      this.FDisabledFill = undefined;
      this.FNormalStroke = undefined;
      this.FDisabledStroke = undefined;
      this.FHoverFill = undefined;
      this.FCorners = undefined;
      this.FInnerStroke = undefined;
      this.FOnChange = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetDisabledFill = function (Value) {
      this.FDisabledFill.Assign(Value);
    };
    this.SetDisabledStroke = function (Value) {
      this.FDisabledStroke.Assign(Value);
    };
    this.SetDownFill = function (Value) {
      this.FDownFill.Assign(Value);
    };
    this.SetDownStroke = function (Value) {
      this.FDownStroke.Assign(Value);
    };
    this.SetHoverFill = function (Value) {
      this.FHoverFill.Assign(Value);
    };
    this.SetHoverStroke = function (Value) {
      this.FHoverStroke.Assign(Value);
    };
    this.SetNormalFill = function (Value) {
      this.FNormalFill.Assign(Value);
    };
    this.SetNormalStroke = function (Value) {
      this.FNormalStroke.Assign(Value);
    };
    this.SetCorners = function (Value) {
      if (rtl.neSet(this.FCorners,Value)) {
        this.FCorners = rtl.refSet(Value);
        this.Changed();
      };
    };
    this.SetRounding = function (Value) {
      if (this.FRounding !== Value) {
        this.FRounding = Value;
        this.Changed();
      };
    };
    this.SetInnerStroke = function (Value) {
      this.FInnerStroke.Assign(Value);
    };
    this.SetShowInnerStroke = function (Value) {
      if (this.FShowInnerStroke !== Value) {
        this.FShowInnerStroke = Value;
        this.Changed();
      };
    };
    this.SetTransparent = function (Value) {
      if (this.FTransparent !== Value) {
        this.FTransparent = Value;
        this.Changed();
      };
    };
    this.IsRoundingStored = function () {
      var Result = false;
      Result = this.FRounding !== 3;
      return Result;
    };
    this.SetFlatStyle = function (Value) {
      var c = null;
      var I = 0;
      if (this.FFlatStyle !== Value) {
        this.FFlatStyle = Value;
        if (this.FOwner != null) {
          for (var $l = 0, $end = this.FOwner.GetControlsCount() - 1; $l <= $end; $l++) {
            I = $l;
            c = this.FOwner.GetControls(I);
            if ($mod.TTMSFNCDefaultToolBarButton.isPrototypeOf(c)) rtl.as(c,$mod.TTMSFNCDefaultToolBarButton).FAppearance.SetFlatStyle(this.FFlatStyle);
            if ($mod.TTMSFNCCustomToolBar.isPrototypeOf(c)) rtl.as(c,$mod.TTMSFNCCustomToolBar).FAppearance.SetFlatStyle(this.FFlatStyle);
          };
        };
        this.Changed();
      };
    };
    this.FillChanged = function (Sender) {
      this.Changed();
    };
    this.StrokeChanged = function (Sender) {
      this.Changed();
    };
    this.Changed = function () {
      if (this.FOwner != null) {
        this.FOwner.AppearanceChanged()}
       else if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCToolBarCustomButtonAppearance.isPrototypeOf(Source)) {
        this.FNormalFill.Assign(rtl.as(Source,$mod.TTMSFNCToolBarCustomButtonAppearance).FNormalFill);
        this.FDisabledFill.Assign(rtl.as(Source,$mod.TTMSFNCToolBarCustomButtonAppearance).FDisabledFill);
        this.FHoverFill.Assign(rtl.as(Source,$mod.TTMSFNCToolBarCustomButtonAppearance).FHoverFill);
        this.FDownFill.Assign(rtl.as(Source,$mod.TTMSFNCToolBarCustomButtonAppearance).FDownFill);
        this.FNormalStroke.Assign(rtl.as(Source,$mod.TTMSFNCToolBarCustomButtonAppearance).FNormalStroke);
        this.FDisabledStroke.Assign(rtl.as(Source,$mod.TTMSFNCToolBarCustomButtonAppearance).FDisabledStroke);
        this.FHoverStroke.Assign(rtl.as(Source,$mod.TTMSFNCToolBarCustomButtonAppearance).FHoverStroke);
        this.FDownStroke.Assign(rtl.as(Source,$mod.TTMSFNCToolBarCustomButtonAppearance).FDownStroke);
        this.FRounding = rtl.as(Source,$mod.TTMSFNCToolBarCustomButtonAppearance).FRounding;
        this.FCorners = rtl.refSet(rtl.as(Source,$mod.TTMSFNCToolBarCustomButtonAppearance).FCorners);
        this.FShowInnerStroke = rtl.as(Source,$mod.TTMSFNCToolBarCustomButtonAppearance).FShowInnerStroke;
        this.FTransparent = rtl.as(Source,$mod.TTMSFNCToolBarCustomButtonAppearance).FTransparent;
        this.FFlatStyle = rtl.as(Source,$mod.TTMSFNCToolBarCustomButtonAppearance).FFlatStyle;
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    this.Create$1 = function (AOwner) {
      this.FOwner = AOwner;
      this.FCorners = rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight);
      this.FRounding = 3;
      this.FTransparent = false;
      this.FShowInnerStroke = true;
      this.FFlatStyle = false;
      this.FNormalFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient,pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(249,251,252),pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(230,235,235),pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(220,220,236),pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(220,225,236)]);
      this.FHoverFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient,pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(229,231,232),pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(210,215,215),pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(200,200,216),pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(200,205,216)]);
      this.FDownFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient,pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(219,221,222),pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(200,205,205),pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(190,190,206),pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(190,195,206)]);
      this.FDisabledFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,13882323,8421504,-1,-1]);
      this.FNormalStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,8421504,1.0]);
      this.FInnerStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,16777215,1.0]);
      this.FHoverStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,8421504,1.0]);
      this.FDownStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,8421504,1.0]);
      this.FDisabledStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,8421504,1.0]);
      this.FNormalFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FHoverFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FDownFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FDisabledFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FInnerStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FNormalStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FHoverStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FDownStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FDisabledStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FNormalFill");
      rtl.free(this,"FHoverFill");
      rtl.free(this,"FDownFill");
      rtl.free(this,"FDisabledFill");
      rtl.free(this,"FInnerStroke");
      rtl.free(this,"FNormalStroke");
      rtl.free(this,"FHoverStroke");
      rtl.free(this,"FDownStroke");
      rtl.free(this,"FDisabledStroke");
      pas.System.TObject.Destroy.call(this);
    };
  });
  rtl.createClass(this,"TTMSFNCToolBarButtonAppearance",this.TTMSFNCToolBarCustomButtonAppearance,function () {
    var $r = this.$rtti;
    $r.addProperty("Transparent",2,rtl.boolean,"FTransparent","SetTransparent",4,{Default: false});
    $r.addProperty("ShowInnerStroke",2,rtl.boolean,"FShowInnerStroke","SetShowInnerStroke",4,{Default: true});
    $r.addProperty("Rounding",14,rtl.double,"FRounding","SetRounding",4,{stored: "IsRoundingStored"});
    $r.addProperty("Corners",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsCorners"],"FCorners","SetCorners",4,{Default: rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight)});
    $r.addProperty("InnerStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FInnerStroke","SetInnerStroke");
    $r.addProperty("NormalFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FNormalFill","SetNormalFill");
    $r.addProperty("NormalStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FNormalStroke","SetNormalStroke");
    $r.addProperty("HoverFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FHoverFill","SetHoverFill");
    $r.addProperty("HoverStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FHoverStroke","SetHoverStroke");
    $r.addProperty("DownFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FDownFill","SetDownFill");
    $r.addProperty("DownStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FDownStroke","SetDownStroke");
    $r.addProperty("DisabledFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FDisabledFill","SetDisabledFill");
    $r.addProperty("DisabledStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FDisabledStroke","SetDisabledStroke");
    $r.addProperty("FlatStyle",2,rtl.boolean,"FFlatStyle","SetFlatStyle",4,{Default: false});
  });
  rtl.createClass(this,"TTMSFNCToolBarCompactAppearance",this.TTMSFNCToolBarCustomButtonAppearance,function () {
    var $r = this.$rtti;
    $r.addProperty("NormalFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FNormalFill","SetNormalFill");
    $r.addProperty("NormalStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FNormalStroke","SetNormalStroke");
    $r.addProperty("HoverFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FHoverFill","SetHoverFill");
    $r.addProperty("HoverStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FHoverStroke","SetHoverStroke");
    $r.addProperty("DownFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FDownFill","SetDownFill");
    $r.addProperty("DownStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FDownStroke","SetDownStroke");
    $r.addProperty("DisabledFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FDisabledFill","SetDisabledFill");
    $r.addProperty("DisabledStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FDisabledStroke","SetDisabledStroke");
    $r.addProperty("FlatStyle",2,rtl.boolean,"FFlatStyle","SetFlatStyle",4,{Default: false});
  });
  rtl.createClass(this,"TTMSFNCToolBarQuickMenuButtonAppearance",this.TTMSFNCToolBarCustomButtonAppearance,function () {
    var $r = this.$rtti;
    $r.addProperty("NormalFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FNormalFill","SetNormalFill");
    $r.addProperty("NormalStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FNormalStroke","SetNormalStroke");
    $r.addProperty("HoverFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FHoverFill","SetHoverFill");
    $r.addProperty("HoverStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FHoverStroke","SetHoverStroke");
    $r.addProperty("DownFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FDownFill","SetDownFill");
    $r.addProperty("DownStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FDownStroke","SetDownStroke");
    $r.addProperty("DisabledFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FDisabledFill","SetDisabledFill");
    $r.addProperty("DisabledStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FDisabledStroke","SetDisabledStroke");
    $r.addProperty("FlatStyle",2,rtl.boolean,"FFlatStyle","SetFlatStyle",4,{Default: false});
  });
  this.TTMSFNCToolBarElementState = {"0": "esNormal", esNormal: 0, "1": "esLarge", esLarge: 1};
  this.$rtti.$Enum("TTMSFNCToolBarElementState",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCToolBarElementState});
  rtl.createClass(this,"TTMSFNCCustomToolBarElement",pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$init.call(this);
      this.FBlockUpdate = false;
      this.FOnUpdateToolBar = null;
      this.FOnUpdateToolBarControl = null;
      this.FCanCopy = false;
      this.FState = 0;
      this.FLastElement = false;
      this.FControlIndex = 0;
    };
    this.$final = function () {
      this.FOnUpdateToolBar = undefined;
      this.FOnUpdateToolBarControl = undefined;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$final.call(this);
    };
    this.SetState = function (Value) {
      if (this.FState !== Value) {
        this.FState = Value;
        this.UpdateState();
      };
    };
    this.SetLastElement = function (Value) {
      if (this.FLastElement !== Value) {
        this.FLastElement = Value;
        this.UpdateToolBar();
      };
    };
    this.GetDocURL = function () {
      var Result = "";
      Result = pas["WEBLib.TMSFNCTypes"].TTMSFNCBaseDocURL + "tmsfncuipack/components/ttmsfnctoolbar";
      return Result;
    };
    this.UpdateState = function () {
    };
    this.UpdateToolBar = function () {
      if ((this.FOnUpdateToolBar != null) && !this.FBlockUpdate) this.FOnUpdateToolBar(this);
    };
    this.UpdateToolBarControl = function () {
      if (this.FOnUpdateToolBarControl != null) this.FOnUpdateToolBarControl(this);
    };
    this.VisibleChanging = function () {
      pas["WEBLib.Controls"].TControl.VisibleChanging.call(this);
      this.UpdateToolBar();
    };
    this.DefineProperties = function (Filer) {
      pas.Classes.TComponent.DefineProperties.apply(this,arguments);
      Filer.DefineProperty("ControlIndex",rtl.createCallback(this,"ReadControlIndex"),rtl.createCallback(this,"WriteControlIndex"),true);
    };
    this.ReadControlIndex = function (Reader) {
      this.FControlIndex = Reader.ReadInteger();
    };
    this.WriteControlIndex = function (Writer) {
      Writer.WriteInteger(this.FControlIndex);
    };
    this.UpdateControlAfterResize = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.UpdateControlAfterResize.call(this);
      this.UpdateToolBar();
    };
    this.Assign = function (Source) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Assign.apply(this,arguments);
      if ($mod.TTMSFNCCustomToolBarElement.isPrototypeOf(Source)) {
        this.FState = rtl.as(Source,$mod.TTMSFNCCustomToolBarElement).FState;
        this.FLastElement = rtl.as(Source,$mod.TTMSFNCCustomToolBarElement).FLastElement;
        this.FCanCopy = rtl.as(Source,$mod.TTMSFNCCustomToolBarElement).FCanCopy;
      };
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Create$1.apply(this,arguments);
      this.DisableBackground();
      this.FLastElement = false;
      this.FCanCopy = true;
      this.FState = $mod.TTMSFNCToolBarElementState.esNormal;
      return this;
    };
    this.Destroy = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Destroy.call(this);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.TTMSFNCToolBarButtonBitmapPosition = {"0": "bbpLeft", bbpLeft: 0, "1": "bbpTop", bbpTop: 1};
  this.$rtti.$Enum("TTMSFNCToolBarButtonBitmapPosition",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCToolBarButtonBitmapPosition});
  this.TTMSFNCToolBarButtonLayout = {"0": "bblNone", bblNone: 0, "1": "bblBitmap", bblBitmap: 1, "2": "bblLabel", bblLabel: 2, "3": "bblLarge", bblLarge: 3};
  this.$rtti.$Enum("TTMSFNCToolBarButtonLayout",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TTMSFNCToolBarButtonLayout});
  rtl.createClass(this,"TTMSFNCDefaultToolBarButton",this.TTMSFNCCustomToolBarElement,function () {
    this.$init = function () {
      $mod.TTMSFNCCustomToolBarElement.$init.call(this);
      this.FOldHeight = 0.0;
      this.FBitmapVisible = false;
      this.FText = "";
      this.FPopup = null;
      this.FPopupPlacement = 0;
      this.FDropDownHeight = 0.0;
      this.FDropDownWidth = 0.0;
      this.FDown = false;
      this.FHover = false;
      this.FPrevHover = false;
      this.FAppearance = null;
      this.FBitmapContainer = null;
      this.FBitmaps = null;
      this.FApplyName = false;
      this.FDropDownControl = null;
      this.FFont$1 = null;
      this.FOnBeforeDropDown = null;
      this.FCloseOnSelection = false;
      this.FDownState = false;
      this.FTextVisible = false;
      this.FOnCloseDropDown = null;
      this.FOnDropDown = null;
      this.FVerticalTextAlign = 0;
      this.FHorizontalTextAlign = 0;
      this.FWordWrapping = false;
      this.FTrimming = 0;
      this.FBitmapSize = 0.0;
      this.FStretchText = false;
      this.FDisabledBitmaps = null;
      this.FHoverBitmaps = null;
      this.FShowFocus$1 = false;
      this.FDropDownAutoWidth = false;
      this.FHoverFontColor = 0;
      this.FDownFontColor = 0;
      this.FDisabledFontColor = 0;
      this.FStretchBitmapIfNoText = false;
      this.FBitmapPosition = 0;
      this.FMaximumLayout = 0;
      this.FMinimumLayout = 0;
      this.FLayout = 0;
      this.FCompactLayout = 0;
      this.FLargeLayoutBitmapSize = 0.0;
      this.FLargeLayoutBitmaps = null;
      this.FLargeLayoutHoverBitmaps = null;
      this.FLargeLayoutDisabledBitmaps = null;
      this.FAutoBitmapSize = false;
      this.FLargeLayoutAutoBitmapSize = false;
      this.FUseStyledDropDownIcon = false;
    };
    this.$final = function () {
      this.FPopup = undefined;
      this.FAppearance = undefined;
      this.FBitmapContainer = undefined;
      this.FBitmaps = undefined;
      this.FDropDownControl = undefined;
      this.FFont$1 = undefined;
      this.FOnBeforeDropDown = undefined;
      this.FOnCloseDropDown = undefined;
      this.FOnDropDown = undefined;
      this.FDisabledBitmaps = undefined;
      this.FHoverBitmaps = undefined;
      this.FLargeLayoutBitmaps = undefined;
      this.FLargeLayoutHoverBitmaps = undefined;
      this.FLargeLayoutDisabledBitmaps = undefined;
      $mod.TTMSFNCCustomToolBarElement.$final.call(this);
    };
    this.SetAppearance = function (Value) {
      this.FAppearance.Assign(Value);
    };
    this.SetBitmapContainer = function (Value) {
      this.FBitmapContainer = Value;
      this.UpdateLayout();
      this.Invalidate();
    };
    this.SetBitmaps = function (Value) {
      this.FBitmaps.Assign(Value);
    };
    this.SetText = function (Value) {
      if (this.FText !== Value) {
        this.FText = Value;
        this.FTextVisible = Value !== "";
        this.UpdateLayout();
        this.Invalidate();
      };
    };
    this.SetDropDownHeight = function (Value) {
      this.FDropDownHeight = Value;
      if ((this.FPopup != null) && !this.FDropDownAutoWidth) this.FPopup.SetDropDownHeight(this.FDropDownHeight);
    };
    this.SetDropDownWidth = function (Value) {
      this.FDropDownWidth = Value;
      if (this.FPopup != null) this.FPopup.SetDropDownWidth(this.FDropDownWidth);
    };
    this.SetBitmapVisible = function (Value) {
      this.FBitmapVisible = Value;
      this.UpdateLayout();
      this.Invalidate();
    };
    this.SetTextVisible = function (Value) {
      if (this.FTextVisible !== Value) {
        this.FTextVisible = Value;
        this.UpdateLayout();
        this.Invalidate();
      };
    };
    this.SetFont$1 = function (Value) {
      this.FFont$1.Assign(Value);
    };
    this.SetDropDownControl = function (Value) {
      this.FDropDownControl = Value;
      if (this.FDropDownControl != null) {
        if (!(pas.Classes.TComponentStateItem.csDesigning in this.FComponentState)) {
          if (this.FPopup != null) {
            this.FPopup.SetContentControl(this.FDropDownControl);
            this.FPopup.FFocusedControl = this.FDropDownControl;
          };
        } else if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
          this.SetDropDownHeight(this.FDropDownControl.GetHeight());
          this.SetDropDownWidth(this.FDropDownControl.GetWidth());
        };
      };
    };
    this.SetCloseOnSelection = function (Value) {
      if (this.FCloseOnSelection !== Value) {
        this.FCloseOnSelection = Value;
      };
    };
    this.SetDownState = function (Value) {
      this.FDownState = Value;
      this.Invalidate();
    };
    this.IsDropDownHeightStored = function () {
      var Result = false;
      Result = this.FDropDownHeight !== 135;
      return Result;
    };
    this.IsDropDownWidthStored = function () {
      var Result = false;
      Result = this.FDropDownWidth !== 135;
      return Result;
    };
    this.SetHorizontalTextAlign = function (Value) {
      if (this.FHorizontalTextAlign !== Value) {
        this.FHorizontalTextAlign = Value;
        this.Invalidate();
      };
    };
    this.SetVerticalTextAlign = function (Value) {
      if (this.FVerticalTextAlign !== Value) {
        this.FVerticalTextAlign = Value;
        this.Invalidate();
      };
    };
    this.SetWordWrapping = function (Value) {
      if (this.FWordWrapping !== Value) {
        this.FWordWrapping = Value;
        this.Invalidate();
      };
    };
    this.SetTrimming = function (Value) {
      if (this.FTrimming !== Value) {
        this.FTrimming = Value;
        this.Invalidate();
      };
    };
    this.IsBitmapSizeStored = function () {
      var Result = false;
      Result = this.FBitmapSize !== 24;
      return Result;
    };
    this.SetBitmapSize = function (Value) {
      if (this.FBitmapSize !== Value) {
        this.FBitmapSize = Value;
        this.UpdateLayout();
        this.Invalidate();
      };
    };
    this.SetStretchText = function (Value) {
      if (this.FStretchText !== Value) {
        this.FStretchText = Value;
        this.UpdateLayout();
        this.Invalidate();
      };
    };
    this.SetDisabledBitmaps = function (Value) {
      this.FDisabledBitmaps.Assign(Value);
    };
    this.SetHoverBitmaps = function (Value) {
      this.FHoverBitmaps.Assign(Value);
    };
    this.GetBitmapContainer = function () {
      var Result = null;
      Result = this.FBitmapContainer;
      return Result;
    };
    this.SetShowFocus$1 = function (Value) {
      if (this.FShowFocus$1 !== Value) {
        this.FShowFocus$1 = Value;
        this.Invalidate();
      };
    };
    this.SetDropDownAutoWidth = function (Value) {
      if (this.FDropDownAutoWidth !== Value) {
        this.FDropDownAutoWidth = Value;
        if (this.FPopup != null) {
          if (this.FDropDownAutoWidth) {
            this.FPopup.SetDropDownWidth(this.GetWidth())}
           else this.FPopup.SetDropDownWidth(this.FDropDownWidth);
        };
      };
    };
    this.SetDisabledFontColor = function (Value) {
      if (this.FDisabledFontColor !== Value) {
        this.FDisabledFontColor = Value;
        this.Invalidate();
      };
    };
    this.SetDownFontColor = function (Value) {
      if (this.FDownFontColor !== Value) {
        this.FDownFontColor = Value;
        this.Invalidate();
      };
    };
    this.SetHoverFontColor = function (Value) {
      if (this.FHoverFontColor !== Value) {
        this.FHoverFontColor = Value;
        this.Invalidate();
      };
    };
    this.SetStretchBitmapIfNoText = function (Value) {
      if (this.FStretchBitmapIfNoText !== Value) {
        this.FStretchBitmapIfNoText = Value;
        this.UpdateLayout();
        this.Invalidate();
      };
    };
    this.SetBitmapPosition = function (Value) {
      if (this.FBitmapPosition !== Value) {
        this.FBitmapPosition = Value;
        this.Invalidate();
      };
    };
    this.SetMaximumLayout = function (Value) {
      if (this.FMaximumLayout !== Value) {
        this.FMaximumLayout = Value;
        this.UpdateToolBar();
      };
    };
    this.SetMinimumLayout = function (Value) {
      if (this.FMinimumLayout !== Value) {
        this.FMinimumLayout = Value;
        this.UpdateToolBar();
      };
    };
    this.SetLayout = function (Value) {
      if (this.FLayout !== Value) {
        this.FLayout = Value;
        this.UpdateLayout();
      };
    };
    this.SetCompactLayout = function (Value) {
      if (this.FCompactLayout !== Value) this.FCompactLayout = Value;
    };
    this.IsLargeLayoutBitmapSizeStored = function () {
      var Result = false;
      Result = this.FLargeLayoutBitmapSize !== 32;
      return Result;
    };
    this.SetLargeLayoutBitmaps = function (Value) {
      this.FLargeLayoutBitmaps.Assign(Value);
    };
    this.SetLargeLayoutBitmapSize = function (Value) {
      if (this.FLargeLayoutBitmapSize !== Value) {
        this.FLargeLayoutBitmapSize = Value;
        this.UpdateLayout();
        this.Invalidate();
      };
    };
    this.SetLargeLayoutDisabledBitmaps = function (Value) {
      this.FLargeLayoutDisabledBitmaps.Assign(Value);
    };
    this.SetLargeLayoutHoverBitmaps = function (Value) {
      this.FLargeLayoutHoverBitmaps.Assign(Value);
    };
    this.SetAutoBitmapSize = function (Value) {
      if (this.FAutoBitmapSize !== Value) {
        this.FAutoBitmapSize = Value;
        this.UpdateLayout();
        this.Invalidate();
      };
    };
    this.SetLargeLayoutAutoBitmapSize = function (Value) {
      if (this.FLargeLayoutAutoBitmapSize !== Value) {
        this.FLargeLayoutAutoBitmapSize = Value;
        this.UpdateLayout();
        this.Invalidate();
      };
    };
    this.SetUseStyledDropDownIcon = function (Value) {
      if (this.FUseStyledDropDownIcon !== Value) {
        this.FUseStyledDropDownIcon = Value;
        this.Invalidate();
      };
    };
    this.CanDrawDesignTime = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    this.HasHint = function () {
      var Result = false;
      Result = this.FHint !== "";
      return Result;
    };
    this.GetHintString = function () {
      var Result = "";
      Result = this.FHint;
      return Result;
    };
    this.GetText = function () {
      var Result = "";
      Result = this.FText;
      return Result;
    };
    this.GetTextSize = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TSizeF.$new();
      var g = null;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.cx = 0;
      Result.cy = 0;
      if (this.FTextVisible && (this.GetText() !== "")) {
        g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[1,1,this.FNativeCanvas,true]);
        if (!this.FNativeCanvas) g.BeginScene();
        g.FBitmapContainer = this.GetBitmapContainer();
        g.FOptimizedHTMLDrawing = this.FOptimizedHTMLDrawing;
        try {
          g.FFont.Assign(this.FFont$1);
          r.$assign(this.GetLocalRect());
          pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,this.ScalePaintValue(-2),this.ScalePaintValue(-2));
          Result.$assign(g.CalculateTextSize(this.GetText(),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FWordWrapping,true));
        } finally {
          if (!this.FNativeCanvas) g.EndScene();
          g = rtl.freeLoc(g);
        };
      };
      return Result;
    };
    this.UpdateControlAfterResize = function () {
      $mod.TTMSFNCCustomToolBarElement.UpdateControlAfterResize.call(this);
      if (this.FLayout === $mod.TTMSFNCToolBarButtonLayout.bblLarge) this.FOldHeight = this.GetHeight();
    };
    this.ApplyStyle = function () {
      var c = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ApplyStyle.call(this);
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleBackgroundFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FAppearance.FNormalFill.SetColor(c);
        this.FAppearance.FNormalFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        this.FAppearance.FDisabledFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(c,20));
        this.FAppearance.FDisabledFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        this.FAppearance.FInnerStroke.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Blend(this.FAppearance.FNormalFill.FColor,this.FAppearance.FNormalStroke.FColor,75));
        this.FAppearance.FInnerStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      };
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleTextFontColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) this.FFont$1.SetColor(c);
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleBackgroundStrokeColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FAppearance.FNormalStroke.SetColor(c);
        this.FAppearance.FDownStroke.SetColor(c);
        this.FAppearance.FDisabledStroke.SetColor(c);
        this.FAppearance.FNormalStroke.SetColor(c);
        this.FAppearance.FDownStroke.SetColor(c);
        this.FAppearance.FDisabledStroke.SetColor(c);
        this.FAppearance.FHoverStroke.SetColor(c);
      };
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleSelectionFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FAppearance.FHoverFill.SetColor(c);
        this.FAppearance.FHoverFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        this.FAppearance.FDownFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Blend(c,this.FFill.FColor,20));
        this.FAppearance.FDownFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      };
    };
    this.ResetToDefaultStyle = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ResetToDefaultStyle.call(this);
      this.FFont$1.SetColor(0);
      this.FAppearance.FNormalFill.SetColor(16777215);
      this.FAppearance.FHoverFill.SetColor(16777215);
      this.FAppearance.FDownFill.SetColor(16777215);
      this.FAppearance.FDisabledFill.SetColor(13882323);
      this.FAppearance.FNormalStroke.SetColor(8421504);
      this.FAppearance.FInnerStroke.SetColor(16777215);
      this.FAppearance.FHoverStroke.SetColor(8421504);
      this.FAppearance.FDownStroke.SetColor(8421504);
      this.FAppearance.FDisabledStroke.SetColor(8421504);
      this.FAppearance.FNormalFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient);
      this.FAppearance.FHoverFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient);
      this.FAppearance.FDownFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient);
      this.FAppearance.FDisabledFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FAppearance.FNormalStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FAppearance.FInnerStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FAppearance.FHoverStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FAppearance.FDownStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FAppearance.FDisabledStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FAppearance.FNormalFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(249,251,252));
      this.FAppearance.FNormalFill.SetColorTo(pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(230,235,235));
      this.FAppearance.FNormalFill.SetColorMirror(pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(220,220,236));
      this.FAppearance.FNormalFill.SetColorMirrorTo(pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(220,225,236));
      this.FAppearance.FHoverFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(229,231,232));
      this.FAppearance.FHoverFill.SetColorTo(pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(210,215,215));
      this.FAppearance.FHoverFill.SetColorMirror(pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(200,200,216));
      this.FAppearance.FHoverFill.SetColorMirrorTo(pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(200,205,216));
      this.FAppearance.FDownFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(219,221,222));
      this.FAppearance.FDownFill.SetColorTo(pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(200,205,205));
      this.FAppearance.FDownFill.SetColorMirror(pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(190,190,206));
      this.FAppearance.FDownFill.SetColorMirrorTo(pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(190,195,206));
    };
    this.SetAdaptToStyle = function (Value) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.SetAdaptToStyle.apply(this,arguments);
      if (this.FPopup != null) this.FPopup.SetAdaptToStyle(this.GetAdaptToStyle());
    };
    this.BitmapsChanged = function (Sender) {
      var bmp = null;
      bmp = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.GetScaledBitmap(this.FBitmaps,0,this.GetBitmapContainer());
      this.SetBitmapVisible((bmp != null) && !pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(bmp));
      if (!this.FBitmapVisible && (this.FLayout === $mod.TTMSFNCToolBarButtonLayout.bblLarge)) {
        bmp = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.GetScaledBitmap(this.FLargeLayoutBitmaps,0,this.GetBitmapContainer());
        this.SetBitmapVisible((bmp != null) && !pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(bmp));
      };
      this.Invalidate();
    };
    this.DoFontChanged = function (Sender) {
      this.Invalidate();
    };
    this.UpdateLayout = function () {
      var sz = pas["WEBLib.TMSFNCTypes"].TSizeF.$new();
      var w = 0.0;
      if ((this.FLayout === $mod.TTMSFNCToolBarButtonLayout.bblNone) || this.FBlockUpdate) return;
      this.FBlockUpdate = true;
      var $tmp = this.FLayout;
      if ($tmp === $mod.TTMSFNCToolBarButtonLayout.bblBitmap) {
        this.SetTextVisible(false);
        this.SetBitmapPosition($mod.TTMSFNCToolBarButtonBitmapPosition.bbpLeft);
        this.SetStretchText(false);
        this.SetHeight(Math.round(this.GetBitmapSize() + 6));
        this.SetWidth(Math.round(this.GetBitmapSize() + 6));
      } else if ($tmp === $mod.TTMSFNCToolBarButtonLayout.bblLabel) {
        this.SetTextVisible(true);
        this.SetBitmapPosition($mod.TTMSFNCToolBarButtonBitmapPosition.bbpLeft);
        this.SetStretchText(false);
        sz.$assign(this.GetTextSize());
        if (this.FBitmapVisible) {
          this.SetHeight(Math.round(Math.max(this.GetBitmapSize(),sz.cy) + 6));
          this.SetWidth(Math.round(this.GetBitmapSize() + sz.cx + 12));
        } else if (this.FTextVisible && (this.GetText() !== "")) {
          this.SetHeight(Math.round(sz.cy + 6));
          this.SetWidth(Math.round(sz.cx + 6));
        } else {
          this.SetWidth(75);
          this.SetHeight(24);
        };
      } else if ($tmp === $mod.TTMSFNCToolBarButtonLayout.bblLarge) {
        this.SetTextVisible(true);
        this.SetBitmapPosition($mod.TTMSFNCToolBarButtonBitmapPosition.bbpTop);
        this.SetStretchText(!this.FBitmapVisible);
        sz.$assign(this.GetTextSize());
        w = 30;
        if (this.FBitmapVisible) w = Math.max(w,this.GetLargeLayoutBitmapSize() + 6);
        if (this.FTextVisible && (this.GetText() !== "")) w = Math.max(w,sz.cx + 12);
        this.SetWidth(Math.round(w));
        if (this.FOldHeight !== -1) this.SetHeight(Math.round(this.FOldHeight));
      };
      this.FBlockUpdate = false;
      this.UpdateToolBar();
    };
    this.DoClosePopup = function (Sender) {
      if (this.FOnCloseDropDown != null) this.FOnCloseDropDown(this);
    };
    this.DoPopup = function (Sender) {
      this.InitializePopup();
    };
    this.InitializePopup = function () {
    };
    this.UpdateState = function () {
      var f = 0.0;
      $mod.TTMSFNCCustomToolBarElement.UpdateState.call(this);
      var $tmp = this.FState;
      if ($tmp === $mod.TTMSFNCToolBarElementState.esNormal) {
        f = 0.8}
       else if ($tmp === $mod.TTMSFNCToolBarElementState.esLarge) {
        f = 1.25}
       else {
        f = 1;
      };
      if (!(pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) {
        this.SetDropDownWidth(this.FDropDownWidth * f);
        this.SetDropDownHeight(this.FDropDownHeight * f);
        this.FFont$1.SetSize(Math.round(this.FFont$1.FSize * f));
        this.SetBounds(this.GetLeft(),this.GetTop(),Math.round(this.GetWidth() * f),Math.round(this.GetHeight() * f));
      };
    };
    this.ChangeDPIScale = function (M, D) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ChangeDPIScale.apply(this,arguments);
      this.BeginUpdate();
      this.FFont$1.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FFont$1.FHeight,M,D));
      this.SetBitmapSize(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FBitmapSize,M,D));
      this.SetLargeLayoutBitmapSize(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FLargeLayoutBitmapSize,M,D));
      if (this.FOldHeight !== -1) this.FOldHeight = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FOldHeight,M,D);
      this.FDropDownHeight = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FDropDownHeight,M,D);
      this.FDropDownWidth = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FDropDownWidth,M,D);
      this.FPopup.SetDropDownWidth(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FPopup.FDropDownWidth,M,D));
      this.FPopup.SetDropDownHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FPopup.FDropDownHeight,M,D));
      this.EndUpdate();
    };
    this.AppearanceChanged = function () {
      this.Invalidate();
    };
    this.Notification = function (AComponent, Operation) {
      pas["WEBLib.Menus"].TWebCustomControl.Notification.apply(this,arguments);
      if ((Operation === pas.Classes.TOperation.opRemove) && (AComponent === this.FBitmapContainer)) this.FBitmapContainer = null;
      if ((Operation === pas.Classes.TOperation.opRemove) && (AComponent === this.FDropDownControl)) this.FDropDownControl = null;
    };
    this.SetName = function (Value) {
      var ChangeText = false;
      ChangeText = !(pas.Classes.TComponentStateItem.csLoading in this.FComponentState) && (this.FName === this.GetText()) && (!(this.FOwner != null) || !pas.Classes.TComponent.isPrototypeOf(this.FOwner) || !(pas.Classes.TComponentStateItem.csLoading in this.FOwner.FComponentState));
      pas["WEBLib.Controls"].TCustomControl.SetName.call(this,Value);
      if (ChangeText && this.FApplyName && this.CanChangeText()) this.SetText(pas.SysUtils.StringReplace(this.GetText(),"TMSFNCToolBar","",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll)));
    };
    this.HandleMouseDown = function (Button, Shift, X, Y) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseDown.apply(this,arguments);
      if (this.CanFocus()) this.SetFocus();
      this.FDown = true;
      this.Invalidate();
    };
    this.HandleMouseMove = function (Shift, X, Y) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseMove.apply(this,arguments);
      this.FHover = true;
      if (this.FPrevHover !== this.FHover) this.Invalidate();
      this.FPrevHover = this.FHover;
    };
    this.HandleMouseUp = function (Button, Shift, X, Y) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseUp.apply(this,arguments);
      this.FDown = false;
      this.Invalidate();
    };
    this.HandleKeyUp = function (Key, Shift) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleKeyUp.apply(this,arguments);
      if (rtl.neSet(Shift,{})) return;
      var $tmp = Key.get();
      if (($tmp === 13) || ($tmp === 115)) {
        if (this.CanDropDown()) this.DropDown();
      };
    };
    this.HandleKeyDown = function (Key, Shift) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleKeyDown.apply(this,arguments);
      var $tmp = Key.get();
      if ($tmp === 36) {
        this.SelectFirstValue()}
       else if ($tmp === 35) {
        this.SelectLastValue()}
       else if (($tmp === 38) || ($tmp === 37)) {
        this.SelectPreviousValue()}
       else if (($tmp === 40) || ($tmp === 39)) {
        this.SelectNextValue()}
       else if ($tmp === 32) this.Click();
    };
    this.HandleKeyPress = function (Key) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleKeyPress.apply(this,arguments);
      if ((Key.get() >= " ") && !(Key.get().charCodeAt() in rtl.createSet(113,13,32,27,36,35,38,37,40,39))) this.SelectValueWithCharacter(Key.get());
    };
    this.HandleMouseEnter = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseEnter.call(this);
    };
    this.HandleMouseLeave = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseLeave.call(this);
      this.FDown = false;
      this.FHover = false;
      this.FPrevHover = false;
      this.Invalidate();
    };
    this.SelectFirstValue = function () {
    };
    this.SelectValueWithCharacter = function (ACharacter) {
    };
    this.SelectLastValue = function () {
    };
    this.SelectNextValue = function () {
    };
    this.SelectPreviousValue = function () {
    };
    this.DrawText = function (AGraphics) {
      var tr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var st = null;
      if (!this.FTextVisible || (this.GetText() === "")) return;
      tr.$assign(this.GetTextRect());
      st = AGraphics.SaveState(false);
      try {
        AGraphics.ClipRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(tr));
        AGraphics.FFont.Assign(this.FFont$1);
        if (this.FEnabled) {
          if ((this.FDown || this.FDownState) && (this.FDownFontColor !== -1)) {
            AGraphics.FFont.SetColor(this.FDownFontColor)}
           else if (this.FHover && (this.FHoverFontColor !== -1)) AGraphics.FFont.SetColor(this.FHoverFontColor);
        } else if (this.FDisabledFontColor !== -1) AGraphics.FFont.SetColor(this.FDisabledFontColor);
        AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(tr),this.GetText(),this.FWordWrapping,this.FHorizontalTextAlign,this.FVerticalTextAlign,this.FTrimming,0,-1,-1,true,false,-1,-1);
      } finally {
        AGraphics.RestoreState(st,false);
      };
    };
    this.DrawBitmap = function (AGraphics, ARect) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var bmpa = null;
      var bmp = null;
      var g = null;
      var x = 0;
      var y = 0;
      var bs = 0.0;
      var s = false;
      if (!this.FBitmapVisible) return;
      r.$assign(this.GetBitmapRect$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect)));
      if ($mod.TTMSFNCToolBarDropDownButton.isPrototypeOf(this) && this.GetAdaptToStyle() && this.FUseStyledDropDownIcon) {
        bmpa = pas["WEBLib.Graphics"].TBitmap.$create("Create$3");
        bmpa.SetSize(this.ScalePaintValue(7),this.ScalePaintValue(7));
        g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("Create$1",[bmpa.GetCanvas(),false]);
        try {
          g.BeginScene();
          g.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
          g.FStroke.SetColor(pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.DefaultSelectionFillColor);
          for (var $l = this.ScalePaintValue(1), $end = this.ScalePaintValue(5); $l <= $end; $l++) {
            y = $l;
            x = Math.max(0,y - this.ScalePaintValue(2));
            g.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(x,y)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(bmpa.GetWidth() - 1 - x,y)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
            if (x >= (bmpa.GetWidth() - 1 - x)) break;
          };
        } finally {
          g.EndScene();
          g = rtl.freeLoc(g);
        };
        try {
          bmp = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
          try {
            bmp.Assign(bmpa);
            AGraphics.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),bmp,true,false,true,false);
          } finally {
            bmp = rtl.freeLoc(bmp);
          };
        } finally {
          bmpa = rtl.freeLoc(bmpa);
        };
      } else {
        AGraphics.FBitmapContainer = this.GetBitmapContainer();
        bs = this.GetBitmapSize();
        var $tmp = this.FLayout;
        if ($tmp === $mod.TTMSFNCToolBarButtonLayout.bblLarge) bs = this.GetLargeLayoutBitmapSize();
        s = false;
        if (!this.FTextVisible || (this.GetText() === "")) if (!((bs !== -1) && !this.FStretchBitmapIfNoText)) s = true;
        var $tmp1 = this.FLayout;
        if ($tmp1 === $mod.TTMSFNCToolBarButtonLayout.bblLarge) {
          if (this.FEnabled) {
            if (this.FHover && (this.FLargeLayoutHoverBitmaps.GetCount() > 0)) {
              AGraphics.DrawScaledBitmap(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FLargeLayoutHoverBitmaps,this.FResourceScaleFactor,true,s,true,false)}
             else if (this.FHover && (this.FHoverBitmaps.GetCount() > 0)) {
              AGraphics.DrawScaledBitmap(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FHoverBitmaps,this.FResourceScaleFactor,true,s,true,false)}
             else if (this.FLargeLayoutBitmaps.GetCount() > 0) {
              AGraphics.DrawScaledBitmap(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FLargeLayoutBitmaps,this.FResourceScaleFactor,true,s,true,false)}
             else AGraphics.DrawScaledBitmap(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FBitmaps,this.FResourceScaleFactor,true,s,true,false);
          } else {
            if (this.FLargeLayoutDisabledBitmaps.GetCount() > 0) {
              AGraphics.DrawScaledBitmap(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FLargeLayoutDisabledBitmaps,this.FResourceScaleFactor,true,s,true,false)}
             else if (this.FDisabledBitmaps.GetCount() > 0) {
              AGraphics.DrawScaledBitmap(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FDisabledBitmaps,this.FResourceScaleFactor,true,s,true,false)}
             else AGraphics.DrawScaledBitmap(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FBitmaps,this.FResourceScaleFactor,true,s,true,false);
          };
        } else {
          if (this.FEnabled) {
            if (this.FHover && (this.FHoverBitmaps.GetCount() > 0)) {
              AGraphics.DrawScaledBitmap(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FHoverBitmaps,this.FResourceScaleFactor,true,s,true,false)}
             else AGraphics.DrawScaledBitmap(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FBitmaps,this.FResourceScaleFactor,true,s,true,false);
          } else if (this.FDisabledBitmaps.GetCount() > 0) {
            AGraphics.DrawScaledBitmap(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FDisabledBitmaps,this.FResourceScaleFactor,true,s,true,false)}
           else AGraphics.DrawScaledBitmap(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FBitmaps,this.FResourceScaleFactor,true,s,true,false);
        };
      };
    };
    this.DrawButton = function (AGraphics) {
    };
    this.CanDropDown = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    this.CanChangeText = function () {
      var Result = false;
      Result = true;
      return Result;
    };
    this.GetTextRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var bmpr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var dr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.$assign(this.GetLocalRect());
      bmpr.$assign(this.GetBitmapRect());
      dr.$assign(this.GetDropDownRect());
      if (!this.FStretchText) {
        var $tmp = this.FBitmapPosition;
        if ($tmp === $mod.TTMSFNCToolBarButtonBitmapPosition.bbpLeft) {
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(bmpr.Right + 3,r.Top + 3,dr.Left - 3,r.Bottom - 3))}
         else if ($tmp === $mod.TTMSFNCToolBarButtonBitmapPosition.bbpTop) Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + 3,bmpr.Bottom + 3,dr.Left - 3,r.Bottom - 3));
      } else Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + 3,r.Top + 3,dr.Left - 3,r.Bottom - 3));
      return Result;
    };
    this.GetDropDownRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.$assign(this.GetLocalRect());
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Right,r.Top,r.Right,r.Bottom));
      return Result;
    };
    this.GetBitmapRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(this.GetBitmapRect$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.GetLocalRect())));
      return Result;
    };
    this.GetBitmapRect$1 = function (ARect) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var bs = 0.0;
      bs = this.GetBitmapSize();
      var $tmp = this.FLayout;
      if ($tmp === $mod.TTMSFNCToolBarButtonLayout.bblLarge) bs = this.GetLargeLayoutBitmapSize();
      r.$assign(ARect);
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top,r.Left,r.Bottom));
      if (this.FBitmapVisible) {
        var $tmp1 = this.FBitmapPosition;
        if ($tmp1 === $mod.TTMSFNCToolBarButtonBitmapPosition.bbpLeft) {
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Result.Left + 3,Result.Top + 3,Result.Left + 3 + bs,Result.Bottom - 3))}
         else if ($tmp1 === $mod.TTMSFNCToolBarButtonBitmapPosition.bbpTop) Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Result.Left + 3,Result.Top + 3,Result.Right - 3,Result.Top + 3 + bs));
      };
      return Result;
    };
    this.GetBitmapSize = function () {
      var Result = 0.0;
      var bmp = null;
      Result = this.FBitmapSize;
      if (this.FAutoBitmapSize) {
        bmp = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.GetScaledBitmap(this.FBitmaps,0,this.GetBitmapContainer());
        if ((bmp != null) && !pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(bmp)) Result = Math.max(bmp.GetHeight(),bmp.GetWidth());
      };
      return Result;
    };
    this.GetLargeLayoutBitmapSize = function () {
      var Result = 0.0;
      var bmp = null;
      Result = this.FLargeLayoutBitmapSize;
      if (this.FLargeLayoutAutoBitmapSize) {
        bmp = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.GetScaledBitmap(this.FLargeLayoutBitmaps,0,this.GetBitmapContainer());
        if ((bmp != null) && !pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(bmp)) Result = Math.max(bmp.GetHeight(),bmp.GetWidth());
      };
      return Result;
    };
    this.Assign = function (Source) {
      $mod.TTMSFNCCustomToolBarElement.Assign.apply(this,arguments);
      if ($mod.TTMSFNCDefaultToolBarButton.isPrototypeOf(Source)) {
        this.FLayout = rtl.as(Source,$mod.TTMSFNCDefaultToolBarButton).FLayout;
        this.FCompactLayout = rtl.as(Source,$mod.TTMSFNCDefaultToolBarButton).FCompactLayout;
        this.FMinimumLayout = rtl.as(Source,$mod.TTMSFNCDefaultToolBarButton).FMinimumLayout;
        this.FMaximumLayout = rtl.as(Source,$mod.TTMSFNCDefaultToolBarButton).FMaximumLayout;
        this.FBitmapPosition = rtl.as(Source,$mod.TTMSFNCDefaultToolBarButton).FBitmapPosition;
        this.FBitmapSize = rtl.as(Source,$mod.TTMSFNCDefaultToolBarButton).FBitmapSize;
        this.FLargeLayoutBitmapSize = rtl.as(Source,$mod.TTMSFNCDefaultToolBarButton).FLargeLayoutBitmapSize;
        this.FAutoBitmapSize = rtl.as(Source,$mod.TTMSFNCDefaultToolBarButton).FAutoBitmapSize;
        this.FLargeLayoutAutoBitmapSize = rtl.as(Source,$mod.TTMSFNCDefaultToolBarButton).FLargeLayoutAutoBitmapSize;
        this.FStretchBitmapIfNoText = rtl.as(Source,$mod.TTMSFNCDefaultToolBarButton).FStretchBitmapIfNoText;
        this.FAppearance.Assign(rtl.as(Source,$mod.TTMSFNCDefaultToolBarButton).FAppearance);
        this.FBitmapContainer = rtl.as(Source,$mod.TTMSFNCDefaultToolBarButton).GetBitmapContainer();
        this.FBitmaps.Assign(rtl.as(Source,$mod.TTMSFNCDefaultToolBarButton).FBitmaps);
        this.FDisabledBitmaps.Assign(rtl.as(Source,$mod.TTMSFNCDefaultToolBarButton).FDisabledBitmaps);
        this.FLargeLayoutHoverBitmaps.Assign(rtl.as(Source,$mod.TTMSFNCDefaultToolBarButton).FLargeLayoutHoverBitmaps);
        this.FLargeLayoutBitmaps.Assign(rtl.as(Source,$mod.TTMSFNCDefaultToolBarButton).FLargeLayoutBitmaps);
        this.FLargeLayoutDisabledBitmaps.Assign(rtl.as(Source,$mod.TTMSFNCDefaultToolBarButton).FLargeLayoutDisabledBitmaps);
        this.FHoverBitmaps.Assign(rtl.as(Source,$mod.TTMSFNCDefaultToolBarButton).FHoverBitmaps);
        this.FBitmapVisible = rtl.as(Source,$mod.TTMSFNCDefaultToolBarButton).FBitmapVisible;
        this.FText = rtl.as(Source,$mod.TTMSFNCDefaultToolBarButton).GetText();
        this.FTextVisible = rtl.as(Source,$mod.TTMSFNCDefaultToolBarButton).FTextVisible;
        this.FDropDownHeight = rtl.as(Source,$mod.TTMSFNCDefaultToolBarButton).FDropDownHeight;
        this.FDropDownWidth = rtl.as(Source,$mod.TTMSFNCDefaultToolBarButton).FDropDownWidth;
        this.FDropDownAutoWidth = rtl.as(Source,$mod.TTMSFNCDefaultToolBarButton).FDropDownAutoWidth;
        this.FWordWrapping = rtl.as(Source,$mod.TTMSFNCDefaultToolBarButton).FWordWrapping;
        this.FHorizontalTextAlign = rtl.as(Source,$mod.TTMSFNCDefaultToolBarButton).FHorizontalTextAlign;
        this.FVerticalTextAlign = rtl.as(Source,$mod.TTMSFNCDefaultToolBarButton).FVerticalTextAlign;
        this.FTrimming = rtl.as(Source,$mod.TTMSFNCDefaultToolBarButton).FTrimming;
        this.FFont$1.Assign(rtl.as(Source,$mod.TTMSFNCDefaultToolBarButton).FFont$1);
        this.FHoverFontColor = rtl.as(Source,$mod.TTMSFNCDefaultToolBarButton).FHoverFontColor;
        this.FDownFontColor = rtl.as(Source,$mod.TTMSFNCDefaultToolBarButton).FDownFontColor;
        this.FDisabledFontColor = rtl.as(Source,$mod.TTMSFNCDefaultToolBarButton).FDisabledFontColor;
        this.FStretchText = rtl.as(Source,$mod.TTMSFNCDefaultToolBarButton).FStretchText;
        this.Invalidate();
      };
    };
    this.Create$1 = function (AOwner) {
      $mod.TTMSFNCCustomToolBarElement.Create$1.apply(this,arguments);
      this.FUseStyledDropDownIcon = true;
      this.FOldHeight = -1;
      this.FLayout = $mod.TTMSFNCToolBarButtonLayout.bblNone;
      this.FCompactLayout = $mod.TTMSFNCToolBarButtonLayout.bblNone;
      this.FMinimumLayout = $mod.TTMSFNCToolBarButtonLayout.bblBitmap;
      this.FMaximumLayout = $mod.TTMSFNCToolBarButtonLayout.bblLarge;
      this.FFont$1 = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FFont$1.FOnChanged = rtl.createCallback(this,"DoFontChanged");
      this.FHoverFontColor = -1;
      this.FDownFontColor = -1;
      this.FDisabledFontColor = -1;
      this.FDownState = false;
      this.FApplyName = true;
      this.FCloseOnSelection = true;
      this.FBitmapSize = 24;
      this.FLargeLayoutBitmapSize = 32;
      this.FAutoBitmapSize = false;
      this.FLargeLayoutAutoBitmapSize = false;
      this.FStretchBitmapIfNoText = true;
      this.FStretchText = false;
      this.FDropDownWidth = 135;
      this.FDropDownHeight = 135;
      this.FDropDownAutoWidth = false;
      this.FPopup = pas["WEBLib.TMSFNCPopup"].TTMSFNCPopup.$create("Create$1",[this]);
      this.FPopup.SetDragWithParent(true);
      this.FPopup.SetDropDownWidth(this.FDropDownWidth);
      this.FPopup.SetDropDownHeight(this.FDropDownHeight);
      this.FPopup.FOnPopup = rtl.createCallback(this,"DoPopup");
      this.FPopup.FOnClosePopup = rtl.createCallback(this,"DoClosePopup");
      this.FPopupPlacement = pas["WEBLib.TMSFNCPopup"].TTMSFNCPopupPlacement.ppBottom;
      this.FBitmaps = pas["WEBLib.TMSFNCTypes"].TTMSFNCScaledBitmaps.$create("Create$3",[this]);
      this.FBitmaps.FOnChange = rtl.createCallback(this,"BitmapsChanged");
      this.FDisabledBitmaps = pas["WEBLib.TMSFNCTypes"].TTMSFNCScaledBitmaps.$create("Create$3",[this]);
      this.FDisabledBitmaps.FOnChange = rtl.createCallback(this,"BitmapsChanged");
      this.FHoverBitmaps = pas["WEBLib.TMSFNCTypes"].TTMSFNCScaledBitmaps.$create("Create$3",[this]);
      this.FHoverBitmaps.FOnChange = rtl.createCallback(this,"BitmapsChanged");
      this.FLargeLayoutBitmaps = pas["WEBLib.TMSFNCTypes"].TTMSFNCScaledBitmaps.$create("Create$3",[this]);
      this.FLargeLayoutBitmaps.FOnChange = rtl.createCallback(this,"BitmapsChanged");
      this.FLargeLayoutDisabledBitmaps = pas["WEBLib.TMSFNCTypes"].TTMSFNCScaledBitmaps.$create("Create$3",[this]);
      this.FLargeLayoutDisabledBitmaps.FOnChange = rtl.createCallback(this,"BitmapsChanged");
      this.FLargeLayoutHoverBitmaps = pas["WEBLib.TMSFNCTypes"].TTMSFNCScaledBitmaps.$create("Create$3",[this]);
      this.FLargeLayoutHoverBitmaps.FOnChange = rtl.createCallback(this,"BitmapsChanged");
      this.FAppearance = $mod.TTMSFNCToolBarButtonAppearance.$create("Create$1",[this]);
      this.FTextVisible = true;
      this.FBitmapVisible = false;
      this.FWordWrapping = false;
      this.FHorizontalTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      this.FVerticalTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      this.FTrimming = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttCharacter;
      this.FBitmapPosition = $mod.TTMSFNCToolBarButtonBitmapPosition.bbpLeft;
      this.SetWidth(100);
      this.SetHeight(24);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FFont$1");
      rtl.free(this,"FPopup");
      rtl.free(this,"FBitmaps");
      rtl.free(this,"FDisabledBitmaps");
      rtl.free(this,"FHoverBitmaps");
      rtl.free(this,"FLargeLayoutBitmaps");
      rtl.free(this,"FLargeLayoutDisabledBitmaps");
      rtl.free(this,"FLargeLayoutHoverBitmaps");
      rtl.free(this,"FAppearance");
      $mod.TTMSFNCCustomToolBarElement.Destroy.call(this);
    };
    this.Draw = function (AGraphics, ARect) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Draw.apply(this,arguments);
      if (!this.FAppearance.FTransparent) {
        if (this.FEnabled) {
          if (this.FDown || this.FDownState) {
            AGraphics.FFill.Assign(this.FAppearance.FDownFill);
            AGraphics.FStroke.Assign(this.FAppearance.FDownStroke);
          } else if (this.FHover) {
            AGraphics.FFill.Assign(this.FAppearance.FHoverFill);
            AGraphics.FStroke.Assign(this.FAppearance.FHoverStroke);
          } else {
            AGraphics.FFill.Assign(this.FAppearance.FNormalFill);
            AGraphics.FStroke.Assign(this.FAppearance.FNormalStroke);
          };
        } else {
          AGraphics.FFill.Assign(this.FAppearance.FDisabledFill);
          AGraphics.FStroke.Assign(this.FAppearance.FDisabledStroke);
        };
        r.$assign(this.GetLocalRect());
        if (this.FAppearance.FFlatStyle) {
          AGraphics.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
          AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        } else AGraphics.DrawRoundRectangle$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FAppearance.FRounding,rtl.refSet(this.FAppearance.FCorners),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        if (this.FAppearance.FShowInnerStroke && !this.FAppearance.FFlatStyle) {
          pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,-1,-1);
          AGraphics.FStroke.Assign(this.FAppearance.FInnerStroke);
          AGraphics.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
          AGraphics.DrawRoundRectangle$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FAppearance.FRounding,rtl.refSet(this.FAppearance.FCorners),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        };
      };
      this.DrawBitmap(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect));
      this.DrawText(AGraphics);
      this.DrawButton(AGraphics);
      if (this.FShowFocus$1 && this.IsFocused()) {
        r.$assign(this.GetTextRect());
        AGraphics.DrawFocusRectangle$3(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),0,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
      };
      if (this.IsDesignTime() && this.CanDrawDesignTime()) AGraphics.DrawFocusRectangle$3(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),0,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
    };
    this.DropDown = function () {
      if (!(this.FPopup != null)) return;
      this.FPopup.SetPlacementControl(this);
      if (!this.FPopup.FIsOpen) {
        if (this.FOnBeforeDropDown != null) this.FOnBeforeDropDown(this);
        if (this.FDropDownAutoWidth) this.FPopup.SetDropDownWidth(this.GetWidth());
        this.FPopup.SetPlacement(this.FPopupPlacement);
        this.FPopup.SetIsOpen(true);
        if (this.FOnDropDown != null) this.FOnDropDown(this);
      } else this.FPopup.SetIsOpen(false);
    };
    this.CloseDropDown = function () {
      if (!(this.FPopup != null)) return;
      if (this.FPopup.FIsOpen) this.FPopup.SetIsOpen(false);
    };
    this.GetPopupControl = function () {
      var Result = null;
      Result = this.FPopup;
      return Result;
    };
    this.GetBitmap = function () {
      var Result = null;
      Result = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.GetScaledBitmap(this.FBitmaps,0,this.FBitmapContainer);
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.TTMSFNCToolBarButtonDropDownKind = {"0": "ddkNormal", ddkNormal: 0, "1": "ddkDropDown", ddkDropDown: 1, "2": "ddkDropDownButton", ddkDropDownButton: 2};
  this.$rtti.$Enum("TTMSFNCToolBarButtonDropDownKind",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCToolBarButtonDropDownKind});
  this.TTMSFNCToolBarButtonDropDownPosition = {"0": "ddpRight", ddpRight: 0, "1": "ddpBottom", ddpBottom: 1};
  this.$rtti.$Enum("TTMSFNCToolBarButtonDropDownPosition",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCToolBarButtonDropDownPosition});
  rtl.createClass(this,"TTMSFNCToolBarDropDownButton",this.TTMSFNCDefaultToolBarButton,function () {
    this.$init = function () {
      $mod.TTMSFNCDefaultToolBarButton.$init.call(this);
      this.FDefaultStyle = false;
    };
    this.SetDefaultStyle = function (Value) {
      if (this.FDefaultStyle !== Value) {
        this.FDefaultStyle = Value;
        this.Invalidate();
      };
    };
    this.RegisterRuntimeClasses = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClass($mod.TTMSFNCToolBarDropDownButton);
    };
    this.DrawBitmap = function (AGraphics, ARect) {
      var bmp = null;
      var bmpa = null;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var g = null;
      if (this.FDefaultStyle) {
        r.$assign(ARect);
        if (!((this.FOwner != null) && $mod.TTMSFNCCustomToolBarButton.isPrototypeOf(this.FOwner) && (rtl.as(this.FOwner,$mod.TTMSFNCCustomToolBarButton).FDropDownPosition === $mod.TTMSFNCToolBarButtonDropDownPosition.ddpBottom))) pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,this.ScalePaintValue(-2),this.ScalePaintValue(-2));
        $mod.TTMSFNCDefaultToolBarButton.DrawBitmap.call(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r));
      } else {
        bmpa = pas["WEBLib.Graphics"].TBitmap.$create("Create$3");
        bmpa.SetSize(7,7);
        g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("Create$1",[bmpa.GetCanvas(),false]);
        try {
          g.BeginScene();
          g.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
          g.FStroke.SetColor(11119017);
          g.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(0,1)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(6,1)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
          g.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(0,2)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(6,2)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
          g.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(1,3)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(5,3)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
          g.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(2,4)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(4,4)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
          g.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(3,5)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(3,5)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
        } finally {
          g.EndScene();
          g = rtl.freeLoc(g);
        };
        try {
          r.$assign(ARect);
          bmp = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
          try {
            bmp.Assign(bmpa);
            AGraphics.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),bmp,true,false,true,false);
          } finally {
            bmp = rtl.freeLoc(bmp);
          };
        } finally {
          bmpa = rtl.freeLoc(bmpa);
        };
      };
    };
    this.GetBitmapRect$1 = function (ARect) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.$assign(ARect);
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + 3,r.Top + 3,r.Right - 3,r.Bottom - 3));
      return Result;
    };
    this.Create$1 = function (AOwner) {
      $mod.TTMSFNCDefaultToolBarButton.Create$1.apply(this,arguments);
      this.FDefaultStyle = true;
      return this;
    };
    this.LoadSettingsFromFile = function (AFileName) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.LoadSettingsFromFile.apply(this,arguments);
      this.SetDefaultStyle(false);
    };
    this.LoadSettingsFromStream = function (AStream) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.LoadSettingsFromStream.apply(this,arguments);
      this.SetDefaultStyle(false);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("DefaultStyle",2,rtl.boolean,"FDefaultStyle","SetDefaultStyle",4,{Default: true});
    $r.addProperty("UseStyledDropDownIcon",2,rtl.boolean,"FUseStyledDropDownIcon","SetUseStyledDropDownIcon",4,{Default: true});
    $r.addProperty("Font",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FFont$1","SetFont$1");
    $r.addProperty("Text",3,rtl.string,"GetText","SetText");
    $r.addProperty("ShowFocus",2,rtl.boolean,"FShowFocus$1","SetShowFocus$1",4,{Default: false});
    $r.addProperty("TextVisible",2,rtl.boolean,"FTextVisible","SetTextVisible",4,{Default: true});
    $r.addProperty("StretchText",2,rtl.boolean,"FStretchText","SetStretchText",4,{Default: false});
    $r.addProperty("HoverFontColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FHoverFontColor","SetHoverFontColor",4,{Default: -1});
    $r.addProperty("DownFontColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FDownFontColor","SetDownFontColor",4,{Default: -1});
    $r.addProperty("DisabledFontColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FDisabledFontColor","SetDisabledFontColor",4,{Default: -1});
    $r.addProperty("WordWrapping",2,rtl.boolean,"FWordWrapping","SetWordWrapping",4,{Default: false});
    $r.addProperty("HorizontalTextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FHorizontalTextAlign","SetHorizontalTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter});
    $r.addProperty("VerticalTextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FVerticalTextAlign","SetVerticalTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter});
    $r.addProperty("Trimming",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextTrimming"],"FTrimming","SetTrimming",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttCharacter});
    $r.addProperty("Bitmaps",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCScaledBitmaps"],"FBitmaps","SetBitmaps");
    $r.addProperty("DisabledBitmaps",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCScaledBitmaps"],"FDisabledBitmaps","SetDisabledBitmaps");
    $r.addProperty("HoverBitmaps",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCScaledBitmaps"],"FHoverBitmaps","SetHoverBitmaps");
    $r.addProperty("BitmapVisible",2,rtl.boolean,"FBitmapVisible","SetBitmapVisible",4,{Default: false});
    $r.addProperty("BitmapContainer",3,pas["WEBLib.TMSFNCBitmapContainer"].$rtti["TTMSFNCBitmapContainer"],"GetBitmapContainer","SetBitmapContainer");
    $r.addProperty("State",2,$mod.$rtti["TTMSFNCToolBarElementState"],"FState","SetState",4,{Default: $mod.TTMSFNCToolBarElementState.esNormal});
    $r.addProperty("LastElement",2,rtl.boolean,"FLastElement","SetLastElement",4,{Default: false});
    $r.addProperty("Appearance",2,$mod.$rtti["TTMSFNCToolBarButtonAppearance"],"FAppearance","SetAppearance");
  });
  this.$rtti.$ClassRef("TTMSFNCToolBarDropDownButtonClass",{instancetype: this.$rtti["TTMSFNCToolBarDropDownButton"]});
  rtl.createClass(this,"TTMSFNCCustomToolBarButton",this.TTMSFNCDefaultToolBarButton,function () {
    this.$init = function () {
      $mod.TTMSFNCDefaultToolBarButton.$init.call(this);
      this.FDropDownButton = null;
      this.FDropDownKind = 0;
      this.FDropDownPosition = 0;
      this.FHidden = false;
      this.FAutoOptionsMenuText = "";
    };
    this.$final = function () {
      this.FDropDownButton = undefined;
      $mod.TTMSFNCDefaultToolBarButton.$final.call(this);
    };
    this.SetDropDownKind = function (Value) {
      if (this.FDropDownKind !== Value) {
        this.FDropDownKind = Value;
        if (this.FDropDownButton != null) {
          var $tmp = this.FDropDownKind;
          if ($tmp === $mod.TTMSFNCToolBarButtonDropDownKind.ddkNormal) {
            this.FDropDownButton.SetVisible(false);
            this.FDropDownButton.SetParent(null);
            this.FDropDownButton.FAppearance.SetTransparent(false);
          } else if ($tmp === $mod.TTMSFNCToolBarButtonDropDownKind.ddkDropDown) {
            this.FDropDownButton.SetVisible(false);
            this.FDropDownButton.SetParent(this);
            this.FDropDownButton.FAppearance.SetTransparent(true);
          } else if ($tmp === $mod.TTMSFNCToolBarButtonDropDownKind.ddkDropDownButton) {
            this.FDropDownButton.SetVisible(true);
            this.FDropDownButton.SetParent(this);
            this.FDropDownButton.FAppearance.SetTransparent(false);
          };
        };
        this.Invalidate();
      };
    };
    this.SetDropDownPosition = function (Value) {
      var sc = 0.0;
      if (this.FDropDownPosition !== Value) {
        sc = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetDPIScale(this,96);
        this.FDropDownPosition = Value;
        if (this.FDropDownButton != null) {
          var $tmp = Value;
          if ($tmp === $mod.TTMSFNCToolBarButtonDropDownPosition.ddpRight) {
            this.FDropDownButton.SetAlign(pas["WEBLib.Controls"].TAlign.alRight);
            this.FDropDownButton.SetWidth(Math.round(sc * 17));
            this.FDropDownButton.FAppearance.SetCorners(rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight));
          } else if ($tmp === $mod.TTMSFNCToolBarButtonDropDownPosition.ddpBottom) {
            this.FDropDownButton.SetAlign(pas["WEBLib.Controls"].TAlign.alBottom);
            this.FDropDownButton.SetHeight(Math.round(sc * 10));
            this.FDropDownButton.FAppearance.SetCorners(rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight));
          };
        };
      };
    };
    this.SetHidden = function (Value) {
      if (this.FHidden !== Value) {
        this.FHidden = Value;
        this.UpdateToolBarControl();
      };
    };
    this.ChangeDPIScale = function (M, D) {
      $mod.TTMSFNCDefaultToolBarButton.ChangeDPIScale.apply(this,arguments);
    };
    this.SetAdaptToStyle = function (Value) {
      $mod.TTMSFNCDefaultToolBarButton.SetAdaptToStyle.apply(this,arguments);
      if (this.FDropDownButton != null) this.FDropDownButton.SetAdaptToStyle(this.GetAdaptToStyle());
    };
    this.DoFontChanged$1 = function (Sender) {
      this.Invalidate();
    };
    this.AppearanceChanged = function () {
      $mod.TTMSFNCDefaultToolBarButton.AppearanceChanged.call(this);
      this.UpdateDropDownButton();
    };
    this.UpdateDropDownButton = function () {
      if (this.FDropDownButton != null) this.FDropDownButton.FAppearance.SetRounding(this.FAppearance.FRounding);
    };
    this.HandleMouseDown = function (Button, Shift, X, Y) {
      $mod.TTMSFNCDefaultToolBarButton.HandleMouseDown.apply(this,arguments);
      if (this.FDropDownKind === $mod.TTMSFNCToolBarButtonDropDownKind.ddkDropDown) this.DropDown();
    };
    this.DropDownButtonClick = function (Sender) {
      this.DropDown();
    };
    this.DrawButton = function (AGraphics) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      $mod.TTMSFNCDefaultToolBarButton.DrawButton.apply(this,arguments);
      if ((this.FDropDownButton != null) && (this.FDropDownKind === $mod.TTMSFNCToolBarButtonDropDownKind.ddkDropDown)) {
        var $tmp = this.FDropDownPosition;
        if ($tmp === $mod.TTMSFNCToolBarButtonDropDownPosition.ddpRight) {
          r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.GetWidth() - this.FDropDownButton.GetWidth(),0,this.GetWidth(),this.GetHeight()))}
         else if ($tmp === $mod.TTMSFNCToolBarButtonDropDownPosition.ddpBottom) r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,this.GetHeight() - this.FDropDownButton.GetHeight(),this.GetWidth(),this.GetHeight()));
        this.FDropDownButton.DrawBitmap(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r));
      };
    };
    this.SetEnabled = function (Value) {
      var d = null;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.SetEnabled.apply(this,arguments);
      d = this.GetDropDownButtonControl();
      if (d != null) d.SetEnabled(Value);
    };
    this.GetDropDownButtonClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCToolBarDropDownButton;
      return Result;
    };
    this.GetDropDownRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign($mod.TTMSFNCDefaultToolBarButton.GetDropDownRect.call(this));
      if ((this.FDropDownButton != null) && (this.FDropDownKind !== $mod.TTMSFNCToolBarButtonDropDownKind.ddkNormal)) {
        if (this.FDropDownKind === $mod.TTMSFNCToolBarButtonDropDownKind.ddkDropDown) {
          var $tmp = this.FDropDownPosition;
          if ($tmp === $mod.TTMSFNCToolBarButtonDropDownPosition.ddpRight) {
            Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.GetWidth() - this.FDropDownButton.GetWidth(),0,this.GetWidth(),this.GetHeight()))}
           else if ($tmp === $mod.TTMSFNCToolBarButtonDropDownPosition.ddpBottom) Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,this.GetHeight() - this.FDropDownButton.GetHeight(),this.GetWidth(),this.GetHeight()));
        } else {
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.FDropDownButton.GetLeft(),this.FDropDownButton.GetTop(),this.FDropDownButton.GetLeft() + this.FDropDownButton.GetWidth(),this.FDropDownButton.GetTop() + this.FDropDownButton.GetHeight()));
        };
      };
      return Result;
    };
    this.GetTextRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var bmpr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var dr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.$assign(this.GetLocalRect());
      bmpr.$assign(this.GetBitmapRect$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r)));
      dr.$assign(this.GetDropDownRect());
      if (this.FDropDownKind !== $mod.TTMSFNCToolBarButtonDropDownKind.ddkNormal) {
        if (!this.FStretchText) {
          var $tmp = this.FBitmapPosition;
          if ($tmp === $mod.TTMSFNCToolBarButtonBitmapPosition.bbpLeft) {
            var $tmp1 = this.FDropDownPosition;
            if ($tmp1 === $mod.TTMSFNCToolBarButtonDropDownPosition.ddpRight) {
              Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(bmpr.Right + 3,r.Top + 3,dr.Left - 3,r.Bottom - 3))}
             else if ($tmp1 === $mod.TTMSFNCToolBarButtonDropDownPosition.ddpBottom) Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(bmpr.Right + 3,r.Top + 3,r.Right - 3,dr.Top - 3));
          } else if ($tmp === $mod.TTMSFNCToolBarButtonBitmapPosition.bbpTop) {
            var $tmp2 = this.FDropDownPosition;
            if ($tmp2 === $mod.TTMSFNCToolBarButtonDropDownPosition.ddpRight) {
              Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + 3,bmpr.Bottom + 3,dr.Left - 3,r.Bottom - 3))}
             else if ($tmp2 === $mod.TTMSFNCToolBarButtonDropDownPosition.ddpBottom) Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + 3,bmpr.Bottom + 3,r.Right - 3,dr.Top - 3));
          };
        } else {
          var $tmp3 = this.FDropDownPosition;
          if ($tmp3 === $mod.TTMSFNCToolBarButtonDropDownPosition.ddpRight) {
            Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + 3,r.Top + 3,dr.Left - 3,r.Bottom - 3))}
           else if ($tmp3 === $mod.TTMSFNCToolBarButtonDropDownPosition.ddpBottom) Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + 3,r.Top + 3,r.Right - 3,dr.Top - 3));
        };
      } else {
        if (!this.FStretchText) {
          var $tmp4 = this.FBitmapPosition;
          if ($tmp4 === $mod.TTMSFNCToolBarButtonBitmapPosition.bbpLeft) {
            Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(bmpr.Right + 3,r.Top + 3,dr.Left - 3,r.Bottom - 3))}
           else if ($tmp4 === $mod.TTMSFNCToolBarButtonBitmapPosition.bbpTop) Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + 3,bmpr.Bottom + 3,dr.Left - 3,r.Bottom - 3));
        } else Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + 3,r.Top + 3,dr.Left - 3,r.Bottom - 3));
      };
      return Result;
    };
    this.GetBitmapRect$1 = function (ARect) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var dr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var bs = 0.0;
      bs = this.GetBitmapSize();
      var $tmp = this.FLayout;
      if ($tmp === $mod.TTMSFNCToolBarButtonLayout.bblLarge) bs = this.GetLargeLayoutBitmapSize();
      r.$assign(ARect);
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top,r.Left,r.Bottom));
      if (this.FBitmapVisible) {
        if (this.FDropDownKind !== $mod.TTMSFNCToolBarButtonDropDownKind.ddkNormal) {
          dr.$assign(this.GetDropDownRect());
          var $tmp1 = this.FBitmapPosition;
          if ($tmp1 === $mod.TTMSFNCToolBarButtonBitmapPosition.bbpLeft) {
            var $tmp2 = this.FDropDownPosition;
            if ($tmp2 === $mod.TTMSFNCToolBarButtonDropDownPosition.ddpRight) {
              Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Result.Left + 3,Result.Top + 3,Result.Left + 3 + bs,Result.Bottom - 3))}
             else if ($tmp2 === $mod.TTMSFNCToolBarButtonDropDownPosition.ddpBottom) Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Result.Left + 3,Result.Top + 3,Result.Left + 3 + bs,dr.Top - 3));
          } else if ($tmp1 === $mod.TTMSFNCToolBarButtonBitmapPosition.bbpTop) {
            var $tmp3 = this.FDropDownPosition;
            if ($tmp3 === $mod.TTMSFNCToolBarButtonDropDownPosition.ddpRight) {
              Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Result.Left + 3,Result.Top + 3,dr.Left - 3,Result.Top + 3 + bs))}
             else if ($tmp3 === $mod.TTMSFNCToolBarButtonDropDownPosition.ddpBottom) Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Result.Left + 3,Result.Top + 3,r.Right - 3,Result.Top + 3 + bs));
          };
        } else if (!this.FTextVisible || (this.GetText() === "")) {
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + 3,r.Top + 3,r.Right - 3,r.Bottom - 3));
          if ((bs !== -1) && !this.FStretchBitmapIfNoText) {
            Result.Left = Math.round(r.Left + ((r.Right - r.Left - bs) / 2));
            Result.Top = Math.round(r.Top + ((r.Bottom - r.Top - bs) / 2));
            Result.Right = Result.Left + bs;
            Result.Bottom = Result.Top + bs;
          };
        } else if (this.FTextVisible && !(this.GetText() === "")) {
          var $tmp4 = this.FBitmapPosition;
          if ($tmp4 === $mod.TTMSFNCToolBarButtonBitmapPosition.bbpLeft) {
            Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + 3,r.Top + 3,r.Left + 3 + bs,r.Bottom - 3))}
           else if ($tmp4 === $mod.TTMSFNCToolBarButtonBitmapPosition.bbpTop) Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + 3,r.Top + 3,r.Right - 3,r.Top + 3 + bs));
        };
      };
      return Result;
    };
    this.GetBitmapRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign($mod.TTMSFNCDefaultToolBarButton.GetBitmapRect.call(this));
      return Result;
    };
    this.CanDropDown = function () {
      var Result = false;
      Result = this.FDropDownKind !== $mod.TTMSFNCToolBarButtonDropDownKind.ddkNormal;
      return Result;
    };
    this.Loaded = function () {
      pas["WEBLib.Controls"].TCustomControl.Loaded.call(this);
    };
    this.Assign = function (Source) {
      $mod.TTMSFNCDefaultToolBarButton.Assign.apply(this,arguments);
      if ($mod.TTMSFNCCustomToolBarButton.isPrototypeOf(Source)) {
        this.FDropDownKind = rtl.as(Source,$mod.TTMSFNCCustomToolBarButton).FDropDownKind;
        this.FDropDownPosition = rtl.as(Source,$mod.TTMSFNCCustomToolBarButton).FDropDownPosition;
        this.FAutoOptionsMenuText = rtl.as(Source,$mod.TTMSFNCCustomToolBarButton).FAutoOptionsMenuText;
        this.FHidden = rtl.as(Source,$mod.TTMSFNCCustomToolBarButton).FHidden;
        this.Invalidate();
      };
    };
    this.Create$1 = function (AOwner) {
      var res = "";
      $mod.TTMSFNCDefaultToolBarButton.Create$1.apply(this,arguments);
      this.FHidden = false;
      this.FDropDownPosition = $mod.TTMSFNCToolBarButtonDropDownPosition.ddpRight;
      this.FDropDownButton = this.GetDropDownButtonClass().$create("Create$1",[this]);
      this.FDropDownButton.SetTabStop(false);
      this.FDropDownButton.SetText("");
      this.FDropDownButton.FOnClick = rtl.createCallback(this,"DropDownButtonClick");
      this.FDropDownButton.SetVisible(false);
      this.FDropDownButton.SetWidth(17);
      this.FDropDownButton.FAppearance.SetCorners(rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight));
      this.FDropDownButton.SetAlign(pas["WEBLib.Controls"].TAlign.alRight);
      this.FDropDownButton.FStored = false;
      res = $mod.TMSFNCTOOLBAREXPANDSVG;
      this.FDropDownButton.FBitmaps.AddBitmapFromResource$1(res,pas["WEBLib.TMSFNCTypes"].HInstance(),1.0);
      this.FDropDownButton.FDisabledBitmaps.AddBitmapFromResource$1(res,pas["WEBLib.TMSFNCTypes"].HInstance(),1.0);
      this.FDropDownButton.FHoverBitmaps.AddBitmapFromResource$1(res,pas["WEBLib.TMSFNCTypes"].HInstance(),1.0);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FDropDownButton");
      $mod.TTMSFNCDefaultToolBarButton.Destroy.call(this);
    };
    this.GetDropDownButtonControl = function () {
      var Result = null;
      Result = this.FDropDownButton;
      return Result;
    };
    this.LoadSettingsFromFile = function (AFileName) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.LoadSettingsFromFile.apply(this,arguments);
      if (this.FDropDownButton != null) {
        this.FDropDownButton.FAppearance.SetShowInnerStroke(this.FAppearance.FShowInnerStroke);
        this.FDropDownButton.FAppearance.FInnerStroke.Assign(this.FAppearance.FInnerStroke);
        this.FDropDownButton.FAppearance.FNormalFill.Assign(this.FAppearance.FNormalFill);
        this.FDropDownButton.FAppearance.FNormalStroke.Assign(this.FAppearance.FNormalStroke);
        this.FDropDownButton.FAppearance.FHoverFill.Assign(this.FAppearance.FHoverFill);
        this.FDropDownButton.FAppearance.FHoverStroke.Assign(this.FAppearance.FHoverStroke);
        this.FDropDownButton.FAppearance.FDownFill.Assign(this.FAppearance.FDownFill);
        this.FDropDownButton.FAppearance.FDownStroke.Assign(this.FAppearance.FDownStroke);
        this.FDropDownButton.FAppearance.FDisabledFill.Assign(this.FAppearance.FDisabledFill);
        this.FDropDownButton.FAppearance.FDisabledStroke.Assign(this.FAppearance.FDisabledStroke);
        this.FDropDownButton.FAppearance.SetFlatStyle(this.FAppearance.FFlatStyle);
        this.FDropDownButton.FFill.Assign(this.FFill);
        this.FDropDownButton.FStroke.Assign(this.FStroke);
      };
    };
    this.LoadSettingsFromStream = function (AStream) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.LoadSettingsFromStream.apply(this,arguments);
      if (this.FDropDownButton != null) {
        this.FDropDownButton.FAppearance.SetShowInnerStroke(this.FAppearance.FShowInnerStroke);
        this.FDropDownButton.FAppearance.FInnerStroke.Assign(this.FAppearance.FInnerStroke);
        this.FDropDownButton.FAppearance.FNormalFill.Assign(this.FAppearance.FNormalFill);
        this.FDropDownButton.FAppearance.FNormalStroke.Assign(this.FAppearance.FNormalStroke);
        this.FDropDownButton.FAppearance.FHoverFill.Assign(this.FAppearance.FHoverFill);
        this.FDropDownButton.FAppearance.FHoverStroke.Assign(this.FAppearance.FHoverStroke);
        this.FDropDownButton.FAppearance.FDownFill.Assign(this.FAppearance.FDownFill);
        this.FDropDownButton.FAppearance.FDownStroke.Assign(this.FAppearance.FDownStroke);
        this.FDropDownButton.FAppearance.FDisabledFill.Assign(this.FAppearance.FDisabledFill);
        this.FDropDownButton.FAppearance.FDisabledStroke.Assign(this.FAppearance.FDisabledStroke);
        this.FDropDownButton.FAppearance.SetFlatStyle(this.FAppearance.FFlatStyle);
        this.FDropDownButton.FFill.Assign(this.FFill);
        this.FDropDownButton.FStroke.Assign(this.FStroke);
      };
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCCustomToolBarSeparatorAppearance",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FOwner = null;
      this.FStroke = null;
      this.FInnerStroke = null;
    };
    this.$final = function () {
      this.FOwner = undefined;
      this.FStroke = undefined;
      this.FInnerStroke = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetStroke = function (Value) {
      this.FStroke.Assign(Value);
    };
    this.SetInnerStroke = function (Value) {
      this.FInnerStroke.Assign(Value);
    };
    this.StrokeChanged = function (Sender) {
      this.FOwner.Invalidate();
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCCustomToolBarSeparatorAppearance.isPrototypeOf(Source)) {
        this.FStroke.Assign(rtl.as(Source,$mod.TTMSFNCCustomToolBarSeparatorAppearance).FStroke);
        this.FInnerStroke.Assign(rtl.as(Source,$mod.TTMSFNCCustomToolBarSeparatorAppearance).FInnerStroke);
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    this.Create$1 = function (AOwner) {
      this.FOwner = AOwner;
      this.FStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,8421504,1.0]);
      this.FStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FInnerStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,16777215,1.0]);
      this.FInnerStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FInnerStroke");
      rtl.free(this,"FStroke");
      pas.System.TObject.Destroy.call(this);
    };
  });
  rtl.createClass(this,"TTMSFNCToolBarSeparatorAppearance",this.TTMSFNCCustomToolBarSeparatorAppearance,function () {
    var $r = this.$rtti;
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
    $r.addProperty("InnerStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FInnerStroke","SetInnerStroke");
  });
  this.TTMSFNCToolBarSeperatorOrientation = {"0": "tbsoVertical", tbsoVertical: 0, "1": "tbsoHorizontal", tbsoHorizontal: 1};
  this.$rtti.$Enum("TTMSFNCToolBarSeperatorOrientation",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCToolBarSeperatorOrientation});
  rtl.createClass(this,"TTMSFNCCustomToolBarSeparator",this.TTMSFNCCustomToolBarElement,function () {
    this.$init = function () {
      $mod.TTMSFNCCustomToolBarElement.$init.call(this);
      this.FAppearance = null;
      this.FOrientation = 0;
    };
    this.$final = function () {
      this.FAppearance = undefined;
      $mod.TTMSFNCCustomToolBarElement.$final.call(this);
    };
    this.SetAppearance = function (Value) {
      this.FAppearance.Assign(Value);
    };
    this.SetOrientation = function (Value) {
      var t = 0;
      if (this.FOrientation !== Value) {
        this.FOrientation = Value;
        t = this.GetWidth();
        this.SetWidth(this.GetHeight());
        this.SetHeight(t);
        this.Invalidate();
      };
    };
    this.UpdateState = function () {
      var f = 0.0;
      $mod.TTMSFNCCustomToolBarElement.UpdateState.call(this);
      var $tmp = this.FState;
      if ($tmp === $mod.TTMSFNCToolBarElementState.esNormal) {
        f = 0.8}
       else if ($tmp === $mod.TTMSFNCToolBarElementState.esLarge) {
        f = 1.25}
       else {
        f = 1;
      };
      if (!(pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) {
        this.SetBounds(this.GetLeft(),this.GetTop(),this.GetWidth(),Math.round(this.GetHeight() * f));
      };
    };
    this.Assign = function (Source) {
      $mod.TTMSFNCCustomToolBarElement.Assign.apply(this,arguments);
      if ($mod.TTMSFNCCustomToolBarSeparator.isPrototypeOf(Source)) {
        this.FAppearance.Assign(rtl.as(Source,$mod.TTMSFNCCustomToolBarSeparator).FAppearance);
        this.Invalidate();
      };
    };
    this.Create$1 = function (AOwner) {
      $mod.TTMSFNCCustomToolBarElement.Create$1.apply(this,arguments);
      this.SetWidth(2);
      this.SetHeight(30);
      this.FOrientation = $mod.TTMSFNCToolBarSeperatorOrientation.tbsoVertical;
      this.FAppearance = $mod.TTMSFNCToolBarSeparatorAppearance.$create("Create$1",[this]);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FAppearance");
      $mod.TTMSFNCCustomToolBarElement.Destroy.call(this);
    };
    this.Draw = function (AGraphics, ARect) {
      var cp = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Draw.apply(this,arguments);
      r.$assign(this.GetLocalRect());
      cp.$assign(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Top));
      var $tmp = this.FOrientation;
      if ($tmp === $mod.TTMSFNCToolBarSeperatorOrientation.tbsoVertical) {
        AGraphics.FStroke.Assign(this.FAppearance.FStroke);
        AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(cp.X,r.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(cp.X,r.Bottom)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
        AGraphics.FStroke.Assign(this.FAppearance.FInnerStroke);
        AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(cp.X + 1,r.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(cp.X + 1,r.Bottom)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
      } else if ($tmp === $mod.TTMSFNCToolBarSeperatorOrientation.tbsoHorizontal) {
        AGraphics.FStroke.Assign(this.FAppearance.FStroke);
        AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,cp.Y)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,cp.Y)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
        AGraphics.FStroke.Assign(this.FAppearance.FInnerStroke);
        AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,cp.Y + 1)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,cp.Y + 1)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
      };
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCToolBarButton",this.TTMSFNCCustomToolBarButton,function () {
    this.RegisterRuntimeClasses = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClass($mod.TTMSFNCToolBarButton);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Font",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FFont$1","SetFont$1");
    $r.addProperty("AutoOptionsMenuText",0,rtl.string,"FAutoOptionsMenuText","FAutoOptionsMenuText");
    $r.addProperty("DropDownAutoWidth",2,rtl.boolean,"FDropDownAutoWidth","SetDropDownAutoWidth",4,{Default: false});
    $r.addProperty("DropDownKind",2,$mod.$rtti["TTMSFNCToolBarButtonDropDownKind"],"FDropDownKind","SetDropDownKind",4,{Default: $mod.TTMSFNCToolBarButtonDropDownKind.ddkNormal});
    $r.addProperty("DropDownPosition",2,$mod.$rtti["TTMSFNCToolBarButtonDropDownPosition"],"FDropDownPosition","SetDropDownPosition",4,{Default: $mod.TTMSFNCToolBarButtonDropDownPosition.ddpRight});
    $r.addProperty("DropDownHeight",14,rtl.double,"FDropDownHeight","SetDropDownHeight",4,{stored: "IsDropDownHeightStored"});
    $r.addProperty("DropDownWidth",14,rtl.double,"FDropDownWidth","SetDropDownWidth",4,{stored: "IsDropDownWidthStored"});
    $r.addProperty("DropDownControl",2,pas["WEBLib.Controls"].$rtti["TControl"],"FDropDownControl","SetDropDownControl");
    $r.addProperty("OnBeforeDropDown",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnBeforeDropDown","FOnBeforeDropDown");
    $r.addProperty("OnDropDown",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDropDown","FOnDropDown");
    $r.addProperty("OnCloseDropDown",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnCloseDropDown","FOnCloseDropDown");
    $r.addProperty("Text",3,rtl.string,"GetText","SetText");
    $r.addProperty("ShowFocus",2,rtl.boolean,"FShowFocus$1","SetShowFocus$1",4,{Default: false});
    $r.addProperty("TextVisible",2,rtl.boolean,"FTextVisible","SetTextVisible",4,{Default: true});
    $r.addProperty("StretchText",2,rtl.boolean,"FStretchText","SetStretchText",4,{Default: false});
    $r.addProperty("HoverFontColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FHoverFontColor","SetHoverFontColor",4,{Default: -1});
    $r.addProperty("DownFontColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FDownFontColor","SetDownFontColor",4,{Default: -1});
    $r.addProperty("DisabledFontColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FDisabledFontColor","SetDisabledFontColor",4,{Default: -1});
    $r.addProperty("StretchBitmapIfNoText",2,rtl.boolean,"FStretchBitmapIfNoText","SetStretchBitmapIfNoText",4,{Default: true});
    $r.addProperty("HorizontalTextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FHorizontalTextAlign","SetHorizontalTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter});
    $r.addProperty("VerticalTextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FVerticalTextAlign","SetVerticalTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter});
    $r.addProperty("Trimming",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextTrimming"],"FTrimming","SetTrimming",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttCharacter});
    $r.addProperty("Bitmaps",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCScaledBitmaps"],"FBitmaps","SetBitmaps");
    $r.addProperty("LargeLayoutBitmaps",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCScaledBitmaps"],"FLargeLayoutBitmaps","SetLargeLayoutBitmaps");
    $r.addProperty("Layout",2,$mod.$rtti["TTMSFNCToolBarButtonLayout"],"FLayout","SetLayout",4,{Default: $mod.TTMSFNCToolBarButtonLayout.bblNone});
    $r.addProperty("CompactLayout",2,$mod.$rtti["TTMSFNCToolBarButtonLayout"],"FCompactLayout","SetCompactLayout",4,{Default: $mod.TTMSFNCToolBarButtonLayout.bblNone});
    $r.addProperty("MinimumLayout",2,$mod.$rtti["TTMSFNCToolBarButtonLayout"],"FMinimumLayout","SetMinimumLayout",4,{Default: $mod.TTMSFNCToolBarButtonLayout.bblBitmap});
    $r.addProperty("MaximumLayout",2,$mod.$rtti["TTMSFNCToolBarButtonLayout"],"FMaximumLayout","SetMaximumLayout",4,{Default: $mod.TTMSFNCToolBarButtonLayout.bblLarge});
    $r.addProperty("BitmapPosition",2,$mod.$rtti["TTMSFNCToolBarButtonBitmapPosition"],"FBitmapPosition","SetBitmapPosition",4,{Default: $mod.TTMSFNCToolBarButtonBitmapPosition.bbpLeft});
    $r.addProperty("DisabledBitmaps",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCScaledBitmaps"],"FDisabledBitmaps","SetDisabledBitmaps");
    $r.addProperty("HoverBitmaps",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCScaledBitmaps"],"FHoverBitmaps","SetHoverBitmaps");
    $r.addProperty("LargeLayoutDisabledBitmaps",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCScaledBitmaps"],"FLargeLayoutDisabledBitmaps","SetLargeLayoutDisabledBitmaps");
    $r.addProperty("LargeLayoutHoverBitmaps",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCScaledBitmaps"],"FLargeLayoutHoverBitmaps","SetLargeLayoutHoverBitmaps");
    $r.addProperty("BitmapVisible",2,rtl.boolean,"FBitmapVisible","SetBitmapVisible",4,{Default: false});
    $r.addProperty("BitmapContainer",3,pas["WEBLib.TMSFNCBitmapContainer"].$rtti["TTMSFNCBitmapContainer"],"GetBitmapContainer","SetBitmapContainer");
    $r.addProperty("BitmapSize",14,rtl.double,"FBitmapSize","SetBitmapSize",4,{stored: "IsBitmapSizeStored"});
    $r.addProperty("AutoBitmapSize",2,rtl.boolean,"FAutoBitmapSize","SetAutoBitmapSize",4,{Default: false});
    $r.addProperty("LargeLayoutBitmapSize",14,rtl.double,"FLargeLayoutBitmapSize","SetLargeLayoutBitmapSize",4,{stored: "IsLargeLayoutBitmapSizeStored"});
    $r.addProperty("LargeLayoutAutoBitmapSize",2,rtl.boolean,"FLargeLayoutAutoBitmapSize","SetLargeLayoutAutoBitmapSize",4,{Default: false});
    $r.addProperty("State",2,$mod.$rtti["TTMSFNCToolBarElementState"],"FState","SetState",4,{Default: $mod.TTMSFNCToolBarElementState.esNormal});
    $r.addProperty("LastElement",2,rtl.boolean,"FLastElement","SetLastElement",4,{Default: false});
    $r.addProperty("Appearance",2,$mod.$rtti["TTMSFNCToolBarButtonAppearance"],"FAppearance","SetAppearance");
    $r.addProperty("WordWrapping",2,rtl.boolean,"FWordWrapping","SetWordWrapping",4,{Default: false});
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
  this.$rtti.$ClassRef("TTMSFNCToolBarButtonClass",{instancetype: this.$rtti["TTMSFNCToolBarButton"]});
  rtl.createClass(this,"TTMSFNCToolBarSeparator",this.TTMSFNCCustomToolBarSeparator,function () {
    this.RegisterRuntimeClasses = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClass($mod.TTMSFNCToolBarSeparator);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("State",2,$mod.$rtti["TTMSFNCToolBarElementState"],"FState","SetState",4,{Default: $mod.TTMSFNCToolBarElementState.esNormal});
    $r.addProperty("LastElement",2,rtl.boolean,"FLastElement","SetLastElement",4,{Default: false});
    $r.addProperty("Appearance",2,$mod.$rtti["TTMSFNCToolBarSeparatorAppearance"],"FAppearance","SetAppearance");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
  this.$rtti.$ClassRef("TTMSFNCToolBarSeparatorClass",{instancetype: this.$rtti["TTMSFNCToolBarSeparator"]});
  this.$rtti.$MethodVar("TTMSFNCToolBarItemPickerItemSelected",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AItemIndex",rtl.longint]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCToolBarCustomItemPicker",this.TTMSFNCToolBarButton,function () {
    this.$init = function () {
      $mod.TTMSFNCToolBarButton.$init.call(this);
      this.FEdit = null;
      this.FTimer = null;
      this.FItemIndex = 0;
      this.FItems = null;
      this.FKeyboardUsed = false;
      this.FItemSelector = null;
      this.FOnItemSelected = null;
      this.FEditable = false;
      this.FOnEditChange = null;
    };
    this.$final = function () {
      this.FEdit = undefined;
      this.FTimer = undefined;
      this.FItems = undefined;
      this.FItemSelector = undefined;
      this.FOnItemSelected = undefined;
      this.FOnEditChange = undefined;
      $mod.TTMSFNCToolBarButton.$final.call(this);
    };
    this.GetSelectedItemIndex = function () {
      var Result = 0;
      Result = this.FItemIndex;
      return Result;
    };
    this.SetSelectedItemIndex = function (Value) {
      this.FItemIndex = Value;
      this.Invalidate();
    };
    this.GetSelectedItem = function () {
      var Result = "";
      Result = "";
      if ((this.FItems != null) && (this.FItemIndex >= 0) && (this.FItemIndex <= (this.FItems.GetCount() - 1))) Result = this.FItems.Get(this.FItemIndex);
      return Result;
    };
    this.SetSelectedItem = function (Value) {
      this.FItemIndex = this.FItems.IndexOf(Value);
      this.Invalidate();
    };
    this.SetItems = function (Value) {
      this.FItems.Assign(Value);
    };
    this.SetEditable = function (Value) {
      if (this.FEditable !== Value) {
        this.FEditable = Value;
        if (this.FEdit != null) {
          if (this.FEditable) {
            this.FEdit.SetParent(this);
          } else this.FEdit.SetParent(null);
          this.FEdit.SetVisible(this.FEditable);
        };
        this.Invalidate();
      };
    };
    this.ChangeDPIScale = function (M, D) {
      $mod.TTMSFNCCustomToolBarButton.ChangeDPIScale.apply(this,arguments);
    };
    this.CanChangeText = function () {
      var Result = false;
      Result = !(pas.Classes.TComponentStateItem.csLoading in this.FComponentState) && !(pas.Classes.TComponentStateItem.csDesigning in this.FComponentState);
      return Result;
    };
    this.GetText = function () {
      var Result = "";
      if (this.FEditable) {
        Result = this.FEdit.GetText()}
       else Result = this.GetSelectedItem();
      return Result;
    };
    this.EnterTimerChanged = function (Sender) {
      this.FEdit.SetFocus();
      this.FTimer.SetEnabled(false);
    };
    this.EditChange = function (Sender) {
      this.SetSelectedItem(this.FEdit.GetText());
      if (this.FOnEditChange != null) this.FOnEditChange(this);
    };
    this.HandleDialogKey = function (Key, Shift) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleDialogKey.apply(this,arguments);
      if (rtl.neSet(Shift,{})) return;
      if (this.FEditable && this.FEdit.IsFocused()) {
        var $tmp = Key.get();
        if ($tmp === 115) {
          if (!(pas.Classes.TShiftState$a.ssAlt in Shift)) this.DropDown();
        };
      };
    };
    this.InitializePopup = function () {
      this.FItemSelector.FItems.Clear();
      this.FItemSelector.FItems.Assign(this.FItems);
      this.FItemSelector.SetItemIndex(this.FItemIndex);
    };
    this.SelectValueWithString = function (AValue) {
      var I = 0;
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MatchStrEx(AValue + "*",this.FItems.Get(I),false)) {
          this.FItemIndex = I;
          this.DoItemSelected();
          this.Invalidate();
          break;
        };
      };
    };
    this.SelectValueWithCharacter = function (ACharacter) {
      var I = 0;
      $mod.TTMSFNCDefaultToolBarButton.SelectValueWithCharacter.apply(this,arguments);
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MatchStrEx(ACharacter + "*",this.FItems.Get(I),false)) {
          this.FItemIndex = I;
          this.DoItemSelected();
          this.Invalidate();
          break;
        };
      };
    };
    this.SelectFirstValue = function () {
      $mod.TTMSFNCDefaultToolBarButton.SelectFirstValue.call(this);
      this.NotifyDataBinderEdit();
      this.FItemIndex = 0;
      this.NotifyDataBinderValueChanged();
      this.DoItemSelected();
      this.Invalidate();
    };
    this.SelectLastValue = function () {
      $mod.TTMSFNCDefaultToolBarButton.SelectLastValue.call(this);
      this.NotifyDataBinderEdit();
      this.FItemIndex = this.FItems.GetCount() - 1;
      this.NotifyDataBinderValueChanged();
      this.DoItemSelected();
      this.Invalidate();
    };
    this.SelectNextValue = function () {
      $mod.TTMSFNCDefaultToolBarButton.SelectNextValue.call(this);
      this.NotifyDataBinderEdit();
      if (this.FItemIndex === -1) {
        this.FItemIndex = 0}
       else this.FItemIndex = Math.min(this.FItems.GetCount() - 1,this.FItemIndex + 1);
      this.NotifyDataBinderValueChanged();
      this.DoItemSelected();
      this.Invalidate();
    };
    this.SelectPreviousValue = function () {
      $mod.TTMSFNCDefaultToolBarButton.SelectPreviousValue.call(this);
      this.NotifyDataBinderEdit();
      if (this.FItemIndex === -1) {
        this.FItemIndex = 0}
       else this.FItemIndex = Math.max(0,this.FItemIndex - 1);
      this.NotifyDataBinderValueChanged();
      this.DoItemSelected();
      this.Invalidate();
    };
    this.ItemKeyUp = function (Sender, Key, Shift) {
      if ((Key.get() === 13) || (Key.get() === 32)) {
        this.NotifyDataBinderEdit();
        this.FItemIndex = this.FItemSelector.GetItemIndex();
        this.NotifyDataBinderValueChanged();
        if (this.FCloseOnSelection) this.DropDown();
        this.DoItemSelected();
        this.Invalidate();
      };
      this.FKeyboardUsed = false;
    };
    this.ItemKeyDown = function (Sender, Key, Shift) {
      this.FKeyboardUsed = true;
    };
    this.ItemSelected = function (Sender) {
      if (this.FKeyboardUsed) return;
      this.NotifyDataBinderEdit();
      this.FItemIndex = this.FItemSelector.GetItemIndex();
      this.NotifyDataBinderValueChanged();
      if (this.FCloseOnSelection) this.DropDown();
      this.DoItemSelected();
      this.Invalidate();
    };
    this.DoItemSelected = function () {
      if ((this.FEdit != null) && this.FEdit.HandleAllocated()) {
        this.FEdit.SetText(this.GetSelectedItem());
        this.FEdit.SetSelStart(this.FEdit.GetText().length);
      };
      if (this.FOnItemSelected != null) this.FOnItemSelected(this,this.GetSelectedItemIndex());
    };
    this.DoEnter = function () {
      pas["WEBLib.Controls"].TControl.DoEnter.call(this);
      this.FTimer.SetEnabled(this.FEditable);
    };
    this.Create$1 = function (AOwner) {
      $mod.TTMSFNCCustomToolBarButton.Create$1.apply(this,arguments);
      this.FTimer = pas["WEBLib.ExtCtrls"].TTimer.$create("Create$1",[this]);
      this.FTimer.SetInterval(1);
      this.FTimer.FOnTimer = rtl.createCallback(this,"EnterTimerChanged");
      this.FTimer.SetEnabled(false);
      this.FEdit = pas["WEBLib.StdCtrls"].TEdit.$create("Create$1",[this]);
      this.FEdit.SetTabStop(true);
      this.FEdit.SetAlign(pas["WEBLib.Controls"].TAlign.alClient);
      this.FEdit.FOnChange = rtl.createCallback(this,"EditChange");
      this.SetWidth(100);
      this.SetHeight(24);
      this.SetHorizontalTextAlign(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading);
      this.FItemIndex = -1;
      this.FItemSelector = pas["WEBLib.StdCtrls"].TListBox.$create("Create$1",[this]);
      this.FItemSelector.SetWidth(200);
      this.FItemSelector.SetHeight(150);
      this.FItemSelector.FFont.SetHeight(-11);
      this.FItemSelector.SetAlign(pas["WEBLib.Controls"].TAlign.alClient);
      this.FItemSelector.FOnClick = rtl.createCallback(this,"ItemSelected");
      this.FItemSelector.FOnKeyUp = rtl.createCallback(this,"ItemKeyUp");
      this.FItemSelector.FOnKeyDown = rtl.createCallback(this,"ItemKeyDown");
      this.SetDropDownControl(this.FItemSelector);
      this.SetDropDownKind($mod.TTMSFNCToolBarButtonDropDownKind.ddkDropDownButton);
      this.SetDropDownWidth(this.FItemSelector.GetWidth());
      this.SetDropDownHeight(this.FItemSelector.GetHeight());
      this.FItems = pas.Classes.TStringList.$create("Create$1");
      return this;
    };
    this.Draw = function (AGraphics, ARect) {
      if (!this.FEditable) $mod.TTMSFNCDefaultToolBarButton.Draw.apply(this,arguments);
    };
    this.Destroy = function () {
      rtl.free(this,"FTimer");
      rtl.free(this,"FItems");
      $mod.TTMSFNCCustomToolBarButton.Destroy.call(this);
    };
    this.DropDown = function () {
      $mod.TTMSFNCDefaultToolBarButton.DropDown.call(this);
      if (!(this.FPopup != null)) return;
      if (this.FPopup.FIsOpen && (this.FItemSelector != null)) {
        this.FItemSelector.SetItemIndex(-1);
        this.FItemSelector.SetItemIndex(this.GetSelectedItemIndex());
      };
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCToolBarItemPicker",this.TTMSFNCToolBarCustomItemPicker,function () {
    this.RegisterRuntimeClasses = function () {
      $mod.TTMSFNCToolBarButton.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClass($mod.TTMSFNCToolBarItemPicker);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("OnItemSelected",0,$mod.$rtti["TTMSFNCToolBarItemPickerItemSelected"],"FOnItemSelected","FOnItemSelected");
    $r.addProperty("SelectedItemIndex",3,rtl.longint,"GetSelectedItemIndex","SetSelectedItemIndex",4,{Default: -1});
    $r.addProperty("Items",2,pas.Classes.$rtti["TStringList"],"FItems","SetItems");
    $r.addProperty("Editable",2,rtl.boolean,"FEditable","SetEditable",4,{Default: false});
    $r.addProperty("OnEditChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnEditChange","FOnEditChange");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
  rtl.createClass(this,"TTMSFNCToolBarCustomComboBox",this.TTMSFNCToolBarButton,function () {
    this.$init = function () {
      $mod.TTMSFNCToolBarButton.$init.call(this);
      this.FEdit = null;
      this.FTimer = null;
      this.FItemIndex = 0;
      this.FItems = null;
      this.FKeyboardUsed = false;
      this.FItemSelector = null;
      this.FOnItemSelected = null;
      this.FEditable = false;
      this.FOnEditChange = null;
    };
    this.$final = function () {
      this.FEdit = undefined;
      this.FTimer = undefined;
      this.FItems = undefined;
      this.FItemSelector = undefined;
      this.FOnItemSelected = undefined;
      this.FOnEditChange = undefined;
      $mod.TTMSFNCToolBarButton.$final.call(this);
    };
    this.GetSelectedItemIndex = function () {
      var Result = 0;
      Result = this.FItemIndex;
      return Result;
    };
    this.SetSelectedItemIndex = function (Value) {
      this.FItemIndex = Value;
      this.Invalidate();
    };
    this.GetSelectedItem = function () {
      var Result = "";
      Result = "";
      if ((this.FItems != null) && (this.FItemIndex >= 0) && (this.FItemIndex <= (this.FItems.GetCount() - 1))) Result = this.FItems.Get(this.FItemIndex);
      return Result;
    };
    this.SetSelectedItem = function (Value) {
      this.FItemIndex = this.FItems.IndexOf(Value);
      this.Invalidate();
    };
    this.SetItems = function (Value) {
      this.FItems.Assign(Value);
    };
    this.SetEditable = function (Value) {
      if (this.FEditable !== Value) {
        this.FEditable = Value;
        if (this.FEdit != null) {
          if (this.FEditable) {
            this.FEdit.SetParent(this);
          } else this.FEdit.SetParent(null);
          this.FEdit.SetVisible(this.FEditable);
        };
        this.Invalidate();
      };
    };
    this.ChangeDPIScale = function (M, D) {
      $mod.TTMSFNCCustomToolBarButton.ChangeDPIScale.apply(this,arguments);
    };
    this.CanChangeText = function () {
      var Result = false;
      Result = !(pas.Classes.TComponentStateItem.csLoading in this.FComponentState) && !(pas.Classes.TComponentStateItem.csDesigning in this.FComponentState);
      return Result;
    };
    this.GetText = function () {
      var Result = "";
      if (this.FEditable) {
        Result = this.FEdit.GetText()}
       else Result = this.GetSelectedItem();
      return Result;
    };
    this.EnterTimerChanged = function (Sender) {
      this.FEdit.SetFocus();
      this.FTimer.SetEnabled(false);
    };
    this.EditChange = function (Sender) {
      this.SetSelectedItem(this.FEdit.GetText());
      if (this.FOnEditChange != null) this.FOnEditChange(this);
    };
    this.HandleDialogKey = function (Key, Shift) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleDialogKey.apply(this,arguments);
      if (rtl.neSet(Shift,{})) return;
      if (this.FEditable && this.FEdit.IsFocused()) {
        var $tmp = Key.get();
        if ($tmp === 115) {
          if (!(pas.Classes.TShiftState$a.ssAlt in Shift)) this.DropDown();
        };
      };
    };
    this.InitializePopup = function () {
      this.FItemSelector.BeginUpdate();
      this.FItemSelector.FItems.Clear$1();
      this.FItemSelector.LoadFromStrings(this.FItems);
      this.FItemSelector.SetItemIndex(this.FItemIndex);
      this.FItemSelector.EndUpdate();
    };
    this.SelectValueWithString = function (AValue) {
      var I = 0;
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MatchStrEx(AValue + "*",this.FItems.Get(I),false)) {
          this.FItemIndex = I;
          this.DoItemSelected();
          this.Invalidate();
          break;
        };
      };
    };
    this.SelectValueWithCharacter = function (ACharacter) {
      var I = 0;
      $mod.TTMSFNCDefaultToolBarButton.SelectValueWithCharacter.apply(this,arguments);
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MatchStrEx(ACharacter + "*",this.FItems.Get(I),false)) {
          this.FItemIndex = I;
          this.DoItemSelected();
          this.Invalidate();
          break;
        };
      };
    };
    this.SelectFirstValue = function () {
      $mod.TTMSFNCDefaultToolBarButton.SelectFirstValue.call(this);
      this.NotifyDataBinderEdit();
      this.FItemIndex = 0;
      this.NotifyDataBinderValueChanged();
      this.DoItemSelected();
      this.Invalidate();
    };
    this.SelectLastValue = function () {
      $mod.TTMSFNCDefaultToolBarButton.SelectLastValue.call(this);
      this.NotifyDataBinderEdit();
      this.FItemIndex = this.FItems.GetCount() - 1;
      this.NotifyDataBinderValueChanged();
      this.DoItemSelected();
      this.Invalidate();
    };
    this.SelectNextValue = function () {
      $mod.TTMSFNCDefaultToolBarButton.SelectNextValue.call(this);
      this.NotifyDataBinderEdit();
      if (this.FItemIndex === -1) {
        this.FItemIndex = 0}
       else this.FItemIndex = Math.min(this.FItems.GetCount() - 1,this.FItemIndex + 1);
      this.NotifyDataBinderValueChanged();
      this.DoItemSelected();
      this.Invalidate();
    };
    this.SelectPreviousValue = function () {
      $mod.TTMSFNCDefaultToolBarButton.SelectPreviousValue.call(this);
      this.NotifyDataBinderEdit();
      if (this.FItemIndex === -1) {
        this.FItemIndex = 0}
       else this.FItemIndex = Math.max(0,this.FItemIndex - 1);
      this.NotifyDataBinderValueChanged();
      this.DoItemSelected();
      this.Invalidate();
    };
    this.ItemKeyUp = function (Sender, Key, Shift) {
      if ((Key.get() === 13) || (Key.get() === 32)) {
        this.NotifyDataBinderEdit();
        this.FItemIndex = this.FItemSelector.GetItemIndex();
        this.NotifyDataBinderValueChanged();
        if (this.FCloseOnSelection) this.DropDown();
        this.DoItemSelected();
        this.Invalidate();
      };
      this.FKeyboardUsed = false;
    };
    this.ItemKeyDown = function (Sender, Key, Shift) {
      this.FKeyboardUsed = true;
    };
    this.ItemSelected = function (Sender, AItem) {
      if (this.FKeyboardUsed) return;
      this.NotifyDataBinderEdit();
      this.FItemIndex = this.FItemSelector.GetItemIndex();
      this.NotifyDataBinderValueChanged();
      if (this.FCloseOnSelection) this.DropDown();
      this.DoItemSelected();
      this.Invalidate();
    };
    this.DoItemSelected = function () {
      if ((this.FEdit != null) && this.FEdit.HandleAllocated()) {
        this.FEdit.SetText(this.GetSelectedItem());
        this.FEdit.SetSelStart(this.FEdit.GetText().length);
      };
      if (this.FOnItemSelected != null) this.FOnItemSelected(this,this.GetSelectedItemIndex());
    };
    this.DoEnter = function () {
      pas["WEBLib.Controls"].TControl.DoEnter.call(this);
      this.FTimer.SetEnabled(this.FEditable);
    };
    this.Create$1 = function (AOwner) {
      $mod.TTMSFNCCustomToolBarButton.Create$1.apply(this,arguments);
      this.FTimer = pas["WEBLib.ExtCtrls"].TTimer.$create("Create$1",[this]);
      this.FTimer.SetInterval(1);
      this.FTimer.FOnTimer = rtl.createCallback(this,"EnterTimerChanged");
      this.FTimer.SetEnabled(false);
      this.FEdit = pas["WEBLib.StdCtrls"].TEdit.$create("Create$1",[this]);
      this.FEdit.SetTabStop(true);
      this.FEdit.SetAlign(pas["WEBLib.Controls"].TAlign.alClient);
      this.FEdit.FOnChange = rtl.createCallback(this,"EditChange");
      this.SetWidth(100);
      this.SetHeight(24);
      this.SetHorizontalTextAlign(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading);
      this.FItemIndex = -1;
      this.FItemSelector = pas["WEBLib.TMSFNCListBox"].TTMSFNCListBox.$create("Create$1",[this]);
      this.FItemSelector.SetWidth(200);
      this.FItemSelector.SetHeight(150);
      this.FItemSelector.SetAlign(pas["WEBLib.Controls"].TAlign.alClient);
      this.FItemSelector.FOnItemSelected = rtl.createCallback(this,"ItemSelected");
      this.FItemSelector.FOnKeyUp = rtl.createCallback(this,"ItemKeyUp");
      this.FItemSelector.FOnKeyDown = rtl.createCallback(this,"ItemKeyDown");
      this.SetDropDownControl(this.FItemSelector);
      this.SetDropDownKind($mod.TTMSFNCToolBarButtonDropDownKind.ddkDropDownButton);
      this.SetDropDownWidth(this.FItemSelector.GetWidth());
      this.SetDropDownHeight(this.FItemSelector.GetHeight());
      this.FItems = pas.Classes.TStringList.$create("Create$1");
      return this;
    };
    this.Draw = function (AGraphics, ARect) {
      if (!this.FEditable) $mod.TTMSFNCDefaultToolBarButton.Draw.apply(this,arguments);
    };
    this.Destroy = function () {
      rtl.free(this,"FTimer");
      rtl.free(this,"FItems");
      $mod.TTMSFNCCustomToolBarButton.Destroy.call(this);
    };
    this.DropDown = function () {
      $mod.TTMSFNCDefaultToolBarButton.DropDown.call(this);
      if (!(this.FPopup != null)) return;
      if (this.FPopup.FIsOpen && (this.FItemSelector != null)) {
        this.FItemSelector.SetItemIndex(-1);
        this.FItemSelector.SetItemIndex(this.GetSelectedItemIndex());
      };
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCToolBarComboBox",this.TTMSFNCToolBarCustomComboBox,function () {
    this.RegisterRuntimeClasses = function () {
      $mod.TTMSFNCToolBarButton.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClass($mod.TTMSFNCToolBarComboBox);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("OnItemSelected",0,$mod.$rtti["TTMSFNCToolBarItemPickerItemSelected"],"FOnItemSelected","FOnItemSelected");
    $r.addProperty("SelectedItemIndex",3,rtl.longint,"GetSelectedItemIndex","SetSelectedItemIndex",4,{Default: -1});
    $r.addProperty("Items",2,pas.Classes.$rtti["TStringList"],"FItems","SetItems");
    $r.addProperty("Editable",2,rtl.boolean,"FEditable","SetEditable",4,{Default: false});
    $r.addProperty("OnEditChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnEditChange","FOnEditChange");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
  this.$rtti.$MethodVar("TTMSFNCToolBarFontNamePickerFontNameSelected",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFontName",rtl.string]]), methodkind: 0});
  this.$rtti.$ClassRef("TTMSFNCToolBarItemPickerClass",{instancetype: this.$rtti["TTMSFNCToolBarItemPicker"]});
  rtl.createClass(this,"TTMSFNCToolBarFontNamePicker",this.TTMSFNCToolBarCustomItemPicker,function () {
    this.$init = function () {
      $mod.TTMSFNCToolBarCustomItemPicker.$init.call(this);
      this.FOnFontNameSelected = null;
    };
    this.$final = function () {
      this.FOnFontNameSelected = undefined;
      $mod.TTMSFNCToolBarCustomItemPicker.$final.call(this);
    };
    this.GetSelectedFontName = function () {
      var Result = "";
      Result = this.GetSelectedItem();
      return Result;
    };
    this.SetSelectedFontName = function (Value) {
      this.SetSelectedItem(Value);
    };
    this.RegisterRuntimeClasses = function () {
      $mod.TTMSFNCToolBarButton.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClass($mod.TTMSFNCToolBarFontNamePicker);
    };
    this.DoItemSelected = function () {
      $mod.TTMSFNCToolBarCustomItemPicker.DoItemSelected.call(this);
      if (this.FOnFontNameSelected != null) this.FOnFontNameSelected(this,this.GetSelectedFontName());
    };
    this.Create$1 = function (AOwner) {
      $mod.TTMSFNCToolBarCustomItemPicker.Create$1.apply(this,arguments);
      this.FAutoOptionsMenuText = "Font Name";
      pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetFonts(this.FItems);
      return this;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("OnFontNameSelected",0,$mod.$rtti["TTMSFNCToolBarFontNamePickerFontNameSelected"],"FOnFontNameSelected","FOnFontNameSelected");
    $r.addProperty("CloseOnSelection",2,rtl.boolean,"FCloseOnSelection","SetCloseOnSelection",4,{Default: true});
    $r.addProperty("Editable",2,rtl.boolean,"FEditable","SetEditable",4,{Default: false});
    $r.addProperty("OnEditChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnEditChange","FOnEditChange");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
  this.$rtti.$MethodVar("TTMSFNCToolBarFontSizePickerFontSizeSelected",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFontSize",rtl.double]]), methodkind: 0});
  this.$rtti.$ClassRef("TTMSFNCToolBarFontNamePickerClass",{instancetype: this.$rtti["TTMSFNCToolBarFontNamePicker"]});
  rtl.createClass(this,"TTMSFNCToolBarFontSizePicker",this.TTMSFNCToolBarCustomItemPicker,function () {
    this.$init = function () {
      $mod.TTMSFNCToolBarCustomItemPicker.$init.call(this);
      this.FOnFontSizeSelected = null;
    };
    this.$final = function () {
      this.FOnFontSizeSelected = undefined;
      $mod.TTMSFNCToolBarCustomItemPicker.$final.call(this);
    };
    this.GetSelectedFontSize = function () {
      var Result = 0.0;
      var s = "";
      Result = -1;
      s = this.GetSelectedItem();
      if (s !== "") Result = pas.SysUtils.StrToFloat(this.GetSelectedItem());
      return Result;
    };
    this.SetSelectedFontSize = function (Value) {
      this.SetSelectedItem(pas.SysUtils.FloatToStr(Value));
    };
    this.RegisterRuntimeClasses = function () {
      $mod.TTMSFNCToolBarButton.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClass($mod.TTMSFNCToolBarFontSizePicker);
    };
    this.DoItemSelected = function () {
      $mod.TTMSFNCToolBarCustomItemPicker.DoItemSelected.call(this);
      if (this.FOnFontSizeSelected != null) this.FOnFontSizeSelected(this,this.GetSelectedFontSize());
    };
    this.Create$1 = function (AOwner) {
      $mod.TTMSFNCToolBarCustomItemPicker.Create$1.apply(this,arguments);
      this.FAutoOptionsMenuText = "Font Size";
      this.FItems.Add("8");
      this.FItems.Add("9");
      this.FItems.Add("10");
      this.FItems.Add("11");
      this.FItems.Add("12");
      this.FItems.Add("14");
      this.FItems.Add("16");
      this.FItems.Add("18");
      this.FItems.Add("20");
      this.FItems.Add("22");
      this.FItems.Add("24");
      this.FItems.Add("26");
      this.FItems.Add("28");
      this.FItems.Add("36");
      this.FItems.Add("48");
      this.FItems.Add("72");
      return this;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("OnFontSizeSelected",0,$mod.$rtti["TTMSFNCToolBarFontSizePickerFontSizeSelected"],"FOnFontSizeSelected","FOnFontSizeSelected");
    $r.addProperty("CloseOnSelection",2,rtl.boolean,"FCloseOnSelection","SetCloseOnSelection",4,{Default: true});
    $r.addProperty("Editable",2,rtl.boolean,"FEditable","SetEditable",4,{Default: false});
    $r.addProperty("OnEditChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnEditChange","FOnEditChange");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
  this.$rtti.$MethodVar("TTMSFNCToolBarColorPickerColorSelected",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColor",pas["WEBLib.Graphics"].$rtti["TColor"]]]), methodkind: 0});
  this.$rtti.$ClassRef("TTMSFNCToolBarFontSizePickerClass",{instancetype: this.$rtti["TTMSFNCToolBarFontSizePicker"]});
  rtl.createClass(this,"TTMSFNCToolBarColorPicker",this.TTMSFNCToolBarButton,function () {
    this.$init = function () {
      $mod.TTMSFNCToolBarButton.$init.call(this);
      this.FColorSelector = null;
      this.FOnColorSelected = null;
    };
    this.$final = function () {
      this.FColorSelector = undefined;
      this.FOnColorSelected = undefined;
      $mod.TTMSFNCToolBarButton.$final.call(this);
    };
    this.GetSelectedColor = function () {
      var Result = 0;
      Result = this.FColorSelector.GetSelectedColor();
      return Result;
    };
    this.SetSelectedColor = function (Value) {
      this.FColorSelector.SetSelectedColor(Value);
      this.Invalidate();
    };
    this.GetSelectedItemIndex = function () {
      var Result = 0;
      Result = this.FColorSelector.FSelectedItemIndex;
      return Result;
    };
    this.SetSelectedItemIndex = function (Value) {
      this.FColorSelector.SetSelectedItemIndex(Value);
      this.Invalidate();
    };
    this.GetItems = function () {
      var Result = null;
      Result = this.FColorSelector.GetItems();
      return Result;
    };
    this.SetItems = function (Value) {
      this.FColorSelector.GetItems().Assign(Value);
    };
    this.RegisterRuntimeClasses = function () {
      $mod.TTMSFNCToolBarButton.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClass($mod.TTMSFNCToolBarColorPicker);
    };
    this.SetAdaptToStyle = function (Value) {
      $mod.TTMSFNCCustomToolBarButton.SetAdaptToStyle.apply(this,arguments);
      if (this.FColorSelector != null) this.FColorSelector.SetAdaptToStyle(this.GetAdaptToStyle());
    };
    this.DrawColor = function (AColor, ARect, AGraphics) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rounding = 0;
      var I = 0;
      var J = 0;
      var st = null;
      r.$assign(ARect);
      rounding = Math.round(Math.max(this.ScalePaintValue$1(3.5),this.FAppearance.FRounding / 4));
      pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,-rounding,-rounding);
      pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(r,this.ScalePaintValue$1(0.5),this.ScalePaintValue$1(0.5));
      st = AGraphics.SaveState(false);
      try {
        AGraphics.ClipRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r));
        AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
        AGraphics.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        AGraphics.FStroke.SetWidth(1);
        AGraphics.FFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(255,255,255));
        AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        AGraphics.FFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(211,211,211));
        for (var $l = 0, $end = pas.System.Trunc((r.Right - r.Left) / 5) + 1; $l <= $end; $l++) {
          I = $l;
          for (var $l1 = 0, $end1 = pas.System.Trunc((r.Bottom - r.Top) / 5) + 1; $l1 <= $end1; $l1++) {
            J = $l1;
            if (pas.System.Odd(I + J)) AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(I * 5,J * 5,(I + 1) * 5,(J + 1) * 5)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmNone);
          };
        };
        AGraphics.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        AGraphics.FFill.SetColor(AColor);
        AGraphics.FStroke.SetColor(0);
        AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
        AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
      } finally {
        AGraphics.RestoreState(st,false);
      };
    };
    this.ColorSelected = function (Sender, AColor) {
      if (this.FCloseOnSelection && !this.BlockChange()) this.CloseDropDown();
      this.DoColorSelected(AColor);
      this.Invalidate();
    };
    this.DoColorSelected = function (AColor) {
      if (this.FOnColorSelected != null) this.FOnColorSelected(this,AColor);
    };
    this.CanChangeText = function () {
      var Result = false;
      Result = !(pas.Classes.TComponentStateItem.csLoading in this.FComponentState) && !(pas.Classes.TComponentStateItem.csDesigning in this.FComponentState);
      return Result;
    };
    this.Create$1 = function (AOwner) {
      $mod.TTMSFNCCustomToolBarButton.Create$1.apply(this,arguments);
      this.SetWidth(40);
      this.SetHeight(24);
      this.FAutoOptionsMenuText = "Color";
      this.FColorSelector = pas["WEBLib.TMSFNCColorSelector"].TTMSFNCColorSelector.$create("Create$1",[this]);
      this.FColorSelector.FAppearance.SetHorizontalSpacing(2);
      this.FColorSelector.FAppearance.SetVerticalSpacing(2);
      this.FColorSelector.SetMode(pas["WEBLib.TMSFNCColorSelector"].TTMSFNCCustomColorSelectorMode.csmExtended);
      this.FColorSelector.SetWidth(175);
      this.FColorSelector.SetHeight(125);
      this.FColorSelector.FStored = false;
      this.FColorSelector.SetSelectedColor(0);
      this.FColorSelector.FOnColorSelected = rtl.createCallback(this,"ColorSelected");
      this.SetDropDownControl(this.FColorSelector);
      this.SetDropDownWidth(this.FColorSelector.GetWidth());
      this.SetDropDownHeight(this.FColorSelector.GetHeight());
      this.SetDropDownKind($mod.TTMSFNCToolBarButtonDropDownKind.ddkDropDownButton);
      return this;
    };
    this.BlockChange = function () {
      var Result = false;
      Result = this.FColorSelector.FBlockChange;
      return Result;
    };
    this.ColorSelector = function () {
      var Result = null;
      Result = this.FColorSelector;
      return Result;
    };
    this.Draw = function (AGraphics, ARect) {
      $mod.TTMSFNCDefaultToolBarButton.Draw.apply(this,arguments);
      this.DrawSelectedColor(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect));
    };
    this.DrawSelectedColor = function (AGraphics, ARect) {
      var R = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var c = 0;
      var ct = null;
      ct = this.GetDropDownButtonControl();
      if (ct != null) {
        R.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,this.GetWidth() - ct.GetWidth(),this.GetHeight()));
        c = this.GetSelectedColor();
        this.DrawColor(c,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(R),AGraphics);
      };
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("OnColorSelected",0,$mod.$rtti["TTMSFNCToolBarColorPickerColorSelected"],"FOnColorSelected","FOnColorSelected");
    $r.addProperty("SelectedColor",3,pas["WEBLib.Graphics"].$rtti["TColor"],"GetSelectedColor","SetSelectedColor",4,{Default: -1});
    $r.addProperty("SelectedItemIndex",3,rtl.longint,"GetSelectedItemIndex","SetSelectedItemIndex");
    $r.addProperty("Items",3,pas["WEBLib.TMSFNCColorSelector"].$rtti["TTMSFNCColorSelectorItems"],"GetItems","SetItems");
    $r.addProperty("CloseOnSelection",2,rtl.boolean,"FCloseOnSelection","SetCloseOnSelection",4,{Default: true});
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
  this.$rtti.$MethodVar("TTMSFNCToolBarBitmapPickerBitmapSelected",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ABitmap",pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"]]]), methodkind: 0});
  this.$rtti.$ClassRef("TTMSFNCToolBarColorPickerClass",{instancetype: this.$rtti["TTMSFNCToolBarColorPicker"]});
  rtl.createClass(this,"TTMSFNCToolBarBitmapPicker",this.TTMSFNCToolBarButton,function () {
    this.$init = function () {
      $mod.TTMSFNCToolBarButton.$init.call(this);
      this.FBitmapSelector = null;
      this.FOnBitmapSelected = null;
    };
    this.$final = function () {
      this.FBitmapSelector = undefined;
      this.FOnBitmapSelected = undefined;
      $mod.TTMSFNCToolBarButton.$final.call(this);
    };
    this.GetSelectedBitmap = function () {
      var Result = null;
      Result = this.FBitmapSelector.GetSelectedBitmap();
      return Result;
    };
    this.GetSelectedItemIndex = function () {
      var Result = 0;
      Result = this.FBitmapSelector.FSelectedItemIndex;
      return Result;
    };
    this.SetSelectedItemIndex = function (Value) {
      this.FBitmapSelector.SetSelectedItemIndex(Value);
      this.FBitmaps.Clear();
      this.FDisabledBitmaps.Clear();
      this.FHoverBitmaps.Clear();
      this.FBitmaps.AddBitmap(this.GetSelectedBitmap(),1.0);
      this.FDisabledBitmaps.AddBitmap(this.GetSelectedBitmap(),1.0);
      this.FHoverBitmaps.AddBitmap(this.GetSelectedBitmap(),1.0);
      this.Invalidate();
    };
    this.GetItems = function () {
      var Result = null;
      Result = this.FBitmapSelector.GetItems();
      return Result;
    };
    this.SetItems = function (Value) {
      if (this.FBitmapSelector != null) this.FBitmapSelector.GetItems().Assign(Value);
    };
    this.SetBitmapContainer = function (Value) {
      $mod.TTMSFNCDefaultToolBarButton.SetBitmapContainer.apply(this,arguments);
      if (this.FBitmapSelector != null) this.FBitmapSelector.SetBitmapContainer(Value);
    };
    this.GetBitmapRect$1 = function (ARect) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var dr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.$assign(ARect);
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top,r.Right,r.Bottom));
      if (this.FBitmapVisible) {
        if (this.FDropDownKind !== $mod.TTMSFNCToolBarButtonDropDownKind.ddkNormal) {
          dr.$assign(this.GetDropDownRect());
          var $tmp = this.FDropDownPosition;
          if ($tmp === $mod.TTMSFNCToolBarButtonDropDownPosition.ddpRight) {
            Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Result.Left + 3,Result.Top + 3,dr.Left - 3,Result.Bottom - 3))}
           else if ($tmp === $mod.TTMSFNCToolBarButtonDropDownPosition.ddpBottom) Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Result.Left + 3,Result.Top + 3,Result.Right - 3,dr.Top - 3));
        } else Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Result.Left + 3,Result.Top + 3,Result.Right - 3,Result.Bottom - 3));
      };
      return Result;
    };
    this.CanChangeText = function () {
      var Result = false;
      Result = !(pas.Classes.TComponentStateItem.csLoading in this.FComponentState) && !(pas.Classes.TComponentStateItem.csDesigning in this.FComponentState);
      return Result;
    };
    this.RegisterRuntimeClasses = function () {
      $mod.TTMSFNCToolBarButton.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClass($mod.TTMSFNCToolBarBitmapPicker);
    };
    this.SetAdaptToStyle = function (Value) {
      $mod.TTMSFNCCustomToolBarButton.SetAdaptToStyle.apply(this,arguments);
      if (this.FBitmapSelector != null) this.FBitmapSelector.SetAdaptToStyle(this.GetAdaptToStyle());
    };
    this.BitmapSelected = function (Sender, ABitmap) {
      this.FBitmaps.Clear();
      this.FDisabledBitmaps.Clear();
      this.FHoverBitmaps.Clear();
      this.FBitmaps.AddBitmap(ABitmap,1.0);
      this.FDisabledBitmaps.AddBitmap(ABitmap,1.0);
      this.FHoverBitmaps.AddBitmap(ABitmap,1.0);
      if (this.FCloseOnSelection && !this.BlockChange()) this.CloseDropDown();
      this.DoBitmapSelected(ABitmap);
    };
    this.DoBitmapSelected = function (ABitmap) {
      if (this.FOnBitmapSelected != null) this.FOnBitmapSelected(this,ABitmap);
    };
    this.Create$1 = function (AOwner) {
      $mod.TTMSFNCCustomToolBarButton.Create$1.apply(this,arguments);
      this.SetWidth(40);
      this.SetHeight(24);
      this.FAutoOptionsMenuText = "Bitmap";
      this.FBitmapSelector = pas["WEBLib.TMSFNCBitmapSelector"].TTMSFNCBitmapSelector.$create("Create$1",[this]);
      this.FBitmapSelector.FAppearance.SetHorizontalSpacing(2);
      this.FBitmapSelector.FAppearance.SetVerticalSpacing(2);
      this.FBitmapSelector.FStored = false;
      this.FBitmapSelector.FOnBitmapSelected = rtl.createCallback(this,"BitmapSelected");
      this.SetDropDownControl(this.FBitmapSelector);
      this.SetDropDownWidth(this.FBitmapSelector.GetWidth());
      this.SetDropDownHeight(this.FBitmapSelector.GetHeight());
      this.SetDropDownKind($mod.TTMSFNCToolBarButtonDropDownKind.ddkDropDownButton);
      return this;
    };
    this.BlockChange = function () {
      var Result = false;
      Result = this.FBitmapSelector.FBlockChange;
      return Result;
    };
    this.BitmapSelector = function () {
      var Result = null;
      Result = this.FBitmapSelector;
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("OnBitmapSelected",0,$mod.$rtti["TTMSFNCToolBarBitmapPickerBitmapSelected"],"FOnBitmapSelected","FOnBitmapSelected");
    $r.addProperty("SelectedItemIndex",3,rtl.longint,"GetSelectedItemIndex","SetSelectedItemIndex");
    $r.addProperty("Items",3,pas["WEBLib.TMSFNCBitmapSelector"].$rtti["TTMSFNCBitmapSelectorItems"],"GetItems","SetItems");
    $r.addProperty("CloseOnSelection",2,rtl.boolean,"FCloseOnSelection","SetCloseOnSelection",4,{Default: true});
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
  this.$rtti.$ClassRef("TTMSFNCToolBarBitmapPickerClass",{instancetype: this.$rtti["TTMSFNCToolBarBitmapPicker"]});
  rtl.createClass(this,"TTMSFNCCustomToolBarAppearance",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FOwner = null;
      this.FFill = null;
      this.FStroke = null;
      this.FVerticalSpacing = 0.0;
      this.FHorizontalSpacing = 0.0;
      this.FDragGripColor = 0;
      this.FDragGrip = false;
      this.FFlatStyle = false;
      this.FFont = null;
      this.FSeparatorStroke = null;
      this.FSeparator = false;
    };
    this.$final = function () {
      this.FOwner = undefined;
      this.FFill = undefined;
      this.FStroke = undefined;
      this.FFont = undefined;
      this.FSeparatorStroke = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetFill = function (Value) {
      this.FFill.Assign(Value);
    };
    this.SetStroke = function (Value) {
      this.FStroke.Assign(Value);
    };
    this.SetHorizontalSpacing = function (Value) {
      if (this.FHorizontalSpacing !== Value) {
        this.FHorizontalSpacing = Value;
        this.FOwner.UpdateControls();
      };
    };
    this.SetVerticalSpacing = function (Value) {
      if (this.FVerticalSpacing !== Value) {
        this.FVerticalSpacing = Value;
        this.FOwner.UpdateControls();
      };
    };
    this.SetDragGrip = function (Value) {
      if (this.FDragGrip !== Value) {
        this.FDragGrip = Value;
        this.FOwner.UpdateControls();
      };
    };
    this.SetDragGripColor = function (Value) {
      if (this.FDragGripColor !== Value) {
        this.FDragGripColor = Value;
        this.FOwner.Invalidate();
      };
    };
    this.IsHorizontalSpacingStored = function () {
      var Result = false;
      Result = this.FHorizontalSpacing !== 3;
      return Result;
    };
    this.IsVerticalSpacingStored = function () {
      var Result = false;
      Result = this.FVerticalSpacing !== 3;
      return Result;
    };
    this.SetFlatStyle = function (Value) {
      if (this.FFlatStyle !== Value) {
        this.FFlatStyle = Value;
        if (this.FOwner != null) this.FOwner.ApplyFlatStyle();
      };
    };
    this.SetSeparator = function (Value) {
      if (this.FSeparator !== Value) {
        this.FSeparator = Value;
        this.FOwner.Invalidate();
      };
    };
    this.SetSeparatorStroke = function (Value) {
      this.FSeparatorStroke.Assign(Value);
    };
    this.FillChanged = function (Sender) {
      this.FOwner.Invalidate();
    };
    this.StrokeChanged = function (Sender) {
      this.FOwner.Invalidate();
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCCustomToolBarAppearance.isPrototypeOf(Source)) {
        this.FSeparatorStroke.Assign(rtl.as(Source,$mod.TTMSFNCCustomToolBarAppearance).FSeparatorStroke);
        this.FSeparator = rtl.as(Source,$mod.TTMSFNCCustomToolBarAppearance).FSeparator;
        this.FFill.Assign(rtl.as(Source,$mod.TTMSFNCCustomToolBarAppearance).FFill);
        this.FStroke.Assign(rtl.as(Source,$mod.TTMSFNCCustomToolBarAppearance).FStroke);
        this.FHorizontalSpacing = rtl.as(Source,$mod.TTMSFNCCustomToolBarAppearance).FHorizontalSpacing;
        this.FVerticalSpacing = rtl.as(Source,$mod.TTMSFNCCustomToolBarAppearance).FVerticalSpacing;
        this.FDragGripColor = rtl.as(Source,$mod.TTMSFNCCustomToolBarAppearance).FDragGripColor;
        this.FDragGrip = rtl.as(Source,$mod.TTMSFNCCustomToolBarAppearance).FDragGrip;
        this.FFlatStyle = rtl.as(Source,$mod.TTMSFNCCustomToolBarAppearance).FFlatStyle;
      };
    };
    this.Create$1 = function (AOwner) {
      this.FOwner = AOwner;
      this.FFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FFlatStyle = false;
      this.FHorizontalSpacing = 3;
      this.FVerticalSpacing = 3;
      this.FDragGrip = true;
      this.FDragGripColor = 13882323;
      this.FFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient,16777215,pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(230,230,230),-1,-1]);
      this.FStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,8421504,1.0]);
      this.FFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FSeparatorStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,16777215,1.0]);
      this.FSeparatorStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FSeparatorStroke");
      rtl.free(this,"FFont");
      rtl.free(this,"FFill");
      rtl.free(this,"FStroke");
      pas.System.TObject.Destroy.call(this);
    };
  });
  rtl.createClass(this,"TTMSFNCToolBarAppearance",this.TTMSFNCCustomToolBarAppearance,function () {
    var $r = this.$rtti;
    $r.addProperty("FlatStyle",2,rtl.boolean,"FFlatStyle","SetFlatStyle",4,{Default: false});
    $r.addProperty("Fill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFill","SetFill");
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
    $r.addProperty("Separator",2,rtl.boolean,"FSeparator","SetSeparator",4,{Default: false});
    $r.addProperty("SeparatorStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FSeparatorStroke","SetSeparatorStroke");
    $r.addProperty("HorizontalSpacing",14,rtl.double,"FHorizontalSpacing","SetHorizontalSpacing",4,{stored: "IsHorizontalSpacingStored"});
    $r.addProperty("VerticalSpacing",14,rtl.double,"FVerticalSpacing","SetVerticalSpacing",4,{stored: "IsVerticalSpacingStored"});
    $r.addProperty("DragGrip",2,rtl.boolean,"FDragGrip","SetDragGrip",4,{Default: true});
    $r.addProperty("DragGripColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FDragGripColor","SetDragGripColor",4,{Default: 13882323});
  });
  rtl.createClass(this,"TTMSFNCToolBarOptionMenuItem",pas["WEBLib.Menus"].TMenuItem,function () {
    this.$init = function () {
      pas["WEBLib.Menus"].TMenuItem.$init.call(this);
      this.FControl = null;
      this.FGlyphWidth = 0.0;
      this.FCalculate = false;
    };
    this.$final = function () {
      this.FControl = undefined;
      pas["WEBLib.Menus"].TMenuItem.$final.call(this);
    };
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCToolBarControl",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FControlIndex = 0;
      this.FControl = null;
      this.FLayout = 0;
      this.FBitmap = null;
    };
    this.$final = function () {
      this.FControl = undefined;
      this.FBitmap = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.Create$1 = function () {
      this.FBitmap = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FBitmap");
      pas.System.TObject.Destroy.call(this);
    };
  });
  this.$rtti.$ClassRef("TControlClass",{instancetype: pas["WEBLib.Controls"].$rtti["TControl"]});
  this.$rtti.$MethodVar("TTMSFNCToolBarCustomizeOptionsMenu",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["APopupMenu",pas["WEBLib.Menus"].$rtti["TPopupMenu"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCToolBarCustomizeOptionsMenuItem",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AControl",pas["WEBLib.Controls"].$rtti["TControl"]],["AMenuItem",pas["WEBLib.Menus"].$rtti["TMenuItem"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCToolBarCanShowOptionsMenuItem",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AControl",pas["WEBLib.Controls"].$rtti["TControl"]],["ACanShowItem",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCToolBarOptionsMenuItemClick",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AControl",pas["WEBLib.Controls"].$rtti["TControl"]],["AMenuItem",pas["WEBLib.Menus"].$rtti["TMenuItem"]],["AExecuteDefaultAction",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCToolBarIsLastElement",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AControl",pas["WEBLib.Controls"].$rtti["TControl"]],["AIsLastElement",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCToolBarAnchorClickEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AAnchor",rtl.string]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCCustomToolBarOptionsMenu",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FOwner = null;
      this.FShowItemText = false;
      this.FShowItemBitmap = false;
      this.FShowButton = false;
      this.FItemBitmapWidth = 0.0;
      this.FAutoItemBitmapWidth = false;
    };
    this.$final = function () {
      this.FOwner = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetShowButton = function (Value) {
      if (this.FShowButton !== Value) {
        this.FShowButton = Value;
        this.FOwner.FOptionsMenuButton.SetVisible(this.FShowButton);
        if (this.FShowButton) {
          this.FOwner.FOptionsMenuButton.SetParent(this.FOwner)}
         else this.FOwner.FOptionsMenuButton.SetParent(null);
        this.FOwner.UpdateControls();
      };
    };
    this.SetShowItemBitmap = function (Value) {
      if (this.FShowItemBitmap !== Value) {
        this.FShowItemBitmap = Value;
      };
    };
    this.SetShowItemText = function (Value) {
      if (this.FShowItemText !== Value) {
        this.FShowItemText = Value;
      };
    };
    this.SetAutoItemBitmapWidth = function (Value) {
      if (this.FAutoItemBitmapWidth !== Value) {
        this.FAutoItemBitmapWidth = Value;
      };
    };
    this.SetItemBitmapWidth = function (Value) {
      if (this.FItemBitmapWidth !== Value) {
        this.FItemBitmapWidth = Value;
      };
    };
    this.IsItemBitmapWidthStored = function () {
      var Result = false;
      Result = this.FItemBitmapWidth !== 50;
      return Result;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCCustomToolBarOptionsMenu.isPrototypeOf(Source)) {
        this.FShowItemText = rtl.as(Source,$mod.TTMSFNCCustomToolBarOptionsMenu).FShowItemText;
        this.FShowItemBitmap = rtl.as(Source,$mod.TTMSFNCCustomToolBarOptionsMenu).FShowItemBitmap;
        this.FShowButton = rtl.as(Source,$mod.TTMSFNCCustomToolBarOptionsMenu).FShowButton;
        this.FAutoItemBitmapWidth = rtl.as(Source,$mod.TTMSFNCCustomToolBarOptionsMenu).FAutoItemBitmapWidth;
        this.FItemBitmapWidth = rtl.as(Source,$mod.TTMSFNCCustomToolBarOptionsMenu).FItemBitmapWidth;
      };
    };
    this.Create$1 = function (AOwner) {
      this.FOwner = AOwner;
      this.FShowItemText = true;
      this.FShowButton = true;
      this.FShowItemBitmap = true;
      this.FAutoItemBitmapWidth = true;
      this.FItemBitmapWidth = 50;
      return this;
    };
    this.Destroy = function () {
      pas.System.TObject.Destroy.call(this);
    };
  });
  rtl.createClass(this,"TTMSFNCToolBarOptionsMenu",this.TTMSFNCCustomToolBarOptionsMenu,function () {
    var $r = this.$rtti;
    $r.addProperty("ShowButton",2,rtl.boolean,"FShowButton","SetShowButton",4,{Default: true});
    $r.addProperty("ShowItemBitmap",2,rtl.boolean,"FShowItemBitmap","SetShowItemBitmap",4,{Default: true});
    $r.addProperty("ShowItemText",2,rtl.boolean,"FShowItemText","SetShowItemText",4,{Default: true});
    $r.addProperty("AutoItemBitmapWidth",2,rtl.boolean,"FAutoItemBitmapWidth","SetAutoItemBitmapWidth",4,{Default: true});
    $r.addProperty("ItemBitmapWidth",14,rtl.double,"FItemBitmapWidth","SetItemBitmapWidth",4,{stored: "IsItemBitmapWidthStored"});
  });
  rtl.createClass(this,"TTMSFNCToolBarControlObjectList",pas.contnrs.TObjectList,function () {
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      this.SetItem(Index,Value);
    };
  });
  rtl.createClass(this,"TTMSFNCToolBarControlList",pas.Classes.TList,function () {
    this.GetItem = function (Index) {
      var Result = null;
      Result = rtl.getObject(this.Get(Index));
      return Result;
    };
    this.SetItem = function (Index, Value) {
      this.Put(Index,Value);
    };
  });
  rtl.createClass(this,"TTMSFNCControlList",pas.Classes.TList,function () {
    this.GetItem = function (Index) {
      var Result = null;
      Result = rtl.getObject(this.Get(Index));
      return Result;
    };
    this.SetItem = function (Index, Value) {
      this.Put(Index,Value);
    };
  });
  this.$rtti.$MethodVar("TTMSFNCToolBarDragGripMovingEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["DeltaX",rtl.double],["DeltaY",rtl.double]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCToolBarPopup",pas["WEBLib.TMSFNCPopup"].TTMSFNCPopup,function () {
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.$rtti.$Class("TTMSFNCToolBar");
  this.$rtti.$MethodVar("TTMSFNCToolBarCustomizeCompactToolBarEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACompactToolBar",this.$rtti["TTMSFNCToolBar"]]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCCustomToolBar",pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$init.call(this);
      this.FCompactToolbar = null;
      this.FCompactPopup = null;
      this.FHover = false;
      this.FHoverP = false;
      this.FQuickMenuButtonHover = false;
      this.FQuickMenuButtonHoverP = false;
      this.FDown = false;
      this.FQuickMenuButtonDown = false;
      this.FOldWidth = 0.0;
      this.FOldMenuButtonState = false;
      this.FBitmapContainer = null;
      this.FInsideDrag = false;
      this.FDragGripMoving = false;
      this.FDragGripDown = false;
      this.FDragGripDownPt = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      this.FTotalOptionsMenuWidth = 0.0;
      this.FHiddenControls = null;
      this.FCompactControls = null;
      this.FBlockUpdate = false;
      this.FBlockResize = false;
      this.FAutoSize = false;
      this.FAppearance = null;
      this.FAutoAlign = false;
      this.FOptionsMenuButton = null;
      this.FAutoOptionsMenu = null;
      this.FOnOptionsMenuCustomize = null;
      this.FOnOptionsMenuItemCustomize = null;
      this.FOnOptionsMenuButtonClick = null;
      this.FOptionsMenu = null;
      this.FCustomOptionsMenu = null;
      this.FOnOptionsMenuItemCanShow = null;
      this.FState = 0;
      this.FOnOptionsMenuItemClick = null;
      this.FOnOptionsMenuItemApplyStyle = null;
      this.FOnUpdateDockPanel = null;
      this.FOnUpdateControls = null;
      this.FOnIsLastElement = null;
      this.FOnDragGripMoving = null;
      this.FAutoMoveToolBar = false;
      this.FOnInternalDblClick$1 = null;
      this.FOnInternalMouseDown$1 = null;
      this.FOnInternalMouseMove$1 = null;
      this.FOnInternalMouseUp$1 = null;
      this.FAutoHeight = false;
      this.FAutoWidth = false;
      this.FOnInternalInsertControl = null;
      this.FAutoStretchHeight = false;
      this.FText = "";
      this.FFirstLoad = false;
      this.FFont$1 = null;
      this.FVerticalTextAlign = 0;
      this.FTrimming = 0;
      this.FHorizontalTextAlign = 0;
      this.FWordWrapping = false;
      this.FTextVisible = false;
      this.FMinimumWidth = 0.0;
      this.FCompact = false;
      this.FCanCompact = false;
      this.FCompactWidth = 0.0;
      this.FCompactAppearance = null;
      this.FCompactBitmaps = null;
      this.FOnCompactClick = null;
      this.FCompactBitmapSize = 0.0;
      this.FCompactBitmapVisible = false;
      this.FCompactExpanderBitmaps = null;
      this.FQuickMenuButton = false;
      this.FQuickMenuButtonAppearance = null;
      this.FOnQuickMenuButtonClick = null;
      this.FQuickMenuButtonBitmaps = null;
      this.FQuickMenuButtonHint = "";
      this.FCompactAutoBitmapSize = false;
      this.FOnAnchorClick = null;
      this.FDisabledFontColor = 0;
      this.FOnCustomizeCompactToolBar = null;
    };
    this.$final = function () {
      this.FCompactToolbar = undefined;
      this.FCompactPopup = undefined;
      this.FBitmapContainer = undefined;
      this.FDragGripDownPt = undefined;
      this.FHiddenControls = undefined;
      this.FCompactControls = undefined;
      this.FAppearance = undefined;
      this.FOptionsMenuButton = undefined;
      this.FAutoOptionsMenu = undefined;
      this.FOnOptionsMenuCustomize = undefined;
      this.FOnOptionsMenuItemCustomize = undefined;
      this.FOnOptionsMenuButtonClick = undefined;
      this.FOptionsMenu = undefined;
      this.FCustomOptionsMenu = undefined;
      this.FOnOptionsMenuItemCanShow = undefined;
      this.FOnOptionsMenuItemClick = undefined;
      this.FOnOptionsMenuItemApplyStyle = undefined;
      this.FOnUpdateDockPanel = undefined;
      this.FOnUpdateControls = undefined;
      this.FOnIsLastElement = undefined;
      this.FOnDragGripMoving = undefined;
      this.FOnInternalDblClick$1 = undefined;
      this.FOnInternalMouseDown$1 = undefined;
      this.FOnInternalMouseMove$1 = undefined;
      this.FOnInternalMouseUp$1 = undefined;
      this.FOnInternalInsertControl = undefined;
      this.FFont$1 = undefined;
      this.FCompactAppearance = undefined;
      this.FCompactBitmaps = undefined;
      this.FOnCompactClick = undefined;
      this.FCompactExpanderBitmaps = undefined;
      this.FQuickMenuButtonAppearance = undefined;
      this.FOnQuickMenuButtonClick = undefined;
      this.FQuickMenuButtonBitmaps = undefined;
      this.FOnAnchorClick = undefined;
      this.FOnCustomizeCompactToolBar = undefined;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$final.call(this);
    };
    this.SetAppearance = function (Value) {
      this.FAppearance.Assign(Value);
    };
    this.SetAS = function (Value) {
      if (this.FAutoSize !== Value) {
        this.FAutoSize = Value;
        this.UpdateControls();
      };
    };
    this.SetAutoAlign = function (Value) {
      if (this.FAutoAlign !== Value) {
        this.FAutoAlign = Value;
        this.UpdateControls();
      };
    };
    this.SetOptionsMenu = function (Value) {
      this.FOptionsMenu.Assign(Value);
    };
    this.SetState = function (Value) {
      var I = 0;
      var c = null;
      if (this.FState !== Value) {
        this.FState = Value;
        for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
          I = $l;
          c = this.GetControls(I);
          if ($mod.TTMSFNCCustomToolBarElement.isPrototypeOf(c)) rtl.as(c,$mod.TTMSFNCCustomToolBarElement).SetState(this.FState);
        };
      };
    };
    this.SetAutoHeight = function (Value) {
      if (this.FAutoHeight !== Value) {
        this.FAutoHeight = Value;
        this.UpdateControls();
      };
    };
    this.SetAutoWidth = function (Value) {
      if (this.FAutoWidth !== Value) {
        this.FAutoWidth = Value;
        this.UpdateControls();
      };
    };
    this.SetAutoStretchHeight = function (Value) {
      if (this.FAutoStretchHeight !== Value) {
        this.FAutoStretchHeight = Value;
        this.UpdateControls();
      };
    };
    this.SetText = function (Value) {
      if (this.FText !== Value) {
        this.FText = Value;
        this.UpdateControls();
      };
    };
    this.GetBitmapContainer = function () {
      var Result = null;
      Result = this.FBitmapContainer;
      return Result;
    };
    this.SetBitmapContainer = function (Value) {
      var I = 0;
      var c = null;
      var b = null;
      var $ir = rtl.createIntfRefs();
      try {
        this.FBitmapContainer = Value;
        for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
          I = $l;
          if (pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(c,pas.System.IUnknown)),rtl.getIntfGUIDR(pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer),{get: function () {
              return b;
            }, set: function (v) {
              b = v;
            }})) b.SetBitmapContainer(Value);
        };
        this.Invalidate();
      } finally {
        $ir.free();
        rtl._Release(b);
      };
    };
    this.SetFont$1 = function (Value) {
      this.FFont$1.Assign(Value);
    };
    this.SetHorizontalTextAlign = function (Value) {
      if (this.FHorizontalTextAlign !== Value) {
        this.FHorizontalTextAlign = Value;
        this.Invalidate();
      };
    };
    this.SetTrimming = function (Value) {
      if (this.FTrimming !== Value) {
        this.FTrimming = Value;
        this.UpdateControls();
      };
    };
    this.SetVerticalTextAlign = function (Value) {
      if (this.FVerticalTextAlign !== Value) {
        this.FVerticalTextAlign = Value;
        this.UpdateControls();
      };
    };
    this.SetWordWrapping = function (Value) {
      if (this.FWordWrapping !== Value) {
        this.FWordWrapping = Value;
        this.UpdateControls();
      };
    };
    this.SetTextVisible = function (Value) {
      if (this.FTextVisible !== Value) {
        this.FTextVisible = Value;
        this.UpdateControls();
      };
    };
    this.IsMinimumWidthStored = function () {
      var Result = false;
      Result = this.FMinimumWidth !== 30;
      return Result;
    };
    this.SetMinimumWidth = function (Value) {
      if (this.FMinimumWidth !== Value) {
        this.FMinimumWidth = Value;
        this.UpdateControls();
      };
    };
    this.SetCompact = function (Value) {
      if (this.FCompact !== Value) {
        if (this.FCanCompact) {
          this.FCompact = Value;
          if (this.FCompact) {
            this.FOldMenuButtonState = this.FOptionsMenu.FShowButton;
            this.FOptionsMenu.SetShowButton(false);
            this.FOldWidth = this.GetWidth();
            this.CompactControls();
            this.SetWidth(Math.round(this.FCompactWidth));
          } else {
            this.SetWidth(Math.round(this.FOldWidth));
            this.UncompactControls();
            this.FOptionsMenu.SetShowButton(this.FOldMenuButtonState);
          };
          this.UpdateControls();
        };
      };
    };
    this.SetCanCompact = function (Value) {
      if (this.FCanCompact !== Value) this.FCanCompact = Value;
    };
    this.IsCompactWidthStored = function () {
      var Result = false;
      Result = this.FCompactWidth !== 50;
      return Result;
    };
    this.SetCompactWidth = function (Value) {
      if (this.FCompactWidth !== Value) {
        this.FCompactWidth = Value;
        if (this.FCompact) this.SetWidth(Math.round(this.FCompactWidth));
      };
    };
    this.SetCompactAppearance = function (Value) {
      this.FCompactAppearance.Assign(Value);
    };
    this.SetCompactBitmaps = function (Value) {
      this.FCompactBitmaps.Assign(Value);
    };
    this.IsCompactBitmapSizeStored = function () {
      var Result = false;
      Result = this.FCompactBitmapSize !== 24;
      return Result;
    };
    this.SetCompactBitmapSize = function (Value) {
      if (this.FCompactBitmapSize !== Value) {
        this.FCompactBitmapSize = Value;
        this.Invalidate();
      };
    };
    this.SetCompactBitmapVisible = function (Value) {
      if (this.FCompactBitmapVisible !== Value) {
        this.FCompactBitmapVisible = Value;
        this.Invalidate();
      };
    };
    this.SetCompactExpanderBitmaps = function (Value) {
      this.FCompactExpanderBitmaps.Assign(Value);
    };
    this.SetQuickMenuButton = function (Value) {
      if (this.FQuickMenuButton !== Value) {
        this.FQuickMenuButton = Value;
        this.Invalidate();
      };
    };
    this.SetQuickMenuButtonAppearance = function (Value) {
      this.FQuickMenuButtonAppearance.Assign(Value);
    };
    this.SetQuickMenuButtonBitmaps = function (Value) {
      this.FQuickMenuButtonBitmaps.Assign(Value);
    };
    this.SetCompactAutoBitmapSize = function (Value) {
      if (this.FCompactAutoBitmapSize !== Value) {
        this.FCompactAutoBitmapSize = Value;
        this.Invalidate();
      };
    };
    this.GetTextRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var h = 0.0;
      var sz = 0.0;
      sz = 0;
      if (this.FAppearance.FDragGrip) {
        if (this.FState === $mod.TTMSFNCToolBarElementState.esLarge) {
          sz = 3}
         else sz = 2;
      };
      r.$assign(this.GetLocalRect());
      r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + this.ScalePaintValue$1(sz),r.Top,r.Right,r.Bottom));
      pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,this.ScalePaintValue(-2),this.ScalePaintValue(-2));
      h = this.GetTextSize().cy;
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Bottom - h,r.Right,r.Bottom));
      return Result;
    };
    this.SetDisabledFontColor = function (Value) {
      if (this.FDisabledFontColor !== Value) {
        this.FDisabledFontColor = Value;
        this.Invalidate();
      };
    };
    this.GetSubComponentArray = function () {
      var Result = [];
      var I = 0;
      Result = rtl.arraySetLength(Result,null,this.GetControlsCount() + this.FHiddenControls.GetCount() + 1);
      for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
        I = $l;
        Result[I] = this.GetControls(I);
      };
      for (var $l1 = 0, $end1 = this.FHiddenControls.GetCount() - 1; $l1 <= $end1; $l1++) {
        I = $l1;
        Result[I + this.GetControlsCount()] = this.FHiddenControls.GetItem$1(I).FControl;
      };
      Result[rtl.length(Result) - 1] = this.FOptionsMenuButton;
      return Result;
    };
    this.GetDocURL = function () {
      var Result = "";
      Result = pas["WEBLib.TMSFNCTypes"].TTMSFNCBaseDocURL + "tmsfncuipack/components/" + pas.SysUtils.LowerCase(this.$classname);
      return Result;
    };
    this.GetVersion = function () {
      var Result = "";
      Result = this.$class.GetVersionNumber(1,0,2,6);
      return Result;
    };
    this.CanDrawDesignTime = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    this.CanBuildControls = function () {
      var Result = false;
      Result = true;
      return Result;
    };
    this.GetOptionsMenuButtonClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCToolBarDropDownButton;
      return Result;
    };
    this.GetBitmapPickerClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCToolBarBitmapPicker;
      return Result;
    };
    this.GetToolBarButtonClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCToolBarButton;
      return Result;
    };
    this.GetColorPickerClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCToolBarColorPicker;
      return Result;
    };
    this.GetItemPickerClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCToolBarItemPicker;
      return Result;
    };
    this.GetFontNamePickerClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCToolBarFontNamePicker;
      return Result;
    };
    this.GetFontSizePickerClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCToolBarFontSizePicker;
      return Result;
    };
    this.GetToolBarSeparatorClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCToolBarSeparator;
      return Result;
    };
    this.GetTextSize = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TSizeF.$new();
      var g = null;
      var sz = 0.0;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.cx = 0;
      Result.cy = 0;
      if (this.FTextVisible && (this.FText !== "")) {
        g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[1,1,this.FNativeCanvas,true]);
        if (!this.FNativeCanvas) g.BeginScene();
        g.FBitmapContainer = this.GetBitmapContainer();
        g.FOptimizedHTMLDrawing = this.FOptimizedHTMLDrawing;
        try {
          sz = 0;
          if (this.FAppearance.FDragGrip) {
            if (this.FState === $mod.TTMSFNCToolBarElementState.esLarge) {
              sz = 3}
             else sz = 2;
          };
          g.FFont.Assign(this.FFont$1);
          r.$assign(this.GetLocalRect());
          r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + sz,r.Top,r.Right,r.Bottom));
          pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,-2,-2);
          Result.$assign(g.CalculateTextSize(this.FText,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FWordWrapping,true));
        } finally {
          if (!this.FNativeCanvas) g.EndScene();
          g = rtl.freeLoc(g);
        };
      };
      return Result;
    };
    this.GetHiddenControl = function (AControl) {
      var Result = null;
      var I = 0;
      Result = null;
      for (var $l = 0, $end = this.FHiddenControls.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (this.FHiddenControls.GetItem$1(I).FControl === AControl) {
          Result = this.FHiddenControls.GetItem$1(I);
          break;
        };
      };
      return Result;
    };
    this.GetCompactControl = function (AControl) {
      var Result = null;
      var I = 0;
      Result = null;
      for (var $l = 0, $end = this.FCompactControls.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (this.FCompactControls.GetItem$1(I).FControl === AControl) {
          Result = this.FCompactControls.GetItem$1(I);
          break;
        };
      };
      return Result;
    };
    this.GetHiddenControlCount = function (AControl) {
      var Result = 0;
      var I = 0;
      var lst = null;
      lst = $mod.TTMSFNCToolBarControlList.$create("Create$1");
      for (var $l = 0, $end = this.FHiddenControls.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        lst.Add(this.FHiddenControls.GetItem$1(I));
      };
      Result = 0;
      for (var $l1 = 0, $end1 = lst.GetCount() - 1; $l1 <= $end1; $l1++) {
        I = $l1;
        if (lst.GetItem(I).FControl === AControl) {
          break}
         else Result += 1;
      };
      lst = rtl.freeLoc(lst);
      return Result;
    };
    this.GetCompactControlCount = function () {
      var Result = 0;
      Result = this.FCompactControls.GetCount();
      return Result;
    };
    this.GetCompactTextRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var bmpr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.$assign(this.GetLocalRect());
      bmpr.$assign(this.GetCompactBitmapRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r)));
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + 3,bmpr.Bottom + 3,r.Right - 3,r.Bottom - 23));
      return Result;
    };
    this.GetCompactBitmapRect = function (ARect) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var bs = 0.0;
      r.$assign(ARect);
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top,r.Right,r.Top));
      if (this.FCompactBitmapVisible) {
        bs = this.GetCompactBitmapSize();
        if (!this.FTextVisible || (this.FText === "")) {
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + 3,r.Top + 3,r.Right - 3,r.Bottom - 3));
          if (bs !== -1) {
            Result.Left = Math.round(r.Left + ((r.Right - r.Left - bs) / 2));
            Result.Top = Math.round(r.Top + ((r.Bottom - r.Top - bs) / 2));
            Result.Right = Result.Left + bs;
            Result.Bottom = Result.Top + bs;
          };
        } else if (this.FTextVisible && !(this.FText === "")) Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + 3,r.Top + 3,r.Right - 3,r.Top + bs));
      };
      return Result;
    };
    this.GetCompactBitmapSize = function () {
      var Result = 0.0;
      var bmp = null;
      Result = this.FCompactBitmapSize;
      if (this.FCompactAutoBitmapSize) {
        bmp = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.GetScaledBitmap(this.FCompactBitmaps,0,this.GetBitmapContainer());
        if ((bmp != null) && !pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(bmp)) Result = Math.max(bmp.GetHeight(),bmp.GetWidth());
      };
      return Result;
    };
    this.GetQuickMenuButtonRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.GetWidth() - 16,this.GetHeight() - 16,this.GetWidth(),this.GetHeight()));
      if (this.FAppearance.FSeparator) {
        Result.Left = Result.Left - this.FAppearance.FSeparatorStroke.FWidth;
        Result.Right = Result.Right - this.FAppearance.FSeparatorStroke.FWidth;
      };
      return Result;
    };
    this.HasHint = function () {
      var Result = false;
      Result = pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBase.HasHint.call(this);
      if (this.FQuickMenuButtonHover) Result = this.FQuickMenuButtonHint !== "";
      return Result;
    };
    this.GetHintString = function () {
      var Result = "";
      Result = pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBase.GetHintString.call(this);
      if (this.FQuickMenuButtonHover) Result = this.FQuickMenuButtonHint;
      return Result;
    };
    this.ChangeDPIScale = function (M, D) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ChangeDPIScale.apply(this,arguments);
      this.FFont$1.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FFont$1.FHeight,M,D));
      this.FAppearance.SetHorizontalSpacing(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FAppearance.FHorizontalSpacing,M,D));
      this.FAppearance.SetVerticalSpacing(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FAppearance.FVerticalSpacing,M,D));
      this.SetCompactWidth(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FCompactWidth,M,D));
      this.SetCompactBitmapSize(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FCompactBitmapSize,M,D));
    };
    this.HandleQuickMenuButton = function () {
      if (this.FOnQuickMenuButtonClick != null) this.FOnQuickMenuButtonClick(this);
    };
    this.CompactAppearanceChanged = function (Sender) {
      this.Invalidate();
    };
    this.QuickMenuButtonAppearanceChanged = function (Sender) {
      this.Invalidate();
    };
    this.CompactBitmapsChanged = function (Sender) {
      var bmp = null;
      bmp = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.GetScaledBitmap(this.FCompactBitmaps,0,this.GetBitmapContainer());
      this.SetCompactBitmapVisible((bmp != null) && !pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(bmp));
      this.Invalidate();
    };
    this.CompactExpanderBitmapsChanged = function (Sender) {
      this.Invalidate();
    };
    this.QuickMenuButtonBitmapsChanged = function (Sender) {
      this.Invalidate();
    };
    this.ApplyFlatStyle = function () {
      var I = 0;
      var c = null;
      for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
        I = $l;
        c = this.GetControls(I);
        if ($mod.TTMSFNCDefaultToolBarButton.isPrototypeOf(c)) rtl.as(c,$mod.TTMSFNCDefaultToolBarButton).FAppearance.SetFlatStyle(this.FAppearance.FFlatStyle);
        if ($mod.TTMSFNCCustomToolBar.isPrototypeOf(c)) rtl.as(c,$mod.TTMSFNCCustomToolBar).FAppearance.SetFlatStyle(this.FAppearance.FFlatStyle);
      };
      this.Invalidate();
    };
    this.SetAdaptToStyle = function (Value) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.SetAdaptToStyle.apply(this,arguments);
      this.UpdateControls();
    };
    this.ApplyStyle = function () {
      var c = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ApplyStyle.call(this);
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleHeaderFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FAppearance.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        this.FAppearance.FFill.SetColor(c);
      };
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleHeaderFillColorTo({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FAppearance.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient);
        this.FAppearance.FFill.SetColorTo(c);
      };
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleTextFontColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) this.FFont$1.SetColor(c);
    };
    this.ResetToDefaultStyle = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ResetToDefaultStyle.call(this);
      this.FAppearance.SetDragGripColor(13882323);
      this.FAppearance.FFill.SetColor(16777215);
      this.FAppearance.FStroke.SetColor(8421504);
      this.FAppearance.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient);
      this.FAppearance.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FAppearance.FFill.SetColor(16777215);
      this.FAppearance.FFill.SetColorTo(pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(230,230,230));
    };
    this.HandleMouseDown = function (Button, Shift, X, Y) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseDown.apply(this,arguments);
      if (this.FAppearance.FDragGrip && !this.FDragGripMoving) {
        this.FDragGripDown = pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetDragGripRect(true),pas["WEBLib.TMSFNCTypes"].PointF(X,Y));
        this.FDragGripDownPt.$assign(pas["WEBLib.TMSFNCTypes"].PointF(X,Y));
      };
      if (!this.FDragGripDown) {
        if (this.FCompact) {
          this.FDown = true;
          this.Invalidate();
          this.CaptureEx();
        } else if (this.FQuickMenuButton) {
          this.FQuickMenuButtonDown = pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetQuickMenuButtonRect(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y));
          if (this.FQuickMenuButtonDown) {
            this.Invalidate();
            this.CaptureEx();
          };
        };
      };
      if ((this.FOnInternalMouseDown$1 != null) && !(Button === pas["WEBLib.Controls"].TMouseButton.mbRight)) this.FOnInternalMouseDown$1(this);
    };
    this.HandleMouseMove = function (Shift, X, Y) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var absx = 0.0;
      var absy = 0.0;
      var pt = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var d = null;
      var a = "";
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseMove.apply(this,arguments);
      if (this.FCompact) {
        this.FHoverP = this.FHover;
        this.FHover = true;
        if (this.FHover !== this.FHoverP) this.Invalidate();
      } else if (this.FQuickMenuButton) {
        this.FQuickMenuButtonHoverP = this.FQuickMenuButtonHover;
        this.FQuickMenuButtonHover = pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetQuickMenuButtonRect(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y));
        if (this.FQuickMenuButtonHover !== this.FQuickMenuButtonHoverP) this.Invalidate();
      };
      if (this.FAppearance.FDragGrip) {
        if (this.FDragGripDown) {
          if (!this.FDragGripMoving) {
            this.CaptureEx();
            this.FDragGripMoving = true;
          };
          if (this.FDragGripMoving) {
            absx = this.FDragGripDownPt.X - X;
            absy = this.FDragGripDownPt.Y - Y;
            if (this.FAutoMoveToolBar) {
              pt.$assign(pas["WEBLib.TMSFNCTypes"].PointF(this.GetLeft() - absx,this.GetTop() - absy));
              if ($mod.TTMSFNCCustomDockPanel.isPrototypeOf(this.FParent)) {
                d = rtl.as(this.FParent,$mod.TTMSFNCCustomDockPanel);
                if (d.FAutoAlign) {
                  if (pt.Y < d.FAppearance.FMargins.FTop) pt.Y = Math.round(d.FAppearance.FMargins.FTop);
                  if (pt.X < d.FAppearance.FMargins.FLeft) {
                    pt.X = Math.round(d.FAppearance.FMargins.FLeft)}
                   else if ((pt.X + this.GetWidth()) > (d.GetWidth() - d.FAppearance.FMargins.FRight)) pt.X = Math.round(d.GetWidth() - d.FAppearance.FMargins.FRight - this.GetWidth());
                  this.SetBounds(Math.round(pt.X),Math.round(pt.Y),this.GetWidth(),this.GetHeight());
                };
              };
            };
            this.FDragGripDownPt.$assign(pas["WEBLib.TMSFNCTypes"].PointF(X + absx,Y + absy));
            this.DoDragGripMoving(absx,absy);
          };
        } else {
          r.$assign(this.GetDragGripRect(true));
          if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(r,pas["WEBLib.TMSFNCTypes"].PointF(X,Y))) {
            if (!this.FInsideDrag) {
              this.FInsideDrag = true;
              this.SetControlCursor(5);
            };
          } else if (this.FInsideDrag) {
            this.FInsideDrag = false;
            this.SetControlCursor(0);
          };
        };
      };
      a = this.XYToAnchor(X,Y);
      if (a !== "") {
        this.SetControlCursor(21)}
       else if (this.FCursor === 21) this.SetControlCursor(0);
      if (this.FOnInternalMouseMove$1 != null) this.FOnInternalMouseMove$1(this);
    };
    this.HandleMouseLeave = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseLeave.call(this);
      this.FHoverP = false;
      this.FQuickMenuButtonHover = false;
      this.SetControlCursor(0);
      this.FInsideDrag = false;
      if (this.FHoverP !== this.FHover) {
        this.FHover = false;
        this.Invalidate();
      };
    };
    this.HandleMouseUp = function (Button, Shift, X, Y) {
      var a = "";
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseUp.apply(this,arguments);
      if (this.FDragGripDown) {
        this.ReleaseCaptureEx()}
       else if (this.FDown && this.FCompact) {
        this.Invalidate();
        this.ReleaseCaptureEx();
        this.HandleCompact();
      } else if (this.FQuickMenuButtonDown && this.FQuickMenuButton && !this.FCompact) {
        this.Invalidate();
        this.ReleaseCaptureEx();
        this.HandleQuickMenuButton();
      };
      this.FDragGripDown = false;
      this.FDragGripMoving = false;
      this.FDown = false;
      this.FQuickMenuButtonDown = false;
      a = this.XYToAnchor(X,Y);
      if (a !== "") this.DoAnchorClick(a);
      if ((this.FOnInternalMouseUp$1 != null) && !(Button === pas["WEBLib.Controls"].TMouseButton.mbRight)) this.FOnInternalMouseUp$1(this);
    };
    this.HandleCompact = function () {
      var I = 0;
      var cc = null;
      this.DeactivateAllPopups();
      if (this.FCompactToolbar != null) {
        rtl.free(this,"FCompactToolbar");
        this.FCompactToolbar = null;
      };
      if (this.FCompactPopup != null) {
        rtl.free(this,"FCompactPopup");
        this.FCompactPopup = null;
      };
      this.FCompactPopup = $mod.TTMSFNCToolBarPopup.$create("Create$1",[this]);
      this.FCompactPopup.FOnClosePopup = rtl.createCallback(this,"DoCloseCompactPopup");
      this.FCompactToolbar = $mod.TTMSFNCToolBar.$create("Create$1",[this.FCompactPopup]);
      this.FCompactToolbar.Assign(this);
      this.FCompactToolbar.SetCompact(false);
      this.FCompactToolbar.SetAS(true);
      this.FCompactToolbar.SetAutoHeight(false);
      this.FCompactToolbar.SetAutoWidth(true);
      this.FCompactToolbar.SetAutoStretchHeight(false);
      this.FCompactToolbar.FAppearance.SetSeparator(false);
      this.FCompactToolbar.SetControlMargins(1,1,1,1);
      this.FCompactToolbar.SetHeight(this.GetHeight() + 2);
      this.DoCustomizeCompactToolBar(this.FCompactToolbar);
      for (var $l = this.FCompactControls.GetCount() - 1; $l >= 0; $l--) {
        I = $l;
        cc = this.FCompactControls.GetItem$1(I);
        if (cc.FControl != null) {
          if ($mod.TTMSFNCDefaultToolBarButton.isPrototypeOf(cc.FControl)) rtl.as(cc.FControl,$mod.TTMSFNCDefaultToolBarButton).SetLayout(rtl.as(cc.FControl,$mod.TTMSFNCDefaultToolBarButton).FCompactLayout);
          cc.FControl.SetVisible(true);
          cc.FControl.SetParent(this.FCompactToolbar);
        };
      };
      this.FCompactToolbar.UpdateControls();
      this.FCompactPopup.SetPlacementControl(this);
      this.FCompactPopup.SetContentControl(this.FCompactToolbar);
      this.FCompactPopup.SetIsOpen(true);
      this.DoCompactClick();
    };
    this.DeactivateAllPopups = function () {
      var I = 0;
      if ((this.FParent != null) && pas["WEBLib.Controls"].TWinControl.isPrototypeOf(this.FParent)) for (var $l = 0, $end = rtl.as(this.FParent,pas["WEBLib.Controls"].TWinControl).GetControlsCount() - 1; $l <= $end; $l++) {
        I = $l;
        if ($mod.TTMSFNCCustomToolBar.isPrototypeOf(rtl.as(this.FParent,pas["WEBLib.Controls"].TWinControl).GetControls(I))) rtl.as(rtl.as(this.FParent,pas["WEBLib.Controls"].TWinControl).GetControls(I),$mod.TTMSFNCCustomToolBar).CloseCompactPopup();
      };
    };
    this.DoCompactClick = function () {
      if (this.FOnCompactClick != null) this.FOnCompactClick(this);
    };
    this.DoCustomizeCompactToolBar = function (ACompactToolBar) {
      if (this.FOnCustomizeCompactToolBar != null) this.FOnCustomizeCompactToolBar(this,ACompactToolBar);
    };
    this.HandleDblClick = function (X, Y) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleDblClick.apply(this,arguments);
      if (this.FOnInternalDblClick$1 != null) this.FOnInternalDblClick$1(this);
    };
    this.UpdateDockPanel = function () {
      if (this.FOnUpdateDockPanel != null) this.FOnUpdateDockPanel(this);
    };
    this.InsertToolBarControl = function (AControl, AIndex) {
      AControl.SetParent(this);
      if (AIndex > -1) this.SetChildOrder(AControl,AIndex);
      if (this.FOnInternalInsertControl != null) this.FOnInternalInsertControl(AControl);
    };
    this.DoDragGripMoving = function (ADeltaX, ADeltaY) {
      if (this.FOnDragGripMoving != null) this.FOnDragGripMoving(this,ADeltaX,ADeltaY);
    };
    this.VisibleChanging = function () {
      pas["WEBLib.Controls"].TControl.VisibleChanging.call(this);
      this.UpdateDockPanel();
    };
    this.GetDragGripRect = function (AInteraction) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var f = 0.0;
      r.$assign(this.GetLocalRect());
      f = 1;
      if (this.FState === $mod.TTMSFNCToolBarElementState.esLarge) f = 1.75;
      if (AInteraction) {
        Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top,r.Left + this.ScalePaintValue$1(8 * f),r.Bottom))}
       else Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + this.ScalePaintValue(3),r.Top + this.ScalePaintValue(3),r.Left + this.ScalePaintValue$1(6 * f),r.Bottom - this.ScalePaintValue(3)));
      return Result;
    };
    this.CompactControls = function () {
      var I = 0;
      var cc = null;
      var c = null;
      this.FBlockUpdate = true;
      this.FCompactControls.Clear();
      for (var $l = this.GetControlsCount() - 1; $l >= 0; $l--) {
        I = $l;
        c = this.GetControls(I);
        if (c !== this.FOptionsMenuButton) {
          cc = $mod.TTMSFNCToolBarControl.$create("Create$1");
          cc.FControl = c;
          if ($mod.TTMSFNCDefaultToolBarButton.isPrototypeOf(c)) {
            cc.FLayout = rtl.as(c,$mod.TTMSFNCDefaultToolBarButton).FLayout;
            if ((rtl.as(c,$mod.TTMSFNCDefaultToolBarButton).FCompactLayout === $mod.TTMSFNCToolBarButtonLayout.bblNone) && (rtl.as(c,$mod.TTMSFNCDefaultToolBarButton).FLayout !== $mod.TTMSFNCToolBarButtonLayout.bblNone)) rtl.as(c,$mod.TTMSFNCDefaultToolBarButton).SetCompactLayout(rtl.as(c,$mod.TTMSFNCDefaultToolBarButton).FMaximumLayout);
          };
          if ($mod.TTMSFNCCustomToolBarElement.isPrototypeOf(c)) {
            cc.FControlIndex = rtl.as(c,$mod.TTMSFNCCustomToolBarElement).FControlIndex}
           else cc.FControlIndex = c.FTag$1;
          c.SetParent(null);
          c.SetVisible(false);
          this.FCompactControls.Add$1(cc);
        };
      };
      this.FBlockUpdate = true;
      this.UpdateControls();
      this.Invalidate();
    };
    this.UncompactControls = function () {
      var I = 0;
      var cc = null;
      var c = null;
      this.FBlockUpdate = true;
      for (var $l = this.FCompactControls.GetCount() - 1; $l >= 0; $l--) {
        I = $l;
        cc = this.FCompactControls.GetItem$1(I);
        c = cc.FControl;
        if (c != null) {
          if ($mod.TTMSFNCCustomToolBarElement.isPrototypeOf(c)) rtl.as(c,$mod.TTMSFNCCustomToolBarElement).FBlockUpdate = true;
          c.SetParent(this);
          c.SetVisible(true);
          if ($mod.TTMSFNCCustomToolBarElement.isPrototypeOf(c)) rtl.as(c,$mod.TTMSFNCCustomToolBarElement).FBlockUpdate = false;
        };
      };
      this.FBlockUpdate = false;
      this.UpdateControls();
      this.Invalidate();
    };
    this.DoCustomizeOptionsMenu = function () {
      if (this.FOnOptionsMenuCustomize != null) this.FOnOptionsMenuCustomize(this,this.FAutoOptionsMenu);
    };
    this.DoCustomizeOptionsMenuItem = function (AControl, AMenuItem) {
      if (this.FOnOptionsMenuItemCustomize != null) this.FOnOptionsMenuItemCustomize(this,AControl,AMenuItem);
    };
    this.DoCanShowOptionsMenuItem = function (AControl, ACanShowItem) {
      if (this.FOnOptionsMenuItemCanShow != null) this.FOnOptionsMenuItemCanShow(this,AControl,ACanShowItem);
    };
    this.UpdateToolBar = function (Sender) {
      this.UpdateControls();
    };
    this.DoIsLastElement = function (AControl, ALastElement) {
      if (this.FOnIsLastElement != null) this.FOnIsLastElement(this,AControl,ALastElement);
    };
    this.UpdateToolBarControl = function (Sender) {
      var tb = null;
      var bmp = null;
      var c = null;
      var tc = null;
      var tci = 0;
      if (!(Sender != null)) return;
      this.FBlockUpdate = true;
      c = rtl.as(Sender,pas["WEBLib.Controls"].TControl);
      tb = this.GetHiddenControl(c);
      if (tb != null) {
        tc = tb.FControl;
        tci = Math.max(0,Math.min(this.GetControlsCount(),tb.FControlIndex - this.GetHiddenControlCount(tc)));
        this.FHiddenControls.Remove$1(tb);
        this.InsertToolBarControl(tc,tci);
        tc.SetVisible(true);
      } else {
        tb = $mod.TTMSFNCToolBarControl.$create("Create$1");
        if ($mod.TTMSFNCCustomToolBarElement.isPrototypeOf(c)) {
          tb.FControlIndex = rtl.as(c,$mod.TTMSFNCCustomToolBarElement).FControlIndex}
         else tb.FControlIndex = c.FTag$1;
        tb.FControl = c;
        this.FBlockUpdate = true;
        bmp = c.MakeScreenshot();
        this.FBlockUpdate = false;
        tb.FBitmap.Assign(bmp);
        bmp = rtl.freeLoc(bmp);
        this.FHiddenControls.Add$1(tb);
        c.SetParent(null);
        c.SetVisible(false);
      };
      this.FBlockUpdate = false;
      this.UpdateControls();
    };
    this.OptionMenuItemClick = function (Sender) {
      var a = false;
      var c = null;
      a = true;
      c = null;
      if ($mod.TTMSFNCToolBarOptionMenuItem.isPrototypeOf(Sender)) c = rtl.as(Sender,$mod.TTMSFNCToolBarOptionMenuItem).FControl;
      if ((this.FOnOptionsMenuItemClick != null) && pas["WEBLib.Menus"].TMenuItem.isPrototypeOf(Sender)) this.FOnOptionsMenuItemClick(this,c,rtl.as(Sender,pas["WEBLib.Menus"].TMenuItem),{get: function () {
          return a;
        }, set: function (v) {
          a = v;
        }});
      if (a) this.UpdateToolBarControl(c);
    };
    this.OptionsButtonClick = function (Sender) {
      var pt = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      if (this.FOnOptionsMenuButtonClick != null) {
        this.FOnOptionsMenuButtonClick(this)}
       else {
        pt.$assign(pas["WEBLib.TMSFNCTypes"].PointF(this.FOptionsMenuButton.GetLeft(),this.FOptionsMenuButton.GetTop()));
        pt.$assign(this.LocalToScreenEx(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(pt.X,pt.Y + this.FOptionsMenuButton.GetHeight()))));
        this.ShowOptionsMenu(pt.X,pt.Y);
      };
    };
    this.DoCloseCompactPopup = function (Sender) {
      var I = 0;
      var cc = null;
      this.FCompactPopup.SetContentControl(null);
      for (var $l = 0, $end = this.FCompactControls.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        cc = this.FCompactControls.GetItem$1(I);
        if (cc.FControl != null) {
          if ($mod.TTMSFNCDefaultToolBarButton.isPrototypeOf(cc.FControl)) rtl.as(cc.FControl,$mod.TTMSFNCDefaultToolBarButton).SetLayout(cc.FLayout);
          cc.FControl.SetParent(null);
          cc.FControl.SetVisible(false);
        };
      };
      if (this.FCompactToolbar != null) {
        rtl.free(this,"FCompactToolbar");
        this.FCompactToolbar = null;
      };
    };
    this.Notification = function (AComponent, Operation) {
      pas["WEBLib.Menus"].TWebCustomControl.Notification.apply(this,arguments);
      if ((Operation === pas.Classes.TOperation.opRemove) && (AComponent === this.FBitmapContainer)) this.FBitmapContainer = null;
      if ((Operation === pas.Classes.TOperation.opRemove) && (AComponent === this.FCustomOptionsMenu)) this.FCustomOptionsMenu = null;
    };
    this.AlignControls = function (AControl, Rect) {
      pas["WEBLib.Controls"].TControl.AlignControls.apply(this,arguments);
      this.UpdateControls();
    };
    this.UpdateControlAfterResize = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.UpdateControlAfterResize.call(this);
      this.UpdateDockPanel();
    };
    this.UpdateControls = function () {
      var $Self = this;
      var I = 0;
      var c = null;
      var idx = 0;
      var fu = false;
      var hc = null;
      var maxx = 0;
      var x = 0;
      var w = 0;
      var y = 0;
      var h = 0;
      var hs = 0;
      var hsm = 0;
      var vs = 0;
      var xs = 0;
      var ys = 0;
      var txth = 0;
      var txtw = 0;
      var mgr = null;
      var l = false;
      var ia = null;
      var sz = pas["WEBLib.TMSFNCTypes"].TSizeF.$new();
      var cn = null;
      var lm = 0.0;
      var tm = 0.0;
      var rm = 0.0;
      var bm = 0.0;
      function GetControl(AIndex) {
        var Result = null;
        Result = null;
        if ((AIndex >= 0) && (AIndex <= ($Self.GetControlsCount() - 1))) {
          if ($Self.GetControls(AIndex).FVisible) {
            Result = $Self.GetControls(AIndex);
            return Result;
          };
        };
        while ((AIndex >= 0) && (AIndex <= ($Self.GetControlsCount() - 1))) {
          AIndex += 1;
          if ((AIndex >= 0) && (AIndex <= ($Self.GetControlsCount() - 1))) {
            if ($Self.GetControls(AIndex).FVisible) {
              Result = $Self.GetControls(AIndex);
              return Result;
            };
          };
        };
        return Result;
      };
      function IsLoadingEx() {
        var Result = false;
        var ii = 0;
        var ctl = null;
        Result = $Self.CheckIsLoading();
        if (!Result) {
          for (var $l = $Self.GetControlsCount() - 1; $l >= 0; $l--) {
            ii = $l;
            ctl = $Self.GetControls(ii);
            if (pas.Classes.TComponentStateItem.csLoading in ctl.FComponentState) {
              Result = true;
              return Result;
            };
          };
        };
        return Result;
      };
      var $ir = rtl.createIntfRefs();
      try {
        if (this.FBlockUpdate || this.FBlockResize || IsLoadingEx() || this.IsDestroying() || !this.CanBuildControls()) return;
        this.FFirstLoad = false;
        this.FBlockUpdate = true;
        hs = Math.round(this.FAppearance.FHorizontalSpacing);
        vs = Math.round(this.FAppearance.FVerticalSpacing);
        x = hs;
        if (this.FAppearance.FDragGrip) {
          x = x + Math.round(this.GetDragGripRect(false).Right);
          if (hs === 0) x = x + this.ScalePaintValue(3);
        };
        y = vs;
        xs = x;
        ys = y;
        hsm = this.ScalePaintValue(30);
        txth = 0;
        txtw = 0;
        sz.$assign(this.GetTextSize());
        if (sz.cy > 0) txth = Math.round(sz.cy + this.ScalePaintValue(4));
        if (sz.cx > 0) txtw = Math.round(sz.cx + this.ScalePaintValue(8));
        w = txtw;
        maxx = 0;
        h = 0;
        idx = 0;
        fu = false;
        for (var $l = 0, $end = $Self.GetControlsCount() - 1; $l <= $end; $l++) {
          I = $l;
          c = $Self.GetControls(I);
          hc = this.GetHiddenControl(c);
          fu = !(hc != null);
          if (fu) break;
        };
        l = false;
        for (var $l1 = 0, $end1 = $Self.GetControlsCount() - 1; $l1 <= $end1; $l1++) {
          I = $l1;
          c = $Self.GetControls(I);
          if (pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(c,pas.System.IUnknown)),rtl.getIntfGUIDR(pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle),{get: function () {
              return ia;
            }, set: function (v) {
              ia = v;
            }})) ia.SetAdaptToStyle(this.GetAdaptToStyle());
          if (l) {
            x = xs;
            y = h;
            ys = y;
          };
          l = false;
          if ($mod.TTMSFNCCustomToolBarElement.isPrototypeOf(c)) {
            l = rtl.as(c,$mod.TTMSFNCCustomToolBarElement).FLastElement;
            rtl.as(c,$mod.TTMSFNCCustomToolBarElement).FOnUpdateToolBar = rtl.createCallback($Self,"UpdateToolBar");
            rtl.as(c,$mod.TTMSFNCCustomToolBarElement).FOnUpdateToolBarControl = rtl.createCallback($Self,"UpdateToolBarControl");
          };
          this.DoIsLastElement(c,{get: function () {
              return l;
            }, set: function (v) {
              l = v;
            }});
          if (!(c === this.FOptionsMenuButton)) {
            if (fu) {
              if ($mod.TTMSFNCCustomToolBarElement.isPrototypeOf(c)) {
                rtl.as(c,$mod.TTMSFNCCustomToolBarElement).FControlIndex = idx}
               else c.FTag$1 = idx;
            };
            if (c.FVisible) {
              if (c.FAlignWithMargins) {
                if (this.FAutoAlign) {
                  c.SetLeft(x + c.FMargins.FLeft);
                  c.SetTop(y + c.FMargins.FTop);
                };
                if (this.FAutoStretchHeight || ($mod.TTMSFNCDefaultToolBarButton.isPrototypeOf(c) && (rtl.as(c,$mod.TTMSFNCDefaultToolBarButton).FLayout === $mod.TTMSFNCToolBarButtonLayout.bblLarge))) {
                  h = this.GetHeight() - c.FMargins.FBottom - txth - y;
                  c.SetHeight(h);
                } else h = Math.max(h,c.GetTop() + c.GetHeight() + vs + c.FMargins.FBottom);
                cn = GetControl(I + 1);
                if ((cn != null) && $mod.TTMSFNCDefaultToolBarButton.isPrototypeOf(cn)) {
                  var $tmp = rtl.as(cn,$mod.TTMSFNCDefaultToolBarButton).FLayout;
                  if (($tmp === $mod.TTMSFNCToolBarButtonLayout.bblBitmap) || ($tmp === $mod.TTMSFNCToolBarButtonLayout.bblLabel)) {
                    y = Math.max(y,c.GetTop() + c.GetHeight() + vs + c.FMargins.FBottom);
                    if ((y + cn.FMargins.FTop + cn.GetHeight()) > (this.GetHeight() - cn.FMargins.FBottom - txth)) {
                      x = Math.max(x,Math.max(maxx,c.GetLeft() + c.GetWidth() + hs + c.FMargins.FRight));
                      y = ys;
                    } else {
                      c.SetLeft(x + c.FMargins.FLeft);
                      maxx = Math.max(x,Math.max(maxx,c.GetLeft() + c.GetWidth() + hs + c.FMargins.FRight));
                    };
                  } else if (($tmp === $mod.TTMSFNCToolBarButtonLayout.bblNone) || ($tmp === $mod.TTMSFNCToolBarButtonLayout.bblLarge)) {
                    x = Math.max(x,c.GetLeft() + c.GetWidth() + hs + c.FMargins.FRight);
                    y = ys;
                  };
                } else {
                  x = Math.max(x,Math.max(maxx,c.GetLeft() + c.GetWidth() + hs + c.FMargins.FRight));
                  y = ys;
                };
              } else {
                if (this.FAutoAlign) {
                  c.SetLeft(x);
                  c.SetTop(y);
                };
                if (this.FAutoStretchHeight || ($mod.TTMSFNCDefaultToolBarButton.isPrototypeOf(c) && (rtl.as(c,$mod.TTMSFNCDefaultToolBarButton).FLayout === $mod.TTMSFNCToolBarButtonLayout.bblLarge))) {
                  h = this.GetHeight() - txth - y;
                  c.SetHeight(h);
                } else h = Math.max(h,c.GetTop() + c.GetHeight() + vs);
                cn = GetControl(I + 1);
                if ((cn != null) && $mod.TTMSFNCDefaultToolBarButton.isPrototypeOf(cn)) {
                  var $tmp1 = rtl.as(cn,$mod.TTMSFNCDefaultToolBarButton).FLayout;
                  if (($tmp1 === $mod.TTMSFNCToolBarButtonLayout.bblBitmap) || ($tmp1 === $mod.TTMSFNCToolBarButtonLayout.bblLabel)) {
                    y = Math.max(y,c.GetTop() + c.GetHeight() + vs);
                    if ((y + cn.GetHeight()) > (this.GetHeight() - txth)) {
                      x = Math.max(x,Math.max(maxx,c.GetLeft() + c.GetWidth() + hs));
                      y = ys;
                    } else {
                      c.SetLeft(x);
                      maxx = Math.max(x,Math.max(maxx,c.GetLeft() + c.GetWidth() + hs));
                    };
                  } else if (($tmp1 === $mod.TTMSFNCToolBarButtonLayout.bblNone) || ($tmp1 === $mod.TTMSFNCToolBarButtonLayout.bblLarge)) {
                    x = Math.max(x,c.GetLeft() + c.GetWidth() + hs);
                    y = ys;
                  };
                } else {
                  x = Math.max(x,Math.max(maxx,c.GetLeft() + c.GetWidth() + hs));
                  y = ys;
                };
              };
              w = Math.max(w,x);
            };
            idx += 1;
          };
        };
        if (h === 0) h = hsm;
        this.FOptionsMenuButton.SetVisible(this.FOptionsMenu.FShowButton);
        if (this.FOptionsMenu.FShowButton) {
          this.FOptionsMenuButton.SetParent($Self)}
         else this.FOptionsMenuButton.SetParent(null);
        if (this.FOptionsMenuButton.FVisible) {
          this.FOptionsMenuButton.FControlIndex = $Self.GetControlsCount() - 1;
          this.FOptionsMenuButton.SetTop(this.FOptionsMenuButton.FMargins.FTop);
          mgr = this.FOptionsMenuButton.FMargins;
          if (!this.FOptionsMenuButton.FAlignWithMargins) {
            mgr.SetLeft(0);
            mgr.SetTop(0);
            mgr.SetRight(0);
            mgr.SetBottom(0);
          };
          if (this.FAutoSize) {
            this.FOptionsMenuButton.SetLeft(w + mgr.FLeft);
            if (this.FAutoHeight) {
              this.FOptionsMenuButton.SetHeight(h - mgr.FBottom - mgr.FTop)}
             else if (this.FAutoStretchHeight) this.FOptionsMenuButton.SetHeight(this.GetHeight() - mgr.FBottom - txth - mgr.FTop);
          } else {
            this.FOptionsMenuButton.SetLeft(this.GetWidth() - this.FOptionsMenuButton.GetWidth() - mgr.FRight);
            this.FOptionsMenuButton.SetHeight(this.GetHeight() - mgr.FBottom - mgr.FTop - txth);
          };
          w = w + this.FOptionsMenuButton.GetWidth() + mgr.FRight + mgr.FLeft;
        };
        if (this.FAutoSize) {
          if (this.FAppearance.FSeparator) w = w + Math.round(this.FAppearance.FSeparatorStroke.FWidth);
          w = Math.round(Math.max(this.FMinimumWidth,w));
          if (this.GetControlAlignment() === pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlAlignment.caNone) {
            lm = 0;
            rm = 0;
            tm = 0;
            bm = 0;
            this.GetControlMargins({get: function () {
                return lm;
              }, set: function (v) {
                lm = v;
              }},{get: function () {
                return tm;
              }, set: function (v) {
                tm = v;
              }},{get: function () {
                return rm;
              }, set: function (v) {
                rm = v;
              }},{get: function () {
                return bm;
              }, set: function (v) {
                bm = v;
              }});
            w = w + Math.round(lm + rm);
          };
          h = h + txth;
          if (this.FAutoHeight && this.FAutoWidth && (this.GetControlAlignment() === pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlAlignment.caNone)) {
            this.SetBounds(this.GetLeft(),this.GetTop(),w,h)}
           else if (this.FAutoHeight && !(this.GetControlAlignment() in rtl.createSet(pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlAlignment.caLeft,pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlAlignment.caRight,pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlAlignment.caClient))) {
            this.SetBounds(this.GetLeft(),this.GetTop(),this.GetWidth(),h)}
           else if (this.FAutoWidth && !(this.GetControlAlignment() in rtl.createSet(pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlAlignment.caTop,pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlAlignment.caBottom,pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlAlignment.caClient))) this.SetBounds(this.GetLeft(),this.GetTop(),w,this.GetHeight());
        };
        if (this.FOnUpdateControls != null) this.FOnUpdateControls($Self);
        this.FBlockUpdate = false;
      } finally {
        $ir.free();
        rtl._Release(ia);
      };
    };
    this.InitializeOptionsMenu = function () {
    };
    this.DrawDragGrip = function (AGraphics) {
      var $Self = this;
      var cnt = 0;
      function DrawDots(ARect) {
        var i = 0;
        var rdg = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
        var sz = 0;
        if ($Self.FState === $mod.TTMSFNCToolBarElementState.esLarge) {
          sz = $Self.ScalePaintValue(3)}
         else sz = $Self.ScalePaintValue(2);
        ARect.Left = ARect.Left;
        ARect.Top = ARect.Top;
        cnt = rtl.trunc(Math.round(ARect.Bottom) / (Math.round(sz) * 2));
        for (var $l = 1, $end = cnt; $l <= $end; $l++) {
          i = $l;
          rdg.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARect.Left + ((ARect.Right - ARect.Left - sz) / 2),ARect.Top + 1,ARect.Left + sz + ((ARect.Right - ARect.Left - sz) / 2),ARect.Top + 1 + sz));
          rdg.$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.System.Int(rdg.Left),pas.System.Int(rdg.Top),pas.System.Int(rdg.Right),pas.System.Int(rdg.Bottom)));
          AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rdg),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
          ARect.Top = ARect.Top + (sz * 2);
        };
      };
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      AGraphics.FFill.SetColor(this.FAppearance.FDragGripColor);
      AGraphics.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      r.$assign(this.GetDragGripRect(false));
      DrawDots(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r));
    };
    this.DrawText = function (AGraphics) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (this.FTextVisible && (this.FText !== "")) {
        AGraphics.FFont.Assign(this.FFont$1);
        if (!this.FEnabled && (this.FDisabledFontColor !== -1)) AGraphics.FFont.SetColor(this.FDisabledFontColor);
        r.$assign(this.GetTextRect());
        AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FText,this.FWordWrapping,this.FHorizontalTextAlign,this.FVerticalTextAlign,this.FTrimming,0,-1,-1,true,false,-1,-1);
      };
    };
    this.DrawCompactBitmap = function (AGraphics, ARect) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.$assign(this.GetCompactBitmapRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect)));
      AGraphics.FBitmapContainer = this.GetBitmapContainer();
      AGraphics.DrawScaledBitmap(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FCompactBitmaps,0,true,false,true,false);
    };
    this.DrawCompactText = function (AGraphics) {
      var tr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var st = null;
      if (!this.FTextVisible || (this.FText === "")) return;
      tr.$assign(this.GetCompactTextRect());
      st = AGraphics.SaveState(false);
      try {
        AGraphics.ClipRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(tr));
        AGraphics.FFont.Assign(this.FFont$1);
        AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(tr),this.FText,this.FWordWrapping,this.FHorizontalTextAlign,this.FVerticalTextAlign,this.FTrimming,0,-1,-1,true,false,-1,-1);
      } finally {
        AGraphics.RestoreState(st,false);
      };
    };
    this.DrawCompactExpander = function (AGraphics) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.$assign(this.GetLocalRect());
      r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Bottom - 20,r.Right,r.Bottom));
      pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,-2,-2);
      AGraphics.DrawScaledBitmap(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FCompactExpanderBitmaps,0,true,false,true,false);
    };
    this.ShowOptionsMenu = function (X, Y) {
    };
    this.CheckIsLoading = function () {
      var Result = false;
      Result = this.IsLoading();
      return Result;
    };
    this.XYToAnchor = function (AX, AY) {
      var Result = "";
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var g = null;
      Result = "";
      r.$assign(this.GetTextRect());
      g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[1,1,false,true]);
      g.BeginScene();
      g.FBitmapContainer = this.GetBitmapContainer();
      try {
        g.FFont.Assign(this.FFont$1);
        Result = g.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FText,this.FWordWrapping,this.FHorizontalTextAlign,this.FVerticalTextAlign,this.FTrimming,0,-1,-1,true,true,AX,AY);
      } finally {
        g.EndScene();
        g = rtl.freeLoc(g);
      };
      return Result;
    };
    this.DoAnchorClick = function (AAnchor) {
      if (this.FOnAnchorClick != null) {
        this.FOnAnchorClick(this,AAnchor)}
       else pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.OpenURL(AAnchor);
    };
    this.Loaded = function () {
      pas["WEBLib.Controls"].TCustomControl.Loaded.call(this);
    };
    this.Assign = function (Source) {
      var c = null;
      var cc = null;
      var I = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Assign.apply(this,arguments);
      if ($mod.TTMSFNCCustomToolBar.isPrototypeOf(Source)) {
        this.FCompactAppearance.Assign(rtl.as(Source,$mod.TTMSFNCCustomToolBar).FCompactAppearance);
        this.FQuickMenuButtonAppearance.Assign(rtl.as(Source,$mod.TTMSFNCCustomToolBar).FQuickMenuButtonAppearance);
        this.FQuickMenuButton = rtl.as(Source,$mod.TTMSFNCCustomToolBar).FQuickMenuButton;
        this.FCompactBitmaps.Assign(rtl.as(Source,$mod.TTMSFNCCustomToolBar).FCompactBitmaps);
        this.FCompact = rtl.as(Source,$mod.TTMSFNCCustomToolBar).FCompact;
        this.FCanCompact = rtl.as(Source,$mod.TTMSFNCCustomToolBar).FCanCompact;
        this.FMinimumWidth = rtl.as(Source,$mod.TTMSFNCCustomToolBar).FMinimumWidth;
        this.FCompactWidth = rtl.as(Source,$mod.TTMSFNCCustomToolBar).FCompactWidth;
        this.FCompactBitmapSize = rtl.as(Source,$mod.TTMSFNCCustomToolBar).FCompactBitmapSize;
        this.FCompactAutoBitmapSize = rtl.as(Source,$mod.TTMSFNCCustomToolBar).FCompactAutoBitmapSize;
        this.FCompactExpanderBitmaps.Assign(rtl.as(Source,$mod.TTMSFNCCustomToolBar).FCompactExpanderBitmaps);
        this.FQuickMenuButtonBitmaps.Assign(rtl.as(Source,$mod.TTMSFNCCustomToolBar).FQuickMenuButtonBitmaps);
        this.FCompactBitmapVisible = rtl.as(Source,$mod.TTMSFNCCustomToolBar).FCompactBitmapVisible;
        this.FText = rtl.as(Source,$mod.TTMSFNCCustomToolBar).FText;
        this.FTextVisible = rtl.as(Source,$mod.TTMSFNCCustomToolBar).FTextVisible;
        this.FWordWrapping = rtl.as(Source,$mod.TTMSFNCCustomToolBar).FWordWrapping;
        this.FHorizontalTextAlign = rtl.as(Source,$mod.TTMSFNCCustomToolBar).FHorizontalTextAlign;
        this.FVerticalTextAlign = rtl.as(Source,$mod.TTMSFNCCustomToolBar).FVerticalTextAlign;
        this.FTrimming = rtl.as(Source,$mod.TTMSFNCCustomToolBar).FTrimming;
        this.FFont$1.Assign(rtl.as(Source,$mod.TTMSFNCCustomToolBar).FFont$1);
        this.FAutoSize = rtl.as(Source,$mod.TTMSFNCCustomToolBar).FAutoSize;
        this.FAutoHeight = rtl.as(Source,$mod.TTMSFNCCustomToolBar).FAutoHeight;
        this.FAutoWidth = rtl.as(Source,$mod.TTMSFNCCustomToolBar).FAutoWidth;
        this.FAutoAlign = rtl.as(Source,$mod.TTMSFNCCustomToolBar).FAutoAlign;
        this.FAutoStretchHeight = rtl.as(Source,$mod.TTMSFNCCustomToolBar).FAutoStretchHeight;
        this.FAutoMoveToolBar = rtl.as(Source,$mod.TTMSFNCCustomToolBar).FAutoMoveToolBar;
        this.FAppearance.Assign(rtl.as(Source,$mod.TTMSFNCCustomToolBar).FAppearance);
        for (var $l = 0, $end = rtl.as(Source,$mod.TTMSFNCCustomToolBar).GetControlsCount() - 1; $l <= $end; $l++) {
          I = $l;
          cc = rtl.as(Source,$mod.TTMSFNCCustomToolBar).GetControls(I);
          if (($mod.TTMSFNCDefaultToolBarButton.isPrototypeOf(cc) && rtl.as(cc,$mod.TTMSFNCDefaultToolBarButton).FCanCopy) || !($mod.TTMSFNCDefaultToolBarButton.isPrototypeOf(cc) && pas["WEBLib.Controls"].TControl.isPrototypeOf(cc))) {
            if ($mod.TTMSFNCDefaultToolBarButton.isPrototypeOf(cc)) rtl.as(cc,$mod.TTMSFNCDefaultToolBarButton).FApplyName = false;
            c = rtl.as(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.Clone(cc),pas["WEBLib.Controls"].TControl);
            if ($mod.TTMSFNCDefaultToolBarButton.isPrototypeOf(cc)) rtl.as(cc,$mod.TTMSFNCDefaultToolBarButton).FApplyName = true;
            this.AddCustomControl(c,-1);
          };
        };
        this.Invalidate();
      } else pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Assign.apply(this,arguments);
    };
    this.Create$1 = function (AOwner) {
      var c = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Create$1.apply(this,arguments);
      this.FFirstLoad = true;
      this.FHiddenControls = $mod.TTMSFNCToolBarControlObjectList.$create("Create$2");
      this.FCompactControls = $mod.TTMSFNCToolBarControlObjectList.$create("Create$2");
      this.FState = $mod.TTMSFNCToolBarElementState.esNormal;
      this.FDisabledFontColor = -1;
      this.FAppearance = $mod.TTMSFNCToolBarAppearance.$create("Create$1",[this]);
      this.FCompactAppearance = $mod.TTMSFNCToolBarCompactAppearance.$create("Create$1",[null]);
      this.FCompactAppearance.FOnChange = rtl.createCallback(this,"CompactAppearanceChanged");
      this.FQuickMenuButtonAppearance = $mod.TTMSFNCToolBarQuickMenuButtonAppearance.$create("Create$1",[null]);
      this.FQuickMenuButtonAppearance.FOnChange = rtl.createCallback(this,"QuickMenuButtonAppearanceChanged");
      this.FCompactBitmaps = pas["WEBLib.TMSFNCTypes"].TTMSFNCScaledBitmaps.$create("Create$3",[this]);
      this.FCompactBitmaps.FOnChange = rtl.createCallback(this,"CompactBitmapsChanged");
      this.FOptionsMenu = $mod.TTMSFNCToolBarOptionsMenu.$create("Create$1",[this]);
      this.FMinimumWidth = 30;
      this.FCompactWidth = 50;
      this.FCompactBitmapSize = 24;
      this.FCompactAutoBitmapSize = false;
      this.FCompactBitmapVisible = false;
      this.FCompactExpanderBitmaps = pas["WEBLib.TMSFNCTypes"].TTMSFNCScaledBitmaps.$create("Create$3",[this]);
      this.FCompactExpanderBitmaps.FOnChange = rtl.createCallback(this,"CompactExpanderBitmapsChanged");
      this.FQuickMenuButtonBitmaps = pas["WEBLib.TMSFNCTypes"].TTMSFNCScaledBitmaps.$create("Create$3",[this]);
      this.FQuickMenuButtonBitmaps.FOnChange = rtl.createCallback(this,"QuickMenuButtonBitmapsChanged");
      this.FCanCompact = true;
      this.FQuickMenuButton = false;
      this.FCompact = false;
      this.FAutoSize = true;
      this.FAutoWidth = true;
      this.FAutoHeight = true;
      this.FAutoAlign = true;
      this.FAutoStretchHeight = false;
      this.FAutoMoveToolBar = true;
      this.FOptionsMenuButton = this.GetOptionsMenuButtonClass().$create("Create$1",[this]);
      this.FOptionsMenuButton.FAppearance.FNormalFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      c = 13882323;
      this.FOptionsMenuButton.FAppearance.FNormalFill.SetColor(c);
      this.FOptionsMenuButton.FAppearance.SetShowInnerStroke(false);
      this.FOptionsMenuButton.FAppearance.SetRounding(0);
      this.FOptionsMenuButton.FAppearance.FHoverFill.Assign(this.FOptionsMenuButton.FAppearance.FNormalFill);
      this.FOptionsMenuButton.FAppearance.FDisabledFill.Assign(this.FOptionsMenuButton.FAppearance.FNormalFill);
      this.FOptionsMenuButton.FAppearance.FDownFill.Assign(this.FOptionsMenuButton.FAppearance.FNormalFill);
      this.FOptionsMenuButton.FAppearance.FHoverFill.SetColor(15128749);
      this.FOptionsMenuButton.FAppearance.FDownFill.SetColor(14599344);
      this.FOptionsMenuButton.FAppearance.FDisabledFill.SetColor(13882323);
      this.FOptionsMenuButton.SetAlignWithMargins(true);
      this.FOptionsMenuButton.FMargins.SetTop(3);
      this.FOptionsMenuButton.FMargins.SetBottom(3);
      this.FOptionsMenuButton.FMargins.SetRight(3);
      this.FOptionsMenuButton.FCanCopy = false;
      this.FAutoOptionsMenu = pas["WEBLib.Menus"].TPopupMenu.$create("Create$1",[this]);
      this.FOptionsMenuButton.FOnClick = rtl.createCallback(this,"OptionsButtonClick");
      this.FOptionsMenuButton.SetWidth(17);
      this.FOptionsMenuButton.SetText("");
      this.FOptionsMenuButton.FStored = false;
      this.FOptionsMenuButton.FBitmaps.AddBitmapFromResource$1(pas["WEBLib.TMSFNCToolBarRes"].TMSFNCTOOLBAROPTIONSMENU,pas["WEBLib.TMSFNCTypes"].HInstance(),1.0);
      this.FOptionsMenuButton.FBitmaps.AddBitmapFromResource$1(pas["WEBLib.TMSFNCToolBarRes"].TMSFNCTOOLBAROPTIONSMENULARGE,pas["WEBLib.TMSFNCTypes"].HInstance(),1.5);
      this.FOptionsMenuButton.FDisabledBitmaps.AddBitmapFromResource$1(pas["WEBLib.TMSFNCToolBarRes"].TMSFNCTOOLBAROPTIONSMENU,pas["WEBLib.TMSFNCTypes"].HInstance(),1.0);
      this.FOptionsMenuButton.FDisabledBitmaps.AddBitmapFromResource$1(pas["WEBLib.TMSFNCToolBarRes"].TMSFNCTOOLBAROPTIONSMENULARGE,pas["WEBLib.TMSFNCTypes"].HInstance(),1.5);
      this.FOptionsMenuButton.FHoverBitmaps.AddBitmapFromResource$1(pas["WEBLib.TMSFNCToolBarRes"].TMSFNCTOOLBAROPTIONSMENU,pas["WEBLib.TMSFNCTypes"].HInstance(),1.0);
      this.FOptionsMenuButton.FHoverBitmaps.AddBitmapFromResource$1(pas["WEBLib.TMSFNCToolBarRes"].TMSFNCTOOLBAROPTIONSMENULARGE,pas["WEBLib.TMSFNCTypes"].HInstance(),1.5);
      this.FHorizontalTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      this.FVerticalTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      this.FTrimming = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttCharacter;
      this.FWordWrapping = false;
      this.FTextVisible = true;
      this.FFont$1 = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FCompactExpanderBitmaps.AddBitmapFromResource$1(pas["WEBLib.TMSFNCGraphics"].TMSFNCGRAPHICSDOWN,pas["WEBLib.TMSFNCTypes"].HInstance(),1.0);
      this.FQuickMenuButtonBitmaps.AddBitmapFromResource$1(pas["WEBLib.TMSFNCToolBarRes"].TMSFNCTOOLBARQUICKMENU,pas["WEBLib.TMSFNCTypes"].HInstance(),1.0);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FQuickMenuButtonBitmaps");
      rtl.free(this,"FCompactExpanderBitmaps");
      rtl.free(this,"FCompactPopup");
      rtl.free(this,"FQuickMenuButtonAppearance");
      rtl.free(this,"FCompactAppearance");
      rtl.free(this,"FCompactBitmaps");
      rtl.free(this,"FFont$1");
      rtl.free(this,"FOptionsMenu");
      rtl.free(this,"FAppearance");
      rtl.free(this,"FHiddenControls");
      rtl.free(this,"FCompactControls");
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Destroy.call(this);
    };
    this.Build = function () {
      this.UpdateControls();
    };
    this.Draw = function (AGraphics, ARect) {
      var qr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var w = 0.0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Draw.apply(this,arguments);
      r.$assign(this.GetLocalRect());
      if (this.FCompact) {
        if (this.FDown) {
          AGraphics.FFill.Assign(this.FCompactAppearance.FDownFill);
          AGraphics.FStroke.Assign(this.FCompactAppearance.FDownStroke);
        } else if (this.FHover) {
          AGraphics.FFill.Assign(this.FCompactAppearance.FHoverFill);
          AGraphics.FStroke.Assign(this.FCompactAppearance.FHoverStroke);
        } else {
          AGraphics.FFill.Assign(this.FCompactAppearance.FNormalFill);
          AGraphics.FStroke.Assign(this.FCompactAppearance.FNormalStroke);
        };
        if (this.FCompactAppearance.FFlatStyle) AGraphics.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top + 2,r.Right - 3,r.Bottom - 2)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
      } else {
        AGraphics.FFill.Assign(this.FAppearance.FFill);
        AGraphics.FStroke.Assign(this.FAppearance.FStroke);
        if (this.FAppearance.FFlatStyle) AGraphics.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
      };
      if (this.FCompact) {
        this.DrawCompactBitmap(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect));
        this.DrawCompactText(AGraphics);
        this.DrawCompactExpander(AGraphics);
      } else {
        if (this.FAppearance.FDragGrip) this.DrawDragGrip(AGraphics);
        this.DrawText(AGraphics);
        if (this.FQuickMenuButton) {
          if (this.FQuickMenuButtonDown) {
            AGraphics.FFill.Assign(this.FQuickMenuButtonAppearance.FDownFill);
            AGraphics.FStroke.Assign(this.FQuickMenuButtonAppearance.FDownStroke);
          } else if (this.FQuickMenuButtonHover) {
            AGraphics.FFill.Assign(this.FQuickMenuButtonAppearance.FHoverFill);
            AGraphics.FStroke.Assign(this.FQuickMenuButtonAppearance.FHoverStroke);
          } else {
            AGraphics.FFill.Assign(this.FQuickMenuButtonAppearance.FNormalFill);
            AGraphics.FStroke.Assign(this.FQuickMenuButtonAppearance.FNormalStroke);
          };
          if (this.FQuickMenuButtonAppearance.FFlatStyle) AGraphics.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
          qr.$assign(this.GetQuickMenuButtonRect());
          AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(qr),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
          pas["WEBLib.TMSFNCTypes"].InflateRectEx(qr,-2,-2);
          AGraphics.DrawScaledBitmap(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(qr),this.FQuickMenuButtonBitmaps,0,true,false,true,false);
        };
      };
      if (this.FAppearance.FSeparator) {
        AGraphics.FStroke.Assign(this.FAppearance.FSeparatorStroke);
        w = this.FAppearance.FSeparatorStroke.FWidth;
        AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - w,r.Top + 4)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - w,r.Bottom - 4)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
      };
      if (this.IsDesignTime() && this.CanDrawDesignTime()) AGraphics.DrawFocusRectangle$3(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),0,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
    };
    this.CanExpand = function () {
      var Result = false;
      var I = 0;
      var c = null;
      var btn = null;
      Result = false;
      if (this.FCompact) {
        Result = true;
        return Result;
      };
      for (var $l = this.GetControlsCount() - 1; $l >= 0; $l--) {
        I = $l;
        c = this.GetControls(I);
        if (c !== this.FOptionsMenuButton) {
          if ($mod.TTMSFNCDefaultToolBarButton.isPrototypeOf(c)) {
            btn = rtl.as(c,$mod.TTMSFNCDefaultToolBarButton);
            if ((btn.FLayout < btn.FMaximumLayout) && (btn.FLayout !== $mod.TTMSFNCToolBarButtonLayout.bblNone)) {
              Result = true;
              break;
            };
          };
        };
      };
      return Result;
    };
    this.CanShrink = function () {
      var Result = false;
      var I = 0;
      var c = null;
      var btn = null;
      Result = false;
      if (!this.FCompact && this.FCanCompact) {
        Result = true;
        return Result;
      };
      for (var $l = this.GetControlsCount() - 1; $l >= 0; $l--) {
        I = $l;
        c = this.GetControls(I);
        if (c !== this.FOptionsMenuButton) {
          if ($mod.TTMSFNCDefaultToolBarButton.isPrototypeOf(c)) {
            btn = rtl.as(c,$mod.TTMSFNCDefaultToolBarButton);
            if ((btn.FLayout > btn.FMinimumLayout) && (btn.FLayout !== $mod.TTMSFNCToolBarButtonLayout.bblNone)) {
              Result = true;
              break;
            };
          };
        };
      };
      return Result;
    };
    this.DropDownActive = function () {
      var Result = false;
      var I = 0;
      var c = null;
      Result = false;
      for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
        I = $l;
        c = this.GetControls(I);
        if ($mod.TTMSFNCDefaultToolBarButton.isPrototypeOf(c)) {
          if (rtl.as(c,$mod.TTMSFNCDefaultToolBarButton).FPopup != null) {
            Result = rtl.as(c,$mod.TTMSFNCDefaultToolBarButton).FPopup.FIsOpen;
            if (Result) break;
          };
        };
      };
      return Result;
    };
    this.CloseCompactPopup = function () {
      if (this.FCompactPopup != null) this.FCompactPopup.SetIsOpen(false);
    };
    this.AddCustomControl = function (AControl, AIndex) {
      this.FBlockUpdate = true;
      this.InsertToolBarControl(AControl,AIndex);
      this.FBlockUpdate = false;
      this.UpdateControls();
    };
    this.AddCustomControlClass = function (AControlClass, AIndex) {
      var Result = null;
      this.FBlockUpdate = true;
      Result = AControlClass.$create("Create$1",[this]);
      this.InsertToolBarControl(Result,AIndex);
      this.FBlockUpdate = false;
      this.UpdateControls();
      return Result;
    };
    this.AddButton = function (AWidth, AHeight, AResource, AResourceLarge, AText, AIndex) {
      var Result = null;
      this.FBlockUpdate = true;
      Result = this.GetToolBarButtonClass().$create("Create$1",[this]);
      Result.FAppearance.SetFlatStyle(this.FAppearance.FFlatStyle);
      Result.SetText(AText);
      if (AWidth !== -1) {
        Result.SetWidth(Math.round(AWidth));
      };
      if (AHeight !== -1) {
        Result.SetHeight(Math.round(AHeight));
      };
      if (AResource !== "") {
        Result.FBitmaps.AddBitmapFromResource$1(AResource,pas["WEBLib.TMSFNCTypes"].HInstance(),1.0);
        Result.FDisabledBitmaps.AddBitmapFromResource$1(AResource,pas["WEBLib.TMSFNCTypes"].HInstance(),1.0);
        Result.FHoverBitmaps.AddBitmapFromResource$1(AResource,pas["WEBLib.TMSFNCTypes"].HInstance(),1.0);
      };
      if (AResourceLarge !== "") {
        Result.FBitmaps.AddBitmapFromResource$1(AResourceLarge,pas["WEBLib.TMSFNCTypes"].HInstance(),1.5);
        Result.FDisabledBitmaps.AddBitmapFromResource$1(AResourceLarge,pas["WEBLib.TMSFNCTypes"].HInstance(),1.5);
        Result.FHoverBitmaps.AddBitmapFromResource$1(AResourceLarge,pas["WEBLib.TMSFNCTypes"].HInstance(),1.5);
      };
      this.InsertToolBarControl(Result,AIndex);
      this.FBlockUpdate = false;
      this.UpdateControls();
      return Result;
    };
    this.AddSeparator = function (AIndex) {
      var Result = null;
      this.FBlockUpdate = true;
      Result = this.GetToolBarSeparatorClass().$create("Create$1",[this]);
      this.InsertToolBarControl(Result,AIndex);
      this.FBlockUpdate = false;
      this.UpdateControls();
      return Result;
    };
    this.AddFontNamePicker = function (AIndex) {
      var Result = null;
      this.FBlockUpdate = true;
      Result = this.GetFontNamePickerClass().$create("Create$1",[this]);
      Result.FAppearance.SetFlatStyle(this.FAppearance.FFlatStyle);
      this.InsertToolBarControl(Result,AIndex);
      this.FBlockUpdate = false;
      this.UpdateControls();
      return Result;
    };
    this.AddFontSizePicker = function (AIndex) {
      var Result = null;
      this.FBlockUpdate = true;
      Result = this.GetFontSizePickerClass().$create("Create$1",[this]);
      Result.FAppearance.SetFlatStyle(this.FAppearance.FFlatStyle);
      this.InsertToolBarControl(Result,AIndex);
      this.FBlockUpdate = false;
      this.UpdateControls();
      return Result;
    };
    this.AddColorPicker = function (AIndex) {
      var Result = null;
      this.FBlockUpdate = true;
      Result = this.GetColorPickerClass().$create("Create$1",[this]);
      Result.FAppearance.SetFlatStyle(this.FAppearance.FFlatStyle);
      this.InsertToolBarControl(Result,AIndex);
      this.FBlockUpdate = false;
      this.UpdateControls();
      return Result;
    };
    this.AddItemPicker = function (AIndex) {
      var Result = null;
      this.FBlockUpdate = true;
      Result = this.GetItemPickerClass().$create("Create$1",[this]);
      Result.FAppearance.SetFlatStyle(this.FAppearance.FFlatStyle);
      this.InsertToolBarControl(Result,AIndex);
      this.FBlockUpdate = false;
      this.UpdateControls();
      return Result;
    };
    this.AddBitmapPicker = function (AIndex) {
      var Result = null;
      this.FBlockUpdate = true;
      Result = this.GetBitmapPickerClass().$create("Create$1",[this]);
      Result.FAppearance.SetFlatStyle(this.FAppearance.FFlatStyle);
      this.InsertToolBarControl(Result,AIndex);
      this.FBlockUpdate = false;
      this.UpdateControls();
      return Result;
    };
    this.GetOptionsMenuButtonControl = function () {
      var Result = null;
      Result = this.FOptionsMenuButton;
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCStylesManager);
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCToolBar",this.TTMSFNCCustomToolBar,function () {
    this.RegisterRuntimeClasses = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClass($mod.TTMSFNCToolBar);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCStylesManager);
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("OnOptionsMenuButtonClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnOptionsMenuButtonClick","FOnOptionsMenuButtonClick");
    $r.addProperty("OnOptionsMenuItemCanShow",0,$mod.$rtti["TTMSFNCToolBarCanShowOptionsMenuItem"],"FOnOptionsMenuItemCanShow","FOnOptionsMenuItemCanShow");
    $r.addProperty("OnOptionsMenuCustomize",0,$mod.$rtti["TTMSFNCToolBarCustomizeOptionsMenu"],"FOnOptionsMenuCustomize","FOnOptionsMenuCustomize");
    $r.addProperty("OnOptionsMenuItemCustomize",0,$mod.$rtti["TTMSFNCToolBarCustomizeOptionsMenuItem"],"FOnOptionsMenuItemCustomize","FOnOptionsMenuItemCustomize");
    $r.addProperty("OnOptionsMenuItemApplyStyle",0,$mod.$rtti["TTMSFNCToolBarCustomizeOptionsMenuItem"],"FOnOptionsMenuItemApplyStyle","FOnOptionsMenuItemApplyStyle");
    $r.addProperty("OnOptionsMenuItemClick",0,$mod.$rtti["TTMSFNCToolBarOptionsMenuItemClick"],"FOnOptionsMenuItemClick","FOnOptionsMenuItemClick");
    $r.addProperty("OnIsLastElement",0,$mod.$rtti["TTMSFNCToolBarIsLastElement"],"FOnIsLastElement","FOnIsLastElement");
    $r.addProperty("OnDragGripMoving",0,$mod.$rtti["TTMSFNCToolBarDragGripMovingEvent"],"FOnDragGripMoving","FOnDragGripMoving");
    $r.addProperty("OnQuickMenuButtonClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnQuickMenuButtonClick","FOnQuickMenuButtonClick");
    $r.addProperty("OnAnchorClick",0,$mod.$rtti["TTMSFNCToolBarAnchorClickEvent"],"FOnAnchorClick","FOnAnchorClick");
    $r.addProperty("Version",1,rtl.string,"GetVersion","");
    $r.addProperty("AutoHeight",2,rtl.boolean,"FAutoHeight","SetAutoHeight",4,{Default: true});
    $r.addProperty("AutoWidth",2,rtl.boolean,"FAutoWidth","SetAutoWidth",4,{Default: true});
    $r.addProperty("AutoSize",2,rtl.boolean,"FAutoSize","SetAS",4,{Default: true});
    $r.addProperty("AutoAlign",2,rtl.boolean,"FAutoAlign","SetAutoAlign",4,{Default: true});
    $r.addProperty("AutoStretchHeight",2,rtl.boolean,"FAutoStretchHeight","SetAutoStretchHeight",4,{Default: false});
    $r.addProperty("OnCustomizeCompactToolBar",0,$mod.$rtti["TTMSFNCToolBarCustomizeCompactToolBarEvent"],"FOnCustomizeCompactToolBar","FOnCustomizeCompactToolBar");
    $r.addProperty("AutoMoveToolBar",0,rtl.boolean,"FAutoMoveToolBar","FAutoMoveToolBar",4,{Default: true});
    $r.addProperty("Appearance",2,$mod.$rtti["TTMSFNCToolBarAppearance"],"FAppearance","SetAppearance");
    $r.addProperty("CanCompact",2,rtl.boolean,"FCanCompact","SetCanCompact",4,{Default: true});
    $r.addProperty("OnCompactClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnCompactClick","FOnCompactClick");
    $r.addProperty("CompactBitmapVisible",2,rtl.boolean,"FCompactBitmapVisible","SetCompactBitmapVisible",4,{Default: false});
    $r.addProperty("CompactBitmaps",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCScaledBitmaps"],"FCompactBitmaps","SetCompactBitmaps");
    $r.addProperty("Compact",2,rtl.boolean,"FCompact","SetCompact",4,{Default: false});
    $r.addProperty("CompactWidth",14,rtl.double,"FCompactWidth","SetCompactWidth",4,{stored: "IsCompactWidthStored"});
    $r.addProperty("CompactAppearance",2,$mod.$rtti["TTMSFNCToolBarCompactAppearance"],"FCompactAppearance","SetCompactAppearance");
    $r.addProperty("CompactBitmapSize",14,rtl.double,"FCompactBitmapSize","SetCompactBitmapSize",4,{stored: "IsCompactBitmapSizeStored"});
    $r.addProperty("CompactAutoBitmapSize",2,rtl.boolean,"FCompactAutoBitmapSize","SetCompactAutoBitmapSize",4,{Default: false});
    $r.addProperty("QuickMenuButtonHint",0,rtl.string,"FQuickMenuButtonHint","FQuickMenuButtonHint");
    $r.addProperty("QuickMenuButton",2,rtl.boolean,"FQuickMenuButton","SetQuickMenuButton",4,{Default: false});
    $r.addProperty("QuickMenuButtonAppearance",2,$mod.$rtti["TTMSFNCToolBarQuickMenuButtonAppearance"],"FQuickMenuButtonAppearance","SetQuickMenuButtonAppearance");
    $r.addProperty("MinimumWidth",14,rtl.double,"FMinimumWidth","SetMinimumWidth",4,{stored: "IsMinimumWidthStored"});
    $r.addProperty("WordWrapping",2,rtl.boolean,"FWordWrapping","SetWordWrapping",4,{Default: false});
    $r.addProperty("Text",2,rtl.string,"FText","SetText");
    $r.addProperty("Trimming",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextTrimming"],"FTrimming","SetTrimming",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttCharacter});
    $r.addProperty("HorizontalTextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FHorizontalTextAlign","SetHorizontalTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter});
    $r.addProperty("VerticalTextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FVerticalTextAlign","SetVerticalTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter});
    $r.addProperty("Font",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FFont$1","SetFont$1");
    $r.addProperty("DisabledFontColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FDisabledFontColor","SetDisabledFontColor",4,{Default: -1});
    $r.addProperty("OptionsMenu",2,$mod.$rtti["TTMSFNCToolBarOptionsMenu"],"FOptionsMenu","SetOptionsMenu");
    $r.addProperty("CustomOptionsMenu",0,pas["WEBLib.Menus"].$rtti["TPopupMenu"],"FCustomOptionsMenu","FCustomOptionsMenu");
    $r.addProperty("State",2,$mod.$rtti["TTMSFNCToolBarElementState"],"FState","SetState",4,{Default: $mod.TTMSFNCToolBarElementState.esNormal});
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
  rtl.createClass(this,"TTMSFNCCustomDockPanelAppearance",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FOwner = null;
      this.FFill = null;
      this.FStroke = null;
      this.FMargins = null;
    };
    this.$final = function () {
      this.FOwner = undefined;
      this.FFill = undefined;
      this.FStroke = undefined;
      this.FMargins = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetFill = function (Value) {
      this.FFill.Assign(Value);
    };
    this.SetStroke = function (Value) {
      this.FStroke.Assign(Value);
    };
    this.SetMargins = function (Value) {
      this.FMargins.Assign(Value);
    };
    this.FillChanged = function (Sender) {
      this.FOwner.Invalidate();
    };
    this.StrokeChanged = function (Sender) {
      this.FOwner.Invalidate();
    };
    this.MarginsChanged = function (Sender) {
      this.FOwner.UpdateControls();
    };
    this.Create$1 = function (AOwner) {
      this.FOwner = AOwner;
      this.FFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16777215,8421504,-1,-1]);
      this.FStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,8421504,1.0]);
      this.FFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FMargins = pas["WEBLib.TMSFNCTypes"].TTMSFNCMargins.$create("Create$1");
      this.FMargins.SetLeft(3);
      this.FMargins.SetTop(3);
      this.FMargins.SetBottom(3);
      this.FMargins.SetRight(3);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FMargins");
      rtl.free(this,"FFill");
      rtl.free(this,"FStroke");
      pas.System.TObject.Destroy.call(this);
    };
  });
  rtl.createClass(this,"TTMSFNCDockPanelAppearance",this.TTMSFNCCustomDockPanelAppearance,function () {
    var $r = this.$rtti;
    $r.addProperty("Fill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFill","SetFill");
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
  });
  rtl.createClass(this,"TTMSFNCCustomDockPanel",pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$init.call(this);
      this.FBlockUpdate = false;
      this.FAppearance = null;
      this.FAutoSize = false;
      this.FAutoAlign = false;
      this.FState = 0;
    };
    this.$final = function () {
      this.FAppearance = undefined;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$final.call(this);
    };
    this.SetAppearance = function (Value) {
      this.FAppearance.Assign(Value);
    };
    this.SetAutoAlign = function (Value) {
      if (this.FAutoAlign !== Value) {
        this.FAutoAlign = Value;
        this.UpdateControls();
      };
    };
    this.SetAS = function (Value) {
      if (this.FAutoSize !== Value) {
        this.FAutoSize = Value;
        this.UpdateControls();
      };
    };
    this.SetState = function (Value) {
      var I = 0;
      var c = null;
      if (this.FState !== Value) {
        this.FState = Value;
        for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
          I = $l;
          c = this.GetControls(I);
          if ($mod.TTMSFNCCustomToolBar.isPrototypeOf(c)) rtl.as(c,$mod.TTMSFNCCustomToolBar).SetState(this.FState);
        };
      };
    };
    this.GetDocURL = function () {
      var Result = "";
      Result = pas["WEBLib.TMSFNCTypes"].TTMSFNCBaseDocURL + "tmsfncuipack/components/ttmsfnctoolbar";
      return Result;
    };
    this.GetVersion = function () {
      var Result = "";
      Result = this.$class.GetVersionNumber(1,0,2,6);
      return Result;
    };
    this.SetAdaptToStyle = function (Value) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.SetAdaptToStyle.apply(this,arguments);
      this.UpdateControls();
    };
    this.UpdateControls = function () {
      var I = 0;
      var h = 0;
      var hsm = 0;
      var c = null;
      var ia = null;
      var $ir = rtl.createIntfRefs();
      try {
        if (this.FBlockUpdate || this.IsLoading() || this.IsDestroying()) return;
        this.FBlockUpdate = true;
        h = 0;
        hsm = this.ScalePaintValue(30);
        if (this.FAutoAlign) {
          this.InitializeControls();
          this.RearrangeControls();
        };
        if (this.FAutoSize) {
          for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
            I = $l;
            c = this.GetControls(I);
            if (pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(c,pas.System.IUnknown)),rtl.getIntfGUIDR(pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle),{get: function () {
                return ia;
              }, set: function (v) {
                ia = v;
              }})) ia.SetAdaptToStyle(this.GetAdaptToStyle());
            if (c.FVisible) h = Math.round(Math.max(h,c.GetTop() + c.GetHeight() + this.FAppearance.FMargins.FBottom));
          };
          if (h === 0) h = hsm;
          if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) h = h + this.ScalePaintValue(15);
          this.SetBounds(this.GetLeft(),this.GetTop(),this.GetWidth(),h);
        };
        this.FBlockUpdate = false;
      } finally {
        $ir.free();
        rtl._Release(ia);
      };
    };
    this.InitializeControls = function () {
      var I = 0;
      var c = null;
      for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
        I = $l;
        c = this.GetControls(I);
        if ($mod.TTMSFNCCustomToolBar.isPrototypeOf(c)) {
          rtl.as(c,$mod.TTMSFNCCustomToolBar).FOnUpdateDockPanel = rtl.createCallback(this,"UpdateDockPanel");
          if (rtl.as(c,$mod.TTMSFNCCustomToolBar).FDragGripMoving) continue;
        };
        if (c.FVisible) {
          if (c.GetTop() < this.FAppearance.FMargins.FTop) c.SetTop(Math.round(this.FAppearance.FMargins.FTop));
          if (c.GetLeft() < this.FAppearance.FMargins.FLeft) {
            c.SetLeft(Math.round(this.FAppearance.FMargins.FLeft))}
           else if ((c.GetLeft() + c.GetWidth()) > (this.GetWidth() - this.FAppearance.FMargins.FRight)) c.SetLeft(Math.round(this.GetWidth() - this.FAppearance.FMargins.FRight - c.GetWidth()));
        };
      };
    };
    this.RearrangeControls = function () {
      var c = null;
      var cl = null;
      var cr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var clr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var I = 0;
      var J = 0;
      for (var $l = 0, $end = this.GetControlsCount() - 1; $l <= $end; $l++) {
        I = $l;
        c = this.GetControls(I);
        if (!c.FVisible) continue;
        if ($mod.TTMSFNCCustomToolBar.isPrototypeOf(c)) {
          if (rtl.as(c,$mod.TTMSFNCCustomToolBar).FDragGripMoving) continue;
        };
        for (var $l1 = 0, $end1 = this.GetControlsCount() - 1; $l1 <= $end1; $l1++) {
          J = $l1;
          cl = this.GetControls(J);
          if ((cl === c) || !cl.FVisible) continue;
          cr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(c.GetLeft(),c.GetTop(),c.GetLeft() + c.GetWidth(),c.GetTop() + c.GetHeight()));
          clr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(cl.GetLeft(),cl.GetTop(),cl.GetLeft() + cl.GetWidth(),cl.GetTop() + cl.GetHeight()));
          if ((clr.Left >= (cr.Left - 3)) && (clr.Left <= (cr.Right + 3))) {
            if ((clr.Top < pas["WEBLib.TMSFNCTypes"].CenterPointEx(cr).Y) && (clr.Top >= (cr.Top - 3))) {
              cl.SetLeft(c.GetLeft() + c.GetWidth() + 3);
              cl.SetTop(c.GetTop());
            } else if ((clr.Top >= pas["WEBLib.TMSFNCTypes"].CenterPointEx(cr).Y) && (clr.Top <= (cr.Bottom + 3))) {
              cl.SetTop(c.GetTop() + c.GetHeight() + 3);
              cl.SetLeft(c.GetLeft());
            };
          };
        };
      };
    };
    this.UpdateDockPanel = function (Sender) {
      this.UpdateControls();
    };
    this.ApplyStyle = function () {
      var c = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ApplyStyle.call(this);
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleHeaderFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FAppearance.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        this.FAppearance.FFill.SetColor(c);
      };
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleHeaderFillColorTo({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FAppearance.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient);
        this.FAppearance.FFill.SetColorTo(c);
      };
    };
    this.ResetToDefaultStyle = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ResetToDefaultStyle.call(this);
    };
    this.AlignControls = function (AControl, Rect) {
      pas["WEBLib.Controls"].TControl.AlignControls.apply(this,arguments);
      this.UpdateControls();
    };
    this.Assign = function (Source) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Assign.apply(this,arguments);
      if ($mod.TTMSFNCCustomDockPanel.isPrototypeOf(Source)) {
        this.FAppearance.Assign(rtl.as(Source,$mod.TTMSFNCCustomDockPanel).FAppearance);
        this.SetAS(rtl.as(Source,$mod.TTMSFNCCustomDockPanel).FAutoSize);
        this.SetAutoAlign(rtl.as(Source,$mod.TTMSFNCCustomDockPanel).FAutoAlign);
        this.SetState(rtl.as(Source,$mod.TTMSFNCCustomDockPanel).FState);
      } else pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Assign.apply(this,arguments);
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Create$1.apply(this,arguments);
      this.FState = $mod.TTMSFNCToolBarElementState.esNormal;
      this.FAppearance = $mod.TTMSFNCDockPanelAppearance.$create("Create$1",[this]);
      this.FAutoSize = true;
      this.FAutoAlign = true;
      this.SetAlign(pas["WEBLib.Controls"].TAlign.alTop);
      this.SetHeight(40);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FAppearance");
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Destroy.call(this);
    };
    this.Draw = function (AGraphics, ARect) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Draw.apply(this,arguments);
      AGraphics.FFill.Assign(this.FAppearance.FFill);
      AGraphics.FStroke.Assign(this.FAppearance.FStroke);
      r.$assign(this.GetLocalRect());
      AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
    };
    this.AddToolBar = function (AIndex) {
      var Result = null;
      this.FBlockUpdate = true;
      Result = $mod.TTMSFNCToolBar.$create("Create$1",[this]);
      Result.SetParent(this);
      this.FBlockUpdate = false;
      this.UpdateControls();
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCDockPanel",this.TTMSFNCCustomDockPanel,function () {
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Version",1,rtl.string,"GetVersion","");
    $r.addProperty("Appearance",2,$mod.$rtti["TTMSFNCDockPanelAppearance"],"FAppearance","SetAppearance");
    $r.addProperty("AutoSize",2,rtl.boolean,"FAutoSize","SetAS",4,{Default: true});
    $r.addProperty("AutoAlign",2,rtl.boolean,"FAutoAlign","SetAutoAlign",4,{Default: true});
    $r.addProperty("State",2,$mod.$rtti["TTMSFNCToolBarElementState"],"FState","SetState",4,{Default: $mod.TTMSFNCToolBarElementState.esNormal});
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
  $mod.$implcode = function () {
    rtl.createClass($impl,"TControlOpen",pas["WEBLib.Controls"].TControl,function () {
      rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
      rtl.addIntf(this,pas.System.IUnknown);
    });
  };
  $mod.$init = function () {
    pas.Classes.RegisterClass($mod.TTMSFNCToolBarButton);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBAREXPANDSVG);
  };
},["Math","SysUtils","WEBLib.TMSFNCUtils","WEBLib.Graphics","StrUtils"]);
rtl.module("WEBLib.TMSFNCEditorToolBar",["System","Classes","WEBLib.TMSFNCToolBar","WEBLib.TMSFNCTypes","WEBLib.TMSFNCGraphicsTypes"],function () {
  "use strict";
  var $mod = this;
  this.MAJ_VER = 1;
  this.MIN_VER = 0;
  this.REL_VER = 0;
  this.BLD_VER = 0;
  this.TMSFNCTOOLBARBOLDSVG = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNC" + "Igdmlld0JveD0iMCAwIDI0IDI0Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzNhM2EzODt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPkJvb" + "GQ8L3RpdGxlPjxnIGlkPSJJY29uIj48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik03LDE3VjJoNC44NWE1LjU1LDUuNTUsMCwwLDEsMy40Mi45" + "MiwzLjA3LDMuMDcsMCwwLDEsMS4yLDIuNTksMy4zLDMuMywwLDAsMS0uNzMsMi4xM0EzLjY2LDMuNjYsMCwwLDEsMTMuODgsOC45VjlBMy4" + "0OCwzLjQ4LDAsMCwxLDE3LDEyLjUyYTQuMjMsNC4yMywwLDAsMS0xLjMxLDMuMjdBNSw1LDAsMCwxLDEyLjEyLDE3Wk0xMCw0LjQ5VjguMD" + "VoMS4zMmEyLDIsMCwwLDAsMS40Ni0uNTEsMS44MiwxLjgyLDAsMCwwLC41My0xLjRxMC0xLjY1LTIuMTktMS42NVptMCw2LjA3djMuOTVoM" + "S42MkEyLjMxLDIuMzEsMCwwLDAsMTMuMjUsMTRhMS45MiwxLjkyLDAsMCwwLC41OS0xLjQ5LDEuNzcsMS43NywwLDAsMC0uNTgtMS40MSwy" + "LjM1LDIuMzUsMCwwLDAtMS42Mi0uNTFaIi8+PC9nPjwvc3ZnPg==";
  this.TMSFNCTOOLBARBOLDSVGWHITE = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3" + "d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGRlZnM+PHN0eWxlPi5jb" + "HMtMXtmaWxsOm5vbmU7fS5jbHMtMntmaWxsOiNmYWZhZmE7fS5jbHMtM3tmaWxsOnVybCgjTmV3X1BhdHRlcm5fU3dhdGNoXzIpO308L3N0" + "eWxlPjxwYXR0ZXJuIGlkPSJOZXdfUGF0dGVybl9Td2F0Y2hfMiIgZGF0YS1uYW1lPSJOZXcgUGF0dGVybiBTd2F0Y2ggMiIgd2lkdGg9IjY" + "4IiBoZWlnaHQ9IjY4IiBwYXR0ZXJuVW5pdHM9InVzZXJTcGFjZU9uVXNlIiB2aWV3Qm94PSIwIDAgNjggNjgiPjxyZWN0IGNsYXNzPSJjbH" + "MtMSIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9ImNscy0yIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48L3BhdHRlc" + "m4+PC9kZWZzPjx0aXRsZT5Cb2xkPC90aXRsZT48ZyBpZD0iSWNvbiI+PHBhdGggY2xhc3M9ImNscy0zIiBkPSJNNywxN1YyaDQuODVhNS41" + "NSw1LjU1LDAsMCwxLDMuNDIuOTIsMy4wNywzLjA3LDAsMCwxLDEuMiwyLjU5LDMuMywzLjMsMCwwLDEtLjczLDIuMTNBMy42NiwzLjY2LDA" + "sMCwxLDEzLjg4LDguOVY5QTMuNDgsMy40OCwwLDAsMSwxNywxMi41MmE0LjIzLDQuMjMsMCwwLDEtMS4zMSwzLjI3QTUsNSwwLDAsMSwxMi" + "4xMiwxN1pNMTAsNC40OVY4LjA1aDEuMzJhMiwyLDAsMCwwLDEuNDYtLjUxLDEuODIsMS44MiwwLDAsMCwuNTMtMS40cTAtMS42NS0yLjE5L" + "TEuNjVabTAsNi4wN3YzLjk1aDEuNjJBMi4zMSwyLjMxLDAsMCwwLDEzLjI1LDE0YTEuOTIsMS45MiwwLDAsMCwuNTktMS40OSwxLjc3LDEu" + "NzcsMCwwLDAtLjU4LTEuNDEsMi4zNSwyLjM1LDAsMCwwLTEuNjItLjUxWiIvPjwvZz48L3N2Zz4=";
  this.TMSFNCTOOLBARITALICSVG = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0" + "JveD0iMCAwIDI0IDI0Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzNhM2EzODt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPkl0YWxpYzwvdGl0" + "bGU+PGcgaWQ9Ikljb24iPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTEzLDE2LjU5bC0uMS40MUg3LjM3bC4xNC0uNDFhMy4xNSwzLjE1LDAsMC" + "wwLDEuMDktLjE1LDEuNDQsMS40NCwwLDAsMCwuNjUtLjUyLDcuNjcsNy42NywwLDAsMCwuNjctMS44NmwyLjMzLTlhNy4yOSw3LjI5LDAsMCww" + "LC4zLTEuNy44My44MywwLDAsMC0uMTMtLjQ5QS43OC43OCwwLDAsMCwxMiwyLjUxYTMuMjcsMy4yNywwLDAsMC0xLS4xTDExLjEzLDJoNS4xOG" + "wtLjExLjQxYTIsMiwwLDAsMC0uOTQuMTUsMS42LDEuNiwwLDAsMC0uNjguNjNBMTAuMjYsMTAuMjYsMCwwLDAsMTQsNWwtMi4zMiw5LjA1YTku" + "MTksOS4xOSwwLDAsMC0uMzIsMS41OS44MS44MSwwLDAsMCwuMTMuNDcuNzYuNzYsMCwwLDAsLjM5LjNBNC42Nyw0LjY3LDAsMCwwLDEzLDE2Lj" + "U5WiIvPjwvZz48L3N2Zz4=";
  this.TMSFNCTOOLBARITALICSVGWHITE = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm" + "9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsO" + "m5vbmU7fS5jbHMtMntmaWxsOiNmYWZhZmE7fS5jbHMtM3tmaWxsOnVybCgjTmV3X1BhdHRlcm5fU3dhdGNoXzIpO308L3N0eWxlPjxwYXR0ZXJu" + "IGlkPSJOZXdfUGF0dGVybl9Td2F0Y2hfMiIgZGF0YS1uYW1lPSJOZXcgUGF0dGVybiBTd2F0Y2ggMiIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4IiB" + "wYXR0ZXJuVW5pdHM9InVzZXJTcGFjZU9uVXNlIiB2aWV3Qm94PSIwIDAgNjggNjgiPjxyZWN0IGNsYXNzPSJjbHMtMSIgd2lkdGg9IjY4IiBoZW" + "lnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9ImNscy0yIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48L3BhdHRlcm4+PC9kZWZzPjx0aXRsZT5JdGFsa" + "WM8L3RpdGxlPjxnIGlkPSJJY29uIj48cGF0aCBjbGFzcz0iY2xzLTMiIGQ9Ik0xMywxNi41OWwtLjEuNDFINy4zN2wuMTQtLjQxYTMuMTUsMy4x" + "NSwwLDAsMCwxLjA5LS4xNSwxLjQ0LDEuNDQsMCwwLDAsLjY1LS41Miw3LjY3LDcuNjcsMCwwLDAsLjY3LTEuODZsMi4zMy05YTcuMjksNy4yOSw" + "wLDAsMCwuMy0xLjcuODMuODMsMCwwLDAtLjEzLS40OUEuNzguNzgsMCwwLDAsMTIsMi41MWEzLjI3LDMuMjcsMCwwLDAtMS0uMUwxMS4xMywyaD" + "UuMThsLS4xMS40MWEyLDIsMCwwLDAtLjk0LjE1LDEuNiwxLjYsMCwwLDAtLjY4LjYzQTEwLjI2LDEwLjI2LDAsMCwwLDE0LDVsLTIuMzIsOS4wN" + "WE5LjE5LDkuMTksMCwwLDAtLjMyLDEuNTkuODEuODEsMCwwLDAsLjEzLjQ3Ljc2Ljc2LDAsMCwwLC4zOS4zQTQuNjcsNC42NywwLDAsMCwxMywx" + "Ni41OVoiLz48L2c+PC9zdmc+";
  this.TMSFNCTOOLBARUNDERLINESVG = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0i" + "MCAwIDI0IDI0Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzNhM2EzODt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPlVuZGVybGluZTwvdGl0bGU+PGcga" + "WQ9Ikljb24iPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTE3LDEwLjc5UTE3LDE3LDExLjM4LDE3LDYsMTcsNiwxMVYySDguMzR2OC41MnEwLDQuMzQsMy" + "4yMiw0LjM0dDMuMS00LjE5VjJIMTdaIi8+PHJlY3QgY2xhc3M9ImNscy0xIiB4PSI1IiB5PSIxOCIgd2lkdGg9IjEzIiBoZWlnaHQ9IjIiLz48L2c+PC9" + "zdmc+";
  this.TMSFNCTOOLBARUNDERLINESVGWHITE = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8x" + "OTk5L3hsaW5rIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOm5vbmU7fS5jb" + "HMtMntmaWxsOiNmYWZhZmE7fS5jbHMtM3tmaWxsOnVybCgjTmV3X1BhdHRlcm5fU3dhdGNoXzIpO308L3N0eWxlPjxwYXR0ZXJuIGlkPSJOZXdfUGF0dG" + "Vybl9Td2F0Y2hfMiIgZGF0YS1uYW1lPSJOZXcgUGF0dGVybiBTd2F0Y2ggMiIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4IiBwYXR0ZXJuVW5pdHM9InVzZXJ" + "TcGFjZU9uVXNlIiB2aWV3Qm94PSIwIDAgNjggNjgiPjxyZWN0IGNsYXNzPSJjbHMtMSIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9" + "ImNscy0yIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48L3BhdHRlcm4+PC9kZWZzPjx0aXRsZT5VbmRlcmxpbmU8L3RpdGxlPjxnIGlkPSJJY29uIj48c" + "GF0aCBjbGFzcz0iY2xzLTMiIGQ9Ik0xNywxMC43OVExNywxNywxMS4zOCwxNyw2LDE3LDYsMTFWMkg4LjM0djguNTJxMCw0LjM0LDMuMjIsNC4zNHQzLj" + "EtNC4xOVYySDE3WiIvPjxyZWN0IGNsYXNzPSJjbHMtMyIgeD0iNSIgeT0iMTgiIHdpZHRoPSIxMyIgaGVpZ2h0PSIyIi8+PC9nPjwvc3ZnPg==";
  this.TMSFNCTOOLBARSTRIKEOUTSVG = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0i" + "MCAwIDI0IDI0Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzNhM2EzODt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPlN0cmlrZW91dDwvdGl0bGU+PGcga" + "WQ9Ikljb24iPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTguMDUsMTYuMThWMTMuN2E0LjEzLDQuMTMsMCwwLDAsLjc2LjU1LDUuNzksNS43OSwwLDAsMC" + "wuOTUuNDEsOSw5LDAsMCwwLDEsLjI2LDUuMTksNS4xOSwwLDAsMCwuOTIuMDksMy43NCwzLjc0LDAsMCwwLDIuMTctLjUxQTEuNjksMS42OSwwLDAsMCw" + "xNC41NiwxM2ExLjYyLDEuNjIsMCwwLDAtLjI0LS44OSwyLjU2LDIuNTYsMCwwLDAtLjY2LS43LDcuMjgsNy4yOCwwLDAsMC0xLS42bC0xLjI1LS42Yy0u" + "NDctLjI2LS45MS0uNTMtMS4zMi0uOEE1LjYsNS42LDAsMCwxLDksOC41NGEzLjY1LDMuNjUsMCwwLDEtLjcxLTEuMUEzLjgzLDMuODMsMCwwLDEsOCw2Y" + "TMuNTEsMy41MSwwLDAsMSwuNDQtMS43OEEzLjg2LDMuODYsMCwwLDEsOS42NSwzYTUuMzEsNS4zMSwwLDAsMSwxLjY2LS43M0E3LjQyLDcuNDIsMCwwLD" + "EsMTMuMiwyYTcuMjMsNy4yMywwLDAsMSwzLjE5LjUyVjQuODlBNSw1LDAsMCwwLDEzLjMzLDRhNS4wNSw1LjA1LDAsMCwwLTEsLjExLDIuNjUsMi42NSw" + "wLDAsMC0uOTIuMzMsMS45LDEuOSwwLDAsMC0uNjYuNiwxLjQ3LDEuNDcsMCwwLDAtLjI1Ljg4LDEuNzQsMS43NCwwLDAsMCwuMTkuODQsMi4xMiwyLjEy" + "LDAsMCwwLC41Ny42NCw1Ljg3LDUuODcsMCwwLDAsLjkyLjU4bDEuMjUuNmExNS4yNywxNS4yNywwLDAsMSwxLjM4LjgzLDYuNzMsNi43MywwLDAsMSwxL" + "jE0LDEsNC4xMyw0LjEzLDAsMCwxLC43OCwxLjE3QTMuNTksMy41OSwwLDAsMSwxNywxM2EzLjY2LDMuNjYsMCwwLDEtLjQzLDEuODYsMy41NCwzLjU0LD" + "AsMCwxLTEuMTYsMS4yNCw0LjksNC45LDAsMCwxLTEuNjcuNjksOS4xNiw5LjE2LDAsMCwxLTIsLjIxLDcuNjEsNy42MSwwLDAsMS0uODYtLjA2LDEwLjM" + "sMTAuMywwLDAsMS0xLjA1LS4xNiw3Ljg1LDcuODUsMCwwLDEtMS0uMjZBMi45NCwyLjk0LDAsMCwxLDguMDUsMTYuMThaIi8+PHBhdGggY2xhc3M9ImNs" + "cy0xIiBkPSJNNywxMlYxMUgxOHYxWiIvPjwvZz48L3N2Zz4=";
  this.TMSFNCTOOLBARSTRIKEOUTSVGWHITE = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8x" + "OTk5L3hsaW5rIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOm5vbmU7fS5jb" + "HMtMntmaWxsOiNmYWZhZmE7fS5jbHMtM3tmaWxsOnVybCgjTmV3X1BhdHRlcm5fU3dhdGNoXzIpO308L3N0eWxlPjxwYXR0ZXJuIGlkPSJOZXdfUGF0dG" + "Vybl9Td2F0Y2hfMiIgZGF0YS1uYW1lPSJOZXcgUGF0dGVybiBTd2F0Y2ggMiIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4IiBwYXR0ZXJuVW5pdHM9InVzZXJ" + "TcGFjZU9uVXNlIiB2aWV3Qm94PSIwIDAgNjggNjgiPjxyZWN0IGNsYXNzPSJjbHMtMSIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9" + "ImNscy0yIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48L3BhdHRlcm4+PC9kZWZzPjx0aXRsZT5TdHJpa2VvdXQ8L3RpdGxlPjxnIGlkPSJJY29uIj48c" + "GF0aCBjbGFzcz0iY2xzLTMiIGQ9Ik04LjA1LDE2LjE4VjEzLjdhNC4xMyw0LjEzLDAsMCwwLC43Ni41NSw1Ljc5LDUuNzksMCwwLDAsLjk1LjQxLDksOS" + "wwLDAsMCwxLC4yNiw1LjE5LDUuMTksMCwwLDAsLjkyLjA5LDMuNzQsMy43NCwwLDAsMCwyLjE3LS41MUExLjY5LDEuNjksMCwwLDAsMTQuNTYsMTNhMS4" + "2MiwxLjYyLDAsMCwwLS4yNC0uODksMi41NiwyLjU2LDAsMCwwLS42Ni0uNyw3LjI4LDcuMjgsMCwwLDAtMS0uNmwtMS4yNS0uNmMtLjQ3LS4yNi0uOTEt" + "LjUzLTEuMzItLjhBNS42LDUuNiwwLDAsMSw5LDguNTRhMy42NSwzLjY1LDAsMCwxLS43MS0xLjFBMy44MywzLjgzLDAsMCwxLDgsNmEzLjUxLDMuNTEsM" + "CwwLDEsLjQ0LTEuNzhBMy44NiwzLjg2LDAsMCwxLDkuNjUsM2E1LjMxLDUuMzEsMCwwLDEsMS42Ni0uNzNBNy40Miw3LjQyLDAsMCwxLDEzLjIsMmE3Lj" + "IzLDcuMjMsMCwwLDEsMy4xOS41MlY0Ljg5QTUsNSwwLDAsMCwxMy4zMyw0YTUuMDUsNS4wNSwwLDAsMC0xLC4xMSwyLjY1LDIuNjUsMCwwLDAtLjkyLjM" + "zLDEuOSwxLjksMCwwLDAtLjY2LjYsMS40NywxLjQ3LDAsMCwwLS4yNS44OCwxLjc0LDEuNzQsMCwwLDAsLjE5Ljg0LDIuMTIsMi4xMiwwLDAsMCwuNTcu" + "NjQsNS44Nyw1Ljg3LDAsMCwwLC45Mi41OGwxLjI1LjZhMTUuMjcsMTUuMjcsMCwwLDEsMS4zOC44Myw2LjczLDYuNzMsMCwwLDEsMS4xNCwxLDQuMTMsN" + "C4xMywwLDAsMSwuNzgsMS4xN0EzLjU5LDMuNTksMCwwLDEsMTcsMTNhMy42NiwzLjY2LDAsMCwxLS40MywxLjg2LDMuNTQsMy41NCwwLDAsMS0xLjE2LD" + "EuMjQsNC45LDQuOSwwLDAsMS0xLjY3LjY5LDkuMTYsOS4xNiwwLDAsMS0yLC4yMSw3LjYxLDcuNjEsMCwwLDEtLjg2LS4wNiwxMC4zLDEwLjMsMCwwLDE" + "tMS4wNS0uMTYsNy44NSw3Ljg1LDAsMCwxLTEtLjI2QTIuOTQsMi45NCwwLDAsMSw4LjA1LDE2LjE4WiIvPjxwYXRoIGNsYXNzPSJjbHMtMyIgZD0iTTcs" + "MTJWMTFIMTh2MVoiLz48L2c+PC9zdmc+";
  this.TMSFNCTOOLBARALIGNLEFTSVG = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0i" + "MCAwIDI0IDI0Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzNhM2EzODt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPkFsaWduLUxlZnQ8L3RpdGxlPjxnI" + "GlkPSJJY29uIj48cmVjdCBjbGFzcz0iY2xzLTEiIHg9IjIiIHk9IjQiIHdpZHRoPSIyMSIgaGVpZ2h0PSIxIi8+PHJlY3QgY2xhc3M9ImNscy0xIiB4PS" + "IyIiB5PSI5IiB3aWR0aD0iMTUiIGhlaWdodD0iMSIvPjxyZWN0IGNsYXNzPSJjbHMtMSIgeD0iMiIgeT0iMTQiIHdpZHRoPSIyMSIgaGVpZ2h0PSIxIi8" + "+PHJlY3QgY2xhc3M9ImNscy0xIiB4PSIyIiB5PSIxOSIgd2lkdGg9IjE1IiBoZWlnaHQ9IjEiLz48L2c+PC9zdmc+";
  this.TMSFNCTOOLBARALIGNLEFTSVGWHITE = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8x" + "OTk5L3hsaW5rIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOm5vbmU7fS5jb" + "HMtMntmaWxsOiNmYWZhZmE7fS5jbHMtM3tmaWxsOnVybCgjTmV3X1BhdHRlcm5fU3dhdGNoXzIpO308L3N0eWxlPjxwYXR0ZXJuIGlkPSJOZXdfUGF0dG" + "Vybl9Td2F0Y2hfMiIgZGF0YS1uYW1lPSJOZXcgUGF0dGVybiBTd2F0Y2ggMiIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4IiBwYXR0ZXJuVW5pdHM9InVzZXJ" + "TcGFjZU9uVXNlIiB2aWV3Qm94PSIwIDAgNjggNjgiPjxyZWN0IGNsYXNzPSJjbHMtMSIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9" + "ImNscy0yIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48L3BhdHRlcm4+PC9kZWZzPjx0aXRsZT5BbGlnbi1MZWZ0PC90aXRsZT48ZyBpZD0iSWNvbiI+P" + "HJlY3QgY2xhc3M9ImNscy0zIiB4PSIyIiB5PSI0IiB3aWR0aD0iMjEiIGhlaWdodD0iMSIvPjxyZWN0IGNsYXNzPSJjbHMtMyIgeD0iMiIgeT0iOSIgd2" + "lkdGg9IjE1IiBoZWlnaHQ9IjEiLz48cmVjdCBjbGFzcz0iY2xzLTMiIHg9IjIiIHk9IjE0IiB3aWR0aD0iMjEiIGhlaWdodD0iMSIvPjxyZWN0IGNsYXN" + "zPSJjbHMtMyIgeD0iMiIgeT0iMTkiIHdpZHRoPSIxNSIgaGVpZ2h0PSIxIi8+PC9nPjwvc3ZnPg==";
  this.TMSFNCTOOLBARALIGNCENTERSVG = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0i" + "MCAwIDI0IDI0Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzNhM2EzODt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPkFsaWduLUNlbnRlcjwvdGl0bGU+P" + "GcgaWQ9Ikljb24iPjxyZWN0IGNsYXNzPSJjbHMtMSIgeD0iMSIgeT0iNCIgd2lkdGg9IjIxIiBoZWlnaHQ9IjEiLz48cmVjdCBjbGFzcz0iY2xzLTEiIH" + "g9IjQiIHk9IjkiIHdpZHRoPSIxNSIgaGVpZ2h0PSIxIi8+PHJlY3QgY2xhc3M9ImNscy0xIiB4PSIxIiB5PSIxNCIgd2lkdGg9IjIxIiBoZWlnaHQ9IjE" + "iLz48cmVjdCBjbGFzcz0iY2xzLTEiIHg9IjQiIHk9IjE5IiB3aWR0aD0iMTUiIGhlaWdodD0iMSIvPjwvZz48L3N2Zz4=";
  this.TMSFNCTOOLBARALIGNCENTERSVGWHITE = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8x" + "OTk5L3hsaW5rIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOm5vbmU7fS5jb" + "HMtMntmaWxsOiNmYWZhZmE7fS5jbHMtM3tmaWxsOnVybCgjTmV3X1BhdHRlcm5fU3dhdGNoXzIpO308L3N0eWxlPjxwYXR0ZXJuIGlkPSJOZXdfUGF0dG" + "Vybl9Td2F0Y2hfMiIgZGF0YS1uYW1lPSJOZXcgUGF0dGVybiBTd2F0Y2ggMiIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4IiBwYXR0ZXJuVW5pdHM9InVzZXJ" + "TcGFjZU9uVXNlIiB2aWV3Qm94PSIwIDAgNjggNjgiPjxyZWN0IGNsYXNzPSJjbHMtMSIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9" + "ImNscy0yIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48L3BhdHRlcm4+PC9kZWZzPjx0aXRsZT5BbGlnbi1DZW50ZXI8L3RpdGxlPjxnIGlkPSJJY29uI" + "j48cmVjdCBjbGFzcz0iY2xzLTMiIHg9IjEiIHk9IjQiIHdpZHRoPSIyMSIgaGVpZ2h0PSIxIi8+PHJlY3QgY2xhc3M9ImNscy0zIiB4PSI0IiB5PSI5Ii" + "B3aWR0aD0iMTUiIGhlaWdodD0iMSIvPjxyZWN0IGNsYXNzPSJjbHMtMyIgeD0iMSIgeT0iMTQiIHdpZHRoPSIyMSIgaGVpZ2h0PSIxIi8+PHJlY3QgY2x" + "hc3M9ImNscy0zIiB4PSI0IiB5PSIxOSIgd2lkdGg9IjE1IiBoZWlnaHQ9IjEiLz48L2c+PC9zdmc+";
  this.TMSFNCTOOLBARALIGNRIGHTSVG = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0i" + "MCAwIDI0IDI0Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzNhM2EzODt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPkFsaWduLVJpZ2h0PC90aXRsZT48Z" + "yBpZD0iSWNvbiI+PHJlY3QgY2xhc3M9ImNscy0xIiB4PSIyIiB5PSI0IiB3aWR0aD0iMjEiIGhlaWdodD0iMSIvPjxyZWN0IGNsYXNzPSJjbHMtMSIgeD" + "0iOCIgeT0iOSIgd2lkdGg9IjE1IiBoZWlnaHQ9IjEiLz48cmVjdCBjbGFzcz0iY2xzLTEiIHg9IjIiIHk9IjE0IiB3aWR0aD0iMjEiIGhlaWdodD0iMSI" + "vPjxyZWN0IGNsYXNzPSJjbHMtMSIgeD0iOCIgeT0iMTkiIHdpZHRoPSIxNSIgaGVpZ2h0PSIxIi8+PC9nPjwvc3ZnPg==";
  this.TMSFNCTOOLBARALIGNRIGHTSVGWHITE = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8x" + "OTk5L3hsaW5rIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOm5vbmU7fS5jb" + "HMtMntmaWxsOiNmYWZhZmE7fS5jbHMtM3tmaWxsOnVybCgjTmV3X1BhdHRlcm5fU3dhdGNoXzIpO308L3N0eWxlPjxwYXR0ZXJuIGlkPSJOZXdfUGF0dG" + "Vybl9Td2F0Y2hfMiIgZGF0YS1uYW1lPSJOZXcgUGF0dGVybiBTd2F0Y2ggMiIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4IiBwYXR0ZXJuVW5pdHM9InVzZXJ" + "TcGFjZU9uVXNlIiB2aWV3Qm94PSIwIDAgNjggNjgiPjxyZWN0IGNsYXNzPSJjbHMtMSIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9" + "ImNscy0yIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48L3BhdHRlcm4+PC9kZWZzPjx0aXRsZT5BbGlnbi1SaWdodDwvdGl0bGU+PGcgaWQ9Ikljb24iP" + "jxyZWN0IGNsYXNzPSJjbHMtMyIgeD0iMiIgeT0iNCIgd2lkdGg9IjIxIiBoZWlnaHQ9IjEiLz48cmVjdCBjbGFzcz0iY2xzLTMiIHg9IjgiIHk9IjkiIH" + "dpZHRoPSIxNSIgaGVpZ2h0PSIxIi8+PHJlY3QgY2xhc3M9ImNscy0zIiB4PSIyIiB5PSIxNCIgd2lkdGg9IjIxIiBoZWlnaHQ9IjEiLz48cmVjdCBjbGF" + "zcz0iY2xzLTMiIHg9IjgiIHk9IjE5IiB3aWR0aD0iMTUiIGhlaWdodD0iMSIvPjwvZz48L3N2Zz4=";
  this.TMSFNCTOOLBARIMAGESVG = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8x" + "OTk5L3hsaW5rIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOm5vbmU7fS5jb" + "HMtMntmaWxsOiMwZTY1YWY7fS5jbHMtM3tmaWxsOiNmOTk4NDY7fS5jbHMtNHtmaWxsOiNmYWZhZmE7fS5jbHMtNXtmaWxsOnVybCgjTmV3X1BhdHRlcm" + "5fU3dhdGNoXzkpO30uY2xzLTZ7ZmlsbDojODViZmVhO30uY2xzLTd7ZmlsbDp1cmwoI05ld19QYXR0ZXJuX1N3YXRjaF81KTt9LmNscy04e2ZpbGw6IzN" + "hM2EzODt9PC9zdHlsZT48cGF0dGVybiBpZD0iTmV3X1BhdHRlcm5fU3dhdGNoXzkiIGRhdGEtbmFtZT0iTmV3IFBhdHRlcm4gU3dhdGNoIDkiIHdpZHRo" + "PSI2OCIgaGVpZ2h0PSI2OCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgdmlld0JveD0iMCAwIDY4IDY4Ij48cmVjdCBjbGFzcz0iY2xzLTEiI" + "HdpZHRoPSI2OCIgaGVpZ2h0PSI2OCIvPjxyZWN0IGNsYXNzPSJjbHMtMyIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PC9wYXR0ZXJuPjxwYXR0ZXJuIG" + "lkPSJOZXdfUGF0dGVybl9Td2F0Y2hfNSIgZGF0YS1uYW1lPSJOZXcgUGF0dGVybiBTd2F0Y2ggNSIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4IiBwYXR0ZXJ" + "uVW5pdHM9InVzZXJTcGFjZU9uVXNlIiB2aWV3Qm94PSIwIDAgNjggNjgiPjxyZWN0IGNsYXNzPSJjbHMtMSIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+" + "PHJlY3QgY2xhc3M9ImNscy0yIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48L3BhdHRlcm4+PC9kZWZzPjx0aXRsZT5JbWFnZTwvdGl0bGU+PGcgaWQ9I" + "kljb24iPjxyZWN0IGNsYXNzPSJjbHMtNCIgeD0iMS41IiB5PSI0LjUiIHdpZHRoPSIyMSIgaGVpZ2h0PSIxNiIvPjxjaXJjbGUgY2xhc3M9ImNscy01Ii" + "BjeD0iMTgiIGN5PSI4IiByPSIyIi8+PHBvbHlnb24gY2xhc3M9ImNscy02IiBwb2ludHM9IjcgOSAxLjUgMTQuNSAxLjUgMjAuNSAxMi45NyAyMC41IDE" + "4LjUgMjAuNSAyMi41IDIwLjUgMjIuNSAxOC41IDE2LjUgMTIuNSAxMy41IDE1LjUgNyA5Ii8+PHBhdGggY2xhc3M9ImNscy03IiBkPSJNMTMuNSwxNC43" + "OSw3LDguMjlsLTYsNlYyMUgyM1YxOC4yOWwtNi41LTYuNVpNMTMuMjgsMjBIMlYxNC43MWw1LTUsNS43OSw1Ljc5LjcxLjcxTDE3LjI5LDIwWk0yMiwyM" + "EgxOC43MWwtNC41LTQuNSwyLjI5LTIuMjksNS41LDUuNVoiLz48cGF0aCBjbGFzcz0iY2xzLTgiIGQ9Ik0yMywyMUgxVjRIMjNaTTIsMjBIMjJWNUgyWi" + "IvPjwvZz48L3N2Zz4=";
  this.TMSFNCTOOLBARIMAGESVGWHITE = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8x" + "OTk5L3hsaW5rIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOm5vbmU7fS5jb" + "HMtMntmaWxsOiNmYWZhZmE7fS5jbHMtM3tmaWxsOnVybCgjTmV3X1BhdHRlcm5fU3dhdGNoXzIpO308L3N0eWxlPjxwYXR0ZXJuIGlkPSJOZXdfUGF0dG" + "Vybl9Td2F0Y2hfMiIgZGF0YS1uYW1lPSJOZXcgUGF0dGVybiBTd2F0Y2ggMiIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4IiBwYXR0ZXJuVW5pdHM9InVzZXJ" + "TcGFjZU9uVXNlIiB2aWV3Qm94PSIwIDAgNjggNjgiPjxyZWN0IGNsYXNzPSJjbHMtMSIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9" + "ImNscy0yIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48L3BhdHRlcm4+PC9kZWZzPjx0aXRsZT5JbWFnZTwvdGl0bGU+PGcgaWQ9Ikljb24iPjxwYXRoI" + "GNsYXNzPSJjbHMtMyIgZD0iTTEsMTQuMjlWMjFIMjNWNEgxWk0xMy4yOCwyMEgyVjE0LjcxbDUtNSw1Ljc5LDUuNzkuNzEuNzFMMTcuMjksMjBaTTIyLD" + "IwSDE4LjcxbC00LjUtNC41LDIuMjktMi4yOSw1LjUsNS41Wk0yMiw1VjE3LjI5bC01LjUtNS41LTMsM0w3LDguMjlsLTUsNVY1WiIvPjxjaXJjbGUgY2x" + "hc3M9ImNscy0zIiBjeD0iMTgiIGN5PSI4IiByPSIyIi8+PC9nPjwvc3ZnPg==";
  this.TMSFNCTOOLBARINTERNETLINKSVG = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0i" + "MCAwIDI0IDI0Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2ZhZmFmYTt9LmNscy0ye2ZpbGw6IzNhM2EzODt9PC9zdHlsZT48L2RlZnM+PHRpdGxlP" + "kludGVybmV0LUxpbms8L3RpdGxlPjxnIGlkPSJNYXNrIj48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik0xNi43Nyw5SDcuMjNBMTguODQsMTguODQsMCwwLD" + "AsNywxMmEyMC4wOSwyMC4wOSwwLDAsMCwuMjMsM2g5LjU0QTE5LjIyLDE5LjIyLDAsMCwwLDE3LDEyLDE5LjEyLDE5LjEyLDAsMCwwLDE2Ljc3LDlaIi8" + "+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMTUsMi40N0ExMS4xMiwxMS4xMiwwLDAsMSwxNy42MSw4aDMuNTVBMTAsMTAsMCwwLDAsMTUsMi40N1oiLz48" + "cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik0yMS41NCw5SDE3Ljc4QTIwLjU0LDIwLjU0LDAsMCwxLDE4LDEyYTIyLjA3LDIyLjA3LDAsMCwxLS4yMSwzaDMuN" + "zVhMTAsMTAsMCwwLDAsMC02WiIvPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTYuMjIsOUgyLjQ2YTEwLDEwLDAsMCwwLDAsNkg2LjIzQTE5LjQxLDE5Lj" + "QxLDAsMCwxLDYsMTIsMjAuNTQsMjAuNTQsMCwwLDEsNi4yMiw5WiIvPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTIuODQsOEg2LjM5QTExLjc3LDExLjc" + "3LDAsMCwxLDguODgsMi41LDEwLjA4LDEwLjA4LDAsMCwwLDIuODQsOFoiLz48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik0xMS45MiwyaC0uMTVDMTAsMi4x" + "LDguMjEsNC4zNyw3LjQxLDhoOS4xOEMxNS44Miw0LjQ2LDE0LDIsMTEuOTIsMloiLz48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik0yLjg0LDE2QTEwLDEwL" + "DAsMCwwLDksMjEuNTR2MEExMS41NywxMS41NywwLDAsMSw2LjQyLDE2WiIvPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTksMTkuODlWMTguNTJBMy41LD" + "MuNSwwLDAsMSwxMC4wNywxNkg3LjQyQTExLjg3LDExLjg3LDAsMCwwLDksMTkuODlaIi8+PHBhdGggY2xhc3M9ImNscy0yIiBkPSJNMTIsMWgtLjI3QTE" + "xLDExLDAsMCwwLDksMjIuNThzMC0uMDcsMC0uMXYtLjk0QTEwLDEwLDAsMCwxLDIuODQsMTZINi40MkExMS41NywxMS41NywwLDAsMCw5LDIxLjUxVjE5" + "Ljg5QTExLjg3LDExLjg3LDAsMCwxLDcuNDIsMTZoMi42NWEzLjQ5LDMuNDksMCwwLDEsMi40NS0xSDcuMjNBMjAuMDksMjAuMDksMCwwLDEsNywxMmExO" + "C44NCwxOC44NCwwLDAsMSwuMjMtM2g5LjU0QTE5LjEyLDE5LjEyLDAsMCwxLDE3LDEyYTE5LjIyLDE5LjIyLDAsMCwxLS4yMywzaDFBMjIuMDcsMjIuMD" + "csMCwwLDAsMTgsMTJhMjAuNTQsMjAuNTQsMCwwLDAtLjIyLTNoMy43NmExMCwxMCwwLDAsMSwwLDZoMUExMSwxMSwwLDAsMCwxMiwxWk0yLjQ2LDE1YTE" + "wLDEwLDAsMCwxLDAtNkg2LjIyQTIwLjU0LDIwLjU0LDAsMCwwLDYsMTJhMTkuNDEsMTkuNDEsMCwwLDAsLjIzLDNaTTYuMzksOEgyLjg0YTEwLjA4LDEw" + "LjA4LDAsMCwxLDYtNS41QTExLjc3LDExLjc3LDAsMCwwLDYuMzksOFptMSwwYy44LTMuNjMsMi42MS01LjksNC4zNi02aC4xNWMyLjEyLDAsMy45LDIuN" + "DYsNC42Nyw2Wm0xMC4yLDBBMTEuMTIsMTEuMTIsMCwwLDAsMTUsMi40NywxMCwxMCwwLDAsMSwyMS4xNiw4WiIvPjwvZz48ZyBpZD0iT3ZlcmxheSI+PH" + "BhdGggY2xhc3M9ImNscy0yIiBkPSJNMTQuNjksMjNIMTQuMUEyLjMzLDIuMzMsMCwwLDEsMTIsMjAuNSwyLjMzLDIuMzMsMCwwLDEsMTQuMSwxOGgyLjh" + "hMS43MywxLjczLDAsMCwxLC42LjEyLDIuMTIsMi4xMiwwLDAsMSwxLjA3Ljg4LDIuODMsMi44MywwLDAsMSwwLDNoMS4xMmEzLjc4LDMuNzgsMCwwLDAs" + "MC0zLDMuNjgsMy42OCwwLDAsMC0uNjMtMSwyLjkzLDIuOTMsMCwwLDAtMS41Ni0uOTMsMi45LDIuOSwwLDAsMC0uNi0uMDdIMTQuMUEzLjMyLDMuMzIsM" + "CwwLDAsMTEsMjAuNSwzLjMyLDMuMzIsMCwwLDAsMTQuMSwyNEgxNUEyLjg1LDIuODUsMCwwLDAsMTQuNjksMjNaIi8+PHBhdGggY2xhc3M9ImNscy0yIi" + "BkPSJNMjAuOSwxN0gyMGEyLjg1LDIuODUsMCwwLDAsLjMxLDFoLjU5QTIuMzMsMi4zMywwLDAsMSwyMywyMC41LDIuMzMsMi4zMywwLDAsMSwyMC45LDI" + "zSDE4LjFhMS43MywxLjczLDAsMCwxLS42LS4xMkEyLjEyLDIuMTIsMCwwLDEsMTYuNDMsMjJhMi44MywyLjgzLDAsMCwxLDAtM0gxNS4zMWEzLjc4LDMu" + "NzgsMCwwLDAsMCwzLDMuNjgsMy42OCwwLDAsMCwuNjMsMSwyLjkzLDIuOTMsMCwwLDAsMS41Ni45MywyLjksMi45LDAsMCwwLC42LjA3aDIuOEEzLjMyL" + "DMuMzIsMCwwLDAsMjQsMjAuNSwzLjMyLDMuMzIsMCwwLDAsMjAuOSwxN1oiLz48L2c+PC9zdmc+";
  this.TMSFNCTOOLBARINTERNETLINKSVGWHITE = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8x" + "OTk5L3hsaW5rIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOm5vbmU7fS5jb" + "HMtMntmaWxsOiNmYWZhZmE7fS5jbHMtM3tmaWxsOnVybCgjTmV3X1BhdHRlcm5fU3dhdGNoXzIpO308L3N0eWxlPjxwYXR0ZXJuIGlkPSJOZXdfUGF0dG" + "Vybl9Td2F0Y2hfMiIgZGF0YS1uYW1lPSJOZXcgUGF0dGVybiBTd2F0Y2ggMiIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4IiBwYXR0ZXJuVW5pdHM9InVzZXJ" + "TcGFjZU9uVXNlIiB2aWV3Qm94PSIwIDAgNjggNjgiPjxyZWN0IGNsYXNzPSJjbHMtMSIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9" + "ImNscy0yIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48L3BhdHRlcm4+PC9kZWZzPjx0aXRsZT5JbnRlcm5ldC1MaW5rPC90aXRsZT48ZyBpZD0iTWFza" + "yI+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMjEuNTQsOUgxNy43OEEyMC41NCwyMC41NCwwLDAsMSwxOCwxMmEyMi4wNywyMi4wNywwLDAsMS0uMjEsM2" + "gzLjc1YTEwLDEwLDAsMCwwLDAtNloiLz48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik0yLjQ2LDE1SDYuMjNBMTkuNDEsMTkuNDEsMCwwLDEsNiwxMmEyMC4" + "1NCwyMC41NCwwLDAsMSwuMjItM0gyLjQ2YTEwLDEwLDAsMCwwLDAsNloiLz48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik04Ljg4LDIuNWExMC4wOCwxMC4w" + "OCwwLDAsMC02LDUuNUg2LjM5QTExLjc3LDExLjc3LDAsMCwxLDguODgsMi41WiIvPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTIxLjE2LDhBMTAsMTAsM" + "CwwLDAsMTUsMi40NywxMS4xMiwxMS4xMiwwLDAsMSwxNy42MSw4WiIvPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTE2LjU5LDhDMTUuODIsNC40NiwxNC" + "wyLDExLjkyLDJoLS4xNUMxMCwyLjEsOC4yMSw0LjM3LDcuNDEsOFoiLz48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik0xNi43Nyw5SDcuMjNBMTguODQsMTg" + "uODQsMCwwLDAsNywxMmEyMC4wOSwyMC4wOSwwLDAsMCwuMjMsM2g5LjU0QTE5LjIyLDE5LjIyLDAsMCwwLDE3LDEyLDE5LjEyLDE5LjEyLDAsMCwwLDE2" + "Ljc3LDlaIi8+PHBhdGggY2xhc3M9ImNscy0zIiBkPSJNOSwyMi41OHMwLS4wNywwLS4xdi0uOTRBMTAsMTAsMCwwLDEsMi44NCwxNkg2LjQyQTExLjU3L" + "DExLjU3LDAsMCwwLDksMjEuNTFWMTkuODlBMTEuODcsMTEuODcsMCwwLDEsNy40MiwxNmgyLjY1YTMuNDksMy40OSwwLDAsMSwyLjQ1LTFINy4yM0EyMC" + "4wOSwyMC4wOSwwLDAsMSw3LDEyYTE4Ljg0LDE4Ljg0LDAsMCwxLC4yMy0zaDkuNTRBMTkuMTIsMTkuMTIsMCwwLDEsMTcsMTJhMTkuMjIsMTkuMjIsMCw" + "wLDEtLjIzLDNoMUEyMi4wNywyMi4wNywwLDAsMCwxOCwxMmEyMC41NCwyMC41NCwwLDAsMC0uMjItM2gzLjc2YTEwLDEwLDAsMCwxLDAsNmgxQTExLDEx" + "LDAsMCwwLDEyLDFoLS4yN0ExMSwxMSwwLDAsMCw5LDIyLjU4Wk0yMS4xNiw4SDE3LjYxQTExLjEyLDExLjEyLDAsMCwwLDE1LDIuNDcsMTAsMTAsMCwwL" + "DEsMjEuMTYsOFpNMTEuNzcsMmguMTVjMi4xMiwwLDMuOSwyLjQ2LDQuNjcsNkg3LjQxQzguMjEsNC4zNywxMCwyLjEsMTEuNzcsMlpNOC44OCwyLjVBMT" + "EuNzcsMTEuNzcsMCwwLDAsNi4zOSw4SDIuODRBMTAuMDgsMTAuMDgsMCwwLDEsOC44OCwyLjVaTTYuMjIsOUEyMC41NCwyMC41NCwwLDAsMCw2LDEyYTE" + "5LjQxLDE5LjQxLDAsMCwwLC4yMywzSDIuNDZhMTAsMTAsMCwwLDEsMC02WiIvPjwvZz48ZyBpZD0iT3ZlcmxheSI+PHBhdGggY2xhc3M9ImNscy0zIiBk" + "PSJNMTQuNjksMjNIMTQuMUEyLjMzLDIuMzMsMCwwLDEsMTIsMjAuNSwyLjMzLDIuMzMsMCwwLDEsMTQuMSwxOGgyLjhhMS43MywxLjczLDAsMCwxLC42L" + "jEyLDIuMTIsMi4xMiwwLDAsMSwxLjA3Ljg4LDIuODMsMi44MywwLDAsMSwwLDNoMS4xMmEzLjc4LDMuNzgsMCwwLDAsMC0zLDMuNjgsMy42OCwwLDAsMC" + "0uNjMtMSwyLjkzLDIuOTMsMCwwLDAtMS41Ni0uOTMsMi45LDIuOSwwLDAsMC0uNi0uMDdIMTQuMUEzLjMyLDMuMzIsMCwwLDAsMTEsMjAuNSwzLjMyLDM" + "uMzIsMCwwLDAsMTQuMSwyNEgxNUEyLjg1LDIuODUsMCwwLDAsMTQuNjksMjNaIi8+PHBhdGggY2xhc3M9ImNscy0zIiBkPSJNMjAuOSwxN0gyMGEyLjg1" + "LDIuODUsMCwwLDAsLjMxLDFoLjU5QTIuMzMsMi4zMywwLDAsMSwyMywyMC41LDIuMzMsMi4zMywwLDAsMSwyMC45LDIzSDE4LjFhMS43MywxLjczLDAsM" + "CwxLS42LS4xMkEyLjEyLDIuMTIsMCwwLDEsMTYuNDMsMjJhMi44MywyLjgzLDAsMCwxLDAtM0gxNS4zMWEzLjc4LDMuNzgsMCwwLDAsMCwzLDMuNjgsMy" + "42OCwwLDAsMCwuNjMsMSwyLjkzLDIuOTMsMCwwLDAsMS41Ni45MywyLjksMi45LDAsMCwwLC42LjA3aDIuOEEzLjMyLDMuMzIsMCwwLDAsMjQsMjAuNSw" + "zLjMyLDMuMzIsMCwwLDAsMjAuOSwxN1oiLz48L2c+PC9zdmc+";
  this.TMSFNCTOOLBARNUMBERINGSVG = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0i" + "MCAwIDI0IDI0Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzNhM2EzODt9LmNscy0ye2ZpbGw6IzFlOGJjZDt9PC9zdHlsZT48L2RlZnM+PHRpdGxlP" + "k51bWJlcmluZzwvdGl0bGU+PGcgaWQ9Ikljb24iPjxyZWN0IGNsYXNzPSJjbHMtMSIgeD0iNiIgeT0iNCIgd2lkdGg9IjE2IiBoZWlnaHQ9IjEiLz48cm" + "VjdCBjbGFzcz0iY2xzLTEiIHg9IjYiIHk9IjEyIiB3aWR0aD0iMTYiIGhlaWdodD0iMSIvPjxyZWN0IGNsYXNzPSJjbHMtMSIgeD0iNiIgeT0iMjAiIHd" + "pZHRoPSIxNiIgaGVpZ2h0PSIxIi8+PHBhdGggY2xhc3M9ImNscy0yIiBkPSJNNCwyLjI3VjhIMy4xNlYzLjM4YTIuNDgsMi40OCwwLDAsMS0uNDkuMyw0" + "LjE4LDQuMTgsMCwwLDEtLjYuMjJWMy4xM0wyLjQ4LDNsLjM4LS4xOC4zOS0uMjMuNC0uMjlaIi8+PHBhdGggY2xhc3M9ImNscy0yIiBkPSJNNSwxNUgxd" + "i0uNDZBMS43NywxLjc3LDAsMCwxLDEuMDgsMTRhMi4yLDIuMiwwLDAsMSwuMjMtLjQ2LDMuMjksMy4yOSwwLDAsMSwuMzMtLjQxYy4xMy0uMTMuMjctLj" + "I1LjQxLS4zN2wuNDUtLjM1LjQ0LS4zMy4zOC0uMzJhMiwyLDAsMCwwLC4yOC0uMzEsMS41MSwxLjUxLDAsMCwwLC4xOS0uMzUsMS4wOSwxLjA5LDAsMCw" + "wLC4wNy0uNCwxLDEsMCwwLDAtLjA4LS40MUEuNy43LDAsMCwwLDMuNTYsMTBhLjg4Ljg4LDAsMCwwLS4zMy0uMTgsMS40MiwxLjQyLDAsMCwwLS40Mi0u" + "MDZBMi4wOCwyLjA4LDAsMCwwLDIsMTBhMi42MiwyLjYyLDAsMCwwLS43OC41MVY5LjU0YTMuMjYsMy4yNiwwLDAsMSwuNC0uMjRsLjQxLS4xN0EzLDMsM" + "CwwLDEsMi41LDksMy44NCwzLjg0LDAsMCwxLDMsOWEyLjY4LDIuNjgsMCwwLDEsLjc4LjEsMS43LDEuNywwLDAsMSwuNi4zMSwxLjM5LDEuMzksMCwwLD" + "EsLjM5LjUxLDEuNzEsMS43MSwwLDAsMSwuMTMuNywyLjE3LDIuMTcsMCwwLDEtLjA5LjY1LDIuNjUsMi42NSwwLDAsMS0uMjcuNTMsMy4xLDMuMSwwLDA" + "sMS0uNDMuNDcsNi42NCw2LjY0LDAsMCwxLS41NS40NUwzLDEzLjFjLS4xNy4xMi0uMzIuMjQtLjQ2LjM2YTIuNjUsMi42NSwwLDAsMC0uMzMuMzUuNjEu" + "NjEsMCwwLDAtLjEzLjM1djBINVoiLz48cGF0aCBjbGFzcz0iY2xzLTIiIGQ9Ik0xLDIxLjY5di0uODhhMi41LDIuNSwwLDAsMCwxLjQ2LjQ1LDEuODIsM" + "S44MiwwLDAsMCwxLS4yNy44LjgsMCwwLDAsLjQtLjcxYzAtLjY2LS41OC0xLTEuNzItMUgxLjY3di0uNzVoLjQ5cTEuNTMsMCwxLjUzLS45M2MwLS41Ny" + "0uNC0uODYtMS4xOS0uODZhMi4xMSwyLjExLDAsMCwwLTEuMjUuNDJ2LS44NEEzLjU4LDMuNTgsMCwwLDEsMi44NCwxNmEyLjMxLDIuMzEsMCwwLDEsMS4" + "0MS4zOSwxLjE3LDEuMTcsMCwwLDEsLjUzLDFjMCwuNzctLjQ0LDEuMjYtMS4zMywxLjQ4aDBhMS45MSwxLjkxLDAsMCwxLDEuMTMuNDQsMS4yNCwxLjI0" + "LDAsMCwxLC40MiwxLDEuNDcsMS40NywwLDAsMS0uNjcsMS4yNkEzLDMsMCwwLDEsMi41NywyMiwzLjMyLDMuMzIsMCwwLDEsMSwyMS42OVoiLz48L2c+P" + "C9zdmc+";
  this.TMSFNCTOOLBARNUMBERINGSVGWHITE = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8x" + "OTk5L3hsaW5rIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOm5vbmU7fS5jb" + "HMtMntmaWxsOiNmYWZhZmE7fS5jbHMtM3tmaWxsOnVybCgjTmV3X1BhdHRlcm5fU3dhdGNoXzIpO308L3N0eWxlPjxwYXR0ZXJuIGlkPSJOZXdfUGF0dG" + "Vybl9Td2F0Y2hfMiIgZGF0YS1uYW1lPSJOZXcgUGF0dGVybiBTd2F0Y2ggMiIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4IiBwYXR0ZXJuVW5pdHM9InVzZXJ" + "TcGFjZU9uVXNlIiB2aWV3Qm94PSIwIDAgNjggNjgiPjxyZWN0IGNsYXNzPSJjbHMtMSIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9" + "ImNscy0yIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48L3BhdHRlcm4+PC9kZWZzPjx0aXRsZT5OdW1iZXJpbmc8L3RpdGxlPjxnIGlkPSJJY29uIj48c" + "mVjdCBjbGFzcz0iY2xzLTMiIHg9IjYiIHk9IjQiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxIi8+PHJlY3QgY2xhc3M9ImNscy0zIiB4PSI2IiB5PSIxMiIgd2" + "lkdGg9IjE2IiBoZWlnaHQ9IjEiLz48cmVjdCBjbGFzcz0iY2xzLTMiIHg9IjYiIHk9IjIwIiB3aWR0aD0iMTYiIGhlaWdodD0iMSIvPjxwYXRoIGNsYXN" + "zPSJjbHMtMyIgZD0iTTQsMi4yN1Y4SDMuMTZWMy4zOGEyLjQ4LDIuNDgsMCwwLDEtLjQ5LjMsNC4xOCw0LjE4LDAsMCwxLS42LjIyVjMuMTNMMi40OCwz" + "bC4zOC0uMTguMzktLjIzLjQtLjI5WiIvPjxwYXRoIGNsYXNzPSJjbHMtMyIgZD0iTTUsMTVIMXYtLjQ2QTEuNzcsMS43NywwLDAsMSwxLjA4LDE0YTIuM" + "iwyLjIsMCwwLDEsLjIzLS40NiwzLjI5LDMuMjksMCwwLDEsLjMzLS40MWMuMTMtLjEzLjI3LS4yNS40MS0uMzdsLjQ1LS4zNS40NC0uMzMuMzgtLjMyYT" + "IsMiwwLDAsMCwuMjgtLjMxLDEuNTEsMS41MSwwLDAsMCwuMTktLjM1LDEuMDksMS4wOSwwLDAsMCwuMDctLjQsMSwxLDAsMCwwLS4wOC0uNDFBLjcuNyw" + "wLDAsMCwzLjU2LDEwYS44OC44OCwwLDAsMC0uMzMtLjE4LDEuNDIsMS40MiwwLDAsMC0uNDItLjA2QTIuMDgsMi4wOCwwLDAsMCwyLDEwYTIuNjIsMi42" + "MiwwLDAsMC0uNzguNTFWOS41NGEzLjI2LDMuMjYsMCwwLDEsLjQtLjI0bC40MS0uMTdBMywzLDAsMCwxLDIuNSw5LDMuODQsMy44NCwwLDAsMSwzLDlhM" + "i42OCwyLjY4LDAsMCwxLC43OC4xLDEuNywxLjcsMCwwLDEsLjYuMzEsMS4zOSwxLjM5LDAsMCwxLC4zOS41MSwxLjcxLDEuNzEsMCwwLDEsLjEzLjcsMi" + "4xNywyLjE3LDAsMCwxLS4wOS42NSwyLjY1LDIuNjUsMCwwLDEtLjI3LjUzLDMuMSwzLjEsMCwwLDEtLjQzLjQ3LDYuNjQsNi42NCwwLDAsMS0uNTUuNDV" + "MMywxMy4xYy0uMTcuMTItLjMyLjI0LS40Ni4zNmEyLjY1LDIuNjUsMCwwLDAtLjMzLjM1LjYxLjYxLDAsMCwwLS4xMy4zNXYwSDVaIi8+PHBhdGggY2xh" + "c3M9ImNscy0zIiBkPSJNMSwyMS42OXYtLjg4YTIuNSwyLjUsMCwwLDAsMS40Ni40NSwxLjgyLDEuODIsMCwwLDAsMS0uMjcuOC44LDAsMCwwLC40LS43M" + "WMwLS42Ni0uNTgtMS0xLjcyLTFIMS42N3YtLjc1aC40OXExLjUzLDAsMS41My0uOTNjMC0uNTctLjQtLjg2LTEuMTktLjg2YTIuMTEsMi4xMSwwLDAsMC" + "0xLjI1LjQydi0uODRBMy41OCwzLjU4LDAsMCwxLDIuODQsMTZhMi4zMSwyLjMxLDAsMCwxLDEuNDEuMzksMS4xNywxLjE3LDAsMCwxLC41MywxYzAsLjc" + "3LS40NCwxLjI2LTEuMzMsMS40OGgwYTEuOTEsMS45MSwwLDAsMSwxLjEzLjQ0LDEuMjQsMS4yNCwwLDAsMSwuNDIsMSwxLjQ3LDEuNDcsMCwwLDEtLjY3" + "LDEuMjZBMywzLDAsMCwxLDIuNTcsMjIsMy4zMiwzLjMyLDAsMCwxLDEsMjEuNjlaIi8+PC9nPjwvc3ZnPg==";
  this.TMSFNCTOOLBARINDENTDECREASESVG = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0i" + "MCAwIDI0IDI0Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzNhM2EzODt9LmNscy0ye2ZpbGw6IzFlOGJjZDt9PC9zdHlsZT48L2RlZnM+PHRpdGxlP" + "kluZGVudC1SaWdodDwvdGl0bGU+PGcgaWQ9Ikljb24iPjxyZWN0IGNsYXNzPSJjbHMtMSIgeD0iMSIgeT0iNCIgd2lkdGg9IjIyIiBoZWlnaHQ9IjEiLz" + "48cmVjdCBjbGFzcz0iY2xzLTEiIHg9IjEiIHk9IjkiIHdpZHRoPSIxMSIgaGVpZ2h0PSIxIi8+PHJlY3QgY2xhc3M9ImNscy0xIiB4PSIxIiB5PSIxNCI" + "gd2lkdGg9IjExIiBoZWlnaHQ9IjEiLz48cmVjdCBjbGFzcz0iY2xzLTEiIHg9IjEiIHk9IjE5IiB3aWR0aD0iMjIiIGhlaWdodD0iMSIvPjxwb2x5Z29u" + "IGNsYXNzPSJjbHMtMiIgcG9pbnRzPSIxOC42MiAxNS41IDE2LjEyIDEzIDIzIDEzIDIzIDEyIDE2LjEyIDEyIDE4LjYyIDkuNSAxNy42MiA4LjUgMTMuN" + "jIgMTIuNSAxNy42MiAxNi41IDE4LjYyIDE1LjUiLz48L2c+PC9zdmc+";
  this.TMSFNCTOOLBARINDENTDECREASESVGWHITE = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8x" + "OTk5L3hsaW5rIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOm5vbmU7fS5jb" + "HMtMntmaWxsOiNmYWZhZmE7fS5jbHMtM3tmaWxsOnVybCgjTmV3X1BhdHRlcm5fU3dhdGNoXzIpO308L3N0eWxlPjxwYXR0ZXJuIGlkPSJOZXdfUGF0dG" + "Vybl9Td2F0Y2hfMiIgZGF0YS1uYW1lPSJOZXcgUGF0dGVybiBTd2F0Y2ggMiIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4IiBwYXR0ZXJuVW5pdHM9InVzZXJ" + "TcGFjZU9uVXNlIiB2aWV3Qm94PSIwIDAgNjggNjgiPjxyZWN0IGNsYXNzPSJjbHMtMSIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9" + "ImNscy0yIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48L3BhdHRlcm4+PC9kZWZzPjx0aXRsZT5JbmRlbnQtUmlnaHQ8L3RpdGxlPjxnIGlkPSJJY29uI" + "j48cmVjdCBjbGFzcz0iY2xzLTMiIHg9IjEiIHk9IjQiIHdpZHRoPSIyMiIgaGVpZ2h0PSIxIi8+PHJlY3QgY2xhc3M9ImNscy0zIiB4PSIxIiB5PSI5Ii" + "B3aWR0aD0iMTEiIGhlaWdodD0iMSIvPjxyZWN0IGNsYXNzPSJjbHMtMyIgeD0iMSIgeT0iMTQiIHdpZHRoPSIxMSIgaGVpZ2h0PSIxIi8+PHJlY3QgY2x" + "hc3M9ImNscy0zIiB4PSIxIiB5PSIxOSIgd2lkdGg9IjIyIiBoZWlnaHQ9IjEiLz48cG9seWdvbiBjbGFzcz0iY2xzLTMiIHBvaW50cz0iMTguNjIgMTUu" + "NSAxNi4xMiAxMyAyMyAxMyAyMyAxMiAxNi4xMiAxMiAxOC42MiA5LjUgMTcuNjIgOC41IDEzLjYyIDEyLjUgMTcuNjIgMTYuNSAxOC42MiAxNS41Ii8+P" + "C9nPjwvc3ZnPg==";
  this.TMSFNCTOOLBARINDENTINCREASESVG = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0i" + "MCAwIDI0IDI0Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzNhM2EzODt9LmNscy0ye2ZpbGw6IzFlOGJjZDt9PC9zdHlsZT48L2RlZnM+PHRpdGxlP" + "kluZGVudC1MZWZ0PC90aXRsZT48ZyBpZD0iSWNvbiI+PHJlY3QgY2xhc3M9ImNscy0xIiB4PSIxIiB5PSI0IiB3aWR0aD0iMjIiIGhlaWdodD0iMSIvPj" + "xyZWN0IGNsYXNzPSJjbHMtMSIgeD0iMTIiIHk9IjkiIHdpZHRoPSIxMSIgaGVpZ2h0PSIxIi8+PHJlY3QgY2xhc3M9ImNscy0xIiB4PSIxMiIgeT0iMTQ" + "iIHdpZHRoPSIxMSIgaGVpZ2h0PSIxIi8+PHJlY3QgY2xhc3M9ImNscy0xIiB4PSIxIiB5PSIxOSIgd2lkdGg9IjIyIiBoZWlnaHQ9IjEiLz48cG9seWdv" + "biBjbGFzcz0iY2xzLTIiIHBvaW50cz0iNS4zOCAxNS41IDcuODggMTMgMSAxMyAxIDEyIDcuODggMTIgNS4zOCA5LjUgNi4zOCA4LjUgMTAuMzggMTIuN" + "SA2LjM4IDE2LjUgNS4zOCAxNS41Ii8+PC9nPjwvc3ZnPg==";
  this.TMSFNCTOOLBARINDENTINCREASESVGWHITE = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8x" + "OTk5L3hsaW5rIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOm5vbmU7fS5jb" + "HMtMntmaWxsOiNmYWZhZmE7fS5jbHMtM3tmaWxsOnVybCgjTmV3X1BhdHRlcm5fU3dhdGNoXzIpO308L3N0eWxlPjxwYXR0ZXJuIGlkPSJOZXdfUGF0dG" + "Vybl9Td2F0Y2hfMiIgZGF0YS1uYW1lPSJOZXcgUGF0dGVybiBTd2F0Y2ggMiIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4IiBwYXR0ZXJuVW5pdHM9InVzZXJ" + "TcGFjZU9uVXNlIiB2aWV3Qm94PSIwIDAgNjggNjgiPjxyZWN0IGNsYXNzPSJjbHMtMSIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9" + "ImNscy0yIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48L3BhdHRlcm4+PC9kZWZzPjx0aXRsZT5JbmRlbnQtTGVmdDwvdGl0bGU+PGcgaWQ9Ikljb24iP" + "jxyZWN0IGNsYXNzPSJjbHMtMyIgeD0iMSIgeT0iNCIgd2lkdGg9IjIyIiBoZWlnaHQ9IjEiLz48cmVjdCBjbGFzcz0iY2xzLTMiIHg9IjEyIiB5PSI5Ii" + "B3aWR0aD0iMTEiIGhlaWdodD0iMSIvPjxyZWN0IGNsYXNzPSJjbHMtMyIgeD0iMTIiIHk9IjE0IiB3aWR0aD0iMTEiIGhlaWdodD0iMSIvPjxyZWN0IGN" + "sYXNzPSJjbHMtMyIgeD0iMSIgeT0iMTkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIxIi8+PHBvbHlnb24gY2xhc3M9ImNscy0zIiBwb2ludHM9IjUuMzggMTUu" + "NSA3Ljg4IDEzIDEgMTMgMSAxMiA3Ljg4IDEyIDUuMzggOS41IDYuMzggOC41IDEwLjM4IDEyLjUgNi4zOCAxNi41IDUuMzggMTUuNSIvPjwvZz48L3N2Zz4=";
  this.TMSFNCTOOLBARCIRCLESVG = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiI+DQogICA8Y2ly" + "Y2xlIGN4PSI2IiBjeT0iNiIgcj0iMyIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSI0IiBmaWxsPSJibGFjayIgLz4NCjwvc3ZnPiA=";
  this.TMSFNCTOOLBARCIRCLESVGWHITE = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiI+DQogICA8Y2ly" + "Y2xlIGN4PSI2IiBjeT0iNiIgcj0iMyIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSI0IiBmaWxsPSJ3aGl0ZSIgLz4NCjwvc3ZnPiA=";
  this.TMSFNCTOOLBARSQUARESVG = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiI+DQogIDxyZWN0" + "IHg9IjIiIHk9IjIiIHJ4PSIxIiByeT0iMSIgd2lkdGg9IjgiIGhlaWdodD0iOCIgZmlsbD0iYmxhY2siIC8+DQo8L3N2Zz4=";
  this.TMSFNCTOOLBARSQUARESVGWHITE = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiI+DQogIDxyZWN0" + "IHg9IjIiIHk9IjIiIHJ4PSIxIiByeT0iMSIgd2lkdGg9IjgiIGhlaWdodD0iOCIgZmlsbD0id2hpdGUiIC8+DQo8L3N2Zz4=";
  this.TMSFNCTOOLBARSTARFULLSVGBLACK = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8x" + "OTk5L3hsaW5rIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOnVybCgjTmV3X" + "1BhdHRlcm5fU3dhdGNoXzEwKTt9LmNscy0ye2ZpbGw6bm9uZTt9LmNscy0ze2ZpbGw6IzNhM2EzODt9LmNscy00e2ZpbGw6IzNhM2EzODt9LmNscy01e2" + "ZpbGw6dXJsKCNOZXdfUGF0dGVybl9Td2F0Y2hfMTAtNSk7fS5jbHMtNntjbGlwLXBhdGg6dXJsKCNjbGlwLXBhdGgpO30uY2xzLTd7ZmlsbDp1cmwoI05" + "ld19QYXR0ZXJuX1N3YXRjaF85KTt9LmNscy04e2NsaXAtcGF0aDp1cmwoI2NsaXAtcGF0aC0yKTt9PC9zdHlsZT48cGF0dGVybiBpZD0iTmV3X1BhdHRl" + "cm5fU3dhdGNoXzEwIiBkYXRhLW5hbWU9Ik5ldyBQYXR0ZXJuIFN3YXRjaCAxMCIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4IiBwYXR0ZXJuVW5pdHM9InVzZ" + "XJTcGFjZU9uVXNlIiB2aWV3Qm94PSIwIDAgNjggNjgiPjxyZWN0IGNsYXNzPSJjbHMtMiIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3" + "M9ImNscy0zIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48L3BhdHRlcm4+PHBhdHRlcm4gaWQ9Ik5ld19QYXR0ZXJuX1N3YXRjaF8xMC01IiBkYXRhLW5" + "hbWU9Ik5ldyBQYXR0ZXJuIFN3YXRjaCAxMCIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4IiBwYXR0ZXJuVW5pdHM9InVzZXJTcGFjZU9uVXNlIiB2aWV3Qm94" + "PSIwIDAgNjggNjgiPjxyZWN0IGNsYXNzPSJjbHMtMiIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9ImNscy0zIiB3aWR0aD0iNjgiI" + "GhlaWdodD0iNjgiLz48L3BhdHRlcm4+PGNsaXBQYXRoIGlkPSJjbGlwLXBhdGgiPjxwb2x5Z29uIGNsYXNzPSJjbHMtMSIgcG9pbnRzPSIxMiAyLjQ5ID" + "E0LjM2IDkuNSAyMiA5LjUgMTUuODIgMTQuNDQgMTguMzEgMjEuODggMTIgMTcuNTcgNS42OCAyMi4wMyA4LjE4IDE0LjQgMiA5LjUgOS42NCA5LjUgMTI" + "gMi40OSIvPjwvY2xpcFBhdGg+PHBhdHRlcm4gaWQ9Ik5ld19QYXR0ZXJuX1N3YXRjaF85IiBkYXRhLW5hbWU9Ik5ldyBQYXR0ZXJuIFN3YXRjaCA5IiB3" + "aWR0aD0iNjgiIGhlaWdodD0iNjgiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHZpZXdCb3g9IjAgMCA2OCA2OCI+PHJlY3QgY2xhc3M9ImNsc" + "y0yIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48cmVjdCBjbGFzcz0iY2xzLTQiIHdpZHRoPSI2OCIgaGVpZ2h0PSI2OCIvPjwvcGF0dGVybj48Y2xpcF" + "BhdGggaWQ9ImNsaXAtcGF0aC0yIj48cG9seWdvbiBjbGFzcz0iY2xzLTEiIHBvaW50cz0iLTIzIC0zLjg3IC0xOS45MyA1LjUgLTEwIDUuNSAtMTguMDM" + "gMTEuOTcgLTE0LjggMjEuODQgLTIzIDE2LjA2IC0zMS4yMiAyMiAtMjcuOTcgMTEuOTMgLTM2IDUuNSAtMjYuMDcgNS41IC0yMyAtMy44NyIvPjwvY2xp" + "cFBhdGg+PC9kZWZzPjx0aXRsZT5GYXZvdXJpdGUtMjwvdGl0bGU+PGcgaWQ9Ikljb24iPjxwb2x5Z29uIGNsYXNzPSJjbHMtNSIgcG9pbnRzPSIxMiAyL" + "jQ5IDE0LjM2IDkuNSAyMiA5LjUgMTUuODIgMTQuNDQgMTguMzEgMjEuODggMTIgMTcuNTcgNS42OCAyMi4wMyA4LjE4IDE0LjQgMiA5LjUgOS42NCA5Lj" + "UgMTIgMi40OSIvPjxnIGNsYXNzPSJjbHMtNiI+PHJlY3QgY2xhc3M9ImNscy01IiB4PSItMzgiIHk9Ii01NiIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8" + "+PHJlY3QgY2xhc3M9ImNscy01IiB4PSItMzgiIHk9Ii01NiIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9ImNscy01IiB4PSItMzgi" + "IHk9IjEyIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48cmVjdCBjbGFzcz0iY2xzLTUiIHg9Ii0zOCIgeT0iMTIiIHdpZHRoPSI2OCIgaGVpZ2h0PSI2O" + "CIvPjwvZz48cGF0aCBjbGFzcz0iY2xzLTciIGQ9Ik00LjczLDIzLjMxLDcuNiwxNC41OC41Nyw5SDkuMjhMMTIsLjkyLDE0LjcyLDloOC43MWwtNyw1Lj" + "YxLDIuODUsOC41MkwxMiwxOC4xOFpNMy40MywxMGw1LjMzLDQuMjNMNi42MywyMC43NSwxMiwxN2w1LjM2LDMuNjYtMi4xMi02LjM1TDIwLjU3LDEwSDE" + "0TDEyLDQuMDVsLTIsNloiLz48cG9seWdvbiBjbGFzcz0iY2xzLTUiIHBvaW50cz0iLTIzIC0zLjg3IC0xOS45MyA1LjUgLTEwIDUuNSAtMTguMDMgMTEu" + "OTcgLTE0LjggMjEuODQgLTIzIDE2LjA2IC0zMS4yMiAyMiAtMjcuOTcgMTEuOTMgLTM2IDUuNSAtMjYuMDcgNS41IC0yMyAtMy44NyIvPjxnIGNsYXNzP" + "SJjbHMtOCI+PHJlY3QgY2xhc3M9ImNscy01IiB4PSItMzgiIHk9Ii01NiIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9ImNscy01Ii" + "B4PSItMzgiIHk9Ii01NiIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9ImNscy01IiB4PSItMzgiIHk9IjEyIiB3aWR0aD0iNjgiIGh" + "laWdodD0iNjgiLz48cmVjdCBjbGFzcz0iY2xzLTUiIHg9Ii0zOCIgeT0iMTIiIHdpZHRoPSI2OCIgaGVpZ2h0PSI2OCIvPjwvZz48L2c+PC9zdmc+";
  this.TMSFNCTOOLBARSTARFULLSVGWHITE = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8x" + "OTk5L3hsaW5rIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOm5vbmU7fS5jb" + "HMtMntjbGlwLXBhdGg6dXJsKCNjbGlwLXBhdGgpO30uY2xzLTN7ZmlsbDojZmFmYWZhO30uY2xzLTR7Y2xpcC1wYXRoOnVybCgjY2xpcC1wYXRoLTIpO3" + "08L3N0eWxlPjxjbGlwUGF0aCBpZD0iY2xpcC1wYXRoIj48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik00LjczLDIzLjMxLDcuNiwxNC41OC41Nyw5SDkuMjh" + "MMTIsLjkyLDE0LjcyLDloOC43MWwtNyw1LjYxLDIuODUsOC41MkwxMiwxOC4xOFpNMy40MywxMGw1LjMzLDQuMjNMNi42MywyMC43NSwxMiwxN2w1LjM2" + "LDMuNjYtMi4xMi02LjM1TDIwLjU3LDEwSDE0TDEyLDQuMDVsLTIsNloiLz48L2NsaXBQYXRoPjxjbGlwUGF0aCBpZD0iY2xpcC1wYXRoLTIiPjxwYXRoI" + "GNsYXNzPSJjbHMtMSIgZD0iTS0zMi4xNiwyMy4zbDMuNjEtMTEuMTlMLTM3LjQyLDVoMTFMLTIzLTUuNDgtMTkuNTcsNWgxMWwtOC44Nyw3LjE0LDMuNi" + "wxMUwtMjMsMTYuNjdaTS0zNC41OCw2bDcuMiw1Ljc2LTIuODksOC45NEwtMjMsMTUuNDRsNy4yNiw1LjEyLTIuODgtOC43Niw3LjItNS44aC04Ljg3TC0" + "yMy0yLjI3LTI1LjcxLDZaIi8+PC9jbGlwUGF0aD48L2RlZnM+PHRpdGxlPkZhdm91cml0ZS0yPC90aXRsZT48ZyBpZD0iSWNvbiI+PGcgY2xhc3M9ImNs" + "cy0yIj48cmVjdCBjbGFzcz0iY2xzLTEiIHg9Ii0zOCIgeT0iLTgiIHdpZHRoPSI2OCIgaGVpZ2h0PSI2OCIvPjxyZWN0IGNsYXNzPSJjbHMtMyIgeD0iL" + "TM4IiB5PSItOCIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9ImNscy0xIiB4PSItMzgiIHk9Ii04IiB3aWR0aD0iNjgiIGhlaWdodD" + "0iNjgiLz48cmVjdCBjbGFzcz0iY2xzLTMiIHg9Ii0zOCIgeT0iLTgiIHdpZHRoPSI2OCIgaGVpZ2h0PSI2OCIvPjwvZz48ZyBjbGFzcz0iY2xzLTQiPjx" + "yZWN0IGNsYXNzPSJjbHMtMSIgeD0iLTM4IiB5PSItOCIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9ImNscy0zIiB4PSItMzgiIHk9" + "Ii04IiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48cmVjdCBjbGFzcz0iY2xzLTEiIHg9Ii0zOCIgeT0iLTgiIHdpZHRoPSI2OCIgaGVpZ2h0PSI2OCIvP" + "jxyZWN0IGNsYXNzPSJjbHMtMyIgeD0iLTM4IiB5PSItOCIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PC9nPjwvZz48L3N2Zz4=";
  this.TMSFNCTOOLBARTICKMARKSVG = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0i" + "MCAwIDE2IDE2Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzNhM2EzODt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPlRpY2s8L3RpdGxlPjxnIGlkPSJJY" + "29uIj48cG9seWdvbiBjbGFzcz0iY2xzLTEiIHBvaW50cz0iNS41IDEzLjI1IDEuMTIgOC44OCAxLjg4IDguMTIgNS41IDExLjc1IDE0LjEyIDMuMTIgMT" + "QuODggMy44OCA1LjUgMTMuMjUiLz48L2c+PC9zdmc+";
  this.TMSFNCTOOLBARTICKMARKSVGWHITE = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8x" + "OTk5L3hsaW5rIiB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOm5vbmU7fS5jb" + "HMtMntmaWxsOiNmYWZhZmE7fS5jbHMtM3tmaWxsOnVybCgjTmV3X1BhdHRlcm5fU3dhdGNoXzIpO308L3N0eWxlPjxwYXR0ZXJuIGlkPSJOZXdfUGF0dG" + "Vybl9Td2F0Y2hfMiIgZGF0YS1uYW1lPSJOZXcgUGF0dGVybiBTd2F0Y2ggMiIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4IiBwYXR0ZXJuVW5pdHM9InVzZXJ" + "TcGFjZU9uVXNlIiB2aWV3Qm94PSIwIDAgNjggNjgiPjxyZWN0IGNsYXNzPSJjbHMtMSIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9" + "ImNscy0yIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48L3BhdHRlcm4+PC9kZWZzPjx0aXRsZT5UaWNrPC90aXRsZT48ZyBpZD0iSWNvbiI+PHBvbHlnb" + "24gY2xhc3M9ImNscy0zIiBwb2ludHM9IjUuNSAxMy4yNSAxLjEyIDguODggMS44OCA4LjEyIDUuNSAxMS43NSAxNC4xMiAzLjEyIDE0Ljg4IDMuODggNS" + "41IDEzLjI1Ii8+PC9nPjwvc3ZnPg==";
  this.TMSFNCTOOLBARARROWSVG = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0i" + "MCAwIDI0IDI0Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzNhM2EzODt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPkFycm93LVJpZ2h0LUJsdWU8L3Rpd" + "GxlPjxnIGlkPSJJY29uIj48cG9seWdvbiBjbGFzcz0iY2xzLTEiIHBvaW50cz0iMjMuMTkgMTEuNSAxNC4yNSAyMC40NCAxMy4zNyAxOS41NiAyMS40Mi" + "AxMS41IDEzLjM3IDMuNDQgMTQuMjUgMi41NiAyMy4xOSAxMS41Ii8+PHJlY3QgY2xhc3M9ImNscy0xIiB4PSIyIiB5PSIxMSIgd2lkdGg9IjIwIiBoZWl" + "naHQ9IjEiLz48L2c+PC9zdmc+";
  this.TMSFNCTOOLBARARROWSVGWHITE = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8x" + "OTk5L3hsaW5rIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOm5vbmU7fS5jb" + "HMtMntmaWxsOiNmYWZhZmE7fS5jbHMtM3tmaWxsOnVybCgjTmV3X1BhdHRlcm5fU3dhdGNoXzIpO308L3N0eWxlPjxwYXR0ZXJuIGlkPSJOZXdfUGF0dG" + "Vybl9Td2F0Y2hfMiIgZGF0YS1uYW1lPSJOZXcgUGF0dGVybiBTd2F0Y2ggMiIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4IiBwYXR0ZXJuVW5pdHM9InVzZXJ" + "TcGFjZU9uVXNlIiB2aWV3Qm94PSIwIDAgNjggNjgiPjxyZWN0IGNsYXNzPSJjbHMtMSIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9" + "ImNscy0yIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48L3BhdHRlcm4+PC9kZWZzPjx0aXRsZT5BcnJvdy1SaWdodC1CbHVlPC90aXRsZT48ZyBpZD0iS" + "WNvbiI+PHBvbHlnb24gY2xhc3M9ImNscy0zIiBwb2ludHM9IjIzLjE5IDExLjUgMTQuMjUgMjAuNDQgMTMuMzcgMTkuNTYgMjEuNDIgMTEuNSAxMy4zNy" + "AzLjQ0IDE0LjI1IDIuNTYgMjMuMTkgMTEuNSIvPjxyZWN0IGNsYXNzPSJjbHMtMyIgeD0iMiIgeT0iMTEiIHdpZHRoPSIyMCIgaGVpZ2h0PSIxIi8+PC9" + "nPjwvc3ZnPg==";
  this.TMSFNCTOOLBAROPENSVG = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3Lncz" + "Lm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGRlZnM+PHN0eWxlPi5jbHMtMXt" + "maWxsOm5vbmU7fS5jbHMtMntmaWxsOiNmYWZhZmE7fS5jbHMtM3tmaWxsOiNmOTk4NDY7fS5jbHMtNHtmaWxsOnVybCgjTmV3X1BhdHRlcm" + "5fU3dhdGNoXzIpO30uY2xzLTV7ZmlsbDp1cmwoI05ld19QYXR0ZXJuX1N3YXRjaF85KTt9LmNscy02e2ZpbGw6IzFlOGJjZDt9PC9zdHlsZT" + "48cGF0dGVybiBpZD0iTmV3X1BhdHRlcm5fU3dhdGNoXzIiIGRhdGEtbmFtZT0iTmV3IFBhdHRlcm4gU3dhdGNoIDIiIHdpZHRoPSI2OCIgaG" + "VpZ2h0PSI2OCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgdmlld0JveD0iMCAwIDY4IDY4Ij48cmVjdCBjbGFzcz0iY2xzLTEiIH" + "dpZHRoPSI2OCIgaGVpZ2h0PSI2OCIvPjxyZWN0IGNsYXNzPSJjbHMtMiIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PC9wYXR0ZXJuPjxwYX" + "R0ZXJuIGlkPSJOZXdfUGF0dGVybl9Td2F0Y2hfOSIgZGF0YS1uYW1lPSJOZXcgUGF0dGVybiBTd2F0Y2ggOSIgd2lkdGg9IjY4IiBoZWlnaH" + "Q9IjY4IiBwYXR0ZXJuVW5pdHM9InVzZXJTcGFjZU9uVXNlIiB2aWV3Qm94PSIwIDAgNjggNjgiPjxyZWN0IGNsYXNzPSJjbHMtMSIgd2lkdG" + "g9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9ImNscy0zIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48L3BhdHRlcm4+PC9kZWZzPj" + "x0aXRsZT5PcGVuPC90aXRsZT48ZyBpZD0iSWNvbiI+PHBvbHlnb24gY2xhc3M9ImNscy0xIiBwb2ludHM9IjIgMTkuNDMgOCAxMCAyIDE5Lj" + "QzIDIgMTkuNDMiLz48cGF0aCBjbGFzcz0iY2xzLTQiIGQ9Ik0xMS41OSw4bC0uMy0uMjlMOC41OSw1SDJWMTkuNDNMOCwxMGg0VjguNUE0Lj" + "A3LDQuMDcsMCwwLDEsMTIsOGgtLjQ0WiIvPjxwb2x5Z29uIGNsYXNzPSJjbHMtNCIgcG9pbnRzPSIyLjgyIDIwIDE2LjQ1IDIwIDIwLjkxID" + "EzIDE3IDEzIDE3IDExIDEyIDExIDguNTUgMTEgMi44MiAyMCIvPjxwYXRoIGNsYXNzPSJjbHMtNCIgZD0iTTguNzksNC41SDEuNVYyMC4yMW" + "wuNS0uNzhWNUg4LjU5bDIuNywyLjcxLjMuMjlIMTJhNCw0LDAsMCwxLC4wNy0uNWgtLjMxWiIvPjxwb2x5Z29uIGNsYXNzPSJjbHMtNCIgcG" + "9pbnRzPSIxLjkxIDIwLjUgMTYuNzMgMjAuNSAyMS41IDEzIDIwLjkxIDEzIDE2LjQ1IDIwIDIuODIgMjAgOC41NSAxMSAxMiAxMSAxMiAxMC" + "41IDguMjcgMTAuNSAxLjkxIDIwLjUiLz48cGF0aCBjbGFzcz0iY2xzLTUiIGQ9Ik0yMC45MSwxM2wtNC40Niw3SDIuODJsNS43My05SDEyVj" + "EwSDhMMiwxOS40M1Y1SDguNTlsMi43LDIuNzEuMy4yOUgxMmE0LDQsMCwwLDEsLjA3LS41YzAtLjE3LjA3LS4zNC4xMS0uNUgxMkw5LDRIMV" + "YyMUgxN2w1LjA5LThIMjAuOTFaIi8+PHBvbHlnb24gY2xhc3M9ImNscy02IiBwb2ludHM9IjE5IDEwIDE5IDExIDI0IDExIDI0IDYgMjMgNi" + "AyMyAxMCAxOSAxMCIvPjxwYXRoIGNsYXNzPSJjbHMtNiIgZD0iTTIzLjE1LDEwLjg1LDE5LjM3LDcuMDlBMi44NCwyLjg0LDAsMCwwLDE3Lj" + "UsNiwyLjUsMi41LDAsMCwwLDE1LDguNVY5SDE0VjguNUEzLjUsMy41LDAsMCwxLDE3LjUsNWEzLjcyLDMuNzIsMCwwLDEsMi41NywxLjM4bC" + "4yNy4yNSwzLjUxLDMuNTJaIi8+PC9nPjwvc3ZnPg==";
  this.TMSFNCTOOLBAROPENSVGWHITE = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3Lncz" + "Lm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGRlZnM+PHN0eWxlPi5jbHMtMXt" + "maWxsOm5vbmU7fS5jbHMtMntmaWxsOiNmYWZhZmE7fS5jbHMtM3tmaWxsOnVybCgjTmV3X1BhdHRlcm5fU3dhdGNoXzIpO308L3N0eWxlPj" + "xwYXR0ZXJuIGlkPSJOZXdfUGF0dGVybl9Td2F0Y2hfMiIgZGF0YS1uYW1lPSJOZXcgUGF0dGVybiBTd2F0Y2ggMiIgd2lkdGg9IjY4IiBoZ" + "WlnaHQ9IjY4IiBwYXR0ZXJuVW5pdHM9InVzZXJTcGFjZU9uVXNlIiB2aWV3Qm94PSIwIDAgNjggNjgiPjxyZWN0IGNsYXNzPSJjbHMtMSIg" + "d2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9ImNscy0yIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48L3BhdHRlcm4+PC9" + "kZWZzPjx0aXRsZT5PcGVuPC90aXRsZT48ZyBpZD0iSWNvbiI+PHBhdGggY2xhc3M9ImNscy0zIiBkPSJNMSwyMUgxN2w1LjA5LThIMjAuOT" + "FsLTQuNDYsN0gyLjgybDUuNzMtOUgxMlYxMEg4TDIsMTkuNDNWNUg4LjU5bDIuNywyLjcxLjMuMjlIMTJhNS41MSw1LjUxLDAsMCwxLC4xO" + "C0xSDEyTDksNEgxWiIvPjxwb2x5Z29uIGNsYXNzPSJjbHMtMyIgcG9pbnRzPSIxOSAxMCAxOSAxMSAyNCAxMSAyNCA2IDIzIDYgMjMgMTAg" + "MTkgMTAiLz48cGF0aCBjbGFzcz0iY2xzLTMiIGQ9Ik0yMy4xNSwxMC44NSwxOS4zNyw3LjA5QTIuODQsMi44NCwwLDAsMCwxNy41LDYsMi4" + "1LDIuNSwwLDAsMCwxNSw4LjVWOUgxNFY4LjVBMy41LDMuNSwwLDAsMSwxNy41LDVhMy43MiwzLjcyLDAsMCwxLDIuNTcsMS4zOGwuMjcuMj" + "UsMy41MSwzLjUyWiIvPjwvZz48L3N2Zz4=";
  this.TMSFNCTOOLBARSAVESVG = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOT" + "k5L3hsaW5rIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOm5vbmU7fS5jbHMtMntmaWxsOiNmYWZhZmE7fS5jbHMt" + "M3tmaWxsOiNhNzRhYjA7fS5jbHMtNHtmaWxsOnVybCgjTmV3X1BhdHRlcm5fU3dhdGNoXzIpO30uY2xzLTV7ZmlsbDp1cmwoI05ld19QYXR0ZXJuX1N3YXRjaF83KTt9PC9zdHlsZT48cGF0dG" + "VybiBpZD0iTmV3X1BhdHRlcm5fU3dhdGNoXzIiIGRhdGEtbmFtZT0iTmV3IFBhdHRlcm4gU3dhdGNoIDIiIHdpZHRoPSI2OCIgaGVpZ2h0PSI2OCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VP" + "blVzZSIgdmlld0JveD0iMCAwIDY4IDY4Ij48cmVjdCBjbGFzcz0iY2xzLTEiIHdpZHRoPSI2OCIgaGVpZ2h0PSI2OCIvPjxyZWN0IGNsYXNzPSJjbHMtMiIgd2lkdGg9IjY4IiBoZWlnaHQ9Ij" + "Y4Ii8+PC9wYXR0ZXJuPjxwYXR0ZXJuIGlkPSJOZXdfUGF0dGVybl9Td2F0Y2hfNyIgZGF0YS1uYW1lPSJOZXcgUGF0dGVybiBTd2F0Y2ggNyIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4IiBwYXR0" + "ZXJuVW5pdHM9InVzZXJTcGFjZU9uVXNlIiB2aWV3Qm94PSIwIDAgNjggNjgiPjxyZWN0IGNsYXNzPSJjbHMtMSIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9ImNscy0zIi" + "B3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48L3BhdHRlcm4+PC9kZWZzPjx0aXRsZT5TYXZlPC90aXRsZT48ZyBpZD0iSWNvbiI+PHJlY3QgY2xhc3M9ImNscy00IiB4PSIyIiB5PSIyIiB3aWR0" + "aD0iMTkiIGhlaWdodD0iMTkiLz48cGF0aCBjbGFzcz0iY2xzLTUiIGQ9Ik0yMSwzVjIxSDRMMywyMFYzSDIxbTEtMUgyVjIxbDEsMUgyMlYyWiIvPjxwYXRoIGNsYXNzPSJjbHMtNSIgZD0iTT" + "E4LDJWMTJINlYySDE4bTEsMEg1VjEzSDE5VjJaIi8+PHBhdGggY2xhc3M9ImNscy01IiBkPSJNMTYsMTZ2NUg2VjE2bTExLTFINXY3SDE3VjE1WiIvPjxwYXRoIGNsYXNzPSJjbHMtNSIgZD0i" + "TTEwLDE4djNIOFYxOG0xLjY2LTFIN3Y1aDRWMTdaIi8+PC9nPjwvc3ZnPg==";
  this.TMSFNCTOOLBARSAVESVGWHITE = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZ" + "y8xOTk5L3hsaW5rIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOm5vbmU7fS5jbHMtMntmaWxsOiNmYWZhZmE7fS5" + "jbHMtM3tmaWxsOnVybCgjTmV3X1BhdHRlcm5fU3dhdGNoXzIpO308L3N0eWxlPjxwYXR0ZXJuIGlkPSJOZXdfUGF0dGVybl9Td2F0Y2hfMiIgZGF0YS1uYW1lPSJOZXcgUGF0dGVybiBTd2F0Y" + "2ggMiIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4IiBwYXR0ZXJuVW5pdHM9InVzZXJTcGFjZU9uVXNlIiB2aWV3Qm94PSIwIDAgNjggNjgiPjxyZWN0IGNsYXNzPSJjbHMtMSIgd2lkdGg9IjY4IiB" + "oZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9ImNscy0yIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48L3BhdHRlcm4+PC9kZWZzPjx0aXRsZT5TYXZlPC90aXRsZT48ZyBpZD0iSWNvbiI+PHBhd" + "GggY2xhc3M9ImNscy0zIiBkPSJNMjEsM1YyMUg0TDMsMjBWM0gyMW0xLTFIMlYyMWwxLDFIMjJWMloiLz48cGF0aCBjbGFzcz0iY2xzLTMiIGQ9Ik0xOCwyVjEySDZWMkgxOG0xLDBINVYxM0g" + "xOVYyWiIvPjxwYXRoIGNsYXNzPSJjbHMtMyIgZD0iTTE2LDE2djVINlYxNm0xMS0xSDV2N0gxN1YxNVoiLz48cGF0aCBjbGFzcz0iY2xzLTMiIGQ9Ik0xMCwxOHYzSDhWMThtMS42Ni0xSDd2N" + "Wg0VjE3WiIvPjwvZz48L3N2Zz4=";
  this.TMSFNCTOOLBARCOPYSVG = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOT" + "k5L3hsaW5rIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOm5vbmU7fS5jbHMtMntmaWxsOiM3OTc3NzQ7fS5jbHMt" + "M3tmaWxsOiMzYTNhMzg7fS5jbHMtNHtmaWxsOiNmZmY7fS5jbHMtNXtmaWxsOnVybCgjTmV3X1BhdHRlcm5fU3dhdGNoXzEpO308L3N0eWxlPjxwYXR0ZXJuIGlkPSJOZXdfUGF0dGVybl9Td2" + "F0Y2hfMSIgZGF0YS1uYW1lPSJOZXcgUGF0dGVybiBTd2F0Y2ggMSIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4IiBwYXR0ZXJuVW5pdHM9InVzZXJTcGFjZU9uVXNlIiB2aWV3Qm94PSIwIDAgNjgg" + "NjgiPjxyZWN0IGNsYXNzPSJjbHMtMSIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9ImNscy0yIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48L3BhdHRlcm4+PC9kZWZzPj" + "x0aXRsZT5Db3B5PC90aXRsZT48ZyBpZD0iSWNvbiI+PHBvbHlnb24gY2xhc3M9ImNscy0zIiBwb2ludHM9IjkgMTggMSAxOCAxIDEgMTQgMSAxNCA1IDkgNSA5IDE4Ii8+PHBvbHlnb24gY2xh" + "c3M9ImNscy00IiBwb2ludHM9IjkgNSA5IDE3IDIgMTcgMiAyIDEzIDIgMTMgNSA5IDUiLz48cmVjdCBjbGFzcz0iY2xzLTUiIHg9IjMiIHk9IjUiIHdpZHRoPSI2IiBoZWlnaHQ9IjEiLz48cm" + "VjdCBjbGFzcz0iY2xzLTUiIHg9IjMiIHk9IjkiIHdpZHRoPSI2IiBoZWlnaHQ9IjEiLz48cmVjdCBjbGFzcz0iY2xzLTUiIHg9IjMiIHk9IjEzIiB3aWR0aD0iNiIgaGVpZ2h0PSIxIi8+PHJl" + "Y3QgY2xhc3M9ImNscy0zIiB4PSIxMCIgeT0iNiIgd2lkdGg9IjEzIiBoZWlnaHQ9IjE3Ii8+PHJlY3QgY2xhc3M9ImNscy00IiB4PSIxMSIgeT0iNyIgd2lkdGg9IjExIiBoZWlnaHQ9IjE1Ii" + "8+PHJlY3QgY2xhc3M9ImNscy01IiB4PSIxMiIgeT0iMTAiIHdpZHRoPSI5IiBoZWlnaHQ9IjEiLz48cmVjdCBjbGFzcz0iY2xzLTUiIHg9IjEyIiB5PSIxNCIgd2lkdGg9IjkiIGhlaWdodD0i" + "MSIvPjxyZWN0IGNsYXNzPSJjbHMtNSIgeD0iMTIiIHk9IjE4IiB3aWR0aD0iOSIgaGVpZ2h0PSIxIi8+PC9nPjwvc3ZnPg==";
  this.TMSFNCTOOLBARCOPYSVGWHITE = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZ" + "y8xOTk5L3hsaW5rIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOm5vbmU7fS5jbHMtMntmaWxsOiNmYWZhZmE7fS5" + "jbHMtM3tmaWxsOnVybCgjTmV3X1BhdHRlcm5fU3dhdGNoXzIpO308L3N0eWxlPjxwYXR0ZXJuIGlkPSJOZXdfUGF0dGVybl9Td2F0Y2hfMiIgZGF0YS1uYW1lPSJOZXcgUGF0dGVybiBTd2F0Y" + "2ggMiIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4IiBwYXR0ZXJuVW5pdHM9InVzZXJTcGFjZU9uVXNlIiB2aWV3Qm94PSIwIDAgNjggNjgiPjxyZWN0IGNsYXNzPSJjbHMtMSIgd2lkdGg9IjY4IiB" + "oZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9ImNscy0yIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48L3BhdHRlcm4+PC9kZWZzPjx0aXRsZT5Db3B5PC90aXRsZT48ZyBpZD0iSWNvbiI+PHBvb" + "Hlnb24gY2xhc3M9ImNscy0zIiBwb2ludHM9IjEgMSAxIDE4IDkgMTggOSAxNyAyIDE3IDIgMiAxMyAyIDEzIDUgMTQgNSAxNCAxIDEgMSIvPjxyZWN0IGNsYXNzPSJjbHMtMyIgeD0iMyIgeT0" + "iNSIgd2lkdGg9IjYiIGhlaWdodD0iMSIvPjxyZWN0IGNsYXNzPSJjbHMtMyIgeD0iMyIgeT0iOSIgd2lkdGg9IjYiIGhlaWdodD0iMSIvPjxyZWN0IGNsYXNzPSJjbHMtMyIgeD0iMyIgeT0iM" + "TMiIHdpZHRoPSI2IiBoZWlnaHQ9IjEiLz48cGF0aCBjbGFzcz0iY2xzLTMiIGQ9Ik0xMCw2VjIzSDIzVjZaTTIyLDIySDExVjdIMjJaIi8+PHJlY3QgY2xhc3M9ImNscy0zIiB4PSIxMiIgeT0" + "iMTAiIHdpZHRoPSI5IiBoZWlnaHQ9IjEiLz48cmVjdCBjbGFzcz0iY2xzLTMiIHg9IjEyIiB5PSIxNCIgd2lkdGg9IjkiIGhlaWdodD0iMSIvPjxyZWN0IGNsYXNzPSJjbHMtMyIgeD0iMTIiI" + "Hk9IjE4IiB3aWR0aD0iOSIgaGVpZ2h0PSIxIi8+PC9nPjwvc3ZnPg==";
  this.TMSFNCTOOLBARPASTESVG = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjQiIGhl" + "aWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOm5vbmU7fS5jbHMtMntmaWxsOiM3OTc3NzQ7fS5jbHMtM3tmaWxsOiNmN2RhOTQ7fS5jbHMtNHtmaWxsO" + "iNmYWZhZmE7fS5jbHMtNXtmaWxsOiNmOTk4NDY7fS5jbHMtNntjbGlwLXBhdGg6dXJsKCNjbGlwLXBhdGgpO30uY2xzLTd7ZmlsbDojM2EzYTM4O30uY2xzLTh7ZmlsbDp1cmwoI05ld19QYXR0ZXJuX1" + "N3YXRjaF8xKTt9LmNscy05e2ZpbGw6dXJsKCNOZXdfUGF0dGVybl9Td2F0Y2hfOSk7fS5jbHMtMTB7ZmlsbDp1cmwoI05ld19QYXR0ZXJuX1N3YXRjaF8xMCk7fS5jbHMtMTF7ZmlsbDp1cmwoI05ld19" + "QYXR0ZXJuX1N3YXRjaF8yKTt9LmNscy0xMntjbGlwLXBhdGg6dXJsKCNjbGlwLXBhdGgtMik7fS5jbHMtMTN7Y2xpcC1wYXRoOnVybCgjY2xpcC1wYXRoLTMpO30uY2xzLTE0e2NsaXAtcGF0aDp1cmwo" + "I2NsaXAtcGF0aC00KTt9PC9zdHlsZT48Y2xpcFBhdGggaWQ9ImNsaXAtcGF0aCI+PHJlY3QgY2xhc3M9ImNscy0xIiB4PSIxMiIgeT0iMTAiIHdpZHRoPSIxMCIgaGVpZ2h0PSIxMyIvPjwvY2xpcFBhd" + "Gg+PHBhdHRlcm4gaWQ9Ik5ld19QYXR0ZXJuX1N3YXRjaF8xIiBkYXRhLW5hbWU9Ik5ldyBQYXR0ZXJuIFN3YXRjaCAxIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiIHBhdHRlcm5Vbml0cz0idXNlclNwYW" + "NlT25Vc2UiIHZpZXdCb3g9IjAgMCA2OCA2OCI+PHJlY3QgY2xhc3M9ImNscy0xIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48cmVjdCBjbGFzcz0iY2xzLTIiIHdpZHRoPSI2OCIgaGVpZ2h0PSI2OCI" + "vPjwvcGF0dGVybj48cGF0dGVybiBpZD0iTmV3X1BhdHRlcm5fU3dhdGNoXzkiIGRhdGEtbmFtZT0iTmV3IFBhdHRlcm4gU3dhdGNoIDkiIHdpZHRoPSI2OCIgaGVpZ2h0PSI2OCIgcGF0dGVyblVuaXRz" + "PSJ1c2VyU3BhY2VPblVzZSIgdmlld0JveD0iMCAwIDY4IDY4Ij48cmVjdCBjbGFzcz0iY2xzLTEiIHdpZHRoPSI2OCIgaGVpZ2h0PSI2OCIvPjxyZWN0IGNsYXNzPSJjbHMtNSIgd2lkdGg9IjY4IiBoZ" + "WlnaHQ9IjY4Ii8+PC9wYXR0ZXJuPjxwYXR0ZXJuIGlkPSJOZXdfUGF0dGVybl9Td2F0Y2hfMTAiIGRhdGEtbmFtZT0iTmV3IFBhdHRlcm4gU3dhdGNoIDEwIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiIH" + "BhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHZpZXdCb3g9IjAgMCA2OCA2OCI+PHJlY3QgY2xhc3M9ImNscy0xIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48cmVjdCBjbGFzcz0iY2xzLTMiIHd" + "pZHRoPSI2OCIgaGVpZ2h0PSI2OCIvPjwvcGF0dGVybj48cGF0dGVybiBpZD0iTmV3X1BhdHRlcm5fU3dhdGNoXzIiIGRhdGEtbmFtZT0iTmV3IFBhdHRlcm4gU3dhdGNoIDIiIHdpZHRoPSI2OCIgaGVp" + "Z2h0PSI2OCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgdmlld0JveD0iMCAwIDY4IDY4Ij48cmVjdCBjbGFzcz0iY2xzLTEiIHdpZHRoPSI2OCIgaGVpZ2h0PSI2OCIvPjxyZWN0IGNsYXNzP" + "SJjbHMtNCIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PC9wYXR0ZXJuPjxjbGlwUGF0aCBpZD0iY2xpcC1wYXRoLTIiPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTEyLDRhMi4xOSwyLjE5LDAsMCwwLT" + "ItMS45MUEyLjE5LDIuMTksMCwwLDAsOCw0SDZWN2g4VjRaIi8+PC9jbGlwUGF0aD48Y2xpcFBhdGggaWQ9ImNsaXAtcGF0aC0zIj48cmVjdCBjbGFzcz0iY2xzLTEiIHg9Ii0yMyIgeT0iNSIgd2lkdGg" + "9IjEzIiBoZWlnaHQ9IjE4Ii8+PC9jbGlwUGF0aD48Y2xpcFBhdGggaWQ9ImNsaXAtcGF0aC00Ij48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik0tMjIuNS0yQTIuNywyLjcsMCwwLDAtMjUtNGEyLjcsMi43" + "LDAsMCwwLTIuNSwySC0zMFYyaDEwVi0yWiIvPjwvY2xpcFBhdGg+PC9kZWZzPjx0aXRsZT5QYXN0ZTwvdGl0bGU+PGcgaWQ9Ikljb24iPjxnIGNsYXNzPSJjbHMtNiI+PHJlY3QgY2xhc3M9ImNscy0xI" + "iB4PSItMzgiIHk9Ii01NiIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9ImNscy00IiB4PSItMzgiIHk9Ii01NiIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9Im" + "Nscy0xIiB4PSItMzgiIHk9IjEyIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48cmVjdCBjbGFzcz0iY2xzLTQiIHg9Ii0zOCIgeT0iMTIiIHdpZHRoPSI2OCIgaGVpZ2h0PSI2OCIvPjwvZz48cGF0aCB" + "jbGFzcz0iY2xzLTciIGQ9Ik0yMiwyM0gxMVY5SDIyWk0xMiwyMmg5VjEwSDEyWiIvPjxyZWN0IGNsYXNzPSJjbHMtOCIgeD0iMTMiIHk9IjEzIiB3aWR0aD0iNyIgaGVpZ2h0PSIxIi8+PHJlY3QgY2xh" + "c3M9ImNscy04IiB4PSIxMyIgeT0iMTUiIHdpZHRoPSI3IiBoZWlnaHQ9IjEiLz48cmVjdCBjbGFzcz0iY2xzLTgiIHg9IjEzIiB5PSIxNyIgd2lkdGg9IjciIGhlaWdodD0iMSIvPjxyZWN0IGNsYXNzP" + "SJjbHMtOCIgeD0iMTMiIHk9IjE5IiB3aWR0aD0iNyIgaGVpZ2h0PSIxIi8+PHBvbHlnb24gY2xhc3M9ImNscy05IiBwb2ludHM9IjEwIDggMTAgMjEgMSAyMSAxIDQgMTggNCAxOCA4IDEwIDgiLz48cG" + "9seWdvbiBjbGFzcz0iY2xzLTEwIiBwb2ludHM9IjEwIDggMTAgMjAgMiAyMCAyIDUgMTcgNSAxNyA4IDEwIDgiLz48cG9seWdvbiBjbGFzcz0iY2xzLTExIiBwb2ludHM9IjEwIDggMTAgMTkgMyAxOSA" + "zIDYgMTYgNiAxNiA4IDEwIDgiLz48ZyBjbGFzcz0iY2xzLTEyIj48cmVjdCBjbGFzcz0iY2xzLTEiIHg9Ii0zOCIgeT0iLTU2IiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48cmVjdCBjbGFzcz0iY2xz" + "LTQiIHg9Ii0zOCIgeT0iLTU2IiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48L2c+PHBhdGggY2xhc3M9ImNscy04IiBkPSJNMTQsN0g1VjNINy4xNEEyLjYsMi42LDAsMCwxLDkuNSwxLjA5LDIuNiwyL" + "jYsMCwwLDEsMTEuODYsM0gxNFpNNiw2aDdWNEgxMUwxMSwzLjU4QTEuNjgsMS42OCwwLDAsMCw5LjUsMi4wOSwxLjY4LDEuNjgsMCwwLDAsOCwzLjU4TDgsNEg2WiIvPjxnIGNsYXNzPSJjbHMtMTMiPj" + "xyZWN0IGNsYXNzPSJjbHMtMSIgeD0iLTM4IiB5PSItNTYiIHdpZHRoPSI2OCIgaGVpZ2h0PSI2OCIvPjxyZWN0IGNsYXNzPSJjbHMtNCIgeD0iLTM4IiB5PSItNTYiIHdpZHRoPSI2OCIgaGVpZ2h0PSI" + "2OCIvPjxyZWN0IGNsYXNzPSJjbHMtMSIgeD0iLTM4IiB5PSIxMiIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9ImNscy00IiB4PSItMzgiIHk9IjEyIiB3aWR0aD0iNjgiIGhlaWdo" + "dD0iNjgiLz48L2c+PGcgY2xhc3M9ImNscy0xNCI+PHJlY3QgY2xhc3M9ImNscy0xIiB4PSItMzgiIHk9Ii01NiIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9ImNscy00IiB4PSItM" + "zgiIHk9Ii01NiIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PC9nPjwvZz48L3N2Zz4=";
  this.TMSFNCTOOLBARPASTESVGWHITE = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm" + "9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOm5" + "vbmU7fS5jbHMtMntmaWxsOiNmYWZhZmE7fS5jbHMtM3tmaWxsOnVybCgjTmV3X1BhdHRlcm5fU3dhdGNoXzIpO308L3N0eWxlPjxwYXR0ZXJuIGlk" + "PSJOZXdfUGF0dGVybl9Td2F0Y2hfMiIgZGF0YS1uYW1lPSJOZXcgUGF0dGVybiBTd2F0Y2ggMiIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4IiBwYXR0Z" + "XJuVW5pdHM9InVzZXJTcGFjZU9uVXNlIiB2aWV3Qm94PSIwIDAgNjggNjgiPjxyZWN0IGNsYXNzPSJjbHMtMSIgd2lkdGg9IjY4IiBoZWlnaHQ9Ij" + "Y4Ii8+PHJlY3QgY2xhc3M9ImNscy0yIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48L3BhdHRlcm4+PC9kZWZzPjx0aXRsZT5QYXN0ZTwvdGl0bGU" + "+PGcgaWQ9Ikljb24iPjxwYXRoIGNsYXNzPSJjbHMtMyIgZD0iTTIyLDIzSDExVjlIMjJaTTEyLDIyaDlWMTBIMTJaIi8+PHJlY3QgY2xhc3M9ImNs" + "cy0zIiB4PSIxMyIgeT0iMTMiIHdpZHRoPSI3IiBoZWlnaHQ9IjEiLz48cmVjdCBjbGFzcz0iY2xzLTMiIHg9IjEzIiB5PSIxNSIgd2lkdGg9IjciI" + "GhlaWdodD0iMSIvPjxyZWN0IGNsYXNzPSJjbHMtMyIgeD0iMTMiIHk9IjE3IiB3aWR0aD0iNyIgaGVpZ2h0PSIxIi8+PHJlY3QgY2xhc3M9ImNscy" + "0zIiB4PSIxMyIgeT0iMTkiIHdpZHRoPSI3IiBoZWlnaHQ9IjEiLz48cG9seWdvbiBjbGFzcz0iY2xzLTMiIHBvaW50cz0iMSA0IDEgMjEgMTAgMjE" + "gMTAgMjAgMiAyMCAyIDUgNiA1IDYgNCAxIDQiLz48cG9seWdvbiBjbGFzcz0iY2xzLTMiIHBvaW50cz0iMTMgNCAxMyA1IDE3IDUgMTcgOCAxOCA4" + "IDE4IDQgMTMgNCIvPjxwYXRoIGNsYXNzPSJjbHMtMyIgZD0iTTE0LDdINVYzSDcuMTRBMi42LDIuNiwwLDAsMSw5LjUsMS4wOSwyLjYsMi42LDAsM" + "CwxLDExLjg2LDNIMTRaTTYsNmg3VjRIMTFMMTEsMy41OEExLjY4LDEuNjgsMCwwLDAsOS41LDIuMDksMS42OCwxLjY4LDAsMCwwLDgsMy41OEw4LD" + "RINloiLz48L2c+PC9zdmc+";
  this.TMSFNCTOOLBARCUTSVG = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy" + "8xOTk5L3hsaW5rIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOm5vbmU7fS" + "5jbHMtMntmaWxsOiNmYWZhZmE7fS5jbHMtM3tmaWxsOiNmOTk4NDY7fS5jbHMtNHtmaWxsOnVybCgjTmV3X1BhdHRlcm5fU3dhdGNoXzkpO30uY2xzLT" + "V7ZmlsbDp1cmwoI05ld19QYXR0ZXJuX1N3YXRjaF8yKTt9LmNscy02e2ZpbGw6IzNhM2EzODt9LmNscy03e2ZpbGw6IzBlNjVhZjt9PC9zdHlsZT48cG" + "F0dGVybiBpZD0iTmV3X1BhdHRlcm5fU3dhdGNoXzkiIGRhdGEtbmFtZT0iTmV3IFBhdHRlcm4gU3dhdGNoIDkiIHdpZHRoPSI2OCIgaGVpZ2h0PSI2OC" + "IgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgdmlld0JveD0iMCAwIDY4IDY4Ij48cmVjdCBjbGFzcz0iY2xzLTEiIHdpZHRoPSI2OCIgaGVpZ2" + "h0PSI2OCIvPjxyZWN0IGNsYXNzPSJjbHMtMyIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PC9wYXR0ZXJuPjxwYXR0ZXJuIGlkPSJOZXdfUGF0dGVybl" + "9Td2F0Y2hfMiIgZGF0YS1uYW1lPSJOZXcgUGF0dGVybiBTd2F0Y2ggMiIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4IiBwYXR0ZXJuVW5pdHM9InVzZXJTcG" + "FjZU9uVXNlIiB2aWV3Qm94PSIwIDAgNjggNjgiPjxyZWN0IGNsYXNzPSJjbHMtMSIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9Im" + "Nscy0yIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48L3BhdHRlcm4+PC9kZWZzPjx0aXRsZT5DdXQ8L3RpdGxlPjxnIGlkPSJJY29uIj48cGF0aCBjbG" + "Fzcz0iY2xzLTQiIGQ9Ik04LjUyLDE2aC4wN2MyLjg3LTIuNzksNy4wOC02LjkzLDcuNjMtNy42M0ExMi41OSwxMi41OSwwLDAsMCwxOCwzLjA2TDcuMz" + "ksMTQuOTRaIi8+PHBhdGggY2xhc3M9ImNscy00IiBkPSJNOC41MiwxNmguMDdjMi44Ny0yLjc5LDcuMDgtNi45Myw3LjYzLTcuNjNBMTIuNTksMTIuNT" + "ksMCwwLDAsMTgsMy4wNkw3LjM5LDE0Ljk0WiIvPjxwYXRoIGNsYXNzPSJjbHMtNSIgZD0iTTguNTIsMTZoLjA3YzIuODctMi43OSw3LjA4LTYuOTMsNy" + "42My03LjYzQTEyLjU5LDEyLjU5LDAsMCwwLDE4LDMuMDZMNy4zOSwxNC45NFoiLz48cGF0aCBjbGFzcz0iY2xzLTYiIGQ9Ik02LDE1bDIuMTMsMkg5cz" + "cuMTgtNyw4LThhMTMuMzYsMTMuMzYsMCwwLDAsMi02LDQuNTgsNC41OCwwLDAsMC0uNS0yWk0xNi42MSw4LjY5Yy0uNjIuNzctNS4zLDUuMzYtNy44MS" + "w3LjgxSDguMzJMNi43LDE1bDExLjY0LTEzQTQuMTYsNC4xNiwwLDAsMSwxOC41LDMsMTMuMDksMTMuMDksMCwwLDEsMTYuNjEsOC42OVoiLz48cGF0aC" + "BjbGFzcz0iY2xzLTYiIGQ9Ik02LjcsMTUsOC4zMiwxNi41SDguOGMyLjUxLTIuNDUsNy4xOS03LDcuODEtNy44MUExMy4wOSwxMy4wOSwwLDAsMCwxOC" + "41LDNhNC4xNiw0LjE2LDAsMCwwLS4xNi0xLjA3Wm05LjUyLTYuNmMtLjU1LjctNC43Niw0Ljg0LTcuNjMsNy42M0g4LjUyTDcuMzksMTQuOTQsMTgsMy" + "4wNkExMi41OSwxMi41OSwwLDAsMSwxNi4yMiw4LjM3WiIvPjxwYXRoIGNsYXNzPSJjbHMtNSIgZD0iTTE0LjQxLDE2aC4xMkwxNS42MSwxNSw1LDMuMD" + "ZBMTIuNTksMTIuNTksMCwwLDAsNi43OCw4LjM3QzcuMzMsOS4wNywxMS41NCwxMy4yMSwxNC40MSwxNloiLz48cGF0aCBjbGFzcz0iY2xzLTYiIGQ9Ik" + "00LDNBMTMuMzYsMTMuMzYsMCwwLDAsNiw5Yy44MiwxLDgsOCw4LDhoLjk0TDE3LDE1LDQuNSwxQTQuNTgsNC41OCwwLDAsMCw0LDNaTTE1LjYxLDE1LD" + "E0LjUzLDE2aC0uMTJjLTIuODctMi43OS03LjA4LTYuOTMtNy42My03LjYzQTEyLjU5LDEyLjU5LDAsMCwxLDUsMy4wNloiLz48cGF0aCBjbGFzcz0iY2" + "xzLTciIGQ9Ik0xMCwxOC41QTQuNSw0LjUsMCwxLDAsNS41LDIzLDQuNTEsNC41MSwwLDAsMCwxMCwxOC41Wm0tNywwQTIuNSwyLjUsMCwxLDEsNS41LD" + "IxLDIuNSwyLjUsMCwwLDEsMywxOC41WiIvPjxwYXRoIGNsYXNzPSJjbHMtNyIgZD0iTTE3LjUsMTRBNC41LDQuNSwwLDEsMCwyMiwxOC41LDQuNTEsNC" + "41MSwwLDAsMCwxNy41LDE0Wm0wLDdBMi41LDIuNSwwLDEsMSwyMCwxOC41LDIuNSwyLjUsMCwwLDEsMTcuNSwyMVoiLz48L2c+PC9zdmc+";
  this.TMSFNCTOOLBARCUTSVGWHITE = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0" + "JveD0iMCAwIDI0IDI0Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2ZhZmFmYTt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPkN1dDwvdGl0bGU+P" + "GcgaWQ9Ikljb24iPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTE3LjUsMTRhNC40NSw0LjQ1LDAsMCwwLTEuMjIuMTlsLTIuMDctMi4zMUMxNS41" + "NSwxMC41NCwxNi43LDkuMzcsMTcsOWExMy4zNiwxMy4zNiwwLDAsMCwyLTYsNC41OCw0LjU4LDAsMCwwLS41LTJsLTcsNy44NEw0LjUsMUE0LjU" + "4LDQuNTgsMCwwLDAsNCwzLDEzLjM2LDEzLjM2LDAsMCwwLDYsOWMuMy4zNywxLjQ1LDEuNTQsMi43OSwyLjg4TDYuNzIsMTQuMTlBNC40NSw0Lj" + "Q1LDAsMCwwLDUuNSwxNGE0LjU2LDQuNTYsMCwxLDAsNCwyLjVsMi0xLjk0Yy44Mi44MSwxLjU0LDEuNSwyLDEuOTRhNC40OSw0LjQ5LDAsMSwwL" + "DQtMi41Wk0xMi4xNyw5LjU5LDE4LDMuMDZhMTIuNTksMTIuNTksMCwwLDEtMS43OCw1LjMxYy0uMjYuMzMtMS4zMywxLjQxLTIuNjgsMi43Nmwt" + "MS42OS0xLjlaTTUuNSwyMUEyLjUsMi41LDAsMSwxLDgsMTguNSwyLjUsMi41LDAsMCwxLDUuNSwyMVpNOSwxNS42NUE0LjUxLDQuNTEsMCwwLDA" + "sNy43LDE0LjZsMS44LTJoMGwxLjI5LDEuMjhaTTYuNzgsOC4zN0ExMi41OSwxMi41OSwwLDAsMSw1LDMuMDZMMTUuMywxNC42YTQuNTEsNC41MS" + "wwLDAsMC0xLjI1LDEuMDVDMTEuMiwxMi44Nyw3LjMxLDksNi43OCw4LjM3Wk0xNy41LDIxQTIuNSwyLjUsMCwxLDEsMjAsMTguNSwyLjUsMi41L" + "DAsMCwxLDE3LjUsMjFaIi8+PC9nPjwvc3ZnPg==";
  this.TMSFNCTOOLBARUNDOSVG = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdm" + "lld0JveD0iMCAwIDI0IDI0Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzNhM2EzODt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPlVuZG88L" + "3RpdGxlPjxnIGlkPSJJY29uIj48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik0xNS41LDhIMi44OEw4Ljk0LDEuOTRsLS44OC0uODhMLjYyLDgu" + "NWw3LjQ0LDcuNDQuODgtLjg4TDIuODgsOUgxNS41YTYuNSw2LjUsMCwwLDEsLjA2LDEzSDE1djFoLjU2QTcuNSw3LjUsMCwwLDAsMTUuNSw" + "4WiIvPjwvZz48L3N2Zz4=";
  this.TMSFNCTOOLBARUNDOSVGWHITE = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5" + "L3hsaW5rIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOm5vbmU7fS5jbHMtMntmaW" + "xsOiNmYWZhZmE7fS5jbHMtM3tmaWxsOnVybCgjTmV3X1BhdHRlcm5fU3dhdGNoXzIpO308L3N0eWxlPjxwYXR0ZXJuIGlkPSJOZXdfUGF0dGVybl9Td2F0Y2hf" + "MiIgZGF0YS1uYW1lPSJOZXcgUGF0dGVybiBTd2F0Y2ggMiIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4IiBwYXR0ZXJuVW5pdHM9InVzZXJTcGFjZU9uVXNlIiB2aW" + "V3Qm94PSIwIDAgNjggNjgiPjxyZWN0IGNsYXNzPSJjbHMtMSIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9ImNscy0yIiB3aWR0aD0iNjgi" + "IGhlaWdodD0iNjgiLz48L3BhdHRlcm4+PC9kZWZzPjx0aXRsZT5VbmRvPC90aXRsZT48ZyBpZD0iSWNvbiI+PHBhdGggY2xhc3M9ImNscy0zIiBkPSJNMTUuNS" + "w4SDIuODhMOC45NCwxLjk0bC0uODgtLjg4TC42Miw4LjVsNy40NCw3LjQ0Ljg4LS44OEwyLjg4LDlIMTUuNWE2LjUsNi41LDAsMCwxLC4wNiwxM0gxNXYxaC41" + "NkE3LjUsNy41LDAsMCwwLDE1LjUsOFoiLz48L2c+PC9zdmc+";
  this.TMSFNCTOOLBARREDOSVG = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI" + "0Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzNhM2EzODt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPlJlZG88L3RpdGxlPjxnIGlkPSJJY29uIj48cGF0aCBjbGFzcz0" + "iY2xzLTEiIGQ9Ik0xNS4wNiwxLjk0LDIxLjEyLDhIOC41YTcuNSw3LjUsMCwwLDAtLjA2LDE1SDlWMjJIOC40NEE2LjUsNi41LDAsMCwxLDguNSw5SDIxLjEybC02LjA" + "2LDYuMDYuODguODhMMjMuMzgsOC41LDE1Ljk0LDEuMDZaIi8+PC9nPjwvc3ZnPg==";
  this.TMSFNCTOOLBARREDOSVGWHITE = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5" + "rIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOm5vbmU7fS5jbHMtMntmaWxsOiNmYWZhZmE" + "7fS5jbHMtM3tmaWxsOnVybCgjTmV3X1BhdHRlcm5fU3dhdGNoXzIpO308L3N0eWxlPjxwYXR0ZXJuIGlkPSJOZXdfUGF0dGVybl9Td2F0Y2hfMiIgZGF0YS1uYW1lPSJ" + "OZXcgUGF0dGVybiBTd2F0Y2ggMiIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4IiBwYXR0ZXJuVW5pdHM9InVzZXJTcGFjZU9uVXNlIiB2aWV3Qm94PSIwIDAgNjggNjgiPjx" + "yZWN0IGNsYXNzPSJjbHMtMSIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9ImNscy0yIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48L3BhdHRlcm4" + "+PC9kZWZzPjx0aXRsZT5SZWRvPC90aXRsZT48ZyBpZD0iSWNvbiI+PHBhdGggY2xhc3M9ImNscy0zIiBkPSJNMTUuMDYsMS45NCwyMS4xMiw4SDguNWE3LjUsNy41LDA" + "sMCwwLS4wNiwxNUg5VjIySDguNDRBNi41LDYuNSwwLDAsMSw4LjUsOUgyMS4xMmwtNi4wNiw2LjA2Ljg4Ljg4TDIzLjM4LDguNSwxNS45NCwxLjA2WiIvPjwvZz48L3N" + "2Zz4=";
  rtl.createClass(this,"TTMSFNCEditorToolBar",pas["WEBLib.TMSFNCToolBar"].TTMSFNCToolBar,function () {
    this.FBlockBuildControls = false;
    this.CanBuildControls = function () {
      var Result = false;
      Result = !this.FBlockBuildControls;
      return Result;
    };
    this.GetVersion = function () {
      var Result = "";
      Result = this.$class.GetVersionNumber(1,0,0,0);
      return Result;
    };
    this.Notification = function (AComponent, AOperation) {
      pas["WEBLib.TMSFNCToolBar"].TTMSFNCCustomToolBar.Notification.apply(this,arguments);
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCToolBar"].TTMSFNCCustomToolBar.Create$1.apply(this,arguments);
      return this;
    };
    this.Destroy = function () {
      pas["WEBLib.TMSFNCToolBar"].TTMSFNCCustomToolBar.Destroy.call(this);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCStylesManager);
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.$rtti.$MethodVar("TTMSFNCEditorFormatToolBarApplyFontSize",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFontSize",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCEditorFormatToolBarApplyFontName",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFontName",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCEditorFormatToolBarApplyColor",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColor",pas["WEBLib.Graphics"].$rtti["TColor"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCEditorFormatToolBarApplyBullets",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AIndex",rtl.longint]]), methodkind: 0});
  this.TTMSFNCEditorFormatToolBarOption = {"0": "ftoFontName", ftoFontName: 0, "1": "ftoFontSize", ftoFontSize: 1, "2": "ftoBold", ftoBold: 2, "3": "ftoItalic", ftoItalic: 3, "4": "ftoUnderline", ftoUnderline: 4, "5": "ftoStrikeout", ftoStrikeout: 5, "6": "ftoAlignLeft", ftoAlignLeft: 6, "7": "ftoAlignCenter", ftoAlignCenter: 7, "8": "ftoAlignRight", ftoAlignRight: 8, "9": "ftoTextColor", ftoTextColor: 9, "10": "ftoBackgroundColor", ftoBackgroundColor: 10, "11": "ftoImage", ftoImage: 11, "12": "ftoHyperlink", ftoHyperlink: 12, "13": "ftoBullets", ftoBullets: 13, "14": "ftoNumbering", ftoNumbering: 14, "15": "ftoUnindent", ftoUnindent: 15, "16": "ftoIndent", ftoIndent: 16};
  this.$rtti.$Enum("TTMSFNCEditorFormatToolBarOption",{minvalue: 0, maxvalue: 16, ordtype: 1, enumtype: this.TTMSFNCEditorFormatToolBarOption});
  this.$rtti.$Set("TTMSFNCEditorFormatToolBarOptions",{comptype: this.$rtti["TTMSFNCEditorFormatToolBarOption"]});
  this.AllFormatOptions = rtl.createSet(null,this.TTMSFNCEditorFormatToolBarOption.ftoFontName,this.TTMSFNCEditorFormatToolBarOption.ftoIndent);
  rtl.createClass(this,"TTMSFNCEditorFormatToolBar",this.TTMSFNCEditorToolBar,function () {
    this.$init = function () {
      $mod.TTMSFNCEditorToolBar.$init.call(this);
      this.FCreated = false;
      this.FSep1 = null;
      this.FSep2 = null;
      this.FSep3 = null;
      this.FSep4 = null;
      this.FBold = null;
      this.FItalic = null;
      this.FUnderline = null;
      this.FStrikeout = null;
      this.FAlignLeft = null;
      this.FAlignCenter = null;
      this.FAlignRight = null;
      this.FUnindent = null;
      this.FIndent = null;
      this.FImage = null;
      this.FNumbering = null;
      this.FHyperlink = null;
      this.FFontNamePicker = null;
      this.FFontSizePicker = null;
      this.FTextColorPicker = null;
      this.FBackgroundColorPicker = null;
      this.FBitmapPicker = null;
      this.FOnApplyFontSize = null;
      this.FOnApplyFontName = null;
      this.FOnApplyBackgroundColor = null;
      this.FOnApplyTextColor = null;
      this.FOnApplyBullets = null;
      this.FOnAlignCenter = null;
      this.FOnAlignLeft = null;
      this.FOnApplyStrikeout = null;
      this.FOnApplyBold = null;
      this.FOnAlignRight = null;
      this.FOnApplyNumbering = null;
      this.FOnApplyUnderline = null;
      this.FOnApplyItalic = null;
      this.FOnInsertHyperlink = null;
      this.FOnIndent = null;
      this.FOnUnindent = null;
      this.FOnInsertBitmap = null;
      this.FOptions = {};
    };
    this.$final = function () {
      this.FSep1 = undefined;
      this.FSep2 = undefined;
      this.FSep3 = undefined;
      this.FSep4 = undefined;
      this.FBold = undefined;
      this.FItalic = undefined;
      this.FUnderline = undefined;
      this.FStrikeout = undefined;
      this.FAlignLeft = undefined;
      this.FAlignCenter = undefined;
      this.FAlignRight = undefined;
      this.FUnindent = undefined;
      this.FIndent = undefined;
      this.FImage = undefined;
      this.FNumbering = undefined;
      this.FHyperlink = undefined;
      this.FFontNamePicker = undefined;
      this.FFontSizePicker = undefined;
      this.FTextColorPicker = undefined;
      this.FBackgroundColorPicker = undefined;
      this.FBitmapPicker = undefined;
      this.FOnApplyFontSize = undefined;
      this.FOnApplyFontName = undefined;
      this.FOnApplyBackgroundColor = undefined;
      this.FOnApplyTextColor = undefined;
      this.FOnApplyBullets = undefined;
      this.FOnAlignCenter = undefined;
      this.FOnAlignLeft = undefined;
      this.FOnApplyStrikeout = undefined;
      this.FOnApplyBold = undefined;
      this.FOnAlignRight = undefined;
      this.FOnApplyNumbering = undefined;
      this.FOnApplyUnderline = undefined;
      this.FOnApplyItalic = undefined;
      this.FOnInsertHyperlink = undefined;
      this.FOnIndent = undefined;
      this.FOnUnindent = undefined;
      this.FOnInsertBitmap = undefined;
      this.FOptions = undefined;
      $mod.TTMSFNCEditorToolBar.$final.call(this);
    };
    this.SetOptions = function (Value) {
      if (rtl.neSet(this.FOptions,Value)) {
        this.FOptions = rtl.refSet(Value);
        this.UpdateOptions();
      };
    };
    this.UpdateToolBar$1 = function () {
      if (!this.FCreated) return;
      this.Invalidate();
    };
    this.FontName = function (Sender) {
      var fn = "";
      if (!(this.FFontNamePicker != null)) return;
      fn = this.FFontNamePicker.GetText();
      if (fn !== "") {
        if (this.FOnApplyFontName != null) {
          this.FOnApplyFontName(this,fn);
          return;
        };
        this.DoApplyFontName(fn);
      };
    };
    this.FontSize = function (Sender) {
      var fs = 0;
      if (!(this.FFontSizePicker != null)) return;
      if (this.FFontSizePicker.GetText() !== "") {
        fs = pas.SysUtils.StrToInt(this.FFontSizePicker.GetText());
        if (this.FOnApplyFontSize != null) {
          this.FOnApplyFontSize(this,fs);
          return;
        };
        this.DoApplyFontSize(fs);
      };
    };
    this.TextColor = function (Sender) {
      var c = 0;
      if (!(this.FTextColorPicker != null)) return;
      c = this.FTextColorPicker.GetSelectedColor();
      if (this.FOnApplyTextColor != null) {
        this.FOnApplyTextColor(this,c);
        return;
      };
      this.DoApplyTextColor(c);
    };
    this.Bullets = function (Sender) {
      var c = 0;
      if (!(this.FBitmapPicker != null)) return;
      c = this.FBitmapPicker.GetSelectedItemIndex();
      if (this.FOnApplyBullets != null) {
        this.FOnApplyBullets(this,c);
        return;
      };
      this.DoApplyBullets(c);
    };
    this.BackgroundColor = function (Sender) {
      var c = 0;
      if (!(this.FBackgroundColorPicker != null)) return;
      c = this.FBackgroundColorPicker.GetSelectedColor();
      if (this.FOnApplyBackgroundColor != null) {
        this.FOnApplyBackgroundColor(this,c);
        return;
      };
      this.DoApplyBackgroundColor(c);
    };
    this.BitmapSelected = function (Sender, ABitmap) {
      if (this.FBitmapPicker != null) {
        this.FBitmapPicker.CloseDropDown();
        this.Bullets(this);
      };
    };
    this.FontNameSelected = function (Sender, AFontName) {
      this.FontName(this);
    };
    this.FontSizeSelected = function (Sender, AFontSize) {
      this.FontSize(this);
    };
    this.TextColorSelected = function (Sender, AColor) {
      if (this.FTextColorPicker != null) {
        if (!this.FTextColorPicker.BlockChange()) this.FTextColorPicker.CloseDropDown();
        this.TextColor(this);
      };
    };
    this.BackgroundColorSelected = function (Sender, AColor) {
      if (this.FBackgroundColorPicker != null) {
        if (!this.FBackgroundColorPicker.BlockChange()) this.FBackgroundColorPicker.CloseDropDown();
        this.BackgroundColor(this);
      };
    };
    this.Bold = function (Sender) {
      if (this.FOnApplyBold != null) {
        this.FOnApplyBold(this);
        return;
      };
      this.DoApplyBold();
    };
    this.Italic = function (Sender) {
      if (this.FOnApplyItalic != null) {
        this.FOnApplyItalic(this);
        return;
      };
      this.DoApplyItalic();
    };
    this.InsertHyperlink = function (Sender) {
      var url = "";
      if (this.FOnInsertHyperlink != null) {
        this.FOnInsertHyperlink(this);
        return;
      };
      url = "";
      pas["WEBLib.Dialogs"].InputQuery("Hyperlink","URL",{get: function () {
          return url;
        }, set: function (v) {
          url = v;
        }});
      this.DoInsertHyperlink(url);
    };
    this.InsertBitmap = function (Sender) {
      var $Self = this;
      var od = null;
      if (this.FOnInsertBitmap != null) {
        this.FOnInsertBitmap($Self);
        return;
      };
      od = pas["WEBLib.Dialogs"].TOpenDialog.$create("Create$1",[$Self]);
      try {
        od.Execute$1(function (AFileName) {
          $Self.DoInsertBitmap(od.FFileName);
        });
      } finally {
      };
    };
    this.Numbering = function (Sender) {
      if (this.FOnApplyNumbering != null) {
        this.FOnApplyNumbering(this);
        return;
      };
      this.DoApplyNumbering();
    };
    this.Indent = function (Sender) {
      if (this.FOnIndent != null) {
        this.FOnIndent(this);
        return;
      };
      this.DoApplyIndent();
    };
    this.Unindent = function (Sender) {
      if (this.FOnUnindent != null) {
        this.FOnUnindent(this);
        return;
      };
      this.DoApplyUnindent();
    };
    this.Underline = function (Sender) {
      if (this.FOnApplyUnderline != null) {
        this.FOnApplyUnderline(this);
        return;
      };
      this.DoApplyUnderline();
    };
    this.Strikeout = function (Sender) {
      if (this.FOnApplyStrikeout != null) {
        this.FOnApplyStrikeout(this);
        return;
      };
      this.DoApplyStrikeout();
    };
    this.AlignLeft = function (Sender) {
      if (this.FOnAlignLeft != null) {
        this.FOnAlignLeft(this);
        return;
      };
      this.DoAlignLeft();
    };
    this.AlignCenter = function (Sender) {
      if (this.FOnAlignCenter != null) {
        this.FOnAlignCenter(this);
        return;
      };
      this.DoAlignCenter();
    };
    this.AlignRight = function (Sender) {
      if (this.FOnAlignRight != null) {
        this.FOnAlignRight(this);
        return;
      };
      this.DoAlignRight();
    };
    this.UpdateOptions = function () {
      this.FBold.SetHidden(!($mod.TTMSFNCEditorFormatToolBarOption.ftoBold in this.FOptions));
      this.FUnderline.SetHidden(!($mod.TTMSFNCEditorFormatToolBarOption.ftoUnderline in this.FOptions));
      this.FStrikeout.SetHidden(!($mod.TTMSFNCEditorFormatToolBarOption.ftoStrikeout in this.FOptions));
      this.FItalic.SetHidden(!($mod.TTMSFNCEditorFormatToolBarOption.ftoItalic in this.FOptions));
      this.FUnindent.SetHidden(!($mod.TTMSFNCEditorFormatToolBarOption.ftoUnindent in this.FOptions));
      this.FIndent.SetHidden(!($mod.TTMSFNCEditorFormatToolBarOption.ftoIndent in this.FOptions));
      this.FFontSizePicker.SetHidden(!($mod.TTMSFNCEditorFormatToolBarOption.ftoFontSize in this.FOptions));
      this.FFontNamePicker.SetHidden(!($mod.TTMSFNCEditorFormatToolBarOption.ftoFontName in this.FOptions));
      this.FAlignLeft.SetHidden(!($mod.TTMSFNCEditorFormatToolBarOption.ftoAlignLeft in this.FOptions));
      this.FAlignCenter.SetHidden(!($mod.TTMSFNCEditorFormatToolBarOption.ftoAlignCenter in this.FOptions));
      this.FAlignRight.SetHidden(!($mod.TTMSFNCEditorFormatToolBarOption.ftoAlignRight in this.FOptions));
      this.FTextColorPicker.SetHidden(!($mod.TTMSFNCEditorFormatToolBarOption.ftoTextColor in this.FOptions));
      this.FBackgroundColorPicker.SetHidden(!($mod.TTMSFNCEditorFormatToolBarOption.ftoBackgroundColor in this.FOptions));
      this.FImage.SetHidden(!($mod.TTMSFNCEditorFormatToolBarOption.ftoImage in this.FOptions));
      this.FHyperlink.SetHidden(!($mod.TTMSFNCEditorFormatToolBarOption.ftoHyperlink in this.FOptions));
      this.FBitmapPicker.SetHidden(!($mod.TTMSFNCEditorFormatToolBarOption.ftoBullets in this.FOptions));
      this.FNumbering.SetHidden(!($mod.TTMSFNCEditorFormatToolBarOption.ftoNumbering in this.FOptions));
      if (!(pas.Classes.TComponentStateItem.csDesigning in this.FComponentState)) {
        this.FBold.SetVisible($mod.TTMSFNCEditorFormatToolBarOption.ftoBold in this.FOptions);
        this.FUnderline.SetVisible($mod.TTMSFNCEditorFormatToolBarOption.ftoUnderline in this.FOptions);
        this.FStrikeout.SetVisible($mod.TTMSFNCEditorFormatToolBarOption.ftoStrikeout in this.FOptions);
        this.FItalic.SetVisible($mod.TTMSFNCEditorFormatToolBarOption.ftoItalic in this.FOptions);
        this.FUnindent.SetVisible($mod.TTMSFNCEditorFormatToolBarOption.ftoUnindent in this.FOptions);
        this.FIndent.SetVisible($mod.TTMSFNCEditorFormatToolBarOption.ftoIndent in this.FOptions);
        this.FFontSizePicker.SetVisible($mod.TTMSFNCEditorFormatToolBarOption.ftoFontSize in this.FOptions);
        this.FFontNamePicker.SetVisible($mod.TTMSFNCEditorFormatToolBarOption.ftoFontName in this.FOptions);
        this.FAlignLeft.SetVisible($mod.TTMSFNCEditorFormatToolBarOption.ftoAlignLeft in this.FOptions);
        this.FAlignCenter.SetVisible($mod.TTMSFNCEditorFormatToolBarOption.ftoAlignCenter in this.FOptions);
        this.FAlignRight.SetVisible($mod.TTMSFNCEditorFormatToolBarOption.ftoAlignRight in this.FOptions);
        this.FTextColorPicker.SetVisible($mod.TTMSFNCEditorFormatToolBarOption.ftoTextColor in this.FOptions);
        this.FBackgroundColorPicker.SetVisible($mod.TTMSFNCEditorFormatToolBarOption.ftoBackgroundColor in this.FOptions);
        this.FImage.SetVisible($mod.TTMSFNCEditorFormatToolBarOption.ftoImage in this.FOptions);
        this.FHyperlink.SetVisible($mod.TTMSFNCEditorFormatToolBarOption.ftoHyperlink in this.FOptions);
        this.FBitmapPicker.SetVisible($mod.TTMSFNCEditorFormatToolBarOption.ftoBullets in this.FOptions);
        this.FNumbering.SetVisible($mod.TTMSFNCEditorFormatToolBarOption.ftoNumbering in this.FOptions);
      };
    };
    this.DoApplyFontName = function (AFontName) {
      this.UpdateToolBar$1();
    };
    this.DoApplyFontSize = function (AFontSize) {
      this.UpdateToolBar$1();
    };
    this.DoApplyBackgroundColor = function (AColor) {
      this.UpdateToolBar$1();
    };
    this.DoApplyTextColor = function (AColor) {
      this.UpdateToolBar$1();
    };
    this.DoApplyBullets = function (AIndex) {
      this.UpdateToolBar$1();
    };
    this.DoApplyBold = function () {
      this.UpdateToolBar$1();
    };
    this.DoApplyItalic = function () {
      this.UpdateToolBar$1();
    };
    this.DoInsertHyperlink = function (AValue) {
      this.UpdateToolBar$1();
    };
    this.DoInsertBitmap = function (AFileName) {
      this.UpdateToolBar$1();
    };
    this.DoApplyNumbering = function () {
      this.UpdateToolBar$1();
    };
    this.DoApplyIndent = function () {
      this.UpdateToolBar$1();
    };
    this.DoApplyUnindent = function () {
      this.UpdateToolBar$1();
    };
    this.DoApplyUnderline = function () {
      this.UpdateToolBar$1();
    };
    this.DoApplyStrikeout = function () {
      this.UpdateToolBar$1();
    };
    this.DoAlignLeft = function () {
      this.UpdateToolBar$1();
    };
    this.DoAlignCenter = function () {
      this.UpdateToolBar$1();
    };
    this.DoAlignRight = function () {
      this.UpdateToolBar$1();
    };
    this.IsCreated = function () {
      var Result = false;
      Result = this.FCreated;
      return Result;
    };
    this.Create$1 = function (AOwner) {
      var res = "";
      $mod.TTMSFNCEditorToolBar.Create$1.apply(this,arguments);
      this.FOptionsMenu.SetShowButton(false);
      this.FOptions = rtl.refSet($mod.AllFormatOptions);
      this.FFontNamePicker = this.AddFontNamePicker(-1);
      this.FFontNamePicker.SetAllowFocus(false);
      this.FFontNamePicker.SetSelectedItemIndex(0);
      this.FFontNamePicker.FStored = false;
      this.FFontNamePicker.FOnClick = rtl.createCallback(this,"FontName");
      this.FFontNamePicker.FOnFontNameSelected = rtl.createCallback(this,"FontNameSelected");
      this.FFontSizePicker = this.AddFontSizePicker(-1);
      this.FFontSizePicker.SetAllowFocus(false);
      this.FFontSizePicker.SetSelectedItemIndex(0);
      this.FFontSizePicker.FOnClick = rtl.createCallback(this,"FontSize");
      this.FFontSizePicker.FOnFontSizeSelected = rtl.createCallback(this,"FontSizeSelected");
      this.FFontSizePicker.FStored = false;
      this.FSep1 = this.AddSeparator(-1);
      this.FSep1.SetAllowFocus(false);
      this.FSep1.FStored = false;
      this.FSep1.SetHeight(24);
      if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
        res = $mod.TMSFNCTOOLBARBOLDSVG}
       else res = $mod.TMSFNCTOOLBARBOLDSVGWHITE;
      this.FBold = this.AddButton(24,24,res,"","",-1);
      this.FBold.SetAllowFocus(false);
      this.FBold.FAutoOptionsMenuText = "Bold";
      this.FBold.FStored = false;
      this.FBold.FOnClick = rtl.createCallback(this,"Bold");
      if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
        res = $mod.TMSFNCTOOLBARITALICSVG}
       else res = $mod.TMSFNCTOOLBARITALICSVGWHITE;
      this.FItalic = this.AddButton(24,24,res,"","",-1);
      this.FItalic.SetAllowFocus(false);
      this.FItalic.FAutoOptionsMenuText = "Italic";
      this.FItalic.FStored = false;
      this.FItalic.FOnClick = rtl.createCallback(this,"Italic");
      if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
        res = $mod.TMSFNCTOOLBARUNDERLINESVG}
       else res = $mod.TMSFNCTOOLBARUNDERLINESVGWHITE;
      this.FUnderline = this.AddButton(24,24,res,"","",-1);
      this.FUnderline.SetAllowFocus(false);
      this.FUnderline.FAutoOptionsMenuText = "Underline";
      this.FUnderline.FStored = false;
      this.FUnderline.FOnClick = rtl.createCallback(this,"Underline");
      if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
        res = $mod.TMSFNCTOOLBARSTRIKEOUTSVG}
       else res = $mod.TMSFNCTOOLBARSTRIKEOUTSVGWHITE;
      this.FStrikeout = this.AddButton(24,24,res,"","",-1);
      this.FStrikeout.SetAllowFocus(false);
      this.FStrikeout.FAutoOptionsMenuText = "Strikeout";
      this.FStrikeout.FStored = false;
      this.FStrikeout.FOnClick = rtl.createCallback(this,"Strikeout");
      this.FSep2 = this.AddSeparator(-1);
      this.FSep2.SetAllowFocus(false);
      this.FSep2.FStored = false;
      this.FSep2.SetHeight(24);
      if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
        res = $mod.TMSFNCTOOLBARALIGNLEFTSVG}
       else res = $mod.TMSFNCTOOLBARALIGNLEFTSVGWHITE;
      this.FAlignLeft = this.AddButton(24,24,res,"","",-1);
      this.FAlignLeft.SetAllowFocus(false);
      this.FAlignLeft.FStored = false;
      this.FAlignLeft.FAutoOptionsMenuText = "Align left";
      this.FAlignLeft.FOnClick = rtl.createCallback(this,"AlignLeft");
      if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
        res = $mod.TMSFNCTOOLBARALIGNCENTERSVG}
       else res = $mod.TMSFNCTOOLBARALIGNCENTERSVGWHITE;
      this.FAlignCenter = this.AddButton(24,24,res,"","",-1);
      this.FAlignCenter.SetAllowFocus(false);
      this.FAlignCenter.FStored = false;
      this.FAlignCenter.FAutoOptionsMenuText = "Align Center";
      this.FAlignCenter.FOnClick = rtl.createCallback(this,"AlignCenter");
      if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
        res = $mod.TMSFNCTOOLBARALIGNRIGHTSVG}
       else res = $mod.TMSFNCTOOLBARALIGNRIGHTSVGWHITE;
      this.FAlignRight = this.AddButton(24,24,res,"","",-1);
      this.FAlignRight.SetAllowFocus(false);
      this.FAlignRight.FAutoOptionsMenuText = "Align Right";
      this.FAlignRight.FStored = false;
      this.FAlignRight.FOnClick = rtl.createCallback(this,"AlignRight");
      this.FSep3 = this.AddSeparator(-1);
      this.FSep3.SetAllowFocus(false);
      this.FSep3.FStored = false;
      this.FSep3.SetHeight(24);
      this.FTextColorPicker = this.AddColorPicker(-1);
      this.FTextColorPicker.SetAllowFocus(false);
      this.FTextColorPicker.FOnClick = rtl.createCallback(this,"TextColor");
      this.FTextColorPicker.FAutoOptionsMenuText = "Text Color";
      this.FTextColorPicker.FStored = false;
      this.FTextColorPicker.FOnColorSelected = rtl.createCallback(this,"TextColorSelected");
      this.FBackgroundColorPicker = this.AddColorPicker(-1);
      this.FBackgroundColorPicker.SetAllowFocus(false);
      this.FBackgroundColorPicker.FOnClick = rtl.createCallback(this,"BackgroundColor");
      this.FBackgroundColorPicker.FAutoOptionsMenuText = "Background Color";
      this.FBackgroundColorPicker.FStored = false;
      this.FBackgroundColorPicker.FOnColorSelected = rtl.createCallback(this,"BackgroundColorSelected");
      this.FSep4 = this.AddSeparator(-1);
      this.FSep4.SetAllowFocus(false);
      this.FSep4.FStored = false;
      this.FSep4.SetHeight(24);
      if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
        res = $mod.TMSFNCTOOLBARIMAGESVG}
       else res = $mod.TMSFNCTOOLBARIMAGESVGWHITE;
      this.FImage = this.AddButton(24,24,res,"","",-1);
      this.FImage.SetAllowFocus(false);
      this.FImage.FAutoOptionsMenuText = "Insert Image";
      this.FImage.FStored = false;
      this.FImage.FOnClick = rtl.createCallback(this,"InsertBitmap");
      if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
        res = $mod.TMSFNCTOOLBARINTERNETLINKSVG}
       else res = $mod.TMSFNCTOOLBARINTERNETLINKSVGWHITE;
      this.FHyperlink = this.AddButton(24,24,res,"","",-1);
      this.FHyperlink.SetAllowFocus(false);
      this.FHyperlink.FAutoOptionsMenuText = "Insert hyperlink";
      this.FHyperlink.FStored = false;
      this.FHyperlink.FOnClick = rtl.createCallback(this,"InsertHyperlink");
      this.FBitmapPicker = this.AddBitmapPicker(-1);
      this.FBitmapPicker.SetAllowFocus(false);
      this.FBitmapPicker.FOnClick = rtl.createCallback(this,"Bullets");
      this.FBitmapPicker.FAutoOptionsMenuText = "Change Bullet Type";
      this.FBitmapPicker.FStored = false;
      if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
        res = $mod.TMSFNCTOOLBARCIRCLESVG}
       else res = $mod.TMSFNCTOOLBARCIRCLESVGWHITE;
      this.FBitmapPicker.GetItems().Add$2().FBitmap.LoadFromResource$1(res,pas["WEBLib.TMSFNCTypes"].HInstance());
      if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
        res = $mod.TMSFNCTOOLBARSQUARESVG}
       else res = $mod.TMSFNCTOOLBARSQUARESVGWHITE;
      this.FBitmapPicker.GetItems().Add$2().FBitmap.LoadFromResource$1(res,pas["WEBLib.TMSFNCTypes"].HInstance());
      if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
        res = $mod.TMSFNCTOOLBARARROWSVG}
       else res = $mod.TMSFNCTOOLBARARROWSVGWHITE;
      this.FBitmapPicker.GetItems().Add$2().FBitmap.LoadFromResource$1(res,pas["WEBLib.TMSFNCTypes"].HInstance());
      if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
        res = $mod.TMSFNCTOOLBARTICKMARKSVG}
       else res = $mod.TMSFNCTOOLBARTICKMARKSVGWHITE;
      this.FBitmapPicker.GetItems().Add$2().FBitmap.LoadFromResource$1(res,pas["WEBLib.TMSFNCTypes"].HInstance());
      if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
        res = $mod.TMSFNCTOOLBARSTARFULLSVGBLACK}
       else res = $mod.TMSFNCTOOLBARSTARFULLSVGWHITE;
      this.FBitmapPicker.GetItems().Add$2().FBitmap.LoadFromResource$1(res,pas["WEBLib.TMSFNCTypes"].HInstance());
      this.FBitmapPicker.FOnBitmapSelected = rtl.createCallback(this,"BitmapSelected");
      this.FBitmapPicker.FBitmaps.AddBitmap(this.FBitmapPicker.GetItems().GetItem$2(0).FBitmap,1.0);
      this.FBitmapPicker.SetSelectedItemIndex(0);
      if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
        res = $mod.TMSFNCTOOLBARNUMBERINGSVG}
       else res = $mod.TMSFNCTOOLBARNUMBERINGSVGWHITE;
      this.FNumbering = this.AddButton(24,24,res,"","",-1);
      this.FNumbering.SetAllowFocus(false);
      this.FNumbering.FAutoOptionsMenuText = "Numbering";
      this.FNumbering.FStored = false;
      this.FNumbering.FOnClick = rtl.createCallback(this,"Numbering");
      if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
        res = $mod.TMSFNCTOOLBARINDENTDECREASESVG}
       else res = $mod.TMSFNCTOOLBARINDENTDECREASESVGWHITE;
      this.FUnindent = this.AddButton(24,24,res,"","",-1);
      this.FUnindent.SetAllowFocus(false);
      this.FUnindent.FAutoOptionsMenuText = "Decrease indent";
      this.FUnindent.FStored = false;
      this.FUnindent.FOnClick = rtl.createCallback(this,"Unindent");
      if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
        res = $mod.TMSFNCTOOLBARINDENTINCREASESVG}
       else res = $mod.TMSFNCTOOLBARINDENTINCREASESVGWHITE;
      this.FIndent = this.AddButton(24,24,res,"","",-1);
      this.FIndent.SetAllowFocus(false);
      this.FIndent.FAutoOptionsMenuText = "Increase indent";
      this.FIndent.FStored = false;
      this.FIndent.FOnClick = rtl.createCallback(this,"Indent");
      this.FCreated = true;
      return this;
    };
    this.FirstSeparator = function () {
      var Result = null;
      Result = this.FSep1;
      return Result;
    };
    this.SecondSeparator = function () {
      var Result = null;
      Result = this.FSep2;
      return Result;
    };
    this.ThirdSeparator = function () {
      var Result = null;
      Result = this.FSep3;
      return Result;
    };
    this.FourthSeparator = function () {
      var Result = null;
      Result = this.FSep4;
      return Result;
    };
    this.FontNamePicker = function () {
      var Result = null;
      Result = this.FFontNamePicker;
      return Result;
    };
    this.FontSizePicker = function () {
      var Result = null;
      Result = this.FFontSizePicker;
      return Result;
    };
    this.BackgroundColorPicker = function () {
      var Result = null;
      Result = this.FBackgroundColorPicker;
      return Result;
    };
    this.TextColorPicker = function () {
      var Result = null;
      Result = this.FTextColorPicker;
      return Result;
    };
    this.BulletsPicker = function () {
      var Result = null;
      Result = this.FBitmapPicker;
      return Result;
    };
    this.NumberingButton = function () {
      var Result = null;
      Result = this.FNumbering;
      return Result;
    };
    this.AlignLeftButton = function () {
      var Result = null;
      Result = this.FAlignLeft;
      return Result;
    };
    this.AlignCenterButton = function () {
      var Result = null;
      Result = this.FAlignCenter;
      return Result;
    };
    this.AlignRightButton = function () {
      var Result = null;
      Result = this.FAlignRight;
      return Result;
    };
    this.StrikeoutButton = function () {
      var Result = null;
      Result = this.FStrikeout;
      return Result;
    };
    this.BoldButton = function () {
      var Result = null;
      Result = this.FBold;
      return Result;
    };
    this.ItalicButton = function () {
      var Result = null;
      Result = this.FItalic;
      return Result;
    };
    this.UnderlineButton = function () {
      var Result = null;
      Result = this.FUnderline;
      return Result;
    };
    this.IndentButton = function () {
      var Result = null;
      Result = this.FIndent;
      return Result;
    };
    this.UnindentButton = function () {
      var Result = null;
      Result = this.FUnindent;
      return Result;
    };
    this.ImageButton = function () {
      var Result = null;
      Result = this.FImage;
      return Result;
    };
    this.HyperlinkButton = function () {
      var Result = null;
      Result = this.FHyperlink;
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCStylesManager);
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("OnApplyBold",0,pas.Classes.$rtti["TNotifyEvent"],"FOnApplyBold","FOnApplyBold");
    $r.addProperty("OnApplyItalic",0,pas.Classes.$rtti["TNotifyEvent"],"FOnApplyItalic","FOnApplyItalic");
    $r.addProperty("OnApplyNumbering",0,pas.Classes.$rtti["TNotifyEvent"],"FOnApplyNumbering","FOnApplyNumbering");
    $r.addProperty("OnApplyUnderline",0,pas.Classes.$rtti["TNotifyEvent"],"FOnApplyUnderline","FOnApplyUnderline");
    $r.addProperty("OnApplyStrikeout",0,pas.Classes.$rtti["TNotifyEvent"],"FOnApplyStrikeout","FOnApplyStrikeout");
    $r.addProperty("OnAlignLeft",0,pas.Classes.$rtti["TNotifyEvent"],"FOnAlignLeft","FOnAlignLeft");
    $r.addProperty("OnAlignCenter",0,pas.Classes.$rtti["TNotifyEvent"],"FOnAlignCenter","FOnAlignCenter");
    $r.addProperty("OnAlignRight",0,pas.Classes.$rtti["TNotifyEvent"],"FOnAlignRight","FOnAlignRight");
    $r.addProperty("OnApplyIndent",0,pas.Classes.$rtti["TNotifyEvent"],"FOnIndent","FOnIndent");
    $r.addProperty("OnApplyUnindent",0,pas.Classes.$rtti["TNotifyEvent"],"FOnUnindent","FOnUnindent");
    $r.addProperty("OnInsertHyperlink",0,pas.Classes.$rtti["TNotifyEvent"],"FOnInsertHyperlink","FOnInsertHyperlink");
    $r.addProperty("OnInsertBitmap",0,pas.Classes.$rtti["TNotifyEvent"],"FOnInsertBitmap","FOnInsertBitmap");
    $r.addProperty("OnApplyBullets",0,$mod.$rtti["TTMSFNCEditorFormatToolBarApplyBullets"],"FOnApplyBullets","FOnApplyBullets");
    $r.addProperty("OnApplyFontName",0,$mod.$rtti["TTMSFNCEditorFormatToolBarApplyFontName"],"FOnApplyFontName","FOnApplyFontName");
    $r.addProperty("OnApplyFontSize",0,$mod.$rtti["TTMSFNCEditorFormatToolBarApplyFontSize"],"FOnApplyFontSize","FOnApplyFontSize");
    $r.addProperty("OnApplyBackgroundColor",0,$mod.$rtti["TTMSFNCEditorFormatToolBarApplyColor"],"FOnApplyBackgroundColor","FOnApplyBackgroundColor");
    $r.addProperty("OnApplyTextColor",0,$mod.$rtti["TTMSFNCEditorFormatToolBarApplyColor"],"FOnApplyTextColor","FOnApplyTextColor");
    $r.addProperty("Options",2,$mod.$rtti["TTMSFNCEditorFormatToolBarOptions"],"FOptions","SetOptions",4,{Default: $mod.AllFormatOptions});
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
  this.TTMSFNCEditorEditToolBarOption = {"0": "etoOpenFile", etoOpenFile: 0, "1": "etoSaveFile", etoSaveFile: 1, "2": "etoCut", etoCut: 2, "3": "etoCopy", etoCopy: 3, "4": "etoPaste", etoPaste: 4, "5": "etoUndo", etoUndo: 5, "6": "etoRedo", etoRedo: 6};
  this.$rtti.$Enum("TTMSFNCEditorEditToolBarOption",{minvalue: 0, maxvalue: 6, ordtype: 1, enumtype: this.TTMSFNCEditorEditToolBarOption});
  this.$rtti.$Set("TTMSFNCEditorEditToolBarOptions",{comptype: this.$rtti["TTMSFNCEditorEditToolBarOption"]});
  this.AllEditOptions = rtl.createSet(null,this.TTMSFNCEditorEditToolBarOption.etoOpenFile,this.TTMSFNCEditorEditToolBarOption.etoRedo);
  rtl.createClass(this,"TTMSFNCEditorEditToolBar",this.TTMSFNCEditorToolBar,function () {
    this.$init = function () {
      $mod.TTMSFNCEditorToolBar.$init.call(this);
      this.FCreated = false;
      this.FOnSaveFile = null;
      this.FOnOpenFile = null;
      this.FOnCut = null;
      this.FOnPaste = null;
      this.FOnUndo = null;
      this.FOnRedo = null;
      this.FOnCopy = null;
      this.FOptions = {};
      this.FSep1 = null;
      this.FSep2 = null;
      this.FOpen = null;
      this.FSave = null;
      this.FCut = null;
      this.FCopy = null;
      this.FPaste = null;
      this.FUndo = null;
      this.FRedo = null;
    };
    this.$final = function () {
      this.FOnSaveFile = undefined;
      this.FOnOpenFile = undefined;
      this.FOnCut = undefined;
      this.FOnPaste = undefined;
      this.FOnUndo = undefined;
      this.FOnRedo = undefined;
      this.FOnCopy = undefined;
      this.FOptions = undefined;
      this.FSep1 = undefined;
      this.FSep2 = undefined;
      this.FOpen = undefined;
      this.FSave = undefined;
      this.FCut = undefined;
      this.FCopy = undefined;
      this.FPaste = undefined;
      this.FUndo = undefined;
      this.FRedo = undefined;
      $mod.TTMSFNCEditorToolBar.$final.call(this);
    };
    this.SetOptions = function (Value) {
      if (rtl.neSet(this.FOptions,Value)) {
        this.FOptions = rtl.refSet(Value);
        this.UpdateOptions();
      };
    };
    this.UpdateToolBar$1 = function () {
    };
    this.OpenFile = function (Sender) {
      var $Self = this;
      var od = null;
      if (this.FOnOpenFile != null) {
        this.FOnOpenFile($Self);
        return;
      };
      od = pas["WEBLib.Dialogs"].TOpenDialog.$create("Create$1",[$Self]);
      try {
        od.Execute$1(function (AFileName) {
          $Self.DoOpenFile(od.FFileName);
        });
      } finally {
      };
    };
    this.SaveFile = function (Sender) {
      if (this.FOnSaveFile != null) {
        this.FOnSaveFile(this);
        return;
      };
      this.DoSaveFile("");
    };
    this.Cut = function (Sender) {
      if (this.FOnCut != null) {
        this.FOnCut(this);
        return;
      };
      this.DoCut();
    };
    this.Paste = function (Sender) {
      if (this.FOnPaste != null) {
        this.FOnPaste(this);
        return;
      };
      this.DoPaste();
    };
    this.Undo = function (Sender) {
      if (this.FOnUndo != null) {
        this.FOnUndo(this);
        return;
      };
      this.DoUndo();
    };
    this.Redo = function (Sender) {
      if (this.FOnRedo != null) {
        this.FOnRedo(this);
        return;
      };
      this.DoRedo();
    };
    this.CopyBtn = function (Sender) {
      if (this.FOnCopy != null) {
        this.FOnCopy(this);
        return;
      };
      this.DoCopy();
    };
    this.UpdateOptions = function () {
      this.FOpen.SetHidden(!($mod.TTMSFNCEditorEditToolBarOption.etoOpenFile in this.FOptions));
      this.FSave.SetHidden(!($mod.TTMSFNCEditorEditToolBarOption.etoSaveFile in this.FOptions));
      this.FCut.SetHidden(!($mod.TTMSFNCEditorEditToolBarOption.etoCut in this.FOptions));
      this.FCopy.SetHidden(!($mod.TTMSFNCEditorEditToolBarOption.etoCopy in this.FOptions));
      this.FPaste.SetHidden(!($mod.TTMSFNCEditorEditToolBarOption.etoPaste in this.FOptions));
      this.FUndo.SetHidden(!($mod.TTMSFNCEditorEditToolBarOption.etoUndo in this.FOptions));
      this.FRedo.SetHidden(!($mod.TTMSFNCEditorEditToolBarOption.etoRedo in this.FOptions));
      if (!(pas.Classes.TComponentStateItem.csDesigning in this.FComponentState)) {
        this.FOpen.SetVisible($mod.TTMSFNCEditorEditToolBarOption.etoOpenFile in this.FOptions);
        this.FSave.SetVisible($mod.TTMSFNCEditorEditToolBarOption.etoSaveFile in this.FOptions);
        this.FCut.SetVisible($mod.TTMSFNCEditorEditToolBarOption.etoCut in this.FOptions);
        this.FCopy.SetVisible($mod.TTMSFNCEditorEditToolBarOption.etoCopy in this.FOptions);
        this.FPaste.SetVisible($mod.TTMSFNCEditorEditToolBarOption.etoPaste in this.FOptions);
        this.FUndo.SetVisible($mod.TTMSFNCEditorEditToolBarOption.etoUndo in this.FOptions);
        this.FRedo.SetVisible($mod.TTMSFNCEditorEditToolBarOption.etoRedo in this.FOptions);
      };
    };
    this.DoOpenFile = function (AFileName) {
    };
    this.DoSaveFile = function (AFileName) {
    };
    this.DoCut = function () {
    };
    this.DoPaste = function () {
    };
    this.DoUndo = function () {
    };
    this.DoRedo = function () {
    };
    this.DoCopy = function () {
    };
    this.IsCreated = function () {
      var Result = false;
      Result = this.FCreated;
      return Result;
    };
    this.Create$1 = function (AOwner) {
      var res = "";
      $mod.TTMSFNCEditorToolBar.Create$1.apply(this,arguments);
      this.FOptionsMenu.SetShowButton(false);
      this.FOptions = rtl.refSet($mod.AllEditOptions);
      if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
        res = $mod.TMSFNCTOOLBAROPENSVG}
       else res = $mod.TMSFNCTOOLBAROPENSVGWHITE;
      this.FOpen = this.AddButton(24,24,res,"","",-1);
      this.FOpen.SetAllowFocus(false);
      this.FOpen.FAutoOptionsMenuText = "Open";
      this.FOpen.FStored = false;
      this.FOpen.FOnClick = rtl.createCallback(this,"OpenFile");
      if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
        res = $mod.TMSFNCTOOLBARSAVESVG}
       else res = $mod.TMSFNCTOOLBARSAVESVGWHITE;
      this.FSave = this.AddButton(24,24,res,"","",-1);
      this.FSave.SetAllowFocus(false);
      this.FSave.FAutoOptionsMenuText = "Save";
      this.FSave.FStored = false;
      this.FSave.FOnClick = rtl.createCallback(this,"SaveFile");
      this.FSep1 = this.AddSeparator(-1);
      this.FSep1.SetAllowFocus(false);
      this.FSep1.FStored = false;
      this.FSep1.SetHeight(24);
      if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
        res = $mod.TMSFNCTOOLBARCUTSVG}
       else res = $mod.TMSFNCTOOLBARCUTSVGWHITE;
      this.FCut = this.AddButton(24,24,res,"","",-1);
      this.FCut.SetAllowFocus(false);
      this.FCut.FAutoOptionsMenuText = "Cut";
      this.FCut.FStored = false;
      this.FCut.FOnClick = rtl.createCallback(this,"Cut");
      if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
        res = $mod.TMSFNCTOOLBARCOPYSVG}
       else res = $mod.TMSFNCTOOLBARCOPYSVGWHITE;
      this.FCopy = this.AddButton(24,24,res,"","",-1);
      this.FCopy.SetAllowFocus(false);
      this.FCopy.FAutoOptionsMenuText = "Copy";
      this.FCopy.FStored = false;
      this.FCopy.FOnClick = rtl.createCallback(this,"CopyBtn");
      if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
        res = $mod.TMSFNCTOOLBARPASTESVG}
       else res = $mod.TMSFNCTOOLBARPASTESVGWHITE;
      this.FPaste = this.AddButton(24,24,res,"","",-1);
      this.FPaste.SetAllowFocus(false);
      this.FPaste.FAutoOptionsMenuText = "Paste";
      this.FPaste.FStored = false;
      this.FPaste.FOnClick = rtl.createCallback(this,"Paste");
      this.FSep2 = this.AddSeparator(-1);
      this.FSep2.SetAllowFocus(false);
      this.FSep2.FStored = false;
      this.FSep2.SetHeight(24);
      if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
        res = $mod.TMSFNCTOOLBARUNDOSVG}
       else res = $mod.TMSFNCTOOLBARPASTESVGWHITE;
      this.FUndo = this.AddButton(24,24,res,"","",-1);
      this.FUndo.SetAllowFocus(false);
      this.FUndo.FAutoOptionsMenuText = "Undo";
      this.FUndo.FStored = false;
      this.FUndo.FOnClick = rtl.createCallback(this,"Undo");
      if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
        res = $mod.TMSFNCTOOLBARREDOSVG}
       else res = $mod.TMSFNCTOOLBARREDOSVGWHITE;
      this.FRedo = this.AddButton(24,24,res,"","",-1);
      this.FRedo.SetAllowFocus(false);
      this.FRedo.FAutoOptionsMenuText = "Redo";
      this.FRedo.FStored = false;
      this.FRedo.FOnClick = rtl.createCallback(this,"Redo");
      this.FCreated = true;
      return this;
    };
    this.FirstSeparator = function () {
      var Result = null;
      Result = this.FSep1;
      return Result;
    };
    this.SecondSeparator = function () {
      var Result = null;
      Result = this.FSep2;
      return Result;
    };
    this.OpenFileButton = function () {
      var Result = null;
      Result = this.FOpen;
      return Result;
    };
    this.SaveFileButton = function () {
      var Result = null;
      Result = this.FSave;
      return Result;
    };
    this.CutButton = function () {
      var Result = null;
      Result = this.FCut;
      return Result;
    };
    this.CopyButton = function () {
      var Result = null;
      Result = this.FCopy;
      return Result;
    };
    this.PasteButton = function () {
      var Result = null;
      Result = this.FPaste;
      return Result;
    };
    this.RedoButton = function () {
      var Result = null;
      Result = this.FRedo;
      return Result;
    };
    this.UndoButton = function () {
      var Result = null;
      Result = this.FUndo;
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCStylesManager);
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("OnOpenFile",0,pas.Classes.$rtti["TNotifyEvent"],"FOnOpenFile","FOnOpenFile");
    $r.addProperty("OnSaveFile",0,pas.Classes.$rtti["TNotifyEvent"],"FOnSaveFile","FOnSaveFile");
    $r.addProperty("OnCut",0,pas.Classes.$rtti["TNotifyEvent"],"FOnCut","FOnCut");
    $r.addProperty("OnCopy",0,pas.Classes.$rtti["TNotifyEvent"],"FOnCopy","FOnCopy");
    $r.addProperty("OnPaste",0,pas.Classes.$rtti["TNotifyEvent"],"FOnPaste","FOnPaste");
    $r.addProperty("OnRedo",0,pas.Classes.$rtti["TNotifyEvent"],"FOnRedo","FOnRedo");
    $r.addProperty("OnUndo",0,pas.Classes.$rtti["TNotifyEvent"],"FOnUndo","FOnUndo");
    $r.addProperty("Options",2,$mod.$rtti["TTMSFNCEditorEditToolBarOptions"],"FOptions","SetOptions",4,{Default: $mod.AllEditOptions});
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
  $mod.$init = function () {
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARBOLDSVG);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARBOLDSVGWHITE);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARITALICSVG);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARITALICSVGWHITE);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARUNDERLINESVG);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARUNDERLINESVGWHITE);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARSTRIKEOUTSVG);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARSTRIKEOUTSVGWHITE);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARALIGNLEFTSVG);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARALIGNLEFTSVGWHITE);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARALIGNCENTERSVG);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARALIGNCENTERSVGWHITE);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARALIGNRIGHTSVG);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARALIGNRIGHTSVGWHITE);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARIMAGESVG);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARIMAGESVGWHITE);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARINTERNETLINKSVG);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARINTERNETLINKSVGWHITE);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARNUMBERINGSVG);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARNUMBERINGSVGWHITE);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARINDENTDECREASESVG);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARINDENTDECREASESVGWHITE);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARINDENTINCREASESVG);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARINDENTINCREASESVGWHITE);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARCIRCLESVG);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARCIRCLESVGWHITE);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARSQUARESVG);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARSQUARESVGWHITE);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARSTARFULLSVGBLACK);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARSTARFULLSVGWHITE);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARARROWSVG);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARARROWSVGWHITE);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBAROPENSVG);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBAROPENSVGWHITE);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARSAVESVG);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARSAVESVGWHITE);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARCUTSVG);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARCUTSVGWHITE);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARCOPYSVG);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARCOPYSVGWHITE);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARPASTESVG);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARPASTESVGWHITE);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARUNDOSVG);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARUNDOSVGWHITE);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARREDOSVG);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTOOLBARREDOSVGWHITE);
  };
},["WEBLib.TMSFNCUtils","WEBLib.Dialogs","SysUtils","WEBLib.Forms","WEBLib.TMSFNCEditorsTools","UITypes"]);
rtl.module("WEBLib.TMSFNCSplitter",["System","Classes","SysUtils","Types","UITypes","WEBLib.ExtCtrls","WEBLib.Controls","WEBLib.TMSFNCCustomControl","WEBLib.TMSFNCGraphics","WEBLib.TMSFNCTypes","WEBLib.TMSFNCGraphicsTypes","WEBLib.TMSFNCStyles","WEBLib.Graphics","WEBLib.Forms"],function () {
  "use strict";
  var $mod = this;
  this.MAJ_VER = 1;
  this.MIN_VER = 0;
  this.REL_VER = 1;
  this.BLD_VER = 0;
  this.$rtti.$Class("TTMSFNCCustomSplitter");
  this.TTMSFNCSplitterIndicator = {"0": "siCircle", siCircle: 0, "1": "siCircles", siCircles: 1, "2": "siLine", siLine: 2, "3": "siSquare", siSquare: 3, "4": "siSquares", siSquares: 4, "5": "siImage", siImage: 5};
  this.$rtti.$Enum("TTMSFNCSplitterIndicator",{minvalue: 0, maxvalue: 5, ordtype: 1, enumtype: this.TTMSFNCSplitterIndicator});
  this.TTMSFNCSplitterResizeStyle = {"0": "rsOnce", rsOnce: 0, "1": "rsContinuous", rsContinuous: 1};
  this.$rtti.$Enum("TTMSFNCSplitterResizeStyle",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCSplitterResizeStyle});
  rtl.createClass(this,"TTMSFNCCustomSplitterAppearance",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FIndicatorBitmap = null;
      this.FIndicatorDownFill = null;
      this.FIndicatorDownStroke = null;
      this.FIndicatorFill = null;
      this.FIndicatorHoverFill = null;
      this.FIndicatorHoverStroke = null;
      this.FIndicatorMargin = 0;
      this.FIndicatorStroke = null;
      this.FOwner = null;
      this.FSplitterDownFill = null;
      this.FSplitterDownStroke = null;
      this.FSplitterFill = null;
      this.FSplitterHoverFill = null;
      this.FSplitterHoverStroke = null;
      this.FSplitterStroke = null;
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FIndicatorBitmap = undefined;
      this.FIndicatorDownFill = undefined;
      this.FIndicatorDownStroke = undefined;
      this.FIndicatorFill = undefined;
      this.FIndicatorHoverFill = undefined;
      this.FIndicatorHoverStroke = undefined;
      this.FIndicatorStroke = undefined;
      this.FOwner = undefined;
      this.FSplitterDownFill = undefined;
      this.FSplitterDownStroke = undefined;
      this.FSplitterFill = undefined;
      this.FSplitterHoverFill = undefined;
      this.FSplitterHoverStroke = undefined;
      this.FSplitterStroke = undefined;
      this.FOnChange = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetIndicatorBitmap = function (Value) {
      this.FIndicatorBitmap.Assign(Value);
      this.BitmapChanged(this.FIndicatorBitmap);
    };
    this.SetIndicatorDownFill = function (Value) {
      this.FIndicatorDownFill.Assign(Value);
      this.FillChanged(this.FIndicatorDownFill);
    };
    this.SetIndicatorDownStroke = function (Value) {
      this.FIndicatorDownStroke.Assign(Value);
      this.StrokeChanged(this.FIndicatorDownStroke);
    };
    this.SetIndicatorFill = function (Value) {
      this.FIndicatorFill.Assign(Value);
      this.FillChanged(this.FIndicatorFill);
    };
    this.SetIndicatorHoverFill = function (Value) {
      this.FIndicatorHoverFill.Assign(Value);
      this.FillChanged(this.FIndicatorHoverFill);
    };
    this.SetIndicatorHoverStroke = function (Value) {
      this.FIndicatorHoverStroke.Assign(Value);
      this.StrokeChanged(this.FIndicatorHoverStroke);
    };
    this.SetIndicatorMargin = function (Value) {
      if (this.FIndicatorMargin !== Value) {
        this.FIndicatorMargin = Value;
        this.Changed();
      };
    };
    this.SetIndicatorStroke = function (Value) {
      this.FIndicatorStroke.Assign(Value);
      this.StrokeChanged(this.FIndicatorStroke);
    };
    this.SetSplitterDownFill = function (Value) {
      this.FSplitterDownFill.Assign(Value);
      this.FillChanged(this.FSplitterDownFill);
    };
    this.SetSplitterDownStroke = function (Value) {
      this.FSplitterDownStroke.Assign(Value);
      this.StrokeChanged(this.FSplitterDownStroke);
    };
    this.SetSplitterHoverFill = function (Value) {
      this.FSplitterHoverFill.Assign(Value);
      this.FillChanged(this.FSplitterHoverFill);
    };
    this.SetSplitterHoverStroke = function (Value) {
      this.FSplitterHoverStroke.Assign(Value);
      this.StrokeChanged(this.FSplitterHoverStroke);
    };
    this.SetSplitterFill = function (Value) {
      this.FSplitterFill.Assign(Value);
      this.FillChanged(this.FSplitterFill);
    };
    this.SetSplitterStroke = function (Value) {
      this.FSplitterStroke.Assign(Value);
      this.StrokeChanged(this.FSplitterStroke);
    };
    this.Changed = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.BitmapChanged = function (Sender) {
      this.Changed();
    };
    this.FillChanged = function (Sender) {
      this.Changed();
    };
    this.StrokeChanged = function (Sender) {
      this.Changed();
    };
    this.ApplyStyle = function () {
      var c = 0;
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleBackgroundFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FSplitterFill.SetColor(c);
        this.FSplitterHoverFill.SetColor(c);
        this.FSplitterDownFill.SetColor(c);
      };
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleAlternativeBackgroundFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FSplitterDownFill.SetColor(c);
      };
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleDefaultButtonFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FIndicatorFill.SetColor(c);
        this.FIndicatorHoverFill.SetColor(c);
        this.FIndicatorDownFill.SetColor(c);
      };
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleTextFontColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FIndicatorHoverFill.SetColor(c);
        this.FIndicatorDownFill.SetColor(c);
      };
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleSelectionFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FIndicatorHoverFill.SetColor(c);
      };
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleDefaultButtonStrokeColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FIndicatorStroke.SetColor(c);
        this.FIndicatorHoverStroke.SetColor(c);
        this.FIndicatorDownStroke.SetColor(c);
      };
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleBackgroundStrokeColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FSplitterStroke.SetColor(c);
        this.FSplitterHoverStroke.SetColor(c);
        this.FSplitterDownStroke.SetColor(c);
      };
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleLineFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FSplitterHoverStroke.SetColor(c);
      };
    };
    this.ResetToDefaultStyle = function () {
      this.FSplitterFill.SetColor(pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor("#E9E9E9"));
      this.FSplitterStroke.SetColor(11119017);
      this.FSplitterHoverFill.SetColor(pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor("#BBC4CC"));
      this.FSplitterHoverStroke.SetColor(10061943);
      this.FSplitterDownFill.SetColor(pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor("#B8C0C8"));
      this.FSplitterDownStroke.SetColor(9470064);
      this.FIndicatorFill.SetColor(16777215);
      this.FIndicatorStroke.SetColor(8421504);
      this.FIndicatorHoverFill.SetColor(16777215);
      this.FIndicatorHoverStroke.SetColor(8421504);
      this.FIndicatorDownFill.SetColor(pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor("#1BADF8"));
      this.FIndicatorDownStroke.SetColor(8421504);
    };
    this.Create$1 = function (AOwner) {
      this.FOwner = AOwner;
      this.FSplitterFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor("#E9E9E9"),8421504,-1,-1]);
      this.FSplitterFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FSplitterStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,11119017,1.0]);
      this.FSplitterStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FSplitterHoverFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor("#BBC4CC"),8421504,-1,-1]);
      this.FSplitterHoverFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FSplitterHoverStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,10061943,1.0]);
      this.FSplitterHoverStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FSplitterDownFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor("#B8C0C8"),8421504,-1,-1]);
      this.FSplitterDownFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FSplitterDownStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,9470064,1.0]);
      this.FSplitterDownStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FIndicatorMargin = 1;
      this.FIndicatorFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16777215,8421504,-1,-1]);
      this.FIndicatorFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FIndicatorStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,8421504,1.0]);
      this.FIndicatorStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FIndicatorHoverFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16777215,8421504,-1,-1]);
      this.FIndicatorHoverFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FIndicatorHoverStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,8421504,1.0]);
      this.FIndicatorHoverStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FIndicatorDownFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.HTMLToColor("#1BADF8"),8421504,-1,-1]);
      this.FIndicatorDownFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FIndicatorDownStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,8421504,1.0]);
      this.FIndicatorDownStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FIndicatorBitmap = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FSplitterFill");
      rtl.free(this,"FSplitterStroke");
      rtl.free(this,"FSplitterHoverFill");
      rtl.free(this,"FSplitterHoverStroke");
      rtl.free(this,"FSplitterDownFill");
      rtl.free(this,"FSplitterDownStroke");
      rtl.free(this,"FIndicatorFill");
      rtl.free(this,"FIndicatorStroke");
      rtl.free(this,"FIndicatorHoverFill");
      rtl.free(this,"FIndicatorHoverStroke");
      rtl.free(this,"FIndicatorDownFill");
      rtl.free(this,"FIndicatorDownStroke");
      rtl.free(this,"FIndicatorBitmap");
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCCustomSplitterAppearance.isPrototypeOf(Source)) {
        this.SetIndicatorBitmap(rtl.as(Source,$mod.TTMSFNCCustomSplitterAppearance).FIndicatorBitmap);
        this.SetIndicatorFill(rtl.as(Source,$mod.TTMSFNCCustomSplitterAppearance).FIndicatorFill);
        this.SetIndicatorStroke(rtl.as(Source,$mod.TTMSFNCCustomSplitterAppearance).FIndicatorStroke);
        this.SetIndicatorHoverFill(rtl.as(Source,$mod.TTMSFNCCustomSplitterAppearance).FIndicatorHoverFill);
        this.SetIndicatorHoverStroke(rtl.as(Source,$mod.TTMSFNCCustomSplitterAppearance).FIndicatorHoverStroke);
        this.SetIndicatorDownFill(rtl.as(Source,$mod.TTMSFNCCustomSplitterAppearance).FIndicatorDownFill);
        this.SetIndicatorDownStroke(rtl.as(Source,$mod.TTMSFNCCustomSplitterAppearance).FIndicatorDownStroke);
        this.SetIndicatorMargin(rtl.as(Source,$mod.TTMSFNCCustomSplitterAppearance).FIndicatorMargin);
        this.SetSplitterFill(rtl.as(Source,$mod.TTMSFNCCustomSplitterAppearance).FSplitterFill);
        this.SetSplitterStroke(rtl.as(Source,$mod.TTMSFNCCustomSplitterAppearance).FSplitterStroke);
        this.SetSplitterHoverFill(rtl.as(Source,$mod.TTMSFNCCustomSplitterAppearance).FSplitterHoverFill);
        this.SetSplitterHoverStroke(rtl.as(Source,$mod.TTMSFNCCustomSplitterAppearance).FSplitterHoverStroke);
        this.SetSplitterDownFill(rtl.as(Source,$mod.TTMSFNCCustomSplitterAppearance).FSplitterDownFill);
        this.SetSplitterDownStroke(rtl.as(Source,$mod.TTMSFNCCustomSplitterAppearance).FSplitterDownStroke);
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
  });
  rtl.createClass(this,"TTMSFNCSplitterAppearance",this.TTMSFNCCustomSplitterAppearance,function () {
    var $r = this.$rtti;
    $r.addProperty("IndicatorBitmap",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FIndicatorBitmap","SetIndicatorBitmap");
    $r.addProperty("IndicatorDownFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FIndicatorDownFill","SetIndicatorDownFill");
    $r.addProperty("IndicatorDownStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FIndicatorDownStroke","SetIndicatorDownStroke");
    $r.addProperty("IndicatorFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FIndicatorFill","SetIndicatorFill");
    $r.addProperty("IndicatorHoverFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FIndicatorHoverFill","SetIndicatorHoverFill");
    $r.addProperty("IndicatorHoverStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FIndicatorHoverStroke","SetIndicatorHoverStroke");
    $r.addProperty("IndicatorMargin",2,rtl.longint,"FIndicatorMargin","SetIndicatorMargin",4,{Default: 1});
    $r.addProperty("IndicatorStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FIndicatorStroke","SetIndicatorStroke");
    $r.addProperty("SplitterDownFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FSplitterDownFill","SetSplitterDownFill");
    $r.addProperty("SplitterDownStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FSplitterDownStroke","SetSplitterDownStroke");
    $r.addProperty("SplitterFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FSplitterFill","SetSplitterFill");
    $r.addProperty("SplitterHoverFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FSplitterHoverFill","SetSplitterHoverFill");
    $r.addProperty("SplitterHoverStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FSplitterHoverStroke","SetSplitterHoverStroke");
    $r.addProperty("SplitterStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FSplitterStroke","SetSplitterStroke");
  });
  rtl.createClass(this,"TTMSFNCSplitterCache",pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$init.call(this);
      this.FSplitter = null;
    };
    this.$final = function () {
      this.FSplitter = undefined;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$final.call(this);
    };
    this.Draw = function (AGraphics, ARect) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Draw.apply(this,arguments);
      if (this.FSplitter != null) {
        if (this.FSplitter.FAppearance.FSplitterDownFill.FKind !== pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone) {
          AGraphics.FFill.Assign(this.FSplitter.FAppearance.FSplitterDownFill)}
         else {
          AGraphics.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
          AGraphics.FFill.SetColor(8421504);
        };
        AGraphics.FStroke.Assign(this.FSplitter.FAppearance.FSplitterDownStroke);
        AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
      };
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.$rtti.$MethodVar("TTMSFNCSplitterMoveEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AResizeStyle",this.$rtti["TTMSFNCSplitterResizeStyle"]],["ADownPos",pas["WEBLib.TMSFNCTypes"].$rtti["TPointF"]],["ACurrentPos",pas["WEBLib.TMSFNCTypes"].$rtti["TPointF"]],["ASplit",rtl.double]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCSplitterAfterDrawIndicatorEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["AIndicator",this.$rtti["TTMSFNCSplitterIndicator"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AResizeStyle",this.$rtti["TTMSFNCSplitterResizeStyle"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCSplitterBeforeDrawIndicatorEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["AIndicator",this.$rtti["TTMSFNCSplitterIndicator"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AResizeStyle",this.$rtti["TTMSFNCSplitterResizeStyle"]],["AAllow",rtl.boolean,1],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCCustomSplitter",pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$init.call(this);
      this.FAppearance = null;
      this.FCache = null;
      this.FControl = null;
      this.FDownPos = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      this.FMaxSize = 0.0;
      this.FMinSize = 0.0;
      this.FMouseDown = false;
      this.FMouseHover = false;
      this.FNewSize = 0.0;
      this.FOldSize = 0.0;
      this.FShowIndicator = false;
      this.FSplit = 0.0;
      this.FSplitterIndicator = 0;
      this.FResizeStyle = 0;
      this.FOnAppearanceChanged = null;
      this.FOnAfterDrawIndicator = null;
      this.FOnBeforeDrawIndicator = null;
      this.FOnChanged = null;
      this.FOnSplitterMove = null;
      this.FOnSplitterMoved = null;
    };
    this.$final = function () {
      this.FAppearance = undefined;
      this.FCache = undefined;
      this.FControl = undefined;
      this.FDownPos = undefined;
      this.FOnAppearanceChanged = undefined;
      this.FOnAfterDrawIndicator = undefined;
      this.FOnBeforeDrawIndicator = undefined;
      this.FOnChanged = undefined;
      this.FOnSplitterMove = undefined;
      this.FOnSplitterMoved = undefined;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$final.call(this);
    };
    this.AppearanceChanged = function (Sender) {
      this.Invalidate();
      this.DoAppearanceChanged(Sender);
    };
    this.CalcSplitSize = function (X, Y, NewSize, Split) {
      var S = 0.0;
      if (this.GetSplitterAlign() in rtl.createSet(pas["WEBLib.Controls"].TAlign.alLeft,pas["WEBLib.Controls"].TAlign.alRight)) {
        Split.set(X - this.FDownPos.X)}
       else Split.set(Y - this.FDownPos.Y);
      S = 0;
      var $tmp = this.GetSplitterAlign();
      if ($tmp === pas["WEBLib.Controls"].TAlign.alLeft) {
        S = this.FControl.GetWidth() + Split.get()}
       else if ($tmp === pas["WEBLib.Controls"].TAlign.alRight) {
        S = this.FControl.GetWidth() - Split.get()}
       else if ($tmp === pas["WEBLib.Controls"].TAlign.alTop) {
        S = this.FControl.GetHeight() + Split.get()}
       else if ($tmp === pas["WEBLib.Controls"].TAlign.alBottom) S = this.FControl.GetHeight() - Split.get();
      NewSize.set(S);
      if (S < this.FMinSize) {
        NewSize.set(this.FMinSize)}
       else if (S > this.FMaxSize) NewSize.set(this.FMaxSize);
      if (S !== NewSize.get()) {
        if (this.GetSplitterAlign() in rtl.createSet(pas["WEBLib.Controls"].TAlign.alBottom,pas["WEBLib.Controls"].TAlign.alRight)) {
          S = S - NewSize.get()}
         else S = NewSize.get() - S;
        Split.set(Split.get() + S);
      };
    };
    this.DrawIndicatorCircle = function (AGraphics, ARect) {
      var rect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var b = false;
      var df = false;
      rect.$assign(this.GetDrawingRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect)));
      b = true;
      df = true;
      this.DoBeforeDrawIndicator(AGraphics,this.FSplitterIndicator,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rect),this.FResizeStyle,{get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }},{get: function () {
          return df;
        }, set: function (v) {
          df = v;
        }});
      if (b) {
        if (df) AGraphics.DrawEllipse$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rect),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        this.DoAfterDrawIndicator(AGraphics,this.FSplitterIndicator,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rect),this.FResizeStyle);
      };
    };
    this.DrawIndicatorCircles = function (AGraphics, ARect) {
      var rect1 = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rect2 = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rect3 = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var b = false;
      var df = false;
      this.GetDrawingRects(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),rect1,rect2,rect3);
      b = true;
      df = true;
      this.DoBeforeDrawIndicator(AGraphics,this.FSplitterIndicator,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(rect1.Left,rect1.Top,rect3.Right,rect3.Bottom)),this.FResizeStyle,{get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }},{get: function () {
          return df;
        }, set: function (v) {
          df = v;
        }});
      if (b) {
        if (df) {
          AGraphics.DrawEllipse$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rect1),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
          AGraphics.DrawEllipse$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rect2),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
          AGraphics.DrawEllipse$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rect3),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        };
        this.DoAfterDrawIndicator(AGraphics,this.FSplitterIndicator,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(rect1.Left,rect1.Top,rect3.Right,rect3.Bottom)),this.FResizeStyle);
      };
    };
    this.DrawIndicatorImage = function (AGraphics, ARect) {
      var x = 0.0;
      var y = 0.0;
      var rect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var b = false;
      var df = false;
      if ((this.FAppearance.FIndicatorBitmap != null) && !pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(this.FAppearance.FIndicatorBitmap)) {
        x = (this.GetWidth() - this.FAppearance.FIndicatorBitmap.GetWidth()) / 2;
        y = (this.GetHeight() - this.FAppearance.FIndicatorBitmap.GetHeight()) / 2;
        rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(x,y,x + this.FAppearance.FIndicatorBitmap.GetWidth(),y + this.FAppearance.FIndicatorBitmap.GetHeight()));
        b = true;
        df = true;
        this.DoBeforeDrawIndicator(AGraphics,this.FSplitterIndicator,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rect),this.FResizeStyle,{get: function () {
            return b;
          }, set: function (v) {
            b = v;
          }},{get: function () {
            return df;
          }, set: function (v) {
            df = v;
          }});
        if (b) {
          if (df) AGraphics.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rect),this.FAppearance.FIndicatorBitmap,true,false,true,false);
          this.DoAfterDrawIndicator(AGraphics,this.FSplitterIndicator,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rect),this.FResizeStyle);
        };
      };
    };
    this.DrawIndicatorLine = function (AGraphics, ARect) {
      var s = 0.0;
      var p1 = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var p2 = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var b = false;
      var df = false;
      s = this.ScalePaintValue(10);
      if (this.GetSplitterAlign() in rtl.createSet(pas["WEBLib.Controls"].TAlign.alLeft,pas["WEBLib.Controls"].TAlign.alRight)) {
        p1.$assign(pas["WEBLib.TMSFNCTypes"].PointF(this.GetWidth() / 2,(this.GetHeight() / 2) + s));
        p2.$assign(pas["WEBLib.TMSFNCTypes"].PointF(this.GetWidth() / 2,(this.GetHeight() / 2) - s));
      } else {
        p1.$assign(pas["WEBLib.TMSFNCTypes"].PointF((this.GetWidth() / 2) + s,this.GetHeight() / 2));
        p2.$assign(pas["WEBLib.TMSFNCTypes"].PointF((this.GetWidth() / 2) - s,this.GetHeight() / 2));
      };
      b = true;
      df = true;
      this.DoBeforeDrawIndicator(AGraphics,this.FSplitterIndicator,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(p1.X,p1.Y,p2.X,p2.Y)),this.FResizeStyle,{get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }},{get: function () {
          return df;
        }, set: function (v) {
          df = v;
        }});
      if (b) {
        if (df) AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(p1),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(p2),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
        this.DoAfterDrawIndicator(AGraphics,this.FSplitterIndicator,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(p1.X,p1.Y,p2.X,p2.Y)),this.FResizeStyle);
      };
    };
    this.DrawIndicatorSquare = function (AGraphics, ARect) {
      var rect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var b = false;
      var df = false;
      rect.$assign(this.GetDrawingRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect)));
      b = true;
      df = true;
      this.DoBeforeDrawIndicator(AGraphics,this.FSplitterIndicator,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rect),this.FResizeStyle,{get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }},{get: function () {
          return df;
        }, set: function (v) {
          df = v;
        }});
      if (b) {
        if (df) AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rect),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        this.DoAfterDrawIndicator(AGraphics,this.FSplitterIndicator,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rect),this.FResizeStyle);
      };
    };
    this.DrawIndicatorSquares = function (AGraphics, ARect) {
      var rect1 = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rect2 = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rect3 = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var b = false;
      var df = false;
      this.GetDrawingRects(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),rect1,rect2,rect3);
      b = true;
      df = true;
      this.DoBeforeDrawIndicator(AGraphics,this.FSplitterIndicator,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(rect1.Left,rect1.Top,rect3.Right,rect3.Bottom)),this.FResizeStyle,{get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }},{get: function () {
          return df;
        }, set: function (v) {
          df = v;
        }});
      if (b) {
        if (df) {
          AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rect1),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
          AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rect2),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
          AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rect3),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        };
        this.DoAfterDrawIndicator(AGraphics,this.FSplitterIndicator,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(rect1.Left,rect1.Top,rect3.Right,rect3.Bottom)),this.FResizeStyle);
      };
    };
    this.DrawLine = function () {
      if (!(this.FCache != null)) {
        this.FCache = $mod.TTMSFNCSplitterCache.$create("Create$1",[this]);
        this.FCache.FSplitter = this;
      };
      this.FCache.SetBoundsRect(this.GetBoundsRect());
      if (this.GetSplitterAlign() in rtl.createSet(pas["WEBLib.Controls"].TAlign.alLeft,pas["WEBLib.Controls"].TAlign.alRight)) {
        this.FCache.SetLeft(this.GetLeft() + Math.round(this.FSplit));
      } else {
        this.FCache.SetTop(this.GetTop() + Math.round(this.FSplit));
      };
      this.FCache.SetParent(this.FParent);
    };
    this.GetDrawingRect = function (ARect) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var s = 0.0;
      var w = 0.0;
      var h = 0.0;
      var im = 0.0;
      im = this.FAppearance.FIndicatorMargin;
      w = Math.max(this.GetWidth() - (2 * im),1);
      h = Math.max(this.GetHeight() - (2 * im),1);
      s = Math.min(w,h);
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARect.Left + im + ((w - s) / 2),ARect.Top + im + ((h - s) / 2),ARect.Left + im + ((w + s) / 2),ARect.Top + im + ((h + s) / 2)));
      return Result;
    };
    this.GetDrawingRects = function (ARect, ARect1, ARect2, ARect3) {
      var s = 0.0;
      var w = 0.0;
      var h = 0.0;
      var im = 0.0;
      im = this.FAppearance.FIndicatorMargin;
      w = this.GetWidth() - (2 * im);
      h = this.GetHeight() - (2 * im);
      s = Math.min(w,h);
      if (this.GetSplitterAlign() in rtl.createSet(pas["WEBLib.Controls"].TAlign.alLeft,pas["WEBLib.Controls"].TAlign.alRight)) {
        ARect2.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARect.Left + im + ((w - s) / 2),ARect.Top + im + ((h - s) / 2),ARect.Left + im + ((w + s) / 2),ARect.Top + im + ((h + s) / 2)));
        ARect1.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARect.Left + im + ((w - s) / 2),(ARect.Top + im + ((h - s) / 2)) - s - this.ScalePaintValue(2),ARect.Left + im + ((w + s) / 2),(ARect.Top + im + ((h + s) / 2)) - s - this.ScalePaintValue(2)));
        ARect3.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARect.Left + im + ((w - s) / 2),ARect.Top + im + ((h - s) / 2) + s + this.ScalePaintValue(2),ARect.Left + im + ((w + s) / 2),ARect.Top + im + ((h + s) / 2) + s + this.ScalePaintValue(2)));
      } else {
        ARect2.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARect.Left + im + ((w - s) / 2),ARect.Top + im + ((h - s) / 2),ARect.Left + im + ((w + s) / 2),ARect.Top + im + ((h + s) / 2)));
        ARect1.$assign(pas["WEBLib.TMSFNCTypes"].RectF((ARect.Left + im + ((w - s) / 2)) - s - this.ScalePaintValue(2),ARect.Top + im + ((h - s) / 2),(ARect.Left + im + ((w + s) / 2)) - s - this.ScalePaintValue(2),ARect.Top + im + ((h + s) / 2)));
        ARect3.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARect.Left + im + ((w - s) / 2) + s + this.ScalePaintValue(2),ARect.Top + im + ((h - s) / 2),ARect.Left + im + ((w + s) / 2) + s + this.ScalePaintValue(2),ARect.Top + im + ((h + s) / 2)));
      };
    };
    this.SetAppearance = function (Value) {
      this.FAppearance.Assign(Value);
    };
    this.SetMinSize = function (Value) {
      if ((this.FMinSize !== Value) && (Value >= 0)) {
        this.FMinSize = Value;
        this.DoChanged();
      };
    };
    this.SetShowIndicator = function (Value) {
      if (this.FShowIndicator !== Value) {
        this.FShowIndicator = Value;
        this.DoChanged();
      };
    };
    this.SetSplitterIndicator = function (Value) {
      if (this.FSplitterIndicator !== Value) {
        this.FSplitterIndicator = Value;
        this.DoChanged();
      };
    };
    this.SetResizeStyle = function (Value) {
      if (this.FResizeStyle !== Value) {
        this.FResizeStyle = Value;
        this.DoChanged();
      };
    };
    this.ApplyStyle = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ApplyStyle.call(this);
      this.FAppearance.ApplyStyle();
    };
    this.ResetToDefaultStyle = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ResetToDefaultStyle.call(this);
      this.FAppearance.ResetToDefaultStyle();
    };
    this.ChangeDPIScale = function (M, D) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ChangeDPIScale.apply(this,arguments);
      this.BeginUpdate();
      this.FMinSize = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FMinSize,M,D);
      this.FAppearance.FIndicatorMargin = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FAppearance.FIndicatorMargin,M,D);
      this.EndUpdate();
    };
    this.DoAppearanceChanged = function (Sender) {
      if (this.FOnAppearanceChanged != null) this.FOnAppearanceChanged(this);
    };
    this.DoAfterDrawIndicator = function (AGraphics, AIndicator, ARect, AResizeStyle) {
      if (this.FOnAfterDrawIndicator != null) this.FOnAfterDrawIndicator(this,AGraphics,AIndicator,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AResizeStyle);
    };
    this.DoBeforeDrawIndicator = function (AGraphics, AIndicator, ARect, AResizeStyle, AAllow, ADefaultDraw) {
      if (this.FOnBeforeDrawIndicator != null) this.FOnBeforeDrawIndicator(this,AGraphics,AIndicator,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AResizeStyle,AAllow,ADefaultDraw);
    };
    this.DoSplitterMove = function (AResizeStyle, ADownPos, ACurrentPos, ASplit) {
      if (this.FOnSplitterMove != null) this.FOnSplitterMove(this,AResizeStyle,pas["WEBLib.TMSFNCTypes"].TPointF.$clone(ADownPos),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(ACurrentPos),ASplit);
    };
    this.DoSplitterMoved = function (AResizeStyle, ADownPos, ACurrentPos, ASplit) {
      if (this.FOnSplitterMoved != null) this.FOnSplitterMoved(this,AResizeStyle,pas["WEBLib.TMSFNCTypes"].TPointF.$clone(ADownPos),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(ACurrentPos),ASplit);
    };
    this.DoCanResize = function (NewSize) {
      var Result = false;
      Result = true;
      if (NewSize.get() <= this.FMinSize) NewSize.set(this.FMinSize);
      return Result;
    };
    this.DoChanged = function () {
      this.Invalidate();
      if (this.FOnChanged != null) this.FOnChanged(this);
    };
    this.DrawBackGroundColor = function (AGraphics, ARect) {
      if (this.FMouseDown && !(this.FResizeStyle === $mod.TTMSFNCSplitterResizeStyle.rsOnce)) {
        AGraphics.FFill.Assign(this.FAppearance.FSplitterDownFill);
        AGraphics.FStroke.Assign(this.FAppearance.FSplitterDownStroke);
      } else if (this.FMouseHover) {
        AGraphics.FFill.Assign(this.FAppearance.FSplitterHoverFill);
        AGraphics.FStroke.Assign(this.FAppearance.FSplitterHoverStroke);
      } else {
        AGraphics.FFill.Assign(this.FAppearance.FSplitterFill);
        AGraphics.FStroke.Assign(this.FAppearance.FSplitterStroke);
      };
      AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
    };
    this.DrawIndicator = function (AGraphics, ARect) {
      if (this.FShowIndicator) {
        if (this.FMouseDown) {
          AGraphics.FFill.Assign(this.FAppearance.FIndicatorDownFill);
          AGraphics.FStroke.Assign(this.FAppearance.FIndicatorDownStroke);
        } else if (this.FMouseHover) {
          AGraphics.FFill.Assign(this.FAppearance.FIndicatorHoverFill);
          AGraphics.FStroke.Assign(this.FAppearance.FIndicatorHoverStroke);
        } else {
          AGraphics.FFill.Assign(this.FAppearance.FIndicatorFill);
          AGraphics.FStroke.Assign(this.FAppearance.FIndicatorStroke);
        };
        var $tmp = this.FSplitterIndicator;
        if ($tmp === $mod.TTMSFNCSplitterIndicator.siCircle) {
          this.DrawIndicatorCircle(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect))}
         else if ($tmp === $mod.TTMSFNCSplitterIndicator.siCircles) {
          this.DrawIndicatorCircles(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect))}
         else if ($tmp === $mod.TTMSFNCSplitterIndicator.siImage) {
          this.DrawIndicatorImage(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect))}
         else if ($tmp === $mod.TTMSFNCSplitterIndicator.siLine) {
          this.DrawIndicatorLine(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect))}
         else if ($tmp === $mod.TTMSFNCSplitterIndicator.siSquare) {
          this.DrawIndicatorSquare(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect))}
         else if ($tmp === $mod.TTMSFNCSplitterIndicator.siSquares) this.DrawIndicatorSquares(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect));
      };
    };
    this.FindControl = function () {
      var Result = null;
      var P = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var i = 0;
      var R = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var IsHorAlign = false;
      var IsVerAlign = false;
      Result = null;
      P.$assign(pas["WEBLib.TMSFNCTypes"].PointF(this.GetLeft(),this.GetTop()));
      var $tmp = this.GetSplitterAlign();
      if ($tmp === pas["WEBLib.Controls"].TAlign.alLeft) {
        P.X = P.X - 1}
       else if ($tmp === pas["WEBLib.Controls"].TAlign.alRight) {
        P.X = P.X + this.GetWidth()}
       else if ($tmp === pas["WEBLib.Controls"].TAlign.alTop) {
        P.Y = P.Y - 1}
       else if ($tmp === pas["WEBLib.Controls"].TAlign.alBottom) {
        P.Y = P.Y + this.GetHeight()}
       else {
        return Result;
      };
      if (this.FParent !== null) {
        IsVerAlign = this.GetSplitterAlign() in rtl.createSet(pas["WEBLib.Controls"].TAlign.alTop,pas["WEBLib.Controls"].TAlign.alBottom);
        IsHorAlign = this.GetSplitterAlign() in rtl.createSet(pas["WEBLib.Controls"].TAlign.alLeft,pas["WEBLib.Controls"].TAlign.alRight);
        for (var $l = 0, $end = this.FParent.GetControlsCount() - 1; $l <= $end; $l++) {
          i = $l;
          Result = this.FParent.GetControls(i);
          if (IsHorAlign && !(Result.FAlign in rtl.createSet(pas["WEBLib.Controls"].TAlign.alLeft,pas["WEBLib.Controls"].TAlign.alRight))) continue;
          if (IsVerAlign && !(Result.FAlign in rtl.createSet(pas["WEBLib.Controls"].TAlign.alTop,pas["WEBLib.Controls"].TAlign.alBottom))) continue;
          if (Result.FVisible) {
            R.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Result.GetBoundsRect().Left,Result.GetBoundsRect().Top,Result.GetBoundsRect().Right,Result.GetBoundsRect().Bottom));
            if ((R.Right - R.Left) === 0) {
              if (this.GetSplitterAlign() in rtl.createSet(pas["WEBLib.Controls"].TAlign.alTop,pas["WEBLib.Controls"].TAlign.alLeft)) {
                R.Left = R.Left - 1}
               else R.Right = R.Right + 1;
            };
            if ((R.Bottom - R.Top) === 0) {
              if (this.GetSplitterAlign() in rtl.createSet(pas["WEBLib.Controls"].TAlign.alTop,pas["WEBLib.Controls"].TAlign.alLeft)) {
                R.Top = R.Top - 1}
               else R.Bottom = R.Bottom + 1;
            };
            if (pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.PointInRect(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(P),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(R))) return Result;
          };
        };
      };
      Result = null;
      return Result;
    };
    this.HandleMouseDown = function (Button, Shift, X, Y) {
      var i = 0;
      var SideControl = null;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseDown.apply(this,arguments);
      this.CaptureEx();
      if ((Button === pas["WEBLib.Controls"].TMouseButton.mbLeft) && (this.FParent != null)) {
        this.FDownPos.$assign(pas["WEBLib.TMSFNCTypes"].PointF(X,Y));
        this.FControl = this.FindControl();
        if (this.FControl !== null) {
          if (this.GetSplitterAlign() in rtl.createSet(pas["WEBLib.Controls"].TAlign.alRight,pas["WEBLib.Controls"].TAlign.alLeft)) {
            this.FMaxSize = this.FParent.GetClientWidth() - this.FMinSize;
            for (var $l = 0, $end = this.FParent.GetControlsCount() - 1; $l <= $end; $l++) {
              i = $l;
              if (!pas["WEBLib.Controls"].TControl.isPrototypeOf(this.FParent.GetControls(i))) continue;
              SideControl = this.FParent.GetControls(i);
              if (SideControl.FVisible && (SideControl.FAlign in rtl.createSet(pas["WEBLib.Controls"].TAlign.alLeft,pas["WEBLib.Controls"].TAlign.alRight))) {
                this.FMaxSize = this.FMaxSize - SideControl.GetWidth();
              };
            };
            this.FMaxSize = this.FMaxSize + this.FControl.GetWidth();
          } else {
            this.FMaxSize = this.FParent.GetClientHeight() - this.FMinSize;
            for (var $l1 = 0, $end1 = this.FParent.GetControlsCount() - 1; $l1 <= $end1; $l1++) {
              i = $l1;
              if (!pas["WEBLib.Controls"].TControl.isPrototypeOf(this.FParent.GetControls(i))) continue;
              SideControl = this.FParent.GetControls(i);
              if (SideControl.FVisible && (SideControl.FAlign in rtl.createSet(pas["WEBLib.Controls"].TAlign.alTop,pas["WEBLib.Controls"].TAlign.alBottom))) {
                this.FMaxSize = this.FMaxSize - SideControl.GetHeight();
              };
            };
            this.FMaxSize = this.FMaxSize + this.FControl.GetHeight();
          };
          this.UpdateSplitterSize(X,Y);
        };
        if (this.FResizeStyle === $mod.TTMSFNCSplitterResizeStyle.rsOnce) this.DrawLine();
        this.FMouseDown = true;
        this.Invalidate();
      };
    };
    this.HandleMouseEnter = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseEnter.call(this);
      this.FMouseHover = true;
      this.Invalidate();
    };
    this.HandleMouseLeave = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseLeave.call(this);
      this.FMouseHover = false;
      this.Invalidate();
    };
    this.HandleMouseMove = function (Shift, X, Y) {
      var NewSize = 0.0;
      var Split = 0.0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseMove.apply(this,arguments);
      if (this.FMouseDown && (this.FControl !== null) && this.FControl.FVisible) {
        this.CalcSplitSize(X,Y,{get: function () {
            return NewSize;
          }, set: function (v) {
            NewSize = v;
          }},{get: function () {
            return Split;
          }, set: function (v) {
            Split = v;
          }});
        if (this.DoCanResize({get: function () {
            return NewSize;
          }, set: function (v) {
            NewSize = v;
          }})) {
          this.FNewSize = NewSize;
          this.FSplit = Split;
          this.DoSplitterMove(this.FResizeStyle,pas["WEBLib.TMSFNCTypes"].TPointF.$clone(this.FDownPos),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(X,Y)),this.FSplit);
          if (this.FResizeStyle === $mod.TTMSFNCSplitterResizeStyle.rsContinuous) this.UpdateSplitterControlSize();
          if (this.FResizeStyle === $mod.TTMSFNCSplitterResizeStyle.rsOnce) this.DrawLine();
        };
      };
    };
    this.HandleMouseUp = function (Button, Shift, X, Y) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseUp.apply(this,arguments);
      if (this.FControl != null) {
        this.UpdateSplitterControlSize();
        this.DoSplitterMoved(this.FResizeStyle,pas["WEBLib.TMSFNCTypes"].TPointF.$clone(this.FDownPos),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(X,Y)),this.FSplit);
      };
      if (this.FCache != null) {
        rtl.free(this,"FCache");
        this.FCache = null;
      };
      this.ReleaseCaptureEx();
      this.FMouseDown = false;
      this.FControl = null;
      this.FDownPos.$assign(pas["WEBLib.TMSFNCTypes"].PointF(-1,-1));
      this.Invalidate();
    };
    this.Notification = function (AComponent, Operation) {
      pas["WEBLib.Menus"].TWebCustomControl.Notification.apply(this,arguments);
    };
    this.UpdateSplitterControlSize = function () {
      if (this.FNewSize !== this.FOldSize) {
        var $tmp = this.GetSplitterAlign();
        if ($tmp === pas["WEBLib.Controls"].TAlign.alLeft) {
          this.FControl.SetWidth(Math.round(this.FNewSize));
        } else if ($tmp === pas["WEBLib.Controls"].TAlign.alRight) {
          this.FControl.SetLeft(this.FControl.GetLeft() + (this.FControl.GetWidth() - Math.round(this.FNewSize)));
          this.FControl.SetWidth(Math.round(this.FNewSize));
        } else if ($tmp === pas["WEBLib.Controls"].TAlign.alTop) {
          this.FControl.SetHeight(Math.round(this.FNewSize));
        } else if ($tmp === pas["WEBLib.Controls"].TAlign.alBottom) {
          this.FControl.SetTop(this.FControl.GetTop() + (this.FControl.GetHeight() - Math.round(this.FNewSize)));
          this.FControl.SetHeight(Math.round(this.FNewSize));
        };
      };
      this.FOldSize = this.FNewSize;
    };
    this.UpdateSplitterSize = function (X, Y) {
      this.CalcSplitSize(X,Y,{p: this, get: function () {
          return this.p.FNewSize;
        }, set: function (v) {
          this.p.FNewSize = v;
        }},{p: this, get: function () {
          return this.p.FSplit;
        }, set: function (v) {
          this.p.FSplit = v;
        }});
    };
    this.SetSplitterAlign = function (Value) {
      var s = 0.0;
      s = Math.min(this.GetWidth(),this.GetHeight());
      this.SetAlign(Value);
      if (this.GetSplitterAlign() in rtl.createSet(pas["WEBLib.Controls"].TAlign.alTop,pas["WEBLib.Controls"].TAlign.alBottom)) {
        this.SetControlCursor(15)}
       else this.SetControlCursor(14);
      this.SetBounds(this.GetLeft(),this.GetTop(),Math.round(s),Math.round(s));
    };
    this.GetSplitterAlign = function () {
      var Result = 0;
      Result = this.FAlign;
      return Result;
    };
    this.SetParent = function (Value) {
      pas["WEBLib.Controls"].TControl.SetParent.apply(this,arguments);
      this.SetSplitterAlign(this.GetSplitterAlign());
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Create$1.apply(this,arguments);
      this.FAppearance = $mod.TTMSFNCSplitterAppearance.$create("Create$1",[this]);
      this.FAppearance.FOnChange = rtl.createCallback(this,"AppearanceChanged");
      this.FSplitterIndicator = $mod.TTMSFNCSplitterIndicator.siCircle;
      this.FShowIndicator = true;
      this.FResizeStyle = $mod.TTMSFNCSplitterResizeStyle.rsContinuous;
      this.FMouseHover = false;
      this.FMouseDown = false;
      this.FDownPos.$assign(pas["WEBLib.TMSFNCTypes"].PointF(-1,-1));
      this.FMinSize = 20;
      this.SetWidth(10);
      this.SetHeight(15);
      this.SetAlign(pas["WEBLib.Controls"].TAlign.alLeft);
      this.SetControlCursor(14);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FAppearance");
      if (this.FCache != null) rtl.free(this,"FCache");
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Destroy.call(this);
    };
    this.Draw = function (AGraphics, ARect) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Draw.apply(this,arguments);
      AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
      this.DrawBackGroundColor(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect));
      this.DrawIndicator(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect));
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCSplitter",this.TTMSFNCCustomSplitter,function () {
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",3,pas["WEBLib.Controls"].$rtti["TAlign"],"GetSplitterAlign","SetSplitterAlign");
    $r.addProperty("Appearance",2,$mod.$rtti["TTMSFNCSplitterAppearance"],"FAppearance","SetAppearance");
    $r.addProperty("MinSize",2,rtl.double,"FMinSize","SetMinSize");
    $r.addProperty("ResizeStyle",2,$mod.$rtti["TTMSFNCSplitterResizeStyle"],"FResizeStyle","SetResizeStyle",4,{Default: $mod.TTMSFNCSplitterResizeStyle.rsContinuous});
    $r.addProperty("ShowIndicator",2,rtl.boolean,"FShowIndicator","SetShowIndicator",4,{Default: true});
    $r.addProperty("SplitterIndicator",2,$mod.$rtti["TTMSFNCSplitterIndicator"],"FSplitterIndicator","SetSplitterIndicator",4,{Default: $mod.TTMSFNCSplitterIndicator.siCircle});
    $r.addProperty("OnAppearanceChanged",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnAppearanceChanged","FOnAppearanceChanged");
    $r.addProperty("OnChanged",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChanged","FOnChanged");
    $r.addProperty("OnSplitterMove",0,$mod.$rtti["TTMSFNCSplitterMoveEvent"],"FOnSplitterMove","FOnSplitterMove");
    $r.addProperty("OnSplitterMoved",0,$mod.$rtti["TTMSFNCSplitterMoveEvent"],"FOnSplitterMoved","FOnSplitterMoved");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
},["Math","WEBLib.TMSFNCUtils"]);
rtl.module("WEBLib.TMSFNCTabSet",["System","Classes","Types","WEBLib.TMSFNCPersistence","WEBLib.TMSFNCCustomControl","WEBLib.TMSFNCBitmapContainer","WEBLib.TMSFNCPopup","WEBLib.TMSFNCGraphics","WEBLib.TMSFNCTypes","WEBLib.Controls","WEBLib.ExtCtrls","WEBLib.StdCtrls","WEBLib.TMSFNCGraphicsTypes"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.MAJ_VER = 1;
  this.MIN_VER = 0;
  this.REL_VER = 1;
  this.BLD_VER = 1;
  this.TMSFNCTABSETLISTSVG = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHhtbG5zPSJodHRw" + "Oi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggc3Ryb2tlPSJjdXJyZW50Q29sb3IiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb" + "2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIiBkPSJtMTcgMTAtNSA1LTUtNSIgZmlsbD0ibm9uZSIvPjwvc3ZnPg==";
  this.TMSFNCTABSETCLOSESVG = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHhtbG5zPSJodHRw" + "Oi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgZmlsbD0ibm9uZSI+PHBhdGggc3Ryb2tlPSJjdXJyZW50Q29sb3IiIHN0cm9rZS1saW5lY2Fw" + "PSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIiBkPSJNMTIgMTIgNyA3bTUgNSA1IDVtLTUtNSA1" + "LTVtLTUgNS01IDUiLz48L3N2Zz4=";
  this.TMSFNCTABSETADDSVG = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53" + "My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjRweCIgaGVpZ2h0" + "PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSI+CjxnIGlkPSJzdXJmYWNlMSI+CjxwYXRoIHN0eWxlPSIgc3Ry" + "b2tlOm5vbmU7ZmlsbC1ydWxlOm5vbnplcm87ZmlsbDpyZ2IoMCUsMCUsMCUpO2ZpbGwtb3BhY2l0eToxOyIgZD0iTSAxMiA2IEMgMTIu" + "NDE0MDYyIDYgMTIuNzUgNi4zMzU5MzggMTIuNzUgNi43NSBMIDEyLjc1IDExLjI1IEwgMTcuMjUgMTEuMjUgQyAxNy42NjQwNjIgMTEu" + "MjUgMTggMTEuNTg1OTM4IDE4IDEyIEMgMTggMTIuNDE0MDYyIDE3LjY2NDA2MiAxMi43NSAxNy4yNSAxMi43NSBMIDEyLjc1IDEyLjc1" + "IEwgMTIuNzUgMTcuMjUgQyAxMi43NSAxNy42NjQwNjIgMTIuNDE0MDYyIDE4IDEyIDE4IEMgMTEuNTg1OTM4IDE4IDExLjI1IDE3LjY2" + "NDA2MiAxMS4yNSAxNy4yNSBMIDExLjI1IDEyLjc1IEwgNi43NSAxMi43NSBDIDYuMzM1OTM4IDEyLjc1IDYgMTIuNDE0MDYyIDYgMTIg" + "QyA2IDExLjU4NTkzOCA2LjMzNTkzOCAxMS4yNSA2Ljc1IDExLjI1IEwgMTEuMjUgMTEuMjUgTCAxMS4yNSA2Ljc1IEMgMTEuMjUgNi4z" + "MzU5MzggMTEuNTg1OTM4IDYgMTIgNiBaIE0gMTIgNiAiLz4KPC9nPgo8L3N2Zz4K";
  this.TMSFNCTABSETNEXTSVG = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHhtbG5zPSJodHRw" + "Oi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJjdXJyZW50Q29sb3IiIHN0cm9rZS1saW5lY2Fw" + "PSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIiBkPSJtMTAgNyA1IDUtNSA1Ii8+PC9zdmc+";
  this.TMSFNCTABSETPREVIOUSSVG = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHhtbG5zPSJodHRw" + "Oi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJjdXJyZW50Q29sb3IiIHN0cm9rZS1saW5lY2Fw" + "PSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIiBkPSJtMTQgNy01IDUgNSA1Ii8+PC9zdmc+";
  this.TTMSFNCTabSetColorProgress = 0xF8AD1B;
  this.TTMSFNCTabSetColor = 0xF8F7ED;
  this.TTMSFNCTabSetDownColor = 0xEEE3D9;
  this.TTMSFNCTabSetHoverColor = 0xF8EDE3;
  this.$rtti.$Class("TTMSFNCCustomTabSet");
  this.$rtti.$Class("TTMSFNCTabSetTab");
  this.TTMSFNCTabSetTabShape = {"0": "tsRectangle", tsRectangle: 0, "1": "tsPyramidLeft", tsPyramidLeft: 1, "2": "tsPyramidRight", tsPyramidRight: 2, "3": "tsPyramid", tsPyramid: 3, "4": "tsRoundLeft", tsRoundLeft: 4, "5": "tsRoundRight", tsRoundRight: 5, "6": "tsRound", tsRound: 6};
  this.$rtti.$Enum("TTMSFNCTabSetTabShape",{minvalue: 0, maxvalue: 6, ordtype: 1, enumtype: this.TTMSFNCTabSetTabShape});
  this.TTMSFNCTabSetTabKind = {"0": "ttkNormal", ttkNormal: 0, "1": "ttkInsert", ttkInsert: 1};
  this.$rtti.$Enum("TTMSFNCTabSetTabKind",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCTabSetTabKind});
  this.TTMSFNCTabSetTabProgressMode = {"0": "tpmNormal", tpmNormal: 0, "1": "tpmMarquee", tpmMarquee: 1};
  this.$rtti.$Enum("TTMSFNCTabSetTabProgressMode",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCTabSetTabProgressMode});
  this.TTMSFNCTabSetTabProgressKind = {"0": "tpkNone", tpkNone: 0, "1": "tpkCircular", tpkCircular: 1, "2": "tpkRectangular", tpkRectangular: 2};
  this.$rtti.$Enum("TTMSFNCTabSetTabProgressKind",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCTabSetTabProgressKind});
  this.TTMSFNCTabSetTabSizeMode = {"0": "tsmAutoSize", tsmAutoSize: 0, "1": "tsmFixedSize", tsmFixedSize: 1, "2": "tsmFixedSizeAutoShrink", tsmFixedSizeAutoShrink: 2, "3": "tsmAutoTabSize", tsmAutoTabSize: 3};
  this.$rtti.$Enum("TTMSFNCTabSetTabSizeMode",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TTMSFNCTabSetTabSizeMode});
  this.TTMSFNCTabSetLayoutPosition = {"0": "tlpLeft", tlpLeft: 0, "1": "tlpTop", tlpTop: 1, "2": "tlpBottom", tlpBottom: 2, "3": "tlpRight", tlpRight: 3};
  this.$rtti.$Enum("TTMSFNCTabSetLayoutPosition",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TTMSFNCTabSetLayoutPosition});
  this.TTMSFNCTabSetLayoutMultiline = {"0": "tlmNone", tlmNone: 0, "1": "tlmEnabled", tlmEnabled: 1, "2": "tlmEnabledActiveTab", tlmEnabledActiveTab: 2};
  this.$rtti.$Enum("TTMSFNCTabSetLayoutMultiline",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCTabSetLayoutMultiline});
  this.TTMSFNCTabSetTabCloseAction = {"0": "ttcaNone", ttcaNone: 0, "1": "ttcaFree", ttcaFree: 1, "2": "ttcaHide", ttcaHide: 2};
  this.$rtti.$Enum("TTMSFNCTabSetTabCloseAction",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCTabSetTabCloseAction});
  rtl.recNewT(this,"TTMSFNCTabSetDisplayTab",function () {
    this.Tab = null;
    this.TabKind = 0;
    this.First = false;
    this.Last = false;
    this.Index = 0;
    this.Row = 0;
    this.$new = function () {
      var r = Object.create(this);
      r.ContentRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.ProgressRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.CloseButtonRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.Rect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.BitmapRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.TextRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      return r;
    };
    this.$eq = function (b) {
      return (this.Tab === b.Tab) && (this.TabKind === b.TabKind) && (this.First === b.First) && (this.Last === b.Last) && this.ContentRect.$eq(b.ContentRect) && this.ProgressRect.$eq(b.ProgressRect) && this.CloseButtonRect.$eq(b.CloseButtonRect) && this.Rect.$eq(b.Rect) && this.BitmapRect.$eq(b.BitmapRect) && (this.Index === b.Index) && (this.Row === b.Row) && this.TextRect.$eq(b.TextRect);
    };
    this.$assign = function (s) {
      this.Tab = s.Tab;
      this.TabKind = s.TabKind;
      this.First = s.First;
      this.Last = s.Last;
      this.ContentRect.$assign(s.ContentRect);
      this.ProgressRect.$assign(s.ProgressRect);
      this.CloseButtonRect.$assign(s.CloseButtonRect);
      this.Rect.$assign(s.Rect);
      this.BitmapRect.$assign(s.BitmapRect);
      this.Index = s.Index;
      this.Row = s.Row;
      this.TextRect.$assign(s.TextRect);
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCTabSetDisplayTab",{},this);
    $r.addField("Tab",$mod.$rtti["TTMSFNCTabSetTab"]);
    $r.addField("TabKind",$mod.$rtti["TTMSFNCTabSetTabKind"]);
    $r.addField("First",rtl.boolean);
    $r.addField("Last",rtl.boolean);
    $r.addField("ContentRect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]);
    $r.addField("ProgressRect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]);
    $r.addField("CloseButtonRect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]);
    $r.addField("Rect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]);
    $r.addField("BitmapRect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]);
    $r.addField("Index",rtl.longint);
    $r.addField("Row",rtl.longint);
    $r.addField("TextRect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]);
  });
  rtl.createClass(this,"TTMSFNCTabSetDisplayList",pas.Classes.TList,function () {
    this.GetItem = function (Index) {
      var Result = $mod.TTMSFNCTabSetDisplayTab.$new();
      Result.$assign(rtl.getObject(this.Get(Index)));
      return Result;
    };
    this.SetItem = function (Index, Value) {
      var v = $mod.TTMSFNCTabSetDisplayTab.$new();
      v.$assign(Value);
      this.Put(Index,v);
    };
  });
  rtl.createClass(this,"TTMSFNCTabSetInvisibleTabList",pas.Classes.TList,function () {
    this.GetItem = function (Index) {
      var Result = null;
      Result = rtl.getObject(this.Get(Index));
      return Result;
    };
    this.SetItem = function (Index, Value) {
      this.Put(Index,Value);
    };
  });
  rtl.createClass(this,"TTMSFNCTabSetTab",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FAnimMarqueeStartAngle = 0.0;
      this.FAnimMarqueeSweepAngle = 0.0;
      this.FAnimMarqueeSwitch = false;
      this.FTag = 0;
      this.FDataString = "";
      this.FDataObject = null;
      this.FDataInteger = 0;
      this.FTabSet = null;
      this.FText = "";
      this.FDBKey = "";
      this.FDataBoolean = false;
      this.FWordWrapping = false;
      this.FTrimming = 0;
      this.FTextAlign = 0;
      this.FActiveTextColor = 0;
      this.FTextColor = 0;
      this.FDisabledTextColor = 0;
      this.FEnabled = false;
      this.FBitmaps = null;
      this.FDisabledBitmaps = null;
      this.FVisible = false;
      this.FUseDefaultAppearance = false;
      this.FWidth = 0.0;
      this.FHeight = 0.0;
      this.FDisabledColor = 0;
      this.FActiveColor = 0;
      this.FHoverTextColor = 0;
      this.FColor = 0;
      this.FHoverColor = 0;
      this.FDownTextColor = 0;
      this.FDownColor = 0;
      this.FBitmapVisible = false;
      this.FBitmapSize = 0.0;
      this.FTextVisible = false;
      this.FStretchText = false;
      this.FShape = 0;
      this.FProgressColor = 0;
      this.FProgress = 0.0;
      this.FProgressMax = 0.0;
      this.FProgressMode = 0;
      this.FCloseButton = false;
      this.FProgressKind = 0;
      this.FBadge = "";
      this.FBadgeColor = 0;
      this.FBadgeTextColor = 0;
      this.FHint = "";
      this.FDataPointer = null;
      this.FShortCutHint = "";
    };
    this.$final = function () {
      this.FDataObject = undefined;
      this.FTabSet = undefined;
      this.FBitmaps = undefined;
      this.FDisabledBitmaps = undefined;
      pas.Classes.TCollectionItem.$final.call(this);
    };
    this.SetTrimming = function (Value) {
      if (this.FTrimming !== Value) {
        this.FTrimming = Value;
        this.UpdateTab();
      };
    };
    this.SetWordWrapping = function (Value) {
      if (this.FWordWrapping !== Value) {
        this.FWordWrapping = Value;
        this.UpdateTab();
      };
    };
    this.SetTextAlign = function (Value) {
      if (this.FTextAlign !== Value) {
        this.FTextAlign = Value;
        this.UpdateTab();
      };
    };
    this.SetActiveTextColor = function (Value) {
      if (this.FActiveTextColor !== Value) {
        this.FActiveTextColor = Value;
        this.UpdateTab();
      };
    };
    this.SetTextColor = function (Value) {
      if (this.FTextColor !== Value) {
        this.FTextColor = Value;
        this.UpdateTab();
      };
    };
    this.SetDisabledTextColor = function (Value) {
      if (this.FDisabledTextColor !== Value) {
        this.FDisabledTextColor = Value;
        this.UpdateTab();
      };
    };
    this.SetEnabled = function (Value) {
      if (this.FEnabled !== Value) {
        this.FEnabled = Value;
        this.UpdateTab();
      };
    };
    this.SetBitmaps = function (Value) {
      this.FBitmaps.Assign(Value);
    };
    this.SetDisabledBitmaps = function (Value) {
      this.FDisabledBitmaps.Assign(Value);
    };
    this.GetBitmapContainer = function () {
      var Result = null;
      var l = null;
      Result = null;
      l = this.TabSet();
      if (l != null) Result = l.GetBitmapContainer();
      return Result;
    };
    this.SetVisible = function (Value) {
      if (this.FVisible !== Value) {
        this.FVisible = Value;
        this.UpdateTab();
      };
    };
    this.SetUseDefaultAppearance = function (Value) {
      if (this.FUseDefaultAppearance !== Value) {
        this.FUseDefaultAppearance = Value;
        this.UpdateTab();
      };
    };
    this.IsWidthStored = function () {
      var Result = false;
      Result = this.FWidth !== -1;
      return Result;
    };
    this.SetWidth = function (Value) {
      if (this.FWidth !== Value) {
        this.FWidth = Value;
        this.UpdateTab();
      };
    };
    this.SetColor = function (Value) {
      if (this.FColor !== Value) {
        this.FColor = Value;
        this.UpdateTab();
      };
    };
    this.SetDisabledColor = function (Value) {
      if (this.FDisabledColor !== Value) {
        this.FDisabledColor = Value;
        this.UpdateTab();
      };
    };
    this.SetDownColor = function (Value) {
      if (this.FDownColor !== Value) {
        this.FDownColor = Value;
        this.UpdateTab();
      };
    };
    this.SetDownTextColor = function (Value) {
      if (this.FDownTextColor !== Value) {
        this.FDownTextColor = Value;
        this.UpdateTab();
      };
    };
    this.SetHoverColor = function (Value) {
      if (this.FHoverColor !== Value) {
        this.FHoverColor = Value;
        this.UpdateTab();
      };
    };
    this.SetHoverTextColor = function (Value) {
      if (this.FHoverTextColor !== Value) {
        this.FHoverTextColor = Value;
        this.UpdateTab();
      };
    };
    this.SetActiveColor = function (Value) {
      if (this.FActiveColor !== Value) {
        this.FActiveColor = Value;
        this.UpdateTab();
      };
    };
    this.SetBitmapVisible = function (Value) {
      if (this.FBitmapVisible !== Value) {
        this.FBitmapVisible = Value;
        this.UpdateTab();
      };
    };
    this.IsBitmapSizeStored = function () {
      var Result = false;
      Result = this.FBitmapSize !== 24;
      return Result;
    };
    this.SetBitmapSize = function (Value) {
      if (this.FBitmapSize !== Value) {
        this.FBitmapSize = Value;
        this.UpdateTab();
      };
    };
    this.SetTextVisible = function (Value) {
      if (this.FTextVisible !== Value) {
        this.FTextVisible = Value;
        this.UpdateTab();
      };
    };
    this.SetStretchText = function (Value) {
      if (this.FStretchText !== Value) {
        this.FStretchText = Value;
        this.UpdateTab();
      };
    };
    this.SetShape = function (Value) {
      if (this.FShape !== Value) {
        this.FShape = Value;
        this.UpdateTab();
      };
    };
    this.SetProgressColor = function (Value) {
      if (this.FProgressColor !== Value) {
        this.FProgressColor = Value;
        this.UpdateTab();
      };
    };
    this.IsProgressStored = function () {
      var Result = false;
      Result = this.FProgress !== 0;
      return Result;
    };
    this.SetProgress = function (Value) {
      if (this.FProgress !== Value) {
        this.FProgress = Value;
        this.UpdateTab();
      };
    };
    this.IsProgressMaxStored = function () {
      var Result = false;
      Result = this.FProgressMax !== 100;
      return Result;
    };
    this.SetProgressMax = function (Value) {
      if (this.FProgressMax !== Value) {
        this.FProgressMax = Value;
        this.UpdateTab();
      };
    };
    this.SetProgressMode = function (Value) {
      if (this.FProgressMode !== Value) {
        this.FProgressMode = Value;
        if ((this.FProgressMode === $mod.TTMSFNCTabSetTabProgressMode.tpmMarquee) && (this.FProgressKind !== $mod.TTMSFNCTabSetTabProgressKind.tpkNone)) this.FTabSet.StartProgressAnimationTimer();
        this.UpdateTab();
      };
    };
    this.SetCloseButton = function (Value) {
      if (this.FCloseButton !== Value) {
        this.FCloseButton = Value;
        this.UpdateTab();
      };
    };
    this.SetProgressKind = function (Value) {
      if (this.FProgressKind !== Value) {
        this.FProgressKind = Value;
        if ((this.FProgressMode === $mod.TTMSFNCTabSetTabProgressMode.tpmMarquee) && (this.FProgressKind !== $mod.TTMSFNCTabSetTabProgressKind.tpkNone)) this.FTabSet.StartProgressAnimationTimer();
        this.UpdateTab();
      };
    };
    this.SetBadge = function (Value) {
      if (this.FBadge !== Value) {
        this.FBadge = Value;
        this.UpdateTab();
      };
    };
    this.SetBadgeColor = function (Value) {
      if (this.FBadgeColor !== Value) {
        this.FBadgeColor = Value;
        this.UpdateTab();
      };
    };
    this.SetBadgeTextColor = function (Value) {
      if (this.FBadgeTextColor !== Value) {
        this.FBadgeTextColor = Value;
        this.UpdateTab();
      };
    };
    this.SetHint = function (Value) {
      if (this.FHint !== Value) {
        this.FHint = Value;
        this.UpdateTab();
      };
    };
    this.SetText = function (Value) {
      if (this.FText !== Value) {
        this.FText = Value;
        this.UpdateTab();
      };
    };
    this.UpdateTab = function () {
      var l = null;
      l = this.TabSet();
      if (l != null) l.UpdateTabs(false,false);
    };
    this.Changed$1 = function (Sender) {
      this.UpdateTab();
    };
    this.BitmapsChanged = function (Sender) {
      var bmp = null;
      bmp = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.GetScaledBitmap(this.FBitmaps,0,this.GetBitmapContainer());
      this.SetBitmapVisible((bmp != null) && !pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(bmp));
    };
    this.Draw = function (AGraphics, ATab) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (!(this.FTabSet != null) || !(ATab.Tab != null)) return;
      r.$assign(this.GetFixedRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ATab.Rect),$mod.TTMSFNCTabSetDisplayTab.$clone(ATab)));
      if (((r.Right - r.Left) <= 0) || ((r.Bottom - r.Top) <= 0)) return;
      AGraphics.FFont.Assign(this.TabSet().FTabAppearance.FFont);
      if (this.FEnabled) {
        if (ATab.Tab === this.TabSet().FActiveTab) {
          AGraphics.FFill.Assign(this.TabSet().FTabAppearance.FActiveFill);
          AGraphics.FStroke.Assign(this.TabSet().FTabAppearance.FActiveStroke);
        } else if (ATab.Tab === this.TabSet().FDownTab) {
          AGraphics.FFill.Assign(this.TabSet().FTabAppearance.FDownFill);
          AGraphics.FStroke.Assign(this.TabSet().FTabAppearance.FDownStroke);
        } else if (ATab.Tab === this.TabSet().FHoverTab) {
          AGraphics.FFill.Assign(this.TabSet().FTabAppearance.FHoverFill);
          AGraphics.FStroke.Assign(this.TabSet().FTabAppearance.FHoverStroke);
        } else {
          AGraphics.FFill.Assign(this.TabSet().FTabAppearance.FFill);
          AGraphics.FStroke.Assign(this.TabSet().FTabAppearance.FStroke);
        };
      } else {
        AGraphics.FFill.Assign(this.TabSet().FTabAppearance.FDisabledFill);
        AGraphics.FStroke.Assign(this.TabSet().FTabAppearance.FDisabledStroke);
      };
      if (!this.FUseDefaultAppearance) {
        if (this.FEnabled) {
          if (ATab.Tab === this.TabSet().FActiveTab) {
            AGraphics.FFill.SetColor(this.FActiveColor)}
           else if (ATab.Tab === this.TabSet().FDownTab) {
            AGraphics.FFill.SetColor(this.FDownColor)}
           else if (ATab.Tab === this.TabSet().FHoverTab) {
            AGraphics.FFill.SetColor(this.FHoverColor)}
           else AGraphics.FFill.SetColor(this.FColor);
        } else AGraphics.FFill.SetColor(this.FDisabledColor);
      };
      this.DrawBackground(AGraphics,$mod.TTMSFNCTabSetDisplayTab.$clone(ATab));
      this.DrawProgress(AGraphics,$mod.TTMSFNCTabSetDisplayTab.$clone(ATab));
      this.DrawBitmap(AGraphics,$mod.TTMSFNCTabSetDisplayTab.$clone(ATab));
      this.DrawText(AGraphics,$mod.TTMSFNCTabSetDisplayTab.$clone(ATab));
      this.DrawCloseButton(AGraphics,$mod.TTMSFNCTabSetDisplayTab.$clone(ATab));
      this.DrawFocus(AGraphics,$mod.TTMSFNCTabSetDisplayTab.$clone(ATab));
    };
    this.DrawBackground = function (AGraphics, ATab) {
      var pth = null;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var c = false;
      var st = 0;
      if (!(this.FTabSet != null)) return;
      r.$assign(this.GetFixedRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ATab.Rect),$mod.TTMSFNCTabSetDisplayTab.$clone(ATab)));
      if (this.FEnabled) {
        if (ATab.Tab === this.TabSet().FActiveTab) {
          st = $mod.TTMSFNCTabSetTabState.ttsActive}
         else if (ATab.Tab === this.TabSet().FDownTab) {
          st = $mod.TTMSFNCTabSetTabState.ttsDown}
         else if (ATab.Tab === this.TabSet().FHoverTab) {
          st = $mod.TTMSFNCTabSetTabState.ttsHover}
         else st = $mod.TTMSFNCTabSetTabState.ttsNormal;
      } else st = $mod.TTMSFNCTabSetTabState.ttsDisabled;
      c = true;
      this.FTabSet.DoBeforeDrawTabBackground(AGraphics,this.GetIndex(),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),st,{get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }});
      if (c) {
        if (this === this.TabSet().FInsertTab) {
          AGraphics.DrawRoundRectangle$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.TabSet().FButtonAppearance.FRounding,rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll)}
         else {
          pth = this.GetShapePath(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r));
          if (pth != null) {
            AGraphics.DrawPath(pth,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPathDrawMode.pdmPolygon);
            pth = rtl.freeLoc(pth);
          };
        };
        this.FTabSet.DoAfterDrawTabBackground(AGraphics,this.GetIndex(),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),st);
      };
    };
    this.DrawText = function (AGraphics, ATab) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var st = null;
      var ww = false;
      var tr = 0;
      var ha = 0;
      var va = 0;
      var str = "";
      var c = false;
      if (!(this.FTabSet != null)) return;
      if (!this.FTextVisible || (this.FText === "") || (this.FTabSet.FInplaceEditorActive && (this.FTabSet.FUpdateTab.Tab === this))) return;
      r.$assign(ATab.TextRect);
      st = AGraphics.SaveState(false);
      try {
        AGraphics.ClipRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r));
        if (this.FUseDefaultAppearance) {
          ww = this.TabSet().FTabAppearance.FWordWrapping;
          tr = this.TabSet().FTabAppearance.FTrimming;
          ha = this.TabSet().FTabAppearance.FTextAlign;
          if (this.FEnabled) {
            if (this === this.TabSet().FActiveTab) {
              AGraphics.FFont.SetColor(this.TabSet().FTabAppearance.FActiveTextColor)}
             else if (this === this.TabSet().FDownTab) {
              AGraphics.FFont.SetColor(this.TabSet().FTabAppearance.FDownTextColor)}
             else if (this === this.TabSet().FHoverTab) {
              AGraphics.FFont.SetColor(this.TabSet().FTabAppearance.FHoverTextColor)}
             else AGraphics.FFont.SetColor(this.TabSet().FTabAppearance.FTextColor);
          } else AGraphics.FFont.SetColor(this.TabSet().FTabAppearance.FDisabledTextColor);
        } else {
          ww = this.FWordWrapping;
          tr = this.FTrimming;
          ha = this.FTextAlign;
          if (this.FEnabled) {
            if (this === this.TabSet().FActiveTab) {
              AGraphics.FFont.SetColor(this.FActiveTextColor)}
             else if (this === this.TabSet().FDownTab) {
              AGraphics.FFont.SetColor(this.FDownTextColor)}
             else if (this === this.TabSet().FHoverTab) {
              AGraphics.FFont.SetColor(this.FHoverTextColor)}
             else AGraphics.FFont.SetColor(this.FTextColor);
          } else AGraphics.FFont.SetColor(this.FDisabledTextColor);
        };
        va = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
        str = this.FText;
        c = true;
        this.FTabSet.DoBeforeDrawTabText(AGraphics,this.GetIndex(),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),str,{get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }});
        if (c) {
          var $tmp = this.TabSet().FLayout.FPosition;
          if (($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom)) {
            AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),str,ww,ha,va,tr,0,-1,-1,true,false,-1,-1)}
           else if ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) {
            AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),str,ww,ha,va,tr,-90,-1,-1,true,false,-1,-1)}
           else if ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpRight) AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),str,ww,ha,va,tr,90,-1,-1,true,false,-1,-1);
          this.FTabSet.DoAfterDrawTabText(AGraphics,this.GetIndex(),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),str);
        };
      } finally {
        AGraphics.RestoreState(st,false);
      };
    };
    this.DrawFocus = function (AGraphics, ATab) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (!(this.FTabSet != null)) return;
      if (this.FTabSet.FTabAppearance.FShowFocus && this.FTabSet.IsFocused() && (this === this.FTabSet.FFocusedTab)) {
        r.$assign(ATab.ContentRect);
        pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,-1,-1);
        AGraphics.DrawFocusRectangle$3(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FTabSet.FTabAppearance.FFocusBorderColor,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
      };
    };
    this.DrawProgress = function (AGraphics, ATab) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rp = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var c = false;
      if (!(this.FTabSet != null)) return;
      if ((this.FProgressKind !== $mod.TTMSFNCTabSetTabProgressKind.tpkNone) && (((this.FProgress > 0) && (this.FProgressMax > 0) && (this.FProgressMode === $mod.TTMSFNCTabSetTabProgressMode.tpmNormal)) || (this.FProgressMode === $mod.TTMSFNCTabSetTabProgressMode.tpmMarquee))) {
        var $tmp = this.FProgressKind;
        if ($tmp === $mod.TTMSFNCTabSetTabProgressKind.tpkCircular) {
          AGraphics.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
          AGraphics.FStroke.Assign(this.FTabSet.FTabAppearance.FProgressStroke);
          if (!this.FUseDefaultAppearance) AGraphics.FStroke.SetColor(this.FProgressColor);
          AGraphics.FStroke.SetWidth(2);
          r.$assign(ATab.ProgressRect);
          pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,-2,-2);
          c = true;
          this.FTabSet.DoBeforeDrawTabProgress(AGraphics,this.GetIndex(),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FProgressMode,this.FProgressKind,this.FAnimMarqueeStartAngle,this.FAnimMarqueeSweepAngle,this.FProgress,this.FProgressMax,{get: function () {
              return c;
            }, set: function (v) {
              c = v;
            }});
          if (c) {
            var $tmp1 = this.FProgressMode;
            if ($tmp1 === $mod.TTMSFNCTabSetTabProgressMode.tpmNormal) {
              AGraphics.DrawArc(pas["WEBLib.TMSFNCTypes"].CenterPointEx(r),pas["WEBLib.TMSFNCTypes"].PointF((r.Right - r.Left) / 2,(r.Bottom - r.Top) / 2),0,(360 / this.FProgressMax) * this.FProgress)}
             else if ($tmp1 === $mod.TTMSFNCTabSetTabProgressMode.tpmMarquee) AGraphics.DrawArc(pas["WEBLib.TMSFNCTypes"].CenterPointEx(r),pas["WEBLib.TMSFNCTypes"].PointF((r.Right - r.Left) / 2,(r.Bottom - r.Top) / 2),this.FAnimMarqueeStartAngle,this.FAnimMarqueeSweepAngle);
            this.FTabSet.DoAfterDrawTabProgress(AGraphics,this.GetIndex(),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FProgressMode,this.FProgressKind,this.FAnimMarqueeStartAngle,this.FAnimMarqueeSweepAngle,this.FProgress,this.FProgressMax);
          };
        } else if ($tmp === $mod.TTMSFNCTabSetTabProgressKind.tpkRectangular) {
          AGraphics.FFill.Assign(this.FTabSet.FTabAppearance.FProgressFill);
          if (!this.FUseDefaultAppearance) AGraphics.FFill.SetColor(this.FProgressColor);
          AGraphics.FStroke.Assign(this.FTabSet.FTabAppearance.FProgressStroke);
          r.$assign(ATab.ContentRect);
          pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,-4,-4);
          c = true;
          this.FTabSet.DoBeforeDrawTabProgress(AGraphics,this.GetIndex(),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FProgressMode,this.FProgressKind,this.FAnimMarqueeStartAngle,this.FAnimMarqueeSweepAngle,this.FProgress,this.FProgressMax,{get: function () {
              return c;
            }, set: function (v) {
              c = v;
            }});
          if (c) {
            var $tmp2 = this.FTabSet.FLayout.FPosition;
            if (($tmp2 === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp2 === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom)) {
              var $tmp3 = this.FProgressMode;
              if ($tmp3 === $mod.TTMSFNCTabSetTabProgressMode.tpmNormal) {
                rp.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top,r.Left + (((r.Right - r.Left) / this.FProgressMax) * this.FProgress),r.Bottom))}
               else if ($tmp3 === $mod.TTMSFNCTabSetTabProgressMode.tpmMarquee) rp.$assign(pas["WEBLib.TMSFNCTypes"].RectF((r.Left + (((r.Right - r.Left) / 360) * this.FAnimMarqueeSweepAngle)) - 5,r.Top,r.Left + 5 + (((r.Right - r.Left) / 360) * this.FAnimMarqueeSweepAngle),r.Bottom));
              AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rp),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
            } else if ($tmp2 === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) {
              var $tmp4 = this.FProgressMode;
              if ($tmp4 === $mod.TTMSFNCTabSetTabProgressMode.tpmNormal) {
                rp.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Bottom - (((r.Bottom - r.Top) / this.FProgressMax) * this.FProgress),r.Right,r.Bottom))}
               else if ($tmp4 === $mod.TTMSFNCTabSetTabProgressMode.tpmMarquee) rp.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Bottom - (((r.Bottom - r.Top) / 360) * this.FAnimMarqueeSweepAngle),r.Right,r.Bottom));
              AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rp),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
            } else if ($tmp2 === $mod.TTMSFNCTabSetLayoutPosition.tlpRight) {
              var $tmp5 = this.FProgressMode;
              if ($tmp5 === $mod.TTMSFNCTabSetTabProgressMode.tpmNormal) {
                rp.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top,r.Right,r.Bottom - (((r.Bottom - r.Top) / this.FProgressMax) * this.FProgress)))}
               else if ($tmp5 === $mod.TTMSFNCTabSetTabProgressMode.tpmMarquee) rp.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top,r.Right,r.Bottom - (((r.Bottom - r.Top) / 360) * this.FAnimMarqueeSweepAngle)));
              AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rp),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
            };
            this.FTabSet.DoAfterDrawTabProgress(AGraphics,this.GetIndex(),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FProgressMode,this.FProgressKind,this.FAnimMarqueeStartAngle,this.FAnimMarqueeSweepAngle,this.FProgress,this.FProgressMax);
          };
        };
      };
    };
    this.DrawCloseButton = function (AGraphics, ATab) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var sk = 0;
      var cl = 0;
      var c = false;
      var st = 0;
      var paintScale = 0.0;
      if (!(this.FTabSet != null)) return;
      if ((this.TabSet().FOptions.FCloseMode === $mod.TTMSFNCTabSetCloseMode.tcmTab) && this.FCloseButton) {
        r.$assign(ATab.CloseButtonRect);
        r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.System.Int(r.Left),pas.System.Int(r.Top),pas.System.Int(r.Right),pas.System.Int(r.Bottom)));
        if (ATab.Tab === this.TabSet().FDownCloseTab) {
          AGraphics.FFill.Assign(this.TabSet().FTabAppearance.FCloseDownFill);
          AGraphics.FStroke.Assign(this.TabSet().FTabAppearance.FCloseDownStroke);
        } else if (ATab.Tab === this.TabSet().FHoverCloseTab) {
          AGraphics.FFill.Assign(this.TabSet().FTabAppearance.FCloseHoverFill);
          AGraphics.FStroke.Assign(this.TabSet().FTabAppearance.FCloseHoverStroke);
        } else {
          AGraphics.FFill.Assign(this.TabSet().FTabAppearance.FCloseFill);
          AGraphics.FStroke.Assign(this.TabSet().FTabAppearance.FCloseStroke);
        };
        if (ATab.Tab === this.TabSet().FDownCloseTab) {
          st = $mod.TTMSFNCTabSetButtonState.tbsDown}
         else if (ATab.Tab === this.TabSet().FHoverCloseTab) {
          st = $mod.TTMSFNCTabSetButtonState.tbsHover}
         else st = $mod.TTMSFNCTabSetButtonState.tbsNormal;
        c = true;
        this.FTabSet.DoBeforeDrawTabCloseButton(AGraphics,this.GetIndex(),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),st,{get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }});
        if (c) {
          if (AGraphics.FFill.FKind !== pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone) {
            sk = AGraphics.FStroke.FKind;
            cl = AGraphics.FStroke.FColor;
            AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
            AGraphics.FStroke.SetColor(AGraphics.FFill.FColor);
            AGraphics.DrawEllipse$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmNone);
            AGraphics.FStroke.SetKind(sk);
            AGraphics.FStroke.SetColor(cl);
          };
          paintScale = this.FTabSet.FPaintScaleFactor;
          pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,paintScale * -4,paintScale * -4);
          AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Bottom)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmNone,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmNone);
          AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Bottom)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Top)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmNone,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmNone);
          this.FTabSet.DoAfterDrawTabCloseButton(AGraphics,this.GetIndex(),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),st);
        };
      };
    };
    this.DrawBitmap = function (AGraphics, ATab) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var c = false;
      if (!(this.FTabSet != null)) return;
      if (!this.FBitmapVisible) return;
      r.$assign(ATab.BitmapRect);
      c = true;
      this.FTabSet.DoBeforeDrawTabBitmap(AGraphics,this.GetIndex(),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),{get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }});
      if (c) {
        if (this.FEnabled) {
          AGraphics.DrawScaledBitmap(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FBitmaps,0,true,false,true,false)}
         else AGraphics.DrawScaledBitmap(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FDisabledBitmaps,0,true,false,true,false);
        this.FTabSet.DoAfterDrawTabBitmap(AGraphics,this.GetIndex(),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r));
      };
    };
    this.DrawBadge = function (AGraphics, ATab) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var sz = pas["WEBLib.TMSFNCTypes"].TSizeF.$new();
      var s = "";
      var pth = null;
      var rnd = 0.0;
      var c = false;
      if (!(this.FTabSet != null)) return;
      if (this.FBadge === "") return;
      AGraphics.FFont.Assign(this.TabSet().FTabAppearance.FBadgeFont);
      AGraphics.FStroke.Assign(this.TabSet().FTabAppearance.FBadgeStroke);
      AGraphics.FFill.Assign(this.TabSet().FTabAppearance.FBadgeFill);
      if (!this.FUseDefaultAppearance) {
        AGraphics.FFont.SetColor(this.FBadgeTextColor);
        AGraphics.FFill.SetColor(this.FBadgeColor);
      };
      s = this.FBadge;
      sz.$assign(AGraphics.CalculateTextSize$1(s));
      sz.cy = sz.cy + 4;
      sz.cx = Math.max(sz.cy,sz.cx + 6);
      if (this.GetShape() in rtl.createSet($mod.TTMSFNCTabSetTabShape.tsRectangle,$mod.TTMSFNCTabSetTabShape.tsRoundLeft,$mod.TTMSFNCTabSetTabShape.tsRoundRight,$mod.TTMSFNCTabSetTabShape.tsRound)) {
        r.$assign(ATab.Rect)}
       else r.$assign(ATab.ContentRect);
      if ((((r.Right - r.Left) / 3) * 2) < sz.cx) return;
      var $tmp = this.TabSet().FLayout.FPosition;
      if ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) {
        r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.System.Int(r.Right - (sz.cx / 2)),pas.System.Int(r.Top - (sz.cy / 2)),pas.System.Int(r.Right + (sz.cx / 2)),pas.System.Int(r.Top + (sz.cy / 2))))}
       else if ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom) {
        r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.System.Int(r.Right - (sz.cx / 2)),pas.System.Int(r.Bottom - (sz.cy / 2)),pas.System.Int(r.Right + (sz.cx / 2)),pas.System.Int(r.Bottom + (sz.cy / 2))))}
       else if ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) {
        r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.System.Int(r.Left - (sz.cy / 2)),pas.System.Int(r.Top - (sz.cx / 2)),pas.System.Int(r.Left + (sz.cy / 2)),pas.System.Int(r.Top + (sz.cx / 2))))}
       else if ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpRight) r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.System.Int(r.Right - (sz.cy / 2)),pas.System.Int(r.Bottom - (sz.cx / 2)),pas.System.Int(r.Right + (sz.cy / 2)),pas.System.Int(r.Bottom + (sz.cx / 2))));
      c = true;
      this.FTabSet.DoBeforeDrawTabBadge(AGraphics,this.GetIndex(),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),s,{get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }});
      if (c) {
        var $tmp1 = this.TabSet().FLayout.FPosition;
        if (($tmp1 === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp1 === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom)) {
          rnd = (r.Bottom - r.Top) / 2}
         else if (($tmp1 === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) || ($tmp1 === $mod.TTMSFNCTabSetLayoutPosition.tlpRight)) {
          rnd = (r.Right - r.Left) / 2}
         else {
          rnd = 0;
        };
        pth = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPath.$create("Create$1");
        pth.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + rnd,r.Top + rnd),pas["WEBLib.TMSFNCTypes"].PointF(rnd,rnd),180,90);
        pth.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - rnd,r.Top + rnd),pas["WEBLib.TMSFNCTypes"].PointF(rnd,rnd),-90,90);
        pth.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - rnd,r.Bottom - rnd),pas["WEBLib.TMSFNCTypes"].PointF(rnd,rnd),0,90);
        pth.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + rnd,r.Bottom - rnd),pas["WEBLib.TMSFNCTypes"].PointF(rnd,rnd),-270,90);
        pth.ClosePath();
        AGraphics.DrawPath(pth,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPathDrawMode.pdmPolygon);
        var $tmp2 = this.TabSet().FLayout.FPosition;
        if (($tmp2 === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp2 === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom)) {
          AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),s,false,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,true,false,-1,-1)}
         else if ($tmp2 === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) {
          AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),s,false,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,-90,-1,-1,true,false,-1,-1)}
         else if ($tmp2 === $mod.TTMSFNCTabSetLayoutPosition.tlpRight) AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),s,false,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,90,-1,-1,true,false,-1,-1);
        pth = rtl.freeLoc(pth);
        this.FTabSet.DoAfterDrawTabBadge(AGraphics,this.GetIndex(),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),s);
      };
    };
    this.GetInsertShapePath = function (ARect) {
      var Result = null;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rnd = 0.0;
      r.$assign(ARect);
      rnd = this.TabSet().FTabAppearance.FShapeRounding;
      Result = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPath.$create("Create$1");
      Result.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + rnd,r.Top + rnd),pas["WEBLib.TMSFNCTypes"].PointF(rnd,rnd),180,90);
      Result.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - rnd,r.Top + rnd),pas["WEBLib.TMSFNCTypes"].PointF(rnd,rnd),-90,90);
      Result.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - rnd,r.Bottom - rnd),pas["WEBLib.TMSFNCTypes"].PointF(rnd,rnd),0,90);
      Result.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + rnd,r.Bottom - rnd),pas["WEBLib.TMSFNCTypes"].PointF(rnd,rnd),-270,90);
      Result.ClosePath();
      return Result;
    };
    this.GetShapePath = function (ARect) {
      var Result = null;
      var shz = 0.0;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var sh = 0;
      var rnd = 0.0;
      var an = 0.0;
      r.$assign(ARect);
      sh = this.GetShape();
      shz = this.TabSet().FTabAppearance.FShapeSlope;
      if ((shz === 0) && (sh in rtl.createSet($mod.TTMSFNCTabSetTabShape.tsPyramidLeft,$mod.TTMSFNCTabSetTabShape.tsPyramidRight,$mod.TTMSFNCTabSetTabShape.tsPyramid))) sh = $mod.TTMSFNCTabSetTabShape.tsRectangle;
      rnd = this.TabSet().FTabAppearance.FShapeRounding;
      an = 0;
      if (shz > 0) {
        var $tmp = this.TabSet().FLayout.FPosition;
        if (($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom)) {
          an = pas.Math.RadToDeg(Math.asin((r.Bottom - r.Top) / Math.sqrt(Math.pow(r.Bottom - r.Top,2) + Math.pow(shz,2))))}
         else if (($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) || ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpRight)) an = pas.Math.RadToDeg(Math.asin((r.Right - r.Left) / Math.sqrt(Math.pow(r.Right - r.Left,2) + Math.pow(shz,2))));
      };
      var $tmp1 = this.TabSet().FLayout.FPosition;
      if ($tmp1 === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) {
        Result = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPath.$create("Create$1");
        Result.MoveTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Bottom));
        var $tmp2 = sh;
        if (($tmp2 === $mod.TTMSFNCTabSetTabShape.tsRectangle) || ($tmp2 === $mod.TTMSFNCTabSetTabShape.tsPyramidRight) || ($tmp2 === $mod.TTMSFNCTabSetTabShape.tsRoundRight)) {
          Result.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Top))}
         else if (($tmp2 === $mod.TTMSFNCTabSetTabShape.tsPyramidLeft) || ($tmp2 === $mod.TTMSFNCTabSetTabShape.tsPyramid)) {
          Result.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Bottom - rnd),pas["WEBLib.TMSFNCTypes"].PointF(rnd,rnd),-270,-an);
          Result.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + shz + rnd,r.Top + rnd),pas["WEBLib.TMSFNCTypes"].PointF(rnd,rnd),-an - 90,an);
        } else if (($tmp2 === $mod.TTMSFNCTabSetTabShape.tsRoundLeft) || ($tmp2 === $mod.TTMSFNCTabSetTabShape.tsRound)) {
          Result.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Top + rnd));
          Result.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + rnd,r.Top + rnd),pas["WEBLib.TMSFNCTypes"].PointF(rnd,rnd),180,90);
        };
        var $tmp3 = sh;
        if (($tmp3 === $mod.TTMSFNCTabSetTabShape.tsRectangle) || ($tmp3 === $mod.TTMSFNCTabSetTabShape.tsPyramidLeft) || ($tmp3 === $mod.TTMSFNCTabSetTabShape.tsRoundLeft)) {
          Result.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Top))}
         else if (($tmp3 === $mod.TTMSFNCTabSetTabShape.tsPyramidRight) || ($tmp3 === $mod.TTMSFNCTabSetTabShape.tsPyramid)) {
          Result.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - shz - rnd,r.Top + rnd),pas["WEBLib.TMSFNCTypes"].PointF(rnd,rnd),270,an);
          Result.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Bottom - rnd),pas["WEBLib.TMSFNCTypes"].PointF(rnd,rnd),an + 90,-an);
        } else if (($tmp3 === $mod.TTMSFNCTabSetTabShape.tsRoundRight) || ($tmp3 === $mod.TTMSFNCTabSetTabShape.tsRound)) {
          Result.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - rnd,r.Top + rnd),pas["WEBLib.TMSFNCTypes"].PointF(rnd,rnd),270,90);
          Result.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Top + rnd));
        };
        Result.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Bottom));
        Result.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Bottom));
        Result.ClosePath();
      } else if ($tmp1 === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom) {
        Result = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPath.$create("Create$1");
        Result.MoveTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Top));
        var $tmp4 = sh;
        if (($tmp4 === $mod.TTMSFNCTabSetTabShape.tsRectangle) || ($tmp4 === $mod.TTMSFNCTabSetTabShape.tsPyramidRight) || ($tmp4 === $mod.TTMSFNCTabSetTabShape.tsRoundRight)) {
          Result.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Bottom))}
         else if (($tmp4 === $mod.TTMSFNCTabSetTabShape.tsPyramidLeft) || ($tmp4 === $mod.TTMSFNCTabSetTabShape.tsPyramid)) {
          Result.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Top + rnd),pas["WEBLib.TMSFNCTypes"].PointF(rnd,rnd),270,an);
          Result.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + shz + rnd,r.Bottom - rnd),pas["WEBLib.TMSFNCTypes"].PointF(rnd,rnd),an - 270,-an);
        } else if (($tmp4 === $mod.TTMSFNCTabSetTabShape.tsRoundLeft) || ($tmp4 === $mod.TTMSFNCTabSetTabShape.tsRound)) {
          Result.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Bottom - rnd));
          Result.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + rnd,r.Bottom - rnd),pas["WEBLib.TMSFNCTypes"].PointF(rnd,rnd),-180,-90);
        };
        var $tmp5 = sh;
        if (($tmp5 === $mod.TTMSFNCTabSetTabShape.tsRectangle) || ($tmp5 === $mod.TTMSFNCTabSetTabShape.tsPyramidLeft) || ($tmp5 === $mod.TTMSFNCTabSetTabShape.tsRoundLeft)) {
          Result.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Bottom))}
         else if (($tmp5 === $mod.TTMSFNCTabSetTabShape.tsPyramidRight) || ($tmp5 === $mod.TTMSFNCTabSetTabShape.tsPyramid)) {
          Result.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - shz - rnd,r.Bottom - rnd),pas["WEBLib.TMSFNCTypes"].PointF(rnd,rnd),-270,-an);
          Result.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Top + rnd),pas["WEBLib.TMSFNCTypes"].PointF(rnd,rnd),-an + 270,an);
        } else if (($tmp5 === $mod.TTMSFNCTabSetTabShape.tsRoundRight) || ($tmp5 === $mod.TTMSFNCTabSetTabShape.tsRound)) {
          Result.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - rnd,r.Bottom - rnd),pas["WEBLib.TMSFNCTypes"].PointF(rnd,rnd),-270,-90);
          Result.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Bottom - rnd));
        };
        Result.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Top));
        Result.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Top));
        Result.ClosePath();
      } else if ($tmp1 === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) {
        Result = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPath.$create("Create$1");
        Result.MoveTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Bottom));
        var $tmp6 = sh;
        if (($tmp6 === $mod.TTMSFNCTabSetTabShape.tsRectangle) || ($tmp6 === $mod.TTMSFNCTabSetTabShape.tsPyramidRight) || ($tmp6 === $mod.TTMSFNCTabSetTabShape.tsRoundRight)) {
          Result.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Bottom))}
         else if (($tmp6 === $mod.TTMSFNCTabSetTabShape.tsPyramidLeft) || ($tmp6 === $mod.TTMSFNCTabSetTabShape.tsPyramid)) {
          Result.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - rnd,r.Bottom),pas["WEBLib.TMSFNCTypes"].PointF(rnd,rnd),0,-an);
          Result.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + rnd,r.Bottom - shz - rnd),pas["WEBLib.TMSFNCTypes"].PointF(rnd,rnd),-an + 180,an);
        } else if (($tmp6 === $mod.TTMSFNCTabSetTabShape.tsRoundLeft) || ($tmp6 === $mod.TTMSFNCTabSetTabShape.tsRound)) {
          Result.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + rnd,r.Bottom));
          Result.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + rnd,r.Bottom - rnd),pas["WEBLib.TMSFNCTypes"].PointF(rnd,rnd),90,90);
        };
        var $tmp7 = sh;
        if (($tmp7 === $mod.TTMSFNCTabSetTabShape.tsRectangle) || ($tmp7 === $mod.TTMSFNCTabSetTabShape.tsPyramidLeft) || ($tmp7 === $mod.TTMSFNCTabSetTabShape.tsRoundLeft)) {
          Result.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Top))}
         else if (($tmp7 === $mod.TTMSFNCTabSetTabShape.tsPyramidRight) || ($tmp7 === $mod.TTMSFNCTabSetTabShape.tsPyramid)) {
          Result.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + rnd,r.Top + shz + rnd),pas["WEBLib.TMSFNCTypes"].PointF(rnd,rnd),180,an);
          Result.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - rnd,r.Top),pas["WEBLib.TMSFNCTypes"].PointF(rnd,rnd),an,-an);
        } else if (($tmp7 === $mod.TTMSFNCTabSetTabShape.tsRoundRight) || ($tmp7 === $mod.TTMSFNCTabSetTabShape.tsRound)) {
          Result.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + rnd,r.Top + rnd),pas["WEBLib.TMSFNCTypes"].PointF(rnd,rnd),180,90);
          Result.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + rnd,r.Top));
        };
        Result.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Top));
        Result.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Bottom));
        Result.ClosePath();
      } else if ($tmp1 === $mod.TTMSFNCTabSetLayoutPosition.tlpRight) {
        Result = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPath.$create("Create$1");
        Result.MoveTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Top));
        var $tmp8 = sh;
        if (($tmp8 === $mod.TTMSFNCTabSetTabShape.tsRectangle) || ($tmp8 === $mod.TTMSFNCTabSetTabShape.tsPyramidRight) || ($tmp8 === $mod.TTMSFNCTabSetTabShape.tsRoundRight)) {
          Result.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Top))}
         else if (($tmp8 === $mod.TTMSFNCTabSetTabShape.tsPyramidLeft) || ($tmp8 === $mod.TTMSFNCTabSetTabShape.tsPyramid)) {
          Result.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + rnd,r.Top),pas["WEBLib.TMSFNCTypes"].PointF(rnd,rnd),-180,-an);
          Result.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - rnd,r.Top + shz + rnd),pas["WEBLib.TMSFNCTypes"].PointF(rnd,rnd),-an,an);
        } else if (($tmp8 === $mod.TTMSFNCTabSetTabShape.tsRoundLeft) || ($tmp8 === $mod.TTMSFNCTabSetTabShape.tsRound)) {
          Result.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - rnd,r.Top));
          Result.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - rnd,r.Top + rnd),pas["WEBLib.TMSFNCTypes"].PointF(rnd,rnd),-90,90);
        };
        var $tmp9 = sh;
        if (($tmp9 === $mod.TTMSFNCTabSetTabShape.tsRectangle) || ($tmp9 === $mod.TTMSFNCTabSetTabShape.tsPyramidLeft) || ($tmp9 === $mod.TTMSFNCTabSetTabShape.tsRoundLeft)) {
          Result.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Bottom))}
         else if (($tmp9 === $mod.TTMSFNCTabSetTabShape.tsPyramidRight) || ($tmp9 === $mod.TTMSFNCTabSetTabShape.tsPyramid)) {
          Result.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - rnd,r.Bottom - shz - rnd),pas["WEBLib.TMSFNCTypes"].PointF(rnd,rnd),0,an);
          Result.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + rnd,r.Bottom),pas["WEBLib.TMSFNCTypes"].PointF(rnd,rnd),-180 + an,-an);
        } else if (($tmp9 === $mod.TTMSFNCTabSetTabShape.tsRoundRight) || ($tmp9 === $mod.TTMSFNCTabSetTabShape.tsRound)) {
          Result.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - rnd,r.Bottom - rnd),pas["WEBLib.TMSFNCTypes"].PointF(rnd,rnd),0,90);
          Result.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - rnd,r.Bottom));
        };
        Result.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Bottom));
        Result.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Top));
        Result.ClosePath();
      } else {
        Result = null;
      };
      return Result;
    };
    this.GetBitmapRect = function (ARect) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rp = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.$assign(ARect);
      rp.$assign(this.GetProgressRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r)));
      Result.$assign(r);
      var $tmp = this.TabSet().FLayout.FPosition;
      if (($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom)) {
        if (this.FBitmapVisible) {
          if (!this.FTextVisible || (this.FText === "")) {
            Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(rp.Right + 2,r.Top + 2,r.Right - 2,r.Bottom - 2))}
           else if (this.FTextVisible && !(this.FText === "")) Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(rp.Right + 2,r.Top + 2,rp.Right + this.FBitmapSize + 2,r.Bottom - 2));
        } else Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(rp.Right,r.Top,rp.Right,r.Bottom));
      } else if ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) {
        if (this.FBitmapVisible) {
          if (!this.FTextVisible || (this.FText === "")) {
            Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + 2,r.Top + 2,r.Right - 2,rp.Bottom - 2))}
           else if (this.FTextVisible && !(this.FText === "")) Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + 2,rp.Top - this.FBitmapSize - 2,r.Right - 2,rp.Top - 2));
        } else Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,rp.Top,r.Right,rp.Top));
      } else if ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpRight) {
        if (this.FBitmapVisible) {
          if (!this.FTextVisible || (this.FText === "")) {
            Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + 2,rp.Top + 2,r.Right - 2,r.Bottom - 2))}
           else if (this.FTextVisible && !(this.FText === "")) Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + 2,rp.Bottom + 2,r.Right - 2,rp.Bottom + this.FBitmapSize + 2));
        } else Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,rp.Bottom,r.Right,rp.Bottom));
      };
      return Result;
    };
    this.GetTextRect = function (ARect) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var bmpr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var cr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.$assign(ARect);
      bmpr.$assign(this.GetBitmapRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect)));
      cr.$assign(this.GetCloseButtonRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect)));
      var $tmp = this.TabSet().FLayout.FPosition;
      if (($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom)) {
        if (!this.FStretchText) {
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(bmpr.Right + 2,r.Top + 2,cr.Left - 4,r.Bottom - 2))}
         else Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + 2,r.Top + 2,r.Right - 2,r.Bottom - 2));
      } else if ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) {
        if (!this.FStretchText) {
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + 2,cr.Bottom + 4,r.Right - 2,bmpr.Top - 2))}
         else Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + 2,r.Top + 2,r.Right - 2,r.Bottom - 2));
      } else if ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpRight) {
        if (!this.FStretchText) {
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + 2,bmpr.Bottom + 2,r.Right - 2,cr.Top - 4))}
         else Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + 2,r.Top + 2,r.Right - 2,r.Bottom - 2));
      };
      return Result;
    };
    this.GetProgressRect = function (ARect) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var sz = 0.0;
      var $tmp = this.FTabSet.FLayout.FPosition;
      if ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) {
        Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARect.Left,ARect.Bottom,ARect.Right,ARect.Bottom))}
       else if (($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom)) {
        Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARect.Left,ARect.Top,ARect.Left,ARect.Bottom))}
       else if ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpRight) Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARect.Left,ARect.Top,ARect.Right,ARect.Top));
      var $tmp1 = this.FProgressKind;
      if ($tmp1 === $mod.TTMSFNCTabSetTabProgressKind.tpkCircular) {
        sz = this.TabSet().FTabAppearance.FProgressCircularSize + 4;
        var $tmp2 = this.FTabSet.FLayout.FPosition;
        if (($tmp2 === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp2 === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom)) {
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Result.Left + 4,Result.Top + ((Result.Bottom - Result.Top - sz) / 2),Result.Left + sz + 4,Result.Top + ((Result.Bottom - Result.Top - sz) / 2) + sz))}
         else if ($tmp2 === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) {
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Result.Left + ((Result.Right - Result.Left - sz) / 2),Result.Bottom - sz - 4,Result.Left + ((Result.Right - Result.Left - sz) / 2) + sz,Result.Bottom - 4))}
         else if ($tmp2 === $mod.TTMSFNCTabSetLayoutPosition.tlpRight) Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Result.Left + ((Result.Right - Result.Left - sz) / 2),Result.Top + 4,Result.Left + ((Result.Right - Result.Left - sz) / 2) + sz,Result.Top + sz + 4));
      };
      return Result;
    };
    this.GetCloseButtonRect = function (ARect) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var sz = 0.0;
      var $tmp = this.FTabSet.FLayout.FPosition;
      if ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) {
        Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARect.Left,ARect.Top,ARect.Right,ARect.Top))}
       else if (($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom)) {
        Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARect.Right,ARect.Top,ARect.Right,ARect.Bottom))}
       else if ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpRight) Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARect.Left,ARect.Bottom,ARect.Right,ARect.Bottom));
      if ((this.FTabSet.FOptions.FCloseMode === $mod.TTMSFNCTabSetCloseMode.tcmTab) && this.FCloseButton) {
        sz = this.FTabSet.FTabAppearance.FCloseSize;
        var $tmp1 = this.FTabSet.FLayout.FPosition;
        if (($tmp1 === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp1 === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom)) {
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Result.Right - sz - 4,Result.Top + ((Result.Bottom - Result.Top - sz) / 2),Result.Right - 4,Result.Top + ((Result.Bottom - Result.Top - sz) / 2) + sz))}
         else if ($tmp1 === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) {
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Result.Left + ((Result.Right - Result.Left - sz) / 2),Result.Top + 4,Result.Left + ((Result.Right - Result.Left - sz) / 2) + sz,Result.Top + sz + 4))}
         else if ($tmp1 === $mod.TTMSFNCTabSetLayoutPosition.tlpRight) Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Result.Left + ((Result.Right - Result.Left - sz) / 2),Result.Bottom - sz - 4,Result.Left + ((Result.Right - Result.Left - sz) / 2) + sz,Result.Bottom - 4));
      };
      return Result;
    };
    this.GetFriendlyName = function () {
      var Result = "";
      Result = this.GetStrippedHTMLText();
      if (Result === "") Result = "Tab " + pas.SysUtils.IntToStr(this.GetIndex());
      return Result;
    };
    this.GetStrippedHTMLText = function () {
      var Result = "";
      var str = "";
      str = this.FText;
      if (this.IsHTML()) {
        Result = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.HTMLStrip(str)}
       else Result = str;
      return Result;
    };
    this.IsHTML = function () {
      var Result = false;
      Result = (pas.System.Pos("</",this.FText) > 0) || (pas.System.Pos("/>",this.FText) > 0) || (pas.System.Pos("<BR>",pas.SysUtils.UpperCase(this.FText)) > 0);
      return Result;
    };
    this.GetFixedRect = function (ARect, ATab) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var t = null;
      Result.$assign(pas["WEBLib.TMSFNCTypes"].EmptyRect());
      t = this.TabSet();
      if (!(t != null)) return Result;
      Result.$assign(ARect);
      var $tmp = this.TabSet().FLayout.FPosition;
      if (($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom)) {
        if (ATab.First) {
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.System.Int(Result.Left) + 0.5,pas.System.Int(Result.Top) + 0.5,pas.System.Int(Result.Right) + 0.5,pas.System.Int(Result.Bottom) - 0.5))}
         else if (ATab.Last) {
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.System.Int(Result.Left) - 0.5,pas.System.Int(Result.Top) + 0.5,pas.System.Int(Result.Right) - 0.5,pas.System.Int(Result.Bottom) - 0.5))}
         else Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.System.Int(Result.Left) - 0.5,pas.System.Int(Result.Top) + 0.5,pas.System.Int(Result.Right) + 0.5,pas.System.Int(Result.Bottom) - 0.5));
      } else if (($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) || ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpRight)) {
        if (ATab.First) {
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.System.Int(Result.Left) + 0.5,pas.System.Int(Result.Top) + 0.5,pas.System.Int(Result.Right) - 0.5,pas.System.Int(Result.Bottom) + 0.5))}
         else if (ATab.Last) {
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.System.Int(Result.Left) + 0.5,pas.System.Int(Result.Top) - 0.5,pas.System.Int(Result.Right) - 0.5,pas.System.Int(Result.Bottom) - 0.5))}
         else Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.System.Int(Result.Left) + 0.5,pas.System.Int(Result.Top) - 0.5,pas.System.Int(Result.Right) - 0.5,pas.System.Int(Result.Bottom) + 0.5));
      };
      return Result;
    };
    this.Create$1 = function (ACollection) {
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      if (this.FCollection != null) this.FTabSet = rtl.as(this.FCollection,$mod.TTMSFNCTabSetTabs).TabSet();
      if ((this.FTabSet != null) && this.FTabSet.IsDesignTime()) this.FText = "Tab Item " + pas.SysUtils.IntToStr(this.GetIndex());
      this.FEnabled = true;
      this.FProgress = 0;
      this.FProgressMax = 100;
      this.FProgressMode = $mod.TTMSFNCTabSetTabProgressMode.tpmNormal;
      this.FProgressKind = $mod.TTMSFNCTabSetTabProgressKind.tpkNone;
      this.FUseDefaultAppearance = false;
      this.FTextColor = 0;
      this.FActiveTextColor = 0;
      this.FDisabledTextColor = 0;
      this.FBadgeColor = 42495;
      this.FBadgeTextColor = 139;
      this.FDownTextColor = 0;
      this.FHoverTextColor = 0;
      this.FColor = 16316397;
      this.FProgressColor = 16297243;
      this.FActiveColor = 16777215;
      this.FDisabledColor = 13882323;
      this.FDownColor = 15655897;
      this.FHoverColor = 16313827;
      this.FWordWrapping = false;
      this.FTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      this.FTrimming = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttCharacter;
      this.FCloseButton = true;
      this.FWidth = -1;
      this.FHeight = -1;
      this.FStretchText = false;
      this.FBitmapVisible = false;
      this.FBitmapSize = 24;
      this.FTextVisible = true;
      this.FShape = $mod.TTMSFNCTabSetTabShape.tsPyramid;
      this.FVisible = true;
      this.FBitmaps = pas["WEBLib.TMSFNCTypes"].TTMSFNCScaledBitmaps.$create("Create$3",[this.FTabSet]);
      this.FBitmaps.FOnChange = rtl.createCallback(this,"BitmapsChanged");
      this.FDisabledBitmaps = pas["WEBLib.TMSFNCTypes"].TTMSFNCScaledBitmaps.$create("Create$3",[this.FTabSet]);
      this.FDisabledBitmaps.FOnChange = rtl.createCallback(this,"BitmapsChanged");
      this.UpdateTab();
      return this;
    };
    this.Destroy = function () {
      var t = null;
      rtl.free(this,"FDisabledBitmaps");
      rtl.free(this,"FBitmaps");
      t = this.TabSet();
      if (t != null) {
        if (t.FActiveTab === this) t.FActiveTab = null;
      };
      pas.Classes.TCollectionItem.Destroy.call(this);
      this.UpdateTab();
    };
    this.TabSet = function () {
      var Result = null;
      Result = this.FTabSet;
      return Result;
    };
    this.GetShape = function () {
      var Result = 0;
      if (this.FUseDefaultAppearance) {
        Result = this.TabSet().FTabAppearance.FShape}
       else Result = this.FShape;
      return Result;
    };
    this.GetAutoSize = function () {
      var Result = 0.0;
      var g = null;
      var b = null;
      var t = null;
      var sz = pas["WEBLib.TMSFNCTypes"].TSizeF.$new();
      var paintScale = 0.0;
      Result = 0;
      paintScale = 1;
      t = this.TabSet();
      if (t != null) {
        g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[1,1,t.FNativeCanvas,true]);
        if (!t.FNativeCanvas) g.BeginScene();
        try {
          b = this.GetBitmap();
          if ((this.FText !== "") && this.FTextVisible) {
            g.SetFont(t.FTabAppearance.FFont);
            sz.$assign(g.CalculateTextSize(this.FText,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,10000,10000)),true,true));
            Result = Result + sz.cx + 6;
            if (((t.FTabAppearance.FTrimming !== pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone) && this.FUseDefaultAppearance) || ((this.FTrimming !== pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone) && !this.FUseDefaultAppearance)) {
              Result = Result + 2;
            };
          };
          if ((b != null) && this.FBitmapVisible) Result = Result + this.FBitmapSize + 4;
          if (this.FProgressKind === $mod.TTMSFNCTabSetTabProgressKind.tpkCircular) Result = Result + t.FTabAppearance.FProgressCircularSize + 8;
          if ((t.FOptions.FCloseMode === $mod.TTMSFNCTabSetCloseMode.tcmTab) && this.FCloseButton) Result = Result + t.FTabAppearance.FCloseSize + 4;
        } finally {
          if (!t.FNativeCanvas) g.EndScene();
          g = rtl.freeLoc(g);
        };
        paintScale = t.FPaintScaleFactor;
      };
      Result = Math.max(30 * paintScale,Result);
      return Result;
    };
    this.GetBitmap = function () {
      var Result = null;
      if (this.FEnabled) {
        Result = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.GetScaledBitmap(this.FBitmaps,0,this.GetBitmapContainer())}
       else Result = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.GetScaledBitmap(this.FDisabledBitmaps,0,this.GetBitmapContainer());
      return Result;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCTabSetTab.isPrototypeOf(Source)) {
        this.FTag = rtl.as(Source,$mod.TTMSFNCTabSetTab).FTag;
        this.FText = rtl.as(Source,$mod.TTMSFNCTabSetTab).FText;
        this.FTrimming = rtl.as(Source,$mod.TTMSFNCTabSetTab).FTrimming;
        this.FWordWrapping = rtl.as(Source,$mod.TTMSFNCTabSetTab).FWordWrapping;
        this.FTextAlign = rtl.as(Source,$mod.TTMSFNCTabSetTab).FTextAlign;
        this.FTextColor = rtl.as(Source,$mod.TTMSFNCTabSetTab).FTextColor;
        this.FActiveTextColor = rtl.as(Source,$mod.TTMSFNCTabSetTab).FActiveTextColor;
        this.FDisabledTextColor = rtl.as(Source,$mod.TTMSFNCTabSetTab).FDisabledTextColor;
        this.FDownTextColor = rtl.as(Source,$mod.TTMSFNCTabSetTab).FDownTextColor;
        this.FHoverTextColor = rtl.as(Source,$mod.TTMSFNCTabSetTab).FHoverTextColor;
        this.FColor = rtl.as(Source,$mod.TTMSFNCTabSetTab).FColor;
        this.FProgressColor = rtl.as(Source,$mod.TTMSFNCTabSetTab).FProgressColor;
        this.FActiveColor = rtl.as(Source,$mod.TTMSFNCTabSetTab).FActiveColor;
        this.FDisabledColor = rtl.as(Source,$mod.TTMSFNCTabSetTab).FDisabledColor;
        this.FDownColor = rtl.as(Source,$mod.TTMSFNCTabSetTab).FDownColor;
        this.FHoverColor = rtl.as(Source,$mod.TTMSFNCTabSetTab).FHoverColor;
        this.FEnabled = rtl.as(Source,$mod.TTMSFNCTabSetTab).FEnabled;
        this.FVisible = rtl.as(Source,$mod.TTMSFNCTabSetTab).FVisible;
        this.FBitmaps.Assign(rtl.as(Source,$mod.TTMSFNCTabSetTab).FBitmaps);
        this.FDisabledBitmaps.Assign(rtl.as(Source,$mod.TTMSFNCTabSetTab).FDisabledBitmaps);
        this.FWidth = rtl.as(Source,$mod.TTMSFNCTabSetTab).FWidth;
        this.FBitmapVisible = rtl.as(Source,$mod.TTMSFNCTabSetTab).FBitmapVisible;
        this.FBitmapSize = rtl.as(Source,$mod.TTMSFNCTabSetTab).FBitmapSize;
        this.FUseDefaultAppearance = rtl.as(Source,$mod.TTMSFNCTabSetTab).FUseDefaultAppearance;
        this.FTextVisible = rtl.as(Source,$mod.TTMSFNCTabSetTab).FTextVisible;
        this.FStretchText = rtl.as(Source,$mod.TTMSFNCTabSetTab).FStretchText;
        this.FShape = rtl.as(Source,$mod.TTMSFNCTabSetTab).FShape;
        this.FProgress = rtl.as(Source,$mod.TTMSFNCTabSetTab).FProgress;
        this.FProgressMax = rtl.as(Source,$mod.TTMSFNCTabSetTab).FProgressMax;
        this.FProgressMode = rtl.as(Source,$mod.TTMSFNCTabSetTab).FProgressMode;
        this.FProgressKind = rtl.as(Source,$mod.TTMSFNCTabSetTab).FProgressKind;
        this.FCloseButton = rtl.as(Source,$mod.TTMSFNCTabSetTab).FCloseButton;
        this.FBadge = rtl.as(Source,$mod.TTMSFNCTabSetTab).FBadge;
        this.FBadgeColor = rtl.as(Source,$mod.TTMSFNCTabSetTab).FBadgeColor;
        this.FBadgeTextColor = rtl.as(Source,$mod.TTMSFNCTabSetTab).FBadgeTextColor;
        this.FHint = rtl.as(Source,$mod.TTMSFNCTabSetTab).FHint;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Text",2,rtl.string,"FText","SetText");
    $r.addProperty("Badge",2,rtl.string,"FBadge","SetBadge");
    $r.addProperty("Hint",2,rtl.string,"FHint","SetHint");
    $r.addProperty("StretchText",2,rtl.boolean,"FStretchText","SetStretchText",4,{Default: false});
    $r.addProperty("TextVisible",2,rtl.boolean,"FTextVisible","SetTextVisible",4,{Default: true});
    $r.addProperty("TabVisible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Bitmaps",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCScaledBitmaps"],"FBitmaps","SetBitmaps");
    $r.addProperty("DisabledBitmaps",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCScaledBitmaps"],"FDisabledBitmaps","SetDisabledBitmaps");
    $r.addProperty("BitmapVisible",2,rtl.boolean,"FBitmapVisible","SetBitmapVisible",4,{Default: false});
    $r.addProperty("BitmapSize",14,rtl.double,"FBitmapSize","SetBitmapSize",4,{stored: "IsBitmapSizeStored"});
    $r.addProperty("WordWrapping",2,rtl.boolean,"FWordWrapping","SetWordWrapping",4,{Default: false});
    $r.addProperty("Trimming",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextTrimming"],"FTrimming","SetTrimming",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttCharacter});
    $r.addProperty("TextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FTextAlign","SetTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter});
    $r.addProperty("TextColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FTextColor","SetTextColor",4,{Default: 0});
    $r.addProperty("ActiveTextColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FActiveTextColor","SetActiveTextColor",4,{Default: 0});
    $r.addProperty("HoverTextColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FHoverTextColor","SetHoverTextColor",4,{Default: 0});
    $r.addProperty("DownTextColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FDownTextColor","SetDownTextColor",4,{Default: 0});
    $r.addProperty("DisabledTextColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FDisabledTextColor","SetDisabledTextColor",4,{Default: 0});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor",4,{Default: 16316397});
    $r.addProperty("ProgressColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FProgressColor","SetProgressColor",4,{Default: 16297243});
    $r.addProperty("ActiveColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FActiveColor","SetActiveColor",4,{Default: 16777215});
    $r.addProperty("HoverColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FHoverColor","SetHoverColor",4,{Default: 16313827});
    $r.addProperty("DownColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FDownColor","SetDownColor",4,{Default: 15655897});
    $r.addProperty("DisabledColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FDisabledColor","SetDisabledColor",4,{Default: 13882323});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("UseDefaultAppearance",2,rtl.boolean,"FUseDefaultAppearance","SetUseDefaultAppearance",4,{Default: false});
    $r.addProperty("Width",14,rtl.double,"FWidth","SetWidth",4,{stored: "IsWidthStored"});
    $r.addProperty("Shape",2,$mod.$rtti["TTMSFNCTabSetTabShape"],"FShape","SetShape",4,{Default: $mod.TTMSFNCTabSetTabShape.tsPyramid});
    $r.addProperty("Tag",0,rtl.nativeint,"FTag","FTag",4,{Default: 0});
    $r.addProperty("Progress",14,rtl.double,"FProgress","SetProgress",4,{stored: "IsProgressStored"});
    $r.addProperty("ProgressMax",14,rtl.double,"FProgressMax","SetProgressMax",4,{stored: "IsProgressMaxStored"});
    $r.addProperty("ProgressMode",2,$mod.$rtti["TTMSFNCTabSetTabProgressMode"],"FProgressMode","SetProgressMode",4,{Default: $mod.TTMSFNCTabSetTabProgressMode.tpmNormal});
    $r.addProperty("ProgressKind",2,$mod.$rtti["TTMSFNCTabSetTabProgressKind"],"FProgressKind","SetProgressKind",4,{Default: $mod.TTMSFNCTabSetTabProgressKind.tpkNone});
    $r.addProperty("CloseButton",2,rtl.boolean,"FCloseButton","SetCloseButton",4,{Default: true});
    $r.addProperty("BadgeTextColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FBadgeTextColor","SetBadgeTextColor",4,{Default: 139});
    $r.addProperty("BadgeColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FBadgeColor","SetBadgeColor",4,{Default: 42495});
  });
  rtl.createClass(this,"TTMSFNCTabSetTabs",pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$init.call(this);
      this.FOwnerInterface = null;
      this.FTabSet = null;
    };
    this.$final = function () {
      rtl.setIntfP(this,"FOwnerInterface",null);
      this.FTabSet = undefined;
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$final.call(this);
    };
    this.GetTab = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetTab = function (Index, Value) {
      this.SetItem(Index,Value);
    };
    this.CreateObject = function (AClassName, ABaseClass) {
      var Result = null;
      Result = this.GetTabClass().$create("Create$1",[null]);
      return Result;
    };
    this.GetInterfaceItemClass = function () {
      var Result = null;
      Result = this.GetTabClass();
      return Result;
    };
    this._AddRef = function () {
      var Result = 0;
      if (this.FOwnerInterface !== null) {
        Result = this.FOwnerInterface._AddRef()}
       else Result = -1;
      return Result;
    };
    this._Release = function () {
      var Result = 0;
      if (this.FOwnerInterface !== null) {
        Result = this.FOwnerInterface._Release()}
       else Result = -1;
      return Result;
    };
    this.GetTabClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCTabSetTab;
      return Result;
    };
    var E_NOINTERFACE = 0x80004002;
    this.QueryInterface = function (IID, Obj) {
      var Result = 0;
      if (this.GetInterface(IID,Obj)) {
        Result = 0}
       else Result = -2147467262;
      return Result;
    };
    this.TabSet = function () {
      var Result = null;
      Result = this.FTabSet;
      return Result;
    };
    this.Create$3 = function (ATabSet) {
      pas.Classes.TOwnedCollection.Create$2.call(this,ATabSet,this.GetTabClass());
      this.FTabSet = ATabSet;
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      return Result;
    };
    this.Clear$1 = function () {
      var l = null;
      var ci = null;
      l = this.TabSet();
      if (l != null) {
        l.BeginUpdate();
        l.SetActiveTabIndex(-1);
      };
      if (this.GetCount() > 0) {
        while (this.GetCount() > 0) {
          ci = this.GetItem(this.GetCount() - 1);
          ci = rtl.freeLoc(ci);
        };
      };
      if (l != null) l.EndUpdate();
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCBaseListIO,{GetItemClass: "GetInterfaceItemClass"});
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCBasePersistenceIO);
  });
  rtl.createClass(this,"TTMSFNCTabSetTabSize",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FTabSet = null;
      this.FMode = 0;
      this.FWidth = 0.0;
      this.FHeight = 0.0;
      this.FSpacing = 0.0;
      this.FMargins = null;
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FTabSet = undefined;
      this.FMargins = undefined;
      this.FOnChange = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.IsHeightStored = function () {
      var Result = false;
      Result = this.FHeight !== 22;
      return Result;
    };
    this.IsWidthStored = function () {
      var Result = false;
      Result = this.FWidth !== 100;
      return Result;
    };
    this.SetHeight = function (Value) {
      if (this.FHeight !== Value) {
        this.FHeight = Value;
        this.UpdateTabs();
      };
    };
    this.SetMode = function (Value) {
      if (this.FMode !== Value) {
        this.FMode = Value;
        this.UpdateTabs();
      };
    };
    this.SetWidth = function (Value) {
      if (this.FWidth !== Value) {
        this.FWidth = Value;
        this.UpdateTabs();
      };
    };
    this.IsSpacingStored = function () {
      var Result = false;
      Result = this.FSpacing !== 0;
      return Result;
    };
    this.SetMargins = function (Value) {
      this.FMargins.Assign(Value);
    };
    this.SetSpacing = function (Value) {
      if (this.FSpacing !== Value) {
        this.FSpacing = Value;
        this.UpdateTabs();
      };
    };
    this.ChangeDPIScale = function (M, D) {
      this.FMargins.SetLeft(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FMargins.FLeft,M,D));
      this.FMargins.SetRight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FMargins.FRight,M,D));
      this.FMargins.SetTop(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FMargins.FTop,M,D));
      this.FMargins.SetBottom(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FMargins.FBottom,M,D));
      this.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FHeight,M,D));
      this.SetSpacing(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FSpacing,M,D));
    };
    this.UpdateTabs = function () {
      if (this.FOnChange != null) this.FOnChange(this);
      if (this.FTabSet != null) this.FTabSet.UpdateTabs(false,false);
    };
    this.MarginsChanged = function (Sender) {
      this.UpdateTabs();
    };
    this.Create$1 = function (ATabSet) {
      this.FTabSet = ATabSet;
      this.FWidth = 100;
      this.FHeight = 22;
      this.FSpacing = 0;
      this.FMode = $mod.TTMSFNCTabSetTabSizeMode.tsmAutoTabSize;
      this.FMargins = pas["WEBLib.TMSFNCTypes"].TTMSFNCMargins.$create("Create$1");
      if ((this.FTabSet != null) && this.FTabSet.IsDesignTime()) {
        this.FMargins.SetLeft(8);
        this.FMargins.SetTop(8);
        this.FMargins.SetRight(8);
        this.FMargins.SetBottom(8);
      };
      this.FMargins.FOnChange = rtl.createCallback(this,"MarginsChanged");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FMargins");
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCTabSetTabSize.isPrototypeOf(Source)) {
        this.FMode = rtl.as(Source,$mod.TTMSFNCTabSetTabSize).FMode;
        this.FWidth = rtl.as(Source,$mod.TTMSFNCTabSetTabSize).FWidth;
        this.FHeight = rtl.as(Source,$mod.TTMSFNCTabSetTabSize).FHeight;
        this.FMargins.Assign(rtl.as(Source,$mod.TTMSFNCTabSetTabSize).FMargins);
        this.FSpacing = rtl.as(Source,$mod.TTMSFNCTabSetTabSize).FSpacing;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Mode",2,$mod.$rtti["TTMSFNCTabSetTabSizeMode"],"FMode","SetMode",4,{Default: $mod.TTMSFNCTabSetTabSizeMode.tsmAutoTabSize});
    $r.addProperty("Width",14,rtl.double,"FWidth","SetWidth",4,{stored: "IsWidthStored"});
    $r.addProperty("Height",14,rtl.double,"FHeight","SetHeight",4,{stored: "IsHeightStored"});
    $r.addProperty("Margins",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCMargins"],"FMargins","SetMargins");
    $r.addProperty("Spacing",14,rtl.double,"FSpacing","SetSpacing",4,{stored: "IsSpacingStored"});
  });
  this.TTMSFNCTabSetCloseMode = {"0": "tcmNone", tcmNone: 0, "1": "tcmTab", tcmTab: 1, "2": "tcmMenu", tcmMenu: 2};
  this.$rtti.$Enum("TTMSFNCTabSetCloseMode",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCTabSetCloseMode});
  this.TTMSFNCTabSetInsertMode = {"0": "timNone", timNone: 0, "1": "timTab", timTab: 1, "2": "timMenu", timMenu: 2};
  this.$rtti.$Enum("TTMSFNCTabSetInsertMode",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCTabSetInsertMode});
  rtl.createClass(this,"TTMSFNCTabSetButtonAppearance",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FTabSet = null;
      this.FSize = 0.0;
      this.FHoverFill = null;
      this.FStroke = null;
      this.FHoverStroke = null;
      this.FDownFill = null;
      this.FDownStroke = null;
      this.FDisabledFill = null;
      this.FDisabledStroke = null;
      this.FFill = null;
      this.FCloseIcon = null;
      this.FScrollPreviousIcon = null;
      this.FInsertIcon = null;
      this.FScrollNextIcon = null;
      this.FTabListIcon = null;
      this.FRounding = 0.0;
    };
    this.$final = function () {
      this.FTabSet = undefined;
      this.FHoverFill = undefined;
      this.FStroke = undefined;
      this.FHoverStroke = undefined;
      this.FDownFill = undefined;
      this.FDownStroke = undefined;
      this.FDisabledFill = undefined;
      this.FDisabledStroke = undefined;
      this.FFill = undefined;
      this.FCloseIcon = undefined;
      this.FScrollPreviousIcon = undefined;
      this.FInsertIcon = undefined;
      this.FScrollNextIcon = undefined;
      this.FTabListIcon = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.IsSizedStored = function () {
      var Result = false;
      Result = this.FSize !== 20;
      return Result;
    };
    this.SetSize = function (Value) {
      if (this.FSize !== Value) {
        this.FSize = Value;
        this.UpdateTabs();
      };
    };
    this.SetDisabledFill = function (Value) {
      this.FDisabledFill.Assign(Value);
    };
    this.SetDisabledStroke = function (Value) {
      this.FDisabledStroke.Assign(Value);
    };
    this.SetDownFill = function (Value) {
      this.FDownFill.Assign(Value);
    };
    this.SetDownStroke = function (Value) {
      this.FDownStroke.Assign(Value);
    };
    this.SetFill = function (Value) {
      this.FFill.Assign(Value);
    };
    this.SetHoverFill = function (Value) {
      this.FHoverFill.Assign(Value);
    };
    this.SetHoverStroke = function (Value) {
      this.FHoverStroke.Assign(Value);
    };
    this.SetStroke = function (Value) {
      this.FStroke.Assign(Value);
    };
    this.SetCloseIcon = function (Value) {
      this.FCloseIcon.Assign(Value);
    };
    this.SetInsertIcon = function (Value) {
      this.FInsertIcon.Assign(Value);
    };
    this.SetScrollNextIcon = function (Value) {
      this.FScrollNextIcon.Assign(Value);
    };
    this.SetScrollPreviousIcon = function (Value) {
      this.FScrollPreviousIcon.Assign(Value);
    };
    this.SetTabListIcon = function (Value) {
      this.FTabListIcon.Assign(Value);
    };
    this.IsRoundingStored = function () {
      var Result = false;
      Result = this.FRounding !== 5;
      return Result;
    };
    this.SetRounding = function (Value) {
      this.FRounding = Value;
    };
    this.UpdateTabs = function () {
      if (this.FTabSet != null) this.FTabSet.UpdateTabs(false,false);
    };
    this.FillChanged = function (Sender) {
      this.UpdateTabs();
    };
    this.StrokeChanged = function (Sender) {
      this.UpdateTabs();
    };
    this.BitmapChanged = function (Sender) {
      if ((this.FTabSet != null) && (this.FTabSet.FInsertTab != null)) {
        this.FTabSet.FInsertTab.FBitmaps.Clear();
        this.FTabSet.FInsertTab.FBitmaps.AddBitmap(this.FInsertIcon,1.0);
        this.FTabSet.FInsertTab.FDisabledBitmaps.Clear();
        this.FTabSet.FInsertTab.FDisabledBitmaps.AddBitmap(this.FInsertIcon,1.0);
      };
      this.UpdateTabs();
    };
    this.Create$1 = function (ATabSet) {
      this.FTabSet = ATabSet;
      this.FSize = 20;
      this.FRounding = 5;
      this.FFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16316397,8421504,-1,-1]);
      this.FFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FDownFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,15655897,8421504,-1,-1]);
      this.FDownFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FHoverFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16313827,8421504,-1,-1]);
      this.FHoverFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FDisabledFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,13882323,8421504,-1,-1]);
      this.FDisabledFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,11119017,1.0]);
      this.FStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FDownStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,11119017,1.0]);
      this.FDownStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FHoverStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,11119017,1.0]);
      this.FHoverStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FDisabledStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,11119017,1.0]);
      this.FDisabledStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FTabListIcon = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource$1($mod.TMSFNCTABSETLISTSVG,pas["WEBLib.TMSFNCTypes"].HInstance());
      this.FTabListIcon.FOnChange = rtl.createCallback(this,"BitmapChanged");
      this.FCloseIcon = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource$1($mod.TMSFNCTABSETCLOSESVG,pas["WEBLib.TMSFNCTypes"].HInstance());
      this.FCloseIcon.FOnChange = rtl.createCallback(this,"BitmapChanged");
      this.FInsertIcon = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource$1($mod.TMSFNCTABSETADDSVG,pas["WEBLib.TMSFNCTypes"].HInstance());
      this.FInsertIcon.FOnChange = rtl.createCallback(this,"BitmapChanged");
      this.FScrollNextIcon = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource$1($mod.TMSFNCTABSETNEXTSVG,pas["WEBLib.TMSFNCTypes"].HInstance());
      this.FScrollNextIcon.FOnChange = rtl.createCallback(this,"BitmapChanged");
      this.FScrollPreviousIcon = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource$1($mod.TMSFNCTABSETPREVIOUSSVG,pas["WEBLib.TMSFNCTypes"].HInstance());
      this.FScrollPreviousIcon.FOnChange = rtl.createCallback(this,"BitmapChanged");
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCTabSetButtonAppearance.isPrototypeOf(Source)) {
        this.FSize = rtl.as(Source,$mod.TTMSFNCTabSetButtonAppearance).FSize;
        this.FRounding = rtl.as(Source,$mod.TTMSFNCTabSetButtonAppearance).FRounding;
        this.FFill.Assign(rtl.as(Source,$mod.TTMSFNCTabSetButtonAppearance).FFill);
        this.FDownFill.Assign(rtl.as(Source,$mod.TTMSFNCTabSetButtonAppearance).FDownFill);
        this.FHoverFill.Assign(rtl.as(Source,$mod.TTMSFNCTabSetButtonAppearance).FHoverFill);
        this.FDisabledFill.Assign(rtl.as(Source,$mod.TTMSFNCTabSetButtonAppearance).FDisabledFill);
        this.FStroke.Assign(rtl.as(Source,$mod.TTMSFNCTabSetButtonAppearance).FStroke);
        this.FDownStroke.Assign(rtl.as(Source,$mod.TTMSFNCTabSetButtonAppearance).FDownStroke);
        this.FHoverStroke.Assign(rtl.as(Source,$mod.TTMSFNCTabSetButtonAppearance).FHoverStroke);
        this.FDisabledStroke.Assign(rtl.as(Source,$mod.TTMSFNCTabSetButtonAppearance).FDisabledStroke);
        this.FTabListIcon.Assign(rtl.as(Source,$mod.TTMSFNCTabSetButtonAppearance).FTabListIcon);
        this.FCloseIcon.Assign(rtl.as(Source,$mod.TTMSFNCTabSetButtonAppearance).FCloseIcon);
        this.FInsertIcon.Assign(rtl.as(Source,$mod.TTMSFNCTabSetButtonAppearance).FInsertIcon);
        this.FScrollNextIcon.Assign(rtl.as(Source,$mod.TTMSFNCTabSetButtonAppearance).FScrollNextIcon);
        this.FScrollPreviousIcon.Assign(rtl.as(Source,$mod.TTMSFNCTabSetButtonAppearance).FScrollPreviousIcon);
      };
    };
    this.Destroy = function () {
      rtl.free(this,"FTabListIcon");
      rtl.free(this,"FCloseIcon");
      rtl.free(this,"FInsertIcon");
      rtl.free(this,"FScrollPreviousIcon");
      rtl.free(this,"FScrollNextIcon");
      rtl.free(this,"FFill");
      rtl.free(this,"FStroke");
      rtl.free(this,"FHoverFill");
      rtl.free(this,"FHoverStroke");
      rtl.free(this,"FDownFill");
      rtl.free(this,"FDownStroke");
      rtl.free(this,"FDisabledFill");
      rtl.free(this,"FDisabledStroke");
      pas.System.TObject.Destroy.call(this);
    };
    var $r = this.$rtti;
    $r.addProperty("Rounding",14,rtl.double,"FRounding","SetRounding",4,{stored: "IsRoundingStored"});
    $r.addProperty("Size",14,rtl.double,"FSize","SetSize",4,{stored: "IsSizedStored"});
    $r.addProperty("Fill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFill","SetFill");
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
    $r.addProperty("DownFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FDownFill","SetDownFill");
    $r.addProperty("DownStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FDownStroke","SetDownStroke");
    $r.addProperty("DisabledFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FDisabledFill","SetDisabledFill");
    $r.addProperty("DisabledStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FDisabledStroke","SetDisabledStroke");
    $r.addProperty("HoverFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FHoverFill","SetHoverFill");
    $r.addProperty("HoverStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FHoverStroke","SetHoverStroke");
    $r.addProperty("CloseIcon",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FCloseIcon","SetCloseIcon");
    $r.addProperty("InsertIcon",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FInsertIcon","SetInsertIcon");
    $r.addProperty("TabListIcon",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FTabListIcon","SetTabListIcon");
    $r.addProperty("ScrollNextIcon",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FScrollNextIcon","SetScrollNextIcon");
    $r.addProperty("ScrollPreviousIcon",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FScrollPreviousIcon","SetScrollPreviousIcon");
  });
  rtl.createClass(this,"TTMSFNCTabSetTabAppearance",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FTabSet = null;
      this.FHoverStroke = null;
      this.FDownFill = null;
      this.FDownStroke = null;
      this.FDisabledFill = null;
      this.FFont = null;
      this.FActiveFill = null;
      this.FDisabledStroke = null;
      this.FActiveStroke = null;
      this.FFill = null;
      this.FHoverFill = null;
      this.FStroke = null;
      this.FWordWrapping = false;
      this.FTrimming = 0;
      this.FTextAlign = 0;
      this.FShape = 0;
      this.FShapeOverlap = 0.0;
      this.FShapeSlope = 0.0;
      this.FTextColor = 0;
      this.FHoverTextColor = 0;
      this.FDownTextColor = 0;
      this.FDisabledTextColor = 0;
      this.FActiveTextColor = 0;
      this.FShowFocus = false;
      this.FFocusBorderColor = 0;
      this.FProgressFill = null;
      this.FShapeRounding = 0.0;
      this.FProgressStroke = null;
      this.FCloseSize = 0.0;
      this.FProgressCircularSize = 0.0;
      this.FCloseHoverStroke = null;
      this.FCloseDownFill = null;
      this.FCloseDownStroke = null;
      this.FCloseFill = null;
      this.FCloseHoverFill = null;
      this.FCloseStroke = null;
      this.FInsertSize = 0.0;
      this.FBadgeFont = null;
      this.FBadgeFill = null;
      this.FBadgeStroke = null;
      this.FTextSpacing = 0.0;
    };
    this.$final = function () {
      this.FTabSet = undefined;
      this.FHoverStroke = undefined;
      this.FDownFill = undefined;
      this.FDownStroke = undefined;
      this.FDisabledFill = undefined;
      this.FFont = undefined;
      this.FActiveFill = undefined;
      this.FDisabledStroke = undefined;
      this.FActiveStroke = undefined;
      this.FFill = undefined;
      this.FHoverFill = undefined;
      this.FStroke = undefined;
      this.FProgressFill = undefined;
      this.FProgressStroke = undefined;
      this.FCloseHoverStroke = undefined;
      this.FCloseDownFill = undefined;
      this.FCloseDownStroke = undefined;
      this.FCloseFill = undefined;
      this.FCloseHoverFill = undefined;
      this.FCloseStroke = undefined;
      this.FBadgeFont = undefined;
      this.FBadgeFill = undefined;
      this.FBadgeStroke = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetDisabledFill = function (Value) {
      this.FDisabledFill.Assign(Value);
    };
    this.SetDisabledStroke = function (Value) {
      this.FDisabledStroke.Assign(Value);
    };
    this.SetDownFill = function (Value) {
      this.FDownFill.Assign(Value);
    };
    this.SetDownStroke = function (Value) {
      this.FDownStroke.Assign(Value);
    };
    this.SetFill = function (Value) {
      this.FFill.Assign(Value);
    };
    this.SetFont = function (Value) {
      this.FFont.Assign(Value);
    };
    this.SetHoverFill = function (Value) {
      this.FHoverFill.Assign(Value);
    };
    this.SetHoverStroke = function (Value) {
      this.FHoverStroke.Assign(Value);
    };
    this.SetActiveFill = function (Value) {
      this.FActiveFill.Assign(Value);
    };
    this.SetActiveStroke = function (Value) {
      this.FActiveStroke.Assign(Value);
    };
    this.SetStroke = function (Value) {
      this.FStroke.Assign(Value);
    };
    this.SetTextAlign = function (Value) {
      if (this.FTextAlign !== Value) {
        this.FTextAlign = Value;
        this.UpdateTabs();
      };
    };
    this.SetTrimming = function (Value) {
      if (this.FTrimming !== Value) {
        this.FTrimming = Value;
        this.UpdateTabs();
      };
    };
    this.SetWordWrapping = function (Value) {
      if (this.FWordWrapping !== Value) {
        this.FWordWrapping = Value;
        this.UpdateTabs();
      };
    };
    this.SetShape = function (Value) {
      if (this.FShape !== Value) {
        this.FShape = Value;
        this.UpdateTabs();
      };
    };
    this.SetShapeOverlap = function (Value) {
      if (this.FShapeOverlap !== Value) {
        this.FShapeOverlap = Value;
        this.UpdateTabs();
      };
    };
    this.IsShapeOverlapStored = function () {
      var Result = false;
      Result = this.FShapeOverlap !== 12;
      return Result;
    };
    this.IsShapeSlopeStored = function () {
      var Result = false;
      Result = this.FShapeSlope !== 11;
      return Result;
    };
    this.SetShapeSlope = function (Value) {
      if (this.FShapeSlope !== Value) {
        this.FShapeSlope = Value;
        this.UpdateTabs();
      };
    };
    this.SetActiveTextColor = function (Value) {
      if (this.FActiveTextColor !== Value) {
        this.FActiveTextColor = Value;
        this.UpdateTabs();
      };
    };
    this.SetDisabledTextColor = function (Value) {
      if (this.FDisabledTextColor !== Value) {
        this.FDisabledTextColor = Value;
        this.UpdateTabs();
      };
    };
    this.SetDownTextColor = function (Value) {
      if (this.FDownTextColor !== Value) {
        this.FDownTextColor = Value;
        this.UpdateTabs();
      };
    };
    this.SetHoverTextColor = function (Value) {
      if (this.FHoverTextColor !== Value) {
        this.FHoverTextColor = Value;
        this.UpdateTabs();
      };
    };
    this.SetTextColor = function (Value) {
      if (this.FTextColor !== Value) {
        this.FTextColor = Value;
        this.UpdateTabs();
      };
    };
    this.SetFocusBorderColor = function (Value) {
      if (this.FFocusBorderColor !== Value) {
        this.FFocusBorderColor = Value;
        this.UpdateTabs();
      };
    };
    this.SetShowFocus = function (Value) {
      if (this.FShowFocus !== Value) {
        this.FShowFocus = Value;
        this.UpdateTabs();
      };
    };
    this.SetProgressFill = function (Value) {
      this.FProgressFill.Assign(Value);
    };
    this.IsShapeRoundingStored = function () {
      var Result = false;
      Result = this.FShapeRounding !== 5;
      return Result;
    };
    this.SetShapeRounding = function (Value) {
      if (this.FShapeRounding !== Value) {
        this.FShapeRounding = Value;
        this.UpdateTabs();
      };
    };
    this.SetProgressStroke = function (Value) {
      this.FProgressStroke.Assign(Value);
    };
    this.IsCloseSizeStored = function () {
      var Result = false;
      Result = this.FCloseSize !== 14;
      return Result;
    };
    this.SetCloseSize = function (Value) {
      if (this.FCloseSize !== Value) {
        this.FCloseSize = Value;
        this.UpdateTabs();
      };
    };
    this.IsProgressCircularSizeStored = function () {
      var Result = false;
      Result = this.FProgressCircularSize !== 15;
      return Result;
    };
    this.SetProgressCircularSize = function (Value) {
      if (this.FProgressCircularSize !== Value) {
        this.FProgressCircularSize = Value;
        this.UpdateTabs();
      };
    };
    this.SetCloseDownFill = function (Value) {
      this.FCloseDownFill.Assign(Value);
    };
    this.SetCloseDownStroke = function (Value) {
      this.FCloseDownStroke.Assign(Value);
    };
    this.SetCloseFill = function (Value) {
      this.FCloseFill.Assign(Value);
    };
    this.SetCloseHoverFill = function (Value) {
      this.FCloseHoverFill.Assign(Value);
    };
    this.SetCloseHoverStroke = function (Value) {
      this.FCloseHoverStroke.Assign(Value);
    };
    this.SetCloseStroke = function (Value) {
      this.FCloseStroke.Assign(Value);
    };
    this.IsInsertSizeStored = function () {
      var Result = false;
      Result = this.FInsertSize !== 20;
      return Result;
    };
    this.SetInsertSize = function (Value) {
      if (this.FInsertSize !== Value) {
        this.FInsertSize = Value;
        this.UpdateTabs();
      };
    };
    this.SetBadgeFill = function (Value) {
      this.FBadgeFill.Assign(Value);
    };
    this.SetBadgeFont = function (Value) {
      this.FBadgeFont.Assign(Value);
    };
    this.SetBadgeStroke = function (Value) {
      this.FBadgeStroke.Assign(Value);
    };
    this.SetTextSpacing = function (Value) {
      if (this.FTextSpacing !== Value) {
        this.FTextSpacing = Value;
        this.UpdateTabs();
      };
    };
    this.ChangeDPIScale = function (M, D) {
      this.SetShapeRounding(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FShapeRounding,M,D));
      this.SetShapeSlope(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FShapeSlope,M,D));
      this.SetShapeOverlap(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FShapeOverlap,M,D));
      this.SetTextSpacing(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FTextSpacing,M,D));
      this.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FFont.FHeight,M,D));
      this.FBadgeFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FBadgeFont.FHeight,M,D));
      this.SetCloseSize(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FCloseSize,M,D));
      this.SetProgressCircularSize(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FProgressCircularSize,M,D));
      this.SetInsertSize(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FInsertSize,M,D));
    };
    this.UpdateTabs = function () {
      if (this.FTabSet != null) this.FTabSet.UpdateTabs(false,false);
    };
    this.FillChanged = function (Sender) {
      this.UpdateTabs();
    };
    this.StrokeChanged = function (Sender) {
      this.UpdateTabs();
    };
    this.FontChanged = function (Sender) {
      this.UpdateTabs();
    };
    this.Create$1 = function (ATabSet) {
      this.FTabSet = ATabSet;
      this.FWordWrapping = false;
      this.FTrimming = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttCharacter;
      this.FShapeOverlap = 12;
      this.FTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      this.FShapeSlope = 11;
      this.FTextSpacing = 0;
      this.FProgressCircularSize = 15;
      this.FCloseSize = 14;
      this.FInsertSize = 20;
      this.FShapeRounding = 5;
      this.FTextColor = 0;
      this.FBadgeFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,42495,8421504,-1,-1]);
      this.FBadgeFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FBadgeStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,139,1.0]);
      this.FBadgeStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FBadgeFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      if ((this.FTabSet != null) && this.FTabSet.IsDesignTime()) {
        this.FBadgeFont.SetColor(139);
        this.FBadgeFont.SetStyle(rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsBold));
      };
      this.FBadgeFont.FOnChanged = rtl.createCallback(this,"FontChanged");
      this.FActiveTextColor = 0;
      this.FDisabledTextColor = 0;
      this.FDownTextColor = 0;
      this.FShowFocus = true;
      this.FFocusBorderColor = 0;
      this.FHoverTextColor = 0;
      this.FFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FFont.FOnChanged = rtl.createCallback(this,"FontChanged");
      this.FProgressFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16297243,8421504,-1,-1]);
      this.FProgressFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FProgressStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,16297243,1.0]);
      this.FProgressStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16316397,8421504,-1,-1]);
      this.FFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FDownFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,15655897,8421504,-1,-1]);
      this.FDownFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FActiveFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16777215,8421504,-1,-1]);
      this.FActiveFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FHoverFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16313827,8421504,-1,-1]);
      this.FHoverFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FDisabledFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,13882323,8421504,-1,-1]);
      this.FDisabledFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,11119017,1.0]);
      this.FStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FDownStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,11119017,1.0]);
      this.FDownStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FActiveStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,11119017,1.0]);
      this.FActiveStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FHoverStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,11119017,1.0]);
      this.FHoverStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FDisabledStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,11119017,1.0]);
      this.FDisabledStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FCloseFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone,16316397,8421504,-1,-1]);
      this.FCloseFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FCloseStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,11119017,1.0]);
      this.FCloseStroke.SetWidth(2);
      this.FCloseStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FCloseHoverFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,255,8421504,-1,-1]);
      this.FCloseHoverFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FCloseHoverStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,16777215,1.0]);
      this.FCloseHoverStroke.SetWidth(2);
      this.FCloseHoverStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FCloseDownFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,3937500,8421504,-1,-1]);
      this.FCloseDownFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FCloseDownStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,16777215,1.0]);
      this.FCloseDownStroke.SetWidth(2);
      this.FCloseDownStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FShape = $mod.TTMSFNCTabSetTabShape.tsPyramid;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCTabSetTabAppearance.isPrototypeOf(Source)) {
        this.FWordWrapping = rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FWordWrapping;
        this.FTrimming = rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FTrimming;
        this.FShapeOverlap = rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FShapeOverlap;
        this.FTextAlign = rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FTextAlign;
        this.FShapeSlope = rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FShapeSlope;
        this.FTextSpacing = rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FTextSpacing;
        this.FShapeRounding = rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FShapeRounding;
        this.FFont.Assign(rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FFont);
        this.FTextColor = rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FTextColor;
        this.FActiveTextColor = rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FActiveTextColor;
        this.FDisabledTextColor = rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FDisabledTextColor;
        this.FDownTextColor = rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FDownTextColor;
        this.FHoverTextColor = rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FHoverTextColor;
        this.FFill.Assign(rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FFill);
        this.FProgressFill.Assign(rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FProgressFill);
        this.FProgressStroke.Assign(rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FProgressStroke);
        this.FDownFill.Assign(rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FDownFill);
        this.FActiveFill.Assign(rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FActiveFill);
        this.FHoverFill.Assign(rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FHoverFill);
        this.FDisabledFill.Assign(rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FDisabledFill);
        this.FStroke.Assign(rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FStroke);
        this.FDownStroke.Assign(rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FDownStroke);
        this.FActiveStroke.Assign(rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FActiveStroke);
        this.FHoverStroke.Assign(rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FHoverStroke);
        this.FDisabledStroke.Assign(rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FDisabledStroke);
        this.FShape = rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FShape;
        this.FShowFocus = rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FShowFocus;
        this.FFocusBorderColor = rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FFocusBorderColor;
        this.FCloseSize = rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FCloseSize;
        this.FInsertSize = rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FInsertSize;
        this.FProgressCircularSize = rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FProgressCircularSize;
        this.FCloseFill.Assign(rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FCloseFill);
        this.FCloseStroke.Assign(rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FCloseStroke);
        this.FCloseHoverFill.Assign(rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FCloseHoverFill);
        this.FCloseHoverStroke.Assign(rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FCloseHoverStroke);
        this.FCloseDownFill.Assign(rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FCloseDownFill);
        this.FCloseDownStroke.Assign(rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FCloseDownStroke);
        this.FBadgeFont.Assign(rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FBadgeFont);
        this.FBadgeFill.Assign(rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FBadgeFill);
        this.FBadgeStroke.Assign(rtl.as(Source,$mod.TTMSFNCTabSetTabAppearance).FBadgeStroke);
      };
    };
    this.Destroy = function () {
      rtl.free(this,"FBadgeFont");
      rtl.free(this,"FBadgeFill");
      rtl.free(this,"FBadgeStroke");
      rtl.free(this,"FFont");
      rtl.free(this,"FFill");
      rtl.free(this,"FProgressFill");
      rtl.free(this,"FProgressStroke");
      rtl.free(this,"FDownFill");
      rtl.free(this,"FHoverFill");
      rtl.free(this,"FDisabledFill");
      rtl.free(this,"FActiveFill");
      rtl.free(this,"FStroke");
      rtl.free(this,"FDownStroke");
      rtl.free(this,"FHoverStroke");
      rtl.free(this,"FDisabledStroke");
      rtl.free(this,"FActiveStroke");
      rtl.free(this,"FCloseHoverStroke");
      rtl.free(this,"FCloseHoverFill");
      rtl.free(this,"FCloseFill");
      rtl.free(this,"FCloseStroke");
      rtl.free(this,"FCloseDownFill");
      rtl.free(this,"FCloseDownStroke");
      pas.System.TObject.Destroy.call(this);
    };
    var $r = this.$rtti;
    $r.addProperty("Font",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FFont","SetFont");
    $r.addProperty("ProgressFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FProgressFill","SetProgressFill");
    $r.addProperty("ProgressStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FProgressStroke","SetProgressStroke");
    $r.addProperty("Fill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFill","SetFill");
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
    $r.addProperty("ActiveFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FActiveFill","SetActiveFill");
    $r.addProperty("ActiveStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FActiveStroke","SetActiveStroke");
    $r.addProperty("DisabledFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FDisabledFill","SetDisabledFill");
    $r.addProperty("DisabledStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FDisabledStroke","SetDisabledStroke");
    $r.addProperty("DownFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FDownFill","SetDownFill");
    $r.addProperty("DownStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FDownStroke","SetDownStroke");
    $r.addProperty("HoverFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FHoverFill","SetHoverFill");
    $r.addProperty("HoverStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FHoverStroke","SetHoverStroke");
    $r.addProperty("WordWrapping",2,rtl.boolean,"FWordWrapping","SetWordWrapping",4,{Default: false});
    $r.addProperty("Trimming",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextTrimming"],"FTrimming","SetTrimming",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttCharacter});
    $r.addProperty("TextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FTextAlign","SetTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter});
    $r.addProperty("TextSpacing",2,rtl.double,"FTextSpacing","SetTextSpacing");
    $r.addProperty("Shape",2,$mod.$rtti["TTMSFNCTabSetTabShape"],"FShape","SetShape",4,{Default: $mod.TTMSFNCTabSetTabShape.tsPyramid});
    $r.addProperty("ShapeOverlap",14,rtl.double,"FShapeOverlap","SetShapeOverlap",4,{stored: "IsShapeOverlapStored"});
    $r.addProperty("ShapeSlope",14,rtl.double,"FShapeSlope","SetShapeSlope",4,{stored: "IsShapeSlopeStored"});
    $r.addProperty("ShapeRounding",14,rtl.double,"FShapeRounding","SetShapeRounding",4,{stored: "IsShapeRoundingStored"});
    $r.addProperty("TextColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FTextColor","SetTextColor",4,{Default: 0});
    $r.addProperty("ActiveTextColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FActiveTextColor","SetActiveTextColor",4,{Default: 0});
    $r.addProperty("HoverTextColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FHoverTextColor","SetHoverTextColor",4,{Default: 0});
    $r.addProperty("DownTextColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FDownTextColor","SetDownTextColor",4,{Default: 0});
    $r.addProperty("DisabledTextColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FDisabledTextColor","SetDisabledTextColor",4,{Default: 0});
    $r.addProperty("ShowFocus",2,rtl.boolean,"FShowFocus","SetShowFocus",4,{Default: true});
    $r.addProperty("FocusBorderColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FFocusBorderColor","SetFocusBorderColor",4,{Default: 0});
    $r.addProperty("ProgressCircularSize",14,rtl.double,"FProgressCircularSize","SetProgressCircularSize",4,{stored: "IsProgressCircularSizeStored"});
    $r.addProperty("InsertSize",14,rtl.double,"FInsertSize","SetInsertSize",4,{stored: "IsInsertSizeStored"});
    $r.addProperty("CloseSize",14,rtl.double,"FCloseSize","SetCloseSize",4,{stored: "IsCloseSizeStored"});
    $r.addProperty("CloseFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FCloseFill","SetCloseFill");
    $r.addProperty("CloseStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FCloseStroke","SetCloseStroke");
    $r.addProperty("CloseDownFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FCloseDownFill","SetCloseDownFill");
    $r.addProperty("CloseDownStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FCloseDownStroke","SetCloseDownStroke");
    $r.addProperty("CloseHoverFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FCloseHoverFill","SetCloseHoverFill");
    $r.addProperty("CloseHoverStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FCloseHoverStroke","SetCloseHoverStroke");
    $r.addProperty("BadgeFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FBadgeFill","SetBadgeFill");
    $r.addProperty("BadgeStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FBadgeStroke","SetBadgeStroke");
    $r.addProperty("BadgeFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FBadgeFont","SetBadgeFont");
  });
  rtl.createClass(this,"TTMSFNCTabSetLayout",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FTabSet = null;
      this.FMultiline = 0;
      this.FPosition = 0;
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FTabSet = undefined;
      this.FOnChange = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetMultiline = function (Value) {
      if (this.FMultiline !== Value) {
        this.FMultiline = Value;
        this.UpdateTabs();
      };
    };
    this.SetPosition = function (Value) {
      if (this.FPosition !== Value) {
        this.FPosition = Value;
        if ((this.FTabSet != null) && (this.FTabSet.FTabList != null)) {
          var $tmp = this.FPosition;
          if ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) {
            this.FTabSet.FTabListPopup.SetPlacement(pas["WEBLib.TMSFNCPopup"].TTMSFNCPopupPlacement.ppRight)}
           else if ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) {
            this.FTabSet.FTabListPopup.SetPlacement(pas["WEBLib.TMSFNCPopup"].TTMSFNCPopupPlacement.ppBottom)}
           else if ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom) {
            this.FTabSet.FTabListPopup.SetPlacement(pas["WEBLib.TMSFNCPopup"].TTMSFNCPopupPlacement.ppTop)}
           else if ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpRight) this.FTabSet.FTabListPopup.SetPlacement(pas["WEBLib.TMSFNCPopup"].TTMSFNCPopupPlacement.ppLeft);
        };
        this.UpdateTabs();
      };
    };
    this.UpdateTabs = function () {
      if (this.FOnChange != null) this.FOnChange(this);
      if (this.FTabSet != null) this.FTabSet.UpdateTabs(false,false);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCTabSetLayout.isPrototypeOf(Source)) {
        this.FMultiline = rtl.as(Source,$mod.TTMSFNCTabSetLayout).FMultiline;
        this.FPosition = rtl.as(Source,$mod.TTMSFNCTabSetLayout).FPosition;
      };
    };
    this.Create$1 = function (ATabSet) {
      this.FTabSet = ATabSet;
      this.FMultiline = $mod.TTMSFNCTabSetLayoutMultiline.tlmNone;
      this.FPosition = $mod.TTMSFNCTabSetLayoutPosition.tlpTop;
      return this;
    };
    var $r = this.$rtti;
    $r.addProperty("Position",2,$mod.$rtti["TTMSFNCTabSetLayoutPosition"],"FPosition","SetPosition",4,{Default: $mod.TTMSFNCTabSetLayoutPosition.tlpTop});
    $r.addProperty("Multiline",2,$mod.$rtti["TTMSFNCTabSetLayoutMultiline"],"FMultiline","SetMultiline",4,{Default: $mod.TTMSFNCTabSetLayoutMultiline.tlmNone});
  });
  rtl.createClass(this,"TTMSFNCTabSetInteraction",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FTabSet = null;
      this.FSelectTabOnFocus = false;
      this.FEditing = false;
      this.FSelectTabOnInsert = false;
      this.FSelectTabOnScroll = false;
      this.FInsertTabWithKeyboard = false;
      this.FCloseTabWithKeyboard = false;
      this.FAutoOpenURL = false;
      this.FReorder = false;
    };
    this.$final = function () {
      this.FTabSet = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.UpdateTabs = function () {
      if (this.FTabSet != null) this.FTabSet.UpdateTabs(false,false);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCTabSetInteraction.isPrototypeOf(Source)) {
        this.FSelectTabOnFocus = rtl.as(Source,$mod.TTMSFNCTabSetInteraction).FSelectTabOnFocus;
        this.FSelectTabOnInsert = rtl.as(Source,$mod.TTMSFNCTabSetInteraction).FSelectTabOnInsert;
        this.FSelectTabOnScroll = rtl.as(Source,$mod.TTMSFNCTabSetInteraction).FSelectTabOnScroll;
        this.FEditing = rtl.as(Source,$mod.TTMSFNCTabSetInteraction).FEditing;
        this.FCloseTabWithKeyboard = rtl.as(Source,$mod.TTMSFNCTabSetInteraction).FCloseTabWithKeyboard;
        this.FInsertTabWithKeyboard = rtl.as(Source,$mod.TTMSFNCTabSetInteraction).FInsertTabWithKeyboard;
        this.FAutoOpenURL = rtl.as(Source,$mod.TTMSFNCTabSetInteraction).FAutoOpenURL;
        this.FReorder = rtl.as(Source,$mod.TTMSFNCTabSetInteraction).FReorder;
      };
    };
    this.Create$1 = function (ATabSet) {
      this.FTabSet = ATabSet;
      this.FSelectTabOnFocus = true;
      this.FSelectTabOnInsert = true;
      this.FSelectTabOnScroll = true;
      this.FEditing = false;
      this.FInsertTabWithKeyboard = true;
      this.FCloseTabWithKeyboard = true;
      this.FAutoOpenURL = true;
      this.FReorder = false;
      return this;
    };
    var $r = this.$rtti;
    $r.addProperty("SelectTabOnFocus",0,rtl.boolean,"FSelectTabOnFocus","FSelectTabOnFocus",4,{Default: true});
    $r.addProperty("SelectTabOnInsert",0,rtl.boolean,"FSelectTabOnInsert","FSelectTabOnInsert",4,{Default: true});
    $r.addProperty("SelectTabOnScroll",0,rtl.boolean,"FSelectTabOnScroll","FSelectTabOnScroll",4,{Default: true});
    $r.addProperty("Editing",0,rtl.boolean,"FEditing","FEditing",4,{Default: false});
    $r.addProperty("CloseTabWithKeyboard",0,rtl.boolean,"FCloseTabWithKeyboard","FCloseTabWithKeyboard",4,{Default: true});
    $r.addProperty("InsertTabWithKeyboard",0,rtl.boolean,"FInsertTabWithKeyboard","FInsertTabWithKeyboard",4,{Default: true});
    $r.addProperty("AutoOpenURL",0,rtl.boolean,"FAutoOpenURL","FAutoOpenURL",4,{Default: true});
    $r.addProperty("Reorder",0,rtl.boolean,"FReorder","FReorder",4,{Default: false});
  });
  rtl.createClass(this,"TTMSFNCTabSetOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FTabSet = null;
      this.FCloseMode = 0;
      this.FInsertMode = 0;
      this.FTabListButton = false;
      this.FCloseAction = 0;
    };
    this.$final = function () {
      this.FTabSet = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetCloseMode = function (Value) {
      if (this.FCloseMode !== Value) {
        this.FCloseMode = Value;
        this.UpdateTabs();
      };
    };
    this.SetInsertMode = function (Value) {
      if (this.FInsertMode !== Value) {
        this.FInsertMode = Value;
        this.UpdateTabs();
      };
    };
    this.SetTabListButton = function (Value) {
      if (this.FTabListButton !== Value) {
        this.FTabListButton = Value;
        this.UpdateTabs();
      };
    };
    this.UpdateTabs = function () {
      if (this.FTabSet != null) this.FTabSet.UpdateTabs(false,false);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCTabSetOptions.isPrototypeOf(Source)) {
        this.FCloseMode = rtl.as(Source,$mod.TTMSFNCTabSetOptions).FCloseMode;
        this.FInsertMode = rtl.as(Source,$mod.TTMSFNCTabSetOptions).FInsertMode;
        this.FTabListButton = rtl.as(Source,$mod.TTMSFNCTabSetOptions).FTabListButton;
        this.FCloseAction = rtl.as(Source,$mod.TTMSFNCTabSetOptions).FCloseAction;
      };
    };
    this.Create$1 = function (ATabSet) {
      this.FTabSet = ATabSet;
      this.FCloseMode = $mod.TTMSFNCTabSetCloseMode.tcmNone;
      this.FInsertMode = $mod.TTMSFNCTabSetInsertMode.timNone;
      this.FTabListButton = false;
      this.FCloseAction = $mod.TTMSFNCTabSetTabCloseAction.ttcaHide;
      return this;
    };
    var $r = this.$rtti;
    $r.addProperty("CloseMode",2,$mod.$rtti["TTMSFNCTabSetCloseMode"],"FCloseMode","SetCloseMode",4,{Default: $mod.TTMSFNCTabSetCloseMode.tcmNone});
    $r.addProperty("CloseAction",0,$mod.$rtti["TTMSFNCTabSetTabCloseAction"],"FCloseAction","FCloseAction",4,{Default: $mod.TTMSFNCTabSetTabCloseAction.ttcaHide});
    $r.addProperty("InsertMode",2,$mod.$rtti["TTMSFNCTabSetInsertMode"],"FInsertMode","SetInsertMode",4,{Default: $mod.TTMSFNCTabSetInsertMode.timNone});
    $r.addProperty("TabListButton",2,rtl.boolean,"FTabListButton","SetTabListButton",4,{Default: false});
  });
  this.TTMSFNCTabSetButtonState = {"0": "tbsNormal", tbsNormal: 0, "1": "tbsHover", tbsHover: 1, "2": "tbsDown", tbsDown: 2, "3": "tbsDisabled", tbsDisabled: 3};
  this.$rtti.$Enum("TTMSFNCTabSetButtonState",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TTMSFNCTabSetButtonState});
  this.TTMSFNCTabSetTabState = {"0": "ttsNormal", ttsNormal: 0, "1": "ttsHover", ttsHover: 1, "2": "ttsDown", ttsDown: 2, "3": "ttsActive", ttsActive: 3, "4": "ttsDisabled", ttsDisabled: 4};
  this.$rtti.$Enum("TTMSFNCTabSetTabState",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TTMSFNCTabSetTabState});
  this.TTMSFNCTabSetMenuButton = {"0": "tmbClose", tmbClose: 0, "1": "tmbInsert", tmbInsert: 1, "2": "tmbTabList", tmbTabList: 2, "3": "tmbScrollPrevious", tmbScrollPrevious: 3, "4": "tmbScrollNext", tmbScrollNext: 4};
  this.$rtti.$Enum("TTMSFNCTabSetMenuButton",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TTMSFNCTabSetMenuButton});
  this.$rtti.$MethodVar("TTMSFNCTabSetBeforeReorderTabEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACurrentTabIndex",rtl.longint],["ANewTabIndex",rtl.longint],["ACanReorder",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTabSetBeforeChangeTabEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACurrentTabIndex",rtl.longint],["ANewTabIndex",rtl.longint],["ACanChange",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTabSetChangeTabEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["APreviousTabIndex",rtl.longint],["ACurrentTabIndex",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTabSetReorderTabEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["APreviousTabIndex",rtl.longint],["ACurrentTabIndex",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTabSetBeforeCloseTabEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ATabIndex",rtl.longint],["ACloseAction",this.$rtti["TTMSFNCTabSetTabCloseAction"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTabSetCloseTabEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ATabIndex",rtl.longint],["ACloseAction",this.$rtti["TTMSFNCTabSetTabCloseAction"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTabSetBeforeInsertTabEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANewTabIndex",rtl.longint,1],["ACanInsert",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTabSetInsertTabEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANewTabIndex",rtl.longint]]), methodkind: 0});
  this.$rtti.$ClassRef("TTMSFNCTabSetInplaceEditorClass",{instancetype: pas["WEBLib.Controls"].$rtti["TWinControl"]});
  this.$rtti.$MethodVar("TTMSFNCTabSetCustomizeInplaceEditorEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ATabIndex",rtl.longint],["AInplaceEditor",pas["WEBLib.Controls"].$rtti["TWinControl"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTabSetGetInplaceEditorRectEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ATabIndex",rtl.longint],["AInplaceEditor",pas["WEBLib.Controls"].$rtti["TWinControl"]],["AInplaceEditorRect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTabSetGetInplaceEditorEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ATabIndex",rtl.longint],["AInplaceEditorClass",this.$rtti["TTMSFNCTabSetInplaceEditorClass"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTabSetBeforeOpenInplaceEditorEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ATabIndex",rtl.longint],["ACanOpen",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTabSetOpenInplaceEditorEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ATabIndex",rtl.longint],["AInplaceEditor",pas["WEBLib.Controls"].$rtti["TWinControl"]],["AInplaceEditorRect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTabSetCloseInplaceEditorEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ATabIndex",rtl.longint],["AInplaceEditor",pas["WEBLib.Controls"].$rtti["TWinControl"]],["ACancelled",rtl.boolean],["ACanClose",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTabSetBeforeUpdateTabEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ATabIndex",rtl.longint],["AText",rtl.string,1],["ACanUpdate",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTabSetUpdateTabEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ATabIndex",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTabSetAnchorTabClickEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ATabIndex",rtl.longint],["AAnchor",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTabSetBeforeDrawTabBackgroundEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ATabIndex",rtl.longint],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AState",this.$rtti["TTMSFNCTabSetTabState"]],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTabSetBeforeDrawTabProgressEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ATabIndex",rtl.longint],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AProgressMode",this.$rtti["TTMSFNCTabSetTabProgressMode"]],["AProgressKind",this.$rtti["TTMSFNCTabSetTabProgressKind"]],["AAnimationStartAngle",rtl.double],["AAnimationSweepAngle",rtl.double],["AProgress",rtl.double],["AProgressMax",rtl.double],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTabSetBeforeDrawTabBadgeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ATabIndex",rtl.longint],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AText",rtl.string],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTabSetBeforeDrawTabTextEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ATabIndex",rtl.longint],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AText",rtl.string],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTabSetBeforeDrawTabCloseButtonEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ATabIndex",rtl.longint],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AState",this.$rtti["TTMSFNCTabSetButtonState"]],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTabSetBeforeDrawTabBitmapEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ATabIndex",rtl.longint],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTabSetAfterDrawTabBackgroundEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ATabIndex",rtl.longint],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AState",this.$rtti["TTMSFNCTabSetTabState"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTabSetAfterDrawTabProgressEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ATabIndex",rtl.longint],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AProgressMode",this.$rtti["TTMSFNCTabSetTabProgressMode"]],["AProgressKind",this.$rtti["TTMSFNCTabSetTabProgressKind"]],["AAnimationStartAngle",rtl.double],["AAnimationSweepAngle",rtl.double],["AProgress",rtl.double],["AProgressMax",rtl.double]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTabSetAfterDrawTabBadgeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ATabIndex",rtl.longint],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AText",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTabSetAfterDrawTabTextEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ATabIndex",rtl.longint],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AText",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTabSetAfterDrawTabCloseButtonEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ATabIndex",rtl.longint],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AState",this.$rtti["TTMSFNCTabSetButtonState"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTabSetAfterDrawTabBitmapEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ATabIndex",rtl.longint],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTabSetBeforeDrawMenuButton",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AButton",this.$rtti["TTMSFNCTabSetMenuButton"]],["AState",this.$rtti["TTMSFNCTabSetButtonState"]],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCTabSetAfterDrawMenuButton",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AButton",this.$rtti["TTMSFNCTabSetMenuButton"]],["AState",this.$rtti["TTMSFNCTabSetButtonState"]]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCTabSetEdit",pas["WEBLib.StdCtrls"].TEdit,function () {
    this.$init = function () {
      pas["WEBLib.StdCtrls"].TEdit.$init.call(this);
      this.FTabSet = null;
    };
    this.$final = function () {
      this.FTabSet = undefined;
      pas["WEBLib.StdCtrls"].TEdit.$final.call(this);
    };
    this.KeyDown = function (Key, Shift) {
      pas["WEBLib.Controls"].TControl.KeyDown.apply(this,arguments);
      if ((this.FTabSet != null) && this.FTabSet.FInplaceEditorActive) {
        var $tmp = Key.get();
        if ($tmp === 27) {
          this.FTabSet.CloseInplaceEditor(true);
          this.FTabSet.FInplaceEditorClosed = true;
          Key.set(0);
        } else if (($tmp === 113) || ($tmp === 13)) {
          this.FTabSet.CloseInplaceEditor(false);
          this.FTabSet.FInplaceEditorClosed = true;
          Key.set(0);
        };
      };
    };
    this.DoExit = function () {
      pas["WEBLib.Controls"].TControl.DoExit.call(this);
      if ((this.FTabSet != null) && this.FTabSet.FInplaceEditorActive) this.FTabSet.CloseInplaceEditor(false);
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.Controls"].TControl.Create$1.apply(this,arguments);
      if ($mod.TTMSFNCCustomTabSet.isPrototypeOf(AOwner)) this.FTabSet = rtl.as(AOwner,$mod.TTMSFNCCustomTabSet);
      return this;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCCustomTabSet",pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$init.call(this);
      this.FPersistence = false;
      this.FTotalTabHeight = 0.0;
      this.FDownX = 0.0;
      this.FDownY = 0.0;
      this.FDragDownX = 0.0;
      this.FDragDownY = 0.0;
      this.FClosing = false;
      this.FTabAnchor = "";
      this.FDblClicked = false;
      this.FInplaceEditorClosed = false;
      this.FCloseWithDialogKey = false;
      this.FUpdateTab = $mod.TTMSFNCTabSetDisplayTab.$new();
      this.FInplaceEditorClass = null;
      this.FInplaceEditor = null;
      this.FInplaceEditorActive = false;
      this.FMenuSize = 0.0;
      this.FInvisibleTabList = null;
      this.FTabListPopup = null;
      this.FTabList = null;
      this.FFirstTabIndex = 0;
      this.FLastTabIndex = 0;
      this.FTabListButtonState = 0;
      this.FCloseButtonState = 0;
      this.FInsertButtonState = 0;
      this.FScrollButtonPreviousState = 0;
      this.FScrollButtonNextState = 0;
      this.FPrevTabListButtonState = 0;
      this.FPrevCloseButtonState = 0;
      this.FPrevInsertButtonState = 0;
      this.FPrevScrollButtonPreviousState = 0;
      this.FPrevScrollButtonNextState = 0;
      this.FScrollButtonNextDisabled = false;
      this.FScrollButtonPreviousDisabled = false;
      this.FShowMenu = false;
      this.FShowScrollButtons = false;
      this.FAllowScrolling = false;
      this.FShowCloseButton = false;
      this.FShowTabListButton = false;
      this.FShowInsertButton = false;
      this.FInsertTab = null;
      this.FDragTab = null;
      this.FActiveTabIndex = 0;
      this.FDownCount = 0;
      this.FAnimTimer = null;
      this.FDownTimer = null;
      this.FActiveTab = null;
      this.FFocusedTab = null;
      this.FPrevTab = null;
      this.FDownTab = null;
      this.FPrevHoverTab = null;
      this.FHoverTab = null;
      this.FTabChanging = false;
      this.FDownCloseTab = null;
      this.FHoverCloseTab = null;
      this.FPrevHoverCloseTab = null;
      this.FDragTabDisplay = $mod.TTMSFNCTabSetDisplayTab.$new();
      this.FOrigRect$1 = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FStartTab = 0;
      this.FScrollCount = 0;
      this.FUpdateCount$1 = 0;
      this.FDisplayList = null;
      this.FBitmapContainer = null;
      this.FTabs = null;
      this.FTabSize = null;
      this.FLayout = null;
      this.FTabAppearance = null;
      this.FInteraction = null;
      this.FOnChangeTab = null;
      this.FOnCloseTab = null;
      this.FOnBeforeChangeTab = null;
      this.FOnBeforeCloseTab = null;
      this.FOptions = null;
      this.FOnInsertTab = null;
      this.FOnBeforeInsertTab = null;
      this.FButtonAppearance = null;
      this.FOnGetInplaceEditorRect = null;
      this.FOnCustomizeInplaceEditor = null;
      this.FOnOpenInplaceEditor = null;
      this.FOnGetInplaceEditor = null;
      this.FOnCloseInplaceEditor = null;
      this.FOnBeforeOpenInplaceEditor = null;
      this.FOnUpdateTab = null;
      this.FOnBeforeUpdateTab = null;
      this.FOnAnchorTabClick = null;
      this.FOnReorderTab = null;
      this.FOnBeforeReorderTab = null;
      this.FOnBeforeDrawTabBadge = null;
      this.FOnBeforeDrawTabText = null;
      this.FOnAfterDrawTabBackground = null;
      this.FOnAfterDrawTabBitmap = null;
      this.FOnBeforeDrawTabCloseButton = null;
      this.FOnAfterDrawTabProgress = null;
      this.FOnAfterDrawTabBadge = null;
      this.FOnAfterDrawTabText = null;
      this.FOnAfterDrawTabCloseButton = null;
      this.FOnBeforeDrawTabBackground = null;
      this.FOnBeforeDrawTabBitmap = null;
      this.FOnBeforeDrawTabProgress = null;
      this.FOnAfterDrawMenuButton = null;
      this.FOnBeforeDrawMenuButton = null;
      this.FGlobalFont = null;
    };
    this.$final = function () {
      this.FUpdateTab = undefined;
      this.FInplaceEditorClass = undefined;
      this.FInplaceEditor = undefined;
      this.FInvisibleTabList = undefined;
      this.FTabListPopup = undefined;
      this.FTabList = undefined;
      this.FInsertTab = undefined;
      this.FDragTab = undefined;
      this.FAnimTimer = undefined;
      this.FDownTimer = undefined;
      this.FActiveTab = undefined;
      this.FFocusedTab = undefined;
      this.FPrevTab = undefined;
      this.FDownTab = undefined;
      this.FPrevHoverTab = undefined;
      this.FHoverTab = undefined;
      this.FDownCloseTab = undefined;
      this.FHoverCloseTab = undefined;
      this.FPrevHoverCloseTab = undefined;
      this.FDragTabDisplay = undefined;
      this.FOrigRect$1 = undefined;
      this.FDisplayList = undefined;
      this.FBitmapContainer = undefined;
      this.FTabs = undefined;
      this.FTabSize = undefined;
      this.FLayout = undefined;
      this.FTabAppearance = undefined;
      this.FInteraction = undefined;
      this.FOnChangeTab = undefined;
      this.FOnCloseTab = undefined;
      this.FOnBeforeChangeTab = undefined;
      this.FOnBeforeCloseTab = undefined;
      this.FOptions = undefined;
      this.FOnInsertTab = undefined;
      this.FOnBeforeInsertTab = undefined;
      this.FButtonAppearance = undefined;
      this.FOnGetInplaceEditorRect = undefined;
      this.FOnCustomizeInplaceEditor = undefined;
      this.FOnOpenInplaceEditor = undefined;
      this.FOnGetInplaceEditor = undefined;
      this.FOnCloseInplaceEditor = undefined;
      this.FOnBeforeOpenInplaceEditor = undefined;
      this.FOnUpdateTab = undefined;
      this.FOnBeforeUpdateTab = undefined;
      this.FOnAnchorTabClick = undefined;
      this.FOnReorderTab = undefined;
      this.FOnBeforeReorderTab = undefined;
      this.FOnBeforeDrawTabBadge = undefined;
      this.FOnBeforeDrawTabText = undefined;
      this.FOnAfterDrawTabBackground = undefined;
      this.FOnAfterDrawTabBitmap = undefined;
      this.FOnBeforeDrawTabCloseButton = undefined;
      this.FOnAfterDrawTabProgress = undefined;
      this.FOnAfterDrawTabBadge = undefined;
      this.FOnAfterDrawTabText = undefined;
      this.FOnAfterDrawTabCloseButton = undefined;
      this.FOnBeforeDrawTabBackground = undefined;
      this.FOnBeforeDrawTabBitmap = undefined;
      this.FOnBeforeDrawTabProgress = undefined;
      this.FOnAfterDrawMenuButton = undefined;
      this.FOnBeforeDrawMenuButton = undefined;
      this.FGlobalFont = undefined;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$final.call(this);
    };
    this.SetTabs = function (Value) {
      this.FTabs.Assign(Value);
    };
    this.SetTabSize = function (Value) {
      this.FTabSize.Assign(Value);
    };
    this.SetLayout = function (Value) {
      if (this.FLayout !== Value) {
        this.FLayout = Value;
        this.UpdateTabs(false,false);
      };
    };
    this.SetTabAppearance = function (Value) {
      this.FTabAppearance.Assign(Value);
    };
    this.GetActiveTab = function () {
      var Result = null;
      Result = null;
      if ((this.FActiveTabIndex >= 0) && (this.FActiveTabIndex <= (this.FTabs.GetCount() - 1))) Result = this.FTabs.GetTab(this.FActiveTabIndex);
      return Result;
    };
    this.GetActiveTabIndex = function () {
      var Result = 0;
      Result = this.FActiveTabIndex;
      if (this.FActiveTab != null) Result = this.FActiveTab.GetIndex();
      return Result;
    };
    this.SetActiveTab = function (Value) {
      this.HandleChangeTab(Value);
    };
    this.SetActiveTabIndex = function (Value) {
      this.FActiveTabIndex = Math.max(0,Math.min(Value,this.FTabs.GetCount() - 1));
      if ((this.FActiveTabIndex >= 0) && (this.FActiveTabIndex <= (this.FTabs.GetCount() - 1))) {
        this.SetActiveTab(this.FTabs.GetTab(this.FActiveTabIndex))}
       else this.SetActiveTab(null);
    };
    this.SetInteraction = function (Value) {
      this.FInteraction.Assign(Value);
    };
    this.SetOptions = function (Value) {
      this.FOptions.Assign(Value);
    };
    this.SetButtonAppearance = function (Value) {
      this.FButtonAppearance.Assign(Value);
    };
    this.GetBitmapContainer = function () {
      var Result = null;
      Result = this.FBitmapContainer;
      return Result;
    };
    this.SetAllowScrolling = function (Value) {
      if (this.FAllowScrolling !== Value) {
        this.FAllowScrolling = Value;
        this.UpdateTabs(false,false);
      };
    };
    this.SetGlobalFont = function (Value) {
      this.FGlobalFont.Assign(Value);
    };
    this.GetItemClass = function () {
      var Result = null;
      this.FPersistence = true;
      Result = this.GetTabClass();
      return Result;
    };
    this.CreateObject = function (AClassName, ABaseClass) {
      var Result = null;
      Result = this.GetTabClass().$create("Create$1",[null]);
      return Result;
    };
    this.GetTabClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCTabSetTab;
      return Result;
    };
    this.GetDocURL = function () {
      var Result = "";
      Result = pas["WEBLib.TMSFNCTypes"].TTMSFNCBaseDocURL + "tmsfncuipack/components/" + pas.SysUtils.LowerCase(this.$classname);
      return Result;
    };
    this.HandleDesignHitTest = function (APoint) {
      var Result = false;
      var tb = $mod.TTMSFNCTabSetDisplayTab.$new();
      Result = pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleDesignHitTest.call(this,APoint);
      tb.$assign(this.XYToTab(APoint.x,APoint.y,null));
      if (tb.Tab != null) Result = true;
      return Result;
    };
    this.GetHintString = function () {
      var Result = "";
      Result = pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBase.GetHintString.call(this);
      if (this.FHoverTab != null) Result = this.FHoverTab.FHint;
      return Result;
    };
    this.HasHint = function () {
      var Result = false;
      Result = (this.FHoverTab != null) && (this.FHoverTab.FHint !== "");
      return Result;
    };
    this.CreateTabs = function () {
      var Result = null;
      Result = $mod.TTMSFNCTabSetTabs.$create("Create$3",[this]);
      return Result;
    };
    this.GetTotalTabHeight = function () {
      var Result = 0.0;
      Result = this.FTotalTabHeight;
      return Result;
    };
    this.GetVersion = function () {
      var Result = "";
      Result = this.$class.GetVersionNumber(1,0,1,1);
      return Result;
    };
    this.GetInnerTabRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var I = 0;
      var tbd = $mod.TTMSFNCTabSetDisplayTab.$new();
      var tb = null;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(this.GetLocalRect());
      r.$assign(Result);
      var $tmp = this.FLayout.FPosition;
      if ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) {
        Result.Left = r.Left + this.FTabSize.FMargins.FLeft + 1;
        Result.Top = r.Top + this.FTabSize.FMargins.FTop;
        Result.Right = r.Left + this.FTabSize.FMargins.FLeft + this.FTabSize.FHeight;
        Result.Bottom = Result.Top;
      } else if ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) {
        Result.Left = r.Left + this.FTabSize.FMargins.FLeft;
        Result.Top = r.Top + this.FTabSize.FMargins.FTop + 1;
        Result.Bottom = r.Top + this.FTabSize.FMargins.FTop + this.FTabSize.FHeight;
        Result.Right = Result.Left;
      } else if ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom) {
        Result.Left = r.Left + this.FTabSize.FMargins.FLeft;
        Result.Top = r.Bottom - this.FTabSize.FMargins.FBottom - this.FTabSize.FHeight;
        Result.Bottom = r.Bottom - this.FTabSize.FMargins.FBottom - 1;
        Result.Right = Result.Left;
      } else if ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpRight) {
        Result.Left = r.Right - this.FTabSize.FMargins.FRight - this.FTabSize.FHeight;
        Result.Top = r.Top + this.FTabSize.FMargins.FTop;
        Result.Right = r.Right - this.FTabSize.FMargins.FRight - 1;
        Result.Bottom = Result.Top;
      };
      for (var $l = this.GetDisplayCount() - 1; $l >= 0; $l--) {
        I = $l;
        tbd.$assign(this.FDisplayList.GetItem(I));
        tb = tbd.Tab;
        if (tb != null) {
          r.$assign(tb.GetFixedRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(tbd.Rect),$mod.TTMSFNCTabSetDisplayTab.$clone(tbd)));
          var $tmp1 = this.FLayout.FPosition;
          if (($tmp1 === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp1 === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom)) {
            if (r.Right > Result.Right) Result.Right = r.Right;
          } else if (($tmp1 === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) || ($tmp1 === $mod.TTMSFNCTabSetLayoutPosition.tlpRight)) {
            if (r.Bottom > Result.Bottom) Result.Bottom = r.Bottom;
          };
        };
      };
      return Result;
    };
    this.GetTabSize = function (ATabIndex) {
      var Result = 0.0;
      Result = 0;
      if ((ATabIndex === (this.GetTotalTabCount() - 1)) && (this.FOptions.FInsertMode === $mod.TTMSFNCTabSetInsertMode.timTab)) {
        Result = this.FTabAppearance.FInsertSize}
       else if ((ATabIndex >= 0) && (ATabIndex <= (this.FTabs.GetCount() - 1))) {
        var $tmp = this.FTabSize.FMode;
        if ($tmp === $mod.TTMSFNCTabSetTabSizeMode.tsmAutoTabSize) {
          Result = this.FTabs.GetTab(ATabIndex).GetAutoSize();
          if (this.FTabAppearance.FShape in rtl.createSet($mod.TTMSFNCTabSetTabShape.tsPyramidLeft,$mod.TTMSFNCTabSetTabShape.tsPyramidRight,$mod.TTMSFNCTabSetTabShape.tsPyramid)) {
            Result = Result + (this.FTabAppearance.FShapeSlope * 2)}
           else if (this.FTabAppearance.FShape in rtl.createSet($mod.TTMSFNCTabSetTabShape.tsRoundLeft,$mod.TTMSFNCTabSetTabShape.tsRoundRight,$mod.TTMSFNCTabSetTabShape.tsRound)) {
            Result = Result + this.FTabAppearance.FShapeSlope}
           else Result = Result + (this.FTabAppearance.FShapeOverlap * 2);
          Result = Result + this.FTabAppearance.FTextSpacing;
        } else if (($tmp === $mod.TTMSFNCTabSetTabSizeMode.tsmFixedSize) || ($tmp === $mod.TTMSFNCTabSetTabSizeMode.tsmFixedSizeAutoShrink)) {
          if (this.FTabs.GetTab(ATabIndex).FWidth > -1) {
            Result = this.FTabs.GetTab(ATabIndex).FWidth}
           else Result = this.FTabSize.FWidth;
        };
      };
      return Result;
    };
    this.GetTotalTabCount = function () {
      var Result = 0;
      Result = this.FTabs.GetCount();
      if (this.FOptions.FInsertMode === $mod.TTMSFNCTabSetInsertMode.timTab) Result = Result + 1;
      return Result;
    };
    this.GetTabRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var sz = 0.0;
      Result.$assign(this.GetLocalRect());
      r.$assign(Result);
      sz = this.FMenuSize;
      var $tmp = this.FLayout.FPosition;
      if ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) {
        Result.Left = r.Left + this.FTabSize.FMargins.FLeft + 1;
        Result.Top = r.Top + this.FTabSize.FMargins.FTop;
        Result.Right = r.Left + this.FTabSize.FMargins.FLeft + this.FTabSize.FHeight;
        if (this.FShowMenu) {
          Result.Bottom = r.Bottom - this.FTabSize.FMargins.FBottom - sz}
         else Result.Bottom = r.Bottom - this.FTabSize.FMargins.FBottom;
      } else if ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) {
        Result.Left = r.Left + this.FTabSize.FMargins.FLeft;
        Result.Top = r.Top + this.FTabSize.FMargins.FTop + 1;
        if (this.FShowMenu) {
          Result.Right = r.Right - this.FTabSize.FMargins.FRight - sz}
         else Result.Right = r.Right - this.FTabSize.FMargins.FRight;
        Result.Bottom = r.Top + this.FTabSize.FMargins.FTop + this.FTabSize.FHeight;
      } else if ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom) {
        Result.Left = r.Left + this.FTabSize.FMargins.FLeft;
        Result.Top = r.Bottom - this.FTabSize.FMargins.FBottom - this.FTabSize.FHeight;
        if (this.FShowMenu) {
          Result.Right = r.Right - this.FTabSize.FMargins.FRight - sz}
         else Result.Right = r.Right - this.FTabSize.FMargins.FRight;
        Result.Bottom = r.Bottom - this.FTabSize.FMargins.FBottom - 1;
      } else if ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpRight) {
        Result.Left = r.Right - this.FTabSize.FMargins.FRight - this.FTabSize.FHeight;
        Result.Top = r.Top + this.FTabSize.FMargins.FTop;
        Result.Right = r.Right - this.FTabSize.FMargins.FRight - 1;
        if (this.FShowMenu) {
          Result.Bottom = r.Bottom - this.FTabSize.FMargins.FBottom - sz}
         else Result.Bottom = r.Bottom - this.FTabSize.FMargins.FBottom;
      };
      return Result;
    };
    this.GetMenuRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var sz = 0.0;
      Result.$assign(this.GetTabRect());
      r.$assign(Result);
      sz = this.FMenuSize;
      var $tmp = this.FLayout.FPosition;
      if (($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom)) {
        Result.Left = r.Right;
        Result.Top = r.Top;
        Result.Right = r.Right + sz;
        Result.Bottom = r.Bottom;
      } else if (($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) || ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpRight)) {
        Result.Left = r.Left;
        Result.Top = r.Bottom;
        Result.Right = r.Right;
        Result.Bottom = r.Bottom + sz;
      };
      return Result;
    };
    this.GetVisibleTabCount = function () {
      var Result = 0;
      var I = 0;
      Result = 0;
      for (var $l = 0, $end = this.FTabs.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (this.IsTabVisible(I)) Result += 1;
      };
      return Result;
    };
    this.GetInvisibleTabCount = function () {
      var Result = 0;
      var I = 0;
      Result = 0;
      for (var $l = 0, $end = this.FTabs.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (!this.IsTabVisible(I)) Result += 1;
      };
      return Result;
    };
    this.GetInvisibleTabCountForScrolling = function () {
      var Result = 0;
      var I = 0;
      Result = 0;
      for (var $l = this.FStartTab, $end = this.FLastTabIndex; $l <= $end; $l++) {
        I = $l;
        if (!this.IsTabVisible(I)) Result += 1;
      };
      return Result;
    };
    this.GetLastScrollableTabIndex = function () {
      var Result = 0;
      var I = 0;
      Result = 0;
      for (var $l = this.FTabs.GetCount() - 1; $l >= 0; $l--) {
        I = $l;
        if (this.IsTabVisible(I) && this.IsTabEnabled(I)) {
          Result = I;
          break;
        };
      };
      return Result;
    };
    this.GetFirstScrollableTabIndex = function () {
      var Result = 0;
      var I = 0;
      Result = 0;
      for (var $l = 0, $end = this.FTabs.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (this.IsTabVisible(I) && this.IsTabEnabled(I)) {
          Result = I;
          break;
        };
      };
      return Result;
    };
    this.GetDisplayCount = function () {
      var Result = 0;
      Result = this.FDisplayList.GetCount();
      return Result;
    };
    this.GetNormalDisplayCount = function () {
      var Result = 0;
      Result = this.GetDisplayCount();
      if (this.FOptions.FInsertMode === $mod.TTMSFNCTabSetInsertMode.timTab) Result -= 1;
      return Result;
    };
    this.GetAdditionalTabSpacing = function () {
      var Result = 0.0;
      Result = 0;
      if (this.FOptions.FInsertMode === $mod.TTMSFNCTabSetInsertMode.timTab) Result = Result + this.FTabAppearance.FInsertSize + 10;
      return Result;
    };
    this.GetButtonShapePath = function (ARect) {
      var Result = null;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rnd = 0.0;
      r.$assign(ARect);
      rnd = 5;
      Result = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPath.$create("Create$1");
      Result.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + rnd,r.Top + rnd),pas["WEBLib.TMSFNCTypes"].PointF(rnd,rnd),180,90);
      Result.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - rnd,r.Top + rnd),pas["WEBLib.TMSFNCTypes"].PointF(rnd,rnd),-90,90);
      Result.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - rnd,r.Bottom - rnd),pas["WEBLib.TMSFNCTypes"].PointF(rnd,rnd),0,90);
      Result.AddArc(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + rnd,r.Bottom - rnd),pas["WEBLib.TMSFNCTypes"].PointF(rnd,rnd),-270,90);
      Result.ClosePath();
      return Result;
    };
    this.GetTabListButtonRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var mnr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var sz = 0.0;
      var spc = 0.0;
      mnr.$assign(this.GetMenuRect());
      sz = this.FButtonAppearance.FSize;
      spc = this.ScalePaintValue(3);
      var $tmp = this.FLayout.FPosition;
      if (($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom)) {
        if (this.FShowTabListButton) {
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(mnr.Right - spc - sz,mnr.Top + ((mnr.Bottom - mnr.Top - sz) / 2),mnr.Right - spc,mnr.Top + ((mnr.Bottom - mnr.Top - sz) / 2) + sz))}
         else Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(mnr.Right,mnr.Top,mnr.Right,mnr.Bottom));
      } else if (($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) || ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpRight)) {
        if (this.FShowTabListButton) {
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(mnr.Left + ((mnr.Right - mnr.Left - sz) / 2),mnr.Bottom - spc - sz,mnr.Left + ((mnr.Right - mnr.Left - sz) / 2) + sz,mnr.Bottom - spc))}
         else Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(mnr.Left,mnr.Bottom,mnr.Right,mnr.Bottom));
      };
      return Result;
    };
    this.GetCloseButtonRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var mnr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var sz = 0.0;
      var spc = 0.0;
      mnr.$assign(this.GetTabListButtonRect());
      sz = this.FButtonAppearance.FSize;
      if (this.FShowTabListButton) {
        spc = this.ScalePaintValue(6)}
       else spc = this.ScalePaintValue(3);
      var $tmp = this.FLayout.FPosition;
      if (($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom)) {
        if (this.FShowCloseButton) {
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(mnr.Left - spc - sz,mnr.Top + ((mnr.Bottom - mnr.Top - sz) / 2),mnr.Left - spc,mnr.Top + ((mnr.Bottom - mnr.Top - sz) / 2) + sz))}
         else Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(mnr.Left,mnr.Top,mnr.Left,mnr.Bottom));
      } else if (($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) || ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpRight)) {
        if (this.FShowCloseButton) {
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(mnr.Left + ((mnr.Right - mnr.Left - sz) / 2),mnr.Top - spc - sz,mnr.Left + ((mnr.Right - mnr.Left - sz) / 2) + sz,mnr.Top - spc))}
         else Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(mnr.Left,mnr.Top,mnr.Right,mnr.Top));
      };
      return Result;
    };
    this.GetInsertButtonRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var mnr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var sz = 0.0;
      var spc = 0.0;
      mnr.$assign(this.GetCloseButtonRect());
      sz = this.FButtonAppearance.FSize;
      if (this.FShowTabListButton || this.FShowCloseButton) {
        spc = 6}
       else spc = 3;
      var $tmp = this.FLayout.FPosition;
      if (($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom)) {
        if (this.FShowInsertButton) {
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(mnr.Left - spc - sz,mnr.Top + ((mnr.Bottom - mnr.Top - sz) / 2),mnr.Left - spc,mnr.Top + ((mnr.Bottom - mnr.Top - sz) / 2) + sz))}
         else Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(mnr.Left,mnr.Top,mnr.Left,mnr.Bottom));
      } else if (($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) || ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpRight)) {
        if (this.FShowInsertButton) {
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(mnr.Left + ((mnr.Right - mnr.Left - sz) / 2),mnr.Top - spc - sz,mnr.Left + ((mnr.Right - mnr.Left - sz) / 2) + sz,mnr.Top - spc))}
         else Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(mnr.Left,mnr.Top,mnr.Right,mnr.Top));
      };
      return Result;
    };
    this.GetScrollButtonNextRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var mnr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var sz = 0.0;
      var spc = 0.0;
      mnr.$assign(this.GetInsertButtonRect());
      sz = this.FButtonAppearance.FSize;
      if (this.FShowTabListButton || this.FShowCloseButton || this.FShowInsertButton) {
        spc = this.ScalePaintValue(6)}
       else spc = this.ScalePaintValue(3);
      var $tmp = this.FLayout.FPosition;
      if (($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom)) {
        if (this.FShowScrollButtons) {
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(mnr.Left - spc - sz,mnr.Top + ((mnr.Bottom - mnr.Top - sz) / 2),mnr.Left - spc,mnr.Top + ((mnr.Bottom - mnr.Top - sz) / 2) + sz))}
         else Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(mnr.Left,mnr.Top,mnr.Left,mnr.Bottom));
      } else if (($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) || ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpRight)) {
        if (this.FShowScrollButtons) {
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(mnr.Left + ((mnr.Right - mnr.Left - sz) / 2),mnr.Top - spc - sz,mnr.Left + ((mnr.Right - mnr.Left - sz) / 2) + sz,mnr.Top - spc))}
         else Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(mnr.Left,mnr.Top,mnr.Right,mnr.Top));
      };
      return Result;
    };
    this.GetScrollButtonPreviousRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var mnr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var sz = 0.0;
      var spc = 0.0;
      mnr.$assign(this.GetScrollButtonNextRect());
      sz = this.FButtonAppearance.FSize;
      if (this.FShowScrollButtons) {
        spc = this.ScalePaintValue(6)}
       else spc = this.ScalePaintValue(3);
      var $tmp = this.FLayout.FPosition;
      if (($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom)) {
        if (this.FShowScrollButtons) {
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(mnr.Left - spc - sz,mnr.Top + ((mnr.Bottom - mnr.Top - sz) / 2),mnr.Left - spc,mnr.Top + ((mnr.Bottom - mnr.Top - sz) / 2) + sz))}
         else Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(mnr.Left,mnr.Top,mnr.Left,mnr.Bottom));
      } else if (($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) || ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpRight)) {
        if (this.FShowScrollButtons) {
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(mnr.Left + ((mnr.Right - mnr.Left - sz) / 2),mnr.Top - spc - sz,mnr.Left + ((mnr.Right - mnr.Left - sz) / 2) + sz,mnr.Top - spc))}
         else Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(mnr.Left,mnr.Top,mnr.Right,mnr.Top));
      };
      return Result;
    };
    this.IsButtonStateDown = function () {
      var Result = false;
      Result = (this.FTabListButtonState === $mod.TTMSFNCTabSetButtonState.tbsDown) || (this.FInsertButtonState === $mod.TTMSFNCTabSetButtonState.tbsDown) || (this.FCloseButtonState === $mod.TTMSFNCTabSetButtonState.tbsDown) || (this.FScrollButtonPreviousState === $mod.TTMSFNCTabSetButtonState.tbsDown) || (this.FScrollButtonNextState === $mod.TTMSFNCTabSetButtonState.tbsDown);
      return Result;
    };
    this.DragTabDisplay = function () {
      var Result = $mod.TTMSFNCTabSetDisplayTab.$new();
      Result.$assign(this.FDragTabDisplay);
      return Result;
    };
    this.IsButtonStateChanged = function () {
      var Result = false;
      Result = (this.FTabListButtonState !== this.FPrevTabListButtonState) || (this.FInsertButtonState !== this.FPrevInsertButtonState) || (this.FCloseButtonState !== this.FPrevCloseButtonState) || (this.FScrollButtonPreviousState !== this.FPrevScrollButtonPreviousState) || (this.FScrollButtonNextState !== this.FPrevScrollButtonNextState);
      return Result;
    };
    this.GetNextTab = function (ATabIndex) {
      var Result = 0;
      var i = 0;
      var j = 0;
      Result = ATabIndex;
      if (ATabIndex < 0) return Result;
      i = ATabIndex;
      j = 1;
      while (j < this.FTabs.GetCount()) {
        i += 1;
        if (i >= this.FTabs.GetCount()) i = 0;
        if ((ATabIndex !== i) && this.IsTabVisible(i) && this.IsTabEnabled(i)) {
          Result = i;
          break;
        };
        j += 1;
      };
      return Result;
    };
    this.GetPreviousTab = function (ATabIndex) {
      var Result = 0;
      var i = 0;
      var j = 0;
      Result = ATabIndex;
      if (ATabIndex < 0) return Result;
      i = ATabIndex;
      j = 1;
      while (j < this.FTabs.GetCount()) {
        i -= 1;
        if (i >= this.FTabs.GetCount()) i = 0;
        if (i < 0) i = this.FTabs.GetCount() - 1;
        if ((ATabIndex !== i) && this.IsTabVisible(i) && this.IsTabEnabled(i)) {
          Result = i;
          break;
        };
        j += 1;
      };
      return Result;
    };
    this.GetDisplayTab = function (ATabIndex) {
      var Result = $mod.TTMSFNCTabSetDisplayTab.$new();
      var I = 0;
      var tbd = $mod.TTMSFNCTabSetDisplayTab.$new();
      Result.$assign($impl.EmptyDisplayTab());
      for (var $l = 0, $end = this.GetNormalDisplayCount() - 1; $l <= $end; $l++) {
        I = $l;
        tbd.$assign(this.FDisplayList.GetItem(I));
        if ((tbd.Tab != null) && (tbd.Tab.GetIndex() === ATabIndex)) {
          Result.$assign(tbd);
          break;
        };
      };
      return Result;
    };
    this.HandleInsertTab = function (AChanged) {
      var Result = null;
      var idx = 0;
      var b = false;
      Result = null;
      idx = this.FTabs.GetCount();
      b = true;
      this.DoBeforeInsertTab({get: function () {
          return idx;
        }, set: function (v) {
          idx = v;
        }},{get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }});
      if (b) {
        Result = this.FTabs.Add$1();
        Result.SetIndex(idx);
        this.DoInsertTab(idx);
        AChanged.set(true);
      };
      return Result;
    };
    this.GetInplaceEditorRect = function (ATab) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,0,0));
      if (!(ATab.Tab != null)) return Result;
      r.$assign(ATab.TextRect);
      pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,2,0);
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.Math.Floor(r.Left),pas.Math.Floor(r.Top),Math.round(r.Right),Math.round(r.Bottom)));
      if (this.FOnGetInplaceEditorRect != null) this.FOnGetInplaceEditorRect(this,ATab.Tab.GetIndex(),this.FInplaceEditor,Result);
      return Result;
    };
    this.XYToAnchor = function (ATab, X, Y) {
      var Result = "";
      var g = null;
      var ha = 0;
      var va = 0;
      var ww = false;
      var tr = 0;
      Result = "";
      if (!(ATab.Tab != null)) return Result;
      if (ATab.Tab.IsHTML()) {
        g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[1,1,this.FNativeCanvas,true]);
        if (!this.FNativeCanvas) g.BeginScene();
        g.FBitmapContainer = this.GetBitmapContainer();
        g.FOptimizedHTMLDrawing = this.FOptimizedHTMLDrawing;
        try {
          g.FFont.Assign(this.FTabAppearance.FFont);
          if (ATab.Tab.FUseDefaultAppearance) {
            ww = this.FTabAppearance.FWordWrapping;
            tr = this.FTabAppearance.FTrimming;
            ha = this.FTabAppearance.FTextAlign;
          } else {
            ww = ATab.Tab.FWordWrapping;
            tr = ATab.Tab.FTrimming;
            ha = ATab.Tab.FTextAlign;
          };
          va = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
          var $tmp = this.FLayout.FPosition;
          if (($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom)) {
            Result = g.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ATab.TextRect),ATab.Tab.FText,ww,ha,va,tr,0,-1,-1,true,true,X,Y)}
           else if ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) {
            Result = g.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ATab.TextRect),ATab.Tab.FText,ww,ha,va,tr,-90,-1,-1,true,true,X,Y)}
           else if ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpRight) Result = g.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ATab.TextRect),ATab.Tab.FText,ww,ha,va,tr,90,-1,-1,true,true,X,Y);
        } finally {
          if (!this.FNativeCanvas) g.EndScene();
          g = rtl.freeLoc(g);
        };
      };
      return Result;
    };
    this.SetBitmapContainer = function (Value) {
      this.FBitmapContainer = Value;
      this.UpdateTabs(false,false);
    };
    this.ChangeDPIScale = function (M, D) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ChangeDPIScale.apply(this,arguments);
      this.FTabAppearance.ChangeDPIScale(M,D);
      this.FTabSize.ChangeDPIScale(M,D);
      this.FButtonAppearance.SetSize(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FButtonAppearance.FSize,M,D));
      this.FButtonAppearance.SetRounding(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FButtonAppearance.FRounding,M,D));
    };
    this.PopupListSelected = function (Sender) {
      var tb = null;
      this.FTabListPopup.SetIsOpen(false);
      if ((this.FTabList.GetItemIndex() >= 0) && (this.FTabList.GetItemIndex() <= (this.FTabList.GetCount() - 1))) {
        tb = rtl.as(this.FTabList.FItems.GetObject(this.FTabList.GetItemIndex()),$mod.TTMSFNCTabSetTab);
        if (tb != null) tb.SetVisible(true);
      };
    };
    this.ApplyStyle = function () {
      var c = 0;
      var sc = 0;
      var bc = 0;
      var I = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ApplyStyle.call(this);
      c = -1;
      bc = c;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleBackgroundFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        bc = c;
        this.FTabAppearance.FActiveFill.SetColor(c);
      };
      c = -1;
      sc = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleSelectionFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        c = pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.GetColorRed(c),pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.GetColorGreen(c),pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.GetColorBlue(c));
        sc = c;
        this.FTabAppearance.FHoverFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(c,20));
        this.FTabAppearance.FDownFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Darker(c,20));
        this.FTabAppearance.FFill.SetColor(c);
        this.FTabAppearance.FBadgeFill.SetColor(c);
        this.FButtonAppearance.FHoverFill.SetColor(this.FTabAppearance.FHoverFill.FColor);
        this.FButtonAppearance.FDownFill.SetColor(this.FTabAppearance.FDownFill.FColor);
        this.FButtonAppearance.FFill.SetColor(this.FTabAppearance.FFill.FColor);
      };
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleLineFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FTabAppearance.FActiveStroke.SetColor(c);
        this.FTabAppearance.FStroke.SetColor(c);
        this.FTabAppearance.FHoverStroke.SetColor(c);
        this.FTabAppearance.FDownStroke.SetColor(c);
        this.FButtonAppearance.FStroke.SetColor(c);
        this.FButtonAppearance.FHoverStroke.SetColor(c);
        this.FButtonAppearance.FDownStroke.SetColor(c);
      };
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleTextFontColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        if (bc !== c) {
          this.FTabAppearance.SetActiveTextColor(c)}
         else if (c === 16777215) {
          this.FTabAppearance.SetActiveTextColor(8421504)}
         else this.FTabAppearance.SetActiveTextColor(pas["WEBLib.TMSFNCGraphicsTypes"].Darker(c,40));
        if (sc !== c) {
          this.FTabAppearance.SetDownTextColor(c)}
         else if (c === 16777215) {
          this.FTabAppearance.SetDownTextColor(8421504)}
         else this.FTabAppearance.SetDownTextColor(pas["WEBLib.TMSFNCGraphicsTypes"].Darker(c,40));
        if (sc !== c) {
          this.FTabAppearance.SetHoverTextColor(c)}
         else if (c === 16777215) {
          this.FTabAppearance.SetHoverTextColor(8421504)}
         else this.FTabAppearance.SetHoverTextColor(pas["WEBLib.TMSFNCGraphicsTypes"].Darker(c,40));
        if (sc !== c) {
          this.FTabAppearance.SetTextColor(c)}
         else if (c === 16777215) {
          this.FTabAppearance.SetTextColor(8421504)}
         else this.FTabAppearance.SetTextColor(pas["WEBLib.TMSFNCGraphicsTypes"].Darker(c,40));
      };
      for (var $l = 0, $end = this.FTabs.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.FTabs.GetTab(I).SetUseDefaultAppearance(true);
      };
      if (this.FInsertTab != null) this.FInsertTab.SetUseDefaultAppearance(true);
    };
    this.ResetToDefaultStyle = function () {
      var I = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ResetToDefaultStyle.call(this);
      this.BeginUpdate();
      this.FTabAppearance.FBadgeFill.SetColor(42495);
      this.FButtonAppearance.FHoverFill.SetColor(this.FTabAppearance.FHoverFill.FColor);
      this.FButtonAppearance.FDownFill.SetColor(this.FTabAppearance.FDownFill.FColor);
      this.FButtonAppearance.FFill.SetColor(this.FTabAppearance.FFill.FColor);
      this.FTabAppearance.FActiveStroke.SetColor(11119017);
      this.FTabAppearance.FStroke.SetColor(11119017);
      this.FTabAppearance.FHoverStroke.SetColor(11119017);
      this.FTabAppearance.FDownStroke.SetColor(11119017);
      this.FButtonAppearance.FStroke.SetColor(11119017);
      this.FButtonAppearance.FHoverStroke.SetColor(11119017);
      this.FButtonAppearance.FDownStroke.SetColor(11119017);
      this.FTabAppearance.FFill.SetColor(0xFCF8F6);
      this.FTabAppearance.FHoverFill.SetColor(0xF9F2EE);
      this.FTabAppearance.FDownFill.SetColor(0xF0BCA8);
      this.FTabAppearance.FHoverStroke.SetColor(0xEF9B2D);
      this.FTabAppearance.SetTextColor(0x7A7A7A);
      this.FTabAppearance.SetActiveTextColor(0x454545);
      this.FTabAppearance.FActiveFill.SetColor(16777215);
      this.FTabAppearance.SetHoverTextColor(this.FTabAppearance.FTextColor);
      this.FTabAppearance.SetDownTextColor(this.FTabAppearance.FActiveTextColor);
      this.FTabAppearance.FDownStroke.SetColor(this.FTabAppearance.FHoverStroke.FColor);
      this.FTabAppearance.FHoverFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FTabAppearance.FDownFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FTabAppearance.FActiveFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FTabAppearance.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FTabAppearance.SetShowFocus(false);
      for (var $l = 0, $end = this.FTabs.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.FTabs.GetTab(I).SetUseDefaultAppearance(true);
      };
      if (this.FInsertTab != null) this.FInsertTab.SetUseDefaultAppearance(false);
      this.EndUpdate();
    };
    this.DoInvalidate = function () {
    };
    this.InitializeInvisibleTabs = function () {
      var I = 0;
      var tb = null;
      this.FInvisibleTabList.Clear();
      for (var $l = 0, $end = this.FTabs.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        tb = this.FTabs.GetTab(I);
        if (!tb.FVisible) this.FInvisibleTabList.Add(tb);
      };
    };
    this.InitializeScrollButtonState = function () {
      if (this.FInteraction.FSelectTabOnScroll) {
        this.FScrollButtonPreviousDisabled = (this.GetActiveTabIndex() === this.GetFirstScrollableTabIndex()) || (this.GetActiveTabIndex() === -1);
        this.FScrollButtonNextDisabled = (this.GetActiveTabIndex() === this.GetLastScrollableTabIndex()) || (this.GetActiveTabIndex() === -1);
      } else {
        this.FScrollButtonPreviousDisabled = this.FStartTab === 0;
        this.FScrollButtonNextDisabled = (this.FScrollCount - this.FStartTab) === 0;
      };
    };
    this.FillTabList = function () {
      var I = 0;
      this.FTabList.SetParent(this);
      this.FTabList.FItems.Clear();
      for (var $l = 0, $end = this.FInvisibleTabList.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.FTabList.FItems.AddObject(this.FInvisibleTabList.GetItem(I).GetFriendlyName(),this.FInvisibleTabList.GetItem(I));
      };
      this.FTabList.SetParent(null);
    };
    this.SaveButtonState = function () {
      this.FPrevTabListButtonState = this.FTabListButtonState;
      this.FPrevCloseButtonState = this.FCloseButtonState;
      this.FPrevScrollButtonPreviousState = this.FScrollButtonPreviousState;
      this.FPrevScrollButtonNextState = this.FScrollButtonNextState;
      this.FPrevInsertButtonState = this.FInsertButtonState;
    };
    this.ClearButtonState = function () {
      this.FTabListButtonState = $mod.TTMSFNCTabSetButtonState.tbsNormal;
      this.FCloseButtonState = $mod.TTMSFNCTabSetButtonState.tbsNormal;
      this.FScrollButtonPreviousState = $mod.TTMSFNCTabSetButtonState.tbsNormal;
      this.FScrollButtonNextState = $mod.TTMSFNCTabSetButtonState.tbsNormal;
      this.FInsertButtonState = $mod.TTMSFNCTabSetButtonState.tbsNormal;
    };
    this.HandleButtonDownState = function (X, Y) {
      if (this.XYToScrollPreviousButton(X,Y)) {
        this.FScrollButtonPreviousState = $mod.TTMSFNCTabSetButtonState.tbsDown;
        return;
      };
      if (this.XYToScrollNextButton(X,Y)) {
        this.FScrollButtonNextState = $mod.TTMSFNCTabSetButtonState.tbsDown;
        return;
      };
      if (this.XYToCloseButton(X,Y)) {
        this.FCloseButtonState = $mod.TTMSFNCTabSetButtonState.tbsDown;
        return;
      };
      if (this.XYToInsertButton(X,Y)) {
        this.FInsertButtonState = $mod.TTMSFNCTabSetButtonState.tbsDown;
        return;
      };
      if (this.XYToTabListButton(X,Y)) {
        this.FTabListButtonState = $mod.TTMSFNCTabSetButtonState.tbsDown;
        return;
      };
    };
    this.HandleButtonHoverState = function (X, Y) {
      if (this.XYToScrollPreviousButton(X,Y)) {
        this.FScrollButtonPreviousState = $mod.TTMSFNCTabSetButtonState.tbsHover;
        return;
      };
      if (this.XYToScrollNextButton(X,Y)) {
        this.FScrollButtonNextState = $mod.TTMSFNCTabSetButtonState.tbsHover;
        return;
      };
      if (this.XYToCloseButton(X,Y)) {
        this.FCloseButtonState = $mod.TTMSFNCTabSetButtonState.tbsHover;
        return;
      };
      if (this.XYToInsertButton(X,Y)) {
        this.FInsertButtonState = $mod.TTMSFNCTabSetButtonState.tbsHover;
        return;
      };
      if (this.XYToTabListButton(X,Y)) {
        this.FTabListButtonState = $mod.TTMSFNCTabSetButtonState.tbsHover;
        return;
      };
    };
    this.InitializeMenu = function () {
      this.FMenuSize = 0;
      this.FShowCloseButton = this.FOptions.FCloseMode === $mod.TTMSFNCTabSetCloseMode.tcmMenu;
      this.FShowInsertButton = this.FOptions.FInsertMode === $mod.TTMSFNCTabSetInsertMode.timMenu;
      this.FShowTabListButton = (this.GetInvisibleTabCount() > 0) && this.FOptions.FTabListButton;
      if (this.FShowTabListButton) {
        this.FMenuSize = this.FMenuSize + this.FButtonAppearance.FSize + 8;
        this.FShowMenu = true;
      };
      if (this.FShowCloseButton) {
        this.FMenuSize = this.FMenuSize + this.FButtonAppearance.FSize + 8;
        this.FShowMenu = true;
      };
      if (this.FShowInsertButton) {
        this.FMenuSize = this.FMenuSize + this.FButtonAppearance.FSize + 8;
        this.FShowMenu = true;
      };
      if (this.FShowScrollButtons) {
        this.FMenuSize = this.FMenuSize + ((this.FButtonAppearance.FSize + 8) * 2);
        this.FShowMenu = true;
      };
    };
    this.StartProgressAnimationTimer = function () {
      this.FAnimTimer.SetEnabled(!this.IsDesignTime());
    };
    this.Notification = function (AComponent, Operation) {
      pas["WEBLib.Menus"].TWebCustomControl.Notification.apply(this,arguments);
      if ((Operation === pas.Classes.TOperation.opRemove) && (AComponent === this.FBitmapContainer)) this.FBitmapContainer = null;
    };
    this.CalculateRects = function (ATab) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.$assign(ATab.Rect);
      var $tmp = this.FLayout.FPosition;
      if (($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom)) {
        var $tmp1 = this.FTabAppearance.FShape;
        if ($tmp1 === $mod.TTMSFNCTabSetTabShape.tsRectangle) {
          ATab.ContentRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + this.FTabAppearance.FShapeOverlap,r.Top,r.Right,r.Bottom))}
         else if ($tmp1 === $mod.TTMSFNCTabSetTabShape.tsPyramidLeft) {
          ATab.ContentRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + this.FTabAppearance.FShapeSlope,r.Top,r.Right,r.Bottom))}
         else if ($tmp1 === $mod.TTMSFNCTabSetTabShape.tsPyramidRight) {
          if (!ATab.First && (this.FActiveTab !== ATab.Tab)) {
            ATab.ContentRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + (this.FTabAppearance.FShapeSlope / 2),r.Top,r.Right - this.FTabAppearance.FShapeSlope,r.Bottom))}
           else ATab.ContentRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top,r.Right - this.FTabAppearance.FShapeSlope,r.Bottom));
        } else if ($tmp1 === $mod.TTMSFNCTabSetTabShape.tsPyramid) {
          ATab.ContentRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + this.FTabAppearance.FShapeSlope,r.Top,r.Right - this.FTabAppearance.FShapeSlope,r.Bottom))}
         else if ($tmp1 === $mod.TTMSFNCTabSetTabShape.tsRoundLeft) {
          ATab.ContentRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + (this.FTabAppearance.FShapeSlope / 2),r.Top,r.Right,r.Bottom))}
         else if ($tmp1 === $mod.TTMSFNCTabSetTabShape.tsRoundRight) {
          if (!ATab.First && (this.FActiveTab !== ATab.Tab)) {
            ATab.ContentRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + (this.FTabAppearance.FShapeSlope / 2),r.Top,r.Right - (this.FTabAppearance.FShapeSlope / 2),r.Bottom))}
           else ATab.ContentRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top,r.Right - (this.FTabAppearance.FShapeSlope / 2),r.Bottom));
        } else if ($tmp1 === $mod.TTMSFNCTabSetTabShape.tsRound) ATab.ContentRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + (this.FTabAppearance.FShapeSlope / 2),r.Top,r.Right - (this.FTabAppearance.FShapeSlope / 2),r.Bottom));
      } else if (($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) || ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpRight)) {
        var $tmp2 = this.FTabAppearance.FShape;
        if ($tmp2 === $mod.TTMSFNCTabSetTabShape.tsRectangle) {
          ATab.ContentRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top + this.FTabAppearance.FShapeOverlap,r.Right,r.Bottom))}
         else if ($tmp2 === $mod.TTMSFNCTabSetTabShape.tsPyramidLeft) {
          ATab.ContentRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top + this.FTabAppearance.FShapeSlope,r.Right,r.Bottom))}
         else if ($tmp2 === $mod.TTMSFNCTabSetTabShape.tsPyramidRight) {
          if (!ATab.First && (this.FActiveTab !== ATab.Tab)) {
            ATab.ContentRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top + (this.FTabAppearance.FShapeSlope / 2),r.Right,r.Bottom - this.FTabAppearance.FShapeSlope))}
           else ATab.ContentRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top,r.Right,r.Bottom - this.FTabAppearance.FShapeSlope));
        } else if ($tmp2 === $mod.TTMSFNCTabSetTabShape.tsPyramid) {
          ATab.ContentRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top + this.FTabAppearance.FShapeSlope,r.Right,r.Bottom - this.FTabAppearance.FShapeSlope))}
         else if ($tmp2 === $mod.TTMSFNCTabSetTabShape.tsRoundLeft) {
          ATab.ContentRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top + (this.FTabAppearance.FShapeSlope / 2),r.Right,r.Bottom))}
         else if ($tmp2 === $mod.TTMSFNCTabSetTabShape.tsRoundRight) {
          if (!ATab.First && (this.FActiveTab !== ATab.Tab)) {
            ATab.ContentRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top + (this.FTabAppearance.FShapeSlope / 2),r.Right,r.Bottom - (this.FTabAppearance.FShapeSlope / 2)))}
           else ATab.ContentRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top,r.Right,r.Bottom - (this.FTabAppearance.FShapeSlope / 2)));
        } else if ($tmp2 === $mod.TTMSFNCTabSetTabShape.tsRound) ATab.ContentRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top + (this.FTabAppearance.FShapeSlope / 2),r.Right,r.Bottom - (this.FTabAppearance.FShapeSlope / 2)));
      };
      ATab.ProgressRect.$assign(ATab.Tab.GetProgressRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ATab.ContentRect)));
      ATab.BitmapRect.$assign(ATab.Tab.GetBitmapRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ATab.ContentRect)));
      ATab.TextRect.$assign(ATab.Tab.GetTextRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ATab.ContentRect)));
      ATab.CloseButtonRect.$assign(ATab.Tab.GetCloseButtonRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ATab.ContentRect)));
    };
    this.FixStartTab = function () {
      var tbdfirst = $mod.TTMSFNCTabSetDisplayTab.$new();
      var tbdlast = $mod.TTMSFNCTabSetDisplayTab.$new();
      var news = 0.0;
      var sz = 0.0;
      var tr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var i = 0;
      var trw = 0.0;
      if ((this.FDisplayList.GetCount() > 0) && (this.FStartTab > 0) && (this.FTabSize.FMode !== $mod.TTMSFNCTabSetTabSizeMode.tsmFixedSizeAutoShrink) && this.FAllowScrolling && (this.FLayout.FMultiline === $mod.TTMSFNCTabSetLayoutMultiline.tlmNone) && (this.FScrollCount > 0) && (this.FLastTabIndex === this.GetLastScrollableTabIndex())) {
        tbdlast.$assign(this.FDisplayList.GetItem(this.FDisplayList.GetCount() - 1));
        tbdfirst.$assign(this.FDisplayList.GetItem(0));
        if ((tbdlast.Tab != null) && (tbdfirst.Tab != null)) {
          i = this.GetPreviousTab(tbdfirst.Tab.GetIndex());
          if ((i >= 0) && (i <= (this.FTabs.GetCount() - 1))) {
            tr.$assign(this.GetTabRect());
            sz = this.GetTabSize(i);
            var $tmp = this.FLayout.FPosition;
            if (($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom)) {
              news = (tbdlast.Rect.Right + sz + this.FTabSize.FSpacing) - this.FTabAppearance.FShapeOverlap;
              if (this.FOptions.FInsertMode === $mod.TTMSFNCTabSetInsertMode.timTab) {
                news = news + this.GetAdditionalTabSpacing()}
               else news = news + 5;
              trw = tr.Right;
            } else if (($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) || ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpRight)) {
              news = (tbdlast.Rect.Bottom + sz + this.FTabSize.FSpacing) - this.FTabAppearance.FShapeOverlap;
              if (this.FOptions.FInsertMode === $mod.TTMSFNCTabSetInsertMode.timTab) {
                news = news + this.GetAdditionalTabSpacing()}
               else news = news + 5;
              trw = tr.Bottom;
            } else {
              news = 0;
              trw = 0;
            };
            if (news < trw) {
              this.FStartTab -= 1;
              this.FStartTab = Math.max(0,this.FStartTab);
              this.UpdateTabs(false,false);
            };
          };
        };
      };
    };
    this.UpdateTabs = function (ACalculateScrolling, AForceUpdate) {
      var I = 0;
      var tbd = $mod.TTMSFNCTabSetDisplayTab.$new();
      var tbdinsert = $mod.TTMSFNCTabSetDisplayTab.$new();
      var x = 0.0;
      var y = 0.0;
      var w = 0.0;
      var h = 0.0;
      var dw = 0.0;
      var dh = 0.0;
      var sz = 0.0;
      var tc = 0;
      var st = 0;
      var tr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var das = 0;
      var newx = 0.0;
      var newy = 0.0;
      var trw = 0.0;
      var trh = 0.0;
      var ar = 0;
      var chrw = false;
      var cnt = 0;
      var off = 0.0;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (this.FTabChanging) return;
      this.FDisplayList.Clear();
      this.FInvisibleTabList.Clear();
      if (!AForceUpdate) {
        if ((this.FUpdateCount$1 > 0) || (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState)) return;
      };
      this.FShowMenu = false;
      if (!ACalculateScrolling) this.FShowScrollButtons = false;
      this.InitializeMenu();
      if (this.FTabs.GetCount() === 0) {
        this.Invalidate();
        return;
      };
      tr.$assign(this.GetTabRect());
      x = tr.Left;
      y = tr.Top;
      das = 0;
      ar = 0;
      var $tmp = this.FLayout.FPosition;
      if (($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom)) {
        dw = this.FTabSize.FWidth;
        dh = tr.Bottom - tr.Top;
      } else if (($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) || ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpRight)) {
        dw = tr.Right - tr.Left;
        dh = this.FTabSize.FWidth;
      } else {
        dw = 0;
        dh = 0;
      };
      tc = this.GetVisibleTabCount();
      var $tmp1 = this.FTabSize.FMode;
      if ($tmp1 === $mod.TTMSFNCTabSetTabSizeMode.tsmAutoSize) {
        var $tmp2 = this.FLayout.FPosition;
        if (($tmp2 === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp2 === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom)) {
          if (tc > 0) {
            w = (((tr.Right - tr.Left) + ((tc - 1) * this.FTabAppearance.FShapeOverlap)) - ((tc - 1) * this.FTabSize.FSpacing) - this.GetAdditionalTabSpacing()) / tc}
           else w = 0;
          if (w > 0) {
            for (var $l = 0, $end = this.FTabs.GetCount() - 1; $l <= $end; $l++) {
              I = $l;
              if (this.IsTabVisible(I)) {
                tbd.First = false;
                tbd.Last = false;
                tbd.Tab = this.FTabs.GetTab(I);
                tbd.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(x,y,x + w,y + dh));
                tbd.Row = 0;
                this.FDisplayList.Add($mod.TTMSFNCTabSetDisplayTab.$clone(tbd));
                x = (x + w + this.FTabSize.FSpacing) - this.FTabAppearance.FShapeOverlap;
              };
            };
          };
          if (this.FOptions.FInsertMode === $mod.TTMSFNCTabSetInsertMode.timTab) {
            tbdinsert.Tab = this.FInsertTab;
            tbdinsert.TabKind = $mod.TTMSFNCTabSetTabKind.ttkInsert;
            tbdinsert.First = false;
            tbdinsert.Last = false;
            tbdinsert.Row = 0;
            if (this.FDisplayList.GetCount() > 0) {
              tbdinsert.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(x + 5 + this.FTabAppearance.FShapeOverlap,y,x + 5 + this.FTabAppearance.FShapeOverlap + this.FTabAppearance.FInsertSize,y + dh))}
             else tbdinsert.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(x + 5,y,x + 5 + this.FTabAppearance.FInsertSize,y + dh));
            this.FDisplayList.Add($mod.TTMSFNCTabSetDisplayTab.$clone(tbdinsert));
          };
        } else if (($tmp2 === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) || ($tmp2 === $mod.TTMSFNCTabSetLayoutPosition.tlpRight)) {
          if (tc > 0) {
            h = (((tr.Bottom - tr.Top) + ((tc - 1) * this.FTabAppearance.FShapeOverlap)) - ((tc - 1) * this.FTabSize.FSpacing) - this.GetAdditionalTabSpacing()) / tc}
           else h = 0;
          if (h > 0) {
            for (var $l1 = 0, $end1 = this.FTabs.GetCount() - 1; $l1 <= $end1; $l1++) {
              I = $l1;
              if (this.IsTabVisible(I)) {
                tbd.First = false;
                tbd.Last = false;
                tbd.Tab = this.FTabs.GetTab(I);
                tbd.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(x,y,x + dw,y + h));
                tbd.Row = 0;
                this.FDisplayList.Add($mod.TTMSFNCTabSetDisplayTab.$clone(tbd));
                y = (y + h + this.FTabSize.FSpacing) - this.FTabAppearance.FShapeOverlap;
              };
            };
          };
          if (this.FOptions.FInsertMode === $mod.TTMSFNCTabSetInsertMode.timTab) {
            tbdinsert.Tab = this.FInsertTab;
            tbdinsert.TabKind = $mod.TTMSFNCTabSetTabKind.ttkInsert;
            tbdinsert.First = false;
            tbdinsert.Last = false;
            tbdinsert.Row = 0;
            if (this.FDisplayList.GetCount() > 0) {
              tbdinsert.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(x,y + 5 + this.FTabAppearance.FShapeOverlap,x + dw,y + 5 + this.FTabAppearance.FShapeOverlap + this.FTabAppearance.FInsertSize))}
             else tbdinsert.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(x,y + 5,x + dw,y + 5 + this.FTabAppearance.FInsertSize));
            this.FDisplayList.Add($mod.TTMSFNCTabSetDisplayTab.$clone(tbdinsert));
          };
        };
      } else if (($tmp1 === $mod.TTMSFNCTabSetTabSizeMode.tsmFixedSize) || ($tmp1 === $mod.TTMSFNCTabSetTabSizeMode.tsmFixedSizeAutoShrink) || ($tmp1 === $mod.TTMSFNCTabSetTabSizeMode.tsmAutoTabSize)) {
        st = 0;
        if ((this.FTabSize.FMode !== $mod.TTMSFNCTabSetTabSizeMode.tsmFixedSizeAutoShrink) && this.FAllowScrolling && (this.FLayout.FMultiline === $mod.TTMSFNCTabSetLayoutMultiline.tlmNone)) st = this.FStartTab;
        cnt = this.FTabs.GetCount();
        if (this.FOptions.FInsertMode === $mod.TTMSFNCTabSetInsertMode.timTab) cnt = cnt + 1;
        for (var $l2 = st, $end2 = cnt - 1; $l2 <= $end2; $l2++) {
          I = $l2;
          if (((I <= (this.FTabs.GetCount() - 1)) && this.IsTabVisible(I)) || (I > (this.FTabs.GetCount() - 1))) {
            var $tmp3 = this.FLayout.FPosition;
            if (($tmp3 === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp3 === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom)) {
              w = this.GetTabSize(I);
              if (w > 0) {
                if ((I === (cnt - 1)) && (this.FOptions.FInsertMode === $mod.TTMSFNCTabSetInsertMode.timTab)) {
                  tbd.Tab = this.FInsertTab;
                  tbd.TabKind = $mod.TTMSFNCTabSetTabKind.ttkInsert;
                  tbd.First = false;
                  tbd.Last = false;
                  tbd.Row = das;
                  if (this.FDisplayList.GetCount() > 0) {
                    tbd.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(x + 5 + this.FTabAppearance.FShapeOverlap,y,x + 5 + this.FTabAppearance.FShapeOverlap + w,y + dh));
                    newx = x + w + 5 + this.FTabAppearance.FShapeOverlap;
                  } else {
                    tbd.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(x + 5,y,x + 5 + w,y + dh));
                    newx = x + w + 5;
                  };
                  this.FDisplayList.Add($mod.TTMSFNCTabSetDisplayTab.$clone(tbd));
                } else {
                  tbd.First = this.FDisplayList.GetCount() === 0;
                  tbd.Last = false;
                  tbd.Tab = this.FTabs.GetTab(I);
                  tbd.Row = das;
                  tbd.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(x,y,x + w,y + dh));
                  if (I === this.GetActiveTabIndex()) ar = das;
                  this.FDisplayList.Add($mod.TTMSFNCTabSetDisplayTab.$clone(tbd));
                  newx = x + w + this.FTabSize.FSpacing;
                  if ((this.FOptions.FInsertMode === $mod.TTMSFNCTabSetInsertMode.timTab) && (I === (cnt - 2))) newx = newx + this.FTabAppearance.FInsertSize + 5;
                };
                trw = tr.Right;
                if (this.FOptions.FInsertMode === $mod.TTMSFNCTabSetInsertMode.timTab) {
                  trw = trw - this.GetAdditionalTabSpacing()}
                 else trw = trw - 5;
                if ((newx > trw) && this.FAllowScrolling && (this.FDisplayList.GetCount() > 1) && (((I < (cnt - 1)) && (this.FOptions.FInsertMode === $mod.TTMSFNCTabSetInsertMode.timTab)) || !(this.FOptions.FInsertMode === $mod.TTMSFNCTabSetInsertMode.timTab))) {
                  das += 1;
                  if ((this.FTabSize.FMode === $mod.TTMSFNCTabSetTabSizeMode.tsmFixedSizeAutoShrink) || (this.FLayout.FMultiline === $mod.TTMSFNCTabSetLayoutMultiline.tlmNone)) {
                    this.FDisplayList.Remove($mod.TTMSFNCTabSetDisplayTab.$clone(tbd));
                    break;
                  } else {
                    x = tr.Left;
                    var $tmp4 = this.FLayout.FPosition;
                    if ($tmp4 === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) {
                      y = y + dh}
                     else if ($tmp4 === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom) y = y - dh;
                    tbd.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(x,y,x + w,y + dh));
                    tbd.First = true;
                    tbd.Row = das;
                    if (I === this.GetActiveTabIndex()) ar = das;
                    this.FDisplayList.SetItem(this.FDisplayList.GetCount() - 1,tbd);
                    if (this.FDisplayList.GetCount() > 1) {
                      tbd.$assign(this.FDisplayList.GetItem(this.FDisplayList.GetCount() - 2));
                      tbd.Last = true;
                      this.FDisplayList.SetItem(this.FDisplayList.GetCount() - 2,tbd);
                    };
                    newx = (x + w + this.FTabSize.FSpacing) - this.FTabAppearance.FShapeOverlap;
                    x = newx;
                  };
                } else {
                  if ((this.FOptions.FInsertMode === $mod.TTMSFNCTabSetInsertMode.timTab) && (I === (cnt - 2))) newx = newx - this.FTabAppearance.FInsertSize - 5;
                  x = newx - this.FTabAppearance.FShapeOverlap;
                };
              };
            } else if (($tmp3 === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) || ($tmp3 === $mod.TTMSFNCTabSetLayoutPosition.tlpRight)) {
              h = this.GetTabSize(I);
              if (h > 0) {
                if ((I === (cnt - 1)) && (this.FOptions.FInsertMode === $mod.TTMSFNCTabSetInsertMode.timTab)) {
                  tbd.Tab = this.FInsertTab;
                  tbd.TabKind = $mod.TTMSFNCTabSetTabKind.ttkInsert;
                  tbd.First = false;
                  tbd.Last = false;
                  tbd.Row = das;
                  if (this.FDisplayList.GetCount() > 0) {
                    tbd.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(x,y + 5 + this.FTabAppearance.FShapeOverlap,x + dw,y + 5 + this.FTabAppearance.FShapeOverlap + h));
                    newy = y + h + 5 + this.FTabAppearance.FShapeOverlap;
                  } else {
                    tbd.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(x,y + 5,x + dw,y + 5 + h));
                    newy = y + h + 5;
                  };
                  this.FDisplayList.Add($mod.TTMSFNCTabSetDisplayTab.$clone(tbd));
                } else {
                  tbd.First = this.FDisplayList.GetCount() === 0;
                  tbd.Last = false;
                  tbd.Tab = this.FTabs.GetTab(I);
                  tbd.Row = das;
                  tbd.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(x,y,x + dw,y + h));
                  if (I === this.GetActiveTabIndex()) ar = das;
                  this.FDisplayList.Add($mod.TTMSFNCTabSetDisplayTab.$clone(tbd));
                  newy = y + h + this.FTabSize.FSpacing;
                  if ((this.FOptions.FInsertMode === $mod.TTMSFNCTabSetInsertMode.timTab) && (I === (cnt - 2))) newy = newy + this.FTabAppearance.FInsertSize + 5;
                };
                trh = tr.Bottom;
                if (this.FOptions.FInsertMode === $mod.TTMSFNCTabSetInsertMode.timTab) {
                  trh = trh - this.GetAdditionalTabSpacing()}
                 else trh = trh - 5;
                if ((newy > trh) && this.FAllowScrolling && (this.FDisplayList.GetCount() > 1) && (((I < (cnt - 1)) && (this.FOptions.FInsertMode === $mod.TTMSFNCTabSetInsertMode.timTab)) || !(this.FOptions.FInsertMode === $mod.TTMSFNCTabSetInsertMode.timTab))) {
                  das += 1;
                  if ((this.FTabSize.FMode === $mod.TTMSFNCTabSetTabSizeMode.tsmFixedSizeAutoShrink) || (this.FLayout.FMultiline === $mod.TTMSFNCTabSetLayoutMultiline.tlmNone)) {
                    this.FDisplayList.Remove($mod.TTMSFNCTabSetDisplayTab.$clone(tbd));
                    break;
                  } else {
                    y = tr.Top;
                    var $tmp5 = this.FLayout.FPosition;
                    if ($tmp5 === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) {
                      x = x + dw}
                     else if ($tmp5 === $mod.TTMSFNCTabSetLayoutPosition.tlpRight) x = x - dw;
                    tbd.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(x,y,x + dw,y + h));
                    tbd.First = true;
                    tbd.Row = das;
                    if (I === this.GetActiveTabIndex()) ar = das;
                    this.FDisplayList.SetItem(this.FDisplayList.GetCount() - 1,tbd);
                    if (this.FDisplayList.GetCount() > 1) {
                      tbd.$assign(this.FDisplayList.GetItem(this.FDisplayList.GetCount() - 2));
                      tbd.Last = true;
                      this.FDisplayList.SetItem(this.FDisplayList.GetCount() - 2,tbd);
                    };
                    newy = (y + h + this.FTabSize.FSpacing) - this.FTabAppearance.FShapeOverlap;
                    y = newy;
                  };
                } else {
                  if ((this.FOptions.FInsertMode === $mod.TTMSFNCTabSetInsertMode.timTab) && (I === (cnt - 2))) newy = newy - this.FTabAppearance.FInsertSize - 5;
                  y = newy - this.FTabAppearance.FShapeOverlap;
                };
              };
            };
          };
        };
        if (((das + this.FStartTab) > 0) && (this.GetDisplayCount() > 0)) {
          if (this.FTabSize.FMode === $mod.TTMSFNCTabSetTabSizeMode.tsmFixedSizeAutoShrink) {
            x = tr.Left;
            y = tr.Top;
            this.FDisplayList.Clear();
            var $tmp6 = this.FLayout.FPosition;
            if (($tmp6 === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp6 === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom)) {
              if (tc > 0) {
                w = (((tr.Right - tr.Left) + ((tc - 1) * this.FTabAppearance.FShapeOverlap)) - ((tc - 1) * this.FTabSize.FSpacing) - this.GetAdditionalTabSpacing()) / tc}
               else w = 0;
              if (w > 0) {
                for (var $l3 = 0, $end3 = this.FTabs.GetCount() - 1; $l3 <= $end3; $l3++) {
                  I = $l3;
                  if (this.IsTabVisible(I)) {
                    tbd.First = false;
                    tbd.Last = false;
                    tbd.Tab = this.FTabs.GetTab(I);
                    tbd.Row = 0;
                    tbd.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(x,y,x + w,y + dh));
                    this.FDisplayList.Add($mod.TTMSFNCTabSetDisplayTab.$clone(tbd));
                    x = (x + w + this.FTabSize.FSpacing) - this.FTabAppearance.FShapeOverlap;
                  };
                };
              };
              if (this.FOptions.FInsertMode === $mod.TTMSFNCTabSetInsertMode.timTab) {
                tbdinsert.Tab = this.FInsertTab;
                tbdinsert.TabKind = $mod.TTMSFNCTabSetTabKind.ttkInsert;
                tbdinsert.First = false;
                tbdinsert.Last = false;
                tbdinsert.Row = 0;
                if (this.FDisplayList.GetCount() > 0) {
                  tbdinsert.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(x + 5 + this.FTabAppearance.FShapeOverlap,y,x + 5 + this.FTabAppearance.FShapeOverlap + this.FTabAppearance.FInsertSize,y + dh))}
                 else tbdinsert.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(x + 5,y,x + 5 + this.FTabAppearance.FInsertSize,y + dh));
                this.FDisplayList.Add($mod.TTMSFNCTabSetDisplayTab.$clone(tbdinsert));
              };
            } else if (($tmp6 === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) || ($tmp6 === $mod.TTMSFNCTabSetLayoutPosition.tlpRight)) {
              if (tc > 0) {
                h = (((tr.Bottom - tr.Top) + ((tc - 1) * this.FTabAppearance.FShapeOverlap)) - ((tc - 1) * this.FTabSize.FSpacing) - this.GetAdditionalTabSpacing()) / tc}
               else h = 0;
              if (h > 0) {
                for (var $l4 = 0, $end4 = this.FTabs.GetCount() - 1; $l4 <= $end4; $l4++) {
                  I = $l4;
                  if (this.IsTabVisible(I)) {
                    tbd.First = false;
                    tbd.Last = false;
                    tbd.Tab = this.FTabs.GetTab(I);
                    tbd.Row = 0;
                    tbd.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(x,y,x + dw,y + h));
                    this.FDisplayList.Add($mod.TTMSFNCTabSetDisplayTab.$clone(tbd));
                    y = (y + h + this.FTabSize.FSpacing) - this.FTabAppearance.FShapeOverlap;
                  };
                };
              };
              if (this.FOptions.FInsertMode === $mod.TTMSFNCTabSetInsertMode.timTab) {
                tbdinsert.Tab = this.FInsertTab;
                tbdinsert.TabKind = $mod.TTMSFNCTabSetTabKind.ttkInsert;
                tbdinsert.First = false;
                tbdinsert.Last = false;
                tbdinsert.Row = 0;
                if (this.FDisplayList.GetCount() > 0) {
                  tbdinsert.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(x,y + 5 + this.FTabAppearance.FShapeOverlap,x + dw,y + 5 + this.FTabAppearance.FShapeOverlap + this.FTabAppearance.FInsertSize))}
                 else tbdinsert.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(x,y + 5,x + dw,y + 5 + this.FTabAppearance.FInsertSize));
                this.FDisplayList.Add($mod.TTMSFNCTabSetDisplayTab.$clone(tbdinsert));
              };
            };
          } else if (this.FLayout.FMultiline === $mod.TTMSFNCTabSetLayoutMultiline.tlmNone) {
            if (!this.FShowScrollButtons && this.FAllowScrolling) {
              this.FShowScrollButtons = true;
              this.UpdateTabs(true,AForceUpdate);
            } else if ((this.FOptions.FInsertMode === $mod.TTMSFNCTabSetInsertMode.timTab) && (das > 0)) {
              var $tmp7 = this.FLayout.FPosition;
              if (($tmp7 === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp7 === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom)) {
                tbdinsert.Tab = this.FInsertTab;
                tbdinsert.TabKind = $mod.TTMSFNCTabSetTabKind.ttkInsert;
                tbdinsert.First = false;
                tbdinsert.Last = false;
                tbdinsert.Row = das;
                tbd.$assign(this.FDisplayList.GetItem(this.FDisplayList.GetCount() - 1));
                tbdinsert.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(tbd.Rect.Right + 5,tbd.Rect.Top,tbd.Rect.Right + 5 + this.FTabAppearance.FInsertSize,tbd.Rect.Top + dh));
                this.FDisplayList.Add($mod.TTMSFNCTabSetDisplayTab.$clone(tbdinsert));
              } else if (($tmp7 === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) || ($tmp7 === $mod.TTMSFNCTabSetLayoutPosition.tlpRight)) {
                tbdinsert.Tab = this.FInsertTab;
                tbdinsert.TabKind = $mod.TTMSFNCTabSetTabKind.ttkInsert;
                tbdinsert.First = false;
                tbdinsert.Last = false;
                tbdinsert.Row = das;
                tbd.$assign(this.FDisplayList.GetItem(this.FDisplayList.GetCount() - 1));
                tbdinsert.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(tbd.Rect.Left,tbd.Rect.Bottom + 5,tbd.Rect.Left + dw,tbd.Rect.Bottom + 5 + this.FTabAppearance.FInsertSize));
                this.FDisplayList.Add($mod.TTMSFNCTabSetDisplayTab.$clone(tbdinsert));
              };
            };
          };
        };
      };
      chrw = (das > 0) && (this.FLayout.FMultiline === $mod.TTMSFNCTabSetLayoutMultiline.tlmEnabledActiveTab) && (this.GetActiveTabIndex() !== -1) && ((this.FTabSize.FMode === $mod.TTMSFNCTabSetTabSizeMode.tsmFixedSize) || (this.FTabSize.FMode === $mod.TTMSFNCTabSetTabSizeMode.tsmAutoTabSize));
      for (var $l5 = 0, $end5 = this.GetNormalDisplayCount() - 1; $l5 <= $end5; $l5++) {
        I = $l5;
        tbd.$assign(this.FDisplayList.GetItem(I));
        tbd.Index = I;
        tbd.TabKind = $mod.TTMSFNCTabSetTabKind.ttkNormal;
        if (I === 0) {
          tbd.First = true;
          if (tbd.Tab != null) this.FFirstTabIndex = tbd.Tab.GetIndex();
        };
        if (I === (this.GetNormalDisplayCount() - 1)) {
          tbd.Last = true;
          if (tbd.Tab != null) this.FLastTabIndex = tbd.Tab.GetIndex();
        };
        if (chrw) {
          off = 0;
          var $tmp8 = this.FLayout.FPosition;
          if (($tmp8 === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) || ($tmp8 === $mod.TTMSFNCTabSetLayoutPosition.tlpRight)) {
            sz = dw}
           else if (($tmp8 === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp8 === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom)) {
            sz = dh}
           else {
            sz = 0;
          };
          if (tbd.Row === ar) {
            off = (das - ar) * sz}
           else if (tbd.Row > ar) off = -sz;
          var $tmp9 = this.FLayout.FPosition;
          if ($tmp9 === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) {
            tbd.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(tbd.Rect.Left + off,tbd.Rect.Top,tbd.Rect.Right + off,tbd.Rect.Bottom))}
           else if ($tmp9 === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) {
            tbd.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(tbd.Rect.Left,tbd.Rect.Top + off,tbd.Rect.Right,tbd.Rect.Bottom + off))}
           else if ($tmp9 === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom) {
            tbd.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(tbd.Rect.Left,tbd.Rect.Top - off,tbd.Rect.Right,tbd.Rect.Bottom - off))}
           else if ($tmp9 === $mod.TTMSFNCTabSetLayoutPosition.tlpRight) tbd.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(tbd.Rect.Left - off,tbd.Rect.Top,tbd.Rect.Right - off,tbd.Rect.Bottom));
        };
        this.CalculateRects(tbd);
        this.FDisplayList.SetItem(I,tbd);
      };
      if ((this.FOptions.FInsertMode === $mod.TTMSFNCTabSetInsertMode.timTab) && (this.FDisplayList.GetCount() > 0)) {
        tbdinsert.$assign(this.FDisplayList.GetItem(this.FDisplayList.GetCount() - 1));
        if (tbdinsert.Tab != null) {
          r.$assign(tbdinsert.Rect);
          var $tmp10 = this.FLayout.FPosition;
          if (($tmp10 === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) || ($tmp10 === $mod.TTMSFNCTabSetLayoutPosition.tlpRight)) {
            tbdinsert.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + ((r.Right - r.Left - this.FTabAppearance.FInsertSize) / 2),r.Top,r.Left + ((r.Right - r.Left - this.FTabAppearance.FInsertSize) / 2) + this.FTabAppearance.FInsertSize,r.Bottom))}
           else if (($tmp10 === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp10 === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom)) tbdinsert.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top + ((r.Bottom - r.Top - this.FTabAppearance.FInsertSize) / 2),r.Right,r.Top + ((r.Bottom - r.Top - this.FTabAppearance.FInsertSize) / 2) + this.FTabAppearance.FInsertSize));
          if (chrw) {
            off = 0;
            var $tmp11 = this.FLayout.FPosition;
            if (($tmp11 === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) || ($tmp11 === $mod.TTMSFNCTabSetLayoutPosition.tlpRight)) {
              sz = dw}
             else if (($tmp11 === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp11 === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom)) {
              sz = dh}
             else {
              sz = 0;
            };
            if (tbd.Row === ar) {
              off = (das - ar) * sz}
             else if (tbd.Row > ar) off = -sz;
            var $tmp12 = this.FLayout.FPosition;
            if ($tmp12 === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) {
              tbdinsert.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(tbdinsert.Rect.Left + off,tbdinsert.Rect.Top,tbdinsert.Rect.Right + off,tbdinsert.Rect.Bottom))}
             else if ($tmp12 === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) {
              tbdinsert.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(tbdinsert.Rect.Left,tbdinsert.Rect.Top + off,tbdinsert.Rect.Right,tbdinsert.Rect.Bottom + off))}
             else if ($tmp12 === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom) {
              tbdinsert.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(tbdinsert.Rect.Left,tbdinsert.Rect.Top - off,tbdinsert.Rect.Right,tbdinsert.Rect.Bottom - off))}
             else if ($tmp12 === $mod.TTMSFNCTabSetLayoutPosition.tlpRight) tbdinsert.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(tbdinsert.Rect.Left - off,tbdinsert.Rect.Top,tbdinsert.Rect.Right - off,tbdinsert.Rect.Bottom));
          };
          r.$assign(tbdinsert.Rect);
          tbdinsert.BitmapRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.Math.Floor(r.Left),pas.Math.Floor(r.Top),pas.Math.Floor(r.Right),pas.Math.Floor(r.Bottom)));
          this.FDisplayList.SetItem(this.FDisplayList.GetCount() - 1,tbdinsert);
        };
      };
      if ((this.FActiveTabIndex >= 0) && (this.FActiveTabIndex <= (this.FTabs.GetCount() - 1))) {
        this.FActiveTab = this.FTabs.GetTab(this.FActiveTabIndex)}
       else this.FActiveTab = null;
      this.FScrollCount = 0;
      if ((this.FTabSize.FMode !== $mod.TTMSFNCTabSetTabSizeMode.tsmFixedSizeAutoShrink) && (this.FLayout.FMultiline === $mod.TTMSFNCTabSetLayoutMultiline.tlmNone) && this.FAllowScrolling) this.FScrollCount = this.FTabs.GetCount() - this.GetNormalDisplayCount() - this.GetInvisibleTabCountForScrolling();
      this.InitializeScrollButtonState();
      this.InitializeInvisibleTabs();
      this.StartProgressAnimationTimer();
      this.FixStartTab();
      if ((this.FLayout.FMultiline !== $mod.TTMSFNCTabSetLayoutMultiline.tlmNone) && (this.FTabSize.FMode in rtl.createSet($mod.TTMSFNCTabSetTabSizeMode.tsmFixedSize,$mod.TTMSFNCTabSetTabSizeMode.tsmAutoTabSize))) {
        this.FTotalTabHeight = (das + 1) * this.FTabSize.FHeight}
       else this.FTotalTabHeight = this.FTabSize.FHeight;
      this.Invalidate();
    };
    this.DoBeforeDrawMenuButton = function (AGraphics, ARect, AButton, AState, ADefaultDraw) {
      if (this.FOnBeforeDrawMenuButton != null) this.FOnBeforeDrawMenuButton(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AButton,AState,ADefaultDraw);
    };
    this.DoAfterDrawMenuButton = function (AGraphics, ARect, AButton, AState) {
      if (this.FOnAfterDrawMenuButton != null) this.FOnAfterDrawMenuButton(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AButton,AState);
    };
    this.DoBeforeDrawTabBackground = function (AGraphics, ATabIndex, ARect, AState, ADefaultDraw) {
      if (this.FOnBeforeDrawTabBackground != null) this.FOnBeforeDrawTabBackground(this,AGraphics,ATabIndex,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AState,ADefaultDraw);
    };
    this.DoBeforeDrawTabProgress = function (AGraphics, ATabIndex, ARect, AProgressMode, AProgressKind, AAnimationStartAngle, AAnimationSweepAngle, AProgress, AProgressMax, ADefaultDraw) {
      if (this.FOnBeforeDrawTabProgress != null) this.FOnBeforeDrawTabProgress(this,AGraphics,ATabIndex,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AProgressMode,AProgressKind,AAnimationStartAngle,AAnimationSweepAngle,AProgress,AProgressMax,ADefaultDraw);
    };
    this.DoBeforeDrawTabBadge = function (AGraphics, ATabIndex, ARect, AText, ADefaultDraw) {
      if (this.FOnBeforeDrawTabBadge != null) this.FOnBeforeDrawTabBadge(this,AGraphics,ATabIndex,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AText,ADefaultDraw);
    };
    this.DoBeforeDrawTabText = function (AGraphics, ATabIndex, ARect, AText, ADefaultDraw) {
      if (this.FOnBeforeDrawTabText != null) this.FOnBeforeDrawTabText(this,AGraphics,ATabIndex,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AText,ADefaultDraw);
    };
    this.DoBeforeDrawTabCloseButton = function (AGraphics, ATabIndex, ARect, AState, ADefaultDraw) {
      if (this.FOnBeforeDrawTabCloseButton != null) this.FOnBeforeDrawTabCloseButton(this,AGraphics,ATabIndex,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AState,ADefaultDraw);
    };
    this.DoBeforeDrawTabBitmap = function (AGraphics, ATabIndex, ARect, ADefaultDraw) {
      if (this.FOnBeforeDrawTabBitmap != null) this.FOnBeforeDrawTabBitmap(this,AGraphics,ATabIndex,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),ADefaultDraw);
    };
    this.DoAfterDrawTabBackground = function (AGraphics, ATabIndex, ARect, AState) {
      if (this.FOnAfterDrawTabBackground != null) this.FOnAfterDrawTabBackground(this,AGraphics,ATabIndex,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AState);
    };
    this.DoAfterDrawTabProgress = function (AGraphics, ATabIndex, ARect, AProgressMode, AProgressKind, AAnimationStartAngle, AAnimationSweepAngle, AProgress, AProgressMax) {
      if (this.FOnAfterDrawTabProgress != null) this.FOnAfterDrawTabProgress(this,AGraphics,ATabIndex,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AProgressMode,AProgressKind,AAnimationStartAngle,AAnimationSweepAngle,AProgress,AProgressMax);
    };
    this.DoAfterDrawTabBadge = function (AGraphics, ATabIndex, ARect, AText) {
      if (this.FOnAfterDrawTabBadge != null) this.FOnAfterDrawTabBadge(this,AGraphics,ATabIndex,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AText);
    };
    this.DoAfterDrawTabText = function (AGraphics, ATabIndex, ARect, AText) {
      if (this.FOnAfterDrawTabText != null) this.FOnAfterDrawTabText(this,AGraphics,ATabIndex,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AText);
    };
    this.DoAfterDrawTabCloseButton = function (AGraphics, ATabIndex, ARect, AState) {
      if (this.FOnAfterDrawTabCloseButton != null) this.FOnAfterDrawTabCloseButton(this,AGraphics,ATabIndex,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AState);
    };
    this.DoAfterDrawTabBitmap = function (AGraphics, ATabIndex, ARect) {
      if (this.FOnAfterDrawTabBitmap != null) this.FOnAfterDrawTabBitmap(this,AGraphics,ATabIndex,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect));
    };
    this.DoBeforeChangeTab = function (ACurrentTabIndex, ANewTabIndex, ACanChange) {
      if (this.FOnBeforeChangeTab != null) this.FOnBeforeChangeTab(this,ACurrentTabIndex,ANewTabIndex,ACanChange);
    };
    this.DoChangeTab = function (APreviousTabIndex, ACurrentTabIndex) {
      if (this.FOnChangeTab != null) this.FOnChangeTab(this,APreviousTabIndex,ACurrentTabIndex);
    };
    this.DoBeforeReorderTab = function (ACurrentTabIndex, ANewTabIndex, ACanReorder) {
      if (this.FOnBeforeReorderTab != null) this.FOnBeforeReorderTab(this,ACurrentTabIndex,ANewTabIndex,ACanReorder);
    };
    this.DoReorderTab = function (APreviousTabIndex, ACurrentTabIndex) {
      if (this.FOnReorderTab != null) this.FOnReorderTab(this,APreviousTabIndex,ACurrentTabIndex);
    };
    this.DoBeforeCloseTab = function (ATabIndex, ACloseAction) {
      if (this.FOnBeforeCloseTab != null) this.FOnBeforeCloseTab(this,ATabIndex,ACloseAction);
    };
    this.DoCloseTab = function (ATabIndex, ACloseAction) {
      if (this.FOnCloseTab != null) this.FOnCloseTab(this,ATabIndex,ACloseAction);
    };
    this.DoBeforeInsertTab = function (ANewTabIndex, ACanInsert) {
      if (this.FOnBeforeInsertTab != null) this.FOnBeforeInsertTab(this,ANewTabIndex,ACanInsert);
    };
    this.DoInsertTab = function (ANewTabIndex) {
      if (this.FOnInsertTab != null) this.FOnInsertTab(this,ANewTabIndex);
    };
    this.DoAnchorTabClick = function (ATabIndex, AAnchor) {
      if (this.FInteraction.FAutoOpenURL) {
        pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.OpenURL(AAnchor)}
       else {
        if (this.FOnAnchorTabClick != null) this.FOnAnchorTabClick(this,ATabIndex,AAnchor);
      };
    };
    this.Draw = function (AGraphics, ARect) {
      var st = null;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Draw.apply(this,arguments);
      st = AGraphics.SaveState(false);
      this.DrawCustom(AGraphics);
      r.$assign(this.GetLocalRect());
      pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,-1,-1);
      AGraphics.ClipRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r));
      AGraphics.FBitmapContainer = this.GetBitmapContainer();
      this.DrawTabs(AGraphics);
      this.DrawBadges(AGraphics);
      this.DrawMenu(AGraphics);
      AGraphics.RestoreState(st,false);
    };
    this.DrawTabs = function (AGraphics) {
      var I = 0;
      var tbd = $mod.TTMSFNCTabSetDisplayTab.$new();
      var tbdsel = $mod.TTMSFNCTabSetDisplayTab.$new();
      var tb = null;
      tbdsel.$assign($impl.EmptyDisplayTab());
      for (var $l = this.GetDisplayCount() - 1; $l >= 0; $l--) {
        I = $l;
        tbd.$assign(this.FDisplayList.GetItem(I));
        tb = tbd.Tab;
        if (tb != null) {
          if (tb === this.FActiveTab) {
            tbdsel.$assign(tbd)}
           else if (tb === this.FDragTab) {
            continue}
           else tb.Draw(AGraphics,$mod.TTMSFNCTabSetDisplayTab.$clone(tbd));
        };
      };
      if ((this.FActiveTab != null) && (this.FActiveTab !== this.FDragTab) && (tbdsel.Tab != null)) this.FActiveTab.Draw(AGraphics,$mod.TTMSFNCTabSetDisplayTab.$clone(tbdsel));
      if ((this.FDragTab != null) && (this.FDragTabDisplay.Tab != null)) this.FDragTab.Draw(AGraphics,$mod.TTMSFNCTabSetDisplayTab.$clone(this.FDragTabDisplay));
    };
    this.DrawCustom = function (AGraphics) {
    };
    this.DrawBadges = function (AGraphics) {
      var I = 0;
      var tbd = $mod.TTMSFNCTabSetDisplayTab.$new();
      var tb = null;
      for (var $l = this.GetDisplayCount() - 1; $l >= 0; $l--) {
        I = $l;
        tbd.$assign(this.FDisplayList.GetItem(I));
        tb = tbd.Tab;
        if (tb != null) tb.DrawBadge(AGraphics,$mod.TTMSFNCTabSetDisplayTab.$clone(tbd));
      };
    };
    this.DrawMenu = function (AGraphics) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var bmp = null;
      var c = false;
      if (this.FShowTabListButton) {
        var $tmp = this.FTabListButtonState;
        if ($tmp === $mod.TTMSFNCTabSetButtonState.tbsNormal) {
          AGraphics.FFill.Assign(this.FButtonAppearance.FFill);
          AGraphics.FStroke.Assign(this.FButtonAppearance.FStroke);
        } else if ($tmp === $mod.TTMSFNCTabSetButtonState.tbsHover) {
          AGraphics.FFill.Assign(this.FButtonAppearance.FHoverFill);
          AGraphics.FStroke.Assign(this.FButtonAppearance.FHoverStroke);
        } else if ($tmp === $mod.TTMSFNCTabSetButtonState.tbsDown) {
          AGraphics.FFill.Assign(this.FButtonAppearance.FDownFill);
          AGraphics.FStroke.Assign(this.FButtonAppearance.FDownStroke);
        };
        r.$assign(this.GetTabListButtonRect());
        c = true;
        this.DoBeforeDrawMenuButton(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),$mod.TTMSFNCTabSetMenuButton.tmbTabList,this.FTabListButtonState,{get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }});
        if (c) {
          AGraphics.DrawRoundRectangle$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FButtonAppearance.FRounding,rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
          bmp = this.FButtonAppearance.FTabListIcon;
          if (bmp != null) AGraphics.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),bmp,true,false,true,false);
          this.DoAfterDrawMenuButton(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),$mod.TTMSFNCTabSetMenuButton.tmbTabList,this.FTabListButtonState);
        };
      };
      if (this.FShowCloseButton) {
        var $tmp1 = this.FCloseButtonState;
        if ($tmp1 === $mod.TTMSFNCTabSetButtonState.tbsNormal) {
          AGraphics.FFill.Assign(this.FButtonAppearance.FFill);
          AGraphics.FStroke.Assign(this.FButtonAppearance.FStroke);
        } else if ($tmp1 === $mod.TTMSFNCTabSetButtonState.tbsHover) {
          AGraphics.FFill.Assign(this.FButtonAppearance.FHoverFill);
          AGraphics.FStroke.Assign(this.FButtonAppearance.FHoverStroke);
        } else if ($tmp1 === $mod.TTMSFNCTabSetButtonState.tbsDown) {
          AGraphics.FFill.Assign(this.FButtonAppearance.FDownFill);
          AGraphics.FStroke.Assign(this.FButtonAppearance.FDownStroke);
        };
        r.$assign(this.GetCloseButtonRect());
        c = true;
        this.DoBeforeDrawMenuButton(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),$mod.TTMSFNCTabSetMenuButton.tmbClose,this.FCloseButtonState,{get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }});
        if (c) {
          AGraphics.DrawRoundRectangle$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FButtonAppearance.FRounding,rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
          bmp = this.FButtonAppearance.FCloseIcon;
          if (bmp != null) AGraphics.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),bmp,true,false,true,false);
          this.DoAfterDrawMenuButton(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),$mod.TTMSFNCTabSetMenuButton.tmbClose,this.FCloseButtonState);
        };
      };
      if (this.FShowInsertButton) {
        var $tmp2 = this.FInsertButtonState;
        if ($tmp2 === $mod.TTMSFNCTabSetButtonState.tbsNormal) {
          AGraphics.FFill.Assign(this.FButtonAppearance.FFill);
          AGraphics.FStroke.Assign(this.FButtonAppearance.FStroke);
        } else if ($tmp2 === $mod.TTMSFNCTabSetButtonState.tbsHover) {
          AGraphics.FFill.Assign(this.FButtonAppearance.FHoverFill);
          AGraphics.FStroke.Assign(this.FButtonAppearance.FHoverStroke);
        } else if ($tmp2 === $mod.TTMSFNCTabSetButtonState.tbsDown) {
          AGraphics.FFill.Assign(this.FButtonAppearance.FDownFill);
          AGraphics.FStroke.Assign(this.FButtonAppearance.FDownStroke);
        };
        r.$assign(this.GetInsertButtonRect());
        c = true;
        this.DoBeforeDrawMenuButton(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),$mod.TTMSFNCTabSetMenuButton.tmbInsert,this.FInsertButtonState,{get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }});
        if (c) {
          AGraphics.DrawRoundRectangle$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FButtonAppearance.FRounding,rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
          bmp = this.FButtonAppearance.FInsertIcon;
          if (bmp != null) AGraphics.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),bmp,true,false,true,false);
          this.DoAfterDrawMenuButton(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),$mod.TTMSFNCTabSetMenuButton.tmbInsert,this.FInsertButtonState);
        };
      };
      if (this.FShowScrollButtons) {
        if (!this.FScrollButtonPreviousDisabled) {
          var $tmp3 = this.FScrollButtonPreviousState;
          if ($tmp3 === $mod.TTMSFNCTabSetButtonState.tbsNormal) {
            AGraphics.FFill.Assign(this.FButtonAppearance.FFill);
            AGraphics.FStroke.Assign(this.FButtonAppearance.FStroke);
          } else if ($tmp3 === $mod.TTMSFNCTabSetButtonState.tbsHover) {
            AGraphics.FFill.Assign(this.FButtonAppearance.FHoverFill);
            AGraphics.FStroke.Assign(this.FButtonAppearance.FHoverStroke);
          } else if ($tmp3 === $mod.TTMSFNCTabSetButtonState.tbsDown) {
            AGraphics.FFill.Assign(this.FButtonAppearance.FDownFill);
            AGraphics.FStroke.Assign(this.FButtonAppearance.FDownStroke);
          };
        } else {
          AGraphics.FFill.Assign(this.FButtonAppearance.FDisabledFill);
          AGraphics.FStroke.Assign(this.FButtonAppearance.FDisabledStroke);
        };
        r.$assign(this.GetScrollButtonPreviousRect());
        c = true;
        if (this.FScrollButtonPreviousDisabled) {
          this.DoBeforeDrawMenuButton(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),$mod.TTMSFNCTabSetMenuButton.tmbScrollPrevious,$mod.TTMSFNCTabSetButtonState.tbsDisabled,{get: function () {
              return c;
            }, set: function (v) {
              c = v;
            }})}
         else this.DoBeforeDrawMenuButton(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),$mod.TTMSFNCTabSetMenuButton.tmbScrollPrevious,this.FScrollButtonPreviousState,{get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }});
        if (c) {
          AGraphics.DrawRoundRectangle$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FButtonAppearance.FRounding,rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
          bmp = this.FButtonAppearance.FScrollPreviousIcon;
          if (bmp != null) AGraphics.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),bmp,true,false,true,false);
          if (this.FScrollButtonPreviousDisabled) {
            this.DoAfterDrawMenuButton(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),$mod.TTMSFNCTabSetMenuButton.tmbScrollPrevious,$mod.TTMSFNCTabSetButtonState.tbsDisabled)}
           else this.DoAfterDrawMenuButton(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),$mod.TTMSFNCTabSetMenuButton.tmbScrollPrevious,this.FScrollButtonPreviousState);
        };
        if (!this.FScrollButtonNextDisabled) {
          var $tmp4 = this.FScrollButtonNextState;
          if ($tmp4 === $mod.TTMSFNCTabSetButtonState.tbsNormal) {
            AGraphics.FFill.Assign(this.FButtonAppearance.FFill);
            AGraphics.FStroke.Assign(this.FButtonAppearance.FStroke);
          } else if ($tmp4 === $mod.TTMSFNCTabSetButtonState.tbsHover) {
            AGraphics.FFill.Assign(this.FButtonAppearance.FHoverFill);
            AGraphics.FStroke.Assign(this.FButtonAppearance.FHoverStroke);
          } else if ($tmp4 === $mod.TTMSFNCTabSetButtonState.tbsDown) {
            AGraphics.FFill.Assign(this.FButtonAppearance.FDownFill);
            AGraphics.FStroke.Assign(this.FButtonAppearance.FDownStroke);
          };
        } else {
          AGraphics.FFill.Assign(this.FButtonAppearance.FDisabledFill);
          AGraphics.FStroke.Assign(this.FButtonAppearance.FDisabledStroke);
        };
        r.$assign(this.GetScrollButtonNextRect());
        c = true;
        if (this.FScrollButtonNextDisabled) {
          this.DoBeforeDrawMenuButton(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),$mod.TTMSFNCTabSetMenuButton.tmbScrollNext,$mod.TTMSFNCTabSetButtonState.tbsDisabled,{get: function () {
              return c;
            }, set: function (v) {
              c = v;
            }})}
         else this.DoBeforeDrawMenuButton(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),$mod.TTMSFNCTabSetMenuButton.tmbScrollNext,this.FScrollButtonNextState,{get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }});
        if (c) {
          AGraphics.DrawRoundRectangle$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FButtonAppearance.FRounding,rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
          bmp = this.FButtonAppearance.FScrollNextIcon;
          if (bmp != null) AGraphics.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),bmp,true,false,true,false);
          if (this.FScrollButtonNextDisabled) {
            this.DoAfterDrawMenuButton(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),$mod.TTMSFNCTabSetMenuButton.tmbScrollNext,$mod.TTMSFNCTabSetButtonState.tbsDisabled)}
           else this.DoAfterDrawMenuButton(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),$mod.TTMSFNCTabSetMenuButton.tmbScrollNext,this.FScrollButtonNextState);
        };
      };
    };
    this.HandleMouseDown = function (Button, Shift, X, Y) {
      var tbd = $mod.TTMSFNCTabSetDisplayTab.$new();
      var tbdc = $mod.TTMSFNCTabSetDisplayTab.$new();
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseDown.apply(this,arguments);
      if (Button === pas["WEBLib.Controls"].TMouseButton.mbRight) return;
      this.FDownX = X;
      this.FDownY = Y;
      this.FDownCount = 0;
      this.FDragDownX = X;
      this.FDragDownY = Y;
      this.CaptureEx();
      if (!this.FDblClicked) {
        if (this.CanFocus()) this.SetFocus();
        if (this.FInplaceEditorActive) {
          this.CloseInplaceEditor(false);
          if (this.FInplaceEditorActive) return;
        };
      };
      this.FDblClicked = false;
      tbd.$assign(this.XYToTab(X,Y,null));
      tbdc.$assign(this.XYToCloseTab(X,Y));
      if (tbdc.Tab != null) {
        this.FDownCloseTab = tbdc.Tab}
       else if ((tbd.Tab != null) && !(this.XYToScrollNextButton(X,Y) || this.XYToScrollPreviousButton(X,Y))) {
        this.FTabAnchor = this.XYToAnchor($mod.TTMSFNCTabSetDisplayTab.$clone(tbd),X,Y);
        if ((this.FTabAnchor === "") && tbd.Tab.FEnabled) {
          this.FDownTab = tbd.Tab;
          this.FDragTabDisplay.$assign(this.GetDisplayTab(this.FDownTab.GetIndex()));
          this.FOrigRect$1.$assign(this.FDragTabDisplay.Rect);
        };
      } else {
        this.SaveButtonState();
        this.ClearButtonState();
        this.HandleButtonDownState(X,Y);
        if (this.IsButtonStateDown()) this.StartDownTimer();
      };
      this.Invalidate();
    };
    this.HandleMouseMove = function (Shift, X, Y) {
      var tbd = $mod.TTMSFNCTabSetDisplayTab.$new();
      var tbdd = $mod.TTMSFNCTabSetDisplayTab.$new();
      var off = 0.0;
      var b = false;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseMove.apply(this,arguments);
      if (!(this.FDownTab != null) && !(this.FDownCloseTab != null)) {
        tbd.$assign(this.XYToTab(X,Y,null));
        this.FPrevHoverTab = this.FHoverTab;
        this.FHoverTab = tbd.Tab;
        if ((this.FHoverTab != null) && !(this.XYToScrollNextButton(X,Y) || this.XYToScrollPreviousButton(X,Y))) {
          tbdd.$assign(this.XYToCloseTab(X,Y));
          this.FPrevHoverCloseTab = this.FHoverCloseTab;
          this.FHoverCloseTab = tbdd.Tab;
          if (!(this.FHoverCloseTab != null)) {
            if ((this.XYToAnchor($mod.TTMSFNCTabSetDisplayTab.$clone(tbd),X,Y) !== "") && this.FHoverTab.IsHTML()) {
              this.SetControlCursor(21)}
             else this.SetControlCursor(0);
          };
        } else if (!this.IsButtonStateDown()) {
          this.SetControlCursor(0);
          this.FPrevHoverCloseTab = null;
          this.FHoverCloseTab = null;
          this.SaveButtonState();
          this.ClearButtonState();
          this.HandleButtonHoverState(X,Y);
        };
        if (this.FHoverTab !== this.FPrevHoverTab) this.CancelHint();
        if ((this.FHoverTab !== this.FPrevHoverTab) || (this.FPrevHoverCloseTab !== this.FHoverCloseTab) || (this.IsButtonStateChanged() && !this.IsButtonStateDown())) this.Invalidate();
      } else if (!(this.FDownCloseTab != null) && this.FInteraction.FReorder && ((Math.abs(this.FDownX - X) > 3) || (Math.abs(this.FDownY - Y) > 3))) {
        this.FDragTab = this.FDownTab;
        r.$assign(this.GetTabRect());
        var $tmp = this.FLayout.FPosition;
        if (($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom)) {
          off = X - this.FDragDownX;
          if ((this.FOrigRect$1.Left + off) < r.Left) {
            off = r.Left - this.FOrigRect$1.Left}
           else if ((this.FOrigRect$1.Right + off) > r.Right) off = r.Right - this.FOrigRect$1.Right;
          this.FDragTabDisplay.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.FOrigRect$1.Left + off,this.FOrigRect$1.Top,this.FOrigRect$1.Right + off,this.FOrigRect$1.Bottom));
        } else if (($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) || ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpRight)) {
          off = Y - this.FDragDownY;
          if ((this.FOrigRect$1.Top + off) < r.Top) {
            off = r.Top - this.FOrigRect$1.Top}
           else if ((this.FOrigRect$1.Bottom + off) > r.Bottom) off = r.Bottom - this.FOrigRect$1.Bottom;
          this.FDragTabDisplay.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.FOrigRect$1.Left,this.FOrigRect$1.Top + off,this.FOrigRect$1.Right,this.FOrigRect$1.Bottom + off));
        };
        this.CalculateRects(this.FDragTabDisplay);
        b = false;
        var $tmp1 = this.FLayout.FPosition;
        if (($tmp1 === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp1 === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom)) {
          this.FDownX = X;
          if (X > (r.Right - 10)) this.HandleScrollNext({get: function () {
              return b;
            }, set: function (v) {
              b = v;
            }},false);
          if (X < (r.Left + 10)) this.HandleScrollPrevious({get: function () {
              return b;
            }, set: function (v) {
              b = v;
            }},false);
        } else if (($tmp1 === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) || ($tmp1 === $mod.TTMSFNCTabSetLayoutPosition.tlpRight)) {
          this.FDownY = Y;
          if (Y < (r.Top + 10)) this.HandleScrollNext({get: function () {
              return b;
            }, set: function (v) {
              b = v;
            }},false);
          if (Y > (r.Bottom - 10)) this.HandleScrollPrevious({get: function () {
              return b;
            }, set: function (v) {
              b = v;
            }},false);
        };
        if (b) {
          this.UpdateTabs(false,false)}
         else {
          this.Invalidate();
          this.DoInvalidate();
        };
      };
    };
    this.HandleDblClick = function (X, Y) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleDblClick.apply(this,arguments);
      this.FDblClicked = true;
    };
    this.HandleMouseUp = function (Button, Shift, X, Y) {
      var tbd = $mod.TTMSFNCTabSetDisplayTab.$new();
      var tbdb = $mod.TTMSFNCTabSetDisplayTab.$new();
      var ins = null;
      var pr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var bc = false;
      var ac = null;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseUp.apply(this,arguments);
      ins = null;
      bc = false;
      if (this.FDragTab != null) {
        var $tmp = this.FLayout.FPosition;
        if (($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpBottom)) {
          tbd.$assign(this.XYToTab(X,this.FDragTabDisplay.Rect.Top + ((this.FDragTabDisplay.Rect.Bottom - this.FDragTabDisplay.Rect.Top) / 2),this.FDragTab))}
         else if (($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpLeft) || ($tmp === $mod.TTMSFNCTabSetLayoutPosition.tlpRight)) tbd.$assign(this.XYToTab(this.FDragTabDisplay.Rect.Left + ((this.FDragTabDisplay.Rect.Right - this.FDragTabDisplay.Rect.Left) / 2),Y,this.FDragTab));
      } else {
        tbd.$assign(this.XYToTab(X,Y,null));
        tbdb.$assign(this.XYToCloseTab(X,Y));
      };
      this.ReleaseCaptureEx();
      if (this.FDragTab != null) {
        this.HandleDragTab(this.FDragTab,tbd.Tab);
        bc = true;
      } else {
        if ((this.FTabAnchor !== "") && (tbd.Tab != null) && (this.XYToAnchor($mod.TTMSFNCTabSetDisplayTab.$clone(tbd),X,Y) !== "")) {
          this.DoAnchorTabClick(tbd.Tab.GetIndex(),this.FTabAnchor)}
         else {
          this.FUpdateCount$1 += 1;
          if ((this.FDownCloseTab != null) && (this.FDownCloseTab === tbdb.Tab)) {
            this.HandleCloseTab(this.FDownCloseTab,{get: function () {
                return bc;
              }, set: function (v) {
                bc = v;
              }})}
           else if ((this.FDownTab != null) && (this.FDownTab === this.FInsertTab)) {
            ins = this.HandleInsertTab({get: function () {
                return bc;
              }, set: function (v) {
                bc = v;
              }})}
           else if ((this.FDownTab != null) && (this.FDownTab === tbd.Tab)) {
            ac = this.FActiveTab;
            if ((ac === this.FDownTab) && this.FInteraction.FEditing) {
              this.HandleTabEditing($mod.TTMSFNCTabSetDisplayTab.$clone(tbd))}
             else {
              this.FFocusedTab = this.FDownTab;
              this.HandleChangeTab(this.FDownTab);
              bc = (this.FLayout.FMultiline === $mod.TTMSFNCTabSetLayoutMultiline.tlmEnabledActiveTab) && (ac !== this.FActiveTab) && (this.GetActiveTabIndex() !== -1);
            };
          } else {
            if ((this.FTabListButtonState === $mod.TTMSFNCTabSetButtonState.tbsDown) && this.XYToTabListButton(X,Y)) {
              this.FillTabList();
              pr.$assign(this.GetTabListButtonRect());
              this.FTabListPopup.SetPlacementControl(this);
              this.FTabListPopup.FPlacementRectangle.SetLeft(pr.Left);
              this.FTabListPopup.FPlacementRectangle.SetTop(pr.Top);
              this.FTabListPopup.FPlacementRectangle.SetRight(pr.Right);
              this.FTabListPopup.FPlacementRectangle.SetBottom(pr.Bottom);
              this.FTabListPopup.Popup(false);
            } else if ((this.FCloseButtonState === $mod.TTMSFNCTabSetButtonState.tbsDown) && this.XYToCloseButton(X,Y)) {
              this.HandleCloseTab(this.FActiveTab,{get: function () {
                  return bc;
                }, set: function (v) {
                  bc = v;
                }})}
             else if ((this.FInsertButtonState === $mod.TTMSFNCTabSetButtonState.tbsDown) && this.XYToInsertButton(X,Y)) {
              ins = this.HandleInsertTab({get: function () {
                  return bc;
                }, set: function (v) {
                  bc = v;
                }})}
             else if ((this.FScrollButtonPreviousState === $mod.TTMSFNCTabSetButtonState.tbsDown) && this.XYToScrollPreviousButton(X,Y)) {
              this.HandleScrollPrevious({get: function () {
                  return bc;
                }, set: function (v) {
                  bc = v;
                }},true)}
             else if ((this.FScrollButtonNextState === $mod.TTMSFNCTabSetButtonState.tbsDown) && this.XYToScrollNextButton(X,Y)) this.HandleScrollNext({get: function () {
                return bc;
              }, set: function (v) {
                bc = v;
              }},true);
          };
        };
      };
      this.StopDownTimer();
      this.FTabAnchor = "";
      this.FDragTab = null;
      this.FDragTabDisplay.$assign($impl.EmptyDisplayTab());
      this.FDownTab = null;
      this.FHoverTab = null;
      this.FDownCloseTab = null;
      this.FHoverCloseTab = null;
      this.ClearButtonState();
      this.FUpdateCount$1 -= 1;
      if (bc) this.UpdateTabs(false,false);
      if ((ins != null) && this.FInteraction.FSelectTabOnInsert) {
        this.HandleChangeTab(ins)}
       else if (!bc) this.Invalidate();
    };
    this.HandleMouseEnter = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseEnter.call(this);
      this.Invalidate();
    };
    this.HandleMouseLeave = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseLeave.call(this);
      this.ClearButtonState();
      this.FHoverTab = null;
      this.FDownTab = null;
      this.FHoverCloseTab = null;
      this.FDownCloseTab = null;
      this.Invalidate();
    };
    this.DoExit = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.DoExit.call(this);
      if (this.FInplaceEditorActive) this.CloseInplaceEditor(false);
      this.Invalidate();
    };
    this.DoEnter = function () {
      pas["WEBLib.Controls"].TControl.DoEnter.call(this);
      this.Invalidate();
    };
    this.UpdateControlAfterResize = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.UpdateControlAfterResize.call(this);
      this.UpdateTabs(false,false);
    };
    this.StartDownTimer = function () {
      this.FDownTimer.SetEnabled(!this.IsDesignTime());
    };
    this.StopDownTimer = function () {
      this.FDownTimer.SetEnabled(false);
    };
    this.HandleKeyDown = function (Key, Shift) {
      var i = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleKeyDown.apply(this,arguments);
      if (this.FInplaceEditorClosed) return;
      var $tmp = Key.get();
      if (($tmp === 37) || ($tmp === 38)) {
        this.FocusPreviousTab(this.FInteraction.FSelectTabOnFocus)}
       else if (($tmp === 39) || ($tmp === 40)) {
        this.FocusNextTab(this.FInteraction.FSelectTabOnFocus)}
       else if ($tmp === 36) {
        i = this.GetFirstScrollableTabIndex();
        if (this.IsTabVisible(i) && this.IsTabEnabled(i)) {
          this.FocusTab(i,this.FInteraction.FSelectTabOnFocus)}
         else {
          if ((i >= 0) && (i < (this.FTabs.GetCount() - 1))) this.FFocusedTab = this.FTabs.GetTab(i);
          this.FocusNextTab(this.FInteraction.FSelectTabOnFocus);
        };
      } else if ($tmp === 35) {
        i = this.GetLastScrollableTabIndex();
        if (this.IsTabVisible(i) && this.IsTabEnabled(i)) {
          this.FocusTab(i,this.FInteraction.FSelectTabOnFocus)}
         else {
          if ((i >= 0) && (i < (this.FTabs.GetCount() - 1))) this.FFocusedTab = this.FTabs.GetTab(i);
          this.FocusPreviousTab(this.FInteraction.FSelectTabOnFocus);
        };
      };
    };
    this.HandleDialogKey = function (Key, Shift) {
      if (this.FInplaceEditorClosed) {
        pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleDialogKey.apply(this,arguments);
        return;
      };
      if ((this.FInplaceEditor != null) && this.FInplaceEditorActive && ((Key.get() === 27) || (Key.get() === 9) || (Key.get() === 113) || (pas["WEBLib.StdCtrls"].TEdit.isPrototypeOf(this.FInplaceEditor) && (Key.get() === 13)))) {
        this.FCloseWithDialogKey = true;
        this.CloseInplaceEditor(Key.get() === 27);
      };
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleDialogKey.apply(this,arguments);
    };
    this.HandleKeyUp = function (Key, Shift) {
      var tbd = $mod.TTMSFNCTabSetDisplayTab.$new();
      var d = false;
      var c = false;
      var ins = null;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleKeyUp.apply(this,arguments);
      if (this.FInplaceEditorClosed) {
        this.FInplaceEditorClosed = false;
        return;
      };
      if (this.FCloseWithDialogKey) {
        this.FCloseWithDialogKey = false;
        return;
      };
      c = false;
      d = false;
      ins = null;
      var $tmp = Key.get();
      if (($tmp === 13) || ($tmp === 32)) {
        if (!this.FInteraction.FSelectTabOnFocus && (this.FFocusedTab != null) && (this.FFocusedTab !== this.FActiveTab)) {
          this.HandleChangeTab(this.FFocusedTab);
          d = true;
        };
      } else if ($tmp === 45) {
        if (this.FInteraction.FInsertTabWithKeyboard) ins = this.HandleInsertTab({get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }});
      };
      if ((this.FFocusedTab != null) && !d) {
        var $tmp1 = Key.get();
        if ($tmp1 === 46) {
          if (this.FInteraction.FCloseTabWithKeyboard) this.HandleCloseTab(this.FFocusedTab,{get: function () {
              return c;
            }, set: function (v) {
              c = v;
            }});
        } else if (($tmp1 === 113) || ($tmp1 === 13)) {
          if (this.IsTabEnabled(this.FFocusedTab.GetIndex()) && this.FInteraction.FEditing) {
            tbd.$assign(this.GetDisplayTab(this.FFocusedTab.GetIndex()));
            this.HandleTabEditing($mod.TTMSFNCTabSetDisplayTab.$clone(tbd));
          };
        };
      };
      if (c) this.UpdateTabs(false,false);
      if ((ins != null) && this.FInteraction.FSelectTabOnInsert) {
        this.HandleChangeTab(ins)}
       else if (!c) this.Invalidate();
    };
    this.HandleMouseWheel = function (Shift, WheelDelta, Handled) {
      var b = false;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseWheel.apply(this,arguments);
      if (Handled.get() || !this.IsFocused()) return;
      b = false;
      if (WheelDelta > 0) {
        this.HandleScrollNext({get: function () {
            return b;
          }, set: function (v) {
            b = v;
          }},true)}
       else this.HandleScrollPrevious({get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }},true);
      if (b) this.UpdateTabs(false,false);
    };
    this.HandleCloseTab = function (ATab, AChanged) {
      var ca = 0;
      var I = 0;
      var dochange = false;
      var b = false;
      var tb = null;
      var idx = 0;
      if (!(ATab != null)) return;
      ca = this.FOptions.FCloseAction;
      idx = ATab.GetIndex();
      this.DoBeforeCloseTab(ATab.GetIndex(),{get: function () {
          return ca;
        }, set: function (v) {
          ca = v;
        }});
      if (ca !== $mod.TTMSFNCTabSetTabCloseAction.ttcaNone) {
        var $tmp = ca;
        if ($tmp === $mod.TTMSFNCTabSetTabCloseAction.ttcaFree) {
          I = ATab.GetIndex();
          dochange = I === this.FActiveTabIndex;
          this.FUpdateCount$1 += 1;
          ATab = rtl.freeLoc(ATab);
          AChanged.set(true);
          this.FUpdateCount$1 -= 1;
          if (I <= this.FActiveTabIndex) this.FActiveTabIndex = Math.max(0,this.FActiveTabIndex - 1);
          if ((this.FActiveTabIndex >= 0) && (this.FActiveTabIndex <= (this.FTabs.GetCount() - 1))) {
            if (!this.IsTabEnabled(this.FActiveTabIndex) || !this.IsTabVisible(this.FActiveTabIndex)) this.SelectNextSequentialTab();
          } else {
            this.FActiveTabIndex = -1;
            this.FActiveTab = null;
            this.FFocusedTab = null;
          };
          if (dochange) {
            b = true;
            if ((this.FActiveTabIndex >= 0) && (this.FActiveTabIndex <= (this.FTabs.GetCount() - 1))) {
              tb = this.FTabs.GetTab(this.FActiveTabIndex);
              if (tb.FEnabled && tb.FVisible) {
                this.DoBeforeChangeTab(I,tb.GetIndex(),{get: function () {
                    return b;
                  }, set: function (v) {
                    b = v;
                  }});
                if (b) {
                  this.FActiveTab = tb;
                  this.FActiveTabIndex = this.FActiveTab.GetIndex();
                  this.FFocusedTab = this.FActiveTab;
                  this.FTabChanging = true;
                  this.DoChangeTab(I,this.FActiveTab.GetIndex());
                  this.FTabChanging = false;
                };
              } else {
                this.FTabChanging = true;
                this.DoChangeTab(I,this.FActiveTabIndex);
                this.FTabChanging = false;
              };
            };
          };
        } else if ($tmp === $mod.TTMSFNCTabSetTabCloseAction.ttcaHide) {
          ATab.SetVisible(false);
          if (this.FActiveTabIndex === ATab.GetIndex()) {
            this.SelectNextSequentialTab();
            if ((this.FActiveTabIndex >= 0) && (this.FActiveTabIndex <= (this.FTabs.GetCount() - 1)) && (this.GetNormalDisplayCount() > 0)) {
              this.HandleChangeTab(this.FTabs.GetTab(this.FActiveTabIndex))}
             else this.HandleChangeTab(null);
          };
          AChanged.set(true);
        };
        this.DoCloseTab(idx,ca);
      };
    };
    this.HandleDragTab = function (ATab, ADropTab) {
      var c = false;
      var pri = 0;
      if ((ATab != null) && (ADropTab != null)) {
        c = true;
        this.DoBeforeReorderTab(ATab.GetIndex(),ADropTab.GetIndex(),{get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }});
        if (c) {
          pri = this.FDragTab.GetIndex();
          ATab.SetIndex(ADropTab.GetIndex());
          if (this.FActiveTab != null) this.FActiveTabIndex = this.FActiveTab.GetIndex();
          this.DoReorderTab(pri,ATab.GetIndex());
        };
      };
    };
    this.HandleChangeTab = function (ATab) {
      var b = false;
      var i = 0;
      var it = 0;
      this.FPrevTab = this.FActiveTab;
      if ((this.FPrevTab !== ATab) && (((ATab != null) && this.IsTabVisible(ATab.GetIndex()) && this.IsTabEnabled(ATab.GetIndex())) || !(ATab != null))) {
        if (this.FPrevTab != null) {
          i = this.FPrevTab.GetIndex()}
         else i = -1;
        if (ATab != null) {
          it = ATab.GetIndex()}
         else it = -1;
        b = true;
        this.DoBeforeChangeTab(i,it,{get: function () {
            return b;
          }, set: function (v) {
            b = v;
          }});
        if (b) {
          this.FActiveTab = ATab;
          this.FFocusedTab = ATab;
          this.FActiveTabIndex = it;
          this.FTabChanging = true;
          this.DoChangeTab(i,it);
          this.FTabChanging = false;
          if ((this.FLayout.FMultiline === $mod.TTMSFNCTabSetLayoutMultiline.tlmEnabledActiveTab) && (this.GetActiveTabIndex() !== -1)) {
            this.UpdateTabs(false,false)}
           else this.ScrollToTab(this.FActiveTabIndex);
        };
      };
    };
    this.HandleTabEditing = function (ATab) {
      var ins = false;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rtr = pas.Types.TRect.$new();
      var n = "";
      if (ATab.Tab != null) {
        this.FInplaceEditorClass = $mod.TTMSFNCTabSetEdit;
        ins = true;
        this.DoBeforeOpenInplaceEditor(ATab.Index,{get: function () {
            return ins;
          }, set: function (v) {
            ins = v;
          }});
        if (ins) {
          this.DoGetInplaceEditor(ATab.Tab.GetIndex(),{p: this, get: function () {
              return this.p.FInplaceEditorClass;
            }, set: function (v) {
              this.p.FInplaceEditorClass = v;
            }});
          if (this.FInplaceEditor != null) {
            rtl.free(this,"FInplaceEditor");
            this.FInplaceEditor = null;
          };
          if (this.FInplaceEditorClass != null) {
            this.FInplaceEditor = this.FInplaceEditorClass.$create("Create$1",[this])}
           else this.FInplaceEditor = $mod.TTMSFNCTabSetEdit.$create("Create$1",[this]);
          r.$assign(this.GetInplaceEditorRect($mod.TTMSFNCTabSetDisplayTab.$clone(ATab)));
          if (this.FInplaceEditor != null) {
            this.FUpdateTab.$assign(ATab);
            this.FInplaceEditor.SetShowFocus(false);
            this.FInplaceEditor.SetParent(this);
            this.FInplaceEditor.SetVisible(false);
            rtr.$assign(pas.Types.Rect(Math.round(r.Left),Math.round(r.Top),Math.round(r.Right),Math.round(r.Bottom)));
            this.FInplaceEditor.SetBoundsRect(rtr);
            this.FInplaceEditor.SetBoundsRect(pas.Types.Rect(rtr.Left,rtr.Top + rtl.trunc((rtr.Bottom - rtr.Top - this.FInplaceEditor.GetHeight()) / 2),rtr.Right,rtr.Top + rtl.trunc((rtr.Bottom - rtr.Top - this.FInplaceEditor.GetHeight()) / 2) + this.FInplaceEditor.GetHeight()));
            this.FInplaceEditor.SetVisible(true);
            this.CustomizeInplaceEditor(this.FInplaceEditor,$mod.TTMSFNCTabSetDisplayTab.$clone(ATab));
            try {
              n = ATab.Tab.FText;
            } finally {
            };
            if (this.FInplaceEditor.CanFocus()) this.FInplaceEditor.SetFocus();
            if (pas["WEBLib.StdCtrls"].TEdit.isPrototypeOf(this.FInplaceEditor)) rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TEdit).SetSelStart(rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TEdit).GetText().length);
            this.FInplaceEditorActive = true;
            this.Invalidate();
          };
          this.DoOpenInplaceEditor(ATab.Tab.GetIndex(),this.FInplaceEditor,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r));
        };
      };
    };
    this.CustomizeInplaceEditor = function (AInplaceEditor, ATab) {
      if (!(ATab.Tab != null) || !(AInplaceEditor != null)) return;
      if (this.FOnCustomizeInplaceEditor != null) this.FOnCustomizeInplaceEditor(this,ATab.Tab.GetIndex(),this.FInplaceEditor);
    };
    this.SelectNextSequentialTab = function () {
      var i = 0;
      var j = 0;
      var found = false;
      if (this.FActiveTabIndex < 0) return;
      found = false;
      i = this.FActiveTabIndex;
      j = 1;
      while (j < this.FTabs.GetCount()) {
        i += 1;
        if (i >= this.FTabs.GetCount()) break;
        if ((this.FActiveTabIndex !== i) && this.IsTabVisible(i) && this.IsTabEnabled(i)) {
          this.FActiveTabIndex = i;
          found = true;
          break;
        };
        j += 1;
      };
      if (!found) {
        i = this.FActiveTabIndex;
        j = 1;
        while (j < this.FTabs.GetCount()) {
          i -= 1;
          if (i >= this.FTabs.GetCount()) break;
          if (i < 0) break;
          if ((this.FActiveTabIndex !== i) && this.IsTabVisible(i) && this.IsTabEnabled(i)) {
            this.FActiveTabIndex = i;
            break;
          };
          j += 1;
        };
      };
    };
    this.AnimateTimerChanged = function (Sender) {
      var I = 0;
      var tbd = $mod.TTMSFNCTabSetDisplayTab.$new();
      var en = false;
      en = false;
      for (var $l = 0, $end = this.GetDisplayCount() - 1; $l <= $end; $l++) {
        I = $l;
        tbd.$assign(this.FDisplayList.GetItem(I));
        if (tbd.Tab != null) {
          if (!en && (tbd.Tab.FProgressMode === $mod.TTMSFNCTabSetTabProgressMode.tpmMarquee) && (tbd.Tab.FProgressKind !== $mod.TTMSFNCTabSetTabProgressKind.tpkNone)) en = true;
          if (!tbd.Tab.FAnimMarqueeSwitch) {
            tbd.Tab.FAnimMarqueeSweepAngle = tbd.Tab.FAnimMarqueeSweepAngle + 5}
           else {
            tbd.Tab.FAnimMarqueeStartAngle = tbd.Tab.FAnimMarqueeStartAngle + 5;
            tbd.Tab.FAnimMarqueeSweepAngle = tbd.Tab.FAnimMarqueeSweepAngle - 5;
          };
          if ((tbd.Tab.FAnimMarqueeSweepAngle === 360) && (tbd.Tab.FAnimMarqueeStartAngle === 0)) {
            tbd.Tab.FAnimMarqueeSwitch = true}
           else if ((tbd.Tab.FAnimMarqueeStartAngle === 360) && (tbd.Tab.FAnimMarqueeSweepAngle === 0)) {
            tbd.Tab.FAnimMarqueeSwitch = false;
            tbd.Tab.FAnimMarqueeStartAngle = 0;
          };
        };
      };
      if (en) this.Invalidate();
      this.FAnimTimer.SetEnabled(en);
    };
    this.DownTimerChanged = function (Sender) {
      var b = false;
      this.FDownCount += 1;
      if (this.FDownCount > 3) {
        b = false;
        if ((this.FScrollButtonNextState === $mod.TTMSFNCTabSetButtonState.tbsDown) && !this.FScrollButtonNextDisabled) this.HandleScrollNext({get: function () {
            return b;
          }, set: function (v) {
            b = v;
          }},true);
        if ((this.FScrollButtonPreviousState === $mod.TTMSFNCTabSetButtonState.tbsDown) && !this.FScrollButtonPreviousDisabled) this.HandleScrollPrevious({get: function () {
            return b;
          }, set: function (v) {
            b = v;
          }},true);
        if (b) this.UpdateTabs(false,false);
      };
    };
    this.HandleScrollNext = function (AChanged, ASelect) {
      var pr = 0;
      if (this.FInteraction.FSelectTabOnScroll && ASelect) {
        this.SelectNextTab()}
       else {
        pr = this.FStartTab;
        if (this.FStartTab < this.FScrollCount) this.FStartTab += 1;
        if (!this.IsTabVisible(this.FStartTab) && (this.FStartTab < this.GetLastScrollableTabIndex())) this.FStartTab = this.GetNextTab(this.FStartTab);
        AChanged.set(pr !== this.FStartTab);
      };
    };
    this.HandleScrollPrevious = function (AChanged, ASelect) {
      var pr = 0;
      if (this.FInteraction.FSelectTabOnScroll && ASelect) {
        this.SelectPreviousTab()}
       else {
        pr = this.FStartTab;
        if (this.FStartTab > 0) this.FStartTab -= 1;
        if (!this.IsTabVisible(this.FStartTab) && (this.FStartTab > this.GetFirstScrollableTabIndex())) this.FStartTab = this.GetPreviousTab(this.FStartTab);
        AChanged.set(pr !== this.FStartTab);
      };
    };
    this.DoBeforeOpenInplaceEditor = function (ATabIndex, ACanOpen) {
      if (this.FOnBeforeOpenInplaceEditor != null) this.FOnBeforeOpenInplaceEditor(this,ATabIndex,ACanOpen);
    };
    this.DoOpenInplaceEditor = function (ATabIndex, AInplaceEditor, AInplaceEditorRect) {
      if (this.FOnOpenInplaceEditor != null) this.FOnOpenInplaceEditor(this,ATabIndex,AInplaceEditor,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(AInplaceEditorRect));
    };
    this.DoBeforeUpdateTab = function (ATabIndex, AText, ACanUpdate) {
      if (this.FOnBeforeUpdateTab != null) this.FOnBeforeUpdateTab(this,ATabIndex,AText,ACanUpdate);
    };
    this.DoUpdateTab = function (ATabIndex) {
      if (this.FOnUpdateTab != null) this.FOnUpdateTab(this,ATabIndex);
    };
    this.DoCloseInplaceEditor = function (ATabIndex, AInplaceEditor, ACancelled, ACanClose) {
      if (this.FOnCloseInplaceEditor != null) this.FOnCloseInplaceEditor(this,ATabIndex,AInplaceEditor,ACancelled,ACanClose);
    };
    this.UpdateInplaceEditorPosition = function () {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rt = pas.Types.TRect.$new();
      if ((this.FUpdateCount$1 > 0) || (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState)) return;
      if ((this.FUpdateTab.Tab != null) && (this.FInplaceEditor != null) && this.FInplaceEditorActive) {
        if (this.GetDisplayTab(this.FUpdateTab.Index).Tab != null) {
          r.$assign(this.GetInplaceEditorRect($mod.TTMSFNCTabSetDisplayTab.$clone(this.FUpdateTab)));
          this.FInplaceEditor.SetParent(this);
          this.FInplaceEditor.SetVisible(false);
          rt.$assign(pas.Types.Rect(Math.round(r.Left),Math.round(r.Top),Math.round(r.Right),Math.round(r.Bottom)));
          this.FInplaceEditor.SetBoundsRect(rt);
          this.FInplaceEditor.SetBoundsRect(pas.Types.Rect(rt.Left,rt.Top + rtl.trunc((rt.Bottom - rt.Top - this.FInplaceEditor.GetHeight()) / 2),rt.Right,rt.Top + rtl.trunc((rt.Bottom - rt.Top - this.FInplaceEditor.GetHeight()) / 2) + this.FInplaceEditor.GetHeight()));
          this.FInplaceEditor.SetVisible(true);
        } else this.FInplaceEditor.SetParent(null);
      };
    };
    this.DoGetInplaceEditor = function (ATabIndex, AInplaceEditorClass) {
      if (this.FOnGetInplaceEditor != null) this.FOnGetInplaceEditor(this,ATabIndex,AInplaceEditorClass);
    };
    this.SetFonts = function (ASetType) {
      var I = 0;
      this.BeginUpdate();
      this.FGlobalFont.ApplyChange(this.FTabAppearance.FFont,ASetType);
      this.FGlobalFont.ApplyChange(this.FTabAppearance.FBadgeFont,ASetType);
      if (ASetType === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCAppearanceGlobalFontType.aftColor) {
        this.FTabAppearance.SetTextColor(this.FGlobalFont.FColor);
        this.FTabAppearance.SetHoverTextColor(this.FGlobalFont.FColor);
        this.FTabAppearance.SetActiveTextColor(this.FGlobalFont.FColor);
        this.FTabAppearance.SetDownTextColor(this.FGlobalFont.FColor);
        for (var $l = 0, $end = this.FTabs.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          this.FTabs.GetTab(I).SetTextColor(this.FGlobalFont.FColor);
          this.FTabs.GetTab(I).SetHoverTextColor(this.FGlobalFont.FColor);
          this.FTabs.GetTab(I).SetActiveTextColor(this.FGlobalFont.FColor);
          this.FTabs.GetTab(I).SetDownTextColor(this.FGlobalFont.FColor);
        };
      };
      this.EndUpdate();
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Create$1.apply(this,arguments);
      this.FInsertTab = $mod.TTMSFNCTabSetTab.$create("Create$1",[null]);
      this.FInsertTab.SetCloseButton(false);
      this.FInsertTab.SetTextVisible(false);
      this.FInsertTab.SetText("");
      this.FInsertTab.SetProgressKind($mod.TTMSFNCTabSetTabProgressKind.tpkNone);
      this.FActiveTabIndex = 0;
      this.FAnimTimer = pas["WEBLib.ExtCtrls"].TTimer.$create("Create$1",[this]);
      this.FAnimTimer.SetEnabled(false);
      this.FAnimTimer.SetInterval(1);
      this.FAnimTimer.FOnTimer = rtl.createCallback(this,"AnimateTimerChanged");
      this.FDownTimer = pas["WEBLib.ExtCtrls"].TTimer.$create("Create$1",[this]);
      this.FDownTimer.SetEnabled(false);
      this.FDownTimer.SetInterval(100);
      this.FDownTimer.FOnTimer = rtl.createCallback(this,"DownTimerChanged");
      this.FDisplayList = $mod.TTMSFNCTabSetDisplayList.$create("Create$1");
      this.FInvisibleTabList = $mod.TTMSFNCTabSetInvisibleTabList.$create("Create$1");
      this.FTabs = this.CreateTabs();
      this.FTabSize = $mod.TTMSFNCTabSetTabSize.$create("Create$1",[this]);
      this.FTabAppearance = $mod.TTMSFNCTabSetTabAppearance.$create("Create$1",[this]);
      this.FButtonAppearance = $mod.TTMSFNCTabSetButtonAppearance.$create("Create$1",[this]);
      this.FInteraction = $mod.TTMSFNCTabSetInteraction.$create("Create$1",[this]);
      this.FOptions = $mod.TTMSFNCTabSetOptions.$create("Create$1",[this]);
      this.FLayout = $mod.TTMSFNCTabSetLayout.$create("Create$1",[this]);
      this.FStartTab = 0;
      this.FAllowScrolling = true;
      this.FInsertTab.FBitmaps.AddBitmap(this.FButtonAppearance.FInsertIcon,1.0);
      this.FInsertTab.FDisabledBitmaps.AddBitmap(this.FButtonAppearance.FInsertIcon,1.0);
      this.FInsertTab.FTabSet = this;
      this.FTabListPopup = pas["WEBLib.TMSFNCPopup"].TTMSFNCPopup.$create("Create$1",[this]);
      this.FTabList = pas["WEBLib.StdCtrls"].TListBox.$create("Create$1",[this.FTabList]);
      this.FTabList.FOnClick = rtl.createCallback(this,"PopupListSelected");
      this.FTabListPopup.SetContentControl(this.FTabList);
      this.FTabListPopup.FFocusedControl = this.FTabList;
      this.FTabListPopup.SetPlacement(pas["WEBLib.TMSFNCPopup"].TTMSFNCPopupPlacement.ppBottom);
      this.FTabListPopup.SetDropDownHeight(125);
      this.FTabListPopup.SetDropDownWidth(100);
      this.FGlobalFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCAppearanceGlobalFont.$create("Create$1",[this]);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FGlobalFont");
      rtl.free(this,"FAnimTimer");
      rtl.free(this,"FTabList");
      rtl.free(this,"FTabListPopup");
      rtl.free(this,"FInsertTab");
      rtl.free(this,"FTabSize");
      rtl.free(this,"FTabs");
      rtl.free(this,"FTabAppearance");
      rtl.free(this,"FButtonAppearance");
      rtl.free(this,"FInteraction");
      rtl.free(this,"FOptions");
      rtl.free(this,"FLayout");
      rtl.free(this,"FInvisibleTabList");
      rtl.free(this,"FDisplayList");
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Destroy.call(this);
    };
    this.FindNextTab = function (ATabIndex, ACheckTabVisible) {
      var Result = 0;
      var i = 0;
      var j = 0;
      Result = -1;
      if ((ATabIndex >= 0) && (ATabIndex < this.FTabs.GetCount())) return Result;
      i = ATabIndex;
      j = 1;
      while (j < this.FTabs.GetCount()) {
        i += 1;
        if (i >= this.FTabs.GetCount()) i = 0;
        if ((ACheckTabVisible && this.IsTabVisible(i)) || !ACheckTabVisible) {
          Result = i;
          break;
        };
        j += 1;
      };
      return Result;
    };
    this.FindPreviousTab = function (ATabIndex, ACheckTabVisible) {
      var Result = 0;
      var i = 0;
      var j = 0;
      Result = -1;
      if ((ATabIndex >= 0) && (ATabIndex < this.FTabs.GetCount())) return Result;
      i = ATabIndex;
      j = 1;
      while (j < this.FTabs.GetCount()) {
        i -= 1;
        if (i >= this.FTabs.GetCount()) i = 0;
        if (i < 0) i = this.FTabs.GetCount() - 1;
        if ((ACheckTabVisible && this.IsTabVisible(i)) || !ACheckTabVisible) {
          Result = i;
          break;
        };
        j += 1;
      };
      return Result;
    };
    this.InsertTab = function (ATabIndex, AText) {
      var Result = null;
      Result = this.FTabs.Insert$1(ATabIndex);
      Result.SetText(AText);
      return Result;
    };
    this.AddTab = function (AText) {
      var Result = null;
      Result = this.FTabs.Add$1();
      Result.SetText(AText);
      return Result;
    };
    this.XYToTab = function (X, Y, AExcludeTab) {
      var Result = $mod.TTMSFNCTabSetDisplayTab.$new();
      var I = 0;
      var tbd = $mod.TTMSFNCTabSetDisplayTab.$new();
      var pth = null;
      var fnd = false;
      fnd = false;
      Result.$assign($impl.EmptyDisplayTab());
      for (var $l = this.GetDisplayCount() - 1; $l >= 0; $l--) {
        I = $l;
        tbd.$assign(this.FDisplayList.GetItem(I));
        if ((tbd.Tab != null) && (tbd.Tab !== AExcludeTab)) {
          if (tbd.Tab === this.FInsertTab) {
            pth = tbd.Tab.GetInsertShapePath(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(tbd.Rect))}
           else pth = tbd.Tab.GetShapePath(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(tbd.Rect));
          if (pth != null) {
            if (pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.PointInPath(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(X,Y)),pth)) {
              Result.$assign(tbd);
              fnd = true;
            };
            pth = rtl.freeLoc(pth);
          };
          if (fnd) break;
        };
      };
      return Result;
    };
    this.XYToCloseTab = function (X, Y) {
      var Result = $mod.TTMSFNCTabSetDisplayTab.$new();
      var I = 0;
      var tbd = $mod.TTMSFNCTabSetDisplayTab.$new();
      Result.$assign($impl.EmptyDisplayTab());
      if (this.FOptions.FCloseMode !== $mod.TTMSFNCTabSetCloseMode.tcmTab) return Result;
      for (var $l = this.GetDisplayCount() - 1; $l >= 0; $l--) {
        I = $l;
        tbd.$assign(this.FDisplayList.GetItem(I));
        if ((tbd.Tab != null) && tbd.Tab.FCloseButton) {
          if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(tbd.CloseButtonRect,pas["WEBLib.TMSFNCTypes"].PointF(X,Y))) {
            Result.$assign(tbd);
            break;
          };
        };
      };
      return Result;
    };
    this.XYToScrollNextButton = function (X, Y) {
      var Result = false;
      Result = this.FShowScrollButtons && !this.FScrollButtonNextDisabled && pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetScrollButtonNextRect(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y));
      return Result;
    };
    this.XYToScrollPreviousButton = function (X, Y) {
      var Result = false;
      Result = this.FShowScrollButtons && !this.FScrollButtonPreviousDisabled && pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetScrollButtonPreviousRect(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y));
      return Result;
    };
    this.XYToCloseButton = function (X, Y) {
      var Result = false;
      Result = this.FShowCloseButton && pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetCloseButtonRect(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y));
      return Result;
    };
    this.XYToInsertButton = function (X, Y) {
      var Result = false;
      Result = this.FShowInsertButton && pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetInsertButtonRect(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y));
      return Result;
    };
    this.XYToTabListButton = function (X, Y) {
      var Result = false;
      Result = this.FShowTabListButton && pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetTabListButtonRect(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y));
      return Result;
    };
    this.IsTabVisible = function (ATabIndex) {
      var Result = false;
      Result = false;
      if ((ATabIndex >= 0) && (ATabIndex <= (this.FTabs.GetCount() - 1))) Result = this.FTabs.GetTab(ATabIndex).FVisible;
      return Result;
    };
    this.IsTabEnabled = function (ATabIndex) {
      var Result = false;
      Result = false;
      if ((ATabIndex >= 0) && (ATabIndex <= (this.FTabs.GetCount() - 1))) Result = this.FTabs.GetTab(ATabIndex).FEnabled;
      return Result;
    };
    this.IsEditing = function () {
      var Result = false;
      Result = this.FInplaceEditorActive;
      return Result;
    };
    this.LoadSettingsFromFile = function (AFileName) {
      var I = 0;
      for (var $l = 0, $end = this.FTabs.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.FTabs.GetTab(I).SetUseDefaultAppearance(true);
      };
      if (this.FInsertTab != null) this.FInsertTab.SetUseDefaultAppearance(true);
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.LoadSettingsFromFile.apply(this,arguments);
    };
    this.LoadSettingsFromStream = function (AStream) {
      var I = 0;
      for (var $l = 0, $end = this.FTabs.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.FTabs.GetTab(I).SetUseDefaultAppearance(true);
      };
      if (this.FInsertTab != null) this.FInsertTab.SetUseDefaultAppearance(true);
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.LoadSettingsFromStream.apply(this,arguments);
    };
    this.MoveTab = function (AFromTabIndex, AToTabIndex) {
      var act = 0;
      if ((AFromTabIndex >= 0) && (AFromTabIndex <= (this.FTabs.GetCount() - 1)) && (AToTabIndex >= 0) && (AToTabIndex <= (this.FTabs.GetCount() - 1))) {
        act = this.GetActiveTabIndex();
        this.FTabs.GetTab(AFromTabIndex).SetIndex(this.FTabs.GetTab(AToTabIndex).GetIndex());
        if (act === AFromTabIndex) this.SetActiveTabIndex(AToTabIndex);
        if (act === AToTabIndex) this.SetActiveTabIndex(AFromTabIndex);
      };
    };
    this.RemoveTab = function (ATabIndex) {
      if ((ATabIndex >= 0) && (ATabIndex <= (this.FTabs.GetCount() - 1))) this.FTabs.Delete(ATabIndex);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCCustomTabSet.isPrototypeOf(Source)) {
        this.FTabSize.Assign(rtl.as(Source,$mod.TTMSFNCCustomTabSet).FTabSize);
        this.FTabAppearance.Assign(rtl.as(Source,$mod.TTMSFNCCustomTabSet).FTabAppearance);
        this.FInteraction.Assign(rtl.as(Source,$mod.TTMSFNCCustomTabSet).FInteraction);
        this.FOptions.Assign(rtl.as(Source,$mod.TTMSFNCCustomTabSet).FOptions);
        this.FLayout.Assign(rtl.as(Source,$mod.TTMSFNCCustomTabSet).FLayout);
        this.FTabs.Assign(rtl.as(Source,$mod.TTMSFNCCustomTabSet).FTabs);
      };
    };
    this.BeginUpdate = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBase.BeginUpdate.call(this);
      this.FUpdateCount$1 += 1;
    };
    this.EndUpdate = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBase.EndUpdate.call(this);
      this.FUpdateCount$1 -= 1;
      if (this.FUpdateCount$1 === 0) this.UpdateTabs(false,false);
    };
    this.InitSample = function () {
      this.BeginUpdate();
      this.ResetToDefaultStyle();
      this.FTabs.Clear$1();
      this.AddTab("Tab 1").SetUseDefaultAppearance(true);
      this.AddTab("Tab 2").SetUseDefaultAppearance(true);
      this.AddTab("Tab 3").SetUseDefaultAppearance(true);
      this.EndUpdate();
    };
    this.SelectNextTab = function () {
      var i = 0;
      var j = 0;
      if (this.FActiveTabIndex < 0) return;
      i = this.FActiveTabIndex;
      j = 1;
      while (j < this.FTabs.GetCount()) {
        i += 1;
        if (i >= this.FTabs.GetCount()) i = 0;
        if ((this.FActiveTabIndex !== i) && this.IsTabVisible(i) && this.IsTabEnabled(i)) {
          this.FActiveTabIndex = i;
          break;
        };
        j += 1;
      };
      if ((this.FActiveTabIndex >= 0) && (this.FActiveTabIndex <= (this.FTabs.GetCount() - 1))) {
        this.HandleChangeTab(this.FTabs.GetTab(this.FActiveTabIndex));
        if (this.FUpdateCount$1 === 0) this.Invalidate();
      };
    };
    this.SelectPreviousTab = function () {
      var i = 0;
      var j = 0;
      if (this.FActiveTabIndex < 0) return;
      i = this.FActiveTabIndex;
      j = 1;
      while (j < this.FTabs.GetCount()) {
        i -= 1;
        if (i >= this.FTabs.GetCount()) i = 0;
        if (i < 0) i = this.FTabs.GetCount() - 1;
        if ((this.FActiveTabIndex !== i) && this.IsTabVisible(i) && this.IsTabEnabled(i)) {
          this.FActiveTabIndex = i;
          break;
        };
        j += 1;
      };
      if ((this.FActiveTabIndex >= 0) && (this.FActiveTabIndex <= (this.FTabs.GetCount() - 1))) {
        this.HandleChangeTab(this.FTabs.GetTab(this.FActiveTabIndex));
        if (this.FUpdateCount$1 === 0) this.Invalidate();
      };
    };
    this.SelectTab = function (ATabIndex) {
      this.SetActiveTabIndex(ATabIndex);
    };
    this.ScrollToTab = function (ATabIndex) {
      if ((this.FTabSize.FMode !== $mod.TTMSFNCTabSetTabSizeMode.tsmFixedSizeAutoShrink) && this.FAllowScrolling && (this.FLayout.FMultiline === $mod.TTMSFNCTabSetLayoutMultiline.tlmNone) && (this.FScrollCount > 0) && (ATabIndex >= 0) && (ATabIndex <= (this.FTabs.GetCount() - 1)) && this.IsTabVisible(ATabIndex)) {
        if ((ATabIndex > this.FLastTabIndex) || (ATabIndex < this.FFirstTabIndex)) {
          this.FStartTab = Math.max(0,ATabIndex - this.GetNormalDisplayCount() - this.GetInvisibleTabCount());
          this.UpdateTabs(false,true);
          if (ATabIndex > this.FLastTabIndex) {
            while (this.FLastTabIndex < ATabIndex) {
              this.FStartTab += 1;
              if (!this.IsTabVisible(this.FStartTab)) this.FStartTab = this.GetNextTab(this.FStartTab);
              this.UpdateTabs(false,true);
            };
          } else if (ATabIndex < this.FFirstTabIndex) {
            while (this.FFirstTabIndex > ATabIndex) {
              this.FStartTab -= 1;
              if (!this.IsTabVisible(this.FStartTab)) this.FStartTab = this.GetPreviousTab(this.FStartTab);
              this.UpdateTabs(false,true);
            };
          };
        } else {
          this.InitializeScrollButtonState();
          this.Invalidate();
        };
      } else this.Invalidate();
    };
    this.StopEditing = function () {
      if (this.FInplaceEditorActive) this.CloseInplaceEditor(false);
    };
    this.CancelEditing = function () {
      if (this.FInplaceEditorActive) this.CloseInplaceEditor(true);
    };
    this.CloseInplaceEditor = function (ACancel) {
      var str = "";
      var b = false;
      var c = false;
      var n = "";
      if (this.FClosing) return;
      this.FClosing = true;
      if ((this.FUpdateTab.Tab != null) && (this.FInplaceEditor != null)) {
        if (!ACancel) {
          try {
            n = "";
            if (pas["WEBLib.StdCtrls"].TEdit.isPrototypeOf(this.FInplaceEditor)) str = rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TEdit).GetText();
            n = str;
          } finally {
          };
        };
        c = true;
        this.DoCloseInplaceEditor(this.FUpdateTab.Tab.GetIndex(),this.FInplaceEditor,ACancel,{get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }});
        if (c) {
          b = true;
          this.DoBeforeUpdateTab(this.FUpdateTab.Tab.GetIndex(),{get: function () {
              return n;
            }, set: function (v) {
              n = v;
            }},{get: function () {
              return b;
            }, set: function (v) {
              b = v;
            }});
          if (b && !ACancel) {
            this.FUpdateCount$1 += 1;
            if (this.FUpdateTab.Tab != null) this.FUpdateTab.Tab.SetText(n);
            this.FUpdateCount$1 -= 1;
            this.DoUpdateTab(this.FUpdateTab.Tab.GetIndex());
          };
          this.FInplaceEditor.SetParent(null);
          rtl.free(this,"FInplaceEditor");
          this.FInplaceEditor = null;
          this.FInplaceEditorActive = false;
        };
        if (c) {
          this.UpdateTabs(false,false);
          if (this.CanFocus()) this.SetFocus();
        };
      };
      this.FClosing = false;
    };
    this.FocusNextTab = function (ASelect) {
      var i = 0;
      var j = 0;
      var fi = 0;
      if (!(this.FFocusedTab != null)) return;
      fi = this.FFocusedTab.GetIndex();
      i = fi;
      j = 1;
      while (j < this.FTabs.GetCount()) {
        i += 1;
        if (i >= this.FTabs.GetCount()) i = 0;
        if ((fi !== i) && this.IsTabVisible(i) && this.IsTabEnabled(i)) {
          fi = i;
          break;
        };
        j += 1;
      };
      if ((fi >= 0) && (fi <= (this.FTabs.GetCount() - 1))) {
        this.FFocusedTab = this.FTabs.GetTab(fi);
        if (ASelect) {
          this.HandleChangeTab(this.FFocusedTab)}
         else this.ScrollToTab(fi);
      };
    };
    this.FocusPreviousTab = function (ASelect) {
      var i = 0;
      var j = 0;
      var fi = 0;
      if (!(this.FFocusedTab != null)) return;
      fi = this.FFocusedTab.GetIndex();
      i = fi;
      j = 1;
      while (j < this.FTabs.GetCount()) {
        i -= 1;
        if (i >= this.FTabs.GetCount()) i = 0;
        if (i < 0) i = this.FTabs.GetCount() - 1;
        if ((fi !== i) && this.IsTabVisible(i) && this.IsTabEnabled(i)) {
          fi = i;
          break;
        };
        j += 1;
      };
      if ((fi >= 0) && (fi <= (this.FTabs.GetCount() - 1))) {
        this.FFocusedTab = this.FTabs.GetTab(fi);
        if (ASelect) {
          this.HandleChangeTab(this.FFocusedTab)}
         else this.ScrollToTab(fi);
      };
    };
    this.FocusTab = function (ATabIndex, ASelect) {
      if ((ATabIndex >= 0) && (ATabIndex <= (this.FTabs.GetCount() - 1)) && this.IsTabVisible(ATabIndex)) {
        this.FFocusedTab = this.FTabs.GetTab(ATabIndex);
        if (ASelect) {
          this.HandleChangeTab(this.FFocusedTab)}
         else this.ScrollToTab(ATabIndex);
      };
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphicsTypes"].ITMSFNCAppearanceGlobalFont);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCBaseListIO);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCBasePersistenceIO);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCTabSet",this.TTMSFNCCustomTabSet,function () {
    this.RegisterRuntimeClasses = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClasses([$mod.TTMSFNCTabSet,$mod.TTMSFNCTabSetTab]);
    };
    this.Create$1 = function (AOwner) {
      $mod.TTMSFNCCustomTabSet.Create$1.apply(this,arguments);
      this.SetWidth(225);
      this.SetHeight(30);
      if (this.IsDesignTime()) this.InitSample();
      return this;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphicsTypes"].ITMSFNCAppearanceGlobalFont);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCBaseListIO);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCBasePersistenceIO);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("ActiveTabIndex",3,rtl.longint,"GetActiveTabIndex","SetActiveTabIndex",4,{Default: 0});
    $r.addProperty("Fill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFill","SetFill");
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
    $r.addProperty("TabAppearance",2,$mod.$rtti["TTMSFNCTabSetTabAppearance"],"FTabAppearance","SetTabAppearance");
    $r.addProperty("ButtonAppearance",2,$mod.$rtti["TTMSFNCTabSetButtonAppearance"],"FButtonAppearance","SetButtonAppearance");
    $r.addProperty("BitmapContainer",3,pas["WEBLib.TMSFNCBitmapContainer"].$rtti["TTMSFNCBitmapContainer"],"GetBitmapContainer","SetBitmapContainer");
    $r.addProperty("Interaction",2,$mod.$rtti["TTMSFNCTabSetInteraction"],"FInteraction","SetInteraction");
    $r.addProperty("Options",2,$mod.$rtti["TTMSFNCTabSetOptions"],"FOptions","SetOptions");
    $r.addProperty("Tabs",2,$mod.$rtti["TTMSFNCTabSetTabs"],"FTabs","SetTabs");
    $r.addProperty("TabSize",2,$mod.$rtti["TTMSFNCTabSetTabSize"],"FTabSize","SetTabSize");
    $r.addProperty("Layout",2,$mod.$rtti["TTMSFNCTabSetLayout"],"FLayout","SetLayout");
    $r.addProperty("Version",1,rtl.string,"GetVersion","");
    $r.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",4,{Default: true});
    $r.addProperty("GlobalFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCAppearanceGlobalFont"],"FGlobalFont","SetGlobalFont");
    $r.addProperty("OnBeforeCloseTab",0,$mod.$rtti["TTMSFNCTabSetBeforeCloseTabEvent"],"FOnBeforeCloseTab","FOnBeforeCloseTab");
    $r.addProperty("OnBeforeChangeTab",0,$mod.$rtti["TTMSFNCTabSetBeforeChangeTabEvent"],"FOnBeforeChangeTab","FOnBeforeChangeTab");
    $r.addProperty("OnCloseTab",0,$mod.$rtti["TTMSFNCTabSetCloseTabEvent"],"FOnCloseTab","FOnCloseTab");
    $r.addProperty("OnChangeTab",0,$mod.$rtti["TTMSFNCTabSetChangeTabEvent"],"FOnChangeTab","FOnChangeTab");
    $r.addProperty("OnAnchorTabClick",0,$mod.$rtti["TTMSFNCTabSetAnchorTabClickEvent"],"FOnAnchorTabClick","FOnAnchorTabClick");
    $r.addProperty("OnBeforeInsertTab",0,$mod.$rtti["TTMSFNCTabSetBeforeInsertTabEvent"],"FOnBeforeInsertTab","FOnBeforeInsertTab");
    $r.addProperty("OnInsertTab",0,$mod.$rtti["TTMSFNCTabSetInsertTabEvent"],"FOnInsertTab","FOnInsertTab");
    $r.addProperty("OnBeforeUpdateTab",0,$mod.$rtti["TTMSFNCTabSetBeforeUpdateTabEvent"],"FOnBeforeUpdateTab","FOnBeforeUpdateTab");
    $r.addProperty("OnUpdateTab",0,$mod.$rtti["TTMSFNCTabSetUpdateTabEvent"],"FOnUpdateTab","FOnUpdateTab");
    $r.addProperty("OnBeforeOpenInplaceEditor",0,$mod.$rtti["TTMSFNCTabSetBeforeOpenInplaceEditorEvent"],"FOnBeforeOpenInplaceEditor","FOnBeforeOpenInplaceEditor");
    $r.addProperty("OnCloseInplaceEditor",0,$mod.$rtti["TTMSFNCTabSetCloseInplaceEditorEvent"],"FOnCloseInplaceEditor","FOnCloseInplaceEditor");
    $r.addProperty("OnOpenInplaceEditor",0,$mod.$rtti["TTMSFNCTabSetOpenInplaceEditorEvent"],"FOnOpenInplaceEditor","FOnOpenInplaceEditor");
    $r.addProperty("OnGetInplaceEditor",0,$mod.$rtti["TTMSFNCTabSetGetInplaceEditorEvent"],"FOnGetInplaceEditor","FOnGetInplaceEditor");
    $r.addProperty("OnCustomizeInplaceEditor",0,$mod.$rtti["TTMSFNCTabSetCustomizeInplaceEditorEvent"],"FOnCustomizeInplaceEditor","FOnCustomizeInplaceEditor");
    $r.addProperty("OnGetInplaceEditorRect",0,$mod.$rtti["TTMSFNCTabSetGetInplaceEditorRectEvent"],"FOnGetInplaceEditorRect","FOnGetInplaceEditorRect");
    $r.addProperty("OnBeforeReorderTab",0,$mod.$rtti["TTMSFNCTabSetBeforeReorderTabEvent"],"FOnBeforeReorderTab","FOnBeforeReorderTab");
    $r.addProperty("OnReorderTab",0,$mod.$rtti["TTMSFNCTabSetReorderTabEvent"],"FOnReorderTab","FOnReorderTab");
    $r.addProperty("OnBeforeDrawTabBackground",0,$mod.$rtti["TTMSFNCTabSetBeforeDrawTabBackgroundEvent"],"FOnBeforeDrawTabBackground","FOnBeforeDrawTabBackground");
    $r.addProperty("OnBeforeDrawTabProgress",0,$mod.$rtti["TTMSFNCTabSetBeforeDrawTabProgressEvent"],"FOnBeforeDrawTabProgress","FOnBeforeDrawTabProgress");
    $r.addProperty("OnBeforeDrawTabBadge",0,$mod.$rtti["TTMSFNCTabSetBeforeDrawTabBadgeEvent"],"FOnBeforeDrawTabBadge","FOnBeforeDrawTabBadge");
    $r.addProperty("OnBeforeDrawTabText",0,$mod.$rtti["TTMSFNCTabSetBeforeDrawTabTextEvent"],"FOnBeforeDrawTabText","FOnBeforeDrawTabText");
    $r.addProperty("OnBeforeDrawTabCloseButton",0,$mod.$rtti["TTMSFNCTabSetBeforeDrawTabCloseButtonEvent"],"FOnBeforeDrawTabCloseButton","FOnBeforeDrawTabCloseButton");
    $r.addProperty("OnBeforeDrawTabBitmap",0,$mod.$rtti["TTMSFNCTabSetBeforeDrawTabBitmapEvent"],"FOnBeforeDrawTabBitmap","FOnBeforeDrawTabBitmap");
    $r.addProperty("OnAfterDrawTabBackground",0,$mod.$rtti["TTMSFNCTabSetAfterDrawTabBackgroundEvent"],"FOnAfterDrawTabBackground","FOnAfterDrawTabBackground");
    $r.addProperty("OnAfterDrawTabProgress",0,$mod.$rtti["TTMSFNCTabSetAfterDrawTabProgressEvent"],"FOnAfterDrawTabProgress","FOnAfterDrawTabProgress");
    $r.addProperty("OnAfterDrawTabBadge",0,$mod.$rtti["TTMSFNCTabSetAfterDrawTabBadgeEvent"],"FOnAfterDrawTabBadge","FOnAfterDrawTabBadge");
    $r.addProperty("OnAfterDrawTabText",0,$mod.$rtti["TTMSFNCTabSetAfterDrawTabTextEvent"],"FOnAfterDrawTabText","FOnAfterDrawTabText");
    $r.addProperty("OnAfterDrawTabCloseButton",0,$mod.$rtti["TTMSFNCTabSetAfterDrawTabCloseButtonEvent"],"FOnAfterDrawTabCloseButton","FOnAfterDrawTabCloseButton");
    $r.addProperty("OnAfterDrawTabBitmap",0,$mod.$rtti["TTMSFNCTabSetAfterDrawTabBitmapEvent"],"FOnAfterDrawTabBitmap","FOnAfterDrawTabBitmap");
    $r.addProperty("OnBeforeDrawMenuButton",0,$mod.$rtti["TTMSFNCTabSetBeforeDrawMenuButton"],"FOnBeforeDrawMenuButton","FOnBeforeDrawMenuButton");
    $r.addProperty("OnAfterDrawMenuButton",0,$mod.$rtti["TTMSFNCTabSetAfterDrawMenuButton"],"FOnAfterDrawMenuButton","FOnAfterDrawMenuButton");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
  this.TMSFNCTABSETLIST = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAJCAYAAAD+WDajAAAABGdBTUEAALGPC/xhBQAAAAlwSF" + "lzAAAOvwAADr8BOAVTJAAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4zjOaXUAAAACpJREFUKFNjwAvCwsL+48IM//" + "/jxvh1YhOEYZz2giVgAKcEDOCUwAQMDAAqj1EKDJG5XAAAAABJRU5ErkJggg==";
  this.TMSFNCTABSETCLOSE = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BA" + "ACxjwv8YQUAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuOWwzfk4AAABVSURB" + "VDhPYxh+QBSI/0OYWAFIThjCxA5ACmAYHeCTQwHYFGITwwuQNSBjkgBFmkGAIgNAGv5BaZINQdYMA0Qbgk0zDBBlCCiR4FM" + "AkhOCMIcJYGAAAHvVMBv6PIFYAAAAAElFTkSuQmCC";
  this.TMSFNCTABSETPREVIOUS = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAA" + "lwSFlzAAALEwAACxMBAJqcGAAAAEpJREFUOI3lzKENgEAQAMEJBkkIDdDTSxp6gqMyCkB8IQgMFdwZAutn+U19Bi84MU" + "bxhZrBawSXB+8RDDMaDkyvmQyZyYYuOvh6N24uDUKEV//MAAAAAElFTkSuQmCC";
  this.TMSFNCTABSETNEXT = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSF" + "lzAAALEwAACxMBAJqcGAAAAFNJREFUOI3tzzsSQFAQRNFDqSezHUuwYBJLsBuhEomE4/ll3HBq+nY1PxENRrS5xzK4L1jPSi" + "ISesxPJcORJJqwU9xthjrX/ko4mpBQocN0tf1rbDeZDIfcSud0AAAAAElFTkSuQmCC";
  this.TMSFNCTABSETADD = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFl" + "zAAALEAAACxABrSO9dQAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC45bDN+TgAAAEtJREFUOE/dzEEKACAIRFHvf2nL" + "hZDyI6VVBS9yahJVvYJhB4YdGLq5bJtHvjcYugc/8MJJ6IQhPdwJnXXIqJBh6D74oALDDgzrVAajy7VnCteJXAAAAABJRU5ErkJggg==";
  $mod.$implcode = function () {
    $impl.EmptyDisplayTab = function () {
      var Result = $mod.TTMSFNCTabSetDisplayTab.$new();
      Result.Tab = null;
      Result.ContentRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,0,0));
      Result.BitmapRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,0,0));
      Result.TextRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,0,0));
      Result.ProgressRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,0,0));
      Result.CloseButtonRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,0,0));
      Result.Rect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,0,0));
      Result.First = false;
      Result.Last = false;
      Result.Index = -1;
      Result.Row = 0;
      return Result;
    };
  };
  $mod.$init = function () {
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTABSETLIST);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTABSETCLOSE);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTABSETPREVIOUS);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTABSETNEXT);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCTABSETADD);
  };
},["WEBLib.TMSFNCUtils","WEBLib.Forms","WEBLib.Graphics","SysUtils","Math","WEBLib.TMSFNCStyles"]);
rtl.module("WEBLib.TMSFNCPageControl",["System","Classes","WEBLib.TMSFNCTabSet","WEBLib.TMSFNCPersistence","WEBLib.TMSFNCTypes","WEBLib.Controls","WEBLib.TMSFNCCustomControl","WEBLib.TMSFNCGraphics","WEBLib.TMSFNCPopup","Types"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.MAJ_VER = 1;
  this.MIN_VER = 0;
  this.REL_VER = 0;
  this.BLD_VER = 9;
  this.$rtti.$Class("TTMSFNCCustomPageControl");
  this.$rtti.$Class("TTMSFNCPageControlPage");
  rtl.createClass(this,"TTMSFNCPageControlContainer",pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$init.call(this);
      this.FIsDestroying = false;
      this.FPage = null;
      this.FPageControl = null;
      this.FPageIndex = 0;
      this.FIsActive = false;
    };
    this.$final = function () {
      this.FPage = undefined;
      this.FPageControl = undefined;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$final.call(this);
    };
    this.SetPageControl = function (Value) {
      this.SetParent(Value);
      this.FPageControl = Value;
    };
    this.GetPageControl = function () {
      var Result = null;
      Result = this.FPageControl;
      if (!(Result != null) && (this.FParent != null) && $mod.TTMSFNCCustomPageControl.isPrototypeOf(this.FParent)) Result = rtl.as(this.FParent,$mod.TTMSFNCCustomPageControl);
      return Result;
    };
    this.SetIsActive = function (Value) {
      this.FIsActive = Value;
      this.SetPage();
    };
    this.SetPageIndex = function (Value) {
      this.FPageIndex = Value;
      this.SetPage();
    };
    this.RegisterRuntimeClasses = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClass($mod.TTMSFNCPageControlContainer);
    };
    this.ReadState = function (Reader) {
      pas.Classes.TComponent.ReadState.call(this,Reader);
      if ($mod.TTMSFNCCustomPageControl.isPrototypeOf(Reader.FParent)) this.SetPageControl(Reader.FParent);
    };
    this.DefineProperties = function (Filer) {
      pas.Classes.TComponent.DefineProperties.apply(this,arguments);
      Filer.DefineProperty("PageIndex",rtl.createCallback(this,"ReadPageIndex"),rtl.createCallback(this,"WritePageIndex"),true);
      Filer.DefineProperty("IsActive",rtl.createCallback(this,"ReadIsActive"),rtl.createCallback(this,"WriteIsActive"),true);
    };
    this.ReadPageIndex = function (Reader) {
      this.FPageIndex = Reader.ReadInteger();
      this.SetPage();
    };
    this.WritePageIndex = function (Writer) {
      Writer.WriteInteger(this.FPageIndex);
    };
    this.ReadIsActive = function (Reader) {
      this.FIsActive = Reader.ReadBoolean();
      this.SetPage();
    };
    this.WriteIsActive = function (Writer) {
      Writer.WriteBoolean(this.FIsActive);
    };
    this.SetPage = function () {
      var p = null;
      if (!(this.FPageControl != null)) return;
      if ((this.FPageIndex >= 0) && (this.FPageIndex <= (this.FPageControl.GetPages().GetCount() - 1))) {
        p = rtl.as(this.FPageControl.GetPages().GetTab(this.FPageIndex),$mod.TTMSFNCPageControlPage);
        p.FContainer = this;
        this.FPage = p;
      };
      if (this.FIsActive) this.FPageControl.SetActivePageIndex(Math.max(0,Math.min(this.FPageIndex,this.FPageControl.GetPages().GetCount() - 1)));
      this.FPageControl.UpdatePages();
    };
    this.UpdateControlLayout = function (AForceUpdate) {
    };
    this.SetParent = function (Value) {
      if ($mod.TTMSFNCCustomPageControl.isPrototypeOf(Value)) this.FPageControl = rtl.as(Value,$mod.TTMSFNCCustomPageControl);
      pas["WEBLib.Controls"].TControl.SetParent.apply(this,arguments);
    };
    this.Create$1 = function (AOwner) {
      this.Create$8(AOwner,null);
      return this;
    };
    this.Create$8 = function (AOwner, APage) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Create$1.call(this,AOwner);
      this.FPage = APage;
      if ((this.FPage != null) && (this.FPage.FPageControl != null)) {
        this.FTransparent = this.FPage.FPageControl.FTransparent;
        this.FBufferedPainting = this.FPage.FPageControl.FBufferedPainting;
      };
      return this;
    };
    this.Destroy = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Destroy.call(this);
      this.FPage = null;
    };
    this.Draw = function (AGraphics, ARect) {
      var p = null;
      var tbd = pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetDisplayTab.$new();
      var tb = null;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var shz = 0.0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Draw.apply(this,arguments);
      if (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState) return;
      if ((this.FPage != null) && (this.FPage.FContainer != null) && (this.FPage.FContainer === this)) {
        if (this.IsDesignTime()) {
          AGraphics.FFont.SetHeight(this.ScalePaintValue(AGraphics.FFont.FHeight));
          AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.GetLocalRect()),this.FPage.GetFriendlyName(),false,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,true,false,-1,-1);
        };
        p = this.FPage.PageControl();
        if ((p != null) && (p.GetActivePage() === this.FPage)) {
          tbd.$assign(p.GetDisplayTab(this.FPage.GetIndex()));
          if ((tbd.Tab != null) && (tbd.Tab === this.FPage)) {
            tb = tbd.Tab;
            if ((p.DragTabDisplay().Tab != null) && (p.DragTabDisplay().Tab === this.FPage)) {
              r.$assign(tb.GetFixedRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(p.DragTabDisplay().Rect),pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetDisplayTab.$clone(p.DragTabDisplay())))}
             else r.$assign(tb.GetFixedRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(tbd.Rect),pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetDisplayTab.$clone(tbd)));
            if (((r.Right - r.Left) <= 0) || ((r.Bottom - r.Top) <= 0)) return;
            if (p.FTabAppearance.FActiveFill.FKind === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient) {
              AGraphics.FStroke.SetColor(p.FTabAppearance.FActiveFill.FColorTo)}
             else {
              if (tb.FUseDefaultAppearance) {
                AGraphics.FStroke.SetColor(p.FTabAppearance.FActiveFill.FColor)}
               else AGraphics.FStroke.SetColor(tb.FActiveColor);
            };
            AGraphics.FStroke.SetWidth(AGraphics.FStroke.FWidth * pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetDPIScale(null,-1));
            var $tmp = p.FLayout.FPosition;
            if (($tmp === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpLeft) || ($tmp === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpRight)) {
              r.Top = r.Top + (AGraphics.FStroke.FWidth / 2);
              r.Bottom = r.Bottom + (AGraphics.FStroke.FWidth / 2);
              if (p.FCollapsed) {
                var $tmp1 = p.FLayout.FPosition;
                if ($tmp1 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpLeft) {
                  r.Left = 0.5;
                  r.Right = 0.5;
                } else if ($tmp1 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpRight) {
                  r.Left = this.GetWidth() - 0.5;
                  r.Right = this.GetWidth() - 0.5;
                };
              };
            } else if (($tmp === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpBottom)) {
              r.Left = r.Left + (AGraphics.FStroke.FWidth / 2);
              r.Right = r.Right + (AGraphics.FStroke.FWidth / 2);
              if (p.FCollapsed) {
                var $tmp2 = p.FLayout.FPosition;
                if ($tmp2 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpTop) {
                  r.Top = 0.5;
                  r.Bottom = 0.5;
                } else if ($tmp2 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpBottom) {
                  r.Top = this.GetHeight() - 0.5;
                  r.Bottom = this.GetHeight() - 0.5;
                };
              };
            };
            shz = Math.round(4 * pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetDPIScale(null,-1));
            var $tmp3 = p.FLayout.FPosition;
            if ($tmp3 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpRight) {
              var $tmp4 = tb.GetShape();
              if ($tmp4 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetTabShape.tsPyramidLeft) {
                r.Top = r.Top + shz}
               else if ($tmp4 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetTabShape.tsPyramidRight) {
                r.Bottom = r.Bottom - shz}
               else if ($tmp4 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetTabShape.tsPyramid) {
                r.Top = r.Top + shz;
                r.Bottom = r.Bottom - shz;
              };
              AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left - this.GetLeft(),r.Top - this.GetTop())),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left - this.GetLeft(),r.Bottom - this.GetTop())),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmNone,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmNone);
            } else if ($tmp3 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpLeft) {
              var $tmp5 = tb.GetShape();
              if ($tmp5 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetTabShape.tsPyramidLeft) {
                r.Bottom = r.Bottom - shz}
               else if ($tmp5 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetTabShape.tsPyramidRight) {
                r.Top = r.Top + shz}
               else if ($tmp5 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetTabShape.tsPyramid) {
                r.Top = r.Top + shz;
                r.Bottom = r.Bottom - shz;
              };
              AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - this.GetLeft(),r.Top - this.GetTop())),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - this.GetLeft(),r.Bottom - this.GetTop())),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmNone,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmNone);
            } else if (($tmp3 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp3 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpBottom)) {
              var $tmp6 = tb.GetShape();
              if ($tmp6 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetTabShape.tsPyramidLeft) {
                r.Left = r.Left + shz}
               else if ($tmp6 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetTabShape.tsPyramidRight) {
                r.Right = r.Right - shz}
               else if ($tmp6 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetTabShape.tsPyramid) {
                r.Left = r.Left + shz;
                r.Right = r.Right - shz;
              };
              var $tmp7 = p.FLayout.FPosition;
              if ($tmp7 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpTop) {
                AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left - this.GetLeft(),r.Bottom - this.GetTop())),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - this.GetLeft(),r.Bottom - this.GetTop())),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmNone,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmNone)}
               else if ($tmp7 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpBottom) AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left - this.GetLeft(),r.Top - this.GetTop())),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - this.GetLeft(),r.Top - this.GetTop())),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmNone,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmNone);
            };
          };
        };
      };
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Fill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFill","SetFill");
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
  });
  this.$rtti.$ClassRef("TTMSFNCPageControlContainerClass",{instancetype: this.$rtti["TTMSFNCPageControlContainer"]});
  rtl.createClass(this,"TTMSFNCPageControlPage",pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetTab,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetTab.$init.call(this);
      this.FContainer = null;
      this.FPageControl = null;
    };
    this.$final = function () {
      this.FContainer = undefined;
      this.FPageControl = undefined;
      pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetTab.$final.call(this);
    };
    this.UpdatePage = function () {
      if (this.FPageControl != null) this.FPageControl.UpdatePages();
    };
    this.GetFriendlyName = function () {
      var Result = "";
      Result = this.GetStrippedHTMLText();
      if (Result === "") Result = "Page " + pas.SysUtils.IntToStr(this.GetIndex());
      return Result;
    };
    this.Create$1 = function (ACollection) {
      var $Self = this;
      var t = null;
      function FindUniqueName(Name) {
        var Result = "";
        Result = Name;
        return Result;
      };
      pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetTab.Create$1.apply(this,arguments);
      if (this.FCollection != null) {
        this.FPageControl = rtl.as(this.FCollection,$mod.TTMSFNCPageControlPages).PageControl();
        t = this.PageControl();
        if ((t != null) && !(t.IsReading() || t.IsLoading() || (pas.Classes.TComponentStateItem.csLoading in t.FComponentState))) {
          this.FContainer = t.GetContainerClass().$create("Create$8",[t.FOwner,$Self]);
          this.FContainer.SetPageControl(t);
          this.FContainer.SetAdaptToStyle(t.GetAdaptToStyle());
          this.FContainer.SetTabStop(false);
          if (t.IsDesigning()) this.FContainer.SetName(FindUniqueName(t.FName + "Page" + pas.SysUtils.IntToStr(this.GetIndex())));
          this.FContainer.SetAlignWithMargins(true);
          this.FContainer.SetAlign(pas["WEBLib.Controls"].TAlign.alClient);
          this.FContainer.SetVisible(false);
          t.UpdateMargins(this.FContainer);
          this.SetText(this.GetFriendlyName());
        };
      };
      if (this.FPageControl != null) {
        this.FPageControl.FUpdateMargins = true;
        if (this.FPageControl.FOnInternalInsertPage != null) this.FPageControl.FOnInternalInsertPage($Self);
      };
      this.UpdatePage();
      return this;
    };
    this.Destroy = function () {
      if (this.FContainer != null) {
        this.FContainer.FIsDestroying = true;
        if ((this.FPageControl != null) && (this.FPageControl.FPrevActivePageContainer === this.FContainer)) this.FPageControl.FPrevActivePageContainer = null;
        if ((this.FContainer.FParent != null) && (this.FPageControl != null) && !this.FPageControl.IsDestroying()) rtl.free(this,"FContainer");
        this.FContainer = null;
      };
      pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetTab.Destroy.call(this);
      if (this.FPageControl != null) this.FPageControl.FUpdateMargins = true;
      this.UpdatePage();
    };
    this.PageControl = function () {
      var Result = null;
      Result = this.FPageControl;
      return Result;
    };
  });
  rtl.createClass(this,"TTMSFNCPageControlPages",pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetTabs,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetTabs.$init.call(this);
      this.FPageControl = null;
    };
    this.$final = function () {
      this.FPageControl = undefined;
      pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetTabs.$final.call(this);
    };
    this.GetTabClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCPageControlPage;
      return Result;
    };
    this.PageControl = function () {
      var Result = null;
      Result = this.FPageControl;
      return Result;
    };
    this.Create$3 = function (ATabSet) {
      pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetTabs.Create$3.apply(this,arguments);
      this.FPageControl = rtl.as(ATabSet,$mod.TTMSFNCCustomPageControl);
      return this;
    };
    this.Clear$1 = function () {
      if (this.FPageControl != null) {
        this.FPageControl.FPrevActivePageContainer = null;
        this.FPageControl.BeginUpdate();
      };
      pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetTabs.Clear$1.call(this);
      if (this.FPageControl != null) this.FPageControl.EndUpdate();
    };
    this.Add$2 = function () {
      var Result = null;
      Result = pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetTabs.Add$1.call(this);
      return Result;
    };
    this.Insert$2 = function (Index) {
      var Result = null;
      Result = pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetTabs.Insert$1.call(this,Index);
      return Result;
    };
    this.IndexOfContainer = function (AValue) {
      var Result = 0;
      var i = 0;
      Result = -1;
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (rtl.as(this.GetItem(i),$mod.TTMSFNCPageControlPage).FContainer === AValue) {
          Result = i;
          break;
        };
      };
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCBaseListIO,{GetItemClass: "GetInterfaceItemClass"});
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCBasePersistenceIO);
  });
  this.TTMSFNCPageControlPageCloseAction = {"0": "ttcaNone", ttcaNone: 0, "1": "ttcaFree", ttcaFree: 1, "2": "ttcaHide", ttcaHide: 2};
  this.$rtti.$Enum("TTMSFNCPageControlPageCloseAction",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCPageControlPageCloseAction});
  this.$rtti.$MethodVar("TTMSFNCPageControlBeforeReorderPageEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACurrentPageIndex",rtl.longint],["ANewPageIndex",rtl.longint],["ACanReorder",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCPageControlBeforeChangePageEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACurrentPageIndex",rtl.longint],["ANewPageIndex",rtl.longint],["ACanChange",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCPageControlChangePageEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["APreviousPageIndex",rtl.longint],["ACurrentPageIndex",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCPageControlReorderPageEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["APreviousPageIndex",rtl.longint],["ACurrentPageIndex",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCPageControlBeforeClosePageEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["APageIndex",rtl.longint],["ACloseAction",this.$rtti["TTMSFNCPageControlPageCloseAction"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCPageControlClosePageEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["APageIndex",rtl.longint],["ACloseAction",this.$rtti["TTMSFNCPageControlPageCloseAction"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCPageControlBeforeInsertPageEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANewPageIndex",rtl.longint,1],["ACanInsert",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCPageControlInsertPageEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ANewPageIndex",rtl.longint]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCPageControlPopupForm",pas["WEBLib.TMSFNCPopup"].TTMSFNCCustomPopupForm,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCPageControlPopup",pas["WEBLib.TMSFNCPopup"].TTMSFNCNonFocusablePopup,function () {
    this.GetPopupFormClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCPageControlPopupForm;
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCCustomPageControl",pas["WEBLib.TMSFNCTabSet"].TTMSFNCCustomTabSet,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCTabSet"].TTMSFNCCustomTabSet.$init.call(this);
      this.FCollapsing = false;
      this.FBlockAssign = false;
      this.FSaveActivePage = null;
      this.FPopup = null;
      this.FSaveHeight = 0.0;
      this.FSaveWidth = 0.0;
      this.FUpdateMargins = false;
      this.FUpdateVisibility = false;
      this.FPrevActivePageContainer = null;
      this.FUpdateCount$2 = 0;
      this.FOnInsertPage = null;
      this.FOnBeforeClosePage = null;
      this.FOnBeforeInsertPage = null;
      this.FOnChangePage = null;
      this.FOnReorderPage = null;
      this.FOnClosePage = null;
      this.FOnBeforeChangePage = null;
      this.FOnBeforeReorderPage = null;
      this.FOnInternalInsertPage = null;
      this.FCollapsed = false;
    };
    this.$final = function () {
      this.FSaveActivePage = undefined;
      this.FPopup = undefined;
      this.FPrevActivePageContainer = undefined;
      this.FOnInsertPage = undefined;
      this.FOnBeforeClosePage = undefined;
      this.FOnBeforeInsertPage = undefined;
      this.FOnChangePage = undefined;
      this.FOnReorderPage = undefined;
      this.FOnClosePage = undefined;
      this.FOnBeforeChangePage = undefined;
      this.FOnBeforeReorderPage = undefined;
      this.FOnInternalInsertPage = undefined;
      pas["WEBLib.TMSFNCTabSet"].TTMSFNCCustomTabSet.$final.call(this);
    };
    this.GetActivePageIndex = function () {
      var Result = 0;
      Result = this.GetActiveTabIndex();
      return Result;
    };
    this.SetActivePageIndex = function (Value) {
      this.SetActiveTabIndex(Value);
    };
    this.SetPages = function (Value) {
      this.FTabs.Assign(Value);
    };
    this.GetActivePage = function () {
      var Result = null;
      Result = rtl.as(this.GetActiveTab(),$mod.TTMSFNCPageControlPage);
      return Result;
    };
    this.SetActivePage = function (Value) {
      this.SetActiveTab(Value);
    };
    this.GetPageContainer = function (AIndex) {
      var Result = null;
      Result = null;
      if ((AIndex >= 0) && (AIndex <= (this.GetPages().GetCount() - 1))) Result = rtl.as(this.GetPages().GetTab(AIndex),$mod.TTMSFNCPageControlPage).FContainer;
      return Result;
    };
    this.SetPageContainer = function (AIndex, Value) {
      var c = null;
      if (!(pas.Classes.TComponentStateItem.csDestroying in this.FComponentState)) {
        c = Value;
        if (!c.FIsDestroying && (c.FPage != null)) {
          if (this.FPrevActivePageContainer === c.FPage.FContainer) this.FPrevActivePageContainer = null;
          c.FPage.FContainer = null;
          rtl.free(c,"FPage");
          c.FPage = null;
          this.SetActivePageIndex(Math.max(0,Math.min(this.GetActivePageIndex(),this.GetPages().GetCount() - 1)));
        };
      };
    };
    this.GetDocURL = function () {
      var Result = "";
      Result = pas["WEBLib.TMSFNCTypes"].TTMSFNCBaseDocURL + "tmsfncuipack/components/" + pas.SysUtils.LowerCase(this.$classname);
      return Result;
    };
    this.GetTabClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCPageControlPage;
      return Result;
    };
    this.GetVersion = function () {
      var Result = "";
      Result = this.$class.GetVersionNumber(1,0,0,9);
      return Result;
    };
    this.CreateTabs = function () {
      var Result = null;
      Result = $mod.TTMSFNCPageControlPages.$create("Create$3",[this]);
      return Result;
    };
    this.GetContainerClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCPageControlContainer;
      return Result;
    };
    this.GetPages = function () {
      var Result = null;
      Result = rtl.as(this.FTabs,$mod.TTMSFNCPageControlPages);
      return Result;
    };
    this.Loaded = function () {
      var I = 0;
      var c = null;
      pas["WEBLib.Controls"].TCustomControl.Loaded.call(this);
      for (var $l = 0, $end = this.GetPages().GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        c = rtl.as(this.GetPages().GetTab(I),$mod.TTMSFNCPageControlPage).FContainer;
        if (c != null) c.SetVisible(true);
      };
      this.UpdatePages();
      for (var $l1 = 0, $end1 = this.GetPages().GetCount() - 1; $l1 <= $end1; $l1++) {
        I = $l1;
        c = rtl.as(this.GetPages().GetTab(I),$mod.TTMSFNCPageControlPage).FContainer;
        if (c != null) c.SetVisible(c.FIsActive);
      };
    };
    this.SetCollapsed = function (Value) {
      if (this.FCollapsed !== Value) {
        this.FCollapsing = true;
        this.FCollapsed = Value;
        this.FBlockAssign = !this.FCollapsed;
        this.FPopup.Deactivate();
        this.FBlockAssign = false;
        var $tmp = this.FLayout.FPosition;
        if (($tmp === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpLeft) || ($tmp === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpRight)) {
          if (this.FCollapsed && (this.FSaveWidth === -1)) this.FSaveWidth = this.GetWidth();
        } else if (($tmp === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpBottom)) {
          if (this.FCollapsed && (this.FSaveHeight === -1)) this.FSaveHeight = Math.round(this.GetHeight());
        };
        if (this.FCollapsed) {
          this.FSaveActivePage = this.GetActivePage();
          this.SetActivePage(null);
          this.FUpdateVisibility = true;
          this.FUpdateMargins = true;
          this.UpdatePages();
        } else if (this.FSaveActivePage != null) this.SetActivePage(this.FSaveActivePage);
        var $tmp1 = this.FLayout.FPosition;
        if (($tmp1 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpLeft) || ($tmp1 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpRight)) {
          if (this.FCollapsed) {
            if (this.FLayout.FPosition === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpLeft) {
              this.SetWidth(Math.round(this.FTabSize.FHeight + this.FTabSize.FMargins.FLeft))}
             else this.SetWidth(Math.round(this.FTabSize.FHeight + this.FTabSize.FMargins.FRight));
            if (this.FLayout.FPosition === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpRight) this.SetLeft(this.GetLeft() + Math.round(this.FSaveWidth - this.GetWidth()));
          } else {
            if (this.FLayout.FPosition === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpRight) this.SetLeft(this.GetLeft() - Math.round(this.FSaveWidth - this.GetWidth()));
            this.SetWidth(Math.round(this.FSaveWidth));
          };
        } else if (($tmp1 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp1 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpBottom)) {
          if (this.FCollapsed) {
            if (this.FLayout.FPosition === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpTop) {
              this.SetHeight(Math.round(this.FTabSize.FHeight + this.FTabSize.FMargins.FTop))}
             else this.SetHeight(Math.round(this.FTabSize.FHeight + this.FTabSize.FMargins.FBottom));
            if (this.FLayout.FPosition === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpBottom) this.SetTop(this.GetTop() + Math.round(this.FSaveHeight - this.GetHeight()));
          } else {
            if (this.FLayout.FPosition === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpBottom) this.SetTop(this.GetTop() - Math.round(this.FSaveHeight - this.GetHeight()));
            this.SetHeight(Math.round(this.FSaveHeight));
          };
        };
        if (!this.FCollapsed) {
          this.FUpdateVisibility = true;
          this.FUpdateMargins = true;
          this.UpdatePages();
        };
        this.FCollapsing = false;
      };
    };
    this.DoClosePopup = function (Sender) {
      if (this.FBlockAssign) return;
      this.SetActivePage(null);
    };
    this.SetAdaptToStyle = function (Value) {
      var I = 0;
      var c = null;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.SetAdaptToStyle.apply(this,arguments);
      for (var $l = 0, $end = this.GetPages().GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        c = rtl.as(this.GetPages().GetTab(I),$mod.TTMSFNCPageControlPage).FContainer;
        if (c != null) c.SetAdaptToStyle(this.GetAdaptToStyle());
      };
    };
    this.UpdateAllPages = function (Sender) {
      this.FUpdateMargins = true;
    };
    this.Notification = function (AComponent, Operation) {
      var c = null;
      if (!(pas.Classes.TComponentStateItem.csDestroying in this.FComponentState) && (Operation === pas.Classes.TOperation.opRemove) && $mod.TTMSFNCPageControlContainer.isPrototypeOf(AComponent)) {
        c = rtl.as(AComponent,$mod.TTMSFNCPageControlContainer);
        if (!c.FIsDestroying && (c.FPage != null)) {
          if (this.FPrevActivePageContainer === c.FPage.FContainer) this.FPrevActivePageContainer = null;
          c.FPage.FContainer = null;
          rtl.free(c,"FPage");
          c.FPage = null;
          this.SetActivePageIndex(Math.max(0,Math.min(this.GetActivePageIndex(),this.GetPages().GetCount() - 1)));
        };
      };
      pas["WEBLib.TMSFNCTabSet"].TTMSFNCCustomTabSet.Notification.apply(this,arguments);
    };
    this.UpdatePages = function () {
      var p = null;
      var c = null;
      var a = 0;
      var l = false;
      if ((this.FUpdateCount$2 > 0) || (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState)) return;
      l = true;
      this.UpdatePageIndexes();
      this.UpdateVisibility();
      a = this.GetActivePageIndex();
      if ((a >= 0) && (a <= (this.GetPages().GetCount() - 1))) {
        p = rtl.as(this.GetPages().GetTab(a),$mod.TTMSFNCPageControlPage);
        c = p.FContainer;
        if (c != null) {
          this.UpdateMargins(c);
          if (l) c.SetVisible(!this.FCollapsed);
          if (c.FParent != null) c.BringToFront();
          c.Invalidate();
          if ((this.FPrevActivePageContainer != null) && (this.FPrevActivePageContainer !== c) && l) this.FPrevActivePageContainer.SetVisible(false);
          this.FPrevActivePageContainer = c;
        };
      } else if (this.FPrevActivePageContainer != null) {
        if (l) this.FPrevActivePageContainer.SetVisible(false);
        this.FPrevActivePageContainer.SendToBack();
      };
    };
    this.UpdateTabs = function (ACalculateScrolling, AForceUpdate) {
      pas["WEBLib.TMSFNCTabSet"].TTMSFNCCustomTabSet.UpdateTabs.apply(this,arguments);
      this.UpdatePages();
    };
    this.UpdateMargins = function (AContainer) {
      var h = 0.0;
      h = this.GetTotalTabHeight();
      if (this.FCollapsed || (h <= 0)) {
        var $tmp = this.FLayout.FPosition;
        if (($tmp === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpLeft) || ($tmp === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpRight)) {
          AContainer.SetWidth(Math.round(this.FSaveWidth));
          AContainer.SetHeight(Math.round(this.GetHeight()));
        } else if (($tmp === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpBottom)) {
          AContainer.SetWidth(Math.round(this.GetWidth()));
          AContainer.SetHeight(Math.round(this.FSaveHeight));
        };
        var $tmp1 = this.FLayout.FPosition;
        if ($tmp1 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpLeft) {
          AContainer.SetWidth(AContainer.GetWidth() - Math.round((this.FTabSize.FHeight - this.FTabSize.FMargins.FLeft) + 1))}
         else if ($tmp1 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpTop) {
          AContainer.SetHeight(AContainer.GetHeight() - Math.round((this.FTabSize.FHeight - this.FTabSize.FMargins.FTop) + 1))}
         else if ($tmp1 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpBottom) {
          AContainer.SetHeight(AContainer.GetHeight() - Math.round((this.FTabSize.FHeight - this.FTabSize.FMargins.FBottom) + 1))}
         else if ($tmp1 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpRight) AContainer.SetWidth(AContainer.GetWidth() - Math.round((this.FTabSize.FHeight - this.FTabSize.FMargins.FRight) + 1));
        AContainer.FMargins.SetTop(0);
        AContainer.FMargins.SetLeft(0);
        AContainer.FMargins.SetRight(0);
        AContainer.FMargins.SetBottom(0);
      } else {
        var $tmp2 = this.FLayout.FPosition;
        if ($tmp2 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpLeft) {
          AContainer.FMargins.SetTop(0);
          AContainer.FMargins.SetLeft(Math.round((h + this.FTabSize.FMargins.FLeft) - 1));
          AContainer.FMargins.SetRight(0);
          AContainer.FMargins.SetBottom(0);
        } else if ($tmp2 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpTop) {
          AContainer.FMargins.SetTop(Math.round((h + this.FTabSize.FMargins.FTop) - 1));
          AContainer.FMargins.SetLeft(0);
          AContainer.FMargins.SetRight(0);
          AContainer.FMargins.SetBottom(0);
        } else if ($tmp2 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpBottom) {
          AContainer.FMargins.SetTop(0);
          AContainer.FMargins.SetLeft(0);
          AContainer.FMargins.SetRight(0);
          AContainer.FMargins.SetBottom(Math.round((this.FTabSize.FMargins.FBottom + h) - 1));
        } else if ($tmp2 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpRight) {
          AContainer.FMargins.SetTop(0);
          AContainer.FMargins.SetLeft(0);
          AContainer.FMargins.SetRight(Math.round((this.FTabSize.FMargins.FRight + h) - 1));
          AContainer.FMargins.SetBottom(0);
        };
      };
    };
    this.UpdatePageIndexes = function () {
      var c = null;
      var I = 0;
      for (var $l = 0, $end = this.GetPages().GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        c = rtl.as(this.GetPages().GetTab(I),$mod.TTMSFNCPageControlPage).FContainer;
        if (c != null) {
          c.FPageIndex = I;
          c.FIsActive = c.FPageIndex === this.GetActivePageIndex();
          if (this.FUpdateMargins) this.UpdateMargins(c);
        };
      };
      this.FUpdateMargins = false;
    };
    this.UpdateVisibility = function () {
      var c = null;
      var I = 0;
      if (!this.FUpdateVisibility || !this.FCollapsed) return;
      for (var $l = 0, $end = this.GetPages().GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        c = rtl.as(this.GetPages().GetTab(I),$mod.TTMSFNCPageControlPage).FContainer;
        if (c != null) c.SetVisible(!this.FCollapsed);
      };
    };
    this.DoInvalidate = function () {
      var c = null;
      pas["WEBLib.TMSFNCTabSet"].TTMSFNCCustomTabSet.DoInvalidate.call(this);
      if (this.GetActivePage() != null) {
        c = this.GetActivePage().FContainer;
        if (c != null) c.Invalidate();
      };
    };
    this.Draw = function (AGraphics, ARect) {
      pas["WEBLib.TMSFNCTabSet"].TTMSFNCCustomTabSet.Draw.apply(this,arguments);
      if ((pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) && (this.GetPages().GetCount() === 0)) {
        AGraphics.DrawFocusRectangle$3(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),0,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        AGraphics.FFont.SetHeight(this.ScalePaintValue(AGraphics.FFont.FHeight));
        AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),'Please add pages by clicking "New Page" in the context menu',false,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,true,false,-1,-1);
      };
    };
    this.DoBeforeChangeTab = function (ACurrentTabIndex, ANewTabIndex, ACanChange) {
      pas["WEBLib.TMSFNCTabSet"].TTMSFNCCustomTabSet.DoBeforeChangeTab.apply(this,arguments);
      this.DoBeforeChangePage(ACurrentTabIndex,ANewTabIndex,ACanChange);
    };
    this.DoChangeTab = function (APreviousTabIndex, ACurrentTabIndex) {
      var p = null;
      pas["WEBLib.TMSFNCTabSet"].TTMSFNCCustomTabSet.DoChangeTab.apply(this,arguments);
      this.UpdatePages();
      this.DoChangePage(APreviousTabIndex,ACurrentTabIndex);
      if (this.FCollapsed && (this.GetActivePage() != null)) {
        this.FSaveActivePage = this.GetActivePage();
        this.FBlockAssign = true;
        this.FPopup.Deactivate();
        this.FBlockAssign = false;
        p = this.GetActivePage().FContainer;
        this.FPopup.SetContentControl(p);
        this.FPopup.SetPlacementControl(this);
        var $tmp = this.FLayout.FPosition;
        if ($tmp === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpLeft) {
          this.FPopup.SetDropDownWidth(this.FSaveWidth - Math.round(this.FTabSize.FHeight + this.FTabSize.FMargins.FTop + 1));
          this.FPopup.SetDropDownHeight(this.GetHeight());
        } else if ($tmp === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpRight) {
          this.FPopup.SetDropDownWidth(this.FSaveWidth - Math.round(this.FTabSize.FHeight + this.FTabSize.FMargins.FRight + 1));
          this.FPopup.SetDropDownHeight(this.GetHeight());
        } else if ($tmp === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpTop) {
          this.FPopup.SetDropDownWidth(this.GetWidth());
          this.FPopup.SetDropDownHeight(this.FSaveHeight - Math.round(this.FTabSize.FHeight + this.FTabSize.FMargins.FTop + 1));
        } else if ($tmp === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpBottom) {
          this.FPopup.SetDropDownWidth(this.GetWidth());
          this.FPopup.SetDropDownHeight(this.FSaveHeight - Math.round(this.FTabSize.FHeight + this.FTabSize.FMargins.FBottom + 1));
        };
        var $tmp1 = this.FLayout.FPosition;
        if (($tmp1 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpLeft) || ($tmp1 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpRight)) {
          this.FPopup.FHorizontalOffset = -1;
          this.FPopup.FVerticalOffset = 0;
          this.FPopup.SetDropDownWidth(this.FPopup.FDropDownWidth + 2);
        } else if (($tmp1 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpTop) || ($tmp1 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpBottom)) {
          this.FPopup.FVerticalOffset = -1;
          this.FPopup.FHorizontalOffset = 0;
          this.FPopup.SetDropDownHeight(this.FPopup.FDropDownHeight + 2);
        };
        var $tmp2 = this.FLayout.FPosition;
        if ($tmp2 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpLeft) {
          this.FPopup.SetPlacement(pas["WEBLib.TMSFNCPopup"].TTMSFNCPopupPlacement.ppRight)}
         else if ($tmp2 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpTop) {
          this.FPopup.SetPlacement(pas["WEBLib.TMSFNCPopup"].TTMSFNCPopupPlacement.ppBottom)}
         else if ($tmp2 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpBottom) {
          this.FPopup.SetPlacement(pas["WEBLib.TMSFNCPopup"].TTMSFNCPopupPlacement.ppTop)}
         else if ($tmp2 === pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetLayoutPosition.tlpRight) this.FPopup.SetPlacement(pas["WEBLib.TMSFNCPopup"].TTMSFNCPopupPlacement.ppLeft);
        this.FPopup.Activate();
      };
    };
    this.DoBeforeReorderTab = function (ACurrentTabIndex, ANewTabIndex, ACanReorder) {
      pas["WEBLib.TMSFNCTabSet"].TTMSFNCCustomTabSet.DoBeforeReorderTab.apply(this,arguments);
      this.DoBeforeReorderPage(ACurrentTabIndex,ANewTabIndex,ACanReorder);
    };
    this.DoReorderTab = function (APreviousTabIndex, ACurrentTabIndex) {
      pas["WEBLib.TMSFNCTabSet"].TTMSFNCCustomTabSet.DoReorderTab.apply(this,arguments);
      this.DoReorderPage(APreviousTabIndex,ACurrentTabIndex);
      this.FUpdateMargins = true;
    };
    this.DoBeforeCloseTab = function (ATabIndex, ACloseAction) {
      var c = 0;
      var i = 0;
      pas["WEBLib.TMSFNCTabSet"].TTMSFNCCustomTabSet.DoBeforeCloseTab.apply(this,arguments);
      i = ACloseAction.get();
      c = i;
      this.DoBeforeClosePage(ATabIndex,{get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }});
      i = c;
      ACloseAction.set(i);
    };
    this.DoCloseTab = function (ATabIndex, ACloseAction) {
      var c = 0;
      var i = 0;
      pas["WEBLib.TMSFNCTabSet"].TTMSFNCCustomTabSet.DoCloseTab.apply(this,arguments);
      i = ACloseAction;
      c = i;
      this.DoClosePage(ATabIndex,c);
      this.FUpdateMargins = true;
    };
    this.DoBeforeInsertTab = function (ANewTabIndex, ACanInsert) {
      pas["WEBLib.TMSFNCTabSet"].TTMSFNCCustomTabSet.DoBeforeInsertTab.apply(this,arguments);
      this.DoBeforeInsertPage(ANewTabIndex,ACanInsert);
    };
    this.DoInsertTab = function (ANewTabIndex) {
      pas["WEBLib.TMSFNCTabSet"].TTMSFNCCustomTabSet.DoInsertTab.apply(this,arguments);
      this.DoInsertPage(ANewTabIndex);
      this.FUpdateMargins = true;
    };
    this.DoBeforeChangePage = function (ACurrentPageIndex, ANewPageIndex, ACanChange) {
      if (this.FOnBeforeChangePage != null) this.FOnBeforeChangePage(this,ACurrentPageIndex,ANewPageIndex,ACanChange);
    };
    this.DoChangePage = function (APreviousPageIndex, ACurrentPageIndex) {
      if (this.FOnChangePage != null) this.FOnChangePage(this,APreviousPageIndex,ACurrentPageIndex);
    };
    this.DoBeforeReorderPage = function (ACurrentPageIndex, ANewPageIndex, ACanReorder) {
      if (this.FOnBeforeReorderPage != null) this.FOnBeforeReorderPage(this,ACurrentPageIndex,ANewPageIndex,ACanReorder);
    };
    this.DoReorderPage = function (APreviousPageIndex, ACurrentPageIndex) {
      if (this.FOnReorderPage != null) this.FOnReorderPage(this,APreviousPageIndex,ACurrentPageIndex);
    };
    this.DoBeforeClosePage = function (APageIndex, ACloseAction) {
      if (this.FOnBeforeClosePage != null) this.FOnBeforeClosePage(this,APageIndex,ACloseAction);
    };
    this.DoClosePage = function (APageIndex, ACloseAction) {
      if (this.FOnClosePage != null) this.FOnClosePage(this,APageIndex,ACloseAction);
    };
    this.DoBeforeInsertPage = function (ANewPageIndex, ACanInsert) {
      if (this.FOnBeforeInsertPage != null) this.FOnBeforeInsertPage(this,ANewPageIndex,ACanInsert);
    };
    this.DoInsertPage = function (ANewPageIndex) {
      if (this.FOnInsertPage != null) this.FOnInsertPage(this,ANewPageIndex);
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCTabSet"].TTMSFNCCustomTabSet.Create$1.apply(this,arguments);
      this.FPopup = $mod.TTMSFNCPageControlPopup.$create("Create$1",[this]);
      this.FPopup.FOnClosePopup = rtl.createCallback(this,"DoClosePopup");
      if (this.IsDesignTime()) this.DisableBackground();
      this.FTabSize.FOnChange = rtl.createCallback(this,"UpdateAllPages");
      this.FLayout.FOnChange = rtl.createCallback(this,"UpdateAllPages");
      this.FSaveWidth = -1;
      this.FSaveHeight = -1;
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FPopup");
      pas["WEBLib.TMSFNCTabSet"].TTMSFNCCustomTabSet.Destroy.call(this);
    };
    this.AddPage = function (AText) {
      var Result = null;
      Result = this.GetPages().Add$2();
      Result.SetText(AText);
      if (this.FOnInternalInsertPage != null) this.FOnInternalInsertPage(Result);
      return Result;
    };
    this.InsertPage = function (APageIndex, AText) {
      var Result = null;
      Result = this.GetPages().Insert$2(APageIndex);
      Result.SetText(AText);
      if (this.FOnInternalInsertPage != null) this.FOnInternalInsertPage(Result);
      return Result;
    };
    this.GetChildren = function (Proc, Root) {
      var I = 0;
      for (var $l = 0, $end = this.GetPages().GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        Proc(this.GetPageContainer(I));
      };
    };
    this.ClosePopup = function () {
      if (this.FPopup != null) this.FPopup.Deactivate();
    };
    this.BeginUpdate = function () {
      pas["WEBLib.TMSFNCTabSet"].TTMSFNCCustomTabSet.BeginUpdate.call(this);
      this.FUpdateCount$2 += 1;
    };
    this.EndUpdate = function () {
      pas["WEBLib.TMSFNCTabSet"].TTMSFNCCustomTabSet.EndUpdate.call(this);
      this.FUpdateCount$2 -= 1;
      if (this.FUpdateCount$2 === 0) {
        this.UpdatePages();
      };
    };
    this.MovePage = function (AFromPageIndex, AToPageIndex) {
      var act = 0;
      if ((AFromPageIndex >= 0) && (AFromPageIndex <= (this.GetPages().GetCount() - 1)) && (AToPageIndex >= 0) && (AToPageIndex <= (this.GetPages().GetCount() - 1))) {
        act = this.GetActivePageIndex();
        this.GetPages().GetTab(AFromPageIndex).SetIndex(this.GetPages().GetTab(AToPageIndex).GetIndex());
        if (act === AFromPageIndex) this.SetActivePageIndex(AToPageIndex);
        if (act === AToPageIndex) this.SetActivePageIndex(AFromPageIndex);
      };
    };
    this.RemovePage = function (APageIndex) {
      if ((APageIndex >= 0) && (APageIndex <= (this.GetPages().GetCount() - 1))) this.GetPages().Delete(APageIndex);
    };
    this.UpdateControlAfterResize = function () {
      this.FUpdateMargins = !this.FCollapsing;
      pas["WEBLib.TMSFNCTabSet"].TTMSFNCCustomTabSet.UpdateControlAfterResize.call(this);
    };
    this.LoadSettingsFromFile = function (AFileName) {
      var I = 0;
      pas["WEBLib.TMSFNCTabSet"].TTMSFNCCustomTabSet.LoadSettingsFromFile.apply(this,arguments);
      for (var $l = 0, $end = this.GetPages().GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.GetPageContainer(I).FFill.Assign(this.FTabAppearance.FActiveFill);
        this.GetPageContainer(I).FStroke.Assign(this.FTabAppearance.FActiveStroke);
      };
    };
    this.LoadSettingsFromStream = function (AStream) {
      var I = 0;
      pas["WEBLib.TMSFNCTabSet"].TTMSFNCCustomTabSet.LoadSettingsFromStream.apply(this,arguments);
      for (var $l = 0, $end = this.GetPages().GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.GetPageContainer(I).FFill.Assign(this.FTabAppearance.FActiveFill);
        this.GetPageContainer(I).FStroke.Assign(this.FTabAppearance.FActiveStroke);
      };
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphicsTypes"].ITMSFNCAppearanceGlobalFont);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCBaseListIO);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCBasePersistenceIO);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCPageControl",this.TTMSFNCCustomPageControl,function () {
    this.$init = function () {
      $mod.TTMSFNCCustomPageControl.$init.call(this);
      this.FInitialize = false;
    };
    this.RegisterRuntimeClasses = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClasses([$mod.TTMSFNCPageControl,$mod.TTMSFNCPageControlPage]);
    };
    this.SetName = function (Value) {
      pas["WEBLib.Controls"].TCustomControl.SetName.apply(this,arguments);
      if (this.FInitialize) {
        this.InitSample$1();
        this.FInitialize = false;
      };
    };
    this.Create$1 = function (AOwner) {
      $mod.TTMSFNCCustomPageControl.Create$1.apply(this,arguments);
      this.SetWidth(500);
      this.SetHeight(500);
      this.FInitialize = this.IsDesignTime();
      return this;
    };
    this.InitSample$1 = function () {
      this.BeginUpdate();
      this.ResetToDefaultStyle();
      this.GetPages().Clear$1();
      this.AddPage("Page 1").SetUseDefaultAppearance(true);
      this.AddPage("Page 2").SetUseDefaultAppearance(true);
      this.AddPage("Page 3").SetUseDefaultAppearance(true);
      this.EndUpdate();
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphicsTypes"].ITMSFNCAppearanceGlobalFont);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCBaseListIO);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCBasePersistenceIO);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("ActivePageIndex",3,rtl.longint,"GetActivePageIndex","SetActivePageIndex",4,{Default: 0});
    $r.addProperty("Collapsed",2,rtl.boolean,"FCollapsed","SetCollapsed",4,{Default: false});
    $r.addProperty("Fill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFill","SetFill");
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
    $r.addProperty("TabAppearance",2,pas["WEBLib.TMSFNCTabSet"].$rtti["TTMSFNCTabSetTabAppearance"],"FTabAppearance","SetTabAppearance");
    $r.addProperty("ButtonAppearance",2,pas["WEBLib.TMSFNCTabSet"].$rtti["TTMSFNCTabSetButtonAppearance"],"FButtonAppearance","SetButtonAppearance");
    $r.addProperty("BitmapContainer",3,pas["WEBLib.TMSFNCBitmapContainer"].$rtti["TTMSFNCBitmapContainer"],"GetBitmapContainer","SetBitmapContainer");
    $r.addProperty("Interaction",2,pas["WEBLib.TMSFNCTabSet"].$rtti["TTMSFNCTabSetInteraction"],"FInteraction","SetInteraction");
    $r.addProperty("Options",2,pas["WEBLib.TMSFNCTabSet"].$rtti["TTMSFNCTabSetOptions"],"FOptions","SetOptions");
    $r.addProperty("TabSize",2,pas["WEBLib.TMSFNCTabSet"].$rtti["TTMSFNCTabSetTabSize"],"FTabSize","SetTabSize");
    $r.addProperty("Layout",2,pas["WEBLib.TMSFNCTabSet"].$rtti["TTMSFNCTabSetLayout"],"FLayout","SetLayout");
    $r.addProperty("Version",1,rtl.string,"GetVersion","");
    $r.addProperty("Pages",3,$mod.$rtti["TTMSFNCPageControlPages"],"GetPages","SetPages");
    $r.addProperty("OnBeforeClosePage",0,$mod.$rtti["TTMSFNCPageControlBeforeClosePageEvent"],"FOnBeforeClosePage","FOnBeforeClosePage");
    $r.addProperty("OnBeforeChangePage",0,$mod.$rtti["TTMSFNCPageControlBeforeChangePageEvent"],"FOnBeforeChangePage","FOnBeforeChangePage");
    $r.addProperty("OnClosePage",0,$mod.$rtti["TTMSFNCPageControlClosePageEvent"],"FOnClosePage","FOnClosePage");
    $r.addProperty("OnChangePage",0,$mod.$rtti["TTMSFNCPageControlChangePageEvent"],"FOnChangePage","FOnChangePage");
    $r.addProperty("OnAnchorTabClick",0,pas["WEBLib.TMSFNCTabSet"].$rtti["TTMSFNCTabSetAnchorTabClickEvent"],"FOnAnchorTabClick","FOnAnchorTabClick");
    $r.addProperty("OnBeforeInsertPage",0,$mod.$rtti["TTMSFNCPageControlBeforeInsertPageEvent"],"FOnBeforeInsertPage","FOnBeforeInsertPage");
    $r.addProperty("OnInsertPage",0,$mod.$rtti["TTMSFNCPageControlInsertPageEvent"],"FOnInsertPage","FOnInsertPage");
    $r.addProperty("OnBeforeUpdateTab",0,pas["WEBLib.TMSFNCTabSet"].$rtti["TTMSFNCTabSetBeforeUpdateTabEvent"],"FOnBeforeUpdateTab","FOnBeforeUpdateTab");
    $r.addProperty("OnUpdateTab",0,pas["WEBLib.TMSFNCTabSet"].$rtti["TTMSFNCTabSetUpdateTabEvent"],"FOnUpdateTab","FOnUpdateTab");
    $r.addProperty("OnBeforeOpenInplaceEditor",0,pas["WEBLib.TMSFNCTabSet"].$rtti["TTMSFNCTabSetBeforeOpenInplaceEditorEvent"],"FOnBeforeOpenInplaceEditor","FOnBeforeOpenInplaceEditor");
    $r.addProperty("OnCloseInplaceEditor",0,pas["WEBLib.TMSFNCTabSet"].$rtti["TTMSFNCTabSetCloseInplaceEditorEvent"],"FOnCloseInplaceEditor","FOnCloseInplaceEditor");
    $r.addProperty("OnOpenInplaceEditor",0,pas["WEBLib.TMSFNCTabSet"].$rtti["TTMSFNCTabSetOpenInplaceEditorEvent"],"FOnOpenInplaceEditor","FOnOpenInplaceEditor");
    $r.addProperty("OnGetInplaceEditor",0,pas["WEBLib.TMSFNCTabSet"].$rtti["TTMSFNCTabSetGetInplaceEditorEvent"],"FOnGetInplaceEditor","FOnGetInplaceEditor");
    $r.addProperty("OnCustomizeInplaceEditor",0,pas["WEBLib.TMSFNCTabSet"].$rtti["TTMSFNCTabSetCustomizeInplaceEditorEvent"],"FOnCustomizeInplaceEditor","FOnCustomizeInplaceEditor");
    $r.addProperty("OnGetInplaceEditorRect",0,pas["WEBLib.TMSFNCTabSet"].$rtti["TTMSFNCTabSetGetInplaceEditorRectEvent"],"FOnGetInplaceEditorRect","FOnGetInplaceEditorRect");
    $r.addProperty("OnBeforeReorderPage",0,$mod.$rtti["TTMSFNCPageControlBeforeReorderPageEvent"],"FOnBeforeReorderPage","FOnBeforeReorderPage");
    $r.addProperty("OnReorderPage",0,$mod.$rtti["TTMSFNCPageControlReorderPageEvent"],"FOnReorderPage","FOnReorderPage");
    $r.addProperty("OnBeforeDrawTabBackground",0,pas["WEBLib.TMSFNCTabSet"].$rtti["TTMSFNCTabSetBeforeDrawTabBackgroundEvent"],"FOnBeforeDrawTabBackground","FOnBeforeDrawTabBackground");
    $r.addProperty("OnBeforeDrawTabProgress",0,pas["WEBLib.TMSFNCTabSet"].$rtti["TTMSFNCTabSetBeforeDrawTabProgressEvent"],"FOnBeforeDrawTabProgress","FOnBeforeDrawTabProgress");
    $r.addProperty("OnBeforeDrawTabBadge",0,pas["WEBLib.TMSFNCTabSet"].$rtti["TTMSFNCTabSetBeforeDrawTabBadgeEvent"],"FOnBeforeDrawTabBadge","FOnBeforeDrawTabBadge");
    $r.addProperty("OnBeforeDrawTabText",0,pas["WEBLib.TMSFNCTabSet"].$rtti["TTMSFNCTabSetBeforeDrawTabTextEvent"],"FOnBeforeDrawTabText","FOnBeforeDrawTabText");
    $r.addProperty("OnBeforeDrawTabCloseButton",0,pas["WEBLib.TMSFNCTabSet"].$rtti["TTMSFNCTabSetBeforeDrawTabCloseButtonEvent"],"FOnBeforeDrawTabCloseButton","FOnBeforeDrawTabCloseButton");
    $r.addProperty("OnBeforeDrawTabBitmap",0,pas["WEBLib.TMSFNCTabSet"].$rtti["TTMSFNCTabSetBeforeDrawTabBitmapEvent"],"FOnBeforeDrawTabBitmap","FOnBeforeDrawTabBitmap");
    $r.addProperty("OnAfterDrawTabBackground",0,pas["WEBLib.TMSFNCTabSet"].$rtti["TTMSFNCTabSetAfterDrawTabBackgroundEvent"],"FOnAfterDrawTabBackground","FOnAfterDrawTabBackground");
    $r.addProperty("OnAfterDrawTabProgress",0,pas["WEBLib.TMSFNCTabSet"].$rtti["TTMSFNCTabSetAfterDrawTabProgressEvent"],"FOnAfterDrawTabProgress","FOnAfterDrawTabProgress");
    $r.addProperty("OnAfterDrawTabBadge",0,pas["WEBLib.TMSFNCTabSet"].$rtti["TTMSFNCTabSetAfterDrawTabBadgeEvent"],"FOnAfterDrawTabBadge","FOnAfterDrawTabBadge");
    $r.addProperty("OnAfterDrawTabText",0,pas["WEBLib.TMSFNCTabSet"].$rtti["TTMSFNCTabSetAfterDrawTabTextEvent"],"FOnAfterDrawTabText","FOnAfterDrawTabText");
    $r.addProperty("OnAfterDrawTabCloseButton",0,pas["WEBLib.TMSFNCTabSet"].$rtti["TTMSFNCTabSetAfterDrawTabCloseButtonEvent"],"FOnAfterDrawTabCloseButton","FOnAfterDrawTabCloseButton");
    $r.addProperty("OnAfterDrawTabBitmap",0,pas["WEBLib.TMSFNCTabSet"].$rtti["TTMSFNCTabSetAfterDrawTabBitmapEvent"],"FOnAfterDrawTabBitmap","FOnAfterDrawTabBitmap");
    $r.addProperty("OnBeforeDrawMenuButton",0,pas["WEBLib.TMSFNCTabSet"].$rtti["TTMSFNCTabSetBeforeDrawMenuButton"],"FOnBeforeDrawMenuButton","FOnBeforeDrawMenuButton");
    $r.addProperty("OnAfterDrawMenuButton",0,pas["WEBLib.TMSFNCTabSet"].$rtti["TTMSFNCTabSetAfterDrawMenuButton"],"FOnAfterDrawMenuButton","FOnAfterDrawMenuButton");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
  $mod.$implcode = function () {
    rtl.createClass($impl,"TTMSFNCTabSetTabOpen",pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetTab,function () {
    });
  };
  $mod.$init = function () {
    pas.Classes.RegisterClass($mod.TTMSFNCPageControlContainer);
  };
},["WEBLib.TMSFNCUtils","WEBLib.Graphics","SysUtils","Math","WEBLib.TMSFNCGraphicsTypes"]);
rtl.module("WEBLib.TMSFNCHTMLImageContainer",["System","Classes","Types","WEBLib.Controls","WEBLib.TMSFNCCustomControl","WEBLib.TMSFNCBitmapContainer","WEBLib.TMSFNCTypes","WEBLib.TMSFNCGraphics","WEBLib.TMSFNCGraphicsTypes","WEBLib.TMSFNCUtils","WEBLib.TMSFNCStyles"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.TTMSFNCHTMLImageContainerWidgetPosition = {"0": "hwpLeft", hwpLeft: 0, "1": "hwpRight", hwpRight: 1};
  this.$rtti.$Enum("TTMSFNCHTMLImageContainerWidgetPosition",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCHTMLImageContainerWidgetPosition});
  this.$rtti.$MethodVar("TTMSFNCHTMLImageContainerBeforeDrawWidgetEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AWidgetPosition",this.$rtti["TTMSFNCHTMLImageContainerWidgetPosition"]],["AAllow",rtl.boolean,1],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCHTMLImageContainerAfterDrawWidgetEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AWidgetPosition",this.$rtti["TTMSFNCHTMLImageContainerWidgetPosition"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCHTMLImageContainerBeforeDrawTextEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AText",rtl.string],["AAllow",rtl.boolean,1],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCHTMLImageContainerAfterDrawTextEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AText",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCHTMLImageContainerAnchorClickEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AAnchor",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCHTMLImageContainerCheckedStateChangedEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AChecked",rtl.boolean]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCHTMLImageContainer",pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$init.call(this);
      this.FBitmapContainer = null;
      this.FChecked = false;
      this.FText = "";
      this.FWordWrapping = false;
      this.FTrimming = 0;
      this.FVerticalTextAlign = 0;
      this.FHorizontalTextAlign = 0;
      this.FOnChange = null;
      this.FWidgetPosition = 0;
      this.FOnAfterDrawText = null;
      this.FOnAfterDrawWidget = null;
      this.FOnBeforeDrawText = null;
      this.FOnBeforeDrawWidget = null;
      this.FBitmapName = "";
      this.FWidgetImage = null;
      this.FOnAnchorClick = null;
      this.FOnCheckedStateChanged = null;
      this.FFont$1 = null;
      this.AnchorText = "";
    };
    this.$final = function () {
      this.FBitmapContainer = undefined;
      this.FOnChange = undefined;
      this.FOnAfterDrawText = undefined;
      this.FOnAfterDrawWidget = undefined;
      this.FOnBeforeDrawText = undefined;
      this.FOnBeforeDrawWidget = undefined;
      this.FWidgetImage = undefined;
      this.FOnAnchorClick = undefined;
      this.FOnCheckedStateChanged = undefined;
      this.FFont$1 = undefined;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$final.call(this);
    };
    this.SetBitmapContainer = function (Value) {
      this.FBitmapContainer = Value;
      this.Invalidate();
    };
    this.SetText = function (Value) {
      if (this.FText !== Value) {
        this.FText = Value;
        this.DoChange();
      };
    };
    this.SetTrimming = function (Value) {
      if (this.FTrimming !== Value) {
        this.FTrimming = Value;
        this.DoChange();
      };
    };
    this.SetWordWrapping = function (Value) {
      if (this.FWordWrapping !== Value) {
        this.FWordWrapping = Value;
        this.DoChange();
      };
    };
    this.SetHorizontalTextAlign = function (Value) {
      if (this.FHorizontalTextAlign !== Value) {
        this.FHorizontalTextAlign = Value;
        this.DoChange();
      };
    };
    this.SetVerticalTextAlign = function (Value) {
      if (this.FVerticalTextAlign !== Value) {
        this.FVerticalTextAlign = Value;
        this.DoChange();
      };
    };
    this.SetWidgetPosition = function (Value) {
      if (this.FWidgetPosition !== Value) {
        this.FWidgetPosition = Value;
        this.DoChange();
      };
    };
    this.SetBitmapName = function (Value) {
      if (this.FBitmapName !== Value) {
        this.FBitmapName = Value;
        this.DoChange();
      };
    };
    this.SetWidgetImage = function (Value) {
      this.FWidgetImage.Assign(Value);
    };
    this.SetFnt = function (Value) {
      this.FFont$1.AssignSource(Value);
    };
    this.GetBitmapContainer = function () {
      var Result = null;
      Result = this.FBitmapContainer;
      return Result;
    };
    this.IsTextStored = function () {
      var Result = false;
      Result = this.FText !== "";
      return Result;
    };
    this.Notification = function (AComponent, Operation) {
      pas["WEBLib.Menus"].TWebCustomControl.Notification.apply(this,arguments);
      if ((Operation === pas.Classes.TOperation.opRemove) && (AComponent === this.FBitmapContainer)) this.FBitmapContainer = null;
    };
    this.Draw = function (AGraphics, ARect) {
      var wr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var tr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var b = false;
      var df = false;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Draw.apply(this,arguments);
      b = true;
      df = true;
      AGraphics.FBitmapContainer = this.GetBitmapContainer();
      wr.$assign(this.GetWidgetAreaRect());
      tr.$assign(this.GetTextRect());
      this.DoBeforeDrawWidget(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),this.FWidgetPosition,{get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }},{get: function () {
          return df;
        }, set: function (v) {
          df = v;
        }});
      if (b) {
        if (df) this.DoDrawWidget(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(wr));
        this.DoAfterDrawWidget(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),this.FWidgetPosition);
      };
      this.DoDrawText(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(tr));
    };
    this.DoFontChanged = function (Sender) {
      this.Invalidate();
    };
    this.HandleMouseMove = function (Shift, X, Y) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseMove.apply(this,arguments);
      this.AnchorText = this.XYToAnchor(X,Y);
      if (this.AnchorText !== "") {
        this.SetControlCursor(21)}
       else this.SetControlCursor(0);
    };
    this.HandleMouseUp = function (Button, Shift, X, Y) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseUp.apply(this,arguments);
      this.SetFocus();
      this.AnchorText = this.XYToAnchor(X,Y);
      if (this.AnchorText !== "") this.DoAnchorClick(this.AnchorText);
    };
    this.DoDrawWidget = function (AGraphics, ARect) {
      if (this.FWidgetImage != null) AGraphics.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),this.FWidgetImage,true,false,true,false);
    };
    this.DoDrawText = function (AGraphics, ARect) {
      var b = false;
      var df = false;
      AGraphics.FFont.Assign(this.FFont$1);
      if (!this.FEnabled) AGraphics.FFont.SetColor(10789024);
      b = true;
      df = true;
      this.DoBeforeDrawText(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),this.FText,{get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }},{get: function () {
          return df;
        }, set: function (v) {
          df = v;
        }});
      if (b) {
        if (df) AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),this.FText,this.FWordWrapping,this.FHorizontalTextAlign,this.FVerticalTextAlign,this.FTrimming,0,-1,-1,true,false,-1,-1);
        this.DoAfterDrawText(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),this.FText);
      };
    };
    this.DoExit = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.DoExit.call(this);
      this.Invalidate();
    };
    this.DoEnter = function () {
      pas["WEBLib.Controls"].TControl.DoEnter.call(this);
      this.Invalidate();
    };
    this.ChangeDPIScale = function (M, D) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ChangeDPIScale.apply(this,arguments);
      this.FFont$1.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FFont$1.FHeight,M,D));
    };
    this.ApplyStyle = function () {
      var c = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ApplyStyle.call(this);
      this.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleTextFontColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) this.FFont$1.SetColor(c);
    };
    this.ResetToDefaultStyle = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ResetToDefaultStyle.call(this);
      this.FFill.SetColor(-1);
      this.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
      this.FFont$1.SetColor(0);
    };
    this.DoChange = function () {
      if (this.FOnChange != null) this.FOnChange(this);
      this.Invalidate();
    };
    this.DoBeforeDrawWidget = function (AGraphics, ARect, AWidgetPosition, AAllow, ADefaultDraw) {
      if (this.FOnBeforeDrawWidget != null) this.FOnBeforeDrawWidget(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AWidgetPosition,AAllow,ADefaultDraw);
    };
    this.DoAfterDrawWidget = function (AGraphics, ARect, AWidgetPosition) {
      if (this.FOnAfterDrawWidget != null) this.FOnAfterDrawWidget(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AWidgetPosition);
    };
    this.DoBeforeDrawText = function (AGraphics, ARect, AText, AAllow, ADefaultDraw) {
      if (this.FOnBeforeDrawText != null) this.FOnBeforeDrawText(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AText,AAllow,ADefaultDraw);
    };
    this.DoAfterDrawText = function (AGraphics, ARect, AText) {
      if (this.FOnAfterDrawText != null) this.FOnAfterDrawText(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AText);
    };
    this.DoAnchorClick = function (AAnchor) {
      if (this.FOnAnchorClick != null) {
        this.FOnAnchorClick(this,AAnchor)}
       else pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.OpenURL(AAnchor);
    };
    this.DoCheckedStateChanged = function (AChecked) {
      if (this.FOnCheckedStateChanged != null) this.FOnCheckedStateChanged(this,AChecked);
    };
    this.SetChecked = function (Value) {
      if (this.FChecked !== Value) {
        this.FChecked = Value;
        this.DoCheckedStateChanged(this.FChecked);
        this.DoChange();
      };
    };
    this.SetEnabled = function (Value) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.SetEnabled.apply(this,arguments);
      this.Invalidate();
    };
    this.XYToAnchor = function (AX, AY) {
      var Result = "";
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var g = null;
      Result = "";
      r.$assign(this.GetTextRect());
      g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[1,1,false,true]);
      g.BeginScene();
      g.FBitmapContainer = this.GetBitmapContainer();
      try {
        g.FFont.Assign(this.FFont$1);
        Result = g.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FText,this.FWordWrapping,this.FHorizontalTextAlign,this.FVerticalTextAlign,this.FTrimming,0,-1,-1,true,true,AX,AY);
      } finally {
        g.EndScene();
        g = rtl.freeLoc(g);
      };
      return Result;
    };
    this.GetWidgetImage = function (AName) {
      var Result = null;
      var I = 0;
      Result = null;
      if (!(this.GetBitmapContainer() != null)) return Result;
      for (var $l = 0, $end = this.GetBitmapContainer().ItemCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (this.GetBitmapContainer().GetBitmapName(I) === this.FBitmapName) {
          Result = this.GetBitmapContainer().GetBitmap(I);
          break;
        };
      };
      return Result;
    };
    this.GetTextRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (this.FWidgetImage != null) {
        if (this.FWidgetPosition === $mod.TTMSFNCHTMLImageContainerWidgetPosition.hwpLeft) {
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.FWidgetImage.GetWidth() + 0,0,this.GetWidth(),this.GetHeight()))}
         else Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,this.GetWidth() - this.FWidgetImage.GetWidth() - 0,this.GetHeight()));
      } else {
        if (this.FWidgetPosition === $mod.TTMSFNCHTMLImageContainerWidgetPosition.hwpLeft) {
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.ScalePaintValue(25) + this.ScalePaintValue(0),0,this.GetWidth(),this.GetHeight()))}
         else Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,this.GetWidth() - this.ScalePaintValue(25) - this.ScalePaintValue(0),this.GetHeight()));
      };
      return Result;
    };
    this.GetWidgetAreaRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FWidgetImage = this.GetWidgetImage(this.FBitmapName);
      if (this.FWidgetImage != null) {
        if (this.FWidgetPosition === $mod.TTMSFNCHTMLImageContainerWidgetPosition.hwpLeft) {
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,this.FWidgetImage.GetWidth(),this.GetHeight()))}
         else Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.GetWidth() - this.FWidgetImage.GetWidth(),0,this.GetWidth(),this.GetHeight()));
      } else {
        if (this.FWidgetPosition === $mod.TTMSFNCHTMLImageContainerWidgetPosition.hwpLeft) {
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,this.ScalePaintValue(25),this.GetHeight()))}
         else Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.GetWidth() - this.ScalePaintValue(25),0,this.GetWidth(),this.GetHeight()));
      };
      return Result;
    };
    this.GetWidgetRectangle = function (ARect) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var l = 0.0;
      var t = 0.0;
      l = (ARect.Right - ARect.Left - 16) / 2;
      t = (ARect.Bottom - ARect.Top - 16) / 2;
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARect.Left + l,ARect.Top + t,ARect.Left + l + 16,ARect.Top + t + 16));
      return Result;
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Create$1.apply(this,arguments);
      this.FChecked = false;
      this.FWordWrapping = false;
      this.FTrimming = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone;
      this.FHorizontalTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading;
      this.FVerticalTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      this.FBitmapName = "";
      this.FWidgetImage = null;
      this.FWidgetPosition = $mod.TTMSFNCHTMLImageContainerWidgetPosition.hwpLeft;
      this.SetHeight(22);
      this.SetWidth(150);
      this.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
      this.FStroke.SetColor(-1);
      this.FFill.SetColor(-1);
      this.FFont$1 = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FFont$1.FOnChanged = rtl.createCallback(this,"DoFontChanged");
      this.FTransparent = true;
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FFont$1");
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCHTMLImageContainer.isPrototypeOf(Source)) {
        this.FChecked = rtl.as(Source,$mod.TTMSFNCHTMLImageContainer).FChecked;
        this.FText = rtl.as(Source,$mod.TTMSFNCHTMLImageContainer).FText;
        this.FWordWrapping = rtl.as(Source,$mod.TTMSFNCHTMLImageContainer).FWordWrapping;
        this.FTrimming = rtl.as(Source,$mod.TTMSFNCHTMLImageContainer).FTrimming;
        this.FHorizontalTextAlign = rtl.as(Source,$mod.TTMSFNCHTMLImageContainer).FHorizontalTextAlign;
        this.FVerticalTextAlign = rtl.as(Source,$mod.TTMSFNCHTMLImageContainer).FVerticalTextAlign;
        this.FBitmapName = rtl.as(Source,$mod.TTMSFNCHTMLImageContainer).FBitmapName;
        this.SetHeight(rtl.as(Source,$mod.TTMSFNCHTMLImageContainer).GetHeight());
        this.SetWidth(rtl.as(Source,$mod.TTMSFNCHTMLImageContainer).GetWidth());
        this.FFont$1.AssignSource(rtl.as(Source,$mod.TTMSFNCHTMLImageContainer).FFont$1);
        this.FWidgetPosition = rtl.as(Source,$mod.TTMSFNCHTMLImageContainer).FWidgetPosition;
      } else pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Assign.apply(this,arguments);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  $mod.$implcode = function () {
    $impl.WIDGETWIDTH = 25;
    $impl.TXTMARGIN = 0;
  };
},[]);
rtl.module("WEBLib.TMSFNCCheckBox",["System","Classes","Types","WEBLib.Controls","WEBLib.TMSFNCHTMLImageContainer","WEBLib.TMSFNCTypes","WEBLib.TMSFNCGraphics","WEBLib.TMSFNCUtils"],function () {
  "use strict";
  var $mod = this;
  this.MAJ_VER = 1;
  this.MIN_VER = 0;
  this.REL_VER = 0;
  this.BLD_VER = 1;
  rtl.createClass(this,"TTMSFNCCustomCheckBox",pas["WEBLib.TMSFNCHTMLImageContainer"].TTMSFNCHTMLImageContainer,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCHTMLImageContainer"].TTMSFNCHTMLImageContainer.$init.call(this);
      this.FStartSize = 0;
      this.FMouseHover = false;
    };
    this.DoDrawWidget = function (AGraphics, ARect) {
      var b = false;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      pas["WEBLib.TMSFNCHTMLImageContainer"].TTMSFNCHTMLImageContainer.DoDrawWidget.apply(this,arguments);
      if (!(this.FWidgetImage != null)) {
        b = this.IsFocused() || this.FMouseHover;
        r.$assign(this.GetWidgetRectangle(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect)));
        AGraphics.DrawCheckBox(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FChecked,b,this.FEnabled,1.0);
      };
    };
    this.HandleMouseUp = function (Button, Shift, X, Y) {
      pas["WEBLib.TMSFNCHTMLImageContainer"].TTMSFNCHTMLImageContainer.HandleMouseUp.apply(this,arguments);
      if (this.FEnabled && (this.AnchorText === "")) {
        this.NotifyDataBinderEdit();
        this.SetChecked(!this.FChecked);
        this.NotifyDataBinderValueChanged();
      };
    };
    this.HandleMouseLeave = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseLeave.call(this);
      if (this.FEnabled) {
        this.FMouseHover = false;
        this.Invalidate();
      };
    };
    this.HandleMouseEnter = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseEnter.call(this);
      if (this.FEnabled) {
        this.FMouseHover = true;
        this.Invalidate();
      };
    };
    this.HandleKeyDown = function (Key, Shift) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleKeyDown.apply(this,arguments);
      if ((Key.get() === 32) || (Key.get() === 13)) {
        this.NotifyDataBinderEdit();
        this.SetChecked(!this.FChecked);
        this.NotifyDataBinderValueChanged();
      };
    };
    this.GetVersion = function () {
      var Result = "";
      Result = this.$class.GetVersionNumber(1,0,0,1);
      return Result;
    };
    this.Create$1 = function (AOwner) {
      var s = 0.0;
      pas["WEBLib.TMSFNCHTMLImageContainer"].TTMSFNCHTMLImageContainer.Create$1.apply(this,arguments);
      this.FMouseHover = false;
      this.SetText("TMSFNCCheckBox");
      s = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetDPIScale(this,96);
      if (s === 1) {
        this.FStartSize = 15}
       else this.FStartSize = 13;
      return this;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCCheckBox",this.TTMSFNCCustomCheckBox,function () {
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("BitmapContainer",3,pas["WEBLib.TMSFNCBitmapContainer"].$rtti["TTMSFNCBitmapContainer"],"GetBitmapContainer","SetBitmapContainer");
    $r.addProperty("BitmapName",2,rtl.string,"FBitmapName","SetBitmapName");
    $r.addProperty("Checked",2,rtl.boolean,"FChecked","SetChecked",4,{Default: false});
    $r.addProperty("WidgetPosition",2,pas["WEBLib.TMSFNCHTMLImageContainer"].$rtti["TTMSFNCHTMLImageContainerWidgetPosition"],"FWidgetPosition","SetWidgetPosition",4,{Default: pas["WEBLib.TMSFNCHTMLImageContainer"].TTMSFNCHTMLImageContainerWidgetPosition.hwpLeft});
    $r.addProperty("WordWrapping",2,rtl.boolean,"FWordWrapping","SetWordWrapping",4,{Default: false});
    $r.addProperty("Trimming",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextTrimming"],"FTrimming","SetTrimming",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone});
    $r.addProperty("Text",14,rtl.string,"FText","SetText",4,{stored: "IsTextStored"});
    $r.addProperty("Font",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FFont$1","SetFnt");
    $r.addProperty("HorizontalTextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FHorizontalTextAlign","SetHorizontalTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading});
    $r.addProperty("VerticalTextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FVerticalTextAlign","SetVerticalTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter});
    $r.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChange","FOnChange");
    $r.addProperty("OnCheckedStateChanged",0,pas["WEBLib.TMSFNCHTMLImageContainer"].$rtti["TTMSFNCHTMLImageContainerCheckedStateChangedEvent"],"FOnCheckedStateChanged","FOnCheckedStateChanged");
    $r.addProperty("OnAnchorClick",0,pas["WEBLib.TMSFNCHTMLImageContainer"].$rtti["TTMSFNCHTMLImageContainerAnchorClickEvent"],"FOnAnchorClick","FOnAnchorClick");
    $r.addProperty("OnBeforeDrawWidget",0,pas["WEBLib.TMSFNCHTMLImageContainer"].$rtti["TTMSFNCHTMLImageContainerBeforeDrawWidgetEvent"],"FOnBeforeDrawWidget","FOnBeforeDrawWidget");
    $r.addProperty("OnAfterDrawWidget",0,pas["WEBLib.TMSFNCHTMLImageContainer"].$rtti["TTMSFNCHTMLImageContainerAfterDrawWidgetEvent"],"FOnAfterDrawWidget","FOnAfterDrawWidget");
    $r.addProperty("OnBeforeDrawText",0,pas["WEBLib.TMSFNCHTMLImageContainer"].$rtti["TTMSFNCHTMLImageContainerBeforeDrawTextEvent"],"FOnBeforeDrawText","FOnBeforeDrawText");
    $r.addProperty("OnAfterDrawText",0,pas["WEBLib.TMSFNCHTMLImageContainer"].$rtti["TTMSFNCHTMLImageContainerAfterDrawTextEvent"],"FOnAfterDrawText","FOnAfterDrawText");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
});
rtl.module("WEBLib.TMSFNCColorPicker",["System","Classes","WEBLib.TMSFNCCustomPicker","WEBLib.Controls","WEBLib.TMSFNCColorSelector","WEBLib.TMSFNCCustomSelector","WEBLib.TMSFNCGraphics","WEBLib.TMSFNCTypes","WEBLib.TMSFNCGraphicsTypes","Types"],function () {
  "use strict";
  var $mod = this;
  this.MAJ_VER = 1;
  this.MIN_VER = 0;
  this.REL_VER = 0;
  this.BLD_VER = 1;
  this.$rtti.$Class("TTMSFNCCustomColorPicker");
  rtl.createClass(this,"TTMSFNCColorSelectorEx",pas["WEBLib.TMSFNCColorSelector"].TTMSFNCColorSelector,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCColorSelector"].TTMSFNCColorSelector.$init.call(this);
      this.FPicker = null;
    };
    this.$final = function () {
      this.FPicker = undefined;
      pas["WEBLib.TMSFNCColorSelector"].TTMSFNCColorSelector.$final.call(this);
    };
    this.WrapperSizeChanged = function (AWidth, AHeight) {
      var sz = pas["WEBLib.TMSFNCTypes"].TSizeF.$new();
      pas["WEBLib.TMSFNCColorSelector"].TTMSFNCCustomColorSelector.WrapperSizeChanged.apply(this,arguments);
      if (this.FPicker != null) {
        this.FPicker.SetDropDownHeight(AHeight);
        this.FPicker.SetDropDownWidth(AWidth);
        sz.cx = AWidth;
        sz.cy = AHeight;
        this.FPicker.GetPopup().SetPopupFormSize(sz);
        this.SetWidth(this.GetWidth() + 1);
        this.SetWidth(this.GetWidth() - 1);
      };
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCColorSelector"].TTMSFNCCustomColorSelector.Create$1.apply(this,arguments);
      if ((AOwner != null) && $mod.TTMSFNCCustomColorPicker.isPrototypeOf(AOwner)) this.FPicker = rtl.as(AOwner,$mod.TTMSFNCCustomColorPicker);
      return this;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCCustomColorPicker",pas["WEBLib.TMSFNCCustomPicker"].TTMSFNCDefaultPicker,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomPicker"].TTMSFNCDefaultPicker.$init.call(this);
      this.FColorSelector = null;
      this.FOnColorSelected = null;
      this.FCloseOnSelection = false;
      this.FOnColorDeselected = null;
    };
    this.$final = function () {
      this.FColorSelector = undefined;
      this.FOnColorSelected = undefined;
      this.FOnColorDeselected = undefined;
      pas["WEBLib.TMSFNCCustomPicker"].TTMSFNCDefaultPicker.$final.call(this);
    };
    this.GetSelectedColor = function () {
      var Result = 0;
      Result = this.FColorSelector.GetSelectedColor();
      return Result;
    };
    this.SetSelectedColor = function (Value) {
      this.FColorSelector.SetSelectedColor(Value);
      this.Invalidate();
    };
    this.GetItems$1 = function () {
      var Result = null;
      Result = this.FColorSelector.GetItems();
      return Result;
    };
    this.SetItems$1 = function (Value) {
      this.FColorSelector.GetItems().Assign(Value);
    };
    this.GetMode = function () {
      var Result = 0;
      Result = this.FColorSelector.FMode;
      return Result;
    };
    this.SetMode = function (Value) {
      var s = 0.0;
      this.FColorSelector.SetMode(Value);
      s = 1;
      var $tmp = this.GetMode();
      if ($tmp === pas["WEBLib.TMSFNCColorSelector"].TTMSFNCCustomColorSelectorMode.csmSimple) {
        this.SetDropDownWidth(s * 135);
        this.SetDropDownHeight(s * 135);
      } else if ($tmp === pas["WEBLib.TMSFNCColorSelector"].TTMSFNCCustomColorSelectorMode.csmExtended) {
        this.SetDropDownWidth(s * 200);
        this.SetDropDownHeight(s * 135);
      } else if ($tmp === pas["WEBLib.TMSFNCColorSelector"].TTMSFNCCustomColorSelectorMode.csmExtendedMore) {
        this.SetDropDownWidth(s * 200);
        this.SetDropDownHeight(s * 175);
      };
    };
    this.ChangeDPIScale = function (M, D) {
      pas["WEBLib.TMSFNCCustomPicker"].TTMSFNCCustomPicker.ChangeDPIScale.apply(this,arguments);
    };
    this.DoColorSelected = function () {
      if (this.FOnColorSelected != null) this.FOnColorSelected(this,this.GetSelectedColor());
      this.Invalidate();
    };
    this.ColorSelected = function (Sender, AColor) {
      if (this.FCloseOnSelection && !this.GetSelector().FBlockChange) this.DropDown();
      if (this.FOnColorSelected != null) this.FOnColorSelected(this,AColor);
      this.Invalidate();
    };
    this.ColorDeselected = function (Sender, AColor) {
      if (this.FOnColorDeselected != null) this.FOnColorDeselected(this,AColor);
      this.Invalidate();
    };
    this.DrawContent = function (AGraphics, ARect) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var I = 0;
      var J = 0;
      var st = null;
      r.$assign(ARect);
      pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,this.ScalePaintValue$1(-3.0),this.ScalePaintValue$1(-4.0));
      pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(r,this.ScalePaintValue$1(1.0),0.5);
      st = AGraphics.SaveState(false);
      try {
        AGraphics.ClipRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r));
        AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
        AGraphics.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        AGraphics.FStroke.SetWidth(1);
        AGraphics.FFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(255,255,255));
        AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        AGraphics.FFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(211,211,211));
        for (var $l = 0, $end = pas.System.Trunc((r.Right - r.Left) / 5) + 1; $l <= $end; $l++) {
          I = $l;
          for (var $l1 = 0, $end1 = pas.System.Trunc((r.Bottom - r.Top) / 5) + 1; $l1 <= $end1; $l1++) {
            J = $l1;
            if (pas.System.Odd(I + J)) AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(I * 5,J * 5,(I + 1) * 5,(J + 1) * 5)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmNone);
          };
        };
        AGraphics.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        AGraphics.FFill.SetColor(this.GetSelectedColor());
        AGraphics.FStroke.SetColor(0);
        AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
        AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
      } finally {
        AGraphics.RestoreState(st,false);
      };
    };
    this.SelectFirstValue = function () {
      pas["WEBLib.TMSFNCCustomPicker"].TTMSFNCCustomPicker.SelectFirstValue.call(this);
      if (this.FColorSelector.GetItems().GetCount() > 0) {
        this.NotifyDataBinderEdit();
        this.FColorSelector.SetSelectedItemIndex(0);
        this.NotifyDataBinderValueChanged();
        this.DoColorSelected();
      };
    };
    this.SelectLastValue = function () {
      pas["WEBLib.TMSFNCCustomPicker"].TTMSFNCCustomPicker.SelectLastValue.call(this);
      if (this.FColorSelector.GetItems().GetCount() > 0) {
        this.NotifyDataBinderEdit();
        this.FColorSelector.SetSelectedItemIndex(this.FColorSelector.GetItems().GetCount() - 1);
        this.NotifyDataBinderValueChanged();
        this.DoColorSelected();
      };
    };
    this.SelectNextValue = function () {
      pas["WEBLib.TMSFNCCustomPicker"].TTMSFNCCustomPicker.SelectNextValue.call(this);
      if (this.FColorSelector.GetItems().GetCount() > 0) {
        this.NotifyDataBinderEdit();
        if (this.FColorSelector.FSelectedItemIndex === -1) {
          this.FColorSelector.SetSelectedItemIndex(0)}
         else this.FColorSelector.SetSelectedItemIndex(Math.min(this.FColorSelector.GetItems().GetCount() - 1,this.FColorSelector.FSelectedItemIndex + 1));
        this.NotifyDataBinderValueChanged();
        this.DoColorSelected();
      };
    };
    this.SelectPreviousValue = function () {
      pas["WEBLib.TMSFNCCustomPicker"].TTMSFNCCustomPicker.SelectPreviousValue.call(this);
      if (this.FColorSelector.GetItems().GetCount() > 0) {
        this.NotifyDataBinderEdit();
        if (this.FColorSelector.FSelectedItemIndex === -1) {
          this.FColorSelector.SetSelectedItemIndex(0)}
         else this.FColorSelector.SetSelectedItemIndex(Math.max(0,this.FColorSelector.FSelectedItemIndex - 1));
        this.NotifyDataBinderValueChanged();
        this.DoColorSelected();
      };
    };
    this.GetVersion = function () {
      var Result = "";
      Result = this.$class.GetVersionNumber(1,0,0,1);
      return Result;
    };
    this.CreateSelector = function () {
      var Result = null;
      this.FColorSelector = $mod.TTMSFNCColorSelectorEx.$create("Create$1",[this]);
      this.FColorSelector.FOnColorSelected = rtl.createCallback(this,"ColorSelected");
      this.FColorSelector.FOnColorDeselected = rtl.createCallback(this,"ColorDeselected");
      this.FColorSelector.InitializeDefault();
      Result = this.FColorSelector;
      return Result;
    };
    this.GetFocusedControl = function () {
      var Result = null;
      Result = this.FColorSelector;
      return Result;
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomPicker"].TTMSFNCCustomPicker.Create$1.apply(this,arguments);
      this.FCloseOnSelection = true;
      return this;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCColorPicker",this.TTMSFNCCustomColorPicker,function () {
    this.RegisterRuntimeClasses = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClass($mod.TTMSFNCColorPicker);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("DropDownWidth",14,rtl.double,"FDropDownWidth","SetDropDownWidth",4,{stored: "IsDropDownWidthStored"});
    $r.addProperty("DropDownHeight",14,rtl.double,"FDropDownHeight","SetDropDownHeight",4,{stored: "IsDropDownHeightStored"});
    $r.addProperty("Appearance",3,pas["WEBLib.TMSFNCCustomSelector"].$rtti["TTMSFNCCustomSelectorAppearance"],"GetAppearance","SetAppearance");
    $r.addProperty("Rows",3,rtl.longint,"GetRows","SetRows",4,{Default: 4});
    $r.addProperty("Columns",3,rtl.longint,"GetColumns","SetColumns",4,{Default: 4});
    $r.addProperty("Items",3,pas["WEBLib.TMSFNCColorSelector"].$rtti["TTMSFNCColorSelectorItems"],"GetItems$1","SetItems$1");
    $r.addProperty("Mode",3,pas["WEBLib.TMSFNCColorSelector"].$rtti["TTMSFNCCustomColorSelectorMode"],"GetMode","SetMode",4,{Default: pas["WEBLib.TMSFNCColorSelector"].TTMSFNCCustomColorSelectorMode.csmSimple});
    $r.addProperty("CloseOnSelection",0,rtl.boolean,"FCloseOnSelection","FCloseOnSelection",4,{Default: true});
    $r.addProperty("OnColorSelected",0,pas["WEBLib.TMSFNCColorSelector"].$rtti["TTMSFNCCustomSelectorColorSelected"],"FOnColorSelected","FOnColorSelected");
    $r.addProperty("OnColorDeselected",0,pas["WEBLib.TMSFNCColorSelector"].$rtti["TTMSFNCCustomSelectorColorDeselected"],"FOnColorDeselected","FOnColorDeselected");
    $r.addProperty("SelectedColor",3,pas["WEBLib.Graphics"].$rtti["TColor"],"GetSelectedColor","SetSelectedColor",4,{Default: -1});
    $r.addProperty("OnItemSelected",0,pas["WEBLib.TMSFNCCustomSelector"].$rtti["TTMSFNCCustomSelectorItemSelected"],"FOnItemSelected","FOnItemSelected");
    $r.addProperty("OnItemDeselected",0,pas["WEBLib.TMSFNCCustomSelector"].$rtti["TTMSFNCCustomSelectorItemDeselected"],"FOnItemDeselected","FOnItemDeselected");
    $r.addProperty("OnItemClick",0,pas["WEBLib.TMSFNCCustomSelector"].$rtti["TTMSFNCCustomSelectorItemClick"],"FOnItemClick","FOnItemClick");
    $r.addProperty("SelectedItemIndex",3,rtl.longint,"GetSelectedItemIndex","SetSelectedItemIndex",4,{Default: -1});
    $r.addProperty("OnPickerBeforeDraw",0,pas["WEBLib.TMSFNCCustomPicker"].$rtti["TTMSFNCCustomPickerBeforeDraw"],"FOnPickerBeforeDraw","FOnPickerBeforeDraw");
    $r.addProperty("OnPickerAfterDraw",0,pas["WEBLib.TMSFNCCustomPicker"].$rtti["TTMSFNCCustomPickerAfterDraw"],"FOnPickerAfterDraw","FOnPickerAfterDraw");
    $r.addProperty("OnItemBeforeDrawBackground",0,pas["WEBLib.TMSFNCCustomSelector"].$rtti["TTMSFNCCustomSelectorItemBeforeDrawBackground"],"FOnItemBeforeDrawBackground","FOnItemBeforeDrawBackground");
    $r.addProperty("OnItemAfterDrawBackground",0,pas["WEBLib.TMSFNCCustomSelector"].$rtti["TTMSFNCCustomSelectorItemAfterDrawBackground"],"FOnItemAfterDrawBackground","FOnItemAfterDrawBackground");
    $r.addProperty("OnItemBeforeDrawContent",0,pas["WEBLib.TMSFNCCustomSelector"].$rtti["TTMSFNCCustomSelectorItemBeforeDrawContent"],"FOnItemBeforeDrawContent","FOnItemBeforeDrawContent");
    $r.addProperty("OnItemAfterDrawContent",0,pas["WEBLib.TMSFNCCustomSelector"].$rtti["TTMSFNCCustomSelectorItemAfterDrawContent"],"FOnItemAfterDrawContent","FOnItemAfterDrawContent");
    $r.addProperty("OnBeforeDraw",0,pas["WEBLib.TMSFNCCustomSelector"].$rtti["TTMSFNCCustomSelectorBeforeDraw"],"FOnBeforeDraw$1","FOnBeforeDraw$1");
    $r.addProperty("OnAfterDraw",0,pas["WEBLib.TMSFNCCustomSelector"].$rtti["TTMSFNCCustomSelectorAfterDraw"],"FOnAfterDraw$1","FOnAfterDraw$1");
    $r.addProperty("OnItemBeforeDrawText",0,pas["WEBLib.TMSFNCCustomSelector"].$rtti["TTMSFNCCustomSelectorItemBeforeDrawText"],"FOnItemBeforeDrawText","FOnItemBeforeDrawText");
    $r.addProperty("OnItemAfterDrawText",0,pas["WEBLib.TMSFNCCustomSelector"].$rtti["TTMSFNCCustomSelectorItemAfterDrawText"],"FOnItemAfterDrawText","FOnItemAfterDrawText");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
},["Math","WEBLib.TMSFNCUtils"]);
rtl.module("WEBLib.TMSFNCGridCell",["System","Classes","WEBLib.TMSFNCGraphics","WEBLib.TMSFNCBitmapContainer","WEBLib.TMSFNCTypes","WEBLib.Controls","WEBLib.TMSFNCGraphicsTypes"],function () {
  "use strict";
  var $mod = this;
  this.$rtti.$Class("TTMSFNCFixedGridCell");
  this.TTMSFNCGridNodeState = {"0": "nsClosed", nsClosed: 0, "1": "nsOpen", nsOpen: 1};
  this.$rtti.$Enum("TTMSFNCGridNodeState",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCGridNodeState});
  this.TTMSFNCGridSortKind = {"0": "skNone", skNone: 0, "1": "skAscending", skAscending: 1, "2": "skDescending", skDescending: 2};
  this.$rtti.$Enum("TTMSFNCGridSortKind",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCGridSortKind});
  this.$rtti.$Class("TTMSFNCGridCell");
  rtl.createClass(this,"TTMSFNCGridCellLayout",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FSides = {};
      this.FFill = null;
      this.FStroke = null;
      this.FVerticalTextAlign = 0;
      this.FFont = null;
      this.FTextAlign = 0;
      this.FWordWrapping = false;
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FSides = undefined;
      this.FFill = undefined;
      this.FStroke = undefined;
      this.FFont = undefined;
      this.FOnChange = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetFill = function (Value) {
      if (this.FFill !== Value) {
        this.FFill.Assign(Value);
        this.Changed();
      };
    };
    this.SetSides = function (Value) {
      if (rtl.neSet(this.FSides,Value)) {
        this.FSides = rtl.refSet(Value);
        this.Changed();
      };
    };
    this.SetStroke = function (Value) {
      if (this.FStroke !== Value) {
        this.FStroke.Assign(Value);
        this.Changed();
      };
    };
    this.SetFont = function (Value) {
      if (this.FFont !== Value) {
        this.FFont.Assign(Value);
        this.Changed();
      };
    };
    this.SetTextAlign = function (Value) {
      if (this.FTextAlign !== Value) {
        this.FTextAlign = Value;
        this.Changed();
      };
    };
    this.SetVerticalTextAlign = function (Value) {
      if (this.FVerticalTextAlign !== Value) {
        this.FVerticalTextAlign = Value;
        this.Changed();
      };
    };
    this.SetWordWrapping = function (Value) {
      if (this.FWordWrapping !== Value) {
        this.FWordWrapping = Value;
        this.Changed();
      };
    };
    this.Changed = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.FillChanged = function (Sender) {
      this.Changed();
    };
    this.FontChanged = function (Sender) {
      this.Changed();
    };
    this.StrokeChanged = function (Sender) {
      this.Changed();
    };
    this.Create$1 = function () {
      this.FFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16777215,8421504,-1,-1]);
      this.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FFill.SetColor(16777215);
      this.FFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,12632256,1.0]);
      this.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FStroke.SetColor(12632256);
      this.FStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FSides = rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsTop,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsRight,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsBottom);
      this.FFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FFont.FOnChanged = rtl.createCallback(this,"FontChanged");
      this.FTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading;
      this.FVerticalTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      this.FWordWrapping = false;
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FFont");
      rtl.free(this,"FFill");
      rtl.free(this,"FStroke");
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCGridCellLayout.isPrototypeOf(Source)) {
        this.FFill.Assign(rtl.as(Source,$mod.TTMSFNCGridCellLayout).FFill);
        this.FStroke.Assign(rtl.as(Source,$mod.TTMSFNCGridCellLayout).FStroke);
        this.FSides = rtl.refSet(rtl.as(Source,$mod.TTMSFNCGridCellLayout).FSides);
        this.FFont.Assign(rtl.as(Source,$mod.TTMSFNCGridCellLayout).FFont);
        this.FTextAlign = rtl.as(Source,$mod.TTMSFNCGridCellLayout).FTextAlign;
        this.FVerticalTextAlign = rtl.as(Source,$mod.TTMSFNCGridCellLayout).FVerticalTextAlign;
        this.FWordWrapping = rtl.as(Source,$mod.TTMSFNCGridCellLayout).FWordWrapping;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Sides",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsSides"],"FSides","SetSides",4,{Default: rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsTop,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsRight,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsBottom)});
    $r.addProperty("Fill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFill","SetFill");
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
    $r.addProperty("Font",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FFont","SetFont");
    $r.addProperty("TextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FTextAlign","SetTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading});
    $r.addProperty("VerticalTextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FVerticalTextAlign","SetVerticalTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter});
    $r.addProperty("WordWrapping",2,rtl.boolean,"FWordWrapping","SetWordWrapping",4,{Default: false});
    $r.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChange","FOnChange");
  });
  rtl.createClass(this,"TTMSFNCGridCellProgressLayout",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FTextColor = 0;
      this.FColor = 0;
      this.FFormat = "";
      this.FOnChange = null;
      this.FShowText = false;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetColor = function (Value) {
      if (this.FColor !== Value) {
        this.FColor = Value;
        this.Changed();
      };
    };
    this.SetTextColor = function (Value) {
      if (this.FTextColor !== Value) {
        this.FTextColor = Value;
        this.Changed();
      };
    };
    this.SetFormat = function (Value) {
      if (this.FFormat !== Value) {
        this.FFormat = Value;
        this.Changed();
      };
    };
    this.SetShowText = function (Value) {
      if (this.FShowText !== Value) {
        this.FShowText = Value;
        this.Changed();
      };
    };
    this.Changed = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Create$1 = function () {
      this.FTextColor = 0;
      this.FColor = 3329434;
      this.FFormat = "%.0f%%";
      this.FShowText = true;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCGridCellProgressLayout.isPrototypeOf(Source)) {
        this.FColor = rtl.as(Source,$mod.TTMSFNCGridCellProgressLayout).FColor;
        this.FTextColor = rtl.as(Source,$mod.TTMSFNCGridCellProgressLayout).FTextColor;
        this.FFormat = rtl.as(Source,$mod.TTMSFNCGridCellProgressLayout).FFormat;
        this.FShowText = rtl.as(Source,$mod.TTMSFNCGridCellProgressLayout).FShowText;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor",4,{Default: 3329434});
    $r.addProperty("TextColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FTextColor","SetTextColor",4,{Default: 0});
    $r.addProperty("Format",2,rtl.string,"FFormat","SetFormat");
    $r.addProperty("ShowText",2,rtl.boolean,"FShowText","SetShowText",4,{Default: true});
    $r.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChange","FOnChange");
  });
  this.$rtti.$MethodVar("TTMSFNCCellBeforeDraw",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"],1],["ATextRect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"],1],["ADrawText",rtl.boolean,1],["ADrawBackGround",rtl.boolean,1],["ADrawBorder",rtl.boolean,1],["AllowDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCellAfterDraw",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["ATextRect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]]]), methodkind: 0});
  this.TTMSFNCGridCellControlPosition = {"0": "gcpLeft", gcpLeft: 0, "1": "gcpTop", gcpTop: 1, "2": "gcpRight", gcpRight: 2, "3": "gcpBottom", gcpBottom: 3, "4": "gcpCenter", gcpCenter: 4};
  this.$rtti.$Enum("TTMSFNCGridCellControlPosition",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TTMSFNCGridCellControlPosition});
  rtl.createClass(this,"TTMSFNCGridCell",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FOwner = null;
      this.FText = "";
      this.FLayout = null;
      this.FBitmapContainer = null;
      this.FDisplayHTMLFormatting = false;
      this.FWidth = 0.0;
      this.FHeight = 0.0;
      this.FTop = 0.0;
      this.FLeft = 0.0;
      this.FControlBitmap = null;
      this.FControlEnabled = false;
      this.FOnBeforeDraw = null;
      this.FOnAfterDraw = null;
      this.FOnControlClick = null;
      this.FControlStretched = false;
      this.FControlPosition = 0;
      this.FOptimizedHTMLDrawing = false;
      this.FScaleFactor = 0.0;
      this.FAngle = 0;
    };
    this.$final = function () {
      this.FOwner = undefined;
      this.FLayout = undefined;
      this.FBitmapContainer = undefined;
      this.FControlBitmap = undefined;
      this.FOnBeforeDraw = undefined;
      this.FOnAfterDraw = undefined;
      this.FOnControlClick = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetText = function (Value) {
      if (this.FText !== Value) {
        this.FText = Value;
      };
    };
    this.SetLayout = function (Value) {
      this.FLayout.Assign(Value);
    };
    this.SetDisplayHTMLFormatting = function (Value) {
      if (this.FDisplayHTMLFormatting !== Value) {
        this.FDisplayHTMLFormatting = Value;
      };
    };
    this.SetHeight = function (Value) {
      if (this.FHeight !== Value) {
        this.FHeight = Value;
      };
    };
    this.SetWidth = function (Value) {
      if (this.FWidth !== Value) {
        this.FWidth = Value;
      };
    };
    this.SetLeft = function (Value) {
      if (this.FLeft !== Value) {
        this.FLeft = Value;
      };
    };
    this.SetTop = function (Value) {
      if (this.FTop !== Value) {
        this.FTop = Value;
      };
    };
    this.SetControlBitmap = function (Value) {
      if (this.FControlBitmap !== Value) {
        this.FControlBitmap = Value;
      };
    };
    this.GetControlBitmap = function () {
      var Result = null;
      Result = this.FControlBitmap;
      return Result;
    };
    this.SetControlEnabled = function (Value) {
      if (this.FControlEnabled !== Value) {
        this.FControlEnabled = Value;
      };
    };
    this.SetAngle = function (Value) {
      if (this.FAngle !== Value) {
        this.FAngle = Value;
      };
    };
    this.Changed = function (Sender) {
    };
    this.DoControlClick = function (Sender) {
      if (this.FOnControlClick != null) this.FOnControlClick(this);
    };
    this.HandleControlMouseDown = function (Button, Shift, X, Y) {
    };
    this.HandleControlMouseUp = function (Button, Shift, X, Y) {
      this.DoControlClick(this);
    };
    this.HandleControlMouseMove = function (Shift, X, Y, ACursor) {
    };
    this.DoBeforeDraw = function (AGraphics, ARect, ATextRect, ADrawText, ADrawBackGround, ADrawBorder, AllowDraw) {
      if (this.FOnBeforeDraw != null) this.FOnBeforeDraw(this,AGraphics,ARect,ATextRect,ADrawText,ADrawBackGround,ADrawBorder,AllowDraw);
    };
    this.DoAfterDraw = function (AGraphics, ARect, ATextRect) {
      if (this.FOnAfterDraw != null) this.FOnAfterDraw(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ATextRect));
    };
    this.IsHTML = function () {
      var Result = false;
      if (this.FDisplayHTMLFormatting) {
        Result = false}
       else Result = (pas.System.Pos("</",this.FText) > 0) || (pas.System.Pos("/>",this.FText) > 0) || (pas.System.Pos("<BR>",pas.SysUtils.UpperCase(this.FText)) > 0);
      return Result;
    };
    this.GetTextWidth = function () {
      var Result = 0.0;
      var str = "";
      var g = null;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var txtr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      str = this.FText;
      Result = 0;
      if (str !== "") {
        g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[1,1,false,true]);
        g.BeginScene();
        g.FOptimizedHTMLDrawing = this.FOptimizedHTMLDrawing;
        g.FBitmapContainer = this.FBitmapContainer;
        try {
          g.SetFont(this.FLayout.FFont);
          r.$assign(this.GetTextRect(false));
          txtr.$assign(g.CalculateText(str,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FLayout.FWordWrapping,true));
          if (Math.abs(this.FAngle) === 90) {
            Result = txtr.Bottom - txtr.Top}
           else Result = txtr.Right - txtr.Left;
        } finally {
          g.EndScene();
          g = rtl.freeLoc(g);
        };
      };
      return Result;
    };
    this.GetTextHeight = function () {
      var Result = 0.0;
      var str = "";
      var g = null;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var txtr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      str = this.FText;
      Result = 0;
      if (str !== "") {
        g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[1,1,false,true]);
        g.BeginScene();
        g.FOptimizedHTMLDrawing = this.FOptimizedHTMLDrawing;
        g.FBitmapContainer = this.FBitmapContainer;
        try {
          g.SetFont(this.FLayout.FFont);
          r.$assign(this.GetTextRect(false));
          txtr.$assign(g.CalculateText(str,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FLayout.FWordWrapping,true));
          if (Math.abs(this.FAngle) === 0) {
            Result = txtr.Bottom - txtr.Top}
           else Result = txtr.Right - txtr.Left;
        } finally {
          g.EndScene();
          g = rtl.freeLoc(g);
        };
      };
      return Result;
    };
    this.XYToAnchor = function (X, Y) {
      var Result = "";
      var g = null;
      var ha = 0;
      var va = 0;
      Result = "";
      if (this.IsHTML()) {
        g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[1,1,false,true]);
        g.BeginScene();
        g.FOptimizedHTMLDrawing = this.FOptimizedHTMLDrawing;
        g.FBitmapContainer = this.FBitmapContainer;
        try {
          g.FFont.Assign(this.FLayout.FFont);
          ha = this.FLayout.FTextAlign;
          va = this.FLayout.FVerticalTextAlign;
          Result = g.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.GetTextRect(true)),this.FText,false,ha,va,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,true,true,X,Y);
        } finally {
          g.EndScene();
          g = rtl.freeLoc(g);
        };
      };
      return Result;
    };
    this.GetStrippedHTMLText = function () {
      var Result = "";
      var str = "";
      str = this.FText;
      if (this.IsHTML()) {
        Result = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.HTMLStrip(str)}
       else Result = str;
      return Result;
    };
    this.GetControlWidth = function () {
      var Result = 0.0;
      var c = null;
      Result = 0;
      c = this.GetControlBitmap();
      if (c != null) Result = c.GetWidth();
      return Result;
    };
    this.GetControlHeight = function () {
      var Result = 0.0;
      var c = null;
      Result = 0;
      c = this.GetControlBitmap();
      if (c != null) Result = c.GetHeight();
      return Result;
    };
    this.GetRealTextRect = function (AAbsolute) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var g = null;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var tr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var s = "";
      Result.$assign(pas["WEBLib.TMSFNCTypes"].EmptyRect());
      r.$assign(this.GetTextRect(AAbsolute));
      g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[1,1,false,true]);
      try {
        g.GetContext().BeginScene();
        g.SetFont(this.FLayout.FFont);
        s = this.FText;
        if (s === "") s = "gh";
        tr.$assign(g.CalculateText(s,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FLayout.FWordWrapping,!this.FDisplayHTMLFormatting));
        tr.Left = r.Left;
        tr.Right = r.Right;
        var $tmp = this.FLayout.FTextAlign;
        if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter) {
          var $tmp1 = this.FLayout.FVerticalTextAlign;
          if ($tmp1 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter) {
            tr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + ((r.Right - r.Left - (tr.Right - tr.Left)) / 2),r.Top + ((r.Bottom - r.Top - (tr.Bottom - tr.Top)) / 2),r.Left + ((r.Right - r.Left - (tr.Right - tr.Left)) / 2) + (tr.Right - tr.Left),r.Top + ((r.Bottom - r.Top - (tr.Bottom - tr.Top)) / 2) + (tr.Bottom - tr.Top)))}
           else if ($tmp1 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading) {
            tr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + ((r.Right - r.Left - (tr.Right - tr.Left)) / 2),r.Top,r.Left + ((r.Right - r.Left - (tr.Right - tr.Left)) / 2) + (tr.Right - tr.Left),r.Top + (tr.Bottom - tr.Top)))}
           else if ($tmp1 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaTrailing) tr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + ((r.Right - r.Left - (tr.Right - tr.Left)) / 2),r.Bottom - (tr.Bottom - tr.Top),r.Left + ((r.Right - r.Left - (tr.Right - tr.Left)) / 2) + (tr.Right - tr.Left),r.Bottom));
        } else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading) {
          var $tmp2 = this.FLayout.FVerticalTextAlign;
          if ($tmp2 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter) {
            tr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top + ((r.Bottom - r.Top - (tr.Bottom - tr.Top)) / 2),r.Left + (tr.Right - tr.Left),r.Top + ((r.Bottom - r.Top - (tr.Bottom - tr.Top)) / 2) + (tr.Bottom - tr.Top)))}
           else if ($tmp2 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading) {
            tr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top,r.Left + (tr.Right - tr.Left),r.Top + (tr.Bottom - tr.Top)))}
           else if ($tmp2 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaTrailing) tr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Bottom - (tr.Bottom - tr.Top),r.Left + (tr.Right - tr.Left),r.Bottom));
        } else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaTrailing) {
          var $tmp3 = this.FLayout.FVerticalTextAlign;
          if ($tmp3 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter) {
            tr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Right - (tr.Right - tr.Left),r.Top + ((r.Bottom - r.Top - (tr.Bottom - tr.Top)) / 2),r.Right,r.Top + ((r.Bottom - r.Top - (tr.Bottom - tr.Top)) / 2) + (tr.Bottom - tr.Top)))}
           else if ($tmp3 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading) {
            tr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Right - (tr.Right - tr.Left),r.Top,r.Right,r.Top + (tr.Bottom - tr.Top)))}
           else if ($tmp3 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaTrailing) tr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Right - (tr.Right - tr.Left),r.Bottom - (tr.Bottom - tr.Top),r.Right,r.Bottom));
        };
        Result.$assign(tr);
        Result.Top = Math.max(r.Top,Result.Top);
        Result.Left = Math.max(r.Left,Result.Left);
        Result.Right = r.Right;
        Result.Bottom = r.Bottom;
        g.GetContext().EndScene();
      } finally {
        g = rtl.freeLoc(g);
      };
      return Result;
    };
    this.GetTextRect = function (AAbsolute) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rct = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var c = null;
      var res = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (AAbsolute) {
        r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.FLeft,this.FTop,this.FLeft + this.FWidth,this.FTop + this.FHeight))}
       else r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,this.FWidth,this.FHeight));
      rct.$assign(this.GetControlRect(false));
      c = this.GetControlBitmap();
      if (!this.FControlStretched && (c != null) && !pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(c)) {
        var $tmp = this.FControlPosition;
        if ($tmp === $mod.TTMSFNCGridCellControlPosition.gcpLeft) {
          res.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + (rct.Right - rct.Left) + 2,r.Top,r.Right,r.Bottom))}
         else if ($tmp === $mod.TTMSFNCGridCellControlPosition.gcpTop) {
          res.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top + (rct.Bottom - rct.Top) + 2,r.Right,r.Bottom))}
         else if ($tmp === $mod.TTMSFNCGridCellControlPosition.gcpRight) {
          res.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top,r.Right - (rct.Right - rct.Left) - 2,r.Bottom))}
         else if ($tmp === $mod.TTMSFNCGridCellControlPosition.gcpBottom) {
          res.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top,r.Right,r.Bottom - (rct.Bottom - rct.Top) - 2))}
         else {
          res.$assign(r);
        };
      } else res.$assign(r);
      pas["WEBLib.TMSFNCTypes"].InflateRectEx(res,-3,-3);
      Result.$assign(res);
      return Result;
    };
    this.GetControlRect = function (AAbsolute) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var c = null;
      var cw = 0.0;
      var ch = 0.0;
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,0,0));
      c = this.GetControlBitmap();
      if ((c != null) && !pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(c)) {
        if (AAbsolute) {
          r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.FLeft,this.FTop,this.FLeft + this.FWidth,this.FTop + this.FHeight))}
         else r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,this.FWidth,this.FHeight));
        if (this.FControlStretched) {
          Result.$assign(r);
          pas["WEBLib.TMSFNCTypes"].InflateRectEx(Result,-2 * this.FScaleFactor,-2 * this.FScaleFactor);
        } else {
          cw = this.GetControlWidth() * this.FScaleFactor;
          ch = this.GetControlHeight() * this.FScaleFactor;
          var $tmp = this.FControlPosition;
          if ($tmp === $mod.TTMSFNCGridCellControlPosition.gcpLeft) {
            Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + 2,r.Top + ((r.Bottom - r.Top - ch) / 2),r.Left + cw + 2,r.Top + ((r.Bottom - r.Top - ch) / 2) + ch))}
           else if ($tmp === $mod.TTMSFNCGridCellControlPosition.gcpTop) {
            Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + ((r.Right - r.Left - cw) / 2),r.Top + 2,r.Left + ((r.Right - r.Left - cw) / 2) + cw,r.Top + 2 + ch))}
           else if ($tmp === $mod.TTMSFNCGridCellControlPosition.gcpRight) {
            Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Right - cw - 2,r.Top + ((r.Bottom - r.Top - ch) / 2),r.Right - 2,r.Top + ((r.Bottom - r.Top - ch) / 2) + ch))}
           else if ($tmp === $mod.TTMSFNCGridCellControlPosition.gcpBottom) {
            Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + ((r.Right - r.Left - cw) / 2),r.Bottom - 2 - ch,r.Left + ((r.Right - r.Left - cw) / 2) + cw,r.Bottom - 2))}
           else if ($tmp === $mod.TTMSFNCGridCellControlPosition.gcpCenter) Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + ((r.Right - r.Left - cw) / 2),r.Top + ((r.Bottom - r.Top - ch) / 2),r.Left + ((r.Right - r.Left - cw) / 2) + cw,r.Top + ((r.Bottom - r.Top - ch) / 2) + ch));
        };
      };
      return Result;
    };
    this.HandleMouseMove = function (Shift, X, Y, AHandled, ACursor) {
      var ctlr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (this.FControlEnabled) {
        ctlr.$assign(this.GetControlRect(true));
        AHandled.set(pas["WEBLib.TMSFNCTypes"].PtInRectEx(ctlr,pas["WEBLib.TMSFNCTypes"].PointF(X,Y)));
        if (AHandled.get()) this.HandleControlMouseMove(rtl.refSet(Shift),X,Y,ACursor);
      };
    };
    this.HandleMouseDown = function (Button, Shift, X, Y, AHandled) {
      var ctlr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (this.FControlEnabled) {
        ctlr.$assign(this.GetControlRect(true));
        AHandled.set(pas["WEBLib.TMSFNCTypes"].PtInRectEx(ctlr,pas["WEBLib.TMSFNCTypes"].PointF(X,Y)));
        if (AHandled.get()) this.HandleControlMouseDown(Button,rtl.refSet(Shift),X,Y);
      };
    };
    this.HandleMouseUp = function (Button, Shift, X, Y, AHandled) {
      var ctlr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (this.FControlEnabled) {
        ctlr.$assign(this.GetControlRect(true));
        AHandled.set(pas["WEBLib.TMSFNCTypes"].PtInRectEx(ctlr,pas["WEBLib.TMSFNCTypes"].PointF(X,Y)));
        if (AHandled.get()) this.HandleControlMouseUp(Button,rtl.refSet(Shift),X,Y);
      };
    };
    this.Draw = function (AGraphics, ADrawText, ADrawBackGround, ADrawBorder) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rt = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var s = "";
      var AllowDraw = false;
      var st = null;
      r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.FLeft,this.FTop,this.FLeft + this.FWidth,this.FTop + this.FHeight));
      rt.$assign(this.GetTextRect(true));
      AllowDraw = true;
      AGraphics.SetFill(this.FLayout.FFill);
      AGraphics.SetStroke(this.FLayout.FStroke);
      AGraphics.SetFont(this.FLayout.FFont);
      this.DoBeforeDraw(AGraphics,r,rt,{get: function () {
          return ADrawText;
        }, set: function (v) {
          ADrawText = v;
        }},{get: function () {
          return ADrawBackGround;
        }, set: function (v) {
          ADrawBackGround = v;
        }},{get: function () {
          return ADrawBorder;
        }, set: function (v) {
          ADrawBorder = v;
        }},{get: function () {
          return AllowDraw;
        }, set: function (v) {
          AllowDraw = v;
        }});
      if (AllowDraw) {
        if (!ADrawBackGround) {
          AGraphics.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
          AGraphics.FFill.SetColor(-1);
        };
        if (!ADrawBorder) {
          AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
          AGraphics.FStroke.SetColor(-1);
        };
        if (ADrawBackGround || ADrawBorder) AGraphics.DrawRectangle$3(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),rtl.refSet(this.FLayout.FSides),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        s = this.FText;
        if ((s !== "") && ADrawText) {
          AGraphics.SetFont(this.FLayout.FFont);
          st = null;
          if (this.FAngle !== 0) st = AGraphics.SaveState(false);
          try {
            if (this.FAngle !== 0) AGraphics.ClipRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rt));
            AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rt),s,this.FLayout.FWordWrapping,this.FLayout.FTextAlign,this.FLayout.FVerticalTextAlign,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,this.FAngle,-1,-1,!this.FDisplayHTMLFormatting,false,-1,-1);
          } finally {
            if (this.FAngle !== 0) AGraphics.RestoreState(st,false);
          };
        };
        this.DrawControl(AGraphics);
        this.DoAfterDraw(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rt));
      };
    };
    this.DrawControl = function (AGraphics) {
      var rc = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var c = null;
      c = this.GetControlBitmap();
      if (c != null) {
        rc.$assign(this.GetControlRect(true));
        rc.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Math.round(rc.Left),Math.round(rc.Top),Math.round(rc.Right),Math.round(rc.Bottom)));
        AGraphics.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rc),c,true,false,true,false);
      };
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCGridCell.isPrototypeOf(Source)) {
        this.FText = rtl.as(Source,$mod.TTMSFNCGridCell).FText;
        this.FLayout.Assign(rtl.as(Source,$mod.TTMSFNCGridCell).FLayout);
        this.FLeft = rtl.as(Source,$mod.TTMSFNCGridCell).FLeft;
        this.FTop = rtl.as(Source,$mod.TTMSFNCGridCell).FTop;
        this.FWidth = rtl.as(Source,$mod.TTMSFNCGridCell).FWidth;
        this.FHeight = rtl.as(Source,$mod.TTMSFNCGridCell).FHeight;
        this.FControlStretched = rtl.as(Source,$mod.TTMSFNCGridCell).FControlStretched;
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    this.AssignLayout = function (Source) {
      if ($mod.TTMSFNCGridCellLayout.isPrototypeOf(Source)) this.SetLayout(Source);
    };
    this.Create$1 = function (AOwner) {
      this.FOwner = AOwner;
      this.FScaleFactor = 1.0;
      this.FLayout = $mod.TTMSFNCGridCellLayout.$create("Create$1");
      this.FLayout.FOnChange = rtl.createCallback(this,"Changed");
      this.FControlStretched = false;
      this.FControlEnabled = true;
      return this;
    };
    this.Destroy = function () {
      this.FControlBitmap = null;
      rtl.free(this,"FLayout");
      pas.System.TObject.Destroy.call(this);
    };
  });
  this.$rtti.$ClassRef("TTMSFNCGridCellClass",{instancetype: this.$rtti["TTMSFNCGridCell"]});
  rtl.createClass(this,"TTMSFNCBaseCheckGridCell",this.TTMSFNCGridCell,function () {
    this.$init = function () {
      $mod.TTMSFNCGridCell.$init.call(this);
      this.FChecked = false;
      this.FOnCheckChanged = null;
    };
    this.$final = function () {
      this.FOnCheckChanged = undefined;
      $mod.TTMSFNCGridCell.$final.call(this);
    };
    this.SetChecked = function (Value) {
      if (this.FChecked !== Value) {
        this.FChecked = Value;
        this.DoCheckChanged(this);
      };
    };
    this.HandleControlMouseUp = function (Button, Shift, X, Y) {
      $mod.TTMSFNCGridCell.HandleControlMouseUp.apply(this,arguments);
      this.SetChecked(!this.FChecked);
    };
    this.DoCheckChanged = function (Sender) {
      if (this.FOnCheckChanged != null) this.FOnCheckChanged(this);
    };
    this.GetControlWidth = function () {
      var Result = 0.0;
      Result = 19;
      return Result;
    };
    this.GetControlHeight = function () {
      var Result = 0.0;
      Result = 19;
      return Result;
    };
    var $r = this.$rtti;
    $r.addProperty("Checked",2,rtl.boolean,"FChecked","SetChecked",4,{Default: false});
    $r.addProperty("OnCheckChanged",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnCheckChanged","FOnCheckChanged");
  });
  rtl.createClass(this,"TTMSFNCRadioGridCell",this.TTMSFNCBaseCheckGridCell,function () {
  });
  rtl.createClass(this,"TTMSFNCCheckGridCell",this.TTMSFNCBaseCheckGridCell,function () {
  });
  rtl.createClass(this,"TTMSFNCButtonGridCell",this.TTMSFNCGridCell,function () {
    this.$init = function () {
      $mod.TTMSFNCGridCell.$init.call(this);
      this.FButtonDown = false;
      this.FButtonWidth = 0;
      this.FButtonText = "";
      this.FButtonHeight = 0;
    };
    this.SetButtonText = function (Value) {
      if (this.FButtonText !== Value) this.FButtonText = Value;
    };
    this.SetButtonWidth = function (Value) {
      if (this.FButtonWidth !== Value) this.FButtonWidth = Value;
    };
    this.SetButtonHeight = function (Value) {
      if (this.FButtonHeight !== Value) this.FButtonHeight = Value;
    };
    this.HandleControlMouseDown = function (Button, Shift, X, Y) {
      $mod.TTMSFNCGridCell.HandleControlMouseDown.apply(this,arguments);
      this.FButtonDown = true;
    };
    this.HandleControlMouseUp = function (Button, Shift, X, Y) {
      $mod.TTMSFNCGridCell.HandleControlMouseUp.apply(this,arguments);
      this.FButtonDown = false;
    };
    this.GetControlWidth = function () {
      var Result = 0.0;
      Result = this.FButtonWidth;
      return Result;
    };
    this.GetControlHeight = function () {
      var Result = 0.0;
      Result = this.FButtonHeight;
      return Result;
    };
    this.Create$1 = function (AOwner) {
      $mod.TTMSFNCGridCell.Create$1.apply(this,arguments);
      this.FButtonWidth = 24;
      this.FButtonHeight = 20;
      this.FButtonDown = false;
      return this;
    };
    this.DrawControl = function (AGraphics) {
      var rc = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      rc.$assign(this.GetControlRect(true));
      rc.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Math.round(rc.Left),Math.round(rc.Top),Math.round(rc.Right),Math.round(rc.Bottom)));
      AGraphics.DrawButton(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rc),false,this.FButtonDown,this.FControlEnabled,true,1.0);
      if (this.FButtonText !== "") {
        pas["WEBLib.TMSFNCTypes"].InflateRectEx(rc,-2,-2);
        AGraphics.FFont.SetColor(0);
        AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rc),this.FButtonText,false,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttWord,0,-1,-1,true,false,-1,-1);
      };
    };
    var $r = this.$rtti;
    $r.addProperty("ButtonText",2,rtl.string,"FButtonText","SetButtonText");
    $r.addProperty("ButtonWidth",2,rtl.longint,"FButtonWidth","SetButtonWidth",4,{Default: 24});
    $r.addProperty("ButtonHeight",2,rtl.longint,"FButtonHeight","SetButtonHeight",4,{Default: 20});
  });
  rtl.createClass(this,"TTMSFNCProgressGridCell",this.TTMSFNCGridCell,function () {
    this.$init = function () {
      $mod.TTMSFNCGridCell.$init.call(this);
      this.FValue = 0.0;
      this.FColor = 0;
      this.FShowText = false;
      this.FTextColor = 0;
      this.FFormat = "";
    };
    this.SetValue = function (Value) {
      this.FValue = Value;
    };
    this.SetColor = function (Value) {
      this.FColor = Value;
    };
    this.SetShowText = function (Value) {
      this.FShowText = Value;
    };
    this.SetTextColor = function (Value) {
      this.FTextColor = Value;
    };
    this.SetFormat = function (Value) {
      this.FFormat = Value;
    };
    this.Draw = function (AGraphics, ADrawText, ADrawBackGround, ADrawBorder) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      $mod.TTMSFNCGridCell.Draw.apply(this,arguments);
      if (ADrawBackGround) {
        r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.FLeft + 4,this.FTop + 4,(this.FLeft + this.FWidth) - 4,(this.FTop + this.FHeight) - 4));
        AGraphics.DrawProgressBar(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FValue,this.FFormat,100,this.FColor,this.FTextColor,this.FShowText,true,1.0);
      };
    };
    this.Create$1 = function (AOwner) {
      $mod.TTMSFNCGridCell.Create$1.apply(this,arguments);
      this.FValue = 0;
      this.FColor = 3329434;
      this.FTextColor = 0;
      this.FShowText = true;
      this.FFormat = "%.0f%%";
      return this;
    };
    var $r = this.$rtti;
    $r.addProperty("Value",2,rtl.double,"FValue","SetValue");
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor",4,{Default: 3329434});
    $r.addProperty("TextColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FTextColor","SetTextColor",4,{Default: 0});
    $r.addProperty("ShowText",2,rtl.boolean,"FShowText","SetShowText",4,{Default: true});
    $r.addProperty("Format",2,rtl.string,"FFormat","SetFormat");
  });
  rtl.createClass(this,"TTMSFNCCommentGridCell",this.TTMSFNCGridCell,function () {
    this.$init = function () {
      $mod.TTMSFNCGridCell.$init.call(this);
      this.FCommentColor = 0;
      this.FCommentText = "";
      this.FCommentTextColor = 0;
    };
    this.PtInComment = function (X, Y) {
      var Result = false;
      var pth = null;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var g = null;
      r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.FLeft,this.FTop,this.FLeft + this.FWidth,this.FTop + this.FHeight));
      pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,-3,-3);
      g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[1,1,false,true]);
      g.BeginScene();
      g.FOptimizedHTMLDrawing = this.FOptimizedHTMLDrawing;
      g.FBitmapContainer = this.FBitmapContainer;
      pth = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPath.$create("Create$1");
      try {
        pth.MoveTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - 7,r.Top));
        pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Top));
        pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Top + 7));
        pth.ClosePath();
        Result = g.$class.PointInPath(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(X,Y)),pth);
      } finally {
        pth = rtl.freeLoc(pth);
        g.EndScene();
        g = rtl.freeLoc(g);
      };
      return Result;
    };
    this.Create$1 = function (AOwner) {
      $mod.TTMSFNCGridCell.Create$1.apply(this,arguments);
      this.FCommentColor = 255;
      this.FCommentTextColor = 0;
      return this;
    };
    this.HandleMouseDown = function (Button, Shift, X, Y, AHandled) {
      $mod.TTMSFNCGridCell.HandleMouseDown.apply(this,arguments);
      AHandled.set(this.PtInComment(X,Y));
    };
    this.HandleMouseMove = function (Shift, X, Y, AHandled, ACursor) {
      $mod.TTMSFNCGridCell.HandleMouseMove.apply(this,arguments);
      AHandled.set(this.PtInComment(X,Y));
      if (AHandled.get()) ACursor.set(21);
    };
    this.HandleMouseUp = function (Button, Shift, X, Y, AHandled) {
      $mod.TTMSFNCGridCell.HandleMouseUp.apply(this,arguments);
      AHandled.set(this.PtInComment(X,Y));
      if (AHandled.get()) this.DoControlClick(this);
    };
    this.Draw = function (AGraphics, ADrawText, ADrawBackGround, ADrawBorder) {
      var pth = null;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      $mod.TTMSFNCGridCell.Draw.apply(this,arguments);
      r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.FLeft,this.FTop,this.FLeft + this.FWidth,this.FTop + this.FHeight));
      pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,-3,-3);
      AGraphics.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      AGraphics.FFill.SetColor(this.FCommentColor);
      AGraphics.FStroke.SetColor(this.FCommentColor);
      pth = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPath.$create("Create$1");
      try {
        pth.MoveTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - 7,r.Top));
        pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Top));
        pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Top + 7));
        pth.ClosePath();
        AGraphics.DrawPath(pth,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPathDrawMode.pdmPolygon);
      } finally {
        pth = rtl.freeLoc(pth);
      };
    };
    var $r = this.$rtti;
    $r.addProperty("CommentText",0,rtl.string,"FCommentText","FCommentText");
    $r.addProperty("CommentColor",0,pas["WEBLib.Graphics"].$rtti["TColor"],"FCommentColor","FCommentColor",4,{Default: 255});
    $r.addProperty("CommentTextColor",0,pas["WEBLib.Graphics"].$rtti["TColor"],"FCommentTextColor","FCommentTextColor",4,{Default: 0});
  });
  rtl.createClass(this,"TTMSFNCFixedGridCell",this.TTMSFNCGridCell,function () {
    this.$init = function () {
      $mod.TTMSFNCGridCell.$init.call(this);
      this.FShowDropDownButton = false;
      this.FSortIndex = 0;
      this.FSortKind = 0;
      this.FSizeMargin = 0;
    };
    this.PtInDropDown = function (X, Y) {
      var Result = false;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var mgr = 0.0;
      var sz = 0.0;
      Result = false;
      if (!this.FShowDropDownButton) return Result;
      mgr = (this.FSizeMargin + 2) * this.FScaleFactor;
      sz = 15 * this.FScaleFactor;
      r.$assign(pas["WEBLib.TMSFNCTypes"].RectF((this.FLeft + this.FWidth) - sz - mgr,this.FTop + ((this.FHeight - sz) / 2),(this.FLeft + this.FWidth) - mgr,this.FTop + ((this.FHeight - sz) / 2) + sz));
      Result = pas["WEBLib.TMSFNCTypes"].PtInRectEx(r,pas["WEBLib.TMSFNCTypes"].PointF(X,Y));
      return Result;
    };
    this.Create$1 = function (AOwner) {
      $mod.TTMSFNCGridCell.Create$1.apply(this,arguments);
      this.FSizeMargin = 0;
      return this;
    };
    this.HandleMouseDown = function (Button, Shift, X, Y, AHandled) {
      $mod.TTMSFNCGridCell.HandleMouseDown.apply(this,arguments);
      AHandled.set(this.PtInDropDown(X,Y));
    };
    this.HandleMouseMove = function (Shift, X, Y, AHandled, ACursor) {
      $mod.TTMSFNCGridCell.HandleMouseMove.apply(this,arguments);
      AHandled.set(this.PtInDropDown(X,Y));
    };
    this.HandleMouseUp = function (Button, Shift, X, Y, AHandled) {
      $mod.TTMSFNCGridCell.HandleMouseUp.apply(this,arguments);
      AHandled.set(this.PtInDropDown(X,Y));
      if (AHandled.get()) this.DoControlClick(this);
    };
    this.Draw = function (AGraphics, ADrawText, ADrawBackGround, ADrawBorder) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var dr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var sr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var sz = 0.0;
      var szr = 0.0;
      var mgr = 0.0;
      $mod.TTMSFNCGridCell.Draw.apply(this,arguments);
      r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.FLeft,this.FTop,this.FLeft + this.FWidth,this.FTop + this.FHeight));
      sr.$assign(r);
      mgr = (this.FSizeMargin + 2) * this.FScaleFactor;
      if (this.FShowDropDownButton) {
        sz = 15 * this.FScaleFactor;
        dr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Right - sz - mgr,r.Top + ((r.Bottom - r.Top - sz) / 2),r.Right - mgr,r.Top + ((r.Bottom - r.Top - sz) / 2) + sz));
        AGraphics.DrawDropDownButton(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(pas.System.Int(dr.Left),pas.System.Int(dr.Top),pas.System.Int(dr.Right),pas.System.Int(dr.Bottom))),false,false,true,true,false,1.0);
        sr.Right = dr.Left;
      };
      if (this.FSortKind !== $mod.TTMSFNCGridSortKind.skNone) {
        szr = 12 * this.FScaleFactor;
        sr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(sr.Right - szr - (3 * this.FScaleFactor) - mgr,sr.Top + ((sr.Bottom - sr.Top - szr) / 2),sr.Right - (3 * this.FScaleFactor) - mgr,sr.Top + ((sr.Bottom - sr.Top - szr) / 2) + szr));
        this.DrawSortIndicator(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(sr));
      };
    };
    this.DrawSortIndicator = function (AGraphics, ARect) {
      var pth = null;
      var vertt = 0;
      var c = 0;
      var txtr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (this.FSortIndex === -1) {
        c = 11829830}
       else c = 17919;
      AGraphics.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      AGraphics.FFill.SetColor(c);
      AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      AGraphics.FStroke.SetColor(c);
      vertt = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      txtr.$assign(ARect);
      pth = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPath.$create("Create$1");
      try {
        var $tmp = this.FSortKind;
        if ($tmp === $mod.TTMSFNCGridSortKind.skAscending) {
          vertt = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaTrailing;
          pth.MoveTo(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Left + ((ARect.Right - ARect.Left) / 2),ARect.Top));
          pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Right,ARect.Bottom));
          pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Left,ARect.Bottom));
          txtr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARect.Left,ARect.Top + 2,ARect.Right,ARect.Bottom + 2));
        } else if ($tmp === $mod.TTMSFNCGridSortKind.skDescending) {
          vertt = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading;
          pth.MoveTo(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Left,ARect.Top));
          pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Right,ARect.Top));
          pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Left + ((ARect.Right - ARect.Left) / 2),ARect.Bottom));
          txtr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARect.Left,ARect.Top - 2,ARect.Right,ARect.Bottom - 2));
        };
        pth.ClosePath();
        AGraphics.DrawPath(pth,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPathDrawMode.pdmPolygon);
        if (this.FSortIndex !== -1) {
          AGraphics.FFont.SetColor(16777215);
          pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.SetFontSize(AGraphics.FFont,9,1);
          AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(txtr),pas.SysUtils.IntToStr(this.FSortIndex),false,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,vertt,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,true,false,-1,-1);
        };
      } finally {
        pth = rtl.freeLoc(pth);
      };
    };
    var $r = this.$rtti;
    $r.addProperty("ShowDropDownButton",0,rtl.boolean,"FShowDropDownButton","FShowDropDownButton",4,{Default: false});
    $r.addProperty("SortKind",0,$mod.$rtti["TTMSFNCGridSortKind"],"FSortKind","FSortKind",4,{Default: $mod.TTMSFNCGridSortKind.skDescending});
    $r.addProperty("SortIndex",0,rtl.longint,"FSortIndex","FSortIndex",4,{Default: -1});
    $r.addProperty("SizeMargin",0,rtl.longint,"FSizeMargin","FSizeMargin",4,{Default: 0});
  });
  rtl.createClass(this,"TTMSFNCNodeGridCell",this.TTMSFNCGridCell,function () {
    this.$init = function () {
      $mod.TTMSFNCGridCell.$init.call(this);
      this.FState = 0;
    };
    this.HandleControlMouseMove = function (Shift, X, Y, ACursor) {
      $mod.TTMSFNCGridCell.HandleControlMouseMove.apply(this,arguments);
      ACursor.set(21);
    };
    var $r = this.$rtti;
    $r.addProperty("State",0,$mod.$rtti["TTMSFNCGridNodeState"],"FState","FState",4,{Default: $mod.TTMSFNCGridNodeState.nsClosed});
  });
  rtl.createClass(this,"TTMSFNCBitmapGridCell",this.TTMSFNCGridCell,function () {
    this.$init = function () {
      $mod.TTMSFNCGridCell.$init.call(this);
      this.FBitmap = null;
      this.FBitmapName = "";
    };
    this.$final = function () {
      this.FBitmap = undefined;
      $mod.TTMSFNCGridCell.$final.call(this);
    };
    this.SetBitmap = function (Value) {
      if (this.FBitmap !== Value) {
        this.FBitmap.Assign(Value);
      };
    };
    this.SetBitmapName = function (Value) {
      if (this.FBitmapName !== Value) {
        this.FBitmapName = Value;
      };
    };
    this.Create$1 = function (AOwner) {
      $mod.TTMSFNCGridCell.Create$1.apply(this,arguments);
      this.FBitmap = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      this.SetControlEnabled(false);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FBitmap");
      $mod.TTMSFNCGridCell.Destroy.call(this);
    };
    this.GetControlBitmap = function () {
      var Result = null;
      Result = null;
      if ((this.FBitmap != null) && !pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(this.FBitmap)) {
        Result = this.FBitmap}
       else if ((this.FBitmapContainer != null) && (this.FBitmapName !== "")) Result = this.FBitmapContainer.FindBitmap$1(this.FBitmapName);
      return Result;
    };
    var $r = this.$rtti;
    $r.addProperty("BitmapName",2,rtl.string,"FBitmapName","SetBitmapName");
    $r.addProperty("Bitmap",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FBitmap","SetBitmap");
  });
},["Math","SysUtils","WEBLib.TMSFNCUtils"]);
rtl.module("WEBLib.TMSFNCGridDataUtil",["System","Classes","Types","SysUtils"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.TTMSFNCGridAutoType = {"0": "atNumeric", atNumeric: 0, "1": "atFloat", atFloat: 1, "2": "atString", atString: 2, "3": "atDate", atDate: 3, "4": "atTime", atTime: 4, "5": "atScientific", atScientific: 5};
  this.$rtti.$Enum("TTMSFNCGridAutoType",{minvalue: 0, maxvalue: 5, ordtype: 1, enumtype: this.TTMSFNCGridAutoType});
  rtl.createClass(this,"TTMSFNCGridIntList",pas.Classes.TList,function () {
    this.SetInteger = function (Index, Value) {
      this.Put(Index,Value);
    };
    this.GetInteger = function (Index) {
      var Result = 0;
      Result = rtl.trunc(this.Get(Index));
      return Result;
    };
    this.GetStrValue = function () {
      var Result = "";
      var i = 0;
      for (var $l = 1, $end = this.GetCount(); $l <= $end; $l++) {
        i = $l;
        if (i === 1) {
          Result = pas.SysUtils.IntToStr(this.GetInteger(i - 1))}
         else Result = Result + "," + pas.SysUtils.IntToStr(this.GetInteger(i - 1));
      };
      return Result;
    };
    this.SetStrValue = function (Value) {
      var sl = null;
      var i = 0;
      sl = pas.Classes.TStringList.$create("Create$1");
      sl.SetCommaText(Value);
      this.Clear();
      for (var $l = 1, $end = sl.GetCount(); $l <= $end; $l++) {
        i = $l;
        this.Add$1(pas.SysUtils.StrToInt(sl.Get(i - 1)));
      };
      sl = rtl.freeLoc(sl);
    };
    this.DeleteValue = function (Value) {
      var i = 0;
      i = this.IndexOf(Value);
      if (i !== -1) this.Delete$1(i);
    };
    this.HasValue = function (Value) {
      var Result = false;
      Result = this.IndexOfValue(Value) !== -1;
      return Result;
    };
    this.IndexOfValue = function (Value) {
      var Result = 0;
      Result = this.IndexOf(Value);
      return Result;
    };
    this.Add$1 = function (Value) {
      pas.Classes.TList.Add.call(this,Value);
    };
    this.Insert$1 = function (Index, Value) {
      pas.Classes.TList.Insert.call(this,Index,Value);
    };
    this.Delete$1 = function (Index) {
      pas.Classes.TList.Delete.call(this,Index);
    };
  });
  this.IsType = function (s) {
    var Result = 0;
    var i = 0;
    var isI = false;
    var isF = false;
    var isS = false;
    var th = 0;
    var de = 0;
    var mi = 0;
    var isE = false;
    Result = $mod.TTMSFNCGridAutoType.atString;
    if (s === "") return Result;
    isI = true;
    isF = true;
    isS = true;
    isE = false;
    th = -1;
    de = 0;
    mi = 0;
    for (var $l = 1, $end = s.length; $l <= $end; $l++) {
      i = $l;
      if (!$impl.CheckSignedNum(s.charAt(i - 1))) isI = false;
      if ((s.charAt(i - 1) === "e") || (s.charAt(i - 1) === "E")) {
        if (isE) isS = false;
        isE = true;
      };
      if ((i > 1) && (s.charAt(i - 1) === "-")) {
        isI = false;
        isF = false;
      };
      if ((i === 1) && ((s.charAt(i - 1) === "e") || (s.charAt(i - 1) === "E"))) isS = false;
      if ((i === s.length) && ((s.charAt(i - 1) === "e") || (s.charAt(i - 1) === "E") || (s.charAt(i - 1) === "+") || (s.charAt(i - 1) === "-"))) isS = false;
      if (!($impl.CheckNum(s.charAt(i - 1)) || (s.charAt(i - 1) === "-") || (s.charAt(i - 1) === pas.SysUtils.FormatSettings.ThousandSeparator) || (s.charAt(i - 1) === pas.SysUtils.FormatSettings.DecimalSeparator))) isF = false;
      if (!($impl.CheckSignedFloatNum(s.charAt(i - 1)) && (s.charAt(i - 1) !== pas.SysUtils.FormatSettings.ThousandSeparator))) isS = false;
      if ((s.charAt(i - 1) === pas.SysUtils.FormatSettings.ThousandSeparator) && ((i - th) < 4) && (th !== -1)) {
        isF = false;
      };
      if (s.charAt(i - 1) === pas.SysUtils.FormatSettings.ThousandSeparator) {
        th = i;
      };
      if (s.charAt(i - 1) === pas.SysUtils.FormatSettings.DecimalSeparator) de += 1;
      if (s.charAt(i - 1) === "-") mi += 1;
    };
    if (isI) {
      Result = $mod.TTMSFNCGridAutoType.atNumeric}
     else {
      if (isF && !isE) Result = $mod.TTMSFNCGridAutoType.atFloat;
      if (isS && isE) {
        if (mi === 2) mi = 1;
        Result = $mod.TTMSFNCGridAutoType.atScientific;
      };
    };
    if ((mi > 1) || (de > 1)) Result = $mod.TTMSFNCGridAutoType.atString;
    return Result;
  };
  this.CharPos = function (ch, s) {
    var Result = 0;
    var i = 0;
    Result = 0;
    for (var $l = 1, $end = s.length; $l <= $end; $l++) {
      i = $l;
      if (s.charAt(i - 1) === ch) {
        Result = i;
        break;
      };
    };
    return Result;
  };
  this.NumSingleChar = function (p, s) {
    var Result = 0;
    var Res = 0;
    var sp = 0;
    Res = 0;
    sp = -1;
    while ($mod.SinglePos(p,s,{get: function () {
        return sp;
      }, set: function (v) {
        sp = v;
      }}) > 0) {
      pas.System.Delete({get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},1,sp);
      Res += 1;
    };
    Result = Res;
    return Result;
  };
  this.DoubleToSingleChar = function (ch, s) {
    var Result = "";
    var Res = "";
    var i = 0;
    if ((s === "") || ($mod.CharPos(ch,s) === 0)) {
      Result = s;
      return Result;
    };
    Res = "";
    i = 1;
    do {
      Res = Res + s.charAt(i - 1);
      if ((s.charAt(i - 1) === ch) && (s.charAt((i + 1) - 1) === ch)) i += 1;
      i += 1;
    } while (!(i > s.length));
    Result = Res;
    return Result;
  };
  this.CSVToLineFeeds = function (s) {
    var res = "";
    var i = 0;
    if ($mod.CharPos("\x0B",s.get()) === 0) return;
    res = "";
    for (var $l = 1, $end = s.get().length; $l <= $end; $l++) {
      i = $l;
      if (s.get().charAt(i - 1) === "\x0B") {
        res = res + "\r\n"}
       else res = res + s.get().charAt(i - 1);
    };
    s.set(res);
  };
  this.VarCharPos = function (ch, s, Res) {
    var Result = 0;
    var i = 0;
    Result = 0;
    for (var $l = 1, $end = s.length; $l <= $end; $l++) {
      i = $l;
      if (s.charAt(i - 1) === ch) {
        Res.set(i);
        Result = i;
        break;
      };
    };
    return Result;
  };
  this.NumChar = function (p, s) {
    var Result = 0;
    var Res = 0;
    var vp = 0;
    Res = 0;
    vp = -1;
    while (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos(p,s,{get: function () {
        return vp;
      }, set: function (v) {
        vp = v;
      }}) > 0) {
      pas.System.Delete({get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},1,vp);
      Res += 1;
    };
    Result = Res;
    return Result;
  };
  this.SinglePos = function (p, s, sp) {
    var Result = 0;
    var i = 0;
    var QuoteCount = 0;
    i = 1;
    QuoteCount = 0;
    while (i <= s.length) {
      if (s.charAt(i - 1) === p) {
        if (i < s.length) {
          QuoteCount += 1}
         else if (i === s.length) {
          Result = i;
          sp.set(i);
          return Result;
        };
      } else {
        if (pas.System.Odd(QuoteCount)) {
          Result = i - 1;
          sp.set(i - 1);
          return Result;
        } else QuoteCount = 0;
      };
      i += 1;
    };
    Result = 0;
    sp.set(0);
    return Result;
  };
  this.GetToken = function (s, separator) {
    var Result = "";
    var sp = 0;
    Result = "";
    sp = pas.System.Pos(separator,s.get());
    if (sp > 0) {
      Result = pas.System.Copy(s.get(),1,sp - 1);
      pas.System.Delete(s,1,sp);
    };
    return Result;
  };
  this.FileToLf = function (s, multiline) {
    var Result = "";
    var i = 0;
    if (pas.System.Pos("\b",s) > 0) for (var $l = 1, $end = s.length; $l <= $end; $l++) {
      i = $l;
      if (s.charAt(i - 1) === "\t") s = rtl.setCharAt(s,i - 1,"\r");
      if (s.charAt(i - 1) === "\b") s = rtl.setCharAt(s,i - 1,"\n");
      if (s.charAt(i - 1) === "\x01") s = rtl.setCharAt(s,i - 1,"\x00");
    };
    if (!multiline) {
      Result = $mod.GetNextLine({get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},multiline)}
     else Result = s;
    return Result;
  };
  this.LfToFile = function (s) {
    var Result = "";
    var i = 0;
    if (pas.System.Pos("\r",s) > 0) for (var $l = 1, $end = s.length; $l <= $end; $l++) {
      i = $l;
      if (s.charAt(i - 1) === "\r") s = rtl.setCharAt(s,i - 1,"\t");
      if (s.charAt(i - 1) === "\n") s = rtl.setCharAt(s,i - 1,"\b");
      if (s.charAt(i - 1) === "\x00") s = rtl.setCharAt(s,i - 1,"\x01");
    };
    Result = s;
    return Result;
  };
  this.GetNextLine = function (s, multiline) {
    var Result = "";
    var vp = 0;
    vp = -1;
    if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos($impl.LINEFEED,s.get(),{get: function () {
        return vp;
      }, set: function (v) {
        vp = v;
      }}) > 0) {
      Result = pas.System.Copy(s.get(),1,vp - 1);
      pas.System.Delete(s,1,vp);
      if (s.get() !== "") if (s.get().charAt(0) === "\n") pas.System.Delete(s,1,1);
      if (!multiline) s.set("");
    } else {
      Result = s.get();
      s.set("");
    };
    return Result;
  };
  this.CSVQuotes = function (S) {
    var Result = "";
    var i = 0;
    Result = "";
    for (var $l = 1, $end = S.length; $l <= $end; $l++) {
      i = $l;
      Result = Result + S.charAt(i - 1);
      if (S.charAt(i - 1) === '"') Result = Result + '"';
    };
    return Result;
  };
  this.LineFeedsToCSV = function (s) {
    var vp = 0;
    vp = -1;
    while (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos("\r\n",s.get(),{get: function () {
        return vp;
      }, set: function (v) {
        vp = v;
      }}) > 0) {
      pas.System.Delete(s,vp,1);
      s.set(rtl.setCharAt(s.get(),vp - 1,"\x0B"));
    };
    s.set('"' + s.get() + '"');
  };
  this.LineFeedsToCSVNQ = function (s) {
    var vp = 0;
    vp = -1;
    while (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos("\r\n",s.get(),{get: function () {
        return vp;
      }, set: function (v) {
        vp = v;
      }}) > 0) pas.System.Delete(s,vp,1);
  };
  this.LinesInText = function (s, multiline) {
    var Result = 0;
    var vp = 0;
    Result = 1;
    if (!multiline) return Result;
    vp = -1;
    while (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos($impl.LINEFEED,s,{get: function () {
        return vp;
      }, set: function (v) {
        vp = v;
      }}) > 0) {
      Result += 1;
      pas.System.Delete({get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},1,vp);
    };
    return Result;
  };
  this.HTMLLineBreaks = function (s) {
    var Result = "";
    var i = 0;
    var res = "";
    res = "";
    if (pas.System.Pos("\r",s) === 0) {
      res = s}
     else for (var $l = 1, $end = s.length; $l <= $end; $l++) {
      i = $l;
      if (s.charAt(i - 1) !== "\r") {
        res = res + s.charAt(i - 1)}
       else res = res + "<br>";
    };
    Result = res;
    return Result;
  };
  this.CRToLF = function (s) {
    var Result = "";
    var i = 0;
    var res = "";
    res = "";
    for (var $l = 1, $end = s.length; $l <= $end; $l++) {
      i = $l;
      if (s.charAt(i - 1) !== "\r") {
        res = res + s.charAt(i - 1)}
       else res = res + "\n";
    };
    Result = res;
    return Result;
  };
  this.FixNonBreaking = function (su) {
    var Result = "";
    while (pas.System.Pos(" ",su) > 0) {
      $impl.TagReplaceString(" ","&nbsp;",{get: function () {
          return su;
        }, set: function (v) {
          su = v;
        }});
    };
    Result = su;
    return Result;
  };
  this.IsURL = function (s) {
    var Result = false;
    var su = "";
    su = pas.SysUtils.UpperCase(s);
    Result = (pas.System.Pos("HTTP://",su) === 1) || (pas.System.Pos("HTTPS://",su) === 1) || (pas.System.Pos("FTP://",su) === 1) || (pas.System.Pos("NNTP://",su) === 1) || (pas.System.Pos("MAILTO:",su) === 1);
    return Result;
  };
  $mod.$implcode = function () {
    $impl.LINEFEED = "\r";
    $impl.IsNumber = function (ch) {
      var Result = false;
      Result = ch.charCodeAt() in rtl.createSet(null,0x30,0x39);
      return Result;
    };
    $impl.CheckNum = function (ch) {
      var Result = false;
      Result = $impl.IsNumber(ch);
      return Result;
    };
    $impl.CheckSignedNum = function (ch) {
      var Result = false;
      Result = $impl.IsNumber(ch) || (ch === "-");
      return Result;
    };
    $impl.CheckExpNum = function (ch) {
      var Result = false;
      Result = $impl.IsNumber(ch) || (ch === "e") || (ch === "E");
      return Result;
    };
    $impl.CheckFloatNum = function (ch) {
      var Result = false;
      Result = $impl.IsNumber(ch) || (ch === pas.SysUtils.FormatSettings.ThousandSeparator) || (ch === pas.SysUtils.FormatSettings.DecimalSeparator) || (ch === "e") || (ch === "E");
      return Result;
    };
    $impl.CheckSignedDottedNum = function (ch) {
      var Result = false;
      Result = $impl.IsNumber(ch) || (ch === ".") || (ch === "-") || (ch === "e") || (ch === "E") || (ch === "+");
      return Result;
    };
    $impl.CheckSignedFloatNum = function (ch) {
      var Result = false;
      Result = $impl.CheckFloatNum(ch) || (ch === "+") || (ch === "-");
      return Result;
    };
    $impl.IPos = function (su, s) {
      var Result = 0;
      Result = pas.System.Pos(pas.SysUtils.UpperCase(su),pas.SysUtils.UpperCase(s));
      return Result;
    };
    $impl.TagReplaceString = function (Srch, Repl, Dest) {
      var Result = false;
      var i = 0;
      i = $impl.IPos(Srch,Dest.get());
      if (i > 0) {
        Result = true;
        pas.System.Delete(Dest,i,Srch.length);
        Dest.set(pas.System.Copy(Dest.get(),1,i - 1) + Repl + pas.System.Copy(Dest.get(),i,Dest.get().length));
      } else Result = false;
      return Result;
    };
  };
},["WEBLib.TMSFNCUtils"]);
rtl.module("WEBLib.TMSFNCCustomScrollControl",["System","Classes","WEBLib.TMSFNCCustomControl","WEBLib.StdCtrls","WEBLib.TMSFNCScrollBar","WEBLib.TMSFNCGraphics","WEBLib.TMSFNCTypes","WEBLib.ExtCtrls","Types","WEBLib.Controls"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.SCROLLINGDELAY = 0;
  this.SWIPECOUNT = 300;
  this.DOWNCOUNT = 100;
  this.TTMSFNCCustomScrollControlMode = {"0": "scmPixelScrolling", scmPixelScrolling: 0, "1": "scmItemScrolling", scmItemScrolling: 1};
  this.$rtti.$Enum("TTMSFNCCustomScrollControlMode",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCCustomScrollControlMode});
  this.TTMSFNCCustomScrollControlUpdate = {"0": "scuContinuous", scuContinuous: 0, "1": "scuOnce", scuOnce: 1};
  this.$rtti.$Enum("TTMSFNCCustomScrollControlUpdate",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCCustomScrollControlUpdate});
  rtl.createClass(this,"TTMSFNCCustomScrollControl",pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$init.call(this);
      this.FDownTime = 0;
      this.FMouseUp = false;
      this.FAnimateVerticalPos = false;
      this.FAnimateHorizontalPos = false;
      this.FAnimating = false;
      this.FSpX = 0.0;
      this.FSpY = 0.0;
      this.FDoubleSelection = false;
      this.FRangeSelection = false;
      this.FScrolling = false;
      this.FScrollX = 0.0;
      this.FScrollY = 0.0;
      this.FDownX = 0.0;
      this.FDownY = 0.0;
      this.FMouseX = 0.0;
      this.FMouseY = 0.0;
      this.FScrollVTo = 0.0;
      this.FScrollHTo = 0.0;
      this.FTimeStart = 0.0;
      this.FTimeStop = 0.0;
      this.FAnimateTimer = null;
      this.FDownTimer = null;
      this.FSaveHScrollPos = 0.0;
      this.FSaveVScrollPos = 0.0;
      this.FBlockScrollingUpdate = false;
      this.FIsMouseDown = false;
      this.FStretchScrollBars = false;
      this.FUpdateCount$1 = 0;
      this.FVerticalScrollBar = null;
      this.FHorizontalScrollBar = null;
      this.FCustomVerticalScrollBar = null;
      this.FCustomHorizontalScrollBar = null;
      this.FVerticalScrollBarVisible = false;
      this.FHorizontalScrollBarVisible = false;
      this.FScrollMode = 0;
      this.FApplyClipRect = false;
      this.FScrollUpdate = 0;
      this.FCustomScrollBars = false;
      this.FTouchScrolling = false;
    };
    this.$final = function () {
      this.FAnimateTimer = undefined;
      this.FDownTimer = undefined;
      this.FVerticalScrollBar = undefined;
      this.FHorizontalScrollBar = undefined;
      this.FCustomVerticalScrollBar = undefined;
      this.FCustomHorizontalScrollBar = undefined;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$final.call(this);
    };
    this.SetStretchScrollBars = function (Value) {
      if (this.FStretchScrollBars !== Value) {
        this.FStretchScrollBars = Value;
        this.UpdateControl(true,true);
      };
    };
    this.SetScrollMode = function (Value) {
      if (this.FScrollMode !== Value) {
        this.FScrollMode = Value;
        this.UpdateControl(true,true);
      };
    };
    this.SetApplyClipRect = function (Value) {
      if (this.FApplyClipRect !== Value) {
        this.FApplyClipRect = Value;
        this.Invalidate();
      };
    };
    this.SetScrollUpdate = function (Value) {
      if (this.FScrollUpdate !== Value) {
        this.FScrollUpdate = Value;
        if (this.FCustomVerticalScrollBar != null) this.FCustomVerticalScrollBar.SetTracking(this.FScrollUpdate === $mod.TTMSFNCCustomScrollControlUpdate.scuContinuous);
        if (this.FCustomHorizontalScrollBar != null) this.FCustomHorizontalScrollBar.SetTracking(this.FScrollUpdate === $mod.TTMSFNCCustomScrollControlUpdate.scuContinuous);
        this.UpdateControl(true,true);
      };
    };
    this.SetCustomScrollBars = function (Value) {
      if (this.FCustomScrollBars !== Value) {
        this.FCustomScrollBars = Value;
        this.UpdateControl(true,true);
      };
    };
    this.GetVersion = function () {
      var Result = "";
      Result = "";
      return Result;
    };
    this.GetCanvasHeightOffset = function () {
      var Result = 0;
      var hs = null;
      var hsc = null;
      Result = 0;
      hs = this.HorizontalScrollBar();
      hsc = this.CustomHorizontalScrollBar();
      if ((hs != null) && (hsc != null)) {
        if (this.FCustomScrollBars && hsc.FVisible && (hsc.FParent != null)) {
          Result = hsc.GetHeight()}
         else if (!this.FCustomScrollBars && hs.FVisible && (hs.FParent != null)) Result = hs.GetHeight();
      };
      return Result;
    };
    this.GetCanvasWidthOffset = function () {
      var Result = 0;
      var vs = null;
      var vsc = null;
      Result = 0;
      vs = this.VerticalScrollBar();
      vsc = this.CustomVerticalScrollBar();
      if ((vs != null) && (vsc != null)) {
        if (this.FCustomScrollBars && vsc.FVisible && (vsc.FParent != null)) {
          Result = vsc.GetWidth()}
         else if (!this.FCustomScrollBars && vs.FVisible && (vs.FParent != null)) Result = vs.GetWidth();
      };
      return Result;
    };
    this.SetHorizontalScrollBarVisible = function (Value) {
      if (this.FHorizontalScrollBarVisible !== Value) {
        this.FHorizontalScrollBarVisible = Value;
        this.UpdateControl(true,true);
      };
    };
    this.SetVerticalScrollBarVisible = function (Value) {
      if (this.FVerticalScrollBarVisible !== Value) {
        this.FVerticalScrollBarVisible = Value;
        this.UpdateControl(true,true);
      };
    };
    this.Animate = function (Sender) {
      var dx = 0.0;
      var dy = 0.0;
      var posx = 0.0;
      var posy = 0.0;
      var animh = false;
      var animv = false;
      posy = this.GetVScrollValue();
      posx = this.GetHScrollValue();
      dx = Math.abs(this.FScrollHTo - posx) / Math.max(1,Math.abs(this.FSpX) * 6);
      dy = Math.abs(this.FScrollVTo - posy) / Math.max(1,Math.abs(this.FSpY) * 6);
      animv = false;
      if (this.FAnimateVerticalPos) animv = $impl.AnimateDouble({get: function () {
          return posy;
        }, set: function (v) {
          posy = v;
        }},{p: this, get: function () {
          return this.p.FScrollVTo;
        }, set: function (v) {
          this.p.FScrollVTo = v;
        }},dy,0.01);
      animh = false;
      if (this.FAnimateHorizontalPos) animh = $impl.AnimateDouble({get: function () {
          return posx;
        }, set: function (v) {
          posx = v;
        }},{p: this, get: function () {
          return this.p.FScrollHTo;
        }, set: function (v) {
          this.p.FScrollHTo = v;
        }},dx,0.01);
      this.FAnimating = animv || animh;
      if (this.FAnimating) {
        this.Scroll(posx,posy)}
       else {
        this.FAnimateVerticalPos = false;
        this.FAnimateTimer.SetEnabled(false);
        this.FAnimateHorizontalPos = false;
      };
    };
    this.DownTime = function (Sender) {
      this.FDownTime += 1;
      if ((this.FDownTime === 100) || !this.FTouchScrolling) {
        this.FRangeSelection = true;
        this.FDownTimer.SetEnabled(false);
      };
    };
    this.UpdateControlAfterResize = function () {
      if ((this.FUpdateCount$1 > 0) || (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState) || (pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) return;
      this.SaveScrollPosition();
      this.UpdateControl(false,true);
      this.RestoreScrollPosition();
    };
    this.FillChanged$1 = function (Sender) {
      this.Invalidate();
    };
    this.StrokeChanged$1 = function (Sender) {
      this.Invalidate();
    };
    this.Scroll = function (AHorizontalPos, AVerticalPos) {
      var AOldHorizontalPos = 0.0;
      var AOldVerticalPos = 0.0;
      this.FBlockScrollingUpdate = true;
      AOldHorizontalPos = this.GetHScrollValue();
      AOldVerticalPos = this.GetVScrollValue();
      this.SetHScrollValue(AHorizontalPos);
      this.SetVScrollValue(AVerticalPos);
      this.FBlockScrollingUpdate = false;
      this.UpdateControlScroll(AOldHorizontalPos,AOldVerticalPos,AHorizontalPos,AVerticalPos);
    };
    this.UpdateControlScroll = function (AHorizontalPos, AVerticalPos, ANewHorizontalPos, ANewVerticalPos) {
    };
    this.VerticalScrollPositionChanged = function () {
    };
    this.HorizontalScrollPositionChanged = function () {
    };
    this.VScrollChanged = function (Sender) {
      if (this.FBlockScrollingUpdate || this.FCustomScrollBars) return;
      if (!this.FIsMouseDown) this.StopAnimationTimer();
      this.VerticalScrollPositionChanged();
      this.SetVScrollValue(this.GetVScrollValue());
    };
    this.HScrollChanged = function (Sender) {
      if (this.FBlockScrollingUpdate || this.FCustomScrollBars) return;
      if (!this.FIsMouseDown) this.StopAnimationTimer();
      this.HorizontalScrollPositionChanged();
      this.SetHScrollValue(this.GetHScrollValue());
    };
    this.HandleMouseDown = function (Button, Shift, X, Y) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseDown.apply(this,arguments);
      if ((!(this.FPopupMenu != null) && (pas["WEBLib.Controls"].TMouseButton.mbRight === Button)) || (pas["WEBLib.Controls"].TMouseButton.mbRight !== Button)) this.CaptureEx();
      if (!this.ProcessTouchScrolling(X,Y)) return;
      this.FIsMouseDown = true;
      this.FTimeStart = $impl.GetTickCountX();
      this.FTimeStop = this.FTimeStart;
      this.FScrollVTo = this.GetVScrollValue();
      this.FScrollHTo = this.GetHScrollValue();
      this.FScrollX = X;
      this.FScrollY = Y;
      this.FDownX = X;
      this.FDownY = Y;
      this.FMouseX = X;
      this.FMouseY = Y;
      this.FMouseUp = false;
      this.FDownTimer.SetEnabled(true);
      this.FDoubleSelection = !this.FAnimateTimer.FEnabled;
      this.FRangeSelection = false;
      this.FScrolling = false;
      this.FDownTime = 0;
    };
    this.HandleMouseMove = function (Shift, X, Y) {
      var f = 0.0;
      var doscroll = false;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseMove.apply(this,arguments);
      if (!this.ProcessTouchScrolling(X,Y)) return;
      if (this.FIsMouseDown) {
        doscroll = true;
        if (doscroll) {
          f = 1;
          if ((this.FScrolling || (Math.abs(this.FMouseX - X) > 3) || (Math.abs(this.FMouseY - Y) > 3)) && !this.FRangeSelection && this.FTouchScrolling) {
            if ((Math.abs(X - this.FDownX) > 0) || (Math.abs(Y - this.FDownY) > 0)) {
              this.FScrolling = true;
              this.FDownTimer.SetEnabled(false);
              this.FDoubleSelection = false;
              if (this.FIsMouseDown && !this.FMouseUp) {
                this.Scroll(this.GetHScrollValue() - ((X - this.FDownX) * f),this.GetVScrollValue() - ((Y - this.FDownY) * f));
                this.FDownY = Y;
                this.FDownX = X;
              };
            };
          };
        } else if (this.FRangeSelection) ;
      };
    };
    this.HandleMouseUp = function (Button, Shift, X, Y) {
      var f = 0.0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseUp.apply(this,arguments);
      this.ReleaseCaptureEx();
      if (!this.ProcessTouchScrolling(X,Y)) return;
      if (!this.FIsMouseDown) return;
      f = 1;
      this.FIsMouseDown = false;
      this.FMouseUp = true;
      this.FScrolling = false;
      this.FDownTimer.SetEnabled(false);
      if (!this.FDoubleSelection && this.FTouchScrolling) {
        this.FTimeStop = $impl.GetTickCountX();
        if (((this.FTimeStop - this.FTimeStart) < 300) && ((this.FTimeStop - this.FTimeStart) > 0)) {
          this.FSpY = Math.abs(Y - this.FScrollY) / (this.FTimeStop - this.FTimeStart);
          if (this.FSpY > 0) {
            if ((Y - this.FScrollY) > 0) {
              this.FScrollVTo = Math.max(0,Math.min(this.VerticalScrollBar().FMax - this.GetVViewPortSize(),this.FScrollVTo - Math.round(Math.abs(Y - this.FScrollY) * this.FSpY * f * 3)))}
             else this.FScrollVTo = Math.max(0,Math.min(this.VerticalScrollBar().FMax - this.GetVViewPortSize(),this.FScrollVTo + Math.round(Math.abs(Y - this.FScrollY) * this.FSpY * f * 3)));
            this.FAnimateVerticalPos = true;
            this.FAnimateTimer.SetEnabled(true);
          };
          this.FSpX = Math.abs(X - this.FScrollX) / (this.FTimeStop - this.FTimeStart);
          if (this.FSpX > 0) {
            if ((X - this.FScrollX) > 0) {
              this.FScrollHTo = Math.max(0,Math.min(this.HorizontalScrollBar().FMax - this.GetHViewPortSize(),this.FScrollHTo - Math.round(Math.abs(X - this.FScrollX) * this.FSpX * f * 3)))}
             else this.FScrollHTo = Math.max(0,Math.min(this.HorizontalScrollBar().FMax - this.GetHViewPortSize(),this.FScrollHTo + Math.round(Math.abs(X - this.FScrollX) * this.FSpX * f * 3)));
            this.FAnimateHorizontalPos = true;
            this.FAnimateTimer.SetEnabled(true);
          };
        };
      } else this.HandleSelection(Button,rtl.refSet(Shift),X,Y);
      this.FRangeSelection = false;
    };
    this.HandleSelection = function (Button, Shift, X, Y) {
    };
    this.HCustomScrollChanged = function (Sender, AValue) {
      if (this.FBlockScrollingUpdate || !this.FCustomScrollBars) return;
      if (!this.FIsMouseDown) this.StopAnimationTimer();
      this.HorizontalScrollPositionChanged();
      this.SetHScrollValue(this.GetHScrollValue());
    };
    this.VCustomScrollChanged = function (Sender, AValue) {
      if (this.FBlockScrollingUpdate || !this.FCustomScrollBars) return;
      if (!this.FIsMouseDown) this.StopAnimationTimer();
      this.VerticalScrollPositionChanged();
      this.SetVScrollValue(this.GetVScrollValue());
    };
    this.UpdateControlScrollBarCalculations = function () {
    };
    this.UpdateControlScrollBars = function (AUpdate, ACalculate) {
      var vs = null;
      var hs = null;
      var vsc = null;
      var hsc = null;
      var w = 0.0;
      var h = 0.0;
      var cw = 0.0;
      var ch = 0.0;
      var cr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var vmgr = null;
      var hmgr = null;
      if ((this.FUpdateCount$1 > 0) || (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState)) return;
      this.FBlockScrollingUpdate = true;
      if (ACalculate) {
        this.UpdateControlScrollBarCalculations();
      };
      vs = this.VerticalScrollBar();
      hs = this.HorizontalScrollBar();
      vsc = this.CustomVerticalScrollBar();
      hsc = this.CustomHorizontalScrollBar();
      if ((vs != null) && (hs != null) && (vsc != null) && (hsc != null)) {
        if (ACalculate) {
          cr.$assign(this.GetCalculationRect())}
         else cr.$assign(this.GetContentRect());
        cw = cr.Right - cr.Left;
        ch = cr.Bottom - cr.Top;
        w = this.GetTotalContentWidth();
        h = this.GetTotalContentHeight();
        hs.SetVisible((w > 0) && (pas["WEBLib.TMSFNCTypes"].CompareValueEx(w,cw,0) === 1) && this.FHorizontalScrollBarVisible && !this.ColumnStretchingActive() && !this.FCustomScrollBars);
        vs.SetVisible((h > 0) && (pas["WEBLib.TMSFNCTypes"].CompareValueEx(h,ch,0) === 1) && this.FVerticalScrollBarVisible && !this.FCustomScrollBars);
        hsc.SetVisible((w > 0) && (pas["WEBLib.TMSFNCTypes"].CompareValueEx(w,cw,0) === 1) && this.FHorizontalScrollBarVisible && !this.ColumnStretchingActive() && this.FCustomScrollBars);
        vsc.SetVisible((h > 0) && (pas["WEBLib.TMSFNCTypes"].CompareValueEx(h,ch,0) === 1) && this.FVerticalScrollBarVisible && this.FCustomScrollBars);
        if (vsc.FVisible && this.FCustomScrollBars) {
          vsc.SetParent(this)}
         else vsc.SetParent(null);
        if (hsc.FVisible && this.FCustomScrollBars) {
          hsc.SetParent(this)}
         else hsc.SetParent(null);
        if (vs.FVisible && !this.FCustomScrollBars) {
          vs.SetParent(this)}
         else vs.SetParent(null);
        if (hs.FVisible && !this.FCustomScrollBars) {
          hs.SetParent(this)}
         else hs.SetParent(null);
        vmgr = pas["WEBLib.TMSFNCTypes"].TTMSFNCMargins.$create("Create$1");
        hmgr = pas["WEBLib.TMSFNCTypes"].TTMSFNCMargins.$create("Create$1");
        if (this.FCustomScrollBars) {
          if (vsc.FVisible && this.FStretchScrollBars) {
            hmgr.SetRight(vsc.GetWidth() + 1)}
           else hmgr.SetRight(1);
        } else {
          if (vs.FVisible && this.FStretchScrollBars) {
            hmgr.SetRight(vs.GetWidth() + 1)}
           else hmgr.SetRight(1);
        };
        vmgr.SetTop(1);
        vmgr.SetRight(1);
        hmgr.SetBottom(1);
        hmgr.SetLeft(1);
        if (this.FCustomScrollBars) {
          if (hsc.FVisible) {
            vmgr.SetBottom(hsc.GetHeight() + 1)}
           else vmgr.SetBottom(1);
        } else {
          if (hs.FVisible) {
            vmgr.SetBottom(hs.GetHeight() + 1)}
           else vmgr.SetBottom(1);
        };
        if (!this.FStretchScrollBars) {
          cr.$assign(this.GetCalculationRect());
          hmgr.SetLeft(hmgr.FLeft + cr.Left);
          hmgr.SetRight(hmgr.FRight + (this.GetWidth() - cr.Right));
          vmgr.SetTop(vmgr.FTop + cr.Top);
          vmgr.SetBottom(vmgr.FBottom + (this.GetHeight() - cr.Bottom));
        };
        hs.SetLeft(Math.round(hmgr.FLeft));
        hs.SetTop(Math.round(this.GetHeight() - hmgr.FBottom - hs.GetHeight()));
        vs.SetLeft(Math.round(this.GetWidth() - vmgr.FRight - vs.GetWidth()));
        vs.SetTop(Math.round(vmgr.FTop));
        hs.SetWidth(Math.round(Math.max(0,this.GetWidth() - hmgr.FRight - hmgr.FLeft)));
        vs.SetHeight(Math.round(Math.max(0,this.GetHeight() - vmgr.FBottom - vmgr.FTop)));
        hsc.SetLeft(Math.round(hmgr.FLeft));
        hsc.SetTop(Math.round(this.GetHeight() - hmgr.FBottom - hsc.GetHeight()));
        vsc.SetLeft(Math.round(this.GetWidth() - vmgr.FRight - vsc.GetWidth()));
        vsc.SetTop(Math.round(vmgr.FTop));
        hsc.SetWidth(Math.round(Math.max(0,this.GetWidth() - hmgr.FRight - hmgr.FLeft)));
        vsc.SetHeight(Math.round(Math.max(0,this.GetHeight() - vmgr.FBottom - vmgr.FTop)));
        hmgr = rtl.freeLoc(hmgr);
        vmgr = rtl.freeLoc(vmgr);
        cr.$assign(this.GetContentRect());
        cw = cr.Right - cr.Left;
        ch = cr.Bottom - cr.Top;
        if (this.FScrollMode === $mod.TTMSFNCCustomScrollControlMode.scmItemScrolling) {
          vs.SetPageSize(Math.round(Math.max(0,this.GetVerticalContentViewPortSize())));
          vs.SetMax(Math.max(vs.GetPageSize(),this.GetVerticalContentCount()));
        } else {
          vs.SetPageSize(Math.round(Math.max(0,Math.min(h,ch))));
          vs.SetMax(Math.round(Math.max(vs.GetPageSize(),h)));
          vs.SetPosition(Math.min(vs.GetPosition(),vs.FMax));
        };
        vs.FSmallChange = Math.max(-2147483648,rtl.trunc(vs.GetPageSize() / 5));
        vs.FLargeChange = Math.max(-2147483648,vs.GetPageSize());
        if (this.FScrollMode === $mod.TTMSFNCCustomScrollControlMode.scmItemScrolling) {
          hs.SetPageSize(Math.round(Math.max(0,this.GetHorizontalContentViewPortSize())));
          hs.SetMax(Math.max(hs.GetPageSize(),this.GetHorizontalContentCount()));
        } else {
          hs.SetPageSize(Math.round(Math.max(0,Math.min(w,cw))));
          hs.SetMax(Math.round(Math.max(hs.GetPageSize(),w)));
          hs.SetPosition(Math.min(hs.GetPosition(),hs.FMax));
        };
        hs.FSmallChange = Math.max(-2147483648,rtl.trunc(hs.GetPageSize() / 5));
        hs.FLargeChange = Math.max(-2147483648,hs.GetPageSize());
        if (this.FScrollMode === $mod.TTMSFNCCustomScrollControlMode.scmItemScrolling) {
          vsc.SetPageSize(this.GetVerticalContentViewPortSize());
          vsc.SetMax(this.GetVerticalContentCount());
        } else {
          vsc.SetPageSize(Math.min(h,ch));
          vsc.SetMax(h);
          vsc.SetValue(Math.min(vsc.FValue,vsc.FMax - vsc.FPageSize));
        };
        vsc.FSmallChange = vsc.FPageSize / 5;
        vsc.FLargeChange = vsc.FPageSize;
        if (this.FScrollMode === $mod.TTMSFNCCustomScrollControlMode.scmItemScrolling) {
          hsc.SetPageSize(this.GetHorizontalContentViewPortSize());
          hsc.SetMax(this.GetHorizontalContentCount());
        } else {
          hsc.SetPageSize(Math.min(w,cw));
          hsc.SetMax(w);
          hsc.SetValue(Math.min(hsc.FValue,hsc.FMax - hsc.FPageSize));
        };
        hsc.FSmallChange = hsc.FPageSize / 5;
        hsc.FLargeChange = hsc.FPageSize;
      };
      this.FBlockScrollingUpdate = false;
      if (AUpdate) this.UpdateControlScrollBars(false,false);
    };
    this.UpdateControl = function (AUpdate, ARealign) {
      this.UpdateControlCache();
      this.UpdateControlScrollBars(true,true);
      this.UpdateControlDisplay();
    };
    this.UpdateControlCache = function () {
    };
    this.UpdateControlDisplay = function () {
    };
    this.StopAnimationTimer = function () {
      this.FAnimateTimer.SetEnabled(false);
      this.FAnimating = false;
    };
    this.SetHScrollValue = function (AValue) {
      if (this.FCustomScrollBars) {
        if (this.CustomHorizontalScrollBar().FPageSize > 0) this.CustomHorizontalScrollBar().SetValue(Math.min(this.CustomHorizontalScrollBar().FMax - this.CustomHorizontalScrollBar().FPageSize,Math.max(0,AValue)));
      } else {
        if (this.HorizontalScrollBar().GetPageSize() > 0) this.HorizontalScrollBar().SetPosition(Math.round(Math.min(this.HorizontalScrollBar().FMax - this.HorizontalScrollBar().GetPageSize(),Math.max(0,AValue))));
      };
    };
    this.SetVScrollValue = function (AValue) {
      if (this.FCustomScrollBars) {
        if (this.CustomVerticalScrollBar().FPageSize > 0) this.CustomVerticalScrollBar().SetValue(Math.min(this.CustomVerticalScrollBar().FMax - this.CustomVerticalScrollBar().FPageSize,Math.max(0,AValue)));
      } else {
        if (this.VerticalScrollBar().GetPageSize() > 0) this.VerticalScrollBar().SetPosition(Math.round(Math.min(this.VerticalScrollBar().FMax - this.VerticalScrollBar().GetPageSize(),Math.max(0,AValue))));
      };
    };
    this.Loaded = function () {
      pas["WEBLib.Controls"].TCustomControl.Loaded.call(this);
      this.UpdateControl(true,true);
    };
    this.Draw = function (AGraphics, ARect) {
      var st = null;
      var cr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Draw.apply(this,arguments);
      cr.$assign(this.GetContentClipRect());
      st = null;
      if (this.FApplyClipRect) {
        st = AGraphics.SaveState(false);
        AGraphics.ClipRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(cr));
      };
      this.DrawContent(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(cr));
      if (this.FApplyClipRect) AGraphics.RestoreState(st,false);
    };
    this.DrawContent = function (AGraphics, ARect) {
    };
    this.UpdateScrollingMode = function (AMode) {
      this.FScrollMode = AMode;
    };
    this.GetTotalContentWidth = function () {
      var Result = 0.0;
      Result = 0;
      return Result;
    };
    this.GetTotalContentHeight = function () {
      var Result = 0.0;
      Result = 0;
      return Result;
    };
    this.GetHorizontalContentViewPortSize = function () {
      var Result = 0.0;
      Result = 0;
      return Result;
    };
    this.GetVerticalContentViewPortSize = function () {
      var Result = 0.0;
      Result = 0;
      return Result;
    };
    this.GetHorizontalContentCount = function () {
      var Result = 0;
      Result = 0;
      return Result;
    };
    this.GetVerticalContentCount = function () {
      var Result = 0;
      Result = 0;
      return Result;
    };
    this.GetCalculationRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(this.GetLocalRect());
      return Result;
    };
    this.GetContentClipRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(this.GetContentRect());
      return Result;
    };
    this.GetContentRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.GetContentRect.call(this));
      if (this.FCustomScrollBars) {
        if (this.CustomHorizontalScrollBar().FVisible) Result.Bottom = Result.Bottom - this.CustomHorizontalScrollBar().GetHeight() - 1;
        if (this.CustomVerticalScrollBar().FVisible) Result.Right = Result.Right - this.CustomVerticalScrollBar().GetWidth() - 1;
      } else {
        if (this.HorizontalScrollBar().FVisible) Result.Bottom = Result.Bottom - this.HorizontalScrollBar().GetHeight() - 1;
        if (this.VerticalScrollBar().FVisible) Result.Right = Result.Right - this.VerticalScrollBar().GetWidth() - 1;
      };
      return Result;
    };
    this.GetHScrollValue = function () {
      var Result = 0.0;
      if (this.FCustomScrollBars) {
        Result = Math.min(this.CustomHorizontalScrollBar().FMax - this.CustomHorizontalScrollBar().FPageSize,Math.max(0,this.CustomHorizontalScrollBar().FValue))}
       else {
        Result = Math.min(this.HorizontalScrollBar().FMax - this.HorizontalScrollBar().GetPageSize(),Math.max(0,Math.round(this.HorizontalScrollBar().GetPosition())));
      };
      return Result;
    };
    this.GetVScrollValue = function () {
      var Result = 0.0;
      if (this.FCustomScrollBars) {
        Result = Math.min(this.CustomVerticalScrollBar().FMax - this.CustomVerticalScrollBar().FPageSize,Math.max(0,this.CustomVerticalScrollBar().FValue))}
       else {
        Result = Math.min(this.VerticalScrollBar().FMax - this.VerticalScrollBar().GetPageSize(),Math.max(0,Math.round(this.VerticalScrollBar().GetPosition())));
      };
      return Result;
    };
    this.GetVViewPortSize = function () {
      var Result = 0.0;
      if (this.FCustomScrollBars) {
        Result = this.CustomVerticalScrollBar().FPageSize}
       else {
        Result = this.VerticalScrollBar().GetPageSize();
      };
      return Result;
    };
    this.GetHViewPortSize = function () {
      var Result = 0.0;
      if (this.FCustomScrollBars) {
        Result = this.CustomHorizontalScrollBar().FPageSize}
       else {
        Result = this.HorizontalScrollBar().GetPageSize();
      };
      return Result;
    };
    this.GetVMax = function () {
      var Result = 0.0;
      if (this.FCustomScrollBars) {
        Result = this.CustomVerticalScrollBar().FMax}
       else Result = this.VerticalScrollBar().FMax;
      return Result;
    };
    this.GetHMax = function () {
      var Result = 0.0;
      if (this.FCustomScrollBars) {
        Result = this.CustomHorizontalScrollBar().FMax}
       else Result = this.HorizontalScrollBar().FMax;
      return Result;
    };
    this.GetHVisible = function () {
      var Result = false;
      if (this.FCustomScrollBars) {
        Result = this.CustomHorizontalScrollBar().FVisible}
       else Result = this.HorizontalScrollBar().FVisible;
      return Result;
    };
    this.GetVVisible = function () {
      var Result = false;
      if (this.FCustomScrollBars) {
        Result = this.CustomVerticalScrollBar().FVisible}
       else Result = this.VerticalScrollBar().FVisible;
      return Result;
    };
    this.ProcessTouchScrolling = function (X, Y) {
      var Result = false;
      Result = this.FTouchScrolling;
      return Result;
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Create$1.apply(this,arguments);
      this.FTouchScrolling = false;
      this.FAnimateTimer = pas["WEBLib.ExtCtrls"].TTimer.$create("Create$1",[this]);
      this.FAnimateTimer.SetInterval(1);
      this.FAnimateTimer.SetEnabled(false);
      this.FAnimateTimer.FOnTimer = rtl.createCallback(this,"Animate");
      this.FDownTimer = pas["WEBLib.ExtCtrls"].TTimer.$create("Create$1",[this]);
      this.FDownTimer.SetInterval(1);
      this.FDownTimer.SetEnabled(false);
      this.FDownTimer.FOnTimer = rtl.createCallback(this,"DownTime");
      this.FApplyClipRect = true;
      this.FStretchScrollBars = true;
      this.FScrollMode = $mod.TTMSFNCCustomScrollControlMode.scmPixelScrolling;
      this.FScrollUpdate = $mod.TTMSFNCCustomScrollControlUpdate.scuContinuous;
      this.FCustomVerticalScrollBar = pas["WEBLib.TMSFNCScrollBar"].TTMSFNCScrollBar.$create("Create$1",[this]);
      this.FCustomVerticalScrollBar.SetParent(this);
      this.FCustomHorizontalScrollBar = pas["WEBLib.TMSFNCScrollBar"].TTMSFNCScrollBar.$create("Create$1",[this]);
      this.FCustomHorizontalScrollBar.SetParent(this);
      this.FVerticalScrollBar = pas["WEBLib.StdCtrls"].TScrollBar.$create("Create$1",[this]);
      this.FVerticalScrollBar.SetParent(this);
      this.FHorizontalScrollBar = pas["WEBLib.StdCtrls"].TScrollBar.$create("Create$1",[this]);
      this.FHorizontalScrollBar.SetParent(this);
      this.FCustomVerticalScrollBar.FAppearance.SetThumbButtonSize(0);
      this.FCustomHorizontalScrollBar.FAppearance.SetThumbButtonSize(0);
      this.FCustomHorizontalScrollBar.SetKind(pas["WEBLib.TMSFNCScrollBar"].TTMSFNCScrollBarKind.sbkHorizontal);
      this.FVerticalScrollBar.FDoubleBuffered = false;
      this.FHorizontalScrollBar.FDoubleBuffered = false;
      this.FVerticalScrollBar.SetKind(pas["WEBLib.Controls"].TScrollBarKind.sbVertical);
      this.FVerticalScrollBar.SetVisible(true);
      this.FHorizontalScrollBar.SetVisible(true);
      this.FCustomVerticalScrollBar.SetVisible(false);
      this.FCustomHorizontalScrollBar.SetVisible(false);
      this.FVerticalScrollBar.FOnChange = rtl.createCallback(this,"VScrollChanged");
      this.FHorizontalScrollBar.FOnChange = rtl.createCallback(this,"HScrollChanged");
      this.FCustomHorizontalScrollBar.FOnValueChange = rtl.createCallback(this,"HCustomScrollChanged");
      this.FCustomVerticalScrollBar.FOnValueChange = rtl.createCallback(this,"VCustomScrollChanged");
      this.FVerticalScrollBarVisible = true;
      this.FHorizontalScrollBarVisible = true;
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FCustomVerticalScrollBar");
      rtl.free(this,"FCustomHorizontalScrollBar");
      rtl.free(this,"FVerticalScrollBar");
      rtl.free(this,"FHorizontalScrollBar");
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Destroy.call(this);
    };
    this.Assign = function (Source) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Assign.apply(this,arguments);
      if ($mod.TTMSFNCCustomScrollControl.isPrototypeOf(Source)) {
        this.FStretchScrollBars = rtl.as(Source,$mod.TTMSFNCCustomScrollControl).FStretchScrollBars;
        this.FScrollMode = rtl.as(Source,$mod.TTMSFNCCustomScrollControl).FScrollMode;
        this.FScrollUpdate = rtl.as(Source,$mod.TTMSFNCCustomScrollControl).FScrollUpdate;
        this.FApplyClipRect = rtl.as(Source,$mod.TTMSFNCCustomScrollControl).FApplyClipRect;
      };
    };
    this.BeginUpdate = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBase.BeginUpdate.call(this);
      this.FUpdateCount$1 += 1;
    };
    this.EndUpdate = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBase.EndUpdate.call(this);
      this.FUpdateCount$1 -= 1;
      if (this.FUpdateCount$1 === 0) this.UpdateControl(true,true);
    };
    this.SaveScrollPosition = function () {
      this.FSaveHScrollPos = this.GetHScrollValue();
      this.FSaveVScrollPos = this.GetVScrollValue();
    };
    this.RestoreScrollPosition = function () {
      this.Scroll(this.FSaveHScrollPos,this.FSaveVScrollPos);
    };
    this.GetVerticalScrollPosition = function () {
      var Result = 0.0;
      var vVal = 0.0;
      vVal = this.GetVScrollValue();
      Result = vVal;
      return Result;
    };
    this.GetHorizontalScrollPosition = function () {
      var Result = 0.0;
      var hVal = 0.0;
      hVal = this.GetHScrollValue();
      Result = hVal;
      return Result;
    };
    this.GetHorizontalScrollMax = function () {
      var Result = 0.0;
      Result = this.GetHMax();
      return Result;
    };
    this.GetVerticalScrollMax = function () {
      var Result = 0.0;
      Result = this.GetVMax();
      return Result;
    };
    this.HorizontalScrollBar = function () {
      var Result = null;
      Result = this.FHorizontalScrollBar;
      return Result;
    };
    this.VerticalScrollBar = function () {
      var Result = null;
      Result = this.FVerticalScrollBar;
      return Result;
    };
    this.CustomHorizontalScrollBar = function () {
      var Result = null;
      Result = this.FCustomHorizontalScrollBar;
      return Result;
    };
    this.CustomVerticalScrollBar = function () {
      var Result = null;
      Result = this.FCustomVerticalScrollBar;
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  $mod.$implcode = function () {
    $impl.GetTickCountX = function () {
      var Result = 0;
      var h = 0;
      var m = 0;
      var s = 0;
      var ms = 0;
      pas.SysUtils.DecodeTime(pas.SysUtils.Now(),{get: function () {
          return h;
        }, set: function (v) {
          h = v;
        }},{get: function () {
          return m;
        }, set: function (v) {
          m = v;
        }},{get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},{get: function () {
          return ms;
        }, set: function (v) {
          ms = v;
        }});
      Result = ms + (s * 1000) + (m * 60 * 1000) + (h * 60 * 60 * 1000);
      return Result;
    };
    $impl.AnimateDouble = function (Start, Stop, Delta, Margin) {
      var Result = false;
      Result = true;
      if ((Start.get() > (Stop.get() - Margin)) && (Start.get() < (Stop.get() + Margin))) {
        Start.set(Stop.get());
        Result = false;
      } else {
        Delta = Math.max(Margin,Delta);
        if (Start.get() < Stop.get()) {
          Start.set(Start.get() + Delta)}
         else Start.set(Start.get() - Delta);
      };
      return Result;
    };
  };
},["WEBLib.Forms","Math","WEBLib.TMSFNCGraphicsTypes","SysUtils"]);
rtl.module("WEBLib.TMSFNCGridOptions",["System","Classes","WEBLib.TMSFNCGridDataUtil","WEBLib.TMSFNCGraphicsTypes"],function () {
  "use strict";
  var $mod = this;
  this.TTMSFNCGridTabKeyHandling = {"0": "tkhNextControl", tkhNextControl: 0, "1": "tkhNextCell", tkhNextCell: 1, "2": "tkhMixed", tkhMixed: 2};
  this.$rtti.$Enum("TTMSFNCGridTabKeyHandling",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCGridTabKeyHandling});
  this.TTMSFNCGridTabKeyDirection = {"0": "tkdNextColumnCell", tkdNextColumnCell: 0, "1": "tkdNextRowCell", tkdNextRowCell: 1};
  this.$rtti.$Enum("TTMSFNCGridTabKeyDirection",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCGridTabKeyDirection});
  this.TTMSFNCGridPrintPosition = {"0": "ppTopLeft", ppTopLeft: 0, "1": "ppTopCenter", ppTopCenter: 1, "2": "ppTopRight", ppTopRight: 2, "3": "ppBottomLeft", ppBottomLeft: 3, "4": "ppBottomCenter", ppBottomCenter: 4, "5": "ppBottomRight", ppBottomRight: 5};
  this.$rtti.$Enum("TTMSFNCGridPrintPosition",{minvalue: 0, maxvalue: 5, ordtype: 1, enumtype: this.TTMSFNCGridPrintPosition});
  this.TTMSFNCGridPrintCellBackground = {"0": "cbNone", cbNone: 0, "1": "cbCellColor", cbCellColor: 1, "2": "cbFull", cbFull: 2};
  this.$rtti.$Enum("TTMSFNCGridPrintCellBackground",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCGridPrintCellBackground});
  rtl.createClass(this,"TTMSFNCGridScrollBarOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FOnChange = null;
      this.FVerticalScrollBarVisible = false;
      this.FHorizontalScrollBarVisible = false;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetHorizontalScrollBarVisible = function (Value) {
      if (this.FHorizontalScrollBarVisible !== Value) {
        this.FHorizontalScrollBarVisible = Value;
        if (this.FOnChange != null) this.FOnChange(this);
      };
    };
    this.SetVerticalScrollBarVisible = function (Value) {
      if (this.FVerticalScrollBarVisible !== Value) {
        this.FVerticalScrollBarVisible = Value;
        if (this.FOnChange != null) this.FOnChange(this);
      };
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCGridScrollBarOptions.isPrototypeOf(Source)) {
        this.SetVerticalScrollBarVisible(rtl.as(Source,$mod.TTMSFNCGridScrollBarOptions).FVerticalScrollBarVisible);
        this.SetHorizontalScrollBarVisible(rtl.as(Source,$mod.TTMSFNCGridScrollBarOptions).FHorizontalScrollBarVisible);
      };
    };
    this.Create$1 = function () {
      this.FVerticalScrollBarVisible = true;
      this.FHorizontalScrollBarVisible = true;
      return this;
    };
    this.Destroy = function () {
      pas.System.TObject.Destroy.call(this);
    };
    var $r = this.$rtti;
    $r.addProperty("HorizontalScrollBarVisible",2,rtl.boolean,"FHorizontalScrollBarVisible","SetHorizontalScrollBarVisible",4,{Default: true});
    $r.addProperty("VerticalScrollBarVisible",2,rtl.boolean,"FVerticalScrollBarVisible","SetVerticalScrollBarVisible",4,{Default: true});
  });
  rtl.createClass(this,"TTMSFNCGridBandOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FEnabled = false;
      this.FOnChange = null;
      this.FBandRowCount = 0;
      this.FNormalRowCount = 0;
      this.FTotalRowCount = 0;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetEnabled = function (Value) {
      if (this.FEnabled !== Value) {
        this.FEnabled = Value;
        this.Changed();
      };
    };
    this.SetBandRowCount = function (Value) {
      if ((Value > 0) && (this.FBandRowCount !== Value)) {
        this.FBandRowCount = Value;
        this.FTotalRowCount = this.FNormalRowCount + this.FBandRowCount;
        this.Changed();
      };
    };
    this.SetNormalRowCount = function (Value) {
      if ((Value > 0) && (this.FNormalRowCount !== Value)) {
        this.FNormalRowCount = Value;
        this.FTotalRowCount = this.FNormalRowCount + this.FBandRowCount;
        this.Changed();
      };
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCGridBandOptions.isPrototypeOf(Source)) {
        this.FEnabled = rtl.as(Source,$mod.TTMSFNCGridBandOptions).FEnabled;
      };
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FEnabled = false;
      this.FNormalRowCount = 1;
      this.FBandRowCount = 1;
      return this;
    };
    this.Changed = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    var $r = this.$rtti;
    $r.addProperty("NormalRowCount",2,rtl.longint,"FNormalRowCount","SetNormalRowCount",4,{Default: 1});
    $r.addProperty("BandRowCount",2,rtl.longint,"FBandRowCount","SetBandRowCount",4,{Default: 1});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: false});
    $r.addProperty("OnChange",0,pas.Classes.$rtti["TNotifyEvent"],"FOnChange","FOnChange");
  });
  this.TTMSFNCGridSelectionMode = {"0": "smNone", smNone: 0, "1": "smSingleCell", smSingleCell: 1, "2": "smSingleRow", smSingleRow: 2, "3": "smSingleColumn", smSingleColumn: 3, "4": "smCellRange", smCellRange: 4, "5": "smRowRange", smRowRange: 5, "6": "smColumnRange", smColumnRange: 6, "7": "smDisjunctRow", smDisjunctRow: 7, "8": "smDisjunctColumn", smDisjunctColumn: 8, "9": "smDisjunctCell", smDisjunctCell: 9};
  this.$rtti.$Enum("TTMSFNCGridSelectionMode",{minvalue: 0, maxvalue: 9, ordtype: 1, enumtype: this.TTMSFNCGridSelectionMode});
  rtl.createClass(this,"TTMSFNCGridSelection",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FMode = 0;
      this.FOnChange = null;
      this.FShowSelectionInFixedCells = false;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetMode = function (Value) {
      if (this.FMode !== Value) {
        this.FMode = Value;
        this.Changed();
      };
    };
    this.SetShowSelectionInFixedCells = function (Value) {
      if (this.FShowSelectionInFixedCells !== Value) {
        this.FShowSelectionInFixedCells = Value;
        this.Changed();
      };
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCGridSelection.isPrototypeOf(Source)) {
        this.FMode = rtl.as(Source,$mod.TTMSFNCGridSelection).FMode;
        this.FShowSelectionInFixedCells = rtl.as(Source,$mod.TTMSFNCGridSelection).FShowSelectionInFixedCells;
      };
    };
    this.Create$1 = function () {
      this.FMode = $mod.TTMSFNCGridSelectionMode.smSingleCell;
      return this;
    };
    this.Changed = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    var $r = this.$rtti;
    $r.addProperty("Mode",2,$mod.$rtti["TTMSFNCGridSelectionMode"],"FMode","SetMode",4,{Default: $mod.TTMSFNCGridSelectionMode.smSingleCell});
    $r.addProperty("ShowSelectionInFixedCells",2,rtl.boolean,"FShowSelectionInFixedCells","SetShowSelectionInFixedCells",4,{Default: false});
    $r.addProperty("OnChange",0,pas.Classes.$rtti["TNotifyEvent"],"FOnChange","FOnChange");
  });
  this.TTMSFNCGridFixedCellSelectionMode = {"0": "fcsAll", fcsAll: 0, "1": "fcsRow", fcsRow: 1, "2": "fcsColumn", fcsColumn: 2, "3": "fcsRowRange", fcsRowRange: 3, "4": "fcsColumnRange", fcsColumnRange: 4, "5": "fcsDisjunctRow", fcsDisjunctRow: 5, "6": "fcsDisjunctColumn", fcsDisjunctColumn: 6};
  this.$rtti.$Enum("TTMSFNCGridFixedCellSelectionMode",{minvalue: 0, maxvalue: 6, ordtype: 1, enumtype: this.TTMSFNCGridFixedCellSelectionMode});
  this.$rtti.$Set("TTMSFNCGridFixedCellSelection",{comptype: this.$rtti["TTMSFNCGridFixedCellSelectionMode"]});
  this.TTMSFNCGridAutoScrollingSpeedMode = {"0": "asmPixels", asmPixels: 0, "1": "asmCell", asmCell: 1};
  this.$rtti.$Enum("TTMSFNCGridAutoScrollingSpeedMode",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCGridAutoScrollingSpeedMode});
  rtl.createClass(this,"TTMSFNCGridMouseOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FDirectEdit = false;
      this.FWheelScrollSize = 0;
      this.FAutoDragging = false;
      this.FFixedRowSizing = false;
      this.FFixedColumnSizing = false;
      this.FRowDragging = false;
      this.FColumnDragging = false;
      this.FAutoScrollingInterval = 0;
      this.FRowSizing = false;
      this.FColumnSizing = false;
      this.FAutoScrollingSpeed = 0;
      this.FAutoScrolling = false;
      this.FTouchScrolling = false;
      this.FTouchScrollingSensitivity = 0.0;
      this.FFixedCellSelection = {};
      this.FRowAutoSizeOnDblClick = false;
      this.FColumnAutoSizeOnDblClick = false;
      this.FWheelScrollKeepSelection = false;
      this.FRowSizeMargin = 0;
      this.FColumnSizeMargin = 0;
      this.FAutoScrollingSpeedMode = 0;
      this.FClickMargin = 0;
    };
    this.$final = function () {
      this.FFixedCellSelection = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetWheelScrollSize = function (Value) {
      this.FWheelScrollSize = Value;
    };
    this.SetAutoScrollingInterval = function (Value) {
      this.FAutoScrollingInterval = Value;
    };
    this.SetTouchScrolling = function (Value) {
      this.FTouchScrolling = Value;
    };
    this.SetWheelScrollKeepSelection = function (Value) {
      this.FWheelScrollKeepSelection = Value;
    };
    this.IsTouchScrollingSensitivityStored = function () {
      var Result = false;
      Result = this.FTouchScrollingSensitivity !== 1;
      return Result;
    };
    this.SetColumnSizeMargin = function (Value) {
      this.FColumnSizeMargin = Value;
    };
    this.SetRowSizeMargin = function (Value) {
      this.FRowSizeMargin = Value;
    };
    this.SetClickMargin = function (Value) {
      this.FClickMargin = Value;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCGridMouseOptions.isPrototypeOf(Source)) {
        this.FDirectEdit = rtl.as(Source,$mod.TTMSFNCGridMouseOptions).FDirectEdit;
        this.FWheelScrollSize = rtl.as(Source,$mod.TTMSFNCGridMouseOptions).FWheelScrollSize;
        this.FColumnSizing = rtl.as(Source,$mod.TTMSFNCGridMouseOptions).FColumnSizing;
        this.FRowSizing = rtl.as(Source,$mod.TTMSFNCGridMouseOptions).FRowSizing;
        this.FFixedColumnSizing = rtl.as(Source,$mod.TTMSFNCGridMouseOptions).FFixedColumnSizing;
        this.FFixedRowSizing = rtl.as(Source,$mod.TTMSFNCGridMouseOptions).FFixedRowSizing;
        this.FColumnDragging = rtl.as(Source,$mod.TTMSFNCGridMouseOptions).FColumnDragging;
        this.FRowDragging = rtl.as(Source,$mod.TTMSFNCGridMouseOptions).FRowDragging;
        this.FAutoScrolling = rtl.as(Source,$mod.TTMSFNCGridMouseOptions).FAutoScrolling;
        this.FAutoDragging = rtl.as(Source,$mod.TTMSFNCGridMouseOptions).FAutoDragging;
        this.FAutoScrollingSpeed = rtl.as(Source,$mod.TTMSFNCGridMouseOptions).FAutoScrollingSpeed;
        this.FAutoScrollingInterval = rtl.as(Source,$mod.TTMSFNCGridMouseOptions).FAutoScrollingInterval;
        this.FTouchScrolling = rtl.as(Source,$mod.TTMSFNCGridMouseOptions).FTouchScrolling;
        this.FTouchScrollingSensitivity = rtl.as(Source,$mod.TTMSFNCGridMouseOptions).FTouchScrollingSensitivity;
        this.FFixedCellSelection = rtl.refSet(rtl.as(Source,$mod.TTMSFNCGridMouseOptions).FFixedCellSelection);
        this.FRowAutoSizeOnDblClick = rtl.as(Source,$mod.TTMSFNCGridMouseOptions).FRowAutoSizeOnDblClick;
        this.FColumnAutoSizeOnDblClick = rtl.as(Source,$mod.TTMSFNCGridMouseOptions).FColumnAutoSizeOnDblClick;
        this.FWheelScrollKeepSelection = rtl.as(Source,$mod.TTMSFNCGridMouseOptions).FWheelScrollKeepSelection;
        this.FColumnSizeMargin = rtl.as(Source,$mod.TTMSFNCGridMouseOptions).FColumnSizeMargin;
        this.FClickMargin = rtl.as(Source,$mod.TTMSFNCGridMouseOptions).FClickMargin;
        this.FRowSizeMargin = rtl.as(Source,$mod.TTMSFNCGridMouseOptions).FRowSizeMargin;
        this.FAutoScrollingSpeedMode = rtl.as(Source,$mod.TTMSFNCGridMouseOptions).FAutoScrollingSpeedMode;
      };
    };
    this.Create$1 = function () {
      this.FTouchScrollingSensitivity = 1;
      this.FTouchScrolling = false;
      this.FDirectEdit = false;
      this.FWheelScrollSize = 4;
      this.FColumnSizing = false;
      this.FRowSizing = false;
      this.FFixedColumnSizing = false;
      this.FFixedRowSizing = false;
      this.FColumnDragging = false;
      this.FRowDragging = false;
      this.FAutoScrolling = true;
      this.FAutoDragging = true;
      this.FAutoScrollingSpeed = 1;
      this.FAutoScrollingInterval = 100;
      this.FFixedCellSelection = {};
      this.FRowAutoSizeOnDblClick = true;
      this.FColumnAutoSizeOnDblClick = true;
      this.FWheelScrollKeepSelection = false;
      this.FColumnSizeMargin = 6;
      this.FRowSizeMargin = 6;
      this.FAutoScrollingSpeedMode = $mod.TTMSFNCGridAutoScrollingSpeedMode.asmPixels;
      return this;
    };
    var $r = this.$rtti;
    $r.addProperty("DirectEdit",0,rtl.boolean,"FDirectEdit","FDirectEdit",4,{Default: false});
    $r.addProperty("WheelScrollSize",2,rtl.longint,"FWheelScrollSize","SetWheelScrollSize",4,{Default: 4});
    $r.addProperty("WheelScrollKeepSelection",2,rtl.boolean,"FWheelScrollKeepSelection","SetWheelScrollKeepSelection",4,{Default: false});
    $r.addProperty("ColumnSizing",0,rtl.boolean,"FColumnSizing","FColumnSizing",4,{Default: false});
    $r.addProperty("ClickMargin",2,rtl.longint,"FClickMargin","SetClickMargin",4,{Default: 2});
    $r.addProperty("ColumnSizeMargin",2,rtl.longint,"FColumnSizeMargin","SetColumnSizeMargin",4,{Default: 2});
    $r.addProperty("RowSizing",0,rtl.boolean,"FRowSizing","FRowSizing",4,{Default: false});
    $r.addProperty("RowSizeMargin",2,rtl.longint,"FRowSizeMargin","SetRowSizeMargin",4,{Default: 2});
    $r.addProperty("FixedColumnSizing",0,rtl.boolean,"FFixedColumnSizing","FFixedColumnSizing",4,{Default: false});
    $r.addProperty("FixedRowSizing",0,rtl.boolean,"FFixedRowSizing","FFixedRowSizing",4,{Default: false});
    $r.addProperty("FixedCellSelection",0,$mod.$rtti["TTMSFNCGridFixedCellSelection"],"FFixedCellSelection","FFixedCellSelection",4,{Default: {}});
    $r.addProperty("ColumnAutoSizeOnDblClick",0,rtl.boolean,"FColumnAutoSizeOnDblClick","FColumnAutoSizeOnDblClick",4,{Default: true});
    $r.addProperty("RowAutoSizeOnDblClick",0,rtl.boolean,"FRowAutoSizeOnDblClick","FRowAutoSizeOnDblClick",4,{Default: true});
    $r.addProperty("ColumnDragging",0,rtl.boolean,"FColumnDragging","FColumnDragging",4,{Default: false});
    $r.addProperty("RowDragging",0,rtl.boolean,"FRowDragging","FRowDragging",4,{Default: false});
    $r.addProperty("AutoScrolling",0,rtl.boolean,"FAutoScrolling","FAutoScrolling",4,{Default: true});
    $r.addProperty("AutoDragging",0,rtl.boolean,"FAutoDragging","FAutoDragging",4,{Default: true});
    $r.addProperty("AutoScrollingSpeedMode",0,$mod.$rtti["TTMSFNCGridAutoScrollingSpeedMode"],"FAutoScrollingSpeedMode","FAutoScrollingSpeedMode",4,{Default: $mod.TTMSFNCGridAutoScrollingSpeedMode.asmPixels});
    $r.addProperty("AutoScrollingSpeed",0,rtl.longint,"FAutoScrollingSpeed","FAutoScrollingSpeed",4,{Default: 1});
    $r.addProperty("AutoScrollingInterval",2,rtl.longint,"FAutoScrollingInterval","SetAutoScrollingInterval",4,{Default: 100});
    $r.addProperty("TouchScrolling",2,rtl.boolean,"FTouchScrolling","SetTouchScrolling",4,{Default: false});
    $r.addProperty("TouchScrollingSensitivity",12,rtl.double,"FTouchScrollingSensitivity","FTouchScrollingSensitivity",4,{stored: "IsTouchScrollingSensitivityStored"});
  });
  this.TTMSFNCGridInsertKeyHandling = {"0": "ikhNone", ikhNone: 0, "1": "ikhInsertRowBefore", ikhInsertRowBefore: 1, "2": "ikhInsertRowAfter", ikhInsertRowAfter: 2};
  this.$rtti.$Enum("TTMSFNCGridInsertKeyHandling",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCGridInsertKeyHandling});
  this.TTMSFNCGridEnterKeyHandling = {"0": "ekhNone", ekhNone: 0, "1": "ekhNextColumn", ekhNextColumn: 1, "2": "ekhNextRow", ekhNextRow: 2, "3": "ekhNextColumnInRow", ekhNextColumnInRow: 3, "4": "ekhNextRowInColumn", ekhNextRowInColumn: 4, "5": "ekhNextColumnAndAppend", ekhNextColumnAndAppend: 5, "6": "ekhNextRowAndAppend", ekhNextRowAndAppend: 6, "7": "ekhNextRowAndColumnAppend", ekhNextRowAndColumnAppend: 7, "8": "ekhNextColumnAndRowAppend", ekhNextColumnAndRowAppend: 8};
  this.$rtti.$Enum("TTMSFNCGridEnterKeyHandling",{minvalue: 0, maxvalue: 8, ordtype: 1, enumtype: this.TTMSFNCGridEnterKeyHandling});
  this.TTMSFNCGridDeleteKeyHandling = {"0": "dkhNone", dkhNone: 0, "1": "dkhDeleteRow", dkhDeleteRow: 1};
  this.$rtti.$Enum("TTMSFNCGridDeleteKeyHandling",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCGridDeleteKeyHandling});
  rtl.createClass(this,"TTMSFNCGridKeyboardOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FTabKeyDirection = 0;
      this.FTabKeyHandling = 0;
      this.FPageScrollSize = 0;
      this.FEnterKeyHandling = 0;
      this.FEnterKeyDirectEdit = false;
      this.FDeleteKeyHandling = 0;
      this.FInsertKeyHandling = 0;
      this.FTabKeyDirectEdit = false;
      this.FArrowKeyDirectEdit = false;
      this.FAllowCellMergeShortCut = false;
    };
    this.SetPageScrollSize = function (Value) {
      this.FPageScrollSize = Value;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCGridKeyboardOptions.isPrototypeOf(Source)) {
        this.FTabKeyDirection = rtl.as(Source,$mod.TTMSFNCGridKeyboardOptions).FTabKeyDirection;
        this.FTabKeyHandling = rtl.as(Source,$mod.TTMSFNCGridKeyboardOptions).FTabKeyHandling;
        this.FEnterKeyHandling = rtl.as(Source,$mod.TTMSFNCGridKeyboardOptions).FEnterKeyHandling;
        this.FDeleteKeyHandling = rtl.as(Source,$mod.TTMSFNCGridKeyboardOptions).FDeleteKeyHandling;
        this.FInsertKeyHandling = rtl.as(Source,$mod.TTMSFNCGridKeyboardOptions).FInsertKeyHandling;
        this.FEnterKeyDirectEdit = rtl.as(Source,$mod.TTMSFNCGridKeyboardOptions).FEnterKeyDirectEdit;
        this.FTabKeyDirectEdit = rtl.as(Source,$mod.TTMSFNCGridKeyboardOptions).FTabKeyDirectEdit;
        this.FArrowKeyDirectEdit = rtl.as(Source,$mod.TTMSFNCGridKeyboardOptions).FArrowKeyDirectEdit;
        this.FAllowCellMergeShortCut = rtl.as(Source,$mod.TTMSFNCGridKeyboardOptions).FAllowCellMergeShortCut;
      };
    };
    this.Create$1 = function () {
      this.FTabKeyDirection = $mod.TTMSFNCGridTabKeyDirection.tkdNextColumnCell;
      this.FTabKeyHandling = $mod.TTMSFNCGridTabKeyHandling.tkhMixed;
      this.FPageScrollSize = 0;
      this.FEnterKeyHandling = $mod.TTMSFNCGridEnterKeyHandling.ekhNone;
      this.FDeleteKeyHandling = $mod.TTMSFNCGridDeleteKeyHandling.dkhNone;
      this.FInsertKeyHandling = $mod.TTMSFNCGridInsertKeyHandling.ikhNone;
      this.FEnterKeyDirectEdit = false;
      this.FArrowKeyDirectEdit = false;
      this.FTabKeyDirectEdit = false;
      this.FAllowCellMergeShortCut = false;
      return this;
    };
    var $r = this.$rtti;
    $r.addProperty("AllowCellMergeShortCut",0,rtl.boolean,"FAllowCellMergeShortCut","FAllowCellMergeShortCut",4,{Default: false});
    $r.addProperty("TabKeyDirectEdit",0,rtl.boolean,"FTabKeyDirectEdit","FTabKeyDirectEdit",4,{Default: false});
    $r.addProperty("ArrowKeyDirectEdit",0,rtl.boolean,"FArrowKeyDirectEdit","FArrowKeyDirectEdit",4,{Default: false});
    $r.addProperty("InsertKeyHandling",0,$mod.$rtti["TTMSFNCGridInsertKeyHandling"],"FInsertKeyHandling","FInsertKeyHandling",4,{Default: $mod.TTMSFNCGridInsertKeyHandling.ikhNone});
    $r.addProperty("DeleteKeyHandling",0,$mod.$rtti["TTMSFNCGridDeleteKeyHandling"],"FDeleteKeyHandling","FDeleteKeyHandling",4,{Default: $mod.TTMSFNCGridDeleteKeyHandling.dkhNone});
    $r.addProperty("EnterKeyHandling",0,$mod.$rtti["TTMSFNCGridEnterKeyHandling"],"FEnterKeyHandling","FEnterKeyHandling",4,{Default: $mod.TTMSFNCGridEnterKeyHandling.ekhNone});
    $r.addProperty("EnterKeyDirectEdit",0,rtl.boolean,"FEnterKeyDirectEdit","FEnterKeyDirectEdit",4,{Default: false});
    $r.addProperty("TabKeyHandling",0,$mod.$rtti["TTMSFNCGridTabKeyHandling"],"FTabKeyHandling","FTabKeyHandling",4,{Default: $mod.TTMSFNCGridTabKeyHandling.tkhMixed});
    $r.addProperty("TabKeyDirection",0,$mod.$rtti["TTMSFNCGridTabKeyDirection"],"FTabKeyDirection","FTabKeyDirection",4,{Default: $mod.TTMSFNCGridTabKeyDirection.tkdNextColumnCell});
    $r.addProperty("PageScrollSize",2,rtl.longint,"FPageScrollSize","SetPageScrollSize",4,{Default: 0});
  });
  this.TTMSFNCGridSortBlankPosition = {"0": "blFirst", blFirst: 0, "1": "blLast", blLast: 1};
  this.$rtti.$Enum("TTMSFNCGridSortBlankPosition",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCGridSortBlankPosition});
  this.TTMSFNCGridSortingMode = {"0": "gsmNone", gsmNone: 0, "1": "gsmNormal", gsmNormal: 1, "2": "gsmIndexed", gsmIndexed: 2};
  this.$rtti.$Enum("TTMSFNCGridSortingMode",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCGridSortingMode});
  this.TTMSFNCGridSortColumns = {"0": "scAll", scAll: 0, "1": "scNormal", scNormal: 1, "2": "scSingle", scSingle: 2};
  this.$rtti.$Enum("TTMSFNCGridSortColumns",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCGridSortColumns});
  this.TTMSFNCGridBorders = {"0": "bNone", bNone: 0, "1": "bAll", bAll: 1, "2": "bVertical", bVertical: 2, "3": "bHorizontal", bHorizontal: 3};
  this.$rtti.$Enum("TTMSFNCGridBorders",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TTMSFNCGridBorders});
  rtl.createClass(this,"TTMSFNCGridSortingOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FMode = 0;
      this.FRow = 0;
      this.FColumns = 0;
      this.FMultiColumn = false;
      this.FIgnoreCase = false;
      this.FIgnoreBlanks = false;
      this.FBlankPosition = 0;
    };
    this.SetMode = function (Value) {
      this.FMode = Value;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCGridSortingOptions.isPrototypeOf(Source)) {
        this.FMultiColumn = rtl.as(Source,$mod.TTMSFNCGridSortingOptions).FMultiColumn;
        this.FMode = rtl.as(Source,$mod.TTMSFNCGridSortingOptions).FMode;
        this.FColumns = rtl.as(Source,$mod.TTMSFNCGridSortingOptions).FColumns;
        this.FRow = rtl.as(Source,$mod.TTMSFNCGridSortingOptions).FRow;
        this.FBlankPosition = rtl.as(Source,$mod.TTMSFNCGridSortingOptions).FBlankPosition;
        this.FIgnoreCase = rtl.as(Source,$mod.TTMSFNCGridSortingOptions).FIgnoreCase;
        this.FIgnoreBlanks = rtl.as(Source,$mod.TTMSFNCGridSortingOptions).FIgnoreBlanks;
      };
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FMode = $mod.TTMSFNCGridSortingMode.gsmNone;
      this.FMultiColumn = true;
      this.FRow = 0;
      return this;
    };
    var $r = this.$rtti;
    $r.addProperty("BlankPosition",0,$mod.$rtti["TTMSFNCGridSortBlankPosition"],"FBlankPosition","FBlankPosition",4,{Default: $mod.TTMSFNCGridSortBlankPosition.blFirst});
    $r.addProperty("Row",0,rtl.longint,"FRow","FRow",4,{Default: 0});
    $r.addProperty("IgnoreCase",0,rtl.boolean,"FIgnoreCase","FIgnoreCase",4,{Default: false});
    $r.addProperty("IgnoreBlanks",0,rtl.boolean,"FIgnoreBlanks","FIgnoreBlanks",4,{Default: false});
    $r.addProperty("MultiColumn",0,rtl.boolean,"FMultiColumn","FMultiColumn",4,{Default: true});
    $r.addProperty("Mode",2,$mod.$rtti["TTMSFNCGridSortingMode"],"FMode","SetMode",4,{Default: $mod.TTMSFNCGridSortingMode.gsmNone});
    $r.addProperty("Columns",0,$mod.$rtti["TTMSFNCGridSortColumns"],"FColumns","FColumns",4,{Default: $mod.TTMSFNCGridSortColumns.scAll});
  });
  rtl.createClass(this,"TTMSFNCGridBorderOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FFixedCellBorders = 0;
      this.FCellBorders = 0;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCGridBorderOptions.isPrototypeOf(Source)) {
        this.FFixedCellBorders = rtl.as(Source,$mod.TTMSFNCGridBorderOptions).FFixedCellBorders;
        this.FCellBorders = rtl.as(Source,$mod.TTMSFNCGridBorderOptions).FCellBorders;
      };
    };
    this.Create$1 = function () {
      this.FFixedCellBorders = $mod.TTMSFNCGridBorders.bAll;
      this.FCellBorders = $mod.TTMSFNCGridBorders.bAll;
      return this;
    };
    var $r = this.$rtti;
    $r.addProperty("FixedCellBorders",0,$mod.$rtti["TTMSFNCGridBorders"],"FFixedCellBorders","FFixedCellBorders",4,{Default: $mod.TTMSFNCGridBorders.bAll});
    $r.addProperty("CellBorders",0,$mod.$rtti["TTMSFNCGridBorders"],"FCellBorders","FCellBorders",4,{Default: $mod.TTMSFNCGridBorders.bAll});
  });
  this.TTMSFNCGridAutoComplete = {"0": "acDisabled", acDisabled: 0, "1": "acNormal", acNormal: 1, "2": "acLookupList", acLookupList: 2};
  this.$rtti.$Enum("TTMSFNCGridAutoComplete",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCGridAutoComplete});
  this.TTMSFNCGridAutoPost = {"0": "apNone", apNone: 0, "1": "apCell", apCell: 1, "2": "apRow", apRow: 2};
  this.$rtti.$Enum("TTMSFNCGridAutoPost",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCGridAutoPost});
  rtl.createClass(this,"TTMSFNCGridEditingOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FEnabled = false;
      this.FAutoComplete = 0;
      this.FAutoCompleteItems = null;
      this.FAutoHistory = false;
      this.FAutoCompleteCaseSensitive = false;
      this.FCalcFormat = "";
      this.FAutoPost = 0;
      this.FAutoCancel = false;
      this.FDirectComboClose = false;
      this.FDirectComboDrop = false;
      this.FEditWithTags = false;
    };
    this.$final = function () {
      this.FAutoCompleteItems = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetAutoCompleteItems = function (Value) {
      this.FAutoCompleteItems.Assign(Value);
    };
    this.SetAutoPost = function (Value) {
      this.FAutoPost = Value;
    };
    this.SetAutoCancel = function (Value) {
      this.FAutoCancel = Value;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCGridEditingOptions.isPrototypeOf(Source)) {
        this.FEnabled = rtl.as(Source,$mod.TTMSFNCGridEditingOptions).FEnabled;
        this.FAutoComplete = rtl.as(Source,$mod.TTMSFNCGridEditingOptions).FAutoComplete;
        this.FAutoCompleteItems.Assign(rtl.as(Source,$mod.TTMSFNCGridEditingOptions).FAutoCompleteItems);
        this.FAutoHistory = rtl.as(Source,$mod.TTMSFNCGridEditingOptions).FAutoHistory;
        this.FAutoCompleteCaseSensitive = rtl.as(Source,$mod.TTMSFNCGridEditingOptions).FAutoCompleteCaseSensitive;
        this.FCalcFormat = rtl.as(Source,$mod.TTMSFNCGridEditingOptions).FCalcFormat;
        this.FAutoPost = rtl.as(Source,$mod.TTMSFNCGridEditingOptions).FAutoPost;
        this.FAutoCancel = rtl.as(Source,$mod.TTMSFNCGridEditingOptions).FAutoCancel;
        this.FEditWithTags = rtl.as(Source,$mod.TTMSFNCGridEditingOptions).FEditWithTags;
      };
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FEnabled = true;
      this.FAutoCompleteItems = pas.Classes.TStringList.$create("Create$1");
      this.FAutoCompleteItems.FDuplicates = pas.Types.TDuplicates.dupIgnore;
      this.FAutoComplete = $mod.TTMSFNCGridAutoComplete.acDisabled;
      this.FAutoHistory = false;
      this.FAutoCompleteCaseSensitive = true;
      this.FCalcFormat = "%g";
      this.FAutoPost = $mod.TTMSFNCGridAutoPost.apCell;
      this.FAutoCancel = false;
      this.FEditWithTags = true;
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FAutoCompleteItems");
      pas.System.TObject.Destroy.call(this);
    };
    var $r = this.$rtti;
    $r.addProperty("AutoCancel",2,rtl.boolean,"FAutoCancel","SetAutoCancel",4,{Default: false});
    $r.addProperty("AutoComplete",0,$mod.$rtti["TTMSFNCGridAutoComplete"],"FAutoComplete","FAutoComplete",4,{Default: $mod.TTMSFNCGridAutoComplete.acDisabled});
    $r.addProperty("AutoCompleteCaseSensitive",0,rtl.boolean,"FAutoCompleteCaseSensitive","FAutoCompleteCaseSensitive",4,{Default: true});
    $r.addProperty("AutoCompleteItems",2,pas.Classes.$rtti["TStringList"],"FAutoCompleteItems","SetAutoCompleteItems");
    $r.addProperty("AutoHistory",0,rtl.boolean,"FAutoHistory","FAutoHistory",4,{Default: false});
    $r.addProperty("AutoPost",2,$mod.$rtti["TTMSFNCGridAutoPost"],"FAutoPost","SetAutoPost",4,{Default: $mod.TTMSFNCGridAutoPost.apCell});
    $r.addProperty("CalcFormat",0,rtl.string,"FCalcFormat","FCalcFormat");
    $r.addProperty("DirectComboDrop",0,rtl.boolean,"FDirectComboDrop","FDirectComboDrop",4,{Default: false});
    $r.addProperty("DirectComboClose",0,rtl.boolean,"FDirectComboClose","FDirectComboClose",4,{Default: false});
    $r.addProperty("Enabled",0,rtl.boolean,"FEnabled","FEnabled",4,{Default: true});
    $r.addProperty("EditWithTags",0,rtl.boolean,"FEditWithTags","FEditWithTags",4,{Default: true});
  });
  rtl.createClass(this,"TTMSFNCGridLookupOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FCaseSensitive = false;
      this.FIncremental = false;
      this.FEnabled = false;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCGridLookupOptions.isPrototypeOf(Source)) {
        this.FCaseSensitive = rtl.as(Source,$mod.TTMSFNCGridLookupOptions).FCaseSensitive;
        this.FIncremental = rtl.as(Source,$mod.TTMSFNCGridLookupOptions).FIncremental;
        this.FEnabled = rtl.as(Source,$mod.TTMSFNCGridLookupOptions).FEnabled;
      };
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FCaseSensitive = false;
      this.FIncremental = true;
      return this;
    };
    var $r = this.$rtti;
    $r.addProperty("CaseSensitive",0,rtl.boolean,"FCaseSensitive","FCaseSensitive",4,{Default: false});
    $r.addProperty("Enabled",0,rtl.boolean,"FEnabled","FEnabled",4,{Default: false});
    $r.addProperty("Incremental",0,rtl.boolean,"FIncremental","FIncremental",4,{Default: true});
  });
  this.TTMSFNCGridFilterRows = {"0": "frNormal", frNormal: 0, "1": "frAll", frAll: 1};
  this.$rtti.$Enum("TTMSFNCGridFilterRows",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCGridFilterRows});
  rtl.createClass(this,"TTMSFNCGridFilteringOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FRows = 0;
      this.FDropDownFixedRow = 0;
      this.FDropDown = false;
      this.FOnChange = null;
      this.FDropDownHeight = 0;
      this.FDropDownWidth = 0;
      this.FMultiColumn = false;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetDropDown = function (Value) {
      if (this.FDropDown !== Value) {
        this.FDropDown = Value;
        this.Changed();
      };
    };
    this.SetDropDownFixedRow = function (Value) {
      if (this.FDropDownFixedRow !== Value) {
        this.FDropDownFixedRow = Value;
        this.Changed();
      };
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FRows = $mod.TTMSFNCGridFilterRows.frNormal;
      this.FDropDown = false;
      this.FDropDownFixedRow = 0;
      this.FDropDownWidth = 100;
      this.FDropDownHeight = 120;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCGridFilteringOptions.isPrototypeOf(Source)) {
        this.FRows = rtl.as(Source,$mod.TTMSFNCGridFilteringOptions).FRows;
        this.FDropDown = rtl.as(Source,$mod.TTMSFNCGridFilteringOptions).FDropDown;
        this.FDropDownFixedRow = rtl.as(Source,$mod.TTMSFNCGridFilteringOptions).FDropDownFixedRow;
        this.FDropDownWidth = rtl.as(Source,$mod.TTMSFNCGridFilteringOptions).FDropDownWidth;
        this.FDropDownHeight = rtl.as(Source,$mod.TTMSFNCGridFilteringOptions).FDropDownHeight;
        this.FMultiColumn = rtl.as(Source,$mod.TTMSFNCGridFilteringOptions).FMultiColumn;
      };
    };
    this.Changed = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    var $r = this.$rtti;
    $r.addProperty("Rows",0,$mod.$rtti["TTMSFNCGridFilterRows"],"FRows","FRows",4,{Default: $mod.TTMSFNCGridFilterRows.frNormal});
    $r.addProperty("DropDown",2,rtl.boolean,"FDropDown","SetDropDown",4,{Default: false});
    $r.addProperty("DropDownFixedRow",2,rtl.longint,"FDropDownFixedRow","SetDropDownFixedRow",4,{Default: 0});
    $r.addProperty("DropDownWidth",0,rtl.longint,"FDropDownWidth","FDropDownWidth",4,{Default: 100});
    $r.addProperty("DropDownHeight",0,rtl.longint,"FDropDownHeight","FDropDownHeight",4,{Default: 120});
    $r.addProperty("MultiColumn",0,rtl.boolean,"FMultiColumn","FMultiColumn",4,{Default: false});
    $r.addProperty("OnChange",0,pas.Classes.$rtti["TNotifyEvent"],"FOnChange","FOnChange");
  });
  rtl.createClass(this,"TTMSFNCGridGroupingOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FMergeHeader = false;
      this.FMergeSummary = false;
      this.FSummary = false;
      this.FShowGroupCount = false;
      this.FCalcFormat = "";
      this.FAutoSelectGroup = false;
      this.FAutoCheckGroup = false;
      this.FGroupCountFormat = "";
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FCalcFormat = "%g";
      this.FGroupCountFormat = "(%d)";
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCGridGroupingOptions.isPrototypeOf(Source)) {
        this.FCalcFormat = rtl.as(Source,$mod.TTMSFNCGridGroupingOptions).FCalcFormat;
        this.FMergeHeader = rtl.as(Source,$mod.TTMSFNCGridGroupingOptions).FMergeHeader;
        this.FMergeSummary = rtl.as(Source,$mod.TTMSFNCGridGroupingOptions).FMergeSummary;
        this.FShowGroupCount = rtl.as(Source,$mod.TTMSFNCGridGroupingOptions).FShowGroupCount;
        this.FAutoCheckGroup = rtl.as(Source,$mod.TTMSFNCGridGroupingOptions).FAutoCheckGroup;
        this.FAutoSelectGroup = rtl.as(Source,$mod.TTMSFNCGridGroupingOptions).FAutoSelectGroup;
        this.FGroupCountFormat = rtl.as(Source,$mod.TTMSFNCGridGroupingOptions).FGroupCountFormat;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("AutoSelectGroup",0,rtl.boolean,"FAutoSelectGroup","FAutoSelectGroup",4,{Default: false});
    $r.addProperty("AutoCheckGroup",0,rtl.boolean,"FAutoCheckGroup","FAutoCheckGroup",4,{Default: false});
    $r.addProperty("CalcFormat",0,rtl.string,"FCalcFormat","FCalcFormat");
    $r.addProperty("MergeHeader",0,rtl.boolean,"FMergeHeader","FMergeHeader",4,{Default: false});
    $r.addProperty("MergeSummary",0,rtl.boolean,"FMergeSummary","FMergeSummary",4,{Default: false});
    $r.addProperty("ShowGroupCount",0,rtl.boolean,"FShowGroupCount","FShowGroupCount",4,{Default: false});
    $r.addProperty("GroupCountFormat",0,rtl.string,"FGroupCountFormat","FGroupCountFormat");
    $r.addProperty("Summary",0,rtl.boolean,"FSummary","FSummary",4,{Default: false});
  });
  this.TTMSFNCGridClipboardPasteAction = {"0": "paReplace", paReplace: 0, "1": "paInsert", paInsert: 1};
  this.$rtti.$Enum("TTMSFNCGridClipboardPasteAction",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCGridClipboardPasteAction});
  rtl.createClass(this,"TTMSFNCGridClipboardOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FEnabled = false;
      this.FIgnoreReadOnly = false;
      this.FAllowColGrow = false;
      this.FAllowRowGrow = false;
      this.FPasteAction = 0;
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FEnabled = true;
      this.FIgnoreReadOnly = false;
      this.FAllowColGrow = false;
      this.FAllowRowGrow = false;
      this.FPasteAction = $mod.TTMSFNCGridClipboardPasteAction.paReplace;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCGridClipboardOptions.isPrototypeOf(Source)) {
        this.FEnabled = rtl.as(Source,$mod.TTMSFNCGridClipboardOptions).FEnabled;
        this.FIgnoreReadOnly = rtl.as(Source,$mod.TTMSFNCGridClipboardOptions).FIgnoreReadOnly;
        this.FAllowColGrow = rtl.as(Source,$mod.TTMSFNCGridClipboardOptions).FAllowColGrow;
        this.FAllowRowGrow = rtl.as(Source,$mod.TTMSFNCGridClipboardOptions).FAllowRowGrow;
        this.FPasteAction = rtl.as(Source,$mod.TTMSFNCGridClipboardOptions).FPasteAction;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Enabled",0,rtl.boolean,"FEnabled","FEnabled",4,{Default: true});
    $r.addProperty("IgnoreReadOnly",0,rtl.boolean,"FIgnoreReadOnly","FIgnoreReadOnly",4,{Default: false});
    $r.addProperty("AllowColGrow",0,rtl.boolean,"FAllowColGrow","FAllowColGrow",4,{Default: false});
    $r.addProperty("AllowRowGrow",0,rtl.boolean,"FAllowRowGrow","FAllowRowGrow",4,{Default: false});
    $r.addProperty("PasteAction",0,$mod.$rtti["TTMSFNCGridClipboardPasteAction"],"FPasteAction","FPasteAction",4,{Default: $mod.TTMSFNCGridClipboardPasteAction.paReplace});
  });
  rtl.createClass(this,"TTMSFNCGridHTMLExportOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FHeaderFile = "";
      this.FFooterFile = "";
      this.FShow = false;
      this.FConvertSpecialChars = false;
      this.FWidth = 0;
      this.FNonBreakingText = false;
      this.FBorderSize = 0;
      this.FCellPadding = 0;
      this.FPrefixTag = "";
      this.FSuffixTag = "";
      this.FSaveFonts = false;
      this.FExportImages = false;
      this.FCellSpacing = 0;
      this.FSummary = "";
      this.FSaveColors = false;
      this.FXHTML = false;
      this.FTableStyle = "";
      this.FColumnWidths = null;
    };
    this.$final = function () {
      this.FColumnWidths = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FShow = false;
      this.FSaveColors = true;
      this.FSaveFonts = true;
      this.FBorderSize = 1;
      this.FCellSpacing = 0;
      this.FCellPadding = 0;
      this.FWidth = 100;
      this.FExportImages = true;
      this.FColumnWidths = pas["WEBLib.TMSFNCGridDataUtil"].TTMSFNCGridIntList.$create("Create$1");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FColumnWidths");
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCGridHTMLExportOptions.isPrototypeOf(Source)) {
        this.FHeaderFile = rtl.as(Source,$mod.TTMSFNCGridHTMLExportOptions).FHeaderFile;
        this.FFooterFile = rtl.as(Source,$mod.TTMSFNCGridHTMLExportOptions).FFooterFile;
        this.FShow = rtl.as(Source,$mod.TTMSFNCGridHTMLExportOptions).FShow;
        this.FBorderSize = rtl.as(Source,$mod.TTMSFNCGridHTMLExportOptions).FBorderSize;
        this.FCellSpacing = rtl.as(Source,$mod.TTMSFNCGridHTMLExportOptions).FCellSpacing;
        this.FCellPadding = rtl.as(Source,$mod.TTMSFNCGridHTMLExportOptions).FCellPadding;
        this.FConvertSpecialChars = rtl.as(Source,$mod.TTMSFNCGridHTMLExportOptions).FConvertSpecialChars;
        this.FExportImages = rtl.as(Source,$mod.TTMSFNCGridHTMLExportOptions).FExportImages;
        this.FNonBreakingText = rtl.as(Source,$mod.TTMSFNCGridHTMLExportOptions).FNonBreakingText;
        this.FPrefixTag = rtl.as(Source,$mod.TTMSFNCGridHTMLExportOptions).FPrefixTag;
        this.FSaveColors = rtl.as(Source,$mod.TTMSFNCGridHTMLExportOptions).FSaveColors;
        this.FSaveFonts = rtl.as(Source,$mod.TTMSFNCGridHTMLExportOptions).FSaveFonts;
        this.FSuffixTag = rtl.as(Source,$mod.TTMSFNCGridHTMLExportOptions).FSuffixTag;
        this.FSummary = rtl.as(Source,$mod.TTMSFNCGridHTMLExportOptions).FSummary;
        this.FTableStyle = rtl.as(Source,$mod.TTMSFNCGridHTMLExportOptions).FTableStyle;
        this.FWidth = rtl.as(Source,$mod.TTMSFNCGridHTMLExportOptions).FWidth;
        this.FXHTML = rtl.as(Source,$mod.TTMSFNCGridHTMLExportOptions).FXHTML;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("BorderSize",0,rtl.longint,"FBorderSize","FBorderSize",4,{Default: 1});
    $r.addProperty("CellSpacing",0,rtl.longint,"FCellSpacing","FCellSpacing",4,{Default: 0});
    $r.addProperty("CellPadding",0,rtl.longint,"FCellPadding","FCellPadding",4,{Default: 0});
    $r.addProperty("ConvertSpecialChars",0,rtl.boolean,"FConvertSpecialChars","FConvertSpecialChars",4,{Default: false});
    $r.addProperty("ExportImages",0,rtl.boolean,"FExportImages","FExportImages",4,{Default: true});
    $r.addProperty("FooterFile",0,rtl.string,"FFooterFile","FFooterFile");
    $r.addProperty("HeaderFile",0,rtl.string,"FHeaderFile","FHeaderFile");
    $r.addProperty("NonBreakingText",0,rtl.boolean,"FNonBreakingText","FNonBreakingText",4,{Default: false});
    $r.addProperty("PrefixTag",0,rtl.string,"FPrefixTag","FPrefixTag");
    $r.addProperty("SaveColors",0,rtl.boolean,"FSaveColors","FSaveColors",4,{Default: true});
    $r.addProperty("SaveFonts",0,rtl.boolean,"FSaveFonts","FSaveFonts",4,{Default: true});
    $r.addProperty("SuffixTag",0,rtl.string,"FSuffixTag","FSuffixTag");
    $r.addProperty("Show",0,rtl.boolean,"FShow","FShow",4,{Default: false});
    $r.addProperty("Summary",0,rtl.string,"FSummary","FSummary");
    $r.addProperty("TableStyle",0,rtl.string,"FTableStyle","FTableStyle");
    $r.addProperty("Width",0,rtl.longint,"FWidth","FWidth",4,{Default: 100});
    $r.addProperty("XHTML",0,rtl.boolean,"FXHTML","FXHTML",4,{Default: false});
  });
  rtl.createClass(this,"TTMSFNCGridURLOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FUnderline = false;
      this.FColor = 0;
      this.FShow = false;
      this.FOnChange = null;
      this.FFull = false;
      this.FOpen = false;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetColor = function (Value) {
      if (this.FColor !== Value) {
        this.FColor = Value;
        this.Changed();
      };
    };
    this.SetUnderline = function (Value) {
      if (this.FUnderline !== Value) {
        this.FUnderline = Value;
        this.Changed();
      };
    };
    this.SetFull = function (Value) {
      if (this.FFull !== Value) {
        this.FFull = Value;
        this.Changed();
      };
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FShow = true;
      this.FColor = 16711680;
      this.FUnderline = true;
      this.FFull = true;
      this.FOpen = true;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCGridURLOptions.isPrototypeOf(Source)) {
        this.FShow = rtl.as(Source,$mod.TTMSFNCGridURLOptions).FShow;
        this.FUnderline = rtl.as(Source,$mod.TTMSFNCGridURLOptions).FUnderline;
        this.FColor = rtl.as(Source,$mod.TTMSFNCGridURLOptions).FColor;
        this.FOpen = rtl.as(Source,$mod.TTMSFNCGridURLOptions).FOpen;
        this.FFull = rtl.as(Source,$mod.TTMSFNCGridURLOptions).FFull;
      };
    };
    this.Changed = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    var $r = this.$rtti;
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor",4,{Default: 16711680});
    $r.addProperty("Full",2,rtl.boolean,"FFull","SetFull",4,{Default: true});
    $r.addProperty("Open",0,rtl.boolean,"FOpen","FOpen",4,{Default: true});
    $r.addProperty("Show",0,rtl.boolean,"FShow","FShow",4,{Default: true});
    $r.addProperty("Underline",2,rtl.boolean,"FUnderline","SetUnderline",4,{Default: true});
    $r.addProperty("OnChange",0,pas.Classes.$rtti["TNotifyEvent"],"FOnChange","FOnChange");
  });
  rtl.createClass(this,"TTMSFNCGridIOOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FDelimiter = "\x00";
      this.FQuoteEmptyCells = false;
      this.FXMLEncoding = "";
      this.FAlwaysQuotes = false;
      this.FSaveVirtualCellData = false;
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FDelimiter = "\x00";
      this.FQuoteEmptyCells = true;
      this.FXMLEncoding = "ISO-8859-1";
      this.FAlwaysQuotes = false;
      this.FSaveVirtualCellData = true;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCGridIOOptions.isPrototypeOf(Source)) {
        this.FAlwaysQuotes = rtl.as(Source,$mod.TTMSFNCGridIOOptions).FAlwaysQuotes;
        this.FDelimiter = rtl.as(Source,$mod.TTMSFNCGridIOOptions).FDelimiter;
        this.FQuoteEmptyCells = rtl.as(Source,$mod.TTMSFNCGridIOOptions).FQuoteEmptyCells;
        this.FXMLEncoding = rtl.as(Source,$mod.TTMSFNCGridIOOptions).FXMLEncoding;
        this.FSaveVirtualCellData = rtl.as(Source,$mod.TTMSFNCGridIOOptions).FSaveVirtualCellData;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("AlwaysQuotes",0,rtl.boolean,"FAlwaysQuotes","FAlwaysQuotes",4,{Default: false});
    $r.addProperty("Delimiter",0,rtl.char,"FDelimiter","FDelimiter",4,{Default: "\x00"});
    $r.addProperty("QuoteEmptyCells",0,rtl.boolean,"FQuoteEmptyCells","FQuoteEmptyCells",4,{Default: true});
    $r.addProperty("XMLEncoding",0,rtl.string,"FXMLEncoding","FXMLEncoding");
    $r.addProperty("SaveVirtualCellData",0,rtl.boolean,"FSaveVirtualCellData","FSaveVirtualCellData",4,{Default: true});
  });
  rtl.createClass(this,"TTMSFNCGridCellOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FDisplayHTMLFormatting = false;
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetDisplayHTMLFormatting = function (Value) {
      if (this.FDisplayHTMLFormatting !== Value) {
        this.FDisplayHTMLFormatting = Value;
        if (this.FOnChange != null) this.FOnChange(this);
      };
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FDisplayHTMLFormatting = false;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCGridCellOptions.isPrototypeOf(Source)) {
        this.FDisplayHTMLFormatting = rtl.as(Source,$mod.TTMSFNCGridCellOptions).FDisplayHTMLFormatting;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("DisplayHTMLFormatting",2,rtl.boolean,"FDisplayHTMLFormatting","SetDisplayHTMLFormatting",4,{Default: false});
  });
  rtl.createClass(this,"TTMSFNCGridColumnSizeOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FStretch = false;
      this.FStretchAll = false;
      this.FStretchColumn = 0;
      this.FOnChange = null;
      this.FSyncWithGrid = false;
      this.FSyncNormalCellsOnly = false;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetStretch = function (Value) {
      if (this.FStretch !== Value) {
        this.FStretch = Value;
        if (this.FOnChange != null) this.FOnChange(this);
      };
    };
    this.SetStretchAll = function (Value) {
      if (this.FStretchAll !== Value) {
        this.FStretchAll = Value;
        if (this.FOnChange != null) this.FOnChange(this);
      };
    };
    this.SetStretchColumn = function (Value) {
      if (this.FStretchColumn !== Value) {
        this.FStretchColumn = Value;
        if (this.FOnChange != null) this.FOnChange(this);
      };
    };
    this.SetNormalCellsOnly = function (Value) {
      if (this.FSyncNormalCellsOnly !== Value) {
        this.FSyncNormalCellsOnly = Value;
        if (this.FOnChange != null) this.FOnChange(this);
      };
    };
    this.SetSyncWithGrid = function (Value) {
      if (this.FSyncWithGrid !== Value) {
        this.FSyncWithGrid = Value;
        if (this.FOnChange != null) this.FOnChange(this);
      };
    };
    this.Create$1 = function () {
      this.FStretch = false;
      this.FStretchAll = false;
      this.FStretchColumn = -1;
      this.FSyncWithGrid = false;
      this.FSyncNormalCellsOnly = false;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCGridColumnSizeOptions.isPrototypeOf(Source)) {
        this.FStretch = rtl.as(Source,$mod.TTMSFNCGridColumnSizeOptions).FStretch;
        this.FStretchAll = rtl.as(Source,$mod.TTMSFNCGridColumnSizeOptions).FStretchAll;
        this.FStretchColumn = rtl.as(Source,$mod.TTMSFNCGridColumnSizeOptions).FStretchColumn;
        this.FSyncNormalCellsOnly = rtl.as(Source,$mod.TTMSFNCGridColumnSizeOptions).FSyncNormalCellsOnly;
        this.FSyncWithGrid = rtl.as(Source,$mod.TTMSFNCGridColumnSizeOptions).FSyncWithGrid;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Stretch",2,rtl.boolean,"FStretch","SetStretch",4,{Default: false});
    $r.addProperty("StretchColumn",2,rtl.longint,"FStretchColumn","SetStretchColumn",4,{Default: -1});
    $r.addProperty("StretchAll",2,rtl.boolean,"FStretchAll","SetStretchAll",4,{Default: false});
    $r.addProperty("SyncWithGrid",2,rtl.boolean,"FSyncWithGrid","SetSyncWithGrid",4,{Default: false});
    $r.addProperty("SyncNormalCellsOnly",2,rtl.boolean,"FSyncNormalCellsOnly","SetNormalCellsOnly",4,{Default: false});
    $r.addProperty("OnChange",0,pas.Classes.$rtti["TNotifyEvent"],"FOnChange","FOnChange");
  });
  rtl.createClass(this,"TTMSFNCGridOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FMouse = null;
      this.FKeyboard = null;
      this.FSorting = null;
      this.FGrouping = null;
      this.FFiltering = null;
      this.FEditing = null;
      this.FBorders = null;
      this.FLookup = null;
      this.FClipboard = null;
      this.FHTMLExport = null;
      this.FBands = null;
      this.FOnChange = null;
      this.FURL = null;
      this.FScrollBar = null;
      this.FIO = null;
      this.FCell = null;
      this.FColumnSize = null;
      this.FSelection = null;
    };
    this.$final = function () {
      this.FMouse = undefined;
      this.FKeyboard = undefined;
      this.FSorting = undefined;
      this.FGrouping = undefined;
      this.FFiltering = undefined;
      this.FEditing = undefined;
      this.FBorders = undefined;
      this.FLookup = undefined;
      this.FClipboard = undefined;
      this.FHTMLExport = undefined;
      this.FBands = undefined;
      this.FOnChange = undefined;
      this.FURL = undefined;
      this.FScrollBar = undefined;
      this.FIO = undefined;
      this.FCell = undefined;
      this.FColumnSize = undefined;
      this.FSelection = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetKeyboard = function (Value) {
      this.FKeyboard.Assign(Value);
    };
    this.SetMouse = function (Value) {
      this.FMouse.Assign(Value);
    };
    this.SetGrouping = function (Value) {
      this.FGrouping.Assign(Value);
    };
    this.SetSorting = function (Value) {
      this.FSorting.Assign(Value);
    };
    this.SetFiltering = function (Value) {
      this.FFiltering.Assign(Value);
    };
    this.SetEditing = function (Value) {
      this.FEditing.Assign(Value);
    };
    this.SetBorders = function (Value) {
      this.FBorders.Assign(Value);
    };
    this.SetLookup = function (Value) {
      this.FLookup.Assign(Value);
    };
    this.SetClipboard = function (Value) {
      this.FClipboard.Assign(Value);
    };
    this.SetHTMLExport = function (Value) {
      this.FHTMLExport.Assign(Value);
    };
    this.SetBands = function (Value) {
      this.FBands.Assign(Value);
    };
    this.SetURL = function (Value) {
      this.FURL.Assign(Value);
    };
    this.SetScrollBar = function (Value) {
      this.FScrollBar.Assign(Value);
    };
    this.SetIO = function (Value) {
      this.FIO.Assign(Value);
    };
    this.SetCell = function (Value) {
      this.FCell.Assign(Value);
    };
    this.SetColumnSize = function (Value) {
      this.FColumnSize.Assign(Value);
    };
    this.SetSelection = function (Value) {
      this.FSelection.Assign(Value);
    };
    this.DoChange = function (Sender) {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FScrollBar = $mod.TTMSFNCGridScrollBarOptions.$create("Create$1");
      this.FScrollBar.FOnChange = rtl.createCallback(this,"DoChange");
      this.FMouse = $mod.TTMSFNCGridMouseOptions.$create("Create$1");
      this.FKeyboard = $mod.TTMSFNCGridKeyboardOptions.$create("Create$1");
      this.FSorting = $mod.TTMSFNCGridSortingOptions.$create("Create$1");
      this.FGrouping = $mod.TTMSFNCGridGroupingOptions.$create("Create$1");
      this.FFiltering = $mod.TTMSFNCGridFilteringOptions.$create("Create$1");
      this.FFiltering.FOnChange = rtl.createCallback(this,"DoChange");
      this.FCell = $mod.TTMSFNCGridCellOptions.$create("Create$1");
      this.FCell.FOnChange = rtl.createCallback(this,"DoChange");
      this.FEditing = $mod.TTMSFNCGridEditingOptions.$create("Create$1");
      this.FColumnSize = $mod.TTMSFNCGridColumnSizeOptions.$create("Create$1");
      this.FColumnSize.FOnChange = rtl.createCallback(this,"DoChange");
      this.FBorders = $mod.TTMSFNCGridBorderOptions.$create("Create$1");
      this.FLookup = $mod.TTMSFNCGridLookupOptions.$create("Create$1");
      this.FClipboard = $mod.TTMSFNCGridClipboardOptions.$create("Create$1");
      this.FHTMLExport = $mod.TTMSFNCGridHTMLExportOptions.$create("Create$1");
      this.FIO = $mod.TTMSFNCGridIOOptions.$create("Create$1");
      this.FBands = $mod.TTMSFNCGridBandOptions.$create("Create$1");
      this.FBands.FOnChange = rtl.createCallback(this,"DoChange");
      this.FURL = $mod.TTMSFNCGridURLOptions.$create("Create$1");
      this.FURL.FOnChange = rtl.createCallback(this,"DoChange");
      this.FSelection = $mod.TTMSFNCGridSelection.$create("Create$1");
      this.FSelection.FOnChange = rtl.createCallback(this,"DoChange");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FCell");
      rtl.free(this,"FColumnSize");
      rtl.free(this,"FScrollBar");
      rtl.free(this,"FBands");
      rtl.free(this,"FBorders");
      rtl.free(this,"FEditing");
      rtl.free(this,"FMouse");
      rtl.free(this,"FKeyboard");
      rtl.free(this,"FSorting");
      rtl.free(this,"FGrouping");
      rtl.free(this,"FFiltering");
      rtl.free(this,"FLookup");
      rtl.free(this,"FClipboard");
      rtl.free(this,"FHTMLExport");
      rtl.free(this,"FURL");
      rtl.free(this,"FIO");
      rtl.free(this,"FSelection");
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCGridOptions.isPrototypeOf(Source)) {
        this.FMouse.Assign(rtl.as(Source,$mod.TTMSFNCGridOptions).FMouse);
        this.FKeyboard.Assign(rtl.as(Source,$mod.TTMSFNCGridOptions).FKeyboard);
        this.FFiltering.Assign(rtl.as(Source,$mod.TTMSFNCGridOptions).FFiltering);
        this.FSorting.Assign(rtl.as(Source,$mod.TTMSFNCGridOptions).FSorting);
        this.FGrouping.Assign(rtl.as(Source,$mod.TTMSFNCGridOptions).FGrouping);
        this.FEditing.Assign(rtl.as(Source,$mod.TTMSFNCGridOptions).FEditing);
        this.FBorders.Assign(rtl.as(Source,$mod.TTMSFNCGridOptions).FBorders);
        this.FLookup.Assign(rtl.as(Source,$mod.TTMSFNCGridOptions).FLookup);
        this.FClipboard.Assign(rtl.as(Source,$mod.TTMSFNCGridOptions).FClipboard);
        this.FCell.Assign(rtl.as(Source,$mod.TTMSFNCGridOptions).FCell);
        this.FBands.Assign(rtl.as(Source,$mod.TTMSFNCGridOptions).FBands);
        this.FHTMLExport.Assign(rtl.as(Source,$mod.TTMSFNCGridOptions).FHTMLExport);
        this.FURL.Assign(rtl.as(Source,$mod.TTMSFNCGridOptions).FURL);
        this.FScrollBar.Assign(rtl.as(Source,$mod.TTMSFNCGridOptions).FScrollBar);
        this.FIO.Assign(rtl.as(Source,$mod.TTMSFNCGridOptions).FIO);
        this.FSelection.Assign(rtl.as(Source,$mod.TTMSFNCGridOptions).FSelection);
        this.FColumnSize.Assign(rtl.as(Source,$mod.TTMSFNCGridOptions).FColumnSize);
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Bands",2,$mod.$rtti["TTMSFNCGridBandOptions"],"FBands","SetBands");
    $r.addProperty("Borders",2,$mod.$rtti["TTMSFNCGridBorderOptions"],"FBorders","SetBorders");
    $r.addProperty("Cell",2,$mod.$rtti["TTMSFNCGridCellOptions"],"FCell","SetCell");
    $r.addProperty("ColumnSize",2,$mod.$rtti["TTMSFNCGridColumnSizeOptions"],"FColumnSize","SetColumnSize");
    $r.addProperty("Clipboard",2,$mod.$rtti["TTMSFNCGridClipboardOptions"],"FClipboard","SetClipboard");
    $r.addProperty("Editing",2,$mod.$rtti["TTMSFNCGridEditingOptions"],"FEditing","SetEditing");
    $r.addProperty("Filtering",2,$mod.$rtti["TTMSFNCGridFilteringOptions"],"FFiltering","SetFiltering");
    $r.addProperty("Grouping",2,$mod.$rtti["TTMSFNCGridGroupingOptions"],"FGrouping","SetGrouping");
    $r.addProperty("HTMLExport",2,$mod.$rtti["TTMSFNCGridHTMLExportOptions"],"FHTMLExport","SetHTMLExport");
    $r.addProperty("IO",2,$mod.$rtti["TTMSFNCGridIOOptions"],"FIO","SetIO");
    $r.addProperty("Keyboard",2,$mod.$rtti["TTMSFNCGridKeyboardOptions"],"FKeyboard","SetKeyboard");
    $r.addProperty("Lookup",2,$mod.$rtti["TTMSFNCGridLookupOptions"],"FLookup","SetLookup");
    $r.addProperty("Mouse",2,$mod.$rtti["TTMSFNCGridMouseOptions"],"FMouse","SetMouse");
    $r.addProperty("Sorting",2,$mod.$rtti["TTMSFNCGridSortingOptions"],"FSorting","SetSorting");
    $r.addProperty("URL",2,$mod.$rtti["TTMSFNCGridURLOptions"],"FURL","SetURL");
    $r.addProperty("ScrollBar",2,$mod.$rtti["TTMSFNCGridScrollBarOptions"],"FScrollBar","SetScrollBar");
    $r.addProperty("Selection",2,$mod.$rtti["TTMSFNCGridSelection"],"FSelection","SetSelection");
  });
},["Types"]);
rtl.module("WEBLib.TMSFNCGridData",["System","Classes","SysUtils","WEBLib.Controls","WEBLib.TMSFNCGraphics","WEBLib.TMSFNCDataBinding","WEBLib.TMSFNCGridCell","WEBLib.TMSFNCGridDataUtil","WEBLib.Graphics","WEBLib.TMSFNCTypes","WEBLib.TMSFNCCustomScrollControl","Types","WEBLib.TMSFNCBitmapContainer","WEBLib.TMSFNCGridOptions","WEBLib.TMSFNCGraphicsTypes","Web","contnrs","WEBLib.StdCtrls"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.$rtti.$StaticArray("CSVSeparators$a",{dims: [10], eltype: rtl.char});
  this.CSVSeparators = [",",";","#","\t","|","@","*","-","+","&"];
  this.$rtti.$ClassRef("TTMSFNCGridEditorClass",{instancetype: pas["WEBLib.Controls"].$rtti["TWinControl"]});
  rtl.createHelper(this,"TJSNodeListHelper",null,function () {
    this.FindNode = function (ANodeName) {
      var Result = null;
      var Index = 0;
      Index = $mod.TJSNodeListHelper.IndexOf.call(this,ANodeName);
      if (Index >= 0) {
        Result = this.item(Index)}
       else Result = null;
      return Result;
    };
    this.IndexOf = function (Name) {
      var Result = 0;
      var n = null;
      for (var $l = 0, $end = $mod.TJSNodeListHelper.GetCount.call(this) - 1; $l <= $end; $l++) {
        Result = $l;
        n = this.item(Result);
        if (n.nodeName === Name) return Result;
      };
      Result = -1;
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = this.length;
      return Result;
    };
  });
  this.$rtti.$Class("TTMSFNCGridData");
  rtl.recNewT(this,"TTMSFNCGridCellRec",function () {
    this.Col = 0;
    this.Row = 0;
    this.$eq = function (b) {
      return (this.Col === b.Col) && (this.Row === b.Row);
    };
    this.$assign = function (s) {
      this.Col = s.Col;
      this.Row = s.Row;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCGridCellRec",{},this);
    $r.addField("Col",rtl.longint);
    $r.addField("Row",rtl.longint);
  });
  rtl.recNewT(this,"TTMSFNCGridCellRecRange",function () {
    this.StartCol = 0;
    this.StartRow = 0;
    this.EndCol = 0;
    this.EndRow = 0;
    this.$eq = function (b) {
      return (this.StartCol === b.StartCol) && (this.StartRow === b.StartRow) && (this.EndCol === b.EndCol) && (this.EndRow === b.EndRow);
    };
    this.$assign = function (s) {
      this.StartCol = s.StartCol;
      this.StartRow = s.StartRow;
      this.EndCol = s.EndCol;
      this.EndRow = s.EndRow;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCGridCellRecRange",{},this);
    $r.addField("StartCol",rtl.longint);
    $r.addField("StartRow",rtl.longint);
    $r.addField("EndCol",rtl.longint);
    $r.addField("EndRow",rtl.longint);
  });
  this.TTMSFNCGridCellState = {"0": "csNormal", csNormal: 0, "1": "csFocused", csFocused: 1, "2": "csFixed", csFixed: 2, "3": "csFixedSelected", csFixedSelected: 3, "4": "csSelected", csSelected: 4};
  this.$rtti.$Enum("TTMSFNCGridCellState",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TTMSFNCGridCellState});
  this.TTMSFNCGridSortDirection = {"0": "sdAscending", sdAscending: 0, "1": "sdDescending", sdDescending: 1};
  this.$rtti.$Enum("TTMSFNCGridSortDirection",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCGridSortDirection});
  this.TTMSFNCGridSortFormat = {"0": "ssAutomatic", ssAutomatic: 0, "1": "ssAlphabetic", ssAlphabetic: 1, "2": "ssAlphabeticNoCase", ssAlphabeticNoCase: 2, "3": "ssNumeric", ssNumeric: 3, "4": "ssDate", ssDate: 4, "5": "ssHTML", ssHTML: 5, "6": "ssCheckBox", ssCheckBox: 6, "7": "ssCustom", ssCustom: 7, "8": "ssRaw", ssRaw: 8};
  this.$rtti.$Enum("TTMSFNCGridSortFormat",{minvalue: 0, maxvalue: 8, ordtype: 1, enumtype: this.TTMSFNCGridSortFormat});
  this.$rtti.$MethodVar("TTMSFNCGridSortFormatEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Col",rtl.longint],["SortFormat",this.$rtti["TTMSFNCGridSortFormat"],1],["APrefix",rtl.string,1],["ASuffix",rtl.string,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridCustomCompareEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Value1",rtl.string],["Value2",rtl.string],["res",rtl.longint,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridRawCompareEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Col",rtl.longint],["Row1",rtl.longint],["Row2",rtl.longint],["res",rtl.longint,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridClipboardBeforePasteEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Col",rtl.longint],["Row",rtl.longint],["Value",rtl.string,1],["Allow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridClipboardAfterPasteEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Col",rtl.longint],["Row",rtl.longint],["Value",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridNeedFilterDropDownEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Col",rtl.longint],["Row",rtl.longint],["Allow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridNeedFilterDropDownDataEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Col",rtl.longint],["Row",rtl.longint],["AValues",pas.Classes.$rtti["TStrings"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridFilterSelectEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Col",rtl.longint],["Condition",rtl.string,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridAfterApplyFilterEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Col",rtl.longint],["Condition",rtl.string],["UpdateCalculations",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridCellsChangedEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Cells",this.$rtti["TTMSFNCGridCellRecRange"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridColumnCalcEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["FromRow",rtl.longint],["ToRow",rtl.longint],["Res",rtl.double,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnSelectCell",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["Allow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnSelectedCell",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint]]), methodkind: 0});
  this.TTMSFNCGridColumnCalculation = {"0": "ccNone", ccNone: 0, "1": "ccSum", ccSum: 1, "2": "ccAvg", ccAvg: 2, "3": "ccCount", ccCount: 3, "4": "ccMin", ccMin: 4, "5": "ccMax", ccMax: 5, "6": "ccCUSTOM", ccCUSTOM: 6, "7": "ccDistinct", ccDistinct: 7, "8": "ccStdDev", ccStdDev: 8};
  this.$rtti.$Enum("TTMSFNCGridColumnCalculation",{minvalue: 0, maxvalue: 8, ordtype: 1, enumtype: this.TTMSFNCGridColumnCalculation});
  this.TTMSFNCGridCellCalcState = {"0": "csNoCalc", csNoCalc: 0, "1": "csCalcOk", csCalcOk: 1, "2": "csCalcErr", csCalcErr: 2};
  this.$rtti.$Enum("TTMSFNCGridCellCalcState",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCGridCellCalcState});
  rtl.createClass(this,"TTMSFNCGridCellProperty",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FDefaultFont = null;
      this.FColor = 0;
      this.FBaseCol = 0;
      this.FBaseRow = 0;
      this.FColSpan = 0;
      this.FRowSpan = 0;
      this.FAlignHorz = 0;
      this.FAlignVert = 0;
      this.FControl = null;
      this.FObject = null;
      this.FReadOnly = false;
      this.FPrintPageNr = 0;
      this.FFontStyle = {};
      this.FFontSize = 0.0;
      this.FFontName = "";
      this.FFontColor = 0;
      this.FAngle = 0;
      this.FComment = "";
      this.FCommentColor = 0;
      this.FBorderColor = 0;
      this.FBorderWidth = 0;
      this.FWordWrap = false;
      this.FFixed = false;
      this.FCalcState = 0;
      this.FCalcValue = undefined;
      this.FNameIndex = 0;
    };
    this.$final = function () {
      this.FDefaultFont = undefined;
      this.FControl = undefined;
      this.FObject = undefined;
      this.FFontStyle = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Assign = function (Source) {
      this.FColSpan = Source.FColSpan;
      this.FRowSpan = Source.FRowSpan;
      this.FBaseCol = Source.FBaseCol;
      this.FBaseRow = Source.FBaseRow;
      this.FColor = Source.FColor;
      this.FAlignHorz = Source.FAlignHorz;
      this.FAlignVert = Source.FAlignVert;
      this.FFontStyle = rtl.refSet(Source.FFontStyle);
      this.FReadOnly = false;
      this.FCalcState = Source.FCalcState;
    };
    this.Create$1 = function (DefaultFont) {
      pas.System.TObject.Create.call(this);
      this.FDefaultFont = DefaultFont;
      this.FColSpan = -1;
      this.FRowSpan = -1;
      this.FBaseCol = -1;
      this.FBaseRow = -1;
      this.FColor = -1;
      this.FBorderColor = -1;
      this.FControl = null;
      this.FPrintPageNr = -1;
      this.FBorderWidth = 1;
      this.FAngle = 0;
      this.FAlignHorz = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading;
      this.FAlignVert = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      this.FFontSize = DefaultFont.FSize;
      this.FFontStyle = rtl.refSet(DefaultFont.FStyle);
      this.FCommentColor = -1;
      this.FComment = "";
      this.FCalcState = $mod.TTMSFNCGridCellCalcState.csNoCalc;
      this.FNameIndex = -1;
      return this;
    };
    this.Destroy = function () {
      if (this.FControl != null) pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FControl;
        }, set: function (v) {
          this.p.FControl = v;
        }});
      pas.System.TObject.Destroy.call(this);
    };
    this.IsBaseCell = function (Col, Row) {
      var Result = false;
      Result = ((Col === this.FBaseCol) && (Row === this.FBaseRow)) || ((this.FBaseCol === -1) && (this.FBaseRow === -1));
      return Result;
    };
    this.FreeControl = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FControl;
        }, set: function (v) {
          this.p.FControl = v;
        }});
    };
  });
  rtl.createClass(this,"TTMSFNCGridCellCheckBox",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FChecked = false;
      this.FHeader = false;
    };
  });
  rtl.createClass(this,"TTMSFNCGridCellDataCheckBox",pas.System.TObject,function () {
  });
  rtl.createClass(this,"TTMSFNCGridCellRadioButton",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FChecked = false;
      this.FIndex = 0;
    };
  });
  rtl.createClass(this,"TTMSFNCGridCellButton",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FText = "";
      this.FWidth = 0;
      this.FHeight = 0;
    };
  });
  rtl.createClass(this,"TTMSFNCGridCellBitmapName",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FBitmapName = "";
      this.FData = false;
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FBitmapName = "";
      this.FData = false;
      return this;
    };
  });
  this.$rtti.$Class("TTMSFNCGridCellBitmap");
  rtl.createClass(this,"TTMSFNCGridCellBitmap",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FBitmap = null;
    };
    this.$final = function () {
      this.FBitmap = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.SetBitmap = function (Value) {
      this.FBitmap.Assign(Value);
    };
    this.Create$1 = function (AOwner) {
      this.FBitmap = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FBitmap");
      pas.System.TObject.Destroy.call(this);
    };
  });
  rtl.createClass(this,"TTMSFNCGridCellNode",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FState = 0;
      this.FSpan = 0;
    };
  });
  rtl.createClass(this,"TTMSFNCGridCellSummary",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FMerged = false;
    };
  });
  rtl.createClass(this,"TTMSFNCGridCellProgressBar",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FValue = 0.0;
      this.FData = false;
    };
  });
  rtl.createClass(this,"TTMSFNCGridCellCombo",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FItems = null;
    };
    this.$final = function () {
      this.FItems = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.SetItems = function (Value) {
      this.FItems.Assign(Value);
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FItems = pas.Classes.TStringList.$create("Create$1");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FItems");
      pas.System.TObject.Destroy.call(this);
    };
  });
  rtl.createClass(this,"TTMSFNCGridSortIndexList",pas["WEBLib.TMSFNCGridDataUtil"].TTMSFNCGridIntList,function () {
    this.GetSortColumns = function (i) {
      var Result = 0;
      Result = this.GetInteger(i) & 0x7FFFFFFF;
      return Result;
    };
    this.GetSortDirections = function (i) {
      var Result = false;
      Result = !((this.GetInteger(i) & 0x80000000) === 0x80000000);
      return Result;
    };
    this.SetSortColumns = function (i, Value) {
      this.SetInteger(i,rtl.lw((Value >>> 0) & 0x7FFFFFFF) + (this.GetInteger(i) & 0x80000000));
    };
    this.SetSortDirections = function (i, Value) {
      if (Value) {
        this.SetInteger(i,this.GetInteger(i) & 0x7FFFFFFF)}
       else this.SetInteger(i,rtl.lw((this.GetInteger(i) >>> 0) | 0x80000000));
    };
    this.SaveToString = function () {
      var Result = "";
      var i = 0;
      var s = "";
      var a = "";
      s = "";
      a = "";
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if ((this.GetInteger(i) & 0x80000000) === 0x80000000) {
          a = "d" + pas.SysUtils.IntToStr(0xFFFF & this.GetInteger(i));
        } else {
          a = "u" + pas.SysUtils.IntToStr(0xFFFF & this.GetInteger(i));
        };
        if (s === "") {
          s = a}
         else s = s + ";" + a;
      };
      Result = s;
      return Result;
    };
    this.LoadFromString = function (s) {
      var a = "";
      var i = 0;
      var e = 0;
      this.Clear();
      while (s.length > 0) {
        if (pas.System.Pos(";",s) > 0) {
          a = pas.System.Copy(s,1,pas.System.Pos(";",s) - 1);
          pas.System.Delete({get: function () {
              return s;
            }, set: function (v) {
              s = v;
            }},1,pas.System.Pos(";",s));
        } else {
          a = s;
          s = "";
        };
        if (a.length > 1) {
          pas.System.val$6(pas.System.Copy(a,2,a.length),{get: function () {
              return i;
            }, set: function (v) {
              i = v;
            }},{get: function () {
              return e;
            }, set: function (v) {
              e = v;
            }});
          if (a.charAt(0) === "u") {
            this.AddIndex(i,$mod.TTMSFNCGridSortDirection.sdAscending)}
           else this.AddIndex(i,$mod.TTMSFNCGridSortDirection.sdDescending);
        };
      };
    };
    this.AddIndex = function (ColumnIndex, ADirection) {
      if (ADirection === $mod.TTMSFNCGridSortDirection.sdAscending) {
        this.Add$1(ColumnIndex)}
       else this.Add$1(0x80000000 | ColumnIndex);
    };
    this.FindIndex = function (ColumnIndex) {
      var Result = 0;
      var i = 0;
      Result = -1;
      i = 0;
      while (i < this.GetCount()) {
        if ((this.GetInteger(i) & 0x7FFFFFFF) === ColumnIndex) {
          Result = i;
          break;
        };
        i += 1;
      };
      return Result;
    };
    this.ToggleIndex = function (ColumnIndex) {
      var i = 0;
      i = 0;
      while (i < this.GetCount()) {
        if ((this.GetInteger(i) & 0x7FFFFFFF) === ColumnIndex) {
          if ((this.GetInteger(i) & 0x80000000) === 0x80000000) {
            this.SetInteger(i,this.GetInteger(i) & 0x7FFFFFFF)}
           else this.SetInteger(i,this.GetInteger(i) | 0x80000000);
          break;
        };
        i += 1;
      };
    };
  });
  this.TTMSFNCGridFilterCells = {"0": "fcVirtual", fcVirtual: 0, "1": "fcNormal", fcNormal: 1, "2": "fcStripHTML", fcStripHTML: 2, "3": "fcRow", fcRow: 3};
  this.$rtti.$Enum("TTMSFNCGridFilterCells",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TTMSFNCGridFilterCells});
  this.TTMSFNCGridFilterOperation = {"0": "foSHORT", foSHORT: 0, "1": "foNONE", foNONE: 1, "2": "foAND", foAND: 2, "3": "foXOR", foXOR: 3, "4": "foOR", foOR: 4};
  this.$rtti.$Enum("TTMSFNCGridFilterOperation",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TTMSFNCGridFilterOperation});
  this.TTMSFNCGridRowState = {"0": "rsDefault", rsDefault: 0, "1": "rsSelected", rsSelected: 1};
  this.$rtti.$Enum("TTMSFNCGridRowState",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCGridRowState});
  this.TTMSFNCClipOperation = {"0": "coCut", coCut: 0, "1": "coCopy", coCopy: 1, "2": "coNone", coNone: 2};
  this.$rtti.$Enum("TTMSFNCClipOperation",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCClipOperation});
  rtl.createClass(this,"TTMSFNCGridDataList",pas.Classes.TStringList,function () {
  });
  rtl.createClass(this,"TTMSFNCGridRowInfo",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FData = null;
      this.FState = 0;
    };
    this.$final = function () {
      this.FData = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.SetState = function (Value) {
      this.FState = Value;
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FData = $mod.TTMSFNCGridDataList.$create("Create$1");
      this.FState = $mod.TTMSFNCGridRowState.rsDefault;
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FData");
      pas.System.TObject.Destroy.call(this);
    };
  });
  rtl.createClass(this,"TTMSFNCGridFilterData",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FColumn = 0;
      this.FCondition = "";
      this.FCaseSensitive = false;
      this.FSuffix = "";
      this.FPrefix = "";
      this.FOperation = 0;
      this.FData = 0;
    };
    this.Create$1 = function (ACollection) {
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      this.FCaseSensitive = true;
      this.FData = $mod.TTMSFNCGridFilterCells.fcVirtual;
      return this;
    };
    this.Assign = function (Source) {
      var ASrcFilterData = null;
      ASrcFilterData = rtl.as(Source,$mod.TTMSFNCGridFilterData);
      if (ASrcFilterData != null) {
        this.FColumn = ASrcFilterData.FColumn;
        this.FCondition = ASrcFilterData.FCondition;
        this.FCaseSensitive = ASrcFilterData.FCaseSensitive;
        this.FData = ASrcFilterData.FData;
        this.FPrefix = ASrcFilterData.FPrefix;
        this.FSuffix = ASrcFilterData.FSuffix;
        this.FOperation = ASrcFilterData.FOperation;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Column",0,rtl.smallint,"FColumn","FColumn");
    $r.addProperty("Condition",0,rtl.string,"FCondition","FCondition");
    $r.addProperty("CaseSensitive",0,rtl.boolean,"FCaseSensitive","FCaseSensitive",4,{Default: true});
    $r.addProperty("Data",0,$mod.$rtti["TTMSFNCGridFilterCells"],"FData","FData",4,{Default: $mod.TTMSFNCGridFilterCells.fcVirtual});
    $r.addProperty("Prefix",0,rtl.string,"FPrefix","FPrefix");
    $r.addProperty("Suffix",0,rtl.string,"FSuffix","FSuffix");
    $r.addProperty("Operation",0,$mod.$rtti["TTMSFNCGridFilterOperation"],"FOperation","FOperation");
  });
  rtl.createClass(this,"TTMSFNCGridFilter",pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$init.call(this);
      this.FOwner$1 = null;
    };
    this.$final = function () {
      this.FOwner$1 = undefined;
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$final.call(this);
    };
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.GetItem.call(this,Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      pas.Classes.TCollection.SetItem.call(this,Index,Value);
    };
    this.GetColFilter = function (Col) {
      var Result = null;
      var i = 0;
      for (var $l = 1, $end = this.GetCount(); $l <= $end; $l++) {
        i = $l;
        if (this.GetItem$1(i - 1).FColumn === Col) {
          Result = this.GetItem$1(i - 1);
          return Result;
        };
      };
      Result = this.Add$1();
      Result.FColumn = Col;
      return Result;
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,$mod.TTMSFNCGridFilterData);
      this.FOwner$1 = AOwner;
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      if (this.GetCount() === 1) {
        Result.FOperation = $mod.TTMSFNCGridFilterOperation.foNONE}
       else Result.FOperation = $mod.TTMSFNCGridFilterOperation.foAND;
      return Result;
    };
    this.Insert$1 = function (index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,index);
      return Result;
    };
    this.HasFilter = function (Col) {
      var Result = false;
      var i = 0;
      Result = false;
      for (var $l = 1, $end = this.GetCount(); $l <= $end; $l++) {
        i = $l;
        if (this.GetItem$1(i - 1).FColumn === Col) {
          Result = true;
          break;
        };
      };
      return Result;
    };
    this.RemoveColumnFilter = function (Col) {
      var i = 0;
      i = this.GetCount();
      while (i > 0) {
        i -= 1;
        if (this.GetItem$1(i).FColumn === Col) this.Delete(i);
      };
    };
  });
  rtl.recNewT(this,"TTMSFNCGridCellCoordinate",function () {
    this.Col = 0;
    this.Row = 0;
    this.$eq = function (b) {
      return (this.Col === b.Col) && (this.Row === b.Row);
    };
    this.$assign = function (s) {
      this.Col = s.Col;
      this.Row = s.Row;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCGridCellCoordinate",{},this);
    $r.addField("Col",rtl.longint);
    $r.addField("Row",rtl.longint);
  });
  rtl.createClass(this,"TTMSFNCGridFileStringList",pas.Classes.TStringList,function () {
    this.$init = function () {
      pas.Classes.TStringList.$init.call(this);
      this.fp = 0;
      this.cache = "";
    };
    this.GetEOF = function () {
      var Result = false;
      Result = this.fp >= this.GetCount();
      return Result;
    };
    this.Reset = function () {
      this.fp = 0;
      this.cache = "";
    };
    this.ReadLn = function (s) {
      s.set(this.Get(this.fp));
      this.fp += 1;
    };
    this.Write = function (s) {
      this.cache = this.cache + s;
    };
    this.WriteLn = function (s) {
      this.Add(this.cache + s);
      this.cache = "";
    };
  });
  this.TTMSFNCGridFindParameters = {"0": "fnMatchCase", fnMatchCase: 0, "1": "fnMatchFull", fnMatchFull: 1, "2": "fnMatchRegular", fnMatchRegular: 2, "3": "fnDirectionLeftRight", fnDirectionLeftRight: 3, "4": "fnMatchStart", fnMatchStart: 4, "5": "fnFindInCurrentRow", fnFindInCurrentRow: 5, "6": "fnFindInCurrentCol", fnFindInCurrentCol: 6, "7": "fnIncludeFixed", fnIncludeFixed: 7, "8": "fnAutoGoto", fnAutoGoto: 8, "9": "fnIgnoreHTMLTags", fnIgnoreHTMLTags: 9, "10": "fnBackward", fnBackward: 10, "11": "fnIncludeHiddenColumns", fnIncludeHiddenColumns: 11, "12": "fnFindInPresetCol", fnFindInPresetCol: 12, "13": "fnFindInPresetRow", fnFindInPresetRow: 13, "14": "fnSelectedCells", fnSelectedCells: 14, "15": "fnIncludeHiddenRows", fnIncludeHiddenRows: 15};
  this.$rtti.$Enum("TTMSFNCGridFindParameters",{minvalue: 0, maxvalue: 15, ordtype: 1, enumtype: this.TTMSFNCGridFindParameters});
  this.$rtti.$Set("TTMSFNCGridFindParams",{comptype: this.$rtti["TTMSFNCGridFindParameters"]});
  rtl.createClass(this,"TTMSFNCGridSingleListItem",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FOwner = null;
      this.FValue = 0.0;
      this.FCellVal = 0;
    };
    this.$final = function () {
      this.FOwner = undefined;
      pas.Classes.TCollectionItem.$final.call(this);
    };
    this.SetValue = function (Value) {
      this.FValue = Value;
    };
    this.Create$1 = function (ACollection) {
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      if (this.FCollection != null) this.FOwner = rtl.as(this.FCollection,$mod.TTMSFNCGridSingleList).FOwner$1;
      return this;
    };
    var $r = this.$rtti;
    $r.addProperty("Value",2,rtl.double,"FValue","SetValue");
    $r.addProperty("CellVal",0,rtl.longint,"FCellVal","FCellVal");
  });
  rtl.createClass(this,"TTMSFNCGridSingleList",pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$init.call(this);
      this.FOwner$1 = null;
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FOwner$1 = undefined;
      this.FOnChange = undefined;
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$final.call(this);
    };
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      this.SetItem(Index,Value);
    };
    this.IndexOf = function (ACellVal) {
      var Result = 0;
      var r = 0;
      Result = -1;
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        r = $l;
        if (this.GetItem$1(r).FCellVal === ACellVal) {
          Result = r;
          return Result;
        };
      };
      return Result;
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,$mod.TTMSFNCGridSingleListItem);
      this.FOwner$1 = AOwner;
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      return Result;
    };
  });
  this.TTMSFNCGridMarkType = {"0": "mtHighlight", mtHighlight: 0, "1": "mtError", mtError: 1};
  this.$rtti.$Enum("TTMSFNCGridMarkType",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCGridMarkType});
  rtl.createClass(this,"TTMSFNCGridCellMarkItem",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FCellRange = $mod.TTMSFNCGridCellRecRange.$new();
      this.FValue = "";
      this.FCaseSensitive = false;
      this.FMarkType = 0;
    };
    this.$final = function () {
      this.FCellRange = undefined;
      pas.Classes.TCollectionItem.$final.call(this);
    };
    var $r = this.$rtti;
    $r.addProperty("CaseSensitive",0,rtl.boolean,"FCaseSensitive","FCaseSensitive");
    $r.addProperty("Value",0,rtl.string,"FValue","FValue");
    $r.addProperty("MarkType",0,$mod.$rtti["TTMSFNCGridMarkType"],"FMarkType","FMarkType");
  });
  rtl.createClass(this,"TTMSFNCGridCellMarkList",pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection,function () {
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      this.SetItem(Index,Value);
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,$mod.TTMSFNCGridCellMarkItem);
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      return Result;
    };
    this.RemoveMarker = function (CellRange, MarkerType) {
      var i = 0;
      for (var $l = this.GetCount() - 1; $l >= 0; $l--) {
        i = $l;
        if ($mod.EqualsCellRange($mod.TTMSFNCGridCellRecRange.$clone(this.GetItem$1(i).FCellRange),$mod.TTMSFNCGridCellRecRange.$clone(CellRange)) && (MarkerType === this.GetItem$1(i).FMarkType)) this.Delete(i);
      };
    };
  });
  rtl.createClass(this,"TTMSFNCGridCellList",pas.Classes.TList,function () {
    this.GetItem = function (Index) {
      var Result = $mod.TTMSFNCGridCellRec.$new();
      Result.$assign(rtl.getObject(this.Get(Index)));
      return Result;
    };
    this.SetItem = function (Index, Value) {
      var v = $mod.TTMSFNCGridCellRec.$new();
      v.$assign(Value);
      this.Put(Index,v);
    };
    this.Create$2 = function () {
      pas.Classes.TList.Create$1.call(this);
      return this;
    };
    this.Destroy = function () {
      this.Clear$1();
      pas.Classes.TList.Destroy.call(this);
    };
    this.AddCell = function (Cell) {
      this.Add($mod.TTMSFNCGridCellRec.$clone(Cell));
    };
    this.DeleteCell = function (Cell) {
      var i = 0;
      var p = $mod.TTMSFNCGridCellRec.$new();
      for (var $l = this.GetCount() - 1; $l >= 0; $l--) {
        i = $l;
        p.$assign(this.GetItem(i));
        if ((p.Col === Cell.Col) && (p.Row === Cell.Row)) this.Delete(i);
      };
    };
    this.DeleteCell$1 = function (index) {
      if ((index >= 0) && (index < this.GetCount())) this.Delete(index);
    };
    this.Clear$1 = function () {
      while (this.GetCount() > 0) {
        this.Delete(this.GetCount() - 1);
      };
    };
    this.Find = function (Cell) {
      var Result = 0;
      var i = 0;
      var p = $mod.TTMSFNCGridCellRec.$new();
      Result = -1;
      for (var $l = this.GetCount() - 1; $l >= 0; $l--) {
        i = $l;
        p.$assign(this.GetItem(i));
        if ((p.Col === Cell.Col) && (p.Row === Cell.Row)) {
          Result = i;
          break;
        };
      };
      return Result;
    };
    this.FindFixed = function (Cell) {
      var Result = 0;
      var i = 0;
      var p = $mod.TTMSFNCGridCellRec.$new();
      Result = -1;
      for (var $l = this.GetCount() - 1; $l >= 0; $l--) {
        i = $l;
        p.$assign(this.GetItem(i));
        if ((p.Row === Cell.Row) || (p.Col === Cell.Col)) {
          Result = i;
          break;
        };
      };
      return Result;
    };
  });
  this.TTMSFNCGridExportState = {"0": "esExportStart", esExportStart: 0, "1": "esExportNewRow", esExportNewRow: 1, "2": "esExportDone", esExportDone: 2, "3": "esExportSelRow", esExportSelRow: 3, "4": "esExportFail", esExportFail: 4, "5": "esExportNextRow", esExportNextRow: 5, "6": "esExportFindRow", esExportFindRow: 6};
  this.$rtti.$Enum("TTMSFNCGridExportState",{minvalue: 0, maxvalue: 6, ordtype: 1, enumtype: this.TTMSFNCGridExportState});
  this.TTMSFNCGridImportState = {"0": "isImportStart", isImportStart: 0, "1": "isImportNewRow", isImportNewRow: 1, "2": "isImportDone", isImportDone: 2, "3": "isImportSelRow", isImportSelRow: 3};
  this.$rtti.$Enum("TTMSFNCGridImportState",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TTMSFNCGridImportState});
  this.TTMSFNCGridEditorType = {"0": "etEdit", etEdit: 0, "1": "etNumericEdit", etNumericEdit: 1, "2": "etSignedNumericEdit", etSignedNumericEdit: 2, "3": "etFloatEdit", etFloatEdit: 3, "4": "etSignedFloatEdit", etSignedFloatEdit: 4, "5": "etUppercaseEdit", etUppercaseEdit: 5, "6": "etMixedCaseEdit", etMixedCaseEdit: 6, "7": "etLowerCaseEdit", etLowerCaseEdit: 7, "8": "etMoneyEdit", etMoneyEdit: 8, "9": "etHexEdit", etHexEdit: 9, "10": "etAlphaNumericEdit", etAlphaNumericEdit: 10, "11": "etValidCharsEdit", etValidCharsEdit: 11, "12": "etComboBox", etComboBox: 12, "13": "etSpinBox", etSpinBox: 13, "14": "etDatePicker", etDatePicker: 14, "15": "etColorPicker", etColorPicker: 15, "16": "etTrackBar", etTrackBar: 16, "17": "etMemo", etMemo: 17, "18": "etCustom", etCustom: 18};
  this.$rtti.$Enum("TTMSFNCGridEditorType",{minvalue: 0, maxvalue: 18, ordtype: 1, enumtype: this.TTMSFNCGridEditorType});
  this.$rtti.$MethodVar("TTMSFNCGridIOProgressEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["CurrentRow",rtl.longint],["TotalRows",rtl.longint],["Progres",rtl.smallint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridIOEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Col",rtl.longint],["Row",rtl.longint],["Value",rtl.string,1]]), methodkind: 0});
  this.TTMSFNCGridColumnType = {"0": "ctDefault", ctDefault: 0, "1": "ctButton", ctButton: 1, "2": "ctCheckBox", ctCheckBox: 2, "3": "ctProgressBar", ctProgressBar: 3, "4": "ctRadioButton", ctRadioButton: 4};
  this.$rtti.$Enum("TTMSFNCGridColumnType",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TTMSFNCGridColumnType});
  rtl.createClass(this,"TTMSFNCGridColumn",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FGrid = null;
      this.FColor = 0;
      this.FVertAlignment = 0;
      this.FHorzAlignment = 0;
      this.FSortFormat = 0;
      this.FFont = null;
      this.FEditor = 0;
      this.FReadOnly = false;
      this.FBorderColor = 0;
      this.FID$1 = "";
      this.FBorderWidth = 0;
      this.FWordWrap = false;
      this.FFixed = false;
      this.FSortPrefix = "";
      this.FSortSuffix = "";
      this.FTag = 0;
      this.FComboItems = null;
      this.FColumnType = 0;
      this.FName = "";
      this.FFixedFont = null;
    };
    this.$final = function () {
      this.FGrid = undefined;
      this.FFont = undefined;
      this.FComboItems = undefined;
      this.FFixedFont = undefined;
      pas.Classes.TCollectionItem.$final.call(this);
    };
    this.SetColor = function (Value) {
      if (this.FColor !== Value) {
        this.FColor = Value;
        this.Changed$1();
      };
    };
    this.SetHorzAlignment = function (Value) {
      if (this.FHorzAlignment !== Value) {
        this.FHorzAlignment = Value;
        this.Changed$1();
      };
    };
    this.SetVertAlignment = function (Value) {
      if (this.FVertAlignment !== Value) {
        this.FVertAlignment = Value;
        this.Changed$1();
      };
    };
    this.SetFont = function (Value) {
      this.FFont.Assign(Value);
      this.Changed$1();
    };
    this.SetBorderColor = function (Value) {
      if (this.FBorderColor !== Value) {
        this.FBorderColor = Value;
        this.Changed$1();
      };
    };
    this.SetBorderWidth = function (Value) {
      if (this.FBorderWidth !== Value) {
        this.FBorderWidth = Value;
        this.Changed$1();
      };
    };
    this.SetWordWrap = function (Value) {
      if (this.FWordWrap !== Value) {
        this.FWordWrap = Value;
        this.Changed$1();
      };
    };
    this.SetFixed = function (Value) {
      if (this.FFixed !== Value) {
        this.FFixed = Value;
        this.Changed$1();
      };
    };
    this.SetComboItems = function (Value) {
      this.FComboItems.Assign(Value);
    };
    this.SetColumnType = function (Value) {
      if (this.FColumnType !== Value) {
        this.FColumnType = Value;
        this.Changed$1();
      };
    };
    this.GetWidth = function () {
      var Result = 0.0;
      Result = rtl.as(this.FCollection.Owner(),$mod.TTMSFNCGridData).GetColWidths(this.GetIndex());
      return Result;
    };
    this.SetWidth = function (Value) {
      if (this.FCollection !== null) {
        rtl.as(this.FCollection.Owner(),$mod.TTMSFNCGridData).BeginUpdate();
        rtl.as(this.FCollection.Owner(),$mod.TTMSFNCGridData).SetColWidths(this.GetIndex(),Value);
        rtl.as(this.FCollection.Owner(),$mod.TTMSFNCGridData).EndUpdate();
      };
    };
    this.SetFixedFont = function (Value) {
      this.FFixedFont.Assign(Value);
      this.Changed$1();
    };
    this.IsWidthStored = function () {
      var Result = false;
      Result = this.GetWidth() !== 64;
      return Result;
    };
    this.Changed$1 = function () {
      if (this.FGrid != null) this.FGrid.UpdateGridCells(false);
    };
    this.GetDisplayName = function () {
      var Result = "";
      Result = "";
      if (this.FGrid != null) Result = this.FGrid.GetColumnDisplayName(this.GetIndex());
      return Result;
    };
    this.Create$1 = function (ACollection) {
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      if (this.FCollection != null) this.FGrid = rtl.as(this.FCollection,$mod.TTMSFNCGridColumns).FGrid;
      this.FColor = -1;
      this.FFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FFixedFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FFixedFont.SetStyle(rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsBold));
      this.FEditor = $mod.TTMSFNCGridEditorType.etEdit;
      this.FBorderColor = 12632256;
      this.FBorderWidth = 1;
      this.FComboItems = pas.Classes.TStringList.$create("Create$1");
      this.FColumnType = $mod.TTMSFNCGridColumnType.ctDefault;
      this.FHorzAlignment = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading;
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FComboItems");
      rtl.free(this,"FFont");
      rtl.free(this,"FFixedFont");
      pas.Classes.TCollectionItem.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCGridColumn.isPrototypeOf(Source)) {
        this.FBorderColor = rtl.as(Source,$mod.TTMSFNCGridColumn).FBorderColor;
        this.FBorderWidth = rtl.as(Source,$mod.TTMSFNCGridColumn).FBorderWidth;
        this.FColor = rtl.as(Source,$mod.TTMSFNCGridColumn).FColor;
        this.FFixed = rtl.as(Source,$mod.TTMSFNCGridColumn).FFixed;
        this.FFont.Assign(rtl.as(Source,$mod.TTMSFNCGridColumn).FFont);
        this.FHorzAlignment = rtl.as(Source,$mod.TTMSFNCGridColumn).FHorzAlignment;
        this.FID$1 = rtl.as(Source,$mod.TTMSFNCGridColumn).FID$1;
        this.FVertAlignment = rtl.as(Source,$mod.TTMSFNCGridColumn).FVertAlignment;
        this.FEditor = rtl.as(Source,$mod.TTMSFNCGridColumn).FEditor;
        this.FReadOnly = rtl.as(Source,$mod.TTMSFNCGridColumn).FReadOnly;
        this.FSortFormat = rtl.as(Source,$mod.TTMSFNCGridColumn).FSortFormat;
        this.FSortSuffix = rtl.as(Source,$mod.TTMSFNCGridColumn).FSortSuffix;
        this.FSortPrefix = rtl.as(Source,$mod.TTMSFNCGridColumn).FSortPrefix;
        this.FWordWrap = rtl.as(Source,$mod.TTMSFNCGridColumn).FWordWrap;
        this.FColumnType = rtl.as(Source,$mod.TTMSFNCGridColumn).FColumnType;
        this.FComboItems.Assign(rtl.as(Source,$mod.TTMSFNCGridColumn).FComboItems);
      };
    };
    var $r = this.$rtti;
    $r.addProperty("BorderColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FBorderColor","SetBorderColor",4,{Default: 12632256});
    $r.addProperty("BorderWidth",2,rtl.longint,"FBorderWidth","SetBorderWidth");
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor",4,{Default: -1});
    $r.addProperty("ColumnType",2,$mod.$rtti["TTMSFNCGridColumnType"],"FColumnType","SetColumnType",4,{Default: $mod.TTMSFNCGridColumnType.ctDefault});
    $r.addProperty("ComboItems",2,pas.Classes.$rtti["TStringList"],"FComboItems","SetComboItems");
    $r.addProperty("Editor",0,$mod.$rtti["TTMSFNCGridEditorType"],"FEditor","FEditor",4,{Default: $mod.TTMSFNCGridEditorType.etEdit});
    $r.addProperty("Fixed",2,rtl.boolean,"FFixed","SetFixed",4,{Default: false});
    $r.addProperty("FixedFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FFixedFont","SetFixedFont");
    $r.addProperty("Font",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FFont","SetFont");
    $r.addProperty("HorzAlignment",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FHorzAlignment","SetHorzAlignment",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading});
    $r.addProperty("ID",0,rtl.string,"FID$1","FID$1");
    $r.addProperty("Name",0,rtl.string,"FName","FName");
    $r.addProperty("ReadOnly",0,rtl.boolean,"FReadOnly","FReadOnly",4,{Default: false});
    $r.addProperty("SortFormat",0,$mod.$rtti["TTMSFNCGridSortFormat"],"FSortFormat","FSortFormat",4,{Default: $mod.TTMSFNCGridSortFormat.ssAutomatic});
    $r.addProperty("SortSuffix",0,rtl.string,"FSortSuffix","FSortSuffix");
    $r.addProperty("SortPrefix",0,rtl.string,"FSortPrefix","FSortPrefix");
    $r.addProperty("Tag",0,rtl.nativeint,"FTag","FTag",4,{Default: 0});
    $r.addProperty("VertAlignment",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FVertAlignment","SetVertAlignment",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter});
    $r.addProperty("Width",15,rtl.double,"GetWidth","SetWidth",4,{stored: "IsWidthStored"});
    $r.addProperty("WordWrap",2,rtl.boolean,"FWordWrap","SetWordWrap",4,{Default: false});
  });
  rtl.createClass(this,"TTMSFNCGridColumns",pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$init.call(this);
      this.FGrid = null;
    };
    this.$final = function () {
      this.FGrid = undefined;
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$final.call(this);
    };
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      this.SetItem(Index,Value);
    };
    this.Create$3 = function (AGrid) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AGrid,$mod.TTMSFNCGridColumn);
      this.FGrid = AGrid;
      return this;
    };
    this.ColumnByName = function (AName) {
      var Result = null;
      var i = 0;
      Result = null;
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.GetItem$1(i).FName === AName) {
          Result = this.GetItem$1(i);
          break;
        };
      };
      return Result;
    };
    this.ColumnByID = function (AID) {
      var Result = null;
      var i = 0;
      Result = null;
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.GetItem$1(i).FID$1 === AID) {
          Result = this.GetItem$1(i);
          break;
        };
      };
      return Result;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      return Result;
    };
    this.ByID = function (Id) {
      var Result = null;
      var i = 0;
      Result = null;
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.GetItem$1(i).FID$1 === Id) {
          Result = this.GetItem$1(i);
          break;
        };
      };
      return Result;
    };
  });
  rtl.createClass(this,"TTMSFNCGridRowInfoList",pas.Classes.TList,function () {
    this.GetItem = function (Index) {
      var Result = null;
      Result = rtl.getObject(this.Get(Index));
      return Result;
    };
    this.SetItem = function (Index, Value) {
      this.Put(Index,Value);
    };
  });
  rtl.createClass(this,"TTMSFNCGridIntegerList",pas.Classes.TList,function () {
    this.GetItem = function (Index) {
      var Result = 0;
      Result = rtl.trunc(this.Get(Index));
      return Result;
    };
    this.SetItem = function (Index, Value) {
      this.Put(Index,Value);
    };
  });
  rtl.createClass(this,"TTMSFNCGridSList",pas.Classes.TList,function () {
    this.GetItem = function (Index) {
      var Result = 0.0;
      Result = rtl.getNumber(this.Get(Index));
      return Result;
    };
    this.SetItem = function (Index, Value) {
      this.Put(Index,Value);
    };
  });
  rtl.createClass(this,"TTMSFNCGridData",pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControl,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControl.$init.call(this);
      this.FDefaultLayout = null;
      this.FOldSize = 0.0;
      this.FInternalColumnUpdate = false;
      this.FInternalRowUpdate = false;
      this.FColumnProp = null;
      this.FColumns = null;
      this.FUseColumns = false;
      this.FFirstCellApply = false;
      this.FBlockUpdate = false;
      this.FFocusedCell = $mod.TTMSFNCGridCellRec.$new();
      this.FStartCell = $mod.TTMSFNCGridCellRec.$new();
      this.FStopCell = $mod.TTMSFNCGridCellRec.$new();
      this.FRowList = null;
      this.FRowDisplayList = null;
      this.FColumnDisplayList = null;
      this.FSuppressedColumnList = null;
      this.FHiddenColumnList = null;
      this.FHiddenRowList = null;
      this.FColSelect = null;
      this.FSelectedCells = null;
      this.FRowCount = 0;
      this.FFilterApplied = false;
      this.FSortDirection = 0;
      this.FSortColumn = 0;
      this.FSortDir = 0;
      this.FIOOffset = pas.Types.TPoint.$new();
      this.FFilter = null;
      this.FSortIndexes = null;
      this.FCellCalcList = null;
      this.FSaveHiddenCells = false;
      this.FFindCol = 0;
      this.FFindRow = 0;
      this.FSearchCell = pas.Types.TPoint.$new();
      this.FSearchCache = "";
      this.FFindParams = {};
      this.FFindBusy = false;
      this.FColumnCount = 0;
      this.FFixedRows = 0;
      this.FFixedColumns = 0;
      this.FRowH = null;
      this.FFixedRightColumns = 0;
      this.FColumnW = null;
      this.FOrigColumnW = null;
      this.FFixedFooterRows = 0;
      this.FDefaultRowHeight = 0.0;
      this.FDefaultColumnWidth = 0.0;
      this.FCheckFalse = "";
      this.FCheckTrue = "";
      this.FPrevProgress = 0;
      this.FGroupColumn = 0;
      this.FGroupWidth = 0.0;
      this.FGroupCaption = "";
      this.FGroupFooter = "";
      this.FIsGrouping = false;
      this.FFloatFormat = "";
      this.FClipTopLeft = pas.Types.TPoint.$new();
      this.FClipOperation = 0;
      this.FColumnOrder = null;
      this.FBitmapContainer = null;
      this.FOnIOProgress = null;
      this.FOnSortFormat = null;
      this.FOnCustomCompare = null;
      this.FOnRawCompare = null;
      this.FOptions = null;
      this.FMarkList = null;
      this.FDefaultFont = null;
      this.FOnClipboardAfterPasteCell = null;
      this.FOnClipboardBeforePasteCell = null;
      this.FOnCellsChanged = null;
      this.FOnClipboardPaste = null;
      this.FOnLoadCell = null;
      this.FOnSaveCell = null;
      this.FOnNeedFilterDropDown = null;
      this.FOnNeedFilterDropDownData = null;
      this.FOnFilterSelect = null;
      this.FOnGroupCalc = null;
      this.FOnColumnCalc = null;
      this.FOnAfterApplyFilter = null;
      this.FBlockSelectEventHandler = false;
      this.FOnSelectedCell = null;
      this.FOnSelectCell = null;
      this.FGlobalFont = null;
    };
    this.$final = function () {
      this.FDefaultLayout = undefined;
      this.FColumnProp = undefined;
      this.FColumns = undefined;
      this.FFocusedCell = undefined;
      this.FStartCell = undefined;
      this.FStopCell = undefined;
      this.FRowList = undefined;
      this.FRowDisplayList = undefined;
      this.FColumnDisplayList = undefined;
      this.FSuppressedColumnList = undefined;
      this.FHiddenColumnList = undefined;
      this.FHiddenRowList = undefined;
      this.FColSelect = undefined;
      this.FSelectedCells = undefined;
      this.FIOOffset = undefined;
      this.FFilter = undefined;
      this.FSortIndexes = undefined;
      this.FCellCalcList = undefined;
      this.FSearchCell = undefined;
      this.FFindParams = undefined;
      this.FRowH = undefined;
      this.FColumnW = undefined;
      this.FOrigColumnW = undefined;
      this.FClipTopLeft = undefined;
      this.FColumnOrder = undefined;
      this.FBitmapContainer = undefined;
      this.FOnIOProgress = undefined;
      this.FOnSortFormat = undefined;
      this.FOnCustomCompare = undefined;
      this.FOnRawCompare = undefined;
      this.FOptions = undefined;
      this.FMarkList = undefined;
      this.FDefaultFont = undefined;
      this.FOnClipboardAfterPasteCell = undefined;
      this.FOnClipboardBeforePasteCell = undefined;
      this.FOnCellsChanged = undefined;
      this.FOnClipboardPaste = undefined;
      this.FOnLoadCell = undefined;
      this.FOnSaveCell = undefined;
      this.FOnNeedFilterDropDown = undefined;
      this.FOnNeedFilterDropDownData = undefined;
      this.FOnFilterSelect = undefined;
      this.FOnGroupCalc = undefined;
      this.FOnColumnCalc = undefined;
      this.FOnAfterApplyFilter = undefined;
      this.FOnSelectedCell = undefined;
      this.FOnSelectCell = undefined;
      this.FGlobalFont = undefined;
      pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControl.$final.call(this);
    };
    this.SetDefaultColumnWidth = function (Value) {
      if (this.FDefaultColumnWidth !== Value) {
        this.BeginUpdate();
        this.FDefaultColumnWidth = Value;
        this.EndUpdate();
      };
    };
    this.SetDefaultRowHeight = function (Value) {
      if (this.FDefaultRowHeight !== Value) {
        this.BeginUpdate();
        this.FDefaultRowHeight = Value;
        this.EndUpdate();
      };
    };
    this.EnsureRow = function (Row) {
      while (this.FRowList.GetCount() <= Row) {
        this.FRowList.Add(null);
      };
      while (this.FRowDisplayList.GetCount() <= Row) {
        this.FRowDisplayList.Add(this.FRowDisplayList.GetCount());
      };
    };
    this.EnsureCol = function (Col) {
      while (this.FColumnDisplayList.GetCount() <= Col) {
        this.FColumnDisplayList.Add(this.FColumnDisplayList.GetCount());
        this.SetColumnCount(Col + 1);
      };
    };
    this.GetCells = function (Col, Row) {
      var Result = "";
      var sl = null;
      var RDisp = 0;
      var CDisp = 0;
      Result = "";
      if (Row >= this.FRowDisplayList.GetCount()) return Result;
      if (Col >= this.FColumnDisplayList.GetCount()) return Result;
      RDisp = -1;
      if ((Row >= 0) && (Row <= (this.FRowDisplayList.GetCount() - 1))) RDisp = this.FRowDisplayList.GetItem(Row);
      CDisp = -1;
      if ((Col >= 0) && (Col <= (this.FColumnDisplayList.GetCount() - 1))) CDisp = this.FColumnDisplayList.GetItem(Col);
      if ((RDisp >= 0) && (RDisp < this.FRowList.GetCount())) {
        if (this.FRowList.GetItem(RDisp) != null) {
          sl = this.FRowList.GetItem(RDisp).FData;
          if ((CDisp >= 0) && (CDisp < sl.GetCount())) {
            Result = sl.Get(CDisp);
          };
        };
      };
      return Result;
    };
    this.SetCells = function (Col, Row, Value) {
      var sl = null;
      var RDisp = 0;
      var CDisp = 0;
      this.EnsureRow(Row);
      this.EnsureCol(Col);
      RDisp = this.FRowDisplayList.GetItem(Row);
      CDisp = this.FColumnDisplayList.GetItem(Col);
      if (this.FRowList.GetItem(RDisp) != null) {
        sl = this.FRowList.GetItem(RDisp);
      } else {
        sl = $mod.TTMSFNCGridRowInfo.$create("Create$1");
        this.FRowList.SetItem(RDisp,sl);
      };
      while (sl.FData.GetCount() <= CDisp) sl.FData.AddObject("",null);
      sl.FData.Put(CDisp,Value);
      this.UpdateGridCells(false);
    };
    this.GetIntObjects = function (Col, Row) {
      var Result = null;
      var sl = null;
      Result = null;
      if ((Row >= 0) && (Row <= (this.FRowList.GetCount() - 1))) {
        if (this.FRowList.GetItem(Row) != null) {
          sl = this.FRowList.GetItem(Row).FData;
          if ((Col >= 0) && (Col <= (sl.GetCount() - 1))) Result = sl.GetObject(Col);
        };
      };
      return Result;
    };
    this.SetIntObjects = function (Col, Row, Value) {
      var sl = null;
      while (this.FRowList.GetCount() <= Row) {
        this.FRowList.Add(null);
        this.FRowDisplayList.Add(this.FRowDisplayList.GetCount());
      };
      if (this.FRowList.GetItem(Row) != null) {
        sl = this.FRowList.GetItem(Row);
      } else {
        sl = $mod.TTMSFNCGridRowInfo.$create("Create$1");
        this.FRowList.SetItem(Row,sl);
      };
      while (sl.FData.GetCount() <= Col) sl.FData.AddObject("",null);
      sl.FData.PutObject(Col,Value);
      this.UpdateGridCells(false);
    };
    this.GetRowCount = function () {
      var Result = 0;
      Result = this.FRowCount;
      return Result;
    };
    this.GetHiddenColCount = function () {
      var Result = 0;
      Result = this.FHiddenColumnList.GetCount();
      return Result;
    };
    this.GetHiddenRowCount = function () {
      var Result = 0;
      Result = this.FRowList.GetCount() - this.FRowDisplayList.GetCount();
      return Result;
    };
    this.GetTotalColCount = function () {
      var Result = 0;
      Result = this.GetColumnCount() + this.FHiddenColumnList.GetCount();
      return Result;
    };
    this.GetTotalRowCount = function () {
      var Result = 0;
      Result = this.FRowList.GetCount();
      return Result;
    };
    this.GetAllCells = function (Col, Row) {
      var Result = "";
      var sl = null;
      Result = "";
      if (Row < this.FRowList.GetCount()) {
        if (this.FRowList.GetItem(Row) != null) {
          sl = this.FRowList.GetItem(Row).FData;
          if (Col < sl.GetCount()) Result = sl.Get(Col);
        };
      };
      return Result;
    };
    this.SetAllCells = function (Col, Row, Value) {
      var sl = null;
      while (this.FRowList.GetCount() <= Row) {
        this.FRowList.Add(null);
      };
      while ((this.FRowDisplayList.GetCount() + this.FHiddenRowList.GetCount()) <= Row) {
        this.FRowDisplayList.Add(this.FRowDisplayList.GetCount());
      };
      while ((this.FColumnDisplayList.GetCount() + this.FHiddenColumnList.GetCount()) <= Col) {
        this.FColumnDisplayList.Add(this.FColumnDisplayList.GetCount());
        this.SetColumnCount(Col + 1);
      };
      if (this.FRowList.GetItem(Row) != null) {
        sl = this.FRowList.GetItem(Row);
      } else {
        sl = $mod.TTMSFNCGridRowInfo.$create("Create$1");
        this.FRowList.SetItem(Row,sl);
      };
      while (sl.FData.GetCount() <= Col) sl.FData.AddObject("",null);
      sl.FData.Put(Col,Value);
    };
    this.GetColors = function (Col, Row) {
      var Result = 0;
      var CellProp = null;
      Result = -1;
      CellProp = this.GetIntObjects(Col,Row);
      if (CellProp != null) Result = CellProp.FColor;
      return Result;
    };
    this.SetColors = function (Col, Row, Value) {
      var cp = null;
      cp = this.GetIntObjects(Col,Row);
      if (cp != null) {
        cp.FColor = Value}
       else {
        cp = $mod.TTMSFNCGridCellProperty.$create("Create$1",[this.GetDefaultFont(Col,Row)]);
        cp.FColor = Value;
        this.SetIntObjects(Col,Row,cp);
      };
    };
    this.SetColumnCount = function (Value) {
      var i = 0;
      while (Value > this.FColumns.GetCount()) this.FColumns.Add$1();
      this.BeginUpdate();
      if (Value < this.FColumnCount) this.ClearCells($mod.TTMSFNCGridCellRecRange.$clone(this.CellRange(Value,0,this.FColumnCount - 1,this.GetRowCount() - 1)));
      this.FColumnCount = Value;
      if (Value < this.FColumnDisplayList.GetCount()) {
        while (this.FColumnDisplayList.GetCount() > Value) {
          this.FColumnDisplayList.Delete(this.FColumnDisplayList.GetCount() - 1);
        };
      } else {
        i = 0;
        if (this.FColumnDisplayList.GetCount() > 0) i = this.FColumnDisplayList.GetItem(this.FColumnDisplayList.GetCount() - 1) + 1;
        while (this.FColumnDisplayList.GetCount() < Value) {
          this.FColumnDisplayList.Add(i);
          i += 1;
        };
      };
      this.DoColumnCountChanged();
      this.EndUpdate();
    };
    this.SetRowCount = function (Value) {
      var ri = null;
      this.BeginUpdate();
      if (Value < this.FRowCount) this.ClearCells($mod.TTMSFNCGridCellRecRange.$clone(this.CellRange(0,Value,this.GetColumnCount() - 1,this.FRowCount - 1)));
      this.FRowCount = Value;
      if (Value < this.FRowList.GetCount()) {
        while (this.FRowList.GetCount() > Value) {
          if (this.FRowList.GetItem(this.FRowList.GetCount() - 1) != null) {
            ri = this.FRowList.GetItem(this.FRowList.GetCount() - 1);
            ri = rtl.freeLoc(ri);
          };
          this.FRowList.Delete(this.FRowList.GetCount() - 1);
        };
      } else while (this.FRowList.GetCount() < Value) this.FRowList.Add(null);
      while (this.FRowDisplayList.GetCount() > this.FRowCount) this.FRowDisplayList.Delete(this.FRowDisplayList.GetCount() - 1);
      this.DoRowCountChanged();
      this.EndUpdate();
    };
    this.SetColumnW = function (Value) {
      if (this.FColumnW !== Value) {
        this.BeginUpdate();
        this.FColumnW.Assign(Value);
        this.EndUpdate();
      };
    };
    this.SetFixedColumns = function (Value) {
      if ((this.FFixedColumns !== Value) && (Value >= 0)) {
        this.BeginUpdate();
        this.FFirstCellApply = false;
        this.FFixedColumns = Value;
        this.EndUpdate();
      };
    };
    this.SetFixedFooterRows = function (Value) {
      if ((this.FFixedFooterRows !== Value) && (Value >= 0)) {
        this.BeginUpdate();
        this.FFirstCellApply = false;
        this.FFixedFooterRows = Value;
        this.EndUpdate();
      };
    };
    this.SetFixedRightColumns = function (Value) {
      if ((this.FFixedRightColumns !== Value) && (Value >= 0)) {
        this.BeginUpdate();
        this.FFirstCellApply = false;
        this.FFixedRightColumns = Value;
        this.EndUpdate();
      };
    };
    this.SetFixedRows = function (Value) {
      if ((this.FFixedRows !== Value) && (Value >= 0)) {
        this.BeginUpdate();
        this.FFirstCellApply = false;
        this.FFixedRows = Value;
        this.EndUpdate();
      };
    };
    this.SetRowH = function (Value) {
      if (this.FRowH !== Value) {
        this.BeginUpdate();
        this.FRowH.Assign(Value);
        this.EndUpdate();
      };
    };
    this.GetColumnCount = function () {
      var Result = 0;
      Result = this.FColumnCount;
      return Result;
    };
    this.SetColWidths = function (Col, Value) {
      var idx = 0;
      var c = null;
      idx = this.FColumnW.IndexOf(Col);
      if ((idx >= 0) && (idx <= (this.FColumnW.GetCount() - 1))) {
        if (Value === this.FDefaultColumnWidth) {
          this.FColumnW.Delete(idx)}
         else {
          this.FColumnW.GetItem$1(idx).SetValue(Math.max(0,Value));
          this.FColumnW.GetItem$1(idx).FCellVal = Col;
        };
      } else if (Value !== this.FDefaultColumnWidth) {
        c = this.FColumnW.Add$1();
        c.SetValue(Math.max(0,Value));
        c.FCellVal = Col;
      };
    };
    this.SetRowHeights = function (Row, Value) {
      var idx = 0;
      var r = null;
      idx = this.FRowH.IndexOf(Row);
      if ((idx >= 0) && (idx <= (this.FRowH.GetCount() - 1))) {
        if (Value === this.FDefaultRowHeight) {
          this.FRowH.Delete(idx)}
         else {
          this.FRowH.GetItem$1(idx).SetValue(Math.max(0,Value));
          this.FRowH.GetItem$1(idx).FCellVal = Row;
        };
      } else if (Value !== this.FDefaultRowHeight) {
        r = this.FRowH.Add$1();
        r.SetValue(Math.max(0,Value));
        r.FCellVal = Row;
      };
    };
    this.GetSelection = function () {
      var Result = $mod.TTMSFNCGridCellRecRange.$new();
      Result.StartCol = this.FStartCell.Col;
      Result.StartRow = this.FStartCell.Row;
      Result.EndCol = this.FStopCell.Col;
      Result.EndRow = this.FStopCell.Row;
      return Result;
    };
    this.SetSelection = function (Value) {
      var start = $mod.TTMSFNCGridCellRec.$new();
      var stop = $mod.TTMSFNCGridCellRec.$new();
      var val = $mod.TTMSFNCGridCellRecRange.$new();
      var vl = $mod.TTMSFNCGridCellRec.$new();
      var a = false;
      val.$assign(Value);
      if (this.IsNormalFixed(val.StartCol,val.StartRow)) {
        vl.$assign(this.NextSelectableColumn(val.StartCol,val.StartRow));
        val.StartCol = vl.Col;
        val.StartRow = vl.Row;
      };
      this.FStartCell.Col = val.StartCol;
      this.FStartCell.Row = val.StartRow;
      this.FStopCell.Col = val.EndCol;
      this.FStopCell.Row = val.EndRow;
      start.$assign(this.FStartCell);
      stop.$assign(this.FStopCell);
      a = true;
      if (this.FOnSelectCell != null) this.FOnSelectCell(this,start.Col,start.Row,{get: function () {
          return a;
        }, set: function (v) {
          a = v;
        }});
      if (a) {
        this.FBlockSelectEventHandler = true;
        this.SelectCell($mod.TTMSFNCGridCellRec.$clone(start),{},true);
        this.SelectCell($mod.TTMSFNCGridCellRec.$clone(stop),{},true);
        this.FBlockSelectEventHandler = false;
        if (this.FOnSelectedCell != null) this.FOnSelectedCell(this,start.Col,start.Row);
      };
      this.FFocusedCell.$assign(this.FStartCell);
      this.UpdateGridCells(false);
    };
    this.GetFocusedCell = function () {
      var Result = $mod.TTMSFNCGridCellRec.$new();
      Result.$assign(this.FFocusedCell);
      return Result;
    };
    this.SetFocusedCell = function (Value) {
      var val = $mod.TTMSFNCGridCellRec.$new();
      this.SetFocusCell(Value.Col,Value.Row);
      if (this.IsNormalFixed(this.GetFocusedCell().Col,this.GetFocusedCell().Row)) {
        val.$assign(this.NextSelectableColumn(this.GetFocusedCell().Col,this.GetFocusedCell().Row));
        this.SetFocusCell(val.Col,val.Row);
      };
      this.SelectCell($mod.TTMSFNCGridCellRec.$clone(this.FFocusedCell),{},false);
    };
    this.GetCellProps = function (Col, Row) {
      var Result = null;
      Result = this.GetIntObjects(Col,Row);
      return Result;
    };
    this.GetRowSelect = function (Row) {
      var Result = false;
      Result = false;
      if (Row < this.FRowList.GetCount()) {
        if (this.FRowList.GetItem(Row) != null) Result = this.FRowList.GetItem(Row).FState === $mod.TTMSFNCGridRowState.rsSelected;
      };
      return Result;
    };
    this.SetSortColumn = function (Value) {
      if (Value !== this.FSortColumn) this.SortData(Value,this.FSortDirection);
    };
    this.SetSortDirection = function (Value) {
      if (Value !== this.FSortDirection) this.SortData(this.FSortColumn,Value);
    };
    this.SetOptions = function (Value) {
      if (this.FOptions !== Value) this.FOptions.Assign(Value);
    };
    this.GetObjects = function (Col, Row) {
      var Result = null;
      var cp = null;
      Result = null;
      cp = this.GetIntObjects(Col,Row);
      if (cp != null) Result = cp.FObject;
      return Result;
    };
    this.SetObjects = function (Col, Row, Value) {
      var cp = null;
      cp = this.GetIntObjects(Col,Row);
      if (!(cp != null)) cp = $mod.TTMSFNCGridCellProperty.$create("Create$1",[this.GetDefaultFont(Col,Row)]);
      cp.FObject = Value;
      this.SetIntObjects(Col,Row,cp);
    };
    this.GetAllFloats = function (Col, Row) {
      var Result = 0.0;
      var s = "";
      var Res = 0.0;
      var Err = 0;
      s = this.GetAllCells(Col,Row);
      if ((s === "") || (s === "-")) s = "0";
      s = $impl.CleanupSep(s);
      pas.System.val$8(s,{get: function () {
          return Res;
        }, set: function (v) {
          Res = v;
        }},{get: function () {
          return Err;
        }, set: function (v) {
          Err = v;
        }});
      if (Err !== 0) {
        Result = 0}
       else Result = Res;
      return Result;
    };
    this.SetAllFloats = function (Col, Row, Value) {
      this.SetAllCells(Col,Row,pas.SysUtils.Format(this.FFloatFormat,pas.System.VarRecs(3,Value)));
    };
    this.GetAllInts = function (Col, Row) {
      var Result = 0;
      var s = "";
      var Res = 0;
      var Err = 0;
      s = this.GetAllCells(Col,Row);
      if ((s === "") || (s === "-")) s = "0";
      s = $impl.CleanupSep(s);
      pas.System.val$6(s,{get: function () {
          return Res;
        }, set: function (v) {
          Res = v;
        }},{get: function () {
          return Err;
        }, set: function (v) {
          Err = v;
        }});
      if (Err !== 0) {
        Result = 0}
       else Result = Res;
      return Result;
    };
    this.SetAllInts = function (Col, Row, Value) {
      this.SetAllCells(Col,Row,pas.SysUtils.IntToStr(Value));
    };
    this.GetMergeCellPrintPageNr = function (Col, Row) {
      var Result = 0;
      var cp = null;
      Result = -1;
      cp = this.GetIntObjects(Col,Row);
      if ((cp != null) && (cp.FBaseCol !== -1)) {
        Result = cp.FPrintPageNr;
      };
      return Result;
    };
    this.SetMergeCellPrintPageNr = function (Col, Row, Value) {
      var cp = null;
      cp = this.GetIntObjects(Col,Row);
      if ((cp != null) && (cp.FBaseCol !== -1)) {
        cp.FPrintPageNr = Value;
      };
    };
    this.GetHorzAlignments = function (Col, Row) {
      var Result = 0;
      var CellProp = null;
      Result = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading;
      CellProp = this.GetIntObjects(Col,Row);
      if (CellProp != null) Result = CellProp.FAlignHorz;
      return Result;
    };
    this.SetHorzAlignments = function (Col, Row, Value) {
      var cp = null;
      cp = this.GetIntObjects(Col,Row);
      if (cp != null) {
        cp.FAlignHorz = Value}
       else {
        cp = $mod.TTMSFNCGridCellProperty.$create("Create$1",[this.GetDefaultFont(Col,Row)]);
        cp.FAlignHorz = Value;
        this.SetIntObjects(Col,Row,cp);
      };
    };
    this.GetVertAlignments = function (Col, Row) {
      var Result = 0;
      var CellProp = null;
      Result = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      CellProp = this.GetIntObjects(Col,Row);
      if (CellProp != null) Result = CellProp.FAlignVert;
      return Result;
    };
    this.SetVertAlignments = function (Col, Row, Value) {
      var cp = null;
      cp = this.GetIntObjects(Col,Row);
      if (cp != null) {
        cp.FAlignVert = Value}
       else {
        cp = $mod.TTMSFNCGridCellProperty.$create("Create$1",[this.GetDefaultFont(Col,Row)]);
        cp.FAlignVert = Value;
        this.SetIntObjects(Col,Row,cp);
      };
    };
    this.GetFontStyles = function (Col, Row) {
      var Result = {};
      var CellProp = null;
      Result = {};
      CellProp = this.GetIntObjects(Col,Row);
      if (CellProp != null) Result = rtl.refSet(CellProp.FFontStyle);
      return Result;
    };
    this.SetFontStyles = function (Col, Row, Value) {
      var cp = null;
      cp = this.GetIntObjects(Col,Row);
      if (cp != null) {
        cp.FFontStyle = rtl.refSet(Value)}
       else {
        cp = $mod.TTMSFNCGridCellProperty.$create("Create$1",[this.GetDefaultFont(Col,Row)]);
        cp.FFontStyle = rtl.refSet(Value);
        this.SetIntObjects(Col,Row,cp);
      };
    };
    this.GetFontSizes = function (Col, Row) {
      var Result = 0.0;
      var CellProp = null;
      Result = 12;
      CellProp = this.GetIntObjects(Col,Row);
      if (CellProp != null) Result = CellProp.FFontSize;
      return Result;
    };
    this.SetFontSizes = function (Col, Row, Value) {
      var cp = null;
      cp = this.GetIntObjects(Col,Row);
      if (cp != null) {
        cp.FFontSize = Value}
       else {
        cp = $mod.TTMSFNCGridCellProperty.$create("Create$1",[this.GetDefaultFont(Col,Row)]);
        cp.FFontSize = Value;
        this.SetIntObjects(Col,Row,cp);
      };
    };
    this.GetFontNames = function (Col, Row) {
      var Result = "";
      var CellProp = null;
      Result = this.FDefaultFont.FName;
      CellProp = this.GetIntObjects(Col,Row);
      if (CellProp != null) Result = CellProp.FFontName;
      return Result;
    };
    this.SetFontNames = function (Col, Row, Value) {
      var cp = null;
      cp = this.GetIntObjects(Col,Row);
      if (cp != null) {
        cp.FFontName = Value}
       else {
        cp = $mod.TTMSFNCGridCellProperty.$create("Create$1",[this.GetDefaultFont(Col,Row)]);
        cp.FFontName = Value;
        this.SetIntObjects(Col,Row,cp);
      };
    };
    this.GetFontColors = function (Col, Row) {
      var Result = 0;
      var CellProp = null;
      Result = -1;
      CellProp = this.GetIntObjects(Col,Row);
      if (CellProp != null) Result = CellProp.FFontColor;
      return Result;
    };
    this.SetFontColors = function (Col, Row, Value) {
      var cp = null;
      cp = this.GetIntObjects(Col,Row);
      if (cp != null) {
        cp.FFontColor = Value}
       else {
        cp = $mod.TTMSFNCGridCellProperty.$create("Create$1",[this.GetDefaultFont(Col,Row)]);
        cp.FFontColor = Value;
        this.SetIntObjects(Col,Row,cp);
      };
    };
    this.GetRowSelectionCount = function () {
      var Result = 0;
      var i = 0;
      var r = 0;
      r = 0;
      for (var $l = 0, $end = this.FRowList.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.GetRowSelect(i)) r += 1;
      };
      Result = r;
      return Result;
    };
    this.GetReadOnlys = function (Col, Row) {
      var Result = false;
      var cp = null;
      Result = false;
      cp = this.GetIntObjects(Col,Row);
      if (cp != null) Result = cp.FReadOnly;
      return Result;
    };
    this.SetReadOnlys = function (Col, Row, Value) {
      var cp = null;
      cp = this.GetIntObjects(Col,Row);
      if (!(cp != null)) cp = $mod.TTMSFNCGridCellProperty.$create("Create$1",[this.GetDefaultFont(Col,Row)]);
      cp.FReadOnly = Value;
      this.SetIntObjects(Col,Row,cp);
    };
    this.SaveToHTMLString = function (dir) {
      var $Self = this;
      var Result = "";
      var i = 0;
      var j = 0;
      var mc = 0;
      var mr = 0;
      var s = "";
      var tablestyle = "";
      var slist = null;
      var FirstRow = 0;
      var strtCol = 0;
      var strtRow = 0;
      var wraptxt = "";
      var colwtxt = "";
      var CellText = "";
      var SpanTxt = "";
      var DoneColW = false;
      var Span = pas.Types.TPoint.$new();
      var cssval = "";
      var cssidx = 0;
      var CSSList = null;
      var r = "";
      var Pic = null;
      var images_counter = 0;
      var htmlhdr = "";
      var summ = "";
      var l = null;
      var cellclasstype = null;
      var prevclasstype = null;
      var cellstr = "";
      var cell = null;
      var a = 0;
      function HTMLAddImage(Pic, counter, dir) {
        var Result = "";
        var fname = "";
        fname = dir + "images/img" + pas.SysUtils.IntToStr(counter) + ".png";
        Result = fname;
        return Result;
      };
      function MakeHREF(s) {
        var Result = "";
        Result = s;
        if (!$Self.FOptions.FURL.FShow) return Result;
        if ((pas.System.Pos("://",s) > 0) && (pas.System.Pos("</",s) === 0)) {
          if (!$Self.FOptions.FURL.FFull) {
            Result = "<a href=" + s + ">" + pas.System.Copy(s,pas.System.Pos("://",s) + 3,255) + "</a>"}
           else Result = "<a href=" + s + ">" + s + "</a>";
        };
        if ((pas.System.Pos("mailto:",s) > 0) && (pas.System.Pos("</",s) === 0)) {
          if (!$Self.FOptions.FURL.FFull) {
            Result = "<a href=" + s + ">" + pas.System.Copy(s,pas.System.Pos("mailto:",s) + 7,255) + "</a>"}
           else Result = "<a href=" + s + ">" + s + "</a>";
        };
        return Result;
      };
      function AppendStrEx(s, newstr) {
        if (s.get() === "") {
          s.set(newstr)}
         else s.set(s.get() + ";" + newstr);
      };
      function CSS(AFont, AColor, AFontColor, AHAlign, AVAlign, AAngle) {
        var Result = "";
        var r = "";
        r = "";
        if ((AColor !== -1) && $Self.FOptions.FHTMLExport.FSaveColors) AppendStrEx({get: function () {
            return r;
          }, set: function (v) {
            r = v;
          }},"background-color: " + pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.ColorToHTML(AColor) + "");
        if ((AFontColor !== -1) && $Self.FOptions.FHTMLExport.FSaveColors) AppendStrEx({get: function () {
            return r;
          }, set: function (v) {
            r = v;
          }},"color: " + pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.ColorToHTML(AFontColor) + "");
        AppendStrEx({get: function () {
            return r;
          }, set: function (v) {
            r = v;
          }},"font-size:" + pas.SysUtils.IntToStr(Math.round(AFont.FSize)) + "pt");
        if (pas["WEBLib.Graphics"].TFontStyle.fsItalic in AFont.FStyle) AppendStrEx({get: function () {
            return r;
          }, set: function (v) {
            r = v;
          }},"font-style: italic");
        if (pas["WEBLib.Graphics"].TFontStyle.fsBold in AFont.FStyle) AppendStrEx({get: function () {
            return r;
          }, set: function (v) {
            r = v;
          }},"font-weight: bold");
        AppendStrEx({get: function () {
            return r;
          }, set: function (v) {
            r = v;
          }},"font-family: " + AFont.FName + "");
        var $tmp = AHAlign;
        if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter) {
          AppendStrEx({get: function () {
              return r;
            }, set: function (v) {
              r = v;
            }},"text-align: center")}
         else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaTrailing) AppendStrEx({get: function () {
            return r;
          }, set: function (v) {
            r = v;
          }},"text-align: right");
        var $tmp1 = AVAlign;
        if ($tmp1 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading) {
          AppendStrEx({get: function () {
              return r;
            }, set: function (v) {
              r = v;
            }},"vertical-align: top")}
         else if ($tmp1 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter) {
          AppendStrEx({get: function () {
              return r;
            }, set: function (v) {
              r = v;
            }},"vertical-align: middle")}
         else if ($tmp1 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaTrailing) AppendStrEx({get: function () {
            return r;
          }, set: function (v) {
            r = v;
          }},"vertical-align: bottom");
        Result = r;
        return Result;
      };
      function ExportImg(ACol, ARow, lst, Pic) {
        var Result = "";
        var image = "";
        Result = "";
        if (!pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(Pic)) {
          image = '<img src= "file://' + HTMLAddImage(Pic,images_counter,dir) + '">';
          lst.Add('<TD class="c' + pas.SysUtils.IntToStr(cssidx) + '"' + SpanTxt + wraptxt + colwtxt + ">" + image + s + "</td>");
          images_counter += 1;
        } else lst.Add('<TD class="c' + pas.SysUtils.IntToStr(cssidx) + '"' + SpanTxt + wraptxt + colwtxt + ">" + s + "</td>");
        return Result;
      };
      strtCol = this.FIOOffset.x;
      strtRow = this.FIOOffset.y;
      slist = pas.Classes.TStringList.$create("Create$1");
      slist.SetSorted(false);
      CSSList = pas.Classes.TStringList.$create("Create$1");
      DoneColW = false;
      htmlhdr = "";
      cell = null;
      cellclasstype = null;
      prevclasstype = null;
      l = pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCellLayout.$create("Create$1");
      try {
        if (this.FOptions.FHTMLExport.FXHTML) {
          htmlhdr = htmlhdr + '<?xml version="1.0" encoding="utf-8"?>\r\n' + '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"\r\n' + '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r\n' + '<HTML xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r\n';
        };
        if (this.FOptions.FHTMLExport.FPrefixTag !== "") htmlhdr = htmlhdr + this.FOptions.FHTMLExport.FPrefixTag;
        if (this.FOptions.FHTMLExport.FTableStyle !== "") {
          tablestyle = " " + this.FOptions.FHTMLExport.FTableStyle + " "}
         else tablestyle = "";
        if (this.FOptions.FHTMLExport.FSummary !== "") {
          summ = 'SUMMARY="' + this.FOptions.FHTMLExport.FSummary + '" '}
         else summ = "";
        slist.Add('<TABLE BORDER="' + pas.SysUtils.IntToStr(this.FOptions.FHTMLExport.FBorderSize) + '" ' + 'CELLSPACING="' + pas.SysUtils.IntToStr(this.FOptions.FHTMLExport.FCellSpacing) + '" ' + 'CELLPADDING="' + pas.SysUtils.IntToStr(this.FOptions.FHTMLExport.FCellPadding) + '" ' + summ + tablestyle + ' WIDTH="' + pas.SysUtils.IntToStr(this.FOptions.FHTMLExport.FWidth) + '%">');
        FirstRow = strtRow;
        if ((this.FFixedRows > 0) && (this.FIOOffset.y < this.FFixedRows)) {
          slist.Add("<TR>");
          DoneColW = true;
          for (var $l = strtCol, $end = this.GetColumnCount() - 1; $l <= $end; $l++) {
            i = $l;
            mc = 0;
            mr = 0;
            if (this.IsBaseCellEx(i,0,{get: function () {
                return mc;
              }, set: function (v) {
                mc = v;
              }},{get: function () {
                return mr;
              }, set: function (v) {
                mr = v;
              }})) {
              Span.$assign(this.CellSpan(i,0));
              SpanTxt = "";
              if (Span.x > 0) SpanTxt = ' COLSPAN="' + pas.SysUtils.IntToStr(Span.x) + '"';
              if (Span.y > 0) SpanTxt = SpanTxt + ' ROWSPAN="' + pas.SysUtils.IntToStr(Span.y) + '"';
              CellText = this.DoSaveCell(i,0);
              s = pas["WEBLib.TMSFNCGridDataUtil"].HTMLLineBreaks(CellText);
              s = MakeHREF(s);
              if (s === "") s = "&nbsp;";
              if (this.FOptions.FHTMLExport.FColumnWidths.GetCount() > i) {
                colwtxt = " WIDTH=" + pas.SysUtils.IntToStr(this.FOptions.FHTMLExport.FColumnWidths.GetInteger(i))}
               else colwtxt = "";
              cellclasstype = null;
              this.DoGetCellClass(i,0,{get: function () {
                  return cellclasstype;
                }, set: function (v) {
                  cellclasstype = v;
                }});
              cellstr = "";
              this.DoGetCellData(i,0,{get: function () {
                  return cellstr;
                }, set: function (v) {
                  cellstr = v;
                }});
              if ((prevclasstype !== cellclasstype) && (prevclasstype !== null) && (cell != null)) cell = rtl.freeLoc(cell);
              if (prevclasstype !== cellclasstype) {
                cell = cellclasstype.$create("Create$1",[$Self]);
                if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell.isPrototypeOf(cell)) rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).FBitmapContainer = this.GetBitmapContainer();
                prevclasstype = cellclasstype;
              };
              if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell.isPrototypeOf(cell)) {
                l.Assign(rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).FLayout);
                l.Assign(this.GetDefaultNormalLayout());
                this.DoGetCellLayout(i,0,l,$mod.TTMSFNCGridCellState.csNormal);
                rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).AssignLayout(l);
              };
              this.DoGetCellProperties(i,0,cell);
              a = 0;
              this.DoGetCellRotation(i,0,{get: function () {
                  return a;
                }, set: function (v) {
                  a = v;
                }});
              wraptxt = "";
              cssval = CSS(l.FFont,l.FFill.FColor,l.FFont.FColor,l.FTextAlign,l.FVerticalTextAlign,a);
              cssidx = CSSList.IndexOf(cssval);
              if (cssidx === -1) cssidx = CSSList.Add(cssval);
              if (this.FOptions.FHTMLExport.FExportImages) {
                Pic = this.GetBitmap(i,0)}
               else Pic = null;
              ExportImg(i,0,slist,Pic);
            };
          };
          slist.Add("</TR>");
          FirstRow = 1;
        };
        this.ExportNotification($mod.TTMSFNCGridExportState.esExportStart,FirstRow);
        images_counter = 1;
        for (var $l1 = FirstRow, $end1 = this.GetRowCount() - 1; $l1 <= $end1; $l1++) {
          i = $l1;
          this.ExportNotification($mod.TTMSFNCGridExportState.esExportNextRow,i);
          slist.Add("<TR>");
          for (var $l2 = strtCol, $end2 = this.GetColumnCount() - 1; $l2 <= $end2; $l2++) {
            j = $l2;
            if (this.IsBaseCellEx(j,i,{get: function () {
                return mc;
              }, set: function (v) {
                mc = v;
              }},{get: function () {
                return mr;
              }, set: function (v) {
                mr = v;
              }})) {
              Span.$assign(this.CellSpan(j,i));
              SpanTxt = "";
              if (Span.x > 0) SpanTxt = ' COLSPAN="' + pas.SysUtils.IntToStr(Span.x) + '"';
              if (Span.y > 0) SpanTxt = SpanTxt + ' ROWSPAN="' + pas.SysUtils.IntToStr(Span.y) + '"';
              CellText = this.DoSaveCell(j,i);
              s = CellText;
              if (this.FOptions.FHTMLExport.FConvertSpecialChars) s = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.FixMarkup(s,true);
              if (this.FOptions.FHTMLExport.FNonBreakingText) s = pas["WEBLib.TMSFNCGridDataUtil"].FixNonBreaking(s);
              s = pas["WEBLib.TMSFNCGridDataUtil"].HTMLLineBreaks(s);
              s = MakeHREF(s);
              cellclasstype = null;
              this.DoGetCellClass(j,i,{get: function () {
                  return cellclasstype;
                }, set: function (v) {
                  cellclasstype = v;
                }});
              cellstr = "";
              this.DoGetCellData(j,i,{get: function () {
                  return cellstr;
                }, set: function (v) {
                  cellstr = v;
                }});
              if ((prevclasstype !== cellclasstype) && (prevclasstype !== null) && (cell != null)) cell = rtl.freeLoc(cell);
              if (prevclasstype !== cellclasstype) {
                cell = cellclasstype.$create("Create$1",[$Self]);
                if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell.isPrototypeOf(cell)) rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).FBitmapContainer = this.GetBitmapContainer();
                prevclasstype = cellclasstype;
              };
              if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell.isPrototypeOf(cell)) {
                l.Assign(rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).FLayout);
                l.Assign(this.GetDefaultNormalLayout());
                this.DoGetCellLayout(j,i,l,$mod.TTMSFNCGridCellState.csNormal);
                rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).AssignLayout(l);
              };
              this.DoGetCellProperties(j,i,cell);
              a = 0;
              this.DoGetCellRotation(j,i,{get: function () {
                  return a;
                }, set: function (v) {
                  a = v;
                }});
              cssval = CSS(l.FFont,l.FFill.FColor,l.FFont.FColor,l.FTextAlign,l.FVerticalTextAlign,a);
              cssidx = CSSList.IndexOf(cssval);
              if (cssidx === -1) cssidx = CSSList.Add(cssval);
              if ((this.FOptions.FHTMLExport.FColumnWidths.GetCount() > (j - strtCol)) && !DoneColW) {
                colwtxt = " width=" + pas.SysUtils.IntToStr(this.FOptions.FHTMLExport.FColumnWidths.GetInteger(j - strtCol))}
               else colwtxt = "";
              if (pas.SysUtils.Trim(s) === "") s = "&nbsp;";
              wraptxt = "";
              if (this.FOptions.FHTMLExport.FExportImages) {
                Pic = this.GetBitmap(j,i)}
               else Pic = null;
              ExportImg(j,i,slist,Pic);
            };
          };
          slist.Add("</TR>");
        };
        this.ExportNotification($mod.TTMSFNCGridExportState.esExportDone,-1);
        slist.Add("</TABLE>");
        if (this.FOptions.FHTMLExport.FSuffixTag !== "") slist.Add(this.FOptions.FHTMLExport.FSuffixTag);
        if (this.FOptions.FHTMLExport.FXHTML) slist.Add("</HTML>");
        r = "<style>\r\n";
        for (var $l3 = 0, $end3 = CSSList.GetCount() - 1; $l3 <= $end3; $l3++) {
          cssidx = $l3;
          r = r + ".c" + pas.SysUtils.IntToStr(cssidx) + " {" + CSSList.Get(cssidx) + "}\r\n";
        };
        r = r + "</style>\r\n";
        Result = htmlhdr + r + slist.GetTextStr();
      } finally {
        if (cell != null) cell = rtl.freeLoc(cell);
        l = rtl.freeLoc(l);
        slist = rtl.freeLoc(slist);
        CSSList = rtl.freeLoc(CSSList);
      };
      return Result;
    };
    this.GetColumnSelect = function (Col) {
      var Result = false;
      Result = this.FColSelect.HasValue(Col);
      return Result;
    };
    this.GetColumnSelectionCount = function () {
      var Result = 0;
      Result = this.FColSelect.GetCount();
      return Result;
    };
    this.SetColumnSelect = function (Col, Value) {
      var idx = 0;
      idx = this.FColSelect.IndexOfValue(Col);
      if ((idx === -1) && Value) this.FColSelect.Add$1(Col);
      if ((idx !== -1) && !Value) this.FColSelect.Delete$1(idx);
      this.UpdateGridCells(false);
    };
    this.GetCellSelect = function (Col, Row) {
      var Result = false;
      Result = this.FSelectedCells.Find($mod.TTMSFNCGridCellRec.$clone($mod.MakeCell(Col,Row))) !== -1;
      return Result;
    };
    this.GetCellSelectionCount = function () {
      var Result = 0;
      Result = this.FSelectedCells.GetCount();
      return Result;
    };
    this.SetCellSelect = function (Col, Row, Value) {
      var idx = 0;
      var c = $mod.TTMSFNCGridCellRec.$new();
      c.$assign($mod.MakeCell(Col,Row));
      idx = this.FSelectedCells.Find($mod.TTMSFNCGridCellRec.$clone(c));
      if ((idx === -1) && Value) this.FSelectedCells.AddCell($mod.TTMSFNCGridCellRec.$clone(c));
      if ((idx !== -1) && !Value) this.FSelectedCells.DeleteCell$1(idx);
      this.UpdateGridCells(false);
    };
    this.GetSelectedColumn = function (index) {
      var Result = 0;
      Result = this.FColSelect.GetInteger(index);
      return Result;
    };
    this.GetSelectedRow = function (index) {
      var Result = 0;
      var i = 0;
      var cnt = 0;
      Result = -1;
      cnt = 0;
      for (var $l = 0, $end = this.GetRowCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.FRowList.GetItem(i) != null) {
          if (this.FRowList.GetItem(i).FState === $mod.TTMSFNCGridRowState.rsSelected) {
            if (cnt === index) {
              Result = i;
              break;
            };
            cnt += 1;
          };
        };
      };
      return Result;
    };
    this.GetSelectedCell = function (index) {
      var Result = $mod.TTMSFNCGridCellRec.$new();
      Result.$assign(this.FSelectedCells.GetItem(index));
      return Result;
    };
    this.GetCheckBoxState = function (Col, Row) {
      var Result = false;
      var cp = null;
      var c = 0;
      Result = false;
      cp = this.GetIntObjects(Col,Row);
      if (this.FUseColumns && !(cp != null)) {
        c = this.DisplToRealColumn(Col);
        if (c < this.FColumns.GetCount()) {
          if (this.FColumns.GetItem$1(c).FColumnType === $mod.TTMSFNCGridColumnType.ctCheckBox) {
            Result = this.GetCells(Col,Row) === this.FCheckTrue;
          };
        };
      } else {
        if ((cp != null) && (cp.FControl != null) && $mod.TTMSFNCGridCellCheckBox.isPrototypeOf(cp.FControl)) {
          Result = rtl.as(cp.FControl,$mod.TTMSFNCGridCellCheckBox).FChecked;
        };
        if ((cp != null) && (cp.FControl != null) && $mod.TTMSFNCGridCellDataCheckBox.isPrototypeOf(cp.FControl)) {
          Result = this.GetCells(Col,Row) === this.FCheckTrue;
        };
      };
      return Result;
    };
    this.SetCheckBoxState = function (Col, Row, Value) {
      var cp = null;
      var c = 0;
      cp = this.GetIntObjects(Col,Row);
      if (this.FUseColumns && !(cp != null)) {
        c = this.DisplToRealColumn(Col);
        if (c < this.FColumns.GetCount()) {
          if (this.FColumns.GetItem$1(c).FColumnType === $mod.TTMSFNCGridColumnType.ctCheckBox) {
            if (Value) {
              this.SetCells(Col,Row,this.FCheckTrue)}
             else this.SetCells(Col,Row,this.FCheckFalse);
          };
        };
      } else {
        if ((cp != null) && (cp.FControl != null) && $mod.TTMSFNCGridCellCheckBox.isPrototypeOf(cp.FControl)) {
          rtl.as(cp.FControl,$mod.TTMSFNCGridCellCheckBox).FChecked = Value;
        };
        if ((cp != null) && (cp.FControl != null) && $mod.TTMSFNCGridCellDataCheckBox.isPrototypeOf(cp.FControl)) {
          if (Value) {
            this.SetCells(Col,Row,this.FCheckTrue)}
           else this.SetCells(Col,Row,this.FCheckFalse);
        };
      };
      this.UpdateGridCells(false);
    };
    this.GetFixedCellSelect = function (Col, Row) {
      var Result = false;
      Result = this.FSelectedCells.FindFixed($mod.TTMSFNCGridCellRec.$clone($mod.MakeCell(Col,Row))) !== -1;
      return Result;
    };
    this.GetComments = function (Col, Row) {
      var Result = "";
      var CellProp = null;
      Result = "";
      CellProp = this.GetIntObjects(Col,Row);
      if (CellProp != null) Result = CellProp.FComment;
      return Result;
    };
    this.SetComments = function (Col, Row, Value) {
      var cp = null;
      cp = this.GetIntObjects(Col,Row);
      if (cp != null) {
        cp.FComment = Value}
       else {
        cp = $mod.TTMSFNCGridCellProperty.$create("Create$1",[this.GetDefaultFont(Col,Row)]);
        cp.FComment = Value;
        this.SetIntObjects(Col,Row,cp);
      };
    };
    this.GetCommentColors = function (Col, Row) {
      var Result = 0;
      var CellProp = null;
      Result = -1;
      CellProp = this.GetIntObjects(Col,Row);
      if (CellProp != null) Result = CellProp.FCommentColor;
      return Result;
    };
    this.SetCommentColors = function (Col, Row, Value) {
      var cp = null;
      cp = this.GetIntObjects(Col,Row);
      if (cp != null) {
        cp.FCommentColor = Value}
       else {
        cp = $mod.TTMSFNCGridCellProperty.$create("Create$1",[this.GetDefaultFont(Col,Row)]);
        cp.FCommentColor = Value;
        this.SetIntObjects(Col,Row,cp);
      };
    };
    this.GetColumnCalculation = function (Col) {
      var Result = 0;
      if (Col >= this.FCellCalcList.GetCount()) {
        Result = $mod.TTMSFNCGridColumnCalculation.ccNone;
      } else {
        Result = this.FCellCalcList.GetInteger(Col);
      };
      return Result;
    };
    this.SetColumnCalculation = function (Col, Value) {
      while (this.FCellCalcList.GetCount() <= Col) this.FCellCalcList.Add$1($mod.TTMSFNCGridColumnCalculation.ccNone);
      this.FCellCalcList.SetInteger(Col,Value);
      this.UpdateColumnCalc(Col,Value);
    };
    this.UpdateColumnCalc = function (Col, Value) {
      var str = "";
      var r = 0.0;
      if (this.FFixedFooterRows === 0) return;
      var $tmp = Value;
      if ($tmp === $mod.TTMSFNCGridColumnCalculation.ccNone) {
        str = ""}
       else if ($tmp === $mod.TTMSFNCGridColumnCalculation.ccSum) {
        str = pas.SysUtils.Format(this.FOptions.FEditing.FCalcFormat,pas.System.VarRecs(3,this.ColumnSum(Col,this.FFixedRows,this.GetRowCount() - this.FFixedFooterRows - 1)))}
       else if ($tmp === $mod.TTMSFNCGridColumnCalculation.ccAvg) {
        str = pas.SysUtils.Format(this.FOptions.FEditing.FCalcFormat,pas.System.VarRecs(3,this.ColumnAvg(Col,this.FFixedRows,this.GetRowCount() - this.FFixedFooterRows - 1)))}
       else if ($tmp === $mod.TTMSFNCGridColumnCalculation.ccCount) {
        r = this.GetRowCount() - this.FFixedFooterRows - this.FFixedRows;
        str = pas.SysUtils.Format(this.FOptions.FEditing.FCalcFormat,pas.System.VarRecs(3,r));
      } else if ($tmp === $mod.TTMSFNCGridColumnCalculation.ccMin) {
        str = pas.SysUtils.Format(this.FOptions.FEditing.FCalcFormat,pas.System.VarRecs(3,this.ColumnMin(Col,this.FFixedRows,this.GetRowCount() - this.FFixedFooterRows - 1)))}
       else if ($tmp === $mod.TTMSFNCGridColumnCalculation.ccMax) {
        str = pas.SysUtils.Format(this.FOptions.FEditing.FCalcFormat,pas.System.VarRecs(3,this.ColumnMax(Col,this.FFixedRows,this.GetRowCount() - this.FFixedFooterRows - 1)))}
       else if ($tmp === $mod.TTMSFNCGridColumnCalculation.ccCUSTOM) {
        str = pas.SysUtils.Format(this.FOptions.FEditing.FCalcFormat,pas.System.VarRecs(3,this.ColumnCustomCalc(Col,this.FFixedRows,this.GetRowCount() - this.FFixedFooterRows - 1)))}
       else if ($tmp === $mod.TTMSFNCGridColumnCalculation.ccDistinct) {
        str = pas.SysUtils.Format(this.FOptions.FEditing.FCalcFormat,pas.System.VarRecs(3,this.ColumnDistinct(Col,this.FFixedRows,this.GetRowCount() - this.FFixedFooterRows - 1)))}
       else if ($tmp === $mod.TTMSFNCGridColumnCalculation.ccStdDev) str = pas.SysUtils.Format(this.FOptions.FEditing.FCalcFormat,pas.System.VarRecs(3,this.ColumnStdDev(Col,this.FFixedRows,this.GetRowCount() - this.FFixedFooterRows - 1)));
      this.SetCells(Col,this.GetRowCount() - this.FFixedFooterRows,str);
    };
    this.GetFloats = function (Col, Row) {
      var Result = 0.0;
      var s = "";
      var Res = 0.0;
      var Err = 0;
      s = this.GetCells(Col,Row);
      this.DoGetCellData(Col,Row,{get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }});
      if ((s === "") || (s === "-")) s = "0";
      s = $impl.CleanupSep(s);
      pas.System.val$8(s,{get: function () {
          return Res;
        }, set: function (v) {
          Res = v;
        }},{get: function () {
          return Err;
        }, set: function (v) {
          Err = v;
        }});
      if (Err !== 0) {
        Result = 0}
       else Result = Res;
      return Result;
    };
    this.SetFloats = function (Col, Row, Value) {
      this.SetAllCells(Col,Row,pas.SysUtils.Format(this.FFloatFormat,pas.System.VarRecs(3,Value)));
    };
    this.GetInts = function (Col, Row) {
      var Result = 0;
      var s = "";
      var Res = 0;
      var Err = 0;
      s = this.GetCells(Col,Row);
      this.DoGetCellData(Col,Row,{get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }});
      if ((s === "") || (s === "-")) s = "0";
      s = $impl.CleanupSep(s);
      pas.System.val$6(s,{get: function () {
          return Res;
        }, set: function (v) {
          Res = v;
        }},{get: function () {
          return Err;
        }, set: function (v) {
          Err = v;
        }});
      if (Err !== 0) {
        Result = 0}
       else Result = Res;
      return Result;
    };
    this.SetInts = function (Col, Row, Value) {
      this.SetAllCells(Col,Row,pas.SysUtils.IntToStr(Value));
    };
    this.GetStrippedCells = function (Col, Row) {
      var Result = "";
      Result = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.HTMLStrip(this.GetCells(Col,Row));
      return Result;
    };
    this.GetRowText = function (Row) {
      var Result = "";
      var sl = null;
      var RDisp = 0;
      Result = "";
      if (Row >= this.FRowDisplayList.GetCount()) return Result;
      RDisp = this.FRowDisplayList.GetItem(Row);
      if (RDisp < this.FRowList.GetCount()) {
        if (this.FRowList.GetItem(RDisp) != null) {
          sl = this.FRowList.GetItem(RDisp).FData;
          sl.SetDelimiter(this.FOptions.FIO.FDelimiter);
          Result = sl.GetDelimitedText();
        };
      };
      return Result;
    };
    this.GetBitmaps = function (Col, Row) {
      var Result = null;
      var cp = null;
      cp = this.GetIntObjects(Col,Row);
      if ((cp != null) && (cp.FControl != null) && $mod.TTMSFNCGridCellBitmap.isPrototypeOf(cp.FControl)) {
        Result = rtl.as(cp.FControl,$mod.TTMSFNCGridCellBitmap).FBitmap}
       else Result = this.CreateBitmap(Col,Row);
      return Result;
    };
    this.GetBooleans = function (Col, Row) {
      var Result = false;
      Result = this.GetCheckBoxState(Col,Row);
      return Result;
    };
    this.SetBitmaps = function (Col, Row, Value) {
      var cp = null;
      cp = this.GetIntObjects(Col,Row);
      if (!(cp != null)) cp = $mod.TTMSFNCGridCellProperty.$create("Create$1",[this.GetDefaultFont(Col,Row)]);
      if (cp.FControl != null) cp.FreeControl();
      cp.FControl = $mod.TTMSFNCGridCellBitmap.$create("Create$1",[this]);
      rtl.as(cp.FControl,$mod.TTMSFNCGridCellBitmap).FBitmap.Assign(Value);
      this.SetIntObjects(Col,Row,cp);
    };
    this.SetBooleans = function (Col, Row, Value) {
      this.AddDataCheckBox(Col,Row,Value);
    };
    this.SetColumns = function (Value) {
      this.FColumns.Assign(Value);
    };
    this.SetOrigColumnW = function (Value) {
      this.FOrigColumnW.Assign(Value);
    };
    this.IsDefaultColumnWidthStored = function () {
      var Result = false;
      Result = this.FDefaultColumnWidth !== 68;
      return Result;
    };
    this.IsDefaultRowHeightStored = function () {
      var Result = false;
      Result = this.FDefaultRowHeight !== 24;
      return Result;
    };
    this.SetRowText = function (Row, Value) {
      var $Self = this;
      var str = null;
      var I = 0;
      function Split(ADelimiter, AInput, AStrings) {
        AStrings.Clear();
        AStrings.SetDelimiter(ADelimiter);
        AStrings.FStrictDelimiter = true;
        AStrings.SetDelimitedText(AInput);
      };
      str = pas.Classes.TStringList.$create("Create$1");
      Split(this.FOptions.FIO.FDelimiter,Value,str);
      for (var $l = this.FIOOffset.x, $end = (this.FIOOffset.x + str.GetCount()) - 1; $l <= $end; $l++) {
        I = $l;
        this.SetCells(I,Row,str.Get(I - this.FIOOffset.x));
      };
      str = rtl.freeLoc(str);
    };
    this.GetBitmapContainer = function () {
      var Result = null;
      Result = this.FBitmapContainer;
      return Result;
    };
    this.SetBitmapContainer = function (Value) {
      this.FBitmapContainer = Value;
    };
    this.GetCellCalcStates = function (Col, Row) {
      var Result = 0;
      var CellProp = null;
      Result = $mod.TTMSFNCGridCellCalcState.csNoCalc;
      CellProp = this.GetIntObjects(Col,Row);
      if (CellProp != null) Result = CellProp.FCalcState;
      return Result;
    };
    this.SetCellCalcStates = function (Col, Row, Value) {
      var cp = null;
      cp = this.GetIntObjects(Col,Row);
      if (cp != null) {
        cp.FCalcState = Value}
       else {
        cp = $mod.TTMSFNCGridCellProperty.$create("Create$1",[this.GetDefaultFont(Col,Row)]);
        cp.FCalcState = Value;
        this.SetIntObjects(Col,Row,cp);
      };
    };
    this.GetCalcValues = function (Col, Row) {
      var Result = undefined;
      var CellProp = null;
      Result = "";
      CellProp = this.GetIntObjects(Col,Row);
      if (CellProp != null) Result = CellProp.FCalcValue;
      return Result;
    };
    this.SetCalcValues = function (Col, Row, Value) {
      var cp = null;
      cp = this.GetIntObjects(Col,Row);
      if (cp != null) {
        cp.FCalcValue = Value}
       else {
        cp = $mod.TTMSFNCGridCellProperty.$create("Create$1",[this.GetDefaultFont(Col,Row)]);
        cp.FCalcValue = Value;
        this.SetIntObjects(Col,Row,cp);
      };
    };
    this.SetDefaultFont = function (Value) {
      this.FDefaultFont.Assign(Value);
    };
    this.SetGlobalFont = function (Value) {
      this.FGlobalFont.Assign(Value);
    };
    this.GetDataRowCount = function () {
      var Result = 0;
      Result = this.GetRowCount() - this.FFixedRows - this.FFixedFooterRows;
      return Result;
    };
    this.DataGetItemIndex = function () {
      var Result = 0;
      Result = this.FFocusedCell.Row - this.FFixedRows;
      return Result;
    };
    this.ClearData = function () {
      this.Clear();
      this.SetRowCount(this.FFixedRows + this.FFixedFooterRows);
      this.SetColumnCount(this.FFixedColumns + this.FFixedRightColumns);
    };
    this.SetDataColumnCount = function (AValue) {
      this.SetColumnCount(AValue + this.FFixedRows + this.FFixedRightColumns);
    };
    this.SetDataRowCount = function (AValue) {
      this.SetRowCount(this.FFixedRows + this.FFixedFooterRows + AValue);
    };
    this.SetDataValue = function (AColumn, ARow, AValue) {
      this.SetCells(AColumn + this.FFixedColumns,ARow + this.FFixedRows,AValue);
    };
    this.SetDataHeader = function (AColumn, AValue) {
      this.SetCells(AColumn + this.FFixedColumns,0,AValue);
    };
    this.DataBeginUpdate = function () {
      this.BeginUpdate();
    };
    this.DataEndUpdate = function () {
      this.EndUpdate();
    };
    this.DataInsertRow = function (AInsertPosition) {
      this.InsertRow(AInsertPosition);
    };
    this.DataSetItemIndex = function (AValue) {
      this.SelectCell($mod.TTMSFNCGridCellRec.$clone($mod.MakeCell(this.FFocusedCell.Col,AValue + this.FFixedRows)),{},false);
    };
    this.SetRowSelect = function (Row, Value) {
      var sl = null;
      this.EnsureRow(Row);
      if (!(this.FRowList.GetItem(Row) != null)) {
        sl = $mod.TTMSFNCGridRowInfo.$create("Create$1");
        this.FRowList.SetItem(Row,sl);
      };
      if (Value) {
        this.FRowList.GetItem(Row).SetState($mod.TTMSFNCGridRowState.rsSelected)}
       else this.FRowList.GetItem(Row).SetState($mod.TTMSFNCGridRowState.rsDefault);
      this.UpdateGridCells(false);
    };
    this.GetColumnDisplayName = function (ACol) {
      var Result = "";
      var c = null;
      Result = "Column " + pas.SysUtils.IntToStr(ACol);
      if ((ACol >= 0) && (ACol <= (this.FColumns.GetCount() - 1))) {
        c = this.FColumns.GetItem$1(ACol);
        if (c.FName !== "") Result = c.FName;
      };
      return Result;
    };
    this.SelectCell = function (Cell, Shift, MouseDragging) {
    };
    this.SetStartCell = function (ACol, ARow) {
      this.FStartCell.Col = ACol;
      this.FStartCell.Row = ARow;
      this.FStartCell.Col = Math.max(this.FFixedColumns,Math.min(this.GetColumnCount() - 1 - this.FFixedRightColumns,this.FStartCell.Col));
      this.FStartCell.Row = Math.max(this.FFixedRows,Math.min(this.GetRowCount() - 1 - this.FFixedFooterRows,this.FStartCell.Row));
    };
    this.SetStopCell = function (ACol, ARow) {
      this.FStopCell.Col = ACol;
      this.FStopCell.Row = ARow;
      this.FStopCell.Col = Math.max(this.FFixedColumns,Math.min(this.GetColumnCount() - 1 - this.FFixedRightColumns,this.FStopCell.Col));
      this.FStopCell.Row = Math.max(this.FFixedRows,Math.min(this.GetRowCount() - 1 - this.FFixedFooterRows,this.FStopCell.Row));
    };
    this.SetFocusCell = function (ACol, ARow) {
      this.FFocusedCell.Col = ACol;
      this.FFocusedCell.Row = ARow;
      this.FFocusedCell.Col = Math.max(this.FFixedColumns,Math.min(this.GetColumnCount() - 1 - this.FFixedRightColumns,this.FFocusedCell.Col));
      this.FFocusedCell.Row = Math.max(this.FFixedRows,Math.min(this.GetRowCount() - 1 - this.FFixedFooterRows,this.FFocusedCell.Row));
    };
    this.GetColWidths = function (AIndex) {
      var Result = 0.0;
      var idx = 0;
      Result = 0;
      if (this.FSuppressedColumnList.IndexOf(AIndex) !== -1) return Result;
      idx = this.FColumnW.IndexOf(AIndex);
      if (idx !== -1) {
        Result = this.FColumnW.GetItem$1(idx).FValue}
       else Result = this.FDefaultColumnWidth;
      return Result;
    };
    this.GetRowHeights = function (AIndex) {
      var Result = 0.0;
      var idx = 0;
      idx = this.FRowH.IndexOf(AIndex);
      if (idx !== -1) {
        Result = this.FRowH.GetItem$1(idx).FValue}
       else Result = this.FDefaultRowHeight;
      return Result;
    };
    this.CompareLine = function (Col, Row1, Row2) {
      var Result = 0;
      var r = 0;
      if (this.IsIgnoredColumn(Col)) {
        r = 0}
       else r = this.CompareRows(Col,Row1,Row2);
      if ((r === 0) && this.FOptions.FSorting.FMultiColumn) {
        if (Col <= (this.GetColumnCount() - 2)) {
          Col += 1;
          r = this.CompareLine(Col,Row1,Row2);
        };
      };
      Result = r;
      return Result;
    };
    this.CompareRows = function (Col, Row1, Row2) {
      var Result = 0;
      var s1 = "";
      var s2 = "";
      var SortFormat = 0;
      var Prefix = "";
      var Suffix = "";
      var dt1 = 0.0;
      var dt2 = 0.0;
      var db1 = 0.0;
      var db2 = 0.0;
      var st1 = "";
      var st2 = "";
      var b1 = false;
      var b2 = false;
      var r = 0;
      var err = 0;
      var t1 = 0;
      var t2 = 0;
      var v = 0.0;
      s1 = this.GetCells(Col,Row1);
      s2 = this.GetCells(Col,Row2);
      if (this.FOptions.FSorting.FIgnoreCase) {
        s1 = pas.SysUtils.UpperCase(s1);
        s2 = pas.SysUtils.UpperCase(s2);
      };
      Suffix = "";
      Prefix = "";
      SortFormat = $mod.TTMSFNCGridSortFormat.ssAutomatic;
      this.DoSortFormat(Col,{get: function () {
          return SortFormat;
        }, set: function (v) {
          SortFormat = v;
        }},{get: function () {
          return Prefix;
        }, set: function (v) {
          Prefix = v;
        }},{get: function () {
          return Suffix;
        }, set: function (v) {
          Suffix = v;
        }});
      var $tmp = SortFormat;
      if ($tmp === $mod.TTMSFNCGridSortFormat.ssAutomatic) {
        t1 = pas["WEBLib.TMSFNCGridDataUtil"].IsType(s1);
        t2 = pas["WEBLib.TMSFNCGridDataUtil"].IsType(s2);
        if ((t1 in rtl.createSet(pas["WEBLib.TMSFNCGridDataUtil"].TTMSFNCGridAutoType.atNumeric,pas["WEBLib.TMSFNCGridDataUtil"].TTMSFNCGridAutoType.atFloat)) && (t2 in rtl.createSet(pas["WEBLib.TMSFNCGridDataUtil"].TTMSFNCGridAutoType.atNumeric,pas["WEBLib.TMSFNCGridDataUtil"].TTMSFNCGridAutoType.atFloat))) {
          pas.System.val$8(s1,{get: function () {
              return db1;
            }, set: function (v) {
              db1 = v;
            }},{get: function () {
              return err;
            }, set: function (v) {
              err = v;
            }});
          pas.System.val$8(s2,{get: function () {
              return db2;
            }, set: function (v) {
              db2 = v;
            }},{get: function () {
              return err;
            }, set: function (v) {
              err = v;
            }});
          if (db1 === db2) {
            r = 0}
           else if (db1 > db2) {
            r = 1}
           else r = -1;
        } else {
          if (s1 === s2) {
            r = 0}
           else if (s1 > s2) {
            r = 1}
           else r = -1;
        };
      } else if (($tmp === $mod.TTMSFNCGridSortFormat.ssAlphabetic) || ($tmp === $mod.TTMSFNCGridSortFormat.ssHTML)) {
        st1 = s1;
        st2 = s2;
        if (SortFormat === $mod.TTMSFNCGridSortFormat.ssHTML) {
          st1 = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.HTMLStrip(st1);
          st2 = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.HTMLStrip(st2);
        };
        if (st1 === st2) {
          r = 0}
         else if (st1 > st2) {
          r = 1}
         else r = -1;
      } else if ($tmp === $mod.TTMSFNCGridSortFormat.ssAlphabeticNoCase) {
        st1 = pas.SysUtils.UpperCase(pas["WEBLib.TMSFNCTypes"].VarToStr(s1));
        st2 = pas.SysUtils.UpperCase(pas["WEBLib.TMSFNCTypes"].VarToStr(s2));
        if (st1 === st2) {
          r = 0}
         else if (st1 > st2) {
          r = 1}
         else r = -1;
      } else if ($tmp === $mod.TTMSFNCGridSortFormat.ssNumeric) {
        if (s1 !== "") {
          v = Infinity;
          pas.SysUtils.TryStrToFloat$2(s1,{get: function () {
              return v;
            }, set: function (w) {
              v = w;
            }});
        } else v = Infinity - 1;
        db1 = v;
        if (s2 !== "") {
          v = Infinity;
          pas.SysUtils.TryStrToFloat$2(s2,{get: function () {
              return v;
            }, set: function (w) {
              v = w;
            }});
        } else v = Infinity - 1;
        db2 = v;
        if (db1 === db2) {
          r = 0}
         else if (db1 > db2) {
          r = 1}
         else r = -1;
      } else if ($tmp === $mod.TTMSFNCGridSortFormat.ssDate) {
        dt1 = 0;
        if (s1 !== "") try {
          dt1 = pas["WEBLib.TMSFNCTypes"].VarToDateTime(s1);
        } catch ($e) {
        };
        dt2 = 0;
        if (s2 !== "") try {
          dt2 = pas["WEBLib.TMSFNCTypes"].VarToDateTime(s2);
        } catch ($e) {
        };
        if (dt1 === dt2) {
          r = 0}
         else if (dt1 > dt2) {
          r = 1}
         else r = -1;
      } else if ($tmp === $mod.TTMSFNCGridSortFormat.ssCheckBox) {
        b1 = this.GetCheckBoxState(Col,Row1);
        b2 = this.GetCheckBoxState(Col,Row2);
        if (b1 && !b2) {
          r = 1}
         else if (b1 === b2) {
          r = 0}
         else r = -1;
      } else if ($tmp === $mod.TTMSFNCGridSortFormat.ssCustom) {
        this.DoCustomCompare(s1,s2,{get: function () {
            return r;
          }, set: function (v) {
            r = v;
          }});
      } else if ($tmp === $mod.TTMSFNCGridSortFormat.ssRaw) {
        this.DoRawCompare(Col,Row1,Row2,{get: function () {
            return r;
          }, set: function (v) {
            r = v;
          }});
      };
      if (this.FOptions.FSorting.FIgnoreBlanks) {
        var $tmp1 = this.FSortDirection;
        if ($tmp1 === $mod.TTMSFNCGridSortDirection.sdAscending) {
          if ((s1 === "") && (s2 !== "")) if (this.FOptions.FSorting.FBlankPosition === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSortBlankPosition.blFirst) {
            r = -1}
           else r = +1;
          if ((s2 === "") && (s1 !== "")) if (this.FOptions.FSorting.FBlankPosition === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSortBlankPosition.blFirst) {
            r = +1}
           else r = -1;
        } else if ($tmp1 === $mod.TTMSFNCGridSortDirection.sdDescending) {
          if ((s1 === "") && (s2 !== "")) if (this.FOptions.FSorting.FBlankPosition === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSortBlankPosition.blFirst) {
            r = +1}
           else r = -1;
          if ((s2 === "") && (s1 !== "")) if (this.FOptions.FSorting.FBlankPosition === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSortBlankPosition.blFirst) {
            r = -1}
           else r = +1;
        };
      };
      Result = r;
      return Result;
    };
    this.CompareRowsIndexed = function (Col, Row1, Row2) {
      var Result = 0;
      var r = 0;
      var idx = 0;
      var sd = 0;
      idx = this.FSortIndexes.GetInteger(Col) & 0x7FFFFFFF;
      if ((this.FSortIndexes.GetInteger(Col) & 0x80000000) === 0x80000000) {
        sd = $mod.TTMSFNCGridSortDirection.sdDescending}
       else sd = $mod.TTMSFNCGridSortDirection.sdAscending;
      if (this.IsIgnoredColumn(idx)) {
        r = 0}
       else r = this.CompareRows(idx,Row1,Row2);
      if ((r === 0) && this.FOptions.FSorting.FMultiColumn) {
        if (Col < (this.FSortIndexes.GetCount() - 1)) {
          Col += 1;
          r = this.CompareRowsIndexed(Col,Row1,Row2);
        };
      } else {
        if (sd === $mod.TTMSFNCGridSortDirection.sdDescending) {
          r = -r;
        };
      };
      Result = r;
      return Result;
    };
    this.QuickSortRows = function (Col, L, R) {
      var i = 0;
      var j = 0;
      var k = 0;
      var m = 0;
      if (this.FSortDirection === $mod.TTMSFNCGridSortDirection.sdAscending) {
        this.FSortDir = 1}
       else this.FSortDir = -1;
      i = L;
      j = R;
      m = (L + R) >>> 1;
      for (var $l = 0, $end = this.GetColumnCount() - 1; $l <= $end; $l++) {
        k = $l;
        this.SetCells(k,this.GetRowCount() - 1,this.GetCells(k,m));
        this.SetObjects(k,this.GetRowCount() - 1,this.GetObjects(k,m));
      };
      do {
        while ((this.CompareRows(Col,this.GetRowCount() - 1,i) === this.FSortDir) && (i < R)) i += 1;
        while ((this.CompareRows(Col,j,this.GetRowCount() - 1) === this.FSortDir) && (j > L)) j -= 1;
        if (i <= j) {
          if (i !== j) {
            if (this.CompareRows(Col,i,j) !== 0) {
              var $tmp = this.FOptions.FSorting.FColumns;
              if ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSortColumns.scAll) {
                this.SwapRows(i,j)}
               else if ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSortColumns.scSingle) {
                this.SwapCells(Col,i,j)}
               else if ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSortColumns.scNormal) this.SwapNormalCells(i,j);
            };
          };
          i += 1;
          j -= 1;
        };
      } while (!(i > j));
      if (L < j) this.QuickSortRows(Col,L,j);
      if (i < R) this.QuickSortRows(Col,i,R);
    };
    this.QuickSortRowsIndexed = function (Col, L, R) {
      var i = 0;
      var j = 0;
      var k = 0;
      var m = 0;
      if (this.FSortDirection === $mod.TTMSFNCGridSortDirection.sdAscending) {
        this.FSortDir = 1}
       else this.FSortDir = -1;
      i = L;
      j = R;
      m = (L + R) >>> 1;
      for (var $l = 0, $end = this.GetColumnCount() - 1; $l <= $end; $l++) {
        k = $l;
        this.SetCells(k,this.GetRowCount() - 1,this.GetCells(k,m));
        this.SetObjects(k,this.GetRowCount() - 1,this.GetObjects(k,m));
      };
      do {
        while ((this.CompareRowsIndexed(Col,this.GetRowCount() - 1,i) === this.FSortDir) && (i < R)) i += 1;
        while ((this.CompareRowsIndexed(Col,j,this.GetRowCount() - 1) === this.FSortDir) && (j > L)) j -= 1;
        if (i <= j) {
          if (i !== j) {
            if (this.CompareRowsIndexed(Col,i,j) !== 0) {
              var $tmp = this.FOptions.FSorting.FColumns;
              if ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSortColumns.scAll) {
                this.SwapRows(i,j)}
               else if ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSortColumns.scNormal) {
                this.SwapNormalCells(i,j)}
               else if ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSortColumns.scSingle) this.SwapCells(Col,i,j);
            };
          };
          i += 1;
          j -= 1;
        };
      } while (!(i > j));
      if (L < j) this.QuickSortRowsIndexed(Col,L,j);
      if (i < R) this.QuickSortRowsIndexed(Col,i,R);
    };
    this.SortGroupedInt = function (Indexed) {
      var i = 0;
      var rr = 0;
      var r1 = 0;
      var r2 = 0;
      var span = 0;
      var idx = 0;
      var nodeClosed = [];
      var fltr = false;
      nodeClosed = rtl.arraySetLength(nodeClosed,false,0);
      fltr = false;
      i = this.FFixedRows;
      while (i <= (this.FRowCount - this.FFixedFooterRows)) {
        rr = this.DisplToRealRow(i);
        if (this.IsNode(rr)) {
          idx = rtl.length(nodeClosed);
          nodeClosed = rtl.arraySetLength(nodeClosed,false,idx + 1);
          if (this.GetNodeState(rr) === pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridNodeState.nsClosed) {
            nodeClosed[idx] = true}
           else nodeClosed[idx] = false;
        };
        i += 1;
      };
      this.OpenAllNodes();
      if (this.FFilterApplied) {
        this.RemoveFilter();
        fltr = true;
      };
      this.BeginUpdate();
      try {
        this.SetRowCount(this.GetRowCount() + 1);
        i = this.FFixedRows;
        while (i <= (this.FRowCount - this.FFixedFooterRows - 3)) {
          rr = this.DisplToRealRow(i);
          if (this.IsNode(rr)) {
            span = this.GetNodeSpan(rr);
            r1 = rr + 1;
            r2 = rr + span;
            if ((r2 - r1) >= 1) {
              if (Indexed) {
                this.QuickSortRowsIndexed(0,r1,r2)}
               else this.QuickSortRows(this.FSortColumn,r1,r2);
            };
            i = i + span;
          } else i += 1;
        };
        this.ClearCells($mod.TTMSFNCGridCellRecRange.$clone(this.CellRange(0,this.GetRowCount() - 1,this.GetColumnCount() - 1,this.GetRowCount() - 1)));
        this.SetRowCount(this.GetRowCount() - 1);
        i = this.FFixedRows;
        idx = 0;
        while (i <= (this.FRowCount - this.FFixedFooterRows)) {
          rr = this.DisplToRealRow(i);
          if (this.IsNode(rr)) {
            if (nodeClosed[idx]) this.CloseNode(rr);
            idx += 1;
          };
          i += 1;
        };
      } finally {
        if (fltr) this.ApplyFilter();
        this.EndUpdate();
      };
      this.UpdateGridCells(false);
    };
    this.MatchFilter = function (ARow) {
      var Result = false;
      var i = 0;
      var s = "";
      var temp = false;
      Result = true;
      for (var $l = 1, $end = this.FFilter.GetCount(); $l <= $end; $l++) {
        i = $l;
        var $with = this.FFilter.GetItem$1(i - 1);
        var $tmp = this.FFilter.GetItem$1(i - 1).FData;
        if ($tmp === $mod.TTMSFNCGridFilterCells.fcVirtual) {
          s = this.GetCells($with.FColumn,ARow)}
         else if ($tmp === $mod.TTMSFNCGridFilterCells.fcNormal) {
          s = this.GetCells($with.FColumn,ARow);
          this.DoGetCellData($with.FColumn,ARow,{get: function () {
              return s;
            }, set: function (v) {
              s = v;
            }});
        } else if ($tmp === $mod.TTMSFNCGridFilterCells.fcStripHTML) {
          s = this.GetStrippedCells($with.FColumn,ARow)}
         else if ($tmp === $mod.TTMSFNCGridFilterCells.fcRow) s = this.GetRowText(ARow);
        s = pas.SysUtils.Trim(s);
        if (this.FFilter.GetItem$1(i - 1).FData === $mod.TTMSFNCGridFilterCells.fcRow) {
          temp = pas.System.Pos(pas.SysUtils.UpperCase($with.FCondition),pas.SysUtils.UpperCase(s)) > 0;
        } else {
          if ($with.FPrefix !== "") if (pas.System.Pos($with.FPrefix,s) === 1) pas.System.Delete({get: function () {
              return s;
            }, set: function (v) {
              s = v;
            }},1,this.FFilter.GetItem$1(i - 1).FPrefix.length);
          if ($with.FSuffix !== "") if (pas.System.Pos($with.FSuffix,s) === ((1 + s.length) - $with.FSuffix.length)) pas.System.Delete({get: function () {
              return s;
            }, set: function (v) {
              s = v;
            }},(1 + s.length) - $with.FSuffix.length,s.length);
          try {
            temp = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MatchStrEx($with.FCondition,s,$with.FCaseSensitive);
          } catch ($e) {
            temp = false;
          };
        };
        var $tmp1 = this.FFilter.GetItem$1(i - 1).FOperation;
        if ($tmp1 === $mod.TTMSFNCGridFilterOperation.foSHORT) {
          Result = temp;
          if (!Result) break;
        } else if ($tmp1 === $mod.TTMSFNCGridFilterOperation.foNONE) {
          Result = temp}
         else if ($tmp1 === $mod.TTMSFNCGridFilterOperation.foAND) {
          Result = Result && temp}
         else if ($tmp1 === $mod.TTMSFNCGridFilterOperation.foOR) {
          Result = Result || temp}
         else if ($tmp1 === $mod.TTMSFNCGridFilterOperation.foXOR) Result = Result ^ temp;
      };
      return Result;
    };
    this.MatchCell = function (Col, Row) {
      var Result = false;
      var res1 = false;
      var res2 = false;
      var ct = "";
      var cs = "";
      var ic = 0;
      res2 = true;
      if ($mod.TTMSFNCGridFindParameters.fnIncludeHiddenRows in this.FFindParams) {
        cs = this.GetAllCells(Col,Row)}
       else cs = this.GetCells(Col,Row);
      if (!($mod.TTMSFNCGridFindParameters.fnMatchCase in this.FFindParams)) {
        ct = pas["WEBLib.TMSFNCTypes"].AnsiUpperCase(cs)}
       else ct = cs;
      if ($mod.TTMSFNCGridFindParameters.fnIgnoreHTMLTags in this.FFindParams) ct = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.HTMLStrip(ct);
      if (this.FSearchCache === '""') {
        Result = ct === "";
        return Result;
      };
      ic = pas.System.Pos(this.FSearchCache,ct);
      if ($mod.TTMSFNCGridFindParameters.fnMatchStart in this.FFindParams) {
        res1 = ic === 1}
       else res1 = ic > 0;
      if ($mod.TTMSFNCGridFindParameters.fnMatchFull in this.FFindParams) res2 = this.FSearchCache === ct;
      if ($mod.TTMSFNCGridFindParameters.fnMatchRegular in this.FFindParams) {
        Result = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MatchStrEx(this.FSearchCache,ct,$mod.TTMSFNCGridFindParameters.fnMatchCase in this.FFindParams);
      } else Result = res1 && res2;
      return Result;
    };
    this.MaxCharsInCol = function (ACol) {
      var Result = 0;
      var i = 0;
      var k = 0;
      var rc = 0;
      var s = "";
      var substr = "";
      Result = 0;
      rc = ACol;
      for (var $l = 0, $end = this.GetRowCount() - 1; $l <= $end; $l++) {
        i = $l;
        s = this.DoSaveCell(rc,i);
        do {
          substr = pas["WEBLib.TMSFNCGridDataUtil"].GetNextLine({get: function () {
              return s;
            }, set: function (v) {
              s = v;
            }},true);
          k = substr.length;
          if (k > Result) Result = k;
        } while (!(s === ""));
      };
      return Result;
    };
    this.InputFromCSVStream = function (AStream, Encoding, insertmode, MaxRows) {
      var buffer = "";
      var celltext = "";
      var s = 0;
      var z = 0;
      var strtCol = 0;
      var strtRow = 0;
      var c1 = 0;
      var c2 = 0;
      var cm = 0;
      var OldDelimiter = "\x00";
      var delimiterpos = 0;
      var quotepos = 0;
      var lr = null;
      var NewRows = 0;
      var sl = null;
      var sh = 0;
      var hasquote = false;
      strtCol = this.FIOOffset.x;
      strtRow = this.FIOOffset.y;
      sl = $mod.TTMSFNCGridFileStringList.$create("Create$1");
      pas.Classes.TStringsHelper.LoadFromStream$1.call(sl,AStream,Encoding);
      if (sl.GetEOF()) {
        throw pas.SysUtils.Exception.$create("Create$1",["File is empty"]);
        sl = rtl.freeLoc(sl);
        return;
      };
      z = strtRow;
      lr = pas.Classes.TStringList.$create("Create$1");
      if (insertmode) z = this.GetRowCount();
      OldDelimiter = this.FOptions.FIO.FDelimiter;
      this.BeginUpdate();
      if (this.FOptions.FIO.FDelimiter === "\x00") {
        celltext = "";
        buffer = "";
        sl.ReadLn({get: function () {
            return buffer;
          }, set: function (v) {
            buffer = v;
          }});
        if (!sl.GetEOF()) sl.ReadLn({get: function () {
            return celltext;
          }, set: function (v) {
            celltext = v;
          }});
        sl.Reset();
        cm = 0;
        for (s = 1; s <= 10; s++) {
          c1 = pas["WEBLib.TMSFNCGridDataUtil"].NumSingleChar($mod.CSVSeparators[s - 1],buffer);
          c2 = pas["WEBLib.TMSFNCGridDataUtil"].NumSingleChar($mod.CSVSeparators[s - 1],celltext);
          if ((c1 === c2) && (c1 > cm)) {
            this.FOptions.FIO.FDelimiter = $mod.CSVSeparators[s - 1];
            cm = c1;
          };
        };
        if (cm === 0) for (s = 1; s <= 10; s++) {
          c1 = pas["WEBLib.TMSFNCGridDataUtil"].NumChar($mod.CSVSeparators[s - 1],buffer);
          c2 = pas["WEBLib.TMSFNCGridDataUtil"].NumChar($mod.CSVSeparators[s - 1],celltext);
          if ((c1 === c2) && (c1 > cm)) {
            this.FOptions.FIO.FDelimiter = $mod.CSVSeparators[s - 1];
            cm = c1;
          };
        };
        if (cm === 0) for (s = 1; s <= 10; s++) {
          c1 = pas["WEBLib.TMSFNCGridDataUtil"].NumChar($mod.CSVSeparators[s - 1],buffer);
          c2 = pas["WEBLib.TMSFNCGridDataUtil"].NumChar($mod.CSVSeparators[s - 1],celltext);
          if ((c1 > cm) || (c2 > cm)) {
            this.FOptions.FIO.FDelimiter = $mod.CSVSeparators[s - 1];
            cm = Math.max(c1,c2);
          };
        };
      };
      sl.Reset();
      NewRows = 0;
      sh = 0;
      while (!sl.GetEOF() && ((MaxRows <= 0) || (NewRows < MaxRows))) {
        sl.ReadLn({get: function () {
            return buffer;
          }, set: function (v) {
            buffer = v;
          }});
        NewRows += 1;
        s = strtCol;
        if (z >= (this.GetRowCount() - this.FFixedFooterRows)) {
          this.SetRowCount(z + 1000);
        };
        delimiterpos = -1;
        while (pas["WEBLib.TMSFNCGridDataUtil"].VarCharPos(this.FOptions.FIO.FDelimiter,buffer,{get: function () {
            return delimiterpos;
          }, set: function (v) {
            delimiterpos = v;
          }}) > 0) {
          hasquote = buffer.charAt(0) === '"';
          if (hasquote) {
            pas.System.Delete({get: function () {
                return buffer;
              }, set: function (v) {
                buffer = v;
              }},1,1);
            quotepos = -1;
            if (pas["WEBLib.TMSFNCGridDataUtil"].SinglePos('"',buffer,{get: function () {
                return quotepos;
              }, set: function (v) {
                quotepos = v;
              }}) > 0) {
              celltext = pas.System.Copy(buffer,1,quotepos - 1);
              celltext = pas["WEBLib.TMSFNCGridDataUtil"].DoubleToSingleChar('"',celltext);
              pas.System.Delete({get: function () {
                  return buffer;
                }, set: function (v) {
                  buffer = v;
                }},1,quotepos);
            } else celltext = "";
            pas["WEBLib.TMSFNCGridDataUtil"].VarCharPos(this.FOptions.FIO.FDelimiter,buffer,{get: function () {
                return delimiterpos;
              }, set: function (v) {
                delimiterpos = v;
              }});
          } else {
            celltext = pas.System.Copy(buffer,1,delimiterpos - 1);
          };
          pas["WEBLib.TMSFNCGridDataUtil"].CSVToLineFeeds({get: function () {
              return celltext;
            }, set: function (v) {
              celltext = v;
            }});
          this.SetCells(s,z,celltext);
          pas.System.Delete({get: function () {
              return buffer;
            }, set: function (v) {
              buffer = v;
            }},1,delimiterpos);
          s += 1;
          if (s >= (this.GetColumnCount() + sh)) {
            this.SetColumnCount(s - sh);
          };
        };
        if (buffer.length > 0) {
          hasquote = buffer.charAt(0) === '"';
          if (hasquote) pas.System.Delete({get: function () {
              return buffer;
            }, set: function (v) {
              buffer = v;
            }},1,1);
          if (buffer.length > 0) {
            if (hasquote && (buffer.charAt(buffer.length - 1) === '"')) pas.System.Delete({get: function () {
                return buffer;
              }, set: function (v) {
                buffer = v;
              }},buffer.length,1);
          };
          if (hasquote) {
            celltext = pas["WEBLib.TMSFNCGridDataUtil"].DoubleToSingleChar('"',buffer)}
           else celltext = buffer;
          pas["WEBLib.TMSFNCGridDataUtil"].CSVToLineFeeds({get: function () {
              return celltext;
            }, set: function (v) {
              celltext = v;
            }});
          this.SetCells(s,z,celltext);
          s += 1;
          if (s > (this.GetColumnCount() + sh)) {
            this.SetColumnCount(s - sh);
          };
        };
        z += 1;
        this.DoIOProgress(z,sl.GetCount());
      };
      sl = rtl.freeLoc(sl);
      this.SetRowCount(z + this.FFixedFooterRows);
      lr = rtl.freeLoc(lr);
      this.FOptions.FIO.FDelimiter = OldDelimiter;
      this.DoCellsChanged($mod.TTMSFNCGridCellRecRange.$clone(this.CellRange(0,0,this.GetColumnCount() - 1,this.GetRowCount() - 1)));
      this.EndUpdate();
    };
    this.InputFromCSV = function (FileName, Encoding, insertmode, MaxRows) {
      var $Self = this;
      var ms = null;
      function InternalInputFromCSV() {
        ms.SetPosition(0);
        $Self.InputFromCSVStream(ms,Encoding,insertmode,MaxRows);
      };
      ms = pas.Classes.TMemoryStream.$create("Create");
      try {
        ms.LoadFromFile(FileName,function () {
          InternalInputFromCSV();
          ms = rtl.freeLoc(ms);
        },null);
      } finally {
      };
    };
    this.OutputToCSVStream = function (AStream, Encoding) {
      var z = 0;
      var s = 0;
      var n = 0;
      var rs = 0;
      var CellText = "";
      var LineText = "";
      var Delim = "\x00";
      var dblquotes = false;
      var sl = null;
      if (this.FSaveHiddenCells) {
        n = this.GetHiddenColCount()}
       else n = 0;
      if (this.FOptions.FIO.FDelimiter === "\x00") {
        Delim = ","}
       else Delim = this.FOptions.FIO.FDelimiter;
      sl = pas.Classes.TStringList.$create("Create$1");
      sl.SetLineBreak("\r\n");
      this.ExportNotification($mod.TTMSFNCGridExportState.esExportStart,this.FIOOffset.y);
      for (var $l = this.FIOOffset.y, $end = this.GetRowCount() - 1; $l <= $end; $l++) {
        z = $l;
        this.ExportNotification($mod.TTMSFNCGridExportState.esExportNextRow,z);
        LineText = "";
        for (var $l1 = this.FIOOffset.x, $end1 = (this.GetColumnCount() - 1) + n; $l1 <= $end1; $l1++) {
          s = $l1;
          if (s > this.FIOOffset.x) LineText = LineText + Delim;
          rs = s;
          CellText = this.DoSaveCell(rs,z);
          CellText = pas["WEBLib.TMSFNCGridDataUtil"].CSVQuotes(CellText);
          dblquotes = false;
          if (this.FOptions.FIO.FAlwaysQuotes || ((pas.System.Pos(Delim,CellText) === 0) && (pas.System.Pos('"',CellText) > 0))) {
            CellText = '"' + CellText + '"';
            dblquotes = true;
          };
          if (CellText === "") {
            if (this.FOptions.FIO.FQuoteEmptyCells) CellText = '""';
          };
          if ((pas.System.Pos(Delim,CellText) > 0) || (pas["WEBLib.TMSFNCGridDataUtil"].LinesInText(CellText,true) > 1)) {
            if (!dblquotes) {
              pas["WEBLib.TMSFNCGridDataUtil"].LineFeedsToCSV({get: function () {
                  return CellText;
                }, set: function (v) {
                  CellText = v;
                }})}
             else pas["WEBLib.TMSFNCGridDataUtil"].LineFeedsToCSVNQ({get: function () {
                return CellText;
              }, set: function (v) {
                CellText = v;
              }});
          };
          LineText = LineText + CellText;
        };
        sl.Add(LineText);
        this.DoIOProgress(z,this.GetRowCount() - 1);
      };
      this.ExportNotification($mod.TTMSFNCGridExportState.esExportDone,-1);
      pas.Classes.TStringsHelper.SaveToStream.call(sl,AStream);
      AStream.SetPosition(0);
      sl = rtl.freeLoc(sl);
    };
    this.FindInternal = function (StartC, s, FindParams) {
      var Result = pas.Types.TPoint.$new();
      var MaxCol = 0;
      var MinCol = 0;
      var MaxRow = 0;
      var MinRow = 0;
      var i = 0;
      var j = 0;
      Result.x = -1;
      Result.y = -1;
      this.FFindParams = rtl.refSet(FindParams);
      this.FFindBusy = true;
      if (!($mod.TTMSFNCGridFindParameters.fnMatchCase in FindParams)) {
        this.FSearchCache = pas["WEBLib.TMSFNCTypes"].AnsiUpperCase(s)}
       else this.FSearchCache = s;
      if ($mod.TTMSFNCGridFindParameters.fnIncludeFixed in FindParams) {
        MaxCol = this.GetColumnCount() - 1;
        MaxRow = this.GetRowCount() - 1;
        MinCol = 0;
        MinRow = 0;
      } else {
        MaxCol = this.GetColumnCount() - 1;
        MaxRow = this.GetRowCount() - 1;
        MinCol = this.FIOOffset.x;
        MinRow = this.FIOOffset.y;
      };
      if ($mod.TTMSFNCGridFindParameters.fnSelectedCells in FindParams) {
        MaxCol = this.GetSelection().EndCol;
        MaxRow = this.GetSelection().EndRow;
        MinCol = this.GetSelection().StartCol;
        MinRow = this.GetSelection().StartRow;
      };
      if ($mod.TTMSFNCGridFindParameters.fnIncludeHiddenColumns in FindParams) MaxCol = MaxCol + this.GetHiddenColCount();
      if ($mod.TTMSFNCGridFindParameters.fnIncludeHiddenRows in FindParams) MaxRow = MaxRow + this.GetHiddenRowCount();
      if ((StartC.x === -1) && (StartC.y === -1)) {
        if ($mod.TTMSFNCGridFindParameters.fnBackward in FindParams) {
          StartC.x = MaxCol;
          StartC.y = MaxRow;
        } else {
          StartC.x = MinCol;
          StartC.y = MinRow;
        };
      } else {
        if ($mod.TTMSFNCGridFindParameters.fnDirectionLeftRight in FindParams) {
          if ($mod.TTMSFNCGridFindParameters.fnBackward in FindParams) {
            if (StartC.x >= MinCol) {
              StartC.x -= 1}
             else if (StartC.y >= MinRow) {
              StartC.y -= 1}
             else {
              StartC.x = MaxCol;
              StartC.y = MaxRow;
            };
          } else {
            if (StartC.x <= MaxCol) {
              StartC.x += 1}
             else if (StartC.y <= MaxRow) {
              StartC.y += 1}
             else {
              StartC.x = MinCol;
              StartC.y = MinRow;
            };
          };
        } else {
          if ($mod.TTMSFNCGridFindParameters.fnBackward in FindParams) {
            if (StartC.y >= MinRow) {
              StartC.y -= 1}
             else if (StartC.x >= MinCol) {
              StartC.x -= 1}
             else {
              StartC.x = MaxCol;
              StartC.y = MaxRow;
            };
          } else {
            if (StartC.y <= MaxRow) {
              StartC.y += 1}
             else if (StartC.x <= MaxCol) {
              StartC.x += 1}
             else {
              StartC.x = MinCol;
              StartC.y = MinRow;
            };
          };
        };
      };
      i = StartC.x;
      j = StartC.y;
      if ($mod.TTMSFNCGridFindParameters.fnFindInCurrentRow in FindParams) {
        j = this.GetSelection().StartRow;
        MaxRow = this.GetSelection().StartRow;
        MinRow = this.GetSelection().StartRow;
      };
      if ($mod.TTMSFNCGridFindParameters.fnFindInPresetRow in FindParams) {
        j = this.FFindRow;
        MaxRow = this.FFindRow;
        MinRow = this.FFindRow;
      };
      if ($mod.TTMSFNCGridFindParameters.fnFindInCurrentCol in FindParams) {
        i = this.GetSelection().StartCol;
        MaxCol = this.GetSelection().StartCol;
        MinCol = this.GetSelection().StartCol;
      };
      if ($mod.TTMSFNCGridFindParameters.fnFindInPresetCol in FindParams) {
        i = this.FFindCol;
        MaxCol = this.FFindCol;
        MinCol = this.FFindCol;
      };
      StartC.x = i;
      StartC.y = j;
      if ($mod.TTMSFNCGridFindParameters.fnDirectionLeftRight in FindParams) {
        while ((j <= MaxRow) && (j >= MinRow)) {
          while ((i <= MaxCol) && (i >= MinCol)) {
            if (this.MatchCell(i,j)) {
              this.FSearchCell.x = i;
              this.FSearchCell.y = j;
              Result.$assign(this.FSearchCell);
              return Result;
            };
            if ($mod.TTMSFNCGridFindParameters.fnBackward in FindParams) {
              i -= 1}
             else i += 1;
          };
          if ($mod.TTMSFNCGridFindParameters.fnBackward in FindParams) {
            i = MaxCol}
           else i = MinCol;
          if ($mod.TTMSFNCGridFindParameters.fnBackward in FindParams) {
            j -= 1}
           else j += 1;
        };
      } else {
        while ((i <= MaxCol) && (i >= MinCol)) {
          while ((j <= MaxRow) && (j >= MinRow)) {
            if (this.MatchCell(i,j)) {
              this.FSearchCell.x = i;
              this.FSearchCell.y = j;
              Result.$assign(this.FSearchCell);
              return Result;
            };
            if ($mod.TTMSFNCGridFindParameters.fnBackward in FindParams) {
              j -= 1}
             else j += 1;
          };
          if ($mod.TTMSFNCGridFindParameters.fnBackward in FindParams) {
            j = MaxRow}
           else j = MinRow;
          if ($mod.TTMSFNCGridFindParameters.fnBackward in FindParams) {
            i -= 1}
           else i += 1;
        };
      };
      this.FFindBusy = false;
      return Result;
    };
    this.CellNameIndex = function (AName) {
      var Result = 0;
      Result = -1;
      return Result;
    };
    this.UpdateGridCells = function (AScrollOnly) {
    };
    this.ExportNotification = function (AState, ARow) {
      if (AState === $mod.TTMSFNCGridExportState.esExportStart) this.FPrevProgress = -1;
    };
    this.ImportNotification = function (AState, ARow) {
      if (AState === $mod.TTMSFNCGridImportState.isImportStart) this.FPrevProgress = -1;
    };
    this.DoRowCountChanged = function () {
    };
    this.DoColumnCountChanged = function () {
    };
    this.DoIOProgress = function (CurrentRow, TotalRows) {
      var np = 0;
      if ((this.FOnIOProgress != null) && (TotalRows > 0)) {
        np = Math.round((CurrentRow / TotalRows) * 100);
        if (np !== this.FPrevProgress) {
          this.FOnIOProgress(this,CurrentRow,TotalRows,np);
          this.FPrevProgress = np;
        };
      };
    };
    this.DoSortFormat = function (Col, SortFormat, Prefix, Suffix) {
      var c = 0;
      SortFormat.set($mod.TTMSFNCGridSortFormat.ssAutomatic);
      Prefix.set("");
      Suffix.set("");
      c = this.DisplToRealColumn(Col);
      if (this.FUseColumns && (c < this.FColumns.GetCount())) {
        SortFormat.set(this.FColumns.GetItem$1(c).FSortFormat);
        Suffix.set(this.FColumns.GetItem$1(c).FSortSuffix);
        Prefix.set(this.FColumns.GetItem$1(c).FSortPrefix);
      };
      if (this.FOnSortFormat != null) this.FOnSortFormat(this,Col,SortFormat,Prefix,Suffix);
    };
    this.DoCustomCompare = function (Value1, Value2, res) {
      if (this.FOnCustomCompare != null) this.FOnCustomCompare(this,Value1,Value2,res);
    };
    this.DoRawCompare = function (Col, Row1, Row2, res) {
      if (this.FOnRawCompare != null) this.FOnRawCompare(this,Col,Row1,Row2,res);
    };
    this.DoClipboardBeforePasteCell = function (Col, Row, AValue, Allow) {
      if (this.FOnClipboardBeforePasteCell != null) this.FOnClipboardBeforePasteCell(this,Col,Row,AValue,Allow);
    };
    this.DoClipboardAfterPasteCell = function (Col, Row, AValue) {
      if (this.FOnClipboardAfterPasteCell != null) this.FOnClipboardAfterPasteCell(this,Col,Row,AValue);
    };
    this.DoNeedFilterDropDown = function (Col, Row, Allow) {
      if (this.FOnNeedFilterDropDown != null) this.FOnNeedFilterDropDown(this,Col,Row,Allow);
    };
    this.DoNeedFilterDropDownData = function (Col, Row, Values) {
      if (this.FOnNeedFilterDropDownData != null) this.FOnNeedFilterDropDownData(this,Col,Row,Values);
    };
    this.DoCellsChanged = function (Cells) {
      if (this.FOnCellsChanged != null) this.FOnCellsChanged(this,$mod.TTMSFNCGridCellRecRange.$clone(Cells));
    };
    this.DoClipboardPaste = function (Cells) {
      if (this.FOnClipboardPaste != null) this.FOnClipboardPaste(this,$mod.TTMSFNCGridCellRecRange.$clone(Cells));
    };
    this.DoSaveCell = function (Col, Row) {
      var Result = "";
      Result = this.GetCells(Col,Row);
      if (this.FOptions.FIO.FSaveVirtualCellData) this.DoGetCellData(Col,Row,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      if (this.FOnSaveCell != null) this.FOnSaveCell(this,Col,Row,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.DoLoadCell = function (Col, Row, Value) {
      if (this.FOnLoadCell != null) this.FOnLoadCell(this,Col,Row,Value);
      this.SetCells(Col,Row,Value.get());
    };
    this.DoFilterSelect = function (Col, Condition) {
      if (this.FOnFilterSelect != null) this.FOnFilterSelect(this,Col,Condition);
    };
    this.DoAfterApplyFilter = function (Col, Condition, UpdateCalculations) {
      if (this.FOnAfterApplyFilter != null) this.FOnAfterApplyFilter(this,Col,Condition,UpdateCalculations);
    };
    this.SetHorizontalScrollBarVisible = function (Value) {
      pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControl.SetHorizontalScrollBarVisible.apply(this,arguments);
      if (this.FUpdateCount$1 === 0) this.FOptions.FScrollBar.SetHorizontalScrollBarVisible(this.FHorizontalScrollBarVisible);
    };
    this.SetVerticalScrollBarVisible = function (Value) {
      pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControl.SetVerticalScrollBarVisible.apply(this,arguments);
      if (this.FUpdateCount$1 === 0) this.FOptions.FScrollBar.SetVerticalScrollBarVisible(this.FVerticalScrollBarVisible);
    };
    this.RemoveCellControl = function (Col, Row, AClass) {
      var cp = null;
      cp = this.GetIntObjects(Col,Row);
      if ((cp != null) && (cp.FControl != null) && AClass.isPrototypeOf(cp.FControl)) {
        cp.FreeControl();
        this.UpdateGridCells(false);
      };
    };
    this.IsCellControl = function (Col, Row, AClass) {
      var Result = false;
      var cp = null;
      var c = 0;
      var r = 0;
      c = this.DisplToRealColumn(Col);
      r = this.DisplToRealRow(Row);
      cp = this.GetIntObjects(c,r);
      Result = (cp != null) && (cp.FControl != null) && AClass.isPrototypeOf(cp.FControl);
      return Result;
    };
    this.IsIgnoredColumn = function (Col) {
      var Result = false;
      Result = false;
      return Result;
    };
    this.Notification = function (AComponent, Operation) {
      pas["WEBLib.Menus"].TWebCustomControl.Notification.apply(this,arguments);
      if ((Operation === pas.Classes.TOperation.opRemove) && (AComponent === this.FBitmapContainer)) this.FBitmapContainer = null;
    };
    this.Loaded = function () {
      pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControl.Loaded.call(this);
      this.InitOriginalColumnSizes();
      this.FIOOffset.$assign(pas.Types.Point(this.FFixedColumns,this.FFixedRows));
      this.SetColumnOrder();
    };
    this.GetDefaultFont = function (Col, Row) {
      var Result = null;
      var gc = null;
      if (this.IsFixed(Col,Row)) {
        gc = this.GetDefaultFixedLayout()}
       else gc = this.GetDefaultNormalLayout();
      if (gc != null) {
        Result = gc.FFont}
       else Result = this.FDefaultFont;
      return Result;
    };
    this.GetDefaultFixedLayout = function () {
      var Result = null;
      Result = null;
      return Result;
    };
    this.GetDefaultNormalLayout = function () {
      var Result = null;
      Result = null;
      return Result;
    };
    this.GetDefaultGroupLayout = function () {
      var Result = null;
      Result = null;
      return Result;
    };
    this.GetDefaultSummaryLayout = function () {
      var Result = null;
      Result = null;
      return Result;
    };
    this.GetDefaultSelectedLayout = function () {
      var Result = null;
      Result = null;
      return Result;
    };
    this.GetDefaultFocusedLayout = function () {
      var Result = null;
      Result = null;
      return Result;
    };
    this.GetDefaultFixedSelectedLayout = function () {
      var Result = null;
      Result = null;
      return Result;
    };
    this.GetDefaultBandLayout = function () {
      var Result = null;
      Result = null;
      return Result;
    };
    this.GetDefaultSortFill = function () {
      var Result = null;
      Result = null;
      return Result;
    };
    this.GetDefaultIndexedSortFill = function () {
      var Result = null;
      Result = null;
      return Result;
    };
    this.GetDefaultSortStroke = function () {
      var Result = null;
      Result = null;
      return Result;
    };
    this.GetDefaultIndexedSortStroke = function () {
      var Result = null;
      Result = null;
      return Result;
    };
    this.GetDefaultSortFont = function () {
      var Result = null;
      Result = null;
      return Result;
    };
    this.GetDefaultIndexedSortFont = function () {
      var Result = null;
      Result = null;
      return Result;
    };
    this.SetFonts = function (ASetType) {
      var I = 0;
      var J = 0;
      this.BeginUpdate();
      this.FGlobalFont.ApplyChange(this.FDefaultFont,ASetType);
      this.FGlobalFont.ApplyChange(this.FDefaultLayout.FFont,ASetType);
      for (var $l = 0, $end = this.FColumns.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.FGlobalFont.ApplyChange(this.FColumns.GetItem$1(I).FFont,ASetType);
        this.FGlobalFont.ApplyChange(this.FColumns.GetItem$1(I).FFixedFont,ASetType);
        for (var $l1 = 0, $end1 = this.GetRowCount() - 1; $l1 <= $end1; $l1++) {
          J = $l1;
          this.FGlobalFont.ApplyChange(this.GetDefaultBandLayout().FFont,ASetType);
          this.FGlobalFont.ApplyChange(this.GetDefaultNormalLayout().FFont,ASetType);
          this.FGlobalFont.ApplyChange(this.GetDefaultFixedLayout().FFont,ASetType);
          this.FGlobalFont.ApplyChange(this.GetDefaultSelectedLayout().FFont,ASetType);
          this.FGlobalFont.ApplyChange(this.GetDefaultFixedSelectedLayout().FFont,ASetType);
          this.FGlobalFont.ApplyChange(this.GetDefaultFocusedLayout().FFont,ASetType);
          this.FGlobalFont.ApplyChange(this.GetDefaultGroupLayout().FFont,ASetType);
          this.FGlobalFont.ApplyChange(this.GetDefaultSummaryLayout().FFont,ASetType);
          this.FGlobalFont.ApplyChange(this.GetDefaultBandLayout().FFont,ASetType);
        };
      };
      this.EndUpdate();
    };
    this.DoOptionsChange = function (Sender) {
      if ((this.FUpdateCount$1 > 0) || this.FBlockUpdate || (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState)) return;
      this.SaveScrollPosition();
      this.BeginUpdate();
      this.SetHorizontalScrollBarVisible(this.FOptions.FScrollBar.FHorizontalScrollBarVisible);
      this.SetVerticalScrollBarVisible(this.FOptions.FScrollBar.FVerticalScrollBarVisible);
      this.EndUpdate();
      this.RestoreScrollPosition();
    };
    this.DoGetCellReadOnly = function (ACol, ARow, AReadOnly) {
      var cp = null;
      cp = this.GetCellProps(ACol,ARow);
      if (cp != null) {
        AReadOnly.set(cp.FReadOnly)}
       else {
        if (this.FUseColumns && (ACol >= 0) && (ACol <= (this.FColumns.GetCount() - 1))) {
          ACol = this.DisplToRealColumn(ACol);
          AReadOnly.set(this.FColumns.GetItem$1(ACol).FReadOnly);
        };
      };
    };
    this.DoGetCellIsDataCheckBox = function (ACol, ARow) {
      var Result = false;
      var cp = null;
      var c = 0;
      var r = 0;
      c = this.DisplToRealColumn(ACol);
      r = this.DisplToRealRow(ARow);
      Result = false;
      cp = this.GetCellProps(c,r);
      if (this.FUseColumns && !(this.GetIntObjects(c,r) != null)) {
        if (c < this.FColumns.GetCount()) Result = (this.FColumns.GetItem$1(c).FColumnType === $mod.TTMSFNCGridColumnType.ctCheckBox) || (this.FColumns.GetItem$1(c).FColumnType === $mod.TTMSFNCGridColumnType.ctRadioButton);
      } else {
        if (cp != null) Result = $mod.TTMSFNCGridCellDataCheckBox.isPrototypeOf(cp.FControl);
      };
      return Result;
    };
    this.DoFixedCellCheckBoxClick = function (ACol, ARow, ACell) {
    };
    this.DoFixedCellSpinBoxChange = function (ACol, ARow, ACell) {
    };
    this.DoFixedCellButtonClick = function (ACol, ARow, ACell) {
    };
    this.DoFixedCellDropDownButtonClick = function (ACol, ARow, ACell) {
    };
    this.DoFixedCellBitmapClick = function (ACol, ARow, ACell) {
    };
    this.DoCellRightClick = function (ACol, ARow) {
    };
    this.DoFixedCellRightClick = function (ACol, ARow) {
    };
    this.DoCellClick = function (ACol, ARow) {
      var rr = 0;
      var i = 0;
      var ns = 0;
      if ((this.FGroupColumn !== -1) && this.FOptions.FGrouping.FAutoSelectGroup) {
        rr = this.DisplToRealRow(ARow);
        if (this.IsNode(rr)) {
          ns = this.GetNodeSpan(rr);
          if (this.FOptions.FSelection.FMode === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctRow) {
            for (var $l = rr, $end = rr + ns; $l <= $end; $l++) {
              i = $l;
              this.SetRowSelect(i,true);
            };
          } else if (this.FOptions.FSelection.FMode === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smCellRange) this.SetSelection(this.CellRange(this.FFixedColumns,ARow,this.GetColumnCount() - 1 - this.FFixedRightColumns,ARow + ns));
        };
      };
    };
    this.DoFixedCellClick = function (Shift, ACol, ARow) {
    };
    this.DoCellDblClick = function (ACol, ARow) {
    };
    this.DoFixedCellDblClick = function (ACol, ARow) {
    };
    this.DoCellCheckBoxClick = function (ACol, ARow, ACell) {
      var cp = null;
      var i = 0;
      var rr = 0;
      var ns = 0;
      var c = 0;
      var r = 0;
      c = this.DisplToRealColumn(ACol);
      r = this.DisplToRealRow(ARow);
      cp = this.GetIntObjects(c,r);
      if ((cp != null) && (cp.FControl != null) && $mod.TTMSFNCGridCellCheckBox.isPrototypeOf(cp.FControl)) {
        rtl.as(cp.FControl,$mod.TTMSFNCGridCellCheckBox).FChecked = rtl.as(ACell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell).FChecked;
        if (rtl.as(cp.FControl,$mod.TTMSFNCGridCellCheckBox).FHeader) {
          for (var $l = ARow + 1, $end = this.GetRowCount() - 1 - this.FFixedFooterRows; $l <= $end; $l++) {
            i = $l;
            if (this.IsCheckBox(ACol,i)) {
              this.SetCheckBoxState(ACol,i,rtl.as(cp.FControl,$mod.TTMSFNCGridCellCheckBox).FChecked)}
             else break;
          };
        };
        this.UpdateGridCells(false);
      };
      if (this.FOptions.FGrouping.FAutoCheckGroup) {
        rr = this.DisplToRealRow(ARow);
        if (this.IsNode(rr)) {
          ns = this.GetNodeSpan(rr);
          for (var $l1 = rr, $end1 = rr + ns; $l1 <= $end1; $l1++) {
            i = $l1;
            this.SetCheckBoxState(ACol,i,rtl.as(cp.FControl,$mod.TTMSFNCGridCellCheckBox).FChecked);
          };
          this.UpdateGridCells(false);
        };
      };
      if (this.FUseColumns && !(cp != null)) {
        c = this.DisplToRealColumn(ACol);
        if (c < this.FColumns.GetCount()) {
          if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell.isPrototypeOf(ACell) && (this.FColumns.GetItem$1(c).FColumnType === $mod.TTMSFNCGridColumnType.ctCheckBox)) {
            if (rtl.as(ACell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell).FChecked) {
              this.SetCells(ACol,ARow,this.FCheckTrue)}
             else this.SetCells(ACol,ARow,this.FCheckFalse);
          };
        };
      } else {
        if ((cp != null) && (cp.FControl != null) && $mod.TTMSFNCGridCellDataCheckBox.isPrototypeOf(cp.FControl)) {
          if (rtl.as(ACell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell).FChecked) {
            this.SetCells(ACol,ARow,this.FCheckTrue)}
           else this.SetCells(ACol,ARow,this.FCheckFalse);
        };
      };
    };
    this.DoCellRadioButtonClick = function (ACol, ARow, ACell) {
      var cp = null;
      var cpt = null;
      var r = 0;
      var c = 0;
      var rr = 0;
      c = this.DisplToRealColumn(ACol);
      r = this.DisplToRealRow(ARow);
      cp = this.GetIntObjects(c,r);
      if (this.FUseColumns && !(cp != null)) {
        for (var $l = this.FFixedRows, $end = this.GetRowCount() - 1 - this.FFixedFooterRows; $l <= $end; $l++) {
          rr = $l;
          this.SetCells(ACol,rr,this.FCheckFalse);
        };
        this.SetCells(ACol,ARow,this.FCheckTrue);
      } else {
        if ((cp != null) && (cp.FControl != null) && $mod.TTMSFNCGridCellRadioButton.isPrototypeOf(cp.FControl)) {
          for (var $l1 = 0, $end1 = this.GetRowCount() - 1; $l1 <= $end1; $l1++) {
            rr = $l1;
            cpt = this.GetIntObjects(ACol,rr);
            if ((cpt != null) && (cpt.FControl != null) && $mod.TTMSFNCGridCellRadioButton.isPrototypeOf(cpt.FControl) && (cpt !== cp)) {
              if (rtl.as(cpt.FControl,$mod.TTMSFNCGridCellRadioButton).FIndex === rtl.as(cp.FControl,$mod.TTMSFNCGridCellRadioButton).FIndex) rtl.as(cpt.FControl,$mod.TTMSFNCGridCellRadioButton).FChecked = false;
            };
          };
          rtl.as(cp.FControl,$mod.TTMSFNCGridCellRadioButton).FChecked = rtl.as(ACell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCRadioGridCell).FChecked;
          this.UpdateGridCells(false);
        };
      };
    };
    this.DoCellButtonClick = function (ACol, ARow, ACell) {
    };
    this.DoCellBitmapClick = function (ACol, ARow, ACell) {
    };
    this.DoCellCommentClick = function (ACol, ARow, ACell) {
    };
    this.DoCellSortClick = function (Shift, ACol, ARow, Direction, ACell) {
      if (this.FGroupColumn !== -1) {
        var $tmp = this.FOptions.FSorting.FMode;
        if ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSortingMode.gsmNormal) {
          this.SortGrouped(ACol,Direction)}
         else if ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSortingMode.gsmIndexed) this.SortGroupedIndexed();
      } else {
        var $tmp1 = this.FOptions.FSorting.FMode;
        if ($tmp1 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSortingMode.gsmNormal) {
          this.SortData(ACol,Direction)}
         else if ($tmp1 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSortingMode.gsmIndexed) this.SortIndexed();
      };
    };
    this.DoCellNodeClick = function (ACol, ARow, ACell) {
      var cn = null;
      var rr = 0;
      rr = this.DisplToRealRow(ARow);
      cn = this.GetNode(rr);
      if (!(cn != null)) return;
      if (cn.FSpan !== -1) {
        if (cn.FState === pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridNodeState.nsOpen) {
          this.CloseNode(rr)}
         else this.OpenNode(rr);
      };
    };
    this.DoGetCellIsFixed = function (ACol, ARow, ACellFixed) {
      var cp = null;
      cp = this.GetCellProps(ACol,ARow);
      if (cp != null) {
        ACellFixed.set(cp.FFixed)}
       else {
        if (this.FUseColumns && (ACol >= 0) && (ACol <= (this.FColumns.GetCount() - 1))) {
          ACol = this.DisplToRealColumn(ACol);
          ACellFixed.set(this.FColumns.GetItem$1(ACol).FFixed);
        };
      };
    };
    this.DoGetRowIsBand = function (ARow, ARowBand) {
      if (this.FOptions.FBands.FTotalRowCount > 0) {
        ARowBand.set(((ARow - this.FFixedRows) % this.FOptions.FBands.FTotalRowCount) < this.FOptions.FBands.FBandRowCount);
      } else ARowBand.set(pas.System.Odd(ARow));
    };
    this.DoCanInsertRow = function (ARow, Allow) {
    };
    this.DoCanDeleteRow = function (ARow, Allow) {
    };
    this.DoCanAppendRow = function (ARow, Allow) {
    };
    this.DoCanAppendColumn = function (ACol, Allow) {
    };
    this.DoInsertRow = function (ARow) {
    };
    this.DoDeleteRow = function (ARow) {
    };
    this.DoAppendRow = function (ARow) {
    };
    this.DoAppendColumn = function (ACol) {
    };
    this.DoGetCellClass = function (ACol, ARow, CellClassType) {
      var cp = null;
      var c = 0;
      var r = 0;
      if (((ACol >= this.FFixedColumns) || (ACol <= (this.GetColumnCount() - 1 - this.FFixedRightColumns))) && ((ARow < this.FFixedRows) || (ARow > (this.GetRowCount() - this.FFixedFooterRows - 1)))) {
        CellClassType.set(pas["WEBLib.TMSFNCGridCell"].TTMSFNCFixedGridCell)}
       else CellClassType.set(pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell);
      c = this.DisplToRealColumn(ACol);
      r = this.DisplToRealRow(ARow);
      cp = this.GetCellProps(c,r);
      if (!(this.GetIntObjects(c,r) != null) && this.FUseColumns && (c < this.FColumns.GetCount()) && !this.IsFixed(c,r)) {
        var $tmp = this.FColumns.GetItem$1(c).FColumnType;
        if ($tmp === $mod.TTMSFNCGridColumnType.ctButton) {
          CellClassType.set(pas["WEBLib.TMSFNCGridCell"].TTMSFNCButtonGridCell)}
         else if ($tmp === $mod.TTMSFNCGridColumnType.ctCheckBox) {
          CellClassType.set(pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell)}
         else if ($tmp === $mod.TTMSFNCGridColumnType.ctProgressBar) {
          CellClassType.set(pas["WEBLib.TMSFNCGridCell"].TTMSFNCProgressGridCell)}
         else if ($tmp === $mod.TTMSFNCGridColumnType.ctRadioButton) CellClassType.set(pas["WEBLib.TMSFNCGridCell"].TTMSFNCRadioGridCell);
      };
      if ((cp != null) && (cp.FControl != null)) {
        if ($mod.TTMSFNCGridCellCheckBox.isPrototypeOf(cp.FControl)) CellClassType.set(pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell);
        if ($mod.TTMSFNCGridCellDataCheckBox.isPrototypeOf(cp.FControl)) CellClassType.set(pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell);
        if ($mod.TTMSFNCGridCellRadioButton.isPrototypeOf(cp.FControl)) CellClassType.set(pas["WEBLib.TMSFNCGridCell"].TTMSFNCRadioGridCell);
        if ($mod.TTMSFNCGridCellBitmapName.isPrototypeOf(cp.FControl)) CellClassType.set(pas["WEBLib.TMSFNCGridCell"].TTMSFNCBitmapGridCell);
        if ($mod.TTMSFNCGridCellButton.isPrototypeOf(cp.FControl)) CellClassType.set(pas["WEBLib.TMSFNCGridCell"].TTMSFNCButtonGridCell);
        if ($mod.TTMSFNCGridCellProgressBar.isPrototypeOf(cp.FControl)) CellClassType.set(pas["WEBLib.TMSFNCGridCell"].TTMSFNCProgressGridCell);
        if ($mod.TTMSFNCGridCellBitmap.isPrototypeOf(cp.FControl)) CellClassType.set(pas["WEBLib.TMSFNCGridCell"].TTMSFNCBitmapGridCell);
        if ($mod.TTMSFNCGridCellNode.isPrototypeOf(cp.FControl)) CellClassType.set(pas["WEBLib.TMSFNCGridCell"].TTMSFNCNodeGridCell);
      };
      if (cp != null) {
        if ((CellClassType.get() === pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell) && (cp.FComment !== "")) CellClassType.set(pas["WEBLib.TMSFNCGridCell"].TTMSFNCCommentGridCell);
      };
    };
    this.DoGetCellData = function (ACol, ARow, CellString) {
      var cp = null;
      var emptydata = false;
      var i = 0;
      var vp = 0;
      var rowc = 0;
      var rr = 0;
      var c = 0;
      rr = this.DisplToRealRow(ARow);
      c = this.DisplToRealColumn(ACol);
      cp = this.GetCellProps(c,rr);
      emptydata = false;
      if ((cp != null) && (cp.FControl != null)) {
        if ($mod.TTMSFNCGridCellBitmapName.isPrototypeOf(cp.FControl)) {
          emptydata = rtl.as(cp.FControl,$mod.TTMSFNCGridCellBitmapName).FData;
        };
        if ($mod.TTMSFNCGridCellDataCheckBox.isPrototypeOf(cp.FControl)) emptydata = true;
      };
      if (this.FUseColumns && !(this.GetIntObjects(c,rr) != null)) {
        if ((c >= 0) && (c < this.FColumns.GetCount()) && !this.IsFixed(c,rr)) emptydata = (this.FColumns.GetItem$1(c).FColumnType === $mod.TTMSFNCGridColumnType.ctCheckBox) || (this.FColumns.GetItem$1(c).FColumnType === $mod.TTMSFNCGridColumnType.ctRadioButton);
      };
      if (!emptydata) {
        CellString.set(this.GetCells(ACol,ARow));
        for (var $l = 0, $end = this.FMarkList.GetCount() - 1; $l <= $end; $l++) {
          i = $l;
          if ($mod.InCellRange(ACol,ARow,$mod.TTMSFNCGridCellRecRange.$clone(this.FMarkList.GetItem$1(i).FCellRange))) {
            var $tmp = this.FMarkList.GetItem$1(i).FMarkType;
            if ($tmp === $mod.TTMSFNCGridMarkType.mtHighlight) {
              CellString.set(pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.ApplyHilight(CellString.get(),this.FMarkList.GetItem$1(i).FValue,"hi",this.FMarkList.GetItem$1(i).FCaseSensitive))}
             else if ($tmp === $mod.TTMSFNCGridMarkType.mtError) CellString.set(pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.ApplyHilight(CellString.get(),this.FMarkList.GetItem$1(i).FValue,"e",this.FMarkList.GetItem$1(i).FCaseSensitive));
          };
        };
        if (this.FOptions.FURL.FShow && !this.FOptions.FURL.FFull) {
          vp = 0;
          if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos("://",CellString.get(),{get: function () {
              return vp;
            }, set: function (v) {
              vp = v;
            }}) > 0) {
            CellString.set(pas.System.Copy(CellString.get(),vp + 3,255))}
           else if (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos("mailto:",CellString.get(),{get: function () {
              return vp;
            }, set: function (v) {
              vp = v;
            }}) === 1) CellString.set(pas.System.Copy(CellString.get(),vp + 7,255));
        };
        if (this.FOptions.FGrouping.FShowGroupCount && (this.FGroupColumn !== -1) && (ACol === 1) && this.IsNode(rr)) {
          rowc = this.GetNodeSpan(rr);
          if (this.FOptions.FGrouping.FGroupCountFormat !== "") {
            CellString.set(CellString.get() + " " + pas.SysUtils.Format(this.FOptions.FGrouping.FGroupCountFormat,pas.System.VarRecs(0,rowc)))}
           else CellString.set(CellString.get() + " (" + pas.SysUtils.IntToStr(rowc) + ")");
        };
      } else CellString.set("");
    };
    this.DoGetCellRotation = function (ACol, ARow, Angle) {
      var cp = null;
      var c = 0;
      var r = 0;
      c = this.DisplToRealColumn(ACol);
      r = this.DisplToRealRow(ARow);
      cp = this.GetCellProps(c,r);
      if (cp != null) Angle.set(cp.FAngle);
    };
    this.DoGetCellLayout = function (ACol, ARow, ALayout, ACellState) {
      var cp = null;
      var c = 0;
      var r = 0;
      c = this.DisplToRealColumn(ACol);
      r = this.DisplToRealRow(ARow);
      cp = this.GetCellProps(c,r);
      if (this.FUseColumns && (c >= 0) && (c <= (this.FColumns.GetCount() - 1)) && !(cp != null)) {
        if (this.FColumnProp.FDefaultFont != null) {
          this.FColumnProp.FFontSize = this.FColumnProp.FDefaultFont.FSize;
          this.FColumnProp.FFontStyle = rtl.refSet(this.FColumnProp.FDefaultFont.FStyle);
        };
        if (ACellState === $mod.TTMSFNCGridCellState.csNormal) {
          this.FColumnProp.FColor = this.FColumns.GetItem$1(c).FColor;
          this.FColumnProp.FFontColor = this.FColumns.GetItem$1(c).FFont.FColor;
          this.FColumnProp.FFontName = this.FColumns.GetItem$1(c).FFont.FName;
          this.FColumnProp.FFontStyle = rtl.refSet(this.FColumns.GetItem$1(c).FFont.FStyle);
          this.FColumnProp.FFontSize = this.FColumns.GetItem$1(c).FFont.FSize;
          this.FColumnProp.FBorderColor = this.FColumns.GetItem$1(c).FBorderColor;
          this.FColumnProp.FBorderWidth = this.FColumns.GetItem$1(c).FBorderWidth;
        };
        if ((ACellState === $mod.TTMSFNCGridCellState.csFixed) || (ACellState === $mod.TTMSFNCGridCellState.csFixedSelected)) {
          this.FColumnProp.FFontColor = this.FColumns.GetItem$1(c).FFixedFont.FColor;
          this.FColumnProp.FFontName = this.FColumns.GetItem$1(c).FFixedFont.FName;
          this.FColumnProp.FFontStyle = rtl.refSet(this.FColumns.GetItem$1(c).FFixedFont.FStyle);
          this.FColumnProp.FFontSize = this.FColumns.GetItem$1(c).FFixedFont.FSize;
        };
        this.FColumnProp.FAlignHorz = this.FColumns.GetItem$1(c).FHorzAlignment;
        this.FColumnProp.FAlignVert = this.FColumns.GetItem$1(c).FVertAlignment;
        this.FColumnProp.FReadOnly = this.FColumns.GetItem$1(c).FReadOnly;
        this.FColumnProp.FFixed = this.FColumns.GetItem$1(c).FFixed;
        this.FColumnProp.FWordWrap = this.FColumns.GetItem$1(c).FWordWrap;
        cp = this.FColumnProp;
      };
      if (this.FUseColumns && (c >= 0) && (c <= (this.FColumns.GetCount() - 1))) ALayout.SetWordWrapping(this.FColumns.GetItem$1(c).FWordWrap);
      if (cp != null) {
        if ((cp.FColor !== -1) && (ACellState === $mod.TTMSFNCGridCellState.csNormal)) ALayout.FFill.SetColor(cp.FColor);
        if ((cp.FFontColor !== -1) && (ACellState === $mod.TTMSFNCGridCellState.csNormal)) ALayout.FFont.SetColor(cp.FFontColor);
        if ((cp.FBorderColor !== -1) && (ACellState === $mod.TTMSFNCGridCellState.csNormal)) ALayout.FStroke.SetColor(cp.FBorderColor);
        ALayout.SetTextAlign(cp.FAlignHorz);
        ALayout.SetVerticalTextAlign(cp.FAlignVert);
        ALayout.FFont.SetStyle(rtl.refSet(cp.FFontStyle));
        ALayout.FFont.SetSize(Math.round(cp.FFontSize));
        if (cp.FFontName !== "") ALayout.FFont.SetName(cp.FFontName);
        ALayout.FStroke.SetWidth(cp.FBorderWidth);
        if (!this.FUseColumns) ALayout.SetWordWrapping(cp.FWordWrap);
      };
      if (this.FOptions.FURL.FShow) {
        if (pas["WEBLib.TMSFNCGridDataUtil"].IsURL(this.GetCells(c,r))) {
          ALayout.FFont.SetColor(this.FOptions.FURL.FColor);
          if (this.FOptions.FURL.FUnderline) ALayout.FFont.SetStyle(rtl.unionSet(ALayout.FFont.FStyle,rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsUnderline)));
        };
      };
    };
    this.DoGetCellProperties = function (ACol, ARow, Cell) {
      var cp = null;
      var realc = 0;
      var realr = 0;
      var allow = false;
      var evnt = null;
      var v = 0;
      realc = this.DisplToRealColumn(ACol);
      realr = this.DisplToRealRow(ARow);
      if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCButtonGridCell.isPrototypeOf(Cell)) {
        cp = this.GetCellProps(realc,realr);
        if ((cp != null) && $mod.TTMSFNCGridCellButton.isPrototypeOf(cp.FControl)) {
          rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCButtonGridCell).SetControlEnabled(!this.IsReadOnly(realc,realr));
          rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCButtonGridCell).SetButtonText(rtl.as(cp.FControl,$mod.TTMSFNCGridCellButton).FText);
          rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCButtonGridCell).SetButtonWidth(rtl.as(cp.FControl,$mod.TTMSFNCGridCellButton).FWidth);
          rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCButtonGridCell).SetButtonHeight(rtl.as(cp.FControl,$mod.TTMSFNCGridCellButton).FHeight);
        };
      };
      if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCRadioGridCell.isPrototypeOf(Cell)) {
        cp = this.GetCellProps(realc,realr);
        if (this.FUseColumns && !(this.GetIntObjects(realc,realr) != null)) {
          if (realc < this.FColumns.GetCount()) {
            if (this.FColumns.GetItem$1(realc).FColumnType === $mod.TTMSFNCGridColumnType.ctRadioButton) {
              rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCRadioGridCell).SetControlEnabled(!this.IsReadOnly(realc,realr));
              evnt = rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCRadioGridCell).FOnCheckChanged;
              rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCRadioGridCell).FOnCheckChanged = null;
              rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCRadioGridCell).SetChecked(this.GetCells(ACol,ARow) === this.FCheckTrue);
              rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCRadioGridCell).FOnCheckChanged = evnt;
            };
          };
        } else {
          if ((cp != null) && $mod.TTMSFNCGridCellRadioButton.isPrototypeOf(cp.FControl)) {
            rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCRadioGridCell).SetControlEnabled(!this.IsReadOnly(realc,realr));
            evnt = rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCRadioGridCell).FOnCheckChanged;
            rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCRadioGridCell).FOnCheckChanged = null;
            rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCRadioGridCell).SetChecked(rtl.as(cp.FControl,$mod.TTMSFNCGridCellRadioButton).FChecked);
            rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCRadioGridCell).FOnCheckChanged = evnt;
          };
        };
      };
      if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCCommentGridCell.isPrototypeOf(Cell)) {
        cp = this.GetCellProps(realc,realr);
        if (cp != null) {
          rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCCommentGridCell).FCommentText = cp.FComment;
          if (cp.FCommentColor !== -1) rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCCommentGridCell).FCommentColor = cp.FCommentColor;
        };
      };
      if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell.isPrototypeOf(Cell)) {
        cp = this.GetCellProps(realc,realr);
        if (this.FUseColumns && !(this.GetIntObjects(realc,realr) != null)) {
          if (realc < this.FColumns.GetCount()) {
            if (this.FColumns.GetItem$1(realc).FColumnType === $mod.TTMSFNCGridColumnType.ctCheckBox) {
              rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell).SetControlEnabled(!this.IsReadOnly(realc,realr));
              evnt = rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell).FOnCheckChanged;
              rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell).FOnCheckChanged = null;
              rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell).SetChecked(this.GetCells(ACol,ARow) === this.FCheckTrue);
              rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell).FOnCheckChanged = evnt;
            };
          };
        } else {
          if ((cp != null) && $mod.TTMSFNCGridCellCheckBox.isPrototypeOf(cp.FControl)) {
            rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell).SetControlEnabled(!this.IsReadOnly(realc,realr));
            evnt = rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell).FOnCheckChanged;
            rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell).FOnCheckChanged = null;
            rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell).SetChecked(rtl.as(cp.FControl,$mod.TTMSFNCGridCellCheckBox).FChecked);
            rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell).FOnCheckChanged = evnt;
          };
          if ((cp != null) && $mod.TTMSFNCGridCellDataCheckBox.isPrototypeOf(cp.FControl)) {
            rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell).SetControlEnabled(!this.IsReadOnly(realc,realr));
            evnt = rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell).FOnCheckChanged;
            rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell).FOnCheckChanged = null;
            rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell).SetChecked(this.GetCells(ACol,ARow) === this.FCheckTrue);
            rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell).FOnCheckChanged = evnt;
          };
        };
      };
      if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCBitmapGridCell.isPrototypeOf(Cell)) {
        cp = this.GetCellProps(realc,realr);
        rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCBitmapGridCell).FBitmapContainer = this.GetBitmapContainer();
        if ((cp != null) && $mod.TTMSFNCGridCellBitmapName.isPrototypeOf(cp.FControl)) {
          if (rtl.as(cp.FControl,$mod.TTMSFNCGridCellBitmapName).FData) {
            rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCBitmapGridCell).SetBitmapName(this.GetCells(ACol,ARow))}
           else rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCBitmapGridCell).SetBitmapName(rtl.as(cp.FControl,$mod.TTMSFNCGridCellBitmapName).FBitmapName);
        };
        if ((cp != null) && $mod.TTMSFNCGridCellBitmap.isPrototypeOf(cp.FControl)) rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCBitmapGridCell).FBitmap.Assign(rtl.as(cp.FControl,$mod.TTMSFNCGridCellBitmap).FBitmap);
      };
      if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCNodeGridCell.isPrototypeOf(Cell)) {
        cp = this.GetCellProps(realc,realr);
        if ((cp != null) && $mod.TTMSFNCGridCellNode.isPrototypeOf(cp.FControl)) {
          rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCNodeGridCell).FState = rtl.as(cp.FControl,$mod.TTMSFNCGridCellNode).FState;
        };
      };
      if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCProgressGridCell.isPrototypeOf(Cell)) {
        cp = this.GetCellProps(realc,realr);
        if (this.FUseColumns && !(this.GetIntObjects(realc,realr) != null)) {
          if (realc < this.FColumns.GetCount()) {
            if (this.FColumns.GetItem$1(realc).FColumnType === $mod.TTMSFNCGridColumnType.ctProgressBar) {
              v = 0;
              if (pas.SysUtils.TryStrToInt(this.GetCells(ACol,ARow),{get: function () {
                  return v;
                }, set: function (w) {
                  v = w;
                }})) {
                rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCProgressGridCell).SetValue(v)}
               else rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCProgressGridCell).SetValue(0);
            };
          };
        } else {
          if ((cp != null) && $mod.TTMSFNCGridCellProgressBar.isPrototypeOf(cp.FControl)) {
            if (rtl.as(cp.FControl,$mod.TTMSFNCGridCellProgressBar).FData) {
              v = 0;
              if (pas.SysUtils.TryStrToInt(this.GetCells(ACol,ARow),{get: function () {
                  return v;
                }, set: function (w) {
                  v = w;
                }})) {
                rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCProgressGridCell).SetValue(v)}
               else rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCProgressGridCell).SetValue(0);
            } else rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCProgressGridCell).SetValue(rtl.as(cp.FControl,$mod.TTMSFNCGridCellProgressBar).FValue);
          };
        };
      };
      if (this.FOptions.FFiltering.FDropDown && pas["WEBLib.TMSFNCGridCell"].TTMSFNCFixedGridCell.isPrototypeOf(Cell)) {
        allow = false;
        if ((this.FOptions.FFiltering.FDropDownFixedRow === realr) && (realc >= this.FFixedColumns) && (realc < (this.GetColumnCount() - this.FFixedRightColumns))) {
          allow = true;
          this.DoNeedFilterDropDown(realc,realr,{get: function () {
              return allow;
            }, set: function (v) {
              allow = v;
            }});
        };
        rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCFixedGridCell).FShowDropDownButton = allow;
        rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCFixedGridCell).FSizeMargin = this.FOptions.FMouse.FColumnSizeMargin - 2;
      };
    };
    this.DoGetCellMergeInfo = function (ACol, ARow, ABaseCol, ABaseRow, AColSpan, ARowSpan) {
      var cp = null;
      cp = this.GetIntObjects(this.DisplToRealColumn(ACol),this.DisplToRealRow(ARow));
      if ((cp != null) && (cp.FBaseCol !== -1)) {
        ABaseCol.set(this.RealToDisplColumn(cp.FBaseCol));
        ABaseRow.set(this.RealToDisplRow(cp.FBaseRow));
        AColSpan.set(cp.FColSpan);
        ARowSpan.set(cp.FRowSpan);
      };
    };
    this.DoGetCellEditorType = function (ACol, ARow, CellEditorType) {
      var c = 0;
      c = this.DisplToRealColumn(ACol);
      if (c < this.FColumns.GetCount()) CellEditorType.set(this.FColumns.GetItem$1(c).FEditor);
      if (this.IsCellControl(ACol,ARow,$mod.TTMSFNCGridCellCombo)) CellEditorType.set($mod.TTMSFNCGridEditorType.etComboBox);
    };
    this.DoGetCellEditorCustomClassType = function (ACol, ARow, CellEditorCustomClassType) {
      var cp = null;
      cp = this.GetIntObjects(ACol,ARow);
      if ((cp != null) && cp.FReadOnly) CellEditorCustomClassType.set(null);
    };
    this.DoCellEditGetData = function (ACol, ARow, CellEditor, CellString) {
    };
    this.DoCellEditValidateData = function (ACol, ARow, CellEditor, CellString, Allow) {
    };
    this.DoCellEditSetData = function (ACol, ARow, CellEditor, CellString) {
      this.SetCells(ACol,ARow,CellString.get());
    };
    this.DoCellEditGetColor = function (ACol, ARow, CellEditor, CellColor) {
    };
    this.DoCellEditValidateColor = function (ACol, ARow, CellEditor, CellColor, Allow) {
    };
    this.DoCellEditSetColor = function (ACol, ARow, CellEditor, CellColor) {
      this.SetColors(ACol,ARow,CellColor.get());
    };
    this.DoCellEditDone = function (ACol, ARow, CellEditor) {
      var cc = 0;
      var I = 0;
      for (var $l = 0, $end = this.GetColumnCount() - 1; $l <= $end; $l++) {
        I = $l;
        cc = this.GetColumnCalculation(I);
        if (cc !== $mod.TTMSFNCGridColumnCalculation.ccNone) this.UpdateColumnCalc(I,cc);
      };
    };
    this.DoGetCellEditorProperties = function (ACol, ARow, CellEditor) {
      var cp = null;
      var c = 0;
      if (pas["WEBLib.StdCtrls"].TComboBox.isPrototypeOf(CellEditor)) {
        rtl.as(CellEditor,pas["WEBLib.StdCtrls"].TComboBox).SetParent(this);
        c = this.DisplToRealColumn(ACol);
        if (this.FUseColumns && (c < this.FColumns.GetCount())) {
          if (this.FColumns.GetItem$1(c).FEditor in rtl.createSet($mod.TTMSFNCGridEditorType.etComboBox)) {
            if (pas["WEBLib.StdCtrls"].TComboBox.isPrototypeOf(CellEditor)) rtl.as(CellEditor,pas["WEBLib.StdCtrls"].TComboBox).FItems.Assign(this.FColumns.GetItem$1(c).FComboItems);
          };
        };
        if (this.IsCellControl(ACol,ARow,$mod.TTMSFNCGridCellCombo)) {
          cp = this.GetIntObjects(ACol,ARow);
          if (cp != null) {
            if (pas["WEBLib.StdCtrls"].TComboBox.isPrototypeOf(CellEditor)) rtl.as(CellEditor,pas["WEBLib.StdCtrls"].TComboBox).FItems.Assign(rtl.as(cp.FControl,$mod.TTMSFNCGridCellCombo).FItems);
          };
        };
        rtl.as(CellEditor,pas["WEBLib.StdCtrls"].TComboBox).SetParent(null);
      };
    };
    this.DoColumnCalc = function (Acol, FromRow, ToRow) {
      var Result = 0.0;
      var r = 0.0;
      r = 0;
      if (this.FOnColumnCalc != null) this.FOnColumnCalc(this,Acol,FromRow,ToRow,{get: function () {
          return r;
        }, set: function (v) {
          r = v;
        }});
      Result = r;
      return Result;
    };
    this.DoColumnCalcGroup = function (Acol, FromRow, ToRow) {
      var Result = 0.0;
      var r = 0.0;
      r = 0;
      if (this.FOnGroupCalc != null) this.FOnGroupCalc(this,Acol,FromRow,ToRow,{get: function () {
          return r;
        }, set: function (v) {
          r = v;
        }});
      Result = r;
      return Result;
    };
    this.DoCellAnchorClick = function (ACol, ARow, AAnchor) {
    };
    this.DoCanEditCell = function (ACol, ARow, Allow) {
      Allow.set(this.FOptions.FEditing.FEnabled);
      Allow.set(Allow.get() && !this.IsReadOnly(ACol,ARow));
    };
    this.DoCanSizeColumn = function (ACol, Allow) {
    };
    this.DoCanSizeRow = function (ARow, Allow) {
    };
    this.DoColumnSize = function (ACol, NewWidth) {
    };
    this.DoRowSize = function (ARow, NewHeight) {
    };
    this.DoColumnSized = function (ACol, NewWidth) {
    };
    this.DoRowSized = function (ARow, NewHeight) {
    };
    this.DoCanSortColumn = function (ACol, Allow) {
    };
    this.DoColumnSorted = function (ACol, Direction) {
    };
    this.DoIsCellSelected = function (ACol, ARow) {
      var Result = false;
      Result = false;
      var $tmp = this.FOptions.FSelection.FMode;
      if ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctColumn) {
        Result = this.GetColumnSelect(ACol)}
       else if ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctRow) {
        Result = this.GetRowSelect(ARow)}
       else if ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctCell) Result = this.GetCellSelect(ACol,ARow);
      return Result;
    };
    this.CreateColumnProp = function () {
      if (this.FColumnProp != null) rtl.free(this,"FColumnProp");
      this.FColumnProp = $mod.TTMSFNCGridCellProperty.$create("Create$1",[this.FDefaultFont]);
    };
    this.DoPasteNotify = function (Origin, ARange, AOperation) {
    };
    this.Create$1 = function (AOwner) {
      var i = 0;
      pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControl.Create$1.apply(this,arguments);
      this.FDefaultLayout = pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCellLayout.$create("Create$1");
      this.FUseColumns = true;
      this.FColumns = $mod.TTMSFNCGridColumns.$create("Create$3",[this]);
      for (i = 0; i <= 4; i++) this.FColumns.Add$1();
      this.FGroupColumn = -1;
      this.FSortColumn = -1;
      this.FRowCount = 10;
      this.FColumnCount = 5;
      this.FDefaultRowHeight = 24;
      this.FDefaultColumnWidth = 68;
      this.FFixedRows = 1;
      this.FFixedColumns = 1;
      this.FFixedRightColumns = 0;
      this.FFixedFooterRows = 0;
      this.FFilterApplied = false;
      this.FCheckTrue = "TRUE";
      this.FCheckFalse = "FALSE";
      this.FFloatFormat = "%g";
      this.FColumnOrder = pas["WEBLib.TMSFNCGridDataUtil"].TTMSFNCGridIntList.$create("Create$1");
      this.FDefaultFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FOptions = pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridOptions.$create("Create$1");
      this.FOptions.FOnChange = rtl.createCallback(this,"DoOptionsChange");
      this.FGlobalFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCAppearanceGlobalFont.$create("Create$1",[this]);
      this.FColumnW = $mod.TTMSFNCGridSingleList.$create("Create$3",[this]);
      this.FOrigColumnW = $mod.TTMSFNCGridSingleList.$create("Create$3",[this]);
      this.FRowH = $mod.TTMSFNCGridSingleList.$create("Create$3",[this]);
      this.FRowList = $mod.TTMSFNCGridRowInfoList.$create("Create$1");
      this.FRowDisplayList = $mod.TTMSFNCGridIntegerList.$create("Create$1");
      this.FColumnDisplayList = $mod.TTMSFNCGridIntegerList.$create("Create$1");
      this.FHiddenColumnList = $mod.TTMSFNCGridIntegerList.$create("Create$1");
      this.FSuppressedColumnList = $mod.TTMSFNCGridIntegerList.$create("Create$1");
      this.FHiddenRowList = $mod.TTMSFNCGridIntegerList.$create("Create$1");
      this.FColSelect = pas["WEBLib.TMSFNCGridDataUtil"].TTMSFNCGridIntList.$create("Create$1");
      this.FSelectedCells = $mod.TTMSFNCGridCellList.$create("Create$2");
      this.FMarkList = $mod.TTMSFNCGridCellMarkList.$create("Create$3",[this]);
      this.FCellCalcList = pas["WEBLib.TMSFNCGridDataUtil"].TTMSFNCGridIntList.$create("Create$1");
      this.FIOOffset.$assign(pas.Types.Point(this.FFixedColumns,this.FFixedRows));
      this.FFilter = $mod.TTMSFNCGridFilter.$create("Create$3",[this]);
      this.FSortIndexes = $mod.TTMSFNCGridSortIndexList.$create("Create$1");
      this.CreateColumnProp();
      this.FUpdateCount$1 = this.FUpdateCount$1 + 1;
      this.SetColumnCount(this.FColumnCount);
      this.FUpdateCount$1 = this.FUpdateCount$1 - 1;
      return this;
    };
    this.Destroy = function () {
      this.Clear();
      rtl.free(this,"FGlobalFont");
      rtl.free(this,"FDefaultLayout");
      rtl.free(this,"FColumns");
      rtl.free(this,"FColumnProp");
      rtl.free(this,"FDefaultFont");
      rtl.free(this,"FOptions");
      rtl.free(this,"FColumnW");
      rtl.free(this,"FOrigColumnW");
      rtl.free(this,"FRowH");
      rtl.free(this,"FRowDisplayList");
      rtl.free(this,"FColumnDisplayList");
      rtl.free(this,"FHiddenColumnList");
      rtl.free(this,"FSuppressedColumnList");
      rtl.free(this,"FHiddenRowList");
      rtl.free(this,"FRowList");
      rtl.free(this,"FFilter");
      rtl.free(this,"FSortIndexes");
      rtl.free(this,"FMarkList");
      rtl.free(this,"FColSelect");
      rtl.free(this,"FSelectedCells");
      rtl.free(this,"FCellCalcList");
      this.FColumnOrder.Clear();
      rtl.free(this,"FColumnOrder");
      pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControl.Destroy.call(this);
    };
    this.Clear = function () {
      var i = 0;
      var j = 0;
      var cp = null;
      var ri = null;
      this.BeginUpdate();
      this.UnHideRowsAll();
      this.UnHideColumnsAll();
      for (var $l = this.FRowList.GetCount() - 1; $l >= 0; $l--) {
        i = $l;
        if (this.FRowList.GetItem(i) != null) {
          for (var $l1 = 0, $end = this.FRowList.GetItem(i).FData.GetCount() - 1; $l1 <= $end; $l1++) {
            j = $l1;
            cp = this.FRowList.GetItem(i).FData.GetObject(j);
            if ((cp != null) && cp.IsBaseCell(j,i)) {
              cp.FreeControl();
              cp = rtl.freeLoc(cp);
            };
          };
          ri = this.FRowList.GetItem(i);
          ri = rtl.freeLoc(ri);
        };
      };
      this.FRowList.Clear();
      this.FRowDisplayList.Clear();
      this.FColumnDisplayList.Clear();
      this.FHiddenColumnList.Clear();
      this.FSuppressedColumnList.Clear();
      this.FHiddenRowList.Clear();
      this.EndUpdate();
    };
    this.ClearSortColumn = function () {
      this.FSortColumn = -1;
    };
    this.ClearCells = function (CellRange) {
      var i = 0;
      var j = 0;
      var cp = null;
      var sl = null;
      this.BeginUpdate();
      for (var $l = CellRange.StartRow, $end = CellRange.EndRow; $l <= $end; $l++) {
        i = $l;
        if ((i < this.FRowList.GetCount()) && (this.FRowList.GetItem(i) != null)) {
          for (var $l1 = CellRange.StartCol, $end1 = Math.min(CellRange.EndCol,this.FRowList.GetItem(i).FData.GetCount() - 1); $l1 <= $end1; $l1++) {
            j = $l1;
            this.SplitCell(j,i);
            sl = this.FRowList.GetItem(i).FData;
            sl.Put(j,"");
            cp = sl.GetObject(j);
            if (cp != null) {
              if (cp.FControl != null) cp.FreeControl();
              cp = rtl.freeLoc(cp);
              sl.PutObject(j,null);
            };
          };
        };
      };
      this.EndUpdate();
    };
    this.ClearNormalCells = function () {
      this.ClearCells($mod.TTMSFNCGridCellRecRange.$clone(this.CellRange(this.FFixedColumns,this.FFixedRows,this.GetColumnCount() - 1,this.GetRowCount() - 1)));
    };
    this.Debug = function () {
    };
    this.GetCellMergeInfo = function (ACol, ARow, ABaseCol, ABaseRow, AColSpan, ARowSpan) {
      this.DoGetCellMergeInfo(ACol,ARow,ABaseCol,ABaseRow,AColSpan,ARowSpan);
    };
    this.GetCellState = function (ACol, ARow) {
      var Result = 0;
      Result = $mod.TTMSFNCGridCellState.csNormal;
      return Result;
    };
    this.GetCellLayout = function (ACol, ARow, ACellState) {
      var Result = null;
      this.FDefaultLayout.Assign(this.GetDefaultNormalLayout());
      this.DoGetCellLayout(ACol,ARow,this.FDefaultLayout,ACellState);
      Result = this.FDefaultLayout;
      return Result;
    };
    this.DisplToRealRow = function (Row) {
      var Result = 0;
      if ((Row >= 0) && (Row < this.FRowDisplayList.GetCount())) {
        Result = this.FRowDisplayList.GetItem(Row)}
       else Result = Row;
      return Result;
    };
    this.RealToDisplRow = function (Row) {
      var Result = 0;
      var i = 0;
      Result = Row;
      i = 0;
      while (i < this.FRowDisplayList.GetCount()) {
        if (this.FRowDisplayList.GetItem(i) === Row) {
          Result = i;
          break;
        };
        i += 1;
      };
      return Result;
    };
    this.DisplToRealColumn = function (Col) {
      var Result = 0;
      if ((Col >= 0) && (Col < this.FColumnDisplayList.GetCount())) {
        Result = this.FColumnDisplayList.GetItem(Col)}
       else Result = Col;
      return Result;
    };
    this.RealToDisplColumn = function (Col) {
      var Result = 0;
      var i = 0;
      Result = -1;
      i = 0;
      while (i < this.FColumnDisplayList.GetCount()) {
        if (this.FColumnDisplayList.GetItem(i) === Col) {
          Result = i;
          break;
        };
        i += 1;
      };
      return Result;
    };
    this.GetColumnRange = function (Col, DoFixed) {
      var Result = $mod.TTMSFNCGridCellRecRange.$new();
      if (DoFixed) {
        Result.$assign(this.CellRange(Col,0,Col,this.GetRowCount() - 1))}
       else Result.$assign(this.CellRange(Col,this.FFixedRows,Col,this.GetRowCount() - 1 - this.FFixedFooterRows));
      return Result;
    };
    this.GetRowRange = function (Row, DoFixed) {
      var Result = $mod.TTMSFNCGridCellRecRange.$new();
      if (DoFixed) {
        Result.$assign(this.CellRange(0,Row,this.GetColumnCount() - 1,Row))}
       else Result.$assign(this.CellRange(this.FFixedColumns,Row,this.GetColumnCount() - 1 - this.FFixedRightColumns,Row));
      return Result;
    };
    this.GetGridRange = function (DoFixed) {
      var Result = $mod.TTMSFNCGridCellRecRange.$new();
      if (DoFixed) {
        Result.$assign(this.CellRange(0,0,this.GetColumnCount() - 1,this.GetRowCount() - 1))}
       else Result.$assign(this.CellRange(this.FFixedColumns,this.FFixedRows,this.GetColumnCount() - 1 - this.FFixedRightColumns,this.GetRowCount() - 1 - this.FFixedFooterRows));
      return Result;
    };
    this.GetCellRecRange = function (Col, Row) {
      var Result = $mod.TTMSFNCGridCellRecRange.$new();
      Result.$assign(this.CellRange(Col,Row,Col,Row));
      return Result;
    };
    this.InitOriginalColumnSizes = function () {
      var i = 0;
      this.FOrigColumnW.Clear();
      for (var $l = 0, $end = this.GetColumnCount() - 1; $l <= $end; $l++) {
        i = $l;
        var $with = this.FOrigColumnW.Add$1();
        $with.SetValue(this.GetColWidths(i));
      };
      this.FOldSize = this.GetWidth();
    };
    this.RandomFill = function (DoFixed, rnd) {
      var i = 0;
      var j = 0;
      var ro = 0;
      var co = 0;
      var re = 0;
      var ce = 0;
      this.BeginUpdate();
      if (DoFixed) {
        ro = 0;
        co = 0;
        re = this.GetRowCount() - 1;
        ce = this.GetColumnCount() - 1;
      } else {
        ro = this.FFixedRows;
        co = this.FFixedColumns;
        re = this.GetRowCount() - 1 - this.FFixedFooterRows;
        ce = this.GetColumnCount() - 1 - this.FFixedRightColumns;
      };
      for (var $l = ro, $end = re; $l <= $end; $l++) {
        i = $l;
        for (var $l1 = co, $end1 = ce; $l1 <= $end1; $l1++) {
          j = $l1;
          this.SetCells(j,i,pas.SysUtils.IntToStr(pas.System.Random(rnd)));
        };
      };
      this.EndUpdate();
    };
    this.LinearFill = function (DoFixed) {
      var i = 0;
      var j = 0;
      var ro = 0;
      var co = 0;
      var re = 0;
      var ce = 0;
      this.BeginUpdate();
      if (DoFixed) {
        ro = 0;
        co = 0;
        re = this.GetRowCount() - 1;
        ce = this.GetColumnCount() - 1;
      } else {
        ro = this.FFixedRows;
        co = this.FFixedColumns;
        re = this.GetRowCount() - 1 - this.FFixedFooterRows;
        ce = this.GetColumnCount() - 1 - this.FFixedRightColumns;
      };
      for (var $l = ro, $end = re; $l <= $end; $l++) {
        i = $l;
        for (var $l1 = co, $end1 = ce; $l1 <= $end1; $l1++) {
          j = $l1;
          this.SetCells(j,i,pas.SysUtils.IntToStr(j) + ":" + pas.SysUtils.IntToStr(i));
        };
      };
      this.EndUpdate();
    };
    this.CellRange = function (AStartCol, AStartRow, AEndCol, AEndRow) {
      var Result = $mod.TTMSFNCGridCellRecRange.$new();
      Result.StartCol = AStartCol;
      Result.StartRow = AStartRow;
      Result.EndCol = AEndCol;
      Result.EndRow = AEndRow;
      return Result;
    };
    this.SingleCell = function (ACol, ARow) {
      var Result = $mod.TTMSFNCGridCellRec.$new();
      Result.Col = ACol;
      Result.Row = ARow;
      return Result;
    };
    this.IsReadOnly = function (Col, Row) {
      var Result = false;
      Result = false;
      this.DoGetCellReadOnly(Col,Row,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.ClearRowSelect = function () {
      var i = 0;
      for (var $l = this.FFixedRows, $end = this.GetRowCount() - this.FFixedFooterRows - 1; $l <= $end; $l++) {
        i = $l;
        if (i >= this.FRowList.GetCount()) break;
        if (this.FRowList.GetItem(i) != null) this.FRowList.GetItem(i).SetState($mod.TTMSFNCGridRowState.rsDefault);
      };
    };
    this.GetSelectedRowCount = function () {
      var Result = 0;
      var i = 0;
      Result = 0;
      for (var $l = this.FFixedRows, $end = this.GetRowCount() - this.FFixedFooterRows - 1; $l <= $end; $l++) {
        i = $l;
        if (i >= this.FRowList.GetCount()) break;
        if ((this.FRowList.GetItem(i) != null) && (this.FRowList.GetItem(i).FState === $mod.TTMSFNCGridRowState.rsSelected)) Result += 1;
      };
      return Result;
    };
    this.SelectRows = function (FromRow, ToRow) {
      var i = 0;
      if (this.FOptions.FSelection.FMode === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smRowRange) {
        this.SetSelection(this.CellRange(0,FromRow,0,ToRow))}
       else if (this.FOptions.FSelection.FMode === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smSingleRow) {
        this.SetSelection(this.CellRange(0,FromRow,0,FromRow))}
       else if (this.FOptions.FSelection.FMode === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctRow) for (var $l = FromRow, $end = ToRow; $l <= $end; $l++) {
        i = $l;
        this.SetRowSelect(i,true);
      };
    };
    this.UnSelectRows = function (FromRow, ToRow) {
      var i = 0;
      for (var $l = FromRow, $end = ToRow; $l <= $end; $l++) {
        i = $l;
        this.SetRowSelect(i,false);
      };
    };
    this.ClearColumnSelect = function () {
      this.FColSelect.Clear();
    };
    this.GetSelectedColumnCount = function () {
      var Result = 0;
      Result = this.FColSelect.GetCount();
      return Result;
    };
    this.SelectColumns = function (FromColumn, ToColumn) {
      this.SelectCell($mod.TTMSFNCGridCellRec.$clone($mod.MakeCell(FromColumn,0)),{},false);
      this.SelectCell($mod.TTMSFNCGridCellRec.$clone($mod.MakeCell(ToColumn,0)),rtl.createSet(pas.Classes.TShiftState$a.ssCtrl,pas.Classes.TShiftState$a.ssShift),false);
    };
    this.UnSelectColumns = function (FromColumn, ToColumn) {
      var i = 0;
      var idx = 0;
      for (var $l = FromColumn, $end = ToColumn; $l <= $end; $l++) {
        i = $l;
        idx = this.FColSelect.IndexOfValue(i);
        if (idx !== -1) this.FColSelect.Delete$1(idx);
      };
      this.UpdateGridCells(false);
    };
    this.ClearCellSelect = function () {
      this.FSelectedCells.Clear$1();
    };
    this.GetSelectedCellCount = function () {
      var Result = 0;
      Result = this.FSelectedCells.GetCount();
      return Result;
    };
    this.SelectCells = function (ARange) {
      this.SelectCell($mod.TTMSFNCGridCellRec.$clone($mod.MakeCell(ARange.StartCol,ARange.StartRow)),{},false);
      this.SelectCell($mod.TTMSFNCGridCellRec.$clone($mod.MakeCell(ARange.EndCol,ARange.EndRow)),rtl.createSet(pas.Classes.TShiftState$a.ssShift,pas.Classes.TShiftState$a.ssCtrl),false);
    };
    this.UnSelectCells = function (ARange) {
      var i = 0;
      var j = 0;
      for (var $l = ARange.StartCol, $end = ARange.EndCol; $l <= $end; $l++) {
        i = $l;
        for (var $l1 = ARange.StartRow, $end1 = ARange.EndRow; $l1 <= $end1; $l1++) {
          j = $l1;
          this.SetCellSelect(i,j,false);
        };
      };
    };
    this.SetColumnOrder = function () {
      var i = 0;
      this.FColumnOrder.Clear();
      for (var $l = 1, $end = this.GetColumnCount(); $l <= $end; $l++) {
        i = $l;
        this.FColumnOrder.Add$1(i - 1);
      };
    };
    this.ResetColumnOrder = function () {
      var i = 0;
      var rst = false;
      this.UnHideColumnsAll();
      if (this.FColumnOrder.GetCount() === 0) {
        this.SetColumnOrder();
        return;
      };
      rst = false;
      while (!rst) {
        rst = true;
        for (var $l = 1, $end = this.GetColumnCount(); $l <= $end; $l++) {
          i = $l;
          if ((i - 1) > this.FColumnOrder.GetInteger(i - 1)) {
            rst = false;
            this.MoveColumn(i - 1,this.FColumnOrder.GetInteger(i - 1));
          };
        };
      };
    };
    this.ColumnStatesToString = function () {
      var Result = "";
      var i = 0;
      var ci = 0;
      var r = "";
      r = pas.SysUtils.IntToStr(this.GetColumnCount() + this.GetHiddenColCount()) + "#";
      for (var $l = 0, $end = (this.GetColumnCount() - 1) + this.GetHiddenColCount(); $l <= $end; $l++) {
        i = $l;
        ci = pas.System.Trunc(this.GetColWidths(i));
        if (i === 0) {
          r = r + pas.SysUtils.IntToStr(ci)}
         else r = r + "," + pas.SysUtils.IntToStr(ci);
      };
      r = r + "#";
      if (this.FColumnOrder.GetCount() === 0) {
        for (var $l1 = 0, $end1 = (this.GetColumnCount() - 1) + this.GetHiddenColCount(); $l1 <= $end1; $l1++) {
          i = $l1;
          if (i === 0) {
            r = r + pas.SysUtils.IntToStr(i)}
           else r = r + "," + pas.SysUtils.IntToStr(i);
        };
      } else for (var $l2 = 0, $end2 = this.FColumnOrder.GetCount() - 1; $l2 <= $end2; $l2++) {
        i = $l2;
        if (i === 0) {
          r = r + pas.SysUtils.IntToStr(this.FColumnOrder.GetInteger(i))}
         else r = r + "," + pas.SysUtils.IntToStr(this.FColumnOrder.GetInteger(i));
      };
      r = r + "#";
      for (var $l3 = 0, $end3 = (this.GetColumnCount() - 1) + this.GetHiddenColCount(); $l3 <= $end3; $l3++) {
        i = $l3;
        if (i === 0) {
          if (this.IsHiddenColumn(i)) {
            r = r + "0"}
           else r = r + "1";
        } else {
          if (this.IsHiddenColumn(i)) {
            r = r + ",0"}
           else r = r + ",1";
        };
      };
      Result = r;
      return Result;
    };
    this.StringToColumnStates = function (Value) {
      var i = 0;
      var j = 0;
      var il = null;
      var sl = null;
      var s = "";
      var NewPos = 0;
      var cw = 0;
      var stretch = false;
      if (pas.System.Pos("#",Value) === 0) return;
      this.BeginUpdate();
      try {
        this.FColumnOrder.Clear();
        this.UnHideColumnsAll();
        s = pas.System.Copy(Value,1,pas.System.Pos("#",Value) - 1);
        this.SetColumnCount(pas.SysUtils.StrToInt(s));
        pas.System.Delete({get: function () {
            return Value;
          }, set: function (v) {
            Value = v;
          }},1,pas.System.Pos("#",Value));
        s = pas.System.Copy(Value,pas.System.Pos("#",Value) + 1,Value.length);
        s = pas.System.Copy(s,1,pas.System.Pos("#",s) - 1);
        sl = pas.Classes.TStringList.$create("Create$1");
        sl.SetCommaText(s);
        if (s !== "") {
          for (var $l = 0, $end = this.GetColumnCount() - 1; $l <= $end; $l++) {
            i = $l;
            if (i < sl.GetCount()) {
              NewPos = pas.SysUtils.StrToInt(sl.Get(i));
              if (NewPos !== -1) this.FColumnOrder.Add$1(NewPos);
            };
          };
          il = pas["WEBLib.TMSFNCGridDataUtil"].TTMSFNCGridIntList.$create("Create$1");
          for (var $l1 = 0, $end1 = this.GetColumnCount() - 1; $l1 <= $end1; $l1++) {
            i = $l1;
            for (var $l2 = 0, $end2 = this.FColumnOrder.GetCount() - 1; $l2 <= $end2; $l2++) {
              j = $l2;
              if (this.FColumnOrder.GetInteger(j) === i) il.Add$1(j);
            };
          };
          this.FColumnOrder.Clear();
          for (var $l3 = 0, $end3 = this.GetColumnCount() - 1; $l3 <= $end3; $l3++) {
            i = $l3;
            this.FColumnOrder.Add$1(il.GetInteger(i));
          };
          il = rtl.freeLoc(il);
          if (this.FColumnOrder.GetCount() > 0) this.ResetColumnOrder();
          this.FColumnOrder.Clear();
          for (var $l4 = 0, $end4 = this.GetColumnCount() - 1; $l4 <= $end4; $l4++) {
            i = $l4;
            NewPos = pas.SysUtils.StrToInt(sl.Get(i));
            if (NewPos !== -1) this.FColumnOrder.Add$1(NewPos);
          };
        };
        s = pas.System.Copy(Value,pas.System.Pos("#",Value) + 1,Value.length);
        s = pas.System.Copy(s,pas.System.Pos("#",s) + 1,s.length);
        sl.SetCommaText(s);
        for (var $l5 = this.GetColumnCount() - 1; $l5 >= 0; $l5--) {
          i = $l5;
          if (sl.Get(i) === "0") this.HideColumn(i);
        };
        s = pas.System.Copy(Value,1,pas.System.Pos("#",Value) - 1);
        sl.SetCommaText(s);
        stretch = this.FOptions.FColumnSize.FStretch;
        this.FOptions.FColumnSize.SetStretch(false);
        if (stretch) {
          if (this.FOptions.FColumnSize.FStretchColumn === -1) {
            this.SetDefaultColumnWidth(this.GetColWidths(this.GetColumnCount() - 1))}
           else this.SetDefaultColumnWidth(this.GetColWidths(this.FOptions.FColumnSize.FStretchColumn));
        };
        for (var $l6 = 0, $end5 = this.GetColumnCount() - 1; $l6 <= $end5; $l6++) {
          i = $l6;
          cw = pas.SysUtils.StrToInt(sl.Get(i));
          if (cw === 0) {
            this.SuppressColumn(i)}
           else this.SetColWidths(this.RealToDisplColumn(i),cw);
        };
        this.FOptions.FColumnSize.SetStretch(stretch);
        sl = rtl.freeLoc(sl);
      } finally {
        this.EndUpdate();
      };
    };
    this.ColumnPosition = function (ACol) {
      var Result = 0;
      var i = 0;
      Result = ACol;
      if (this.FColumnOrder.GetCount() === 0) return Result;
      for (var $l = 1, $end = this.GetColumnCount() + this.GetHiddenColCount(); $l <= $end; $l++) {
        i = $l;
        if (ACol === this.FColumnOrder.GetInteger(i - 1)) {
          Result = i - 1;
          break;
        };
      };
      if (this.FGroupColumn !== -1) {
        if (ACol >= this.FGroupColumn) {
          Result = Result - 1;
        };
      };
      return Result;
    };
    this.ColumnAtPosition = function (ACol) {
      var Result = 0;
      Result = ACol;
      if (this.FColumnOrder.GetCount() === 0) {
        this.SetColumnOrder();
        if (this.FColumnOrder.GetCount() === 0) return Result;
      };
      Result = this.FColumnOrder.GetInteger(ACol);
      if (this.FGroupColumn !== -1) {
        if (Result >= this.FGroupColumn) Result = Result + 1;
      };
      return Result;
    };
    this.Find = function (StartC, s, FindParams) {
      var Result = pas.Types.TPoint.$new();
      Result.$assign(this.FindInternal(pas.Types.TPoint.$clone(StartC),s,rtl.refSet(FindParams)));
      if (($mod.TTMSFNCGridFindParameters.fnAutoGoto in FindParams) && (Result.x !== -1)) {
        this.SetSelection(this.CellRange(Result.x,Result.y,Result.x,Result.y));
      };
      return Result;
    };
    this.FindFirst = function (s, FindParams) {
      var Result = pas.Types.TPoint.$new();
      this.FSearchCell.$assign(this.Find(pas.Types.TPoint.$clone(pas.Types.Point(-1,-1)),s,rtl.refSet(FindParams)));
      Result.$assign(this.FSearchCell);
      return Result;
    };
    this.FindNext = function () {
      var Result = pas.Types.TPoint.$new();
      this.FSearchCell.$assign(this.Find(pas.Types.TPoint.$clone(this.FSearchCell),this.FSearchCache,rtl.refSet(this.FFindParams)));
      Result.$assign(this.FSearchCell);
      return Result;
    };
    this.Replace = function (OrigStr, NewStr, FindParams) {
      var Result = 0;
      var cp = pas.Types.TPoint.$new();
      var i = 0;
      i = 0;
      cp.$assign(this.FindFirst(OrigStr,rtl.refSet(FindParams)));
      while (cp.x !== -1) {
        this.SetCells(cp.x,cp.y,NewStr);
        i += 1;
        cp.$assign(this.FindNext());
      };
      Result = i;
      return Result;
    };
    this.IsFixed = function (Col, Row) {
      var Result = false;
      Result = (Row < this.FFixedRows) || (Row > (this.GetRowCount() - 1 - this.FFixedFooterRows)) || (Col < this.FFixedColumns) || (Col > (this.GetColumnCount() - 1 - this.FFixedRightColumns));
      Result = Result || this.IsNormalFixed(Col,Row);
      return Result;
    };
    this.IsBand = function (Row) {
      var Result = false;
      Result = pas.System.Odd(Row);
      this.DoGetRowIsBand(Row,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.IsNormalFixed = function (Col, Row) {
      var Result = false;
      var ACellFixed = false;
      ACellFixed = false;
      this.DoGetCellIsFixed(Col,Row,{get: function () {
          return ACellFixed;
        }, set: function (v) {
          ACellFixed = v;
        }});
      Result = ACellFixed;
      return Result;
    };
    this.NextSelectableRow = function (Col, Row) {
      var Result = $mod.TTMSFNCGridCellRec.$new();
      var c = 0;
      var r = 0;
      var corig = 0;
      var rorig = 0;
      var rs = 0;
      var chk = false;
      c = Col;
      r = Row;
      corig = c;
      rorig = r;
      Result.Col = Col;
      Result.Row = Row;
      rs = this.RowSpan(c,r);
      if (rs > 0) {
        chk = (Result.Row + rs) <= (this.GetRowCount() - 1 - this.FFixedFooterRows);
        if (chk) Result.Row = Result.Row + rs;
      } else {
        chk = (Result.Row + 1) <= (this.GetRowCount() - 1 - this.FFixedFooterRows);
        if (chk) Result.Row = Result.Row + 1;
      };
      if (chk) {
        while (this.IsNormalFixed(Result.Col,Result.Row) && (Result.Row < (this.GetRowCount() - 1 - this.FFixedFooterRows))) {
          rs = this.RowSpan(c,r);
          if (rs > 0) {
            Result.Row = Result.Row + rs}
           else Result.Row = Result.Row + 1;
        };
      };
      if (this.IsNormalFixed(Result.Col,Result.Row)) {
        Result.Col = corig;
        Result.Row = rorig;
      };
      return Result;
    };
    this.NextSelectableColumn = function (Col, Row) {
      var Result = $mod.TTMSFNCGridCellRec.$new();
      var c = 0;
      var corig = 0;
      var r = 0;
      var rorig = 0;
      var cs = 0;
      var chk = false;
      c = Col;
      r = Row;
      corig = c;
      rorig = r;
      Result.Col = Col;
      Result.Row = Row;
      cs = this.ColSpan(c,r);
      if (cs > 0) {
        chk = (Result.Col + cs) <= (this.GetColumnCount() - 1 - this.FFixedRightColumns);
        if (chk) Result.Col = Result.Col + cs;
      } else {
        chk = (Result.Col + 1) <= (this.GetColumnCount() - 1 - this.FFixedRightColumns);
        if (chk) Result.Col = Result.Col + 1;
      };
      if (chk) {
        while ((this.IsNormalFixed(Result.Col,Result.Row) || this.IsSuppressedColumn(Result.Col)) && (Result.Col < (this.GetColumnCount() - 1 - this.FFixedRightColumns))) {
          cs = this.ColSpan(c,r);
          if (cs > 0) {
            Result.Col = Result.Col + cs}
           else Result.Col = Result.Col + 1;
        };
      };
      if (this.IsNormalFixed(Result.Col,Result.Row) || this.IsSuppressedColumn(Result.Col)) {
        Result.Col = corig;
        Result.Row = rorig;
      };
      return Result;
    };
    this.PreviousSelectableColumn = function (Col, Row) {
      var Result = $mod.TTMSFNCGridCellRec.$new();
      var c = 0;
      var r = 0;
      var rorig = 0;
      var corig = 0;
      c = Col;
      r = Row;
      corig = c;
      rorig = r;
      Result.Col = Col;
      Result.Row = Row;
      if ((Result.Col - 1) >= this.FFixedColumns) {
        Result.Col = Result.Col - 1;
        while ((this.IsNormalFixed(Result.Col,Result.Row) || this.IsSuppressedColumn(Result.Col)) && (Result.Col > this.FFixedColumns)) Result.Col = Result.Col - 1;
      };
      if (this.IsNormalFixed(Result.Col,Result.Row) || this.IsSuppressedColumn(Result.Col)) {
        Result.Col = corig;
        Result.Row = rorig;
      };
      return Result;
    };
    this.PreviousSelectableRow = function (Col, Row) {
      var Result = $mod.TTMSFNCGridCellRec.$new();
      var c = 0;
      var r = 0;
      var corig = 0;
      var rorig = 0;
      c = Col;
      r = Row;
      corig = c;
      rorig = r;
      Result.Col = Col;
      Result.Row = Row;
      if ((Result.Row - 1) >= this.FFixedRows) {
        Result.Row = Result.Row - 1;
        while (this.IsNormalFixed(Result.Col,Result.Row) && (Result.Row > this.FFixedRows)) Result.Row = Result.Row - 1;
      };
      if (this.IsNormalFixed(Result.Col,Result.Row)) {
        Result.Col = corig;
        Result.Row = rorig;
      };
      return Result;
    };
    this.ApplyFilter = function () {
      var i = 0;
      var h = 0;
      var HideList = null;
      var cnd = false;
      HideList = $mod.TTMSFNCGridIntegerList.$create("Create$1");
      try {
        for (var $l = this.FFixedRows, $end = this.GetRowCount() - 1; $l <= $end; $l++) {
          i = $l;
          cnd = (this.FOptions.FFiltering.FRows === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridFilterRows.frAll) || ((this.FOptions.FFiltering.FRows === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridFilterRows.frNormal) && !this.IsNode(i) && !this.IsSummary(i) && !this.IsFixed(this.FFixedColumns,i));
          if (!this.MatchFilter(i) && cnd) {
            HideList.Add(i);
          };
        };
        h = 0;
        for (var $l1 = 0, $end1 = HideList.GetCount() - 1; $l1 <= $end1; $l1++) {
          i = $l1;
          while (this.FRowDisplayList.GetItem(h) !== HideList.GetItem(i)) h += 1;
          if (this.FRowDisplayList.GetItem(h) === HideList.GetItem(i)) this.FRowDisplayList.Delete(h);
        };
        this.FRowCount = this.FRowCount - HideList.GetCount();
      } finally {
        HideList = rtl.freeLoc(HideList);
        this.FFilterApplied = true;
        this.UpdateControl(true,true);
      };
    };
    this.RemoveFilter = function () {
      this.UnHideRowsAll();
      this.FFilterApplied = false;
    };
    this.RemoveFilters = function () {
      this.FFilter.Clear();
      this.UnHideRowsAll();
      this.FFilterApplied = false;
    };
    this.LookupInColumn = function (Col, AValue, AllRows, AutoGoto) {
      var Result = 0;
      var sr = 0;
      if (AllRows) {
        sr = 0}
       else sr = this.FFixedRows;
      Result = this.LookupInColumnFromRow(Col,sr,AValue,AllRows,AutoGoto);
      return Result;
    };
    this.LookupInColumnFromRow = function (Col, Row, AValue, AllRows, AutoGoto) {
      var Result = 0;
      var i = 0;
      var sr = 0;
      var er = 0;
      var m = 0;
      var s = "";
      var v = "";
      Result = -1;
      v = AValue;
      if (!this.FOptions.FLookup.FCaseSensitive) v = pas.SysUtils.UpperCase(v);
      if (AllRows) {
        sr = this.FFixedRows;
        er = this.GetRowCount() - 1;
      } else {
        sr = Row;
        er = this.GetRowCount() - 1 - this.FFixedFooterRows;
      };
      if (Col === this.FSortColumn) {
        do {
          m = sr + Math.round((er - sr) / 2);
          s = this.GetCells(Col,this.DisplToRealRow(m));
          if (!this.FOptions.FLookup.FCaseSensitive) s = pas.SysUtils.UpperCase(s);
          if (pas.System.Pos(v,s) === 1) {
            Result = m;
            break;
          };
          if (v > s) {
            sr = m}
           else er = m;
        } while (!((er - sr) <= 1));
        if ((m > sr) && (Result !== -1)) {
          do {
            s = this.GetCells(Col,this.DisplToRealRow(m - 1));
            if (!this.FOptions.FLookup.FCaseSensitive) s = pas.SysUtils.UpperCase(s);
            if (pas.System.Pos(v,s) === 1) {
              m -= 1}
             else break;
          } while (!(m <= sr));
          Result = m;
        };
      } else {
        for (var $l = sr, $end = er; $l <= $end; $l++) {
          i = $l;
          s = this.GetCells(Col,this.DisplToRealRow(i));
          if (!this.FOptions.FLookup.FCaseSensitive) s = pas.SysUtils.UpperCase(s);
          if (pas.System.Pos(v,s) === 1) {
            Result = i;
            break;
          };
        };
      };
      if (AutoGoto && (Result !== -1)) this.SetFocusedCell($mod.MakeCell(Col,Result));
      return Result;
    };
    this.AutoNumberCol = function (Col, StartRow, StartValue) {
      var i = 0;
      for (var $l = StartRow, $end = this.FRowCount - 1; $l <= $end; $l++) {
        i = $l;
        this.SetCells(Col,i,pas.SysUtils.IntToStr(StartValue));
        StartValue += 1;
      };
    };
    this.AutoNumberRow = function (Row, StartColumn, StartValue) {
      var i = 0;
      for (var $l = StartColumn, $end = this.GetColumnCount() - 1; $l <= $end; $l++) {
        i = $l;
        this.SetCells(i,Row,pas.SysUtils.IntToStr(StartValue));
        StartValue += 1;
      };
    };
    this.AddHeaderCheckBox = function (Col, Row, State) {
      var cp = null;
      cp = this.GetIntObjects(Col,Row);
      if (!(cp != null)) cp = $mod.TTMSFNCGridCellProperty.$create("Create$1",[this.GetDefaultFont(Col,Row)]);
      if (cp.FControl != null) cp.FreeControl();
      cp.FControl = $mod.TTMSFNCGridCellCheckBox.$create("Create");
      rtl.as(cp.FControl,$mod.TTMSFNCGridCellCheckBox).FChecked = State;
      rtl.as(cp.FControl,$mod.TTMSFNCGridCellCheckBox).FHeader = true;
      this.SetIntObjects(Col,Row,cp);
      this.UpdateGridCells(false);
    };
    this.AddCheckBox = function (Col, Row, State) {
      var cp = null;
      cp = this.GetIntObjects(Col,Row);
      if (!(cp != null)) cp = $mod.TTMSFNCGridCellProperty.$create("Create$1",[this.GetDefaultFont(Col,Row)]);
      if (cp.FControl != null) cp.FreeControl();
      cp.FControl = $mod.TTMSFNCGridCellCheckBox.$create("Create");
      rtl.as(cp.FControl,$mod.TTMSFNCGridCellCheckBox).FChecked = State;
      rtl.as(cp.FControl,$mod.TTMSFNCGridCellCheckBox).FHeader = false;
      this.SetIntObjects(Col,Row,cp);
      this.UpdateGridCells(false);
    };
    this.AddCheckBoxColumn = function (Col) {
      var i = 0;
      for (var $l = this.FFixedRows, $end = this.GetRowCount() - this.FFixedFooterRows - 1; $l <= $end; $l++) {
        i = $l;
        if (this.FGroupColumn !== -1) {
          if (this.IsNode(i)) {
            if (this.FOptions.FGrouping.FAutoCheckGroup) this.AddCheckBox(Col,i,false);
          } else if (!this.IsSummary(i)) this.AddCheckBox(Col,i,false);
        } else this.AddCheckBox(Col,i,false);
      };
    };
    this.RemoveCheckBox = function (Col, Row) {
      this.RemoveCellControl(Col,Row,$mod.TTMSFNCGridCellCheckBox);
    };
    this.IsCheckBox = function (Col, Row) {
      var Result = false;
      Result = this.IsCellControl(Col,Row,$mod.TTMSFNCGridCellCheckBox) || this.IsCellControl(Col,Row,$mod.TTMSFNCGridCellDataCheckBox);
      return Result;
    };
    this.AddDataCheckBox = function (Col, Row, State) {
      var cp = null;
      cp = this.GetIntObjects(Col,Row);
      if (!(cp != null)) cp = $mod.TTMSFNCGridCellProperty.$create("Create$1",[this.GetDefaultFont(Col,Row)]);
      if (cp.FControl != null) cp.FreeControl();
      cp.FControl = $mod.TTMSFNCGridCellDataCheckBox.$create("Create");
      this.SetIntObjects(Col,Row,cp);
      if (State) {
        this.SetCells(Col,Row,this.FCheckTrue)}
       else this.SetCells(Col,Row,this.FCheckFalse);
      this.UpdateGridCells(false);
    };
    this.AddDataCheckBoxColumn = function (Col) {
      var i = 0;
      for (var $l = this.FFixedRows, $end = this.GetRowCount() - this.FFixedFooterRows - 1; $l <= $end; $l++) {
        i = $l;
        this.AddDataCheckBox(Col,i,false);
      };
    };
    this.AddRadioButton = function (Col, Row, Index, State) {
      var cp = null;
      cp = this.GetIntObjects(Col,Row);
      if (!(cp != null)) cp = $mod.TTMSFNCGridCellProperty.$create("Create$1",[this.GetDefaultFont(Col,Row)]);
      if (cp.FControl != null) cp.FreeControl();
      cp.FControl = $mod.TTMSFNCGridCellRadioButton.$create("Create");
      rtl.as(cp.FControl,$mod.TTMSFNCGridCellRadioButton).FChecked = State;
      rtl.as(cp.FControl,$mod.TTMSFNCGridCellRadioButton).FIndex = Index;
      this.SetIntObjects(Col,Row,cp);
      this.UpdateGridCells(false);
    };
    this.AddRadioButtonColumn = function (Col, Index) {
      var i = 0;
      for (var $l = this.FFixedRows, $end = this.GetRowCount() - this.FFixedFooterRows - 1; $l <= $end; $l++) {
        i = $l;
        this.AddRadioButton(Col,i,Index,false);
      };
    };
    this.RemoveRadioButton = function (Col, Row) {
      this.RemoveCellControl(Col,Row,$mod.TTMSFNCGridCellRadioButton);
    };
    this.IsRadioButton = function (Col, Row) {
      var Result = false;
      Result = this.IsCellControl(Col,Row,$mod.TTMSFNCGridCellRadioButton);
      return Result;
    };
    this.RadioButtonState = function (Col, Row) {
      var Result = false;
      var cp = null;
      Result = false;
      cp = this.GetIntObjects(Col,Row);
      if ((cp != null) && (cp.FControl != null) && $mod.TTMSFNCGridCellRadioButton.isPrototypeOf(cp.FControl)) {
        Result = rtl.as(cp.FControl,$mod.TTMSFNCGridCellRadioButton).FChecked;
      };
      return Result;
    };
    this.AddRotated = function (Col, Row, AAngle, Value) {
      var cp = null;
      cp = this.GetIntObjects(Col,Row);
      if (!(cp != null)) cp = $mod.TTMSFNCGridCellProperty.$create("Create$1",[this.GetDefaultFont(Col,Row)]);
      cp.FAngle = AAngle;
      this.SetIntObjects(Col,Row,cp);
      this.SetCells(Col,Row,Value);
    };
    this.SetRotated = function (Col, Row, AAngle) {
      var cp = null;
      cp = this.GetIntObjects(Col,Row);
      if (!(cp != null)) cp = $mod.TTMSFNCGridCellProperty.$create("Create$1",[this.GetDefaultFont(Col,Row)]);
      if (cp != null) {
        cp.FAngle = AAngle;
        this.SetIntObjects(Col,Row,cp);
      };
    };
    this.RemoveRotated = function (Col, Row) {
      var cp = null;
      cp = this.GetIntObjects(Col,Row);
      if (cp != null) {
        cp.FAngle = 0;
        this.UpdateGridCells(false);
      };
    };
    this.IsRotated = function (Col, Row, AAngle) {
      var Result = false;
      var cp = null;
      cp = this.GetIntObjects(Col,Row);
      if (cp != null) AAngle.set(cp.FAngle);
      Result = AAngle.get() !== 0;
      return Result;
    };
    this.AddButton = function (Col, Row, AText, AWidth, AHeight) {
      var cp = null;
      cp = this.GetIntObjects(Col,Row);
      if (!(cp != null)) cp = $mod.TTMSFNCGridCellProperty.$create("Create$1",[this.GetDefaultFont(Col,Row)]);
      if (cp.FControl != null) cp.FreeControl();
      cp.FControl = $mod.TTMSFNCGridCellButton.$create("Create");
      rtl.as(cp.FControl,$mod.TTMSFNCGridCellButton).FWidth = AWidth;
      rtl.as(cp.FControl,$mod.TTMSFNCGridCellButton).FHeight = AHeight;
      rtl.as(cp.FControl,$mod.TTMSFNCGridCellButton).FText = AText;
      this.SetIntObjects(Col,Row,cp);
      this.UpdateGridCells(false);
    };
    this.IsButton = function (Col, Row) {
      var Result = false;
      Result = this.IsCellControl(Col,Row,$mod.TTMSFNCGridCellButton);
      return Result;
    };
    this.RemoveButton = function (Col, Row) {
      this.RemoveCellControl(Col,Row,$mod.TTMSFNCGridCellButton);
    };
    this.AddBitmap = function (Col, Row, AName) {
      var cp = null;
      cp = this.GetIntObjects(Col,Row);
      if (!(cp != null)) cp = $mod.TTMSFNCGridCellProperty.$create("Create$1",[this.GetDefaultFont(Col,Row)]);
      if (cp.FControl != null) cp.FreeControl();
      cp.FControl = $mod.TTMSFNCGridCellBitmapName.$create("Create$1");
      rtl.as(cp.FControl,$mod.TTMSFNCGridCellBitmapName).FBitmapName = AName;
      this.SetIntObjects(Col,Row,cp);
      this.UpdateGridCells(false);
    };
    this.AddBitmap$1 = function (Col, Row, ABitmap) {
      var cp = null;
      cp = this.GetIntObjects(Col,Row);
      if (!(cp != null)) cp = $mod.TTMSFNCGridCellProperty.$create("Create$1",[this.GetDefaultFont(Col,Row)]);
      if (cp.FControl != null) cp.FreeControl();
      cp.FControl = $mod.TTMSFNCGridCellBitmap.$create("Create$1",[this]);
      rtl.as(cp.FControl,$mod.TTMSFNCGridCellBitmap).FBitmap.Assign(ABitmap);
      this.SetIntObjects(Col,Row,cp);
      this.UpdateGridCells(false);
    };
    this.CreateBitmap = function (Col, Row) {
      var Result = null;
      var cp = null;
      cp = this.GetIntObjects(Col,Row);
      if (!(cp != null)) cp = $mod.TTMSFNCGridCellProperty.$create("Create$1",[this.GetDefaultFont(Col,Row)]);
      if (cp.FControl != null) cp.FreeControl();
      cp.FControl = $mod.TTMSFNCGridCellBitmap.$create("Create$1",[this]);
      Result = rtl.as(cp.FControl,$mod.TTMSFNCGridCellBitmap).FBitmap;
      this.SetIntObjects(Col,Row,cp);
      this.UpdateGridCells(false);
      return Result;
    };
    this.CreateCheck = function (Col, Row) {
      var Result = false;
      var cp = null;
      cp = this.GetIntObjects(Col,Row);
      if (!(cp != null)) cp = $mod.TTMSFNCGridCellProperty.$create("Create$1",[this.GetDefaultFont(Col,Row)]);
      if (cp.FControl != null) cp.FreeControl();
      cp.FControl = $mod.TTMSFNCGridCellCheckBox.$create("Create");
      Result = rtl.as(cp.FControl,$mod.TTMSFNCGridCellCheckBox).FChecked;
      this.SetIntObjects(Col,Row,cp);
      this.UpdateGridCells(false);
      return Result;
    };
    this.AddDataBitmap = function (Col, Row) {
      var cp = null;
      cp = this.GetIntObjects(Col,Row);
      if (!(cp != null)) cp = $mod.TTMSFNCGridCellProperty.$create("Create$1",[this.GetDefaultFont(Col,Row)]);
      if (cp.FControl != null) cp.FreeControl();
      cp.FControl = $mod.TTMSFNCGridCellBitmapName.$create("Create$1");
      rtl.as(cp.FControl,$mod.TTMSFNCGridCellBitmapName).FData = true;
      this.SetIntObjects(Col,Row,cp);
      this.UpdateGridCells(false);
    };
    this.RemoveBitmap = function (Col, Row) {
      this.RemoveCellControl(Col,Row,$mod.TTMSFNCGridCellBitmapName);
      this.RemoveCellControl(Col,Row,$mod.TTMSFNCGridCellBitmap);
    };
    this.IsBitmap = function (Col, Row) {
      var Result = false;
      Result = this.IsCellControl(Col,Row,$mod.TTMSFNCGridCellBitmapName) || this.IsCellControl(Col,Row,$mod.TTMSFNCGridCellBitmap);
      return Result;
    };
    this.GetBitmap = function (Col, Row) {
      var Result = null;
      var cp = null;
      Result = null;
      cp = this.GetIntObjects(Col,Row);
      if ((cp != null) && (cp.FControl != null) && $mod.TTMSFNCGridCellBitmapName.isPrototypeOf(cp.FControl)) ;
      if ((cp != null) && (cp.FControl != null) && $mod.TTMSFNCGridCellBitmap.isPrototypeOf(cp.FControl)) {
        Result = rtl.as(cp.FControl,$mod.TTMSFNCGridCellBitmap).FBitmap;
      };
      return Result;
    };
    this.SetBitmapName = function (Col, Row, AName) {
      var cp = null;
      cp = this.GetIntObjects(Col,Row);
      if ((cp != null) && (cp.FControl != null) && $mod.TTMSFNCGridCellBitmapName.isPrototypeOf(cp.FControl)) {
        rtl.as(cp.FControl,$mod.TTMSFNCGridCellBitmapName).FBitmapName = AName;
        this.UpdateGridCells(false);
      };
    };
    this.GetBitmapName = function (Col, Row) {
      var Result = "";
      var cp = null;
      Result = "";
      cp = this.GetIntObjects(Col,Row);
      if ((cp != null) && (cp.FControl != null) && $mod.TTMSFNCGridCellBitmapName.isPrototypeOf(cp.FControl)) {
        Result = rtl.as(cp.FControl,$mod.TTMSFNCGridCellBitmapName).FBitmapName;
      };
      return Result;
    };
    this.AddProgressBar = function (Col, Row, Value) {
      var cp = null;
      cp = this.GetIntObjects(Col,Row);
      if (!(cp != null)) cp = $mod.TTMSFNCGridCellProperty.$create("Create$1",[this.GetDefaultFont(Col,Row)]);
      if (cp.FControl != null) cp.FreeControl();
      cp.FControl = $mod.TTMSFNCGridCellProgressBar.$create("Create");
      rtl.as(cp.FControl,$mod.TTMSFNCGridCellProgressBar).FValue = Value;
      rtl.as(cp.FControl,$mod.TTMSFNCGridCellProgressBar).FData = false;
      this.SetIntObjects(Col,Row,cp);
      this.UpdateGridCells(false);
    };
    this.AddDataProgressBar = function (Col, Row) {
      var cp = null;
      cp = this.GetIntObjects(Col,Row);
      if (!(cp != null)) cp = $mod.TTMSFNCGridCellProperty.$create("Create$1",[this.GetDefaultFont(Col,Row)]);
      if (cp.FControl != null) cp.FreeControl();
      cp.FControl = $mod.TTMSFNCGridCellProgressBar.$create("Create");
      rtl.as(cp.FControl,$mod.TTMSFNCGridCellProgressBar).FValue = 0;
      rtl.as(cp.FControl,$mod.TTMSFNCGridCellProgressBar).FData = true;
      this.SetIntObjects(Col,Row,cp);
      this.UpdateGridCells(false);
    };
    this.SetProgressBarValue = function (Col, Row, Value) {
      var cp = null;
      cp = this.GetIntObjects(Col,Row);
      if (!(cp != null)) return;
      if ($mod.TTMSFNCGridCellProgressBar.isPrototypeOf(cp.FControl)) {
        rtl.as(cp.FControl,$mod.TTMSFNCGridCellProgressBar).FValue = Value;
        this.UpdateGridCells(false);
      };
    };
    this.GetProgressBarValue = function (Col, Row) {
      var Result = 0.0;
      var cp = null;
      Result = 0;
      cp = this.GetIntObjects(Col,Row);
      if (!(cp != null)) return Result;
      if ($mod.TTMSFNCGridCellProgressBar.isPrototypeOf(cp.FControl)) Result = rtl.as(cp.FControl,$mod.TTMSFNCGridCellProgressBar).FValue;
      return Result;
    };
    this.IsProgressBar = function (Col, Row) {
      var Result = false;
      Result = this.IsCellControl(Col,Row,$mod.TTMSFNCGridCellProgressBar);
      return Result;
    };
    this.RemoveProgressBar = function (Col, Row) {
      this.RemoveCellControl(Col,Row,$mod.TTMSFNCGridCellProgressBar);
    };
    this.AddSummary = function (Row) {
      var cp = null;
      cp = this.GetIntObjects(this.FFixedColumns - 1,Row);
      if (!(cp != null)) cp = $mod.TTMSFNCGridCellProperty.$create("Create$1",[this.GetDefaultFont(this.FFixedColumns - 1,Row)]);
      if (cp.FControl != null) cp.FreeControl();
      cp.FControl = $mod.TTMSFNCGridCellSummary.$create("Create");
      this.SetIntObjects(this.FFixedColumns - 1,Row,cp);
    };
    this.RemoveSummary = function (Row) {
      this.RemoveCellControl(this.FFixedColumns - 1,Row,$mod.TTMSFNCGridCellSummary);
    };
    this.IsSummary = function (Row) {
      var Result = false;
      Result = this.IsCellControl(0,Row,$mod.TTMSFNCGridCellSummary);
      return Result;
    };
    this.AddNode = function (Row, Span) {
      var cp = null;
      if ((this.FFixedColumns - 1) >= 0) {
        cp = this.GetIntObjects(this.FFixedColumns - 1,Row);
        if (!(cp != null)) cp = $mod.TTMSFNCGridCellProperty.$create("Create$1",[this.GetDefaultFont(this.FFixedColumns - 1,Row)]);
        if (cp.FControl != null) cp.FreeControl();
        cp.FControl = $mod.TTMSFNCGridCellNode.$create("Create");
        rtl.as(cp.FControl,$mod.TTMSFNCGridCellNode).FSpan = Span;
        rtl.as(cp.FControl,$mod.TTMSFNCGridCellNode).FState = pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridNodeState.nsOpen;
        this.SetIntObjects(this.FFixedColumns - 1,Row,cp);
        this.UpdateGridCells(false);
      };
    };
    this.RemoveNode = function (Row) {
      this.RemoveCellControl(this.FFixedColumns - 1,Row,$mod.TTMSFNCGridCellNode);
    };
    this.IsNode = function (Row) {
      var Result = false;
      Result = this.IsCellControl(this.FFixedColumns - 1,Row,$mod.TTMSFNCGridCellNode);
      return Result;
    };
    this.SetNodeState = function (Row, State) {
      var cp = null;
      cp = this.GetIntObjects(this.FFixedColumns - 1,Row);
      if ((cp != null) && (cp.FControl != null) && $mod.TTMSFNCGridCellNode.isPrototypeOf(cp.FControl)) {
        rtl.as(cp.FControl,$mod.TTMSFNCGridCellNode).FState = State;
      };
    };
    this.GetNodeState = function (Row) {
      var Result = 0;
      var cn = null;
      Result = pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridNodeState.nsOpen;
      cn = this.GetNode(Row);
      if (cn != null) Result = cn.FState;
      return Result;
    };
    this.SetNodeSpan = function (Row, Span) {
      var cp = null;
      cp = this.GetIntObjects(this.FFixedColumns - 1,Row);
      if ((cp != null) && (cp.FControl != null) && $mod.TTMSFNCGridCellNode.isPrototypeOf(cp.FControl)) {
        rtl.as(cp.FControl,$mod.TTMSFNCGridCellNode).FSpan = Span;
      };
    };
    this.GetNodeSpan = function (Row) {
      var Result = 0;
      var cn = null;
      Result = -1;
      cn = this.GetNode(Row);
      if (cn != null) Result = cn.FSpan;
      return Result;
    };
    this.GetNode = function (Row) {
      var Result = null;
      var cp = null;
      Result = null;
      cp = this.GetIntObjects(this.FFixedColumns - 1,Row);
      if ((cp != null) && (cp.FControl != null) && $mod.TTMSFNCGridCellNode.isPrototypeOf(cp.FControl)) {
        Result = rtl.as(cp.FControl,$mod.TTMSFNCGridCellNode);
      };
      return Result;
    };
    this.OpenNode = function (Row) {
      var cn = null;
      cn = this.GetNode(Row);
      if (!(cn != null)) return;
      if (cn.FSpan !== -1) {
        if (cn.FState === pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridNodeState.nsClosed) {
          cn.FState = pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridNodeState.nsOpen;
          this.UnHideRows(Row + 1,cn.FSpan);
        };
      };
    };
    this.CloseNode = function (Row) {
      var cn = null;
      cn = this.GetNode(Row);
      if (!(cn != null)) return;
      if (cn.FSpan !== -1) {
        if (cn.FState === pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridNodeState.nsOpen) {
          cn.FState = pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridNodeState.nsClosed;
          this.HideRows(Row + 1,cn.FSpan);
        };
      };
    };
    this.OpenAllNodes = function () {
      var i = 0;
      var rr = 0;
      i = this.FFixedRows;
      while (i < (this.GetRowCount() - this.FFixedFooterRows)) {
        rr = this.DisplToRealRow(i);
        if (this.IsNode(rr)) this.OpenNode(rr);
        i += 1;
      };
      this.UpdateGridCells(false);
    };
    this.CloseAllNodes = function () {
      var i = 0;
      var rr = 0;
      i = this.FFixedRows;
      while (i < (this.GetRowCount() - this.FFixedFooterRows)) {
        rr = this.DisplToRealRow(i);
        if (this.IsNode(i)) this.CloseNode(rr);
        i += 1;
      };
      this.UpdateGridCells(false);
    };
    this.AddComboBox = function (Col, Row, Items) {
      var cp = null;
      cp = this.GetIntObjects(Col,Row);
      if (!(cp != null)) cp = $mod.TTMSFNCGridCellProperty.$create("Create$1",[this.GetDefaultFont(Col,Row)]);
      if (cp.FControl != null) cp.FreeControl();
      cp.FControl = $mod.TTMSFNCGridCellCombo.$create("Create$1");
      rtl.as(cp.FControl,$mod.TTMSFNCGridCellCombo).FItems.Assign(Items);
      this.SetIntObjects(Col,Row,cp);
      this.UpdateGridCells(false);
    };
    this.RemoveComboBox = function (Col, Row) {
      this.RemoveCellControl(Col,Row,$mod.TTMSFNCGridCellCombo);
    };
    this.IsComboBox = function (Col, Row) {
      var Result = false;
      Result = this.IsCellControl(Col,Row,$mod.TTMSFNCGridCellCombo);
      return Result;
    };
    this.GetComboIndex = function (Col, Row) {
      var Result = 0;
      var cp = null;
      Result = -1;
      if (this.IsCellControl(Col,Row,$mod.TTMSFNCGridCellCombo)) {
        cp = this.GetIntObjects(Col,Row);
        if ((cp != null) && (cp.FControl != null) && $mod.TTMSFNCGridCellCombo.isPrototypeOf(cp.FControl)) Result = rtl.as(cp.FControl,$mod.TTMSFNCGridCellCombo).FItems.IndexOf(this.GetCells(Col,Row));
      };
      return Result;
    };
    this.SetComboIndex = function (Col, Row, Value) {
      var cp = null;
      if (Value === -1) {
        this.SetCells(Col,Row,"")}
       else if (this.IsCellControl(Col,Row,$mod.TTMSFNCGridCellCombo)) {
        cp = this.GetIntObjects(Col,Row);
        if ((cp != null) && (cp.FControl != null) && $mod.TTMSFNCGridCellCombo.isPrototypeOf(cp.FControl)) {
          if (Value < rtl.as(cp.FControl,$mod.TTMSFNCGridCellCombo).FItems.GetCount()) this.SetCells(Col,Row,rtl.as(cp.FControl,$mod.TTMSFNCGridCellCombo).FItems.Get(Value));
        };
      };
    };
    this.MergeSelection = function (ASelection) {
      this.MergeCells(ASelection.StartCol,ASelection.StartRow,(ASelection.EndCol - ASelection.StartCol) + 1,(ASelection.EndRow - ASelection.StartRow) + 1);
    };
    this.MergeCells = function (Col, Row, ColCount, RowCount) {
      var cp = null;
      var oldcp = null;
      var i = 0;
      var j = 0;
      var cl = $mod.TTMSFNCGridCellRec.$new();
      var usecp = false;
      this.FBlockUpdate = true;
      usecp = false;
      cp = null;
      for (var $l = Col, $end = (Col + ColCount) - 1; $l <= $end; $l++) {
        i = $l;
        for (var $l1 = Row, $end1 = (Row + RowCount) - 1; $l1 <= $end1; $l1++) {
          j = $l1;
          if (!usecp) {
            cp = this.GetIntObjects(i,j);
            if (!(cp != null)) cp = $mod.TTMSFNCGridCellProperty.$create("Create$1",[this.GetDefaultFont(this.RealToDisplColumn(Col),this.RealToDisplRow(Row))]);
            cp.FBaseCol = Col;
            cp.FBaseRow = Row;
            cp.FColSpan = ColCount;
            cp.FRowSpan = RowCount;
            usecp = true;
          } else {
            oldcp = this.GetIntObjects(i,j);
            if (oldcp != null) {
              if (oldcp.FControl != null) oldcp.FreeControl();
              oldcp = rtl.freeLoc(oldcp);
            };
          };
          this.SetIntObjects(i,j,cp);
        };
      };
      cl.$assign(this.BaseCell(Col,Row));
      cl.Col = Col;
      cl.Row = Row;
      this.SetFocusedCell(cl);
      this.FBlockUpdate = false;
      this.UpdateGridCells(false);
    };
    this.IsMerged = function (Col, Row) {
      var Result = false;
      var cp = null;
      Result = false;
      cp = this.GetIntObjects(Col,this.DisplToRealRow(Row));
      if ((cp != null) && (cp.FBaseCol !== -1) && (cp.FBaseRow !== -1)) {
        Result = (cp.FColSpan > 1) || (cp.FRowSpan > 1);
      };
      return Result;
    };
    this.IsYMergedCell = function (Col, Row) {
      var Result = false;
      var cp = null;
      Result = false;
      cp = this.GetIntObjects(Col,this.DisplToRealRow(Row));
      if ((cp != null) && (cp.FBaseCol !== -1) && (cp.FBaseRow !== -1)) {
        Result = cp.FRowSpan > 1;
      };
      return Result;
    };
    this.IsXMergedCell = function (Col, Row) {
      var Result = false;
      var cp = null;
      Result = false;
      cp = this.GetIntObjects(Col,this.DisplToRealRow(Row));
      if ((cp != null) && (cp.FBaseCol !== -1) && (cp.FBaseRow !== -1)) {
        Result = cp.FColSpan > 1;
      };
      return Result;
    };
    this.IsBaseCell = function (Col, Row) {
      var Result = false;
      var c = $mod.TTMSFNCGridCellRec.$new();
      c.$assign(this.BaseCell(Col,Row));
      Result = (c.Col === Col) && (c.Row === Row);
      return Result;
    };
    this.ColSpan = function (Col, Row) {
      var Result = 0;
      var cp = null;
      Result = 0;
      cp = this.GetIntObjects(this.DisplToRealColumn(Col),this.DisplToRealRow(Row));
      if ((cp != null) && (cp.FBaseCol !== -1) && (cp.FBaseRow !== -1)) Result = cp.FColSpan;
      return Result;
    };
    this.RowSpan = function (Col, Row) {
      var Result = 0;
      var cp = null;
      Result = 0;
      cp = this.GetIntObjects(this.DisplToRealColumn(Col),this.DisplToRealRow(Row));
      if ((cp != null) && (cp.FBaseCol !== -1) && (cp.FBaseRow !== -1)) Result = cp.FRowSpan;
      return Result;
    };
    this.CellSpan = function (Col, Row) {
      var Result = pas.Types.TPoint.$new();
      var cp = null;
      Result.$assign(pas.Types.Point(0,0));
      cp = this.GetIntObjects(Col,Row);
      if ((cp != null) && (cp.FBaseCol !== -1) && (cp.FBaseRow !== -1)) {
        Result.$assign(pas.Types.Point(cp.FColSpan,cp.FRowSpan));
      };
      return Result;
    };
    this.GetCellSize = function (Col, Row) {
      var Result = pas["WEBLib.TMSFNCTypes"].TSizeF.$new();
      Result.cx = this.GetColWidths(Col);
      Result.cy = this.GetRowHeights(Row);
      return Result;
    };
    this.BaseCell = function (Col, Row) {
      var Result = $mod.TTMSFNCGridCellRec.$new();
      var cp = null;
      cp = this.GetIntObjects(this.DisplToRealColumn(Col),this.DisplToRealRow(Row));
      Result.Col = Col;
      Result.Row = Row;
      if ((cp != null) && (cp.FBaseCol !== -1) && (cp.FBaseRow !== -1)) {
        Result.Col = cp.FBaseCol;
        Result.Row = this.RealToDisplRow(cp.FBaseRow);
      };
      return Result;
    };
    this.IsBaseCellEx = function (Col, Row, BaseCol, BaseRow) {
      var Result = false;
      var c = $mod.TTMSFNCGridCellRec.$new();
      c.$assign(this.BaseCell(Col,Row));
      BaseCol.set(c.Col);
      BaseRow.set(c.Row);
      Result = (c.Col === Col) && (c.Row === Row);
      return Result;
    };
    this.SplitCell = function (Col, Row) {
      var cp = null;
      var i = 0;
      var j = 0;
      var fromc = 0;
      var toc = 0;
      var fromr = 0;
      var tor = 0;
      cp = this.GetIntObjects(Col,Row);
      if ((cp != null) && cp.IsBaseCell(Col,Row)) {
        fromc = cp.FBaseCol;
        fromr = cp.FBaseRow;
        toc = cp.FBaseCol + cp.FColSpan;
        tor = cp.FBaseRow + cp.FRowSpan;
        for (var $l = fromc, $end = toc - 1; $l <= $end; $l++) {
          i = $l;
          for (var $l1 = fromr, $end1 = tor - 1; $l1 <= $end1; $l1++) {
            j = $l1;
            cp = this.GetIntObjects(i,j);
            if (cp != null) {
              cp.FBaseCol = -1;
              cp.FBaseRow = -1;
              cp.FColSpan = 0;
              cp.FRowSpan = 0;
            };
            if (!((j === fromr) && (i === fromc))) this.SetIntObjects(i,j,null);
          };
        };
        this.UpdateGridCells(false);
      };
    };
    this.DeleteRow = function (Row) {
      this.DeleteRows(Row,1);
    };
    this.DeleteRows = function (Row, Count) {
      var i = 0;
      var j = 0;
      var ri = null;
      var cp = null;
      this.BeginUpdate();
      this.ClearCells($mod.TTMSFNCGridCellRecRange.$clone(this.CellRange(0,Row,(this.GetColumnCount() - 1) + this.GetHiddenColCount(),(Row + Count) - 1)));
      for (var $l = Row, $end = this.FRowDisplayList.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        for (var $l1 = 0, $end1 = this.GetColumnCount() - 1; $l1 <= $end1; $l1++) {
          j = $l1;
          if (this.IsBaseCell(j,i)) {
            cp = this.GetIntObjects(j,i);
            if (cp != null) if (cp.FBaseRow >= Row) {
              cp.FBaseRow = cp.FBaseRow - Count;
            };
          };
        };
      };
      while (this.FRowList.GetCount() < this.GetRowCount()) this.FRowList.Add(null);
      for (var $l2 = 1, $end2 = Count; $l2 <= $end2; $l2++) {
        i = $l2;
        if (this.FRowList.GetItem(Row) != null) {
          ri = this.FRowList.GetItem(Row);
          ri = rtl.freeLoc(ri);
        };
        if (Row < this.FRowList.GetCount()) this.FRowList.Delete(Row);
        if (Row < this.FRowDisplayList.GetCount()) this.FRowDisplayList.Delete(Row);
        this.FRowCount = this.FRowCount - 1;
      };
      for (var $l3 = Row, $end3 = this.FRowDisplayList.GetCount() - 1; $l3 <= $end3; $l3++) {
        i = $l3;
        this.FRowDisplayList.SetItem(i,this.FRowDisplayList.GetItem(i) - Count);
      };
      this.EndUpdate();
    };
    this.InsertRow = function (Row) {
      this.InsertRows(Row,1);
    };
    this.InsertRows = function (Row, Count) {
      var i = 0;
      var j = 0;
      var ridx = 0;
      var cp = null;
      if (Row > this.GetRowCount()) return;
      this.BeginUpdate();
      this.EnsureRow(Row);
      for (var $l = Row, $end = this.FRowDisplayList.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        for (var $l1 = 0, $end1 = this.GetColumnCount() - 1; $l1 <= $end1; $l1++) {
          j = $l1;
          if (this.IsBaseCell(j,i)) {
            cp = this.GetIntObjects(j,i);
            if (cp != null) if (cp.FBaseRow >= Row) {
              cp.FBaseRow = cp.FBaseRow + Count;
            };
          };
        };
      };
      for (var $l2 = 1, $end2 = Count; $l2 <= $end2; $l2++) {
        i = $l2;
        this.FRowList.Insert(Row,$mod.TTMSFNCGridRowInfo.$create("Create$1"));
      };
      for (var $l3 = 1, $end3 = Count; $l3 <= $end3; $l3++) {
        i = $l3;
        this.FRowDisplayList.Insert(Row,(Row + i) - 1);
      };
      for (var $l4 = 1, $end4 = Count; $l4 <= $end4; $l4++) {
        i = $l4;
        this.FRowDisplayList.SetItem((Row + i) - 1,(Row + i) - 1);
      };
      for (var $l5 = Row + Count, $end5 = this.FRowDisplayList.GetCount() - 1; $l5 <= $end5; $l5++) {
        i = $l5;
        this.FRowDisplayList.SetItem(i,this.FRowDisplayList.GetItem(i) + Count);
      };
      if (!this.FInternalRowUpdate) {
        if (Row <= (this.FRowH.GetCount() - 1)) {
          ridx = this.FRowH.Insert$1(Row).GetIndex()}
         else ridx = this.FRowH.Add$1().GetIndex();
        if ((ridx >= 0) && (ridx <= (this.FRowH.GetCount() - 1))) {
          this.FRowH.GetItem$1(ridx).SetValue(this.FDefaultRowHeight);
          this.FRowH.GetItem$1(ridx).FCellVal = Row;
          for (var $l6 = ridx + 1, $end6 = this.FRowH.GetCount() - 1; $l6 <= $end6; $l6++) {
            i = $l6;
            this.FRowH.GetItem$1(i).FCellVal = this.FRowH.GetItem$1(i).FCellVal + 1;
          };
        };
      };
      this.FRowCount = this.FRowCount + Count;
      this.EndUpdate();
    };
    this.SwapCells = function (Col, Row1, Row2) {
      var v = "";
      var o = null;
      v = this.GetCells(Col,Row1);
      o = this.GetIntObjects(Col,Row1);
      this.SetCells(Col,Row1,this.GetCells(Col,Row2));
      this.SetIntObjects(Col,Row1,this.GetIntObjects(Col,Row2));
      this.SetCells(Col,Row2,v);
      this.SetIntObjects(Col,Row2,o);
    };
    this.SwapNormalCells = function (Row1, Row2) {
      var i = 0;
      var v = "";
      var o = null;
      for (var $l = this.FFixedColumns, $end = this.GetColumnCount() - this.FFixedRightColumns - 1; $l <= $end; $l++) {
        i = $l;
        v = this.GetCells(i,Row1);
        o = this.GetIntObjects(i,Row1);
        this.SetCells(i,Row1,this.GetCells(i,Row2));
        this.SetIntObjects(i,Row1,this.GetIntObjects(i,Row2));
        this.SetCells(i,Row2,v);
        this.SetIntObjects(i,Row2,o);
      };
    };
    this.SwapRows = function (Row1, Row2) {
      var item = null;
      var val1 = 0.0;
      var val2 = 0.0;
      var rr1 = 0;
      var rr2 = 0;
      var sel1 = false;
      var sel2 = false;
      rr1 = this.DisplToRealRow(Row1);
      rr2 = this.DisplToRealRow(Row2);
      item = this.FRowList.GetItem(rr1);
      this.FRowList.SetItem(rr1,this.FRowList.GetItem(rr2));
      this.FRowList.SetItem(rr2,item);
      val1 = this.GetRowHeights(Row1);
      val2 = this.GetRowHeights(Row2);
      this.SetRowHeights(Row1,val2);
      this.SetRowHeights(Row2,val1);
      sel1 = this.GetRowSelect(Row1);
      sel2 = this.GetRowSelect(Row2);
      this.SetRowSelect(Row1,sel2);
      this.SetRowSelect(Row2,sel1);
      this.UpdateGridCells(false);
    };
    this.MoveRow = function (FromRow, ToRow) {
      var rh = null;
      var si = null;
      var ii = 0;
      this.FRowList.Move(FromRow,ToRow);
      rh = $mod.TTMSFNCGridSList.$create("Create$1");
      try {
        for (var $l = 0, $end = this.GetRowCount() - 1; $l <= $end; $l++) {
          ii = $l;
          rh.Add(this.GetRowHeights(ii));
        };
        rh.Move(FromRow,ToRow);
        this.FRowH.Clear();
        for (var $l1 = 0, $end1 = this.GetRowCount() - 1; $l1 <= $end1; $l1++) {
          ii = $l1;
          si = this.FRowH.Add$1();
          si.FCellVal = ii;
          si.SetValue(rh.GetItem(ii));
        };
      } finally {
        rh = rtl.freeLoc(rh);
      };
      this.UpdateControl(true,true);
    };
    this.HighlightInCell = function (DoCase, Col, Row, HiText) {
      var mi = null;
      mi = this.FMarkList.Add$1();
      mi.FCellRange.$assign(this.GetCellRecRange(Col,Row));
      mi.FValue = HiText;
      mi.FCaseSensitive = DoCase;
      mi.FMarkType = $mod.TTMSFNCGridMarkType.mtHighlight;
      this.UpdateGridCells(false);
    };
    this.HighlightInCol = function (DoFixed, DoCase, Col, HiText) {
      var mi = null;
      mi = this.FMarkList.Add$1();
      mi.FCellRange.$assign(this.GetColumnRange(Col,DoFixed));
      mi.FValue = HiText;
      mi.FCaseSensitive = DoCase;
      mi.FMarkType = $mod.TTMSFNCGridMarkType.mtHighlight;
      this.UpdateGridCells(false);
    };
    this.HighlightInRow = function (DoFixed, DoCase, Row, HiText) {
      var mi = null;
      mi = this.FMarkList.Add$1();
      mi.FCellRange.$assign(this.GetRowRange(Row,DoFixed));
      mi.FValue = HiText;
      mi.FCaseSensitive = DoCase;
      mi.FMarkType = $mod.TTMSFNCGridMarkType.mtHighlight;
      this.UpdateGridCells(false);
    };
    this.HighlightInGrid = function (DoFixed, DoCase, HiText) {
      var mi = null;
      mi = this.FMarkList.Add$1();
      mi.FCellRange.$assign(this.GetGridRange(DoFixed));
      mi.FValue = HiText;
      mi.FCaseSensitive = DoCase;
      mi.FMarkType = $mod.TTMSFNCGridMarkType.mtHighlight;
      this.UpdateGridCells(false);
    };
    this.UnHighlightInCell = function (Col, Row) {
      this.FMarkList.RemoveMarker($mod.TTMSFNCGridCellRecRange.$clone(this.GetCellRecRange(Col,Row)),$mod.TTMSFNCGridMarkType.mtHighlight);
      this.UpdateGridCells(false);
    };
    this.UnHighlightInCol = function (DoFixed, Col) {
      this.FMarkList.RemoveMarker($mod.TTMSFNCGridCellRecRange.$clone(this.GetColumnRange(Col,DoFixed)),$mod.TTMSFNCGridMarkType.mtHighlight);
      this.UpdateGridCells(false);
    };
    this.UnHighlightInRow = function (DoFixed, Row) {
      this.FMarkList.RemoveMarker($mod.TTMSFNCGridCellRecRange.$clone(this.GetRowRange(Row,DoFixed)),$mod.TTMSFNCGridMarkType.mtHighlight);
      this.UpdateGridCells(false);
    };
    this.UnHighlightInGrid = function (DoFixed) {
      this.FMarkList.RemoveMarker($mod.TTMSFNCGridCellRecRange.$clone(this.GetGridRange(DoFixed)),$mod.TTMSFNCGridMarkType.mtHighlight);
      this.UpdateGridCells(false);
    };
    this.UnHighlightAll = function () {
      var i = 0;
      for (var $l = this.FMarkList.GetCount() - 1; $l >= 0; $l--) {
        i = $l;
        if (this.FMarkList.GetItem$1(i).FMarkType === $mod.TTMSFNCGridMarkType.mtHighlight) this.FMarkList.Delete(i);
      };
      this.UpdateGridCells(false);
    };
    this.MarkInCell = function (DoCase, Col, Row, HiText) {
      var mi = null;
      mi = this.FMarkList.Add$1();
      mi.FCellRange.$assign(this.GetCellRecRange(Col,Row));
      mi.FValue = HiText;
      mi.FCaseSensitive = DoCase;
      mi.FMarkType = $mod.TTMSFNCGridMarkType.mtError;
      this.UpdateGridCells(false);
    };
    this.MarkInCol = function (DoFixed, DoCase, Col, HiText) {
      var mi = null;
      mi = this.FMarkList.Add$1();
      mi.FCellRange.$assign(this.GetColumnRange(Col,DoFixed));
      mi.FValue = HiText;
      mi.FCaseSensitive = DoCase;
      mi.FMarkType = $mod.TTMSFNCGridMarkType.mtError;
      this.UpdateGridCells(false);
    };
    this.MarkInRow = function (DoFixed, DoCase, Row, HiText) {
      var mi = null;
      mi = this.FMarkList.Add$1();
      mi.FCellRange.$assign(this.GetRowRange(Row,DoFixed));
      mi.FValue = HiText;
      mi.FCaseSensitive = DoCase;
      mi.FMarkType = $mod.TTMSFNCGridMarkType.mtError;
      this.UpdateGridCells(false);
    };
    this.MarkInGrid = function (DoFixed, DoCase, HiText) {
      var mi = null;
      mi = this.FMarkList.Add$1();
      mi.FCellRange.$assign(this.GetGridRange(DoFixed));
      mi.FValue = HiText;
      mi.FCaseSensitive = DoCase;
      mi.FMarkType = $mod.TTMSFNCGridMarkType.mtError;
      this.UpdateGridCells(false);
    };
    this.UnMarkInCell = function (Col, Row) {
      this.FMarkList.RemoveMarker($mod.TTMSFNCGridCellRecRange.$clone(this.GetCellRecRange(Col,Row)),$mod.TTMSFNCGridMarkType.mtError);
      this.UpdateGridCells(false);
    };
    this.UnMarkInCol = function (DoFixed, Col) {
      this.FMarkList.RemoveMarker($mod.TTMSFNCGridCellRecRange.$clone(this.GetColumnRange(Col,DoFixed)),$mod.TTMSFNCGridMarkType.mtError);
      this.UpdateGridCells(false);
    };
    this.UnMarkInRow = function (DoFixed, Row) {
      this.FMarkList.RemoveMarker($mod.TTMSFNCGridCellRecRange.$clone(this.GetRowRange(Row,DoFixed)),$mod.TTMSFNCGridMarkType.mtError);
      this.UpdateGridCells(false);
    };
    this.UnMarkInGrid = function (DoFixed) {
      this.FMarkList.RemoveMarker($mod.TTMSFNCGridCellRecRange.$clone(this.GetGridRange(DoFixed)),$mod.TTMSFNCGridMarkType.mtError);
      this.UpdateGridCells(false);
    };
    this.UnMarkAll = function () {
      var i = 0;
      for (var $l = this.FMarkList.GetCount() - 1; $l >= 0; $l--) {
        i = $l;
        if (this.FMarkList.GetItem$1(i).FMarkType === $mod.TTMSFNCGridMarkType.mtError) this.FMarkList.Delete(i);
      };
      this.UpdateGridCells(false);
    };
    this.UnGroup = function () {
      var i = 0;
      var j = 0;
      var nc = "";
      var grpc = 0;
      if (this.FGroupColumn <= 0) return;
      this.BeginUpdate();
      this.OpenAllNodes();
      if (this.FGroupColumn === 1) {
        grpc = 2}
       else grpc = 1;
      i = this.FFixedRows;
      this.FIsGrouping = true;
      while (i <= (this.GetRowCount() - 1 - this.FFixedFooterRows)) {
        if (this.IsNode(i)) {
          if (this.FOptions.FGrouping.FMergeHeader) this.SplitCell(this.FFixedColumns,i);
          if (this.FOptions.FGrouping.FMergeSummary) {
            j = this.GetNodeSpan(i);
            this.SplitCell(this.FFixedColumns,i + j + 1);
          };
        };
        if (this.IsSummary(i)) this.RemoveSummary(i);
        i += 1;
      };
      this.FInternalColumnUpdate = true;
      this.InsertColumn(this.FGroupColumn);
      this.FInternalColumnUpdate = false;
      this.SetColWidths(this.FGroupColumn,this.FGroupWidth);
      if (this.FFixedRows > 0) this.SetCells(this.FGroupColumn,0,this.FGroupCaption);
      if (this.FFixedFooterRows > 0) this.SetCells(this.FGroupColumn,this.GetRowCount() - 1,this.FGroupFooter);
      i = this.FFixedRows;
      this.FIsGrouping = true;
      while (i <= (this.GetRowCount() - 1 - this.FFixedFooterRows)) {
        if (this.IsNode(i)) {
          if (this.FOptions.FGrouping.FSummary) {
            j = this.GetNodeSpan(i);
            this.ClearCells($mod.TTMSFNCGridCellRecRange.$clone(this.CellRange(0,i + j + 1,this.GetColumnCount() - 1,i + j + 1)));
            this.DeleteRows(i + j + 1,1);
          };
          nc = this.GetCells(grpc,i);
          this.RemoveNode(i);
          this.ClearCells($mod.TTMSFNCGridCellRecRange.$clone(this.CellRange(0,i,this.GetColumnCount() - 1,i)));
          this.DeleteRows(i,1);
        } else {
          this.SetCells(this.FGroupColumn,i,nc);
          i += 1;
        };
      };
      this.FIsGrouping = false;
      this.FGroupColumn = -1;
      this.EndUpdate();
    };
    this.Group = function (Column) {
      var i = 0;
      var np = 0;
      var lc = "";
      var nc = "";
      var grp = 0;
      var grpc = 0;
      if (Column < this.FFixedColumns) return;
      if (this.FGroupColumn !== -1) this.UnGroup();
      if ((this.GetRowCount() - this.FFixedRows) < 1) return;
      this.BeginUpdate();
      this.FIsGrouping = true;
      try {
        this.FGroupColumn = Column;
        this.FGroupWidth = this.GetColWidths(Column);
        if (this.FFixedRows > 0) this.FGroupCaption = this.GetCells(Column,0);
        if (this.FFixedFooterRows > 0) this.FGroupFooter = this.GetCells(Column,this.GetRowCount() - 1);
        grp = Column;
        grpc = 1;
        if (grpc === Column) grpc += 1;
        np = -1;
        lc = String.fromCharCode(255) + String.fromCharCode(254);
        i = this.FFixedRows;
        while (i <= (this.GetRowCount() - 1 - this.FFixedFooterRows)) {
          nc = this.GetCells(Column,i);
          if (lc !== nc) {
            if (np !== -1) {
              if ((np > this.FFixedRows) && this.FOptions.FGrouping.FSummary) {
                this.FInternalRowUpdate = true;
                this.InsertRows(np,1);
                this.FInternalRowUpdate = false;
                this.AddSummary(np);
                np += 1;
                this.AddNode(np,i - np);
                i += 1;
              } else {
                this.AddNode(np,i - np - 1);
              };
            };
            this.FInternalRowUpdate = true;
            this.InsertRows(i,1);
            this.FInternalRowUpdate = false;
            this.SetCells(grpc,i,nc);
            np = i;
            i += 1;
          };
          if (i < (this.GetRowCount() - 1)) lc = this.GetCells(grp,i);
          i += 1;
        };
        if (np !== -1) {
          if ((np > this.FFixedRows) && this.FOptions.FGrouping.FSummary) {
            this.FInternalRowUpdate = true;
            this.InsertRows(np,1);
            this.FInternalRowUpdate = false;
            this.AddSummary(np);
            np += 1;
            i += 1;
          };
          this.AddNode(np,i - np - 1);
        } else this.AddNode(this.FFixedRows,i - 1 - 1);
        if (this.FOptions.FGrouping.FSummary) {
          this.FInternalRowUpdate = true;
          this.InsertRows(i,1);
          this.FInternalRowUpdate = false;
          this.AddSummary(i);
        };
        this.DeleteColumn(grp);
        if (this.FOptions.FGrouping.FMergeHeader || (this.FOptions.FGrouping.FMergeSummary && this.FOptions.FGrouping.FSummary)) {
          for (var $l = this.FFixedRows, $end = this.GetRowCount() - 1; $l <= $end; $l++) {
            i = $l;
            grpc = 1;
            if (this.IsNode(i) && this.FOptions.FGrouping.FMergeHeader) {
              this.MergeCells(grpc,i,this.GetColumnCount() - grpc - this.FFixedRightColumns,1);
            };
            if ((this.IsNode(i + 1) || (i === (this.GetRowCount() - 1))) && this.FOptions.FGrouping.FMergeSummary && this.FOptions.FGrouping.FSummary) {
              this.MergeCells(grpc,i,this.GetColumnCount() - grpc - this.FFixedRightColumns,1);
            };
          };
        };
      } finally {
        this.FIsGrouping = false;
        this.EndUpdate();
      };
    };
    this.GroupCalc = function (Col, method) {
      var i = 0;
      var j = 0;
      var k = 0;
      var r = 0.0;
      i = this.FFixedRows;
      while (i < this.GetRowCount()) {
        if (this.IsNode(i)) {
          j = i + this.GetNodeSpan(i);
          if (this.FOptions.FGrouping.FSummary) {
            k = i + this.GetNodeSpan(i) + 1}
           else k = i + 1;
          r = 0;
          var $tmp = method;
          if ($tmp === 1) {
            r = this.ColumnSum(Col,i + 1,j)}
           else if ($tmp === 2) {
            r = this.ColumnAvg(Col,i + 1,j)}
           else if ($tmp === 3) {
            r = this.ColumnMin(Col,i + 1,j)}
           else if ($tmp === 4) {
            r = this.ColumnMax(Col,i + 1,j)}
           else if ($tmp === 5) {
            r = j - i}
           else if ($tmp === 6) {
            r = this.ColumnCustomCalcGroup(Col,i + 1,j)}
           else if ($tmp === 7) {
            r = this.ColumnDistinct(Col,i + 1,j)}
           else if ($tmp === 8) r = this.ColumnStdDev(Col,i + 1,j);
          this.SetCells(Col,k,pas.SysUtils.Format(this.FOptions.FGrouping.FCalcFormat,pas.System.VarRecs(3,r)));
          i = j;
        } else i += 1;
      };
      this.UpdateGridCells(false);
    };
    this.GroupSum = function (Col) {
      this.GroupCalc(Col,1);
    };
    this.GroupAvg = function (Col) {
      this.GroupCalc(Col,2);
    };
    this.GroupMin = function (Col) {
      this.GroupCalc(Col,3);
    };
    this.GroupMax = function (Col) {
      this.GroupCalc(Col,4);
    };
    this.ColumnSum = function (ACol, FromRow, ToRow) {
      var Result = 0.0;
      var i = 0;
      var sum = 0.0;
      if ((FromRow === -1) || (ToRow === -1)) {
        FromRow = this.FFixedRows;
        ToRow = this.GetRowCount() - 1 - this.FFixedFooterRows;
      };
      sum = 0;
      this.ExportNotification($mod.TTMSFNCGridExportState.esExportStart,FromRow);
      for (var $l = FromRow, $end = ToRow; $l <= $end; $l++) {
        i = $l;
        if (this.IsBaseCell(ACol,i)) {
          this.ExportNotification($mod.TTMSFNCGridExportState.esExportNextRow,i);
          try {
            sum = sum + this.GetFloats(ACol,i);
          } catch ($e) {
          };
        };
      };
      this.ExportNotification($mod.TTMSFNCGridExportState.esExportDone,-1);
      Result = sum;
      return Result;
    };
    this.ColumnAvg = function (ACol, FromRow, ToRow) {
      var Result = 0.0;
      if ((FromRow === -1) || (ToRow === -1)) {
        FromRow = this.FFixedRows;
        ToRow = this.GetRowCount() - 1 - this.FFixedFooterRows;
      };
      if (((ToRow - FromRow) + 1) > 0) {
        Result = this.ColumnSum(ACol,FromRow,ToRow) / ((ToRow - FromRow) + 1)}
       else Result = 0;
      return Result;
    };
    this.ColumnMin = function (ACol, FromRow, ToRow) {
      var Result = 0.0;
      var m = 0.0;
      var i = 0;
      if ((FromRow === -1) || (ToRow === -1)) {
        FromRow = this.FFixedRows;
        ToRow = this.GetRowCount() - 1 - this.FFixedFooterRows;
      };
      m = this.GetFloats(ACol,FromRow);
      this.ExportNotification($mod.TTMSFNCGridExportState.esExportStart,FromRow);
      for (var $l = FromRow, $end = ToRow; $l <= $end; $l++) {
        i = $l;
        if (this.IsBaseCell(ACol,i)) {
          this.ExportNotification($mod.TTMSFNCGridExportState.esExportNextRow,i);
          try {
            if (m > this.GetFloats(ACol,i)) m = this.GetFloats(ACol,i);
          } catch ($e) {
          };
        };
      };
      this.ExportNotification($mod.TTMSFNCGridExportState.esExportDone,-1);
      Result = m;
      return Result;
    };
    this.ColumnMax = function (ACol, FromRow, ToRow) {
      var Result = 0.0;
      var m = 0.0;
      var i = 0;
      if ((FromRow === -1) || (ToRow === -1)) {
        FromRow = this.FFixedRows;
        ToRow = this.GetRowCount() - 1 - this.FFixedFooterRows;
      };
      m = this.GetFloats(ACol,FromRow);
      this.ExportNotification($mod.TTMSFNCGridExportState.esExportStart,FromRow);
      for (var $l = FromRow, $end = ToRow; $l <= $end; $l++) {
        i = $l;
        if (this.IsBaseCell(ACol,i)) {
          this.ExportNotification($mod.TTMSFNCGridExportState.esExportNextRow,i);
          try {
            if (m < this.GetFloats(ACol,i)) m = this.GetFloats(ACol,i);
          } catch ($e) {
          };
        };
      };
      this.ExportNotification($mod.TTMSFNCGridExportState.esExportDone,-1);
      Result = m;
      return Result;
    };
    this.ColumnDistinct = function (ACol, FromRow, ToRow) {
      var Result = 0.0;
      var sl = null;
      var i = 0;
      if ((FromRow === -1) || (ToRow === -1)) {
        FromRow = this.FFixedRows;
        ToRow = this.GetRowCount() - 1 - this.FFixedFooterRows;
      };
      this.ExportNotification($mod.TTMSFNCGridExportState.esExportStart,FromRow);
      sl = pas.Classes.TStringList.$create("Create$1");
      try {
        sl.FDuplicates = pas.Types.TDuplicates.dupIgnore;
        sl.SetSorted(true);
        sl.SetCaseSensitive(false);
        for (var $l = FromRow, $end = ToRow; $l <= $end; $l++) {
          i = $l;
          this.ExportNotification($mod.TTMSFNCGridExportState.esExportNextRow,i);
          sl.Add(this.GetCells(ACol,i));
        };
        Result = sl.GetCount();
      } finally {
        this.ExportNotification($mod.TTMSFNCGridExportState.esExportDone,-1);
        sl = rtl.freeLoc(sl);
      };
      return Result;
    };
    this.ColumnStdDev = function (ACol, FromRow, ToRow) {
      var Result = 0.0;
      var m = 0.0;
      var d = 0.0;
      var i = 0;
      if ((FromRow === -1) || (ToRow === -1)) {
        FromRow = this.FFixedRows;
        ToRow = this.GetRowCount() - 1 - this.FFixedFooterRows;
      };
      m = this.ColumnAvg(ACol,FromRow,ToRow);
      this.ExportNotification($mod.TTMSFNCGridExportState.esExportStart,FromRow);
      d = 0;
      for (var $l = FromRow, $end = ToRow; $l <= $end; $l++) {
        i = $l;
        d = d + pas.System.Sqr$1(this.GetFloats(ACol,i) - m);
      };
      Result = Math.sqrt(d / ((ToRow - FromRow) + 1));
      this.ExportNotification($mod.TTMSFNCGridExportState.esExportDone,-1);
      return Result;
    };
    this.ColumnCustomCalc = function (ACol, FromRow, ToRow) {
      var Result = 0.0;
      Result = this.DoColumnCalc(ACol,FromRow,ToRow);
      return Result;
    };
    this.ColumnCustomCalcGroup = function (ACol, FromRow, ToRow) {
      var Result = 0.0;
      Result = this.DoColumnCalcGroup(ACol,FromRow,ToRow);
      return Result;
    };
    this.UpdateCalculations = function () {
      var i = 0;
      var cc = 0;
      for (var $l = 0, $end = this.GetColumnCount() - 1; $l <= $end; $l++) {
        i = $l;
        cc = this.GetColumnCalculation(i);
        if (cc !== $mod.TTMSFNCGridColumnCalculation.ccNone) this.UpdateColumnCalc(i,cc);
      };
    };
    this.UpdateCalculation = function (ACol) {
      var cc = 0;
      cc = this.GetColumnCalculation(ACol);
      if (cc !== $mod.TTMSFNCGridColumnCalculation.ccNone) this.UpdateColumnCalc(ACol,cc);
    };
    this.GroupCustomCalc = function (Col) {
      this.GroupCalc(Col,6);
    };
    this.GroupCount = function (Col) {
      this.GroupCalc(Col,5);
    };
    this.GroupDistinct = function (Col) {
      this.GroupCalc(Col,7);
    };
    this.GroupStdDev = function (Col) {
      this.GroupCalc(Col,8);
    };
    this.HideRow = function (Row) {
      var i = 0;
      this.BeginUpdate();
      for (var $l = 0, $end = this.FRowDisplayList.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.FRowDisplayList.GetItem(i) === Row) {
          this.FHiddenRowList.Add(Row);
          this.FRowDisplayList.Delete(i);
          this.FRowCount = this.FRowCount - 1;
          break;
        };
      };
      this.EndUpdate();
    };
    this.HideRows = function (Row, Count) {
      var i = 0;
      var c = 0;
      var flg = false;
      c = 0;
      i = 0;
      flg = false;
      while (i < this.FRowDisplayList.GetCount()) {
        if (this.FRowDisplayList.GetItem(i) === (Row + c)) {
          this.FHiddenRowList.Add(Row + c);
          this.FRowDisplayList.Delete(i);
          this.FRowCount = this.FRowCount - 1;
          flg = true;
          if (c < (Count - 1)) {
            c += 1}
           else break;
        } else i += 1;
      };
      if (flg) this.UpdateControl(true,true);
    };
    this.UnHideRow = function (Row) {
      var i = 0;
      var fnd = false;
      if (!this.IsHiddenRow(Row)) return;
      i = 0;
      fnd = this.FHiddenRowList.GetCount() > 0;
      while (i < this.FRowDisplayList.GetCount()) {
        if (this.FRowDisplayList.GetItem(i) >= Row) {
          fnd = true;
          break;
        } else i += 1;
      };
      if (fnd) {
        this.FRowDisplayList.Insert(i,Row);
        this.FHiddenRowList.Delete(this.FHiddenRowList.IndexOf(Row));
        this.FRowCount = this.FRowCount + 1;
        this.UpdateGridCells(false);
      };
    };
    this.UnHideRows = function (Row, Count) {
      var i = 0;
      var j = 0;
      var nr = 0;
      var ri = 0;
      var fnd = false;
      if (this.FHiddenRowList.GetCount() === 0) return;
      i = 0;
      nr = 0;
      if ((this.FRowDisplayList.GetCount() === 0) || (Row > this.FRowDisplayList.GetItem(this.FRowDisplayList.GetCount() - 1))) {
        for (var $l = 0, $end = Math.max(0,Count - 1); $l <= $end; $l++) {
          i = $l;
          if (this.FHiddenRowList.IndexOf(i + Row) !== -1) {
            nr += 1;
            this.FRowDisplayList.Add(i + Row);
            this.FHiddenRowList.Delete(this.FHiddenRowList.IndexOf(i + Row));
          };
        };
        this.FRowCount = this.FRowCount + nr;
        this.UpdateControl(true,true);
        return;
      };
      fnd = false;
      while (i < this.FRowDisplayList.GetCount()) {
        if (this.FRowDisplayList.GetItem(i) >= Row) {
          fnd = true;
          break;
        } else i += 1;
      };
      if (fnd) {
        ri = this.FHiddenRowList.IndexOf(Row);
        if (ri >= 0) {
          this.FRowDisplayList.Insert(i,Row);
          this.FHiddenRowList.Delete(ri);
          this.FRowCount = this.FRowCount + 1;
          j = 1;
          i += 1;
          while (j <= Count) {
            if (this.FRowDisplayList.GetItem(i) !== (Row + j)) {
              ri = this.FHiddenRowList.IndexOf(Row + j);
              if (ri >= 0) {
                this.FRowDisplayList.Insert(i,Row + j);
                this.FHiddenRowList.Delete(ri);
                this.FRowCount = this.FRowCount + 1;
              };
            };
            i += 1;
            j += 1;
          };
        };
      };
      if (fnd) this.UpdateControl(true,true);
    };
    this.UnHideRowsAll = function () {
      var i = 0;
      while (this.FRowDisplayList.GetCount() < this.FRowList.GetCount()) {
        this.FRowDisplayList.Add(0);
      };
      for (var $l = 0, $end = this.FRowList.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        this.FRowDisplayList.SetItem(i,i);
      };
      this.FRowCount = this.FRowList.GetCount();
      this.UpdateControl(true,true);
    };
    this.IsHiddenRow = function (Row) {
      var Result = false;
      var i = 0;
      Result = false;
      for (var $l = 0, $end = this.FHiddenRowList.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.FHiddenRowList.GetItem(i) === Row) {
          Result = true;
          break;
        };
      };
      return Result;
    };
    this.UpdateColumnWidth = function (ACol, AWidth) {
      this.BeginUpdate();
      this.SetColWidths(ACol,AWidth);
      this.EndUpdate();
    };
    this.UpdateRowHeight = function (ARow, AHeight) {
      this.BeginUpdate();
      this.SetRowHeights(ARow,AHeight);
      this.EndUpdate();
    };
    this.HideColumn = function (Col) {
      var i = 0;
      var fnd = false;
      if (this.IsHiddenColumn(Col)) return;
      fnd = false;
      this.BeginUpdate();
      for (var $l = 0, $end = this.FColumnDisplayList.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.FColumnDisplayList.GetItem(i) === Col) {
          this.FHiddenColumnList.Add(Col);
          this.FColumnDisplayList.Delete(i);
          fnd = true;
          break;
        };
      };
      if (fnd) this.FColumnCount = this.FColumnCount - 1;
      this.EndUpdate();
    };
    this.HideColumns = function (Col, Count) {
      var i = 0;
      var c = 0;
      this.BeginUpdate();
      c = 0;
      i = 0;
      while (i < this.FColumnDisplayList.GetCount()) {
        if ((this.FColumnDisplayList.GetItem(i) === (Col + c)) && (c < Count)) {
          this.FHiddenColumnList.Add(Col + c);
          this.FColumnDisplayList.Delete(i);
          c += 1;
        } else i += 1;
      };
      this.FColumnCount = this.FColumnCount - c;
      this.EndUpdate();
    };
    this.UnHideColumn = function (Col) {
      var i = 0;
      var fnd = false;
      if (!this.IsHiddenColumn(Col) || (this.FHiddenColumnList.GetCount() === 0)) return;
      i = 0;
      fnd = this.FHiddenColumnList.IndexOf(Col) !== -1;
      while (i < this.FColumnDisplayList.GetCount()) {
        if (this.FColumnDisplayList.GetItem(i) >= Col) {
          fnd = true;
          break;
        } else i += 1;
      };
      if (fnd) {
        this.FColumnDisplayList.Insert(i,Col);
        this.FHiddenColumnList.Delete(this.FHiddenColumnList.IndexOf(Col));
        this.SetColumnCount(this.GetColumnCount() + 1);
        this.UpdateGridCells(false);
      };
    };
    this.UnHideColumns = function (Col, Count) {
      var i = 0;
      for (var $l = Col, $end = (Col + Count) - 1; $l <= $end; $l++) {
        i = $l;
        this.UnHideColumn(i);
      };
    };
    this.UnHideColumnsAll = function () {
      var i = 0;
      this.BeginUpdate();
      while (this.FColumnDisplayList.GetCount() < this.GetTotalColCount()) {
        this.FColumnDisplayList.Add(0);
      };
      for (var $l = 0, $end = this.GetTotalColCount() - 1; $l <= $end; $l++) {
        i = $l;
        this.FColumnDisplayList.SetItem(i,i);
      };
      this.FColumnCount = this.GetTotalColCount();
      this.FHiddenColumnList.Clear();
      this.EndUpdate();
    };
    this.IsHiddenColumn = function (Col) {
      var Result = false;
      var i = 0;
      Result = true;
      for (var $l = 0, $end = this.FColumnDisplayList.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.FColumnDisplayList.GetItem(i) === Col) {
          Result = false;
          break;
        };
      };
      return Result;
    };
    this.SuppressColumn = function (Col) {
      var i = 0;
      if (this.IsSuppressedColumn(Col)) return;
      this.BeginUpdate();
      for (var $l = 0, $end = this.FColumnDisplayList.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.FColumnDisplayList.GetItem(i) === Col) {
          this.FSuppressedColumnList.Add(Col);
          break;
        };
      };
      this.EndUpdate();
    };
    this.SuppressColumns = function (Col, Count) {
      var i = 0;
      var c = 0;
      this.BeginUpdate();
      c = 0;
      i = 0;
      while (i < this.FColumnDisplayList.GetCount()) {
        if ((this.FColumnDisplayList.GetItem(i) === (Col + c)) && (c < Count)) {
          this.FSuppressedColumnList.Add(Col + c);
          c += 1;
        } else i += 1;
      };
      this.EndUpdate();
    };
    this.UnSuppressColumn = function (Col) {
      var i = 0;
      var fnd = false;
      if (!this.IsSuppressedColumn(Col) || (this.FSuppressedColumnList.GetCount() === 0)) return;
      i = 0;
      fnd = this.FSuppressedColumnList.IndexOf(Col) !== -1;
      while (i < this.FColumnDisplayList.GetCount()) {
        if (this.FColumnDisplayList.GetItem(i) >= Col) {
          fnd = true;
          break;
        } else i += 1;
      };
      if (fnd) {
        this.FSuppressedColumnList.Delete(this.FSuppressedColumnList.IndexOf(Col));
        this.UpdateGridCells(false);
      };
    };
    this.UnSuppressColumns = function (Col, Count) {
      var i = 0;
      for (var $l = Col, $end = (Col + Count) - 1; $l <= $end; $l++) {
        i = $l;
        this.UnSuppressColumn(i);
      };
    };
    this.UnSuppressColumnsAll = function () {
      this.BeginUpdate();
      this.FSuppressedColumnList.Clear();
      this.EndUpdate();
    };
    this.IsSuppressedColumn = function (Col) {
      var Result = false;
      var i = 0;
      Result = false;
      for (var $l = 0, $end = this.FSuppressedColumnList.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.FSuppressedColumnList.GetItem(i) === Col) {
          Result = true;
          break;
        };
      };
      return Result;
    };
    this.DeleteColumn = function (Col) {
      var i = 0;
      var rc = 0;
      this.BeginUpdate();
      rc = this.DisplToRealColumn(Col);
      for (var $l = Col, $end = this.FColumnDisplayList.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.FColumnDisplayList.GetItem(i) > Col) this.FColumnDisplayList.SetItem(i,this.FColumnDisplayList.GetItem(i) - 1);
      };
      this.FColumnDisplayList.Delete(Col);
      this.ClearCells($mod.TTMSFNCGridCellRecRange.$clone(this.CellRange(rc,0,rc,this.GetRowCount() - 1)));
      for (var $l1 = 0, $end1 = this.FRowList.GetCount() - 1; $l1 <= $end1; $l1++) {
        i = $l1;
        if ((this.FRowList.GetItem(i) != null) && (this.FRowList.GetItem(i).FData.GetCount() > rc)) this.FRowList.GetItem(i).FData.Delete(rc);
      };
      this.SetColumnCount(this.GetColumnCount() - 1);
      this.EndUpdate();
    };
    this.InsertColumn = function (Col) {
      var i = 0;
      var sl = null;
      var cidx = 0;
      this.BeginUpdate();
      for (var $l = 0, $end = this.FRowList.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        sl = this.FRowList.GetItem(i);
        if (sl != null) {
          if (Col < sl.FData.GetCount()) sl.FData.InsertObject(Col,"",null);
        };
      };
      if (!this.FInternalColumnUpdate) {
        if (Col <= (this.FColumnW.GetCount() - 1)) {
          cidx = this.FColumnW.Insert$1(Col).GetIndex()}
         else cidx = this.FColumnW.Add$1().GetIndex();
        if ((cidx >= 0) && (cidx <= (this.FColumnW.GetCount() - 1))) {
          this.FColumnW.GetItem$1(cidx).SetValue(this.FDefaultColumnWidth);
          this.FColumnW.GetItem$1(cidx).FCellVal = Col;
          for (var $l1 = cidx + 1, $end1 = this.FColumnW.GetCount() - 1; $l1 <= $end1; $l1++) {
            i = $l1;
            this.FColumnW.GetItem$1(i).FCellVal = this.FColumnW.GetItem$1(i).FCellVal + 1;
          };
        };
      };
      this.EndUpdate();
      this.FColumnDisplayList.Insert(Col,Col);
      for (var $l2 = Col + 1, $end2 = this.FColumnDisplayList.GetCount() - 1; $l2 <= $end2; $l2++) {
        i = $l2;
        this.FColumnDisplayList.SetItem(i,this.FColumnDisplayList.GetItem(i) + 1);
      };
      this.SetColumnCount(this.GetColumnCount() + 1);
    };
    this.MoveColumn = function (FromCol, ToCol) {
      var rfi = 0;
      var rti = 0;
      var ii = 0;
      var si = null;
      var cw = null;
      if (this.FColumnOrder.GetCount() === 0) this.SetColumnOrder();
      this.FColumnDisplayList.Move(FromCol,ToCol);
      cw = $mod.TTMSFNCGridSList.$create("Create$1");
      try {
        for (var $l = 0, $end = this.GetColumnCount() - 1; $l <= $end; $l++) {
          ii = $l;
          cw.Add(this.GetColWidths(ii));
        };
        cw.Move(FromCol,ToCol);
        this.FColumnW.Clear();
        for (var $l1 = 0, $end1 = this.GetColumnCount() - 1; $l1 <= $end1; $l1++) {
          ii = $l1;
          si = this.FColumnW.Add$1();
          si.FCellVal = ii;
          si.SetValue(cw.GetItem(ii));
        };
      } finally {
        cw = rtl.freeLoc(cw);
      };
      rfi = FromCol;
      rti = ToCol;
      if ((this.FColumnOrder.GetCount() > rfi) && (this.FColumnOrder.GetCount() > rti)) {
        ii = this.FColumnOrder.GetInteger(rfi);
        this.FColumnOrder.Delete$1(rfi);
        this.FColumnOrder.Insert$1(rti,ii);
      };
      this.UpdateControl(true,true);
    };
    this.SwapColumns = function (Col1, Col2) {
      var i = 0;
      var k = 0;
      var v = "";
      var o = null;
      var val1 = 0.0;
      var val2 = 0.0;
      var cc = 0;
      for (var $l = 0, $end = this.FRowList.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.FRowList.GetItem(i) != null) {
          for (var $l1 = this.FRowList.GetItem(i).FData.GetCount(), $end1 = Col1; $l1 <= $end1; $l1++) {
            k = $l1;
            this.FRowList.GetItem(i).FData.Add("");
          };
          for (var $l2 = this.FRowList.GetItem(i).FData.GetCount(), $end2 = Col2; $l2 <= $end2; $l2++) {
            k = $l2;
            this.FRowList.GetItem(i).FData.Add("");
          };
          v = this.FRowList.GetItem(i).FData.Get(Col1);
          o = this.FRowList.GetItem(i).FData.GetObject(Col1);
          this.FRowList.GetItem(i).FData.Put(Col1,this.FRowList.GetItem(i).FData.Get(Col2));
          this.FRowList.GetItem(i).FData.PutObject(Col1,this.FRowList.GetItem(i).FData.GetObject(Col2));
          this.FRowList.GetItem(i).FData.Put(Col2,v);
          this.FRowList.GetItem(i).FData.PutObject(Col2,o);
        };
      };
      val1 = this.GetColWidths(Col1);
      val2 = this.GetColWidths(Col2);
      this.SetColWidths(Col1,val2);
      this.SetColWidths(Col2,val1);
      cc = this.GetColumnCalculation(Col1);
      this.SetColumnCalculation(Col1,this.GetColumnCalculation(Col2));
      this.SetColumnCalculation(Col2,cc);
      this.UpdateGridCells(false);
    };
    this.SortData = function (Column, Direction) {
      var fltr = false;
      this.FBlockUpdate = true;
      fltr = false;
      if (this.FFilterApplied) {
        this.RemoveFilter();
        fltr = true;
      };
      this.FSortColumn = Column;
      this.FSortDirection = Direction;
      this.FRowCount = this.FRowCount + 1;
      this.QuickSortRows(this.FSortColumn,this.FFixedRows,this.FRowCount - 2 - this.FFixedFooterRows);
      this.DeleteRow(this.GetRowCount() - 1);
      if (fltr) this.ApplyFilter();
      this.FBlockUpdate = false;
      this.UpdateGridCells(false);
    };
    this.SortIndexed = function () {
      var rdl = 0;
      var rl = 0;
      var ri = null;
      var fltr = false;
      if (this.FSortIndexes.GetCount() === 0) throw pas.SysUtils.Exception.$create("Create$1",["No indexes specified for indexed sort"]);
      fltr = false;
      if (this.FFilterApplied) {
        this.RemoveFilter();
        fltr = true;
      };
      this.BeginUpdate();
      try {
        rdl = this.FRowDisplayList.GetCount();
        rl = this.FRowList.GetCount();
        this.FRowCount = this.FRowCount + 1;
        this.QuickSortRowsIndexed(0,this.FFixedRows,this.FRowCount - 2 - this.FFixedFooterRows);
        this.ClearCells($mod.TTMSFNCGridCellRecRange.$clone(this.CellRange(0,this.GetRowCount() - 1,this.GetColumnCount() - 1,this.GetRowCount() - 1)));
        this.FRowCount = this.FRowCount - 1;
        while (rdl < this.FRowDisplayList.GetCount()) {
          this.FRowDisplayList.Delete(this.FRowDisplayList.GetCount() - 1);
        };
        while (rl < this.FRowList.GetCount()) {
          ri = this.FRowList.GetItem(this.FRowList.GetCount() - 1);
          ri = rtl.freeLoc(ri);
          this.FRowList.Delete(this.FRowList.GetCount() - 1);
        };
      } finally {
        if (fltr) this.ApplyFilter();
        this.EndUpdate();
      };
      this.UpdateGridCells(false);
    };
    this.SortGrouped = function (Column, Direction) {
      this.FSortColumn = Column;
      this.FSortDirection = Direction;
      this.SortGroupedInt(false);
    };
    this.SortGroupedIndexed = function () {
      this.SortGroupedInt(true);
    };
    this.CopyToClipboard = function (SelectedCells) {
    };
    this.CutToClipboard = function (SelectedCells) {
    };
    this.PasteFromClipboard = function () {
    };
    this.LoadFromCSV = function (FileName, MaxRows) {
      this.InputFromCSV(FileName,null,false,MaxRows);
    };
    this.InsertFromCSV = function (FileName, MaxRows) {
      this.InputFromCSV(FileName,null,true,MaxRows);
    };
    this.LoadFromCSV$1 = function (FileName, Encoding, MaxRows) {
      this.InputFromCSV(FileName,Encoding,false,MaxRows);
    };
    this.InsertFromCSV$1 = function (FileName, Encoding, MaxRows) {
      this.InputFromCSV(FileName,Encoding,true,MaxRows);
    };
    this.LoadFromCSVStream = function (AStream, MaxRows) {
      this.InputFromCSVStream(AStream,null,false,MaxRows);
    };
    this.InsertFromCSVStream = function (AStream, MaxRows) {
      this.InputFromCSVStream(AStream,null,true,MaxRows);
    };
    this.LoadFromCSVStream$1 = function (AStream, Encoding, MaxRows) {
      this.InputFromCSVStream(AStream,Encoding,false,MaxRows);
    };
    this.InsertFromCSVStream$1 = function (AStream, Encoding, MaxRows) {
      this.InputFromCSVStream(AStream,Encoding,true,MaxRows);
    };
    this.LoadFromFile = function (FileName) {
      var $Self = this;
      var X = 0;
      var Y = 0;
      var CW = 0;
      var ss = "";
      var ss1 = "";
      var strtCol = 0;
      var strtRow = 0;
      var oprogr = 0;
      var seppos = 0;
      var sl = null;
      function MStrToInt(s) {
        var Result = 0;
        var code = 0;
        var i = 0;
        pas.System.val$6(s,{get: function () {
            return i;
          }, set: function (v) {
            i = v;
          }},{get: function () {
            return code;
          }, set: function (v) {
            code = v;
          }});
        Result = i;
        return Result;
      };
      sl = $mod.TTMSFNCGridFileStringList.$create("Create$1");
      sl.LoadFromFile(FileName);
      strtCol = 0;
      strtRow = 0;
      ss = "";
      sl.ReadLn({get: function () {
          return ss;
        }, set: function (v) {
          ss = v;
        }});
      if (ss !== "") {
        ss1 = pas.System.Copy(ss,1,pas["WEBLib.TMSFNCGridDataUtil"].CharPos(",",ss) - 1);
        this.SetColumnCount(MStrToInt(ss1) + strtCol);
        ss1 = pas.System.Copy(ss,pas["WEBLib.TMSFNCGridDataUtil"].CharPos(",",ss) + 1,ss.length);
        this.FRowCount = MStrToInt(ss1) + strtRow;
      };
      if ((this.GetColumnCount() === 0) || (this.FRowCount === 0)) {
        sl = rtl.freeLoc(sl);
        throw pas.SysUtils.Exception.$create("Create$1",["File contains no data or corrupt file " + FileName]);
      };
      this.BeginUpdate();
      try {
        this.SetCells(this.GetColumnCount() - 1,this.FRowCount - 1,"");
        oprogr = 1;
        while (!sl.GetEOF()) {
          sl.ReadLn({get: function () {
              return ss;
            }, set: function (v) {
              ss = v;
            }});
          if (pas.System.Pos("cw",ss) === 1) {
            seppos = pas["WEBLib.TMSFNCGridDataUtil"].CharPos(",",ss);
            ss1 = pas.System.Copy(ss,4,seppos - 4);
            ss = pas.System.Copy(ss,seppos + 1,255);
            CW = MStrToInt(ss1);
            if ((CW >= 0) && (CW < this.GetColumnCount())) this.SetColWidths(CW,MStrToInt(ss));
          } else {
            ss1 = pas["WEBLib.TMSFNCGridDataUtil"].GetToken({get: function () {
                return ss;
              }, set: function (v) {
                ss = v;
              }},",");
            X = MStrToInt(ss1);
            ss1 = pas["WEBLib.TMSFNCGridDataUtil"].GetToken({get: function () {
                return ss;
              }, set: function (v) {
                ss = v;
              }},",");
            Y = MStrToInt(ss1);
            if ((X < this.GetColumnCount()) && (Y < this.FRowCount)) {
              ss = pas["WEBLib.TMSFNCGridDataUtil"].FileToLf(ss,true);
              this.DoLoadCell(X,Y,{get: function () {
                  return ss;
                }, set: function (v) {
                  ss = v;
                }});
            };
          };
          oprogr += 1;
          this.DoIOProgress(oprogr,sl.GetCount());
        };
      } finally {
        sl = rtl.freeLoc(sl);
        this.DoCellsChanged($mod.TTMSFNCGridCellRecRange.$clone(this.CellRange(0,0,this.GetColumnCount() - 1,this.GetRowCount() - 1)));
        this.EndUpdate();
      };
    };
    this.LoadXMLFromStream = function (AStream, LoadFieldDescr, IgnoreFixedColumns) {
      var s = null;
      s = pas.Classes.TStringStream.$create("Create$2",[""]);
      try {
        AStream.SetPosition(0);
        s.CopyFrom(AStream,AStream.GetSize());
        this.LoadXMLFromText(s.GetDataString(),LoadFieldDescr,IgnoreFixedColumns);
      } finally {
        s = rtl.freeLoc(s);
      };
    };
    this.LoadXMLFromText = function (AText, LoadFieldDescr, IgnoreFixedColumns) {
      var $Self = this;
      var xmldoc = null;
      var r = 0;
      var c = 0;
      var fc = 0;
      var fr = 0;
      var parentNode = null;
      var eNode = null;
      var I = 0;
      var sl = null;
      var txt = "";
      function LoadChildNodes(ANode) {
        var J = 0;
        var idx = 0;
        for (var $l = 0, $end = $mod.TJSNodeListHelper.GetCount.call(ANode.childNodes) - 1; $l <= $end; $l++) {
          J = $l;
          if ($mod.TJSNodeListHelper.GetCount.call(ANode.childNodes.item(J).childNodes) > 1) {
            LoadChildNodes(ANode.childNodes.item(J));
          } else if ($mod.TJSNodeListHelper.GetCount.call(ANode.childNodes.item(J).childNodes) === 1) {
            eNode = ANode.childNodes.item(J);
            idx = sl.IndexOf(eNode.nodeName);
            if (idx === -1) {
              sl.Add(eNode.nodeName);
              idx = sl.GetCount() - 1;
              if (LoadFieldDescr) {
                txt = eNode.nodeName;
                $Self.DoLoadCell(idx + fc,fr - 1,{get: function () {
                    return txt;
                  }, set: function (v) {
                    txt = v;
                  }});
              };
            };
            txt = eNode.childNodes.item(0).nodeValue;
            $Self.DoLoadCell(idx + fc,r,{get: function () {
                return txt;
              }, set: function (v) {
                txt = v;
              }});
          };
        };
        if ($mod.TJSNodeListHelper.GetCount.call(ANode.childNodes) > 0) r = r + 1;
      };
      var parser = new DOMParser();
      xmldoc = parser.parseFromString(AText, 'text/xml');
      parentNode = xmldoc.documentElement;
      if (IgnoreFixedColumns) {
        fc = 0}
       else fc = this.FFixedColumns;
      if (LoadFieldDescr && (this.FFixedRows < 1)) {
        fr = 1}
       else fr = this.FFixedRows;
      r = fr;
      sl = pas.Classes.TStringList.$create("Create$1");
      try {
        for (var $l = 0, $end = $mod.TJSNodeListHelper.GetCount.call(parentNode.childNodes) - 1; $l <= $end; $l++) {
          I = $l;
          LoadChildNodes(parentNode.childNodes.item(I));
        };
      } finally {
        c = sl.GetCount() + fc;
        sl = rtl.freeLoc(sl);
      };
      this.SetColumnCount(c);
      this.SetRowCount(r);
    };
    this.SaveToCSVStream = function (AStream, Encoding) {
      this.OutputToCSVStream(AStream,Encoding);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderGrid);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphicsTypes"].ITMSFNCAppearanceGlobalFont);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("BitmapContainer",3,pas["WEBLib.TMSFNCBitmapContainer"].$rtti["TTMSFNCBitmapContainer"],"GetBitmapContainer","SetBitmapContainer");
    $r.addProperty("DefaultRowHeight",14,rtl.double,"FDefaultRowHeight","SetDefaultRowHeight",4,{stored: "IsDefaultRowHeightStored"});
    $r.addProperty("DefaultColumnWidth",14,rtl.double,"FDefaultColumnWidth","SetDefaultColumnWidth",4,{stored: "IsDefaultColumnWidthStored"});
    $r.addProperty("FixedColumns",2,rtl.longint,"FFixedColumns","SetFixedColumns",4,{Default: 1});
    $r.addProperty("FixedRows",2,rtl.longint,"FFixedRows","SetFixedRows",4,{Default: 1});
    $r.addProperty("FixedRightColumns",2,rtl.longint,"FFixedRightColumns","SetFixedRightColumns",4,{Default: 0});
    $r.addProperty("FixedFooterRows",2,rtl.longint,"FFixedFooterRows","SetFixedFooterRows",4,{Default: 0});
    $r.addProperty("ColumnCount",3,rtl.longint,"GetColumnCount","SetColumnCount",4,{Default: 5});
    $r.addProperty("RowCount",3,rtl.longint,"GetRowCount","SetRowCount",4,{Default: 10});
    $r.addProperty("OnColumnCalc",0,$mod.$rtti["TTMSFNCGridColumnCalcEvent"],"FOnColumnCalc","FOnColumnCalc");
    $r.addProperty("OnGroupCalc",0,$mod.$rtti["TTMSFNCGridColumnCalcEvent"],"FOnGroupCalc","FOnGroupCalc");
    $r.addProperty("OnCustomCompare",0,$mod.$rtti["TTMSFNCGridCustomCompareEvent"],"FOnCustomCompare","FOnCustomCompare");
    $r.addProperty("OnIOProgress",0,$mod.$rtti["TTMSFNCGridIOProgressEvent"],"FOnIOProgress","FOnIOProgress");
    $r.addProperty("OnRawCompare",0,$mod.$rtti["TTMSFNCGridRawCompareEvent"],"FOnRawCompare","FOnRawCompare");
    $r.addProperty("OnSortFormat",0,$mod.$rtti["TTMSFNCGridSortFormatEvent"],"FOnSortFormat","FOnSortFormat");
    $r.addProperty("OnCellsChanged",0,$mod.$rtti["TTMSFNCGridCellsChangedEvent"],"FOnCellsChanged","FOnCellsChanged");
    $r.addProperty("OnClipboardBeforePasteCell",0,$mod.$rtti["TTMSFNCGridClipboardBeforePasteEvent"],"FOnClipboardBeforePasteCell","FOnClipboardBeforePasteCell");
    $r.addProperty("OnClipboardAfterPasteCell",0,$mod.$rtti["TTMSFNCGridClipboardAfterPasteEvent"],"FOnClipboardAfterPasteCell","FOnClipboardAfterPasteCell");
    $r.addProperty("OnClipboardPaste",0,$mod.$rtti["TTMSFNCGridCellsChangedEvent"],"FOnClipboardPaste","FOnClipboardPaste");
    $r.addProperty("OnNeedFilterDropDown",0,$mod.$rtti["TTMSFNCGridNeedFilterDropDownEvent"],"FOnNeedFilterDropDown","FOnNeedFilterDropDown");
    $r.addProperty("OnNeedFilterDropDownData",0,$mod.$rtti["TTMSFNCGridNeedFilterDropDownDataEvent"],"FOnNeedFilterDropDownData","FOnNeedFilterDropDownData");
    $r.addProperty("OnFilterSelect",0,$mod.$rtti["TTMSFNCGridFilterSelectEvent"],"FOnFilterSelect","FOnFilterSelect");
    $r.addProperty("OnAfterApplyFilter",0,$mod.$rtti["TTMSFNCGridAfterApplyFilterEvent"],"FOnAfterApplyFilter","FOnAfterApplyFilter");
    $r.addProperty("OnLoadCell",0,$mod.$rtti["TTMSFNCGridIOEvent"],"FOnLoadCell","FOnLoadCell");
    $r.addProperty("OnSaveCell",0,$mod.$rtti["TTMSFNCGridIOEvent"],"FOnSaveCell","FOnSaveCell");
    $r.addProperty("Options",2,pas["WEBLib.TMSFNCGridOptions"].$rtti["TTMSFNCGridOptions"],"FOptions","SetOptions");
    $r.addProperty("OnSelectCell",0,$mod.$rtti["TTMSFNCGridOnSelectCell"],"FOnSelectCell","FOnSelectCell");
    $r.addProperty("OnSelectedCell",0,$mod.$rtti["TTMSFNCGridOnSelectedCell"],"FOnSelectedCell","FOnSelectedCell");
  });
  this.MakeCellRange = function (AStartCol, AStartRow, AEndCol, AEndRow) {
    var Result = $mod.TTMSFNCGridCellRecRange.$new();
    Result.StartCol = AStartCol;
    Result.StartRow = AStartRow;
    Result.EndCol = AEndCol;
    Result.EndRow = AEndRow;
    return Result;
  };
  this.EqualsCellRange = function (Range1, Range2) {
    var Result = false;
    Result = (Range1.StartCol === Range2.StartCol) && (Range1.StartRow === Range2.StartRow) && (Range1.EndCol === Range2.EndCol) && (Range1.EndRow === Range2.EndRow);
    return Result;
  };
  this.InCellRange = function (Col, Row, Range) {
    var Result = false;
    Result = (Col >= Range.StartCol) && (Col <= Range.EndCol) && (Row >= Range.StartRow) && (Row <= Range.EndRow);
    return Result;
  };
  this.MakeCell = function (ACol, ARow) {
    var Result = $mod.TTMSFNCGridCellRec.$new();
    Result.Col = ACol;
    Result.Row = ARow;
    return Result;
  };
  $mod.$implcode = function () {
    $impl.CleanupSep = function (value) {
      var Result = "";
      var i = 0;
      var s = "";
      s = "";
      for (var $l = 1, $end = value.length; $l <= $end; $l++) {
        i = $l;
        if (value.charAt(i - 1) === pas.SysUtils.FormatSettings.ThousandSeparator) continue;
        if (value.charAt(i - 1) === pas.SysUtils.FormatSettings.DecimalSeparator) {
          s = s + "."}
         else s = s + value.charAt(i - 1);
      };
      Result = s;
      return Result;
    };
  };
},["RTLConsts","Math","WEBLib.TMSFNCUtils"]);
rtl.module("WEBLib.TMSFNCToolBarPopup",["System","Classes","WEBLib.TMSFNCPopup","WEBLib.TMSFNCToolBar","WEBLib.TMSFNCTypes"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.MAJ_VER = 1;
  this.MIN_VER = 0;
  this.REL_VER = 0;
  this.BLD_VER = 0;
  this.$rtti.$Class("TTMSFNCCustomToolBarPopup");
  rtl.createClass(this,"TTMSFNCToolBarPopupButton",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FOwner = null;
      this.FButton = null;
      this.FText = "";
      this.FDataBoolean = false;
      this.FTag = 0;
      this.FDataString = "";
      this.FDataObject = null;
      this.FDataInteger = 0;
      this.FWidth = 0.0;
      this.FHeight = 0.0;
      this.FEnabled = false;
      this.FVisible = false;
      this.FTop = 0.0;
      this.FLeft = 0.0;
      this.FLastElement = false;
      this.FBitmap = null;
      this.FDataPointer = null;
    };
    this.$final = function () {
      this.FOwner = undefined;
      this.FButton = undefined;
      this.FDataObject = undefined;
      this.FBitmap = undefined;
      pas.Classes.TCollectionItem.$final.call(this);
    };
    this.SetText = function (Value) {
      if (this.FText !== Value) {
        this.FText = Value;
        if (this.FButton != null) this.FButton.SetText(this.FText);
        if (this.FOwner != null) this.FOwner.UpdateToolBar();
      };
    };
    this.SetHeight = function (Value) {
      if (this.FHeight !== Value) {
        this.FHeight = Value;
        if ((this.FButton != null) && (this.FHeight > -1)) this.FButton.SetHeight(Math.round(this.FHeight));
        if (this.FOwner != null) this.FOwner.UpdateToolBar();
      };
    };
    this.SetWidth = function (Value) {
      if (this.FWidth !== Value) {
        this.FWidth = Value;
        if ((this.FButton != null) && (this.FWidth > -1)) this.FButton.SetWidth(Math.round(this.FWidth));
        if (this.FOwner != null) this.FOwner.UpdateToolBar();
      };
    };
    this.IsHeightStored = function () {
      var Result = false;
      Result = this.FHeight !== -1;
      return Result;
    };
    this.IsWidthStored = function () {
      var Result = false;
      Result = this.FWidth !== -1;
      return Result;
    };
    this.SetEnabled = function (Value) {
      if (this.FEnabled !== Value) {
        this.FEnabled = Value;
        if (this.FButton != null) this.FButton.SetEnabled(this.FEnabled);
        if (this.FOwner != null) this.FOwner.UpdateToolBar();
      };
    };
    this.SetVisible = function (Value) {
      if (this.FVisible !== Value) {
        this.FVisible = Value;
        if (this.FButton != null) this.FButton.SetVisible(this.FVisible);
        if (this.FOwner != null) this.FOwner.UpdateToolBar();
      };
    };
    this.IsLeftStored = function () {
      var Result = false;
      Result = this.FLeft !== -1;
      return Result;
    };
    this.IsTopStored = function () {
      var Result = false;
      Result = this.FTop !== -1;
      return Result;
    };
    this.SetLeft = function (Value) {
      if (this.FLeft !== Value) {
        this.FLeft = Value;
        if ((this.FButton != null) && (this.FLeft > -1)) this.FButton.SetLeft(Math.round(this.FLeft));
        if (this.FOwner != null) this.FOwner.UpdateToolBar();
      };
    };
    this.SetTop = function (Value) {
      if (this.FTop !== Value) {
        this.FTop = Value;
        if ((this.FButton != null) && (this.FTop > -1)) this.FButton.SetTop(Math.round(this.FTop));
        if (this.FOwner != null) this.FOwner.UpdateToolBar();
      };
    };
    this.SetLastElement = function (Value) {
      if (this.FLastElement !== Value) {
        this.FLastElement = Value;
        if (this.FButton != null) this.FButton.SetLastElement(this.FLastElement);
        if (this.FOwner != null) this.FOwner.UpdateToolBar();
      };
    };
    this.SetBitmap = function (Value) {
      if (this.FBitmap !== Value) {
        this.FBitmap.Assign(Value);
        if ((this.FButton != null) && !pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(this.FBitmap)) {
          this.FButton.FBitmaps.Clear();
          this.FButton.FBitmaps.AddBitmap(this.FBitmap,1.0);
        };
        if (this.FOwner != null) this.FOwner.UpdateToolBar();
      };
    };
    this.BitmapChanged = function (Sender) {
      if ((this.FButton != null) && !pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(this.FBitmap)) {
        this.FButton.FBitmaps.Clear();
        this.FButton.FBitmaps.AddBitmap(this.FBitmap,1.0);
      };
      if (this.FOwner != null) this.FOwner.UpdateToolBar();
    };
    this.Create$1 = function (ACollection) {
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      if (this.FCollection != null) this.FOwner = rtl.as(this.FCollection,$mod.TTMSFNCToolBarPopupButtons).FOwner$1;
      this.FBitmap = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      this.FBitmap.FOnChange = rtl.createCallback(this,"BitmapChanged");
      this.FWidth = -1;
      this.FHeight = -1;
      this.FTop = -1;
      this.FLeft = -1;
      this.FVisible = true;
      this.FEnabled = true;
      this.FLastElement = false;
      if ((this.FOwner != null) && (this.FOwner.FToolBar != null)) {
        this.FButton = pas["WEBLib.TMSFNCToolBar"].TTMSFNCToolBarButton.$create("Create$1",[this.FOwner.FToolBar]);
        this.FButton.SetTabStop(false);
        this.FButton.SetAllowFocus(false);
        this.FButton.SetParent(this.FOwner.FToolBar);
        this.FButton.FOnClick = rtl.createCallback(this.FOwner,"ToolBarButtonClick");
      };
      if (this.FOwner != null) {
        if (this.FOwner.FToolBar != null) this.FOwner.FToolBar.AddCustomControl(this.FButton,this.GetIndex());
        this.FOwner.UpdateToolBar();
      };
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCToolBarPopupButton.isPrototypeOf(Source)) {
        this.FText = rtl.as(Source,$mod.TTMSFNCToolBarPopupButton).FText;
        this.FWidth = rtl.as(Source,$mod.TTMSFNCToolBarPopupButton).FWidth;
        this.FHeight = rtl.as(Source,$mod.TTMSFNCToolBarPopupButton).FHeight;
        this.FLeft = rtl.as(Source,$mod.TTMSFNCToolBarPopupButton).FLeft;
        this.FTop = rtl.as(Source,$mod.TTMSFNCToolBarPopupButton).FTop;
        this.FEnabled = rtl.as(Source,$mod.TTMSFNCToolBarPopupButton).FEnabled;
        this.FVisible = rtl.as(Source,$mod.TTMSFNCToolBarPopupButton).FVisible;
        this.FBitmap.Assign(rtl.as(Source,$mod.TTMSFNCToolBarPopupButton).FBitmap);
        this.FLastElement = rtl.as(Source,$mod.TTMSFNCToolBarPopupButton).FLastElement;
      };
    };
    this.Destroy = function () {
      rtl.free(this,"FBitmap");
      pas.Classes.TCollectionItem.Destroy.call(this);
      if (this.FOwner != null) this.FOwner.UpdateToolBar();
    };
    var $r = this.$rtti;
    $r.addProperty("Text",2,rtl.string,"FText","SetText");
    $r.addProperty("Tag",0,rtl.longint,"FTag","FTag");
    $r.addProperty("Left",14,rtl.double,"FLeft","SetLeft",4,{stored: "IsLeftStored"});
    $r.addProperty("Top",14,rtl.double,"FTop","SetTop",4,{stored: "IsTopStored"});
    $r.addProperty("Width",14,rtl.double,"FWidth","SetWidth",4,{stored: "IsWidthStored"});
    $r.addProperty("Height",14,rtl.double,"FHeight","SetHeight",4,{stored: "IsHeightStored"});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("LastElement",2,rtl.boolean,"FLastElement","SetLastElement",4,{Default: false});
    $r.addProperty("Bitmap",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FBitmap","SetBitmap");
  });
  rtl.createClass(this,"TTMSFNCToolBarPopupButtons",pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$init.call(this);
      this.FOwner$1 = null;
    };
    this.$final = function () {
      this.FOwner$1 = undefined;
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$final.call(this);
    };
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      this.SetItem(Index,Value);
    };
    this.CreateItemClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCToolBarPopupButton;
      return Result;
    };
    this.GetOwner = function () {
      var Result = null;
      Result = this.FOwner$1;
      return Result;
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,this.CreateItemClass());
      this.FOwner$1 = AOwner;
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      return Result;
    };
  });
  this.$rtti.$MethodVar("TTMSFNCToolBarPopupButtonClickEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AButton",this.$rtti["TTMSFNCToolBarPopupButton"]]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCCustomToolBarPopup",pas["WEBLib.TMSFNCPopup"].TTMSFNCCustomNonFocusablePopup,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCPopup"].TTMSFNCCustomNonFocusablePopup.$init.call(this);
      this.FActivate = false;
      this.FToolBar = null;
      this.FButtons = null;
      this.FButtonClick = null;
      this.FOnDeactivate = null;
      this.FOnActivate = null;
    };
    this.$final = function () {
      this.FToolBar = undefined;
      this.FButtons = undefined;
      this.FButtonClick = undefined;
      this.FOnDeactivate = undefined;
      this.FOnActivate = undefined;
      pas["WEBLib.TMSFNCPopup"].TTMSFNCCustomNonFocusablePopup.$final.call(this);
    };
    this.SetButtons = function (Value) {
      this.FButtons.Assign(Value);
    };
    this.GetAutoAlign = function () {
      var Result = false;
      Result = this.FToolBar.FAutoAlign;
      return Result;
    };
    this.SetAutoAlign = function (Value) {
      this.FToolBar.SetAutoAlign(Value);
    };
    this.GetDragGrip = function () {
      var Result = false;
      Result = this.FToolBar.FAppearance.FDragGrip;
      return Result;
    };
    this.SetDragGrip = function (Value) {
      this.FToolBar.FAppearance.SetDragGrip(Value);
    };
    this.GetVersion = function () {
      var Result = "";
      Result = this.$class.GetVersionNumber(1,0,0,0);
      return Result;
    };
    this.CreateToolBar = function () {
      var Result = null;
      Result = pas["WEBLib.TMSFNCToolBar"].TTMSFNCToolBar.$create("Create$1",[this]);
      return Result;
    };
    this.FindPopupButton = function (AButton) {
      var Result = null;
      var I = 0;
      Result = null;
      for (var $l = 0, $end = this.FButtons.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (AButton === this.FButtons.GetItem$1(I).FButton) {
          Result = this.FButtons.GetItem$1(I);
          break;
        };
      };
      return Result;
    };
    this.GetInstance = function () {
      var Result = 0;
      Result = pas["WEBLib.TMSFNCTypes"].HInstance();
      return Result;
    };
    this.SetAdaptToStyle = function (Value) {
      pas["WEBLib.TMSFNCPopup"].TTMSFNCCustomPopup.SetAdaptToStyle.apply(this,arguments);
      if (this.FToolBar != null) this.FToolBar.SetAdaptToStyle(this.FAdaptToStyle);
    };
    this.UpdateControls = function (Sender) {
      this.UpdateToolBar();
    };
    this.UpdateToolBar = function () {
      if ((pas.Classes.TComponentStateItem.csLoading in this.FComponentState) || (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState)) return;
      this.SetDropDownWidth(this.FToolBar.GetWidth());
      this.SetDropDownHeight(this.FToolBar.GetHeight());
    };
    this.PrepareToolBar = function () {
      if (this.FToolBar != null) this.FToolBar.SetAdaptToStyle(this.FAdaptToStyle);
    };
    this.ActivatePopup = function () {
      this.DoCreatePopup(false);
    };
    this.DeactivatePopup = function () {
      this.ClosePopup();
    };
    this.DoClosePopup = function () {
      pas["WEBLib.TMSFNCPopup"].TTMSFNCCustomPopup.DoClosePopup.call(this);
      this.DestroyPopupForm();
    };
    this.ToolBarClick = function (Sender) {
      this.ActivatePreviousWindow();
    };
    this.ToolBarButtonClick = function (Sender) {
      if (this.FButtonClick != null) this.FButtonClick(this,this.FindPopupButton(rtl.as(Sender,pas["WEBLib.TMSFNCToolBar"].TTMSFNCToolBarButton)));
      this.ActivatePreviousWindow();
    };
    this.DoDragGripMoving = function (Sender, ADeltaX, ADeltaY) {
      if (this.FPopupForm != null) {
        this.FPopupForm.SetLeft(this.FPopupForm.GetLeft() - Math.round(ADeltaX));
        this.FPopupForm.SetTop(this.FPopupForm.GetTop() - Math.round(ADeltaY));
      };
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCPopup"].TTMSFNCCustomNonFocusablePopup.Create$1.apply(this,arguments);
      this.SetPlacement(pas["WEBLib.TMSFNCPopup"].TTMSFNCPopupPlacement.ppMouse);
      this.FButtons = $mod.TTMSFNCToolBarPopupButtons.$create("Create$3",[this]);
      this.FToolBar = this.CreateToolBar();
      if (!(pas.Classes.TComponentStateItem.csDesigning in this.FComponentState)) this.FToolBar.SetParent(this);
      this.FToolBar.SetAutoAlign(true);
      this.FToolBar.FOnClick = rtl.createCallback(this,"ToolBarClick");
      this.FToolBar.SetTabStop(false);
      this.FToolBar.SetAllowFocus(false);
      this.FToolBar.FOptionsMenu.SetShowButton(false);
      this.FToolBar.FAppearance.SetDragGrip(false);
      this.FToolBar.FOnDragGripMoving = rtl.createCallback(this,"DoDragGripMoving");
      this.FToolBar.FAutoMoveToolBar = false;
      this.FToolBar.FOnUpdateControls = rtl.createCallback(this,"UpdateControls");
      this.SetContentControl(this.FToolBar);
      return this;
    };
    this.Assign = function (Source) {
      pas["WEBLib.TMSFNCPopup"].TTMSFNCCustomPopup.Assign.apply(this,arguments);
      if ($mod.TTMSFNCCustomToolBarPopup.isPrototypeOf(Source)) {
        this.FButtons.Assign(rtl.as(Source,$mod.TTMSFNCCustomToolBarPopup).FButtons);
        this.SetAutoAlign(rtl.as(Source,$mod.TTMSFNCCustomToolBarPopup).GetAutoAlign());
        this.SetDragGrip(rtl.as(Source,$mod.TTMSFNCCustomToolBarPopup).GetDragGrip());
      };
    };
    this.Destroy = function () {
      rtl.free(this,"FButtons");
      pas["WEBLib.TMSFNCPopup"].TTMSFNCCustomNonFocusablePopup.Destroy.call(this);
    };
    this.Activate = function () {
      var frm = null;
      if (this.Activated()) this.Deactivate();
      if (this.FToolBar != null) {
        this.FToolBar.SetParent(frm);
        this.FToolBar.SetVisible(false);
      };
      this.PrepareToolBar();
      this.ActivatePopup();
      this.UpdateToolBar();
      this.FActivate = true;
      if (this.FOnActivate != null) this.FOnActivate(this);
    };
    this.Deactivate = function () {
      this.DeactivatePopup();
      this.FActivate = false;
      if (this.FOnDeactivate != null) this.FOnDeactivate(this);
    };
    this.DropDownActive = function () {
      var Result = false;
      Result = false;
      if (this.FToolBar != null) Result = this.FToolBar.DropDownActive();
      return Result;
    };
    this.Activated = function () {
      var Result = false;
      Result = this.HasPopupForm();
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCToolBarPopup",this.TTMSFNCCustomToolBarPopup,function () {
    this.RegisterRuntimeClasses = function () {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClass($mod.TTMSFNCToolBarPopup);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("AdaptToStyle",2,rtl.boolean,"FAdaptToStyle","SetAdaptToStyle",4,{Default: false});
    $r.addProperty("OnButtonClick",0,$mod.$rtti["TTMSFNCToolBarPopupButtonClickEvent"],"FButtonClick","FButtonClick");
    $r.addProperty("AutoAlign",3,rtl.boolean,"GetAutoAlign","SetAutoAlign",4,{Default: true});
    $r.addProperty("Buttons",2,$mod.$rtti["TTMSFNCToolBarPopupButtons"],"FButtons","SetButtons");
    $r.addProperty("Placement",2,pas["WEBLib.TMSFNCPopup"].$rtti["TTMSFNCPopupPlacement"],"FPlacement","SetPlacement",4,{Default: pas["WEBLib.TMSFNCPopup"].TTMSFNCPopupPlacement.ppBottom});
    $r.addProperty("PlacementRectangle",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCMargins"],"FPlacementRectangle","SetPlacementRectangle");
    $r.addProperty("PlacementControl",2,pas["WEBLib.Controls"].$rtti["TControl"],"FPlacementControl","SetPlacementControl");
    $r.addProperty("OnActivate",0,pas.Classes.$rtti["TNotifyEvent"],"FOnActivate","FOnActivate");
    $r.addProperty("OnDeactivate",0,pas.Classes.$rtti["TNotifyEvent"],"FOnDeactivate","FOnDeactivate");
    $r.addProperty("Version",1,rtl.string,"GetVersion","");
    $r.addProperty("DragGrip",3,rtl.boolean,"GetDragGrip","SetDragGrip",4,{Default: false});
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
  $mod.$implcode = function () {
    rtl.createClass($impl,"TTMSFNCToolBarOpen",pas["WEBLib.TMSFNCToolBar"].TTMSFNCToolBar,function () {
      rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCStylesManager);
      rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
      rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
      rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
      rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
      rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
      rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
      rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
      rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
      rtl.addIntf(this,pas.System.IUnknown);
    });
  };
},["WEBLib.Forms","WEBLib.TMSFNCUtils","Types"]);
rtl.module("WEBLib.TMSFNCCustomGrid",["System","Classes","WEBLib.TMSFNCEdit","WEBLib.TMSFNCPersistence","WEBLib.TMSFNCCustomComponent","WEBLib.StdCtrls","WEBLib.TMSFNCColorPicker","WEBLib.TMSFNCImage","WEBLib.TMSFNCGridData","WEBLib.TMSFNCGridCell","WEBLib.TMSFNCPopup","WEBLib.TMSFNCGraphics","WEBLib.TMSFNCToolBarPopup","Types","WEBLib.TMSFNCTypes","WEBLib.Controls","WEBLib.TMSFNCGridOptions","WEBLib.TMSFNCGridDataUtil","WEBLib.TMSFNCGraphicsTypes","WEBLib.ExtCtrls"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.TTMSFNCGridDocURL = pas["WEBLib.TMSFNCTypes"].TTMSFNCBaseDocURL + "tmsfncuipack/components/ttmsfncgrid/";
  this.MAJ_VER = 1;
  this.MIN_VER = 1;
  this.REL_VER = 0;
  this.BLD_VER = 8;
  this.SCROLLINGDELAY = 0;
  this.SWIPECOUNT = 300;
  this.DOWNCOUNT = 100;
  this.$rtti.$Class("TTMSFNCCustomGrid");
  this.TTMSFNCGridCustomToolBarPopupMode = {"0": "tpmActiveCell", tpmActiveCell: 0, "1": "tpmHoverCell", tpmHoverCell: 1, "2": "tpmHoverNormalCell", tpmHoverNormalCell: 2, "3": "tpmNone", tpmNone: 3};
  this.$rtti.$Enum("TTMSFNCGridCustomToolBarPopupMode",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TTMSFNCGridCustomToolBarPopupMode});
  rtl.createClass(this,"TTMSFNCGridCustomToolBarPopup",pas["WEBLib.TMSFNCToolBarPopup"].TTMSFNCCustomToolBarPopup,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCToolBarPopup"].TTMSFNCCustomToolBarPopup.$init.call(this);
      this.FGrid = null;
      this.FGridCell = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
    };
    this.$final = function () {
      this.FGrid = undefined;
      this.FGridCell = undefined;
      pas["WEBLib.TMSFNCToolBarPopup"].TTMSFNCCustomToolBarPopup.$final.call(this);
    };
    this.Notification = function (AComponent, Operation) {
      pas["WEBLib.TMSFNCPopup"].TTMSFNCCustomPopup.Notification.apply(this,arguments);
      if ((Operation === pas.Classes.TOperation.opRemove) && (AComponent === this.FGrid)) this.FGrid = null;
    };
    this.Create$1 = function (AOwner) {
      var I = 0;
      pas["WEBLib.TMSFNCToolBarPopup"].TTMSFNCCustomToolBarPopup.Create$1.apply(this,arguments);
      if (this.IsDesignTime() && (AOwner != null) && pas["WEBLib.Forms"].TCustomForm.isPrototypeOf(AOwner)) {
        for (var $l = 0, $end = AOwner.GetComponentCount() - 1; $l <= $end; $l++) {
          I = $l;
          if ($mod.TTMSFNCCustomGrid.isPrototypeOf(AOwner.GetComponent(I))) {
            this.FGrid = rtl.as(AOwner.GetComponent(I),$mod.TTMSFNCCustomGrid);
            this.FGrid.FToolBarPopup = this;
            break;
          };
        };
      };
      return this;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCGridColorPicker",pas["WEBLib.TMSFNCColorPicker"].TTMSFNCColorPicker,function () {
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCGridEdit",pas["WEBLib.TMSFNCEdit"].TTMSFNCEdit,function () {
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCEdit"].TTMSFNCEdit.Create$1.apply(this,arguments);
      this.FAutoClose = false;
      return this;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCGridComboBox",pas["WEBLib.StdCtrls"].TComboBox,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCGridTrackBar",pas["WEBLib.ExtCtrls"].TTrackBar,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCGridMemo",pas["WEBLib.StdCtrls"].TMemo,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCGridDatePicker",pas["WEBLib.StdCtrls"].TDateTimePicker,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCGridSpinBox",pas["WEBLib.StdCtrls"].TSpinEdit,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCGridProtectedControl",pas["WEBLib.Controls"].TWinControl,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.$rtti.$MethodVar("TTMSFNCGridOnGetCellClass",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["CellClassType",pas["WEBLib.TMSFNCGridCell"].$rtti["TTMSFNCGridCellClass"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridTopLeftChanged",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ATopRow",rtl.longint],["ALeftCol",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnGetCellData",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["CellString",rtl.string,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnGetCellProperties",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["Cell",pas["WEBLib.TMSFNCGridCell"].$rtti["TTMSFNCGridCell"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnGetCellMergeInfo",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["ABaseCol",rtl.longint,1],["ABaseRow",rtl.longint,1],["AColSpan",rtl.longint,1],["ARowSpan",rtl.longint,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnGetCellEditorCustomClassType",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["CellEditorCustomClassType",pas["WEBLib.TMSFNCGridData"].$rtti["TTMSFNCGridEditorClass"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnGetCellEditorType",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["CellEditorType",pas["WEBLib.TMSFNCGridData"].$rtti["TTMSFNCGridEditorType"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnCellEditGetData",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["CellEditor",pas["WEBLib.Controls"].$rtti["TWinControl"]],["CellString",rtl.string,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnGetCellEditorProperties",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["CellEditor",pas["WEBLib.Controls"].$rtti["TWinControl"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnCellEditValidateData",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["CellEditor",pas["WEBLib.Controls"].$rtti["TWinControl"]],["CellString",rtl.string,1],["Allow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnCellEditSetData",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["CellEditor",pas["WEBLib.Controls"].$rtti["TWinControl"]],["CellString",rtl.string,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnCellComboCloseUp",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["ItemIndex",rtl.longint],["AValue",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnCellEditGetColor",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["CellEditor",pas["WEBLib.Controls"].$rtti["TWinControl"]],["CellColor",pas["WEBLib.Graphics"].$rtti["TColor"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnCellEditValidateColor",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["CellEditor",pas["WEBLib.Controls"].$rtti["TWinControl"]],["CellColor",pas["WEBLib.Graphics"].$rtti["TColor"],1],["Allow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnCellEditSetColor",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["CellEditor",pas["WEBLib.Controls"].$rtti["TWinControl"]],["CellColor",pas["WEBLib.Graphics"].$rtti["TColor"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnCellEditDone",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["CellEditor",pas["WEBLib.Controls"].$rtti["TWinControl"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnCellEditCancel",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnCanSizeColumn",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["Allow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnCanSizeRow",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ARow",rtl.longint],["Allow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnColumnSize",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["NewWidth",rtl.double,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnRowSize",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ARow",rtl.longint],["NewHeight",rtl.double,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnColumnSized",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["NewWidth",rtl.double]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnRowSized",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ARow",rtl.longint],["NewHeight",rtl.double]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnColumnDragged",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["FromCol",rtl.longint],["ToCol",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnRowDragged",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["FromRow",rtl.longint],["ToRow",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnBeforeRowDrop",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["FromRow",rtl.longint],["ToRow",rtl.longint,1],["Allow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnBeforeColumnDrop",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["FromColumn",rtl.longint],["ToColumn",rtl.longint,1],["Allow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnCanSortColumn",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["Allow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnColumnSorted",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["Direction",pas["WEBLib.TMSFNCGridData"].$rtti["TTMSFNCGridSortDirection"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnCellAnchorClick",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["AAnchor",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnGetCellReadOnly",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["AReadOnly",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnGetCellLayout",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["ALayout",pas["WEBLib.TMSFNCGridCell"].$rtti["TTMSFNCGridCellLayout"]],["ACellState",pas["WEBLib.TMSFNCGridData"].$rtti["TTMSFNCGridCellState"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnCellClick",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnGetCellIsFixed",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["ACellFixed",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnGetCellRotation",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["Angle",rtl.longint,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnGetRowIsBand",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ARow",rtl.longint],["ARowBand",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnCanInsertRow",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ARow",rtl.longint],["Allow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnCanDeleteRow",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ARow",rtl.longint],["Allow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnCanAppendColumn",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["Allow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnCanAppendRow",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ARow",rtl.longint],["Allow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnInsertRow",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ARow",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnDeleteRow",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ARow",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnAppendColumn",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridOnAppendRow",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ARow",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridCellControlEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["ACell",pas["WEBLib.TMSFNCGridCell"].$rtti["TTMSFNCGridCell"]]]), methodkind: 0});
  this.$rtti.$DynArray("TTMSFNCGridCellArray$a",{eltype: pas["WEBLib.TMSFNCGridCell"].$rtti["TTMSFNCGridCell"]});
  this.$rtti.$DynArray("TTMSFNCGridCellArray",{eltype: this.$rtti["TTMSFNCGridCellArray$a"]});
  this.TTMSFNCGridSizeMode = {"0": "smColumnSizing", smColumnSizing: 0, "1": "smRowSizing", smRowSizing: 1, "2": "smPreviousColumnSizing", smPreviousColumnSizing: 2, "3": "smPreviousRowSizing", smPreviousRowSizing: 3};
  this.$rtti.$Enum("TTMSFNCGridSizeMode",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TTMSFNCGridSizeMode});
  this.TTMSFNCGridDraggingMode = {"0": "dmNone", dmNone: 0, "1": "dmRowDragging", dmRowDragging: 1, "2": "dmColumnDragging", dmColumnDragging: 2};
  this.$rtti.$Enum("TTMSFNCGridDraggingMode",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCGridDraggingMode});
  this.$rtti.$MethodVar("TTMSFNCGridCellBeforeDraw",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"],1],["ATextRect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"],1],["ADrawText",rtl.boolean,1],["ADrawBackGround",rtl.boolean,1],["ADrawBorder",rtl.boolean,1],["AllowDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridCellEditBeforeExit",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["CellEditor",pas["WEBLib.Controls"].$rtti["TWinControl"]],["AllowExit",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGridCellAfterDraw",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["ATextRect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]]]), methodkind: 0});
  this.TTMSFNCGridEditCellStart = {"0": "csNone", csNone: 0, "1": "csStart", csStart: 1, "2": "csEnd", csEnd: 2};
  this.$rtti.$Enum("TTMSFNCGridEditCellStart",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCGridEditCellStart});
  this.TTMSFNCGridTabKeyMode = {"0": "tkmNone", tkmNone: 0, "1": "tkmNormal", tkmNormal: 1, "2": "tkmShift", tkmShift: 2};
  this.$rtti.$Enum("TTMSFNCGridTabKeyMode",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCGridTabKeyMode});
  rtl.createClass(this,"TTMSFNCGridAppearance",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FBandLayout = null;
      this.FFocusedLayout = null;
      this.FFixedSelectedLayout = null;
      this.FNormalLayout = null;
      this.FSummaryLayout = null;
      this.FOnChange = null;
      this.FSelectedLayout = null;
      this.FFixedLayout = null;
      this.FGroupLayout = null;
      this.FProgressLayout = null;
      this.FShowFocus = false;
    };
    this.$final = function () {
      this.FBandLayout = undefined;
      this.FFocusedLayout = undefined;
      this.FFixedSelectedLayout = undefined;
      this.FNormalLayout = undefined;
      this.FSummaryLayout = undefined;
      this.FOnChange = undefined;
      this.FSelectedLayout = undefined;
      this.FFixedLayout = undefined;
      this.FGroupLayout = undefined;
      this.FProgressLayout = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetBandLayout = function (Value) {
      this.FBandLayout.Assign(Value);
    };
    this.SetFixedLayout = function (Value) {
      this.FFixedLayout.Assign(Value);
    };
    this.SetFixedSelectedLayout = function (Value) {
      this.FFixedSelectedLayout.Assign(Value);
    };
    this.SetFocusedLayout = function (Value) {
      this.FFocusedLayout.Assign(Value);
    };
    this.SetGroupLayout = function (Value) {
      this.FGroupLayout.Assign(Value);
    };
    this.SetNormalLayout = function (Value) {
      this.FNormalLayout.Assign(Value);
    };
    this.SetSelectedLayout = function (Value) {
      this.FSelectedLayout.Assign(Value);
    };
    this.SetSummaryLayout = function (Value) {
      this.FSummaryLayout.Assign(Value);
    };
    this.SetProgressLayout = function (Value) {
      this.FProgressLayout.Assign(Value);
    };
    this.SetShowFocus = function (Value) {
      if (this.FShowFocus !== Value) {
        this.FShowFocus = Value;
        this.LayoutChanged(this);
      };
    };
    this.LayoutChanged = function (Sender) {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.InitializeDefaultLayout = function () {
      this.FNormalLayout.FFill.SetColor(-1);
      this.FFixedLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FFixedLayout.FFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(230,230,230));
      this.FFixedLayout.FFont.SetStyle(rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsBold));
      this.FFixedSelectedLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FFixedSelectedLayout.FFill.SetColor(14599344);
      this.FFocusedLayout.FFill.SetColor(14599344);
      this.FFocusedLayout.FFont.SetColor(16777215);
      this.FSelectedLayout.FFill.SetColor(14599344);
      this.FSelectedLayout.FFont.SetColor(16777215);
      this.FBandLayout.FFill.SetColor(14745599);
      this.FGroupLayout.FFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(110,147,195));
      this.FGroupLayout.FFont.SetColor(16777215);
      this.FSummaryLayout.FFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(185,197,213));
    };
    this.Create$1 = function () {
      this.FBandLayout = pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCellLayout.$create("Create$1");
      this.FFixedLayout = pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCellLayout.$create("Create$1");
      this.FNormalLayout = pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCellLayout.$create("Create$1");
      this.FGroupLayout = pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCellLayout.$create("Create$1");
      this.FSummaryLayout = pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCellLayout.$create("Create$1");
      this.FSelectedLayout = pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCellLayout.$create("Create$1");
      this.FFocusedLayout = pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCellLayout.$create("Create$1");
      this.FFixedSelectedLayout = pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCellLayout.$create("Create$1");
      this.FProgressLayout = pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCellProgressLayout.$create("Create$1");
      this.FShowFocus = true;
      this.InitializeDefaultLayout();
      this.FProgressLayout.FOnChange = rtl.createCallback(this,"LayoutChanged");
      this.FBandLayout.FOnChange = rtl.createCallback(this,"LayoutChanged");
      this.FFixedLayout.FOnChange = rtl.createCallback(this,"LayoutChanged");
      this.FNormalLayout.FOnChange = rtl.createCallback(this,"LayoutChanged");
      this.FGroupLayout.FOnChange = rtl.createCallback(this,"LayoutChanged");
      this.FSummaryLayout.FOnChange = rtl.createCallback(this,"LayoutChanged");
      this.FSelectedLayout.FOnChange = rtl.createCallback(this,"LayoutChanged");
      this.FFocusedLayout.FOnChange = rtl.createCallback(this,"LayoutChanged");
      this.FFixedSelectedLayout.FOnChange = rtl.createCallback(this,"LayoutChanged");
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCGridAppearance.isPrototypeOf(Source)) {
        this.FBandLayout.Assign(rtl.as(Source,$mod.TTMSFNCGridAppearance).FBandLayout);
        this.FFixedSelectedLayout.Assign(rtl.as(Source,$mod.TTMSFNCGridAppearance).FFixedSelectedLayout);
        this.FFixedLayout.Assign(rtl.as(Source,$mod.TTMSFNCGridAppearance).FFixedLayout);
        this.FNormalLayout.Assign(rtl.as(Source,$mod.TTMSFNCGridAppearance).FNormalLayout);
        this.FGroupLayout.Assign(rtl.as(Source,$mod.TTMSFNCGridAppearance).FGroupLayout);
        this.FSummaryLayout.Assign(rtl.as(Source,$mod.TTMSFNCGridAppearance).FSummaryLayout);
        this.FSelectedLayout.Assign(rtl.as(Source,$mod.TTMSFNCGridAppearance).FSelectedLayout);
        this.FFocusedLayout.Assign(rtl.as(Source,$mod.TTMSFNCGridAppearance).FFocusedLayout);
        this.FProgressLayout.Assign(rtl.as(Source,$mod.TTMSFNCGridAppearance).FProgressLayout);
        this.FShowFocus = rtl.as(Source,$mod.TTMSFNCGridAppearance).FShowFocus;
      };
    };
    this.Destroy = function () {
      rtl.free(this,"FProgressLayout");
      rtl.free(this,"FBandLayout");
      rtl.free(this,"FFixedLayout");
      rtl.free(this,"FNormalLayout");
      rtl.free(this,"FGroupLayout");
      rtl.free(this,"FSummaryLayout");
      rtl.free(this,"FSelectedLayout");
      rtl.free(this,"FFocusedLayout");
      rtl.free(this,"FFixedSelectedLayout");
      pas.System.TObject.Destroy.call(this);
    };
    var $r = this.$rtti;
    $r.addProperty("FixedLayout",2,pas["WEBLib.TMSFNCGridCell"].$rtti["TTMSFNCGridCellLayout"],"FFixedLayout","SetFixedLayout");
    $r.addProperty("NormalLayout",2,pas["WEBLib.TMSFNCGridCell"].$rtti["TTMSFNCGridCellLayout"],"FNormalLayout","SetNormalLayout");
    $r.addProperty("GroupLayout",2,pas["WEBLib.TMSFNCGridCell"].$rtti["TTMSFNCGridCellLayout"],"FGroupLayout","SetGroupLayout");
    $r.addProperty("SummaryLayout",2,pas["WEBLib.TMSFNCGridCell"].$rtti["TTMSFNCGridCellLayout"],"FSummaryLayout","SetSummaryLayout");
    $r.addProperty("SelectedLayout",2,pas["WEBLib.TMSFNCGridCell"].$rtti["TTMSFNCGridCellLayout"],"FSelectedLayout","SetSelectedLayout");
    $r.addProperty("FocusedLayout",2,pas["WEBLib.TMSFNCGridCell"].$rtti["TTMSFNCGridCellLayout"],"FFocusedLayout","SetFocusedLayout");
    $r.addProperty("FixedSelectedLayout",2,pas["WEBLib.TMSFNCGridCell"].$rtti["TTMSFNCGridCellLayout"],"FFixedSelectedLayout","SetFixedSelectedLayout");
    $r.addProperty("BandLayout",2,pas["WEBLib.TMSFNCGridCell"].$rtti["TTMSFNCGridCellLayout"],"FBandLayout","SetBandLayout");
    $r.addProperty("ProgressLayout",2,pas["WEBLib.TMSFNCGridCell"].$rtti["TTMSFNCGridCellProgressLayout"],"FProgressLayout","SetProgressLayout");
    $r.addProperty("ShowFocus",2,rtl.boolean,"FShowFocus","SetShowFocus",4,{Default: true});
    $r.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChange","FOnChange");
  });
  rtl.createClass(this,"TTMSFNCGridAdapter",pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.$init.call(this);
      this.FBlockAdd = false;
      this.FGrid = null;
      this.FActive = false;
    };
    this.$final = function () {
      this.FGrid = undefined;
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.$final.call(this);
    };
    this.SetActive = function (Value) {
      this.FActive = Value;
      if (!(this.FGrid != null)) return;
      this.Initialize();
    };
    this.SetGrid = function (Value) {
      if (this.FGrid !== Value) {
        this.FGrid = Value;
        if (this.FBlockAdd) return;
        this.FBlockAdd = true;
        if (this.FGrid != null) {
          this.FGrid.SetAdapter(this);
          this.Initialize();
        };
        this.FBlockAdd = false;
      };
    };
    this.GetInstance = function () {
      var Result = 0;
      Result = pas["WEBLib.TMSFNCTypes"].HInstance();
      return Result;
    };
    this.AlternateDisplayBuildUp = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    this.CanCancelEdit = function () {
      var Result = false;
      Result = true;
      return Result;
    };
    this.StartBuild = function (ARow) {
    };
    this.Notification = function (AComponent, Operation) {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.Notification.apply(this,arguments);
      if ((Operation === pas.Classes.TOperation.opRemove) && (AComponent === this.FGrid)) this.FGrid = null;
    };
    this.UpdateBounds = function () {
    };
    this.Initialize = function () {
    };
    this.ScrollGrid = function (ADelta, ABeforeDisplayCells, AScrollOnly) {
    };
    this.SelectCell = function (ACell) {
    };
    this.GetCellData = function (ACol, ARow, ACellData) {
    };
    this.GetCellClass = function (ACol, ARow, ACellClassType) {
    };
    this.GetCellProperties = function (ACol, ARow, ACell) {
    };
    this.GetCellEditorProperties = function (ACol, ARow, CellEditor) {
    };
    this.GetCellEditorType = function (ACol, ARow, ACellEditorType) {
    };
    this.GetCellReadOnly = function (ACol, ARow, AReadOnly) {
    };
    this.CellEditGetData = function (ACol, ARow, CellEditor, CellString) {
    };
    this.CellEditValidateData = function (ACol, ARow, CellEditor, CellString, Allow) {
    };
    this.CellEditSetData = function (ACol, ARow, CellEditor, CellString) {
    };
    this.CellEditDone = function (ACol, ARow, CellEditor) {
    };
    this.CellEditCancel = function (ACol, ARow) {
    };
    this.CellBeforeEdit = function (ACol, ARow) {
    };
    this.CellCheckBoxClick = function (ACol, ARow, ACell) {
    };
    this.CellBeforeEditExit = function (ACol, ARow, CellEditor, AllowExit) {
    };
    this.ExportNotification = function (AState, ARow) {
    };
    this.GetColumnDisplayName = function (ACol) {
      var Result = "";
      Result = "";
      return Result;
    };
    this.Create$1 = function (AOwner) {
      var I = 0;
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.Create$1.apply(this,arguments);
      this.FActive = false;
      if (this.IsDesignTime() && (AOwner != null) && pas["WEBLib.Forms"].TCustomForm.isPrototypeOf(AOwner)) {
        for (var $l = 0, $end = AOwner.GetComponentCount() - 1; $l <= $end; $l++) {
          I = $l;
          if ($mod.TTMSFNCCustomGrid.isPrototypeOf(AOwner.GetComponent(I))) {
            this.SetGrid(rtl.as(AOwner.GetComponent(I),$mod.TTMSFNCCustomGrid));
            break;
          };
        };
      };
      return this;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Active",2,rtl.boolean,"FActive","SetActive",4,{Default: false});
    $r.addProperty("Grid",2,$mod.$rtti["TTMSFNCCustomGrid"],"FGrid","SetGrid");
  });
  rtl.createClass(this,"TTMSFNCCustomGrid",pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.$init.call(this);
      this.FToolBarPopupCell = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      this.FDummyButtonBitmap = null;
      this.FBlockUpdateAdapter = 0;
      this.FBlockAdd = false;
      this.FKeyUsed = false;
      this.FTimeStart$1 = 0.0;
      this.FTimeStop$1 = 0.0;
      this.FAnimating$1 = false;
      this.FAnimateVerticalPos$1 = false;
      this.FAnimateHorizontalPos$1 = false;
      this.FScrollVTo$1 = 0.0;
      this.FScrollHTo$1 = 0.0;
      this.FAnimateTimer$1 = null;
      this.FFreeEditControlTimer = null;
      this.FDoubleSelection$1 = false;
      this.FSpX$1 = 0.0;
      this.FSpY$1 = 0.0;
      this.FScrollX$1 = 0.0;
      this.FScrollY$1 = 0.0;
      this.FCommentPopup = null;
      this.FDoTouchScroll = false;
      this.FFilterPopup = null;
      this.FActiveComment = "";
      this.FActiveCommentTextColor = 0;
      this.FNodeOpenBitmap = null;
      this.FNodeClosedBitmap = null;
      this.FCellKeyDown = false;
      this.FCellPosX = 0;
      this.FCellPosY = 0;
      this.FContainerWidth = 0.0;
      this.FContainerHeight = 0.0;
      this.FClearMouseDown = false;
      this.ChangeCursor = false;
      this.OldCursor = 0;
      this.FBlockHide = false;
      this.FTabKey = 0;
      this.FTopr = 0;
      this.FLeftC = 0;
      this.FDblClick = false;
      this.FSaveTopCell = null;
      this.FPrevSelection = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRecRange.$new();
      this.FCellAnchor = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      this.FCellAnchorString = "";
      this.FLookupString = "";
      this.FDraggingMode = 0;
      this.FDragBitmap = null;
      this.FDragFixed = false;
      this.FTouchScrolling$1 = false;
      this.FMouseX$1 = 0.0;
      this.FMouseY$1 = 0.0;
      this.FDragCell = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      this.FDragScrollCell = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      this.FEditCell = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      this.FEditControl = null;
      this.FCellEdit = null;
      this.FCellComboBox = null;
      this.FRealCell = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      this.FX = 0.0;
      this.FY = 0.0;
      this.FPrevX = 0.0;
      this.FPrevY = 0.0;
      this.FSizeX = 0.0;
      this.FSaveDragX = 0.0;
      this.FSaveDragY = 0.0;
      this.FSizeY = 0.0;
      this.FDragX = 0.0;
      this.FDragY = 0.0;
      this.FDownX$1 = 0.0;
      this.FDownY$1 = 0.0;
      this.FTouchX = 0.0;
      this.FTouchY = 0.0;
      this.FScrollTimer = null;
      this.FDragTimer = null;
      this.FPrevSelectedCell = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      this.FFirstCell = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      this.FSaveCell = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      this.FMouseDown = false;
      this.FMouseDblClick = false;
      this.FMouseUp$1 = false;
      this.FMouseScrollingUp = false;
      this.FMouseSizing = false;
      this.FSizing = false;
      this.FSizeMode = 0;
      this.FMouseDragging = false;
      this.FCStart = 0;
      this.FRStart = 0;
      this.FCStop = 0;
      this.FRStop = 0;
      this.FOldTopRow = 0;
      this.FReset = false;
      this.FCellArray = [];
      this.FOnGetCellClass = null;
      this.FOnGetCellData = null;
      this.FFreezeRows = 0;
      this.FFreezeColumns = 0;
      this.FOnGetCellMergeInfo = null;
      this.FOnCellEditSetData = null;
      this.FOnCellEditDone = null;
      this.FOnGetCellEditorCustomClassType = null;
      this.FOnCellEditValidateData = null;
      this.FOnCellEditGetData = null;
      this.FOnGetCellEditorProperties = null;
      this.FOnCellRadioButtonClick = null;
      this.FOnCellCheckBoxClick = null;
      this.FOnCellBitmapClick = null;
      this.FOnCellCommentClick = null;
      this.FOnCellSortClick = null;
      this.FOnRowSized = null;
      this.FOnColumnSized = null;
      this.FOnCanSizeRow = null;
      this.FOnCanSizeColumn = null;
      this.FOnCanDragRow = null;
      this.FOnCanDragColumn = null;
      this.FOnColumnDragged = null;
      this.FOnRowDragged = null;
      this.FOnRowSize = null;
      this.FOnColumnSize = null;
      this.FOnCellNodeClick = null;
      this.FOnCanSortColumn = null;
      this.FOnColumnSorted = null;
      this.FOnCellAnchorClick = null;
      this.FOnCellClick = null;
      this.FOnFixedCellClick = null;
      this.FOnCellRightClick = null;
      this.FOnFixedCellRightClick = null;
      this.FOnGetCellReadOnly = null;
      this.FOnGetCellLayout = null;
      this.FOnGetCellIsFixed = null;
      this.FOnGetCellEditorType = null;
      this.FCellSpinBox = null;
      this.FCellColorPicker = null;
      this.FCellDatePicker = null;
      this.FCellTrackBar = null;
      this.FOnCellEditGetColor = null;
      this.FOnCellEditSetColor = null;
      this.FOnCellEditValidateColor = null;
      this.FOnGetRowIsBand = null;
      this.FOnCanDeleteRow = null;
      this.FOnCanAppendRow = null;
      this.FOnCanAppendColumn = null;
      this.FOnCanInsertRow = null;
      this.FOnDeleteRow = null;
      this.FOnAppendRow = null;
      this.FOnAppendColumn = null;
      this.FOnInsertRow = null;
      this.FOnCellAfterDraw = null;
      this.FOnCellBeforeDraw = null;
      this.FOnFixedCellDropDownButtonClick = null;
      this.FEditing = false;
      this.FFilterListBox = null;
      this.FFilterTimer = null;
      this.FOnTopLeftChanged = null;
      this.FOnCellEditCancel = null;
      this.FCellMemo = null;
      this.FOnBeforeRowDrop = null;
      this.FOnBeforeColumnDrop = null;
      this.FOnGetCellProperties = null;
      this.FAppearance = null;
      this.FOnBeforeCellEditExit = null;
      this.FAdapter = null;
      this.FOnCellButtonClick = null;
      this.FToolBarPopupMode = 0;
      this.FToolBarPopup = null;
      this.FOnCellComboCloseUp = null;
      this.FOnInternalCellEditDone = null;
      this.FDesignTimeSampleData = false;
      this.FOnFixedCellDblClick = null;
      this.FOnCellDblClick = null;
      this.FOnGetCellRotation = null;
    };
    this.$final = function () {
      this.FToolBarPopupCell = undefined;
      this.FDummyButtonBitmap = undefined;
      this.FAnimateTimer$1 = undefined;
      this.FFreeEditControlTimer = undefined;
      this.FCommentPopup = undefined;
      this.FFilterPopup = undefined;
      this.FNodeOpenBitmap = undefined;
      this.FNodeClosedBitmap = undefined;
      this.FSaveTopCell = undefined;
      this.FPrevSelection = undefined;
      this.FCellAnchor = undefined;
      this.FDragBitmap = undefined;
      this.FDragCell = undefined;
      this.FDragScrollCell = undefined;
      this.FEditCell = undefined;
      this.FEditControl = undefined;
      this.FCellEdit = undefined;
      this.FCellComboBox = undefined;
      this.FRealCell = undefined;
      this.FScrollTimer = undefined;
      this.FDragTimer = undefined;
      this.FPrevSelectedCell = undefined;
      this.FFirstCell = undefined;
      this.FSaveCell = undefined;
      this.FCellArray = undefined;
      this.FOnGetCellClass = undefined;
      this.FOnGetCellData = undefined;
      this.FOnGetCellMergeInfo = undefined;
      this.FOnCellEditSetData = undefined;
      this.FOnCellEditDone = undefined;
      this.FOnGetCellEditorCustomClassType = undefined;
      this.FOnCellEditValidateData = undefined;
      this.FOnCellEditGetData = undefined;
      this.FOnGetCellEditorProperties = undefined;
      this.FOnCellRadioButtonClick = undefined;
      this.FOnCellCheckBoxClick = undefined;
      this.FOnCellBitmapClick = undefined;
      this.FOnCellCommentClick = undefined;
      this.FOnCellSortClick = undefined;
      this.FOnRowSized = undefined;
      this.FOnColumnSized = undefined;
      this.FOnCanSizeRow = undefined;
      this.FOnCanSizeColumn = undefined;
      this.FOnCanDragRow = undefined;
      this.FOnCanDragColumn = undefined;
      this.FOnColumnDragged = undefined;
      this.FOnRowDragged = undefined;
      this.FOnRowSize = undefined;
      this.FOnColumnSize = undefined;
      this.FOnCellNodeClick = undefined;
      this.FOnCanSortColumn = undefined;
      this.FOnColumnSorted = undefined;
      this.FOnCellAnchorClick = undefined;
      this.FOnCellClick = undefined;
      this.FOnFixedCellClick = undefined;
      this.FOnCellRightClick = undefined;
      this.FOnFixedCellRightClick = undefined;
      this.FOnGetCellReadOnly = undefined;
      this.FOnGetCellLayout = undefined;
      this.FOnGetCellIsFixed = undefined;
      this.FOnGetCellEditorType = undefined;
      this.FCellSpinBox = undefined;
      this.FCellColorPicker = undefined;
      this.FCellDatePicker = undefined;
      this.FCellTrackBar = undefined;
      this.FOnCellEditGetColor = undefined;
      this.FOnCellEditSetColor = undefined;
      this.FOnCellEditValidateColor = undefined;
      this.FOnGetRowIsBand = undefined;
      this.FOnCanDeleteRow = undefined;
      this.FOnCanAppendRow = undefined;
      this.FOnCanAppendColumn = undefined;
      this.FOnCanInsertRow = undefined;
      this.FOnDeleteRow = undefined;
      this.FOnAppendRow = undefined;
      this.FOnAppendColumn = undefined;
      this.FOnInsertRow = undefined;
      this.FOnCellAfterDraw = undefined;
      this.FOnCellBeforeDraw = undefined;
      this.FOnFixedCellDropDownButtonClick = undefined;
      this.FFilterListBox = undefined;
      this.FFilterTimer = undefined;
      this.FOnTopLeftChanged = undefined;
      this.FOnCellEditCancel = undefined;
      this.FCellMemo = undefined;
      this.FOnBeforeRowDrop = undefined;
      this.FOnBeforeColumnDrop = undefined;
      this.FOnGetCellProperties = undefined;
      this.FAppearance = undefined;
      this.FOnBeforeCellEditExit = undefined;
      this.FAdapter = undefined;
      this.FOnCellButtonClick = undefined;
      this.FToolBarPopup = undefined;
      this.FOnCellComboCloseUp = undefined;
      this.FOnInternalCellEditDone = undefined;
      this.FOnFixedCellDblClick = undefined;
      this.FOnCellDblClick = undefined;
      this.FOnGetCellRotation = undefined;
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.$final.call(this);
    };
    this.SetFreezeColumns = function (Value) {
      if (this.FFreezeColumns !== Value) {
        this.FFreezeColumns = Value;
        this.UpdateControl(true,true);
      };
    };
    this.SetFreezeRows = function (Value) {
      if (this.FFreezeRows !== Value) {
        this.FFreezeRows = Value;
        this.UpdateControl(true,true);
      };
    };
    this.SetLeftCol = function (Value) {
      var cl = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      cl.Row = Math.max(this.FFixedRows,Math.min(this.FRStart,this.GetRowCount() - 1 - this.FFixedFooterRows));
      cl.Col = Math.max(this.FFixedColumns,Math.min(Value,this.GetColumnCount() - 1 - this.FFixedRightColumns));
      this.Navigate(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(cl),true);
    };
    this.SetTopRow = function (Value) {
      var cl = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      cl.Row = Math.max(this.FFixedRows,Math.min(Value,this.GetRowCount() - 1 - this.FFixedFooterRows));
      cl.Col = Math.max(this.FFixedColumns,Math.min(this.FCStart,this.GetColumnCount() - 1 - this.FFixedRightColumns));
      this.Navigate(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(cl),true);
    };
    this.SetC = function (Value) {
      this.SetControlCursor(Value);
      if (this.ChangeCursor) this.OldCursor = Value;
    };
    this.GetLeftCol = function () {
      var Result = 0;
      Result = this.FCStart;
      return Result;
    };
    this.GetTopRow = function () {
      var Result = 0;
      Result = this.FRStart;
      return Result;
    };
    this.GetCellMemo = function () {
      var Result = null;
      if (!(this.FCellMemo != null)) {
        this.FCellMemo = $mod.TTMSFNCGridMemo.$create("Create$1",[this]);
        this.FCellMemo.SetBorderStyle(pas["WEBLib.Controls"].TBorderStyle.bsNone);
        this.FCellMemo.SetAutoSize(false);
        this.FCellMemo.SetTabStop(false);
        this.FCellMemo.SetBorderStyle(pas["WEBLib.Controls"].TBorderStyle.bsNone);
        this.FCellMemo.FDoubleBuffered = false;
        this.FCellMemo.SetShowFocus(false);
        this.FCellMemo.FOnKeyDown = rtl.createCallback(this,"CellEditKeyDown");
        this.FCellMemo.FOnExit = rtl.createCallback(this,"CellExit");
      };
      Result = this.FCellMemo;
      return Result;
    };
    this.GetCellEdit = function () {
      var Result = null;
      if (!(this.FCellEdit != null)) {
        this.FCellEdit = $mod.TTMSFNCGridEdit.$create("Create$1",[this]);
        this.FCellEdit.SetBorderStyle(pas["WEBLib.Controls"].TBorderStyle.bsNone);
        this.FCellEdit.SetAutoSize(false);
        this.FCellEdit.SetShowFocus(false);
        this.FCellEdit.SetTabStop(false);
        this.FCellEdit.SetBorderStyle(pas["WEBLib.Controls"].TBorderStyle.bsNone);
        this.FCellEdit.FDoubleBuffered = false;
        this.FCellEdit.FOnKeyDown = rtl.createCallback(this,"CellEditKeyDown");
        this.FCellEdit.FOnExit = rtl.createCallback(this,"CellExit");
      };
      Result = this.FCellEdit;
      return Result;
    };
    this.GetCellSpinBox = function () {
      var Result = null;
      if (!(this.FCellSpinBox != null)) {
        this.FCellSpinBox = $mod.TTMSFNCGridSpinBox.$create("Create$1",[this]);
        this.FCellSpinBox.SetBorderStyle(pas["WEBLib.Controls"].TBorderStyle.bsNone);
        this.FCellSpinBox.FAutoSize = false;
        this.FCellSpinBox.SetShowFocus(false);
        this.FCellSpinBox.SetTabStop(false);
        this.FCellSpinBox.SetBorderStyle(pas["WEBLib.Controls"].TBorderStyle.bsNone);
        this.FCellSpinBox.FDoubleBuffered = false;
        this.FCellSpinBox.FOnKeyDown = rtl.createCallback(this,"CellControlKeyDown");
        this.FCellSpinBox.FOnExit = rtl.createCallback(this,"CellExit");
      };
      Result = this.FCellSpinBox;
      return Result;
    };
    this.GetCellColorPicker = function () {
      var Result = null;
      if (!(this.FCellColorPicker != null)) {
        this.FCellColorPicker = $mod.TTMSFNCGridColorPicker.$create("Create$1",[this]);
        this.FCellColorPicker.FCloseOnSelection = true;
        this.FCellColorPicker.SetMode(pas["WEBLib.TMSFNCColorSelector"].TTMSFNCCustomColorSelectorMode.csmExtended);
        this.FCellColorPicker.FOnKeyDown = rtl.createCallback(this,"CellComboBoxKeyDown");
        this.FCellColorPicker.FOnExit = rtl.createCallback(this,"CellExit");
      };
      Result = this.FCellColorPicker;
      return Result;
    };
    this.GetCellDatePicker = function () {
      var Result = null;
      if (!(this.FCellDatePicker != null)) {
        this.FCellDatePicker = $mod.TTMSFNCGridDatePicker.$create("Create$1",[this]);
        this.FCellDatePicker.SetShowFocus(false);
        this.FCellDatePicker.FOnKeyDown = rtl.createCallback(this,"CellComboBoxKeyDown");
        this.FCellDatePicker.FOnExit = rtl.createCallback(this,"CellExit");
      };
      Result = this.FCellDatePicker;
      return Result;
    };
    this.GetCellTrackBar = function () {
      var Result = null;
      if (!(this.FCellTrackBar != null)) {
        this.FCellTrackBar = $mod.TTMSFNCGridTrackBar.$create("Create$1",[this]);
        this.FCellTrackBar.SetShowFocus(false);
        this.FCellTrackBar.FOnKeyDown = rtl.createCallback(this,"CellControlKeyDown");
        this.FCellTrackBar.FOnExit = rtl.createCallback(this,"CellExit");
      };
      Result = this.FCellTrackBar;
      return Result;
    };
    this.GetCellComboBox = function () {
      var Result = null;
      if (!(this.FCellComboBox != null)) {
        this.FCellComboBox = $mod.TTMSFNCGridComboBox.$create("Create$1",[this]);
        this.FCellComboBox.SetStyle(pas["WEBLib.StdCtrls"].TComboBoxStyle.csDropDownList);
        this.FCellComboBox.FOnChange = rtl.createCallback(this,"CellComboBoxChange");
        this.FCellComboBox.SetShowFocus(false);
        this.FCellComboBox.FOnKeyDown = rtl.createCallback(this,"CellComboBoxKeyDown");
        this.FCellComboBox.FOnExit = rtl.createCallback(this,"CellExit");
      };
      Result = this.FCellComboBox;
      return Result;
    };
    this.GetC = function () {
      var Result = 0;
      Result = this.FCursor;
      return Result;
    };
    this.SetAppearance = function (Value) {
      if (this.FAppearance !== Value) {
        this.FAppearance.Assign(Value);
      };
    };
    this.SetAdapter = function (Value) {
      if (this.FAdapter !== Value) {
        this.FAdapter = Value;
        if (this.FBlockAdd) return;
        this.FBlockAdd = true;
        if (this.FAdapter != null) {
          this.FAdapter.SetGrid(this);
          this.FAdapter.Initialize();
        };
        this.FBlockAdd = false;
      };
    };
    this.GetBottomRow = function () {
      var Result = 0;
      Result = this.FRStop;
      return Result;
    };
    this.GetRightCol = function () {
      var Result = 0;
      Result = this.FCStop;
      return Result;
    };
    this.GetPrevFocusedCell = function () {
      var Result = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      Result.$assign(this.FPrevSelectedCell);
      return Result;
    };
    this.SetDesignTimeSampleData = function (Value) {
      this.FDesignTimeSampleData = Value;
      if (this.FDesignTimeSampleData && ((pas.Classes.TComponentStateItem.csLoading in this.FComponentState) || (pas.Classes.TComponentStateItem.csReading in this.FComponentState)) && (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState)) {
        this.LoadSampleData();
      };
    };
    this.Animate$1 = function (Sender) {
      var dx = 0.0;
      var dy = 0.0;
      var posx = 0.0;
      var posy = 0.0;
      var animh = false;
      var animv = false;
      posy = this.GetVScrollValue();
      posx = this.GetHScrollValue();
      dx = Math.abs(this.FScrollHTo$1 - posx) / Math.max(1,Math.abs(this.FSpX$1) * 6);
      dy = Math.abs(this.FScrollVTo$1 - posy) / Math.max(1,Math.abs(this.FSpY$1) * 6);
      animv = false;
      if (this.FAnimateVerticalPos$1) animv = $impl.AnimateDouble({get: function () {
          return posy;
        }, set: function (v) {
          posy = v;
        }},{p: this, get: function () {
          return this.p.FScrollVTo$1;
        }, set: function (v) {
          this.p.FScrollVTo$1 = v;
        }},dy,0.01);
      animh = false;
      if (this.FAnimateHorizontalPos$1) animh = $impl.AnimateDouble({get: function () {
          return posx;
        }, set: function (v) {
          posx = v;
        }},{p: this, get: function () {
          return this.p.FScrollHTo$1;
        }, set: function (v) {
          this.p.FScrollHTo$1 = v;
        }},dx,0.01);
      this.FAnimating$1 = animv || animh;
      if (this.FAnimating$1) {
        this.Scroll(posx,posy)}
       else {
        this.FAnimateVerticalPos$1 = false;
        this.FAnimateTimer$1.SetEnabled(false);
        this.FAnimateHorizontalPos$1 = false;
      };
    };
    this.DoFreeEditControl = function (Sender) {
      if (this.FEditControl != null) {
        rtl.free(this,"FEditControl");
        this.FEditControl = null;
      };
      this.FFreeEditControlTimer.SetEnabled(false);
    };
    this.ApplyStyle = function () {
      var c = 0;
      var I = 0;
      var J = 0;
      var cp = null;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ApplyStyle.call(this);
      this.BeginUpdate();
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleBackgroundFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) this.FFill.SetColor(c);
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleLineFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FStroke.SetColor(c);
        this.FAppearance.FFixedLayout.FStroke.SetColor(c);
        this.FAppearance.FFixedSelectedLayout.FStroke.SetColor(c);
        this.FAppearance.FSelectedLayout.FStroke.SetColor(c);
        this.FAppearance.FNormalLayout.FStroke.SetColor(c);
        this.FAppearance.FFocusedLayout.FStroke.SetColor(c);
        this.FAppearance.FBandLayout.FStroke.SetColor(c);
        this.FAppearance.FGroupLayout.FStroke.SetColor(c);
        this.FAppearance.FSummaryLayout.FStroke.SetColor(c);
      };
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleHeaderFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FAppearance.FFixedLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        this.FAppearance.FFixedLayout.FFill.SetColor(c);
      };
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleHeaderFillColorTo({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FAppearance.FFixedLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient);
        this.FAppearance.FFixedLayout.FFill.SetColorTo(c);
      };
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleSelectionFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FAppearance.FFixedSelectedLayout.FFill.SetColor(c);
        this.FAppearance.FFocusedLayout.FFill.SetColor(c);
        this.FAppearance.FSelectedLayout.FFill.SetColor(c);
        this.FAppearance.FGroupLayout.FFill.SetColor(c);
        this.FAppearance.FSummaryLayout.FFill.SetColor(c);
        this.FAppearance.FProgressLayout.SetColor(c);
        this.FAppearance.FFixedSelectedLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        this.FAppearance.FFocusedLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        this.FAppearance.FSelectedLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        this.FAppearance.FGroupLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        this.FAppearance.FSummaryLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      };
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleSelectionFillColorTo({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FAppearance.FFixedSelectedLayout.FFill.SetColorTo(c);
        this.FAppearance.FFocusedLayout.FFill.SetColorTo(c);
        this.FAppearance.FSelectedLayout.FFill.SetColorTo(c);
        this.FAppearance.FGroupLayout.FFill.SetColorTo(c);
        this.FAppearance.FSummaryLayout.FFill.SetColorTo(c);
        this.FAppearance.FFixedSelectedLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient);
        this.FAppearance.FFocusedLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient);
        this.FAppearance.FSelectedLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient);
        this.FAppearance.FGroupLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient);
        this.FAppearance.FSummaryLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient);
      };
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleTextFontColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FDefaultFont.SetColor(c);
        this.FAppearance.FFixedLayout.FFont.SetColor(c);
        this.FAppearance.FNormalLayout.FFont.SetColor(c);
        this.FAppearance.FFixedSelectedLayout.FFont.SetColor(c);
        this.FAppearance.FSelectedLayout.FFont.SetColor(c);
        this.FAppearance.FFocusedLayout.FFont.SetColor(c);
        this.FAppearance.FGroupLayout.FFont.SetColor(c);
        this.FAppearance.FSummaryLayout.FFont.SetColor(c);
      };
      this.RemoveAllCells();
      for (var $l = 0, $end = this.FRowList.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (this.FRowList.GetItem(I) != null) {
          for (var $l1 = 0, $end1 = this.FRowList.GetItem(I).FData.GetCount() - 1; $l1 <= $end1; $l1++) {
            J = $l1;
            cp = this.FRowList.GetItem(I).FData.GetObject(J);
            if (cp != null) cp.FFontColor = c;
          };
        };
      };
      this.EndUpdate();
    };
    this.SetAdaptToStyle = function (Value) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.SetAdaptToStyle.apply(this,arguments);
      if (this.FCommentPopup != null) this.FCommentPopup.SetAdaptToStyle(true);
      if (this.FFilterPopup != null) this.FFilterPopup.SetAdaptToStyle(true);
    };
    this.ResetToDefaultStyle = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ResetToDefaultStyle.call(this);
      this.FAppearance.InitializeDefaultLayout();
      this.FAppearance.SetShowFocus(true);
      this.FAppearance.FFixedLayout.FFill.SetColor(0xF9F2EE);
      this.FAppearance.FFixedLayout.FFont.SetColor(0x454545);
      this.FAppearance.FNormalLayout.FFill.SetColor(0xFCF8F6);
      this.FAppearance.FNormalLayout.FFont.SetColor(0x7A7A7A);
      this.FAppearance.FSelectedLayout.FFill.SetColor(0xFADEBB);
      this.FAppearance.FSelectedLayout.FFont.SetColor(0x454545);
      this.FAppearance.FFocusedLayout.FFill.SetColor(0xF4BD74);
      this.FAppearance.FFocusedLayout.FFont.SetColor(0x454545);
      this.FAppearance.FBandLayout.FFill.SetColor(0xFEFFFF);
      this.FAppearance.FBandLayout.FFont.SetColor(0x7A7A7A);
      this.FAppearance.FSelectedLayout.FStroke.SetColor(12632256);
      this.FAppearance.FFocusedLayout.FStroke.SetColor(12632256);
      this.FAppearance.FNormalLayout.FStroke.SetColor(12632256);
      this.FAppearance.FNormalLayout.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FAppearance.FFixedLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FAppearance.FFixedLayout.FStroke.SetColor(12632256);
      this.FAppearance.FFixedLayout.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FAppearance.FFixedLayout.FFont.SetStyle(rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsBold));
      pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.SetFontSize(this.FAppearance.FFixedLayout.FFont,14,1);
      this.FAppearance.FFixedSelectedLayout.FFont.SetColor(0);
      this.FAppearance.FFixedSelectedLayout.FStroke.SetColor(12632256);
      this.FAppearance.FFixedSelectedLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FAppearance.FSelectedLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FAppearance.FBandLayout.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FAppearance.FBandLayout.FStroke.SetColor(12632256);
      this.FAppearance.FGroupLayout.FFont.SetColor(0);
      this.FAppearance.FGroupLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FAppearance.FSummaryLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FAppearance.FSummaryLayout.FFont.SetColor(0);
      this.FAppearance.FFocusedLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FAppearance.FFocusedLayout.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FFill.SetColor(16777215);
      this.FStroke.SetColor(12632256);
      this.RemoveAllCells();
      this.UpdateGridCells(false);
    };
    this.BeforeExport = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.BeforeExport.call(this);
      this.UpdateControl(true,true);
    };
    this.AfterExport = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.AfterExport.call(this);
      this.UpdateControl(true,true);
    };
    this.ChangeDPIScale = function (M, D) {
      var I = 0;
      var J = 0;
      var cp = null;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ChangeDPIScale.apply(this,arguments);
      this.BeginUpdate();
      this.FOptions.FFiltering.FDropDownWidth = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FOptions.FFiltering.FDropDownWidth,M,D);
      this.FOptions.FFiltering.FDropDownHeight = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FOptions.FFiltering.FDropDownHeight,M,D);
      this.SetDefaultRowHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FDefaultRowHeight,M,D));
      this.SetDefaultColumnWidth(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FDefaultColumnWidth,M,D));
      this.FDefaultFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FDefaultFont.FHeight,M,D));
      this.FAppearance.FFixedLayout.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FAppearance.FFixedLayout.FFont.FHeight,M,D));
      this.FAppearance.FNormalLayout.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FAppearance.FNormalLayout.FFont.FHeight,M,D));
      this.FAppearance.FGroupLayout.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FAppearance.FGroupLayout.FFont.FHeight,M,D));
      this.FAppearance.FSummaryLayout.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FAppearance.FSummaryLayout.FFont.FHeight,M,D));
      this.FAppearance.FSelectedLayout.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FAppearance.FSelectedLayout.FFont.FHeight,M,D));
      this.FAppearance.FFocusedLayout.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FAppearance.FFocusedLayout.FFont.FHeight,M,D));
      this.FAppearance.FFixedSelectedLayout.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FAppearance.FFixedSelectedLayout.FFont.FHeight,M,D));
      this.FAppearance.FBandLayout.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FAppearance.FBandLayout.FFont.FHeight,M,D));
      this.CreateColumnProp();
      for (var $l = 0, $end = this.FColumns.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.FColumns.GetItem$1(I).FFixedFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FColumns.GetItem$1(I).FFixedFont.FHeight,M,D));
        this.FColumns.GetItem$1(I).FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FColumns.GetItem$1(I).FFont.FHeight,M,D));
      };
      for (var $l1 = this.FRowList.GetCount() - 1; $l1 >= 0; $l1--) {
        I = $l1;
        if (this.FRowList.GetItem(I) != null) {
          for (var $l2 = 0, $end1 = this.FRowList.GetItem(I).FData.GetCount() - 1; $l2 <= $end1; $l2++) {
            J = $l2;
            cp = this.FRowList.GetItem(I).FData.GetObject(J);
            if ((cp != null) && cp.IsBaseCell(J,I)) cp.FFontSize = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(cp.FFontSize,M,D);
          };
        };
      };
      this.EndUpdate();
    };
    this.SetRowSelect = function (Row, Value) {
      if (!this.FBlockUpdate && Value) {
        this.FBlockSelectEventHandler = true;
        this.SelectCell(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(pas["WEBLib.TMSFNCGridData"].MakeCell(this.FFixedColumns,Row)),rtl.createSet(pas.Classes.TShiftState$a.ssCtrl),false);
        this.FBlockSelectEventHandler = false;
      } else pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.SetRowSelect.apply(this,arguments);
    };
    this.GetColumnDisplayName = function (ACol) {
      var Result = "";
      Result = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.GetColumnDisplayName.call(this,ACol);
      if (this.FAdapter != null) Result = this.FAdapter.GetColumnDisplayName(ACol);
      return Result;
    };
    this.GetCellAppearance = function (AState, ACol, ARow) {
      var Result = null;
      var c = null;
      var rr = 0;
      var $tmp = AState;
      if ($tmp === pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellState.csNormal) {
        if (this.FGroupColumn !== -1) {
          rr = ARow;
          if (this.IsNode(rr)) {
            c = this.GetDefaultGroupLayout()}
           else if (this.IsSummary(rr)) {
            c = this.GetDefaultSummaryLayout()}
           else {
            if (this.IsBand(this.DisplToRealRow(ARow)) && this.FOptions.FBands.FEnabled) {
              c = this.GetDefaultBandLayout()}
             else c = this.GetDefaultNormalLayout();
          };
        } else {
          if (this.IsBand(this.DisplToRealRow(ARow)) && this.FOptions.FBands.FEnabled) {
            c = this.GetDefaultBandLayout()}
           else c = this.GetDefaultNormalLayout();
        };
      } else if ($tmp === pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellState.csFocused) {
        c = this.GetDefaultFocusedLayout()}
       else if ($tmp === pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellState.csFixed) {
        c = this.GetDefaultFixedLayout()}
       else if ($tmp === pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellState.csFixedSelected) {
        c = this.GetDefaultFixedSelectedLayout()}
       else if ($tmp === pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellState.csSelected) {
        c = this.GetDefaultSelectedLayout()}
       else {
        c = null;
      };
      Result = c;
      return Result;
    };
    this.GetPageScrollSize = function () {
      var Result = 0;
      if ((this.FOptions.FKeyboard.FPageScrollSize === 0) && ((this.GetVerticalScrollMax() * this.GetRowCount()) > 0)) {
        Result = Math.round((this.GetVerticalContentViewPortSize() / this.GetVerticalScrollMax()) * this.GetRowCount())}
       else Result = this.FOptions.FKeyboard.FPageScrollSize;
      return Result;
    };
    this.GetColumnViewPortSize = function () {
      var Result = 0.0;
      var I = 0;
      var cnt = 0;
      var w = 0.0;
      var contentr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result = 0;
      w = this.GetFixedWidth() + this.GetFixedRightWidth();
      cnt = 0;
      contentr.$assign(this.GetContentRect());
      for (var $l = this.GetColumnCount() - 1 - this.FFixedRightColumns; $l >= 0; $l--) {
        I = $l;
        w = w + this.GetColWidths(I);
        if (w > (contentr.Right - contentr.Left)) {
          Result = Math.max(1,cnt);
          break;
        };
        cnt += 1;
      };
      return Result;
    };
    this.GetRowViewPortSize = function () {
      var Result = 0.0;
      var I = 0;
      var cnt = 0;
      var h = 0.0;
      var contentr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result = 0;
      h = this.GetFixedHeight() + this.GetFixedFooterHeight();
      cnt = 0;
      contentr.$assign(this.GetContentRect());
      for (var $l = this.GetRowCount() - 1 - this.FFixedFooterRows; $l >= 0; $l--) {
        I = $l;
        h = h + this.GetRowHeights(I);
        if (h > (contentr.Bottom - contentr.Top)) {
          Result = Math.max(1,cnt);
          break;
        };
        cnt += 1;
      };
      return Result;
    };
    this.GetVersion = function () {
      var Result = "";
      Result = this.$class.GetVersionNumber(1,0,0,1);
      return Result;
    };
    this.GetDocURL = function () {
      var Result = "";
      Result = $mod.TTMSFNCGridDocURL;
      return Result;
    };
    this.GetHorizontalContentCount = function () {
      var Result = 0;
      Result = this.GetColumnCount() - this.FFixedColumns - this.FFreezeColumns - this.FFixedRightColumns;
      return Result;
    };
    this.GetHorizontalContentViewPortSize = function () {
      var Result = 0.0;
      Result = this.GetColumnViewPortSize();
      return Result;
    };
    this.GetVerticalContentCount = function () {
      var Result = 0;
      Result = this.GetRowCount() - this.FFixedRows - this.FFreezeRows - this.FFixedFooterRows;
      return Result;
    };
    this.GetVerticalContentViewPortSize = function () {
      var Result = 0.0;
      Result = this.GetRowViewPortSize();
      return Result;
    };
    this.GetHorizontalPos = function (AStartCol, AStopCol) {
      var Result = 0.0;
      var I = 0;
      Result = 0;
      for (var $l = AStartCol, $end = AStopCol - 1; $l <= $end; $l++) {
        I = $l;
        Result = Result + this.GetColWidths(I);
      };
      return Result;
    };
    this.GetVerticalPos = function (AStartRow, AStopRow) {
      var Result = 0.0;
      var I = 0;
      Result = 0;
      for (var $l = AStartRow, $end = AStopRow - 1; $l <= $end; $l++) {
        I = $l;
        Result = Result + this.GetRowHeights(I);
      };
      return Result;
    };
    this.DoIsCellSelected = function (ACol, ARow) {
      var Result = false;
      if (this.FOptions.FSelection.FMode in rtl.createSet(pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctRow,pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctColumn,pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctCell)) {
        Result = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoIsCellSelected.call(this,ACol,ARow)}
       else Result = (ACol >= this.FStartCell.Col) && (ARow >= this.FStartCell.Row) && (ACol <= this.FStopCell.Col) && (ARow <= this.FStopCell.Row);
      return Result;
    };
    this.DoIsFixedCellSelected = function (ACol, ARow) {
      var Result = false;
      Result = ((ACol >= this.FStartCell.Col) && (ACol <= this.FStopCell.Col) && (this.FOptions.FSelection.FMode !== pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smSingleRow) && (this.FOptions.FSelection.FMode !== pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctRow) && (this.FOptions.FSelection.FMode !== pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctCell) && (this.FOptions.FSelection.FMode !== pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smRowRange)) || ((ARow >= this.FStartCell.Row) && (ARow <= this.FStopCell.Row) && (this.FOptions.FSelection.FMode !== pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smSingleColumn) && (this.FOptions.FSelection.FMode !== pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctColumn) && (this.FOptions.FSelection.FMode !== pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctCell) && (this.FOptions.FSelection.FMode !== pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smColumnRange));
      if (this.FOptions.FSelection.FMode === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctRow) {
        Result = this.GetRowSelect(ARow)}
       else if (this.FOptions.FSelection.FMode === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctColumn) {
        Result = this.GetColumnSelect(ACol)}
       else if (this.FOptions.FSelection.FMode === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctCell) Result = this.GetFixedCellSelect(ACol,ARow);
      return Result;
    };
    this.GetDefaultFixedLayout = function () {
      var Result = null;
      Result = this.FAppearance.FFixedLayout;
      return Result;
    };
    this.GetDefaultNormalLayout = function () {
      var Result = null;
      Result = this.FAppearance.FNormalLayout;
      return Result;
    };
    this.GetDefaultGroupLayout = function () {
      var Result = null;
      Result = this.FAppearance.FGroupLayout;
      return Result;
    };
    this.GetDefaultSummaryLayout = function () {
      var Result = null;
      Result = this.FAppearance.FSummaryLayout;
      return Result;
    };
    this.GetDefaultSelectedLayout = function () {
      var Result = null;
      Result = this.FAppearance.FSelectedLayout;
      return Result;
    };
    this.GetDefaultFocusedLayout = function () {
      var Result = null;
      Result = this.FAppearance.FFocusedLayout;
      return Result;
    };
    this.GetDefaultFixedSelectedLayout = function () {
      var Result = null;
      Result = this.FAppearance.FFixedSelectedLayout;
      return Result;
    };
    this.GetDefaultBandLayout = function () {
      var Result = null;
      Result = this.FAppearance.FBandLayout;
      return Result;
    };
    this.GetNodeBitmap = function (AState) {
      var Result = null;
      var $tmp = AState;
      if ($tmp === pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridNodeState.nsOpen) {
        if (!(this.FNodeClosedBitmap != null)) this.FNodeClosedBitmap = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource$1($mod.TMSFNCGRIDCELLNODECLOSED,pas["WEBLib.TMSFNCTypes"].HInstance());
        Result = this.FNodeClosedBitmap;
      } else if ($tmp === pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridNodeState.nsClosed) {
        if (!(this.FNodeOpenBitmap != null)) this.FNodeOpenBitmap = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource$1($mod.TMSFNCGRIDCELLNODEOPEN,pas["WEBLib.TMSFNCTypes"].HInstance());
        Result = this.FNodeOpenBitmap;
      } else {
        Result = null;
      };
      return Result;
    };
    this.GetDummyButtonBitmap = function (ACell) {
      var Result = null;
      if ((this.FDummyButtonBitmap != null) && ((this.FDummyButtonBitmap.GetWidth() !== ACell.FWidth) || (this.FDummyButtonBitmap.GetHeight() !== ACell.FHeight))) {
        rtl.free(this,"FDummyButtonBitmap");
        this.FDummyButtonBitmap = null;
      };
      if (!(this.FDummyButtonBitmap != null)) {
        this.FDummyButtonBitmap = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
        this.FDummyButtonBitmap.SetSize(ACell.FButtonWidth,ACell.FButtonHeight);
      };
      Result = this.FDummyButtonBitmap;
      return Result;
    };
    this.Notification = function (AComponent, Operation) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.Notification.apply(this,arguments);
      if ((AComponent === this.FAdapter) && (Operation === pas.Classes.TOperation.opRemove)) this.SetAdapter(null);
      if ((AComponent === this.FToolBarPopup) && (Operation === pas.Classes.TOperation.opRemove)) this.FToolBarPopup = null;
    };
    this.AppearanceChanged = function (Sender) {
      this.UpdateControl(true,true);
    };
    this.DoPaintCommentPopup = function (Sender, AGraphics, ARect) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      AGraphics.FFont.SetColor(this.FActiveCommentTextColor);
      r.$assign(ARect);
      pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,-4,-4);
      AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FActiveComment,true,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,true,false,-1,-1);
    };
    this.ClearFixedSorting = function (ACell) {
      var c = 0;
      var r = 0;
      var ctl = null;
      var cell = null;
      for (var $l = 0, $end = rtl.length(this.FCellArray) - 1; $l <= $end; $l++) {
        c = $l;
        for (var $l1 = 0, $end1 = this.FFixedRows - 1; $l1 <= $end1; $l1++) {
          r = $l1;
          cell = this.FCellArray[c][r];
          if ((cell != null) && pas["WEBLib.TMSFNCGridCell"].TTMSFNCFixedGridCell.isPrototypeOf(cell) && (cell !== ACell)) {
            ctl = rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCFixedGridCell);
            ctl.FSortIndex = -1;
            ctl.FSortKind = pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridSortKind.skNone;
          };
        };
      };
    };
    this.HandleMouseLeave = function () {
      var p = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseLeave.call(this);
      if ((this.FToolBarPopup != null) && this.FToolBarPopup.Activated() && !this.FEditing) {
        p.$assign(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetMousePos());
        if (!this.FToolBarPopup.PointInPopup(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(p)) && !this.FToolBarPopup.DropDownActive()) this.FToolBarPopup.Deactivate();
      };
    };
    this.HandleDblClick = function (X, Y) {
      var pt = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var cl = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleDblClick.apply(this,arguments);
      this.FDblClick = true;
      if (this.FMouseDblClick) {
        this.FMouseDblClick = false;
        var $tmp = this.FSizeMode;
        if (($tmp === $mod.TTMSFNCGridSizeMode.smPreviousColumnSizing) || ($tmp === $mod.TTMSFNCGridSizeMode.smColumnSizing)) {
          if (this.FOptions.FMouse.FColumnAutoSizeOnDblClick) this.AutoSizeColumn(this.FDragCell.Col,true,5)}
         else if (($tmp === $mod.TTMSFNCGridSizeMode.smPreviousRowSizing) || ($tmp === $mod.TTMSFNCGridSizeMode.smRowSizing)) if (this.FOptions.FMouse.FRowAutoSizeOnDblClick) this.AutoSizeRow(this.FDragCell.Row,5);
      };
      pt.$assign(this.ScreenToLocalEx(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetMousePos())));
      cl.$assign(this.XYToCell(pt.X,pt.Y));
      if ((cl.Col !== -1) && (cl.Row !== -1)) {
        if (this.IsFixed(cl.Col,cl.Row)) {
          this.DoFixedCellDblClick(cl.Col,cl.Row)}
         else this.DoCellDblClick(cl.Col,cl.Row);
      };
      this.FClearMouseDown = true;
    };
    this.HandleMouseDown = function (Button, Shift, X, Y) {
      var cell = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      var obj = null;
      var sx = 0.0;
      var sy = 0.0;
      var fixed = false;
      var rowsz = false;
      var colsz = false;
      var allow = false;
      var bctl = false;
      var ct = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      var s = false;
      pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControl.HandleMouseDown.apply(this,arguments);
      if (!this.HideEdit(false,true)) {
        ct.$assign(this.XYToCell(X,Y));
        s = true;
        if ((ct.Col !== this.FEditCell.Col) || (ct.Row !== this.FEditCell.Row)) {
          this.CancelEdit();
          s = false;
        };
        if (s) return;
      };
      if (this.CanFocus()) this.SetFocus();
      if ((!(this.FPopupMenu != null) && (pas["WEBLib.Controls"].TMouseButton.mbRight === Button)) || (pas["WEBLib.Controls"].TMouseButton.mbRight !== Button)) this.CaptureEx();
      if (!(Button === pas["WEBLib.Controls"].TMouseButton.mbLeft)) return;
      sx = X;
      sy = Y;
      cell.$assign(this.XYToCell(X,Y));
      obj = this.GetCellObject(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(this.GetDisplayCell(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(cell))));
      if (obj != null) {
        this.FDragCell.$assign(cell);
        fixed = this.IsFixed(cell.Col,cell.Row);
        if (fixed) {
          rowsz = this.FOptions.FMouse.FFixedRowSizing;
          colsz = this.FOptions.FMouse.FFixedColumnSizing;
        } else {
          rowsz = this.FOptions.FMouse.FRowSizing;
          colsz = this.FOptions.FMouse.FColumnSizing;
        };
        if (rowsz && (((cell.Row < (this.GetRowCount() - this.FFixedFooterRows)) && fixed) || !fixed) && (sy >= ((obj.FTop + obj.FHeight) - this.FOptions.FMouse.FRowSizeMargin)) && (sx > (obj.FLeft + this.FOptions.FMouse.FColumnSizeMargin)) && (sx < ((obj.FLeft + obj.FWidth) - this.FOptions.FMouse.FColumnSizeMargin))) {
          allow = true;
          this.DoCanSizeRow(cell.Row,{get: function () {
              return allow;
            }, set: function (v) {
              allow = v;
            }});
          if (allow) {
            this.FMouseSizing = true;
            this.FSizeMode = $mod.TTMSFNCGridSizeMode.smRowSizing;
          };
        } else if (rowsz && (((cell.Row > this.FFixedRows) && fixed) || !fixed) && (sy <= (obj.FTop + this.FOptions.FMouse.FRowSizeMargin)) && (sx > (obj.FLeft + this.FOptions.FMouse.FColumnSizeMargin)) && (sx < ((obj.FLeft + obj.FWidth) - this.FOptions.FMouse.FColumnSizeMargin))) {
          allow = true;
          this.DoCanSizeRow(cell.Row - 1,{get: function () {
              return allow;
            }, set: function (v) {
              allow = v;
            }});
          if (allow) {
            this.FMouseSizing = true;
            this.FSizeMode = $mod.TTMSFNCGridSizeMode.smPreviousRowSizing;
          };
        } else if (colsz && (((cell.Col < (this.GetColumnCount() - this.FFixedRightColumns)) && fixed) || !fixed) && (sx >= ((obj.FLeft + obj.FWidth) - this.FOptions.FMouse.FColumnSizeMargin)) && (sy > (obj.FTop + this.FOptions.FMouse.FRowSizeMargin)) && (sy < ((obj.FTop + obj.FHeight) - this.FOptions.FMouse.FRowSizeMargin))) {
          allow = true;
          this.DoCanSizeColumn(cell.Col,{get: function () {
              return allow;
            }, set: function (v) {
              allow = v;
            }});
          if (allow) {
            this.FMouseSizing = true;
            this.FSizeMode = $mod.TTMSFNCGridSizeMode.smColumnSizing;
          };
        } else if (colsz && (((cell.Col > this.FFixedColumns) && fixed) || !fixed) && (sx <= (obj.FLeft - this.FOptions.FMouse.FColumnSizeMargin)) && (sy > (obj.FTop + this.FOptions.FMouse.FRowSizeMargin)) && (sy < ((obj.FTop + obj.FHeight) - this.FOptions.FMouse.FRowSizeMargin))) {
          allow = true;
          this.DoCanSizeColumn(cell.Col - 1,{get: function () {
              return allow;
            }, set: function (v) {
              allow = v;
            }});
          if (allow) {
            this.FMouseSizing = true;
            this.FSizeMode = $mod.TTMSFNCGridSizeMode.smPreviousColumnSizing;
          };
        } else {
          this.FMouseDown = true;
          this.FMouseUp$1 = true;
          bctl = false;
          if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell.isPrototypeOf(obj)) {
            bctl = false;
            rtl.as(obj,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).HandleMouseDown(Button,rtl.refSet(Shift),X,Y,{get: function () {
                return bctl;
              }, set: function (v) {
                bctl = v;
              }});
            if (bctl) this.Invalidate();
          };
          if (!bctl) {
            if (!this.IsFixed(cell.Col,cell.Row)) {
              cell.$assign(this.BaseCell(cell.Col,cell.Row));
              if ((cell.Col === this.GetFocusedCell().Col) && (cell.Row === this.GetFocusedCell().Row) && !this.FOptions.FMouse.FDirectEdit) {
                this.FMouseUp$1 = false;
                allow = true;
                this.DoCanEditCell(this.GetFocusedCell().Col,this.GetFocusedCell().Row,{get: function () {
                    return allow;
                  }, set: function (v) {
                    allow = v;
                  }});
                this.FMouseUp$1 = !allow;
                if (allow) this.EditCell(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(this.GetFocusedCell()),$mod.TTMSFNCGridEditCellStart.csNone,false,"",0);
              } else this.HideEdit(false,false);
            } else {
              this.FDragFixed = this.FOptions.FMouse.FRowDragging && ((cell.Col < this.FFixedColumns) || (cell.Col > (this.GetColumnCount() - 1 - this.FFixedRightColumns)));
              this.FDragFixed = this.FDragFixed || (((this.FOptions.FSorting.FMode !== pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSortingMode.gsmNone) || this.FOptions.FMouse.FColumnDragging) && ((cell.Row < this.FFixedRows) || (cell.Row > (this.GetRowCount() - 1 - this.FFixedFooterRows))));
            };
          };
        };
      };
      this.FTouchScrolling$1 = false;
      this.FPrevX = X;
      this.FPrevY = Y;
      this.FSizeX = this.FPrevX;
      this.FSizeY = this.FPrevY;
      this.FDragX = this.FPrevX;
      this.FDragY = this.FPrevY;
      this.FDownX$1 = this.FPrevX;
      this.FDownY$1 = this.FPrevY;
      this.FTouchX = this.FPrevX;
      this.FTouchY = this.FPrevY;
      this.FScrollX$1 = this.FPrevX;
      this.FScrollY$1 = this.FPrevY;
      this.FMouseX$1 = this.FPrevX;
      this.FMouseY$1 = this.FPrevY;
      if (this.GetHVisible()) {
        this.FScrollHTo$1 = this.GetHScrollValue()}
       else this.FScrollHTo$1 = 0;
      if (this.GetVVisible()) {
        this.FScrollVTo$1 = this.GetVScrollValue()}
       else this.FScrollVTo$1 = 0;
      this.FCellAnchor.Col = -1;
      this.FCellAnchor.Row = -1;
      this.FFirstCell.Col = -1;
      this.FFirstCell.Row = -1;
      this.FCellAnchorString = "";
      this.FDoubleSelection$1 = !this.FAnimateTimer$1.FEnabled;
      this.FTimeStart$1 = $impl.GetTickCountX();
      this.FTimeStop$1 = this.FTimeStart$1;
      this.FIsMouseDown = true;
      this.FMouseScrollingUp = false;
    };
    this.HandleMouseMove = function (Shift, X, Y) {
      var $Self = this;
      var res = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      var enablescroll = false;
      var obj = null;
      var sx = 0.0;
      var sy = 0.0;
      var fixed = false;
      var rowsz = false;
      var colsz = false;
      var cell = null;
      var g = null;
      var bmp = null;
      var dx = 0.0;
      var dy = 0.0;
      var Allow = false;
      var newsz = 0.0;
      var newposx = 0.0;
      var newposy = 0.0;
      var vss = 0.0;
      var hss = 0.0;
      var fxd = false;
      var contentr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var bctl = false;
      var cr = 0;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var f = 0.0;
      var h = 0.0;
      var v = 0.0;
      var pt = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      function ShowToolBar() {
        $Self.FToolBarPopup.SetPlacementControl($Self);
        $Self.FToolBarPopup.SetPlacement(pas["WEBLib.TMSFNCPopup"].TTMSFNCPopupPlacement.ppAbsolute);
        $Self.FToolBarPopup.FGrid = $Self;
        $Self.FToolBarPopupCell.$assign(res);
        $Self.FToolBarPopup.FGridCell.$assign($Self.FToolBarPopupCell);
        $Self.FToolBarPopup.Activate();
        pt.$assign(pas["WEBLib.TMSFNCTypes"].PointF(obj.FLeft + ((obj.FWidth - $Self.FToolBarPopup.FToolBar.GetWidth()) / 2),(obj.FTop - $Self.FToolBarPopup.FToolBar.GetHeight()) + 1));
        pt.$assign($Self.ConvertClientToScreen(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pt)));
        $Self.FToolBarPopup.FPlacementRectangle.SetLeft(pt.X);
        $Self.FToolBarPopup.FPlacementRectangle.SetTop(pt.Y);
        $Self.FToolBarPopup.FPlacementRectangle.SetRight(pt.X);
        $Self.FToolBarPopup.FPlacementRectangle.SetBottom(pt.Y);
      };
      pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControl.HandleMouseMove.apply(this,arguments);
      if (this.FMouseDown && !this.HideEdit(false,true)) return;
      if (this.FClearMouseDown) {
        this.FMouseDown = false;
        this.FClearMouseDown = false;
      };
      if (this.FDblClick) {
        this.FDblClick = false;
        this.FMouseDown = false;
        this.ReleaseCaptureEx();
      };
      this.FCellAnchor.Col = -1;
      this.FCellAnchor.Row = -1;
      this.FCellAnchorString = "";
      this.FX = X;
      this.FY = Y;
      r.$assign(this.GetContentClipRect());
      if (this.FMouseDown && ((this.FX < (this.FDownX$1 - this.FOptions.FMouse.FClickMargin)) || (this.FX > (this.FDownX$1 + this.FOptions.FMouse.FClickMargin)) || (this.FY < (this.FDownY$1 - this.FOptions.FMouse.FClickMargin)) || (this.FY > (this.FDownY$1 + this.FOptions.FMouse.FClickMargin)))) {
        if (!this.FDragFixed) {
          this.HideEdit(false,false);
          hss = this.GetCellContainerPosX();
          vss = this.GetCellContainerPosY();
          contentr.$assign(this.GetContentRect());
          this.FDoTouchScroll = this.FOptions.FMouse.FTouchScrolling && ((this.FOptions.FSelection.FMode === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smSingleCell) || (this.FOptions.FSelection.FMode === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smSingleRow) || (this.FOptions.FSelection.FMode === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smSingleColumn) || (this.FOptions.FSelection.FMode === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smNone));
          enablescroll = false;
          if (((-hss > 0) && (this.FX < this.GetFixedWidth())) || ((-hss < (this.GetTotalContentWidth() - this.GetFixedRightWidth())) && (this.FX > (contentr.Right - contentr.Left - this.GetFixedRightWidth()))) || ((-vss > 0) && (this.FY < this.GetFixedHeight())) || ((-vss < (this.GetTotalContentHeight() - this.GetFixedFooterHeight())) && (this.FY > (contentr.Bottom - contentr.Top - this.GetFixedFooterHeight())))) enablescroll = this.FOptions.FMouse.FAutoScrolling && !this.FDoTouchScroll;
          if (this.FX > (contentr.Right - contentr.Left - this.GetFixedRightWidth())) enablescroll = !(pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridFixedCellSelectionMode.fcsRow in this.FOptions.FMouse.FFixedCellSelection) && !(pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridFixedCellSelectionMode.fcsRowRange in this.FOptions.FMouse.FFixedCellSelection);
          if (this.FY > (contentr.Bottom - contentr.Top - this.GetFixedFooterHeight())) enablescroll = !(pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridFixedCellSelectionMode.fcsColumn in this.FOptions.FMouse.FFixedCellSelection) && !(pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridFixedCellSelectionMode.fcsColumnRange in this.FOptions.FMouse.FFixedCellSelection);
          this.FScrollTimer.SetEnabled(enablescroll);
          if (!this.FScrollTimer.FEnabled) {
            if (this.FOptions.FMouse.FTouchScrolling && this.FDoTouchScroll) {
              f = this.FOptions.FMouse.FTouchScrollingSensitivity;
              if (this.FScrollMode === pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControlMode.scmItemScrolling) f = f / 10;
              if (this.FTouchScrolling$1 || (Math.abs(this.FMouseX$1 - X) > 3) || (Math.abs(this.FMouseY$1 - Y) > 3)) {
                if ((Math.abs(X - this.FTouchX) > 0) || (Math.abs(Y - this.FTouchY) > 0)) {
                  this.FTouchScrolling$1 = true;
                  this.FDoubleSelection$1 = false;
                  if (this.FIsMouseDown && !this.FMouseScrollingUp) {
                    if (this.GetHVisible()) {
                      h = this.GetHScrollValue() - ((X - this.FTouchX) * f)}
                     else h = 0;
                    if (this.GetVVisible()) {
                      v = this.GetVScrollValue() - ((Y - this.FTouchY) * f)}
                     else v = 0;
                    this.Scroll(h,v);
                    this.FTouchY = Y;
                    this.FTouchX = X;
                  };
                };
              };
            } else {
              this.FMouseDragging = true;
              res.$assign(this.XYToCell(X,Y));
              if ((res.Col !== -1) && (res.Row !== -1)) {
                fxd = this.IsFixed(res.Col,res.Row);
                var $tmp = this.FOptions.FSelection.FMode;
                if ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smSingleRow) {
                  if (pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridFixedCellSelectionMode.fcsRow in this.FOptions.FMouse.FFixedCellSelection) fxd = false}
                 else if ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smSingleColumn) {
                  if (pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridFixedCellSelectionMode.fcsColumn in this.FOptions.FMouse.FFixedCellSelection) fxd = false}
                 else if ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smRowRange) {
                  if (pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridFixedCellSelectionMode.fcsRowRange in this.FOptions.FMouse.FFixedCellSelection) fxd = false}
                 else if ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smColumnRange) if (pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridFixedCellSelectionMode.fcsColumnRange in this.FOptions.FMouse.FFixedCellSelection) fxd = false;
                if (!fxd) this.SelectCell(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(res),rtl.refSet(Shift),this.FMouseDragging);
              };
            };
          };
        } else {
          if ((this.FDragCell.Col !== -1) && (this.FDragCell.Row !== -1)) {
            if (!(this.FDragBitmap != null)) {
              cell = this.GetCellObject(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(this.GetDisplayCell(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(this.FDragCell))));
              if (cell != null) {
                Allow = this.FOptions.FMouse.FColumnDragging;
                if (Allow) this.DoCanDragColumn(this.FDragCell.Col,{get: function () {
                    return Allow;
                  }, set: function (v) {
                    Allow = v;
                  }});
                if (((this.FDragCell.Row < this.FFixedRows) || (this.FDragCell.Row > (this.GetRowCount() - 1 - this.FFixedFooterRows))) && Allow) {
                  this.UpdateCursor(10);
                  this.FDragBitmap = pas["WEBLib.TMSFNCImage"].TTMSFNCImage.$create("Create$1",[$Self]);
                  this.FDragBitmap.SetWidth(Math.round(cell.FWidth) + 2);
                  this.FDragBitmap.SetHeight(Math.round(Math.min(this.GetHeight(),r.Bottom - r.Top)) + 2);
                  dx = -cell.FLeft;
                  this.FDragBitmap.SetLeft(Math.round(-dx));
                  this.FDragBitmap.SetTop(0);
                  g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[Math.round(this.FDragBitmap.GetWidth()),Math.round(this.FDragBitmap.GetHeight()),false,true]);
                  g.BeginScene();
                  g.FBitmapContainer = this.GetBitmapContainer();
                  g.FOptimizedHTMLDrawing = this.FOptimizedHTMLDrawing;
                  bmp = this.MakeScreenshot();
                  try {
                    g.BeginScene();
                    g.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,this.FDragBitmap.GetWidth(),this.FDragBitmap.GetHeight())),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
                    g.DrawBitmapPart$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(this.FDragBitmap.GetLeft(),this.FDragBitmap.GetTop(),(this.FDragBitmap.GetLeft() + this.FDragBitmap.GetWidth()) - 2,(this.FDragBitmap.GetTop() + this.FDragBitmap.GetHeight()) - 2)),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,this.FDragBitmap.GetWidth(),this.FDragBitmap.GetHeight())),bmp,true,false,true,false);
                    g.EndScene();
                    this.FDragBitmap.FBitmaps.AddDrawBitmap(g.FBitmap,1.0);
                  } finally {
                    bmp = rtl.freeLoc(bmp);
                    g.EndScene();
                    g = rtl.freeLoc(g);
                  };
                  this.FDraggingMode = $mod.TTMSFNCGridDraggingMode.dmColumnDragging;
                  this.FSaveDragX = this.FDragBitmap.GetLeft();
                  this.FDragBitmap.SetParent($Self);
                  this.FDragX = this.FX;
                  this.FDragY = this.FY;
                } else {
                  Allow = this.FOptions.FMouse.FRowDragging;
                  if (Allow) this.DoCanDragRow(this.FDragCell.Row,{get: function () {
                      return Allow;
                    }, set: function (v) {
                      Allow = v;
                    }});
                  if (((this.FDragCell.Col < this.FFixedColumns) || (this.FDragCell.Col > (this.GetColumnCount() - 1 - this.FFixedRightColumns))) && Allow) {
                    this.UpdateCursor(10);
                    this.FDragBitmap = pas["WEBLib.TMSFNCImage"].TTMSFNCImage.$create("Create$1",[$Self]);
                    this.FDragBitmap.SetWidth(Math.round(Math.min(this.GetWidth(),r.Right - r.Left)) + 2);
                    this.FDragBitmap.SetHeight(Math.round(cell.FHeight) + 2);
                    dy = -cell.FTop;
                    this.FDragBitmap.SetLeft(0);
                    this.FDragBitmap.SetTop(Math.round(-dy));
                    g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[Math.round(this.FDragBitmap.GetWidth()),Math.round(this.FDragBitmap.GetHeight()),false,true]);
                    g.BeginScene();
                    g.FOptimizedHTMLDrawing = this.FOptimizedHTMLDrawing;
                    g.FBitmapContainer = this.GetBitmapContainer();
                    bmp = this.MakeScreenshot();
                    try {
                      g.BeginScene();
                      g.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,this.FDragBitmap.GetWidth(),this.FDragBitmap.GetHeight())),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
                      g.DrawBitmapPart$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(this.FDragBitmap.GetLeft(),this.FDragBitmap.GetTop(),(this.FDragBitmap.GetLeft() + this.FDragBitmap.GetWidth()) - 2,(this.FDragBitmap.GetTop() + this.FDragBitmap.GetHeight()) - 2)),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,this.FDragBitmap.GetWidth(),this.FDragBitmap.GetHeight())),bmp,true,false,true,false);
                      g.EndScene();
                      this.FDragBitmap.FBitmaps.AddDrawBitmap(g.FBitmap,1.0);
                    } finally {
                      bmp = rtl.freeLoc(bmp);
                      g.EndScene();
                      g = rtl.freeLoc(g);
                    };
                    this.FDraggingMode = $mod.TTMSFNCGridDraggingMode.dmRowDragging;
                    this.FSaveDragY = this.FDragBitmap.GetTop();
                    this.FDragBitmap.SetParent($Self);
                    this.FDragX = this.FX;
                    this.FDragY = this.FY;
                  };
                };
              };
            } else {
              if (((this.FDragCell.Row < this.FFixedRows) || (this.FDragCell.Row > (this.GetRowCount() - 1 - this.FFixedFooterRows))) && this.FOptions.FMouse.FColumnDragging) {
                newposx = this.FSaveDragX + (this.FX - this.FDragX);
                if ((newposx <= (r.Right - r.Left - this.FDragBitmap.GetWidth())) && (newposx >= 0)) {
                  this.FDragBitmap.SetLeft(Math.round(Math.max(0,Math.min(r.Right - r.Left - this.FDragBitmap.GetWidth(),newposx))));
                  this.FSaveDragX = this.FDragBitmap.GetLeft();
                  this.FDragTimer.SetEnabled(false);
                  if ((newposx > this.GetFixedWidth()) && (newposx < (r.Right - r.Left - this.GetFixedRightWidth()))) this.FDragScrollCell.$assign(this.XYToCell(newposx,(r.Bottom - r.Top) / 2));
                } else if (newposx > (r.Right - r.Left - this.FDragBitmap.GetWidth())) {
                  this.FDragBitmap.SetLeft(Math.round(r.Right - r.Left - this.FDragBitmap.GetWidth()));
                  this.FSaveDragX = newposx;
                  this.FDragTimer.SetEnabled(true);
                } else if (newposx < 0) {
                  this.FDragBitmap.SetLeft(0);
                  this.FSaveDragX = newposx;
                  this.FDragTimer.SetEnabled(true);
                };
                this.FDragX = this.FX;
                this.FDragY = this.FY;
              } else if (((this.FDragCell.Col < this.FFixedColumns) || (this.FDragCell.Col > (this.GetColumnCount() - 1 - this.FFixedRightColumns))) && this.FOptions.FMouse.FRowDragging) {
                newposy = this.FSaveDragY + (this.FY - this.FDragY);
                if (newposy <= (r.Bottom - r.Top - this.FDragBitmap.GetHeight())) {
                  this.FDragBitmap.SetTop(Math.round(Math.max(0,Math.min(r.Bottom - r.Top - this.FDragBitmap.GetHeight(),newposy))));
                  this.FSaveDragY = this.FDragBitmap.GetTop();
                  this.FDragTimer.SetEnabled(false);
                  if ((newposy > this.GetFixedHeight()) && (newposy < (r.Bottom - r.Top - this.GetFixedFooterHeight()))) this.FDragScrollCell.$assign(this.XYToCell((r.Right - r.Left) / 2,newposy));
                } else if (newposy > (r.Bottom - r.Top - this.FDragBitmap.GetHeight())) {
                  this.FDragBitmap.SetTop(Math.round(r.Bottom - r.Top - this.FDragBitmap.GetHeight()));
                  this.FSaveDragY = newposy;
                  this.FDragTimer.SetEnabled(true);
                };
                this.FDragX = this.FX;
                this.FDragY = this.FY;
              };
              if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetLocalRect(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y))) {
                this.UpdateCursor(10)}
               else this.UpdateCursor(13);
            };
          };
        };
      } else if (!this.FMouseSizing) {
        sx = X;
        sy = Y;
        res.$assign(this.XYToCell(X,Y));
        if ((res.Col !== -1) && (res.Row !== -1)) {
          obj = this.GetCellObject(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(this.GetDisplayCell(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(res))));
          if (obj != null) {
            fixed = this.IsFixed(res.Col,res.Row);
            if ((this.FToolBarPopup != null) && (this.FToolBarPopupMode !== $mod.TTMSFNCGridCustomToolBarPopupMode.tpmNone)) {
              if (this.FToolBarPopupMode === $mod.TTMSFNCGridCustomToolBarPopupMode.tpmActiveCell) {
                if ((res.Col === this.GetFocusedCell().Col) && (res.Row === this.GetFocusedCell().Row) && !this.FToolBarPopup.Activated()) ShowToolBar();
                if (((res.Col !== this.GetFocusedCell().Col) || (res.Row !== this.GetFocusedCell().Row)) && (this.FToolBarPopup != null) && this.FToolBarPopup.Activated() && !this.FToolBarPopup.DropDownActive()) this.FToolBarPopup.Deactivate();
              };
              if (this.FToolBarPopupMode in rtl.createSet($mod.TTMSFNCGridCustomToolBarPopupMode.tpmHoverCell,$mod.TTMSFNCGridCustomToolBarPopupMode.tpmHoverNormalCell)) {
                if (((res.Col !== this.FToolBarPopupCell.Col) || (res.Row !== this.FToolBarPopupCell.Row)) && !this.FToolBarPopup.Activated()) {
                  if (!fixed || (this.FToolBarPopupMode === $mod.TTMSFNCGridCustomToolBarPopupMode.tpmHoverCell)) ShowToolBar();
                };
                if (((res.Col !== this.FToolBarPopupCell.Col) || (res.Row !== this.FToolBarPopupCell.Row)) && this.FToolBarPopup.Activated() && !this.FToolBarPopup.DropDownActive()) this.FToolBarPopup.Deactivate();
              };
            };
            if (fixed) {
              rowsz = this.FOptions.FMouse.FFixedRowSizing;
              colsz = this.FOptions.FMouse.FFixedColumnSizing;
            } else {
              rowsz = this.FOptions.FMouse.FRowSizing;
              colsz = this.FOptions.FMouse.FColumnSizing;
            };
            if (rowsz && (res.Row > this.FFixedRows) && (sy <= (obj.FTop + this.FOptions.FMouse.FRowSizeMargin)) && (sx > (obj.FLeft + this.FOptions.FMouse.FColumnSizeMargin)) && (sx < ((obj.FLeft + obj.FWidth) - this.FOptions.FMouse.FColumnSizeMargin))) {
              Allow = true;
              this.DoCanSizeRow(res.Row - 1,{get: function () {
                  return Allow;
                }, set: function (v) {
                  Allow = v;
                }});
              if (Allow) this.UpdateCursor(7);
            } else if (rowsz && (((res.Row < (this.GetRowCount() - this.FFixedRows)) && fixed) || !fixed) && (sy >= ((obj.FTop + obj.FHeight) - this.FOptions.FMouse.FRowSizeMargin)) && (sx > (obj.FLeft + this.FOptions.FMouse.FColumnSizeMargin)) && (sx < ((obj.FLeft + obj.FWidth) - this.FOptions.FMouse.FColumnSizeMargin))) {
              Allow = true;
              this.DoCanSizeRow(res.Row,{get: function () {
                  return Allow;
                }, set: function (v) {
                  Allow = v;
                }});
              if (Allow) this.UpdateCursor(7);
            } else if (colsz && (res.Col > this.FFixedColumns) && (sx <= (obj.FLeft - this.FOptions.FMouse.FColumnSizeMargin)) && (sy > (obj.FTop + this.FOptions.FMouse.FRowSizeMargin)) && (sy < ((obj.FTop + obj.FHeight) - this.FOptions.FMouse.FRowSizeMargin))) {
              Allow = true;
              this.DoCanSizeColumn(res.Col - 1,{get: function () {
                  return Allow;
                }, set: function (v) {
                  Allow = v;
                }});
              if (Allow) this.UpdateCursor(9);
            } else if (colsz && (((res.Col < (this.GetColumnCount() - this.FFixedColumns)) && fixed) || !fixed) && (sx >= ((obj.FLeft + obj.FWidth) - this.FOptions.FMouse.FColumnSizeMargin)) && (sy > (obj.FTop + this.FOptions.FMouse.FRowSizeMargin)) && (sy < ((obj.FTop + obj.FHeight) - this.FOptions.FMouse.FRowSizeMargin))) {
              Allow = true;
              this.DoCanSizeColumn(res.Col,{get: function () {
                  return Allow;
                }, set: function (v) {
                  Allow = v;
                }});
              if (Allow) this.UpdateCursor(9);
            } else {
              if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell.isPrototypeOf(obj)) {
                bctl = false;
                cr = this.OldCursor;
                rtl.as(obj,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).HandleMouseMove(rtl.refSet(Shift),X,Y,{get: function () {
                    return bctl;
                  }, set: function (v) {
                    bctl = v;
                  }},{get: function () {
                    return cr;
                  }, set: function (v) {
                    cr = v;
                  }});
                if (bctl) {
                  this.UpdateCursor(cr);
                  this.Invalidate();
                };
                if (!bctl) {
                  if (rtl.as(obj,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).IsHTML()) {
                    this.FCellAnchorString = rtl.as(obj,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).XYToAnchor(X,Y)}
                   else {
                    this.FCellAnchorString = rtl.as(obj,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).FText;
                    if (!pas["WEBLib.TMSFNCGridDataUtil"].IsURL(this.FCellAnchorString)) this.FCellAnchorString = "";
                  };
                  if ((this.FCellAnchorString !== "") && this.FOptions.FURL.FShow) {
                    this.UpdateCursor(21)}
                   else this.UpdateCursor(this.OldCursor);
                };
              };
            };
          };
        } else this.UpdateCursor(this.OldCursor);
      } else {
        if ((this.FDragCell.Col !== -1) && (this.FDragCell.Col !== -1)) {
          this.HideEdit(false,false);
          var $tmp1 = this.FSizeMode;
          if ($tmp1 === $mod.TTMSFNCGridSizeMode.smColumnSizing) {
            newsz = this.GetColWidths(this.FDragCell.Col) + (this.FX - this.FSizeX);
            this.DoColumnSize(this.FDragCell.Col,{get: function () {
                return newsz;
              }, set: function (v) {
                newsz = v;
              }});
            this.SetColWidths(this.FDragCell.Col,newsz);
          } else if ($tmp1 === $mod.TTMSFNCGridSizeMode.smRowSizing) {
            newsz = this.GetRowHeights(this.FDragCell.Row) + (this.FY - this.FSizeY);
            this.DoRowSize(this.FDragCell.Row,{get: function () {
                return newsz;
              }, set: function (v) {
                newsz = v;
              }});
            this.SetRowHeights(this.FDragCell.Row,newsz);
          } else if ($tmp1 === $mod.TTMSFNCGridSizeMode.smPreviousColumnSizing) {
            newsz = this.GetColWidths(this.FDragCell.Col - 1) + (this.FX - this.FSizeX);
            this.DoColumnSize(this.FDragCell.Col - 1,{get: function () {
                return newsz;
              }, set: function (v) {
                newsz = v;
              }});
            this.SetColWidths(this.FDragCell.Col - 1,newsz);
          } else if ($tmp1 === $mod.TTMSFNCGridSizeMode.smPreviousRowSizing) {
            newsz = this.GetRowHeights(this.FDragCell.Row - 1) + (this.FY - this.FSizeY);
            this.DoRowSize(this.FDragCell.Row - 1,{get: function () {
                return newsz;
              }, set: function (v) {
                newsz = v;
              }});
            this.SetRowHeights(this.FDragCell.Row - 1,newsz);
          };
          this.FSizeX = this.FX;
          this.FSizeY = this.FY;
          this.UpdateControl(true,true);
          this.FSizing = true;
        };
      };
    };
    this.HandleMouseUp = function (Button, Shift, X, Y) {
      var res = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      var Allow = false;
      var obj = null;
      var fxd = false;
      var bctl = false;
      var b = false;
      var f = 0.0;
      pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControl.HandleMouseUp.apply(this,arguments);
      if (!this.HideEdit(false,true)) return;
      this.ReleaseCaptureEx();
      if (!(Button === pas["WEBLib.Controls"].TMouseButton.mbLeft)) {
        if (Button === pas["WEBLib.Controls"].TMouseButton.mbRight) {
          res.$assign(this.XYToCell(X,Y));
          if ((res.Col !== -1) && (res.Row !== -1)) {
            fxd = this.IsFixed(res.Col,res.Row);
            if (fxd) {
              this.DoFixedCellRightClick(res.Col,res.Row)}
             else this.DoCellRightClick(res.Col,res.Row);
          };
        };
        return;
      };
      if (!this.FIsMouseDown) return;
      this.FMouseScrollingUp = true;
      this.FIsMouseDown = false;
      this.FScrollTimer.SetEnabled(false);
      this.FDragTimer.SetEnabled(false);
      if (this.FSizing) {
        var $tmp = this.FSizeMode;
        if ($tmp === $mod.TTMSFNCGridSizeMode.smColumnSizing) {
          this.DoColumnSized(this.FDragCell.Col,this.GetColWidths(this.FDragCell.Col))}
         else if ($tmp === $mod.TTMSFNCGridSizeMode.smRowSizing) {
          this.DoRowSized(this.FDragCell.Row,this.GetRowHeights(this.FDragCell.Row))}
         else if ($tmp === $mod.TTMSFNCGridSizeMode.smPreviousColumnSizing) {
          this.DoColumnSized(this.FDragCell.Col - 1,this.GetColWidths(this.FDragCell.Col - 1))}
         else if ($tmp === $mod.TTMSFNCGridSizeMode.smPreviousRowSizing) this.DoRowSized(this.FDragCell.Row - 1,this.GetRowHeights(this.FDragCell.Row - 1));
        this.UpdateControl(true,true);
      };
      if (this.FDragBitmap != null) {
        this.FDragBitmap.SetParent(null);
        rtl.free(this,"FDragBitmap");
        this.FDragBitmap = null;
      };
      if (!this.FDoubleSelection$1 && this.FOptions.FMouse.FTouchScrolling && this.FDoTouchScroll) {
        f = this.FOptions.FMouse.FTouchScrollingSensitivity;
        if (this.FScrollMode === pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControlMode.scmItemScrolling) f = f / 10;
        this.FTimeStop$1 = $impl.GetTickCountX();
        if (((this.FTimeStop$1 - this.FTimeStart$1) < 300) && ((this.FTimeStop$1 - this.FTimeStart$1) > 0)) {
          this.FSpY$1 = Math.abs(Y - this.FScrollY$1) / (this.FTimeStop$1 - this.FTimeStart$1);
          if (this.FSpY$1 > 0) {
            if (this.GetVVisible()) {
              if ((Y - this.FScrollY$1) > 0) {
                this.FScrollVTo$1 = Math.max(0,Math.min(this.GetVMax() - this.GetVViewPortSize(),this.FScrollVTo$1 - Math.round(Math.abs(Y - this.FScrollY$1) * this.FSpY$1 * f * 3)))}
               else this.FScrollVTo$1 = Math.max(0,Math.min(this.GetVMax() - this.GetVViewPortSize(),this.FScrollVTo$1 + Math.round(Math.abs(Y - this.FScrollY$1) * this.FSpY$1 * f * 3)));
            } else this.FScrollVTo$1 = 0;
            this.FAnimateVerticalPos$1 = true;
            this.FAnimateTimer$1.SetEnabled(true);
          };
          this.FSpX$1 = Math.abs(X - this.FScrollX$1) / (this.FTimeStop$1 - this.FTimeStart$1);
          if (this.FSpX$1 > 0) {
            if (this.GetHVisible()) {
              if ((X - this.FScrollX$1) > 0) {
                this.FScrollHTo$1 = Math.max(0,Math.min(this.GetHMax() - this.GetHViewPortSize(),this.FScrollHTo$1 - Math.round(Math.abs(X - this.FScrollX$1) * this.FSpX$1 * f * 3)))}
               else this.FScrollHTo$1 = Math.max(0,Math.min(this.GetHMax() - this.GetHViewPortSize(),this.FScrollHTo$1 + Math.round(Math.abs(X - this.FScrollX$1) * this.FSpX$1 * f * 3)));
            } else this.FScrollHTo$1 = 0;
            this.FAnimateHorizontalPos$1 = true;
            this.FAnimateTimer$1.SetEnabled(true);
          };
        };
      };
      bctl = false;
      if (this.FMouseUp$1) {
        res.$assign(this.XYToCell(X,Y));
        if ((res.Col !== -1) && (res.Row !== -1)) {
          obj = this.GetCellObject(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(this.GetDisplayCell(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(res))));
          if (obj != null) {
            this.FCellAnchor.Col = -1;
            this.FCellAnchor.Row = -1;
            if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell.isPrototypeOf(obj) && !this.FMouseDragging) {
              bctl = false;
              rtl.as(obj,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).HandleMouseUp(Button,rtl.refSet(Shift),X,Y,{get: function () {
                  return bctl;
                }, set: function (v) {
                  bctl = v;
                }});
              if (bctl) this.Invalidate();
              if (rtl.as(obj,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).IsHTML()) {
                this.FCellAnchorString = rtl.as(obj,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).XYToAnchor(X,Y)}
               else {
                this.FCellAnchorString = rtl.as(obj,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).FText;
                if (!pas["WEBLib.TMSFNCGridDataUtil"].IsURL(this.FCellAnchorString) || !this.FOptions.FURL.FShow) this.FCellAnchorString = "";
              };
              if (this.FCellAnchorString !== "") this.FCellAnchor.$assign(res);
            };
          };
          if (!bctl) {
            if ((this.FCellAnchor.Col === -1) && (this.FCellAnchor.Row === -1) && (this.FCellAnchorString === "")) {
              fxd = this.IsFixed(res.Col,res.Row);
              var $tmp1 = this.FOptions.FSelection.FMode;
              if ($tmp1 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smCellRange) {
                if ((pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridFixedCellSelectionMode.fcsAll in this.FOptions.FMouse.FFixedCellSelection) && (res.Col < this.FFixedColumns) && (res.Row < this.FFixedRows)) fxd = false;
              } else if ($tmp1 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smSingleRow) {
                if (pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridFixedCellSelectionMode.fcsRow in this.FOptions.FMouse.FFixedCellSelection) fxd = false}
               else if ($tmp1 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smSingleColumn) {
                if (pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridFixedCellSelectionMode.fcsColumn in this.FOptions.FMouse.FFixedCellSelection) fxd = false}
               else if ($tmp1 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smRowRange) {
                if (pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridFixedCellSelectionMode.fcsRowRange in this.FOptions.FMouse.FFixedCellSelection) fxd = false}
               else if ($tmp1 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smColumnRange) {
                if (pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridFixedCellSelectionMode.fcsColumnRange in this.FOptions.FMouse.FFixedCellSelection) fxd = false}
               else if ($tmp1 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctRow) {
                if (pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridFixedCellSelectionMode.fcsDisjunctRow in this.FOptions.FMouse.FFixedCellSelection) fxd = false}
               else if ($tmp1 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctColumn) if (pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridFixedCellSelectionMode.fcsDisjunctColumn in this.FOptions.FMouse.FFixedCellSelection) fxd = false;
              if (!fxd && !this.FDragFixed && !this.FTouchScrolling$1) {
                this.SelectCell(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(res),rtl.refSet(Shift),this.FMouseDragging);
                this.DoCellClick(res.Col,res.Row);
                if (!this.FMouseDragging && this.FOptions.FMouse.FDirectEdit) {
                  Allow = true;
                  this.DoCanEditCell(this.GetFocusedCell().Col,this.GetFocusedCell().Row,{get: function () {
                      return Allow;
                    }, set: function (v) {
                      Allow = v;
                    }});
                  if (Allow) this.EditCell(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(this.GetFocusedCell()),$mod.TTMSFNCGridEditCellStart.csNone,false,"",0);
                };
              } else {
                if (this.FDraggingMode === $mod.TTMSFNCGridDraggingMode.dmColumnDragging) {
                  b = true;
                  this.DoBeforeColumnDrop(this.FDragCell.Col,{p: res, get: function () {
                      return this.p.Col;
                    }, set: function (v) {
                      this.p.Col = v;
                    }},{get: function () {
                      return b;
                    }, set: function (v) {
                      b = v;
                    }});
                  if (b) {
                    this.BeginUpdate();
                    this.MoveColumn(this.FDragCell.Col,res.Col);
                    this.EndUpdate();
                    this.DoColumnDragged(this.FDragCell.Col,res.Col);
                  };
                } else if (this.FDraggingMode === $mod.TTMSFNCGridDraggingMode.dmRowDragging) {
                  b = true;
                  this.DoBeforeRowDrop(this.FDragCell.Row,{p: res, get: function () {
                      return this.p.Row;
                    }, set: function (v) {
                      this.p.Row = v;
                    }},{get: function () {
                      return b;
                    }, set: function (v) {
                      b = v;
                    }});
                  if (b) {
                    this.BeginUpdate();
                    this.MoveRow(this.FDragCell.Row,res.Row);
                    this.EndUpdate();
                    this.DoRowDragged(this.FDragCell.Row,res.Row);
                  };
                } else this.DoFixedCellClick(rtl.refSet(Shift),res.Col,res.Row);
              };
            } else this.DoCellAnchorClick(this.FCellAnchor.Col,this.FCellAnchor.Row,this.FCellAnchorString);
          };
        };
      };
      this.FTouchScrolling$1 = false;
      this.FDraggingMode = $mod.TTMSFNCGridDraggingMode.dmNone;
      this.FDragFixed = false;
      this.FFirstCell.Row = -1;
      this.FFirstCell.Col = -1;
      this.FMouseDown = false;
      this.FMouseUp$1 = false;
      this.FMouseDragging = false;
      this.FMouseDblClick = this.FMouseSizing;
      this.FMouseSizing = false;
      this.FSizing = false;
    };
    this.HandleMouseWheel = function (Shift, WheelDelta, Handled) {
      var sel = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      var cl = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      var r = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseWheel.apply(this,arguments);
      if (Handled.get()) return;
      if ((pas.Classes.TShiftState$a.ssCtrl in Shift) || this.FOptions.FMouse.FWheelScrollKeepSelection) {
        if (WheelDelta > 0) {
          this.SetTopRow(this.GetTopRow() - this.FOptions.FMouse.FWheelScrollSize)}
         else this.SetTopRow(this.GetTopRow() + this.FOptions.FMouse.FWheelScrollSize);
        r = this.GetTopRow();
        cl.$assign(this.BaseCell(this.GetLeftCol(),r));
        this.SetTopRow(cl.Row);
      } else {
        sel.$assign(this.GetFocusedCell());
        if (WheelDelta > 0) {
          sel.Row = sel.Row - this.FOptions.FMouse.FWheelScrollSize}
         else sel.Row = sel.Row + this.FOptions.FMouse.FWheelScrollSize;
        cl.$assign(this.BaseCell(sel.Col,sel.Row));
        sel.$assign(cl);
        this.CancelEdit();
        this.SelectCell(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(sel),rtl.refSet(Shift),false);
      };
      Handled.set(true);
    };
    this.HandleKeyDown = function (Key, Shift) {
      var sel = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      var real = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      var cs = 0;
      var rs = 0;
      var i = 0;
      var j = 0;
      var Allow = false;
      if (Key.get() === 9) return;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleKeyDown.apply(this,arguments);
      if (Key.get() in rtl.createSet(27,45,46,38,40,37,39,36,35,33,34,9)) this.FLookupString = "";
      if (this.FOptions.FEditing.FEnabled) {
        Allow = true;
        this.DoCanEditCell(this.GetFocusedCell().Col,this.GetFocusedCell().Row,{get: function () {
            return Allow;
          }, set: function (v) {
            Allow = v;
          }});
        if (Allow) {
          if ((Key.get() === 113) || (Key.get() === 13)) {
            this.EditCell(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(this.GetFocusedCell()),$mod.TTMSFNCGridEditCellStart.csNone,false,"",0);
            return;
          };
        };
      };
      if (Key.get() === 32) {
        Key.set(32);
        if ((this.GetFocusedCell().Row !== -1) && (this.GetFocusedCell().Col !== -1)) this.DoCellKeyDown(this.GetFocusedCell().Col,this.GetFocusedCell().Row,Key,rtl.refSet(Shift));
        return;
      };
      this.FPrevSelectedCell.$assign(this.GetFocusedCell());
      if ((pas.Classes.TShiftState$a.ssShift in Shift) && !(pas.Classes.TShiftState$a.ssCtrl in Shift) && !(pas.Classes.TShiftState$a.ssAlt in Shift) && (Key.get() === 45) && !this.FEditing && this.FOptions.FClipboard.FEnabled) this.PasteFromClipboard();
      if ((pas.Classes.TShiftState$a.ssCtrl in Shift) && !(pas.Classes.TShiftState$a.ssShift in Shift) && !(pas.Classes.TShiftState$a.ssAlt in Shift)) {
        var $tmp = Key.get();
        if ($tmp === 77) {
          if (this.FOptions.FKeyboard.FAllowCellMergeShortCut) this.MergeSelection(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRecRange.$clone(this.GetSelection()))}
         else if ($tmp === 83) {
          if (this.FOptions.FKeyboard.FAllowCellMergeShortCut) this.SplitCell(this.GetSelection().StartCol,this.GetSelection().StartRow)}
         else if ($tmp === 88) {
          if (this.FOptions.FClipboard.FEnabled && !this.FEditing) this.CutToClipboard(true);
        } else if ($tmp === 67) {
          if (this.FOptions.FClipboard.FEnabled && !this.FEditing) this.CopyToClipboard(true);
        } else if ($tmp === 86) {
          if (this.FOptions.FClipboard.FEnabled && !this.FEditing) this.PasteFromClipboard();
        } else if ($tmp === 65) {
          if (this.FOptions.FSelection.FMode in rtl.createSet(pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smCellRange,pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smRowRange,pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smColumnRange,pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctCell,pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctColumn,pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctRow)) {
            this.SetStartCell(this.FFixedColumns,this.FFixedRows);
            this.SetStopCell(this.GetColumnCount() - 1 - this.FFixedRightColumns,this.GetRowCount() - 1 - this.FFixedFooterRows);
            this.SetFocusCell(this.FFixedColumns,this.FFixedRows);
          };
          if (this.FOptions.FSelection.FMode in rtl.createSet(pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctRow)) {
            this.FBlockUpdate = true;
            for (var $l = this.FFixedRows, $end = this.GetRowCount() - this.FFixedFooterRows - 1; $l <= $end; $l++) {
              i = $l;
              this.SetRowSelect(i,true);
            };
            this.FBlockUpdate = false;
          };
          if (this.FOptions.FSelection.FMode in rtl.createSet(pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctColumn)) {
            this.FBlockUpdate = true;
            for (var $l1 = this.FFixedColumns, $end1 = this.GetColumnCount() - 1 - this.FFixedRightColumns; $l1 <= $end1; $l1++) {
              i = $l1;
              this.SetColumnSelect(i,true);
            };
            this.FBlockUpdate = false;
          };
          if (this.FOptions.FSelection.FMode in rtl.createSet(pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctCell)) {
            this.FBlockUpdate = true;
            for (var $l2 = this.FFixedColumns, $end2 = this.GetColumnCount() - 1 - this.FFixedRightColumns; $l2 <= $end2; $l2++) {
              i = $l2;
              for (var $l3 = this.FFixedRows, $end3 = this.GetRowCount() - this.FFixedFooterRows - 1; $l3 <= $end3; $l3++) {
                j = $l3;
                this.SetCellSelect(i,j,true);
              };
            };
            this.FBlockUpdate = false;
          };
          this.Navigate(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(this.GetFocusedCell()),false);
          if (this.FOnSelectedCell != null) this.FOnSelectedCell(this,this.GetFocusedCell().Col,this.GetFocusedCell().Row);
        } else if ($tmp === 46) {
          if (this.FOptions.FClipboard.FEnabled) this.CutToClipboard(true);
        } else if ($tmp === 45) {
          if (this.FOptions.FClipboard.FEnabled) this.CopyToClipboard(true);
        } else if ($tmp === 34) {
          this.SetTopRow(this.GetTopRow() + this.GetPageScrollSize())}
         else if ($tmp === 33) {
          this.SetTopRow(this.GetTopRow() - this.GetPageScrollSize())}
         else if ($tmp === 38) {
          this.SetTopRow(this.GetTopRow() - 1);
        } else if ($tmp === 40) {
          rs = this.RowSpan(this.GetLeftCol(),this.GetTopRow());
          if (rs > 0) {
            this.SetTopRow(this.GetTopRow() + rs)}
           else this.SetTopRow(this.GetTopRow() + 1);
        } else if ($tmp === 37) {
          this.SetLeftCol(this.GetLeftCol() - 1)}
         else if ($tmp === 39) {
          cs = this.ColSpan(this.GetLeftCol(),this.GetTopRow());
          if (cs > 0) {
            this.SetLeftCol(this.GetLeftCol() + cs)}
           else this.SetLeftCol(this.GetLeftCol() + 1);
        } else if ($tmp === 36) {
          this.SetTopRow(this.FFixedRows)}
         else if ($tmp === 35) this.SetTopRow(this.GetRowCount() - 1 - this.FFixedFooterRows);
      } else {
        sel.$assign(this.GetFocusedCell());
        real.$assign(this.FRealCell);
        var $tmp1 = Key.get();
        if ($tmp1 === 46) {
          if (rtl.eqSet(Shift,{})) {
            if (this.FOptions.FKeyboard.FDeleteKeyHandling === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridDeleteKeyHandling.dkhDeleteRow) {
              if (this.GetRowCount() > (this.FFixedRows + this.FFixedFooterRows)) {
                Allow = true;
                this.DoCanDeleteRow(sel.Row,{get: function () {
                    return Allow;
                  }, set: function (v) {
                    Allow = v;
                  }});
                if (Allow) {
                  this.DeleteRow(sel.Row);
                  sel.Row = Math.max(this.FFixedRows,Math.min(sel.Row,this.GetRowCount() - 1 - this.FFixedFooterRows));
                  this.DoDeleteRow(sel.Row);
                };
              };
            };
          };
        } else if ($tmp1 === 45) {
          if (rtl.eqSet(Shift,{})) {
            if (sel.Row === -1) sel.Row = this.FFixedRows - 1;
            var $tmp2 = this.FOptions.FKeyboard.FInsertKeyHandling;
            if ($tmp2 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridInsertKeyHandling.ikhInsertRowBefore) {
              Allow = true;
              this.DoCanInsertRow(sel.Row,{get: function () {
                  return Allow;
                }, set: function (v) {
                  Allow = v;
                }});
              if (Allow) {
                this.InsertRow(sel.Row);
                sel.Row = Math.max(this.FFixedRows,Math.min(sel.Row,this.GetRowCount() - 1 - this.FFixedFooterRows));
                this.DoInsertRow(sel.Row);
              };
            } else if ($tmp2 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridInsertKeyHandling.ikhInsertRowAfter) {
              Allow = true;
              this.DoCanInsertRow(sel.Row,{get: function () {
                  return Allow;
                }, set: function (v) {
                  Allow = v;
                }});
              if (Allow) {
                this.InsertRow(sel.Row + 1);
                sel.Row = Math.max(this.FFixedRows,Math.min(sel.Row + 1,this.GetRowCount() - 1 - this.FFixedFooterRows));
                this.DoInsertRow(sel.Row);
              };
            };
          };
        } else if ($tmp1 === 34) {
          sel.$assign(this.NextSelectableRow(sel.Col,(sel.Row + this.GetPageScrollSize()) - 1));
          sel.Col = real.Col;
        } else if ($tmp1 === 33) {
          sel.$assign(this.PreviousSelectableRow(sel.Col,(sel.Row - this.GetPageScrollSize()) + 1));
          sel.Col = real.Col;
        } else if ($tmp1 === 38) {
          sel.$assign(this.PreviousSelectableRow(sel.Col,sel.Row));
          sel.Col = real.Col;
        } else if ($tmp1 === 40) {
          sel.$assign(this.NextSelectableRow(sel.Col,sel.Row));
          sel.Col = real.Col;
        } else if ($tmp1 === 37) {
          sel.$assign(this.PreviousSelectableColumn(sel.Col,sel.Row));
          sel.Row = real.Row;
        } else if ($tmp1 === 39) {
          sel.$assign(this.NextSelectableColumn(sel.Col,sel.Row));
          sel.Row = real.Row;
        } else if ($tmp1 === 36) {
          if (pas.Classes.TShiftState$a.ssAlt in Shift) {
            sel.Row = this.FFixedRows;
            sel.Col = real.Col;
            sel.$assign(this.NextSelectableRow(sel.Col,sel.Row - 1));
          } else {
            sel.Col = this.FFixedColumns;
            sel.Row = real.Row;
            sel.$assign(this.NextSelectableColumn(sel.Col - 1,sel.Row));
          };
        } else if ($tmp1 === 35) {
          if (pas.Classes.TShiftState$a.ssAlt in Shift) {
            sel.Row = this.GetRowCount() - 1 - this.FFixedFooterRows;
            sel.Col = real.Col;
            sel.$assign(this.PreviousSelectableRow(sel.Col,sel.Row + 1));
          } else {
            sel.Col = this.GetColumnCount() - 1 - this.FFixedRightColumns;
            sel.Row = real.Row;
            sel.$assign(this.PreviousSelectableColumn(sel.Col + 1,sel.Row));
          };
        };
        var $tmp3 = Key.get();
        if (($tmp3 === 38) || ($tmp3 === 37) || ($tmp3 === 40) || ($tmp3 === 39) || ($tmp3 === 36) || ($tmp3 === 35) || ($tmp3 === 34) || ($tmp3 === 33) || ($tmp3 === 46) || ($tmp3 === 45)) {
          if (pas.Classes.TShiftState$a.ssCtrl in Shift) {
            this.Navigate(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(sel),false)}
           else this.SelectCell(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(sel),rtl.refSet(Shift),false);
          Key.set(0);
        };
      };
    };
    this.HandleKeyPress = function (Key) {
      var Allow = false;
      var k = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleKeyPress.apply(this,arguments);
      k = Key.get().charCodeAt();
      if (k in rtl.createSet(9)) return;
      if (!this.FOptions.FEditing.FEnabled && this.FOptions.FLookup.FEnabled) {
        if (k in rtl.createSet(27,45,46,38,40,37,39,36,35,33,34,9)) {
          this.FLookupString = ""}
         else {
          if (this.FOptions.FLookup.FIncremental) {
            this.FLookupString = this.FLookupString + Key.get()}
           else this.FLookupString = Key.get();
          this.LookupInColumn(this.GetFocusedCell().Col,this.FLookupString,true,true);
        };
      };
      if (this.FOptions.FEditing.FEnabled) {
        Allow = true;
        this.DoCanEditCell(this.GetFocusedCell().Col,this.GetFocusedCell().Row,{get: function () {
            return Allow;
          }, set: function (v) {
            Allow = v;
          }});
        if (Allow) {
          if (k >= 32) {
            this.EditCell(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(this.GetFocusedCell()),$mod.TTMSFNCGridEditCellStart.csStart,true,Key.get(),Key.get().charCodeAt());
            Key.set("\x00");
            return;
          };
        };
      };
    };
    this.HandleDialogKey = function (Key, Shift) {
      this.FTabKey = $mod.TTMSFNCGridTabKeyMode.tkmNone;
      if ((Key.get() === 9) && (this.FOptions.FKeyboard.FTabKeyHandling === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridTabKeyHandling.tkhMixed)) {
        if (pas.Classes.TShiftState$a.ssShift in Shift) {
          this.FTabKey = $mod.TTMSFNCGridTabKeyMode.tkmShift}
         else this.FTabKey = $mod.TTMSFNCGridTabKeyMode.tkmNormal;
      };
      if (this.IsFocused() || ((this.FEditControl !== null) && this.FEditControl.IsFocused())) this.ProcessTab(Key,rtl.refSet(Shift),this.FOptions.FKeyboard.FTabKeyDirection,this.FOptions.FKeyboard.FTabKeyHandling,this.FOptions.FKeyboard.FTabKeyDirectEdit,$mod.TTMSFNCGridEditCellStart.csNone);
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleDialogKey.apply(this,arguments);
    };
    this.HandleFilterListClick = function (Sender) {
      this.FFilterTimer.SetEnabled(true);
    };
    this.HandleFilterTimer = function (Sender) {
      var fd = null;
      var cnd = "";
      var i = 0;
      var filtercol = 0;
      var u = false;
      this.FFilterTimer.SetEnabled(false);
      if (this.FFilterListBox != null) {
        filtercol = this.FFilterListBox.FTag$1;
        if (this.FOptions.FFiltering.FMultiColumn) {
          for (var $l = this.FFilter.GetCount() - 1; $l >= 0; $l--) {
            i = $l;
            if (this.FFilter.GetItem$1(i).FColumn === filtercol) this.FFilter.Delete(i);
          };
        } else this.FFilter.Clear();
        fd = this.FFilter.Add$1();
        fd.FColumn = filtercol;
        cnd = "";
        if ((this.FFilterListBox.GetItemIndex() >= 0) && (this.FFilterListBox.GetItemIndex() <= (this.FFilterListBox.FItems.GetCount() - 1))) cnd = this.FFilterListBox.FItems.Get(this.FFilterListBox.GetItemIndex());
        if (pas.System.Pos(" ",cnd) > 0) cnd = '"' + cnd + '"';
        this.FFilterPopup.SetIsOpen(false);
        if (cnd === rtl.getResStr($mod,"sTMSFNCGridFilterAll")) {
          this.FBlockUpdate = true;
          this.UnHideRowsAll();
          this.FBlockUpdate = false;
          this.FFilter.Clear();
          this.ApplyFilter();
        } else {
          this.DoFilterSelect(fd.FColumn,{get: function () {
              return cnd;
            }, set: function (v) {
              cnd = v;
            }});
          fd.FCondition = cnd;
          this.FBlockUpdate = true;
          this.UnHideRowsAll();
          this.FBlockUpdate = false;
          this.ApplyFilter();
        };
        u = false;
        this.DoAfterApplyFilter(fd.FColumn,cnd,{get: function () {
            return u;
          }, set: function (v) {
            u = v;
          }});
        if (u) {
          this.BeginUpdate();
          this.UpdateCalculations();
          this.EndUpdate();
        };
      };
    };
    this.HandleKeyUp = function (Key, Shift) {
      if (Key.get() === 9) return;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleKeyUp.apply(this,arguments);
      if (Key.get() === 32) {
        Key.set(32);
        if ((this.GetFocusedCell().Row !== -1) && (this.GetFocusedCell().Col !== -1)) this.DoCellKeyUp(this.GetFocusedCell().Col,this.GetFocusedCell().Row,Key,rtl.refSet(Shift));
      };
    };
    this.DoCellKeyDown = function (ACol, ARow, Key, Shift) {
      var cell = null;
      var cl = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      cl.Col = ACol;
      cl.Row = ARow;
      cell = this.GetCellObject(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(this.GetDisplayCell(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(cl))));
      if (cell != null) {
        var $tmp = Key.get();
        if ($tmp === 32) this.FCellKeyDown = true;
      };
    };
    this.DoCellKeyUp = function (ACol, ARow, Key, Shift) {
      var cell = null;
      var cl = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      cl.Col = ACol;
      cl.Row = ARow;
      cell = this.GetCellObject(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(this.GetDisplayCell(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(cl))));
      if (cell != null) {
        var $tmp = Key.get();
        if ($tmp === 32) {
          if (this.FCellKeyDown && !this.IsReadOnly(cl.Col,cl.Row)) {
            if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell.isPrototypeOf(cell)) {
              rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell).SetChecked(!rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell).FChecked)}
             else if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCRadioGridCell.isPrototypeOf(cell)) rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCRadioGridCell).SetChecked(!rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCRadioGridCell).FChecked);
          };
          this.FCellKeyDown = false;
        };
      };
    };
    this.ProcessTab = function (Key, Shift, Mode, Handling, DirectEdit, CellStart) {
      var cl = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      var clc = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      var rl = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      var c = 0;
      var r = 0;
      var a = false;
      var Allow = false;
      var SaveFocusCell = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      if ((Key.get() === 9) && (this.GetRowCount() > (this.FFixedRows + this.FFixedFooterRows)) && (this.GetColumnCount() > (this.FFixedColumns + this.FFixedRightColumns))) {
        SaveFocusCell.$assign(this.GetFocusedCell());
        a = this.HideEdit(false,false);
        if (!a) return;
        this.SetFocusedCell(SaveFocusCell);
        if (this.IsFocused()) {
          var $tmp = Handling;
          if ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridTabKeyHandling.tkhNextCell) {
            Key.set(0)}
           else if ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridTabKeyHandling.tkhMixed) {
            if (pas.Classes.TShiftState$a.ssShift in Shift) {
              cl.Col = this.FFixedColumns;
              cl.Row = this.FFixedRows;
              if (this.IsNormalFixed(cl.Col,cl.Row)) {
                var $tmp1 = Mode;
                if ($tmp1 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridTabKeyDirection.tkdNextColumnCell) {
                  cl.$assign(this.NextSelectableColumn(cl.Col,cl.Row))}
                 else if ($tmp1 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridTabKeyDirection.tkdNextRowCell) cl.$assign(this.NextSelectableRow(cl.Col,cl.Row));
              };
              if ((Handling === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridTabKeyHandling.tkhMixed) && !((this.GetFocusedCell().Col === cl.Col) && (this.GetFocusedCell().Row === cl.Row))) Key.set(0);
            } else {
              cl.Col = this.GetColumnCount() - 1 - this.FFixedRightColumns;
              cl.Row = this.GetRowCount() - 1 - this.FFixedFooterRows;
              if (this.IsNormalFixed(cl.Col,cl.Row)) {
                var $tmp2 = Mode;
                if ($tmp2 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridTabKeyDirection.tkdNextColumnCell) {
                  cl.$assign(this.PreviousSelectableColumn(cl.Col,cl.Row))}
                 else if ($tmp2 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridTabKeyDirection.tkdNextRowCell) cl.$assign(this.PreviousSelectableRow(cl.Col,cl.Row));
              };
              if ((Handling === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridTabKeyHandling.tkhMixed) && !((this.GetFocusedCell().Col === cl.Col) && (this.GetFocusedCell().Row === cl.Row))) Key.set(0);
            };
          };
          if (Key.get() === 0) {
            var $tmp3 = Handling;
            if (($tmp3 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridTabKeyHandling.tkhNextCell) || ($tmp3 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridTabKeyHandling.tkhMixed)) {
              cl.$assign(this.GetFocusedCell());
              rl.$assign(this.FRealCell);
              cl.$assign(this.BaseCell(cl.Col,cl.Row));
              if (pas.Classes.TShiftState$a.ssShift in Shift) {
                clc.$assign(pas["WEBLib.TMSFNCGridData"].MakeCell(this.FFixedColumns,this.FFixedRows));
                if ((this.GetFocusedCell().Col === clc.Col) && (this.GetFocusedCell().Row === clc.Row)) {
                  clc.$assign(pas["WEBLib.TMSFNCGridData"].MakeCell(this.GetColumnCount() - 1 - this.FFixedRightColumns,this.GetRowCount() - 1 - this.FFixedFooterRows));
                  this.SetFocusedCell(clc);
                  return;
                };
                var $tmp4 = Mode;
                if ($tmp4 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridTabKeyDirection.tkdNextColumnCell) {
                  c = cl.Col;
                  cl.$assign(this.PreviousSelectableColumn(cl.Col,cl.Row));
                  cl.Row = rl.Row;
                  if (c === cl.Col) {
                    r = cl.Row;
                    cl.Col = this.GetColumnCount() - 1 - this.FFixedRightColumns;
                    cl.$assign(this.PreviousSelectableColumn(cl.Col,cl.Row));
                    if (r === cl.Row) {
                      cl.$assign(this.PreviousSelectableColumn(this.GetColumnCount() - this.FFixedRightColumns,cl.Row - 1));
                      while ((cl.Col === (this.GetColumnCount() - this.FFixedRightColumns)) && (cl.Row === (r - 1))) {
                        r = cl.Row;
                        cl.$assign(this.PreviousSelectableColumn(this.GetColumnCount() - this.FFixedRightColumns,cl.Row - 1));
                      };
                    };
                    if ((Handling === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridTabKeyHandling.tkhNextCell) && ((cl.Row < this.FFixedRows) || (r === cl.Row))) {
                      cl.Col = this.GetColumnCount() - 1 - this.FFixedRightColumns;
                      cl.Row = this.GetRowCount() - 1 - this.FFixedFooterRows;
                      cl.$assign(this.PreviousSelectableColumn(cl.Col,cl.Row));
                    };
                  };
                } else if ($tmp4 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridTabKeyDirection.tkdNextRowCell) {
                  r = cl.Row;
                  cl.$assign(this.PreviousSelectableRow(cl.Col,cl.Row));
                  cl.Col = rl.Col;
                  if (r === cl.Row) {
                    c = cl.Col;
                    cl.Row = this.GetRowCount() - 1 - this.FFixedFooterRows;
                    cl.$assign(this.PreviousSelectableRow(cl.Col,cl.Row));
                    if (c === cl.Col) {
                      cl.$assign(this.PreviousSelectableRow(cl.Col - 1,this.GetRowCount() - this.FFixedFooterRows));
                      while ((cl.Row === (this.GetRowCount() - this.FFixedFooterRows)) && (cl.Col === (c - 1))) {
                        c = cl.Col;
                        cl.$assign(this.PreviousSelectableRow(cl.Col - 1,this.GetRowCount() - this.FFixedFooterRows));
                      };
                    };
                    if ((Handling === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridTabKeyHandling.tkhNextCell) && ((cl.Col < this.FFixedColumns) || (c === cl.Col))) {
                      cl.Col = this.GetColumnCount() - 1 - this.FFixedRightColumns;
                      cl.Row = this.GetRowCount() - 1 - this.FFixedFooterRows;
                      cl.$assign(this.PreviousSelectableRow(cl.Col,cl.Row));
                    };
                  };
                };
                this.SelectCell(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(cl),{},false);
                if (DirectEdit) {
                  Allow = true;
                  this.DoCanEditCell(this.GetFocusedCell().Col,this.GetFocusedCell().Row,{get: function () {
                      return Allow;
                    }, set: function (v) {
                      Allow = v;
                    }});
                  if (Allow) this.EditCell(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(this.GetFocusedCell()),CellStart,false,"",0);
                };
              } else {
                clc.$assign(pas["WEBLib.TMSFNCGridData"].MakeCell(this.GetColumnCount() - 1 - this.FFixedRightColumns,this.GetRowCount() - 1 - this.FFixedFooterRows));
                if ((this.GetFocusedCell().Col === clc.Col) && (this.GetFocusedCell().Row === clc.Row)) {
                  clc.$assign(pas["WEBLib.TMSFNCGridData"].MakeCell(this.FFixedColumns,this.FFixedRows));
                  this.SetFocusedCell(clc);
                  return;
                };
                var $tmp5 = Mode;
                if ($tmp5 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridTabKeyDirection.tkdNextColumnCell) {
                  c = cl.Col;
                  cl.$assign(this.NextSelectableColumn(cl.Col,cl.Row));
                  cl.Row = rl.Row;
                  if (c === cl.Col) {
                    r = cl.Row;
                    cl.Col = this.FFixedColumns;
                    cl.$assign(this.NextSelectableColumn(cl.Col,cl.Row));
                    if (r === cl.Row) {
                      cl.$assign(this.NextSelectableColumn(this.FFixedColumns - 1,cl.Row + 1));
                      while ((cl.Col === (this.FFixedColumns - 1)) && (cl.Row === (r + 1))) {
                        r = cl.Row;
                        cl.$assign(this.NextSelectableColumn(this.FFixedColumns - 1,cl.Row + 1));
                      };
                    };
                    if ((Handling === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridTabKeyHandling.tkhNextCell) && ((cl.Row > (this.GetRowCount() - 1 - this.FFixedFooterRows)) || (r === cl.Row))) {
                      cl.Col = this.FFixedColumns;
                      cl.Row = this.FFixedRows;
                      cl.$assign(this.NextSelectableColumn(cl.Col,cl.Row));
                    };
                  };
                } else if ($tmp5 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridTabKeyDirection.tkdNextRowCell) {
                  r = cl.Row;
                  cl.$assign(this.NextSelectableRow(cl.Col,cl.Row));
                  cl.Col = rl.Col;
                  if (r === cl.Row) {
                    c = cl.Col;
                    cl.Row = this.FFixedRows;
                    cl.$assign(this.NextSelectableRow(cl.Col,cl.Row));
                    if (c === cl.Col) {
                      cl.$assign(this.NextSelectableRow(cl.Col + 1,this.FFixedRows - 1));
                      while ((cl.Row === (this.FFixedRows - 1)) && (cl.Col === (c + 1))) {
                        c = cl.Col;
                        cl.$assign(this.NextSelectableRow(cl.Col + 1,this.FFixedRows - 1));
                      };
                    };
                    if ((Handling === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridTabKeyHandling.tkhNextCell) && ((cl.Col > (this.GetColumnCount() - 1 - this.FFixedRightColumns)) || (c === cl.Col))) {
                      cl.Col = this.FFixedColumns;
                      cl.Row = this.FFixedRows;
                      cl.$assign(this.NextSelectableRow(cl.Col,cl.Row));
                    };
                  };
                };
                this.SelectCell(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(cl),{},false);
                if (DirectEdit) {
                  Allow = true;
                  this.DoCanEditCell(this.GetFocusedCell().Col,this.GetFocusedCell().Row,{get: function () {
                      return Allow;
                    }, set: function (v) {
                      Allow = v;
                    }});
                  if (Allow) this.EditCell(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(this.GetFocusedCell()),CellStart,false,"",0);
                };
              };
            };
          };
        } else {
          if (Handling !== pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridTabKeyHandling.tkhNextControl) {
            if (pas.Classes.TShiftState$a.ssShift in Shift) {
              cl.Col = this.GetColumnCount() - 1 - this.FFixedRightColumns;
              cl.Row = this.GetRowCount() - 1 - this.FFixedFooterRows;
              if (this.IsNormalFixed(cl.Col,cl.Row)) {
                var $tmp6 = Mode;
                if ($tmp6 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridTabKeyDirection.tkdNextColumnCell) {
                  cl.$assign(this.PreviousSelectableColumn(cl.Col,cl.Row))}
                 else if ($tmp6 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridTabKeyDirection.tkdNextRowCell) cl.$assign(this.PreviousSelectableRow(cl.Col,cl.Row));
              };
              this.SelectCell(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(cl),{},false);
            } else {
              cl.Col = this.FFixedColumns;
              cl.Row = this.FFixedRows;
              if (this.IsNormalFixed(cl.Col,cl.Row)) {
                var $tmp7 = Mode;
                if ($tmp7 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridTabKeyDirection.tkdNextColumnCell) {
                  cl.$assign(this.NextSelectableColumn(cl.Col,cl.Row))}
                 else if ($tmp7 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridTabKeyDirection.tkdNextRowCell) cl.$assign(this.NextSelectableRow(cl.Col,cl.Row));
              };
              this.SelectCell(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(cl),{},false);
            };
          };
        };
      };
    };
    this.UpdateCursor = function (ACursor) {
      this.ChangeCursor = false;
      this.SetC(ACursor);
      this.ChangeCursor = true;
    };
    this.DoExit = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.DoExit.call(this);
      this.FClearMouseDown = this.FBlockHide;
      this.FDblClick = false;
      this.FMouseDown = false;
      this.FMouseDblClick = false;
      this.UpdateGridCellDisplay();
    };
    this.DoEnter = function () {
      var cl = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      pas["WEBLib.Controls"].TControl.DoEnter.call(this);
      if (this.FTabKey === $mod.TTMSFNCGridTabKeyMode.tkmNormal) {
        this.SetFocusedCell(pas["WEBLib.TMSFNCGridData"].MakeCell(this.FFixedColumns,this.FFixedRows))}
       else if (this.FTabKey === $mod.TTMSFNCGridTabKeyMode.tkmShift) {
        cl.Col = this.GetColumnCount() - 1 - this.FFixedRightColumns;
        cl.Row = this.GetRowCount() - 1 - this.FFixedFooterRows;
        this.SetFocusedCell(cl);
      } else this.UpdateGridCellDisplay();
      this.FTabKey = $mod.TTMSFNCGridTabKeyMode.tkmNone;
    };
    this.StopAnimationTimer = function () {
      this.FAnimateTimer$1.SetEnabled(false);
      this.FAnimating$1 = false;
    };
    this.UpdateControlCache = function () {
      var r = 0.0;
      var scol = 0;
      var ecol = 0;
      var i = 0;
      var cl = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      if ((this.FUpdateCount$1 > 0) || this.FBlockUpdate || (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState)) return;
      if ((this.FOldSize > 0) && this.FOptions.FColumnSize.FSyncWithGrid) {
        r = this.GetWidth() / this.FOldSize;
        if (this.FOptions.FColumnSize.FSyncNormalCellsOnly) {
          scol = this.FFixedColumns;
          ecol = this.GetColumnCount() - 1 - this.FFixedRightColumns;
        } else {
          scol = 0;
          ecol = this.GetColumnCount() - 1;
        };
        for (var $l = scol, $end = ecol; $l <= $end; $l++) {
          i = $l;
          if (this.FOrigColumnW.GetCount() > i) this.SetColWidths(i,this.FOrigColumnW.GetItem$1(i).FValue * r);
        };
      };
      if (this.FOptions.FColumnSize.FStretch) this.StretchColumn(this.FOptions.FColumnSize.FStretchColumn,-1);
      this.UpdateControlScrollBars(true,true);
      this.FContainerWidth = this.GetTotalColumnWidth();
      this.FContainerHeight = this.GetTotalRowHeight();
      this.UpdateControlScrollBars(false,false);
      if (this.FOptions.FColumnSize.FStretch) this.StretchColumn(this.FOptions.FColumnSize.FStretchColumn,-1);
      this.FContainerWidth = this.GetTotalColumnWidth();
      this.FContainerHeight = this.GetTotalRowHeight();
      if ((this.GetColumnCount() > this.FFixedColumns) && (this.GetRowCount() > this.FFixedRows)) {
        if (!this.FFirstCellApply) {
          cl.Col = this.FFixedColumns;
          cl.Row = this.FFixedRows;
          if (this.IsNormalFixed(cl.Col,cl.Row)) cl.$assign(this.NextSelectableColumn(cl.Col,cl.Row));
          this.SetStartCell(cl.Col,cl.Row);
          this.SetStopCell(cl.Col,cl.Row);
          this.SetFocusCell(cl.Col,cl.Row);
          this.FPrevSelectedCell.$assign(this.GetFocusedCell());
          this.FSaveCell.$assign(this.GetFocusedCell());
          this.FFirstCell.Col = -1;
          this.FFirstCell.Row = -1;
          this.FRealCell.$assign(this.GetFocusedCell());
          this.FPrevSelection.$assign(this.GetSelection());
          var $tmp = this.FOptions.FSelection.FMode;
          if (($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smRowRange) || ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smSingleRow) || ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctRow)) {
            this.SetStopCell(this.GetColumnCount() - 1 - this.FFixedRightColumns,this.FStopCell.Row)}
           else if (($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smColumnRange) || ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smSingleColumn) || ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctColumn)) this.SetStopCell(this.FStopCell.Col,this.GetRowCount() - 1 - this.FFixedFooterRows);
          this.FBlockUpdate = true;
          var $tmp1 = this.FOptions.FSelection.FMode;
          if ($tmp1 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctRow) {
            this.SetRowSelect(this.GetFocusedCell().Row,true)}
           else if ($tmp1 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctColumn) {
            this.SetColumnSelect(this.GetFocusedCell().Col,true)}
           else if ($tmp1 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctCell) this.SetCellSelect(this.GetFocusedCell().Col,this.GetFocusedCell().Row,true);
          this.FBlockUpdate = false;
          this.FFirstCellApply = true;
        } else {
          var $tmp2 = this.FOptions.FSelection.FMode;
          if (($tmp2 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smRowRange) || ($tmp2 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smSingleRow) || ($tmp2 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctRow)) {
            this.SetStopCell(this.GetColumnCount() - 1 - this.FFixedRightColumns,this.FStopCell.Row)}
           else if (($tmp2 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smColumnRange) || ($tmp2 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smSingleColumn) || ($tmp2 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctColumn)) this.SetStopCell(this.FStopCell.Col,this.GetRowCount() - 1 - this.FFixedFooterRows);
        };
      } else {
        cl.Col = -1;
        cl.Row = -1;
        this.FStartCell.$assign(cl);
        this.FStopCell.$assign(cl);
        this.FFocusedCell.$assign(cl);
        this.FPrevSelectedCell.$assign(this.GetFocusedCell());
        this.FSaveCell.$assign(this.GetFocusedCell());
        this.FFirstCell.Col = -1;
        this.FFirstCell.Row = -1;
        this.FRealCell.$assign(this.GetFocusedCell());
        this.FPrevSelection.$assign(this.GetSelection());
      };
      this.UpdateGridCells(false);
    };
    this.UpdateControlDisplay = function () {
      pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControl.UpdateControlDisplay.call(this);
      this.UpdateGridCellDisplay();
    };
    this.VerticalScrollPositionChanged = function () {
      if (this.FReset) return;
      this.StopEdit();
      this.UpdateGridCells(true);
    };
    this.HorizontalScrollPositionChanged = function () {
      if (this.FReset) return;
      this.StopEdit();
      this.UpdateGridCells(true);
    };
    this.HideEdit = function (AEnterKey, ATestHiding) {
      var Result = false;
      var str = "";
      var allow = false;
      var cl = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      var rl = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      var nav = false;
      var cellEditor = 0;
      var col = 0;
      var r = 0;
      var c = 0;
      Result = true;
      if (!(this.FEditControl != null) || this.FBlockHide) return Result;
      this.FBlockHide = true;
      try {
        if (this.FEditControl != null) {
          str = "";
          if ($mod.TTMSFNCGridEdit.isPrototypeOf(this.FEditControl)) {
            str = rtl.as(this.FEditControl,$mod.TTMSFNCGridEdit).GetT()}
           else if ($mod.TTMSFNCGridMemo.isPrototypeOf(this.FEditControl)) {
            str = rtl.as(this.FEditControl,$mod.TTMSFNCGridMemo).GetText()}
           else if ($mod.TTMSFNCGridSpinBox.isPrototypeOf(this.FEditControl)) {
            str = rtl.as(this.FEditControl,$mod.TTMSFNCGridSpinBox).GetText()}
           else if ($mod.TTMSFNCGridDatePicker.isPrototypeOf(this.FEditControl)) {
            str = pas.SysUtils.DateToStr(rtl.as(this.FEditControl,$mod.TTMSFNCGridDatePicker).GetDate())}
           else if ($mod.TTMSFNCGridColorPicker.isPrototypeOf(this.FEditControl)) {
            col = rtl.as(this.FEditControl,$mod.TTMSFNCGridColorPicker).GetSelectedColor()}
           else if ($mod.TTMSFNCGridTrackBar.isPrototypeOf(this.FEditControl)) {
            str = pas.SysUtils.IntToStr(rtl.as(this.FEditControl,$mod.TTMSFNCGridTrackBar).GetPosition())}
           else if ($mod.TTMSFNCGridComboBox.isPrototypeOf(this.FEditControl)) str = rtl.as(this.FEditControl,$mod.TTMSFNCGridComboBox).GetText();
          allow = true;
          if ($mod.TTMSFNCGridColorPicker.isPrototypeOf(this.FEditControl)) {
            this.DoCellEditValidateColor(this.FEditCell.Col,this.FEditCell.Row,this.FEditControl,{get: function () {
                return col;
              }, set: function (v) {
                col = v;
              }},{get: function () {
                return allow;
              }, set: function (v) {
                allow = v;
              }})}
           else this.DoCellEditValidateData(this.FEditCell.Col,this.FEditCell.Row,this.FEditControl,{get: function () {
              return str;
            }, set: function (v) {
              str = v;
            }},{get: function () {
              return allow;
            }, set: function (v) {
              allow = v;
            }});
          if (ATestHiding) {
            Result = allow;
            return Result;
          };
          if (allow) {
            this.FEditing = false;
            if ($mod.TTMSFNCGridColorPicker.isPrototypeOf(this.FEditControl)) {
              this.DoCellEditSetColor(this.FEditCell.Col,this.FEditCell.Row,this.FEditControl,{get: function () {
                  return col;
                }, set: function (v) {
                  col = v;
                }})}
             else this.DoCellEditSetData(this.FEditCell.Col,this.FEditCell.Row,this.FEditControl,{get: function () {
                return str;
              }, set: function (v) {
                str = v;
              }});
            if (this.FOptions.FEditing.FAutoHistory && $mod.TTMSFNCGridEdit.isPrototypeOf(this.FEditControl)) {
              this.FOptions.FEditing.FAutoCompleteItems.Add(str);
            };
            this.DoCellEditDone(this.FEditCell.Col,this.FEditCell.Row,this.FEditControl);
            cellEditor = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridEditorType.etEdit;
            this.DoGetCellEditorType(this.FEditCell.Col,this.FEditCell.Row,{get: function () {
                return cellEditor;
              }, set: function (v) {
                cellEditor = v;
              }});
            if (cellEditor !== pas["WEBLib.TMSFNCGridData"].TTMSFNCGridEditorType.etCustom) {
              if (this.FEditControl != null) {
                this.FEditControl.SetParent(null);
                this.FEditControl = null;
              };
            } else this.FFreeEditControlTimer.SetEnabled(true);
            nav = false;
            cl.$assign(this.GetFocusedCell());
            rl.$assign(this.FRealCell);
            if (AEnterKey) {
              var $tmp = this.FOptions.FKeyboard.FEnterKeyHandling;
              if (($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridEnterKeyHandling.ekhNextColumn) || ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridEnterKeyHandling.ekhNextColumnInRow) || ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridEnterKeyHandling.ekhNextColumnAndAppend) || ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridEnterKeyHandling.ekhNextColumnAndRowAppend)) {
                nav = true;
                c = cl.Col;
                cl.$assign(this.NextSelectableColumn(cl.Col,cl.Row));
                cl.Row = rl.Row;
                allow = true;
                this.DoCanAppendColumn(cl.Col + 1,{get: function () {
                    return allow;
                  }, set: function (v) {
                    allow = v;
                  }});
                if (allow && (this.FOptions.FKeyboard.FEnterKeyHandling === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridEnterKeyHandling.ekhNextColumnAndAppend)) {
                  while (c === cl.Col) {
                    this.InsertRow(this.GetColumnCount() - this.FFixedRightColumns);
                    cl.$assign(this.NextSelectableColumn(cl.Col,cl.Row));
                    this.DoAppendColumn(this.GetColumnCount() - this.FFixedRightColumns - 1);
                  };
                };
                if (c === cl.Col) {
                  r = cl.Row;
                  cl.Col = this.FFixedColumns - 1;
                  cl.$assign(this.NextSelectableColumn(cl.Col,cl.Row));
                  if (r === cl.Row) {
                    if (this.FOptions.FKeyboard.FEnterKeyHandling === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridEnterKeyHandling.ekhNextColumnInRow) {
                      cl.$assign(this.NextSelectableColumn(this.FFixedColumns - 1,cl.Row - 1))}
                     else {
                      allow = true;
                      this.DoCanAppendRow(cl.Row + 1,{get: function () {
                          return allow;
                        }, set: function (v) {
                          allow = v;
                        }});
                      if (allow && (cl.Row === (this.GetRowCount() - 1 - this.FFixedFooterRows))) {
                        if (this.FOptions.FKeyboard.FEnterKeyHandling === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridEnterKeyHandling.ekhNextColumnAndRowAppend) {
                          while (r === cl.Row) {
                            this.InsertRow(this.GetRowCount() - this.FFixedFooterRows);
                            cl.$assign(this.NextSelectableColumn(this.FFixedColumns - 1,cl.Row + 1));
                            this.DoAppendRow(this.GetRowCount() - this.FFixedFooterRows - 1);
                          };
                        };
                      } else cl.$assign(this.NextSelectableColumn(this.FFixedColumns - 1,cl.Row + 1));
                    };
                    while ((cl.Col === (this.FFixedColumns - 1)) && (cl.Row === (r + 1))) {
                      r = cl.Row;
                      cl.$assign(this.NextSelectableColumn(this.FFixedColumns - 1,cl.Row + 1));
                    };
                  };
                };
              } else if (($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridEnterKeyHandling.ekhNextRow) || ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridEnterKeyHandling.ekhNextRowInColumn) || ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridEnterKeyHandling.ekhNextRowAndAppend) || ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridEnterKeyHandling.ekhNextRowAndColumnAppend)) {
                nav = true;
                r = cl.Row;
                cl.$assign(this.NextSelectableRow(cl.Col,cl.Row));
                cl.Col = rl.Col;
                allow = true;
                this.DoCanAppendRow(cl.Row + 1,{get: function () {
                    return allow;
                  }, set: function (v) {
                    allow = v;
                  }});
                if (allow && (this.FOptions.FKeyboard.FEnterKeyHandling === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridEnterKeyHandling.ekhNextRowAndAppend)) {
                  while (r === cl.Row) {
                    this.InsertRow(this.GetRowCount() - this.FFixedFooterRows);
                    cl.$assign(this.NextSelectableRow(cl.Col,cl.Row));
                    this.DoAppendRow(this.GetRowCount() - this.FFixedFooterRows - 1);
                  };
                };
                if (r === cl.Row) {
                  c = cl.Col;
                  cl.Row = this.FFixedRows - 1;
                  cl.$assign(this.NextSelectableRow(cl.Col,cl.Row));
                  if (c === cl.Col) {
                    if (this.FOptions.FKeyboard.FEnterKeyHandling === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridEnterKeyHandling.ekhNextColumnInRow) {
                      cl.$assign(this.NextSelectableRow(cl.Col - 1,this.FFixedRows - 1))}
                     else {
                      allow = true;
                      this.DoCanAppendColumn(cl.Col + 1,{get: function () {
                          return allow;
                        }, set: function (v) {
                          allow = v;
                        }});
                      if (allow && (cl.Col === (this.GetColumnCount() - 1 - this.FFixedRightColumns))) {
                        if (this.FOptions.FKeyboard.FEnterKeyHandling === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridEnterKeyHandling.ekhNextRowAndColumnAppend) {
                          while (c === cl.Col) {
                            this.InsertColumn(this.GetColumnCount() - this.FFixedRightColumns);
                            cl.$assign(this.NextSelectableRow(cl.Col + 1,this.FFixedRows - 1));
                            this.DoAppendColumn(this.GetColumnCount() - this.FFixedRightColumns - 1);
                          };
                        };
                      } else cl.$assign(this.NextSelectableRow(cl.Col + 1,this.FFixedRows - 1));
                    };
                    while ((cl.Row === (this.FFixedRows - 1)) && (cl.Col === (c + 1))) {
                      c = cl.Col;
                      cl.$assign(this.NextSelectableRow(cl.Col + 1,this.FFixedRows - 1));
                    };
                  };
                };
              };
            };
            if (this.CanFocus()) this.SetFocus();
            if (nav) {
              this.SelectCell(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(cl),{},false);
              if (AEnterKey && this.FOptions.FKeyboard.FEnterKeyDirectEdit) {
                allow = true;
                this.DoCanEditCell(this.GetFocusedCell().Col,this.GetFocusedCell().Row,{get: function () {
                    return allow;
                  }, set: function (v) {
                    allow = v;
                  }});
                if (allow) this.EditCell(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(this.GetFocusedCell()),$mod.TTMSFNCGridEditCellStart.csNone,false,"",0);
              };
            };
            Result = true;
          } else Result = false;
        };
      } finally {
        this.FBlockHide = false;
      };
      return Result;
    };
    this.CellControlKeyDown = function (Sender, Key, Shift) {
      var $tmp = Key.get();
      if ($tmp === 9) this.HandleDialogKey(Key,rtl.refSet(Shift));
      if (rtl.neSet(Shift,{})) return;
      var $tmp1 = Key.get();
      if ($tmp1 === 27) {
        this.CancelEdit()}
       else if (($tmp1 === 13) || ($tmp1 === 113)) {
        this.HideEdit(Key.get() === 13,false);
        if (Key.get() === 13) Key.set(0);
      };
    };
    this.CellEditKeyDown = function (Sender, Key, Shift) {
      var k = 0;
      var a = false;
      var Allow = false;
      var $tmp = Key.get();
      if ($tmp === 9) this.HandleDialogKey(Key,rtl.refSet(Shift));
      if (rtl.neSet(Shift,{})) return;
      var $tmp1 = Key.get();
      if ($tmp1 === 27) {
        this.CancelEdit()}
       else if (($tmp1 === 13) || ($tmp1 === 113)) {
        this.HideEdit(Key.get() === 13,false)}
       else if ($tmp1 === 37) {
        if (this.FOptions.FKeyboard.FArrowKeyDirectEdit) {
          if (((this.FEditControl === this.GetCellEdit()) && (this.GetCellEdit().GetSelStart() === 0)) || ((this.FEditControl === this.GetCellMemo()) && (this.GetCellMemo().GetSelStart() === 0))) {
            k = 9;
            Key.set(0);
            this.ProcessTab({get: function () {
                return k;
              }, set: function (v) {
                k = v;
              }},rtl.createSet(pas.Classes.TShiftState$a.ssShift),pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridTabKeyDirection.tkdNextColumnCell,pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridTabKeyHandling.tkhNextCell,true,$mod.TTMSFNCGridEditCellStart.csEnd);
          };
        };
      } else if ($tmp1 === 39) {
        if (this.FOptions.FKeyboard.FArrowKeyDirectEdit) {
          if (((this.FEditControl === this.GetCellEdit()) && (this.GetCellEdit().GetSelStart() === this.GetCellEdit().GetT().length)) || ((this.FEditControl === this.GetCellMemo()) && (this.GetCellMemo().GetSelStart() === this.GetCellMemo().GetText().length))) {
            k = 9;
            Key.set(0);
            this.ProcessTab({get: function () {
                return k;
              }, set: function (v) {
                k = v;
              }},{},pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridTabKeyDirection.tkdNextColumnCell,pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridTabKeyHandling.tkhNextCell,true,$mod.TTMSFNCGridEditCellStart.csStart);
          };
        };
      } else if (($tmp1 === 38) || ($tmp1 === 40)) {
        a = this.HideEdit(false,false);
        if (a) {
          this.HandleKeyDown(Key,rtl.refSet(Shift));
          if (this.FOptions.FKeyboard.FArrowKeyDirectEdit) {
            Allow = true;
            this.DoCanEditCell(this.GetFocusedCell().Col,this.GetFocusedCell().Row,{get: function () {
                return Allow;
              }, set: function (v) {
                Allow = v;
              }});
            if (Allow) this.EditCell(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(this.GetFocusedCell()),$mod.TTMSFNCGridEditCellStart.csNone,false,"",0);
          };
        };
      };
    };
    this.CellExit = function (Sender) {
      var b = false;
      var p = null;
      if (pas["WEBLib.TMSFNCColorPicker"].TTMSFNCColorPicker.isPrototypeOf(Sender)) {
        p = rtl.as(Sender,pas["WEBLib.TMSFNCColorPicker"].TTMSFNCColorPicker).GetPopup();
        if ((p != null) && p.FIsOpen) return;
      };
      if (pas["WEBLib.TMSFNCEdit"].TTMSFNCEdit.isPrototypeOf(Sender)) {
        p = rtl.as(Sender,pas["WEBLib.TMSFNCEdit"].TTMSFNCEdit).LookupList();
        if ((p != null) && p.FIsOpen) return;
      };
      b = true;
      if (this.FEditing && (this.FEditControl != null)) this.DoBeforeCellEditExit(this.FEditCell.Col,this.FEditCell.Row,this.FEditControl,{get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }});
      if (b) this.StopEdit();
    };
    this.CellEditBtnKeyDown = function (Sender, Key, Shift) {
      var k = 0;
      var a = false;
      var Allow = false;
      var $tmp = Key.get();
      if ($tmp === 9) this.HandleDialogKey(Key,rtl.refSet(Shift));
      if (rtl.neSet(Shift,{})) return;
      var $tmp1 = Key.get();
      if ($tmp1 === 27) {
        this.CancelEdit()}
       else if (($tmp1 === 13) || ($tmp1 === 113)) {
        this.HideEdit(Key.get() === 13,false)}
       else if ($tmp1 === 37) {
        if (this.FOptions.FKeyboard.FArrowKeyDirectEdit) {
          if (this.FEditControl === this.GetCellEdit()) {
            if (this.GetCellEdit().GetSelStart() === 0) {
              k = 9;
              Key.set(0);
              this.ProcessTab({get: function () {
                  return k;
                }, set: function (v) {
                  k = v;
                }},rtl.createSet(pas.Classes.TShiftState$a.ssShift),pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridTabKeyDirection.tkdNextColumnCell,pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridTabKeyHandling.tkhNextCell,true,$mod.TTMSFNCGridEditCellStart.csEnd);
            };
          };
        };
      } else if ($tmp1 === 39) {
        if (this.FOptions.FKeyboard.FArrowKeyDirectEdit) {
          if (this.FEditControl === this.GetCellEdit()) {
            if (this.GetCellEdit().GetSelStart() === this.GetCellEdit().GetT().length) {
              k = 9;
              Key.set(0);
              this.ProcessTab({get: function () {
                  return k;
                }, set: function (v) {
                  k = v;
                }},{},pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridTabKeyDirection.tkdNextColumnCell,pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridTabKeyHandling.tkhNextCell,true,$mod.TTMSFNCGridEditCellStart.csStart);
            };
          };
        };
      } else if (($tmp1 === 38) || ($tmp1 === 40)) {
        a = this.HideEdit(false,false);
        if (a) {
          this.HandleKeyDown(Key,rtl.refSet(Shift));
          if (this.FOptions.FKeyboard.FArrowKeyDirectEdit) {
            Allow = true;
            this.DoCanEditCell(this.GetFocusedCell().Col,this.GetFocusedCell().Row,{get: function () {
                return Allow;
              }, set: function (v) {
                Allow = v;
              }});
            if (Allow) this.EditCell(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(this.GetFocusedCell()),$mod.TTMSFNCGridEditCellStart.csNone,false,"",0);
          };
        };
      };
    };
    this.CellComboBoxKeyDown = function (Sender, Key, Shift) {
      var $tmp = Key.get();
      if ($tmp === 9) this.HandleDialogKey(Key,rtl.refSet(Shift));
      this.FKeyUsed = true;
      if (rtl.neSet(Shift,{})) return;
      var $tmp1 = Key.get();
      if ($tmp1 === 115) {
        if (this.FEditControl === this.GetCellDatePicker()) ;
      } else if (($tmp1 === 13) || ($tmp1 === 113)) {
        this.HideEdit(Key.get() === 13,false);
        if (Key.get() === 13) Key.set(0);
      } else if ($tmp1 === 27) this.CancelEdit();
    };
    this.CellComboBoxChange = function (Sender) {
      if (this.FKeyUsed) {
        this.FKeyUsed = false;
        return;
      };
      if (this.FOptions.FEditing.FDirectComboClose && this.FEditing) this.StopEdit();
    };
    this.CellComboBoxCloseUp = function (Sender) {
      var v = "";
      var i = 0;
      i = -1;
      v = "";
      if (pas["WEBLib.StdCtrls"].TComboBox.isPrototypeOf(Sender)) {
        i = rtl.as(Sender,pas["WEBLib.StdCtrls"].TComboBox).GetItemIndex();
        if (i >= 0) {
          v = rtl.as(Sender,pas["WEBLib.StdCtrls"].TComboBox).FItems.Get(i)}
         else v = "";
      };
      if (this.FOptions.FEditing.FDirectComboClose) this.HideEdit(true,false);
      this.DoCellComboCloseUp(this.GetFocusedCell().Col,this.GetFocusedCell().Row,i,v);
      this.CellComboBoxChange(Sender);
    };
    this.ScrollTimer = function (Sender) {
      var c = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      var contentr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (!this.FOptions.FMouse.FAutoScrolling) {
        this.FScrollTimer.SetEnabled(false);
        return;
      };
      contentr.$assign(this.GetContentRect());
      if (this.FX >= (contentr.Right - contentr.Left - this.GetFixedRightWidth())) {
        c.$assign(this.GetFocusedCell());
        if (this.FOptions.FMouse.FAutoScrollingSpeedMode === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridAutoScrollingSpeedMode.asmPixels) {
          c.Col = c.Col + (Math.round(this.FX - (contentr.Right - contentr.Left - this.GetFixedRightWidth())) * this.FOptions.FMouse.FAutoScrollingSpeed)}
         else c.Col = c.Col + this.FOptions.FMouse.FAutoScrollingSpeed;
        this.SetFocusCell(c.Col,c.Row);
        this.SelectCell(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(this.GetFocusedCell()),{},this.FMouseDragging);
      } else if (this.FX <= this.GetFixedWidth()) {
        c.$assign(this.GetFocusedCell());
        if (this.FOptions.FMouse.FAutoScrollingSpeedMode === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridAutoScrollingSpeedMode.asmPixels) {
          c.Col = c.Col + (Math.round(this.FX - this.GetFixedWidth()) * this.FOptions.FMouse.FAutoScrollingSpeed)}
         else c.Col = c.Col - this.FOptions.FMouse.FAutoScrollingSpeed;
        this.SetFocusCell(c.Col,c.Row);
        this.SelectCell(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(this.GetFocusedCell()),{},this.FMouseDragging);
      };
      if (this.FY >= (contentr.Bottom - contentr.Top - this.GetFixedFooterHeight())) {
        c.$assign(this.GetFocusedCell());
        if (this.FOptions.FMouse.FAutoScrollingSpeedMode === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridAutoScrollingSpeedMode.asmPixels) {
          c.Row = c.Row + (Math.round(this.FY - (contentr.Bottom - contentr.Top - this.GetFixedFooterHeight())) * this.FOptions.FMouse.FAutoScrollingSpeed)}
         else c.Row = c.Row + this.FOptions.FMouse.FAutoScrollingSpeed;
        this.SetFocusCell(c.Col,c.Row);
        this.SelectCell(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(this.GetFocusedCell()),{},this.FMouseDragging);
      } else if (this.FY <= this.GetFixedHeight()) {
        c.$assign(this.GetFocusedCell());
        if (this.FOptions.FMouse.FAutoScrollingSpeedMode === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridAutoScrollingSpeedMode.asmPixels) {
          c.Row = c.Row + (Math.round(this.FY - this.GetFixedHeight()) * this.FOptions.FMouse.FAutoScrollingSpeed)}
         else c.Row = c.Row - this.FOptions.FMouse.FAutoScrollingSpeed;
        this.SetFocusCell(c.Col,c.Row);
        this.SelectCell(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(this.GetFocusedCell()),{},this.FMouseDragging);
      };
    };
    this.DragTimer = function (Sender) {
      var contentr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (!this.FOptions.FMouse.FAutoDragging) {
        this.FDragTimer.SetEnabled(false);
        return;
      };
      contentr.$assign(this.GetContentRect());
      if (this.FX >= (contentr.Right - contentr.Left)) {
        if (this.FOptions.FMouse.FAutoScrollingSpeedMode === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridAutoScrollingSpeedMode.asmPixels) {
          this.FDragScrollCell.Col = this.FDragScrollCell.Col + (Math.round(this.FX - (contentr.Right - contentr.Left)) * this.FOptions.FMouse.FAutoScrollingSpeed)}
         else this.FDragScrollCell.Col = this.FDragScrollCell.Col + this.FOptions.FMouse.FAutoScrollingSpeed;
        this.Navigate(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(this.FDragScrollCell),false);
      } else if (this.FX <= 0) {
        if (this.FOptions.FMouse.FAutoScrollingSpeedMode === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridAutoScrollingSpeedMode.asmPixels) {
          this.FDragScrollCell.Col = this.FDragScrollCell.Col + (Math.round(this.FX) * this.FOptions.FMouse.FAutoScrollingSpeed)}
         else this.FDragScrollCell.Col = this.FDragScrollCell.Col - this.FOptions.FMouse.FAutoScrollingSpeed;
        this.Navigate(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(this.FDragScrollCell),false);
      };
      if (this.FY >= (contentr.Bottom - contentr.Top)) {
        if (this.FOptions.FMouse.FAutoScrollingSpeedMode === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridAutoScrollingSpeedMode.asmPixels) {
          this.FDragScrollCell.Row = this.FDragScrollCell.Row + (Math.round(this.FY - (contentr.Bottom - contentr.Top)) * this.FOptions.FMouse.FAutoScrollingSpeed)}
         else this.FDragScrollCell.Row = this.FDragScrollCell.Row + this.FOptions.FMouse.FAutoScrollingSpeed;
        this.Navigate(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(this.FDragScrollCell),false);
      } else if (this.FY <= 0) {
        if (this.FOptions.FMouse.FAutoScrollingSpeedMode === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridAutoScrollingSpeedMode.asmPixels) {
          this.FDragScrollCell.Row = this.FDragScrollCell.Row + (Math.round(this.FY) * this.FOptions.FMouse.FAutoScrollingSpeed)}
         else this.FDragScrollCell.Row = this.FDragScrollCell.Row - this.FOptions.FMouse.FAutoScrollingSpeed;
        this.Navigate(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(this.FDragScrollCell),false);
      };
    };
    this.AutoSizeColumnInt = function (ACol, Accurate, Padding) {
      var i = 0;
      var k = 0;
      var cell = null;
      var cellclasstype = null;
      var prevclasstype = null;
      var cellstr = "";
      var m = 0.0;
      var nw = 0.0;
      var tw = 0.0;
      var ctl = null;
      var l = null;
      var bmp = null;
      var totalh = 0.0;
      var rs = 0;
      var c = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      var a = 0;
      l = pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCellLayout.$create("Create$1");
      m = 0;
      nw = 0;
      cell = null;
      prevclasstype = null;
      if (!Accurate) {
        prevclasstype = pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell;
        cell = pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell.$create("Create$1",[this]);
        cell.FScaleFactor = this.FPaintScaleFactor;
        this.DoGetCellLayout(this.FFixedColumns,this.FFixedRows,cell.FLayout,pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellState.csNormal);
        cell.SetWidth(10000);
        cell.SetHeight(10000);
        rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).SetText("g");
        nw = rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).GetTextWidth();
      };
      for (var $l = 0, $end = this.GetRowCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.IsXMergedCell(ACol,i)) continue;
        cellclasstype = null;
        this.DoGetCellClass(ACol,i,{get: function () {
            return cellclasstype;
          }, set: function (v) {
            cellclasstype = v;
          }});
        cellstr = "";
        this.DoGetCellData(ACol,i,{get: function () {
            return cellstr;
          }, set: function (v) {
            cellstr = v;
          }});
        if ((prevclasstype !== cellclasstype) && (prevclasstype !== null) && (cell != null)) cell = rtl.freeLoc(cell);
        if (prevclasstype !== cellclasstype) {
          cell = cellclasstype.$create("Create$1",[this]);
          if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell.isPrototypeOf(cell)) {
            rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).FBitmapContainer = this.GetBitmapContainer();
            rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).FOptimizedHTMLDrawing = this.FOptimizedHTMLDrawing;
          };
        };
        cell.FScaleFactor = this.FPaintScaleFactor;
        prevclasstype = cellclasstype;
        if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell.isPrototypeOf(cell)) {
          a = 0;
          this.DoGetCellRotation(ACol,i,{get: function () {
              return a;
            }, set: function (v) {
              a = v;
            }});
          rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).SetAngle(a);
          rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).SetText(cellstr);
          rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).SetDisplayHTMLFormatting(this.FOptions.FCell.FDisplayHTMLFormatting);
          rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).SetWidth(this.GetColWidths(ACol));
          rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).SetHeight(this.GetRowHeights(i));
        };
        if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCProgressGridCell.isPrototypeOf(cell)) {
          rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCProgressGridCell).SetFormat(this.FAppearance.FProgressLayout.FFormat);
          rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCProgressGridCell).SetTextColor(this.FAppearance.FProgressLayout.FTextColor);
          rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCProgressGridCell).SetColor(this.FAppearance.FProgressLayout.FColor);
          rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCProgressGridCell).SetShowText(this.FAppearance.FProgressLayout.FShowText);
        };
        if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell.isPrototypeOf(cell)) rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell).SetControlBitmap(this.GetCheckBoxBitmap(rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell).FChecked,false,true));
        if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCRadioGridCell.isPrototypeOf(cell)) rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCRadioGridCell).SetControlBitmap(this.GetRadioButtonBitmap(rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCRadioGridCell).FChecked,false,true));
        if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCNodeGridCell.isPrototypeOf(cell)) rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCNodeGridCell).SetControlBitmap(this.GetNodeBitmap(rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCNodeGridCell).FState));
        if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCButtonGridCell.isPrototypeOf(cell)) rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCButtonGridCell).SetControlBitmap(this.GetDummyButtonBitmap(rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCButtonGridCell)));
        this.ApplyCellState(ACol,i,cell);
        if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell.isPrototypeOf(cell)) {
          l.Assign(rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).FLayout);
          this.DoGetCellLayout(ACol,i,l,this.GetCellState(ACol,i));
          rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).AssignLayout(l);
        };
        this.DoGetCellProperties(ACol,i,cell);
        totalh = 0;
        c.$assign(pas["WEBLib.TMSFNCGridData"].MakeCell(ACol,i));
        c.$assign(this.BaseCell(c.Col,c.Row));
        rs = this.RowSpan(c.Col,c.Row);
        if (rs > 0) {
          for (var $l1 = c.Row, $end1 = (c.Row + rs) - 1; $l1 <= $end1; $l1++) {
            k = $l1;
            totalh = totalh + this.GetRowHeights(k);
          };
        } else totalh = this.GetRowHeights(c.Row);
        if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell.isPrototypeOf(cell)) {
          ctl = rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell);
          ctl.SetWidth(10000);
          ctl.SetHeight(totalh - 4);
          if (!Accurate) {
            tw = ctl.GetStrippedHTMLText().length * nw;
            bmp = ctl.GetControlBitmap();
            if ((bmp != null) && !pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(bmp)) tw = tw + bmp.GetWidth();
            if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCFixedGridCell.isPrototypeOf(ctl)) {
              if (rtl.as(ctl,pas["WEBLib.TMSFNCGridCell"].TTMSFNCFixedGridCell).FShowDropDownButton) nw = nw + 19;
              if (rtl.as(ctl,pas["WEBLib.TMSFNCGridCell"].TTMSFNCFixedGridCell).FSortKind !== pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridSortKind.skNone) nw = nw + 16;
            };
            if (tw > m) m = tw;
          } else {
            nw = ctl.GetTextWidth();
            bmp = ctl.GetControlBitmap();
            if ((bmp != null) && !pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(bmp)) nw = nw + bmp.GetWidth();
            if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCFixedGridCell.isPrototypeOf(ctl)) {
              if (rtl.as(ctl,pas["WEBLib.TMSFNCGridCell"].TTMSFNCFixedGridCell).FShowDropDownButton) nw = nw + 19;
              if (rtl.as(ctl,pas["WEBLib.TMSFNCGridCell"].TTMSFNCFixedGridCell).FSortKind !== pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridSortKind.skNone) nw = nw + 16;
            };
            if (nw > m) m = nw;
          };
        };
      };
      if (cell != null) cell = rtl.freeLoc(cell);
      this.SetColWidths(ACol,m + Padding);
      l = rtl.freeLoc(l);
    };
    this.AutoSizeRowInt = function (ARow, Padding) {
      var i = 0;
      var k = 0;
      var cell = null;
      var cellclasstype = null;
      var prevclasstype = null;
      var cellstr = "";
      var m = 0.0;
      var nw = 0.0;
      var ctl = null;
      var l = null;
      var bmp = null;
      var c = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      var totalw = 0.0;
      var cs = 0;
      var a = 0;
      l = pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCellLayout.$create("Create$1");
      m = 0;
      prevclasstype = null;
      cell = null;
      for (var $l = 0, $end = this.GetColumnCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.IsYMergedCell(i,ARow)) continue;
        cellclasstype = null;
        this.DoGetCellClass(i,ARow,{get: function () {
            return cellclasstype;
          }, set: function (v) {
            cellclasstype = v;
          }});
        cellstr = "";
        this.DoGetCellData(i,ARow,{get: function () {
            return cellstr;
          }, set: function (v) {
            cellstr = v;
          }});
        if ((prevclasstype !== cellclasstype) && (prevclasstype !== null) && (cell != null)) cell = rtl.freeLoc(cell);
        if (prevclasstype !== cellclasstype) {
          cell = cellclasstype.$create("Create$1",[this]);
          if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell.isPrototypeOf(cell)) {
            rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).SetLayout(null);
            rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).FBitmapContainer = this.GetBitmapContainer();
            rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).FOptimizedHTMLDrawing = this.FOptimizedHTMLDrawing;
          };
        };
        cell.FScaleFactor = this.FPaintScaleFactor;
        prevclasstype = cellclasstype;
        if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell.isPrototypeOf(cell)) {
          a = 0;
          this.DoGetCellRotation(i,ARow,{get: function () {
              return a;
            }, set: function (v) {
              a = v;
            }});
          rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).SetAngle(a);
          rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).SetText(cellstr);
          rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).SetDisplayHTMLFormatting(this.FOptions.FCell.FDisplayHTMLFormatting);
          rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).SetWidth(this.GetColWidths(i));
          rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).SetHeight(this.GetRowHeights(ARow));
        };
        if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCProgressGridCell.isPrototypeOf(cell)) {
          rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCProgressGridCell).SetFormat(this.FAppearance.FProgressLayout.FFormat);
          rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCProgressGridCell).SetTextColor(this.FAppearance.FProgressLayout.FTextColor);
          rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCProgressGridCell).SetColor(this.FAppearance.FProgressLayout.FColor);
          rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCProgressGridCell).SetShowText(this.FAppearance.FProgressLayout.FShowText);
        };
        if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell.isPrototypeOf(cell)) rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell).SetControlBitmap(this.GetCheckBoxBitmap(rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell).FChecked,false,true));
        if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCRadioGridCell.isPrototypeOf(cell)) rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCRadioGridCell).SetControlBitmap(this.GetRadioButtonBitmap(rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCRadioGridCell).FChecked,false,true));
        if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCNodeGridCell.isPrototypeOf(cell)) rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCNodeGridCell).SetControlBitmap(this.GetNodeBitmap(rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCNodeGridCell).FState));
        if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCButtonGridCell.isPrototypeOf(cell)) rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCButtonGridCell).SetControlBitmap(this.GetDummyButtonBitmap(rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCButtonGridCell)));
        this.ApplyCellState(i,ARow,cell);
        if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell.isPrototypeOf(cell)) {
          l.Assign(rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).FLayout);
          this.DoGetCellLayout(i,ARow,l,this.GetCellState(i,ARow));
          rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).AssignLayout(l);
        };
        this.DoGetCellProperties(i,ARow,cell);
        totalw = 0;
        c.$assign(pas["WEBLib.TMSFNCGridData"].MakeCell(i,ARow));
        c.$assign(this.BaseCell(c.Col,c.Row));
        cs = this.ColSpan(c.Col,c.Row);
        if (cs > 0) {
          for (var $l1 = c.Col, $end1 = (c.Col + cs) - 1; $l1 <= $end1; $l1++) {
            k = $l1;
            totalw = totalw + this.GetColWidths(k);
          };
        } else totalw = this.GetColWidths(c.Col);
        if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell.isPrototypeOf(cell)) {
          ctl = rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell);
          ctl.SetWidth(totalw - 4);
          ctl.SetHeight(10000);
          nw = ctl.GetTextHeight();
          bmp = ctl.GetControlBitmap();
          if ((bmp != null) && !pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(bmp)) {
            if (bmp.GetHeight() > nw) nw = bmp.GetHeight();
          };
          if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCFixedGridCell.isPrototypeOf(ctl)) {
            if (rtl.as(ctl,pas["WEBLib.TMSFNCGridCell"].TTMSFNCFixedGridCell).FShowDropDownButton) {
              if (15 > nw) nw = 15;
            };
            if (rtl.as(ctl,pas["WEBLib.TMSFNCGridCell"].TTMSFNCFixedGridCell).FSortKind !== pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridSortKind.skNone) {
              if (12 > nw) nw = 12;
            };
          };
          if (nw > m) m = nw;
        };
      };
      if (cell != null) cell = rtl.freeLoc(cell);
      this.SetRowHeights(ARow,m + Padding);
      l = rtl.freeLoc(l);
    };
    this.DoCheckBoxClick = function (Sender) {
      var cell = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      var cl = null;
      this.StopEdit();
      if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell.isPrototypeOf(Sender)) {
        cl = rtl.as(Sender,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell);
        cell.$assign(this.GetCellByObject(cl));
        if ((cell.Row !== -1) && (cell.Col !== -1)) {
          if (this.FAdapter != null) this.FAdapter.CellCheckBoxClick(cell.Col,cell.Row,cl);
          this.DoCellCheckBoxClick(cell.Col,cell.Row,cl);
        };
      };
    };
    this.DoRadioButtonClick = function (Sender) {
      var cell = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      var cl = null;
      if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell.isPrototypeOf(Sender)) {
        cl = rtl.as(Sender,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell);
        cell.$assign(this.GetCellByObject(cl));
        if ((cell.Row !== -1) && (cell.Col !== -1)) this.DoCellRadioButtonClick(cell.Col,cell.Row,cl);
      };
    };
    this.DoButtonClick = function (Sender) {
      var cell = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      var cl = null;
      if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell.isPrototypeOf(Sender)) {
        cl = rtl.as(Sender,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell);
        cell.$assign(this.GetCellByObject(cl));
        if ((cell.Row !== -1) && (cell.Col !== -1)) this.DoCellButtonClick(cell.Col,cell.Row,cl);
      };
    };
    this.DoNodeClick = function (Sender) {
      var cell = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      var cl = null;
      if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell.isPrototypeOf(Sender)) {
        cl = rtl.as(Sender,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell);
        cell.$assign(this.GetCellByObject(cl));
        if ((cell.Row !== -1) && (cell.Col !== -1)) this.DoCellNodeClick(cell.Col,cell.Row,cl);
      };
    };
    this.DoBitmapClick = function (Sender) {
      var cell = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      var cl = null;
      if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell.isPrototypeOf(Sender)) {
        cl = rtl.as(Sender,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell);
        cell.$assign(this.GetCellByObject(cl));
        if ((cell.Row !== -1) && (cell.Col !== -1)) this.DoCellBitmapClick(cell.Col,cell.Row,cl);
      };
    };
    this.DoCommentClick = function (Sender) {
      var cell = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      var cl = null;
      if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell.isPrototypeOf(Sender)) {
        cl = rtl.as(Sender,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell);
        cell.$assign(this.GetCellByObject(cl));
        if ((cell.Row !== -1) && (cell.Col !== -1)) this.DoCellCommentClick(cell.Col,cell.Row,cl);
      };
    };
    this.DoFixedDropDownButtonClick = function (Sender) {
      var cell = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      var cl = null;
      if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell.isPrototypeOf(Sender)) {
        cl = rtl.as(Sender,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell);
        cell.$assign(this.GetCellByObject(cl));
        if ((cell.Row !== -1) && (cell.Col !== -1)) this.DoFixedCellDropDownButtonClick(cell.Col,cell.Row,cl);
      };
    };
    this.DoCellAnchorClick = function (ACol, ARow, AAnchor) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoCellAnchorClick.apply(this,arguments);
      if (this.FOptions.FURL.FOpen) pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.OpenURL(AAnchor);
      if (this.FOnCellAnchorClick != null) this.FOnCellAnchorClick(this,ACol,ARow,AAnchor);
    };
    this.DoCanSizeColumn = function (ACol, Allow) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoCanSizeColumn.apply(this,arguments);
      if (this.FOnCanSizeColumn != null) this.FOnCanSizeColumn(this,ACol,Allow);
    };
    this.DoCanSizeRow = function (ARow, Allow) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoCanSizeRow.apply(this,arguments);
      if (this.FOnCanSizeRow != null) this.FOnCanSizeRow(this,ARow,Allow);
    };
    this.DoColumnSize = function (ACol, NewWidth) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoColumnSize.apply(this,arguments);
      if (this.FOnColumnSize != null) this.FOnColumnSize(this,ACol,NewWidth);
    };
    this.DoRowSize = function (ARow, NewHeight) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoRowSize.apply(this,arguments);
      if (this.FOnRowSize != null) this.FOnRowSize(this,ARow,NewHeight);
    };
    this.DoColumnSized = function (ACol, NewWidth) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoColumnSized.apply(this,arguments);
      if (this.FOnColumnSized != null) this.FOnColumnSized(this,ACol,NewWidth);
    };
    this.DoRowSized = function (ARow, NewHeight) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoRowSized.apply(this,arguments);
      if (this.FOnRowSized != null) this.FOnRowSized(this,ARow,NewHeight);
    };
    this.DoCanSortColumn = function (ACol, Allow) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoCanSortColumn.apply(this,arguments);
      if (this.FOnCanSortColumn != null) this.FOnCanSortColumn(this,ACol,Allow);
    };
    this.DoColumnSorted = function (ACol, Direction) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoColumnSorted.apply(this,arguments);
      if (this.FOnColumnSorted != null) this.FOnColumnSorted(this,ACol,Direction);
    };
    this.DoCanDragColumn = function (ACol, Allow) {
      if (this.FOnCanDragColumn != null) this.FOnCanDragColumn(this,ACol,Allow);
    };
    this.DoCanDragRow = function (ARow, Allow) {
      if (this.FOnCanDragRow != null) this.FOnCanDragRow(this,ARow,Allow);
    };
    this.DoColumnDragged = function (FromColumn, ToColumn) {
      if (this.FOnColumnDragged != null) this.FOnColumnDragged(this,FromColumn,ToColumn);
    };
    this.DoRowDragged = function (FromRow, ToRow) {
      if (this.FOnRowDragged != null) this.FOnRowDragged(this,FromRow,ToRow);
    };
    this.DoBeforeCellEditExit = function (ACol, ARow, CellEditor, AllowExit) {
      if (this.FAdapter != null) this.FAdapter.CellBeforeEditExit(ACol,ARow,CellEditor,AllowExit);
      if (this.FOnBeforeCellEditExit != null) this.FOnBeforeCellEditExit(this,ACol,ARow,CellEditor,AllowExit);
    };
    this.DoBeforeColumnDrop = function (FromColumn, ToColumn, Allow) {
      if (this.FOnBeforeColumnDrop != null) this.FOnBeforeColumnDrop(this,FromColumn,ToColumn,Allow);
    };
    this.DoBeforeRowDrop = function (FromRow, ToRow, Allow) {
      if (this.FOnBeforeRowDrop != null) this.FOnBeforeRowDrop(this,FromRow,ToRow,Allow);
    };
    this.DoFixedCellDropDownButtonClick = function (ACol, ARow, ACell) {
      var sl = null;
      var i = 0;
      var c = 0;
      var pt = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoFixedCellDropDownButtonClick.apply(this,arguments);
      if (this.FOptions.FFiltering.FDropDown && (this.FOptions.FFiltering.FDropDownFixedRow === ARow)) {
        sl = pas.Classes.TStringList.$create("Create$1");
        try {
          sl.FDuplicates = pas.Types.TDuplicates.dupIgnore;
          sl.SetSorted(true);
          sl.Add(rtl.getResStr($mod,"sTMSFNCGridFilterAll"));
          c = this.DisplToRealColumn(ACol);
          for (var $l = this.FFixedRows, $end = (this.GetRowCount() - this.FFixedFooterRows - 1) + this.GetHiddenRowCount(); $l <= $end; $l++) {
            i = $l;
            sl.Add(pas.SysUtils.Trim(this.GetAllCells(c,i)));
          };
          this.DoNeedFilterDropDownData(c,ARow,sl);
          this.FFilterListBox.SetParent(this);
          this.FFilterListBox.FItems.Assign(sl);
          this.FFilterListBox.SetItemIndex(-1);
          this.FFilterListBox.SetParent(null);
          this.FFilterListBox.FTag$1 = ACol;
        } finally {
          sl = rtl.freeLoc(sl);
        };
      };
      this.FFilterPopup.SetPlacementControl(this);
      pt.$assign(this.LocalToScreenEx(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF((ACell.FLeft + ACell.FWidth) - (17 * this.FPaintScaleFactor),ACell.FTop + ((ACell.FHeight + (15 * this.FPaintScaleFactor)) / 2)))));
      this.FFilterPopup.FPlacementRectangle.SetLeft(pt.X);
      this.FFilterPopup.FPlacementRectangle.SetTop(pt.Y);
      this.FFilterPopup.FPlacementRectangle.SetRight(pt.X + this.FFilterPopup.FDropDownWidth);
      this.FFilterPopup.FPlacementRectangle.SetBottom(pt.Y + this.FFilterPopup.FDropDownHeight);
      this.FFilterListBox.SetWidth(this.FOptions.FFiltering.FDropDownWidth);
      this.FFilterListBox.SetHeight(this.FOptions.FFiltering.FDropDownHeight);
      this.FFilterPopup.SetDropDownHeight(this.FOptions.FFiltering.FDropDownHeight);
      this.FFilterPopup.SetDropDownWidth(this.FOptions.FFiltering.FDropDownWidth);
      this.FFilterPopup.SetContentControl(this.FFilterListBox);
      this.FFilterPopup.FFocusedControl = this.FFilterListBox;
      this.FFilterPopup.Popup(false);
      if (this.FOnFixedCellDropDownButtonClick != null) this.FOnFixedCellDropDownButtonClick(this,ACol,ARow,ACell);
    };
    this.DoCellCheckBoxClick = function (ACol, ARow, ACell) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoCellCheckBoxClick.apply(this,arguments);
      if (this.FOnCellCheckBoxClick != null) this.FOnCellCheckBoxClick(this,ACol,ARow,ACell);
    };
    this.DoCellRadioButtonClick = function (ACol, ARow, ACell) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoCellRadioButtonClick.apply(this,arguments);
      if (this.FOnCellRadioButtonClick != null) this.FOnCellRadioButtonClick(this,ACol,ARow,ACell);
    };
    this.DoCellButtonClick = function (ACol, ARow, ACell) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoCellButtonClick.apply(this,arguments);
      if (this.FOnCellButtonClick != null) this.FOnCellButtonClick(this,ACol,ARow,ACell);
    };
    this.DoGetCellIsFixed = function (ACol, ARow, ACellFixed) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoGetCellIsFixed.apply(this,arguments);
      if (this.FOnGetCellIsFixed != null) this.FOnGetCellIsFixed(this,ACol,ARow,ACellFixed);
    };
    this.DoGetRowIsBand = function (ARow, ARowBand) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoGetRowIsBand.apply(this,arguments);
      if (this.FOnGetRowIsBand != null) this.FOnGetRowIsBand(this,ARow,ARowBand);
    };
    this.DoCellBitmapClick = function (ACol, ARow, ACell) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoCellBitmapClick.apply(this,arguments);
      if (this.FOnCellBitmapClick != null) this.FOnCellBitmapClick(this,ACol,ARow,ACell);
    };
    this.DoCellCommentClick = function (ACol, ARow, ACell) {
      var g = null;
      var sz = pas["WEBLib.TMSFNCTypes"].TSizeF.$new();
      var pt = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoCellCommentClick.apply(this,arguments);
      this.FCommentPopup.SetPlacementControl(this);
      this.FActiveComment = rtl.as(ACell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCCommentGridCell).FCommentText;
      this.FActiveCommentTextColor = rtl.as(ACell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCCommentGridCell).FCommentTextColor;
      g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[1,1,false,true]);
      g.BeginScene();
      g.FBitmapContainer = this.GetBitmapContainer();
      g.FOptimizedHTMLDrawing = this.FOptimizedHTMLDrawing;
      try {
        sz.$assign(g.CalculateTextSize(this.FActiveComment,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,10000,10000)),true,true));
        this.FCommentPopup.SetDropDownHeight(sz.cy + 10);
        this.FCommentPopup.SetDropDownWidth(sz.cx + 10);
      } finally {
        g.EndScene();
        g = rtl.freeLoc(g);
      };
      pt.$assign(this.LocalToScreenEx(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF((ACell.FLeft + ACell.FWidth) - this.FCommentPopup.FDropDownWidth,ACell.FTop - this.FCommentPopup.FDropDownHeight))));
      this.FCommentPopup.FPlacementRectangle.SetLeft(pt.X);
      this.FCommentPopup.FPlacementRectangle.SetTop(pt.Y);
      this.FCommentPopup.FPlacementRectangle.SetRight(pt.X + this.FCommentPopup.FDropDownWidth);
      this.FCommentPopup.FPlacementRectangle.SetBottom(pt.Y + this.FCommentPopup.FDropDownHeight);
      this.FCommentPopup.Popup(false);
      if (this.FOnCellCommentClick != null) this.FOnCellCommentClick(this,ACol,ARow,ACell);
    };
    this.DoCellSortClick = function (Shift, ACol, ARow, Direction, ACell) {
      var AllowSort = false;
      var sortc = null;
      if (this.FOptions.FSorting.FMode !== pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSortingMode.gsmNone) {
        AllowSort = true;
        this.DoCanSortColumn(ACol,{get: function () {
            return AllowSort;
          }, set: function (v) {
            AllowSort = v;
          }});
        if (AllowSort) {
          sortc = rtl.as(ACell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCFixedGridCell);
          if (sortc != null) {
            if (this.FOptions.FSorting.FMode === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSortingMode.gsmIndexed) {
              if (!(pas.Classes.TShiftState$a.ssShift in Shift)) {
                this.FSortIndexes.Clear();
                this.ClearFixedSorting(sortc);
              };
            } else this.ClearFixedSorting(sortc);
            var $tmp = sortc.FSortKind;
            if ($tmp === pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridSortKind.skAscending) {
              Direction = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridSortDirection.sdDescending;
              if (this.FOptions.FSorting.FMode === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSortingMode.gsmIndexed) {
                if (this.FSortIndexes.FindIndex(ACol) === -1) {
                  this.FSortIndexes.AddIndex(ACol,pas["WEBLib.TMSFNCGridData"].TTMSFNCGridSortDirection.sdDescending)}
                 else this.FSortIndexes.ToggleIndex(ACol);
                sortc.FSortIndex = this.FSortIndexes.FindIndex(ACol) + 1;
              } else sortc.FSortIndex = -1;
              sortc.FSortKind = pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridSortKind.skDescending;
            } else if (($tmp === pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridSortKind.skNone) || ($tmp === pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridSortKind.skDescending)) {
              Direction = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridSortDirection.sdAscending;
              if (this.FOptions.FSorting.FMode === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSortingMode.gsmIndexed) {
                if (this.FSortIndexes.FindIndex(ACol) === -1) {
                  this.FSortIndexes.AddIndex(ACol,pas["WEBLib.TMSFNCGridData"].TTMSFNCGridSortDirection.sdAscending)}
                 else this.FSortIndexes.ToggleIndex(ACol);
                sortc.FSortIndex = this.FSortIndexes.FindIndex(ACol) + 1;
              } else sortc.FSortIndex = -1;
              sortc.FSortKind = pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridSortKind.skAscending;
            };
            pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoCellSortClick.call(this,rtl.refSet(Shift),ACol,ARow,Direction,ACell);
            if (this.FOnCellSortClick != null) this.FOnCellSortClick(this,ACol,ARow,ACell);
            this.DoColumnSorted(ACol,Direction);
          };
        };
      };
    };
    this.DoCellNodeClick = function (ACol, ARow, ACell) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoCellNodeClick.apply(this,arguments);
      if (this.FOnCellNodeClick != null) this.FOnCellNodeClick(this,ACol,ARow,ACell);
    };
    this.DoInsertRow = function (ARow) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoInsertRow.apply(this,arguments);
      if (this.FOnInsertRow != null) this.FOnInsertRow(this,ARow);
    };
    this.DoDeleteRow = function (ARow) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoDeleteRow.apply(this,arguments);
      if (this.FOnDeleteRow != null) this.FOnDeleteRow(this,ARow);
    };
    this.DoAppendRow = function (ARow) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoAppendRow.apply(this,arguments);
      if (this.FOnAppendRow != null) this.FOnAppendRow(this,ARow);
    };
    this.DoAppendColumn = function (ACol) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoAppendColumn.apply(this,arguments);
      if (this.FOnAppendColumn != null) this.FOnAppendColumn(this,ACol);
    };
    this.DoCanInsertRow = function (ARow, Allow) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoCanInsertRow.apply(this,arguments);
      if (this.FOnCanInsertRow != null) this.FOnCanInsertRow(this,ARow,Allow);
    };
    this.DoCanDeleteRow = function (ARow, Allow) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoCanDeleteRow.apply(this,arguments);
      if (this.FOnCanDeleteRow != null) this.FOnCanDeleteRow(this,ARow,Allow);
    };
    this.DoCanAppendRow = function (ARow, Allow) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoCanAppendRow.apply(this,arguments);
      if (this.FOnCanAppendRow != null) this.FOnCanAppendRow(this,ARow,Allow);
    };
    this.DoCanAppendColumn = function (ACol, Allow) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoCanAppendColumn.apply(this,arguments);
      if (this.FOnCanAppendColumn != null) this.FOnCanAppendColumn(this,ACol,Allow);
    };
    this.DoCellRightClick = function (ACol, ARow) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoCellRightClick.apply(this,arguments);
      if (this.FOnCellRightClick != null) this.FOnCellRightClick(this,ACol,ARow);
    };
    this.DoFixedCellRightClick = function (ACol, ARow) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoFixedCellRightClick.apply(this,arguments);
      if (this.FOnFixedCellRightClick != null) this.FOnFixedCellRightClick(this,ACol,ARow);
    };
    this.DoCellClick = function (ACol, ARow) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoCellClick.apply(this,arguments);
      if (this.FOnCellClick != null) this.FOnCellClick(this,ACol,ARow);
    };
    this.DoFixedCellClick = function (Shift, ACol, ARow) {
      var cell = null;
      var cl = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoFixedCellClick.apply(this,arguments);
      cl.Col = ACol;
      cl.Row = ARow;
      cell = this.GetCellObject(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(this.GetDisplayCell(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(cl))));
      if (cell != null) {
        if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCFixedGridCell.isPrototypeOf(cell) && (ARow === this.FOptions.FSorting.FRow)) this.DoCellSortClick(rtl.refSet(Shift),ACol,ARow,pas["WEBLib.TMSFNCGridData"].TTMSFNCGridSortDirection.sdAscending,cell);
      };
      if (this.FOnFixedCellClick != null) this.FOnFixedCellClick(this,ACol,ARow);
    };
    this.DoCellDblClick = function (ACol, ARow) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoCellDblClick.apply(this,arguments);
      if (this.FOnCellDblClick != null) this.FOnCellDblClick(this,ACol,ARow);
    };
    this.DoFixedCellDblClick = function (ACol, ARow) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoFixedCellDblClick.apply(this,arguments);
      if (this.FOnFixedCellDblClick != null) this.FOnFixedCellDblClick(this,ACol,ARow);
    };
    this.DoGetCellClass = function (ACol, ARow, CellClassType) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoGetCellClass.apply(this,arguments);
      if (this.FAdapter != null) this.FAdapter.GetCellClass(ACol,ARow,CellClassType);
      if (this.FOnGetCellClass != null) this.FOnGetCellClass(this,ACol,ARow,CellClassType);
    };
    this.DoGetCellData = function (ACol, ARow, CellString) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoGetCellData.apply(this,arguments);
      if (this.FAdapter != null) this.FAdapter.GetCellData(ACol,ARow,CellString);
      if (this.FOnGetCellData != null) this.FOnGetCellData(this,ACol,ARow,CellString);
    };
    this.DoGetCellRotation = function (ACol, ARow, Angle) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoGetCellRotation.apply(this,arguments);
      if (this.FOnGetCellRotation != null) this.FOnGetCellRotation(this,ACol,ARow,Angle);
    };
    this.DoGetCellLayout = function (ACol, ARow, ALayout, ACellState) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoGetCellLayout.apply(this,arguments);
      if (this.FOnGetCellLayout != null) this.FOnGetCellLayout(this,ACol,ARow,ALayout,ACellState);
    };
    this.DoGetCellProperties = function (ACol, ARow, Cell) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoGetCellProperties.apply(this,arguments);
      if (this.FAdapter != null) this.FAdapter.GetCellProperties(ACol,ARow,Cell);
      if (this.FOnGetCellProperties != null) this.FOnGetCellProperties(this,ACol,ARow,Cell);
    };
    this.DoGetCellMergeInfo = function (ACol, ARow, ABaseCol, ABaseRow, AColSpan, ARowSpan) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoGetCellMergeInfo.apply(this,arguments);
      if (this.FOnGetCellMergeInfo != null) this.FOnGetCellMergeInfo(this,ACol,ARow,ABaseCol,ABaseRow,AColSpan,ARowSpan);
    };
    this.DoGetCellEditorCustomClassType = function (ACol, ARow, CellEditorCustomClassType) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoGetCellEditorCustomClassType.apply(this,arguments);
      if (this.FOnGetCellEditorCustomClassType != null) this.FOnGetCellEditorCustomClassType(this,ACol,ARow,CellEditorCustomClassType);
    };
    this.DoGetCellEditorType = function (ACol, ARow, CellEditorType) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoGetCellEditorType.apply(this,arguments);
      if (this.FAdapter != null) this.FAdapter.GetCellEditorType(ACol,ARow,CellEditorType);
      if (this.FOnGetCellEditorType != null) this.FOnGetCellEditorType(this,ACol,ARow,CellEditorType);
    };
    this.DoCellEditGetData = function (ACol, ARow, CellEditor, CellString) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoCellEditGetData.apply(this,arguments);
      if (this.FAdapter != null) this.FAdapter.CellEditGetData(ACol,ARow,CellEditor,CellString);
      if (this.FOnCellEditGetData != null) this.FOnCellEditGetData(this,ACol,ARow,CellEditor,CellString);
    };
    this.DoCellEditValidateData = function (ACol, ARow, CellEditor, CellString, Allow) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoCellEditValidateData.apply(this,arguments);
      if (this.FOnCellEditValidateData != null) this.FOnCellEditValidateData(this,ACol,ARow,CellEditor,CellString,Allow);
      if (this.FAdapter != null) this.FAdapter.CellEditValidateData(ACol,ARow,CellEditor,CellString,Allow);
    };
    this.DoCellEditSetData = function (ACol, ARow, CellEditor, CellString) {
      if (this.FAdapter != null) this.FAdapter.CellEditSetData(ACol,ARow,CellEditor,CellString);
      if (this.FOnCellEditSetData != null) this.FOnCellEditSetData(this,ACol,ARow,CellEditor,CellString);
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoCellEditSetData.apply(this,arguments);
    };
    this.DoCellComboCloseUp = function (ACol, ARow, ItemIndex, Value) {
      if (this.FOnCellComboCloseUp != null) this.FOnCellComboCloseUp(this,ACol,ARow,ItemIndex,Value);
    };
    this.DoCellEditGetColor = function (ACol, ARow, CellEditor, CellColor) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoCellEditGetColor.apply(this,arguments);
      if (this.FOnCellEditGetColor != null) this.FOnCellEditGetColor(this,ACol,ARow,CellEditor,CellColor);
    };
    this.DoCellEditValidateColor = function (ACol, ARow, CellEditor, CellColor, Allow) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoCellEditValidateColor.apply(this,arguments);
      if (this.FOnCellEditValidateColor != null) this.FOnCellEditValidateColor(this,ACol,ARow,CellEditor,CellColor,Allow);
    };
    this.DoCellEditSetColor = function (ACol, ARow, CellEditor, CellColor) {
      if (this.FOnCellEditSetColor != null) this.FOnCellEditSetColor(this,ACol,ARow,CellEditor,CellColor);
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoCellEditSetColor.apply(this,arguments);
    };
    this.DoCellEditDone = function (ACol, ARow, CellEditor) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoCellEditDone.apply(this,arguments);
      if (this.FAdapter != null) this.FAdapter.CellEditDone(ACol,ARow,CellEditor);
      if (this.FOnCellEditDone != null) this.FOnCellEditDone(this,ACol,ARow,CellEditor);
      if (this.FOnInternalCellEditDone != null) this.FOnInternalCellEditDone(this,ACol,ARow,CellEditor);
    };
    this.DoCellEditCancel = function (ACol, ARow) {
      if (this.FAdapter != null) this.FAdapter.CellEditCancel(ACol,ARow);
      if (this.FOnCellEditCancel != null) this.FOnCellEditCancel(this,ACol,ARow);
    };
    this.DoGetCellEditorProperties = function (ACol, ARow, CellEditor) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoGetCellEditorProperties.apply(this,arguments);
      if (pas["WEBLib.StdCtrls"].TComboBox.isPrototypeOf(CellEditor)) rtl.as(CellEditor,pas["WEBLib.StdCtrls"].TComboBox).SetParent(this);
      if (this.FAdapter != null) this.FAdapter.GetCellEditorProperties(ACol,ARow,CellEditor);
      if (this.FOnGetCellEditorProperties != null) this.FOnGetCellEditorProperties(this,ACol,ARow,CellEditor);
      if (pas["WEBLib.StdCtrls"].TComboBox.isPrototypeOf(CellEditor)) rtl.as(CellEditor,pas["WEBLib.StdCtrls"].TComboBox).SetParent(null);
    };
    this.DoGetCellReadOnly = function (ACol, ARow, AReadOnly) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.DoGetCellReadOnly.apply(this,arguments);
      if (this.FAdapter != null) this.FAdapter.GetCellReadOnly(ACol,ARow,AReadOnly);
      if (this.FOnGetCellReadOnly != null) this.FOnGetCellReadOnly(this,ACol,ARow,AReadOnly);
    };
    this.DoBeforeDrawCell = function (Sender, AGraphics, ARect, ATextRect, ADrawText, ADrawBackGround, ADrawBorder, AllowDraw) {
      var cell = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      var cl = null;
      if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell.isPrototypeOf(Sender)) {
        cl = rtl.as(Sender,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell);
        cell.$assign(this.GetCellByObject(cl));
        if ((cell.Row !== -1) && (cell.Col !== -1)) this.DoBeforeDrawGridCell(cell.Col,cell.Row,AGraphics,ARect,ATextRect,ADrawText,ADrawBackGround,ADrawBorder,AllowDraw);
      };
    };
    this.DoAfterDrawCell = function (Sender, AGraphics, ARect, ATextRect) {
      var cell = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      var cl = null;
      if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell.isPrototypeOf(Sender)) {
        cl = rtl.as(Sender,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell);
        cell.$assign(this.GetCellByObject(cl));
        if ((cell.Row !== -1) && (cell.Col !== -1)) this.DoAfterDrawGridCell(cell.Col,cell.Row,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ATextRect));
      };
    };
    this.DoBeforeDrawGridCell = function (ACol, ARow, AGraphics, ARect, ATextRect, ADrawText, ADrawBackGround, ADrawBorder, AllowDraw) {
      if (this.FOnCellBeforeDraw != null) this.FOnCellBeforeDraw(this,ACol,ARow,AGraphics,ARect,ATextRect,ADrawText,ADrawBackGround,ADrawBorder,AllowDraw);
    };
    this.DoAfterDrawGridCell = function (ACol, ARow, AGraphics, ARect, ATextRect) {
      if (this.FOnCellAfterDraw != null) this.FOnCellAfterDraw(this,ACol,ARow,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ATextRect));
    };
    this.DisplayCellsAlternate = function (x, y, xOrig, yOrig, CStart, CStop, RStart, RStop, Ci, Ri, ResetCi, Fixed) {
      var cw = 0.0;
      var rh = 0.0;
      var cwr = 0.0;
      var rhr = 0.0;
      var cwrt = 0.0;
      var rhrt = 0.0;
      var xr = 0.0;
      var yr = 0.0;
      var cell = null;
      var c = 0;
      var r = 0;
      var bc = 0;
      var br = 0;
      var cs = 0;
      var rs = 0;
      var cellclasstype = null;
      var cellr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var cellstr = "";
      var I = 0;
      var l = null;
      var a = 0;
      l = pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCellLayout.$create("Create$1");
      for (var $l = RStart, $end = RStop; $l <= $end; $l++) {
        r = $l;
        rh = this.GetRowHeights(r);
        if (this.FAdapter != null) this.FAdapter.StartBuild(r);
        for (var $l1 = CStart, $end1 = CStop; $l1 <= $end1; $l1++) {
          c = $l1;
          bc = c;
          br = r;
          cs = 0;
          rs = 0;
          cw = this.GetColWidths(c);
          this.DoGetCellMergeInfo(c,r,{get: function () {
              return bc;
            }, set: function (v) {
              bc = v;
            }},{get: function () {
              return br;
            }, set: function (v) {
              br = v;
            }},{get: function () {
              return cs;
            }, set: function (v) {
              cs = v;
            }},{get: function () {
              return rs;
            }, set: function (v) {
              rs = v;
            }});
          cellclasstype = null;
          this.DoGetCellClass(bc,br,{get: function () {
              return cellclasstype;
            }, set: function (v) {
              cellclasstype = v;
            }});
          cell = null;
          if (rtl.length(this.FCellArray) > Ci) if (rtl.length(this.FCellArray[Ci]) > Ri) {
            cell = this.FCellArray[Ci][Ri];
          };
          if (cell != null) {
            if (cell.$class.ClassType() !== cellclasstype) {
              cell = rtl.freeLoc(cell);
              cell = null;
              this.FCellArray[Ci][Ri] = null;
            };
          };
          cwr = cw;
          rhr = rh;
          cwrt = 0;
          for (var $l2 = bc, $end2 = (bc + cs) - 1; $l2 <= $end2; $l2++) {
            I = $l2;
            cwrt = cwrt + this.GetColWidths(I);
          };
          if (cwrt > 0) cwr = cwrt;
          rhrt = 0;
          for (var $l3 = br, $end3 = (br + rs) - 1; $l3 <= $end3; $l3++) {
            I = $l3;
            rhrt = rhrt + this.GetRowHeights(I);
          };
          if (rhrt > 0) rhr = rhrt;
          xr = 0;
          for (var $l4 = bc, $end4 = c - 1; $l4 <= $end4; $l4++) {
            I = $l4;
            xr = xr + this.GetColWidths(I);
          };
          yr = 0;
          for (var $l5 = br, $end5 = r - 1; $l5 <= $end5; $l5++) {
            I = $l5;
            yr = yr + this.GetRowHeights(I);
          };
          cellr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(x - xr,y - yr,(x - xr) + cwr + 1,(y - yr) + rhr + 1));
          if (!(cell != null)) {
            cell = cellclasstype.$create("Create$1",[this]);
            if (rtl.length(this.FCellArray) <= Ci) this.FCellArray = rtl.arraySetLength(this.FCellArray,[],Ci + 1);
            if (rtl.length(this.FCellArray[Ci]) <= Ri) this.FCellArray[Ci] = rtl.arraySetLength(this.FCellArray[Ci],null,Ri + 1);
          };
          if (cell != null) {
            cell.FScaleFactor = this.FPaintScaleFactor;
            this.FCellArray[bc][br] = cell;
            cellstr = "";
            this.DoGetCellData(bc,br,{get: function () {
                return cellstr;
              }, set: function (v) {
                cellstr = v;
              }});
            if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell.isPrototypeOf(cell)) {
              a = 0;
              this.DoGetCellRotation(bc,br,{get: function () {
                  return a;
                }, set: function (v) {
                  a = v;
                }});
              rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).SetAngle(a);
              rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).FOnBeforeDraw = rtl.createCallback(this,"DoBeforeDrawCell");
              rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).FOnAfterDraw = rtl.createCallback(this,"DoAfterDrawCell");
              rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).SetLayout(null);
              rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).SetText(cellstr);
              rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).SetDisplayHTMLFormatting(this.FOptions.FCell.FDisplayHTMLFormatting);
              rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).FBitmapContainer = this.GetBitmapContainer();
              rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).FOptimizedHTMLDrawing = this.FOptimizedHTMLDrawing;
            };
            if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCProgressGridCell.isPrototypeOf(cell)) {
              rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCProgressGridCell).SetFormat(this.FAppearance.FProgressLayout.FFormat);
              rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCProgressGridCell).SetTextColor(this.FAppearance.FProgressLayout.FTextColor);
              rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCProgressGridCell).SetColor(this.FAppearance.FProgressLayout.FColor);
              rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCProgressGridCell).SetShowText(this.FAppearance.FProgressLayout.FShowText);
            };
            if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCNodeGridCell.isPrototypeOf(cell)) rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCNodeGridCell).FOnControlClick = rtl.createCallback(this,"DoNodeClick");
            if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCCommentGridCell.isPrototypeOf(cell)) rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCCommentGridCell).FOnControlClick = rtl.createCallback(this,"DoCommentClick");
            if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCBitmapGridCell.isPrototypeOf(cell)) rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCBitmapGridCell).FOnControlClick = rtl.createCallback(this,"DoBitmapClick");
            if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCFixedGridCell.isPrototypeOf(cell)) rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCFixedGridCell).FOnControlClick = rtl.createCallback(this,"DoFixedDropDownButtonClick");
            cell.SetLeft(cellr.Left);
            cell.SetTop(cellr.Top);
            cell.SetWidth(cellr.Right - cellr.Left);
            cell.SetHeight(cellr.Bottom - cellr.Top);
            if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell.isPrototypeOf(cell)) rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell).FOnCheckChanged = rtl.createCallback(this,"DoCheckBoxClick");
            if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCButtonGridCell.isPrototypeOf(cell)) rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCButtonGridCell).FOnControlClick = rtl.createCallback(this,"DoButtonClick");
            if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCRadioGridCell.isPrototypeOf(cell)) rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCRadioGridCell).FOnCheckChanged = rtl.createCallback(this,"DoRadioButtonClick");
            this.ApplyCellState(bc,br,cell);
            if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell.isPrototypeOf(cell)) {
              l.Assign(rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).FLayout);
              this.DoGetCellLayout(bc,br,l,this.GetCellState(bc,br));
              rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).AssignLayout(l);
            };
            this.DoGetCellProperties(bc,br,cell);
          };
          x = x + cw;
          Ci += 1;
        };
        x = xOrig;
        y = y + rh;
        Ri += 1;
        Ci = CStart;
      };
      l = rtl.freeLoc(l);
    };
    this.DisplayCellsNormal = function (x, y, xOrig, yOrig, CStart, CStop, RStart, RStop, Ci, Ri, ResetCi, Fixed) {
      var cw = 0.0;
      var rh = 0.0;
      var cwr = 0.0;
      var rhr = 0.0;
      var cwrt = 0.0;
      var rhrt = 0.0;
      var xr = 0.0;
      var yr = 0.0;
      var cell = null;
      var c = 0;
      var r = 0;
      var bc = 0;
      var br = 0;
      var cs = 0;
      var rs = 0;
      var cellclasstype = null;
      var cellr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var cellstr = "";
      var I = 0;
      var l = null;
      var a = 0;
      l = pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCellLayout.$create("Create$1");
      for (var $l = CStart, $end = CStop; $l <= $end; $l++) {
        c = $l;
        cw = this.GetColWidths(c);
        for (var $l1 = RStart, $end1 = RStop; $l1 <= $end1; $l1++) {
          r = $l1;
          if (this.FAdapter != null) this.FAdapter.StartBuild(r);
          bc = c;
          br = r;
          cs = 0;
          rs = 0;
          rh = this.GetRowHeights(r);
          this.DoGetCellMergeInfo(c,r,{get: function () {
              return bc;
            }, set: function (v) {
              bc = v;
            }},{get: function () {
              return br;
            }, set: function (v) {
              br = v;
            }},{get: function () {
              return cs;
            }, set: function (v) {
              cs = v;
            }},{get: function () {
              return rs;
            }, set: function (v) {
              rs = v;
            }});
          cellclasstype = null;
          this.DoGetCellClass(bc,br,{get: function () {
              return cellclasstype;
            }, set: function (v) {
              cellclasstype = v;
            }});
          cell = null;
          if (rtl.length(this.FCellArray) > Ci) if (rtl.length(this.FCellArray[Ci]) > Ri) {
            cell = this.FCellArray[Ci][Ri];
          };
          if (cell != null) {
            if (cell.$class.ClassType() !== cellclasstype) {
              cell = rtl.freeLoc(cell);
              cell = null;
              this.FCellArray[Ci][Ri] = null;
            };
          };
          cwr = cw;
          rhr = rh;
          cwrt = 0;
          for (var $l2 = bc, $end2 = (bc + cs) - 1; $l2 <= $end2; $l2++) {
            I = $l2;
            cwrt = cwrt + this.GetColWidths(I);
          };
          if (cwrt > 0) cwr = cwrt;
          rhrt = 0;
          for (var $l3 = br, $end3 = (br + rs) - 1; $l3 <= $end3; $l3++) {
            I = $l3;
            rhrt = rhrt + this.GetRowHeights(I);
          };
          if (rhrt > 0) rhr = rhrt;
          xr = 0;
          for (var $l4 = bc, $end4 = c - 1; $l4 <= $end4; $l4++) {
            I = $l4;
            xr = xr + this.GetColWidths(I);
          };
          yr = 0;
          for (var $l5 = br, $end5 = r - 1; $l5 <= $end5; $l5++) {
            I = $l5;
            yr = yr + this.GetRowHeights(I);
          };
          cellr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(x - xr,y - yr,(x - xr) + cwr + 1,(y - yr) + rhr + 1));
          pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(cellr,this.GetContentRect().Left,this.GetContentRect().Top);
          if (!(cell != null)) {
            cell = cellclasstype.$create("Create$1",[this]);
            if (rtl.length(this.FCellArray) <= Ci) this.FCellArray = rtl.arraySetLength(this.FCellArray,[],Ci + 1);
            if (rtl.length(this.FCellArray[Ci]) <= Ri) this.FCellArray[Ci] = rtl.arraySetLength(this.FCellArray[Ci],null,Ri + 1);
          };
          if (cell != null) {
            a = 0;
            this.DoGetCellRotation(bc,br,{get: function () {
                return a;
              }, set: function (v) {
                a = v;
              }});
            rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).SetAngle(a);
            cell.FScaleFactor = this.FPaintScaleFactor;
            this.FCellArray[Ci][Ri] = cell;
            cellstr = "";
            this.DoGetCellData(bc,br,{get: function () {
                return cellstr;
              }, set: function (v) {
                cellstr = v;
              }});
            if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell.isPrototypeOf(cell)) {
              rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).FOnBeforeDraw = rtl.createCallback(this,"DoBeforeDrawCell");
              rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).FOnAfterDraw = rtl.createCallback(this,"DoAfterDrawCell");
              rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).SetLayout(null);
              rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).SetText(cellstr);
              rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).SetDisplayHTMLFormatting(this.FOptions.FCell.FDisplayHTMLFormatting);
              rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).FBitmapContainer = this.GetBitmapContainer();
              rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).FOptimizedHTMLDrawing = this.FOptimizedHTMLDrawing;
            };
            if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCProgressGridCell.isPrototypeOf(cell)) {
              rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCProgressGridCell).SetFormat(this.FAppearance.FProgressLayout.FFormat);
              rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCProgressGridCell).SetTextColor(this.FAppearance.FProgressLayout.FTextColor);
              rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCProgressGridCell).SetColor(this.FAppearance.FProgressLayout.FColor);
              rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCProgressGridCell).SetShowText(this.FAppearance.FProgressLayout.FShowText);
            };
            if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCNodeGridCell.isPrototypeOf(cell)) rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCNodeGridCell).FOnControlClick = rtl.createCallback(this,"DoNodeClick");
            if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCCommentGridCell.isPrototypeOf(cell)) rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCCommentGridCell).FOnControlClick = rtl.createCallback(this,"DoCommentClick");
            if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCBitmapGridCell.isPrototypeOf(cell)) rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCBitmapGridCell).FOnControlClick = rtl.createCallback(this,"DoBitmapClick");
            if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCFixedGridCell.isPrototypeOf(cell)) rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCFixedGridCell).FOnControlClick = rtl.createCallback(this,"DoFixedDropDownButtonClick");
            cell.SetLeft(cellr.Left);
            cell.SetTop(cellr.Top);
            cell.SetWidth(cellr.Right - cellr.Left);
            cell.SetHeight(cellr.Bottom - cellr.Top);
            if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell.isPrototypeOf(cell)) rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell).FOnCheckChanged = rtl.createCallback(this,"DoCheckBoxClick");
            if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCButtonGridCell.isPrototypeOf(cell)) rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCButtonGridCell).FOnControlClick = rtl.createCallback(this,"DoButtonClick");
            if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCRadioGridCell.isPrototypeOf(cell)) rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCRadioGridCell).FOnCheckChanged = rtl.createCallback(this,"DoRadioButtonClick");
            this.ApplyCellState(bc,br,cell);
            if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell.isPrototypeOf(cell)) {
              l.Assign(rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).FLayout);
              this.DoGetCellLayout(bc,br,l,this.GetCellState(bc,br));
              rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).AssignLayout(l);
            };
            this.DoGetCellProperties(bc,br,cell);
          };
          y = y + rh;
          Ri += 1;
        };
        y = yOrig;
        x = x + cw;
        Ci += 1;
        Ri = ResetCi;
      };
      l = rtl.freeLoc(l);
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.Create$1.apply(this,arguments);
      this.UpdateScrollingMode(pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControlMode.scmItemScrolling);
      this.ChangeCursor = true;
      this.FLeftC = 0;
      this.FTopr = 0;
      this.FFreezeRows = 0;
      this.FFreezeColumns = 0;
      this.FToolBarPopupMode = $mod.TTMSFNCGridCustomToolBarPopupMode.tpmActiveCell;
      this.FFreeEditControlTimer = pas["WEBLib.ExtCtrls"].TTimer.$create("Create$1",[this]);
      this.FFreeEditControlTimer.SetInterval(1);
      this.FFreeEditControlTimer.SetEnabled(false);
      this.FFreeEditControlTimer.FOnTimer = rtl.createCallback(this,"DoFreeEditControl");
      this.FAnimateTimer$1 = pas["WEBLib.ExtCtrls"].TTimer.$create("Create$1",[this]);
      this.FAnimateTimer$1.SetInterval(1);
      this.FAnimateTimer$1.SetEnabled(false);
      this.FAnimateTimer$1.FOnTimer = rtl.createCallback(this,"Animate$1");
      this.FScrollTimer = pas["WEBLib.ExtCtrls"].TTimer.$create("Create$1",[this]);
      this.FScrollTimer.FOnTimer = rtl.createCallback(this,"ScrollTimer");
      this.FScrollTimer.SetInterval(this.FOptions.FMouse.FAutoScrollingInterval);
      this.FScrollTimer.SetEnabled(false);
      this.FDragTimer = pas["WEBLib.ExtCtrls"].TTimer.$create("Create$1",[this]);
      this.FDragTimer.FOnTimer = rtl.createCallback(this,"DragTimer");
      this.FDragTimer.SetInterval(this.FOptions.FMouse.FAutoScrollingInterval);
      this.FDragTimer.SetEnabled(false);
      this.FActiveCommentTextColor = 0;
      this.FActiveComment = "";
      this.FFilterListBox = pas["WEBLib.StdCtrls"].TListBox.$create("Create$1",[this]);
      this.FFilterListBox.FTag$1 = -1;
      this.FFilterListBox.FOnClick = rtl.createCallback(this,"HandleFilterListClick");
      this.FFilterTimer = pas["WEBLib.ExtCtrls"].TTimer.$create("Create$1",[this]);
      this.FFilterTimer.FOnTimer = rtl.createCallback(this,"HandleFilterTimer");
      this.FFilterTimer.SetInterval(100);
      this.FFilterTimer.SetEnabled(false);
      this.FCommentPopup = pas["WEBLib.TMSFNCPopup"].TTMSFNCPopup.$create("Create$1",[this]);
      this.FCommentPopup.SetPlacement(pas["WEBLib.TMSFNCPopup"].TTMSFNCPopupPlacement.ppAbsolute);
      this.FCommentPopup.FOnPopupPaint = rtl.createCallback(this,"DoPaintCommentPopup");
      this.FFilterPopup = pas["WEBLib.TMSFNCPopup"].TTMSFNCPopup.$create("Create$1",[this]);
      this.FFilterPopup.SetPlacement(pas["WEBLib.TMSFNCPopup"].TTMSFNCPopupPlacement.ppAbsolute);
      this.FAppearance = $mod.TTMSFNCGridAppearance.$create("Create$1");
      this.FAppearance.FOnChange = rtl.createCallback(this,"AppearanceChanged");
      this.SetWidth(370);
      this.SetHeight(270);
      if (this.IsDesignTime()) this.InitSample();
      this.FDesignTimeSampleData = true;
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FDragTimer;
        }, set: function (v) {
          this.p.FDragTimer = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FFilterTimer;
        }, set: function (v) {
          this.p.FFilterTimer = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FScrollTimer;
        }, set: function (v) {
          this.p.FScrollTimer = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FAnimateTimer$1;
        }, set: function (v) {
          this.p.FAnimateTimer$1 = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FFreeEditControlTimer;
        }, set: function (v) {
          this.p.FFreeEditControlTimer = v;
        }});
      this.RemoveAllCells();
      if (this.FDummyButtonBitmap != null) rtl.free(this,"FDummyButtonBitmap");
      if (this.FNodeOpenBitmap != null) rtl.free(this,"FNodeOpenBitmap");
      if (this.FNodeClosedBitmap != null) rtl.free(this,"FNodeClosedBitmap");
      if (this.FCellMemo != null) rtl.free(this,"FCellMemo");
      if (this.FCellEdit != null) rtl.free(this,"FCellEdit");
      if (this.FCellColorPicker != null) rtl.free(this,"FCellColorPicker");
      if (this.FCellSpinBox != null) rtl.free(this,"FCellSpinBox");
      if (this.FCellComboBox != null) rtl.free(this,"FCellComboBox");
      if (this.FCellDatePicker != null) rtl.free(this,"FCellDatePicker");
      if (this.FCellTrackBar != null) rtl.free(this,"FCellTrackBar");
      rtl.free(this,"FFilterListBox");
      rtl.free(this,"FCommentPopup");
      rtl.free(this,"FFilterPopup");
      rtl.free(this,"FAppearance");
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.Destroy.call(this);
    };
    this.VisibleRowCount = function () {
      var Result = 0;
      Result = (this.FRStop - this.FRStart) + this.FFixedFooterRows + this.GetFixedRows() + 1;
      return Result;
    };
    this.VisibleColumnCount = function () {
      var Result = 0;
      Result = (this.FCStop - this.FCStart) + this.FFixedRightColumns + this.GetFixedCols() + 1;
      return Result;
    };
    this.GetDisplayCell = function (ACell) {
      var Result = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      var maxc = 0;
      var maxr = 0;
      maxc = rtl.length(this.FCellArray) - 1;
      if (ACell.Col > (this.GetColumnCount() - 1 - this.FFixedRightColumns)) {
        Result.Col = ((this.FCStop - this.FCStart) + this.FFixedRightColumns + this.FFixedColumns) - (this.GetColumnCount() - ACell.Col - 1)}
       else if (ACell.Col >= this.GetFixedCols()) {
        Result.Col = (ACell.Col - this.FCStart) + this.GetFixedCols()}
       else Result.Col = ACell.Col;
      Result.Col = Math.max(0,Math.min(Result.Col,maxc));
      maxr = 0;
      if ((Result.Col >= 0) && (Result.Col <= maxc)) {
        maxr = rtl.length(this.FCellArray[Result.Col]) - 1;
        if (ACell.Row > (this.GetRowCount() - 1 - this.FFixedRightColumns)) {
          Result.Row = ((this.FRStop - this.FRStart) + this.FFixedFooterRows + this.FFixedRows) - (this.GetRowCount() - ACell.Row - 1)}
         else if (ACell.Row >= this.GetFixedRows()) {
          Result.Row = (ACell.Row - this.FRStart) + this.GetFixedRows()}
         else Result.Row = ACell.Row;
      };
      Result.Row = Math.max(0,Math.min(Result.Row,maxr));
      return Result;
    };
    this.GetRealCell = function (ACell) {
      var Result = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      if (ACell.Col > (rtl.length(this.FCellArray) - 1 - this.FFixedRightColumns)) {
        Result.Col = this.GetColumnCount() - 1 - (rtl.length(this.FCellArray) - 1 - ACell.Col)}
       else if (ACell.Col >= this.GetFixedCols()) {
        Result.Col = (ACell.Col + this.FCStart) - this.GetFixedCols()}
       else Result.Col = ACell.Col;
      if ((ACell.Col >= 0) && (ACell.Col <= (rtl.length(this.FCellArray) - 1))) {
        if (ACell.Row > (rtl.length(this.FCellArray[ACell.Col]) - 1 - this.FFixedRightColumns)) {
          Result.Row = this.GetRowCount() - 1 - (rtl.length(this.FCellArray[ACell.Col]) - 1 - ACell.Row)}
         else if (ACell.Row >= this.GetFixedRows()) {
          Result.Row = (ACell.Row + this.FRStart) - this.GetFixedRows()}
         else Result.Row = ACell.Row;
      };
      return Result;
    };
    this.GetCellObject = function (ACell) {
      var Result = null;
      Result = null;
      if ((ACell.Col >= 0) && (ACell.Col <= (rtl.length(this.FCellArray) - 1))) if ((ACell.Row >= 0) && (ACell.Row <= (rtl.length(this.FCellArray[ACell.Col]) - 1))) Result = this.FCellArray[ACell.Col][ACell.Row];
      return Result;
    };
    this.GetCell = function (ACell) {
      var Result = null;
      ACell.$assign(this.GetDisplayCell(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(ACell)));
      Result = null;
      if ((ACell.Col >= 0) && (ACell.Col <= (rtl.length(this.FCellArray) - 1))) if ((ACell.Row >= 0) && (ACell.Row <= (rtl.length(this.FCellArray[ACell.Col]) - 1))) Result = this.FCellArray[ACell.Col][ACell.Row];
      return Result;
    };
    this.GetCellByObject = function (Cell) {
      var Result = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      var c = 0;
      var r = 0;
      Result.Col = -1;
      Result.Row = -1;
      for (var $l = 0, $end = rtl.length(this.FCellArray) - 1; $l <= $end; $l++) {
        c = $l;
        for (var $l1 = 0, $end1 = rtl.length(this.FCellArray[c]) - 1; $l1 <= $end1; $l1++) {
          r = $l1;
          if (this.FCellArray[c][r] === Cell) {
            Result.Col = c;
            Result.Row = r;
            Result.$assign(this.GetRealCell(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(Result)));
            return Result;
          };
        };
      };
      return Result;
    };
    this.GetDisplayCellByObject = function (Cell) {
      var Result = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      var c = 0;
      var r = 0;
      Result.Col = -1;
      Result.Row = -1;
      for (var $l = 0, $end = rtl.length(this.FCellArray) - 1; $l <= $end; $l++) {
        c = $l;
        for (var $l1 = 0, $end1 = rtl.length(this.FCellArray[c]) - 1; $l1 <= $end1; $l1++) {
          r = $l1;
          if (this.FCellArray[c][r] === Cell) {
            Result.Col = c;
            Result.Row = r;
            return Result;
          };
        };
      };
      return Result;
    };
    this.GetTotalColumnWidth = function () {
      var Result = 0.0;
      var I = 0;
      Result = (this.GetColumnCount() - Math.min(this.GetColumnCount(),this.FColumnW.GetCount())) * this.FDefaultColumnWidth;
      for (var $l = 0, $end = Math.min(this.GetColumnCount() - 1,this.FColumnW.GetCount() - 1); $l <= $end; $l++) {
        I = $l;
        Result = Result + this.FColumnW.GetItem$1(I).FValue;
      };
      return Result;
    };
    this.GetTotalRowHeight = function () {
      var Result = 0.0;
      var I = 0;
      Result = (this.GetRowCount() - Math.min(this.GetRowCount(),this.FRowH.GetCount())) * this.FDefaultRowHeight;
      for (var $l = 0, $end = Math.min(this.GetRowCount() - 1,this.FRowH.GetCount() - 1); $l <= $end; $l++) {
        I = $l;
        Result = Result + this.FRowH.GetItem$1(I).FValue;
      };
      return Result;
    };
    this.GetTotalContentWidth = function () {
      var Result = 0.0;
      pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControl.GetTotalContentWidth.call(this);
      Result = this.FContainerWidth;
      return Result;
    };
    this.GetTotalContentHeight = function () {
      var Result = 0.0;
      pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControl.GetTotalContentHeight.call(this);
      Result = this.FContainerHeight;
      return Result;
    };
    this.EndUpdate = function () {
      pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControl.EndUpdate.call(this);
      if (this.FDragTimer != null) this.FDragTimer.SetInterval(this.FOptions.FMouse.FAutoScrollingInterval);
      if (this.FScrollTimer != null) this.FScrollTimer.SetInterval(this.FOptions.FMouse.FAutoScrollingInterval);
    };
    this.RemoveAllCells = function () {
      var c = 0;
      var r = 0;
      for (var $l = 0, $end = rtl.length(this.FCellArray) - 1; $l <= $end; $l++) {
        c = $l;
        for (var $l1 = 0, $end1 = rtl.length(this.FCellArray[c]) - 1; $l1 <= $end1; $l1++) {
          r = $l1;
          if (this.FCellArray[c][r] != null) {
            rtl.free(this.FCellArray[c],r);
            this.FCellArray[c][r] = null;
          };
        };
      };
      this.FCellArray = rtl.arraySetLength(this.FCellArray,[],0);
    };
    this.ClearSelection = function () {
      var cl = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      cl.Col = -1;
      cl.Row = -1;
      this.FStartCell.$assign(cl);
      this.FStopCell.$assign(cl);
      this.FFocusedCell.$assign(cl);
      this.FPrevSelectedCell.$assign(this.GetFocusedCell());
      this.FSaveCell.$assign(this.GetFocusedCell());
      this.FFirstCell.Col = -1;
      this.FFirstCell.Row = -1;
      this.FRealCell.$assign(this.GetFocusedCell());
      this.FPrevSelection.$assign(this.GetSelection());
      this.UpdateGridCells(false);
    };
    this.ExportNotification = function (AState, ARow) {
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.ExportNotification.apply(this,arguments);
      if (this.FAdapter != null) this.FAdapter.ExportNotification(AState,ARow);
    };
    this.ApplyCellState = function (ACol, ARow, Cell) {
      var cl = null;
      var ctl = null;
      var idx = 0;
      if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell.isPrototypeOf(Cell)) {
        cl = rtl.as(Cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell);
        if (cl != null) {
          if ((this.FOptions.FSelection.FMode !== pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smNone) && (this.GetFocusedCell().Row === ARow) && (this.GetFocusedCell().Col === ACol) && this.IsFocused()) {
            cl.AssignLayout(this.GetCellAppearance(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellState.csFocused,ACol,ARow))}
           else {
            if (this.IsFixed(ACol,ARow)) {
              if ((this.FOptions.FSelection.FMode !== pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smNone) && this.FOptions.FSelection.FShowSelectionInFixedCells && this.DoIsFixedCellSelected(ACol,ARow) && !this.IsNormalFixed(ACol,ARow)) {
                cl.AssignLayout(this.GetCellAppearance(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellState.csFixedSelected,ACol,ARow))}
               else cl.AssignLayout(this.GetCellAppearance(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellState.csFixed,ACol,ARow));
            } else if ((this.FOptions.FSelection.FMode !== pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smNone) && this.DoIsCellSelected(ACol,ARow)) {
              cl.AssignLayout(this.GetCellAppearance(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellState.csSelected,ACol,ARow))}
             else cl.AssignLayout(this.GetCellAppearance(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellState.csNormal,ACol,ARow));
          };
          if (this.IsFixed(ACol,ARow)) {
            var $tmp = this.FOptions.FBorders.FFixedCellBorders;
            if ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridBorders.bNone) {
              cl.FLayout.SetSides({})}
             else if ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridBorders.bVertical) {
              cl.FLayout.SetSides(rtl.diffSet(cl.FLayout.FSides,rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsTop,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsBottom)))}
             else if ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridBorders.bHorizontal) cl.FLayout.SetSides(rtl.diffSet(cl.FLayout.FSides,rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsRight)));
          } else {
            var $tmp1 = this.FOptions.FBorders.FCellBorders;
            if ($tmp1 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridBorders.bNone) {
              cl.FLayout.SetSides({})}
             else if ($tmp1 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridBorders.bVertical) {
              cl.FLayout.SetSides(rtl.diffSet(cl.FLayout.FSides,rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsTop,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsBottom)))}
             else if ($tmp1 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridBorders.bHorizontal) cl.FLayout.SetSides(rtl.diffSet(cl.FLayout.FSides,rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsRight)));
          };
          if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCFixedGridCell.isPrototypeOf(cl) && (ARow === this.FOptions.FSorting.FRow)) {
            ctl = rtl.as(cl,pas["WEBLib.TMSFNCGridCell"].TTMSFNCFixedGridCell);
            ctl.FSortIndex = -1;
            ctl.FSortKind = pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridSortKind.skNone;
            var $tmp2 = this.FOptions.FSorting.FMode;
            if ($tmp2 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSortingMode.gsmNone) {
              ctl.FSortKind = pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridSortKind.skNone}
             else if ($tmp2 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSortingMode.gsmNormal) {
              if (ACol === this.FSortColumn) {
                var $tmp3 = this.FSortDirection;
                if ($tmp3 === pas["WEBLib.TMSFNCGridData"].TTMSFNCGridSortDirection.sdAscending) {
                  ctl.FSortKind = pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridSortKind.skAscending}
                 else if ($tmp3 === pas["WEBLib.TMSFNCGridData"].TTMSFNCGridSortDirection.sdDescending) ctl.FSortKind = pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridSortKind.skDescending;
              };
            } else if ($tmp2 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSortingMode.gsmIndexed) {
              idx = this.FSortIndexes.FindIndex(ACol);
              if (idx !== -1) {
                ctl.FSortIndex = idx + 1;
                if (this.FSortIndexes.GetSortDirections(idx)) {
                  ctl.FSortKind = pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridSortKind.skAscending}
                 else ctl.FSortKind = pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridSortKind.skDescending;
              };
            };
          };
        };
      };
    };
    this.GetCellState = function (ACol, ARow) {
      var Result = 0;
      if ((this.FOptions.FSelection.FMode !== pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smNone) && (this.GetFocusedCell().Row === ARow) && (this.GetFocusedCell().Col === ACol)) {
        Result = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellState.csFocused}
       else {
        if (this.IsFixed(ACol,ARow)) {
          if ((this.FOptions.FSelection.FMode !== pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smNone) && this.FOptions.FSelection.FShowSelectionInFixedCells && this.DoIsFixedCellSelected(ACol,ARow)) {
            Result = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellState.csFixedSelected}
           else Result = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellState.csFixed;
        } else if ((this.FOptions.FSelection.FMode !== pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smNone) && this.DoIsCellSelected(ACol,ARow)) {
          Result = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellState.csSelected}
         else Result = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellState.csNormal;
      };
      return Result;
    };
    this.XYToCell = function (X, Y) {
      var Result = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      var I = 0;
      var val = 0.0;
      var contentr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.Row = -1;
      Result.Col = -1;
      if ((this.GetRowCount() === 0) || (this.GetColumnCount() === 0)) return Result;
      contentr.$assign(this.GetContentRect());
      if (!pas["WEBLib.TMSFNCTypes"].PtInRectEx(contentr,pas["WEBLib.TMSFNCTypes"].PointF(X,Y))) return Result;
      if (Y < this.GetFixedHeight()) {
        val = 0;
        for (var $l = 0, $end = this.GetFixedRows(); $l <= $end; $l++) {
          I = $l;
          val = val + this.GetRowHeights(I);
          if (val >= Y) {
            Result.Row = I;
            break;
          };
        };
      } else if (Y > (contentr.Bottom - contentr.Top - this.GetFixedFooterHeight())) {
        val = contentr.Bottom - contentr.Top;
        for (var $l1 = this.GetRowCount() - 1, $end1 = this.GetRowCount() - 1 - this.FFixedFooterRows; $l1 >= $end1; $l1--) {
          I = $l1;
          val = val - this.GetRowHeights(I);
          if (val <= Y) {
            Result.Row = I;
            break;
          };
        };
      } else {
        val = this.GetCellContainerPosY();
        for (var $l2 = 0, $end2 = this.FRStop; $l2 <= $end2; $l2++) {
          I = $l2;
          val = val + this.GetRowHeights(I);
          if (val >= Y) {
            Result.Row = I;
            break;
          };
        };
      };
      if (X < this.GetFixedWidth()) {
        val = 0;
        for (var $l3 = 0, $end3 = this.GetFixedCols(); $l3 <= $end3; $l3++) {
          I = $l3;
          val = val + this.GetColWidths(I);
          if (val >= X) {
            Result.Col = I;
            break;
          };
        };
      } else if (X > (contentr.Right - contentr.Left - this.GetFixedRightWidth())) {
        val = contentr.Right - contentr.Left;
        for (var $l4 = this.GetColumnCount() - 1, $end4 = this.GetColumnCount() - 1 - this.FFixedRightColumns; $l4 >= $end4; $l4--) {
          I = $l4;
          val = val - this.GetColWidths(I);
          if (val <= X) {
            Result.Col = I;
            break;
          };
        };
      } else {
        val = this.GetCellContainerPosX();
        for (var $l5 = 0, $end5 = this.FCStop; $l5 <= $end5; $l5++) {
          I = $l5;
          val = val + this.GetColWidths(I);
          if (val >= X) {
            Result.Col = I;
            break;
          };
        };
      };
      return Result;
    };
    this.GetFixedCols = function () {
      var Result = 0;
      Result = this.FFixedColumns + this.FFreezeColumns;
      return Result;
    };
    this.GetFixedRows = function () {
      var Result = 0;
      Result = this.FFixedRows + this.FFreezeRows;
      return Result;
    };
    this.GetFixedWidth = function () {
      var Result = 0.0;
      var I = 0;
      Result = 0;
      for (var $l = 0, $end = (this.FFixedColumns + this.FFreezeColumns) - 1; $l <= $end; $l++) {
        I = $l;
        Result = Result + this.GetColWidths(I);
      };
      return Result;
    };
    this.GetFixedOnlyHeight = function () {
      var Result = 0.0;
      var I = 0;
      Result = 0;
      for (var $l = 0, $end = this.FFixedRows - 1; $l <= $end; $l++) {
        I = $l;
        Result = Result + this.GetRowHeights(I);
      };
      return Result;
    };
    this.GetFixedOnlyWidth = function () {
      var Result = 0.0;
      var I = 0;
      Result = 0;
      for (var $l = 0, $end = this.FFixedColumns - 1; $l <= $end; $l++) {
        I = $l;
        Result = Result + this.GetColWidths(I);
      };
      return Result;
    };
    this.GetFixedHeight = function () {
      var Result = 0.0;
      var I = 0;
      Result = 0;
      for (var $l = 0, $end = (this.FFixedRows + this.FFreezeRows) - 1; $l <= $end; $l++) {
        I = $l;
        Result = Result + this.GetRowHeights(I);
      };
      return Result;
    };
    this.GetFixedRightWidth = function () {
      var Result = 0.0;
      var I = 0;
      Result = 0;
      for (var $l = this.GetColumnCount() - 1, $end = this.GetColumnCount() - this.FFixedRightColumns; $l >= $end; $l--) {
        I = $l;
        Result = Result + this.GetColWidths(I);
      };
      return Result;
    };
    this.GetFixedFooterHeight = function () {
      var Result = 0.0;
      var I = 0;
      Result = 0;
      for (var $l = this.GetRowCount() - 1, $end = this.GetRowCount() - this.FFixedFooterRows; $l >= $end; $l--) {
        I = $l;
        Result = Result + this.GetRowHeights(I);
      };
      return Result;
    };
    this.GetCellContainerPosX = function () {
      var Result = 0;
      Result = this.FCellPosX;
      return Result;
    };
    this.GetCellContainerPosY = function () {
      var Result = 0;
      Result = this.FCellPosY;
      return Result;
    };
    this.ColumnStretchingActive = function () {
      var Result = false;
      Result = this.FOptions.FColumnSize.FStretch && this.FOptions.FColumnSize.FStretchAll;
      return Result;
    };
    this.DrawContent = function (AGraphics, ARect) {
      var cfs = 0;
      var rfs = 0;
      var cfst = 0;
      var rfst = 0;
      pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControl.DrawContent.apply(this,arguments);
      AGraphics.FBitmapContainer = this.GetBitmapContainer();
      cfs = this.GetFixedCols();
      rfs = this.GetFixedRows();
      cfst = this.FFixedRightColumns;
      rfst = this.FFixedFooterRows;
      if ((this.GetColumnCount() > this.FFixedColumns) && (this.GetRowCount() > this.FFixedRows)) this.PaintCells(AGraphics,this.FCStart,this.FCStop,this.FRStart,this.FRStop,cfs,rfs,rfs);
      if (this.GetRowCount() > this.FFixedRows) this.PaintCells(AGraphics,0,cfs - 1,this.FRStart,this.FRStop,0,rfs,rfs);
      if (this.GetColumnCount() > this.FFixedColumns) this.PaintCells(AGraphics,this.FCStart,this.FCStop,0,rfs - 1,cfs,0,0);
      this.PaintCells(AGraphics,0,cfs - 1,0,rfs - 1,0,0,0);
      if ((this.GetColumnCount() > (this.FFixedColumns + this.FFixedRightColumns)) && (this.GetRowCount() > this.FFixedRows)) {
        this.PaintCells(AGraphics,this.GetColumnCount() - cfst,this.GetColumnCount() - 1,this.FRStart,this.FRStop,(this.FCStop - this.FCStart) + cfs + 1,rfs,rfs);
        this.PaintCells(AGraphics,this.GetColumnCount() - cfst,this.GetColumnCount() - 1,0,rfs - 1,(this.FCStop - this.FCStart) + cfs + 1,0,0);
      };
      if ((this.GetColumnCount() > this.FFixedColumns) && (this.GetRowCount() > (this.FFixedRows + this.FFixedFooterRows))) this.PaintCells(AGraphics,this.FCStart,this.FCStop,this.GetRowCount() - rfst,this.GetRowCount() - 1,cfs,(this.FRStop - this.FRStart) + rfs + 1,(this.FRStop - this.FRStart) + rfs + 1);
      if ((this.GetColumnCount() > (this.FFixedColumns + this.FFixedRightColumns)) && (this.GetRowCount() > (this.FFixedRows + this.FFixedFooterRows))) this.PaintCells(AGraphics,this.GetColumnCount() - cfst,this.GetColumnCount() - 1,this.GetRowCount() - rfst,this.GetRowCount() - 1,(this.FCStop - this.FCStart) + cfs + 1,(this.FRStop - this.FRStart) + rfs + 1,(this.FRStop - this.FRStart) + rfs + 1);
      if (this.GetRowCount() > this.FFixedRows) this.PaintCells(AGraphics,0,cfs - 1,this.GetRowCount() - rfst,this.GetRowCount() - 1,0,(this.FRStop - this.FRStart) + rfs + 1,(this.FRStop - this.FRStart) + rfs + 1);
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        AGraphics.FFont.SetColor(255);
        AGraphics.FFont.SetStyle({});
        AGraphics.DrawText(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(2,2)),"For new developments, please use TTMSFNCDataGrid",0,true,false,-1,-1);
      };
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCCustomGrid.isPrototypeOf(Source)) {
        this.FAppearance.Assign(rtl.as(Source,$mod.TTMSFNCCustomGrid).FAppearance);
        this.FOptions.Assign(rtl.as(Source,$mod.TTMSFNCCustomGrid).FOptions);
        this.SetColumnCount(rtl.as(Source,$mod.TTMSFNCCustomGrid).GetColumnCount());
        this.SetRowCount(rtl.as(Source,$mod.TTMSFNCCustomGrid).GetRowCount());
        this.SetFixedColumns(rtl.as(Source,$mod.TTMSFNCCustomGrid).FFixedColumns);
        this.SetFixedRows(rtl.as(Source,$mod.TTMSFNCCustomGrid).FFixedRows);
        this.SetFixedRightColumns(rtl.as(Source,$mod.TTMSFNCCustomGrid).FFixedRightColumns);
        this.SetFixedFooterRows(rtl.as(Source,$mod.TTMSFNCCustomGrid).FFixedFooterRows);
        this.SetFreezeColumns(rtl.as(Source,$mod.TTMSFNCCustomGrid).FFreezeColumns);
        this.SetFreezeRows(rtl.as(Source,$mod.TTMSFNCCustomGrid).FFreezeRows);
        this.SetBitmapContainer(rtl.as(Source,$mod.TTMSFNCCustomGrid).GetBitmapContainer());
        this.SetEnabled(rtl.as(Source,$mod.TTMSFNCCustomGrid).FEnabled);
        this.SetDefaultColumnWidth(rtl.as(Source,$mod.TTMSFNCCustomGrid).FDefaultColumnWidth);
        this.SetDefaultRowHeight(rtl.as(Source,$mod.TTMSFNCCustomGrid).FDefaultRowHeight);
        this.SetLeftCol(rtl.as(Source,$mod.TTMSFNCCustomGrid).GetLeftCol());
        this.SetTopRow(rtl.as(Source,$mod.TTMSFNCCustomGrid).GetTopRow());
      };
    };
    this.EditCell = function (ACell, CellStart, InsertKey, Value, Key) {
      var $Self = this;
      function CreateCaretPos(ALine, APos) {
        var Result = pas.Types.TPoint.$new();
        Result.x = ALine;
        Result.y = APos;
        return Result;
      };
      var CellEditorClassType = null;
      var cellstring = "";
      var ctl = null;
      var realc = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var AReadOnly = false;
      var EditorType = 0;
      var c = 0;
      var dtc = false;
      var s = "";
      var ectl = null;
      var ioe = null;
      var fc = 0;
      var $ir = rtl.createIntfRefs();
      try {
        if (!this.FOptions.FEditing.FEnabled || this.IsFixed(ACell.Col,ACell.Row)) return;
        this.Navigate(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(ACell),false);
        AReadOnly = false;
        this.DoGetCellReadOnly(ACell.Col,ACell.Row,{get: function () {
            return AReadOnly;
          }, set: function (v) {
            AReadOnly = v;
          }});
        dtc = this.DoGetCellIsDataCheckBox(ACell.Col,ACell.Row);
        if (AReadOnly || dtc) return;
        if (this.FAdapter != null) this.FAdapter.CellBeforeEdit(ACell.Col,ACell.Row);
        realc.$assign(this.GetDisplayCell(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(ACell)));
        ctl = null;
        if ((realc.Col >= 0) && (realc.Col <= (rtl.length(this.FCellArray) - 1))) {
          if ((realc.Row >= 0) && (realc.Row <= (rtl.length(this.FCellArray[realc.Col]) - 1))) ctl = this.FCellArray[realc.Col][realc.Row];
        };
        if ((ctl != null) && pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell.isPrototypeOf(ctl)) {
          EditorType = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridEditorType.etEdit;
          this.FEditControl = this.GetCellEdit();
          CellEditorClassType = $mod.TTMSFNCGridEdit;
          this.DoGetCellEditorType(ACell.Col,ACell.Row,{get: function () {
              return EditorType;
            }, set: function (v) {
              EditorType = v;
            }});
          if (EditorType === pas["WEBLib.TMSFNCGridData"].TTMSFNCGridEditorType.etCustom) {
            this.DoGetCellEditorCustomClassType(ACell.Col,ACell.Row,{get: function () {
                return CellEditorClassType;
              }, set: function (v) {
                CellEditorClassType = v;
              }});
            if (CellEditorClassType !== null) {
              this.FEditControl = CellEditorClassType.$create("Create$1",[$Self]);
              this.FEditControl.SetShowFocus(false);
              this.FEditControl.FOnKeyDown = rtl.createCallback($Self,"CellControlKeyDown");
              this.FEditControl.FOnExit = rtl.createCallback($Self,"CellExit");
            };
          } else {
            var $tmp = EditorType;
            if ($tmp === pas["WEBLib.TMSFNCGridData"].TTMSFNCGridEditorType.etMemo) {
              this.FEditControl = this.GetCellMemo()}
             else if ($tmp === pas["WEBLib.TMSFNCGridData"].TTMSFNCGridEditorType.etSpinBox) {
              this.FEditControl = this.GetCellSpinBox()}
             else if ($tmp === pas["WEBLib.TMSFNCGridData"].TTMSFNCGridEditorType.etColorPicker) {
              this.FEditControl = this.GetCellColorPicker()}
             else if ($tmp === pas["WEBLib.TMSFNCGridData"].TTMSFNCGridEditorType.etComboBox) {
              this.FEditControl = this.GetCellComboBox()}
             else if ($tmp === pas["WEBLib.TMSFNCGridData"].TTMSFNCGridEditorType.etDatePicker) {
              this.FEditControl = this.GetCellDatePicker()}
             else if ($tmp === pas["WEBLib.TMSFNCGridData"].TTMSFNCGridEditorType.etTrackBar) {
              this.FEditControl = this.GetCellTrackBar()}
             else if ($tmp === pas["WEBLib.TMSFNCGridData"].TTMSFNCGridEditorType.etEdit) {
              this.GetCellEdit().SetEditType$1(pas["WEBLib.TMSFNCEdit"].TTMSFNCEditType.etString)}
             else if ($tmp === pas["WEBLib.TMSFNCGridData"].TTMSFNCGridEditorType.etNumericEdit) {
              this.GetCellEdit().SetEditType$1(pas["WEBLib.TMSFNCEdit"].TTMSFNCEditType.etNumeric)}
             else if ($tmp === pas["WEBLib.TMSFNCGridData"].TTMSFNCGridEditorType.etSignedNumericEdit) {
              this.GetCellEdit().SetEditType$1(pas["WEBLib.TMSFNCEdit"].TTMSFNCEditType.etSignedNumeric)}
             else if ($tmp === pas["WEBLib.TMSFNCGridData"].TTMSFNCGridEditorType.etFloatEdit) {
              this.GetCellEdit().SetEditType$1(pas["WEBLib.TMSFNCEdit"].TTMSFNCEditType.etFloat)}
             else if ($tmp === pas["WEBLib.TMSFNCGridData"].TTMSFNCGridEditorType.etSignedFloatEdit) {
              this.GetCellEdit().SetEditType$1(pas["WEBLib.TMSFNCEdit"].TTMSFNCEditType.etSignedFloat)}
             else if ($tmp === pas["WEBLib.TMSFNCGridData"].TTMSFNCGridEditorType.etUppercaseEdit) {
              this.GetCellEdit().SetEditType$1(pas["WEBLib.TMSFNCEdit"].TTMSFNCEditType.etUpperCase)}
             else if ($tmp === pas["WEBLib.TMSFNCGridData"].TTMSFNCGridEditorType.etMixedCaseEdit) {
              this.GetCellEdit().SetEditType$1(pas["WEBLib.TMSFNCEdit"].TTMSFNCEditType.etMixedCase)}
             else if ($tmp === pas["WEBLib.TMSFNCGridData"].TTMSFNCGridEditorType.etLowerCaseEdit) {
              this.GetCellEdit().SetEditType$1(pas["WEBLib.TMSFNCEdit"].TTMSFNCEditType.etLowerCase)}
             else if ($tmp === pas["WEBLib.TMSFNCGridData"].TTMSFNCGridEditorType.etMoneyEdit) {
              this.GetCellEdit().SetEditType$1(pas["WEBLib.TMSFNCEdit"].TTMSFNCEditType.etMoney)}
             else if ($tmp === pas["WEBLib.TMSFNCGridData"].TTMSFNCGridEditorType.etHexEdit) {
              this.GetCellEdit().SetEditType$1(pas["WEBLib.TMSFNCEdit"].TTMSFNCEditType.etHex)}
             else if ($tmp === pas["WEBLib.TMSFNCGridData"].TTMSFNCGridEditorType.etAlphaNumericEdit) {
              this.GetCellEdit().SetEditType$1(pas["WEBLib.TMSFNCEdit"].TTMSFNCEditType.etAlphaNumeric)}
             else if ($tmp === pas["WEBLib.TMSFNCGridData"].TTMSFNCGridEditorType.etValidCharsEdit) this.GetCellEdit().SetEditType$1(pas["WEBLib.TMSFNCEdit"].TTMSFNCEditType.etValidChars);
            if ((EditorType in rtl.createSet(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridEditorType.etEdit)) && (this.FOptions.FEditing.FAutoComplete !== pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridAutoComplete.acDisabled)) {
              this.GetCellEdit().FLookup.FDisplayList.Assign(this.FOptions.FEditing.FAutoCompleteItems);
              this.GetCellEdit().FAutoComplete = this.FOptions.FEditing.FAutoComplete === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridAutoComplete.acNormal;
              this.GetCellEdit().FLookup.FEnabled = this.FOptions.FEditing.FAutoComplete !== pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridAutoComplete.acNormal;
            };
          };
          if (this.FEditControl != null) {
            if (pas["WEBLib.StdCtrls"].TComboBox.isPrototypeOf(this.FEditControl)) rtl.as(this.FEditControl,pas["WEBLib.StdCtrls"].TComboBox).SetParent($Self);
            this.DoGetCellEditorProperties(ACell.Col,ACell.Row,this.FEditControl);
            if (pas["WEBLib.StdCtrls"].TComboBox.isPrototypeOf(this.FEditControl)) rtl.as(this.FEditControl,pas["WEBLib.StdCtrls"].TComboBox).SetParent(null);
            cellstring = this.GetCells(ACell.Col,ACell.Row);
            if (!this.FOptions.FEditing.FEditWithTags && pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.IsHTML(cellstring)) cellstring = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.HTMLStrip(cellstring);
            c = this.GetColors(ACell.Col,ACell.Row);
            if ($mod.TTMSFNCGridColorPicker.isPrototypeOf(this.FEditControl)) {
              this.DoCellEditGetColor(ACell.Col,ACell.Row,this.FEditControl,{get: function () {
                  return c;
                }, set: function (v) {
                  c = v;
                }})}
             else this.DoCellEditGetData(ACell.Col,ACell.Row,this.FEditControl,{get: function () {
                return cellstring;
              }, set: function (v) {
                cellstring = v;
              }});
            if (pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(this.FEditControl,pas.System.IUnknown)),rtl.getIntfGUIDR(pas["WEBLib.TMSFNCTypes"].ITMSFNCCustomEditor),{get: function () {
                return ioe;
              }, set: function (v) {
                ioe = v;
              }})) {
              if (InsertKey) ioe.SetText(Value);
            };
            if ($mod.TTMSFNCGridEdit.isPrototypeOf(this.FEditControl) || $mod.TTMSFNCGridMemo.isPrototypeOf(this.FEditControl)) {
              if (InsertKey) {
                if ($mod.TTMSFNCGridMemo.isPrototypeOf(this.FEditControl)) rtl.as(this.FEditControl,$mod.TTMSFNCGridMemo).SetText("");
                if ($mod.TTMSFNCGridEdit.isPrototypeOf(this.FEditControl)) rtl.as(this.FEditControl,$mod.TTMSFNCGridEdit).SetT("");
                if ($mod.TTMSFNCGridEdit.isPrototypeOf(this.FEditControl) && (EditorType in rtl.createSet(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridEditorType.etMoneyEdit,pas["WEBLib.TMSFNCGridData"].TTMSFNCGridEditorType.etFloatEdit,pas["WEBLib.TMSFNCGridData"].TTMSFNCGridEditorType.etSignedFloatEdit,pas["WEBLib.TMSFNCGridData"].TTMSFNCGridEditorType.etNumericEdit))) {
                  this.FEditControl.SetParent($Self);
                  this.FEditControl.SelectAll();
                  this.FEditControl.SetParent(null);
                };
                s = Value;
                if ($mod.TTMSFNCGridMemo.isPrototypeOf(this.FEditControl)) rtl.as(this.FEditControl,$mod.TTMSFNCGridMemo).SetText(s);
                if ($mod.TTMSFNCGridEdit.isPrototypeOf(this.FEditControl)) rtl.as(this.FEditControl,$mod.TTMSFNCGridEdit).SetT(s);
              } else {
                if ($mod.TTMSFNCGridMemo.isPrototypeOf(this.FEditControl)) rtl.as(this.FEditControl,$mod.TTMSFNCGridMemo).SetText(cellstring);
                if ($mod.TTMSFNCGridEdit.isPrototypeOf(this.FEditControl)) rtl.as(this.FEditControl,$mod.TTMSFNCGridEdit).SetT(cellstring);
              };
            } else if ($mod.TTMSFNCGridTrackBar.isPrototypeOf(this.FEditControl)) {
              if (cellstring !== "") {
                rtl.as(this.FEditControl,$mod.TTMSFNCGridTrackBar).SetPosition(pas.SysUtils.StrToInt(cellstring))}
               else rtl.as(this.FEditControl,$mod.TTMSFNCGridTrackBar).SetPosition(0);
            } else if ($mod.TTMSFNCGridColorPicker.isPrototypeOf(this.FEditControl)) {
              rtl.as(this.FEditControl,$mod.TTMSFNCGridColorPicker).SetSelectedColor(c)}
             else if ($mod.TTMSFNCGridSpinBox.isPrototypeOf(this.FEditControl)) {
              rtl.as(this.FEditControl,$mod.TTMSFNCGridSpinBox).SetText(cellstring)}
             else if ($mod.TTMSFNCGridDatePicker.isPrototypeOf(this.FEditControl)) {
              rtl.as(this.FEditControl,$mod.TTMSFNCGridDatePicker).SetParent($Self);
              if (cellstring === "") {
                rtl.as(this.FEditControl,$mod.TTMSFNCGridDatePicker).SetDate(pas.System.Int(pas.SysUtils.Now()));
                rtl.as(this.FEditControl,$mod.TTMSFNCGridDatePicker).SetText(pas.SysUtils.DateToStr(pas.SysUtils.Now()));
              } else {
                rtl.as(this.FEditControl,$mod.TTMSFNCGridDatePicker).SetDate(pas["WEBLib.TMSFNCTypes"].VarToDateTime(cellstring));
                rtl.as(this.FEditControl,$mod.TTMSFNCGridDatePicker).SetText(cellstring);
              };
              rtl.as(this.FEditControl,$mod.TTMSFNCGridDatePicker).SetParent(null);
            } else if ($mod.TTMSFNCGridComboBox.isPrototypeOf(this.FEditControl)) {
              rtl.as(this.FEditControl,$mod.TTMSFNCGridComboBox).SetParent($Self);
              rtl.as(this.FEditControl,$mod.TTMSFNCGridComboBox).SetItemIndex(rtl.as(this.FEditControl,$mod.TTMSFNCGridComboBox).FItems.IndexOf(cellstring));
              rtl.as(this.FEditControl,$mod.TTMSFNCGridComboBox).SetParent(null);
            };
            ectl = this.FEditControl;
            if ($mod.TTMSFNCGridEdit.isPrototypeOf(ectl)) {
              fc = rtl.as(ectl,$mod.TTMSFNCGridEdit).FFont.FColor;
              rtl.as(ectl,$mod.TTMSFNCGridEdit).FFont.Assign(ctl.FLayout.FFont);
              rtl.as(ectl,$mod.TTMSFNCGridEdit).FFont.SetColor(fc);
              var $tmp1 = ctl.FLayout.FTextAlign;
              if ($tmp1 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter) {
                rtl.as(ectl,$mod.TTMSFNCGridEdit).SetAlignment(pas.Classes.TAlignment.taCenter)}
               else if ($tmp1 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading) {
                rtl.as(ectl,$mod.TTMSFNCGridEdit).SetAlignment(pas.Classes.TAlignment.taLeftJustify)}
               else if ($tmp1 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaTrailing) rtl.as(ectl,$mod.TTMSFNCGridEdit).SetAlignment(pas.Classes.TAlignment.taRightJustify);
              r.$assign(ctl.GetTextRect(false));
            } else r.$assign(ctl.GetTextRect(false));
            ectl.SetBounds(Math.round(ctl.FLeft + r.Left),Math.round(ctl.FTop + r.Top),Math.round(r.Right - r.Left),Math.round(r.Bottom - r.Top));
            ectl.SetBounds(Math.round(ectl.GetLeft() + ((r.Right - r.Left - ectl.GetWidth()) / 2)),Math.round(ectl.GetTop() + ((r.Bottom - r.Top - ectl.GetHeight()) / 2)),ectl.GetWidth(),ectl.GetHeight());
            if ((pas["WEBLib.StdCtrls"].TCustomEdit.isPrototypeOf(ectl) || pas["WEBLib.StdCtrls"].TCustomMemo.isPrototypeOf(ectl)) && !$mod.TTMSFNCGridSpinBox.isPrototypeOf(ectl) && (ectl.GetHeight() > (r.Bottom - r.Top))) {
              ectl.SetTop(ectl.GetTop() + 4);
              ectl.SetHeight(ectl.GetHeight() - 8);
            };
            this.FEditControl.SetParent($Self);
            this.FEditControl.SetVisible(true);
            this.FEditControl.BringToFront();
            if (pas.SysUtils.Supports$1($ir.ref(2,rtl.queryIntfT(this.FEditControl,pas.System.IUnknown)),rtl.getIntfGUIDR(pas["WEBLib.TMSFNCTypes"].ITMSFNCCustomEditor),{get: function () {
                return ioe;
              }, set: function (v) {
                ioe = v;
              }})) {
              if (InsertKey) {
                ioe.SetSelStart(ioe.GetTextLength());
                ioe.SetSelLength(0);
              } else {
                var $tmp2 = CellStart;
                if ($tmp2 === $mod.TTMSFNCGridEditCellStart.csNone) {
                  ioe.SetSelStart(0);
                  ioe.SetSelLength(ioe.GetTextLength());
                } else if ($tmp2 === $mod.TTMSFNCGridEditCellStart.csStart) {
                  ioe.SetSelStart(0);
                  ioe.SetSelLength(0);
                } else if ($tmp2 === $mod.TTMSFNCGridEditCellStart.csEnd) {
                  ioe.SetSelStart(ioe.GetTextLength());
                  ioe.SetSelLength(0);
                };
              };
            };
            if ($mod.TTMSFNCGridEdit.isPrototypeOf(this.FEditControl)) {
              try {
                if (InsertKey) {
                  rtl.as(this.FEditControl,$mod.TTMSFNCGridEdit).SetSelStart(rtl.as(this.FEditControl,$mod.TTMSFNCGridEdit).GetT().length);
                  rtl.as(this.FEditControl,$mod.TTMSFNCGridEdit).SetSelLength(0);
                } else {
                  var $tmp3 = CellStart;
                  if ($tmp3 === $mod.TTMSFNCGridEditCellStart.csNone) {
                    rtl.as(this.FEditControl,$mod.TTMSFNCGridEdit).SetSelStart(0);
                    rtl.as(this.FEditControl,$mod.TTMSFNCGridEdit).SetSelLength(rtl.as(this.FEditControl,$mod.TTMSFNCGridEdit).GetT().length);
                  } else if ($tmp3 === $mod.TTMSFNCGridEditCellStart.csStart) {
                    rtl.as(this.FEditControl,$mod.TTMSFNCGridEdit).SetSelStart(0);
                    rtl.as(this.FEditControl,$mod.TTMSFNCGridEdit).SetSelLength(0);
                  } else if ($tmp3 === $mod.TTMSFNCGridEditCellStart.csEnd) {
                    rtl.as(this.FEditControl,$mod.TTMSFNCGridEdit).SetSelStart(rtl.as(this.FEditControl,$mod.TTMSFNCGridEdit).GetT().length);
                    rtl.as(this.FEditControl,$mod.TTMSFNCGridEdit).SetSelLength(0);
                  };
                };
              } finally {
              };
            };
            if ($mod.TTMSFNCGridMemo.isPrototypeOf(this.FEditControl)) {
              if (InsertKey) {
                if (rtl.as(this.FEditControl,$mod.TTMSFNCGridMemo).FLines.GetCount() > 0) {
                  rtl.as(this.FEditControl,$mod.TTMSFNCGridMemo).FCaretPosition.$assign(CreateCaretPos(rtl.as(this.FEditControl,$mod.TTMSFNCGridMemo).FLines.GetCount() - 1,rtl.as(this.FEditControl,$mod.TTMSFNCGridMemo).FLines.Get(rtl.as(this.FEditControl,$mod.TTMSFNCGridMemo).FLines.GetCount() - 1).length))}
                 else rtl.as(this.FEditControl,$mod.TTMSFNCGridMemo).FCaretPosition.$assign(CreateCaretPos(0,0));
                rtl.as(this.FEditControl,$mod.TTMSFNCGridMemo).SetSelLength(0);
              } else {
                var $tmp4 = CellStart;
                if ($tmp4 === $mod.TTMSFNCGridEditCellStart.csNone) {
                  rtl.as(this.FEditControl,$mod.TTMSFNCGridMemo).FCaretPosition.$assign(CreateCaretPos(0,0));
                  rtl.as(this.FEditControl,$mod.TTMSFNCGridMemo).SetSelLength(rtl.as(this.FEditControl,$mod.TTMSFNCGridMemo).FLines.GetCount() - 1);
                } else if ($tmp4 === $mod.TTMSFNCGridEditCellStart.csStart) {
                  rtl.as(this.FEditControl,$mod.TTMSFNCGridMemo).FCaretPosition.$assign(CreateCaretPos(0,0));
                  rtl.as(this.FEditControl,$mod.TTMSFNCGridMemo).SetSelLength(0);
                } else if ($tmp4 === $mod.TTMSFNCGridEditCellStart.csEnd) {
                  if (rtl.as(this.FEditControl,$mod.TTMSFNCGridMemo).FLines.GetCount() > 0) {
                    rtl.as(this.FEditControl,$mod.TTMSFNCGridMemo).FCaretPosition.$assign(CreateCaretPos(rtl.as(this.FEditControl,$mod.TTMSFNCGridMemo).FLines.GetCount() - 1,rtl.as(this.FEditControl,$mod.TTMSFNCGridMemo).FLines.Get(rtl.as(this.FEditControl,$mod.TTMSFNCGridMemo).FLines.GetCount() - 1).length))}
                   else rtl.as(this.FEditControl,$mod.TTMSFNCGridMemo).FCaretPosition.$assign(CreateCaretPos(0,0));
                  rtl.as(this.FEditControl,$mod.TTMSFNCGridMemo).SetSelLength(0);
                };
              };
            };
            if (this.FOptions.FEditing.FDirectComboDrop) {
              if ($mod.TTMSFNCGridComboBox.isPrototypeOf(this.FEditControl)) if ($mod.TTMSFNCGridComboBox.isPrototypeOf(this.FEditControl)) rtl.as(this.FEditControl,$mod.TTMSFNCGridComboBox).SetDroppedDown(true);
              if ($mod.TTMSFNCGridDatePicker.isPrototypeOf(this.FEditControl)) ;
            };
            if (this.FEditControl.CanFocus()) this.FEditControl.SetFocus();
            this.FEditCell.$assign(ACell);
            this.FEditing = true;
          };
        };
        this.Invalidate();
      } finally {
        $ir.free();
        rtl._Release(ioe);
      };
    };
    this.CancelEdit = function () {
      var celleditor = 0;
      if (this.FBlockHide) return;
      this.FBlockHide = true;
      celleditor = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridEditorType.etEdit;
      this.DoGetCellEditorType(this.FEditCell.Col,this.FEditCell.Row,{get: function () {
          return celleditor;
        }, set: function (v) {
          celleditor = v;
        }});
      if (celleditor !== pas["WEBLib.TMSFNCGridData"].TTMSFNCGridEditorType.etCustom) {
        if (this.FEditControl != null) this.FEditControl.SetParent(null);
        this.FEditControl = null;
      } else this.FFreeEditControlTimer.SetEnabled(true);
      this.FEditing = false;
      this.DoCellEditCancel(this.FEditCell.Col,this.FEditCell.Row);
      if (this.CanFocus()) this.SetFocus();
      this.FBlockHide = false;
    };
    this.StopEdit = function () {
      this.HideEdit(false,false);
    };
    this.NextPage = function () {
      var c = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      c.$assign(this.GetFocusedCell());
      this.SetFocusedCell(this.NextSelectableRow(c.Col,(c.Row + this.GetPageScrollSize()) - 1));
    };
    this.PreviousPage = function () {
      var c = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      c.$assign(this.GetFocusedCell());
      this.SetFocusedCell(this.NextSelectableRow(c.Col,(c.Row - this.GetPageScrollSize()) + 1));
    };
    this.LoadSettingsFromFile = function (AFileName) {
      this.FUseColumns = false;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.LoadSettingsFromFile.apply(this,arguments);
    };
    this.LoadSettingsFromStream = function (AStream) {
      this.FUseColumns = false;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.LoadSettingsFromStream.apply(this,arguments);
    };
    this.Navigate = function (ACell, ForceScroll) {
      var hs = 0.0;
      var vs = 0.0;
      var rhs = 0.0;
      var rvs = 0.0;
      var vss = 0.0;
      var hss = 0.0;
      var totalh = 0.0;
      var totalw = 0.0;
      var cs = 0;
      var rs = 0;
      var c = 0;
      var r = 0;
      var toth = 0.0;
      var totw = 0.0;
      var cl = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      var contentr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (this.FBlockUpdate) return;
      contentr.$assign(this.GetContentRect());
      vs = this.GetVerticalScrollPosition();
      hs = this.GetHorizontalScrollPosition();
      vss = vs;
      hss = hs;
      if (this.FScrollMode === pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControlMode.scmItemScrolling) {
        vss = -this.GetCellContainerPosY();
        hss = -this.GetCellContainerPosX();
      };
      totalw = 0;
      totalh = 0;
      ACell.$assign(this.BaseCell(ACell.Col,ACell.Row));
      cs = this.ColSpan(ACell.Col,ACell.Row);
      rs = this.RowSpan(ACell.Col,ACell.Row);
      if (cs > 0) {
        for (var $l = ACell.Col, $end = (ACell.Col + cs) - 1; $l <= $end; $l++) {
          c = $l;
          totalw = totalw + this.GetColWidths(c);
        };
      } else totalw = this.GetColWidths(ACell.Col);
      if (rs > 0) {
        for (var $l1 = ACell.Row, $end1 = (ACell.Row + rs) - 1; $l1 <= $end1; $l1++) {
          r = $l1;
          totalh = totalh + this.GetRowHeights(r);
        };
      } else totalh = this.GetRowHeights(ACell.Row);
      rvs = this.GetVerticalPos(0,ACell.Row);
      if (ForceScroll) {
        var $tmp = this.FScrollMode;
        if ($tmp === pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControlMode.scmPixelScrolling) {
          vs = rvs - this.GetFixedHeight()}
         else if ($tmp === pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControlMode.scmItemScrolling) vs = ACell.Row - this.FFixedRows - this.FFreezeRows;
      } else {
        if (rvs < (vss + this.GetFixedHeight())) {
          var $tmp1 = this.FScrollMode;
          if ($tmp1 === pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControlMode.scmPixelScrolling) {
            vs = rvs - this.GetFixedHeight()}
           else if ($tmp1 === pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControlMode.scmItemScrolling) vs = ACell.Row - this.FFixedRows - this.FFreezeRows;
        } else {
          var $tmp2 = this.FScrollMode;
          if ($tmp2 === pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControlMode.scmPixelScrolling) {
            if ((rvs + totalh) > ((vss + (contentr.Bottom - contentr.Top)) - this.GetFixedFooterHeight())) vs = ((rvs + totalh) - (contentr.Bottom - contentr.Top)) + this.GetFixedFooterHeight();
          } else if ($tmp2 === pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControlMode.scmItemScrolling) {
            while ((rvs + totalh) > ((vss + (contentr.Bottom - contentr.Top)) - this.GetFixedFooterHeight())) {
              toth = 0;
              vs = vs + 1;
              cl.$assign(this.BaseCell(ACell.Col,Math.round(vs)));
              rs = this.RowSpan(cl.Col,cl.Row);
              if (rs > 0) {
                for (var $l2 = cl.Row, $end2 = (cl.Row + rs) - 1; $l2 <= $end2; $l2++) {
                  r = $l2;
                  toth = toth + this.GetRowHeights(r);
                };
              } else {
                rs = 1;
                toth = this.GetRowHeights(cl.Row);
              };
              vs = (vs + rs) - 1;
              vss = vss + toth;
            };
          };
        };
      };
      rhs = this.GetHorizontalPos(0,ACell.Col);
      if (ForceScroll) {
        var $tmp3 = this.FScrollMode;
        if ($tmp3 === pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControlMode.scmPixelScrolling) {
          hs = rhs - this.GetFixedWidth()}
         else if ($tmp3 === pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControlMode.scmItemScrolling) hs = ACell.Col - this.FFixedColumns - this.FFreezeColumns;
      } else {
        if (rhs < (hss + this.GetFixedWidth())) {
          var $tmp4 = this.FScrollMode;
          if ($tmp4 === pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControlMode.scmPixelScrolling) {
            hs = rhs - this.GetFixedWidth()}
           else if ($tmp4 === pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControlMode.scmItemScrolling) hs = ACell.Col - this.FFixedColumns - this.FFreezeColumns;
        } else {
          var $tmp5 = this.FScrollMode;
          if ($tmp5 === pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControlMode.scmPixelScrolling) {
            if ((rhs + totalw) > ((hss + (contentr.Right - contentr.Left)) - this.GetFixedRightWidth())) hs = ((rhs + totalw) - (contentr.Right - contentr.Left)) + this.GetFixedRightWidth();
          } else if ($tmp5 === pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControlMode.scmItemScrolling) {
            while ((rhs + totalw) > ((hss + (contentr.Right - contentr.Left)) - this.GetFixedRightWidth())) {
              totw = 0;
              hs = hs + 1;
              cl.$assign(this.BaseCell(Math.round(hs),ACell.Row));
              cs = this.ColSpan(cl.Col,cl.Row);
              if (cs > 0) {
                for (var $l3 = cl.Col, $end3 = (cl.Col + cs) - 1; $l3 <= $end3; $l3++) {
                  c = $l3;
                  totw = totw + this.GetColWidths(c);
                };
              } else {
                cs = 1;
                totw = this.GetColWidths(cl.Col);
              };
              hs = (hs + cs) - 1;
              hss = hss + totw;
            };
          };
        };
      };
      this.Scroll(hs,vs);
    };
    this.UpdateControlAfterResize = function () {
      var a = false;
      pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControl.UpdateControlAfterResize.call(this);
      a = true;
      if (this.FAdapter != null) {
        this.FAdapter.UpdateBounds();
        a = this.FAdapter.CanCancelEdit();
      };
      if (this.FEditing && a) this.CancelEdit();
    };
    this.AutoSizeGrid = function (Accurate, PaddingCol, PaddingRow) {
      this.AutoSizeColumns(Accurate,PaddingCol);
      this.AutoSizeRows(PaddingRow);
    };
    this.AutoSizeColumn = function (ACol, Accurate, Padding) {
      this.AutoSizeColumnInt(ACol,Accurate,Padding);
      this.UpdateControl(true,true);
    };
    this.AutoSizeColumns = function (Accurate, Padding) {
      var i = 0;
      for (var $l = 0, $end = this.GetColumnCount() - 1; $l <= $end; $l++) {
        i = $l;
        this.AutoSizeColumn(i,Accurate,Padding);
      };
      this.UpdateControl(true,true);
    };
    this.AutoSizeRow = function (ARow, Padding) {
      this.AutoSizeRowInt(ARow,Padding);
      this.UpdateControl(true,true);
    };
    this.AutoSizeRows = function (Padding) {
      var i = 0;
      for (var $l = 0, $end = this.GetRowCount() - 1; $l <= $end; $l++) {
        i = $l;
        this.AutoSizeRowInt(i,Padding);
      };
      this.UpdateControl(true,true);
    };
    this.StretchColumn = function (ACol, ANewWidth) {
      var i = 0;
      var w = 0.0;
      var nw = 0.0;
      var d = 0.0;
      var cnt = 0;
      var contentr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      contentr.$assign(this.GetContentRect());
      if (ANewWidth === -1) {
        nw = contentr.Right - contentr.Left - 1}
       else nw = ANewWidth;
      cnt = this.GetColumnCount();
      if (ACol === -1) ACol = cnt - 1;
      if ((cnt === 0) || !this.FOptions.FColumnSize.FStretch) return;
      if (ACol >= cnt) throw pas.SysUtils.Exception.$create("Create$1",["Stretch column index out of range"]);
      if (cnt === 1) {
        this.SetColWidths(0,contentr.Right - contentr.Left - 1);
        return;
      };
      w = 0;
      if (this.FOptions.FColumnSize.FStretchAll) {
        if ((cnt - this.FFixedColumns - this.FFixedRightColumns) > 0) {
          d = nw;
          for (var $l = 1, $end = this.FFixedColumns; $l <= $end; $l++) {
            i = $l;
            d = d - this.GetColWidths(i - 1);
          };
          for (var $l1 = 1, $end1 = this.FFixedRightColumns; $l1 <= $end1; $l1++) {
            i = $l1;
            d = d - this.GetColWidths(cnt - i);
          };
          w = d / (cnt - this.FFixedColumns - this.FFixedRightColumns);
          for (var $l2 = this.FFixedColumns, $end2 = cnt - this.FFixedRightColumns - 1; $l2 <= $end2; $l2++) {
            i = $l2;
            this.SetColWidths(i,w);
          };
        };
      } else {
        for (var $l3 = 0, $end3 = cnt - 1; $l3 <= $end3; $l3++) {
          i = $l3;
          if (i !== ACol) w = w + this.GetColWidths(i);
        };
        if (w < this.GetWidth()) this.SetColWidths(ACol,nw - w);
      };
    };
    this.SelectCell = function (Cell, Shift, MouseDragging) {
      var sta = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      var stc = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      var rs = 0;
      var cs = 0;
      var rsstart = 0;
      var csstart = 0;
      var bs = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      var cst = 0;
      var rst = 0;
      var ic = 0;
      var ir = 0;
      var I = 0;
      var J = 0;
      var doUpdate = false;
      var Allow = false;
      var key = 0;
      var k = "\x00";
      var cntr = 0;
      var cntc = 0;
      var cntcl = 0;
      pas["WEBLib.TMSFNCGridData"].TTMSFNCGridData.SelectCell.apply(this,arguments);
      this.FPrevSelection.$assign(this.GetSelection());
      if ((Cell.Row < this.FFixedRows) && (Cell.Col < this.FFixedColumns) && (pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridFixedCellSelectionMode.fcsAll in this.FOptions.FMouse.FFixedCellSelection)) {
        k = "\x1F";
        key = 65;
        this.HandleKeyPress({get: function () {
            return k;
          }, set: function (v) {
            k = v;
          }});
        this.HandleKeyDown({get: function () {
            return key;
          }, set: function (v) {
            key = v;
          }},rtl.createSet(pas.Classes.TShiftState$a.ssCtrl));
        return;
      };
      Cell.Row = Math.max(this.FFixedRows,Math.min(Cell.Row,this.GetRowCount() - 1 - this.FFixedFooterRows));
      Cell.Col = Math.max(this.FFixedColumns,Math.min(Cell.Col,this.GetColumnCount() - 1 - this.FFixedRightColumns));
      Allow = true;
      if ((this.FOnSelectCell != null) && !this.FBlockSelectEventHandler) this.FOnSelectCell(this,Cell.Col,Cell.Row,{get: function () {
          return Allow;
        }, set: function (v) {
          Allow = v;
        }});
      if (!Allow) return;
      this.FPrevSelectedCell.$assign(this.GetFocusedCell());
      this.FRealCell.$assign(Cell);
      Cell.$assign(this.BaseCell(Cell.Col,Cell.Row));
      this.SetFocusCell(Cell.Col,Cell.Row);
      var $tmp = this.FOptions.FSelection.FMode;
      if ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smSingleCell) {
        this.SetStartCell(this.GetFocusedCell().Col,this.GetFocusedCell().Row);
        this.SetStopCell(this.GetFocusedCell().Col,this.GetFocusedCell().Row);
      } else if ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smSingleRow) {
        this.SetStartCell(this.FFixedColumns,this.GetFocusedCell().Row);
        this.SetStopCell(this.GetColumnCount() - 1 - this.FFixedRightColumns,this.GetFocusedCell().Row);
      } else if ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smSingleColumn) {
        this.SetStartCell(this.GetFocusedCell().Col,this.FFixedRows);
        this.SetStopCell(this.GetFocusedCell().Col,this.GetRowCount() - 1 - this.FFixedFooterRows);
      } else if (($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smCellRange) || ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smRowRange) || ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smColumnRange) || ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctRow) || ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctColumn) || ($tmp === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctCell)) {
        doUpdate = true;
        if ((!MouseDragging || (this.FFirstCell.Row === -1) || (this.FFirstCell.Col === -1)) && !(pas.Classes.TShiftState$a.ssShift in Shift) && !(pas.Classes.TShiftState$a.ssCtrl in Shift)) {
          this.SetStartCell(this.FRealCell.Col,this.GetFocusedCell().Row);
          this.SetStopCell(this.GetFocusedCell().Col,this.GetFocusedCell().Row);
          this.FFirstCell.$assign(this.FStartCell);
          this.FSaveCell.$assign(this.FStartCell);
        } else if ((pas.Classes.TShiftState$a.ssShift in Shift) && ((this.FSaveCell.Row === -1) || (this.FSaveCell.Col === -1))) {
          this.SetStartCell(this.GetFocusedCell().Col,this.GetFocusedCell().Row);
          this.SetStopCell(this.GetFocusedCell().Col,this.GetFocusedCell().Row);
          this.FSaveCell.$assign(this.FStartCell);
        } else if ((pas.Classes.TShiftState$a.ssCtrl in Shift) && ((this.FOptions.FSelection.FMode === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctRow) || (this.FOptions.FSelection.FMode === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctColumn) || (this.FOptions.FSelection.FMode === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctCell))) {
          var $tmp1 = this.FOptions.FSelection.FMode;
          if ($tmp1 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctRow) {
            if (this.GetFocusedCell().Row < this.FStartCell.Row) {
              this.SetStartCell(this.FRealCell.Col,this.GetFocusedCell().Row);
              this.FFirstCell.$assign(this.FStopCell);
              this.FSaveCell.$assign(this.FStopCell);
            } else if (this.GetFocusedCell().Row > this.FStopCell.Row) {
              this.SetStopCell(this.GetFocusedCell().Col,this.GetFocusedCell().Row);
              this.FFirstCell.$assign(this.FStartCell);
              this.FSaveCell.$assign(this.FStartCell);
            } else doUpdate = false;
          } else if ($tmp1 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctColumn) {
            if (this.GetFocusedCell().Col < this.FStartCell.Col) {
              this.SetStartCell(this.GetFocusedCell().Col,this.FRealCell.Row);
              this.FFirstCell.$assign(this.FStopCell);
              this.FSaveCell.$assign(this.FStopCell);
            } else if (this.GetFocusedCell().Col > this.FStopCell.Col) {
              this.SetStopCell(this.GetFocusedCell().Col,this.GetFocusedCell().Row);
              this.FFirstCell.$assign(this.FStartCell);
              this.FSaveCell.$assign(this.FStartCell);
            } else doUpdate = false;
          } else if ($tmp1 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctCell) {
            doUpdate = false;
            if (this.GetFocusedCell().Col < this.FStartCell.Col) {
              if (this.GetFocusedCell().Row < this.FStartCell.Row) {
                this.SetStartCell(this.GetFocusedCell().Col,this.GetFocusedCell().Row)}
               else if (this.GetFocusedCell().Row > this.FStopCell.Row) {
                this.SetStopCell(this.GetFocusedCell().Col,this.GetFocusedCell().Row)}
               else if ((this.GetFocusedCell().Row >= this.FStartCell.Row) || (this.GetFocusedCell().Row <= this.FStopCell.Row)) this.SetStartCell(this.GetFocusedCell().Col,this.FStartCell.Row);
            } else if (this.GetFocusedCell().Col > this.FStopCell.Col) {
              if (this.GetFocusedCell().Row < this.FStartCell.Row) {
                this.SetStartCell(this.GetFocusedCell().Col,this.GetFocusedCell().Row)}
               else if (this.GetFocusedCell().Row > this.FStopCell.Row) {
                this.SetStopCell(this.GetFocusedCell().Col,this.GetFocusedCell().Row)}
               else if ((this.GetFocusedCell().Row >= this.FStartCell.Row) || (this.GetFocusedCell().Row >= this.FStopCell.Row)) this.SetStopCell(this.GetFocusedCell().Col,this.FStopCell.Row);
            } else if ((this.GetFocusedCell().Col >= this.FStartCell.Col) && (this.GetFocusedCell().Col <= this.FStopCell.Col)) {
              if (this.GetFocusedCell().Row < this.FStartCell.Row) {
                this.SetStartCell(this.FStartCell.Col,this.GetFocusedCell().Row)}
               else if (this.GetFocusedCell().Row > this.FStopCell.Row) this.SetStopCell(this.FStopCell.Col,this.GetFocusedCell().Row);
            };
          };
        };
        if (pas.Classes.TShiftState$a.ssShift in Shift) this.FFirstCell.$assign(this.FSaveCell);
        if (doUpdate) {
          if (this.GetFocusedCell().Col < this.FFirstCell.Col) {
            this.SetStartCell(this.GetFocusedCell().Col,this.FStartCell.Row);
            this.SetStopCell(this.FFirstCell.Col,this.FStopCell.Row);
          } else {
            this.SetStopCell(this.GetFocusedCell().Col,this.FStopCell.Row);
            this.SetStartCell(this.FFirstCell.Col,this.FStartCell.Row);
          };
          if (this.GetFocusedCell().Row < this.FFirstCell.Row) {
            this.SetStartCell(this.FStartCell.Col,this.GetFocusedCell().Row);
            this.SetStopCell(this.FStopCell.Col,this.FFirstCell.Row);
          } else {
            this.SetStopCell(this.FStopCell.Col,this.GetFocusedCell().Row);
            this.SetStartCell(this.FStartCell.Col,this.FFirstCell.Row);
          };
        };
        var $tmp2 = this.FOptions.FSelection.FMode;
        if (($tmp2 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctRow) || ($tmp2 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctColumn) || ($tmp2 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctCell)) {
          if (!(pas.Classes.TShiftState$a.ssCtrl in Shift) && !(pas.Classes.TShiftState$a.ssShift in Shift)) {
            this.SetStartCell(this.GetFocusedCell().Col,this.GetFocusedCell().Row);
            this.SetStopCell(this.GetFocusedCell().Col,this.GetFocusedCell().Row);
            this.FSaveCell.$assign(this.GetFocusedCell());
          };
        };
        var $tmp3 = this.FOptions.FSelection.FMode;
        if (($tmp3 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smRowRange) || ($tmp3 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctRow)) {
          this.SetStartCell(this.FFixedColumns,this.FStartCell.Row);
          this.SetStopCell(this.GetColumnCount() - 1 - this.FFixedRightColumns,this.FStopCell.Row);
        } else if (($tmp3 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smColumnRange) || ($tmp3 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctColumn)) {
          this.SetStartCell(this.FStartCell.Col,this.FFixedRows);
          this.SetStopCell(this.FStopCell.Col,this.GetRowCount() - 1 - this.FFixedFooterRows);
        };
      };
      stc.$assign(this.FStopCell);
      sta.$assign(this.FStartCell);
      if (this.FStopCell.Col < this.FStartCell.Col) {
        this.SetStopCell(sta.Col,this.FStopCell.Row);
        this.SetStartCell(stc.Col,this.FStartCell.Row);
      };
      if (this.FStopCell.Row < this.FStartCell.Row) {
        this.SetStopCell(this.FStopCell.Col,sta.Row);
        this.SetStartCell(this.FStartCell.Col,stc.Row);
      };
      this.Navigate(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(this.GetFocusedCell()),false);
      cs = this.FStopCell.Col;
      csstart = this.FStartCell.Col;
      rs = this.FStopCell.Row;
      rsstart = this.FStartCell.Row;
      for (var $l = Math.max(this.FCStart,csstart), $end = Math.min(this.FCStop,cs); $l <= $end; $l++) {
        ic = $l;
        for (var $l1 = Math.max(this.FRStart,rsstart), $end1 = Math.min(this.FRStop,rs); $l1 <= $end1; $l1++) {
          ir = $l1;
          bs.$assign(this.BaseCell(ic,ir));
          cst = this.ColSpan(bs.Col,bs.Row);
          if (((bs.Col + cst) - 1) > cs) cs = (bs.Col + cst) - 1;
          if (bs.Col < csstart) csstart = bs.Col;
          rst = this.RowSpan(bs.Col,bs.Row);
          if (((bs.Row + rst) - 1) > rs) rs = (bs.Row + rst) - 1;
          if (bs.Row < rsstart) rsstart = bs.Row;
        };
      };
      this.SetStopCell(cs,rs);
      this.SetStartCell(csstart,rsstart);
      var $tmp4 = this.FOptions.FSelection.FMode;
      if ($tmp4 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctRow) {
        this.FBlockUpdate = true;
        if (!(pas.Classes.TShiftState$a.ssCtrl in Shift)) this.ClearRowSelect();
        if (pas.Classes.TShiftState$a.ssShift in Shift) {
          for (var $l2 = this.FStartCell.Row, $end2 = this.FStopCell.Row; $l2 <= $end2; $l2++) {
            I = $l2;
            this.SetRowSelect(I,!this.GetRowSelect(I));
          };
        } else {
          this.SetRowSelect(this.GetFocusedCell().Row,!this.GetRowSelect(this.GetFocusedCell().Row));
          cntr = this.GetSelectedRowCount();
          if (!this.GetRowSelect(this.GetFocusedCell().Row) && (cntr === 0)) this.SetRowSelect(this.GetFocusedCell().Row,true);
        };
        if (!this.GetRowSelect(this.GetFocusedCell().Row)) for (var $l3 = this.FStartCell.Row, $end3 = this.FStopCell.Row; $l3 <= $end3; $l3++) {
          I = $l3;
          if ((I !== this.GetFocusedCell().Row) && this.GetRowSelect(I)) this.SetFocusCell(this.GetFocusedCell().Col,I);
        };
        this.FBlockUpdate = false;
      } else if ($tmp4 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctColumn) {
        this.FBlockUpdate = true;
        if (!(pas.Classes.TShiftState$a.ssCtrl in Shift)) this.ClearColumnSelect();
        if (pas.Classes.TShiftState$a.ssShift in Shift) {
          for (var $l4 = this.FStartCell.Col, $end4 = this.FStopCell.Col; $l4 <= $end4; $l4++) {
            I = $l4;
            this.SetColumnSelect(I,!this.GetColumnSelect(I));
          };
        } else {
          this.SetColumnSelect(this.GetFocusedCell().Col,!this.GetColumnSelect(this.GetFocusedCell().Col));
          cntc = this.GetSelectedColumnCount();
          if (!this.GetColumnSelect(this.GetFocusedCell().Col) && (cntc === 0)) this.SetColumnSelect(this.GetFocusedCell().Col,true);
        };
        if (!this.GetColumnSelect(this.GetFocusedCell().Col)) for (var $l5 = this.FStartCell.Col, $end5 = this.FStopCell.Col; $l5 <= $end5; $l5++) {
          I = $l5;
          if ((I !== this.GetFocusedCell().Col) && this.GetColumnSelect(I)) this.SetFocusCell(I,this.GetFocusedCell().Row);
        };
        this.FBlockUpdate = false;
      } else if ($tmp4 === pas["WEBLib.TMSFNCGridOptions"].TTMSFNCGridSelectionMode.smDisjunctCell) {
        this.FBlockUpdate = true;
        if (!(pas.Classes.TShiftState$a.ssCtrl in Shift)) this.ClearCellSelect();
        if (pas.Classes.TShiftState$a.ssShift in Shift) {
          for (var $l6 = this.FStartCell.Col, $end6 = this.FStartCell.Row; $l6 <= $end6; $l6++) {
            I = $l6;
            for (var $l7 = this.FStartCell.Row, $end7 = this.FStopCell.Row; $l7 <= $end7; $l7++) {
              J = $l7;
              this.SetCellSelect(I,J,!this.GetCellSelect(I,J));
            };
          };
        } else {
          this.SetCellSelect(this.GetFocusedCell().Col,this.GetFocusedCell().Row,!this.GetCellSelect(this.GetFocusedCell().Col,this.GetFocusedCell().Row));
          cntcl = this.GetSelectedCellCount();
          if (!this.GetCellSelect(this.GetFocusedCell().Col,this.GetFocusedCell().Row) && (cntcl === 0)) this.SetCellSelect(this.GetFocusedCell().Col,this.GetFocusedCell().Row,true);
        };
        if (!this.GetCellSelect(this.GetFocusedCell().Col,this.GetFocusedCell().Row)) for (var $l8 = this.FStartCell.Col, $end8 = this.FStartCell.Row; $l8 <= $end8; $l8++) {
          I = $l8;
          for (var $l9 = this.FStartCell.Row, $end9 = this.FStopCell.Row; $l9 <= $end9; $l9++) {
            J = $l9;
            if ((I !== this.GetFocusedCell().Col) && (J !== this.GetFocusedCell().Row) && this.GetCellSelect(I,J)) this.SetFocusCell(I,J);
          };
        };
        this.FBlockUpdate = false;
      };
      this.Navigate(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(this.GetFocusedCell()),false);
      if (Allow && (this.FAdapter != null)) this.FAdapter.SelectCell(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(this.GetFocusedCell()));
      if (Allow && (this.FOnSelectedCell != null) && !this.FBlockSelectEventHandler) this.FOnSelectedCell(this,this.GetFocusedCell().Col,this.GetFocusedCell().Row);
    };
    this.UpdateGridCells = function (AScrollOnly) {
      var vVal = 0.0;
      var hVal = 0.0;
      var cw = 0.0;
      var rh = 0.0;
      var x = 0.0;
      var y = 0.0;
      var xs = 0.0;
      var ys = 0.0;
      var rBounds = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var xOrig = 0.0;
      var yOrig = 0.0;
      var scrollv = 0.0;
      var scrollh = 0.0;
      var i = 0;
      var fw = 0.0;
      var fh = 0.0;
      var fwr = 0.0;
      var fhr = 0.0;
      var cfs = 0;
      var rfs = 0;
      var cfst = 0;
      var rfst = 0;
      var hMax = 0.0;
      var vMax = 0.0;
      var containerh = 0.0;
      var containerw = 0.0;
      if ((this.FUpdateCount$1 > 0) || this.FBlockUpdate || (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState)) return;
      this.FBlockUpdate = true;
      vVal = this.GetVerticalScrollPosition();
      hVal = this.GetHorizontalScrollPosition();
      hMax = this.GetHorizontalScrollMax();
      vMax = this.GetVerticalScrollMax();
      scrollv = 0;
      scrollh = 0;
      if (this.FScrollMode === pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControlMode.scmItemScrolling) {
        hMax = this.GetTotalContentWidth();
        vMax = this.GetTotalContentHeight();
        for (var $l = this.FFixedRows + this.FFreezeRows, $end = (Math.round(vVal) - 1) + this.FFixedRows + this.FFreezeRows; $l <= $end; $l++) {
          i = $l;
          scrollv = scrollv + this.GetRowHeights(i);
        };
        for (var $l1 = this.FFixedColumns + this.FFreezeColumns, $end1 = (Math.round(hVal) - 1) + this.FFixedColumns + this.FFreezeColumns; $l1 <= $end1; $l1++) {
          i = $l1;
          scrollh = scrollh + this.GetColWidths(i);
        };
        vVal = scrollv;
        hVal = scrollh;
      };
      this.FCellPosX = Math.round(-hVal);
      this.FCellPosY = Math.round(-vVal);
      containerw = this.GetTotalContentWidth();
      containerh = this.GetTotalContentHeight();
      if ((containerw > 0) && (containerh > 0)) {
        cfs = this.GetFixedCols();
        rfs = this.GetFixedRows();
        cfst = this.FFixedRightColumns;
        rfst = this.FFixedFooterRows;
        this.FOldTopRow = this.FRStart;
        this.FCStart = cfs;
        this.FRStart = rfs;
        rBounds.$assign(this.GetContentRect());
        rBounds.$assign(pas["WEBLib.TMSFNCTypes"].RectF(rBounds.Left,rBounds.Top,rBounds.Right - 1,rBounds.Bottom - 1));
        fw = this.GetFixedWidth();
        fh = this.GetFixedHeight();
        fwr = this.GetFixedRightWidth();
        fhr = this.GetFixedFooterHeight();
        xOrig = 0;
        yOrig = 0;
        if ((hVal > (hMax / 2)) && (this.FColumnW.GetCount() === 0)) {
          this.FCStop = this.GetColumnCount() - 1 - cfst;
          x = containerw - fwr;
          do {
            cw = this.GetColWidths(this.FCStop);
            if ((x - cw) > ((hVal + (rBounds.Right - rBounds.Left)) - fwr)) {
              x = x - cw;
              this.FCStop -= 1;
            };
          } while (!((x - cw) <= ((hVal + (rBounds.Right - rBounds.Left)) - fwr)));
        } else {
          x = fw;
          do {
            cw = this.GetColWidths(this.FCStart);
            if ((x + cw) <= (hVal + fw)) {
              x = x + cw;
              this.FCStart += 1;
            };
          } while (!((x + cw) > (hVal + fw)));
          xOrig = x;
        };
        if ((vVal > (vMax / 2)) && (this.FRowH.GetCount() === 0)) {
          this.FRStop = this.GetRowCount() - 1 - rfst;
          y = containerh - fhr;
          do {
            rh = this.GetRowHeights(this.FRStop);
            if ((y - rh) > ((vVal + (rBounds.Bottom - rBounds.Top)) - fhr)) {
              y = y - rh;
              this.FRStop -= 1;
            };
          } while (!((y - rh) <= ((vVal + (rBounds.Bottom - rBounds.Top)) - fhr)));
        } else {
          y = fh;
          do {
            rh = this.GetRowHeights(this.FRStart);
            if ((y + rh) <= (vVal + fh)) {
              y = y + rh;
              this.FRStart += 1;
            };
          } while (!((y + rh) > (vVal + fh)));
          yOrig = y;
        };
        if ((hVal > (hMax / 2)) && (this.FColumnW.GetCount() === 0)) {
          this.FCStart = this.FCStop;
          while ((this.FCStart > 0) && (x > (hVal + fw))) {
            x = x - this.GetColWidths(this.FCStart);
            if (!((this.FCStart > 0) && (x > (hVal + fw)))) break;
            this.FCStart -= 1;
          };
          xOrig = x;
        } else {
          this.FCStop = this.FCStart;
          while ((this.FCStop < (this.GetColumnCount() - 1)) && (x < ((hVal + (rBounds.Right - rBounds.Left)) - fwr))) {
            x = x + this.GetColWidths(this.FCStop);
            if (!((this.FCStop < (this.GetColumnCount() - 1)) && (x < ((hVal + (rBounds.Right - rBounds.Left)) - fwr)))) break;
            this.FCStop += 1;
          };
        };
        if ((vVal > (vMax / 2)) && (this.FRowH.GetCount() === 0)) {
          this.FRStart = this.FRStop;
          while ((this.FRStart > 0) && (y > (vVal + fh))) {
            y = y - this.GetRowHeights(this.FRStart);
            if (!((this.FRStart > 0) && (y > (vVal + fh)))) break;
            this.FRStart -= 1;
          };
          yOrig = y;
        } else {
          this.FRStop = this.FRStart;
          while ((this.FRStop < (this.GetRowCount() - 1)) && (y < ((vVal + (rBounds.Bottom - rBounds.Top)) - fhr))) {
            y = y + this.GetRowHeights(this.FRStop);
            if (!((this.FRStop < (this.GetRowCount() - 1)) && (y < ((vVal + (rBounds.Bottom - rBounds.Top)) - fhr)))) break;
            this.FRStop += 1;
          };
        };
        this.FRStart = Math.max(this.FFixedRows,Math.min(this.GetRowCount() - 1 - this.FFixedFooterRows,this.FRStart));
        this.FCStart = Math.max(this.FFixedColumns,Math.min(this.GetColumnCount() - 1 - this.FFixedRightColumns,this.FCStart));
        this.FRStop = Math.max(this.FFixedRows,Math.min(this.GetRowCount() - 1 - this.FFixedFooterRows,this.FRStop));
        this.FCStop = Math.max(this.FFixedColumns,Math.min(this.GetColumnCount() - 1 - this.FFixedRightColumns,this.FCStop));
        if ((this.FAdapter != null) && (this.FBlockUpdateAdapter === 0)) {
          this.FBlockUpdateAdapter += 1;
          this.FAdapter.ScrollGrid(this.GetTopRow() - this.FOldTopRow,true,AScrollOnly);
          this.FBlockUpdateAdapter -= 1;
        };
        x = xOrig - hVal;
        y = yOrig - vVal;
        xs = 0;
        ys = 0;
        if ((this.GetColumnCount() > this.GetFixedCols()) && (this.GetRowCount() > this.GetFixedRows())) this.DisplayCells(x,y,x,y,this.FCStart,this.FCStop,this.FRStart,this.FRStop,cfs,rfs,rfs,false);
        if (this.GetRowCount() > this.GetFixedRows()) this.DisplayCells(xs,y,xs,y,0,cfs - 1,this.FRStart,this.FRStop,0,rfs,rfs,true);
        if (this.GetColumnCount() > this.GetFixedCols()) this.DisplayCells(x,ys,x,ys,this.FCStart,this.FCStop,0,rfs - 1,cfs,0,0,true);
        this.DisplayCells(xs,ys,xs,ys,0,cfs - 1,0,rfs - 1,0,0,0,true);
        if ((this.GetColumnCount() > (this.GetFixedCols() + this.FFixedRightColumns)) && (this.GetRowCount() > this.GetFixedRows())) {
          this.DisplayCells((xs + (rBounds.Right - rBounds.Left)) - fwr,y,(xs + (rBounds.Right - rBounds.Left)) - fwr,y,this.GetColumnCount() - cfst,this.GetColumnCount() - 1,this.FRStart,this.FRStop,(this.FCStop - this.FCStart) + cfs + 1,rfs,rfs,true);
          this.DisplayCells((xs + (rBounds.Right - rBounds.Left)) - fwr,ys,(xs + (rBounds.Right - rBounds.Left)) - fwr,ys,this.GetColumnCount() - cfst,this.GetColumnCount() - 1,0,rfs - 1,(this.FCStop - this.FCStart) + cfs + 1,0,0,true);
        };
        if ((this.GetColumnCount() > this.GetFixedCols()) && (this.GetRowCount() > (this.GetFixedRows() + this.FFixedFooterRows))) {
          this.DisplayCells(x,(ys + (rBounds.Bottom - rBounds.Top)) - fhr,xs,(ys + (rBounds.Bottom - rBounds.Top)) - fhr,this.FCStart,this.FCStop,this.GetRowCount() - rfst,this.GetRowCount() - 1,cfs,(this.FRStop - this.FRStart) + rfs + 1,(this.FRStop - this.FRStart) + rfs + 1,true);
        };
        if ((this.GetColumnCount() > (this.GetFixedCols() + this.FFixedRightColumns)) && (this.GetRowCount() > (this.GetFixedRows() + this.FFixedFooterRows))) {
          this.DisplayCells((xs + (rBounds.Right - rBounds.Left)) - fwr,(ys + (rBounds.Bottom - rBounds.Top)) - fhr,(xs + (rBounds.Right - rBounds.Left)) - fwr,(ys + (rBounds.Bottom - rBounds.Top)) - fhr,this.GetColumnCount() - cfst,this.GetColumnCount() - 1,this.GetRowCount() - rfst,this.GetRowCount() - 1,(this.FCStop - this.FCStart) + cfs + 1,(this.FRStop - this.FRStart) + rfs + 1,(this.FRStop - this.FRStart) + rfs + 1,true);
        };
        if (this.GetRowCount() > this.GetFixedRows()) {
          this.DisplayCells(xs,(ys + (rBounds.Bottom - rBounds.Top)) - fhr,xs,(ys + (rBounds.Bottom - rBounds.Top)) - fhr,0,cfs - 1,this.GetRowCount() - rfst,this.GetRowCount() - 1,0,(this.FRStop - this.FRStart) + rfs + 1,(this.FRStop - this.FRStart) + rfs + 1,true);
        };
      } else this.RemoveAllCells();
      if ((this.FEditControl != null) && this.FEditing && !this.FFreeEditControlTimer.FEnabled) {
        this.FEditControl.BringToFront();
        this.FEditControl.SetVisible(true);
        if (this.FEditControl.CanFocus()) this.FEditControl.SetFocus();
      };
      if ((this.FTopr !== this.GetTopRow()) || (this.FLeftC !== this.GetLeftCol())) {
        if (this.FOnTopLeftChanged != null) this.FOnTopLeftChanged(this,this.GetTopRow(),this.GetLeftCol());
      };
      this.FTopr = this.GetTopRow();
      this.FLeftC = this.GetLeftCol();
      this.FBlockUpdate = false;
      if ((this.FAdapter != null) && (this.FBlockUpdateAdapter === 0)) {
        this.FBlockUpdateAdapter += 1;
        this.FAdapter.ScrollGrid(this.GetTopRow() - this.FOldTopRow,false,AScrollOnly);
        this.FBlockUpdateAdapter -= 1;
      };
      this.Invalidate();
    };
    this.UpdateControlScroll = function (AHorizontalPos, AVerticalPos, ANewHorizontalPos, ANewVerticalPos) {
      pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControl.UpdateControlScroll.apply(this,arguments);
      if ((AHorizontalPos !== ANewHorizontalPos) || (AVerticalPos !== ANewVerticalPos)) {
        this.UpdateGridCells(false)}
       else this.UpdateGridCellDisplay();
    };
    this.UpdateGridCellDisplay = function () {
      var cl = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRecRange.$new();
      if ((this.FUpdateCount$1 > 0) || this.FBlockUpdate || (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState)) return;
      this.FBlockUpdate = true;
      cl.StartCol = this.FPrevSelection.StartCol;
      cl.EndCol = this.FPrevSelection.EndCol;
      cl.StartRow = 0;
      cl.EndRow = this.FFixedRows - 1;
      this.DoUpdateGridCellDisplay(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRecRange.$clone(cl));
      cl.StartCol = 0;
      cl.EndCol = this.FFixedColumns - 1;
      cl.StartRow = this.FPrevSelection.StartRow;
      cl.EndRow = this.FPrevSelection.EndRow;
      this.DoUpdateGridCellDisplay(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRecRange.$clone(cl));
      cl.StartCol = this.FPrevSelection.StartCol;
      cl.EndCol = this.FPrevSelection.EndCol;
      cl.StartRow = this.GetRowCount() - this.FFixedFooterRows;
      cl.EndRow = this.GetRowCount() - 1;
      this.DoUpdateGridCellDisplay(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRecRange.$clone(cl));
      cl.StartCol = this.GetColumnCount() - this.FFixedRightColumns;
      cl.EndCol = this.GetColumnCount() - 1;
      cl.StartRow = this.FPrevSelection.StartRow;
      cl.EndRow = this.FPrevSelection.EndRow;
      this.DoUpdateGridCellDisplay(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRecRange.$clone(cl));
      this.DoUpdateGridCellDisplay(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRecRange.$clone(this.FPrevSelection));
      cl.StartCol = this.GetSelection().StartCol;
      cl.EndCol = this.GetSelection().EndCol;
      cl.StartRow = 0;
      cl.EndRow = this.FFixedRows - 1;
      this.DoUpdateGridCellDisplay(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRecRange.$clone(cl));
      cl.StartCol = 0;
      cl.EndCol = this.FFixedColumns - 1;
      cl.StartRow = this.GetSelection().StartRow;
      cl.EndRow = this.GetSelection().EndRow;
      this.DoUpdateGridCellDisplay(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRecRange.$clone(cl));
      cl.StartCol = this.GetSelection().StartCol;
      cl.EndCol = this.GetSelection().EndCol;
      cl.StartRow = this.GetRowCount() - this.FFixedFooterRows;
      cl.EndRow = this.GetRowCount() - 1;
      this.DoUpdateGridCellDisplay(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRecRange.$clone(cl));
      cl.StartCol = this.GetColumnCount() - this.FFixedRightColumns;
      cl.EndCol = this.GetColumnCount() - 1;
      cl.StartRow = this.GetSelection().StartRow;
      cl.EndRow = this.GetSelection().EndRow;
      this.DoUpdateGridCellDisplay(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRecRange.$clone(cl));
      this.DoUpdateGridCellDisplay(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRecRange.$clone(this.GetSelection()));
      this.FBlockUpdate = false;
      this.Invalidate();
    };
    this.DoUpdateGridCellDisplay = function (ASelection) {
      var c = 0;
      var r = 0;
      var ci = 0;
      var ri = 0;
      var cell = null;
      var bc = 0;
      var br = 0;
      var cs = 0;
      var rs = 0;
      var fc = 0;
      var fr = 0;
      var incfr = false;
      var incfc = false;
      var cStart = 0;
      var cStop = 0;
      var rStart = 0;
      var rStop = 0;
      var clStart = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      var clStop = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      var l = null;
      l = pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCellLayout.$create("Create$1");
      fc = 0;
      this.FSaveTopCell = null;
      incfc = false;
      cStart = ASelection.StartCol;
      cStop = ASelection.EndCol;
      rStart = ASelection.StartRow;
      rStop = ASelection.EndRow;
      clStart.Col = cStart;
      clStop.Col = cStop;
      clStart.Row = rStart;
      clStop.Row = rStop;
      clStart.$assign(this.GetDisplayCell(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(clStart)));
      clStop.$assign(this.GetDisplayCell(pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$clone(clStop)));
      for (var $l = clStart.Col, $end = clStop.Col; $l <= $end; $l++) {
        c = $l;
        if ((c >= 0) && (c <= (rtl.length(this.FCellArray) - 1))) {
          if (incfc) fc += 1;
          fr = 0;
          incfr = false;
          for (var $l1 = clStart.Row, $end1 = clStop.Row; $l1 <= $end1; $l1++) {
            r = $l1;
            if ((r >= 0) && (r <= (rtl.length(this.FCellArray[c]) - 1))) {
              if (incfr) fr += 1;
              cell = this.FCellArray[c][r];
              if (cell != null) {
                if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell.isPrototypeOf(cell)) {
                  bc = (c + this.FCStart) - this.GetFixedCols();
                  if (bc > this.FCStop) {
                    bc = (this.GetColumnCount() - this.FFixedRightColumns) + fc;
                    incfc = true;
                  } else if (bc < this.FCStart) bc = c;
                  br = (r + this.FRStart) - this.GetFixedRows();
                  if (br > this.FRStop) {
                    br = (this.GetRowCount() - this.FFixedFooterRows) + fr;
                    incfr = true;
                  } else if (br < this.FRStart) br = r;
                  cs = 0;
                  rs = 0;
                  this.DoGetCellMergeInfo(bc,br,{get: function () {
                      return bc;
                    }, set: function (v) {
                      bc = v;
                    }},{get: function () {
                      return br;
                    }, set: function (v) {
                      br = v;
                    }},{get: function () {
                      return cs;
                    }, set: function (v) {
                      cs = v;
                    }},{get: function () {
                      return rs;
                    }, set: function (v) {
                      rs = v;
                    }});
                  ci = bc;
                  ri = br;
                  ci = Math.max(0,Math.min(ci,this.GetColumnCount() - 1));
                  ri = Math.max(0,Math.min(ri,this.GetRowCount() - 1));
                  if ((ci === this.GetFocusedCell().Col) && (ri === this.GetFocusedCell().Row)) this.FSaveTopCell = cell;
                  this.ApplyCellState(ci,ri,cell);
                  if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell.isPrototypeOf(cell)) {
                    l.Assign(rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).FLayout);
                    this.DoGetCellLayout(ci,ri,l,this.GetCellState(ci,ri));
                    rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCGridCell).AssignLayout(l);
                  };
                  this.DoGetCellProperties(ci,ri,cell);
                };
              };
            };
          };
        };
      };
      l = rtl.freeLoc(l);
    };
    this.PaintCells = function (AGraphics, CStart, CStop, RStart, RStop, Ci, Ri, ResetCi) {
      var c = 0;
      var r = 0;
      var cell = null;
      var rctl = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rt = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var ck = false;
      var dr = false;
      var bc = pas["WEBLib.TMSFNCGridData"].TTMSFNCGridCellRec.$new();
      for (var $l = CStart, $end = CStop; $l <= $end; $l++) {
        c = $l;
        for (var $l1 = RStart, $end1 = RStop; $l1 <= $end1; $l1++) {
          r = $l1;
          if (rtl.length(this.FCellArray) > Ci) {
            if (rtl.length(this.FCellArray[Ci]) > Ri) {
              dr = true;
              ck = (this.GetFocusedCell().Col === c) && (this.GetFocusedCell().Row === r);
              if (this.IsMerged(c,r)) {
                bc.$assign(this.BaseCell(c,r));
                ck = ck || ((bc.Col === this.GetFocusedCell().Col) && (bc.Row === this.GetFocusedCell().Row));
              };
              if (this.FEditing && ck) dr = false;
              cell = this.FCellArray[Ci][Ri];
              if (cell != null) {
                rctl.$assign(pas["WEBLib.TMSFNCTypes"].RectF(cell.FLeft,cell.FTop,cell.FLeft + cell.FWidth,cell.FTop + cell.FHeight));
                if (((rctl.Bottom - rctl.Top) > 1) && ((rctl.Right - rctl.Left) > 1)) {
                  if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell.isPrototypeOf(cell)) rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell).SetControlBitmap(this.GetCheckBoxBitmap(rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCCheckGridCell).FChecked,false,true));
                  if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCRadioGridCell.isPrototypeOf(cell)) rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCRadioGridCell).SetControlBitmap(this.GetRadioButtonBitmap(rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCRadioGridCell).FChecked,false,true));
                  if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCNodeGridCell.isPrototypeOf(cell)) rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCNodeGridCell).SetControlBitmap(this.GetNodeBitmap(rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCNodeGridCell).FState));
                  if (pas["WEBLib.TMSFNCGridCell"].TTMSFNCButtonGridCell.isPrototypeOf(cell)) rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCButtonGridCell).SetControlBitmap(this.GetDummyButtonBitmap(rtl.as(cell,pas["WEBLib.TMSFNCGridCell"].TTMSFNCButtonGridCell)));
                  if (!dr) {
                    cell.FLayout.FFill.Assign(this.FAppearance.FNormalLayout.FFill);
                    cell.FLayout.FStroke.Assign(this.FAppearance.FNormalLayout.FStroke);
                  };
                  rt.$assign(cell.GetTextRect(false));
                  pas["WEBLib.TMSFNCTypes"].InflateRectEx(rt,-2,-2);
                  cell.Draw(AGraphics,dr,dr,true);
                  if ((this.GetFocusedCell().Col === c) && (this.GetFocusedCell().Row === r) && !this.FEditing && this.IsFocused() && dr && this.FAppearance.FShowFocus) AGraphics.DrawFocusRectangle$3(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(rctl.Left + 1,rctl.Top + 1,rctl.Right - 1,rctl.Bottom - 1)),0,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
                };
              };
            };
          };
          Ri += 1;
        };
        Ci += 1;
        Ri = ResetCi;
      };
    };
    this.DisplayCells = function (x, y, xOrig, yOrig, CStart, CStop, RStart, RStop, Ci, Ri, ResetCi, Fixed) {
      if ((this.FAdapter != null) && this.FAdapter.AlternateDisplayBuildUp()) {
        this.DisplayCellsAlternate(x,y,xOrig,yOrig,CStart,CStop,RStart,RStop,Ci,Ri,ResetCi,Fixed)}
       else this.DisplayCellsNormal(x,y,xOrig,yOrig,CStart,CStop,RStart,RStop,Ci,Ri,ResetCi,Fixed);
    };
    this.InitSample = function () {
      var I = 0;
      this.BeginUpdate();
      this.FUseColumns = false;
      this.ResetToDefaultStyle();
      this.SetDefaultRowHeight(this.ScalePaintValue(40));
      this.SetFixedColumns(0);
      this.FOptions.FBands.SetEnabled(true);
      for (var $l = 0, $end = this.FColumns.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.FColumns.GetItem$1(I).SetWidth(this.ScalePaintValue(90));
        this.FColumns.GetItem$1(I).FFixedFont.SetColor(0x454545);
        this.FColumns.GetItem$1(I).FFont.SetColor(0x7A7A7A);
      };
      this.FColumns.GetItem$1(0).SetWidth(this.ScalePaintValue(70));
      this.FColumns.GetItem$1(1).SetWidth(this.ScalePaintValue(250));
      this.FColumns.GetItem$1(2).SetWidth(this.ScalePaintValue(100));
      this.FColumns.GetItem$1(3).SetWidth(this.ScalePaintValue(100));
      this.LoadSampleData();
      this.SetColumnCount(4);
      this.SetWidth(this.ScalePaintValue(520));
      this.EndUpdate();
    };
    this.LoadSampleData = function () {
      var I = 0;
      var J = 0;
      var s = "";
      var p = "";
      var d = 0.0;
      this.BeginUpdate();
      for (var $l = 0, $end = this.FFixedRows - 1; $l <= $end; $l++) {
        I = $l;
        if (I > 0) {
          p = "Sub "}
         else p = "";
        for (var $l1 = this.FFixedColumns, $end1 = this.GetColumnCount() - 1; $l1 <= $end1; $l1++) {
          J = $l1;
          var $tmp = J;
          if ($tmp === 0) {
            s = p + "ID"}
           else if ($tmp === 1) {
            s = p + "Name"}
           else if ($tmp === 2) {
            s = p + "Joined"}
           else if ($tmp === 3) {
            s = p + "Status"}
           else {
            s = p + "Number";
          };
          this.SetCells(J,I,s);
        };
      };
      for (var $l2 = this.FFixedRows, $end2 = this.GetRowCount() - 1; $l2 <= $end2; $l2++) {
        I = $l2;
        for (var $l3 = this.FFixedColumns, $end3 = this.GetColumnCount() - 1; $l3 <= $end3; $l3++) {
          J = $l3;
          s = "";
          var $tmp1 = J;
          if ($tmp1 === 0) {
            s = "00" + pas.SysUtils.TIntegerHelper.ToString$1.call({get: function () {
                return I;
              }, set: function (v) {
                I = v;
              }})}
           else if ($tmp1 === 1) {
            var $tmp2 = pas.System.Random(120) % 5;
            if ($tmp2 === 0) {
              s = "David"}
             else if ($tmp2 === 1) {
              s = "Laura"}
             else if ($tmp2 === 2) {
              s = "Isaac"}
             else if ($tmp2 === 3) {
              s = "Marie"}
             else {
              s = "Leon";
            };
            var $tmp3 = pas.System.Random(120) % 5;
            if ($tmp3 === 0) {
              s = s + " Kleermakers"}
             else if ($tmp3 === 1) {
              s = s + " Tailor"}
             else if ($tmp3 === 2) {
              s = s + " Terzi"}
             else if ($tmp3 === 3) {
              s = s + " Sastre"}
             else {
              s = s + " Schneider";
            };
          } else if ($tmp1 === 2) {
            d = Math.round(pas.SysUtils.Now()) - pas.System.Random(5475);
            s = pas.SysUtils.DateToStr(d);
          } else if ($tmp1 === 3) {
            var $tmp4 = pas.System.Random(120) % 5;
            if ($tmp4 === 0) {
              s = "Flight"}
             else if ($tmp4 === 1) {
              s = "On Leave"}
             else if ($tmp4 === 2) {
              s = "Abroad"}
             else {
              s = "Office";
            };
          } else {
            s = pas.SysUtils.TIntegerHelper.ToString$1.call({a: pas.System.Random(100), get: function () {
                return this.a;
              }, set: function (v) {
                this.a = v;
              }});
          };
          this.SetCells(J,I,s);
        };
      };
      this.EndUpdate();
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderGrid);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphicsTypes"].ITMSFNCAppearanceGlobalFont);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.TMSFNCGRIDCELLNODEOPEN = "data:image/PNG;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlY" + "WR5ccllPAAAARJJREFUeNpi/P//P0NcX2oCAwNDJhCbMRAGp4B4+qKi2QsYY3tT6hTFVRrdTQIYZETkCep88u" + "Yhw84zGxjuv7xTzwSyMdo5mUFRQpGBlYWJIAapA6kH6WMBEhIifAIMpAB2VrB6CSYIhwkrLqzrxSkHAiCbGVi" + "ZmXDagk8OrJnhPx434pEDa/77DyGQUdmJoiC1HMGf0V6OqfnPH4TAlGaEgpzaThQ+sjq45p+//+F0Gj45sObv" + "P3/jVIBPDqz587cfWCXLczNwysE0P3329rk0Nwcf0Ynk649PIOops767Eefrjy+dBLllGP79YwT68Q9e/OHrR" + "4ZD1zYxfP7xvosRmqvqoLlKggiLX0BzVRNAgAEAJkJ1yu0zs+kAAAAASUVORK5CYII=";
  this.TMSFNCGRIDCELLNODECLOSED = "data:image/PNG;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJ" + "lYWR5ccllPAAAAOxJREFUeNpi/P//P0NcX2oCAwNDJhCbMRAGp4B4+qKi2QsYY3tT6hTFVRrdTQIYZETkCe" + "p88uYhw84zGxjuv7xTzwSyMdo5mUFRQpGBlYWJIAapA6kH6WMBEhIifAIMpAB2VrB6CRYIh4mBHADWzMpMg" + "WaG/wzka/77DyGQUdmJU/GM9nJMzX/+IASmNJfj1IysDq755+9/5Dv7+8/f5Gv+/O0H2ZqfPnv7XJqbg49o" + "TV9/fAJRT5n13Y04X3986STILcPw7x8j0P9/8OIPXz8yHLq2ieHzj/ddjNBcVQfNVRJEWPwCmquaAAIMAGY" + "uZD5GuUOeAAAAAElFTkSuQmCC";
  $mod.$resourcestrings = {sTMSFNCGridFilterAll: {org: "(All)"}};
  $mod.$implcode = function () {
    $impl.GetTickCountX = function () {
      var Result = 0;
      var h = 0;
      var m = 0;
      var s = 0;
      var ms = 0;
      pas.SysUtils.DecodeTime(pas.SysUtils.Now(),{get: function () {
          return h;
        }, set: function (v) {
          h = v;
        }},{get: function () {
          return m;
        }, set: function (v) {
          m = v;
        }},{get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},{get: function () {
          return ms;
        }, set: function (v) {
          ms = v;
        }});
      Result = ms + (s * 1000) + (m * 60 * 1000) + (h * 60 * 60 * 1000);
      return Result;
    };
    $impl.AnimateDouble = function (Start, Stop, Delta, Margin) {
      var Result = false;
      Result = true;
      if ((Start.get() > (Stop.get() - Margin)) && (Start.get() < (Stop.get() + Margin))) {
        Start.set(Stop.get());
        Result = false;
      } else {
        Delta = Math.max(Margin,Delta);
        if (Start.get() < Stop.get()) {
          Start.set(Start.get() + Delta)}
         else Start.set(Start.get() - Delta);
      };
      return Result;
    };
    $impl.PtInR = function (Rect, P) {
      var Result = false;
      Result = (P.X >= Rect.Left) && (P.X < Rect.Right) && (P.Y >= Rect.Top) && (P.Y < Rect.Bottom);
      return Result;
    };
  };
  $mod.$init = function () {
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCGRIDCELLNODEOPEN);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TMSFNCGRIDCELLNODECLOSED);
  };
},["WEBLib.TMSFNCCustomScrollControl","WEBLib.TMSFNCUtils","SysUtils","WEBLib.TMSFNCColorSelector","Math","WEBLib.Graphics","WEBLib.Forms","WEBLib.TMSFNCStyles","WEBLib.Dialogs"]);
rtl.module("WEBLib.TMSFNCGrid",["System","Classes","WEBLib.TMSFNCCustomGrid","WEBLib.TMSFNCGridData"],function () {
  "use strict";
  var $mod = this;
  rtl.createClass(this,"TTMSFNCGrid",pas["WEBLib.TMSFNCCustomGrid"].TTMSFNCCustomGrid,function () {
    this.RegisterRuntimeClasses = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClasses([$mod.TTMSFNCGrid,pas["WEBLib.TMSFNCGridData"].TTMSFNCGridColumn]);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderGrid);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphicsTypes"].ITMSFNCAppearanceGlobalFont);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Adapter",2,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridAdapter"],"FAdapter","SetAdapter");
    $r.addProperty("HorizontalScrollBarVisible",2,rtl.boolean,"FHorizontalScrollBarVisible","SetHorizontalScrollBarVisible",4,{Default: true});
    $r.addProperty("VerticalScrollBarVisible",2,rtl.boolean,"FVerticalScrollBarVisible","SetVerticalScrollBarVisible",4,{Default: true});
    $r.addProperty("Columns",2,pas["WEBLib.TMSFNCGridData"].$rtti["TTMSFNCGridColumns"],"FColumns","SetColumns");
    $r.addProperty("ToolBarPopup",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridCustomToolBarPopup"],"FToolBarPopup","FToolBarPopup");
    $r.addProperty("ToolBarPopupMode",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridCustomToolBarPopupMode"],"FToolBarPopupMode","FToolBarPopupMode",4,{Default: pas["WEBLib.TMSFNCCustomGrid"].TTMSFNCGridCustomToolBarPopupMode.tpmActiveCell});
    $r.addProperty("Version",1,rtl.string,"GetVersion","");
    $r.addProperty("Fill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFill","SetFill");
    $r.addProperty("DefaultFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FDefaultFont","SetDefaultFont");
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
    $r.addProperty("TopRow",3,rtl.longint,"GetTopRow","SetTopRow");
    $r.addProperty("Appearance",2,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridAppearance"],"FAppearance","SetAppearance");
    $r.addProperty("LeftCol",3,rtl.longint,"GetLeftCol","SetLeftCol");
    $r.addProperty("ScrollMode",2,pas["WEBLib.TMSFNCCustomScrollControl"].$rtti["TTMSFNCCustomScrollControlMode"],"FScrollMode","SetScrollMode",4,{Default: pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControlMode.scmPixelScrolling});
    $r.addProperty("ScrollUpdate",2,pas["WEBLib.TMSFNCCustomScrollControl"].$rtti["TTMSFNCCustomScrollControlUpdate"],"FScrollUpdate","SetScrollUpdate",4,{Default: pas["WEBLib.TMSFNCCustomScrollControl"].TTMSFNCCustomScrollControlUpdate.scuContinuous});
    $r.addProperty("CustomScrollBars",2,rtl.boolean,"FCustomScrollBars","SetCustomScrollBars",4,{Default: false});
    $r.addProperty("FreezeColumns",2,rtl.longint,"FFreezeColumns","SetFreezeColumns",4,{Default: 0});
    $r.addProperty("FreezeRows",2,rtl.longint,"FFreezeRows","SetFreezeRows",4,{Default: 0});
    $r.addProperty("GlobalFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCAppearanceGlobalFont"],"FGlobalFont","SetGlobalFont");
    $r.addProperty("DesignTimeSampleData",2,rtl.boolean,"FDesignTimeSampleData","SetDesignTimeSampleData");
    $r.addProperty("OnTopLeftChanged",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridTopLeftChanged"],"FOnTopLeftChanged","FOnTopLeftChanged");
    $r.addProperty("OnGetCellClass",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnGetCellClass"],"FOnGetCellClass","FOnGetCellClass");
    $r.addProperty("OnGetCellData",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnGetCellData"],"FOnGetCellData","FOnGetCellData");
    $r.addProperty("OnGetCellRotation",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnGetCellRotation"],"FOnGetCellRotation","FOnGetCellRotation");
    $r.addProperty("OnGetCellProperties",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnGetCellProperties"],"FOnGetCellProperties","FOnGetCellProperties");
    $r.addProperty("OnGetCellLayout",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnGetCellLayout"],"FOnGetCellLayout","FOnGetCellLayout");
    $r.addProperty("OnGetCellMergeInfo",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnGetCellMergeInfo"],"FOnGetCellMergeInfo","FOnGetCellMergeInfo");
    $r.addProperty("OnGetCellReadOnly",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnGetCellReadOnly"],"FOnGetCellReadOnly","FOnGetCellReadOnly");
    $r.addProperty("OnGetRowIsBand",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnGetRowIsBand"],"FOnGetRowIsBand","FOnGetRowIsBand");
    $r.addProperty("OnCanInsertRow",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnCanInsertRow"],"FOnCanInsertRow","FOnCanInsertRow");
    $r.addProperty("OnCanAppendRow",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnCanAppendRow"],"FOnCanAppendRow","FOnCanAppendRow");
    $r.addProperty("OnCanAppendColumn",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnCanAppendColumn"],"FOnCanAppendColumn","FOnCanAppendColumn");
    $r.addProperty("OnCanDeleteRow",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnCanDeleteRow"],"FOnCanDeleteRow","FOnCanDeleteRow");
    $r.addProperty("OnInsertRow",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnInsertRow"],"FOnInsertRow","FOnInsertRow");
    $r.addProperty("OnAppendRow",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnAppendRow"],"FOnAppendRow","FOnAppendRow");
    $r.addProperty("OnAppendColumn",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnAppendColumn"],"FOnAppendColumn","FOnAppendColumn");
    $r.addProperty("OnDeleteRow",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnDeleteRow"],"FOnDeleteRow","FOnDeleteRow");
    $r.addProperty("OnCellAnchorClick",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnCellAnchorClick"],"FOnCellAnchorClick","FOnCellAnchorClick");
    $r.addProperty("OnGetCellEditorCustomClassType",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnGetCellEditorCustomClassType"],"FOnGetCellEditorCustomClassType","FOnGetCellEditorCustomClassType");
    $r.addProperty("OnGetCellEditorType",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnGetCellEditorType"],"FOnGetCellEditorType","FOnGetCellEditorType");
    $r.addProperty("OnCellEditGetData",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnCellEditGetData"],"FOnCellEditGetData","FOnCellEditGetData");
    $r.addProperty("OnCellEditValidateData",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnCellEditValidateData"],"FOnCellEditValidateData","FOnCellEditValidateData");
    $r.addProperty("OnCellEditSetData",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnCellEditSetData"],"FOnCellEditSetData","FOnCellEditSetData");
    $r.addProperty("OnCellEditGetColor",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnCellEditGetColor"],"FOnCellEditGetColor","FOnCellEditGetColor");
    $r.addProperty("OnCellEditValidateColor",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnCellEditValidateColor"],"FOnCellEditValidateColor","FOnCellEditValidateColor");
    $r.addProperty("OnCellEditSetColor",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnCellEditSetColor"],"FOnCellEditSetColor","FOnCellEditSetColor");
    $r.addProperty("OnCellEditDone",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnCellEditDone"],"FOnCellEditDone","FOnCellEditDone");
    $r.addProperty("OnCellEditCancel",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnCellEditCancel"],"FOnCellEditCancel","FOnCellEditCancel");
    $r.addProperty("OnGetCellEditorProperties",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnGetCellEditorProperties"],"FOnGetCellEditorProperties","FOnGetCellEditorProperties");
    $r.addProperty("OnGetCellIsFixed",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnGetCellIsFixed"],"FOnGetCellIsFixed","FOnGetCellIsFixed");
    $r.addProperty("OnFixedCellDropDownButtonClick",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridCellControlEvent"],"FOnFixedCellDropDownButtonClick","FOnFixedCellDropDownButtonClick");
    $r.addProperty("OnCellComboCloseUp",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnCellComboCloseUp"],"FOnCellComboCloseUp","FOnCellComboCloseUp");
    $r.addProperty("OnCellBeforeDraw",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridCellBeforeDraw"],"FOnCellBeforeDraw","FOnCellBeforeDraw");
    $r.addProperty("OnCellAfterDraw",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridCellAfterDraw"],"FOnCellAfterDraw","FOnCellAfterDraw");
    $r.addProperty("OnCellBitmapClick",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridCellControlEvent"],"FOnCellBitmapClick","FOnCellBitmapClick");
    $r.addProperty("OnCellRadioButtonClick",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridCellControlEvent"],"FOnCellRadioButtonClick","FOnCellRadioButtonClick");
    $r.addProperty("OnCellCheckBoxClick",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridCellControlEvent"],"FOnCellCheckBoxClick","FOnCellCheckBoxClick");
    $r.addProperty("OnCellButtonClick",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridCellControlEvent"],"FOnCellButtonClick","FOnCellButtonClick");
    $r.addProperty("OnCellCommentClick",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridCellControlEvent"],"FOnCellCommentClick","FOnCellCommentClick");
    $r.addProperty("OnCellSortClick",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridCellControlEvent"],"FOnCellSortClick","FOnCellSortClick");
    $r.addProperty("OnCellNodeClick",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridCellControlEvent"],"FOnCellNodeClick","FOnCellNodeClick");
    $r.addProperty("OnCanSizeColumn",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnCanSizeColumn"],"FOnCanSizeColumn","FOnCanSizeColumn");
    $r.addProperty("OnCanSizeRow",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnCanSizeRow"],"FOnCanSizeRow","FOnCanSizeRow");
    $r.addProperty("OnColumnSize",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnColumnSize"],"FOnColumnSize","FOnColumnSize");
    $r.addProperty("OnRowSize",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnRowSize"],"FOnRowSize","FOnRowSize");
    $r.addProperty("OnColumnSized",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnColumnSized"],"FOnColumnSized","FOnColumnSized");
    $r.addProperty("OnRowSized",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnRowSized"],"FOnRowSized","FOnRowSized");
    $r.addProperty("OnCanDragColumn",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnCanSizeColumn"],"FOnCanDragColumn","FOnCanDragColumn");
    $r.addProperty("OnCanDragRow",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnCanSizeRow"],"FOnCanDragRow","FOnCanDragRow");
    $r.addProperty("OnColumnDragged",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnColumnDragged"],"FOnColumnDragged","FOnColumnDragged");
    $r.addProperty("OnRowDragged",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnRowDragged"],"FOnRowDragged","FOnRowDragged");
    $r.addProperty("OnBeforeColumnDrop",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnBeforeColumnDrop"],"FOnBeforeColumnDrop","FOnBeforeColumnDrop");
    $r.addProperty("OnBeforeCellEditExit",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridCellEditBeforeExit"],"FOnBeforeCellEditExit","FOnBeforeCellEditExit");
    $r.addProperty("OnBeforeRowDrop",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnBeforeRowDrop"],"FOnBeforeRowDrop","FOnBeforeRowDrop");
    $r.addProperty("OnColumnSorted",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnColumnSorted"],"FOnColumnSorted","FOnColumnSorted");
    $r.addProperty("OnCanSortColumn",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnCanSortColumn"],"FOnCanSortColumn","FOnCanSortColumn");
    $r.addProperty("OnCellRightClick",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnCellClick"],"FOnCellRightClick","FOnCellRightClick");
    $r.addProperty("OnFixedCellRightClick",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnCellClick"],"FOnFixedCellRightClick","FOnFixedCellRightClick");
    $r.addProperty("OnCellClick",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnCellClick"],"FOnCellClick","FOnCellClick");
    $r.addProperty("OnFixedCellClick",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnCellClick"],"FOnFixedCellClick","FOnFixedCellClick");
    $r.addProperty("OnCellDblClick",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnCellClick"],"FOnCellDblClick","FOnCellDblClick");
    $r.addProperty("OnFixedCellDblClick",0,pas["WEBLib.TMSFNCCustomGrid"].$rtti["TTMSFNCGridOnCellClick"],"FOnFixedCellDblClick","FOnFixedCellDblClick");
    $r.addProperty("OnSelectCell",0,pas["WEBLib.TMSFNCGridData"].$rtti["TTMSFNCGridOnSelectCell"],"FOnSelectCell","FOnSelectCell");
    $r.addProperty("OnSelectedCell",0,pas["WEBLib.TMSFNCGridData"].$rtti["TTMSFNCGridOnSelectedCell"],"FOnSelectedCell","FOnSelectedCell");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[1]];
  });
});
rtl.module("WEBLib.TMSFNCEditorsToolsUI",["System","Classes","Types","WEBLib.TMSFNCTypes","WEBLib.TMSFNCGraphicsTypes","WEBLib.Graphics","WEBLib.TMSFNCEditorsTools","WEBLib.TMSFNCToolBar","WEBLib.TMSFNCHTMLText","WEBLib.TMSFNCSplitter","WEBLib.TMSFNCPageControl","WEBLib.TMSFNCTabSet","WEBLib.TMSFNCCheckBox","WEBLib.TMSFNCGrid","JS","Web"],function () {
  "use strict";
  var $mod = this;
  this.MAJ_VER = 1;
  this.MIN_VER = 0;
  this.REL_VER = 0;
  this.BLD_VER = 0;
  this.SetEditorHTMLTextAppearance = function (AHTMLText, AFontColor, ABackGroundColor) {
    if (AHTMLText != null) {
      if (AFontColor === -1) {
        if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
          AHTMLText.FFont$1.SetColor(5592405)}
         else AHTMLText.FFont$1.SetColor(11184810);
      } else AHTMLText.FFont$1.SetColor(AFontColor);
      AHTMLText.SetColor(ABackGroundColor);
    };
  };
  this.SetEditorToolBarAppearance = function (AToolBar, APrimaryColor, ARounding, AFontColor, ABackGroundColor) {
    var I = 0;
    var tb = null;
    var ddb = null;
    var fc = 0;
    var lt = false;
    if (AFontColor === -1) {
      if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
        fc = 5592405}
       else fc = 11184810;
    } else fc = AFontColor;
    lt = pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme();
    for (var $l = 0, $end = AToolBar.GetControlsCount() - 1; $l <= $end; $l++) {
      I = $l;
      if (pas["WEBLib.TMSFNCToolBar"].TTMSFNCToolBarButton.isPrototypeOf(AToolBar.GetControls(I))) {
        tb = rtl.as(AToolBar.GetControls(I),pas["WEBLib.TMSFNCToolBar"].TTMSFNCToolBarButton);
        tb.FAppearance.SetFlatStyle(false);
        tb.FAppearance.SetRounding(0);
        tb.FAppearance.SetShowInnerStroke(false);
        tb.FAppearance.FDisabledStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
        tb.FAppearance.FDisabledFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
        tb.FAppearance.FNormalFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
        tb.FAppearance.FHoverFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        tb.FAppearance.FHoverStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
        tb.FAppearance.FHoverStroke.SetColor(APrimaryColor);
        tb.FAppearance.FHoverFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
        tb.FAppearance.FDownStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
        tb.FAppearance.FDownFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        tb.FAppearance.FDownStroke.SetColor(APrimaryColor);
        tb.FAppearance.FDownFill.SetColor(pas["WEBLib.TMSFNCEditorsTools"].EditorDarkerShadeColor(APrimaryColor,10,1));
        if ((tb.GetDropDownButtonControl() !== null) && tb.GetDropDownButtonControl().FVisible) {
          tb.FAppearance.FNormalFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
          tb.FAppearance.FNormalStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
          tb.FAppearance.FNormalStroke.SetColor(fc);
          ddb = tb.GetDropDownButtonControl();
          ddb.FAppearance.SetShowInnerStroke(false);
          ddb.FAppearance.FNormalStroke.SetColor(fc);
          ddb.FAppearance.FDisabledStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
          ddb.FAppearance.FDisabledFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
          ddb.FAppearance.FHoverStroke.SetColor(APrimaryColor);
          ddb.FAppearance.FDownStroke.SetColor(APrimaryColor);
          ddb.FAppearance.FHoverFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
          ddb.FAppearance.FDownFill.SetColor(pas["WEBLib.TMSFNCEditorsTools"].EditorDarkerShadeColor(APrimaryColor,10,1));
          ddb.FAppearance.FNormalFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
          ddb.FAppearance.FHoverFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
          ddb.FAppearance.FDownFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
          if (ABackGroundColor === -1) {
            if (lt) {
              tb.FAppearance.FNormalFill.SetColor(16119285);
              ddb.FAppearance.FNormalFill.SetColor(16119285);
              ddb.FAppearance.FHoverFill.SetColor(16777215);
            } else {
              tb.FAppearance.FNormalFill.SetColor(4406846);
              ddb.FAppearance.FNormalFill.SetColor(4406846);
              ddb.FAppearance.FHoverFill.SetColor(2894378);
            };
          } else {
            tb.FAppearance.FNormalFill.SetColor(ABackGroundColor);
            ddb.FAppearance.FNormalFill.SetColor(ABackGroundColor);
            ddb.FAppearance.FHoverFill.SetColor(ABackGroundColor);
          };
        } else {
          tb.FAppearance.FNormalFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
          tb.FAppearance.FNormalStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
        };
        tb.FFont$1.SetColor(fc);
      } else if (pas["WEBLib.TMSFNCToolBar"].TTMSFNCToolBarSeparator.isPrototypeOf(AToolBar.GetControls(I))) {
        rtl.as(AToolBar.GetControls(I),pas["WEBLib.TMSFNCToolBar"].TTMSFNCToolBarSeparator).FAppearance.FStroke.SetColor(ABackGroundColor);
        rtl.as(AToolBar.GetControls(I),pas["WEBLib.TMSFNCToolBar"].TTMSFNCToolBarSeparator).FAppearance.FInnerStroke.SetColor(fc);
      };
    };
  };
  this.SetEditorToolBarButtonAppearance = function (AButton, APrimaryColor, ARounding, AFontColor, ABackGroundColor) {
    var fc = 0;
    var ddb = null;
    if (AButton != null) {
      if (AFontColor === -1) {
        if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
          fc = 5592405}
         else fc = 11184810;
      } else fc = AFontColor;
      AButton.FAppearance.SetFlatStyle(false);
      AButton.FAppearance.SetRounding(ARounding);
      AButton.FAppearance.SetShowInnerStroke(false);
      AButton.FAppearance.FDisabledStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
      AButton.FAppearance.FDisabledFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
      AButton.FAppearance.FNormalFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
      AButton.FAppearance.FHoverStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      AButton.FAppearance.FHoverStroke.SetColor(APrimaryColor);
      AButton.FAppearance.FHoverFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
      AButton.FAppearance.FDownStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      AButton.FAppearance.FDownFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      AButton.FAppearance.FDownStroke.SetColor(APrimaryColor);
      AButton.FAppearance.FDownFill.SetColor(pas["WEBLib.TMSFNCEditorsTools"].EditorDarkerShadeColor(APrimaryColor,10,1));
      if ((AButton.GetDropDownButtonControl() !== null) && AButton.GetDropDownButtonControl().FVisible) {
        AButton.FAppearance.FNormalFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        AButton.FAppearance.FNormalStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
        AButton.FAppearance.FNormalStroke.SetColor(fc);
        ddb = AButton.GetDropDownButtonControl();
        ddb.FAppearance.SetShowInnerStroke(false);
        ddb.FAppearance.FNormalStroke.SetColor(fc);
        ddb.FAppearance.FDisabledStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
        ddb.FAppearance.FDisabledFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
        ddb.FAppearance.FHoverStroke.SetColor(APrimaryColor);
        ddb.FAppearance.FDownStroke.SetColor(APrimaryColor);
        ddb.FAppearance.FHoverFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        ddb.FAppearance.FDownFill.SetColor(pas["WEBLib.TMSFNCEditorsTools"].EditorDarkerShadeColor(APrimaryColor,10,1));
        ddb.FAppearance.FNormalFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        ddb.FAppearance.FHoverFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        ddb.FAppearance.FDownFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        if (ABackGroundColor === -1) {
          if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
            AButton.FAppearance.FNormalFill.SetColor(16119285);
            ddb.FAppearance.FNormalFill.SetColor(16119285);
            ddb.FAppearance.FHoverFill.SetColor(16777215);
          } else {
            AButton.FAppearance.FNormalFill.SetColor(4406846);
            ddb.FAppearance.FNormalFill.SetColor(4406846);
            ddb.FAppearance.FHoverFill.SetColor(2894378);
          };
        } else {
          AButton.FAppearance.FNormalFill.SetColor(ABackGroundColor);
          ddb.FAppearance.FNormalFill.SetColor(ABackGroundColor);
          ddb.FAppearance.FHoverFill.SetColor(ABackGroundColor);
        };
      } else {
        AButton.FAppearance.FNormalFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
        AButton.FAppearance.FNormalStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
      };
      AButton.FFont$1.SetColor(fc);
    };
  };
  this.SetEditorFNCSplitterAppearance = function (ASplitter, APrimaryColor, ABackGroundColor) {
    if (ASplitter != null) {
      if (ABackGroundColor === -1) {
        if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
          ASplitter.FAppearance.FSplitterFill.SetColor(16777215);
        } else {
          ASplitter.FAppearance.FSplitterFill.SetColor(2894378);
        };
      } else ASplitter.FAppearance.FSplitterFill.SetColor(ABackGroundColor);
      if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
        ASplitter.FAppearance.FSplitterHoverFill.SetColor(16119285);
        ASplitter.FAppearance.FSplitterDownFill.SetColor(16119285);
      } else {
        ASplitter.FAppearance.FSplitterHoverFill.SetColor(4406846);
        ASplitter.FAppearance.FSplitterDownFill.SetColor(4406846);
      };
      ASplitter.FAppearance.FSplitterHoverFill.SetColor(12482304);
      ASplitter.FAppearance.FSplitterDownFill.SetColor(12482304);
    };
  };
  this.SetEditorFNCPageControlAppearance = function (APageControl, APrimaryColor, ARounding, AFontColor, ABackGroundColor) {
    var dc = 0;
    var fc = 0;
    if (APageControl != null) {
      if (AFontColor === -1) {
        if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
          fc = 5592405}
         else fc = 11184810;
      } else fc = AFontColor;
      APageControl.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
      APageControl.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
      APageControl.FTabAppearance.FFill.SetColor(ABackGroundColor);
      APageControl.FTabAppearance.SetTextColor(fc);
      APageControl.FTabAppearance.FStroke.SetColor(ABackGroundColor);
      APageControl.FTabAppearance.FHoverFill.SetColor(ABackGroundColor);
      APageControl.FTabAppearance.FHoverStroke.SetColor(APrimaryColor);
      APageControl.FTabAppearance.SetHoverTextColor(APrimaryColor);
      APageControl.FTabAppearance.SetDownTextColor(16777215);
      APageControl.FTabAppearance.FDownStroke.SetColor(APrimaryColor);
      dc = pas["WEBLib.TMSFNCEditorsTools"].EditorLighterShadeColor(APrimaryColor,10,1);
      APageControl.FTabAppearance.FDownFill.SetColor(dc);
      APageControl.FTabAppearance.SetActiveTextColor(16777215);
      APageControl.FTabAppearance.FActiveFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient);
      APageControl.FTabAppearance.FActiveFill.SetColor(APrimaryColor);
      APageControl.FTabAppearance.FActiveFill.SetColorTo(pas["WEBLib.TMSFNCEditorsTools"].EditorDarkerShadeColor(APrimaryColor,10,1));
      APageControl.FTabAppearance.FActiveStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
      APageControl.FTabAppearance.SetShape(pas["WEBLib.TMSFNCTabSet"].TTMSFNCTabSetTabShape.tsRound);
      APageControl.FTabAppearance.SetShapeOverlap(0);
    };
  };
  this.SetEditorFNCPageAppearance = function (APage, APrimaryColor, ARounding, AFontColor, ABackGroundColor) {
    APage.SetUseDefaultAppearance(true);
    APage.FContainer.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
    APage.FContainer.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
    if (ABackGroundColor === -1) {
      if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
        APage.FContainer.FFill.SetColor(16119285);
        APage.FContainer.FStroke.SetColor(16119285);
      } else {
        APage.FContainer.FFill.SetColor(4406846);
        APage.FContainer.FStroke.SetColor(4406846);
      };
    } else {
      APage.FContainer.FFill.SetColor(ABackGroundColor);
      APage.FContainer.FStroke.SetColor(ABackGroundColor);
    };
  };
  this.SetEditorFNCCheckBoxAppearance = function (ACheckBox, AFontColor, ABackgroundColor) {
    if (ACheckBox != null) {
      if (AFontColor === -1) {
        if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
          ACheckBox.FFont$1.SetColor(5592405)}
         else ACheckBox.FFont$1.SetColor(11184810);
      } else ACheckBox.FFont$1.SetColor(AFontColor);
      if (ABackgroundColor === -1) {
        if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
          ACheckBox.SetColor(16119285)}
         else ACheckBox.SetColor(4406846);
      } else ACheckBox.SetColor(ABackgroundColor);
    };
  };
  this.SetEditorFNCGridAppearance = function (AGrid, APrimaryColor, AFontColor, ABackGroundColor) {
    var ffc = 0;
    var bc = 0;
    var fc = 0;
    if (AGrid != null) {
      if (AFontColor === -1) {
        if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
          fc = 5592405}
         else fc = 11184810;
      } else fc = AFontColor;
      if (ABackGroundColor === -1) {
        if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
          bc = 16777215}
         else bc = 2894378;
      } else bc = ABackGroundColor;
      if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
        ffc = 16119285;
      } else {
        ffc = 4406846;
      };
      AGrid.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      AGrid.FFill.SetColor(bc);
      AGrid.FGlobalFont.SetColor(fc);
      AGrid.FAppearance.FFixedLayout.FFill.SetColor(ffc);
      AGrid.FAppearance.FFixedLayout.FFont.SetColor(fc);
      AGrid.FStroke.SetColor(ffc);
      AGrid.FAppearance.FSelectedLayout.FFill.SetColor(APrimaryColor);
      AGrid.FAppearance.FSelectedLayout.FFont.SetColor(16777215);
      AGrid.FAppearance.FFocusedLayout.FFill.SetColor(APrimaryColor);
      AGrid.FAppearance.FFocusedLayout.FFont.SetColor(16777215);
    };
  };
},["WEBLib.TMSFNCGraphics","WEBLib.TMSFNCUtils","Math","SysUtils"]);
rtl.module("WEBLib.TMSFNCHTMLEditor",["System","Classes","WEBLib.TMSFNCCustomComponent","WEBLib.TMSFNCCustomControl","WEBLib.Controls","WEBLib.TMSFNCEditorToolBar","WEBLib.TMSFNCTypes","WEBLib.StdCtrls","WEBLib.ExtCtrls","WEBLib.TMSFNCHTMLText","WEBLib.TMSFNCBitmapContainer","WEBLib.Forms","WEBLib.TMSFNCGraphics","WEBLib.TMSFNCGraphicsTypes","WEBLib.TMSFNCEditorButton","WEBLib.TMSFNCEditorPanel","UITypes","Types"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.MAJ_VER = 1;
  this.MIN_VER = 1;
  this.REL_VER = 0;
  this.BLD_VER = 0;
  this.$rtti.$Class("TTMSFNCHTMLEditor");
  this.$rtti.$MethodVar("TTMSFNCBrowserCallBackEvent",{procsig: rtl.newTIProcSig([["ACallbackURLResult",rtl.string,2]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCHTMLEditorComboBox",pas["WEBLib.StdCtrls"].TComboBox,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCHTMLEditor",pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.$init.call(this);
      this.FFormatToolBar = null;
      this.FEditToolBar = null;
      this.FPanel = null;
      this.FContentPanel = null;
      this.FTopPanel = null;
      this.FButtonOk = null;
      this.FButtonCancel = null;
      this.FMemo = null;
      this.FHTMLText = null;
      this.FText = "";
      this.FOriginalText = "";
      this.FBitmapContainer = null;
      this.frm = null;
    };
    this.$final = function () {
      this.FFormatToolBar = undefined;
      this.FEditToolBar = undefined;
      this.FPanel = undefined;
      this.FContentPanel = undefined;
      this.FTopPanel = undefined;
      this.FButtonOk = undefined;
      this.FButtonCancel = undefined;
      this.FMemo = undefined;
      this.FHTMLText = undefined;
      this.FBitmapContainer = undefined;
      this.frm = undefined;
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.$final.call(this);
    };
    this.SetText = function (Value) {
      this.FText = Value;
      this.FOriginalText = this.FText;
      if (this.FMemo != null) this.FMemo.SetText(this.FText);
      if (this.FHTMLText != null) this.FHTMLText.SetText(this.FText);
    };
    this.SetBitmapContainer = function (Value) {
      this.FBitmapContainer = Value;
      if (this.FHTMLText != null) this.FHTMLText.SetBitmapContainer(this.FBitmapContainer);
    };
    this.GetInstance = function () {
      var Result = 0;
      Result = pas["WEBLib.TMSFNCTypes"].HInstance();
      return Result;
    };
    this.RegisterRuntimeClasses = function () {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClass($mod.TTMSFNCHTMLEditor);
    };
    this.Notification = function (AComponent, AOperation) {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.Notification.apply(this,arguments);
      if ((AOperation === pas.Classes.TOperation.opRemove) && (AComponent === this.FBitmapContainer)) this.FBitmapContainer = null;
    };
    this.DoOpenFile = async function (Sender) {
      var od = null;
      var res = false;
      var str = "";
      if (!(this.FMemo != null)) return;
      od = pas["WEBLib.Dialogs"].TWebOpenDialog.$create("Create$1",[this]);
      try {
        res = await od.Perform();
        if (res) {
          if (od.FFiles.GetCount() > 0) {
            str = await od.FFiles.GetItem$1(0).FileAsText();
            this.FMemo.SetText(str);
            this.UpdateHTMLText();
          };
        };
      } finally {
        od = rtl.freeLoc(od);
      };
    };
    this.DoCut = function (Sender) {
      var s = "";
      var ss = 0;
      if (!(this.FMemo != null)) return;
      pas["WEBLib.TMSFNCUtils"].TTMSFNCClipBoard.SetText(pas.System.Copy(this.FMemo.GetText(),this.FMemo.GetSelStart(),this.FMemo.GetSelLength()));
      s = this.FMemo.GetText();
      ss = this.FMemo.GetSelStart();
      pas.System.Delete({get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},this.FMemo.GetSelStart() + 1,this.FMemo.GetSelLength());
      this.FMemo.SetText(s);
      this.FMemo.SetSelStart(ss);
    };
    this.DoPaste = function (Sender) {
      var s = "";
      var cs = "";
      var ss = 0;
      var sl = 0;
      if (!(this.FMemo != null)) return;
      cs = pas["WEBLib.TMSFNCUtils"].TTMSFNCClipBoard.GetText();
      if (cs !== "") {
        ss = this.FMemo.GetSelStart() + 1;
        sl = this.FMemo.GetSelLength();
        s = this.FMemo.FLines.GetTextStr();
        $impl.InsertString(cs,{get: function () {
            return s;
          }, set: function (v) {
            s = v;
          }},ss);
        this.FMemo.FLines.SetTextStr(s);
        this.FMemo.SetSelStart((ss - 1) + cs.length);
        this.FMemo.SetSelLength(sl);
      };
    };
    this.DoCopy = function (Sender) {
      if (!(this.FMemo != null)) return;
      pas["WEBLib.TMSFNCUtils"].TTMSFNCClipBoard.SetText(pas.System.Copy(this.FMemo.GetText(),this.FMemo.GetSelStart(),this.FMemo.GetSelLength()));
    };
    this.DoApplyFontName = function (Sender, AFontName) {
      if (!(this.FMemo != null)) return;
      if (this.HasTags("<FONT ","</FONT>")) {
        this.ChangeTagProp("<FONT ","</FONT>","face",AFontName)}
       else this.InsertTags('<FONT face="' + AFontName + '">',"</FONT>");
      this.FMemo.SetFocus();
    };
    this.DoApplyFontSize = function (Sender, AFontSize) {
      if (!(this.FMemo != null)) return;
      if (this.HasTags("<FONT ","</FONT>")) {
        this.ChangeTagProp("<FONT ","</FONT>"," size",pas.SysUtils.IntToStr(AFontSize))}
       else this.InsertTags('<FONT size="' + pas.SysUtils.IntToStr(AFontSize) + '">',"</FONT>");
      this.FMemo.SetFocus();
    };
    this.DoApplyTextColor = function (Sender, AColor) {
      var l = 0;
      if (!(this.FMemo != null)) return;
      l = pas["WEBLib.Graphics"].ColorToRGB(AColor);
      l = ((l & 0xFF0000) >>> 16) | ((l & 0xFF) << 16) | (l & 0xFF00);
      if (this.HasTags("<FONT ","</FONT>")) {
        this.ChangeTagProp("<FONT ","</FONT>","color","#" + pas.SysUtils.IntToHex(l,6))}
       else this.InsertTags('<FONT color="#' + pas.SysUtils.IntToHex(l,6) + '">',"</FONT>");
    };
    this.DoApplyBold = function (Sender) {
      if (!(this.FMemo != null)) return;
      if (!this.HasTags("<B>","</B>")) {
        this.InsertTags("<B>","</B>")}
       else this.RemoveTags("<B>","</B>");
    };
    this.DoApplyItalic = function (Sender) {
      if (!(this.FMemo != null)) return;
      if (!this.HasTags("<I>","</I>")) {
        this.InsertTags("<I>","</I>")}
       else this.RemoveTags("<I>","</I>");
    };
    this.DoInsertHyperlink = function (Sender) {
      var url = "";
      var cb = null;
      if (!(this.FMemo != null)) return;
      if (this.HasTags("<A ","</A>")) this.RemoveTags("<A ","</A>");
      url = "";
      if (pas["WEBLib.Forms"].VSIDE != null) {
        cb = rtl.createCallback(this,"HyperlinkCallBack");
        if (pas["WEBLib.Forms"].VSIDE)
        {
          pas["WEBLib.Forms"].VSIDE.Prompt("Hyperlink","URL", cb);
        };
      } else if (pas["WEBLib.Dialogs"].InputQuery("Hyperlink","URL",{get: function () {
          return url;
        }, set: function (v) {
          url = v;
        }})) this.InsertTags('<A href="' + url + '">',"</A>");
      this.FMemo.SetFocus();
    };
    this.DoInsertBitmap = function (Sender) {
      var t = "";
      var sl = null;
      var i = 0;
      var cb = null;
      if (!(this.FMemo != null)) return;
      if (pas["WEBLib.Forms"].VSIDE != null) {
        cb = rtl.createCallback(this,"ImageCallBack");
        if (pas["WEBLib.Forms"].VSIDE)
        {
          pas["WEBLib.Forms"].VSIDE.Prompt("Image","Image bitmap name", cb);
        };
      } else {
        t = "";
        sl = pas.Classes.TStringList.$create("Create$1");
        if (this.FBitmapContainer != null) {
          for (var $l = 0, $end = this.FBitmapContainer.GetItems().GetCount() - 1; $l <= $end; $l++) {
            i = $l;
            sl.Add(this.FBitmapContainer.GetItems().GetItemEx(i).FName);
          };
        };
        try {
          if ($impl.InputListQuery("Image","Image reference",sl,{get: function () {
              return t;
            }, set: function (v) {
              t = v;
            }})) this.InsertTags('<IMG src="' + t + '"/>',"");
        } finally {
          sl = rtl.freeLoc(sl);
        };
      };
    };
    this.DoApplyNumbering = function (Sender) {
      var i = 0;
      var sl = null;
      if (!(this.FMemo != null)) return;
      if (this.FMemo.GetSelLength() === 0) {
        this.InsertTags("<LI>","")}
       else {
        if (!this.HasTags("<UL>","</UL>")) {
          this.InsertTags("<UL>","</UL>");
          if (!this.HasTags("<LI>","</LI>")) {
            sl = pas.Classes.TStringList.$create("Create$1");
            sl.SetTextStr(pas.System.Copy(this.FMemo.GetText(),this.FMemo.GetSelStart(),this.FMemo.GetSelLength()));
            if (sl.GetCount() > 1) {
              for (var $l = 0, $end = sl.GetCount() - 1; $l <= $end; $l++) {
                i = $l;
                sl.Put(i,"<LI>" + sl.Get(i));
              };
              this.FMemo.SetSelStart(pas.System.Pos(this.FMemo.FLines.GetTextStr(),sl.GetTextStr()));
              this.FMemo.SetSelLength(sl.GetTextStr().length);
            };
            sl = rtl.freeLoc(sl);
          };
        } else this.RemoveTags("<UL>","</UL>");
      };
    };
    this.DoApplyIndent = function (Sender) {
      var t = "";
      var cb = null;
      if (!(this.FMemo != null)) return;
      t = "0";
      if (pas["WEBLib.Forms"].VSIDE != null) {
        cb = rtl.createCallback(this,"IndentCallBack");
        if (pas["WEBLib.Forms"].VSIDE)
        {
          pas["WEBLib.Forms"].VSIDE.Prompt("Set indent","Indent value", cb);
        };
      } else if (pas["WEBLib.Dialogs"].InputQuery("Set indent","Indent value",{get: function () {
          return t;
        }, set: function (v) {
          t = v;
        }})) this.InsertTags('<IND x="' + t + '"/>',"");
    };
    this.DoApplyUnderline = function (Sender) {
      if (!(this.FMemo != null)) return;
      if (!this.HasTags("<U>","</U>")) {
        this.InsertTags("<U>","</U>")}
       else this.RemoveTags("<U>","</U>");
    };
    this.DoAlignLeft = function (Sender) {
      if (!(this.FMemo != null)) return;
      if (this.HasTags('<P align="right">',"</P>")) this.RemoveTags('<P align="right">',"</P>");
      if (this.HasTags('<P align="center">',"</P>")) this.RemoveTags('<P align="center">',"</P>");
      this.InsertTags('<P align="left">',"</P>");
    };
    this.DoAlignCenter = function (Sender) {
      if (!(this.FMemo != null)) return;
      if (this.HasTags('<P align="right">',"</P>")) this.RemoveTags('<P align="right">',"</P>");
      if (this.HasTags('<P align="left">',"</P>")) this.RemoveTags('<P align="left">',"</P>");
      this.InsertTags('<P align="center">',"</P>");
    };
    this.DoAlignRight = function (Sender) {
      if (!(this.FMemo != null)) return;
      if (this.HasTags('<P align="center">',"</P>")) this.RemoveTags('<P align="center">',"</P>");
      if (this.HasTags('<P align="left">',"</P>")) this.RemoveTags('<P align="left">',"</P>");
      this.InsertTags('<P align="right">',"</P>");
    };
    this.HasTags = function (starttag, endtag) {
      var Result = false;
      Result = this.ScanBackward(starttag,endtag) && this.ScanForward(starttag,endtag);
      return Result;
    };
    this.ScanForward = function (starttag, endtag) {
      var Result = false;
      var i = 0;
      var s = "";
      var st = 0;
      var et = 0;
      Result = false;
      if (!(this.FMemo != null)) return Result;
      Result = false;
      i = this.FMemo.GetSelStart() + 1;
      s = this.FMemo.FLines.GetTextStr();
      s = pas.System.Copy(s,i,s.length);
      st = $impl.IPos(starttag,s);
      et = $impl.IPos(endtag,s);
      if ((st === 0) && (et > 0)) Result = true;
      if ((st > 0) && (et > 0) && (et < st)) Result = true;
      return Result;
    };
    this.ScanBackward = function (starttag, endtag) {
      var Result = false;
      var i = 0;
      var s = "";
      Result = false;
      if (!(this.FMemo != null)) return Result;
      i = this.FMemo.GetSelStart();
      s = this.FMemo.FLines.GetTextStr();
      s = pas.System.Copy(s,1,i);
      Result = false;
      while (i >= 1) {
        if ($impl.PosFrom(i,starttag,s) > $impl.PosFrom(i,endtag,s)) {
          if (pas.System.Pos(">",starttag) === 0) {
            Result = pas.System.Pos(">",s) !== 0}
           else Result = true;
          break;
        };
        i -= 1;
      };
      return Result;
    };
    this.InsertTags = function (starttag, endtag) {
      var s = "";
      var ss = 0;
      var sl = 0;
      if (!(this.FMemo != null)) return;
      ss = this.FMemo.GetSelStart() + 1;
      sl = this.FMemo.GetSelLength();
      s = this.FMemo.FLines.GetTextStr();
      $impl.InsertString(starttag,{get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},ss);
      $impl.InsertString(endtag,{get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},ss + this.FMemo.GetSelLength() + starttag.length);
      this.FMemo.FLines.SetTextStr(s);
      this.FMemo.SetSelStart((ss - 1) + starttag.length);
      this.FMemo.SetSelLength(sl);
      this.UpdateHTMLText();
    };
    this.RemoveTags = function (starttag, endtag) {
      var i = 0;
      var j = 0;
      var k = 0;
      var s = "";
      if (!(this.FMemo != null)) return;
      i = this.FMemo.GetSelStart();
      j = this.FMemo.GetSelLength();
      s = this.FMemo.FLines.GetTextStr();
      s = pas.System.Copy(s,1,i);
      k = i;
      while (i >= 1) {
        if ($impl.PosFrom(i,starttag,s) > $impl.PosFrom(i,endtag,s)) {
          s = this.FMemo.FLines.GetTextStr();
          pas.System.Delete({get: function () {
              return s;
            }, set: function (v) {
              s = v;
            }},i,starttag.length);
          if (pas.System.Pos(">",starttag) === 0) pas.System.Delete({get: function () {
              return s;
            }, set: function (v) {
              s = v;
            }},i,$impl.PosFrom(i,">",s));
          break;
        };
        i -= 1;
      };
      pas.System.Delete({get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},($impl.PosFrom(i,endtag,s) + i) - 1,endtag.length);
      this.FMemo.FLines.SetTextStr(s);
      this.FMemo.SetSelStart(k - starttag.length);
      this.FMemo.SetSelLength(j);
      this.UpdateHTMLText();
    };
    this.ChangeTagProp = function (starttag, endtag, propname, propval) {
      var i = 0;
      var j = 0;
      var k = 0;
      var l = 0;
      var pp = 0;
      var s = "";
      var t = "";
      if (!(this.FMemo != null)) return;
      i = this.FMemo.GetSelStart();
      j = this.FMemo.GetSelLength();
      s = this.FMemo.FLines.GetTextStr();
      k = s.length;
      l = i;
      s = pas.System.Copy(s,1,i);
      t = starttag;
      while (i >= 1) {
        if ($impl.PosFrom(i,starttag,s) > $impl.PosFrom(i,endtag,s)) {
          s = this.FMemo.FLines.GetTextStr();
          t = pas.System.Copy(s,i,$impl.PosFrom(i,">",s));
          pp = $impl.IPos(" " + propname,t);
          if (pp > 0) {
            pp += 1;
            pas.System.Delete({get: function () {
                return s;
              }, set: function (v) {
                s = v;
              }},(i + pp) - 1,propname.length);
            pas.System.Delete({get: function () {
                return s;
              }, set: function (v) {
                s = v;
              }},(i + pp) - 1,$impl.PosFrom(i + pp,'"',s) + 1);
            pas.System.Delete({get: function () {
                return s;
              }, set: function (v) {
                s = v;
              }},(i + pp) - 1,$impl.PosFrom(i + pp,'"',s) + 1);
          };
          $impl.InsertString(propname + '="' + propval + '" ',{get: function () {
              return s;
            }, set: function (v) {
              s = v;
            }},i + starttag.length);
          break;
        };
        i -= 1;
      };
      this.FMemo.FLines.SetTextStr(s);
      this.FMemo.SetSelStart((l + s.length) - k);
      this.FMemo.SetSelLength(j);
    };
    this.DoMemoChanged = function (Sender) {
      this.UpdateHTMLText();
    };
    this.DoFormKeyDown = function (Sender, Key, Shift) {
      if (pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomDesignerForm.isPrototypeOf(Sender)) {
        if (Key.get() === 27) {
          rtl.as(Sender,pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomDesignerForm).Close();
        };
      };
    };
    this.DoMemoKeyDown = function (Sender, Key, Shift) {
      if (!(this.FMemo != null)) return;
      if ((Key.get() === 65) && (pas.Classes.TShiftState$a.ssCtrl in Shift)) {
        this.FMemo.SetSelStart(0);
        this.FMemo.SetSelLength(this.FMemo.GetText().length);
      };
    };
    this.DoMemoKeyUp = function (Sender, Key, Shift) {
      this.UpdateButtons();
    };
    this.DoMemoMouseUp = function (Sender, Button, Shift, X, Y) {
      this.UpdateButtons();
    };
    this.DoButtonOKClick = function (Sender) {
      if (this.frm != null) this.frm.SetModalResult(1);
    };
    this.DoButtonCancelClick = function (Sender) {
      if (this.frm != null) this.frm.SetModalResult(2);
    };
    this.IndentCallBack = function (AIndent) {
      this.InsertTags('<IND x="' + AIndent + '"/>',"");
    };
    this.HyperlinkCallBack = function (AURL) {
      this.InsertTags('<A href="' + AURL + '">',"</A>");
    };
    this.ImageCallBack = function (AImage) {
      this.InsertTags('<IMG src="' + AImage + '"/>',"");
    };
    this.BuildEditor = function (AParent) {
      if (AParent != null) {
        this.FTopPanel = pas["WEBLib.TMSFNCEditorPanel"].TTMSFNCEditorPanel.$create("Create$1",[AParent]);
        this.FTopPanel.SetAlign(pas["WEBLib.Controls"].TAlign.alTop);
        this.FTopPanel.SetTop(0);
        this.FTopPanel.SetPanelPosition(pas["WEBLib.TMSFNCEditorPanel"].TTMSFNCEditorPanelPosition.eppCenter);
        this.FTopPanel.SetParent(AParent);
        pas["WEBLib.TMSFNCEditorsTools"].SetEditorBackPanelAppearance(this.FTopPanel,-1,-1,5);
        this.FPanel = pas["WEBLib.TMSFNCEditorPanel"].TTMSFNCEditorPanel.$create("Create$1",[AParent]);
        this.FPanel.SetAlign(pas["WEBLib.Controls"].TAlign.alBottom);
        this.FPanel.SetPanelPosition(pas["WEBLib.TMSFNCEditorPanel"].TTMSFNCEditorPanelPosition.eppCenter);
        this.FPanel.SetHeight(37);
        this.FPanel.SetParent(AParent);
        pas["WEBLib.TMSFNCEditorsTools"].SetEditorBackPanelAppearance(this.FPanel,-1,-1,5);
        this.FContentPanel = pas["WEBLib.TMSFNCEditorPanel"].TTMSFNCEditorPanel.$create("Create$1",[AParent]);
        this.FContentPanel.SetAlign(pas["WEBLib.Controls"].TAlign.alClient);
        this.FContentPanel.SetPanelPosition(pas["WEBLib.TMSFNCEditorPanel"].TTMSFNCEditorPanelPosition.eppCenter);
        this.FContentPanel.SetParent(AParent);
        pas["WEBLib.TMSFNCEditorsTools"].SetEditorSubPanelAppearance(this.FContentPanel,-1,-1,0);
        pas["WEBLib.TMSFNCEditorToolBar"].TTMSFNCEditorToolBar.FBlockBuildControls = true;
        this.FEditToolBar = pas["WEBLib.TMSFNCEditorToolBar"].TTMSFNCEditorEditToolBar.$create("Create$1",[this.FTopPanel]);
        this.FEditToolBar.FAppearance.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
        this.FEditToolBar.FAppearance.FFill.SetColor(-1);
        this.FEditToolBar.FAppearance.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
        this.FEditToolBar.DisableBackground();
        this.FEditToolBar.FAppearance.SetDragGrip(false);
        this.FEditToolBar.SetParent(this.FTopPanel);
        this.FEditToolBar.SetOptions(rtl.diffSet(this.FEditToolBar.FOptions,rtl.createSet(pas["WEBLib.TMSFNCEditorToolBar"].TTMSFNCEditorEditToolBarOption.etoUndo,pas["WEBLib.TMSFNCEditorToolBar"].TTMSFNCEditorEditToolBarOption.etoRedo)));
        this.FEditToolBar.SetControlAlignment(pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlAlignment.caRight);
        this.FEditToolBar.FAppearance.SetFlatStyle(true);
        this.FEditToolBar.FOnOpenFile = rtl.createCallback(this,"DoOpenFile");
        this.FEditToolBar.SaveFileButton().SetVisible(false);
        this.FEditToolBar.FOnCut = rtl.createCallback(this,"DoCut");
        this.FEditToolBar.FOnCopy = rtl.createCallback(this,"DoCopy");
        this.FEditToolBar.FOnPaste = rtl.createCallback(this,"DoPaste");
        this.FEditToolBar.SecondSeparator().SetVisible(false);
        this.FEditToolBar.SetAS(true);
        this.FEditToolBar.FOptionsMenu.SetShowButton(false);
        this.FEditToolBar.SetAlignWithMargins(true);
        this.FEditToolBar.FMargins.SetLeft(5);
        this.FEditToolBar.FMargins.SetTop(5);
        this.FEditToolBar.FMargins.SetRight(5);
        this.FEditToolBar.FMargins.SetBottom(5);
        this.FFormatToolBar = pas["WEBLib.TMSFNCEditorToolBar"].TTMSFNCEditorFormatToolBar.$create("Create$1",[this.FTopPanel]);
        this.FFormatToolBar.FAppearance.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
        this.FFormatToolBar.FAppearance.FFill.SetColor(-1);
        this.FFormatToolBar.FAppearance.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
        this.FFormatToolBar.DisableBackground();
        this.FFormatToolBar.FAppearance.SetDragGrip(false);
        this.FFormatToolBar.SetParent(this.FTopPanel);
        this.FFormatToolBar.SetOptions(rtl.diffSet(this.FFormatToolBar.FOptions,rtl.createSet(pas["WEBLib.TMSFNCEditorToolBar"].TTMSFNCEditorFormatToolBarOption.ftoStrikeout,pas["WEBLib.TMSFNCEditorToolBar"].TTMSFNCEditorFormatToolBarOption.ftoBackgroundColor,pas["WEBLib.TMSFNCEditorToolBar"].TTMSFNCEditorFormatToolBarOption.ftoBullets,pas["WEBLib.TMSFNCEditorToolBar"].TTMSFNCEditorFormatToolBarOption.ftoUnindent)));
        this.FFormatToolBar.SetControlAlignment(pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlAlignment.caLeft);
        this.FFormatToolBar.FAppearance.SetFlatStyle(true);
        this.FFormatToolBar.FOnApplyBold = rtl.createCallback(this,"DoApplyBold");
        this.FFormatToolBar.FOnApplyItalic = rtl.createCallback(this,"DoApplyItalic");
        this.FFormatToolBar.FOnApplyNumbering = rtl.createCallback(this,"DoApplyNumbering");
        this.FFormatToolBar.FOnApplyUnderline = rtl.createCallback(this,"DoApplyUnderline");
        this.FFormatToolBar.FOnAlignLeft = rtl.createCallback(this,"DoAlignLeft");
        this.FFormatToolBar.FOnAlignCenter = rtl.createCallback(this,"DoAlignCenter");
        this.FFormatToolBar.FOnAlignRight = rtl.createCallback(this,"DoAlignRight");
        this.FFormatToolBar.FOnIndent = rtl.createCallback(this,"DoApplyIndent");
        this.FFormatToolBar.FOnInsertHyperlink = rtl.createCallback(this,"DoInsertHyperlink");
        this.FFormatToolBar.FOnInsertBitmap = rtl.createCallback(this,"DoInsertBitmap");
        this.FFormatToolBar.FOnApplyFontName = rtl.createCallback(this,"DoApplyFontName");
        this.FFormatToolBar.FOnApplyFontSize = rtl.createCallback(this,"DoApplyFontSize");
        this.FFormatToolBar.FOnApplyTextColor = rtl.createCallback(this,"DoApplyTextColor");
        this.FFormatToolBar.SetAS(true);
        this.FFormatToolBar.FOptionsMenu.SetShowButton(false);
        this.FFormatToolBar.SetAlignWithMargins(true);
        this.FFormatToolBar.FMargins.SetLeft(5);
        this.FFormatToolBar.FMargins.SetTop(5);
        this.FFormatToolBar.FMargins.SetRight(5);
        this.FFormatToolBar.FMargins.SetBottom(5);
        this.FTopPanel.SetHeight(42);
        pas["WEBLib.TMSFNCEditorToolBar"].TTMSFNCEditorToolBar.FBlockBuildControls = false;
        this.FFormatToolBar.Build();
        this.FEditToolBar.Build();
        this.FMemo = pas["WEBLib.StdCtrls"].TMemo.$create("Create$1",[this.FContentPanel]);
        this.FMemo.SetParent(this.FContentPanel);
        this.FMemo.SetHeight(150);
        this.FMemo.FOnMouseUp = rtl.createCallback(this,"DoMemoMouseUp");
        this.FMemo.FOnKeyDown = rtl.createCallback(this,"DoMemoKeyDown");
        this.FMemo.SetAlign(pas["WEBLib.Controls"].TAlign.alTop);
        this.FMemo.FOnChange = rtl.createCallback(this,"DoMemoChanged");
        this.FMemo.SetTop(10);
        this.FMemo.SetAlignWithMargins(true);
        this.FMemo.FMargins.SetLeft(5);
        this.FMemo.FMargins.SetTop(5);
        this.FMemo.FMargins.SetRight(5);
        this.FMemo.FMargins.SetBottom(5);
        this.FHTMLText = pas["WEBLib.TMSFNCHTMLText"].TTMSFNCHTMLText.$create("Create$1",[this.FContentPanel]);
        this.FHTMLText.SetAdaptToStyle(true);
        this.FHTMLText.SetParent(this.FContentPanel);
        this.FHTMLText.SetControlAlignment(pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlAlignment.caClient);
        this.FHTMLText.SetHorizontalTextAlign(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading);
        this.FHTMLText.SetVerticalTextAlign(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading);
        this.FHTMLText.SetBitmapContainer(this.FBitmapContainer);
        this.FHTMLText.SetWordWrapping(true);
        this.FHTMLText.SetAlignWithMargins(true);
        this.FHTMLText.FMargins.SetLeft(5);
        this.FHTMLText.FMargins.SetTop(0);
        this.FHTMLText.FMargins.SetRight(5);
        this.FHTMLText.FMargins.SetBottom(5);
        pas["WEBLib.TMSFNCEditorsToolsUI"].SetEditorHTMLTextAppearance(this.FHTMLText,-1,-1);
        this.FButtonCancel = pas["WEBLib.TMSFNCEditorButton"].TTMSFNCEditorButton.$create("Create$1",[this.FPanel]);
        this.FButtonCancel.FModalResult = 2;
        this.FButtonCancel.SetParent(this.FPanel);
        this.FButtonCancel.SetText($impl.TranslateTextEx(rtl.getResStr($mod,"sTMSFNCHTMLEditorCancel")));
        this.FButtonCancel.SetAlign(pas["WEBLib.Controls"].TAlign.alRight);
        this.FButtonCancel.SetLeft(100);
        this.FButtonCancel.SetAlignWithMargins(true);
        this.FButtonCancel.FMargins.SetRight(5);
        this.FButtonCancel.FMargins.SetTop(5);
        this.FButtonCancel.FMargins.SetBottom(5);
        this.FButtonCancel.FMargins.SetLeft(5);
        this.FButtonCancel.FOnClick = rtl.createCallback(this,"DoButtonCancelClick");
        pas["WEBLib.TMSFNCEditorsTools"].SetEditorCancelButtonAppearance(this.FButtonCancel,12482304,5,-1,-1);
        this.FButtonOk = pas["WEBLib.TMSFNCEditorButton"].TTMSFNCEditorButton.$create("Create$1",[this.FPanel]);
        this.FButtonOk.FModalResult = 1;
        this.FButtonOk.SetParent(this.FPanel);
        this.FButtonOk.SetText($impl.TranslateTextEx(rtl.getResStr($mod,"sTMSFNCHTMLEditorOK")));
        this.FButtonOk.SetAlign(pas["WEBLib.Controls"].TAlign.alRight);
        this.FButtonOk.SetLeft(99);
        this.FButtonOk.SetAlignWithMargins(true);
        this.FButtonOk.FMargins.SetRight(0);
        this.FButtonOk.FMargins.SetTop(5);
        this.FButtonOk.FMargins.SetBottom(5);
        this.FButtonOk.FMargins.SetLeft(5);
        this.FButtonOk.FOnClick = rtl.createCallback(this,"DoButtonOKClick");
        pas["WEBLib.TMSFNCEditorsTools"].SetEditorOKButtonAppearance(this.FButtonOk,12482304,5,16777215);
        if (this.FMemo != null) this.FMemo.SetText(this.FText);
        if (this.FHTMLText != null) this.FHTMLText.SetText(this.FText);
        this.UpdateButtons();
        pas["WEBLib.TMSFNCEditorsToolsUI"].SetEditorToolBarAppearance(this.FEditToolBar,12482304,5,-1,-1);
        pas["WEBLib.TMSFNCEditorsToolsUI"].SetEditorToolBarAppearance(this.FFormatToolBar,12482304,5,-1,-1);
      };
    };
    this.UpdateHTMLText = function () {
      if (this.FMemo != null) {
        this.FText = this.FMemo.GetText();
        if (this.FHTMLText != null) this.FHTMLText.SetText(this.FText);
      };
    };
    this.UpdateButtons = function () {
      if (!(this.FFormatToolBar != null) || !(this.FEditToolBar != null) || !(this.FMemo != null)) return;
      this.FEditToolBar.CopyButton().SetEnabled(this.FMemo.GetSelLength() > 0);
      this.FEditToolBar.CutButton().SetEnabled(this.FMemo.GetSelLength() > 0);
      this.FEditToolBar.PasteButton().SetEnabled(pas["WEBLib.TMSFNCUtils"].TTMSFNCClipBoard.HasFormat(pas["WEBLib.TMSFNCUtils"].TTMSFNCClipBoardFormat.cfText));
      this.FFormatToolBar.BoldButton().SetDownState(this.HasTags("<B>","</B>"));
      this.FFormatToolBar.ItalicButton().SetDownState(this.HasTags("<I>","</I>"));
      this.FFormatToolBar.UnderlineButton().SetDownState(this.HasTags("<U>","</U>"));
      this.FFormatToolBar.AlignLeftButton().SetDownState(!this.HasTags('<P align="right">',"</P>") && !this.HasTags('<P align="center">',"</P>"));
      this.FFormatToolBar.AlignRightButton().SetDownState(this.HasTags('<P align="right">',"</P>"));
      this.FFormatToolBar.AlignCenterButton().SetDownState(this.HasTags('<P align="center">',"</P>"));
      this.FFormatToolBar.AlignLeftButton().SetDownState(this.HasTags('<P align="left">',"</P>"));
      this.FFormatToolBar.HyperlinkButton().SetDownState(this.HasTags("<A ","</A>"));
      this.FFormatToolBar.NumberingButton().SetDownState(this.HasTags("<UL>","</UL>"));
    };
    this.Execute = function (AProc) {
      var $Self = this;
      this.FOriginalText = this.FText;
      this.frm = $mod.TTMSFNCHTMLEditorForm.$create("CreateDialogNew$1",[$Self,"HTML Editor"]);
      this.frm.SetWidth(750);
      this.frm.SetHeight(400);
      this.frm.SetPosition(pas["WEBLib.Forms"].TPosition.poScreenCenter);
      this.frm.FOnKeyDown = rtl.createCallback($Self,"DoFormKeyDown");
      pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.ScaleForCurrentDPI(this.frm);
      this.frm.ShowModal$1(function (AResult) {
        if (AResult !== 1) {
          $Self.SetText($Self.FOriginalText);
        };
        $Self.frm = null;
        if (AProc != null) AProc(AResult);
      });
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCHTMLEditor.isPrototypeOf(Source)) this.FText = rtl.as(Source,$mod.TTMSFNCHTMLEditor).FText;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Text",2,rtl.string,"FText","SetText");
    $r.addProperty("BitmapContainer",2,pas["WEBLib.TMSFNCBitmapContainer"].$rtti["TTMSFNCBitmapContainer"],"FBitmapContainer","SetBitmapContainer");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
  rtl.createClass(this,"TTMSFNCHTMLEditorForm",pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomDesignerForm,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomDesignerForm.$init.call(this);
      this.FHTMLEditor = null;
    };
    this.$final = function () {
      this.FHTMLEditor = undefined;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomDesignerForm.$final.call(this);
    };
    this.Loaded = function () {
      var css = "";
      pas["WEBLib.Forms"].TCustomForm.Loaded.call(this);
      css = pas["WEBLib.Forms"].Application.IDECSS();
      if (css !== "") {
        this.AddCSS("IDECSS",css);
        this.SetElementClassName("IDEBkg");
        this.FCaptionElement.setAttribute("class","IDECaption IDEFont");
      };
    };
    this.LoadDFMValues = function () {
      pas["WEBLib.Forms"].TCustomForm.LoadDFMValues.call(this);
      if (this.FHTMLEditor != null) {
        this.FHTMLEditor.BuildEditor(this);
        if (this.FHTMLEditor.FMemo != null) this.SetActiveControl(this.FHTMLEditor.FMemo);
      };
    };
    this.CreateDialogNew$1 = function (AHTMLEditor, ACaption) {
      this.FHTMLEditor = AHTMLEditor;
      pas["WEBLib.Forms"].TCustomForm.CreateDialogNew.call(this,ACaption);
      return this;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  $mod.$resourcestrings = {sTMSFNCHTMLEditorOK: {org: "OK"}, sTMSFNCHTMLEditorCancel: {org: "Cancel"}};
  $mod.$implcode = function () {
    $impl.InsertString = function (ASource, AString, AIndex) {
      var ts = "";
      ts = pas.System.Copy(AString.get(),0,AIndex - 1);
      ts = ts + ASource;
      ts = ts + pas.System.Copy(AString.get(),AIndex,AString.get().length - (AIndex - 1));
      AString.set(ts);
    };
    $impl.IPos = function (substr, s) {
      var Result = 0;
      Result = pas.System.Pos(pas.SysUtils.UpperCase(substr),pas.SysUtils.UpperCase(s));
      return Result;
    };
    $impl.PosFrom = function (selpos, substr, s) {
      var Result = 0;
      pas.System.Delete({get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},1,selpos - 1);
      Result = $impl.IPos(substr,s);
      return Result;
    };
    $impl.TranslateTextEx = function (AText) {
      var Result = "";
      Result = AText;
      return Result;
    };
    $impl.GetAveCharSize = function () {
      var Result = pas.Types.TPoint.$new();
      var I = 0;
      var Buffer = "";
      var g = null;
      var sz = pas["WEBLib.TMSFNCTypes"].TSizeF.$new();
      Buffer = "";
      for (I = 0; I <= 25; I++) Buffer = Buffer + String.fromCharCode(I + 65);
      for (I = 0; I <= 25; I++) Buffer = Buffer + String.fromCharCode(I + 97);
      g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[1,1,false,true]);
      g.BeginScene();
      try {
        sz.$assign(g.CalculateTextSize$1(Buffer));
        Result.x = Math.round(sz.cx);
        Result.y = Math.round(sz.cy);
      } finally {
        g.EndScene();
        g = rtl.freeLoc(g);
      };
      Result.x = rtl.trunc(Result.x / 52);
      return Result;
    };
    $impl.InputListQuery = function (ACaption, APrompt, SL, Value) {
      var Result = false;
      var efrm = null;
      var Prompt = null;
      var Edit = null;
      var DialogUnits = pas.Types.TPoint.$new();
      var ButtonTop = 0;
      var ButtonWidth = 0;
      var ButtonHeight = 0;
      Result = false;
      efrm = pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomDesignerForm.$create("CreateNew",[pas["WEBLib.Forms"].Application,0]);
      try {
        DialogUnits.$assign($impl.GetAveCharSize());
        efrm.SetCaption(ACaption);
        efrm.SetClientWidth(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(180,DialogUnits.x,4));
        efrm.FPopupMode = pas["WEBLib.Forms"].TPopupMode.pmAuto;
        efrm.SetPosition(pas["WEBLib.Forms"].TPosition.poScreenCenter);
        Prompt = pas["WEBLib.StdCtrls"].TLabel.$create("Create$1",[efrm]);
        Prompt.SetParent(efrm);
        Prompt.SetCaption(APrompt);
        Prompt.SetLeft(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(8,DialogUnits.x,4));
        Prompt.SetTop(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(8,DialogUnits.y,8));
        Prompt.FWordWrap = true;
        Edit = $mod.TTMSFNCHTMLEditorComboBox.$create("Create$1",[efrm]);
        Edit.SetParent(efrm);
        Edit.FItems.Assign(SL);
        Edit.SetLeft(Prompt.GetLeft());
        Edit.SetTop(Prompt.GetTop() + Prompt.GetHeight() + 5);
        Edit.SetWidth(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(164,DialogUnits.x,4));
        Edit.SetText(Value.get());
        Edit.SetStyle(pas["WEBLib.StdCtrls"].TComboBoxStyle.csDropDown);
        ButtonTop = Edit.GetTop() + Edit.GetHeight() + 15;
        ButtonWidth = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(50,DialogUnits.x,4);
        ButtonHeight = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(14,DialogUnits.y,8);
        var $with = pas["WEBLib.StdCtrls"].TButton.$create("Create$1",[efrm]);
        $with.SetParent(efrm);
        $with.SetCaption(rtl.getResStr($mod,"sTMSFNCHTMLEditorOK"));
        $with.FModalResult = 1;
        $with.SetDefault(true);
        $with.SetBounds(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(38,DialogUnits.x,4),ButtonTop,ButtonWidth,ButtonHeight);
        var $with1 = pas["WEBLib.StdCtrls"].TButton.$create("Create$1",[efrm]);
        $with1.SetParent(efrm);
        $with1.SetCaption(rtl.getResStr($mod,"sTMSFNCHTMLEditorCancel"));
        $with1.FModalResult = 2;
        $with1.FCancel = true;
        $with1.SetBounds(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(92,DialogUnits.x,4),Edit.GetTop() + Edit.GetHeight() + 15,ButtonWidth,ButtonHeight);
        efrm.SetClientHeight(Math.round($with1.GetTop() + $with1.GetHeight() + 13));
        if (efrm.ShowModal() === 1) {
          Value.set(Edit.GetText());
          Result = true;
        };
      } finally {
        efrm = rtl.freeLoc(efrm);
      };
      return Result;
    };
  };
},["WEBLib.TMSFNCUtils","WEBLib.Graphics","SysUtils","WEBLib.Dialogs","WEBLib.TMSFNCEditorsTools","WEBLib.TMSFNCEditorsToolsUI"]);
rtl.module("WEBLib.TMSFNCCustomDialog",["System","Classes","UITypes","WEBLib.Controls","WEBLib.Forms","WEBLib.TMSFNCCustomComponent","WEBLib.TMSFNCCustomControl"],function () {
  "use strict";
  var $mod = this;
  this.$rtti.$MethodVar("TTMSFNCCustomDialogGetModalResult",{procsig: rtl.newTIProcSig([["ASender",pas.System.$rtti["TObject"]],["AModalResult",rtl.longint]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCCustomDialog",pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.$init.call(this);
      this.FFrm = null;
      this.FControl = null;
      this.FDialogHeight = 0;
      this.FDialogWidth = 0;
      this.FOnClose = null;
      this.FAllowReturnKeyClose = false;
      this.FOnGetModalResult = null;
      this.FOnResize$1 = null;
      this.FSizeable = false;
      this.FDestroyForm = false;
      this.FIsOpen = false;
    };
    this.$final = function () {
      this.FFrm = undefined;
      this.FControl = undefined;
      this.FOnClose = undefined;
      this.FOnGetModalResult = undefined;
      this.FOnResize$1 = undefined;
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.$final.call(this);
    };
    this.SetControl = function (Value) {
      if (this.FControl !== Value) this.FControl = Value;
    };
    this.SetDialogHeight = function (Value) {
      if (this.FDialogHeight !== Value) {
        this.FDialogHeight = Value;
        if (this.FFrm != null) {
          this.FFrm.SetClientHeight(Value);
        };
      };
    };
    this.SetDialogWidth = function (Value) {
      if (this.FDialogWidth !== Value) {
        this.FDialogWidth = Value;
        if (this.FFrm != null) {
          this.FFrm.SetClientWidth(Value);
        };
      };
    };
    this.GetInstance = function () {
      var Result = 0;
      Result = pas["WEBLib.TMSFNCTypes"].HInstance();
      return Result;
    };
    this.Notification = function (AComponent, AOperation) {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.Notification.apply(this,arguments);
      if ((AOperation === pas.Classes.TOperation.opRemove) && (AComponent === this.FControl)) this.FControl = null;
    };
    this.DoFormClose = function (Sender, AAction) {
      if (this.FDestroyForm) {
        this.FFrm = null;
        AAction.set(pas["WEBLib.Forms"].TCloseAction.caFree);
      };
      this.DoClose();
    };
    this.DoClose = function () {
      this.FIsOpen = false;
      if (this.FOnClose != null) this.FOnClose(this);
    };
    this.DoFormShow = function (Sender) {
      this.FIsOpen = true;
    };
    this.DoGetModalResult = function (AModalResult) {
      if (this.FOnGetModalResult != null) this.FOnGetModalResult(this,AModalResult);
    };
    this.DoFormKeyDown = function (Sender, Key, Shift) {
      if (Key.get() === 27) {
        this.FFrm.Close();
      } else if (Key.get() === 13) {
        if (this.FAllowReturnKeyClose) {
          this.FFrm.SetModalResult(1);
          this.FFrm.Close();
        };
      };
    };
    this.DoFormResize = function (Sender) {
      if (this.FOnResize$1 != null) this.FOnResize$1(this);
    };
    this.BuildDialog = function (AParent) {
    };
    this.ScaleForCurrentDPI = function (AForm) {
      if (AForm != null) ;
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.Create$1.apply(this,arguments);
      this.FDestroyForm = true;
      this.FDialogWidth = 440;
      this.FDialogHeight = 300;
      this.FSizeable = false;
      this.FIsOpen = false;
      return this;
    };
    this.Destroy = function () {
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.Execute = function (AProc, AModal) {
      var $Self = this;
      if (!(this.FFrm != null)) {
        this.FFrm = $mod.TTMSFNCCustomDialogForm.$create("CreateDialogNew$1",[$Self,this.FCaption]);
        this.FFrm.FOnClose = rtl.createCallback($Self,"DoFormClose");
        this.FFrm.FOnShow = rtl.createCallback($Self,"DoFormShow");
        this.FFrm.FOnKeyDown = rtl.createCallback($Self,"DoFormKeyDown");
        this.FFrm.FOnResize = rtl.createCallback($Self,"DoFormResize");
        this.FFrm.SetCaption(this.FCaption);
        this.FFrm.SetClientWidth(this.FDialogWidth);
        this.FFrm.SetClientHeight(this.FDialogHeight);
        this.FFrm.SetPosition(pas["WEBLib.Forms"].TPosition.poScreenCenter);
        this.ScaleForCurrentDPI(this.FFrm);
      };
      if (AModal) {
        this.FFrm.ShowModal$1(function (AResult) {
          $Self.DoGetModalResult(AResult);
          if (AProc != null) AProc(AResult);
        });
      } else {
        this.FFrm.Show$1();
        if (AProc != null) AProc(1);
      };
    };
    this.Close = function () {
      if (this.FFrm != null) this.FFrm.Close();
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCCustomDialogForm",pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomDesignerForm,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomDesignerForm.$init.call(this);
      this.FCustomDialog = null;
    };
    this.$final = function () {
      this.FCustomDialog = undefined;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomDesignerForm.$final.call(this);
    };
    this.Loaded = function () {
      var css = "";
      pas["WEBLib.Forms"].TCustomForm.Loaded.call(this);
      css = pas["WEBLib.Forms"].Application.IDECSS();
      if (css !== "") {
        this.AddCSS("IDECSS",css);
        this.SetElementClassName("IDEBkg");
        this.FCaptionElement.setAttribute("class","IDECaption IDEFont");
      };
    };
    this.LoadDFMValues = function () {
      pas["WEBLib.Forms"].TCustomForm.LoadDFMValues.call(this);
      if (this.FCustomDialog != null) {
        this.FCustomDialog.BuildDialog(this);
      };
    };
    this.CreateDialogNew$1 = function (ACustomDialog, ACaption) {
      this.FCustomDialog = ACustomDialog;
      pas["WEBLib.Forms"].TCustomForm.CreateDialogNew.call(this,ACaption);
      return this;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
},["SysUtils","WEBLib.TMSFNCUtils","WEBLib.TMSFNCTypes"]);
rtl.module("WEBLib.TMSFNCCalendar",["System","WEBLib.Menus","Classes","Types","TypInfo","WEBLib.Controls","WEBLib.Graphics","WEBLib.TMSFNCCustomControl","WEBLib.TMSFNCGraphics","WEBLib.TMSFNCGraphicsTypes","WEBLib.TMSFNCTypes","WEBLib.TMSFNCUtils","WEBLib.TMSFNCBitmapContainer","SysUtils","WEBLib.TMSFNCStyles"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.MAJ_VER = 1;
  this.MIN_VER = 0;
  this.REL_VER = 4;
  this.BLD_VER = 2;
  this.$rtti.$Class("TTMSFNCCustomCalendar");
  this.TTMSFNCCalendarArrowLayoutValue = {"0": "alvLeft", alvLeft: 0, "1": "alvRight", alvRight: 1};
  this.$rtti.$Enum("TTMSFNCCalendarArrowLayoutValue",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCCalendarArrowLayoutValue});
  this.$rtti.$Set("TTMSFNCCalendarArrowLayout",{comptype: this.$rtti["TTMSFNCCalendarArrowLayoutValue"]});
  this.TTMSFNCCalendarArrowType = {"0": "atTriangle", atTriangle: 0, "1": "atArrow", atArrow: 1, "2": "atBitmap", atBitmap: 2, "3": "atCustom", atCustom: 3};
  this.$rtti.$Enum("TTMSFNCCalendarArrowType",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TTMSFNCCalendarArrowType});
  rtl.createClass(this,"TTMSFNCCalendarArrow",pas["WEBLib.TMSFNCTypes"].TTMSFNCPersistent,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCTypes"].TTMSFNCPersistent.$init.call(this);
      this.FOwner = null;
      this.FColor = 0;
      this.FVisibility = {};
      this.FSize = 0;
      this.FOnChange = null;
      this.FArrowLeftType = 0;
      this.FArrowLeftBitmap = null;
      this.FArrowRightBitmap = null;
      this.FArrowRightBitmapSize = 0.0;
      this.FArrowRightType = 0;
      this.FArrowLeftBitmapSize = 0.0;
    };
    this.$final = function () {
      this.FOwner = undefined;
      this.FVisibility = undefined;
      this.FOnChange = undefined;
      this.FArrowLeftBitmap = undefined;
      this.FArrowRightBitmap = undefined;
      pas["WEBLib.TMSFNCTypes"].TTMSFNCPersistent.$final.call(this);
    };
    this.SetColor = function (Value) {
      if (this.FColor !== Value) {
        this.FColor = Value;
        this.Changed();
      };
    };
    this.SetVisibility = function (Value) {
      if (rtl.neSet(this.FVisibility,Value)) {
        this.FVisibility = rtl.refSet(Value);
        this.Changed();
      };
    };
    this.SetSize = function (Value) {
      if (this.FSize !== Value) this.FSize = Value;
    };
    this.SetArrowLeftBitmap = function (Value) {
      this.FArrowLeftBitmap.Assign(Value);
    };
    this.SetArrowRightBitmap = function (Value) {
      this.FArrowRightBitmap.Assign(Value);
    };
    this.SetArrowLeftBitmapSize = function (Value) {
      if (this.FArrowLeftBitmapSize !== Value) {
        this.FArrowLeftBitmapSize = Value;
        this.Changed();
      };
    };
    this.SetArrowLeftType = function (Value) {
      if (this.FArrowLeftType !== Value) {
        this.FArrowLeftType = Value;
        this.Changed();
      };
    };
    this.SetArrowRightBitmapSize = function (Value) {
      if (this.FArrowRightBitmapSize !== Value) {
        this.FArrowRightBitmapSize = Value;
        this.Changed();
      };
    };
    this.SetArrowRightType = function (Value) {
      if (this.FArrowRightType !== Value) {
        this.FArrowRightType = Value;
        this.Changed();
      };
    };
    this.SetBitmapContainer = function (Value) {
    };
    this.GetBitmapContainer = function () {
      var Result = null;
      Result = null;
      return Result;
    };
    this.IsArrowLeftBitmapSizeStored = function () {
      var Result = false;
      Result = this.FArrowLeftBitmapSize !== 15;
      return Result;
    };
    this.IsArrowRightBitmapSizeStore = function () {
      var Result = false;
      Result = this.FArrowRightBitmapSize !== 15;
      return Result;
    };
    this.Changed = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.GetOwner = function () {
      var Result = null;
      Result = this.FOwner;
      return Result;
    };
    this.Create$1 = function (AOwner) {
      this.FOwner = AOwner;
      this.FArrowLeftBitmap = pas["WEBLib.TMSFNCTypes"].TTMSFNCScaledBitmaps.$create("Create$3",[this]);
      this.FArrowRightBitmap = pas["WEBLib.TMSFNCTypes"].TTMSFNCScaledBitmaps.$create("Create$3",[this]);
      this.FColor = 6908265;
      this.FVisibility = rtl.createSet($mod.TTMSFNCCalendarArrowLayoutValue.alvLeft,$mod.TTMSFNCCalendarArrowLayoutValue.alvRight);
      this.FArrowLeftType = $mod.TTMSFNCCalendarArrowType.atArrow;
      this.FArrowRightType = $mod.TTMSFNCCalendarArrowType.atArrow;
      this.FArrowLeftBitmapSize = 15;
      this.FArrowRightBitmapSize = 15;
      this.FSize = 15;
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FArrowLeftBitmap");
      rtl.free(this,"FArrowRightBitmap");
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCCalendarArrow.isPrototypeOf(Source)) {
        this.FColor = rtl.as(Source,$mod.TTMSFNCCalendarArrow).FColor;
        this.FVisibility = rtl.refSet(rtl.as(Source,$mod.TTMSFNCCalendarArrow).FVisibility);
        this.FSize = rtl.as(Source,$mod.TTMSFNCCalendarArrow).FSize;
        this.FArrowLeftType = rtl.as(Source,$mod.TTMSFNCCalendarArrow).FArrowLeftType;
        this.FArrowLeftBitmapSize = rtl.as(Source,$mod.TTMSFNCCalendarArrow).FArrowLeftBitmapSize;
        this.FArrowLeftBitmap.Assign(rtl.as(Source,$mod.TTMSFNCCalendarArrow).FArrowLeftBitmap);
        this.FArrowRightType = rtl.as(Source,$mod.TTMSFNCCalendarArrow).FArrowRightType;
        this.FArrowRightBitmapSize = rtl.as(Source,$mod.TTMSFNCCalendarArrow).FArrowRightBitmapSize;
        this.FArrowRightBitmap.Assign(rtl.as(Source,$mod.TTMSFNCCalendarArrow).FArrowRightBitmap);
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    var $r = this.$rtti;
    $r.addProperty("ArrowLeftBitmap",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCScaledBitmaps"],"FArrowLeftBitmap","SetArrowLeftBitmap");
    $r.addProperty("ArrowLeftType",2,$mod.$rtti["TTMSFNCCalendarArrowType"],"FArrowLeftType","SetArrowLeftType",4,{Default: $mod.TTMSFNCCalendarArrowType.atArrow});
    $r.addProperty("ArrowLeftBitmapSize",14,rtl.double,"FArrowLeftBitmapSize","SetArrowLeftBitmapSize",4,{stored: "IsArrowLeftBitmapSizeStored"});
    $r.addProperty("ArrowRightBitmap",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCScaledBitmaps"],"FArrowRightBitmap","SetArrowRightBitmap");
    $r.addProperty("ArrowRightType",2,$mod.$rtti["TTMSFNCCalendarArrowType"],"FArrowRightType","SetArrowRightType",4,{Default: $mod.TTMSFNCCalendarArrowType.atArrow});
    $r.addProperty("ArrowRightBitmapSize",14,rtl.double,"FArrowRightBitmapSize","SetArrowRightBitmapSize",4,{stored: "IsArrowRightBitmapSizeStore"});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor",4,{Default: 6908265});
    $r.addProperty("Visibility",2,$mod.$rtti["TTMSFNCCalendarArrowLayout"],"FVisibility","SetVisibility",4,{Default: rtl.createSet($mod.TTMSFNCCalendarArrowLayoutValue.alvLeft,$mod.TTMSFNCCalendarArrowLayoutValue.alvRight)});
  });
  rtl.createClass(this,"TTMSFNCCalendarHeader",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FFill = null;
      this.FFont = null;
      this.FStroke = null;
      this.FVerticalTextAlign = 0;
      this.FHorizontalTextAlign = 0;
      this.FArrow = null;
      this.FVisible = false;
      this.FOnChange = null;
      this.FHeight = 0;
    };
    this.$final = function () {
      this.FFill = undefined;
      this.FFont = undefined;
      this.FStroke = undefined;
      this.FArrow = undefined;
      this.FOnChange = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetFill = function (Value) {
      if (this.FFill !== Value) this.FFill.Assign(Value);
    };
    this.SetFont = function (Value) {
      this.FFont.AssignSource(Value);
    };
    this.SetHorizontalTextAlign = function (Value) {
      if (this.FHorizontalTextAlign !== Value) {
        this.FHorizontalTextAlign = Value;
        this.Changed();
      };
    };
    this.SetVerticalTextAlign = function (Value) {
      if (this.FVerticalTextAlign !== Value) {
        this.FVerticalTextAlign = Value;
        this.Changed();
      };
    };
    this.SetStroke = function (Value) {
      if (this.FStroke !== Value) this.FStroke.Assign(Value);
    };
    this.SetArrow = function (Value) {
      if (this.FArrow !== Value) this.FArrow.Assign(Value);
    };
    this.SetVisible = function (Value) {
      if (this.FVisible !== Value) {
        this.FVisible = Value;
        this.Changed();
      };
    };
    this.SetHeight = function (Value) {
      if (this.FHeight !== Value) {
        this.FHeight = Value;
        this.Changed();
      };
    };
    this.Changed = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.FillChanged = function (Sender) {
      this.Changed();
    };
    this.FontChanged = function (Sender) {
      this.Changed();
    };
    this.StrokeChanged = function (Sender) {
      this.Changed();
    };
    this.Create$1 = function (AOwner) {
      this.FFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FHorizontalTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      this.FVerticalTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      this.FStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,12632256,1.0]);
      this.FFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(228,228,228),8421504,-1,-1]);
      this.FArrow = $mod.TTMSFNCCalendarArrow.$create("Create$1",[AOwner]);
      this.FVisible = true;
      this.FHeight = 25;
      this.FFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FFont.FOnChanged = rtl.createCallback(this,"FontChanged");
      this.FStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FFont");
      rtl.free(this,"FFill");
      rtl.free(this,"FStroke");
      rtl.free(this,"FArrow");
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCCalendarHeader.isPrototypeOf(Source)) {
        this.FFont.AssignSource(rtl.as(Source,$mod.TTMSFNCCalendarHeader).FFont);
        this.FHorizontalTextAlign = rtl.as(Source,$mod.TTMSFNCCalendarHeader).FHorizontalTextAlign;
        this.FVerticalTextAlign = rtl.as(Source,$mod.TTMSFNCCalendarHeader).FVerticalTextAlign;
        this.FStroke.Assign(rtl.as(Source,$mod.TTMSFNCCalendarHeader).FStroke);
        this.FFill.Assign(rtl.as(Source,$mod.TTMSFNCCalendarHeader).FFill);
        this.FArrow.Assign(rtl.as(Source,$mod.TTMSFNCCalendarHeader).FArrow);
        this.FVisible = rtl.as(Source,$mod.TTMSFNCCalendarHeader).FVisible;
        this.FHeight = rtl.as(Source,$mod.TTMSFNCCalendarHeader).FHeight;
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    var $r = this.$rtti;
    $r.addProperty("Arrow",2,$mod.$rtti["TTMSFNCCalendarArrow"],"FArrow","SetArrow");
    $r.addProperty("Height",2,rtl.longint,"FHeight","SetHeight",4,{Default: 25});
    $r.addProperty("Fill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFill","SetFill");
    $r.addProperty("Font",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FFont","SetFont");
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("VerticalTextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FVerticalTextAlign","SetVerticalTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter});
    $r.addProperty("HorizontalTextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FHorizontalTextAlign","SetHorizontalTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter});
  });
  this.TTMSFNCCalendarFooterDate = {"0": "fdNone", fdNone: 0, "1": "fdSelected", fdSelected: 1, "2": "fdToday", fdToday: 2};
  this.$rtti.$Enum("TTMSFNCCalendarFooterDate",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCCalendarFooterDate});
  rtl.createClass(this,"TTMSFNCCalendarFooter",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FFill = null;
      this.FFont = null;
      this.FStroke = null;
      this.FVerticalTextAlign = 0;
      this.FHorizontalTextAlign = 0;
      this.FCaption = "";
      this.FVisible = false;
      this.FDateCaption = 0;
      this.FOnChange = null;
      this.FHeight = 0;
      this.FCaptionRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
    };
    this.$final = function () {
      this.FFill = undefined;
      this.FFont = undefined;
      this.FStroke = undefined;
      this.FOnChange = undefined;
      this.FCaptionRect = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetFill = function (Value) {
      if (this.FFill !== Value) this.FFill.Assign(Value);
    };
    this.SetFont = function (Value) {
      this.FFont.AssignSource(Value);
    };
    this.SetHorizontalTextAlign = function (Value) {
      if (this.FHorizontalTextAlign !== Value) {
        this.FHorizontalTextAlign = Value;
        this.Changed();
      };
    };
    this.SetVerticalTextAlign = function (Value) {
      if (this.FVerticalTextAlign !== Value) {
        this.FVerticalTextAlign = Value;
        this.Changed();
      };
    };
    this.SetStroke = function (Value) {
      if (this.FStroke !== Value) this.FStroke.Assign(Value);
    };
    this.SetCaption = function (Value) {
      if (this.FCaption !== Value) {
        this.FCaption = Value;
        this.Changed();
      };
    };
    this.SetVisible = function (Value) {
      if (this.FVisible !== Value) {
        this.FVisible = Value;
        this.Changed();
      };
    };
    this.SetHeight = function (Value) {
      if (this.FHeight !== Value) {
        this.FHeight = Value;
        this.Changed();
      };
    };
    this.SetDateCaption = function (Value) {
      if (this.FDateCaption !== Value) {
        this.FDateCaption = Value;
        this.Changed();
      };
    };
    this.SetCaptionRect = function (Value) {
      this.FCaptionRect.$assign(Value);
    };
    this.IsCaptionStored = function () {
      var Result = false;
      Result = this.FCaption !== "";
      return Result;
    };
    this.Changed = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.FillChanged = function (Sender) {
      this.Changed();
    };
    this.FontChanged = function (Sender) {
      this.Changed();
    };
    this.StrokeChanged = function (Sender) {
      this.Changed();
    };
    this.Create$1 = function () {
      this.FFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FHorizontalTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      this.FVerticalTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      this.FStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,12632256,1.0]);
      this.FFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(228,228,228),8421504,-1,-1]);
      this.FVisible = true;
      this.FHeight = 25;
      this.FDateCaption = $mod.TTMSFNCCalendarFooterDate.fdToday;
      this.FFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FFont.FOnChanged = rtl.createCallback(this,"FontChanged");
      this.FStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FFont");
      rtl.free(this,"FStroke");
      rtl.free(this,"FFill");
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCCalendarFooter.isPrototypeOf(Source)) {
        this.FFill.Assign(rtl.as(Source,$mod.TTMSFNCCalendarFooter).FFill);
        this.FStroke.Assign(rtl.as(Source,$mod.TTMSFNCCalendarFooter).FStroke);
        this.FFont.AssignSource(rtl.as(Source,$mod.TTMSFNCCalendarFooter).FFont);
        this.FVerticalTextAlign = rtl.as(Source,$mod.TTMSFNCCalendarFooter).FVerticalTextAlign;
        this.FHorizontalTextAlign = rtl.as(Source,$mod.TTMSFNCCalendarFooter).FHorizontalTextAlign;
        this.FVisible = rtl.as(Source,$mod.TTMSFNCCalendarFooter).FVisible;
        this.FDateCaption = rtl.as(Source,$mod.TTMSFNCCalendarFooter).FDateCaption;
        this.FCaptionRect.$assign(rtl.as(Source,$mod.TTMSFNCCalendarFooter).FCaptionRect);
        this.FCaption = rtl.as(Source,$mod.TTMSFNCCalendarFooter).FCaption;
        this.FHeight = rtl.as(Source,$mod.TTMSFNCCalendarFooter).FHeight;
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    var $r = this.$rtti;
    $r.addProperty("Caption",14,rtl.string,"FCaption","SetCaption",4,{stored: "IsCaptionStored"});
    $r.addProperty("DateCaption",2,$mod.$rtti["TTMSFNCCalendarFooterDate"],"FDateCaption","SetDateCaption",4,{Default: $mod.TTMSFNCCalendarFooterDate.fdToday});
    $r.addProperty("Height",2,rtl.longint,"FHeight","SetHeight",4,{Default: 25});
    $r.addProperty("Fill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFill","SetFill");
    $r.addProperty("Font",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FFont","SetFont");
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("VerticalTextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FVerticalTextAlign","SetVerticalTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter});
    $r.addProperty("HorizontalTextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FHorizontalTextAlign","SetHorizontalTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter});
  });
  rtl.createClass(this,"TTMSFNCCalendarDayNameAppearance",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FFill = null;
      this.FFont = null;
      this.FStroke = null;
      this.FVerticalTextAlign = 0;
      this.FHorizontalTextAlign = 0;
      this.FOnChange = null;
      this.FHeight = 0;
    };
    this.$final = function () {
      this.FFill = undefined;
      this.FFont = undefined;
      this.FStroke = undefined;
      this.FOnChange = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetFill = function (Value) {
      if (this.FFill !== Value) this.FFill.Assign(Value);
    };
    this.SetFont = function (Value) {
      this.FFont.AssignSource(Value);
    };
    this.SetHorizontalTextAlign = function (Value) {
      if (this.FHorizontalTextAlign !== Value) this.FHorizontalTextAlign = Value;
    };
    this.SetStroke = function (Value) {
      if (this.FStroke !== Value) this.FStroke.Assign(Value);
    };
    this.SetVerticalTextAlign = function (Value) {
      if (this.FVerticalTextAlign !== Value) this.FVerticalTextAlign = Value;
    };
    this.SetHeight = function (Value) {
      if (this.FHeight !== Value) this.FHeight = Value;
    };
    this.Changed = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.FillChanged = function (Sender) {
      this.Changed();
    };
    this.FontChanged = function (Sender) {
      this.Changed();
    };
    this.StrokeChanged = function (Sender) {
      this.Changed();
    };
    this.Create$1 = function () {
      this.FHeight = 15;
      this.FFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,-1,8421504,-1,-1]);
      this.FStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,-1,1.0]);
      this.FHorizontalTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      this.FVerticalTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FFill");
      rtl.free(this,"FStroke");
      rtl.free(this,"FFont");
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCCalendarDayNameAppearance.isPrototypeOf(Source)) {
        this.FHeight = rtl.as(Source,$mod.TTMSFNCCalendarDayNameAppearance).FHeight;
        this.FFill.Assign(rtl.as(Source,$mod.TTMSFNCCalendarDayNameAppearance).FFill);
        this.FStroke.Assign(rtl.as(Source,$mod.TTMSFNCCalendarDayNameAppearance).FStroke);
        this.FFont.AssignSource(rtl.as(Source,$mod.TTMSFNCCalendarDayNameAppearance).FFont);
        this.FVerticalTextAlign = rtl.as(Source,$mod.TTMSFNCCalendarDayNameAppearance).FVerticalTextAlign;
        this.FHorizontalTextAlign = rtl.as(Source,$mod.TTMSFNCCalendarDayNameAppearance).FHorizontalTextAlign;
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    var $r = this.$rtti;
    $r.addProperty("Height",2,rtl.longint,"FHeight","SetHeight",4,{Default: 15});
    $r.addProperty("Fill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFill","SetFill");
    $r.addProperty("Font",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FFont","SetFont");
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
    $r.addProperty("VerticalTextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FVerticalTextAlign","SetVerticalTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter});
    $r.addProperty("HorizontalTextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FHorizontalTextAlign","SetHorizontalTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter});
  });
  rtl.createClass(this,"TTMSFNCCalendarDateAppearance",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FFill = null;
      this.FFont = null;
      this.FStroke = null;
      this.FVerticalTextAlign = 0;
      this.FHorizontalTextAlign = 0;
      this.FSelectedFill = null;
      this.FSelectedFont = null;
      this.FSelectedStroke = null;
      this.FSelectedVerticalTextAlign = 0;
      this.FSelectedHorizontalTextAlign = 0;
      this.FDisabledFill = null;
      this.FDisabledFont = null;
      this.FDisabledStroke = null;
      this.FDateBeforeFill = null;
      this.FDateBeforeFont = null;
      this.FDateBeforeStroke = null;
      this.FDateAfterFont = null;
      this.FDateAfterFill = null;
      this.FDateAfterStroke = null;
      this.FShowDaysBefore = false;
      this.FShowDaysAfter = false;
      this.FOnChange = null;
      this.FTodayFill = null;
      this.FBadgeFont = null;
      this.FTodayStroke = null;
      this.FBadgeFill = null;
      this.FBadgeStroke = null;
      this.FTodayFont = null;
      this.FShowFocus = false;
    };
    this.$final = function () {
      this.FFill = undefined;
      this.FFont = undefined;
      this.FStroke = undefined;
      this.FSelectedFill = undefined;
      this.FSelectedFont = undefined;
      this.FSelectedStroke = undefined;
      this.FDisabledFill = undefined;
      this.FDisabledFont = undefined;
      this.FDisabledStroke = undefined;
      this.FDateBeforeFill = undefined;
      this.FDateBeforeFont = undefined;
      this.FDateBeforeStroke = undefined;
      this.FDateAfterFont = undefined;
      this.FDateAfterFill = undefined;
      this.FDateAfterStroke = undefined;
      this.FOnChange = undefined;
      this.FTodayFill = undefined;
      this.FBadgeFont = undefined;
      this.FTodayStroke = undefined;
      this.FBadgeFill = undefined;
      this.FBadgeStroke = undefined;
      this.FTodayFont = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetFill = function (Value) {
      if (this.FFill !== Value) this.FFill.Assign(Value);
    };
    this.SetFont = function (Value) {
      this.FFont.AssignSource(Value);
    };
    this.SetHorizontalTextAlign = function (Value) {
      if (this.FHorizontalTextAlign !== Value) this.FHorizontalTextAlign = Value;
    };
    this.SetStroke = function (Value) {
      if (this.FStroke !== Value) this.FStroke.Assign(Value);
    };
    this.SetVerticalTextAlign = function (Value) {
      if (this.FVerticalTextAlign !== Value) this.FVerticalTextAlign = Value;
    };
    this.SetSelectedFill = function (Value) {
      if (this.FSelectedFill !== Value) this.FSelectedFill.Assign(Value);
    };
    this.SetSelectedFont = function (Value) {
      this.FSelectedFont.AssignSource(Value);
    };
    this.SetSelectedHorizontalTextAlign = function (Value) {
      if (this.FSelectedHorizontalTextAlign !== Value) this.FSelectedHorizontalTextAlign = Value;
    };
    this.SetSelectedStroke = function (Value) {
      if (this.FSelectedStroke !== Value) this.FSelectedStroke.Assign(Value);
    };
    this.SetSelectedVerticalTextAlign = function (Value) {
      if (this.FSelectedVerticalTextAlign !== Value) this.FSelectedVerticalTextAlign = Value;
    };
    this.SetDisabledFill = function (Value) {
      if (this.FDisabledFill !== Value) this.FDisabledFill.Assign(Value);
    };
    this.SetDisabledFont = function (Value) {
      this.FDisabledFont.AssignSource(Value);
    };
    this.SetDisabledStroke = function (Value) {
      if (this.FDisabledStroke !== Value) this.FDisabledStroke.Assign(Value);
    };
    this.SetDateAfterFill = function (Value) {
      if (this.FDateAfterFill !== Value) this.FDateAfterFill.Assign(Value);
    };
    this.SetDateAfterFont = function (Value) {
      this.FDateAfterFont.AssignSource(Value);
    };
    this.SetDateBeforeFill = function (Value) {
      if (this.FDateBeforeFill !== Value) this.FDateBeforeFill.Assign(Value);
    };
    this.SetDateBeforeFont = function (Value) {
      this.FDateBeforeFont.AssignSource(Value);
    };
    this.SetShowDaysAfter = function (Value) {
      if (this.FShowDaysAfter !== Value) {
        this.FShowDaysAfter = Value;
        this.Changed();
      };
    };
    this.SetShowDaysBefore = function (Value) {
      if (this.FShowDaysBefore !== Value) {
        this.FShowDaysBefore = Value;
        this.Changed();
      };
    };
    this.SetDateAfterStroke = function (Value) {
      if (this.FDateAfterStroke !== Value) this.FDateAfterStroke.Assign(Value);
    };
    this.SetDateBeforeStroke = function (Value) {
      if (this.FDateBeforeStroke !== Value) this.FDateBeforeStroke.Assign(Value);
    };
    this.SetBadgeFill = function (Value) {
      if (this.FBadgeFill !== Value) this.FBadgeFill.Assign(Value);
    };
    this.SetBadgeFont = function (Value) {
      this.FBadgeFont.AssignSource(Value);
    };
    this.SetBadgeStroke = function (Value) {
      if (this.FBadgeStroke !== Value) this.FBadgeStroke.Assign(Value);
    };
    this.SetTodayFill = function (Value) {
      if (this.FTodayFill !== Value) this.FTodayFill.Assign(Value);
    };
    this.SetTodayFont = function (Value) {
      this.FTodayFont.AssignSource(Value);
    };
    this.SetTodayStroke = function (Value) {
      if (this.FTodayStroke !== Value) this.FTodayStroke.Assign(Value);
    };
    this.SetShowFocus = function (Value) {
      if (this.FShowFocus !== Value) {
        this.FShowFocus = Value;
        this.Changed();
      };
    };
    this.Changed = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.FillChanged = function (Sender) {
      this.Changed();
    };
    this.FontChanged = function (Sender) {
      this.Changed();
    };
    this.StrokeChanged = function (Sender) {
      this.Changed();
    };
    this.Create$1 = function () {
      this.FFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,-1,8421504,-1,-1]);
      this.FStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,-1,1.0]);
      this.FHorizontalTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      this.FVerticalTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      this.FSelectedFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16748574,8421504,-1,-1]);
      this.FSelectedStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,16748574,1.0]);
      this.FSelectedFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FSelectedFont.SetColor(16777215);
      this.FSelectedHorizontalTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      this.FSelectedVerticalTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      this.FDisabledFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FDisabledFont.SetColor(13882323);
      this.FDisabledFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,-1,8421504,-1,-1]);
      this.FDisabledStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,-1,1.0]);
      this.FDateBeforeFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,-1,8421504,-1,-1]);
      this.FDateBeforeFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FDateBeforeStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,-1,1.0]);
      this.FDateBeforeFont.SetColor(10789024);
      this.FDateAfterFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,-1,8421504,-1,-1]);
      this.FDateAfterFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FDateAfterFont.SetColor(10789024);
      this.FDateAfterStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,-1,1.0]);
      this.FTodayFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,-1,8421504,-1,-1]);
      this.FTodayFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FTodayFont.SetColor(255);
      this.FTodayStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,-1,1.0]);
      this.FBadgeFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,255,8421504,-1,-1]);
      this.FBadgeFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FBadgeFont.SetColor(16777215);
      this.FShowFocus = true;
      this.FBadgeFont.SetSize(7);
      this.FBadgeStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,255,1.0]);
      this.FShowDaysBefore = false;
      this.FShowDaysAfter = false;
      this.FFont.FOnChanged = rtl.createCallback(this,"FontChanged");
      this.FSelectedFont.FOnChanged = rtl.createCallback(this,"FontChanged");
      this.FDisabledFont.FOnChanged = rtl.createCallback(this,"FontChanged");
      this.FDateBeforeFont.FOnChanged = rtl.createCallback(this,"FontChanged");
      this.FDateAfterFont.FOnChanged = rtl.createCallback(this,"FontChanged");
      this.FTodayFont.FOnChanged = rtl.createCallback(this,"FontChanged");
      this.FBadgeFont.FOnChanged = rtl.createCallback(this,"FontChanged");
      this.FFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FSelectedFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FDisabledFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FDateBeforeFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FDateAfterFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FTodayFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FBadgeFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FSelectedStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FDisabledStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FDateBeforeStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FDateAfterStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FTodayStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FBadgeStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FFill");
      rtl.free(this,"FStroke");
      rtl.free(this,"FFont");
      rtl.free(this,"FSelectedFill");
      rtl.free(this,"FSelectedStroke");
      rtl.free(this,"FSelectedFont");
      rtl.free(this,"FDisabledFill");
      rtl.free(this,"FDisabledStroke");
      rtl.free(this,"FDisabledFont");
      rtl.free(this,"FDateBeforeFill");
      rtl.free(this,"FDateBeforeFont");
      rtl.free(this,"FDateBeforeStroke");
      rtl.free(this,"FDateAfterFill");
      rtl.free(this,"FDateAfterFont");
      rtl.free(this,"FDateAfterStroke");
      rtl.free(this,"FTodayFill");
      rtl.free(this,"FTodayFont");
      rtl.free(this,"FTodayStroke");
      rtl.free(this,"FBadgeFill");
      rtl.free(this,"FBadgeFont");
      rtl.free(this,"FBadgeStroke");
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCCalendarDateAppearance.isPrototypeOf(Source)) {
        this.FFill.Assign(rtl.as(Source,$mod.TTMSFNCCalendarDateAppearance).FFill);
        this.FStroke.Assign(rtl.as(Source,$mod.TTMSFNCCalendarDateAppearance).FStroke);
        this.FFont.AssignSource(rtl.as(Source,$mod.TTMSFNCCalendarDateAppearance).FFont);
        this.FVerticalTextAlign = rtl.as(Source,$mod.TTMSFNCCalendarDateAppearance).FVerticalTextAlign;
        this.FHorizontalTextAlign = rtl.as(Source,$mod.TTMSFNCCalendarDateAppearance).FHorizontalTextAlign;
        this.FSelectedFill.Assign(rtl.as(Source,$mod.TTMSFNCCalendarDateAppearance).FSelectedFill);
        this.FSelectedStroke.Assign(rtl.as(Source,$mod.TTMSFNCCalendarDateAppearance).FSelectedStroke);
        this.FSelectedFont.AssignSource(rtl.as(Source,$mod.TTMSFNCCalendarDateAppearance).FSelectedFont);
        this.FSelectedVerticalTextAlign = rtl.as(Source,$mod.TTMSFNCCalendarDateAppearance).FSelectedVerticalTextAlign;
        this.FSelectedHorizontalTextAlign = rtl.as(Source,$mod.TTMSFNCCalendarDateAppearance).FSelectedHorizontalTextAlign;
        this.FDisabledFill.Assign(rtl.as(Source,$mod.TTMSFNCCalendarDateAppearance).FDisabledFill);
        this.FDisabledStroke.Assign(rtl.as(Source,$mod.TTMSFNCCalendarDateAppearance).FDisabledStroke);
        this.FDisabledFont.AssignSource(rtl.as(Source,$mod.TTMSFNCCalendarDateAppearance).FDisabledFont);
        this.FDateBeforeFill.Assign(rtl.as(Source,$mod.TTMSFNCCalendarDateAppearance).FDateBeforeFill);
        this.FDateBeforeFont.AssignSource(rtl.as(Source,$mod.TTMSFNCCalendarDateAppearance).FDateBeforeFont);
        this.FDateBeforeStroke.Assign(rtl.as(Source,$mod.TTMSFNCCalendarDateAppearance).FDateBeforeStroke);
        this.FDateAfterFill.Assign(rtl.as(Source,$mod.TTMSFNCCalendarDateAppearance).FDateAfterFill);
        this.FDateAfterFont.AssignSource(rtl.as(Source,$mod.TTMSFNCCalendarDateAppearance).FDateAfterFont);
        this.FDateAfterStroke.Assign(rtl.as(Source,$mod.TTMSFNCCalendarDateAppearance).FDateAfterStroke);
        this.FTodayFill.Assign(rtl.as(Source,$mod.TTMSFNCCalendarDateAppearance).FTodayFill);
        this.FTodayFont.AssignSource(rtl.as(Source,$mod.TTMSFNCCalendarDateAppearance).FTodayFont);
        this.FTodayStroke.Assign(rtl.as(Source,$mod.TTMSFNCCalendarDateAppearance).FTodayStroke);
        this.FBadgeFill.Assign(rtl.as(Source,$mod.TTMSFNCCalendarDateAppearance).FBadgeFill);
        this.FBadgeFont.AssignSource(rtl.as(Source,$mod.TTMSFNCCalendarDateAppearance).FBadgeFont);
        this.FBadgeStroke.Assign(rtl.as(Source,$mod.TTMSFNCCalendarDateAppearance).FBadgeStroke);
        this.FShowDaysBefore = rtl.as(Source,$mod.TTMSFNCCalendarDateAppearance).FShowDaysBefore;
        this.FShowDaysAfter = rtl.as(Source,$mod.TTMSFNCCalendarDateAppearance).FShowDaysAfter;
        this.FShowFocus = rtl.as(Source,$mod.TTMSFNCCalendarDateAppearance).FShowFocus;
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    var $r = this.$rtti;
    $r.addProperty("Fill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFill","SetFill");
    $r.addProperty("Font",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FFont","SetFont");
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
    $r.addProperty("VerticalTextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FVerticalTextAlign","SetVerticalTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter});
    $r.addProperty("HorizontalTextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FHorizontalTextAlign","SetHorizontalTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter});
    $r.addProperty("SelectedFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FSelectedFill","SetSelectedFill");
    $r.addProperty("SelectedFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FSelectedFont","SetSelectedFont");
    $r.addProperty("SelectedStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FSelectedStroke","SetSelectedStroke");
    $r.addProperty("SelectedVerticalTextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FSelectedVerticalTextAlign","SetSelectedVerticalTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter});
    $r.addProperty("SelectedHorizontalTextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FSelectedHorizontalTextAlign","SetSelectedHorizontalTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter});
    $r.addProperty("DisabledFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FDisabledFill","SetDisabledFill");
    $r.addProperty("DisabledFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FDisabledFont","SetDisabledFont");
    $r.addProperty("DisabledStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FDisabledStroke","SetDisabledStroke");
    $r.addProperty("ShowDaysBefore",2,rtl.boolean,"FShowDaysBefore","SetShowDaysBefore",4,{Default: false});
    $r.addProperty("ShowDaysAfter",2,rtl.boolean,"FShowDaysAfter","SetShowDaysAfter",4,{Default: false});
    $r.addProperty("DateBeforeFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FDateBeforeFill","SetDateBeforeFill");
    $r.addProperty("DateBeforeFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FDateBeforeFont","SetDateBeforeFont");
    $r.addProperty("DateBeforeStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FDateBeforeStroke","SetDateBeforeStroke");
    $r.addProperty("DateAfterFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FDateAfterFill","SetDateAfterFill");
    $r.addProperty("DateAfterFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FDateAfterFont","SetDateAfterFont");
    $r.addProperty("DateAfterStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FDateAfterStroke","SetDateAfterStroke");
    $r.addProperty("TodayFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FTodayFill","SetTodayFill");
    $r.addProperty("TodayFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FTodayFont","SetTodayFont");
    $r.addProperty("TodayStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FTodayStroke","SetTodayStroke");
    $r.addProperty("BadgeFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FBadgeFill","SetBadgeFill");
    $r.addProperty("BadgeFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FBadgeFont","SetBadgeFont");
    $r.addProperty("BadgeStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FBadgeStroke","SetBadgeStroke");
    $r.addProperty("ShowFocus",2,rtl.boolean,"FShowFocus","SetShowFocus",4,{Default: true});
  });
  rtl.createClass(this,"TTMSFNCCalendarLineAppearance",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FStroke = null;
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FStroke = undefined;
      this.FOnChange = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetStroke = function (Value) {
      if (this.FStroke !== Value) this.FStroke.Assign(Value);
    };
    this.Changed = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.StrokeChanged = function (Sender) {
      this.Changed();
    };
    this.Create$1 = function () {
      this.FStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,12632256,1.0]);
      this.FStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FStroke");
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCCalendarLineAppearance.isPrototypeOf(Source)) {
        this.FStroke.Assign(rtl.as(Source,$mod.TTMSFNCCalendarLineAppearance).FStroke)}
       else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    var $r = this.$rtti;
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
  });
  rtl.createClass(this,"TTMSFNCCalendarWeekNumberAppearance",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FOnChange = null;
      this.FVisible = false;
      this.FFont = null;
      this.FFill = null;
      this.FStroke = null;
      this.FVerticalTextAlign = 0;
      this.FHorizontalTextAlign = 0;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      this.FFont = undefined;
      this.FFill = undefined;
      this.FStroke = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetFill = function (Value) {
      if (this.FFill !== Value) this.FFill.Assign(Value);
    };
    this.SetFont = function (Value) {
      this.FFont.AssignSource(Value);
    };
    this.SetStroke = function (Value) {
      if (this.FStroke !== Value) this.FStroke.Assign(Value);
    };
    this.SetVisible = function (Value) {
      if (this.FVisible !== Value) {
        this.FVisible = Value;
        this.Changed();
      };
    };
    this.SetHorizontalTextAlign = function (Value) {
      if (this.FHorizontalTextAlign !== Value) {
        this.FHorizontalTextAlign = Value;
        this.Changed();
      };
    };
    this.SetVerticalTextAlign = function (Value) {
      if (this.FVerticalTextAlign !== Value) {
        this.FVerticalTextAlign = Value;
        this.Changed();
      };
    };
    this.Changed = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.FillChanged = function (Sender) {
      this.Changed();
    };
    this.FontChanged = function (Sender) {
      this.Changed();
    };
    this.StrokeChanged = function (Sender) {
      this.Changed();
    };
    this.Create$1 = function () {
      this.FVisible = false;
      this.FFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,-1,8421504,-1,-1]);
      this.FFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,-1,1.0]);
      this.FHorizontalTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      this.FVerticalTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      this.FFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FFont.FOnChanged = rtl.createCallback(this,"FontChanged");
      this.FStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FFill");
      rtl.free(this,"FFont");
      rtl.free(this,"FStroke");
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCCalendarWeekNumberAppearance.isPrototypeOf(Source)) {
        this.FVisible = rtl.as(Source,$mod.TTMSFNCCalendarWeekNumberAppearance).FVisible;
        this.FFill.Assign(rtl.as(Source,$mod.TTMSFNCCalendarWeekNumberAppearance).FFill);
        this.FStroke.Assign(rtl.as(Source,$mod.TTMSFNCCalendarWeekNumberAppearance).FStroke);
        this.FFont.AssignSource(rtl.as(Source,$mod.TTMSFNCCalendarWeekNumberAppearance).FFont);
        this.FHorizontalTextAlign = rtl.as(Source,$mod.TTMSFNCCalendarWeekNumberAppearance).FHorizontalTextAlign;
        this.FVerticalTextAlign = rtl.as(Source,$mod.TTMSFNCCalendarWeekNumberAppearance).FVerticalTextAlign;
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    var $r = this.$rtti;
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: false});
    $r.addProperty("Font",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FFont","SetFont");
    $r.addProperty("Fill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFill","SetFill");
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
    $r.addProperty("VerticalTextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FVerticalTextAlign","SetVerticalTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter});
    $r.addProperty("HorizontalTextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FHorizontalTextAlign","SetHorizontalTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter});
  });
  this.TTMSFNCCalendarNavigationMode = {"0": "nmMonth", nmMonth: 0, "1": "nmYear", nmYear: 1, "2": "nmFocusedDate", nmFocusedDate: 2, "3": "nmCustom", nmCustom: 3};
  this.$rtti.$Enum("TTMSFNCCalendarNavigationMode",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TTMSFNCCalendarNavigationMode});
  rtl.createClass(this,"TTMSFNCCalendarInteractionYearOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FItemsBeforeCurrentYear = 0;
      this.FItemsAfterCurrentYear = 0;
    };
    this.SetItemsAfterCurrentYear = function (Value) {
      if (this.FItemsAfterCurrentYear !== Value) {
        if (Value < 0) {
          this.FItemsAfterCurrentYear = 0}
         else this.FItemsAfterCurrentYear = Value;
      };
    };
    this.SetItemsBeforeCurrentYear = function (Value) {
      if (this.FItemsBeforeCurrentYear !== Value) {
        if (Value < 0) {
          this.FItemsBeforeCurrentYear = 0}
         else this.FItemsBeforeCurrentYear = Value;
      };
    };
    this.Create$1 = function () {
      this.FItemsBeforeCurrentYear = 5;
      this.FItemsAfterCurrentYear = 5;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCCalendarInteractionYearOptions.isPrototypeOf(Source)) {
        this.FItemsBeforeCurrentYear = rtl.as(Source,$mod.TTMSFNCCalendarInteractionYearOptions).FItemsBeforeCurrentYear;
        this.FItemsAfterCurrentYear = rtl.as(Source,$mod.TTMSFNCCalendarInteractionYearOptions).FItemsAfterCurrentYear;
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    var $r = this.$rtti;
    $r.addProperty("ItemsBeforeCurrentYear",2,rtl.longint,"FItemsBeforeCurrentYear","SetItemsBeforeCurrentYear",4,{Default: 5});
    $r.addProperty("ItemsAfterCurrentYear",2,rtl.longint,"FItemsAfterCurrentYear","SetItemsAfterCurrentYear",4,{Default: 5});
  });
  rtl.createClass(this,"TTMSFNCCalendarCustomInteraction",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FMultiSelect = false;
      this.FKeyboardSupport = false;
      this.FReadOnlyMode = false;
      this.FNavigationMode = 0;
      this.FSwipeOnHeader = false;
      this.FAllowMonthSelection = false;
      this.FAllowYearSelection = false;
      this.FYearOptions = null;
    };
    this.$final = function () {
      this.FYearOptions = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetKeyboardSupport = function (Value) {
      if (this.FKeyboardSupport !== Value) this.FKeyboardSupport = Value;
    };
    this.SetMultiSelect = function (Value) {
      if (this.FMultiSelect !== Value) this.FMultiSelect = Value;
    };
    this.SetReadOnlyMode = function (Value) {
      if (this.FReadOnlyMode !== Value) this.FReadOnlyMode = Value;
    };
    this.SetNavigationMode = function (Value) {
      if (this.FNavigationMode !== Value) this.FNavigationMode = Value;
    };
    this.SetSwipeOnHeader = function (Value) {
      if (this.FSwipeOnHeader !== Value) this.FSwipeOnHeader = Value;
    };
    this.SetAllowMonthSelection = function (Value) {
      if (this.FAllowMonthSelection !== Value) this.FAllowMonthSelection = Value;
    };
    this.SetAllowYearSelection = function (Value) {
      if (this.FAllowYearSelection !== Value) this.FAllowYearSelection = Value;
    };
    this.SetYearOptions = function (Value) {
      this.FYearOptions.Assign(Value);
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FKeyboardSupport = true;
      this.FMultiSelect = false;
      this.FReadOnlyMode = false;
      this.FNavigationMode = $mod.TTMSFNCCalendarNavigationMode.nmMonth;
      this.FSwipeOnHeader = false;
      this.FAllowMonthSelection = false;
      this.FAllowYearSelection = false;
      this.FYearOptions = $mod.TTMSFNCCalendarInteractionYearOptions.$create("Create$1");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FYearOptions");
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCCalendarCustomInteraction.isPrototypeOf(Source)) {
        this.FKeyboardSupport = rtl.as(Source,$mod.TTMSFNCCalendarCustomInteraction).FKeyboardSupport;
        this.FMultiSelect = rtl.as(Source,$mod.TTMSFNCCalendarCustomInteraction).FMultiSelect;
        this.FReadOnlyMode = rtl.as(Source,$mod.TTMSFNCCalendarCustomInteraction).FReadOnlyMode;
        this.FNavigationMode = rtl.as(Source,$mod.TTMSFNCCalendarCustomInteraction).FNavigationMode;
        this.FSwipeOnHeader = rtl.as(Source,$mod.TTMSFNCCalendarCustomInteraction).FSwipeOnHeader;
        this.FAllowYearSelection = rtl.as(Source,$mod.TTMSFNCCalendarCustomInteraction).FAllowYearSelection;
        this.FAllowMonthSelection = rtl.as(Source,$mod.TTMSFNCCalendarCustomInteraction).FAllowMonthSelection;
        this.FYearOptions.Assign(rtl.as(Source,$mod.TTMSFNCCalendarCustomInteraction).FYearOptions);
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
  });
  rtl.createClass(this,"TTMSFNCCalendarInteraction",this.TTMSFNCCalendarCustomInteraction,function () {
    var $r = this.$rtti;
    $r.addProperty("AllowYearSelection",2,rtl.boolean,"FAllowYearSelection","SetAllowYearSelection",4,{Default: false});
    $r.addProperty("AllowMonthSelection",2,rtl.boolean,"FAllowMonthSelection","SetAllowMonthSelection",4,{Default: false});
    $r.addProperty("YearOptions",2,$mod.$rtti["TTMSFNCCalendarInteractionYearOptions"],"FYearOptions","SetYearOptions");
    $r.addProperty("MultiSelect",2,rtl.boolean,"FMultiSelect","SetMultiSelect",4,{Default: false});
    $r.addProperty("KeyboardSupport",2,rtl.boolean,"FKeyboardSupport","SetKeyboardSupport",4,{Default: true});
    $r.addProperty("ReadOnlyMode",2,rtl.boolean,"FReadOnlyMode","SetReadOnlyMode",4,{Default: false});
    $r.addProperty("SwipeOnHeader",2,rtl.boolean,"FSwipeOnHeader","SetSwipeOnHeader",4,{Default: false});
    $r.addProperty("NavigationMode",2,$mod.$rtti["TTMSFNCCalendarNavigationMode"],"FNavigationMode","SetNavigationMode",4,{Default: $mod.TTMSFNCCalendarNavigationMode.nmMonth});
  });
  rtl.createClass(this,"TTMSFNCCalendarDateItem",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FDate = 0.0;
    };
    this.SetDate = function (Value) {
      if (this.FDate !== Value) {
        this.FDate = Value;
        this.Update();
      };
    };
    this.Update = function () {
      this.FCollection.Update(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCCalendarDateItem.isPrototypeOf(Source)) {
        this.FDate = rtl.as(Source,$mod.TTMSFNCCalendarDateItem).FDate}
       else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    var $r = this.$rtti;
    $r.addProperty("Date",2,pas.System.$rtti["TDate"],"FDate","SetDate");
  });
  rtl.createClass(this,"TTMSFNCCalendarDates",pas.Classes.TCollection,function () {
    this.$init = function () {
      pas.Classes.TCollection.$init.call(this);
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      pas.Classes.TCollection.$final.call(this);
    };
    this.SetItem$1 = function (Index, Value) {
      this.SetItem(Index,Value);
    };
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.DoChange = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Update = function (Item) {
      pas.Classes.TCollection.Update.apply(this,arguments);
      this.DoChange();
    };
    this.SelectDate = function (ADate) {
      var DateToAdd = null;
      DateToAdd = this.Add$1();
      DateToAdd.SetDate(ADate);
    };
    this.SelectDateInterval = function (ADateFrom, ADateTo) {
      var I = 0;
      var IDate = 0.0;
      this.SelectDate(ADateFrom);
      IDate = ADateFrom;
      if (pas.DateUtils.CompareDate(ADateFrom,ADateTo) === -1) {
        for (var $l = 0, $end = pas.DateUtils.DaysBetween(ADateFrom,ADateTo) - 1; $l <= $end; $l++) {
          I = $l;
          IDate = pas.DateUtils.IncDay(IDate,1);
          this.SelectDate(IDate);
        };
      };
      if (pas.DateUtils.CompareDate(ADateTo,ADateFrom) === -1) {
        for (var $l1 = 0, $end1 = pas.DateUtils.DaysBetween(ADateTo,ADateFrom) - 1; $l1 <= $end1; $l1++) {
          I = $l1;
          IDate = pas.DateUtils.IncDay(IDate,-1);
          this.SelectDate(IDate);
        };
      };
    };
    this.UnselectDate = function (ADate) {
      var I = 0;
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (this.GetItem$1(I).FDate === ADate) {
          this.Delete(I);
          return;
        };
      };
    };
    this.UnselectAll = function () {
      this.Clear();
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.InCollection = function (ADate) {
      var Result = false;
      var I = 0;
      Result = false;
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (pas.DateUtils.CompareDate(this.GetItem$1(I).FDate,ADate) === 0) {
          Result = true;
          break;
        };
      };
      return Result;
    };
  });
  rtl.createClass(this,"TTMSFNCCalendarEventItem",this.TTMSFNCCalendarDateItem,function () {
    this.$init = function () {
      $mod.TTMSFNCCalendarDateItem.$init.call(this);
      this.FHint = "";
      this.FBadgeValue = 0;
      this.FBadgeColor = 0;
      this.FShowBadge = false;
      this.FBadgeFontColor = 0;
    };
    this.SetBadgeColor = function (Value) {
      if (this.FBadgeColor !== Value) {
        this.FBadgeColor = Value;
        this.Update$1();
      };
    };
    this.SetBadgeFontColor = function (Value) {
      if (this.FBadgeFontColor !== Value) {
        this.FBadgeFontColor = Value;
        this.Update$1();
      };
    };
    this.SetBadgeValue = function (Value) {
      if (this.FBadgeValue !== Value) {
        this.FBadgeValue = Value;
        this.Update$1();
      };
    };
    this.SetHint = function (Value) {
      if (this.FHint !== Value) {
        this.FHint = Value;
        this.Update$1();
      };
    };
    this.SetShowBadge = function (Value) {
      if (this.FShowBadge !== Value) {
        this.FShowBadge = Value;
        this.Update$1();
      };
    };
    this.IsHintStored = function () {
      var Result = false;
      Result = this.FHint !== "";
      return Result;
    };
    this.Update$1 = function () {
      this.FCollection.Update(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCCalendarEventItem.isPrototypeOf(Source)) {
        this.FBadgeColor = rtl.as(Source,$mod.TTMSFNCCalendarEventItem).FBadgeColor;
        this.FBadgeFontColor = rtl.as(Source,$mod.TTMSFNCCalendarEventItem).FBadgeFontColor;
        this.FBadgeValue = rtl.as(Source,$mod.TTMSFNCCalendarEventItem).FBadgeValue;
        this.FHint = rtl.as(Source,$mod.TTMSFNCCalendarEventItem).FHint;
        this.FShowBadge = rtl.as(Source,$mod.TTMSFNCCalendarEventItem).FShowBadge;
        this.FDate = rtl.as(Source,$mod.TTMSFNCCalendarEventItem).FDate;
      } else $mod.TTMSFNCCalendarDateItem.Assign.apply(this,arguments);
    };
    this.Create$1 = function (ACollection) {
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      this.FShowBadge = true;
      this.FBadgeColor = -1;
      this.FBadgeFontColor = -1;
      this.SetDate(pas.SysUtils.Now());
      return this;
    };
    var $r = this.$rtti;
    $r.addProperty("BadgeValue",2,rtl.longint,"FBadgeValue","SetBadgeValue",4,{Default: 0});
    $r.addProperty("ShowBadge",2,rtl.boolean,"FShowBadge","SetShowBadge",4,{Default: true});
    $r.addProperty("BadgeFontColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FBadgeFontColor","SetBadgeFontColor",4,{Default: -1});
    $r.addProperty("BadgeColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FBadgeColor","SetBadgeColor",4,{Default: -1});
    $r.addProperty("Hint",14,rtl.string,"FHint","SetHint",4,{stored: "IsHintStored"});
  });
  rtl.createClass(this,"TTMSFNCCalendarEvents",this.TTMSFNCCalendarDates,function () {
    this.SetItem$2 = function (Index, Value) {
      this.SetItem$1(Index,Value);
    };
    this.GetItem$2 = function (Index) {
      var Result = null;
      Result = this.GetItem$1(Index);
      return Result;
    };
    this.Add$2 = function () {
      var Result = null;
      Result = $mod.TTMSFNCCalendarDates.Add$1.call(this);
      return Result;
    };
    this.GetEventCollectionItemByDate = function (ADate) {
      var Result = null;
      var I = 0;
      Result = null;
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (pas.DateUtils.CompareDate(this.GetItem$2(I).FDate,ADate) === 0) {
          Result = this.GetItem$2(I);
          return Result;
        };
      };
      return Result;
    };
  });
  rtl.createClass(this,"TTMSFNCCalendarPopupBox",pas.Classes.TComponent,function () {
    this.$init = function () {
      pas.Classes.TComponent.$init.call(this);
      this.FPaintScale = 0.0;
      this.FPopup = null;
      this.FItems = null;
      this.FItemIndex = 0;
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FPopup = undefined;
      this.FItems = undefined;
      this.FOnChange = undefined;
      pas.Classes.TComponent.$final.call(this);
    };
    this.SetItemIndex = function (Value) {
      if (this.FItemIndex !== Value) {
        this.FItemIndex = Value;
      };
    };
    this.SetItems = function (Value) {
      this.FItems.Assign(Value);
    };
    this.DoMenuItemClick = function (Sender) {
      this.SetItemIndex(Sender.FTag);
      this.DoChange();
    };
    this.DoPopup = function (ALeft, ATop) {
      var mi = null;
      var I = 0;
      this.FPopup.FItems.Clear();
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        mi = pas["WEBLib.Menus"].TMenuItem.$create("Create$1",[this.FPopup]);
        mi.FOnClick = rtl.createCallback(this,"DoMenuItemClick");
        mi.FTag = I;
        mi.SetName("MenuItem" + this.FItems.Get(I));
        mi.SetCaption(this.FItems.Get(I));
        mi.FAutoCheck = true;
        mi.FRadioItem = true;
        mi.SetChecked(I === this.FItemIndex);
        this.FPopup.FItems.Add(mi);
      };
      if (this.FItems.GetCount() > 0) this.FPopup.Popup(Math.round(ALeft),Math.round(ATop - (15 * this.FPaintScale)));
    };
    this.DoChange = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Create$2 = function (AOwner) {
      pas.Classes.TComponent.Create$1.call(this,AOwner);
      this.FPopup = pas["WEBLib.Menus"].TWebPopupMenu.$create("Create$1",[pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetParentForm(AOwner)]);
      this.FPopup.SetParent(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetParentForm(AOwner));
      this.FItems = pas.Classes.TStringList.$create("Create$1");
      this.FPaintScale = 1;
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FPopup");
      rtl.free(this,"FItems");
      pas.Classes.TComponent.Destroy.call(this);
    };
    this.SetPaintScale = function (AValue) {
      this.FPaintScale = AValue;
    };
    this.Popup = function (APoint) {
      this.DoPopup(APoint.X,APoint.Y);
    };
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.$rtti.$MethodVar("TTMSFNCCalendarBeforeDrawHeaderEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AAllow",rtl.boolean,1],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarAfterDrawHeaderEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarBeforeDrawHeaderTextEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AText",rtl.string],["AHorizontalTextAlign",pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"]],["AVerticalTextAlign",pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"]],["AAllow",rtl.boolean,1],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarAfterDrawHeaderTextEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AText",rtl.string],["AHorizontalTextAlign",pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"]],["AVerticalTextAlign",pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarBeforeDrawFooterEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARectF",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AAllow",rtl.boolean,1],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarAfterDrawFooterEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARectF",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarBeforeDrawFooterTextEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AText",rtl.string],["AHorizontalTextAlign",pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"]],["AVerticalTextAlign",pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"]],["AAllow",rtl.boolean,1],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarAfterDrawFooterTextEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AText",rtl.string],["AHorizontalTextAlign",pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"]],["AVerticalTextAlign",pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarBeforeDrawDayNamesEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AAllow",rtl.boolean,1],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarAfterDrawDayNamesEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarBeforeDrawDayNamesTextEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AText",rtl.string],["AHorizontalTextAlign",pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"]],["AVerticalTextAlign",pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"]],["AAllow",rtl.boolean,1],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarAfterDrawDayNamesTextEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AText",rtl.string],["AHorizontalTextAlign",pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"]],["AVerticalTextAlign",pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarBeforeDrawDayNumbersEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["ADate",pas.System.$rtti["TDate"]],["AAllow",rtl.boolean,1],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarAfterDrawDayNumbersEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["ADate",pas.System.$rtti["TDate"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarBeforeDrawDayNumbersTextEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AText",rtl.string],["AHorizontalTextAlign",pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"]],["AVerticalTextAlign",pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"]],["AAllow",rtl.boolean,1],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarAfterDrawDayNumbersTextEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AText",rtl.string],["AHorizontalTextAlign",pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"]],["AVerticalTextAlign",pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarBeforeDrawLinesEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["AAllow",rtl.boolean,1],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarAfterDrawLinesEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarBeforeDrawWeekNumbersEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AAllow",rtl.boolean,1],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarAfterDrawWeekNumbersEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarBeforeDrawWeekNumbersTextEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AText",rtl.string],["AHorizontalTextAlign",pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"]],["AVerticalTextAlign",pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"]],["AAllow",rtl.boolean,1],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarAfterDrawWeekNumbersTextEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AText",rtl.string],["AHorizontalTextAlign",pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"]],["AVerticalTextAlign",pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarBeforeDrawBadgeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["ABadge",this.$rtti["TTMSFNCCalendarEventItem"]],["AAllow",rtl.boolean,1],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarAfterDrawBadgeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["ABadge",this.$rtti["TTMSFNCCalendarEventItem"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarBeforeDrawArrowLeftEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["AArrowRect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AAllow",rtl.boolean,1],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarAfterDrawArrowLeftEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["AArrowRect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarBeforeDrawArrowRightEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["AArrowRect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AAllow",rtl.boolean,1],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarAfterDrawArrowRightEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["AArrowRect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarBeforeSelectDateEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ADate",pas.System.$rtti["TDate"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarSelectedDateEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ADate",pas.System.$rtti["TDate"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarSelectedMultiDateEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AStartDate",pas.System.$rtti["TDate"]],["AEndDate",pas.System.$rtti["TDate"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarYearChangedEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AYear",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarMonthChangedEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AMonth",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarCustomNavigationEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ADate",pas.System.$rtti["TDate"]],["AFocusedDate",pas.System.$rtti["TDate"]],["ADirection",rtl.boolean]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarCustomArrowDrawEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["ADirection",rtl.boolean]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarCustomNavigateEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AMonth",rtl.longint],["AYear",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarShowPopupEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AAllow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarYearPopupValueSelected",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AItemIndex",rtl.longint],["AYear",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCalendarMonthPopupValueSelected",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AItemIndex",rtl.longint],["AMonth",rtl.longint],["AMonthValue",rtl.string]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCCustomCalendar",pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$init.call(this);
      this.FDay = 0;
      this.FMonth = 0;
      this.FYear = 0;
      this.FBitmapContainer = null;
      this.FNumOfWeeksDrawn = 0;
      this.FWeekNumberAppearance = null;
      this.FFirstDay = 0;
      this.FHeader = null;
      this.FFooter = null;
      this.FDayNameAppearance = null;
      this.FDateAppearance = null;
      this.FLineAppearance = null;
      this.FXOffset = 0.0;
      this.FYOffset = 0.0;
      this.FDateAreaHeight = 0.0;
      this.FMx = 0.0;
      this.FMy = 0.0;
      this.FTick = 0;
      this.FSelectedDates = null;
      this.FEvents = null;
      this.FBadgeSize = 0;
      this.FMouseDown = false;
      this.FShiftPressed = false;
      this.FSelectedAll = false;
      this.FDate = 0.0;
      this.FMaxDate = 0.0;
      this.FMinDate = 0.0;
      this.FClickedDate = 0.0;
      this.FMouseAtDate = 0.0;
      this.FFocusedDate = 0.0;
      this.FHoverDate = 0.0;
      this.FOnChange = null;
      this.FMonthPopupOpens = false;
      this.FYearPopupOpens = false;
      this.FOnBeforeDrawHeader = null;
      this.FOnAfterDrawDayNames = null;
      this.FOnAfterDrawHeader = null;
      this.FOnBeforeDrawDayNames = null;
      this.FOnAfterDrawHeaderText = null;
      this.FOnBeforeDrawHeaderText = null;
      this.FOnAfterDrawDayNamesText = null;
      this.FOnBeforeDrawDayNamesText = null;
      this.FOnAfterDrawWeekNumbersText = null;
      this.FOnBeforeDrawDayNumbersText = null;
      this.FOnBeforeDrawLines = null;
      this.FOnAfterDrawWeekNumbers = null;
      this.FOnBeforeDrawDayNumbers = null;
      this.FOnAfterDrawDayNumbersText = null;
      this.FOnBeforeDrawWeekNumbersText = null;
      this.FOnAfterDrawLines = null;
      this.FOnAfterDrawDayNumbers = null;
      this.FOnBeforeDrawWeekNumbers = null;
      this.FInteraction = null;
      this.FOnYearChanged = null;
      this.FOnSelectDate = null;
      this.FOnMonthChanged = null;
      this.FOnSelectMultiDate = null;
      this.FOnBeforeSelectDate = null;
      this.FOnBeforeDrawFooterText = null;
      this.FOnBeforeDrawFooter = null;
      this.FOnAfterDrawFooterText = null;
      this.FOnAfterDrawFooter = null;
      this.FOnCustomNavigation = null;
      this.FOnAfterDrawBadge = null;
      this.FOnBeforeDrawBadge = null;
      this.FOnCustomArrowDraw = null;
      this.FOnAfterDrawArrowRight = null;
      this.FOnBeforeDrawArrowLeft = null;
      this.FOnBeforeDrawArrowRight = null;
      this.FOnAfterDrawArrowLeft = null;
      this.FOnNavigateBack = null;
      this.FOnNavigateForward = null;
      this.FOnNavigateFooter = null;
      this.FGlobalFont = null;
      this.FMonthsPopup = null;
      this.FYearsPopup = null;
      this.FOnBeforeShowMonthPopup = null;
      this.FOnBeforeShowYearPopup = null;
      this.FOnYearPopupValueSelected = null;
      this.FOnMonthPopupValueSelected = null;
    };
    this.$final = function () {
      this.FBitmapContainer = undefined;
      this.FWeekNumberAppearance = undefined;
      this.FHeader = undefined;
      this.FFooter = undefined;
      this.FDayNameAppearance = undefined;
      this.FDateAppearance = undefined;
      this.FLineAppearance = undefined;
      this.FSelectedDates = undefined;
      this.FEvents = undefined;
      this.FOnChange = undefined;
      this.FOnBeforeDrawHeader = undefined;
      this.FOnAfterDrawDayNames = undefined;
      this.FOnAfterDrawHeader = undefined;
      this.FOnBeforeDrawDayNames = undefined;
      this.FOnAfterDrawHeaderText = undefined;
      this.FOnBeforeDrawHeaderText = undefined;
      this.FOnAfterDrawDayNamesText = undefined;
      this.FOnBeforeDrawDayNamesText = undefined;
      this.FOnAfterDrawWeekNumbersText = undefined;
      this.FOnBeforeDrawDayNumbersText = undefined;
      this.FOnBeforeDrawLines = undefined;
      this.FOnAfterDrawWeekNumbers = undefined;
      this.FOnBeforeDrawDayNumbers = undefined;
      this.FOnAfterDrawDayNumbersText = undefined;
      this.FOnBeforeDrawWeekNumbersText = undefined;
      this.FOnAfterDrawLines = undefined;
      this.FOnAfterDrawDayNumbers = undefined;
      this.FOnBeforeDrawWeekNumbers = undefined;
      this.FInteraction = undefined;
      this.FOnYearChanged = undefined;
      this.FOnSelectDate = undefined;
      this.FOnMonthChanged = undefined;
      this.FOnSelectMultiDate = undefined;
      this.FOnBeforeSelectDate = undefined;
      this.FOnBeforeDrawFooterText = undefined;
      this.FOnBeforeDrawFooter = undefined;
      this.FOnAfterDrawFooterText = undefined;
      this.FOnAfterDrawFooter = undefined;
      this.FOnCustomNavigation = undefined;
      this.FOnAfterDrawBadge = undefined;
      this.FOnBeforeDrawBadge = undefined;
      this.FOnCustomArrowDraw = undefined;
      this.FOnAfterDrawArrowRight = undefined;
      this.FOnBeforeDrawArrowLeft = undefined;
      this.FOnBeforeDrawArrowRight = undefined;
      this.FOnAfterDrawArrowLeft = undefined;
      this.FOnNavigateBack = undefined;
      this.FOnNavigateForward = undefined;
      this.FOnNavigateFooter = undefined;
      this.FGlobalFont = undefined;
      this.FMonthsPopup = undefined;
      this.FYearsPopup = undefined;
      this.FOnBeforeShowMonthPopup = undefined;
      this.FOnBeforeShowYearPopup = undefined;
      this.FOnYearPopupValueSelected = undefined;
      this.FOnMonthPopupValueSelected = undefined;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$final.call(this);
    };
    this.SetDay = function (Value) {
      if (this.FDay !== Value) {
        this.FDay = Value;
        this.FDate = pas.SysUtils.EncodeDate(pas.DateUtils.YearOf(this.FDate),pas.DateUtils.MonthOf(this.FDate),this.FDay);
        this.Invalidate();
      };
    };
    this.SetMonth = function (Value) {
      if (this.FMonth !== Value) {
        this.FMonth = Value;
        this.FDate = pas.SysUtils.EncodeDate(pas.DateUtils.YearOf(this.FDate),this.FMonth,pas.DateUtils.DayOf(this.FDate));
        this.Invalidate();
      };
    };
    this.SetYear = function (Value) {
      if (this.FYear !== Value) {
        this.FYear = Value;
        this.FDate = pas.SysUtils.EncodeDate(this.FYear,pas.DateUtils.MonthOf(this.FDate),pas.DateUtils.DayOf(this.FDate));
        this.Invalidate();
      };
    };
    this.SetFirstDay = function (Value) {
      if (this.FFirstDay !== Value) {
        this.FFirstDay = Value;
        this.Invalidate();
      };
    };
    this.SetHeader = function (Value) {
      this.FHeader.Assign(Value);
    };
    this.IncrementCell = function (ACellSide, AMoveBy) {
      ACellSide.set(ACellSide.get() + AMoveBy);
    };
    this.ShiftCellH = function (ACell, AMoveBy) {
      this.IncrementCell({p: ACell, get: function () {
          return this.p.Left;
        }, set: function (v) {
          this.p.Left = v;
        }},AMoveBy);
      this.IncrementCell({p: ACell, get: function () {
          return this.p.Right;
        }, set: function (v) {
          this.p.Right = v;
        }},AMoveBy);
    };
    this.ShiftCellV = function (ACell, AMoveBy) {
      this.IncrementCell({p: ACell, get: function () {
          return this.p.Top;
        }, set: function (v) {
          this.p.Top = v;
        }},AMoveBy);
      this.IncrementCell({p: ACell, get: function () {
          return this.p.Bottom;
        }, set: function (v) {
          this.p.Bottom = v;
        }},AMoveBy);
    };
    this.IncrementWeekDay = function (ADay) {
      ADay.set((ADay.get() + 1) % 7);
      if (ADay.get() === 0) ADay.set(7);
    };
    this.SetDateForward = function (ADate, ASetBy) {
      ADate.set(pas.DateUtils.IncDay(ADate.get(),ASetBy));
      if (pas.DateUtils.YearOf(ADate.get()) > this.FYear) {
        this.DoChangeYear(this.FYear);
        this.DoChangeMonth(this.FMonth);
      } else if (pas.DateUtils.MonthOf(ADate.get()) > this.FMonth) {
        this.DoChangeMonth(this.FMonth);
      };
      this.SetDate(ADate.get());
    };
    this.SetDateBackward = function (ADate, ASetBy) {
      ADate.set(pas.DateUtils.IncDay(ADate.get(),ASetBy));
      if (pas.DateUtils.YearOf(ADate.get()) < this.FYear) {
        this.DoChangeYear(this.FYear);
        this.DoChangeMonth(this.FMonth);
      } else if (pas.DateUtils.MonthOf(ADate.get()) < this.FMonth) {
        this.DoChangeMonth(this.FMonth);
      };
      this.SetDate(ADate.get());
    };
    this.SetDayNameAppearance = function (Value) {
      this.FDayNameAppearance.Assign(Value);
    };
    this.SetDateAppearance = function (Value) {
      this.FDateAppearance.Assign(Value);
    };
    this.SetLineAppearance = function (Value) {
      this.FLineAppearance.Assign(Value);
    };
    this.SetWeekNumberAppearance = function (Value) {
      this.FWeekNumberAppearance.Assign(Value);
      this.Invalidate();
    };
    this.SetArrowLeftRect = function (AHeaderRect, AArrowRect, ACentre) {
      var $tmp = this.FHeader.FArrow.FArrowLeftType;
      if (($tmp === $mod.TTMSFNCCalendarArrowType.atTriangle) || ($tmp === $mod.TTMSFNCCalendarArrowType.atArrow) || ($tmp === $mod.TTMSFNCCalendarArrowType.atCustom)) {
        AArrowRect.Top = ACentre - (this.FHeader.FArrow.FSize / 2);
        AArrowRect.Bottom = ACentre + (this.FHeader.FArrow.FSize / 2);
        AArrowRect.Right = AHeaderRect.Left + this.FHeader.FArrow.FSize + 8;
      } else if ($tmp === $mod.TTMSFNCCalendarArrowType.atBitmap) {
        AArrowRect.Top = ACentre - (this.FHeader.FArrow.FArrowLeftBitmapSize / 2);
        AArrowRect.Bottom = ACentre + (this.FHeader.FArrow.FArrowLeftBitmapSize / 2);
        AArrowRect.Right = AHeaderRect.Left + this.FHeader.FArrow.FArrowLeftBitmapSize + 8;
      };
      AArrowRect.Left = AHeaderRect.Left + 8;
    };
    this.SetArrowRightRect = function (AHeaderRect, AArrowRect, ACentre) {
      var $tmp = this.FHeader.FArrow.FArrowRightType;
      if (($tmp === $mod.TTMSFNCCalendarArrowType.atTriangle) || ($tmp === $mod.TTMSFNCCalendarArrowType.atArrow) || ($tmp === $mod.TTMSFNCCalendarArrowType.atCustom)) {
        AArrowRect.Top = ACentre - (this.FHeader.FArrow.FSize / 2);
        AArrowRect.Bottom = ACentre + (this.FHeader.FArrow.FSize / 2);
        AArrowRect.Left = AHeaderRect.Right - 8 - this.FHeader.FArrow.FSize;
      } else if ($tmp === $mod.TTMSFNCCalendarArrowType.atBitmap) {
        AArrowRect.Top = ACentre - (this.FHeader.FArrow.FArrowRightBitmapSize / 2);
        AArrowRect.Bottom = ACentre + (this.FHeader.FArrow.FArrowRightBitmapSize / 2);
        AArrowRect.Left = AHeaderRect.Right - 8 - this.FHeader.FArrow.FArrowRightBitmapSize;
      };
      AArrowRect.Right = AHeaderRect.Right - 8;
    };
    this.SetFocusedDate = function (Value) {
      if (this.FFocusedDate !== Value) this.FFocusedDate = Value;
    };
    this.SetDate = function (Value) {
      if (this.FDate !== Value) {
        this.FDate = Value;
        this.FDay = pas.DateUtils.DayOf(this.FDate);
        this.FMonth = pas.DateUtils.MonthOf(this.FDate);
        this.FYear = pas.DateUtils.YearOf(this.FDate);
      };
    };
    this.SetInteraction = function (Value) {
      this.FInteraction.Assign(Value);
    };
    this.SetMaxDate = function (Value) {
      if (this.FMaxDate !== Value) {
        this.FMaxDate = Value;
        this.Changed();
      };
    };
    this.SetMinDate = function (Value) {
      if (this.FMinDate !== Value) {
        this.FMinDate = Value;
        this.Changed();
      };
    };
    this.SetFooter = function (Value) {
      this.FFooter.Assign(Value);
    };
    this.SetBitmapContainer = function (Value) {
      this.FBitmapContainer = Value;
      this.Invalidate();
    };
    this.SetBadgeSize = function (Value) {
      if (this.FBadgeSize !== Value) this.FBadgeSize = Value;
    };
    this.SetEvents = function (Value) {
      this.FEvents.Assign(Value);
    };
    this.ColCount = function (AShowWeeks) {
      var Result = 0;
      if (AShowWeeks) {
        Result = 8}
       else Result = 7;
      return Result;
    };
    this.CalcRowCount = function (ACol, ADaysInAMonth) {
      var Result = 0;
      Result = pas.Math.Ceil((ADaysInAMonth + ACol) / 7);
      return Result;
    };
    this.CalcDateAreaHeight = function (AHeight, AHeaderVisible, AFooterVisible) {
      var Result = 0.0;
      var h = 0.0;
      h = AHeight;
      if (AHeaderVisible) h = h - this.FHeader.FHeight;
      if (AFooterVisible) h = h - this.FFooter.FHeight;
      h = h - this.FDayNameAppearance.FHeight;
      Result = h;
      return Result;
    };
    this.GetArrowRect = function (ALeft) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var hHeight = 0.0;
      var s = 0.0;
      hHeight = this.FHeader.FHeight;
      s = 0;
      if (ALeft) {
        var $tmp = this.FHeader.FArrow.FArrowLeftType;
        if (($tmp === $mod.TTMSFNCCalendarArrowType.atTriangle) || ($tmp === $mod.TTMSFNCCalendarArrowType.atArrow) || ($tmp === $mod.TTMSFNCCalendarArrowType.atCustom)) {
          s = this.FHeader.FArrow.FSize}
         else if ($tmp === $mod.TTMSFNCCalendarArrowType.atBitmap) s = this.FHeader.FArrow.FArrowLeftBitmapSize;
        rect.Top = (hHeight / 2) - (s / 2);
        rect.Bottom = (hHeight / 2) + (s / 2);
        rect.Left = 8;
        rect.Right = 8 + s;
      } else {
        var $tmp1 = this.FHeader.FArrow.FArrowRightType;
        if (($tmp1 === $mod.TTMSFNCCalendarArrowType.atTriangle) || ($tmp1 === $mod.TTMSFNCCalendarArrowType.atArrow) || ($tmp1 === $mod.TTMSFNCCalendarArrowType.atCustom)) {
          s = this.FHeader.FArrow.FSize}
         else if ($tmp1 === $mod.TTMSFNCCalendarArrowType.atBitmap) s = this.FHeader.FArrow.FArrowRightBitmapSize;
        rect.Top = (hHeight / 2) - (s / 2);
        rect.Bottom = (hHeight / 2) + (s / 2);
        rect.Left = this.GetWidth() - 8 - s;
        rect.Right = this.GetWidth() - 8;
      };
      Result.$assign(rect);
      return Result;
    };
    this.GetMonthYearRect = function (AControl, AMonthRect, AYearRect) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var g = null;
      var sAll = "";
      var sYear = "";
      r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(AControl.Left,AControl.Top,AControl.Right,AControl.Top + this.FHeader.FHeight));
      sAll = pas.SysUtils.FormatSettings.ShortMonthNames[this.FMonth - 1] + " " + pas.SysUtils.IntToStr(this.FYear);
      sYear = pas.SysUtils.IntToStr(this.FYear);
      g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("Create$1",[this.GetCanvas(),false]);
      try {
        g.FFont.Assign(this.FHeader.FFont);
        AMonthRect.$assign(g.CalculateText(sAll,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),false,true));
        pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(AMonthRect,((r.Right - r.Left - AMonthRect.Right) + AMonthRect.Left) / 2,((this.FHeader.FHeight - AMonthRect.Bottom) + AMonthRect.Top) / 2);
        AYearRect.$assign(g.CalculateText(sYear,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),false,true));
        AMonthRect.Right = (AMonthRect.Right - AYearRect.Right) + AYearRect.Left;
        pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(AYearRect,AMonthRect.Right - AYearRect.Left,((this.FHeader.FHeight - AYearRect.Bottom) + AYearRect.Top) / 2);
      } finally {
        g = rtl.freeLoc(g);
      };
    };
    this.GetFooterTextRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var l = 0.0;
      var t = 0.0;
      var r = 0.0;
      var b = 0.0;
      var fHeight = 0.0;
      var fWidth = 0.0;
      l = 0;
      t = 0;
      fHeight = this.FFooter.FCaptionRect.Bottom;
      fWidth = this.FFooter.FCaptionRect.Right;
      var $tmp = this.FFooter.FHorizontalTextAlign;
      if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter) {
        l = (this.GetWidth() / 2) - (fWidth / 2)}
       else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading) {
        l = this.FFooter.FCaptionRect.Left}
       else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaTrailing) l = this.GetWidth() - fWidth;
      var $tmp1 = this.FFooter.FVerticalTextAlign;
      if ($tmp1 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter) {
        t = this.GetHeight() - (this.FFooter.FHeight / 2) - (fHeight / 2)}
       else if ($tmp1 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading) {
        t = this.FFooter.FCaptionRect.Top}
       else if ($tmp1 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaTrailing) t = this.GetHeight() - fHeight;
      b = t + fHeight;
      r = l + fWidth;
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(l,t,r,b));
      return Result;
    };
    this.PointInRect = function (ARect, APoint) {
      var Result = false;
      Result = (ARect.Left <= APoint.X) && (ARect.Right >= APoint.X) && (ARect.Top <= APoint.Y) && (ARect.Bottom >= APoint.Y);
      return Result;
    };
    this.IsMaxDateStored = function () {
      var Result = false;
      Result = this.FMaxDate !== 0.0;
      return Result;
    };
    this.IsMinDateStored = function () {
      var Result = false;
      Result = this.FMinDate !== 0.0;
      return Result;
    };
    this.GetCurrentDate = function () {
      var Result = 0.0;
      Result = pas.SysUtils.Now();
      return Result;
    };
    this.GetBitmapContainer = function () {
      var Result = null;
      Result = this.FBitmapContainer;
      return Result;
    };
    this.IsFocusedDateStored = function () {
      var Result = false;
      Result = this.FFocusedDate !== 0.0;
      return Result;
    };
    this.SetGlobalFont = function (Value) {
      this.FGlobalFont.Assign(Value);
    };
    this.GetMonthsPopup = function () {
      var Result = null;
      if (!(this.FMonthsPopup != null)) {
        this.FMonthsPopup = $mod.TTMSFNCCalendarPopupBox.$create("Create$2",[this]);
        this.FMonthsPopup.FOnChange = rtl.createCallback(this,"DoPopupMonthsChange");
      };
      Result = this.FMonthsPopup;
      return Result;
    };
    this.GetYearsPopup = function () {
      var Result = null;
      if (!(this.FYearsPopup != null)) {
        this.FYearsPopup = $mod.TTMSFNCCalendarPopupBox.$create("Create$2",[this]);
        this.FYearsPopup.FOnChange = rtl.createCallback(this,"DoPopupYearsChange");
      };
      Result = this.FYearsPopup;
      return Result;
    };
    this.ApplyStyle = function () {
      var c = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ApplyStyle.call(this);
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleBackgroundFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FFill.SetColor(c);
        this.FDateAppearance.FFill.SetColor(c);
        this.FDateAppearance.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
        this.FDateAppearance.FDateAfterFill.SetColor(c);
        this.FDateAppearance.FDateAfterStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
        this.FDateAppearance.FDateBeforeFill.SetColor(c);
        this.FDateAppearance.FDateBeforeStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
        this.FDateAppearance.FDisabledFill.SetColor(c);
        this.FDateAppearance.FDisabledStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
        this.FDateAppearance.FTodayFill.SetColor(c);
        this.FDateAppearance.FTodayStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
        this.FWeekNumberAppearance.FFill.SetColor(c);
        this.FWeekNumberAppearance.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
        this.FDayNameAppearance.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
        this.FDayNameAppearance.FFill.SetColor(c);
      };
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleSelectionFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FDateAppearance.FSelectedFill.SetColor(c);
        this.FDateAppearance.FSelectedStroke.SetColor(c);
      };
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleLineFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FStroke.SetColor(c);
        this.FHeader.FStroke.SetColor(c);
        this.FFooter.FStroke.SetColor(c);
        this.FLineAppearance.FStroke.SetColor(c);
        this.FHeader.FArrow.SetColor(c);
      };
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleHeaderFillColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FHeader.FFill.SetColor(c);
        this.FFooter.FFill.SetColor(c);
      };
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleHeaderFillColorTo({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        this.FHeader.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient);
        this.FHeader.FFill.SetColorTo(c);
        this.FFooter.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient);
        this.FFooter.FFill.SetColorTo(c);
      };
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleSelectionFillColorTo({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) this.FDateAppearance.FTodayFont.SetColor(c);
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleTextFontColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) {
        if (c === 0) {
          this.FDateAppearance.FDateAfterFont.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(c,50));
          this.FDateAppearance.FDateBeforeFont.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(c,50));
          this.FDateAppearance.FDisabledFont.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(c,75));
        } else {
          this.FDateAppearance.FDateAfterFont.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Blend(c,this.FFill.FColor,50));
          this.FDateAppearance.FDateBeforeFont.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Blend(c,this.FFill.FColor,50));
          this.FDateAppearance.FDisabledFont.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Blend(c,this.FFill.FColor,25));
        };
        this.FDateAppearance.FSelectedFont.SetColor(c);
        this.FDateAppearance.FFont.SetColor(c);
        this.FHeader.FFont.SetColor(c);
        this.FFooter.FFont.SetColor(c);
        this.FDayNameAppearance.FFont.SetColor(c);
        this.FWeekNumberAppearance.FFont.SetColor(c);
      };
    };
    this.ResetToDefaultStyle = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ResetToDefaultStyle.call(this);
      this.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FFill.SetColor(16777215);
      this.FStroke.SetColor(12632256);
      this.FHeader.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient);
      this.FHeader.FFill.SetColor(0xFCF8F6);
      this.FHeader.FFill.SetColorTo(0xF9F2EE);
      this.FHeader.FFont.SetColor(0x454545);
      this.FHeader.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FHeader.FStroke.SetColor(12632256);
      this.FHeader.FArrow.SetColor(6908265);
      pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.SetFontSize(this.FHeader.FFont,14,1);
      this.FFooter.FFill.Assign(this.FHeader.FFill);
      this.FFooter.FStroke.Assign(this.FHeader.FStroke);
      this.FFooter.FFont.Assign(this.FHeader.FFont);
      this.FFooter.FFont.SetStyle({});
      this.FLineAppearance.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FLineAppearance.FStroke.SetColor(11119017);
      this.FDayNameAppearance.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FDayNameAppearance.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FDayNameAppearance.FFill.SetColor(-1);
      this.FDayNameAppearance.FStroke.SetColor(-1);
      this.FDayNameAppearance.FFont.SetColor(0x7A7A7A);
      this.FWeekNumberAppearance.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FWeekNumberAppearance.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FWeekNumberAppearance.FFill.SetColor(-1);
      this.FWeekNumberAppearance.FStroke.SetColor(-1);
      this.FWeekNumberAppearance.FFont.SetColor(this.FDayNameAppearance.FFont.FColor);
      this.FDateAppearance.FDateAfterFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FDateAppearance.FDateAfterStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FDateAppearance.FDateBeforeFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FDateAppearance.FDateBeforeStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FDateAppearance.FDisabledFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FDateAppearance.FDisabledStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FDateAppearance.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FDateAppearance.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FDateAppearance.FSelectedFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FDateAppearance.FSelectedStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FDateAppearance.FTodayFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FDateAppearance.FTodayStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FDateAppearance.FFont.SetColor(0x7A7A7A);
      this.FDateAppearance.FTodayFont.SetColor(0xEF9B2D);
      this.FDateAppearance.FDateBeforeFont.SetColor(0xBBBBBB);
      this.FDateAppearance.FDateAfterFill.SetColor(-1);
      this.FDateAppearance.FDateAfterStroke.SetColor(-1);
      this.FDateAppearance.FDateAfterFont.SetColor(this.FDateAppearance.FDateBeforeFont.FColor);
      this.FDateAppearance.FDateBeforeFill.SetColor(-1);
      this.FDateAppearance.FDateBeforeStroke.SetColor(-1);
      this.FDateAppearance.FDisabledFill.SetColor(-1);
      this.FDateAppearance.FDisabledStroke.SetColor(-1);
      this.FDateAppearance.FDisabledFont.SetColor(13882323);
      this.FDateAppearance.FFill.SetColor(-1);
      this.FDateAppearance.FStroke.SetColor(-1);
      this.FDateAppearance.FSelectedFill.SetColor(this.FHeader.FFill.FColorTo);
      this.FDateAppearance.FSelectedStroke.SetColor(this.FDateAppearance.FTodayFont.FColor);
      this.FDateAppearance.FTodayFill.SetColor(-1);
      this.FDateAppearance.FTodayStroke.SetColor(-1);
      this.FDateAppearance.FTodayFont.SetStyle(rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsBold));
      this.FDateAppearance.SetShowFocus(false);
      this.FHeader.FFont.SetStyle(rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsBold));
      this.FDateAppearance.FSelectedFont.Assign(this.FHeader.FFont);
    };
    this.Changed = function () {
      if (this.FOnChange != null) this.FOnChange(this);
      this.Invalidate();
    };
    this.CalculateXOffset = function () {
      this.FXOffset = (this.GetWidth() - 2) / this.ColCount(this.FWeekNumberAppearance.FVisible);
    };
    this.ChangeDPIScale = function (M, D) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ChangeDPIScale.apply(this,arguments);
      this.BeginUpdate();
      this.FHeader.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FHeader.FFont.FHeight,M,D));
      this.FFooter.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FFooter.FFont.FHeight,M,D));
      this.FDayNameAppearance.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FDayNameAppearance.FFont.FHeight,M,D));
      this.FDateAppearance.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FDateAppearance.FFont.FHeight,M,D));
      this.FDateAppearance.FSelectedFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FDateAppearance.FSelectedFont.FHeight,M,D));
      this.FDateAppearance.FDisabledFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FDateAppearance.FDisabledFont.FHeight,M,D));
      this.FDateAppearance.FBadgeFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FDateAppearance.FBadgeFont.FHeight,M,D));
      this.FDateAppearance.FDateBeforeFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FDateAppearance.FDateBeforeFont.FHeight,M,D));
      this.FDateAppearance.FDateAfterFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FDateAppearance.FDateAfterFont.FHeight,M,D));
      this.FDateAppearance.FTodayFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FDateAppearance.FTodayFont.FHeight,M,D));
      this.FWeekNumberAppearance.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FWeekNumberAppearance.FFont.FHeight,M,D));
      this.FDayNameAppearance.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FDayNameAppearance.FHeight,M,D));
      this.FHeader.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FHeader.FHeight,M,D));
      this.FFooter.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FFooter.FHeight,M,D));
      this.FHeader.FArrow.SetSize(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FHeader.FArrow.FSize,M,D));
      this.FHeader.FArrow.SetArrowLeftBitmapSize(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FHeader.FArrow.FArrowLeftBitmapSize,M,D));
      this.FHeader.FArrow.SetArrowRightBitmapSize(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FHeader.FArrow.FArrowRightBitmapSize,M,D));
      this.SetBadgeSize(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FBadgeSize,M,D));
      this.EndUpdate();
    };
    this.Notification = function (AComponent, Operation) {
      pas["WEBLib.Menus"].TWebCustomControl.Notification.apply(this,arguments);
      if ((Operation === pas.Classes.TOperation.opRemove) && (AComponent === this.FBitmapContainer)) this.FBitmapContainer = null;
    };
    this.Draw = function (AGraphics, ARectF) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Draw.apply(this,arguments);
      this.FDateAreaHeight = this.CalcDateAreaHeight(this.GetHeight(),this.FHeader.FVisible,this.FFooter.FVisible);
      AGraphics.FBitmapContainer = this.GetBitmapContainer();
      this.DrawDayNames(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF));
      if (this.FDateAreaHeight > 0) {
        this.DrawDays(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF));
        if (this.FWeekNumberAppearance.FVisible) this.DrawWeekNumbers(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF));
      };
      if (this.FFooter.FVisible) this.DrawFooter(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF));
      this.DrawLines(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF));
      if (this.FHeader.FVisible) this.DrawHeader(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF));
      this.DrawBadges(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF));
    };
    this.DrawHeader = function (AGraphics, ARectF) {
      var b = false;
      var df = false;
      var hr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var ar = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rCentre = 0.0;
      var ht = "";
      ht = pas.SysUtils.FormatSettings.ShortMonthNames[this.FMonth - 1] + " " + pas.SysUtils.IntToStr(this.FYear);
      hr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARectF.Left,ARectF.Top,ARectF.Right,this.FHeader.FHeight));
      AGraphics.FFill.Assign(this.FHeader.FFill);
      AGraphics.FStroke.Assign(this.FHeader.FStroke);
      b = true;
      df = true;
      this.DoBeforeDrawHeader(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(hr),{get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }},{get: function () {
          return df;
        }, set: function (v) {
          df = v;
        }});
      if (b) {
        if (df) AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(hr),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        this.DoAfterDrawHeader(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(hr));
      };
      AGraphics.FFont.AssignSource(this.FHeader.FFont);
      b = true;
      df = true;
      this.DoBeforeDrawHeaderText(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(hr),ht,this.FHeader.FHorizontalTextAlign,this.FHeader.FVerticalTextAlign,{get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }},{get: function () {
          return df;
        }, set: function (v) {
          df = v;
        }});
      if (b) {
        if (df) AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(hr),ht,false,this.FHeader.FHorizontalTextAlign,this.FHeader.FVerticalTextAlign,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,true,false,-1,-1);
        this.DoAfterDrawHeaderText(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(hr),ht,this.FHeader.FHorizontalTextAlign,this.FHeader.FVerticalTextAlign);
      };
      if (!rtl.eqSet(this.FHeader.FArrow.FVisibility,{})) {
        ar.$assign(hr);
        rCentre = (hr.Bottom - hr.Top) / 2;
        if ($mod.TTMSFNCCalendarArrowLayoutValue.alvLeft in this.FHeader.FArrow.FVisibility) {
          this.SetArrowLeftRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(hr),ar,rCentre);
          this.DrawArrows(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ar),$mod.TTMSFNCCalendarArrowLayoutValue.alvLeft);
        };
        if ($mod.TTMSFNCCalendarArrowLayoutValue.alvRight in this.FHeader.FArrow.FVisibility) {
          this.SetArrowRightRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(hr),ar,rCentre);
          this.DrawArrows(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ar),$mod.TTMSFNCCalendarArrowLayoutValue.alvRight);
        };
      };
    };
    this.DrawFooter = function (AGraphics, ARectF) {
      var fr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var fText = "";
      var b = false;
      var df = false;
      fr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARectF.Left,ARectF.Bottom - this.FFooter.FHeight,ARectF.Right,ARectF.Bottom));
      AGraphics.FFill.Assign(this.FFooter.FFill);
      AGraphics.FStroke.Assign(this.FFooter.FStroke);
      b = true;
      df = true;
      this.DoBeforeDrawFooter(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(fr),{get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }},{get: function () {
          return df;
        }, set: function (v) {
          df = v;
        }});
      if (b) {
        if (df) AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(fr),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        this.DoAfterDrawFooter(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(fr));
      };
      if ($mod.TTMSFNCCalendarFooterDate.fdSelected === this.FFooter.FDateCaption) {
        fText = this.FFooter.FCaption + " " + pas.SysUtils.DateToStr(this.SelectedDate())}
       else if ($mod.TTMSFNCCalendarFooterDate.fdToday === this.FFooter.FDateCaption) {
        fText = this.FFooter.FCaption + " " + pas.SysUtils.DateToStr(this.GetCurrentDate())}
       else fText = this.FFooter.FCaption;
      AGraphics.FFont.AssignSource(this.FFooter.FFont);
      this.FFooter.SetCaptionRect(AGraphics.CalculateText(fText,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(fr),false,true));
      b = true;
      df = true;
      this.DoBeforeDrawFooterText(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(fr),fText,this.FFooter.FHorizontalTextAlign,this.FFooter.FVerticalTextAlign,{get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }},{get: function () {
          return df;
        }, set: function (v) {
          df = v;
        }});
      if (b) {
        if (df) AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(fr),fText,false,this.FFooter.FHorizontalTextAlign,this.FFooter.FVerticalTextAlign,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,true,false,-1,-1);
        this.DoAfterDrawFooterText(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(fr),fText,this.FFooter.FHorizontalTextAlign,this.FFooter.FVerticalTextAlign);
      };
    };
    this.DrawArrows = function (AGraphics, ARectF, ADirection) {
      var arrPath = null;
      var p = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var rHeight = 0.0;
      var rRight = 0.0;
      var rLeft = 0.0;
      var b = false;
      var df = false;
      rHeight = ARectF.Bottom - ARectF.Top;
      pas["WEBLib.TMSFNCTypes"].InflateRectEx(ARectF,-1,-1);
      AGraphics.FFill.SetColor(this.FHeader.FArrow.FColor);
      AGraphics.FStroke.SetColor(this.FHeader.FArrow.FColor);
      if (ADirection === $mod.TTMSFNCCalendarArrowLayoutValue.alvLeft) {
        b = true;
        df = true;
        var $tmp = this.FHeader.FArrow.FArrowLeftType;
        if ($tmp === $mod.TTMSFNCCalendarArrowType.atTriangle) {
          arrPath = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPath.$create("Create$1");
          try {
            p.$assign(pas["WEBLib.TMSFNCTypes"].PointF(ARectF.Left,ARectF.Top + (rHeight / 2)));
            arrPath.MoveTo(p);
            arrPath.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(ARectF.Right,ARectF.Top));
            arrPath.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(ARectF.Right,ARectF.Bottom));
            arrPath.ClosePath();
            AGraphics.FStroke.SetWidth(1);
            this.DoBeforeDrawArrowLeft(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF),{get: function () {
                return b;
              }, set: function (v) {
                b = v;
              }},{get: function () {
                return df;
              }, set: function (v) {
                df = v;
              }});
            if (b) {
              if (df) AGraphics.DrawPath(arrPath,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPathDrawMode.pdmPolygon);
              this.DoAfterDrawArrowLeft(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF));
            };
          } finally {
            arrPath = rtl.freeLoc(arrPath);
          };
        } else if ($tmp === $mod.TTMSFNCCalendarArrowType.atArrow) {
          p.$assign(pas["WEBLib.TMSFNCTypes"].PointF(ARectF.Left,ARectF.Top + (rHeight / 2)));
          rRight = ARectF.Left + ((ARectF.Right - ARectF.Left) / 2);
          AGraphics.FStroke.SetWidth(2);
          this.DoBeforeDrawArrowLeft(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF),{get: function () {
              return b;
            }, set: function (v) {
              b = v;
            }},{get: function () {
              return df;
            }, set: function (v) {
              df = v;
            }});
          if (b) {
            if (df) {
              AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(rRight,ARectF.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(p),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
              AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(p),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(rRight,ARectF.Bottom)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
            };
            this.DoAfterDrawArrowLeft(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF));
          };
        } else if ($tmp === $mod.TTMSFNCCalendarArrowType.atBitmap) {
          this.DoBeforeDrawArrowLeft(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF),{get: function () {
              return b;
            }, set: function (v) {
              b = v;
            }},{get: function () {
              return df;
            }, set: function (v) {
              df = v;
            }});
          if (b) {
            if (df) AGraphics.DrawScaledBitmap(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF),this.FHeader.FArrow.FArrowLeftBitmap,0,true,false,true,false);
            this.DoAfterDrawArrowLeft(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF));
          };
        } else if ($tmp === $mod.TTMSFNCCalendarArrowType.atCustom) {
          this.DoBeforeDrawArrowLeft(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF),{get: function () {
              return b;
            }, set: function (v) {
              b = v;
            }},{get: function () {
              return df;
            }, set: function (v) {
              df = v;
            }});
          if (b) {
            if (df) this.DoCustomArrowDraw(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF),true);
            this.DoAfterDrawArrowLeft(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF));
          };
        };
      } else if (ADirection === $mod.TTMSFNCCalendarArrowLayoutValue.alvRight) {
        b = true;
        df = true;
        var $tmp1 = this.FHeader.FArrow.FArrowRightType;
        if ($tmp1 === $mod.TTMSFNCCalendarArrowType.atTriangle) {
          arrPath = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPath.$create("Create$1");
          try {
            p.$assign(pas["WEBLib.TMSFNCTypes"].PointF(ARectF.Right,ARectF.Top + (rHeight / 2)));
            arrPath.MoveTo(p);
            arrPath.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(ARectF.Left,ARectF.Bottom));
            arrPath.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(ARectF.Left,ARectF.Top));
            arrPath.ClosePath();
            AGraphics.FStroke.SetWidth(1);
            this.DoBeforeDrawArrowLeft(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF),{get: function () {
                return b;
              }, set: function (v) {
                b = v;
              }},{get: function () {
                return df;
              }, set: function (v) {
                df = v;
              }});
            if (b) {
              if (df) AGraphics.DrawPath(arrPath,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPathDrawMode.pdmPolygon);
              this.DoAfterDrawArrowLeft(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF));
            };
          } finally {
            arrPath = rtl.freeLoc(arrPath);
          };
        } else if ($tmp1 === $mod.TTMSFNCCalendarArrowType.atArrow) {
          p.$assign(pas["WEBLib.TMSFNCTypes"].PointF(ARectF.Right,ARectF.Top + (rHeight / 2)));
          rLeft = ARectF.Left + ((ARectF.Right - ARectF.Left) / 2);
          AGraphics.FStroke.SetWidth(2);
          this.DoBeforeDrawArrowLeft(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF),{get: function () {
              return b;
            }, set: function (v) {
              b = v;
            }},{get: function () {
              return df;
            }, set: function (v) {
              df = v;
            }});
          if (b) {
            if (df) {
              AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(rLeft,ARectF.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(p),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
              AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(rLeft,ARectF.Bottom)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(p),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
            };
            this.DoAfterDrawArrowLeft(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF));
          };
        } else if ($tmp1 === $mod.TTMSFNCCalendarArrowType.atBitmap) {
          this.DoBeforeDrawArrowLeft(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF),{get: function () {
              return b;
            }, set: function (v) {
              b = v;
            }},{get: function () {
              return df;
            }, set: function (v) {
              df = v;
            }});
          if (b) {
            if (df) AGraphics.DrawScaledBitmap(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF),this.FHeader.FArrow.FArrowRightBitmap,0,true,false,true,false);
            this.DoAfterDrawArrowLeft(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF));
          };
        } else if ($tmp1 === $mod.TTMSFNCCalendarArrowType.atCustom) {
          this.DoBeforeDrawArrowLeft(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF),{get: function () {
              return b;
            }, set: function (v) {
              b = v;
            }},{get: function () {
              return df;
            }, set: function (v) {
              df = v;
            }});
          if (b) {
            if (df) this.DoCustomArrowDraw(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF),false);
            this.DoAfterDrawArrowLeft(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF));
          };
        };
      };
    };
    this.DrawDayNames = function (AGraphics, ARectF) {
      var dnColCount = 0;
      var dn = 0;
      var cellRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var I = 0;
      var b = false;
      var df = false;
      dnColCount = this.ColCount(this.FWeekNumberAppearance.FVisible);
      if (this.FHeader.FVisible) {
        cellRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARectF.Left,this.FHeader.FHeight - 1,this.FXOffset,this.FHeader.FHeight + this.FDayNameAppearance.FHeight))}
       else cellRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARectF.Left,ARectF.Top + 1,this.FXOffset,this.FDayNameAppearance.FHeight));
      dn = this.FFirstDay;
      this.ShiftCellH(cellRect,1);
      if (this.FWeekNumberAppearance.FVisible) {
        this.ShiftCellH(cellRect,this.FXOffset);
        dnColCount = dnColCount - 1;
      };
      AGraphics.FFill.Assign(this.FDayNameAppearance.FFill);
      AGraphics.FStroke.Assign(this.FDayNameAppearance.FStroke);
      AGraphics.FFont.AssignSource(this.FDayNameAppearance.FFont);
      for (var $l = 0, $end = dnColCount - 1; $l <= $end; $l++) {
        I = $l;
        b = true;
        df = true;
        this.DoBeforeDrawDayNames(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(cellRect),{get: function () {
            return b;
          }, set: function (v) {
            b = v;
          }},{get: function () {
            return df;
          }, set: function (v) {
            df = v;
          }});
        if (b) {
          if (df) AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(cellRect),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmNone);
          this.DoAfterDrawDayNames(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(cellRect));
        };
        b = true;
        df = true;
        this.DoBeforeDrawDayNamesText(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(cellRect),pas.SysUtils.FormatSettings.ShortDayNames[dn - 1],this.FDayNameAppearance.FHorizontalTextAlign,this.FDayNameAppearance.FVerticalTextAlign,{get: function () {
            return b;
          }, set: function (v) {
            b = v;
          }},{get: function () {
            return df;
          }, set: function (v) {
            df = v;
          }});
        if (b) {
          if (df) AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(cellRect),pas.SysUtils.FormatSettings.ShortDayNames[dn - 1],false,this.FDayNameAppearance.FHorizontalTextAlign,this.FDayNameAppearance.FVerticalTextAlign,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,true,false,-1,-1);
          this.DoAfterDrawDayNamesText(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(cellRect),pas.SysUtils.FormatSettings.ShortDayNames[dn - 1],this.FDayNameAppearance.FHorizontalTextAlign,this.FDayNameAppearance.FVerticalTextAlign);
        };
        this.IncrementWeekDay({get: function () {
            return dn;
          }, set: function (v) {
            dn = v;
          }});
        this.ShiftCellH(cellRect,this.FXOffset);
      };
    };
    this.DrawDays = function (AGraphics, ARectF) {
      var I = 0;
      var row = 0;
      var allRows = 0;
      var col = 0;
      var bCol = 0;
      var dim = 0;
      var baDays = 0;
      var CalcMonth = 0.0;
      var CellRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      row = 1;
      CalcMonth = pas.SysUtils.EncodeDate(this.FYear,this.FMonth,1);
      col = pas.SysUtils.DayOfWeek(CalcMonth) - this.FFirstDay;
      if (col < 0) col = col + 7;
      dim = pas.DateUtils.DaysInMonth(CalcMonth);
      allRows = this.CalcRowCount(col,dim);
      if (allRows !== 0) this.FYOffset = this.FDateAreaHeight / allRows;
      CellRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARectF.Left,ARectF.Top,ARectF.Left + this.FXOffset,ARectF.Top + this.FYOffset));
      this.ShiftCellH(CellRect,1);
      if (this.FDateAppearance.FShowDaysBefore) {
        bCol = col;
        if (bCol > 0) {
          baDays = pas.DateUtils.DaysInMonth(pas.SysUtils.IncMonth(CalcMonth,-1));
          for (var $l = bCol - 1; $l >= 0; $l--) {
            I = $l;
            bCol -= 1;
            this.DrawDayNumbers(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(CellRect),bCol,row,this.PreviousMonth(),baDays);
            baDays -= 1;
          };
        };
      };
      for (var $l1 = 1, $end = dim; $l1 <= $end; $l1++) {
        I = $l1;
        this.DrawDayNumbers(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(CellRect),col,row,this.FMonth,I);
        col += 1;
        if (col > 6) {
          col = 0;
          row += 1;
        };
      };
      if (this.FDateAppearance.FShowDaysAfter) {
        baDays = 1;
        while (row <= allRows) {
          this.DrawDayNumbers(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(CellRect),col,row,this.NextMonth(),baDays);
          col += 1;
          if (col > 6) {
            col = 0;
            row += 1;
          };
          baDays += 1;
        };
      };
      this.FNumOfWeeksDrawn = allRows;
    };
    this.DrawDayNumbers = function (AGraphics, ACellRect, Col, Row, AMonth, I) {
      var d = 0.0;
      var mind = 0.0;
      var maxd = 0.0;
      var b = false;
      var df = false;
      if (this.FWeekNumberAppearance.FVisible) Col += 1;
      if (this.FHeader.FVisible) {
        this.ShiftCellV(ACellRect,this.FHeader.FHeight + this.FDayNameAppearance.FHeight + ((Row - 1) * this.FYOffset))}
       else this.ShiftCellV(ACellRect,this.FDayNameAppearance.FHeight + ((Row - 1) * this.FYOffset));
      this.ShiftCellH(ACellRect,Col * this.FXOffset);
      d = pas.SysUtils.EncodeDate(this.FYear,AMonth,I);
      mind = this.FMinDate;
      maxd = this.FMaxDate;
      if (this.FMinDate === 0) mind = d;
      if (this.FMaxDate === 0) maxd = d;
      if (this.FSelectedDates.InCollection(d)) {
        AGraphics.FFill.Assign(this.FDateAppearance.FSelectedFill);
        AGraphics.FStroke.Assign(this.FDateAppearance.FSelectedStroke);
        AGraphics.FFont.AssignSource(this.FDateAppearance.FSelectedFont);
      } else if ((pas.System.Int(d) < pas.System.Int(mind)) || (pas.System.Int(d) > pas.System.Int(maxd))) {
        AGraphics.FFill.Assign(this.FDateAppearance.FDisabledFill);
        AGraphics.FStroke.Assign(this.FDateAppearance.FDisabledStroke);
        AGraphics.FFont.AssignSource(this.FDateAppearance.FDisabledFont);
      } else if (this.FDateAppearance.FShowDaysBefore && (20 < I) && (Row === 1)) {
        if (AMonth === 12) d = pas.DateUtils.IncYear(d,-1);
        AGraphics.FFill.Assign(this.FDateAppearance.FDateBeforeFill);
        AGraphics.FFont.AssignSource(this.FDateAppearance.FDateBeforeFont);
        AGraphics.FStroke.Assign(this.FDateAppearance.FDateBeforeStroke);
      } else if (this.FDateAppearance.FShowDaysAfter && (15 > I) && (Row >= 5)) {
        if (AMonth === 1) d = pas.DateUtils.IncYear(d,1);
        AGraphics.FFill.Assign(this.FDateAppearance.FDateAfterFill);
        AGraphics.FFont.AssignSource(this.FDateAppearance.FDateAfterFont);
        AGraphics.FStroke.Assign(this.FDateAppearance.FDateAfterStroke);
      } else if (pas.DateUtils.CompareDate(d,this.GetCurrentDate()) === 0) {
        AGraphics.FFill.Assign(this.FDateAppearance.FTodayFill);
        AGraphics.FStroke.Assign(this.FDateAppearance.FTodayStroke);
        AGraphics.FFont.AssignSource(this.FDateAppearance.FTodayFont);
      } else {
        AGraphics.FFill.Assign(this.FDateAppearance.FFill);
        AGraphics.FStroke.Assign(this.FDateAppearance.FStroke);
        AGraphics.FFont.AssignSource(this.FDateAppearance.FFont);
      };
      b = true;
      df = true;
      this.DoBeforeDrawDayNumbers(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ACellRect),d,{get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }},{get: function () {
          return df;
        }, set: function (v) {
          df = v;
        }});
      if (b) {
        if (df) AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ACellRect),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmNone);
        this.DoAfterDrawDayNumbers(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ACellRect),d);
      };
      b = true;
      this.DoBeforeDrawDayNumbersText(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ACellRect),pas.SysUtils.IntToStr(I),this.FDateAppearance.FHorizontalTextAlign,this.FDateAppearance.FVerticalTextAlign,{get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }},{get: function () {
          return df;
        }, set: function (v) {
          df = v;
        }});
      if (b) {
        if (df) AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ACellRect),pas.SysUtils.IntToStr(I),false,this.FDateAppearance.FHorizontalTextAlign,this.FDateAppearance.FVerticalTextAlign,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,true,false,-1,-1);
        this.DoAfterDrawDayNumbersText(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ACellRect),pas.SysUtils.IntToStr(I),this.FDateAppearance.FHorizontalTextAlign,this.FDateAppearance.FVerticalTextAlign);
      };
      if ((pas.DateUtils.CompareDate(d,this.FFocusedDate) === 0) && this.FDateAppearance.FShowFocus) AGraphics.DrawFocusRectangle$3(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ACellRect),0,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
    };
    var dm = [7,1,2,3,4,5,6];
    this.DrawWeekNumbers = function (AGraphics, ARectF) {
      var $Self = this;
      var wNum = 0;
      var I = 0;
      var CellRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var b = false;
      var df = false;
      var wks = [];
      function GregorianFirstWeekDaysCount(AYear, AFirstDayOfWeek) {
        var Result = 0;
        var FirstJanuary = 0.0;
        var FirstJanuaryDay = 0;
        FirstJanuary = pas.SysUtils.EncodeDate(AYear,1,1);
        FirstJanuaryDay = pas.DateUtils.DayOfTheWeek(FirstJanuary);
        Result = 7 - (((FirstJanuaryDay - AFirstDayOfWeek) + 7) % 7);
        return Result;
      };
      function GregorianWeeksInAYear(AYear, AFirstDayOfWeek) {
        var Result = 0;
        var DaysInFirstWeek = 0;
        Result = rtl.trunc(pas.DateUtils.DaysInAYear(AYear) / 7);
        DaysInFirstWeek = GregorianFirstWeekDaysCount(AYear,AFirstDayOfWeek);
        if (pas.SysUtils.IsLeapYear(AYear)) {
          if (DaysInFirstWeek >= 4) Result += 1;
        } else {
          if (DaysInFirstWeek > 4) Result += 1;
        };
        return Result;
      };
      function GregorianWeekOfTheYear(ADateTime, AFirstDayOfWeek) {
        var Result = 0;
        var DaysInFirstWeek = 0;
        DaysInFirstWeek = GregorianFirstWeekDaysCount(pas.DateUtils.YearOf(ADateTime),AFirstDayOfWeek);
        if (DaysInFirstWeek >= 4) {
          Result = rtl.trunc(((pas.DateUtils.DayOfTheYear(ADateTime) + 7) - DaysInFirstWeek - 1) / 7) + 1}
         else if (pas.DateUtils.DayOfTheYear(ADateTime) < 4) {
          Result = GregorianWeeksInAYear(pas.DateUtils.YearOf(ADateTime) - 1,AFirstDayOfWeek)}
         else Result = rtl.trunc(((pas.DateUtils.DayOfTheYear(ADateTime) + 7) - DaysInFirstWeek - 1) / 7);
        return Result;
      };
      function GenerateWeekNumbers(AMonth) {
        var Result = [];
        var lod = 0;
        var wcnt = 0;
        var wc = 0;
        var fw = 0;
        var dic = 0;
        var I = 0;
        var bd = 0.0;
        Result = rtl.arraySetLength(Result,0,$Self.FNumOfWeeksDrawn);
        I = 7 - dm[$Self.FFirstDay - 1];
        bd = pas.SysUtils.EncodeDate(pas.DateUtils.YearOf($Self.FDate),pas.DateUtils.MonthOf($Self.FDate),1);
        dic = ((I + pas.DateUtils.DayOfTheWeek(bd)) % 7) + 1;
        wc = rtl.trunc((dic - 1) / 7);
        fw = GregorianWeekOfTheYear(bd,dm[$Self.FFirstDay - 1]);
        var $tmp = AMonth;
        if ($tmp === 1) {
          if (fw !== 1) {
            Result[0] = fw;
            for (var $l = 1, $end = $Self.FNumOfWeeksDrawn - 1; $l <= $end; $l++) {
              I = $l;
              Result[I] = I - wc;
            };
          } else {
            for (var $l1 = 0, $end1 = $Self.FNumOfWeeksDrawn - 1; $l1 <= $end1; $l1++) {
              I = $l1;
              Result[I] = (fw + I) - wc;
            };
          };
        } else if ($tmp === 12) {
          lod = GregorianWeekOfTheYear(pas.SysUtils.EncodeDate(pas.DateUtils.YearOf($Self.FDate),pas.DateUtils.MonthOf($Self.FDate),31),dm[$Self.FFirstDay - 1]);
          wcnt = (lod - fw) + 1;
          wc = rtl.trunc((dic - 1) / 7);
          for (var $l2 = 0, $end2 = Math.min(wcnt - 1,$Self.FNumOfWeeksDrawn - 1); $l2 <= $end2; $l2++) {
            I = $l2;
            Result[I] = (fw + I) - wc;
          };
          for (var $l3 = wcnt, $end3 = $Self.FNumOfWeeksDrawn - 1; $l3 <= $end3; $l3++) {
            I = $l3;
            Result[I] = (I - wcnt) + 1;
          };
        } else {
          for (var $l4 = 0, $end4 = $Self.FNumOfWeeksDrawn - 1; $l4 <= $end4; $l4++) {
            I = $l4;
            Result[I] = (fw + I) - wc;
          };
        };
        return Result;
      };
      wks = GenerateWeekNumbers(pas.DateUtils.MonthOf(this.FDate));
      if (rtl.length(wks) > 0) {
        CellRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARectF.Left,ARectF.Top,ARectF.Left + this.FXOffset,ARectF.Top + this.FYOffset));
        this.ShiftCellH(CellRect,1);
        if (this.FHeader.FVisible) {
          this.ShiftCellV(CellRect,this.FHeader.FHeight + this.FDayNameAppearance.FHeight)}
         else this.ShiftCellV(CellRect,this.FDayNameAppearance.FHeight);
        AGraphics.FFill.Assign(this.FWeekNumberAppearance.FFill);
        AGraphics.FStroke.Assign(this.FWeekNumberAppearance.FStroke);
        AGraphics.FFont.AssignSource(this.FWeekNumberAppearance.FFont);
        for (var $l = 0, $end = rtl.length(wks) - 1; $l <= $end; $l++) {
          I = $l;
          wNum = wks[I];
          b = true;
          df = true;
          this.DoBeforeDrawWeekNumbers(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(CellRect),{get: function () {
              return b;
            }, set: function (v) {
              b = v;
            }},{get: function () {
              return df;
            }, set: function (v) {
              df = v;
            }});
          if (b) {
            if (df) AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(CellRect),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmNone);
            this.DoAfterDrawWeekNumbers(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(CellRect));
          };
          b = true;
          df = true;
          this.DoBeforeDrawWeekNumbersText(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(CellRect),pas.SysUtils.IntToStr(wNum),this.FWeekNumberAppearance.FHorizontalTextAlign,this.FWeekNumberAppearance.FVerticalTextAlign,{get: function () {
              return b;
            }, set: function (v) {
              b = v;
            }},{get: function () {
              return df;
            }, set: function (v) {
              df = v;
            }});
          if (b) {
            if (df) AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(CellRect),pas.SysUtils.IntToStr(wNum),false,this.FWeekNumberAppearance.FHorizontalTextAlign,this.FWeekNumberAppearance.FVerticalTextAlign,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,true,false,-1,-1);
            this.DoAfterDrawWeekNumbersText(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(CellRect),pas.SysUtils.IntToStr(wNum),this.FWeekNumberAppearance.FHorizontalTextAlign,this.FWeekNumberAppearance.FVerticalTextAlign);
          };
          this.ShiftCellV(CellRect,this.FYOffset);
        };
      };
    };
    this.DrawLines = function (AGraphics, ARectF) {
      var fLeft = 0.0;
      var fTop = 0.0;
      var tRight = 0.0;
      var tBottom = 0.0;
      var b = false;
      var df = false;
      AGraphics.FStroke.Assign(this.FLineAppearance.FStroke);
      fLeft = ARectF.Left + 1;
      tRight = ARectF.Right - 1;
      if (this.FHeader.FVisible) {
        fTop = (this.FHeader.FHeight + this.FDayNameAppearance.FHeight) - 1}
       else fTop = this.FDayNameAppearance.FHeight - 1;
      tBottom = fTop;
      b = true;
      df = true;
      this.DoBeforeDrawLines(AGraphics,{get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }},{get: function () {
          return df;
        }, set: function (v) {
          df = v;
        }});
      if (b) {
        if (df) AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(fLeft,fTop)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(tRight,tBottom)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
        this.DoAfterDrawLines(AGraphics);
      };
      if (this.FWeekNumberAppearance.FVisible) {
        fLeft = ARectF.Left + this.FXOffset;
        tRight = fLeft;
        if (this.FHeader.FVisible) {
          fTop = this.FHeader.FHeight - 1}
         else fTop = 0;
        if (this.FFooter.FVisible) {
          tBottom = ARectF.Bottom - this.FFooter.FHeight}
         else tBottom = ARectF.Bottom;
        this.DoBeforeDrawLines(AGraphics,{get: function () {
            return b;
          }, set: function (v) {
            b = v;
          }},{get: function () {
            return df;
          }, set: function (v) {
            df = v;
          }});
        if (b) {
          if (df) AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(fLeft,fTop)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(tRight,tBottom)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
          this.DoAfterDrawLines(AGraphics);
        };
      };
    };
    this.DrawBadges = function (AGraphics, ARectF) {
      var col = 0;
      var row = 0;
      var I = 0;
      var br = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var badge = null;
      br.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARectF.Left,ARectF.Top,ARectF.Left + this.FBadgeSize,ARectF.Top + this.FBadgeSize));
      this.ShiftCellH(br,1);
      if (this.FHeader.FVisible) {
        this.ShiftCellV(br,this.FHeader.FHeight + this.FDayNameAppearance.FHeight)}
       else this.ShiftCellV(br,this.FDayNameAppearance.FHeight);
      for (var $l = 0, $end = this.FEvents.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        badge = this.FEvents.GetItem$2(I);
        if ((this.FYear === pas.DateUtils.YearOf(badge.FDate)) && (this.FMonth === pas.DateUtils.MonthOf(badge.FDate)) && badge.FShowBadge) {
          row = this.DateToRow(badge.FDate);
          col = this.DateToCol(badge.FDate);
          this.DrawBadge(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(br),badge,col,row);
        };
      };
    };
    this.DrawBadge = function (AGraphics, ARectF, ABadge, ACol, ARow) {
      var b = false;
      var df = false;
      if (ABadge.FBadgeColor !== -1) {
        AGraphics.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
        AGraphics.FFill.SetColor(ABadge.FBadgeColor);
        AGraphics.FStroke.SetColor(ABadge.FBadgeColor);
      } else {
        AGraphics.FFill.Assign(this.FDateAppearance.FBadgeFill);
        AGraphics.FStroke.Assign(this.FDateAppearance.FBadgeStroke);
      };
      if (ABadge.FBadgeFontColor !== -1) {
        AGraphics.FFont.SetSize(7);
        AGraphics.FFont.SetColor(ABadge.FBadgeFontColor);
      } else AGraphics.FFont.AssignSource(this.FDateAppearance.FBadgeFont);
      this.ShiftCellH(ARectF,((ACol + 1) * this.FXOffset) - this.FBadgeSize);
      this.ShiftCellV(ARectF,ARow * this.FYOffset);
      b = true;
      df = true;
      this.DoBeforeDrawBadge(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF),ABadge,{get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }},{get: function () {
          return df;
        }, set: function (v) {
          df = v;
        }});
      if (b) {
        if (df) {
          AGraphics.DrawEllipse$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
          if (ABadge.FBadgeValue !== 0) AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF),pas.SysUtils.IntToStr(ABadge.FBadgeValue),false,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,true,false,-1,-1);
        };
        this.DoAfterDrawBadge(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF),ABadge);
      };
    };
    this.EventsChanged = function (Sender) {
      this.Changed();
    };
    this.WeekNumbersChanged = function (Sender) {
      this.CalculateXOffset();
      this.Changed();
    };
    this.ArrowsChanged = function (Sender) {
      this.Changed();
    };
    this.HeaderChanged = function (Sender) {
      this.Changed();
    };
    this.FooterChanged = function (Sender) {
      this.Changed();
    };
    this.DayNameAppearanceChanged = function (Sender) {
      this.Changed();
    };
    this.LineAppearanceChanged = function (Sender) {
      this.Changed();
    };
    this.ShowBeforeAndAfterChanged = function (Sender) {
      this.Changed();
    };
    this.HandleMouseDown = function (Button, Shift, X, Y) {
      var dateAtXY = 0.0;
      var mind = 0.0;
      var maxd = 0.0;
      var mr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var yr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseDown.apply(this,arguments);
      if (this.FInteraction.FReadOnlyMode) return;
      this.SetFocus();
      this.FMouseDown = true;
      this.CaptureEx();
      if (this.FHeader.FVisible) {
        if (Y <= this.FHeader.FHeight) {
          if (($mod.TTMSFNCCalendarArrowLayoutValue.alvLeft in this.FHeader.FArrow.FVisibility) && this.PointInRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.GetArrowRect(true)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(X,Y)))) {
            this.PreviousDate()}
           else if (($mod.TTMSFNCCalendarArrowLayoutValue.alvRight in this.FHeader.FArrow.FVisibility) && this.PointInRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.GetArrowRect(false)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(X,Y)))) {
            this.NextDate()}
           else if (this.FInteraction.FAllowYearSelection || this.FInteraction.FAllowMonthSelection) {
            this.GetMonthYearRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.GetControlRect()),mr,yr);
            if (this.FInteraction.FAllowMonthSelection && this.PointInRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(mr),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(X,Y)))) {
              this.DoMonthSelectorPopup(mr.Left,mr.Top)}
             else if (this.FInteraction.FAllowYearSelection && this.PointInRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(yr),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(X,Y)))) this.DoYearSelectorPopup(yr.Left,yr.Top);
          };
          if (this.FInteraction.FSwipeOnHeader) {
            this.FTick = $impl.GetTickCountX();
            this.FMx = X;
            this.FMy = Y;
          };
          this.Invalidate();
          return;
        };
      };
      if (this.FFooter.FVisible) {
        if (Y >= (this.GetHeight() - this.FFooter.FHeight)) {
          if (this.PointInRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.GetFooterTextRect()),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(X,Y))) && (this.FFooter.FDateCaption === $mod.TTMSFNCCalendarFooterDate.fdToday)) {
            if ((pas.DateUtils.MonthOf(this.FDate) !== pas.DateUtils.MonthOf(pas.SysUtils.Now())) || (pas.DateUtils.YearOf(this.FDate) !== pas.DateUtils.YearOf(pas.SysUtils.Now()))) {
              if (this.FOnNavigateFooter != null) this.FOnNavigateFooter(this);
            };
            this.SetDate(pas.SysUtils.Now());
          };
          this.Invalidate();
          return;
        };
      };
      dateAtXY = this.XYToDate(X,Y);
      mind = this.FMinDate;
      maxd = this.FMaxDate;
      if (this.FMinDate === 0) mind = dateAtXY;
      if (this.FMaxDate === 0) maxd = dateAtXY;
      if ((pas.System.Int(dateAtXY) === -693594) || (pas.System.Int(dateAtXY) < pas.System.Int(mind)) || (pas.System.Int(dateAtXY) > pas.System.Int(maxd))) return;
      this.FClickedDate = dateAtXY;
      this.FFocusedDate = this.FClickedDate;
      this.FMouseAtDate = dateAtXY;
      if (this.FInteraction.FMultiSelect) {
        if (pas.Classes.TShiftState$a.ssCtrl in Shift) {
          this.DoBeforeSelectDate(dateAtXY);
          this.SelectDate(dateAtXY);
          this.DoSelectDate(dateAtXY);
        } else if (pas.Classes.TShiftState$a.ssShift in Shift) {
          if (this.FSelectedDates.GetCount() > 0) {
            this.SelectMultiDates(this.FSelectedDates.GetItem$1(this.FSelectedDates.GetCount() - 1).FDate,dateAtXY);
            this.DoSelectMultiDate(this.FSelectedDates.GetItem$1(this.FSelectedDates.GetCount() - 1).FDate,dateAtXY);
          };
        } else {
          this.FSelectedDates.UnselectAll();
          if (this.FSelectedDates.InCollection(dateAtXY)) {
            this.FSelectedDates.UnselectDate(dateAtXY)}
           else {
            this.DoBeforeSelectDate(dateAtXY);
            this.SelectDate(dateAtXY);
            this.SetDate(dateAtXY);
            this.DoSelectDate(dateAtXY);
          };
        };
      } else {
        this.FSelectedDates.UnselectAll();
        if (this.FSelectedDates.InCollection(dateAtXY)) {
          this.FSelectedDates.UnselectDate(dateAtXY)}
         else {
          this.DoBeforeSelectDate(dateAtXY);
          this.SetDate(dateAtXY);
          this.SelectDate(dateAtXY);
          this.DoSelectDate(dateAtXY);
          this.ReleaseCaptureEx();
        };
      };
    };
    this.HandleMouseUp = function (Button, Shift, X, Y) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseUp.apply(this,arguments);
      if (this.FInteraction.FSwipeOnHeader) {
        if ((Math.abs(Y - this.FMy) < 10) && (Math.abs(X - this.FMx) > 20) && this.FMouseDown && (($impl.GetTickCountX() - this.FTick) < 1000)) {
          if (X < this.FMx) {
            this.NextDate()}
           else this.PreviousDate();
        };
        this.Invalidate();
      };
      this.FMouseDown = false;
      this.ReleaseCaptureEx();
    };
    this.HandleMouseMove = function (Shift, X, Y) {
      var dt = 0.0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseMove.apply(this,arguments);
      if ((this.FYOffset === 0) || (this.FXOffset === 0)) return;
      dt = this.XYToDate(X,Y);
      if (this.FHoverDate !== dt) {
        this.FHoverDate = dt;
        this.CancelHint();
        this.Invalidate();
      };
      if (this.FInteraction.FReadOnlyMode) return;
      if (this.FHeader.FVisible) {
        if (Y <= this.FHeader.FHeight) {
          if ((($mod.TTMSFNCCalendarArrowLayoutValue.alvLeft in this.FHeader.FArrow.FVisibility) && this.PointInRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.GetArrowRect(true)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(X,Y)))) || (($mod.TTMSFNCCalendarArrowLayoutValue.alvRight in this.FHeader.FArrow.FVisibility) && this.PointInRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.GetArrowRect(false)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(X,Y))))) {
            this.SetControlCursor(21)}
           else this.SetControlCursor(0);
          return;
        } else this.SetControlCursor(0);
      };
      if (this.FFooter.FVisible) {
        if (Y > (this.GetHeight() - this.FFooter.FHeight)) {
          if (this.PointInRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.GetFooterTextRect()),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(X,Y))) && (this.FFooter.FDateCaption === $mod.TTMSFNCCalendarFooterDate.fdToday)) {
            this.SetControlCursor(21)}
           else this.SetControlCursor(0);
          return;
        } else this.SetControlCursor(0);
      };
      if (this.FInteraction.FMultiSelect && this.FMouseDown) {
        if (X > this.GetWidth()) return;
        if (dt === -693594) {
          this.FMouseAtDate = dt;
          return;
        };
        if (this.FMouseAtDate === dt) return;
        if (dt !== -693594) {
          this.FMouseAtDate = dt;
          this.SelectMultiDates(this.FClickedDate,this.FMouseAtDate);
          this.DoSelectMultiDate(this.FClickedDate,this.FMouseAtDate);
          this.Invalidate();
        };
      };
    };
    this.HandleKeyDown = function (Key, Shift) {
      var df = 0.0;
      var dt = 0.0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleKeyDown.apply(this,arguments);
      if (this.FInteraction.FReadOnlyMode || !this.FInteraction.FKeyboardSupport) return;
      if (rtl.eqSet(rtl.createSet(pas.Classes.TShiftState$a.ssCtrl),Shift) && this.FInteraction.FMultiSelect) {
        var $tmp = Key.get();
        if (($tmp === 65) || ($tmp === 97)) {
          if (this.FSelectedAll) {
            this.FSelectedDates.UnselectAll();
            this.DoBeforeSelectDate(this.FFocusedDate);
            this.SelectDate(this.FFocusedDate);
            this.DoSelectDate(this.FFocusedDate);
            this.FSelectedAll = false;
          } else {
            df = pas.SysUtils.EncodeDate(this.FYear,this.FMonth,1);
            dt = pas.SysUtils.EncodeDate(this.FYear,this.FMonth,pas.DateUtils.DaysInAMonth(this.FYear,this.FMonth));
            if (this.FMinDate !== 0) {
              if ((this.FMinDate >= df) && (this.FMinDate <= dt)) df = this.FMinDate;
            };
            if (this.FMaxDate !== 0) {
              if ((this.FMaxDate <= dt) && (this.FMaxDate >= df)) dt = this.FMaxDate;
            };
            this.SelectMultiDates(df,dt);
            this.DoSelectMultiDate(df,dt);
            this.FSelectedAll = true;
          };
        };
      } else if (rtl.eqSet(rtl.createSet(pas.Classes.TShiftState$a.ssShift),Shift) && this.FInteraction.FMultiSelect) {
        var $tmp1 = Key.get();
        if (($tmp1 === 37) || ($tmp1 === 39) || ($tmp1 === 38) || ($tmp1 === 40)) {
          if (!this.FShiftPressed) {
            this.FClickedDate = this.FFocusedDate;
            this.DoBeforeSelectDate(this.FClickedDate);
            this.SelectDate(this.FClickedDate);
            this.DoSelectDate(this.FClickedDate);
            this.FShiftPressed = true;
          };
          if (Key.get() === 37) {
            this.SetDateBackward({p: this, get: function () {
                return this.p.FFocusedDate;
              }, set: function (v) {
                this.p.FFocusedDate = v;
              }},-1);
            this.SelectMultiDates(this.FClickedDate,this.FFocusedDate);
            this.DoSelectMultiDate(this.FClickedDate,this.FFocusedDate);
          } else if (Key.get() === 39) {
            this.SetDateForward({p: this, get: function () {
                return this.p.FFocusedDate;
              }, set: function (v) {
                this.p.FFocusedDate = v;
              }},1);
            this.SelectMultiDates(this.FClickedDate,this.FFocusedDate);
            this.DoSelectMultiDate(this.FClickedDate,this.FFocusedDate);
          } else if (Key.get() === 38) {
            this.SetDateBackward({p: this, get: function () {
                return this.p.FFocusedDate;
              }, set: function (v) {
                this.p.FFocusedDate = v;
              }},-7);
            this.SelectMultiDates(this.FClickedDate,this.FFocusedDate);
            this.DoSelectMultiDate(this.FClickedDate,this.FFocusedDate);
          } else if (Key.get() === 40) {
            this.SetDateForward({p: this, get: function () {
                return this.p.FFocusedDate;
              }, set: function (v) {
                this.p.FFocusedDate = v;
              }},7);
            this.SelectMultiDates(this.FClickedDate,this.FFocusedDate);
            this.DoSelectMultiDate(this.FClickedDate,this.FFocusedDate);
          };
        };
        return;
      };
      var $tmp2 = Key.get();
      if ($tmp2 === 37) {
        this.SetDateBackward({p: this, get: function () {
            return this.p.FFocusedDate;
          }, set: function (v) {
            this.p.FFocusedDate = v;
          }},-1);
      } else if ($tmp2 === 39) {
        this.SetDateForward({p: this, get: function () {
            return this.p.FFocusedDate;
          }, set: function (v) {
            this.p.FFocusedDate = v;
          }},1);
      } else if ($tmp2 === 38) {
        this.SetDateBackward({p: this, get: function () {
            return this.p.FFocusedDate;
          }, set: function (v) {
            this.p.FFocusedDate = v;
          }},-7);
      } else if ($tmp2 === 40) {
        this.SetDateForward({p: this, get: function () {
            return this.p.FFocusedDate;
          }, set: function (v) {
            this.p.FFocusedDate = v;
          }},7);
      } else if ($tmp2 === 36) {
        this.FFocusedDate = pas.SysUtils.EncodeDate(this.FYear,this.FMonth,1);
      } else if ($tmp2 === 35) {
        this.FFocusedDate = pas.SysUtils.EncodeDate(this.FYear,this.FMonth,pas.DateUtils.DaysInAMonth(this.FYear,this.FMonth));
      };
      this.Invalidate();
    };
    this.HandleKeyUp = function (Key, Shift) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleKeyUp.apply(this,arguments);
      if (this.FInteraction.FReadOnlyMode || !this.FInteraction.FKeyboardSupport) return;
      var $tmp = Key.get();
      if ($tmp === 16) {
        this.FShiftPressed = false}
       else if (($tmp === 32) || ($tmp === 13)) {
        this.DoBeforeSelectDate(this.FFocusedDate);
        if (!(this.FInteraction.FMultiSelect && (pas.Classes.TShiftState$a.ssCtrl in Shift))) {
          this.SelectDateIfAvailable(this.FFocusedDate)}
         else this.SelectDate(this.FFocusedDate);
        this.DoSelectDate(this.FFocusedDate);
      };
      this.Invalidate();
    };
    this.DoBeforeDrawHeader = function (AGraphics, ARect, AAllow, ADefaultDraw) {
      if (this.FOnBeforeDrawHeader != null) this.FOnBeforeDrawHeader(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AAllow,ADefaultDraw);
    };
    this.DoAfterDrawHeader = function (AGraphics, ARect) {
      if (this.FOnAfterDrawHeader != null) this.FOnAfterDrawHeader(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect));
    };
    this.DoBeforeDrawHeaderText = function (AGraphics, ARect, AText, AHorizontalTextAlign, AVerticalTextAlign, AAllow, ADefaultDraw) {
      if (this.FOnBeforeDrawHeaderText != null) this.FOnBeforeDrawHeaderText(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AText,AHorizontalTextAlign,AVerticalTextAlign,AAllow,ADefaultDraw);
    };
    this.DoAfterDrawHeaderText = function (AGraphics, ARect, AText, AHorizontalTextAlign, AVerticalTextAlign) {
      if (this.FOnAfterDrawHeaderText != null) this.FOnAfterDrawHeaderText(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AText,AHorizontalTextAlign,AVerticalTextAlign);
    };
    this.DoBeforeDrawFooter = function (AGraphics, ARect, AAllow, ADefaultDraw) {
      if (this.FOnBeforeDrawFooter != null) this.FOnBeforeDrawFooter(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AAllow,ADefaultDraw);
    };
    this.DoAfterDrawFooter = function (AGraphics, ARect) {
      if (this.FOnAfterDrawFooter != null) this.FOnAfterDrawFooter(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect));
    };
    this.DoBeforeDrawFooterText = function (AGraphics, ARect, AText, AHorizontalTextAlign, AVerticalTextAlign, AAllow, ADefaultDraw) {
      if (this.FOnBeforeDrawFooterText != null) this.FOnBeforeDrawFooterText(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AText,AHorizontalTextAlign,AVerticalTextAlign,AAllow,ADefaultDraw);
    };
    this.DoAfterDrawFooterText = function (AGraphics, ARect, AText, AHorizontalTextAlign, AVerticalTextAlign) {
      if (this.FOnAfterDrawFooterText != null) this.FOnAfterDrawFooterText(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AText,AHorizontalTextAlign,AVerticalTextAlign);
    };
    this.DoBeforeDrawDayNames = function (AGraphics, ARect, AAllow, ADefaultDraw) {
      if (this.FOnBeforeDrawDayNames != null) this.FOnBeforeDrawDayNames(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AAllow,ADefaultDraw);
    };
    this.DoAfterDrawDayNames = function (AGraphics, ARect) {
      if (this.FOnAfterDrawDayNames != null) this.FOnAfterDrawDayNames(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect));
    };
    this.DoBeforeDrawDayNamesText = function (AGraphics, ARect, AText, AHorizontalTextAlign, AVerticalTextAlign, AAllow, ADefaultDraw) {
      if (this.FOnBeforeDrawDayNamesText != null) this.FOnBeforeDrawDayNamesText(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AText,AHorizontalTextAlign,AVerticalTextAlign,AAllow,ADefaultDraw);
    };
    this.DoAfterDrawDayNamesText = function (AGraphics, ARect, AText, AHorizontalTextAlign, AVerticalTextAlign) {
      if (this.FOnAfterDrawDayNamesText != null) this.FOnAfterDrawDayNamesText(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AText,AHorizontalTextAlign,AVerticalTextAlign);
    };
    this.DoBeforeDrawDayNumbers = function (AGraphics, ARect, ADate, AAllow, ADefaultDraw) {
      if (this.FOnBeforeDrawDayNumbers != null) this.FOnBeforeDrawDayNumbers(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),ADate,AAllow,ADefaultDraw);
    };
    this.DoAfterDrawDayNumbers = function (AGraphics, ARect, ADate) {
      if (this.FOnAfterDrawDayNumbers != null) this.FOnAfterDrawDayNumbers(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),ADate);
    };
    this.DoBeforeDrawDayNumbersText = function (AGraphics, ARect, AText, AHorizontalTextAlign, AVerticalTextAlign, AAllow, ADefaultDraw) {
      if (this.FOnBeforeDrawDayNumbersText != null) this.FOnBeforeDrawDayNumbersText(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AText,AHorizontalTextAlign,AVerticalTextAlign,AAllow,ADefaultDraw);
    };
    this.DoAfterDrawDayNumbersText = function (AGraphics, ARect, AText, AHorizontalTextAlign, AVerticalTextAlign) {
      if (this.FOnAfterDrawDayNumbersText != null) this.FOnAfterDrawDayNumbersText(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AText,AHorizontalTextAlign,AVerticalTextAlign);
    };
    this.DoBeforeDrawLines = function (AGraphics, AAllow, ADefaultDraw) {
      if (this.FOnBeforeDrawLines != null) this.FOnBeforeDrawLines(this,AGraphics,AAllow,ADefaultDraw);
    };
    this.DoAfterDrawLines = function (AGraphics) {
      if (this.FOnAfterDrawLines != null) this.FOnAfterDrawLines(this,AGraphics);
    };
    this.DoBeforeDrawWeekNumbers = function (AGraphics, ARect, AAllow, ADefaultDraw) {
      if (this.FOnBeforeDrawWeekNumbers != null) this.FOnBeforeDrawWeekNumbers(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AAllow,ADefaultDraw);
    };
    this.DoAfterDrawWeekNumbers = function (AGraphics, ARect) {
      if (this.FOnAfterDrawWeekNumbers != null) this.FOnAfterDrawWeekNumbers(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect));
    };
    this.DoBeforeDrawWeekNumbersText = function (AGraphics, ARect, AText, AHorizontalTextAlign, AVerticalTextAlign, AAllow, ADefaultDraw) {
      if (this.FOnBeforeDrawWeekNumbersText != null) this.FOnBeforeDrawWeekNumbersText(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AText,AHorizontalTextAlign,AVerticalTextAlign,AAllow,ADefaultDraw);
    };
    this.DoAfterDrawWeekNumbersText = function (AGraphics, ARect, AText, AHorizontalTextAlign, AVerticalTextAlign) {
      if (this.FOnAfterDrawWeekNumbersText != null) this.FOnAfterDrawWeekNumbersText(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AText,AHorizontalTextAlign,AVerticalTextAlign);
    };
    this.DoBeforeDrawBadge = function (AGraphics, ARect, ABadge, AAllow, ADefaultDraw) {
      if (this.FOnBeforeDrawBadge != null) this.FOnBeforeDrawBadge(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),ABadge,AAllow,ADefaultDraw);
    };
    this.DoAfterDrawBadge = function (AGraphics, ARect, ABadge) {
      if (this.FOnAfterDrawBadge != null) this.FOnAfterDrawBadge(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),ABadge);
    };
    this.DoBeforeDrawArrowLeft = function (AGraphics, AArrowRect, AAllow, ADefaultDraw) {
      if (this.FOnBeforeDrawArrowLeft != null) this.FOnBeforeDrawArrowLeft(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(AArrowRect),AAllow,ADefaultDraw);
    };
    this.DoAfterDrawArrowLeft = function (AGraphics, AArrowRect) {
      if (this.FOnAfterDrawArrowLeft != null) this.FOnAfterDrawArrowLeft(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(AArrowRect));
    };
    this.DoBeforeDrawArrowRight = function (AGraphics, AArrowRect, AAllow, ADefaultDraw) {
      if (this.FOnBeforeDrawArrowRight != null) this.FOnBeforeDrawArrowRight(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(AArrowRect),AAllow,ADefaultDraw);
    };
    this.DoAfterDrawArrowRight = function (AGraphics, AArrowRect) {
      if (this.FOnAfterDrawArrowRight != null) this.FOnAfterDrawArrowRight(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(AArrowRect));
    };
    this.DoBeforeSelectDate = function (ADate) {
      if (this.FOnBeforeSelectDate != null) this.FOnBeforeSelectDate(this,ADate);
    };
    this.DoSelectDate = function (ADate) {
      if (this.FOnSelectDate != null) this.FOnSelectDate(this,ADate);
    };
    this.DoSelectMultiDate = function (AStartDate, AEndDate) {
      if (this.FOnSelectMultiDate != null) this.FOnSelectMultiDate(this,AStartDate,AEndDate);
    };
    this.DoChangeYear = function (AYear) {
      if (this.FOnYearChanged != null) this.FOnYearChanged(this,AYear);
    };
    this.DoChangeMonth = function (AMonth) {
      if (this.FOnMonthChanged != null) this.FOnMonthChanged(this,AMonth);
    };
    this.DoCustomNavigation = function (ADate, AFocusedDate, ADirection) {
      if (this.FOnCustomNavigation != null) this.FOnCustomNavigation(this,ADate,AFocusedDate,ADirection);
    };
    this.DoCustomArrowDraw = function (AGraphics, ARect, ADirection) {
      if (this.FOnCustomArrowDraw != null) this.FOnCustomArrowDraw(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),ADirection);
    };
    this.DoPopupYearsChange = function (Sender) {
      var y = 0;
      if (!this.FYearPopupOpens) {
        this.FYearPopupOpens = true}
       else {
        y = pas.SysUtils.StrToInt(this.GetYearsPopup().FItems.Get(this.GetYearsPopup().FItemIndex));
        this.DoYearPopupValueSelected(this.GetYearsPopup().FItemIndex,y);
        this.SetYear(y);
      };
    };
    this.DoPopupMonthsChange = function (Sender) {
      var m = 0;
      if (!this.FMonthPopupOpens) {
        this.FMonthPopupOpens = true}
       else {
        m = this.GetMonthsPopup().FItemIndex + 1;
        this.DoMonthPopupValueSelected(this.GetMonthsPopup().FItemIndex,m,this.GetMonthsPopup().FItems.Get(this.GetMonthsPopup().FItemIndex));
        this.SetMonth(m);
      };
    };
    this.DoMonthSelectorPopup = function (ALeft, ATop) {
      var I = 0;
      var b = false;
      var p = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      this.GetMonthsPopup().FItems.Clear();
      for (I = 1; I <= 12; I++) this.GetMonthsPopup().FItems.Add(pas.SysUtils.FormatSettings.LongMonthNames[I - 1]);
      this.GetMonthsPopup().SetItemIndex(pas.DateUtils.MonthOf(this.FDate) - 1);
      p.$assign(pas["WEBLib.TMSFNCTypes"].PointF(ALeft,ATop));
      p.$assign(this.LocalToScreenEx(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(p)));
      b = true;
      this.DoBeforeShowMonthPopup({get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }});
      if (b) this.GetMonthsPopup().Popup(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(p));
    };
    this.DoYearSelectorPopup = function (ALeft, ATop) {
      var I = 0;
      var b = false;
      var p = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      this.GetYearsPopup().FItems.Clear();
      for (var $l = this.FInteraction.FYearOptions.FItemsBeforeCurrentYear; $l >= 1; $l--) {
        I = $l;
        this.GetYearsPopup().FItems.Add(pas.SysUtils.IntToStr(this.FYear - I));
      };
      this.GetYearsPopup().FItems.Add(pas.SysUtils.IntToStr(this.FYear));
      for (var $l1 = 1, $end = this.FInteraction.FYearOptions.FItemsAfterCurrentYear; $l1 <= $end; $l1++) {
        I = $l1;
        this.GetYearsPopup().FItems.Add(pas.SysUtils.IntToStr(this.FYear + I));
      };
      this.GetYearsPopup().SetItemIndex(this.FInteraction.FYearOptions.FItemsBeforeCurrentYear);
      p.$assign(pas["WEBLib.TMSFNCTypes"].PointF(ALeft,ATop));
      p.$assign(this.LocalToScreenEx(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(p)));
      b = true;
      this.DoBeforeShowYearPopup({get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }});
      if (b) this.GetYearsPopup().Popup(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(p));
    };
    this.DoBeforeShowMonthPopup = function (AAllow) {
      if (this.FOnBeforeShowMonthPopup != null) this.FOnBeforeShowMonthPopup(this,AAllow);
    };
    this.DoBeforeShowYearPopup = function (AAllow) {
      if (this.FOnBeforeShowYearPopup != null) this.FOnBeforeShowYearPopup(this,AAllow);
    };
    this.DoYearPopupValueSelected = function (AItemIndex, AYear) {
      if (this.FOnYearPopupValueSelected != null) this.FOnYearPopupValueSelected(this,AItemIndex,AYear);
    };
    this.DoMonthPopupValueSelected = function (AItemIndex, AMonth, AMonthValue) {
      if (this.FOnMonthPopupValueSelected != null) this.FOnMonthPopupValueSelected(this,AItemIndex,AMonth,AMonthValue);
    };
    this.IsAppearanceProperty = function (AObject, APropertyName, APropertyType) {
      var Result = false;
      Result = pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.IsAppearanceProperty.call(this,AObject,APropertyName,APropertyType);
      Result = Result || (APropertyName === "Header") || (APropertyName === "Footer");
      return Result;
    };
    this.GetVersion = function () {
      var Result = "";
      Result = this.$class.GetVersionNumber(1,0,4,2);
      return Result;
    };
    this.GetHintString = function () {
      var Result = "";
      var it = null;
      Result = pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBase.GetHintString.call(this);
      it = this.FEvents.GetEventCollectionItemByDate(this.FHoverDate);
      if (it != null) Result = it.FHint;
      return Result;
    };
    this.HasHint = function () {
      var Result = false;
      var it = null;
      it = this.FEvents.GetEventCollectionItemByDate(this.FHoverDate);
      Result = (it != null) && (it.FHint !== "");
      return Result;
    };
    this.GetDocURL = function () {
      var Result = "";
      Result = pas["WEBLib.TMSFNCTypes"].TTMSFNCBaseDocURL + "tmsfncuipack/components/" + pas.SysUtils.LowerCase(this.$classname);
      return Result;
    };
    this.SetFonts = function (ASetType) {
      this.BeginUpdate();
      this.FGlobalFont.ApplyChange(this.FDayNameAppearance.FFont,ASetType);
      this.FGlobalFont.ApplyChange(this.FWeekNumberAppearance.FFont,ASetType);
      this.FGlobalFont.ApplyChange(this.FDateAppearance.FFont,ASetType);
      this.FGlobalFont.ApplyChange(this.FDateAppearance.FSelectedFont,ASetType);
      if (!(ASetType === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCAppearanceGlobalFontType.aftColor)) this.FGlobalFont.ApplyChange(this.FDateAppearance.FDisabledFont,ASetType);
      this.FGlobalFont.ApplyChange(this.FDateAppearance.FDateBeforeFont,ASetType);
      this.FGlobalFont.ApplyChange(this.FDateAppearance.FDateAfterFont,ASetType);
      this.FGlobalFont.ApplyChange(this.FDateAppearance.FBadgeFont,ASetType);
      this.FGlobalFont.ApplyChange(this.FDateAppearance.FTodayFont,ASetType);
      this.FGlobalFont.ApplyChange(this.FFooter.FFont,ASetType);
      this.FGlobalFont.ApplyChange(this.FHeader.FFont,ASetType);
      this.EndUpdate();
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Create$1.apply(this,arguments);
      this.SetWidth(235);
      this.SetHeight(235);
      this.SetDate(pas.System.Int(pas.SysUtils.Now()));
      this.FHoverDate = -693594;
      this.FSelectedAll = false;
      this.FBadgeSize = 14;
      this.FFocusedDate = this.FDate;
      this.SetFirstDay(1);
      this.FMonthPopupOpens = true;
      this.FYearPopupOpens = true;
      this.FHeader = $mod.TTMSFNCCalendarHeader.$create("Create$1",[this]);
      this.FFooter = $mod.TTMSFNCCalendarFooter.$create("Create$1");
      this.FDayNameAppearance = $mod.TTMSFNCCalendarDayNameAppearance.$create("Create$1");
      this.FDateAppearance = $mod.TTMSFNCCalendarDateAppearance.$create("Create$1");
      this.FLineAppearance = $mod.TTMSFNCCalendarLineAppearance.$create("Create$1");
      this.FWeekNumberAppearance = $mod.TTMSFNCCalendarWeekNumberAppearance.$create("Create$1");
      this.FInteraction = $mod.TTMSFNCCalendarInteraction.$create("Create$1");
      this.FSelectedDates = $mod.TTMSFNCCalendarDates.$create("Create$1",[$mod.TTMSFNCCalendarDateItem]);
      this.FEvents = $mod.TTMSFNCCalendarEvents.$create("Create$1",[$mod.TTMSFNCCalendarEventItem]);
      this.SelectDate(this.FFocusedDate);
      this.CalculateXOffset();
      this.FEvents.FOnChange = rtl.createCallback(this,"EventsChanged");
      this.FWeekNumberAppearance.FOnChange = rtl.createCallback(this,"WeekNumbersChanged");
      this.FDateAppearance.FOnChange = rtl.createCallback(this,"ShowBeforeAndAfterChanged");
      this.FHeader.FOnChange = rtl.createCallback(this,"HeaderChanged");
      this.FHeader.FArrow.FOnChange = rtl.createCallback(this,"ArrowsChanged");
      this.FFooter.FOnChange = rtl.createCallback(this,"FooterChanged");
      this.FDayNameAppearance.FOnChange = rtl.createCallback(this,"DayNameAppearanceChanged");
      this.FLineAppearance.FOnChange = rtl.createCallback(this,"LineAppearanceChanged");
      this.FGlobalFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCAppearanceGlobalFont.$create("Create$1",[this]);
      if (this.IsDesignTime()) this.InitSample();
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FGlobalFont");
      rtl.free(this,"FHeader");
      rtl.free(this,"FFooter");
      rtl.free(this,"FDayNameAppearance");
      rtl.free(this,"FDateAppearance");
      rtl.free(this,"FLineAppearance");
      rtl.free(this,"FWeekNumberAppearance");
      rtl.free(this,"FSelectedDates");
      rtl.free(this,"FEvents");
      rtl.free(this,"FInteraction");
      if (this.FYearsPopup != null) rtl.free(this,"FYearsPopup");
      if (this.FMonthsPopup != null) rtl.free(this,"FMonthsPopup");
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCCustomCalendar.isPrototypeOf(Source)) {
        this.FDate = rtl.as(Source,$mod.TTMSFNCCustomCalendar).FDate;
        this.FYear = rtl.as(Source,$mod.TTMSFNCCustomCalendar).FYear;
        this.FMonth = rtl.as(Source,$mod.TTMSFNCCustomCalendar).FMonth;
        this.FDay = rtl.as(Source,$mod.TTMSFNCCustomCalendar).FDay;
        this.FMinDate = rtl.as(Source,$mod.TTMSFNCCustomCalendar).FMinDate;
        this.FMaxDate = rtl.as(Source,$mod.TTMSFNCCustomCalendar).FMaxDate;
        this.FFill.Assign(rtl.as(Source,$mod.TTMSFNCCustomCalendar).FFill);
        this.FStroke.Assign(rtl.as(Source,$mod.TTMSFNCCustomCalendar).FStroke);
        this.FSelectedAll = rtl.as(Source,$mod.TTMSFNCCustomCalendar).FSelectedAll;
        this.FFirstDay = rtl.as(Source,$mod.TTMSFNCCustomCalendar).FFirstDay;
        this.FBadgeSize = rtl.as(Source,$mod.TTMSFNCCustomCalendar).FBadgeSize;
        this.FFocusedDate = rtl.as(Source,$mod.TTMSFNCCustomCalendar).FFocusedDate;
        this.FXOffset = rtl.as(Source,$mod.TTMSFNCCustomCalendar).FXOffset;
        this.FYOffset = rtl.as(Source,$mod.TTMSFNCCustomCalendar).FYOffset;
        this.FHeader.Assign(rtl.as(Source,$mod.TTMSFNCCustomCalendar).FHeader);
        this.FFooter.Assign(rtl.as(Source,$mod.TTMSFNCCustomCalendar).FFooter);
        this.FDayNameAppearance.Assign(rtl.as(Source,$mod.TTMSFNCCustomCalendar).FDayNameAppearance);
        this.FDateAppearance.Assign(rtl.as(Source,$mod.TTMSFNCCustomCalendar).FDateAppearance);
        this.FLineAppearance.Assign(rtl.as(Source,$mod.TTMSFNCCustomCalendar).FLineAppearance);
        this.FWeekNumberAppearance.Assign(rtl.as(Source,$mod.TTMSFNCCustomCalendar).FWeekNumberAppearance);
        this.FInteraction.Assign(rtl.as(Source,$mod.TTMSFNCCustomCalendar).FInteraction);
        this.FSelectedDates.Assign(rtl.as(Source,$mod.TTMSFNCCustomCalendar).FSelectedDates);
        this.FEvents.Assign(rtl.as(Source,$mod.TTMSFNCCustomCalendar).FEvents);
      } else pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Assign.apply(this,arguments);
    };
    this.SelectDate = function (ADate) {
      var mind = 0.0;
      var maxd = 0.0;
      mind = this.FMinDate;
      maxd = this.FMaxDate;
      if (this.FMinDate === 0) mind = ADate;
      if (this.FMaxDate === 0) maxd = ADate;
      if ((pas.System.Int(ADate) >= pas.System.Int(mind)) && (pas.System.Int(ADate) <= pas.System.Int(maxd))) {
        this.FSelectedDates.SelectDate(ADate);
        this.FClickedDate = ADate;
      };
      this.Invalidate();
    };
    this.SelectEvent = function (ADate) {
      this.FEvents.SelectDate(ADate);
    };
    this.SelectMultiDates = function (AStartDate, AEndDate) {
      var mind = 0.0;
      var maxd = 0.0;
      mind = this.FMinDate;
      maxd = this.FMaxDate;
      if (pas.DateUtils.CompareDate(AStartDate,AEndDate) === -1) {
        if (this.FMinDate === 0) mind = AStartDate;
        if (this.FMaxDate === 0) maxd = AEndDate;
        if ((pas.System.Int(AStartDate) >= pas.System.Int(mind)) && (pas.System.Int(AEndDate) <= pas.System.Int(maxd))) {
          this.FSelectedDates.UnselectAll();
          this.FSelectedDates.SelectDateInterval(AStartDate,AEndDate);
        };
      } else {
        if (this.FMinDate === 0) mind = AEndDate;
        if (this.FMaxDate === 0) maxd = AStartDate;
        if ((pas.System.Int(AEndDate) >= pas.System.Int(mind)) && (pas.System.Int(AStartDate) <= pas.System.Int(maxd))) {
          this.FSelectedDates.UnselectAll();
          this.FSelectedDates.SelectDateInterval(AStartDate,AEndDate);
        };
      };
      this.Invalidate();
    };
    this.PreviousDate = function () {
      var tMonth = 0;
      var tYear = 0;
      var d = 0.0;
      var $tmp = this.FInteraction.FNavigationMode;
      if ($tmp === $mod.TTMSFNCCalendarNavigationMode.nmMonth) {
        if ((this.FMonth - 1) <= 0) {
          this.SetDate(pas.SysUtils.EncodeDate(this.PreviousYear(),this.PreviousMonth(),1));
          this.DoChangeYear(this.FYear);
        } else this.SetDate(pas.SysUtils.EncodeDate(this.FYear,this.PreviousMonth(),1));
        this.DoChangeMonth(this.FMonth);
      } else if ($tmp === $mod.TTMSFNCCalendarNavigationMode.nmYear) {
        this.SetDate(pas.DateUtils.IncYear(this.FDate,-1));
        this.DoChangeYear(this.FYear);
      } else if ($tmp === $mod.TTMSFNCCalendarNavigationMode.nmFocusedDate) {
        tMonth = this.FMonth;
        tYear = this.FYear;
        this.SetFocusedDate(pas.DateUtils.IncDay(this.FFocusedDate,-1));
        if (tMonth !== pas.DateUtils.MonthOf(this.FFocusedDate)) {
          this.SetDate(this.FFocusedDate);
          this.DoChangeMonth(this.FMonth);
          if (tYear !== pas.DateUtils.MonthOf(this.FFocusedDate)) this.DoChangeYear(this.FYear);
        };
      } else if ($tmp === $mod.TTMSFNCCalendarNavigationMode.nmCustom) {
        d = this.FDate;
        this.DoCustomNavigation(this.FDate,this.FFocusedDate,true);
        if (pas.DateUtils.MonthOf(d) !== pas.DateUtils.MonthOf(this.FDate)) this.DoChangeMonth(this.FMonth);
        if (pas.DateUtils.YearOf(d) !== pas.DateUtils.YearOf(this.FDate)) this.DoChangeYear(this.FYear);
      };
      if (this.FOnNavigateBack != null) this.FOnNavigateBack(this,this.FMonth,this.FYear);
    };
    this.NextDate = function () {
      var tMonth = 0;
      var tYear = 0;
      var d = 0.0;
      var $tmp = this.FInteraction.FNavigationMode;
      if ($tmp === $mod.TTMSFNCCalendarNavigationMode.nmMonth) {
        if ((this.FMonth + 1) > 12) {
          this.SetDate(pas.SysUtils.EncodeDate(this.NextYear(),this.NextMonth(),1));
          this.DoChangeYear(this.FYear);
        } else this.SetDate(pas.SysUtils.EncodeDate(this.FYear,this.NextMonth(),1));
        this.DoChangeMonth(this.FMonth);
      } else if ($tmp === $mod.TTMSFNCCalendarNavigationMode.nmYear) {
        this.SetDate(pas.DateUtils.IncYear$1(this.FDate));
        this.DoChangeYear(this.FYear);
      } else if ($tmp === $mod.TTMSFNCCalendarNavigationMode.nmFocusedDate) {
        tMonth = this.FMonth;
        tYear = this.FYear;
        this.SetFocusedDate(pas.DateUtils.IncDay$1(this.FFocusedDate));
        if (tMonth !== pas.DateUtils.MonthOf(this.FFocusedDate)) {
          this.SetDate(this.FFocusedDate);
          this.DoChangeMonth(this.FMonth);
          if (tYear !== pas.DateUtils.YearOf(this.FFocusedDate)) this.DoChangeYear(this.FYear);
        };
      } else if ($tmp === $mod.TTMSFNCCalendarNavigationMode.nmCustom) {
        d = this.FDate;
        this.DoCustomNavigation(this.FDate,this.FFocusedDate,false);
        if (pas.DateUtils.MonthOf(d) !== pas.DateUtils.MonthOf(this.FDate)) this.DoChangeMonth(this.FMonth);
        if (pas.DateUtils.YearOf(d) !== pas.DateUtils.YearOf(this.FDate)) this.DoChangeYear(this.FYear);
      };
      if (this.FOnNavigateForward != null) this.FOnNavigateForward(this,this.FMonth,this.FYear);
    };
    this.UpdateControlAfterResize = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.UpdateControlAfterResize.call(this);
      if (this.FWeekNumberAppearance != null) this.CalculateXOffset();
    };
    this.SelectADate = function (ADate) {
      this.FSelectedDates.UnselectAll();
      this.FSelectedDates.SelectDate(ADate);
      this.SetDate(ADate);
      this.FFocusedDate = ADate;
      this.Invalidate();
    };
    this.SelectDateIfAvailable = function (ADate) {
      var mind = 0.0;
      var maxd = 0.0;
      mind = this.FMinDate;
      maxd = this.FMaxDate;
      if (this.FMinDate === 0) mind = ADate;
      if (this.FMaxDate === 0) maxd = ADate;
      if ((pas.System.Int(ADate) >= pas.System.Int(mind)) && (pas.System.Int(ADate) <= pas.System.Int(maxd))) {
        this.FSelectedDates.UnselectAll();
        this.FSelectedDates.SelectDate(ADate);
        this.SetDate(ADate);
        this.FFocusedDate = ADate;
        this.FClickedDate = ADate;
      };
      this.Invalidate();
    };
    this.InitSample = function () {
      this.BeginUpdate();
      this.ResetToDefaultStyle();
      this.EndUpdate();
    };
    this.ColAtX = function (AX) {
      var Result = 0;
      if (this.FWeekNumberAppearance.FVisible) {
        if ((AX > this.FXOffset) && (AX < (this.GetWidth() - 2)) && (this.FXOffset !== 0)) {
          Result = pas.System.Trunc(AX / this.FXOffset)}
         else Result = -1;
      } else {
        if ((AX > 0) && (AX < (this.GetWidth() - 2)) && (this.FXOffset !== 0)) {
          Result = pas.System.Trunc(AX / this.FXOffset) + 1}
         else Result = -1;
      };
      return Result;
    };
    this.RowAtY = function (AY) {
      var Result = 0;
      var t = 0.0;
      var b = 0.0;
      if (this.FHeader.FVisible) {
        t = this.FHeader.FHeight + this.FDayNameAppearance.FHeight}
       else t = this.FDayNameAppearance.FHeight;
      if (this.FFooter.FVisible) {
        b = this.GetHeight() - this.FFooter.FHeight}
       else b = this.GetHeight();
      if ((AY > t) && (AY < b) && (this.FYOffset !== 0)) {
        if (this.FHeader.FVisible) {
          Result = pas.System.Trunc((AY - this.FHeader.FHeight - this.FDayNameAppearance.FHeight) / this.FYOffset) + 1}
         else Result = pas.System.Trunc((AY - this.FDayNameAppearance.FHeight) / this.FYOffset) + 1;
      } else Result = -1;
      return Result;
    };
    this.DateToRow = function (ADate) {
      var Result = 0;
      var fd = 0;
      fd = pas.SysUtils.DayOfWeek(pas.SysUtils.EncodeDate(this.FYear,this.FMonth,1)) - this.FFirstDay;
      if (fd < 0) fd = fd + 7;
      Result = rtl.trunc(((fd - 1) + pas.DateUtils.DayOf(ADate)) / 7);
      return Result;
    };
    this.DateToCol = function (ADate) {
      var Result = 0;
      var Col = 0;
      Col = pas.SysUtils.DayOfWeek(pas.SysUtils.EncodeDate(this.FYear,this.FMonth,1)) - this.FFirstDay;
      if (Col < 0) Col = Col + 7;
      if (this.FWeekNumberAppearance.FVisible) {
        Result = (Col + pas.DateUtils.DayOf(ADate) + this.DateToRow(ADate)) % 8}
       else Result = ((Col + pas.DateUtils.DayOf(ADate)) - 1) % 7;
      return Result;
    };
    this.XYToDate = function (AX, AY) {
      var Result = 0.0;
      var colFrom = 0;
      var rowFrom = 0;
      var colTo = 0;
      var rowTo = 0;
      var cDay = 0;
      var dim = 0;
      var calcMonth = 0.0;
      rowTo = this.RowAtY(AY);
      colTo = this.ColAtX(AX);
      if ((rowTo === -1) || (colTo === -1)) {
        Result = -693594;
        return Result;
      };
      calcMonth = pas.SysUtils.EncodeDate(this.FYear,this.FMonth,1);
      rowFrom = 1;
      colFrom = pas.SysUtils.DayOfWeek(calcMonth) - this.FFirstDay;
      if (colFrom < 0) colFrom = colFrom + 7;
      colFrom += 1;
      cDay = (colTo - colFrom) + 1;
      if ((rowFrom === rowTo) && !this.FDateAppearance.FShowDaysBefore) {
        if (cDay < 1) {
          Result = -693594;
          return Result;
        };
        Result = pas.SysUtils.EncodeDate(this.FYear,this.FMonth,cDay);
        return Result;
      } else if ((rowFrom === rowTo) && this.FDateAppearance.FShowDaysBefore) {
        if (cDay < 1) {
          Result = pas.DateUtils.IncDay(calcMonth,colTo - colFrom);
          return Result;
        };
      };
      cDay = ((rowTo - rowFrom - 1) * 7) + colTo + ((7 - colFrom) + 1);
      dim = pas.DateUtils.DaysInAMonth(this.FYear,this.FMonth);
      calcMonth = pas.SysUtils.EncodeDate(this.FYear,this.FMonth,dim);
      if ((cDay > dim) && !this.FDateAppearance.FShowDaysAfter) {
        Result = -693594}
       else if ((cDay > dim) && this.FDateAppearance.FShowDaysAfter) {
        Result = pas.DateUtils.IncDay(calcMonth,cDay - dim)}
       else Result = pas.SysUtils.EncodeDate(this.FYear,this.FMonth,cDay);
      return Result;
    };
    this.CurrentDay = function () {
      var Result = 0;
      Result = pas.DateUtils.DayOf(pas.SysUtils.Now());
      return Result;
    };
    this.CurrentMonth = function () {
      var Result = 0;
      Result = pas.DateUtils.MonthOf(pas.SysUtils.Now());
      return Result;
    };
    this.CurrentYear = function () {
      var Result = 0;
      Result = pas.DateUtils.YearOf(pas.SysUtils.Now());
      return Result;
    };
    this.PreviousMonth = function () {
      var Result = 0;
      var pMonth = 0;
      pMonth = this.FMonth - 1;
      if (pMonth === 0) pMonth = 12;
      Result = pMonth;
      return Result;
    };
    this.PreviousYear = function () {
      var Result = 0;
      Result = this.FYear - 1;
      return Result;
    };
    this.NextMonth = function () {
      var Result = 0;
      var nMonth = 0;
      nMonth = this.FMonth + 1;
      if (nMonth === 13) nMonth = 1;
      Result = nMonth;
      return Result;
    };
    this.NextYear = function () {
      var Result = 0;
      Result = this.FYear + 1;
      return Result;
    };
    this.SelectedDate = function () {
      var Result = 0.0;
      if (this.FSelectedDates.GetCount() > 0) {
        Result = this.FSelectedDates.GetItem$1(this.FSelectedDates.GetCount() - 1).FDate}
       else Result = -693594;
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphicsTypes"].ITMSFNCAppearanceGlobalFont);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCCalendar",this.TTMSFNCCustomCalendar,function () {
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphicsTypes"].ITMSFNCAppearanceGlobalFont);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("BitmapContainer",3,pas["WEBLib.TMSFNCBitmapContainer"].$rtti["TTMSFNCBitmapContainer"],"GetBitmapContainer","SetBitmapContainer");
    $r.addProperty("BadgeSize",2,rtl.longint,"FBadgeSize","SetBadgeSize",4,{Default: 14});
    $r.addProperty("Header",2,$mod.$rtti["TTMSFNCCalendarHeader"],"FHeader","SetHeader");
    $r.addProperty("Footer",2,$mod.$rtti["TTMSFNCCalendarFooter"],"FFooter","SetFooter");
    $r.addProperty("Fill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFill","SetFill");
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
    $r.addProperty("Day",2,rtl.longint,"FDay","SetDay");
    $r.addProperty("Month",2,rtl.longint,"FMonth","SetMonth");
    $r.addProperty("Year",2,rtl.longint,"FYear","SetYear");
    $r.addProperty("Date",2,pas.System.$rtti["TDate"],"FDate","SetDate");
    $r.addProperty("MaxDate",14,pas.System.$rtti["TDate"],"FMaxDate","SetMaxDate",4,{stored: "IsMaxDateStored"});
    $r.addProperty("MinDate",14,pas.System.$rtti["TDate"],"FMinDate","SetMinDate",4,{stored: "IsMinDateStored"});
    $r.addProperty("FirstDay",2,rtl.longint,"FFirstDay","SetFirstDay",4,{Default: 1});
    $r.addProperty("Events",2,$mod.$rtti["TTMSFNCCalendarEvents"],"FEvents","SetEvents");
    $r.addProperty("WeekNumberAppearance",2,$mod.$rtti["TTMSFNCCalendarWeekNumberAppearance"],"FWeekNumberAppearance","SetWeekNumberAppearance");
    $r.addProperty("DayNameAppearance",2,$mod.$rtti["TTMSFNCCalendarDayNameAppearance"],"FDayNameAppearance","SetDayNameAppearance");
    $r.addProperty("DateAppearance",2,$mod.$rtti["TTMSFNCCalendarDateAppearance"],"FDateAppearance","SetDateAppearance");
    $r.addProperty("LineAppearance",2,$mod.$rtti["TTMSFNCCalendarLineAppearance"],"FLineAppearance","SetLineAppearance");
    $r.addProperty("Interaction",2,$mod.$rtti["TTMSFNCCalendarInteraction"],"FInteraction","SetInteraction");
    $r.addProperty("GlobalFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCAppearanceGlobalFont"],"FGlobalFont","SetGlobalFont");
    $r.addProperty("OnBeforeDrawHeader",0,$mod.$rtti["TTMSFNCCalendarBeforeDrawHeaderEvent"],"FOnBeforeDrawHeader","FOnBeforeDrawHeader");
    $r.addProperty("OnAfterDrawHeader",0,$mod.$rtti["TTMSFNCCalendarAfterDrawHeaderEvent"],"FOnAfterDrawHeader","FOnAfterDrawHeader");
    $r.addProperty("OnBeforeDrawFooter",0,$mod.$rtti["TTMSFNCCalendarBeforeDrawFooterEvent"],"FOnBeforeDrawFooter","FOnBeforeDrawFooter");
    $r.addProperty("OnAfterDrawFooter",0,$mod.$rtti["TTMSFNCCalendarAfterDrawFooterEvent"],"FOnAfterDrawFooter","FOnAfterDrawFooter");
    $r.addProperty("OnBeforeDrawDayNames",0,$mod.$rtti["TTMSFNCCalendarBeforeDrawDayNamesEvent"],"FOnBeforeDrawDayNames","FOnBeforeDrawDayNames");
    $r.addProperty("OnAfterDrawDayNames",0,$mod.$rtti["TTMSFNCCalendarAfterDrawDayNamesEvent"],"FOnAfterDrawDayNames","FOnAfterDrawDayNames");
    $r.addProperty("OnBeforeDrawDayNumbers",0,$mod.$rtti["TTMSFNCCalendarBeforeDrawDayNumbersEvent"],"FOnBeforeDrawDayNumbers","FOnBeforeDrawDayNumbers");
    $r.addProperty("OnAfterDrawDayNumbers",0,$mod.$rtti["TTMSFNCCalendarAfterDrawDayNumbersEvent"],"FOnAfterDrawDayNumbers","FOnAfterDrawDayNumbers");
    $r.addProperty("OnBeforeDrawLines",0,$mod.$rtti["TTMSFNCCalendarBeforeDrawLinesEvent"],"FOnBeforeDrawLines","FOnBeforeDrawLines");
    $r.addProperty("OnAfterDrawLines",0,$mod.$rtti["TTMSFNCCalendarAfterDrawLinesEvent"],"FOnAfterDrawLines","FOnAfterDrawLines");
    $r.addProperty("OnBeforeDrawWeekNumbers",0,$mod.$rtti["TTMSFNCCalendarBeforeDrawWeekNumbersEvent"],"FOnBeforeDrawWeekNumbers","FOnBeforeDrawWeekNumbers");
    $r.addProperty("OnAfterDrawWeekNumbers",0,$mod.$rtti["TTMSFNCCalendarAfterDrawWeekNumbersEvent"],"FOnAfterDrawWeekNumbers","FOnAfterDrawWeekNumbers");
    $r.addProperty("OnBeforeDrawArrowLeft",0,$mod.$rtti["TTMSFNCCalendarBeforeDrawArrowLeftEvent"],"FOnBeforeDrawArrowLeft","FOnBeforeDrawArrowLeft");
    $r.addProperty("OnAfterDrawArrowLeft",0,$mod.$rtti["TTMSFNCCalendarAfterDrawArrowLeftEvent"],"FOnAfterDrawArrowLeft","FOnAfterDrawArrowLeft");
    $r.addProperty("OnBeforeDrawArrowRight",0,$mod.$rtti["TTMSFNCCalendarBeforeDrawArrowRightEvent"],"FOnBeforeDrawArrowRight","FOnBeforeDrawArrowRight");
    $r.addProperty("OnAfterDrawArrowRight",0,$mod.$rtti["TTMSFNCCalendarAfterDrawArrowRightEvent"],"FOnAfterDrawArrowRight","FOnAfterDrawArrowRight");
    $r.addProperty("OnBeforeDrawBadge",0,$mod.$rtti["TTMSFNCCalendarBeforeDrawBadgeEvent"],"FOnBeforeDrawBadge","FOnBeforeDrawBadge");
    $r.addProperty("OnAfterDrawBadge",0,$mod.$rtti["TTMSFNCCalendarAfterDrawBadgeEvent"],"FOnAfterDrawBadge","FOnAfterDrawBadge");
    $r.addProperty("OnBeforeDrawHeaderText",0,$mod.$rtti["TTMSFNCCalendarBeforeDrawHeaderTextEvent"],"FOnBeforeDrawHeaderText","FOnBeforeDrawHeaderText");
    $r.addProperty("OnAfterDrawHeaderText",0,$mod.$rtti["TTMSFNCCalendarAfterDrawHeaderTextEvent"],"FOnAfterDrawHeaderText","FOnAfterDrawHeaderText");
    $r.addProperty("OnBeforeDrawFooterText",0,$mod.$rtti["TTMSFNCCalendarBeforeDrawFooterTextEvent"],"FOnBeforeDrawFooterText","FOnBeforeDrawFooterText");
    $r.addProperty("OnAfterDrawFooterText",0,$mod.$rtti["TTMSFNCCalendarAfterDrawFooterTextEvent"],"FOnAfterDrawFooterText","FOnAfterDrawFooterText");
    $r.addProperty("OnBeforeDrawDayNamesText",0,$mod.$rtti["TTMSFNCCalendarBeforeDrawDayNamesTextEvent"],"FOnBeforeDrawDayNamesText","FOnBeforeDrawDayNamesText");
    $r.addProperty("OnAfterDrawDayNamesText",0,$mod.$rtti["TTMSFNCCalendarAfterDrawDayNamesTextEvent"],"FOnAfterDrawDayNamesText","FOnAfterDrawDayNamesText");
    $r.addProperty("OnBeforeDrawDayNumbersText",0,$mod.$rtti["TTMSFNCCalendarBeforeDrawDayNumbersTextEvent"],"FOnBeforeDrawDayNumbersText","FOnBeforeDrawDayNumbersText");
    $r.addProperty("OnAfterDrawDayNumbersText",0,$mod.$rtti["TTMSFNCCalendarAfterDrawDayNumbersTextEvent"],"FOnAfterDrawDayNumbersText","FOnAfterDrawDayNumbersText");
    $r.addProperty("OnBeforeDrawWeekNumbersText",0,$mod.$rtti["TTMSFNCCalendarBeforeDrawWeekNumbersTextEvent"],"FOnBeforeDrawWeekNumbersText","FOnBeforeDrawWeekNumbersText");
    $r.addProperty("OnAfterDrawWeekNumbersText",0,$mod.$rtti["TTMSFNCCalendarAfterDrawWeekNumbersTextEvent"],"FOnAfterDrawWeekNumbersText","FOnAfterDrawWeekNumbersText");
    $r.addProperty("OnBeforeSelectDate",0,$mod.$rtti["TTMSFNCCalendarBeforeSelectDateEvent"],"FOnBeforeSelectDate","FOnBeforeSelectDate");
    $r.addProperty("OnSelectDate",0,$mod.$rtti["TTMSFNCCalendarSelectedDateEvent"],"FOnSelectDate","FOnSelectDate");
    $r.addProperty("OnSelectMultiDate",0,$mod.$rtti["TTMSFNCCalendarSelectedMultiDateEvent"],"FOnSelectMultiDate","FOnSelectMultiDate");
    $r.addProperty("OnYearChanged",0,$mod.$rtti["TTMSFNCCalendarYearChangedEvent"],"FOnYearChanged","FOnYearChanged");
    $r.addProperty("OnMonthChanged",0,$mod.$rtti["TTMSFNCCalendarMonthChangedEvent"],"FOnMonthChanged","FOnMonthChanged");
    $r.addProperty("OnCustomNavigation",0,$mod.$rtti["TTMSFNCCalendarCustomNavigationEvent"],"FOnCustomNavigation","FOnCustomNavigation");
    $r.addProperty("OnCustomArrowDraw",0,$mod.$rtti["TTMSFNCCalendarCustomArrowDrawEvent"],"FOnCustomArrowDraw","FOnCustomArrowDraw");
    $r.addProperty("OnNavigateBack",0,$mod.$rtti["TTMSFNCCalendarCustomNavigateEvent"],"FOnNavigateBack","FOnNavigateBack");
    $r.addProperty("OnNavigateForward",0,$mod.$rtti["TTMSFNCCalendarCustomNavigateEvent"],"FOnNavigateForward","FOnNavigateForward");
    $r.addProperty("OnNavigateFooter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnNavigateFooter","FOnNavigateFooter");
    $r.addProperty("OnBeforeShowMonthPopup",0,$mod.$rtti["TTMSFNCCalendarShowPopupEvent"],"FOnBeforeShowMonthPopup","FOnBeforeShowMonthPopup");
    $r.addProperty("OnBeforeShowYearPopup",0,$mod.$rtti["TTMSFNCCalendarShowPopupEvent"],"FOnBeforeShowYearPopup","FOnBeforeShowYearPopup");
    $r.addProperty("OnYearPopupValueSelected",0,$mod.$rtti["TTMSFNCCalendarYearPopupValueSelected"],"FOnYearPopupValueSelected","FOnYearPopupValueSelected");
    $r.addProperty("OnMonthPopupValueSelected",0,$mod.$rtti["TTMSFNCCalendarMonthPopupValueSelected"],"FOnMonthPopupValueSelected","FOnMonthPopupValueSelected");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
  $mod.$implcode = function () {
    $impl.CALMINDATE = -693594;
    $impl.ARRPOS = 8;
    $mod.$rtti.$DynArray("TTMSFNCCalendarWordArray",{eltype: rtl.word});
    $impl.GetTickCountX = function () {
      var Result = 0;
      var h = 0;
      var m = 0;
      var s = 0;
      var ms = 0;
      pas.SysUtils.DecodeTime(pas.SysUtils.Now(),{get: function () {
          return h;
        }, set: function (v) {
          h = v;
        }},{get: function () {
          return m;
        }, set: function (v) {
          m = v;
        }},{get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},{get: function () {
          return ms;
        }, set: function (v) {
          ms = v;
        }});
      Result = ms + (s * 1000) + (m * 60 * 1000) + (h * 60 * 60 * 1000);
      return Result;
    };
  };
},["Math","DateUtils","Variants","WEBLib.TMSFNCPersistence"]);
rtl.module("WEBLib.TMSFNCDigitalTimeSelector",["System","Classes","Types","WEBLib.TMSFNCCustomSelector","WEBLib.TMSFNCGraphics","WEBLib.TMSFNCGraphicsTypes","WEBLib.TMSFNCTypes","WEBLib.Controls","WEBLib.TMSFNCUtils"],function () {
  "use strict";
  var $mod = this;
  this.MAJ_VER = 1;
  this.MIN_VER = 0;
  this.REL_VER = 2;
  this.BLD_VER = 1;
  this.TTMSFNCDigitalTimeSelectorIntervalUnit = {"0": "tsuMilliseconds", tsuMilliseconds: 0, "1": "tsuSeconds", tsuSeconds: 1, "2": "tsuMinutes", tsuMinutes: 2, "3": "tsuHours", tsuHours: 3};
  this.$rtti.$Enum("TTMSFNCDigitalTimeSelectorIntervalUnit",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TTMSFNCDigitalTimeSelectorIntervalUnit});
  this.$rtti.$Class("TTMSFNCCustomDigitalTimeSelector");
  rtl.createClass(this,"TTMSFNCDigitalTimeSelectorItem",pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelectorItem,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelectorItem.$init.call(this);
      this.FOwner$1 = null;
      this.FTime = 0.0;
    };
    this.$final = function () {
      this.FOwner$1 = undefined;
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelectorItem.$final.call(this);
    };
    this.SetTime = function (Value) {
      if (this.FTime !== Value) this.FTime = Value;
    };
    this.IsTimeStored = function () {
      var Result = false;
      Result = this.FTime !== 0.0;
      return Result;
    };
    this.Create$1 = function (ACollection) {
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelectorItem.Create$1.apply(this,arguments);
      if (ACollection != null) this.FOwner$1 = rtl.as(ACollection,$mod.TTMSFNCDigitalTimeSelectorItems).FOwner$2;
      return this;
    };
    this.Assign = function (Source) {
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelectorItem.Assign.apply(this,arguments);
      if ($mod.TTMSFNCDigitalTimeSelectorItem.isPrototypeOf(Source)) this.FTime = rtl.as(Source,$mod.TTMSFNCDigitalTimeSelectorItem).FTime;
    };
    var $r = this.$rtti;
    $r.addProperty("Time",14,pas.System.$rtti["TTime"],"FTime","SetTime",4,{stored: "IsTimeStored"});
  });
  rtl.createClass(this,"TTMSFNCDigitalTimeSelectorItems",pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelectorItems,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelectorItems.$init.call(this);
      this.FOwner$2 = null;
    };
    this.$final = function () {
      this.FOwner$2 = undefined;
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelectorItems.$final.call(this);
    };
    this.SetItem$2 = function (Index, Value) {
      this.SetItem$1(Index,Value);
    };
    this.GetItem$2 = function (Index) {
      var Result = null;
      Result = this.GetItem$1(Index);
      return Result;
    };
    this.CreateItemClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCDigitalTimeSelectorItem;
      return Result;
    };
    this.Create$3 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelectorItems.Create$3.apply(this,arguments);
      this.FOwner$2 = rtl.as(AOwner,$mod.TTMSFNCCustomDigitalTimeSelector);
      return this;
    };
    this.Add$2 = function () {
      var Result = null;
      Result = pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelectorItems.Add$1.call(this);
      return Result;
    };
    this.Insert$2 = function (Index) {
      var Result = null;
      Result = pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelectorItems.Insert$1.call(this,Index);
      return Result;
    };
  });
  this.$rtti.$MethodVar("TTMSFNCCustomDigitalTimeSelectorTimeSelected",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ATime",pas.System.$rtti["TTime"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCustomDigitalTimeSelectorTimeDeselected",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ATime",pas.System.$rtti["TTime"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCustomDigitalTimeSelectorBeforeDrawHeaderEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARectF",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AAllow",rtl.boolean,1],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCustomDigitalTimeSelectorAfterDrawHeaderEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARectF",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCustomDigitalTimeSelectorBeforeDrawHeaderTextEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARectF",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AText",rtl.string],["AAllow",rtl.boolean,1],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCustomDigitalTimeSelectorAfterDrawHeaderTextEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARectF",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AText",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCustomDigitalTimeSelectorBeforeDrawArrowEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARectF",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["ALeft",rtl.boolean],["AAllow",rtl.boolean,1],["ADefaultDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCustomDigitalTimeSelectorAfterDrawArrowEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARectF",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["ALeft",rtl.boolean]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCCustomDigitalTimeSelectorNavigationEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ALeft",rtl.boolean]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCCustomDigitalTimeSelector",pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCDefaultSelector,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCDefaultSelector.$init.call(this);
      this.FStartTime = 0.0;
      this.FEndTime = 0.0;
      this.FFirst = 0.0;
      this.FLast = 0.0;
      this.FSelectedTime = 0.0;
      this.FTimeInterval = 0;
      this.FIntervalUnit = 0;
      this.FTimeFormat = "";
      this.FOnTimeDeselected = null;
      this.FOnTimeSelected = null;
      this.FOnAfterDrawArrow = null;
      this.FOnBeforeDrawHeader = null;
      this.FOnBeforeDrawArrow = null;
      this.FOnAfterDrawHeader = null;
      this.FOnAfterDrawHeaderText = null;
      this.FOnBeforeDrawHeaderText = null;
      this.FOnNavigation = null;
      this.FHeaderSize = 0;
    };
    this.$final = function () {
      this.FOnTimeDeselected = undefined;
      this.FOnTimeSelected = undefined;
      this.FOnAfterDrawArrow = undefined;
      this.FOnBeforeDrawHeader = undefined;
      this.FOnBeforeDrawArrow = undefined;
      this.FOnAfterDrawHeader = undefined;
      this.FOnAfterDrawHeaderText = undefined;
      this.FOnBeforeDrawHeaderText = undefined;
      this.FOnNavigation = undefined;
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCDefaultSelector.$final.call(this);
    };
    this.SetItems$1 = function (Value) {
      this.GetItems().Assign(Value);
    };
    this.SetSelectedTime = function (Value) {
      this.FSelectedTime = Value;
      this.SetSelectedItemIndex(this.FindItemByTime(Value));
    };
    this.SetStartTime = function (Value) {
      if (pas.DateUtils.CompareTime(this.FStartTime,Value) !== 0) {
        this.FStartTime = Value;
        this.FFirst = this.FStartTime;
        this.AddTimes();
      };
    };
    this.SetTimeInterval = function (Value) {
      if (this.FTimeInterval !== Value) {
        this.FTimeInterval = Value;
        this.AddTimes();
      };
    };
    this.SetEndTime = function (Value) {
      if (pas.DateUtils.CompareTime(this.FEndTime,Value) !== 0) {
        this.FEndTime = Value;
        this.AddTimes();
      };
    };
    this.SetIntervalUnit = function (Value) {
      if (this.FIntervalUnit !== Value) {
        this.FIntervalUnit = Value;
        this.AddTimes();
      };
    };
    this.SetTimeFormat = function (Value) {
      if (this.FTimeFormat !== Value) {
        this.FTimeFormat = Value;
        this.Invalidate();
      };
    };
    this.SetHeaderSize = function (Value) {
      if (this.FHeaderSize !== Value) this.FHeaderSize = Value;
    };
    this.GetItems = function () {
      var Result = null;
      Result = this.FItems;
      return Result;
    };
    this.IsTimeFormatStored = function () {
      var Result = false;
      Result = this.FTimeFormat !== "hh:nn:ss";
      return Result;
    };
    this.ChangeDPIScale = function (M, D) {
      this.SetHeaderSize(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FHeaderSize,M,D));
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelector.ChangeDPIScale.apply(this,arguments);
    };
    this.DoItemSelected = function (AItemIndex) {
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelector.DoItemSelected.apply(this,arguments);
      this.FSelectedTime = this.FindTimeByItem(AItemIndex);
      if (this.FOnTimeSelected != null) this.FOnTimeSelected(this,this.FindTimeByItem(AItemIndex));
    };
    this.DoItemDeselected = function (AItemIndex) {
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelector.DoItemDeselected.apply(this,arguments);
      if (this.FOnTimeDeselected != null) this.FOnTimeDeselected(this,this.FindTimeByItem(AItemIndex));
    };
    this.DoBeforeDrawHeader = function (AGraphics, ARectF, AAllow, ADefaultDraw) {
      if (this.FOnBeforeDrawHeader != null) this.FOnBeforeDrawHeader(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF),AAllow,ADefaultDraw);
    };
    this.DoAfterDrawHeader = function (AGraphics, ARectF) {
      if (this.FOnAfterDrawHeader != null) this.FOnAfterDrawHeader(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF));
    };
    this.DoBeforeDrawHeaderText = function (AGraphics, ARectF, AText, AAllow, ADefaultDraw) {
      if (this.FOnBeforeDrawHeaderText != null) this.FOnBeforeDrawHeaderText(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF),AText,AAllow,ADefaultDraw);
    };
    this.DoAfterDrawHeaderText = function (AGraphics, ARectF, AText) {
      if (this.FOnAfterDrawHeaderText != null) this.FOnAfterDrawHeaderText(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF),AText);
    };
    this.DoBeforeDrawArrow = function (AGraphics, ARectF, ALeft, AAllow, ADefaultDraw) {
      if (this.FOnBeforeDrawArrow != null) this.FOnBeforeDrawArrow(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF),ALeft,AAllow,ADefaultDraw);
    };
    this.DoAfterDrawArrow = function (AGraphics, ARectF, ALeft) {
      if (this.FOnAfterDrawArrow != null) this.FOnAfterDrawArrow(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARectF),ALeft);
    };
    this.DoNavigation = function (ALeft) {
      if (this.FOnNavigation != null) this.FOnNavigation(this,ALeft);
    };
    this.Draw = function (AGraphics, ARect) {
      var b = false;
      var df = false;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var s = "";
      b = true;
      df = true;
      r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,this.GetWidth(),this.GetTopOffset()));
      AGraphics.FFill.SetColor(this.FAppearance.FFill.FColor);
      AGraphics.FStroke.SetColor(this.FAppearance.FStroke.FColor);
      AGraphics.FFont.AssignSource(this.FAppearance.FFont);
      this.DoBeforeDrawHeader(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),{get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }},{get: function () {
          return df;
        }, set: function (v) {
          df = v;
        }});
      if (b) {
        if (df) AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        this.DoAfterDrawHeader(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r));
      };
      s = pas.SysUtils.FormatDateTime(this.FTimeFormat,this.FindTimeByItem(0)) + " - " + pas.SysUtils.FormatDateTime(this.FTimeFormat,this.FindTimeByItem(this.GetItems().GetCount() - 1));
      b = true;
      df = true;
      this.DoBeforeDrawHeaderText(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),s,{get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }},{get: function () {
          return df;
        }, set: function (v) {
          df = v;
        }});
      if (b) {
        if (df) AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),s,false,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,true,false,-1,-1);
        this.DoAfterDrawHeaderText(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),s);
      };
      this.DrawArrows(AGraphics);
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelector.Draw.apply(this,arguments);
    };
    this.DrawArrows = function (AGraphics) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var p = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var b = false;
      var df = false;
      r.$assign(this.GetArrowRect(true));
      AGraphics.FStroke.SetWidth(this.ScalePaintValue(2));
      AGraphics.FStroke.SetColor(6908265);
      b = true;
      df = true;
      this.DoBeforeDrawArrow(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),true,{get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }},{get: function () {
          return df;
        }, set: function (v) {
          df = v;
        }});
      if (b) {
        if (df) {
          p.$assign(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + this.ScalePaintValue(4),this.GetTopOffset() / 2));
          AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(p),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - this.ScalePaintValue(4),r.Top)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
          AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(p),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - this.ScalePaintValue(4),r.Bottom - 1)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
        };
        this.DoAfterDrawArrow(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),true);
      };
      r.$assign(this.GetArrowRect(false));
      b = true;
      df = true;
      this.DoBeforeDrawArrow(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),false,{get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }},{get: function () {
          return df;
        }, set: function (v) {
          df = v;
        }});
      if (b) {
        if (df) {
          p.$assign(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - this.ScalePaintValue(4),this.GetTopOffset() / 2));
          AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(p),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + this.ScalePaintValue(4),r.Top)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
          AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(p),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + this.ScalePaintValue(4),r.Bottom - 1)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
        };
        this.DoAfterDrawArrow(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),false);
      };
    };
    this.DrawItemText = function (AGraphics, ADisplayItem) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var s = "";
      var it = null;
      var t = 0.0;
      var a = false;
      it = ADisplayItem.Item;
      if ((it != null) && $mod.TTMSFNCDigitalTimeSelectorItem.isPrototypeOf(it)) {
        r.$assign(ADisplayItem.Rect);
        a = true;
        pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,-5,-5);
        t = rtl.as(it,$mod.TTMSFNCDigitalTimeSelectorItem).FTime;
        s = pas.SysUtils.FormatDateTime(this.FTimeFormat,t);
        AGraphics.FFont.AssignSource(this.FAppearance.FFont);
        this.DoItemBeforeDrawText(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ADisplayItem.Rect),it.GetIndex(),{get: function () {
            return s;
          }, set: function (v) {
            s = v;
          }},{get: function () {
            return a;
          }, set: function (v) {
            a = v;
          }});
        if (a) {
          AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),s,false,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,true,false,-1,-1);
          this.DoItemAfterDrawText(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ADisplayItem.Rect),it.GetIndex(),s);
        };
      };
    };
    this.AddTimes = function () {
      this.BeginUpdate();
      this.CalculateTimes();
      this.EndUpdate();
    };
    this.CalculateTimes = function () {
      var I = 0;
      var t = 0.0;
      this.GetItems().Clear();
      t = 0.0;
      for (var $l = 0, $end = (this.FColumns * this.FRows) - 1; $l <= $end; $l++) {
        I = $l;
        var $tmp = this.FIntervalUnit;
        if ($tmp === $mod.TTMSFNCDigitalTimeSelectorIntervalUnit.tsuMilliseconds) {
          t = pas.DateUtils.IncMilliSecond(this.FFirst,I * this.FTimeInterval)}
         else if ($tmp === $mod.TTMSFNCDigitalTimeSelectorIntervalUnit.tsuSeconds) {
          t = pas.DateUtils.IncSecond(this.FFirst,I * this.FTimeInterval)}
         else if ($tmp === $mod.TTMSFNCDigitalTimeSelectorIntervalUnit.tsuMinutes) {
          t = pas.DateUtils.IncMinute(this.FFirst,I * this.FTimeInterval)}
         else if ($tmp === $mod.TTMSFNCDigitalTimeSelectorIntervalUnit.tsuHours) t = pas.DateUtils.IncHour(this.FFirst,I * this.FTimeInterval);
        if (pas.DateUtils.CompareDateTime(t,this.FEndTime) === 1) break;
        this.GetItems().Add$2().SetTime(t);
        this.FLast = t;
      };
    };
    this.UpdateCalculations = function () {
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelector.UpdateCalculations.call(this);
      this.CalculateTimes();
    };
    this.HandleMouseDown = function (Button, Shift, X, Y) {
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelector.HandleMouseDown.apply(this,arguments);
      if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetArrowRect(true),pas["WEBLib.TMSFNCTypes"].PointF(X,Y))) {
        this.NavigateBack()}
       else if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetArrowRect(false),pas["WEBLib.TMSFNCTypes"].PointF(X,Y))) this.NavigateForth();
    };
    this.HandleMouseMove = function (Shift, X, Y) {
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelector.HandleMouseMove.apply(this,arguments);
      if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetArrowRect(true),pas["WEBLib.TMSFNCTypes"].PointF(X,Y)) || pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetArrowRect(false),pas["WEBLib.TMSFNCTypes"].PointF(X,Y))) {
        this.SetControlCursor(21)}
       else this.SetControlCursor(2);
    };
    this.GetVersion = function () {
      var Result = "";
      Result = this.$class.GetVersionNumber(1,0,2,1);
      return Result;
    };
    this.CreateItemsCollection = function () {
      var Result = null;
      Result = $mod.TTMSFNCDigitalTimeSelectorItems.$create("Create$3",[this]);
      return Result;
    };
    this.GetTopOffset = function () {
      var Result = 0.0;
      Result = this.FHeaderSize;
      return Result;
    };
    this.GetArrowRect = function (ALeft) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.$assign(this.GetControlRect());
      if (ALeft) {
        Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top,r.Left + this.FHeaderSize,r.Top + this.FHeaderSize))}
       else Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Right - this.FHeaderSize,r.Top,r.Right,r.Top + this.FHeaderSize));
      pas["WEBLib.TMSFNCTypes"].InflateRectEx(Result,-this.ScalePaintValue(4),-this.ScalePaintValue(4));
      return Result;
    };
    this.ResetToDefaultStyle = function () {
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelector.ResetToDefaultStyle.call(this);
      this.BeginUpdate();
      this.FAppearance.FFont.SetColor(0x454545);
      this.FAppearance.FFill.SetColor(0xF9F2EE);
      this.FAppearance.FFillSelected.SetColor(0xF0BCA8);
      this.FAppearance.FStrokeSelected.SetColor(0xEF9B2D);
      this.FAppearance.FFillDown.SetColor(0xE6815A);
      this.FAppearance.FFillSelected.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FAppearance.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FAppearance.FFillDown.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      this.FAppearance.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FAppearance.FStrokeSelected.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FAppearance.FStrokeHover.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FAppearance.FStroke.SetColor(11119017);
      this.FAppearance.FStrokeHover.SetColor(this.FAppearance.FFillDown.FColor);
      this.FAppearance.FFillHover.Assign(this.FAppearance.FFill);
      this.FAppearance.FStrokeDown.Assign(this.FAppearance.FStroke);
      this.EndUpdate();
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelector.Create$1.apply(this,arguments);
      this.SetHeight(150);
      this.SetWidth(220);
      this.SetColumns(3);
      this.SetRows(4);
      this.FTimeInterval = 5;
      this.FHeaderSize = 24;
      this.FIntervalUnit = $mod.TTMSFNCDigitalTimeSelectorIntervalUnit.tsuMinutes;
      this.FTimeFormat = "hh:nn:ss";
      this.FStartTime = pas.SysUtils.EncodeTime(0,0,0,0);
      this.FEndTime = pas.SysUtils.EncodeTime(23,59,59,999);
      this.FSelectedTime = this.FStartTime;
      this.FFirst = this.FStartTime;
      this.AddTimes();
      if (this.IsDesignTime()) this.InitSample();
      return this;
    };
    this.NavigateBack = function () {
      var t = 0.0;
      t = 0.0;
      var $tmp = this.FIntervalUnit;
      if ($tmp === $mod.TTMSFNCDigitalTimeSelectorIntervalUnit.tsuMilliseconds) {
        t = pas.DateUtils.IncMilliSecond(this.FFirst,-(this.FColumns * this.FRows) * this.FTimeInterval)}
       else if ($tmp === $mod.TTMSFNCDigitalTimeSelectorIntervalUnit.tsuSeconds) {
        t = pas.DateUtils.IncSecond(this.FFirst,-(this.FColumns * this.FRows) * this.FTimeInterval)}
       else if ($tmp === $mod.TTMSFNCDigitalTimeSelectorIntervalUnit.tsuMinutes) {
        t = pas.DateUtils.IncMinute(this.FFirst,-(this.FColumns * this.FRows) * this.FTimeInterval)}
       else if ($tmp === $mod.TTMSFNCDigitalTimeSelectorIntervalUnit.tsuHours) t = pas.DateUtils.IncHour(this.FFirst,-(this.FColumns * this.FRows) * this.FTimeInterval);
      if (pas.DateUtils.CompareDateTime(t,this.FStartTime) >= 0) {
        this.FFirst = pas.System.Frac(t);
        this.AddTimes();
        this.NotifyDataBinderEdit();
        this.SetSelectedItemIndex(this.FindItemByTime(this.FSelectedTime));
        this.NotifyDataBinderValueChanged();
        this.DoNavigation(true);
      };
    };
    this.NavigateForth = function () {
      var t = 0.0;
      t = 0.0;
      var $tmp = this.FIntervalUnit;
      if ($tmp === $mod.TTMSFNCDigitalTimeSelectorIntervalUnit.tsuMilliseconds) {
        t = pas.DateUtils.IncMilliSecond(this.FLast,this.FTimeInterval)}
       else if ($tmp === $mod.TTMSFNCDigitalTimeSelectorIntervalUnit.tsuSeconds) {
        t = pas.DateUtils.IncSecond(this.FLast,this.FTimeInterval)}
       else if ($tmp === $mod.TTMSFNCDigitalTimeSelectorIntervalUnit.tsuMinutes) {
        t = pas.DateUtils.IncMinute(this.FLast,this.FTimeInterval)}
       else if ($tmp === $mod.TTMSFNCDigitalTimeSelectorIntervalUnit.tsuHours) t = pas.DateUtils.IncHour(this.FLast,this.FTimeInterval);
      if (pas.DateUtils.CompareDateTime(t,this.FEndTime) < 0) {
        this.FFirst = pas.System.Frac(t);
        this.AddTimes();
        this.NotifyDataBinderEdit();
        this.SetSelectedItemIndex(this.FindItemByTime(this.FSelectedTime));
        this.NotifyDataBinderValueChanged();
        this.DoNavigation(false);
      };
    };
    this.InitializePage = function (ATime) {
      var e = 0;
      var p = 0;
      if ((pas.DateUtils.CompareTime(ATime,this.FStartTime) === -1) || (pas.DateUtils.CompareTime(ATime,this.FEndTime) === 1)) {
        this.FFirst = this.FStartTime;
        return;
      };
      var $tmp = this.FIntervalUnit;
      if ($tmp === $mod.TTMSFNCDigitalTimeSelectorIntervalUnit.tsuMilliseconds) {
        e = rtl.trunc((pas.DateUtils.MilliSecondOfTheDay(ATime) - pas.DateUtils.MilliSecondOfTheDay(this.FStartTime)) / (this.FTimeInterval >>> 0));
        p = rtl.trunc(e / (this.FRows * this.FColumns));
        this.FFirst = pas.DateUtils.IncMilliSecond(this.FStartTime,p * this.FRows * this.FColumns * this.FTimeInterval);
      } else if ($tmp === $mod.TTMSFNCDigitalTimeSelectorIntervalUnit.tsuSeconds) {
        e = rtl.trunc((pas.DateUtils.SecondOfTheDay(ATime) - pas.DateUtils.SecondOfTheDay(this.FStartTime)) / (this.FTimeInterval >>> 0));
        p = rtl.trunc(e / (this.FRows * this.FColumns));
        this.FFirst = pas.DateUtils.IncSecond(this.FStartTime,p * this.FRows * this.FColumns * this.FTimeInterval);
      } else if ($tmp === $mod.TTMSFNCDigitalTimeSelectorIntervalUnit.tsuMinutes) {
        e = rtl.trunc((pas.DateUtils.MinuteOfTheDay(ATime) - pas.DateUtils.MinuteOfTheDay(this.FStartTime)) / this.FTimeInterval);
        p = rtl.trunc(e / (this.FRows * this.FColumns));
        this.FFirst = pas.DateUtils.IncMinute(this.FStartTime,p * this.FRows * this.FColumns * this.FTimeInterval);
      } else if ($tmp === $mod.TTMSFNCDigitalTimeSelectorIntervalUnit.tsuHours) {
        e = rtl.trunc((pas.DateUtils.HourOfTheDay(ATime) - pas.DateUtils.HourOfTheDay(this.FStartTime)) / this.FTimeInterval);
        p = rtl.trunc(e / (this.FRows * this.FColumns));
        this.FFirst = pas.DateUtils.IncHour(this.FStartTime,p * this.FRows * this.FColumns * this.FTimeInterval);
      };
      this.AddTimes();
      this.NotifyDataBinderEdit();
      this.SetSelectedItemIndex(this.FindItemByTime(this.FSelectedTime));
      this.NotifyDataBinderValueChanged();
    };
    this.FindItemByTime = function (ATime) {
      var Result = 0;
      var I = 0;
      var it = null;
      Result = -1;
      for (var $l = 0, $end = this.GetItems().GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        it = rtl.as(this.GetItems().GetItem$2(I),$mod.TTMSFNCDigitalTimeSelectorItem);
        if ((pas.DateUtils.CompareTime(it.FTime,ATime) === 0) && it.FCanSelect) {
          Result = it.GetIndex();
          break;
        };
      };
      return Result;
    };
    this.FindTimeByItem = function (AItem) {
      var Result = 0.0;
      var I = 0;
      var it = null;
      Result = 0.0;
      for (var $l = 0, $end = this.GetItems().GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        it = rtl.as(this.GetItems().GetItem$2(I),$mod.TTMSFNCDigitalTimeSelectorItem);
        if (it.GetIndex() === AItem) {
          Result = it.FTime;
          break;
        };
      };
      return Result;
    };
    this.InitSample = function () {
      this.ResetToDefaultStyle();
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCDigitalTimeSelector",this.TTMSFNCCustomDigitalTimeSelector,function () {
    this.RegisterRuntimeClasses = function () {
      pas["WEBLib.TMSFNCCustomSelector"].TTMSFNCCustomSelector.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClasses([$mod.TTMSFNCDigitalTimeSelector,$mod.TTMSFNCDigitalTimeSelectorItem]);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Appearance",2,pas["WEBLib.TMSFNCCustomSelector"].$rtti["TTMSFNCCustomSelectorAppearance"],"FAppearance","SetAppearance");
    $r.addProperty("Rows",2,rtl.longint,"FRows","SetRows",4,{Default: 4});
    $r.addProperty("Columns",2,rtl.longint,"FColumns","SetColumns",4,{Default: 3});
    $r.addProperty("SelectedItemIndex",2,rtl.longint,"FSelectedItemIndex","SetSelectedItemIndex",4,{Default: -1});
    $r.addProperty("StartTime",2,pas.System.$rtti["TTime"],"FStartTime","SetStartTime");
    $r.addProperty("EndTime",2,pas.System.$rtti["TTime"],"FEndTime","SetEndTime");
    $r.addProperty("HeaderSize",2,rtl.longint,"FHeaderSize","SetHeaderSize",4,{Default: 24});
    $r.addProperty("IntervalUnit",2,$mod.$rtti["TTMSFNCDigitalTimeSelectorIntervalUnit"],"FIntervalUnit","SetIntervalUnit",4,{Default: $mod.TTMSFNCDigitalTimeSelectorIntervalUnit.tsuMinutes});
    $r.addProperty("TimeInterval",2,rtl.longint,"FTimeInterval","SetTimeInterval",4,{Default: 5});
    $r.addProperty("TimeFormat",14,rtl.string,"FTimeFormat","SetTimeFormat",4,{stored: "IsTimeFormatStored"});
    $r.addProperty("OnTimeSelected",0,$mod.$rtti["TTMSFNCCustomDigitalTimeSelectorTimeSelected"],"FOnTimeSelected","FOnTimeSelected");
    $r.addProperty("OnTimeDeselected",0,$mod.$rtti["TTMSFNCCustomDigitalTimeSelectorTimeDeselected"],"FOnTimeDeselected","FOnTimeDeselected");
    $r.addProperty("OnBeforeDrawHeader",0,$mod.$rtti["TTMSFNCCustomDigitalTimeSelectorBeforeDrawHeaderEvent"],"FOnBeforeDrawHeader","FOnBeforeDrawHeader");
    $r.addProperty("OnAfterDrawHeader",0,$mod.$rtti["TTMSFNCCustomDigitalTimeSelectorAfterDrawHeaderEvent"],"FOnAfterDrawHeader","FOnAfterDrawHeader");
    $r.addProperty("OnBeforeDrawHeaderText",0,$mod.$rtti["TTMSFNCCustomDigitalTimeSelectorBeforeDrawHeaderTextEvent"],"FOnBeforeDrawHeaderText","FOnBeforeDrawHeaderText");
    $r.addProperty("OnAfterDrawHeaderText",0,$mod.$rtti["TTMSFNCCustomDigitalTimeSelectorAfterDrawHeaderTextEvent"],"FOnAfterDrawHeaderText","FOnAfterDrawHeaderText");
    $r.addProperty("OnBeforeDrawArrow",0,$mod.$rtti["TTMSFNCCustomDigitalTimeSelectorBeforeDrawArrowEvent"],"FOnBeforeDrawArrow","FOnBeforeDrawArrow");
    $r.addProperty("OnAfterDrawArrow",0,$mod.$rtti["TTMSFNCCustomDigitalTimeSelectorAfterDrawArrowEvent"],"FOnAfterDrawArrow","FOnAfterDrawArrow");
    $r.addProperty("OnNavigation",0,$mod.$rtti["TTMSFNCCustomDigitalTimeSelectorNavigationEvent"],"FOnNavigation","FOnNavigation");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
},["Math","DateUtils","SysUtils"]);
rtl.module("WEBLib.TMSFNCEditorDropDownEdit",["System","Classes","Types","WEBLib.TMSFNCTypes","WEBLib.Controls","WEBLib.StdCtrls","WEBLib.Forms","WEBLib.TMSFNCEdit","Generics.Collections","WEBLib.TMSFNCCustomControl","WEBLib.TMSFNCGraphics","WEBLib.TMSFNCGraphicsTypes","WEBLib.TMSFNCListBox","WEBLib.TMSFNCCalendar","WEBLib.TMSFNCDigitalTimeSelector","WEBLib.TMSFNCPopup","SysUtils","UITypes"],function () {
  "use strict";
  var $mod = this;
  this.MAJ_VER = 1;
  this.MIN_VER = 0;
  this.REL_VER = 0;
  this.BLD_VER = 0;
  this.TTMSFNCEditorDropDownEditType = {"0": "ddetEdit", ddetEdit: 0, "1": "ddetComboBox", ddetComboBox: 1, "2": "ddetComboEdit", ddetComboEdit: 2, "3": "ddetDatePicker", ddetDatePicker: 3, "4": "ddetTimePicker", ddetTimePicker: 4};
  this.$rtti.$Enum("TTMSFNCEditorDropDownEditType",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TTMSFNCEditorDropDownEditType});
  this.$rtti.$MethodVar("TTMSFNCEditorDropDownEditItemTextEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AText",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCEditorDropDownEditKeyEvent",{procsig: rtl.newTIProcSig([["Self",pas.System.$rtti["TObject"]],["Key",rtl.word,1],["Shift",pas.Classes.$rtti["TShiftState"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCEditorDropDownEditGetFormatSettings",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFormatSettings",pas.SysUtils.$rtti["TFormatSettings"],1]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCEditorDropDownEditAppearance",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FControlFill = null;
      this.FEditFont = null;
      this.FControlStroke = null;
      this.FEditFill = null;
      this.FEditStroke = null;
      this.FControlFont = null;
      this.FOnInternalChanged = null;
      this.FTransparentEdit = false;
      this.FListBoxItemHoverFill = null;
      this.FListBoxItemHoverFont = null;
    };
    this.$final = function () {
      this.FControlFill = undefined;
      this.FEditFont = undefined;
      this.FControlStroke = undefined;
      this.FEditFill = undefined;
      this.FEditStroke = undefined;
      this.FControlFont = undefined;
      this.FOnInternalChanged = undefined;
      this.FListBoxItemHoverFill = undefined;
      this.FListBoxItemHoverFont = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetControlFill = function (Value) {
      this.FControlFill.Assign(Value);
      this.DoFillChanged(this.FControlFill);
    };
    this.SetControlFont = function (Value) {
      this.FControlFont.Assign(Value);
      this.DoFontChanged(this.FControlFont);
    };
    this.SetControlStroke = function (Value) {
      this.FControlStroke.Assign(Value);
      this.DoStrokeChanged(this.FControlStroke);
    };
    this.SetEditFill = function (Value) {
      this.FEditFill.Assign(Value);
      this.DoFillChanged(this.FEditFill);
    };
    this.SetEditFont = function (Value) {
      this.FEditFont.Assign(Value);
      this.DoFontChanged(this.FEditFont);
    };
    this.SetEditStroke = function (Value) {
      this.FEditStroke.Assign(Value);
      this.DoStrokeChanged(this.FEditStroke);
    };
    this.SetTransparentEdit = function (Value) {
      if (this.FTransparentEdit !== Value) {
        this.FTransparentEdit = Value;
        this.DoChanged();
      };
    };
    this.SetListBoxItemHoverFill = function (Value) {
      this.FListBoxItemHoverFill.Assign(Value);
      this.DoFillChanged(this.FListBoxItemHoverFill);
    };
    this.SetListBoxItemHoverFont = function (Value) {
      this.FListBoxItemHoverFont.Assign(Value);
      this.DoFontChanged(this.FListBoxItemHoverFont);
    };
    this.DoFillChanged = function (Sender) {
      this.DoChanged();
    };
    this.DoFontChanged = function (Sender) {
      this.DoChanged();
    };
    this.DoStrokeChanged = function (Sender) {
      this.DoChanged();
    };
    this.DoChanged = function () {
      if (this.FOnInternalChanged != null) this.FOnInternalChanged(this);
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FTransparentEdit = false;
      this.FEditFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16777215,8421504,-1,-1]);
      this.FEditStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,12632256,1.0]);
      this.FEditFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FControlFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16777215,8421504,-1,-1]);
      this.FControlStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,12632256,1.0]);
      this.FControlFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FListBoxItemHoverFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16777215,8421504,-1,-1]);
      this.FListBoxItemHoverFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FEditFill.FOnChanged = rtl.createCallback(this,"DoFillChanged");
      this.FEditFont.FOnChanged = rtl.createCallback(this,"DoFontChanged");
      this.FEditStroke.FOnChanged = rtl.createCallback(this,"DoStrokeChanged");
      this.FControlFill.FOnChanged = rtl.createCallback(this,"DoFillChanged");
      this.FControlFont.FOnChanged = rtl.createCallback(this,"DoFontChanged");
      this.FControlStroke.FOnChanged = rtl.createCallback(this,"DoStrokeChanged");
      this.FListBoxItemHoverFill.FOnChanged = rtl.createCallback(this,"DoFillChanged");
      this.FListBoxItemHoverFont.FOnChanged = rtl.createCallback(this,"DoFontChanged");
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FEditFill");
      rtl.free(this,"FEditStroke");
      rtl.free(this,"FEditFont");
      rtl.free(this,"FControlFill");
      rtl.free(this,"FControlStroke");
      rtl.free(this,"FControlFont");
      rtl.free(this,"FListBoxItemHoverFill");
      rtl.free(this,"FListBoxItemHoverFont");
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCEditorDropDownEditAppearance.isPrototypeOf(Source)) {
        this.FEditFill.Assign(rtl.as(Source,$mod.TTMSFNCEditorDropDownEditAppearance).FEditFill);
        this.FEditStroke.Assign(rtl.as(Source,$mod.TTMSFNCEditorDropDownEditAppearance).FEditStroke);
        this.FEditFont.Assign(rtl.as(Source,$mod.TTMSFNCEditorDropDownEditAppearance).FEditFont);
        this.FControlFill.Assign(rtl.as(Source,$mod.TTMSFNCEditorDropDownEditAppearance).FControlFill);
        this.FControlStroke.Assign(rtl.as(Source,$mod.TTMSFNCEditorDropDownEditAppearance).FControlStroke);
        this.FControlFont.Assign(rtl.as(Source,$mod.TTMSFNCEditorDropDownEditAppearance).FControlFont);
        this.FTransparentEdit = rtl.as(Source,$mod.TTMSFNCEditorDropDownEditAppearance).FTransparentEdit;
        this.FListBoxItemHoverFill.Assign(rtl.as(Source,$mod.TTMSFNCEditorDropDownEditAppearance).FListBoxItemHoverFill);
        this.FListBoxItemHoverFont.Assign(rtl.as(Source,$mod.TTMSFNCEditorDropDownEditAppearance).FListBoxItemHoverFont);
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
  });
  rtl.createClass(this,"TTMSFNCCustomEditorDropDownEdit",pas["WEBLib.TMSFNCEdit"].TTMSFNCEdit,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCEdit"].TTMSFNCEdit.$init.call(this);
      this.FDateTime = 0.0;
      this.FListBoxHoverIndex = 0;
      this.FUpdateCount$1 = 0;
      this.FPopup = null;
      this.FListBox = null;
      this.FCalendar = null;
      this.FTimeSelector = null;
      this.FDropDownType = 0;
      this.FDropDownWidth = 0;
      this.FDropDownHeight = 0;
      this.FDropDownStayOpen = false;
      this.FOnItemChanged = null;
      this.FListBoxItemIndex = 0;
      this.FAppearance = null;
      this.FOnDropDownClosed = null;
      this.FOnDropDownKeyDown = null;
      this.FOnEditKeyDown = null;
      this.FOnItemSelected = null;
      this.FOnGetFormatSettings = null;
      this.FHideEdit = false;
      this.FDisableEditKeyInput = false;
    };
    this.$final = function () {
      this.FPopup = undefined;
      this.FListBox = undefined;
      this.FCalendar = undefined;
      this.FTimeSelector = undefined;
      this.FOnItemChanged = undefined;
      this.FAppearance = undefined;
      this.FOnDropDownClosed = undefined;
      this.FOnDropDownKeyDown = undefined;
      this.FOnEditKeyDown = undefined;
      this.FOnItemSelected = undefined;
      this.FOnGetFormatSettings = undefined;
      pas["WEBLib.TMSFNCEdit"].TTMSFNCEdit.$final.call(this);
    };
    this.SetDropDownType = function (Value) {
      if (this.FDropDownType !== Value) this.FDropDownType = Value;
    };
    this.GetItems = function () {
      var Result = null;
      Result = this.FListBox.FItems;
      return Result;
    };
    this.SetItems = function (Value) {
      this.FListBox.FItems.Assign(Value);
    };
    this.SetAppearance = function (Value) {
      this.FAppearance.Assign(Value);
      this.DoOnAppearanceChanged(this.FAppearance);
    };
    this.GetItemIndex = function () {
      var Result = 0;
      if (this.FListBox != null) {
        Result = this.FListBox.GetItemIndex()}
       else Result = this.FListBoxItemIndex;
      return Result;
    };
    this.SetItemIndex = function (Value) {
      this.FListBoxItemIndex = Value;
      if (this.FListBox != null) this.FListBox.SetItemIndex(this.FListBoxItemIndex);
    };
    this.SetHideEdit = function (Value) {
      this.FHideEdit = Value;
      if (this.FVisible && Value) this.SetVisible(false);
    };
    this.SetDisableEditKeyInput = function (Value) {
      this.FDisableEditKeyInput = Value;
    };
    this.ApplyAppearance = function () {
      this.SetBorderStyle(pas["WEBLib.Controls"].TBorderStyle.bsNone);
      if (this.FListBox != null) {
        this.FListBox.GetFill().Assign(this.FAppearance.FControlFill);
        this.FListBox.GetStroke().Assign(this.FAppearance.FControlStroke);
        if (this.FListBox.GetStroke().FKind !== pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone) {
          this.FPopup.FFillColor = this.FAppearance.FControlStroke.FColor}
         else this.FPopup.FFillColor = this.FAppearance.FControlFill.FColor;
        this.FListBox.FDefaultItem.SetTextColor(this.FAppearance.FControlFont.FColor);
        this.FListBox.FItemsAppearance.GetFont().Assign(this.FAppearance.FControlFont);
      };
      this.SetColor(this.FAppearance.FEditFill.FColor);
      this.FFont.SetColor(this.FAppearance.FEditFont.FColor);
    };
    this.ResetListBox = function () {
      if (this.FListBox != null) {
        this.FListBox.SetVisible(false);
        this.FListBox.SetParent(null);
        this.FListBox.SetItemIndex(-1);
        this.FListBox.SetLeft(-1000);
        this.FListBox.SetTop(-1000);
        this.FListBoxHoverIndex = -1;
        this.FListBoxItemIndex = -1;
      };
    };
    this.ResetCalendar = function () {
      if (this.FCalendar != null) {
        this.FCalendar.SetVisible(false);
        this.FCalendar.SetParent(null);
        this.FCalendar.SetLeft(-1000);
        this.FCalendar.SetTop(-1000);
      };
    };
    this.ResetTimeSelector = function () {
      if (this.FTimeSelector != null) {
        this.FTimeSelector.SetVisible(false);
        this.FTimeSelector.SetParent(null);
        this.FTimeSelector.SetLeft(-1000);
        this.FTimeSelector.SetTop(-1000);
      };
    };
    this.DoOnAppearanceChanged = function (Sender) {
      if (this.FUpdateCount$1 <= 0) {
        this.ApplyAppearance();
        this.Invalidate();
      };
    };
    this.DoOnListBoxItemClick = function (Sender, AItem) {
      if (this.GetT() !== AItem.FText) {
        this.SetT(AItem.FText);
        this.FListBoxItemIndex = AItem.GetIndex();
        this.DoItemChanged();
      };
      this.DoItemSelected();
      if (!this.FDropDownStayOpen) {
        this.FPopup.SetIsOpen(false);
        this.ResetListBox();
      };
    };
    this.DoOnCalendarSelectDate = function (Sender, ADate) {
      var fs = pas.SysUtils.TFormatSettings.$new();
      if (this.FDateTime !== ADate) {
        this.FDateTime = ADate;
        fs.$assign(pas.SysUtils.TFormatSettings.Create());
        this.DoGetFormatSettings(fs);
        this.SetT(pas.SysUtils.DateTimeToStr$1(ADate,fs,false));
        this.DoItemChanged();
      };
      this.DoItemSelected();
      if (!this.FDropDownStayOpen) {
        this.FPopup.SetIsOpen(false);
        this.ResetListBox();
      };
    };
    this.DoOnTimeSelected = function (Sender, ATime) {
      var fs = pas.SysUtils.TFormatSettings.$new();
      if (this.FDateTime !== ATime) {
        this.FDateTime = ATime;
        fs.$assign(pas.SysUtils.TFormatSettings.Create());
        this.DoGetFormatSettings(fs);
        this.SetT(pas.SysUtils.TimeToStr$1(ATime,fs));
        this.DoItemChanged();
      };
      this.DoItemSelected();
      if (!this.FDropDownStayOpen) {
        this.FPopup.SetIsOpen(false);
        this.ResetTimeSelector();
      };
    };
    this.DoGetFormatSettings = function (AFormatSettings) {
      if (this.FOnGetFormatSettings != null) this.FOnGetFormatSettings(this,AFormatSettings);
    };
    this.DoOnBeforeDrawItem = function (Sender, AGraphics, ARect, AItem, AAllow, ADefaultDraw) {
      if (AItem.GetIndex() === this.FListBoxHoverIndex) AGraphics.FFill.Assign(this.FAppearance.FListBoxItemHoverFill);
    };
    this.DoOnBeforeDrawItemText = function (Sender, AGraphics, ARect, AItem, AText, AAllow) {
      if (AItem.GetIndex() === this.FListBoxHoverIndex) AGraphics.FFont.Assign(this.FAppearance.FListBoxItemHoverFont);
    };
    this.KeyDown = function (Key, Shift) {
      if ((Key.get() === 13) && (this.FPopup != null)) this.FPopup.SetIsOpen(false);
      this.DoEditKeyDown(Key,rtl.refSet(Shift));
      pas["WEBLib.TMSFNCEdit"].TTMSFNCEdit.KeyDown.apply(this,arguments);
    };
    this.KeyUp = function (Key, Shift) {
      if (!this.FDisableEditKeyInput) {
        pas["WEBLib.TMSFNCEdit"].TTMSFNCEdit.KeyUp.apply(this,arguments);
      };
      if (Key.get() === 40) {
        this.SelectNextValue()}
       else if (Key.get() === 38) this.SelectPreviousValue();
    };
    this.KeyPress = function (Key) {
      if (!this.FDisableEditKeyInput) {
        pas["WEBLib.TMSFNCEdit"].TTMSFNCEdit.KeyPress.apply(this,arguments);
      };
    };
    this.DoOnMouseMove = function (Sender, Shift, X, Y) {
      var it = null;
      it = this.FListBox.XYToItem(X,Y);
      if (it != null) {
        this.FListBoxHoverIndex = it.GetIndex()}
       else this.FListBoxHoverIndex = -1;
      this.FListBox.FTreeView.Invalidate();
    };
    this.DoOnPopupClose = function (Sender) {
      this.DoDropDownClose();
    };
    this.DoOnPopupKeyDown = function (Sender, Key, Shift) {
      this.DoDropDownKeyDown(Key,rtl.refSet(Shift));
    };
    this.DoOnListBoxKeyDown = function (Sender, Key, Shift) {
      this.DoDropDownKeyDown(Key,rtl.refSet(Shift));
    };
    this.SelectNextValue = function () {
      var idx = 0;
      var t = 0.0;
      var fs = pas.SysUtils.TFormatSettings.$new();
      if (this.FListBox != null) {
        idx = this.FListBox.GetItemIndex();
        if (idx < 0) {
          this.FListBox.SelectItem(0)}
         else if (idx < this.FListBox.FItems.GetCount()) this.FListBox.SelectItem(idx + 1);
        if (this.FListBox.GetSelectedItem() != null) {
          this.SetT(this.FListBox.GetSelectedItem().FText);
          this.FListBox.ScrollToItem(this.FListBox.GetSelectedItem().GetIndex());
        } else this.SetT("");
        this.SetSelStart(this.GetT().length);
      } else if (this.FCalendar != null) {
        this.FCalendar.NextDate();
        fs.$assign(pas.SysUtils.TFormatSettings.Create());
        this.DoGetFormatSettings(fs);
        this.SetT(pas.SysUtils.DateTimeToStr$1(this.FCalendar.FDate,fs,false));
      } else if (this.FTimeSelector != null) {
        t = this.FTimeSelector.FSelectedTime;
        this.FTimeSelector.SetSelectedTime(pas.DateUtils.IncHour$1(t));
        fs.$assign(pas.SysUtils.TFormatSettings.Create());
        this.DoGetFormatSettings(fs);
        this.SetT(pas.SysUtils.DateTimeToStr$1(this.FTimeSelector.FSelectedTime,fs,false));
      };
    };
    this.SelectPreviousValue = function () {
      var idx = 0;
      var t = 0.0;
      var fs = pas.SysUtils.TFormatSettings.$new();
      if (this.FListBox != null) {
        idx = this.FListBox.GetItemIndex();
        if (idx < 0) {
          this.FListBox.SelectItem(this.FListBox.FItems.GetCount() - 1)}
         else if (idx > 0) this.FListBox.SelectItem(idx - 1);
        if (this.FListBox.GetSelectedItem() != null) {
          this.SetT(this.FListBox.GetSelectedItem().FText);
          this.FListBox.ScrollToItem(this.FListBox.GetSelectedItem().GetIndex());
        } else this.SetT("");
        this.SetSelStart(this.GetT().length);
      } else if (this.FCalendar != null) {
        this.FCalendar.PreviousDate();
        fs.$assign(pas.SysUtils.TFormatSettings.Create());
        this.DoGetFormatSettings(fs);
        this.SetT(pas.SysUtils.DateTimeToStr$1(this.FCalendar.FDate,fs,false));
      } else if (this.FTimeSelector != null) {
        t = this.FTimeSelector.FSelectedTime;
        this.FTimeSelector.SetSelectedTime(pas.DateUtils.IncHour(t,-1));
        fs.$assign(pas.SysUtils.TFormatSettings.Create());
        this.DoGetFormatSettings(fs);
        this.SetT(pas.SysUtils.DateTimeToStr$1(this.FTimeSelector.FSelectedTime,fs,false));
      };
    };
    this.DoItemChanged = function () {
      if (this.FOnItemChanged != null) this.FOnItemChanged(this,this.GetT());
    };
    this.DoItemSelected = function () {
      if (this.FOnItemSelected != null) this.FOnItemSelected(this,this.GetT());
    };
    this.DoDropDownClose = function () {
      if (this.FOnDropDownClosed != null) this.FOnDropDownClosed(this);
    };
    this.DoDropDownKeyDown = function (Key, Shift) {
      if (this.FOnDropDownKeyDown != null) this.FOnDropDownKeyDown(this,Key,rtl.refSet(Shift));
    };
    this.DoEditKeyDown = function (Key, Shift) {
      if (this.FOnEditKeyDown != null) this.FOnEditKeyDown(this,Key,rtl.refSet(Shift));
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCEdit"].TTMSFNCEdit.Create$1.apply(this,arguments);
      this.FListBoxHoverIndex = -1;
      this.FListBoxItemIndex = -1;
      this.FDateTime = pas.SysUtils.Now();
      this.FDropDownType = $mod.TTMSFNCEditorDropDownEditType.ddetEdit;
      this.FDropDownWidth = 100;
      this.FDropDownHeight = 150;
      this.FDropDownStayOpen = false;
      this.FHideEdit = false;
      this.FDisableEditKeyInput = false;
      this.FPopup = pas["WEBLib.TMSFNCPopup"].TTMSFNCPopup.$create("Create$1",[AOwner]);
      this.FPopup.SetDragWithParent(true);
      this.FPopup.FOnClosePopup = rtl.createCallback(this,"DoOnPopupClose");
      this.FAppearance = $mod.TTMSFNCEditorDropDownEditAppearance.$create("Create$1");
      this.FAppearance.FOnInternalChanged = rtl.createCallback(this,"DoOnAppearanceChanged");
      this.FListBox = pas["WEBLib.TMSFNCListBox"].TTMSFNCListBox.$create("Create$1",[this.FPopup]);
      this.FListBox.SetParent(this.FPopup);
      this.FListBox.FOnItemClick = rtl.createCallback(this,"DoOnListBoxItemClick");
      this.FListBox.FOnBeforeDrawItem = rtl.createCallback(this,"DoOnBeforeDrawItem");
      this.FListBox.FOnBeforeDrawItemText = rtl.createCallback(this,"DoOnBeforeDrawItemText");
      this.FListBox.FTreeView.FOnMouseMove = rtl.createCallback(this,"DoOnMouseMove");
      this.FListBox.SetAlignWithMargins(true);
      this.FListBox.FMargins.SetTop(1);
      this.FListBox.FMargins.SetLeft(1);
      this.FListBox.FMargins.SetRight(1);
      this.FListBox.FMargins.SetBottom(1);
      this.FListBox.FOnKeyDown = rtl.createCallback(this,"DoOnListBoxKeyDown");
      this.FListBox.FTreeView.FOnKeyDown = rtl.createCallback(this,"DoOnListBoxKeyDown");
      this.FCalendar = pas["WEBLib.TMSFNCCalendar"].TTMSFNCCalendar.$create("Create$1",[this.FPopup]);
      this.FCalendar.FInteraction.SetAllowMonthSelection(true);
      this.FCalendar.FInteraction.SetAllowYearSelection(true);
      this.FCalendar.SetParent(this.FPopup);
      this.FCalendar.FInteraction.SetMultiSelect(false);
      this.FCalendar.FOnSelectDate = rtl.createCallback(this,"DoOnCalendarSelectDate");
      this.FTimeSelector = pas["WEBLib.TMSFNCDigitalTimeSelector"].TTMSFNCDigitalTimeSelector.$create("Create$1",[this.FPopup]);
      this.FTimeSelector.SetParent(this.FPopup);
      this.FTimeSelector.FOnTimeSelected = rtl.createCallback(this,"DoOnTimeSelected");
      this.ResetListBox();
      this.ResetCalendar();
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FListBox");
      rtl.free(this,"FAppearance");
      rtl.free(this,"FPopup");
      pas["WEBLib.TMSFNCEdit"].TTMSFNCEdit.Destroy.call(this);
    };
    this.GetListBoxItemHeight = function () {
      var Result = 0;
      Result = 30;
      if (this.FListBox != null) Result = Math.round(this.FListBox.FItemsAppearance.GetFixedHeight());
      return Result;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCCustomEditorDropDownEdit.isPrototypeOf(Source)) {
        this.FDateTime = rtl.as(Source,$mod.TTMSFNCCustomEditorDropDownEdit).FDateTime;
        this.FListBox.Assign(rtl.as(Source,$mod.TTMSFNCCustomEditorDropDownEdit).FListBox);
        this.FAppearance.Assign(rtl.as(Source,$mod.TTMSFNCCustomEditorDropDownEdit).FAppearance);
      } else pas["WEBLib.Controls"].TControl.Assign.apply(this,arguments);
    };
    this.BeginUpdate$2 = function () {
      this.FUpdateCount$1 += 1;
      pas["WEBLib.Controls"].TControl.BeginUpdate.call(this);
    };
    this.EndUpdate$3 = function () {
      pas["WEBLib.Controls"].TCustomControl.EndUpdate.call(this);
      this.ApplyAppearance();
      this.Invalidate();
    };
    this.OpenDropDown = function () {
      if (this.FDropDownType !== $mod.TTMSFNCEditorDropDownEditType.ddetEdit) {
        this.FPopup.SetPlacementControl(this);
        this.FPopup.FVerticalOffset = 2;
        this.FPopup.FStaysOpen = true;
        var $tmp = this.FDropDownType;
        if (($tmp === $mod.TTMSFNCEditorDropDownEditType.ddetComboEdit) || ($tmp === $mod.TTMSFNCEditorDropDownEditType.ddetComboBox)) {
          this.FPopup.SetContentControl(this.FListBox);
          this.FListBox.SetVisible(true);
          this.FListBox.SetItemIndex(this.FListBoxItemIndex);
        } else if ($tmp === $mod.TTMSFNCEditorDropDownEditType.ddetDatePicker) {
          this.FPopup.SetContentControl(this.FCalendar);
          this.FCalendar.SetVisible(true);
          this.FCalendar.SetDate(this.FDateTime);
        } else if ($tmp === $mod.TTMSFNCEditorDropDownEditType.ddetTimePicker) {
          this.FPopup.SetContentControl(this.FTimeSelector);
          this.FTimeSelector.SetVisible(true);
          this.FTimeSelector.SetSelectedTime(pas.SysUtils.EncodeTime(pas.DateUtils.HourOf(this.FDateTime),pas.DateUtils.MinuteOf(this.FDateTime),pas.DateUtils.SecondOf(this.FDateTime),0));
        };
        this.FPopup.SetDropDownHeight(this.FDropDownHeight);
        this.FPopup.SetDropDownWidth(this.FDropDownWidth);
        this.FPopup.SetIsOpen(true);
        this.FPopup.Popup(false);
      } else this.SetFocus();
      if (!this.FHideEdit) {
        if (!this.FDisableEditKeyInput) this.FPopup.FFocusedControl = this;
        this.SelectAll();
        this.SetSelStart(this.GetT().length);
      } else this.SetVisible(false);
    };
    this.CloseDropDown = function () {
      if (this.FPopup.FIsOpen) {
        this.FPopup.SetIsOpen(false);
        this.DoDropDownClose();
      };
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCEditorDropDownEdit",this.TTMSFNCCustomEditorDropDownEdit,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Appearance",2,$mod.$rtti["TTMSFNCEditorDropDownEditAppearance"],"FAppearance","SetAppearance");
    $r.addProperty("DateTime",0,pas.System.$rtti["TDateTime"],"FDateTime","FDateTime");
    $r.addProperty("Items",3,pas["WEBLib.TMSFNCListBox"].$rtti["TTMSFNCListBoxItems"],"GetItems","SetItems");
    $r.addProperty("ItemIndex",3,rtl.longint,"GetItemIndex","SetItemIndex");
    $r.addProperty("DropDownType",2,$mod.$rtti["TTMSFNCEditorDropDownEditType"],"FDropDownType","SetDropDownType");
    $r.addProperty("DropDownWidth",0,rtl.longint,"FDropDownWidth","FDropDownWidth",4,{Default: 100});
    $r.addProperty("DropDownHeight",0,rtl.longint,"FDropDownHeight","FDropDownHeight",4,{Default: 150});
    $r.addProperty("DropDownStayOpen",0,rtl.boolean,"FDropDownStayOpen","FDropDownStayOpen",4,{Default: false});
    $r.addProperty("HideEdit",2,rtl.boolean,"FHideEdit","SetHideEdit",4,{Default: false});
    $r.addProperty("DisableEditKeyInput",2,rtl.boolean,"FDisableEditKeyInput","SetDisableEditKeyInput",4,{Default: false});
    $r.addProperty("OnItemChanged",0,$mod.$rtti["TTMSFNCEditorDropDownEditItemTextEvent"],"FOnItemChanged","FOnItemChanged");
    $r.addProperty("OnItemSelected",0,$mod.$rtti["TTMSFNCEditorDropDownEditItemTextEvent"],"FOnItemSelected","FOnItemSelected");
    $r.addProperty("OnDropDownClosed",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDropDownClosed","FOnDropDownClosed");
    $r.addProperty("OnDropDownKeyDown",0,$mod.$rtti["TTMSFNCEditorDropDownEditKeyEvent"],"FOnDropDownKeyDown","FOnDropDownKeyDown");
    $r.addProperty("OnEditKeyDown",0,$mod.$rtti["TTMSFNCEditorDropDownEditKeyEvent"],"FOnEditKeyDown","FOnEditKeyDown");
    $r.addProperty("OnGetFormatSettings",0,$mod.$rtti["TTMSFNCEditorDropDownEditGetFormatSettings"],"FOnGetFormatSettings","FOnGetFormatSettings");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
},["WEBLib.Graphics","DateUtils","WEBLib.TMSFNCUtils"]);
rtl.module("WEBLib.TMSFNCFilterDialog",["System","Classes","Types","UITypes","WEBLib.TMSFNCCustomDialog","WEBLib.Controls","WEBLib.TMSFNCTypes","WEBLib.TMSFNCEditorPanel","WEBLib.TMSFNCEditorButton","TMS.TMSFNCValue","TMS.TMSFNCFilterBuilder","WEBLib.TMSFNCCustomControl","WEBLib.TMSFNCGraphics","WEBLib.TMSFNCGraphicsTypes","WEBLib.TMSFNCEditorDropDownEdit","SysUtils","Generics.Collections","WEBLib.Forms","DB","WEBLib.StdCtrls","WEBLib.ExtCtrls","WEBLib.ExtCtrls","Web"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.MAJ_VER = 1;
  this.MIN_VER = 0;
  this.REL_VER = 0;
  this.BLD_VER = 1;
  this.COMBOTYPES = rtl.createSet(pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtBoolean,pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtDateTime,pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtDate,pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtTime);
  this.TTMSFNCADDBITMAP = "data:image/svg+xml;base64," + "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9z" + "dmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjRweCIgaGVpZ2h0PS" + "IyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSI+CjxnIGlkPSJzdXJmYWNlMSI+CjxwYXRoIHN0" + "eWxlPSIgc3Ryb2tlOm5vbmU7ZmlsbC1ydWxlOm5vbnplcm87ZmlsbDojMDA3N2JlOyIgZD0iTSAxMiAwIEMgNS4zOD" + "I4MTIgMCAwIDUuMzgyODEyIDAgMTIgQyAwIDE4LjYxNzE4OCA1LjM4MjgxMiAyNCAxMiAyNCBDIDE4LjYxNzE4OCAy" + "NCAyNCAxOC42MTcxODggMjQgMTIgQyAyNCA1LjM4MjgxMiAxOC42MTcxODggMCAxMiAwIFogTSAxMiAyMi4xNDA2Mj" + "UgQyA2LjQxMDE1NiAyMi4xNDA2MjUgMS44NTkzNzUgMTcuNTkzNzUgMS44NTkzNzUgMTIgQyAxLjg1OTM3NSA2LjQw" + "NjI1IDYuNDEwMTU2IDEuODU5Mzc1IDEyIDEuODU5Mzc1IEMgMTcuNTg5ODQ0IDEuODU5Mzc1IDIyLjE0MDYyNSA2Lj" + "QwNjI1IDIyLjE0MDYyNSAxMiBDIDIyLjE0MDYyNSAxNy41OTM3NSAxNy41OTM3NSAyMi4xNDA2MjUgMTIgMjIuMTQw" + "NjI1IFogTSAxMiAyMi4xNDA2MjUgIi8+CjxwYXRoIHN0eWxlPSIgc3Ryb2tlOm5vbmU7ZmlsbC1ydWxlOm5vbnplcm" + "87ZmlsbDojMDA3N2JlO2ZpbGwtb3BhY2l0eToxOyIgZD0iTSAxNi42NDg0MzggMTAuOTg4MjgxIEwgMTIuOTI5Njg4" + "IDEwLjk4ODI4MSBMIDEyLjkyOTY4OCA3LjI2OTUzMSBDIDEyLjkyOTY4OCA2Ljc1MzkwNiAxMi41MTU2MjUgNi4zMz" + "k4NDQgMTIgNi4zMzk4NDQgQyAxMS40ODQzNzUgNi4zMzk4NDQgMTEuMDcwMzEyIDYuNzUzOTA2IDExLjA3MDMxMiA3" + "LjI2OTUzMSBMIDExLjA3MDMxMiAxMC45ODgyODEgTCA3LjM1MTU2MiAxMC45ODgyODEgQyA2LjgzOTg0NCAxMC45OD" + "gyODEgNi40MjE4NzUgMTEuNDAyMzQ0IDYuNDIxODc1IDExLjkxNzk2OSBDIDYuNDIxODc1IDEyLjQyOTY4OCA2Ljgz" + "OTg0NCAxMi44NDc2NTYgNy4zNTE1NjIgMTIuODQ3NjU2IEwgMTEuMDcwMzEyIDEyLjg0NzY1NiBMIDExLjA3MDMxMi" + "AxNi41NjI1IEMgMTEuMDcwMzEyIDE3LjA3ODEyNSAxMS40ODQzNzUgMTcuNDkyMTg4IDEyIDE3LjQ5MjE4OCBDIDEy" + "LjUxNTYyNSAxNy40OTIxODggMTIuOTI5Njg4IDE3LjA3ODEyNSAxMi45Mjk2ODggMTYuNTYyNSBMIDEyLjkyOTY4OC" + "AxMi44NDc2NTYgTCAxNi42NDg0MzggMTIuODQ3NjU2IEMgMTcuMTYwMTU2IDEyLjg0NzY1NiAxNy41NzgxMjUgMTIu" + "NDI5Njg4IDE3LjU3ODEyNSAxMS45MTc5NjkgQyAxNy41NzgxMjUgMTEuNDAyMzQ0IDE3LjE2MDE1NiAxMC45ODgyOD" + "EgMTYuNjQ4NDM4IDEwLjk4ODI4MSBaIE0gMTYuNjQ4NDM4IDEwLjk4ODI4MSAiLz4KPC9nPgo8L3N2Zz4K";
  this.TTMSFNCREMOVEBITMAP = "data:image/svg+xml;base64," + "PHN2ZyBpZD0iSWNvbnMiIGhlaWdodD0iNTEyIiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSI1MTIiIH" + "htbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iIzAwNzdiZSIgZD0ibTEyIDFhMTEgMTEgMCAxIDAg" + "MTEgMTEgMTEuMDEzIDExLjAxMyAwIDAgMCAtMTEtMTF6bTAgMjBhOSA5IDAgMSAxIDktOSA5LjAxIDkuMDEgMCAwIDEgLTkgOXoiLz" + "48cGF0aCBmaWxsPSIjMDA3N2JlIiBkPSJtMTYgMTFoLThhMSAxIDAgMCAwIDAgMmg4YTEgMSAwIDAgMCAwLTJ6Ii8+PC9zdmc+";
  this.TTMSFNCNOTBITMAP = "data:image/svg+xml;base64," + "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzd" + "HJhdG9yIDE5LjAuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPg0KPHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJDYX" + "BhXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0" + "iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgNTEyIDUxMjsiIHhtbDpzcGFjZT0icHJlc2VydmUi" + "Pg0KPGc+DQoJPGc+DQoJCTxwYXRoIGQ9Ik0yNTYsMEMxMTQuODQ0LDAsMCwxMTQuODQ0LDAsMjU2czExNC44NDQsMjU2LDI1NiwyNTZzMjU2LTExNC44NDQsMjU2L" + "TI1NlMzOTcuMTU2LDAsMjU2LDB6IE0yNTYsNDQ4DQoJCQljLTEwNS44NjUsMC0xOTItODYuMTM1LTE5Mi0xOTJjMC00MC40MDYsMTIuMjUtNzguNjA0LDM1LjU0Mi" + "0xMTEuMTk4bDI2Ny42NTYsMjY3LjY1NkMzMzQuNjA0LDQzNS43NSwyOTYuNDA2LDQ0OCwyNTYsNDQ4eg0KCQkJIE00MTIuNDU4LDM2Ny4xOThMMTQ0LjgwMiw5OS4" + "1NDJDMTc3LjM5Niw3Ni4yNSwyMTUuNTk0LDY0LDI1Niw2NGMxMDUuODY1LDAsMTkyLDg2LjEzNSwxOTIsMTkyDQoJCQlDNDQ4LDI5Ni40MDYsNDM1Ljc1LDMzNC42" + "MDQsNDEyLjQ1OCwzNjcuMTk4eiIgZmlsbD0iIzg4ODg4OCIvPg0KCTwvZz4NCjwvZz4NCjwvc3ZnPg0K";
  rtl.createClass(this,"TTMSFNCFilterDialogUILanguage",pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderCustomUILanguage,function () {
    var $r = this.$rtti;
    $r.addProperty("Clear",12,rtl.string,"FClear","FClear",4,{stored: "IsClearStored"});
    $r.addProperty("Apply",12,rtl.string,"FApply","FApply",4,{stored: "IsApplyStored"});
    $r.addProperty("OK",12,rtl.string,"FOK","FOK",4,{stored: "IsOKStored"});
    $r.addProperty("Cancel",12,rtl.string,"FCancel","FCancel",4,{stored: "IsCancelStored"});
    $r.addProperty("Close",12,rtl.string,"FClose","FClose",4,{stored: "IsCloseStored"});
    $r.addProperty("Caption",12,rtl.string,"FCaption","FCaption",4,{stored: "IsCaptionStored"});
    $r.addProperty("AndOperatorText",12,rtl.string,"FAndOperatorText","FAndOperatorText",4,{stored: "IsAndOperatorTextStored"});
    $r.addProperty("OrOperatorText",12,rtl.string,"FOrOperatorText","FOrOperatorText",4,{stored: "IsOrOperatorTextStored"});
    $r.addProperty("EqualOperatorText",12,rtl.string,"FEqualOperatorText","FEqualOperatorText",4,{stored: "IsEqualOperatorTextStored"});
    $r.addProperty("NotEqualOperatorText",12,rtl.string,"FNotEqualOperatorText","FNotEqualOperatorText",4,{stored: "IsNotEqualOperatorTextStored"});
    $r.addProperty("SmallerThanOperatorText",12,rtl.string,"FSmallerThanOperatorText","FSmallerThanOperatorText",4,{stored: "IsSmallerThanOperatorTextStored"});
    $r.addProperty("SmallerThanOrEqualOperatorText",12,rtl.string,"FSmallerThanOrEqualOperatorText","FSmallerThanOrEqualOperatorText",4,{stored: "IsSmallerThanOrEqualOperatorTextStored"});
    $r.addProperty("LargerThanOperatorText",12,rtl.string,"FLargerThanOperatorText","FLargerThanOperatorText",4,{stored: "IsLargerThanOperatorTextStored"});
    $r.addProperty("LargerThanOrEqualOperatorText",12,rtl.string,"FLargerThanOrEqualOperatorText","FLargerThanOrEqualOperatorText",4,{stored: "IsLargerThanOrEqualOperatorTextStored"});
    $r.addProperty("EmptyOperatorText",12,rtl.string,"FEmptyOperatorText","FEmptyOperatorText",4,{stored: "IsEmptyOperatorTextStored"});
    $r.addProperty("NotEmptyOperatorText",12,rtl.string,"FNotEmptyOperatorText","FNotEmptyOperatorText",4,{stored: "IsNotEmptyOperatorTextStored"});
    $r.addProperty("StartsWithOperatorText",12,rtl.string,"FStartsWithOperatorText","FStartsWithOperatorText",4,{stored: "IsStartsWithOperatorTextStored"});
    $r.addProperty("EndsWithOperatorText",12,rtl.string,"FEndsWithOperatorText","FEndsWithOperatorText",4,{stored: "IsEndsWithOperatorTextStored"});
    $r.addProperty("ContainsOperatorText",12,rtl.string,"FContainsOperatorText","FContainsOperatorText",4,{stored: "IsContainsOperatorTextStored"});
    $r.addProperty("NotContainsOperatorText",12,rtl.string,"FNotContainsOperatorText","FNotContainsOperatorText",4,{stored: "IsNotContainsOperatorTextStored"});
    $r.addProperty("TrueText",12,rtl.string,"FTrueText","FTrueText",4,{stored: "TrueOperatorTextStored"});
    $r.addProperty("FalseText",12,rtl.string,"FFalseText","FFalseText",4,{stored: "FalseOperatorTextStored"});
    $r.addProperty("AddExpression",12,rtl.string,"FAddExpression","FAddExpression",4,{stored: "IsAddExpressionStored"});
    $r.addProperty("AddGroup",12,rtl.string,"FAddGroup","FAddGroup",4,{stored: "IsAddGroupStored"});
    $r.addProperty("AddHint",12,rtl.string,"FAddHint","FAddHint",4,{stored: "IsAddHintStored"});
    $r.addProperty("RemoveHint",12,rtl.string,"FRemoveHint","FRemoveHint",4,{stored: "IsRemoveHintStored"});
    $r.addProperty("NotHint",12,rtl.string,"FNotHint","FNotHint",4,{stored: "IsNotHintStored"});
    $r.addProperty("ColumnNameHint",12,rtl.string,"FColumnNameHint","FColumnNameHint",4,{stored: "IsColumnNameHintStored"});
    $r.addProperty("OperatorHint",12,rtl.string,"FOperatorHint","FOperatorHint",4,{stored: "IsOperatorHintStored"});
    $r.addProperty("ValueHint",12,rtl.string,"FValueHint","FValueHint",4,{stored: "IsValueHintStored"});
  });
  this.TTMSFNCFilterDialogButton = {"0": "fdbApply", fdbApply: 0, "1": "fdbCancel", fdbCancel: 1, "2": "fdbClear", fdbClear: 2, "3": "fdbOk", fdbOk: 3};
  this.$rtti.$Enum("TTMSFNCFilterDialogButton",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TTMSFNCFilterDialogButton});
  this.$rtti.$Set("TTMSFNCFilterDialogButtons",{comptype: this.$rtti["TTMSFNCFilterDialogButton"]});
  rtl.createClass(this,"TTMSFNCFilterDialogCustomOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FUILanguage = null;
      this.FOnInternalChanged = null;
      this.FButtons = {};
    };
    this.$final = function () {
      this.FUILanguage = undefined;
      this.FOnInternalChanged = undefined;
      this.FButtons = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetUILanguage = function (Value) {
      this.FUILanguage.Assign(Value);
      this.DoInternalChanged();
    };
    this.SetButtons = function (Value) {
      if (rtl.neSet(this.FButtons,Value)) {
        this.FButtons = rtl.refSet(Value);
        this.DoInternalChanged();
      };
    };
    this.IsButtonsStored = function () {
      var Result = false;
      Result = rtl.neSet(this.FButtons,rtl.createSet($mod.TTMSFNCFilterDialogButton.fdbApply,$mod.TTMSFNCFilterDialogButton.fdbClear,$mod.TTMSFNCFilterDialogButton.fdbCancel));
      return Result;
    };
    this.DoInternalChanged = function () {
      if (this.FOnInternalChanged != null) this.FOnInternalChanged(this);
    };
    this.Create$1 = function (AOwner) {
      pas.System.TObject.Create.call(this);
      this.FUILanguage = $mod.TTMSFNCFilterDialogUILanguage.$create("Create$1");
      this.FButtons = rtl.createSet($mod.TTMSFNCFilterDialogButton.fdbApply,$mod.TTMSFNCFilterDialogButton.fdbClear,$mod.TTMSFNCFilterDialogButton.fdbCancel);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FUILanguage");
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCFilterDialogCustomOptions.isPrototypeOf(Source)) {
        this.FUILanguage.Assign(rtl.as(Source,$mod.TTMSFNCFilterDialogCustomOptions).FUILanguage);
        this.FButtons = rtl.refSet(rtl.as(Source,$mod.TTMSFNCFilterDialogCustomOptions).FButtons);
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
  });
  rtl.createClass(this,"TTMSFNCFilterDialogOptions",this.TTMSFNCFilterDialogCustomOptions,function () {
    var $r = this.$rtti;
    $r.addProperty("UILanguage",2,$mod.$rtti["TTMSFNCFilterDialogUILanguage"],"FUILanguage","SetUILanguage");
    $r.addProperty("Buttons",14,$mod.$rtti["TTMSFNCFilterDialogButtons"],"FButtons","SetButtons",4,{stored: "IsButtonsStored"});
  });
  this.$rtti.$MethodVar("TTMSFNCFilterDialogDarkStyleChanged",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ADarkStyle",rtl.boolean]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCFilterDialogAppearance",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FExpressionValueFill = null;
      this.FExpressionColumnFill = null;
      this.FExpressionOperatorFont = null;
      this.FGroupFont = null;
      this.FExpressionOperatorFill = null;
      this.FGroupFill = null;
      this.FExpressionValueFont = null;
      this.FExpressionColumnFont = null;
      this.FOnInternalChanged = null;
      this.FIndent = 0;
      this.FItemHeight = 0;
      this.FItemRounding = 0;
      this.FItemControlsMargins = null;
      this.FConnectionLine = null;
      this.FHoverFill = null;
      this.FHoverPartStroke = null;
      this.FDropDownHoverFont = null;
      this.FDropDownHoverFill = null;
      this.FDarkStyleControls = false;
      this.FOnDarkStyleChanged = null;
      this.FThemeColor = 0;
      this.FThemeFontColor = 0;
    };
    this.$final = function () {
      this.FExpressionValueFill = undefined;
      this.FExpressionColumnFill = undefined;
      this.FExpressionOperatorFont = undefined;
      this.FGroupFont = undefined;
      this.FExpressionOperatorFill = undefined;
      this.FGroupFill = undefined;
      this.FExpressionValueFont = undefined;
      this.FExpressionColumnFont = undefined;
      this.FOnInternalChanged = undefined;
      this.FItemControlsMargins = undefined;
      this.FConnectionLine = undefined;
      this.FHoverFill = undefined;
      this.FHoverPartStroke = undefined;
      this.FDropDownHoverFont = undefined;
      this.FDropDownHoverFill = undefined;
      this.FOnDarkStyleChanged = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetExpressionColumnFill = function (Value) {
      this.FExpressionColumnFill.Assign(Value);
      this.DoOnFillChanged(this.FExpressionColumnFill);
    };
    this.SetExpressionColumnFont = function (Value) {
      this.FExpressionColumnFont.Assign(Value);
      this.DoOnFontChanged(this.FExpressionColumnFont);
    };
    this.SetExpressionOperatorFill = function (Value) {
      this.FExpressionOperatorFill.Assign(Value);
      this.DoOnFillChanged(this.FExpressionOperatorFill);
    };
    this.SetExpressionOperatorFont = function (Value) {
      this.FExpressionOperatorFont.Assign(Value);
      this.DoOnFontChanged(this.FExpressionOperatorFont);
    };
    this.SetExpressionValueFill = function (Value) {
      this.FExpressionValueFill.Assign(Value);
      this.DoOnFillChanged(this.FExpressionValueFill);
    };
    this.SetExpressionValueFont = function (Value) {
      this.FExpressionValueFont.Assign(Value);
      this.DoOnFontChanged(this.FExpressionValueFont);
    };
    this.SetGroupFill = function (Value) {
      this.FGroupFill.Assign(Value);
      this.DoOnFillChanged(this.FGroupFill);
    };
    this.SetGroupFont = function (Value) {
      this.FGroupFont.Assign(Value);
      this.DoOnFontChanged(this.FGroupFont);
    };
    this.SetIndent = function (Value) {
      if (this.FIndent !== Value) {
        this.FIndent = Value;
        this.DoChanged();
      };
    };
    this.SetItemHeight = function (Value) {
      if (this.FItemHeight !== Value) {
        this.FItemHeight = Value;
        this.DoChanged();
      };
    };
    this.SetItemRounding = function (Value) {
      if (this.FItemRounding !== Value) {
        this.FItemRounding = Value;
        this.DoChanged();
      };
    };
    this.SetItemControlsMargins = function (Value) {
      this.FItemControlsMargins.Assign(Value);
      this.DoChanged();
    };
    this.SetConnectionLine = function (Value) {
      this.FConnectionLine.Assign(Value);
      this.DoOnStrokeChanged(this.FConnectionLine);
    };
    this.SetHoverFill = function (Value) {
      this.FHoverFill.Assign(Value);
      this.DoOnFillChanged(this.FHoverFill);
    };
    this.SetHoverPartStroke = function (Value) {
      this.FHoverPartStroke.Assign(Value);
      this.DoOnStrokeChanged(this.FHoverPartStroke);
    };
    this.SetDropDownHoverFill = function (Value) {
      this.FDropDownHoverFill.Assign(Value);
      this.DoOnFillChanged(this.FDropDownHoverFill);
    };
    this.SetDropDownHoverFont = function (Value) {
      this.FDropDownHoverFont.Assign(Value);
      this.DoOnFontChanged(this.FDropDownHoverFont);
    };
    this.SetDarkStyleControls = function (Value) {
      if (this.FDarkStyleControls !== Value) {
        this.FDarkStyleControls = Value;
        this.DoDarkStyleChanged(this.FDarkStyleControls);
      };
    };
    this.SetThemeColor = function (Value) {
      if (this.FThemeColor !== Value) {
        this.FThemeColor = Value;
        this.DoChanged();
      };
    };
    this.IsThemeColorStored = function () {
      var Result = false;
      Result = this.FThemeColor !== 12482304;
      return Result;
    };
    this.IsThemeFontColorStored = function () {
      var Result = false;
      Result = this.FThemeFontColor !== 16777215;
      return Result;
    };
    this.SetThemeFontColor = function (Value) {
      this.FThemeFontColor = Value;
    };
    this.ChangeDPIScale = function (M, D) {
      this.FGroupFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FGroupFont.FHeight,M,D));
      this.FExpressionColumnFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FExpressionColumnFont.FHeight,M,D));
      this.FExpressionOperatorFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FExpressionOperatorFont.FHeight,M,D));
      this.FExpressionValueFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FExpressionValueFont.FHeight,M,D));
      this.FDropDownHoverFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FDropDownHoverFont.FHeight,M,D));
      this.FItemControlsMargins.SetTop(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FItemControlsMargins.FTop,M,D));
      this.FItemControlsMargins.SetBottom(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FItemControlsMargins.FBottom,M,D));
      this.FItemControlsMargins.SetLeft(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FItemControlsMargins.FLeft,M,D));
      this.FItemControlsMargins.SetRight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FItemControlsMargins.FRight,M,D));
      this.FIndent = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FIndent,M,D);
      this.FItemHeight = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FItemHeight,M,D);
      this.FItemRounding = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FItemRounding,M,D);
    };
    this.DoOnFillChanged = function (Sender) {
      this.DoChanged();
    };
    this.DoOnFontChanged = function (Sender) {
      this.DoChanged();
    };
    this.DoOnStrokeChanged = function (Sender) {
      this.DoChanged();
    };
    this.DoChanged = function () {
      if (this.FOnInternalChanged != null) this.FOnInternalChanged(this);
    };
    this.DoDarkStyleChanged = function (AIsDark) {
      if (this.FOnDarkStyleChanged != null) this.FOnDarkStyleChanged(this,AIsDark);
    };
    this.Create$1 = function (AOwner) {
      this.FThemeColor = 12482304;
      this.FThemeFontColor = 16777215;
      this.FGroupFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,12482304,8421504,-1,-1]);
      this.FExpressionColumnFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,25600,8421504,-1,-1]);
      this.FExpressionOperatorFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,13828244,8421504,-1,-1]);
      this.FExpressionValueFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,9109504,8421504,-1,-1]);
      this.FHoverFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(149,213,246),8421504,-1,-1]);
      this.FDropDownHoverFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(149,213,246),8421504,-1,-1]);
      this.FGroupFill.FOnChanged = rtl.createCallback(this,"DoOnFillChanged");
      this.FExpressionColumnFill.FOnChanged = rtl.createCallback(this,"DoOnFillChanged");
      this.FExpressionOperatorFill.FOnChanged = rtl.createCallback(this,"DoOnFillChanged");
      this.FExpressionValueFill.FOnChanged = rtl.createCallback(this,"DoOnFillChanged");
      this.FHoverFill.FOnChanged = rtl.createCallback(this,"DoOnFillChanged");
      this.FDropDownHoverFill.FOnChanged = rtl.createCallback(this,"DoOnFillChanged");
      this.FGroupFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FGroupFont.SetColor(16777215);
      this.FExpressionColumnFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FExpressionColumnFont.SetColor(16777215);
      this.FExpressionOperatorFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FExpressionOperatorFont.SetColor(16777215);
      this.FExpressionValueFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FExpressionValueFont.SetColor(16777215);
      this.FDropDownHoverFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FDropDownHoverFont.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(45,45,45));
      this.FGroupFont.FOnChanged = rtl.createCallback(this,"DoOnFontChanged");
      this.FExpressionColumnFont.FOnChanged = rtl.createCallback(this,"DoOnFontChanged");
      this.FExpressionOperatorFont.FOnChanged = rtl.createCallback(this,"DoOnFontChanged");
      this.FExpressionValueFont.FOnChanged = rtl.createCallback(this,"DoOnFontChanged");
      this.FDropDownHoverFont.FOnChanged = rtl.createCallback(this,"DoOnFontChanged");
      this.FConnectionLine = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskDot,9470064,1.0]);
      this.FHoverPartStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,16777215,1.0]);
      this.FConnectionLine.FOnChanged = rtl.createCallback(this,"DoOnStrokeChanged");
      this.FHoverPartStroke.FOnChanged = rtl.createCallback(this,"DoOnStrokeChanged");
      this.FItemControlsMargins = pas["WEBLib.TMSFNCTypes"].TTMSFNCMargins.$create("Create$1");
      this.FItemControlsMargins.SetTop(4);
      this.FItemControlsMargins.SetBottom(4);
      this.FItemControlsMargins.SetLeft(2);
      this.FItemControlsMargins.SetRight(18);
      this.FDarkStyleControls = false;
      this.FIndent = 20;
      this.FItemHeight = 30;
      this.FItemRounding = 4;
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FDropDownHoverFill");
      rtl.free(this,"FDropDownHoverFont");
      rtl.free(this,"FItemControlsMargins");
      rtl.free(this,"FConnectionLine");
      rtl.free(this,"FGroupFill");
      rtl.free(this,"FExpressionColumnFill");
      rtl.free(this,"FExpressionOperatorFill");
      rtl.free(this,"FExpressionValueFill");
      rtl.free(this,"FGroupFont");
      rtl.free(this,"FExpressionColumnFont");
      rtl.free(this,"FExpressionOperatorFont");
      rtl.free(this,"FExpressionValueFont");
      rtl.free(this,"FHoverFill");
      rtl.free(this,"FHoverPartStroke");
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCFilterDialogAppearance.isPrototypeOf(Source)) {
        this.FGroupFill.Assign(rtl.as(Source,$mod.TTMSFNCFilterDialogAppearance).FGroupFill);
        this.FExpressionColumnFill.Assign(rtl.as(Source,$mod.TTMSFNCFilterDialogAppearance).FExpressionColumnFill);
        this.FExpressionOperatorFill.Assign(rtl.as(Source,$mod.TTMSFNCFilterDialogAppearance).FExpressionOperatorFill);
        this.FExpressionValueFill.Assign(rtl.as(Source,$mod.TTMSFNCFilterDialogAppearance).FExpressionValueFill);
        this.FGroupFont.Assign(rtl.as(Source,$mod.TTMSFNCFilterDialogAppearance).FGroupFont);
        this.FExpressionColumnFont.Assign(rtl.as(Source,$mod.TTMSFNCFilterDialogAppearance).FExpressionColumnFont);
        this.FExpressionOperatorFont.Assign(rtl.as(Source,$mod.TTMSFNCFilterDialogAppearance).FExpressionOperatorFont);
        this.FExpressionValueFont.Assign(rtl.as(Source,$mod.TTMSFNCFilterDialogAppearance).FExpressionValueFont);
        this.FConnectionLine.Assign(rtl.as(Source,$mod.TTMSFNCFilterDialogAppearance).FConnectionLine);
        this.FHoverFill.Assign(rtl.as(Source,$mod.TTMSFNCFilterDialogAppearance).FHoverFill);
        this.FDropDownHoverFill.Assign(rtl.as(Source,$mod.TTMSFNCFilterDialogAppearance).FDropDownHoverFill);
        this.FDropDownHoverFont.Assign(rtl.as(Source,$mod.TTMSFNCFilterDialogAppearance).FDropDownHoverFont);
        this.FHoverPartStroke.Assign(rtl.as(Source,$mod.TTMSFNCFilterDialogAppearance).FHoverPartStroke);
        this.FItemControlsMargins.Assign(rtl.as(Source,$mod.TTMSFNCFilterDialogAppearance).FItemControlsMargins);
        this.FIndent = rtl.as(Source,$mod.TTMSFNCFilterDialogAppearance).FIndent;
        this.FItemHeight = rtl.as(Source,$mod.TTMSFNCFilterDialogAppearance).FItemHeight;
        this.FThemeColor = rtl.as(Source,$mod.TTMSFNCFilterDialogAppearance).FThemeColor;
        this.FThemeFontColor = rtl.as(Source,$mod.TTMSFNCFilterDialogAppearance).FThemeFontColor;
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    var $r = this.$rtti;
    $r.addProperty("GroupFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FGroupFill","SetGroupFill");
    $r.addProperty("ExpressionColumnFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FExpressionColumnFill","SetExpressionColumnFill");
    $r.addProperty("ExpressionOperatorFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FExpressionOperatorFill","SetExpressionOperatorFill");
    $r.addProperty("ExpressionValueFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FExpressionValueFill","SetExpressionValueFill");
    $r.addProperty("GroupFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FGroupFont","SetGroupFont");
    $r.addProperty("ExpressionColumnFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FExpressionColumnFont","SetExpressionColumnFont");
    $r.addProperty("ExpressionOperatorFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FExpressionOperatorFont","SetExpressionOperatorFont");
    $r.addProperty("ExpressionValueFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FExpressionValueFont","SetExpressionValueFont");
    $r.addProperty("HoverFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FHoverFill","SetHoverFill");
    $r.addProperty("HoverPartStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FHoverPartStroke","SetHoverPartStroke");
    $r.addProperty("ConnectionLine",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FConnectionLine","SetConnectionLine");
    $r.addProperty("DropDownHoverFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FDropDownHoverFill","SetDropDownHoverFill");
    $r.addProperty("DropDownHoverFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FDropDownHoverFont","SetDropDownHoverFont");
    $r.addProperty("Indent",2,rtl.longint,"FIndent","SetIndent",4,{Default: 20});
    $r.addProperty("ItemHeight",2,rtl.longint,"FItemHeight","SetItemHeight",4,{Default: 30});
    $r.addProperty("ItemRounding",2,rtl.longint,"FItemRounding","SetItemRounding",4,{Default: 4});
    $r.addProperty("ItemControlsMargins",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCMargins"],"FItemControlsMargins","SetItemControlsMargins");
    $r.addProperty("DarkStyleControls",2,rtl.boolean,"FDarkStyleControls","SetDarkStyleControls",4,{Default: false});
    $r.addProperty("ThemeColor",14,pas["WEBLib.Graphics"].$rtti["TColor"],"FThemeColor","SetThemeColor",4,{stored: "IsThemeColorStored"});
    $r.addProperty("ThemeFontColor",14,pas["WEBLib.Graphics"].$rtti["TColor"],"FThemeFontColor","SetThemeFontColor",4,{stored: "IsThemeFontColorStored"});
  });
  this.TTMSFNCFilterDialogDrawItemPart = {"0": "ddipNone", ddipNone: 0, "1": "ddipName", ddipName: 1, "2": "ddipOperator", ddipOperator: 2, "3": "ddipValue", ddipValue: 3, "4": "ddipExtraValue", ddipExtraValue: 4, "5": "ddipAdd", ddipAdd: 5, "6": "ddipDelete", ddipDelete: 6, "7": "ddipNot", ddipNot: 7};
  this.$rtti.$Enum("TTMSFNCFilterDialogDrawItemPart",{minvalue: 0, maxvalue: 7, ordtype: 1, enumtype: this.TTMSFNCFilterDialogDrawItemPart});
  this.TTMSFNCFilterDialogEditorType = {"0": "vetEdit", vetEdit: 0, "1": "vetComboEdit", vetComboEdit: 1, "2": "vetComboBox", vetComboBox: 2, "3": "vetDatePicker", vetDatePicker: 3, "4": "vetTimePicker", vetTimePicker: 4, "5": "vetCustom", vetCustom: 5};
  this.$rtti.$Enum("TTMSFNCFilterDialogEditorType",{minvalue: 0, maxvalue: 5, ordtype: 1, enumtype: this.TTMSFNCFilterDialogEditorType});
  rtl.recNewT(this,"TTMSFNCFilterDialogEditorProperties",function () {
    this.EditorPart = 0;
    this.EditorType = 0;
    this.EditorText = "";
    this.EditorDate = 0.0;
    this.$new = function () {
      var r = Object.create(this);
      r.EditorRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      return r;
    };
    this.$eq = function (b) {
      return (this.EditorPart === b.EditorPart) && (this.EditorType === b.EditorType) && (this.EditorText === b.EditorText) && (this.EditorDate === b.EditorDate) && this.EditorRect.$eq(b.EditorRect);
    };
    this.$assign = function (s) {
      this.EditorPart = s.EditorPart;
      this.EditorType = s.EditorType;
      this.EditorText = s.EditorText;
      this.EditorDate = s.EditorDate;
      this.EditorRect.$assign(s.EditorRect);
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCFilterDialogEditorProperties",{},this);
    $r.addField("EditorPart",$mod.$rtti["TTMSFNCFilterDialogDrawItemPart"]);
    $r.addField("EditorType",$mod.$rtti["TTMSFNCFilterDialogEditorType"]);
    $r.addField("EditorText",rtl.string);
    $r.addField("EditorDate",pas.System.$rtti["TDateTime"]);
    $r.addField("EditorRect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]);
  });
  this.$rtti.$MethodVar("TTMSFNCFilterDialogGetFilterBuilder",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFilterBuilder",pas["TMS.TMSFNCFilterBuilder"].$rtti["TTMSFNCFilterBuilder"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCFilterDialogGetFilterBuilderColumns",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFilterBuilder",pas["TMS.TMSFNCFilterBuilder"].$rtti["TTMSFNCFilterBuilder"]],["ADataColumns",pas["TMS.TMSFNCFilterBuilder"].$rtti["TTMSFNCFilterBuilderColumns"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCFilterDialogGetFormatSettings",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFormatSettings",pas.SysUtils.$rtti["TFormatSettings"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCFilterDialogShowGroupEditor",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGroup",pas["TMS.TMSFNCFilterBuilder"].$rtti["TTMSFNCFilterBuilderGroup"]],["AEditorProperties",this.$rtti["TTMSFNCFilterDialogEditorProperties"],1],["APossibleValues",pas.Classes.$rtti["TStringList"]],["AFixed",rtl.boolean,1],["AShow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCFilterDialogShowExpressionEditor",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AExpression",pas["TMS.TMSFNCFilterBuilder"].$rtti["TTMSFNCFilterBuilderExpression"]],["AEditorProperties",this.$rtti["TTMSFNCFilterDialogEditorProperties"],1],["AValues",pas.Classes.$rtti["TStringList"]],["AFixed",rtl.boolean,1],["AShow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCFilterDialogButtonClicked",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFilterBuilder",pas["TMS.TMSFNCFilterBuilder"].$rtti["TTMSFNCFilterBuilder"]],["AClose",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCFilterDialogButtonClearClicked",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFilterBuilder",pas["TMS.TMSFNCFilterBuilder"].$rtti["TTMSFNCFilterBuilder"]],["AClear",rtl.boolean,1]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCFilterDialogDrawItem",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FExpression = null;
      this.FGroup = null;
      this.FIsSelected = false;
      this.FRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FColumnNameRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FOperatorRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FValueRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FColumnNameArrowRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FOperatorArrowRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FValueArrowRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FColumnNameTextRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FOperatorTextRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FValueTextRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FArrowSpace = 0.0;
      this.FColumnNameText = "";
      this.FOperatorText = "";
      this.FValueText = "";
      this.FValueType = 0;
      this.FLevel = 0;
      this.FIndex = 0;
      this.FEndIndex = 0;
      this.FRounding = 0.0;
      this.FAddRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FDeleteRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FExtraValueText = "";
      this.FExtraValueTextRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FExtraValueRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FExtraValueArrowRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FValue = undefined;
      this.FNotRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FIsInverted = false;
    };
    this.$final = function () {
      this.FExpression = undefined;
      this.FGroup = undefined;
      this.FRect = undefined;
      this.FColumnNameRect = undefined;
      this.FOperatorRect = undefined;
      this.FValueRect = undefined;
      this.FColumnNameArrowRect = undefined;
      this.FOperatorArrowRect = undefined;
      this.FValueArrowRect = undefined;
      this.FColumnNameTextRect = undefined;
      this.FOperatorTextRect = undefined;
      this.FValueTextRect = undefined;
      this.FAddRect = undefined;
      this.FDeleteRect = undefined;
      this.FExtraValueTextRect = undefined;
      this.FExtraValueRect = undefined;
      this.FExtraValueArrowRect = undefined;
      this.FNotRect = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function () {
      this.FExpression = null;
      this.FGroup = null;
      this.FIsSelected = false;
      this.FRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(-1,-1,-1,-1));
      this.FColumnNameRect.$assign(this.FRect);
      this.FOperatorRect.$assign(this.FRect);
      this.FValueRect.$assign(this.FRect);
      this.FColumnNameArrowRect.$assign(this.FRect);
      this.FOperatorArrowRect.$assign(this.FRect);
      this.FValueArrowRect.$assign(this.FRect);
      this.FColumnNameTextRect.$assign(this.FRect);
      this.FOperatorTextRect.$assign(this.FRect);
      this.FValueTextRect.$assign(this.FRect);
      this.FExtraValueRect.$assign(this.FRect);
      this.FExtraValueTextRect.$assign(this.FRect);
      this.FExtraValueArrowRect.$assign(this.FRect);
      this.FNotRect.$assign(this.FRect);
      this.FAddRect.$assign(this.FRect);
      this.FDeleteRect.$assign(this.FRect);
      this.FArrowSpace = 20;
      this.FColumnNameText = "";
      this.FOperatorText = "";
      this.FValueText = "";
      this.FExtraValueText = "";
      this.FValueType = pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtAutomatic;
      this.FLevel = -1;
      this.FIndex = -1;
      this.FEndIndex = -1;
      this.FRounding = 4;
      this.FIsInverted = false;
      this.FValue = pas["TMS.TMSFNCValue"].TValueToFNCValue(pas.RTTI.TValue.$clone(pas.RTTI.TValue.Empty()));
      return this;
    };
    this.Destroy = function () {
      this.FGroup = null;
      this.FExpression = null;
      pas.System.TObject.Destroy.call(this);
    };
  });
  rtl.createClass(this,"TTMSFNCFilterDialogDrawItemList",pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem,function () {
    this.AddItem = function () {
      var Result = null;
      var it = null;
      it = $mod.TTMSFNCFilterDialogDrawItem.$create("Create$1");
      it.FIndex = this.FLength;
      it.FEndIndex = it.FIndex;
      pas["Generics.Collections"].TList$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem.Add.call(this,it);
      Result = it;
      return Result;
    };
    this.AddItem$1 = function (AExpression, ALevel) {
      var Result = null;
      Result = this.AddItem();
      Result.FLevel = ALevel;
      Result.FExpression = AExpression;
      return Result;
    };
    this.AddItem$2 = function (AGroup, ALevel) {
      var Result = null;
      Result = this.AddItem();
      Result.FLevel = ALevel;
      Result.FGroup = AGroup;
      return Result;
    };
  });
  rtl.recNewT(this,"TTMSFNCFilterDialogOpenControlParameters",function () {
    this.DrawItem = null;
    this.Text = "";
    this.DateTime = 0.0;
    this.List = null;
    this.Fixed = false;
    this.HideEdit = false;
    this.Part = 0;
    this.Editor = 0;
    this.$new = function () {
      var r = Object.create(this);
      r.PartRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      return r;
    };
    this.$eq = function (b) {
      return (this.DrawItem === b.DrawItem) && this.PartRect.$eq(b.PartRect) && (this.Text === b.Text) && (this.DateTime === b.DateTime) && (this.List === b.List) && (this.Fixed === b.Fixed) && (this.HideEdit === b.HideEdit) && (this.Part === b.Part) && (this.Editor === b.Editor);
    };
    this.$assign = function (s) {
      this.DrawItem = s.DrawItem;
      this.PartRect.$assign(s.PartRect);
      this.Text = s.Text;
      this.DateTime = s.DateTime;
      this.List = s.List;
      this.Fixed = s.Fixed;
      this.HideEdit = s.HideEdit;
      this.Part = s.Part;
      this.Editor = s.Editor;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCFilterDialogOpenControlParameters",{},this);
    $r.addField("DrawItem",$mod.$rtti["TTMSFNCFilterDialogDrawItem"]);
    $r.addField("PartRect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]);
    $r.addField("Text",rtl.string);
    $r.addField("DateTime",pas.System.$rtti["TDateTime"]);
    $r.addField("List",pas.Classes.$rtti["TStringList"]);
    $r.addField("Fixed",rtl.boolean);
    $r.addField("HideEdit",rtl.boolean);
    $r.addField("Part",$mod.$rtti["TTMSFNCFilterDialogDrawItemPart"]);
    $r.addField("Editor",$mod.$rtti["TTMSFNCFilterDialogEditorType"]);
  });
  this.$rtti.$Class("TTMSFNCCustomFilterDialog");
  rtl.createClass(this,"TTMSFNCFilterPreview",pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$init.call(this);
      this.FDialog = null;
    };
    this.$final = function () {
      this.FDialog = undefined;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$final.call(this);
    };
    this.GetHintString = function () {
      var Result = "";
      Result = pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBase.GetHintString.call(this);
      if (this.FDialog != null) {
        if (this.FDialog.FHoveredItemIndex >= 0) {
          var $tmp = this.FDialog.FHoverItemPart;
          if ($tmp === $mod.TTMSFNCFilterDialogDrawItemPart.ddipName) {
            Result = this.FDialog.FOptions.FUILanguage.FColumnNameHint}
           else if ($tmp === $mod.TTMSFNCFilterDialogDrawItemPart.ddipOperator) {
            Result = this.FDialog.FOptions.FUILanguage.FOperatorHint}
           else if (($tmp === $mod.TTMSFNCFilterDialogDrawItemPart.ddipValue) || ($tmp === $mod.TTMSFNCFilterDialogDrawItemPart.ddipExtraValue)) {
            Result = this.FDialog.FOptions.FUILanguage.FValueHint}
           else if ($tmp === $mod.TTMSFNCFilterDialogDrawItemPart.ddipAdd) {
            Result = this.FDialog.FOptions.FUILanguage.FAddHint}
           else if ($tmp === $mod.TTMSFNCFilterDialogDrawItemPart.ddipDelete) {
            Result = this.FDialog.FOptions.FUILanguage.FRemoveHint}
           else if ($tmp === $mod.TTMSFNCFilterDialogDrawItemPart.ddipNot) Result = this.FDialog.FOptions.FUILanguage.FNotHint;
        };
      };
      return Result;
    };
    this.HasHint = function () {
      var Result = false;
      Result = false;
      if (this.FDialog != null) {
        if (this.FDialog.FHoveredItemIndex >= 0) {
          var $tmp = this.FDialog.FHoverItemPart;
          if (($tmp === $mod.TTMSFNCFilterDialogDrawItemPart.ddipName) || ($tmp === $mod.TTMSFNCFilterDialogDrawItemPart.ddipOperator) || ($tmp === $mod.TTMSFNCFilterDialogDrawItemPart.ddipValue) || ($tmp === $mod.TTMSFNCFilterDialogDrawItemPart.ddipExtraValue) || ($tmp === $mod.TTMSFNCFilterDialogDrawItemPart.ddipAdd) || ($tmp === $mod.TTMSFNCFilterDialogDrawItemPart.ddipDelete) || ($tmp === $mod.TTMSFNCFilterDialogDrawItemPart.ddipNot)) Result = true;
        };
      };
      return Result;
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Create$1.call(this,AOwner);
      return this;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.$rtti.$MethodVar("TTMSFNCFilterDialogShowCustomEditor",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ADrawItem",this.$rtti["TTMSFNCFilterDialogDrawItem"]],["AEditorProperties",this.$rtti["TTMSFNCFilterDialogEditorProperties"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCFilterDialogGetExpressionValues",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",pas["TMS.TMSFNCFilterBuilder"].$rtti["TTMSFNCFilterBuilderColumn"]],["AValues",pas.Classes.$rtti["TStringList"]]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCCustomFilterDialog",pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog.$init.call(this);
      this.FIsModal = false;
      this.FDefaultDropDownHeight = 0;
      this.FOriginalFilterBuilder = null;
      this.FFilterText = "";
      this.FVScrlBox = null;
      this.FPreview = null;
      this.FTopPanel = null;
      this.FPanel = null;
      this.FBottomPanel = null;
      this.FButtonApply = null;
      this.FButtonCancel = null;
      this.FButtonOk = null;
      this.FButtonClear = null;
      this.FExpressionEdit = null;
      this.FChangeCombo = null;
      this.FFilterBuilder = null;
      this.FCopyFilterText = "";
      this.FOnGetFilterBuilder = null;
      this.FOptions = null;
      this.FAppearance = null;
      this.FOnGetFormatSettings = null;
      this.FDrawItems = null;
      this.FFilterTimer = null;
      this.FFilterTime = 0;
      this.FMouseDown = false;
      this.FMouseDrag = false;
      this.FHoverItemPart = 0;
      this.FHoveredItemIndex = 0;
      this.FEditorOpen = false;
      this.FEditorPart = 0;
      this.FEditorIndex = 0;
      this.FEditorValueText = "";
      this.FEditorDate = 0.0;
      this.FNotText = "";
      this.FDialogOpen = false;
      this.FOnShowExpressionEditor = null;
      this.FOnShowGroupEditor = null;
      this.FOnGetFilterBuilderDataColumns = null;
      this.FOnApplyButtonClicked = null;
      this.FOnCancelButtonClicked = null;
      this.FOnClearButtonClicked = null;
      this.FOnShowCustomEditor = null;
      this.FOnGetExpressionValues = null;
      this.FOnOKButtonClicked = null;
    };
    this.$final = function () {
      this.FOriginalFilterBuilder = undefined;
      this.FVScrlBox = undefined;
      this.FPreview = undefined;
      this.FTopPanel = undefined;
      this.FPanel = undefined;
      this.FBottomPanel = undefined;
      this.FButtonApply = undefined;
      this.FButtonCancel = undefined;
      this.FButtonOk = undefined;
      this.FButtonClear = undefined;
      this.FExpressionEdit = undefined;
      this.FChangeCombo = undefined;
      this.FFilterBuilder = undefined;
      this.FOnGetFilterBuilder = undefined;
      this.FOptions = undefined;
      this.FAppearance = undefined;
      this.FOnGetFormatSettings = undefined;
      this.FDrawItems = undefined;
      this.FFilterTimer = undefined;
      this.FOnShowExpressionEditor = undefined;
      this.FOnShowGroupEditor = undefined;
      this.FOnGetFilterBuilderDataColumns = undefined;
      this.FOnApplyButtonClicked = undefined;
      this.FOnCancelButtonClicked = undefined;
      this.FOnClearButtonClicked = undefined;
      this.FOnShowCustomEditor = undefined;
      this.FOnGetExpressionValues = undefined;
      this.FOnOKButtonClicked = undefined;
      pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog.$final.call(this);
    };
    this.SetOptions = function (Value) {
      this.FOptions.Assign(Value);
    };
    this.SetAppearance = function (Value) {
      this.FAppearance.Assign(Value);
      this.DoOnAppearanceChanged(this.FAppearance);
    };
    this.ResetHoveredItem = function () {
      this.FHoveredItemIndex = -1;
      this.FHoverItemPart = $mod.TTMSFNCFilterDialogDrawItemPart.ddipNone;
    };
    this.ResetChangeControls = function () {
      if (this.FChangeCombo != null) {
        this.FChangeCombo.SetVisible(false);
        this.FChangeCombo.GetItems().Clear$1();
      };
      this.FEditorValueText = "";
      this.FEditorIndex = -1;
      this.FEditorPart = $mod.TTMSFNCFilterDialogDrawItemPart.ddipNone;
      this.FEditorOpen = false;
      if (this.FPreview != null) this.FPreview.Invalidate();
    };
    this.GetFilterText = function () {
      var Result = "";
      if (this.FFilterBuilder != null) this.FFilterText = this.FFilterBuilder.GetFilterText();
      Result = this.FFilterText;
      return Result;
    };
    this.SetFilterText = function (Value) {
      if (this.FFilterBuilder != null) {
        this.FFilterBuilder.SetFilterText(Value);
        this.FFilterText = this.FFilterBuilder.GetDisplayFilterText();
      } else this.FFilterText = Value;
    };
    this.SetFilterBuilder = function (Value) {
      var e = null;
      if (this.FFilterBuilder !== Value) {
        if (this.FFilterBuilder != null) this.FFilterBuilder.FOnInternalChanged = null;
        e = null;
        try {
          this.FFilterBuilder = Value;
          if (this.FFilterBuilder != null) {
            e = this.FFilterBuilder.FOnChanged;
            this.FFilterBuilder.FOnChanged = null;
            this.FFilterBuilder.SetFilterText(this.GetFilterText());
          } else this.FFilterText = "";
        } finally {
          if (this.FFilterBuilder != null) {
            this.FFilterBuilder.FOnInternalChanged = rtl.createCallback(this,"DoOnInternalFilterBuilderChanged");
            this.FFilterBuilder.FOnChanged = e;
          };
        };
      };
    };
    this.GetDisplayFilterText = function () {
      var Result = "";
      if (this.FFilterBuilder != null) Result = this.FFilterBuilder.GetDisplayFilterText();
      return Result;
    };
    this.DoOnInternalFilterBuilderChanged = function (Sender) {
      if (!this.FIsOpen) {
        this.FFilterText = this.FFilterBuilder.GetDisplayFilterText();
      };
    };
    this.DoInternalChanged = function () {
      this.FilterItemsChanged();
    };
    this.GetInstance = function () {
      var Result = 0;
      Result = pas["WEBLib.TMSFNCTypes"].HInstance();
      return Result;
    };
    this.DoOnAppearanceChanged = function (Sender) {
      this.UpdateDrawItems();
    };
    this.DoOnDarkStyleChanged = function (Sender, ADarkStyle) {
      if (ADarkStyle) {
        pas["WEBLib.TMSFNCEditorsTools"].SetTMSFNCDesignerTheme(pas["WEBLib.TMSFNCEditorsTools"].TTMSFNCEditorDesignerTheme.edtDark)}
       else pas["WEBLib.TMSFNCEditorsTools"].SetTMSFNCDesignerTheme(pas["WEBLib.TMSFNCEditorsTools"].TTMSFNCEditorDesignerTheme.edtLight);
      this.SetControlAppearance(ADarkStyle);
    };
    this.DoOnInternalFilterChanged = function (Sender) {
      this.FFilterText = this.FFilterBuilder.GetDisplayFilterText();
    };
    this.SetControlAppearance = function (ADarkStyle) {
      if (this.FButtonClear != null) pas["WEBLib.TMSFNCEditorsTools"].SetEditorCancelButtonAppearance(this.FButtonClear,this.FAppearance.FThemeColor,5,-1,-1);
      if (this.FPanel != null) pas["WEBLib.TMSFNCEditorsTools"].SetEditorSubPanelAppearance(this.FPanel,-1,-1,0);
      if (this.FVScrlBox != null) {
        this.FVScrlBox.SetBorderStyle(pas["WEBLib.Controls"].TBorderStyle.bsNone);
        if (ADarkStyle) {
          this.FVScrlBox.SetColor(4406846)}
         else this.FVScrlBox.SetColor(16119285);
      };
      if (this.FPreview != null) {
        if (pas["WEBLib.TMSFNCEditorsTools"].IsLightTheme()) {
          this.FPreview.SetColor(16119285)}
         else this.FPreview.SetColor(4406846);
      };
      if (this.FBottomPanel != null) pas["WEBLib.TMSFNCEditorsTools"].SetEditorBackPanelAppearance(this.FBottomPanel,-1,-1,5);
      if (this.FButtonCancel != null) pas["WEBLib.TMSFNCEditorsTools"].SetEditorCancelButtonAppearance(this.FButtonCancel,this.FAppearance.FThemeColor,5,-1,-1);
      if (this.FButtonApply != null) {
        if (this.FButtonOk != null) {
          pas["WEBLib.TMSFNCEditorsTools"].SetEditorCancelButtonAppearance(this.FButtonApply,this.FAppearance.FThemeColor,5,-1,-1)}
         else pas["WEBLib.TMSFNCEditorsTools"].SetEditorOKButtonAppearance(this.FButtonApply,this.FAppearance.FThemeColor,5,this.FAppearance.FThemeFontColor);
      };
      if (this.FButtonOk != null) pas["WEBLib.TMSFNCEditorsTools"].SetEditorOKButtonAppearance(this.FButtonOk,this.FAppearance.FThemeColor,5,this.FAppearance.FThemeFontColor);
      if (this.FExpressionEdit != null) pas["WEBLib.TMSFNCEditorsTools"].SetEditorEditAppearance(this.FExpressionEdit,-1,-1,-1);
      if (this.FTopPanel != null) pas["WEBLib.TMSFNCEditorsTools"].SetEditorSubPanelAppearance(this.FTopPanel,-1,-1,0);
    };
    this.DrawExpression = function (AGraphics, ADrawItem) {
      var hvd = false;
      hvd = ADrawItem.FIndex === this.FHoveredItemIndex;
      AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
      this.DrawNot(AGraphics,ADrawItem);
      if (hvd) {
        AGraphics.FFill.Assign(this.FAppearance.FHoverFill);
        AGraphics.FStroke.SetColor(16777200);
        if (AGraphics.FFill.FColor === -1) {
          AGraphics.FFill.SetColor(this.FAppearance.FThemeColor);
          AGraphics.FFont.SetColor(this.FAppearance.FThemeFontColor);
        };
        AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(ADrawItem.FColumnNameRect.Left - 6,ADrawItem.FRect.Top,ADrawItem.FRect.Right,ADrawItem.FRect.Bottom)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
      };
      if (hvd && (this.FHoverItemPart === $mod.TTMSFNCFilterDialogDrawItemPart.ddipOperator)) {
        AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
        AGraphics.FStroke.SetColor(15128749);
      } else AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
      AGraphics.FFill.Assign(this.FAppearance.FExpressionOperatorFill);
      AGraphics.FFont.Assign(this.FAppearance.FExpressionOperatorFont);
      if (hvd && (this.FHoverItemPart === $mod.TTMSFNCFilterDialogDrawItemPart.ddipName)) {
        AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
        AGraphics.FStroke.SetColor(15128749);
      } else AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
      AGraphics.FFill.Assign(this.FAppearance.FExpressionColumnFill);
      AGraphics.FFont.Assign(this.FAppearance.FExpressionColumnFont);
      if (AGraphics.FFill.FColor === -1) {
        AGraphics.FFill.SetColor(this.FAppearance.FThemeColor);
        AGraphics.FFont.SetColor(this.FAppearance.FThemeFontColor);
      };
      AGraphics.DrawRoundRectangle$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ADrawItem.FColumnNameRect),ADrawItem.FRounding,rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
      if (!(this.FEditorOpen && (this.FEditorIndex === ADrawItem.FIndex) && (this.FEditorPart === $mod.TTMSFNCFilterDialogDrawItemPart.ddipName))) AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ADrawItem.FColumnNameTextRect),ADrawItem.FColumnNameText,false,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,true,false,-1,-1);
      this.DrawArrow(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ADrawItem.FColumnNameArrowRect),AGraphics.FFont.FColor);
      if (hvd && (this.FHoverItemPart === $mod.TTMSFNCFilterDialogDrawItemPart.ddipOperator)) {
        AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
        AGraphics.FStroke.SetColor(15128749);
      } else AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
      AGraphics.FFill.Assign(this.FAppearance.FExpressionOperatorFill);
      AGraphics.FFont.Assign(this.FAppearance.FExpressionOperatorFont);
      if (AGraphics.FFill.FColor === -1) {
        AGraphics.FFill.SetColor(this.FAppearance.FThemeColor);
        AGraphics.FFont.SetColor(this.FAppearance.FThemeFontColor);
      };
      AGraphics.DrawRoundRectangle$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ADrawItem.FOperatorRect),ADrawItem.FRounding,rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
      if (!(this.FEditorOpen && (this.FEditorIndex === ADrawItem.FIndex) && (this.FEditorPart === $mod.TTMSFNCFilterDialogDrawItemPart.ddipOperator))) AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ADrawItem.FOperatorTextRect),ADrawItem.FOperatorText,false,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,true,false,-1,-1);
      this.DrawArrow(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ADrawItem.FOperatorArrowRect),AGraphics.FFont.FColor);
      if (hvd && (this.FHoverItemPart === $mod.TTMSFNCFilterDialogDrawItemPart.ddipValue)) {
        AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
        AGraphics.FStroke.SetColor(15128749);
      } else AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
      AGraphics.FFill.Assign(this.FAppearance.FExpressionValueFill);
      AGraphics.FFont.Assign(this.FAppearance.FExpressionValueFont);
      if (AGraphics.FFill.FColor === -1) {
        AGraphics.FFill.SetColor(this.FAppearance.FThemeColor);
        AGraphics.FFont.SetColor(this.FAppearance.FThemeFontColor);
      };
      AGraphics.DrawRoundRectangle$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ADrawItem.FValueRect),ADrawItem.FRounding,rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
      if (!(this.FEditorOpen && (this.FEditorIndex === ADrawItem.FIndex) && (this.FEditorPart === $mod.TTMSFNCFilterDialogDrawItemPart.ddipValue))) AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ADrawItem.FValueTextRect),ADrawItem.FValueText,false,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,true,false,-1,-1);
      this.DrawArrow(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ADrawItem.FValueArrowRect),AGraphics.FFont.FColor);
      if ((ADrawItem.FExtraValueRect.Left >= 0) || (ADrawItem.FExtraValueRect.Right >= 0)) {
        if (hvd && (this.FHoverItemPart === $mod.TTMSFNCFilterDialogDrawItemPart.ddipExtraValue)) {
          AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
          AGraphics.FStroke.SetColor(15128749);
        } else AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
        AGraphics.FFill.Assign(this.FAppearance.FExpressionValueFill);
        AGraphics.FFont.Assign(this.FAppearance.FExpressionValueFont);
        if (AGraphics.FFill.FColor === -1) AGraphics.FFill.SetColor(this.FAppearance.FThemeColor);
        AGraphics.DrawRoundRectangle$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ADrawItem.FExtraValueRect),ADrawItem.FRounding,rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        if (!(this.FEditorOpen && (this.FEditorIndex === ADrawItem.FIndex) && (this.FEditorPart === $mod.TTMSFNCFilterDialogDrawItemPart.ddipExtraValue))) AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ADrawItem.FExtraValueTextRect),ADrawItem.FExtraValueText,false,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,true,false,-1,-1);
        this.DrawArrow(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ADrawItem.FExtraValueArrowRect),AGraphics.FFont.FColor);
      };
      this.DrawAddDelete(AGraphics,ADrawItem);
      this.DrawConnectionLine(AGraphics,ADrawItem);
    };
    this.DrawNot = function (AGraphics, ADrawItem) {
      var bmpNot = null;
      if ((ADrawItem.FNotRect.Left >= 0) || (ADrawItem.FNotRect.Right >= 0)) {
        bmpNot = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource$1($mod.TTMSFNCNOTBITMAP,pas["WEBLib.TMSFNCTypes"].HInstance());
        try {
          AGraphics.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ADrawItem.FNotRect),bmpNot,true,false,true,false);
        } finally {
          bmpNot = rtl.freeLoc(bmpNot);
        };
      };
    };
    this.DrawGroup = function (AGraphics, ADrawItem) {
      AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
      if (ADrawItem.FIndex === this.FHoveredItemIndex) {
        AGraphics.FFill.Assign(this.FAppearance.FHoverFill);
        AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ADrawItem.FRect),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        if (this.FHoverItemPart === $mod.TTMSFNCFilterDialogDrawItemPart.ddipOperator) {
          AGraphics.FStroke.Assign(this.FAppearance.FHoverFill);
          AGraphics.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
        };
      };
      if (this.FAppearance != null) {
        AGraphics.FFill.Assign(this.FAppearance.FGroupFill);
        AGraphics.FFont.Assign(this.FAppearance.FGroupFont);
        if (AGraphics.FFill.FColor === -1) {
          AGraphics.FFill.SetColor(this.FAppearance.FThemeColor);
          AGraphics.FFont.SetColor(this.FAppearance.FThemeFontColor);
        };
      };
      AGraphics.DrawRoundRectangle$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ADrawItem.FOperatorRect),ADrawItem.FRounding,rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
      if (!(this.FEditorOpen && (this.FEditorIndex === ADrawItem.FIndex) && (this.FEditorPart === $mod.TTMSFNCFilterDialogDrawItemPart.ddipOperator))) AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ADrawItem.FOperatorTextRect),ADrawItem.FOperatorText,false,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,true,false,-1,-1);
      this.DrawArrow(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ADrawItem.FOperatorArrowRect),AGraphics.FFont.FColor);
      this.DrawAddDelete(AGraphics,ADrawItem);
      this.DrawConnectionLine(AGraphics,ADrawItem);
    };
    this.DrawArrow = function (AGraphics, ARect, AFillColor) {
      var pth = null;
      var s = 0.0;
      AGraphics.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      AGraphics.FFill.SetColor(AFillColor);
      AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      AGraphics.FStroke.SetColor(AFillColor);
      s = pas.Math.Floor(Math.min(ARect.Right - ARect.Left,ARect.Bottom - ARect.Top) / 3);
      if (ARect.Right > 0) {
        pth = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPath.$create("Create$1");
        pth.MoveTo(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Left + ((ARect.Right - ARect.Left - s) / 2),ARect.Top + ((ARect.Bottom - ARect.Top - s) / 2) + 1));
        pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Left + ((ARect.Right - ARect.Left - s) / 2) + (s / 2),ARect.Top + ((ARect.Bottom - ARect.Top - s) / 2) + s));
        pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(ARect.Left + ((ARect.Right - ARect.Left - s) / 2) + s,ARect.Top + ((ARect.Bottom - ARect.Top - s) / 2) + 1));
        pth.ClosePath();
        AGraphics.DrawPath(pth,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPathDrawMode.pdmPolygon);
        pth = rtl.freeLoc(pth);
      };
    };
    this.DrawItems = function (AGraphics, ARect) {
      var I = 0;
      for (var $l = 0, $end = this.FDrawItems.FLength - 1; $l <= $end; $l++) {
        I = $l;
        if (this.FDrawItems.GetItem(I).FExpression != null) {
          this.DrawExpression(AGraphics,this.FDrawItems.GetItem(I))}
         else this.DrawGroup(AGraphics,this.FDrawItems.GetItem(I));
      };
    };
    this.DrawAddDelete = function (AGraphics, ADrawItem) {
      var bmpAdd = null;
      var bmpDel = null;
      AGraphics.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
      AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      if (this.FAppearance != null) {
        AGraphics.FStroke.SetColor(this.FAppearance.FGroupFill.FColor);
        AGraphics.FFont.SetColor(this.FAppearance.FGroupFill.FColor);
      };
      bmpDel = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource$1($mod.TTMSFNCREMOVEBITMAP,pas["WEBLib.TMSFNCTypes"].HInstance());
      bmpAdd = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource$1($mod.TTMSFNCADDBITMAP,pas["WEBLib.TMSFNCTypes"].HInstance());
      try {
        if ((ADrawItem.FDeleteRect.Left >= 0) || (ADrawItem.FDeleteRect.Right >= 0)) AGraphics.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ADrawItem.FDeleteRect),bmpDel,true,false,true,false);
        if ((ADrawItem.FAddRect.Left >= 0) || (ADrawItem.FAddRect.Right >= 0)) AGraphics.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ADrawItem.FAddRect),bmpAdd,true,false,true,false);
      } finally {
        bmpAdd = rtl.freeLoc(bmpAdd);
        bmpDel = rtl.freeLoc(bmpDel);
      };
    };
    this.DrawConnectionLine = function (AGraphics, ADrawItem) {
      var sp = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var ep = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var ind = 0.0;
      var ith = 0.0;
      AGraphics.FStroke.Assign(this.FAppearance.FConnectionLine);
      if (this.FAppearance != null) {
        ind = this.FAppearance.FIndent}
       else ind = 20;
      sp.$assign(pas["WEBLib.TMSFNCTypes"].PointF((ADrawItem.FLevel * ind) - (ind / 2),ADrawItem.FRect.Top + ((ADrawItem.FRect.Bottom - ADrawItem.FRect.Top) / 2)));
      if (ADrawItem.FLevel > 0) {
        ep.$assign(pas["WEBLib.TMSFNCTypes"].PointF(sp.X + (ind / 2),sp.Y));
        AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(sp),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(ep),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
      };
      if (ADrawItem.FEndIndex !== ADrawItem.FIndex) {
        sp.$assign(pas["WEBLib.TMSFNCTypes"].PointF((ADrawItem.FLevel * ind) + (ind / 2),ADrawItem.FRect.Top + ((ADrawItem.FRect.Bottom - ADrawItem.FRect.Top) / 2)));
        if (this.FDrawItems.FLength > ADrawItem.FEndIndex) {
          ep.$assign(pas["WEBLib.TMSFNCTypes"].PointF(sp.X,this.FDrawItems.GetItem(ADrawItem.FEndIndex).FRect.Top + ((this.FDrawItems.GetItem(ADrawItem.FEndIndex).FRect.Bottom - this.FDrawItems.GetItem(ADrawItem.FEndIndex).FRect.Top) / 2)))}
         else {
          if (this.FAppearance != null) {
            ith = this.FAppearance.FItemHeight}
           else ith = 30;
          ep.$assign(pas["WEBLib.TMSFNCTypes"].PointF(sp.X,sp.Y + (ith * (ADrawItem.FEndIndex - ADrawItem.FIndex))));
        };
        AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(sp),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(ep),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
      };
    };
    this.DoAfterDrawPreview = function (Sender, AGraphics, ARect) {
      this.DrawItems(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect));
    };
    this.GetDrawItemAtXY = function (AX, AY) {
      var Result = null;
      var p = 0;
      Result = this.GetDrawItemAtXY$1(AX,AY,{get: function () {
          return p;
        }, set: function (v) {
          p = v;
        }});
      return Result;
    };
    this.GetDrawItemAtXY$1 = function (AX, AY, APart) {
      var Result = null;
      var I = 0;
      Result = null;
      APart.set($mod.TTMSFNCFilterDialogDrawItemPart.ddipNone);
      for (var $l = 0, $end = this.FDrawItems.FLength - 1; $l <= $end; $l++) {
        I = $l;
        if ((AY >= this.FDrawItems.GetItem(I).FRect.Top) && (AY <= this.FDrawItems.GetItem(I).FRect.Bottom)) {
          Result = this.FDrawItems.GetItem(I);
          if ((AX >= this.FDrawItems.GetItem(I).FNotRect.Left) && (AX <= this.FDrawItems.GetItem(I).FNotRect.Right)) {
            APart.set($mod.TTMSFNCFilterDialogDrawItemPart.ddipNot)}
           else if ((AX >= this.FDrawItems.GetItem(I).FColumnNameRect.Left) && (AX <= this.FDrawItems.GetItem(I).FColumnNameRect.Right)) {
            APart.set($mod.TTMSFNCFilterDialogDrawItemPart.ddipName)}
           else if ((AX >= this.FDrawItems.GetItem(I).FOperatorRect.Left) && (AX <= this.FDrawItems.GetItem(I).FOperatorRect.Right)) {
            APart.set($mod.TTMSFNCFilterDialogDrawItemPart.ddipOperator)}
           else if ((AX >= this.FDrawItems.GetItem(I).FValueRect.Left) && (AX <= this.FDrawItems.GetItem(I).FValueRect.Right)) {
            APart.set($mod.TTMSFNCFilterDialogDrawItemPart.ddipValue)}
           else if ((AX >= this.FDrawItems.GetItem(I).FExtraValueRect.Left) && (AX <= this.FDrawItems.GetItem(I).FExtraValueRect.Right)) {
            APart.set($mod.TTMSFNCFilterDialogDrawItemPart.ddipExtraValue)}
           else if ((AX >= this.FDrawItems.GetItem(I).FAddRect.Left) && (AX <= this.FDrawItems.GetItem(I).FAddRect.Right)) {
            APart.set($mod.TTMSFNCFilterDialogDrawItemPart.ddipAdd)}
           else if ((AX >= this.FDrawItems.GetItem(I).FDeleteRect.Left) && (AX <= this.FDrawItems.GetItem(I).FDeleteRect.Right)) APart.set($mod.TTMSFNCFilterDialogDrawItemPart.ddipDelete);
          return Result;
        };
      };
      return Result;
    };
    this.DoPreviewMouseUp = function (Sender, Button, Shift, X, Y) {
      var hit = null;
      var hp = 0;
      hit = this.GetDrawItemAtXY$1(X,Y,{get: function () {
          return hp;
        }, set: function (v) {
          hp = v;
        }});
      if ((hit != null) && (hp !== $mod.TTMSFNCFilterDialogDrawItemPart.ddipNone)) {
        this.ItemClick(hit,hp);
      };
      this.FMouseDown = false;
    };
    this.DoPreviewMouseDown = function (Sender, Button, Shift, X, Y) {
      if (this.FEditorOpen) {
        this.HandleEditorResult(true);
      } else {
        this.FMouseDown = true;
      };
    };
    this.DoPreviewMouseMove = function (Sender, Shift, X, Y) {
      var hit = null;
      var hp = 0;
      var cur = 0;
      cur = 0;
      if (!this.FMouseDown) {
        hit = this.GetDrawItemAtXY$1(X,Y,{get: function () {
            return hp;
          }, set: function (v) {
            hp = v;
          }});
        if (hit != null) {
          if (hp !== $mod.TTMSFNCFilterDialogDrawItemPart.ddipNone) cur = 21;
          if ((this.FHoveredItemIndex !== hit.FIndex) || (this.FHoverItemPart !== hp)) {
            this.FHoverItemPart = hp;
            this.FHoveredItemIndex = hit.FIndex;
            this.FPreview.Invalidate();
          };
        } else if (this.FHoveredItemIndex >= 0) {
          this.ResetHoveredItem();
          this.FPreview.Invalidate();
        };
      };
      if (cur !== this.FPreview.FCursor) this.FPreview.SetControlCursor(cur);
    };
    this.DoPreviewMouseLeave = function (Sender) {
      this.ResetHoveredItem();
      this.FPreview.Invalidate();
    };
    this.DoOnItemSelected = function (Sender, AText) {
      this.HandleEditorResult(true);
    };
    this.DoApplyClicked = function (AFilterBuilder, AClose) {
      if (this.FOnApplyButtonClicked != null) this.FOnApplyButtonClicked(this,AFilterBuilder,AClose);
    };
    this.DoOKClicked = function (AFilterBuilder, AClose) {
      if (this.FOnOKButtonClicked != null) this.FOnOKButtonClicked(this,AFilterBuilder,AClose);
    };
    this.DoCancelClicked = function (AFilterBuilder, AClose) {
      if (this.FOnCancelButtonClicked != null) this.FOnCancelButtonClicked(this,AFilterBuilder,AClose);
    };
    this.DoClearClicked = function (AFilterBuilder, AClear) {
      if (this.FOnClearButtonClicked != null) this.FOnClearButtonClicked(this,AFilterBuilder,AClear);
    };
    this.DoButtonApplyClick = function (Sender) {
      var cl = false;
      if (this.FEditorOpen && (this.FChangeCombo != null)) this.HandleEditorResult(this.FChangeCombo.FDropDownType === pas["WEBLib.TMSFNCEditorDropDownEdit"].TTMSFNCEditorDropDownEditType.ddetEdit);
      this.FFilterText = this.FFilterBuilder.GetDisplayFilterText();
      cl = !($mod.TTMSFNCFilterDialogButton.fdbOk in this.FOptions.FButtons);
      this.DoApplyClicked(this.FFilterBuilder,{get: function () {
          return cl;
        }, set: function (v) {
          cl = v;
        }});
      if (cl) {
        this.FFrm.SetModalResult(1);
        if (!this.FIsModal) this.FFrm.Close();
      } else this.FCopyFilterText = this.FFilterText;
    };
    this.DoButtonOKClick = function (Sender) {
      var cl = false;
      if (this.FEditorOpen && (this.FChangeCombo != null)) this.HandleEditorResult(this.FChangeCombo.FDropDownType === pas["WEBLib.TMSFNCEditorDropDownEdit"].TTMSFNCEditorDropDownEditType.ddetEdit);
      this.FFilterText = this.FFilterBuilder.GetDisplayFilterText();
      cl = true;
      this.DoOKClicked(this.FFilterBuilder,{get: function () {
          return cl;
        }, set: function (v) {
          cl = v;
        }});
      if (cl) {
        this.FFrm.SetModalResult(1);
        if (!this.FIsModal) this.FFrm.Close();
      };
    };
    this.DoButtonCancelClick = function (Sender) {
      var cl = false;
      if (this.FEditorOpen && (this.FChangeCombo != null)) this.HandleEditorResult(false);
      cl = true;
      this.DoCancelClicked(this.FFilterBuilder,{get: function () {
          return cl;
        }, set: function (v) {
          cl = v;
        }});
      if (cl) {
        this.FFrm.SetModalResult(2);
        if (!this.FIsModal) this.FFrm.Close();
      };
    };
    this.DoButtonClearClick = function (Sender) {
      var cl = false;
      cl = true;
      this.DoClearClicked(this.FFilterBuilder,{get: function () {
          return cl;
        }, set: function (v) {
          cl = v;
        }});
      if (cl) {
        this.FFilterBuilder.ClearFilter();
        this.FExpressionEdit.SetText("");
        this.UpdateDrawItems();
      };
    };
    this.ItemClick = function (ADrawItem, APart) {
      var $Self = this;
      var editorType = 0;
      var er = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var sl = null;
      var fixed = false;
      var sh = false;
      var ep = $mod.TTMSFNCFilterDialogEditorProperties.$new();
      var op = $mod.TTMSFNCFilterDialogOpenControlParameters.$new();
      function AddAllGroupOperators() {
        var go = 0;
        sl.Clear();
        for (go = 0; go <= 1; go++) {
          sl.Add($Self.GetTextForGroupOperator(go));
        };
      };
      function AddColumnNames() {
        var I = 0;
        for (var $l = 0, $end = $Self.FFilterBuilder.FDataColumns.FLength - 1; $l <= $end; $l++) {
          I = $l;
          sl.Add($Self.FFilterBuilder.FDataColumns.GetItem(I).GetDisplayName());
        };
      };
      function AddAllExpressionsOperator() {
        var eo = 0;
        for (eo = 0; eo <= 10; eo++) {
          sl.Add($Self.GetTextForExpressionOperator(eo));
        };
      };
      function AddNumericExpressionsOperator() {
        var eo = 0;
        for (eo = 0; eo <= 10; eo++) {
          if (eo in pas["TMS.TMSFNCFilterBuilder"].DefaultNumberOperators) sl.Add($Self.GetTextForExpressionOperator(eo));
        };
      };
      function AddTextExpressionsOperator() {
        var eo = 0;
        for (eo = 0; eo <= 10; eo++) {
          if (eo in pas["TMS.TMSFNCFilterBuilder"].DefaultTextOperators) sl.Add($Self.GetTextForExpressionOperator(eo));
        };
      };
      function AddOtherExpressionsOperator() {
        sl.Add($Self.GetTextForExpressionOperator(pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderExpressionOperator.feoEmpty));
        sl.Add($Self.GetTextForExpressionOperator(pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderExpressionOperator.feoNotEmpty));
      };
      if (APart in rtl.createSet($mod.TTMSFNCFilterDialogDrawItemPart.ddipDelete)) {
        if (ADrawItem.FGroup != null) {
          this.FFilterBuilder.DeleteGroup(ADrawItem.FGroup)}
         else if (ADrawItem.FExpression != null) this.FFilterBuilder.DeleteExpression(ADrawItem.FExpression);
        this.UpdateDrawItems();
        return;
      } else if (APart === $mod.TTMSFNCFilterDialogDrawItemPart.ddipNot) {
        ADrawItem.FExpression.SetInverted(!ADrawItem.FExpression.FIsInverted);
        this.UpdateExpressionEdit();
        this.UpdateDrawItems();
        return;
      };
      sh = true;
      this.FEditorIndex = ADrawItem.FIndex;
      this.FEditorPart = APart;
      editorType = $mod.TTMSFNCFilterDialogEditorType.vetEdit;
      sl = pas.Classes.TStringList.$create("Create$1");
      op.HideEdit = false;
      var $tmp = APart;
      if ($tmp === $mod.TTMSFNCFilterDialogDrawItemPart.ddipNone) {
        er.$assign(ADrawItem.FRect)}
       else if ($tmp === $mod.TTMSFNCFilterDialogDrawItemPart.ddipAdd) {
        op.HideEdit = true;
        er.$assign(ADrawItem.FAddRect);
        editorType = $mod.TTMSFNCFilterDialogEditorType.vetComboBox;
        sl.Add(this.FOptions.FUILanguage.FAddExpression);
        sl.Add(this.FOptions.FUILanguage.FAddGroup);
      } else if ($tmp === $mod.TTMSFNCFilterDialogDrawItemPart.ddipName) {
        ep.EditorText = ADrawItem.FColumnNameText;
        er.$assign(ADrawItem.FColumnNameRect);
        AddColumnNames();
        if (this.FFilterBuilder.FDataColumns.FLength > 0) editorType = $mod.TTMSFNCFilterDialogEditorType.vetComboBox;
      } else if ($tmp === $mod.TTMSFNCFilterDialogDrawItemPart.ddipOperator) {
        ep.EditorText = ADrawItem.FOperatorText;
        er.$assign(ADrawItem.FOperatorRect);
        editorType = $mod.TTMSFNCFilterDialogEditorType.vetComboBox;
        if (ADrawItem.FGroup != null) {
          AddAllGroupOperators()}
         else if (ADrawItem.FExpression != null) {
          var $tmp1 = ADrawItem.FValueType;
          if ($tmp1 === pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtAutomatic) {
            AddAllExpressionsOperator()}
           else if ($tmp1 === pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtText) {
            AddTextExpressionsOperator()}
           else if ($tmp1 === pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtBoolean) {
            ep.EditorText = this.GetTextForExpressionOperator(pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderExpressionOperator.feoEqual);
            sh = false;
          } else if ($tmp1 === pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtOther) {
            AddOtherExpressionsOperator()}
           else if (($tmp1 === pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtDateTime) || ($tmp1 === pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtDate) || ($tmp1 === pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtTime)) {
            AddNumericExpressionsOperator()}
           else if (($tmp1 === pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtFloat) || ($tmp1 === pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtNumber)) AddNumericExpressionsOperator();
        };
      } else if ($tmp === $mod.TTMSFNCFilterDialogDrawItemPart.ddipValue) {
        ep.EditorText = ADrawItem.FValueText;
        er.$assign(ADrawItem.FValueRect);
        if (ADrawItem.FValueType === pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtBoolean) {
          sl.Add(this.FOptions.FUILanguage.FTrueText);
          sl.Add(this.FOptions.FUILanguage.FFalseText);
          editorType = $mod.TTMSFNCFilterDialogEditorType.vetComboBox;
        } else if (ADrawItem.FValueType in rtl.createSet(pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtDateTime,pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtDate)) {
          editorType = $mod.TTMSFNCFilterDialogEditorType.vetDatePicker;
          ep.EditorDate = pas["TMS.TMSFNCValue"].ValueToDateTime(ADrawItem.FValue);
          ep.EditorText = "";
        } else if (ADrawItem.FValueType in rtl.createSet(pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtTime)) {
          editorType = $mod.TTMSFNCFilterDialogEditorType.vetTimePicker;
          ep.EditorDate = pas["TMS.TMSFNCValue"].ValueToDateTime(ADrawItem.FValue);
          ep.EditorText = "";
        } else if (!(ADrawItem.FValueType in rtl.createSet(pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtFloat,pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtNumber)) && (ADrawItem.FExpression.FColumn != null)) {
          this.DoGetExpressionValueList(ADrawItem.FExpression.FColumn,sl);
          if (sl.GetCount() > 0) editorType = $mod.TTMSFNCFilterDialogEditorType.vetComboEdit;
        };
      } else if ($tmp === $mod.TTMSFNCFilterDialogDrawItemPart.ddipExtraValue) {
        ep.EditorDate = pas["TMS.TMSFNCValue"].ValueToDateTime(ADrawItem.FValue);
        er.$assign(ADrawItem.FExtraValueRect);
        editorType = $mod.TTMSFNCFilterDialogEditorType.vetTimePicker;
      };
      fixed = !(editorType in rtl.createSet($mod.TTMSFNCFilterDialogEditorType.vetEdit,$mod.TTMSFNCFilterDialogEditorType.vetComboEdit));
      ep.EditorPart = APart;
      ep.EditorType = editorType;
      pas["WEBLib.TMSFNCTypes"].InflateRectEx(er,-2,0);
      pas["WEBLib.TMSFNCTypes"].InflateRectEx(er,-2,-2);
      ep.EditorRect.$assign(er);
      if (ADrawItem.FGroup != null) {
        this.DoShowGroupEditorEvent(ADrawItem.FGroup,ep,sl,{get: function () {
            return fixed;
          }, set: function (v) {
            fixed = v;
          }},{get: function () {
            return sh;
          }, set: function (v) {
            sh = v;
          }})}
       else if (ADrawItem.FExpression != null) this.DoShowExpressionEditorEvent(ADrawItem.FExpression,ep,sl,{get: function () {
          return fixed;
        }, set: function (v) {
          fixed = v;
        }},{get: function () {
          return sh;
        }, set: function (v) {
          sh = v;
        }});
      op.DrawItem = ADrawItem;
      op.PartRect.$assign(ep.EditorRect);
      op.Part = APart;
      op.List = sl;
      op.Fixed = fixed;
      op.Editor = ep.EditorType;
      if (op.Editor in rtl.createSet($mod.TTMSFNCFilterDialogEditorType.vetDatePicker,$mod.TTMSFNCFilterDialogEditorType.vetTimePicker)) {
        op.DateTime = pas["TMS.TMSFNCValue"].ValueToDateTime(ADrawItem.FValue);
        op.Text = "";
      } else {
        op.Text = ep.EditorText;
        op.DateTime = -1;
      };
      if (sh) {
        this.FEditorValueText = ep.EditorText;
        this.FEditorDate = op.DateTime;
        if (ep.EditorType === $mod.TTMSFNCFilterDialogEditorType.vetCustom) {
          this.DoShowCustomEditor(ADrawItem,$mod.TTMSFNCFilterDialogEditorProperties.$clone(ep))}
         else this.OpenCombo($mod.TTMSFNCFilterDialogOpenControlParameters.$clone(op));
      };
      sl = rtl.freeLoc(sl);
    };
    this.DoShowCustomEditor = function (ADrawItem, AEditorProperties) {
      if (this.FOnShowCustomEditor != null) this.FOnShowCustomEditor(this,ADrawItem,$mod.TTMSFNCFilterDialogEditorProperties.$clone(AEditorProperties));
    };
    this.OpenCombo = function (AOpenParameters) {
      this.FChangeCombo.BeginUpdate$2();
      this.FChangeCombo.FAppearance.FControlFill.Assign(this.FTopPanel.FAppearance.FFill);
      this.FChangeCombo.FAppearance.FControlStroke.Assign(this.FTopPanel.FAppearance.FStroke);
      this.FChangeCombo.FAppearance.FControlFont.SetColor(pas["WEBLib.TMSFNCEditorsTools"].GetEditorDefaultFontColor());
      var $tmp = AOpenParameters.Part;
      if ($tmp === $mod.TTMSFNCFilterDialogDrawItemPart.ddipName) {
        this.FChangeCombo.FAppearance.FEditFill.Assign(this.FAppearance.FExpressionColumnFill);
        this.FChangeCombo.FAppearance.FEditFont.Assign(this.FAppearance.FExpressionColumnFont);
        this.FChangeCombo.FAppearance.FEditStroke.SetColor(this.FAppearance.FExpressionColumnFill.FColor);
      } else if ($tmp === $mod.TTMSFNCFilterDialogDrawItemPart.ddipValue) {
        this.FChangeCombo.FAppearance.FEditFill.Assign(this.FAppearance.FExpressionValueFill);
        this.FChangeCombo.FAppearance.FEditFont.Assign(this.FAppearance.FExpressionValueFont);
        this.FChangeCombo.FAppearance.FEditStroke.SetColor(this.FAppearance.FExpressionValueFill.FColor);
      } else if ($tmp === $mod.TTMSFNCFilterDialogDrawItemPart.ddipAdd) {}
      else if ($tmp === $mod.TTMSFNCFilterDialogDrawItemPart.ddipOperator) {
        if (AOpenParameters.DrawItem.FGroup != null) {
          this.FChangeCombo.FAppearance.FEditFill.Assign(this.FAppearance.FGroupFill);
          this.FChangeCombo.FAppearance.FEditFont.Assign(this.FAppearance.FGroupFont);
          this.FChangeCombo.FAppearance.FEditStroke.SetColor(this.FAppearance.FGroupFill.FColor);
        } else if (AOpenParameters.DrawItem.FExpression != null) {
          this.FChangeCombo.FAppearance.FEditFill.Assign(this.FAppearance.FExpressionOperatorFill);
          this.FChangeCombo.FAppearance.FEditFont.Assign(this.FAppearance.FExpressionOperatorFont);
          this.FChangeCombo.FAppearance.FEditStroke.SetColor(this.FAppearance.FExpressionOperatorFill.FColor);
        };
      };
      this.FChangeCombo.FAppearance.FControlFill.Assign(this.FTopPanel.FAppearance.FFill);
      this.FChangeCombo.FAppearance.FControlStroke.Assign(this.FTopPanel.FAppearance.FStroke);
      this.FChangeCombo.FAppearance.FControlFont.SetColor(pas["WEBLib.TMSFNCEditorsTools"].GetEditorDefaultFontColor());
      this.FChangeCombo.SetHideEdit(AOpenParameters.HideEdit);
      this.FChangeCombo.EndUpdate$3();
      this.FChangeCombo.GetItems().AddStrings(AOpenParameters.List,true);
      this.FChangeCombo.FDropDownHeight = this.FDefaultDropDownHeight;
      this.FChangeCombo.SetEditType$1(pas["WEBLib.TMSFNCEdit"].TTMSFNCEditType.etString);
      if (AOpenParameters.Part === $mod.TTMSFNCFilterDialogDrawItemPart.ddipValue) {
        var $tmp1 = AOpenParameters.DrawItem.FValueType;
        if ($tmp1 === pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtFloat) {
          this.FChangeCombo.SetEditType$1(pas["WEBLib.TMSFNCEdit"].TTMSFNCEditType.etFloat)}
         else if ($tmp1 === pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtNumber) this.FChangeCombo.SetEditType$1(pas["WEBLib.TMSFNCEdit"].TTMSFNCEditType.etNumeric);
      };
      this.FChangeCombo.SetDisableEditKeyInput(AOpenParameters.Fixed);
      var $tmp2 = AOpenParameters.Editor;
      if ($tmp2 === $mod.TTMSFNCFilterDialogEditorType.vetEdit) {
        this.FChangeCombo.SetDropDownType(pas["WEBLib.TMSFNCEditorDropDownEdit"].TTMSFNCEditorDropDownEditType.ddetEdit)}
       else if (($tmp2 === $mod.TTMSFNCFilterDialogEditorType.vetComboBox) || ($tmp2 === $mod.TTMSFNCFilterDialogEditorType.vetComboEdit)) {
        this.FChangeCombo.FAppearance.FListBoxItemHoverFill.Assign(this.FAppearance.FDropDownHoverFill);
        this.FChangeCombo.FAppearance.FListBoxItemHoverFont.Assign(this.FAppearance.FDropDownHoverFont);
        if (AOpenParameters.Fixed) {
          this.FChangeCombo.SetDropDownType(pas["WEBLib.TMSFNCEditorDropDownEdit"].TTMSFNCEditorDropDownEditType.ddetComboBox)}
         else this.FChangeCombo.SetDropDownType(pas["WEBLib.TMSFNCEditorDropDownEdit"].TTMSFNCEditorDropDownEditType.ddetComboEdit);
        this.FChangeCombo.FDropDownWidth = 140;
        this.FChangeCombo.FDropDownHeight = Math.min(this.FDefaultDropDownHeight,(this.FChangeCombo.GetListBoxItemHeight() * AOpenParameters.List.GetCount()) + 4);
      } else if ($tmp2 === $mod.TTMSFNCFilterDialogEditorType.vetTimePicker) {
        this.FChangeCombo.SetDropDownType(pas["WEBLib.TMSFNCEditorDropDownEdit"].TTMSFNCEditorDropDownEditType.ddetTimePicker);
        this.FChangeCombo.FDropDownHeight = 180;
        this.FChangeCombo.FDropDownWidth = 180;
      } else if ($tmp2 === $mod.TTMSFNCFilterDialogEditorType.vetDatePicker) {
        this.FChangeCombo.SetDropDownType(pas["WEBLib.TMSFNCEditorDropDownEdit"].TTMSFNCEditorDropDownEditType.ddetDatePicker);
        this.FChangeCombo.FDropDownHeight = 180;
        this.FChangeCombo.FDropDownWidth = 180;
      };
      this.FChangeCombo.SetLeft(pas.Math.Floor(AOpenParameters.PartRect.Left));
      this.FChangeCombo.SetTop(pas.Math.Floor(AOpenParameters.PartRect.Top));
      this.FChangeCombo.SetWidth(pas.Math.Floor(AOpenParameters.PartRect.Right - AOpenParameters.PartRect.Left));
      this.FChangeCombo.SetHeight(pas.Math.Floor(AOpenParameters.PartRect.Bottom - AOpenParameters.PartRect.Top));
      this.FChangeCombo.SetHideEdit(!(AOpenParameters.Editor in rtl.createSet($mod.TTMSFNCFilterDialogEditorType.vetEdit,$mod.TTMSFNCFilterDialogEditorType.vetComboEdit)));
      this.FChangeCombo.FDateTime = AOpenParameters.DateTime;
      if (AOpenParameters.DateTime < 0) this.FChangeCombo.SetT(AOpenParameters.Text);
      this.FEditorValueText = AOpenParameters.Text;
      this.FChangeCombo.SetVisible(true);
      this.FChangeCombo.OpenDropDown();
      this.FEditorOpen = true;
    };
    this.HandleEditorResult = function (AChange) {
      var txt = "";
      var fs = pas.SysUtils.TFormatSettings.$new();
      var v = undefined;
      var go = 0;
      var eo = 0;
      var dt = 0;
      txt = "";
      if (this.FChangeCombo != null) {
        txt = this.FChangeCombo.GetT();
        this.FChangeCombo.CloseDropDown();
      };
      if (AChange && (this.FEditorValueText !== txt) && (this.FEditorIndex >= 0) && (this.FEditorIndex < this.FDrawItems.FLength)) {
        if (this.FDrawItems.GetItem(this.FEditorIndex).FGroup != null) {
          if ((this.FEditorPart === $mod.TTMSFNCFilterDialogDrawItemPart.ddipOperator) && this.GroupOperatorFoundForText(txt,{get: function () {
              return go;
            }, set: function (v) {
              go = v;
            }})) {
            this.FDrawItems.GetItem(this.FEditorIndex).FGroup.SetGroupOperator(go)}
           else if (this.FEditorPart === $mod.TTMSFNCFilterDialogDrawItemPart.ddipAdd) {
            if (pas.SysUtils.Trim(txt) === this.FOptions.FUILanguage.FAddExpression) {
              this.FDrawItems.GetItem(this.FEditorIndex).FGroup.FExpressions.Add$3()}
             else if (pas.SysUtils.Trim(txt) === this.FOptions.FUILanguage.FAddGroup) this.FDrawItems.GetItem(this.FEditorIndex).FGroup.FGroups.Add$2();
          };
        } else if (this.FDrawItems.GetItem(this.FEditorIndex).FExpression != null) {
          var $tmp = this.FEditorPart;
          if ($tmp === $mod.TTMSFNCFilterDialogDrawItemPart.ddipName) {
            if (this.FDrawItems.GetItem(this.FEditorIndex).FExpression.FColumn != null) {
              dt = this.FDrawItems.GetItem(this.FEditorIndex).FExpression.FColumn.FDataType}
             else dt = pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtAutomatic;
            this.FDrawItems.GetItem(this.FEditorIndex).FExpression.SetColumnByName(txt);
            if ((this.FDrawItems.GetItem(this.FEditorIndex).FExpression.GetValueDataType() !== pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtAutomatic) && (dt !== this.FDrawItems.GetItem(this.FEditorIndex).FExpression.GetValueDataType()) && !((dt === pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtNumber) && (this.FDrawItems.GetItem(this.FEditorIndex).FExpression.GetValueDataType() === pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtFloat))) {
              if (this.FDrawItems.GetItem(this.FEditorIndex).FExpression.GetValueDataType() === pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtBoolean) {
                this.FDrawItems.GetItem(this.FEditorIndex).FExpression.SetExpressionOperator(pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderExpressionOperator.feoEqual)}
               else this.FDrawItems.GetItem(this.FEditorIndex).FExpression.SetExpressionOperator(pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderExpressionOperator.feoNotEmpty);
              this.FDrawItems.GetItem(this.FEditorIndex).FExpression.SetValue(pas["TMS.TMSFNCValue"].TValueToFNCValue(pas.RTTI.TValue.$clone(pas.RTTI.TValue.Empty())));
            };
          } else if ($tmp === $mod.TTMSFNCFilterDialogDrawItemPart.ddipOperator) {
            if (this.ExpressionOperatorFoundForText(txt,{get: function () {
                return eo;
              }, set: function (v) {
                eo = v;
              }})) this.FDrawItems.GetItem(this.FEditorIndex).FExpression.SetExpressionOperator(eo);
          } else if ($tmp === $mod.TTMSFNCFilterDialogDrawItemPart.ddipValue) {
            fs.$assign(this.FFilterBuilder.GetFormatSettings());
            this.DoGetFormatSettings(fs);
            if (this.FDrawItems.GetItem(this.FEditorIndex).FExpression.FColumn != null) {
              dt = this.FDrawItems.GetItem(this.FEditorIndex).FExpression.FColumn.FDataType}
             else dt = pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtAutomatic;
            if (dt === pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtBoolean) {
              if (txt === this.FOptions.FUILanguage.FTrueText) {
                v = true}
               else v = false;
            } else if (dt === pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtDate) {
              v = pas.SysUtils.EncodeDate(pas.DateUtils.YearOf(this.FChangeCombo.FDateTime),pas.DateUtils.MonthOf(this.FChangeCombo.FDateTime),pas.DateUtils.DayOf(this.FChangeCombo.FDateTime))}
             else if (dt === pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtTime) {
              v = pas.SysUtils.EncodeTime(pas.DateUtils.HourOf(this.FChangeCombo.FDateTime),pas.DateUtils.MinuteOf(this.FChangeCombo.FDateTime),pas.DateUtils.SecondOf(this.FChangeCombo.FDateTime),0)}
             else if (dt === pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtDateTime) {
              v = pas.DateUtils.EncodeDateTime(pas.DateUtils.YearOf(this.FChangeCombo.FDateTime),pas.DateUtils.MonthOf(this.FChangeCombo.FDateTime),pas.DateUtils.DayOf(this.FChangeCombo.FDateTime),pas.DateUtils.HourOf(this.FEditorDate),pas.DateUtils.MinuteOf(this.FEditorDate),pas.DateUtils.SecondOf(this.FEditorDate),0)}
             else v = pas["TMS.TMSFNCFilterBuilder"].ParseValueTextToFNCValue(txt,dt,pas.SysUtils.TFormatSettings.$clone(fs));
            this.FDrawItems.GetItem(this.FEditorIndex).FExpression.SetValue(v);
          } else if ($tmp === $mod.TTMSFNCFilterDialogDrawItemPart.ddipExtraValue) {
            fs.$assign(this.FFilterBuilder.GetFormatSettings());
            this.DoGetFormatSettings(fs);
            if (this.FDrawItems.GetItem(this.FEditorIndex).FExpression.FColumn != null) {
              dt = this.FDrawItems.GetItem(this.FEditorIndex).FExpression.FColumn.FDataType}
             else dt = pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtAutomatic;
            if (dt === pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtDateTime) {
              v = pas.DateUtils.EncodeDateTime(pas.DateUtils.YearOf(this.FEditorDate),pas.DateUtils.MonthOf(this.FEditorDate),pas.DateUtils.DayOf(this.FEditorDate),pas.DateUtils.HourOf(this.FChangeCombo.FDateTime),pas.DateUtils.MinuteOf(this.FChangeCombo.FDateTime),pas.DateUtils.SecondOf(this.FChangeCombo.FDateTime),0);
              this.FDrawItems.GetItem(this.FEditorIndex).FExpression.SetValue(v);
            };
          };
        };
        this.UpdateDrawItems();
      };
      this.ResetChangeControls();
    };
    this.DoGetFilterBuilder = function (AFilterBuilder) {
      if (this.FOnGetFilterBuilder != null) this.FOnGetFilterBuilder(this,AFilterBuilder);
    };
    this.DoGetFilterDataColmuns = function (AFilterBuilder, ADataColumns) {
      if (this.FOnGetFilterBuilderDataColumns != null) this.FOnGetFilterBuilderDataColumns(this,AFilterBuilder,ADataColumns);
    };
    this.DoClose = function () {
      if (this.FChangeCombo != null) this.FChangeCombo.CloseDropDown();
      if (this.FFrm.FModalResult !== 1) {
        this.FFilterBuilder.SetFilterText(this.FCopyFilterText);
        this.FFilterText = this.FCopyFilterText;
      };
      this.FDialogOpen = false;
      pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog.DoClose.call(this);
    };
    this.FilterItemsChanged = function () {
      this.UpdateExpressionEdit();
      this.UpdateDrawItems();
    };
    this.DoPreviewResize = function (Sender) {
      this.UpdateDrawItems();
    };
    this.DoFormShow = function (Sender) {
      pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog.DoFormShow.apply(this,arguments);
      this.UpdateDrawItems();
      if ((this.FPreview != null) && this.FPreview.FVisible) this.FPreview.SetFocus();
    };
    this.DoGetModalResult = function (AModalResult) {
      pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog.DoGetModalResult.apply(this,arguments);
    };
    this.DoGetFormatSettings = function (AFormatSettings) {
      if (this.FOnGetFormatSettings != null) this.FOnGetFormatSettings(this,AFormatSettings);
    };
    this.DoOnFilterEditChange = function (Sender) {
      this.FFilterTime = 0;
      this.FFilterTimer.SetEnabled(true);
    };
    this.DoOnChangeComboKeyDown = function (Sender, Key, Shift) {
      if (Key.get() in rtl.createSet(27,13)) {
        if (Key.get() === 27) {
          this.HandleEditorResult(false)}
         else if (Key.get() === 13) this.HandleEditorResult(true);
        Key.set(0);
      };
    };
    this.DoFormKeyDown = function (Sender, Key, Shift) {
      if (Key.get() === 13) this.DoButtonApplyClick(this);
      pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog.DoFormKeyDown.apply(this,arguments);
    };
    this.DoOnFilterTimer = function (Sender) {
      if (this.FFilterTime > 20) {
        this.FFilterTime = 0;
        this.FFilterTimer.SetEnabled(false);
        if (this.FFilterBuilder.GetDisplayFilterText() !== this.FExpressionEdit.GetText()) {
          if (!this.FFilterBuilder.ParseExpression(this.FExpressionEdit.GetText())) {
            this.FExpressionEdit.FFont.SetColor(255)}
           else {
            this.FExpressionEdit.FFont.SetColor(pas["WEBLib.TMSFNCEditorsTools"].GetEditorDefaultFontColor());
            this.UpdateDrawItems();
          };
        };
      } else this.FFilterTime += 1;
    };
    this.DoOnChangeComboDropDownKeyDown = function (Sender, Key, Shift) {
      if (Key.get() === 27) {
        this.HandleEditorResult(false)}
       else if (Key.get() === 13) {
        this.HandleEditorResult(true);
        Key.set(0);
      };
    };
    this.DoOnChangeComboEditKeyDown = function (Sender, Key, Shift) {
      if (Key.get() === 27) {
        this.HandleEditorResult(false)}
       else if (Key.get() === 13) {
        this.HandleEditorResult(true);
        Key.set(0);
      };
    };
    this.DoOnChangeComboGetFormatSettings = function (Sender, AFormatSettings) {
      AFormatSettings.$assign(this.FFilterBuilder.GetFormatSettings());
      this.DoGetFormatSettings(AFormatSettings);
    };
    this.DoOnCloseDropDown = function (Sender) {
      var setResult = false;
      if (this.FEditorOpen && (this.FEditorIndex >= 0)) {
        var $tmp = this.FChangeCombo.FDropDownType;
        if ($tmp === pas["WEBLib.TMSFNCEditorDropDownEdit"].TTMSFNCEditorDropDownEditType.ddetEdit) {
          setResult = true}
         else if ($tmp === pas["WEBLib.TMSFNCEditorDropDownEdit"].TTMSFNCEditorDropDownEditType.ddetComboBox) {
          setResult = this.FChangeCombo.GetItemIndex() >= 0}
         else if ($tmp === pas["WEBLib.TMSFNCEditorDropDownEdit"].TTMSFNCEditorDropDownEditType.ddetComboEdit) {
          setResult = true}
         else if (($tmp === pas["WEBLib.TMSFNCEditorDropDownEdit"].TTMSFNCEditorDropDownEditType.ddetDatePicker) || ($tmp === pas["WEBLib.TMSFNCEditorDropDownEdit"].TTMSFNCEditorDropDownEditType.ddetTimePicker)) {
          setResult = true}
         else {
          setResult = false;
        };
        this.HandleEditorResult(setResult);
      };
      this.FPreview.Invalidate();
    };
    this.BuildDialog = function (AParent) {
      pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog.BuildDialog.apply(this,arguments);
      if (pas["WEBLib.Forms"].TCustomForm.isPrototypeOf(AParent)) {
        AParent.SetFormStyle(pas["WEBLib.Forms"].TFormStyle.fsStayOnTop);
      };
      this.FTopPanel = pas["WEBLib.TMSFNCEditorPanel"].TTMSFNCEditorPanel.$create("Create$1",[AParent]);
      this.FTopPanel.SetPanelPosition(pas["WEBLib.TMSFNCEditorPanel"].TTMSFNCEditorPanelPosition.eppCenter);
      this.FTopPanel.SetAlign(pas["WEBLib.Controls"].TAlign.alTop);
      this.FTopPanel.SetParent(AParent);
      this.FTopPanel.SetHeight(37);
      this.FExpressionEdit = pas["WEBLib.StdCtrls"].TEdit.$create("Create$1",[this.FTopPanel]);
      this.FExpressionEdit.SetParent(this.FTopPanel);
      this.FExpressionEdit.SetText(this.FFilterBuilder.GetDisplayFilterText());
      this.FExpressionEdit.SetAlign(pas["WEBLib.Controls"].TAlign.alTop);
      this.FExpressionEdit.SetAlignWithMargins(true);
      this.FExpressionEdit.FOnChange = rtl.createCallback(this,"DoOnFilterEditChange");
      this.FExpressionEdit.SetAlign(pas["WEBLib.Controls"].TAlign.alClient);
      this.FExpressionEdit.SetAlignWithMargins(true);
      this.FExpressionEdit.FMargins.SetRight(5);
      this.FExpressionEdit.FMargins.SetTop(5);
      this.FExpressionEdit.FMargins.SetBottom(5);
      this.FExpressionEdit.FMargins.SetLeft(5);
      if ($mod.TTMSFNCFilterDialogButton.fdbClear in this.FOptions.FButtons) {
        this.FButtonClear = pas["WEBLib.TMSFNCEditorButton"].TTMSFNCEditorButton.$create("Create$1",[this.FTopPanel]);
        this.FButtonClear.SetParent(this.FTopPanel);
        this.FButtonClear.SetText(this.FOptions.FUILanguage.FClear);
        this.FButtonClear.SetAlign(pas["WEBLib.Controls"].TAlign.alRight);
        this.FButtonClear.SetLeft(99);
        this.FButtonClear.SetAlignWithMargins(true);
        this.FButtonClear.FMargins.SetRight(5);
        this.FButtonClear.FMargins.SetTop(5);
        this.FButtonClear.FMargins.SetBottom(5);
        this.FButtonClear.FMargins.SetLeft(5);
        this.FButtonClear.FOnClick = rtl.createCallback(this,"DoButtonClearClick");
      };
      this.FPanel = pas["WEBLib.TMSFNCEditorPanel"].TTMSFNCEditorPanel.$create("Create$1",[AParent]);
      this.FPanel.SetPanelPosition(pas["WEBLib.TMSFNCEditorPanel"].TTMSFNCEditorPanelPosition.eppCenter);
      this.FPanel.SetAlign(pas["WEBLib.Controls"].TAlign.alClient);
      this.FPanel.SetParent(AParent);
      this.FVScrlBox = pas["WEBLib.ExtCtrls"].TScrollBox.$create("Create$1",[this.FPanel]);
      this.FVScrlBox.SetAlign(pas["WEBLib.Controls"].TAlign.alClient);
      this.FVScrlBox.SetTop(0);
      this.FVScrlBox.SetParent(this.FPanel);
      this.FPreview = $mod.TTMSFNCFilterPreview.$create("Create$1",[this.FVScrlBox]);
      this.FPreview.SetParent(this.FVScrlBox);
      this.FPreview.FDialog = this;
      this.FPreview.SetAlign(pas["WEBLib.Controls"].TAlign.alClient);
      this.FPreview.DisableBackground();
      this.FPreview.DisableStroke();
      this.FPreview.SetShowHint(true);
      this.FChangeCombo = pas["WEBLib.TMSFNCEditorDropDownEdit"].TTMSFNCEditorDropDownEdit.$create("Create$1",[this.FPreview]);
      this.FChangeCombo.SetParent(this.FPreview);
      this.FChangeCombo.SetLeft(-100);
      this.FChangeCombo.SetTop(-100);
      this.FChangeCombo.FAppearance.SetTransparentEdit(true);
      this.FChangeCombo.FOnKeyDown = rtl.createCallback(this,"DoOnChangeComboKeyDown");
      this.FChangeCombo.FOnDropDownKeyDown = rtl.createCallback(this,"DoOnChangeComboDropDownKeyDown");
      this.FChangeCombo.FOnEditKeyDown = rtl.createCallback(this,"DoOnChangeComboEditKeyDown");
      this.FChangeCombo.FOnDropDownClosed = rtl.createCallback(this,"DoOnCloseDropDown");
      this.FChangeCombo.FOnGetFormatSettings = rtl.createCallback(this,"DoOnChangeComboGetFormatSettings");
      this.FBottomPanel = pas["WEBLib.TMSFNCEditorPanel"].TTMSFNCEditorPanel.$create("Create$1",[AParent]);
      this.FBottomPanel.SetPanelPosition(pas["WEBLib.TMSFNCEditorPanel"].TTMSFNCEditorPanelPosition.eppCenter);
      this.FBottomPanel.SetAlign(pas["WEBLib.Controls"].TAlign.alBottom);
      this.FBottomPanel.SetParent(AParent);
      this.FBottomPanel.SetHeight(37);
      if ($mod.TTMSFNCFilterDialogButton.fdbCancel in this.FOptions.FButtons) {
        this.FButtonCancel = pas["WEBLib.TMSFNCEditorButton"].TTMSFNCEditorButton.$create("Create$1",[this.FBottomPanel]);
        this.FButtonCancel.SetParent(this.FBottomPanel);
        this.FButtonCancel.SetText(this.FOptions.FUILanguage.FCancel);
        this.FButtonCancel.SetAlign(pas["WEBLib.Controls"].TAlign.alRight);
        this.FButtonCancel.SetLeft(99);
        this.FButtonCancel.SetAlignWithMargins(true);
        this.FButtonCancel.FMargins.SetRight(5);
        this.FButtonCancel.FMargins.SetTop(5);
        this.FButtonCancel.FMargins.SetBottom(5);
        this.FButtonCancel.FMargins.SetLeft(0);
        this.FButtonCancel.FOnClick = rtl.createCallback(this,"DoButtonCancelClick");
      };
      if ($mod.TTMSFNCFilterDialogButton.fdbApply in this.FOptions.FButtons) {
        this.FButtonApply = pas["WEBLib.TMSFNCEditorButton"].TTMSFNCEditorButton.$create("Create$1",[this.FBottomPanel]);
        this.FButtonApply.SetParent(this.FBottomPanel);
        this.FButtonApply.SetText(this.FOptions.FUILanguage.FApply);
        if ($mod.TTMSFNCFilterDialogButton.fdbOk in this.FOptions.FButtons) {
          this.FButtonApply.SetAlign(pas["WEBLib.Controls"].TAlign.alLeft)}
         else this.FButtonApply.SetAlign(pas["WEBLib.Controls"].TAlign.alRight);
        this.FButtonApply.SetLeft(99);
        this.FButtonApply.SetAlignWithMargins(true);
        this.FButtonApply.FMargins.SetRight(5);
        this.FButtonApply.FMargins.SetTop(5);
        this.FButtonApply.FMargins.SetBottom(5);
        this.FButtonApply.FMargins.SetLeft(5);
        this.FButtonApply.FOnClick = rtl.createCallback(this,"DoButtonApplyClick");
      };
      if ($mod.TTMSFNCFilterDialogButton.fdbOk in this.FOptions.FButtons) {
        this.FButtonOk = pas["WEBLib.TMSFNCEditorButton"].TTMSFNCEditorButton.$create("Create$1",[this.FBottomPanel]);
        this.FButtonOk.SetParent(this.FBottomPanel);
        this.FButtonOk.SetText(this.FOptions.FUILanguage.FOK);
        this.FButtonOk.SetAlign(pas["WEBLib.Controls"].TAlign.alRight);
        this.FButtonOk.SetLeft(130);
        this.FButtonOk.SetAlignWithMargins(true);
        this.FButtonOk.FMargins.SetRight(5);
        this.FButtonOk.FMargins.SetTop(5);
        this.FButtonOk.FMargins.SetBottom(5);
        this.FButtonOk.FMargins.SetLeft(5);
        this.FButtonOk.FOnClick = rtl.createCallback(this,"DoButtonOKClick");
      };
      this.FPreview.FOnResize = rtl.createCallback(this,"DoPreviewResize");
      this.FPreview.FOnAfterDraw = rtl.createCallback(this,"DoAfterDrawPreview");
      this.FPreview.FOnMouseMove = rtl.createCallback(this,"DoPreviewMouseMove");
      this.FPreview.FOnMouseUp = rtl.createCallback(this,"DoPreviewMouseUp");
      this.FPreview.FOnMouseDown = rtl.createCallback(this,"DoPreviewMouseDown");
      this.FPreview.FOnMouseLeave = rtl.createCallback(this,"DoPreviewMouseLeave");
      this.UpdateDrawItems();
      this.ResetChangeControls();
      this.DoOnDarkStyleChanged(this,this.FAppearance.FDarkStyleControls);
    };
    this.UpdateDrawItems = function () {
      var $Self = this;
      var leftTxtSp = 0;
      var RightTxtSp = 0;
      var TopTxtSp = 0;
      var BottomTxtSp = 0;
      var ind = 0.0;
      var ith = 0.0;
      var ComboLength = 0.0;
      var ArrSpace = 0.0;
      var AddSpace = 0.0;
      var rnd = 0.0;
      var wdt = 0.0;
      var offx = 0.0;
      var idx = 0;
      var icm = null;
      var fs = pas.SysUtils.TFormatSettings.$new();
      function AddExpression(AExpression, ALevel) {
        var g = null;
        var twName = 0.0;
        var twOp = 0.0;
        var twVal = 0.0;
        var twExVal = 0.0;
        var it = null;
        var s = 0.0;
        idx = $Self.FDrawItems.FLength;
        it = $Self.FDrawItems.AddItem$1(AExpression,ALevel);
        it.FRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,idx * ith,wdt,(idx + 1) * ith));
        it.FRounding = rnd;
        it.FColumnNameText = AExpression.GetColumnDisplayName();
        it.FOperatorText = $Self.GetTextForExpressionOperator(AExpression.FExpressionOperator);
        it.FValueType = AExpression.GetValueDataType();
        var $tmp = it.FValueType;
        if ($tmp === pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtDateTime) {
          if (pas["TMS.TMSFNCValue"].ValueIsEmpty(AExpression.FValue)) AExpression.SetValue(pas.SysUtils.Now());
          it.FValueText = pas.SysUtils.DateToStr$1(pas["TMS.TMSFNCValue"].ValueToDateTime$1(AExpression.FValue,pas.SysUtils.TFormatSettings.$clone(fs)),fs);
          it.FExtraValueText = pas.SysUtils.TimeToStr$1(pas["TMS.TMSFNCValue"].ValueToDateTime$1(AExpression.FValue,pas.SysUtils.TFormatSettings.$clone(fs)),fs);
        } else if ($tmp === pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtDate) {
          if (pas["TMS.TMSFNCValue"].ValueIsEmpty(AExpression.FValue)) AExpression.SetValue(pas.SysUtils.Now());
          if (pas["TMS.TMSFNCValue"].ValueIsDateTime$1(AExpression.FValue,pas.SysUtils.TFormatSettings.$clone(fs))) {
            it.FValueText = pas.SysUtils.DateToStr$1(pas["TMS.TMSFNCValue"].ValueToDateTime$1(AExpression.FValue,pas.SysUtils.TFormatSettings.$clone(fs)),fs)}
           else it.FValueText = pas["TMS.TMSFNCValue"].FNCValueToString$1(AExpression.FValue,pas.SysUtils.TFormatSettings.$clone(fs));
        } else if ($tmp === pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtTime) {
          if (pas["TMS.TMSFNCValue"].ValueIsEmpty(AExpression.FValue)) AExpression.SetValue(0);
          if (pas["TMS.TMSFNCValue"].ValueIsDateTime$1(AExpression.FValue,pas.SysUtils.TFormatSettings.$clone(fs))) {
            it.FValueText = pas.SysUtils.TimeToStr$1(pas["TMS.TMSFNCValue"].ValueToDateTime$1(AExpression.FValue,pas.SysUtils.TFormatSettings.$clone(fs)),fs)}
           else it.FValueText = pas["TMS.TMSFNCValue"].FNCValueToString$1(AExpression.FValue,pas.SysUtils.TFormatSettings.$clone(fs));
        } else if ($tmp === pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtText) {
          it.FValueText = pas["TMS.TMSFNCValue"].ValueToString(AExpression.FValue);
        } else if ($tmp === pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtBoolean) {
          if (pas["TMS.TMSFNCValue"].ValueToBoolean$1(AExpression.FValue,pas.SysUtils.TFormatSettings.$clone(fs))) {
            it.FValueText = $Self.FOptions.FUILanguage.FTrueText}
           else it.FValueText = $Self.FOptions.FUILanguage.FFalseText;
        } else {
          it.FValueText = pas["TMS.TMSFNCValue"].FNCValueToString$1(AExpression.FValue,pas.SysUtils.TFormatSettings.$clone(fs));
        };
        it.FValue = AExpression.FValue;
        s = Math.min(AddSpace - 20,it.FRect.Bottom - it.FRect.Top - 2) / 2;
        it.FDeleteRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(it.FRect.Right - s - 10,it.FRect.Top + ((it.FRect.Bottom - it.FRect.Top - s) / 2),it.FRect.Right - 10,it.FRect.Top + ((it.FRect.Bottom - it.FRect.Top - s) / 2) + s));
        it.FAddRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(-1,-1,-1,-1));
        it.FNotRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(it.FRect.Left + ((ALevel + 1) * ind) + icm.FLeft,it.FRect.Top + ((it.FRect.Bottom - it.FRect.Top - s) / 2),it.FRect.Left + ((ALevel + 1) * ind) + icm.FLeft + s,it.FRect.Top + ((it.FRect.Bottom - it.FRect.Top - s) / 2) + s));
        twExVal = 0;
        it.FIsInverted = AExpression.FIsInverted;
        g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("Create$1",[$Self.FPreview.GetCanvas(),false]);
        try {
          if ($Self.FAppearance != null) g.FFont.Assign($Self.FAppearance.FExpressionColumnFont);
          twName = Math.max(g.CalculateTextWidth$1(it.FColumnNameText) + leftTxtSp + RightTxtSp,ComboLength);
          if ($Self.FAppearance != null) g.FFont.Assign($Self.FAppearance.FExpressionOperatorFont);
          twOp = Math.max(g.CalculateTextWidth$1(it.FOperatorText) + leftTxtSp + RightTxtSp,ComboLength);
          if ($Self.FAppearance != null) g.FFont.Assign($Self.FAppearance.FExpressionValueFont);
          if (it.FExtraValueText !== "") twExVal = Math.max(g.CalculateTextWidth$1(it.FExtraValueText) + leftTxtSp + RightTxtSp,ComboLength);
          twVal = Math.max(twExVal + g.CalculateTextWidth$1(it.FValueText) + leftTxtSp + RightTxtSp,ComboLength);
        } finally {
          g = rtl.freeLoc(g);
        };
        offx = ((ALevel + 1) * ind) + (3 * icm.FLeft) + (2 * icm.FRight) + (3 * ArrSpace) + (AddSpace / 2) + (it.FNotRect.Right - it.FNotRect.Left);
        if ((offx + twName + twOp + twVal) > wdt) {
          if ((wdt - (offx + twName + twOp)) >= ComboLength) {
            twVal = wdt - (offx + twName + twOp)}
           else {
            twVal = ComboLength;
            if ((wdt - (offx + twVal + twOp)) >= ComboLength) {
              twName = wdt - (offx + twVal + twOp)}
             else {
              twName = ComboLength;
              if ((wdt - (offx + twName + twVal)) >= ComboLength) {
                twOp = wdt - (offx + twVal + twName)}
               else twOp = ComboLength;
            };
          };
        };
        it.FColumnNameRect.$assign(it.FRect);
        it.FColumnNameRect.Top = it.FRect.Top + icm.FTop;
        it.FColumnNameRect.Bottom = it.FRect.Bottom - icm.FBottom;
        it.FColumnNameRect.Left = it.FNotRect.Right + icm.FRight + icm.FLeft;
        it.FColumnNameRect.Right = it.FColumnNameRect.Left + twName + ArrSpace;
        if ($Self.FFilterBuilder.FDataColumns.FLength > 0) {
          it.FColumnNameArrowRect.Right = it.FColumnNameRect.Right - 4;
          it.FColumnNameArrowRect.Left = (it.FColumnNameRect.Right - ArrSpace) + 4;
          it.FColumnNameArrowRect.Top = it.FColumnNameRect.Top + 4;
          it.FColumnNameArrowRect.Bottom = it.FColumnNameRect.Bottom - 4;
        };
        it.FColumnNameTextRect.Right = it.FColumnNameRect.Right - ArrSpace - RightTxtSp;
        it.FColumnNameTextRect.Top = it.FColumnNameRect.Top + TopTxtSp;
        it.FColumnNameTextRect.Bottom = it.FColumnNameRect.Bottom - RightTxtSp;
        it.FColumnNameTextRect.Left = it.FColumnNameRect.Left + leftTxtSp;
        it.FOperatorRect.$assign(it.FRect);
        it.FOperatorRect.Top = it.FRect.Top + icm.FTop;
        it.FOperatorRect.Bottom = it.FRect.Bottom - icm.FBottom;
        it.FOperatorRect.Left = it.FColumnNameRect.Right + icm.FRight + icm.FLeft;
        it.FOperatorRect.Right = it.FOperatorRect.Left + twOp + ArrSpace;
        if (AExpression.GetValueDataType() !== pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtBoolean) {
          it.FOperatorArrowRect.Right = it.FOperatorRect.Right - 4;
          it.FOperatorArrowRect.Left = (it.FOperatorRect.Right - ArrSpace) + 4;
          it.FOperatorArrowRect.Top = it.FOperatorRect.Top + 4;
          it.FOperatorArrowRect.Bottom = it.FOperatorRect.Bottom - 4;
        };
        it.FOperatorTextRect.Left = it.FOperatorRect.Left + leftTxtSp;
        it.FOperatorTextRect.Right = it.FOperatorRect.Right - ArrSpace - RightTxtSp;
        it.FOperatorTextRect.Top = it.FOperatorRect.Top + TopTxtSp;
        it.FOperatorTextRect.Bottom = it.FOperatorRect.Bottom - BottomTxtSp;
        if (!(AExpression.FExpressionOperator in rtl.createSet(pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderExpressionOperator.feoEmpty,pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderExpressionOperator.feoNotEmpty))) {
          it.FValueRect.$assign(it.FRect);
          it.FValueRect.Top = it.FRect.Top + icm.FTop;
          it.FValueRect.Bottom = it.FRect.Bottom - icm.FBottom;
          it.FValueRect.Left = it.FOperatorRect.Right + icm.FRight + icm.FLeft;
          it.FValueRect.Right = Math.min(((it.FValueRect.Left + twVal) - twExVal) + ArrSpace,it.FRect.Right - twExVal - AddSpace);
          if (it.FValueType in $mod.COMBOTYPES) {
            it.FValueArrowRect.Right = it.FValueRect.Right - 4;
            it.FValueArrowRect.Left = (it.FValueRect.Right - ArrSpace) + 4;
            it.FValueArrowRect.Top = it.FValueRect.Top + 4;
            it.FValueArrowRect.Bottom = it.FValueRect.Bottom - 4;
          } else it.FValueArrowRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(-1,-1,-1,-1));
          it.FValueTextRect.Left = it.FValueRect.Left + leftTxtSp;
          it.FValueTextRect.Right = it.FValueRect.Right - RightTxtSp;
          if (it.FValueType in $mod.COMBOTYPES) {
            it.FValueTextRect.Right = it.FValueTextRect.Right - ArrSpace;
          };
          it.FValueTextRect.Top = it.FValueRect.Top + TopTxtSp;
          it.FValueTextRect.Bottom = it.FValueRect.Bottom - BottomTxtSp;
          if (it.FExtraValueText !== "") {
            it.FExtraValueRect.$assign(it.FRect);
            it.FExtraValueRect.Top = it.FValueRect.Top;
            it.FExtraValueRect.Bottom = it.FValueRect.Bottom;
            it.FExtraValueRect.Left = it.FValueRect.Right + icm.FLeft;
            it.FExtraValueRect.Right = Math.min(it.FExtraValueRect.Left + twExVal + ArrSpace,it.FRect.Right - AddSpace);
            if (it.FValueType in $mod.COMBOTYPES) {
              it.FExtraValueArrowRect.Right = it.FExtraValueRect.Right - 4;
              it.FExtraValueArrowRect.Left = (it.FExtraValueRect.Right - ArrSpace) + 4;
              it.FExtraValueArrowRect.Top = it.FExtraValueRect.Top + 4;
              it.FExtraValueArrowRect.Bottom = it.FExtraValueRect.Bottom - 4;
            } else it.FExtraValueArrowRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(-1,-1,-1,-1));
            it.FExtraValueTextRect.Left = it.FExtraValueRect.Left + leftTxtSp;
            it.FExtraValueTextRect.Right = it.FExtraValueRect.Right - RightTxtSp;
            if (it.FValueType in $mod.COMBOTYPES) {
              it.FExtraValueTextRect.Right = it.FExtraValueTextRect.Right - ArrSpace;
            };
            it.FExtraValueTextRect.Top = it.FExtraValueRect.Top + TopTxtSp;
            it.FExtraValueTextRect.Bottom = it.FExtraValueRect.Bottom - BottomTxtSp;
          };
        } else it.FValueRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(-1,-1,-1,-1));
      };
      function AddGroups(AGroup, ALevel) {
        var g = null;
        var s = 0.0;
        var twOp = 0.0;
        var I = 0;
        var it = null;
        idx = $Self.FDrawItems.FLength;
        it = $Self.FDrawItems.AddItem$2(AGroup,ALevel);
        it.FLevel = ALevel;
        it.FRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,it.FIndex * ith,wdt,(it.FIndex + 1) * ith));
        it.FRounding = rnd;
        s = Math.min(AddSpace - 20,it.FRect.Bottom - it.FRect.Top - 2) / 2;
        it.FDeleteRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(it.FRect.Right - s - 10,it.FRect.Top + ((it.FRect.Bottom - it.FRect.Top - s) / 2),it.FRect.Right - 10,it.FRect.Top + ((it.FRect.Bottom - it.FRect.Top - s) / 2) + s));
        it.FAddRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(it.FDeleteRect.Left - 5 - s,it.FDeleteRect.Top,it.FDeleteRect.Left - 5,it.FDeleteRect.Bottom));
        it.FOperatorText = $Self.GetTextForGroupOperator(AGroup.FGroupOperator);
        g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("Create$1",[$Self.FPreview.GetCanvas(),false]);
        try {
          if ($Self.FAppearance != null) g.FFont.Assign($Self.FAppearance.FGroupFont);
          twOp = Math.max(g.CalculateTextWidth$1($Self.FDrawItems.GetItem(idx).FOperatorText) + leftTxtSp + RightTxtSp,ComboLength);
        } finally {
          g = rtl.freeLoc(g);
        };
        it.FOperatorRect.$assign(it.FRect);
        it.FOperatorRect.Top = it.FRect.Top + icm.FTop;
        it.FOperatorRect.Bottom = it.FRect.Bottom - icm.FBottom;
        it.FOperatorRect.Left = it.FRect.Left + ((ALevel + 1) * ind) + icm.FLeft;
        it.FOperatorRect.Right = it.FOperatorRect.Left + twOp + ArrSpace;
        it.FOperatorArrowRect.Right = it.FOperatorRect.Right - 4;
        it.FOperatorArrowRect.Left = (it.FOperatorRect.Right - ArrSpace) + 4;
        it.FOperatorArrowRect.Top = it.FOperatorRect.Top + 4;
        it.FOperatorArrowRect.Bottom = it.FOperatorRect.Bottom - 4;
        it.FOperatorTextRect.Left = it.FOperatorRect.Left + leftTxtSp;
        it.FOperatorTextRect.Right = it.FOperatorRect.Right - ArrSpace - RightTxtSp;
        it.FOperatorTextRect.Top = it.FOperatorRect.Top + TopTxtSp;
        it.FOperatorTextRect.Bottom = it.FOperatorRect.Bottom - BottomTxtSp;
        for (var $l = 0, $end = AGroup.FGroups.FLength - 1; $l <= $end; $l++) {
          I = $l;
          AddGroups(AGroup.FGroups.GetItem(I),ALevel + 1);
        };
        for (var $l1 = 0, $end1 = AGroup.FExpressions.FLength - 1; $l1 <= $end1; $l1++) {
          I = $l1;
          AddExpression(AGroup.FExpressions.GetItem(I),ALevel + 1);
        };
        if (AGroup === $Self.FFilterBuilder.FFilter) {
          it.FEndIndex = idx + 1}
         else it.FEndIndex = idx;
      };
      function AddLast() {
        var s = 0.0;
        var it = null;
        idx = $Self.FDrawItems.FLength;
        it = $Self.FDrawItems.AddItem();
        it.FGroup = $Self.FFilterBuilder.FFilter;
        it.FLevel = 1;
        it.FRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,it.FIndex * ith,wdt,(it.FIndex + 1) * ith));
        it.FRounding = rnd;
        s = Math.min(AddSpace - 20,it.FRect.Bottom - it.FRect.Top - 2) / 2;
        it.FAddRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(it.FRect.Left + ((it.FLevel + 1) * ind) + icm.FLeft,it.FRect.Top + ((it.FRect.Bottom - it.FRect.Top - s) / 2),it.FRect.Left + ((it.FLevel + 1) * ind) + icm.FLeft + s,it.FRect.Top + ((it.FRect.Bottom - it.FRect.Top - s) / 2) + s));
        it.FEndIndex = idx;
      };
      if (!(this.FPreview != null)) return;
      this.FNotText = this.FFilterBuilder.FParseFormat.FNotOperator;
      ComboLength = this.FPreview.ScalePaintValue(50);
      ArrSpace = this.FPreview.ScalePaintValue(20);
      AddSpace = this.FPreview.ScalePaintValue(60);
      leftTxtSp = this.FPreview.ScalePaintValue(5);
      RightTxtSp = this.FPreview.ScalePaintValue(3);
      TopTxtSp = this.FPreview.ScalePaintValue(3);
      BottomTxtSp = this.FPreview.ScalePaintValue(3);
      fs.$assign(pas.SysUtils.TFormatSettings.Create());
      this.DoGetFormatSettings(fs);
      icm = pas["WEBLib.TMSFNCTypes"].TTMSFNCMargins.$create("Create$2",[pas["WEBLib.TMSFNCTypes"].RectF(this.FPreview.ScalePaintValue(4),this.FPreview.ScalePaintValue(4),this.FPreview.ScalePaintValue(4),this.FPreview.ScalePaintValue(6))]);
      if (this.FPreview != null) {
        wdt = this.FPreview.GetWidth()}
       else wdt = this.FFrm.GetWidth();
      if (this.FAppearance != null) {
        ind = this.FAppearance.FIndent;
        ith = this.FAppearance.FItemHeight;
        icm.Assign(this.FAppearance.FItemControlsMargins);
        rnd = this.FAppearance.FItemRounding;
      } else {
        ind = this.FPreview.ScalePaintValue(20);
        ith = this.FPreview.ScalePaintValue(30);
        rnd = this.FPreview.ScalePaintValue(4);
      };
      this.FDrawItems.Clear();
      AddGroups(this.FFilterBuilder.FFilter,0);
      AddLast();
      icm = rtl.freeLoc(icm);
      this.FPreview.SetHeight(pas.Math.Floor((this.FDrawItems.FLength + 1) * ith) + 1);
      this.FPreview.Invalidate();
      this.UpdateExpressionEdit();
    };
    this.UpdateExpressionEdit = function () {
      var cpos = 0;
      if (this.FExpressionEdit != null) {
        if (this.FExpressionEdit.GetText() !== this.FFilterBuilder.GetDisplayFilterText()) {
          cpos = -1;
          if (this.FExpressionEdit.IsFocused()) cpos = this.FExpressionEdit.GetSelStart();
          this.FExpressionEdit.SetText(this.FFilterBuilder.GetDisplayFilterText());
          this.FExpressionEdit.FFont.SetColor(pas["WEBLib.TMSFNCEditorsTools"].GetEditorDefaultFontColor());
          if (cpos >= 0) this.FExpressionEdit.SetSelStart(cpos);
        };
      };
    };
    this.DoShowGroupEditorEvent = function (AGroup, AEditorProperties, AValues, AFixed, AShow) {
      if (this.FOnShowGroupEditor != null) this.FOnShowGroupEditor(this,AGroup,AEditorProperties,AValues,AFixed,AShow);
    };
    this.DoGetExpressionValueList = function (AColumn, AValues) {
      if (this.FOnGetExpressionValues != null) this.FOnGetExpressionValues(this,AColumn,AValues);
    };
    this.DoShowExpressionEditorEvent = function (AExpression, AEditorProperties, AValues, AFixed, AShow) {
      if (this.FOnShowExpressionEditor != null) this.FOnShowExpressionEditor(this,AExpression,AEditorProperties,AValues,AFixed,AShow);
    };
    this.DoBeforeExecute = function () {
      this.DoGetFilterBuilder({p: this, get: function () {
          return this.p.FFilterBuilder;
        }, set: function (v) {
          this.p.FFilterBuilder = v;
        }});
      this.DoGetFilterDataColmuns(this.FFilterBuilder,this.FFilterBuilder.FDataColumns);
      if (this.FFilterBuilder.GetDisplayFilterText() !== this.FFilterText) this.SetFilterText(this.FFilterText);
    };
    this.GetTextForGroupOperator = function (AGroupOperator) {
      var Result = "";
      var $tmp = AGroupOperator;
      if ($tmp === pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderGroupOperator.fgoAND) {
        Result = this.FOptions.FUILanguage.FAndOperatorText}
       else if ($tmp === pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderGroupOperator.fgoOR) {
        Result = this.FOptions.FUILanguage.FOrOperatorText}
       else {
        Result = "UNKNOWN OPERATOR";
      };
      return Result;
    };
    this.GetTextForExpressionOperator = function (AExpressionOperator) {
      var Result = "";
      Result = pas["TMS.TMSFNCFilterBuilder"].GetFilterBuilderTextForExpressionOperator(AExpressionOperator,this.FOptions.FUILanguage);
      return Result;
    };
    this.GroupOperatorFoundForText = function (AText, AGroupOperator) {
      var Result = false;
      Result = true;
      if (pas.SysUtils.Trim(AText) === pas.SysUtils.Trim(this.FOptions.FUILanguage.FAndOperatorText)) {
        AGroupOperator.set(pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderGroupOperator.fgoAND)}
       else if (pas.SysUtils.Trim(AText) === pas.SysUtils.Trim(this.FOptions.FUILanguage.FOrOperatorText)) {
        AGroupOperator.set(pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderGroupOperator.fgoOR)}
       else Result = false;
      return Result;
    };
    this.ExpressionOperatorFoundForText = function (AText, AExpressionOperator) {
      var Result = false;
      Result = pas["TMS.TMSFNCFilterBuilder"].GetFilterBuilderExpressionOperatorFoundForText(AText,AExpressionOperator,this.FOptions.FUILanguage);
      return Result;
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog.Create$1.apply(this,arguments);
      this.FDestroyForm = false;
      this.SetDialogWidth(470);
      this.FDefaultDropDownHeight = 150;
      this.FSizeable = true;
      this.FAllowReturnKeyClose = true;
      this.FFilterTimer = pas["WEBLib.ExtCtrls"].TTimer.$create("Create$1",[null]);
      this.FFilterTimer.FOnTimer = rtl.createCallback(this,"DoOnFilterTimer");
      this.FFilterTimer.SetInterval(50);
      this.FFilterTimer.SetEnabled(false);
      this.FOriginalFilterBuilder = pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilder.$create("Create$1");
      this.FOriginalFilterBuilder.FFilter.FOnInternalChanged = rtl.createCallback(this,"DoOnInternalFilterChanged");
      this.FFilterBuilder = this.FOriginalFilterBuilder;
      this.FOptions = $mod.TTMSFNCFilterDialogOptions.$create("Create$1",[this]);
      this.FAppearance = $mod.TTMSFNCFilterDialogAppearance.$create("Create$1",[this]);
      this.FAppearance.FOnInternalChanged = rtl.createCallback(this,"DoOnAppearanceChanged");
      this.FAllowReturnKeyClose = false;
      this.FDrawItems = $mod.TTMSFNCFilterDialogDrawItemList.$create("Create$4",[true]);
      this.SetCaption(this.FOptions.FUILanguage.FCaption);
      this.FMouseDown = false;
      this.FMouseDrag = false;
      this.ResetHoveredItem();
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FFilterTimer");
      rtl.free(this,"FDrawItems");
      rtl.free(this,"FOriginalFilterBuilder");
      rtl.free(this,"FOptions");
      rtl.free(this,"FAppearance");
      pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCCustomFilterDialog.isPrototypeOf(Source)) {
        this.FOptions.Assign(rtl.as(Source,$mod.TTMSFNCCustomFilterDialog).FOptions);
        this.FAppearance.Assign(rtl.as(Source,$mod.TTMSFNCCustomFilterDialog).FAppearance);
      } else pas["WEBLib.Controls"].TControl.Assign.apply(this,arguments);
    };
    this.Execute = function (AProc, AModal) {
      this.FDialogOpen = true;
      this.FIsModal = AModal;
      if (this.FFilterBuilder != null) this.FCopyFilterText = this.FFilterBuilder.GetFilterText();
      this.DoBeforeExecute();
      if (!(this.FFilterBuilder != null)) {
        AProc(3);
        return;
      };
      pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog.Execute.apply(this,arguments);
    };
    this.ValidateFilterRow = function (AInputRow) {
      var Result = false;
      Result = this.FFilterBuilder.ValidateFilterRow(rtl.arrayRef(AInputRow));
      return Result;
    };
    this.ValidateFilterArray = function (AInputArray) {
      var Result = [];
      Result = this.FFilterBuilder.ValidateFilterArray(rtl.arrayRef(AInputArray),false);
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCFilterDialog",this.TTMSFNCCustomFilterDialog,function () {
    this.Create$1 = function (AOwner) {
      $mod.TTMSFNCCustomFilterDialog.Create$1.apply(this,arguments);
      this.FFilterBuilder.SetFormatType(pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderFormatType.fftUniversalFilterExpressions);
      return this;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("FilterText",3,rtl.string,"GetFilterText","SetFilterText");
    $r.addProperty("DisplayFilterText",3,rtl.string,"GetDisplayFilterText","SetFilterText");
    $r.addProperty("Options",2,$mod.$rtti["TTMSFNCFilterDialogOptions"],"FOptions","SetOptions");
    $r.addProperty("Appearance",2,$mod.$rtti["TTMSFNCFilterDialogAppearance"],"FAppearance","SetAppearance");
    $r.addProperty("OnClose",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClose","FOnClose");
    $r.addProperty("OnGetFilterBuilder",0,$mod.$rtti["TTMSFNCFilterDialogGetFilterBuilder"],"FOnGetFilterBuilder","FOnGetFilterBuilder");
    $r.addProperty("OnGetFilterBuilderDataColumns",0,$mod.$rtti["TTMSFNCFilterDialogGetFilterBuilderColumns"],"FOnGetFilterBuilderDataColumns","FOnGetFilterBuilderDataColumns");
    $r.addProperty("OnGetFormatSettings",0,$mod.$rtti["TTMSFNCFilterDialogGetFormatSettings"],"FOnGetFormatSettings","FOnGetFormatSettings");
    $r.addProperty("OnShowGroupEditor",0,$mod.$rtti["TTMSFNCFilterDialogShowGroupEditor"],"FOnShowGroupEditor","FOnShowGroupEditor");
    $r.addProperty("OnShowExpressionEditor",0,$mod.$rtti["TTMSFNCFilterDialogShowExpressionEditor"],"FOnShowExpressionEditor","FOnShowExpressionEditor");
    $r.addProperty("OnShowCustomEditor",0,$mod.$rtti["TTMSFNCFilterDialogShowCustomEditor"],"FOnShowCustomEditor","FOnShowCustomEditor");
    $r.addProperty("OnApplyButtonClicked",0,$mod.$rtti["TTMSFNCFilterDialogButtonClicked"],"FOnApplyButtonClicked","FOnApplyButtonClicked");
    $r.addProperty("OnOKButtonClicked",0,$mod.$rtti["TTMSFNCFilterDialogButtonClicked"],"FOnOKButtonClicked","FOnOKButtonClicked");
    $r.addProperty("OnCancelButtonClicked",0,$mod.$rtti["TTMSFNCFilterDialogButtonClicked"],"FOnCancelButtonClicked","FOnCancelButtonClicked");
    $r.addProperty("OnClearButtonClicked",0,$mod.$rtti["TTMSFNCFilterDialogButtonClearClicked"],"FOnClearButtonClicked","FOnClearButtonClicked");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
  this.$rtti.$MethodVar("TTMSFNCDataSetFilterDialogAddColumn",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AField",pas.DB.$rtti["TField"]],["AColumnProperties",pas["TMS.TMSFNCFilterBuilder"].$rtti["TTMSFNCFilterBuilderColumnProperties"],1],["AAdd",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataSetFilterDialogColumnAdded",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",pas["TMS.TMSFNCFilterBuilder"].$rtti["TTMSFNCFilterBuilderColumn"]]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCCustomDataSetFilterDialog",this.TTMSFNCCustomFilterDialog,function () {
    this.$init = function () {
      $mod.TTMSFNCCustomFilterDialog.$init.call(this);
      this.FDataSet = null;
      this.FOnBeforeAddColumn = null;
      this.FOnAfterAddColumn = null;
    };
    this.$final = function () {
      this.FDataSet = undefined;
      this.FOnBeforeAddColumn = undefined;
      this.FOnAfterAddColumn = undefined;
      $mod.TTMSFNCCustomFilterDialog.$final.call(this);
    };
    this.SetDataSet = function (Value) {
      if (this.FDataSet !== Value) {
        this.FDataSet = Value;
        if (this.FDataSet != null) {
          this.AddDataSetColumns();
          this.SetFilterText(this.FDataSet.FFilterText);
        };
      };
    };
    this.GetFilterText = function () {
      var Result = "";
      if (!this.FDialogOpen && (this.FDataSet != null)) $mod.TTMSFNCCustomFilterDialog.SetFilterText.call(this,this.FDataSet.FFilterText);
      Result = $mod.TTMSFNCCustomFilterDialog.GetFilterText.call(this);
      return Result;
    };
    this.SetFilterText = function (Value) {
      var df = false;
      $mod.TTMSFNCCustomFilterDialog.SetFilterText.call(this,Value);
      if (this.FDataSet != null) {
        df = this.FDataSet.FFiltered;
        this.FDataSet.SetFiltered(false);
        this.FDataSet.SetFilterText(this.FFilterBuilder.GetFilterText());
        if (df && (this.FFilterBuilder.GetFilterText() !== "")) this.FDataSet.SetFiltered(true);
      };
    };
    this.Notification = function (AComponent, AOperation) {
      pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog.Notification.apply(this,arguments);
      if ((AOperation === pas.Classes.TOperation.opRemove) && (AComponent === this.FDataSet)) this.FDataSet = null;
    };
    this.AddDataSetColumns = function () {
      var I = 0;
      var dt = 0;
      var cp = pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderColumnProperties.$new();
      var c = null;
      var add = false;
      if (this.FDataSet != null) {
        this.FFilterBuilder.FDataColumns.Clear();
        for (var $l = 0, $end = this.FDataSet.FFieldList.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          if (this.FDataSet.FFieldList.GetField(I).FFieldKind === pas.DB.TFieldKind.fkData) {
            var $tmp = this.FDataSet.FFieldList.GetField(I).FDataType;
            if (($tmp === pas.DB.TFieldType.ftWord) || ($tmp === pas.DB.TFieldType.ftInteger) || ($tmp === pas.DB.TFieldType.ftAutoInc) || ($tmp === pas.DB.TFieldType.ftLargeint)) {
              dt = pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtNumber}
             else if ($tmp === pas.DB.TFieldType.ftFloat) {
              dt = pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtFloat}
             else if (($tmp === pas.DB.TFieldType.ftDateTime) || ($tmp === pas.DB.TFieldType.ftTimeStamp) || ($tmp === pas.DB.TFieldType.ftTimeStampOffset)) {
              dt = pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtDateTime}
             else if ($tmp === pas.DB.TFieldType.ftDate) {
              dt = pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtDate}
             else if ($tmp === pas.DB.TFieldType.ftTime) {
              dt = pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtTime}
             else if ($tmp === pas.DB.TFieldType.ftBoolean) {
              dt = pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtBoolean}
             else if (($tmp === pas.DB.TFieldType.ftString) || ($tmp === pas.DB.TFieldType.ftWideString) || ($tmp === pas.DB.TFieldType.ftFixedChar) || ($tmp === pas.DB.TFieldType.ftMemo) || ($tmp === pas.DB.TFieldType.ftWideMemo)) {
              dt = pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtText}
             else if (($tmp === pas.DB.TFieldType.ftBlob) || ($tmp === pas.DB.TFieldType.ftGraphic)) {
              dt = pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtOther}
             else {
              dt = pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderDataType.fdtAutomatic;
            };
            cp.Name = this.FDataSet.FFieldList.GetField(I).FFieldName;
            cp.DataType = dt;
            add = true;
            this.DoBeforeAddColumn(this.FDataSet.FFieldList.GetField(I),cp,{get: function () {
                return add;
              }, set: function (v) {
                add = v;
              }});
            if (add) {
              c = this.FFilterBuilder.AddDataColumn$1(cp.Name,cp.DataType,cp.DisplayName);
              this.DoAfterAddColumn(c);
            };
          };
        };
      };
    };
    this.DoBeforeExecute = function () {
      this.AddDataSetColumns();
      if (this.FFilterBuilder.GetDisplayFilterText() !== this.FFilterText) this.SetFilterText(this.FFilterText);
    };
    this.DoGetModalResult = function (AModalResult) {
      $mod.TTMSFNCCustomFilterDialog.DoGetModalResult.apply(this,arguments);
    };
    this.DoBeforeAddColumn = function (AField, AColumnProperties, AAdd) {
      if (this.FOnBeforeAddColumn != null) this.FOnBeforeAddColumn(this,AField,AColumnProperties,AAdd);
    };
    this.DoAfterAddColumn = function (AColumn) {
      if (this.FOnAfterAddColumn != null) this.FOnAfterAddColumn(this,AColumn);
    };
    this.DoApplyClicked = function (AFilterBuilder, AClose) {
      var fTxt = "";
      if (this.FOnApplyButtonClicked != null) {
        this.FOnApplyButtonClicked(this,AFilterBuilder,AClose)}
       else if (this.FDataSet != null) {
        fTxt = pas.SysUtils.Trim(this.GetFilterText());
        this.FDataSet.SetFiltered(false);
        this.FDataSet.SetFilterText(fTxt);
        if (fTxt !== "") this.FDataSet.SetFiltered(true);
      };
    };
    this.DoOKClicked = function (AFilterBuilder, AClose) {
      var fTxt = "";
      if (this.FOnOKButtonClicked != null) {
        this.FOnOKButtonClicked(this,AFilterBuilder,AClose)}
       else if (this.FDataSet != null) {
        fTxt = pas.SysUtils.Trim(this.GetFilterText());
        this.FDataSet.SetFiltered(false);
        this.FDataSet.SetFilterText(fTxt);
        if (fTxt !== "") this.FDataSet.SetFiltered(true);
      };
    };
    this.DoCancelClicked = function (AFilterBuilder, AClose) {
      if (this.FOnCancelButtonClicked != null) {
        this.FOnCancelButtonClicked(this,AFilterBuilder,AClose)}
       else if (this.FDataSet != null) {
        this.FDataSet.SetFilterText(this.FCopyFilterText);
        if (this.FCopyFilterText !== "") this.FDataSet.SetFiltered(true);
      };
    };
    this.DoGetExpressionValueList = function (AColumn, AValues) {
      var s = "";
      var ds = null;
      var f = null;
      var b = false;
      var fd = false;
      if ((this.FDataSet != null) && this.FDataSet.GetActive()) {
        if (this.FOnGetExpressionValues != null) {
          this.FOnGetExpressionValues(this,AColumn,AValues)}
         else {
          f = this.FDataSet.FieldByName(AColumn.FName);
          if ((f != null) && (f.FDataSet != null)) {
            f.FDataSet.DisableControls();
            fd = f.FDataSet.FFiltered;
            f.FDataSet.SetFiltered(false);
            ds = null;
            b = false;
            if (!(ds != null)) {
              ds = f.FDataSet;
              b = true;
            };
            if (ds != null) {
              try {
                ds.First();
                while (!ds.GetEOF()) {
                  s = ds.FieldByName(f.FFieldName).GetAsString();
                  AValues.Add(s);
                  ds.Next();
                };
              } finally {
                if (!b) ds = rtl.freeLoc(ds);
                f.FDataSet.SetFiltered(fd);
                f.FDataSet.EnableControls();
              };
            };
          };
        };
      };
    };
    this.Create$1 = function (AOwner) {
      $mod.TTMSFNCCustomFilterDialog.Create$1.apply(this,arguments);
      return this;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCDataSetFilterDialog",this.TTMSFNCCustomDataSetFilterDialog,function () {
    this.RegisterRuntimeClasses = function () {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClass($mod.TTMSFNCDataSetFilterDialog);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("FilterText",3,rtl.string,"GetFilterText","SetFilterText");
    $r.addProperty("DataSet",2,pas.DB.$rtti["TDataSet"],"FDataSet","SetDataSet");
    $r.addProperty("Options",2,$mod.$rtti["TTMSFNCFilterDialogOptions"],"FOptions","SetOptions");
    $r.addProperty("Appearance",2,$mod.$rtti["TTMSFNCFilterDialogAppearance"],"FAppearance","SetAppearance");
    $r.addProperty("OnClose",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClose","FOnClose");
    $r.addProperty("OnGetFormatSettings",0,$mod.$rtti["TTMSFNCFilterDialogGetFormatSettings"],"FOnGetFormatSettings","FOnGetFormatSettings");
    $r.addProperty("OnShowGroupEditor",0,$mod.$rtti["TTMSFNCFilterDialogShowGroupEditor"],"FOnShowGroupEditor","FOnShowGroupEditor");
    $r.addProperty("OnShowExpressionEditor",0,$mod.$rtti["TTMSFNCFilterDialogShowExpressionEditor"],"FOnShowExpressionEditor","FOnShowExpressionEditor");
    $r.addProperty("OnShowCustomEditor",0,$mod.$rtti["TTMSFNCFilterDialogShowCustomEditor"],"FOnShowCustomEditor","FOnShowCustomEditor");
    $r.addProperty("OnApplyButtonClicked",0,$mod.$rtti["TTMSFNCFilterDialogButtonClicked"],"FOnApplyButtonClicked","FOnApplyButtonClicked");
    $r.addProperty("OnOKButtonClicked",0,$mod.$rtti["TTMSFNCFilterDialogButtonClicked"],"FOnOKButtonClicked","FOnOKButtonClicked");
    $r.addProperty("OnCancelButtonClicked",0,$mod.$rtti["TTMSFNCFilterDialogButtonClicked"],"FOnCancelButtonClicked","FOnCancelButtonClicked");
    $r.addProperty("OnClearButtonClicked",0,$mod.$rtti["TTMSFNCFilterDialogButtonClearClicked"],"FOnClearButtonClicked","FOnClearButtonClicked");
    $r.addProperty("OnBeforeAddColumn",0,$mod.$rtti["TTMSFNCDataSetFilterDialogAddColumn"],"FOnBeforeAddColumn","FOnBeforeAddColumn");
    $r.addProperty("OnAfterAddColumn",0,$mod.$rtti["TTMSFNCDataSetFilterDialogColumnAdded"],"FOnAfterAddColumn","FOnAfterAddColumn");
    $r.addProperty("OnGetExpressionValues",0,$mod.$rtti["TTMSFNCFilterDialogGetExpressionValues"],"FOnGetExpressionValues","FOnGetExpressionValues");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
  $mod.$implcode = function () {
    rtl.createClass($impl,"TFBOpen",pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilder,function () {
    });
    rtl.createClass($impl,"TFBGroupOpen",pas["TMS.TMSFNCFilterBuilder"].TTMSFNCFilterBuilderGroup,function () {
    });
    rtl.createClass($impl,"TTMSFNCCustomDialogEx",pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog,function () {
      rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
      rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
      rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
      rtl.addIntf(this,pas.System.IUnknown);
    });
    rtl.createClass($impl,"TCustomFormOpen",pas["WEBLib.Forms"].TCustomForm,function () {
      rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
      rtl.addIntf(this,pas.System.IUnknown);
    });
    $impl.TranslateTextEx = function (AText) {
      var Result = "";
      Result = AText;
      return Result;
    };
    $impl.ContainsLetters = function (AText) {
      var Result = false;
      var c = "\x00";
      Result = false;
      for (var $in = AText, $l = 0, $end = $in.length - 1; $l <= $end; $l++) {
        c = $in.charAt($l);
        if (pas["WEBLib.TMSFNCTypes"].CharIsLetter(c)) {
          Result = true;
          return Result;
        };
      };
      return Result;
    };
  };
  $mod.$init = function () {
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TTMSFNCADDBITMAP);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TTMSFNCREMOVEBITMAP);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($mod.TTMSFNCNOTBITMAP);
  };
},["WEBLib.TMSFNCEdit","RTTI","Math","WEBLib.Graphics","WEBLib.TMSFNCEditorsTools","WEBLib.TMSFNCUtils","DateUtils"]);
rtl.module("WEBLib.TMSFNCCheckedListBox",["System","Classes","WEBLib.TMSFNCListBox","WEBLib.TMSFNCTreeView","WEBLib.TMSFNCTreeViewData","WEBLib.TMSFNCTypes"],function () {
  "use strict";
  var $mod = this;
  this.MAJ_VER = 1;
  this.MIN_VER = 0;
  this.REL_VER = 0;
  this.BLD_VER = 2;
  this.$rtti.$Class("TTMSFNCCheckedListBoxItems");
  rtl.createClass(this,"TTMSFNCCheckedListBoxItem",pas["WEBLib.TMSFNCListBox"].TTMSFNCListBoxItem,function () {
    var $r = this.$rtti;
    $r.addProperty("Checked",2,rtl.boolean,"FChecked","SetChecked",4,{Default: false});
  });
  this.$rtti.$DynArray("TTMSFNCListBoxCheckedItems",{eltype: this.$rtti["TTMSFNCCheckedListBoxItem"]});
  rtl.createClass(this,"TTMSFNCCheckedListBoxItems",pas["WEBLib.TMSFNCListBox"].TTMSFNCListBoxItems,function () {
    this.GetItemClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCCheckedListBoxItem;
      return Result;
    };
    this.CheckedItems = function () {
      var Result = [];
      var I = 0;
      var n = null;
      Result = [];
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        n = rtl.as(this.GetItem$1(I),$mod.TTMSFNCCheckedListBoxItem);
        if (n.FChecked) {
          Result = rtl.arraySetLength(Result,null,rtl.length(Result) + 1);
          Result[rtl.length(Result) - 1] = n;
        };
      };
      return Result;
    };
  });
  this.$rtti.$MethodVar("TTMSFNCCheckedListBoxItemCheckChanged",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AItem",this.$rtti["TTMSFNCCheckedListBoxItem"]]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCCustomCheckedListBox",pas["WEBLib.TMSFNCListBox"].TTMSFNCListBox,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCListBox"].TTMSFNCListBox.$init.call(this);
      this.FOnItemCheckChanged = null;
    };
    this.$final = function () {
      this.FOnItemCheckChanged = undefined;
      pas["WEBLib.TMSFNCListBox"].TTMSFNCListBox.$final.call(this);
    };
    this.GetCheckedItem = function (AItem) {
      var Result = false;
      Result = false;
      if (AItem != null) Result = AItem.FChecked;
      return Result;
    };
    this.SetCheckedItem = function (AItem, Value) {
      if (AItem != null) AItem.SetChecked(Value);
    };
    this.GetChecked = function (AItemIndex) {
      var Result = false;
      Result = false;
      if ((AItemIndex >= 0) && (AItemIndex <= (this.FItems.GetCount() - 1))) Result = rtl.as(this.FItems.GetItem$1(AItemIndex),$mod.TTMSFNCCheckedListBoxItem).FChecked;
      return Result;
    };
    this.SetChecked = function (AItemIndex, Value) {
      if ((AItemIndex >= 0) && (AItemIndex <= (this.FItems.GetCount() - 1))) rtl.as(this.FItems.GetItem$1(AItemIndex),$mod.TTMSFNCCheckedListBoxItem).SetChecked(Value);
    };
    this.Loaded = function () {
      pas["WEBLib.TMSFNCListBox"].TTMSFNCCustomListBox.Loaded.call(this);
      window.setTimeout(rtl.createSafeCallback(this,"UpdateItems"),100);
    };
    this.CreateItems = function () {
      var Result = null;
      Result = $mod.TTMSFNCCheckedListBoxItems.$create("Create$3",[this]);
      return Result;
    };
    this.GetVersion = function () {
      var Result = "";
      Result = this.$class.GetVersionNumber(1,0,0,2);
      return Result;
    };
    this.DoItemCheckChanged = function (Sender, AItem) {
      if (this.FOnItemCheckChanged != null) this.FOnItemCheckChanged(this,AItem);
    };
    this.CustomizeTreeView = function (ATreeView) {
      pas["WEBLib.TMSFNCListBox"].TTMSFNCCustomListBox.CustomizeTreeView.apply(this,arguments);
      ATreeView.FOnIsNodeChecked = rtl.createCallback(this,"DoIsNodeChecked");
      ATreeView.FOnGetNodeCheckType = rtl.createCallback(this,"DoGetNodeCheckType");
      ATreeView.FOnAfterUnCheckNode = rtl.createCallback(this,"DoAfterUnCheckNode");
      ATreeView.FOnAfterCheckNode = rtl.createCallback(this,"DoAfterCheckNode");
    };
    this.DoIsNodeChecked = function (Sender, ANode, AColumn, AIsChecked) {
      if ((ANode.FRow >= 0) && (ANode.FRow <= (this.FItems.GetCount() - 1))) AIsChecked.set(rtl.as(this.FItems.GetItem$1(ANode.FRow),$mod.TTMSFNCCheckedListBoxItem).FChecked);
    };
    this.DoGetNodeCheckType = function (Sender, ANode, AColumn, ACheckType) {
      ACheckType.set(pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeCheckType.tvntCheckBox);
    };
    this.DoAfterCheckNode = function (Sender, ANode, AColumn) {
      var it = null;
      if ((ANode.FRow >= 0) && (ANode.FRow <= (this.FItems.GetCount() - 1))) {
        it = rtl.as(this.FItems.GetItem$1(ANode.FRow),$mod.TTMSFNCCheckedListBoxItem);
        it.SetChecked(true);
        this.DoItemCheckChanged(this,it);
      };
    };
    this.DoAfterUnCheckNode = function (Sender, ANode, AColumn) {
      var it = null;
      if ((ANode.FRow >= 0) && (ANode.FRow <= (this.FItems.GetCount() - 1))) {
        it = rtl.as(this.FItems.GetItem$1(ANode.FRow),$mod.TTMSFNCCheckedListBoxItem);
        it.SetChecked(false);
        this.DoItemCheckChanged(this,it);
      };
    };
    this.CheckedItems = function () {
      var Result = [];
      Result = this.FItems.CheckedItems();
      return Result;
    };
    this.AddItem$1 = function (AText) {
      var Result = null;
      Result = pas["WEBLib.TMSFNCListBox"].TTMSFNCCustomListBox.AddItem.call(this,AText);
      return Result;
    };
    this.CheckAll = function () {
      var I = 0;
      this.BeginUpdate();
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.SetChecked(I,true);
      };
      this.EndUpdate();
    };
    this.UncheckAll = function () {
      var I = 0;
      this.BeginUpdate();
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.SetChecked(I,false);
      };
      this.EndUpdate();
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCStylesManager);
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCControlPicker"].ITMSFNCControlPickerFull);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphicsTypes"].ITMSFNCAppearanceGlobalFont);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCCheckedListBox",this.TTMSFNCCustomCheckedListBox,function () {
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCStylesManager);
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCControlPicker"].ITMSFNCControlPickerFull);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphicsTypes"].ITMSFNCAppearanceGlobalFont);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("OnItemCheckChanged",0,$mod.$rtti["TTMSFNCCheckedListBoxItemCheckChanged"],"FOnItemCheckChanged","FOnItemCheckChanged");
    $r.addProperty("OnAfterDrawItemCheck",0,pas["WEBLib.TMSFNCListBox"].$rtti["TTMSFNCListBoxAfterDrawItemCheckEvent"],"FOnAfterDrawItemCheck","FOnAfterDrawItemCheck");
    $r.addProperty("OnBeforeDrawItemCheck",0,pas["WEBLib.TMSFNCListBox"].$rtti["TTMSFNCListBoxBeforeDrawItemCheckEvent"],"FOnBeforeDrawItemCheck","FOnBeforeDrawItemCheck");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
},["WEBLib.TMSFNCUtils","Web"]);
rtl.module("WEBLib.TMSFNCFindDialog",["System","Classes","WEBLib.TMSFNCCustomDialog","WEBLib.TMSFNCTypes","WEBLib.StdCtrls","WEBLib.ExtCtrls"],function () {
  "use strict";
  var $mod = this;
  this.TTMSFNCFindDialogOption = {"0": "fdoCaseSensitive", fdoCaseSensitive: 0, "1": "fdoExpression", fdoExpression: 1, "2": "fdoCloseIfFound", fdoCloseIfFound: 2, "3": "fdoWholeWordOnly", fdoWholeWordOnly: 3, "4": "fdoWrapAtEndOfFile", fdoWrapAtEndOfFile: 4, "5": "fdoContinueToNextFile", fdoContinueToNextFile: 5, "6": "fdoMoreEnabled", fdoMoreEnabled: 6, "7": "fdoSetMarkerEnabled", fdoSetMarkerEnabled: 7, "8": "fdoNextEnabled", fdoNextEnabled: 8, "9": "fdoFindEnabled", fdoFindEnabled: 9, "10": "fdoCloseEnabled", fdoCloseEnabled: 10, "11": "fdoMoreExpanded", fdoMoreExpanded: 11, "12": "fdoDown", fdoDown: 12, "13": "fdoSelection", fdoSelection: 13};
  this.$rtti.$Enum("TTMSFNCFindDialogOption",{minvalue: 0, maxvalue: 13, ordtype: 1, enumtype: this.TTMSFNCFindDialogOption});
  this.TTMSFNCFindDialogVisibleOption = {"0": "fdovCaseSensitive", fdovCaseSensitive: 0, "1": "fdovExpression", fdovExpression: 1, "2": "fdovCloseIfFound", fdovCloseIfFound: 2, "3": "fdovWholeWordOnly", fdovWholeWordOnly: 3, "4": "fdovWrapAtEndOfFile", fdovWrapAtEndOfFile: 4, "5": "fdovContinueToNextFile", fdovContinueToNextFile: 5, "6": "fdovMore", fdovMore: 6, "7": "fdovSetMarker", fdovSetMarker: 7, "8": "fdovNext", fdovNext: 8, "9": "fdovFind", fdovFind: 9, "10": "fdovClose", fdovClose: 10, "11": "fdovFindCombo", fdovFindCombo: 11, "12": "fdovFindMemo", fdovFindMemo: 12, "13": "fdovDirection", fdovDirection: 13, "14": "fdovSelection", fdovSelection: 14};
  this.$rtti.$Enum("TTMSFNCFindDialogVisibleOption",{minvalue: 0, maxvalue: 14, ordtype: 1, enumtype: this.TTMSFNCFindDialogVisibleOption});
  this.$rtti.$Set("TTMSFNCFindDialogOptions",{comptype: this.$rtti["TTMSFNCFindDialogOption"]});
  this.$rtti.$Set("TTMSFNCFindDialogVisibleOptions",{comptype: this.$rtti["TTMSFNCFindDialogVisibleOption"]});
  this.DefaultFindOptions = rtl.createSet(this.TTMSFNCFindDialogOption.fdoMoreEnabled,this.TTMSFNCFindDialogOption.fdoNextEnabled,this.TTMSFNCFindDialogOption.fdoSetMarkerEnabled,this.TTMSFNCFindDialogOption.fdoFindEnabled,this.TTMSFNCFindDialogOption.fdoCloseEnabled,this.TTMSFNCFindDialogOption.fdoDown);
  this.DefaultVisibleOptions = rtl.createSet(this.TTMSFNCFindDialogVisibleOption.fdovCaseSensitive,this.TTMSFNCFindDialogVisibleOption.fdovExpression,this.TTMSFNCFindDialogVisibleOption.fdovCloseIfFound,this.TTMSFNCFindDialogVisibleOption.fdovWholeWordOnly,this.TTMSFNCFindDialogVisibleOption.fdovWrapAtEndOfFile,this.TTMSFNCFindDialogVisibleOption.fdovNext,this.TTMSFNCFindDialogVisibleOption.fdovFind,this.TTMSFNCFindDialogVisibleOption.fdovClose,this.TTMSFNCFindDialogVisibleOption.fdovFindCombo,this.TTMSFNCFindDialogVisibleOption.fdovFindMemo,this.TTMSFNCFindDialogVisibleOption.fdovDirection);
  rtl.createClass(this,"TTMSFNCFindDialogComboBox",pas["WEBLib.StdCtrls"].TComboBox,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCFindDialogUILanguage",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FFindWhat = "";
      this.FCloseIfFound = "";
      this.FLess = "";
      this.FCaseSensitive = "";
      this.FSelection = "";
      this.FWrapAtEndOfFile = "";
      this.FDirection = "";
      this.FSetMarker = "";
      this.FMore = "";
      this.FDown = "";
      this.FCaption = "";
      this.FNext = "";
      this.FWholeWordOnly = "";
      this.FExpression = "";
      this.FUp = "";
      this.FClose = "";
      this.FFind = "";
      this.FContinueToNextFile = "";
      this.FOnChanged = null;
    };
    this.$final = function () {
      this.FOnChanged = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.IsCaptionStored = function () {
      var Result = false;
      Result = this.FCaption !== "Find";
      return Result;
    };
    this.IsCaseSensitiveStored = function () {
      var Result = false;
      Result = this.FCaseSensitive !== "Case sensitive";
      return Result;
    };
    this.IsCloseIfFoundStored = function () {
      var Result = false;
      Result = this.FCloseIfFound !== "Close if found";
      return Result;
    };
    this.IsCloseStored = function () {
      var Result = false;
      Result = this.FClose !== "Close";
      return Result;
    };
    this.IsContinueToNextFileStored = function () {
      var Result = false;
      Result = this.FContinueToNextFile !== "Continue to next file";
      return Result;
    };
    this.IsDirectionStored = function () {
      var Result = false;
      Result = this.FDirection !== "Direction";
      return Result;
    };
    this.IsDownStored = function () {
      var Result = false;
      Result = this.FDown !== "Down";
      return Result;
    };
    this.IsExpressionStored = function () {
      var Result = false;
      Result = this.FExpression !== "Expression";
      return Result;
    };
    this.IsFindStored = function () {
      var Result = false;
      Result = this.FFind !== "Find";
      return Result;
    };
    this.IsFindWhatStored = function () {
      var Result = false;
      Result = this.FFindWhat !== "Find what:";
      return Result;
    };
    this.IsLessStored = function () {
      var Result = false;
      Result = this.FLess !== "Less";
      return Result;
    };
    this.IsMoreStored = function () {
      var Result = false;
      Result = this.FMore !== "More";
      return Result;
    };
    this.IsNextStored = function () {
      var Result = false;
      Result = this.FNext !== "Next";
      return Result;
    };
    this.IsSelectionStored = function () {
      var Result = false;
      Result = this.FSelection !== "Selection";
      return Result;
    };
    this.IsSetMarkerStored = function () {
      var Result = false;
      Result = this.FSetMarker !== "Set marker";
      return Result;
    };
    this.IsUpStored = function () {
      var Result = false;
      Result = this.FUp !== "Up";
      return Result;
    };
    this.IsWholeWordOnlyStored = function () {
      var Result = false;
      Result = this.FWholeWordOnly !== "Whole word only";
      return Result;
    };
    this.IsWrapAtEndOfFileStored = function () {
      var Result = false;
      Result = this.FWrapAtEndOfFile !== "Wrap at end of file";
      return Result;
    };
    this.SetCaption = function (Value) {
      if (this.FCaption !== Value) {
        this.FCaption = Value;
        this.Changed();
      };
    };
    this.Changed = function () {
      if (this.FOnChanged != null) this.FOnChanged(this);
    };
    this.Create$1 = function () {
      this.FCaseSensitive = "Case sensitive";
      this.FClose = "Close";
      this.FCloseIfFound = "Close if found";
      this.FContinueToNextFile = "Continue to next file";
      this.FDirection = "Direction";
      this.FDown = "Down";
      this.FExpression = "Expression";
      this.FFind = "Find";
      this.FCaption = "Find";
      this.FFindWhat = "Find what:";
      this.FLess = "Less";
      this.FMore = "More";
      this.FNext = "Next";
      this.FSelection = "Selection";
      this.FSetMarker = "Set marker";
      this.FUp = "Up";
      this.FWholeWordOnly = "Whole word only";
      this.FWrapAtEndOfFile = "Wrap at end of file";
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCFindDialogUILanguage.isPrototypeOf(Source)) {
        this.FCaseSensitive = rtl.as(Source,$mod.TTMSFNCFindDialogUILanguage).FCaseSensitive;
        this.FClose = rtl.as(Source,$mod.TTMSFNCFindDialogUILanguage).FClose;
        this.FCloseIfFound = rtl.as(Source,$mod.TTMSFNCFindDialogUILanguage).FCloseIfFound;
        this.FContinueToNextFile = rtl.as(Source,$mod.TTMSFNCFindDialogUILanguage).FContinueToNextFile;
        this.FDirection = rtl.as(Source,$mod.TTMSFNCFindDialogUILanguage).FDirection;
        this.FDown = rtl.as(Source,$mod.TTMSFNCFindDialogUILanguage).FDown;
        this.FExpression = rtl.as(Source,$mod.TTMSFNCFindDialogUILanguage).FExpression;
        this.FFind = rtl.as(Source,$mod.TTMSFNCFindDialogUILanguage).FFind;
        this.FCaption = rtl.as(Source,$mod.TTMSFNCFindDialogUILanguage).FCaption;
        this.FFindWhat = rtl.as(Source,$mod.TTMSFNCFindDialogUILanguage).FFindWhat;
        this.FLess = rtl.as(Source,$mod.TTMSFNCFindDialogUILanguage).FLess;
        this.FMore = rtl.as(Source,$mod.TTMSFNCFindDialogUILanguage).FMore;
        this.FNext = rtl.as(Source,$mod.TTMSFNCFindDialogUILanguage).FNext;
        this.FSelection = rtl.as(Source,$mod.TTMSFNCFindDialogUILanguage).FSelection;
        this.FSetMarker = rtl.as(Source,$mod.TTMSFNCFindDialogUILanguage).FSetMarker;
        this.FUp = rtl.as(Source,$mod.TTMSFNCFindDialogUILanguage).FUp;
        this.FWholeWordOnly = rtl.as(Source,$mod.TTMSFNCFindDialogUILanguage).FWholeWordOnly;
        this.FWrapAtEndOfFile = rtl.as(Source,$mod.TTMSFNCFindDialogUILanguage).FWrapAtEndOfFile;
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    var $r = this.$rtti;
    $r.addProperty("CaseSensitive",12,rtl.string,"FCaseSensitive","FCaseSensitive",4,{stored: "IsCaseSensitiveStored"});
    $r.addProperty("Close",12,rtl.string,"FClose","FClose",4,{stored: "IsCloseStored"});
    $r.addProperty("CloseIfFound",12,rtl.string,"FCloseIfFound","FCloseIfFound",4,{stored: "IsCloseIfFoundStored"});
    $r.addProperty("ContinueToNextFile",12,rtl.string,"FContinueToNextFile","FContinueToNextFile",4,{stored: "IsContinueToNextFileStored"});
    $r.addProperty("Direction",12,rtl.string,"FDirection","FDirection",4,{stored: "IsDirectionStored"});
    $r.addProperty("Down",12,rtl.string,"FDown","FDown",4,{stored: "IsDownStored"});
    $r.addProperty("Expression",12,rtl.string,"FExpression","FExpression",4,{stored: "IsExpressionStored"});
    $r.addProperty("Find",12,rtl.string,"FFind","FFind",4,{stored: "IsFindStored"});
    $r.addProperty("Caption",14,rtl.string,"FCaption","SetCaption",4,{stored: "IsCaptionStored"});
    $r.addProperty("FindWhat",12,rtl.string,"FFindWhat","FFindWhat",4,{stored: "IsFindWhatStored"});
    $r.addProperty("Less",12,rtl.string,"FLess","FLess",4,{stored: "IsLessStored"});
    $r.addProperty("More",12,rtl.string,"FMore","FMore",4,{stored: "IsMoreStored"});
    $r.addProperty("Next",12,rtl.string,"FNext","FNext",4,{stored: "IsNextStored"});
    $r.addProperty("Selection",12,rtl.string,"FSelection","FSelection",4,{stored: "IsSelectionStored"});
    $r.addProperty("SetMarker",12,rtl.string,"FSetMarker","FSetMarker",4,{stored: "IsSetMarkerStored"});
    $r.addProperty("Up",12,rtl.string,"FUp","FUp",4,{stored: "IsUpStored"});
    $r.addProperty("WholeWordOnly",12,rtl.string,"FWholeWordOnly","FWholeWordOnly",4,{stored: "IsWholeWordOnlyStored"});
    $r.addProperty("WrapAtEndOfFile",12,rtl.string,"FWrapAtEndOfFile","FWrapAtEndOfFile",4,{stored: "IsWrapAtEndOfFileStored"});
  });
  rtl.createInterface(this,"ITMSFNCFind","{02B8E1DA-978E-49B0-BC84-EF2ACCB47FCF}",["FindValue","FindNextValue","FindEditChange","SetMarker"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("FindValue",0,[["AText",rtl.string],["AFound",rtl.boolean,1]]);
    $r.addMethod("FindNextValue",0,[["AText",rtl.string],["AFound",rtl.boolean,1]]);
    $r.addMethod("FindEditChange",0,[["APrevText",rtl.string],["ANewText",rtl.string]]);
    $r.addMethod("SetMarker",0,[]);
  });
  this.$rtti.$MethodVar("TTMSFNCFindDialogFindEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFindText",rtl.string],["AFound",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCFindDialogFindEditChangeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["APrevText",rtl.string],["ANewText",rtl.string]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCCustomFindDialog",pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog.$init.call(this);
      this.FDialogOpenedHeight = 0;
      this.FDialogClosedHeight = 0;
      this.FComboBoxFind = null;
      this.FButtonFind = null;
      this.FButtonClose = null;
      this.FButtonNext = null;
      this.FButtonMore = null;
      this.FButtonMarker = null;
      this.FLabelFind = null;
      this.FLabelFindMore = null;
      this.FMemoFind = null;
      this.FCheckBoxCase = null;
      this.FCheckBoxWholeOnly = null;
      this.FCheckBoxExpression = null;
      this.FCheckBoxEOF = null;
      this.FCheckBoxClose = null;
      this.FCheckBoxContinue = null;
      this.FCheckBoxSelection = null;
      this.FDirGroup = null;
      this.FRadioDown = null;
      this.FRadioUp = null;
      this.FOnFind = null;
      this.FOnFindNext = null;
      this.FOnFindEditChange = null;
      this.FOnSetMarker = null;
      this.FOptions = {};
      this.FVisibleOptions = {};
      this.FMore = false;
      this.FUILanguage = null;
      this.FAutoHistory = false;
      this.FFindText = "";
      this.FFindList = null;
    };
    this.$final = function () {
      this.FComboBoxFind = undefined;
      this.FButtonFind = undefined;
      this.FButtonClose = undefined;
      this.FButtonNext = undefined;
      this.FButtonMore = undefined;
      this.FButtonMarker = undefined;
      this.FLabelFind = undefined;
      this.FLabelFindMore = undefined;
      this.FMemoFind = undefined;
      this.FCheckBoxCase = undefined;
      this.FCheckBoxWholeOnly = undefined;
      this.FCheckBoxExpression = undefined;
      this.FCheckBoxEOF = undefined;
      this.FCheckBoxClose = undefined;
      this.FCheckBoxContinue = undefined;
      this.FCheckBoxSelection = undefined;
      this.FDirGroup = undefined;
      this.FRadioDown = undefined;
      this.FRadioUp = undefined;
      this.FOnFind = undefined;
      this.FOnFindNext = undefined;
      this.FOnFindEditChange = undefined;
      this.FOnSetMarker = undefined;
      this.FOptions = undefined;
      this.FVisibleOptions = undefined;
      this.FUILanguage = undefined;
      this.FFindList = undefined;
      pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog.$final.call(this);
    };
    this.SetUILanguage = function (Value) {
      this.FUILanguage.Assign(Value);
    };
    this.GetInstance = function () {
      var Result = 0;
      Result = pas["WEBLib.TMSFNCTypes"].HInstance();
      return Result;
    };
    this.ButtonFindClick = function (Sender) {
      this.DoFindText(this.FFindText);
    };
    this.ButtonNextClick = function (Sender) {
      this.DoFindNextText(this.FFindText);
    };
    this.ButtonMoreClick = function (Sender) {
      if (!this.FMore) {
        this.UpdateMoreButton(this.FUILanguage.FLess);
        this.FOptions = rtl.unionSet(this.FOptions,rtl.createSet($mod.TTMSFNCFindDialogOption.fdoMoreExpanded));
        this.SetDialogHeight(this.FDialogOpenedHeight);
      } else {
        this.UpdateMoreButton(this.FUILanguage.FMore);
        this.FOptions = rtl.diffSet(this.FOptions,rtl.createSet($mod.TTMSFNCFindDialogOption.fdoMoreExpanded));
        this.SetDialogHeight(this.FDialogClosedHeight);
      };
      this.FLabelFindMore.SetVisible(!this.FMore);
      this.FMemoFind.SetVisible(!this.FMore);
      this.FLabelFind.SetEnabled(this.FMore);
      this.FComboBoxFind.SetEnabled(this.FMore);
      this.FMore = !this.FMore;
    };
    this.ButtonMarkerClick = function (Sender) {
      this.DoSetMarkerEvent();
    };
    this.ButtonCloseClick = function (Sender) {
      if (this.FFrm != null) this.FFrm.Close();
    };
    this.CheckBoxCaseClick = function (Sender) {
      if (this.FCheckBoxCase.GetChecked()) {
        this.FOptions = rtl.unionSet(this.FOptions,rtl.createSet($mod.TTMSFNCFindDialogOption.fdoCaseSensitive))}
       else this.FOptions = rtl.diffSet(this.FOptions,rtl.createSet($mod.TTMSFNCFindDialogOption.fdoCaseSensitive));
    };
    this.CheckBoxWholeOnlyClick = function (Sender) {
      if (this.FCheckBoxWholeOnly.GetChecked()) {
        this.FOptions = rtl.unionSet(this.FOptions,rtl.createSet($mod.TTMSFNCFindDialogOption.fdoWholeWordOnly))}
       else this.FOptions = rtl.diffSet(this.FOptions,rtl.createSet($mod.TTMSFNCFindDialogOption.fdoWholeWordOnly));
    };
    this.CheckBoxExpressionClick = function (Sender) {
      if (this.FCheckBoxExpression.GetChecked()) {
        this.FOptions = rtl.unionSet(this.FOptions,rtl.createSet($mod.TTMSFNCFindDialogOption.fdoExpression))}
       else this.FOptions = rtl.diffSet(this.FOptions,rtl.createSet($mod.TTMSFNCFindDialogOption.fdoExpression));
    };
    this.CheckBoxEOFClick = function (Sender) {
      if (this.FCheckBoxEOF.GetChecked()) {
        this.FOptions = rtl.unionSet(this.FOptions,rtl.createSet($mod.TTMSFNCFindDialogOption.fdoWrapAtEndOfFile))}
       else this.FOptions = rtl.diffSet(this.FOptions,rtl.createSet($mod.TTMSFNCFindDialogOption.fdoWrapAtEndOfFile));
    };
    this.CheckBoxCloseClick = function (Sender) {
      if (this.FCheckBoxClose.GetChecked()) {
        this.FOptions = rtl.unionSet(this.FOptions,rtl.createSet($mod.TTMSFNCFindDialogOption.fdoCloseIfFound))}
       else this.FOptions = rtl.diffSet(this.FOptions,rtl.createSet($mod.TTMSFNCFindDialogOption.fdoCloseIfFound));
    };
    this.CheckBoxContinueClick = function (Sender) {
      if (this.FCheckBoxContinue.GetChecked()) {
        this.FOptions = rtl.unionSet(this.FOptions,rtl.createSet($mod.TTMSFNCFindDialogOption.fdoContinueToNextFile))}
       else this.FOptions = rtl.diffSet(this.FOptions,rtl.createSet($mod.TTMSFNCFindDialogOption.fdoContinueToNextFile));
    };
    this.CheckBoxSelectionClick = function (Sender) {
      if (this.FCheckBoxSelection.GetChecked()) {
        this.FOptions = rtl.unionSet(this.FOptions,rtl.createSet($mod.TTMSFNCFindDialogOption.fdoSelection))}
       else this.FOptions = rtl.diffSet(this.FOptions,rtl.createSet($mod.TTMSFNCFindDialogOption.fdoSelection));
    };
    this.RadioClick = function (Sender) {
      if (this.FRadioDown.GetChecked()) {
        this.FOptions = rtl.unionSet(this.FOptions,rtl.createSet($mod.TTMSFNCFindDialogOption.fdoDown))}
       else this.FOptions = rtl.diffSet(this.FOptions,rtl.createSet($mod.TTMSFNCFindDialogOption.fdoDown));
    };
    this.ComboBoxFindChange = function (Sender) {
      var s = "";
      s = this.FComboBoxFind.GetText();
      this.DoFindEditChangeEvent(this.FFindText,s);
      this.FFindText = s;
      this.EnableButtons();
    };
    this.ComboBoxKeyDown = function (Sender, Key, Shift) {
      if (Key.get() === 13) this.DoFindText(this.FFindText);
    };
    this.MemoFindChange = function (Sender) {
      var s = "";
      var i = 0;
      s = "";
      for (var $l = 0, $end = this.FMemoFind.FLines.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (i > 0) {
          s = s + "\r\n" + this.FMemoFind.FLines.Get(i)}
         else s = this.FMemoFind.FLines.Get(i);
      };
      this.DoFindEditChangeEvent(this.FFindText,s);
      this.FFindText = s;
      this.EnableButtons();
    };
    this.UILanguageChanged = function (Sender) {
      this.SetCaption(this.FUILanguage.FCaption);
    };
    this.UpdateMoreButton = function (AValue) {
      if (this.FButtonMore != null) {
        this.FButtonMore.SetCaption(AValue);
      };
    };
    this.EnableButtons = function () {
      if ($mod.TTMSFNCFindDialogVisibleOption.fdovFind in this.FVisibleOptions) this.FButtonFind.SetEnabled((this.FFindText !== "") && ($mod.TTMSFNCFindDialogOption.fdoFindEnabled in this.FOptions));
      if ($mod.TTMSFNCFindDialogVisibleOption.fdovNext in this.FVisibleOptions) this.FButtonNext.SetEnabled((this.FFindText !== "") && ($mod.TTMSFNCFindDialogOption.fdoNextEnabled in this.FOptions));
      if ($mod.TTMSFNCFindDialogVisibleOption.fdovSetMarker in this.FVisibleOptions) this.FButtonMarker.SetEnabled((this.FFindText !== "") && ($mod.TTMSFNCFindDialogOption.fdoSetMarkerEnabled in this.FOptions));
    };
    this.DoFindText = function (AText) {
      var f = null;
      var b = false;
      var $ir = rtl.createIntfRefs();
      try {
        if (this.FAutoHistory && (AText !== "")) {
          if (this.FFindList.IndexOf(AText) === -1) this.FFindList.Add(AText);
          if ($mod.TTMSFNCFindDialogVisibleOption.fdovFindCombo in this.FVisibleOptions) {
            this.FComboBoxFind.FItems.Assign(this.FFindList);
            this.FComboBoxFind.SetText(AText);
          };
        };
        b = false;
        if (pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCFind),{get: function () {
            return f;
          }, set: function (v) {
            f = v;
          }})) f.FindValue(AText,{get: function () {
            return b;
          }, set: function (v) {
            b = v;
          }});
        this.DoFind(AText,{get: function () {
            return b;
          }, set: function (v) {
            b = v;
          }});
        if ((this.FFrm != null) && (this.FCheckBoxClose != null) && this.FCheckBoxClose.GetChecked() && b) this.FFrm.Close();
      } finally {
        $ir.free();
        rtl._Release(f);
      };
    };
    this.DoFindNextText = function (AText) {
      var f = null;
      var b = false;
      var $ir = rtl.createIntfRefs();
      try {
        if (this.FAutoHistory && (AText !== "")) {
          if (this.FFindList.IndexOf(AText) === -1) this.FFindList.Add(AText);
          if ($mod.TTMSFNCFindDialogVisibleOption.fdovFindCombo in this.FVisibleOptions) {
            this.FComboBoxFind.FItems.Assign(this.FFindList);
            this.FComboBoxFind.SetText(AText);
          };
        };
        b = false;
        if (pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCFind),{get: function () {
            return f;
          }, set: function (v) {
            f = v;
          }})) f.FindNextValue(AText,{get: function () {
            return b;
          }, set: function (v) {
            b = v;
          }});
        this.DoFindNext(AText,{get: function () {
            return b;
          }, set: function (v) {
            b = v;
          }});
        if ((this.FFrm != null) && (this.FCheckBoxClose != null) && this.FCheckBoxClose.GetChecked() && b) this.FFrm.Close();
      } finally {
        $ir.free();
        rtl._Release(f);
      };
    };
    this.DoFindEditChangeEvent = function (APrevText, ANewText) {
      var f = null;
      var $ir = rtl.createIntfRefs();
      try {
        if (pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCFind),{get: function () {
            return f;
          }, set: function (v) {
            f = v;
          }})) f.FindEditChange(APrevText,ANewText);
        this.DoFindEditChange(APrevText,ANewText);
      } finally {
        $ir.free();
        rtl._Release(f);
      };
    };
    this.DoSetMarkerEvent = function () {
      var f = null;
      var $ir = rtl.createIntfRefs();
      try {
        if (pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCFind),{get: function () {
            return f;
          }, set: function (v) {
            f = v;
          }})) f.SetMarker();
        this.DoSetMarker();
      } finally {
        $ir.free();
        rtl._Release(f);
      };
    };
    this.DoFind = function (AText, AFound) {
      if (this.FOnFind != null) this.FOnFind(this,AText,AFound);
    };
    this.DoFindNext = function (AText, AFound) {
      if (this.FOnFind != null) this.FOnFindNext(this,AText,AFound);
    };
    this.DoFindEditChange = function (APrevText, ANewText) {
      if (this.FOnFindEditChange != null) this.FOnFindEditChange(this,APrevText,ANewText);
    };
    this.DoSetMarker = function () {
      if (this.FOnSetMarker != null) this.FOnSetMarker(this);
    };
    this.DoClose = function () {
      if (this.FAutoHistory && (this.FFindText !== "")) {
        if (this.FFindList.IndexOf(this.FFindText) === -1) this.FFindList.Add(this.FFindText);
      };
      pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog.DoClose.call(this);
    };
    this.DoFormShow = function (Sender) {
      pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog.DoFormShow.apply(this,arguments);
      if ((this.FComboBoxFind != null) && this.FComboBoxFind.FVisible) this.FComboBoxFind.SetFocus();
      if ((this.FMemoFind != null) && this.FMemoFind.FVisible) this.FMemoFind.SetFocus();
    };
    this.BuildDialog = function (AParent) {
      var $Self = this;
      function InitCheckBox(AParentControl, ACaption, AChecked, ALeft, ATop, ACount) {
        var Result = null;
        ACount.set(ACount.get() + 1);
        Result = pas["WEBLib.StdCtrls"].TCheckBox.$create("Create$1",[AParentControl]);
        Result.SetParent(AParentControl);
        Result.SetWidth(140);
        Result.SetChecked(AChecked);
        Result.SetLeft(ALeft.get());
        Result.SetTop(ATop.get());
        Result.SetCaption(ACaption);
        if (ALeft.get() !== 16) {
          ALeft.set(16)}
         else ALeft.set(160);
        if ((ACount.get() % 2) === 0) ATop.set(ATop.get() + Math.round(Result.GetHeight()) + 6);
        return Result;
      };
      function InitButton(AParentControl, ACaption, ALeft, ATop) {
        var Result = null;
        Result = pas["WEBLib.StdCtrls"].TButton.$create("Create$1",[AParentControl]);
        Result.SetParent(AParentControl);
        Result.SetWidth(80);
        Result.SetHeight(22);
        Result.SetLeft(ALeft);
        Result.SetTop(ATop.get());
        Result.SetCaption(ACaption);
        ATop.set(ATop.get() + Math.round(Result.GetHeight()) + 3);
        return Result;
      };
      var tc = 0;
      var lc = 0;
      var cc = 0;
      var btm = 0;
      var tb = 0;
      var s = "";
      pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog.BuildDialog.apply(this,arguments);
      tb = 13;
      tc = 16;
      lc = 16;
      cc = 0;
      this.FLabelFind = pas["WEBLib.StdCtrls"].TLabel.$create("Create$1",[AParent]);
      this.FLabelFind.SetParent(AParent);
      this.FLabelFind.SetEnabled(!($mod.TTMSFNCFindDialogOption.fdoMoreExpanded in this.FOptions));
      this.FLabelFind.SetLeft(16);
      this.FLabelFind.SetTop(tc);
      this.FLabelFind.SetCaption(this.FUILanguage.FFindWhat);
      if ($mod.TTMSFNCFindDialogVisibleOption.fdovFindCombo in this.FVisibleOptions) {
        this.FComboBoxFind = $mod.TTMSFNCFindDialogComboBox.$create("Create$1",[AParent]);
        this.FComboBoxFind.SetParent(AParent);
        this.FComboBoxFind.SetEnabled(!($mod.TTMSFNCFindDialogOption.fdoMoreExpanded in this.FOptions));
        this.FComboBoxFind.SetTabOrder(0);
        this.FComboBoxFind.FItems.Assign(this.FFindList);
        this.FComboBoxFind.SetText(this.FFindText);
        this.FComboBoxFind.SetWidth(250);
        this.FComboBoxFind.FOnChange = rtl.createCallback($Self,"ComboBoxFindChange");
        this.FComboBoxFind.FOnKeyDown = rtl.createCallback($Self,"ComboBoxKeyDown");
        this.FComboBoxFind.SetLeft(85);
        this.FComboBoxFind.SetTop(tc - 3);
        this.FComboBoxFind.SetStyle(pas["WEBLib.StdCtrls"].TComboBoxStyle.csDropDown);
        tc = tc + Math.round(this.FComboBoxFind.GetHeight()) + 7;
      };
      if ($mod.TTMSFNCFindDialogVisibleOption.fdovCaseSensitive in this.FVisibleOptions) {
        this.FCheckBoxCase = InitCheckBox(AParent,this.FUILanguage.FCaseSensitive,$mod.TTMSFNCFindDialogOption.fdoCaseSensitive in this.FOptions,{get: function () {
            return lc;
          }, set: function (v) {
            lc = v;
          }},{get: function () {
            return tc;
          }, set: function (v) {
            tc = v;
          }},{get: function () {
            return cc;
          }, set: function (v) {
            cc = v;
          }});
        this.FCheckBoxCase.FOnClick = rtl.createCallback($Self,"CheckBoxCaseClick");
        this.FCheckBoxCase.SetTabOrder(1);
      };
      if ($mod.TTMSFNCFindDialogVisibleOption.fdovWholeWordOnly in this.FVisibleOptions) {
        this.FCheckBoxWholeOnly = InitCheckBox(AParent,this.FUILanguage.FWholeWordOnly,$mod.TTMSFNCFindDialogOption.fdoWholeWordOnly in this.FOptions,{get: function () {
            return lc;
          }, set: function (v) {
            lc = v;
          }},{get: function () {
            return tc;
          }, set: function (v) {
            tc = v;
          }},{get: function () {
            return cc;
          }, set: function (v) {
            cc = v;
          }});
        this.FCheckBoxWholeOnly.FOnClick = rtl.createCallback($Self,"CheckBoxWholeOnlyClick");
        this.FCheckBoxWholeOnly.SetTabOrder(2);
      };
      if ($mod.TTMSFNCFindDialogVisibleOption.fdovExpression in this.FVisibleOptions) {
        this.FCheckBoxExpression = InitCheckBox(AParent,this.FUILanguage.FExpression,$mod.TTMSFNCFindDialogOption.fdoExpression in this.FOptions,{get: function () {
            return lc;
          }, set: function (v) {
            lc = v;
          }},{get: function () {
            return tc;
          }, set: function (v) {
            tc = v;
          }},{get: function () {
            return cc;
          }, set: function (v) {
            cc = v;
          }});
        this.FCheckBoxExpression.FOnClick = rtl.createCallback($Self,"CheckBoxExpressionClick");
        this.FCheckBoxExpression.SetTabOrder(3);
      };
      if ($mod.TTMSFNCFindDialogVisibleOption.fdovWrapAtEndOfFile in this.FVisibleOptions) {
        this.FCheckBoxEOF = InitCheckBox(AParent,this.FUILanguage.FWrapAtEndOfFile,$mod.TTMSFNCFindDialogOption.fdoWrapAtEndOfFile in this.FOptions,{get: function () {
            return lc;
          }, set: function (v) {
            lc = v;
          }},{get: function () {
            return tc;
          }, set: function (v) {
            tc = v;
          }},{get: function () {
            return cc;
          }, set: function (v) {
            cc = v;
          }});
        this.FCheckBoxEOF.FOnClick = rtl.createCallback($Self,"CheckBoxEOFClick");
        this.FCheckBoxEOF.SetTabOrder(4);
      };
      if ($mod.TTMSFNCFindDialogVisibleOption.fdovCloseIfFound in this.FVisibleOptions) {
        this.FCheckBoxClose = InitCheckBox(AParent,this.FUILanguage.FCloseIfFound,$mod.TTMSFNCFindDialogOption.fdoCloseIfFound in this.FOptions,{get: function () {
            return lc;
          }, set: function (v) {
            lc = v;
          }},{get: function () {
            return tc;
          }, set: function (v) {
            tc = v;
          }},{get: function () {
            return cc;
          }, set: function (v) {
            cc = v;
          }});
        this.FCheckBoxClose.FOnClick = rtl.createCallback($Self,"CheckBoxCloseClick");
        this.FCheckBoxClose.SetTabOrder(5);
      };
      if ($mod.TTMSFNCFindDialogVisibleOption.fdovContinueToNextFile in this.FVisibleOptions) {
        this.FCheckBoxContinue = InitCheckBox(AParent,this.FUILanguage.FContinueToNextFile,$mod.TTMSFNCFindDialogOption.fdoContinueToNextFile in this.FOptions,{get: function () {
            return lc;
          }, set: function (v) {
            lc = v;
          }},{get: function () {
            return tc;
          }, set: function (v) {
            tc = v;
          }},{get: function () {
            return cc;
          }, set: function (v) {
            cc = v;
          }});
        this.FCheckBoxContinue.FOnClick = rtl.createCallback($Self,"CheckBoxContinueClick");
        this.FCheckBoxContinue.SetTabOrder(6);
      };
      if ($mod.TTMSFNCFindDialogVisibleOption.fdovSelection in this.FVisibleOptions) {
        this.FCheckBoxSelection = InitCheckBox(AParent,this.FUILanguage.FSelection,$mod.TTMSFNCFindDialogOption.fdoSelection in this.FOptions,{get: function () {
            return lc;
          }, set: function (v) {
            lc = v;
          }},{get: function () {
            return tc;
          }, set: function (v) {
            tc = v;
          }},{get: function () {
            return cc;
          }, set: function (v) {
            cc = v;
          }});
        this.FCheckBoxSelection.FOnClick = rtl.createCallback($Self,"CheckBoxSelectionClick");
        this.FCheckBoxSelection.SetTabOrder(7);
      };
      if ($mod.TTMSFNCFindDialogVisibleOption.fdovFind in this.FVisibleOptions) {
        this.FButtonFind = InitButton(AParent,this.FUILanguage.FFind,345,{get: function () {
            return tb;
          }, set: function (v) {
            tb = v;
          }});
        this.FButtonFind.FOnClick = rtl.createCallback($Self,"ButtonFindClick");
        this.FButtonFind.SetTabOrder(8);
      };
      if ($mod.TTMSFNCFindDialogVisibleOption.fdovNext in this.FVisibleOptions) {
        this.FButtonNext = InitButton(AParent,this.FUILanguage.FNext,345,{get: function () {
            return tb;
          }, set: function (v) {
            tb = v;
          }});
        this.FButtonNext.FOnClick = rtl.createCallback($Self,"ButtonNextClick");
        this.FButtonNext.SetTabOrder(9);
      };
      if ($mod.TTMSFNCFindDialogVisibleOption.fdovSetMarker in this.FVisibleOptions) {
        this.FButtonMarker = InitButton(AParent,this.FUILanguage.FSetMarker,345,{get: function () {
            return tb;
          }, set: function (v) {
            tb = v;
          }});
        this.FButtonMarker.FOnClick = rtl.createCallback($Self,"ButtonMarkerClick");
        this.FButtonMarker.SetTabOrder(10);
      };
      if ($mod.TTMSFNCFindDialogVisibleOption.fdovClose in this.FVisibleOptions) {
        this.FButtonClose = InitButton(AParent,this.FUILanguage.FClose,345,{get: function () {
            return tb;
          }, set: function (v) {
            tb = v;
          }});
        this.FButtonClose.FOnClick = rtl.createCallback($Self,"ButtonCloseClick");
        this.FButtonClose.SetTabOrder(11);
      };
      if ((cc % 2) === 1) tc = tc + 26;
      btm = tc;
      if ($mod.TTMSFNCFindDialogVisibleOption.fdovDirection in this.FVisibleOptions) {
        this.FDirGroup = pas["WEBLib.ExtCtrls"].TGroupBox.$create("Create$1",[AParent]);
        this.FDirGroup.SetParent(AParent);
        this.FDirGroup.SetWidth(140);
        this.FDirGroup.SetHeight(45);
        this.FDirGroup.SetCaption(this.FUILanguage.FDirection);
        this.FDirGroup.SetLeft(16);
        this.FDirGroup.SetTop(tc);
        this.FRadioUp = pas["WEBLib.StdCtrls"].TRadioButton.$create("Create$1",[this.FDirGroup]);
        this.FRadioUp.SetParent(this.FDirGroup);
        this.FRadioUp.SetTabOrder(12);
        this.FRadioUp.FOnClick = rtl.createCallback($Self,"RadioClick");
        this.FRadioUp.SetCaption(this.FUILanguage.FUp);
        this.FRadioUp.SetLeft(8);
        this.FRadioUp.SetTop(13);
        if (!($mod.TTMSFNCFindDialogOption.fdoDown in this.FOptions)) this.FRadioUp.SetChecked(true);
        this.FRadioDown = pas["WEBLib.StdCtrls"].TRadioButton.$create("Create$1",[this.FDirGroup]);
        this.FRadioDown.SetParent(this.FDirGroup);
        this.FRadioDown.SetTabOrder(13);
        this.FRadioDown.FOnClick = rtl.createCallback($Self,"RadioClick");
        this.FRadioDown.SetCaption(this.FUILanguage.FDown);
        this.FRadioDown.SetLeft(65);
        this.FRadioDown.SetTop(13);
        if ($mod.TTMSFNCFindDialogOption.fdoDown in this.FOptions) this.FRadioDown.SetChecked(true);
        btm = btm + Math.round(this.FDirGroup.GetHeight());
        tc = tc + Math.round(this.FDirGroup.GetHeight());
      };
      tb = Math.max(tc - 25,tb);
      if ($mod.TTMSFNCFindDialogVisibleOption.fdovMore in this.FVisibleOptions) {
        if ($mod.TTMSFNCFindDialogOption.fdoMoreExpanded in this.FOptions) {
          s = this.FUILanguage.FLess}
         else s = this.FUILanguage.FMore;
        this.FButtonMore = InitButton(AParent,s,345,{get: function () {
            return tb;
          }, set: function (v) {
            tb = v;
          }});
        this.FButtonMore.FOnClick = rtl.createCallback($Self,"ButtonMoreClick");
        this.FButtonMore.SetTabOrder(14);
        btm = Math.max(btm,tb - 3);
      };
      btm = btm + 10;
      this.FDialogClosedHeight = btm;
      this.FDialogOpenedHeight = btm;
      if ($mod.TTMSFNCFindDialogVisibleOption.fdovMore in this.FVisibleOptions) {
        if ($mod.TTMSFNCFindDialogVisibleOption.fdovFindMemo in this.FVisibleOptions) {
          this.FLabelFindMore = pas["WEBLib.StdCtrls"].TLabel.$create("Create$1",[AParent]);
          this.FLabelFindMore.SetParent(AParent);
          this.FLabelFindMore.SetVisible($mod.TTMSFNCFindDialogOption.fdoMoreExpanded in this.FOptions);
          this.FLabelFindMore.SetLeft(16);
          this.FLabelFindMore.SetTop(btm);
          this.FLabelFindMore.SetCaption(this.FUILanguage.FFindWhat);
          this.FMemoFind = pas["WEBLib.StdCtrls"].TMemo.$create("Create$1",[AParent]);
          this.FMemoFind.SetParent(AParent);
          this.FMemoFind.SetVisible($mod.TTMSFNCFindDialogOption.fdoMoreExpanded in this.FOptions);
          this.FMemoFind.SetTabOrder(15);
          this.FMemoFind.SetWidth(410);
          this.FMemoFind.SetHeight(80);
          this.FMemoFind.FOnChange = rtl.createCallback($Self,"MemoFindChange");
          this.FMemoFind.SetLeft(16);
          this.FMemoFind.SetTop(this.FLabelFindMore.GetTop() + this.FLabelFindMore.GetHeight() + 8);
          this.FDialogOpenedHeight = Math.round(this.FMemoFind.GetTop() + this.FMemoFind.GetHeight() + 13);
        };
      };
      if ($mod.TTMSFNCFindDialogOption.fdoMoreExpanded in this.FOptions) {
        this.FMore = true;
        this.SetDialogHeight(this.FDialogOpenedHeight);
      } else {
        this.SetDialogHeight(this.FDialogClosedHeight);
      };
      this.SetCaption(this.FUILanguage.FCaption);
      this.EnableButtons();
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog.Create$1.apply(this,arguments);
      this.FDialogOpenedHeight = 0;
      this.FDialogClosedHeight = 0;
      this.FOptions = rtl.refSet($mod.DefaultFindOptions);
      this.FVisibleOptions = rtl.refSet($mod.DefaultVisibleOptions);
      this.FMore = false;
      this.FAutoHistory = true;
      this.FFindText = "";
      this.FUILanguage = $mod.TTMSFNCFindDialogUILanguage.$create("Create$1");
      this.FUILanguage.FOnChanged = rtl.createCallback(this,"UILanguageChanged");
      this.FFindList = pas.Classes.TStringList.$create("Create$1");
      this.SetCaption(this.FUILanguage.FCaption);
      this.FAllowReturnKeyClose = false;
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FFindList");
      rtl.free(this,"FUILanguage");
      pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog.Destroy.call(this);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCFindDialog",this.TTMSFNCCustomFindDialog,function () {
    this.RegisterRuntimeClasses = function () {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClass($mod.TTMSFNCFindDialog);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("AutoHistory",0,rtl.boolean,"FAutoHistory","FAutoHistory",4,{Default: true});
    $r.addProperty("FindText",0,rtl.string,"FFindText","FFindText");
    $r.addProperty("FindList",0,pas.Classes.$rtti["TStringList"],"FFindList","FFindList");
    $r.addProperty("UILanguage",2,$mod.$rtti["TTMSFNCFindDialogUILanguage"],"FUILanguage","SetUILanguage");
    $r.addProperty("Options",0,$mod.$rtti["TTMSFNCFindDialogOptions"],"FOptions","FOptions",4,{Default: $mod.DefaultFindOptions});
    $r.addProperty("VisibleOptions",0,$mod.$rtti["TTMSFNCFindDialogVisibleOptions"],"FVisibleOptions","FVisibleOptions",4,{Default: $mod.DefaultVisibleOptions});
    $r.addProperty("OnFind",0,$mod.$rtti["TTMSFNCFindDialogFindEvent"],"FOnFind","FOnFind");
    $r.addProperty("OnFindNext",0,$mod.$rtti["TTMSFNCFindDialogFindEvent"],"FOnFindNext","FOnFindNext");
    $r.addProperty("OnFindEditChange",0,$mod.$rtti["TTMSFNCFindDialogFindEditChangeEvent"],"FOnFindEditChange","FOnFindEditChange");
    $r.addProperty("OnSetMarker",0,pas.Classes.$rtti["TNotifyEvent"],"FOnSetMarker","FOnSetMarker");
    $r.addProperty("OnClose",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClose","FOnClose");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
},["SysUtils","Math"]);
rtl.module("WEBLib.TMSFNCReplaceDialog",["System","Classes","WEBLib.TMSFNCCustomDialog","WEBLib.TMSFNCTypes","WEBLib.StdCtrls","WEBLib.ExtCtrls"],function () {
  "use strict";
  var $mod = this;
  this.TTMSFNCReplaceDialogOption = {"0": "rdoCurrentFile", rdoCurrentFile: 0, "1": "rdoSelection", rdoSelection: 1, "2": "rdoAllOpenFiles", rdoAllOpenFiles: 2, "3": "rdoCaseSensitive", rdoCaseSensitive: 3, "4": "rdoExpression", rdoExpression: 4, "5": "rdoWholeWordOnly", rdoWholeWordOnly: 5, "6": "rdoWrapAtEndOfFile", rdoWrapAtEndOfFile: 6, "7": "rdoMoreEnabled", rdoMoreEnabled: 7, "8": "rdoFindEnabled", rdoFindEnabled: 8, "9": "rdoFindNextEnabled", rdoFindNextEnabled: 9, "10": "rdoReplaceAllEnabled", rdoReplaceAllEnabled: 10, "11": "rdoReplaceEnabled", rdoReplaceEnabled: 11, "12": "rdoCloseEnabled", rdoCloseEnabled: 12, "13": "rdoMoreExpanded", rdoMoreExpanded: 13, "14": "rdoDown", rdoDown: 14};
  this.$rtti.$Enum("TTMSFNCReplaceDialogOption",{minvalue: 0, maxvalue: 14, ordtype: 1, enumtype: this.TTMSFNCReplaceDialogOption});
  this.TTMSFNCReplaceDialogVisibleOption = {"0": "rdovCaseSensitive", rdovCaseSensitive: 0, "1": "rdovExpression", rdovExpression: 1, "2": "rdovWholeWordOnly", rdovWholeWordOnly: 2, "3": "rdovWrapAtEndOfFile", rdovWrapAtEndOfFile: 3, "4": "rdovMore", rdovMore: 4, "5": "rdovReplace", rdovReplace: 5, "6": "rdovReplaceAll", rdovReplaceAll: 6, "7": "rdovFind", rdovFind: 7, "8": "rdovFindNext", rdovFindNext: 8, "9": "rdovClose", rdovClose: 9, "10": "rdovFindCombo", rdovFindCombo: 10, "11": "rdovFindMemo", rdovFindMemo: 11, "12": "rdovReplaceCombo", rdovReplaceCombo: 12, "13": "rdovReplaceMemo", rdovReplaceMemo: 13, "14": "rdovReplaceAllRange", rdovReplaceAllRange: 14, "15": "rdovCurrentFile", rdovCurrentFile: 15, "16": "rdovSelection", rdovSelection: 16, "17": "rdovAllOpenFiles", rdovAllOpenFiles: 17, "18": "rdovDirection", rdovDirection: 18};
  this.$rtti.$Enum("TTMSFNCReplaceDialogVisibleOption",{minvalue: 0, maxvalue: 18, ordtype: 1, enumtype: this.TTMSFNCReplaceDialogVisibleOption});
  this.$rtti.$Set("TTMSFNCReplaceDialogOptions",{comptype: this.$rtti["TTMSFNCReplaceDialogOption"]});
  this.$rtti.$Set("TTMSFNCReplaceDialogVisibleOptions",{comptype: this.$rtti["TTMSFNCReplaceDialogVisibleOption"]});
  this.DefaultReplaceOptions = rtl.createSet(this.TTMSFNCReplaceDialogOption.rdoMoreEnabled,this.TTMSFNCReplaceDialogOption.rdoReplaceAllEnabled,this.TTMSFNCReplaceDialogOption.rdoFindEnabled,this.TTMSFNCReplaceDialogOption.rdoFindNextEnabled,this.TTMSFNCReplaceDialogOption.rdoReplaceEnabled,this.TTMSFNCReplaceDialogOption.rdoCloseEnabled,this.TTMSFNCReplaceDialogOption.rdoDown);
  this.DefaultVisibleReplaceOptions = rtl.createSet(this.TTMSFNCReplaceDialogVisibleOption.rdovCaseSensitive,this.TTMSFNCReplaceDialogVisibleOption.rdovExpression,this.TTMSFNCReplaceDialogVisibleOption.rdovWholeWordOnly,this.TTMSFNCReplaceDialogVisibleOption.rdovWrapAtEndOfFile,this.TTMSFNCReplaceDialogVisibleOption.rdovMore,this.TTMSFNCReplaceDialogVisibleOption.rdovReplace,this.TTMSFNCReplaceDialogVisibleOption.rdovReplaceAll,this.TTMSFNCReplaceDialogVisibleOption.rdovFind,this.TTMSFNCReplaceDialogVisibleOption.rdovFindNext,this.TTMSFNCReplaceDialogVisibleOption.rdovClose,this.TTMSFNCReplaceDialogVisibleOption.rdovFindCombo,this.TTMSFNCReplaceDialogVisibleOption.rdovFindMemo,this.TTMSFNCReplaceDialogVisibleOption.rdovReplaceCombo,this.TTMSFNCReplaceDialogVisibleOption.rdovReplaceMemo,this.TTMSFNCReplaceDialogVisibleOption.rdovReplaceAllRange,this.TTMSFNCReplaceDialogVisibleOption.rdovCurrentFile,this.TTMSFNCReplaceDialogVisibleOption.rdovSelection,this.TTMSFNCReplaceDialogVisibleOption.rdovDirection);
  rtl.createClass(this,"TTMSFNCReplaceDialogComboBox",pas["WEBLib.StdCtrls"].TComboBox,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCReplaceDialogUILanguage",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FReplaceWith = "";
      this.FLess = "";
      this.FCaseSensitive = "";
      this.FSelection = "";
      this.FWrapAtEndOfFile = "";
      this.FDirection = "";
      this.FMore = "";
      this.FDown = "";
      this.FCaption = "";
      this.FWholeWordOnly = "";
      this.FExpression = "";
      this.FUp = "";
      this.FClose = "";
      this.FReplace = "";
      this.FFindWhat = "";
      this.FCurrentFile = "";
      this.FReplaceAllRange = "";
      this.FReplaceAll = "";
      this.FAllOpenFiles = "";
      this.FFind = "";
      this.FOnChanged = null;
      this.FFindNext = "";
    };
    this.$final = function () {
      this.FOnChanged = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.IsCaptionStored = function () {
      var Result = false;
      Result = this.FCaption !== "Replace";
      return Result;
    };
    this.IsCaseSensitiveStored = function () {
      var Result = false;
      Result = this.FCaseSensitive !== "Case sensitive";
      return Result;
    };
    this.IsCloseStored = function () {
      var Result = false;
      Result = this.FClose !== "Close";
      return Result;
    };
    this.IsDirectionStored = function () {
      var Result = false;
      Result = this.FDirection !== "Direction";
      return Result;
    };
    this.IsDownStored = function () {
      var Result = false;
      Result = this.FDown !== "Down";
      return Result;
    };
    this.IsExpressionStored = function () {
      var Result = false;
      Result = this.FExpression !== "Expression";
      return Result;
    };
    this.IsReplaceStored = function () {
      var Result = false;
      Result = this.FReplace !== "Replace";
      return Result;
    };
    this.IsReplaceWithStored = function () {
      var Result = false;
      Result = this.FReplaceWith !== "Replace with:";
      return Result;
    };
    this.IsLessStored = function () {
      var Result = false;
      Result = this.FLess !== "Less";
      return Result;
    };
    this.IsMoreStored = function () {
      var Result = false;
      Result = this.FMore !== "More";
      return Result;
    };
    this.IsSelectionStored = function () {
      var Result = false;
      Result = this.FSelection !== "Selection";
      return Result;
    };
    this.IsUpStored = function () {
      var Result = false;
      Result = this.FUp !== "Up";
      return Result;
    };
    this.IsWholeWordOnlyStored = function () {
      var Result = false;
      Result = this.FWholeWordOnly !== "Whole word only";
      return Result;
    };
    this.IsWrapAtEndOfFileStored = function () {
      var Result = false;
      Result = this.FWrapAtEndOfFile !== "Wrap at end of file";
      return Result;
    };
    this.IsAllOpenFilesStored = function () {
      var Result = false;
      Result = this.FAllOpenFiles !== "All open files";
      return Result;
    };
    this.IsCurrentFileStored = function () {
      var Result = false;
      Result = this.FCurrentFile !== "Current file";
      return Result;
    };
    this.IsFindStored = function () {
      var Result = false;
      Result = this.FFind !== "Find";
      return Result;
    };
    this.IsFindWhatStored = function () {
      var Result = false;
      Result = this.FFindWhat !== "Find what:";
      return Result;
    };
    this.IsReplaceAllRangeStored = function () {
      var Result = false;
      Result = this.FReplaceAllRange !== "Replace all range";
      return Result;
    };
    this.IsReplaceAllStored = function () {
      var Result = false;
      Result = this.FReplaceAll !== "Replace all";
      return Result;
    };
    this.SetCaption = function (Value) {
      if (this.FCaption !== Value) {
        this.FCaption = Value;
        this.Changed();
      };
    };
    this.IsFindNextStored = function () {
      var Result = false;
      Result = this.FFindNext !== "Find next";
      return Result;
    };
    this.Changed = function () {
      if (this.FOnChanged != null) this.FOnChanged(this);
    };
    this.Create$1 = function () {
      this.FAllOpenFiles = "All open files";
      this.FCaseSensitive = "Case sensitive";
      this.FClose = "Close";
      this.FDirection = "Direction";
      this.FDown = "Down";
      this.FExpression = "Expression";
      this.FReplace = "Replace";
      this.FCaption = "Replace";
      this.FReplaceWith = "Replace with:";
      this.FLess = "Less";
      this.FMore = "More";
      this.FSelection = "Selection";
      this.FUp = "Up";
      this.FWholeWordOnly = "Whole word only";
      this.FWrapAtEndOfFile = "Wrap at end of file";
      this.FFind = "Find";
      this.FFindNext = "Find next";
      this.FFindWhat = "Find what:";
      this.FReplaceAll = "Replace all";
      this.FReplaceAllRange = "Replace all range";
      this.FCurrentFile = "Current file";
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCReplaceDialogUILanguage.isPrototypeOf(Source)) {
        this.FCaseSensitive = rtl.as(Source,$mod.TTMSFNCReplaceDialogUILanguage).FCaseSensitive;
        this.FClose = rtl.as(Source,$mod.TTMSFNCReplaceDialogUILanguage).FClose;
        this.FDirection = rtl.as(Source,$mod.TTMSFNCReplaceDialogUILanguage).FDirection;
        this.FDown = rtl.as(Source,$mod.TTMSFNCReplaceDialogUILanguage).FDown;
        this.FExpression = rtl.as(Source,$mod.TTMSFNCReplaceDialogUILanguage).FExpression;
        this.FReplace = rtl.as(Source,$mod.TTMSFNCReplaceDialogUILanguage).FReplace;
        this.FCaption = rtl.as(Source,$mod.TTMSFNCReplaceDialogUILanguage).FCaption;
        this.FReplaceWith = rtl.as(Source,$mod.TTMSFNCReplaceDialogUILanguage).FReplaceWith;
        this.FLess = rtl.as(Source,$mod.TTMSFNCReplaceDialogUILanguage).FLess;
        this.FMore = rtl.as(Source,$mod.TTMSFNCReplaceDialogUILanguage).FMore;
        this.FSelection = rtl.as(Source,$mod.TTMSFNCReplaceDialogUILanguage).FSelection;
        this.FUp = rtl.as(Source,$mod.TTMSFNCReplaceDialogUILanguage).FUp;
        this.FWholeWordOnly = rtl.as(Source,$mod.TTMSFNCReplaceDialogUILanguage).FWholeWordOnly;
        this.FWrapAtEndOfFile = rtl.as(Source,$mod.TTMSFNCReplaceDialogUILanguage).FWrapAtEndOfFile;
        this.FAllOpenFiles = rtl.as(Source,$mod.TTMSFNCReplaceDialogUILanguage).FAllOpenFiles;
        this.FCurrentFile = rtl.as(Source,$mod.TTMSFNCReplaceDialogUILanguage).FCurrentFile;
        this.FFind = rtl.as(Source,$mod.TTMSFNCReplaceDialogUILanguage).FFind;
        this.FFindWhat = rtl.as(Source,$mod.TTMSFNCReplaceDialogUILanguage).FFindWhat;
        this.FReplaceAll = rtl.as(Source,$mod.TTMSFNCReplaceDialogUILanguage).FReplaceAll;
        this.FReplaceAllRange = rtl.as(Source,$mod.TTMSFNCReplaceDialogUILanguage).FReplaceAllRange;
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    var $r = this.$rtti;
    $r.addProperty("AllOpenFiles",12,rtl.string,"FAllOpenFiles","FAllOpenFiles",4,{stored: "IsAllOpenFilesStored"});
    $r.addProperty("Caption",14,rtl.string,"FCaption","SetCaption",4,{stored: "IsCaptionStored"});
    $r.addProperty("CaseSensitive",12,rtl.string,"FCaseSensitive","FCaseSensitive",4,{stored: "IsCaseSensitiveStored"});
    $r.addProperty("Close",12,rtl.string,"FClose","FClose",4,{stored: "IsCloseStored"});
    $r.addProperty("CurrentFile",12,rtl.string,"FCurrentFile","FCurrentFile",4,{stored: "IsCurrentFileStored"});
    $r.addProperty("Direction",12,rtl.string,"FDirection","FDirection",4,{stored: "IsDirectionStored"});
    $r.addProperty("Down",12,rtl.string,"FDown","FDown",4,{stored: "IsDownStored"});
    $r.addProperty("Expression",12,rtl.string,"FExpression","FExpression",4,{stored: "IsExpressionStored"});
    $r.addProperty("Find",12,rtl.string,"FFind","FFind",4,{stored: "IsFindStored"});
    $r.addProperty("FindNext",12,rtl.string,"FFindNext","FFindNext",4,{stored: "IsFindNextStored"});
    $r.addProperty("FindWhat",12,rtl.string,"FFindWhat","FFindWhat",4,{stored: "IsFindWhatStored"});
    $r.addProperty("Less",12,rtl.string,"FLess","FLess",4,{stored: "IsLessStored"});
    $r.addProperty("More",12,rtl.string,"FMore","FMore",4,{stored: "IsMoreStored"});
    $r.addProperty("Replace",12,rtl.string,"FReplace","FReplace",4,{stored: "IsReplaceStored"});
    $r.addProperty("ReplaceAll",12,rtl.string,"FReplaceAll","FReplaceAll",4,{stored: "IsReplaceAllStored"});
    $r.addProperty("ReplaceAllRange",12,rtl.string,"FReplaceAllRange","FReplaceAllRange",4,{stored: "IsReplaceAllRangeStored"});
    $r.addProperty("ReplaceWith",12,rtl.string,"FReplaceWith","FReplaceWith",4,{stored: "IsReplaceWithStored"});
    $r.addProperty("Selection",12,rtl.string,"FSelection","FSelection",4,{stored: "IsSelectionStored"});
    $r.addProperty("Up",12,rtl.string,"FUp","FUp",4,{stored: "IsUpStored"});
    $r.addProperty("WholeWordOnly",12,rtl.string,"FWholeWordOnly","FWholeWordOnly",4,{stored: "IsWholeWordOnlyStored"});
    $r.addProperty("WrapAtEndOfFile",12,rtl.string,"FWrapAtEndOfFile","FWrapAtEndOfFile",4,{stored: "IsWrapAtEndOfFileStored"});
  });
  rtl.createInterface(this,"ITMSFNCReplace","{02B8E1DA-978E-49B0-BC84-EF2ACCB47FCF}",["FindValue","FindNextValue","ReplaceValue","ReplaceAllValue","FindEditChange","ReplaceEditChange"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("FindValue",0,[["AText",rtl.string]]);
    $r.addMethod("FindNextValue",0,[["AText",rtl.string]]);
    $r.addMethod("ReplaceValue",0,[["AFind",rtl.string],["AReplace",rtl.string]]);
    $r.addMethod("ReplaceAllValue",0,[["AFind",rtl.string],["AReplace",rtl.string]]);
    $r.addMethod("FindEditChange",0,[["APrevText",rtl.string],["ANewText",rtl.string]]);
    $r.addMethod("ReplaceEditChange",0,[["APrevText",rtl.string],["ANewText",rtl.string]]);
  });
  this.$rtti.$MethodVar("TTMSFNCReplaceDialogFindEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFindText",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCReplaceDialogReplaceEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFindText",rtl.string],["AReplaceText",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCReplaceDialogReplaceEditChangeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["APrevText",rtl.string],["ANewText",rtl.string]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCCustomReplaceDialog",pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog.$init.call(this);
      this.FDialogOpenedHeight = 0;
      this.FDialogClosedHeight = 0;
      this.FComboBoxFind = null;
      this.FComboBoxReplace = null;
      this.FButtonFind = null;
      this.FButtonFindNext = null;
      this.FButtonReplace = null;
      this.FButtonReplaceAll = null;
      this.FButtonClose = null;
      this.FButtonMore = null;
      this.FLabelFind = null;
      this.FLabelFindMore = null;
      this.FLabelReplace = null;
      this.FLabelReplaceMore = null;
      this.FMemoFind = null;
      this.FMemoReplace = null;
      this.FCheckBoxCase = null;
      this.FCheckBoxWholeOnly = null;
      this.FCheckBoxExpression = null;
      this.FCheckBoxEOF = null;
      this.FDirGroup = null;
      this.FRadioDown = null;
      this.FRadioUp = null;
      this.FRangeGroup = null;
      this.FRadioCurrentFile = null;
      this.FRadioSelection = null;
      this.FRadioAllOpen = null;
      this.FOnReplace = null;
      this.FOnReplaceEditChange = null;
      this.FOptions = {};
      this.FVisibleOptions = {};
      this.FMore = false;
      this.FUILanguage = null;
      this.FAutoHistory = false;
      this.FFindText = "";
      this.FFindList = null;
      this.FReplaceText = "";
      this.FReplaceList = null;
      this.FOnFind = null;
      this.FOnFindEditChange = null;
      this.FOnReplaceAll = null;
      this.FOnFindNext = null;
    };
    this.$final = function () {
      this.FComboBoxFind = undefined;
      this.FComboBoxReplace = undefined;
      this.FButtonFind = undefined;
      this.FButtonFindNext = undefined;
      this.FButtonReplace = undefined;
      this.FButtonReplaceAll = undefined;
      this.FButtonClose = undefined;
      this.FButtonMore = undefined;
      this.FLabelFind = undefined;
      this.FLabelFindMore = undefined;
      this.FLabelReplace = undefined;
      this.FLabelReplaceMore = undefined;
      this.FMemoFind = undefined;
      this.FMemoReplace = undefined;
      this.FCheckBoxCase = undefined;
      this.FCheckBoxWholeOnly = undefined;
      this.FCheckBoxExpression = undefined;
      this.FCheckBoxEOF = undefined;
      this.FDirGroup = undefined;
      this.FRadioDown = undefined;
      this.FRadioUp = undefined;
      this.FRangeGroup = undefined;
      this.FRadioCurrentFile = undefined;
      this.FRadioSelection = undefined;
      this.FRadioAllOpen = undefined;
      this.FOnReplace = undefined;
      this.FOnReplaceEditChange = undefined;
      this.FOptions = undefined;
      this.FVisibleOptions = undefined;
      this.FUILanguage = undefined;
      this.FFindList = undefined;
      this.FReplaceList = undefined;
      this.FOnFind = undefined;
      this.FOnFindEditChange = undefined;
      this.FOnReplaceAll = undefined;
      this.FOnFindNext = undefined;
      pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog.$final.call(this);
    };
    this.SetUILanguage = function (Value) {
      this.FUILanguage.Assign(Value);
    };
    this.GetInstance = function () {
      var Result = 0;
      Result = pas["WEBLib.TMSFNCTypes"].HInstance();
      return Result;
    };
    this.ButtonReplaceClick = function (Sender) {
      this.DoReplaceText(this.FFindText,this.FReplaceText);
    };
    this.ButtonFindClick = function (Sender) {
      this.DoFindText(this.FFindText);
    };
    this.ButtonFindNextClick = function (Sender) {
      this.DoFindNextText(this.FFindText);
    };
    this.ButtonMoreClick = function (Sender) {
      if (!this.FMore) {
        this.UpdateMoreButton(this.FUILanguage.FLess);
        this.FOptions = rtl.unionSet(this.FOptions,rtl.createSet($mod.TTMSFNCReplaceDialogOption.rdoMoreExpanded));
        this.SetDialogHeight(this.FDialogOpenedHeight);
      } else {
        this.UpdateMoreButton(this.FUILanguage.FMore);
        this.FOptions = rtl.diffSet(this.FOptions,rtl.createSet($mod.TTMSFNCReplaceDialogOption.rdoMoreExpanded));
        this.SetDialogHeight(this.FDialogClosedHeight);
      };
      if ($mod.TTMSFNCReplaceDialogVisibleOption.rdovFindMemo in this.FVisibleOptions) {
        this.FLabelFindMore.SetVisible(!this.FMore);
        this.FMemoFind.SetVisible(!this.FMore);
      };
      if ($mod.TTMSFNCReplaceDialogVisibleOption.rdovReplaceMemo in this.FVisibleOptions) {
        this.FLabelReplaceMore.SetVisible(!this.FMore);
        this.FMemoReplace.SetVisible(!this.FMore);
      };
      if ($mod.TTMSFNCReplaceDialogVisibleOption.rdovFindCombo in this.FVisibleOptions) {
        this.FLabelFind.SetEnabled(this.FMore);
        this.FComboBoxFind.SetEnabled(this.FMore);
      };
      if ($mod.TTMSFNCReplaceDialogVisibleOption.rdovReplaceCombo in this.FVisibleOptions) {
        this.FLabelReplace.SetEnabled(this.FMore);
        this.FComboBoxReplace.SetEnabled(this.FMore);
      };
      this.FMore = !this.FMore;
    };
    this.ButtonReplaceAllClick = function (Sender) {
      this.DoReplaceAllText(this.FFindText,this.FReplaceText);
    };
    this.ButtonCloseClick = function (Sender) {
      if (this.FFrm != null) this.FFrm.Close();
    };
    this.CheckBoxCaseClick = function (Sender) {
      if (this.FCheckBoxCase.GetChecked()) {
        this.FOptions = rtl.unionSet(this.FOptions,rtl.createSet($mod.TTMSFNCReplaceDialogOption.rdoCaseSensitive))}
       else this.FOptions = rtl.diffSet(this.FOptions,rtl.createSet($mod.TTMSFNCReplaceDialogOption.rdoCaseSensitive));
    };
    this.CheckBoxWholeOnlyClick = function (Sender) {
      if (this.FCheckBoxWholeOnly.GetChecked()) {
        this.FOptions = rtl.unionSet(this.FOptions,rtl.createSet($mod.TTMSFNCReplaceDialogOption.rdoWholeWordOnly))}
       else this.FOptions = rtl.diffSet(this.FOptions,rtl.createSet($mod.TTMSFNCReplaceDialogOption.rdoWholeWordOnly));
    };
    this.CheckBoxExpressionClick = function (Sender) {
      if (this.FCheckBoxExpression.GetChecked()) {
        this.FOptions = rtl.unionSet(this.FOptions,rtl.createSet($mod.TTMSFNCReplaceDialogOption.rdoExpression))}
       else this.FOptions = rtl.diffSet(this.FOptions,rtl.createSet($mod.TTMSFNCReplaceDialogOption.rdoExpression));
    };
    this.CheckBoxEOFClick = function (Sender) {
      if (this.FCheckBoxEOF.GetChecked()) {
        this.FOptions = rtl.unionSet(this.FOptions,rtl.createSet($mod.TTMSFNCReplaceDialogOption.rdoWrapAtEndOfFile))}
       else this.FOptions = rtl.diffSet(this.FOptions,rtl.createSet($mod.TTMSFNCReplaceDialogOption.rdoWrapAtEndOfFile));
    };
    this.RadioDirClick = function (Sender) {
      if (this.FRadioDown != null) {
        if (this.FRadioDown.GetChecked()) {
          this.FOptions = rtl.unionSet(this.FOptions,rtl.createSet($mod.TTMSFNCReplaceDialogOption.rdoDown))}
         else this.FOptions = rtl.diffSet(this.FOptions,rtl.createSet($mod.TTMSFNCReplaceDialogOption.rdoDown));
      };
    };
    this.RadioRangeClick = function (Sender) {
      if ((this.FRadioCurrentFile != null) && ($mod.TTMSFNCReplaceDialogVisibleOption.rdovCurrentFile in this.FVisibleOptions)) {
        if (this.FRadioCurrentFile.GetChecked()) {
          this.FOptions = rtl.unionSet(this.FOptions,rtl.createSet($mod.TTMSFNCReplaceDialogOption.rdoCurrentFile))}
         else this.FOptions = rtl.diffSet(this.FOptions,rtl.createSet($mod.TTMSFNCReplaceDialogOption.rdoCurrentFile));
      };
      if ((this.FRadioSelection != null) && ($mod.TTMSFNCReplaceDialogVisibleOption.rdovSelection in this.FVisibleOptions)) {
        if (this.FRadioSelection.GetChecked()) {
          this.FOptions = rtl.unionSet(this.FOptions,rtl.createSet($mod.TTMSFNCReplaceDialogOption.rdoSelection))}
         else this.FOptions = rtl.diffSet(this.FOptions,rtl.createSet($mod.TTMSFNCReplaceDialogOption.rdoSelection));
      };
      if ((this.FRadioAllOpen != null) && ($mod.TTMSFNCReplaceDialogVisibleOption.rdovAllOpenFiles in this.FVisibleOptions)) {
        if (this.FRadioAllOpen.GetChecked()) {
          this.FOptions = rtl.unionSet(this.FOptions,rtl.createSet($mod.TTMSFNCReplaceDialogOption.rdoAllOpenFiles))}
         else this.FOptions = rtl.diffSet(this.FOptions,rtl.createSet($mod.TTMSFNCReplaceDialogOption.rdoAllOpenFiles));
      };
    };
    this.ComboBoxFindChange = function (Sender) {
      var s = "";
      s = this.FComboBoxFind.GetText();
      this.DoFindEditChangeEvent(this.FFindText,s);
      this.FFindText = s;
      this.EnableButtons();
    };
    this.ComboBoxFindKeyDown = function (Sender, Key, Shift) {
      if (Key.get() === 13) this.DoFindText(this.FFindText);
    };
    this.ComboBoxReplaceKeyDown = function (Sender, Key, Shift) {
      if (Key.get() === 13) this.DoReplaceText(this.FFindText,this.FReplaceText);
    };
    this.ComboBoxReplaceChange = function (Sender) {
      var s = "";
      s = this.FComboBoxReplace.GetText();
      this.DoReplaceEditChangeEvent(this.FReplaceText,s);
      this.FReplaceText = s;
      this.EnableButtons();
    };
    this.MemoFindChange = function (Sender) {
      var s = "";
      var i = 0;
      s = "";
      for (var $l = 0, $end = this.FMemoFind.FLines.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (i > 0) {
          s = s + "\r\n" + this.FMemoFind.FLines.Get(i)}
         else s = this.FMemoFind.FLines.Get(i);
      };
      this.DoReplaceEditChangeEvent(this.FFindText,s);
      this.FFindText = s;
      this.EnableButtons();
    };
    this.MemoReplaceChange = function (Sender) {
      var s = "";
      var i = 0;
      s = "";
      for (var $l = 0, $end = this.FMemoReplace.FLines.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (i > 0) {
          s = s + "\r\n" + this.FMemoReplace.FLines.Get(i)}
         else s = this.FMemoReplace.FLines.Get(i);
      };
      this.DoReplaceEditChangeEvent(this.FReplaceText,s);
      this.FReplaceText = s;
      this.EnableButtons();
    };
    this.UILanguageChanged = function (Sender) {
      this.SetCaption(this.FUILanguage.FCaption);
    };
    this.UpdateMoreButton = function (AValue) {
      if (this.FButtonMore != null) {
        this.FButtonMore.SetCaption(AValue);
      };
    };
    this.EnableButtons = function () {
      if ($mod.TTMSFNCReplaceDialogVisibleOption.rdovFind in this.FVisibleOptions) this.FButtonFind.SetEnabled((this.FFindText !== "") && ($mod.TTMSFNCReplaceDialogOption.rdoFindEnabled in this.FOptions));
      if ($mod.TTMSFNCReplaceDialogVisibleOption.rdovFindNext in this.FVisibleOptions) this.FButtonFindNext.SetEnabled((this.FFindText !== "") && ($mod.TTMSFNCReplaceDialogOption.rdoFindNextEnabled in this.FOptions));
      if ($mod.TTMSFNCReplaceDialogVisibleOption.rdovReplace in this.FVisibleOptions) this.FButtonReplace.SetEnabled((this.FFindText !== "") && ($mod.TTMSFNCReplaceDialogOption.rdoReplaceEnabled in this.FOptions));
      if ($mod.TTMSFNCReplaceDialogVisibleOption.rdovReplaceAll in this.FVisibleOptions) this.FButtonReplaceAll.SetEnabled((this.FFindText !== "") && ($mod.TTMSFNCReplaceDialogOption.rdoReplaceAllEnabled in this.FOptions));
    };
    this.DoFindText = function (AText) {
      var f = null;
      var $ir = rtl.createIntfRefs();
      try {
        if (this.FAutoHistory) {
          if ((this.FFindText !== "") && (this.FFindList.IndexOf(this.FFindText) === -1)) this.FFindList.Add(this.FFindText);
          if ($mod.TTMSFNCReplaceDialogVisibleOption.rdovFindCombo in this.FVisibleOptions) {
            this.FComboBoxFind.FItems.Assign(this.FFindList);
            this.FComboBoxFind.SetText(AText);
          };
        };
        if (pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCReplace),{get: function () {
            return f;
          }, set: function (v) {
            f = v;
          }})) f.FindValue(AText);
        this.DoFind(AText);
      } finally {
        $ir.free();
        rtl._Release(f);
      };
    };
    this.DoFindNextText = function (AText) {
      var f = null;
      var $ir = rtl.createIntfRefs();
      try {
        if (this.FAutoHistory) {
          if ((this.FFindText !== "") && (this.FFindList.IndexOf(this.FFindText) === -1)) this.FFindList.Add(this.FFindText);
          if ($mod.TTMSFNCReplaceDialogVisibleOption.rdovFindCombo in this.FVisibleOptions) {
            this.FComboBoxFind.FItems.Assign(this.FFindList);
            this.FComboBoxFind.SetText(AText);
          };
        };
        if (pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCReplace),{get: function () {
            return f;
          }, set: function (v) {
            f = v;
          }})) f.FindNextValue(AText);
        this.DoFindNext(AText);
      } finally {
        $ir.free();
        rtl._Release(f);
      };
    };
    this.DoFindEditChangeEvent = function (APrevText, ANewText) {
      var f = null;
      var $ir = rtl.createIntfRefs();
      try {
        if (pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCReplace),{get: function () {
            return f;
          }, set: function (v) {
            f = v;
          }})) f.FindEditChange(APrevText,ANewText);
        this.DoFindEditChange(APrevText,ANewText);
      } finally {
        $ir.free();
        rtl._Release(f);
      };
    };
    this.DoReplaceText = function (AFindText, AReplaceText) {
      var f = null;
      var $ir = rtl.createIntfRefs();
      try {
        if (this.FAutoHistory) {
          if ((this.FFindText !== "") && (this.FFindList.IndexOf(this.FFindText) === -1)) this.FFindList.Add(this.FFindText);
          if ($mod.TTMSFNCReplaceDialogVisibleOption.rdovFindCombo in this.FVisibleOptions) {
            this.FComboBoxFind.FItems.Assign(this.FFindList);
            this.FComboBoxFind.SetText(AFindText);
          };
          if ((this.FReplaceText !== "") && (this.FReplaceList.IndexOf(this.FReplaceText) === -1)) this.FReplaceList.Add(this.FReplaceText);
          if ($mod.TTMSFNCReplaceDialogVisibleOption.rdovReplaceCombo in this.FVisibleOptions) {
            this.FComboBoxReplace.FItems.Assign(this.FReplaceList);
            this.FComboBoxReplace.SetText(AReplaceText);
          };
        };
        if (pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCReplace),{get: function () {
            return f;
          }, set: function (v) {
            f = v;
          }})) f.ReplaceValue(AFindText,AReplaceText);
        this.DoReplace(AFindText,AReplaceText);
      } finally {
        $ir.free();
        rtl._Release(f);
      };
    };
    this.DoReplaceAllText = function (AFindText, AReplaceText) {
      var f = null;
      var $ir = rtl.createIntfRefs();
      try {
        if (this.FAutoHistory) {
          if ((this.FFindText !== "") && (this.FFindList.IndexOf(this.FFindText) === -1)) this.FFindList.Add(this.FFindText);
          if ($mod.TTMSFNCReplaceDialogVisibleOption.rdovFindCombo in this.FVisibleOptions) {
            this.FComboBoxFind.FItems.Assign(this.FFindList);
            this.FComboBoxFind.SetText(AFindText);
          };
          if ((this.FReplaceText !== "") && (this.FReplaceList.IndexOf(this.FReplaceText) === -1)) this.FReplaceList.Add(this.FReplaceText);
          if ($mod.TTMSFNCReplaceDialogVisibleOption.rdovReplaceCombo in this.FVisibleOptions) {
            this.FComboBoxReplace.FItems.Assign(this.FReplaceList);
            this.FComboBoxReplace.SetText(AReplaceText);
          };
        };
        if (pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCReplace),{get: function () {
            return f;
          }, set: function (v) {
            f = v;
          }})) f.ReplaceAllValue(AFindText,AReplaceText);
        this.DoReplaceAll(AFindText,AReplaceText);
      } finally {
        $ir.free();
        rtl._Release(f);
      };
    };
    this.DoReplaceEditChangeEvent = function (APrevText, ANewText) {
      var f = null;
      var $ir = rtl.createIntfRefs();
      try {
        if (pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(this.FControl,pas.System.IUnknown)),rtl.getIntfGUIDR($mod.ITMSFNCReplace),{get: function () {
            return f;
          }, set: function (v) {
            f = v;
          }})) f.ReplaceEditChange(APrevText,ANewText);
        this.DoReplaceEditChange(APrevText,ANewText);
      } finally {
        $ir.free();
        rtl._Release(f);
      };
    };
    this.DoFind = function (AText) {
      if (this.FOnFind != null) this.FOnFind(this,AText);
    };
    this.DoFindNext = function (AText) {
      if (this.FOnFindNext != null) this.FOnFindNext(this,AText);
    };
    this.DoReplace = function (AFindText, AReplaceText) {
      if (this.FOnReplace != null) this.FOnReplace(this,AFindText,AReplaceText);
    };
    this.DoReplaceAll = function (AFindText, AReplaceText) {
      if (this.FOnReplaceAll != null) this.FOnReplaceAll(this,AFindText,AReplaceText);
    };
    this.DoFindEditChange = function (APrevText, ANewText) {
      if (this.FOnFindEditChange != null) this.FOnFindEditChange(this,APrevText,ANewText);
    };
    this.DoReplaceEditChange = function (APrevText, ANewText) {
      if (this.FOnReplaceEditChange != null) this.FOnReplaceEditChange(this,APrevText,ANewText);
    };
    this.DoClose = function () {
      if (this.FAutoHistory) {
        if ((this.FFindText !== "") && (this.FFindList.IndexOf(this.FFindText) === -1)) this.FFindList.Add(this.FFindText);
        if ((this.FReplaceText !== "") && (this.FReplaceList.IndexOf(this.FReplaceText) === -1)) this.FReplaceList.Add(this.FReplaceText);
      };
      pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog.DoClose.call(this);
    };
    this.DoFormShow = function (Sender) {
      pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog.DoFormShow.apply(this,arguments);
      if ((this.FComboBoxFind != null) && this.FComboBoxFind.FVisible) {
        this.FComboBoxFind.SetFocus()}
       else if ((this.FComboBoxReplace != null) && this.FComboBoxReplace.FVisible) this.FComboBoxReplace.SetFocus();
      if ((this.FMemoFind != null) && this.FMemoFind.FVisible) {
        this.FMemoFind.SetFocus()}
       else if ((this.FMemoReplace != null) && this.FMemoReplace.FVisible) this.FMemoReplace.SetFocus();
    };
    this.BuildDialog = function (AParent) {
      var $Self = this;
      function InitCheckBox(AParentControl, ACaption, AChecked, ALeft, ATop, ACount) {
        var Result = null;
        ACount.set(ACount.get() + 1);
        Result = pas["WEBLib.StdCtrls"].TCheckBox.$create("Create$1",[AParentControl]);
        Result.SetParent(AParentControl);
        Result.SetWidth(140);
        Result.SetChecked(AChecked);
        Result.SetLeft(ALeft.get());
        Result.SetTop(ATop.get());
        Result.SetCaption(ACaption);
        if (ALeft.get() !== 16) {
          ALeft.set(16)}
         else ALeft.set(160);
        if ((ACount.get() % 2) === 0) ATop.set(ATop.get() + Math.round(Result.GetHeight()) + 6);
        return Result;
      };
      function InitButton(AParentControl, ACaption, ALeft, ATop) {
        var Result = null;
        Result = pas["WEBLib.StdCtrls"].TButton.$create("Create$1",[AParentControl]);
        Result.SetParent(AParentControl);
        Result.SetWidth(80);
        Result.SetHeight(22);
        Result.SetLeft(ALeft);
        Result.SetTop(ATop.get());
        Result.SetCaption(ACaption);
        ATop.set(ATop.get() + Math.round(Result.GetHeight()) + 3);
        return Result;
      };
      var tc = 0;
      var lc = 0;
      var cc = 0;
      var btm = 0;
      var tb = 0;
      var s = "";
      pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog.BuildDialog.apply(this,arguments);
      tb = 13;
      tc = 16;
      lc = 16;
      cc = 0;
      if ($mod.TTMSFNCReplaceDialogVisibleOption.rdovFindCombo in this.FVisibleOptions) {
        this.FLabelFind = pas["WEBLib.StdCtrls"].TLabel.$create("Create$1",[AParent]);
        this.FLabelFind.SetParent(AParent);
        this.FLabelFind.SetEnabled(!($mod.TTMSFNCReplaceDialogOption.rdoMoreExpanded in this.FOptions));
        this.FLabelFind.SetLeft(16);
        this.FLabelFind.SetTop(tc);
        this.FLabelFind.SetCaption(this.FUILanguage.FFindWhat);
        this.FComboBoxFind = $mod.TTMSFNCReplaceDialogComboBox.$create("Create$1",[AParent]);
        this.FComboBoxFind.SetParent(AParent);
        this.FComboBoxFind.SetEnabled(!($mod.TTMSFNCReplaceDialogOption.rdoMoreExpanded in this.FOptions));
        this.FComboBoxFind.SetTabOrder(0);
        this.FComboBoxFind.FItems.Assign(this.FReplaceList);
        this.FComboBoxFind.SetText(this.FFindText);
        this.FComboBoxFind.SetWidth(240);
        this.FComboBoxFind.FOnChange = rtl.createCallback($Self,"ComboBoxFindChange");
        this.FComboBoxFind.FOnKeyDown = rtl.createCallback($Self,"ComboBoxFindKeyDown");
        this.FComboBoxFind.SetLeft(95);
        this.FComboBoxFind.SetTop(tc - 3);
        this.FComboBoxFind.SetStyle(pas["WEBLib.StdCtrls"].TComboBoxStyle.csDropDown);
        tc = tc + Math.round(this.FComboBoxFind.GetHeight()) + 7;
      };
      if ($mod.TTMSFNCReplaceDialogVisibleOption.rdovReplaceCombo in this.FVisibleOptions) {
        this.FLabelReplace = pas["WEBLib.StdCtrls"].TLabel.$create("Create$1",[AParent]);
        this.FLabelReplace.SetParent(AParent);
        this.FLabelReplace.SetEnabled(!($mod.TTMSFNCReplaceDialogOption.rdoMoreExpanded in this.FOptions));
        this.FLabelReplace.SetLeft(16);
        this.FLabelReplace.SetTop(tc);
        this.FLabelReplace.SetCaption(this.FUILanguage.FReplaceWith);
        this.FComboBoxReplace = $mod.TTMSFNCReplaceDialogComboBox.$create("Create$1",[AParent]);
        this.FComboBoxReplace.SetParent(AParent);
        this.FComboBoxReplace.SetEnabled(!($mod.TTMSFNCReplaceDialogOption.rdoMoreExpanded in this.FOptions));
        this.FComboBoxReplace.SetTabOrder(1);
        this.FComboBoxReplace.FItems.Assign(this.FReplaceList);
        this.FComboBoxReplace.SetText(this.FReplaceText);
        this.FComboBoxReplace.SetWidth(240);
        this.FComboBoxReplace.FOnChange = rtl.createCallback($Self,"ComboBoxReplaceChange");
        this.FComboBoxReplace.FOnKeyDown = rtl.createCallback($Self,"ComboBoxReplaceKeyDown");
        this.FComboBoxReplace.SetLeft(95);
        this.FComboBoxReplace.SetTop(tc - 3);
        this.FComboBoxReplace.SetStyle(pas["WEBLib.StdCtrls"].TComboBoxStyle.csDropDown);
        tc = tc + Math.round(this.FComboBoxReplace.GetHeight()) + 7;
      };
      if ($mod.TTMSFNCReplaceDialogVisibleOption.rdovCaseSensitive in this.FVisibleOptions) {
        this.FCheckBoxCase = InitCheckBox(AParent,this.FUILanguage.FCaseSensitive,$mod.TTMSFNCReplaceDialogOption.rdoCaseSensitive in this.FOptions,{get: function () {
            return lc;
          }, set: function (v) {
            lc = v;
          }},{get: function () {
            return tc;
          }, set: function (v) {
            tc = v;
          }},{get: function () {
            return cc;
          }, set: function (v) {
            cc = v;
          }});
        this.FCheckBoxCase.FOnClick = rtl.createCallback($Self,"CheckBoxCaseClick");
        this.FCheckBoxCase.SetTabOrder(2);
      };
      if ($mod.TTMSFNCReplaceDialogVisibleOption.rdovWholeWordOnly in this.FVisibleOptions) {
        this.FCheckBoxWholeOnly = InitCheckBox(AParent,this.FUILanguage.FWholeWordOnly,$mod.TTMSFNCReplaceDialogOption.rdoWholeWordOnly in this.FOptions,{get: function () {
            return lc;
          }, set: function (v) {
            lc = v;
          }},{get: function () {
            return tc;
          }, set: function (v) {
            tc = v;
          }},{get: function () {
            return cc;
          }, set: function (v) {
            cc = v;
          }});
        this.FCheckBoxWholeOnly.FOnClick = rtl.createCallback($Self,"CheckBoxWholeOnlyClick");
        this.FCheckBoxWholeOnly.SetTabOrder(3);
      };
      if ($mod.TTMSFNCReplaceDialogVisibleOption.rdovExpression in this.FVisibleOptions) {
        this.FCheckBoxExpression = InitCheckBox(AParent,this.FUILanguage.FExpression,$mod.TTMSFNCReplaceDialogOption.rdoExpression in this.FOptions,{get: function () {
            return lc;
          }, set: function (v) {
            lc = v;
          }},{get: function () {
            return tc;
          }, set: function (v) {
            tc = v;
          }},{get: function () {
            return cc;
          }, set: function (v) {
            cc = v;
          }});
        this.FCheckBoxExpression.FOnClick = rtl.createCallback($Self,"CheckBoxExpressionClick");
        this.FCheckBoxExpression.SetTabOrder(4);
      };
      if ($mod.TTMSFNCReplaceDialogVisibleOption.rdovWrapAtEndOfFile in this.FVisibleOptions) {
        this.FCheckBoxEOF = InitCheckBox(AParent,this.FUILanguage.FWrapAtEndOfFile,$mod.TTMSFNCReplaceDialogOption.rdoWrapAtEndOfFile in this.FOptions,{get: function () {
            return lc;
          }, set: function (v) {
            lc = v;
          }},{get: function () {
            return tc;
          }, set: function (v) {
            tc = v;
          }},{get: function () {
            return cc;
          }, set: function (v) {
            cc = v;
          }});
        this.FCheckBoxEOF.FOnClick = rtl.createCallback($Self,"CheckBoxEOFClick");
        this.FCheckBoxEOF.SetTabOrder(5);
      };
      if ($mod.TTMSFNCReplaceDialogVisibleOption.rdovFind in this.FVisibleOptions) {
        this.FButtonFind = InitButton(AParent,this.FUILanguage.FFind,345,{get: function () {
            return tb;
          }, set: function (v) {
            tb = v;
          }});
        this.FButtonFind.FOnClick = rtl.createCallback($Self,"ButtonFindClick");
        this.FButtonFind.SetTabOrder(6);
      };
      if ($mod.TTMSFNCReplaceDialogVisibleOption.rdovFindNext in this.FVisibleOptions) {
        this.FButtonFindNext = InitButton(AParent,this.FUILanguage.FFindNext,345,{get: function () {
            return tb;
          }, set: function (v) {
            tb = v;
          }});
        this.FButtonFindNext.FOnClick = rtl.createCallback($Self,"ButtonFindNextClick");
        this.FButtonFindNext.SetTabOrder(7);
      };
      if ($mod.TTMSFNCReplaceDialogVisibleOption.rdovReplace in this.FVisibleOptions) {
        this.FButtonReplace = InitButton(AParent,this.FUILanguage.FReplace,345,{get: function () {
            return tb;
          }, set: function (v) {
            tb = v;
          }});
        this.FButtonReplace.FOnClick = rtl.createCallback($Self,"ButtonReplaceClick");
        this.FButtonReplace.SetTabOrder(8);
      };
      if ($mod.TTMSFNCReplaceDialogVisibleOption.rdovReplaceAll in this.FVisibleOptions) {
        this.FButtonReplaceAll = InitButton(AParent,this.FUILanguage.FReplaceAll,345,{get: function () {
            return tb;
          }, set: function (v) {
            tb = v;
          }});
        this.FButtonReplaceAll.FOnClick = rtl.createCallback($Self,"ButtonReplaceAllClick");
        this.FButtonReplaceAll.SetTabOrder(9);
      };
      if ($mod.TTMSFNCReplaceDialogVisibleOption.rdovClose in this.FVisibleOptions) {
        this.FButtonClose = InitButton(AParent,this.FUILanguage.FClose,345,{get: function () {
            return tb;
          }, set: function (v) {
            tb = v;
          }});
        this.FButtonClose.FOnClick = rtl.createCallback($Self,"ButtonCloseClick");
        this.FButtonClose.SetTabOrder(10);
      };
      if ((cc % 2) === 1) tc = tc + 26;
      btm = tc;
      if ($mod.TTMSFNCReplaceDialogVisibleOption.rdovDirection in this.FVisibleOptions) {
        this.FDirGroup = pas["WEBLib.ExtCtrls"].TGroupBox.$create("Create$1",[AParent]);
        this.FDirGroup.SetParent(AParent);
        this.FDirGroup.SetWidth(140);
        this.FDirGroup.SetHeight(45);
        this.FDirGroup.SetCaption(this.FUILanguage.FDirection);
        this.FDirGroup.SetLeft(16);
        this.FDirGroup.SetTop(tc);
        this.FRadioUp = pas["WEBLib.StdCtrls"].TRadioButton.$create("Create$1",[this.FDirGroup]);
        this.FRadioUp.SetParent(this.FDirGroup);
        this.FRadioUp.SetGroupName("direction");
        this.FRadioUp.SetTabOrder(13);
        this.FRadioUp.FOnClick = rtl.createCallback($Self,"RadioDirClick");
        this.FRadioUp.SetCaption(this.FUILanguage.FUp);
        this.FRadioUp.SetLeft(8);
        this.FRadioUp.SetTop(14);
        if (!($mod.TTMSFNCReplaceDialogOption.rdoDown in this.FOptions)) this.FRadioUp.SetChecked(true);
        this.FRadioDown = pas["WEBLib.StdCtrls"].TRadioButton.$create("Create$1",[this.FDirGroup]);
        this.FRadioDown.SetParent(this.FDirGroup);
        this.FRadioDown.SetGroupName("direction");
        this.FRadioDown.SetTabOrder(14);
        this.FRadioDown.FOnClick = rtl.createCallback($Self,"RadioDirClick");
        this.FRadioDown.SetCaption(this.FUILanguage.FDown);
        this.FRadioDown.SetLeft(65);
        this.FRadioDown.SetTop(14);
        if ($mod.TTMSFNCReplaceDialogOption.rdoDown in this.FOptions) this.FRadioDown.SetChecked(true);
        tc = tc + Math.round(this.FDirGroup.GetHeight());
        btm = btm + Math.round(this.FDirGroup.GetHeight());
      };
      if ($mod.TTMSFNCReplaceDialogVisibleOption.rdovReplaceAllRange in this.FVisibleOptions) {
        if ($mod.TTMSFNCReplaceDialogVisibleOption.rdovDirection in this.FVisibleOptions) {
          tc = tc + 10;
          btm = btm + 10;
        };
        this.FRangeGroup = pas["WEBLib.ExtCtrls"].TGroupBox.$create("Create$1",[AParent]);
        this.FRangeGroup.SetParent(AParent);
        this.FRangeGroup.SetHeight(45);
        this.FRangeGroup.SetCaption(this.FUILanguage.FReplaceAllRange);
        this.FRangeGroup.SetLeft(16);
        this.FRangeGroup.SetTop(tc);
        tc = tc + Math.round(this.FRangeGroup.GetHeight());
        btm = btm + Math.round(this.FDirGroup.GetHeight());
        lc = 8;
        if ($mod.TTMSFNCReplaceDialogVisibleOption.rdovCurrentFile in this.FVisibleOptions) {
          this.FRadioCurrentFile = pas["WEBLib.StdCtrls"].TRadioButton.$create("Create$1",[this.FRangeGroup]);
          this.FRadioCurrentFile.SetParent(this.FRangeGroup);
          this.FRadioCurrentFile.SetTabOrder(15);
          this.FRadioCurrentFile.SetGroupName("range");
          this.FRadioCurrentFile.FOnClick = rtl.createCallback($Self,"RadioRangeClick");
          this.FRadioCurrentFile.SetCaption(this.FUILanguage.FCurrentFile);
          this.FRadioCurrentFile.SetLeft(lc);
          this.FRadioCurrentFile.SetTop(14);
          if (!($mod.TTMSFNCReplaceDialogOption.rdoDown in this.FOptions)) this.FRadioCurrentFile.SetChecked(true);
          lc = lc + 90;
        };
        if ($mod.TTMSFNCReplaceDialogVisibleOption.rdovSelection in this.FVisibleOptions) {
          this.FRadioSelection = pas["WEBLib.StdCtrls"].TRadioButton.$create("Create$1",[this.FRangeGroup]);
          this.FRadioSelection.SetParent(this.FRangeGroup);
          this.FRadioSelection.SetTabOrder(16);
          this.FRadioSelection.SetGroupName("range");
          this.FRadioSelection.FOnClick = rtl.createCallback($Self,"RadioRangeClick");
          this.FRadioSelection.SetCaption(this.FUILanguage.FSelection);
          this.FRadioSelection.SetLeft(lc);
          this.FRadioSelection.SetTop(14);
          if (!($mod.TTMSFNCReplaceDialogOption.rdoDown in this.FOptions)) this.FRadioSelection.SetChecked(true);
          lc = lc + 90;
        };
        if ($mod.TTMSFNCReplaceDialogVisibleOption.rdovAllOpenFiles in this.FVisibleOptions) {
          this.FRadioAllOpen = pas["WEBLib.StdCtrls"].TRadioButton.$create("Create$1",[this.FRangeGroup]);
          this.FRadioAllOpen.SetParent(this.FRangeGroup);
          this.FRadioAllOpen.SetTabOrder(17);
          this.FRadioAllOpen.SetGroupName("range");
          this.FRadioAllOpen.FOnClick = rtl.createCallback($Self,"RadioRangeClick");
          this.FRadioAllOpen.SetCaption(this.FUILanguage.FAllOpenFiles);
          this.FRadioAllOpen.SetLeft(lc);
          this.FRadioAllOpen.SetTop(14);
          if (!($mod.TTMSFNCReplaceDialogOption.rdoDown in this.FOptions)) this.FRadioAllOpen.SetChecked(true);
          lc = lc + 100;
        };
        this.FRangeGroup.SetWidth(lc);
      };
      tb = Math.max(tc - 25,tb);
      if ($mod.TTMSFNCReplaceDialogVisibleOption.rdovMore in this.FVisibleOptions) {
        if ($mod.TTMSFNCReplaceDialogOption.rdoMoreExpanded in this.FOptions) {
          s = this.FUILanguage.FLess}
         else s = this.FUILanguage.FMore;
        this.FButtonMore = InitButton(AParent,s,345,{get: function () {
            return tb;
          }, set: function (v) {
            tb = v;
          }});
        this.FButtonMore.FOnClick = rtl.createCallback($Self,"ButtonMoreClick");
        this.FButtonMore.SetTabOrder(18);
        btm = Math.max(btm,tb - 3);
      };
      btm = btm + 10;
      this.FDialogClosedHeight = btm;
      this.FDialogOpenedHeight = btm;
      if ($mod.TTMSFNCReplaceDialogVisibleOption.rdovMore in this.FVisibleOptions) {
        cc = btm;
        if ($mod.TTMSFNCReplaceDialogVisibleOption.rdovFindMemo in this.FVisibleOptions) {
          this.FLabelFindMore = pas["WEBLib.StdCtrls"].TLabel.$create("Create$1",[AParent]);
          this.FLabelFindMore.SetParent(AParent);
          this.FLabelFindMore.SetVisible($mod.TTMSFNCReplaceDialogOption.rdoMoreExpanded in this.FOptions);
          this.FLabelFindMore.SetLeft(16);
          this.FLabelFindMore.SetTop(cc);
          this.FLabelFindMore.SetCaption(this.FUILanguage.FFindWhat);
          this.FMemoFind = pas["WEBLib.StdCtrls"].TMemo.$create("Create$1",[AParent]);
          this.FMemoFind.SetParent(AParent);
          this.FMemoFind.SetVisible($mod.TTMSFNCReplaceDialogOption.rdoMoreExpanded in this.FOptions);
          this.FMemoFind.SetTabOrder(19);
          this.FMemoFind.SetWidth(410);
          this.FMemoFind.SetHeight(80);
          this.FMemoFind.FOnChange = rtl.createCallback($Self,"MemoFindChange");
          this.FMemoFind.SetLeft(16);
          this.FMemoFind.SetTop(this.FLabelFindMore.GetTop() + this.FLabelFindMore.GetHeight() + 7);
          cc = this.FMemoFind.GetTop() + this.FMemoFind.GetHeight() + 8;
        };
        if ($mod.TTMSFNCReplaceDialogVisibleOption.rdovReplaceMemo in this.FVisibleOptions) {
          this.FLabelReplaceMore = pas["WEBLib.StdCtrls"].TLabel.$create("Create$1",[AParent]);
          this.FLabelReplaceMore.SetParent(AParent);
          this.FLabelReplaceMore.SetVisible($mod.TTMSFNCReplaceDialogOption.rdoMoreExpanded in this.FOptions);
          this.FLabelReplaceMore.SetLeft(16);
          this.FLabelReplaceMore.SetTop(cc);
          this.FLabelReplaceMore.SetCaption(this.FUILanguage.FReplaceWith);
          this.FMemoReplace = pas["WEBLib.StdCtrls"].TMemo.$create("Create$1",[AParent]);
          this.FMemoReplace.SetParent(AParent);
          this.FMemoReplace.SetVisible($mod.TTMSFNCReplaceDialogOption.rdoMoreExpanded in this.FOptions);
          this.FMemoReplace.SetTabOrder(20);
          this.FMemoReplace.SetWidth(410);
          this.FMemoReplace.SetHeight(80);
          this.FMemoReplace.FOnChange = rtl.createCallback($Self,"MemoReplaceChange");
          this.FMemoReplace.SetLeft(16);
          this.FMemoReplace.SetTop(this.FLabelReplaceMore.GetTop() + this.FLabelReplaceMore.GetHeight() + 7);
          cc = Math.round(this.FMemoReplace.GetTop() + this.FMemoReplace.GetHeight()) + 8;
        };
        if (cc !== btm) this.FDialogOpenedHeight = cc + 5;
      };
      if ($mod.TTMSFNCReplaceDialogOption.rdoMoreExpanded in this.FOptions) {
        this.FMore = true;
        this.SetDialogHeight(this.FDialogOpenedHeight);
      } else {
        this.SetDialogHeight(this.FDialogClosedHeight);
      };
      this.SetCaption(this.FUILanguage.FCaption);
      this.EnableButtons();
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog.Create$1.apply(this,arguments);
      this.FDialogOpenedHeight = 0;
      this.FDialogClosedHeight = 0;
      this.FOptions = rtl.refSet($mod.DefaultReplaceOptions);
      this.FVisibleOptions = rtl.refSet($mod.DefaultVisibleReplaceOptions);
      this.FMore = false;
      this.FAutoHistory = true;
      this.FReplaceText = "";
      this.FUILanguage = $mod.TTMSFNCReplaceDialogUILanguage.$create("Create$1");
      this.FUILanguage.FOnChanged = rtl.createCallback(this,"UILanguageChanged");
      this.FReplaceList = pas.Classes.TStringList.$create("Create$1");
      this.FFindList = pas.Classes.TStringList.$create("Create$1");
      this.SetCaption(this.FUILanguage.FCaption);
      this.FAllowReturnKeyClose = false;
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FReplaceList");
      rtl.free(this,"FFindList");
      rtl.free(this,"FUILanguage");
      pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog.Destroy.call(this);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCReplaceDialog",this.TTMSFNCCustomReplaceDialog,function () {
    this.RegisterRuntimeClasses = function () {
      pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClass($mod.TTMSFNCReplaceDialog);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("AutoHistory",0,rtl.boolean,"FAutoHistory","FAutoHistory",4,{Default: true});
    $r.addProperty("FindText",0,rtl.string,"FFindText","FFindText");
    $r.addProperty("FindList",0,pas.Classes.$rtti["TStringList"],"FFindList","FFindList");
    $r.addProperty("ReplaceText",0,rtl.string,"FReplaceText","FReplaceText");
    $r.addProperty("ReplaceList",0,pas.Classes.$rtti["TStringList"],"FReplaceList","FReplaceList");
    $r.addProperty("UILanguage",2,$mod.$rtti["TTMSFNCReplaceDialogUILanguage"],"FUILanguage","SetUILanguage");
    $r.addProperty("Options",0,$mod.$rtti["TTMSFNCReplaceDialogOptions"],"FOptions","FOptions",4,{Default: $mod.DefaultReplaceOptions});
    $r.addProperty("VisibleOptions",0,$mod.$rtti["TTMSFNCReplaceDialogVisibleOptions"],"FVisibleOptions","FVisibleOptions",4,{Default: $mod.DefaultVisibleReplaceOptions});
    $r.addProperty("OnFind",0,$mod.$rtti["TTMSFNCReplaceDialogFindEvent"],"FOnFind","FOnFind");
    $r.addProperty("OnFindNext",0,$mod.$rtti["TTMSFNCReplaceDialogFindEvent"],"FOnFindNext","FOnFindNext");
    $r.addProperty("OnFindEditChange",0,$mod.$rtti["TTMSFNCReplaceDialogReplaceEditChangeEvent"],"FOnFindEditChange","FOnFindEditChange");
    $r.addProperty("OnReplace",0,$mod.$rtti["TTMSFNCReplaceDialogReplaceEvent"],"FOnReplace","FOnReplace");
    $r.addProperty("OnReplaceEditChange",0,$mod.$rtti["TTMSFNCReplaceDialogReplaceEditChangeEvent"],"FOnReplaceEditChange","FOnReplaceEditChange");
    $r.addProperty("OnReplaceAll",0,$mod.$rtti["TTMSFNCReplaceDialogReplaceEvent"],"FOnReplaceAll","FOnReplaceAll");
    $r.addProperty("OnClose",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClose","FOnClose");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
},["SysUtils","Math"]);
rtl.module("WEBLib.TMSFNCCustomGroup",["System","Classes","SysUtils","TypInfo","WEBLib.TMSFNCCustomControl","WEBLib.TMSFNCGraphics","WEBLib.Controls","WEBLib.TMSFNCTypes","WEBLib.TMSFNCBitmapContainer","WEBLib.TMSFNCUtils","WEBLib.TMSFNCGraphicsTypes","WEBLib.ExtCtrls"],function () {
  "use strict";
  var $mod = this;
  this.MAJ_VER = 1;
  this.MIN_VER = 0;
  this.REL_VER = 1;
  this.BLD_VER = 2;
  this.$rtti.$ClassRef("TTMSFNCCustomGroupControlClass",{instancetype: pas["WEBLib.Controls"].$rtti["TControl"]});
  rtl.createClass(this,"TTMSFNCCustomGroupList",pas.Classes.TList,function () {
    this.GetItem = function (Index) {
      var Result = null;
      Result = rtl.getObject(this.Get(Index));
      return Result;
    };
    this.SetItem = function (Index, Value) {
      this.Put(Index,Value);
    };
  });
  rtl.createClass(this,"TTMSFNCGroupTitle",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FText = "";
      this.FOnChange = null;
      this.FFont = null;
      this.FAlignment = 0;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      this.FFont = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetText = function (Value) {
      if (this.FText !== Value) {
        this.FText = Value;
        this.Changed();
      };
    };
    this.SetFont = function (Value) {
      this.FFont.Assign(Value);
    };
    this.SetAlignment = function (Value) {
      if (this.FAlignment !== Value) {
        this.FAlignment = Value;
        this.Changed();
      };
    };
    this.FontChanged = function (Sender) {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Changed = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Create$1 = function () {
      this.FFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FFont.FOnChanged = rtl.createCallback(this,"FontChanged");
      this.FAlignment = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading;
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FFont");
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCGroupTitle.isPrototypeOf(Source)) {
        this.FFont.Assign(rtl.as(Source,$mod.TTMSFNCGroupTitle).FFont);
        this.FText = rtl.as(Source,$mod.TTMSFNCGroupTitle).FText;
        this.FAlignment = rtl.as(Source,$mod.TTMSFNCGroupTitle).FAlignment;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Text",2,rtl.string,"FText","SetText");
    $r.addProperty("Font",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FFont","SetFont");
    $r.addProperty("Alignment",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FAlignment","SetAlignment",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading});
  });
  this.$rtti.$MethodVar("TTMSFNCGroupGetControlClassEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AIndex",rtl.longint],["AControlClass",this.$rtti["TTMSFNCCustomGroupControlClass"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGroupSetControlPropertiesEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AControl",pas["WEBLib.Controls"].$rtti["TControl"]],["AIndex",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGroupSetControlNameEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AControl",pas["WEBLib.Controls"].$rtti["TControl"]],["AIndex",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGroupSetControlTextEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AControl",pas["WEBLib.Controls"].$rtti["TControl"]],["AIndex",rtl.longint],["AText",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGroupSetControlBoundsEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AControl",pas["WEBLib.Controls"].$rtti["TControl"]],["AIndex",rtl.longint],["ALeft",rtl.double],["ATop",rtl.double],["AWidth",rtl.double],["AHeight",rtl.double]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGroupGetControlTextEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AControl",pas["WEBLib.Controls"].$rtti["TControl"]],["AIndex",rtl.longint],["AText",rtl.string,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCGroupUpdateControlPropertiesEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AControl",pas["WEBLib.Controls"].$rtti["TControl"]],["AIndex",rtl.longint]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCCustomGroup",pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$init.call(this);
      this.FTimer = null;
      this.FUpdateCount$1 = 0;
      this.FBitmapContainer = null;
      this.FControls$1 = null;
      this.FItems = null;
      this.FColumns = 0;
      this.FIsReadingControl = false;
      this.FIsUpdatingControl = false;
      this.FFont$1 = null;
      this.FTitle = null;
      this.FOnSetControlProperties = null;
      this.FOnGetControlClass = null;
      this.FOnUpdateControlProperties = null;
      this.FOnSetControlText = null;
      this.FOnGetControlText = null;
      this.FOnItemsChanged = null;
      this.FOnSetControlBounds = null;
      this.FOnSetControlName = null;
      this.FBlockReinitialize = false;
    };
    this.$final = function () {
      this.FTimer = undefined;
      this.FBitmapContainer = undefined;
      this.FControls$1 = undefined;
      this.FItems = undefined;
      this.FFont$1 = undefined;
      this.FTitle = undefined;
      this.FOnSetControlProperties = undefined;
      this.FOnGetControlClass = undefined;
      this.FOnUpdateControlProperties = undefined;
      this.FOnSetControlText = undefined;
      this.FOnGetControlText = undefined;
      this.FOnItemsChanged = undefined;
      this.FOnSetControlBounds = undefined;
      this.FOnSetControlName = undefined;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$final.call(this);
    };
    this.GetControl = function (Index) {
      var Result = null;
      Result = null;
      if ((Index >= 0) && (Index <= (this.FControls$1.GetCount() - 1))) Result = this.FControls$1.GetItem(Index);
      return Result;
    };
    this.SetControlCount = function (Value) {
      var c = null;
      var cls = null;
      if (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState) return;
      while (this.FControls$1.GetCount() < Value) {
        cls = this.GetControlClass(this.FControls$1.GetCount());
        c = cls.$create("Create$1",[this]);
        c.SetParent(this);
        this.SetControlProperties(c,this.FControls$1.GetCount());
        this.FControls$1.Add(c);
      };
      while (this.FControls$1.GetCount() > Value) {
        c = rtl.getObject(this.FControls$1.Last());
        this.FControls$1.Remove(c);
        c = rtl.freeLoc(c);
      };
    };
    this.SetColumns = function (Value) {
      Value = Math.max(1,Math.min(Value,16));
      if (this.FColumns !== Value) {
        this.FColumns = Value;
        this.ArrangeControls();
        this.Invalidate();
      };
    };
    this.SetItems = function (Value) {
      this.FItems.Assign(Value);
    };
    this.SetFnt = function (Value) {
      this.FFont$1.Assign(Value);
    };
    this.SetTitle = function (Value) {
      this.FTitle.Assign(Value);
    };
    this.GetBitmapContainer = function () {
      var Result = null;
      Result = this.FBitmapContainer;
      return Result;
    };
    this.SetBitmapContainer = function (Value) {
      this.FBitmapContainer = Value;
      this.UpdateAllControlProperties();
      this.ArrangeControls();
      this.Invalidate();
    };
    this.GetText = function (AIndex) {
      var Result = "";
      var c = null;
      Result = "";
      c = this.GetControl(AIndex);
      if (c != null) Result = this.GetControlText(c,AIndex);
      return Result;
    };
    this.SetText = function (AIndex, Value) {
      var c = null;
      c = this.GetControl(AIndex);
      if (c != null) this.SetControlText(c,AIndex,Value);
    };
    this.GetDocURL = function () {
      var Result = "";
      Result = pas["WEBLib.TMSFNCTypes"].TTMSFNCBaseDocURL + "tmsfncuipack/components/" + pas.SysUtils.LowerCase(this.$classname);
      return Result;
    };
    this.ChangeDPIScale = function (M, D) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ChangeDPIScale.apply(this,arguments);
      this.BeginUpdate();
      this.FTitle.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FTitle.FFont.FHeight,M,D));
      this.FFont$1.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FFont$1.FHeight,M,D));
      this.EndUpdate();
    };
    this.ApplyStyle = function () {
      var c = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ApplyStyle.call(this);
      c = -1;
      if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleTextFontColor({get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }})) this.FFont$1.SetColor(c);
    };
    this.ResetToDefaultStyle = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ResetToDefaultStyle.call(this);
      this.FFont$1.SetColor(0);
    };
    this.CreateAdditionalControls = function () {
    };
    this.DoTimer = function (Sender) {
      var c = null;
      this.FTimer.SetEnabled(false);
      while (this.FControls$1.GetCount() > 0) {
        c = rtl.getObject(this.FControls$1.Last());
        this.FControls$1.Remove(c);
        c = rtl.freeLoc(c);
      };
      this.UpdateControls();
    };
    this.InitializeProperties = function () {
    };
    this.ArrangeControls = function () {
      var ControlsPerCol = 0;
      var I = 0;
      var ControlWidth = 0.0;
      var ControlHeight = 0.0;
      var TopMargin = 0.0;
      var c = null;
      var tr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var x = 0.0;
      var y = 0.0;
      var w = 0.0;
      var h = 0.0;
      if (this.FUpdateCount$1 > 0) return;
      if ((this.FControls$1 != null) && (this.FControls$1.GetCount() !== 0) && !this.FIsReadingControl) {
        tr.$assign(this.GetTitleRect());
        ControlsPerCol = rtl.trunc(((this.FControls$1.GetCount() + this.FColumns) - 1) / this.FColumns);
        ControlWidth = (this.GetWidth() - this.ScalePaintValue(10)) / this.FColumns;
        I = Math.round(this.GetHeight() - (tr.Bottom - tr.Top)) - this.ScalePaintValue(12);
        ControlHeight = rtl.trunc(I / ControlsPerCol);
        TopMargin = (tr.Bottom - tr.Top) + this.ScalePaintValue(6) + rtl.trunc((I % ControlsPerCol) / 2);
        for (var $l = 0, $end = this.FControls$1.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          c = this.FControls$1.GetItem(I);
          this.SetControlName(c,I);
          this.SetControlEnabled(c,I);
          x = (rtl.trunc(I / ControlsPerCol) * ControlWidth) + this.ScalePaintValue(8);
          y = ((I % ControlsPerCol) * ControlHeight) + TopMargin;
          w = ControlWidth;
          h = ControlHeight;
          c.SetEnabled(this.FEnabled);
          c.SetBounds(Math.round(x),Math.round(y),Math.round(Math.max(0,w)),Math.round(Math.max(0,h)));
          this.SetControlBounds(c,I,x,y,w,h);
        };
      };
    };
    this.ItemsChange = function (Sender) {
      if (!this.FIsReadingControl) {
        this.ItemsChanged();
        this.UpdateControls();
      };
    };
    this.FntChanged = function (Sender) {
      var I = 0;
      if (!this.FIsReadingControl) {
        for (var $l = 0, $end = this.FControls$1.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          this.UpdateControlProperties(this.FControls$1.GetItem(I),I);
        };
      };
    };
    this.UpdateControls = function () {
      var I = 0;
      if (this.FUpdateCount$1 > 0) return;
      this.SetControlCount(this.FItems.GetCount());
      for (var $l = 0, $end = this.FControls$1.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.SetControlText(this.FControls$1.GetItem(I),I,this.FItems.Get(I));
        this.UpdateControlProperties(this.FControls$1.GetItem(I),I);
      };
      this.FIsUpdatingControl = true;
      this.UpdateItemIndexControl();
      this.FIsUpdatingControl = false;
      this.ArrangeControls();
      this.Invalidate();
    };
    this.SetEnabled = function (Value) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.SetEnabled.apply(this,arguments);
      this.ArrangeControls();
    };
    this.UpdateAllControlProperties = function () {
      var I = 0;
      if (this.FUpdateCount$1 > 0) return;
      for (var $l = 0, $end = this.FControls$1.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        this.UpdateControlProperties(this.FControls$1.GetItem(I),I);
      };
    };
    this.TitleChanged = function (Sender) {
      this.ArrangeControls();
      this.Invalidate();
    };
    this.ItemsChanged = function () {
      this.DoItemsChanged();
    };
    this.UpdateItemIndexControl = function () {
    };
    this.SetName = function (NewName) {
      pas["WEBLib.Controls"].TCustomControl.SetName.apply(this,arguments);
      this.ArrangeControls();
    };
    this.Notification = function (AComponent, Operation) {
      pas["WEBLib.Menus"].TWebCustomControl.Notification.apply(this,arguments);
      if ((Operation === pas.Classes.TOperation.opRemove) && (AComponent === this.FBitmapContainer)) this.FBitmapContainer = null;
    };
    this.SetControlName = function (AControl, AIndex) {
      this.DoSetControlName(AControl,AIndex);
    };
    this.SetControlEnabled = function (AControl, AIndex) {
    };
    this.SetControlBounds = function (AControl, AIndex, ALeft, ATop, AWidth, AHeight) {
      this.DoSetControlBounds(AControl,AIndex,ALeft,ATop,AWidth,AHeight);
    };
    this.SetControlText = function (AControl, AIndex, AText) {
      this.DoSetControlText(AControl,AIndex,AText);
    };
    this.SetControlProperties = function (AControl, AIndex) {
      this.DoSetControlProperties(AControl,AIndex);
    };
    this.UpdateControlProperties = function (AControl, AIndex) {
      this.DoUpdateControlProperties(AControl,AIndex);
    };
    this.Loaded = function () {
      pas["WEBLib.Controls"].TCustomControl.Loaded.call(this);
      this.ArrangeControls();
    };
    this.DoSetControlProperties = function (AControl, AIndex) {
      if (this.FOnSetControlProperties != null) this.FOnSetControlProperties(this,AControl,AIndex);
    };
    this.DoSetControlName = function (AControl, AIndex) {
      if (this.FOnSetControlName != null) this.FOnSetControlName(this,AControl,AIndex);
    };
    this.DoSetControlText = function (AControl, AIndex, AText) {
      if (this.FOnSetControlText != null) this.FOnSetControlText(this,AControl,AIndex,AText);
    };
    this.DoGetControlText = function (AControl, AIndex, AText) {
      if (this.FOnGetControlText != null) this.FOnGetControlText(this,AControl,AIndex,AText);
    };
    this.DoSetControlBounds = function (AControl, AIndex, ALeft, ATop, AWidth, AHeight) {
      if (this.FOnSetControlBounds != null) this.FOnSetControlBounds(this,AControl,AIndex,ALeft,ATop,AWidth,AHeight);
    };
    this.DoUpdateControlProperties = function (AControl, AIndex) {
      if (this.FOnUpdateControlProperties != null) this.FOnUpdateControlProperties(this,AControl,AIndex);
    };
    this.DoItemsChanged = function () {
      if (this.FOnItemsChanged != null) this.FOnItemsChanged(this);
    };
    this.DoGetControlClass = function (AIndex, AControlClass) {
      if (this.FOnGetControlClass != null) this.FOnGetControlClass(this,AIndex,AControlClass);
    };
    this.CanDrawTitle = function () {
      var Result = false;
      Result = this.FTitle.FText !== "";
      return Result;
    };
    this.GetControlText = function (AControl, AIndex) {
      var Result = "";
      Result = "";
      this.DoGetControlText(AControl,AIndex,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.GetControlClass = function (AIndex) {
      var Result = null;
      Result = pas["WEBLib.Controls"].TControl;
      this.DoGetControlClass(AIndex,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.GetTitleRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var g = null;
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,0,0));
      if (this.FTitle.FText !== "") {
        g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[1,1,false,true]);
        g.BeginScene();
        try {
          g.FOptimizedHTMLDrawing = this.FOptimizedHTMLDrawing;
          g.FBitmapContainer = this.GetBitmapContainer();
          g.FFont.Assign(this.FTitle.FFont);
          Result.$assign(g.CalculateText(this.FTitle.FText,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.GetLocalRect()),false,true));
          Result.Right = Result.Right + 6;
        } finally {
          g.EndScene();
          g = rtl.freeLoc(g);
        };
      };
      return Result;
    };
    this.GetTitleDrawRect = function (ARect) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var tr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      tr.$assign(this.GetTitleRect());
      var $tmp = this.FTitle.FAlignment;
      if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter) {
        r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARect.Left + ((ARect.Right - ARect.Left - (tr.Right - tr.Left)) / 2),ARect.Top + this.ScalePaintValue(2),ARect.Left + ((ARect.Right - ARect.Left - (tr.Right - tr.Left)) / 2) + (tr.Right - tr.Left),ARect.Top + this.ScalePaintValue(2) + (tr.Bottom - tr.Top)))}
       else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading) {
        r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARect.Left + this.ScalePaintValue(4),ARect.Top + this.ScalePaintValue(2),ARect.Left + this.ScalePaintValue(4) + (tr.Right - tr.Left),ARect.Top + this.ScalePaintValue(2) + (tr.Bottom - tr.Top)))}
       else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaTrailing) r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARect.Right - this.ScalePaintValue(4) - (tr.Right - tr.Left),ARect.Top + this.ScalePaintValue(2),ARect.Right - this.ScalePaintValue(4),ARect.Top + this.ScalePaintValue(2) + (tr.Bottom - tr.Top)));
      Result.$assign(r);
      return Result;
    };
    this.CreateGroupTitle = function () {
      var Result = null;
      Result = $mod.TTMSFNCGroupTitle.$create("Create$1");
      return Result;
    };
    this.IsAppearanceProperty = function (AObject, APropertyName, APropertyType) {
      var Result = false;
      Result = pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.IsAppearanceProperty.call(this,AObject,APropertyName,APropertyType);
      Result = Result || (APropertyName === "Title");
      return Result;
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Create$1.call(this,AOwner);
      this.FBlockReinitialize = false;
      this.FTimer = pas["WEBLib.ExtCtrls"].TTimer.$create("Create$1",[this]);
      this.FTimer.SetEnabled(false);
      this.FTimer.SetInterval(1);
      this.FTimer.FOnTimer = rtl.createCallback(this,"DoTimer");
      this.DisableFill();
      this.SetParentColor(true);
      this.FControls$1 = $mod.TTMSFNCCustomGroupList.$create("Create$1");
      this.FItems = pas.Classes.TStringList.$create("Create$1");
      this.FTitle = this.CreateGroupTitle();
      this.FTitle.FOnChange = rtl.createCallback(this,"TitleChanged");
      this.FItems.FOnChange = rtl.createCallback(this,"ItemsChange");
      this.FColumns = 1;
      this.FFont$1 = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FFont$1.FOnChanged = rtl.createCallback(this,"FntChanged");
      this.CreateAdditionalControls();
      this.InitializeProperties();
      if (this.IsDesignTime()) this.InitSample();
      this.SetWidth(155);
      this.SetHeight(105);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FTimer");
      this.SetControlCount(0);
      rtl.free(this,"FTitle");
      rtl.free(this,"FItems");
      rtl.free(this,"FControls$1");
      rtl.free(this,"FFont$1");
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Destroy.call(this);
    };
    this.UpdateControlAfterResize = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.UpdateControlAfterResize.call(this);
      this.ArrangeControls();
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCCustomGroup.isPrototypeOf(Source)) {
        this.FItems.Assign(rtl.as(Source,$mod.TTMSFNCCustomGroup).FItems);
        this.FFont$1.Assign(rtl.as(Source,$mod.TTMSFNCCustomGroup).FFont$1);
        this.FColumns = rtl.as(Source,$mod.TTMSFNCCustomGroup).FColumns;
        this.FTitle.Assign(rtl.as(Source,$mod.TTMSFNCCustomGroup).FTitle);
      };
    };
    this.InitSample = function () {
      this.BeginUpdate();
      this.FItems.Clear();
      this.FItems.Add("Analysts");
      this.FItems.Add("Assistants");
      this.FItems.Add("Managers");
      this.FItems.Add("Specialists");
      this.EndUpdate();
    };
    this.Reinitialize = function () {
      var c = null;
      if (this.FUpdateCount$1 > 0) return;
      while (this.FControls$1.GetCount() > 0) {
        c = rtl.getObject(this.FControls$1.Last());
        this.FControls$1.Remove(c);
        c = rtl.freeLoc(c);
      };
      this.UpdateControls();
    };
    this.BeginUpdate = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBase.BeginUpdate.call(this);
      this.FUpdateCount$1 += 1;
    };
    this.EndUpdate = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBase.EndUpdate.call(this);
      this.FUpdateCount$1 -= 1;
      if (this.FUpdateCount$1 === 0) this.Reinitialize();
    };
    this.Draw = function (AGraphics, ARect) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Draw.apply(this,arguments);
      this.DrawText(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect));
    };
    this.DrawBackground = function (AGraphics, ARect) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var tr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (!this.CanDrawTitle()) {
        pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.DrawBackground.apply(this,arguments);
        return;
      };
      r.$assign(ARect);
      tr.$assign(this.GetTitleRect());
      r.Top = r.Top + 4 + ((tr.Bottom - tr.Top) / 2);
      AGraphics.FFill.Assign(this.FFill);
      AGraphics.FFill.SetColor(this.FColor);
      AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
      AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
      AGraphics.FStroke.Assign(this.FStroke);
      AGraphics.DrawRectangle$3(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsBottom,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsRight),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
      var $tmp = this.FTitle.FAlignment;
      if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter) {
        AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + ((r.Right - r.Left - (tr.Right - tr.Left)) / 2),r.Top)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
        AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + ((r.Right - r.Left - (tr.Right - tr.Left)) / 2) + (tr.Right - tr.Left),r.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Top)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
      } else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading) {
        AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + this.ScalePaintValue(4),r.Top)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
        AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(Math.min(r.Left + this.ScalePaintValue(4) + (tr.Right - tr.Left),r.Right),r.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Top)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
      } else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaTrailing) {
        AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - this.ScalePaintValue(4),r.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Top)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
        AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Top)),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(r.Right - this.ScalePaintValue(4) - (tr.Right - tr.Left),r.Top)),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
      };
    };
    this.DrawText = function (AGraphics, ARect) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (this.FTitle.FText !== "") {
        AGraphics.FBitmapContainer = this.GetBitmapContainer();
        AGraphics.FFont.Assign(this.FTitle.FFont);
        r.$assign(this.GetTitleDrawRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect)));
        AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.FTitle.FText,false,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,true,false,-1,-1);
      };
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCGroup",this.TTMSFNCCustomGroup,function () {
    this.GetVersion = function () {
      var Result = "";
      Result = this.$class.GetVersionNumber(1,0,1,2);
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("BitmapContainer",3,pas["WEBLib.TMSFNCBitmapContainer"].$rtti["TTMSFNCBitmapContainer"],"GetBitmapContainer","SetBitmapContainer");
    $r.addProperty("Version",1,rtl.string,"GetVersion","");
    $r.addProperty("Items",2,pas.Classes.$rtti["TStrings"],"FItems","SetItems");
    $r.addProperty("Font",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FFont$1","SetFnt");
    $r.addProperty("Columns",2,rtl.longint,"FColumns","SetColumns",4,{Default: 1});
    $r.addProperty("Fill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFill","SetFill");
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
    $r.addProperty("Title",2,$mod.$rtti["TTMSFNCGroupTitle"],"FTitle","SetTitle");
    $r.addProperty("OnGetControlClass",0,$mod.$rtti["TTMSFNCGroupGetControlClassEvent"],"FOnGetControlClass","FOnGetControlClass");
    $r.addProperty("OnSetControlProperties",0,$mod.$rtti["TTMSFNCGroupSetControlPropertiesEvent"],"FOnSetControlProperties","FOnSetControlProperties");
    $r.addProperty("OnSetControlText",0,$mod.$rtti["TTMSFNCGroupSetControlTextEvent"],"FOnSetControlText","FOnSetControlText");
    $r.addProperty("OnSetControlName",0,$mod.$rtti["TTMSFNCGroupSetControlNameEvent"],"FOnSetControlName","FOnSetControlName");
    $r.addProperty("OnSetControlBounds",0,$mod.$rtti["TTMSFNCGroupSetControlBoundsEvent"],"FOnSetControlBounds","FOnSetControlBounds");
    $r.addProperty("OnGetControlText",0,$mod.$rtti["TTMSFNCGroupGetControlTextEvent"],"FOnGetControlText","FOnGetControlText");
    $r.addProperty("OnUpdateControlProperties",0,$mod.$rtti["TTMSFNCGroupUpdateControlPropertiesEvent"],"FOnUpdateControlProperties","FOnUpdateControlProperties");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
},["Math","WEBLib.TMSFNCStyles","WEBLib.Graphics"]);
rtl.module("WEBLib.TMSFNCRadioGroup",["System","Classes","WEBLib.TMSFNCCustomControl","WEBLib.TMSFNCCustomGroup","WEBLib.TMSFNCGraphicsTypes","WEBLib.TMSFNCTypes","WEBLib.StdCtrls","WEBLib.Controls","WEBLib.TMSFNCHTMLText","Types"],function () {
  "use strict";
  var $mod = this;
  this.MAJ_VER = 1;
  this.MIN_VER = 0;
  this.REL_VER = 3;
  this.BLD_VER = 3;
  rtl.createClass(this,"TTMSFNCRadioHTMLText",pas["WEBLib.TMSFNCHTMLText"].TTMSFNCHTMLText,function () {
    this.CanDrawDesignTime = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCRadioContainer",pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$init.call(this);
      this.FRadioButton = null;
      this.FHTMLText = null;
    };
    this.$final = function () {
      this.FRadioButton = undefined;
      this.FHTMLText = undefined;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$final.call(this);
    };
    this.RegisterRuntimeClasses = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClass($mod.TTMSFNCRadioContainer);
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Create$1.apply(this,arguments);
      this.DisableBackground();
      this.SetTabStop(false);
      this.FRadioButton = pas["WEBLib.StdCtrls"].TRadioButton.$create("Create$1",[this]);
      this.FRadioButton.SetParent(this);
      this.FRadioButton.SetWidth(this.FRadioButton.GetHeight());
      this.SetHeight(this.FRadioButton.GetHeight());
      this.FHTMLText = $mod.TTMSFNCRadioHTMLText.$create("Create$1",[this]);
      this.FHTMLText.SetAllowFocus(false);
      this.FHTMLText.SetParent(this);
      this.FHTMLText.DisableBackground();
      this.FHTMLText.SetHorizontalTextAlign(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading);
      this.SetParentColor(true);
      this.FHTMLText.SetParentColor(true);
      this.FHTMLText.SetAlign(pas["WEBLib.Controls"].TAlign.alClient);
      this.FRadioButton.SetAlign(pas["WEBLib.Controls"].TAlign.alLeft);
      return this;
    };
    this.Destroy = function () {
      if (this.FRadioButton != null) rtl.free(this,"FRadioButton");
      if (this.FHTMLText != null) rtl.free(this,"FHTMLText");
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Destroy.call(this);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.TTMSFNCRadioGroupTitleCheckBoxMode = {"0": "rgtcmNone", rgtcmNone: 0, "1": "rgtcmToggleEnabled", rgtcmToggleEnabled: 1};
  this.$rtti.$Enum("TTMSFNCRadioGroupTitleCheckBoxMode",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCRadioGroupTitleCheckBoxMode});
  this.$rtti.$MethodVar("TTMSFNCRadioGroupTitleSetCheckState",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACheckState",rtl.boolean]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCRadioGroupTitleGetCheckState",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACheckState",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCRadioGroupClickEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AItemIndex",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCRadioGroupTitleAnchorClickEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AAnchor",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCRadioGroupItemAnchorClickEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AItemIndex",rtl.longint],["AAnchor",rtl.string]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCRadioGroupTitle",pas["WEBLib.TMSFNCCustomGroup"].TTMSFNCGroupTitle,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomGroup"].TTMSFNCGroupTitle.$init.call(this);
      this.FCheckBoxMode = 0;
      this.FShowCheckBox = false;
      this.FOnGetCheckState = null;
      this.FOnSetCheckState = null;
    };
    this.$final = function () {
      this.FOnGetCheckState = undefined;
      this.FOnSetCheckState = undefined;
      pas["WEBLib.TMSFNCCustomGroup"].TTMSFNCGroupTitle.$final.call(this);
    };
    this.SetCheckBoxMode = function (Value) {
      if (this.FCheckBoxMode !== Value) {
        this.FCheckBoxMode = Value;
        this.Changed();
      };
    };
    this.SetShowCheckBox = function (Value) {
      if (this.FShowCheckBox !== Value) {
        this.FShowCheckBox = Value;
        this.Changed();
      };
    };
    this.GetChecked = function () {
      var Result = false;
      var b = false;
      b = false;
      if (this.FOnGetCheckState != null) this.FOnGetCheckState(this,{get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }});
      Result = b;
      return Result;
    };
    this.SetChecked = function (Value) {
      if (this.FOnSetCheckState != null) this.FOnSetCheckState(this,Value);
    };
    this.Create$1 = function () {
      pas["WEBLib.TMSFNCCustomGroup"].TTMSFNCGroupTitle.Create$1.call(this);
      this.FShowCheckBox = false;
      this.FCheckBoxMode = $mod.TTMSFNCRadioGroupTitleCheckBoxMode.rgtcmToggleEnabled;
      return this;
    };
    this.Assign = function (Source) {
      pas["WEBLib.TMSFNCCustomGroup"].TTMSFNCGroupTitle.Assign.apply(this,arguments);
      if ($mod.TTMSFNCRadioGroupTitle.isPrototypeOf(Source)) {
        this.FCheckBoxMode = rtl.as(Source,$mod.TTMSFNCRadioGroupTitle).FCheckBoxMode;
        this.FShowCheckBox = rtl.as(Source,$mod.TTMSFNCRadioGroupTitle).FShowCheckBox;
        this.SetChecked(rtl.as(Source,$mod.TTMSFNCRadioGroupTitle).GetChecked());
      };
    };
    var $r = this.$rtti;
    $r.addProperty("ShowCheckBox",2,rtl.boolean,"FShowCheckBox","SetShowCheckBox",4,{Default: false});
    $r.addProperty("Checked",3,rtl.boolean,"GetChecked","SetChecked",4,{Default: true});
    $r.addProperty("CheckBoxMode",2,$mod.$rtti["TTMSFNCRadioGroupTitleCheckBoxMode"],"FCheckBoxMode","SetCheckBoxMode",4,{Default: $mod.TTMSFNCRadioGroupTitleCheckBoxMode.rgtcmToggleEnabled});
  });
  rtl.createClass(this,"TTMSFNCCustomRadioGroup",pas["WEBLib.TMSFNCCustomGroup"].TTMSFNCCustomGroup,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomGroup"].TTMSFNCCustomGroup.$init.call(this);
      this.FItemIndex = 0;
      this.FTitleCheckBox = null;
      this.FOnTitleCheckBoxClick = null;
      this.FOnRadioButtonClick = null;
      this.FOnTitleAnchorClick = null;
      this.FOnRadioButtonAnchorClick = null;
      this.FOnRadioButtonDblClick = null;
      this.FRadioTabStop = false;
    };
    this.$final = function () {
      this.FTitleCheckBox = undefined;
      this.FOnTitleCheckBoxClick = undefined;
      this.FOnRadioButtonClick = undefined;
      this.FOnTitleAnchorClick = undefined;
      this.FOnRadioButtonAnchorClick = undefined;
      this.FOnRadioButtonDblClick = undefined;
      pas["WEBLib.TMSFNCCustomGroup"].TTMSFNCCustomGroup.$final.call(this);
    };
    this.GetRadioButton = function (AIndex) {
      var Result = null;
      var c = null;
      Result = null;
      c = this.GetControl(AIndex);
      if ((c != null) && $mod.TTMSFNCRadioContainer.isPrototypeOf(c)) Result = rtl.as(c,$mod.TTMSFNCRadioContainer).FRadioButton;
      return Result;
    };
    this.GetHTMLText = function (AIndex) {
      var Result = null;
      var c = null;
      Result = null;
      c = this.GetControl(AIndex);
      if ((c != null) && $mod.TTMSFNCRadioContainer.isPrototypeOf(c)) Result = rtl.as(c,$mod.TTMSFNCRadioContainer).FHTMLText;
      return Result;
    };
    this.GetRadioContainer = function (AIndex) {
      var Result = null;
      var c = null;
      Result = null;
      c = this.GetControl(AIndex);
      if ((c != null) && $mod.TTMSFNCRadioContainer.isPrototypeOf(c)) Result = rtl.as(c,$mod.TTMSFNCRadioContainer);
      return Result;
    };
    this.GetTitle = function () {
      var Result = null;
      Result = this.FTitle;
      return Result;
    };
    this.SetTitle$1 = function (Value) {
      this.GetTitle().Assign(Value);
    };
    this.SetRadioTabStop = function (Value) {
      var c = null;
      if (Value !== this.FRadioTabStop) {
        this.FRadioTabStop = Value;
        if (rtl.eqSet(rtl.intersectSet(rtl.createSet(pas.Classes.TComponentStateItem.csDesigning,pas.Classes.TComponentStateItem.csLoading,pas.Classes.TComponentStateItem.csReading),this.FComponentState),{})) {
          if (this.FItemIndex >= 0) {
            c = this.GetControl(this.FItemIndex);
            if ((c != null) && $mod.TTMSFNCRadioContainer.isPrototypeOf(c)) rtl.as(c,$mod.TTMSFNCRadioContainer).FRadioButton.SetTabStop(this.FRadioTabStop);
          };
        };
      };
    };
    this.SetItemIndex = function (Value) {
      if (this.FIsReadingControl) {
        this.FItemIndex = Value}
       else {
        if (Value < -1) Value = -1;
        if (Value >= this.FControls$1.GetCount()) Value = this.FControls$1.GetCount() - 1;
        if (this.FItemIndex !== Value) {
          if (this.FItemIndex >= 0) this.SetControlCheckState(this.GetControl(this.FItemIndex),false);
          this.FItemIndex = Value;
          if (this.FItemIndex >= 0) this.SetControlCheckState(this.GetControl(this.FItemIndex),true);
        };
      };
    };
    this.DoRadioButtonClick = function (AItemIndex) {
      if (this.FOnRadioButtonClick != null) this.FOnRadioButtonClick(this,this.FItemIndex);
    };
    this.ControlClick = function (Sender) {
      var I = 0;
      if (!this.FIsUpdatingControl) {
        if (pas["WEBLib.StdCtrls"].TRadioButton.isPrototypeOf(Sender) || $mod.TTMSFNCRadioHTMLText.isPrototypeOf(Sender)) {
          I = this.FControls$1.IndexOf(rtl.as(rtl.as(Sender,pas["WEBLib.Controls"].TControl).FParent,pas["WEBLib.Controls"].TControl))}
         else I = this.FControls$1.IndexOf(rtl.as(Sender,pas["WEBLib.Controls"].TControl));
        if (this.GetRadioContainer(I) != null) {
          if (this.GetRadioContainer(I).FRadioButton.FEnabled) {
            this.SetItemIndex(I);
            if (this.GetRadioContainer(I) != null) this.GetRadioContainer(I).FRadioButton.SetFocus();
            this.DoRadioButtonClick(I);
          };
        };
        this.NotifyDataBinderEdit();
        this.NotifyDataBinderValueChanged();
      };
      this.Click();
    };
    this.ControlEnter = function (Sender) {
      this.DoEnter();
    };
    this.ControlExit = function (Sender) {
      this.DoExit();
    };
    this.ControlDblClick = function (Sender) {
      var I = 0;
      if (!this.FIsUpdatingControl) {
        if (pas["WEBLib.StdCtrls"].TRadioButton.isPrototypeOf(Sender) || $mod.TTMSFNCRadioHTMLText.isPrototypeOf(Sender)) {
          I = this.FControls$1.IndexOf(rtl.as(rtl.as(Sender,pas["WEBLib.Controls"].TControl).FParent,pas["WEBLib.Controls"].TControl))}
         else I = this.FControls$1.IndexOf(rtl.as(Sender,pas["WEBLib.Controls"].TControl));
        if (this.GetRadioContainer(I) != null) {
          if (this.GetRadioContainer(I).FRadioButton.FEnabled) {
            this.SetItemIndex(I);
            if (this.GetRadioContainer(I) != null) this.GetRadioContainer(I).FRadioButton.SetFocus();
            if (this.FOnRadioButtonDblClick != null) this.FOnRadioButtonDblClick(this,this.FItemIndex);
          };
        };
      };
      this.DblClick();
    };
    this.AnchorClick = function (Sender, AAnchor) {
      var I = 0;
      if (pas["WEBLib.StdCtrls"].TRadioButton.isPrototypeOf(Sender) || $mod.TTMSFNCRadioHTMLText.isPrototypeOf(Sender)) {
        I = this.FControls$1.IndexOf(rtl.as(rtl.as(Sender,pas["WEBLib.Controls"].TControl).FParent,pas["WEBLib.Controls"].TControl))}
       else I = this.FControls$1.IndexOf(rtl.as(Sender,pas["WEBLib.Controls"].TControl));
      this.DoRadioButtonAnchorClick(I,AAnchor);
    };
    this.ArrangeControls = function () {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      pas["WEBLib.TMSFNCCustomGroup"].TTMSFNCCustomGroup.ArrangeControls.call(this);
      if (this.FTitleCheckBox != null) {
        this.FTitleCheckBox.SetVisible(this.GetTitle().FShowCheckBox);
        if (this.FTitleCheckBox.FVisible) {
          this.FTitleCheckBox.SetParent(this);
          r.$assign(this.GetTitleDrawRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.GetLocalRect())));
          this.FTitleCheckBox.SetLeft(Math.round(r.Left - this.FTitleCheckBox.GetWidth()));
          this.FTitleCheckBox.SetTop(Math.round(r.Top + ((r.Bottom - r.Top - this.FTitleCheckBox.GetHeight()) / 2)));
        } else this.FTitleCheckBox.SetParent(null);
      };
    };
    this.ItemsChanged = function () {
      if (this.FItemIndex >= this.FItems.GetCount()) this.FItemIndex = this.FItems.GetCount() - 1;
    };
    this.UpdateItemIndexControl = function () {
      if (this.FItemIndex >= 0) this.SetControlCheckState(this.GetControl(this.FItemIndex),true);
    };
    this.SetControlText = function (AControl, AIndex, AText) {
      pas["WEBLib.TMSFNCCustomGroup"].TTMSFNCCustomGroup.SetControlText.apply(this,arguments);
      if ((AControl != null) && $mod.TTMSFNCRadioContainer.isPrototypeOf(AControl)) rtl.as(AControl,$mod.TTMSFNCRadioContainer).FHTMLText.SetText(AText);
    };
    this.SetControlCheckState = function (AControl, ACheckState) {
      var evnt = null;
      if ((AControl != null) && $mod.TTMSFNCRadioContainer.isPrototypeOf(AControl)) {
        evnt = rtl.as(AControl,$mod.TTMSFNCRadioContainer).FRadioButton.FOnClick;
        rtl.as(AControl,$mod.TTMSFNCRadioContainer).FRadioButton.FOnClick = null;
        rtl.as(AControl,$mod.TTMSFNCRadioContainer).FRadioButton.SetChecked(ACheckState);
        rtl.as(AControl,$mod.TTMSFNCRadioContainer).FRadioButton.FOnClick = evnt;
        if (ACheckState && !this.FRadioTabStop) rtl.as(AControl,$mod.TTMSFNCRadioContainer).FRadioButton.SetTabStop(false);
      };
    };
    this.SetControlProperties = function (AControl, AIndex) {
      pas["WEBLib.TMSFNCCustomGroup"].TTMSFNCCustomGroup.SetControlProperties.apply(this,arguments);
      if ((AControl != null) && $mod.TTMSFNCRadioContainer.isPrototypeOf(AControl)) {
        rtl.as(AControl,$mod.TTMSFNCRadioContainer).FRadioButton.FOnClick = rtl.createCallback(this,"ControlClick");
        rtl.as(AControl,$mod.TTMSFNCRadioContainer).FRadioButton.FOnEnter = rtl.createCallback(this,"ControlEnter");
        rtl.as(AControl,$mod.TTMSFNCRadioContainer).FRadioButton.FOnExit = rtl.createCallback(this,"ControlExit");
        rtl.as(AControl,$mod.TTMSFNCRadioContainer).FHTMLText.FOnClick = rtl.createCallback(this,"ControlClick");
        rtl.as(AControl,$mod.TTMSFNCRadioContainer).FHTMLText.FOnDblClick = rtl.createCallback(this,"ControlDblClick");
        rtl.as(AControl,$mod.TTMSFNCRadioContainer).FHTMLText.FOnAnchorClick = rtl.createCallback(this,"AnchorClick");
        rtl.as(AControl,$mod.TTMSFNCRadioContainer).FHTMLText.FOnEnter = rtl.createCallback(this,"ControlEnter");
        rtl.as(AControl,$mod.TTMSFNCRadioContainer).FHTMLText.FOnExit = rtl.createCallback(this,"ControlExit");
        rtl.as(AControl,$mod.TTMSFNCRadioContainer).FOnClick = rtl.createCallback(this,"ControlClick");
        rtl.as(AControl,$mod.TTMSFNCRadioContainer).FOnEnter = rtl.createCallback(this,"ControlEnter");
        rtl.as(AControl,$mod.TTMSFNCRadioContainer).FOnExit = rtl.createCallback(this,"ControlExit");
        rtl.as(AControl,$mod.TTMSFNCRadioContainer).FOnDblClick = rtl.createCallback(this,"ControlDblClick");
        rtl.as(AControl,$mod.TTMSFNCRadioContainer).FHTMLText.FFont$1.Assign(this.FFont$1);
      };
    };
    this.UpdateControlProperties = function (AControl, AIndex) {
      pas["WEBLib.TMSFNCCustomGroup"].TTMSFNCCustomGroup.UpdateControlProperties.apply(this,arguments);
      if ((AControl != null) && $mod.TTMSFNCRadioContainer.isPrototypeOf(AControl)) {
        rtl.as(AControl,$mod.TTMSFNCRadioContainer).FHTMLText.FFont$1.Assign(this.FFont$1);
        rtl.as(AControl,$mod.TTMSFNCRadioContainer).FHTMLText.SetBitmapContainer(this.GetBitmapContainer());
      };
    };
    this.TitleCheckBoxChange = function (Sender) {
      if (this.GetTitle().FShowCheckBox) {
        var $tmp = this.GetTitle().FCheckBoxMode;
        if ($tmp === $mod.TTMSFNCRadioGroupTitleCheckBoxMode.rgtcmToggleEnabled) {
          this.ArrangeControls();
          this.Invalidate();
        };
        if (this.FOnTitleCheckBoxClick != null) this.FOnTitleCheckBoxClick(this);
      };
    };
    this.CreateAdditionalControls = function () {
      pas["WEBLib.TMSFNCCustomGroup"].TTMSFNCCustomGroup.CreateAdditionalControls.call(this);
      this.FTitleCheckBox = pas["WEBLib.StdCtrls"].TCheckBox.$create("Create$1",[this]);
      this.FTitleCheckBox.SetVisible(false);
      this.FTitleCheckBox.SetWidth(this.FTitleCheckBox.GetHeight());
      this.FTitleCheckBox.SetCaption("");
      this.FTitleCheckBox.SetChecked(true);
      this.FTitleCheckBox.FOnClick = rtl.createCallback(this,"TitleCheckBoxChange");
    };
    this.SetControlEnabled = function (AControl, AIndex) {
      pas["WEBLib.TMSFNCCustomGroup"].TTMSFNCCustomGroup.SetControlEnabled.apply(this,arguments);
      if ((AControl != null) && this.GetTitle().FShowCheckBox && (this.GetTitle().FCheckBoxMode === $mod.TTMSFNCRadioGroupTitleCheckBoxMode.rgtcmToggleEnabled)) AControl.SetEnabled(this.GetTitle().GetChecked());
      if ($mod.TTMSFNCRadioContainer.isPrototypeOf(AControl)) {
        rtl.as(AControl,$mod.TTMSFNCRadioContainer).FHTMLText.SetEnabled(this.FEnabled);
        rtl.as(AControl,$mod.TTMSFNCRadioContainer).FRadioButton.SetEnabled(this.FEnabled);
      };
    };
    this.SetControlName = function (AControl, AIndex) {
      pas["WEBLib.TMSFNCCustomGroup"].TTMSFNCCustomGroup.SetControlName.apply(this,arguments);
      if ((AControl != null) && $mod.TTMSFNCRadioContainer.isPrototypeOf(AControl)) ;
    };
    this.DoSetTitleCheckState = function (Sender, ACheckState) {
      var evnt = null;
      if (this.FTitleCheckBox != null) {
        evnt = this.FTitleCheckBox.FOnClick;
        this.FTitleCheckBox.FOnClick = null;
        this.FTitleCheckBox.SetChecked(ACheckState);
        this.FTitleCheckBox.FOnClick = evnt;
      };
    };
    this.DoGetTitleCheckState = function (Sender, ACheckState) {
      if (this.FTitleCheckBox != null) {
        ACheckState.set(this.FTitleCheckBox.GetChecked());
      };
    };
    this.InitializeProperties = function () {
      pas["WEBLib.TMSFNCCustomGroup"].TTMSFNCCustomGroup.InitializeProperties.call(this);
      this.FItemIndex = -1;
    };
    this.CanDrawTitle = function () {
      var Result = false;
      Result = pas["WEBLib.TMSFNCCustomGroup"].TTMSFNCCustomGroup.CanDrawTitle.call(this);
      Result = Result || this.GetTitle().FShowCheckBox;
      return Result;
    };
    this.CreateGroupTitle = function () {
      var Result = null;
      Result = $mod.TTMSFNCRadioGroupTitle.$create("Create$1");
      rtl.as(Result,$mod.TTMSFNCRadioGroupTitle).FOnSetCheckState = rtl.createCallback(this,"DoSetTitleCheckState");
      rtl.as(Result,$mod.TTMSFNCRadioGroupTitle).FOnGetCheckState = rtl.createCallback(this,"DoGetTitleCheckState");
      return Result;
    };
    this.GetTitleRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(pas["WEBLib.TMSFNCCustomGroup"].TTMSFNCCustomGroup.GetTitleRect.call(this));
      if (!this.GetTitle().FShowCheckBox) return Result;
      Result.Right = Result.Right + this.FTitleCheckBox.GetWidth();
      if ((this.FTitleCheckBox.GetHeight() + 4) > (Result.Bottom - Result.Top)) Result.Bottom = Result.Top + this.FTitleCheckBox.GetHeight() + 4;
      return Result;
    };
    this.GetTitleDrawRect = function (ARect) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(pas["WEBLib.TMSFNCCustomGroup"].TTMSFNCCustomGroup.GetTitleDrawRect.call(this,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect)));
      if (!this.GetTitle().FShowCheckBox) return Result;
      Result.Left = Result.Left + this.FTitleCheckBox.GetWidth() + 4;
      return Result;
    };
    this.GetControlText = function (AControl, AIndex) {
      var Result = "";
      Result = pas["WEBLib.TMSFNCCustomGroup"].TTMSFNCCustomGroup.GetControlText.call(this,AControl,AIndex);
      if ((AControl != null) && $mod.TTMSFNCRadioContainer.isPrototypeOf(AControl)) Result = rtl.as(AControl,$mod.TTMSFNCRadioContainer).FHTMLText.FText;
      return Result;
    };
    this.GetControlClass = function (AIndex) {
      var Result = null;
      Result = $mod.TTMSFNCRadioContainer;
      return Result;
    };
    this.GetControlCheckState = function (AControl) {
      var Result = false;
      Result = false;
      if ((AControl != null) && $mod.TTMSFNCRadioContainer.isPrototypeOf(AControl)) {
        Result = rtl.as(AControl,$mod.TTMSFNCRadioContainer).FRadioButton.GetChecked();
      };
      return Result;
    };
    this.HandleMouseUp = function (Button, Shift, X, Y) {
      var a = "";
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseUp.apply(this,arguments);
      a = this.XYtoTitleAnchor(X,Y);
      if (a !== "") this.DoTitleAnchorClick(a);
    };
    this.HandleMouseMove = function (Shift, X, Y) {
      var a = "";
      a = this.XYtoTitleAnchor(X,Y);
      if (a !== "") {
        this.SetControlCursor(21)}
       else this.SetControlCursor(0);
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseMove.apply(this,arguments);
    };
    this.XYtoTitleAnchor = function (AX, AY) {
      var Result = "";
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var g = null;
      Result = "";
      r.$assign(this.GetTitleDrawRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.GetTitleRect())));
      g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[1,1,false,true]);
      g.BeginScene();
      g.FBitmapContainer = this.GetBitmapContainer();
      try {
        g.FFont.Assign(this.GetTitle().FFont);
        Result = g.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.GetTitle().FText,false,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,true,true,AX,AY);
      } finally {
        g.EndScene();
        g = rtl.freeLoc(g);
      };
      return Result;
    };
    this.DoTitleAnchorClick = function (AAnchor) {
      if (this.FOnTitleAnchorClick != null) {
        this.FOnTitleAnchorClick(this,AAnchor)}
       else pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.OpenURL(AAnchor);
    };
    this.DoRadioButtonAnchorClick = function (AItemIndex, AAnchor) {
      if (this.FOnRadioButtonAnchorClick != null) {
        this.FOnRadioButtonAnchorClick(this,AItemIndex,AAnchor)}
       else pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.OpenURL(AAnchor);
    };
    this.Loaded = function () {
      pas["WEBLib.TMSFNCCustomGroup"].TTMSFNCCustomGroup.Loaded.call(this);
    };
    this.Destroy = function () {
      if (this.FTitleCheckBox != null) rtl.free(this,"FTitleCheckBox");
      pas["WEBLib.TMSFNCCustomGroup"].TTMSFNCCustomGroup.Destroy.call(this);
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomGroup"].TTMSFNCCustomGroup.Create$1.apply(this,arguments);
      this.FRadioTabStop = true;
      return this;
    };
    this.Assign = function (Source) {
      pas["WEBLib.TMSFNCCustomGroup"].TTMSFNCCustomGroup.Assign.apply(this,arguments);
      if ($mod.TTMSFNCRadioGroup.isPrototypeOf(Source)) this.FItemIndex = rtl.as(Source,$mod.TTMSFNCRadioGroup).FItemIndex;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("RadioTabStop",2,rtl.boolean,"FRadioTabStop","SetRadioTabStop",4,{Default: true});
    $r.addProperty("BitmapContainer",3,pas["WEBLib.TMSFNCBitmapContainer"].$rtti["TTMSFNCBitmapContainer"],"GetBitmapContainer","SetBitmapContainer");
  });
  rtl.createClass(this,"TTMSFNCRadioGroup",this.TTMSFNCCustomRadioGroup,function () {
    this.RegisterRuntimeClasses = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClass($mod.TTMSFNCRadioGroup);
    };
    this.GetVersion = function () {
      var Result = "";
      Result = this.$class.GetVersionNumber(1,0,3,3);
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("RadioTabStop",2,rtl.boolean,"FRadioTabStop","SetRadioTabStop",4,{Default: true});
    $r.addProperty("BitmapContainer",3,pas["WEBLib.TMSFNCBitmapContainer"].$rtti["TTMSFNCBitmapContainer"],"GetBitmapContainer","SetBitmapContainer");
    $r.addProperty("Version",1,rtl.string,"GetVersion","");
    $r.addProperty("Items",2,pas.Classes.$rtti["TStrings"],"FItems","SetItems");
    $r.addProperty("Font",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FFont$1","SetFnt");
    $r.addProperty("Columns",2,rtl.longint,"FColumns","SetColumns",4,{Default: 1});
    $r.addProperty("Fill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFill","SetFill");
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
    $r.addProperty("ItemIndex",2,rtl.longint,"FItemIndex","SetItemIndex",4,{Default: -1});
    $r.addProperty("Title",3,$mod.$rtti["TTMSFNCRadioGroupTitle"],"GetTitle","SetTitle$1");
    $r.addProperty("OnTitleCheckBoxClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnTitleCheckBoxClick","FOnTitleCheckBoxClick");
    $r.addProperty("OnRadioButtonClick",0,$mod.$rtti["TTMSFNCRadioGroupClickEvent"],"FOnRadioButtonClick","FOnRadioButtonClick");
    $r.addProperty("OnRadioButtonDblClick",0,$mod.$rtti["TTMSFNCRadioGroupClickEvent"],"FOnRadioButtonDblClick","FOnRadioButtonDblClick");
    $r.addProperty("OnTitleAnchorClick",0,$mod.$rtti["TTMSFNCRadioGroupTitleAnchorClickEvent"],"FOnTitleAnchorClick","FOnTitleAnchorClick");
    $r.addProperty("OnRadioButtonAnchorClick",0,$mod.$rtti["TTMSFNCRadioGroupItemAnchorClickEvent"],"FOnRadioButtonAnchorClick","FOnRadioButtonAnchorClick");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
},["WEBLib.TMSFNCUtils","WEBLib.TMSFNCGraphics"]);
rtl.module("WEBLib.TMSFNCDataGridBase",["System","Classes","WEBLib.TMSFNCCustomControl","WEBLib.Controls","WEBLib.TMSFNCDataGridRenderer","WEBLib.TMSFNCDataGridData","WEBLib.TMSFNCDataGridCore","WEBLib.TMSFNCTypes","Types","Generics.Collections","SysUtils"],function () {
  "use strict";
  var $mod = this;
  this.$rtti.$Class("TTMSFNCDataGridBase");
  rtl.createClass(this,"TTMSFNCDataGridBase",pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$init.call(this);
      this.FUpdateCount$1 = 0;
      this.FRoot = null;
      this.FRootPersistence = 0;
    };
    this.$final = function () {
      this.FRoot = undefined;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$final.call(this);
    };
    this.GetRoot = function () {
      var Result = null;
      if (!(this.FRoot != null)) {
        this.FRoot = this.GetRendererClass().$create("Create$3",[this]);
        this.FRoot.FName = "Root";
      };
      Result = this.FRoot;
      return Result;
    };
    this.GetCalculationRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(this.GetLocalRect());
      return Result;
    };
    this.GetRendererClass = function () {
      var Result = null;
      Result = pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridRenderer;
      return Result;
    };
    this.DoRootIsDestroying = function (Sender) {
      var Result = false;
      Result = this.IsDestroying();
      return Result;
    };
    this.DoRootIsLoading = function (Sender) {
      var Result = false;
      Result = this.IsLoading();
      return Result;
    };
    this.DoRootIsFocused = function (Sender) {
      var Result = false;
      Result = this.IsFocused();
      return Result;
    };
    this.DoRootIsDesigntime = function (Sender) {
      var Result = false;
      Result = this.IsDesignTime();
      return Result;
    };
    this.AfterExport = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.AfterExport.call(this);
      this.GetRoot().AfterExport();
    };
    this.BeforeExport = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.BeforeExport.call(this);
      this.GetRoot().BeforeExport();
    };
    this.SetExportRect = function (ARect) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.SetExportRect.apply(this,arguments);
      this.GetRoot().SetExportRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect));
    };
    this.ApplyExportScale = function (AScale) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ApplyExportScale.apply(this,arguments);
      this.GetRoot().ApplyExportScale(AScale);
    };
    this.ResetExportScale = function () {
      this.GetRoot().ResetExportScale();
    };
    this.DoRootDisplay = function (Sender) {
      this.InvalidateGrid();
    };
    this.DoRootResetCapture = function (Sender) {
      this.ReleaseCaptureEx();
    };
    this.DoRootFocus = function (Sender) {
    };
    this.DoRootAfterCalculate = function (Sender) {
    };
    this.DoRootBeforeCalculate = function (Sender) {
    };
    this.DoRootUpdateCursor = function (Sender, ACursor) {
    };
    this.Loaded = function () {
      pas["WEBLib.Controls"].TCustomControl.Loaded.call(this);
      this.UpdateRoot();
    };
    this.InvalidateGrid = function () {
      this.Invalidate();
    };
    this.UpdateControlAfterResize = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.UpdateControlAfterResize.call(this);
      this.UpdateRoot();
    };
    this.UpdateRoot = function () {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.$assign(this.GetCalculationRect());
      this.GetRoot().SetLocalRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r));
      this.GetRoot().Update();
    };
    this.ExportNotification = function (AState, ARow) {
      this.GetRoot().ExportNotification(AState,ARow);
    };
    this.ImportNotification = function (AState, ARow) {
      this.GetRoot().ImportNotification(AState,ARow);
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Create$1.apply(this,arguments);
      this.FRootPersistence = 0;
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FRoot;
        }, set: function (v) {
          this.p.FRoot = v;
        }});
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Destroy.call(this);
    };
    this.BeginUpdate = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBase.BeginUpdate.call(this);
      this.GetRoot().BeginUpdate();
      this.FUpdateCount$1 += 1;
    };
    this.Clear = function () {
      this.GetRoot().Clear();
    };
    this.ClearData = function () {
      this.GetRoot().ClearData();
    };
    this.RefreshData = function (ACell, AUpdate) {
      this.GetRoot().RefreshData(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AUpdate);
    };
    this.RefreshData$1 = function (ACellRange, AUpdate) {
      this.GetRoot().RefreshData$1(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoordRange.$clone(ACellRange),AUpdate);
    };
    this.RefreshData$2 = function (AUpdate) {
      this.GetRoot().RefreshData$2(AUpdate);
    };
    this.EndUpdate = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBase.EndUpdate.call(this);
      this.FUpdateCount$1 -= 1;
      this.GetRoot().EndUpdate();
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
},["DateUtils","WEBLib.TMSFNCDataGridCell","WEBLib.Forms","Math","WEBLib.TMSFNCUtils"]);
rtl.module("WEBLib.TMSFNCDataGrid",["System","Classes","SysUtils","Types","TMS.TMSFNCFilterBuilder","WEBLib.TMSFNCPersistence","WEBLib.TMSFNCJSONReader","WEBLib.TMSFNCJSONWriter","WEBLib.TMSFNCDataBinding","WEBLib.TMSFNCToolBar","WEBLib.TMSFNCRadioGroup","WEBLib.TMSFNCPopup","WEBLib.TMSFNCCustomControl","WEBLib.TMSFNCDataGridCell","WEBLib.TMSFNCDataGridRenderer","WEBLib.TMSFNCDataGridData","WEBLib.TMSFNCDataGridColumnsEditor","WEBLib.Graphics","WEBLib.TMSFNCBitmapContainer","WEBLib.TMSFNCGraphics","WEBLib.StdCtrls","WEBLib.TMSFNCScrollBar","WEBLib.TMSFNCDataGridCore","WEBLib.TMSFNCDataGridBase","WEBLib.ExtCtrls","WEBLib.TMSFNCHTMLText","WEBLib.TMSFNCButton","WEBLib.Menus","WEBLib.Controls","WEBLib.Forms","WEBLib.TMSFNCTypes","WEBLib.TMSFNCCustomComponent","WEBLib.TMSFNCGraphicsTypes","Generics.Collections","RTTI","Generics.Defaults"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.TTMSFNCDataGridDocURL = pas["WEBLib.TMSFNCTypes"].TTMSFNCBaseDocURL + "tmsfncuipack/components/ttmsfncdatagrid/";
  this.SCROLLINGDELAY = 0;
  this.MAJ_VER = 1;
  this.MIN_VER = 8;
  this.REL_VER = 0;
  this.BLD_VER = 2;
  this.$rtti.$Class("TTMSFNCCustomDataGrid");
  this.TTMSFNCDataGridKeyboardMode = {"0": "gkmDefault", gkmDefault: 0, "1": "gkmGrid", gkmGrid: 1};
  this.$rtti.$Enum("TTMSFNCDataGridKeyboardMode",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCDataGridKeyboardMode});
  rtl.createClass(this,"TTMSFNCDataGridButton",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FName = "";
      this.FOnClick = null;
      this.FHint = "";
      this.FWidth = 0.0;
      this.FButton = null;
      this.FBitmap = null;
      this.FText = "";
      this.FEnabled = false;
      this.FVisible = false;
      this.FControl = null;
      this.FDataPointer = null;
      this.FDataBoolean = false;
      this.FDataString = "";
      this.FDataObject = null;
      this.FDataInteger = 0;
      this.FCallback = null;
    };
    this.$final = function () {
      this.FOnClick = undefined;
      this.FButton = undefined;
      this.FBitmap = undefined;
      this.FControl = undefined;
      this.FDataObject = undefined;
      this.FCallback = undefined;
      pas.Classes.TCollectionItem.$final.call(this);
    };
    this.IsHintStored = function () {
      var Result = false;
      Result = this.FHint !== "";
      return Result;
    };
    this.IsTextStored = function () {
      var Result = false;
      Result = this.FText !== "";
      return Result;
    };
    this.IsWidthStored = function () {
      var Result = false;
      Result = this.FWidth !== 30;
      return Result;
    };
    this.SetBitmap = function (Value) {
      if (this.FBitmap !== Value) this.FBitmap.Assign(Value);
    };
    this.SetWidth = function (Value) {
      if (this.FWidth !== Value) {
        this.FWidth = Value;
        this.DoChanged();
      };
    };
    this.SetHint = function (Value) {
      if (this.FHint !== Value) {
        this.FHint = Value;
        this.DoChanged();
      };
    };
    this.SetText = function (Value) {
      if (this.FText !== Value) {
        this.FText = Value;
        this.DoChanged();
      };
    };
    this.GetButton = function () {
      var Result = null;
      if (!(this.FButton != null)) {
        this.FButton = pas["WEBLib.TMSFNCToolBar"].TTMSFNCToolBarButton.$create("Create$1",[null]);
        this.FButton.FStored = false;
        this.FButton.FAppearance.SetFlatStyle(true);
        this.FButton.SetText("");
        this.FButton.FAppearance.FNormalFill.SetColor(16777215);
        this.FButton.FAppearance.FNormalStroke.SetColor(16777215);
        this.FButton.SetShowHint(true);
      };
      Result = this.FButton;
      return Result;
    };
    this.SetEnabled = function (Value) {
      if (this.FEnabled !== Value) {
        this.FEnabled = Value;
        this.DoChanged();
      };
    };
    this.SetVisible = function (Value) {
      if (this.FVisible !== Value) {
        this.FVisible = Value;
        this.DoChanged();
      };
    };
    this.SetControl = function (Value) {
      if (Value === null) {
        if (this.FControl != null) this.FControl.SetVisible(true);
      };
      this.FControl = Value;
      if (this.FControl != null) {
        pas.SysUtils.FreeAndNil({p: this, get: function () {
            return this.p.FButton;
          }, set: function (v) {
            this.p.FButton = v;
          }});
        this.FControl.SetVisible(false);
        this.SetWidth(this.FControl.GetWidth());
      };
    };
    this.DoChanged = function () {
      if ($mod.TTMSFNCDataGridButtons.isPrototypeOf(this.FCollection)) rtl.as(this.FCollection,$mod.TTMSFNCDataGridButtons).DoChanged();
    };
    this.DoBitmapChanged = function (Sender) {
      this.DoChanged();
    };
    this.Create$1 = function (ACollection) {
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      this.FName = "Button" + pas.SysUtils.IntToStr(this.FCollection.GetCount());
      this.FBitmap = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      this.FBitmap.FOnChange = rtl.createCallback(this,"DoBitmapChanged");
      this.FHint = "";
      this.FText = "";
      this.FEnabled = true;
      this.FVisible = true;
      this.FWidth = 30;
      return this;
    };
    this.Destroy = function () {
      this.FControl = null;
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FBitmap;
        }, set: function (v) {
          this.p.FBitmap = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FButton;
        }, set: function (v) {
          this.p.FButton = v;
        }});
      pas.Classes.TCollectionItem.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridButton.isPrototypeOf(Source)) {
        this.FName = rtl.as(Source,$mod.TTMSFNCDataGridButton).FName;
        this.FHint = rtl.as(Source,$mod.TTMSFNCDataGridButton).FHint;
        this.FText = rtl.as(Source,$mod.TTMSFNCDataGridButton).FText;
        this.FBitmap.Assign(rtl.as(Source,$mod.TTMSFNCDataGridButton).FBitmap);
        this.FWidth = rtl.as(Source,$mod.TTMSFNCDataGridButton).FWidth;
        this.FEnabled = rtl.as(Source,$mod.TTMSFNCDataGridButton).FEnabled;
        this.FVisible = rtl.as(Source,$mod.TTMSFNCDataGridButton).FVisible;
      };
    };
    this.GetDisplayName = function () {
      var Result = "";
      if (this.FName !== "") {
        Result = this.FName}
       else Result = "";
      return Result;
    };
    var $r = this.$rtti;
    $r.addProperty("Name",0,rtl.string,"FName","FName");
    $r.addProperty("Hint",14,rtl.string,"FHint","SetHint",4,{stored: "IsHintStored"});
    $r.addProperty("Text",14,rtl.string,"FText","SetText",4,{stored: "IsTextStored"});
    $r.addProperty("Bitmap",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FBitmap","SetBitmap");
    $r.addProperty("Width",14,rtl.double,"FWidth","SetWidth",4,{stored: "IsWidthStored"});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("Control",2,pas["WEBLib.Controls"].$rtti["TWinControl"],"FControl","SetControl");
  });
  rtl.createClass(this,"TTMSFNCDataGridButtons",pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$init.call(this);
      this.FOnChanged = null;
    };
    this.$final = function () {
      this.FOnChanged = undefined;
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$final.call(this);
    };
    this.GetItemEx = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItemEx = function (Index, Value) {
      pas.Classes.TCollection.SetItem.call(this,Index,Value);
    };
    this.DoChanged = function () {
      if (this.FOnChanged != null) this.FOnChanged(this);
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,index);
      return Result;
    };
  });
  rtl.createClass(this,"TTMSFNCDataGridHeaderFooterBar",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FOwner = null;
      this.FVisible = false;
      this.FOnChange = null;
      this.FOnChangeRebuild = null;
      this.FSize = 0;
      this.FFill = null;
      this.FStroke = null;
      this.FButtons = null;
    };
    this.$final = function () {
      this.FOwner = undefined;
      this.FOnChange = undefined;
      this.FOnChangeRebuild = undefined;
      this.FFill = undefined;
      this.FStroke = undefined;
      this.FButtons = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetVisible = function (Value) {
      if (this.FVisible !== Value) {
        this.FVisible = Value;
        if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
      };
    };
    this.SetSize = function (Value) {
      if (this.FSize !== Value) {
        this.FSize = Value;
        if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
      };
    };
    this.SetFill = function (Value) {
      if (this.FFill !== Value) this.FFill.Assign(Value);
    };
    this.SetStroke = function (Value) {
      if (this.FStroke !== Value) this.FStroke.Assign(Value);
    };
    this.SetButtons = function (Value) {
      if (this.FButtons !== Value) this.FButtons.Assign(Value);
    };
    this.GetOwner = function () {
      var Result = null;
      Result = this.FOwner;
      return Result;
    };
    this.DoFillChanged = function (Sender) {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.DoStrokeChanged = function (Sender) {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.DoButtonsChanged = function (Sender) {
      if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
    };
    this.Create$1 = function (AOwner) {
      this.FOwner = AOwner;
      this.FButtons = $mod.TTMSFNCDataGridButtons.$create("Create$2",[this,$mod.TTMSFNCDataGridButton]);
      this.FButtons.FOnChanged = rtl.createCallback(this,"DoButtonsChanged");
      this.FVisible = false;
      this.FSize = 30;
      this.FFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16119285,8421504,-1,-1]);
      this.FStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,12632256,1.0]);
      this.FFill.FOnChanged = rtl.createCallback(this,"DoFillChanged");
      this.FStroke.FOnChanged = rtl.createCallback(this,"DoStrokeChanged");
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridHeaderFooterBar.isPrototypeOf(Source)) {
        this.FVisible = rtl.as(Source,$mod.TTMSFNCDataGridHeaderFooterBar).FVisible;
        this.FFill.Assign(rtl.as(Source,$mod.TTMSFNCDataGridHeaderFooterBar).FFill);
        this.FStroke.Assign(rtl.as(Source,$mod.TTMSFNCDataGridHeaderFooterBar).FStroke);
        this.FSize = rtl.as(Source,$mod.TTMSFNCDataGridHeaderFooterBar).FSize;
        this.FButtons.Assign(rtl.as(Source,$mod.TTMSFNCDataGridHeaderFooterBar).FButtons);
      };
    };
    this.Destroy = function () {
      rtl.free(this,"FButtons");
      rtl.free(this,"FStroke");
      rtl.free(this,"FFill");
      pas.System.TObject.Destroy.call(this);
    };
    var $r = this.$rtti;
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: false});
    $r.addProperty("Size",2,rtl.longint,"FSize","SetSize",4,{Default: 30});
    $r.addProperty("Fill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFill","SetFill");
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
    $r.addProperty("Buttons",2,$mod.$rtti["TTMSFNCDataGridButtons"],"FButtons","SetButtons");
  });
  rtl.createClass(this,"TTMSFNCDataGridHeaderFooter",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FOwner = null;
      this.FVisible = false;
      this.FOnChangeRebuild = null;
      this.FSize = 0;
      this.FFill = null;
      this.FStroke = null;
      this.FOnChange = null;
      this.FAutoSize = false;
      this.FBar = null;
    };
    this.$final = function () {
      this.FOwner = undefined;
      this.FOnChangeRebuild = undefined;
      this.FFill = undefined;
      this.FStroke = undefined;
      this.FOnChange = undefined;
      this.FBar = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetSize = function (Value) {
      if (this.FSize !== Value) {
        this.FSize = Value;
        if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
      };
    };
    this.SetVisible = function (Value) {
      if (this.FVisible !== Value) {
        this.FVisible = Value;
        if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
      };
    };
    this.SetFill = function (Value) {
      this.FFill.Assign(Value);
    };
    this.SetStroke = function (Value) {
      this.FStroke.Assign(Value);
    };
    this.SetAutoSize = function (Value) {
      if (this.FAutoSize !== Value) {
        this.FAutoSize = Value;
        if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
      };
    };
    this.SetBar = function (Value) {
      this.FBar.Assign(Value);
    };
    this.GetOwner = function () {
      var Result = null;
      Result = this.FOwner;
      return Result;
    };
    this.DoBarChanged = function (Sender) {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.DoBarChangedRebuild = function (Sender) {
      if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
    };
    this.DoFillChanged = function (Sender) {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.DoStrokeChanged = function (Sender) {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Create$1 = function (AOwner) {
      this.FOwner = AOwner;
      this.FSize = 30;
      this.FVisible = false;
      this.FFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16777215,8421504,-1,-1]);
      this.FFill.FOnChanged = rtl.createCallback(this,"DoFillChanged");
      this.FStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,12632256,1.0]);
      this.FStroke.FOnChanged = rtl.createCallback(this,"DoStrokeChanged");
      this.FAutoSize = true;
      this.FBar = $mod.TTMSFNCDataGridHeaderFooterBar.$create("Create$1",[this]);
      this.FBar.FOnChange = rtl.createCallback(this,"DoBarChanged");
      this.FBar.FOnChangeRebuild = rtl.createCallback(this,"DoBarChangedRebuild");
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridHeaderFooter.isPrototypeOf(Source)) {
        this.FVisible = rtl.as(Source,$mod.TTMSFNCDataGridHeaderFooter).FVisible;
        this.FSize = rtl.as(Source,$mod.TTMSFNCDataGridHeaderFooter).FSize;
        this.FFill.Assign(rtl.as(Source,$mod.TTMSFNCDataGridHeaderFooter).FFill);
        this.FStroke.Assign(rtl.as(Source,$mod.TTMSFNCDataGridHeaderFooter).FStroke);
        this.FAutoSize = rtl.as(Source,$mod.TTMSFNCDataGridHeaderFooter).FAutoSize;
        this.FBar.Assign(rtl.as(Source,$mod.TTMSFNCDataGridHeaderFooter).FBar);
      };
    };
    this.Destroy = function () {
      rtl.free(this,"FBar");
      rtl.free(this,"FStroke");
      rtl.free(this,"FFill");
      pas.System.TObject.Destroy.call(this);
    };
  });
  rtl.createClass(this,"TTMSFNCDataGridHeaderVisualGroupingLayout",pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellLayout,function () {
    this.GetTextAlign = function () {
      var Result = 0;
      Result = this.FTextAlign;
      return Result;
    };
    this.SetTextAlign$1 = function (Value) {
      this.SetTextAlign(Value);
    };
    this.Create$1 = function (ADefaultFillColor) {
      pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellLayout.Create$1.call(this,ADefaultFillColor);
      this.SetTextAlign(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter);
      return this;
    };
    var $r = this.$rtti;
    $r.addProperty("TextAlign",3,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"GetTextAlign","SetTextAlign$1",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter});
  });
  rtl.createClass(this,"TTMSFNCDataGridHeaderVisualGrouping",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FVisible = false;
      this.FOnChange = null;
      this.FOnChangeRebuild = null;
      this.FSortOnClick = false;
      this.FCloseIndicator = false;
      this.FConnectionLines = false;
      this.FLayout = null;
      this.FConnectionStroke = null;
      this.FAutoSize = false;
      this.FSize = 0;
      this.FLevelIndicationFill = null;
      this.FLevelActiveIndicationStroke = null;
      this.FLevelIndicationStroke = null;
      this.FLevelActiveIndicationFill = null;
      this.FDragging = false;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      this.FOnChangeRebuild = undefined;
      this.FLayout = undefined;
      this.FConnectionStroke = undefined;
      this.FLevelIndicationFill = undefined;
      this.FLevelActiveIndicationStroke = undefined;
      this.FLevelIndicationStroke = undefined;
      this.FLevelActiveIndicationFill = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetVisible = function (Value) {
      if (this.FVisible !== Value) {
        this.FVisible = Value;
        if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
      };
    };
    this.SetCloseIndicator = function (Value) {
      if (this.FCloseIndicator !== Value) {
        this.FCloseIndicator = Value;
        if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
      };
    };
    this.SetConnectionLines = function (Value) {
      if (this.FConnectionLines !== Value) {
        this.FConnectionLines = Value;
        if (this.FOnChange != null) this.FOnChange(this);
      };
    };
    this.SetLayout = function (Value) {
      if (this.FLayout !== Value) this.FLayout.Assign(Value);
    };
    this.SetConnectionStroke = function (Value) {
      if (this.FConnectionStroke !== Value) this.FConnectionStroke.Assign(Value);
    };
    this.SetAutoSize = function (Value) {
      if (this.FAutoSize !== Value) {
        this.FAutoSize = Value;
        if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
      };
    };
    this.SetSize = function (Value) {
      if (this.FSize !== Value) {
        this.FSize = Value;
        if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
      };
    };
    this.SetLevelActiveIndicationFill = function (Value) {
      if (this.FLevelActiveIndicationFill !== Value) this.FLevelActiveIndicationFill.Assign(Value);
    };
    this.SetLevelActiveIndicationStroke = function (Value) {
      if (this.FLevelActiveIndicationStroke !== Value) this.FLevelActiveIndicationStroke.Assign(Value);
    };
    this.SetLevelIndicationFill = function (Value) {
      if (this.FLevelIndicationFill !== Value) this.FLevelIndicationFill.Assign(Value);
    };
    this.SetLevelIndicationStroke = function (Value) {
      if (this.FLevelIndicationStroke !== Value) this.FLevelIndicationStroke.Assign(Value);
    };
    this.DoLayoutChanged = function (Sender) {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.DoConnectionStrokeChanged = function (Sender) {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.DoFillChanged = function (Sender) {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.DoStrokeChanged = function (Sender) {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Create$1 = function () {
      this.FVisible = true;
      this.FDragging = true;
      this.FSize = 30;
      this.FAutoSize = true;
      this.FSortOnClick = true;
      this.FCloseIndicator = true;
      this.FConnectionLines = true;
      this.FLayout = $mod.TTMSFNCDataGridHeaderVisualGroupingLayout.$create("Create$1",[16119285]);
      this.FLayout.FOnChange = rtl.createCallback(this,"DoLayoutChanged");
      this.FConnectionStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,12632256,1.0]);
      this.FConnectionStroke.FOnChanged = rtl.createCallback(this,"DoConnectionStrokeChanged");
      this.FLevelIndicationFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone,16777215,8421504,-1,-1]);
      this.FLevelIndicationFill.FOnChanged = rtl.createCallback(this,"DoFillChanged");
      this.FLevelIndicationStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskDash,13882323,1.0]);
      this.FLevelIndicationStroke.FOnChanged = rtl.createCallback(this,"DoStrokeChanged");
      this.FLevelActiveIndicationFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(16119285,20),8421504,-1,-1]);
      this.FLevelActiveIndicationFill.FOnChanged = rtl.createCallback(this,"DoFillChanged");
      this.FLevelActiveIndicationStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(16119285,20),1.0]);
      this.FLevelActiveIndicationStroke.FOnChanged = rtl.createCallback(this,"DoStrokeChanged");
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridHeaderVisualGrouping.isPrototypeOf(Source)) {
        this.FSize = rtl.as(Source,$mod.TTMSFNCDataGridHeaderVisualGrouping).FSize;
        this.FAutoSize = rtl.as(Source,$mod.TTMSFNCDataGridHeaderVisualGrouping).FAutoSize;
        this.FVisible = rtl.as(Source,$mod.TTMSFNCDataGridHeaderVisualGrouping).FVisible;
        this.FSortOnClick = rtl.as(Source,$mod.TTMSFNCDataGridHeaderVisualGrouping).FSortOnClick;
        this.FCloseIndicator = rtl.as(Source,$mod.TTMSFNCDataGridHeaderVisualGrouping).FCloseIndicator;
        this.FConnectionLines = rtl.as(Source,$mod.TTMSFNCDataGridHeaderVisualGrouping).FConnectionLines;
        this.FConnectionStroke.Assign(rtl.as(Source,$mod.TTMSFNCDataGridHeaderVisualGrouping).FConnectionStroke);
        this.FLayout.Assign(rtl.as(Source,$mod.TTMSFNCDataGridHeaderVisualGrouping).FLayout);
        this.FDragging = rtl.as(Source,$mod.TTMSFNCDataGridHeaderVisualGrouping).FDragging;
        this.FLevelIndicationFill.Assign(rtl.as(Source,$mod.TTMSFNCDataGridHeaderVisualGrouping).FLevelIndicationFill);
        this.FLevelIndicationStroke.Assign(rtl.as(Source,$mod.TTMSFNCDataGridHeaderVisualGrouping).FLevelIndicationStroke);
        this.FLevelActiveIndicationFill.Assign(rtl.as(Source,$mod.TTMSFNCDataGridHeaderVisualGrouping).FLevelActiveIndicationFill);
        this.FLevelActiveIndicationStroke.Assign(rtl.as(Source,$mod.TTMSFNCDataGridHeaderVisualGrouping).FLevelActiveIndicationStroke);
      };
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FLevelIndicationFill;
        }, set: function (v) {
          this.p.FLevelIndicationFill = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FLevelIndicationStroke;
        }, set: function (v) {
          this.p.FLevelIndicationStroke = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FLevelActiveIndicationFill;
        }, set: function (v) {
          this.p.FLevelActiveIndicationFill = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FLevelActiveIndicationStroke;
        }, set: function (v) {
          this.p.FLevelActiveIndicationStroke = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FLayout;
        }, set: function (v) {
          this.p.FLayout = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FConnectionStroke;
        }, set: function (v) {
          this.p.FConnectionStroke = v;
        }});
      pas.System.TObject.Destroy.call(this);
    };
    var $r = this.$rtti;
    $r.addProperty("AutoSize",2,rtl.boolean,"FAutoSize","SetAutoSize",4,{Default: true});
    $r.addProperty("Dragging",0,rtl.boolean,"FDragging","FDragging",4,{Default: true});
    $r.addProperty("Size",2,rtl.longint,"FSize","SetSize",4,{Default: 30});
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("SortOnClick",0,rtl.boolean,"FSortOnClick","FSortOnClick",4,{Default: true});
    $r.addProperty("CloseIndicator",2,rtl.boolean,"FCloseIndicator","SetCloseIndicator",4,{Default: true});
    $r.addProperty("ConnectionLines",2,rtl.boolean,"FConnectionLines","SetConnectionLines",4,{Default: true});
    $r.addProperty("ConnectionStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FConnectionStroke","SetConnectionStroke");
    $r.addProperty("Layout",2,$mod.$rtti["TTMSFNCDataGridHeaderVisualGroupingLayout"],"FLayout","SetLayout");
    $r.addProperty("LevelIndicationFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FLevelIndicationFill","SetLevelIndicationFill");
    $r.addProperty("LevelActiveIndicationFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FLevelActiveIndicationFill","SetLevelActiveIndicationFill");
    $r.addProperty("LevelIndicationStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FLevelIndicationStroke","SetLevelIndicationStroke");
    $r.addProperty("LevelActiveIndicationStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FLevelActiveIndicationStroke","SetLevelActiveIndicationStroke");
  });
  rtl.createClass(this,"TTMSFNCDataGridHeader",this.TTMSFNCDataGridHeaderFooter,function () {
    this.$init = function () {
      $mod.TTMSFNCDataGridHeaderFooter.$init.call(this);
      this.FVisualGrouping = null;
    };
    this.$final = function () {
      this.FVisualGrouping = undefined;
      $mod.TTMSFNCDataGridHeaderFooter.$final.call(this);
    };
    this.SetVisualGrouping = function (Value) {
      this.FVisualGrouping.Assign(Value);
    };
    this.DoVisualGroupingChanged = function (Sender) {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.DoVisualGroupingChangedRebuild = function (Sender) {
      if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
    };
    this.Create$1 = function (AOwner) {
      $mod.TTMSFNCDataGridHeaderFooter.Create$1.call(this,AOwner);
      this.FVisualGrouping = $mod.TTMSFNCDataGridHeaderVisualGrouping.$create("Create$1");
      this.FVisualGrouping.FOnChange = rtl.createCallback(this,"DoVisualGroupingChanged");
      this.FVisualGrouping.FOnChangeRebuild = rtl.createCallback(this,"DoVisualGroupingChangedRebuild");
      return this;
    };
    this.Assign = function (Source) {
      $mod.TTMSFNCDataGridHeaderFooter.Assign.apply(this,arguments);
      if ($mod.TTMSFNCDataGridHeader.isPrototypeOf(Source)) this.FVisualGrouping.Assign(rtl.as(Source,$mod.TTMSFNCDataGridHeader).FVisualGrouping);
    };
    this.Destroy = function () {
      rtl.free(this,"FVisualGrouping");
      $mod.TTMSFNCDataGridHeaderFooter.Destroy.call(this);
    };
    var $r = this.$rtti;
    $r.addProperty("VisualGrouping",2,$mod.$rtti["TTMSFNCDataGridHeaderVisualGrouping"],"FVisualGrouping","SetVisualGrouping");
    $r.addProperty("AutoSize",2,rtl.boolean,"FAutoSize","SetAutoSize",4,{Default: true});
    $r.addProperty("Size",2,rtl.longint,"FSize","SetSize",4,{Default: 30});
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: false});
    $r.addProperty("Fill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFill","SetFill");
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
    $r.addProperty("Bar",2,$mod.$rtti["TTMSFNCDataGridHeaderFooterBar"],"FBar","SetBar");
  });
  rtl.createClass(this,"TTMSFNCDataGridFooterPaging",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FVisible = false;
      this.FOnChange = null;
      this.FOnChangeRebuild = null;
      this.FSize = 0;
      this.FShowPageSelector = false;
      this.FShowPageInfo = false;
      this.FShowNavigationButtons = false;
      this.FPageSelectorWidth = 0;
      this.FNavigationButtonWidth = 0;
      this.FPageInfoWidth = 0;
      this.FPageInfoFormat = "";
      this.FPageSelectorFormat = "";
    };
    this.$final = function () {
      this.FOnChange = undefined;
      this.FOnChangeRebuild = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetVisible = function (Value) {
      if (this.FVisible !== Value) {
        this.FVisible = Value;
        if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
      };
    };
    this.SetSize = function (Value) {
      if (this.FSize !== Value) {
        this.FSize = Value;
        if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
      };
    };
    this.SetShowPageSelector = function (Value) {
      if (this.FShowPageSelector !== Value) {
        this.FShowPageSelector = Value;
        if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
      };
    };
    this.SetShowPageInfo = function (Value) {
      if (this.FShowPageInfo !== Value) {
        this.FShowPageInfo = Value;
        if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
      };
    };
    this.SetShowNavigationButtons = function (Value) {
      if (this.FShowNavigationButtons !== Value) {
        this.FShowNavigationButtons = Value;
        if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
      };
    };
    this.SetPageSelectorWidth = function (Value) {
      if (this.FPageSelectorWidth !== Value) {
        this.FPageSelectorWidth = Value;
        if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
      };
    };
    this.SetNavigationButtonWidth = function (Value) {
      if (this.FNavigationButtonWidth !== Value) {
        this.FNavigationButtonWidth = Value;
        if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
      };
    };
    this.SetPageInfoWidth = function (Value) {
      if (this.FPageInfoWidth !== Value) {
        this.FPageInfoWidth = Value;
        if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
      };
    };
    this.IsPageInfoFormatStored = function () {
      var Result = false;
      Result = this.FPageInfoFormat !== $impl.DefaultPageInfoFormat;
      return Result;
    };
    this.SetPageInfoFormat = function (Value) {
      this.FPageInfoFormat = Value;
    };
    this.IsPageSelectorFormatStored = function () {
      var Result = false;
      Result = this.FPageSelectorFormat !== $impl.DefaultPageSelectorFormat;
      return Result;
    };
    this.SetPageSelectorFormat = function (Value) {
      this.FPageSelectorFormat = Value;
    };
    this.DoFillChanged = function (Sender) {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.DoStrokeChanged = function (Sender) {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Create$1 = function () {
      this.FVisible = false;
      this.FSize = 30;
      this.FShowPageSelector = true;
      this.FShowPageInfo = true;
      this.FShowNavigationButtons = true;
      this.FPageSelectorWidth = 100;
      this.FNavigationButtonWidth = 25;
      this.FPageInfoWidth = 150;
      this.FPageInfoFormat = $impl.DefaultPageInfoFormat;
      this.FPageSelectorFormat = $impl.DefaultPageSelectorFormat;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridFooterPaging.isPrototypeOf(Source)) {
        this.FVisible = rtl.as(Source,$mod.TTMSFNCDataGridFooterPaging).FVisible;
        this.FSize = rtl.as(Source,$mod.TTMSFNCDataGridFooterPaging).FSize;
        this.FShowPageSelector = rtl.as(Source,$mod.TTMSFNCDataGridFooterPaging).FShowPageSelector;
        this.FShowPageInfo = rtl.as(Source,$mod.TTMSFNCDataGridFooterPaging).FShowPageInfo;
        this.FShowNavigationButtons = rtl.as(Source,$mod.TTMSFNCDataGridFooterPaging).FShowNavigationButtons;
        this.FPageSelectorWidth = rtl.as(Source,$mod.TTMSFNCDataGridFooterPaging).FPageSelectorWidth;
        this.FNavigationButtonWidth = rtl.as(Source,$mod.TTMSFNCDataGridFooterPaging).FNavigationButtonWidth;
        this.FPageInfoWidth = rtl.as(Source,$mod.TTMSFNCDataGridFooterPaging).FPageInfoWidth;
        this.FPageInfoFormat = rtl.as(Source,$mod.TTMSFNCDataGridFooterPaging).FPageInfoFormat;
        this.FPageSelectorFormat = rtl.as(Source,$mod.TTMSFNCDataGridFooterPaging).FPageSelectorFormat;
      };
    };
    this.Destroy = function () {
      pas.System.TObject.Destroy.call(this);
    };
    var $r = this.$rtti;
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: false});
    $r.addProperty("Size",2,rtl.longint,"FSize","SetSize",4,{Default: 30});
    $r.addProperty("ShowPageSelector",2,rtl.boolean,"FShowPageSelector","SetShowPageSelector",4,{Default: true});
    $r.addProperty("ShowPageInfo",2,rtl.boolean,"FShowPageInfo","SetShowPageInfo",4,{Default: true});
    $r.addProperty("ShowNavigationButtons",2,rtl.boolean,"FShowNavigationButtons","SetShowNavigationButtons",4,{Default: true});
    $r.addProperty("PageSelectorWidth",2,rtl.longint,"FPageSelectorWidth","SetPageSelectorWidth",4,{Default: 100});
    $r.addProperty("NavigationButtonWidth",2,rtl.longint,"FNavigationButtonWidth","SetNavigationButtonWidth",4,{Default: 25});
    $r.addProperty("PageInfoWidth",2,rtl.longint,"FPageInfoWidth","SetPageInfoWidth",4,{Default: 150});
    $r.addProperty("PageInfoFormat",14,rtl.string,"FPageInfoFormat","SetPageInfoFormat",4,{stored: "IsPageInfoFormatStored"});
    $r.addProperty("PageSelectorFormat",14,rtl.string,"FPageSelectorFormat","SetPageSelectorFormat",4,{stored: "IsPageSelectorFormatStored"});
  });
  rtl.createClass(this,"TTMSFNCDataGridFooter",this.TTMSFNCDataGridHeaderFooter,function () {
    this.$init = function () {
      $mod.TTMSFNCDataGridHeaderFooter.$init.call(this);
      this.FPaging = null;
    };
    this.$final = function () {
      this.FPaging = undefined;
      $mod.TTMSFNCDataGridHeaderFooter.$final.call(this);
    };
    this.SetPaging = function (Value) {
      this.FPaging.Assign(Value);
    };
    this.DoPagingChanged = function (Sender) {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.DoPagingChangedRebuild = function (Sender) {
      if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
    };
    this.Create$1 = function (AOwner) {
      $mod.TTMSFNCDataGridHeaderFooter.Create$1.call(this,AOwner);
      this.FPaging = $mod.TTMSFNCDataGridFooterPaging.$create("Create$1");
      this.FPaging.FOnChange = rtl.createCallback(this,"DoPagingChanged");
      this.FPaging.FOnChangeRebuild = rtl.createCallback(this,"DoPagingChangedRebuild");
      return this;
    };
    this.Assign = function (Source) {
      $mod.TTMSFNCDataGridHeaderFooter.Assign.apply(this,arguments);
      if ($mod.TTMSFNCDataGridFooter.isPrototypeOf(Source)) this.FPaging.Assign(rtl.as(Source,$mod.TTMSFNCDataGridFooter).FPaging);
    };
    this.Destroy = function () {
      rtl.free(this,"FPaging");
      $mod.TTMSFNCDataGridHeaderFooter.Destroy.call(this);
    };
    var $r = this.$rtti;
    $r.addProperty("Paging",2,$mod.$rtti["TTMSFNCDataGridFooterPaging"],"FPaging","SetPaging");
    $r.addProperty("AutoSize",2,rtl.boolean,"FAutoSize","SetAutoSize",4,{Default: true});
    $r.addProperty("Size",2,rtl.longint,"FSize","SetSize",4,{Default: 30});
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: false});
    $r.addProperty("Fill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFill","SetFill");
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
    $r.addProperty("Bar",2,$mod.$rtti["TTMSFNCDataGridHeaderFooterBar"],"FBar","SetBar");
  });
  this.$rtti.$MethodVar("TTMSFNCDataGridHeaderGroupBeforeDrawEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ACanDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridHeaderGroupAfterDrawEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCDataGridHeaderGroup",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FNew = false;
      this.FScale = 0.0;
      this.FOrigRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FSortIndicator = 0;
      this.FSortDescendingIcon = null;
      this.FSortAscendingIcon = null;
      this.FText = "";
      this.FColumn = 0;
      this.FCloseIcon = null;
      this.FCloseIndicator = false;
      this.FLevel = 0;
      this.FLayout = null;
      this.FActive = false;
      this.FOnAfterDraw = null;
      this.FOnBeforeDraw = null;
    };
    this.$final = function () {
      this.FOrigRect = undefined;
      this.FRect = undefined;
      this.FSortDescendingIcon = undefined;
      this.FSortAscendingIcon = undefined;
      this.FCloseIcon = undefined;
      this.FLayout = undefined;
      this.FOnAfterDraw = undefined;
      this.FOnBeforeDraw = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.GetSortIndicatorRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var sz = 0.0;
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.GetRect().Right,this.GetRect().Top,this.GetRect().Right,this.GetRect().Bottom));
      if (this.FSortIndicator !== pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellSortIndicator.gsiNone) {
        sz = this.GetSortIndicatorSize();
        Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Result.Left - sz - (4 * this.FScale),(Result.Top + ((Result.Bottom - Result.Top) / 2)) - (sz / 2),Result.Left - (2 * this.FScale),Result.Top + ((Result.Bottom - Result.Top) / 2) + (sz / 2)));
      } else Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Result.Left,Result.Top,Result.Left,Result.Bottom));
      return Result;
    };
    this.GetTextRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var sr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var cr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var res = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      sr.$assign(this.GetSortIndicatorRect());
      cr.$assign(this.GetCloseIndicatorRect());
      r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(cr.Right,this.GetRect().Top,sr.Left,this.GetRect().Bottom));
      res.$assign(r);
      pas["WEBLib.TMSFNCTypes"].InflateRectEx(res,-2 * this.FScale,-2 * this.FScale);
      Result.$assign(res);
      return Result;
    };
    this.GetCloseIndicatorRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var sz = 0.0;
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.GetRect().Left,this.GetRect().Top,this.GetRect().Left,this.GetRect().Bottom));
      if (this.FCloseIndicator) {
        sz = this.GetCloseIndicatorSize();
        Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Result.Left + (2 * this.FScale),(Result.Top + ((Result.Bottom - Result.Top) / 2)) - (sz / 2),Result.Left + sz + (4 * this.FScale),Result.Top + ((Result.Bottom - Result.Top) / 2) + (sz / 2)));
      } else Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Result.Left,Result.Top,Result.Left,Result.Bottom));
      return Result;
    };
    this.GetLayout = function () {
      var Result = null;
      if (!(this.FLayout != null)) this.FLayout = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellLayout.$create("Create$1",[16119285]);
      Result = this.FLayout;
      return Result;
    };
    this.GetRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (this.FActive) {
        Result.$assign(this.FOrigRect)}
       else Result.$assign(this.FRect);
      return Result;
    };
    this.XYToCloseIndicator = function (X, Y) {
      var Result = false;
      Result = false;
      if (this.FCloseIndicator) Result = pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetCloseIndicatorRect(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y));
      return Result;
    };
    this.GetSortIndicatorSize = function () {
      var Result = 0.0;
      Result = 16 * this.FScale;
      return Result;
    };
    this.GetCloseIndicatorSize = function () {
      var Result = 0.0;
      Result = 16 * this.FScale;
      return Result;
    };
    this.DoAfterDraw = function (AGraphics) {
      if (this.FOnAfterDraw != null) this.FOnAfterDraw(this,AGraphics);
    };
    this.DoBeforeDraw = function (AGraphics, ACanDraw) {
      if (this.FOnBeforeDraw != null) this.FOnBeforeDraw(this,AGraphics,ACanDraw);
    };
    this.DrawContent = function (AGraphics) {
      this.DrawText(AGraphics);
      if (this.FSortIndicator !== pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellSortIndicator.gsiNone) this.DrawSortIndicator(AGraphics);
      if (this.FCloseIndicator) this.DrawCloseIndicator(AGraphics);
    };
    this.DrawBackground = function (AGraphics) {
      AGraphics.DrawRoundRectangle$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.GetRect()),6,rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcTopRight,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsCorner.gcBottomRight),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
    };
    this.DrawSortIndicator = function (AGraphics) {
      var bmp = null;
      var bmpr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var st = null;
      bmp = null;
      var $tmp = this.FSortIndicator;
      if ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellSortIndicator.gsiAscending) {
        bmp = this.FSortAscendingIcon}
       else if ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellSortIndicator.gsiDescending) bmp = this.FSortDescendingIcon;
      bmpr.$assign(this.GetSortIndicatorRect());
      if (bmp != null) {
        st = AGraphics.SaveState(false);
        try {
          AGraphics.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(bmpr),bmp,true,false,true,false);
        } finally {
          AGraphics.RestoreState(st,false);
        };
      };
    };
    this.DrawCloseIndicator = function (AGraphics) {
      var bmp = null;
      var bmpr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var st = null;
      bmp = this.FCloseIcon;
      bmpr.$assign(this.GetCloseIndicatorRect());
      if (bmp != null) {
        st = AGraphics.SaveState(false);
        try {
          AGraphics.ClipRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(bmpr));
          AGraphics.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(bmpr),bmp,true,false,true,false);
        } finally {
          AGraphics.RestoreState(st,false);
        };
      };
    };
    this.DrawText = function (AGraphics) {
      var dr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var s = "";
      var st = null;
      dr.$assign(this.GetTextRect());
      s = this.FText;
      if (s !== "") {
        st = AGraphics.SaveState(false);
        try {
          AGraphics.ClipRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(dr));
          AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(dr),s,this.GetLayout().FWordWrapping,this.GetLayout().FTextAlign,this.GetLayout().FVerticalTextAlign,this.GetLayout().FTrimming,this.GetLayout().FTextAngle,-1,-1,true,false,-1,-1);
        } finally {
          AGraphics.RestoreState(st,false);
        };
      };
    };
    this.Reset = function () {
      this.FRect.$assign(this.FOrigRect);
    };
    this.Create$1 = function () {
      this.FNew = false;
      this.FScale = 1.0;
      this.FActive = false;
      this.FSortIndicator = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellSortIndicator.gsiNone;
      this.FCloseIndicator = true;
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FLayout;
        }, set: function (v) {
          this.p.FLayout = v;
        }});
      this.FSortDescendingIcon = null;
      this.FSortAscendingIcon = null;
      this.FCloseIcon = null;
      pas.System.TObject.Destroy.call(this);
    };
    this.Draw = function (AGraphics) {
      var b = false;
      AGraphics.SetFill(this.GetLayout().FFill);
      AGraphics.SetStroke(this.GetLayout().FStroke);
      AGraphics.SetFont(this.GetLayout().FFont);
      if (this.FActive) {
        AGraphics.FFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(AGraphics.FFill.FColor,50));
        AGraphics.FFill.SetColorTo(pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(AGraphics.FFill.FColor,50));
        AGraphics.FFont.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(AGraphics.FFont.FColor,50));
        AGraphics.FStroke.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(AGraphics.FStroke.FColor,50));
      };
      b = true;
      this.DoBeforeDraw(AGraphics,{get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }});
      if (b) {
        this.DrawBackground(AGraphics);
        this.DrawContent(AGraphics);
        this.DoAfterDraw(AGraphics);
      };
    };
  });
  rtl.createClass(this,"TTMSFNCDataGridHeaderGroups",pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup,function () {
    this.Find = function (AColumn, AHeaderGroup) {
      var Result = false;
      var I = 0;
      Result = false;
      AHeaderGroup.set(null);
      for (var $l = 0, $end = this.FLength - 1; $l <= $end; $l++) {
        I = $l;
        if (this.GetItem(I).FColumn === AColumn) {
          AHeaderGroup.set(this.GetItem(I));
          Result = true;
          break;
        };
      };
      return Result;
    };
  });
  this.$rtti.$MethodVar("TTMSFNCDataGridBeforeDropHeaderGroupEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["ACanDrop",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridCanDragHeaderGroupEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["ACanDrag",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridAfterDropHeaderGroupEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridBeforeSortHeaderGroupEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["ACanSort",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridAfterSortHeaderGroupEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridBeforeCloseHeaderGroupEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["ACanClose",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridAfterCloseHeaderGroupEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridHeaderGroupClickEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridAfterDrawHeaderGroupEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["AHeaderGroup",this.$rtti["TTMSFNCDataGridHeaderGroup"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridBeforeDrawHeaderGroupEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["AHeaderGroup",this.$rtti["TTMSFNCDataGridHeaderGroup"]],["ACanDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridAfterDrawHeaderGroupLevelEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["ALevel",rtl.longint],["AActive",rtl.boolean]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridBeforeDrawHeaderGroupLevelEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["ALevel",rtl.longint],["AActive",rtl.boolean],["ACanDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridCustomizeHeaderGroupEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AHeaderGroup",this.$rtti["TTMSFNCDataGridHeaderGroup"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridAfterDrawHeaderEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridBeforeDrawHeaderEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["ACanDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridAfterDrawFooterEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridBeforeDrawFooterEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["ACanDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridPageChangedEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AOldPageIndex",rtl.longint],["ANewPageIndex",rtl.longint]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCCustomDataGrid",pas["WEBLib.TMSFNCDataGridBase"].TTMSFNCDataGridBase,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCDataGridBase"].TTMSFNCDataGridBase.$init.call(this);
      this.FOnPageChanged = null;
      this.FFooterPageSelector = null;
      this.FFooterPageInfo = null;
      this.FFooterFirstPageButton = null;
      this.FFooterPreviousPageButton = null;
      this.FFooterNextPageButton = null;
      this.FFooterLastPageButton = null;
      this.FDoubleClicked = false;
      this.FVisualGroupingSize = 0.0;
      this.FDraggedOnHeader = false;
      this.FDraggingOnHeader = false;
      this.FMoveX = 0.0;
      this.FMoveY = 0.0;
      this.FDownX = 0.0;
      this.FDownY = 0.0;
      this.FHeaderLevelRects = [];
      this.FDownHeaderGroup = null;
      this.FDragHeaderGroup = null;
      this.FCalculateGraphics = null;
      this.FFocusedRenderer = null;
      this.FDownRenderer = null;
      this.FFooter = null;
      this.FHeader = null;
      this.FHeaderGroups = null;
      this.FTempHeaderGroups = null;
      this.FDesigner = false;
      this.FOnHeaderGroupClick = null;
      this.FOnAfterDropHeaderGroup = null;
      this.FOnBeforeSortHeaderGroup = null;
      this.FOnBeforeCloseHeaderGroup = null;
      this.FOnAfterSortHeaderGroup = null;
      this.FOnBeforeDropHeaderGroup = null;
      this.FOnCanDragHeaderGroup = null;
      this.FOnAfterCloseHeaderGroup = null;
      this.FOnGroup = null;
      this.FOnUngroup = null;
      this.FOnBeforeDrawHeaderGroup = null;
      this.FOnAfterDrawHeaderGroup = null;
      this.FOnCustomizeHeaderGroup = null;
      this.FOnBeforeDrawHeaderGroupLevel = null;
      this.FOnAfterDrawHeaderGroupLevel = null;
      this.FOnBeforeDrawHeader = null;
      this.FOnBeforeDrawFooter = null;
      this.FOnAfterDrawHeader = null;
      this.FOnAfterDrawFooter = null;
      this.FOnFooterPageSelectorChange = null;
      this.FOnFooterPreviousPageClick = null;
      this.FOnFooterFirstPageClick = null;
      this.FOnFooterNextPageClick = null;
      this.FOnFooterLastPageClick = null;
    };
    this.$final = function () {
      this.FOnPageChanged = undefined;
      this.FFooterPageSelector = undefined;
      this.FFooterPageInfo = undefined;
      this.FFooterFirstPageButton = undefined;
      this.FFooterPreviousPageButton = undefined;
      this.FFooterNextPageButton = undefined;
      this.FFooterLastPageButton = undefined;
      this.FHeaderLevelRects = undefined;
      this.FDownHeaderGroup = undefined;
      this.FDragHeaderGroup = undefined;
      this.FCalculateGraphics = undefined;
      this.FFocusedRenderer = undefined;
      this.FDownRenderer = undefined;
      this.FFooter = undefined;
      this.FHeader = undefined;
      this.FHeaderGroups = undefined;
      this.FTempHeaderGroups = undefined;
      this.FOnHeaderGroupClick = undefined;
      this.FOnAfterDropHeaderGroup = undefined;
      this.FOnBeforeSortHeaderGroup = undefined;
      this.FOnBeforeCloseHeaderGroup = undefined;
      this.FOnAfterSortHeaderGroup = undefined;
      this.FOnBeforeDropHeaderGroup = undefined;
      this.FOnCanDragHeaderGroup = undefined;
      this.FOnAfterCloseHeaderGroup = undefined;
      this.FOnGroup = undefined;
      this.FOnUngroup = undefined;
      this.FOnBeforeDrawHeaderGroup = undefined;
      this.FOnAfterDrawHeaderGroup = undefined;
      this.FOnCustomizeHeaderGroup = undefined;
      this.FOnBeforeDrawHeaderGroupLevel = undefined;
      this.FOnAfterDrawHeaderGroupLevel = undefined;
      this.FOnBeforeDrawHeader = undefined;
      this.FOnBeforeDrawFooter = undefined;
      this.FOnAfterDrawHeader = undefined;
      this.FOnAfterDrawFooter = undefined;
      this.FOnFooterPageSelectorChange = undefined;
      this.FOnFooterPreviousPageClick = undefined;
      this.FOnFooterFirstPageClick = undefined;
      this.FOnFooterNextPageClick = undefined;
      this.FOnFooterLastPageClick = undefined;
      pas["WEBLib.TMSFNCDataGridBase"].TTMSFNCDataGridBase.$final.call(this);
    };
    this.GetAdapter = function () {
      var Result = null;
      Result = this.GetRoot().FAdapter;
      return Result;
    };
    this.GetBitmapContainer = function () {
      var Result = null;
      Result = this.GetRoot().GetBitmapContainer();
      return Result;
    };
    this.GetBitmapName = function (AColumn, ARow) {
      var Result = "";
      Result = this.GetRoot().GetBitmapName(AColumn,ARow);
      return Result;
    };
    this.GetBitmap = function (AColumn, ARow) {
      var Result = null;
      Result = this.GetRoot().GetBitmap(AColumn,ARow);
      return Result;
    };
    this.GetBoolean = function (AColumn, ARow) {
      var Result = false;
      Result = this.GetRoot().GetBoolean(AColumn,ARow);
      return Result;
    };
    this.GetBottomRow = function () {
      var Result = 0;
      Result = this.GetRoot().GetBottomRow();
      return Result;
    };
    this.GetCellAppearance = function () {
      var Result = null;
      Result = this.GetRoot().FCellAppearance;
      return Result;
    };
    this.GetCellData = function (AColumn, ARow) {
      var Result = null;
      Result = this.GetRoot().GetCellData(AColumn,ARow);
      return Result;
    };
    this.GetCellPopupMenu = function () {
      var Result = null;
      Result = this.GetRoot().FCellPopupMenu;
      return Result;
    };
    this.GetCell = function (AColumn, ARow) {
      var Result = undefined;
      Result = this.GetRoot().GetCell(AColumn,ARow);
      return Result;
    };
    this.GetColor = function (AColumn, ARow) {
      var Result = 0;
      Result = this.GetRoot().GetColor(AColumn,ARow);
      return Result;
    };
    this.GetColumnCalculation = function (AColumn, AName) {
      var Result = [];
      Result = rtl.arrayRef(this.GetRoot().GetColumnCalculation(AColumn,AName));
      return Result;
    };
    this.GetColumnCount = function () {
      var Result = 0;
      Result = this.GetRoot().FColumnCount;
      return Result;
    };
    this.GetColumnOrder = function (AColumn) {
      var Result = 0;
      Result = this.GetRoot().GetColumnOrder(AColumn);
      return Result;
    };
    this.GetColumnPos = function (AColumn) {
      var Result = 0.0;
      Result = this.GetRoot().GetColumnPosition(AColumn);
      return Result;
    };
    this.GetColumnReverseOrder = function (AColumn) {
      var Result = 0;
      Result = this.GetRoot().GetColumnReverseOrder(AColumn);
      return Result;
    };
    this.GetColumns = function () {
      var Result = null;
      Result = this.GetRoot().FColumns;
      return Result;
    };
    this.GetColumnWidth = function (AColumn) {
      var Result = 0.0;
      Result = this.GetRoot().GetColumnWidth(AColumn);
      return Result;
    };
    this.GetComment = function (AColumn, ARow) {
      var Result = "";
      Result = this.GetRoot().GetComment(AColumn,ARow);
      return Result;
    };
    this.GetControlAlign = function (AColumn, ARow) {
      var Result = 0;
      Result = this.GetRoot().GetControlAlign(AColumn,ARow);
      return Result;
    };
    this.GetControlHeight = function (AColumn, ARow) {
      var Result = 0;
      Result = this.GetRoot().GetControlHeight(AColumn,ARow);
      return Result;
    };
    this.GetControlMargins$1 = function (AColumn, ARow) {
      var Result = null;
      Result = this.GetRoot().GetControlMargins(AColumn,ARow);
      return Result;
    };
    this.GetControlPosition = function (AColumn, ARow) {
      var Result = 0;
      Result = this.GetRoot().GetControlPosition(AColumn,ARow);
      return Result;
    };
    this.GetControl = function (AColumn, ARow) {
      var Result = null;
      Result = this.GetRoot().GetControl(AColumn,ARow);
      return Result;
    };
    this.GetControlText = function (AColumn, ARow) {
      var Result = "";
      Result = this.GetRoot().GetControlText(AColumn,ARow);
      return Result;
    };
    this.GetControlWidth = function (AColumn, ARow) {
      var Result = 0;
      Result = this.GetRoot().GetControlWidth(AColumn,ARow);
      return Result;
    };
    this.GetCustomHorizontalScrollBar = function () {
      var Result = null;
      Result = this.GetRoot().GetCustomHorizontalScrollBar();
      return Result;
    };
    this.GetCustomScrollBars = function () {
      var Result = false;
      Result = this.GetRoot().FCustomScrollBars;
      return Result;
    };
    this.GetCustomVerticalScrollBar = function () {
      var Result = null;
      Result = this.GetRoot().GetCustomVerticalScrollBar();
      return Result;
    };
    this.GetExternalVerticalScrollBar = function () {
      var Result = null;
      var $ok = false;
      try {
        Result = rtl.setIntfL(Result,this.GetRoot().FExternalVerticalScrollBar);
        $ok = true;
      } finally {
        if (!$ok) rtl._Release(Result);
      };
      return Result;
    };
    this.GetExternalHorizontalScrollBar = function () {
      var Result = null;
      var $ok = false;
      try {
        Result = rtl.setIntfL(Result,this.GetRoot().FExternalHorizontalScrollBar);
        $ok = true;
      } finally {
        if (!$ok) rtl._Release(Result);
      };
      return Result;
    };
    this.SetExternalVerticalScrollBar = function (Value) {
      this.GetRoot().SetExternalVerticalScrollBar(Value);
    };
    this.SetExternalHorizontalScrollBar = function (Value) {
      this.GetRoot().SetExternalHorizontalScrollBar(Value);
    };
    this.GetDefaultColumnWidth = function () {
      var Result = 0.0;
      Result = this.GetRoot().FDefaultColumnWidth;
      return Result;
    };
    this.GetDefaultRowHeight = function () {
      var Result = 0.0;
      Result = this.GetRoot().FDefaultRowHeight;
      return Result;
    };
    this.GetDragAppearance = function () {
      var Result = null;
      Result = this.GetRoot().FDragAppearance;
      return Result;
    };
    this.GetAutoFillAppearance = function () {
      var Result = null;
      Result = this.GetRoot().FAutoFillAppearance;
      return Result;
    };
    this.GetEditingCell = function () {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      Result.$assign(this.GetRoot().FEditingCell);
      return Result;
    };
    this.GetFilter = function () {
      var Result = null;
      Result = this.GetRoot().GetFilter();
      return Result;
    };
    this.GetFilterAppearance = function () {
      var Result = null;
      Result = this.GetRoot().FFilterAppearance;
      return Result;
    };
    this.GetFilterEditor = function (AColumn, ARow) {
      var Result = null;
      Result = this.GetRoot().GetFilterEditor(AColumn,ARow);
      return Result;
    };
    this.GetFilteredRowCount = function () {
      var Result = 0;
      Result = this.GetRoot().GetFilteredRowCount();
      return Result;
    };
    this.GetFixedBottomRowCount = function () {
      var Result = 0;
      Result = this.GetRoot().FFixedBottomRowCount;
      return Result;
    };
    this.GetFixedColumnCount = function () {
      var Result = 0;
      Result = this.GetRoot().FFixedColumnCount;
      return Result;
    };
    this.GetFixedRightColumnCount = function () {
      var Result = 0;
      Result = this.GetRoot().FFixedRightColumnCount;
      return Result;
    };
    this.GetFixedRowCount = function () {
      var Result = 0;
      Result = this.GetRoot().FFixedRowCount;
      return Result;
    };
    this.GetFloat = function (AColumn, ARow) {
      var Result = 0.0;
      Result = this.GetRoot().GetFloat(AColumn,ARow);
      return Result;
    };
    this.GetFocusedCell = function () {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      Result.$assign(this.GetRoot().GetFocusedCell());
      return Result;
    };
    this.GetFontColor = function (AColumn, ARow) {
      var Result = 0;
      Result = this.GetRoot().GetFontColor(AColumn,ARow);
      return Result;
    };
    this.GetFontName = function (AColumn, ARow) {
      var Result = "";
      Result = this.GetRoot().GetFontName(AColumn,ARow);
      return Result;
    };
    this.GetFontSize = function (AColumn, ARow) {
      var Result = 0.0;
      Result = this.GetRoot().GetFontSize(AColumn,ARow);
      return Result;
    };
    this.GetFontStyle = function (AColumn, ARow) {
      var Result = {};
      Result = rtl.refSet(this.GetRoot().GetFontStyle(AColumn,ARow));
      return Result;
    };
    this.GetFreezeColumnCount = function () {
      var Result = 0;
      Result = this.GetRoot().FFreezeColumnCount;
      return Result;
    };
    this.GetFreezeRowCount = function () {
      var Result = 0;
      Result = this.GetRoot().FFreezeRowCount;
      return Result;
    };
    this.GetGlobalFont = function () {
      var Result = null;
      Result = this.GetRoot().FGlobalFont;
      return Result;
    };
    this.GetGrid = function (AColumn, ARow) {
      var Result = null;
      Result = this.GetRoot().GetGrid(AColumn,ARow);
      return Result;
    };
    this.GetHasFilterEditor = function (AColumn, ARow) {
      var Result = false;
      Result = this.GetRoot().GetHasFilterEditor(AColumn,ARow);
      return Result;
    };
    this.GetHasLayout = function (AColumn, ARow) {
      var Result = false;
      Result = this.GetRoot().GetHasLayout(AColumn,ARow);
      return Result;
    };
    this.GetHasRowOrder = function (ARow) {
      var Result = false;
      Result = this.GetRoot().GetHasRowOrder(ARow);
      return Result;
    };
    this.GetHeader = function () {
      var Result = null;
      Result = this.FHeader;
      return Result;
    };
    this.GetHiddenColumnCount = function () {
      var Result = 0;
      Result = this.GetRoot().GetHiddenColumnCount();
      return Result;
    };
    this.GetHiddenColumn = function (AColumn) {
      var Result = false;
      Result = this.GetRoot().GetHiddenColumn(AColumn);
      return Result;
    };
    this.GetHiddenColumnWidth = function (AColumn) {
      var Result = 0.0;
      Result = this.GetRoot().GetHiddenColumnWidth(AColumn);
      return Result;
    };
    this.GetHiddenRowCount = function () {
      var Result = 0;
      Result = this.GetRoot().GetHiddenRowCount();
      return Result;
    };
    this.GetHiddenRowHeight = function (ARow) {
      var Result = 0.0;
      Result = this.GetRoot().GetHiddenRowHeight(ARow);
      return Result;
    };
    this.GetHiddenRow = function (ARow) {
      var Result = false;
      Result = this.GetRoot().GetHiddenRow(ARow);
      return Result;
    };
    this.GetHints = function (AColumn, ARow) {
      var Result = "";
      Result = this.GetRoot().GetHint(AColumn,ARow);
      return Result;
    };
    this.GetHorizontalScrollBar = function () {
      var Result = null;
      Result = this.GetRoot().GetHorizontalScrollBar();
      return Result;
    };
    this.GetHorizontalScrollBarVisible = function () {
      var Result = false;
      Result = this.GetRoot().FHorizontalScrollBarVisible;
      return Result;
    };
    this.GetIcons = function () {
      var Result = null;
      Result = this.GetRoot().FIcons;
      return Result;
    };
    this.GetInt = function (AColumn, ARow) {
      var Result = 0;
      Result = this.GetRoot().GetInt(AColumn,ARow);
      return Result;
    };
    this.GetLayout = function (AColumn, ARow) {
      var Result = null;
      Result = this.GetRoot().GetLayout(AColumn,ARow);
      return Result;
    };
    this.GetLeftColumn = function () {
      var Result = 0;
      Result = this.GetRoot().GetLeftColumn();
      return Result;
    };
    this.GetLink = function () {
      var Result = null;
      Result = this.FFocusedRenderer;
      return Result;
    };
    this.GetManagedObject = function (AColumn, ARow) {
      var Result = null;
      Result = this.GetRoot().GetManagedObject(AColumn,ARow);
      return Result;
    };
    this.GetMergedColumn = function (AColumn) {
      var Result = false;
      Result = this.GetRoot().GetMergedColumn(AColumn);
      return Result;
    };
    this.GetMergedRow = function (ARow) {
      var Result = false;
      Result = this.GetRoot().GetMergedRow(ARow);
      return Result;
    };
    this.GetObj = function (AColumn, ARow) {
      var Result = null;
      Result = this.GetRoot().GetObj(AColumn,ARow);
      return Result;
    };
    this.GetOnAfterApplyFilter = function () {
      var Result = null;
      Result = this.GetRoot().FOnAfterApplyFilter;
      return Result;
    };
    this.GetOnAfterApplyAdvancedFilter = function () {
      var Result = null;
      Result = this.GetRoot().FOnAfterApplyAdvancedFilter;
      return Result;
    };
    this.GetOnAfterCloseInplaceEditor = function () {
      var Result = null;
      Result = this.GetRoot().FOnAfterCloseInplaceEditor;
      return Result;
    };
    this.GetOnAfterExitInplaceEditor = function () {
      var Result = null;
      Result = this.GetRoot().FOnAfterExitInplaceEditor;
      return Result;
    };
    this.GetOnAfterCopyToClipboard = function () {
      var Result = null;
      Result = this.GetRoot().FOnAfterCopyToClipboard;
      return Result;
    };
    this.GetOnAfterCreateFilterEditor = function () {
      var Result = null;
      Result = this.GetRoot().FOnAfterCreateFilterEditor;
      return Result;
    };
    this.GetOnAfterCutToClipboard = function () {
      var Result = null;
      Result = this.GetRoot().FOnAfterCutToClipboard;
      return Result;
    };
    this.GetOnAfterDrawCell = function () {
      var Result = null;
      Result = this.GetRoot().FOnAfterDrawCell;
      return Result;
    };
    this.GetOnAfterDrawEmptySpace = function () {
      var Result = null;
      Result = this.GetRoot().FOnAfterDrawEmptySpace;
      return Result;
    };
    this.GetOnAfterDrawGrid = function () {
      var Result = null;
      Result = this.GetRoot().FOnAfterDrawGrid;
      return Result;
    };
    this.GetOnAfterLookup = function () {
      var Result = null;
      Result = this.GetRoot().FOnAfterLookup;
      return Result;
    };
    this.GetOnAfterOpenInplaceEditor = function () {
      var Result = null;
      Result = this.GetRoot().FOnAfterOpenInplaceEditor;
      return Result;
    };
    this.GetOnAfterPasteFromClipboard = function () {
      var Result = null;
      Result = this.GetRoot().FOnAfterPasteFromClipboard;
      return Result;
    };
    this.GetOnAfterShowFilter = function () {
      var Result = null;
      Result = this.GetRoot().FOnAfterShowFilter;
      return Result;
    };
    this.GetOnAfterShowFilterDialog = function () {
      var Result = null;
      Result = this.GetRoot().FOnAfterShowFilterDialog;
      return Result;
    };
    this.GetOnAfterShowFindDialog = function () {
      var Result = null;
      Result = this.GetRoot().FOnAfterShowFindDialog;
      return Result;
    };
    this.GetOnAfterShowReplaceDialog = function () {
      var Result = null;
      Result = this.GetRoot().FOnAfterShowReplaceDialog;
      return Result;
    };
    this.GetOnBeforeDialogFind = function () {
      var Result = null;
      Result = this.GetRoot().FOnBeforeDialogFind;
      return Result;
    };
    this.GetOnAfterDialogFind = function () {
      var Result = null;
      Result = this.GetRoot().FOnAfterDialogFind;
      return Result;
    };
    this.GetOnBeforeDialogReplace = function () {
      var Result = null;
      Result = this.GetRoot().FOnBeforeDialogReplace;
      return Result;
    };
    this.GetOnAfterDialogReplace = function () {
      var Result = null;
      Result = this.GetRoot().FOnAfterDialogReplace;
      return Result;
    };
    this.GetOnAfterSortColumn = function () {
      var Result = null;
      Result = this.GetRoot().FOnAfterSortColumn;
      return Result;
    };
    this.GetOnAppendColumn = function () {
      var Result = null;
      Result = this.GetRoot().FOnAppendColumn;
      return Result;
    };
    this.GetOnAppendRow = function () {
      var Result = null;
      Result = this.GetRoot().FOnAppendRow;
      return Result;
    };
    this.GetOnBeforeApplyFilter = function () {
      var Result = null;
      Result = this.GetRoot().FOnBeforeApplyFilter;
      return Result;
    };
    this.GetOnBeforeApplyAdvancedFilter = function () {
      var Result = null;
      Result = this.GetRoot().FOnBeforeApplyAdvancedFilter;
      return Result;
    };
    this.GetOnBeforeCloseInplaceEditor = function () {
      var Result = null;
      Result = this.GetRoot().FOnBeforeCloseInplaceEditor;
      return Result;
    };
    this.GetOnBeforeExitInplaceEditor = function () {
      var Result = null;
      Result = this.GetRoot().FOnBeforeExitInplaceEditor;
      return Result;
    };
    this.GetOnBeforeCopyToClipboard = function () {
      var Result = null;
      Result = this.GetRoot().FOnBeforeCopyToClipboard;
      return Result;
    };
    this.GetOnBeforeCreateFilterEditor = function () {
      var Result = null;
      Result = this.GetRoot().FOnBeforeCreateFilterEditor;
      return Result;
    };
    this.GetOnBeforeCutToClipboard = function () {
      var Result = null;
      Result = this.GetRoot().FOnBeforeCutToClipboard;
      return Result;
    };
    this.GetOnBeforeDrawCell = function () {
      var Result = null;
      Result = this.GetRoot().FOnBeforeDrawCell;
      return Result;
    };
    this.GetOnBeforeDrawEmptySpace = function () {
      var Result = null;
      Result = this.GetRoot().FOnBeforeDrawEmptySpace;
      return Result;
    };
    this.GetOnBeforeLookup = function () {
      var Result = null;
      Result = this.GetRoot().FOnBeforeLookup;
      return Result;
    };
    this.GetOnBeforeOpenInplaceEditor = function () {
      var Result = null;
      Result = this.GetRoot().FOnBeforeOpenInplaceEditor;
      return Result;
    };
    this.GetOnBeforePasteFromClipboard = function () {
      var Result = null;
      Result = this.GetRoot().FOnBeforePasteFromClipboard;
      return Result;
    };
    this.GetOnBeforeShowFilter = function () {
      var Result = null;
      Result = this.GetRoot().FOnBeforeShowFilter;
      return Result;
    };
    this.GetOnBeforeShowFindDialog = function () {
      var Result = null;
      Result = this.GetRoot().FOnBeforeShowFindDialog;
      return Result;
    };
    this.GetOnBeforeShowFilterDialog = function () {
      var Result = null;
      Result = this.GetRoot().FOnBeforeShowFilterDialog;
      return Result;
    };
    this.GetOnBeforeShowReplaceDialog = function () {
      var Result = null;
      Result = this.GetRoot().FOnBeforeShowReplaceDialog;
      return Result;
    };
    this.GetOnBeforeSortColumn = function () {
      var Result = null;
      Result = this.GetRoot().FOnBeforeSortColumn;
      return Result;
    };
    this.GetOnCanAppendColumn = function () {
      var Result = null;
      Result = this.GetRoot().FOnCanAppendColumn;
      return Result;
    };
    this.GetOnCanAppendRow = function () {
      var Result = null;
      Result = this.GetRoot().FOnCanAppendRow;
      return Result;
    };
    this.GetOnCanDeleteColumn = function () {
      var Result = null;
      Result = this.GetRoot().FOnCanDeleteColumn;
      return Result;
    };
    this.GetOnCanDeleteRow = function () {
      var Result = null;
      Result = this.GetRoot().FOnCanDeleteRow;
      return Result;
    };
    this.GetOnCanDragColumn = function () {
      var Result = null;
      Result = this.GetRoot().FOnCanDragColumn;
      return Result;
    };
    this.GetOnCanDragRow = function () {
      var Result = null;
      Result = this.GetRoot().FOnCanDragRow;
      return Result;
    };
    this.GetOnCanDropColumn = function () {
      var Result = null;
      Result = this.GetRoot().FOnCanDropColumn;
      return Result;
    };
    this.GetOnCanDropRow = function () {
      var Result = null;
      Result = this.GetRoot().FOnCanDropRow;
      return Result;
    };
    this.GetOnCanEditCell = function () {
      var Result = null;
      Result = this.GetRoot().FOnCanEditCell;
      return Result;
    };
    this.GetOnCanInsertColumn = function () {
      var Result = null;
      Result = this.GetRoot().FOnCanInsertColumn;
      return Result;
    };
    this.GetOnCanInsertRow = function () {
      var Result = null;
      Result = this.GetRoot().FOnCanInsertRow;
      return Result;
    };
    this.GetOnCanSizeColumn = function () {
      var Result = null;
      Result = this.GetRoot().FOnCanSizeColumn;
      return Result;
    };
    this.GetOnCanSizeRow = function () {
      var Result = null;
      Result = this.GetRoot().FOnCanSizeRow;
      return Result;
    };
    this.GetOnCellAfterNodeCollapse = function () {
      var Result = null;
      Result = this.GetRoot().FOnCellAfterNodeCollapse;
      return Result;
    };
    this.GetOnCellAfterNodeExpand = function () {
      var Result = null;
      Result = this.GetRoot().FOnCellAfterNodeExpand;
      return Result;
    };
    this.GetOnCellAnchorClick = function () {
      var Result = null;
      Result = this.GetRoot().FOnCellAnchorClick;
      return Result;
    };
    this.GetOnCellBeforeNodeCollapse = function () {
      var Result = null;
      Result = this.GetRoot().FOnCellBeforeNodeCollapse;
      return Result;
    };
    this.GetOnCellBeforeNodeExpand = function () {
      var Result = null;
      Result = this.GetRoot().FOnCellBeforeNodeExpand;
      return Result;
    };
    this.GetOnCellBeforeShowPopupMenu = function () {
      var Result = null;
      Result = this.GetRoot().FOnCellBeforeShowPopupMenu;
      return Result;
    };
    this.GetOnCellButtonClick = function () {
      var Result = null;
      Result = this.GetRoot().FOnCellButtonClick;
      return Result;
    };
    this.GetOnCellCheckBoxChange = function () {
      var Result = null;
      Result = this.GetRoot().FOnCellCheckBoxChange;
      return Result;
    };
    this.GetOnCellClick = function () {
      var Result = null;
      Result = this.GetRoot().FOnCellClick;
      return Result;
    };
    this.GetOnCellDblClick = function () {
      var Result = null;
      Result = this.GetRoot().FOnCellDblClick;
      return Result;
    };
    this.GetOnCellEditGetData = function () {
      var Result = null;
      Result = this.GetRoot().FOnCellEditGetData;
      return Result;
    };
    this.GetOnCellEditSetData = function () {
      var Result = null;
      Result = this.GetRoot().FOnCellEditSetData;
      return Result;
    };
    this.GetOnCellEditValidateData = function () {
      var Result = null;
      Result = this.GetRoot().FOnCellEditValidateData;
      return Result;
    };
    this.GetOnCellRadioButtonChange = function () {
      var Result = null;
      Result = this.GetRoot().FOnCellRadioButtonChange;
      return Result;
    };
    this.GetOnCellRightClick = function () {
      var Result = null;
      Result = this.GetRoot().FOnCellRightClick;
      return Result;
    };
    this.GetOnColumnDropped = function () {
      var Result = null;
      Result = this.GetRoot().FOnColumnDropped;
      return Result;
    };
    this.GetOnColumnSized = function () {
      var Result = null;
      Result = this.GetRoot().FOnColumnSized;
      return Result;
    };
    this.GetOnCreateCustomFilterEditor = function () {
      var Result = null;
      Result = this.GetRoot().FOnCreateCustomFilterEditor;
      return Result;
    };
    this.GetOnCustomColumnCalculation = function () {
      var Result = null;
      Result = this.GetRoot().FOnCustomColumnCalculation;
      return Result;
    };
    this.GetOnCustomCompare = function () {
      var Result = null;
      Result = this.GetRoot().FOnCustomCompare;
      return Result;
    };
    this.GetOnCustomizeFilterPopupEditor = function () {
      var Result = null;
      Result = this.GetRoot().FOnCustomizeFilterPopupEditor;
      return Result;
    };
    this.GetOnCustomRowCalculation = function () {
      var Result = null;
      Result = this.GetRoot().FOnCustomRowCalculation;
      return Result;
    };
    this.GetOnDeleteColumn = function () {
      var Result = null;
      Result = this.GetRoot().FOnDeleteColumn;
      return Result;
    };
    this.GetOnDeleteRow = function () {
      var Result = null;
      Result = this.GetRoot().FOnDeleteRow;
      return Result;
    };
    this.GetOnBeforeClearSelectedCells = function () {
      var Result = null;
      Result = this.GetRoot().FOnBeforeClearSelectedCells;
      return Result;
    };
    this.GetOnAfterClearSelectedCells = function () {
      var Result = null;
      Result = this.GetRoot().FOnAfterClearSelectedCells;
      return Result;
    };
    this.GetOnDropFiles = function () {
      var Result = null;
      Result = this.GetRoot().FOnDropFiles;
      return Result;
    };
    this.GetOnGetCellClass = function () {
      var Result = null;
      Result = this.GetRoot().FOnGetCellClass;
      return Result;
    };
    this.GetOnGetCellData = function () {
      var Result = null;
      Result = this.GetRoot().FOnGetCellData;
      return Result;
    };
    this.GetOnGetCellDataProperties = function () {
      var Result = null;
      Result = this.GetRoot().FOnGetCellDataProperties;
      return Result;
    };
    this.GetOnGetCellDisplayValue = function () {
      var Result = null;
      Result = this.GetRoot().FOnGetCellDisplayValue;
      return Result;
    };
    this.GetOnGetCellFormatting = function () {
      var Result = null;
      Result = this.GetRoot().FOnGetCellFormatting;
      return Result;
    };
    this.GetOnGetCellHint = function () {
      var Result = null;
      Result = this.GetRoot().FOnGetCellHint;
      return Result;
    };
    this.GetOnGetCellLayout = function () {
      var Result = null;
      Result = this.GetRoot().FOnGetCellLayout;
      return Result;
    };
    this.GetOnGetCellLayoutHasPriority = function () {
      var Result = null;
      Result = this.GetRoot().FOnGetCellLayoutHasPriority;
      return Result;
    };
    this.GetOnGetCellProperties = function () {
      var Result = null;
      Result = this.GetRoot().FOnGetCellProperties;
      return Result;
    };
    this.GetOnGetColumnCalculationOptions = function () {
      var Result = null;
      Result = this.GetRoot().FOnGetColumnCalculationOptions;
      return Result;
    };
    this.GetOnGetCustomGroup = function () {
      var Result = null;
      Result = this.GetRoot().FOnGetCustomGroup;
      return Result;
    };
    this.GetOnGetGroupOptions = function () {
      var Result = null;
      Result = this.GetRoot().FOnGetGroupOptions;
      return Result;
    };
    this.GetOnGetInplaceEditorClass = function () {
      var Result = null;
      Result = this.GetRoot().FOnGetInplaceEditorClass;
      return Result;
    };
    this.GetOnGetInplaceEditorProperties = function () {
      var Result = null;
      Result = this.GetRoot().FOnGetInplaceEditorProperties;
      return Result;
    };
    this.GetOnGetInplaceEditorRect = function () {
      var Result = null;
      Result = this.GetRoot().FOnGetInplaceEditorRect;
      return Result;
    };
    this.GetOnGetInplaceEditorTarget = function () {
      var Result = null;
      Result = this.GetRoot().FOnGetInplaceEditorTarget;
      return Result;
    };
    this.GetOnGetInplaceEditorType = function () {
      var Result = null;
      Result = this.GetRoot().FOnGetInplaceEditorType;
      return Result;
    };
    this.GetOnGetRowCalculationOptions = function () {
      var Result = null;
      Result = this.GetRoot().FOnGetRowCalculationOptions;
      return Result;
    };
    this.GetOnGetSortOptions = function () {
      var Result = null;
      Result = this.GetRoot().FOnGetSortOptions;
      return Result;
    };
    this.GetOnHScroll = function () {
      var Result = null;
      Result = this.GetRoot().FOnHScroll;
      return Result;
    };
    this.GetOnInsertColumn = function () {
      var Result = null;
      Result = this.GetRoot().FOnInsertColumn;
      return Result;
    };
    this.GetOnInsertRow = function () {
      var Result = null;
      Result = this.GetRoot().FOnInsertRow;
      return Result;
    };
    this.GetOnLoadCellData = function () {
      var Result = null;
      Result = this.GetRoot().FOnLoadCellData;
      return Result;
    };
    this.GetOnLogMessage = function () {
      var Result = null;
      Result = this.GetRoot().FOnLogMessage;
      return Result;
    };
    this.GetOnNeedFilterDropDownData = function () {
      var Result = null;
      Result = this.GetRoot().FOnNeedFilterDropDownData;
      return Result;
    };
    this.GetOnRemoveFilter = function () {
      var Result = null;
      Result = this.GetRoot().FOnRemoveFilter;
      return Result;
    };
    this.GetOnRemoveAdvancedFilter = function () {
      var Result = null;
      Result = this.GetRoot().FOnRemoveAdvancedFilter;
      return Result;
    };
    this.GetOnRowCollapse = function () {
      var Result = null;
      Result = this.GetRoot().FOnRowCollapse;
      return Result;
    };
    this.GetOnRowDropped = function () {
      var Result = null;
      Result = this.GetRoot().FOnRowDropped;
      return Result;
    };
    this.GetOnRowExpand = function () {
      var Result = null;
      Result = this.GetRoot().FOnRowExpand;
      return Result;
    };
    this.GetOnRowSized = function () {
      var Result = null;
      Result = this.GetRoot().FOnRowSized;
      return Result;
    };
    this.GetOnSaveCellData = function () {
      var Result = null;
      Result = this.GetRoot().FOnSaveCellData;
      return Result;
    };
    this.GetOnSelectCell = function () {
      var Result = null;
      Result = this.GetRoot().FOnSelectCell;
      return Result;
    };
    this.GetOnSelectingCell = function () {
      var Result = null;
      Result = this.GetRoot().FOnSelectingCell;
      return Result;
    };
    this.GetOnSizeColumn = function () {
      var Result = null;
      Result = this.GetRoot().FOnSizeColumn;
      return Result;
    };
    this.GetOnSizeRow = function () {
      var Result = null;
      Result = this.GetRoot().FOnSizeRow;
      return Result;
    };
    this.GetOnVScroll = function () {
      var Result = null;
      Result = this.GetRoot().FOnVScroll;
      return Result;
    };
    this.GetOptions = function () {
      var Result = null;
      Result = this.GetRoot().GetOptions();
      return Result;
    };
    this.GetPageCount = function () {
      var Result = 0;
      Result = this.GetRoot().GetPageCount();
      return Result;
    };
    this.GetPageIndex = function () {
      var Result = 0;
      Result = this.GetRoot().GetPageIndex();
      return Result;
    };
    this.GetReadOnly = function (AColumn, ARow) {
      var Result = false;
      Result = this.GetRoot().GetReadOnly(AColumn,ARow);
      return Result;
    };
    this.GetRightColumn = function () {
      var Result = 0;
      Result = this.GetRoot().GetRightColumn();
      return Result;
    };
    this.GetRowCalculation = function (ARow, AName) {
      var Result = [];
      Result = rtl.arrayRef(this.GetRoot().GetRowCalculation(ARow,AName));
      return Result;
    };
    this.GetRowCount = function () {
      var Result = 0;
      Result = this.GetRoot().FRowCount;
      return Result;
    };
    this.GetRowHeight = function (ARow) {
      var Result = 0.0;
      Result = this.GetRoot().GetRowHeight(ARow);
      return Result;
    };
    this.GetRowNodeChildCount = function (ARow) {
      var Result = 0;
      Result = this.GetRoot().GetRowNodeChildCount(ARow);
      return Result;
    };
    this.GetRowNodeLevel = function (ARow) {
      var Result = 0;
      Result = this.GetRoot().GetRowNodeLevel(ARow);
      return Result;
    };
    this.GetRowNodeState = function (ARow) {
      var Result = 0;
      Result = this.GetRoot().GetRowNodeState(ARow);
      return Result;
    };
    this.GetRowOrder = function (ARow) {
      var Result = 0;
      Result = this.GetRoot().GetRowOrder(ARow);
      return Result;
    };
    this.GetRowPos = function (ARow) {
      var Result = 0.0;
      Result = this.GetRoot().GetRowPosition(ARow);
      return Result;
    };
    this.GetRowReverseOrder = function (ARow) {
      var Result = 0;
      Result = this.GetRoot().GetRowReverseOrder(ARow);
      return Result;
    };
    this.GetRowText = function (ARow) {
      var Result = "";
      Result = this.GetRoot().GetRowText(ARow);
      return Result;
    };
    this.GetRowType = function (ARow) {
      var Result = 0;
      Result = this.GetRoot().GetRowType(ARow);
      return Result;
    };
    this.GetScrollMode = function () {
      var Result = 0;
      Result = this.GetRoot().FScrollMode;
      return Result;
    };
    this.GetScrollUpdate = function () {
      var Result = 0;
      Result = this.GetRoot().FScrollUpdate;
      return Result;
    };
    this.GetSelectedCellCount = function () {
      var Result = 0;
      Result = this.GetRoot().GetSelectedCellCount();
      return Result;
    };
    this.GetSelectedCell = function (AColumn, ARow) {
      var Result = false;
      Result = this.GetRoot().GetSelectedCell(AColumn,ARow);
      return Result;
    };
    this.GetSelectedColumnCount = function () {
      var Result = 0;
      Result = this.GetRoot().GetSelectedColumnCount();
      return Result;
    };
    this.GetSelectedColumns = function (AColumn) {
      var Result = false;
      Result = this.GetRoot().GetSelectedColumn(AColumn);
      return Result;
    };
    this.GetSelectedRowCount = function () {
      var Result = 0;
      Result = this.GetRoot().GetSelectedRowCount();
      return Result;
    };
    this.GetSelectedRows = function (ARow) {
      var Result = false;
      Result = this.GetRoot().GetSelectedRow(ARow);
      return Result;
    };
    this.GetSelection = function () {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoordRange.$new();
      Result.$assign(this.GetRoot().FSelection);
      return Result;
    };
    this.GetSortIndexList = function () {
      var Result = null;
      Result = this.GetRoot().GetSortIndexList();
      return Result;
    };
    this.GetStartColumn = function () {
      var Result = 0;
      Result = this.GetRoot().GetStartColumn();
      return Result;
    };
    this.GetStartRow = function () {
      var Result = 0;
      Result = this.GetRoot().GetStartRow();
      return Result;
    };
    this.GetState = function (AColumn, ARow) {
      var Result = 0;
      Result = this.GetRoot().GetState(AColumn,ARow);
      return Result;
    };
    this.GetStopColumn = function () {
      var Result = 0;
      Result = this.GetRoot().GetStopColumn();
      return Result;
    };
    this.GetStopRow = function () {
      var Result = 0;
      Result = this.GetRoot().GetStopRow();
      return Result;
    };
    this.GetStoredCell = function (AColumn, ARow) {
      var Result = undefined;
      Result = this.GetRoot().GetStoredCell(AColumn,ARow);
      return Result;
    };
    this.GetStretchScrollBars = function () {
      var Result = false;
      Result = this.GetRoot().FStretchScrollBars;
      return Result;
    };
    this.GetString = function (AColumn, ARow) {
      var Result = "";
      Result = this.GetRoot().GetString(AColumn,ARow);
      return Result;
    };
    this.GetStrippedCell = function (AColumn, ARow) {
      var Result = "";
      Result = this.GetRoot().GetStrippedCell(AColumn,ARow);
      return Result;
    };
    this.GetTextAlign = function (AColumn, ARow) {
      var Result = 0;
      Result = this.GetRoot().GetTextAlign(AColumn,ARow);
      return Result;
    };
    this.GetTextAngle = function (AColumn, ARow) {
      var Result = 0.0;
      Result = this.GetRoot().GetTextAngle(AColumn,ARow);
      return Result;
    };
    this.GetTopRow = function () {
      var Result = 0;
      Result = this.GetRoot().GetTopRow();
      return Result;
    };
    this.GetTotalColumnWidth = function () {
      var Result = 0.0;
      Result = this.GetRoot().FTotalColumnWidth;
      return Result;
    };
    this.GetTotalRowHeight = function () {
      var Result = 0.0;
      Result = this.GetRoot().FTotalRowHeight;
      return Result;
    };
    this.GetVerticalScrollBar = function () {
      var Result = null;
      Result = this.GetRoot().GetVerticalScrollBar();
      return Result;
    };
    this.GetVerticalScrollBarVisible = function () {
      var Result = false;
      Result = this.GetRoot().FVerticalScrollBarVisible;
      return Result;
    };
    this.GetVerticalTextAlign = function (AColumn, ARow) {
      var Result = 0;
      Result = this.GetRoot().GetVerticalTextAlign(AColumn,ARow);
      return Result;
    };
    this.GetVisibleColumnCount = function () {
      var Result = 0;
      Result = this.GetRoot().GetVisibleColumnCount();
      return Result;
    };
    this.GetVisibleRowCount = function () {
      var Result = 0;
      Result = this.GetRoot().GetVisibleRowCount();
      return Result;
    };
    this.GetWordWrapping = function (AColumn, ARow) {
      var Result = false;
      Result = this.GetRoot().GetWordWrapping(AColumn,ARow);
      return Result;
    };
    this.GetDragCell = function () {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      Result.$assign(this.GetRoot().FDragCell);
      return Result;
    };
    this.GetColumnsEditor = function () {
      var Result = null;
      var o = null;
      Result = null;
      o = this.GetRoot().GetColumnsEditor();
      if ((o != null) && pas["WEBLib.TMSFNCDataGridColumnsEditor"].TTMSFNCDataGridColumnsEditor.isPrototypeOf(o)) Result = rtl.as(o,pas["WEBLib.TMSFNCDataGridColumnsEditor"].TTMSFNCDataGridColumnsEditor);
      return Result;
    };
    this.GetRowViewMode = function () {
      var Result = 0;
      Result = this.GetRoot().FRowViewMode;
      return Result;
    };
    this.GetColumnViewMode = function () {
      var Result = 0;
      Result = this.GetRoot().FColumnViewMode;
      return Result;
    };
    this.IsDefaultColumnWidthStored = function () {
      var Result = false;
      Result = this.GetDefaultColumnWidth() !== 75;
      return Result;
    };
    this.IsDefaultRowHeightStored = function () {
      var Result = false;
      Result = this.GetDefaultRowHeight() !== 30;
      return Result;
    };
    this.SetAdapter = function (Value) {
      this.GetRoot().SetAdapter(Value);
    };
    this.SetBitmapContainer = function (Value) {
      this.GetRoot().SetBitmapContainer(Value);
    };
    this.SetBoolean = function (AColumn, ARow, Value) {
      this.GetRoot().SetBoolean(AColumn,ARow,Value);
    };
    this.SetCellAppearance = function (Value) {
      this.GetRoot().FCellAppearance.Assign(Value);
    };
    this.SetCellPopupMenu = function (Value) {
      this.GetRoot().FCellPopupMenu = Value;
    };
    this.SetCell = function (AColumn, ARow, Value) {
      this.GetRoot().SetCell(AColumn,ARow,Value);
    };
    this.SetColor$2 = function (AColumn, ARow, Value) {
      this.GetRoot().SetColor(AColumn,ARow,Value);
    };
    this.SetColumnCalculation = function (AColumn, AName, Value) {
      this.GetRoot().SetColumnCalculation(AColumn,AName,rtl.arrayRef(Value));
    };
    this.SetColumnCount = function (Value) {
      this.GetRoot().SetColumnCount(Value);
    };
    this.SetColumns = function (Value) {
      this.GetRoot().FColumns.Assign(Value);
    };
    this.SetColumnWidth = function (AColumn, Value) {
      this.GetRoot().SetColumnWidth(AColumn,Value);
    };
    this.SetComment = function (AColumn, ARow, Value) {
      this.GetRoot().SetComment(AColumn,ARow,Value);
    };
    this.SetControlAlign = function (AColumn, ARow, Value) {
      this.GetRoot().SetControlAlign(AColumn,ARow,Value);
    };
    this.SetControlHeight = function (AColumn, ARow, Value) {
      this.GetRoot().SetControlHeight(AColumn,ARow,Value);
    };
    this.SetControlPosition = function (AColumn, ARow, Value) {
      this.GetRoot().SetControlPosition(AColumn,ARow,Value);
    };
    this.SetControl = function (AColumn, ARow, Value) {
      this.GetRoot().SetControl(AColumn,ARow,Value);
    };
    this.SetControlText = function (AColumn, ARow, Value) {
      this.GetRoot().SetControlText(AColumn,ARow,Value);
    };
    this.SetControlWidth = function (AColumn, ARow, Value) {
      this.GetRoot().SetControlWidth(AColumn,ARow,Value);
    };
    this.SetCustomScrollBars = function (Value) {
      this.GetRoot().SetCustomScrollBars(Value);
    };
    this.SetDefaultColumnWidth = function (Value) {
      this.GetRoot().SetDefaultColumnWidth(Value);
    };
    this.SetDefaultRowHeight = function (Value) {
      this.GetRoot().SetDefaultRowHeight(Value);
    };
    this.SetDesigner = function (Value) {
      if (this.FDesigner !== Value) {
        this.FDesigner = Value;
      };
    };
    this.SetDragAppearance = function (Value) {
      this.GetRoot().FDragAppearance.Assign(Value);
    };
    this.SetAutoFillAppearance = function (Value) {
      this.GetRoot().FAutoFillAppearance.Assign(Value);
    };
    this.SetFilterAppearance = function (Value) {
      this.GetRoot().FFilterAppearance.Assign(Value);
    };
    this.SetFixedBottomRowCount = function (Value) {
      this.GetRoot().SetFixedBottomRowCount(Value);
    };
    this.SetFixedColumnCount = function (Value) {
      this.GetRoot().SetFixedColumnCount(Value);
    };
    this.SetFixedRightColumnCount = function (Value) {
      this.GetRoot().SetFixedRightColumnCount(Value);
    };
    this.SetFixedRowCount = function (Value) {
      this.GetRoot().SetFixedRowCount(Value);
    };
    this.SetFloat = function (AColumn, ARow, Value) {
      this.GetRoot().SetFloat(AColumn,ARow,Value);
    };
    this.SetFocusedCell = function (Value) {
      this.GetRoot().SetFocusedCell(Value);
    };
    this.SetFontColor = function (AColumn, ARow, Value) {
      this.GetRoot().SetFontColor(AColumn,ARow,Value);
    };
    this.SetFontName = function (AColumn, ARow, Value) {
      this.GetRoot().SetFontName(AColumn,ARow,Value);
    };
    this.SetFontSize = function (AColumn, ARow, Value) {
      this.GetRoot().SetFontSize(AColumn,ARow,Value);
    };
    this.SetFontStyle = function (AColumn, ARow, Value) {
      this.GetRoot().SetFontStyle(AColumn,ARow,rtl.refSet(Value));
    };
    this.SetFooter = function (Value) {
      this.FFooter.Assign(Value);
    };
    this.SetFreezeColumnCount = function (Value) {
      this.GetRoot().SetFreezeColumnCount(Value);
    };
    this.SetFreezeRowCount = function (Value) {
      this.GetRoot().SetFreezeRowCount(Value);
    };
    this.SetGlobalFont = function (Value) {
      this.GetRoot().FGlobalFont.Assign(Value);
    };
    this.SetHeader = function (Value) {
      this.FHeader.Assign(Value);
    };
    this.SetHiddenColumn = function (AColumn, Value) {
      this.GetRoot().SetHiddenColumn(AColumn,Value);
    };
    this.SetHiddenRow = function (ARow, Value) {
      this.GetRoot().SetHiddenRow(ARow,Value);
    };
    this.SetHints = function (AColumn, ARow, Value) {
      this.GetRoot().SetHint(AColumn,ARow,Value);
    };
    this.SetHorizontalScrollBarVisible = function (Value) {
      this.GetRoot().SetHorizontalScrollBarVisible(Value);
    };
    this.SetIcons = function (Value) {
      this.GetRoot().FIcons.Assign(Value);
    };
    this.SetInt = function (AColumn, ARow, Value) {
      this.GetRoot().SetInt(AColumn,ARow,Value);
    };
    this.SetLeftColumn = function (Value) {
      this.GetRoot().SetLeftColumn(Value);
    };
    this.SetManagedObject = function (AColumn, ARow, Value) {
      this.GetRoot().SetManagedObject(AColumn,ARow,Value);
    };
    this.SetMergedColumn = function (AColumn, Value) {
      this.GetRoot().SetMergedColumn(AColumn,Value);
    };
    this.SetMergedRow = function (ARow, Value) {
      this.GetRoot().SetMergedRow(ARow,Value);
    };
    this.SetObj = function (AColumn, ARow, Value) {
      this.GetRoot().SetObj(AColumn,ARow,Value);
    };
    this.SetOnAfterApplyFilter = function (Value) {
      this.GetRoot().FOnAfterApplyFilter = Value;
    };
    this.SetOnAfterApplyAdvancedFilter = function (Value) {
      this.GetRoot().FOnAfterApplyAdvancedFilter = Value;
    };
    this.SetOnAfterCloseInplaceEditor = function (Value) {
      this.GetRoot().FOnAfterCloseInplaceEditor = Value;
    };
    this.SetOnAfterExitInplaceEditor = function (Value) {
      this.GetRoot().FOnAfterExitInplaceEditor = Value;
    };
    this.SetOnAfterCopyToClipboard = function (Value) {
      this.GetRoot().FOnAfterCopyToClipboard = Value;
    };
    this.SetOnAfterCreateFilterEditor = function (Value) {
      this.GetRoot().FOnAfterCreateFilterEditor = Value;
    };
    this.SetOnAfterCutToClipboard = function (Value) {
      this.GetRoot().FOnAfterCutToClipboard = Value;
    };
    this.SetOnAfterDrawCell = function (Value) {
      this.GetRoot().FOnAfterDrawCell = Value;
    };
    this.SetOnAfterDrawEmptySpace = function (Value) {
      this.GetRoot().FOnAfterDrawEmptySpace = Value;
    };
    this.SetOnAfterDrawGrid = function (Value) {
      this.GetRoot().FOnAfterDrawGrid = Value;
    };
    this.SetOnAfterLookup = function (Value) {
      this.GetRoot().FOnAfterLookup = Value;
    };
    this.SetOnAfterOpenInplaceEditor = function (Value) {
      this.GetRoot().FOnAfterOpenInplaceEditor = Value;
    };
    this.SetOnAfterPasteFromClipboard = function (Value) {
      this.GetRoot().FOnAfterPasteFromClipboard = Value;
    };
    this.SetOnAfterShowFilter = function (Value) {
      this.GetRoot().FOnAfterShowFilter = Value;
    };
    this.SetOnAfterShowFilterDialog = function (Value) {
      this.GetRoot().FOnAfterShowFilterDialog = Value;
    };
    this.SetOnAfterShowFindDialog = function (Value) {
      this.GetRoot().FOnAfterShowFindDialog = Value;
    };
    this.SetOnAfterShowReplaceDialog = function (Value) {
      this.GetRoot().FOnAfterShowReplaceDialog = Value;
    };
    this.SetOnBeforeDialogFind = function (Value) {
      this.GetRoot().FOnBeforeDialogFind = Value;
    };
    this.SetOnAfterDialogFind = function (Value) {
      this.GetRoot().FOnAfterDialogFind = Value;
    };
    this.SetOnBeforeDialogReplace = function (Value) {
      this.GetRoot().FOnBeforeDialogReplace = Value;
    };
    this.SetOnAfterDialogReplace = function (Value) {
      this.GetRoot().FOnAfterDialogReplace = Value;
    };
    this.SetOnAfterSortColumn = function (Value) {
      this.GetRoot().FOnAfterSortColumn = Value;
    };
    this.SetOnAppendColumn = function (Value) {
      this.GetRoot().FOnAppendColumn = Value;
    };
    this.SetOnAppendRow = function (Value) {
      this.GetRoot().FOnAppendRow = Value;
    };
    this.SetOnBeforeApplyFilter = function (Value) {
      this.GetRoot().FOnBeforeApplyFilter = Value;
    };
    this.SetOnBeforeApplyAdvancedFilter = function (Value) {
      this.GetRoot().FOnBeforeApplyAdvancedFilter = Value;
    };
    this.SetOnBeforeCloseInplaceEditor = function (Value) {
      this.GetRoot().FOnBeforeCloseInplaceEditor = Value;
    };
    this.SetOnBeforeExitInplaceEditor = function (Value) {
      this.GetRoot().FOnBeforeExitInplaceEditor = Value;
    };
    this.SetOnBeforeCopyToClipboard = function (Value) {
      this.GetRoot().FOnBeforeCopyToClipboard = Value;
    };
    this.SetOnBeforeCreateFilterEditor = function (Value) {
      this.GetRoot().FOnBeforeCreateFilterEditor = Value;
    };
    this.SetOnBeforeCutToClipboard = function (Value) {
      this.GetRoot().FOnBeforeCutToClipboard = Value;
    };
    this.SetOnBeforeDrawCell = function (Value) {
      this.GetRoot().FOnBeforeDrawCell = Value;
    };
    this.SetOnBeforeDrawEmptySpace = function (Value) {
      this.GetRoot().FOnBeforeDrawEmptySpace = Value;
    };
    this.SetOnBeforeLookup = function (Value) {
      this.GetRoot().FOnBeforeLookup = Value;
    };
    this.SetOnBeforeOpenInplaceEditor = function (Value) {
      this.GetRoot().FOnBeforeOpenInplaceEditor = Value;
    };
    this.SetOnBeforePasteFromClipboard = function (Value) {
      this.GetRoot().FOnBeforePasteFromClipboard = Value;
    };
    this.SetOnBeforeShowFilter = function (Value) {
      this.GetRoot().FOnBeforeShowFilter = Value;
    };
    this.SetOnBeforeShowFilterDialog = function (Value) {
      this.GetRoot().FOnBeforeShowFilterDialog = Value;
    };
    this.SetOnBeforeShowFindDialog = function (Value) {
      this.GetRoot().FOnBeforeShowFindDialog = Value;
    };
    this.SetOnBeforeShowReplaceDialog = function (Value) {
      this.GetRoot().FOnBeforeShowReplaceDialog = Value;
    };
    this.SetOnBeforeSortColumn = function (Value) {
      this.GetRoot().FOnBeforeSortColumn = Value;
    };
    this.SetOnCanAppendColumn = function (Value) {
      this.GetRoot().FOnCanAppendColumn = Value;
    };
    this.SetOnCanAppendRow = function (Value) {
      this.GetRoot().FOnCanAppendRow = Value;
    };
    this.SetOnCanDeleteColumn = function (Value) {
      this.GetRoot().FOnCanDeleteColumn = Value;
    };
    this.SetOnCanDeleteRow = function (Value) {
      this.GetRoot().FOnCanDeleteRow = Value;
    };
    this.SetOnCanDragColumn = function (Value) {
      this.GetRoot().FOnCanDragColumn = Value;
    };
    this.SetOnCanDragRow = function (Value) {
      this.GetRoot().FOnCanDragRow = Value;
    };
    this.SetOnCanDropColumn = function (Value) {
      this.GetRoot().FOnCanDropColumn = Value;
    };
    this.SetOnCanDropRow = function (Value) {
      this.GetRoot().FOnCanDropRow = Value;
    };
    this.SetOnCanEditCell = function (Value) {
      this.GetRoot().FOnCanEditCell = Value;
    };
    this.SetOnCanInsertColumn = function (Value) {
      this.GetRoot().FOnCanInsertColumn = Value;
    };
    this.SetOnCanInsertRow = function (Value) {
      this.GetRoot().FOnCanInsertRow = Value;
    };
    this.SetOnCanSizeColumn = function (Value) {
      this.GetRoot().FOnCanSizeColumn = Value;
    };
    this.SetOnCanSizeRow = function (Value) {
      this.GetRoot().FOnCanSizeRow = Value;
    };
    this.SetOnCellAfterNodeCollapse = function (Value) {
      this.GetRoot().FOnCellAfterNodeCollapse = Value;
    };
    this.SetOnCellAfterNodeExpand = function (Value) {
      this.GetRoot().FOnCellAfterNodeExpand = Value;
    };
    this.SetOnCellAnchorClick = function (Value) {
      this.GetRoot().FOnCellAnchorClick = Value;
    };
    this.SetOnCellBeforeNodeCollapse = function (Value) {
      this.GetRoot().FOnCellBeforeNodeCollapse = Value;
    };
    this.SetOnCellBeforeNodeExpand = function (Value) {
      this.GetRoot().FOnCellBeforeNodeExpand = Value;
    };
    this.SetOnCellBeforeShowPopupMenu = function (Value) {
      this.GetRoot().FOnCellBeforeShowPopupMenu = Value;
    };
    this.SetOnCellButtonClick = function (Value) {
      this.GetRoot().FOnCellButtonClick = Value;
    };
    this.SetOnCellCheckBoxChange = function (Value) {
      this.GetRoot().FOnCellCheckBoxChange = Value;
    };
    this.SetOnCellClick = function (Value) {
      this.GetRoot().FOnCellClick = Value;
    };
    this.SetOnCellDblClick = function (Value) {
      this.GetRoot().FOnCellDblClick = Value;
    };
    this.SetOnCellEditGetData = function (Value) {
      this.GetRoot().FOnCellEditGetData = Value;
    };
    this.SetOnCellEditSetData = function (Value) {
      this.GetRoot().FOnCellEditSetData = Value;
    };
    this.SetOnCellEditValidateData = function (Value) {
      this.GetRoot().FOnCellEditValidateData = Value;
    };
    this.SetOnCellRadioButtonChange = function (Value) {
      this.GetRoot().FOnCellRadioButtonChange = Value;
    };
    this.SetOnCellRightClick = function (Value) {
      this.GetRoot().FOnCellRightClick = Value;
    };
    this.SetOnColumnDropped = function (Value) {
      this.GetRoot().FOnColumnDropped = Value;
    };
    this.SetOnColumnSized = function (Value) {
      this.GetRoot().FOnColumnSized = Value;
    };
    this.SetOnCreateCustomFilterEditor = function (Value) {
      this.GetRoot().FOnCreateCustomFilterEditor = Value;
    };
    this.SetOnCustomColumnCalculation = function (Value) {
      this.GetRoot().FOnCustomColumnCalculation = Value;
    };
    this.SetOnCustomCompare = function (Value) {
      this.GetRoot().FOnCustomCompare = Value;
    };
    this.SetOnCustomizeFilterPopupEditor = function (Value) {
      this.GetRoot().FOnCustomizeFilterPopupEditor = Value;
    };
    this.SetOnCustomRowCalculation = function (Value) {
      this.GetRoot().FOnCustomRowCalculation = Value;
    };
    this.SetOnDeleteColumn = function (Value) {
      this.GetRoot().FOnDeleteColumn = Value;
    };
    this.SetOnDeleteRow = function (Value) {
      this.GetRoot().FOnDeleteRow = Value;
    };
    this.SetOnBeforeClearSelectedCells = function (Value) {
      this.GetRoot().FOnBeforeClearSelectedCells = Value;
    };
    this.SetOnAfterClearSelectedCells = function (Value) {
      this.GetRoot().FOnAfterClearSelectedCells = Value;
    };
    this.SetOnDropFiles = function (Value) {
      this.GetRoot().FOnDropFiles = Value;
    };
    this.SetOnGetCellClass = function (Value) {
      this.GetRoot().FOnGetCellClass = Value;
    };
    this.SetOnGetCellData = function (Value) {
      this.GetRoot().FOnGetCellData = Value;
    };
    this.SetOnGetCellDataProperties = function (Value) {
      this.GetRoot().FOnGetCellDataProperties = Value;
    };
    this.SetOnGetCellDisplayValue = function (Value) {
      this.GetRoot().FOnGetCellDisplayValue = Value;
    };
    this.SetOnGetCellFormatting = function (Value) {
      this.GetRoot().FOnGetCellFormatting = Value;
    };
    this.SetOnGetCellHint = function (Value) {
      this.GetRoot().FOnGetCellHint = Value;
    };
    this.SetOnGetCellLayout = function (Value) {
      this.GetRoot().FOnGetCellLayout = Value;
    };
    this.SetOnGetCellLayoutHasPriority = function (Value) {
      this.GetRoot().FOnGetCellLayoutHasPriority = Value;
    };
    this.SetOnGetCellProperties = function (Value) {
      this.GetRoot().FOnGetCellProperties = Value;
    };
    this.SetOnGetColumnCalculationOptions = function (Value) {
      this.GetRoot().FOnGetColumnCalculationOptions = Value;
    };
    this.SetOnGetCustomGroup = function (Value) {
      this.GetRoot().FOnGetCustomGroup = Value;
    };
    this.SetOnGetGroupOptions = function (Value) {
      this.GetRoot().FOnGetGroupOptions = Value;
    };
    this.SetOnGetInplaceEditorClass = function (Value) {
      this.GetRoot().FOnGetInplaceEditorClass = Value;
    };
    this.SetOnGetInplaceEditorProperties = function (Value) {
      this.GetRoot().FOnGetInplaceEditorProperties = Value;
    };
    this.SetOnGetInplaceEditorRect = function (Value) {
      this.GetRoot().FOnGetInplaceEditorRect = Value;
    };
    this.SetOnGetInplaceEditorTarget = function (Value) {
      this.GetRoot().FOnGetInplaceEditorTarget = Value;
    };
    this.SetOnGetInplaceEditorType = function (Value) {
      this.GetRoot().FOnGetInplaceEditorType = Value;
    };
    this.SetOnGetRowCalculationOptions = function (Value) {
      this.GetRoot().FOnGetRowCalculationOptions = Value;
    };
    this.SetOnGetSortOptions = function (Value) {
      this.GetRoot().FOnGetSortOptions = Value;
    };
    this.SetOnHScroll = function (Value) {
      this.GetRoot().FOnHScroll = Value;
    };
    this.SetOnInsertColumn = function (Value) {
      this.GetRoot().FOnInsertColumn = Value;
    };
    this.SetOnInsertRow = function (Value) {
      this.GetRoot().FOnInsertRow = Value;
    };
    this.SetOnLoadCellData = function (Value) {
      this.GetRoot().FOnLoadCellData = Value;
    };
    this.SetOnLogMessage = function (Value) {
      this.GetRoot().FOnLogMessage = Value;
    };
    this.SetOnNeedFilterDropDownData = function (Value) {
      this.GetRoot().FOnNeedFilterDropDownData = Value;
    };
    this.SetOnRemoveFilter = function (Value) {
      this.GetRoot().FOnRemoveFilter = Value;
    };
    this.SetOnRemoveAdvancedFilter = function (Value) {
      this.GetRoot().FOnRemoveAdvancedFilter = Value;
    };
    this.SetOnRowCollapse = function (Value) {
      this.GetRoot().FOnRowCollapse = Value;
    };
    this.SetOnRowDropped = function (Value) {
      this.GetRoot().FOnRowDropped = Value;
    };
    this.SetOnRowExpand = function (Value) {
      this.GetRoot().FOnRowExpand = Value;
    };
    this.SetOnRowSized = function (Value) {
      this.GetRoot().FOnRowSized = Value;
    };
    this.SetOnSaveCellData = function (Value) {
      this.GetRoot().FOnSaveCellData = Value;
    };
    this.SetOnSelectCell = function (Value) {
      this.GetRoot().FOnSelectCell = Value;
    };
    this.SetOnSelectingCell = function (Value) {
      this.GetRoot().FOnSelectingCell = Value;
    };
    this.SetOnSizeColumn = function (Value) {
      this.GetRoot().FOnSizeColumn = Value;
    };
    this.SetOnSizeRow = function (Value) {
      this.GetRoot().FOnSizeRow = Value;
    };
    this.SetOnVScroll = function (Value) {
      this.GetRoot().FOnVScroll = Value;
    };
    this.SetOptions = function (Value) {
      this.GetRoot().GetOptions().Assign(Value);
    };
    this.SetPageIndex = function (Value) {
      this.GetRoot().SetPageIndex(Value);
    };
    this.SetReadOnly = function (AColumn, ARow, Value) {
      this.GetRoot().SetReadOnly(AColumn,ARow,Value);
    };
    this.SetRowCalculation = function (ARow, AName, Value) {
      this.GetRoot().SetRowCalculation(ARow,AName,rtl.arrayRef(Value));
    };
    this.SetRowCount = function (Value) {
      this.GetRoot().SetRowCount(Value);
    };
    this.SetRowHeight = function (ARow, Value) {
      this.GetRoot().SetRowHeight(ARow,Value);
    };
    this.SetRowNodeChildCount = function (ARow, Value) {
      this.GetRoot().SetRowNodeChildCount(ARow,Value);
    };
    this.SetRowNodeLevel = function (ARow, Value) {
      this.GetRoot().SetRowNodeLevel(ARow,Value);
    };
    this.SetRowNodeState = function (ARow, Value) {
      this.GetRoot().SetRowNodeState(ARow,Value);
    };
    this.SetRowText = function (ARow, Value) {
      this.GetRoot().SetRowText(ARow,Value);
    };
    this.SetRowType = function (ARow, Value) {
      this.GetRoot().SetRowType(ARow,Value);
    };
    this.SetScrollMode = function (Value) {
      this.GetRoot().SetScrollMode(Value);
    };
    this.SetScrollUpdate = function (Value) {
      this.GetRoot().SetScrollUpdate(Value);
    };
    this.SetSelectedCell = function (AColumn, ARow, Value) {
      this.GetRoot().SetSelectedCell(AColumn,ARow,Value);
    };
    this.SetSelectedColumns = function (AColumn, Value) {
      this.GetRoot().SetSelectedColumn(AColumn,Value);
    };
    this.SetSelectedRows = function (ARow, Value) {
      this.GetRoot().SetSelectedRow(ARow,Value);
    };
    this.SetSelection = function (Value) {
      this.GetRoot().FSelection.$assign(Value);
    };
    this.SetStretchScrollBars = function (Value) {
      this.GetRoot().SetStretchScrollBars(Value);
    };
    this.SetString = function (AColumn, ARow, Value) {
      this.GetRoot().SetString(AColumn,ARow,Value);
    };
    this.SetTextAlign = function (AColumn, ARow, Value) {
      this.GetRoot().SetTextAlign(AColumn,ARow,Value);
    };
    this.SetTextAngle = function (AColumn, ARow, Value) {
      this.GetRoot().SetTextAngle(AColumn,ARow,Value);
    };
    this.SetTopRow = function (Value) {
      this.GetRoot().SetTopRow(Value);
    };
    this.SetVerticalScrollBarVisible = function (Value) {
      this.GetRoot().SetVerticalScrollBarVisible(Value);
    };
    this.SetVerticalTextAlign = function (AColumn, ARow, Value) {
      this.GetRoot().SetVerticalTextAlign(AColumn,ARow,Value);
    };
    this.SetWordWrapping = function (AColumn, ARow, Value) {
      this.GetRoot().SetWordWrapping(AColumn,ARow,Value);
    };
    this.SetRowViewMode = function (Value) {
      this.GetRoot().SetRowViewMode(Value);
    };
    this.SetColumnViewMode = function (Value) {
      this.GetRoot().SetColumnViewMode(Value);
    };
    this.GetFilterBuilder = function () {
      var Result = null;
      Result = this.GetRoot().GetFilterBuilder();
      return Result;
    };
    this.GetOnAfterSetColumnCalculation = function () {
      var Result = null;
      Result = this.GetRoot().FOnAfterSetColumnCalculation;
      return Result;
    };
    this.GetOnAfterSetRowCalculation = function () {
      var Result = null;
      Result = this.GetRoot().FOnAfterSetRowCalculation;
      return Result;
    };
    this.GetOnBeforeSetColumnCalculation = function () {
      var Result = null;
      Result = this.GetRoot().FOnBeforeSetColumnCalculation;
      return Result;
    };
    this.GetOnBeforeSetRowCalculation = function () {
      var Result = null;
      Result = this.GetRoot().FOnBeforeSetRowCalculation;
      return Result;
    };
    this.SetOnAfterSetColumnCalculation = function (Value) {
      this.GetRoot().FOnAfterSetColumnCalculation = Value;
    };
    this.SetOnAfterSetRowCalculation = function (Value) {
      this.GetRoot().FOnAfterSetRowCalculation = Value;
    };
    this.SetOnBeforeSetColumnCalculation = function (Value) {
      this.GetRoot().FOnBeforeSetColumnCalculation = Value;
    };
    this.SetOnBeforeSetRowCalculation = function (Value) {
      this.GetRoot().FOnBeforeSetRowCalculation = Value;
    };
    this.GetFilterActions = function () {
      var Result = null;
      Result = this.GetRoot().FFilterActions;
      return Result;
    };
    this.SetFilterActions = function (Value) {
      this.GetRoot().FFilterActions.Assign(Value);
    };
    this.GetHeaderGroups = function () {
      var Result = null;
      if (!(this.FHeaderGroups != null)) this.FHeaderGroups = $mod.TTMSFNCDataGridHeaderGroups.$create("Create$4",[true]);
      Result = this.FHeaderGroups;
      return Result;
    };
    this.GetCalculateGraphics = function () {
      var Result = null;
      if (!(this.FCalculateGraphics != null)) {
        this.FCalculateGraphics = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[1,1,false,true]);
        this.FCalculateGraphics.BeginScene();
      };
      Result = this.FCalculateGraphics;
      return Result;
    };
    this.GetHasFilter = function () {
      var Result = false;
      Result = this.GetRoot().GetHasFilter();
      return Result;
    };
    this.GetGroupInfo = function () {
      var Result = pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataGroupInfo.$new();
      Result.$assign(this.GetRoot().FGroupInfo);
      return Result;
    };
    this.GetFooterFirstPageButton = function () {
      var Result = null;
      if (!(this.FFooterFirstPageButton != null)) {
        this.FFooterFirstPageButton = pas["WEBLib.TMSFNCToolBar"].TTMSFNCToolBarButton.$create("Create$1",[null]);
        this.FFooterFirstPageButton.FStored = false;
        this.FFooterFirstPageButton.FAppearance.SetFlatStyle(true);
        this.FFooterFirstPageButton.SetText("");
        this.FFooterFirstPageButton.SetAllowFocus(false);
        this.FFooterFirstPageButton.FAppearance.FNormalFill.SetColor(16777215);
        this.FFooterFirstPageButton.FAppearance.FNormalStroke.SetColor(16777215);
        this.FFooterFirstPageButton.SetParent(this);
        this.FFooterFirstPageButton.FBitmaps.AddBitmap(this.GetIcons().GetActiveFirstPageIcon(),1.0);
        this.FFooterFirstPageButton.FOnClick = rtl.createCallback(this,"DoFooterFirstPageClick");
      };
      Result = this.FFooterFirstPageButton;
      return Result;
    };
    this.GetFooterLastPageButton = function () {
      var Result = null;
      if (!(this.FFooterLastPageButton != null)) {
        this.FFooterLastPageButton = pas["WEBLib.TMSFNCToolBar"].TTMSFNCToolBarButton.$create("Create$1",[null]);
        this.FFooterLastPageButton.FStored = false;
        this.FFooterLastPageButton.FAppearance.SetFlatStyle(true);
        this.FFooterLastPageButton.SetText("");
        this.FFooterLastPageButton.SetAllowFocus(false);
        this.FFooterLastPageButton.FAppearance.FNormalFill.SetColor(16777215);
        this.FFooterLastPageButton.FAppearance.FNormalStroke.SetColor(16777215);
        this.FFooterLastPageButton.SetParent(this);
        this.FFooterLastPageButton.FBitmaps.AddBitmap(this.GetIcons().GetActiveLastPageIcon(),1.0);
        this.FFooterLastPageButton.FOnClick = rtl.createCallback(this,"DoFooterLastPageClick");
      };
      Result = this.FFooterLastPageButton;
      return Result;
    };
    this.GetFooterNextPageButton = function () {
      var Result = null;
      if (!(this.FFooterNextPageButton != null)) {
        this.FFooterNextPageButton = pas["WEBLib.TMSFNCToolBar"].TTMSFNCToolBarButton.$create("Create$1",[null]);
        this.FFooterNextPageButton.FStored = false;
        this.FFooterNextPageButton.FAppearance.SetFlatStyle(true);
        this.FFooterNextPageButton.SetText("");
        this.FFooterNextPageButton.SetAllowFocus(false);
        this.FFooterNextPageButton.FAppearance.FNormalFill.SetColor(16777215);
        this.FFooterNextPageButton.FAppearance.FNormalStroke.SetColor(16777215);
        this.FFooterNextPageButton.SetParent(this);
        this.FFooterNextPageButton.FBitmaps.AddBitmap(this.GetIcons().GetActiveNextPageIcon(),1.0);
        this.FFooterNextPageButton.FOnClick = rtl.createCallback(this,"DoFooterNextPageClick");
      };
      Result = this.FFooterNextPageButton;
      return Result;
    };
    this.GetFooterPageInfo = function () {
      var Result = null;
      if (!(this.FFooterPageInfo != null)) {
        this.FFooterPageInfo = pas["WEBLib.TMSFNCHTMLText"].TTMSFNCHTMLText.$create("Create$1",[this]);
        this.FFooterPageInfo.FTransparent = true;
        this.FFooterPageInfo.DisableBackground();
        this.FFooterPageInfo.SetParent(this);
        this.FFooterPageInfo.FStored = false;
      };
      Result = this.FFooterPageInfo;
      return Result;
    };
    this.GetFooterPageSelector = function () {
      var Result = null;
      if (!(this.FFooterPageSelector != null)) {
        this.FFooterPageSelector = pas["WEBLib.TMSFNCToolBar"].TTMSFNCToolBarComboBox.$create("Create$1",[this]);
        this.FFooterPageSelector.SetDropDownKind(pas["WEBLib.TMSFNCToolBar"].TTMSFNCToolBarButtonDropDownKind.ddkDropDown);
        this.FFooterPageSelector.FAppearance.SetFlatStyle(true);
        this.FFooterPageSelector.SetAllowFocus(false);
        this.FFooterPageSelector.FAppearance.FNormalFill.SetColor(16777215);
        this.FFooterPageSelector.FAppearance.FNormalStroke.SetColor(16777215);
        this.FFooterPageSelector.SetParent(this);
        this.FFooterPageSelector.FStored = false;
        this.FFooterPageSelector.FOnItemSelected = rtl.createCallback(this,"DoFooterPageSelectorChange");
      };
      Result = this.FFooterPageSelector;
      return Result;
    };
    this.GetFooterPreviousPageButton = function () {
      var Result = null;
      if (!(this.FFooterPreviousPageButton != null)) {
        this.FFooterPreviousPageButton = pas["WEBLib.TMSFNCToolBar"].TTMSFNCToolBarButton.$create("Create$1",[null]);
        this.FFooterPreviousPageButton.FStored = false;
        this.FFooterPreviousPageButton.FAppearance.SetFlatStyle(true);
        this.FFooterPreviousPageButton.SetText("");
        this.FFooterPreviousPageButton.SetAllowFocus(false);
        this.FFooterPreviousPageButton.FAppearance.FNormalFill.SetColor(16777215);
        this.FFooterPreviousPageButton.FAppearance.FNormalStroke.SetColor(16777215);
        this.FFooterPreviousPageButton.SetParent(this);
        this.FFooterPreviousPageButton.FBitmaps.AddBitmap(this.GetIcons().GetActivePreviousPageIcon(),1.0);
        this.FFooterPreviousPageButton.FOnClick = rtl.createCallback(this,"DoFooterPreviousPageClick");
      };
      Result = this.FFooterPreviousPageButton;
      return Result;
    };
    this.GetPaging = function () {
      var Result = false;
      Result = this.GetRoot().FPaging;
      return Result;
    };
    this.SetPaging = function (Value) {
      this.GetRoot().SetPaging(Value);
    };
    this.GetOnAfterInplaceEditorGetValue = function () {
      var Result = null;
      Result = this.GetRoot().FOnAfterInplaceEditorGetValue;
      return Result;
    };
    this.GetOnAfterInplaceEditorSetValue = function () {
      var Result = null;
      Result = this.GetRoot().FOnAfterInplaceEditorSetValue;
      return Result;
    };
    this.GetOnBeforeInplaceEditorGetValue = function () {
      var Result = null;
      Result = this.GetRoot().FOnBeforeInplaceEditorGetValue;
      return Result;
    };
    this.GetOnBeforeInplaceEditorSetValue = function () {
      var Result = null;
      Result = this.GetRoot().FOnBeforeInplaceEditorSetValue;
      return Result;
    };
    this.SetOnAfterInplaceEditorGetValue = function (Value) {
      this.GetRoot().FOnAfterInplaceEditorGetValue = Value;
    };
    this.SetOnAfterInplaceEditorSetValue = function (Value) {
      this.GetRoot().FOnAfterInplaceEditorSetValue = Value;
    };
    this.SetOnBeforeInplaceEditorGetValue = function (Value) {
      this.GetRoot().FOnBeforeInplaceEditorGetValue = Value;
    };
    this.SetOnBeforeInplaceEditorSetValue = function (Value) {
      this.GetRoot().FOnBeforeInplaceEditorSetValue = Value;
    };
    this.GetControlHeightDIP = function (AColumn, ARow) {
      var Result = 0;
      Result = this.GetRoot().GetControlHeightDIP(AColumn,ARow);
      return Result;
    };
    this.GetControlWidthDIP = function (AColumn, ARow) {
      var Result = 0;
      Result = this.GetRoot().GetControlWidthDIP(AColumn,ARow);
      return Result;
    };
    this.GetRowHeightDIP = function (ARow) {
      var Result = 0.0;
      Result = this.GetRoot().GetRowHeightDIP(ARow);
      return Result;
    };
    this.SetControlHeightDIP = function (AColumn, ARow, Value) {
      this.GetRoot().SetControlHeightDIP(AColumn,ARow,Value);
    };
    this.SetControlWidthDIP = function (AColumn, ARow, Value) {
      this.GetRoot().SetControlWidthDIP(AColumn,ARow,Value);
    };
    this.SetRowHeightDIP = function (ARow, Value) {
      this.GetRoot().SetRowHeightDIP(ARow,Value);
    };
    this.GetBitmapAspectRatio = function (AColumn, ARow) {
      var Result = false;
      Result = this.GetRoot().GetBitmapAspectRatio(AColumn,ARow);
      return Result;
    };
    this.GetBitmapCentered = function (AColumn, ARow) {
      var Result = false;
      Result = this.GetRoot().GetBitmapCentered(AColumn,ARow);
      return Result;
    };
    this.GetBitmapCropped = function (AColumn, ARow) {
      var Result = false;
      Result = this.GetRoot().GetBitmapCropped(AColumn,ARow);
      return Result;
    };
    this.GetBitmapStretched = function (AColumn, ARow) {
      var Result = false;
      Result = this.GetRoot().GetBitmapStretched(AColumn,ARow);
      return Result;
    };
    this.SetBitmapAspectRatio = function (AColumn, ARow, Value) {
      this.GetRoot().SetBitmapAspectRatio(AColumn,ARow,Value);
    };
    this.SetBitmapCentered = function (AColumn, ARow, Value) {
      this.GetRoot().SetBitmapCentered(AColumn,ARow,Value);
    };
    this.SetBitmapCropped = function (AColumn, ARow, Value) {
      this.GetRoot().SetBitmapCropped(AColumn,ARow,Value);
    };
    this.SetBitmapStretched = function (AColumn, ARow, Value) {
      this.GetRoot().SetBitmapStretched(AColumn,ARow,Value);
    };
    this.GetColumnWidthDIP = function (AColumn) {
      var Result = 0.0;
      Result = this.GetRoot().GetColumnWidthDIP(AColumn);
      return Result;
    };
    this.SetColumnWidthDIP = function (AColumn, Value) {
      this.GetRoot().SetColumnWidthDIP(AColumn,Value);
    };
    this.GetProgressValue = function (AColumn, ARow) {
      var Result = 0;
      Result = this.GetRoot().GetProgressValue(AColumn,ARow);
      return Result;
    };
    this.SetProgressValue = function (AColumn, ARow, Value) {
      this.GetRoot().SetProgressValue(AColumn,ARow,Value);
    };
    this.GetOnAfterApplyAutoFill = function () {
      var Result = null;
      Result = this.GetRoot().FOnAfterApplyAutoFill;
      return Result;
    };
    this.GetOnAutoFillCalculateValue = function () {
      var Result = null;
      Result = this.GetRoot().FOnAutoFillCalculateValue;
      return Result;
    };
    this.GetOnAutoFillGetCustomList = function () {
      var Result = null;
      Result = this.GetRoot().FOnAutoFillGetCustomList;
      return Result;
    };
    this.GetOnBeforeApplyAutoFill = function () {
      var Result = null;
      Result = this.GetRoot().FOnBeforeApplyAutoFill;
      return Result;
    };
    this.SetOnAfterApplyAutoFill = function (Value) {
      this.GetRoot().FOnAfterApplyAutoFill = Value;
    };
    this.SetOnAutoFillCalculateValue = function (Value) {
      this.GetRoot().FOnAutoFillCalculateValue = Value;
    };
    this.SetOnAutoFillGetCustomList = function (Value) {
      this.GetRoot().FOnAutoFillGetCustomList = Value;
    };
    this.SetOnBeforeApplyAutoFill = function (Value) {
      this.GetRoot().FOnBeforeApplyAutoFill = Value;
    };
    this.CustomReadProperty = function (AObject, APropertyName, APropertyKind, AReader, ACanRead) {
      var rd = null;
      if (ACanRead.get() && (APropertyName === "RootPersistence")) {
        ACanRead.set(false);
        rd = pas["WEBLib.TMSFNCPersistence"].TTMSFNCReader.$create("Create$2",[AReader]);
        try {
          if (!AReader.IsNull()) rd.Read$1(this.GetRoot());
        } finally {
          rd = rtl.freeLoc(rd);
        };
      };
    };
    this.CustomWriteProperty = function (AObject, APropertyName, APropertyKind, AWriter, ACanWrite) {
      var wr = null;
      if (ACanWrite.get() && (APropertyName === "RootPersistence")) {
        ACanWrite.set(false);
        wr = pas["WEBLib.TMSFNCPersistence"].TTMSFNCWriter.$create("Create$2",[AWriter]);
        try {
          AWriter.WriteName("RootPersistence");
          wr.Write(this.GetRoot());
        } finally {
          wr = rtl.freeLoc(wr);
        };
      };
    };
    this.ReadState = function (Reader) {
      this.GetRoot().IncUpdateCount();
      pas.Classes.TComponent.ReadState.apply(this,arguments);
      this.GetRoot().DecUpdateCount();
    };
    this.SetDataColumnCount = function (AValue) {
      this.GetRoot().SetDataColumnCount(AValue);
    };
    this.SetDataRowCount = function (AValue) {
      this.GetRoot().SetDataRowCount(AValue);
    };
    this.DataBeginUpdate = function () {
      this.BeginUpdate();
    };
    this.DataEndUpdate = function () {
      this.EndUpdate();
    };
    this.DataClearData = function () {
      this.GetRoot().DataClearData();
    };
    this.GetDataRowCount = function () {
      var Result = 0;
      Result = this.GetRoot().GetDataRowCount();
      return Result;
    };
    this.SetDataValue = function (AColumn, ARow, AValue) {
      this.GetRoot().SetDataValue(AColumn,ARow,AValue);
    };
    this.SetDataHeader = function (AColumn, AValue) {
      this.GetRoot().SetDataHeader(AColumn,AValue);
    };
    this.DataInsertRow = function (AInsertPosition) {
      this.GetRoot().DataInsertRow(AInsertPosition);
    };
    this.DataGetItemIndex = function () {
      var Result = 0;
      Result = this.GetRoot().DataGetItemIndex();
      return Result;
    };
    this.DataSetItemIndex = function (AValue) {
      this.GetRoot().DataSetItemIndex(AValue);
    };
    this.InternalXYToHeaderGroup = function (X, Y, AHeaderGroups, ASkipDragHeaderGroup, AUseOriginalRect) {
      var Result = null;
      var I = 0;
      var hg = null;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result = null;
      for (var $l = 0, $end = AHeaderGroups.FLength - 1; $l <= $end; $l++) {
        I = $l;
        hg = AHeaderGroups.GetItem(I);
        if (AUseOriginalRect) {
          r.$assign(hg.FOrigRect)}
         else r.$assign(hg.GetRect());
        if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(r,pas["WEBLib.TMSFNCTypes"].PointF(X,Y)) && ((ASkipDragHeaderGroup && (hg !== this.FDragHeaderGroup)) || !ASkipDragHeaderGroup)) {
          Result = hg;
          break;
        };
      };
      return Result;
    };
    this.CanAddLevel = function (AHeaderGroups, ASkipHeaderGroup, ALevel, ACheckLevel) {
      var Result = false;
      var I = 0;
      var CountAtLevel0 = 0;
      var CountAtLevel1 = 0;
      var CountAtLevel2 = 0;
      var CurrentLevel = 0;
      if (ASkipHeaderGroup != null) {
        CurrentLevel = ASkipHeaderGroup.FLevel}
       else CurrentLevel = 0;
      if ((ALevel < 0) || (ALevel > 2)) return false;
      if (ACheckLevel) {
        for (var $l = 0, $end = AHeaderGroups.FLength - 1; $l <= $end; $l++) {
          I = $l;
          if ((AHeaderGroups.GetItem(I) !== ASkipHeaderGroup) && (AHeaderGroups.GetItem(I).FLevel === ALevel)) return false;
        };
      };
      CountAtLevel0 = 0;
      CountAtLevel1 = 0;
      CountAtLevel2 = 0;
      for (var $l1 = 0, $end1 = AHeaderGroups.FLength - 1; $l1 <= $end1; $l1++) {
        I = $l1;
        if (AHeaderGroups.GetItem(I) === ASkipHeaderGroup) continue;
        var $tmp = AHeaderGroups.GetItem(I).FLevel;
        if ($tmp === 0) {
          CountAtLevel0 += 1}
         else if ($tmp === 1) {
          CountAtLevel1 += 1}
         else if ($tmp === 2) CountAtLevel2 += 1;
      };
      if (CurrentLevel === ALevel) return true;
      if ((CurrentLevel === 0) && (ALevel === 1)) return CountAtLevel0 > 0;
      if ((CurrentLevel === 1) && (ALevel === 2)) return CountAtLevel1 > 0;
      if ((CurrentLevel === 0) && (ALevel === 2)) return (CountAtLevel0 > 0) && (CountAtLevel1 > 0);
      if ((CurrentLevel === 2) && ((ALevel === 1) || (ALevel === 0))) return true;
      if ((CurrentLevel === 1) && (ALevel === 0)) {
        return ((CountAtLevel2 > 0) && (CountAtLevel1 === 1)) || (CountAtLevel2 === 0);
      };
      Result = false;
      return Result;
    };
    this.DoRootIsFocused = function (Sender) {
      var Result = false;
      Result = pas["WEBLib.TMSFNCDataGridBase"].TTMSFNCDataGridBase.DoRootIsFocused.apply(this,arguments);
      Result = Result && (((this.FFocusedRenderer != null) && (this.FFocusedRenderer === Sender)) || (!(this.FFocusedRenderer != null) && (this.GetRoot() === Sender)));
      return Result;
    };
    this.GetCalculationRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(pas["WEBLib.TMSFNCDataGridBase"].TTMSFNCDataGridBase.GetCalculationRect.call(this));
      Result.Top = Result.Top + this.GetHeaderSize();
      Result.Top = Result.Top + this.GetDesignerTopSize();
      Result.Left = Result.Left + this.GetDesignerLeftSize();
      Result.Bottom = Result.Bottom - this.GetFooterSize();
      Result.Bottom = Result.Bottom - this.GetDesignerBottomSize();
      Result.Right = Result.Right - this.GetDesignerRightSize();
      Result.Right = Result.Left + Math.max(0,Result.Right - Result.Left);
      Result.Bottom = Result.Top + Math.max(0,Result.Bottom - Result.Top);
      return Result;
    };
    this.GetDesignerBottomSize = function () {
      var Result = 0.0;
      Result = 0;
      return Result;
    };
    this.GetDesignerLeftSize = function () {
      var Result = 0.0;
      Result = 0;
      return Result;
    };
    this.GetDesignerRightSize = function () {
      var Result = 0.0;
      Result = 0;
      return Result;
    };
    this.GetDesignerTopSize = function () {
      var Result = 0.0;
      Result = 0;
      return Result;
    };
    this.GetDocURL = function () {
      var Result = "";
      Result = $mod.TTMSFNCDataGridDocURL;
      return Result;
    };
    this.GetFooterRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(pas["WEBLib.TMSFNCDataGridBase"].TTMSFNCDataGridBase.GetCalculationRect.call(this));
      Result.Top = Result.Bottom - this.GetFooterSize() - 1;
      Result.Left = Result.Left + this.GetDesignerLeftSize();
      Result.Bottom = Result.Bottom - this.GetDesignerBottomSize();
      Result.Right = Result.Right - this.GetDesignerRightSize();
      return Result;
    };
    this.GetFooterSize = function () {
      var Result = 0.0;
      Result = 0;
      if (this.FFooter.FVisible) {
        if (this.FFooter.FAutoSize) {
          if (this.FFooter.FPaging.FVisible) Result = this.FFooter.FPaging.FSize;
          if (this.FFooter.FBar.FVisible) Result = Result + this.FFooter.FBar.FSize;
        } else Result = this.FFooter.FSize;
      };
      return Result;
    };
    this.GetFooterBarSize = function () {
      var Result = 0.0;
      Result = 0;
      if (this.FFooter.FVisible && this.FFooter.FBar.FVisible) Result = this.FFooter.FBar.FSize;
      return Result;
    };
    this.GetHeaderBarRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.$assign(this.GetHeaderRect());
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Bottom - this.GetHeaderBarSize(),r.Right,r.Bottom));
      return Result;
    };
    this.GetFooterBarRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.$assign(this.GetFooterRect());
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top,r.Right,r.Top + this.GetFooterBarSize()));
      return Result;
    };
    this.GetHeaderRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(pas["WEBLib.TMSFNCDataGridBase"].TTMSFNCDataGridBase.GetCalculationRect.call(this));
      Result.Top = Result.Top + this.GetDesignerTopSize();
      Result.Left = Result.Left + this.GetDesignerLeftSize();
      Result.Bottom = Result.Top + this.GetHeaderSize() + 1;
      Result.Right = Result.Right - this.GetDesignerRightSize();
      return Result;
    };
    this.GetHeaderVisualGroupingRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var hr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var br = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      hr.$assign(this.GetHeaderRect());
      br.$assign(this.GetHeaderBarRect());
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(hr.Left,hr.Top,hr.Right,br.Top));
      return Result;
    };
    this.GetFooterPagingRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var fr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var br = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      fr.$assign(this.GetFooterRect());
      br.$assign(this.GetFooterBarRect());
      if (this.GetFooterPagingSize() > 0) {
        Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(fr.Left,br.Bottom - 1,fr.Right,fr.Bottom))}
       else Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(fr.Left,br.Bottom - 1,fr.Right,fr.Bottom));
      return Result;
    };
    this.GetFooterPagingSize = function () {
      var Result = 0.0;
      Result = 0;
      if (this.FFooter.FVisible && this.FFooter.FPaging.FVisible) Result = this.FFooter.FPaging.FSize;
      return Result;
    };
    this.GetHeaderSize = function () {
      var Result = 0.0;
      Result = 0;
      if (this.GetHeader().FVisible) {
        if (this.GetHeader().FAutoSize) {
          if (this.GetHeader().FVisualGrouping.FVisible) {
            if (this.FVisualGroupingSize > 0) {
              Result = this.FVisualGroupingSize}
             else Result = this.GetHeader().FVisualGrouping.FSize;
          };
          if (this.GetHeader().FBar.FVisible) Result = Result + this.GetHeader().FBar.FSize;
        } else Result = this.GetHeader().FSize;
      };
      return Result;
    };
    this.GetHeaderBarSize = function () {
      var Result = 0.0;
      Result = 0;
      if (this.GetHeader().FVisible && this.GetHeader().FBar.FVisible) Result = this.GetHeader().FBar.FSize;
      return Result;
    };
    this.GetHintString = function () {
      var Result = "";
      var h = "";
      var r = null;
      Result = pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBase.GetHintString.call(this);
      if (this.FFocusedRenderer != null) {
        r = this.FFocusedRenderer}
       else r = this.GetRoot();
      if (r.HasHint()) {
        h = r.GetHintString();
        Result = h;
      };
      return Result;
    };
    this.GetVersion = function () {
      var Result = "";
      Result = this.$class.GetVersionNumber(1,0,0,1);
      return Result;
    };
    this.HasHint = function () {
      var Result = false;
      var h = "";
      var r = null;
      Result = pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBase.HasHint.call(this);
      if (this.FFocusedRenderer != null) {
        r = this.FFocusedRenderer}
       else r = this.GetRoot();
      if ((r != null) && r.HasHint()) {
        h = r.GetHintString();
        Result = h !== "";
      };
      return Result;
    };
    this.HandleDragOnHeader = function (X, Y) {
      var Result = false;
      var NeedsInit = false;
      var a = false;
      var Col = 0;
      var GI = pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataGroupInfo.$new();
      var DragHG = null;
      var InsertIdx = 0;
      Result = false;
      if (this.FDragHeaderGroup != null) {
        pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(this.FDragHeaderGroup.FRect,X - this.FMoveX,Y - this.FMoveY);
        if (!(this.FTempHeaderGroups != null)) {
          this.FTempHeaderGroups = $mod.TTMSFNCDataGridHeaderGroups.$create("Create$4",[true]);
          GI.$assign(pas["WEBLib.TMSFNCDataGridData"].DefaultGroupInfo());
          this.HeaderGroupsToGroupInfo(this.GetHeaderGroups(),GI);
          this.GroupInfoToHeaderGroups$1(true,pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataGroupInfo.$clone(GI),this.FTempHeaderGroups);
        };
        if (this.FTempHeaderGroups != null) {
          DragHG = null;
          if (this.FTempHeaderGroups.Find(this.FDragHeaderGroup.FColumn,{get: function () {
              return DragHG;
            }, set: function (v) {
              DragHG = v;
            }}) && (DragHG != null)) {
            DragHG.FLevel = this.PositionToHeaderGroupLevel(this.FTempHeaderGroups,DragHG,Y);
            InsertIdx = this.PositionToHeaderGroupIndex(this.FTempHeaderGroups,DragHG,DragHG.FLevel,X);
            if (pas.Math.InRange(InsertIdx,0,this.FTempHeaderGroups.FLength)) {
              this.FTempHeaderGroups.Extract(DragHG);
              this.FTempHeaderGroups.Insert(InsertIdx,DragHG);
            };
            GI.$assign(pas["WEBLib.TMSFNCDataGridData"].DefaultGroupInfo());
            this.HeaderGroupsToGroupInfo(this.FTempHeaderGroups,GI);
            this.GroupInfoToHeaderGroups$1(true,pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataGroupInfo.$clone(GI),this.FTempHeaderGroups);
          };
        };
        this.Invalidate();
        Result = pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetHeaderRect(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y));
      } else if ((this.FDownHeaderGroup != null) && this.GetHeader().FVisualGrouping.FDragging) {
        a = true;
        this.DoCanDragHeaderGroup(this.FDownHeaderGroup.FColumn,{get: function () {
            return a;
          }, set: function (v) {
            a = v;
          }});
        if (a && ((Math.abs(X - this.FDownX) > this.GetOptions().FMouse.FClickMargin) || (Math.abs(Y - this.FDownY) > this.GetOptions().FMouse.FClickMargin))) {
          NeedsInit = !(this.FDragHeaderGroup != null);
          this.FDragHeaderGroup = this.FDownHeaderGroup;
          this.SetControlCursor(12);
          if (NeedsInit) {
            Col = this.FDragHeaderGroup.FColumn;
            this.GetRoot().Update();
            this.GetHeaderGroups().Find(Col,{p: this, get: function () {
                return this.p.FDragHeaderGroup;
              }, set: function (v) {
                this.p.FDragHeaderGroup = v;
              }});
          };
          this.FDownHeaderGroup = null;
        };
        Result = pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetHeaderRect(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y));
      };
      this.FMoveX = X;
      this.FMoveY = Y;
      return Result;
    };
    this.HandleDropOnHeader = function (X, Y, AShift) {
      var Result = false;
      var CurrentHG = null;
      var TargetHG = null;
      var DoAction = false;
      var CanSort = false;
      var Modified = false;
      var Col = 0;
      var Level = 0;
      var InsertIdx = 0;
      var SortIdx = null;
      var SortDir = 0;
      Result = false;
      TargetHG = this.InternalXYToHeaderGroup(X,Y,this.GetHeaderGroups(),true,false);
      if (this.FDraggingOnHeader && this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.GetRoot().FDragCell))) {
        Col = this.GetRoot().FDragCell.GetColumn();
        DoAction = true;
        this.DoBeforeDropHeaderGroup(Col,{get: function () {
            return DoAction;
          }, set: function (v) {
            DoAction = v;
          }});
        if (DoAction) {
          if (!this.GetHeaderGroups().Find(Col,{get: function () {
              return CurrentHG;
            }, set: function (v) {
              CurrentHG = v;
            }})) {
            CurrentHG = $mod.TTMSFNCDataGridHeaderGroup.$create("Create$1");
            CurrentHG.FNew = true;
            CurrentHG.FOnBeforeDraw = rtl.createCallback(this,"DoBeforeDrawHeaderGroup");
            CurrentHG.FOnAfterDraw = rtl.createCallback(this,"DoAfterDrawHeaderGroup");
          };
          if (CurrentHG !== TargetHG) {
            Modified = (CurrentHG.FColumn !== Col) || CurrentHG.FNew;
            CurrentHG.FColumn = Col;
            if (TargetHG != null) {
              Modified = Modified || (CurrentHG.FLevel !== TargetHG.FLevel);
              CurrentHG.FLevel = TargetHG.FLevel;
              if (this.GetHeaderGroups().Contains(CurrentHG)) this.GetHeaderGroups().Extract(CurrentHG);
              this.GetHeaderGroups().Insert(this.GetHeaderGroups().IndexOf(TargetHG),CurrentHG);
            } else {
              Level = this.PositionToHeaderGroupLevel(this.GetHeaderGroups(),CurrentHG,Y);
              Modified = Modified || (CurrentHG.FLevel !== Level);
              CurrentHG.FLevel = Level;
              if (this.GetHeaderGroups().Contains(CurrentHG)) this.GetHeaderGroups().Extract(CurrentHG);
              this.GetHeaderGroups().Add(CurrentHG);
            };
            if (Modified) {
              this.GroupActiveHeaders()}
             else this.Invalidate();
          };
          this.DoAfterDropHeaderGroup(Col);
        };
        if (this.FDragHeaderGroup != null) {
          this.FDragHeaderGroup.Reset();
          this.FDragHeaderGroup = null;
          this.GetRoot().Update();
        };
      } else if (!(this.FDragHeaderGroup != null) && (this.FDownHeaderGroup != null) && (this.FDownHeaderGroup === TargetHG)) {
        CurrentHG = this.FDownHeaderGroup;
        Col = pas.Math.IfThen(CurrentHG != null,CurrentHG.FColumn,-1);
        if ((Col !== -1) && CurrentHG.XYToCloseIndicator(X,Y)) {
          DoAction = true;
          this.DoBeforeCloseHeaderGroup(Col,{get: function () {
              return DoAction;
            }, set: function (v) {
              DoAction = v;
            }});
          if (DoAction) {
            this.GetHeaderGroups().Remove(CurrentHG);
            this.GroupActiveHeaders();
            this.DoAfterCloseHeaderGroup(Col);
          };
        } else if ((Col !== -1) && this.GetOptions().FSorting.FEnabled && this.GetHeader().FVisualGrouping.FSortOnClick) {
          DoAction = true;
          this.DoBeforeSortHeaderGroup(Col,{get: function () {
              return DoAction;
            }, set: function (v) {
              DoAction = v;
            }});
          if (DoAction) {
            CanSort = true;
            this.GetRoot().DoBeforeSortColumn(Col,{get: function () {
                return CanSort;
              }, set: function (v) {
                CanSort = v;
              }});
            if (CanSort) {
              if (!(pas.Classes.TShiftState$a.ssShift in AShift)) this.GetSortIndexList().Clear();
              if (!this.GetSortIndexList().Find(Col,{get: function () {
                  return SortIdx;
                }, set: function (v) {
                  SortIdx = v;
                }})) {
                SortDir = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.IfElse$$$G$$WEBLib$TMSFNCUtils$$TTMSFNCDataGridSortDirection(CurrentHG.FSortIndicator === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellSortIndicator.gsiAscending,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortDirection.gsdDescending,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortDirection.gsdAscending);
                this.GetSortIndexList().Add$1(Col,SortDir);
              } else {
                SortIdx.FDirection = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.IfElse$$$G$$WEBLib$TMSFNCUtils$$TTMSFNCDataGridSortDirection(SortIdx.FDirection === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortDirection.gsdAscending,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortDirection.gsdDescending,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortDirection.gsdAscending);
              };
              if (this.GetRoot().IsGrouped()) {
                this.GetRoot().GroupSortIndexed()}
               else this.GetRoot().SortIndexed();
            };
            this.GetRoot().DoAfterSortColumn(Col);
          };
          this.DoAfterSortHeaderGroup(Col);
        };
        if (Col !== -1) this.DoHeaderGroupClick(Col);
        this.FDownHeaderGroup = null;
        Result = true;
      } else if ((this.FDragHeaderGroup != null) && (TargetHG !== this.FDragHeaderGroup)) {
        CurrentHG = this.FDragHeaderGroup;
        this.FDragHeaderGroup.Reset();
        this.FDragHeaderGroup = null;
        this.FDownHeaderGroup = null;
        Col = CurrentHG.FColumn;
        DoAction = true;
        this.DoBeforeDropHeaderGroup(Col,{get: function () {
            return DoAction;
          }, set: function (v) {
            DoAction = v;
          }});
        if (DoAction) {
          if (TargetHG != null) {
            Modified = CurrentHG.FColumn !== TargetHG.FColumn;
            CurrentHG.FColumn = TargetHG.FColumn;
            CurrentHG.FLevel = TargetHG.FLevel;
            TargetHG.FColumn = Col;
          } else {
            Level = this.PositionToHeaderGroupLevel(this.GetHeaderGroups(),CurrentHG,Y);
            InsertIdx = this.PositionToHeaderGroupIndex(this.GetHeaderGroups(),CurrentHG,Level,X);
            Modified = CurrentHG.FLevel !== Level;
            CurrentHG.FLevel = Level;
            if (pas.Math.InRange(InsertIdx,0,this.GetHeaderGroups().FLength)) {
              this.GetHeaderGroups().Extract(CurrentHG);
              this.GetHeaderGroups().Insert(InsertIdx,CurrentHG);
              Modified = true;
            };
          };
          if (Modified) {
            this.GroupActiveHeaders()}
           else this.GetRoot().Update();
          this.DoAfterDropHeaderGroup(Col);
        };
        Result = true;
      } else if (this.FDraggedOnHeader) {
        this.GetRoot().Update();
        this.FDraggedOnHeader = false;
      };
      if (Result) this.SetControlCursor(0);
      return Result;
    };
    this.StartDragOnHeader = function (X, Y) {
      var Result = false;
      Result = false;
      this.FDownX = X;
      this.FDownY = Y;
      this.FDownHeaderGroup = this.XYToHeaderGroup(X,Y);
      this.FDragHeaderGroup = null;
      if (this.FDownHeaderGroup != null) {
        this.FDownHeaderGroup.FOrigRect.$assign(this.FDownHeaderGroup.FRect);
        Result = true;
      };
      return Result;
    };
    this.PositionToHeaderGroupIndex = function (AHeaderGroups, ASkipHeaderGroup, ALevel, X) {
      var Result = 0;
      var I = 0;
      var HG = null;
      var l = null;
      Result = -1;
      l = pas["Generics.Collections"].TList$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup.$create("Create$1");
      try {
        for (var $l = 0, $end = AHeaderGroups.FLength - 1; $l <= $end; $l++) {
          I = $l;
          HG = AHeaderGroups.GetItem(I);
          if ((HG !== ASkipHeaderGroup) && (HG.FLevel === ALevel)) l.Add(HG);
        };
        for (var $l1 = 0, $end1 = l.FLength - 1; $l1 <= $end1; $l1++) {
          I = $l1;
          HG = l.GetItem(I);
          if ((X >= HG.FRect.Left) && (X <= HG.FRect.Right)) {
            Result = I}
           else if ((X < (HG.FRect.Left + ((HG.FRect.Right - HG.FRect.Left) / 2))) && (I === 0)) {
            Result = Math.max(0,AHeaderGroups.IndexOf(HG) - 1)}
           else if ((X > (HG.FRect.Right - ((HG.FRect.Right - HG.FRect.Left) / 2))) && (I === (l.FLength - 1))) Result = Math.min(AHeaderGroups.FLength - 1,AHeaderGroups.IndexOf(HG) + 1);
        };
      } finally {
        l = rtl.freeLoc(l);
      };
      return Result;
    };
    this.PositionToHeaderGroupLevel = function (AHeaderGroups, ASkipHeaderGroup, Y) {
      var Result = 0;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var hs = 0.0;
      var levelHeight = 0.0;
      var ys = 0.0;
      var L = 0;
      var insertRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (ASkipHeaderGroup != null) {
        Result = ASkipHeaderGroup.FLevel}
       else Result = 0;
      r.$assign(this.GetHeaderRect());
      hs = this.GetHeaderSize();
      if (rtl.length(this.FHeaderLevelRects) > 0) {
        levelHeight = (this.FHeaderLevelRects[0].Bottom - this.FHeaderLevelRects[0].Top) + 2}
       else levelHeight = hs / 3;
      ys = r.Top + 3;
      for (L = 0; L <= 2; L++) {
        if (this.CanAddLevel(AHeaderGroups,ASkipHeaderGroup,L,false)) {
          insertRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,ys,r.Right,Math.min(r.Bottom,ys + levelHeight)));
          if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(insertRect,pas["WEBLib.TMSFNCTypes"].PointF(0,Y))) {
            Result = L;
            return Result;
          };
        };
        ys = ys + levelHeight;
      };
      return Result;
    };
    this.HeaderGroupsToGroupInfo = function (AHeaderGroups, AGroupInfo) {
      var Result = false;
      var sd = 0;
      var h = null;
      var gi = pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataGroupInfo.$new();
      var i = 0;
      var k = 0;
      var l = null;
      var d = null;
      var levelCols = rtl.arraySetLength(null,[],3);
      var levelDirs = rtl.arraySetLength(null,[],3);
      Result = false;
      AGroupInfo.$assign(pas["WEBLib.TMSFNCDataGridData"].DefaultGroupInfo());
      if (AHeaderGroups.FLength === 0) return Result;
      d = pas["Generics.Collections"].TObjectDictionary$$$G$$generics$collections$$Longint$$TObjectList$WEBLib$TMSFNCDataGridData$TTMSFNCDataGridSortIndex$.$create("Create$5",[rtl.createSet(pas["Generics.Collections"].TDictionaryOwnership.doOwnsValues)]);
      try {
        for (var $l = 0, $end = AHeaderGroups.FLength - 1; $l <= $end; $l++) {
          i = $l;
          h = AHeaderGroups.GetItem(i);
          if (!d.TryGetValue(h.FLevel,{get: function () {
              return l;
            }, set: function (v) {
              l = v;
            }})) {
            l = pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCDataGridSortIndex.$create("Create$4",[true]);
            d.Add(h.FLevel,l);
          };
          var $tmp = h.FSortIndicator;
          if ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellSortIndicator.gsiAscending) {
            sd = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortDirection.gsdAscending}
           else if ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellSortIndicator.gsiDescending) {
            sd = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortDirection.gsdDescending}
           else {
            sd = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortDirection.gsdNone;
          };
          l.Add(pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridSortIndex.$create("Create$1",[h.FColumn,sd]));
        };
        var $in = d.GetKeys().GetEnumerator$1();
        try {
          while ($in.MoveNext$1()) {
            i = $in.GetCurrent();
            if ((i >= 0) && (i <= 2)) {
              l = d.GetItem(i);
              levelCols[i] = rtl.arraySetLength(levelCols[i],0,l.FLength);
              levelDirs[i] = rtl.arraySetLength(levelDirs[i],0,l.FLength);
              for (var $l1 = 0, $end1 = l.FLength - 1; $l1 <= $end1; $l1++) {
                k = $l1;
                levelCols[i][k] = l.GetItem(k).FColumn;
                levelDirs[i][k] = l.GetItem(k).FDirection;
              };
            };
          }
        } finally {
          $in = rtl.freeLoc($in)
        };
        if (rtl.length(levelCols[0]) > 0) {
          gi.Columns = rtl.arrayRef(levelCols[0]);
          if (rtl.length(levelCols[1]) > 0) {
            gi.SubColumns = rtl.arraySetLength(gi.SubColumns,pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataGroupInfo,1);
            gi.SubColumns[0].Columns = rtl.arrayRef(levelCols[1]);
            if (rtl.length(levelCols[2]) > 0) {
              gi.SubColumns[0].SubColumns = rtl.arraySetLength(gi.SubColumns[0].SubColumns,pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataGroupInfo,1);
              gi.SubColumns[0].SubColumns[0].Columns = rtl.arrayRef(levelCols[2]);
            };
          };
          AGroupInfo.$assign(gi);
          Result = true;
        };
      } finally {
        d = rtl.freeLoc(d);
      };
      return Result;
    };
    this.GroupInfoToHeaderGroups = function (AIsGrouped, AGroupInfo, AHeaderGroups, ASkipHeaderGroup, AAutoHeaderSize, AHeaderLevelRects) {
      var $Self = this;
      var Result = false;
      var g = null;
      var hr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var gi = pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataGroupInfo.$new();
      var maxh = 0.0;
      var lvl = 0;
      var i = 0;
      function CalculateGroupInfo(AGraphics, AGroupSubInfo, ALevel, ARect) {
        var x = 0.0;
        var height = 0.0;
        var i = 0;
        var hg = null;
        x = ARect.Left;
        maxh = 0;
        for (var $l = 0, $end = rtl.length(AGroupSubInfo.Columns) - 1; $l <= $end; $l++) {
          i = $l;
          if ((ASkipHeaderGroup != null) && (ASkipHeaderGroup.FColumn === AGroupSubInfo.Columns[i])) {
            hg = ASkipHeaderGroup}
           else hg = $mod.TTMSFNCDataGridHeaderGroup.$create("Create$1");
          hg.FOnBeforeDraw = rtl.createCallback($Self,"DoBeforeDrawHeaderGroup");
          hg.FOnAfterDraw = rtl.createCallback($Self,"DoAfterDrawHeaderGroup");
          $Self.InitializeHeaderGroup(AGraphics,hg,AGroupSubInfo.Columns[i],ALevel.get(),x,ARect.Top);
          AHeaderGroups.Add(hg);
          x = hg.GetRect().Right + 4;
          height = hg.GetRect().Bottom - hg.GetRect().Top;
          maxh = Math.max(maxh,height);
          AAutoHeaderSize.set(Math.max(AAutoHeaderSize.get(),hg.GetRect().Bottom));
        };
        if (ALevel.get() >= rtl.length(AHeaderLevelRects.get())) AHeaderLevelRects.set(rtl.arraySetLength(AHeaderLevelRects.get(),pas["WEBLib.TMSFNCTypes"].TRectF,ALevel.get() + 1));
        if (AHeaderLevelRects.get()[ALevel.get()].Bottom < (ARect.Top + maxh)) AHeaderLevelRects.get()[ALevel.get()].$assign(pas["WEBLib.TMSFNCTypes"].RectF(ARect.Left,ARect.Top,ARect.Right,ARect.Top + maxh));
        ALevel.set(ALevel.get() + 1);
        for (var $l1 = 0, $end1 = rtl.length(AGroupSubInfo.SubColumns) - 1; $l1 <= $end1; $l1++) {
          i = $l1;
          CalculateGroupInfo(AGraphics,pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataGroupInfo.$clone(AGroupSubInfo.SubColumns[i]),ALevel,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(x,ARect.Top + maxh + 2,ARect.Right,ARect.Bottom)));
        };
      };
      Result = true;
      AAutoHeaderSize.set(0);
      AHeaderLevelRects.set(rtl.arraySetLength(AHeaderLevelRects.get(),pas["WEBLib.TMSFNCTypes"].TRectF,0));
      for (var $l = AHeaderGroups.FLength - 1; $l >= 0; $l--) {
        i = $l;
        if (AHeaderGroups.GetItem(i) === ASkipHeaderGroup) {
          AHeaderGroups.Extract(ASkipHeaderGroup)}
         else AHeaderGroups.Delete(i);
      };
      if (AIsGrouped) {
        gi.$assign(AGroupInfo);
        g = this.GetCalculateGraphics();
        if (g != null) {
          g.FBitmapContainer = this.GetBitmapContainer();
          hr.$assign(this.GetHeaderRect());
          lvl = 0;
          CalculateGroupInfo(g,pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataGroupInfo.$clone(gi),{get: function () {
              return lvl;
            }, set: function (v) {
              lvl = v;
            }},pas["WEBLib.TMSFNCTypes"].TRectF.$clone(hr));
        };
      };
      if (AAutoHeaderSize.get() === 0) AAutoHeaderSize.set(this.GetHeader().FVisualGrouping.FSize + 2);
      if (AAutoHeaderSize.get() > 0) AAutoHeaderSize.set(AAutoHeaderSize.get() + 2);
      AAutoHeaderSize.set(Math.round(AAutoHeaderSize.get()));
      if ((ASkipHeaderGroup != null) && (this.CanAddLevel(AHeaderGroups,ASkipHeaderGroup,ASkipHeaderGroup.FLevel + 1,true) || this.CanAddLevel(AHeaderGroups,ASkipHeaderGroup,ASkipHeaderGroup.FLevel + 2,true))) AAutoHeaderSize.set(AAutoHeaderSize.get() + maxh + 2);
      return Result;
    };
    this.GroupInfoToHeaderGroups$1 = function (AIsGrouped, AGroupInfo, AHeaderGroups) {
      var Result = false;
      var ah = 0.0;
      var lh = [];
      Result = this.GroupInfoToHeaderGroups(AIsGrouped,pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataGroupInfo.$clone(AGroupInfo),AHeaderGroups,null,{get: function () {
          return ah;
        }, set: function (v) {
          ah = v;
        }},{get: function () {
          return lh;
        }, set: function (v) {
          lh = v;
        }});
      return Result;
    };
    this.DoHeaderButtonClick = function (Sender) {
      var btn = null;
      var b = null;
      if ((Sender != null) && pas["WEBLib.TMSFNCToolBar"].TTMSFNCToolBarButton.isPrototypeOf(Sender)) {
        btn = rtl.as(Sender,pas["WEBLib.TMSFNCToolBar"].TTMSFNCToolBarButton);
        if ((btn.FDataObject != null) && $mod.TTMSFNCDataGridButton.isPrototypeOf(btn.FDataObject)) {
          b = rtl.as(btn.FDataObject,$mod.TTMSFNCDataGridButton);
          if (b.FCallback != null) b.FCallback();
          if (b.FOnClick != null) b.FOnClick(b);
        };
      };
    };
    this.DoFooterButtonClick = function (Sender) {
      var btn = null;
      var b = null;
      if ((Sender != null) && pas["WEBLib.TMSFNCToolBar"].TTMSFNCToolBarButton.isPrototypeOf(Sender)) {
        btn = rtl.as(Sender,pas["WEBLib.TMSFNCToolBar"].TTMSFNCToolBarButton);
        if ((btn.FDataObject != null) && $mod.TTMSFNCDataGridButton.isPrototypeOf(btn.FDataObject)) {
          b = rtl.as(btn.FDataObject,$mod.TTMSFNCDataGridButton);
          if (b.FCallback != null) b.FCallback();
          if (b.FOnClick != null) b.FOnClick(b);
        };
      };
    };
    this.ApplyStyle = function () {
      var c = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ApplyStyle.call(this);
      this.BeginUpdate();
      this.GetRoot().ApplyStyle();
      try {
        c = -1;
        if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleBackgroundFillColor({get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }})) {
          this.GetHeader().FFill.SetColor(c);
          this.FFooter.FFill.SetColor(c);
        };
        if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleBackgroundFillColor({get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }})) {
          this.GetHeader().FVisualGrouping.FLevelIndicationFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(c,30));
          this.GetHeader().FVisualGrouping.FLevelActiveIndicationFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(c,30));
        };
        c = -1;
        if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleHeaderFillColor({get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }})) {
          this.GetHeader().FBar.FFill.SetColor(c);
          this.FFooter.FBar.FFill.SetColor(c);
        };
        c = -1;
        if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleHeaderFillColor({get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }})) {
          this.GetHeader().FVisualGrouping.FLayout.FFill.SetColor(c);
          this.GetHeader().FVisualGrouping.FLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        };
        c = -1;
        if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleHeaderFillColorTo({get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }})) {
          this.GetHeader().FVisualGrouping.FLayout.FFill.SetColorTo(c);
          this.GetHeader().FVisualGrouping.FLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient);
        };
        c = -1;
        if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleTextFontColor({get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }})) this.GetHeader().FVisualGrouping.FLayout.FFont.SetColor(c);
        c = -1;
        if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleLineFillColor({get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }})) {
          this.GetHeader().FVisualGrouping.FLayout.FStroke.SetColor(c);
          this.GetHeader().FStroke.SetColor(c);
          this.GetHeader().FBar.FStroke.SetColor(c);
          this.FFooter.FStroke.SetColor(c);
          this.FFooter.FBar.FStroke.SetColor(c);
          this.GetHeader().FVisualGrouping.FLevelIndicationStroke.SetColor(c);
          this.GetHeader().FVisualGrouping.FLevelActiveIndicationStroke.SetColor(c);
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.CalculateFooter = function () {
      this.CalculateFooterPaging();
      this.CalculateFooterBar();
    };
    this.CalculateFooterPaging = function () {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var x = 0;
      var y = 0;
      var w = 0;
      var h = 0;
      var SinglePage = false;
      if ((this.FUpdateCount$1 > 0) || this.IsDestroying() || ((this.GetRoot() != null) && ((this.GetRoot().GetUpdateCount() > 0) || this.GetRoot().GetIsDestroying()))) return;
      if (!this.FFooter.FVisible || !this.FFooter.FPaging.FVisible || (this.GetFooterSize() <= 0) || (this.GetFooterPagingSize() <= 0) || !this.GetPaging()) {
        if (this.FFooterPageSelector != null) this.FFooterPageSelector.SetVisible(false);
        if (this.FFooterPageInfo != null) this.FFooterPageInfo.SetVisible(false);
        if (this.FFooterFirstPageButton != null) this.FFooterFirstPageButton.SetVisible(false);
        if (this.FFooterPreviousPageButton != null) this.FFooterPreviousPageButton.SetVisible(false);
        if (this.FFooterNextPageButton != null) this.FFooterNextPageButton.SetVisible(false);
        if (this.FFooterLastPageButton != null) this.FFooterLastPageButton.SetVisible(false);
        return;
      };
      SinglePage = this.GetPageCount() <= 1;
      r.$assign(this.GetFooterPagingRect());
      x = Math.round(r.Left) + 4;
      y = Math.round(r.Top) + 4;
      h = Math.round(r.Bottom - r.Top) - 8;
      if (this.FFooter.FPaging.FShowNavigationButtons) {
        w = this.FFooter.FPaging.FNavigationButtonWidth;
        this.GetFooterFirstPageButton().SetBounds(x,y,w,h);
        this.GetFooterFirstPageButton().SetVisible(true);
        this.GetFooterFirstPageButton().SetEnabled(!SinglePage);
        if (this.GetFooterFirstPageButton().GetAdaptToStyle() !== this.GetAdaptToStyle()) this.GetFooterFirstPageButton().SetAdaptToStyle(this.GetAdaptToStyle());
        x = x + w + 4;
        this.GetFooterPreviousPageButton().SetBounds(x,y,w,h);
        this.GetFooterPreviousPageButton().SetVisible(true);
        this.GetFooterPreviousPageButton().SetEnabled(!SinglePage);
        if (this.GetFooterPreviousPageButton().GetAdaptToStyle() !== this.GetAdaptToStyle()) this.GetFooterPreviousPageButton().SetAdaptToStyle(this.GetAdaptToStyle());
        x = x + w + 4;
      } else {
        this.GetFooterFirstPageButton().SetVisible(false);
        this.GetFooterPreviousPageButton().SetVisible(false);
      };
      if (this.FFooter.FPaging.FShowPageSelector) {
        w = this.FFooter.FPaging.FPageSelectorWidth;
        this.GetFooterPageSelector().SetBounds(x,y,w,h);
        this.GetFooterPageSelector().SetVisible(true);
        this.GetFooterPageSelector().SetEnabled(!SinglePage);
        if (this.GetFooterPageSelector().GetAdaptToStyle() !== this.GetAdaptToStyle()) this.GetFooterPageSelector().SetAdaptToStyle(this.GetAdaptToStyle());
        x = x + w + 4;
      } else this.GetFooterPageSelector().SetVisible(false);
      if (this.FFooter.FPaging.FShowPageInfo) {
        w = this.FFooter.FPaging.FPageInfoWidth;
        this.GetFooterPageInfo().SetBounds(x,y,w,h);
        this.GetFooterPageInfo().SetVisible(true);
        if (this.GetFooterPageInfo().GetAdaptToStyle() !== this.GetAdaptToStyle()) this.GetFooterPageInfo().SetAdaptToStyle(this.GetAdaptToStyle());
        x = x + w + 4;
      } else this.GetFooterPageInfo().SetVisible(false);
      if (this.FFooter.FPaging.FShowNavigationButtons) {
        w = this.FFooter.FPaging.FNavigationButtonWidth;
        this.GetFooterNextPageButton().SetBounds(x,y,w,h);
        this.GetFooterNextPageButton().SetVisible(true);
        this.GetFooterNextPageButton().SetEnabled(!SinglePage);
        if (this.GetFooterNextPageButton().GetAdaptToStyle() !== this.GetAdaptToStyle()) this.GetFooterNextPageButton().SetAdaptToStyle(this.GetAdaptToStyle());
        x = x + w + 4;
        this.GetFooterLastPageButton().SetBounds(x,y,w,h);
        this.GetFooterLastPageButton().SetVisible(true);
        this.GetFooterLastPageButton().SetEnabled(!SinglePage);
        if (this.GetFooterLastPageButton().GetAdaptToStyle() !== this.GetAdaptToStyle()) this.GetFooterLastPageButton().SetAdaptToStyle(this.GetAdaptToStyle());
      } else {
        this.GetFooterNextPageButton().SetVisible(false);
        this.GetFooterLastPageButton().SetVisible(false);
      };
    };
    this.CalculateFooterBar = function () {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var I = 0;
      var x = 0;
      var y = 0;
      var w = 0;
      var h = 0;
      var b = null;
      var btn = null;
      var c = null;
      if ((this.FUpdateCount$1 > 0) || this.IsDestroying() || ((this.GetRoot() != null) && ((this.GetRoot().GetUpdateCount() > 0) || this.GetRoot().GetIsDestroying()))) return;
      if (!this.FFooter.FVisible || !this.FFooter.FBar.FVisible || (this.GetFooterSize() <= 0) || (this.GetFooterBarSize() <= 0)) {
        for (var $l = 0, $end = this.FFooter.FBar.FButtons.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          b = this.FFooter.FBar.FButtons.GetItemEx(I);
          if (b.GetButton() != null) b.GetButton().SetVisible(false);
        };
        return;
      };
      r.$assign(this.GetFooterBarRect());
      x = Math.round(r.Left) + 4;
      y = Math.round(r.Top) + 4;
      for (var $l1 = 0, $end1 = this.FFooter.FBar.FButtons.GetCount() - 1; $l1 <= $end1; $l1++) {
        I = $l1;
        b = this.FFooter.FBar.FButtons.GetItemEx(I);
        w = Math.round(b.FWidth);
        h = Math.round(r.Bottom - r.Top) - 8;
        if (b.FControl != null) {
          c = b.FControl;
          c.SetParent(this);
          c.SetEnabled(b.FEnabled);
          c.SetVisible(b.FVisible);
          c.SetHint(b.FHint);
          c.SetBounds(x,y,w,h);
          if (c.FVisible) x = x + w + 4;
        } else {
          btn = b.GetButton();
          if (btn != null) {
            btn.FDataObject = b;
            btn.FOnClick = rtl.createCallback(this,"DoFooterButtonClick");
            btn.SetParent(this);
            btn.SetText(b.FText);
            btn.SetHint(b.FHint);
            btn.SetEnabled(b.FEnabled);
            btn.SetVisible(b.FVisible);
            if (btn.GetAdaptToStyle() !== this.GetAdaptToStyle()) btn.SetAdaptToStyle(this.GetAdaptToStyle());
            btn.FBitmaps.Clear();
            btn.FBitmaps.AddBitmap(b.FBitmap,1.0);
            btn.SetBounds(x,y,w,h);
            if (btn.FVisible) x = x + w + 4;
          };
        };
      };
    };
    this.DoFooterPageSelectorChange = function (Sender, AItemIndex) {
      var pi = 0;
      if (this.FOnFooterPageSelectorChange != null) {
        this.FOnFooterPageSelectorChange(Sender)}
       else {
        if ((this.GetFooterPageSelector() != null) && (this.GetFooterPageSelector().GetSelectedItemIndex() >= 0)) {
          pi = this.GetPageIndex();
          this.SetPageIndex(this.GetFooterPageSelector().GetSelectedItemIndex());
          this.DoPageChanged(pi,this.GetPageIndex());
        };
      };
      this.UpdatePagingControls();
    };
    this.DoFooterFirstPageClick = function (Sender) {
      var pi = 0;
      if (this.FOnFooterFirstPageClick != null) {
        this.FOnFooterFirstPageClick(Sender)}
       else {
        pi = this.GetPageIndex();
        this.FirstPage();
        this.DoPageChanged(pi,this.GetPageIndex());
      };
      this.UpdatePagingControls();
    };
    this.DoFooterPreviousPageClick = function (Sender) {
      var pi = 0;
      if (this.FOnFooterPreviousPageClick != null) {
        this.FOnFooterPreviousPageClick(Sender)}
       else {
        pi = this.GetPageIndex();
        this.PreviousPage();
        this.DoPageChanged(pi,this.GetPageIndex());
      };
      this.UpdatePagingControls();
    };
    this.DoFooterNextPageClick = function (Sender) {
      var pi = 0;
      if (this.FOnFooterNextPageClick != null) {
        this.FOnFooterNextPageClick(Sender)}
       else {
        pi = this.GetPageIndex();
        this.NextPage();
        this.DoPageChanged(pi,this.GetPageIndex());
      };
      this.UpdatePagingControls();
    };
    this.DoFooterLastPageClick = function (Sender) {
      var pi = 0;
      if (this.FOnFooterLastPageClick != null) {
        this.FOnFooterLastPageClick(Sender)}
       else {
        pi = this.GetPageIndex();
        this.LastPage();
        this.DoPageChanged(pi,this.GetPageIndex());
      };
      this.UpdatePagingControls();
    };
    this.UpdatePagingControls = function () {
      this.CalculateFooterPaging();
    };
    this.CalculateHeader = function () {
      this.CalculateHeaderVisualGrouping();
      this.CalculateHeaderBar();
    };
    this.CalculateHeaderVisualGrouping = function () {
      if ((this.FUpdateCount$1 > 0) || this.IsDestroying() || ((this.GetRoot() != null) && ((this.GetRoot().GetUpdateCount() > 0) || this.GetRoot().GetIsDestroying()))) return;
      if (!this.GetHeader().FVisible || !this.GetHeader().FVisualGrouping.FVisible) return;
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FTempHeaderGroups;
        }, set: function (v) {
          this.p.FTempHeaderGroups = v;
        }});
      this.FVisualGroupingSize = 0;
      this.FHeaderLevelRects = rtl.arraySetLength(this.FHeaderLevelRects,pas["WEBLib.TMSFNCTypes"].TRectF,0);
      this.GroupInfoToHeaderGroups(this.GetRoot().IsGrouped(),pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataGroupInfo.$clone(this.GetRoot().FGroupInfo),this.GetHeaderGroups(),this.FDragHeaderGroup,{p: this, get: function () {
          return this.p.FVisualGroupingSize;
        }, set: function (v) {
          this.p.FVisualGroupingSize = v;
        }},{p: this, get: function () {
          return this.p.FHeaderLevelRects;
        }, set: function (v) {
          this.p.FHeaderLevelRects = v;
        }});
    };
    this.CalculateHeaderBar = function () {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var I = 0;
      var x = 0;
      var y = 0;
      var w = 0;
      var h = 0;
      var b = null;
      var btn = null;
      var c = null;
      if ((this.FUpdateCount$1 > 0) || this.IsDestroying() || ((this.GetRoot() != null) && ((this.GetRoot().GetUpdateCount() > 0) || this.GetRoot().GetIsDestroying()))) return;
      if (!this.GetHeader().FVisible || !this.GetHeader().FBar.FVisible || (this.GetHeaderSize() <= 0) || (this.GetHeaderBarSize() <= 0)) {
        for (var $l = 0, $end = this.GetHeader().FBar.FButtons.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          b = this.GetHeader().FBar.FButtons.GetItemEx(I);
          if (b.GetButton() != null) b.GetButton().SetVisible(false);
        };
        return;
      };
      r.$assign(this.GetHeaderBarRect());
      x = Math.round(r.Left) + 4;
      y = Math.round(r.Top) + 4;
      for (var $l1 = 0, $end1 = this.GetHeader().FBar.FButtons.GetCount() - 1; $l1 <= $end1; $l1++) {
        I = $l1;
        b = this.GetHeader().FBar.FButtons.GetItemEx(I);
        w = Math.round(b.FWidth);
        h = Math.round(r.Bottom - r.Top) - 8;
        if (b.FControl != null) {
          c = b.FControl;
          c.SetParent(this);
          c.SetEnabled(b.FEnabled);
          c.SetVisible(b.FVisible);
          c.SetHint(b.FHint);
          c.SetBounds(x,y,w,h);
          if (c.FVisible) x = x + w + 4;
        } else {
          btn = b.GetButton();
          if (btn != null) {
            btn.FDataObject = b;
            btn.FOnClick = rtl.createCallback(this,"DoHeaderButtonClick");
            btn.SetParent(this);
            btn.SetText(b.FText);
            btn.SetHint(b.FHint);
            btn.SetEnabled(b.FEnabled);
            btn.SetVisible(b.FVisible);
            if (btn.GetAdaptToStyle() !== this.GetAdaptToStyle()) btn.SetAdaptToStyle(this.GetAdaptToStyle());
            btn.FBitmaps.Clear();
            btn.FBitmaps.AddBitmap(b.FBitmap,1.0);
            btn.SetBounds(x,y,w,h);
            if (btn.FVisible) x = x + w + 4;
          };
        };
      };
    };
    this.ChangeDPIScale = function (M, D) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.ChangeDPIScale.apply(this,arguments);
      this.BeginUpdate();
      try {
        this.GetHeader().FVisualGrouping.FLayout.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.GetHeader().FVisualGrouping.FLayout.FFont.FHeight,M,D));
        this.GetHeader().FBar.SetSize(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.GetHeader().FBar.FSize,M,D));
        this.GetHeader().FVisualGrouping.SetSize(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.GetHeader().FVisualGrouping.FSize,M,D));
        this.GetHeader().SetSize(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.GetHeader().FSize,M,D));
        this.FFooter.FBar.SetSize(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FFooter.FBar.FSize,M,D));
        this.FFooter.FPaging.SetSize(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FFooter.FPaging.FSize,M,D));
        this.FFooter.SetSize(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FFooter.FSize,M,D));
        this.GetRoot().ChangeDPIScale(M,D);
      } finally {
        this.EndUpdate();
      };
    };
    this.DestroyGraphicElements = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.DestroyGraphicElements.call(this);
      this.ClearControlCache();
    };
    this.DoPageChanged = function (AOldPageIndex, ANewPageIndex) {
      if (this.FOnPageChanged != null) this.FOnPageChanged(this,AOldPageIndex,ANewPageIndex);
    };
    this.DoCustomizeHeaderGroup = function (AHeaderGroup) {
      if (this.FOnCustomizeHeaderGroup != null) this.FOnCustomizeHeaderGroup(this,AHeaderGroup);
    };
    this.DoBeforeDrawHeader = function (AGraphics, ARect, ACanDraw) {
      if (this.FOnBeforeDrawHeader != null) this.FOnBeforeDrawHeader(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),ACanDraw);
    };
    this.DoAfterDrawHeader = function (AGraphics, ARect) {
      if (this.FOnAfterDrawHeader != null) this.FOnAfterDrawHeader(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect));
    };
    this.DoBeforeDrawFooter = function (AGraphics, ARect, ACanDraw) {
      if (this.FOnBeforeDrawFooter != null) this.FOnBeforeDrawFooter(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),ACanDraw);
    };
    this.DoAfterDrawFooter = function (AGraphics, ARect) {
      if (this.FOnAfterDrawFooter != null) this.FOnAfterDrawFooter(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect));
    };
    this.DoAfterDrawHeaderGroupLevel = function (AGraphics, ARect, ALevel, AActive) {
      if (this.FOnAfterDrawHeaderGroupLevel != null) this.FOnAfterDrawHeaderGroupLevel(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),ALevel,AActive);
    };
    this.DoBeforeDrawHeaderGroupLevel = function (AGraphics, ARect, ALevel, AActive, ACanDraw) {
      if (this.FOnBeforeDrawHeaderGroupLevel != null) this.FOnBeforeDrawHeaderGroupLevel(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),ALevel,AActive,ACanDraw);
    };
    this.DoAfterDrawHeaderGroup = function (Sender, AGraphics) {
      if ((this.FOnAfterDrawHeaderGroup != null) && $mod.TTMSFNCDataGridHeaderGroup.isPrototypeOf(Sender)) this.FOnAfterDrawHeaderGroup(this,AGraphics,rtl.as(Sender,$mod.TTMSFNCDataGridHeaderGroup));
    };
    this.DoBeforeDrawHeaderGroup = function (Sender, AGraphics, ACanDraw) {
      if ((this.FOnBeforeDrawHeaderGroup != null) && $mod.TTMSFNCDataGridHeaderGroup.isPrototypeOf(Sender)) this.FOnBeforeDrawHeaderGroup(this,AGraphics,rtl.as(Sender,$mod.TTMSFNCDataGridHeaderGroup),ACanDraw);
    };
    this.DoBeforeDropHeaderGroup = function (AColumn, ACanDrop) {
      if (this.FOnBeforeDropHeaderGroup != null) this.FOnBeforeDropHeaderGroup(this,AColumn,ACanDrop);
    };
    this.DoCanDragHeaderGroup = function (AColumn, ACanDrag) {
      if (this.FOnCanDragHeaderGroup != null) this.FOnCanDragHeaderGroup(this,AColumn,ACanDrag);
    };
    this.DoAfterDropHeaderGroup = function (AColumn) {
      if (this.FOnAfterDropHeaderGroup != null) this.FOnAfterDropHeaderGroup(this,AColumn);
    };
    this.DoBeforeSortHeaderGroup = function (AColumn, ACanSort) {
      if (this.FOnBeforeSortHeaderGroup != null) this.FOnBeforeSortHeaderGroup(this,AColumn,ACanSort);
    };
    this.DoAfterSortHeaderGroup = function (AColumn) {
      if (this.FOnAfterSortHeaderGroup != null) this.FOnAfterSortHeaderGroup(this,AColumn);
    };
    this.DoBeforeCloseHeaderGroup = function (AColumn, ACanClose) {
      if (this.FOnBeforeCloseHeaderGroup != null) this.FOnBeforeCloseHeaderGroup(this,AColumn,ACanClose);
    };
    this.DoAfterCloseHeaderGroup = function (AColumn) {
      if (this.FOnAfterCloseHeaderGroup != null) this.FOnAfterCloseHeaderGroup(this,AColumn);
    };
    this.DoHeaderGroupClick = function (AColumn) {
      if (this.FOnHeaderGroupClick != null) this.FOnHeaderGroupClick(this,AColumn);
    };
    this.DoUngroup = function () {
      if (this.FOnUngroup != null) this.FOnUngroup(this);
    };
    this.DoGroup = function () {
      if (this.FOnGroup != null) this.FOnGroup(this);
    };
    this.DoEnter = function () {
      pas["WEBLib.Controls"].TControl.DoEnter.call(this);
      if (this.FFocusedRenderer != null) {
        this.FFocusedRenderer.HandleEnter()}
       else this.GetRoot().HandleEnter();
    };
    this.DoExit = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.DoExit.call(this);
      if (this.FFocusedRenderer != null) {
        this.FFocusedRenderer.HandleExit()}
       else this.GetRoot().HandleExit();
    };
    this.DoRootFocus = function (Sender) {
      if (this.CanFocus()) this.SetFocus();
      if (this.FFocusedRenderer != null) this.FFocusedRenderer.ClearFocus();
      if ((this.FFocusedRenderer != null) && (this.FFocusedRenderer !== Sender)) {
        this.FFocusedRenderer.ClearSelection();
        this.FFocusedRenderer.StopEditing(true);
      };
      if (pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridRenderer.isPrototypeOf(Sender)) this.FFocusedRenderer = rtl.as(Sender,pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridRenderer);
      this.GetRoot().Display();
    };
    this.DoRootBeforeCalculate = function (Sender) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var cr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      pas["WEBLib.TMSFNCDataGridBase"].TTMSFNCDataGridBase.DoRootBeforeCalculate.apply(this,arguments);
      if ((this.FUpdateCount$1 > 0) || this.IsDestroying() || ((this.GetRoot() != null) && ((this.GetRoot().GetUpdateCount() > 0) || this.GetRoot().GetIsDestroying()))) return;
      try {
        this.Calculate();
      } finally {
      };
      r.$assign(this.GetRoot().GetLocalRect());
      cr.$assign(this.GetCalculationRect());
      if (!pas["WEBLib.TMSFNCTypes"].EqualRectEx(r,cr)) this.GetRoot().SetLocalRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(cr));
    };
    this.DoRootAfterCalculate = function (Sender) {
      pas["WEBLib.TMSFNCDataGridBase"].TTMSFNCDataGridBase.DoRootAfterCalculate.apply(this,arguments);
      if ((this.FUpdateCount$1 > 0) || this.IsDestroying() || ((this.GetRoot() != null) && ((this.GetRoot().GetUpdateCount() > 0) || this.GetRoot().GetIsDestroying()))) return;
      try {
        this.CalculateFooterPagingLabels();
      } finally {
      };
    };
    this.DoRootUpdateCursor = function (Sender, ACursor) {
      pas["WEBLib.TMSFNCDataGridBase"].TTMSFNCDataGridBase.DoRootUpdateCursor.apply(this,arguments);
      this.SetControlCursor(ACursor);
    };
    this.DrawFooter = function (AGraphics) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var c = false;
      if (!this.FFooter.FVisible || (this.GetFooterSize() <= 0)) return;
      c = true;
      r.$assign(this.GetFooterRect());
      this.DoBeforeDrawFooter(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),{get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }});
      if (c) {
        this.DrawFooterBackground(AGraphics);
        this.DrawFooterBar(AGraphics);
        this.DoAfterDrawFooter(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r));
      };
    };
    this.DrawFooterBackground = function (AGraphics) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (!this.FFooter.FVisible || (this.GetFooterSize() <= 0)) return;
      r.$assign(this.GetFooterRect());
      AGraphics.FFill.Assign(this.FFooter.FFill);
      AGraphics.FStroke.Assign(this.FFooter.FStroke);
      AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
    };
    this.DrawHeader = function (AGraphics) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var c = false;
      if (!this.GetHeader().FVisible || (this.GetHeaderSize() <= 0)) return;
      c = true;
      r.$assign(this.GetHeaderRect());
      this.DoBeforeDrawHeader(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),{get: function () {
          return c;
        }, set: function (v) {
          c = v;
        }});
      if (c) {
        this.DrawHeaderBackground(AGraphics);
        this.DrawHeaderBar(AGraphics);
        if (this.FTempHeaderGroups != null) {
          this.DrawHeaderGroups(AGraphics,this.FTempHeaderGroups)}
         else this.DrawHeaderGroups(AGraphics,this.GetHeaderGroups());
        this.DoAfterDrawHeader(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r));
      };
    };
    this.DrawHeaderBackground = function (AGraphics) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (!this.GetHeader().FVisible || (this.GetHeaderSize() <= 0)) return;
      r.$assign(this.GetHeaderRect());
      AGraphics.FFill.Assign(this.GetHeader().FFill);
      AGraphics.FStroke.Assign(this.GetHeader().FStroke);
      AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
    };
    this.DrawHeaderBar = function (AGraphics) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (!this.GetHeader().FVisible || !this.GetHeader().FBar.FVisible || (this.GetHeaderSize() <= 0) || (this.GetHeaderBarSize() <= 0)) return;
      r.$assign(this.GetHeaderBarRect());
      AGraphics.FFill.Assign(this.GetHeader().FBar.FFill);
      AGraphics.FStroke.Assign(this.GetHeader().FBar.FStroke);
      AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
    };
    this.DrawFooterBar = function (AGraphics) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (!this.FFooter.FVisible || !this.FFooter.FBar.FVisible || (this.GetFooterSize() <= 0) || (this.GetFooterBarSize() <= 0)) return;
      r.$assign(this.GetFooterBarRect());
      AGraphics.FFill.Assign(this.FFooter.FBar.FFill);
      AGraphics.FStroke.Assign(this.FFooter.FBar.FStroke);
      AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
    };
    var InsertRects$a$clone = function (a) {
      var b = [];
      b.length = 3;
      for (var c = 0; c < 3; c++) b[c] = pas["WEBLib.TMSFNCTypes"].TRectF.$clone(a[c]);
      return b;
    };
    this.DrawHeaderGroups = function (AGraphics, AHeaderGroups) {
      var $Self = this;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var I = 0;
      var L = 0;
      var hg = null;
      var hgn = null;
      var levelHeight = 0.0;
      var hs = 0.0;
      var y = 0.0;
      var InsertRects = rtl.arraySetLength(null,pas["WEBLib.TMSFNCTypes"].TRectF,3);
      var st = null;
      function DrawLevel(ARect, ALevel, AIndication) {
        var a = false;
        pas["WEBLib.TMSFNCTypes"].InflateRectEx(ARect,-1,-1);
        a = true;
        $Self.DoBeforeDrawHeaderGroupLevel(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),ALevel,AIndication,{get: function () {
            return a;
          }, set: function (v) {
            a = v;
          }});
        if (a) {
          if (AIndication) {
            AGraphics.FStroke.Assign($Self.GetHeader().FVisualGrouping.FLevelActiveIndicationStroke);
            AGraphics.FFill.Assign($Self.GetHeader().FVisualGrouping.FLevelActiveIndicationFill);
          } else {
            AGraphics.FStroke.Assign($Self.GetHeader().FVisualGrouping.FLevelIndicationStroke);
            AGraphics.FFill.Assign($Self.GetHeader().FVisualGrouping.FLevelIndicationFill);
          };
          if (AGraphics.FStroke.FKind in rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskDash,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskDot,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskDashDot,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskDashDotDot)) AGraphics.StartSpecialPen();
          AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
          if (AGraphics.FStroke.FKind in rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskDash,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskDot,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskDashDot,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskDashDotDot)) AGraphics.StopSpecialPen();
          $Self.DoAfterDrawHeaderGroupLevel(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),ALevel,AIndication);
        };
      };
      if (!this.GetHeader().FVisible || !this.GetHeader().FVisualGrouping.FVisible || (this.GetHeaderSize() <= 0)) return;
      st = AGraphics.SaveState(false);
      try {
        AGraphics.ClipRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.GetHeaderVisualGroupingRect()));
        if ((this.FDraggingOnHeader || (this.FDragHeaderGroup != null)) && (AHeaderGroups.FLength > 1)) {
          r.$assign(this.GetHeaderRect());
          hs = this.GetHeaderSize();
          if (rtl.length(this.FHeaderLevelRects) > 0) {
            levelHeight = (this.FHeaderLevelRects[0].Bottom - this.FHeaderLevelRects[0].Top) + 2}
           else levelHeight = hs / 3;
          y = r.Top + 3;
          for (L = 0; L <= 2; L++) {
            InsertRects[L].$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,y,r.Right,Math.min(r.Bottom,y + levelHeight)));
            y = y + levelHeight;
          };
          for (var $l = 2; $l >= 0; $l--) {
            L = $l;
            if (this.CanAddLevel(this.GetHeaderGroups(),this.FDragHeaderGroup,L,false)) DrawLevel(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(InsertRects[L]),L,pas["WEBLib.TMSFNCTypes"].PtInRectEx(InsertRects[L],pas["WEBLib.TMSFNCTypes"].PointF(this.FMoveX,this.FMoveY)));
          };
        };
        for (var $l1 = 0, $end = AHeaderGroups.FLength - 1; $l1 <= $end; $l1++) {
          I = $l1;
          hg = AHeaderGroups.GetItem(I);
          if (!(this.FDragHeaderGroup != null) && this.GetHeader().FVisualGrouping.FConnectionLines && (I < (AHeaderGroups.FLength - 1))) {
            AGraphics.FStroke.Assign(this.GetHeader().FVisualGrouping.FConnectionStroke);
            hgn = AHeaderGroups.GetItem(I + 1);
            AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(hg.GetRect().Right,hg.GetRect().Top + ((hg.GetRect().Bottom - hg.GetRect().Top) / 2))),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(hgn.GetRect().Left - 4,hg.GetRect().Top + ((hg.GetRect().Bottom - hg.GetRect().Top) / 2))),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
            if (hgn.FLevel === hg.FLevel) {
              AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(hgn.GetRect().Left - 4,hg.GetRect().Top + ((hg.GetRect().Bottom - hg.GetRect().Top) / 2))),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(hgn.GetRect().Left,hg.GetRect().Top + ((hg.GetRect().Bottom - hg.GetRect().Top) / 2))),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown)}
             else {
              AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(hgn.GetRect().Left - 4,hg.GetRect().Top + ((hg.GetRect().Bottom - hg.GetRect().Top) / 2))),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(hgn.GetRect().Left - 4,hgn.GetRect().Top + ((hgn.GetRect().Bottom - hgn.GetRect().Top) / 2))),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
              AGraphics.DrawLine$1(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(hgn.GetRect().Left - 4,hgn.GetRect().Top + ((hgn.GetRect().Bottom - hgn.GetRect().Top) / 2))),pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCTypes"].PointF(hgn.GetRect().Left,hgn.GetRect().Top + ((hgn.GetRect().Bottom - hgn.GetRect().Top) / 2))),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyPointMode.gcpmRightDown);
            };
          };
          if (!hg.FNew) {
            hg.FActive = this.FDragHeaderGroup === hg;
            hg.Draw(AGraphics);
          };
        };
      } finally {
        AGraphics.RestoreState(st,false);
      };
    };
    this.FooterChangedRebuild = function (Sender) {
      this.UpdateRoot();
    };
    this.GroupActiveHeaders = function () {
      var gi = pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataGroupInfo.$new();
      this.BeginUpdate();
      try {
        if (this.IsGrouped()) {
          this.DoUngroup();
          this.Ungroup();
        };
        gi.$assign(pas["WEBLib.TMSFNCDataGridData"].DefaultGroupInfo());
        if (this.HeaderGroupsToGroupInfo(this.GetHeaderGroups(),gi)) {
          this.Group$2(pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataGroupInfo.$clone(gi),null,null,null,null);
          this.DoGroup();
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.HandleDblClick = function (X, Y) {
      var m = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseInfo.$new();
      var r = null;
      var c = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleDblClick.apply(this,arguments);
      c.$assign(this.ScreenToLocalEx(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetMousePos())));
      m.$assign(pas["WEBLib.TMSFNCDataGridCell"].DefaultMouseInfo());
      m.Kind = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseKind.gmkDouble;
      m.Handled = false;
      m.X = c.X;
      m.Y = c.Y;
      r = this.GetRoot().XYToRenderer(X,Y);
      if (!(r != null)) r = this.GetRoot();
      if (r != null) r.HandleMouse(m);
      this.FDoubleClicked = true;
    };
    this.HandleDialogKey = function (Key, Shift) {
      var k = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridKeyInfo.$new();
      k.$assign(pas["WEBLib.TMSFNCDataGridCell"].DefaultKeyInfo());
      k.Handled = true;
      k.Key = Key.get();
      k.Kind = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridKeyKind.gkkDialog;
      k.Shift = rtl.refSet(Shift);
      if (this.FFocusedRenderer != null) {
        this.FFocusedRenderer.HandleKey(k)}
       else this.GetRoot().HandleKey(k);
      Key.set(k.Key);
      if (k.Handled) pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleDialogKey.apply(this,arguments);
    };
    this.HandleDragDrop = function (Source, Point) {
      var c = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var r = null;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleDragDrop.apply(this,arguments);
      if (this.FOnDragDrop != null) return;
      c.$assign(this.ScreenToLocalEx(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetMousePos())));
      r = this.GetRoot().XYToRenderer(c.X,c.Y);
      if (!(r != null)) r = this.GetRoot();
      if (r != null) r.HandleDragDrop(Source,Point);
    };
    this.HandleDragOver = function (Source, Point, Accept) {
      var c = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var r = null;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleDragOver.apply(this,arguments);
      if (this.FOnDragOver != null) return;
      c.$assign(Point);
      r = this.GetRoot().XYToRenderer(c.X,c.Y);
      if (!(r != null)) r = this.GetRoot();
      if (r != null) r.HandleDragOver(Source,Point,Accept);
    };
    this.HandleKeyDown = function (Key, Shift) {
      var k = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridKeyInfo.$new();
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleKeyDown.apply(this,arguments);
      k.$assign(pas["WEBLib.TMSFNCDataGridCell"].DefaultKeyInfo());
      k.Key = Key.get();
      k.Shift = rtl.refSet(Shift);
      k.Kind = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridKeyKind.gkkDown;
      if (this.FFocusedRenderer != null) {
        this.FFocusedRenderer.HandleKey(k)}
       else this.GetRoot().HandleKey(k);
      Key.set(k.Key);
    };
    this.HandleKeyPress = function (Key) {
      var k = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridKeyInfo.$new();
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleKeyPress.apply(this,arguments);
      k.$assign(pas["WEBLib.TMSFNCDataGridCell"].DefaultKeyInfo());
      k.Key = Key.get().charCodeAt();
      k.KeyChar = Key.get();
      k.Kind = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridKeyKind.gkkPress;
      if (this.FFocusedRenderer != null) {
        this.FFocusedRenderer.HandleKey(k)}
       else this.GetRoot().HandleKey(k);
      Key.set(k.KeyChar);
    };
    this.HandleKeyUp = function (Key, Shift) {
      var k = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridKeyInfo.$new();
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleKeyUp.apply(this,arguments);
      k.$assign(pas["WEBLib.TMSFNCDataGridCell"].DefaultKeyInfo());
      k.Key = Key.get();
      k.Shift = rtl.refSet(Shift);
      k.Kind = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridKeyKind.gkkUp;
      if (this.FFocusedRenderer != null) {
        this.FFocusedRenderer.HandleKey(k)}
       else this.GetRoot().HandleKey(k);
      Key.set(k.Key);
    };
    this.HandleMouseDown = function (Button, Shift, X, Y) {
      var m = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseInfo.$new();
      var r = null;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseDown.apply(this,arguments);
      if (!this.FDoubleClicked && ((!(this.FPopupMenu != null) && (pas["WEBLib.Controls"].TMouseButton.mbRight === Button)) || (pas["WEBLib.Controls"].TMouseButton.mbRight !== Button))) this.CaptureEx();
      this.FDoubleClicked = false;
      if ((pas["WEBLib.Controls"].TMouseButton.mbLeft === Button) && this.StartDragOnHeader(X,Y)) return;
      m.$assign(pas["WEBLib.TMSFNCDataGridCell"].DefaultMouseInfo());
      m.Shift = rtl.refSet(Shift);
      m.X = X;
      m.Y = Y;
      m.Button = Button;
      m.Kind = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseKind.gmkDown;
      r = this.GetRoot().XYToRenderer(X,Y);
      if (!(r != null)) r = this.GetRoot();
      this.FDownRenderer = r;
      if (r != null) r.HandleMouse(m);
    };
    this.HandleMouseEnter = function () {
      var m = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseInfo.$new();
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseEnter.call(this);
      m.$assign(pas["WEBLib.TMSFNCDataGridCell"].DefaultMouseInfo());
      m.Kind = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseKind.gmkEnter;
      this.GetRoot().HandleMouse(m);
    };
    this.HandleMouseLeave = function () {
      var m = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseInfo.$new();
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseLeave.call(this);
      m.$assign(pas["WEBLib.TMSFNCDataGridCell"].DefaultMouseInfo());
      m.Kind = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseKind.gmkLeave;
      this.GetRoot().HandleMouse(m);
    };
    this.HandleMouseMove = function (Shift, X, Y) {
      var m = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseInfo.$new();
      var r = null;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseMove.apply(this,arguments);
      if (this.HandleDragOnHeader(X,Y)) return;
      m.$assign(pas["WEBLib.TMSFNCDataGridCell"].DefaultMouseInfo());
      m.Shift = rtl.refSet(Shift);
      m.X = X;
      m.Y = Y;
      m.Kind = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseKind.gmkMove;
      r = this.GetRoot().XYToRenderer(X,Y);
      if (!(r != null)) r = this.GetRoot();
      if ((this.FDownRenderer !== r) && (this.FDownRenderer != null)) this.FDownRenderer.ResetScrollBarCapture();
      if (r != null) r.HandleMouse(m);
      this.HandleEndDragOnHeader(X,Y);
    };
    this.HandleMouseUp = function (Button, Shift, X, Y) {
      var m = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseInfo.$new();
      var r = null;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseUp.apply(this,arguments);
      this.ReleaseCaptureEx();
      if ((pas["WEBLib.Controls"].TMouseButton.mbLeft === Button) && this.HandleDropOnHeader(X,Y,rtl.refSet(Shift))) return;
      m.$assign(pas["WEBLib.TMSFNCDataGridCell"].DefaultMouseInfo());
      m.Shift = rtl.refSet(Shift);
      m.X = X;
      m.Y = Y;
      m.Button = Button;
      m.Kind = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseKind.gmkUp;
      r = this.GetRoot().XYToRenderer(X,Y);
      if (!(r != null)) r = this.GetRoot();
      if ((this.FDownRenderer != null) && (this.FDownRenderer !== r)) this.FDownRenderer.HandleExit();
      this.FDownRenderer = null;
      this.HandleEndDropOnHeader();
      if (r != null) r.HandleMouse(m);
    };
    this.HandleMouseWheel = function (Shift, WheelDelta, Handled) {
      var m = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseInfo.$new();
      var r = null;
      var c = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.HandleMouseWheel.apply(this,arguments);
      if (Handled.get() || !this.FVisible || !(this.FParent != null)) return;
      c.$assign(this.ScreenToLocalEx(pas["WEBLib.TMSFNCTypes"].TPointF.$clone(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetMousePos())));
      m.$assign(pas["WEBLib.TMSFNCDataGridCell"].DefaultMouseInfo());
      m.Kind = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseKind.gmkWheel;
      m.Handled = Handled.get();
      m.WheelDelta = WheelDelta;
      m.Shift = rtl.refSet(Shift);
      m.X = c.X;
      m.Y = c.Y;
      r = this.GetRoot().XYToRenderer(c.X,c.Y);
      if (!(r != null)) r = this.GetRoot();
      if (r != null) {
        if (r.IsEditing()) r.StopEditing(true);
        if (!r.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(r.GetFocusedCell())) && !r.GetOptions().FMouse.FWheelScrollKeepSelection) r.SetFocusedCell(r.XYToCell(c.X,c.Y,false));
        r.Focus();
        r.HandleMouse(m);
        Handled.set(m.Handled);
      };
    };
    this.HeaderChangedRebuild = function (Sender) {
      this.UpdateRoot();
    };
    this.HandleEndDropOnHeader = function () {
      var needsUpdate = false;
      if (this.FDragHeaderGroup != null) {
        this.FDragHeaderGroup.Reset();
        this.Invalidate();
      };
      needsUpdate = this.FDraggingOnHeader || (this.FDragHeaderGroup != null);
      this.FDragHeaderGroup = null;
      this.FDraggingOnHeader = false;
      this.FDraggedOnHeader = false;
      if (needsUpdate) this.GetRoot().Update();
    };
    this.HandleEndDragOnHeader = function (X, Y) {
      var headerCenterX = 0.0;
      var headerCenterY = 0.0;
      this.FDraggingOnHeader = this.GetHeader().FVisualGrouping.FDragging && this.GetHeader().FVisualGrouping.FVisible && this.GetHeader().FVisible && this.GetOptions().FMouse.FColumnDragging && (pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridColumnDragMode.gcdmVisualGrouping in this.GetOptions().FMouse.FColumnDragModes) && this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.GetRoot().FDragCell)) && this.XYToHeader(X,Y);
      if (this.FDraggingOnHeader) {
        this.FDraggedOnHeader = true;
        this.SetControlCursor(12);
        if (!(this.FDragHeaderGroup != null)) {
          if (!this.GetHeaderGroups().Find(this.GetRoot().FDragCell.GetColumn(),{p: this, get: function () {
              return this.p.FDragHeaderGroup;
            }, set: function (v) {
              this.p.FDragHeaderGroup = v;
            }})) {
            this.FDragHeaderGroup = $mod.TTMSFNCDataGridHeaderGroup.$create("Create$1");
            this.FDragHeaderGroup.FOnBeforeDraw = rtl.createCallback(this,"DoBeforeDrawHeaderGroup");
            this.FDragHeaderGroup.FOnAfterDraw = rtl.createCallback(this,"DoAfterDrawHeaderGroup");
            this.FDragHeaderGroup.FNew = true;
            this.InitializeHeaderGroup(this.GetCalculateGraphics(),this.FDragHeaderGroup,this.GetRoot().FDragCell.GetColumn(),0,X,Y);
            this.GetRoot().Update();
            this.GetHeaderGroups().Add(this.FDragHeaderGroup);
          };
          headerCenterX = this.FDragHeaderGroup.GetRect().Left + ((this.FDragHeaderGroup.GetRect().Right - this.FDragHeaderGroup.GetRect().Left) / 2);
          headerCenterY = this.FDragHeaderGroup.GetRect().Top + ((this.FDragHeaderGroup.GetRect().Bottom - this.FDragHeaderGroup.GetRect().Top) / 2);
          this.FDragHeaderGroup.FOrigRect.$assign(this.FDragHeaderGroup.GetRect());
          this.FDragHeaderGroup.FRect.Left = this.FDragHeaderGroup.FRect.Left - (headerCenterX - X);
          this.FDragHeaderGroup.FRect.Top = this.FDragHeaderGroup.FRect.Top - (headerCenterY - Y);
          this.FDragHeaderGroup.FRect.Right = this.FDragHeaderGroup.FRect.Right - (headerCenterX - X);
          this.FDragHeaderGroup.FRect.Bottom = this.FDragHeaderGroup.FRect.Bottom - (headerCenterY - Y);
        };
      } else if (this.FDragHeaderGroup != null) {
        if (this.FDragHeaderGroup.FNew) this.GetHeaderGroups().Remove(this.FDragHeaderGroup);
        this.FDragHeaderGroup.Reset();
        this.FDragHeaderGroup = null;
        this.GetRoot().Update();
      };
    };
    this.InitializeHeaderGroup = function (AGraphics, AHeaderGroup, AColumn, ALevel, AX, AY) {
      var c = 0;
      var cl = null;
      var si = null;
      var n = "";
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var spc = 0.0;
      var w = 0.0;
      var h = 0.0;
      var iw = 0.0;
      spc = 4;
      AHeaderGroup.GetLayout().Assign(this.GetHeader().FVisualGrouping.FLayout);
      AHeaderGroup.FCloseIndicator = this.GetHeader().FVisualGrouping.FCloseIndicator;
      AHeaderGroup.FSortDescendingIcon = this.GetIcons().GetActiveSortDescendingIcon();
      AHeaderGroup.FSortAscendingIcon = this.GetIcons().GetActiveSortAscendingIcon();
      AHeaderGroup.FCloseIcon = this.GetIcons().GetActiveCloseIcon();
      AHeaderGroup.FLevel = ALevel;
      c = AColumn;
      AHeaderGroup.FColumn = c;
      cl = this.GetRoot().GetColumn(c);
      if (cl != null) {
        n = cl.GetHeader()}
       else n = this.GetString(c,0);
      AHeaderGroup.FText = n;
      iw = 0;
      if (this.GetSortIndexList().Find(c,{get: function () {
          return si;
        }, set: function (v) {
          si = v;
        }}) && this.GetOptions().FSorting.FEnabled) {
        var $tmp = si.FDirection;
        if ($tmp === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortDirection.gsdAscending) {
          AHeaderGroup.FSortIndicator = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellSortIndicator.gsiAscending}
         else if ($tmp === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortDirection.gsdDescending) AHeaderGroup.FSortIndicator = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellSortIndicator.gsiDescending;
        if (si.FDirection !== pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortDirection.gsdNone) iw = AHeaderGroup.GetSortIndicatorSize() + (4 * AHeaderGroup.FScale);
      };
      if (AHeaderGroup.FCloseIndicator) iw = iw + AHeaderGroup.GetCloseIndicatorSize() + (4 * AHeaderGroup.FScale);
      this.DoCustomizeHeaderGroup(AHeaderGroup);
      AGraphics.FFont.Assign(AHeaderGroup.GetLayout().FFont);
      w = AGraphics.CalculateTextWidth$1(AHeaderGroup.FText) + (4 * AHeaderGroup.FScale);
      if (this.GetHeader().FVisualGrouping.FAutoSize) {
        h = AGraphics.CalculateTextHeight$1(AHeaderGroup.FText) + (8 * AHeaderGroup.FScale)}
       else h = this.GetHeader().FVisualGrouping.FSize;
      w = w + iw;
      r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(AX + spc,AY + spc,AX + (spc * 2) + 2 + w,AY + h + spc));
      r.Left = pas.System.Int(r.Left) + 0.5;
      r.Right = pas.System.Int(r.Right) + 0.5;
      r.Top = pas.System.Int(r.Top) + 0.5;
      r.Bottom = pas.System.Int(r.Bottom) + 0.5;
      AHeaderGroup.FRect.$assign(r);
    };
    this.Notification = function (AComponent, Operation) {
      pas["WEBLib.Menus"].TWebCustomControl.Notification.apply(this,arguments);
      if ((Operation === pas.Classes.TOperation.opRemove) && !(pas.Classes.TComponentStateItem.csDestroying in this.FComponentState)) {
        if (AComponent === this.GetCellPopupMenu()) this.SetCellPopupMenu(null);
        if (AComponent === this.GetBitmapContainer()) this.SetBitmapContainer(null);
        if (AComponent === this.GetAdapter()) this.SetAdapter(null);
      };
    };
    this.ResetToDefaultStyle = function () {
      this.BeginUpdate();
      try {
        this.GetRoot().ResetToDefaultStyle();
        this.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        this.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
        this.FFill.SetColor(16777215);
        this.FStroke.SetColor(12632256);
      } finally {
        this.EndUpdate();
      };
    };
    this.SetAdaptToStyle = function (Value) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControlBaseCommon.SetAdaptToStyle.apply(this,arguments);
      this.GetRoot().SetAdaptToStyle(Value);
    };
    this.SetFonts = function (ASetType) {
      this.GetGlobalFont().ApplyChange(this.GetHeader().FVisualGrouping.FLayout.FFont,ASetType);
    };
    this.Calculate = function () {
      this.CalculateHeader();
      this.CalculateFooter();
    };
    this.CalculateFooterPagingLabels = function () {
      var i = 0;
      var pg = 0;
      var pc = 0;
      var SinglePage = false;
      if ((this.FUpdateCount$1 > 0) || this.IsDestroying() || ((this.GetRoot() != null) && ((this.GetRoot().GetUpdateCount() > 0) || this.GetRoot().GetIsDestroying()))) return;
      pc = this.GetPageCount();
      if (!this.FFooter.FVisible || !this.FFooter.FPaging.FVisible || (this.GetFooterSize() <= 0) || (this.GetFooterPagingSize() <= 0) || !this.GetPaging()) return;
      pg = this.GetPageIndex();
      SinglePage = pc <= 1;
      if (this.GetFooterFirstPageButton() != null) this.GetFooterFirstPageButton().SetEnabled((pg > 0) && !SinglePage);
      if (this.GetFooterPreviousPageButton() != null) this.GetFooterPreviousPageButton().SetEnabled((pg > 0) && !SinglePage);
      if (this.GetFooterPageSelector() != null) {
        this.GetFooterPageSelector().BeginUpdate();
        try {
          this.GetFooterPageSelector().FItems.Clear();
          for (var $l = 0, $end = Math.max(pc - 1,0); $l <= $end; $l++) {
            i = $l;
            this.GetFooterPageSelector().FItems.Add(pas.SysUtils.Format(this.FFooter.FPaging.FPageSelectorFormat,pas.System.VarRecs(0,i + 1)));
          };
          this.GetFooterPageSelector().SetSelectedItemIndex(this.GetPageIndex());
          this.GetFooterPageSelector().SetEnabled(!SinglePage);
        } finally {
          this.GetFooterPageSelector().EndUpdate();
        };
      };
      if (this.GetFooterPageInfo() != null) this.GetFooterPageInfo().SetText(pas.SysUtils.Format(this.FFooter.FPaging.FPageInfoFormat,pas.System.VarRecs(0,pg + 1,0,Math.max(pc,1))));
      if (this.GetFooterNextPageButton() != null) this.GetFooterNextPageButton().SetEnabled((pg < (pc - 1)) && !SinglePage);
      if (this.GetFooterLastPageButton() != null) this.GetFooterLastPageButton().SetEnabled((pg < (pc - 1)) && !SinglePage);
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCDataGridBase"].TTMSFNCDataGridBase.Create$1.apply(this,arguments);
      this.FDesigner = true;
      this.FFooter = $mod.TTMSFNCDataGridFooter.$create("Create$1",[this]);
      this.FFooter.FOnChangeRebuild = rtl.createCallback(this,"FooterChangedRebuild");
      this.FHeader = $mod.TTMSFNCDataGridHeader.$create("Create$1",[this]);
      this.FHeader.FOnChangeRebuild = rtl.createCallback(this,"HeaderChangedRebuild");
      this.GetRoot().IncUpdateCount();
      this.SetWidth(540);
      this.SetHeight(400);
      this.GetRoot().DecUpdateCount();
      this.SetShowAcceleratorChar(false);
      if ((pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) && !((pas.Classes.TComponentStateItem.csReading in this.FOwner.FComponentState) || (pas.Classes.TComponentStateItem.csLoading in this.FOwner.FComponentState))) this.InitSample();
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FFooterPageSelector;
        }, set: function (v) {
          this.p.FFooterPageSelector = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FFooterPageInfo;
        }, set: function (v) {
          this.p.FFooterPageInfo = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FFooterFirstPageButton;
        }, set: function (v) {
          this.p.FFooterFirstPageButton = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FFooterPreviousPageButton;
        }, set: function (v) {
          this.p.FFooterPreviousPageButton = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FFooterNextPageButton;
        }, set: function (v) {
          this.p.FFooterNextPageButton = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FFooterLastPageButton;
        }, set: function (v) {
          this.p.FFooterLastPageButton = v;
        }});
      rtl.free(this,"FHeader");
      rtl.free(this,"FFooter");
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FHeaderGroups;
        }, set: function (v) {
          this.p.FHeaderGroups = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FTempHeaderGroups;
        }, set: function (v) {
          this.p.FTempHeaderGroups = v;
        }});
      if (this.FCalculateGraphics != null) this.FCalculateGraphics.EndScene();
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FCalculateGraphics;
        }, set: function (v) {
          this.p.FCalculateGraphics = v;
        }});
      pas["WEBLib.TMSFNCDataGridBase"].TTMSFNCDataGridBase.Destroy.call(this);
    };
    this.AddGrid = function (ACell) {
      var Result = null;
      Result = this.GetRoot().AddGrid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
      return Result;
    };
    this.AddGrid$1 = function (AColumn, ARow) {
      var Result = null;
      Result = this.GetRoot().AddGrid$1(AColumn,ARow);
      return Result;
    };
    this.BaseCell = function (ACell) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      Result.$assign(this.GetRoot().BaseCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell)));
      return Result;
    };
    this.CancelEditing = function () {
      var Result = false;
      Result = this.GetRoot().CancelEditing(true);
      return Result;
    };
    this.CanDeleteColumn = function (AColumn) {
      var Result = false;
      Result = this.GetRoot().CanDeleteColumn(AColumn);
      return Result;
    };
    this.CanDeleteRow = function (ARow) {
      var Result = false;
      Result = this.GetRoot().CanDeleteRow(ARow);
      return Result;
    };
    this.CanInsertColumn = function (AColumn) {
      var Result = false;
      Result = this.GetRoot().CanInsertColumn(AColumn);
      return Result;
    };
    this.CanInsertRow = function (ARow) {
      var Result = false;
      Result = this.GetRoot().CanInsertRow(ARow);
      return Result;
    };
    this.CanMergeCells = function (AColumn, ARow, AColumnCount, ARowCount) {
      var Result = false;
      Result = this.GetRoot().CanMergeCells(AColumn,ARow,AColumnCount,ARowCount);
      return Result;
    };
    this.CanMoveColumn = function (AFromColumn, AToColumn) {
      var Result = false;
      Result = this.GetRoot().CanMoveColumn(AFromColumn,AToColumn);
      return Result;
    };
    this.CanMoveRow = function (AFromRow, AToRow) {
      var Result = false;
      Result = this.GetRoot().CanMoveRow(AFromRow,AToRow);
      return Result;
    };
    this.CanSwapColumn = function (AFromColumn, AToColumn) {
      var Result = false;
      Result = this.GetRoot().CanSwapColumn(AFromColumn,AToColumn);
      return Result;
    };
    this.CanSwapRow = function (AFromRow, AToRow) {
      var Result = false;
      Result = this.GetRoot().CanSwapRow(AFromRow,AToRow);
      return Result;
    };
    this.ColumnAverage = function (AColumn, AFromRow, AToRow) {
      var Result = 0.0;
      Result = this.GetRoot().ColumnAverage(AColumn,AFromRow,AToRow);
      return Result;
    };
    this.ColumnByHeader = function (AHeader) {
      var Result = null;
      Result = this.GetRoot().ColumnByHeader(AHeader);
      return Result;
    };
    this.ColumnByName = function (AName) {
      var Result = null;
      Result = this.GetRoot().ColumnByName(AName);
      return Result;
    };
    this.ColumnCustomCalculation = function (AColumn, ACustomCalculationCallback, AFromRow, AToRow) {
      var Result = 0.0;
      Result = this.GetRoot().ColumnCustomCalculation(AColumn,ACustomCalculationCallback,AFromRow,AToRow);
      return Result;
    };
    this.ColumnDistinct = function (AColumn, AFromRow, AToRow) {
      var Result = 0.0;
      Result = this.GetRoot().ColumnDistinct(AColumn,AFromRow,AToRow);
      return Result;
    };
    this.ColumnIndexByHeader = function (AHeader) {
      var Result = 0;
      Result = this.GetRoot().ColumnIndexByHeader(AHeader);
      return Result;
    };
    this.ColumnIndexByName = function (AName) {
      var Result = 0;
      Result = this.GetRoot().ColumnIndexByName(AName);
      return Result;
    };
    this.ColumnMax = function (AColumn, AFromRow, AToRow) {
      var Result = 0.0;
      Result = this.GetRoot().ColumnMax(AColumn,AFromRow,AToRow);
      return Result;
    };
    this.ColumnMin = function (AColumn, AFromRow, AToRow) {
      var Result = 0.0;
      Result = this.GetRoot().ColumnMin(AColumn,AFromRow,AToRow);
      return Result;
    };
    this.ColumnSpan = function (ACell) {
      var Result = 0;
      Result = this.GetRoot().ColumnSpan(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
      return Result;
    };
    this.ColumnStandardDeviation = function (AColumn, AFromRow, AToRow) {
      var Result = 0.0;
      Result = this.GetRoot().ColumnStandardDeviation(AColumn,AFromRow,AToRow);
      return Result;
    };
    this.ColumnSum = function (AColumn, AFromRow, AToRow) {
      var Result = 0.0;
      Result = this.GetRoot().ColumnSum(AColumn,AFromRow,AToRow);
      return Result;
    };
    this.DisplayToRealCell = function (ACell) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      Result.$assign(this.GetRoot().DisplayToRealCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell)));
      return Result;
    };
    this.Find = function (AText) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      Result.$assign(this.GetRoot().Find(AText));
      return Result;
    };
    this.Find$1 = function (AText, AParameters) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      Result.$assign(this.GetRoot().Find$1(AText,rtl.refSet(AParameters)));
      return Result;
    };
    this.Find$2 = function (AText, AParameters, AStartCell) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      Result.$assign(this.GetRoot().Find$2(AText,rtl.refSet(AParameters),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(AStartCell)));
      return Result;
    };
    this.FindAll = function (AText, AParameters, AResults) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      Result.$assign(this.GetRoot().FindAll(AText,rtl.refSet(AParameters),AResults));
      return Result;
    };
    this.FindFirst = function (AText, AParameters) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      Result.$assign(this.GetRoot().FindFirst(AText,rtl.refSet(AParameters)));
      return Result;
    };
    this.FindNext = function () {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      Result.$assign(this.GetRoot().FindNext$1());
      return Result;
    };
    this.GetCellKind = function (ACell) {
      var Result = 0;
      Result = this.GetRoot().GetCellKind(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
      return Result;
    };
    this.GetCellMergeType = function (ACell) {
      var Result = 0;
      Result = this.GetRoot().GetCellMergeType(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
      return Result;
    };
    this.GetCellObjectForCell = function (ACell) {
      var Result = null;
      Result = this.GetRoot().GetCellObjectForCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
      return Result;
    };
    this.GetCellSize = function (ACell) {
      var Result = pas["WEBLib.TMSFNCTypes"].TSizeF.$new();
      Result.$assign(this.GetRoot().GetCellSize(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell)));
      return Result;
    };
    this.GetFilterTypeName = function (AType) {
      var Result = "";
      Result = this.GetRoot().GetFilterTypeName(AType);
      return Result;
    };
    this.GetHMax = function () {
      var Result = 0.0;
      Result = this.GetRoot().GetHMax();
      return Result;
    };
    this.GetHScrollValue = function () {
      var Result = 0.0;
      Result = this.GetRoot().GetHScrollValue();
      return Result;
    };
    this.GetHViewPortSize = function () {
      var Result = 0.0;
      Result = this.GetRoot().GetHViewPortSize();
      return Result;
    };
    this.GetMaxLevel = function () {
      var Result = 0;
      Result = this.GetRoot().GetMaxLevel();
      return Result;
    };
    this.GetParentRow = function (ARow) {
      var Result = 0;
      Result = this.GetRoot().GetParentRow(ARow);
      return Result;
    };
    this.GetRootRow = function (ARow) {
      var Result = 0;
      Result = this.GetRoot().GetRootRow(ARow);
      return Result;
    };
    this.GetTotalFixedBottomRowHeight = function () {
      var Result = 0.0;
      Result = this.GetRoot().GetTotalFixedBottomRowHeight();
      return Result;
    };
    this.GetTotalFixedColumnWidth = function () {
      var Result = 0.0;
      Result = this.GetRoot().GetTotalFixedColumnWidth(false);
      return Result;
    };
    this.GetTotalFixedRightColumnWidth = function () {
      var Result = 0.0;
      Result = this.GetRoot().GetTotalFixedRightColumnWidth();
      return Result;
    };
    this.GetTotalFixedRowHeight = function () {
      var Result = 0.0;
      Result = this.GetRoot().GetTotalFixedRowHeight(false);
      return Result;
    };
    this.GetVMax = function () {
      var Result = 0.0;
      Result = this.GetRoot().GetVMax();
      return Result;
    };
    this.GetVScrollValue = function () {
      var Result = 0.0;
      Result = this.GetRoot().GetVScrollValue();
      return Result;
    };
    this.GetVViewPortSize = function () {
      var Result = 0.0;
      Result = this.GetRoot().GetVViewPortSize();
      return Result;
    };
    this.HasRowData = function (ARow) {
      var Result = false;
      Result = this.GetRoot().HasRowData(ARow);
      return Result;
    };
    this.IsCellBase = function (ACell) {
      var Result = false;
      Result = this.GetRoot().IsCellBase(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
      return Result;
    };
    this.IsCellDisabled = function (ACell) {
      var Result = false;
      Result = this.GetRoot().IsCellDisabled(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
      return Result;
    };
    this.IsCellDisplayed = function (ACell) {
      var Result = false;
      Result = this.GetRoot().IsCellDisplayed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
      return Result;
    };
    this.IsCellFixed = function (ACell) {
      var Result = false;
      Result = this.GetRoot().IsCellFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
      return Result;
    };
    this.IsCellFixedRoot = function (ACell) {
      var Result = false;
      Result = this.GetRoot().IsCellFixedRoot(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
      return Result;
    };
    this.IsCellFreeze = function (ACell) {
      var Result = false;
      Result = this.GetRoot().IsCellFreeze(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
      return Result;
    };
    this.IsCellFreezeFixed = function (ACell) {
      var Result = false;
      Result = this.GetRoot().IsCellFreezeFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
      return Result;
    };
    this.IsCellFreezeRoot = function (ACell) {
      var Result = false;
      Result = this.GetRoot().IsCellFreezeRoot(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
      return Result;
    };
    this.IsCellHidden = function (ACell) {
      var Result = false;
      Result = this.GetRoot().IsCellHidden(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
      return Result;
    };
    this.IsCellMerged = function (ACell) {
      var Result = false;
      Result = this.GetRoot().IsCellMerged(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
      return Result;
    };
    this.IsCellSelected = function (ACell) {
      var Result = false;
      Result = this.GetRoot().IsCellSelected(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
      return Result;
    };
    this.IsCellValid = function (ACell) {
      var Result = false;
      Result = this.GetRoot().IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
      return Result;
    };
    this.IsCellValid$1 = function (AColumn, ARow) {
      var Result = false;
      Result = this.GetRoot().IsCellValid$1(AColumn,ARow);
      return Result;
    };
    this.IsCellVisible = function (ACell) {
      var Result = false;
      Result = this.GetRoot().IsCellVisible(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
      return Result;
    };
    this.IsColumnDisplayed = function (AColumn) {
      var Result = false;
      Result = this.GetRoot().IsColumnDisplayed(AColumn);
      return Result;
    };
    this.IsColumnHidden = function (AColumn) {
      var Result = false;
      Result = this.GetRoot().IsColumnHidden(AColumn);
      return Result;
    };
    this.IsColumnMerged = function (AColumn) {
      var Result = false;
      Result = this.GetRoot().IsColumnMerged(AColumn);
      return Result;
    };
    this.IsColumnValid = function (AColumn) {
      var Result = false;
      Result = this.GetRoot().IsColumnValid(AColumn);
      return Result;
    };
    this.IsColumnVisible = function (AColumn) {
      var Result = false;
      Result = this.GetRoot().IsColumnVisible(AColumn);
      return Result;
    };
    this.IsEditing = function () {
      var Result = false;
      Result = this.GetRoot().IsEditing();
      return Result;
    };
    this.IsFixedCellSelected = function (ACell) {
      var Result = false;
      Result = this.GetRoot().IsFixedCellSelected(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
      return Result;
    };
    this.IsGrouped = function () {
      var Result = false;
      Result = this.GetRoot().IsGrouped();
      return Result;
    };
    this.IsRowBand = function (ARow) {
      var Result = false;
      Result = this.GetRoot().IsRowBand(ARow);
      return Result;
    };
    this.IsRowDisplayed = function (ARow) {
      var Result = false;
      Result = this.GetRoot().IsRowDisplayed(ARow);
      return Result;
    };
    this.IsRowFilter = function (ARow) {
      var Result = false;
      Result = this.GetRoot().IsRowFilter(ARow);
      return Result;
    };
    this.IsRowFiltered = function (ARow) {
      var Result = false;
      Result = this.GetRoot().IsRowFiltered(ARow);
      return Result;
    };
    this.IsRowHidden = function (ARow) {
      var Result = false;
      Result = this.GetRoot().IsRowHidden(ARow);
      return Result;
    };
    this.IsRowMerged = function (ARow) {
      var Result = false;
      Result = this.GetRoot().IsRowMerged(ARow);
      return Result;
    };
    this.IsRowNode = function (ARow) {
      var Result = false;
      Result = this.GetRoot().IsRowNode(ARow);
      return Result;
    };
    this.IsRowNormal = function (ARow) {
      var Result = false;
      Result = this.GetRoot().IsRowNormal(ARow);
      return Result;
    };
    this.IsRowSummary = function (ARow) {
      var Result = false;
      Result = this.GetRoot().IsRowSummary(ARow);
      return Result;
    };
    this.IsRowValid = function (ARow) {
      var Result = false;
      Result = this.GetRoot().IsRowValid(ARow);
      return Result;
    };
    this.IsRowVisible = function (ARow) {
      var Result = false;
      Result = this.GetRoot().IsRowVisible(ARow);
      return Result;
    };
    this.MatchFilter = function (ARow) {
      var Result = false;
      Result = this.GetRoot().MatchFilter(ARow);
      return Result;
    };
    this.NextSelectableColumn = function (AColumn, ARow) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      Result.$assign(this.GetRoot().NextSelectableColumn(AColumn,ARow));
      return Result;
    };
    this.NextSelectableRow = function (AColumn, ARow) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      Result.$assign(this.GetRoot().NextSelectableRow(AColumn,ARow));
      return Result;
    };
    this.NextVisibleColumn = function (AColumn, ARow) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      Result.$assign(this.GetRoot().NextVisibleColumn(AColumn,ARow));
      return Result;
    };
    this.NextVisibleRow = function (AColumn, ARow) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      Result.$assign(this.GetRoot().NextVisibleRow(AColumn,ARow));
      return Result;
    };
    this.PreviousSelectableColumn = function (AColumn, ARow) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      Result.$assign(this.GetRoot().PreviousSelectableColumn(AColumn,ARow));
      return Result;
    };
    this.PreviousSelectableRow = function (AColumn, ARow) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      Result.$assign(this.GetRoot().PreviousSelectableRow(AColumn,ARow));
      return Result;
    };
    this.PreviousVisibleColumn = function (AColumn, ARow) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      Result.$assign(this.GetRoot().PreviousVisibleColumn(AColumn,ARow));
      return Result;
    };
    this.PreviousVisibleRow = function (AColumn, ARow) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      Result.$assign(this.GetRoot().PreviousVisibleRow(AColumn,ARow));
      return Result;
    };
    this.RealToDisplayCell = function (ACell) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      Result.$assign(this.GetRoot().RealToDisplayCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell)));
      return Result;
    };
    this.Replace = function (AOriginalValue, ANewValue) {
      var Result = 0;
      Result = this.GetRoot().Replace(AOriginalValue,ANewValue);
      return Result;
    };
    this.Replace$1 = function (AOriginalValue, ANewValue, AParameters) {
      var Result = 0;
      Result = this.GetRoot().Replace$1(AOriginalValue,ANewValue,rtl.refSet(AParameters));
      return Result;
    };
    this.RowAverage = function (ARow, AFromColumn, AToColumn) {
      var Result = 0.0;
      Result = this.GetRoot().RowAverage(ARow,AFromColumn,AToColumn);
      return Result;
    };
    this.RowCustomCalculation = function (ARow, ACustomCalculationCallback, AFromColumn, AToColumn) {
      var Result = 0.0;
      Result = this.GetRoot().RowCustomCalculation(ARow,ACustomCalculationCallback,AFromColumn,AToColumn);
      return Result;
    };
    this.RowDistinct = function (ARow, AFromColumn, AToColumn) {
      var Result = 0.0;
      Result = this.GetRoot().RowDistinct(ARow,AFromColumn,AToColumn);
      return Result;
    };
    this.RowMax = function (ARow, AFromColumn, AToColumn) {
      var Result = 0.0;
      Result = this.GetRoot().RowMax(ARow,AFromColumn,AToColumn);
      return Result;
    };
    this.RowMin = function (ARow, AFromColumn, AToColumn) {
      var Result = 0.0;
      Result = this.GetRoot().RowMin(ARow,AFromColumn,AToColumn);
      return Result;
    };
    this.RowSpan = function (ACell) {
      var Result = 0;
      Result = this.GetRoot().RowSpan(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
      return Result;
    };
    this.RowStandardDeviation = function (ARow, AFromColumn, AToColumn) {
      var Result = 0.0;
      Result = this.GetRoot().RowStandardDeviation(ARow,AFromColumn,AToColumn);
      return Result;
    };
    this.RowSum = function (ARow, AFromColumn, AToColumn) {
      var Result = 0.0;
      Result = this.GetRoot().RowSum(ARow,AFromColumn,AToColumn);
      return Result;
    };
    this.SetGrid = function (ACell) {
      var Result = null;
      Result = this.GetRoot().SetGrid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
      return Result;
    };
    this.SetGrid$1 = function (AColumn, ARow) {
      var Result = null;
      Result = this.GetRoot().SetGrid$1(AColumn,ARow);
      return Result;
    };
    this.StopEditing = function () {
      var Result = false;
      Result = this.GetRoot().StopEditing(true);
      return Result;
    };
    this.TypeOfValue = function (AValue) {
      var Result = 0;
      Result = this.GetRoot().$class.TypeOfValue(AValue);
      return Result;
    };
    this.ValueIsEmpty = function (AValue) {
      var Result = false;
      Result = this.GetRoot().$class.ValueIsEmpty(AValue);
      return Result;
    };
    this.ValueIsFloat = function (AValue) {
      var Result = false;
      Result = this.GetRoot().$class.ValueIsFloat(AValue);
      return Result;
    };
    this.ValueIsInteger = function (AValue) {
      var Result = false;
      Result = this.GetRoot().$class.ValueIsInteger(AValue);
      return Result;
    };
    this.ValueIsString = function (AValue) {
      var Result = false;
      Result = this.GetRoot().$class.ValueIsString(AValue);
      return Result;
    };
    this.ValueToBoolean = function (AValue) {
      var Result = false;
      Result = this.GetRoot().$class.ValueToBoolean(AValue);
      return Result;
    };
    this.ValueToBoolean$1 = function (AValue, AFormatSettings) {
      var Result = false;
      Result = this.GetRoot().$class.ValueToBoolean$1(AValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings));
      return Result;
    };
    this.ValueToFloat = function (AValue) {
      var Result = 0.0;
      Result = this.GetRoot().$class.ValueToFloat(AValue);
      return Result;
    };
    this.ValueToFloat$1 = function (AValue, AFormatSettings) {
      var Result = 0.0;
      Result = this.GetRoot().$class.ValueToFloat$1(AValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings));
      return Result;
    };
    this.ValueToInt64 = function (AValue) {
      var Result = 0;
      Result = this.GetRoot().$class.ValueToInt64(AValue);
      return Result;
    };
    this.ValueToInt64$1 = function (AValue, AFormatSettings) {
      var Result = 0;
      Result = this.GetRoot().$class.ValueToInt64$1(AValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings));
      return Result;
    };
    this.ValueToInteger = function (AValue) {
      var Result = 0;
      Result = this.GetRoot().$class.ValueToInt64(AValue);
      return Result;
    };
    this.ValueToInteger$1 = function (AValue, AFormatSettings) {
      var Result = 0;
      Result = this.GetRoot().$class.ValueToInteger$1(AValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings));
      return Result;
    };
    this.ValueToString = function (AValue) {
      var Result = "";
      Result = this.GetRoot().$class.ValueToString(AValue);
      return Result;
    };
    this.ValueToString$1 = function (AValue, AFormatSettings) {
      var Result = "";
      Result = this.GetRoot().$class.ValueToString$1(AValue,pas.SysUtils.TFormatSettings.$clone(AFormatSettings));
      return Result;
    };
    this.XYToHeaderGroup = function (X, Y) {
      var Result = null;
      Result = this.InternalXYToHeaderGroup(X,Y,this.GetHeaderGroups(),false,false);
      return Result;
    };
    this.XYToHeader = function (X, Y) {
      var Result = false;
      Result = pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetHeaderRect(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y));
      return Result;
    };
    this.XYToFooter = function (X, Y) {
      var Result = false;
      Result = pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetFooterRect(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y));
      return Result;
    };
    this.XYToCell = function (X, Y) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      Result.$assign(this.GetRoot().XYToCell(X,Y,false));
      return Result;
    };
    this.XYToColumn = function (X, Y) {
      var Result = 0;
      Result = this.GetRoot().XYToColumn(X,Y);
      return Result;
    };
    this.XYToRenderer = function (X, Y) {
      var Result = null;
      Result = this.GetRoot().XYToRenderer(X,Y);
      return Result;
    };
    this.XYToRow = function (X, Y) {
      var Result = 0;
      Result = this.GetRoot().XYToRow(X,Y);
      return Result;
    };
    this.AddBitmap = function (ACell, ABitmap) {
      this.GetRoot().AddBitmap(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),ABitmap);
    };
    this.AddBitmap$1 = function (ACell, AName) {
      this.GetRoot().AddBitmap$1(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AName);
    };
    this.AddBitmap$2 = function (AColumn, ARow, ABitmap) {
      this.GetRoot().AddBitmap$2(AColumn,ARow,ABitmap);
    };
    this.AddBitmap$3 = function (AColumn, ARow, AName) {
      this.GetRoot().AddBitmap$3(AColumn,ARow,AName);
    };
    this.AddBitmapColumn = function (AColumn, ABitmap) {
      this.GetRoot().AddBitmapColumn(AColumn,ABitmap);
    };
    this.AddBitmapColumn$1 = function (AColumn, AName) {
      this.GetRoot().AddBitmapColumn$1(AColumn,AName);
    };
    this.AddButton = function (ACell, AText) {
      this.GetRoot().AddButton(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AText);
    };
    this.AddButton$1 = function (AColumn, ARow, AText) {
      this.GetRoot().AddButton$1(AColumn,ARow,AText);
    };
    this.AddButtonColumn = function (AColumn, AText) {
      this.GetRoot().AddButtonColumn(AColumn,AText);
    };
    this.AddCheckBox = function (ACell, AValue) {
      this.GetRoot().AddCheckBox(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AValue);
    };
    this.AddCheckBox$1 = function (AColumn, ARow, AValue) {
      this.GetRoot().AddCheckBox$1(AColumn,ARow,AValue);
    };
    this.AddCheckBoxColumn = function (AColumn, AValue) {
      this.GetRoot().AddCheckBoxColumn(AColumn,AValue);
    };
    this.AddColumn = function () {
      this.GetRoot().AddColumn();
    };
    this.AddDataCheckBox = function (ACell) {
      this.GetRoot().AddDataCheckBox(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
    };
    this.AddDataCheckBox$1 = function (AColumn, ARow) {
      this.GetRoot().AddDataCheckBox$1(AColumn,ARow);
    };
    this.AddDataCheckBoxColumn = function (AColumn) {
      this.GetRoot().AddDataCheckBoxColumn(AColumn);
    };
    this.AddDataProgressBar = function (ACell) {
      this.GetRoot().AddDataProgressBar(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
    };
    this.AddDataProgressBar$1 = function (AColumn, ARow) {
      this.GetRoot().AddDataProgressBar$1(AColumn,ARow);
    };
    this.AddDataProgressBarColumn = function (AColumn) {
      this.GetRoot().AddDataProgressBarColumn(AColumn);
    };
    this.AddDataRadioButton = function (ACell, AValue, AGroupIndex) {
      this.GetRoot().AddDataRadioButton(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AValue,AGroupIndex);
    };
    this.AddDataRadioButton$1 = function (AColumn, ARow, AValue, AGroupIndex) {
      this.GetRoot().AddDataRadioButton$1(AColumn,ARow,AValue,AGroupIndex);
    };
    this.AddDataRadioButtonColumn = function (AColumn, AValue, AGroupIndex) {
      this.GetRoot().AddDataRadioButtonColumn(AColumn,AValue,0);
    };
    this.AddFilterEditor = function (ACell) {
      this.GetRoot().AddFilterEditor(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
    };
    this.AddFilterEditor$1 = function (AColumn, ARow) {
      this.GetRoot().AddFilterEditor$1(AColumn,ARow);
    };
    this.AddNodeRow = function (ARow, AChildCount, ALevel, AMerge) {
      this.GetRoot().AddNodeRow(ARow,AChildCount,ALevel,AMerge);
    };
    this.AddProgressBar = function (ACell, AValue) {
      this.GetRoot().AddProgressBar(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AValue);
    };
    this.AddProgressBar$1 = function (AColumn, ARow, AValue) {
      this.GetRoot().AddProgressBar$1(AColumn,ARow,AValue);
    };
    this.AddProgressBarColumn = function (AColumn, AValue) {
      this.GetRoot().AddProgressBarColumn(AColumn,AValue);
    };
    this.AddRadioButton = function (ACell, AValue, AGroupIndex) {
      this.GetRoot().AddRadioButton(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AValue,AGroupIndex);
    };
    this.AddRadioButton$1 = function (AColumn, ARow, AValue, AGroupIndex) {
      this.GetRoot().AddRadioButton$1(AColumn,ARow,AValue,AGroupIndex);
    };
    this.AddRadioButtonColumn = function (AColumn, AValue, AGroupIndex) {
      this.GetRoot().AddRadioButtonColumn(AColumn,AValue,0);
    };
    this.AddRow = function () {
      this.GetRoot().AddRow();
    };
    this.ApplyFilter = function () {
      this.GetRoot().ApplyFilter();
    };
    this.Assign = function (Source) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Assign.apply(this,arguments);
      if ($mod.TTMSFNCCustomDataGrid.isPrototypeOf(Source)) {
        this.FFooter.Assign(rtl.as(Source,$mod.TTMSFNCCustomDataGrid).FFooter);
        this.FHeader.Assign(rtl.as(Source,$mod.TTMSFNCCustomDataGrid).GetHeader());
        this.GetRoot().Assign(rtl.as(Source,$mod.TTMSFNCCustomDataGrid).GetRoot());
      };
    };
    this.AutoFillCustomListsClear = function () {
      this.GetRoot().AutoFillCustomListsClear();
    };
    this.AutoFillCustomListRemove = function (AKey) {
      this.GetRoot().AutoFillCustomListRemove(AKey);
    };
    this.AutoFillCustomListSet = function (AKey, AValues) {
      this.GetRoot().AutoFillCustomListSet(AKey,AValues);
    };
    this.AutoFillCustomListTryGet = function (AKey, AValues) {
      var Result = false;
      Result = this.GetRoot().AutoFillCustomListTryGet(AKey,AValues);
      return Result;
    };
    this.AutoFillCustomListsCount = function () {
      var Result = 0;
      Result = this.GetRoot().AutoFillCustomListsCount();
      return Result;
    };
    this.AutoFill = function (ASourceStart, ASourceEnd, ATargetStart, ATargetEnd, ADirection) {
      this.GetRoot().AutoFill(ASourceStart,ASourceEnd,ATargetStart,ATargetEnd,ADirection);
    };
    this.AutoNumberColumn = function (AColumn, AStartRow, AStartValue) {
      this.GetRoot().AutoNumberColumn(AColumn,AStartRow,AStartValue);
    };
    this.AutoNumberRow = function (ARow, AStartColumn, AStartValue) {
      this.GetRoot().AutoNumberRow(ARow,AStartColumn,AStartValue);
    };
    this.AutoSizeColumn = function (AColumn, AMode, APadding) {
      this.GetRoot().AutoSizeColumn(AColumn,AMode,APadding);
    };
    this.AutoSizeColumns = function (AMode, APadding) {
      this.GetRoot().AutoSizeColumns(AMode,APadding);
    };
    this.AutoSizeGrid = function (AMode, APaddingColumn, APaddingRow) {
      this.GetRoot().AutoSizeGrid(AMode,APaddingColumn,APaddingRow);
    };
    this.AutoSizeRow = function (ARow, AMode, APadding) {
      this.GetRoot().AutoSizeRow(ARow,AMode,APadding);
    };
    this.AutoSizeRows = function (AMode, APadding) {
      this.GetRoot().AutoSizeRows(AMode,APadding);
    };
    this.ClearCells = function (ACellRange) {
      this.GetRoot().ClearCells(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoordRange.$clone(ACellRange));
    };
    this.ClearColumns = function () {
      this.GetRoot().ClearColumns();
    };
    this.ClearControlCache = function () {
      this.GetRoot().ClearControlCache();
    };
    this.ClearFilter = function () {
      this.GetRoot().ClearFilter();
    };
    this.ClearNodeRow = function (ARow) {
      this.GetRoot().ClearNodeRow(ARow);
    };
    this.ClearSelection = function () {
      this.GetRoot().ClearSelection();
    };
    this.CloseFilterPopup = function () {
      this.GetRoot().CloseFilterPopup();
    };
    this.CollapseAllNodes = function () {
      this.GetRoot().CollapseAllNodes();
    };
    this.CollapseNode = function (ARow) {
      this.GetRoot().CollapseNode(ARow);
    };
    this.ColumnCalculation = function (AColumn, AMethod, ACalculationOptionsCallback, ACustomCalculationCallback) {
      this.GetRoot().ColumnCalculation(AColumn,AMethod,ACalculationOptionsCallback,ACustomCalculationCallback);
    };
    this.ColumnCalculation$1 = function (AColumns, AMethod, ACalculationOptionsCallback, ACustomCalculationCallback) {
      this.GetRoot().ColumnCalculation$1(rtl.arrayRef(AColumns),AMethod,ACalculationOptionsCallback,ACustomCalculationCallback);
    };
    this.CopyToClipboard = function (ASelectedCells) {
      this.GetRoot().CopyToClipboard(ASelectedCells);
    };
    this.CutToClipboard = function (ASelectedCells) {
      this.GetRoot().CutToClipboard(ASelectedCells);
    };
    this.DeleteColumn = function (AColumn) {
      this.GetRoot().DeleteColumn(AColumn);
    };
    this.DeleteColumns = function (AColumn, ACount) {
      this.GetRoot().DeleteColumns(AColumn,ACount);
    };
    this.DeleteRow = function (ARow) {
      this.GetRoot().DeleteRow(ARow);
    };
    this.DeleteRows = function (ARow, ACount) {
      this.GetRoot().DeleteRows(ARow,ACount);
    };
    this.Draw = function (AGraphics, ARect) {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Draw.apply(this,arguments);
      if (this.GetRoot().GetUpdateCount() > 0) return;
      AGraphics.FBitmapContainer = this.GetBitmapContainer();
      this.GetRoot().FStroke.Assign(this.FStroke);
      this.GetRoot().Draw(AGraphics);
      this.DrawFooter(AGraphics);
      this.DrawHeader(AGraphics);
    };
    this.EditCell = function (ACell, ACellStart, AInsertKey, AValue, AKey) {
      this.GetRoot().EditCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),ACellStart,AInsertKey,AValue,AKey);
    };
    this.ExpandAllNodes = function () {
      this.GetRoot().ExpandAllNodes();
    };
    this.ExpandNode = function (ARow) {
      this.GetRoot().ExpandNode(ARow);
    };
    this.FirstPage = function () {
      this.GetRoot().FirstPage();
    };
    this.LastPage = function () {
      this.GetRoot().LastPage();
    };
    this.NextPage = function () {
      this.GetRoot().NextPage();
    };
    this.PreviousPage = function () {
      this.GetRoot().PreviousPage();
    };
    this.GoToPage = function (APageIndex) {
      this.GetRoot().GoToPage(APageIndex);
    };
    this.GoToFirstPage = function () {
      this.GetRoot().GoToFirstPage();
    };
    this.GoToLastPage = function () {
      this.GetRoot().GoToLastPage();
    };
    this.GoToCell = function (ACell, ASelect) {
      this.GetRoot().GoToCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),ASelect);
    };
    this.Group = function (AColumn) {
      this.GetRoot().Group(AColumn);
    };
    this.Group$1 = function (AColumns, ASortColumns, ACustomGroupCallback, ACustomCompareCallback, AGroupOptionsCallback, ASortOptionsCallback) {
      this.GetRoot().Group$1(rtl.arrayRef(AColumns),rtl.arrayRef(ASortColumns),ACustomGroupCallback,ACustomCompareCallback,AGroupOptionsCallback,ASortOptionsCallback);
    };
    this.Group$2 = function (AGroupInfo, ACustomGroupCallback, ACustomCompareCallback, AGroupOptionsCallback, ASortOptionsCallback) {
      this.GetRoot().Group$2(pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataGroupInfo.$clone(AGroupInfo),ACustomGroupCallback,ACustomCompareCallback,AGroupOptionsCallback,ASortOptionsCallback);
    };
    this.GroupAverage = function (AColumn) {
      this.GetRoot().GroupAverage(AColumn,null);
    };
    this.GroupAverage$1 = function (AColumns, ACalculationOptionsCallback) {
      this.GetRoot().GroupAverage$1(rtl.arrayRef(AColumns),ACalculationOptionsCallback);
    };
    this.GroupCalculation = function (AColumn, AMethod, ACalculationOptionsCallback, ACustomCalculationCallback) {
      this.GetRoot().GroupCalculation(AColumn,AMethod,ACalculationOptionsCallback,ACustomCalculationCallback);
    };
    this.GroupCalculation$1 = function (AColumns, AMethod, ACalculationOptionsCallback, ACustomCalculationCallback) {
      this.GetRoot().GroupCalculation$1(rtl.arrayRef(AColumns),AMethod,ACalculationOptionsCallback,ACustomCalculationCallback);
    };
    this.GroupCount = function (AColumn, ACalculationOptionsCallback) {
      this.GetRoot().GroupCount(AColumn,ACalculationOptionsCallback);
    };
    this.GroupCount$1 = function (AColumns, ACalculationOptionsCallback) {
      this.GetRoot().GroupCount$1(rtl.arrayRef(AColumns),ACalculationOptionsCallback);
    };
    this.GroupCustomCalculation = function (AColumn, ACalculationOptionsCallback, ACustomCalculationCallback) {
      this.GetRoot().GroupCustomCalculation(AColumn,ACalculationOptionsCallback,ACustomCalculationCallback);
    };
    this.GroupCustomCalculation$1 = function (AColumns, ACalculationOptionsCallback, ACustomCalculationCallback) {
      this.GetRoot().GroupCustomCalculation$1(rtl.arrayRef(AColumns),ACalculationOptionsCallback,ACustomCalculationCallback);
    };
    this.GroupDistinct = function (AColumn, ACalculationOptionsCallback) {
      this.GetRoot().GroupDistinct(AColumn,ACalculationOptionsCallback);
    };
    this.GroupDistinct$1 = function (AColumns, ACalculationOptionsCallback) {
      this.GetRoot().GroupDistinct$1(rtl.arrayRef(AColumns),ACalculationOptionsCallback);
    };
    this.GroupMax = function (AColumn, ACalculationOptionsCallback) {
      this.GetRoot().GroupMax(AColumn,ACalculationOptionsCallback);
    };
    this.GroupMax$1 = function (AColumns, ACalculationOptionsCallback) {
      this.GetRoot().GroupMax$1(rtl.arrayRef(AColumns),ACalculationOptionsCallback);
    };
    this.GroupMin = function (AColumn, ACalculationOptionsCallback) {
      this.GetRoot().GroupMin(AColumn,ACalculationOptionsCallback);
    };
    this.GroupMin$1 = function (AColumns, ACalculationOptionsCallback) {
      this.GetRoot().GroupMin$1(rtl.arrayRef(AColumns),ACalculationOptionsCallback);
    };
    this.GroupSort = function (AColumn, ADirection) {
      this.GetRoot().GroupSort(AColumn,ADirection);
    };
    this.GroupSort$1 = function (AColumns, ADirections, ACustomCompareCallback, ASortOptionsCallback) {
      this.GetRoot().GroupSort$1(rtl.arrayRef(AColumns),rtl.arrayRef(ADirections),ACustomCompareCallback,ASortOptionsCallback);
    };
    this.GroupStandardDeviation = function (AColumn, ACalculationOptionsCallback) {
      this.GetRoot().GroupStandardDeviation(AColumn,ACalculationOptionsCallback);
    };
    this.GroupStandardDeviation$1 = function (AColumns, ACalculationOptionsCallback) {
      this.GetRoot().GroupStandardDeviation$1(rtl.arrayRef(AColumns),ACalculationOptionsCallback);
    };
    this.GroupSum = function (AColumn, ACalculationOptionsCallback) {
      this.GetRoot().GroupSum(AColumn,ACalculationOptionsCallback);
    };
    this.GroupSum$1 = function (AColumns, ACalculationOptionsCallback) {
      this.GetRoot().GroupSum$1(rtl.arrayRef(AColumns),ACalculationOptionsCallback);
    };
    this.HideColumn = function (AColumn) {
      this.GetRoot().HideColumn(AColumn);
    };
    this.HideRow = function (ARow) {
      this.GetRoot().HideRow(ARow);
    };
    this.HilightCells = function (AHilightText, AOptions) {
      this.GetRoot().HilightCells(AHilightText,pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridHilightOptions.$clone(AOptions));
    };
    this.InitSample = function () {
      var I = 0;
      this.BeginUpdate();
      try {
        this.Clear();
        this.ResetToDefaultStyle();
        this.GetRoot().SetDefaultRowHeight(this.ScalePaintValue(30));
        this.GetRoot().SetFixedColumnCount(0);
        this.GetRoot().SetColumnWidth(0,this.ScalePaintValue(70));
        this.GetRoot().SetColumnWidth(1,this.ScalePaintValue(250));
        this.GetRoot().SetColumnWidth(2,this.ScalePaintValue(100));
        this.GetRoot().SetColumnWidth(3,this.ScalePaintValue(100));
        this.GetColumns().Clear();
        for (I = 0; I <= 3; I++) this.GetColumns().Add$1();
        this.LoadSampleData();
      } finally {
        this.EndUpdate();
      };
    };
    this.InsertColumn = function (AColumn) {
      this.GetRoot().InsertColumn(AColumn);
    };
    this.InsertColumns = function (AColumn, ACount) {
      this.GetRoot().InsertColumns(AColumn,ACount);
    };
    this.InsertRow = function (ARow) {
      this.GetRoot().InsertRow(ARow);
    };
    this.InsertRows = function (ARow, ACount) {
      this.GetRoot().InsertRows(ARow,ACount);
    };
    this.LinearFill = function (ADoFixed) {
      this.GetRoot().LinearFill(ADoFixed);
    };
    this.LoadFromCSVData = function (AFileName) {
      this.GetRoot().LoadFromCSVData(AFileName);
    };
    this.LoadFromCSVData$1 = function (AFileName, AEncoding) {
      this.GetRoot().LoadFromCSVData$1(AFileName,AEncoding);
    };
    this.LoadFromCSVStreamData = function (AStream) {
      this.GetRoot().LoadFromCSVStreamData(AStream);
    };
    this.LoadFromCSVStreamData$1 = function (AStream, AEncoding) {
      this.GetRoot().LoadFromCSVStreamData$1(AStream,AEncoding);
    };
    this.LoadFromFileData = function (AFileName) {
      this.GetRoot().LoadFromFileData(AFileName);
    };
    this.LoadFromFileData$1 = function (AFileName, AEncoding) {
      this.GetRoot().LoadFromFileData$1(AFileName,AEncoding);
    };
    this.LoadFromFileStreamData = function (AStream) {
      this.GetRoot().LoadFromFileStreamData(AStream);
    };
    this.LoadFromFileStreamData$1 = function (AStream, AEncoding) {
      this.GetRoot().LoadFromFileStreamData$1(AStream,AEncoding);
    };
    this.LoadFromJSONData = function (AFileName, AEncoding, ARowDataName, AColumnDataName, AColumnNames) {
      this.GetRoot().LoadFromJSONData(AFileName,AEncoding,ARowDataName,AColumnDataName,rtl.arrayRef(AColumnNames));
    };
    this.LoadFromJSONData$1 = function (AFileName, ARowDataName, AColumnDataName, AColumnNames) {
      this.GetRoot().LoadFromJSONData(AFileName,pas.SysUtils.TEncoding.GetDefault(),ARowDataName,AColumnDataName,rtl.arrayRef(AColumnNames));
    };
    this.LoadFromJSONStreamData = function (AStream, AEncoding, ARowDataName, AColumnDataName, AColumnNames) {
      this.GetRoot().LoadFromJSONStreamData(AStream,AEncoding,ARowDataName,AColumnDataName,rtl.arrayRef(AColumnNames));
    };
    this.LoadFromJSONStreamData$1 = function (AStream, ARowDataName, AColumnDataName, AColumnNames) {
      this.GetRoot().LoadFromJSONStreamData(AStream,pas.SysUtils.TEncoding.GetDefault(),ARowDataName,AColumnDataName,rtl.arrayRef(AColumnNames));
    };
    this.LoadFromJSONTextData = function (AText, ARowDataName, AColumnDataName, AColumnNames) {
      this.GetRoot().LoadFromJSONTextData(AText,ARowDataName,AColumnDataName,rtl.arrayRef(AColumnNames));
    };
    this.LoadFromXMLData = function (AFileName) {
      this.GetRoot().LoadFromXMLData(AFileName);
    };
    this.LoadFromXMLData$1 = function (AFileName, AEncoding) {
      this.GetRoot().LoadFromXMLData$1(AFileName,AEncoding);
    };
    this.LoadFromXMLStreamData = function (AStream) {
      this.GetRoot().LoadFromXMLStreamData(AStream);
    };
    this.LoadFromXMLStreamData$1 = function (AStream, AEncoding) {
      this.GetRoot().LoadFromXMLStreamData$1(AStream,AEncoding);
    };
    this.LoadSampleData = function () {
      this.GetRoot().LoadSampleData();
    };
    this.LogMessage = function (AMessage, AMessageType) {
      this.GetRoot().LogMessage(AMessage,AMessageType);
    };
    this.LoopThroughColumns = function (ALoopCallback, AIncludeFixed) {
      this.GetRoot().LoopThroughColumns(ALoopCallback,AIncludeFixed);
    };
    this.LoopThroughRows = function (ALoopCallback, AIncludeFixed) {
      this.GetRoot().LoopThroughRows(ALoopCallback,AIncludeFixed);
    };
    this.MarkCells = function (AHilightText, AOptions) {
      this.GetRoot().MarkCells(AHilightText,pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridHilightOptions.$clone(AOptions));
    };
    this.MergeCells = function (AColumn, ARow, AColumnCount, ARowCount) {
      this.GetRoot().MergeCells(AColumn,ARow,AColumnCount,ARowCount);
    };
    this.MergeColumn = function (AColumn) {
      this.GetRoot().MergeColumn(AColumn);
    };
    this.MergeColumns = function (AColumn, ACount) {
      this.GetRoot().MergeColumns(AColumn,ACount);
    };
    this.MergeRange = function (ARange) {
      this.GetRoot().MergeRange(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoordRange.$clone(ARange));
    };
    this.MergeRow = function (ARow) {
      this.GetRoot().MergeRow(ARow);
    };
    this.MergeRows = function (ARow, ACount) {
      this.GetRoot().MergeRows(ARow,ACount);
    };
    this.MoveColumn = function (AFromColumn, AToColumn) {
      this.GetRoot().MoveColumn(AFromColumn,AToColumn);
    };
    this.MoveRow = function (AFromRow, AToRow) {
      this.GetRoot().MoveRow(AFromRow,AToRow);
    };
    this.PasteFromClipboard = function () {
      this.GetRoot().PasteFromClipboard();
    };
    this.RandomFill = function (ADoFixed, ARandomNumber) {
      this.GetRoot().RandomFill(ADoFixed,ARandomNumber);
    };
    this.RemoveBitmap = function (ACell) {
      this.GetRoot().RemoveBitmap(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
    };
    this.RemoveBitmap$1 = function (AColumn, ARow) {
      this.GetRoot().RemoveBitmap$1(AColumn,ARow);
    };
    this.RemoveButton = function (ACell) {
      this.GetRoot().RemoveButton(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
    };
    this.RemoveButton$1 = function (AColumn, ARow) {
      this.GetRoot().RemoveButton$1(AColumn,ARow);
    };
    this.RemoveCheckBox = function (ACell) {
      this.GetRoot().RemoveCheckBox(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
    };
    this.RemoveCheckBox$1 = function (AColumn, ARow) {
      this.GetRoot().RemoveCheckBox$1(AColumn,ARow);
    };
    this.RemoveDataCheckBox = function (ACell) {
      this.GetRoot().RemoveDataCheckBox(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
    };
    this.RemoveDataCheckBox$1 = function (AColumn, ARow) {
      this.GetRoot().RemoveDataCheckBox$1(AColumn,ARow);
    };
    this.RemoveDataRadioButton = function (ACell) {
      this.GetRoot().RemoveDataRadioButton(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
    };
    this.RemoveDataRadioButton$1 = function (AColumn, ARow) {
      this.GetRoot().RemoveDataRadioButton$1(AColumn,ARow);
    };
    this.RemoveFilter = function () {
      this.GetRoot().RemoveFilter();
    };
    this.RemoveFilterEditor = function (ACell) {
      this.GetRoot().RemoveFilterEditor(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
    };
    this.RemoveFilterEditor$1 = function (AColumn, ARow) {
      this.GetRoot().RemoveFilterEditor$1(AColumn,ARow);
    };
    this.RemoveGrid = function (ACell) {
      this.GetRoot().RemoveGrid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
    };
    this.RemoveGrid$1 = function (AColumn, ARow) {
      this.GetRoot().RemoveGrid$1(AColumn,ARow);
    };
    this.RemoveLayout = function (ACell) {
      this.GetRoot().RemoveLayout(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
    };
    this.RemoveLayout$1 = function (AColumn, ARow) {
      this.GetRoot().RemoveLayout$1(AColumn,ARow);
    };
    this.RemoveNodeRow = function (ARow) {
      this.GetRoot().RemoveNodeRow(ARow);
    };
    this.RemoveProgressBar = function (ACell) {
      this.GetRoot().RemoveProgressBar(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
    };
    this.RemoveProgressBar$1 = function (AColumn, ARow) {
      this.GetRoot().RemoveProgressBar$1(AColumn,ARow);
    };
    this.RemoveRadioButton = function (ACell) {
      this.GetRoot().RemoveRadioButton(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
    };
    this.RemoveRadioButton$1 = function (AColumn, ARow) {
      this.GetRoot().RemoveRadioButton$1(AColumn,ARow);
    };
    this.RowCalculation = function (ARow, AMethod, ACalculationOptionsCallback, ACustomCalculationCallback) {
      this.GetRoot().RowCalculation(ARow,AMethod,ACalculationOptionsCallback,ACustomCalculationCallback);
    };
    this.RowCalculation$1 = function (ARows, AMethod, ACalculationOptionsCallback, ACustomCalculationCallback) {
      this.GetRoot().RowCalculation$1(rtl.arrayRef(ARows),AMethod,ACalculationOptionsCallback,ACustomCalculationCallback);
    };
    this.ResetDrag = function () {
      this.GetRoot().ResetDrag();
    };
    this.SaveToCSVData = function (AFileName) {
      this.GetRoot().SaveToCSVData(AFileName);
    };
    this.SaveToCSVData$1 = function (AFileName, AEncoding) {
      this.GetRoot().SaveToCSVData$1(AFileName,AEncoding);
    };
    this.SaveToCSVStreamData = function (AStream) {
      this.GetRoot().SaveToCSVStreamData(AStream);
    };
    this.SaveToCSVStreamData$1 = function (AStream, AEncoding) {
      this.GetRoot().SaveToCSVStreamData$1(AStream,AEncoding);
    };
    this.SaveToFileData = function (AFileName) {
      this.GetRoot().SaveToFileData(AFileName);
    };
    this.SaveToFileData$1 = function (AFileName, AEncoding) {
      this.GetRoot().SaveToFileData$1(AFileName,AEncoding);
    };
    this.SaveToFileStreamData = function (AStream) {
      this.GetRoot().SaveToFileStreamData(AStream);
    };
    this.SaveToFileStreamData$1 = function (AStream, AEncoding) {
      this.GetRoot().SaveToFileStreamData$1(AStream,AEncoding);
    };
    this.SaveToHTMLData = function (AFileName) {
      this.GetRoot().SaveToHTMLData(AFileName);
    };
    this.SaveToHTMLData$1 = function (AFileName, AEncoding) {
      this.GetRoot().SaveToHTMLData$1(AFileName,AEncoding);
    };
    this.SaveToHTMLStreamData = function (AStream) {
      this.GetRoot().SaveToHTMLStreamData(AStream);
    };
    this.SaveToHTMLStreamData$1 = function (AStream, AEncoding) {
      this.GetRoot().SaveToHTMLStreamData$1(AStream,AEncoding);
    };
    this.SaveToImageData = function (AFileName) {
      this.GetRoot().SaveToImageData(AFileName);
    };
    this.SaveToImageStreamData = function (AStream) {
      this.GetRoot().SaveToImageStreamData(AStream);
    };
    this.Scroll = function (AHorizontalPos, AVerticalPos) {
      this.GetRoot().Scroll(AHorizontalPos,AVerticalPos);
    };
    this.SelectAllCells = function (AIncludeHidden) {
      this.GetRoot().SelectAllCells(AIncludeHidden);
    };
    this.SelectCell = function (ACell, AShift) {
      this.GetRoot().SelectCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),rtl.refSet(AShift),false,false,false);
    };
    this.SelectColumns = function (AFromColumn, AToColumn) {
      this.GetRoot().SelectColumns(AFromColumn,AToColumn);
    };
    this.SelectRows = function (AFromRow, AToRow) {
      this.GetRoot().SelectRows(AFromRow,AToRow);
    };
    this.SelectCellRange = function (AFromCol, AFromRow, AToCol, AToRow) {
      this.GetRoot().SelectCellRange(AFromCol,AFromRow,AToCol,AToRow);
    };
    this.SetBitmap = function (ACell, ABitmap) {
      this.GetRoot().SetBitmap(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),ABitmap);
    };
    this.SetBitmap$1 = function (ACell, AName) {
      this.GetRoot().SetBitmap$1(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AName);
    };
    this.SetBitmap$2 = function (AColumn, ARow, ABitmap) {
      this.GetRoot().SetBitmap$2(AColumn,ARow,ABitmap);
    };
    this.SetBitmap$3 = function (AColumn, ARow, AName) {
      this.GetRoot().SetBitmap$3(AColumn,ARow,AName);
    };
    this.SetBitmapColumn = function (AColumn, ABitmap) {
      this.GetRoot().SetBitmapColumn(AColumn,ABitmap);
    };
    this.SetBitmapColumn$1 = function (AColumn, AName) {
      this.GetRoot().SetBitmapColumn$1(AColumn,AName);
    };
    this.SetButton = function (ACell, AText) {
      this.GetRoot().SetButton(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AText);
    };
    this.SetButton$1 = function (AColumn, ARow, AText) {
      this.GetRoot().SetButton$1(AColumn,ARow,AText);
    };
    this.SetButtonColumn = function (AColumn, AText) {
      this.GetRoot().SetButtonColumn(AColumn,AText);
    };
    this.SetCheckBox = function (ACell, AValue) {
      this.GetRoot().SetCheckBox(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AValue);
    };
    this.SetCheckBox$1 = function (AColumn, ARow, AValue) {
      this.GetRoot().SetCheckBox$1(AColumn,ARow,AValue);
    };
    this.SetCheckBoxColumn = function (AColumn, AValue) {
      this.GetRoot().SetCheckBoxColumn(AColumn,AValue);
    };
    this.SetDataCheckBox = function (ACell) {
      this.GetRoot().SetDataCheckBox(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
    };
    this.SetDataCheckBox$1 = function (AColumn, ARow) {
      this.GetRoot().SetDataCheckBox$1(AColumn,ARow);
    };
    this.SetDataCheckBoxColumn = function (AColumn) {
      this.GetRoot().SetDataCheckBoxColumn(AColumn);
    };
    this.SetDataProgressBar = function (ACell) {
      this.GetRoot().SetDataProgressBar(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
    };
    this.SetDataProgressBar$1 = function (AColumn, ARow) {
      this.GetRoot().SetDataProgressBar$1(AColumn,ARow);
    };
    this.SetDataProgressBarColumn = function (AColumn) {
      this.GetRoot().SetDataProgressBarColumn(AColumn);
    };
    this.SetDataRadioButton = function (ACell, AValue, AGroupIndex) {
      this.GetRoot().SetDataRadioButton(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AValue,AGroupIndex);
    };
    this.SetDataRadioButton$1 = function (AColumn, ARow, AValue, AGroupIndex) {
      this.GetRoot().SetDataRadioButton$1(AColumn,ARow,AValue,AGroupIndex);
    };
    this.SetDataRadioButtonColumn = function (AColumn, AValue, AGroupIndex) {
      this.GetRoot().SetDataRadioButtonColumn(AColumn,AValue,AGroupIndex);
    };
    this.SetNodeRow = function (ARow, AChildCount, ALevel, AMerge) {
      this.GetRoot().SetNodeRow(ARow,AChildCount,ALevel,AMerge);
    };
    this.SetProgressBar = function (ACell, AValue) {
      this.GetRoot().SetProgressBar(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AValue);
    };
    this.SetProgressBar$1 = function (AColumn, ARow, AValue) {
      this.GetRoot().SetProgressBar$1(AColumn,ARow,AValue);
    };
    this.SetProgressBarColumn = function (AColumn, AValue) {
      this.GetRoot().SetProgressBarColumn(AColumn,AValue);
    };
    this.SetRadioButton = function (ACell, AValue, AGroupIndex) {
      this.GetRoot().SetRadioButton(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AValue,AGroupIndex);
    };
    this.SetRadioButton$1 = function (AColumn, ARow, AValue, AGroupIndex) {
      this.GetRoot().SetRadioButton$1(AColumn,ARow,AValue,AGroupIndex);
    };
    this.SetRadioButtonColumn = function (AColumn, AValue, AGroupIndex) {
      this.GetRoot().SetRadioButtonColumn(AColumn,AValue,AGroupIndex);
    };
    this.ShowFilterDialog = function () {
      this.GetRoot().ShowFilterDialog();
    };
    this.ShowColumnsEditor = function () {
      this.GetRoot().ShowColumnsEditor();
    };
    this.ShowFindDialog = function () {
      this.GetRoot().ShowFindDialog();
    };
    this.ShowReplaceDialog = function () {
      this.GetRoot().ShowReplaceDialog();
    };
    this.Sort = function (AColumn, ADirection) {
      this.GetRoot().Sort(AColumn,ADirection);
    };
    this.Sort$1 = function (AColumn, ADirection, AFromRow, AToRow) {
      this.GetRoot().Sort$1(AColumn,ADirection,AFromRow,AToRow);
    };
    this.Sort$2 = function (AColumns, ADirections, ACustomCompareCallback, ASortOptionsCallback) {
      this.GetRoot().Sort$2(rtl.arrayRef(AColumns),rtl.arrayRef(ADirections),ACustomCompareCallback,ASortOptionsCallback);
    };
    this.Sort$3 = function (AColumns, ADirections, AFromRow, AToRow, ACustomCompareCallback, ASortOptionsCallback) {
      this.GetRoot().Sort$3(rtl.arrayRef(AColumns),rtl.arrayRef(ADirections),AFromRow,AToRow,ACustomCompareCallback,ASortOptionsCallback);
    };
    this.SortIndexed = function () {
      this.GetRoot().SortIndexed();
    };
    this.SplitCell = function (ACell) {
      this.GetRoot().SplitCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
    };
    this.StretchColumns = function (AMode, ARange, AIndex, ANewWidth) {
      this.GetRoot().StretchColumns(AMode,ARange,AIndex,ANewWidth);
    };
    this.StretchRows = function (AMode, ARange, AIndex, ANewHeight) {
      this.GetRoot().StretchRows(AMode,ARange,AIndex,ANewHeight);
    };
    this.SwapCells = function (AFromCell, AToCell) {
      this.GetRoot().SwapCells(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(AFromCell),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(AToCell));
    };
    this.SwapColumns = function (AFromColumn, AToColumn) {
      this.GetRoot().SwapColumn(AFromColumn,AToColumn);
    };
    this.SwapRows = function (AFromRow, AToRow) {
      this.GetRoot().SwapRow(AFromRow,AToRow);
    };
    this.ToggleNode = function (ARow) {
      this.GetRoot().ToggleNode(ARow);
    };
    this.Ungroup = function () {
      this.GetRoot().Ungroup();
    };
    this.UnhideAll = function () {
      this.GetRoot().UnhideAll();
    };
    this.UnhideAllColumns = function () {
      this.GetRoot().UnhideAllColumns();
    };
    this.UnhideAllRows = function () {
      this.GetRoot().UnhideAllRows();
    };
    this.UnhideColumn = function (AColumn) {
      this.GetRoot().UnhideColumn(AColumn);
    };
    this.UnhideRow = function (ARow) {
      this.GetRoot().UnhideRow(ARow);
    };
    this.UnhilightCells = function (AOptions) {
      this.GetRoot().UnhilightCells(pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridHilightOptions.$clone(AOptions));
    };
    this.UnmarkCells = function (AOptions) {
      this.GetRoot().UnmarkCells(pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridHilightOptions.$clone(AOptions));
    };
    this.UpdateCalculations = function () {
      this.GetRoot().UpdateCalculations();
    };
    this.UpdateColumnCalculation = function (AColumn, AName) {
      this.GetRoot().UpdateColumnCalculation(AColumn,AName);
    };
    this.UpdateColumnCalculations = function () {
      this.GetRoot().UpdateColumnCalculations();
    };
    this.UpdateRowCalculation = function (ARow, AName) {
      this.GetRoot().UpdateRowCalculation(ARow,AName);
    };
    this.UpdateRowCalculations = function () {
      this.GetRoot().UpdateRowCalculations();
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphicsTypes"].ITMSFNCAppearanceGlobalFont);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataGridRenderer"].ITMSFNCDataGridRendererLink);
    rtl.addIntf(this,pas["WEBLib.Controls"].ITMSFNCDataBinderGrid,{ClearData: "DataClearData"});
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCCustomReadWriteIO);
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCDataGrid",this.TTMSFNCCustomDataGrid,function () {
    this.RegisterRuntimeClasses = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClasses([$mod.TTMSFNCDataGrid]);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphicsTypes"].ITMSFNCAppearanceGlobalFont);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataGridRenderer"].ITMSFNCDataGridRendererLink);
    rtl.addIntf(this,pas["WEBLib.Controls"].ITMSFNCDataBinderGrid,{ClearData: "DataClearData"});
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCCustomReadWriteIO);
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Footer",2,$mod.$rtti["TTMSFNCDataGridFooter"],"FFooter","SetFooter");
    $r.addProperty("Header",3,$mod.$rtti["TTMSFNCDataGridHeader"],"GetHeader","SetHeader");
    $r.addProperty("AcceptDropFiles",2,rtl.boolean,"FAcceptDropFiles","SetAcceptDropFiles",4,{Default: false});
    $r.addProperty("Adapter",3,pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataAdapter"],"GetAdapter","SetAdapter");
    $r.addProperty("BitmapContainer",3,pas["WEBLib.TMSFNCBitmapContainer"].$rtti["TTMSFNCBitmapContainer"],"GetBitmapContainer","SetBitmapContainer");
    $r.addProperty("CellAppearance",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCellAppearance"],"GetCellAppearance","SetCellAppearance");
    $r.addProperty("CellPopupMenu",3,pas["WEBLib.Menus"].$rtti["TPopupMenu"],"GetCellPopupMenu","SetCellPopupMenu");
    $r.addProperty("ColumnCount",3,rtl.longint,"GetColumnCount","SetColumnCount",4,{Default: 4});
    $r.addProperty("Columns",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridColumns"],"GetColumns","SetColumns");
    $r.addProperty("ColumnViewMode",3,pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridColumnViewMode"],"GetColumnViewMode","SetColumnViewMode",4,{Default: pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridColumnViewMode.gcvmTotalColumns});
    $r.addProperty("DefaultColumnWidth",15,rtl.double,"GetDefaultColumnWidth","SetDefaultColumnWidth",4,{stored: "IsDefaultColumnWidthStored"});
    $r.addProperty("DefaultRowHeight",15,rtl.double,"GetDefaultRowHeight","SetDefaultRowHeight",4,{stored: "IsDefaultRowHeightStored"});
    $r.addProperty("Designer",2,rtl.boolean,"FDesigner","SetDesigner",4,{Default: true});
    $r.addProperty("DragAppearance",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridDragAppearance"],"GetDragAppearance","SetDragAppearance");
    $r.addProperty("AutoFillAppearance",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridAutoFillAppearance"],"GetAutoFillAppearance","SetAutoFillAppearance");
    $r.addProperty("Fill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFill","SetFill");
    $r.addProperty("FilterActions",3,pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataFilterActions"],"GetFilterActions","SetFilterActions");
    $r.addProperty("FilterAppearance",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridFilterAppearance"],"GetFilterAppearance","SetFilterAppearance");
    $r.addProperty("FixedBottomRowCount",3,rtl.longint,"GetFixedBottomRowCount","SetFixedBottomRowCount",4,{Default: 0});
    $r.addProperty("FixedColumnCount",3,rtl.longint,"GetFixedColumnCount","SetFixedColumnCount",4,{Default: 0});
    $r.addProperty("FixedRightColumnCount",3,rtl.longint,"GetFixedRightColumnCount","SetFixedRightColumnCount",4,{Default: 0});
    $r.addProperty("FixedRowCount",3,rtl.longint,"GetFixedRowCount","SetFixedRowCount",4,{Default: 1});
    $r.addProperty("FreezeColumnCount",3,rtl.longint,"GetFreezeColumnCount","SetFreezeColumnCount",4,{Default: 0});
    $r.addProperty("FreezeRowCount",3,rtl.longint,"GetFreezeRowCount","SetFreezeRowCount",4,{Default: 0});
    $r.addProperty("GlobalFont",3,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCAppearanceGlobalFont"],"GetGlobalFont","SetGlobalFont");
    $r.addProperty("HorizontalScrollBarVisible",3,rtl.boolean,"GetHorizontalScrollBarVisible","SetHorizontalScrollBarVisible",4,{Default: true});
    $r.addProperty("Icons",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridIcons"],"GetIcons","SetIcons");
    $r.addProperty("OnAutoFillCalculateValue",3,pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataAutoFillCalculateValueEvent"],"GetOnAutoFillCalculateValue","SetOnAutoFillCalculateValue");
    $r.addProperty("OnBeforeApplyAutoFill",3,pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataBeforeApplyAutoFillEvent"],"GetOnBeforeApplyAutoFill","SetOnBeforeApplyAutoFill");
    $r.addProperty("OnAfterApplyAutoFill",3,pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataAfterApplyAutoFillEvent"],"GetOnAfterApplyAutoFill","SetOnAfterApplyAutoFill");
    $r.addProperty("OnAutoFillGetCustomList",3,pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataAutoFillGetCustomListEvent"],"GetOnAutoFillGetCustomList","SetOnAutoFillGetCustomList");
    $r.addProperty("OnPageChanged",0,$mod.$rtti["TTMSFNCDataGridPageChangedEvent"],"FOnPageChanged","FOnPageChanged");
    $r.addProperty("OnBeforeDrawHeader",0,$mod.$rtti["TTMSFNCDataGridBeforeDrawHeaderEvent"],"FOnBeforeDrawHeader","FOnBeforeDrawHeader");
    $r.addProperty("OnAfterDrawHeader",0,$mod.$rtti["TTMSFNCDataGridAfterDrawHeaderEvent"],"FOnAfterDrawHeader","FOnAfterDrawHeader");
    $r.addProperty("OnBeforeDrawFooter",0,$mod.$rtti["TTMSFNCDataGridBeforeDrawFooterEvent"],"FOnBeforeDrawFooter","FOnBeforeDrawFooter");
    $r.addProperty("OnAfterDrawFooter",0,$mod.$rtti["TTMSFNCDataGridAfterDrawFooterEvent"],"FOnAfterDrawFooter","FOnAfterDrawFooter");
    $r.addProperty("OnBeforeDrawHeaderGroupLevel",0,$mod.$rtti["TTMSFNCDataGridBeforeDrawHeaderGroupLevelEvent"],"FOnBeforeDrawHeaderGroupLevel","FOnBeforeDrawHeaderGroupLevel");
    $r.addProperty("OnAfterDrawHeaderGroupLevel",0,$mod.$rtti["TTMSFNCDataGridAfterDrawHeaderGroupLevelEvent"],"FOnAfterDrawHeaderGroupLevel","FOnAfterDrawHeaderGroupLevel");
    $r.addProperty("OnBeforeDrawHeaderGroup",0,$mod.$rtti["TTMSFNCDataGridBeforeDrawHeaderGroupEvent"],"FOnBeforeDrawHeaderGroup","FOnBeforeDrawHeaderGroup");
    $r.addProperty("OnAfterDrawHeaderGroup",0,$mod.$rtti["TTMSFNCDataGridAfterDrawHeaderGroupEvent"],"FOnAfterDrawHeaderGroup","FOnAfterDrawHeaderGroup");
    $r.addProperty("OnBeforeDropHeaderGroup",0,$mod.$rtti["TTMSFNCDataGridBeforeDropHeaderGroupEvent"],"FOnBeforeDropHeaderGroup","FOnBeforeDropHeaderGroup");
    $r.addProperty("OnCanDragHeaderGroup",0,$mod.$rtti["TTMSFNCDataGridCanDragHeaderGroupEvent"],"FOnCanDragHeaderGroup","FOnCanDragHeaderGroup");
    $r.addProperty("OnAfterDropHeaderGroup",0,$mod.$rtti["TTMSFNCDataGridAfterDropHeaderGroupEvent"],"FOnAfterDropHeaderGroup","FOnAfterDropHeaderGroup");
    $r.addProperty("OnBeforeSortHeaderGroup",0,$mod.$rtti["TTMSFNCDataGridBeforeSortHeaderGroupEvent"],"FOnBeforeSortHeaderGroup","FOnBeforeSortHeaderGroup");
    $r.addProperty("OnAfterSortHeaderGroup",0,$mod.$rtti["TTMSFNCDataGridAfterSortHeaderGroupEvent"],"FOnAfterSortHeaderGroup","FOnAfterSortHeaderGroup");
    $r.addProperty("OnBeforeCloseHeaderGroup",0,$mod.$rtti["TTMSFNCDataGridBeforeCloseHeaderGroupEvent"],"FOnBeforeCloseHeaderGroup","FOnBeforeCloseHeaderGroup");
    $r.addProperty("OnAfterCloseHeaderGroup",0,$mod.$rtti["TTMSFNCDataGridAfterCloseHeaderGroupEvent"],"FOnAfterCloseHeaderGroup","FOnAfterCloseHeaderGroup");
    $r.addProperty("OnHeaderGroupClick",0,$mod.$rtti["TTMSFNCDataGridHeaderGroupClickEvent"],"FOnHeaderGroupClick","FOnHeaderGroupClick");
    $r.addProperty("OnAfterApplyFilter",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridAfterApplyFilterEvent"],"GetOnAfterApplyFilter","SetOnAfterApplyFilter");
    $r.addProperty("OnAfterApplyAdvancedFilter",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridAfterApplyAdvancedFilterEvent"],"GetOnAfterApplyAdvancedFilter","SetOnAfterApplyAdvancedFilter");
    $r.addProperty("OnAfterCloseInplaceEditor",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridAfterCloseInplaceEditorEvent"],"GetOnAfterCloseInplaceEditor","SetOnAfterCloseInplaceEditor");
    $r.addProperty("OnAfterExitInplaceEditor",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridAfterExitInplaceEditorEvent"],"GetOnAfterExitInplaceEditor","SetOnAfterExitInplaceEditor");
    $r.addProperty("OnAfterCopyToClipboard",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridAfterClipboardEvent"],"GetOnAfterCopyToClipboard","SetOnAfterCopyToClipboard");
    $r.addProperty("OnAfterCreateFilterEditor",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridAfterCreateFilterEditorEvent"],"GetOnAfterCreateFilterEditor","SetOnAfterCreateFilterEditor");
    $r.addProperty("OnAfterCutToClipboard",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridAfterClipboardEvent"],"GetOnAfterCutToClipboard","SetOnAfterCutToClipboard");
    $r.addProperty("OnAfterDrawCell",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridAfterDrawCellEvent"],"GetOnAfterDrawCell","SetOnAfterDrawCell");
    $r.addProperty("OnAfterDrawEmptySpace",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridAfterDrawEmptySpaceEvent"],"GetOnAfterDrawEmptySpace","SetOnAfterDrawEmptySpace");
    $r.addProperty("OnAfterDrawGrid",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridAfterDrawGridEvent"],"GetOnAfterDrawGrid","SetOnAfterDrawGrid");
    $r.addProperty("OnAfterLookup",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridAfterLookupEvent"],"GetOnAfterLookup","SetOnAfterLookup");
    $r.addProperty("OnAfterOpenInplaceEditor",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridAfterOpenInplaceEditorEvent"],"GetOnAfterOpenInplaceEditor","SetOnAfterOpenInplaceEditor");
    $r.addProperty("OnAfterPasteFromClipboard",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridAfterClipboardEvent"],"GetOnAfterPasteFromClipboard","SetOnAfterPasteFromClipboard");
    $r.addProperty("OnAfterSetColumnCalculation",3,pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataAfterSetColumnCalculationEvent"],"GetOnAfterSetColumnCalculation","SetOnAfterSetColumnCalculation");
    $r.addProperty("OnAfterSetRowCalculation",3,pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataAfterSetRowCalculationEvent"],"GetOnAfterSetRowCalculation","SetOnAfterSetRowCalculation");
    $r.addProperty("OnAfterShowFilter",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridAfterShowFilterEvent"],"GetOnAfterShowFilter","SetOnAfterShowFilter");
    $r.addProperty("OnAfterShowFilterDialog",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridAfterShowFilterDialogEvent"],"GetOnAfterShowFilterDialog","SetOnAfterShowFilterDialog");
    $r.addProperty("OnAfterShowFindDialog",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridAfterShowFindDialogEvent"],"GetOnAfterShowFindDialog","SetOnAfterShowFindDialog");
    $r.addProperty("OnAfterShowReplaceDialog",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridAfterShowReplaceDialogEvent"],"GetOnAfterShowReplaceDialog","SetOnAfterShowReplaceDialog");
    $r.addProperty("OnBeforeDialogFind",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridBeforeDialogFindEvent"],"GetOnBeforeDialogFind","SetOnBeforeDialogFind");
    $r.addProperty("OnAfterDialogFind",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridAfterDialogFindEvent"],"GetOnAfterDialogFind","SetOnAfterDialogFind");
    $r.addProperty("OnBeforeDialogReplace",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridBeforeDialogReplaceEvent"],"GetOnBeforeDialogReplace","SetOnBeforeDialogReplace");
    $r.addProperty("OnAfterDialogReplace",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridAfterDialogReplaceEvent"],"GetOnAfterDialogReplace","SetOnAfterDialogReplace");
    $r.addProperty("OnAfterSortColumn",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridAfterSortColumnEvent"],"GetOnAfterSortColumn","SetOnAfterSortColumn");
    $r.addProperty("OnAppendColumn",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridAppendColumnEvent"],"GetOnAppendColumn","SetOnAppendColumn");
    $r.addProperty("OnAppendRow",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridAppendRowEvent"],"GetOnAppendRow","SetOnAppendRow");
    $r.addProperty("OnBeforeInplaceEditorGetValue",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridBeforeInplaceEditorGetValueEvent"],"GetOnBeforeInplaceEditorGetValue","SetOnBeforeInplaceEditorGetValue");
    $r.addProperty("OnAfterInplaceEditorGetValue",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridAfterInplaceEditorGetValueEvent"],"GetOnAfterInplaceEditorGetValue","SetOnAfterInplaceEditorGetValue");
    $r.addProperty("OnBeforeInplaceEditorSetValue",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridBeforeInplaceEditorSetValueEvent"],"GetOnBeforeInplaceEditorSetValue","SetOnBeforeInplaceEditorSetValue");
    $r.addProperty("OnAfterInplaceEditorSetValue",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridAfterInplaceEditorSetValueEvent"],"GetOnAfterInplaceEditorSetValue","SetOnAfterInplaceEditorSetValue");
    $r.addProperty("OnBeforeApplyFilter",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridBeforeApplyFilterEvent"],"GetOnBeforeApplyFilter","SetOnBeforeApplyFilter");
    $r.addProperty("OnBeforeApplyAdvancedFilter",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridBeforeApplyAdvancedFilterEvent"],"GetOnBeforeApplyAdvancedFilter","SetOnBeforeApplyAdvancedFilter");
    $r.addProperty("OnBeforeCloseInplaceEditor",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridBeforeCloseInplaceEditorEvent"],"GetOnBeforeCloseInplaceEditor","SetOnBeforeCloseInplaceEditor");
    $r.addProperty("OnBeforeExitInplaceEditor",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridBeforeExitInplaceEditorEvent"],"GetOnBeforeExitInplaceEditor","SetOnBeforeExitInplaceEditor");
    $r.addProperty("OnBeforeCopyToClipboard",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridBeforeClipboardEvent"],"GetOnBeforeCopyToClipboard","SetOnBeforeCopyToClipboard");
    $r.addProperty("OnBeforeCreateFilterEditor",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridBeforeCreateFilterEditorEvent"],"GetOnBeforeCreateFilterEditor","SetOnBeforeCreateFilterEditor");
    $r.addProperty("OnBeforeCutToClipboard",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridBeforeClipboardEvent"],"GetOnBeforeCutToClipboard","SetOnBeforeCutToClipboard");
    $r.addProperty("OnBeforeDrawCell",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridBeforeDrawCellEvent"],"GetOnBeforeDrawCell","SetOnBeforeDrawCell");
    $r.addProperty("OnBeforeDrawEmptySpace",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridBeforeDrawEmptySpaceEvent"],"GetOnBeforeDrawEmptySpace","SetOnBeforeDrawEmptySpace");
    $r.addProperty("OnBeforeLookup",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridBeforeLookupEvent"],"GetOnBeforeLookup","SetOnBeforeLookup");
    $r.addProperty("OnBeforeOpenInplaceEditor",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridBeforeOpenInplaceEditorEvent"],"GetOnBeforeOpenInplaceEditor","SetOnBeforeOpenInplaceEditor");
    $r.addProperty("OnBeforePasteFromClipboard",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridBeforeClipboardEvent"],"GetOnBeforePasteFromClipboard","SetOnBeforePasteFromClipboard");
    $r.addProperty("OnBeforeSetColumnCalculation",3,pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataBeforeSetColumnCalculationEvent"],"GetOnBeforeSetColumnCalculation","SetOnBeforeSetColumnCalculation");
    $r.addProperty("OnBeforeSetRowCalculation",3,pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataBeforeSetRowCalculationEvent"],"GetOnBeforeSetRowCalculation","SetOnBeforeSetRowCalculation");
    $r.addProperty("OnBeforeShowFilter",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridBeforeShowFilterEvent"],"GetOnBeforeShowFilter","SetOnBeforeShowFilter");
    $r.addProperty("OnBeforeShowFilterDialog",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridBeforeShowFilterDialogEvent"],"GetOnBeforeShowFilterDialog","SetOnBeforeShowFilterDialog");
    $r.addProperty("OnBeforeShowFindDialog",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridBeforeShowFindDialogEvent"],"GetOnBeforeShowFindDialog","SetOnBeforeShowFindDialog");
    $r.addProperty("OnBeforeShowReplaceDialog",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridBeforeShowReplaceDialogEvent"],"GetOnBeforeShowReplaceDialog","SetOnBeforeShowReplaceDialog");
    $r.addProperty("OnBeforeSortColumn",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridBeforeSortColumnEvent"],"GetOnBeforeSortColumn","SetOnBeforeSortColumn");
    $r.addProperty("OnCanAppendColumn",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCanAppendColumnEvent"],"GetOnCanAppendColumn","SetOnCanAppendColumn");
    $r.addProperty("OnCanAppendRow",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCanAppendRowEvent"],"GetOnCanAppendRow","SetOnCanAppendRow");
    $r.addProperty("OnCanDeleteColumn",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCanDeleteColumnEvent"],"GetOnCanDeleteColumn","SetOnCanDeleteColumn");
    $r.addProperty("OnCanDeleteRow",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCanDeleteRowEvent"],"GetOnCanDeleteRow","SetOnCanDeleteRow");
    $r.addProperty("OnCanDragColumn",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCanDragColumnEvent"],"GetOnCanDragColumn","SetOnCanDragColumn");
    $r.addProperty("OnCanDragRow",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCanDragRowEvent"],"GetOnCanDragRow","SetOnCanDragRow");
    $r.addProperty("OnCanDropColumn",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCanDropColumnEvent"],"GetOnCanDropColumn","SetOnCanDropColumn");
    $r.addProperty("OnCanDropRow",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCanDropRowEvent"],"GetOnCanDropRow","SetOnCanDropRow");
    $r.addProperty("OnCanEditCell",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCanEditCellEvent"],"GetOnCanEditCell","SetOnCanEditCell");
    $r.addProperty("OnCanInsertColumn",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCanInsertColumnEvent"],"GetOnCanInsertColumn","SetOnCanInsertColumn");
    $r.addProperty("OnCanInsertRow",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCanInsertRowEvent"],"GetOnCanInsertRow","SetOnCanInsertRow");
    $r.addProperty("OnCanSizeColumn",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCanSizeColumnEvent"],"GetOnCanSizeColumn","SetOnCanSizeColumn");
    $r.addProperty("OnCanSizeRow",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCanSizeRowEvent"],"GetOnCanSizeRow","SetOnCanSizeRow");
    $r.addProperty("OnCellAfterNodeCollapse",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCellAfterNodeCollapseEvent"],"GetOnCellAfterNodeCollapse","SetOnCellAfterNodeCollapse");
    $r.addProperty("OnCellAfterNodeExpand",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCellAfterNodeExpandEvent"],"GetOnCellAfterNodeExpand","SetOnCellAfterNodeExpand");
    $r.addProperty("OnCellAnchorClick",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCellAnchorClickEvent"],"GetOnCellAnchorClick","SetOnCellAnchorClick");
    $r.addProperty("OnCellBeforeNodeCollapse",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCellBeforeNodeCollapseEvent"],"GetOnCellBeforeNodeCollapse","SetOnCellBeforeNodeCollapse");
    $r.addProperty("OnCellBeforeNodeExpand",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCellBeforeNodeExpandEvent"],"GetOnCellBeforeNodeExpand","SetOnCellBeforeNodeExpand");
    $r.addProperty("OnCellBeforeShowPopupMenu",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCellBeforeShowPopupMenuEvent"],"GetOnCellBeforeShowPopupMenu","SetOnCellBeforeShowPopupMenu");
    $r.addProperty("OnCellButtonClick",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCellClickEvent"],"GetOnCellButtonClick","SetOnCellButtonClick");
    $r.addProperty("OnCellCheckBoxChange",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCellClickEvent"],"GetOnCellCheckBoxChange","SetOnCellCheckBoxChange");
    $r.addProperty("OnCellClick",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCellClickEvent"],"GetOnCellClick","SetOnCellClick");
    $r.addProperty("OnCellDblClick",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCellClickEvent"],"GetOnCellDblClick","SetOnCellDblClick");
    $r.addProperty("OnCellEditGetData",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCellEditGetDataEvent"],"GetOnCellEditGetData","SetOnCellEditGetData");
    $r.addProperty("OnCellEditSetData",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCellEditSetDataEvent"],"GetOnCellEditSetData","SetOnCellEditSetData");
    $r.addProperty("OnCellEditValidateData",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCellEditValidateDataEvent"],"GetOnCellEditValidateData","SetOnCellEditValidateData");
    $r.addProperty("OnCellRadioButtonChange",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCellClickEvent"],"GetOnCellRadioButtonChange","SetOnCellRadioButtonChange");
    $r.addProperty("OnCellRightClick",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCellClickEvent"],"GetOnCellRightClick","SetOnCellRightClick");
    $r.addProperty("OnColumnDropped",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridColumnDroppedEvent"],"GetOnColumnDropped","SetOnColumnDropped");
    $r.addProperty("OnColumnSized",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridColumnSizedEvent"],"GetOnColumnSized","SetOnColumnSized");
    $r.addProperty("OnCreateCustomFilterEditor",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCreateCustomFilterEditorEvent"],"GetOnCreateCustomFilterEditor","SetOnCreateCustomFilterEditor");
    $r.addProperty("OnCustomColumnCalculation",3,pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataCustomColumnCalculationEvent"],"GetOnCustomColumnCalculation","SetOnCustomColumnCalculation");
    $r.addProperty("OnCustomCompare",3,pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataCustomCompareEvent"],"GetOnCustomCompare","SetOnCustomCompare");
    $r.addProperty("OnCustomizeHeaderGroup",0,$mod.$rtti["TTMSFNCDataGridCustomizeHeaderGroupEvent"],"FOnCustomizeHeaderGroup","FOnCustomizeHeaderGroup");
    $r.addProperty("OnCustomizeFilterPopupEditor",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCustomizeFilterPopupEditorEvent"],"GetOnCustomizeFilterPopupEditor","SetOnCustomizeFilterPopupEditor");
    $r.addProperty("OnCustomRowCalculation",3,pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataCustomRowCalculationEvent"],"GetOnCustomRowCalculation","SetOnCustomRowCalculation");
    $r.addProperty("OnDeleteColumn",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridDeleteColumnEvent"],"GetOnDeleteColumn","SetOnDeleteColumn");
    $r.addProperty("OnDeleteRow",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridDeleteRowEvent"],"GetOnDeleteRow","SetOnDeleteRow");
    $r.addProperty("OnBeforeClearSelectedCells",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridBeforeClearSelectedCellsEvent"],"GetOnBeforeClearSelectedCells","SetOnBeforeClearSelectedCells");
    $r.addProperty("OnAfterClearSelectedCells",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridAfterClearSelectedCellsEvent"],"GetOnAfterClearSelectedCells","SetOnAfterClearSelectedCells");
    $r.addProperty("OnDropFiles",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridDropFilesEvent"],"GetOnDropFiles","SetOnDropFiles");
    $r.addProperty("OnGetCellClass",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridGetCellClassEvent"],"GetOnGetCellClass","SetOnGetCellClass");
    $r.addProperty("OnGetCellData",3,pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataGetCellDataEvent"],"GetOnGetCellData","SetOnGetCellData");
    $r.addProperty("OnGetCellDataProperties",3,pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataGetCellDataPropertiesEvent"],"GetOnGetCellDataProperties","SetOnGetCellDataProperties");
    $r.addProperty("OnGetCellDisplayValue",3,pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataGetCellDisplayValueEvent"],"GetOnGetCellDisplayValue","SetOnGetCellDisplayValue");
    $r.addProperty("OnGetCellFormatting",3,pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataGetCellFormattingEvent"],"GetOnGetCellFormatting","SetOnGetCellFormatting");
    $r.addProperty("OnGetCellHint",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridGetCellHintEvent"],"GetOnGetCellHint","SetOnGetCellHint");
    $r.addProperty("OnGetCellLayout",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridGetCellLayoutEvent"],"GetOnGetCellLayout","SetOnGetCellLayout");
    $r.addProperty("OnGetCellLayoutHasPriority",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridGetCellLayoutHasPriorityEvent"],"GetOnGetCellLayoutHasPriority","SetOnGetCellLayoutHasPriority");
    $r.addProperty("OnGetCellProperties",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridGetCellPropertiesEvent"],"GetOnGetCellProperties","SetOnGetCellProperties");
    $r.addProperty("OnGetColumnCalculationOptions",3,pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataGetColumnCalculationOptionsEvent"],"GetOnGetColumnCalculationOptions","SetOnGetColumnCalculationOptions");
    $r.addProperty("OnGetCustomGroup",3,pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataGetCustomGroupEvent"],"GetOnGetCustomGroup","SetOnGetCustomGroup");
    $r.addProperty("OnGetGroupOptions",3,pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataGetGroupOptionsEvent"],"GetOnGetGroupOptions","SetOnGetGroupOptions");
    $r.addProperty("OnGetInplaceEditorClass",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridGetInplaceEditorClassEvent"],"GetOnGetInplaceEditorClass","SetOnGetInplaceEditorClass");
    $r.addProperty("OnGetInplaceEditorProperties",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridGetInplaceEditorPropertiesEvent"],"GetOnGetInplaceEditorProperties","SetOnGetInplaceEditorProperties");
    $r.addProperty("OnGetInplaceEditorRect",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridGetInplaceEditorRectEvent"],"GetOnGetInplaceEditorRect","SetOnGetInplaceEditorRect");
    $r.addProperty("OnGetInplaceEditorTarget",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridGetInplaceEditorTargetEvent"],"GetOnGetInplaceEditorTarget","SetOnGetInplaceEditorTarget");
    $r.addProperty("OnGetInplaceEditorType",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridGetInplaceEditorTypeEvent"],"GetOnGetInplaceEditorType","SetOnGetInplaceEditorType");
    $r.addProperty("OnGetRowCalculationOptions",3,pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataGetRowCalculationOptionsEvent"],"GetOnGetRowCalculationOptions","SetOnGetRowCalculationOptions");
    $r.addProperty("OnGetSortOptions",3,pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataGetSortOptionsEvent"],"GetOnGetSortOptions","SetOnGetSortOptions");
    $r.addProperty("OnGroup",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnGroup","FOnGroup");
    $r.addProperty("OnFooterPageSelectorChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnFooterPageSelectorChange","FOnFooterPageSelectorChange");
    $r.addProperty("OnFooterFirstPageClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnFooterFirstPageClick","FOnFooterFirstPageClick");
    $r.addProperty("OnFooterPreviousPageClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnFooterPreviousPageClick","FOnFooterPreviousPageClick");
    $r.addProperty("OnFooterNextPageClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnFooterNextPageClick","FOnFooterNextPageClick");
    $r.addProperty("OnFooterLastPageClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnFooterLastPageClick","FOnFooterLastPageClick");
    $r.addProperty("OnHScroll",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridScrollEvent"],"GetOnHScroll","SetOnHScroll");
    $r.addProperty("OnInsertColumn",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridInsertColumnEvent"],"GetOnInsertColumn","SetOnInsertColumn");
    $r.addProperty("OnInsertRow",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridInsertRowEvent"],"GetOnInsertRow","SetOnInsertRow");
    $r.addProperty("OnLoadCellData",3,pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataCellDataEvent"],"GetOnLoadCellData","SetOnLoadCellData");
    $r.addProperty("OnLogMessage",3,pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridLogMessageEvent"],"GetOnLogMessage","SetOnLogMessage");
    $r.addProperty("OnNeedFilterDropDownData",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridNeedFilterDropDownData"],"GetOnNeedFilterDropDownData","SetOnNeedFilterDropDownData");
    $r.addProperty("OnRemoveFilter",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridRemoveFilterEvent"],"GetOnRemoveFilter","SetOnRemoveFilter");
    $r.addProperty("OnRemoveAdvancedFilter",3,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"GetOnRemoveAdvancedFilter","SetOnRemoveAdvancedFilter");
    $r.addProperty("OnRowCollapse",3,pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataRowCollapseEvent"],"GetOnRowCollapse","SetOnRowCollapse");
    $r.addProperty("OnRowDropped",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridRowDroppedEvent"],"GetOnRowDropped","SetOnRowDropped");
    $r.addProperty("OnRowExpand",3,pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataRowExpandEvent"],"GetOnRowExpand","SetOnRowExpand");
    $r.addProperty("OnRowSized",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridRowSizedEvent"],"GetOnRowSized","SetOnRowSized");
    $r.addProperty("OnSaveCellData",3,pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataCellDataEvent"],"GetOnSaveCellData","SetOnSaveCellData");
    $r.addProperty("OnSelectCell",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridSelectCellEvent"],"GetOnSelectCell","SetOnSelectCell");
    $r.addProperty("OnSelectingCell",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridSelectingCellEvent"],"GetOnSelectingCell","SetOnSelectingCell");
    $r.addProperty("OnSizeColumn",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridSizeColumnEvent"],"GetOnSizeColumn","SetOnSizeColumn");
    $r.addProperty("OnSizeRow",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridSizeRowEvent"],"GetOnSizeRow","SetOnSizeRow");
    $r.addProperty("OnUngroup",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnUngroup","FOnUngroup");
    $r.addProperty("OnVScroll",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridScrollEvent"],"GetOnVScroll","SetOnVScroll");
    $r.addProperty("Options",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridOptions"],"GetOptions","SetOptions");
    $r.addProperty("Paging",3,rtl.boolean,"GetPaging","SetPaging",4,{Default: false});
    $r.addProperty("RootPersistence",0,rtl.longint,"FRootPersistence","FRootPersistence",4,{Default: 0});
    $r.addProperty("RowCount",3,rtl.longint,"GetRowCount","SetRowCount",4,{Default: 24});
    $r.addProperty("RowViewMode",3,pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridRowViewMode"],"GetRowViewMode","SetRowViewMode",4,{Default: pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowViewMode.grvmTotalRows});
    $r.addProperty("ScrollMode",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridScrollMode"],"GetScrollMode","SetScrollMode",4,{Default: pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridScrollMode.gsmPixelScrolling});
    $r.addProperty("ScrollUpdate",3,pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridScrollUpdate"],"GetScrollUpdate","SetScrollUpdate",4,{Default: pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridScrollUpdate.gsuContinuous});
    $r.addProperty("StretchScrollBars",3,rtl.boolean,"GetStretchScrollBars","SetStretchScrollBars",4,{Default: false});
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
    $r.addProperty("Version",1,rtl.string,"GetVersion","");
    $r.addProperty("VerticalScrollBarVisible",3,rtl.boolean,"GetVerticalScrollBarVisible","SetVerticalScrollBarVisible",4,{Default: true});
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
  $mod.$implcode = function () {
    rtl.createClass($impl,"TTMSFNCDataGridRendererOpen",pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridRenderer,function () {
      rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
      rtl.addIntf(this,pas["WEBLib.TMSFNCGraphicsTypes"].ITMSFNCAppearanceGlobalFont);
      rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
      rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
      rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderGrid,{ClearData: "DataClearData"});
      rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCCustomReadWriteIO);
      rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
      rtl.addIntf(this,pas.System.IUnknown);
    });
    rtl.createClass($impl,"TTMSFNCHTMLTextOpen",pas["WEBLib.TMSFNCHTMLText"].TTMSFNCHTMLText,function () {
      rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
      rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
      rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
      rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
      rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
      rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
      rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
      rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
      rtl.addIntf(this,pas.System.IUnknown);
    });
    $impl.DefaultPageInfoFormat = "Page %d of %d";
    $impl.DefaultPageSelectorFormat = "Page %d";
  };
},["DateUtils","Variants","Math","WEBLib.Dialogs","WEBLib.TMSFNCImage","WEBLib.TMSFNCUtils","WEBLib.TMSFNCStyles"]);
rtl.module("WEBLib.TMSFNCDataGridColumnsEditor",["System","Classes","Types","UITypes","WEBLib.Forms","WEBLib.TMSFNCTypes","WEBLib.TMSFNCCustomDialog","WEBLib.TMSFNCEditorPanel","WEBLib.TMSFNCTreeViewData","WEBLib.TMSFNCEditorButton","WEBLib.TMSFNCCheckedListBox","WEBLib.TMSFNCDataGridRenderer"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  rtl.createClass(this,"TTMSFNCDataGridColumnsEditorUILanguage",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FClose = "";
      this.FOnInternalChanged = null;
    };
    this.$final = function () {
      this.FOnInternalChanged = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.IsCloseStored = function () {
      var Result = false;
      Result = this.FClose !== rtl.getResStr($mod,"sTMSFNCDataGridColumnsEditorUILanguageClose");
      return Result;
    };
    this.DoChanged = function () {
      if (this.FOnInternalChanged != null) this.FOnInternalChanged(this);
    };
    this.Create$1 = function () {
      this.FClose = rtl.getResStr($mod,"sTMSFNCDataGridColumnsEditorUILanguageClose");
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridColumnsEditorUILanguage.isPrototypeOf(Source)) {
        this.FClose = rtl.as(Source,$mod.TTMSFNCDataGridColumnsEditorUILanguage).FClose;
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    var $r = this.$rtti;
    $r.addProperty("Close",12,rtl.string,"FClose","FClose",4,{stored: "IsCloseStored"});
  });
  this.TTMSFNCDataGridColumnsEditorMode = {"0": "gcemVisibleOnly", gcemVisibleOnly: 0, "1": "gcemAll", gcemAll: 1};
  this.$rtti.$Enum("TTMSFNCDataGridColumnsEditorMode",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCDataGridColumnsEditorMode});
  rtl.createClass(this,"TTMSFNCDataGridColumnsEditorOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FOwner = null;
      this.FUILanguage = null;
      this.FMode = 0;
      this.FEnableDragDrop = false;
    };
    this.$final = function () {
      this.FOwner = undefined;
      this.FUILanguage = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetUILanguage = function (Value) {
      this.FUILanguage.Assign(Value);
    };
    this.SetEnableDragDrop = function (Value) {
      var ce = null;
      if (this.FEnableDragDrop !== Value) {
        this.FEnableDragDrop = Value;
        if ((this.FOwner != null) && $mod.TTMSFNCCustomDataGridColumnsEditor.isPrototypeOf(this.FOwner)) {
          ce = rtl.as(this.FOwner,$mod.TTMSFNCCustomDataGridColumnsEditor);
          if (ce.FListBox != null) {
            if (this.FEnableDragDrop) {
              ce.FListBox.FInteraction.SetDragDropMode(pas["WEBLib.TMSFNCListBox"].TTMSFNCListBoxDragDropMode.ldmMove)}
             else ce.FListBox.FInteraction.SetDragDropMode(pas["WEBLib.TMSFNCListBox"].TTMSFNCListBoxDragDropMode.ldmNone);
          };
          ce.UpdateList();
        };
      };
    };
    this.SetMode = function (Value) {
      var ce = null;
      if (this.FMode !== Value) {
        this.FMode = Value;
        if ((this.FOwner != null) && $mod.TTMSFNCCustomDataGridColumnsEditor.isPrototypeOf(this.FOwner)) {
          ce = rtl.as(this.FOwner,$mod.TTMSFNCCustomDataGridColumnsEditor);
          ce.UpdateList();
        };
      };
    };
    this.Create$1 = function (AOwner) {
      pas.System.TObject.Create.call(this);
      this.FOwner = AOwner;
      this.FUILanguage = $mod.TTMSFNCDataGridColumnsEditorUILanguage.$create("Create$1");
      this.FMode = $mod.TTMSFNCDataGridColumnsEditorMode.gcemVisibleOnly;
      this.FEnableDragDrop = true;
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FUILanguage");
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridColumnsEditorOptions.isPrototypeOf(Source)) {
        this.FUILanguage.Assign(rtl.as(Source,$mod.TTMSFNCDataGridColumnsEditorOptions).FUILanguage);
        this.FMode = rtl.as(Source,$mod.TTMSFNCDataGridColumnsEditorOptions).FMode;
        this.FEnableDragDrop = rtl.as(Source,$mod.TTMSFNCDataGridColumnsEditorOptions).FEnableDragDrop;
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    var $r = this.$rtti;
    $r.addProperty("UILanguage",2,$mod.$rtti["TTMSFNCDataGridColumnsEditorUILanguage"],"FUILanguage","SetUILanguage");
    $r.addProperty("Mode",2,$mod.$rtti["TTMSFNCDataGridColumnsEditorMode"],"FMode","SetMode",4,{Default: $mod.TTMSFNCDataGridColumnsEditorMode.gcemVisibleOnly});
    $r.addProperty("EnableDragDrop",2,rtl.boolean,"FEnableDragDrop","SetEnableDragDrop",4,{Default: true});
  });
  rtl.createClass(this,"TTMSFNCCustomDataGridColumnsEditor",pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog.$init.call(this);
      this.FPanel = null;
      this.FBottomPanel = null;
      this.FButtonClose = null;
      this.FListBox = null;
      this.FModified = false;
      this.FOptions = null;
      this.FRenderer = null;
    };
    this.$final = function () {
      this.FPanel = undefined;
      this.FBottomPanel = undefined;
      this.FButtonClose = undefined;
      this.FListBox = undefined;
      this.FOptions = undefined;
      this.FRenderer = undefined;
      pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog.$final.call(this);
    };
    this.SetOptions = function (Value) {
      this.FOptions.Assign(Value);
    };
    this.SetRenderer = function (Value) {
      this.FRenderer = Value;
      if (this.FRenderer != null) this.FRenderer.FOnNotifyEditor = rtl.createCallback(this,"DoNotifyEditor");
    };
    this.GetInstance = function () {
      var Result = 0;
      Result = pas["WEBLib.TMSFNCTypes"].HInstance();
      return Result;
    };
    this.DoNotifyEditor = function (Sender) {
      this.UpdateList();
    };
    this.DoButtonCloseClick = function (Sender) {
      var cl = false;
      cl = true;
      if (cl) {
        this.FFrm.SetModalResult(8);
        this.FFrm.Close();
      };
    };
    this.DoListBoxGetNodeData = function (Sender, ANode) {
      var it = null;
      it = this.FListBox.GetItemForNode(ANode);
      if (it != null) {
        ANode.FDataInteger = it.FDataInteger;
        ANode.FDataString = it.FDataString;
      };
    };
    this.DoListBoxItemCheckChanged = function (Sender, AItem) {
      if (this.FRenderer != null) {
        if (AItem.FChecked) {
          this.FRenderer.UnhideColumn(AItem.FDataInteger)}
         else this.FRenderer.HideColumn(AItem.FDataInteger);
      };
    };
    this.DoListBoxGetNodeCheckType = function (Sender, ANode, AColumn, ACheckType) {
      if (this.FOptions.FMode === $mod.TTMSFNCDataGridColumnsEditorMode.gcemAll) {
        ACheckType.set(pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeCheckType.tvntCheckBox)}
       else ACheckType.set(pas["WEBLib.TMSFNCTreeViewData"].TTMSFNCTreeViewNodeCheckType.tvntNone);
    };
    this.DoListBoxDragOver = function (Sender, Source, Point, Accept) {
      var r = null;
      var rl = null;
      try {
        if (pas.SysUtils.Supports$3(Source,pas["WEBLib.TMSFNCDataGridRenderer"].ITMSFNCDataGridRendererLink.$guid,{get: function () {
            return rl;
          }, set: function (v) {
            rl = v;
          }})) {
          r = rl.GetLink();
          if (r != null) Accept.set(r.FDraggingMode === pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridDraggingMode.gdmColumnDragging);
        };
      } finally {
        rtl._Release(rl);
      };
    };
    this.DoListBoxDragDrop = function (Sender, Source, Point) {
      var r = null;
      var rl = null;
      try {
        if (pas.SysUtils.Supports$3(Source,pas["WEBLib.TMSFNCDataGridRenderer"].ITMSFNCDataGridRendererLink.$guid,{get: function () {
            return rl;
          }, set: function (v) {
            rl = v;
          }})) {
          r = rl.GetLink();
          if (r != null) {
            r.HideDragCell();
            r.ResetDrag();
          };
          this.UpdateList();
        };
      } finally {
        rtl._Release(rl);
      };
    };
    this.BuildDialog = function (AParent) {
      pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog.BuildDialog.apply(this,arguments);
      if (pas["WEBLib.Forms"].TCustomForm.isPrototypeOf(AParent)) {
        AParent.SetFormStyle(pas["WEBLib.Forms"].TFormStyle.fsStayOnTop);
      };
      this.FPanel = pas["WEBLib.TMSFNCEditorPanel"].TTMSFNCEditorPanel.$create("Create$1",[AParent]);
      this.FPanel.SetPanelPosition(pas["WEBLib.TMSFNCEditorPanel"].TTMSFNCEditorPanelPosition.eppCenter);
      this.FPanel.SetAlign(pas["WEBLib.Controls"].TAlign.alClient);
      this.FPanel.SetParent(AParent);
      pas["WEBLib.TMSFNCEditorsTools"].SetEditorSubPanelAppearance(this.FPanel,-1,-1,0);
      this.FListBox = pas["WEBLib.TMSFNCCheckedListBox"].TTMSFNCCheckedListBox.$create("Create$1",[AParent]);
      this.FListBox.SetControlAlignment(pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlAlignment.caClient);
      this.FListBox.SetParent(AParent);
      this.FListBox.FOnItemCheckChanged = rtl.createCallback(this,"DoListBoxItemCheckChanged");
      this.FListBox.FTreeView.FOnGetNodeData = rtl.createCallback(this,"DoListBoxGetNodeData");
      this.FListBox.FTreeView.FOnCustomDragOver = rtl.createCallback(this,"DoListBoxDragOver");
      this.FListBox.FTreeView.FOnCustomDragDrop = rtl.createCallback(this,"DoListBoxDragDrop");
      this.FListBox.FTreeView.FOnGetNodeCheckType = rtl.createCallback(this,"DoListBoxGetNodeCheckType");
      this.FListBox.FItemsAppearance.SetHeightMode(pas["WEBLib.TMSFNCListBox"].TTMSFNCListBoxItemHeightMode.lihmVariable);
      if (this.FOptions.FEnableDragDrop) {
        this.FListBox.FInteraction.SetDragDropMode(pas["WEBLib.TMSFNCListBox"].TTMSFNCListBoxDragDropMode.ldmMove)}
       else this.FListBox.FInteraction.SetDragDropMode(pas["WEBLib.TMSFNCListBox"].TTMSFNCListBoxDragDropMode.ldmNone);
      this.FBottomPanel = pas["WEBLib.TMSFNCEditorPanel"].TTMSFNCEditorPanel.$create("Create$1",[AParent]);
      this.FBottomPanel.SetPanelPosition(pas["WEBLib.TMSFNCEditorPanel"].TTMSFNCEditorPanelPosition.eppCenter);
      this.FBottomPanel.SetAlign(pas["WEBLib.Controls"].TAlign.alBottom);
      this.FBottomPanel.SetParent(AParent);
      this.FBottomPanel.SetHeight(37);
      pas["WEBLib.TMSFNCEditorsTools"].SetEditorBackPanelAppearance(this.FBottomPanel,-1,-1,5);
      this.FButtonClose = pas["WEBLib.TMSFNCEditorButton"].TTMSFNCEditorButton.$create("Create$1",[this.FBottomPanel]);
      this.FButtonClose.FModalResult = 8;
      this.FButtonClose.SetParent(this.FBottomPanel);
      this.FButtonClose.SetText(this.FOptions.FUILanguage.FClose);
      this.FButtonClose.SetAlign(pas["WEBLib.Controls"].TAlign.alRight);
      this.FButtonClose.SetLeft(99);
      this.FButtonClose.SetAlignWithMargins(true);
      this.FButtonClose.FMargins.SetRight(5);
      this.FButtonClose.FMargins.SetTop(5);
      this.FButtonClose.FMargins.SetBottom(5);
      this.FButtonClose.FMargins.SetLeft(5);
      this.FButtonClose.FOnClick = rtl.createCallback(this,"DoButtonCloseClick");
      pas["WEBLib.TMSFNCEditorsTools"].SetEditorCancelButtonAppearance(this.FButtonClose,12482304,5,-1,-1);
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog.Create$1.apply(this,arguments);
      this.FDestroyForm = false;
      this.SetCaption("Columns Editor");
      this.SetDialogWidth(250);
      this.SetDialogHeight(400);
      this.FSizeable = true;
      this.FOptions = $mod.TTMSFNCDataGridColumnsEditorOptions.$create("Create$1",[this]);
      this.FAllowReturnKeyClose = false;
      this.FModified = false;
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FOptions");
      pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog.Destroy.call(this);
    };
    this.UpdateList = function () {
      var I = 0;
      var it = null;
      if (!(this.FListBox != null)) return;
      this.FListBox.BeginUpdate();
      this.FListBox.FItems.Clear$1();
      if (this.FRenderer != null) {
        for (var $l = 0, $end = this.FRenderer.FColumnCount - 1; $l <= $end; $l++) {
          I = $l;
          if (this.FRenderer.IsColumnHidden(I) || (this.FOptions.FMode === $mod.TTMSFNCDataGridColumnsEditorMode.gcemAll)) {
            it = this.FListBox.FItems.Add$1();
            it.FDataInteger = I;
            it.FDataString = "columns_editor";
            it.SetText(this.FRenderer.FColumns.GetItem$1(I).GetDisplayName() + '<BR><font color="gcSilver">Index: ' + pas.SysUtils.IntToStr(this.FRenderer.GetColumnOrder(I)) + "</font>");
            it.SetChecked(this.FRenderer.IsColumnDisplayed(I));
          };
        };
      };
      this.FListBox.EndUpdate();
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCCustomDataGridColumnsEditor.isPrototypeOf(Source)) {
        this.FOptions.Assign(rtl.as(Source,$mod.TTMSFNCCustomDataGridColumnsEditor).FOptions)}
       else pas["WEBLib.Controls"].TControl.Assign.apply(this,arguments);
      this.FModified = true;
    };
    this.Execute = function (AProc, AModal) {
      if (!(this.FRenderer != null)) {
        AProc(3);
        return;
      };
      pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog.Execute.apply(this,arguments);
      this.UpdateList();
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCDataGridColumnsEditor",this.TTMSFNCCustomDataGridColumnsEditor,function () {
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Options",2,$mod.$rtti["TTMSFNCDataGridColumnsEditorOptions"],"FOptions","SetOptions");
    $r.addProperty("OnClose",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClose","FOnClose");
    $r.attr = [pas.Classes.ComponentPlatformsAttribute,"Create$1",[0]];
  });
  $mod.$resourcestrings = {sTMSFNCDataGridColumnsEditorUILanguageClose: {org: "Close"}};
  $mod.$implcode = function () {
    rtl.createClass($impl,"TTMSFNCCustomDialogEx",pas["WEBLib.TMSFNCCustomDialog"].TTMSFNCCustomDialog,function () {
      rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
      rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
      rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
      rtl.addIntf(this,pas.System.IUnknown);
    });
    rtl.createClass($impl,"TCustomFormOpen",pas["WEBLib.Forms"].TCustomForm,function () {
      rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
      rtl.addIntf(this,pas.System.IUnknown);
    });
    rtl.createClass($impl,"TTMSFNCListBoxOpen",pas["WEBLib.TMSFNCCheckedListBox"].TTMSFNCCheckedListBox,function () {
      rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCStylesManager);
      rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
      rtl.addIntf(this,pas["WEBLib.TMSFNCControlPicker"].ITMSFNCControlPickerFull);
      rtl.addIntf(this,pas["WEBLib.TMSFNCGraphicsTypes"].ITMSFNCAppearanceGlobalFont);
      rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
      rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
      rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
      rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
      rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
      rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
      rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
      rtl.addIntf(this,pas.System.IUnknown);
    });
    rtl.createClass($impl,"TTMSFNCDataGridRendererOpen",pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridRenderer,function () {
      rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
      rtl.addIntf(this,pas["WEBLib.TMSFNCGraphicsTypes"].ITMSFNCAppearanceGlobalFont);
      rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
      rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
      rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderGrid,{ClearData: "DataClearData"});
      rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCCustomReadWriteIO);
      rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
      rtl.addIntf(this,pas.System.IUnknown);
    });
  };
},["WEBLib.TMSFNCDataGrid","WEBLib.TMSFNCCustomControl","Math","SysUtils","WEBLib.Controls","WEBLib.Graphics","WEBLib.TMSFNCListBox","WEBLib.TMSFNCEditorsTools","WEBLib.TMSFNCUtils"]);
rtl.module("WEBLib.TMSFNCDataGridRenderer",["System","Classes","SysUtils","WEBLib.Graphics","WEBLib.TMSFNCDataBinding","WEBLib.TMSFNCHTMLEditor","TMS.TMSFNCFilterBuilder","WEBLib.TMSFNCDataGridCell","WEBLib.TMSFNCColorPicker","WEBLib.TMSFNCDataGridData","WEBLib.TMSFNCDataGridCore","WEBLib.TMSFNCGraphics","WEBLib.TMSFNCGraphicsTypes","Types","WEBLib.StdCtrls","WEBLib.TMSFNCScrollBar","WEBLib.TMSFNCFilterDialog","WEBLib.TMSFNCCustomControl","WEBLib.TMSFNCToolBar","WEBLib.TMSFNCCheckedListBox","WEBLib.TMSFNCListBox","WEBLib.TMSFNCPopup","WEBLib.TMSFNCTypes","Generics.Collections","Generics.Defaults","WEBLib.TMSFNCBitmapContainer","WEBLib.TMSFNCImage","WEBLib.Controls","WEBLib.ExtCtrls","WEBLib.TMSFNCEdit","WEBLib.TMSFNCFindDialog","WEBLib.TMSFNCReplaceDialog","WEBLib.Menus","WEBLib.TMSFNCStyles"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  rtl.createClass(this,"TTMSFNCDataGridCellList",pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCDataGridCell,function () {
    this.GetItemForCell = function (ACell) {
      var Result = null;
      var it = null;
      var I = 0;
      Result = null;
      for (var $l = 0, $end = this.FLength - 1; $l <= $end; $l++) {
        I = $l;
        it = this.GetItem(I);
        if ((it.FColumn === ACell.GetColumn()) && (it.FRow === ACell.GetRow())) {
          Result = it;
          break;
        };
      };
      return Result;
    };
  });
  rtl.createClass(this,"TTMSFNCDataGridDisplayList",pas["Generics.Collections"].TList$$$G$$generics$collections$$TTMSFNCDataGridCell,function () {
    this.GetItemForCell = function (ACell) {
      var Result = null;
      var it = null;
      var I = 0;
      Result = null;
      for (var $l = 0, $end = this.FLength - 1; $l <= $end; $l++) {
        I = $l;
        it = this.GetItem(I);
        if ((it.FColumn === ACell.GetColumn()) && (it.FRow === ACell.GetRow())) {
          Result = it;
          break;
        };
      };
      return Result;
    };
  });
  rtl.createClass(this,"TTMSFNCDataGridFixedColumnCellDisplayList",this.TTMSFNCDataGridDisplayList,function () {
  });
  rtl.createClass(this,"TTMSFNCDataGridFixedColumnCellList",this.TTMSFNCDataGridCellList,function () {
  });
  rtl.createClass(this,"TTMSFNCDataGridFixedRootCellDisplayList",this.TTMSFNCDataGridDisplayList,function () {
  });
  rtl.createClass(this,"TTMSFNCDataGridFixedRootCellList",this.TTMSFNCDataGridCellList,function () {
  });
  rtl.createClass(this,"TTMSFNCDataGridFixedRowCellDisplayList",this.TTMSFNCDataGridDisplayList,function () {
  });
  rtl.createClass(this,"TTMSFNCDataGridFixedRowCellList",this.TTMSFNCDataGridCellList,function () {
  });
  rtl.createClass(this,"TTMSFNCDataGridNormalCellDisplayList",this.TTMSFNCDataGridDisplayList,function () {
  });
  rtl.createClass(this,"TTMSFNCDataGridNormalCellList",this.TTMSFNCDataGridCellList,function () {
  });
  rtl.createClass(this,"TTMSFNCDataGridSelectedCellDictionary",pas["Generics.Collections"].TDictionary$$$G$$generics$collections$$TTMSFNCDataGridCellCoord$$Boolean,function () {
  });
  rtl.createClass(this,"TTMSFNCDataGridFilterAppearance",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FFill = null;
      this.FStroke = null;
      this.FFont = null;
    };
    this.$final = function () {
      this.FFill = undefined;
      this.FStroke = undefined;
      this.FFont = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetFill = function (Value) {
      this.FFill.Assign(Value);
      this.DoFillChanged(this.FFill);
    };
    this.SetStroke = function (Value) {
      this.FStroke.Assign(Value);
    };
    this.SetFont = function (Value) {
      this.FFont.Assign(Value);
      this.DoFontChanged(this.FFont);
    };
    this.DoChange = function (Sender) {
    };
    this.DoFillChanged = function (Sender) {
      this.DoChange(this);
    };
    this.DoFontChanged = function (Sender) {
      this.DoChange(this);
    };
    this.DoStrokeChanged = function (Sender) {
      this.DoChange(this);
    };
    this.Create$1 = function () {
      this.FFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,16777215,8421504,-1,-1]);
      this.FFill.FOnChanged = rtl.createCallback(this,"DoFillChanged");
      this.FStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,12632256,1.0]);
      this.FStroke.FOnChanged = rtl.createCallback(this,"DoStrokeChanged");
      this.FFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FFont.FOnChanged = rtl.createCallback(this,"DoFontChanged");
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridFilterAppearance.isPrototypeOf(Source)) {
        this.FFill.Assign(rtl.as(Source,$mod.TTMSFNCDataGridFilterAppearance).FFill);
        this.FStroke.Assign(rtl.as(Source,$mod.TTMSFNCDataGridFilterAppearance).FStroke);
        this.FFont.Assign(rtl.as(Source,$mod.TTMSFNCDataGridFilterAppearance).FFont);
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    this.Destroy = function () {
      rtl.free(this,"FFont");
      rtl.free(this,"FStroke");
      rtl.free(this,"FFill");
      pas.System.TObject.Destroy.call(this);
    };
    var $r = this.$rtti;
    $r.addProperty("Fill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFill","SetFill");
    $r.addProperty("Font",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FFont","SetFont");
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
  });
  rtl.createClass(this,"TTMSFNCDataGridDragAppearance",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FFill = null;
      this.FStroke = null;
      this.FSize = 0.0;
    };
    this.$final = function () {
      this.FFill = undefined;
      this.FStroke = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetFill = function (Value) {
      this.FFill.Assign(Value);
      this.DoFillChanged(this.FFill);
    };
    this.SetStroke = function (Value) {
      this.FStroke.Assign(Value);
    };
    this.SetSize = function (Value) {
      if (this.FSize !== Value) {
        this.FSize = Value;
        this.DoChange(this);
      };
    };
    this.IsSizeStored = function () {
      var Result = false;
      Result = this.FSize !== 12;
      return Result;
    };
    this.DoChange = function (Sender) {
    };
    this.DoFillChanged = function (Sender) {
      this.DoChange(this);
    };
    this.DoStrokeChanged = function (Sender) {
      this.DoChange(this);
    };
    this.Create$1 = function () {
      this.FFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(11829830,30),8421504,-1,-1]);
      this.FFill.FOnChanged = rtl.createCallback(this,"DoFillChanged");
      this.FStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(11829830,30),1.0]);
      this.FStroke.FOnChanged = rtl.createCallback(this,"DoStrokeChanged");
      this.FSize = 12;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridDragAppearance.isPrototypeOf(Source)) {
        this.FFill.Assign(rtl.as(Source,$mod.TTMSFNCDataGridDragAppearance).FFill);
        this.FStroke.Assign(rtl.as(Source,$mod.TTMSFNCDataGridDragAppearance).FStroke);
        this.FSize = rtl.as(Source,$mod.TTMSFNCDataGridDragAppearance).FSize;
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    this.Destroy = function () {
      rtl.free(this,"FStroke");
      rtl.free(this,"FFill");
      pas.System.TObject.Destroy.call(this);
    };
    var $r = this.$rtti;
    $r.addProperty("Fill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFill","SetFill");
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
    $r.addProperty("Size",14,rtl.double,"FSize","SetSize",4,{stored: "IsSizeStored"});
  });
  rtl.createClass(this,"TTMSFNCDataGridAutoFillAppearance",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FHandleFill = null;
      this.FHandleStroke = null;
      this.FHandleSize = 0.0;
      this.FPreviewFill = null;
      this.FPreviewStroke = null;
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FHandleFill = undefined;
      this.FHandleStroke = undefined;
      this.FPreviewFill = undefined;
      this.FPreviewStroke = undefined;
      this.FOnChange = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetHandleFill = function (Value) {
      this.FHandleFill.Assign(Value);
      this.DoFillChanged(this.FHandleFill);
    };
    this.SetHandleStroke = function (Value) {
      this.FHandleStroke.Assign(Value);
      this.DoStrokeChanged(this.FHandleStroke);
    };
    this.SetHandleSize = function (Value) {
      if (this.FHandleSize !== Value) {
        this.FHandleSize = Value;
        this.DoChange(this);
      };
    };
    this.SetPreviewFill = function (Value) {
      this.FPreviewFill.Assign(Value);
      this.DoFillChanged(this.FPreviewFill);
    };
    this.SetPreviewStroke = function (Value) {
      this.FPreviewStroke.Assign(Value);
      this.DoStrokeChanged(this.FPreviewStroke);
    };
    this.IsHandleSizeStored = function () {
      var Result = false;
      Result = this.FHandleSize !== 6;
      return Result;
    };
    this.DoChange = function (Sender) {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.DoFillChanged = function (Sender) {
      this.DoChange(this);
    };
    this.DoStrokeChanged = function (Sender) {
      this.DoChange(this);
    };
    this.Create$1 = function () {
      this.FHandleFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,11829830,8421504,-1,-1]);
      this.FHandleFill.FOnChanged = rtl.createCallback(this,"DoFillChanged");
      this.FHandleStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,11829830,1.0]);
      this.FHandleStroke.FOnChanged = rtl.createCallback(this,"DoStrokeChanged");
      this.FHandleSize = 6;
      this.FPreviewFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone,-1,8421504,-1,-1]);
      this.FPreviewFill.FOnChanged = rtl.createCallback(this,"DoFillChanged");
      this.FPreviewStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskDash,11829830,1.5]);
      this.FPreviewStroke.FOnChanged = rtl.createCallback(this,"DoStrokeChanged");
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridAutoFillAppearance.isPrototypeOf(Source)) {
        this.FHandleFill.Assign(rtl.as(Source,$mod.TTMSFNCDataGridAutoFillAppearance).FHandleFill);
        this.FHandleStroke.Assign(rtl.as(Source,$mod.TTMSFNCDataGridAutoFillAppearance).FHandleStroke);
        this.FHandleSize = rtl.as(Source,$mod.TTMSFNCDataGridAutoFillAppearance).FHandleSize;
        this.FPreviewFill.Assign(rtl.as(Source,$mod.TTMSFNCDataGridAutoFillAppearance).FPreviewFill);
        this.FPreviewStroke.Assign(rtl.as(Source,$mod.TTMSFNCDataGridAutoFillAppearance).FPreviewStroke);
      } else pas.Classes.TPersistent.Assign.apply(this,arguments);
    };
    this.Destroy = function () {
      rtl.free(this,"FPreviewStroke");
      rtl.free(this,"FPreviewFill");
      rtl.free(this,"FHandleStroke");
      rtl.free(this,"FHandleFill");
      pas.System.TObject.Destroy.call(this);
    };
    var $r = this.$rtti;
    $r.addProperty("HandleFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FHandleFill","SetHandleFill");
    $r.addProperty("HandleStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FHandleStroke","SetHandleStroke");
    $r.addProperty("HandleSize",14,rtl.double,"FHandleSize","SetHandleSize",4,{stored: "IsHandleSizeStored"});
    $r.addProperty("PreviewFill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FPreviewFill","SetPreviewFill");
    $r.addProperty("PreviewStroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FPreviewStroke","SetPreviewStroke");
  });
  rtl.createClass(this,"TTMSFNCDataGridCellAppearance",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FBandLayout = null;
      this.FFilterInverseMatchLayout = null;
      this.FFilterMatchLayout = null;
      this.FFixedLayout = null;
      this.FFixedSelectedLayout = null;
      this.FFocusedLayout = null;
      this.FGroupLayout = null;
      this.FNormalLayout = null;
      this.FOnChange = null;
      this.FSelectedLayout = null;
      this.FShowFocus = false;
      this.FSummaryLayout = null;
    };
    this.$final = function () {
      this.FBandLayout = undefined;
      this.FFilterInverseMatchLayout = undefined;
      this.FFilterMatchLayout = undefined;
      this.FFixedLayout = undefined;
      this.FFixedSelectedLayout = undefined;
      this.FFocusedLayout = undefined;
      this.FGroupLayout = undefined;
      this.FNormalLayout = undefined;
      this.FOnChange = undefined;
      this.FSelectedLayout = undefined;
      this.FSummaryLayout = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetBandLayout = function (Value) {
      this.FBandLayout.Assign(Value);
    };
    this.SetFilterMatchLayout = function (Value) {
      this.FFilterMatchLayout.Assign(Value);
    };
    this.SetFilterInverseMatchLayout = function (Value) {
      this.FFilterInverseMatchLayout.Assign(Value);
    };
    this.SetFixedLayout = function (Value) {
      this.FFixedLayout.Assign(Value);
    };
    this.SetFixedSelectedLayout = function (Value) {
      this.FFixedSelectedLayout.Assign(Value);
    };
    this.SetFocusedLayout = function (Value) {
      this.FFocusedLayout.Assign(Value);
    };
    this.SetGroupLayout = function (Value) {
      this.FGroupLayout.Assign(Value);
    };
    this.SetNormalLayout = function (Value) {
      this.FNormalLayout.Assign(Value);
    };
    this.SetSelectedLayout = function (Value) {
      this.FSelectedLayout.Assign(Value);
    };
    this.SetShowFocus = function (Value) {
      if (this.FShowFocus !== Value) {
        this.FShowFocus = Value;
        this.LayoutChanged(this);
      };
    };
    this.SetSummaryLayout = function (Value) {
      this.FSummaryLayout.Assign(Value);
    };
    this.LayoutChanged = function (Sender) {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Create$1 = function () {
      this.FFilterMatchLayout = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellLayout.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(193,232,153)]);
      this.FFilterInverseMatchLayout = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellLayout.$create("Create$1",[16777215]);
      this.FBandLayout = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellLayout.$create("Create$1",[14745599]);
      this.FFixedLayout = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellLayout.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(238,238,238),10)]);
      this.FNormalLayout = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellLayout.$create("Create$1",[16777215]);
      this.FGroupLayout = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellLayout.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(238,238,238),10)]);
      this.FSummaryLayout = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellLayout.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(245,245,230),10)]);
      this.FSelectedLayout = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellLayout.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(14599344,80)]);
      this.FFocusedLayout = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellLayout.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(14599344,40)]);
      this.FFixedSelectedLayout = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellLayout.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(14599344,80)]);
      this.FShowFocus = true;
      this.FFilterMatchLayout.FOnChange = rtl.createCallback(this,"LayoutChanged");
      this.FFilterInverseMatchLayout.FOnChange = rtl.createCallback(this,"LayoutChanged");
      this.FBandLayout.FOnChange = rtl.createCallback(this,"LayoutChanged");
      this.FFixedLayout.FOnChange = rtl.createCallback(this,"LayoutChanged");
      this.FNormalLayout.FOnChange = rtl.createCallback(this,"LayoutChanged");
      this.FGroupLayout.FOnChange = rtl.createCallback(this,"LayoutChanged");
      this.FSummaryLayout.FOnChange = rtl.createCallback(this,"LayoutChanged");
      this.FSelectedLayout.FOnChange = rtl.createCallback(this,"LayoutChanged");
      this.FFocusedLayout.FOnChange = rtl.createCallback(this,"LayoutChanged");
      this.FFixedSelectedLayout.FOnChange = rtl.createCallback(this,"LayoutChanged");
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridCellAppearance.isPrototypeOf(Source)) {
        this.FBandLayout.Assign(rtl.as(Source,$mod.TTMSFNCDataGridCellAppearance).FBandLayout);
        this.FFilterInverseMatchLayout.Assign(rtl.as(Source,$mod.TTMSFNCDataGridCellAppearance).FFilterInverseMatchLayout);
        this.FFilterMatchLayout.Assign(rtl.as(Source,$mod.TTMSFNCDataGridCellAppearance).FFilterMatchLayout);
        this.FFixedSelectedLayout.Assign(rtl.as(Source,$mod.TTMSFNCDataGridCellAppearance).FFixedSelectedLayout);
        this.FFixedLayout.Assign(rtl.as(Source,$mod.TTMSFNCDataGridCellAppearance).FFixedLayout);
        this.FNormalLayout.Assign(rtl.as(Source,$mod.TTMSFNCDataGridCellAppearance).FNormalLayout);
        this.FGroupLayout.Assign(rtl.as(Source,$mod.TTMSFNCDataGridCellAppearance).FGroupLayout);
        this.FSummaryLayout.Assign(rtl.as(Source,$mod.TTMSFNCDataGridCellAppearance).FSummaryLayout);
        this.FSelectedLayout.Assign(rtl.as(Source,$mod.TTMSFNCDataGridCellAppearance).FSelectedLayout);
        this.FFocusedLayout.Assign(rtl.as(Source,$mod.TTMSFNCDataGridCellAppearance).FFocusedLayout);
        this.FShowFocus = rtl.as(Source,$mod.TTMSFNCDataGridCellAppearance).FShowFocus;
      };
    };
    this.Destroy = function () {
      rtl.free(this,"FFilterInverseMatchLayout");
      rtl.free(this,"FFilterMatchLayout");
      rtl.free(this,"FBandLayout");
      rtl.free(this,"FFixedLayout");
      rtl.free(this,"FNormalLayout");
      rtl.free(this,"FGroupLayout");
      rtl.free(this,"FSummaryLayout");
      rtl.free(this,"FSelectedLayout");
      rtl.free(this,"FFocusedLayout");
      rtl.free(this,"FFixedSelectedLayout");
      pas.System.TObject.Destroy.call(this);
    };
    var $r = this.$rtti;
    $r.addProperty("FilterMatchLayout",2,pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCellLayout"],"FFilterMatchLayout","SetFilterMatchLayout");
    $r.addProperty("FilterInverseMatchLayout",2,pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCellLayout"],"FFilterInverseMatchLayout","SetFilterInverseMatchLayout");
    $r.addProperty("BandLayout",2,pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCellLayout"],"FBandLayout","SetBandLayout");
    $r.addProperty("FixedLayout",2,pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCellLayout"],"FFixedLayout","SetFixedLayout");
    $r.addProperty("FixedSelectedLayout",2,pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCellLayout"],"FFixedSelectedLayout","SetFixedSelectedLayout");
    $r.addProperty("FocusedLayout",2,pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCellLayout"],"FFocusedLayout","SetFocusedLayout");
    $r.addProperty("GroupLayout",2,pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCellLayout"],"FGroupLayout","SetGroupLayout");
    $r.addProperty("NormalLayout",2,pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCellLayout"],"FNormalLayout","SetNormalLayout");
    $r.addProperty("SelectedLayout",2,pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCellLayout"],"FSelectedLayout","SetSelectedLayout");
    $r.addProperty("ShowFocus",2,rtl.boolean,"FShowFocus","SetShowFocus",4,{Default: true});
    $r.addProperty("SummaryLayout",2,pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCellLayout"],"FSummaryLayout","SetSummaryLayout");
  });
  rtl.createClass(this,"TTMSFNCDataGridIcons",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FOnChange = null;
      this.FExpandIcon = null;
      this.FCollapseIcon = null;
      this.FFilterIcon = null;
      this.FFilterActiveIcon = null;
      this.FFilterTypeIcon = null;
      this.FSortDescendingIcon = null;
      this.FSortAscendingIcon = null;
      this.FFilterClearIcon = null;
      this.FCloseIcon = null;
      this.FPreviousPageIcon = null;
      this.FFirstPageIcon = null;
      this.FNextPageIcon = null;
      this.FLastPageIcon = null;
      this.FDefaultExpandIcon = null;
      this.FDefaultCollapseIcon = null;
      this.FDefaultFilterIcon = null;
      this.FDefaultFilterActiveIcon = null;
      this.FDefaultFilterTypeIcon = null;
      this.FDefaultSortDescendingIcon = null;
      this.FDefaultSortAscendingIcon = null;
      this.FDefaultFilterClearIcon = null;
      this.FDefaultCloseIcon = null;
      this.FDefaultPreviousPageIcon = null;
      this.FDefaultFirstPageIcon = null;
      this.FDefaultNextPageIcon = null;
      this.FDefaultLastPageIcon = null;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      this.FExpandIcon = undefined;
      this.FCollapseIcon = undefined;
      this.FFilterIcon = undefined;
      this.FFilterActiveIcon = undefined;
      this.FFilterTypeIcon = undefined;
      this.FSortDescendingIcon = undefined;
      this.FSortAscendingIcon = undefined;
      this.FFilterClearIcon = undefined;
      this.FCloseIcon = undefined;
      this.FPreviousPageIcon = undefined;
      this.FFirstPageIcon = undefined;
      this.FNextPageIcon = undefined;
      this.FLastPageIcon = undefined;
      this.FDefaultExpandIcon = undefined;
      this.FDefaultCollapseIcon = undefined;
      this.FDefaultFilterIcon = undefined;
      this.FDefaultFilterActiveIcon = undefined;
      this.FDefaultFilterTypeIcon = undefined;
      this.FDefaultSortDescendingIcon = undefined;
      this.FDefaultSortAscendingIcon = undefined;
      this.FDefaultFilterClearIcon = undefined;
      this.FDefaultCloseIcon = undefined;
      this.FDefaultPreviousPageIcon = undefined;
      this.FDefaultFirstPageIcon = undefined;
      this.FDefaultNextPageIcon = undefined;
      this.FDefaultLastPageIcon = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetCollapseIcon = function (Value) {
      if (this.FCollapseIcon !== Value) this.FCollapseIcon.Assign(Value);
    };
    this.SetExpandIcon = function (Value) {
      if (this.FExpandIcon !== Value) this.FExpandIcon.Assign(Value);
    };
    this.SetFilterIcon = function (Value) {
      if (this.FFilterIcon !== Value) this.FFilterIcon.Assign(Value);
    };
    this.SetFilterActiveIcon = function (Value) {
      if (this.FFilterActiveIcon !== Value) this.FFilterActiveIcon.Assign(Value);
    };
    this.SetSortAscendingIcon = function (Value) {
      if (this.FSortAscendingIcon !== Value) this.FSortAscendingIcon.Assign(Value);
    };
    this.SetSortDescendingIcon = function (Value) {
      if (this.FSortDescendingIcon !== Value) this.FSortDescendingIcon.Assign(Value);
    };
    this.SetFilterClearIcon = function (Value) {
      if (this.FFilterClearIcon !== Value) this.FFilterClearIcon.Assign(Value);
    };
    this.SetFilterTypeIcon = function (Value) {
      if (this.FFilterTypeIcon !== Value) this.FFilterTypeIcon.Assign(Value);
    };
    this.SetCloseIcon = function (Value) {
      if (this.FCloseIcon !== Value) this.FCloseIcon.Assign(Value);
    };
    this.SetFirstPageIcon = function (Value) {
      if (this.FFirstPageIcon !== Value) this.FFirstPageIcon.Assign(Value);
    };
    this.SetLastPageIcon = function (Value) {
      if (this.FLastPageIcon !== Value) this.FLastPageIcon.Assign(Value);
    };
    this.SetNextPageIcon = function (Value) {
      if (this.FNextPageIcon !== Value) this.FNextPageIcon.Assign(Value);
    };
    this.SetPreviousPageIcon = function (Value) {
      if (this.FPreviousPageIcon !== Value) this.FPreviousPageIcon.Assign(Value);
    };
    this.GetActiveCloseIcon = function () {
      var Result = null;
      if (!pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(this.FCloseIcon)) {
        Result = this.FCloseIcon}
       else {
        if (!(this.FDefaultCloseIcon != null)) this.FDefaultCloseIcon = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource$1($impl.TTMSFNCDATAGRIDCLOSE,pas["WEBLib.TMSFNCTypes"].HInstance());
        Result = this.FDefaultCloseIcon;
      };
      return Result;
    };
    this.GetActiveCollapseIcon = function () {
      var Result = null;
      if (!pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(this.FCollapseIcon)) {
        Result = this.FCollapseIcon}
       else {
        if (!(this.FDefaultCollapseIcon != null)) this.FDefaultCollapseIcon = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource$1($impl.TTMSFNCDATAGRIDCOLLAPSE,pas["WEBLib.TMSFNCTypes"].HInstance());
        Result = this.FDefaultCollapseIcon;
      };
      return Result;
    };
    this.GetActiveExpandIcon = function () {
      var Result = null;
      if (!pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(this.FExpandIcon)) {
        Result = this.FExpandIcon}
       else {
        if (!(this.FDefaultExpandIcon != null)) this.FDefaultExpandIcon = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource$1($impl.TTMSFNCDATAGRIDEXPAND,pas["WEBLib.TMSFNCTypes"].HInstance());
        Result = this.FDefaultExpandIcon;
      };
      return Result;
    };
    this.GetActiveFilterActiveIcon = function () {
      var Result = null;
      if (!pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(this.FFilterActiveIcon)) {
        Result = this.FFilterActiveIcon}
       else {
        if (!(this.FDefaultFilterActiveIcon != null)) this.FDefaultFilterActiveIcon = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource$1($impl.TTMSFNCDATAGRIDFILTERACTIVE,pas["WEBLib.TMSFNCTypes"].HInstance());
        Result = this.FDefaultFilterActiveIcon;
      };
      return Result;
    };
    this.GetActiveFilterClearIcon = function () {
      var Result = null;
      if (!pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(this.FFilterClearIcon)) {
        Result = this.FFilterClearIcon}
       else {
        if (!(this.FDefaultFilterClearIcon != null)) this.FDefaultFilterClearIcon = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource$1($impl.TTMSFNCDATAGRIDFILTERCLEAR,pas["WEBLib.TMSFNCTypes"].HInstance());
        Result = this.FDefaultFilterClearIcon;
      };
      return Result;
    };
    this.GetActiveFilterIcon = function () {
      var Result = null;
      if (!pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(this.FFilterIcon)) {
        Result = this.FFilterIcon}
       else {
        if (!(this.FDefaultFilterIcon != null)) this.FDefaultFilterIcon = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource$1($impl.TTMSFNCDATAGRIDFILTER,pas["WEBLib.TMSFNCTypes"].HInstance());
        Result = this.FDefaultFilterIcon;
      };
      return Result;
    };
    this.GetActiveFilterTypeIcon = function () {
      var Result = null;
      if (!pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(this.FFilterTypeIcon)) {
        Result = this.FFilterTypeIcon}
       else {
        if (!(this.FDefaultFilterTypeIcon != null)) this.FDefaultFilterTypeIcon = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource$1($impl.TTMSFNCDATAGRIDFILTERTYPE,pas["WEBLib.TMSFNCTypes"].HInstance());
        Result = this.FDefaultFilterTypeIcon;
      };
      return Result;
    };
    this.GetActiveFirstPageIcon = function () {
      var Result = null;
      if (!pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(this.FFirstPageIcon)) {
        Result = this.FFirstPageIcon}
       else {
        if (!(this.FDefaultFirstPageIcon != null)) this.FDefaultFirstPageIcon = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource$1($impl.TTMSFNCDATAGRIDFIRSTPAGE,pas["WEBLib.TMSFNCTypes"].HInstance());
        Result = this.FDefaultFirstPageIcon;
      };
      return Result;
    };
    this.GetActiveLastPageIcon = function () {
      var Result = null;
      if (!pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(this.FLastPageIcon)) {
        Result = this.FLastPageIcon}
       else {
        if (!(this.FDefaultLastPageIcon != null)) this.FDefaultLastPageIcon = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource$1($impl.TTMSFNCDATAGRIDLASTPAGE,pas["WEBLib.TMSFNCTypes"].HInstance());
        Result = this.FDefaultLastPageIcon;
      };
      return Result;
    };
    this.GetActiveNextPageIcon = function () {
      var Result = null;
      if (!pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(this.FNextPageIcon)) {
        Result = this.FNextPageIcon}
       else {
        if (!(this.FDefaultNextPageIcon != null)) this.FDefaultNextPageIcon = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource$1($impl.TTMSFNCDATAGRIDNEXTPAGE,pas["WEBLib.TMSFNCTypes"].HInstance());
        Result = this.FDefaultNextPageIcon;
      };
      return Result;
    };
    this.GetActivePreviousPageIcon = function () {
      var Result = null;
      if (!pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(this.FPreviousPageIcon)) {
        Result = this.FPreviousPageIcon}
       else {
        if (!(this.FDefaultPreviousPageIcon != null)) this.FDefaultPreviousPageIcon = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource$1($impl.TTMSFNCDATAGRIDPREVIOUSPAGE,pas["WEBLib.TMSFNCTypes"].HInstance());
        Result = this.FDefaultPreviousPageIcon;
      };
      return Result;
    };
    this.GetActiveSortAscendingIcon = function () {
      var Result = null;
      if (!pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(this.FSortAscendingIcon)) {
        Result = this.FSortAscendingIcon}
       else {
        if (!(this.FDefaultSortAscendingIcon != null)) this.FDefaultSortAscendingIcon = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource$1($impl.TTMSFNCDATAGRIDSORTASC,pas["WEBLib.TMSFNCTypes"].HInstance());
        Result = this.FDefaultSortAscendingIcon;
      };
      return Result;
    };
    this.GetActiveSortDescendingIcon = function () {
      var Result = null;
      if (!pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(this.FSortDescendingIcon)) {
        Result = this.FSortDescendingIcon}
       else {
        if (!(this.FDefaultSortDescendingIcon != null)) this.FDefaultSortDescendingIcon = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource$1($impl.TTMSFNCDATAGRIDSORTDESC,pas["WEBLib.TMSFNCTypes"].HInstance());
        Result = this.FDefaultSortDescendingIcon;
      };
      return Result;
    };
    this.IconChanged = function (Sender) {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Create$1 = function () {
      this.FFirstPageIcon = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      this.FPreviousPageIcon = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      this.FNextPageIcon = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      this.FLastPageIcon = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      this.FCloseIcon = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      this.FExpandIcon = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      this.FCollapseIcon = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      this.FFilterIcon = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      this.FFilterClearIcon = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      this.FFilterTypeIcon = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      this.FFilterActiveIcon = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      this.FSortAscendingIcon = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      this.FSortDescendingIcon = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      this.FPreviousPageIcon.FOnChange = rtl.createCallback(this,"IconChanged");
      this.FLastPageIcon.FOnChange = rtl.createCallback(this,"IconChanged");
      this.FNextPageIcon.FOnChange = rtl.createCallback(this,"IconChanged");
      this.FFirstPageIcon.FOnChange = rtl.createCallback(this,"IconChanged");
      this.FCloseIcon.FOnChange = rtl.createCallback(this,"IconChanged");
      this.FExpandIcon.FOnChange = rtl.createCallback(this,"IconChanged");
      this.FCollapseIcon.FOnChange = rtl.createCallback(this,"IconChanged");
      this.FFilterIcon.FOnChange = rtl.createCallback(this,"IconChanged");
      this.FFilterClearIcon.FOnChange = rtl.createCallback(this,"IconChanged");
      this.FFilterTypeIcon.FOnChange = rtl.createCallback(this,"IconChanged");
      this.FFilterActiveIcon.FOnChange = rtl.createCallback(this,"IconChanged");
      this.FSortAscendingIcon.FOnChange = rtl.createCallback(this,"IconChanged");
      this.FSortDescendingIcon.FOnChange = rtl.createCallback(this,"IconChanged");
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridIcons.isPrototypeOf(Source)) {
        this.FCloseIcon.Assign(rtl.as(Source,$mod.TTMSFNCDataGridIcons).FCloseIcon);
        this.FExpandIcon.Assign(rtl.as(Source,$mod.TTMSFNCDataGridIcons).FExpandIcon);
        this.FCollapseIcon.Assign(rtl.as(Source,$mod.TTMSFNCDataGridIcons).FCollapseIcon);
        this.FFilterIcon.Assign(rtl.as(Source,$mod.TTMSFNCDataGridIcons).FFilterIcon);
        this.FFilterClearIcon.Assign(rtl.as(Source,$mod.TTMSFNCDataGridIcons).FFilterClearIcon);
        this.FFilterTypeIcon.Assign(rtl.as(Source,$mod.TTMSFNCDataGridIcons).FFilterTypeIcon);
        this.FFilterActiveIcon.Assign(rtl.as(Source,$mod.TTMSFNCDataGridIcons).FFilterActiveIcon);
        this.FSortAscendingIcon.Assign(rtl.as(Source,$mod.TTMSFNCDataGridIcons).FSortAscendingIcon);
        this.FSortDescendingIcon.Assign(rtl.as(Source,$mod.TTMSFNCDataGridIcons).FSortDescendingIcon);
        this.FFirstPageIcon.Assign(rtl.as(Source,$mod.TTMSFNCDataGridIcons).FFirstPageIcon);
        this.FLastPageIcon.Assign(rtl.as(Source,$mod.TTMSFNCDataGridIcons).FLastPageIcon);
        this.FNextPageIcon.Assign(rtl.as(Source,$mod.TTMSFNCDataGridIcons).FNextPageIcon);
        this.FPreviousPageIcon.Assign(rtl.as(Source,$mod.TTMSFNCDataGridIcons).FPreviousPageIcon);
      };
    };
    this.Destroy = function () {
      rtl.free(this,"FFirstPageIcon");
      rtl.free(this,"FLastPageIcon");
      rtl.free(this,"FNextPageIcon");
      rtl.free(this,"FPreviousPageIcon");
      rtl.free(this,"FCloseIcon");
      rtl.free(this,"FExpandIcon");
      rtl.free(this,"FCollapseIcon");
      rtl.free(this,"FFilterIcon");
      rtl.free(this,"FFilterClearIcon");
      rtl.free(this,"FFilterTypeIcon");
      rtl.free(this,"FFilterActiveIcon");
      rtl.free(this,"FSortDescendingIcon");
      rtl.free(this,"FSortAscendingIcon");
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FDefaultFirstPageIcon;
        }, set: function (v) {
          this.p.FDefaultFirstPageIcon = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FDefaultLastPageIcon;
        }, set: function (v) {
          this.p.FDefaultLastPageIcon = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FDefaultNextPageIcon;
        }, set: function (v) {
          this.p.FDefaultNextPageIcon = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FDefaultPreviousPageIcon;
        }, set: function (v) {
          this.p.FDefaultPreviousPageIcon = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FDefaultCloseIcon;
        }, set: function (v) {
          this.p.FDefaultCloseIcon = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FDefaultExpandIcon;
        }, set: function (v) {
          this.p.FDefaultExpandIcon = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FDefaultCollapseIcon;
        }, set: function (v) {
          this.p.FDefaultCollapseIcon = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FDefaultFilterIcon;
        }, set: function (v) {
          this.p.FDefaultFilterIcon = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FDefaultFilterClearIcon;
        }, set: function (v) {
          this.p.FDefaultFilterClearIcon = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FDefaultFilterTypeIcon;
        }, set: function (v) {
          this.p.FDefaultFilterTypeIcon = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FDefaultFilterActiveIcon;
        }, set: function (v) {
          this.p.FDefaultFilterActiveIcon = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FDefaultSortDescendingIcon;
        }, set: function (v) {
          this.p.FDefaultSortDescendingIcon = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FDefaultSortAscendingIcon;
        }, set: function (v) {
          this.p.FDefaultSortAscendingIcon = v;
        }});
      pas.System.TObject.Destroy.call(this);
    };
    var $r = this.$rtti;
    $r.addProperty("ExpandIcon",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FExpandIcon","SetExpandIcon");
    $r.addProperty("CollapseIcon",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FCollapseIcon","SetCollapseIcon");
    $r.addProperty("FilterIcon",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FFilterIcon","SetFilterIcon");
    $r.addProperty("FilterActiveIcon",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FFilterActiveIcon","SetFilterActiveIcon");
    $r.addProperty("FilterClearIcon",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FFilterClearIcon","SetFilterClearIcon");
    $r.addProperty("FilterTypeIcon",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FFilterTypeIcon","SetFilterTypeIcon");
    $r.addProperty("SortAscendingIcon",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FSortAscendingIcon","SetSortAscendingIcon");
    $r.addProperty("SortDescendingIcon",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FSortDescendingIcon","SetSortDescendingIcon");
    $r.addProperty("CloseIcon",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FCloseIcon","SetCloseIcon");
    $r.addProperty("FirstPageIcon",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FFirstPageIcon","SetFirstPageIcon");
    $r.addProperty("LastPageIcon",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FLastPageIcon","SetLastPageIcon");
    $r.addProperty("NextPageIcon",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FNextPageIcon","SetNextPageIcon");
    $r.addProperty("PreviousPageIcon",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"FPreviousPageIcon","SetPreviousPageIcon");
  });
  this.TTMSFNCDataGridEmptySpaceKind = {"0": "gekColumnTop", gekColumnTop: 0, "1": "gekColumnBottom", gekColumnBottom: 1, "2": "gekRowLeft", gekRowLeft: 2, "3": "gekRowRight", gekRowRight: 3, "4": "gekColumnBottomRowRight", gekColumnBottomRowRight: 4};
  this.$rtti.$Enum("TTMSFNCDataGridEmptySpaceKind",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TTMSFNCDataGridEmptySpaceKind});
  this.$rtti.$MethodVar("TTMSFNCDataGridDropFilesEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ADropFiles",pas["WEBLib.TMSFNCCustomControl"].$rtti["TTMSFNCCustomControlDropFiles"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridAfterLookupEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ALookupString",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridBeforeLookupEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ALookupString",rtl.string,1],["ACanLookup",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridAfterDrawCellEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ACell",pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCell"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridAfterDrawGridEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridBeforeDrawCellEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ACell",pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCell"]],["ACanDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridBeforeDrawEmptySpaceEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AKind",this.$rtti["TTMSFNCDataGridEmptySpaceKind"]],["ACanDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridAfterDrawEmptySpaceEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ARect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"]],["AKind",this.$rtti["TTMSFNCDataGridEmptySpaceKind"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridGetCellClassEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["ARow",rtl.longint],["ACellClass",pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCellClass"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridGetCellLayoutEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACell",pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCell"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridGetCellLayoutHasPriorityEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["AHasPriority",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridGetCellHintEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["AHint",rtl.string,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridGetCellPropertiesEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACell",pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCell"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridCanEditCellEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["ARow",rtl.longint],["ACanEdit",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridCellClickEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["ARow",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridCellAnchorClickEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["ARow",rtl.longint],["AAnchor",rtl.string]]), methodkind: 0});
  this.TTMSFNCDataGridCellConfigureMode = {"0": "gccmLayout", gccmLayout: 0, "1": "gccmProperties", gccmProperties: 1, "2": "gccmBoth", gccmBoth: 2};
  this.$rtti.$Enum("TTMSFNCDataGridCellConfigureMode",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCDataGridCellConfigureMode});
  rtl.createClass(this,"TTMSFNCDataGridStretchingOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FOnChangeRebuild = null;
      this.FEnabled = false;
      this.FIndex = 0;
      this.FMode = 0;
      this.FRange = 0;
    };
    this.$final = function () {
      this.FOnChangeRebuild = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetEnabled = function (Value) {
      if (this.FEnabled !== Value) {
        this.FEnabled = Value;
        if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
      };
    };
    this.SetIndex = function (Value) {
      if (this.FIndex !== Value) {
        this.FIndex = Value;
        if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
      };
    };
    this.SetMode = function (Value) {
      if (this.FMode !== Value) {
        this.FMode = Value;
        if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
      };
    };
    this.SetRange = function (Value) {
      if (this.FRange !== Value) {
        this.FRange = Value;
        if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
      };
    };
    this.Create$1 = function () {
      this.FEnabled = false;
      this.FIndex = -1;
      this.FMode = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridStretchingMode.gstmAll;
      this.FRange = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridStretchingRange.gstrNormal;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridStretchingOptions.isPrototypeOf(Source)) {
        this.FEnabled = rtl.as(Source,$mod.TTMSFNCDataGridStretchingOptions).FEnabled;
        this.FIndex = rtl.as(Source,$mod.TTMSFNCDataGridStretchingOptions).FIndex;
        this.FMode = rtl.as(Source,$mod.TTMSFNCDataGridStretchingOptions).FMode;
        this.FRange = rtl.as(Source,$mod.TTMSFNCDataGridStretchingOptions).FRange;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: false});
    $r.addProperty("Mode",2,pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridStretchingMode"],"FMode","SetMode",4,{Default: pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridStretchingMode.gstmAll});
    $r.addProperty("Range",2,pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridStretchingRange"],"FRange","SetRange",4,{Default: pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridStretchingRange.gstrNormal});
    $r.addProperty("Index",2,rtl.longint,"FIndex","SetIndex",4,{Default: -1});
  });
  rtl.createClass(this,"TTMSFNCDataGridColumnRowOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FOnChangeRebuild = null;
      this.FStretching = null;
    };
    this.$final = function () {
      this.FOnChangeRebuild = undefined;
      this.FStretching = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetStretching = function (Value) {
      if (this.FStretching !== Value) this.FStretching.Assign(Value);
    };
    this.DoStretchingChanged = function (Sender) {
      if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
    };
    this.Create$1 = function () {
      this.FStretching = $mod.TTMSFNCDataGridStretchingOptions.$create("Create$1");
      this.FStretching.FOnChangeRebuild = rtl.createCallback(this,"DoStretchingChanged");
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FStretching;
        }, set: function (v) {
          this.p.FStretching = v;
        }});
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridColumnRowOptions.isPrototypeOf(Source)) {
        this.FStretching.Assign(rtl.as(Source,$mod.TTMSFNCDataGridColumnRowOptions).FStretching);
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Stretching",2,$mod.$rtti["TTMSFNCDataGridStretchingOptions"],"FStretching","SetStretching");
  });
  rtl.createClass(this,"TTMSFNCDataGridColumnOptions",this.TTMSFNCDataGridColumnRowOptions,function () {
    this.$init = function () {
      $mod.TTMSFNCDataGridColumnRowOptions.$init.call(this);
      this.FNodeIndex = 0;
      this.FFixedAutoCheckAll = false;
    };
    this.SetNodeIndex = function (Value) {
      if (this.FNodeIndex !== Value) {
        this.FNodeIndex = Value;
        if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
      };
    };
    this.Create$1 = function () {
      $mod.TTMSFNCDataGridColumnRowOptions.Create$1.call(this);
      this.FFixedAutoCheckAll = true;
      this.FNodeIndex = 0;
      return this;
    };
    this.Assign = function (Source) {
      $mod.TTMSFNCDataGridColumnRowOptions.Assign.apply(this,arguments);
      if ($mod.TTMSFNCDataGridColumnOptions.isPrototypeOf(Source)) {
        this.FFixedAutoCheckAll = rtl.as(Source,$mod.TTMSFNCDataGridColumnOptions).FFixedAutoCheckAll;
        this.FNodeIndex = rtl.as(Source,$mod.TTMSFNCDataGridColumnOptions).FNodeIndex;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("FixedAutoCheckAll",0,rtl.boolean,"FFixedAutoCheckAll","FFixedAutoCheckAll",4,{Default: true});
    $r.addProperty("NodeIndex",2,rtl.longint,"FNodeIndex","SetNodeIndex",4,{Default: 0});
  });
  rtl.createClass(this,"TTMSFNCDataGridRowOptions",this.TTMSFNCDataGridColumnRowOptions,function () {
  });
  this.TTMSFNCDataGridAutoFillState = {"0": "gafsNone", gafsNone: 0, "1": "gafsHover", gafsHover: 1, "2": "gafsDragging", gafsDragging: 2, "3": "gafsPreview", gafsPreview: 3};
  this.$rtti.$Enum("TTMSFNCDataGridAutoFillState",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TTMSFNCDataGridAutoFillState});
  this.TTMSFNCDataGridSelectionMode = {"0": "gsmNone", gsmNone: 0, "1": "gsmSingleCell", gsmSingleCell: 1, "2": "gsmSingleRow", gsmSingleRow: 2, "3": "gsmSingleColumn", gsmSingleColumn: 3, "4": "gsmCellRange", gsmCellRange: 4, "5": "gsmRowRange", gsmRowRange: 5, "6": "gsmColumnRange", gsmColumnRange: 6, "7": "gsmDisjunctRow", gsmDisjunctRow: 7, "8": "gsmDisjunctColumn", gsmDisjunctColumn: 8, "9": "gsmDisjunctCell", gsmDisjunctCell: 9, "10": "gsmDisjunctCellRange", gsmDisjunctCellRange: 10};
  this.$rtti.$Enum("TTMSFNCDataGridSelectionMode",{minvalue: 0, maxvalue: 10, ordtype: 1, enumtype: this.TTMSFNCDataGridSelectionMode});
  this.TTMSFNCDataGridSelectionRangeType = {"0": "gsrtMoveFocusedCell", gsrtMoveFocusedCell: 0, "1": "gsrtKeepFocusedCell", gsrtKeepFocusedCell: 1};
  this.$rtti.$Enum("TTMSFNCDataGridSelectionRangeType",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCDataGridSelectionRangeType});
  rtl.createClass(this,"TTMSFNCDataGridSelectionOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FMode = 0;
      this.FOnChange = null;
      this.FShowSelectionInFixedCells = false;
      this.FOnChangeRebuild = null;
      this.FRangeType = 0;
      this.FAutoFill = false;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      this.FOnChangeRebuild = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetMode = function (Value) {
      if (this.FMode !== Value) {
        this.FMode = Value;
        this.ChangedRebuild();
      };
    };
    this.SetShowSelectionInFixedCells = function (Value) {
      if (this.FShowSelectionInFixedCells !== Value) {
        this.FShowSelectionInFixedCells = Value;
        this.Changed();
      };
    };
    this.SetRangeType = function (Value) {
      if (this.FRangeType !== Value) {
        this.FRangeType = Value;
        this.ChangedRebuild();
      };
    };
    this.SetAutoFill = function (Value) {
      if (this.FAutoFill !== Value) {
        this.FAutoFill = Value;
        this.Changed();
      };
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridSelectionOptions.isPrototypeOf(Source)) {
        this.FMode = rtl.as(Source,$mod.TTMSFNCDataGridSelectionOptions).FMode;
        this.FShowSelectionInFixedCells = rtl.as(Source,$mod.TTMSFNCDataGridSelectionOptions).FShowSelectionInFixedCells;
        this.FRangeType = rtl.as(Source,$mod.TTMSFNCDataGridSelectionOptions).FRangeType;
        this.FAutoFill = rtl.as(Source,$mod.TTMSFNCDataGridSelectionOptions).FAutoFill;
      };
    };
    this.Create$1 = function () {
      this.FMode = $mod.TTMSFNCDataGridSelectionMode.gsmSingleCell;
      this.FRangeType = $mod.TTMSFNCDataGridSelectionRangeType.gsrtMoveFocusedCell;
      this.FShowSelectionInFixedCells = false;
      this.FAutoFill = false;
      return this;
    };
    this.Changed = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.ChangedRebuild = function () {
      if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
    };
    var $r = this.$rtti;
    $r.addProperty("RangeType",2,$mod.$rtti["TTMSFNCDataGridSelectionRangeType"],"FRangeType","SetRangeType",4,{Default: $mod.TTMSFNCDataGridSelectionRangeType.gsrtMoveFocusedCell});
    $r.addProperty("Mode",2,$mod.$rtti["TTMSFNCDataGridSelectionMode"],"FMode","SetMode",4,{Default: $mod.TTMSFNCDataGridSelectionMode.gsmSingleCell});
    $r.addProperty("AutoFill",2,rtl.boolean,"FAutoFill","SetAutoFill",4,{Default: false});
    $r.addProperty("ShowSelectionInFixedCells",2,rtl.boolean,"FShowSelectionInFixedCells","SetShowSelectionInFixedCells",4,{Default: false});
  });
  rtl.createClass(this,"TTMSFNCDataGridLocalizationOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FFilterAllText = "";
      this.FFilterEmptyText = "";
      this.FFilterNotEmptyText = "";
      this.FFilterClearButtonHint = "";
      this.FFilterEditPrompt = "";
      this.FFilterSortButtonAscendingHint = "";
      this.FFilterSortButtonAscendingText = "";
      this.FFilterSortButtonDescendingHint = "";
      this.FFilterSortButtonDescendingText = "";
      this.FFilterTypeButtonHint = "";
      this.FFilterTypeContainsText = "";
      this.FFilterTypeEmptyText = "";
      this.FFilterTypeEndsWithText = "";
      this.FFilterTypeEqualText = "";
      this.FFilterTypeLargerOrEqualThanText = "";
      this.FFilterTypeLargerThanText = "";
      this.FFilterTypeNotContainsText = "";
      this.FFilterTypeNotEmptyText = "";
      this.FFilterTypeNotEqualText = "";
      this.FFilterTypeSmallerOrEqualThanText = "";
      this.FFilterTypeSmallerThanText = "";
      this.FFilterTypeStartsWithText = "";
    };
    this.IsFilterAllTextStored = function () {
      var Result = false;
      Result = this.FFilterAllText !== rtl.getResStr($mod,"sTMSFNCDataGridFilterAllText");
      return Result;
    };
    this.IsFilterEmptyTextStored = function () {
      var Result = false;
      Result = this.FFilterEmptyText !== rtl.getResStr($mod,"sTMSFNCDataGridFilterEmptyText");
      return Result;
    };
    this.IsFilterNotEmptyTextStored = function () {
      var Result = false;
      Result = this.FFilterNotEmptyText !== rtl.getResStr($mod,"sTMSFNCDataGridFilterNotEmptyText");
      return Result;
    };
    this.IsFilterClearButtonHintStored = function () {
      var Result = false;
      Result = this.FFilterClearButtonHint !== rtl.getResStr($mod,"sTMSFNCDataGridFilterClearButtonHint");
      return Result;
    };
    this.IsFilterEditPromptStored = function () {
      var Result = false;
      Result = this.FFilterEditPrompt !== rtl.getResStr($mod,"sTMSFNCDataGridFilterEditPrompt");
      return Result;
    };
    this.IsFilterSortButtonAscendingHintStored = function () {
      var Result = false;
      Result = this.FFilterSortButtonAscendingHint !== rtl.getResStr($mod,"sTMSFNCDataGridFilterSortButtonAscendingHint");
      return Result;
    };
    this.IsFilterSortButtonAscendingTextStored = function () {
      var Result = false;
      Result = this.FFilterSortButtonAscendingText !== rtl.getResStr($mod,"sTMSFNCDataGridFilterSortButtonAscendingText");
      return Result;
    };
    this.IsFilterSortButtonDescendingHintStored = function () {
      var Result = false;
      Result = this.FFilterSortButtonDescendingHint !== rtl.getResStr($mod,"sTMSFNCDataGridFilterSortButtonDescendingHint");
      return Result;
    };
    this.IsFilterSortButtonDescendingTextStored = function () {
      var Result = false;
      Result = this.FFilterSortButtonDescendingText !== rtl.getResStr($mod,"sTMSFNCDataGridFilterSortButtonDescendingText");
      return Result;
    };
    this.IsFilterTypeButtonHintStored = function () {
      var Result = false;
      Result = this.FFilterTypeButtonHint !== rtl.getResStr($mod,"sTMSFNCDataGridFilterTypeButtonHint");
      return Result;
    };
    this.IsFilterTypeContainsTextStored = function () {
      var Result = false;
      Result = this.FFilterTypeContainsText !== rtl.getResStr($mod,"sTMSFNCDataGridFilterTypeContainsText");
      return Result;
    };
    this.IsFilterTypeEmptyTextStored = function () {
      var Result = false;
      Result = this.FFilterTypeEmptyText !== rtl.getResStr($mod,"sTMSFNCDataGridFilterTypeEmptyText");
      return Result;
    };
    this.IsFilterTypeEndsWithTextStored = function () {
      var Result = false;
      Result = this.FFilterTypeEndsWithText !== rtl.getResStr($mod,"sTMSFNCDataGridFilterTypeEndsWithText");
      return Result;
    };
    this.IsFilterTypeEqualTextStored = function () {
      var Result = false;
      Result = this.FFilterTypeEqualText !== rtl.getResStr($mod,"sTMSFNCDataGridFilterTypeEqualText");
      return Result;
    };
    this.IsFilterTypeLargerOrEqualThanTextStored = function () {
      var Result = false;
      Result = this.FFilterTypeLargerOrEqualThanText !== rtl.getResStr($mod,"sTMSFNCDataGridFilterTypeLargerOrEqualThanText");
      return Result;
    };
    this.IsFilterTypeLargerThanTextStored = function () {
      var Result = false;
      Result = this.FFilterTypeLargerThanText !== rtl.getResStr($mod,"sTMSFNCDataGridFilterTypeLargerThanText");
      return Result;
    };
    this.IsFilterTypeNotContainsTextStored = function () {
      var Result = false;
      Result = this.FFilterTypeNotContainsText !== rtl.getResStr($mod,"sTMSFNCDataGridFilterTypeNotContainsText");
      return Result;
    };
    this.IsFilterTypeNotEmptyTextStored = function () {
      var Result = false;
      Result = this.FFilterTypeNotEmptyText !== rtl.getResStr($mod,"sTMSFNCDataGridFilterTypeNotEmptyText");
      return Result;
    };
    this.IsFilterTypeNotEqualTextStored = function () {
      var Result = false;
      Result = this.FFilterTypeNotEqualText !== rtl.getResStr($mod,"sTMSFNCDataGridFilterTypeNotEqualText");
      return Result;
    };
    this.IsFilterTypeSmallerOrEqualThanTextStored = function () {
      var Result = false;
      Result = this.FFilterTypeSmallerOrEqualThanText !== rtl.getResStr($mod,"sTMSFNCDataGridFilterTypeSmallerOrEqualThanText");
      return Result;
    };
    this.IsFilterTypeSmallerThanTextStored = function () {
      var Result = false;
      Result = this.FFilterTypeSmallerThanText !== rtl.getResStr($mod,"sTMSFNCDataGridFilterTypeSmallerThanText");
      return Result;
    };
    this.IsFilterTypeStartsWithTextStored = function () {
      var Result = false;
      Result = this.FFilterTypeStartsWithText !== rtl.getResStr($mod,"sTMSFNCDataGridFilterTypeStartsWithText");
      return Result;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridLocalizationOptions.isPrototypeOf(Source)) {
        this.FFilterClearButtonHint = rtl.as(Source,$mod.TTMSFNCDataGridLocalizationOptions).FFilterClearButtonHint;
        this.FFilterTypeButtonHint = rtl.as(Source,$mod.TTMSFNCDataGridLocalizationOptions).FFilterTypeButtonHint;
        this.FFilterAllText = rtl.as(Source,$mod.TTMSFNCDataGridLocalizationOptions).FFilterAllText;
        this.FFilterEmptyText = rtl.as(Source,$mod.TTMSFNCDataGridLocalizationOptions).FFilterEmptyText;
        this.FFilterNotEmptyText = rtl.as(Source,$mod.TTMSFNCDataGridLocalizationOptions).FFilterNotEmptyText;
        this.FFilterEditPrompt = rtl.as(Source,$mod.TTMSFNCDataGridLocalizationOptions).FFilterEditPrompt;
        this.FFilterSortButtonAscendingText = rtl.as(Source,$mod.TTMSFNCDataGridLocalizationOptions).FFilterSortButtonAscendingText;
        this.FFilterSortButtonDescendingText = rtl.as(Source,$mod.TTMSFNCDataGridLocalizationOptions).FFilterSortButtonDescendingText;
        this.FFilterSortButtonAscendingHint = rtl.as(Source,$mod.TTMSFNCDataGridLocalizationOptions).FFilterSortButtonAscendingHint;
        this.FFilterSortButtonDescendingHint = rtl.as(Source,$mod.TTMSFNCDataGridLocalizationOptions).FFilterSortButtonDescendingHint;
        this.FFilterTypeEmptyText = rtl.as(Source,$mod.TTMSFNCDataGridLocalizationOptions).FFilterTypeEmptyText;
        this.FFilterTypeNotEmptyText = rtl.as(Source,$mod.TTMSFNCDataGridLocalizationOptions).FFilterTypeNotEmptyText;
        this.FFilterTypeStartsWithText = rtl.as(Source,$mod.TTMSFNCDataGridLocalizationOptions).FFilterTypeStartsWithText;
        this.FFilterTypeEndsWithText = rtl.as(Source,$mod.TTMSFNCDataGridLocalizationOptions).FFilterTypeEndsWithText;
        this.FFilterTypeContainsText = rtl.as(Source,$mod.TTMSFNCDataGridLocalizationOptions).FFilterTypeContainsText;
        this.FFilterTypeNotContainsText = rtl.as(Source,$mod.TTMSFNCDataGridLocalizationOptions).FFilterTypeNotContainsText;
        this.FFilterTypeEqualText = rtl.as(Source,$mod.TTMSFNCDataGridLocalizationOptions).FFilterTypeEqualText;
        this.FFilterTypeNotEqualText = rtl.as(Source,$mod.TTMSFNCDataGridLocalizationOptions).FFilterTypeNotEqualText;
        this.FFilterTypeLargerThanText = rtl.as(Source,$mod.TTMSFNCDataGridLocalizationOptions).FFilterTypeLargerThanText;
        this.FFilterTypeSmallerThanText = rtl.as(Source,$mod.TTMSFNCDataGridLocalizationOptions).FFilterTypeSmallerThanText;
        this.FFilterTypeLargerOrEqualThanText = rtl.as(Source,$mod.TTMSFNCDataGridLocalizationOptions).FFilterTypeLargerOrEqualThanText;
        this.FFilterTypeSmallerOrEqualThanText = rtl.as(Source,$mod.TTMSFNCDataGridLocalizationOptions).FFilterTypeSmallerOrEqualThanText;
      };
    };
    this.Create$1 = function () {
      this.FFilterClearButtonHint = rtl.getResStr($mod,"sTMSFNCDataGridFilterClearButtonHint");
      this.FFilterTypeButtonHint = rtl.getResStr($mod,"sTMSFNCDataGridFilterTypeButtonHint");
      this.FFilterTypeNotContainsText = rtl.getResStr($mod,"sTMSFNCDataGridFilterTypeNotContainsText");
      this.FFilterTypeNotEqualText = rtl.getResStr($mod,"sTMSFNCDataGridFilterTypeNotEqualText");
      this.FFilterTypeEmptyText = rtl.getResStr($mod,"sTMSFNCDataGridFilterTypeEmptyText");
      this.FFilterAllText = rtl.getResStr($mod,"sTMSFNCDataGridFilterAllText");
      this.FFilterEmptyText = rtl.getResStr($mod,"sTMSFNCDataGridFilterEmptyText");
      this.FFilterNotEmptyText = rtl.getResStr($mod,"sTMSFNCDataGridFilterNotEmptyText");
      this.FFilterTypeNotEmptyText = rtl.getResStr($mod,"sTMSFNCDataGridFilterTypeNotEmptyText");
      this.FFilterTypeSmallerThanText = rtl.getResStr($mod,"sTMSFNCDataGridFilterTypeSmallerThanText");
      this.FFilterTypeLargerThanText = rtl.getResStr($mod,"sTMSFNCDataGridFilterTypeLargerThanText");
      this.FFilterTypeStartsWithText = rtl.getResStr($mod,"sTMSFNCDataGridFilterTypeStartsWithText");
      this.FFilterSortButtonDescendingText = rtl.getResStr($mod,"sTMSFNCDataGridFilterSortButtonDescendingText");
      this.FFilterSortButtonAscendingText = rtl.getResStr($mod,"sTMSFNCDataGridFilterSortButtonAscendingText");
      this.FFilterSortButtonDescendingHint = rtl.getResStr($mod,"sTMSFNCDataGridFilterSortButtonDescendingHint");
      this.FFilterSortButtonAscendingHint = rtl.getResStr($mod,"sTMSFNCDataGridFilterSortButtonAscendingHint");
      this.FFilterTypeSmallerOrEqualThanText = rtl.getResStr($mod,"sTMSFNCDataGridFilterTypeSmallerOrEqualThanText");
      this.FFilterTypeLargerOrEqualThanText = rtl.getResStr($mod,"sTMSFNCDataGridFilterTypeLargerOrEqualThanText");
      this.FFilterTypeEndsWithText = rtl.getResStr($mod,"sTMSFNCDataGridFilterTypeEndsWithText");
      this.FFilterTypeContainsText = rtl.getResStr($mod,"sTMSFNCDataGridFilterTypeContainsText");
      this.FFilterEditPrompt = rtl.getResStr($mod,"sTMSFNCDataGridFilterEditPrompt");
      this.FFilterTypeEqualText = rtl.getResStr($mod,"sTMSFNCDataGridFilterTypeEqualText");
      return this;
    };
    var $r = this.$rtti;
    $r.addProperty("FilterAllText",12,rtl.string,"FFilterAllText","FFilterAllText",4,{stored: "IsFilterAllTextStored"});
    $r.addProperty("FilterEmptyText",12,rtl.string,"FFilterEmptyText","FFilterEmptyText",4,{stored: "IsFilterEmptyTextStored"});
    $r.addProperty("FilterNotEmptyText",12,rtl.string,"FFilterNotEmptyText","FFilterNotEmptyText",4,{stored: "IsFilterNotEmptyTextStored"});
    $r.addProperty("FilterClearButtonHint",12,rtl.string,"FFilterClearButtonHint","FFilterClearButtonHint",4,{stored: "IsFilterClearButtonHintStored"});
    $r.addProperty("FilterEditPrompt",12,rtl.string,"FFilterEditPrompt","FFilterEditPrompt",4,{stored: "IsFilterEditPromptStored"});
    $r.addProperty("FilterSortButtonAscendingHint",12,rtl.string,"FFilterSortButtonAscendingHint","FFilterSortButtonAscendingHint",4,{stored: "IsFilterSortButtonAscendingHintStored"});
    $r.addProperty("FilterSortButtonAscendingText",12,rtl.string,"FFilterSortButtonAscendingText","FFilterSortButtonAscendingText",4,{stored: "IsFilterSortButtonAscendingTextStored"});
    $r.addProperty("FilterSortButtonDescendingHint",12,rtl.string,"FFilterSortButtonDescendingHint","FFilterSortButtonDescendingHint",4,{stored: "IsFilterSortButtonDescendingHintStored"});
    $r.addProperty("FilterSortButtonDescendingText",12,rtl.string,"FFilterSortButtonDescendingText","FFilterSortButtonDescendingText",4,{stored: "IsFilterSortButtonDescendingTextStored"});
    $r.addProperty("FilterTypeButtonHint",12,rtl.string,"FFilterTypeButtonHint","FFilterTypeButtonHint",4,{stored: "IsFilterTypeButtonHintStored"});
    $r.addProperty("FilterTypeContainsText",12,rtl.string,"FFilterTypeContainsText","FFilterTypeContainsText",4,{stored: "IsFilterTypeContainsTextStored"});
    $r.addProperty("FilterTypeEmptyText",12,rtl.string,"FFilterTypeEmptyText","FFilterTypeEmptyText",4,{stored: "IsFilterTypeEmptyTextStored"});
    $r.addProperty("FilterTypeEndsWithText",12,rtl.string,"FFilterTypeEndsWithText","FFilterTypeEndsWithText",4,{stored: "IsFilterTypeEndsWithTextStored"});
    $r.addProperty("FilterTypeEqualText",12,rtl.string,"FFilterTypeEqualText","FFilterTypeEqualText",4,{stored: "IsFilterTypeEqualTextStored"});
    $r.addProperty("FilterTypeLargerOrEqualThanText",12,rtl.string,"FFilterTypeLargerOrEqualThanText","FFilterTypeLargerOrEqualThanText",4,{stored: "IsFilterTypeLargerOrEqualThanTextStored"});
    $r.addProperty("FilterTypeLargerThanText",12,rtl.string,"FFilterTypeLargerThanText","FFilterTypeLargerThanText",4,{stored: "IsFilterTypeLargerThanTextStored"});
    $r.addProperty("FilterTypeNotContainsText",12,rtl.string,"FFilterTypeNotContainsText","FFilterTypeNotContainsText",4,{stored: "IsFilterTypeNotContainsTextStored"});
    $r.addProperty("FilterTypeNotEmptyText",12,rtl.string,"FFilterTypeNotEmptyText","FFilterTypeNotEmptyText",4,{stored: "IsFilterTypeNotEmptyTextStored"});
    $r.addProperty("FilterTypeNotEqualText",12,rtl.string,"FFilterTypeNotEqualText","FFilterTypeNotEqualText",4,{stored: "IsFilterTypeNotEqualTextStored"});
    $r.addProperty("FilterTypeSmallerOrEqualThanText",12,rtl.string,"FFilterTypeSmallerOrEqualThanText","FFilterTypeSmallerOrEqualThanText",4,{stored: "IsFilterTypeSmallerOrEqualThanTextStored"});
    $r.addProperty("FilterTypeSmallerThanText",12,rtl.string,"FFilterTypeSmallerThanText","FFilterTypeSmallerThanText",4,{stored: "IsFilterTypeSmallerThanTextStored"});
    $r.addProperty("FilterTypeStartsWithText",12,rtl.string,"FFilterTypeStartsWithText","FFilterTypeStartsWithText",4,{stored: "IsFilterTypeStartsWithTextStored"});
  });
  rtl.createClass(this,"TTMSFNCDataGridBandingOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FEnabled = false;
      this.FOnChange = null;
      this.FBandRowCount = 0;
      this.FNormalRowCount = 0;
      this.FTotalRowCount = 0;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetEnabled = function (Value) {
      if (this.FEnabled !== Value) {
        this.FEnabled = Value;
        this.Changed();
      };
    };
    this.SetBandRowCount = function (Value) {
      if ((Value > 0) && (this.FBandRowCount !== Value)) {
        this.FBandRowCount = Value;
        this.FTotalRowCount = this.FNormalRowCount + this.FBandRowCount;
        this.Changed();
      };
    };
    this.SetNormalRowCount = function (Value) {
      if ((Value > 0) && (this.FNormalRowCount !== Value)) {
        this.FNormalRowCount = Value;
        this.FTotalRowCount = this.FNormalRowCount + this.FBandRowCount;
        this.Changed();
      };
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridBandingOptions.isPrototypeOf(Source)) {
        this.FEnabled = rtl.as(Source,$mod.TTMSFNCDataGridBandingOptions).FEnabled;
      };
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FEnabled = false;
      this.FNormalRowCount = 1;
      this.FBandRowCount = 1;
      return this;
    };
    this.Changed = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    var $r = this.$rtti;
    $r.addProperty("BandRowCount",2,rtl.longint,"FBandRowCount","SetBandRowCount",4,{Default: 1});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: false});
    $r.addProperty("NormalRowCount",2,rtl.longint,"FNormalRowCount","SetNormalRowCount",4,{Default: 1});
  });
  this.TTMSFNCDataGridClipboardPasteAction = {"0": "gpaReplace", gpaReplace: 0, "1": "gpaInsert", gpaInsert: 1};
  this.$rtti.$Enum("TTMSFNCDataGridClipboardPasteAction",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCDataGridClipboardPasteAction});
  rtl.createClass(this,"TTMSFNCDataGridClipboardOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FPasteAction = 0;
      this.FEnabled = false;
      this.FIgnoreReadOnly = false;
      this.FAllowRowGrow = false;
      this.FAllowColumnGrow = false;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridClipboardOptions.isPrototypeOf(Source)) {
        this.FPasteAction = rtl.as(Source,$mod.TTMSFNCDataGridClipboardOptions).FPasteAction;
        this.FIgnoreReadOnly = rtl.as(Source,$mod.TTMSFNCDataGridClipboardOptions).FIgnoreReadOnly;
        this.FEnabled = rtl.as(Source,$mod.TTMSFNCDataGridClipboardOptions).FEnabled;
        this.FAllowRowGrow = rtl.as(Source,$mod.TTMSFNCDataGridClipboardOptions).FAllowRowGrow;
        this.FAllowColumnGrow = rtl.as(Source,$mod.TTMSFNCDataGridClipboardOptions).FAllowColumnGrow;
      };
    };
    this.Create$1 = function () {
      this.FPasteAction = $mod.TTMSFNCDataGridClipboardPasteAction.gpaReplace;
      this.FIgnoreReadOnly = false;
      this.FEnabled = true;
      this.FAllowRowGrow = false;
      this.FAllowColumnGrow = false;
      return this;
    };
    var $r = this.$rtti;
    $r.addProperty("AllowColumnGrow",0,rtl.boolean,"FAllowColumnGrow","FAllowColumnGrow",4,{Default: false});
    $r.addProperty("AllowRowGrow",0,rtl.boolean,"FAllowRowGrow","FAllowRowGrow",4,{Default: false});
    $r.addProperty("Enabled",0,rtl.boolean,"FEnabled","FEnabled",4,{Default: true});
    $r.addProperty("IgnoreReadOnly",0,rtl.boolean,"FIgnoreReadOnly","FIgnoreReadOnly",4,{Default: false});
    $r.addProperty("PasteAction",0,$mod.$rtti["TTMSFNCDataGridClipboardPasteAction"],"FPasteAction","FPasteAction",4,{Default: $mod.TTMSFNCDataGridClipboardPasteAction.gpaReplace});
  });
  this.TTMSFNCDataGridEditCellStart = {"0": "gcsNone", gcsNone: 0, "1": "gcsStart", gcsStart: 1, "2": "gcsEnd", gcsEnd: 2};
  this.$rtti.$Enum("TTMSFNCDataGridEditCellStart",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCDataGridEditCellStart});
  this.TTMSFNCDataGridTabKeyHandling = {"0": "gtkhNextControl", gtkhNextControl: 0, "1": "gtkhNextCell", gtkhNextCell: 1, "2": "gtkhMixed", gtkhMixed: 2};
  this.$rtti.$Enum("TTMSFNCDataGridTabKeyHandling",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCDataGridTabKeyHandling});
  this.TTMSFNCDataGridTabKeyDirection = {"0": "gtkdNextColumnCell", gtkdNextColumnCell: 0, "1": "gtkdNextRowCell", gtkdNextRowCell: 1};
  this.$rtti.$Enum("TTMSFNCDataGridTabKeyDirection",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCDataGridTabKeyDirection});
  this.TTMSFNCDataGridTabKeyMode = {"0": "gtkmNone", gtkmNone: 0, "1": "gtkmNormal", gtkmNormal: 1, "2": "gtkmShift", gtkmShift: 2};
  this.$rtti.$Enum("TTMSFNCDataGridTabKeyMode",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCDataGridTabKeyMode});
  this.TTMSFNCDataGridInsertKeyHandling = {"0": "gikhNone", gikhNone: 0, "1": "gikhInsertRowBefore", gikhInsertRowBefore: 1, "2": "gikhInsertRowAfter", gikhInsertRowAfter: 2};
  this.$rtti.$Enum("TTMSFNCDataGridInsertKeyHandling",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCDataGridInsertKeyHandling});
  this.TTMSFNCDataGridEnterKeyHandling = {"0": "gekhNone", gekhNone: 0, "1": "gekhNextColumn", gekhNextColumn: 1, "2": "gekhNextRow", gekhNextRow: 2, "3": "gekhNextColumnInRow", gekhNextColumnInRow: 3, "4": "gekhNextRowInColumn", gekhNextRowInColumn: 4, "5": "gekhNextColumnAndAppend", gekhNextColumnAndAppend: 5, "6": "gekhNextRowAndAppend", gekhNextRowAndAppend: 6, "7": "gekhNextRowAndColumnAppend", gekhNextRowAndColumnAppend: 7, "8": "gekhNextColumnAndRowAppend", gekhNextColumnAndRowAppend: 8};
  this.$rtti.$Enum("TTMSFNCDataGridEnterKeyHandling",{minvalue: 0, maxvalue: 8, ordtype: 1, enumtype: this.TTMSFNCDataGridEnterKeyHandling});
  this.TTMSFNCDataGridDeleteKeyHandling = {"0": "gdkhNone", gdkhNone: 0, "1": "gdkhDeleteRow", gdkhDeleteRow: 1, "2": "gdkhClearSelectedCells", gdkhClearSelectedCells: 2};
  this.$rtti.$Enum("TTMSFNCDataGridDeleteKeyHandling",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCDataGridDeleteKeyHandling});
  this.TTMSFNCDataGridHomeKeyHandling = {"0": "ghkhNone", ghkhNone: 0, "1": "ghkhFirstRow", ghkhFirstRow: 1, "2": "ghkhFirstColumn", ghkhFirstColumn: 2};
  this.$rtti.$Enum("TTMSFNCDataGridHomeKeyHandling",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCDataGridHomeKeyHandling});
  this.TTMSFNCDataGridEndKeyHandling = {"0": "genkhNone", genkhNone: 0, "1": "genkhLastRow", genkhLastRow: 1, "2": "genkhLastColumn", genkhLastColumn: 2};
  this.$rtti.$Enum("TTMSFNCDataGridEndKeyHandling",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCDataGridEndKeyHandling});
  rtl.createClass(this,"TTMSFNCDataGridKeyboardOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FAppendColumnOnArrowKeyRight = false;
      this.FAppendRowOnArrowKeyDown = false;
      this.FArrowKeyDirectEdit = false;
      this.FCellMergeShortcut = false;
      this.FDeleteKeyHandling = 0;
      this.FEndKeyHandling = 0;
      this.FEnterKeyDirectEdit = false;
      this.FEnterKeyHandling = 0;
      this.FFindShortcut = false;
      this.FHomeKeyHandling = 0;
      this.FInsertKeyHandling = 0;
      this.FPageScrollSize = 0;
      this.FReplaceShortcut = false;
      this.FTabKeyDirectEdit = false;
      this.FTabKeyDirection = 0;
      this.FTabKeyHandling = 0;
    };
    this.SetPageScrollSize = function (Value) {
      this.FPageScrollSize = Value;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridKeyboardOptions.isPrototypeOf(Source)) {
        this.FTabKeyDirection = rtl.as(Source,$mod.TTMSFNCDataGridKeyboardOptions).FTabKeyDirection;
        this.FTabKeyHandling = rtl.as(Source,$mod.TTMSFNCDataGridKeyboardOptions).FTabKeyHandling;
        this.FEnterKeyHandling = rtl.as(Source,$mod.TTMSFNCDataGridKeyboardOptions).FEnterKeyHandling;
        this.FDeleteKeyHandling = rtl.as(Source,$mod.TTMSFNCDataGridKeyboardOptions).FDeleteKeyHandling;
        this.FInsertKeyHandling = rtl.as(Source,$mod.TTMSFNCDataGridKeyboardOptions).FInsertKeyHandling;
        this.FEnterKeyDirectEdit = rtl.as(Source,$mod.TTMSFNCDataGridKeyboardOptions).FEnterKeyDirectEdit;
        this.FTabKeyDirectEdit = rtl.as(Source,$mod.TTMSFNCDataGridKeyboardOptions).FTabKeyDirectEdit;
        this.FArrowKeyDirectEdit = rtl.as(Source,$mod.TTMSFNCDataGridKeyboardOptions).FArrowKeyDirectEdit;
        this.FCellMergeShortcut = rtl.as(Source,$mod.TTMSFNCDataGridKeyboardOptions).FCellMergeShortcut;
        this.FFindShortcut = rtl.as(Source,$mod.TTMSFNCDataGridKeyboardOptions).FFindShortcut;
        this.FReplaceShortcut = rtl.as(Source,$mod.TTMSFNCDataGridKeyboardOptions).FReplaceShortcut;
        this.FAppendRowOnArrowKeyDown = rtl.as(Source,$mod.TTMSFNCDataGridKeyboardOptions).FAppendRowOnArrowKeyDown;
        this.FAppendColumnOnArrowKeyRight = rtl.as(Source,$mod.TTMSFNCDataGridKeyboardOptions).FAppendColumnOnArrowKeyRight;
        this.FHomeKeyHandling = rtl.as(Source,$mod.TTMSFNCDataGridKeyboardOptions).FHomeKeyHandling;
        this.FEndKeyHandling = rtl.as(Source,$mod.TTMSFNCDataGridKeyboardOptions).FEndKeyHandling;
      };
    };
    this.Create$1 = function () {
      this.FAppendRowOnArrowKeyDown = false;
      this.FAppendColumnOnArrowKeyRight = false;
      this.FFindShortcut = true;
      this.FReplaceShortcut = true;
      this.FTabKeyDirection = $mod.TTMSFNCDataGridTabKeyDirection.gtkdNextColumnCell;
      this.FTabKeyHandling = $mod.TTMSFNCDataGridTabKeyHandling.gtkhMixed;
      this.FPageScrollSize = 0;
      this.FEnterKeyHandling = $mod.TTMSFNCDataGridEnterKeyHandling.gekhNone;
      this.FDeleteKeyHandling = $mod.TTMSFNCDataGridDeleteKeyHandling.gdkhNone;
      this.FInsertKeyHandling = $mod.TTMSFNCDataGridInsertKeyHandling.gikhNone;
      this.FEnterKeyDirectEdit = false;
      this.FArrowKeyDirectEdit = false;
      this.FTabKeyDirectEdit = false;
      this.FCellMergeShortcut = false;
      this.FHomeKeyHandling = $mod.TTMSFNCDataGridHomeKeyHandling.ghkhFirstColumn;
      this.FEndKeyHandling = $mod.TTMSFNCDataGridEndKeyHandling.genkhLastColumn;
      return this;
    };
    var $r = this.$rtti;
    $r.addProperty("AppendColumnOnArrowKeyRight",0,rtl.boolean,"FAppendColumnOnArrowKeyRight","FAppendColumnOnArrowKeyRight",4,{Default: false});
    $r.addProperty("AppendRowOnArrowKeyDown",0,rtl.boolean,"FAppendRowOnArrowKeyDown","FAppendRowOnArrowKeyDown",4,{Default: false});
    $r.addProperty("ArrowKeyDirectEdit",0,rtl.boolean,"FArrowKeyDirectEdit","FArrowKeyDirectEdit",4,{Default: false});
    $r.addProperty("CellMergeShortcut",0,rtl.boolean,"FCellMergeShortcut","FCellMergeShortcut",4,{Default: false});
    $r.addProperty("DeleteKeyHandling",0,$mod.$rtti["TTMSFNCDataGridDeleteKeyHandling"],"FDeleteKeyHandling","FDeleteKeyHandling",4,{Default: $mod.TTMSFNCDataGridDeleteKeyHandling.gdkhNone});
    $r.addProperty("EndKeyHandling",0,$mod.$rtti["TTMSFNCDataGridEndKeyHandling"],"FEndKeyHandling","FEndKeyHandling",4,{Default: $mod.TTMSFNCDataGridEndKeyHandling.genkhLastColumn});
    $r.addProperty("EnterKeyDirectEdit",0,rtl.boolean,"FEnterKeyDirectEdit","FEnterKeyDirectEdit",4,{Default: false});
    $r.addProperty("EnterKeyHandling",0,$mod.$rtti["TTMSFNCDataGridEnterKeyHandling"],"FEnterKeyHandling","FEnterKeyHandling",4,{Default: $mod.TTMSFNCDataGridEnterKeyHandling.gekhNone});
    $r.addProperty("FindShortcut",0,rtl.boolean,"FFindShortcut","FFindShortcut",4,{Default: true});
    $r.addProperty("HomeKeyHandling",0,$mod.$rtti["TTMSFNCDataGridHomeKeyHandling"],"FHomeKeyHandling","FHomeKeyHandling",4,{Default: $mod.TTMSFNCDataGridHomeKeyHandling.ghkhFirstColumn});
    $r.addProperty("InsertKeyHandling",0,$mod.$rtti["TTMSFNCDataGridInsertKeyHandling"],"FInsertKeyHandling","FInsertKeyHandling",4,{Default: $mod.TTMSFNCDataGridInsertKeyHandling.gikhNone});
    $r.addProperty("PageScrollSize",2,rtl.longint,"FPageScrollSize","SetPageScrollSize",4,{Default: 0});
    $r.addProperty("ReplaceShortcut",0,rtl.boolean,"FReplaceShortcut","FReplaceShortcut",4,{Default: true});
    $r.addProperty("TabKeyDirectEdit",0,rtl.boolean,"FTabKeyDirectEdit","FTabKeyDirectEdit",4,{Default: false});
    $r.addProperty("TabKeyDirection",0,$mod.$rtti["TTMSFNCDataGridTabKeyDirection"],"FTabKeyDirection","FTabKeyDirection",4,{Default: $mod.TTMSFNCDataGridTabKeyDirection.gtkdNextColumnCell});
    $r.addProperty("TabKeyHandling",0,$mod.$rtti["TTMSFNCDataGridTabKeyHandling"],"FTabKeyHandling","FTabKeyHandling",4,{Default: $mod.TTMSFNCDataGridTabKeyHandling.gtkhMixed});
  });
  this.TTMSFNCDataGridFixedCellSelectionMode = {"0": "gfcsAll", gfcsAll: 0, "1": "gfcsRow", gfcsRow: 1, "2": "gfcsColumn", gfcsColumn: 2, "3": "gfcsRowRange", gfcsRowRange: 3, "4": "gfcsColumnRange", gfcsColumnRange: 4, "5": "gfcsDisjunctRow", gfcsDisjunctRow: 5, "6": "gfcsDisjunctColumn", gfcsDisjunctColumn: 6};
  this.$rtti.$Enum("TTMSFNCDataGridFixedCellSelectionMode",{minvalue: 0, maxvalue: 6, ordtype: 1, enumtype: this.TTMSFNCDataGridFixedCellSelectionMode});
  this.$rtti.$Set("TTMSFNCDataGridFixedCellSelection",{comptype: this.$rtti["TTMSFNCDataGridFixedCellSelectionMode"]});
  this.TTMSFNCDataGridAutoScrollingSpeedMode = {"0": "gasmPixels", gasmPixels: 0, "1": "gasmCell", gasmCell: 1};
  this.$rtti.$Enum("TTMSFNCDataGridAutoScrollingSpeedMode",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCDataGridAutoScrollingSpeedMode});
  rtl.createClass(this,"TTMSFNCDataGridIOHTMLOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FConvertSpecialChars = false;
      this.FExportColors = false;
      this.FExportImages = false;
      this.FFooterFile = "";
      this.FFooterText = "";
      this.FHeaderFile = "";
      this.FHeaderText = "";
      this.FImageBaseName = "";
      this.FImageFolder = "";
      this.FNonBreakingText = false;
      this.FPrefixTag = "";
      this.FSuffixTag = "";
      this.FSummary = "";
      this.FTableBorderSize = 0;
      this.FTableCellPadding = 0;
      this.FTableCellSpacing = 0;
      this.FTableStyle = "";
      this.FTableWidth = 0;
      this.FXHTML = false;
    };
    this.IsImageBaseNameStored = function () {
      var Result = false;
      Result = this.FImageBaseName !== "img";
      return Result;
    };
    this.IsImageFolderStored = function () {
      var Result = false;
      Result = this.FImageFolder !== "images";
      return Result;
    };
    this.Create$1 = function () {
      this.FExportImages = true;
      this.FExportColors = true;
      this.FImageBaseName = "img";
      this.FImageFolder = "images";
      this.FTableBorderSize = 1;
      this.FTableCellSpacing = 0;
      this.FTableCellPadding = 0;
      this.FConvertSpecialChars = false;
      this.FFooterFile = "";
      this.FFooterText = "";
      this.FHeaderFile = "";
      this.FHeaderText = "";
      this.FNonBreakingText = false;
      this.FPrefixTag = "";
      this.FSuffixTag = "";
      this.FSummary = "";
      this.FTableStyle = "";
      this.FTableWidth = 100;
      this.FXHTML = false;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridIOHTMLOptions.isPrototypeOf(Source)) {
        this.FExportColors = rtl.as(Source,$mod.TTMSFNCDataGridIOHTMLOptions).FExportColors;
        this.FExportImages = rtl.as(Source,$mod.TTMSFNCDataGridIOHTMLOptions).FExportImages;
        this.FImageBaseName = rtl.as(Source,$mod.TTMSFNCDataGridIOHTMLOptions).FImageBaseName;
        this.FImageFolder = rtl.as(Source,$mod.TTMSFNCDataGridIOHTMLOptions).FImageFolder;
        this.FTableBorderSize = rtl.as(Source,$mod.TTMSFNCDataGridIOHTMLOptions).FTableBorderSize;
        this.FTableCellSpacing = rtl.as(Source,$mod.TTMSFNCDataGridIOHTMLOptions).FTableCellSpacing;
        this.FTableCellPadding = rtl.as(Source,$mod.TTMSFNCDataGridIOHTMLOptions).FTableCellPadding;
        this.FConvertSpecialChars = rtl.as(Source,$mod.TTMSFNCDataGridIOHTMLOptions).FConvertSpecialChars;
        this.FFooterFile = rtl.as(Source,$mod.TTMSFNCDataGridIOHTMLOptions).FFooterFile;
        this.FFooterText = rtl.as(Source,$mod.TTMSFNCDataGridIOHTMLOptions).FFooterText;
        this.FHeaderFile = rtl.as(Source,$mod.TTMSFNCDataGridIOHTMLOptions).FHeaderFile;
        this.FHeaderText = rtl.as(Source,$mod.TTMSFNCDataGridIOHTMLOptions).FHeaderText;
        this.FNonBreakingText = rtl.as(Source,$mod.TTMSFNCDataGridIOHTMLOptions).FNonBreakingText;
        this.FPrefixTag = rtl.as(Source,$mod.TTMSFNCDataGridIOHTMLOptions).FPrefixTag;
        this.FSuffixTag = rtl.as(Source,$mod.TTMSFNCDataGridIOHTMLOptions).FSuffixTag;
        this.FSummary = rtl.as(Source,$mod.TTMSFNCDataGridIOHTMLOptions).FSummary;
        this.FTableStyle = rtl.as(Source,$mod.TTMSFNCDataGridIOHTMLOptions).FTableStyle;
        this.FTableWidth = rtl.as(Source,$mod.TTMSFNCDataGridIOHTMLOptions).FTableWidth;
        this.FXHTML = rtl.as(Source,$mod.TTMSFNCDataGridIOHTMLOptions).FXHTML;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("ConvertSpecialChars",0,rtl.boolean,"FConvertSpecialChars","FConvertSpecialChars",4,{Default: false});
    $r.addProperty("ExportColors",0,rtl.boolean,"FExportColors","FExportColors",4,{Default: true});
    $r.addProperty("ExportImages",0,rtl.boolean,"FExportImages","FExportImages",4,{Default: true});
    $r.addProperty("FooterFile",0,rtl.string,"FFooterFile","FFooterFile");
    $r.addProperty("FooterText",0,rtl.string,"FFooterText","FFooterText");
    $r.addProperty("HeaderFile",0,rtl.string,"FHeaderFile","FHeaderFile");
    $r.addProperty("HeaderText",0,rtl.string,"FHeaderText","FHeaderText");
    $r.addProperty("ImageBaseName",12,rtl.string,"FImageBaseName","FImageBaseName",4,{stored: "IsImageBaseNameStored"});
    $r.addProperty("ImageFolder",12,rtl.string,"FImageFolder","FImageFolder",4,{stored: "IsImageFolderStored"});
    $r.addProperty("NonBreakingText",0,rtl.boolean,"FNonBreakingText","FNonBreakingText",4,{Default: false});
    $r.addProperty("PrefixTag",0,rtl.string,"FPrefixTag","FPrefixTag");
    $r.addProperty("SuffixTag",0,rtl.string,"FSuffixTag","FSuffixTag");
    $r.addProperty("Summary",0,rtl.string,"FSummary","FSummary");
    $r.addProperty("TableBorderSize",0,rtl.longint,"FTableBorderSize","FTableBorderSize",4,{Default: 1});
    $r.addProperty("TableCellPadding",0,rtl.longint,"FTableCellPadding","FTableCellPadding",4,{Default: 0});
    $r.addProperty("TableCellSpacing",0,rtl.longint,"FTableCellSpacing","FTableCellSpacing",4,{Default: 0});
    $r.addProperty("TableStyle",0,rtl.string,"FTableStyle","FTableStyle");
    $r.addProperty("TableWidth",0,rtl.longint,"FTableWidth","FTableWidth",4,{Default: 100});
    $r.addProperty("XHTML",0,rtl.boolean,"FXHTML","FXHTML",4,{Default: false});
  });
  rtl.createClass(this,"TTMSFNCDataGridIOOptions",pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataIOOptions,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataIOOptions.$init.call(this);
      this.FHTML = null;
    };
    this.$final = function () {
      this.FHTML = undefined;
      pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataIOOptions.$final.call(this);
    };
    this.SetHTML = function (Value) {
      if (this.FHTML !== Value) this.FHTML.Assign(Value);
    };
    this.Create$1 = function () {
      pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataIOOptions.Create$1.call(this);
      this.FHTML = $mod.TTMSFNCDataGridIOHTMLOptions.$create("Create$1");
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FHTML;
        }, set: function (v) {
          this.p.FHTML = v;
        }});
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataIOOptions.Assign.apply(this,arguments);
      if ($mod.TTMSFNCDataGridIOOptions.isPrototypeOf(Source)) {
        this.FHTML.Assign(rtl.as(Source,$mod.TTMSFNCDataGridIOOptions).FHTML);
      };
    };
    var $r = this.$rtti;
    $r.addProperty("HTML",2,$mod.$rtti["TTMSFNCDataGridIOHTMLOptions"],"FHTML","SetHTML");
  });
  this.TTMSFNCDataGridDragMode = {"0": "gdmReorder", gdmReorder: 0, "1": "gdmDrag", gdmDrag: 1};
  this.$rtti.$Enum("TTMSFNCDataGridDragMode",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCDataGridDragMode});
  this.TTMSFNCDataGridColumnDragMode = {"0": "gcdmReorder", gcdmReorder: 0, "1": "gcdmVisualGrouping", gcdmVisualGrouping: 1};
  this.$rtti.$Enum("TTMSFNCDataGridColumnDragMode",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCDataGridColumnDragMode});
  this.$rtti.$Set("TTMSFNCDataGridColumnDragModes",{comptype: this.$rtti["TTMSFNCDataGridColumnDragMode"]});
  this.TTMSFNCDataGridSizingMode = {"0": "gszmOneSided", gszmOneSided: 0, "1": "gszmTwoSided", gszmTwoSided: 1};
  this.$rtti.$Enum("TTMSFNCDataGridSizingMode",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCDataGridSizingMode});
  rtl.createClass(this,"TTMSFNCDataGridMouseOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FAutoDragging = false;
      this.FAutoScrolling = false;
      this.FAutoScrollingInterval = 0;
      this.FAutoScrollingSpeed = 0;
      this.FAutoScrollingSpeedMode = 0;
      this.FClickMargin = 0;
      this.FColumnAutoSizeOnDblClick = false;
      this.FColumnDragging = false;
      this.FColumnSizeMargin = 0;
      this.FColumnSizing = false;
      this.FDirectEdit = false;
      this.FDragMode = 0;
      this.FFixedCellSelection = {};
      this.FFixedColumnSizing = false;
      this.FFixedRowSizing = false;
      this.FRowAutoSizeOnDblClick = false;
      this.FRowDragging = false;
      this.FRowSizeMargin = 0;
      this.FRowSizing = false;
      this.FTouchScrolling = false;
      this.FTouchScrollingSensitivity = 0.0;
      this.FWheelScrollKeepSelection = false;
      this.FWheelScrollSize = 0;
      this.FColumnDragModes = {};
      this.FColumnSizingMode = 0;
      this.FRowSizingMode = 0;
    };
    this.$final = function () {
      this.FFixedCellSelection = undefined;
      this.FColumnDragModes = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.IsTouchScrollingSensitivityStored = function () {
      var Result = false;
      Result = this.FTouchScrollingSensitivity !== 1;
      return Result;
    };
    this.SetAutoScrollingInterval = function (Value) {
      if (this.FAutoScrollingInterval !== Value) this.FAutoScrollingInterval = Value;
    };
    this.SetClickMargin = function (Value) {
      if (this.FClickMargin !== Value) this.FClickMargin = Value;
    };
    this.SetColumnSizeMargin = function (Value) {
      if (this.FColumnSizeMargin !== Value) this.FColumnSizeMargin = Value;
    };
    this.SetRowSizeMargin = function (Value) {
      if (this.FRowSizeMargin !== Value) this.FRowSizeMargin = Value;
    };
    this.SetTouchScrolling = function (Value) {
      if (this.FTouchScrolling !== Value) this.FTouchScrolling = Value;
    };
    this.SetWheelScrollKeepSelection = function (Value) {
      if (this.FWheelScrollKeepSelection !== Value) this.FWheelScrollKeepSelection = Value;
    };
    this.SetWheelScrollSize = function (Value) {
      if (this.FWheelScrollSize !== Value) this.FWheelScrollSize = Value;
    };
    this.SetColumnDragModes = function (Value) {
      if (rtl.neSet(this.FColumnDragModes,Value)) this.FColumnDragModes = rtl.refSet(Value);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridMouseOptions.isPrototypeOf(Source)) {
        this.FDirectEdit = rtl.as(Source,$mod.TTMSFNCDataGridMouseOptions).FDirectEdit;
        this.FWheelScrollSize = rtl.as(Source,$mod.TTMSFNCDataGridMouseOptions).FWheelScrollSize;
        this.FColumnSizing = rtl.as(Source,$mod.TTMSFNCDataGridMouseOptions).FColumnSizing;
        this.FRowSizing = rtl.as(Source,$mod.TTMSFNCDataGridMouseOptions).FRowSizing;
        this.FFixedColumnSizing = rtl.as(Source,$mod.TTMSFNCDataGridMouseOptions).FFixedColumnSizing;
        this.FFixedRowSizing = rtl.as(Source,$mod.TTMSFNCDataGridMouseOptions).FFixedRowSizing;
        this.FColumnDragging = rtl.as(Source,$mod.TTMSFNCDataGridMouseOptions).FColumnDragging;
        this.FRowDragging = rtl.as(Source,$mod.TTMSFNCDataGridMouseOptions).FRowDragging;
        this.FAutoScrolling = rtl.as(Source,$mod.TTMSFNCDataGridMouseOptions).FAutoScrolling;
        this.FAutoDragging = rtl.as(Source,$mod.TTMSFNCDataGridMouseOptions).FAutoDragging;
        this.FAutoScrollingSpeed = rtl.as(Source,$mod.TTMSFNCDataGridMouseOptions).FAutoScrollingSpeed;
        this.FAutoScrollingInterval = rtl.as(Source,$mod.TTMSFNCDataGridMouseOptions).FAutoScrollingInterval;
        this.FTouchScrolling = rtl.as(Source,$mod.TTMSFNCDataGridMouseOptions).FTouchScrolling;
        this.FTouchScrollingSensitivity = rtl.as(Source,$mod.TTMSFNCDataGridMouseOptions).FTouchScrollingSensitivity;
        this.FFixedCellSelection = rtl.refSet(rtl.as(Source,$mod.TTMSFNCDataGridMouseOptions).FFixedCellSelection);
        this.FRowAutoSizeOnDblClick = rtl.as(Source,$mod.TTMSFNCDataGridMouseOptions).FRowAutoSizeOnDblClick;
        this.FColumnAutoSizeOnDblClick = rtl.as(Source,$mod.TTMSFNCDataGridMouseOptions).FColumnAutoSizeOnDblClick;
        this.FWheelScrollKeepSelection = rtl.as(Source,$mod.TTMSFNCDataGridMouseOptions).FWheelScrollKeepSelection;
        this.FColumnSizeMargin = rtl.as(Source,$mod.TTMSFNCDataGridMouseOptions).FColumnSizeMargin;
        this.FClickMargin = rtl.as(Source,$mod.TTMSFNCDataGridMouseOptions).FClickMargin;
        this.FRowSizeMargin = rtl.as(Source,$mod.TTMSFNCDataGridMouseOptions).FRowSizeMargin;
        this.FAutoScrollingSpeedMode = rtl.as(Source,$mod.TTMSFNCDataGridMouseOptions).FAutoScrollingSpeedMode;
        this.FDragMode = rtl.as(Source,$mod.TTMSFNCDataGridMouseOptions).FDragMode;
        this.FColumnDragModes = rtl.refSet(rtl.as(Source,$mod.TTMSFNCDataGridMouseOptions).FColumnDragModes);
        this.FColumnSizingMode = rtl.as(Source,$mod.TTMSFNCDataGridMouseOptions).FColumnSizingMode;
        this.FRowSizingMode = rtl.as(Source,$mod.TTMSFNCDataGridMouseOptions).FRowSizingMode;
      };
    };
    this.Create$1 = function () {
      this.FColumnSizingMode = $mod.TTMSFNCDataGridSizingMode.gszmOneSided;
      this.FRowSizingMode = $mod.TTMSFNCDataGridSizingMode.gszmOneSided;
      this.FTouchScrollingSensitivity = 1;
      this.FTouchScrolling = false;
      this.FDirectEdit = false;
      this.FWheelScrollSize = 4;
      this.FColumnSizing = false;
      this.FRowSizing = false;
      this.FDragMode = $mod.TTMSFNCDataGridDragMode.gdmReorder;
      this.FFixedColumnSizing = false;
      this.FFixedRowSizing = false;
      this.FColumnDragging = false;
      this.FRowDragging = false;
      this.FAutoScrolling = true;
      this.FAutoDragging = true;
      this.FAutoScrollingSpeed = 1;
      this.FAutoScrollingInterval = 100;
      this.FFixedCellSelection = {};
      this.FRowAutoSizeOnDblClick = true;
      this.FColumnAutoSizeOnDblClick = true;
      this.FWheelScrollKeepSelection = true;
      this.FColumnSizeMargin = 6;
      this.FRowSizeMargin = 6;
      this.FClickMargin = 2;
      this.FAutoScrollingSpeedMode = $mod.TTMSFNCDataGridAutoScrollingSpeedMode.gasmPixels;
      this.FColumnDragModes = rtl.createSet($mod.TTMSFNCDataGridColumnDragMode.gcdmReorder,$mod.TTMSFNCDataGridColumnDragMode.gcdmVisualGrouping);
      return this;
    };
    var $r = this.$rtti;
    $r.addProperty("AutoDragging",0,rtl.boolean,"FAutoDragging","FAutoDragging",4,{Default: true});
    $r.addProperty("AutoScrolling",0,rtl.boolean,"FAutoScrolling","FAutoScrolling",4,{Default: true});
    $r.addProperty("AutoScrollingInterval",2,rtl.longint,"FAutoScrollingInterval","SetAutoScrollingInterval",4,{Default: 100});
    $r.addProperty("AutoScrollingSpeed",0,rtl.longint,"FAutoScrollingSpeed","FAutoScrollingSpeed",4,{Default: 1});
    $r.addProperty("AutoScrollingSpeedMode",0,$mod.$rtti["TTMSFNCDataGridAutoScrollingSpeedMode"],"FAutoScrollingSpeedMode","FAutoScrollingSpeedMode",4,{Default: $mod.TTMSFNCDataGridAutoScrollingSpeedMode.gasmPixels});
    $r.addProperty("ClickMargin",2,rtl.longint,"FClickMargin","SetClickMargin",4,{Default: 2});
    $r.addProperty("ColumnAutoSizeOnDblClick",0,rtl.boolean,"FColumnAutoSizeOnDblClick","FColumnAutoSizeOnDblClick",4,{Default: true});
    $r.addProperty("ColumnDragging",0,rtl.boolean,"FColumnDragging","FColumnDragging",4,{Default: false});
    $r.addProperty("ColumnDragModes",2,$mod.$rtti["TTMSFNCDataGridColumnDragModes"],"FColumnDragModes","SetColumnDragModes",4,{Default: rtl.createSet($mod.TTMSFNCDataGridColumnDragMode.gcdmReorder,$mod.TTMSFNCDataGridColumnDragMode.gcdmVisualGrouping)});
    $r.addProperty("ColumnSizeMargin",2,rtl.longint,"FColumnSizeMargin","SetColumnSizeMargin",4,{Default: 6});
    $r.addProperty("ColumnSizing",0,rtl.boolean,"FColumnSizing","FColumnSizing",4,{Default: false});
    $r.addProperty("ColumnSizingMode",0,$mod.$rtti["TTMSFNCDataGridSizingMode"],"FColumnSizingMode","FColumnSizingMode",4,{Default: $mod.TTMSFNCDataGridSizingMode.gszmOneSided});
    $r.addProperty("DirectEdit",0,rtl.boolean,"FDirectEdit","FDirectEdit",4,{Default: false});
    $r.addProperty("DragMode",0,$mod.$rtti["TTMSFNCDataGridDragMode"],"FDragMode","FDragMode",4,{Default: $mod.TTMSFNCDataGridDragMode.gdmReorder});
    $r.addProperty("FixedCellSelection",0,$mod.$rtti["TTMSFNCDataGridFixedCellSelection"],"FFixedCellSelection","FFixedCellSelection",4,{Default: {}});
    $r.addProperty("FixedColumnSizing",0,rtl.boolean,"FFixedColumnSizing","FFixedColumnSizing",4,{Default: false});
    $r.addProperty("FixedRowSizing",0,rtl.boolean,"FFixedRowSizing","FFixedRowSizing",4,{Default: false});
    $r.addProperty("RowAutoSizeOnDblClick",0,rtl.boolean,"FRowAutoSizeOnDblClick","FRowAutoSizeOnDblClick",4,{Default: true});
    $r.addProperty("RowDragging",0,rtl.boolean,"FRowDragging","FRowDragging",4,{Default: false});
    $r.addProperty("RowSizeMargin",2,rtl.longint,"FRowSizeMargin","SetRowSizeMargin",4,{Default: 6});
    $r.addProperty("RowSizing",0,rtl.boolean,"FRowSizing","FRowSizing",4,{Default: false});
    $r.addProperty("RowSizingMode",0,$mod.$rtti["TTMSFNCDataGridSizingMode"],"FRowSizingMode","FRowSizingMode",4,{Default: $mod.TTMSFNCDataGridSizingMode.gszmOneSided});
    $r.addProperty("TouchScrolling",2,rtl.boolean,"FTouchScrolling","SetTouchScrolling",4,{Default: false});
    $r.addProperty("TouchScrollingSensitivity",12,rtl.double,"FTouchScrollingSensitivity","FTouchScrollingSensitivity",4,{stored: "IsTouchScrollingSensitivityStored"});
    $r.addProperty("WheelScrollKeepSelection",2,rtl.boolean,"FWheelScrollKeepSelection","SetWheelScrollKeepSelection",4,{Default: true});
    $r.addProperty("WheelScrollSize",2,rtl.longint,"FWheelScrollSize","SetWheelScrollSize",4,{Default: 4});
  });
  rtl.createClass(this,"TTMSFNCDataGridLookupOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FCaseSensitive = false;
      this.FIncremental = false;
      this.FEnabled = false;
      this.FResetInterval = 0;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridLookupOptions.isPrototypeOf(Source)) {
        this.FCaseSensitive = rtl.as(Source,$mod.TTMSFNCDataGridLookupOptions).FCaseSensitive;
        this.FIncremental = rtl.as(Source,$mod.TTMSFNCDataGridLookupOptions).FIncremental;
        this.FEnabled = rtl.as(Source,$mod.TTMSFNCDataGridLookupOptions).FEnabled;
        this.FResetInterval = rtl.as(Source,$mod.TTMSFNCDataGridLookupOptions).FResetInterval;
      };
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FCaseSensitive = false;
      this.FIncremental = true;
      this.FEnabled = false;
      this.FResetInterval = 4000;
      return this;
    };
    var $r = this.$rtti;
    $r.addProperty("CaseSensitive",0,rtl.boolean,"FCaseSensitive","FCaseSensitive",4,{Default: false});
    $r.addProperty("Enabled",0,rtl.boolean,"FEnabled","FEnabled",4,{Default: false});
    $r.addProperty("Incremental",0,rtl.boolean,"FIncremental","FIncremental",4,{Default: true});
    $r.addProperty("ResetInterval",0,rtl.longint,"FResetInterval","FResetInterval",4,{Default: 4000});
  });
  this.TTMSFNCDataGridAutoCompleteType = {"0": "gactDisabled", gactDisabled: 0, "1": "gactNormal", gactNormal: 1, "2": "gactLookupList", gactLookupList: 2};
  this.$rtti.$Enum("TTMSFNCDataGridAutoCompleteType",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCDataGridAutoCompleteType});
  rtl.createClass(this,"TTMSFNCDataGridAutoCompleteOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FType = 0;
      this.FCaseSensitive = false;
      this.FItems = null;
    };
    this.$final = function () {
      this.FItems = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetItems = function (Value) {
      if (this.FItems !== Value) {
        this.FItems.Assign(Value);
      };
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridAutoCompleteOptions.isPrototypeOf(Source)) {
        this.FType = rtl.as(Source,$mod.TTMSFNCDataGridAutoCompleteOptions).FType;
        this.FItems.Assign(rtl.as(Source,$mod.TTMSFNCDataGridAutoCompleteOptions).FItems);
        this.FCaseSensitive = rtl.as(Source,$mod.TTMSFNCDataGridAutoCompleteOptions).FCaseSensitive;
      };
    };
    this.Create$1 = function () {
      this.FType = $mod.TTMSFNCDataGridAutoCompleteType.gactDisabled;
      this.FCaseSensitive = false;
      this.FItems = pas.Classes.TStringList.$create("Create$1");
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FItems;
        }, set: function (v) {
          this.p.FItems = v;
        }});
      pas.System.TObject.Destroy.call(this);
    };
    var $r = this.$rtti;
    $r.addProperty("Type",0,$mod.$rtti["TTMSFNCDataGridAutoCompleteType"],"FType","FType",4,{Default: $mod.TTMSFNCDataGridAutoCompleteType.gactDisabled});
    $r.addProperty("CaseSensitive",0,rtl.boolean,"FCaseSensitive","FCaseSensitive",4,{Default: false});
    $r.addProperty("Items",2,pas.Classes.$rtti["TStringList"],"FItems","SetItems");
  });
  rtl.createClass(this,"TTMSFNCDataGridEditingOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FEnabled = false;
      this.FDirectDropDown = false;
      this.FAutoComplete = null;
    };
    this.$final = function () {
      this.FAutoComplete = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetAutoComplete = function (Value) {
      if (this.FAutoComplete !== Value) this.FAutoComplete.Assign(Value);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridEditingOptions.isPrototypeOf(Source)) {
        this.FEnabled = rtl.as(Source,$mod.TTMSFNCDataGridEditingOptions).FEnabled;
        this.FDirectDropDown = rtl.as(Source,$mod.TTMSFNCDataGridEditingOptions).FDirectDropDown;
        this.FAutoComplete.Assign(rtl.as(Source,$mod.TTMSFNCDataGridEditingOptions).FAutoComplete);
      };
    };
    this.Create$1 = function () {
      this.FEnabled = true;
      this.FDirectDropDown = false;
      this.FAutoComplete = $mod.TTMSFNCDataGridAutoCompleteOptions.$create("Create$1");
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FAutoComplete;
        }, set: function (v) {
          this.p.FAutoComplete = v;
        }});
      pas.System.TObject.Destroy.call(this);
    };
    var $r = this.$rtti;
    $r.addProperty("Enabled",0,rtl.boolean,"FEnabled","FEnabled",4,{Default: true});
    $r.addProperty("AutoComplete",2,$mod.$rtti["TTMSFNCDataGridAutoCompleteOptions"],"FAutoComplete","SetAutoComplete");
    $r.addProperty("DirectDropDown",0,rtl.boolean,"FDirectDropDown","FDirectDropDown",4,{Default: false});
  });
  rtl.createClass(this,"TTMSFNCDataGridOptions",pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataOptions,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataOptions.$init.call(this);
      this.FBanding = null;
      this.FClipboard = null;
      this.FColumn = null;
      this.FEditing = null;
      this.FKeyboard = null;
      this.FLocalization = null;
      this.FLookup = null;
      this.FMouse = null;
      this.FRow = null;
      this.FSelection = null;
    };
    this.$final = function () {
      this.FBanding = undefined;
      this.FClipboard = undefined;
      this.FColumn = undefined;
      this.FEditing = undefined;
      this.FKeyboard = undefined;
      this.FLocalization = undefined;
      this.FLookup = undefined;
      this.FMouse = undefined;
      this.FRow = undefined;
      this.FSelection = undefined;
      pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataOptions.$final.call(this);
    };
    this.GetIO = function () {
      var Result = null;
      Result = this.FIO;
      return Result;
    };
    this.SetBanding = function (Value) {
      if (this.FBanding !== Value) this.FBanding.Assign(Value);
    };
    this.SetClipboard = function (Value) {
      if (this.FClipboard !== Value) this.FClipboard.Assign(Value);
    };
    this.SetColumn = function (Value) {
      if (this.FColumn !== Value) this.FColumn.Assign(Value);
    };
    this.SetEditing = function (Value) {
      if (this.FEditing !== Value) this.FEditing.Assign(Value);
    };
    this.SetIO$1 = function (Value) {
      this.SetIO(Value);
    };
    this.SetKeyboard = function (Value) {
      if (this.FKeyboard !== Value) this.FKeyboard.Assign(Value);
    };
    this.SetLocalization = function (Value) {
      if (this.FLocalization !== Value) this.FLocalization.Assign(Value);
    };
    this.SetLookup = function (Value) {
      if (this.FLookup !== Value) this.FLookup = Value;
    };
    this.SetMouse = function (Value) {
      if (this.FMouse !== Value) this.FMouse.Assign(Value);
    };
    this.SetRow = function (Value) {
      if (this.FRow !== Value) this.FRow.Assign(Value);
    };
    this.SetSelection = function (Value) {
      if (this.FSelection !== Value) this.FSelection.Assign(Value);
    };
    this.GetIOOptionsClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCDataGridIOOptions;
      return Result;
    };
    this.DoBandingChanged = function (Sender) {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.DoCellsChangedRebuild = function (Sender) {
      if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
    };
    this.DoColumnChangedRebuild = function (Sender) {
      if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
    };
    this.DoRowChangedRebuild = function (Sender) {
      if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
    };
    this.DoSelectionChanged = function (Sender) {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.DoSelectionChangedRebuild = function (Sender) {
      if (this.FOnChangeRebuild != null) this.FOnChangeRebuild(this);
    };
    this.Create$1 = function () {
      pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataOptions.Create$1.call(this);
      this.FColumn = $mod.TTMSFNCDataGridColumnOptions.$create("Create$1");
      this.FColumn.FOnChangeRebuild = rtl.createCallback(this,"DoColumnChangedRebuild");
      this.FRow = $mod.TTMSFNCDataGridRowOptions.$create("Create$1");
      this.FRow.FOnChangeRebuild = rtl.createCallback(this,"DoRowChangedRebuild");
      this.FSelection = $mod.TTMSFNCDataGridSelectionOptions.$create("Create$1");
      this.FSelection.FOnChangeRebuild = rtl.createCallback(this,"DoSelectionChangedRebuild");
      this.FSelection.FOnChange = rtl.createCallback(this,"DoSelectionChanged");
      this.FBanding = $mod.TTMSFNCDataGridBandingOptions.$create("Create$1");
      this.FBanding.FOnChange = rtl.createCallback(this,"DoBandingChanged");
      this.FClipboard = $mod.TTMSFNCDataGridClipboardOptions.$create("Create$1");
      this.FKeyboard = $mod.TTMSFNCDataGridKeyboardOptions.$create("Create$1");
      this.FMouse = $mod.TTMSFNCDataGridMouseOptions.$create("Create$1");
      this.FEditing = $mod.TTMSFNCDataGridEditingOptions.$create("Create$1");
      this.FLookup = $mod.TTMSFNCDataGridLookupOptions.$create("Create$1");
      this.FLocalization = $mod.TTMSFNCDataGridLocalizationOptions.$create("Create$1");
      return this;
    };
    this.Assign = function (Source) {
      pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataOptions.Assign.apply(this,arguments);
      if ($mod.TTMSFNCDataGridOptions.isPrototypeOf(Source)) {
        this.FColumn.Assign(rtl.as(Source,$mod.TTMSFNCDataGridOptions).FColumn);
        this.FRow.Assign(rtl.as(Source,$mod.TTMSFNCDataGridOptions).FRow);
        this.FBanding.Assign(rtl.as(Source,$mod.TTMSFNCDataGridOptions).FBanding);
        this.FClipboard.Assign(rtl.as(Source,$mod.TTMSFNCDataGridOptions).FClipboard);
        this.FKeyboard.Assign(rtl.as(Source,$mod.TTMSFNCDataGridOptions).FKeyboard);
        this.FMouse.Assign(rtl.as(Source,$mod.TTMSFNCDataGridOptions).FMouse);
        this.FEditing.Assign(rtl.as(Source,$mod.TTMSFNCDataGridOptions).FEditing);
        this.FLookup.Assign(rtl.as(Source,$mod.TTMSFNCDataGridOptions).FLookup);
        this.FLocalization.Assign(rtl.as(Source,$mod.TTMSFNCDataGridOptions).FLocalization);
      };
    };
    this.Destroy = function () {
      rtl.free(this,"FLocalization");
      rtl.free(this,"FLookup");
      rtl.free(this,"FEditing");
      rtl.free(this,"FMouse");
      rtl.free(this,"FKeyboard");
      rtl.free(this,"FClipboard");
      rtl.free(this,"FBanding");
      rtl.free(this,"FSelection");
      rtl.free(this,"FColumn");
      rtl.free(this,"FRow");
      pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataOptions.Destroy.call(this);
    };
    var $r = this.$rtti;
    $r.addProperty("Banding",2,$mod.$rtti["TTMSFNCDataGridBandingOptions"],"FBanding","SetBanding");
    $r.addProperty("Clipboard",2,$mod.$rtti["TTMSFNCDataGridClipboardOptions"],"FClipboard","SetClipboard");
    $r.addProperty("Column",2,$mod.$rtti["TTMSFNCDataGridColumnOptions"],"FColumn","SetColumn");
    $r.addProperty("Editing",2,$mod.$rtti["TTMSFNCDataGridEditingOptions"],"FEditing","SetEditing");
    $r.addProperty("IO",3,$mod.$rtti["TTMSFNCDataGridIOOptions"],"GetIO","SetIO$1");
    $r.addProperty("Keyboard",2,$mod.$rtti["TTMSFNCDataGridKeyboardOptions"],"FKeyboard","SetKeyboard");
    $r.addProperty("Localization",2,$mod.$rtti["TTMSFNCDataGridLocalizationOptions"],"FLocalization","SetLocalization");
    $r.addProperty("Lookup",2,$mod.$rtti["TTMSFNCDataGridLookupOptions"],"FLookup","SetLookup");
    $r.addProperty("Mouse",2,$mod.$rtti["TTMSFNCDataGridMouseOptions"],"FMouse","SetMouse");
    $r.addProperty("Row",2,$mod.$rtti["TTMSFNCDataGridRowOptions"],"FRow","SetRow");
    $r.addProperty("Selection",2,$mod.$rtti["TTMSFNCDataGridSelectionOptions"],"FSelection","SetSelection");
  });
  this.TTMSFNCDataGridScrollMode = {"0": "gsmPixelScrolling", gsmPixelScrolling: 0, "1": "gsmCellScrolling", gsmCellScrolling: 1};
  this.$rtti.$Enum("TTMSFNCDataGridScrollMode",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCDataGridScrollMode});
  this.TTMSFNCDataGridScrollUpdate = {"0": "gsuContinuous", gsuContinuous: 0, "1": "gsuOnce", gsuOnce: 1};
  this.$rtti.$Enum("TTMSFNCDataGridScrollUpdate",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCDataGridScrollUpdate});
  this.$rtti.$MethodVar("TTMSFNCDataGridScrollEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["APosition",rtl.double]]), methodkind: 0});
  this.TTMSFNCDataGridInteractionDirection = {"0": "gidNone", gidNone: 0, "1": "gidLeft", gidLeft: 1, "2": "gidRight", gidRight: 2, "3": "gidUp", gidUp: 3, "4": "gidDown", gidDown: 4, "5": "gidLeftUp", gidLeftUp: 5, "6": "gidRightDown", gidRightDown: 6};
  this.$rtti.$Enum("TTMSFNCDataGridInteractionDirection",{minvalue: 0, maxvalue: 6, ordtype: 1, enumtype: this.TTMSFNCDataGridInteractionDirection});
  this.TTMSFNCDataGridSizeMode = {"0": "gsmColumnSizing", gsmColumnSizing: 0, "1": "gsmRowSizing", gsmRowSizing: 1, "2": "gsmPreviousColumnSizing", gsmPreviousColumnSizing: 2, "3": "gsmPreviousRowSizing", gsmPreviousRowSizing: 3};
  this.$rtti.$Enum("TTMSFNCDataGridSizeMode",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TTMSFNCDataGridSizeMode});
  this.TTMSFNCDataGridDraggingMode = {"0": "gdmNone", gdmNone: 0, "1": "gdmRowDragging", gdmRowDragging: 1, "2": "gdmColumnDragging", gdmColumnDragging: 2};
  this.$rtti.$Enum("TTMSFNCDataGridDraggingMode",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCDataGridDraggingMode});
  this.TTMSFNCDataGridDraggingType = {"0": "gdtNone", gdtNone: 0, "1": "gdtSwap", gdtSwap: 1, "2": "gdtInsert", gdtInsert: 2};
  this.$rtti.$Enum("TTMSFNCDataGridDraggingType",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCDataGridDraggingType});
  this.$rtti.$MethodVar("TTMSFNCDataGridRendererUpdateCursorEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACursor",pas["WEBLib.Controls"].$rtti["TCursor"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridRendererIsLoadingEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]]],rtl.boolean), methodkind: 1});
  this.$rtti.$MethodVar("TTMSFNCDataGridRendererIsDestroyingEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]]],rtl.boolean), methodkind: 1});
  this.$rtti.$MethodVar("TTMSFNCDataGridRendererIsDesigntimeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]]],rtl.boolean), methodkind: 1});
  this.$rtti.$MethodVar("TTMSFNCDataGridRendererIsFocusedEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]]],rtl.boolean), methodkind: 1});
  this.$rtti.$Class("TTMSFNCDataGridRenderer");
  rtl.createInterface(this,"ITMSFNCDataGridRendererLink","{DA896D18-6547-430D-A3C8-82A6077CB799}",["GetLink"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("GetLink",1,[],2,$mod.$rtti["TTMSFNCDataGridRenderer"]);
    $r.addProperty("Link",1,$mod.$rtti["TTMSFNCDataGridRenderer"],"GetLink","",2);
  });
  rtl.createInterface(this,"ITMSFNCDataGridExternalScrollBar","{B5E8D2A1-7C9F-4E3B-8A6D-1F2C3D4E5B6A}",["GetValue","SetValue","GetMin","SetMin","GetMax","SetMax","GetPageSize","SetPageSize","GetSmallChange","SetSmallChange","GetLargeChange","SetLargeChange","GetIsVisible","SetIsVisible","GetOnChange","SetOnChange"],pas.System.IUnknown,function () {
    var $r = this.$rtti;
    $r.addMethod("GetValue",1,[],2,rtl.double);
    $r.addMethod("SetValue",0,[["AValue",rtl.double,2]]);
    $r.addMethod("GetMin",1,[],2,rtl.double);
    $r.addMethod("SetMin",0,[["AValue",rtl.double,2]]);
    $r.addMethod("GetMax",1,[],2,rtl.double);
    $r.addMethod("SetMax",0,[["AValue",rtl.double,2]]);
    $r.addMethod("GetPageSize",1,[],2,rtl.double);
    $r.addMethod("SetPageSize",0,[["AValue",rtl.double,2]]);
    $r.addMethod("GetSmallChange",1,[],2,rtl.double);
    $r.addMethod("SetSmallChange",0,[["AValue",rtl.double,2]]);
    $r.addMethod("GetLargeChange",1,[],2,rtl.double);
    $r.addMethod("SetLargeChange",0,[["AValue",rtl.double,2]]);
    $r.addMethod("GetIsVisible",1,[],2,rtl.boolean);
    $r.addMethod("SetIsVisible",0,[["AValue",rtl.boolean,2]]);
    $r.addMethod("GetOnChange",1,[],2,pas["WEBLib.Controls"].$rtti["TNotifyEvent"]);
    $r.addMethod("SetOnChange",0,[["AValue",pas["WEBLib.Controls"].$rtti["TNotifyEvent"],2]]);
    $r.addProperty("Value",3,rtl.double,"GetValue","SetValue",2);
    $r.addProperty("Min",3,rtl.double,"GetMin","SetMin",2);
    $r.addProperty("Max",3,rtl.double,"GetMax","SetMax",2);
    $r.addProperty("PageSize",3,rtl.double,"GetPageSize","SetPageSize",2);
    $r.addProperty("SmallChange",3,rtl.double,"GetSmallChange","SetSmallChange",2);
    $r.addProperty("LargeChange",3,rtl.double,"GetLargeChange","SetLargeChange",2);
    $r.addProperty("Visible",3,rtl.boolean,"GetIsVisible","SetIsVisible",2);
    $r.addProperty("OnChange",3,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"GetOnChange","SetOnChange",2);
  });
  rtl.createClass(this,"TTMSFNCDataGridScrollBar",pas["WEBLib.TMSFNCScrollBar"].TTMSFNCScrollBar,function () {
    this.DrawEx = function (AGraphics) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.$assign(pas["WEBLib.TMSFNCTypes"].ConvertToRectF(this.GetBoundsRect()));
      this.DrawBackground(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r));
      this.Export(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r));
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.$rtti.$ClassRef("TTMSFNCDataGridInplaceEditorClass",{instancetype: pas["WEBLib.Controls"].$rtti["TWinControl"]});
  this.TTMSFNCDataGridInplaceEditorExitMode = {"0": "gieeIgnoreEditing", gieeIgnoreEditing: 0, "1": "gieeStopEditing", gieeStopEditing: 1, "2": "gieeCancelEditing", gieeCancelEditing: 2};
  this.$rtti.$Enum("TTMSFNCDataGridInplaceEditorExitMode",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCDataGridInplaceEditorExitMode});
  this.TTMSFNCDataGridInplaceEditorType = {"0": "getNone", getNone: 0, "1": "getEdit", getEdit: 1, "2": "getNumericEdit", getNumericEdit: 2, "3": "getSignedNumericEdit", getSignedNumericEdit: 3, "4": "getFloatEdit", getFloatEdit: 4, "5": "getSignedFloatEdit", getSignedFloatEdit: 5, "6": "getUppercaseEdit", getUppercaseEdit: 6, "7": "getMixedCaseEdit", getMixedCaseEdit: 7, "8": "getLowerCaseEdit", getLowerCaseEdit: 8, "9": "getMoneyEdit", getMoneyEdit: 9, "10": "getHexEdit", getHexEdit: 10, "11": "getAlphaNumericEdit", getAlphaNumericEdit: 11, "12": "getValidCharsEdit", getValidCharsEdit: 12, "13": "getComboBox", getComboBox: 13, "14": "getComboEdit", getComboEdit: 14, "15": "getSpinBox", getSpinBox: 15, "16": "getDatePicker", getDatePicker: 16, "17": "getColorPicker", getColorPicker: 17, "18": "getTrackBar", getTrackBar: 18, "19": "getMemo", getMemo: 19, "20": "getHTMLEditor", getHTMLEditor: 20, "21": "getCustom", getCustom: 21};
  this.$rtti.$Enum("TTMSFNCDataGridInplaceEditorType",{minvalue: 0, maxvalue: 21, ordtype: 1, enumtype: this.TTMSFNCDataGridInplaceEditorType});
  this.TTMSFNCDataGridInplaceEditorTarget = {"0": "getCellValue", getCellValue: 0, "1": "getFillColor", getFillColor: 1};
  this.$rtti.$Enum("TTMSFNCDataGridInplaceEditorTarget",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCDataGridInplaceEditorTarget});
  this.$rtti.$MethodVar("TTMSFNCDataGridBeforeOpenInplaceEditorEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["AValue",rtl.jsvalue,1],["ACanOpen",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridAfterOpenInplaceEditorEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["AInplaceEditor",pas["WEBLib.Controls"].$rtti["TWinControl"]],["AValue",rtl.jsvalue]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridBeforeSortColumnEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["ACanSort",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridAfterSortColumnEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridBeforeApplyFilterEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["ACondition",rtl.string,1],["ACanApply",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridBeforeApplyAdvancedFilterEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFilterText",rtl.string,1],["ACanApply",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridBeforeInplaceEditorSetValueEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["AInplaceEditor",pas["WEBLib.Controls"].$rtti["TWinControl"]],["AValue",rtl.jsvalue,1],["AHandled",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridBeforeInplaceEditorGetValueEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["AInplaceEditor",pas["WEBLib.Controls"].$rtti["TWinControl"]],["AValue",rtl.jsvalue,1],["AHandled",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridAfterInplaceEditorSetValueEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["AInplaceEditor",pas["WEBLib.Controls"].$rtti["TWinControl"]],["AValue",rtl.jsvalue]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridAfterInplaceEditorGetValueEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["AInplaceEditor",pas["WEBLib.Controls"].$rtti["TWinControl"]],["AValue",rtl.jsvalue]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridAfterApplyFilterEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["ACondition",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridAfterApplyAdvancedFilterEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFilterText",rtl.string]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridRemoveFilterEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridBeforeShowFilterEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["ACanShow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridAfterShowFilterEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridCustomizeFilterPopupEditorEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["AEditor",pas["WEBLib.Controls"].$rtti["TWinControl"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridBeforeClipboardEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACanExecute",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridAfterClipboardEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridBeforeShowFilterDialogEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFilterDialog",pas["WEBLib.TMSFNCFilterDialog"].$rtti["TTMSFNCFilterDialog"]],["ACanShow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridBeforeShowFindDialogEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFindDialog",pas["WEBLib.TMSFNCFindDialog"].$rtti["TTMSFNCFindDialog"]],["ACanShow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridAfterShowFindDialogEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFindDialog",pas["WEBLib.TMSFNCFindDialog"].$rtti["TTMSFNCFindDialog"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridAfterShowFilterDialogEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFilterDialog",pas["WEBLib.TMSFNCFilterDialog"].$rtti["TTMSFNCFilterDialog"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridBeforeShowReplaceDialogEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AReplaceDialog",pas["WEBLib.TMSFNCReplaceDialog"].$rtti["TTMSFNCReplaceDialog"]],["ACanShow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridAfterShowReplaceDialogEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AReplaceDialog",pas["WEBLib.TMSFNCReplaceDialog"].$rtti["TTMSFNCReplaceDialog"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridBeforeDialogFindEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFindText",rtl.string],["AParameters",pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataFindParameters"],1],["ACanFind",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridAfterDialogFindEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFindText",rtl.string],["AResultCell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["AFound",rtl.boolean]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridBeforeDialogReplaceEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFindText",rtl.string],["AReplaceText",rtl.string],["AParameters",pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataFindParameters"],1],["ACanReplace",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridAfterDialogReplaceEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFindText",rtl.string],["AReplaceText",rtl.string],["AReplaceCount",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridBeforeCloseInplaceEditorEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["AInplaceEditor",pas["WEBLib.Controls"].$rtti["TWinControl"]],["ACancelled",rtl.boolean],["AValue",rtl.jsvalue,1],["ACanClose",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridBeforeExitInplaceEditorEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["AInplaceEditor",pas["WEBLib.Controls"].$rtti["TWinControl"]],["AExitMode",this.$rtti["TTMSFNCDataGridInplaceEditorExitMode"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridAfterExitInplaceEditorEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["AExitMode",this.$rtti["TTMSFNCDataGridInplaceEditorExitMode"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridAfterCloseInplaceEditorEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["ACancel",rtl.boolean],["AValue",rtl.jsvalue]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridCellEditValidateDataEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["AInplaceEditor",pas["WEBLib.Controls"].$rtti["TWinControl"]],["AValue",rtl.jsvalue,1],["AValid",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridCellBeforeShowPopupMenuEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["APopupMenu",pas["WEBLib.Menus"].$rtti["TPopupMenu"]],["ACanShow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridCellBeforeNodeExpandEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["ACanExpand",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridCellBeforeNodeCollapseEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["ACanCollapse",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridCellAfterNodeExpandEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridCellAfterNodeCollapseEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridNeedFilterDropDownData",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["AValues",pas.Classes.$rtti["TStrings"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridCellEditGetDataEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["AInplaceEditor",pas["WEBLib.Controls"].$rtti["TWinControl"]],["AValue",rtl.jsvalue,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridCellEditSetDataEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["AInplaceEditor",pas["WEBLib.Controls"].$rtti["TWinControl"]],["AValue",rtl.jsvalue,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridGetInplaceEditorClassEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["AInplaceEditorClass",this.$rtti["TTMSFNCDataGridInplaceEditorClass"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridGetInplaceEditorTypeEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["AInplaceEditorType",this.$rtti["TTMSFNCDataGridInplaceEditorType"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridGetInplaceEditorTargetEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["AInplaceEditorTarget",this.$rtti["TTMSFNCDataGridInplaceEditorTarget"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridGetInplaceEditorRectEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["AInplaceEditor",pas["WEBLib.Controls"].$rtti["TWinControl"]],["AInplaceEditorRect",pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridGetInplaceEditorPropertiesEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["AInplaceEditor",pas["WEBLib.Controls"].$rtti["TWinControl"]],["AInplaceEditorType",this.$rtti["TTMSFNCDataGridInplaceEditorType"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridSelectingCellEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AStartCell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["AEndCell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["AFocusedCell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["ACanSelect",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridSelectCellEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AStartCell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["AEndCell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["AFocusedCell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridCanAppendColumnEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["ACanAppend",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridCanAppendRowEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ARow",rtl.longint],["ACanAppend",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridAppendColumnEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridAppendRowEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ARow",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridCanDeleteColumnEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["ACanDelete",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridCanDeleteRowEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ARow",rtl.longint],["ACanDelete",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridDeleteColumnEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridDeleteRowEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ARow",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridBeforeClearSelectedCellsEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ASelection",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoordRange"]],["ACanClear",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridAfterClearSelectedCellsEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ASelection",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoordRange"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridCanDropColumnEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFromColumn",rtl.longint],["AToColumn",rtl.longint],["ACanDrop",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridCanDropRowEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFromRow",rtl.longint],["AToRow",rtl.longint],["ACanDrop",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridCanDragColumnEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["ACanDrag",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridCanDragRowEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ARow",rtl.longint],["ACanDrag",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridColumnDroppedEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFromColumn",rtl.longint],["AToColumn",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridRowDroppedEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AFromRow",rtl.longint],["AToRow",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridCanInsertColumnEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["ACanInsert",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridCanInsertRowEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ARow",rtl.longint],["ACanInsert",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridInsertColumnEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridInsertRowEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ARow",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridCanSizeColumnEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["ASize",rtl.double,1],["ACanSize",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridCanSizeRowEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ARow",rtl.longint],["ASize",rtl.double,1],["ACanSize",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridSizeColumnEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["ASize",rtl.double]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridSizeRowEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ARow",rtl.longint],["ASize",rtl.double]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridColumnSizedEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AColumn",rtl.longint],["ASize",rtl.double]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridRowSizedEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ARow",rtl.longint],["ASize",rtl.double]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCDataGridEdit",pas["WEBLib.TMSFNCEdit"].TTMSFNCEdit,function () {
    this.Create$1 = function (AOwner) {
      pas["WEBLib.TMSFNCEdit"].TTMSFNCEdit.Create$1.apply(this,arguments);
      this.FAutoClose = false;
      this.SetBorderStyle(pas["WEBLib.Controls"].TBorderStyle.bsNone);
      this.SetShowFocus(false);
      this.SetTabStop(false);
      this.FDoubleBuffered = false;
      return this;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TComboBoxSafe",pas["WEBLib.StdCtrls"].TComboBox,function () {
    this.GetSafeItemIndex = function () {
      var Result = 0;
      Result = this.GetItemIndex();
      return Result;
    };
    this.GetSafeItems = function () {
      var Result = [];
      Result = this.FItems.ToStringArray();
      return Result;
    };
    this.SetSafeItemIndex = function (AValue) {
      this.SetItemIndex(AValue);
    };
    this.SetSafeItems = function (AValue) {
      var I = 0;
      this.FItems.Clear();
      for (var $l = 0, $end = rtl.length(AValue) - 1; $l <= $end; $l++) {
        I = $l;
        this.FItems.Add(AValue[I]);
      };
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.Controls"].TControl.Create$1.apply(this,arguments);
      return this;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCDataGridComboBox",pas["WEBLib.StdCtrls"].TComboBox,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCDataGridComboEdit",pas["WEBLib.StdCtrls"].TComboBox,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCDataGridTrackBar",pas["WEBLib.ExtCtrls"].TTrackBar,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCDataGridColorPicker",pas["WEBLib.TMSFNCColorPicker"].TTMSFNCColorPicker,function () {
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCDataGridMemo",pas["WEBLib.StdCtrls"].TMemo,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCDataGridDatePicker",pas["WEBLib.StdCtrls"].TDateTimePicker,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCDataGridSpinBox",pas["WEBLib.StdCtrls"].TSpinEdit,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCDataGridHTMLEditor",pas["WEBLib.TMSFNCHTMLEditor"].TTMSFNCHTMLEditor,function () {
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createHelper(this,"TTMSFNCDataGridInplaceEditorHelper",null,function () {
    this.GetDataValue = function () {
      var Result = undefined;
      Result = pas["WEBLib.TMSFNCDataGridData"].GetObjectValue(this,"");
      return Result;
    };
    this.SetDataValue = function (Value) {
      pas["WEBLib.TMSFNCDataGridData"].SetObjectValue(this,Value,"");
    };
    this.IsEdit = function () {
      var Result = false;
      Result = $mod.TTMSFNCDataGridEdit.isPrototypeOf(this);
      return Result;
    };
    this.AsEdit = function () {
      var Result = null;
      Result = rtl.as(this,$mod.TTMSFNCDataGridEdit);
      return Result;
    };
    this.IsComboBox = function () {
      var Result = false;
      Result = $mod.TTMSFNCDataGridComboBox.isPrototypeOf(this);
      return Result;
    };
    this.AsComboBox = function () {
      var Result = null;
      Result = rtl.as(this,$mod.TTMSFNCDataGridComboBox);
      return Result;
    };
    this.IsComboEdit = function () {
      var Result = false;
      Result = $mod.TTMSFNCDataGridComboEdit.isPrototypeOf(this);
      return Result;
    };
    this.AsComboEdit = function () {
      var Result = null;
      Result = rtl.as(this,$mod.TTMSFNCDataGridComboEdit);
      return Result;
    };
    this.IsSpinBox = function () {
      var Result = false;
      Result = $mod.TTMSFNCDataGridSpinBox.isPrototypeOf(this);
      return Result;
    };
    this.AsSpinBox = function () {
      var Result = null;
      Result = rtl.as(this,$mod.TTMSFNCDataGridSpinBox);
      return Result;
    };
    this.IsDatePicker = function () {
      var Result = false;
      Result = $mod.TTMSFNCDataGridDatePicker.isPrototypeOf(this);
      return Result;
    };
    this.AsDatePicker = function () {
      var Result = null;
      Result = rtl.as(this,$mod.TTMSFNCDataGridDatePicker);
      return Result;
    };
    this.IsColorPicker = function () {
      var Result = false;
      Result = $mod.TTMSFNCDataGridColorPicker.isPrototypeOf(this);
      return Result;
    };
    this.AsColorPicker = function () {
      var Result = null;
      Result = rtl.as(this,$mod.TTMSFNCDataGridColorPicker);
      return Result;
    };
    this.IsTrackBar = function () {
      var Result = false;
      Result = $mod.TTMSFNCDataGridTrackBar.isPrototypeOf(this);
      return Result;
    };
    this.AsTrackBar = function () {
      var Result = null;
      Result = rtl.as(this,$mod.TTMSFNCDataGridTrackBar);
      return Result;
    };
    this.IsMemo = function () {
      var Result = false;
      Result = $mod.TTMSFNCDataGridMemo.isPrototypeOf(this);
      return Result;
    };
    this.AsMemo = function () {
      var Result = null;
      Result = rtl.as(this,$mod.TTMSFNCDataGridMemo);
      return Result;
    };
    this.IsHTMLEditor = function () {
      var Result = false;
      Result = $mod.TTMSFNCDataGridHTMLEditor.isPrototypeOf(this);
      return Result;
    };
    this.AsHTMLEditor = function () {
      var Result = null;
      Result = rtl.as(this,$mod.TTMSFNCDataGridHTMLEditor);
      return Result;
    };
  });
  rtl.createClass(this,"TTMSFNCDataGridRendererDataAdapter",pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataAdapter,function () {
    this.GetRenderer = function () {
      var Result = null;
      if ((this.GetDataInstance() != null) && $mod.TTMSFNCDataGridRenderer.isPrototypeOf(this.GetDataInstance())) {
        Result = rtl.as(this.GetDataInstance(),$mod.TTMSFNCDataGridRenderer)}
       else Result = null;
      return Result;
    };
    this.SetRenderer = function (Value) {
      this.SetDataInstance(Value);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.TTMSFNCDataGridHilightMode = {"0": "ghmCell", ghmCell: 0, "1": "ghmColumn", ghmColumn: 1, "2": "ghmRow", ghmRow: 2, "3": "ghmGrid", ghmGrid: 3};
  this.$rtti.$Enum("TTMSFNCDataGridHilightMode",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TTMSFNCDataGridHilightMode});
  rtl.recNewT(this,"TTMSFNCDataGridHilightOptions",function () {
    this.IncludeFixed = false;
    this.CaseSensitive = false;
    this.FullText = false;
    this.Mode = 0;
    this.Column = 0;
    this.Row = 0;
    this.$eq = function (b) {
      return (this.IncludeFixed === b.IncludeFixed) && (this.CaseSensitive === b.CaseSensitive) && (this.FullText === b.FullText) && (this.Mode === b.Mode) && (this.Column === b.Column) && (this.Row === b.Row);
    };
    this.$assign = function (s) {
      this.IncludeFixed = s.IncludeFixed;
      this.CaseSensitive = s.CaseSensitive;
      this.FullText = s.FullText;
      this.Mode = s.Mode;
      this.Column = s.Column;
      this.Row = s.Row;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCDataGridHilightOptions",{},this);
    $r.addField("IncludeFixed",rtl.boolean);
    $r.addField("CaseSensitive",rtl.boolean);
    $r.addField("FullText",rtl.boolean);
    $r.addField("Mode",$mod.$rtti["TTMSFNCDataGridHilightMode"]);
    $r.addField("Column",rtl.longint);
    $r.addField("Row",rtl.longint);
  });
  rtl.createClass(this,"TTMSFNCCommentPopup",pas["WEBLib.TMSFNCPopup"].TTMSFNCPopup,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCPopup"].TTMSFNCPopup.$init.call(this);
      this.FCell = null;
    };
    this.$final = function () {
      this.FCell = undefined;
      pas["WEBLib.TMSFNCPopup"].TTMSFNCPopup.$final.call(this);
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.TTMSFNCDataGridColumnSetting = {"0": "gcsAppearance", gcsAppearance: 0, "1": "gcsType", gcsType: 1, "2": "gcsEditor", gcsEditor: 2, "3": "gcsEditorTarget", gcsEditorTarget: 3, "4": "gcsEditorItems", gcsEditorItems: 4, "5": "gcsReadOnly", gcsReadOnly: 5, "6": "gcsFormatting", gcsFormatting: 6, "7": "gcsControlText", gcsControlText: 7, "8": "gcsControlWidth", gcsControlWidth: 8, "9": "gcsControlHeight", gcsControlHeight: 9, "10": "gcsControlAlign", gcsControlAlign: 10, "11": "gcsControlPosition", gcsControlPosition: 11, "12": "gcsControlMargins", gcsControlMargins: 12, "13": "gcsFilterButton", gcsFilterButton: 13, "14": "gcsFilterEditor", gcsFilterEditor: 14, "15": "gcsFilterEditorType", gcsFilterEditorType: 15, "16": "gcsFilterDefaultType", gcsFilterDefaultType: 16};
  this.$rtti.$Enum("TTMSFNCDataGridColumnSetting",{minvalue: 0, maxvalue: 16, ordtype: 1, enumtype: this.TTMSFNCDataGridColumnSetting});
  this.$rtti.$Set("TTMSFNCDataGridColumnSettings",{comptype: this.$rtti["TTMSFNCDataGridColumnSetting"]});
  this.$rtti.$Class("TTMSFNCDataGridColumns");
  rtl.createClass(this,"TTMSFNCDataGridColumnFormatting",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FFormat = "";
      this.FType = 0;
      this.FOnChange = null;
      this.FConvertSettings = pas.SysUtils.TFormatSettings.$new();
      this.FBooleanFalseText = "";
      this.FBooleanTrueText = "";
    };
    this.$final = function () {
      this.FOnChange = undefined;
      this.FConvertSettings = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetFormat = function (Value) {
      if (this.FFormat !== Value) {
        this.FFormat = Value;
        this.UpdateColumnFormatting();
      };
    };
    this.SetType = function (Value) {
      if (this.FType !== Value) {
        this.FType = Value;
        this.UpdateColumnFormatting();
      };
    };
    this.IsFormatStored = function () {
      var Result = false;
      Result = this.FFormat !== "";
      return Result;
    };
    this.IsBooleanFalseTextStored = function () {
      var Result = false;
      Result = this.FBooleanFalseText !== "";
      return Result;
    };
    this.IsBooleanTrueTextStored = function () {
      var Result = false;
      Result = this.FBooleanTrueText !== "";
      return Result;
    };
    this.UpdateColumnFormatting = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Create$1 = function () {
      this.FType = pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFormattingType.gdftDefault;
      this.FFormat = "";
      this.FConvertSettings.$assign(pas.SysUtils.FormatSettings);
      this.FBooleanFalseText = "";
      this.FBooleanTrueText = "";
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridColumnFormatting.isPrototypeOf(Source)) {
        this.FFormat = rtl.as(Source,$mod.TTMSFNCDataGridColumnFormatting).FFormat;
        this.FType = rtl.as(Source,$mod.TTMSFNCDataGridColumnFormatting).FType;
        this.FBooleanFalseText = rtl.as(Source,$mod.TTMSFNCDataGridColumnFormatting).FBooleanFalseText;
        this.FBooleanTrueText = rtl.as(Source,$mod.TTMSFNCDataGridColumnFormatting).FBooleanTrueText;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Type",2,pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataFormattingType"],"FType","SetType",4,{Default: pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFormattingType.gdftDefault});
    $r.addProperty("Format",14,rtl.string,"FFormat","SetFormat",4,{stored: "IsFormatStored"});
    $r.addProperty("BooleanTrueText",12,rtl.string,"FBooleanTrueText","FBooleanTrueText",4,{stored: "IsBooleanTrueTextStored"});
    $r.addProperty("BooleanFalseText",12,rtl.string,"FBooleanFalseText","FBooleanFalseText",4,{stored: "IsBooleanFalseTextStored"});
  });
  rtl.createClass(this,"TTMSFNCDataGridColumnBinding",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FBooleanFalseValue = "";
      this.FBooleanTrueValue = "";
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.IsBooleanFalseValueStored = function () {
      var Result = false;
      Result = this.FBooleanFalseValue !== "False";
      return Result;
    };
    this.IsBooleanTrueValueStored = function () {
      var Result = false;
      Result = this.FBooleanTrueValue !== "True";
      return Result;
    };
    this.SetBooleanFalseValue = function (Value) {
      if (this.FBooleanFalseValue !== "") {
        this.FBooleanFalseValue = Value;
        this.UpdateColumnBinding();
      };
    };
    this.SetBooleanTrueValue = function (Value) {
      if (this.FBooleanTrueValue !== "") {
        this.FBooleanTrueValue = Value;
        this.UpdateColumnBinding();
      };
    };
    this.UpdateColumnBinding = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Create$1 = function () {
      this.FBooleanFalseValue = "False";
      this.FBooleanTrueValue = "True";
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridColumnBinding.isPrototypeOf(Source)) {
        this.FBooleanFalseValue = rtl.as(Source,$mod.TTMSFNCDataGridColumnBinding).FBooleanFalseValue;
        this.FBooleanTrueValue = rtl.as(Source,$mod.TTMSFNCDataGridColumnBinding).FBooleanTrueValue;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("BooleanTrueValue",14,rtl.string,"FBooleanTrueValue","SetBooleanTrueValue",4,{stored: "IsBooleanTrueValueStored"});
    $r.addProperty("BooleanFalseValue",14,rtl.string,"FBooleanFalseValue","SetBooleanFalseValue",4,{stored: "IsBooleanFalseValueStored"});
  });
  this.TTMSFNCDataGridFilterEditorType = {"0": "gfetAutomatic", gfetAutomatic: 0, "1": "gfetString", gfetString: 1, "2": "gfetBoolean", gfetBoolean: 2, "3": "gfetDateTime", gfetDateTime: 3, "4": "gfetFloat", gfetFloat: 4, "5": "gfetNumber", gfetNumber: 5, "6": "gfetCustom", gfetCustom: 6};
  this.$rtti.$Enum("TTMSFNCDataGridFilterEditorType",{minvalue: 0, maxvalue: 6, ordtype: 1, enumtype: this.TTMSFNCDataGridFilterEditorType});
  rtl.createClass(this,"TTMSFNCDataGridColumn",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FAppearance = null;
      this.FBinding = null;
      this.FColumns = null;
      this.FControlAlign = 0;
      this.FControlHeight = 0;
      this.FControlMargins = null;
      this.FControlPosition = 0;
      this.FControlText = "";
      this.FControlWidth = 0;
      this.FDataBoolean = false;
      this.FDataInteger = 0;
      this.FDataObject = null;
      this.FDataPointer = null;
      this.FDataString = "";
      this.FEditor = 0;
      this.FEditorItems = null;
      this.FEditorTarget = 0;
      this.FFilterButton = false;
      this.FFilterDefaultType = 0;
      this.FFilterEditor = false;
      this.FFilterEditorType = 0;
      this.FFormatting = null;
      this.FHeader = "";
      this.FName = "";
      this.FReadOnly = false;
      this.FSettings = {};
      this.FType = 0;
      this.FTypeRange = 0;
      this.FVisible = false;
      this.FWidth = 0.0;
    };
    this.$final = function () {
      this.FAppearance = undefined;
      this.FBinding = undefined;
      this.FColumns = undefined;
      this.FControlMargins = undefined;
      this.FDataObject = undefined;
      this.FEditorItems = undefined;
      this.FFormatting = undefined;
      this.FSettings = undefined;
      pas.Classes.TCollectionItem.$final.call(this);
    };
    this.GetHeader = function () {
      var Result = "";
      Result = this.FHeader;
      if (this.GetRenderer() != null) Result = this.GetRenderer().GetString(this.GetIndex(),0);
      return Result;
    };
    this.GetRenderer = function () {
      var Result = null;
      Result = null;
      if ((this.FCollection != null) && $mod.TTMSFNCDataGridColumns.isPrototypeOf(this.FCollection)) Result = rtl.as(this.FCollection,$mod.TTMSFNCDataGridColumns).FRenderer;
      return Result;
    };
    this.GetValueType = function () {
      var Result = 0;
      var v = undefined;
      Result = pas.System.TTypeKind.tkUnknown;
      if ((this.FColumns != null) && (this.FColumns.FRenderer != null)) {
        v = this.FColumns.FRenderer.GetCell(this.GetIndex(),this.FColumns.FRenderer.FFixedRowCount);
        Result = pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridData.TypeOfValue(v);
      };
      return Result;
    };
    this.GetVisible = function () {
      var Result = false;
      Result = this.FVisible;
      return Result;
    };
    this.GetWidth = function () {
      var Result = 0.0;
      Result = this.FWidth;
      return Result;
    };
    this.IsControlHeightStored = function () {
      var Result = false;
      Result = this.FControlHeight !== -1;
      return Result;
    };
    this.IsControlTextStored = function () {
      var Result = false;
      Result = this.FControlText !== "";
      return Result;
    };
    this.IsControlWidthStored = function () {
      var Result = false;
      Result = this.FControlWidth !== -1;
      return Result;
    };
    this.IsHeaderStored = function () {
      var Result = false;
      Result = this.GetHeader() !== "";
      return Result;
    };
    this.IsWidthStored = function () {
      var Result = false;
      Result = this.GetWidth() !== 75;
      return Result;
    };
    this.SetAppearance = function (Value) {
      this.FAppearance.Assign(Value);
    };
    this.SetBinding = function (Value) {
      if (this.FBinding !== Value) this.FBinding.Assign(Value);
    };
    this.SetControlAlign = function (Value) {
      if (this.FControlAlign !== Value) {
        this.FControlAlign = Value;
        this.UpdateSettings($mod.TTMSFNCDataGridColumnSetting.gcsControlAlign);
        this.UpdateColumn();
      };
    };
    this.SetControlHeight = function (Value) {
      if (this.FControlHeight !== Value) {
        this.FControlHeight = Value;
        this.UpdateSettings($mod.TTMSFNCDataGridColumnSetting.gcsControlHeight);
        this.UpdateColumn();
      };
    };
    this.SetControlMargins = function (Value) {
      if (this.FControlMargins !== Value) {
        this.FControlMargins.Assign(Value);
        this.UpdateSettings($mod.TTMSFNCDataGridColumnSetting.gcsControlMargins);
        this.UpdateColumn();
      };
    };
    this.SetControlPosition = function (Value) {
      if (this.FControlPosition !== Value) {
        this.FControlPosition = Value;
        this.UpdateSettings($mod.TTMSFNCDataGridColumnSetting.gcsControlPosition);
        this.UpdateColumn();
      };
    };
    this.SetControlText = function (Value) {
      if (this.FControlText !== Value) {
        this.FControlText = Value;
        this.UpdateSettings($mod.TTMSFNCDataGridColumnSetting.gcsControlText);
        this.UpdateColumn();
      };
    };
    this.SetControlWidth = function (Value) {
      if (this.FControlWidth !== Value) {
        this.FControlWidth = Value;
        this.UpdateSettings($mod.TTMSFNCDataGridColumnSetting.gcsControlWidth);
        this.UpdateColumn();
      };
    };
    this.SetEditor = function (Value) {
      if (this.FEditor !== Value) {
        this.FEditor = Value;
        if (this.FEditor === $mod.TTMSFNCDataGridInplaceEditorType.getColorPicker) {
          if ((this.FColumns != null) && (this.FColumns.FRenderer != null) && this.FColumns.FRenderer.IsDesigntime()) this.FEditorTarget = $mod.TTMSFNCDataGridInplaceEditorTarget.getFillColor;
          this.UpdateSettings($mod.TTMSFNCDataGridColumnSetting.gcsEditorTarget);
        };
        this.UpdateSettings($mod.TTMSFNCDataGridColumnSetting.gcsEditor);
        this.UpdateColumn();
      };
    };
    this.SetEditorItems = function (Value) {
      this.FEditorItems.Assign(Value);
    };
    this.SetEditorTarget = function (Value) {
      if (this.FEditorTarget !== Value) {
        this.FEditorTarget = Value;
        this.UpdateSettings($mod.TTMSFNCDataGridColumnSetting.gcsEditorTarget);
        this.UpdateColumn();
      };
    };
    this.SetFilterButton = function (Value) {
      if (this.FFilterButton !== Value) {
        this.FFilterButton = Value;
        this.UpdateSettings($mod.TTMSFNCDataGridColumnSetting.gcsFilterButton);
        this.UpdateColumn();
      };
    };
    this.SetFilterDefaultType = function (Value) {
      if (this.FFilterDefaultType !== Value) {
        this.FFilterDefaultType = Value;
        this.UpdateSettings($mod.TTMSFNCDataGridColumnSetting.gcsFilterDefaultType);
        this.UpdateColumn();
      };
    };
    this.SetFilterEditor = function (Value) {
      if (this.FFilterEditor !== Value) {
        this.FFilterEditor = Value;
        this.UpdateSettings($mod.TTMSFNCDataGridColumnSetting.gcsFilterEditor);
        this.UpdateColumn();
      };
    };
    this.SetFilterEditorType = function (Value) {
      if (this.FFilterEditorType !== Value) {
        this.FFilterEditorType = Value;
        this.UpdateSettings($mod.TTMSFNCDataGridColumnSetting.gcsFilterEditorType);
        this.UpdateColumn();
      };
    };
    this.SetFormatting = function (Value) {
      this.FFormatting.Assign(Value);
    };
    this.SetHeader = function (Value) {
      this.FHeader = Value;
      if (this.GetRenderer() != null) this.GetRenderer().SetCell(this.GetIndex(),0,Value);
    };
    this.SetReadOnly = function (Value) {
      if (this.FReadOnly !== Value) {
        this.FReadOnly = Value;
        this.UpdateSettings($mod.TTMSFNCDataGridColumnSetting.gcsReadOnly);
        this.UpdateColumn();
      };
    };
    this.SetSettings = function (Value) {
      if (rtl.neSet(this.FSettings,Value)) {
        this.FSettings = rtl.refSet(Value);
        this.UpdateColumn();
      };
    };
    this.SetType = function (Value) {
      if (this.FType !== Value) {
        this.FType = Value;
        this.UpdateSettings($mod.TTMSFNCDataGridColumnSetting.gcsType);
        this.UpdateColumn();
      };
    };
    this.SetTypeRange = function (Value) {
      if (this.FTypeRange !== Value) {
        this.FTypeRange = Value;
        this.UpdateColumn();
      };
    };
    this.SetVisible = function (Value) {
      this.FVisible = Value;
      if (this.GetRenderer() != null) {
        if (this.FVisible) {
          this.GetRenderer().UnhideColumn(this.GetIndex())}
         else this.GetRenderer().HideColumn(this.GetIndex());
      };
    };
    this.SetWidth = function (Value) {
      this.FWidth = Value;
      if (this.GetRenderer() != null) {
        this.GetRenderer().FBlockWidthChange = true;
        this.GetRenderer().SetColumnWidth(this.GetIndex(),Value);
        this.GetRenderer().FBlockWidthChange = false;
      };
    };
    this.GetDisplayName = function () {
      var Result = "";
      if (this.GetHeader() === "") {
        if (this.FName === "") {
          Result = "Column " + pas.SysUtils.IntToStr(this.GetIndex())}
         else Result = this.FName;
      } else Result = this.GetHeader();
      return Result;
    };
    this.AppearanceChanged = function (Sender) {
      this.UpdateSettings($mod.TTMSFNCDataGridColumnSetting.gcsAppearance);
      this.UpdateColumn();
    };
    this.BindingChanged = function (Sender) {
      this.UpdateColumn();
    };
    this.ClearColumn = function () {
      if ((this.FColumns != null) && (this.FColumns.FRenderer != null) && !this.FColumns.FRenderer.GetIsDestroying()) this.FColumns.ClearColumn(this.GetIndex());
    };
    this.EditorItemsChanged = function (Sender) {
      this.UpdateSettings($mod.TTMSFNCDataGridColumnSetting.gcsEditorItems);
    };
    this.FormattingChanged = function (Sender) {
      this.UpdateSettings($mod.TTMSFNCDataGridColumnSetting.gcsFormatting);
      this.UpdateColumn();
    };
    this.MarginsChanged = function (Sender) {
      this.UpdateSettings($mod.TTMSFNCDataGridColumnSetting.gcsControlMargins);
      this.UpdateColumn();
    };
    this.UpdateColumn = function () {
      if (this.FColumns != null) this.FColumns.UpdateColumns();
    };
    this.SetIndex = function (Value) {
      if (this.GetRenderer() != null) {
        if ((this.GetRenderer().FAdapter != null) && $mod.TTMSFNCDataGridRendererDataAdapter.isPrototypeOf(this.GetRenderer().FAdapter)) {
          rtl.as(this.GetRenderer().FAdapter,$mod.TTMSFNCDataGridRendererDataAdapter).MoveColumn(this.GetIndex(),Value)}
         else this.GetRenderer().MoveColumn(this.GetIndex(),Value);
      };
    };
    this.UpdateSettings = function (ASetting) {
      if ((this.FColumns != null) && (this.FColumns.FRenderer != null) && this.FColumns.FRenderer.IsDesigntime() && !this.FColumns.FRenderer.FIsStyling) this.FSettings = rtl.unionSet(this.FSettings,rtl.createSet(ASetting));
    };
    this.Create$1 = function (ACollection) {
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      this.FColumns = null;
      if ($mod.TTMSFNCDataGridColumns.isPrototypeOf(this.FCollection)) this.FColumns = rtl.as(this.FCollection,$mod.TTMSFNCDataGridColumns);
      this.FTypeRange = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemTypeRange.gcirAll;
      this.FFilterDefaultType = pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilterType.gftEqual;
      this.FVisible = true;
      this.FFilterButton = true;
      this.FFilterEditor = false;
      this.FFilterEditorType = $mod.TTMSFNCDataGridFilterEditorType.gfetAutomatic;
      this.FFormatting = $mod.TTMSFNCDataGridColumnFormatting.$create("Create$1");
      this.FFormatting.FOnChange = rtl.createCallback(this,"FormattingChanged");
      this.FBinding = $mod.TTMSFNCDataGridColumnBinding.$create("Create$1");
      this.FBinding.FOnChange = rtl.createCallback(this,"BindingChanged");
      this.FAppearance = $mod.TTMSFNCDataGridCellAppearance.$create("Create$1");
      if (this.FColumns != null) this.FAppearance.Assign(this.FColumns.FRenderer.FCellAppearance);
      this.FAppearance.FOnChange = rtl.createCallback(this,"AppearanceChanged");
      this.FSettings = {};
      this.FType = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitNormal;
      this.FEditor = $mod.TTMSFNCDataGridInplaceEditorType.getEdit;
      this.FEditorTarget = $mod.TTMSFNCDataGridInplaceEditorTarget.getCellValue;
      this.FEditorItems = pas.Classes.TStringList.$create("Create$1");
      this.FEditorItems.FOnChange = rtl.createCallback(this,"EditorItemsChanged");
      this.FControlText = "";
      this.FControlWidth = -1;
      this.FControlHeight = -1;
      this.FControlMargins = pas["WEBLib.TMSFNCTypes"].TTMSFNCMargins.$create("Create$1");
      this.FControlMargins.FOnChange = rtl.createCallback(this,"MarginsChanged");
      if (this.GetRenderer() != null) {
        this.FWidth = this.GetRenderer().GetColumnWidth(this.GetIndex())}
       else this.FWidth = 75;
      this.FHeader = "";
      this.FControlAlign = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellControlAlign.gcaNone;
      this.FControlPosition = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellControlPosition.gcpCenterRight;
      this.UpdateColumn();
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FBinding");
      rtl.free(this,"FFormatting");
      rtl.free(this,"FAppearance");
      rtl.free(this,"FEditorItems");
      rtl.free(this,"FControlMargins");
      this.ClearColumn();
      pas.Classes.TCollectionItem.Destroy.call(this);
      this.UpdateColumn();
      this.FColumns = null;
    };
    this.AddSetting = function (ASetting) {
      this.SetSettings(rtl.unionSet(this.FSettings,rtl.createSet(ASetting)));
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridColumn.isPrototypeOf(Source)) {
        this.FAppearance.Assign(rtl.as(Source,$mod.TTMSFNCDataGridColumn).FAppearance);
        this.FSettings = rtl.refSet(rtl.as(Source,$mod.TTMSFNCDataGridColumn).FSettings);
        this.FType = rtl.as(Source,$mod.TTMSFNCDataGridColumn).FType;
        this.FEditor = rtl.as(Source,$mod.TTMSFNCDataGridColumn).FEditor;
        this.FEditorTarget = rtl.as(Source,$mod.TTMSFNCDataGridColumn).FEditorTarget;
        this.FFormatting.Assign(rtl.as(Source,$mod.TTMSFNCDataGridColumn).FFormatting);
        this.FBinding.Assign(rtl.as(Source,$mod.TTMSFNCDataGridColumn).FBinding);
        this.FEditorItems.Assign(rtl.as(Source,$mod.TTMSFNCDataGridColumn).FEditorItems);
        this.FReadOnly = rtl.as(Source,$mod.TTMSFNCDataGridColumn).FReadOnly;
        this.FTypeRange = rtl.as(Source,$mod.TTMSFNCDataGridColumn).FTypeRange;
        this.FControlText = rtl.as(Source,$mod.TTMSFNCDataGridColumn).FControlText;
        this.FControlWidth = rtl.as(Source,$mod.TTMSFNCDataGridColumn).FControlWidth;
        this.FControlHeight = rtl.as(Source,$mod.TTMSFNCDataGridColumn).FControlHeight;
        this.FControlAlign = rtl.as(Source,$mod.TTMSFNCDataGridColumn).FControlAlign;
        this.FControlPosition = rtl.as(Source,$mod.TTMSFNCDataGridColumn).FControlPosition;
        this.FControlMargins.Assign(rtl.as(Source,$mod.TTMSFNCDataGridColumn).FControlMargins);
        this.FFilterButton = rtl.as(Source,$mod.TTMSFNCDataGridColumn).FFilterButton;
        this.FFilterEditor = rtl.as(Source,$mod.TTMSFNCDataGridColumn).FFilterEditor;
        this.FFilterEditorType = rtl.as(Source,$mod.TTMSFNCDataGridColumn).FFilterEditorType;
        this.FFilterDefaultType = rtl.as(Source,$mod.TTMSFNCDataGridColumn).FFilterDefaultType;
        this.FName = rtl.as(Source,$mod.TTMSFNCDataGridColumn).FName;
        this.FWidth = rtl.as(Source,$mod.TTMSFNCDataGridColumn).FWidth;
        this.FHeader = rtl.as(Source,$mod.TTMSFNCDataGridColumn).FHeader;
        this.FVisible = rtl.as(Source,$mod.TTMSFNCDataGridColumn).FVisible;
      };
    };
    this.RemoveSetting = function (ASetting) {
      this.SetSettings(rtl.diffSet(this.FSettings,rtl.createSet(ASetting)));
    };
    var $r = this.$rtti;
    $r.addProperty("ReadOnly",2,rtl.boolean,"FReadOnly","SetReadOnly",4,{Default: false});
    $r.addProperty("Type",2,pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCellItemType"],"FType","SetType",4,{Default: pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitNormal});
    $r.addProperty("Appearance",2,$mod.$rtti["TTMSFNCDataGridCellAppearance"],"FAppearance","SetAppearance");
    $r.addProperty("Binding",2,$mod.$rtti["TTMSFNCDataGridColumnBinding"],"FBinding","SetBinding");
    $r.addProperty("ControlAlign",2,pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCellControlAlign"],"FControlAlign","SetControlAlign",4,{Default: pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellControlAlign.gcaNone});
    $r.addProperty("ControlHeight",14,rtl.longint,"FControlHeight","SetControlHeight",4,{stored: "IsControlHeightStored"});
    $r.addProperty("ControlMargins",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCMargins"],"FControlMargins","SetControlMargins");
    $r.addProperty("ControlPosition",2,pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCellControlPosition"],"FControlPosition","SetControlPosition",4,{Default: pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellControlPosition.gcpCenterRight});
    $r.addProperty("ControlText",14,rtl.string,"FControlText","SetControlText",4,{stored: "IsControlTextStored"});
    $r.addProperty("ControlWidth",14,rtl.longint,"FControlWidth","SetControlWidth",4,{stored: "IsControlWidthStored"});
    $r.addProperty("Editor",2,$mod.$rtti["TTMSFNCDataGridInplaceEditorType"],"FEditor","SetEditor",4,{Default: $mod.TTMSFNCDataGridInplaceEditorType.getEdit});
    $r.addProperty("EditorItems",2,pas.Classes.$rtti["TStringList"],"FEditorItems","SetEditorItems");
    $r.addProperty("EditorTarget",2,$mod.$rtti["TTMSFNCDataGridInplaceEditorTarget"],"FEditorTarget","SetEditorTarget",4,{Default: $mod.TTMSFNCDataGridInplaceEditorTarget.getCellValue});
    $r.addProperty("FilterButton",2,rtl.boolean,"FFilterButton","SetFilterButton",4,{Default: true});
    $r.addProperty("FilterDefaultType",2,pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataFilterType"],"FFilterDefaultType","SetFilterDefaultType",4,{Default: pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilterType.gftEqual});
    $r.addProperty("FilterEditor",2,rtl.boolean,"FFilterEditor","SetFilterEditor",4,{Default: false});
    $r.addProperty("FilterEditorType",2,$mod.$rtti["TTMSFNCDataGridFilterEditorType"],"FFilterEditorType","SetFilterEditorType",4,{Default: $mod.TTMSFNCDataGridFilterEditorType.gfetAutomatic});
    $r.addProperty("Formatting",2,$mod.$rtti["TTMSFNCDataGridColumnFormatting"],"FFormatting","SetFormatting");
    $r.addProperty("Header",15,rtl.string,"GetHeader","SetHeader",4,{stored: "IsHeaderStored"});
    $r.addProperty("Name",0,rtl.string,"FName","FName");
    $r.addProperty("Settings",2,$mod.$rtti["TTMSFNCDataGridColumnSettings"],"FSettings","SetSettings",4,{Default: {}});
    $r.addProperty("TypeRange",2,pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCellItemTypeRange"],"FTypeRange","SetTypeRange",4,{Default: pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemTypeRange.gcirAll});
    $r.addProperty("ValueType",1,pas.System.$rtti["TTypeKind"],"GetValueType","");
    $r.addProperty("Visible",3,rtl.boolean,"GetVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",15,rtl.double,"GetWidth","SetWidth",4,{stored: "IsWidthStored"});
  });
  this.$rtti.$ClassRef("TTMSFNCDataGridColumnClass",{instancetype: this.$rtti["TTMSFNCDataGridColumn"]});
  rtl.createClass(this,"TTMSFNCDataGridColumns",pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$init.call(this);
      this.FRenderer = null;
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FRenderer = undefined;
      this.FOnChange = undefined;
      pas["WEBLib.TMSFNCTypes"].TTMSFNCOwnedCollection.$final.call(this);
    };
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      this.SetItem(Index,Value);
    };
    this.UpdateColumns = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.ClearColumn = function (AIndex) {
      if (this.FRenderer != null) {
        this.FRenderer.ClearDataForColumn(AIndex,pas["WEBLib.TMSFNCDataGridCore"].AllRowTypes);
        this.FRenderer.ClearColumnInfo(AIndex);
      };
    };
    this.GetColumnClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCDataGridColumn;
      return Result;
    };
    this.ColumnByName = function (AName) {
      var Result = null;
      var i = 0;
      Result = null;
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.GetItem$1(i).FName === AName) {
          Result = this.GetItem$1(i);
          break;
        };
      };
      return Result;
    };
    this.ColumnByHeader = function (AHeader) {
      var Result = null;
      var i = 0;
      Result = null;
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.GetItem$1(i).GetHeader() === AHeader) {
          Result = this.GetItem$1(i);
          break;
        };
      };
      return Result;
    };
    this.Create$3 = function (AHost, ARenderer) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AHost,this.GetColumnClass());
      this.FRenderer = ARenderer;
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      return Result;
    };
  });
  this.$rtti.$ClassRef("TTMSFNCDataGridColumnsClass",{instancetype: this.$rtti["TTMSFNCDataGridColumns"]});
  this.TTMSFNCDataGridAutoSizeMode = {"0": "gamVisibleCells", gamVisibleCells: 0, "1": "gamAllCells", gamAllCells: 1};
  this.$rtti.$Enum("TTMSFNCDataGridAutoSizeMode",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCDataGridAutoSizeMode});
  this.$rtti.$RefToProcVar("TTMSFNCDataGridRendererExportNewPageCallback",{procsig: rtl.newTIProcSig([])});
  this.$rtti.$RefToProcVar("TTMSFNCDataGridRendererExportGetPageIndexCallback",{procsig: rtl.newTIProcSig([],rtl.longint)});
  rtl.createClass(this,"TTMSFNCDataGridCellControlWrapperListItem",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FKey = "";
      this.FWrapper = null;
    };
    this.$final = function () {
      this.FWrapper = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function (AKey, AWrapper) {
      this.FKey = AKey;
      this.FWrapper = AWrapper;
      return this;
    };
  });
  rtl.createClass(this,"TTMSFNCDataGridCellControlWrapperList",pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem,function () {
    this.GetKeys = function () {
      var Result = [];
      var I = 0;
      Result = rtl.arraySetLength(Result,"",this.FLength);
      for (var $l = 0, $end = this.FLength - 1; $l <= $end; $l++) {
        I = $l;
        Result[I] = this.GetItem(I).FKey;
      };
      return Result;
    };
    this.TryGetValue = function (AKey, AWrapper) {
      var Result = false;
      var I = 0;
      Result = false;
      for (var $l = 0, $end = this.FLength - 1; $l <= $end; $l++) {
        I = $l;
        if (AKey === this.GetItem(I).FKey) {
          AWrapper.set(this.GetItem(I).FWrapper);
          Result = true;
          break;
        };
      };
      return Result;
    };
    this.AddOrSetValue = function (AKey, AWrapper) {
      var I = 0;
      var it = null;
      it = null;
      for (var $l = 0, $end = this.FLength - 1; $l <= $end; $l++) {
        I = $l;
        if (AKey === this.GetItem(I).FKey) {
          it = this.GetItem(I);
          break;
        };
      };
      if (!(it != null)) {
        it = $mod.TTMSFNCDataGridCellControlWrapperListItem.$create("Create$1",[AKey,AWrapper]);
        this.Add(it);
      } else it.FWrapper = AWrapper;
    };
    this.Remove$1 = function (AKey) {
      var I = 0;
      var it = 0;
      it = -1;
      for (var $l = 0, $end = this.FLength - 1; $l <= $end; $l++) {
        I = $l;
        if (AKey === this.GetItem(I).FKey) {
          it = I;
          break;
        };
      };
      if (it !== -1) this.Delete(it);
    };
  });
  this.$rtti.$MethodVar("TTMSFNCDataGridCreateCustomFilterEditorEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]]],pas["WEBLib.Controls"].$rtti["TWinControl"]), methodkind: 1});
  this.$rtti.$MethodVar("TTMSFNCDataGridBeforeCreateFilterEditorEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["ACanCreate",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridAfterCreateFilterEditorEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACell",pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"]],["AEditor",pas["WEBLib.Controls"].$rtti["TWinControl"]]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCDataGridFilterPanel",pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$init.call(this);
      this.FAutoHideControls = false;
      this.FBlockChange = false;
      this.FCell = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      this.FClearButton = null;
      this.FEditor = null;
      this.FEditorTime = 0;
      this.FEditorTimer = null;
      this.FRenderer = null;
      this.FType = 0;
      this.FTypeButton = null;
      this.FTypeListBox = null;
    };
    this.$final = function () {
      this.FCell = undefined;
      this.FClearButton = undefined;
      this.FEditor = undefined;
      this.FEditorTimer = undefined;
      this.FRenderer = undefined;
      this.FTypeButton = undefined;
      this.FTypeListBox = undefined;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$final.call(this);
    };
    this.GetEditorTimer = function () {
      var Result = null;
      if (!(this.FEditorTimer != null)) {
        this.FEditorTimer = pas["WEBLib.ExtCtrls"].TTimer.$create("Create$1",[null]);
        this.FEditorTimer.SetEnabled(false);
        this.FEditorTimer.SetInterval(1);
        this.FEditorTimer.FOnTimer = rtl.createCallback(this,"DoEditorTimerChanged");
      };
      Result = this.FEditorTimer;
      return Result;
    };
    this.GetDefaultFilterType = function (AType) {
      var Result = 0;
      var cl = null;
      if (this.FRenderer != null) {
        cl = this.FRenderer.GetColumn(this.FCell.GetColumn());
        if ((cl != null) && ($mod.TTMSFNCDataGridColumnSetting.gcsFilterDefaultType in cl.FSettings)) {
          Result = cl.FFilterDefaultType;
          return Result;
        };
      };
      var $tmp = AType;
      if (($tmp === $mod.TTMSFNCDataGridFilterEditorType.gfetString) || ($tmp === $mod.TTMSFNCDataGridFilterEditorType.gfetCustom)) {
        Result = pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilterType.gftContains}
       else if (($tmp === $mod.TTMSFNCDataGridFilterEditorType.gfetBoolean) || ($tmp === $mod.TTMSFNCDataGridFilterEditorType.gfetDateTime) || ($tmp === $mod.TTMSFNCDataGridFilterEditorType.gfetFloat) || ($tmp === $mod.TTMSFNCDataGridFilterEditorType.gfetNumber)) {
        Result = pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilterType.gftEqual}
       else {
        Result = pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilterType.gftContains;
      };
      return Result;
    };
    this.ItemIndexByType = function (AType) {
      var Result = 0;
      var I = 0;
      var d = 0;
      Result = -1;
      for (var $l = 0, $end = this.FTypeListBox.FItems.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        d = this.FTypeListBox.FItems.GetItem$1(I).FDataInteger;
        if (d === AType) {
          Result = I;
          break;
        };
      };
      return Result;
    };
    this.DoClearClick = function (Sender) {
      if (!(this.FRenderer != null)) return;
      if (this.FEditor != null) {
        this.FBlockChange = true;
        if (pas["WEBLib.TMSFNCEdit"].TTMSFNCEdit.isPrototypeOf(this.FEditor)) {
          rtl.as(this.FEditor,pas["WEBLib.TMSFNCEdit"].TTMSFNCEdit).SetT("")}
         else if (pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCheckBox.isPrototypeOf(this.FEditor)) {
          rtl.as(this.FEditor,pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCheckBox).SetChecked(false);
        } else if ($mod.TTMSFNCDataGridDatePicker.isPrototypeOf(this.FEditor)) {
          rtl.as(this.FEditor,$mod.TTMSFNCDataGridDatePicker).SetDate(pas.SysUtils.Now());
        } else if ($mod.TTMSFNCDataGridSpinBox.isPrototypeOf(this.FEditor)) {
          rtl.as(this.FEditor,$mod.TTMSFNCDataGridSpinBox).SetText("");
        };
        this.FBlockChange = false;
      };
      this.FRenderer.DoFilterClearClick(Sender);
    };
    this.DoEditorChange = function (Sender) {
      if (this.FBlockChange) return;
      this.FEditorTime = 0;
      this.GetEditorTimer().SetEnabled(true);
    };
    this.DoEditorTimerChanged = function (Sender) {
      var v = undefined;
      var fdt = 0;
      this.FEditorTime += 1;
      if (this.FEditorTime >= 40) {
        this.FEditorTimer.SetEnabled(false);
        if (!(this.FRenderer != null) || !(this.FEditor != null) || this.FBlockChange) return;
        if ($mod.TTMSFNCDataGridSpinBox.isPrototypeOf(this.FEditor)) {
          v = pas["WEBLib.TMSFNCDataGridData"].GetObjectValue(this.FEditor,"Value");
        } else v = pas["WEBLib.TMSFNCDataGridData"].GetObjectValue(this.FEditor,"");
        fdt = pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilterType.gftContains;
        if ((this.FTypeButton != null) && this.FTypeButton.FVisible && (this.FTypeListBox.GetItemIndex() !== -1)) fdt = this.FTypeListBox.FItems.GetItem$1(this.FTypeListBox.GetItemIndex()).FDataInteger;
        this.FRenderer.ApplyFilterFromValue(this.FCell.GetColumn(),v,fdt);
      };
    };
    this.DoTypeButtonClick = function (Sender) {
      if (this.FTypeButton != null) this.FTypeButton.DropDown();
    };
    this.DoTypeListBoxSelected = function (Sender, AItem) {
      if (this.FTypeButton != null) this.FTypeButton.CloseDropDown();
      this.DoEditorChange(Sender);
    };
    this.Notification = function (AComponent, Operation) {
      pas["WEBLib.Menus"].TWebCustomControl.Notification.apply(this,arguments);
      if ((Operation === pas.Classes.TOperation.opRemove) && !(pas.Classes.TComponentStateItem.csDestroying in this.FComponentState)) {
        if (AComponent === this.FClearButton) this.FClearButton = null;
        if (AComponent === this.FTypeButton) this.FTypeButton = null;
        if (AComponent === this.FEditor) this.FEditor = null;
        if (AComponent === this.FTypeListBox) this.FTypeListBox = null;
      };
    };
    this.UpdateControlAfterResize = function () {
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.UpdateControlAfterResize.call(this);
      try {
        if (this.FTypeButton != null) {
          this.FTypeButton.SetLeft(5);
          this.FTypeButton.SetTop(Math.round((this.GetHeight() - this.FTypeButton.GetHeight()) / 2));
        };
        if (this.FClearButton != null) {
          this.FClearButton.SetLeft(this.GetWidth() - this.FClearButton.GetWidth() - 5);
          this.FClearButton.SetTop(Math.round((this.GetHeight() - this.FClearButton.GetHeight()) / 2));
        };
        if (this.FEditor != null) {
          this.FEditor.SetLeft(5);
          this.FEditor.SetTop(rtl.trunc((this.GetHeight() - this.FEditor.GetHeight()) / 2));
          if ((this.FClearButton != null) && this.FAutoHideControls) this.FClearButton.SetVisible((this.GetWidth() - this.FClearButton.GetWidth() - 15) > 85);
          if ((this.FClearButton != null) && this.FClearButton.FVisible) {
            this.FEditor.SetWidth(this.GetWidth() - this.FClearButton.GetWidth() - 15)}
           else this.FEditor.SetWidth(this.GetWidth() - 5);
          if ((this.FTypeButton != null) && this.FAutoHideControls) this.FTypeButton.SetVisible(this.FEditor.GetWidth() > 85);
          if ((this.FTypeButton != null) && this.FTypeButton.FVisible) {
            this.FEditor.SetLeft(this.FEditor.GetLeft() + this.FTypeButton.GetWidth() + 5);
            this.FEditor.SetWidth(this.FEditor.GetWidth() - this.FTypeButton.GetWidth() - 5);
          };
        };
      } finally {
      };
    };
    this.Create$7 = function (AOwner, ARenderer, ACell, AType) {
      var it = null;
      var I = 0;
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Create$1.call(this,AOwner);
      this.DisableBackground();
      this.SetTabStop(false);
      this.FAutoHideControls = true;
      this.FCell.$assign(ACell);
      this.FType = AType;
      this.FRenderer = ARenderer;
      this.FTypeButton = pas["WEBLib.TMSFNCToolBar"].TTMSFNCToolBarButton.$create("Create$1",[this]);
      this.FTypeButton.FStored = false;
      this.FTypeButton.SetParent(this);
      this.FTypeButton.SetTabStop(false);
      this.FTypeButton.FAppearance.SetFlatStyle(true);
      this.FTypeButton.SetWidth(25);
      this.FTypeButton.SetHeight(22);
      this.FTypeButton.SetText("");
      this.FTypeButton.SetHorizontalTextAlign(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading);
      this.FTypeButton.FAppearance.FNormalFill.SetColor(16777215);
      this.FTypeButton.FAppearance.FNormalStroke.SetColor(16777215);
      this.FTypeButton.SetShowHint(true);
      if (this.FRenderer != null) {
        this.FTypeButton.SetHint(this.FRenderer.GetOptions().FLocalization.FFilterTypeButtonHint);
        this.FTypeButton.FBitmaps.AddBitmap(this.FRenderer.FIcons.GetActiveFilterTypeIcon(),1.0);
      };
      this.FTypeButton.SetAdaptToStyle(this.GetAdaptToStyle());
      this.FTypeButton.FDataInteger = this.FCell.GetColumn();
      this.FTypeListBox = pas["WEBLib.TMSFNCListBox"].TTMSFNCListBox.$create("Create$1",[this]);
      this.FTypeListBox.FOnItemSelected = rtl.createCallback(this,"DoTypeListBoxSelected");
      var $tmp = AType;
      if ($tmp === $mod.TTMSFNCDataGridFilterEditorType.gfetString) {
        for (I = 0; I <= 7; I++) {
          it = this.FTypeListBox.FItems.Add$1();
          it.FDataInteger = I;
          if (this.FRenderer != null) it.SetText(this.FRenderer.GetFilterTypeName(I));
        };
      } else if (($tmp === $mod.TTMSFNCDataGridFilterEditorType.gfetNumber) || ($tmp === $mod.TTMSFNCDataGridFilterEditorType.gfetFloat) || ($tmp === $mod.TTMSFNCDataGridFilterEditorType.gfetDateTime) || ($tmp === $mod.TTMSFNCDataGridFilterEditorType.gfetBoolean)) {
        for (I = 4; I <= 11; I++) {
          it = this.FTypeListBox.FItems.Add$1();
          it.FDataInteger = I;
          if (this.FRenderer != null) it.SetText(this.FRenderer.GetFilterTypeName(I));
        };
      } else if ($tmp === $mod.TTMSFNCDataGridFilterEditorType.gfetCustom) {
        for (I = 0; I <= 11; I++) {
          it = this.FTypeListBox.FItems.Add$1();
          it.FDataInteger = I;
          if (this.FRenderer != null) it.SetText(this.FRenderer.GetFilterTypeName(I));
        };
      };
      this.FTypeListBox.SetItemIndex(this.ItemIndexByType(this.GetDefaultFilterType(this.FType)));
      this.FTypeListBox.SetHeight(Math.round(this.FTypeListBox.FItems.GetCount() * this.FTypeListBox.FItemsAppearance.GetFixedHeight()) + 4);
      this.FTypeListBox.SetWidth(150);
      this.FTypeButton.SetDropDownControl(this.FTypeListBox);
      this.FTypeButton.FOnClick = rtl.createCallback(this,"DoTypeButtonClick");
      this.FTypeListBox.SetAdaptToStyle(this.GetAdaptToStyle());
      this.FTypeListBox.FDataInteger = this.FCell.GetColumn();
      this.FClearButton = pas["WEBLib.TMSFNCToolBar"].TTMSFNCToolBarButton.$create("Create$1",[this]);
      this.FClearButton.FStored = false;
      this.FClearButton.SetTabStop(false);
      this.FClearButton.SetParent(this);
      this.FClearButton.FAppearance.SetFlatStyle(true);
      this.FClearButton.SetWidth(25);
      this.FClearButton.SetHeight(22);
      this.FClearButton.SetText("");
      this.FClearButton.SetHorizontalTextAlign(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading);
      this.FClearButton.FAppearance.FNormalFill.SetColor(16777215);
      this.FClearButton.FAppearance.FNormalStroke.SetColor(16777215);
      this.FClearButton.SetShowHint(true);
      if (this.FRenderer != null) {
        this.FClearButton.FBitmaps.AddBitmap(this.FRenderer.FIcons.GetActiveFilterClearIcon(),1.0);
        this.FClearButton.SetHint(this.FRenderer.GetOptions().FLocalization.FFilterClearButtonHint);
      };
      if (this.FRenderer != null) this.FClearButton.FOnClick = rtl.createCallback(this,"DoClearClick");
      this.FClearButton.SetAdaptToStyle(this.GetAdaptToStyle());
      this.FClearButton.FDataInteger = this.FCell.GetColumn();
      var $tmp1 = AType;
      if ($tmp1 === $mod.TTMSFNCDataGridFilterEditorType.gfetString) {
        this.FEditor = pas["WEBLib.TMSFNCEdit"].TTMSFNCEdit.$create("Create$1",[this])}
       else if ($tmp1 === $mod.TTMSFNCDataGridFilterEditorType.gfetBoolean) {
        this.FEditor = pas["WEBLib.StdCtrls"].TCheckBox.$create("Create$1",[this]);
        rtl.as(this.FEditor,pas["WEBLib.StdCtrls"].TCheckBox).SetWidth(20);
      } else if ($tmp1 === $mod.TTMSFNCDataGridFilterEditorType.gfetDateTime) {
        this.FEditor = $mod.TTMSFNCDataGridDatePicker.$create("Create$1",[this]);
        rtl.as(this.FEditor,$mod.TTMSFNCDataGridDatePicker).SetDate(pas.SysUtils.Now());
      } else if ($tmp1 === $mod.TTMSFNCDataGridFilterEditorType.gfetFloat) {
        this.FEditor = $mod.TTMSFNCDataGridSpinBox.$create("Create$1",[this])}
       else if ($tmp1 === $mod.TTMSFNCDataGridFilterEditorType.gfetNumber) this.FEditor = $mod.TTMSFNCDataGridSpinBox.$create("Create$1",[this]);
      if (this.FEditor != null) {
        this.FEditor.SetParent(this);
        if (pas["WEBLib.TMSFNCEdit"].TTMSFNCEdit.isPrototypeOf(this.FEditor)) {
          rtl.as(this.FEditor,pas["WEBLib.TMSFNCEdit"].TTMSFNCEdit).FOnChange = rtl.createCallback(this,"DoEditorChange");
        } else if (pas["WEBLib.StdCtrls"].TCheckBox.isPrototypeOf(this.FEditor)) {
          rtl.as(this.FEditor,pas["WEBLib.StdCtrls"].TCheckBox).FOnClick = rtl.createCallback(this,"DoEditorChange");
        } else if ($mod.TTMSFNCDataGridDatePicker.isPrototypeOf(this.FEditor)) {
          rtl.as(this.FEditor,$mod.TTMSFNCDataGridDatePicker).FOnChange = rtl.createCallback(this,"DoEditorChange")}
         else if ($mod.TTMSFNCDataGridSpinBox.isPrototypeOf(this.FEditor)) {
          rtl.as(this.FEditor,$mod.TTMSFNCDataGridSpinBox).FOnChange = rtl.createCallback(this,"DoEditorChange");
        };
        this.FEditor.SetTabOrder(this.FCell.GetColumn());
        if (pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.isPrototypeOf(this.FEditor)) rtl.as(this.FEditor,pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl).SetAdaptToStyle(this.GetAdaptToStyle());
      };
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FEditorTimer;
        }, set: function (v) {
          this.p.FEditorTimer = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FEditor;
        }, set: function (v) {
          this.p.FEditor = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FTypeListBox;
        }, set: function (v) {
          this.p.FTypeListBox = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FClearButton;
        }, set: function (v) {
          this.p.FClearButton = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FTypeButton;
        }, set: function (v) {
          this.p.FTypeButton = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FTypeListBox;
        }, set: function (v) {
          this.p.FTypeListBox = v;
        }});
      pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.Destroy.call(this);
    };
    this.Reset = function () {
      this.FBlockChange = true;
      if (this.FTypeListBox != null) this.FTypeListBox.SetItemIndex(this.ItemIndexByType(this.GetDefaultFilterType(this.FType)));
      if (this.FEditor != null) {
        if ($mod.TTMSFNCDataGridDatePicker.isPrototypeOf(this.FEditor)) {
          pas["WEBLib.TMSFNCDataGridData"].SetObjectValue(this.FEditor,pas.SysUtils.Now(),"")}
         else pas["WEBLib.TMSFNCDataGridData"].SetObjectValue(this.FEditor,pas["WEBLib.TMSFNCDataGridData"].TValueToCellValue(pas.RTTI.TValue.$clone(pas.RTTI.TValue.Empty())),"");
      };
      this.FBlockChange = false;
    };
    this.SetFilter = function (AFilter) {
      if (AFilter != null) {
        this.FBlockChange = true;
        if (this.FTypeListBox != null) this.FTypeListBox.SetItemIndex(this.ItemIndexByType(AFilter.FType));
        if (this.FEditor != null) pas["WEBLib.TMSFNCDataGridData"].SetObjectValue(this.FEditor,AFilter.FCondition,"");
        this.FBlockChange = false;
      };
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.TTMSFNCDataGridFilterTimerMode = {"0": "gftmDropDown", gftmDropDown: 0, "1": "gftmEditor", gftmEditor: 1};
  this.$rtti.$Enum("TTMSFNCDataGridFilterTimerMode",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCDataGridFilterTimerMode});
  this.TTMSFNCDataGridFilterEditMode = {"0": "gfemList", gfemList: 0, "1": "gfemEdit", gfemEdit: 1};
  this.$rtti.$Enum("TTMSFNCDataGridFilterEditMode",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TTMSFNCDataGridFilterEditMode});
  rtl.createClass(this,"TTMSFNCDataGridRenderer",pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridData,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridData.$init.call(this);
      this.FAutoFillState = 0;
      this.FAutoFillStart = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      this.FAutoFillEnd = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      this.FAutoFillOriginalSelection = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoordRange.$new();
      this.FAutoFillPreviewRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FDisjunctAnchorCell = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      this.FIsStyling = false;
      this.FAdaptedToStyle = false;
      this.FAdaptToStyle = false;
      this.FAnimateVerticalPos = false;
      this.FAnimateHorizontalPos = false;
      this.FAnimating = false;
      this.FBitmapContainer = null;
      this.FBlockScrollingUpdate = false;
      this.FBlockSynchronizeColumns = false;
      this.FCapturedScrollbar = null;
      this.FCellAnchor = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      this.FDragScrollCell = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      this.FCellAnchorString = "";
      this.FCellAppearance = null;
      this.FCellLayout = null;
      this.FCellPopupMenu = null;
      this.FClosing = false;
      this.FColumns = null;
      this.FColumnsEditor = null;
      this.FColumnStretchingActive = false;
      this.FColumnStretchingApplied = false;
      this.FCommentPopup = null;
      this.FControlWrapperList = null;
      this.FCustomScrollBars = false;
      this.FCustomVerticalScrollBar = null;
      this.FCustomHorizontalScrollBar = null;
      this.FExternalVerticalScrollBar = null;
      this.FExternalHorizontalScrollBar = null;
      this.FExternalVScrollChanged = null;
      this.FExternalHScrollChanged = null;
      this.FDblClick = false;
      this.FClearMouseDown = false;
      this.FDoTouchScroll = false;
      this.FTouchScrolling = false;
      this.FDoubleSelection = false;
      this.FDragAppearance = null;
      this.FAutoFillAppearance = null;
      this.FDragBitmap = null;
      this.FDragCell = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      this.FDragCellTo = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      this.FDraggingMode = 0;
      this.FDraggingType = 0;
      this.FDroppedDown = false;
      this.FEditing = false;
      this.FEditingCell = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      this.FFilterAppearance = null;
      this.FFilterClearButton = null;
      this.FFilterContainer = null;
      this.FFilterCustomEditor = null;
      this.FFilterEdit = null;
      this.FFilterEditMode = 0;
      this.FFilterExitTimer = null;
      this.FFilterListBox = null;
      this.FFilterPopup = null;
      this.FFilterSortAscendingButton = null;
      this.FFilterSortDescendingButton = null;
      this.FFilterTime = 0;
      this.FFilterTimer = null;
      this.FFilterTypeComboBox = null;
      this.FFindDialog = null;
      this.FFilterDialog = null;
      this.FFixedColumnCellDisplay = null;
      this.FFixedColumnCellList = null;
      this.FFixedRootCellDisplay = null;
      this.FFixedRootCellList = null;
      this.FFixedRowCellDisplay = null;
      this.FFixedRowCellList = null;
      this.FGlobalFont = null;
      this.FHorizontalScrollBarVisible = false;
      this.FHost = null;
      this.FHoverCell = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      this.FFocusedCell = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      this.FFirstCell = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      this.FSaveCell = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      this.FRealCell = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      this.FIcons = null;
      this.FInplaceEditor = null;
      this.FInplaceEditorActive = false;
      this.FInplaceEditorCustomClass = null;
      this.FInplaceEditorTarget = 0;
      this.FInplaceEditorType = 0;
      this.FDragging = false;
      this.FKeyDown = false;
      this.FLoadFilter = false;
      this.FLocalHScrollValue = 0.0;
      this.FLocalRectChanged = false;
      this.FLocalVScrollValue = 0.0;
      this.FLookupString = "";
      this.FLookupTimer = null;
      this.FMergedCells = null;
      this.FMouseDblClick = false;
      this.FMouseSizing = false;
      this.FMouseDown = false;
      this.FMouseUp = false;
      this.FDragFixed = false;
      this.FMouseScrollingUp = false;
      this.FMouseDragging = false;
      this.FNormalCellDisplay = null;
      this.FNormalCellList = null;
      this.FOldCursor = 0;
      this.FOnAfterApplyFilter = null;
      this.FOnAfterCloseInplaceEditor = null;
      this.FOnAfterExitInplaceEditor = null;
      this.FOnAfterCloseInplaceEditorInternal = null;
      this.FOnAfterCopyToClipboard = null;
      this.FOnAfterCreateFilterEditor = null;
      this.FOnAfterCutToClipboard = null;
      this.FOnAfterDrawCell = null;
      this.FOnAfterDrawEmptySpace = null;
      this.FOnAfterDrawGrid = null;
      this.FOnAfterLookup = null;
      this.FOnAfterOpenInplaceEditor = null;
      this.FOnAfterPasteFromClipboard = null;
      this.FOnAfterShowFilter = null;
      this.FOnAfterShowFilterDialog = null;
      this.FOnAfterShowFindDialog = null;
      this.FOnAfterShowReplaceDialog = null;
      this.FOnBeforeDialogFind = null;
      this.FOnAfterDialogFind = null;
      this.FOnBeforeDialogReplace = null;
      this.FOnAfterDialogReplace = null;
      this.FOnAfterSortColumn = null;
      this.FOnAppendColumn = null;
      this.FOnAppendRow = null;
      this.FOnBeforeApplyFilter = null;
      this.FOnBeforeCloseInplaceEditor = null;
      this.FOnBeforeExitInplaceEditor = null;
      this.FOnBeforeCopyToClipboard = null;
      this.FOnBeforeCreateFilterEditor = null;
      this.FOnBeforeCutToClipboard = null;
      this.FOnBeforeDrawCell = null;
      this.FOnBeforeDrawEmptySpace = null;
      this.FOnBeforeLookup = null;
      this.FOnBeforeOpenInplaceEditor = null;
      this.FOnBeforePasteFromClipboard = null;
      this.FOnBeforeShowFilter = null;
      this.FOnBeforeShowFilterDialog = null;
      this.FOnBeforeShowFindDialog = null;
      this.FOnBeforeShowReplaceDialog = null;
      this.FOnBeforeSortColumn = null;
      this.FOnCanAppendColumn = null;
      this.FOnCanAppendRow = null;
      this.FOnCanDeleteColumn = null;
      this.FOnCanDeleteRow = null;
      this.FOnCanDragColumn = null;
      this.FOnCanDragRow = null;
      this.FOnCanDropColumn = null;
      this.FOnCanDropRow = null;
      this.FOnCanEditCell = null;
      this.FOnCanInsertColumn = null;
      this.FOnCanInsertRow = null;
      this.FOnCanSizeColumn = null;
      this.FOnCanSizeRow = null;
      this.FOnCellAfterNodeCollapse = null;
      this.FOnCellAfterNodeExpand = null;
      this.FOnCellAnchorClick = null;
      this.FOnCellBeforeNodeCollapse = null;
      this.FOnCellBeforeNodeExpand = null;
      this.FOnCellBeforeShowPopupMenu = null;
      this.FOnCellButtonClick = null;
      this.FOnCellCheckBoxChange = null;
      this.FOnCellClick = null;
      this.FOnCellDblClick = null;
      this.FOnCellEditGetData = null;
      this.FOnCellEditSetData = null;
      this.FOnCellEditValidateData = null;
      this.FOnCellRadioButtonChange = null;
      this.FOnCellRightClick = null;
      this.FOnColumnDropped = null;
      this.FOnColumnSized = null;
      this.FOnCreateCustomFilterEditor = null;
      this.FOnCustomizeFilterPopupEditor = null;
      this.FOnDeleteColumn = null;
      this.FOnDeleteRow = null;
      this.FOnBeforeClearSelectedCells = null;
      this.FOnAfterClearSelectedCells = null;
      this.FOnDisplay = null;
      this.FOnDropFiles = null;
      this.FOnFocus = null;
      this.FOnGetCellClass = null;
      this.FOnGetCellHint = null;
      this.FOnGetCellLayout = null;
      this.FOnGetCellLayoutHasPriority = null;
      this.FOnGetCellProperties = null;
      this.FOnGetInplaceEditorClass = null;
      this.FOnGetInplaceEditorProperties = null;
      this.FOnGetInplaceEditorRect = null;
      this.FOnGetInplaceEditorTarget = null;
      this.FOnGetInplaceEditorType = null;
      this.FOnHScroll = null;
      this.FOnInsertColumn = null;
      this.FOnInsertRow = null;
      this.FOnIsDesigntime = null;
      this.FOnIsDestroying = null;
      this.FOnIsFocused = null;
      this.FOnIsLoading = null;
      this.FOnNeedFilterDropDownData = null;
      this.FOnRemoveFilter = null;
      this.FOnRowDropped = null;
      this.FOnRowSized = null;
      this.FOnSelectCell = null;
      this.FOnSelectingCell = null;
      this.FOnSizeColumn = null;
      this.FOnSizeRow = null;
      this.FOnUpdateCursor = null;
      this.FOnVScroll = null;
      this.FPadding = null;
      this.FPrevX = 0.0;
      this.FPrevY = 0.0;
      this.FSizeX = 0.0;
      this.FSizeY = 0.0;
      this.FDownX = 0.0;
      this.FDownY = 0.0;
      this.FReplaceDialog = null;
      this.FRowStretchingActive = false;
      this.FRowStretchingApplied = false;
      this.FBlockFocusedCell = 0;
      this.FSaveClipRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FClipRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FSaveHScrollPos = 0.0;
      this.FSaveVScrollPos = 0.0;
      this.FSaveLeft = 0.0;
      this.FSaveTop = 0.0;
      this.FScale = 0.0;
      this.FScrollHTo = 0.0;
      this.FScrollVTo = 0.0;
      this.FScrollMode = 0;
      this.FScrollTimer = null;
      this.FDragTimer = null;
      this.FAnimateTimer = null;
      this.FScrollUpdate = 0;
      this.FSelectedCellDictionary = null;
      this.FSelectedColumnDictionary = null;
      this.FSelectedRowDictionary = null;
      this.FSelection = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoordRange.$new();
      this.FSizeMode = 0;
      this.FSizing = false;
      this.FSpY = 0.0;
      this.FSpX = 0.0;
      this.FX = 0.0;
      this.FY = 0.0;
      this.FTouchX = 0.0;
      this.FTouchY = 0.0;
      this.FScrollX = 0.0;
      this.FScrollY = 0.0;
      this.FMouseX = 0.0;
      this.FMouseY = 0.0;
      this.FStretchScrollBars = false;
      this.FStroke = null;
      this.FStyleApplied = false;
      this.FTabKey = 0;
      this.FTimeStart = 0.0;
      this.FTimeStop = 0.0;
      this.FUseClipRect = false;
      this.FVerticalScrollBar = null;
      this.FHorizontalScrollBar = null;
      this.FVerticalScrollBarVisible = false;
      this.FOnAfterCalculate = null;
      this.FOnBeforeCalculate = null;
      this.FIsMouseDown = false;
      this.FPaging = false;
      this.FOnAfterApplyAdvancedFilter = null;
      this.FOnRemoveAdvancedFilter = null;
      this.FOnBeforeApplyAdvancedFilter = null;
      this.FOnBeforeInplaceEditorSetValue = null;
      this.FOnAfterInplaceEditorGetValue = null;
      this.FOnAfterInplaceEditorSetValue = null;
      this.FOnBeforeInplaceEditorGetValue = null;
      this.FOnResetCapture = null;
    };
    this.$final = function () {
      this.FAutoFillStart = undefined;
      this.FAutoFillEnd = undefined;
      this.FAutoFillOriginalSelection = undefined;
      this.FAutoFillPreviewRect = undefined;
      this.FDisjunctAnchorCell = undefined;
      this.FBitmapContainer = undefined;
      this.FCapturedScrollbar = undefined;
      this.FCellAnchor = undefined;
      this.FDragScrollCell = undefined;
      this.FCellAppearance = undefined;
      this.FCellLayout = undefined;
      this.FCellPopupMenu = undefined;
      this.FColumns = undefined;
      this.FColumnsEditor = undefined;
      this.FCommentPopup = undefined;
      this.FControlWrapperList = undefined;
      this.FCustomVerticalScrollBar = undefined;
      this.FCustomHorizontalScrollBar = undefined;
      rtl.setIntfP(this,"FExternalVerticalScrollBar",null);
      rtl.setIntfP(this,"FExternalHorizontalScrollBar",null);
      this.FExternalVScrollChanged = undefined;
      this.FExternalHScrollChanged = undefined;
      this.FDragAppearance = undefined;
      this.FAutoFillAppearance = undefined;
      this.FDragBitmap = undefined;
      this.FDragCell = undefined;
      this.FDragCellTo = undefined;
      this.FEditingCell = undefined;
      this.FFilterAppearance = undefined;
      this.FFilterClearButton = undefined;
      this.FFilterContainer = undefined;
      this.FFilterCustomEditor = undefined;
      this.FFilterEdit = undefined;
      this.FFilterExitTimer = undefined;
      this.FFilterListBox = undefined;
      this.FFilterPopup = undefined;
      this.FFilterSortAscendingButton = undefined;
      this.FFilterSortDescendingButton = undefined;
      this.FFilterTimer = undefined;
      this.FFilterTypeComboBox = undefined;
      this.FFindDialog = undefined;
      this.FFilterDialog = undefined;
      this.FFixedColumnCellDisplay = undefined;
      this.FFixedColumnCellList = undefined;
      this.FFixedRootCellDisplay = undefined;
      this.FFixedRootCellList = undefined;
      this.FFixedRowCellDisplay = undefined;
      this.FFixedRowCellList = undefined;
      this.FGlobalFont = undefined;
      this.FHost = undefined;
      this.FHoverCell = undefined;
      this.FFocusedCell = undefined;
      this.FFirstCell = undefined;
      this.FSaveCell = undefined;
      this.FRealCell = undefined;
      this.FIcons = undefined;
      this.FInplaceEditor = undefined;
      this.FInplaceEditorCustomClass = undefined;
      this.FLookupTimer = undefined;
      this.FMergedCells = undefined;
      this.FNormalCellDisplay = undefined;
      this.FNormalCellList = undefined;
      this.FOnAfterApplyFilter = undefined;
      this.FOnAfterCloseInplaceEditor = undefined;
      this.FOnAfterExitInplaceEditor = undefined;
      this.FOnAfterCloseInplaceEditorInternal = undefined;
      this.FOnAfterCopyToClipboard = undefined;
      this.FOnAfterCreateFilterEditor = undefined;
      this.FOnAfterCutToClipboard = undefined;
      this.FOnAfterDrawCell = undefined;
      this.FOnAfterDrawEmptySpace = undefined;
      this.FOnAfterDrawGrid = undefined;
      this.FOnAfterLookup = undefined;
      this.FOnAfterOpenInplaceEditor = undefined;
      this.FOnAfterPasteFromClipboard = undefined;
      this.FOnAfterShowFilter = undefined;
      this.FOnAfterShowFilterDialog = undefined;
      this.FOnAfterShowFindDialog = undefined;
      this.FOnAfterShowReplaceDialog = undefined;
      this.FOnBeforeDialogFind = undefined;
      this.FOnAfterDialogFind = undefined;
      this.FOnBeforeDialogReplace = undefined;
      this.FOnAfterDialogReplace = undefined;
      this.FOnAfterSortColumn = undefined;
      this.FOnAppendColumn = undefined;
      this.FOnAppendRow = undefined;
      this.FOnBeforeApplyFilter = undefined;
      this.FOnBeforeCloseInplaceEditor = undefined;
      this.FOnBeforeExitInplaceEditor = undefined;
      this.FOnBeforeCopyToClipboard = undefined;
      this.FOnBeforeCreateFilterEditor = undefined;
      this.FOnBeforeCutToClipboard = undefined;
      this.FOnBeforeDrawCell = undefined;
      this.FOnBeforeDrawEmptySpace = undefined;
      this.FOnBeforeLookup = undefined;
      this.FOnBeforeOpenInplaceEditor = undefined;
      this.FOnBeforePasteFromClipboard = undefined;
      this.FOnBeforeShowFilter = undefined;
      this.FOnBeforeShowFilterDialog = undefined;
      this.FOnBeforeShowFindDialog = undefined;
      this.FOnBeforeShowReplaceDialog = undefined;
      this.FOnBeforeSortColumn = undefined;
      this.FOnCanAppendColumn = undefined;
      this.FOnCanAppendRow = undefined;
      this.FOnCanDeleteColumn = undefined;
      this.FOnCanDeleteRow = undefined;
      this.FOnCanDragColumn = undefined;
      this.FOnCanDragRow = undefined;
      this.FOnCanDropColumn = undefined;
      this.FOnCanDropRow = undefined;
      this.FOnCanEditCell = undefined;
      this.FOnCanInsertColumn = undefined;
      this.FOnCanInsertRow = undefined;
      this.FOnCanSizeColumn = undefined;
      this.FOnCanSizeRow = undefined;
      this.FOnCellAfterNodeCollapse = undefined;
      this.FOnCellAfterNodeExpand = undefined;
      this.FOnCellAnchorClick = undefined;
      this.FOnCellBeforeNodeCollapse = undefined;
      this.FOnCellBeforeNodeExpand = undefined;
      this.FOnCellBeforeShowPopupMenu = undefined;
      this.FOnCellButtonClick = undefined;
      this.FOnCellCheckBoxChange = undefined;
      this.FOnCellClick = undefined;
      this.FOnCellDblClick = undefined;
      this.FOnCellEditGetData = undefined;
      this.FOnCellEditSetData = undefined;
      this.FOnCellEditValidateData = undefined;
      this.FOnCellRadioButtonChange = undefined;
      this.FOnCellRightClick = undefined;
      this.FOnColumnDropped = undefined;
      this.FOnColumnSized = undefined;
      this.FOnCreateCustomFilterEditor = undefined;
      this.FOnCustomizeFilterPopupEditor = undefined;
      this.FOnDeleteColumn = undefined;
      this.FOnDeleteRow = undefined;
      this.FOnBeforeClearSelectedCells = undefined;
      this.FOnAfterClearSelectedCells = undefined;
      this.FOnDisplay = undefined;
      this.FOnDropFiles = undefined;
      this.FOnFocus = undefined;
      this.FOnGetCellClass = undefined;
      this.FOnGetCellHint = undefined;
      this.FOnGetCellLayout = undefined;
      this.FOnGetCellLayoutHasPriority = undefined;
      this.FOnGetCellProperties = undefined;
      this.FOnGetInplaceEditorClass = undefined;
      this.FOnGetInplaceEditorProperties = undefined;
      this.FOnGetInplaceEditorRect = undefined;
      this.FOnGetInplaceEditorTarget = undefined;
      this.FOnGetInplaceEditorType = undefined;
      this.FOnHScroll = undefined;
      this.FOnInsertColumn = undefined;
      this.FOnInsertRow = undefined;
      this.FOnIsDesigntime = undefined;
      this.FOnIsDestroying = undefined;
      this.FOnIsFocused = undefined;
      this.FOnIsLoading = undefined;
      this.FOnNeedFilterDropDownData = undefined;
      this.FOnRemoveFilter = undefined;
      this.FOnRowDropped = undefined;
      this.FOnRowSized = undefined;
      this.FOnSelectCell = undefined;
      this.FOnSelectingCell = undefined;
      this.FOnSizeColumn = undefined;
      this.FOnSizeRow = undefined;
      this.FOnUpdateCursor = undefined;
      this.FOnVScroll = undefined;
      this.FPadding = undefined;
      this.FReplaceDialog = undefined;
      this.FSaveClipRect = undefined;
      this.FClipRect = undefined;
      this.FScrollTimer = undefined;
      this.FDragTimer = undefined;
      this.FAnimateTimer = undefined;
      this.FSelectedCellDictionary = undefined;
      this.FSelectedColumnDictionary = undefined;
      this.FSelectedRowDictionary = undefined;
      this.FSelection = undefined;
      this.FStroke = undefined;
      this.FVerticalScrollBar = undefined;
      this.FHorizontalScrollBar = undefined;
      this.FOnAfterCalculate = undefined;
      this.FOnBeforeCalculate = undefined;
      this.FOnAfterApplyAdvancedFilter = undefined;
      this.FOnRemoveAdvancedFilter = undefined;
      this.FOnBeforeApplyAdvancedFilter = undefined;
      this.FOnBeforeInplaceEditorSetValue = undefined;
      this.FOnAfterInplaceEditorGetValue = undefined;
      this.FOnAfterInplaceEditorSetValue = undefined;
      this.FOnBeforeInplaceEditorGetValue = undefined;
      this.FOnResetCapture = undefined;
      pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridData.$final.call(this);
    };
    this.GetAdaptToStyle = function () {
      var Result = false;
      Result = this.FAdaptToStyle;
      return Result;
    };
    this.GetAnimateTimer = function () {
      var Result = null;
      if (!(this.FAnimateTimer != null)) {
        this.FAnimateTimer = pas["WEBLib.ExtCtrls"].TTimer.$create("Create$1",[null]);
        this.FAnimateTimer.SetInterval(1);
        this.FAnimateTimer.SetEnabled(false);
        this.FAnimateTimer.FOnTimer = rtl.createCallback(this,"Animate");
      };
      Result = this.FAnimateTimer;
      return Result;
    };
    this.GetBitmapContainer = function () {
      var Result = null;
      Result = this.FBitmapContainer;
      return Result;
    };
    this.GetBitmapName = function (AColumn, ARow) {
      var Result = "";
      var cd = null;
      Result = "";
      cd = this.GetCellData(AColumn,ARow);
      if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd) && (pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FType === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitBitmap)) Result = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FBitmapName;
      return Result;
    };
    this.GetBitmap = function (AColumn, ARow) {
      var Result = null;
      var cd = null;
      Result = null;
      cd = this.GetCellData(AColumn,ARow);
      if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd) && (pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FType === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitBitmap)) Result = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).GetBitmap();
      return Result;
    };
    this.GetBottomRow = function () {
      var Result = 0;
      Result = this.GetStopRow();
      return Result;
    };
    this.GetColor = function (AColumn, ARow) {
      var Result = 0;
      var l = null;
      Result = -1;
      l = this.GetCellAppearance(this.GetCellState(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow))),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow)),false);
      if (l != null) Result = l.FFill.FColor;
      return Result;
    };
    this.GetColumnsEditor = function () {
      var Result = null;
      if (!(this.FColumnsEditor != null)) {
        this.FColumnsEditor = pas["WEBLib.TMSFNCDataGridColumnsEditor"].TTMSFNCDataGridColumnsEditor.$create("Create$1",[null]);
        rtl.as(this.FColumnsEditor,pas["WEBLib.TMSFNCDataGridColumnsEditor"].TTMSFNCDataGridColumnsEditor).SetRenderer(this);
      };
      Result = this.FColumnsEditor;
      return Result;
    };
    this.GetCommentPopup = function () {
      var Result = null;
      if (!(this.FCommentPopup != null)) {
        this.FCommentPopup = $mod.TTMSFNCCommentPopup.$create("Create$1",[null]);
        this.FCommentPopup.SetPlacement(pas["WEBLib.TMSFNCPopup"].TTMSFNCPopupPlacement.ppAbsolute);
        this.FCommentPopup.FOnPopupPaint = rtl.createCallback(this,"DoPaintCommentPopup");
      };
      Result = this.FCommentPopup;
      return Result;
    };
    this.GetComment = function (AColumn, ARow) {
      var Result = "";
      var cd = null;
      Result = "";
      cd = this.GetCellData(AColumn,ARow);
      if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd)) Result = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FComment;
      return Result;
    };
    this.GetControlAlign = function (AColumn, ARow) {
      var Result = 0;
      var cd = null;
      var cl = null;
      Result = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellControlAlign.gcaNone;
      cl = this.GetColumn(AColumn);
      if ((cl != null) && ($mod.TTMSFNCDataGridColumnSetting.gcsControlAlign in cl.FSettings)) {
        Result = cl.FControlAlign}
       else {
        cd = this.GetCellData(AColumn,ARow);
        if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd)) Result = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FControlAlign;
      };
      return Result;
    };
    this.GetControlHeight = function (AColumn, ARow) {
      var Result = 0;
      var cd = null;
      var cl = null;
      Result = -1;
      cl = this.GetColumn(AColumn);
      if ((cl != null) && ($mod.TTMSFNCDataGridColumnSetting.gcsControlHeight in cl.FSettings)) {
        Result = cl.FControlHeight}
       else {
        cd = this.GetCellData(AColumn,ARow);
        if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd)) Result = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FControlHeight;
      };
      return Result;
    };
    this.GetControlHeightDIP = function (AColumn, ARow) {
      var Result = 0;
      Result = this.UnscaleValue$1(this.GetControlHeight(AColumn,ARow));
      return Result;
    };
    this.GetControlMargins = function (AColumn, ARow) {
      var Result = null;
      var cd = null;
      var cl = null;
      Result = null;
      cl = this.GetColumn(AColumn);
      if ((cl != null) && ($mod.TTMSFNCDataGridColumnSetting.gcsControlMargins in cl.FSettings)) {
        Result = cl.FControlMargins}
       else {
        cd = this.GetCellData(AColumn,ARow);
        if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd)) Result = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).GetControlMargins();
      };
      return Result;
    };
    this.GetControlPosition = function (AColumn, ARow) {
      var Result = 0;
      var cd = null;
      var cl = null;
      Result = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellControlPosition.gcpCenterRight;
      cl = this.GetColumn(AColumn);
      if ((cl != null) && ($mod.TTMSFNCDataGridColumnSetting.gcsControlPosition in cl.FSettings)) {
        Result = cl.FControlPosition}
       else {
        cd = this.GetCellData(AColumn,ARow);
        if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd)) Result = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FControlPosition;
      };
      return Result;
    };
    this.GetControlText = function (AColumn, ARow) {
      var Result = "";
      var cd = null;
      var cl = null;
      Result = "";
      cl = this.GetColumn(AColumn);
      if ((cl != null) && ($mod.TTMSFNCDataGridColumnSetting.gcsControlText in cl.FSettings)) {
        Result = cl.FControlText}
       else {
        cd = this.GetCellData(AColumn,ARow);
        if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd)) Result = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FControlText;
      };
      return Result;
    };
    this.GetControlWidth = function (AColumn, ARow) {
      var Result = 0;
      var cd = null;
      var cl = null;
      Result = -1;
      cl = this.GetColumn(AColumn);
      if ((cl != null) && ($mod.TTMSFNCDataGridColumnSetting.gcsControlWidth in cl.FSettings)) {
        Result = cl.FControlWidth}
       else {
        cd = this.GetCellData(AColumn,ARow);
        if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd)) Result = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FControlWidth;
      };
      return Result;
    };
    this.GetControlWidthDIP = function (AColumn, ARow) {
      var Result = 0;
      Result = this.UnscaleValue$1(this.GetControlWidth(AColumn,ARow));
      return Result;
    };
    this.GetControlWrapperList = function () {
      var Result = null;
      if (!(this.FControlWrapperList != null)) this.FControlWrapperList = $mod.TTMSFNCDataGridCellControlWrapperList.$create("Create$4",[true]);
      Result = this.FControlWrapperList;
      return Result;
    };
    this.GetCustomHorizontalScrollBar = function () {
      var Result = null;
      Result = this.FCustomHorizontalScrollBar;
      return Result;
    };
    this.GetCustomVerticalScrollBar = function () {
      var Result = null;
      Result = this.FCustomVerticalScrollBar;
      return Result;
    };
    this.GetDragTimer = function () {
      var Result = null;
      if (!(this.FDragTimer != null)) {
        this.FDragTimer = pas["WEBLib.ExtCtrls"].TTimer.$create("Create$1",[null]);
        this.FDragTimer.FOnTimer = rtl.createCallback(this,"DoDragTimer");
        this.FDragTimer.SetInterval(this.GetOptions().FMouse.FAutoScrollingInterval);
        this.FDragTimer.SetEnabled(false);
      };
      Result = this.FDragTimer;
      return Result;
    };
    this.GetFilterClearButton = function () {
      var Result = null;
      if (!(this.FFilterClearButton != null)) {
        this.FFilterClearButton = pas["WEBLib.TMSFNCToolBar"].TTMSFNCToolBarButton.$create("Create$1",[this.GetFilterContainer()]);
        this.FFilterClearButton.SetParent(this.GetFilterContainer());
        this.FFilterClearButton.FAppearance.SetFlatStyle(true);
        this.FFilterClearButton.SetWidth(25);
        this.FFilterClearButton.SetLeft(5);
        this.FFilterClearButton.SetTop(5 + this.GetFilterTypeComboBox().GetHeight());
        this.FFilterClearButton.SetHeight(22);
        this.FFilterClearButton.SetText("");
        this.FFilterClearButton.SetHorizontalTextAlign(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading);
        this.FFilterClearButton.FAppearance.FNormalFill.SetColor(16777215);
        this.FFilterClearButton.FAppearance.FNormalStroke.SetColor(16777215);
        this.FFilterClearButton.SetHint(this.GetOptions().FLocalization.FFilterClearButtonHint);
        this.FFilterClearButton.SetShowHint(true);
        this.FFilterClearButton.FOnClick = rtl.createCallback(this,"DoFilterClearClick");
        this.GetFilterClearButton().SetAdaptToStyle(this.GetAdaptToStyle());
      };
      this.FFilterClearButton.FBitmaps.Clear();
      this.FFilterClearButton.FBitmaps.AddBitmap(this.FIcons.GetActiveFilterClearIcon(),1.0);
      Result = this.FFilterClearButton;
      return Result;
    };
    this.GetFilterContainer = function () {
      var Result = null;
      if (!(this.FFilterContainer != null)) this.FFilterContainer = pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.$create("Create$1",[null]);
      Result = this.FFilterContainer;
      return Result;
    };
    this.GetFilterEdit = function () {
      var Result = null;
      if (!(this.FFilterEdit != null)) {
        this.FFilterEdit = pas["WEBLib.TMSFNCEdit"].TTMSFNCEdit.$create("Create$1",[this.GetFilterContainer()]);
        this.FFilterEdit.SetParent(this.GetFilterContainer());
        this.FFilterEdit.FOnEnter = rtl.createCallback(this,"DoFilterEnter");
        this.FFilterEdit.SetTextHint(this.GetOptions().FLocalization.FFilterEditPrompt);
        this.FFilterEdit.SetAlign(pas["WEBLib.Controls"].TAlign.alTop);
        this.FFilterEdit.SetAlignWithMargins(true);
        this.FFilterEdit.FOnChange = rtl.createCallback(this,"DoFilterEditChange");
        this.FFilterEdit.FMargins.SetLeft(35);
        this.FFilterEdit.FMargins.SetTop(5);
        this.FFilterEdit.FMargins.SetRight(5);
        this.FFilterEdit.FMargins.SetBottom(0);
      };
      Result = this.FFilterEdit;
      return Result;
    };
    this.GetFilterEditor = function (AColumn, ARow) {
      var Result = null;
      var cd = null;
      Result = null;
      cd = this.GetCellData(AColumn,ARow);
      if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd)) {
        if (!(cd.FFilterEditor != null)) cd.FFilterEditor = this.CreateFilterEditor(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow)));
        Result = cd.FFilterEditor;
      };
      return Result;
    };
    this.GetFilterExitTimer = function () {
      var Result = null;
      if (!(this.FFilterExitTimer != null)) {
        this.FFilterExitTimer = pas["WEBLib.ExtCtrls"].TTimer.$create("Create$1",[null]);
        this.FFilterExitTimer.FOnTimer = rtl.createCallback(this,"DoFilterExitTimer");
        this.FFilterExitTimer.SetInterval(100);
        this.FFilterExitTimer.SetEnabled(false);
      };
      Result = this.FFilterExitTimer;
      return Result;
    };
    this.GetFilterListBox = function () {
      var Result = null;
      if (!(this.FFilterListBox != null)) {
        this.FFilterListBox = pas["WEBLib.TMSFNCCheckedListBox"].TTMSFNCCheckedListBox.$create("Create$1",[this.GetFilterContainer()]);
        this.FFilterListBox.SetParent(this.GetFilterContainer());
        this.FFilterListBox.SetControlAlignment(pas["WEBLib.TMSFNCCustomControl"].TTMSFNCControlAlignment.caClient);
        this.FFilterListBox.SetAlignWithMargins(true);
        this.FFilterListBox.FMargins.SetLeft(5);
        this.FFilterListBox.FMargins.SetTop(5);
        this.FFilterListBox.FMargins.SetRight(5);
        this.FFilterListBox.FMargins.SetBottom(5);
        this.FFilterListBox.FOnItemCheckChanged = rtl.createCallback(this,"DoFilterListBoxItemCheckChanged");
        this.FFilterListBox.SetAdaptToStyle(this.GetAdaptToStyle());
      };
      Result = this.FFilterListBox;
      return Result;
    };
    this.GetFilterPopup = function () {
      var Result = null;
      var p = null;
      if (!(this.FFilterPopup != null)) {
        p = this.GetParentHost();
        this.FFilterPopup = pas["WEBLib.TMSFNCPopup"].TTMSFNCPopup.$create("Create$1",[p]);
        this.FFilterPopup.SetPlacement(pas["WEBLib.TMSFNCPopup"].TTMSFNCPopupPlacement.ppAbsolute);
        this.FFilterPopup.SetAdaptToStyle(this.GetAdaptToStyle());
      };
      Result = this.FFilterPopup;
      return Result;
    };
    this.GetFilterSortAscendingButton = function () {
      var Result = null;
      if (!(this.FFilterSortAscendingButton != null)) {
        this.FFilterSortAscendingButton = pas["WEBLib.TMSFNCToolBar"].TTMSFNCToolBarButton.$create("Create$1",[this.GetFilterContainer()]);
        this.FFilterSortAscendingButton.SetParent(this.GetFilterContainer());
        this.FFilterSortAscendingButton.SetAlign(pas["WEBLib.Controls"].TAlign.alBottom);
        this.FFilterSortAscendingButton.SetAlignWithMargins(true);
        this.FFilterSortAscendingButton.FAppearance.SetFlatStyle(true);
        this.FFilterSortAscendingButton.SetText(this.GetOptions().FLocalization.FFilterSortButtonAscendingText);
        this.FFilterSortAscendingButton.SetHorizontalTextAlign(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading);
        this.FFilterSortAscendingButton.FAppearance.FNormalFill.SetColor(16777215);
        this.FFilterSortAscendingButton.FAppearance.FNormalStroke.SetColor(16777215);
        this.FFilterSortAscendingButton.SetHint(this.GetOptions().FLocalization.FFilterSortButtonAscendingHint);
        this.FFilterSortAscendingButton.SetShowHint(true);
        this.FFilterSortAscendingButton.FMargins.SetLeft(5);
        this.FFilterSortAscendingButton.FMargins.SetTop(0);
        this.FFilterSortAscendingButton.FMargins.SetRight(5);
        this.FFilterSortAscendingButton.FMargins.SetBottom(5);
        this.FFilterSortAscendingButton.FDataString = "asc";
        this.FFilterSortAscendingButton.FOnClick = rtl.createCallback(this,"DoFilterSortClick");
        this.FFilterSortAscendingButton.SetAdaptToStyle(this.GetAdaptToStyle());
      };
      this.FFilterSortAscendingButton.FBitmaps.Clear();
      this.FFilterSortAscendingButton.FBitmaps.AddBitmap(this.FIcons.GetActiveSortAscendingIcon(),1.0);
      Result = this.FFilterSortAscendingButton;
      return Result;
    };
    this.GetFilterSortDescendingButton = function () {
      var Result = null;
      if (!(this.FFilterSortDescendingButton != null)) {
        this.FFilterSortDescendingButton = pas["WEBLib.TMSFNCToolBar"].TTMSFNCToolBarButton.$create("Create$1",[this.GetFilterContainer()]);
        this.FFilterSortDescendingButton.SetParent(this.GetFilterContainer());
        this.FFilterSortDescendingButton.SetAlign(pas["WEBLib.Controls"].TAlign.alBottom);
        this.FFilterSortDescendingButton.SetAlignWithMargins(true);
        this.FFilterSortDescendingButton.FAppearance.SetFlatStyle(true);
        this.FFilterSortDescendingButton.SetText(this.GetOptions().FLocalization.FFilterSortButtonDescendingText);
        this.FFilterSortDescendingButton.SetHorizontalTextAlign(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading);
        this.FFilterSortDescendingButton.FAppearance.FNormalFill.SetColor(16777215);
        this.FFilterSortDescendingButton.FAppearance.FNormalStroke.SetColor(16777215);
        this.FFilterSortDescendingButton.SetHint(this.GetOptions().FLocalization.FFilterSortButtonDescendingHint);
        this.FFilterSortDescendingButton.SetShowHint(true);
        this.FFilterSortDescendingButton.FMargins.SetLeft(5);
        this.FFilterSortDescendingButton.FMargins.SetTop(0);
        this.FFilterSortDescendingButton.FMargins.SetRight(5);
        this.FFilterSortDescendingButton.FMargins.SetBottom(5);
        this.FFilterSortDescendingButton.FDataString = "desc";
        this.FFilterSortDescendingButton.FOnClick = rtl.createCallback(this,"DoFilterSortClick");
        this.FFilterSortDescendingButton.SetAdaptToStyle(this.GetAdaptToStyle());
      };
      this.FFilterSortDescendingButton.FBitmaps.Clear();
      this.FFilterSortDescendingButton.FBitmaps.AddBitmap(this.FIcons.GetActiveSortDescendingIcon(),1.0);
      Result = this.FFilterSortDescendingButton;
      return Result;
    };
    this.GetFilterTimer = function () {
      var Result = null;
      if (!(this.FFilterTimer != null)) {
        this.FFilterTimer = pas["WEBLib.ExtCtrls"].TTimer.$create("Create$1",[null]);
        this.FFilterTimer.FOnTimer = rtl.createCallback(this,"DoFilterTimer");
        this.FFilterTimer.SetInterval(1);
        this.FFilterTimer.SetEnabled(false);
      };
      Result = this.FFilterTimer;
      return Result;
    };
    this.GetFilterTypeComboBox = function () {
      var Result = null;
      var I = 0;
      var a = [];
      if (!(this.FFilterTypeComboBox != null)) {
        this.FFilterTypeComboBox = $mod.TComboBoxSafe.$create("Create$1",[this.GetFilterContainer()]);
        this.FFilterTypeComboBox.SetParent(this.GetFilterContainer());
        this.FFilterTypeComboBox.SetAlign(pas["WEBLib.Controls"].TAlign.alTop);
        this.FFilterTypeComboBox.SetAlignWithMargins(true);
        this.FFilterTypeComboBox.FMargins.SetLeft(5);
        this.FFilterTypeComboBox.FMargins.SetTop(5);
        this.FFilterTypeComboBox.FMargins.SetRight(5);
        this.FFilterTypeComboBox.FMargins.SetBottom(0);
        a = rtl.arraySetLength(a,"",0);
        for (I = 0; I <= 11; I++) {
          a = rtl.arraySetLength(a,"",rtl.length(a) + 1);
          a[rtl.length(a) - 1] = this.GetFilterTypeName(I);
        };
        this.FFilterTypeComboBox.SetSafeItems(a);
        this.FFilterTypeComboBox.FOnChange = rtl.createCallback(this,"DoFilterTypeChange");
      };
      Result = this.FFilterTypeComboBox;
      return Result;
    };
    this.GetFindDialog = function () {
      var Result = null;
      if (!(this.FFindDialog != null)) {
        this.FFindDialog = pas["WEBLib.TMSFNCFindDialog"].TTMSFNCFindDialog.$create("Create$1",[null]);
        this.FFindDialog.FOptions = rtl.createSet(pas["WEBLib.TMSFNCFindDialog"].TTMSFNCFindDialogOption.fdoCaseSensitive,pas["WEBLib.TMSFNCFindDialog"].TTMSFNCFindDialogOption.fdoNextEnabled,pas["WEBLib.TMSFNCFindDialog"].TTMSFNCFindDialogOption.fdoFindEnabled,pas["WEBLib.TMSFNCFindDialog"].TTMSFNCFindDialogOption.fdoCloseEnabled,pas["WEBLib.TMSFNCFindDialog"].TTMSFNCFindDialogOption.fdoDown);
        this.FFindDialog.FVisibleOptions = rtl.createSet(pas["WEBLib.TMSFNCFindDialog"].TTMSFNCFindDialogVisibleOption.fdovCaseSensitive,pas["WEBLib.TMSFNCFindDialog"].TTMSFNCFindDialogVisibleOption.fdovExpression,pas["WEBLib.TMSFNCFindDialog"].TTMSFNCFindDialogVisibleOption.fdovCloseIfFound,pas["WEBLib.TMSFNCFindDialog"].TTMSFNCFindDialogVisibleOption.fdovWholeWordOnly,pas["WEBLib.TMSFNCFindDialog"].TTMSFNCFindDialogVisibleOption.fdovNext,pas["WEBLib.TMSFNCFindDialog"].TTMSFNCFindDialogVisibleOption.fdovFind,pas["WEBLib.TMSFNCFindDialog"].TTMSFNCFindDialogVisibleOption.fdovClose,pas["WEBLib.TMSFNCFindDialog"].TTMSFNCFindDialogVisibleOption.fdovFindCombo,pas["WEBLib.TMSFNCFindDialog"].TTMSFNCFindDialogVisibleOption.fdovFindMemo,pas["WEBLib.TMSFNCFindDialog"].TTMSFNCFindDialogVisibleOption.fdovDirection);
        this.FFindDialog.FOnFind = rtl.createCallback(this,"DoFind");
        this.FFindDialog.FOnFindNext = rtl.createCallback(this,"DoFindNext");
      };
      Result = this.FFindDialog;
      return Result;
    };
    this.GetFocusedCell = function () {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      Result.$assign(this.FFocusedCell);
      return Result;
    };
    this.GetFontColor = function (AColumn, ARow) {
      var Result = 0;
      var l = null;
      Result = -1;
      l = this.GetCellAppearance(this.GetCellState(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow))),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow)),false);
      if (l != null) Result = l.FFont.FColor;
      return Result;
    };
    this.GetFontName = function (AColumn, ARow) {
      var Result = "";
      var l = null;
      Result = "";
      l = this.GetCellAppearance(this.GetCellState(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow))),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow)),false);
      if (l != null) Result = l.FFont.FName;
      return Result;
    };
    this.GetFontSize = function (AColumn, ARow) {
      var Result = 0.0;
      var l = null;
      Result = 0;
      l = this.GetCellAppearance(this.GetCellState(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow))),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow)),false);
      if (l != null) Result = l.FFont.FSize;
      return Result;
    };
    this.GetFontStyle = function (AColumn, ARow) {
      var Result = {};
      var l = null;
      Result = {};
      l = this.GetCellAppearance(this.GetCellState(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow))),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow)),false);
      if (l != null) Result = rtl.refSet(l.FFont.FStyle);
      return Result;
    };
    this.GetGrid = function (AColumn, ARow) {
      var Result = null;
      var cd = null;
      var o = null;
      Result = null;
      cd = this.GetCellData(AColumn,ARow);
      if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd)) {
        o = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FRenderer;
        if ((o != null) && $mod.TTMSFNCDataGridRenderer.isPrototypeOf(o)) Result = rtl.as(o,$mod.TTMSFNCDataGridRenderer);
      };
      if (!(Result != null)) throw pas.SysUtils.Exception.$create("Create$1",[rtl.getResStr($mod,"sTMSFNCDataGridNotAvailableError")]);
      return Result;
    };
    this.GetHasBitmap = function (AColumn, ARow) {
      var Result = false;
      var cd = null;
      var cl = null;
      Result = false;
      cl = this.GetColumn(AColumn);
      if ((cl != null) && ($mod.TTMSFNCDataGridColumnSetting.gcsType in cl.FSettings)) {
        Result = cl.FType === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitBitmap;
        Result = Result && this.CheckRange(cl.FTypeRange,ARow);
      } else {
        cd = this.GetCellData(AColumn,ARow);
        if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd)) Result = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FType === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitBitmap;
      };
      return Result;
    };
    this.GetHasButton = function (AColumn, ARow) {
      var Result = false;
      var cd = null;
      var cl = null;
      Result = false;
      cl = this.GetColumn(AColumn);
      if ((cl != null) && ($mod.TTMSFNCDataGridColumnSetting.gcsType in cl.FSettings)) {
        Result = cl.FType === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitButton;
        Result = Result && this.CheckRange(cl.FTypeRange,ARow);
      } else {
        cd = this.GetCellData(AColumn,ARow);
        if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd)) Result = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FType === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitButton;
      };
      return Result;
    };
    this.GetHasCheckBox = function (AColumn, ARow) {
      var Result = false;
      var cd = null;
      var cl = null;
      Result = false;
      cl = this.GetColumn(AColumn);
      if ((cl != null) && ($mod.TTMSFNCDataGridColumnSetting.gcsType in cl.FSettings)) {
        Result = cl.FType === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitCheckBox;
        Result = Result && this.CheckRange(cl.FTypeRange,ARow);
      } else {
        cd = this.GetCellData(AColumn,ARow);
        if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd)) Result = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FType === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitCheckBox;
      };
      return Result;
    };
    this.GetHasDataCheckBox = function (AColumn, ARow) {
      var Result = false;
      var cd = null;
      var cl = null;
      Result = false;
      cl = this.GetColumn(AColumn);
      if ((cl != null) && ($mod.TTMSFNCDataGridColumnSetting.gcsType in cl.FSettings)) {
        Result = cl.FType === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitDataCheckBox;
        Result = Result && this.CheckRange(cl.FTypeRange,ARow);
      } else {
        cd = this.GetCellData(AColumn,ARow);
        if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd)) Result = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FType === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitDataCheckBox;
      };
      return Result;
    };
    this.GetHasDataProgressBar = function (AColumn, ARow) {
      var Result = false;
      var cd = null;
      var cl = null;
      Result = false;
      cl = this.GetColumn(AColumn);
      if ((cl != null) && ($mod.TTMSFNCDataGridColumnSetting.gcsType in cl.FSettings)) {
        Result = cl.FType === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitDataProgressBar;
        Result = Result && this.CheckRange(cl.FTypeRange,ARow);
      } else {
        cd = this.GetCellData(AColumn,ARow);
        if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd)) Result = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FType === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitDataProgressBar;
      };
      return Result;
    };
    this.GetHasDataRadioButton = function (AColumn, ARow) {
      var Result = false;
      var cd = null;
      var cl = null;
      Result = false;
      cl = this.GetColumn(AColumn);
      if ((cl != null) && ($mod.TTMSFNCDataGridColumnSetting.gcsType in cl.FSettings)) {
        Result = cl.FType === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitDataRadioButton;
        Result = Result && this.CheckRange(cl.FTypeRange,ARow);
      } else {
        cd = this.GetCellData(AColumn,ARow);
        if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd)) Result = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FType === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitDataRadioButton;
      };
      return Result;
    };
    this.GetHasFilterEditor = function (AColumn, ARow) {
      var Result = false;
      var cd = null;
      Result = false;
      cd = this.GetCellData(AColumn,ARow);
      if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd)) Result = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FFilterEditor != null;
      return Result;
    };
    this.GetHasGrid = function (AColumn, ARow) {
      var Result = false;
      var cd = null;
      var o = null;
      Result = false;
      cd = this.GetCellData(AColumn,ARow);
      if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd)) {
        o = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FRenderer;
        if ((o != null) && $mod.TTMSFNCDataGridRenderer.isPrototypeOf(o)) Result = true;
      };
      return Result;
    };
    this.GetHasLayout = function (AColumn, ARow) {
      var Result = false;
      var cd = null;
      Result = false;
      cd = this.GetCellData(AColumn,ARow);
      if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd)) Result = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FLayout != null;
      return Result;
    };
    this.GetHasProgressBar = function (AColumn, ARow) {
      var Result = false;
      var cd = null;
      var cl = null;
      Result = false;
      cl = this.GetColumn(AColumn);
      if ((cl != null) && ($mod.TTMSFNCDataGridColumnSetting.gcsType in cl.FSettings)) {
        Result = cl.FType === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitProgressBar;
        Result = Result && this.CheckRange(cl.FTypeRange,ARow);
      } else {
        cd = this.GetCellData(AColumn,ARow);
        if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd)) Result = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FType === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitProgressBar;
      };
      return Result;
    };
    this.GetHasRadioButton = function (AColumn, ARow) {
      var Result = false;
      var cd = null;
      var cl = null;
      Result = false;
      cl = this.GetColumn(AColumn);
      if ((cl != null) && ($mod.TTMSFNCDataGridColumnSetting.gcsType in cl.FSettings)) {
        Result = cl.FType === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitRadioButton;
        Result = Result && this.CheckRange(cl.FTypeRange,ARow);
      } else {
        cd = this.GetCellData(AColumn,ARow);
        if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd)) Result = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FType === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitRadioButton;
      };
      return Result;
    };
    this.GetHint = function (AColumn, ARow) {
      var Result = "";
      var cd = null;
      Result = "";
      cd = this.GetCellData(AColumn,ARow);
      if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd)) Result = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FHint;
      return Result;
    };
    this.GetLayout = function (AColumn, ARow) {
      var Result = null;
      var cd = null;
      Result = null;
      cd = this.GetCellDataExtended(AColumn,ARow);
      if (cd != null) {
        if (!(cd.FLayout != null)) {
          cd.FLayout = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellLayout.$create("Create$1",[16777215]);
          this.ConfigureLayout(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow)),cd.FLayout,true);
          cd.FLayout.FOnChange = rtl.createCallback(this,"DoLayoutChanged");
        };
        Result = cd.FLayout;
      };
      return Result;
    };
    this.GetLeftColumn = function () {
      var Result = 0;
      Result = this.GetStartColumn();
      return Result;
    };
    this.GetLookupTimer = function () {
      var Result = null;
      if (!(this.FLookupTimer != null)) {
        this.FLookupTimer = pas["WEBLib.ExtCtrls"].TTimer.$create("Create$1",[null]);
        this.FLookupTimer.FOnTimer = rtl.createCallback(this,"DoLookupTimer");
        this.FLookupTimer.SetInterval(this.GetOptions().FLookup.FResetInterval);
        this.FLookupTimer.SetEnabled(false);
      };
      Result = this.FLookupTimer;
      return Result;
    };
    this.GetOptions = function () {
      var Result = null;
      Result = this.FOptions;
      return Result;
    };
    this.GetPageCount = function () {
      var Result = 0;
      var ScrollableRows = 0;
      var PageSize = 0;
      var MaxTopRow = 0;
      var StartTopRow = 0;
      PageSize = this.GetPageScrollSize();
      ScrollableRows = this.FRowCount - this.FFixedRowCount - this.FFreezeRowCount - this.FFixedBottomRowCount;
      if ((PageSize <= 0) || (ScrollableRows <= 0)) return 0;
      MaxTopRow = this.FRowCount - this.FFixedBottomRowCount - 1;
      StartTopRow = this.FFixedRowCount + this.FFreezeRowCount;
      Result = rtl.trunc((((MaxTopRow - StartTopRow) + 1 + PageSize) - 1) / PageSize);
      return Result;
    };
    this.GetPageIndex = function () {
      var Result = 0;
      var MidRow = 0;
      if ((this.FRowCount <= (this.FFixedRowCount + this.FFreezeRowCount + this.FFixedBottomRowCount)) || (this.GetPageScrollSize() <= 0)) return 0;
      if (this.GetBottomRow() === (this.FRowCount - 1 - this.FFixedBottomRowCount)) {
        Result = this.GetPageCount() - 1}
       else {
        MidRow = this.GetTopRow() + rtl.trunc((this.GetBottomRow() - this.GetTopRow()) / 2);
        Result = this.GetPageIndexForRow(MidRow);
      };
      return Result;
    };
    this.GetProgressValue = function (AColumn, ARow) {
      var Result = 0;
      var cd = null;
      Result = 0;
      if (this.GetHasDataProgressBar(AColumn,ARow)) {
        Result = this.GetInt(AColumn,ARow)}
       else {
        cd = this.GetCellData(AColumn,ARow);
        if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd)) Result = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FIntegerValue;
      };
      return Result;
    };
    this.GetRadioGroupIndex = function (AColumn, ARow) {
      var Result = 0;
      var cd = null;
      Result = -1;
      cd = this.GetCellData(AColumn,ARow);
      if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd)) Result = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FRadioGroupIndex;
      return Result;
    };
    this.GetReadOnly = function (AColumn, ARow) {
      var Result = false;
      var cd = null;
      var cl = null;
      Result = false;
      cl = this.GetColumn(AColumn);
      if ((cl != null) && ($mod.TTMSFNCDataGridColumnSetting.gcsReadOnly in cl.FSettings)) {
        Result = cl.FReadOnly}
       else {
        cd = this.GetCellData(AColumn,ARow);
        if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd)) Result = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FReadOnly;
      };
      return Result;
    };
    this.GetReplaceDialog = function () {
      var Result = null;
      if (!(this.FReplaceDialog != null)) {
        this.FReplaceDialog = pas["WEBLib.TMSFNCReplaceDialog"].TTMSFNCReplaceDialog.$create("Create$1",[null]);
        this.FReplaceDialog.FOptions = rtl.createSet(pas["WEBLib.TMSFNCReplaceDialog"].TTMSFNCReplaceDialogOption.rdoCaseSensitive,pas["WEBLib.TMSFNCReplaceDialog"].TTMSFNCReplaceDialogOption.rdoFindEnabled,pas["WEBLib.TMSFNCReplaceDialog"].TTMSFNCReplaceDialogOption.rdoFindNextEnabled,pas["WEBLib.TMSFNCReplaceDialog"].TTMSFNCReplaceDialogOption.rdoReplaceAllEnabled,pas["WEBLib.TMSFNCReplaceDialog"].TTMSFNCReplaceDialogOption.rdoReplaceEnabled,pas["WEBLib.TMSFNCReplaceDialog"].TTMSFNCReplaceDialogOption.rdoCloseEnabled,pas["WEBLib.TMSFNCReplaceDialog"].TTMSFNCReplaceDialogOption.rdoDown);
        this.FReplaceDialog.FVisibleOptions = rtl.createSet(pas["WEBLib.TMSFNCReplaceDialog"].TTMSFNCReplaceDialogVisibleOption.rdovCaseSensitive,pas["WEBLib.TMSFNCReplaceDialog"].TTMSFNCReplaceDialogVisibleOption.rdovExpression,pas["WEBLib.TMSFNCReplaceDialog"].TTMSFNCReplaceDialogVisibleOption.rdovWholeWordOnly,pas["WEBLib.TMSFNCReplaceDialog"].TTMSFNCReplaceDialogVisibleOption.rdovReplace,pas["WEBLib.TMSFNCReplaceDialog"].TTMSFNCReplaceDialogVisibleOption.rdovReplaceAll,pas["WEBLib.TMSFNCReplaceDialog"].TTMSFNCReplaceDialogVisibleOption.rdovFind,pas["WEBLib.TMSFNCReplaceDialog"].TTMSFNCReplaceDialogVisibleOption.rdovFindNext,pas["WEBLib.TMSFNCReplaceDialog"].TTMSFNCReplaceDialogVisibleOption.rdovClose,pas["WEBLib.TMSFNCReplaceDialog"].TTMSFNCReplaceDialogVisibleOption.rdovFindCombo,pas["WEBLib.TMSFNCReplaceDialog"].TTMSFNCReplaceDialogVisibleOption.rdovFindMemo,pas["WEBLib.TMSFNCReplaceDialog"].TTMSFNCReplaceDialogVisibleOption.rdovReplaceCombo,pas["WEBLib.TMSFNCReplaceDialog"].TTMSFNCReplaceDialogVisibleOption.rdovDirection);
        this.FReplaceDialog.FOnFind = rtl.createCallback(this,"DoReplaceFind");
        this.FReplaceDialog.FOnFindNext = rtl.createCallback(this,"DoReplaceFindNext");
        this.FReplaceDialog.FOnReplace = rtl.createCallback(this,"DoReplace");
        this.FReplaceDialog.FOnReplaceAll = rtl.createCallback(this,"DoReplaceAll");
      };
      Result = this.FReplaceDialog;
      return Result;
    };
    this.GetRightColumn = function () {
      var Result = 0;
      Result = this.GetStopColumn();
      return Result;
    };
    this.GetScrollTimer = function () {
      var Result = null;
      if (!(this.FScrollTimer != null)) {
        this.FScrollTimer = pas["WEBLib.ExtCtrls"].TTimer.$create("Create$1",[null]);
        this.FScrollTimer.FOnTimer = rtl.createCallback(this,"DoScrollTimer");
        this.FScrollTimer.SetInterval(this.GetOptions().FMouse.FAutoScrollingInterval);
        this.FScrollTimer.SetEnabled(false);
      };
      Result = this.FScrollTimer;
      return Result;
    };
    this.GetSelectedCell = function (AColumn, ARow) {
      var Result = false;
      var $tmp = this.GetOptions().FSelection.FMode;
      if ($tmp === $mod.TTMSFNCDataGridSelectionMode.gsmDisjunctRow) {
        Result = this.GetSelectedRow(ARow)}
       else if ($tmp === $mod.TTMSFNCDataGridSelectionMode.gsmDisjunctColumn) {
        Result = this.GetSelectedColumn(AColumn)}
       else if (($tmp === $mod.TTMSFNCDataGridSelectionMode.gsmDisjunctCell) || ($tmp === $mod.TTMSFNCDataGridSelectionMode.gsmDisjunctCellRange)) {
        if (this.GetSelectedCellDictionary().ContainsKey(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow))) {
          Result = this.GetSelectedCellDictionary().GetItem(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow))}
         else Result = false;
      } else {
        Result = (AColumn >= this.FSelection.StartCell.GetColumn()) && (AColumn <= this.FSelection.StopCell.GetColumn()) && (ARow >= this.FSelection.StartCell.GetRow()) && (ARow <= this.FSelection.StopCell.GetRow());
      };
      return Result;
    };
    this.GetSelectedCellDictionary = function () {
      var Result = null;
      if (!(this.FSelectedCellDictionary != null)) this.FSelectedCellDictionary = $mod.TTMSFNCDataGridSelectedCellDictionary.$create("Create$1",[0]);
      Result = this.FSelectedCellDictionary;
      return Result;
    };
    this.GetSelectedColumn = function (AColumn) {
      var Result = false;
      if (this.GetOptions().FSelection.FMode in rtl.createSet($mod.TTMSFNCDataGridSelectionMode.gsmDisjunctColumn,$mod.TTMSFNCDataGridSelectionMode.gsmDisjunctCell,$mod.TTMSFNCDataGridSelectionMode.gsmDisjunctCellRange)) {
        if (this.GetSelectedColumnDictionary().ContainsKey(AColumn)) {
          Result = this.GetSelectedColumnDictionary().GetItem(AColumn)}
         else Result = false;
      } else Result = (AColumn >= this.FSelection.StartCell.GetColumn()) && (AColumn <= this.FSelection.StopCell.GetColumn());
      return Result;
    };
    this.GetSelectedColumnDictionary = function () {
      var Result = null;
      if (!(this.FSelectedColumnDictionary != null)) this.FSelectedColumnDictionary = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridBooleanDictionary.$create("Create$1",[0]);
      Result = this.FSelectedColumnDictionary;
      return Result;
    };
    this.GetSelectedRow = function (ARow) {
      var Result = false;
      if (this.GetOptions().FSelection.FMode in rtl.createSet($mod.TTMSFNCDataGridSelectionMode.gsmDisjunctRow,$mod.TTMSFNCDataGridSelectionMode.gsmDisjunctCell,$mod.TTMSFNCDataGridSelectionMode.gsmDisjunctCellRange)) {
        if (this.GetSelectedRowDictionary().ContainsKey(ARow)) {
          Result = this.GetSelectedRowDictionary().GetItem(ARow)}
         else Result = false;
      } else Result = (ARow >= this.FSelection.StartCell.GetRow()) && (ARow <= this.FSelection.StopCell.GetRow());
      return Result;
    };
    this.GetSelectedRowDictionary = function () {
      var Result = null;
      if (!(this.FSelectedRowDictionary != null)) this.FSelectedRowDictionary = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridBooleanDictionary.$create("Create$1",[0]);
      Result = this.FSelectedRowDictionary;
      return Result;
    };
    this.GetState = function (AColumn, ARow) {
      var Result = 0;
      Result = this.GetCellState(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow)));
      return Result;
    };
    this.GetTextAlign = function (AColumn, ARow) {
      var Result = 0;
      var l = null;
      Result = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading;
      l = this.GetCellAppearance(this.GetCellState(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow))),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow)),false);
      if (l != null) Result = l.FTextAlign;
      return Result;
    };
    this.GetTextAngle = function (AColumn, ARow) {
      var Result = 0.0;
      var l = null;
      Result = 0.0;
      l = this.GetCellAppearance(this.GetCellState(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow))),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow)),false);
      if (l != null) Result = l.FTextAngle;
      return Result;
    };
    this.GetTopRow = function () {
      var Result = 0;
      Result = this.GetStartRow();
      return Result;
    };
    this.GetVerticalTextAlign = function (AColumn, ARow) {
      var Result = 0;
      var l = null;
      Result = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading;
      l = this.GetCellAppearance(this.GetCellState(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow))),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow)),false);
      if (l != null) Result = l.FVerticalTextAlign;
      return Result;
    };
    this.GetWordWrapping = function (AColumn, ARow) {
      var Result = false;
      var l = null;
      Result = false;
      l = this.GetCellAppearance(this.GetCellState(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow))),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow)),false);
      if (l != null) Result = l.FWordWrapping;
      return Result;
    };
    this.SetAdaptToStyle = function (Value) {
      this.FAdaptToStyle = Value;
      if (this.GetAdaptToStyle()) {
        this.FAdaptedToStyle = true;
        this.ApplyStyle();
      } else if (this.FAdaptedToStyle) {
        this.ResetToDefaultStyle();
        this.FAdaptedToStyle = false;
      };
    };
    this.SetBitmapContainer = function (Value) {
      this.FBitmapContainer = Value;
      this.Display();
    };
    this.SetCellAppearance = function (Value) {
      if (this.FCellAppearance !== Value) this.FCellAppearance.Assign(Value);
    };
    this.SetColor = function (AColumn, ARow, Value) {
      var l = null;
      l = this.GetLayout(AColumn,ARow);
      if (l != null) l.FFill.SetColor(Value);
    };
    this.SetColumns = function (Value) {
      this.FColumns.Assign(Value);
    };
    this.SetComment = function (AColumn, ARow, Value) {
      var cd = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      this.BeginUpdate();
      try {
        cd = this.GetCellDataExtended(AColumn,ARow);
        if (cd != null) cd.FComment = Value;
      } finally {
        this.EndUpdate();
      };
    };
    this.SetControlAlign = function (AColumn, ARow, Value) {
      var cd = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      this.BeginUpdate();
      try {
        cd = this.GetCellDataExtended(AColumn,ARow);
        if (cd != null) cd.FControlAlign = Value;
      } finally {
        this.EndUpdate();
      };
    };
    this.SetControlHeight = function (AColumn, ARow, Value) {
      var cd = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      this.BeginUpdate();
      try {
        cd = this.GetCellDataExtended(AColumn,ARow);
        if (cd != null) cd.FControlHeight = Value;
      } finally {
        this.EndUpdate();
      };
    };
    this.SetControlHeightDIP = function (AColumn, ARow, Value) {
      this.SetControlHeight(AColumn,ARow,this.ScaleValue$1(Value));
    };
    this.SetControlPosition = function (AColumn, ARow, Value) {
      var cd = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      this.BeginUpdate();
      try {
        cd = this.GetCellDataExtended(AColumn,ARow);
        if (cd != null) cd.FControlPosition = Value;
      } finally {
        this.EndUpdate();
      };
    };
    this.SetControlText = function (AColumn, ARow, Value) {
      var cd = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      this.BeginUpdate();
      try {
        cd = this.GetCellDataExtended(AColumn,ARow);
        if (cd != null) cd.FControlText = Value;
      } finally {
        this.EndUpdate();
      };
    };
    this.SetControlWidth = function (AColumn, ARow, Value) {
      var cd = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      this.BeginUpdate();
      try {
        cd = this.GetCellDataExtended(AColumn,ARow);
        if (cd != null) cd.FControlWidth = Value;
      } finally {
        this.EndUpdate();
      };
    };
    this.SetControlWidthDIP = function (AColumn, ARow, Value) {
      this.SetControlWidth(AColumn,ARow,this.ScaleValue$1(Value));
    };
    this.SetCustomScrollBars = function (Value) {
      if (this.FCustomScrollBars !== Value) {
        this.FCustomScrollBars = Value;
        this.Update();
      };
    };
    this.SetDragAppearance = function (Value) {
      this.FDragAppearance.Assign(Value);
    };
    this.SetAutoFillAppearance = function (Value) {
      this.FAutoFillAppearance.Assign(Value);
    };
    this.SetFilterAppearance = function (Value) {
      this.FFilterAppearance.Assign(Value);
    };
    this.SetFocusedCell = function (Value) {
      var val = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      if (this.FBlockFocusedCell > 0) return;
      this.FBlockFocusedCell += 1;
      try {
        this.SetFocusCell(Value.GetColumn(),Value.GetRow());
        if (this.IsCellDisabled(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Value))) {
          val.$assign(this.NextSelectableColumn(this.GetFocusedCell().GetColumn(),this.GetFocusedCell().GetRow()));
          this.SetFocusCell(val.GetColumn(),val.GetRow());
        };
        this.SelectCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FFocusedCell),{},false,false,false);
      } finally {
        this.FBlockFocusedCell -= 1;
      };
    };
    this.SetFontColor = function (AColumn, ARow, Value) {
      var l = null;
      l = this.GetLayout(AColumn,ARow);
      if (l != null) l.FFont.SetColor(Value);
    };
    this.SetFontName = function (AColumn, ARow, Value) {
      var l = null;
      l = this.GetLayout(AColumn,ARow);
      if (l != null) l.FFont.SetName(Value);
    };
    this.SetFontSize = function (AColumn, ARow, Value) {
      var l = null;
      l = this.GetLayout(AColumn,ARow);
      if (l != null) l.FFont.SetSize(Math.round(Value));
    };
    this.SetFontStyle = function (AColumn, ARow, Value) {
      var l = null;
      l = this.GetLayout(AColumn,ARow);
      if (l != null) l.FFont.SetStyle(rtl.refSet(Value));
    };
    this.SetGlobalFont = function (Value) {
      this.FGlobalFont.Assign(Value);
    };
    this.SetHint = function (AColumn, ARow, Value) {
      var cd = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      this.BeginUpdate();
      try {
        cd = this.GetCellDataExtended(AColumn,ARow);
        if (cd != null) cd.FHint = Value;
      } finally {
        this.EndUpdate();
      };
    };
    this.SetHorizontalScrollBarVisible = function (Value) {
      if (this.FHorizontalScrollBarVisible !== Value) {
        this.FHorizontalScrollBarVisible = Value;
        this.Update();
      };
    };
    this.SetHScrollValue = function (AValue) {
      this.FLocalHScrollValue = AValue;
      if (this.HasExternalScrollBars() && (this.FExternalHorizontalScrollBar != null)) {
        if (this.FExternalHorizontalScrollBar.GetPageSize() > 0) this.FExternalHorizontalScrollBar.SetValue(Math.min(this.FExternalHorizontalScrollBar.GetMax() - this.FExternalHorizontalScrollBar.GetPageSize(),Math.max(0,AValue)));
      } else if (this.HasCustomScrollBars() && (this.GetCustomHorizontalScrollBar() != null)) {
        if (this.GetCustomHorizontalScrollBar().FPageSize > 0) this.GetCustomHorizontalScrollBar().SetValue(Math.min(this.GetCustomHorizontalScrollBar().FMax - this.GetCustomHorizontalScrollBar().FPageSize,Math.max(0,AValue)));
      } else if (this.GetHorizontalScrollBar() != null) {
        if (this.GetHorizontalScrollBar().GetPageSize() > 0) this.GetHorizontalScrollBar().SetPosition(Math.round(Math.min(this.GetHorizontalScrollBar().FMax - this.GetHorizontalScrollBar().GetPageSize(),Math.max(0,AValue))));
      };
    };
    this.SetIcons = function (Value) {
      if (this.FIcons !== Value) this.FIcons.Assign(Value);
    };
    this.SetLeftColumn = function (Value) {
      var cl = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      cl.SetRow(Math.max(this.FFixedRowCount,Math.min(this.GetStartRow(),this.FRowCount - 1 - this.FFixedBottomRowCount)));
      cl.SetColumn(Math.max(this.FFixedColumnCount,Math.min(Value,this.FColumnCount - 1 - this.FFixedRightColumnCount)));
      this.Navigate(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cl),true,false,true);
    };
    this.SetOptions$1 = function (Value) {
      this.GetOptions().Assign(Value);
    };
    this.SetPadding = function (Value) {
      if (this.FPadding !== Value) this.FPadding.Assign(Value);
    };
    this.SetPageIndex = function (Value) {
      if (Value !== this.GetPageIndex()) this.GoToPage(Value);
    };
    this.SetRadioGroupIndex = function (AColumn, ARow, Value) {
      var cd = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      this.BeginUpdate();
      try {
        cd = this.GetCellDataExtended(AColumn,ARow);
        if (cd != null) cd.FRadioGroupIndex = Value;
      } finally {
        this.EndUpdate();
      };
    };
    this.SetReadOnly = function (AColumn, ARow, Value) {
      var cd = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      cd = this.GetCellDataExtended(AColumn,ARow);
      if (cd != null) {
        cd.FReadOnly = Value;
        this.DoUpdate();
      };
    };
    this.SetScrollMode = function (Value) {
      if (this.FScrollMode !== Value) {
        this.FScrollMode = Value;
        if ((this.FAdapter != null) && $mod.TTMSFNCDataGridRendererDataAdapter.isPrototypeOf(this.FAdapter)) rtl.as(this.FAdapter,$mod.TTMSFNCDataGridRendererDataAdapter).UpdateScrollMode();
        this.Update();
      };
    };
    this.SetScrollUpdate = function (Value) {
      if (this.FScrollUpdate !== Value) {
        this.FScrollUpdate = Value;
        if (this.FCustomVerticalScrollBar != null) this.FCustomVerticalScrollBar.SetTracking(this.FScrollUpdate === $mod.TTMSFNCDataGridScrollUpdate.gsuContinuous);
        if (this.FCustomHorizontalScrollBar != null) this.FCustomHorizontalScrollBar.SetTracking(this.FScrollUpdate === $mod.TTMSFNCDataGridScrollUpdate.gsuContinuous);
        this.Update();
      };
    };
    this.SetSelectedCell = function (AColumn, ARow, Value) {
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      if (this.GetSelectedCellDictionary().ContainsKey(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow))) {
        if (Value === false) {
          this.GetSelectedCellDictionary().Remove(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow))}
         else this.GetSelectedCellDictionary().SetItem(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow),Value);
      } else if (Value !== false) this.GetSelectedCellDictionary().Add(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow),Value);
      this.SetSelectedRow(ARow,Value);
      this.SetSelectedColumn(AColumn,Value);
      this.DoUpdate();
    };
    this.SetSelectedColumn = function (AColumn, Value) {
      if (!this.IsColumnValid(AColumn)) return;
      if (this.GetSelectedColumnDictionary().ContainsKey(AColumn)) {
        if (Value === false) {
          this.GetSelectedColumnDictionary().Remove(AColumn)}
         else this.GetSelectedColumnDictionary().SetItem(AColumn,Value);
      } else if (Value !== false) this.GetSelectedColumnDictionary().Add(AColumn,Value);
      this.DoUpdate();
    };
    this.SetSelectedRow = function (ARow, Value) {
      if (!this.IsRowValid(ARow)) return;
      if (this.GetSelectedRowDictionary().ContainsKey(ARow)) {
        if (Value === false) {
          this.GetSelectedRowDictionary().Remove(ARow)}
         else this.GetSelectedRowDictionary().SetItem(ARow,Value);
      } else if (Value !== false) this.GetSelectedRowDictionary().Add(ARow,Value);
      this.DoUpdate();
    };
    this.SetStretchScrollBars = function (Value) {
      if (this.FStretchScrollBars !== Value) {
        this.FStretchScrollBars = Value;
        this.Update();
      };
    };
    this.SetTextAlign = function (AColumn, ARow, Value) {
      var l = null;
      l = this.GetLayout(AColumn,ARow);
      if (l != null) l.SetTextAlign(Value);
    };
    this.SetTextAngle = function (AColumn, ARow, Value) {
      var l = null;
      l = this.GetLayout(AColumn,ARow);
      if (l != null) l.SetTextAngle(Value);
    };
    this.SetTopRow = function (Value) {
      var cl = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      cl.SetRow(Math.max(this.FFixedRowCount,Math.min(Value,this.FRowCount - 1 - this.FFixedBottomRowCount)));
      cl.SetColumn(Math.max(this.FFixedColumnCount,Math.min(this.GetStartColumn(),this.FColumnCount - 1 - this.FFixedRightColumnCount)));
      this.Navigate(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cl),true,true,false);
    };
    this.SetVerticalScrollBarVisible = function (Value) {
      if (this.FVerticalScrollBarVisible !== Value) {
        this.FVerticalScrollBarVisible = Value;
        this.Update();
      };
    };
    this.SetVerticalTextAlign = function (AColumn, ARow, Value) {
      var l = null;
      l = this.GetLayout(AColumn,ARow);
      if (l != null) l.SetVerticalTextAlign(Value);
    };
    this.SetVScrollValue = function (AValue) {
      this.FLocalVScrollValue = AValue;
      if (this.HasExternalScrollBars() && (this.FExternalVerticalScrollBar != null)) {
        if (this.FExternalVerticalScrollBar.GetPageSize() > 0) this.FExternalVerticalScrollBar.SetValue(Math.min(this.FExternalVerticalScrollBar.GetMax() - this.FExternalVerticalScrollBar.GetPageSize(),Math.max(0,AValue)));
      } else if (this.HasCustomScrollBars() && (this.GetCustomVerticalScrollBar() != null)) {
        if (this.GetCustomVerticalScrollBar().FPageSize > 0) this.GetCustomVerticalScrollBar().SetValue(Math.min(this.GetCustomVerticalScrollBar().FMax - this.GetCustomVerticalScrollBar().FPageSize,Math.max(0,AValue)));
      } else if (this.GetVerticalScrollBar() != null) {
        if (this.GetVerticalScrollBar().GetPageSize() > 0) this.GetVerticalScrollBar().SetPosition(Math.round(Math.min(this.GetVerticalScrollBar().FMax - this.GetVerticalScrollBar().GetPageSize(),Math.max(0,AValue))));
      };
    };
    this.SetWordWrapping = function (AColumn, ARow, Value) {
      var l = null;
      l = this.GetLayout(AColumn,ARow);
      if (l != null) l.SetWordWrapping(Value);
    };
    this.GetFilterDialog = function () {
      var Result = null;
      if (!(this.FFilterDialog != null)) {
        this.FFilterDialog = pas["WEBLib.TMSFNCFilterDialog"].TTMSFNCFilterDialog.$create("Create$1",[null]);
        this.FFilterDialog.FOnApplyButtonClicked = rtl.createCallback(this,"DoFilterBuilderApplyButtonClicked");
        this.FFilterDialog.FOnOKButtonClicked = rtl.createCallback(this,"DoFilterBuilderApplyButtonClicked");
        this.FFilterDialog.FOnClose = rtl.createCallback(this,"DoFilterBuilderClose");
        this.FFilterDialog.FOptions.SetButtons(rtl.unionSet(this.FFilterDialog.FOptions.FButtons,rtl.createSet(pas["WEBLib.TMSFNCFilterDialog"].TTMSFNCFilterDialogButton.fdbOk)));
        this.FFilterDialog.SetFilterBuilder(this.GetFilterBuilder());
      };
      Result = this.FFilterDialog;
      return Result;
    };
    this.GetRowIndex = function (ARow) {
      var Result = 0;
      var ri = null;
      Result = ARow;
      ri = this.GetRowData(ARow);
      if (ri != null) Result = ri.FIndex;
      return Result;
    };
    this.SetRowIndex = function (ARow, Value) {
      var ri = null;
      if (!this.IsRowValid(ARow)) return;
      ri = this.GetRowData(ARow);
      if (ri != null) ri.FIndex = Value;
    };
    this.SetPaging = function (Value) {
      if (this.FPaging !== Value) {
        this.FPaging = Value;
        this.Update();
      };
    };
    this.GetBitmapAspectRatio = function (AColumn, ARow) {
      var Result = false;
      var cd = null;
      Result = true;
      cd = this.GetCellData(AColumn,ARow);
      if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd) && (pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FType === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitBitmap)) Result = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FBitmapAspectRatio;
      return Result;
    };
    this.GetBitmapCentered = function (AColumn, ARow) {
      var Result = false;
      var cd = null;
      Result = true;
      cd = this.GetCellData(AColumn,ARow);
      if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd) && (pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FType === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitBitmap)) Result = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FBitmapCentered;
      return Result;
    };
    this.GetBitmapCropped = function (AColumn, ARow) {
      var Result = false;
      var cd = null;
      Result = false;
      cd = this.GetCellData(AColumn,ARow);
      if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd) && (pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FType === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitBitmap)) Result = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FBitmapCropped;
      return Result;
    };
    this.GetBitmapStretched = function (AColumn, ARow) {
      var Result = false;
      var cd = null;
      Result = false;
      cd = this.GetCellData(AColumn,ARow);
      if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd) && (pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FType === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitBitmap)) Result = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FBitmapStretched;
      return Result;
    };
    this.SetBitmapAspectRatio = function (AColumn, ARow, Value) {
      var cd = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      this.BeginUpdate();
      try {
        cd = this.GetCellDataExtended(AColumn,ARow);
        if (cd != null) cd.FBitmapAspectRatio = Value;
      } finally {
        this.EndUpdate();
      };
    };
    this.SetBitmapCentered = function (AColumn, ARow, Value) {
      var cd = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      this.BeginUpdate();
      try {
        cd = this.GetCellDataExtended(AColumn,ARow);
        if (cd != null) cd.FBitmapCentered = Value;
      } finally {
        this.EndUpdate();
      };
    };
    this.SetBitmapCropped = function (AColumn, ARow, Value) {
      var cd = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      this.BeginUpdate();
      try {
        cd = this.GetCellDataExtended(AColumn,ARow);
        if (cd != null) cd.FBitmapCropped = Value;
      } finally {
        this.EndUpdate();
      };
    };
    this.SetBitmapStretched = function (AColumn, ARow, Value) {
      var cd = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      this.BeginUpdate();
      try {
        cd = this.GetCellDataExtended(AColumn,ARow);
        if (cd != null) cd.FBitmapStretched = Value;
      } finally {
        this.EndUpdate();
      };
    };
    this.ResetCapture = function () {
      if (this.FOnResetCapture != null) this.FOnResetCapture(this);
    };
    this.SetProgressValue = function (AColumn, ARow, Value) {
      var $Self = this;
      var cd = null;
      function UpdateCell(ACell, AValue) {
        var cll = null;
        cll = $Self.GetCellObjectForCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
        if (cll != null) {
          cll.UpdateData($Self.GetCellData(ACell.GetColumn(),ACell.GetRow()));
          if (pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellHelper.GetIsProgressBarCell.call(cll)) pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellHelper.GetAsProgressBarCell.call(cll).FValue = AValue;
          cll.CreateControlCache();
        };
      };
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      if (this.GetHasDataProgressBar(AColumn,ARow)) {
        this.SetInt(AColumn,ARow,Value)}
       else {
        cd = this.GetCellDataExtended(AColumn,ARow);
        if (cd != null) pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FIntegerValue = Value;
      };
      UpdateCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow)),Value);
    };
    this.DataGetItemIndex = function () {
      var Result = 0;
      Result = this.GetFocusedCell().GetRow() - this.FFixedRowCount;
      return Result;
    };
    this.DataSetItemIndex = function (AValue) {
      this.SelectCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(this.FFocusedCell.GetColumn(),AValue + this.FFixedRowCount)),{},false,false,false);
    };
    this.ApplySelectionRange = function (ANewStart, ANewStop, ASuggestedFocus, AFinalFocus) {
      var Result = false;
      var OldStart = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var OldStop = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var OldFocus = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var Allow = false;
      OldStart.$assign(this.FSelection.StartCell);
      OldStop.$assign(this.FSelection.StopCell);
      OldFocus.$assign(this.GetFocusedCell());
      Allow = true;
      this.DoSelectingCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ANewStart),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ANewStop),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ASuggestedFocus),{get: function () {
          return Allow;
        }, set: function (v) {
          Allow = v;
        }});
      if (!Allow) {
        if (this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(OldStart))) this.SetStartCell(OldStart.GetColumn(),OldStart.GetRow());
        if (this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(OldStop))) this.SetStopCell(OldStop.GetColumn(),OldStop.GetRow());
        if (this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(OldFocus))) this.SetFocusCell(OldFocus.GetColumn(),OldFocus.GetRow());
        this.FRealCell.$assign(OldFocus);
        this.FFocusedCell.$assign(OldFocus);
        AFinalFocus.$assign(OldFocus);
        Result = false;
        return Result;
      };
      this.SetStartCell(ANewStart.GetColumn(),ANewStart.GetRow());
      this.SetStopCell(ANewStop.GetColumn(),ANewStop.GetRow());
      this.SetFocusCell(ASuggestedFocus.GetColumn(),ASuggestedFocus.GetRow());
      this.FRealCell.$assign(ASuggestedFocus);
      this.FFocusedCell.$assign(ASuggestedFocus);
      AFinalFocus.$assign(ASuggestedFocus);
      Result = true;
      return Result;
    };
    this.CheckRange = function (ARange, ARow) {
      var Result = false;
      Result = true;
      var $tmp = ARange;
      if ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemTypeRange.gcirNormal) {
        Result = Result && (ARow >= this.FFixedRowCount) && (ARow <= (this.FRowCount - 1 - this.FFixedBottomRowCount))}
       else if ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemTypeRange.gcirFixed) Result = Result && ((ARow < this.FFixedRowCount) || (ARow > (this.FRowCount - 1 - this.FFixedBottomRowCount)));
      return Result;
    };
    this.CloseInplaceEditor = function (ACancel, AFlagClose, AEnterKey, AFocusGrid) {
      var Result = false;
      var ivl = pas.RTTI.TValue.$new();
      var vl = undefined;
      var vlv = pas.RTTI.TValue.$new();
      var vlt = pas.RTTI.TValue.$new();
      var cc = false;
      var a = false;
      var nav = false;
      var cl = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var rl = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var Allow = false;
      var l = null;
      var c = false;
      Result = true;
      if (this.FClosing) return Result;
      this.FClosing = true;
      try {
        c = true;
        vl = pas.RTTI.TValue.Empty();
        this.DoBeforeInplaceEditorGetValue(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FEditingCell),this.FInplaceEditor,{get: function () {
            return vl;
          }, set: function (v) {
            vl = v;
          }},{get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }});
        if (c) {
          vl = pas["WEBLib.TMSFNCDataGridData"].GetObjectValue(this.FInplaceEditor,"");
          this.DoAfterInplaceEditorGetValue(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FEditingCell),this.FInplaceEditor,vl);
        };
        vlv.$assign(pas["WEBLib.TMSFNCDataGridData"].CellValueToTValue(vl));
        var $tmp = this.FInplaceEditorTarget;
        if ($tmp === $mod.TTMSFNCDataGridInplaceEditorTarget.getCellValue) {
          vlt.$assign(pas["WEBLib.TMSFNCDataGridData"].CellValueToTValue(this.GetCell(this.FEditingCell.GetColumn(),this.FEditingCell.GetRow())))}
         else if ($tmp === $mod.TTMSFNCDataGridInplaceEditorTarget.getFillColor) {
          vlt.$assign(pas["WEBLib.TMSFNCDataGridData"].CellValueToTValue(-1));
          if (this.GetHasLayout(this.FEditingCell.GetColumn(),this.FEditingCell.GetRow())) vlt.$assign(pas["WEBLib.TMSFNCDataGridData"].CellValueToTValue(this.GetLayout(this.FEditingCell.GetColumn(),this.FEditingCell.GetRow()).FFill.FColor));
        };
        if (vlt.GetTypeKind() !== vlv.GetTypeKind()) {
          var $tmp1 = vlt.GetTypeKind();
          if (($tmp1 === pas.System.TTypeKind.tkInteger) || ($tmp1 === pas.System.TTypeKind.tkEnumeration)) {
            vl = this.$class.ValueToInteger$1(vl,pas.SysUtils.TFormatSettings.$clone(pas.SysUtils.FormatSettings))}
           else if ($tmp1 === pas.System.TTypeKind.tkDouble) {
            vl = this.$class.ValueToFloat$1(vl,pas.SysUtils.TFormatSettings.$clone(pas.SysUtils.FormatSettings))}
           else if ($tmp1 === pas.System.TTypeKind.tkString) {
            vl = this.$class.ValueToString(vl)}
           else {
            vl = this.$class.ValueToString(vl);
          };
        };
        cc = true;
        this.DoBeforeCloseInplaceEditor(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FEditingCell),this.FInplaceEditor,ACancel,{get: function () {
            return vl;
          }, set: function (v) {
            vl = v;
          }},{get: function () {
            return cc;
          }, set: function (v) {
            cc = v;
          }});
        if (cc) {
          if (!ACancel) {
            if (this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FEditingCell))) {
              a = true;
              this.DoCellEditValidateData(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FEditingCell),this.FInplaceEditor,{get: function () {
                  return vl;
                }, set: function (v) {
                  vl = v;
                }},{get: function () {
                  return a;
                }, set: function (v) {
                  a = v;
                }});
              if (a) {
                this.DoCellEditSetData(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FEditingCell),this.FInplaceEditor,{get: function () {
                    return vl;
                  }, set: function (v) {
                    vl = v;
                  }});
                var $tmp2 = this.FInplaceEditorTarget;
                if ($tmp2 === $mod.TTMSFNCDataGridInplaceEditorTarget.getCellValue) {
                  this.SetCell(this.FEditingCell.GetColumn(),this.FEditingCell.GetRow(),vl)}
                 else if ($tmp2 === $mod.TTMSFNCDataGridInplaceEditorTarget.getFillColor) {
                  ivl.$assign(pas["WEBLib.TMSFNCDataGridData"].CellValueToTValue(vl));
                  if (ivl.IsType$1$$$G$$rtti$$NativeInt(true)) {
                    l = this.GetLayout(this.FEditingCell.GetColumn(),this.FEditingCell.GetRow());
                    if (l != null) {
                      l.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
                      l.FFill.SetColor(ivl.AsType$$$G$$rtti$$NativeInt());
                    };
                  };
                };
              };
            };
          };
          this.DestroyEditor();
          nav = false;
          cl.$assign(this.GetFocusedCell());
          rl.$assign(this.FRealCell);
          if (AEnterKey && (this.GetOptions().FKeyboard.FEnterKeyHandling !== $mod.TTMSFNCDataGridEnterKeyHandling.gekhNone)) {
            nav = true;
            cl.$assign(this.ProcessEnterKey(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cl),this.GetOptions().FKeyboard.FEnterKeyHandling));
          };
          if (AFocusGrid) this.Focus();
          this.DoAfterCloseInplaceEditor(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FEditingCell),ACancel,vl);
          this.FEditingCell.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(-1,-1));
          if (nav) {
            this.SelectCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cl),{},false,false,false);
            if (AEnterKey && this.GetOptions().FKeyboard.FEnterKeyDirectEdit) {
              Allow = true;
              this.DoCanEditCell(this.GetFocusedCell().GetColumn(),this.GetFocusedCell().GetRow(),{get: function () {
                  return Allow;
                }, set: function (v) {
                  Allow = v;
                }});
              if (Allow) this.EditCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.GetFocusedCell()),$mod.TTMSFNCDataGridEditCellStart.gcsNone,false,"",0);
            };
          };
          Result = true;
        } else {
          Result = false;
          if (this.FInplaceEditor.CanFocus()) {
            this.FInplaceEditor.SetFocus();
            this.FClearMouseDown = false;
            this.FDblClick = false;
          };
        };
      } finally {
        this.FClosing = false;
      };
      return Result;
    };
    this.CanAutoFill = function () {
      var Result = false;
      Result = !(this.FAdapter != null) && this.IsRangeMode() && this.GetOptions().FSelection.FAutoFill && this.IsSelectionRangeValid();
      return Result;
    };
    this.CellToRect = function (ACell) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var obj = null;
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,0,0));
      if (this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell))) {
        obj = this.GetCellObjectForCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
        if (obj != null) Result.$assign(obj.FRect);
      };
      return Result;
    };
    this.CellRangeToRect = function (AStartCell, AStopCell) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rsa = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rse = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,0,0));
      if (this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(AStartCell)) && this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(AStopCell))) {
        rsa.$assign(this.CellToRect(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(AStartCell)));
        rse.$assign(this.CellToRect(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(AStopCell)));
        if (pas["WEBLib.TMSFNCTypes"].RectIsEmpty(rsa) || pas["WEBLib.TMSFNCTypes"].RectIsEmpty(rse)) {
          Result.$assign(this.CellRangeToRectEx(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(AStartCell),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(AStopCell)))}
         else Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(rsa.Left,rsa.Top,rse.Right,rse.Bottom));
      };
      return Result;
    };
    this.CellRangeToRectEx = function (AStartCell, AStopCell) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var hscroll = 0.0;
      var vscroll = 0.0;
      var fcw = 0.0;
      var frh = 0.0;
      var startX = 0.0;
      var startY = 0.0;
      var stopX = 0.0;
      var stopY = 0.0;
      var contentRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var fcc = 0;
      var frc = 0;
      var startColFixed = false;
      var startRowFixed = false;
      var stopColFixed = false;
      var stopRowFixed = false;
      var clipLeft = 0.0;
      var clipTop = 0.0;
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,0,0));
      if (!this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(AStartCell)) || !this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(AStopCell))) return Result;
      contentRect.$assign(this.GetContentClipRect());
      hscroll = this.GetHorizontalScrollPosition();
      vscroll = this.GetVerticalScrollPosition();
      fcw = this.GetTotalFixedColumnWidth(true);
      frh = this.GetTotalFixedRowHeight(true);
      fcc = this.FFixedColumnCount + this.FFreezeColumnCount;
      frc = this.FFixedRowCount + this.FFreezeRowCount;
      startColFixed = AStartCell.GetColumn() < fcc;
      startRowFixed = AStartCell.GetRow() < frc;
      stopColFixed = AStopCell.GetColumn() < fcc;
      stopRowFixed = AStopCell.GetRow() < frc;
      if (startColFixed) {
        startX = contentRect.Left + this.GetColumnPosition(AStartCell.GetColumn())}
       else startX = (contentRect.Left + fcw + (this.GetColumnPosition(AStartCell.GetColumn()) - this.GetColumnPosition(fcc))) - hscroll;
      if (startRowFixed) {
        startY = contentRect.Top + this.GetRowPosition(AStartCell.GetRow())}
       else startY = (contentRect.Top + frh + (this.GetRowPosition(AStartCell.GetRow()) - this.GetRowPosition(frc))) - vscroll;
      if (stopColFixed) {
        stopX = contentRect.Left + this.GetColumnPosition(AStopCell.GetColumn()) + this.GetColumnWidth(AStopCell.GetColumn())}
       else stopX = ((contentRect.Left + fcw + (this.GetColumnPosition(AStopCell.GetColumn()) - this.GetColumnPosition(fcc))) - hscroll) + this.GetColumnWidth(AStopCell.GetColumn());
      if (stopRowFixed) {
        stopY = contentRect.Top + this.GetRowPosition(AStopCell.GetRow()) + this.GetRowHeight(AStopCell.GetRow())}
       else stopY = ((contentRect.Top + frh + (this.GetRowPosition(AStopCell.GetRow()) - this.GetRowPosition(frc))) - vscroll) + this.GetRowHeight(AStopCell.GetRow());
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(startX,startY,stopX,stopY));
      if (!startColFixed && !stopColFixed) {
        clipLeft = contentRect.Left + fcw;
        if (Result.Left < clipLeft) Result.Left = clipLeft;
      };
      if (!startRowFixed && !stopRowFixed) {
        clipTop = contentRect.Top + frh;
        if (Result.Top < clipTop) Result.Top = clipTop;
      };
      return Result;
    };
    this.ColumnStretchingActive = function () {
      var Result = false;
      Result = this.FColumnStretchingActive;
      return Result;
    };
    this.ConfigureScrollBarsRect = function (ARect) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(ARect);
      if (!this.FIsExporting) {
        if (this.HasCustomScrollBars()) {
          if ((this.GetCustomHorizontalScrollBar() != null) && this.GetCustomHorizontalScrollBar().FVisible) Result.Bottom = this.GetCustomHorizontalScrollBar().GetTop();
          if ((this.GetCustomVerticalScrollBar() != null) && this.GetCustomVerticalScrollBar().FVisible) Result.Right = this.GetCustomVerticalScrollBar().GetLeft();
        } else {
          if ((this.GetHorizontalScrollBar() != null) && this.GetHorizontalScrollBar().FVisible) {
            Result.Bottom = this.GetHorizontalScrollBar().GetTop();
          };
          if ((this.GetVerticalScrollBar() != null) && this.GetVerticalScrollBar().FVisible) {
            Result.Right = this.GetVerticalScrollBar().GetLeft();
          };
        };
      };
      return Result;
    };
    this.CreateFilterEditor = function (ACell) {
      var Result = null;
      var a = false;
      var cl = null;
      var fet = 0;
      var ft = 0;
      var v = undefined;
      var i = 0;
      var c = false;
      var f = pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFormatting.$new();
      var fmt = pas.SysUtils.TFormatSettings.$new();
      var I64val = 0;
      var Ival = 0;
      var Dval = 0.0;
      var dt = 0.0;
      var vl = pas.RTTI.TValue.$new();
      Result = null;
      i = this.FFixedRowCount;
      while (!this.IsRowNormal(i) && (i < this.FRowCount)) i += 1;
      v = this.GetCell(ACell.GetColumn(),i);
      a = true;
      this.DoBeforeCreateFilterEditor(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),{get: function () {
          return a;
        }, set: function (v) {
          a = v;
        }});
      if (a) {
        cl = this.GetColumn(ACell.GetColumn());
        if ((cl != null) && ($mod.TTMSFNCDataGridColumnSetting.gcsFilterEditorType in cl.FSettings)) {
          fet = cl.FFilterEditorType}
         else fet = $mod.TTMSFNCDataGridFilterEditorType.gfetAutomatic;
        ft = $mod.TTMSFNCDataGridFilterEditorType.gfetString;
        if (fet === $mod.TTMSFNCDataGridFilterEditorType.gfetAutomatic) {
          f.$assign(pas["WEBLib.TMSFNCDataGridData"].DefaultFormatting());
          fmt.$assign(pas.SysUtils.FormatSettings);
          c = true;
          this.DoGetCellFormatting(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),v,f,fmt,{get: function () {
              return c;
            }, set: function (v) {
              c = v;
            }});
          if (c) {
            var $tmp = f.Type;
            if ($tmp === pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFormattingType.gdftBoolean) {
              ft = $mod.TTMSFNCDataGridFilterEditorType.gfetBoolean}
             else if (($tmp === pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFormattingType.gdftDateTime) || ($tmp === pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFormattingType.gdftDate) || ($tmp === pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFormattingType.gdftTime)) {
              ft = $mod.TTMSFNCDataGridFilterEditorType.gfetDateTime}
             else if ($tmp === pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFormattingType.gdftFloat) {
              ft = $mod.TTMSFNCDataGridFilterEditorType.gfetFloat}
             else if ($tmp === pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFormattingType.gdftNumber) {
              ft = $mod.TTMSFNCDataGridFilterEditorType.gfetNumber}
             else if ($tmp === pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFormattingType.gdftDefault) {
              if (this.$class.ValueIsBoolean(v)) {
                ft = $mod.TTMSFNCDataGridFilterEditorType.gfetBoolean}
               else if (this.$class.ValueIsInteger(v)) {
                ft = $mod.TTMSFNCDataGridFilterEditorType.gfetNumber}
               else if (this.$class.ValueIsFloat(v)) {
                ft = $mod.TTMSFNCDataGridFilterEditorType.gfetFloat}
               else if (this.$class.ValueIsString(v)) {
                vl.$assign(pas["WEBLib.TMSFNCDataGridData"].CellValueToTValue(v));
                if (pas.SysUtils.TryStrToInt(vl.AsString(),{get: function () {
                    return Ival;
                  }, set: function (v) {
                    Ival = v;
                  }})) {
                  ft = $mod.TTMSFNCDataGridFilterEditorType.gfetNumber}
                 else if (pas.SysUtils.TryStrToInt64(vl.AsString(),{get: function () {
                    return I64val;
                  }, set: function (v) {
                    I64val = v;
                  }})) {
                  ft = $mod.TTMSFNCDataGridFilterEditorType.gfetNumber}
                 else if (pas.SysUtils.TryStrToFloat$3(vl.AsString(),{get: function () {
                    return Dval;
                  }, set: function (v) {
                    Dval = v;
                  }},fmt)) {
                  ft = $mod.TTMSFNCDataGridFilterEditorType.gfetFloat}
                 else if (pas.SysUtils.TryStrToDateTime(vl.AsString(),{get: function () {
                    return dt;
                  }, set: function (v) {
                    dt = v;
                  }})) {
                  ft = $mod.TTMSFNCDataGridFilterEditorType.gfetDateTime}
                 else if (pas.DateUtils.TryISO8601ToDate(vl.AsString(),{get: function () {
                    return dt;
                  }, set: function (v) {
                    dt = v;
                  }},true)) ft = $mod.TTMSFNCDataGridFilterEditorType.gfetDateTime;
              };
            };
          } else ft = $mod.TTMSFNCDataGridFilterEditorType.gfetString;
        } else ft = fet;
        var $tmp1 = ft;
        if ($tmp1 === $mod.TTMSFNCDataGridFilterEditorType.gfetCustom) {
          Result = this.DoCreateCustomFilterEditor(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell))}
         else {
          Result = $mod.TTMSFNCDataGridFilterPanel.$create("Create$7",[null,this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),ft]);
        };
        if (Result != null) {
          Result.FTag$1 = ACell.GetColumn();
          this.DoAfterCreateFilterEditor(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),Result);
        };
      };
      return Result;
    };
    this.DoCreateCustomFilterEditor = function (ACell) {
      var Result = null;
      Result = null;
      if (this.FOnCreateCustomFilterEditor != null) Result = this.FOnCreateCustomFilterEditor(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
      return Result;
    };
    this.DoIsDesigntimeGrid = function (Sender) {
      var Result = false;
      Result = false;
      if (this.FOnIsDesigntime != null) Result = this.FOnIsDesigntime(Sender);
      return Result;
    };
    this.DoIsDestroyingGrid = function (Sender) {
      var Result = false;
      Result = false;
      if (this.FOnIsDestroying != null) Result = this.FOnIsDestroying(Sender);
      return Result;
    };
    this.DoIsFocusedGrid = function (Sender) {
      var Result = false;
      Result = false;
      if (this.FOnIsFocused != null) Result = this.FOnIsFocused(Sender);
      return Result;
    };
    this.DoIsLoadingGrid = function (Sender) {
      var Result = false;
      Result = false;
      if (this.FOnIsLoading != null) Result = this.FOnIsLoading(Sender);
      return Result;
    };
    this.GetBaseCellClass = function (ACell) {
      var Result = null;
      var r = null;
      var cl = null;
      var fe = false;
      Result = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCell;
      fe = false;
      if (this.GetOptions().FFiltering.FEnabled && !this.GetOptions().FFiltering.FAdvanced && (this.GetOptions().FFiltering.FRow === ACell.GetRow()) && (ACell.GetColumn() >= this.FFixedColumnCount) && (ACell.GetColumn() <= (this.FColumnCount - this.FFixedRightColumnCount - 1))) {
        cl = this.GetColumn(ACell.GetColumn());
        if ((cl != null) && ($mod.TTMSFNCDataGridColumnSetting.gcsFilterEditor in cl.FSettings)) {
          fe = cl.FFilterEditor}
         else fe = pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilterControl.gfcEditor in this.GetOptions().FFiltering.FControls;
      };
      if (!fe && !this.GetOptions().FFiltering.FAdvanced) fe = this.GetHasFilterEditor(ACell.GetColumn(),ACell.GetRow());
      if (this.GetHasGrid(ACell.GetColumn(),ACell.GetRow())) {
        r = this.GetGrid(ACell.GetColumn(),ACell.GetRow());
        if (r != null) Result = $mod.TTMSFNCDataGridRendererCell;
      } else if (fe) {
        Result = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridFilterEditorCell}
       else if (this.GetHasCheckBox(ACell.GetColumn(),ACell.GetRow())) {
        Result = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCheckBoxCell}
       else if (this.GetHasDataCheckBox(ACell.GetColumn(),ACell.GetRow())) {
        Result = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridDataCheckBoxCell}
       else if (this.GetHasButton(ACell.GetColumn(),ACell.GetRow())) {
        Result = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridButtonCell}
       else if (this.GetHasBitmap(ACell.GetColumn(),ACell.GetRow())) {
        Result = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridBitmapCell}
       else if (this.GetHasProgressBar(ACell.GetColumn(),ACell.GetRow())) {
        Result = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridProgressBarCell}
       else if (this.GetHasDataProgressBar(ACell.GetColumn(),ACell.GetRow())) {
        Result = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridDataProgressBarCell}
       else if (this.GetHasRadioButton(ACell.GetColumn(),ACell.GetRow())) {
        Result = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridRadioButtonCell}
       else if (this.GetHasDataRadioButton(ACell.GetColumn(),ACell.GetRow())) {
        Result = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridDataRadioButtonCell}
       else if ((this.GetRowType(ACell.GetRow()) === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowType.grtNode) && (ACell.GetColumn() === this.GetOptions().FColumn.FNodeIndex)) Result = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridNodeCell;
      return Result;
    };
    this.GetBoolean = function (AColumn, ARow) {
      var Result = false;
      var cl = null;
      Result = false;
      if (this.GetHasDataCheckBox(AColumn,ARow) || this.GetHasDataRadioButton(AColumn,ARow)) {
        cl = this.GetColumn(AColumn);
        if (cl != null) Result = this.GetString(AColumn,ARow) === cl.FBinding.FBooleanTrueValue;
      } else Result = pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridData.GetBoolean.call(this,AColumn,ARow);
      return Result;
    };
    this.GetCalculationRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(this.LocalRect());
      Result.Right = Result.Left + Math.max(0,Result.Right - Result.Left);
      Result.Bottom = Result.Top + Math.max(0,Result.Bottom - Result.Top);
      Result.$assign(this.ConfigureScrollBarsRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(Result)));
      return Result;
    };
    this.GetCellAppearance = function (AState, ACell, ASkipCellLayout) {
      var Result = null;
      var c = null;
      var cll = null;
      var ap = null;
      var cl = null;
      var rr = 0;
      var b = false;
      cll = null;
      if (!ASkipCellLayout && this.GetHasLayout(ACell.GetColumn(),ACell.GetRow())) cll = this.GetLayout(ACell.GetColumn(),ACell.GetRow());
      cl = this.GetColumn(ACell.GetColumn());
      if ((cl != null) && ($mod.TTMSFNCDataGridColumnSetting.gcsAppearance in cl.FSettings)) {
        ap = cl.FAppearance}
       else ap = this.FCellAppearance;
      b = false;
      var $tmp = AState;
      if ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellState.gcsNormal) {
        rr = ACell.GetRow();
        if (this.IsGrouped() && this.IsRowNode(rr)) {
          c = ap.FGroupLayout}
         else if (this.IsGrouped() && this.IsRowSummary(rr)) {
          c = ap.FSummaryLayout}
         else {
          if (this.GetHasFilter() && (pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilteringAction.gdfaApplyAppearance in this.GetOptions().FFiltering.FActions) && this.IsRowNormal(ACell.GetRow())) {
            if (!this.IsRowFiltered(ACell.GetRow())) {
              c = ap.FFilterMatchLayout}
             else c = ap.FFilterInverseMatchLayout;
          } else if (this.GetOptions().FBanding.FEnabled && this.IsRowBand(ACell.GetRow())) {
            c = ap.FBandLayout}
           else {
            c = ap.FNormalLayout;
            b = true;
          };
        };
      } else if ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellState.gcsFocused) {
        c = ap.FFocusedLayout}
       else if ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellState.gcsFixed) {
        c = ap.FFixedLayout}
       else if ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellState.gcsFixedSelected) {
        c = ap.FFixedSelectedLayout}
       else if ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellState.gcsSelected) {
        c = ap.FSelectedLayout}
       else {
        c = null;
      };
      if (!(this.FCellLayout != null)) this.FCellLayout = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellLayout.$create("Create$1",[16777215]);
      if (c != null) {
        this.FCellLayout.Assign(c);
        if (cll != null) {
          this.DoGetCellLayoutHasPriority(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),{get: function () {
              return b;
            }, set: function (v) {
              b = v;
            }});
          if (b) {
            this.FCellLayout.Assign(cll)}
           else {
            this.FCellLayout.SetSides(rtl.refSet(cll.FSides));
            this.FCellLayout.FFont.SetColor(cll.FFont.FColor);
            this.FCellLayout.FFont.SetName(cll.FFont.FName);
            this.FCellLayout.FFont.SetSize(cll.FFont.FSize);
            this.FCellLayout.FFont.SetStyle(rtl.refSet(cll.FFont.FStyle));
            this.FCellLayout.SetTextAlign(cll.FTextAlign);
            this.FCellLayout.SetTextAngle(cll.FTextAngle);
            this.FCellLayout.SetVerticalTextAlign(cll.FVerticalTextAlign);
            this.FCellLayout.SetWordWrapping(cll.FWordWrapping);
            this.FCellLayout.SetTrimming(cll.FTrimming);
          };
        };
        Result = this.FCellLayout;
      } else Result = null;
      return Result;
    };
    this.GetCellState = function (ACell) {
      var Result = 0;
      if ((this.GetOptions().FSelection.FMode !== $mod.TTMSFNCDataGridSelectionMode.gsmNone) && (this.GetFocusedCell().GetRow() === ACell.GetRow()) && (this.GetFocusedCell().GetColumn() === ACell.GetColumn()) && this.IsFocused()) {
        Result = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellState.gcsFocused}
       else {
        if (this.IsCellFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell))) {
          if ((this.GetOptions().FSelection.FMode !== $mod.TTMSFNCDataGridSelectionMode.gsmNone) && this.GetOptions().FSelection.FShowSelectionInFixedCells && this.IsFixedCellSelected(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(ACell.GetColumn(),ACell.GetRow())))) {
            Result = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellState.gcsFixedSelected}
           else Result = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellState.gcsFixed;
        } else if ((this.GetOptions().FSelection.FMode !== $mod.TTMSFNCDataGridSelectionMode.gsmNone) && this.IsCellSelected(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(ACell.GetColumn(),ACell.GetRow())))) {
          Result = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellState.gcsSelected}
         else Result = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellState.gcsNormal;
      };
      return Result;
    };
    this.GetColumn = function (AColumn) {
      var Result = null;
      Result = null;
      if ((AColumn >= 0) && (AColumn <= (this.FColumns.GetCount() - 1))) Result = this.FColumns.GetItem$1(AColumn);
      return Result;
    };
    this.GetColumnsClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCDataGridColumns;
      return Result;
    };
    this.GetColumnFilterName = function (AColumn) {
      var Result = "";
      var cl = null;
      Result = "";
      cl = this.GetColumn(AColumn);
      if (cl != null) Result = cl.GetDisplayName();
      if (Result === "") Result = pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridData.GetColumnFilterName.call(this,AColumn);
      return Result;
    };
    this.GetColumnViewPortSize = function () {
      var Result = 0.0;
      var I = 0;
      var cnt = 0;
      var w = 0.0;
      var cw = 0.0;
      var cr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      cr.$assign(this.GetContentRect());
      cw = cr.Right - cr.Left;
      Result = 0;
      w = 0;
      cnt = 0;
      for (var $l = this.FColumnCount - 1; $l >= 0; $l--) {
        I = $l;
        w = w + this.GetColumnWidth(I);
        if (w > cw) {
          Result = Math.max(1,cnt);
          break;
        };
        cnt += 1;
      };
      return Result;
    };
    this.GetContentRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCore.GetContentRect.call(this));
      Result.Right = Result.Left + Math.max(0,Result.Right - Result.Left);
      Result.Bottom = Result.Top + Math.max(0,Result.Bottom - Result.Top);
      Result.$assign(this.ConfigureScrollBarsRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(Result)));
      return Result;
    };
    this.GetFullRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCore.GetContentRect.call(this));
      if (!this.FIsExporting) {
        if (this.HasCustomScrollBars()) {
          if ((this.GetCustomHorizontalScrollBar() != null) && this.GetCustomHorizontalScrollBar().FVisible) Result.Bottom = this.GetCustomHorizontalScrollBar().GetTop() + this.GetCustomHorizontalScrollBar().GetHeight();
          if ((this.GetCustomVerticalScrollBar() != null) && this.GetCustomVerticalScrollBar().FVisible) Result.Right = this.GetCustomVerticalScrollBar().GetLeft() + this.GetCustomVerticalScrollBar().GetWidth();
        } else {
          if ((this.GetHorizontalScrollBar() != null) && this.GetHorizontalScrollBar().FVisible) {
            Result.Bottom = this.GetHorizontalScrollBar().GetTop();
            Result.Bottom = Result.Bottom + this.GetHorizontalScrollBar().GetHeight();
          };
          if ((this.GetVerticalScrollBar() != null) && this.GetVerticalScrollBar().FVisible) {
            Result.Right = this.GetVerticalScrollBar().GetLeft();
            Result.Right = Result.Right + this.GetVerticalScrollBar().GetWidth();
          };
        };
      };
      return Result;
    };
    this.GetHintString = function () {
      var Result = "";
      Result = "";
      if (this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FHoverCell))) {
        Result = this.GetHint(this.FHoverCell.GetColumn(),this.FHoverCell.GetRow());
        this.DoGetCellHint(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FHoverCell),{get: function () {
            return Result;
          }, set: function (v) {
            Result = v;
          }});
      };
      return Result;
    };
    this.GetHorizontalScrollBar = function () {
      var Result = null;
      Result = this.FHorizontalScrollBar;
      return Result;
    };
    this.GetHorizontalScrollPosition = function () {
      var Result = 0.0;
      var hVal = 0.0;
      var scrollh = 0.0;
      hVal = this.GetHScrollValue();
      if (this.GetHorizontalScrollMode() === $mod.TTMSFNCDataGridScrollMode.gsmCellScrolling) {
        if (this.GetHVisible()) {
          scrollh = this.GetColumnPosition(Math.round(hVal))}
         else scrollh = this.GetColumnPosition(0);
        hVal = scrollh;
      };
      Result = hVal;
      return Result;
    };
    this.GetHVisible = function () {
      var Result = false;
      Result = false;
      if (this.HasCustomScrollBars() && (this.GetCustomHorizontalScrollBar() != null)) {
        Result = this.GetCustomHorizontalScrollBar().FVisible}
       else if (this.GetHorizontalScrollBar() != null) Result = this.GetHorizontalScrollBar().FVisible;
      return Result;
    };
    this.GetInplaceEditor = function () {
      var Result = null;
      Result = this.FInplaceEditor;
      return Result;
    };
    this.GetInplaceEditorRect = function (ACell) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var cr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var c = null;
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,0,0));
      c = this.GetCellObjectForCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
      if (c != null) {
        if ((this.FInplaceEditorType !== $mod.TTMSFNCDataGridInplaceEditorType.getNone) && (this.FInplaceEditor != null)) {
          if ((pas["WEBLib.StdCtrls"].TCustomEdit.isPrototypeOf(this.FInplaceEditor) || pas["WEBLib.StdCtrls"].TCustomMemo.isPrototypeOf(this.FInplaceEditor)) && !(this.FInplaceEditorType in rtl.createSet($mod.TTMSFNCDataGridInplaceEditorType.getCustom,$mod.TTMSFNCDataGridInplaceEditorType.getComboEdit))) {
            Result.$assign(c.GetActualTextRect());
            pas["WEBLib.TMSFNCTypes"].InflateRectEx(Result,2,0);
            pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(Result,0,-2);
          } else Result.$assign(c.FRect);
          cr.$assign(this.GetContentClipRect());
          Result.Top = Math.max(Result.Top,cr.Top);
          Result.Bottom = Math.min(Result.Bottom,cr.Bottom);
          Result.Left = Math.max(Result.Left,cr.Left);
          Result.Right = Math.min(Result.Right,cr.Right);
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.Math.Floor(Result.Left),pas.Math.Floor(Result.Top),pas.Math.Floor(Result.Right),pas.Math.Floor(Result.Bottom)));
          this.DoGetInplaceEditorRect(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),this.FInplaceEditor,Result);
        };
      };
      return Result;
    };
    this.GetOptionsClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCDataGridOptions;
      return Result;
    };
    this.GetKeyboardPageScrollSize = function () {
      var Result = 0;
      if (this.GetOptions().FKeyboard.FPageScrollSize > 0) {
        Result = this.GetOptions().FKeyboard.FPageScrollSize}
       else Result = this.GetPageScrollSize();
      return Result;
    };
    this.GetRowViewPortSize = function () {
      var Result = 0.0;
      var I = 0;
      var cnt = 0;
      var h = 0.0;
      var ch = 0.0;
      var cr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      cr.$assign(this.GetContentRect());
      ch = cr.Bottom - cr.Top;
      Result = 0;
      h = 0;
      cnt = 0;
      for (var $l = this.FRowCount - 1; $l >= 0; $l--) {
        I = $l;
        h = h + this.GetRowHeight(I);
        if (h > ch) {
          Result = Math.max(1,cnt);
          break;
        };
        cnt += 1;
      };
      return Result;
    };
    this.GetSelectedCellCount = function () {
      var Result = 0;
      var $tmp = this.GetOptions().FSelection.FMode;
      if (($tmp === $mod.TTMSFNCDataGridSelectionMode.gsmDisjunctCell) || ($tmp === $mod.TTMSFNCDataGridSelectionMode.gsmDisjunctCellRange)) {
        Result = this.GetSelectedCellDictionary().GetCount()}
       else {
        Result = this.GetSelectedRowCount() * this.GetSelectedColumnCount();
      };
      return Result;
    };
    this.GetSelectedColumnCount = function () {
      var Result = 0;
      var k = 0;
      Result = 0;
      if (this.GetOptions().FSelection.FMode in rtl.createSet($mod.TTMSFNCDataGridSelectionMode.gsmDisjunctColumn,$mod.TTMSFNCDataGridSelectionMode.gsmDisjunctCell,$mod.TTMSFNCDataGridSelectionMode.gsmDisjunctCellRange)) {
        var $in = this.GetSelectedColumnDictionary().GetKeys().GetEnumerator$1();
        try {
          while ($in.MoveNext$1()) {
            k = $in.GetCurrent();
            if (this.IsColumnValid(k)) Result += 1;
          }
        } finally {
          $in = rtl.freeLoc($in)
        };
      } else if ((this.FSelection.StartCell.GetRow() !== -1) && (this.FSelection.StopCell.GetRow() !== -1) && (this.FSelection.StartCell.GetColumn() !== -1) && (this.FSelection.StopCell.GetColumn() !== -1)) {
        for (var $l = this.FSelection.StartCell.GetColumn(), $end = this.FSelection.StopCell.GetColumn(); $l <= $end; $l++) {
          k = $l;
          Result += 1;
        };
      };
      return Result;
    };
    this.GetSelectedRowCount = function () {
      var Result = 0;
      var k = 0;
      Result = 0;
      if (this.GetOptions().FSelection.FMode in rtl.createSet($mod.TTMSFNCDataGridSelectionMode.gsmDisjunctRow,$mod.TTMSFNCDataGridSelectionMode.gsmDisjunctCell,$mod.TTMSFNCDataGridSelectionMode.gsmDisjunctCellRange)) {
        var $in = this.GetSelectedRowDictionary().GetKeys().GetEnumerator$1();
        try {
          while ($in.MoveNext$1()) {
            k = $in.GetCurrent();
            if (this.IsRowValid(k)) Result += 1;
          }
        } finally {
          $in = rtl.freeLoc($in)
        };
      } else if ((this.FSelection.StartCell.GetRow() !== -1) && (this.FSelection.StopCell.GetRow() !== -1) && (this.FSelection.StartCell.GetColumn() !== -1) && (this.FSelection.StopCell.GetColumn() !== -1)) {
        for (var $l = this.FSelection.StartCell.GetRow(), $end = this.FSelection.StopCell.GetRow(); $l <= $end; $l++) {
          k = $l;
          Result += 1;
        };
      };
      return Result;
    };
    this.GetSelection = function () {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoordRange.$new();
      Result.$assign(this.FSelection);
      return Result;
    };
    this.GetSelectionRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var sta = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var ste = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var ra = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var re = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,0,0));
      sta.$assign(this.FSelection.StartCell);
      ste.$assign(this.FSelection.StopCell);
      if (this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(sta)) && this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ste))) {
        ra.$assign(this.CellToRect(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(sta)));
        re.$assign(this.CellToRect(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ste)));
        Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(ra.Left,ra.Top,re.Right,re.Bottom));
      };
      return Result;
    };
    this.GetAutoFillHandleRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var selectionRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var handleSize = 0.0;
      var contentRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,0,0));
      if (!this.CanAutoFill()) return Result;
      selectionRect.$assign(this.GetSelectionRect());
      if (pas["WEBLib.TMSFNCTypes"].RectIsEmpty(selectionRect)) return Result;
      handleSize = this.FAutoFillAppearance.FHandleSize;
      contentRect.$assign(this.GetContentClipRect());
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(selectionRect.Right - (handleSize / 2),selectionRect.Bottom - (handleSize / 2),selectionRect.Right + (handleSize / 2),selectionRect.Bottom + (handleSize / 2)));
      if (Result.Right > contentRect.Right) pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(Result,contentRect.Right - Result.Right,0);
      if (Result.Bottom > contentRect.Bottom) pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(Result,0,contentRect.Bottom - Result.Bottom);
      return Result;
    };
    this.GetVerticalScrollBar = function () {
      var Result = null;
      Result = this.FVerticalScrollBar;
      return Result;
    };
    this.GetVerticalScrollPosition = function () {
      var Result = 0.0;
      var vVal = 0.0;
      var scrollv = 0.0;
      vVal = this.GetVScrollValue();
      if (this.GetVerticalScrollMode() === $mod.TTMSFNCDataGridScrollMode.gsmCellScrolling) {
        if (this.GetVVisible() || this.FPaging) {
          scrollv = this.GetRowPosition(Math.round(vVal))}
         else scrollv = this.GetRowPosition(0);
        vVal = scrollv;
      };
      Result = vVal;
      return Result;
    };
    this.GetHorizontalScrollMode = function () {
      var Result = 0;
      Result = this.FScrollMode;
      return Result;
    };
    this.GetVerticalScrollMode = function () {
      var Result = 0;
      if (this.FPaging) {
        Result = $mod.TTMSFNCDataGridScrollMode.gsmCellScrolling}
       else Result = this.FScrollMode;
      return Result;
    };
    this.GetVVisible = function () {
      var Result = false;
      Result = false;
      if (this.HasCustomScrollBars() && (this.GetCustomVerticalScrollBar() != null)) {
        Result = this.GetCustomVerticalScrollBar().FVisible}
       else if (this.GetVerticalScrollBar() != null) Result = this.GetVerticalScrollBar().FVisible;
      return Result;
    };
    this.HasHint = function () {
      var Result = false;
      var h = "";
      Result = this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FHoverCell));
      if (Result) {
        h = this.GetHint(this.FHoverCell.GetColumn(),this.FHoverCell.GetRow());
        this.DoGetCellHint(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FHoverCell),{get: function () {
            return h;
          }, set: function (v) {
            h = v;
          }});
        Result = h !== "";
      };
      return Result;
    };
    this.IsSelectionRangeValid = function () {
      var Result = false;
      var r = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoordRange.$new();
      r.$assign(this.FSelection);
      Result = (r.StartCell.GetRow() >= 0) && (r.StartCell.GetColumn() >= 0) && (r.StopCell.GetRow() < this.FRowCount) && (r.StopCell.GetColumn() < this.FColumnCount) && (r.StartCell.GetRow() <= r.StopCell.GetRow()) && (r.StartCell.GetColumn() <= r.StopCell.GetColumn());
      return Result;
    };
    this.IsBlocked = function () {
      var Result = false;
      Result = this.FBlockScrollingUpdate;
      return Result;
    };
    this.IsDesigntime = function () {
      var Result = false;
      Result = false;
      if (this.FOnIsDesigntime != null) Result = this.FOnIsDesigntime(this);
      return Result;
    };
    this.IsFocused = function () {
      var Result = false;
      Result = false;
      if (this.FOnIsFocused != null) Result = this.FOnIsFocused(this);
      return Result;
    };
    this.LocalRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCore.LocalRect.call(this));
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.FPadding.FLeft + Result.Left,this.FPadding.FTop + Result.Top,Result.Right - this.FPadding.FRight,Result.Bottom - this.FPadding.FBottom));
      return Result;
    };
    this.NeedsItemExtended = function (ACell) {
      var Result = false;
      var cl = null;
      Result = pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridData.NeedsItemExtended.call(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
      if (this.GetOptions().FFiltering.FEnabled && !this.GetOptions().FFiltering.FAdvanced && (ACell.GetRow() === this.GetOptions().FFiltering.FRow) && (ACell.GetColumn() >= this.FFixedColumnCount) && (ACell.GetColumn() <= (this.FColumnCount - this.FFixedRightColumnCount - 1))) {
        cl = this.GetColumn(ACell.GetColumn());
        if ((cl != null) && ($mod.TTMSFNCDataGridColumnSetting.gcsFilterEditor in cl.FSettings)) {
          Result = Result || cl.FFilterEditor}
         else Result = Result || (pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilterControl.gfcEditor in this.GetOptions().FFiltering.FControls);
      };
      return Result;
    };
    this.OnlyLastFullVisibleRow = function () {
      var Result = false;
      Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCore.OnlyLastFullVisibleRow.call(this);
      if (((this.FAdapter != null) && (this.GetVerticalScrollMode() === $mod.TTMSFNCDataGridScrollMode.gsmCellScrolling)) || this.FPaging) Result = true;
      return Result;
    };
    this.ProcessEnterKey = function (ACell, AKeyHandling) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var c = 0;
      var r = 0;
      var cl = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var Allow = false;
      cl.$assign(ACell);
      var $tmp = AKeyHandling;
      if (($tmp === $mod.TTMSFNCDataGridEnterKeyHandling.gekhNextColumn) || ($tmp === $mod.TTMSFNCDataGridEnterKeyHandling.gekhNextColumnInRow) || ($tmp === $mod.TTMSFNCDataGridEnterKeyHandling.gekhNextColumnAndAppend) || ($tmp === $mod.TTMSFNCDataGridEnterKeyHandling.gekhNextColumnAndRowAppend)) {
        c = cl.GetColumn();
        cl.$assign(this.NextSelectableColumn(cl.GetColumn(),cl.GetRow()));
        if (cl.GetColumn() === c) {
          var $tmp1 = this.GetOptions().FKeyboard.FEnterKeyHandling;
          if (($tmp1 === $mod.TTMSFNCDataGridEnterKeyHandling.gekhNextColumn) || ($tmp1 === $mod.TTMSFNCDataGridEnterKeyHandling.gekhNextColumnAndRowAppend)) {
            cl.SetColumn(this.FFixedColumnCount - 1);
            r = cl.GetRow();
            cl.SetRow(Math.min(this.FRowCount - 1 - this.FFixedBottomRowCount,cl.GetRow() + 1));
            cl.$assign(this.NextSelectableColumn(cl.GetColumn(),cl.GetRow()));
            if (r === cl.GetRow()) {
              if (this.GetOptions().FKeyboard.FEnterKeyHandling === $mod.TTMSFNCDataGridEnterKeyHandling.gekhNextColumnAndRowAppend) {
                Allow = true;
                cl.SetRow(cl.GetRow() + 1);
                this.DoCanAppendRow(cl.GetRow(),{get: function () {
                    return Allow;
                  }, set: function (v) {
                    Allow = v;
                  }});
                if (Allow) {
                  this.InsertRow(cl.GetRow());
                  this.DoAppendRow(cl.GetRow());
                };
              } else {
                cl.SetRow(this.FFixedRowCount);
                cl.SetColumn(this.FFixedColumnCount);
              };
            };
          } else if (($tmp1 === $mod.TTMSFNCDataGridEnterKeyHandling.gekhNextColumnInRow) || ($tmp1 === $mod.TTMSFNCDataGridEnterKeyHandling.gekhNextColumnAndAppend)) {
            if (this.GetOptions().FKeyboard.FEnterKeyHandling === $mod.TTMSFNCDataGridEnterKeyHandling.gekhNextColumnInRow) cl.SetColumn(this.FFixedColumnCount - 1);
            r = cl.GetRow();
            c = cl.GetColumn();
            cl.$assign(this.NextSelectableColumn(cl.GetColumn(),cl.GetRow()));
            if ((c === cl.GetColumn()) && (this.GetOptions().FKeyboard.FEnterKeyHandling === $mod.TTMSFNCDataGridEnterKeyHandling.gekhNextColumnAndAppend)) {
              Allow = true;
              cl.SetColumn(cl.GetColumn() + 1);
              this.DoCanAppendColumn(cl.GetColumn(),{get: function () {
                  return Allow;
                }, set: function (v) {
                  Allow = v;
                }});
              if (Allow) {
                this.InsertColumn(cl.GetColumn());
                this.DoAppendColumn(cl.GetColumn());
              };
            } else if (r === cl.GetRow()) cl.SetColumn(this.FFixedColumnCount);
          };
          if (this.IsCellDisabled(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cl))) cl.$assign(this.NextSelectableColumn(cl.GetColumn(),cl.GetRow()));
        };
      } else if (($tmp === $mod.TTMSFNCDataGridEnterKeyHandling.gekhNextRow) || ($tmp === $mod.TTMSFNCDataGridEnterKeyHandling.gekhNextRowInColumn) || ($tmp === $mod.TTMSFNCDataGridEnterKeyHandling.gekhNextRowAndAppend) || ($tmp === $mod.TTMSFNCDataGridEnterKeyHandling.gekhNextRowAndColumnAppend)) {
        r = cl.GetRow();
        cl.$assign(this.NextSelectableRow(cl.GetColumn(),cl.GetRow()));
        if (cl.GetRow() === r) {
          var $tmp2 = this.GetOptions().FKeyboard.FEnterKeyHandling;
          if (($tmp2 === $mod.TTMSFNCDataGridEnterKeyHandling.gekhNextRow) || ($tmp2 === $mod.TTMSFNCDataGridEnterKeyHandling.gekhNextRowAndColumnAppend)) {
            cl.SetRow(this.FFixedRowCount - 1);
            c = cl.GetColumn();
            cl.SetColumn(Math.min(this.FColumnCount - 1 - this.FFixedRightColumnCount,cl.GetColumn() + 1));
            cl.$assign(this.NextSelectableRow(cl.GetColumn(),cl.GetRow()));
            if (c === cl.GetColumn()) {
              if (this.GetOptions().FKeyboard.FEnterKeyHandling === $mod.TTMSFNCDataGridEnterKeyHandling.gekhNextRowAndColumnAppend) {
                Allow = true;
                cl.SetColumn(cl.GetColumn() + 1);
                this.DoCanAppendColumn(cl.GetColumn(),{get: function () {
                    return Allow;
                  }, set: function (v) {
                    Allow = v;
                  }});
                if (Allow) {
                  this.InsertColumn(cl.GetColumn());
                  this.DoAppendColumn(cl.GetColumn());
                };
              } else {
                cl.SetRow(this.FFixedRowCount);
                cl.SetColumn(this.FFixedColumnCount);
              };
            };
          } else if (($tmp2 === $mod.TTMSFNCDataGridEnterKeyHandling.gekhNextRowInColumn) || ($tmp2 === $mod.TTMSFNCDataGridEnterKeyHandling.gekhNextRowAndAppend)) {
            if (this.GetOptions().FKeyboard.FEnterKeyHandling === $mod.TTMSFNCDataGridEnterKeyHandling.gekhNextRowInColumn) cl.SetRow(this.FFixedRowCount - 1);
            c = cl.GetColumn();
            r = cl.GetRow();
            cl.$assign(this.NextSelectableRow(cl.GetColumn(),cl.GetRow()));
            if ((r === cl.GetRow()) && (this.GetOptions().FKeyboard.FEnterKeyHandling === $mod.TTMSFNCDataGridEnterKeyHandling.gekhNextRowAndAppend)) {
              Allow = true;
              cl.SetRow(cl.GetRow() + 1);
              this.DoCanAppendRow(cl.GetRow(),{get: function () {
                  return Allow;
                }, set: function (v) {
                  Allow = v;
                }});
              if (Allow) {
                this.InsertRow(cl.GetRow());
                this.DoAppendRow(cl.GetRow());
              };
            } else if (c === cl.GetColumn()) cl.SetRow(this.FFixedRowCount);
          };
          if (this.IsCellDisabled(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cl))) cl.$assign(this.NextSelectableColumn(cl.GetColumn(),cl.GetRow()));
        };
      };
      Result.$assign(cl);
      return Result;
    };
    this.RowStretchingActive = function () {
      var Result = false;
      Result = this.FRowStretchingActive;
      return Result;
    };
    this.SavetoHTMLString = function (ARange, AImageDirectory) {
      var $Self = this;
      var Result = "";
      var i = 0;
      var j = 0;
      var s = "";
      var tablestyle = "";
      var slist = null;
      var wraptxt = "";
      var colwtxt = "";
      var CellText = "";
      var SpanTxt = "";
      var Span = pas.Types.TPoint.$new();
      var cssval = "";
      var cssidx = 0;
      var CSSList = null;
      var res = "";
      var Pic = null;
      var bmp = null;
      var images_counter = 0;
      var htmlhdr = "";
      var summ = "";
      var mi = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellMergeInfo.$new();
      var v = undefined;
      var l = null;
      function HTMLAddImage(Pic, counter, dir) {
        var Result = "";
        Result = "";
        return Result;
      };
      function MakeHREF(s) {
        var Result = "";
        Result = s;
        if ((pas.System.Pos("://",s) > 0) && (pas.System.Pos("</",s) === 0)) {
          Result = "<a href=" + s + ">" + s + "</a>";
        };
        if ((pas.System.Pos("mailto:",s) > 0) && (pas.System.Pos("</",s) === 0)) {
          Result = "<a href=" + s + ">" + s + "</a>";
        };
        return Result;
      };
      function AppendStr(s, newstr) {
        if (s.get() === "") {
          s.set(newstr)}
         else s.set(s.get() + ";" + newstr);
      };
      function CSS(ALayout) {
        var Result = "";
        var res = "";
        res = "";
        if ((ALayout.FFill.FColor !== -1) && (ALayout.FFill.FKind !== pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone) && $Self.GetOptions().GetIO().FHTML.FExportColors) AppendStr({get: function () {
            return res;
          }, set: function (v) {
            res = v;
          }},"background-color: " + pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.ColorToHTML(ALayout.FFill.FColor) + "");
        if ((ALayout.FFont.FColor !== -1) && $Self.GetOptions().GetIO().FHTML.FExportColors) AppendStr({get: function () {
            return res;
          }, set: function (v) {
            res = v;
          }},"color: " + pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.ColorToHTML(ALayout.FFont.FColor) + "");
        AppendStr({get: function () {
            return res;
          }, set: function (v) {
            res = v;
          }},"font-size:" + pas.SysUtils.IntToStr(Math.round(ALayout.FFont.FSize)) + "pt");
        if (pas["WEBLib.Graphics"].TFontStyle.fsItalic in ALayout.FFont.FStyle) AppendStr({get: function () {
            return res;
          }, set: function (v) {
            res = v;
          }},"font-style: italic");
        if (pas["WEBLib.Graphics"].TFontStyle.fsBold in ALayout.FFont.FStyle) AppendStr({get: function () {
            return res;
          }, set: function (v) {
            res = v;
          }},"font-weight: bold");
        AppendStr({get: function () {
            return res;
          }, set: function (v) {
            res = v;
          }},"font-family: " + ALayout.FFont.FName + "");
        var $tmp = ALayout.FTextAlign;
        if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter) {
          AppendStr({get: function () {
              return res;
            }, set: function (v) {
              res = v;
            }},"text-align: center")}
         else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaTrailing) AppendStr({get: function () {
            return res;
          }, set: function (v) {
            res = v;
          }},"text-align: right");
        var $tmp1 = ALayout.FVerticalTextAlign;
        if ($tmp1 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading) {
          AppendStr({get: function () {
              return res;
            }, set: function (v) {
              res = v;
            }},"vertical-align: top")}
         else if ($tmp1 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter) {
          AppendStr({get: function () {
              return res;
            }, set: function (v) {
              res = v;
            }},"vertical-align: middle")}
         else if ($tmp1 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaTrailing) AppendStr({get: function () {
            return res;
          }, set: function (v) {
            res = v;
          }},"vertical-align: bottom");
        Result = res;
        return Result;
      };
      function ExportImg(ACol, ARow, lst, celltext, Pic) {
        var image = "";
        if ((Pic != null) && !pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(Pic)) {
          image = '<img src= "file://' + HTMLAddImage(Pic,images_counter,AImageDirectory) + '">';
          lst.Add('<td class="c' + pas.SysUtils.IntToStr(cssidx) + '"' + SpanTxt + wraptxt + colwtxt + ">" + s + image + "</td>");
          images_counter += 1;
        } else lst.Add('<td class="c' + pas.SysUtils.IntToStr(cssidx) + '"' + SpanTxt + wraptxt + colwtxt + ">" + s + "</td>");
      };
      slist = pas.Classes.TStringList.$create("Create$1");
      slist.SetSorted(false);
      CSSList = pas.Classes.TStringList.$create("Create$1");
      this.ExportNotification(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridExportState.gesExportStart,ARange.StartCell.GetRow());
      try {
        htmlhdr = "";
        if (this.GetOptions().GetIO().FHTML.FXHTML) {
          htmlhdr = htmlhdr + '<?xml version="1.0" encoding="utf-8"?>\r\n' + '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"\r\n' + '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r\n' + '<HTML xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r\n';
        };
        htmlhdr = htmlhdr + this.GetOptions().GetIO().FHTML.FHeaderText;
        if (this.GetOptions().GetIO().FHTML.FPrefixTag !== "") htmlhdr = htmlhdr + this.GetOptions().GetIO().FHTML.FPrefixTag;
        if (this.GetOptions().GetIO().FHTML.FTableStyle !== "") {
          tablestyle = " " + this.GetOptions().GetIO().FHTML.FTableStyle + " "}
         else tablestyle = "";
        if (this.GetOptions().GetIO().FHTML.FSummary !== "") {
          summ = 'summary="' + this.GetOptions().GetIO().FHTML.FSummary + '" '}
         else summ = "";
        slist.Add('<table border="' + pas.SysUtils.IntToStr(this.GetOptions().GetIO().FHTML.FTableBorderSize) + '" ' + 'cellspacing="' + pas.SysUtils.IntToStr(this.GetOptions().GetIO().FHTML.FTableCellSpacing) + '" ' + 'cellpadding="' + pas.SysUtils.IntToStr(this.GetOptions().GetIO().FHTML.FTableCellPadding) + '" ' + summ + tablestyle + ' width="' + pas.SysUtils.IntToStr(this.GetOptions().GetIO().FHTML.FTableWidth) + '%">');
        images_counter = 1;
        for (var $l = ARange.StartCell.GetRow(), $end = ARange.StopCell.GetRow(); $l <= $end; $l++) {
          i = $l;
          this.ExportNotification(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridExportState.gesExportNextRow,i);
          slist.Add("<tr>");
          for (var $l1 = ARange.StartCell.GetColumn(), $end1 = ARange.StopCell.GetColumn(); $l1 <= $end1; $l1++) {
            j = $l1;
            if (this.IsCellBase(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(j,i))) && this.IsCellDisplayed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(j,i)))) {
              mi.$assign(this.GetMergeInfo(j,i));
              Span.$assign(pas.Types.Point(mi.ColumnSpan,mi.RowSpan));
              SpanTxt = "";
              if (Span.x > 0) SpanTxt = ' colspan="' + pas.SysUtils.IntToStr(Span.x) + '"';
              if (Span.y > 0) SpanTxt = SpanTxt + ' rowspan="' + pas.SysUtils.IntToStr(Span.y) + '"';
              v = this.GetCell(j,i);
              this.DoSaveCellData(j,i,{get: function () {
                  return v;
                }, set: function (w) {
                  v = w;
                }});
              CellText = this.$class.ValueToString(v);
              s = CellText;
              if (this.GetOptions().GetIO().FHTML.FConvertSpecialChars) s = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.FixMarkup(s,true);
              if (this.GetOptions().GetIO().FHTML.FNonBreakingText) s = pas["WEBLib.TMSFNCDataGridUtil"].FixNonBreaking(s);
              s = pas["WEBLib.TMSFNCDataGridUtil"].HTMLLineBreaks(s);
              s = MakeHREF(s);
              l = this.GetCellAppearance(this.GetCellState(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(j,i))),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(j,i)),false);
              cssval = CSS(l);
              cssidx = CSSList.IndexOf(cssval);
              if (cssidx === -1) cssidx = CSSList.Add(cssval);
              colwtxt = "";
              if (pas.SysUtils.Trim(s) === "") s = "&nbsp;";
              if (l.FWordWrapping) {
                wraptxt = ""}
               else wraptxt = ' nowrap="nowrap"';
              Pic = null;
              if (this.GetOptions().GetIO().FHTML.FExportImages) {
                bmp = this.GetBitmap(j,i);
                if ((bmp != null) && !pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(bmp)) {
                  Pic = bmp}
                 else if ((this.GetBitmapContainer() != null) && (this.GetBitmapName(j,i) !== "")) Pic = this.GetBitmapContainer().FindBitmap$1(this.GetBitmapName(j,i));
              };
              ExportImg(j,i,slist,CellText,Pic);
            };
          };
          slist.Add("</tr>");
        };
        slist.Add("</table>");
        if (this.GetOptions().GetIO().FHTML.FSuffixTag !== "") slist.Add(this.GetOptions().GetIO().FHTML.FSuffixTag);
        if (this.GetOptions().GetIO().FHTML.FFooterText !== "") slist.Add(this.GetOptions().GetIO().FHTML.FFooterText);
        if (this.GetOptions().GetIO().FHTML.FXHTML) slist.Add("</HTML>");
        res = "<style>\r\n";
        for (var $l2 = 0, $end2 = CSSList.GetCount() - 1; $l2 <= $end2; $l2++) {
          cssidx = $l2;
          res = res + ".c" + pas.SysUtils.IntToStr(cssidx) + " {" + CSSList.Get(cssidx) + "}\r\n";
        };
        res = res + "</style>\r\n";
        Result = htmlhdr + res + slist.GetTextStr();
      } finally {
        slist = rtl.freeLoc(slist);
        CSSList = rtl.freeLoc(CSSList);
        this.ExportNotification(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridExportState.gesExportDone,-1);
      };
      return Result;
    };
    this.ScaleValue = function (Value) {
      var Result = 0.0;
      Result = Value;
      return Result;
    };
    this.UnscaleValue = function (Value) {
      var Result = 0.0;
      Result = Value;
      return Result;
    };
    this.ScaleValue$1 = function (Value) {
      var Result = 0;
      Result = Value;
      return Result;
    };
    this.UnscaleValue$1 = function (Value) {
      var Result = 0;
      Result = Value;
      return Result;
    };
    this.Animate = function (Sender) {
      var dx = 0.0;
      var dy = 0.0;
      var posx = 0.0;
      var posy = 0.0;
      var animh = false;
      var animv = false;
      posy = this.GetVScrollValue();
      posx = this.GetHScrollValue();
      dx = Math.abs(this.FScrollHTo - posx) / Math.max(1,Math.abs(this.FSpX) * 6);
      dy = Math.abs(this.FScrollVTo - posy) / Math.max(1,Math.abs(this.FSpY) * 6);
      animv = false;
      if (this.FAnimateVerticalPos) animv = $impl.AnimateDouble({get: function () {
          return posy;
        }, set: function (v) {
          posy = v;
        }},{p: this, get: function () {
          return this.p.FScrollVTo;
        }, set: function (v) {
          this.p.FScrollVTo = v;
        }},dy,0.01);
      animh = false;
      if (this.FAnimateHorizontalPos) animh = $impl.AnimateDouble({get: function () {
          return posx;
        }, set: function (v) {
          posx = v;
        }},{p: this, get: function () {
          return this.p.FScrollHTo;
        }, set: function (v) {
          this.p.FScrollHTo = v;
        }},dx,0.01);
      this.FAnimating = animv || animh;
      if (this.FAnimating) {
        this.Scroll(posx,posy)}
       else {
        this.FAnimateVerticalPos = false;
        this.GetAnimateTimer().SetEnabled(false);
        this.FAnimateHorizontalPos = false;
      };
    };
    this.ApplyFilterFromValue = function (AColumn, AValue, AType) {
      var fd = null;
      var cnd = "";
      var s = "";
      var cs = "";
      var i = 0;
      var filtercol = 0;
      var c = false;
      var b = false;
      var cli = 0;
      filtercol = AColumn;
      fd = null;
      if (this.GetOptions().FFiltering.FMultiColumn) {
        if (this.GetFilter().HasFilter(filtercol)) fd = this.GetFilter().GetColumnFilter(filtercol);
      } else this.GetFilter().Clear$1();
      i = this.FFixedRowCount;
      while (!this.IsRowNormal(i) && (i < this.FRowCount)) i += 1;
      s = this.$class.ValueToString(AValue);
      if ((pas.System.Pos("&",s) === 0) && (pas.System.Pos("|",s) === 0) && (pas.System.Pos("<",s) === 0) && (pas.System.Pos(">",s) === 0) && (pas.System.Pos("=",s) === 0) && (pas.System.Pos("!",s) === 0) && (pas.System.Pos("*",s) === 0) && (pas.System.Pos("?",s) === 0)) s = this.FormatDisplayValue(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,i)),AValue);
      b = false;
      cli = -1;
      if (s !== "") {
        if (!(fd != null)) fd = this.GetFilter().Add$3();
        fd.SetColumn(filtercol);
        fd.SetType(AType);
        fd.SetCondition(s);
        cnd = fd.GetFilterCondition();
      } else {
        b = true;
        if (fd != null) cli = fd.FColumn;
        pas.SysUtils.FreeAndNil({get: function () {
            return fd;
          }, set: function (v) {
            fd = v;
          }});
      };
      c = true;
      if (fd != null) {
        cs = cnd;
        this.DoBeforeApplyFilter(fd.FColumn,{get: function () {
            return cnd;
          }, set: function (v) {
            cnd = v;
          }},{get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }});
      };
      if (c) {
        if ((fd != null) && (cnd !== cs)) fd.SetFilterCondition(cnd);
        if (this.GetFilter().GetCount() === 0) {
          this.ClearFilter()}
         else {
          this.IncUpdateCount();
          this.RemoveFilter();
          this.DecUpdateCount();
          this.ApplyFilter();
        };
        if (b && (cli !== -1)) this.DoRemoveFilter(cli);
        if (fd != null) this.DoAfterApplyFilter(fd.FColumn,cnd);
      };
    };
    this.ApplyFilterFromBuilder = function () {
      var c = false;
      var fd = "";
      if (this.GetFilterBuilder().GetIsEmpty()) {
        this.ClearFilter();
        this.DoRemoveAdvancedFilter();
      } else {
        c = true;
        fd = this.GetFilterBuilder().GetFilterText();
        this.DoBeforeApplyAdvancedFilter({get: function () {
            return fd;
          }, set: function (v) {
            fd = v;
          }},{get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }});
        if (c) {
          this.GetFilterBuilder().SetFilterText(fd);
          this.IncUpdateCount();
          this.RemoveFilter();
          this.DecUpdateCount();
          this.ApplyFilter();
          this.DoAfterApplyAdvancedFilter(fd);
        };
      };
    };
    this.ApplyCellScale = function (ACell, AScale) {
      ACell.ApplyScale(AScale);
    };
    this.AddCellToDisplay = function (ACell, ADisplay) {
      var x = 0.0;
      var y = 0.0;
      var cell = null;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rc = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rg = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rcc = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if ((this.GetUpdateCount() > 0) || this.GetIsDestroying() || !(ACell != null) || !(ADisplay != null)) return;
      x = -this.GetHorizontalScrollPosition();
      y = -this.GetVerticalScrollPosition();
      r.$assign(this.GetContentClipRect());
      rc.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + this.FTotalFixedColumnWidth + 1,r.Top + this.FTotalFixedRowHeight + 1,r.Right - this.FTotalFixedRightColumnWidth - 1,r.Bottom - this.FTotalFixedBottomRowHeight - 1));
      if (this.FUseClipRect) {
        rcc.$assign(this.FClipRect);
        rc.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Math.max(rc.Left,rcc.Left),Math.max(rc.Top,rcc.Top),Math.min(rc.Right,rcc.Right),Math.min(rc.Bottom,rcc.Bottom)));
      };
      cell = ACell;
      rg.$assign(cell.FCalcRect);
      var $tmp = cell.FKind;
      if ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckCell) {
        pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(rg,pas.System.Int(x) + r.Left,pas.System.Int(y) + r.Top)}
       else if (($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFixedRowCell) || ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFreezeRowCell)) {
        pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(rg,pas.System.Int(x) + r.Left,r.Top)}
       else if (($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFixedColumnCell) || ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFreezeColumnCell)) {
        pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(rg,r.Left,pas.System.Int(y) + r.Top)}
       else if (($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFixedRootCell) || ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFreezeRootCell) || ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFreezeFixedRowCell) || ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFreezeFixedColumnCell)) pas["WEBLib.TMSFNCTypes"].OffsetRectEx$1(rg,r.Left,r.Top);
      if (pas["WEBLib.TMSFNCTypes"].RectIntersectsWithEx(rg,r) && this.IsCellDisplayed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(cell.FColumn,cell.FRow)))) {
        cell.FRect.$assign(rg);
        var $tmp1 = cell.FKind;
        if ($tmp1 === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckCell) {
          cell.FClipRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Math.max(rc.Left,rg.Left),Math.max(rc.Top,rg.Top),Math.min(rc.Right,rg.Right),Math.min(rc.Bottom,rg.Bottom)))}
         else if (($tmp1 === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFixedRowCell) || ($tmp1 === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFreezeRowCell)) {
          cell.FClipRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Math.max(rc.Left,rg.Left),rg.Top,Math.min(rc.Right,rg.Right),rg.Bottom))}
         else if (($tmp1 === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFixedColumnCell) || ($tmp1 === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFreezeColumnCell)) {
          cell.FClipRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(rg.Left,Math.max(rc.Top,rg.Top),rg.Right,Math.min(rc.Bottom,rg.Bottom)))}
         else if (($tmp1 === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFixedRootCell) || ($tmp1 === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFreezeRootCell) || ($tmp1 === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFreezeFixedRowCell) || ($tmp1 === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFreezeFixedColumnCell)) cell.FClipRect.$assign(rg);
        this.BeginUsingCellData(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cell.GetCoordinate()),cell.FData);
        try {
          this.ConfigureCell(cell,$mod.TTMSFNCDataGridCellConfigureMode.gccmLayout);
        } finally {
          this.EndUsingCellData();
        };
        ADisplay.Add(cell);
      };
    };
    this.BuildDisplay = function (AList, ADisplay) {
      var I = 0;
      if ((this.GetUpdateCount() > 0) || this.GetIsDestroying() || !(AList != null) || !(ADisplay != null)) return;
      ADisplay.Clear();
      for (var $l = 0, $end = AList.FLength - 1; $l <= $end; $l++) {
        I = $l;
        this.AddCellToDisplay(AList.GetItem(I),ADisplay);
      };
    };
    this.CalculateAutoFillRange = function (ACurrentCell, ADirection, AStartCell, AEndCell) {
      var originalStart = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var originalEnd = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      originalStart.$assign(this.FAutoFillOriginalSelection.StartCell);
      originalEnd.$assign(this.FAutoFillOriginalSelection.StopCell);
      AStartCell.$assign(originalStart);
      AEndCell.$assign(originalEnd);
      var $tmp = ADirection;
      if ($tmp === pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataAutoFillDirection.gafdDown) {
        AEndCell.SetRow(Math.max(ACurrentCell.GetRow(),originalEnd.GetRow()));
        AEndCell.SetRow(Math.min(AEndCell.GetRow(),this.FRowCount - 1 - this.FFixedBottomRowCount));
      } else if ($tmp === pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataAutoFillDirection.gafdUp) {
        AStartCell.SetRow(Math.min(ACurrentCell.GetRow(),originalStart.GetRow()));
        AStartCell.SetRow(Math.max(AStartCell.GetRow(),this.FFixedRowCount));
      } else if ($tmp === pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataAutoFillDirection.gafdRight) {
        AEndCell.SetColumn(Math.max(ACurrentCell.GetColumn(),originalEnd.GetColumn()));
        AEndCell.SetColumn(Math.min(AEndCell.GetColumn(),this.FColumnCount - 1 - this.FFixedRightColumnCount));
      } else if ($tmp === pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataAutoFillDirection.gafdLeft) {
        AStartCell.SetColumn(Math.min(ACurrentCell.GetColumn(),originalStart.GetColumn()));
        AStartCell.SetColumn(Math.max(AStartCell.GetColumn(),this.FFixedColumnCount));
      };
    };
    this.CellAppearanceChanged = function (Sender) {
      this.Display();
    };
    this.ConfigureCell = function (ACell, AMode) {
      if (AMode in rtl.createSet($mod.TTMSFNCDataGridCellConfigureMode.gccmLayout,$mod.TTMSFNCDataGridCellConfigureMode.gccmBoth)) {
        this.SetLayout(ACell);
        this.DoGetCellLayout(ACell);
      };
      if (AMode in rtl.createSet($mod.TTMSFNCDataGridCellConfigureMode.gccmProperties,$mod.TTMSFNCDataGridCellConfigureMode.gccmBoth)) {
        this.SetProperties(ACell);
        this.DoGetCellProperties(ACell);
      };
      this.ApplyCellScale(ACell,this.FScale);
    };
    this.ConfigureLayout = function (ACell, ALayout, ASkipCellLayout) {
      ALayout.Assign(this.GetCellAppearance(this.GetCellState(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell)),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),ASkipCellLayout));
    };
    this.CopyColumnDataTo = function (AColumn, ADestinationColumn, ADestination) {
      var cl = null;
      var cld = null;
      pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridData.CopyColumnDataTo.apply(this,arguments);
      if ($mod.TTMSFNCDataGridRenderer.isPrototypeOf(ADestination)) {
        cl = this.GetColumn(AColumn);
        if (cl != null) {
          cld = rtl.as(ADestination,$mod.TTMSFNCDataGridRenderer).GetColumn(ADestinationColumn);
          if (cld != null) cld.Assign(cl);
        };
      };
    };
    this.DeleteColumnData = function (AColumn) {
      var k = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridData.DeleteColumnData.apply(this,arguments);
      this.GetSelectedColumnDictionary().Remove(AColumn);
      var $in = this.GetSelectedCellDictionary().GetKeys().GetEnumerator$1();
      try {
        while ($in.MoveNext$1()) {
          k = $in.GetCurrent();
          if (k.GetColumn() === AColumn) this.GetSelectedCellDictionary().Remove(k);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.DeleteRowData = function (ARow) {
      var k = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridData.DeleteRowData.apply(this,arguments);
      this.GetSelectedRowDictionary().Remove(ARow);
      var $in = this.GetSelectedCellDictionary().GetKeys().GetEnumerator$1();
      try {
        while ($in.MoveNext$1()) {
          k = $in.GetCurrent();
          if (k.GetRow() === ARow) this.GetSelectedCellDictionary().Remove(k);
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.DestroyEditor = function () {
      if (this.FInplaceEditor != null) {
        this.FInplaceEditor.SetParent(null);
        rtl.free(this,"FInplaceEditor");
        this.FInplaceEditor = null;
        this.FInplaceEditorActive = false;
        this.Display();
      };
    };
    this.DoAfterApplyFilter = function (AColumn, ACondition) {
      if (this.FOnAfterApplyFilter != null) this.FOnAfterApplyFilter(this,AColumn,ACondition);
    };
    this.DoAfterApplyAdvancedFilter = function (AFilterText) {
      if (this.FOnAfterApplyAdvancedFilter != null) this.FOnAfterApplyAdvancedFilter(this,AFilterText);
    };
    this.DoAfterCloseInplaceEditor = function (ACell, ACancelled, AValue) {
      if (this.FOnAfterCloseInplaceEditorInternal != null) this.FOnAfterCloseInplaceEditorInternal(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),ACancelled,AValue);
      if (this.FOnAfterCloseInplaceEditor != null) this.FOnAfterCloseInplaceEditor(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),ACancelled,AValue);
    };
    this.DoAfterCopyToClipboard = function () {
      if (this.FOnAfterCopyToClipboard != null) this.FOnAfterCopyToClipboard(this);
    };
    this.DoAfterCreateFilterEditor = function (ACell, AEditor) {
      if (this.FOnAfterCreateFilterEditor != null) this.FOnAfterCreateFilterEditor(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AEditor);
    };
    this.DoAfterCutToClipboard = function () {
      if (this.FOnAfterCutToClipboard != null) this.FOnAfterCutToClipboard(this);
    };
    this.DoAfterDrawEmptySpace = function (AGraphics, ARect, AKind) {
      if (this.FOnAfterDrawEmptySpace != null) this.FOnAfterDrawEmptySpace(AGraphics,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AKind);
    };
    this.DoAfterDrawGrid = function (AGraphics, ARect) {
      if (this.FOnAfterDrawGrid != null) this.FOnAfterDrawGrid(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect));
    };
    this.DoAfterLookup = function (ALookupString) {
      if (this.FOnAfterLookup != null) this.FOnAfterLookup(this,ALookupString);
    };
    this.DoAfterInplaceEditorSetValue = function (ACell, AInplaceEditor, AValue) {
      if (this.FOnAfterInplaceEditorSetValue != null) this.FOnAfterInplaceEditorSetValue(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AInplaceEditor,AValue);
    };
    this.DoAfterInplaceEditorGetValue = function (ACell, AInplaceEditor, AValue) {
      if (this.FOnAfterInplaceEditorGetValue != null) this.FOnAfterInplaceEditorGetValue(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AInplaceEditor,AValue);
    };
    this.DoAfterOpenInplaceEditor = function (ACell, AInplaceEditor, AValue) {
      if (this.FOnAfterOpenInplaceEditor != null) this.FOnAfterOpenInplaceEditor(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AInplaceEditor,AValue);
    };
    this.DoAfterPasteFromClipboard = function () {
      if (this.FOnAfterPasteFromClipboard != null) this.FOnAfterPasteFromClipboard(this);
    };
    this.DoAfterShowFilter = function (AColumn) {
      if (this.FOnAfterShowFilter != null) this.FOnAfterShowFilter(this,AColumn);
    };
    this.DoAfterShowFilterDialog = function (AFilterDialog) {
      if (this.FOnAfterShowFilterDialog != null) this.FOnAfterShowFilterDialog(this,AFilterDialog);
    };
    this.DoAfterShowFindDialog = function (AFindDialog) {
      if (this.FOnAfterShowFindDialog != null) this.FOnAfterShowFindDialog(this,AFindDialog);
    };
    this.DoAfterShowReplaceDialog = function (AReplaceDialog) {
      if (this.FOnAfterShowReplaceDialog != null) this.FOnAfterShowReplaceDialog(this,AReplaceDialog);
    };
    this.DoBeforeDialogFind = function (AFindText, AParameters, ACanFind) {
      if (this.FOnBeforeDialogFind != null) this.FOnBeforeDialogFind(this,AFindText,AParameters,ACanFind);
    };
    this.DoAfterDialogFind = function (AFindText, AResultCell, AFound) {
      if (this.FOnAfterDialogFind != null) this.FOnAfterDialogFind(this,AFindText,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(AResultCell),AFound);
    };
    this.DoBeforeDialogReplace = function (AFindText, AReplaceText, AParameters, ACanReplace) {
      if (this.FOnBeforeDialogReplace != null) this.FOnBeforeDialogReplace(this,AFindText,AReplaceText,AParameters,ACanReplace);
    };
    this.DoAfterDialogReplace = function (AFindText, AReplaceText, AReplaceCount) {
      if (this.FOnAfterDialogReplace != null) this.FOnAfterDialogReplace(this,AFindText,AReplaceText,AReplaceCount);
    };
    this.DoAfterSortColumn = function (AColumn) {
      if (this.FOnAfterSortColumn != null) this.FOnAfterSortColumn(this,AColumn);
    };
    this.DoAppendColumn = function (AColumn) {
      if (this.FOnAppendColumn != null) this.FOnAppendColumn(this,AColumn);
    };
    this.DoAppendRow = function (ARow) {
      if (this.FOnAppendRow != null) this.FOnAppendRow(this,ARow);
    };
    this.DoBeforeApplyFilter = function (AColumn, ACondition, ACanApply) {
      if (this.FOnBeforeApplyFilter != null) this.FOnBeforeApplyFilter(this,AColumn,ACondition,ACanApply);
    };
    this.DoBeforeApplyAdvancedFilter = function (AFilterText, ACanApply) {
      if (this.FOnBeforeApplyAdvancedFilter != null) this.FOnBeforeApplyAdvancedFilter(this,AFilterText,ACanApply);
    };
    this.DoBeforeInplaceEditorSetValue = function (ACell, AInplaceEditor, AValue, AHandled) {
      if (this.FOnBeforeInplaceEditorSetValue != null) this.FOnBeforeInplaceEditorSetValue(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AInplaceEditor,AValue,AHandled);
    };
    this.DoBeforeInplaceEditorGetValue = function (ACell, AInplaceEditor, AValue, AHandled) {
      if (this.FOnBeforeInplaceEditorGetValue != null) this.FOnBeforeInplaceEditorGetValue(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AInplaceEditor,AValue,AHandled);
    };
    this.DoBeforeCloseInplaceEditor = function (ACell, AInplaceEditor, ACancelled, AValue, ACanClose) {
      if (this.FOnBeforeCloseInplaceEditor != null) this.FOnBeforeCloseInplaceEditor(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AInplaceEditor,ACancelled,AValue,ACanClose);
    };
    this.DoBeforeExitInplaceEditor = function (ACell, AInplaceEditor, AMode) {
      if (this.FOnBeforeExitInplaceEditor != null) this.FOnBeforeExitInplaceEditor(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AInplaceEditor,AMode);
    };
    this.DoAfterExitInplaceEditor = function (ACell, AMode) {
      if (this.FOnAfterExitInplaceEditor != null) this.FOnAfterExitInplaceEditor(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AMode);
    };
    this.DoBeforeCopyToClipboard = function (ACanCopy) {
      if (this.FOnBeforeCopyToClipboard != null) this.FOnBeforeCopyToClipboard(this,ACanCopy);
    };
    this.DoBeforeCreateFilterEditor = function (ACell, ACanCreate) {
      if (this.FOnBeforeCreateFilterEditor != null) this.FOnBeforeCreateFilterEditor(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),ACanCreate);
    };
    this.DoBeforeCutToClipboard = function (ACanCut) {
      if (this.FOnBeforeCutToClipboard != null) this.FOnBeforeCutToClipboard(this,ACanCut);
    };
    this.DoBeforeDrawEmptySpace = function (AGraphics, ARect, AKind, ACanDraw) {
      if (this.FOnBeforeDrawEmptySpace != null) this.FOnBeforeDrawEmptySpace(this,AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AKind,ACanDraw);
    };
    this.DoBeforeLookup = function (ALookupString, ACanLookup) {
      if (this.FOnBeforeLookup != null) this.FOnBeforeLookup(this,ALookupString,ACanLookup);
    };
    this.DoBeforeOpenInplaceEditor = function (ACell, AValue, ACanOpen) {
      if (this.FOnBeforeOpenInplaceEditor != null) this.FOnBeforeOpenInplaceEditor(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AValue,ACanOpen);
    };
    this.DoBeforePasteFromClipboard = function (ACanPaste) {
      if (this.FOnBeforePasteFromClipboard != null) this.FOnBeforePasteFromClipboard(this,ACanPaste);
    };
    this.DoBeforeShowFilter = function (AColumn, ACanShow) {
      if (this.FOnBeforeShowFilter != null) this.FOnBeforeShowFilter(this,AColumn,ACanShow);
    };
    this.DoBeforeShowFilterDialog = function (AFilterDialog, ACanShow) {
      if (this.FOnBeforeShowFilterDialog != null) this.FOnBeforeShowFilterDialog(this,AFilterDialog,ACanShow);
    };
    this.DoBeforeShowFindDialog = function (AFindDialog, ACanShow) {
      if (this.FOnBeforeShowFindDialog != null) this.FOnBeforeShowFindDialog(this,AFindDialog,ACanShow);
    };
    this.DoBeforeShowReplaceDialog = function (AReplaceDialog, ACanShow) {
      if (this.FOnBeforeShowReplaceDialog != null) this.FOnBeforeShowReplaceDialog(this,AReplaceDialog,ACanShow);
    };
    this.DoBeforeSortColumn = function (AColumn, ACanSort) {
      if (this.FOnBeforeSortColumn != null) this.FOnBeforeSortColumn(this,AColumn,ACanSort);
    };
    this.DoCanAppendColumn = function (AColumn, ACanAppend) {
      if (this.FOnCanAppendColumn != null) this.FOnCanAppendColumn(this,AColumn,ACanAppend);
    };
    this.DoCanAppendRow = function (ARow, ACanAppend) {
      if (this.FOnCanAppendRow != null) this.FOnCanAppendRow(this,ARow,ACanAppend);
    };
    this.DoCanDeleteColumn = function (AColumn, ACanDelete) {
      if (this.FOnCanDeleteColumn != null) this.FOnCanDeleteColumn(this,AColumn,ACanDelete);
    };
    this.DoCanDeleteRow = function (ARow, ACanDelete) {
      if (this.FOnCanDeleteRow != null) this.FOnCanDeleteRow(this,ARow,ACanDelete);
    };
    this.DoCanDragColumn = function (AColumn, ACanDrag) {
      if (this.FOnCanDragColumn != null) this.FOnCanDragColumn(this,AColumn,ACanDrag);
    };
    this.DoCanDragRow = function (ARow, ACanDrag) {
      if (this.FOnCanDragRow != null) this.FOnCanDragRow(this,ARow,ACanDrag);
    };
    this.DoCanDropColumn = function (AFromColumn, AToColumn, ACanDrop) {
      if (this.FOnCanDropColumn != null) this.FOnCanDropColumn(this,AFromColumn,AToColumn,ACanDrop);
    };
    this.DoCanDropRow = function (AFromRow, AToRow, ACanDrop) {
      if (this.FOnCanDropRow != null) this.FOnCanDropRow(this,AFromRow,AToRow,ACanDrop);
    };
    this.DoCanEditCell = function (AColumn, ARow, ACanEdit) {
      var cl = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var et = 0;
      ACanEdit.set(ACanEdit.get() && this.GetOptions().FEditing.FEnabled);
      cl.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow));
      ACanEdit.set(ACanEdit.get() && !this.IsCellReadOnly(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cl)));
      this.DoGetInplaceEditorType(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cl),{get: function () {
          return et;
        }, set: function (v) {
          et = v;
        }});
      ACanEdit.set(ACanEdit.get() && (et !== $mod.TTMSFNCDataGridInplaceEditorType.getNone));
      if ((this.FAdapter != null) && $mod.TTMSFNCDataGridRendererDataAdapter.isPrototypeOf(this.FAdapter)) rtl.as(this.FAdapter,$mod.TTMSFNCDataGridRendererDataAdapter).CanEditCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow)),ACanEdit);
      if (this.FOnCanEditCell != null) this.FOnCanEditCell(this,AColumn,ARow,ACanEdit);
    };
    this.DoCanInsertColumn = function (AColumn, ACanInsert) {
      if (this.FOnCanInsertColumn != null) this.FOnCanInsertColumn(this,AColumn,ACanInsert);
    };
    this.DoCanInsertRow = function (ARow, ACanInsert) {
      if (this.FOnCanInsertRow != null) this.FOnCanInsertRow(this,ARow,ACanInsert);
    };
    this.DoCanSizeColumn = function (AColumn, ASize, ACanSize) {
      if (this.FOnCanSizeColumn != null) this.FOnCanSizeColumn(this,AColumn,ASize,ACanSize);
    };
    this.DoCanSizeRow = function (ARow, ASize, ACanSize) {
      if (this.FOnCanSizeRow != null) this.FOnCanSizeRow(this,ARow,ASize,ACanSize);
    };
    this.DoCellAfterDraw = function (Sender, AGraphics) {
      if ((this.FOnAfterDrawCell != null) && pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCell.isPrototypeOf(Sender)) this.FOnAfterDrawCell(this,AGraphics,rtl.as(Sender,pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCell));
    };
    this.DoCellAfterNodeCollapse = function (ACell) {
      if ((this.FAdapter != null) && $mod.TTMSFNCDataGridRendererDataAdapter.isPrototypeOf(this.FAdapter)) rtl.as(this.FAdapter,$mod.TTMSFNCDataGridRendererDataAdapter).RowAfterCollapse(ACell.GetRow());
      if (this.FOnCellAfterNodeCollapse != null) this.FOnCellAfterNodeCollapse(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
    };
    this.DoCellAfterNodeExpand = function (ACell) {
      if ((this.FAdapter != null) && $mod.TTMSFNCDataGridRendererDataAdapter.isPrototypeOf(this.FAdapter)) rtl.as(this.FAdapter,$mod.TTMSFNCDataGridRendererDataAdapter).RowAfterExpand(ACell.GetRow());
      if (this.FOnCellAfterNodeExpand != null) this.FOnCellAfterNodeExpand(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
    };
    this.DoCellAnchorClick = function (AColumn, ARow, AAnchor) {
      if (this.GetOptions().FURL.FAutoOpen) pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.OpenURL(AAnchor);
      if (this.FOnCellAnchorClick != null) this.FOnCellAnchorClick(this,AColumn,ARow,AAnchor);
    };
    this.DoCellBeforeDraw = function (Sender, AGraphics, ACanDraw) {
      if ((this.FOnBeforeDrawCell != null) && pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCell.isPrototypeOf(Sender)) this.FOnBeforeDrawCell(this,AGraphics,rtl.as(Sender,pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCell),ACanDraw);
    };
    this.DoCellBeforeNodeCollapse = function (ACell, ACanCollapse) {
      if ((this.FAdapter != null) && $mod.TTMSFNCDataGridRendererDataAdapter.isPrototypeOf(this.FAdapter)) rtl.as(this.FAdapter,$mod.TTMSFNCDataGridRendererDataAdapter).RowBeforeCollapse(ACell.GetRow());
      if (this.FOnCellBeforeNodeCollapse != null) this.FOnCellBeforeNodeCollapse(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),ACanCollapse);
    };
    this.DoCellBeforeNodeExpand = function (ACell, ACanExpand) {
      if ((this.FAdapter != null) && $mod.TTMSFNCDataGridRendererDataAdapter.isPrototypeOf(this.FAdapter)) rtl.as(this.FAdapter,$mod.TTMSFNCDataGridRendererDataAdapter).RowBeforeExpand(ACell.GetRow());
      if (this.FOnCellBeforeNodeExpand != null) this.FOnCellBeforeNodeExpand(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),ACanExpand);
    };
    this.DoCellBeforeShowPopupMenu = function (ACell, APopupMenu, ACanShow) {
      if (this.FOnCellBeforeShowPopupMenu != null) this.FOnCellBeforeShowPopupMenu(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),APopupMenu,ACanShow);
    };
    this.DoCellButtonClick = function (Sender) {
      var cl = null;
      if ((Sender != null) && pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCell.isPrototypeOf(Sender)) {
        cl = rtl.as(Sender,pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCell);
        if (this.FOnCellButtonClick != null) this.FOnCellButtonClick(this,cl.FColumn,cl.FRow);
      };
    };
    this.DoCellCheckChange = function (Sender) {
      var $Self = this;
      var cl = null;
      var I = 0;
      var g = 0;
      var b = false;
      function TriggerEvents(ACell) {
        var cll = null;
        cll = $Self.GetCellObjectForCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
        if (cll != null) {
          if (pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellHelper.GetIsCheckBoxCell.call(cll)) {
            if ($Self.FOnCellCheckBoxChange != null) $Self.FOnCellCheckBoxChange($Self,cll.FColumn,cll.FRow);
          } else if (pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellHelper.GetIsRadioButtonCell.call(cll)) {
            if ($Self.FOnCellRadioButtonChange != null) $Self.FOnCellRadioButtonChange($Self,cll.FColumn,cll.FRow);
          };
        };
      };
      if ((Sender != null) && pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCell.isPrototypeOf(Sender)) {
        cl = rtl.as(Sender,pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCell);
        if (pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellHelper.GetIsCheckedCell.call(cl)) {
          this.IncUpdateCount();
          b = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellHelper.GetAsCheckedCell.call(cl).FChecked;
          if (pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellHelper.GetIsCheckBoxCell.call(cl)) {
            if ((cl.FRow <= (this.FFixedRowCount - 1)) && this.GetOptions().FColumn.FFixedAutoCheckAll) {
              for (var $l = cl.FRow, $end = this.FRowCount - this.FFixedBottomRowCount - 1; $l <= $end; $l++) {
                I = $l;
                if ((I !== cl.FRow) && this.IsCellDisplayed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(cl.FColumn,I)))) {
                  if (this.GetBoolean(cl.FColumn,I) !== b) {
                    this.SetBoolean(cl.FColumn,I,b);
                    TriggerEvents(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(cl.FColumn,I)));
                  };
                };
              };
            };
          } else if (pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellHelper.GetIsRadioButtonCell.call(cl)) {
            g = this.GetRadioGroupIndex(cl.FColumn,cl.FRow);
            for (var $l1 = 0, $end1 = this.FRowCount - 1; $l1 <= $end1; $l1++) {
              I = $l1;
              if ((I !== cl.FRow) && this.IsCellDisplayed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(cl.FColumn,I)))) {
                if (this.GetRadioGroupIndex(cl.FColumn,I) === g) {
                  if (this.GetBoolean(cl.FColumn,I) !== false) {
                    this.SetBoolean(cl.FColumn,I,false);
                    TriggerEvents(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(cl.FColumn,I)));
                  };
                };
              };
            };
          };
          if (b !== this.GetBoolean(cl.FColumn,cl.FRow)) {
            this.SetBoolean(cl.FColumn,cl.FRow,b);
            TriggerEvents(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(cl.FColumn,cl.FRow)));
          };
          this.DecUpdateCount();
          this.Display();
        };
      };
    };
    this.DoCellClick = function (ACell, AMouseInfo) {
      var c = false;
      var sd = 0;
      var idx = null;
      var cl = null;
      if (this.IsCellFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell)) && (ACell.GetRow() === this.GetOptions().FSorting.FRow) && this.GetOptions().FSorting.FEnabled) {
        c = true;
        this.DoBeforeSortColumn(ACell.GetColumn(),{get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }});
        if (c) {
          cl = this.GetCellObjectForCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
          if (cl != null) {
            if (!(pas.Classes.TShiftState$a.ssShift in AMouseInfo.Shift)) this.GetSortIndexList().Clear();
            var $tmp = cl.FSortIndicator;
            if ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellSortIndicator.gsiAscending) {
              sd = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortDirection.gsdDescending}
             else {
              sd = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortDirection.gsdAscending;
            };
            idx = null;
            if (!this.GetSortIndexList().Find(ACell.GetColumn(),{get: function () {
                return idx;
              }, set: function (v) {
                idx = v;
              }})) {
              this.GetSortIndexList().Add$1(ACell.GetColumn(),sd)}
             else {
              var $tmp1 = idx.FDirection;
              if ($tmp1 === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortDirection.gsdAscending) {
                idx.FDirection = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortDirection.gsdDescending}
               else if ($tmp1 === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortDirection.gsdDescending) idx.FDirection = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortDirection.gsdAscending;
            };
            if (this.IsGrouped()) {
              this.GroupSortIndexed()}
             else this.SortIndexed();
          };
          this.DoAfterSortColumn(ACell.GetColumn());
        };
      };
      if (this.FOnCellClick != null) this.FOnCellClick(this,ACell.GetColumn(),ACell.GetRow());
    };
    this.DoCellCommentIndicatorClick = function (Sender) {
      var g = null;
      var sz = pas["WEBLib.TMSFNCTypes"].TSizeF.$new();
      var pt = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var ptx = pas.Types.TPoint.$new();
      var p = null;
      var cl = null;
      var cr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var cm = "";
      if (pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCell.isPrototypeOf(Sender)) {
        cl = rtl.as(Sender,pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCell);
        p = this.GetParentHost();
        if (pas["WEBLib.Controls"].TWinControl.isPrototypeOf(p)) this.GetCommentPopup().SetPlacementControl(rtl.as(p,pas["WEBLib.Controls"].TWinControl));
        cr.$assign(cl.GetCommentIndicatorRect());
        pt.$assign(pas["WEBLib.TMSFNCTypes"].PointF(cr.Left,cr.Bottom));
        if (pas["WEBLib.Controls"].TWinControl.isPrototypeOf(p)) {
          ptx.$assign(rtl.as(p,pas["WEBLib.Controls"].TWinControl).ClientToScreen(pas.Types.Point(Math.round(pt.X),Math.round(pt.Y))));
          pt.$assign(pas["WEBLib.TMSFNCTypes"].PointF(ptx.x,ptx.y));
        };
        cm = cl.FComment;
        this.GetCommentPopup().FCell = cl;
        g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[1,1,false,true]);
        g.BeginScene();
        g.FBitmapContainer = this.GetBitmapContainer();
        try {
          sz.$assign(g.CalculateTextSize(cm,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,10000,10000)),true,true));
          this.GetCommentPopup().SetDropDownHeight(sz.cy + 10);
          this.GetCommentPopup().SetDropDownWidth(sz.cx + 10);
        } finally {
          g.EndScene();
          g = rtl.freeLoc(g);
        };
        this.GetCommentPopup().FPlacementRectangle.SetLeft(pt.X);
        this.GetCommentPopup().FPlacementRectangle.SetTop(pt.Y);
        this.GetCommentPopup().FPlacementRectangle.SetRight(pt.X + this.GetCommentPopup().FDropDownWidth);
        this.GetCommentPopup().FPlacementRectangle.SetBottom(pt.Y + this.GetCommentPopup().FDropDownHeight);
        this.GetCommentPopup().Popup(false);
      };
    };
    this.DoCellDblClick = function (AColumn, ARow) {
      if (this.FOnCellDblClick != null) this.FOnCellDblClick(this,AColumn,ARow);
    };
    this.DoCellEditGetData = function (ACell, AInplaceEditor, AValue) {
      if (this.FOnCellEditGetData != null) this.FOnCellEditGetData(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AInplaceEditor,AValue);
    };
    this.DoCellEditSetData = function (ACell, AInplaceEditor, AValue) {
      if ((this.FAdapter != null) && $mod.TTMSFNCDataGridRendererDataAdapter.isPrototypeOf(this.FAdapter)) rtl.as(this.FAdapter,$mod.TTMSFNCDataGridRendererDataAdapter).EditSetData(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AInplaceEditor,AValue);
      if (this.FOnCellEditSetData != null) this.FOnCellEditSetData(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AInplaceEditor,AValue);
    };
    this.DoCellEditValidateData = function (ACell, AInplaceEditor, AValue, AValid) {
      if (this.FOnCellEditValidateData != null) this.FOnCellEditValidateData(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AInplaceEditor,AValue,AValid);
    };
    this.DoCellFilterButtonClick = function (Sender) {
      var pt = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var cl = null;
      var fr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var p = null;
      var c = false;
      var ptx = pas.Types.TPoint.$new();
      var ed = null;
      if ((Sender != null) && pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCell.isPrototypeOf(Sender)) {
        cl = rtl.as(Sender,pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCell);
        if (this.GetOptions().FFiltering.FEnabled && (this.GetOptions().FFiltering.FRow === cl.FRow)) {
          if (this.GetOptions().FFiltering.FAdvanced) {
            this.ShowFilterDialog()}
           else {
            c = true;
            this.DoBeforeShowFilter(cl.FColumn,{get: function () {
                return c;
              }, set: function (v) {
                c = v;
              }});
            if (c) {
              this.UpdateFilterList(cl.FColumn);
              p = this.GetParentHost();
              if (pas["WEBLib.Controls"].TWinControl.isPrototypeOf(p)) this.GetFilterPopup().SetPlacementControl(rtl.as(p,pas["WEBLib.Controls"].TWinControl));
              fr.$assign(cl.GetFilterButtonRect());
              pt.$assign(pas["WEBLib.TMSFNCTypes"].PointF(fr.Left,fr.Bottom));
              if (pas["WEBLib.Controls"].TWinControl.isPrototypeOf(p)) {
                ptx.$assign(rtl.as(p,pas["WEBLib.Controls"].TWinControl).ClientToScreen(pas.Types.Point(Math.round(pt.X),Math.round(pt.Y))));
                pt.$assign(pas["WEBLib.TMSFNCTypes"].PointF(ptx.x,ptx.y));
              };
              this.GetFilterPopup().FPlacementRectangle.SetLeft(pt.X);
              this.GetFilterPopup().FPlacementRectangle.SetTop(pt.Y);
              this.GetFilterPopup().FPlacementRectangle.SetRight(pt.X + this.GetFilterPopup().FDropDownWidth);
              this.GetFilterPopup().FPlacementRectangle.SetBottom(pt.Y + this.GetFilterPopup().FDropDownHeight);
              if (!this.FStyleApplied) {
                this.GetFilterPopup().FFillColor = this.FFilterAppearance.FFill.FColor;
                this.GetFilterPopup().FStrokeColor = this.FFilterAppearance.FStroke.FColor;
                this.GetFilterContainer().FFill.Assign(this.FFilterAppearance.FFill);
                this.GetFilterContainer().FStroke.Assign(this.FFilterAppearance.FStroke);
              };
              this.GetFilterContainer().SetWidth(this.GetOptions().FFiltering.FDropDownWidth);
              this.GetFilterContainer().SetHeight(this.GetOptions().FFiltering.FDropDownHeight);
              this.GetFilterPopup().SetDropDownHeight(this.GetOptions().FFiltering.FDropDownHeight);
              this.GetFilterPopup().SetDropDownWidth(this.GetOptions().FFiltering.FDropDownWidth);
              this.GetFilterTypeComboBox().SetParent(null);
              this.GetFilterEdit().SetParent(null);
              this.GetFilterClearButton().SetParent(null);
              this.GetFilterListBox().SetParent(null);
              this.GetFilterSortAscendingButton().SetParent(null);
              this.GetFilterSortDescendingButton().SetParent(null);
              if (this.FFilterCustomEditor != null) this.FFilterCustomEditor.SetParent(null);
              ed = null;
              this.DoCustomizeFilterPopupEditor(cl.FColumn,{get: function () {
                  return ed;
                }, set: function (v) {
                  ed = v;
                }});
              if (!(ed != null)) {
                this.GetFilterTypeComboBox().SetParent(this.GetFilterContainer());
                this.GetFilterEdit().SetParent(this.GetFilterContainer());
                this.GetFilterClearButton().SetParent(this.GetFilterContainer());
                this.GetFilterListBox().SetParent(this.GetFilterContainer());
                this.GetFilterSortAscendingButton().SetParent(this.GetFilterContainer());
                this.GetFilterSortDescendingButton().SetParent(this.GetFilterContainer());
                this.GetFilterClearButton().FDataInteger = cl.FColumn;
                this.GetFilterSortAscendingButton().FDataInteger = cl.FColumn;
                this.GetFilterSortDescendingButton().FDataInteger = cl.FColumn;
                this.GetFilterSortAscendingButton().SetVisible(this.GetOptions().FSorting.FEnabled);
                this.GetFilterSortDescendingButton().SetVisible(this.GetOptions().FSorting.FEnabled);
                this.GetFilterEdit().FTag$1 = cl.FColumn;
                this.GetFilterPopup().FFocusedControl = this.GetFilterEdit();
              } else {
                ed.SetParent(this.GetFilterContainer());
                this.GetFilterPopup().FFocusedControl = ed;
              };
              this.FFilterCustomEditor = ed;
              this.GetFilterPopup().SetContentControl(this.GetFilterContainer());
              this.GetFilterPopup().Popup(false);
              if (!(ed != null)) {
                if (!this.FStyleApplied) {
                  this.GetFilterListBox().FItemsAppearance.GetFont().Assign(this.FFilterAppearance.FFont);
                  this.GetFilterSortAscendingButton().FFont$1.Assign(this.FFilterAppearance.FFont);
                  this.GetFilterSortAscendingButton().FAppearance.FNormalFill.Assign(this.FFilterAppearance.FFill);
                  this.GetFilterSortAscendingButton().FAppearance.FNormalStroke.Assign(this.FFilterAppearance.FStroke);
                  this.GetFilterSortDescendingButton().FFont$1.Assign(this.FFilterAppearance.FFont);
                  this.GetFilterSortDescendingButton().FAppearance.FNormalFill.Assign(this.FFilterAppearance.FFill);
                  this.GetFilterSortDescendingButton().FAppearance.FNormalStroke.Assign(this.FFilterAppearance.FStroke);
                } else {
                  this.GetFilterSortAscendingButton().FAppearance.FNormalStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
                  this.GetFilterSortDescendingButton().FAppearance.FNormalStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
                };
              };
              this.GetFilterContainer().Realign();
              this.DoAfterShowFilter(cl.FColumn);
            };
          };
        };
      };
    };
    this.DoCellNodeCollapse = function (Sender) {
      var cl = null;
      var cc = false;
      var c = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      if ((Sender != null) && pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCell.isPrototypeOf(Sender)) {
        cl = rtl.as(Sender,pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCell);
        cc = true;
        c.$assign(cl.GetCoordinate());
        this.DoCellBeforeNodeCollapse(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c),{get: function () {
            return cc;
          }, set: function (v) {
            cc = v;
          }});
        if (cc) {
          this.CollapseNode(c.GetRow());
          this.DoCellAfterNodeCollapse(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c));
        };
      };
    };
    this.DoCellNodeExpand = function (Sender) {
      var cl = null;
      var c = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var ce = false;
      if ((Sender != null) && pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCell.isPrototypeOf(Sender)) {
        cl = rtl.as(Sender,pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCell);
        ce = true;
        c.$assign(cl.GetCoordinate());
        this.DoCellBeforeNodeExpand(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c),{get: function () {
            return ce;
          }, set: function (v) {
            ce = v;
          }});
        if (ce) {
          this.ExpandNode(c.GetRow());
          this.DoCellAfterNodeExpand(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c));
        };
      };
    };
    this.DoCellRightClick = function (AColumn, ARow) {
      if (this.FOnCellRightClick != null) this.FOnCellRightClick(this,AColumn,ARow);
    };
    this.DoColumnDropped = function (AFromColumn, AToColumn) {
      if (this.FOnColumnDropped != null) this.FOnColumnDropped(this,AFromColumn,AToColumn);
    };
    this.DoColumnsChanged = function (Sender) {
      this.SynchronizeColumns(true);
      if ((this.GetUpdateCount() > 0) || this.GetIsDestroying()) return;
      this.RefreshData$2(true);
      this.Update();
    };
    this.DoColumnSized = function (AColumn, ASize) {
      if (this.FOnColumnSized != null) this.FOnColumnSized(this,AColumn,ASize);
    };
    this.DoCustomizeFilterPopupEditor = function (AColumn, AEditor) {
      if (this.FOnCustomizeFilterPopupEditor != null) this.FOnCustomizeFilterPopupEditor(this,AColumn,AEditor);
    };
    this.DoDeleteColumn = function (AColumn) {
      if (this.FOnDeleteColumn != null) this.FOnDeleteColumn(this,AColumn);
    };
    this.DoDeleteRow = function (ARow) {
      if ((this.FAdapter != null) && $mod.TTMSFNCDataGridRendererDataAdapter.isPrototypeOf(this.FAdapter)) rtl.as(this.FAdapter,$mod.TTMSFNCDataGridRendererDataAdapter).DeleteRow(ARow);
      if (this.FOnDeleteRow != null) this.FOnDeleteRow(this,ARow);
    };
    this.DoBeforeClearSelectedCells = function (ASelection, ACanClear) {
      if (this.FOnBeforeClearSelectedCells != null) this.FOnBeforeClearSelectedCells(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoordRange.$clone(ASelection),ACanClear);
    };
    this.DoAfterClearSelectedCells = function (ASelection) {
      if (this.FOnAfterClearSelectedCells != null) this.FOnAfterClearSelectedCells(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoordRange.$clone(ASelection));
    };
    this.DoDisplay = function () {
      if (this.FOnDisplay != null) this.FOnDisplay(this);
    };
    this.DoDisplayGrid = function (Sender) {
      if (this.FOnDisplay != null) this.FOnDisplay(Sender);
    };
    this.DoDragTimer = function (Sender) {
      var contentr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (!this.GetOptions().FMouse.FAutoDragging) {
        this.GetDragTimer().SetEnabled(false);
        return;
      };
      contentr.$assign(this.GetContentRect());
      if (this.FX >= (contentr.Right - contentr.Left)) {
        if (this.GetOptions().FMouse.FAutoScrollingSpeedMode === $mod.TTMSFNCDataGridAutoScrollingSpeedMode.gasmPixels) {
          this.FDragScrollCell.SetColumn(this.FDragScrollCell.GetColumn() + (Math.round(this.FX - (contentr.Right - contentr.Left)) * this.GetOptions().FMouse.FAutoScrollingSpeed))}
         else this.FDragScrollCell.SetColumn(this.FDragScrollCell.GetColumn() + this.GetOptions().FMouse.FAutoScrollingSpeed);
        this.Navigate(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FDragScrollCell),false,false,false);
      } else if (this.FX <= 0) {
        if (this.GetOptions().FMouse.FAutoScrollingSpeedMode === $mod.TTMSFNCDataGridAutoScrollingSpeedMode.gasmPixels) {
          this.FDragScrollCell.SetColumn(this.FDragScrollCell.GetColumn() + (Math.round(this.FX) * this.GetOptions().FMouse.FAutoScrollingSpeed))}
         else this.FDragScrollCell.SetColumn(this.FDragScrollCell.GetColumn() - this.GetOptions().FMouse.FAutoScrollingSpeed);
        this.Navigate(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FDragScrollCell),false,false,false);
      };
      if (this.FY >= (contentr.Bottom - contentr.Top)) {
        if (this.GetOptions().FMouse.FAutoScrollingSpeedMode === $mod.TTMSFNCDataGridAutoScrollingSpeedMode.gasmPixels) {
          this.FDragScrollCell.SetRow(this.FDragScrollCell.GetRow() + (Math.round(this.FY - (contentr.Bottom - contentr.Top)) * this.GetOptions().FMouse.FAutoScrollingSpeed))}
         else this.FDragScrollCell.SetRow(this.FDragScrollCell.GetRow() + this.GetOptions().FMouse.FAutoScrollingSpeed);
        this.Navigate(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FDragScrollCell),false,false,false);
      } else if (this.FY <= 0) {
        if (this.GetOptions().FMouse.FAutoScrollingSpeedMode === $mod.TTMSFNCDataGridAutoScrollingSpeedMode.gasmPixels) {
          this.FDragScrollCell.SetRow(this.FDragScrollCell.GetRow() + (Math.round(this.FY) * this.GetOptions().FMouse.FAutoScrollingSpeed))}
         else this.FDragScrollCell.SetRow(this.FDragScrollCell.GetRow() - this.GetOptions().FMouse.FAutoScrollingSpeed);
        this.Navigate(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FDragScrollCell),false,false,false);
      };
    };
    this.DoEditorExit = function (Sender) {
      var m = 0;
      var ec = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var p = null;
      if (this.IsEditing()) {
        if ($mod.TTMSFNCDataGridColorPicker.isPrototypeOf(Sender)) {
          p = rtl.as(Sender,$mod.TTMSFNCDataGridColorPicker).GetPopup();
          if ((p != null) && p.FIsOpen) return;
        };
        if ($mod.TTMSFNCDataGridEdit.isPrototypeOf(Sender)) {
          p = rtl.as(Sender,$mod.TTMSFNCDataGridEdit).LookupList();
          if ((p != null) && p.FIsOpen) return;
        };
        m = $mod.TTMSFNCDataGridInplaceEditorExitMode.gieeIgnoreEditing;
        ec.$assign(this.FEditingCell);
        this.DoBeforeExitInplaceEditor(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ec),this.FInplaceEditor,{get: function () {
            return m;
          }, set: function (v) {
            m = v;
          }});
        var $tmp = m;
        if ($tmp === $mod.TTMSFNCDataGridInplaceEditorExitMode.gieeStopEditing) {
          this.StopEditing(false)}
         else if ($tmp === $mod.TTMSFNCDataGridInplaceEditorExitMode.gieeCancelEditing) this.CancelEditing(false);
        this.DoAfterExitInplaceEditor(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ec),m);
      };
    };
    this.DoEditorKeyDown = function (Sender, Key, Shift) {
      var ki = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridKeyInfo.$new();
      if (rtl.neSet(Shift,{})) return;
      this.FKeyDown = true;
      var $tmp = Key.get();
      if ($tmp === 9) {
        if (this.FInplaceEditorActive) Key.set(0)}
       else if (($tmp === 13) || ($tmp === 113)) {
        this.FDroppedDown = pas["WEBLib.StdCtrls"].TCustomComboBox.isPrototypeOf(this.FInplaceEditor) && rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomComboBox).FDroppedDown;
        this.FDroppedDown = this.FDroppedDown || ($mod.TTMSFNCDataGridEdit.isPrototypeOf(this.FInplaceEditor) && rtl.as(this.FInplaceEditor,$mod.TTMSFNCDataGridEdit).LookupList().FIsOpen);
        this.FDroppedDown = this.FDroppedDown || (pas["WEBLib.TMSFNCCustomPicker"].TTMSFNCCustomPicker.isPrototypeOf(this.FInplaceEditor) && rtl.as(this.FInplaceEditor,pas["WEBLib.TMSFNCCustomPicker"].TTMSFNCCustomPicker).GetPopup().FIsOpen);
        if (!(pas["WEBLib.StdCtrls"].TCustomComboBox.isPrototypeOf(this.FInplaceEditor) && rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomComboBox).FDroppedDown) && !($mod.TTMSFNCDataGridEdit.isPrototypeOf(this.FInplaceEditor) && rtl.as(this.FInplaceEditor,$mod.TTMSFNCDataGridEdit).LookupList().FIsOpen) && !(pas["WEBLib.TMSFNCCustomPicker"].TTMSFNCCustomPicker.isPrototypeOf(this.FInplaceEditor) && rtl.as(this.FInplaceEditor,pas["WEBLib.TMSFNCCustomPicker"].TTMSFNCCustomPicker).GetPopup().FIsOpen)) Key.set(0);
      } else if ($tmp === 37) {
        if (this.GetOptions().FKeyboard.FArrowKeyDirectEdit) {
          if ((pas["WEBLib.StdCtrls"].TCustomEdit.isPrototypeOf(this.FInplaceEditor) && (rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomEdit).GetSelStart() === 0)) || (pas["WEBLib.StdCtrls"].TCustomMemo.isPrototypeOf(this.FInplaceEditor) && (rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomMemo).GetSelStart() === 0))) {
            ki.$assign(pas["WEBLib.TMSFNCDataGridCell"].DefaultKeyInfo());
            ki.Key = 9;
            ki.Shift = rtl.createSet(pas.Classes.TShiftState$a.ssShift);
            this.ProcessTab(ki,$mod.TTMSFNCDataGridTabKeyDirection.gtkdNextColumnCell,$mod.TTMSFNCDataGridTabKeyHandling.gtkhNextCell,true,$mod.TTMSFNCDataGridEditCellStart.gcsEnd);
            Key.set(0);
            if (!(this.FInplaceEditor != null)) pas.SysUtils.Abort();
          };
        };
      } else if ($tmp === 39) {
        if (this.GetOptions().FKeyboard.FArrowKeyDirectEdit) {
          if ((pas["WEBLib.StdCtrls"].TCustomEdit.isPrototypeOf(this.FInplaceEditor) && (rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomEdit).GetSelStart() === rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomEdit).GetText().length)) || (pas["WEBLib.StdCtrls"].TCustomMemo.isPrototypeOf(this.FInplaceEditor) && (rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomMemo).GetSelStart() === rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomMemo).GetText().length))) {
            ki.$assign(pas["WEBLib.TMSFNCDataGridCell"].DefaultKeyInfo());
            ki.Key = 9;
            this.ProcessTab(ki,$mod.TTMSFNCDataGridTabKeyDirection.gtkdNextColumnCell,$mod.TTMSFNCDataGridTabKeyHandling.gtkhNextCell,true,$mod.TTMSFNCDataGridEditCellStart.gcsStart);
            Key.set(0);
            if (!(this.FInplaceEditor != null)) pas.SysUtils.Abort();
          };
        };
      } else if (($tmp === 38) || ($tmp === 40)) {
        if (!pas["WEBLib.StdCtrls"].TCustomMemo.isPrototypeOf(this.FInplaceEditor) && !(pas["WEBLib.StdCtrls"].TCustomComboBox.isPrototypeOf(this.FInplaceEditor) && rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomComboBox).FDroppedDown) && !($mod.TTMSFNCDataGridEdit.isPrototypeOf(this.FInplaceEditor) && rtl.as(this.FInplaceEditor,$mod.TTMSFNCDataGridEdit).LookupList().FIsOpen) && !(pas["WEBLib.TMSFNCCustomPicker"].TTMSFNCCustomPicker.isPrototypeOf(this.FInplaceEditor) && rtl.as(this.FInplaceEditor,pas["WEBLib.TMSFNCCustomPicker"].TTMSFNCCustomPicker).GetPopup().FIsOpen)) Key.set(0);
      };
    };
    this.DoFilterBuilderApplyButtonClicked = function (Sender, AFilterBuilder, AClose) {
      this.ApplyFilterFromBuilder();
    };
    this.DoFilterBuilderClose = function (Sender) {
      this.DoAfterShowFilterDialog(this.GetFilterDialog());
    };
    this.DoLayoutChanged = function (Sender) {
      this.DoUpdate();
    };
    this.IconsChanged = function (Sender) {
      this.Display();
    };
    this.DoEditorKeyPress = function (Sender, Key) {
      if (Key.get().charCodeAt() in rtl.createSet(27,13,9)) Key.set("\x00");
    };
    this.DoEditorKeyUp = function (Sender, Key, Shift) {
      var ki = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridKeyInfo.$new();
      var a = false;
      var Allow = false;
      if (!this.FKeyDown) return;
      this.FKeyDown = false;
      var $tmp = Key.get();
      if ($tmp === 9) {
        ki.$assign(pas["WEBLib.TMSFNCDataGridCell"].DefaultKeyInfo());
        ki.Kind = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridKeyKind.gkkDialog;
        ki.Key = Key.get();
        ki.Shift = rtl.refSet(Shift);
        ki.Blocked = this.FInplaceEditorActive;
        this.HandleKey(ki);
      };
      if (rtl.neSet(Shift,{})) return;
      var $tmp1 = Key.get();
      if ($tmp1 === 27) {
        this.CancelEditing(true)}
       else if (($tmp1 === 13) || ($tmp1 === 113)) {
        if (!this.FDroppedDown) this.CloseInplaceEditor(false,false,Key.get() === 13,true);
      } else if (($tmp1 === 38) || ($tmp1 === 40)) {
        if (!pas["WEBLib.StdCtrls"].TCustomMemo.isPrototypeOf(this.FInplaceEditor) && !(pas["WEBLib.StdCtrls"].TCustomComboBox.isPrototypeOf(this.FInplaceEditor) && rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomComboBox).FDroppedDown) && !($mod.TTMSFNCDataGridEdit.isPrototypeOf(this.FInplaceEditor) && rtl.as(this.FInplaceEditor,$mod.TTMSFNCDataGridEdit).LookupList().FIsOpen) && !(pas["WEBLib.TMSFNCCustomPicker"].TTMSFNCCustomPicker.isPrototypeOf(this.FInplaceEditor) && rtl.as(this.FInplaceEditor,pas["WEBLib.TMSFNCCustomPicker"].TTMSFNCCustomPicker).GetPopup().FIsOpen) && !(this.FInplaceEditorType in rtl.createSet($mod.TTMSFNCDataGridInplaceEditorType.getSpinBox))) {
          a = this.StopEditing(true);
          if (a) {
            ki.$assign(pas["WEBLib.TMSFNCDataGridCell"].DefaultKeyInfo());
            ki.Key = Key.get();
            ki.Shift = rtl.refSet(Shift);
            ki.Kind = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridKeyKind.gkkDown;
            this.HandleKey(ki);
            if (this.GetOptions().FKeyboard.FArrowKeyDirectEdit) {
              Allow = true;
              this.DoCanEditCell(this.GetFocusedCell().GetColumn(),this.GetFocusedCell().GetRow(),{get: function () {
                  return Allow;
                }, set: function (v) {
                  Allow = v;
                }});
              if (Allow) this.EditCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.GetFocusedCell()),$mod.TTMSFNCDataGridEditCellStart.gcsNone,false,"",0);
            };
          };
        };
      };
      this.FDroppedDown = false;
      Key.set(ki.Key);
    };
    this.BeginDrag = function () {
      var p = null;
      p = this.GetParentHost();
      if ((p != null) && pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.isPrototypeOf(p)) {
        this.FDragging = true;
        p.BeginDrag$1();
      };
    };
    this.DoDropFiles = function (ADropFiles) {
      if (this.FOnDropFiles != null) this.FOnDropFiles(this,ADropFiles);
    };
    this.DoFilterClearClick = function (Sender) {
      var btn = null;
      var c = 0;
      var b = false;
      if (pas["WEBLib.TMSFNCToolBar"].TTMSFNCToolBarButton.isPrototypeOf(Sender)) {
        btn = rtl.as(Sender,pas["WEBLib.TMSFNCToolBar"].TTMSFNCToolBarButton);
        c = btn.FDataInteger;
        b = false;
        if (this.GetFilter().HasFilter(c)) {
          this.GetFilter().RemoveColumnFilter(c);
          b = true;
        };
        if (this.GetFilter().GetCount() === 0) {
          this.ClearFilter()}
         else {
          this.IncUpdateCount();
          this.RemoveFilter();
          this.DecUpdateCount();
          this.ApplyFilter();
        };
        if (b && (c !== -1)) this.DoRemoveFilter(c);
        this.UpdateFilterList(c);
      };
    };
    this.DoFilterEditChange = function (Sender) {
      if (this.FLoadFilter) return;
      this.FFilterEditMode = $mod.TTMSFNCDataGridFilterEditMode.gfemEdit;
      this.FFilterTime = 0;
      this.GetFilterTimer().SetEnabled(true);
    };
    this.DoFilterEnter = function (Sender) {
      this.GetFilterEdit().SelectAll();
    };
    this.DoFilterExitTimer = function (Sender) {
      this.GetFilterExitTimer().SetEnabled(false);
    };
    this.DoFilterListBoxItemCheckChanged = function (Sender, AItem) {
      var I = 0;
      var cl = null;
      var ItemAll = null;
      var ItemEmpty = null;
      var ItemNotEmpty = null;
      var IsAllChecked = false;
      if (!pas["WEBLib.TMSFNCCheckedListBox"].TTMSFNCCheckedListBox.isPrototypeOf(Sender)) return;
      cl = Sender;
      ItemAll = null;
      ItemEmpty = null;
      ItemNotEmpty = null;
      for (var $l = 0, $end = cl.FItems.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (cl.FItems.GetItem$1(I).FText === this.GetOptions().FLocalization.FFilterAllText) {
          ItemAll = rtl.as(cl.FItems.GetItem$1(I),pas["WEBLib.TMSFNCCheckedListBox"].TTMSFNCCheckedListBoxItem)}
         else if (cl.FItems.GetItem$1(I).FText === this.GetOptions().FLocalization.FFilterEmptyText) {
          ItemEmpty = rtl.as(cl.FItems.GetItem$1(I),pas["WEBLib.TMSFNCCheckedListBox"].TTMSFNCCheckedListBoxItem)}
         else if (cl.FItems.GetItem$1(I).FText === this.GetOptions().FLocalization.FFilterNotEmptyText) ItemNotEmpty = rtl.as(cl.FItems.GetItem$1(I),pas["WEBLib.TMSFNCCheckedListBox"].TTMSFNCCheckedListBoxItem);
      };
      if (AItem === ItemAll) {
        if (ItemAll.FChecked) {
          cl.CheckAll()}
         else cl.UncheckAll();
      } else if (AItem === ItemEmpty) {
        if (ItemEmpty.FChecked) {
          if (ItemAll != null) ItemAll.SetChecked(false);
          if (ItemNotEmpty != null) ItemNotEmpty.SetChecked(false);
        } else {
          if ((ItemNotEmpty != null) && ItemNotEmpty.FChecked) {
            if (ItemAll != null) ItemAll.SetChecked(false);
            for (var $l1 = 0, $end1 = cl.FItems.GetCount() - 1; $l1 <= $end1; $l1++) {
              I = $l1;
              if (cl.FItems.GetItem$1(I) !== ItemNotEmpty) cl.FItems.GetItem$1(I).SetChecked(false);
            };
          };
        };
      } else if (AItem === ItemNotEmpty) {
        if (ItemNotEmpty.FChecked) {
          if (ItemEmpty != null) ItemEmpty.SetChecked(false);
          if (ItemAll != null) ItemAll.SetChecked(false);
          for (var $l2 = 0, $end2 = cl.FItems.GetCount() - 1; $l2 <= $end2; $l2++) {
            I = $l2;
            if (cl.FItems.GetItem$1(I) !== ItemNotEmpty) cl.FItems.GetItem$1(I).SetChecked(false);
          };
        };
      } else {
        if (AItem.FChecked) {
          if (ItemAll != null) ItemAll.SetChecked(false);
          if (ItemNotEmpty != null) ItemNotEmpty.SetChecked(false);
        } else {
          if ((ItemNotEmpty != null) && ItemNotEmpty.FChecked) ItemNotEmpty.SetChecked(false);
        };
      };
      if (ItemAll != null) {
        IsAllChecked = true;
        for (var $l3 = 0, $end3 = cl.FItems.GetCount() - 1; $l3 <= $end3; $l3++) {
          I = $l3;
          if (cl.FItems.GetItem$1(I) === ItemAll) continue;
          if (!cl.FItems.GetItem$1(I).FChecked) {
            IsAllChecked = false;
            break;
          };
        };
        if (ItemAll.FChecked !== IsAllChecked) ItemAll.SetChecked(IsAllChecked);
      };
      this.FFilterEditMode = $mod.TTMSFNCDataGridFilterEditMode.gfemList;
      this.FFilterTime = 0;
      this.GetFilterTimer().SetEnabled(true);
    };
    this.DoFilterSortClick = function (Sender) {
      var btn = null;
      var c = 0;
      if (pas["WEBLib.TMSFNCToolBar"].TTMSFNCToolBarButton.isPrototypeOf(Sender)) {
        btn = rtl.as(Sender,pas["WEBLib.TMSFNCToolBar"].TTMSFNCToolBarButton);
        c = btn.FDataInteger;
        if (btn.FDataString === "asc") {
          if (this.IsGrouped()) {
            this.GroupSort(c,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortDirection.gsdAscending)}
           else this.Sort(c,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortDirection.gsdAscending);
        } else if (btn.FDataString === "desc") {
          if (this.IsGrouped()) {
            this.GroupSort(c,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortDirection.gsdDescending)}
           else this.Sort(c,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortDirection.gsdDescending);
        };
      };
    };
    this.DoFilterTimer = function (Sender) {
      var fd = null;
      var cnd = "";
      var b = false;
      var cli = 0;
      var obj = null;
      var f = false;
      var i = 0;
      var filtercol = 0;
      var c = false;
      var fdt = 0;
      var cl = null;
      var e = null;
      var useEmpty = false;
      this.FFilterTime += 1;
      if (this.FFilterTime >= 40) {
        this.GetFilterTimer().SetEnabled(false);
        if (this.GetOptions().FFiltering.FAdvanced) return;
        if (this.GetFilterListBox() != null) {
          filtercol = this.GetFilterListBox().FTag$1;
          fd = null;
          if (this.GetOptions().FFiltering.FMultiColumn) {
            if (this.GetFilter().HasFilter(filtercol)) fd = this.GetFilter().GetColumnFilter(filtercol);
          } else this.GetFilter().Clear$1();
          fdt = pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilterType.gftEqual;
          cl = this.GetColumn(filtercol);
          if ((cl != null) && ($mod.TTMSFNCDataGridColumnSetting.gcsFilterDefaultType in cl.FSettings)) fdt = cl.FFilterDefaultType;
          if (this.GetFilterTypeComboBox().FVisible && (this.GetFilterTypeComboBox().GetItemIndex() !== -1)) fdt = this.GetFilterTypeComboBox().GetItemIndex();
          f = false;
          if ((this.FFilterEditMode === $mod.TTMSFNCDataGridFilterEditMode.gfemEdit) && (((this.GetFilterEdit() != null) && this.GetFilterEdit().FVisible && (this.GetFilterEdit().GetT() !== "")) || (fdt in rtl.createSet(pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilterType.gftEmpty,pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilterType.gftNotEmpty)))) {
            if (!(fd != null)) fd = this.GetFilter().Add$3();
            fd.SetColumn(filtercol);
            fd.SetType(fdt);
            fd.SetCondition(this.GetFilterEdit().GetT());
            cnd = fd.GetFilterCondition();
            f = true;
          } else if (this.GetFilterListBox().FVisible && (this.FFilterEditMode === $mod.TTMSFNCDataGridFilterEditMode.gfemList)) {
            if (!(fd != null)) fd = this.GetFilter().Add$3();
            fd.SetColumn(filtercol);
            fd.SetType(pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilterType.gftEqual);
            cnd = "";
            useEmpty = false;
            for (var $l = 0, $end = this.GetFilterListBox().FItems.GetCount() - 1; $l <= $end; $l++) {
              i = $l;
              if (this.GetFilterListBox().GetChecked(i)) {
                if (this.GetFilterListBox().FItems.GetItem$1(i).FText === this.GetOptions().FLocalization.FFilterAllText) {
                  cnd = this.GetOptions().FLocalization.FFilterAllText;
                  f = true;
                  break;
                } else if (this.GetFilterListBox().FItems.GetItem$1(i).FText === this.GetOptions().FLocalization.FFilterEmptyText) {
                  useEmpty = true;
                  f = true;
                } else if (this.GetFilterListBox().FItems.GetItem$1(i).FText === this.GetOptions().FLocalization.FFilterNotEmptyText) {
                  fd.SetType(pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilterType.gftNotEmpty);
                  cnd = "!";
                  f = true;
                  break;
                } else {
                  if (cnd !== "") cnd = cnd + "|";
                  b = false;
                  obj = this.GetFilterListBox().FItems.GetItem$1(i).FDataObject;
                  if ((obj != null) && pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilterItem.isPrototypeOf(obj)) b = rtl.as(obj,pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilterItem).FDoubleQuotes;
                  if (b) {
                    cnd = cnd + '"' + this.GetFilterListBox().FItems.GetItem$1(i).FText + '"'}
                   else cnd = cnd + this.GetFilterListBox().FItems.GetItem$1(i).FText;
                  f = true;
                };
              };
            };
            if (useEmpty && (fd.FType === pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilterType.gftEqual)) {
              if (cnd !== "") cnd = cnd + "|";
              cnd = cnd + '""';
            };
            fd.SetFilterCondition(cnd);
          };
          e = null;
          if (this.GetHasFilterEditor(filtercol,this.GetOptions().FFiltering.FRow)) {
            e = this.GetFilterEditor(filtercol,this.GetOptions().FFiltering.FRow);
            if ((e != null) && $mod.TTMSFNCDataGridFilterPanel.isPrototypeOf(e)) rtl.as(e,$mod.TTMSFNCDataGridFilterPanel).Reset();
          };
          cli = -1;
          b = false;
          if ((fd != null) && ((cnd === this.GetOptions().FLocalization.FFilterAllText) || !f)) {
            cli = fd.FColumn;
            b = true;
            pas.SysUtils.FreeAndNil({get: function () {
                return fd;
              }, set: function (v) {
                fd = v;
              }});
          };
          c = true;
          if (fd != null) this.DoBeforeApplyFilter(fd.FColumn,{get: function () {
              return cnd;
            }, set: function (v) {
              cnd = v;
            }},{get: function () {
              return c;
            }, set: function (v) {
              c = v;
            }});
          if (c) {
            if (fd != null) {
              fd.SetFilterCondition(cnd);
              if ((e != null) && $mod.TTMSFNCDataGridFilterPanel.isPrototypeOf(e)) rtl.as(e,$mod.TTMSFNCDataGridFilterPanel).SetFilter(fd);
            };
            if (this.GetFilter().GetCount() === 0) {
              this.ClearFilter()}
             else {
              this.IncUpdateCount();
              this.RemoveFilter();
              this.DecUpdateCount();
              this.ApplyFilter();
            };
            if (b && (cli !== -1)) this.DoRemoveFilter(cli);
            if (fd != null) this.DoAfterApplyFilter(fd.FColumn,cnd);
          };
        };
      };
    };
    this.DoFilterTypeChange = function (Sender) {
      if (this.FLoadFilter) return;
      this.FFilterEditMode = $mod.TTMSFNCDataGridFilterEditMode.gfemEdit;
      this.FFilterTime = 0;
      this.GetFilterTimer().SetEnabled(true);
    };
    this.DoFind = function (Sender, AFindText, AFound) {
      var p = {};
      var f = null;
      var c = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var b = false;
      if (pas["WEBLib.TMSFNCFindDialog"].TTMSFNCFindDialog.isPrototypeOf(Sender)) {
        f = rtl.as(Sender,pas["WEBLib.TMSFNCFindDialog"].TTMSFNCFindDialog);
        p = rtl.refSet($impl.FindOptionsToParameters(rtl.refSet(f.FOptions)));
        b = true;
        this.DoBeforeDialogFind(AFindText,{get: function () {
            return p;
          }, set: function (v) {
            p = v;
          }},{get: function () {
            return b;
          }, set: function (v) {
            b = v;
          }});
        if (b) {
          c.$assign(this.Find$1(AFindText,rtl.refSet(p)));
          AFound.set(this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c)));
          this.DoAfterDialogFind(AFindText,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c),AFound.get());
        } else AFound.set(false);
      };
    };
    this.DoFindNext = function (Sender, AFindText, AFound) {
      var p = {};
      var f = null;
      var c = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var b = false;
      if (pas["WEBLib.TMSFNCFindDialog"].TTMSFNCFindDialog.isPrototypeOf(Sender)) {
        f = rtl.as(Sender,pas["WEBLib.TMSFNCFindDialog"].TTMSFNCFindDialog);
        p = rtl.refSet($impl.FindOptionsToParameters(rtl.refSet(f.FOptions)));
        if (!(pas["WEBLib.TMSFNCFindDialog"].TTMSFNCFindDialogOption.fdoDown in f.FOptions)) p = rtl.unionSet(p,rtl.createSet(pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFindParameter.gfnBackward));
        b = true;
        this.DoBeforeDialogFind(AFindText,{get: function () {
            return p;
          }, set: function (v) {
            p = v;
          }},{get: function () {
            return b;
          }, set: function (v) {
            b = v;
          }});
        if (b) {
          c.$assign(this.Find$2(AFindText,rtl.refSet(p),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.GetFocusedCell())));
          AFound.set(this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c)));
          this.DoAfterDialogFind(AFindText,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c),AFound.get());
        } else AFound.set(false);
      };
    };
    this.DoFocusGrid = function (Sender) {
      if (this.FOnFocus != null) this.FOnFocus(Sender);
    };
    this.DoResetCapture = function (Sender) {
      if (this.FOnResetCapture != null) this.FOnResetCapture(Sender);
    };
    this.DoAfterCalculateGrid = function (Sender) {
      if (this.FOnAfterCalculate != null) this.FOnAfterCalculate(Sender);
    };
    this.DoBeforeCalculateGrid = function (Sender) {
      if (this.FOnBeforeCalculate != null) this.FOnBeforeCalculate(Sender);
    };
    this.DoGetCellClass = function (AColumn, ARow, ACellClass) {
      if (this.FOnGetCellClass != null) this.FOnGetCellClass(this,AColumn,ARow,ACellClass);
    };
    this.DoGetCellFormatting = function (ACell, AData, AFormatting, AConvertSettings, ACanFormat) {
      var cl = null;
      cl = this.GetColumn(ACell.GetColumn());
      if ((cl != null) && ($mod.TTMSFNCDataGridColumnSetting.gcsFormatting in cl.FSettings)) {
        AFormatting.Format = cl.FFormatting.FFormat;
        AFormatting.Type = cl.FFormatting.FType;
        AFormatting.BooleanTrueText = cl.FFormatting.FBooleanTrueText;
        AFormatting.BooleanFalseText = cl.FFormatting.FBooleanFalseText;
        AConvertSettings.$assign(cl.FFormatting.FConvertSettings);
      };
      pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridData.DoGetCellFormatting.apply(this,arguments);
    };
    this.DoGetCellHint = function (ACell, AHint) {
      if (this.FOnGetCellHint != null) this.FOnGetCellHint(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AHint);
    };
    this.DoGetCellLayout = function (ACell) {
      if (this.FOnGetCellLayout != null) this.FOnGetCellLayout(this,ACell);
    };
    this.DoGetCellLayoutHasPriority = function (ACell, AHasPriority) {
      if (this.FOnGetCellLayoutHasPriority != null) this.FOnGetCellLayoutHasPriority(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AHasPriority);
    };
    this.DoGetCellProperties = function (ACell) {
      if ((this.FAdapter != null) && $mod.TTMSFNCDataGridRendererDataAdapter.isPrototypeOf(this.FAdapter)) rtl.as(this.FAdapter,$mod.TTMSFNCDataGridRendererDataAdapter).GetCellProperties(ACell);
      if (this.FOnGetCellProperties != null) this.FOnGetCellProperties(this,ACell);
    };
    this.DoGetInplaceEditorClass = function (ACell, AInplaceEditorClass) {
      if (this.FOnGetInplaceEditorClass != null) this.FOnGetInplaceEditorClass(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AInplaceEditorClass);
    };
    this.DoGetInplaceEditorProperties = function (ACell, AInplaceEditor, AInplaceEditorType) {
      if ((this.FAdapter != null) && $mod.TTMSFNCDataGridRendererDataAdapter.isPrototypeOf(this.FAdapter)) rtl.as(this.FAdapter,$mod.TTMSFNCDataGridRendererDataAdapter).GetInplaceEditorProperties(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AInplaceEditor,AInplaceEditorType);
      if (this.FOnGetInplaceEditorProperties != null) this.FOnGetInplaceEditorProperties(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AInplaceEditor,AInplaceEditorType);
    };
    this.DoGetInplaceEditorRect = function (ACell, AInplaceEditor, AInplaceEditorRect) {
      if (this.FOnGetInplaceEditorRect != null) this.FOnGetInplaceEditorRect(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AInplaceEditor,AInplaceEditorRect);
    };
    this.DoGetInplaceEditorTarget = function (ACell, AInplaceEditorTarget) {
      var cl = null;
      cl = this.GetColumn(ACell.GetColumn());
      if ((cl != null) && ($mod.TTMSFNCDataGridColumnSetting.gcsEditor in cl.FSettings)) {
        AInplaceEditorTarget.set(cl.FEditorTarget)}
       else AInplaceEditorTarget.set($mod.TTMSFNCDataGridInplaceEditorTarget.getCellValue);
      if (this.FOnGetInplaceEditorTarget != null) this.FOnGetInplaceEditorTarget(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AInplaceEditorTarget);
    };
    this.DoGetInplaceEditorType = function (ACell, AInplaceEditorType) {
      var cl = null;
      cl = this.GetColumn(ACell.GetColumn());
      if ((cl != null) && ($mod.TTMSFNCDataGridColumnSetting.gcsEditor in cl.FSettings)) {
        AInplaceEditorType.set(cl.FEditor)}
       else AInplaceEditorType.set($mod.TTMSFNCDataGridInplaceEditorType.getEdit);
      if ((this.FAdapter != null) && $mod.TTMSFNCDataGridRendererDataAdapter.isPrototypeOf(this.FAdapter)) rtl.as(this.FAdapter,$mod.TTMSFNCDataGridRendererDataAdapter).GetInplaceEditorType(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AInplaceEditorType);
      if (this.FOnGetInplaceEditorType != null) this.FOnGetInplaceEditorType(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AInplaceEditorType);
    };
    this.DoGetSortOptions = function (AColumn, ALevel, AOptions) {
      var cl = null;
      cl = this.GetColumn(AColumn);
      if ((cl != null) && ($mod.TTMSFNCDataGridColumnSetting.gcsFormatting in cl.FSettings)) AOptions.FormatSettings.$assign(cl.FFormatting.FConvertSettings);
      pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridData.DoGetSortOptions.apply(this,arguments);
    };
    this.DoHScroll = function (APosition) {
      if (this.FOnHScroll != null) this.FOnHScroll(this,APosition);
    };
    this.DoInsertColumn = function (AColumn) {
      if (this.FOnInsertColumn != null) this.FOnInsertColumn(this,AColumn);
    };
    this.DoInsertRow = function (ARow) {
      if ((this.FAdapter != null) && $mod.TTMSFNCDataGridRendererDataAdapter.isPrototypeOf(this.FAdapter)) rtl.as(this.FAdapter,$mod.TTMSFNCDataGridRendererDataAdapter).InsertRow(ARow);
      if (this.FOnInsertRow != null) this.FOnInsertRow(this,ARow);
    };
    this.DoLookupTimer = function (Sender) {
      this.FLookupString = "";
      this.GetLookupTimer().SetEnabled(false);
    };
    this.DoNeedFilterDropDownData = function (AColumn, AValues) {
      if (this.FOnNeedFilterDropDownData != null) this.FOnNeedFilterDropDownData(this,AColumn,AValues);
    };
    this.DoPaintCommentPopup = function (Sender, AGraphics, ARect) {
      var c = null;
      var cl = null;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if ($mod.TTMSFNCCommentPopup.isPrototypeOf(Sender)) {
        c = rtl.as(Sender,$mod.TTMSFNCCommentPopup);
        cl = c.FCell;
        if (cl != null) {
          r.$assign(ARect);
          pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,-4,-4);
          AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),cl.FComment,true,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,true,false,-1,-1);
        };
      };
    };
    this.DoRemoveFilter = function (AColumn) {
      if (this.FOnRemoveFilter != null) this.FOnRemoveFilter(this,AColumn);
    };
    this.DoRemoveAdvancedFilter = function () {
      if (this.FOnRemoveAdvancedFilter != null) this.FOnRemoveAdvancedFilter(this);
    };
    this.DoReplace = function (Sender, AFindText, AReplaceText) {
      var c = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var ov = "";
      var nv = "";
      c.$assign(this.GetFocusedCell());
      if ((c.GetColumn() !== -1) && (c.GetRow() !== -1)) {
        ov = this.GetString(c.GetColumn(),c.GetRow());
        nv = pas.SysUtils.StringReplace(ov,AFindText,AReplaceText,rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll,pas.SysUtils.TStringReplaceFlag.rfIgnoreCase));
        this.SetCell(c.GetColumn(),c.GetRow(),nv);
      };
    };
    this.DoReplaceAll = function (Sender, AFindText, AReplaceText) {
      var p = {};
      var r = null;
      var cnt = 0;
      var b = false;
      if (pas["WEBLib.TMSFNCReplaceDialog"].TTMSFNCReplaceDialog.isPrototypeOf(Sender)) {
        r = rtl.as(Sender,pas["WEBLib.TMSFNCReplaceDialog"].TTMSFNCReplaceDialog);
        p = rtl.refSet($impl.ReplaceOptionsToParameters(rtl.refSet(r.FOptions)));
        b = true;
        this.DoBeforeDialogReplace(AFindText,AReplaceText,{get: function () {
            return p;
          }, set: function (v) {
            p = v;
          }},{get: function () {
            return b;
          }, set: function (v) {
            b = v;
          }});
        if (b) {
          cnt = this.Replace$1(AFindText,AReplaceText,rtl.refSet(p));
          this.DoAfterDialogReplace(AFindText,AReplaceText,cnt);
        };
      };
    };
    this.DoReplaceFind = function (Sender, AReplaceText) {
      var p = {};
      var r = null;
      var c = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var b = false;
      if (pas["WEBLib.TMSFNCReplaceDialog"].TTMSFNCReplaceDialog.isPrototypeOf(Sender)) {
        r = rtl.as(Sender,pas["WEBLib.TMSFNCReplaceDialog"].TTMSFNCReplaceDialog);
        p = rtl.refSet($impl.ReplaceOptionsToParameters(rtl.refSet(r.FOptions)));
        b = true;
        this.DoBeforeDialogFind(AReplaceText,{get: function () {
            return p;
          }, set: function (v) {
            p = v;
          }},{get: function () {
            return b;
          }, set: function (v) {
            b = v;
          }});
        if (b) {
          c.$assign(this.Find$1(AReplaceText,rtl.refSet(p)));
          this.DoAfterDialogFind(AReplaceText,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c),this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c)));
        };
      };
    };
    this.DoReplaceFindNext = function (Sender, AFindText) {
      var p = {};
      var f = null;
      var c = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var b = false;
      if (pas["WEBLib.TMSFNCReplaceDialog"].TTMSFNCReplaceDialog.isPrototypeOf(Sender)) {
        f = rtl.as(Sender,pas["WEBLib.TMSFNCReplaceDialog"].TTMSFNCReplaceDialog);
        p = rtl.refSet($impl.ReplaceOptionsToParameters(rtl.refSet(f.FOptions)));
        if (!(pas["WEBLib.TMSFNCReplaceDialog"].TTMSFNCReplaceDialogOption.rdoDown in f.FOptions)) p = rtl.unionSet(p,rtl.createSet(pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFindParameter.gfnBackward));
        b = true;
        this.DoBeforeDialogFind(AFindText,{get: function () {
            return p;
          }, set: function (v) {
            p = v;
          }},{get: function () {
            return b;
          }, set: function (v) {
            b = v;
          }});
        if (b) {
          c.$assign(this.Find$2(AFindText,rtl.refSet(p),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.GetFocusedCell())));
          this.DoAfterDialogFind(AFindText,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c),this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c)));
        };
      };
    };
    this.DoRowDropped = function (AFromRow, AToRow) {
      if (this.FOnRowDropped != null) this.FOnRowDropped(this,AFromRow,AToRow);
    };
    this.DoRowSized = function (ARow, ASize) {
      if (this.FOnRowSized != null) this.FOnRowSized(this,ARow,ASize);
    };
    this.DoScrollTimer = function (Sender) {
      var c = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var currentCell = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var contentr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var fillDirection = 0;
      if (!this.GetOptions().FMouse.FAutoScrolling) {
        this.GetScrollTimer().SetEnabled(false);
        return;
      };
      contentr.$assign(this.GetContentRect());
      if (this.FAutoFillState === $mod.TTMSFNCDataGridAutoFillState.gafsDragging) {
        currentCell.$assign(this.XYToCell(this.FX,this.FY,false));
        if ((currentCell.GetColumn() === -1) || (currentCell.GetRow() === -1)) currentCell.$assign(this.FAutoFillEnd);
        c.$assign(currentCell);
        if (this.FX >= (contentr.Right - contentr.Left - this.GetTotalFixedRightColumnWidth())) {
          if (this.GetOptions().FMouse.FAutoScrollingSpeedMode === $mod.TTMSFNCDataGridAutoScrollingSpeedMode.gasmPixels) {
            c.SetColumn(c.GetColumn() + (Math.round(this.FX - (contentr.Right - contentr.Left - this.GetTotalFixedRightColumnWidth())) * this.GetOptions().FMouse.FAutoScrollingSpeed))}
           else c.SetColumn(c.GetColumn() + this.GetOptions().FMouse.FAutoScrollingSpeed);
          c.SetColumn(Math.min(c.GetColumn(),this.FColumnCount - 1 - this.FFixedRightColumnCount));
          currentCell.SetColumn(c.GetColumn());
          this.Navigate(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c),false,false,true);
        } else if (this.FX <= this.GetTotalFixedColumnWidth(true)) {
          if (this.GetOptions().FMouse.FAutoScrollingSpeedMode === $mod.TTMSFNCDataGridAutoScrollingSpeedMode.gasmPixels) {
            c.SetColumn(c.GetColumn() + (Math.round(this.FX - this.GetTotalFixedColumnWidth(true)) * this.GetOptions().FMouse.FAutoScrollingSpeed))}
           else c.SetColumn(c.GetColumn() - this.GetOptions().FMouse.FAutoScrollingSpeed);
          c.SetColumn(Math.max(c.GetColumn(),this.FFixedColumnCount));
          currentCell.SetColumn(c.GetColumn());
          this.Navigate(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c),false,false,true);
        };
        if (this.FY >= (contentr.Bottom - contentr.Top - this.GetTotalFixedBottomRowHeight())) {
          if (this.GetOptions().FMouse.FAutoScrollingSpeedMode === $mod.TTMSFNCDataGridAutoScrollingSpeedMode.gasmPixels) {
            c.SetRow(c.GetRow() + (Math.round(this.FY - (contentr.Bottom - contentr.Top - this.GetTotalFixedBottomRowHeight())) * this.GetOptions().FMouse.FAutoScrollingSpeed))}
           else c.SetRow(c.GetRow() + this.GetOptions().FMouse.FAutoScrollingSpeed);
          c.SetRow(Math.min(c.GetRow(),this.FRowCount - 1 - this.FFixedBottomRowCount));
          currentCell.SetRow(c.GetRow());
          this.Navigate(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c),false,true,false);
        } else if (this.FY <= this.GetTotalFixedRowHeight(true)) {
          if (this.GetOptions().FMouse.FAutoScrollingSpeedMode === $mod.TTMSFNCDataGridAutoScrollingSpeedMode.gasmPixels) {
            c.SetRow(c.GetRow() + (Math.round(this.FY - this.GetTotalFixedRowHeight(true)) * this.GetOptions().FMouse.FAutoScrollingSpeed))}
           else c.SetRow(c.GetRow() - this.GetOptions().FMouse.FAutoScrollingSpeed);
          c.SetRow(Math.max(c.GetRow(),this.FFixedRowCount));
          currentCell.SetRow(c.GetRow());
          this.Navigate(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c),false,true,false);
        };
        if ((currentCell.GetColumn() !== -1) && (currentCell.GetRow() !== -1)) {
          fillDirection = this.GetAutoFillDirection(currentCell,this.FAutoFillOriginalSelection);
          this.CalculateAutoFillRange(currentCell,fillDirection,this.FAutoFillStart,this.FAutoFillEnd);
          this.FAutoFillPreviewRect.$assign(this.CellRangeToRect(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FAutoFillStart),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FAutoFillEnd)));
          this.Display();
        };
        return;
      };
      if (this.FX >= (contentr.Right - contentr.Left - this.GetTotalFixedRightColumnWidth())) {
        c.$assign(this.GetFocusedCell());
        if (this.GetOptions().FMouse.FAutoScrollingSpeedMode === $mod.TTMSFNCDataGridAutoScrollingSpeedMode.gasmPixels) {
          c.SetColumn(c.GetColumn() + (Math.round(this.FX - (contentr.Right - contentr.Left - this.GetTotalFixedRightColumnWidth())) * this.GetOptions().FMouse.FAutoScrollingSpeed))}
         else c.SetColumn(c.GetColumn() + this.GetOptions().FMouse.FAutoScrollingSpeed);
        this.SetFocusCell(c.GetColumn(),c.GetRow());
        this.SelectCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.GetFocusedCell()),{},this.FMouseDragging,false,false);
      } else if (this.FX <= this.GetTotalFixedColumnWidth(true)) {
        c.$assign(this.GetFocusedCell());
        if (this.GetOptions().FMouse.FAutoScrollingSpeedMode === $mod.TTMSFNCDataGridAutoScrollingSpeedMode.gasmPixels) {
          c.SetColumn(c.GetColumn() + (Math.round(this.FX - this.GetTotalFixedColumnWidth(true)) * this.GetOptions().FMouse.FAutoScrollingSpeed))}
         else c.SetColumn(c.GetColumn() - this.GetOptions().FMouse.FAutoScrollingSpeed);
        this.SetFocusCell(c.GetColumn(),c.GetRow());
        this.SelectCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.GetFocusedCell()),{},this.FMouseDragging,false,false);
      };
      if (this.FY >= (contentr.Bottom - contentr.Top - this.GetTotalFixedBottomRowHeight())) {
        c.$assign(this.GetFocusedCell());
        if (this.GetOptions().FMouse.FAutoScrollingSpeedMode === $mod.TTMSFNCDataGridAutoScrollingSpeedMode.gasmPixels) {
          c.SetRow(c.GetRow() + (Math.round(this.FY - (contentr.Bottom - contentr.Top - this.GetTotalFixedBottomRowHeight())) * this.GetOptions().FMouse.FAutoScrollingSpeed))}
         else c.SetRow(c.GetRow() + this.GetOptions().FMouse.FAutoScrollingSpeed);
        this.SetFocusCell(c.GetColumn(),c.GetRow());
        this.SelectCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.GetFocusedCell()),{},this.FMouseDragging,false,false);
      } else if (this.FY <= this.GetTotalFixedRowHeight(true)) {
        c.$assign(this.GetFocusedCell());
        if (this.GetOptions().FMouse.FAutoScrollingSpeedMode === $mod.TTMSFNCDataGridAutoScrollingSpeedMode.gasmPixels) {
          c.SetRow(c.GetRow() + (Math.round(this.FY - this.GetTotalFixedRowHeight(true)) * this.GetOptions().FMouse.FAutoScrollingSpeed))}
         else c.SetRow(c.GetRow() - this.GetOptions().FMouse.FAutoScrollingSpeed);
        this.SetFocusCell(c.GetColumn(),c.GetRow());
        this.SelectCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.GetFocusedCell()),{},this.FMouseDragging,false,false);
      };
    };
    this.DoSelectCell = function (AStartCell, AEndCell, AFocusedCell) {
      if (this.FOnSelectCell != null) this.FOnSelectCell(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(AStartCell),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(AEndCell),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(AFocusedCell));
    };
    this.DoSelectingCell = function (AStartCell, AEndCell, AFocusedCell, ACanSelect) {
      if (this.FOnSelectingCell != null) this.FOnSelectingCell(this,pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(AStartCell),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(AEndCell),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(AFocusedCell),ACanSelect);
    };
    this.DoSizeColumn = function (AColumn, ASize) {
      if (this.FOnSizeColumn != null) this.FOnSizeColumn(this,AColumn,ASize);
    };
    this.DoSizeRow = function (ARow, ASize) {
      if (this.FOnSizeRow != null) this.FOnSizeRow(this,ARow,ASize);
    };
    this.DoUpdateCursorGrid = function (Sender, ACursor) {
      if (this.FOnUpdateCursor != null) this.FOnUpdateCursor(Sender,ACursor);
    };
    this.DoVScroll = function (APosition) {
      if (this.FOnVScroll != null) this.FOnVScroll(this,APosition);
    };
    this.DrawCell = function (AGraphics, ACache) {
      var e = false;
      e = this.IsEditing() && (this.FEditingCell.GetColumn() === ACache.FColumn) && (this.FEditingCell.GetRow() === ACache.FRow);
      ACache.FDrawElements = rtl.refSet(ACache.GetDrawElements(e));
      ACache.Draw(AGraphics);
    };
    this.DrawDisplay = function (AGraphics, ADisplay) {
      var I = 0;
      var cache = null;
      if (ADisplay.FLength === 0) return;
      for (var $l = 0, $end = ADisplay.FLength - 1; $l <= $end; $l++) {
        I = $l;
        cache = ADisplay.GetItem(I);
        if (this.IsCellDisplayList(ADisplay)) this.DrawCell(AGraphics,cache);
      };
    };
    this.DrawDragging = function (AGraphics) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var pth = null;
      var sz = 0.0;
      var cl = null;
      if (this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FDragCellTo))) {
        cl = this.GetCellObjectForCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FDragCellTo));
        if (!(cl != null)) return;
        sz = this.FDragAppearance.FSize;
        var $tmp = this.FDraggingMode;
        if ($tmp === $mod.TTMSFNCDataGridDraggingMode.gdmRowDragging) {
          r.$assign(cl.FRect);
          if (this.FDraggingType === $mod.TTMSFNCDataGridDraggingType.gdtSwap) {
            r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Right,(r.Top + ((r.Bottom - r.Top) / 2)) - (sz / 2),r.Right + sz,r.Top + ((r.Bottom - r.Top) / 2) + (sz / 2)))}
           else r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Right,r.Bottom - (sz / 2),r.Right + sz,r.Bottom + (sz / 2)));
          AGraphics.FFill.Assign(this.FDragAppearance.FFill);
          AGraphics.FStroke.Assign(this.FDragAppearance.FStroke);
          pth = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPath.$create("Create$1");
          try {
            pth.MoveTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Top + ((r.Bottom - r.Top) / 2)));
            pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Top));
            pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Bottom));
            pth.ClosePath();
            AGraphics.DrawPath(pth,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPathDrawMode.pdmPolygon);
          } finally {
            pth = rtl.freeLoc(pth);
          };
        } else if ($tmp === $mod.TTMSFNCDataGridDraggingMode.gdmColumnDragging) {
          r.$assign(cl.FRect);
          if (this.FDraggingType === $mod.TTMSFNCDataGridDraggingType.gdtSwap) {
            r.$assign(pas["WEBLib.TMSFNCTypes"].RectF((r.Left + ((r.Right - r.Left) / 2)) - (sz / 2),r.Bottom,r.Left + ((r.Right - r.Left) / 2) + (sz / 2),r.Bottom + sz))}
           else r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Right - (sz / 2),r.Bottom,r.Right + (sz / 2),r.Bottom + sz));
          AGraphics.FFill.Assign(this.FDragAppearance.FFill);
          AGraphics.FStroke.Assign(this.FDragAppearance.FStroke);
          pth = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPath.$create("Create$1");
          try {
            pth.MoveTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left + ((r.Right - r.Left) / 2),r.Top));
            pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Bottom));
            pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Bottom));
            pth.ClosePath();
            AGraphics.DrawPath(pth,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPathDrawMode.pdmPolygon);
          } finally {
            pth = rtl.freeLoc(pth);
          };
        };
      };
    };
    this.DrawAutoFillPreview = function (AGraphics) {
      if ((this.FAutoFillState === $mod.TTMSFNCDataGridAutoFillState.gafsDragging) && !pas["WEBLib.TMSFNCTypes"].RectIsEmpty(this.FAutoFillPreviewRect)) {
        AGraphics.FFill.Assign(this.FAutoFillAppearance.FPreviewFill);
        AGraphics.FStroke.Assign(this.FAutoFillAppearance.FPreviewStroke);
        AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.FAutoFillPreviewRect),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
      };
    };
    this.DrawAutoFillHandle = function (AGraphics) {
      var handleRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (!this.CanAutoFill()) return;
      handleRect.$assign(this.GetAutoFillHandleRect());
      if (pas["WEBLib.TMSFNCTypes"].RectIsEmpty(handleRect)) return;
      AGraphics.FFill.Assign(this.FAutoFillAppearance.FHandleFill);
      AGraphics.FStroke.Assign(this.FAutoFillAppearance.FHandleStroke);
      AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(handleRect),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
    };
    this.DrawEmptySpaces = function (AGraphics) {
      var lr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var fr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var vs = null;
      var hs = null;
      var vsc = null;
      var hsc = null;
      var vsb = false;
      var hsb = false;
      var a = false;
      if (!this.FStretchScrollBars) {
        lr.$assign(this.GetContentClipRect());
        fr.$assign(this.GetFullRect());
        AGraphics.FFill.Assign(this.FCellAppearance.FFixedLayout.FFill);
        AGraphics.FStroke.Assign(this.FStroke);
        vsc = this.GetCustomVerticalScrollBar();
        hsc = this.GetCustomHorizontalScrollBar();
        vs = this.GetVerticalScrollBar();
        hs = this.GetHorizontalScrollBar();
        if (this.HasCustomScrollBars()) {
          vsb = (vsc != null) && vsc.FVisible}
         else vsb = (vs != null) && vs.FVisible;
        if (this.HasCustomScrollBars()) {
          hsb = (hsc != null) && hsc.FVisible}
         else hsb = (hs != null) && hs.FVisible;
        if (vsb) {
          r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.System.Int(lr.Right - 1) + 0.5,pas.System.Int(fr.Top) + 0.5,pas.System.Int(fr.Right + 1) + 0.5,pas.System.Int(fr.Top + 1) + 0.5 + this.FTotalFixedRowHeight));
          if (((r.Right - r.Left) > 0) && ((r.Bottom - r.Top) > 0)) {
            a = true;
            this.DoBeforeDrawEmptySpace(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),$mod.TTMSFNCDataGridEmptySpaceKind.gekColumnTop,{get: function () {
                return a;
              }, set: function (v) {
                a = v;
              }});
            if (a) {
              AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
              this.DoAfterDrawEmptySpace(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),$mod.TTMSFNCDataGridEmptySpaceKind.gekColumnTop);
            };
          };
          r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.System.Int(lr.Right - 1) + 0.5,(pas.System.Int(lr.Bottom) + 0.5) - this.FTotalFixedBottomRowHeight,pas.System.Int(fr.Right + 1) + 0.5,pas.System.Int(lr.Bottom) + 0.5));
          if (((r.Right - r.Left) > 0) && ((r.Bottom - r.Top) > 0)) {
            a = true;
            this.DoBeforeDrawEmptySpace(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),$mod.TTMSFNCDataGridEmptySpaceKind.gekColumnBottom,{get: function () {
                return a;
              }, set: function (v) {
                a = v;
              }});
            if (a) {
              AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
              this.DoAfterDrawEmptySpace(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),$mod.TTMSFNCDataGridEmptySpaceKind.gekColumnBottom);
            };
          };
        };
        if (hsb) {
          r.$assign(pas["WEBLib.TMSFNCTypes"].RectF((pas.System.Int(lr.Right) + 0.5) - this.FTotalFixedRightColumnWidth,pas.System.Int(lr.Bottom - 1) + 0.5,pas.System.Int(lr.Right) + 0.5,pas.System.Int(fr.Bottom + 1) + 0.5));
          if (((r.Right - r.Left) > 0) && ((r.Bottom - r.Top) > 0)) {
            a = true;
            this.DoBeforeDrawEmptySpace(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),$mod.TTMSFNCDataGridEmptySpaceKind.gekRowRight,{get: function () {
                return a;
              }, set: function (v) {
                a = v;
              }});
            if (a) {
              AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
              this.DoAfterDrawEmptySpace(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),$mod.TTMSFNCDataGridEmptySpaceKind.gekRowRight);
            };
          };
          r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.System.Int(fr.Left) + 0.5,pas.System.Int(lr.Bottom - 1) + 0.5,pas.System.Int(lr.Left + 1) + 0.5 + this.FTotalFixedColumnWidth,pas.System.Int(fr.Bottom + 1) + 0.5));
          if (((r.Right - r.Left) > 0) && ((r.Bottom - r.Top) > 0)) {
            a = true;
            this.DoBeforeDrawEmptySpace(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),$mod.TTMSFNCDataGridEmptySpaceKind.gekRowLeft,{get: function () {
                return a;
              }, set: function (v) {
                a = v;
              }});
            if (a) {
              AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
              this.DoAfterDrawEmptySpace(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),$mod.TTMSFNCDataGridEmptySpaceKind.gekRowLeft);
            };
          };
        };
        if (hsb && vsb) {
          r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.System.Int(lr.Right - 1) + 0.5,pas.System.Int(lr.Bottom - 1) + 0.5,pas.System.Int(fr.Right + 1) + 0.5,pas.System.Int(fr.Bottom + 1) + 0.5));
          if (((r.Right - r.Left) > 0) && ((r.Bottom - r.Top) > 0)) {
            a = true;
            this.DoBeforeDrawEmptySpace(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),$mod.TTMSFNCDataGridEmptySpaceKind.gekColumnBottomRowRight,{get: function () {
                return a;
              }, set: function (v) {
                a = v;
              }});
            if (a) {
              AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
              this.DoAfterDrawEmptySpace(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),$mod.TTMSFNCDataGridEmptySpaceKind.gekColumnBottomRowRight);
            };
          };
        };
      };
    };
    this.DrawScrollBars = function (AGraphics) {
      if (this.HasCustomScrollBars() && !this.HasValidHost() && (this.FCustomVerticalScrollBar != null) && (this.FCustomHorizontalScrollBar != null)) {
        if (this.FCustomVerticalScrollBar.FVisible) this.FCustomVerticalScrollBar.DrawEx(AGraphics);
        if (this.FCustomHorizontalScrollBar.FVisible) this.FCustomHorizontalScrollBar.DrawEx(AGraphics);
      };
    };
    this.HandleTwoSidedColumnResize = function (AColumn, ARow, AX, ASizeX, AMouseInfo) {
      var c = 0;
      var cl = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var Delta = 0.0;
      var MinW = 0.0;
      var LeftW = 0.0;
      var NewLeftW = 0.0;
      var RightW = 0.0;
      var NewRightW = 0.0;
      var Allow = false;
      var AllowLeft = false;
      var AllowRight = false;
      var RightColumns = [];
      var CountRight = 0;
      var rc = 0;
      var TotalRight = 0.0;
      var TargetLeft = 0.0;
      var Scale = 0.0;
      var TargetRight = 0.0;
      var NewWidths = [];
      var Diff = 0.0;
      var IsLast = false;
      var LeftColumns = [];
      var NewLeftWidths = [];
      var CountLeft = 0;
      var TotalLeft = 0.0;
      this.IncUpdateCount();
      try {
        Delta = AX - ASizeX;
        LeftW = this.GetColumnWidth(AColumn);
        MinW = this.GetOptions().FMouse.FColumnSizeMargin;
        cl.$assign(this.NextVisibleColumn(AColumn,ARow));
        IsLast = !this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cl)) || (cl.GetColumn() <= AColumn);
        if (pas.Classes.TShiftState$a.ssShift in AMouseInfo.Shift) {
          NewLeftW = LeftW + Delta;
          if (NewLeftW < MinW) NewLeftW = MinW;
          Allow = true;
          this.DoCanSizeColumn(AColumn,{get: function () {
              return NewLeftW;
            }, set: function (v) {
              NewLeftW = v;
            }},{get: function () {
              return Allow;
            }, set: function (v) {
              Allow = v;
            }});
          if (!Allow) return;
          this.SetColumnWidth(AColumn,NewLeftW);
          this.DoSizeColumn(AColumn,NewLeftW);
          return;
        };
        CountRight = 0;
        RightColumns = rtl.arraySetLength(RightColumns,0,this.FColumnCount);
        for (var $l = AColumn + 1, $end = this.FColumnCount - this.FFixedRightColumnCount - 1; $l <= $end; $l++) {
          c = $l;
          if (!this.IsColumnHidden(c)) {
            RightColumns[CountRight] = c;
            CountRight += 1;
          };
        };
        if (CountRight === 0) IsLast = true;
        if (pas.Classes.TShiftState$a.ssCtrl in AMouseInfo.Shift) {
          NewLeftW = LeftW + Delta;
          if (NewLeftW < MinW) NewLeftW = MinW;
          Allow = true;
          this.DoCanSizeColumn(AColumn,{get: function () {
              return NewLeftW;
            }, set: function (v) {
              NewLeftW = v;
            }},{get: function () {
              return Allow;
            }, set: function (v) {
              Allow = v;
            }});
          if (!Allow) return;
          if (!IsLast) {
            TotalRight = 0;
            for (var $l1 = 0, $end1 = CountRight - 1; $l1 <= $end1; $l1++) {
              rc = $l1;
              TotalRight = TotalRight + this.GetColumnWidth(RightColumns[rc]);
            };
            if (TotalRight > 0) {
              TargetRight = TotalRight - Delta;
              if (TargetRight < (CountRight * MinW)) TargetRight = CountRight * MinW;
              Scale = TargetRight / TotalRight;
              NewWidths = rtl.arraySetLength(NewWidths,0.0,CountRight);
              for (var $l2 = 0, $end2 = CountRight - 1; $l2 <= $end2; $l2++) {
                rc = $l2;
                c = RightColumns[rc];
                NewWidths[rc] = this.GetColumnWidth(c) * Scale;
                if (NewWidths[rc] < MinW) NewWidths[rc] = MinW;
                Allow = true;
                this.DoCanSizeColumn(c,{a: rc, p: NewWidths, get: function () {
                    return this.p[this.a];
                  }, set: function (v) {
                    this.p[this.a] = v;
                  }},{get: function () {
                    return Allow;
                  }, set: function (v) {
                    Allow = v;
                  }});
                if (!Allow) return;
              };
              this.SetColumnWidth(AColumn,NewLeftW);
              this.DoSizeColumn(AColumn,NewLeftW);
              for (var $l3 = 0, $end3 = CountRight - 1; $l3 <= $end3; $l3++) {
                rc = $l3;
                c = RightColumns[rc];
                this.SetColumnWidth(c,NewWidths[rc]);
                this.DoSizeColumn(c,NewWidths[rc]);
              };
              return;
            };
          } else {
            CountLeft = 0;
            TotalLeft = 0;
            LeftColumns = rtl.arraySetLength(LeftColumns,0,this.FColumnCount);
            for (var $l4 = this.FFixedColumnCount, $end4 = AColumn - 1; $l4 <= $end4; $l4++) {
              c = $l4;
              if (!this.IsColumnHidden(c)) {
                LeftColumns[CountLeft] = c;
                CountLeft += 1;
              };
            };
            for (var $l5 = 0, $end5 = CountLeft - 1; $l5 <= $end5; $l5++) {
              rc = $l5;
              TotalLeft = TotalLeft + this.GetColumnWidth(LeftColumns[rc]);
            };
            if (TotalLeft > 0) {
              TargetLeft = TotalLeft + Delta;
              if (TargetLeft < (CountLeft * MinW)) TargetLeft = CountLeft * MinW;
              Scale = TargetLeft / TotalLeft;
              NewLeftWidths = rtl.arraySetLength(NewLeftWidths,0.0,CountLeft);
              for (var $l6 = 0, $end6 = CountLeft - 1; $l6 <= $end6; $l6++) {
                rc = $l6;
                c = LeftColumns[rc];
                NewLeftWidths[rc] = this.GetColumnWidth(c) * Scale;
                if (NewLeftWidths[rc] < MinW) NewLeftWidths[rc] = MinW;
                Allow = true;
                this.DoCanSizeColumn(c,{a: rc, p: NewLeftWidths, get: function () {
                    return this.p[this.a];
                  }, set: function (v) {
                    this.p[this.a] = v;
                  }},{get: function () {
                    return Allow;
                  }, set: function (v) {
                    Allow = v;
                  }});
                if (!Allow) return;
              };
              this.SetColumnWidth(AColumn,NewLeftW);
              this.DoSizeColumn(AColumn,NewLeftW);
              for (var $l7 = 0, $end7 = CountLeft - 1; $l7 <= $end7; $l7++) {
                rc = $l7;
                c = LeftColumns[rc];
                this.SetColumnWidth(c,NewLeftWidths[rc]);
                this.DoSizeColumn(c,NewLeftWidths[rc]);
              };
              return;
            };
          };
          return;
        };
        if (IsLast) {
          NewLeftW = LeftW + Delta;
          if (NewLeftW < MinW) NewLeftW = MinW;
          Allow = true;
          this.DoCanSizeColumn(AColumn,{get: function () {
              return NewLeftW;
            }, set: function (v) {
              NewLeftW = v;
            }},{get: function () {
              return Allow;
            }, set: function (v) {
              Allow = v;
            }});
          if (!Allow) return;
          this.SetColumnWidth(AColumn,NewLeftW);
          this.DoSizeColumn(AColumn,NewLeftW);
          return;
        };
        c = cl.GetColumn();
        RightW = this.GetColumnWidth(c);
        NewLeftW = LeftW + Delta;
        NewRightW = RightW - Delta;
        if (NewLeftW < MinW) {
          Diff = MinW - NewLeftW;
          NewLeftW = MinW;
          NewRightW = NewRightW - Diff;
        };
        if (NewRightW < MinW) {
          Diff = MinW - NewRightW;
          NewRightW = MinW;
          NewLeftW = NewLeftW - Diff;
        };
        AllowLeft = true;
        this.DoCanSizeColumn(AColumn,{get: function () {
            return NewLeftW;
          }, set: function (v) {
            NewLeftW = v;
          }},{get: function () {
            return AllowLeft;
          }, set: function (v) {
            AllowLeft = v;
          }});
        AllowRight = true;
        this.DoCanSizeColumn(c,{get: function () {
            return NewRightW;
          }, set: function (v) {
            NewRightW = v;
          }},{get: function () {
            return AllowRight;
          }, set: function (v) {
            AllowRight = v;
          }});
        if (!(AllowLeft && AllowRight)) return;
        this.SetColumnWidth(AColumn,NewLeftW);
        this.SetColumnWidth(c,NewRightW);
        this.DoSizeColumn(AColumn,NewLeftW);
        this.DoSizeColumn(c,NewRightW);
      } finally {
        this.DecUpdateCount();
      };
    };
    this.HandleTwoSidedRowResize = function (AColumn, ARow, AY, ASizeY, AMouseInfo) {
      var r = 0;
      var rl = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var Delta = 0.0;
      var MinH = 0.0;
      var TopH = 0.0;
      var NewTopH = 0.0;
      var BottomH = 0.0;
      var NewBottomH = 0.0;
      var Allow = false;
      var AllowTop = false;
      var AllowBottom = false;
      var BottomRows = [];
      var CountBottom = 0;
      var rc = 0;
      var TotalBottom = 0.0;
      var Scale = 0.0;
      var TargetBottom = 0.0;
      var NewHeights = [];
      var IsLast = false;
      var TopRows = [];
      var CountTop = 0;
      var TotalTop = 0.0;
      var TargetTop = 0.0;
      var Diff = 0.0;
      var NewTopWidths = [];
      this.IncUpdateCount();
      try {
        Delta = AY - ASizeY;
        TopH = this.GetRowHeight(ARow);
        MinH = this.GetOptions().FMouse.FRowSizeMargin;
        rl.$assign(this.NextVisibleRow(AColumn,ARow));
        IsLast = !this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(rl)) || (rl.GetRow() <= ARow);
        if (pas.Classes.TShiftState$a.ssShift in AMouseInfo.Shift) {
          NewTopH = TopH + Delta;
          if (NewTopH < MinH) NewTopH = MinH;
          Allow = true;
          this.DoCanSizeRow(ARow,{get: function () {
              return NewTopH;
            }, set: function (v) {
              NewTopH = v;
            }},{get: function () {
              return Allow;
            }, set: function (v) {
              Allow = v;
            }});
          if (!Allow) return;
          this.SetRowHeight(ARow,NewTopH);
          this.DoSizeRow(ARow,NewTopH);
          return;
        };
        CountBottom = 0;
        BottomRows = rtl.arraySetLength(BottomRows,0,this.FRowCount);
        for (var $l = ARow + 1, $end = this.FRowCount - this.FFixedBottomRowCount - 1; $l <= $end; $l++) {
          r = $l;
          if (!this.IsRowHidden(r)) {
            BottomRows[CountBottom] = r;
            CountBottom += 1;
          };
        };
        if (CountBottom === 0) IsLast = true;
        if (pas.Classes.TShiftState$a.ssCtrl in AMouseInfo.Shift) {
          NewTopH = TopH + Delta;
          if (NewTopH < MinH) NewTopH = MinH;
          Allow = true;
          this.DoCanSizeRow(ARow,{get: function () {
              return NewTopH;
            }, set: function (v) {
              NewTopH = v;
            }},{get: function () {
              return Allow;
            }, set: function (v) {
              Allow = v;
            }});
          if (!Allow) return;
          if (!IsLast) {
            TotalBottom = 0;
            for (var $l1 = 0, $end1 = CountBottom - 1; $l1 <= $end1; $l1++) {
              rc = $l1;
              TotalBottom = TotalBottom + this.GetRowHeight(BottomRows[rc]);
            };
            if (TotalBottom > 0) {
              TargetBottom = TotalBottom - Delta;
              if (TargetBottom < (CountBottom * MinH)) TargetBottom = CountBottom * MinH;
              Scale = TargetBottom / TotalBottom;
              NewHeights = rtl.arraySetLength(NewHeights,0.0,CountBottom);
              for (var $l2 = 0, $end2 = CountBottom - 1; $l2 <= $end2; $l2++) {
                rc = $l2;
                BottomH = this.GetRowHeight(BottomRows[rc]) * Scale;
                if (BottomH < MinH) BottomH = MinH;
                Allow = true;
                this.DoCanSizeRow(BottomRows[rc],{get: function () {
                    return BottomH;
                  }, set: function (v) {
                    BottomH = v;
                  }},{get: function () {
                    return Allow;
                  }, set: function (v) {
                    Allow = v;
                  }});
                if (!Allow) return;
                NewHeights[rc] = BottomH;
              };
              this.SetRowHeight(ARow,NewTopH);
              this.DoSizeRow(ARow,NewTopH);
              for (var $l3 = 0, $end3 = CountBottom - 1; $l3 <= $end3; $l3++) {
                rc = $l3;
                r = BottomRows[rc];
                this.SetRowHeight(r,NewHeights[rc]);
                this.DoSizeRow(r,NewHeights[rc]);
              };
              return;
            };
          } else {
            CountTop = 0;
            TopRows = rtl.arraySetLength(TopRows,0,this.FRowCount);
            TotalTop = 0;
            for (var $l4 = this.FFixedRowCount, $end4 = ARow - 1; $l4 <= $end4; $l4++) {
              r = $l4;
              if (!this.IsRowHidden(r)) {
                TopRows[CountTop] = r;
                CountTop += 1;
                TotalTop = TotalTop + this.GetRowHeight(r);
              };
            };
            if (TotalTop > 0) {
              TargetTop = TotalTop + Delta;
              if (TargetTop < (CountTop * MinH)) TargetTop = CountTop * MinH;
              Scale = TargetTop / TotalTop;
              NewTopWidths = rtl.arraySetLength(NewTopWidths,0.0,CountTop);
              for (var $l5 = 0, $end5 = CountTop - 1; $l5 <= $end5; $l5++) {
                rc = $l5;
                r = TopRows[rc];
                NewTopH = this.GetRowHeight(r) * Scale;
                if (NewTopH < MinH) NewTopH = MinH;
                Allow = true;
                this.DoCanSizeRow(r,{get: function () {
                    return NewTopH;
                  }, set: function (v) {
                    NewTopH = v;
                  }},{get: function () {
                    return Allow;
                  }, set: function (v) {
                    Allow = v;
                  }});
                if (!Allow) return;
                NewTopWidths[rc] = NewTopH;
              };
              this.SetRowHeight(ARow,NewTopH);
              this.DoSizeRow(ARow,NewTopH);
              for (var $l6 = 0, $end6 = CountTop - 1; $l6 <= $end6; $l6++) {
                rc = $l6;
                r = TopRows[rc];
                this.SetRowHeight(r,NewTopWidths[rc]);
                this.DoSizeRow(r,NewTopWidths[rc]);
              };
              return;
            };
          };
          return;
        };
        if (IsLast) {
          NewTopH = TopH + Delta;
          if (NewTopH < MinH) NewTopH = MinH;
          Allow = true;
          this.DoCanSizeRow(ARow,{get: function () {
              return NewTopH;
            }, set: function (v) {
              NewTopH = v;
            }},{get: function () {
              return Allow;
            }, set: function (v) {
              Allow = v;
            }});
          if (!Allow) return;
          this.SetRowHeight(ARow,NewTopH);
          this.DoSizeRow(ARow,NewTopH);
          return;
        };
        r = rl.GetRow();
        BottomH = this.GetRowHeight(r);
        NewTopH = TopH + Delta;
        NewBottomH = BottomH - Delta;
        if (NewTopH < MinH) {
          Diff = MinH - NewTopH;
          NewTopH = MinH;
          NewBottomH = NewBottomH - Diff;
        };
        if (NewBottomH < MinH) {
          Diff = MinH - NewBottomH;
          NewBottomH = MinH;
          NewTopH = NewTopH - Diff;
        };
        AllowTop = true;
        this.DoCanSizeRow(ARow,{get: function () {
            return NewTopH;
          }, set: function (v) {
            NewTopH = v;
          }},{get: function () {
            return AllowTop;
          }, set: function (v) {
            AllowTop = v;
          }});
        AllowBottom = true;
        this.DoCanSizeRow(r,{get: function () {
            return NewBottomH;
          }, set: function (v) {
            NewBottomH = v;
          }},{get: function () {
            return AllowBottom;
          }, set: function (v) {
            AllowBottom = v;
          }});
        if (!(AllowTop && AllowBottom)) return;
        this.SetRowHeight(ARow,NewTopH);
        this.SetRowHeight(r,NewBottomH);
        this.DoSizeRow(ARow,NewTopH);
        this.DoSizeRow(r,NewBottomH);
      } finally {
        this.DecUpdateCount();
      };
    };
    this.HandleDragDrop = function (Source, Point) {
      var m = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseInfo.$new();
      var df = null;
      if (pas["WEBLib.TMSFNCCustomControl"].IsSourceDropFiles(Source)) {
        df = pas["WEBLib.TMSFNCCustomControl"].AsSourceDropFiles(Source);
        this.DoDropFiles(df);
      } else {
        m.$assign(pas["WEBLib.TMSFNCDataGridCell"].DefaultMouseInfo());
        m.Kind = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseKind.gmkDragDrop;
        m.X = Point.X;
        m.Y = Point.Y;
        this.HandleDragEnd(pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseInfo.$clone(m));
        this.ResetDrag();
        this.Display();
      };
    };
    this.HandleDragOver = function (Source, Point, Accept) {
      var m = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseInfo.$new();
      var rl = null;
      var r = null;
      try {
        m.$assign(pas["WEBLib.TMSFNCDataGridCell"].DefaultMouseInfo());
        m.Kind = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseKind.gmkDragOver;
        m.X = Point.X;
        m.Y = Point.Y;
        if (pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCCustomTreeView.isPrototypeOf(Source) && (rtl.as(Source,pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCCustomTreeView).FDragNode != null)) {
          Accept.set(rtl.as(Source,pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCCustomTreeView).FDragNode.FDataString === "columns_editor");
          this.FDraggingType = $mod.TTMSFNCDataGridDraggingType.gdtInsert;
          this.FDragCell.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(rtl.as(Source,pas["WEBLib.TMSFNCCustomTreeView"].TTMSFNCCustomTreeView).FDragNode.FDataInteger,0));
        } else if (pas["WEBLib.TMSFNCCustomControl"].IsSourceDropFiles(Source)) {
          Accept.set(true)}
         else {
          r = null;
          if (pas.SysUtils.Supports$3(Source,$mod.ITMSFNCDataGridRendererLink.$guid,{get: function () {
              return rl;
            }, set: function (v) {
              rl = v;
            }})) r = rl.GetLink();
          Accept.set(r === this);
          if (Accept.get()) this.FDraggingType = $mod.TTMSFNCDataGridDraggingType.gdtSwap;
        };
        if (Accept.get() && !pas["WEBLib.TMSFNCCustomControl"].IsSourceDropFiles(Source)) {
          if ((this.FDraggingMode === $mod.TTMSFNCDataGridDraggingMode.gdmNone) && (this.GetOptions().FMouse.FRowDragging || this.GetOptions().FMouse.FColumnDragging)) {
            this.StartDragging(pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseInfo.$clone(m),false);
          };
          if (this.FDraggingMode !== $mod.TTMSFNCDataGridDraggingMode.gdmNone) {
            this.HandleDragging(pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseInfo.$clone(m));
          };
        };
      } finally {
        rtl._Release(rl);
      };
    };
    this.HCustomScrollChanged = function (Sender, AValue) {
      if (this.FBlockScrollingUpdate || !this.HasCustomScrollBars()) return;
      if (!this.FIsMouseDown) this.StopAnimationTimer();
      this.HorizontalScrollPositionChanged();
      this.SetHScrollValue(this.GetHScrollValue());
    };
    this.HideDragCell = function () {
      if (this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FDragCell))) {
        var $tmp = this.FDraggingMode;
        if ($tmp === $mod.TTMSFNCDataGridDraggingMode.gdmRowDragging) {
          this.HideRow(this.FDragCell.GetRow())}
         else if ($tmp === $mod.TTMSFNCDataGridDraggingMode.gdmColumnDragging) this.HideColumn(this.FDragCell.GetColumn());
      };
    };
    this.HorizontalScrollPositionChanged = function () {
      this.FBlockScrollingUpdate = true;
      this.Update();
      this.FBlockScrollingUpdate = false;
      this.DoHScroll(this.GetHScrollValue());
    };
    this.HScrollChanged = function (Sender) {
      if (this.FBlockScrollingUpdate || this.HasCustomScrollBars()) return;
      if (!this.FIsMouseDown) this.StopAnimationTimer();
      this.HorizontalScrollPositionChanged();
      this.SetHScrollValue(this.GetHScrollValue());
    };
    this.VExternalScrollChanged = function (Sender) {
      if (this.FBlockScrollingUpdate || !this.HasExternalScrollBars()) return;
      if (!this.FIsMouseDown) this.StopAnimationTimer();
      this.VerticalScrollPositionChanged();
      if (this.FExternalVScrollChanged != null) this.FExternalVScrollChanged(Sender);
    };
    this.HExternalScrollChanged = function (Sender) {
      if (this.FBlockScrollingUpdate || !this.HasExternalScrollBars()) return;
      if (!this.FIsMouseDown) this.StopAnimationTimer();
      this.HorizontalScrollPositionChanged();
      if (this.FExternalHScrollChanged != null) this.FExternalHScrollChanged(Sender);
    };
    this.SetExternalVerticalScrollBar = function (Value) {
      if (this.FExternalVerticalScrollBar !== Value) {
        if (this.FExternalVerticalScrollBar != null) {
          this.FExternalVerticalScrollBar.SetOnChange(this.FExternalVScrollChanged);
          this.FExternalVScrollChanged = null;
        };
        rtl.setIntfP(this,"FExternalVerticalScrollBar",Value);
        if (this.FExternalVerticalScrollBar != null) {
          this.FExternalVScrollChanged = this.FExternalVerticalScrollBar.GetOnChange();
          this.FExternalVerticalScrollBar.SetOnChange(rtl.createCallback(this,"VExternalScrollChanged"));
        };
        this.UpdateScrollBars(true,true);
      };
    };
    this.SetExternalHorizontalScrollBar = function (Value) {
      if (this.FExternalHorizontalScrollBar !== Value) {
        if (this.FExternalHorizontalScrollBar != null) {
          this.FExternalHorizontalScrollBar.SetOnChange(this.FExternalHScrollChanged);
          this.FExternalHScrollChanged = null;
        };
        rtl.setIntfP(this,"FExternalHorizontalScrollBar",Value);
        if (this.FExternalHorizontalScrollBar != null) {
          this.FExternalHScrollChanged = this.FExternalHorizontalScrollBar.GetOnChange();
          this.FExternalHorizontalScrollBar.SetOnChange(rtl.createCallback(this,"HExternalScrollChanged"));
        };
        this.UpdateScrollBars(true,true);
      };
    };
    this.InternalAutoSizeColumn = function (AColumn, AMode, APadding, AGraphics) {
      var i = 0;
      var k = 0;
      var m = 0.0;
      var totalh = 0.0;
      var rs = 0;
      var c = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var cellr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var cls = null;
      var ck = 0;
      var ci = null;
      var bc = 0;
      var br = 0;
      var d = null;
      var sz = pas["WEBLib.TMSFNCTypes"].TSizeF.$new();
      var sr = 0;
      var er = 0;
      m = 0;
      if (AMode === $mod.TTMSFNCDataGridAutoSizeMode.gamVisibleCells) {
        sr = this.GetStartRow();
        er = this.GetStopRow();
      } else {
        sr = 0;
        er = this.FRowCount - 1;
      };
      for (var $l = sr, $end = er; $l <= $end; $l++) {
        i = $l;
        c.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,i));
        c.$assign(this.BaseCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c)));
        if (!((c.GetColumn() === AColumn) && (c.GetRow() === i))) continue;
        rs = this.RowSpan(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c));
        totalh = 0;
        if (rs > 0) {
          for (var $l1 = c.GetRow(), $end1 = (c.GetRow() + rs) - 1; $l1 <= $end1; $l1++) {
            k = $l1;
            totalh = totalh + this.GetRowHeight(k);
          };
        } else totalh = this.GetRowHeight(c.GetRow());
        bc = c.GetColumn();
        br = c.GetRow();
        cellr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,10000,totalh - 4));
        cls = this.GetBaseCellClass(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(bc,br)));
        this.DoGetCellClass(bc,br,{get: function () {
            return cls;
          }, set: function (v) {
            cls = v;
          }});
        if (cls != null) {
          ck = this.GetCellKind(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(bc,br)));
          d = this.GetCellData(bc,br);
          ci = cls.$create("Create$1",[pas["WEBLib.TMSFNCTypes"].TRectF.$clone(cellr),bc,br,d,ck,this]);
          if (ci != null) {
            try {
              this.ConfigureCell(ci,$mod.TTMSFNCDataGridCellConfigureMode.gccmBoth);
              sz.$assign(ci.GetRequiredSize(AGraphics));
              if (sz.cx > m) m = sz.cx;
            } finally {
              ci = rtl.freeLoc(ci);
            };
          };
        };
      };
      this.SetColumnWidth(AColumn,m + APadding);
    };
    this.InternalAutoSizeRow = function (ARow, AMode, APadding, AGraphics) {
      var i = 0;
      var k = 0;
      var m = 0.0;
      var totalw = 0.0;
      var cs = 0;
      var c = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var cellr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var cls = null;
      var ck = 0;
      var ci = null;
      var bc = 0;
      var br = 0;
      var d = null;
      var sz = pas["WEBLib.TMSFNCTypes"].TSizeF.$new();
      var sc = 0;
      var ec = 0;
      m = 0;
      if (AMode === $mod.TTMSFNCDataGridAutoSizeMode.gamVisibleCells) {
        sc = this.GetStartColumn();
        ec = this.GetStopColumn();
      } else {
        sc = 0;
        ec = this.FColumnCount - 1;
      };
      for (var $l = sc, $end = ec; $l <= $end; $l++) {
        i = $l;
        c.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(i,ARow));
        c.$assign(this.BaseCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c)));
        if (!((c.GetColumn() === i) && (c.GetRow() === ARow))) continue;
        cs = this.ColumnSpan(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c));
        totalw = 0;
        if (cs > 0) {
          for (var $l1 = c.GetColumn(), $end1 = (c.GetColumn() + cs) - 1; $l1 <= $end1; $l1++) {
            k = $l1;
            totalw = totalw + this.GetColumnWidth(k);
          };
        } else totalw = this.GetColumnWidth(c.GetColumn());
        bc = c.GetColumn();
        br = c.GetRow();
        cellr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,totalw - 4,10000));
        cls = this.GetBaseCellClass(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(bc,br)));
        this.DoGetCellClass(bc,br,{get: function () {
            return cls;
          }, set: function (v) {
            cls = v;
          }});
        if (cls != null) {
          ck = this.GetCellKind(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(bc,br)));
          d = this.GetCellData(bc,br);
          ci = cls.$create("Create$1",[pas["WEBLib.TMSFNCTypes"].TRectF.$clone(cellr),bc,br,d,ck,this]);
          if (ci != null) {
            try {
              this.ConfigureCell(ci,$mod.TTMSFNCDataGridCellConfigureMode.gccmBoth);
              sz.$assign(ci.GetRequiredSize(AGraphics));
              if (sz.cy > m) m = sz.cy;
            } finally {
              ci = rtl.freeLoc(ci);
            };
          };
        };
      };
      this.SetRowHeight(ARow,m + APadding);
    };
    this.InternalClear = function () {
      if (this.GetControlWrapperList() != null) this.GetControlWrapperList().Clear();
      this.GetSelectedCellDictionary().Clear();
      this.GetSelectedColumnDictionary().Clear();
      this.GetSelectedRowDictionary().Clear();
      this.FNormalCellDisplay.Clear();
      this.FFixedColumnCellDisplay.Clear();
      this.FFixedRowCellDisplay.Clear();
      this.FFixedRootCellDisplay.Clear();
      this.FNormalCellList.Clear();
      this.FFixedColumnCellList.Clear();
      this.FFixedRowCellList.Clear();
      this.FFixedRootCellList.Clear();
      this.ClearControlCache();
      pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridData.InternalClear.call(this);
    };
    this.InternalMarkCells = function (AValue, ATag, ACaseSensitive, AFromColumn, AFromRow, AToColumn, AToRow, AFullCell) {
      var r = 0;
      var c = 0;
      var ct = "";
      var h = "";
      AValue = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.FixMarkup(AValue,false);
      for (var $l = AFromRow, $end = AToRow; $l <= $end; $l++) {
        r = $l;
        for (var $l1 = AFromColumn, $end1 = AToColumn; $l1 <= $end1; $l1++) {
          c = $l1;
          if (this.IsCellBase(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r)))) {
            ct = this.GetString(c,r);
            h = pas["WEBLib.TMSFNCHTMLEngine"].HiLight(ct,AValue,ATag,ACaseSensitive,AFullCell);
            if (h !== ct) this.SetCell(c,r,h);
          };
        };
      };
    };
    this.InternalSaveToHTML = function (AFileName, AEncoding) {
      var $Self = this;
      var ms = null;
      function InternalOutputToHTML() {
        var d = "";
        d = pas.SysUtils.ExtractFilePath(AFileName);
        d = pas.SysUtils.StringReplace(d,"\\","/",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
        ms.SetPosition(0);
        $Self.InternalSaveToHTMLStream(ms,AEncoding,d);
      };
      ms = pas.Classes.TMemoryStream.$create("Create");
      try {
        InternalOutputToHTML();
        pas["WEBLib.TMSFNCTypes"].TTMSFNCMemoryStream.SaveToFile.call(ms,AFileName);
        if (this.GetOptions().GetIO().FOpenAfterCreation) pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.OpenFile(AFileName,null);
      } finally {
        ms = rtl.freeLoc(ms);
      };
    };
    this.InternalSaveToHTMLStream = function (AStream, AEncoding, AImageDirectory) {
      var s = "";
      var sl = null;
      sl = pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFileStringList.$create("Create$1");
      try {
        s = this.SavetoHTMLString(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoordRange.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCellRange(this.GetOptions().GetIO().FStartColumn,this.GetOptions().GetIO().FStartRow,this.FColumnCount - 1,pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.IfElse$$$G$$WEBLib$TMSFNCUtils$$Longint(this.GetOptions().GetIO().FMaxRows > -1,this.GetOptions().GetIO().FMaxRows,this.FRowCount - 1))),AImageDirectory);
        sl.WriteLn(s);
        pas.Classes.TStringsHelper.SaveToStream$1.call(sl,AStream,AEncoding);
      } finally {
        sl = rtl.freeLoc(sl);
      };
    };
    this.InternalSaveToImage = function (AFileName) {
      var $Self = this;
      var ms = null;
      function InternalOutputToImage() {
        ms.SetPosition(0);
        $Self.InternalSaveToImageStream(ms);
      };
      ms = pas.Classes.TMemoryStream.$create("Create");
      try {
        InternalOutputToImage();
        pas["WEBLib.TMSFNCTypes"].TTMSFNCMemoryStream.SaveToFile.call(ms,AFileName);
        if (this.GetOptions().GetIO().FOpenAfterCreation) pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.OpenFile(AFileName,null);
      } finally {
        ms = rtl.freeLoc(ms);
      };
    };
    this.InternalSaveToImageStream = function (AStream) {
      var g = null;
      g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[Math.round(this.FTotalColumnWidth),Math.round(this.FTotalRowHeight),false,true]);
      try {
        g.BeginScene();
        this.Export$1(g,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,this.FTotalColumnWidth,this.FTotalRowHeight)),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoordRange.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCellRange(0,0,this.FColumnCount - 1,this.FRowCount - 1)),false,false,true,false,1.0,null,null);
        g.EndScene();
        g.FBitmap.SaveToStream(AStream);
      } finally {
        g = rtl.freeLoc(g);
      };
    };
    this.InternalUnmarkCells = function (ATag, AFromColumn, AFromRow, AToColumn, AToRow) {
      var r = 0;
      var c = 0;
      var ct = "";
      for (var $l = AFromRow, $end = AToRow; $l <= $end; $l++) {
        r = $l;
        for (var $l1 = AFromColumn, $end1 = AToColumn; $l1 <= $end1; $l1++) {
          c = $l1;
          if (this.IsCellBase(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r)))) {
            ct = this.GetString(c,r);
            ct = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.UnFixMarkup(ct,false,false);
            this.SetCell(c,r,pas["WEBLib.TMSFNCHTMLEngine"].UnHiLight(ct,ATag));
          };
        };
      };
    };
    this.MoveColumnData = function (AFromColumn, AToColumn) {
      var pb = pas["Generics.Collections"].TPair$$$G$$generics$collections$$Longint$$Boolean.$new();
      var pk = pas["Generics.Collections"].TPair$$$G$$generics$collections$$TTMSFNCDataGridCellCoord$$Boolean.$new();
      var R = 0;
      pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridData.MoveColumnData.apply(this,arguments);
      if (this.GetSelectedColumnDictionary().ContainsKey(AFromColumn)) {
        pb.$assign(this.GetSelectedColumnDictionary().ExtractPair(AFromColumn));
        this.SetSelectedColumn(AToColumn,pb.Value);
        this.GetSelectedColumnDictionary().Remove(AFromColumn);
        if (this.GetSelectedCellDictionary().GetCount() > 0) {
          for (var $l = 0, $end = this.FRowCount - 1; $l <= $end; $l++) {
            R = $l;
            pk.$assign(this.GetSelectedCellDictionary().ExtractPair(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AFromColumn,R)));
            this.SetSelectedCell(AToColumn,R,pk.Value);
            this.GetSelectedCellDictionary().Remove(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AFromColumn,R));
          };
        };
      };
      this.SynchronizeColumns(false);
      if ((AFromColumn >= 0) && (AFromColumn <= (this.FColumns.GetCount() - 1)) && (AToColumn >= 0) && (AToColumn <= (this.FColumns.GetCount() - 1))) this.FColumns.GetItem$1(AFromColumn).SetIndex(AToColumn);
    };
    this.MoveRowData = function (AFromRow, AToRow) {
      var pb = pas["Generics.Collections"].TPair$$$G$$generics$collections$$Longint$$Boolean.$new();
      var pk = pas["Generics.Collections"].TPair$$$G$$generics$collections$$TTMSFNCDataGridCellCoord$$Boolean.$new();
      var C = 0;
      pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridData.MoveRowData.apply(this,arguments);
      if (this.GetSelectedRowDictionary().ContainsKey(AFromRow)) {
        pb.$assign(this.GetSelectedRowDictionary().ExtractPair(AFromRow));
        this.SetSelectedRow(AToRow,pb.Value);
        this.GetSelectedRowDictionary().Remove(AFromRow);
        if (this.GetSelectedCellDictionary().GetCount() > 0) {
          for (var $l = 0, $end = this.FColumnCount - 1; $l <= $end; $l++) {
            C = $l;
            pk.$assign(this.GetSelectedCellDictionary().ExtractPair(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(C,AFromRow)));
            this.SetSelectedCell(C,AToRow,pk.Value);
            this.GetSelectedCellDictionary().Remove(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(C,AFromRow));
          };
        };
      };
    };
    this.OptionsChanged = function (Sender) {
      this.Display();
    };
    this.OptionsFilterRowChanged = function (OldRow, NewRow) {
      var I = 0;
      this.IncUpdateCount();
      try {
        for (var $l = 0, $end = this.FColumnCount - 1; $l <= $end; $l++) {
          I = $l;
          this.RemoveFilterEditor$1(I,OldRow);
        };
      } finally {
        this.DecUpdateCount();
      };
    };
    this.OptionsChangedRebuild = function (Sender) {
      this.Update();
    };
    this.PaddingChanged = function (Sender) {
      this.Update();
    };
    this.ProcessTab = function (AKeyInfo, Mode, Handling, DirectEdit, CellStart) {
      var cl = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var clc = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var rl = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var c = 0;
      var r = 0;
      var a = false;
      var Allow = false;
      var SaveFocusCell = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      if ((AKeyInfo.Key === 9) && (this.FRowCount > (this.FFixedRowCount + this.FFixedBottomRowCount)) && (this.FColumnCount > (this.FFixedColumnCount + this.FFixedRightColumnCount))) {
        SaveFocusCell.$assign(this.GetFocusedCell());
        a = this.StopEditing(true);
        if (!a) {
          AKeyInfo.Key = 0;
          return;
        };
        this.SetFocusedCell(SaveFocusCell);
        if (this.IsFocused()) {
          var $tmp = Handling;
          if ($tmp === $mod.TTMSFNCDataGridTabKeyHandling.gtkhNextCell) {
            AKeyInfo.Key = 0}
           else if ($tmp === $mod.TTMSFNCDataGridTabKeyHandling.gtkhMixed) {
            if (pas.Classes.TShiftState$a.ssShift in AKeyInfo.Shift) {
              cl.SetColumn(this.FFixedColumnCount);
              cl.SetRow(this.FFixedRowCount);
              if (this.IsCellDisabled(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cl))) {
                var $tmp1 = Mode;
                if ($tmp1 === $mod.TTMSFNCDataGridTabKeyDirection.gtkdNextColumnCell) {
                  cl.$assign(this.NextSelectableColumn(cl.GetColumn(),cl.GetRow()))}
                 else if ($tmp1 === $mod.TTMSFNCDataGridTabKeyDirection.gtkdNextRowCell) cl.$assign(this.NextSelectableRow(cl.GetColumn(),cl.GetRow()));
              };
              if ((Handling === $mod.TTMSFNCDataGridTabKeyHandling.gtkhMixed) && !((this.GetFocusedCell().GetColumn() === cl.GetColumn()) && (this.GetFocusedCell().GetRow() === cl.GetRow()))) AKeyInfo.Key = 0;
            } else {
              cl.SetColumn(this.FColumnCount - 1 - this.FFixedRightColumnCount);
              cl.SetRow(this.FRowCount - 1 - this.FFixedBottomRowCount);
              if (this.IsCellDisabled(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cl))) {
                var $tmp2 = Mode;
                if ($tmp2 === $mod.TTMSFNCDataGridTabKeyDirection.gtkdNextColumnCell) {
                  cl.$assign(this.PreviousSelectableColumn(cl.GetColumn(),cl.GetRow()))}
                 else if ($tmp2 === $mod.TTMSFNCDataGridTabKeyDirection.gtkdNextRowCell) cl.$assign(this.PreviousSelectableRow(cl.GetColumn(),cl.GetRow()));
              };
              if ((Handling === $mod.TTMSFNCDataGridTabKeyHandling.gtkhMixed) && !((this.GetFocusedCell().GetColumn() === cl.GetColumn()) && (this.GetFocusedCell().GetRow() === cl.GetRow()))) AKeyInfo.Key = 0;
            };
          };
          if (AKeyInfo.Key === 0) {
            var $tmp3 = Handling;
            if (($tmp3 === $mod.TTMSFNCDataGridTabKeyHandling.gtkhNextCell) || ($tmp3 === $mod.TTMSFNCDataGridTabKeyHandling.gtkhMixed)) {
              cl.$assign(this.GetFocusedCell());
              rl.$assign(this.FRealCell);
              cl.$assign(this.BaseCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cl)));
              if (pas.Classes.TShiftState$a.ssShift in AKeyInfo.Shift) {
                clc.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(this.FFixedColumnCount,this.FFixedRowCount));
                if ((this.GetFocusedCell().GetColumn() === clc.GetColumn()) && (this.GetFocusedCell().GetRow() === clc.GetRow())) {
                  clc.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(this.FColumnCount - 1 - this.FFixedRightColumnCount,this.FRowCount - 1 - this.FFixedBottomRowCount));
                  this.SetFocusedCell(clc);
                  return;
                };
                var $tmp4 = Mode;
                if ($tmp4 === $mod.TTMSFNCDataGridTabKeyDirection.gtkdNextColumnCell) {
                  c = cl.GetColumn();
                  cl.$assign(this.PreviousSelectableColumn(cl.GetColumn(),cl.GetRow()));
                  cl.SetRow(rl.GetRow());
                  if (c === cl.GetColumn()) {
                    r = cl.GetRow();
                    cl.SetColumn(this.FColumnCount - 1 - this.FFixedRightColumnCount);
                    cl.$assign(this.PreviousSelectableColumn(cl.GetColumn(),cl.GetRow()));
                    if (r === cl.GetRow()) {
                      cl.$assign(this.PreviousSelectableColumn(this.FColumnCount - this.FFixedRightColumnCount,cl.GetRow() - 1));
                      while ((cl.GetColumn() === (this.FColumnCount - this.FFixedRightColumnCount)) && (cl.GetRow() === (r - 1))) {
                        r = cl.GetRow();
                        cl.$assign(this.PreviousSelectableColumn(this.FColumnCount - this.FFixedRightColumnCount,cl.GetRow() - 1));
                      };
                    };
                    if ((Handling === $mod.TTMSFNCDataGridTabKeyHandling.gtkhNextCell) && ((cl.GetRow() < this.FFixedRowCount) || (r === cl.GetRow()))) {
                      cl.SetColumn(this.FColumnCount - 1 - this.FFixedRightColumnCount);
                      cl.SetRow(this.FRowCount - 1 - this.FFixedBottomRowCount);
                      cl.$assign(this.PreviousSelectableColumn(cl.GetColumn(),cl.GetRow()));
                    };
                  };
                } else if ($tmp4 === $mod.TTMSFNCDataGridTabKeyDirection.gtkdNextRowCell) {
                  r = cl.GetRow();
                  cl.$assign(this.PreviousSelectableRow(cl.GetColumn(),cl.GetRow()));
                  cl.SetColumn(rl.GetColumn());
                  if (r === cl.GetRow()) {
                    c = cl.GetColumn();
                    cl.SetRow(this.FRowCount - 1 - this.FFixedBottomRowCount);
                    cl.$assign(this.PreviousSelectableRow(cl.GetColumn(),cl.GetRow()));
                    if (c === cl.GetColumn()) {
                      cl.$assign(this.PreviousSelectableRow(cl.GetColumn() - 1,this.FRowCount - this.FFixedBottomRowCount));
                      while ((cl.GetRow() === (this.FRowCount - this.FFixedBottomRowCount)) && (cl.GetColumn() === (c - 1))) {
                        c = cl.GetColumn();
                        cl.$assign(this.PreviousSelectableRow(cl.GetColumn() - 1,this.FRowCount - this.FFixedBottomRowCount));
                      };
                    };
                    if ((Handling === $mod.TTMSFNCDataGridTabKeyHandling.gtkhNextCell) && ((cl.GetColumn() < this.FFixedColumnCount) || (c === cl.GetColumn()))) {
                      cl.SetColumn(this.FColumnCount - 1 - this.FFixedRightColumnCount);
                      cl.SetRow(this.FRowCount - 1 - this.FFixedBottomRowCount);
                      cl.$assign(this.PreviousSelectableRow(cl.GetColumn(),cl.GetRow()));
                    };
                  };
                };
                this.SelectCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cl),{},false,false,false);
                if (DirectEdit) {
                  Allow = true;
                  this.DoCanEditCell(this.GetFocusedCell().GetColumn(),this.GetFocusedCell().GetRow(),{get: function () {
                      return Allow;
                    }, set: function (v) {
                      Allow = v;
                    }});
                  if (Allow) this.EditCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.GetFocusedCell()),CellStart,false,"",0);
                };
              } else {
                clc.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(this.FColumnCount - 1 - this.FFixedRightColumnCount,this.FRowCount - 1 - this.FFixedBottomRowCount));
                if ((this.GetFocusedCell().GetColumn() === clc.GetColumn()) && (this.GetFocusedCell().GetRow() === clc.GetRow())) {
                  clc.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(this.FFixedColumnCount,this.FFixedRowCount));
                  this.SetFocusedCell(clc);
                  return;
                };
                var $tmp5 = Mode;
                if ($tmp5 === $mod.TTMSFNCDataGridTabKeyDirection.gtkdNextColumnCell) {
                  c = cl.GetColumn();
                  cl.$assign(this.NextSelectableColumn(cl.GetColumn(),cl.GetRow()));
                  cl.SetRow(rl.GetRow());
                  if (c === cl.GetColumn()) {
                    r = cl.GetRow();
                    cl.SetColumn(this.FFixedColumnCount);
                    cl.$assign(this.NextSelectableColumn(cl.GetColumn(),cl.GetRow()));
                    if (r === cl.GetRow()) {
                      cl.$assign(this.NextSelectableColumn(this.FFixedColumnCount - 1,cl.GetRow() + 1));
                      while ((cl.GetColumn() === (this.FFixedColumnCount - 1)) && (cl.GetRow() === (r + 1))) {
                        r = cl.GetRow();
                        cl.$assign(this.NextSelectableColumn(this.FFixedColumnCount - 1,cl.GetRow() + 1));
                      };
                    };
                    if ((Handling === $mod.TTMSFNCDataGridTabKeyHandling.gtkhNextCell) && ((cl.GetRow() > (this.FRowCount - 1 - this.FFixedBottomRowCount)) || (r === cl.GetRow()))) {
                      cl.SetColumn(this.FFixedColumnCount);
                      cl.SetRow(this.FFixedRowCount);
                      cl.$assign(this.NextSelectableColumn(cl.GetColumn(),cl.GetRow()));
                    };
                  };
                } else if ($tmp5 === $mod.TTMSFNCDataGridTabKeyDirection.gtkdNextRowCell) {
                  r = cl.GetRow();
                  cl.$assign(this.NextSelectableRow(cl.GetColumn(),cl.GetRow()));
                  cl.SetColumn(rl.GetColumn());
                  if (r === cl.GetRow()) {
                    c = cl.GetColumn();
                    cl.SetRow(this.FFixedRowCount);
                    cl.$assign(this.NextSelectableRow(cl.GetColumn(),cl.GetRow()));
                    if (c === cl.GetColumn()) {
                      cl.$assign(this.NextSelectableRow(cl.GetColumn() + 1,this.FFixedRowCount - 1));
                      while ((cl.GetRow() === (this.FFixedRowCount - 1)) && (cl.GetColumn() === (c + 1))) {
                        c = cl.GetColumn();
                        cl.$assign(this.NextSelectableRow(cl.GetColumn() + 1,this.FFixedRowCount - 1));
                      };
                    };
                    if ((Handling === $mod.TTMSFNCDataGridTabKeyHandling.gtkhNextCell) && ((cl.GetColumn() > (this.FColumnCount - 1 - this.FFixedRightColumnCount)) || (c === cl.GetColumn()))) {
                      cl.SetColumn(this.FFixedColumnCount);
                      cl.SetRow(this.FFixedRowCount);
                      cl.$assign(this.NextSelectableRow(cl.GetColumn(),cl.GetRow()));
                    };
                  };
                };
                this.SelectCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cl),{},false,false,false);
                if (DirectEdit) {
                  Allow = true;
                  this.DoCanEditCell(this.GetFocusedCell().GetColumn(),this.GetFocusedCell().GetRow(),{get: function () {
                      return Allow;
                    }, set: function (v) {
                      Allow = v;
                    }});
                  if (Allow) this.EditCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.GetFocusedCell()),CellStart,false,"",0);
                };
              };
            };
          };
        } else {
          if (Handling !== $mod.TTMSFNCDataGridTabKeyHandling.gtkhNextControl) {
            if (pas.Classes.TShiftState$a.ssShift in AKeyInfo.Shift) {
              cl.SetColumn(this.FColumnCount - 1 - this.FFixedRightColumnCount);
              cl.SetRow(this.FRowCount - 1 - this.FFixedBottomRowCount);
              if (this.IsCellDisabled(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cl))) {
                var $tmp6 = Mode;
                if ($tmp6 === $mod.TTMSFNCDataGridTabKeyDirection.gtkdNextColumnCell) {
                  cl.$assign(this.PreviousSelectableColumn(cl.GetColumn(),cl.GetRow()))}
                 else if ($tmp6 === $mod.TTMSFNCDataGridTabKeyDirection.gtkdNextRowCell) cl.$assign(this.PreviousSelectableRow(cl.GetColumn(),cl.GetRow()));
              };
              this.SelectCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cl),{},false,false,false);
            } else {
              cl.SetColumn(this.FFixedColumnCount);
              cl.SetRow(this.FFixedRowCount);
              if (this.IsCellDisabled(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cl))) {
                var $tmp7 = Mode;
                if ($tmp7 === $mod.TTMSFNCDataGridTabKeyDirection.gtkdNextColumnCell) {
                  cl.$assign(this.NextSelectableColumn(cl.GetColumn(),cl.GetRow()))}
                 else if ($tmp7 === $mod.TTMSFNCDataGridTabKeyDirection.gtkdNextRowCell) cl.$assign(this.NextSelectableRow(cl.GetColumn(),cl.GetRow()));
              };
              this.SelectCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cl),{},false,false,false);
            };
          };
        };
      };
    };
    this.RemoveCellControlFromCache = function (AColumn, ARow) {
      var cl = null;
      pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridData.RemoveCellControlFromCache.apply(this,arguments);
      cl = this.GetCellObjectForCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow)));
      if (cl != null) cl.ClearControlCache();
    };
    this.ResetColumnWidths = function () {
      var I = 0;
      var cl = null;
      this.BeginUpdate();
      try {
        for (var $l = 0, $end = this.FColumnCount - 1; $l <= $end; $l++) {
          I = $l;
          cl = this.GetColumn(I);
          if (cl != null) {
            this.SetColumnWidth(I,cl.GetWidth())}
           else this.SetColumnWidth(I,this.FDefaultColumnWidth);
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.ResetRowHeights = function () {
      var I = 0;
      this.BeginUpdate();
      try {
        for (var $l = 0, $end = this.FRowCount - 1; $l <= $end; $l++) {
          I = $l;
          this.SetRowHeight(I,this.FDefaultRowHeight);
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.ResetScrollBarCapture = function () {
      if (this.FCapturedScrollbar != null) this.FCapturedScrollbar.HandleMouseLeave();
      this.FCapturedScrollbar = null;
    };
    this.SafeSwap = function (A, B) {
      var T = 0;
      T = A.get();
      A.set(B.get());
      B.set(T);
    };
    this.SetBoolean = function (AColumn, ARow, Value) {
      var $Self = this;
      var cl = null;
      function UpdateCell(ACell, AValue) {
        var cll = null;
        var v = undefined;
        cll = $Self.GetCellObjectForCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
        if (cll != null) {
          cll.UpdateData($Self.GetCellData(ACell.GetColumn(),ACell.GetRow()));
          if (pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellHelper.GetIsCheckedCell.call(cll)) pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellHelper.GetAsCheckedCell.call(cll).FChecked = AValue;
          cll.CreateControlCache();
          if (($Self.FAdapter != null) && $mod.TTMSFNCDataGridRendererDataAdapter.isPrototypeOf($Self.FAdapter)) {
            v = AValue;
            rtl.as($Self.FAdapter,$mod.TTMSFNCDataGridRendererDataAdapter).EditSetData(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),null,{get: function () {
                return v;
              }, set: function (w) {
                v = w;
              }});
          };
        };
      };
      if (this.GetHasDataCheckBox(AColumn,ARow) || this.GetHasDataRadioButton(AColumn,ARow)) {
        cl = this.GetColumn(AColumn);
        if (cl != null) {
          if (Value) {
            this.SetCell(AColumn,ARow,cl.FBinding.FBooleanTrueValue)}
           else this.SetCell(AColumn,ARow,cl.FBinding.FBooleanFalseValue);
        };
      } else pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridData.SetBoolean.call(this,AColumn,ARow,Value);
      UpdateCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow)),Value);
    };
    this.SetClipRect = function (ARect) {
      this.FClipRect.$assign(ARect);
      this.FUseClipRect = true;
    };
    this.SetFocusCell = function (ACol, ARow) {
      this.FFocusedCell.SetColumn(ACol);
      this.FFocusedCell.SetRow(ARow);
      this.FFocusedCell.SetColumn(Math.max(this.FFixedColumnCount,Math.min(this.FColumnCount - 1 - this.FFixedRightColumnCount,this.FFocusedCell.GetColumn())));
      this.FFocusedCell.SetRow(Math.max(this.FFixedRowCount,Math.min(this.FRowCount - 1 - this.FFixedBottomRowCount,this.FFocusedCell.GetRow())));
    };
    this.SetFonts = function (ASetType) {
      var I = 0;
      var c = null;
      var p = null;
      var fi = null;
      var $ir = rtl.createIntfRefs();
      try {
        this.BeginUpdate();
        try {
          p = this.GetParentHost();
          if ((p != null) && pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(p,pas.System.IUnknown)),rtl.getIntfGUIDR(pas["WEBLib.TMSFNCGraphicsTypes"].ITMSFNCAppearanceGlobalFont),{get: function () {
              return fi;
            }, set: function (v) {
              fi = v;
            }})) fi.SetFonts(ASetType);
          this.FGlobalFont.ApplyChange(this.FCellAppearance.FFixedLayout.FFont,ASetType);
          this.FGlobalFont.ApplyChange(this.FCellAppearance.FFocusedLayout.FFont,ASetType);
          this.FGlobalFont.ApplyChange(this.FCellAppearance.FNormalLayout.FFont,ASetType);
          this.FGlobalFont.ApplyChange(this.FCellAppearance.FGroupLayout.FFont,ASetType);
          this.FGlobalFont.ApplyChange(this.FCellAppearance.FSummaryLayout.FFont,ASetType);
          this.FGlobalFont.ApplyChange(this.FCellAppearance.FSelectedLayout.FFont,ASetType);
          this.FGlobalFont.ApplyChange(this.FCellAppearance.FFixedSelectedLayout.FFont,ASetType);
          this.FGlobalFont.ApplyChange(this.FCellAppearance.FBandLayout.FFont,ASetType);
          this.FGlobalFont.ApplyChange(this.FCellAppearance.FFilterInverseMatchLayout.FFont,ASetType);
          this.FGlobalFont.ApplyChange(this.FCellAppearance.FFilterMatchLayout.FFont,ASetType);
          for (var $l = 0, $end = this.FColumns.GetCount() - 1; $l <= $end; $l++) {
            I = $l;
            c = this.FColumns.GetItem$1(I);
            this.FGlobalFont.ApplyChange(c.FAppearance.FFixedLayout.FFont,ASetType);
            this.FGlobalFont.ApplyChange(c.FAppearance.FFocusedLayout.FFont,ASetType);
            this.FGlobalFont.ApplyChange(c.FAppearance.FNormalLayout.FFont,ASetType);
            this.FGlobalFont.ApplyChange(c.FAppearance.FGroupLayout.FFont,ASetType);
            this.FGlobalFont.ApplyChange(c.FAppearance.FSummaryLayout.FFont,ASetType);
            this.FGlobalFont.ApplyChange(c.FAppearance.FSelectedLayout.FFont,ASetType);
            this.FGlobalFont.ApplyChange(c.FAppearance.FFixedSelectedLayout.FFont,ASetType);
            this.FGlobalFont.ApplyChange(c.FAppearance.FBandLayout.FFont,ASetType);
            this.FGlobalFont.ApplyChange(c.FAppearance.FFilterMatchLayout.FFont,ASetType);
            this.FGlobalFont.ApplyChange(c.FAppearance.FFilterInverseMatchLayout.FFont,ASetType);
          };
        } finally {
          this.EndUpdate();
        };
      } finally {
        $ir.free();
        rtl._Release(fi);
      };
    };
    this.SetLayout = function (ACell) {
      if (ACell != null) this.ConfigureLayout(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell.GetCoordinate()),ACell.GetLayout(),false);
    };
    this.SetProperties = function (ACell) {
      var idx = null;
      var c = "";
      var w = 0;
      var h = 0;
      var t = "";
      var ctx = pas.RTTI.TRTTIContext.$new();
      var rt = null;
      var prop = null;
      var val = pas.RTTI.TValue.$new();
      var fe = false;
      var rf = false;
      var rs = 0;
      var cl = null;
      var ci = null;
      var eci = null;
      var ctl = null;
      var ctla = 0;
      var ctlp = 0;
      var ctlm = null;
      var ctlw = 0;
      var ctlh = 0;
      var cf = "";
      var ctltxt = "";
      var hf = false;
      if (!(ACell != null)) return;
      ci = ACell.FData;
      cl = this.GetColumn(ACell.FColumn);
      eci = null;
      ctl = null;
      if (pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(ci)) {
        eci = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(ci);
        ctl = eci.FControl;
      };
      ctla = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellControlAlign.gcaNone;
      if ((cl != null) && ($mod.TTMSFNCDataGridColumnSetting.gcsControlAlign in cl.FSettings)) {
        ctla = cl.FControlAlign}
       else if (eci != null) ctla = eci.FControlAlign;
      ctlp = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellControlPosition.gcpCenterRight;
      if ((cl != null) && ($mod.TTMSFNCDataGridColumnSetting.gcsControlPosition in cl.FSettings)) {
        ctlp = cl.FControlPosition}
       else if (eci != null) ctlp = eci.FControlPosition;
      ctlm = null;
      if ((cl != null) && ($mod.TTMSFNCDataGridColumnSetting.gcsControlMargins in cl.FSettings)) {
        ctlm = cl.FControlMargins}
       else if (eci != null) ctlm = eci.GetControlMargins();
      ctlw = -1;
      if ((cl != null) && ($mod.TTMSFNCDataGridColumnSetting.gcsControlWidth in cl.FSettings)) {
        ctlw = cl.FControlWidth}
       else if (eci != null) ctlw = eci.FControlWidth;
      ctlh = -1;
      if ((cl != null) && ($mod.TTMSFNCDataGridColumnSetting.gcsControlHeight in cl.FSettings)) {
        ctlh = cl.FControlHeight}
       else if (eci != null) ctlh = eci.FControlHeight;
      ctltxt = "";
      if ((cl != null) && ($mod.TTMSFNCDataGridColumnSetting.gcsControlText in cl.FSettings)) {
        ctltxt = cl.FControlText}
       else if (eci != null) ctltxt = eci.FControlText;
      fe = false;
      rf = false;
      if (this.GetOptions().FFiltering.FEnabled && (ACell.FRow === this.GetOptions().FFiltering.FRow) && (ACell.FColumn >= this.FFixedColumnCount) && (ACell.FColumn <= (this.FColumnCount - this.FFixedRightColumnCount - 1))) {
        if ((cl != null) && ($mod.TTMSFNCDataGridColumnSetting.gcsFilterButton in cl.FSettings)) {
          ACell.FFilterButton = cl.FFilterButton}
         else ACell.FFilterButton = pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilterControl.gfcButton in this.GetOptions().FFiltering.FControls;
        if (!(ctl != null) && !this.GetOptions().FFiltering.FAdvanced) {
          if ((cl != null) && ($mod.TTMSFNCDataGridColumnSetting.gcsFilterEditor in cl.FSettings)) {
            fe = cl.FFilterEditor}
           else fe = pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilterControl.gfcEditor in this.GetOptions().FFiltering.FControls;
        };
        rf = true;
      };
      if (!fe && !rf && !this.GetOptions().FFiltering.FAdvanced) fe = this.GetHasFilterEditor(ACell.FColumn,ACell.FRow);
      if (fe) {
        ctl = this.GetFilterEditor(ACell.FColumn,ACell.FRow);
        if (ctl != null) ctla = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellControlAlign.gcaClient;
      };
      ACell.FBitmapContainer = this.GetBitmapContainer();
      if (pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellHelper.GetIsBitmapCell.call(ACell)) {
        pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellHelper.GetAsBitmapCell.call(ACell).GetBitmap().Assign(this.GetBitmap(ACell.FColumn,ACell.FRow));
        pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellHelper.GetAsBitmapCell.call(ACell).SetBitmapName(this.GetBitmapName(ACell.FColumn,ACell.FRow));
        pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellHelper.GetAsBitmapCell.call(ACell).SetBitmapAspectRatio(this.GetBitmapAspectRatio(ACell.FColumn,ACell.FRow));
        pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellHelper.GetAsBitmapCell.call(ACell).SetBitmapCropped(this.GetBitmapCropped(ACell.FColumn,ACell.FRow));
        pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellHelper.GetAsBitmapCell.call(ACell).SetBitmapCentered(this.GetBitmapCentered(ACell.FColumn,ACell.FRow));
        pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellHelper.GetAsBitmapCell.call(ACell).SetBitmapStretched(this.GetBitmapStretched(ACell.FColumn,ACell.FRow));
      };
      ACell.FControl = ctl;
      ACell.FControlAlign = ctla;
      ACell.FControlPosition = ctlp;
      ACell.GetControlMargins().Assign(ctlm);
      c = "";
      if (eci != null) c = eci.FComment;
      ACell.FCommentIndicator = c !== "";
      ACell.FComment = c;
      if (ACell.GetControl() != null) {
        w = ctlw;
        h = ctlh;
        t = ctltxt;
        if (w !== -1) ACell.GetControl().SetWidth(w);
        if (h !== -1) ACell.GetControl().SetHeight(h);
        if (t !== "") {
          ctx.$assign(pas.RTTI.TRTTIContext.Create());
          try {
            rt = ctx.GetType(ACell.GetControl().$class.ClassInfo());
            prop = rt.GetProperty("Caption");
            if ((prop != null) && prop.GetIsWritable()) {
              val.$assign(pas["WEBLib.TMSFNCDataGridData"].CellValueToTValue(t));
              prop.SetValue(ACell.GetControl(),val);
            };
          } finally {
            ctx.Free();
          };
        };
      };
      if (this.GetOptions().FFiltering.FAdvanced) {
        cf = pas.SysUtils.StringReplace(this.GetFilterBuilder().FParseFormat.FColumnFormat,"#COLUMN",this.GetColumnDataName(ACell.FColumn),rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
        hf = pas.System.Pos(cf,this.GetFilterBuilder().GetFilterText()) > 0;
      } else hf = this.GetFilter().HasFilter(ACell.FColumn);
      if (hf) {
        ACell.FFilterIcon = this.FIcons.GetActiveFilterActiveIcon()}
       else ACell.FFilterIcon = this.FIcons.GetActiveFilterIcon();
      ACell.FSortDescendingIcon = this.FIcons.GetActiveSortDescendingIcon();
      ACell.FSortAscendingIcon = this.FIcons.GetActiveSortAscendingIcon();
      ACell.FOnFilterButtonClick = rtl.createCallback(this,"DoCellFilterButtonClick");
      ACell.FOnCommentIndicatorClick = rtl.createCallback(this,"DoCellCommentIndicatorClick");
      ACell.FOnBeforeDraw = rtl.createCallback(this,"DoCellBeforeDraw");
      ACell.FOnAfterDraw = rtl.createCallback(this,"DoCellAfterDraw");
      if (this.GetOptions().FSorting.FEnabled && (this.GetSortIndexList().FLength > 0) && (ACell.FRow === this.GetOptions().FSorting.FRow)) {
        idx = null;
        if (this.GetSortIndexList().Find(ACell.FColumn,{get: function () {
            return idx;
          }, set: function (v) {
            idx = v;
          }})) {
          var $tmp = idx.FDirection;
          if ($tmp === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortDirection.gsdAscending) {
            ACell.FSortIndicator = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellSortIndicator.gsiAscending}
           else if ($tmp === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridSortDirection.gsdDescending) ACell.FSortIndicator = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellSortIndicator.gsiDescending;
        };
      };
      if (pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellHelper.GetIsNodeCell.call(ACell)) {
        rs = this.GetRowNodeState(ACell.FRow);
        pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellHelper.GetAsNodeCell.call(ACell).FState = rs;
        pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellHelper.GetAsNodeCell.call(ACell).FCollapseIcon = this.FIcons.GetActiveCollapseIcon();
        pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellHelper.GetAsNodeCell.call(ACell).FExpandIcon = this.FIcons.GetActiveExpandIcon();
        pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellHelper.GetAsNodeCell.call(ACell).FOnCollapse = rtl.createCallback(this,"DoCellNodeCollapse");
        pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellHelper.GetAsNodeCell.call(ACell).FOnExpand = rtl.createCallback(this,"DoCellNodeExpand");
      } else if (pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellHelper.GetIsCheckedCell.call(ACell)) {
        pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellHelper.GetAsCheckedCell.call(ACell).FChecked = this.GetBoolean(ACell.FColumn,ACell.FRow);
        pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellHelper.GetAsCheckedCell.call(ACell).FOnChange = rtl.createCallback(this,"DoCellCheckChange");
      } else if (pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellHelper.GetIsProgressBarCell.call(ACell)) {
        pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellHelper.GetAsProgressBarCell.call(ACell).FValue = this.GetProgressValue(ACell.FColumn,ACell.FRow)}
       else if (pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellHelper.GetIsButtonCell.call(ACell)) pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellHelper.GetAsButtonCell.call(ACell).FOnClick = rtl.createCallback(this,"DoCellButtonClick");
    };
    this.SetStartCell = function (AColumn, ARow) {
      var stc = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      stc.SetColumn(AColumn);
      stc.SetRow(ARow);
      stc.SetColumn(Math.max(this.FFixedColumnCount,Math.min(this.FColumnCount - 1 - this.FFixedRightColumnCount,stc.GetColumn())));
      stc.SetRow(Math.max(this.FFixedRowCount,Math.min(this.FRowCount - 1 - this.FFixedBottomRowCount,stc.GetRow())));
      this.FSelection.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCellRange(stc.GetColumn(),stc.GetRow(),this.FSelection.StopCell.GetColumn(),this.FSelection.StopCell.GetRow()));
    };
    this.SetStopCell = function (AColumn, ARow) {
      var stc = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      stc.SetColumn(AColumn);
      stc.SetRow(ARow);
      stc.SetColumn(Math.max(this.FFixedColumnCount,Math.min(this.FColumnCount - 1 - this.FFixedRightColumnCount,stc.GetColumn())));
      stc.SetRow(Math.max(this.FFixedRowCount,Math.min(this.FRowCount - 1 - this.FFixedBottomRowCount,stc.GetRow())));
      this.FSelection.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCellRange(this.FSelection.StartCell.GetColumn(),this.FSelection.StartCell.GetRow(),stc.GetColumn(),stc.GetRow()));
    };
    this.StopAnimationTimer = function () {
      this.GetAnimateTimer().SetEnabled(false);
      this.FAnimating = false;
    };
    this.SwapColumnData = function (AFromColumn, AToColumn) {
      var sc = false;
      var sct = false;
      var R = 0;
      var cFrom = null;
      var cTo = null;
      pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridData.SwapColumnData.apply(this,arguments);
      sc = this.GetSelectedColumn(AFromColumn);
      sct = this.GetSelectedColumn(AToColumn);
      this.SetSelectedColumn(AFromColumn,sct);
      this.SetSelectedColumn(AToColumn,sc);
      if (this.GetSelectedCellDictionary().GetCount() > 0) {
        for (var $l = 0, $end = this.FRowCount - 1; $l <= $end; $l++) {
          R = $l;
          sc = this.GetSelectedCell(AFromColumn,R);
          sct = this.GetSelectedCell(AToColumn,R);
          this.SetSelectedCell(AFromColumn,R,sct);
          this.SetSelectedCell(AToColumn,R,sc);
        };
      };
      if (this.FFocusedCell.GetColumn() === AFromColumn) {
        this.FFocusedCell.SetColumn(AToColumn)}
       else if (this.FFocusedCell.GetColumn() === AToColumn) this.FFocusedCell.SetColumn(AFromColumn);
      this.SynchronizeColumns(false);
      if ((AFromColumn >= 0) && (AFromColumn <= (this.FColumns.GetCount() - 1)) && (AToColumn >= 0) && (AToColumn <= (this.FColumns.GetCount() - 1))) {
        cFrom = $mod.TTMSFNCDataGridColumn.$create("Create$1",[null]);
        cTo = $mod.TTMSFNCDataGridColumn.$create("Create$1",[null]);
        try {
          cFrom.Assign(this.FColumns.GetItem$1(AFromColumn));
          cTo.Assign(this.FColumns.GetItem$1(AToColumn));
          this.FColumns.GetItem$1(AFromColumn).Assign(cTo);
          this.FColumns.GetItem$1(AToColumn).Assign(cFrom);
        } finally {
          cTo = rtl.freeLoc(cTo);
          cFrom = rtl.freeLoc(cFrom);
        };
      };
    };
    this.SwapRowData = function (AFromRow, AToRow) {
      var sr = false;
      var srt = false;
      var C = 0;
      pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridData.SwapRowData.apply(this,arguments);
      sr = this.GetSelectedRow(AFromRow);
      srt = this.GetSelectedRow(AToRow);
      this.SetSelectedRow(AFromRow,srt);
      this.SetSelectedRow(AToRow,sr);
      if (this.GetSelectedCellDictionary().GetCount() > 0) {
        for (var $l = 0, $end = this.FColumnCount - 1; $l <= $end; $l++) {
          C = $l;
          sr = this.GetSelectedCell(C,AFromRow);
          srt = this.GetSelectedCell(C,AToRow);
          this.SetSelectedCell(C,AFromRow,srt);
          this.SetSelectedCell(C,AToRow,sr);
        };
      };
      if (this.FFocusedCell.GetRow() === AFromRow) {
        this.FFocusedCell.SetRow(AToRow)}
       else if (this.FFocusedCell.GetRow() === AToRow) this.FFocusedCell.SetRow(AFromRow);
    };
    this.SynchronizeColumns = function (ACollectionUpdate) {
      if (this.GetIsDestroying() || this.FBlockSynchronizeColumns) return;
      this.FBlockSynchronizeColumns = true;
      this.IncUpdateCount();
      if (ACollectionUpdate) {
        this.SetColumnCount(this.FColumns.GetCount())}
       else {
        while (this.FColumns.GetCount() > this.FColumnCount) this.FColumns.Delete(this.FColumns.GetCount() - 1);
        while (this.FColumns.GetCount() < this.FColumnCount) this.FColumns.Add$1();
      };
      this.DecUpdateCount();
      this.FBlockSynchronizeColumns = false;
      pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCore.SynchronizeColumns.apply(this,arguments);
    };
    this.UpdateAutoSizing = function () {
      if ((this.FHost != null) && pas.Classes.TComponent.isPrototypeOf(this.FHost)) {
        if (pas.Classes.TComponentStateItem.csReading in rtl.as(this.FHost,pas.Classes.TComponent).FComponentState) return;
      };
      this.IncUpdateCount();
      try {
        if (this.GetOptions().FColumn.FStretching.FEnabled) {
          this.FColumnStretchingActive = this.StretchColumns(this.GetOptions().FColumn.FStretching.FMode,this.GetOptions().FColumn.FStretching.FRange,this.GetOptions().FColumn.FStretching.FIndex,-1);
          this.FColumnStretchingApplied = true;
        } else if (this.FColumnStretchingApplied) {
          this.FColumnStretchingActive = false;
          this.FColumnStretchingApplied = false;
          this.ResetColumnWidths();
        };
        if (this.GetOptions().FRow.FStretching.FEnabled) {
          this.FRowStretchingActive = this.StretchRows(this.GetOptions().FRow.FStretching.FMode,this.GetOptions().FRow.FStretching.FRange,this.GetOptions().FRow.FStretching.FIndex,-1);
          this.FRowStretchingApplied = true;
        } else if (this.FRowStretchingApplied) {
          this.FRowStretchingActive = false;
          this.FRowStretchingApplied = false;
          this.ResetRowHeights();
        };
      } finally {
        this.DecUpdateCount();
      };
    };
    this.UpdateCursor = function (ACursor) {
      if (this.FOnUpdateCursor != null) this.FOnUpdateCursor(this,ACursor);
    };
    this.UpdateFilterList = function (AColumn) {
      var sl = null;
      var fsl = null;
      var s = "";
      var sc = "";
      var fs = "";
      var sf = "";
      var k = 0;
      var i = 0;
      var it = null;
      var f = null;
      var fdt = 0;
      var cl = null;
      var c = 0;
      var b = false;
      var a = false;
      var an = false;
      var obj = null;
      var e = null;
      if (this.GetOptions().FFiltering.FAdvanced) return;
      sl = pas.Classes.TStringList.$create("Create$1");
      try {
        sl.FDuplicates = pas.Types.TDuplicates.dupIgnore;
        sl.SetSorted(true);
        sl.Add(this.GetOptions().FLocalization.FFilterAllText);
        c = AColumn;
        if (this.GetFilter().GetCount() > 0) c = this.GetFilter().GetItem$1(0).FColumn;
        a = true;
        if ((this.FAdapter != null) && $mod.TTMSFNCDataGridRendererDataAdapter.isPrototypeOf(this.FAdapter)) {
          var $tmp = rtl.as(this.FAdapter,$mod.TTMSFNCDataGridRendererDataAdapter).FilterMode();
          if ($tmp === pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataAdapterFilterMode.afmNone) {
            return}
           else if ($tmp === pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataAdapterFilterMode.afmAdapter) {
            rtl.as(this.FAdapter,$mod.TTMSFNCDataGridRendererDataAdapter).GetFilterData(AColumn,sl);
            a = false;
          };
        };
        an = false;
        if (a) {
          for (var $l = this.FFixedRowCount, $end = this.FRowCount - this.FFixedBottomRowCount - 1; $l <= $end; $l++) {
            i = $l;
            if (this.IsRowNormal(i) && ((this.GetOptions().FFiltering.FMultiColumn && ((!this.IsRowFilteredDisplay(i) && (c !== AColumn)) || (c === AColumn))) || !this.GetOptions().FFiltering.FMultiColumn)) {
              sf = pas.SysUtils.Trim(this.GetString(AColumn,i));
              if (sf !== "") {
                sl.AddObject(sf,this.GetFilter().GetCommonDoubleQuotedItem())}
               else an = true;
            };
          };
        };
        if (an) {
          sl.AddObject(this.GetOptions().FLocalization.FFilterEmptyText,this.GetFilter().GetCommonItem());
          sl.AddObject(this.GetOptions().FLocalization.FFilterNotEmptyText,this.GetFilter().GetCommonItem());
        };
        this.DoNeedFilterDropDownData(AColumn,sl);
        this.FLoadFilter = true;
        this.GetFilterListBox().BeginUpdate();
        try {
          if (!this.FStyleApplied) {
            this.GetFilterListBox().GetFill().Assign(this.FFilterAppearance.FFill);
            this.GetFilterListBox().GetStroke().Assign(this.FFilterAppearance.FStroke);
            this.GetFilterListBox().FDefaultItem.SetTextColor(this.FFilterAppearance.FFont.FColor);
            this.GetFilterListBox().FItemsAppearance.GetFont().Assign(this.FFilterAppearance.FFont);
          };
          this.GetFilterListBox().FItems.Clear$1();
          for (var $l1 = 0, $end1 = sl.GetCount() - 1; $l1 <= $end1; $l1++) {
            i = $l1;
            it = this.GetFilterListBox().FItems.Add$1();
            it.SetText(sl.Get(i));
            it.FDataObject = sl.GetObject(i);
          };
          this.GetFilterListBox().SetItemIndex(-1);
          this.GetFilterListBox().FTag$1 = AColumn;
          this.GetFilterListBox().CheckAll();
          fdt = pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilterType.gftEqual;
          cl = this.GetColumn(AColumn);
          if ((cl != null) && ($mod.TTMSFNCDataGridColumnSetting.gcsFilterDefaultType in cl.FSettings)) fdt = cl.FFilterDefaultType;
          this.GetFilterTypeComboBox().SetSafeItemIndex(fdt);
          this.GetFilterEdit().SetT("");
          e = null;
          if (this.GetHasFilterEditor(AColumn,this.GetOptions().FFiltering.FRow)) {
            e = this.GetFilterEditor(AColumn,this.GetOptions().FFiltering.FRow);
            if ((e != null) && $mod.TTMSFNCDataGridFilterPanel.isPrototypeOf(e)) rtl.as(e,$mod.TTMSFNCDataGridFilterPanel).Reset();
          };
          if (!this.FStyleApplied) {
            this.GetFilterEdit().SetColor(this.FFilterAppearance.FFill.FColor);
            this.GetFilterEdit().FFont.SetColor(this.FFilterAppearance.FFont.FColor);
          };
          if (this.GetFilter().HasFilter(AColumn)) {
            f = this.GetFilter().GetColumnFilter(AColumn);
            this.GetFilterEdit().SetT(f.FCondition);
            this.GetFilterTypeComboBox().SetSafeItemIndex(f.FType);
            if ((e != null) && $mod.TTMSFNCDataGridFilterPanel.isPrototypeOf(e)) rtl.as(e,$mod.TTMSFNCDataGridFilterPanel).SetFilter(f);
            fsl = pas.Classes.TStringList.$create("Create$1");
            try {
              fsl.SetQuoteChar("'");
              pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.Split("|",f.FCondition,fsl,false);
              b = false;
              for (var $l2 = 0, $end2 = this.GetFilterListBox().FItems.GetCount() - 1; $l2 <= $end2; $l2++) {
                i = $l2;
                s = this.GetFilterListBox().FItems.GetItem$1(i).FText;
                this.GetFilterListBox().SetChecked(i,false);
                if (s === this.GetOptions().FLocalization.FFilterAllText) continue;
                var $tmp1 = f.FType;
                if ($tmp1 === pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilterType.gftEmpty) {
                  this.GetFilterListBox().SetChecked(i,s === this.GetOptions().FLocalization.FFilterEmptyText)}
                 else if ($tmp1 === pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilterType.gftNotEmpty) {
                  this.GetFilterListBox().SetChecked(i,s === this.GetOptions().FLocalization.FFilterNotEmptyText)}
                 else if ($tmp1 === pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilterType.gftEqual) {
                  for (var $l3 = 0, $end3 = fsl.GetCount() - 1; $l3 <= $end3; $l3++) {
                    k = $l3;
                    fs = pas.SysUtils.Trim(fsl.Get(k));
                    obj = this.GetFilterListBox().FItems.GetItem$1(i).FDataObject;
                    if ((s === this.GetOptions().FLocalization.FFilterEmptyText) && (fs === '""')) {
                      this.GetFilterListBox().SetChecked(i,true);
                      break;
                    };
                    if ((obj != null) && pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilterItem.isPrototypeOf(obj) && rtl.as(obj,pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilterItem).FDoubleQuotes) {
                      sc = '"' + s + '"'}
                     else sc = s;
                    if (fs === sc) {
                      this.GetFilterListBox().SetChecked(i,true);
                      break;
                    };
                  };
                };
                if (!this.GetFilterListBox().GetChecked(i)) b = true;
              };
              for (var $l4 = 0, $end4 = this.GetFilterListBox().FItems.GetCount() - 1; $l4 <= $end4; $l4++) {
                i = $l4;
                if (this.GetFilterListBox().FItems.GetItem$1(i).FText === this.GetOptions().FLocalization.FFilterAllText) {
                  this.GetFilterListBox().SetChecked(i,!b);
                  break;
                };
              };
            } finally {
              fsl = rtl.freeLoc(fsl);
            };
          };
        } finally {
          this.GetFilterListBox().EndUpdate();
        };
      } finally {
        sl = rtl.freeLoc(sl);
      };
      this.FLoadFilter = false;
    };
    this.UpdateInplaceEditorPosition = function () {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if ((this.GetUpdateCount() > 0) || this.GetIsDestroying()) return;
      if (this.FInplaceEditor != null) {
        r.$assign(this.GetInplaceEditorRect(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FEditingCell)));
        this.FInplaceEditor.SetBoundsRect(pas["WEBLib.TMSFNCTypes"].ConvertToRect(r));
      };
    };
    this.UpdateScrollBars = function (AUpdate, ACalculate) {
      var vs = null;
      var hs = null;
      var vsc = null;
      var hsc = null;
      var w = 0.0;
      var h = 0.0;
      var ww = 0.0;
      var hh = 0.0;
      var cw = 0.0;
      var ch = 0.0;
      var cr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var vmgr = null;
      var hmgr = null;
      var lr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var p = null;
      if (this.FBlockScrollingUpdate || (this.GetUpdateCount() > 0) || this.GetIsDestroying()) return;
      this.FBlockScrollingUpdate = true;
      vs = this.GetVerticalScrollBar();
      hs = this.GetHorizontalScrollBar();
      vsc = this.GetCustomVerticalScrollBar();
      hsc = this.GetCustomHorizontalScrollBar();
      if (ACalculate) {
        this.UpdateAutoSizing();
        this.UpdateColumnRowCalculations();
      };
      if (AUpdate) {
        cr.$assign(this.GetCalculationRect())}
       else cr.$assign(this.GetContentRect());
      cw = cr.Right - cr.Left;
      ch = cr.Bottom - cr.Top;
      w = this.FTotalColumnWidth;
      h = this.FTotalRowHeight;
      lr.$assign(this.LocalRect());
      ww = lr.Right;
      hh = lr.Bottom;
      if (vs != null) vs.SetVisible((h > 0) && (pas["WEBLib.TMSFNCTypes"].CompareValueEx(h,ch,1) === 1) && this.FVerticalScrollBarVisible && !this.RowStretchingActive() && !this.HasCustomScrollBars() && !this.HasExternalScrollBars() && !this.FIsExporting && !this.FPaging);
      if (hs != null) hs.SetVisible((w > 0) && (pas["WEBLib.TMSFNCTypes"].CompareValueEx(w,cw,1) === 1) && this.FHorizontalScrollBarVisible && !this.ColumnStretchingActive() && !this.HasCustomScrollBars() && !this.HasExternalScrollBars() && !this.FIsExporting);
      if (vsc != null) vsc.SetVisible((h > 0) && (pas["WEBLib.TMSFNCTypes"].CompareValueEx(h,ch,1) === 1) && this.FVerticalScrollBarVisible && !this.RowStretchingActive() && this.HasCustomScrollBars() && !this.HasExternalScrollBars() && !this.FIsExporting && !this.FPaging);
      if (hsc != null) {
        if ((vsc != null) && vsc.FVisible && (((this.FHost != null) && $mod.TTMSFNCDataGridRenderer.isPrototypeOf(this.FHost)) || !(this.FHost != null))) {
          hsc.SetVisible((w > 0) && (pas["WEBLib.TMSFNCTypes"].CompareValueEx(w,cw - vsc.GetWidth(),1) === 1) && this.FHorizontalScrollBarVisible && !this.ColumnStretchingActive() && this.HasCustomScrollBars() && !this.HasExternalScrollBars() && !this.FIsExporting)}
         else hsc.SetVisible((w > 0) && (pas["WEBLib.TMSFNCTypes"].CompareValueEx(w,cw,1) === 1) && this.FHorizontalScrollBarVisible && !this.ColumnStretchingActive() && this.HasCustomScrollBars() && !this.HasExternalScrollBars() && !this.FIsExporting);
      };
      if (this.HasValidHost()) {
        p = rtl.as(this.FHost,pas["WEBLib.Controls"].TWinControl);
        if (vsc != null) {
          if (vsc.FVisible && this.HasCustomScrollBars()) {
            vsc.SetParent(p)}
           else vsc.SetParent(null);
        };
        if (hsc != null) {
          if (hsc.FVisible && this.HasCustomScrollBars()) {
            hsc.SetParent(p)}
           else hsc.SetParent(null);
        };
        if (vs != null) {
          if (vs.FVisible && !this.HasCustomScrollBars()) {
            vs.SetParent(p)}
           else vs.SetParent(null);
        };
        if (hs != null) {
          if (hs.FVisible && !this.HasCustomScrollBars()) {
            hs.SetParent(p)}
           else hs.SetParent(null);
        };
      };
      vmgr = pas["WEBLib.TMSFNCTypes"].TTMSFNCMargins.$create("Create$1");
      hmgr = pas["WEBLib.TMSFNCTypes"].TTMSFNCMargins.$create("Create$1");
      if (this.HasCustomScrollBars()) {
        if ((vsc != null) && vsc.FVisible) hmgr.SetRight(vsc.GetWidth() + 1);
      } else {
        if ((vs != null) && vs.FVisible) {
          hmgr.SetRight(vs.GetWidth() + 1 + 1)}
         else hmgr.SetRight(1 + 1);
      };
      vmgr.SetTop(1);
      if (this.HasCustomScrollBars()) {
        vmgr.SetRight(1);
        hmgr.SetBottom(1);
      } else {
        vmgr.SetRight(1 + 1);
        hmgr.SetBottom(1 + 1);
      };
      hmgr.SetLeft(1);
      if (this.HasCustomScrollBars()) {
        if ((hsc != null) && hsc.FVisible) vmgr.SetBottom(hsc.GetHeight() + 1);
      } else {
        if ((hs != null) && hs.FVisible) {
          vmgr.SetBottom(hs.GetHeight() + 1 + 1)}
         else vmgr.SetBottom(1 + 1);
      };
      vmgr.SetTop(vmgr.FTop + this.LocalRect().Top);
      hmgr.SetLeft(hmgr.FLeft + this.LocalRect().Left);
      if (!this.FStretchScrollBars) {
        hmgr.SetLeft(hmgr.FLeft + this.FTotalFixedColumnWidth);
        hmgr.SetRight(hmgr.FRight + this.FTotalFixedRightColumnWidth);
        vmgr.SetTop(vmgr.FTop + this.FTotalFixedRowHeight);
        vmgr.SetBottom(vmgr.FBottom + this.FTotalFixedBottomRowHeight);
      };
      if ((hs != null) && (vs != null)) {
        hs.SetLeft(Math.round(hmgr.FLeft));
        hs.SetTop(Math.round(hh - hmgr.FBottom - hs.GetHeight()));
        vs.SetLeft(Math.round(ww - vmgr.FRight - vs.GetWidth()));
        vs.SetTop(Math.round(vmgr.FTop));
        hs.SetWidth(Math.round(Math.max(0,ww - hmgr.FRight - hmgr.FLeft)));
        vs.SetHeight(Math.round(Math.max(0,hh - vmgr.FBottom - vmgr.FTop)));
      };
      if ((hsc != null) && (vsc != null)) {
        hsc.SetLeft(Math.round(hmgr.FLeft));
        hsc.SetTop(Math.round(hh - hmgr.FBottom - hsc.GetHeight()));
        vsc.SetLeft(Math.round(ww - vmgr.FRight - vsc.GetWidth()));
        vsc.SetTop(Math.round(vmgr.FTop));
        hsc.SetWidth(Math.round(Math.max(0,ww - hmgr.FRight - hmgr.FLeft)));
        vsc.SetHeight(Math.round(Math.max(0,hh - vmgr.FBottom - vmgr.FTop)));
      };
      hmgr = rtl.freeLoc(hmgr);
      vmgr = rtl.freeLoc(vmgr);
      cr.$assign(this.GetContentRect());
      cw = cr.Right - cr.Left;
      ch = cr.Bottom - cr.Top;
      if (vs != null) {
        if (this.GetVerticalScrollMode() === $mod.TTMSFNCDataGridScrollMode.gsmCellScrolling) {
          vs.SetPageSize(Math.round(Math.max(0,this.GetRowViewPortSize())));
          if (this.FPaging) {
            vs.SetMax(Math.max(vs.GetPageSize(),this.FRowCount + vs.GetPageSize()))}
           else vs.SetMax(Math.max(vs.GetPageSize(),this.FRowCount));
          vs.FSmallChange = 1;
        } else {
          vs.SetPageSize(Math.round(Math.max(0,Math.min(h,ch))));
          vs.SetMax(Math.round(Math.max(0,h)));
          vs.FSmallChange = Math.round(this.FDefaultRowHeight);
        };
        vs.FLargeChange = Math.min(2147483647,Math.max(1,vs.GetPageSize()));
        vs.SetPosition(Math.min(vs.GetPosition(),vs.FMax));
      };
      if (hs != null) {
        if (this.GetHorizontalScrollMode() === $mod.TTMSFNCDataGridScrollMode.gsmCellScrolling) {
          hs.SetPageSize(Math.round(Math.max(0,this.GetColumnViewPortSize())));
          hs.SetMax(Math.max(hs.GetPageSize(),this.FColumnCount));
          hs.FSmallChange = 1;
        } else {
          hs.SetPageSize(Math.round(Math.max(0,Math.min(w,cw))));
          hs.SetMax(Math.round(Math.max(0,w)));
          hs.FSmallChange = Math.round(this.FDefaultColumnWidth);
        };
        hs.FLargeChange = Math.min(2147483647,Math.max(1,hs.GetPageSize()));
        hs.SetPosition(Math.min(hs.GetPosition(),hs.FMax));
      };
      if (vsc != null) {
        if (this.GetVerticalScrollMode() === $mod.TTMSFNCDataGridScrollMode.gsmCellScrolling) {
          vsc.SetPageSize(this.GetRowViewPortSize());
          if (this.FPaging) {
            vsc.SetMax(this.FRowCount + vsc.FPageSize)}
           else vsc.SetMax(this.FRowCount);
          vsc.FSmallChange = 1;
        } else {
          vsc.SetPageSize(Math.min(h,ch));
          vsc.SetMax(h);
          vsc.FSmallChange = Math.round(this.FDefaultRowHeight);
        };
        vsc.FLargeChange = Math.max(1,vsc.FPageSize);
        vsc.SetValue(Math.min(vsc.FValue,vsc.FMax - vsc.FPageSize));
      };
      if (hsc != null) {
        if (this.GetHorizontalScrollMode() === $mod.TTMSFNCDataGridScrollMode.gsmCellScrolling) {
          hsc.SetPageSize(this.GetColumnViewPortSize());
          hsc.SetMax(this.FColumnCount);
          hsc.FSmallChange = 1;
        } else {
          hsc.SetPageSize(Math.min(w,cw));
          hsc.SetMax(w);
          hsc.FSmallChange = Math.round(this.FDefaultColumnWidth);
        };
        hsc.FLargeChange = Math.max(1,hsc.FPageSize);
        hsc.SetValue(Math.min(hsc.FValue,hsc.FMax - hsc.FPageSize));
      };
      if (this.FExternalVerticalScrollBar != null) {
        if (this.GetVerticalScrollMode() === $mod.TTMSFNCDataGridScrollMode.gsmCellScrolling) {
          this.FExternalVerticalScrollBar.SetPageSize(this.GetRowViewPortSize());
          if (this.FPaging) {
            this.FExternalVerticalScrollBar.SetMax(this.FRowCount + this.FExternalVerticalScrollBar.GetPageSize())}
           else this.FExternalVerticalScrollBar.SetMax(this.FRowCount);
          this.FExternalVerticalScrollBar.SetSmallChange(1);
        } else {
          this.FExternalVerticalScrollBar.SetPageSize(Math.min(h,ch));
          this.FExternalVerticalScrollBar.SetMax(h);
          this.FExternalVerticalScrollBar.SetSmallChange(Math.round(this.FDefaultRowHeight));
        };
        this.FExternalVerticalScrollBar.SetLargeChange(Math.max(1,this.FExternalVerticalScrollBar.GetPageSize()));
        this.FExternalVerticalScrollBar.SetValue(Math.min(this.FExternalVerticalScrollBar.GetValue(),this.FExternalVerticalScrollBar.GetMax() - this.FExternalVerticalScrollBar.GetPageSize()));
        this.FExternalVerticalScrollBar.SetIsVisible((h > 0) && (pas["WEBLib.TMSFNCTypes"].CompareValueEx(h,ch,1) === 1) && this.FVerticalScrollBarVisible && !this.RowStretchingActive() && !this.FIsExporting && !this.FPaging);
      };
      if (this.FExternalHorizontalScrollBar != null) {
        if (this.GetHorizontalScrollMode() === $mod.TTMSFNCDataGridScrollMode.gsmCellScrolling) {
          this.FExternalHorizontalScrollBar.SetPageSize(this.GetColumnViewPortSize());
          this.FExternalHorizontalScrollBar.SetMax(this.FColumnCount);
          this.FExternalHorizontalScrollBar.SetSmallChange(1);
        } else {
          this.FExternalHorizontalScrollBar.SetPageSize(Math.min(w,cw));
          this.FExternalHorizontalScrollBar.SetMax(w);
          this.FExternalHorizontalScrollBar.SetSmallChange(Math.round(this.FDefaultColumnWidth));
        };
        this.FExternalHorizontalScrollBar.SetLargeChange(Math.max(1,this.FExternalHorizontalScrollBar.GetPageSize()));
        this.FExternalHorizontalScrollBar.SetValue(Math.min(this.FExternalHorizontalScrollBar.GetValue(),this.FExternalHorizontalScrollBar.GetMax() - this.FExternalHorizontalScrollBar.GetPageSize()));
        this.FExternalHorizontalScrollBar.SetIsVisible((w > 0) && (pas["WEBLib.TMSFNCTypes"].CompareValueEx(w,cw,1) === 1) && this.FHorizontalScrollBarVisible && !this.ColumnStretchingActive() && !this.FIsExporting);
      };
      this.FBlockScrollingUpdate = false;
      if (AUpdate) this.UpdateScrollBars(false,true);
    };
    this.VCustomScrollChanged = function (Sender, AValue) {
      if (this.FBlockScrollingUpdate || !this.HasCustomScrollBars()) return;
      if (!this.FIsMouseDown) this.StopAnimationTimer();
      this.VerticalScrollPositionChanged();
      this.SetVScrollValue(this.GetVScrollValue());
    };
    this.VerticalScrollPositionChanged = function () {
      this.FBlockScrollingUpdate = true;
      this.Update();
      this.FBlockScrollingUpdate = false;
      this.DoVScroll(this.GetVScrollValue());
      if ((this.FAdapter != null) && $mod.TTMSFNCDataGridRendererDataAdapter.isPrototypeOf(this.FAdapter)) rtl.as(this.FAdapter,$mod.TTMSFNCDataGridRendererDataAdapter).Scroll();
    };
    this.VScrollChanged = function (Sender) {
      if (this.FBlockScrollingUpdate || this.HasCustomScrollBars()) return;
      if (!this.FIsMouseDown) this.StopAnimationTimer();
      this.VerticalScrollPositionChanged();
      this.SetVScrollValue(this.GetVScrollValue());
    };
    this.WidthChanged = function (AColumn) {
      var cl = null;
      pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCore.WidthChanged.apply(this,arguments);
      cl = this.GetColumn(AColumn);
      if (cl != null) cl.FWidth = this.GetColumnWidth(AColumn);
    };
    this.VisibilityChanged = function (AColumn) {
      var cl = null;
      pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCore.VisibilityChanged.apply(this,arguments);
      cl = this.GetColumn(AColumn);
      if (cl != null) cl.FVisible = !this.GetHiddenColumn(AColumn);
    };
    this.Create$3 = function (AHost) {
      var p = null;
      this.FHost = AHost;
      pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridData.Create$1.call(this,AHost);
      if ((AHost != null) && pas.Classes.TPersistent.isPrototypeOf(AHost)) {
        this.FColumns = this.GetColumnsClass().$create("Create$3",[rtl.as(AHost,pas.Classes.TPersistent),this])}
       else this.FColumns = this.GetColumnsClass().$create("Create$3",[null,this]);
      this.FColumns.FOnChange = rtl.createCallback(this,"DoColumnsChanged");
      this.FScale = 1.0;
      this.FDragCell.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(-1,-1));
      this.FDragCellTo.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(-1,-1));
      this.FDisjunctAnchorCell.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(-1,-1));
      this.FBlockFocusedCell = 0;
      this.FAutoFillState = $mod.TTMSFNCDataGridAutoFillState.gafsNone;
      this.FAutoFillStart.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(-1,-1));
      this.FAutoFillEnd.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(-1,-1));
      this.FAutoFillPreviewRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,0,0));
      this.FSelection.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCellRange(-1,-1,-1,-1));
      this.FStretchScrollBars = false;
      this.FScrollMode = $mod.TTMSFNCDataGridScrollMode.gsmPixelScrolling;
      this.FScrollUpdate = $mod.TTMSFNCDataGridScrollUpdate.gsuContinuous;
      this.FCustomScrollBars = false;
      this.FFilterEditMode = $mod.TTMSFNCDataGridFilterEditMode.gfemList;
      this.FPaging = false;
      this.FPadding = pas["WEBLib.TMSFNCTypes"].TTMSFNCMargins.$create("Create$1");
      this.FPadding.FOnChange = rtl.createCallback(this,"PaddingChanged");
      this.FVerticalScrollBarVisible = true;
      this.FHorizontalScrollBarVisible = true;
      this.FEditingCell.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(-1,-1));
      this.FFocusedCell.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(-1,-1));
      this.FFirstCell.$assign(this.FFocusedCell);
      this.FRealCell.$assign(this.FFocusedCell);
      this.FSaveCell.$assign(this.FFocusedCell);
      this.GetOptions().FOnChange = rtl.createCallback(this,"OptionsChanged");
      this.GetOptions().FOnChangeRebuild = rtl.createCallback(this,"OptionsChangedRebuild");
      this.GetOptions().FOnFilterRowChanged = rtl.createCallback(this,"OptionsFilterRowChanged");
      this.FStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,12632256,1.0]);
      this.FMergedCells = pas["Generics.Collections"].TList$$$G$$generics$collections$$TTMSFNCDataGridCellCoord.$create("Create$1");
      this.FNormalCellList = $mod.TTMSFNCDataGridNormalCellList.$create("Create$4",[true]);
      this.FNormalCellDisplay = $mod.TTMSFNCDataGridNormalCellDisplayList.$create("Create$1");
      this.FFixedColumnCellList = $mod.TTMSFNCDataGridFixedColumnCellList.$create("Create$4",[true]);
      this.FFixedColumnCellDisplay = $mod.TTMSFNCDataGridFixedColumnCellDisplayList.$create("Create$1");
      this.FFixedRowCellList = $mod.TTMSFNCDataGridFixedRowCellList.$create("Create$4",[true]);
      this.FFixedRowCellDisplay = $mod.TTMSFNCDataGridFixedRowCellDisplayList.$create("Create$1");
      this.FFixedRootCellList = $mod.TTMSFNCDataGridFixedRootCellList.$create("Create$4",[true]);
      this.FFixedRootCellDisplay = $mod.TTMSFNCDataGridFixedRootCellDisplayList.$create("Create$1");
      this.FCellAppearance = $mod.TTMSFNCDataGridCellAppearance.$create("Create$1");
      this.FCellAppearance.FOnChange = rtl.createCallback(this,"CellAppearanceChanged");
      this.FIcons = $mod.TTMSFNCDataGridIcons.$create("Create$1");
      this.FIcons.FOnChange = rtl.createCallback(this,"IconsChanged");
      this.FStyleApplied = false;
      this.FFilterAppearance = $mod.TTMSFNCDataGridFilterAppearance.$create("Create$1");
      this.FDragAppearance = $mod.TTMSFNCDataGridDragAppearance.$create("Create$1");
      this.FAutoFillAppearance = $mod.TTMSFNCDataGridAutoFillAppearance.$create("Create$1");
      this.FGlobalFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCAppearanceGlobalFont.$create("Create$1",[this]);
      p = null;
      if ((AHost != null) && pas["WEBLib.Controls"].TWinControl.isPrototypeOf(AHost)) {
        p = rtl.as(AHost,pas["WEBLib.Controls"].TWinControl);
        this.FVerticalScrollBar = pas["WEBLib.StdCtrls"].TScrollBar.$create("Create$1",[p]);
        this.FVerticalScrollBar.SetParent(p);
        this.FVerticalScrollBar.SetTabStop(false);
        this.FHorizontalScrollBar = pas["WEBLib.StdCtrls"].TScrollBar.$create("Create$1",[p]);
        this.FHorizontalScrollBar.SetParent(p);
        this.FHorizontalScrollBar.SetTabStop(false);
        this.FVerticalScrollBar.FDoubleBuffered = false;
        this.FHorizontalScrollBar.FDoubleBuffered = false;
        this.FVerticalScrollBar.SetKind(pas["WEBLib.Controls"].TScrollBarKind.sbVertical);
        this.FVerticalScrollBar.FOnChange = rtl.createCallback(this,"VScrollChanged");
        this.FHorizontalScrollBar.FOnChange = rtl.createCallback(this,"HScrollChanged");
      };
      this.FCustomVerticalScrollBar = $mod.TTMSFNCDataGridScrollBar.$create("Create$1",[p]);
      this.FCustomVerticalScrollBar.SetParent(p);
      this.FCustomVerticalScrollBar.SetTabStop(false);
      this.FCustomHorizontalScrollBar = $mod.TTMSFNCDataGridScrollBar.$create("Create$1",[p]);
      this.FCustomHorizontalScrollBar.SetParent(p);
      this.FCustomHorizontalScrollBar.SetTabStop(false);
      this.GetCustomVerticalScrollBar().FStroke.SetColor(this.FStroke.FColor);
      this.GetCustomVerticalScrollBar().FAppearance.FThumbStroke.SetColor(this.FStroke.FColor);
      this.GetCustomVerticalScrollBar().FAppearance.FScrollButtonLeftStroke.SetColor(this.FStroke.FColor);
      this.GetCustomVerticalScrollBar().FAppearance.FScrollButtonRightStroke.SetColor(this.FStroke.FColor);
      this.GetCustomVerticalScrollBar().FAppearance.FThumbButtonLeftStroke.SetColor(this.FStroke.FColor);
      this.GetCustomVerticalScrollBar().FAppearance.FThumbButtonRightStroke.SetColor(this.FStroke.FColor);
      this.GetCustomHorizontalScrollBar().FAppearance.Assign(this.GetCustomVerticalScrollBar().FAppearance);
      this.FCustomVerticalScrollBar.FAppearance.SetThumbButtonSize(0);
      this.FCustomHorizontalScrollBar.FAppearance.SetThumbButtonSize(0);
      this.FCustomHorizontalScrollBar.SetKind(pas["WEBLib.TMSFNCScrollBar"].TTMSFNCScrollBarKind.sbkHorizontal);
      this.FCustomVerticalScrollBar.SetVisible(false);
      this.FCustomHorizontalScrollBar.SetVisible(false);
      this.FCustomHorizontalScrollBar.FOnValueChange = rtl.createCallback(this,"HCustomScrollChanged");
      this.FCustomVerticalScrollBar.FOnValueChange = rtl.createCallback(this,"VCustomScrollChanged");
      if (AHost != null) {
        if ($mod.TTMSFNCDataGridRenderer.isPrototypeOf(AHost)) {
          this.FOnDisplay = rtl.createCallback(rtl.as(AHost,$mod.TTMSFNCDataGridRenderer),"DoDisplayGrid");
          this.FOnFocus = rtl.createCallback(rtl.as(AHost,$mod.TTMSFNCDataGridRenderer),"DoFocusGrid");
          this.FOnResetCapture = rtl.createCallback(rtl.as(AHost,$mod.TTMSFNCDataGridRenderer),"DoResetCapture");
          this.FOnAfterCalculate = rtl.createCallback(rtl.as(AHost,$mod.TTMSFNCDataGridRenderer),"DoAfterCalculateGrid");
          this.FOnBeforeCalculate = rtl.createCallback(rtl.as(AHost,$mod.TTMSFNCDataGridRenderer),"DoBeforeCalculateGrid");
          this.FOnUpdateCursor = rtl.createCallback(rtl.as(AHost,$mod.TTMSFNCDataGridRenderer),"DoUpdateCursorGrid");
          this.FOnIsDestroying = rtl.createCallback(rtl.as(AHost,$mod.TTMSFNCDataGridRenderer),"DoIsDestroyingGrid");
          this.FOnIsLoading = rtl.createCallback(rtl.as(AHost,$mod.TTMSFNCDataGridRenderer),"DoIsLoadingGrid");
          this.FOnIsDesigntime = rtl.createCallback(rtl.as(AHost,$mod.TTMSFNCDataGridRenderer),"DoIsDesigntimeGrid");
          this.FOnIsFocused = rtl.createCallback(rtl.as(AHost,$mod.TTMSFNCDataGridRenderer),"DoIsFocusedGrid");
        } else if (pas["WEBLib.TMSFNCDataGridBase"].TTMSFNCDataGridBase.isPrototypeOf(AHost)) {
          this.FOnDisplay = rtl.createCallback(rtl.as(AHost,pas["WEBLib.TMSFNCDataGridBase"].TTMSFNCDataGridBase),"DoRootDisplay");
          this.FOnFocus = rtl.createCallback(rtl.as(AHost,pas["WEBLib.TMSFNCDataGridBase"].TTMSFNCDataGridBase),"DoRootFocus");
          this.FOnResetCapture = rtl.createCallback(rtl.as(AHost,pas["WEBLib.TMSFNCDataGridBase"].TTMSFNCDataGridBase),"DoRootResetCapture");
          this.FOnAfterCalculate = rtl.createCallback(rtl.as(AHost,pas["WEBLib.TMSFNCDataGridBase"].TTMSFNCDataGridBase),"DoRootAfterCalculate");
          this.FOnBeforeCalculate = rtl.createCallback(rtl.as(AHost,pas["WEBLib.TMSFNCDataGridBase"].TTMSFNCDataGridBase),"DoRootBeforeCalculate");
          this.FOnUpdateCursor = rtl.createCallback(rtl.as(AHost,pas["WEBLib.TMSFNCDataGridBase"].TTMSFNCDataGridBase),"DoRootUpdateCursor");
          this.FOnIsDestroying = rtl.createCallback(rtl.as(AHost,pas["WEBLib.TMSFNCDataGridBase"].TTMSFNCDataGridBase),"DoRootIsDestroying");
          this.FOnIsLoading = rtl.createCallback(rtl.as(AHost,pas["WEBLib.TMSFNCDataGridBase"].TTMSFNCDataGridBase),"DoRootIsLoading");
          this.FOnIsDesigntime = rtl.createCallback(rtl.as(AHost,pas["WEBLib.TMSFNCDataGridBase"].TTMSFNCDataGridBase),"DoRootIsDesigntime");
          this.FOnIsFocused = rtl.createCallback(rtl.as(AHost,pas["WEBLib.TMSFNCDataGridBase"].TTMSFNCDataGridBase),"DoRootIsFocused");
        };
      };
      return this;
    };
    this.Destroy = function () {
      this.FHost = null;
      rtl.free(this,"FColumns");
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FCellLayout;
        }, set: function (v) {
          this.p.FCellLayout = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FColumnsEditor;
        }, set: function (v) {
          this.p.FColumnsEditor = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FFilterDialog;
        }, set: function (v) {
          this.p.FFilterDialog = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FFindDialog;
        }, set: function (v) {
          this.p.FFindDialog = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FReplaceDialog;
        }, set: function (v) {
          this.p.FReplaceDialog = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FInplaceEditor;
        }, set: function (v) {
          this.p.FInplaceEditor = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FFilterTimer;
        }, set: function (v) {
          this.p.FFilterTimer = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FFilterExitTimer;
        }, set: function (v) {
          this.p.FFilterExitTimer = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FScrollTimer;
        }, set: function (v) {
          this.p.FScrollTimer = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FAnimateTimer;
        }, set: function (v) {
          this.p.FAnimateTimer = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FDragTimer;
        }, set: function (v) {
          this.p.FDragTimer = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FLookupTimer;
        }, set: function (v) {
          this.p.FLookupTimer = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FFilterTypeComboBox;
        }, set: function (v) {
          this.p.FFilterTypeComboBox = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FFilterListBox;
        }, set: function (v) {
          this.p.FFilterListBox = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FFilterEdit;
        }, set: function (v) {
          this.p.FFilterEdit = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FFilterClearButton;
        }, set: function (v) {
          this.p.FFilterClearButton = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FFilterSortAscendingButton;
        }, set: function (v) {
          this.p.FFilterSortAscendingButton = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FFilterSortDescendingButton;
        }, set: function (v) {
          this.p.FFilterSortDescendingButton = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FFilterContainer;
        }, set: function (v) {
          this.p.FFilterContainer = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FFilterPopup;
        }, set: function (v) {
          this.p.FFilterPopup = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FCommentPopup;
        }, set: function (v) {
          this.p.FCommentPopup = v;
        }});
      rtl.free(this,"FFilterAppearance");
      rtl.free(this,"FDragAppearance");
      rtl.free(this,"FAutoFillAppearance");
      rtl.free(this,"FPadding");
      rtl.free(this,"FStroke");
      rtl.free(this,"FGlobalFont");
      rtl.free(this,"FCellAppearance");
      rtl.free(this,"FIcons");
      rtl.free(this,"FNormalCellDisplay");
      rtl.free(this,"FNormalCellList");
      rtl.free(this,"FMergedCells");
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FSelectedCellDictionary;
        }, set: function (v) {
          this.p.FSelectedCellDictionary = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FSelectedColumnDictionary;
        }, set: function (v) {
          this.p.FSelectedColumnDictionary = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FSelectedRowDictionary;
        }, set: function (v) {
          this.p.FSelectedRowDictionary = v;
        }});
      rtl.free(this,"FFixedRowCellDisplay");
      rtl.free(this,"FFixedRowCellList");
      rtl.free(this,"FFixedRootCellDisplay");
      rtl.free(this,"FFixedRootCellList");
      rtl.free(this,"FFixedColumnCellDisplay");
      rtl.free(this,"FFixedColumnCellList");
      if (this.FCustomVerticalScrollBar != null) rtl.free(this,"FCustomVerticalScrollBar");
      if (this.FCustomHorizontalScrollBar != null) rtl.free(this,"FCustomHorizontalScrollBar");
      if (this.FVerticalScrollBar != null) rtl.free(this,"FVerticalScrollBar");
      if (this.FHorizontalScrollBar != null) rtl.free(this,"FHorizontalScrollBar");
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FControlWrapperList;
        }, set: function (v) {
          this.p.FControlWrapperList = v;
        }});
      pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridData.Destroy.call(this);
    };
    this.AddGrid = function (ACell) {
      var Result = null;
      Result = this.SetGrid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
      return Result;
    };
    this.AddGrid$1 = function (AColumn, ARow) {
      var Result = null;
      Result = this.SetGrid$1(AColumn,ARow);
      return Result;
    };
    this.CancelEditing = function (AFocusGrid) {
      var Result = false;
      Result = true;
      if (this.FInplaceEditorActive) Result = this.CloseInplaceEditor(true,false,false,AFocusGrid);
      return Result;
    };
    this.CanRegisterRuntimeClasses = function () {
      var Result = false;
      Result = true;
      if ((this.FHost != null) && pas.Classes.TComponent.isPrototypeOf(this.FHost)) Result = !(pas.Classes.TComponentStateItem.csDesigning in rtl.as(this.FHost,pas.Classes.TComponent).FComponentState);
      return Result;
    };
    this.ColumnByHeader = function (AHeader) {
      var Result = null;
      Result = this.FColumns.ColumnByHeader(AHeader);
      return Result;
    };
    this.ColumnByName = function (AName) {
      var Result = null;
      Result = this.FColumns.ColumnByName(AName);
      return Result;
    };
    this.ColumnIndexByHeader = function (AHeader) {
      var Result = 0;
      var c = null;
      Result = -1;
      c = this.ColumnByHeader(AHeader);
      if (c != null) Result = c.GetIndex();
      return Result;
    };
    this.ColumnIndexByName = function (AName) {
      var Result = 0;
      var c = null;
      Result = -1;
      c = this.ColumnByName(AName);
      if (c != null) Result = c.GetIndex();
      return Result;
    };
    this.CreateCell = function (ARect, ACell) {
      var Result = null;
      Result = this.CreateCell$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),ACell.GetColumn(),ACell.GetRow());
      return Result;
    };
    this.CreateCell$1 = function (ARect, AColumn, ARow) {
      var Result = null;
      var cls = null;
      var ck = 0;
      var d = null;
      Result = null;
      cls = this.GetBaseCellClass(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow)));
      this.DoGetCellClass(AColumn,ARow,{get: function () {
          return cls;
        }, set: function (v) {
          cls = v;
        }});
      if (cls != null) {
        ck = this.GetCellKind(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,ARow)));
        d = this.GetCellData(AColumn,ARow);
        Result = cls.$create("Create$1",[pas["WEBLib.TMSFNCTypes"].TRectF.$clone(ARect),AColumn,ARow,d,ck,this]);
      };
      return Result;
    };
    this.GetCellObjectForCell = function (ACell) {
      var Result = null;
      Result = null;
      if ((ACell.GetColumn() === -1) || (ACell.GetRow() === -1)) return Result;
      var $tmp = this.GetCellKind(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
      if ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckCell) {
        Result = this.FNormalCellList.GetItemForCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell))}
       else if (($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFreezeFixedRowCell) || ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFreezeFixedColumnCell) || ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFreezeRootCell) || ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFixedRootCell)) {
        Result = this.FFixedRootCellList.GetItemForCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell))}
       else if (($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFreezeRowCell) || ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFixedRowCell)) {
        Result = this.FFixedRowCellList.GetItemForCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell))}
       else if (($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFreezeColumnCell) || ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFixedColumnCell)) Result = this.FFixedColumnCellList.GetItemForCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
      return Result;
    };
    this.GetFilterTypeName = function (AType) {
      var Result = "";
      var $tmp = AType;
      if ($tmp === pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilterType.gftEmpty) {
        Result = this.GetOptions().FLocalization.FFilterTypeEmptyText}
       else if ($tmp === pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilterType.gftNotEmpty) {
        Result = this.GetOptions().FLocalization.FFilterTypeNotEmptyText}
       else if ($tmp === pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilterType.gftStartsWith) {
        Result = this.GetOptions().FLocalization.FFilterTypeStartsWithText}
       else if ($tmp === pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilterType.gftEndsWith) {
        Result = this.GetOptions().FLocalization.FFilterTypeEndsWithText}
       else if ($tmp === pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilterType.gftContains) {
        Result = this.GetOptions().FLocalization.FFilterTypeContainsText}
       else if ($tmp === pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilterType.gftNotContains) {
        Result = this.GetOptions().FLocalization.FFilterTypeNotContainsText}
       else if ($tmp === pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilterType.gftEqual) {
        Result = this.GetOptions().FLocalization.FFilterTypeEqualText}
       else if ($tmp === pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilterType.gftNotEqual) {
        Result = this.GetOptions().FLocalization.FFilterTypeNotEqualText}
       else if ($tmp === pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilterType.gftLargerThan) {
        Result = this.GetOptions().FLocalization.FFilterTypeLargerThanText}
       else if ($tmp === pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilterType.gftSmallerThan) {
        Result = this.GetOptions().FLocalization.FFilterTypeSmallerThanText}
       else if ($tmp === pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilterType.gftLargerOrEqualThan) {
        Result = this.GetOptions().FLocalization.FFilterTypeLargerOrEqualThanText}
       else if ($tmp === pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFilterType.gftSmallerOrEqualThan) Result = this.GetOptions().FLocalization.FFilterTypeSmallerOrEqualThanText;
      return Result;
    };
    this.GetPageIndexForRow = function (ARow) {
      var Result = 0;
      var PageSize = 0;
      var AdjustedRow = 0;
      PageSize = this.GetPageScrollSize();
      if ((PageSize > 0) && (this.FRowCount > 0)) {
        AdjustedRow = ARow - this.FFixedRowCount - this.FFreezeRowCount;
        if (AdjustedRow < 0) {
          Result = 0}
         else Result = rtl.trunc(AdjustedRow / PageSize);
        if (Result >= this.GetPageCount()) Result = this.GetPageCount() - 1;
        if (Result < 0) Result = 0;
      } else Result = 0;
      return Result;
    };
    this.GetRowForPageIndex = function (APageIndex) {
      var Result = 0;
      var PageSize = 0;
      var FirstRow = 0;
      var MaxTop = 0;
      Result = -1;
      if (this.GetPageCount() === 0) return Result;
      APageIndex = pas.Math.EnsureRange(APageIndex,0,this.GetPageCount() - 1);
      PageSize = this.GetPageScrollSize();
      FirstRow = this.FFixedRowCount + this.FFreezeRowCount + (APageIndex * PageSize);
      MaxTop = this.FRowCount - this.FFixedBottomRowCount - 1;
      if (FirstRow > MaxTop) FirstRow = MaxTop;
      Result = FirstRow;
      return Result;
    };
    this.GetPageScrollSize = function () {
      var Result = 0;
      Result = Math.round(this.GetVViewPortSize()) - this.FFixedRowCount - this.FFreezeRowCount;
      if (Result <= 0) Result = this.GetVisibleRowCount() - this.FFixedRowCount - this.FFreezeRowCount - this.FFixedBottomRowCount;
      return Result;
    };
    this.GetPageScrollSizeByPageIndex = function (AIndex) {
      var Result = 0;
      var PageSize = 0;
      var ScrollableRows = 0;
      var PageCount = 0;
      var StartRow = 0;
      var RemainingRows = 0;
      PageSize = this.GetPageScrollSize();
      ScrollableRows = this.FRowCount - this.FFixedRowCount - this.FFreezeRowCount - this.FFixedBottomRowCount;
      if ((PageSize <= 0) || (ScrollableRows <= 0)) return 0;
      PageCount = rtl.trunc(((ScrollableRows + PageSize) - 1) / PageSize);
      if (AIndex < 0) {
        AIndex = 0}
       else if (AIndex >= PageCount) AIndex = PageCount - 1;
      StartRow = AIndex * PageSize;
      RemainingRows = ScrollableRows - StartRow;
      if (RemainingRows < PageSize) {
        Result = RemainingRows}
       else Result = PageSize;
      return Result;
    };
    this.GetHMax = function () {
      var Result = 0.0;
      Result = 0;
      if (this.HasCustomScrollBars() && (this.GetCustomHorizontalScrollBar() != null)) {
        Result = this.GetCustomHorizontalScrollBar().FMax}
       else if (this.GetHorizontalScrollBar() != null) Result = this.GetHorizontalScrollBar().FMax;
      return Result;
    };
    this.GetHScrollValue = function () {
      var Result = 0.0;
      Result = this.FLocalHScrollValue;
      if (this.HasExternalScrollBars() && (this.FExternalHorizontalScrollBar != null)) {
        Result = Math.min(this.FExternalHorizontalScrollBar.GetMax() - this.FExternalHorizontalScrollBar.GetPageSize(),Math.max(0,this.FExternalHorizontalScrollBar.GetValue()))}
       else if (this.HasCustomScrollBars() && (this.GetCustomHorizontalScrollBar() != null)) {
        Result = Math.min(this.GetCustomHorizontalScrollBar().FMax - this.GetCustomHorizontalScrollBar().FPageSize,Math.max(0,this.GetCustomHorizontalScrollBar().FValue))}
       else if (this.GetHorizontalScrollBar() != null) {
        Result = Math.min(this.GetHorizontalScrollBar().FMax - this.GetHorizontalScrollBar().GetPageSize(),Math.max(0,Math.round(this.GetHorizontalScrollBar().GetPosition())));
      };
      return Result;
    };
    this.GetHViewPortSize = function () {
      var Result = 0.0;
      Result = 0;
      if (this.HasCustomScrollBars() && (this.GetCustomHorizontalScrollBar() != null)) {
        Result = this.GetCustomHorizontalScrollBar().FPageSize}
       else if (this.GetHorizontalScrollBar() != null) {
        Result = this.GetHorizontalScrollBar().GetPageSize();
      };
      return Result;
    };
    this.GetIsDestroying = function () {
      var Result = false;
      Result = false;
      if (this.FOnIsDestroying != null) Result = this.FOnIsDestroying(this);
      return Result;
    };
    this.GetIsLoading = function () {
      var Result = false;
      Result = false;
      if (this.FOnIsLoading != null) Result = this.FOnIsLoading(this);
      return Result;
    };
    this.GetParentHost = function () {
      var Result = null;
      var h = null;
      Result = null;
      h = this.FHost;
      if (pas["WEBLib.Controls"].TWinControl.isPrototypeOf(h)) {
        Result = rtl.as(h,pas["WEBLib.Controls"].TWinControl);
        return Result;
      };
      while ((h != null) && !pas["WEBLib.Controls"].TWinControl.isPrototypeOf(h)) {
        if ($mod.TTMSFNCDataGridRenderer.isPrototypeOf(h)) h = rtl.as(h,$mod.TTMSFNCDataGridRenderer).FHost;
        if (pas["WEBLib.Controls"].TWinControl.isPrototypeOf(h)) {
          Result = rtl.as(h,pas["WEBLib.Controls"].TWinControl);
          break;
        };
      };
      return Result;
    };
    this.GetVMax = function () {
      var Result = 0.0;
      Result = 0;
      if (this.HasCustomScrollBars() && (this.GetCustomVerticalScrollBar() != null)) {
        Result = this.GetCustomVerticalScrollBar().FMax}
       else if (this.GetVerticalScrollBar() != null) Result = this.GetVerticalScrollBar().FMax;
      return Result;
    };
    this.GetVScrollValue = function () {
      var Result = 0.0;
      Result = this.FLocalVScrollValue;
      if (this.HasExternalScrollBars() && (this.FExternalVerticalScrollBar != null)) {
        Result = Math.min(this.FExternalVerticalScrollBar.GetMax() - this.FExternalVerticalScrollBar.GetPageSize(),Math.max(0,this.FExternalVerticalScrollBar.GetValue()))}
       else if (this.HasCustomScrollBars() && (this.GetCustomVerticalScrollBar() != null)) {
        Result = Math.min(this.GetCustomVerticalScrollBar().FMax - this.GetCustomVerticalScrollBar().FPageSize,Math.max(0,this.GetCustomVerticalScrollBar().FValue))}
       else if (this.GetVerticalScrollBar() != null) {
        Result = Math.min(this.GetVerticalScrollBar().FMax - this.GetVerticalScrollBar().GetPageSize(),Math.max(0,Math.round(this.GetVerticalScrollBar().GetPosition())));
      };
      return Result;
    };
    this.GetVViewPortSize = function () {
      var Result = 0.0;
      Result = 0;
      if (this.HasCustomScrollBars() && (this.GetCustomVerticalScrollBar() != null)) {
        Result = this.GetCustomVerticalScrollBar().FPageSize}
       else if (this.GetVerticalScrollBar() != null) {
        Result = this.GetVerticalScrollBar().GetPageSize();
      };
      return Result;
    };
    this.HasCustomScrollBars = function () {
      var Result = false;
      Result = ((this.FCustomScrollBars && this.HasValidHost()) || !this.HasValidHost()) && !this.FIsExporting;
      return Result;
    };
    this.HasExternalScrollBars = function () {
      var Result = false;
      Result = (this.FExternalVerticalScrollBar != null) || (this.FExternalHorizontalScrollBar != null);
      return Result;
    };
    this.HasValidHost = function () {
      var Result = false;
      Result = false;
      if (this.FHost != null) Result = pas["WEBLib.Controls"].TWinControl.isPrototypeOf(this.FHost);
      return Result;
    };
    this.HilightText = function (ACaseSensitive, AValue, AText) {
      var Result = "";
      Result = pas["WEBLib.TMSFNCHTMLEngine"].HiLight(AValue,AText,"hi",ACaseSensitive,false);
      return Result;
    };
    this.IsCellDisplayList = function (ADisplay) {
      var Result = false;
      Result = $mod.TTMSFNCDataGridNormalCellDisplayList.isPrototypeOf(ADisplay) || $mod.TTMSFNCDataGridFixedColumnCellDisplayList.isPrototypeOf(ADisplay) || $mod.TTMSFNCDataGridFixedRootCellDisplayList.isPrototypeOf(ADisplay) || $mod.TTMSFNCDataGridFixedRowCellDisplayList.isPrototypeOf(ADisplay);
      return Result;
    };
    this.IsCellReadOnly = function (ACell) {
      var Result = false;
      Result = this.IsCellFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell)) || this.GetReadOnly(ACell.GetColumn(),ACell.GetRow());
      return Result;
    };
    this.IsCellSelected = function (ACell) {
      var Result = false;
      var sc = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var stc = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var $tmp = this.GetOptions().FSelection.FMode;
      if ($tmp === $mod.TTMSFNCDataGridSelectionMode.gsmDisjunctColumn) {
        Result = this.GetSelectedColumn(ACell.GetColumn())}
       else if ($tmp === $mod.TTMSFNCDataGridSelectionMode.gsmDisjunctRow) {
        Result = this.GetSelectedRow(ACell.GetRow())}
       else if (($tmp === $mod.TTMSFNCDataGridSelectionMode.gsmDisjunctCell) || ($tmp === $mod.TTMSFNCDataGridSelectionMode.gsmDisjunctCellRange)) {
        Result = this.GetSelectedCell(ACell.GetColumn(),ACell.GetRow())}
       else {
        sc.$assign(this.FSelection.StartCell);
        stc.$assign(this.FSelection.StopCell);
        Result = (ACell.GetColumn() >= sc.GetColumn()) && (ACell.GetColumn() <= stc.GetColumn()) && (ACell.GetRow() >= sc.GetRow()) && (ACell.GetRow() <= stc.GetRow());
      };
      return Result;
    };
    this.IsRowBand = function (ARow) {
      var Result = false;
      Result = false;
      if (this.GetOptions().FBanding.FEnabled) {
        if (this.GetOptions().FBanding.FTotalRowCount > 0) {
          Result = ((ARow - this.FFixedRowCount) % this.GetOptions().FBanding.FTotalRowCount) < this.GetOptions().FBanding.FBandRowCount}
         else Result = pas.System.Odd(ARow);
      };
      return Result;
    };
    this.IsEditing = function () {
      var Result = false;
      Result = this.FInplaceEditorActive;
      return Result;
    };
    this.IsDisjunctMode = function () {
      var Result = false;
      Result = this.GetOptions().FSelection.FMode in rtl.createSet($mod.TTMSFNCDataGridSelectionMode.gsmDisjunctRow,$mod.TTMSFNCDataGridSelectionMode.gsmDisjunctColumn,$mod.TTMSFNCDataGridSelectionMode.gsmDisjunctCell,$mod.TTMSFNCDataGridSelectionMode.gsmDisjunctCellRange);
      return Result;
    };
    this.IsRangeMode = function () {
      var Result = false;
      Result = this.GetOptions().FSelection.FMode in rtl.createSet($mod.TTMSFNCDataGridSelectionMode.gsmCellRange,$mod.TTMSFNCDataGridSelectionMode.gsmRowRange,$mod.TTMSFNCDataGridSelectionMode.gsmColumnRange);
      return Result;
    };
    this.IsSingleMode = function () {
      var Result = false;
      Result = this.GetOptions().FSelection.FMode in rtl.createSet($mod.TTMSFNCDataGridSelectionMode.gsmSingleCell,$mod.TTMSFNCDataGridSelectionMode.gsmSingleRow,$mod.TTMSFNCDataGridSelectionMode.gsmSingleColumn);
      return Result;
    };
    this.IsAnchorMode = function () {
      var Result = false;
      Result = this.GetOptions().FSelection.FRangeType === $mod.TTMSFNCDataGridSelectionRangeType.gsrtKeepFocusedCell;
      return Result;
    };
    this.IsFixedCellSelected = function (ACell) {
      var Result = false;
      Result = false;
      if (this.IsCellFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell))) {
        Result = ((ACell.GetColumn() >= this.FSelection.StartCell.GetColumn()) && (ACell.GetColumn() <= this.FSelection.StopCell.GetColumn()) && (this.GetOptions().FSelection.FMode !== $mod.TTMSFNCDataGridSelectionMode.gsmSingleRow) && (this.GetOptions().FSelection.FMode !== $mod.TTMSFNCDataGridSelectionMode.gsmDisjunctRow) && !(this.GetOptions().FSelection.FMode in rtl.createSet($mod.TTMSFNCDataGridSelectionMode.gsmDisjunctCell,$mod.TTMSFNCDataGridSelectionMode.gsmDisjunctCellRange)) && (this.GetOptions().FSelection.FMode !== $mod.TTMSFNCDataGridSelectionMode.gsmRowRange)) || ((ACell.GetRow() >= this.FSelection.StartCell.GetRow()) && (ACell.GetRow() <= this.FSelection.StopCell.GetRow()) && (this.GetOptions().FSelection.FMode !== $mod.TTMSFNCDataGridSelectionMode.gsmSingleColumn) && (this.GetOptions().FSelection.FMode !== $mod.TTMSFNCDataGridSelectionMode.gsmDisjunctColumn) && !(this.GetOptions().FSelection.FMode in rtl.createSet($mod.TTMSFNCDataGridSelectionMode.gsmDisjunctCell,$mod.TTMSFNCDataGridSelectionMode.gsmDisjunctCellRange)) && (this.GetOptions().FSelection.FMode !== $mod.TTMSFNCDataGridSelectionMode.gsmColumnRange));
        if (this.GetOptions().FSelection.FMode === $mod.TTMSFNCDataGridSelectionMode.gsmDisjunctRow) {
          Result = this.GetSelectedRow(ACell.GetRow())}
         else if (this.GetOptions().FSelection.FMode === $mod.TTMSFNCDataGridSelectionMode.gsmDisjunctColumn) {
          Result = this.GetSelectedColumn(ACell.GetColumn())}
         else if (this.GetOptions().FSelection.FMode in rtl.createSet($mod.TTMSFNCDataGridSelectionMode.gsmDisjunctCell,$mod.TTMSFNCDataGridSelectionMode.gsmDisjunctCellRange)) Result = this.GetSelectedCell(ACell.GetColumn(),ACell.GetRow());
      };
      return Result;
    };
    this.LastVisibleColumn = function (AColumn, ARow) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var c = 0;
      var corig = 0;
      var r = 0;
      var rorig = 0;
      c = Math.max(0,Math.min(AColumn,this.FColumnCount - 1));
      r = Math.max(0,Math.min(ARow,this.FRowCount - 1));
      corig = c;
      rorig = r;
      Result.SetColumn(this.FColumnCount - 1 - this.FFixedRightColumnCount);
      Result.SetRow(r);
      while ((Result.GetColumn() >= this.FFixedColumnCount) && !this.IsCellDisplayed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Result))) Result.SetColumn(Result.GetColumn() - 1);
      if (!this.IsCellDisplayed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Result))) {
        Result.SetColumn(corig);
        Result.SetRow(rorig);
      };
      return Result;
    };
    this.LastVisibleRow = function (AColumn, ARow) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var c = 0;
      var corig = 0;
      var r = 0;
      var rorig = 0;
      c = Math.max(0,Math.min(AColumn,this.FColumnCount - 1));
      r = Math.max(0,Math.min(ARow,this.FRowCount - 1));
      corig = c;
      rorig = r;
      Result.SetColumn(c);
      Result.SetRow(this.FRowCount - 1 - this.FFixedBottomRowCount);
      while ((Result.GetRow() >= this.FFixedRowCount) && !this.IsCellDisplayed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Result))) Result.SetRow(Result.GetRow() - 1);
      if (!this.IsCellDisplayed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Result))) {
        Result.SetColumn(corig);
        Result.SetRow(rorig);
      };
      return Result;
    };
    this.Lookup = function (AValue, AAllRows, AAutoGoto) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var I = 0;
      Result.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(-1,-1));
      for (var $l = this.GetFocusedCell().GetColumn(), $end = this.FColumnCount - 1; $l <= $end; $l++) {
        I = $l;
        Result.$assign(this.LookupInColumn(I,AValue,AAllRows,AAutoGoto));
        if ((Result.GetColumn() !== -1) && (Result.GetRow() !== -1)) break;
      };
      return Result;
    };
    this.LookupInColumn = function (AColumn, AValue, AAllRows, AAutoGoto) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var sr = 0;
      if (AAllRows) {
        sr = 0}
       else sr = this.FFixedRowCount;
      Result.$assign(this.LookupInColumnFromRow(AColumn,sr,AValue,AAllRows,AAutoGoto));
      return Result;
    };
    this.LookupInColumnFromRow = function (AColumn, ARow, AValue, AAllRows, AAutoGoto) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var sr = 0;
      var er = 0;
      var m = 0;
      var r = 0;
      var s = "";
      var v = "";
      Result.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(-1,-1));
      v = AValue;
      if (!this.GetOptions().FLookup.FCaseSensitive) v = pas.SysUtils.UpperCase(v);
      if (AAllRows) {
        sr = this.FFixedRowCount;
        er = this.FRowCount - 1;
      } else {
        sr = ARow;
        er = this.FRowCount - 1 - this.FFixedBottomRowCount;
      };
      r = -1;
      for (var $l = sr, $end = er; $l <= $end; $l++) {
        m = $l;
        s = this.GetString(AColumn,m);
        if (pas.System.Pos("</",s) > 0) s = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.HTMLStrip(s);
        if (!this.GetOptions().FLookup.FCaseSensitive) s = pas.SysUtils.UpperCase(s);
        if (pas.System.Pos(v,s) === 1) {
          r = m;
          break;
        };
      };
      if (r !== -1) {
        Result.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AColumn,r));
        if (AAutoGoto) this.SetFocusedCell(Result);
      };
      return Result;
    };
    this.MarkText = function (ACaseSensitive, AValue, AText) {
      var Result = "";
      Result = pas["WEBLib.TMSFNCHTMLEngine"].HiLight(AValue,AText,"e",ACaseSensitive,false);
      return Result;
    };
    this.NextSelectableColumn = function (AColumn, ARow) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var c = 0;
      var corig = 0;
      var r = 0;
      var rorig = 0;
      var cs = 0;
      var chk = false;
      var i = 0;
      c = AColumn;
      r = ARow;
      corig = c;
      rorig = r;
      if (this.IsRowHidden(r)) {
        for (var $l = this.FFixedRowCount, $end = this.FRowCount - 1 - this.FFixedBottomRowCount; $l <= $end; $l++) {
          i = $l;
          if (!this.IsRowHidden(i)) {
            r = i;
            break;
          };
        };
      };
      Result.SetColumn(c);
      Result.SetRow(r);
      cs = this.ColumnSpan(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r)));
      if (cs > 0) {
        chk = (Result.GetColumn() + cs) <= (this.FColumnCount - 1 - this.FFixedRightColumnCount);
        if (chk) Result.SetColumn(Result.GetColumn() + cs);
      } else {
        chk = (Result.GetColumn() + 1) <= (this.FColumnCount - 1 - this.FFixedRightColumnCount);
        if (chk) Result.SetColumn(Result.GetColumn() + 1);
      };
      if (chk) {
        while (this.IsCellDisabled(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Result)) && (Result.GetColumn() < (this.FColumnCount - 1 - this.FFixedRightColumnCount))) {
          cs = this.ColumnSpan(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r)));
          if (cs > 0) {
            Result.SetColumn(Result.GetColumn() + cs)}
           else Result.SetColumn(Result.GetColumn() + 1);
        };
      };
      if (this.IsCellDisabled(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Result))) {
        Result.SetColumn(corig);
        Result.SetRow(rorig);
      };
      return Result;
    };
    this.NextSelectableRow = function (AColumn, ARow) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var c = 0;
      var r = 0;
      var corig = 0;
      var rorig = 0;
      var rs = 0;
      var chk = false;
      var i = 0;
      c = AColumn;
      r = ARow;
      corig = c;
      rorig = r;
      if (this.IsColumnHidden(c)) {
        for (var $l = this.FFixedColumnCount, $end = this.FColumnCount - 1 - this.FFixedRightColumnCount; $l <= $end; $l++) {
          i = $l;
          if (!this.IsColumnHidden(i)) {
            c = i;
            break;
          };
        };
      };
      Result.SetColumn(c);
      Result.SetRow(r);
      rs = this.RowSpan(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r)));
      if (rs > 0) {
        chk = (Result.GetRow() + rs) <= (this.FRowCount - 1 - this.FFixedBottomRowCount);
        if (chk) Result.SetRow(Result.GetRow() + rs);
      } else {
        chk = (Result.GetRow() + 1) <= (this.FRowCount - 1 - this.FFixedBottomRowCount);
        if (chk) Result.SetRow(Result.GetRow() + 1);
      };
      if (chk) {
        while (this.IsCellDisabled(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Result)) && (Result.GetRow() < (this.FRowCount - 1 - this.FFixedBottomRowCount))) {
          rs = this.RowSpan(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r)));
          if (rs > 0) {
            Result.SetRow(Result.GetRow() + rs)}
           else Result.SetRow(Result.GetRow() + 1);
        };
      };
      if (this.IsCellDisabled(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Result))) {
        Result.SetColumn(corig);
        Result.SetRow(rorig);
      };
      return Result;
    };
    this.NextVisibleColumn = function (AColumn, ARow) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var c = 0;
      var corig = 0;
      var r = 0;
      var rorig = 0;
      var cs = 0;
      var chk = false;
      var i = 0;
      c = Math.max(0,Math.min(AColumn,this.FColumnCount - 1));
      r = Math.max(0,Math.min(ARow,this.FRowCount - 1));
      corig = c;
      rorig = r;
      if (this.IsRowHidden(r)) {
        for (var $l = this.FFixedRowCount, $end = this.FRowCount - 1 - this.FFixedBottomRowCount; $l <= $end; $l++) {
          i = $l;
          if (!this.IsRowHidden(i)) {
            r = i;
            break;
          };
        };
      };
      Result.SetColumn(c);
      Result.SetRow(r);
      cs = this.ColumnSpan(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r)));
      if (cs > 0) {
        chk = (Result.GetColumn() + cs) <= (this.FColumnCount - 1 - this.FFixedRightColumnCount);
        if (chk) Result.SetColumn(Result.GetColumn() + cs);
      } else {
        chk = (Result.GetColumn() + 1) <= (this.FColumnCount - 1 - this.FFixedRightColumnCount);
        if (chk) Result.SetColumn(Result.GetColumn() + 1);
      };
      if (chk) {
        while (!this.IsCellDisplayed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Result)) && (Result.GetColumn() < (this.FColumnCount - 1 - this.FFixedRightColumnCount))) {
          cs = this.ColumnSpan(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r)));
          if (cs > 0) {
            Result.SetColumn(Result.GetColumn() + cs)}
           else Result.SetColumn(Result.GetColumn() + 1);
        };
      };
      if (!this.IsCellDisplayed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Result))) {
        Result.SetColumn(corig);
        Result.SetRow(rorig);
      };
      return Result;
    };
    this.NextVisibleRow = function (AColumn, ARow) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var c = 0;
      var r = 0;
      var corig = 0;
      var rorig = 0;
      var rs = 0;
      var chk = false;
      var i = 0;
      c = Math.max(0,Math.min(AColumn,this.FColumnCount - 1));
      r = Math.max(0,Math.min(ARow,this.FRowCount - 1));
      corig = c;
      rorig = r;
      if (this.IsColumnHidden(c)) {
        for (var $l = this.FFixedColumnCount, $end = this.FColumnCount - 1 - this.FFixedRightColumnCount; $l <= $end; $l++) {
          i = $l;
          if (!this.IsColumnHidden(i)) {
            c = i;
            break;
          };
        };
      };
      Result.SetColumn(c);
      Result.SetRow(r);
      rs = this.RowSpan(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r)));
      if (rs > 0) {
        chk = (Result.GetRow() + rs) <= (this.FRowCount - 1 - this.FFixedBottomRowCount);
        if (chk) Result.SetRow(Result.GetRow() + rs);
      } else {
        chk = (Result.GetRow() + 1) <= (this.FRowCount - 1 - this.FFixedBottomRowCount);
        if (chk) Result.SetRow(Result.GetRow() + 1);
      };
      if (chk) {
        while (!this.IsCellDisplayed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Result)) && (Result.GetRow() < (this.FRowCount - 1 - this.FFixedBottomRowCount))) {
          rs = this.RowSpan(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r)));
          if (rs > 0) {
            Result.SetRow(Result.GetRow() + rs)}
           else Result.SetRow(Result.GetRow() + 1);
        };
      };
      if (!this.IsCellDisplayed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Result))) {
        Result.SetColumn(corig);
        Result.SetRow(rorig);
      };
      return Result;
    };
    this.PreviousSelectableColumn = function (AColumn, ARow) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var c = 0;
      var r = 0;
      var rorig = 0;
      var corig = 0;
      var i = 0;
      c = AColumn;
      r = ARow;
      corig = c;
      rorig = r;
      Result.SetColumn(c);
      Result.SetRow(r);
      if (this.IsRowHidden(Result.GetRow())) {
        for (var $l = this.FFixedRowCount, $end = this.FRowCount - 1 - this.FFixedBottomRowCount; $l <= $end; $l++) {
          i = $l;
          if (!this.IsRowHidden(i)) {
            Result.SetRow(i);
            break;
          };
        };
      };
      if ((Result.GetColumn() - 1) >= this.FFixedColumnCount) {
        Result.SetColumn(Result.GetColumn() - 1);
        while (this.IsCellDisabled(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Result)) && (Result.GetColumn() > this.FFixedColumnCount)) Result.SetColumn(Result.GetColumn() - 1);
      };
      if (this.IsCellDisabled(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Result))) {
        Result.SetColumn(corig);
        Result.SetRow(rorig);
      };
      return Result;
    };
    this.PreviousSelectableRow = function (AColumn, ARow) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var c = 0;
      var r = 0;
      var corig = 0;
      var rorig = 0;
      var i = 0;
      c = AColumn;
      r = ARow;
      corig = c;
      rorig = r;
      Result.SetColumn(c);
      Result.SetRow(r);
      if (this.IsColumnHidden(Result.GetColumn())) {
        for (var $l = this.FFixedColumnCount, $end = this.FColumnCount - 1 - this.FFixedRightColumnCount; $l <= $end; $l++) {
          i = $l;
          if (!this.IsColumnHidden(i)) {
            Result.SetColumn(i);
            break;
          };
        };
      };
      if ((Result.GetRow() - 1) >= this.FFixedRowCount) {
        Result.SetRow(Result.GetRow() - 1);
        while (this.IsCellDisabled(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Result)) && (Result.GetRow() > this.FFixedRowCount)) Result.SetRow(Result.GetRow() - 1);
      };
      if (this.IsCellDisabled(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Result))) {
        Result.SetColumn(corig);
        Result.SetRow(rorig);
      };
      return Result;
    };
    this.PreviousVisibleColumn = function (AColumn, ARow) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var c = 0;
      var r = 0;
      var rorig = 0;
      var corig = 0;
      var i = 0;
      c = Math.max(0,Math.min(AColumn,this.FColumnCount - 1));
      r = Math.max(0,Math.min(ARow,this.FRowCount - 1));
      corig = c;
      rorig = r;
      Result.SetColumn(c);
      Result.SetRow(r);
      if (this.IsRowHidden(Result.GetRow())) {
        for (var $l = this.FFixedRowCount, $end = this.FRowCount - 1 - this.FFixedBottomRowCount; $l <= $end; $l++) {
          i = $l;
          if (!this.IsRowHidden(i)) {
            Result.SetRow(i);
            break;
          };
        };
      };
      if ((Result.GetColumn() - 1) >= this.FFixedColumnCount) {
        Result.SetColumn(Result.GetColumn() - 1);
        while (!this.IsCellDisplayed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Result)) && (Result.GetColumn() > this.FFixedColumnCount)) Result.SetColumn(Result.GetColumn() - 1);
      };
      if (!this.IsCellDisplayed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Result))) {
        Result.SetColumn(corig);
        Result.SetRow(rorig);
      };
      return Result;
    };
    this.PreviousVisibleRow = function (AColumn, ARow) {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var c = 0;
      var r = 0;
      var corig = 0;
      var rorig = 0;
      var i = 0;
      c = Math.max(0,Math.min(AColumn,this.FColumnCount - 1));
      r = Math.max(0,Math.min(ARow,this.FRowCount - 1));
      corig = c;
      rorig = r;
      Result.SetColumn(c);
      Result.SetRow(r);
      if (this.IsColumnHidden(Result.GetColumn())) {
        for (var $l = this.FFixedColumnCount, $end = this.FColumnCount - 1 - this.FFixedRightColumnCount; $l <= $end; $l++) {
          i = $l;
          if (!this.IsColumnHidden(i)) {
            Result.SetColumn(i);
            break;
          };
        };
      };
      if ((Result.GetRow() - 1) >= this.FFixedRowCount) {
        Result.SetRow(Result.GetRow() - 1);
        while (!this.IsCellDisplayed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Result)) && (Result.GetRow() > this.FFixedRowCount)) Result.SetRow(Result.GetRow() - 1);
      };
      if (!this.IsCellDisplayed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(Result))) {
        Result.SetColumn(corig);
        Result.SetRow(rorig);
      };
      return Result;
    };
    this.SetGrid = function (ACell) {
      var Result = null;
      Result = this.SetGrid$1(ACell.GetColumn(),ACell.GetRow());
      return Result;
    };
    this.SetGrid$1 = function (AColumn, ARow) {
      var Result = null;
      var cd = null;
      var o = null;
      var r = null;
      Result = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return Result;
      this.BeginUpdate();
      try {
        cd = this.GetCellDataExtended(AColumn,ARow);
        if (cd != null) {
          o = cd.FRenderer;
          if (!(o != null)) {
            r = $mod.TTMSFNCDataGridRenderer.$create("Create$3",[this]);
            cd.FRenderer = r;
            Result = r;
          } else if ($mod.TTMSFNCDataGridRenderer.isPrototypeOf(o)) Result = rtl.as(o,$mod.TTMSFNCDataGridRenderer);
        };
      } finally {
        this.EndUpdate();
      };
      return Result;
    };
    this.StopEditing = function (AFocusGrid) {
      var Result = false;
      Result = true;
      if (this.FInplaceEditorActive) Result = this.CloseInplaceEditor(false,false,false,AFocusGrid);
      return Result;
    };
    this.UnhilightText = function (ACaseSensitive, AValue) {
      var Result = "";
      Result = pas["WEBLib.TMSFNCHTMLEngine"].UnHiLight(AValue,"hi");
      return Result;
    };
    this.UnmarkText = function (AValue) {
      var Result = "";
      Result = pas["WEBLib.TMSFNCHTMLEngine"].UnHiLight(AValue,"e");
      return Result;
    };
    this.XYToCell = function (X, Y, ASizing) {
      var $Self = this;
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var c = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      function FindCell(ADisplayList) {
        var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
        var cf = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
        var I = 0;
        var cl = null;
        var er = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
        cf.SetColumn(-1);
        cf.SetRow(-1);
        Result.$assign(cf);
        for (var $l = 0, $end = ADisplayList.FLength - 1; $l <= $end; $l++) {
          I = $l;
          cl = ADisplayList.GetItem(I);
          er.$assign(cl.FRect);
          if (ASizing) {
            er.Left = er.Left - $Self.GetOptions().FMouse.FColumnSizeMargin;
            er.Right = er.Right + $Self.GetOptions().FMouse.FColumnSizeMargin;
            er.Top = er.Top - $Self.GetOptions().FMouse.FRowSizeMargin;
            er.Bottom = er.Bottom + $Self.GetOptions().FMouse.FRowSizeMargin;
          };
          if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(er,pas["WEBLib.TMSFNCTypes"].PointF(X,Y))) {
            cf.SetColumn(cl.FColumn);
            cf.SetRow(cl.FRow);
            Result.$assign(cf);
            break;
          };
        };
        return Result;
      };
      c.SetColumn(-1);
      c.SetRow(-1);
      Result.$assign(c);
      if (!pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.LocalRect(),pas["WEBLib.TMSFNCTypes"].PointF(X,Y))) return Result;
      c.$assign(FindCell(this.FFixedRootCellDisplay));
      if (this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c)) && (this.IsCellFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c)) || this.IsCellFreeze(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c)))) {
        Result.$assign(c);
        return Result;
      };
      c.$assign(FindCell(this.FFixedRowCellDisplay));
      if (this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c)) && (this.IsCellFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c)) || this.IsCellFreeze(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c)))) {
        Result.$assign(c);
        return Result;
      };
      c.$assign(FindCell(this.FFixedColumnCellDisplay));
      if (this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c)) && (this.IsCellFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c)) || this.IsCellFreeze(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c)))) {
        Result.$assign(c);
        return Result;
      };
      c.$assign(FindCell(this.FNormalCellDisplay));
      if (this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c)) && !(this.IsCellFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c)) || this.IsCellFreeze(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(c)))) {
        Result.$assign(c);
        return Result;
      };
      return Result;
    };
    this.XYToColumn = function (X, Y) {
      var Result = 0;
      Result = this.XYToCell(X,Y,false).GetColumn();
      return Result;
    };
    this.XYToRenderer = function (X, Y) {
      var Result = null;
      var obj = null;
      var pr = null;
      var r = null;
      obj = this.GetCellObjectForCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.XYToCell(X,Y,false)));
      pr = null;
      if ((obj != null) && $mod.TTMSFNCDataGridRendererCell.isPrototypeOf(obj)) {
        r = rtl.as(obj,$mod.TTMSFNCDataGridRendererCell).GetRenderer();
        while (r != null) {
          pr = r;
          r = pr.XYToRenderer(X,Y);
        };
      };
      Result = pr;
      return Result;
    };
    this.XYToRow = function (X, Y) {
      var Result = 0;
      Result = this.XYToCell(X,Y,false).GetRow();
      return Result;
    };
    this.Export = function (AGraphics) {
      this.Export$1(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,this.GetWidth(),this.GetHeight())),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoordRange.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCellRange(0,0,this.FColumnCount - 1,this.FRowCount - 1)),false,false,true,false,1.0,null,null);
    };
    this.Export$1 = function (AGraphics, ARect, ASelection, ARepeatFixedColumns, ARepeatFixedRows, AFitToPage, ASkipSaveBounds, AScale, AOnNewPage, AOnGetPageIndex) {
      var $Self = this;
      var c = 0;
      var r = 0;
      var cellstr = "";
      var cwr = 0.0;
      var rhr = 0.0;
      var cw = 0.0;
      var rh = 0.0;
      var cwrt = 0.0;
      var rhrt = 0.0;
      var pgi = 0;
      var I = 0;
      var xr = 0.0;
      var yr = 0.0;
      var bc = 0;
      var br = 0;
      var cs = 0;
      var rs = 0;
      var cellr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var cls = null;
      var off = 0.0;
      var x = 0.0;
      var y = 0.0;
      var rSt = 0;
      var csave = 0;
      var cSt = 0;
      var chk = false;
      var FFixedRowsSave = 0;
      var FFixedColumnsSave = 0;
      var FCSave = 0;
      var FRSave = 0;
      var FFixedRowGet = false;
      var FFixedColGet = false;
      var FSetRSave = false;
      var FSetCSave = false;
      var xs = 0.0;
      var ys = 0.0;
      var ph = 0.0;
      var pw = 0.0;
      var xts = 0.0;
      var yts = 0.0;
      var FSaveXBounds = 0.0;
      var FSaveYBounds = 0.0;
      var sc = 0.0;
      var ci = null;
      var d = null;
      var ck = 0;
      var mcpp = null;
      var needspage = false;
      function GetFixedPrintWidth() {
        var Result = 0.0;
        var I = 0;
        Result = 0;
        for (var $l = 0, $end = $Self.FFixedColumnCount - 1; $l <= $end; $l++) {
          I = $l;
          Result = Result + ($Self.GetColumnWidth(I) * sc);
        };
        return Result;
      };
      function GetFixedPrintHeight() {
        var Result = 0.0;
        var I = 0;
        Result = 0;
        for (var $l = 0, $end = $Self.FFixedRowCount - 1; $l <= $end; $l++) {
          I = $l;
          Result = Result + ($Self.GetRowHeight(I) * sc);
        };
        return Result;
      };
      function GetScale() {
        var Result = 0.0;
        var w = 0;
        var K = 0;
        Result = AScale;
        if (AFitToPage) {
          w = 0;
          for (var $l = 0, $end = $Self.FColumnCount - 1; $l <= $end; $l++) {
            K = $l;
            w = w + Math.round($Self.GetColumnWidth(K));
          };
          if (w > 0) Result = (ARect.Right - ARect.Left) / w;
        };
        return Result;
      };
      function GetCellMergeInfo(AColumn, ARow, ABaseColumn, ABaseRow, AColumnSpan, ARowSpan) {
        var mi = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellMergeInfo.$new();
        if ($Self.GetHasMergeInfo(AColumn,ARow)) {
          mi.$assign($Self.GetMergeInfo(AColumn,ARow));
          ABaseColumn.set(c - mi.ColumnOffset);
          ABaseRow.set(r - mi.RowOffset);
          AColumnSpan.set(mi.ColumnSpan);
          ARowSpan.set(mi.RowSpan);
        };
      };
      mcpp = pas["Generics.Collections"].TDictionary$$$G$$generics$collections$$TTMSFNCDataGridCellCoord$$Longint.$create("Create$1",[0]);
      this.ExportNotification(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridExportState.gesExportStart,-1);
      try {
        AGraphics.FBitmapContainer = this.GetBitmapContainer();
        sc = GetScale();
        if (AOnNewPage != null) AOnNewPage();
        needspage = false;
        x = ARect.Left;
        y = ARect.Top;
        rSt = ASelection.StartCell.GetRow();
        FFixedRowsSave = 0;
        FFixedColumnsSave = 0;
        csave = -1;
        cSt = -1;
        FFixedRowGet = false;
        FFixedColGet = false;
        FSetRSave = true;
        FSetCSave = true;
        pw = GetFixedPrintWidth();
        ph = GetFixedPrintHeight();
        FSaveXBounds = ARect.Left;
        for (var $l = ASelection.StartCell.GetColumn(), $end = ASelection.StopCell.GetColumn(); $l <= $end; $l++) {
          I = $l;
          if (pas.Math.CompareValue$3(pas.Math.Floor(FSaveXBounds + (this.GetColumnWidth(I) * sc)),ARect.Right,0.0) === 1) break;
          FSaveXBounds = FSaveXBounds + (this.GetColumnWidth(I) * sc);
        };
        FSaveYBounds = ARect.Top;
        for (var $l1 = ASelection.StartCell.GetRow(), $end1 = ASelection.StopCell.GetRow(); $l1 <= $end1; $l1++) {
          I = $l1;
          if (pas.Math.CompareValue$3(pas.Math.Floor(FSaveYBounds + (this.GetRowHeight(I) * sc)),ARect.Bottom,0.0) === 1) break;
          FSaveYBounds = FSaveYBounds + (this.GetRowHeight(I) * sc);
        };
        c = ASelection.StartCell.GetColumn();
        FCSave = -1;
        while (c <= ASelection.StopCell.GetColumn()) {
          if (cSt === -1) cSt = c;
          if (ARepeatFixedColumns && (this.FFixedColumnCount > 0)) {
            if (FFixedColumnsSave < this.FFixedColumnCount) {
              FFixedColGet = true;
              if (FSetCSave) {
                FSetCSave = false;
                FCSave = cSt;
              };
              cSt = FFixedColumnsSave;
              c = cSt;
              FFixedColumnsSave += 1;
            } else if (FFixedColGet) {
              FFixedColGet = false;
              cSt = FCSave;
              c = FCSave;
              if (cSt < this.FFixedColumnCount) {
                cSt = this.FFixedColumnCount;
                c = cSt;
              };
            };
          };
          cw = this.GetColumnWidth(c) * sc;
          r = rSt;
          FRSave = rSt;
          while (r <= ASelection.StopCell.GetRow()) {
            if (needspage) {
              if (AOnNewPage != null) AOnNewPage();
              needspage = false;
            };
            if (ARepeatFixedRows && (this.FFixedRowCount > 0)) {
              if (FFixedRowsSave < this.FFixedRowCount) {
                FFixedRowGet = true;
                if (FSetRSave) {
                  FSetRSave = false;
                  FRSave = rSt;
                };
                rSt = FFixedRowsSave;
                r = rSt;
                FFixedRowsSave += 1;
              } else if (FFixedRowGet) {
                FFixedRowGet = false;
                rSt = FRSave;
                r = FRSave;
                if (rSt < this.FFixedRowCount) {
                  rSt = this.FFixedRowCount;
                  r = rSt;
                };
              };
            };
            this.ExportNotification(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridExportState.gesExportNewRow,r);
            bc = c;
            br = r;
            cs = 0;
            rs = 0;
            rh = this.GetRowHeight(r) * sc;
            GetCellMergeInfo(c,r,{get: function () {
                return bc;
              }, set: function (v) {
                bc = v;
              }},{get: function () {
                return br;
              }, set: function (v) {
                br = v;
              }},{get: function () {
                return cs;
              }, set: function (v) {
                cs = v;
              }},{get: function () {
                return rs;
              }, set: function (v) {
                rs = v;
              }});
            chk = (c === bc) && (r === br);
            if (AOnGetPageIndex != null) {
              pgi = AOnGetPageIndex();
              if (chk) {
                mcpp.AddOrSetValue(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(bc,br),pgi)}
               else if ((bc !== c) && (br !== r)) chk = mcpp.ContainsKey(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(bc,br)) && (mcpp.GetItem(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(bc,br)) !== pgi);
            };
            if (chk) {
              cellstr = this.GetString(bc,br);
              cwr = cw;
              rhr = rh;
              cwrt = 0;
              for (var $l2 = bc, $end2 = (bc + cs) - 1; $l2 <= $end2; $l2++) {
                I = $l2;
                cwrt = cwrt + (this.GetColumnWidth(I) * sc);
              };
              if (cwrt > 0) cwr = cwrt;
              rhrt = 0;
              for (var $l3 = br, $end3 = (br + rs) - 1; $l3 <= $end3; $l3++) {
                I = $l3;
                rhrt = rhrt + (this.GetRowHeight(I) * sc);
              };
              if (rhrt > 0) rhr = rhrt;
              xr = 0;
              for (var $l4 = bc, $end4 = c - 1; $l4 <= $end4; $l4++) {
                I = $l4;
                xr = xr + (this.GetColumnWidth(I) * sc);
              };
              yr = 0;
              for (var $l5 = br, $end5 = r - 1; $l5 <= $end5; $l5++) {
                I = $l5;
                yr = yr + (this.GetRowHeight(I) * sc);
              };
              xts = x - xr;
              yts = y - yr;
              xs = xts + cwr;
              ys = yts + rhr;
              if (!ASkipSaveBounds) {
                if (FSaveXBounds > -1) xs = Math.min(FSaveXBounds,xs);
              };
              pgi = 0;
              if (AOnGetPageIndex != null) pgi = AOnGetPageIndex();
              if (((pgi === 0) || ARepeatFixedColumns) && (c > this.FFixedColumnCount)) {
                xts = Math.max(ARect.Left + pw,xts)}
               else xts = Math.max(ARect.Left,xts);
              if (!ASkipSaveBounds) {
                if (FSaveYBounds > -1) ys = Math.min(FSaveYBounds,ys);
              };
              if (((pgi === 0) || ARepeatFixedRows) && (r > this.FFixedRowCount)) {
                yts = Math.max(ARect.Top + ph,yts)}
               else yts = Math.max(ARect.Top,yts);
              if (bc === this.GetOptions().FColumn.FNodeIndex) {
                if (this.GetRowType(br) === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowType.grtDefault) {
                  off = 20 * Math.max(0,this.GetRowNodeLevel(br) - 1)}
                 else off = 20 * Math.max(0,this.GetRowNodeLevel(br));
                xts = xts + off;
              };
              cellr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(xts,yts,xs,ys));
              if (this.IsCellDisplayed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(bc,br)))) {
                cls = this.GetBaseCellClass(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(bc,br)));
                this.DoGetCellClass(bc,br,{get: function () {
                    return cls;
                  }, set: function (v) {
                    cls = v;
                  }});
                if (cls != null) {
                  ck = this.GetCellKind(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(bc,br)));
                  d = this.GetCellData(bc,br);
                  ci = cls.$create("Create$1",[pas["WEBLib.TMSFNCTypes"].TRectF.$clone(cellr),bc,br,d,ck,$Self]);
                  if (ci != null) {
                    ci.BeforeExport();
                    try {
                      this.ConfigureCell(ci,$mod.TTMSFNCDataGridCellConfigureMode.gccmBoth);
                      this.ApplyCellScale(ci,sc);
                      this.DrawCell(AGraphics,ci);
                    } finally {
                      ci.AfterExport();
                      ci = rtl.freeLoc(ci);
                    };
                  };
                };
              };
            };
            y = y + rh;
            if (pas.Math.CompareValue$3(pas.Math.Floor(y + (this.GetRowHeight(r + 1) * sc)),ARect.Bottom,0.0) === 1) {
              FSaveYBounds = ARect.Bottom;
              break;
            };
            r += 1;
          };
          y = ARect.Top;
          x = x + cw;
          c += 1;
          FFixedRowsSave = 0;
          if (((bc + cs) === ASelection.StopCell.GetColumn()) && ((br + rs) === ASelection.StopCell.GetRow())) break;
          if ((pas.Math.CompareValue$3(pas.Math.Floor(x + (this.GetColumnWidth(c) * sc)),ARect.Right,0.0) === 1) || (c === (ASelection.StopCell.GetColumn() + 1))) {
            FSaveXBounds = ARect.Right;
            rSt = r + 1;
            if (csave === -1) csave = c;
            if (r === (ASelection.StopCell.GetRow() + 1)) {
              c = csave;
              cSt = -1;
              rSt = ASelection.StartCell.GetRow();
              csave = -1;
            } else c = cSt;
            FFixedRowsSave = 0;
            FFixedColumnsSave = 0;
            FSetRSave = true;
            FSetCSave = true;
            if (c < (ASelection.StopCell.GetColumn() + 1)) {
              needspage = true;
              x = ARect.Left;
              y = ARect.Top;
            };
          };
        };
      } finally {
        mcpp = rtl.freeLoc(mcpp);
        this.ExportNotification(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridExportState.gesExportDone,-1);
      };
    };
    this.AddBitmap = function (ACell, ABitmap) {
      this.SetBitmap(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),ABitmap);
    };
    this.AddBitmap$1 = function (ACell, AName) {
      this.SetBitmap$1(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AName);
    };
    this.AddBitmap$2 = function (AColumn, ARow, ABitmap) {
      this.SetBitmap$2(AColumn,ARow,ABitmap);
    };
    this.AddBitmap$3 = function (AColumn, ARow, AName) {
      this.SetBitmap$3(AColumn,ARow,AName);
    };
    this.AddBitmapColumn = function (AColumn, ABitmap) {
      this.SetBitmapColumn(AColumn,ABitmap);
    };
    this.AddBitmapColumn$1 = function (AColumn, AName) {
      this.SetBitmapColumn$1(AColumn,AName);
    };
    this.AddButton = function (ACell, AText) {
      this.SetButton(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AText);
    };
    this.AddButton$1 = function (AColumn, ARow, AText) {
      this.SetButton$1(AColumn,ARow,AText);
    };
    this.AddButtonColumn = function (AColumn, AText) {
      this.SetButtonColumn(AColumn,AText);
    };
    this.AddCheckBox = function (ACell, AValue) {
      this.SetCheckBox(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AValue);
    };
    this.AddCheckBox$1 = function (AColumn, ARow, AValue) {
      this.SetCheckBox$1(AColumn,ARow,AValue);
    };
    this.AddCheckBoxColumn = function (AColumn, AValue) {
      this.SetCheckBoxColumn(AColumn,AValue);
    };
    this.AddDataCheckBox = function (ACell) {
      this.SetDataCheckBox(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
    };
    this.AddDataCheckBox$1 = function (AColumn, ARow) {
      this.SetDataCheckBox$1(AColumn,ARow);
    };
    this.AddDataCheckBoxColumn = function (AColumn) {
      this.SetDataCheckBoxColumn(AColumn);
    };
    this.AddDataProgressBar = function (ACell) {
      this.SetDataProgressBar(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
    };
    this.AddDataProgressBar$1 = function (AColumn, ARow) {
      this.SetDataProgressBar$1(AColumn,ARow);
    };
    this.AddDataProgressBarColumn = function (AColumn) {
      this.SetDataProgressBarColumn(AColumn);
    };
    this.AddDataRadioButton = function (ACell, AValue, AGroupIndex) {
      this.SetDataRadioButton(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AValue,AGroupIndex);
    };
    this.AddDataRadioButton$1 = function (AColumn, ARow, AValue, AGroupIndex) {
      this.SetDataRadioButton$1(AColumn,ARow,AValue,AGroupIndex);
    };
    this.AddDataRadioButtonColumn = function (AColumn, AValue, AGroupIndex) {
      this.SetDataRadioButtonColumn(AColumn,AValue,AGroupIndex);
    };
    this.AddFilterEditor = function (ACell) {
      this.AddFilterEditor$1(ACell.GetColumn(),ACell.GetRow());
    };
    this.AddFilterEditor$1 = function (AColumn, ARow) {
      var cd = null;
      var f = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      this.BeginUpdate();
      try {
        cd = this.GetCellDataExtended(AColumn,ARow);
        if (cd != null) f = this.GetFilterEditor(AColumn,ARow);
      } finally {
        this.EndUpdate();
      };
    };
    this.AddProgressBar = function (ACell, AValue) {
      this.SetProgressBar(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AValue);
    };
    this.AddProgressBar$1 = function (AColumn, ARow, AValue) {
      this.SetProgressBar$1(AColumn,ARow,AValue);
    };
    this.AddProgressBarColumn = function (AColumn, AValue) {
      this.SetProgressBarColumn(AColumn,AValue);
    };
    this.AddRadioButton = function (ACell, AValue, AGroupIndex) {
      this.SetRadioButton(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),AValue,AGroupIndex);
    };
    this.AddRadioButton$1 = function (AColumn, ARow, AValue, AGroupIndex) {
      this.SetRadioButton$1(AColumn,ARow,AValue,AGroupIndex);
    };
    this.AddRadioButtonColumn = function (AColumn, AValue, AGroupIndex) {
      this.SetRadioButtonColumn(AColumn,AValue,AGroupIndex);
    };
    this.AfterExport = function () {
      pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCore.AfterExport.call(this);
      this.FClipRect.$assign(this.FSaveClipRect);
    };
    this.ApplyExportScale = function (AScale) {
      var I = 0;
      this.FScale = AScale;
      this.BeginUpdate();
      try {
        for (var $l = 0, $end = this.FColumnCount - 1; $l <= $end; $l++) {
          I = $l;
          this.SetColumnWidth(I,this.GetColumnWidth(I) * AScale);
        };
        for (var $l1 = 0, $end1 = this.FRowCount - 1; $l1 <= $end1; $l1++) {
          I = $l1;
          this.SetRowHeight(I,this.GetRowHeight(I) * AScale);
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.ApplyStyle = function () {
      var c = 0;
      var cs = null;
      var vs = null;
      this.FStyleApplied = true;
      this.FIsStyling = true;
      this.BeginUpdate();
      try {
        c = -1;
        if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleBackgroundFillColor({get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }})) {
          this.FCellAppearance.FNormalLayout.FFill.SetColor(c);
          this.FCellAppearance.FNormalLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
          this.FFilterAppearance.FFill.SetColor(c);
          this.FFilterAppearance.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        };
        c = -1;
        if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleLineFillColor({get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }})) {
          this.FStroke.SetColor(c);
          this.FCellAppearance.FFixedLayout.FStroke.SetColor(c);
          this.FCellAppearance.FFixedSelectedLayout.FStroke.SetColor(c);
          this.FCellAppearance.FSelectedLayout.FStroke.SetColor(c);
          this.FCellAppearance.FNormalLayout.FStroke.SetColor(c);
          this.FCellAppearance.FFocusedLayout.FStroke.SetColor(c);
          this.FCellAppearance.FBandLayout.FStroke.SetColor(c);
          this.FCellAppearance.FGroupLayout.FStroke.SetColor(c);
          this.FCellAppearance.FSummaryLayout.FStroke.SetColor(c);
          this.FFilterAppearance.FStroke.SetColor(c);
        };
        c = -1;
        if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleHeaderFillColor({get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }})) {
          this.FCellAppearance.FFixedLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
          this.FCellAppearance.FFixedLayout.FFill.SetColor(c);
          this.FCellAppearance.FGroupLayout.FFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Darker(c,15));
          this.FCellAppearance.FSummaryLayout.FFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Darker(c,15));
          this.FCellAppearance.FGroupLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
          this.FCellAppearance.FSummaryLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        };
        c = -1;
        if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleHeaderFillColorTo({get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }})) {
          this.FCellAppearance.FFixedLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient);
          this.FCellAppearance.FFixedLayout.FFill.SetColorTo(c);
        };
        c = -1;
        if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleSelectionFillColor({get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }})) {
          this.FCellAppearance.FFixedSelectedLayout.FFill.SetColor(c);
          this.FCellAppearance.FFocusedLayout.FFill.SetColor(c);
          this.FCellAppearance.FSelectedLayout.FFill.SetColor(c);
          this.FCellAppearance.FFixedSelectedLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
          this.FCellAppearance.FFocusedLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
          this.FCellAppearance.FSelectedLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        };
        c = -1;
        if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleSelectionFillColorTo({get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }})) {
          this.FCellAppearance.FFixedSelectedLayout.FFill.SetColorTo(c);
          this.FCellAppearance.FFocusedLayout.FFill.SetColorTo(c);
          this.FCellAppearance.FSelectedLayout.FFill.SetColorTo(c);
          this.FCellAppearance.FFixedSelectedLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient);
          this.FCellAppearance.FFocusedLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient);
          this.FCellAppearance.FSelectedLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkGradient);
        };
        c = -1;
        if (pas["WEBLib.TMSFNCStyles"].TTMSFNCStyles.GetStyleTextFontColor({get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }})) {
          this.FCellAppearance.FFixedLayout.FFont.SetColor(c);
          this.FCellAppearance.FNormalLayout.FFont.SetColor(c);
          this.FCellAppearance.FFixedSelectedLayout.FFont.SetColor(c);
          this.FCellAppearance.FSelectedLayout.FFont.SetColor(c);
          this.FCellAppearance.FFocusedLayout.FFont.SetColor(c);
          this.FCellAppearance.FGroupLayout.FFont.SetColor(c);
          this.FCellAppearance.FSummaryLayout.FFont.SetColor(c);
          this.FFilterAppearance.FFont.SetColor(c);
        };
        cs = this.GetCustomHorizontalScrollBar();
        if (cs != null) cs.ApplyStyle();
        vs = this.GetCustomVerticalScrollBar();
        if (vs != null) vs.ApplyStyle();
      } finally {
        this.EndUpdate();
        this.FIsStyling = false;
      };
    };
    this.Assign = function (Source) {
      this.BeginUpdate();
      try {
        pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridData.Assign.apply(this,arguments);
        if ($mod.TTMSFNCDataGridRenderer.isPrototypeOf(Source)) {
          this.FIcons.Assign(rtl.as(Source,$mod.TTMSFNCDataGridRenderer).FIcons);
          this.FCellAppearance.Assign(rtl.as(Source,$mod.TTMSFNCDataGridRenderer).FCellAppearance);
          this.FCustomScrollBars = rtl.as(Source,$mod.TTMSFNCDataGridRenderer).FCustomScrollBars;
          this.FDragAppearance.Assign(rtl.as(Source,$mod.TTMSFNCDataGridRenderer).FDragAppearance);
          this.FFilterAppearance.Assign(rtl.as(Source,$mod.TTMSFNCDataGridRenderer).FFilterAppearance);
          this.FGlobalFont.Assign(rtl.as(Source,$mod.TTMSFNCDataGridRenderer).FGlobalFont);
          this.FHorizontalScrollBarVisible = rtl.as(Source,$mod.TTMSFNCDataGridRenderer).FHorizontalScrollBarVisible;
          this.FVerticalScrollBarVisible = rtl.as(Source,$mod.TTMSFNCDataGridRenderer).FVerticalScrollBarVisible;
          this.FScrollMode = rtl.as(Source,$mod.TTMSFNCDataGridRenderer).FScrollMode;
          this.FScrollUpdate = rtl.as(Source,$mod.TTMSFNCDataGridRenderer).FScrollUpdate;
          this.FStretchScrollBars = rtl.as(Source,$mod.TTMSFNCDataGridRenderer).FStretchScrollBars;
          this.FPaging = rtl.as(Source,$mod.TTMSFNCDataGridRenderer).FPaging;
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.AutoSizeColumn = function (AColumn, AMode, APadding) {
      var g = null;
      this.BeginUpdate();
      g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[1,1,false,true]);
      try {
        g.BeginScene();
        this.InternalAutoSizeColumn(AColumn,AMode,APadding,g);
        g.EndScene();
      } finally {
        g = rtl.freeLoc(g);
        this.EndUpdate();
      };
    };
    this.AutoSizeColumns = function (AMode, APadding) {
      var i = 0;
      var g = null;
      this.BeginUpdate();
      g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[1,1,false,true]);
      try {
        g.BeginScene();
        for (var $l = 0, $end = this.FColumnCount - 1; $l <= $end; $l++) {
          i = $l;
          this.InternalAutoSizeColumn(i,AMode,APadding,g);
        };
        g.EndScene();
      } finally {
        g = rtl.freeLoc(g);
        this.EndUpdate();
      };
    };
    this.AutoSizeGrid = function (AMode, APaddingColumn, APaddingRow) {
      var g = null;
      var i = 0;
      this.BeginUpdate();
      g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[1,1,false,true]);
      try {
        g.BeginScene();
        for (var $l = 0, $end = this.FColumnCount - 1; $l <= $end; $l++) {
          i = $l;
          this.InternalAutoSizeColumn(i,AMode,APaddingColumn,g);
        };
        for (var $l1 = 0, $end1 = this.FColumnCount - 1; $l1 <= $end1; $l1++) {
          i = $l1;
          this.InternalAutoSizeRow(i,AMode,APaddingRow,g);
        };
        g.EndScene();
      } finally {
        g = rtl.freeLoc(g);
        this.EndUpdate();
      };
    };
    this.AutoSizeRow = function (ARow, AMode, APadding) {
      var g = null;
      this.BeginUpdate();
      g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[1,1,false,true]);
      try {
        g.BeginScene();
        this.InternalAutoSizeRow(ARow,AMode,APadding,g);
        g.EndScene();
      } finally {
        g = rtl.freeLoc(g);
        this.EndUpdate();
      };
    };
    this.AutoSizeRows = function (AMode, APadding) {
      var i = 0;
      var g = null;
      this.BeginUpdate();
      g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[1,1,false,true]);
      try {
        g.BeginScene();
        for (var $l = 0, $end = this.FRowCount - 1; $l <= $end; $l++) {
          i = $l;
          this.InternalAutoSizeRow(i,AMode,APadding,g);
        };
        g.EndScene();
      } finally {
        g = rtl.freeLoc(g);
        this.EndUpdate();
      };
    };
    this.BeforeExport = function () {
      pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCore.BeforeExport.call(this);
      this.FSaveClipRect.$assign(this.FClipRect);
    };
    this.Calculate = function () {
      var $Self = this;
      var c = 0;
      var r = 0;
      var vr = 0;
      var sdx = 0.0;
      var sdy = 0.0;
      var dx = 0.0;
      var dy = 0.0;
      var offsetx = 0.0;
      var offsety = 0.0;
      var ac = 0;
      var ar = 0;
      var rc = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rclip = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var fcc = 0;
      var rcc = 0;
      var rcnt = 0;
      var ccnt = 0;
      function SetCellRectLeftRight() {
        sdx = dx;
        dx = dx + $Self.GetColumnWidth(c);
      };
      function SetCellRectTopBottom() {
        sdy = dy;
        dy = dy + $Self.GetRowHeight(r);
      };
      function AddCellWithKind(AKind) {
        var d = null;
        var sz = pas["WEBLib.TMSFNCTypes"].TSizeF.$new();
        var bc = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
        var cl = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
        var cx = 0.0;
        var cy = 0.0;
        var cc = 0;
        var rr = 0;
        var off = 0;
        var cell = null;
        var cls = null;
        cl.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r));
        d = $Self.GetCellData(cl.GetColumn(),cl.GetRow());
        $Self.BeginUsingCellData(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cl),d);
        try {
          if ($Self.IsCellMerged(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cl))) {
            bc.$assign($Self.BaseCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cl)));
            if ($Self.FMergedCells.Contains(bc)) {
              return}
             else $Self.FMergedCells.Add(bc);
            cl.$assign(bc);
            $Self.EndUsingCellData();
            d = $Self.GetCellData(cl.GetColumn(),cl.GetRow());
            $Self.BeginUsingCellData(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cl),d);
          };
          sz.$assign($Self.GetCellSize(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cl)));
          cx = sdx;
          cy = sdy;
          if (AKind === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckCell) {
            for (var $l = cl.GetColumn(), $end = $Self.GetStartColumn() - 1; $l <= $end; $l++) {
              cc = $l;
              cx = cx - $Self.GetColumnWidth(cc);
            };
            for (var $l1 = cl.GetRow(), $end1 = $Self.GetStartRow() - 1; $l1 <= $end1; $l1++) {
              rr = $l1;
              cy = cy - $Self.GetRowHeight(rr);
            };
            if (cl.GetColumn() === $Self.GetOptions().FColumn.FNodeIndex) {
              if ($Self.GetRowType(cl.GetRow()) === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowType.grtDefault) {
                off = 20 * Math.max(0,$Self.GetRowNodeLevel(cl.GetRow()) - 1)}
               else off = 20 * Math.max(0,$Self.GetRowNodeLevel(cl.GetRow()));
              cx = cx + off;
              sz.cx = sz.cx - off;
            };
          };
          rc.Left = pas.System.Int(cx) + 0.5;
          rc.Right = pas.System.Int(cx + sz.cx) + 0.5;
          rc.Top = pas.System.Int(cy) + 0.5;
          rc.Bottom = pas.System.Int(cy + sz.cy) + 0.5;
          cls = $Self.GetBaseCellClass(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cl));
          $Self.DoGetCellClass(cl.GetColumn(),cl.GetRow(),{get: function () {
              return cls;
            }, set: function (v) {
              cls = v;
            }});
          if (cls != null) {
            cell = cls.$create("Create$1",[pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rc),cl.GetColumn(),cl.GetRow(),d,AKind,$Self]);
            $Self.ConfigureCell(cell,$mod.TTMSFNCDataGridCellConfigureMode.gccmProperties);
            var $tmp = AKind;
            if ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckCell) {
              $Self.FNormalCellList.Add(cell);
              $Self.AddCellToDisplay(cell,$Self.FNormalCellDisplay);
            } else if (($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFreezeFixedRowCell) || ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFreezeFixedColumnCell) || ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFreezeRootCell) || ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFixedRootCell)) {
              $Self.FFixedRootCellList.Add(cell);
              $Self.AddCellToDisplay(cell,$Self.FFixedRootCellDisplay);
            } else if (($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFreezeRowCell) || ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFixedRowCell)) {
              $Self.FFixedRowCellList.Add(cell);
              $Self.AddCellToDisplay(cell,$Self.FFixedRowCellDisplay);
            } else if (($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFreezeColumnCell) || ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFixedColumnCell)) {
              $Self.FFixedColumnCellList.Add(cell);
              $Self.AddCellToDisplay(cell,$Self.FFixedColumnCellDisplay);
            };
          };
        } finally {
          $Self.EndUsingCellData();
        };
      };
      function AddFreezeRootCell() {
        AddCellWithKind(pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFreezeRootCell);
      };
      function AddFixedRootCell() {
        AddCellWithKind(pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFixedRootCell);
      };
      function AddFixedRowCell() {
        AddCellWithKind(pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFixedRowCell);
      };
      function AddCell() {
        AddCellWithKind(pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckCell);
      };
      function AddFreezeRowCell() {
        AddCellWithKind(pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFreezeRowCell);
      };
      function AddFreezeColumnCell() {
        AddCellWithKind(pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFreezeColumnCell);
      };
      function AddFixedColumnCell() {
        AddCellWithKind(pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFixedColumnCell);
      };
      function AddFreezeFixedColumnCell() {
        AddCellWithKind(pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFreezeFixedColumnCell);
      };
      function AddFreezeFixedRowCell() {
        AddCellWithKind(pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellKind.gckFreezeFixedRowCell);
      };
      function IncVisibleRowIndex() {
        if ($Self.IsRowDisplayed(r) && $Self.IsRowNormal(r)) {
          $Self.SetRowIndex(r,vr);
          vr += 1;
        };
      };
      if ((this.GetUpdateCount() > 0) || this.GetIsDestroying()) return;
      this.FMergedCells.Clear();
      this.FNormalCellDisplay.Clear();
      this.FFixedColumnCellDisplay.Clear();
      this.FFixedRowCellDisplay.Clear();
      this.FFixedRootCellDisplay.Clear();
      this.FNormalCellList.Clear();
      this.FFixedRowCellList.Clear();
      this.FFixedColumnCellList.Clear();
      this.FFixedRootCellList.Clear();
      if ((this.FColumnCount > 0) && (this.FRowCount > 0)) {
        offsetx = this.FTotalColumnOffset;
        offsety = this.FTotalRowOffset;
        ac = this.GetStartColumn();
        ar = this.GetStartRow();
        rcnt = Math.min(this.GetStopRow(),this.FRowCount - 1 - this.FFixedBottomRowCount);
        ccnt = Math.min(this.GetStopColumn(),this.FColumnCount - 1 - this.FFixedRightColumnCount);
        fcc = this.FFixedColumnCount + this.FFreezeColumnCount;
        rcc = this.FFixedRowCount + this.FFreezeRowCount;
        rclip.$assign(this.GetContentClipRect());
        dx = rclip.Right - rclip.Left;
        for (var $l = this.FColumnCount - this.FFixedRightColumnCount, $end = this.FColumnCount - 1; $l <= $end; $l++) {
          c = $l;
          dx = dx - this.GetColumnWidth(c);
        };
        for (var $l1 = this.FColumnCount - this.FFixedRightColumnCount, $end1 = this.FColumnCount - 1; $l1 <= $end1; $l1++) {
          c = $l1;
          SetCellRectLeftRight();
          dy = rclip.Bottom - rclip.Top;
          for (var $l2 = this.FRowCount - this.FFixedBottomRowCount, $end2 = this.FRowCount - 1; $l2 <= $end2; $l2++) {
            r = $l2;
            dy = dy - this.GetRowHeight(r);
          };
          vr = 0;
          for (var $l3 = this.FRowCount - this.FFixedBottomRowCount, $end3 = this.FRowCount - 1; $l3 <= $end3; $l3++) {
            r = $l3;
            IncVisibleRowIndex();
            SetCellRectTopBottom();
            if (this.IsCellFixedRoot(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r)))) AddFixedRootCell();
          };
          dy = offsety;
          r = ar;
          vr = 0;
          while (r <= rcnt) {
            IncVisibleRowIndex();
            SetCellRectTopBottom();
            if (!this.IsCellFreezeFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r))) && !this.IsCellFixedRoot(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r))) && (r >= this.FFixedRowCount)) {
              if (this.IsCellFreeze(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r)))) {
                AddFreezeColumnCell()}
               else if (!this.IsCellFreezeFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r)))) AddFixedColumnCell();
            };
            if (this.IsRowNode(r) && (this.GetRowNodeState(r) === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowNodeState.grnsCollapsed)) r = r + this.GetRowNodeChildCount(r);
            r += 1;
          };
          dy = 0;
          vr = 0;
          for (var $l4 = 0, $end4 = rcc - 1; $l4 <= $end4; $l4++) {
            r = $l4;
            IncVisibleRowIndex();
            SetCellRectTopBottom();
            if (this.IsCellFreezeFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r))) && (r >= this.FFixedRowCount)) {
              AddFreezeFixedColumnCell()}
             else if (this.IsCellFixedRoot(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r)))) AddFixedRootCell();
          };
        };
        dx = 0;
        for (var $l5 = 0, $end5 = fcc - 1; $l5 <= $end5; $l5++) {
          c = $l5;
          SetCellRectLeftRight();
          dy = 0;
          vr = 0;
          for (var $l6 = 0, $end6 = rcc - 1; $l6 <= $end6; $l6++) {
            r = $l6;
            IncVisibleRowIndex();
            SetCellRectTopBottom();
            if (this.IsCellFreezeRoot(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r)))) {
              AddFreezeRootCell()}
             else if (this.IsCellFreezeFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r))) && (r >= this.FFixedRowCount) && (c < this.FFixedColumnCount)) {
              AddFreezeFixedColumnCell()}
             else if (this.IsCellFreezeFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r))) && (c >= this.FFixedColumnCount) && (r < this.FFixedRowCount)) {
              AddFreezeFixedRowCell()}
             else if (this.IsCellFixedRoot(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r)))) AddFixedRootCell();
          };
          dy = offsety;
          r = ar;
          vr = 0;
          while (r <= rcnt) {
            IncVisibleRowIndex();
            SetCellRectTopBottom();
            if (!this.IsCellFreezeFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r))) && !this.IsCellFixedRoot(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r))) && (r >= this.FFixedRowCount)) {
              if (this.IsCellFreeze(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r)))) {
                AddFreezeColumnCell()}
               else if (!this.IsCellFreezeFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r)))) AddFixedColumnCell();
            };
            if (this.IsRowNode(r) && (this.GetRowNodeState(r) === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowNodeState.grnsCollapsed)) r = r + this.GetRowNodeChildCount(r);
            r += 1;
          };
          dy = rclip.Bottom - rclip.Top;
          for (var $l7 = this.FRowCount - this.FFixedBottomRowCount, $end7 = this.FRowCount - 1; $l7 <= $end7; $l7++) {
            r = $l7;
            dy = dy - this.GetRowHeight(r);
          };
          vr = 0;
          for (var $l8 = this.FRowCount - this.FFixedBottomRowCount, $end8 = this.FRowCount - 1; $l8 <= $end8; $l8++) {
            r = $l8;
            IncVisibleRowIndex();
            SetCellRectTopBottom();
            if (this.IsCellFreezeFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r))) && (c >= this.FFixedColumnCount)) {
              AddFreezeFixedRowCell()}
             else if (this.IsCellFixedRoot(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r)))) AddFixedRootCell();
          };
        };
        dx = offsetx;
        for (var $l9 = ac, $end9 = ccnt; $l9 <= $end9; $l9++) {
          c = $l9;
          SetCellRectLeftRight();
          dy = 0;
          vr = 0;
          for (var $l10 = 0, $end10 = rcc - 1; $l10 <= $end10; $l10++) {
            r = $l10;
            IncVisibleRowIndex();
            SetCellRectTopBottom();
            if (!this.IsCellFreezeFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r))) && !this.IsCellFixedRoot(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r))) && (c >= this.FFixedColumnCount)) {
              if (this.IsCellFreeze(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r)))) {
                AddFreezeRowCell()}
               else if (!this.IsCellFreezeFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r)))) AddFixedRowCell();
            };
          };
          dy = offsety;
          r = ar;
          vr = 0;
          while (r <= rcnt) {
            while (this.IsRowFilteredDisplay(r)) r += 1;
            IncVisibleRowIndex();
            SetCellRectTopBottom();
            if (!this.IsCellFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r))) && !this.IsCellFreeze(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r))) && !this.IsCellFreezeFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r)))) AddCell();
            if (this.IsRowNode(r) && (this.GetRowNodeState(r) === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowNodeState.grnsCollapsed)) r = r + this.GetRowNodeChildCount(r);
            r += 1;
          };
          dy = rclip.Bottom - rclip.Top;
          for (var $l11 = this.FRowCount - this.FFixedBottomRowCount, $end11 = this.FRowCount - 1; $l11 <= $end11; $l11++) {
            r = $l11;
            dy = dy - this.GetRowHeight(r);
          };
          vr = 0;
          for (var $l12 = this.FRowCount - this.FFixedBottomRowCount, $end12 = this.FRowCount - 1; $l12 <= $end12; $l12++) {
            r = $l12;
            IncVisibleRowIndex();
            SetCellRectTopBottom();
            if (!this.IsCellFreezeFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r))) && !this.IsCellFixedRoot(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r)))) AddFixedRowCell();
          };
        };
      };
      this.UpdateInplaceEditorPosition();
      this.DoDisplay();
    };
    this.ChangeDPIScale = function (M, D) {
      var C = 0;
      this.BeginUpdate();
      try {
        this.GetOptions().FFiltering.FDropDownWidth = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.GetOptions().FFiltering.FDropDownWidth,M,D);
        this.GetOptions().FFiltering.FDropDownHeight = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.GetOptions().FFiltering.FDropDownHeight,M,D);
        this.FFilterAppearance.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FFilterAppearance.FFont.FHeight,M,D));
        this.FCellAppearance.FFixedLayout.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FCellAppearance.FFixedLayout.FFont.FHeight,M,D));
        this.FCellAppearance.FNormalLayout.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FCellAppearance.FNormalLayout.FFont.FHeight,M,D));
        this.FCellAppearance.FGroupLayout.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FCellAppearance.FGroupLayout.FFont.FHeight,M,D));
        this.FCellAppearance.FSummaryLayout.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FCellAppearance.FSummaryLayout.FFont.FHeight,M,D));
        this.FCellAppearance.FSelectedLayout.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FCellAppearance.FSelectedLayout.FFont.FHeight,M,D));
        this.FCellAppearance.FFocusedLayout.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FCellAppearance.FFocusedLayout.FFont.FHeight,M,D));
        this.FCellAppearance.FFixedSelectedLayout.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FCellAppearance.FFixedSelectedLayout.FFont.FHeight,M,D));
        this.FCellAppearance.FBandLayout.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FCellAppearance.FBandLayout.FFont.FHeight,M,D));
        this.FCellAppearance.FFilterMatchLayout.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FCellAppearance.FFilterMatchLayout.FFont.FHeight,M,D));
        this.FCellAppearance.FFilterInverseMatchLayout.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FCellAppearance.FFilterInverseMatchLayout.FFont.FHeight,M,D));
        this.SetDefaultRowHeight(pas.System.Int(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FDefaultRowHeight,M,D)));
        this.SetDefaultColumnWidth(pas.System.Int(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FDefaultColumnWidth,M,D)));
        this.FPadding.SetLeft(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FPadding.FLeft,M,D));
        this.FPadding.SetTop(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FPadding.FLeft,M,D));
        this.FPadding.SetRight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FPadding.FLeft,M,D));
        this.FPadding.SetBottom(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FPadding.FLeft,M,D));
        this.GetOptions().FGrouping.FSummaryHeight = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.GetOptions().FGrouping.FSummaryHeight,M,D);
        this.GetOptions().FGrouping.FHeaderHeight = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.GetOptions().FGrouping.FHeaderHeight,M,D);
        for (var $l = 0, $end = this.FColumns.GetCount() - 1; $l <= $end; $l++) {
          C = $l;
          this.FColumns.GetItem$1(C).SetWidth(pas.System.Int(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivSingle(this.FColumns.GetItem$1(C).GetWidth(),M,D)));
          this.FColumns.GetItem$1(C).FAppearance.FFixedLayout.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FColumns.GetItem$1(C).FAppearance.FFixedLayout.FFont.FHeight,M,D));
          this.FColumns.GetItem$1(C).FAppearance.FNormalLayout.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FColumns.GetItem$1(C).FAppearance.FNormalLayout.FFont.FHeight,M,D));
          this.FColumns.GetItem$1(C).FAppearance.FGroupLayout.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FColumns.GetItem$1(C).FAppearance.FGroupLayout.FFont.FHeight,M,D));
          this.FColumns.GetItem$1(C).FAppearance.FSummaryLayout.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FColumns.GetItem$1(C).FAppearance.FSummaryLayout.FFont.FHeight,M,D));
          this.FColumns.GetItem$1(C).FAppearance.FSelectedLayout.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FColumns.GetItem$1(C).FAppearance.FSelectedLayout.FFont.FHeight,M,D));
          this.FColumns.GetItem$1(C).FAppearance.FFocusedLayout.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FColumns.GetItem$1(C).FAppearance.FFocusedLayout.FFont.FHeight,M,D));
          this.FColumns.GetItem$1(C).FAppearance.FFixedSelectedLayout.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FColumns.GetItem$1(C).FAppearance.FFixedSelectedLayout.FFont.FHeight,M,D));
          this.FColumns.GetItem$1(C).FAppearance.FBandLayout.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FColumns.GetItem$1(C).FAppearance.FBandLayout.FFont.FHeight,M,D));
          this.FColumns.GetItem$1(C).FAppearance.FFilterMatchLayout.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FColumns.GetItem$1(C).FAppearance.FFilterMatchLayout.FFont.FHeight,M,D));
          this.FColumns.GetItem$1(C).FAppearance.FFilterInverseMatchLayout.FFont.SetHeight(pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.MulDivInt(this.FColumns.GetItem$1(C).FAppearance.FFilterInverseMatchLayout.FFont.FHeight,M,D));
        };
        this.ClearControlCache();
      } finally {
        this.EndUpdate();
      };
    };
    this.ClearColumns = function () {
      this.FColumns.Clear();
    };
    this.ClearControlCache = function () {
      if ($impl.TTMSFNCDataGridCellOpen.FControlCacheList != null) $impl.TTMSFNCDataGridCellOpen.FControlCacheList.Clear();
    };
    this.ClearFocus = function () {
    };
    this.ClearSelection = function () {
      this.FFocusedCell.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(-1,-1));
      this.FFirstCell.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(-1,-1));
      this.FSaveCell.$assign(this.FFocusedCell);
      this.FRealCell.$assign(this.FFocusedCell);
      this.GetSelectedCellDictionary().Clear();
      this.GetSelectedColumnDictionary().Clear();
      this.GetSelectedRowDictionary().Clear();
      this.FSelection.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCellRange(-1,-1,-1,-1));
      this.Display();
    };
    this.CloseColumnsEditor = function () {
      if ((this.GetColumnsEditor() != null) && pas["WEBLib.TMSFNCDataGridColumnsEditor"].TTMSFNCDataGridColumnsEditor.isPrototypeOf(this.GetColumnsEditor())) rtl.as(this.GetColumnsEditor(),pas["WEBLib.TMSFNCDataGridColumnsEditor"].TTMSFNCDataGridColumnsEditor).Close();
    };
    this.CloseFilterPopup = function () {
      if (this.FFilterPopup != null) this.FFilterPopup.SetIsOpen(false);
    };
    this.CopyToClipboard = function (ASelectedCells) {
      var s = 0;
      var z = 0;
      var ct = "";
      var cliptext = "";
      var ACellRange = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoordRange.$new();
      var v = undefined;
      if (ASelectedCells) {
        ACellRange.$assign(this.FSelection)}
       else ACellRange.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCellRange(0,0,this.FColumnCount - 1,this.FRowCount - 1));
      if ((ACellRange.StartCell.GetRow() === -1) || (ACellRange.StartCell.GetColumn() === -1) || (ACellRange.StopCell.GetRow() === -1) || (ACellRange.StopCell.GetColumn() === -1)) return;
      cliptext = "";
      for (var $l = ACellRange.StartCell.GetRow(), $end = ACellRange.StopCell.GetRow(); $l <= $end; $l++) {
        z = $l;
        for (var $l1 = ACellRange.StartCell.GetColumn(), $end1 = ACellRange.StopCell.GetColumn(); $l1 <= $end1; $l1++) {
          s = $l1;
          v = this.GetCell(s,z);
          this.DoSaveCellData(s,z,{get: function () {
              return v;
            }, set: function (w) {
              v = w;
            }});
          ct = this.$class.ValueToString(v);
          if (pas.System.Pos("\r",ct) > 0) {
            ct = '"' + pas["WEBLib.TMSFNCDataGridUtil"].CRToLF(ct) + '"';
          };
          if (pas.System.Pos("</",ct) > 0) ct = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.HTMLStrip(ct);
          if (pas["WEBLib.TMSFNCDataGridUtil"].LinesInText(ct,true) > 1) pas["WEBLib.TMSFNCDataGridUtil"].LineFeedsToCSV({get: function () {
              return ct;
            }, set: function (v) {
              ct = v;
            }});
          if (s < ACellRange.StopCell.GetColumn()) {
            cliptext = cliptext + ct + "\t"}
           else cliptext = cliptext + ct;
        };
        if (ACellRange.StartCell.GetRow() < ACellRange.StopCell.GetRow()) cliptext = cliptext + "\r\n";
      };
      pas["WEBLib.TMSFNCUtils"].TTMSFNCClipBoard.SetText(cliptext);
    };
    this.CreateDragBitmap = function (AMouseInfo) {
      var g = null;
      var dr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = "";
      var p = null;
      var sc = 0.0;
      var ci = null;
      return;
      if (!this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FDragCell))) return;
      p = this.GetParentHost();
      if (!(p != null)) return;
      sc = 1.0;
      if (pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl.isPrototypeOf(p)) sc = rtl.as(p,pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl).FResourceScaleFactor;
      this.DestroyDragBitmap();
      dr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(AMouseInfo.X,AMouseInfo.Y,AMouseInfo.X + this.GetHiddenColumnWidth(this.FDragCell.GetColumn()),AMouseInfo.Y + this.GetHiddenRowHeight(this.FDragCell.GetRow())));
      this.FDragBitmap = pas["WEBLib.TMSFNCImage"].TTMSFNCImage.$create("Create$1",[p]);
      this.FDragBitmap.SetWidth(Math.round((dr.Right - dr.Left) / sc) + 1);
      this.FDragBitmap.SetHeight(Math.round((dr.Bottom - dr.Top) / sc) + 1);
      this.FDragBitmap.SetLeft(Math.round(dr.Left / sc));
      this.FDragBitmap.SetTop(Math.round(dr.Top / sc));
      g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[Math.round(this.FDragBitmap.GetWidth() * sc),Math.round(this.FDragBitmap.GetHeight() * sc),false,true]);
      g.FBitmapContainer = this.GetBitmapContainer();
      try {
        g.BeginScene();
        ci = this.CreateCell(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(pas["WEBLib.TMSFNCTypes"].RectF(0,0,dr.Right - dr.Left,dr.Bottom - dr.Top)),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FDragCell));
        if (ci != null) {
          ci.BeforeExport();
          try {
            this.ConfigureCell(ci,$mod.TTMSFNCDataGridCellConfigureMode.gccmBoth);
            this.ApplyCellScale(ci,sc);
            this.DrawCell(g,ci);
          } finally {
            ci.AfterExport();
            ci = rtl.freeLoc(ci);
          };
        };
        g.EndScene();
        r = g.FBitmap.GetBase64Image();
        this.FDragBitmap.FBitmaps.AddBitmapFromResource(r,1.0);
      } finally {
        g = rtl.freeLoc(g);
      };
      this.FDragBitmap.SetParent(p);
    };
    this.CutToClipboard = function (ASelectedCells) {
      this.CopyToClipboard(ASelectedCells);
      if (ASelectedCells) {
        this.ClearCells(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoordRange.$clone(this.FSelection))}
       else this.Clear();
    };
    this.DestroyDragBitmap = function () {
      if (this.FDragBitmap != null) {
        this.FDragBitmap.SetParent(null);
        rtl.free(this,"FDragBitmap");
        this.FDragBitmap = null;
      };
    };
    this.Display = function () {
      if ((this.GetUpdateCount() > 0) || this.GetIsDestroying()) return;
      this.BuildDisplay(this.FNormalCellList,this.FNormalCellDisplay);
      this.BuildDisplay(this.FFixedRowCellList,this.FFixedRowCellDisplay);
      this.BuildDisplay(this.FFixedColumnCellList,this.FFixedColumnCellDisplay);
      this.BuildDisplay(this.FFixedRootCellList,this.FFixedRootCellDisplay);
      this.UpdateInplaceEditorPosition();
      this.DoDisplay();
    };
    this.Draw = function (AGraphics) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var st = null;
      st = AGraphics.SaveState(false);
      try {
        r.$assign(this.GetContentClipRect());
        AGraphics.ClipRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r));
        this.DrawDisplay(AGraphics,this.FNormalCellDisplay);
        this.DrawDisplay(AGraphics,this.FFixedColumnCellDisplay);
        this.DrawDisplay(AGraphics,this.FFixedRowCellDisplay);
        this.DrawDisplay(AGraphics,this.FFixedRootCellDisplay);
        this.DrawAutoFillPreview(AGraphics);
        this.DrawAutoFillHandle(AGraphics);
        this.DrawDragging(AGraphics);
        if (!this.FIsExporting) {
          AGraphics.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
          AGraphics.FStroke.Assign(this.FStroke);
          AGraphics.DrawRectangle$2(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmShrinkAll);
        };
        this.DoAfterDrawGrid(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r));
      } finally {
        AGraphics.RestoreState(st,false);
      };
      this.DrawEmptySpaces(AGraphics);
      this.DrawScrollBars(AGraphics);
    };
    this.EditCell = function (ACell, ACellStart, AInsertKey, AValue, AKey) {
      var $Self = this;
      var ins = false;
      var c = false;
      var a = false;
      var ci = false;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var v = pas.RTTI.TValue.$new();
      var cl = null;
      var ct = 0;
      var vl = undefined;
      var p = null;
      var ctl = null;
      var l = null;
      var fc = 0;
      function CreateCaretPos(ALine, APos) {
        var Result = pas.Types.TPoint.$new();
        Result.x = ALine;
        Result.y = APos;
        return Result;
      };
      function TryExecuteEditor() {
        var Result = pas.RTTI.TValue.$new();
        var AContext = pas.RTTI.TRTTIContext.$new();
        var rt = null;
        var m = null;
        Result.$assign(pas.RTTI.TValue.Empty());
        AContext.$assign(pas.RTTI.TRTTIContext.Create());
        try {
          rt = AContext.GetType($Self.FInplaceEditor.$class.ClassInfo());
          m = rt.GetMethod("Execute");
          if (m != null) Result.$assign(m.Invoke$1($Self.FInplaceEditor,[]));
        } finally {
          AContext.Free();
        };
        return Result;
      };
      if (this.IsCellDisabled(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell))) return;
      p = this.GetParentHost();
      this.FInplaceEditorTarget = $mod.TTMSFNCDataGridInplaceEditorTarget.getCellValue;
      this.DoGetInplaceEditorTarget(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),{p: this, get: function () {
          return this.p.FInplaceEditorTarget;
        }, set: function (v) {
          this.p.FInplaceEditorTarget = v;
        }});
      this.DoGetInplaceEditorType(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),{p: this, get: function () {
          return this.p.FInplaceEditorType;
        }, set: function (v) {
          this.p.FInplaceEditorType = v;
        }});
      var $tmp = this.FInplaceEditorTarget;
      if ($tmp === $mod.TTMSFNCDataGridInplaceEditorTarget.getCellValue) {
        ci = !(this.FInplaceEditorType in rtl.createSet($mod.TTMSFNCDataGridInplaceEditorType.getComboBox,$mod.TTMSFNCDataGridInplaceEditorType.getDatePicker,$mod.TTMSFNCDataGridInplaceEditorType.getColorPicker,$mod.TTMSFNCDataGridInplaceEditorType.getTrackBar,$mod.TTMSFNCDataGridInplaceEditorType.getHTMLEditor,$mod.TTMSFNCDataGridInplaceEditorType.getCustom));
        if (AInsertKey && ci) {
          vl = AValue}
         else vl = this.GetCell(ACell.GetColumn(),ACell.GetRow());
      } else if ($tmp === $mod.TTMSFNCDataGridInplaceEditorTarget.getFillColor) {
        if (this.GetHasLayout(ACell.GetColumn(),ACell.GetRow())) {
          l = this.GetLayout(ACell.GetColumn(),ACell.GetRow());
          if (l.FFill.FKind === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid) {
            ct = l.FFill.FColor;
            vl = ct;
          };
        };
      };
      ins = true;
      this.DoBeforeOpenInplaceEditor(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),{get: function () {
          return vl;
        }, set: function (v) {
          vl = v;
        }},{get: function () {
          return ins;
        }, set: function (v) {
          ins = v;
        }});
      if (ins) {
        this.DestroyEditor();
        var $tmp1 = this.FInplaceEditorType;
        if (($tmp1 === $mod.TTMSFNCDataGridInplaceEditorType.getMixedCaseEdit) || ($tmp1 === $mod.TTMSFNCDataGridInplaceEditorType.getUppercaseEdit) || ($tmp1 === $mod.TTMSFNCDataGridInplaceEditorType.getSignedFloatEdit) || ($tmp1 === $mod.TTMSFNCDataGridInplaceEditorType.getFloatEdit) || ($tmp1 === $mod.TTMSFNCDataGridInplaceEditorType.getSignedNumericEdit) || ($tmp1 === $mod.TTMSFNCDataGridInplaceEditorType.getHexEdit) || ($tmp1 === $mod.TTMSFNCDataGridInplaceEditorType.getMoneyEdit) || ($tmp1 === $mod.TTMSFNCDataGridInplaceEditorType.getLowerCaseEdit) || ($tmp1 === $mod.TTMSFNCDataGridInplaceEditorType.getNumericEdit) || ($tmp1 === $mod.TTMSFNCDataGridInplaceEditorType.getValidCharsEdit) || ($tmp1 === $mod.TTMSFNCDataGridInplaceEditorType.getAlphaNumericEdit) || ($tmp1 === $mod.TTMSFNCDataGridInplaceEditorType.getEdit)) {
          this.FInplaceEditor = $mod.TTMSFNCDataGridEdit.$create("Create$1",[p]);
          var $tmp2 = this.FInplaceEditorType;
          if ($tmp2 === $mod.TTMSFNCDataGridInplaceEditorType.getNumericEdit) {
            rtl.as(this.FInplaceEditor,$mod.TTMSFNCDataGridEdit).SetEditType$1(pas["WEBLib.TMSFNCEdit"].TTMSFNCEditType.etNumeric)}
           else if ($tmp2 === $mod.TTMSFNCDataGridInplaceEditorType.getSignedNumericEdit) {
            rtl.as(this.FInplaceEditor,$mod.TTMSFNCDataGridEdit).SetEditType$1(pas["WEBLib.TMSFNCEdit"].TTMSFNCEditType.etSignedNumeric)}
           else if ($tmp2 === $mod.TTMSFNCDataGridInplaceEditorType.getFloatEdit) {
            rtl.as(this.FInplaceEditor,$mod.TTMSFNCDataGridEdit).SetEditType$1(pas["WEBLib.TMSFNCEdit"].TTMSFNCEditType.etFloat)}
           else if ($tmp2 === $mod.TTMSFNCDataGridInplaceEditorType.getSignedFloatEdit) {
            rtl.as(this.FInplaceEditor,$mod.TTMSFNCDataGridEdit).SetEditType$1(pas["WEBLib.TMSFNCEdit"].TTMSFNCEditType.etSignedFloat)}
           else if ($tmp2 === $mod.TTMSFNCDataGridInplaceEditorType.getUppercaseEdit) {
            rtl.as(this.FInplaceEditor,$mod.TTMSFNCDataGridEdit).SetEditType$1(pas["WEBLib.TMSFNCEdit"].TTMSFNCEditType.etUpperCase)}
           else if ($tmp2 === $mod.TTMSFNCDataGridInplaceEditorType.getMixedCaseEdit) {
            rtl.as(this.FInplaceEditor,$mod.TTMSFNCDataGridEdit).SetEditType$1(pas["WEBLib.TMSFNCEdit"].TTMSFNCEditType.etMixedCase)}
           else if ($tmp2 === $mod.TTMSFNCDataGridInplaceEditorType.getLowerCaseEdit) {
            rtl.as(this.FInplaceEditor,$mod.TTMSFNCDataGridEdit).SetEditType$1(pas["WEBLib.TMSFNCEdit"].TTMSFNCEditType.etLowerCase)}
           else if ($tmp2 === $mod.TTMSFNCDataGridInplaceEditorType.getMoneyEdit) {
            rtl.as(this.FInplaceEditor,$mod.TTMSFNCDataGridEdit).SetEditType$1(pas["WEBLib.TMSFNCEdit"].TTMSFNCEditType.etMoney)}
           else if ($tmp2 === $mod.TTMSFNCDataGridInplaceEditorType.getHexEdit) {
            rtl.as(this.FInplaceEditor,$mod.TTMSFNCDataGridEdit).SetEditType$1(pas["WEBLib.TMSFNCEdit"].TTMSFNCEditType.etHex)}
           else if ($tmp2 === $mod.TTMSFNCDataGridInplaceEditorType.getAlphaNumericEdit) {
            rtl.as(this.FInplaceEditor,$mod.TTMSFNCDataGridEdit).SetEditType$1(pas["WEBLib.TMSFNCEdit"].TTMSFNCEditType.etAlphaNumeric)}
           else if ($tmp2 === $mod.TTMSFNCDataGridInplaceEditorType.getValidCharsEdit) rtl.as(this.FInplaceEditor,$mod.TTMSFNCDataGridEdit).SetEditType$1(pas["WEBLib.TMSFNCEdit"].TTMSFNCEditType.etValidChars);
        } else if ($tmp1 === $mod.TTMSFNCDataGridInplaceEditorType.getComboBox) {
          this.FInplaceEditor = $mod.TTMSFNCDataGridComboBox.$create("Create$1",[p]);
          rtl.as(this.FInplaceEditor,$mod.TTMSFNCDataGridComboBox).SetStyle(pas["WEBLib.StdCtrls"].TComboBoxStyle.csDropDownList);
        } else if ($tmp1 === $mod.TTMSFNCDataGridInplaceEditorType.getComboEdit) {
          this.FInplaceEditor = $mod.TTMSFNCDataGridComboEdit.$create("Create$1",[p]);
          rtl.as(this.FInplaceEditor,$mod.TTMSFNCDataGridComboEdit).SetStyle(pas["WEBLib.StdCtrls"].TComboBoxStyle.csDropDown);
        } else if ($tmp1 === $mod.TTMSFNCDataGridInplaceEditorType.getSpinBox) {
          this.FInplaceEditor = $mod.TTMSFNCDataGridSpinBox.$create("Create$1",[p])}
         else if ($tmp1 === $mod.TTMSFNCDataGridInplaceEditorType.getDatePicker) {
          this.FInplaceEditor = $mod.TTMSFNCDataGridDatePicker.$create("Create$1",[p])}
         else if ($tmp1 === $mod.TTMSFNCDataGridInplaceEditorType.getColorPicker) {
          this.FInplaceEditor = $mod.TTMSFNCDataGridColorPicker.$create("Create$1",[p]);
          rtl.as(this.FInplaceEditor,$mod.TTMSFNCDataGridColorPicker).SetMode(pas["WEBLib.TMSFNCColorSelector"].TTMSFNCCustomColorSelectorMode.csmExtended);
        } else if ($tmp1 === $mod.TTMSFNCDataGridInplaceEditorType.getTrackBar) {
          this.FInplaceEditor = $mod.TTMSFNCDataGridTrackBar.$create("Create$1",[p])}
         else if ($tmp1 === $mod.TTMSFNCDataGridInplaceEditorType.getMemo) {
          this.FInplaceEditor = $mod.TTMSFNCDataGridMemo.$create("Create$1",[p])}
         else if ($tmp1 === $mod.TTMSFNCDataGridInplaceEditorType.getHTMLEditor) {
          this.FInplaceEditor = $mod.TTMSFNCDataGridHTMLEditor.$create("Create$1",[p])}
         else if ($tmp1 === $mod.TTMSFNCDataGridInplaceEditorType.getCustom) {
          this.FInplaceEditorCustomClass = null;
          this.DoGetInplaceEditorClass(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),{p: this, get: function () {
              return this.p.FInplaceEditorCustomClass;
            }, set: function (v) {
              this.p.FInplaceEditorCustomClass = v;
            }});
          if (this.FInplaceEditorCustomClass != null) this.FInplaceEditor = this.FInplaceEditorCustomClass.$create("Create$1",[p]);
        };
        a = true;
        if ((this.FInplaceEditor != null) && !pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.isPrototypeOf(this.FInplaceEditor)) {
          r.$assign(this.GetInplaceEditorRect(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell)));
          a = a && !pas["WEBLib.TMSFNCTypes"].RectIsEmpty(r);
        };
        if ((this.FInplaceEditor != null) && a) {
          if (pas["WEBLib.StdCtrls"].TCustomEdit.isPrototypeOf(this.FInplaceEditor)) {
            ctl = this.GetCellObjectForCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
            if (ctl != null) {
              fc = rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomEdit).FFont.FColor;
              rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomEdit).FFont.Assign(ctl.GetLayout().FFont);
              rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomEdit).FFont.SetColor(fc);
              var $tmp3 = ctl.GetLayout().FTextAlign;
              if ($tmp3 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter) {
                rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomEdit).SetAlignment(pas.Classes.TAlignment.taCenter)}
               else if ($tmp3 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading) {
                rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomEdit).SetAlignment(pas.Classes.TAlignment.taLeftJustify)}
               else if ($tmp3 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaTrailing) rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomEdit).SetAlignment(pas.Classes.TAlignment.taRightJustify);
            };
          };
          if (pas["WEBLib.StdCtrls"].TCustomMemo.isPrototypeOf(this.FInplaceEditor)) {
            ctl = this.GetCellObjectForCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
            if (ctl != null) {
              fc = rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomMemo).FFont.FColor;
              rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomMemo).FFont.Assign(ctl.GetLayout().FFont);
              rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomMemo).FFont.SetColor(fc);
            };
          };
          cl = this.GetColumn(ACell.GetColumn());
          if ((cl != null) && ($mod.TTMSFNCDataGridColumnSetting.gcsEditorItems in cl.FSettings)) {
            if (pas["WEBLib.StdCtrls"].TCustomComboBox.isPrototypeOf(this.FInplaceEditor)) {
              if (pas["WEBLib.StdCtrls"].TCustomComboBox.isPrototypeOf(this.FInplaceEditor)) rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomComboBox).FItems.Assign(cl.FEditorItems);
            };
          };
          if (!pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.isPrototypeOf(this.FInplaceEditor)) {
            if (pas["WEBLib.StdCtrls"].TCustomMemo.isPrototypeOf(this.FInplaceEditor)) ;
            if (pas["WEBLib.StdCtrls"].TCustomEdit.isPrototypeOf(this.FInplaceEditor)) ;
            this.FInplaceEditor.FOnKeyDown = rtl.createCallback($Self,"DoEditorKeyDown");
            this.FInplaceEditor.FOnKeyUp = rtl.createCallback($Self,"DoEditorKeyUp");
            this.FInplaceEditor.FOnKeyPress = rtl.createCallback($Self,"DoEditorKeyPress");
            this.FInplaceEditor.FOnExit = rtl.createCallback($Self,"DoEditorExit");
          };
          if ($mod.TTMSFNCDataGridEdit.isPrototypeOf(this.FInplaceEditor) && (this.GetOptions().FEditing.FAutoComplete.FType !== $mod.TTMSFNCDataGridAutoCompleteType.gactDisabled)) {
            rtl.as(this.FInplaceEditor,$mod.TTMSFNCDataGridEdit).FLookup.FDisplayList.Assign(this.GetOptions().FEditing.FAutoComplete.FItems);
            rtl.as(this.FInplaceEditor,$mod.TTMSFNCDataGridEdit).FAutoComplete = this.GetOptions().FEditing.FAutoComplete.FType === $mod.TTMSFNCDataGridAutoCompleteType.gactNormal;
            rtl.as(this.FInplaceEditor,$mod.TTMSFNCDataGridEdit).FLookup.FEnabled = this.GetOptions().FEditing.FAutoComplete.FType !== $mod.TTMSFNCDataGridAutoCompleteType.gactNormal;
          };
          if ($mod.TTMSFNCDataGridHTMLEditor.isPrototypeOf(this.FInplaceEditor)) rtl.as(this.FInplaceEditor,$mod.TTMSFNCDataGridHTMLEditor).SetBitmapContainer(this.GetBitmapContainer());
          this.FEditingCell.$assign(ACell);
          if (!pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.isPrototypeOf(this.FInplaceEditor)) {
            this.FInplaceEditor.SetParent(p);
            this.UpdateInplaceEditorPosition();
          };
          this.DoGetInplaceEditorProperties(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),this.FInplaceEditor,this.FInplaceEditorType);
          this.DoCellEditGetData(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),this.FInplaceEditor,{get: function () {
              return vl;
            }, set: function (v) {
              vl = v;
            }});
          c = true;
          this.DoBeforeInplaceEditorSetValue(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),this.FInplaceEditor,{get: function () {
              return vl;
            }, set: function (v) {
              vl = v;
            }},{get: function () {
              return c;
            }, set: function (v) {
              c = v;
            }});
          if (c) {
            pas["WEBLib.TMSFNCDataGridData"].SetObjectValue(this.FInplaceEditor,vl,"");
            this.DoAfterInplaceEditorSetValue(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),this.FInplaceEditor,vl);
          };
          if ((this.FAdapter != null) && $mod.TTMSFNCDataGridRendererDataAdapter.isPrototypeOf(this.FAdapter)) rtl.as(this.FAdapter,$mod.TTMSFNCDataGridRendererDataAdapter).EditCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
          c = false;
          if (pas["WEBLib.TMSFNCCustomComponent"].TTMSFNCCustomComponent.isPrototypeOf(this.FInplaceEditor)) {
            v.$assign(TryExecuteEditor());
            if (v.IsType$1$$$G$$rtti$$Longint(true)) {
              this.FMouseDown = false;
              this.CloseInplaceEditor(v.AsType$$$G$$rtti$$Longint() === 2,false,false,true);
              c = true;
            };
          } else {
            if (this.GetOptions().FEditing.FDirectDropDown) {
              if (pas["WEBLib.StdCtrls"].TCustomComboBox.isPrototypeOf(this.FInplaceEditor)) {
                rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomComboBox).SetDroppedDown(true);
              } else if (pas["WEBLib.TMSFNCCustomPicker"].TTMSFNCCustomPicker.isPrototypeOf(this.FInplaceEditor)) {
                rtl.as(this.FInplaceEditor,pas["WEBLib.TMSFNCCustomPicker"].TTMSFNCCustomPicker).DropDown();
              };
            };
            if (this.FInplaceEditor.CanFocus()) {
              this.FInplaceEditor.SetFocus();
              this.FClearMouseDown = false;
              this.FDblClick = false;
            };
            if (pas["WEBLib.StdCtrls"].TCustomEdit.isPrototypeOf(this.FInplaceEditor)) {
              try {
                if (AInsertKey) {
                  rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomEdit).SetSelStart(rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomEdit).GetText().length);
                  rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomEdit).SetSelLength(0);
                } else {
                  var $tmp4 = ACellStart;
                  if ($tmp4 === $mod.TTMSFNCDataGridEditCellStart.gcsNone) {
                    rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomEdit).SetSelStart(0);
                    rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomEdit).SetSelLength(rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomEdit).GetText().length);
                  } else if ($tmp4 === $mod.TTMSFNCDataGridEditCellStart.gcsStart) {
                    rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomEdit).SetSelStart(0);
                    rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomEdit).SetSelLength(0);
                  } else if ($tmp4 === $mod.TTMSFNCDataGridEditCellStart.gcsEnd) {
                    rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomEdit).SetSelStart(rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomEdit).GetText().length);
                    rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomEdit).SetSelLength(0);
                  };
                };
              } finally {
              };
            } else if (pas["WEBLib.StdCtrls"].TCustomMemo.isPrototypeOf(this.FInplaceEditor)) {
              if (AInsertKey) {
                if (rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomMemo).FLines.GetCount() > 0) {
                  rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomMemo).FCaretPosition.$assign(CreateCaretPos(rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomMemo).FLines.GetCount() - 1,rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomMemo).FLines.Get(rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomMemo).FLines.GetCount() - 1).length))}
                 else rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomMemo).FCaretPosition.$assign(CreateCaretPos(0,0));
                rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomMemo).SetSelLength(0);
              } else {
                var $tmp5 = ACellStart;
                if ($tmp5 === $mod.TTMSFNCDataGridEditCellStart.gcsNone) {
                  rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomMemo).FCaretPosition.$assign(CreateCaretPos(0,0));
                  rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomMemo).SetSelLength(rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomMemo).GetText().length);
                } else if ($tmp5 === $mod.TTMSFNCDataGridEditCellStart.gcsStart) {
                  rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomMemo).FCaretPosition.$assign(CreateCaretPos(0,0));
                  rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomMemo).SetSelLength(0);
                } else if ($tmp5 === $mod.TTMSFNCDataGridEditCellStart.gcsEnd) {
                  if (rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomMemo).FLines.GetCount() > 0) {
                    rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomMemo).FCaretPosition.$assign(CreateCaretPos(rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomMemo).FLines.GetCount() - 1,rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomMemo).FLines.Get(rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomMemo).FLines.GetCount() - 1).length))}
                   else rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomMemo).FCaretPosition.$assign(CreateCaretPos(0,0));
                  rtl.as(this.FInplaceEditor,pas["WEBLib.StdCtrls"].TCustomMemo).SetSelLength(0);
                };
              };
            };
          };
          this.FInplaceEditorActive = !c;
        };
        if (this.FInplaceEditorActive) this.DoAfterOpenInplaceEditor(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),this.FInplaceEditor,vl);
      };
    };
    this.ExportNotification = function (AState, ARow) {
      pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCore.ExportNotification.apply(this,arguments);
      if ((this.FAdapter != null) && $mod.TTMSFNCDataGridRendererDataAdapter.isPrototypeOf(this.FAdapter)) rtl.as(this.FAdapter,$mod.TTMSFNCDataGridRendererDataAdapter).ExportNotification(AState,ARow);
    };
    this.FirstPage = function () {
      this.SetPageIndex(0);
    };
    this.Focus = function () {
      if (this.FOnFocus != null) this.FOnFocus(this);
    };
    this.GoToCell = function (ACell, ASelect) {
      pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridData.GoToCell.apply(this,arguments);
      if (ASelect) {
        this.SelectCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),{},false,false,false)}
       else this.Navigate(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell),true,false,false);
    };
    this.GoToPage = function (APageIndex) {
      var r = 0;
      r = this.GetRowForPageIndex(APageIndex);
      if (r !== -1) this.SetTopRow(r);
    };
    this.GoToFirstPage = function () {
      this.GoToPage(0);
    };
    this.GoToLastPage = function () {
      this.GoToPage(this.GetPageCount() - 1);
    };
    this.HandleDragBitmapDrop = function (AMouseInfo) {
      this.DestroyDragBitmap();
    };
    this.HandleDragBitmapOver = function (AMouseInfo) {
      if (this.FDragBitmap != null) this.FDragBitmap.SetBounds(Math.round(AMouseInfo.X - this.FSaveLeft),Math.round(AMouseInfo.Y - this.FSaveTop),this.FDragBitmap.GetWidth(),this.FDragBitmap.GetHeight());
    };
    this.HandleDragBitmapStart = function (AMouseInfo) {
      var img = null;
      var offx = 0.0;
      var offy = 0.0;
      var p = null;
      p = this.GetParentHost();
      if (p != null) {
        this.CreateDragBitmap(pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseInfo.$clone(AMouseInfo));
        if (this.FDragBitmap != null) {
          img = this.FDragBitmap;
          offx = img.GetLeft();
          offy = img.GetTop();
          img.SetParent(p);
          img.SetBounds(Math.round(offx),Math.round(offy),img.GetWidth(),img.GetHeight());
          this.FSaveLeft = AMouseInfo.X - offx;
          this.FSaveTop = AMouseInfo.Y - offy;
        };
      };
    };
    this.HandleDragEnd = function (AMouseInfo) {
      var b = false;
      var res = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      this.HandleDragBitmapDrop(pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseInfo.$clone(AMouseInfo));
      res.$assign(this.XYToCell(AMouseInfo.X,AMouseInfo.Y,false));
      var $tmp = this.FDraggingType;
      if ($tmp === $mod.TTMSFNCDataGridDraggingType.gdtSwap) {
        if ((res.GetColumn() !== -1) && (res.GetRow() !== -1)) {
          if (this.FDraggingMode === $mod.TTMSFNCDataGridDraggingMode.gdmColumnDragging) {
            b = true;
            this.DoCanDropColumn(this.FDragCell.GetColumn(),res.GetColumn(),{get: function () {
                return b;
              }, set: function (v) {
                b = v;
              }});
            if (b) {
              this.BeginUpdate();
              this.MoveColumn(this.FDragCell.GetColumn(),res.GetColumn());
              this.EndUpdate();
              this.DoColumnDropped(this.FDragCell.GetColumn(),res.GetColumn());
            };
          } else if (this.FDraggingMode === $mod.TTMSFNCDataGridDraggingMode.gdmRowDragging) {
            b = true;
            this.DoCanDropRow(this.FDragCell.GetRow(),res.GetRow(),{get: function () {
                return b;
              }, set: function (v) {
                b = v;
              }});
            if (b) {
              this.BeginUpdate();
              this.MoveRow(this.FDragCell.GetRow(),res.GetRow());
              this.EndUpdate();
              this.DoRowDropped(this.FDragCell.GetRow(),res.GetRow());
            };
          };
        };
      } else if ($tmp === $mod.TTMSFNCDataGridDraggingType.gdtInsert) {
        if (this.FDraggingMode === $mod.TTMSFNCDataGridDraggingMode.gdmColumnDragging) {
          b = true;
          this.DoCanDropColumn(this.FDragCell.GetColumn(),res.GetColumn(),{get: function () {
              return b;
            }, set: function (v) {
              b = v;
            }});
          if (b) {
            this.BeginUpdate();
            this.UnhideColumn(this.FDragCell.GetColumn());
            this.MoveColumn(this.FDragCell.GetColumn(),res.GetColumn());
            this.EndUpdate();
            this.DoColumnDropped(this.FDragCell.GetColumn(),res.GetColumn());
          };
        } else if (this.FDraggingMode === $mod.TTMSFNCDataGridDraggingMode.gdmRowDragging) {
          b = true;
          this.DoCanDropRow(this.FDragCell.GetRow(),res.GetRow(),{get: function () {
              return b;
            }, set: function (v) {
              b = v;
            }});
          if (b) {
            this.BeginUpdate();
            this.UnhideRow(this.FDragCell.GetRow());
            this.MoveRow(this.FDragCell.GetRow(),res.GetRow());
            this.EndUpdate();
            this.DoRowDropped(this.FDragCell.GetRow(),res.GetRow());
          };
        };
      };
    };
    this.HandleDragging = function (AMouseInfo) {
      var newposx = 0.0;
      var newposy = 0.0;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FX = AMouseInfo.X;
      this.FY = AMouseInfo.Y;
      this.HandleDragBitmapOver(pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseInfo.$clone(AMouseInfo));
      if (((this.FDragCell.GetRow() < this.FFixedRowCount) || (this.FDragCell.GetRow() > (this.FRowCount - 1 - this.FFixedBottomRowCount))) && this.GetOptions().FMouse.FColumnDragging) {
        r.$assign(this.GetContentClipRect());
        newposx = this.FX;
        if ((newposx <= (r.Right - r.Left)) && (newposx >= 0)) {
          this.GetDragTimer().SetEnabled(false);
          if ((newposx > this.GetTotalFixedColumnWidth(true)) && (newposx < (r.Right - r.Left - this.GetTotalFixedRightColumnWidth()))) this.FDragScrollCell.$assign(this.XYToCell(newposx,(r.Bottom - r.Top) / 2,false));
        } else if (newposx > (r.Right - r.Left)) {
          this.GetDragTimer().SetEnabled(true)}
         else if (newposx < 0) this.GetDragTimer().SetEnabled(true);
        this.FDragCellTo.$assign(this.XYToCell(AMouseInfo.X,AMouseInfo.Y,false));
        if (this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FDragCellTo))) {
          this.FDragCellTo.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(this.FDragCellTo.GetColumn(),0))}
         else this.FDragCellTo.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(-1,-1));
        this.Display();
      } else if (((this.FDragCell.GetColumn() < this.FFixedColumnCount) || (this.FDragCell.GetColumn() > (this.FColumnCount - 1 - this.FFixedRightColumnCount))) && this.GetOptions().FMouse.FRowDragging) {
        r.$assign(this.GetContentClipRect());
        newposy = this.FY;
        if ((newposy <= (r.Bottom - r.Top)) && (newposy >= 0)) {
          this.GetDragTimer().SetEnabled(false);
          if ((newposy > this.GetTotalFixedRowHeight(true)) && (newposy < (r.Bottom - r.Top - this.GetTotalFixedBottomRowHeight()))) this.FDragScrollCell.$assign(this.XYToCell((r.Right - r.Left) / 2,newposy,false));
        } else if (newposy > (r.Bottom - r.Top)) {
          this.GetDragTimer().SetEnabled(true)}
         else if (newposy < 0) this.GetDragTimer().SetEnabled(true);
        this.FDragCellTo.$assign(this.XYToCell(AMouseInfo.X,AMouseInfo.Y,false));
        if (this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FDragCellTo))) {
          this.FDragCellTo.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(0,this.FDragCellTo.GetRow()))}
         else this.FDragCellTo.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(-1,-1));
        this.Display();
      };
    };
    this.HandleEnter = function () {
      var cl = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      if ((this.GetFocusedCell().GetColumn() === -1) && (this.GetFocusedCell().GetRow() === -1)) {
        if (this.FTabKey === $mod.TTMSFNCDataGridTabKeyMode.gtkmNormal) {
          this.SetFocusedCell(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(this.FFixedColumnCount,this.FFixedRowCount))}
         else if (this.FTabKey === $mod.TTMSFNCDataGridTabKeyMode.gtkmShift) {
          cl.SetColumn(this.FColumnCount - 1 - this.FFixedRightColumnCount);
          cl.SetRow(this.FRowCount - 1 - this.FFixedBottomRowCount);
          this.SetFocusedCell(cl);
        } else this.Display();
        this.FTabKey = $mod.TTMSFNCDataGridTabKeyMode.gtkmNone;
      };
    };
    this.HandleExit = function () {
      this.ResetScrollBarCapture();
      this.FClearMouseDown = this.FClosing;
      this.FMouseDown = false;
      this.FMouseDblClick = false;
      this.FDragCell.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(-1,-1));
      this.FDragCellTo.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(-1,-1));
      this.Display();
    };
    this.HandleKey = function (AKeyInfo) {
      var psel = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var sel = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var real = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var cs = 0;
      var rs = 0;
      var Allow = false;
      var obj = null;
      var cl = false;
      var ce = false;
      var cc = false;
      var s = 0;
      var r = 0;
      var c = 0;
      var $tmp = AKeyInfo.Kind;
      if ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridKeyKind.gkkPress) {
        if (AKeyInfo.Key in rtl.createSet(9)) return;
        if (!this.GetOptions().FEditing.FEnabled && this.GetOptions().FLookup.FEnabled) {
          if (AKeyInfo.Key in rtl.createSet(27,45,46,38,40,37,39,36,35,33,34,9)) {
            this.FLookupString = ""}
           else {
            this.GetLookupTimer().SetEnabled(false);
            if (AKeyInfo.KeyChar !== "\x00") {
              if (this.GetOptions().FLookup.FIncremental) {
                this.FLookupString = this.FLookupString + AKeyInfo.KeyChar}
               else this.FLookupString = AKeyInfo.KeyChar;
              this.GetLookupTimer().SetEnabled(true);
              cl = true;
              this.DoBeforeLookup({p: this, get: function () {
                  return this.p.FLookupString;
                }, set: function (v) {
                  this.p.FLookupString = v;
                }},{get: function () {
                  return cl;
                }, set: function (v) {
                  cl = v;
                }});
              if (cl) {
                this.Lookup(this.FLookupString,true,true);
                this.DoAfterLookup(this.FLookupString);
              };
            };
          };
        };
        if (this.GetOptions().FEditing.FEnabled) {
          Allow = true;
          this.DoCanEditCell(this.GetFocusedCell().GetColumn(),this.GetFocusedCell().GetRow(),{get: function () {
              return Allow;
            }, set: function (v) {
              Allow = v;
            }});
          if (Allow) {
            if (AKeyInfo.Key >= 32) {
              this.EditCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.GetFocusedCell()),$mod.TTMSFNCDataGridEditCellStart.gcsStart,true,AKeyInfo.KeyChar,AKeyInfo.Key);
              AKeyInfo.KeyChar = "\x00";
              return;
            };
          };
        };
      } else if ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridKeyKind.gkkDown) {
        if (AKeyInfo.Key === 9) return;
        if (AKeyInfo.Key in rtl.createSet(27,45,46,38,40,37,39,36,35,33,34,9)) this.FLookupString = "";
        Allow = true;
        this.DoCanEditCell(this.GetFocusedCell().GetColumn(),this.GetFocusedCell().GetRow(),{get: function () {
            return Allow;
          }, set: function (v) {
            Allow = v;
          }});
        if (Allow) {
          if ((AKeyInfo.Key === 113) || (AKeyInfo.Key === 13)) {
            this.EditCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.GetFocusedCell()),$mod.TTMSFNCDataGridEditCellStart.gcsNone,false,"",0);
            return;
          };
        };
        if (AKeyInfo.Key === 32) {
          obj = this.GetCellObjectForCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.GetFocusedCell()));
          if (obj != null) obj.HandleKey(AKeyInfo);
          return;
        };
        if ((pas.Classes.TShiftState$a.ssShift in AKeyInfo.Shift) && !(pas.Classes.TShiftState$a.ssCtrl in AKeyInfo.Shift) && !(pas.Classes.TShiftState$a.ssAlt in AKeyInfo.Shift) && (AKeyInfo.Key === 45) && !this.FEditing && this.GetOptions().FClipboard.FEnabled) this.PasteFromClipboard();
        if ((pas.Classes.TShiftState$a.ssCtrl in AKeyInfo.Shift) && !(pas.Classes.TShiftState$a.ssShift in AKeyInfo.Shift) && !(pas.Classes.TShiftState$a.ssAlt in AKeyInfo.Shift)) {
          var $tmp1 = AKeyInfo.Key;
          if ($tmp1 === 77) {
            if (this.GetOptions().FKeyboard.FCellMergeShortcut) {
              this.MergeRange(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoordRange.$clone(this.FSelection));
              AKeyInfo.Key = 0;
            };
          } else if ($tmp1 === 83) {
            if (this.GetOptions().FKeyboard.FCellMergeShortcut) {
              this.SplitCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FSelection.StartCell));
              AKeyInfo.Key = 0;
            };
          } else if ($tmp1 === 88) {
            if (this.GetOptions().FClipboard.FEnabled && !this.FEditing) {
              Allow = true;
              this.DoBeforeCutToClipboard({get: function () {
                  return Allow;
                }, set: function (v) {
                  Allow = v;
                }});
              if (Allow) {
                this.CutToClipboard(true);
                this.DoAfterCutToClipboard();
              };
            };
          } else if ($tmp1 === 67) {
            if (this.GetOptions().FClipboard.FEnabled && !this.FEditing) {
              Allow = true;
              this.DoBeforeCopyToClipboard({get: function () {
                  return Allow;
                }, set: function (v) {
                  Allow = v;
                }});
              if (Allow) {
                this.CopyToClipboard(true);
                this.DoAfterCopyToClipboard();
              };
            };
          } else if ($tmp1 === 86) {
            if (this.GetOptions().FClipboard.FEnabled && !this.FEditing) {
              Allow = true;
              this.DoBeforePasteFromClipboard({get: function () {
                  return Allow;
                }, set: function (v) {
                  Allow = v;
                }});
              if (Allow) {
                this.PasteFromClipboard();
                this.DoAfterPasteFromClipboard();
              };
            };
          } else if ($tmp1 === 65) {
            this.SelectAllCells(true)}
           else if ($tmp1 === 70) {
            if (this.GetOptions().FKeyboard.FFindShortcut && !this.FEditing) {
              AKeyInfo.Key = 0;
              this.ShowFindDialog();
            };
          } else if ($tmp1 === 72) {
            if (this.GetOptions().FKeyboard.FReplaceShortcut && !this.FEditing) {
              AKeyInfo.Key = 0;
              this.ShowReplaceDialog();
            };
          } else if ($tmp1 === 46) {
            if (this.GetOptions().FClipboard.FEnabled) this.CutToClipboard(true);
          } else if ($tmp1 === 45) {
            if (this.GetOptions().FClipboard.FEnabled) this.CopyToClipboard(true);
          } else if ($tmp1 === 34) {
            this.SetTopRow(this.GetTopRow() + this.GetKeyboardPageScrollSize())}
           else if ($tmp1 === 33) {
            this.SetTopRow(this.GetTopRow() - this.GetKeyboardPageScrollSize())}
           else if ($tmp1 === 38) {
            this.SetTopRow(this.GetTopRow() - 1);
          } else if ($tmp1 === 40) {
            rs = this.RowSpan(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(this.GetLeftColumn(),this.GetTopRow())));
            if (rs > 0) {
              this.SetTopRow(this.GetTopRow() + rs)}
             else this.SetTopRow(this.GetTopRow() + 1);
          } else if ($tmp1 === 37) {
            sel.$assign(this.GetFocusedCell());
            if (this.IsRowNode(sel.GetRow()) && (sel.GetColumn() === this.GetOptions().FColumn.FNodeIndex)) {
              cc = true;
              this.DoCellBeforeNodeCollapse(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(sel),{get: function () {
                  return cc;
                }, set: function (v) {
                  cc = v;
                }});
              if (cc) {
                this.CollapseNode(sel.GetRow());
                this.DoCellAfterNodeCollapse(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(sel));
              };
            } else this.SetLeftColumn(this.GetLeftColumn() - 1);
          } else if ($tmp1 === 39) {
            sel.$assign(this.GetFocusedCell());
            if (this.IsRowNode(sel.GetRow()) && (sel.GetColumn() === this.GetOptions().FColumn.FNodeIndex)) {
              ce = true;
              this.DoCellBeforeNodeExpand(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(sel),{get: function () {
                  return ce;
                }, set: function (v) {
                  ce = v;
                }});
              if (ce) {
                this.ExpandNode(sel.GetRow());
                this.DoCellAfterNodeExpand(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(sel));
              };
            } else {
              cs = this.ColumnSpan(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(this.GetLeftColumn(),this.GetTopRow())));
              if (cs > 0) {
                this.SetLeftColumn(this.GetLeftColumn() + cs)}
               else this.SetLeftColumn(this.GetLeftColumn() + 1);
            };
          } else if ($tmp1 === 36) {
            var $tmp2 = this.GetOptions().FKeyboard.FHomeKeyHandling;
            if ($tmp2 === $mod.TTMSFNCDataGridHomeKeyHandling.ghkhFirstColumn) {
              this.SetLeftColumn(this.FFixedColumnCount)}
             else if ($tmp2 === $mod.TTMSFNCDataGridHomeKeyHandling.ghkhFirstRow) this.SetTopRow(this.FFixedRowCount);
          } else if ($tmp1 === 35) {
            var $tmp3 = this.GetOptions().FKeyboard.FEndKeyHandling;
            if ($tmp3 === $mod.TTMSFNCDataGridEndKeyHandling.genkhLastColumn) {
              this.SetLeftColumn(this.FColumnCount - 1 - this.FFixedRightColumnCount)}
             else if ($tmp3 === $mod.TTMSFNCDataGridEndKeyHandling.genkhLastRow) this.SetTopRow(this.FRowCount - 1 - this.FFixedBottomRowCount);
          };
        } else {
          sel.$assign(this.GetFocusedCell());
          real.$assign(this.FRealCell);
          if (this.IsAnchorMode() && (pas.Classes.TShiftState$a.ssShift in AKeyInfo.Shift)) if (this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(real))) sel.$assign(real);
          var $tmp4 = AKeyInfo.Key;
          if ($tmp4 === 46) {
            if (rtl.eqSet(AKeyInfo.Shift,{})) {
              var $tmp5 = this.GetOptions().FKeyboard.FDeleteKeyHandling;
              if ($tmp5 === $mod.TTMSFNCDataGridDeleteKeyHandling.gdkhDeleteRow) {
                if (this.FRowCount > (this.FFixedRowCount + this.FFixedBottomRowCount)) {
                  Allow = true;
                  this.DoCanDeleteRow(sel.GetRow(),{get: function () {
                      return Allow;
                    }, set: function (v) {
                      Allow = v;
                    }});
                  if (Allow) {
                    this.DeleteRow(sel.GetRow());
                    s = sel.GetRow();
                    sel.SetRow(Math.max(this.FFixedRowCount,Math.min(sel.GetRow(),this.FRowCount - 1 - this.FFixedBottomRowCount)));
                    this.DoDeleteRow(s);
                  };
                };
              } else if ($tmp5 === $mod.TTMSFNCDataGridDeleteKeyHandling.gdkhClearSelectedCells) {
                Allow = true;
                this.DoBeforeClearSelectedCells(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoordRange.$clone(this.FSelection),{get: function () {
                    return Allow;
                  }, set: function (v) {
                    Allow = v;
                  }});
                if (Allow) {
                  this.BeginUpdate();
                  try {
                    for (var $l = this.FSelection.StartCell.GetColumn(), $end = this.FSelection.StopCell.GetColumn(); $l <= $end; $l++) {
                      c = $l;
                      for (var $l1 = this.FSelection.StartCell.GetRow(), $end1 = this.FSelection.StopCell.GetRow(); $l1 <= $end1; $l1++) {
                        r = $l1;
                        if (this.IsCellSelected(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r))) && !this.IsCellReadOnly(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(c,r)))) this.SetCell(c,r,null);
                      };
                    };
                  } finally {
                    this.EndUpdate();
                  };
                  this.DoAfterClearSelectedCells(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoordRange.$clone(this.FSelection));
                };
              };
            };
          } else if ($tmp4 === 45) {
            if (rtl.eqSet(AKeyInfo.Shift,{})) {
              if (sel.GetRow() === -1) sel.SetRow(this.FFixedRowCount - 1);
              var $tmp6 = this.GetOptions().FKeyboard.FInsertKeyHandling;
              if ($tmp6 === $mod.TTMSFNCDataGridInsertKeyHandling.gikhInsertRowBefore) {
                Allow = true;
                this.DoCanInsertRow(sel.GetRow(),{get: function () {
                    return Allow;
                  }, set: function (v) {
                    Allow = v;
                  }});
                if (Allow) {
                  this.InsertRow(sel.GetRow());
                  s = sel.GetRow();
                  sel.SetRow(Math.max(this.FFixedRowCount,Math.min(sel.GetRow(),this.FRowCount - 1 - this.FFixedBottomRowCount)));
                  this.DoInsertRow(s);
                };
              } else if ($tmp6 === $mod.TTMSFNCDataGridInsertKeyHandling.gikhInsertRowAfter) {
                Allow = true;
                this.DoCanInsertRow(sel.GetRow(),{get: function () {
                    return Allow;
                  }, set: function (v) {
                    Allow = v;
                  }});
                if (Allow) {
                  s = sel.GetRow() + 1;
                  this.InsertRow(s);
                  sel.SetRow(Math.max(this.FFixedRowCount,Math.min(sel.GetRow() + 1,this.FRowCount - 1 - this.FFixedBottomRowCount)));
                  this.DoInsertRow(s);
                };
              };
            };
          } else if ($tmp4 === 114) {
            if (this.GetOptions().FKeyboard.FFindShortcut) {
              this.FindNext(!(pas.Classes.TShiftState$a.ssShift in AKeyInfo.Shift));
              AKeyInfo.Key = 0;
            };
          } else if ($tmp4 === 34) {
            psel.$assign(sel);
            sel.$assign(this.NextSelectableRow(sel.GetColumn(),Math.min(this.FRowCount - this.FFixedBottomRowCount - 1,(sel.GetRow() + this.GetKeyboardPageScrollSize()) - 1)));
            if (this.IsCellDisabled(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(sel))) sel.$assign(psel);
            if (!this.IsColumnHidden(real.GetColumn())) sel.SetColumn(real.GetColumn());
          } else if ($tmp4 === 33) {
            psel.$assign(sel);
            sel.$assign(this.PreviousSelectableRow(sel.GetColumn(),Math.max(this.FFixedRowCount,(sel.GetRow() - this.GetKeyboardPageScrollSize()) + 1)));
            if (this.IsCellDisabled(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(sel))) sel.$assign(psel);
            if (!this.IsColumnHidden(real.GetColumn())) sel.SetColumn(real.GetColumn());
          } else if ($tmp4 === 38) {
            sel.$assign(this.PreviousSelectableRow(sel.GetColumn(),sel.GetRow()));
            if (!this.IsColumnHidden(real.GetColumn())) sel.SetColumn(real.GetColumn());
          } else if ($tmp4 === 40) {
            r = sel.GetRow();
            sel.$assign(this.NextSelectableRow(sel.GetColumn(),sel.GetRow()));
            if ((sel.GetRow() === r) && this.GetOptions().FKeyboard.FAppendRowOnArrowKeyDown) {
              Allow = true;
              sel.SetRow(sel.GetRow() + 1);
              this.DoCanAppendRow(sel.GetRow(),{get: function () {
                  return Allow;
                }, set: function (v) {
                  Allow = v;
                }});
              if (Allow) {
                this.InsertRow(sel.GetRow());
                this.DoAppendRow(sel.GetRow());
              };
            };
            if (!this.IsColumnHidden(real.GetColumn())) sel.SetColumn(real.GetColumn());
          } else if ($tmp4 === 37) {
            sel.$assign(this.PreviousSelectableColumn(sel.GetColumn(),sel.GetRow()));
            if (!this.IsRowHidden(real.GetRow())) sel.SetRow(real.GetRow());
          } else if ($tmp4 === 39) {
            c = sel.GetColumn();
            sel.$assign(this.NextSelectableColumn(sel.GetColumn(),sel.GetRow()));
            if ((sel.GetColumn() === c) && this.GetOptions().FKeyboard.FAppendColumnOnArrowKeyRight) {
              Allow = true;
              sel.SetColumn(sel.GetColumn() + 1);
              this.DoCanAppendColumn(sel.GetColumn(),{get: function () {
                  return Allow;
                }, set: function (v) {
                  Allow = v;
                }});
              if (Allow) {
                this.InsertColumn(sel.GetColumn());
                this.DoAppendColumn(sel.GetColumn());
              };
            };
            if (!this.IsRowHidden(real.GetRow())) sel.SetRow(real.GetRow());
          } else if ($tmp4 === 36) {
            if (this.GetOptions().FKeyboard.FHomeKeyHandling === $mod.TTMSFNCDataGridHomeKeyHandling.ghkhFirstRow) {
              sel.SetRow(this.FFixedRowCount);
              if (!this.IsColumnHidden(real.GetColumn())) sel.SetColumn(real.GetColumn());
              sel.$assign(this.NextSelectableRow(sel.GetColumn(),sel.GetRow() - 1));
            } else if (this.GetOptions().FKeyboard.FHomeKeyHandling === $mod.TTMSFNCDataGridHomeKeyHandling.ghkhFirstColumn) {
              sel.SetColumn(this.FFixedColumnCount);
              if (!this.IsRowHidden(real.GetRow())) sel.SetRow(real.GetRow());
              sel.$assign(this.NextSelectableColumn(sel.GetColumn() - 1,sel.GetRow()));
            };
          } else if ($tmp4 === 35) {
            if (this.GetOptions().FKeyboard.FEndKeyHandling === $mod.TTMSFNCDataGridEndKeyHandling.genkhLastRow) {
              sel.SetRow(this.FRowCount - 1 - this.FFixedBottomRowCount);
              if (!this.IsColumnHidden(real.GetColumn())) sel.SetColumn(real.GetColumn());
              sel.$assign(this.PreviousSelectableRow(sel.GetColumn(),sel.GetRow() + 1));
            } else if (this.GetOptions().FKeyboard.FEndKeyHandling === $mod.TTMSFNCDataGridEndKeyHandling.genkhLastColumn) {
              sel.SetColumn(this.FColumnCount - 1 - this.FFixedRightColumnCount);
              if (!this.IsRowHidden(real.GetRow())) sel.SetRow(real.GetRow());
              sel.$assign(this.PreviousSelectableColumn(sel.GetColumn() + 1,sel.GetRow()));
            };
          };
          var $tmp7 = AKeyInfo.Key;
          if (($tmp7 === 38) || ($tmp7 === 37) || ($tmp7 === 40) || ($tmp7 === 39) || ($tmp7 === 36) || ($tmp7 === 35) || ($tmp7 === 34) || ($tmp7 === 33) || ($tmp7 === 46) || ($tmp7 === 45)) {
            if (pas.Classes.TShiftState$a.ssCtrl in AKeyInfo.Shift) {
              this.Navigate(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(sel),false,false,false)}
             else this.SelectCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(sel),rtl.refSet(AKeyInfo.Shift),false,false,false);
            AKeyInfo.Key = 0;
          };
        };
      } else if ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridKeyKind.gkkUp) {
        if (AKeyInfo.Key === 32) {
          obj = this.GetCellObjectForCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.GetFocusedCell()));
          if (obj != null) obj.HandleKey(AKeyInfo);
        };
      } else if ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridKeyKind.gkkDialog) {
        this.FTabKey = $mod.TTMSFNCDataGridTabKeyMode.gtkmNone;
        if ((AKeyInfo.Key === 9) && (this.GetOptions().FKeyboard.FTabKeyHandling === $mod.TTMSFNCDataGridTabKeyHandling.gtkhMixed)) {
          if (pas.Classes.TShiftState$a.ssShift in AKeyInfo.Shift) {
            this.FTabKey = $mod.TTMSFNCDataGridTabKeyMode.gtkmShift}
           else this.FTabKey = $mod.TTMSFNCDataGridTabKeyMode.gtkmNormal;
        };
        if (this.IsFocused() || ((this.FInplaceEditor !== null) && this.FInplaceEditor.IsFocused())) {
          this.ProcessTab(AKeyInfo,this.GetOptions().FKeyboard.FTabKeyDirection,this.GetOptions().FKeyboard.FTabKeyHandling,this.GetOptions().FKeyboard.FTabKeyDirectEdit,$mod.TTMSFNCDataGridEditCellStart.gcsNone);
        };
      };
    };
    this.HandleMouse = function (AMouseInfo) {
      var $Self = this;
      var sizingRes = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var sel = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var psel = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var cl = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var cell = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var sizingCell = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var res = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var sizingObj = null;
      var obj = null;
      var sx = 0.0;
      var sy = 0.0;
      var cdColumn = false;
      var cdRow = false;
      var newsz = 0.0;
      var sizingFixed = false;
      var sizingRowsz = false;
      var sizingColsz = false;
      var fxd = false;
      var fixed = false;
      var rowsz = false;
      var colsz = false;
      var allow = false;
      var bctl = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseInfo.$new();
      var cr = 0;
      var contentr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var hss = 0.0;
      var vss = 0.0;
      var enablescroll = false;
      var hld = false;
      var h = 0.0;
      var v = 0.0;
      var fh = 0.0;
      var fv = 0.0;
      var tr = 0;
      var c = null;
      var cp = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var sz = 0.0;
      var csz = false;
      var cs = false;
      var p = null;
      var a = false;
      var cpg = 0;
      var psr = 0;
      var per = 0;
      function SetHoveredCell() {
        if ((res.GetColumn() !== $Self.FHoverCell.GetColumn()) || (res.GetRow() !== $Self.FHoverCell.GetRow())) {
          $Self.FHoverCell.$assign(res);
        };
      };
      if ((this.FAutoFillState !== $mod.TTMSFNCDataGridAutoFillState.gafsNone) || (this.CanAutoFill() && pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetAutoFillHandleRect(),pas["WEBLib.TMSFNCTypes"].PointF(AMouseInfo.X,AMouseInfo.Y)))) {
        this.HandleAutoFillMouse(AMouseInfo);
        if (AMouseInfo.Blocked) return;
      };
      if ((!pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetContentClipRect(),pas["WEBLib.TMSFNCTypes"].PointF(AMouseInfo.X,AMouseInfo.Y)) && !this.HasValidHost()) || (this.FCapturedScrollbar != null)) {
        c = null;
        if (!(this.FCapturedScrollbar != null)) {
          if (this.GetCustomHorizontalScrollBar().FVisible && pas["WEBLib.TMSFNCTypes"].PtInRectEx(pas["WEBLib.TMSFNCTypes"].ConvertToRectF(this.GetCustomHorizontalScrollBar().GetBoundsRect()),pas["WEBLib.TMSFNCTypes"].PointF(AMouseInfo.X,AMouseInfo.Y))) {
            c = this.GetCustomHorizontalScrollBar()}
           else if (this.GetCustomVerticalScrollBar().FVisible && pas["WEBLib.TMSFNCTypes"].PtInRectEx(pas["WEBLib.TMSFNCTypes"].ConvertToRectF(this.GetCustomVerticalScrollBar().GetBoundsRect()),pas["WEBLib.TMSFNCTypes"].PointF(AMouseInfo.X,AMouseInfo.Y))) c = this.GetCustomVerticalScrollBar();
        } else c = this.FCapturedScrollbar;
        if (c != null) {
          cp.$assign(pas["WEBLib.TMSFNCTypes"].PointF(AMouseInfo.X,AMouseInfo.Y));
          cp.$assign(pas["WEBLib.TMSFNCTypes"].PointF(cp.X - c.GetBoundsRect().Left,cp.Y - c.GetBoundsRect().Top));
          var $tmp = AMouseInfo.Kind;
          if ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseKind.gmkDown) {
            c.HandleMouseDown(AMouseInfo.Button,rtl.refSet(AMouseInfo.Shift),cp.X,cp.Y);
            this.FCapturedScrollbar = c;
          } else if ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseKind.gmkMove) {
            c.HandleMouseMove(rtl.refSet(AMouseInfo.Shift),cp.X,cp.Y)}
           else if ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseKind.gmkUp) {
            this.FCapturedScrollbar = null;
            c.HandleMouseUp(AMouseInfo.Button,rtl.refSet(AMouseInfo.Shift),cp.X,cp.Y);
          } else if ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseKind.gmkWheel) {
            c.HandleMouseWheel(rtl.refSet(AMouseInfo.Shift),AMouseInfo.WheelDelta,{get: function () {
                return hld;
              }, set: function (v) {
                hld = v;
              }})}
           else if ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseKind.gmkEnter) {
            c.HandleMouseEnter()}
           else if ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseKind.gmkLeave) c.HandleMouseLeave();
        };
        return;
      };
      var $tmp1 = AMouseInfo.Kind;
      if ($tmp1 === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseKind.gmkDown) {
        if (!this.FDblClick) this.Focus();
        if (!(AMouseInfo.Button === pas["WEBLib.Controls"].TMouseButton.mbLeft)) return;
        sx = AMouseInfo.X;
        sy = AMouseInfo.Y;
        cell.$assign(this.XYToCell(sx,sy,false));
        sizingCell.$assign(this.XYToCell(sx,sy,true));
        obj = this.GetCellObjectForCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cell));
        sizingObj = this.GetCellObjectForCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(sizingCell));
        if ((obj != null) || (sizingObj != null)) {
          cdColumn = true;
          this.DoCanDragColumn(sizingCell.GetColumn(),{get: function () {
              return cdColumn;
            }, set: function (v) {
              cdColumn = v;
            }});
          cdRow = true;
          this.DoCanDragRow(sizingCell.GetRow(),{get: function () {
              return cdRow;
            }, set: function (v) {
              cdRow = v;
            }});
          if (cdColumn || cdRow) this.FDragCell.$assign(sizingCell);
          fixed = this.IsCellFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(sizingCell));
          if (fixed) {
            rowsz = this.GetOptions().FMouse.FFixedRowSizing;
            colsz = this.GetOptions().FMouse.FFixedColumnSizing;
          } else {
            rowsz = this.GetOptions().FMouse.FRowSizing;
            colsz = this.GetOptions().FMouse.FColumnSizing;
          };
          if ((sizingObj != null) && rowsz && (((sizingCell.GetRow() < (this.FRowCount - this.FFixedBottomRowCount)) && this.IsCellFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(sizingCell))) || !this.IsCellFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(sizingCell))) && (sy >= ((sizingObj.GetTop() + sizingObj.GetHeight()) - this.GetOptions().FMouse.FRowSizeMargin)) && (sx > (sizingObj.GetLeft() + this.GetOptions().FMouse.FColumnSizeMargin)) && (sx < ((sizingObj.GetLeft() + sizingObj.GetWidth()) - this.GetOptions().FMouse.FColumnSizeMargin))) {
            allow = true;
            sz = this.GetRowHeight(sizingCell.GetRow());
            this.DoCanSizeRow(sizingCell.GetRow(),{get: function () {
                return sz;
              }, set: function (v) {
                sz = v;
              }},{get: function () {
                return allow;
              }, set: function (v) {
                allow = v;
              }});
            if (allow) {
              this.FMouseSizing = true;
              this.FSizeMode = $mod.TTMSFNCDataGridSizeMode.gsmRowSizing;
            };
          } else if ((sizingObj != null) && rowsz && (((sizingCell.GetRow() > this.FFixedRowCount) && this.IsCellFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(sizingCell))) || !this.IsCellFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(sizingCell))) && (sy <= (sizingObj.GetTop() + this.GetOptions().FMouse.FRowSizeMargin)) && (sx > (sizingObj.GetLeft() + this.GetOptions().FMouse.FColumnSizeMargin)) && (sx < ((sizingObj.GetLeft() + sizingObj.GetWidth()) - this.GetOptions().FMouse.FColumnSizeMargin))) {
            allow = true;
            sz = this.GetRowHeight(sizingCell.GetRow() - 1);
            this.DoCanSizeRow(sizingCell.GetRow() - 1,{get: function () {
                return sz;
              }, set: function (v) {
                sz = v;
              }},{get: function () {
                return allow;
              }, set: function (v) {
                allow = v;
              }});
            if (allow) {
              this.FMouseSizing = true;
              this.FSizeMode = $mod.TTMSFNCDataGridSizeMode.gsmPreviousRowSizing;
            };
          } else if ((sizingObj != null) && colsz && (((sizingCell.GetColumn() < (this.FColumnCount - this.FFixedRightColumnCount)) && this.IsCellFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(sizingCell))) || !this.IsCellFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(sizingCell))) && (sx >= ((sizingObj.GetLeft() + sizingObj.GetWidth()) - this.GetOptions().FMouse.FColumnSizeMargin)) && (sy > (sizingObj.GetTop() + this.GetOptions().FMouse.FRowSizeMargin)) && (sy < ((sizingObj.GetTop() + sizingObj.GetHeight()) - this.GetOptions().FMouse.FRowSizeMargin))) {
            allow = true;
            sz = this.GetColumnWidth(sizingCell.GetColumn());
            this.DoCanSizeColumn(sizingCell.GetColumn(),{get: function () {
                return sz;
              }, set: function (v) {
                sz = v;
              }},{get: function () {
                return allow;
              }, set: function (v) {
                allow = v;
              }});
            if (allow) {
              this.FMouseSizing = true;
              this.FSizeMode = $mod.TTMSFNCDataGridSizeMode.gsmColumnSizing;
            };
          } else if ((sizingObj != null) && colsz && (((sizingCell.GetColumn() > this.FFixedColumnCount) && this.IsCellFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(sizingCell))) || !this.IsCellFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(sizingCell))) && (sx <= (sizingObj.GetLeft() + this.GetOptions().FMouse.FColumnSizeMargin)) && (sy > (sizingObj.GetTop() + this.GetOptions().FMouse.FRowSizeMargin)) && (sy < ((sizingObj.GetTop() + sizingObj.GetHeight()) - this.GetOptions().FMouse.FRowSizeMargin))) {
            allow = true;
            sz = this.GetColumnWidth(sizingCell.GetColumn() - 1);
            this.DoCanSizeColumn(sizingCell.GetColumn() - 1,{get: function () {
                return sz;
              }, set: function (v) {
                sz = v;
              }},{get: function () {
                return allow;
              }, set: function (v) {
                allow = v;
              }});
            if (allow) {
              this.FMouseSizing = true;
              this.FSizeMode = $mod.TTMSFNCDataGridSizeMode.gsmPreviousColumnSizing;
            };
          } else {
            this.FMouseDown = true;
            this.FMouseUp = true;
            bctl.$assign(AMouseInfo);
            bctl.Blocked = false;
            if (obj != null) obj.HandleMouse(bctl);
            if (bctl.Blocked) this.Display();
            if (!bctl.Blocked) {
              if (!this.IsCellFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cell))) {
                cell.$assign(this.BaseCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cell)));
                if ((cell.GetColumn() === this.GetFocusedCell().GetColumn()) && (cell.GetRow() === this.GetFocusedCell().GetRow()) && !this.GetOptions().FMouse.FDirectEdit) {
                  this.FMouseUp = false;
                  allow = true;
                  this.DoCanEditCell(this.GetFocusedCell().GetColumn(),this.GetFocusedCell().GetRow(),{get: function () {
                      return allow;
                    }, set: function (v) {
                      allow = v;
                    }});
                  this.FMouseUp = !allow;
                  if (allow) {
                    this.ResetCapture();
                    this.EditCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.GetFocusedCell()),$mod.TTMSFNCDataGridEditCellStart.gcsNone,false,"",0);
                  };
                } else bctl.Blocked = this.StopEditing(true);
              } else {
                this.FDragFixed = this.GetOptions().FMouse.FRowDragging && ((cell.GetColumn() < this.FFixedColumnCount) || (cell.GetColumn() > (this.FColumnCount - 1 - this.FFixedRightColumnCount)));
                this.FDragFixed = this.FDragFixed || ((this.GetOptions().FSorting.FEnabled || this.GetOptions().FMouse.FColumnDragging) && ((cell.GetRow() < this.FFixedRowCount) || (cell.GetRow() > (this.FRowCount - 1 - this.FFixedBottomRowCount))));
              };
            };
          };
        };
        this.FTouchScrolling = false;
        this.FPrevX = AMouseInfo.X;
        this.FPrevY = AMouseInfo.Y;
        this.FSizeX = this.FPrevX;
        this.FSizeY = this.FPrevY;
        this.FDownX = this.FPrevX;
        this.FDownY = this.FPrevY;
        this.FTouchX = this.FPrevX;
        this.FTouchY = this.FPrevY;
        this.FScrollX = this.FPrevX;
        this.FScrollY = this.FPrevY;
        this.FMouseX = this.FPrevX;
        this.FMouseY = this.FPrevY;
        if (this.GetHVisible()) {
          this.FScrollHTo = this.GetHScrollValue()}
         else this.FScrollHTo = 0;
        if (this.GetVVisible() || this.FPaging) {
          this.FScrollVTo = this.GetVScrollValue()}
         else this.FScrollVTo = 0;
        this.FCellAnchor.SetColumn(-1);
        this.FCellAnchor.SetRow(-1);
        this.FFirstCell.SetColumn(-1);
        this.FFirstCell.SetRow(-1);
        this.FCellAnchorString = "";
        this.FDoubleSelection = !this.GetAnimateTimer().FEnabled;
        this.FTimeStart = $impl.GetTickCountX();
        this.FTimeStop = this.FTimeStart;
        this.FIsMouseDown = true;
        this.FMouseScrollingUp = false;
      } else if ($tmp1 === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseKind.gmkMove) {
        if (this.FInplaceEditorActive) return;
        if (this.FClearMouseDown) {
          this.FMouseDown = false;
          this.FIsMouseDown = false;
          this.FClearMouseDown = false;
        };
        if (this.FDblClick) {
          this.FDblClick = false;
          this.FMouseDown = false;
        };
        this.FCellAnchor.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(-1,-1));
        this.FCellAnchorString = "";
        this.FX = AMouseInfo.X;
        this.FY = AMouseInfo.Y;
        if (this.FMouseDown && ((this.FX < (this.FDownX - this.GetOptions().FMouse.FClickMargin)) || (this.FX > (this.FDownX + this.GetOptions().FMouse.FClickMargin)) || (this.FY < (this.FDownY - this.GetOptions().FMouse.FClickMargin)) || (this.FY > (this.FDownY + this.GetOptions().FMouse.FClickMargin)))) {
          if (!this.FDragFixed) {
            hss = this.GetHorizontalScrollPosition();
            vss = this.GetVerticalScrollPosition();
            contentr.$assign(this.GetContentRect());
            this.FDoTouchScroll = !this.FPaging && this.GetOptions().FMouse.FTouchScrolling && ((this.GetOptions().FSelection.FMode === $mod.TTMSFNCDataGridSelectionMode.gsmSingleCell) || (this.GetOptions().FSelection.FMode === $mod.TTMSFNCDataGridSelectionMode.gsmSingleRow) || (this.GetOptions().FSelection.FMode === $mod.TTMSFNCDataGridSelectionMode.gsmSingleColumn) || (this.GetOptions().FSelection.FMode === $mod.TTMSFNCDataGridSelectionMode.gsmNone));
            enablescroll = false;
            if (((-hss > 0) && (this.FX < this.GetTotalFixedColumnWidth(true))) || ((-hss < (this.FTotalColumnWidth - this.GetTotalFixedRightColumnWidth())) && (this.FX > ((contentr.Left + (contentr.Right - contentr.Left)) - this.GetTotalFixedRightColumnWidth()))) || ((-vss > 0) && (this.FY < this.GetTotalFixedRowHeight(true))) || ((-vss < (this.FTotalRowHeight - this.GetTotalFixedBottomRowHeight())) && (this.FY > ((contentr.Top + (contentr.Bottom - contentr.Top)) - this.GetTotalFixedBottomRowHeight())))) enablescroll = this.GetOptions().FMouse.FAutoScrolling && !this.FDoTouchScroll;
            if (this.FX > ((contentr.Left + (contentr.Right - contentr.Left)) - this.GetTotalFixedRightColumnWidth())) enablescroll = !($mod.TTMSFNCDataGridFixedCellSelectionMode.gfcsRow in this.GetOptions().FMouse.FFixedCellSelection) && !($mod.TTMSFNCDataGridFixedCellSelectionMode.gfcsRowRange in this.GetOptions().FMouse.FFixedCellSelection);
            if (this.FY > ((contentr.Top + (contentr.Bottom - contentr.Top)) - this.GetTotalFixedBottomRowHeight())) enablescroll = !($mod.TTMSFNCDataGridFixedCellSelectionMode.gfcsColumn in this.GetOptions().FMouse.FFixedCellSelection) && !($mod.TTMSFNCDataGridFixedCellSelectionMode.gfcsColumnRange in this.GetOptions().FMouse.FFixedCellSelection);
            this.GetScrollTimer().SetEnabled(enablescroll);
            if (!this.GetScrollTimer().FEnabled) {
              if (this.FDoTouchScroll) {
                fh = this.GetOptions().FMouse.FTouchScrollingSensitivity;
                fv = fh;
                if (this.GetHorizontalScrollMode() === $mod.TTMSFNCDataGridScrollMode.gsmCellScrolling) fh = fh / 10;
                if (this.GetVerticalScrollMode() === $mod.TTMSFNCDataGridScrollMode.gsmCellScrolling) fv = fv / 10;
                if (this.FTouchScrolling || (Math.abs(this.FMouseX - AMouseInfo.X) > 3) || (Math.abs(this.FMouseY - AMouseInfo.Y) > 3)) {
                  if ((Math.abs(AMouseInfo.X - this.FTouchX) > 0) || (Math.abs(AMouseInfo.Y - this.FTouchY) > 0)) {
                    this.FTouchScrolling = true;
                    this.FDoubleSelection = false;
                    if (this.FIsMouseDown && !this.FMouseScrollingUp) {
                      if (this.GetHVisible()) {
                        h = this.GetHScrollValue() - ((AMouseInfo.X - this.FTouchX) * fh)}
                       else h = 0;
                      if (this.GetVVisible() || this.FPaging) {
                        v = this.GetVScrollValue() - ((AMouseInfo.Y - this.FTouchY) * fv)}
                       else v = 0;
                      this.Scroll(h,v);
                      this.FTouchY = AMouseInfo.Y;
                      this.FTouchX = AMouseInfo.X;
                    };
                  };
                };
              } else {
                this.FMouseDragging = true;
                res.$assign(this.XYToCell(AMouseInfo.X,AMouseInfo.Y,false));
                if ((res.GetColumn() !== -1) && (res.GetRow() !== -1)) {
                  fxd = this.IsCellFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(res));
                  var $tmp2 = this.GetOptions().FSelection.FMode;
                  if ($tmp2 === $mod.TTMSFNCDataGridSelectionMode.gsmSingleRow) {
                    if ($mod.TTMSFNCDataGridFixedCellSelectionMode.gfcsRow in this.GetOptions().FMouse.FFixedCellSelection) fxd = false}
                   else if ($tmp2 === $mod.TTMSFNCDataGridSelectionMode.gsmSingleColumn) {
                    if ($mod.TTMSFNCDataGridFixedCellSelectionMode.gfcsColumn in this.GetOptions().FMouse.FFixedCellSelection) fxd = false}
                   else if ($tmp2 === $mod.TTMSFNCDataGridSelectionMode.gsmRowRange) {
                    if ($mod.TTMSFNCDataGridFixedCellSelectionMode.gfcsRowRange in this.GetOptions().FMouse.FFixedCellSelection) fxd = false}
                   else if ($tmp2 === $mod.TTMSFNCDataGridSelectionMode.gsmColumnRange) if ($mod.TTMSFNCDataGridFixedCellSelectionMode.gfcsColumnRange in this.GetOptions().FMouse.FFixedCellSelection) fxd = false;
                  if (!fxd) this.SelectCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(res),rtl.refSet(AMouseInfo.Shift),this.FMouseDragging,false,false);
                };
              };
            };
          } else {
            if ((this.FDragCell.GetColumn() !== -1) && (this.FDragCell.GetRow() !== -1)) {
              obj = this.GetCellObjectForCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FDragCell));
              if ((obj != null) && (this.FDraggingMode === $mod.TTMSFNCDataGridDraggingMode.gdmNone)) {
                this.FDraggingType = $mod.TTMSFNCDataGridDraggingType.gdtSwap;
                this.StartDragging(pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseInfo.$clone(AMouseInfo),this.GetOptions().FMouse.FDragMode === $mod.TTMSFNCDataGridDragMode.gdmDrag);
              } else {
                this.HandleDragging(pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseInfo.$clone(AMouseInfo));
                if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.LocalRect(),pas["WEBLib.TMSFNCTypes"].PointF(AMouseInfo.X,AMouseInfo.Y))) {
                  this.UpdateCursor(10)}
                 else this.UpdateCursor(13);
              };
            };
          };
        } else if (!this.FMouseSizing) {
          sx = AMouseInfo.X;
          sy = AMouseInfo.Y;
          res.$assign(this.XYToCell(AMouseInfo.X,AMouseInfo.Y,false));
          sizingRes.$assign(this.XYToCell(AMouseInfo.X,AMouseInfo.Y,true));
          if (((res.GetColumn() !== -1) && (res.GetRow() !== -1)) || ((sizingRes.GetColumn() !== -1) && (sizingRes.GetRow() !== -1))) {
            obj = this.GetCellObjectForCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(res));
            sizingObj = this.GetCellObjectForCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(sizingRes));
            if ((obj != null) || (sizingObj != null)) {
              sizingFixed = this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(sizingRes)) && this.IsCellFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(sizingRes));
              if (this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(sizingRes))) {
                if (sizingFixed) {
                  sizingRowsz = this.GetOptions().FMouse.FFixedRowSizing;
                  sizingColsz = this.GetOptions().FMouse.FFixedColumnSizing;
                } else {
                  sizingRowsz = this.GetOptions().FMouse.FRowSizing;
                  sizingColsz = this.GetOptions().FMouse.FColumnSizing;
                };
              } else {
                sizingRowsz = false;
                sizingColsz = false;
              };
              if ((sizingObj != null) && sizingRowsz && (sizingRes.GetRow() > this.FFixedRowCount) && (sy <= (sizingObj.GetTop() + this.GetOptions().FMouse.FRowSizeMargin)) && (sx > (sizingObj.GetLeft() + this.GetOptions().FMouse.FColumnSizeMargin)) && (sx < ((sizingObj.GetLeft() + sizingObj.GetWidth()) - this.GetOptions().FMouse.FColumnSizeMargin))) {
                allow = true;
                sz = this.GetRowHeight(sizingRes.GetRow() - 1);
                this.DoCanSizeRow(sizingRes.GetRow() - 1,{get: function () {
                    return sz;
                  }, set: function (v) {
                    sz = v;
                  }},{get: function () {
                    return allow;
                  }, set: function (v) {
                    allow = v;
                  }});
                if (allow) this.UpdateCursor(7);
              } else if ((sizingObj != null) && sizingRowsz && (((sizingRes.GetRow() < (this.FRowCount - this.FFixedBottomRowCount)) && sizingFixed) || !sizingFixed) && (sy >= ((sizingObj.GetTop() + sizingObj.GetHeight()) - this.GetOptions().FMouse.FRowSizeMargin)) && (sx > (sizingObj.GetLeft() + this.GetOptions().FMouse.FColumnSizeMargin)) && (sx < ((sizingObj.GetLeft() + sizingObj.GetWidth()) - this.GetOptions().FMouse.FColumnSizeMargin))) {
                allow = true;
                sz = this.GetRowHeight(sizingRes.GetRow());
                this.DoCanSizeRow(sizingRes.GetRow(),{get: function () {
                    return sz;
                  }, set: function (v) {
                    sz = v;
                  }},{get: function () {
                    return allow;
                  }, set: function (v) {
                    allow = v;
                  }});
                if (allow) this.UpdateCursor(7);
              } else if ((sizingObj != null) && sizingColsz && (sizingRes.GetColumn() > this.FFixedColumnCount) && (sx <= (sizingObj.GetLeft() + this.GetOptions().FMouse.FColumnSizeMargin)) && (sy > (sizingObj.GetTop() + this.GetOptions().FMouse.FRowSizeMargin)) && (sy < ((sizingObj.GetTop() + sizingObj.GetHeight()) - this.GetOptions().FMouse.FRowSizeMargin))) {
                allow = true;
                sz = this.GetColumnWidth(sizingRes.GetColumn() - 1);
                this.DoCanSizeColumn(sizingRes.GetColumn() - 1,{get: function () {
                    return sz;
                  }, set: function (v) {
                    sz = v;
                  }},{get: function () {
                    return allow;
                  }, set: function (v) {
                    allow = v;
                  }});
                if (allow) this.UpdateCursor(9);
              } else if ((sizingObj != null) && sizingColsz && (((sizingRes.GetColumn() < (this.FColumnCount - this.FFixedRightColumnCount)) && sizingFixed) || !sizingFixed) && (sx >= ((sizingObj.GetLeft() + sizingObj.GetWidth()) - this.GetOptions().FMouse.FColumnSizeMargin)) && (sy > (sizingObj.GetTop() + this.GetOptions().FMouse.FRowSizeMargin)) && (sy < ((sizingObj.GetTop() + sizingObj.GetHeight()) - this.GetOptions().FMouse.FRowSizeMargin))) {
                allow = true;
                sz = this.GetColumnWidth(sizingRes.GetColumn());
                this.DoCanSizeColumn(sizingRes.GetColumn(),{get: function () {
                    return sz;
                  }, set: function (v) {
                    sz = v;
                  }},{get: function () {
                    return allow;
                  }, set: function (v) {
                    allow = v;
                  }});
                if (allow) this.UpdateCursor(9);
              } else {
                if (obj != null) {
                  bctl.$assign(AMouseInfo);
                  bctl.Blocked = false;
                  cr = this.FOldCursor;
                  bctl.Cursor = cr;
                  obj.HandleMouse(bctl);
                  if (bctl.Blocked) {
                    this.UpdateCursor(bctl.Cursor);
                    this.Display();
                  };
                  if (!bctl.Blocked) {
                    if (obj.IsHTML()) {
                      this.FCellAnchorString = obj.XYToAnchor(AMouseInfo.X,AMouseInfo.Y)}
                     else {
                      this.FCellAnchorString = obj.GetText();
                      if (!pas["WEBLib.TMSFNCDataGridUtil"].IsURL(this.FCellAnchorString) || !this.GetOptions().FURL.FAutoDetect) this.FCellAnchorString = "";
                    };
                    if ((this.FCellAnchorString !== "") && this.GetOptions().FURL.FAutoDetect) {
                      this.UpdateCursor(21)}
                     else {
                      SetHoveredCell();
                      this.UpdateCursor(this.FOldCursor);
                    };
                  };
                } else {
                  SetHoveredCell();
                  this.UpdateCursor(this.FOldCursor);
                };
              };
            };
          } else {
            SetHoveredCell();
            this.UpdateCursor(this.FOldCursor);
          };
        } else {
          if ((this.FDragCell.GetColumn() !== -1) && (this.FDragCell.GetColumn() !== -1)) {
            var $tmp3 = this.FSizeMode;
            if ($tmp3 === $mod.TTMSFNCDataGridSizeMode.gsmColumnSizing) {
              if (this.GetOptions().FMouse.FColumnSizingMode === $mod.TTMSFNCDataGridSizingMode.gszmTwoSided) {
                this.HandleTwoSidedColumnResize(this.FDragCell.GetColumn(),this.FDragCell.GetRow(),this.FX,this.FSizeX,AMouseInfo)}
               else {
                newsz = this.GetColumnWidth(this.FDragCell.GetColumn()) + (this.FX - this.FSizeX);
                csz = true;
                this.DoCanSizeColumn(this.FDragCell.GetColumn(),{get: function () {
                    return newsz;
                  }, set: function (v) {
                    newsz = v;
                  }},{get: function () {
                    return csz;
                  }, set: function (v) {
                    csz = v;
                  }});
                if (csz) {
                  this.SetColumnWidth(this.FDragCell.GetColumn(),newsz);
                  this.DoSizeColumn(this.FDragCell.GetColumn(),newsz);
                };
              };
            } else if ($tmp3 === $mod.TTMSFNCDataGridSizeMode.gsmRowSizing) {
              if (this.GetOptions().FMouse.FColumnSizingMode === $mod.TTMSFNCDataGridSizingMode.gszmTwoSided) {
                this.HandleTwoSidedRowResize(this.FDragCell.GetColumn(),this.FDragCell.GetRow(),this.FY,this.FSizeY,AMouseInfo)}
               else {
                newsz = this.GetRowHeight(this.FDragCell.GetRow()) + (this.FY - this.FSizeY);
                csz = true;
                this.DoCanSizeRow(this.FDragCell.GetRow(),{get: function () {
                    return newsz;
                  }, set: function (v) {
                    newsz = v;
                  }},{get: function () {
                    return csz;
                  }, set: function (v) {
                    csz = v;
                  }});
                if (csz) {
                  this.SetRowHeight(this.FDragCell.GetRow(),newsz);
                  this.DoSizeRow(this.FDragCell.GetRow(),newsz);
                };
              };
            } else if ($tmp3 === $mod.TTMSFNCDataGridSizeMode.gsmPreviousColumnSizing) {
              if (this.GetOptions().FMouse.FColumnSizingMode === $mod.TTMSFNCDataGridSizingMode.gszmTwoSided) {
                this.HandleTwoSidedColumnResize(this.FDragCell.GetColumn() - 1,this.FDragCell.GetRow(),this.FX,this.FSizeX,AMouseInfo)}
               else {
                newsz = this.GetColumnWidth(this.FDragCell.GetColumn() - 1) + (this.FX - this.FSizeX);
                csz = true;
                this.DoCanSizeColumn(this.FDragCell.GetColumn() - 1,{get: function () {
                    return newsz;
                  }, set: function (v) {
                    newsz = v;
                  }},{get: function () {
                    return csz;
                  }, set: function (v) {
                    csz = v;
                  }});
                if (csz) {
                  this.SetColumnWidth(this.FDragCell.GetColumn() - 1,newsz);
                  this.DoSizeColumn(this.FDragCell.GetColumn() - 1,newsz);
                };
              };
            } else if ($tmp3 === $mod.TTMSFNCDataGridSizeMode.gsmPreviousRowSizing) {
              if (this.GetOptions().FMouse.FColumnSizingMode === $mod.TTMSFNCDataGridSizingMode.gszmTwoSided) {
                this.HandleTwoSidedRowResize(this.FDragCell.GetColumn(),this.FDragCell.GetRow() - 1,this.FY,this.FSizeY,AMouseInfo)}
               else {
                newsz = this.GetRowHeight(this.FDragCell.GetRow() - 1) + (this.FY - this.FSizeY);
                csz = true;
                this.DoCanSizeRow(this.FDragCell.GetRow() - 1,{get: function () {
                    return newsz;
                  }, set: function (v) {
                    newsz = v;
                  }},{get: function () {
                    return csz;
                  }, set: function (v) {
                    csz = v;
                  }});
                if (csz) {
                  this.SetRowHeight(this.FDragCell.GetRow() - 1,newsz);
                  this.DoSizeRow(this.FDragCell.GetRow() - 1,newsz);
                };
              };
            };
            this.FSizeX = this.FX;
            this.FSizeY = this.FY;
            this.Update();
            this.FSizing = true;
          };
        };
      } else if ($tmp1 === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseKind.gmkUp) {
        if (this.FInplaceEditorActive) return;
        if (!(AMouseInfo.Button === pas["WEBLib.Controls"].TMouseButton.mbLeft)) {
          if (AMouseInfo.Button === pas["WEBLib.Controls"].TMouseButton.mbRight) {
            res.$assign(this.XYToCell(AMouseInfo.X,AMouseInfo.Y,false));
            if ((res.GetColumn() !== -1) && (res.GetRow() !== -1)) {
              this.DoCellRightClick(res.GetColumn(),res.GetRow());
              p = this.GetParentHost();
              if ((this.FCellPopupMenu != null) && (p != null) && pas["WEBLib.Controls"].TWinControl.isPrototypeOf(p)) {
                a = true;
                this.DoCellBeforeShowPopupMenu(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(res),this.FCellPopupMenu,{get: function () {
                    return a;
                  }, set: function (v) {
                    a = v;
                  }});
                if (a) ;
              };
            };
          };
          return;
        };
        if (!this.FIsMouseDown) return;
        this.FMouseScrollingUp = true;
        this.FIsMouseDown = false;
        this.GetScrollTimer().SetEnabled(false);
        this.GetDragTimer().SetEnabled(false);
        if (this.FSizing) {
          var $tmp4 = this.FSizeMode;
          if ($tmp4 === $mod.TTMSFNCDataGridSizeMode.gsmColumnSizing) {
            this.DoColumnSized(this.FDragCell.GetColumn(),this.GetColumnWidth(this.FDragCell.GetColumn()))}
           else if ($tmp4 === $mod.TTMSFNCDataGridSizeMode.gsmRowSizing) {
            this.DoRowSized(this.FDragCell.GetRow(),this.GetRowHeight(this.FDragCell.GetRow()))}
           else if ($tmp4 === $mod.TTMSFNCDataGridSizeMode.gsmPreviousColumnSizing) {
            this.DoColumnSized(this.FDragCell.GetColumn() - 1,this.GetColumnWidth(this.FDragCell.GetColumn() - 1))}
           else if ($tmp4 === $mod.TTMSFNCDataGridSizeMode.gsmPreviousRowSizing) this.DoRowSized(this.FDragCell.GetRow() - 1,this.GetRowHeight(this.FDragCell.GetRow() - 1));
          this.Update();
        };
        if (!this.FDoubleSelection && this.FDoTouchScroll) {
          fh = this.GetOptions().FMouse.FTouchScrollingSensitivity;
          fv = fh;
          if (this.GetHorizontalScrollMode() === $mod.TTMSFNCDataGridScrollMode.gsmCellScrolling) fh = fh / 10;
          if (this.GetVerticalScrollMode() === $mod.TTMSFNCDataGridScrollMode.gsmCellScrolling) fv = fv / 10;
          this.FTimeStop = $impl.GetTickCountX();
          if (((this.FTimeStop - this.FTimeStart) < 300) && ((this.FTimeStop - this.FTimeStart) > 0)) {
            this.FSpY = Math.abs(AMouseInfo.Y - this.FScrollY) / (this.FTimeStop - this.FTimeStart);
            if (this.FSpY > 0) {
              if (this.GetVVisible() || this.FPaging) {
                if ((AMouseInfo.Y - this.FScrollY) > 0) {
                  this.FScrollVTo = Math.max(0,Math.min(this.GetVMax() - this.GetVViewPortSize(),this.FScrollVTo - Math.round(Math.abs(AMouseInfo.Y - this.FScrollY) * this.FSpY * fv * 3)))}
                 else this.FScrollVTo = Math.max(0,Math.min(this.GetVMax() - this.GetVViewPortSize(),this.FScrollVTo + Math.round(Math.abs(AMouseInfo.Y - this.FScrollY) * this.FSpY * fv * 3)));
              } else this.FScrollVTo = 0;
              this.FAnimateVerticalPos = true;
              this.GetAnimateTimer().SetEnabled(true);
            };
            this.FSpX = Math.abs(AMouseInfo.X - this.FScrollX) / (this.FTimeStop - this.FTimeStart);
            if (this.FSpX > 0) {
              if (this.GetHVisible()) {
                if ((AMouseInfo.X - this.FScrollX) > 0) {
                  this.FScrollHTo = Math.max(0,Math.min(this.GetHMax() - this.GetHViewPortSize(),this.FScrollHTo - Math.round(Math.abs(AMouseInfo.X - this.FScrollX) * this.FSpX * fh * 3)))}
                 else this.FScrollHTo = Math.max(0,Math.min(this.GetHMax() - this.GetHViewPortSize(),this.FScrollHTo + Math.round(Math.abs(AMouseInfo.X - this.FScrollX) * this.FSpX * fh * 3)));
              } else this.FScrollHTo = 0;
              this.FAnimateHorizontalPos = true;
              this.GetAnimateTimer().SetEnabled(true);
            };
          };
        };
        bctl.$assign(AMouseInfo);
        bctl.Blocked = !(this.FDraggingMode === $mod.TTMSFNCDataGridDraggingMode.gdmNone) || this.FDblClick;
        if (this.FMouseUp) {
          res.$assign(this.XYToCell(AMouseInfo.X,AMouseInfo.Y,false));
          if ((res.GetColumn() !== -1) && (res.GetRow() !== -1)) {
            obj = this.GetCellObjectForCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(res));
            if (obj != null) {
              this.FCellAnchor.SetColumn(-1);
              this.FCellAnchor.SetRow(-1);
              if (!this.FMouseDragging) {
                obj.HandleMouse(bctl);
                if (bctl.Blocked) this.Display();
                if (!bctl.Blocked) {
                  if (obj.IsHTML()) {
                    this.FCellAnchorString = obj.XYToAnchor(AMouseInfo.X,AMouseInfo.Y)}
                   else {
                    this.FCellAnchorString = obj.GetText();
                    if (!pas["WEBLib.TMSFNCDataGridUtil"].IsURL(this.FCellAnchorString) || !this.GetOptions().FURL.FAutoDetect) this.FCellAnchorString = "";
                  };
                  if (this.FCellAnchorString !== "") this.FCellAnchor.$assign(res);
                };
              };
            };
            if (!bctl.Blocked) {
              if ((this.FCellAnchor.GetColumn() === -1) && (this.FCellAnchor.GetRow() === -1) && (this.FCellAnchorString === "")) {
                fxd = this.IsCellFixed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(res));
                var $tmp5 = this.GetOptions().FSelection.FMode;
                if ($tmp5 === $mod.TTMSFNCDataGridSelectionMode.gsmCellRange) {
                  if (($mod.TTMSFNCDataGridFixedCellSelectionMode.gfcsAll in this.GetOptions().FMouse.FFixedCellSelection) && (res.GetColumn() < this.FFixedColumnCount) && (res.GetRow() < this.FFixedRowCount)) fxd = false;
                } else if ($tmp5 === $mod.TTMSFNCDataGridSelectionMode.gsmSingleRow) {
                  if ($mod.TTMSFNCDataGridFixedCellSelectionMode.gfcsRow in this.GetOptions().FMouse.FFixedCellSelection) fxd = false}
                 else if ($tmp5 === $mod.TTMSFNCDataGridSelectionMode.gsmSingleColumn) {
                  if ($mod.TTMSFNCDataGridFixedCellSelectionMode.gfcsColumn in this.GetOptions().FMouse.FFixedCellSelection) fxd = false}
                 else if ($tmp5 === $mod.TTMSFNCDataGridSelectionMode.gsmRowRange) {
                  if ($mod.TTMSFNCDataGridFixedCellSelectionMode.gfcsRowRange in this.GetOptions().FMouse.FFixedCellSelection) fxd = false}
                 else if ($tmp5 === $mod.TTMSFNCDataGridSelectionMode.gsmColumnRange) {
                  if ($mod.TTMSFNCDataGridFixedCellSelectionMode.gfcsColumnRange in this.GetOptions().FMouse.FFixedCellSelection) fxd = false}
                 else if ($tmp5 === $mod.TTMSFNCDataGridSelectionMode.gsmDisjunctRow) {
                  if ($mod.TTMSFNCDataGridFixedCellSelectionMode.gfcsDisjunctRow in this.GetOptions().FMouse.FFixedCellSelection) fxd = false}
                 else if ($tmp5 === $mod.TTMSFNCDataGridSelectionMode.gsmDisjunctColumn) if ($mod.TTMSFNCDataGridFixedCellSelectionMode.gfcsDisjunctColumn in this.GetOptions().FMouse.FFixedCellSelection) fxd = false;
                if (!fxd && !this.FDragFixed && !this.FTouchScrolling) {
                  this.SelectCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(res),rtl.refSet(AMouseInfo.Shift),this.FMouseDragging,false,false);
                  if (!this.FMouseDragging && this.GetOptions().FMouse.FDirectEdit) {
                    allow = true;
                    this.DoCanEditCell(this.GetFocusedCell().GetColumn(),this.GetFocusedCell().GetRow(),{get: function () {
                        return allow;
                      }, set: function (v) {
                        allow = v;
                      }});
                    if (allow) this.EditCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.GetFocusedCell()),$mod.TTMSFNCDataGridEditCellStart.gcsNone,false,"",0);
                  };
                };
                if (!this.FTouchScrolling) this.DoCellClick(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(res),pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseInfo.$clone(AMouseInfo));
              } else this.DoCellAnchorClick(this.FCellAnchor.GetColumn(),this.FCellAnchor.GetRow(),this.FCellAnchorString);
            } else {
              this.HandleDragEnd(pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseInfo.$clone(AMouseInfo));
            };
          };
        };
        if (!this.FDragging) {
          this.FDraggingMode = $mod.TTMSFNCDataGridDraggingMode.gdmNone;
          this.FDragCell.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(-1,-1));
          this.FDragCellTo.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(-1,-1));
          this.FDragFixed = false;
          this.FDraggingType = $mod.TTMSFNCDataGridDraggingType.gdtNone;
        };
        this.FTouchScrolling = false;
        this.FFirstCell.SetRow(-1);
        this.FFirstCell.SetColumn(-1);
        this.FMouseDown = false;
        this.FMouseUp = false;
        this.FMouseDragging = false;
        this.FMouseDblClick = this.FMouseSizing;
        this.FMouseSizing = false;
        this.FSizing = false;
      } else if ($tmp1 === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseKind.gmkDouble) {
        this.FDblClick = true;
        this.FIsMouseDown = false;
        cell.$assign(this.XYToCell(AMouseInfo.X,AMouseInfo.Y,false));
        if ((cell.GetColumn() !== -1) && (cell.GetRow() !== -1)) {
          if (this.FMouseDblClick) {
            this.FMouseDblClick = false;
            this.UpdateCursor(11);
            try {
              var $tmp6 = this.FSizeMode;
              if (($tmp6 === $mod.TTMSFNCDataGridSizeMode.gsmPreviousColumnSizing) || ($tmp6 === $mod.TTMSFNCDataGridSizeMode.gsmColumnSizing)) {
                if (this.GetOptions().FMouse.FColumnAutoSizeOnDblClick) {
                  this.AutoSizeColumn(cell.GetColumn(),$mod.TTMSFNCDataGridAutoSizeMode.gamAllCells,5);
                  this.DoColumnSized(cell.GetColumn(),this.GetColumnWidth(cell.GetColumn()));
                };
              } else if (($tmp6 === $mod.TTMSFNCDataGridSizeMode.gsmPreviousRowSizing) || ($tmp6 === $mod.TTMSFNCDataGridSizeMode.gsmRowSizing)) {
                if (this.GetOptions().FMouse.FRowAutoSizeOnDblClick) {
                  this.AutoSizeRow(cell.GetRow(),$mod.TTMSFNCDataGridAutoSizeMode.gamAllCells,5);
                  this.DoRowSized(cell.GetRow(),this.GetRowHeight(cell.GetRow()));
                };
              };
            } finally {
              this.UpdateCursor(this.FOldCursor);
            };
          };
          this.DoCellDblClick(cell.GetColumn(),cell.GetRow());
          this.FClearMouseDown = true;
        };
      } else if ($tmp1 === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseKind.gmkWheel) {
        if (AMouseInfo.Handled) return;
        cs = true;
        if ((this.FAdapter != null) && $mod.TTMSFNCDataGridRendererDataAdapter.isPrototypeOf(this.FAdapter)) {
          var $tmp7 = rtl.as(this.FAdapter,$mod.TTMSFNCDataGridRendererDataAdapter).ScrollMode();
          if ($tmp7 === pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataAdapterScrollMode.ascmNone) {
            return}
           else if ($tmp7 === pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataAdapterScrollMode.ascmKeepSelection) cs = false;
        };
        if (((pas.Classes.TShiftState$a.ssCtrl in AMouseInfo.Shift) || this.GetOptions().FMouse.FWheelScrollKeepSelection) && cs) {
          if (this.FPaging) {
            cpg = this.GetPageIndex();
            if (AMouseInfo.WheelDelta > 0) {
              if ((this.GetTopRow() <= (this.FFixedRowCount + this.FFreezeRowCount + (cpg * this.GetPageScrollSize()))) && (cpg > 0)) {
                psr = this.FFixedRowCount + this.FFreezeRowCount + ((cpg - 1) * this.GetPageScrollSize());
                cl.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(0,psr));
              } else {
                tr = this.GetTopRow() - this.GetOptions().FMouse.FWheelScrollSize;
                psr = this.FFixedRowCount + this.FFreezeRowCount + (cpg * this.GetPageScrollSize());
                if (tr < psr) tr = psr;
                cl.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(0,tr));
              };
            } else {
              per = Math.min((this.FFixedRowCount + this.FFreezeRowCount + ((cpg + 1) * this.GetPageScrollSize())) - 1,this.FRowCount - 1 - this.FFixedBottomRowCount);
              if ((this.GetBottomRow() >= per) && (cpg < (this.GetPageCount() - 1))) {
                psr = this.FFixedRowCount + this.FFreezeRowCount + ((cpg + 1) * this.GetPageScrollSize());
                cl.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(0,psr));
              } else {
                tr = this.GetTopRow() + this.GetOptions().FMouse.FWheelScrollSize;
                per = Math.min((this.FFixedRowCount + this.FFreezeRowCount + ((cpg + 1) * this.GetPageScrollSize())) - 1,this.FRowCount - 1 - this.FFixedBottomRowCount);
                if (tr > (per - (this.GetBottomRow() - this.GetTopRow()))) tr = per - (this.GetBottomRow() - this.GetTopRow());
                cl.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(0,tr));
              };
            };
          } else {
            if (AMouseInfo.WheelDelta > 0) {
              tr = this.GetTopRow() - this.GetOptions().FMouse.FWheelScrollSize}
             else tr = this.GetTopRow() + this.GetOptions().FMouse.FWheelScrollSize;
            if (tr < (this.FFixedRowCount + this.FFreezeRowCount)) {
              tr = this.FFixedRowCount + this.FFreezeRowCount}
             else if (tr > (this.FRowCount - 1 - this.FFixedBottomRowCount)) tr = this.FRowCount - 1 - this.FFixedBottomRowCount;
            cl.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(0,tr));
          };
          if (!this.IsCellDisplayed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cl))) {
            if (AMouseInfo.WheelDelta > 0) {
              cl.$assign(this.PreviousVisibleRow(cl.GetColumn(),cl.GetRow()))}
             else cl.$assign(this.NextVisibleRow(cl.GetColumn(),cl.GetRow()));
          };
          this.Navigate(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cl),true,true,false);
        } else {
          sel.$assign(this.GetFocusedCell());
          psel.$assign(sel);
          if (AMouseInfo.WheelDelta > 0) {
            sel.SetRow(Math.max(this.FFixedRowCount,sel.GetRow() - this.GetOptions().FMouse.FWheelScrollSize))}
           else sel.SetRow(Math.min(this.FRowCount - this.FFixedBottomRowCount - 1,sel.GetRow() + this.GetOptions().FMouse.FWheelScrollSize));
          cell.$assign(this.BaseCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(sel)));
          sel.$assign(cell);
          if (this.IsCellDisabled(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(sel))) {
            if (AMouseInfo.WheelDelta > 0) {
              sel.$assign(this.PreviousSelectableRow(sel.GetColumn(),sel.GetRow()))}
             else sel.$assign(this.NextSelectableRow(sel.GetColumn(),sel.GetRow()));
          };
          if (this.IsCellDisabled(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(sel))) sel.$assign(psel);
          this.SelectCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(sel),rtl.refSet(AMouseInfo.Shift),false,false,false);
        };
        AMouseInfo.Handled = true;
      } else if ($tmp1 === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseKind.gmkEnter) {}
      else if ($tmp1 === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseKind.gmkLeave) {
        this.FHoverCell.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(-1,-1));
      };
    };
    this.HandleAutoFillMouse = function (AMouseInfo) {
      var currentCell = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var fillDirection = 0;
      var mousePoint = pas["WEBLib.TMSFNCTypes"].TPointF.$new();
      var handleRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var contentr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var hss = 0.0;
      var vss = 0.0;
      var enableScroll = false;
      mousePoint.$assign(pas["WEBLib.TMSFNCTypes"].PointF(AMouseInfo.X,AMouseInfo.Y));
      handleRect.$assign(this.GetAutoFillHandleRect());
      var $tmp = AMouseInfo.Kind;
      if ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseKind.gmkDown) {
        if ((AMouseInfo.Button === pas["WEBLib.Controls"].TMouseButton.mbLeft) && this.CanAutoFill()) {
          if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(handleRect,mousePoint)) {
            this.FAutoFillState = $mod.TTMSFNCDataGridAutoFillState.gafsDragging;
            this.FAutoFillStart.$assign(this.FSelection.StartCell);
            this.FAutoFillEnd.$assign(this.FSelection.StopCell);
            this.FAutoFillOriginalSelection.$assign(this.FSelection);
            this.UpdateCursor(3);
            AMouseInfo.Blocked = true;
            return;
          };
        };
      } else if ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseKind.gmkMove) {
        if (this.FAutoFillState === $mod.TTMSFNCDataGridAutoFillState.gafsDragging) {
          this.FX = AMouseInfo.X;
          this.FY = AMouseInfo.Y;
          currentCell.$assign(this.XYToCell(AMouseInfo.X,AMouseInfo.Y,false));
          if ((currentCell.GetColumn() !== -1) && (currentCell.GetRow() !== -1)) {
            fillDirection = this.GetAutoFillDirection(currentCell,this.FAutoFillOriginalSelection);
            this.CalculateAutoFillRange(currentCell,fillDirection,this.FAutoFillStart,this.FAutoFillEnd);
            this.FAutoFillPreviewRect.$assign(this.CellRangeToRect(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FAutoFillStart),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FAutoFillEnd)));
            this.UpdateCursor(3);
            AMouseInfo.Blocked = true;
            this.Display();
          };
          if (this.GetOptions().FMouse.FAutoScrolling) {
            contentr.$assign(this.GetContentClipRect());
            hss = this.GetHorizontalScrollPosition();
            vss = this.GetVerticalScrollPosition();
            enableScroll = false;
            if (((-hss > 0) && (this.FX < this.GetTotalFixedColumnWidth(true))) || ((-hss < (this.FTotalColumnWidth - this.GetTotalFixedRightColumnWidth())) && (this.FX > ((contentr.Left + (contentr.Right - contentr.Left)) - this.GetTotalFixedRightColumnWidth()))) || ((-vss > 0) && (this.FY < this.GetTotalFixedRowHeight(true))) || ((-vss < (this.FTotalRowHeight - this.GetTotalFixedBottomRowHeight())) && (this.FY > ((contentr.Top + (contentr.Bottom - contentr.Top)) - this.GetTotalFixedBottomRowHeight())))) enableScroll = true;
            this.GetScrollTimer().SetEnabled(enableScroll);
          };
          return;
        } else if (this.FAutoFillState === $mod.TTMSFNCDataGridAutoFillState.gafsNone) {
          if (this.CanAutoFill() && pas["WEBLib.TMSFNCTypes"].PtInRectEx(handleRect,mousePoint)) {
            this.FAutoFillState = $mod.TTMSFNCDataGridAutoFillState.gafsHover;
            this.UpdateCursor(3);
            AMouseInfo.Blocked = true;
            return;
          };
        } else if (this.FAutoFillState === $mod.TTMSFNCDataGridAutoFillState.gafsHover) {
          if (!pas["WEBLib.TMSFNCTypes"].PtInRectEx(handleRect,mousePoint)) {
            this.FAutoFillState = $mod.TTMSFNCDataGridAutoFillState.gafsNone;
            this.UpdateCursor(this.FOldCursor);
          } else {
            AMouseInfo.Cursor = 3;
            AMouseInfo.Blocked = true;
          };
          return;
        };
      } else if ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseKind.gmkUp) {
        if (this.FAutoFillState === $mod.TTMSFNCDataGridAutoFillState.gafsDragging) {
          this.GetScrollTimer().SetEnabled(false);
          if ((this.FAutoFillStart.GetColumn() !== -1) && (this.FAutoFillStart.GetRow() !== -1) && (this.FAutoFillEnd.GetColumn() !== -1) && (this.FAutoFillEnd.GetRow() !== -1)) {
            this.AutoFill(this.FAutoFillOriginalSelection.StartCell,this.FAutoFillOriginalSelection.StopCell,this.FAutoFillStart,this.FAutoFillEnd,pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataAutoFillDirection.gafdAuto);
            this.SelectCellRange(this.FAutoFillStart.GetColumn(),this.FAutoFillStart.GetRow(),this.FAutoFillEnd.GetColumn(),this.FAutoFillEnd.GetRow());
          };
          this.FAutoFillState = $mod.TTMSFNCDataGridAutoFillState.gafsNone;
          this.FAutoFillPreviewRect.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,0,0));
          this.UpdateCursor(this.FOldCursor);
          AMouseInfo.Blocked = true;
          this.Display();
          return;
        };
      };
    };
    this.HilightCells = function (AHilightText, AOptions) {
      var $tmp = AOptions.Mode;
      if ($tmp === $mod.TTMSFNCDataGridHilightMode.ghmCell) {
        this.InternalMarkCells(AHilightText,"hi",AOptions.CaseSensitive,AOptions.Column,AOptions.Row,AOptions.Column,AOptions.Row,AOptions.FullText)}
       else if ($tmp === $mod.TTMSFNCDataGridHilightMode.ghmColumn) {
        if (AOptions.IncludeFixed) {
          this.InternalMarkCells(AHilightText,"hi",AOptions.CaseSensitive,AOptions.Column,0,AOptions.Column,this.FRowCount - 1,AOptions.FullText)}
         else this.InternalMarkCells(AHilightText,"hi",AOptions.CaseSensitive,AOptions.Column,this.FFixedRowCount,AOptions.Column,this.FRowCount - 1 - this.FFixedBottomRowCount,AOptions.FullText);
      } else if ($tmp === $mod.TTMSFNCDataGridHilightMode.ghmRow) {
        if (AOptions.IncludeFixed) {
          this.InternalMarkCells(AHilightText,"hi",AOptions.CaseSensitive,0,AOptions.Row,this.FColumnCount - 1,AOptions.Row,AOptions.FullText)}
         else this.InternalMarkCells(AHilightText,"hi",AOptions.CaseSensitive,this.FFixedColumnCount,AOptions.Row,this.FColumnCount - 1 - this.FFixedRightColumnCount,AOptions.Row,AOptions.FullText);
      } else if ($tmp === $mod.TTMSFNCDataGridHilightMode.ghmGrid) {
        if (AOptions.IncludeFixed) {
          this.InternalMarkCells(AHilightText,"hi",AOptions.CaseSensitive,0,0,this.FColumnCount - 1,this.FRowCount - 1,AOptions.FullText)}
         else this.InternalMarkCells(AHilightText,"hi",AOptions.CaseSensitive,this.FFixedColumnCount,this.FFixedRowCount,this.FColumnCount - 1 - this.FFixedRightColumnCount,this.FRowCount - 1 - this.FFixedBottomRowCount,AOptions.FullText);
      };
    };
    this.LastPage = function () {
      this.GoToPage(this.GetPageCount() - 1);
    };
    this.MarkCells = function (AHilightText, AOptions) {
      var $tmp = AOptions.Mode;
      if ($tmp === $mod.TTMSFNCDataGridHilightMode.ghmCell) {
        this.InternalMarkCells(AHilightText,"e",AOptions.CaseSensitive,AOptions.Column,AOptions.Row,AOptions.Column,AOptions.Row,AOptions.FullText)}
       else if ($tmp === $mod.TTMSFNCDataGridHilightMode.ghmColumn) {
        if (AOptions.IncludeFixed) {
          this.InternalMarkCells(AHilightText,"e",AOptions.CaseSensitive,AOptions.Column,0,AOptions.Column,this.FRowCount - 1,AOptions.FullText)}
         else this.InternalMarkCells(AHilightText,"e",AOptions.CaseSensitive,AOptions.Column,this.FFixedRowCount,AOptions.Column,this.FRowCount - 1 - this.FFixedBottomRowCount,AOptions.FullText);
      } else if ($tmp === $mod.TTMSFNCDataGridHilightMode.ghmRow) {
        if (AOptions.IncludeFixed) {
          this.InternalMarkCells(AHilightText,"e",AOptions.CaseSensitive,0,AOptions.Row,this.FColumnCount - 1,AOptions.Row,AOptions.FullText)}
         else this.InternalMarkCells(AHilightText,"e",AOptions.CaseSensitive,this.FFixedColumnCount,AOptions.Row,this.FColumnCount - 1 - this.FFixedRightColumnCount,AOptions.Row,AOptions.FullText);
      } else if ($tmp === $mod.TTMSFNCDataGridHilightMode.ghmGrid) {
        if (AOptions.IncludeFixed) {
          this.InternalMarkCells(AHilightText,"e",AOptions.CaseSensitive,0,0,this.FColumnCount - 1,this.FRowCount - 1,AOptions.FullText)}
         else this.InternalMarkCells(AHilightText,"e",AOptions.CaseSensitive,this.FFixedColumnCount,this.FFixedRowCount,this.FColumnCount - 1 - this.FFixedRightColumnCount,this.FRowCount - 1 - this.FFixedBottomRowCount,AOptions.FullText);
      };
    };
    this.Navigate = function (ACell, AForceScroll, AIgnoreColumn, AIgnoreRow) {
      var hs = 0.0;
      var vs = 0.0;
      var rhs = 0.0;
      var rvs = 0.0;
      var vss = 0.0;
      var hss = 0.0;
      var cw = 0.0;
      var ch = 0.0;
      var totalh = 0.0;
      var totalw = 0.0;
      var cs = 0;
      var rs = 0;
      var toth = 0.0;
      var totw = 0.0;
      var cl = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var cr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var c = 0;
      var r = 0;
      var CurrentPage = 0;
      var TargetPage = 0;
      var PageSize = 0;
      var PageStartRow = 0;
      var ShouldForcePageJump = false;
      cr.$assign(this.GetContentClipRect());
      cw = cr.Right - cr.Left;
      ch = cr.Bottom - cr.Top;
      vs = this.GetVScrollValue();
      hs = this.GetHScrollValue();
      vss = vs;
      hss = hs;
      if (this.GetHorizontalScrollMode() === $mod.TTMSFNCDataGridScrollMode.gsmCellScrolling) hss = this.GetHorizontalScrollPosition();
      if (this.GetVerticalScrollMode() === $mod.TTMSFNCDataGridScrollMode.gsmCellScrolling) vss = this.GetVerticalScrollPosition();
      totalw = 0;
      totalh = 0;
      ACell.$assign(this.BaseCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell)));
      ShouldForcePageJump = false;
      if (this.FPaging) {
        CurrentPage = this.GetPageIndex();
        TargetPage = this.GetPageIndexForRow(ACell.GetRow());
        PageSize = this.GetPageScrollSize();
        if ((PageSize > 0) && (TargetPage !== CurrentPage) && (TargetPage >= 0) && (TargetPage < this.GetPageCount())) {
          ShouldForcePageJump = true;
          PageStartRow = this.FFixedRowCount + this.FFreezeRowCount + (TargetPage * PageSize);
          vs = PageStartRow - this.FFixedRowCount - this.FFreezeRowCount;
        };
      };
      cs = this.ColumnSpan(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
      rs = this.RowSpan(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell));
      if (cs > 0) {
        for (var $l = ACell.GetColumn(), $end = (ACell.GetColumn() + cs) - 1; $l <= $end; $l++) {
          c = $l;
          totalw = totalw + this.GetColumnWidth(c);
        };
      } else totalw = this.GetColumnWidth(ACell.GetColumn());
      if (rs > 0) {
        for (var $l1 = ACell.GetRow(), $end1 = (ACell.GetRow() + rs) - 1; $l1 <= $end1; $l1++) {
          r = $l1;
          totalh = totalh + this.GetRowHeight(r);
        };
      } else totalh = this.GetRowHeight(ACell.GetRow());
      if (!ShouldForcePageJump) {
        rvs = this.GetRowPosition(ACell.GetRow());
        if (AForceScroll) {
          var $tmp = this.GetVerticalScrollMode();
          if ($tmp === $mod.TTMSFNCDataGridScrollMode.gsmPixelScrolling) {
            vs = rvs - this.GetTotalFixedRowHeight(true)}
           else if ($tmp === $mod.TTMSFNCDataGridScrollMode.gsmCellScrolling) vs = ACell.GetRow() - this.FFixedRowCount - this.FFreezeRowCount;
        } else {
          if (rvs < (vss + this.GetTotalFixedRowHeight(true))) {
            var $tmp1 = this.GetVerticalScrollMode();
            if ($tmp1 === $mod.TTMSFNCDataGridScrollMode.gsmPixelScrolling) {
              vs = rvs - this.GetTotalFixedRowHeight(true)}
             else if ($tmp1 === $mod.TTMSFNCDataGridScrollMode.gsmCellScrolling) vs = ACell.GetRow() - this.FFixedRowCount - this.FFreezeRowCount;
          } else {
            if (totalh < (ch - this.GetTotalFixedBottomRowHeight())) {
              var $tmp2 = this.GetVerticalScrollMode();
              if ($tmp2 === $mod.TTMSFNCDataGridScrollMode.gsmPixelScrolling) {
                if ((rvs + totalh) > ((vss + ch) - this.GetTotalFixedBottomRowHeight())) vs = ((rvs + totalh) - ch - 1) + this.GetTotalFixedBottomRowHeight();
              } else if ($tmp2 === $mod.TTMSFNCDataGridScrollMode.gsmCellScrolling) {
                while ((rvs + totalh) > ((vss + ch) - this.GetTotalFixedBottomRowHeight())) {
                  vs = vs + 1;
                  cl.$assign(this.BaseCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(ACell.GetColumn(),Math.round(vs)))));
                  rs = this.RowSpan(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cl));
                  if (rs > 0) {
                    toth = this.GetRowPosition((cl.GetRow() + rs) - 1) - this.GetRowPosition(cl.GetRow())}
                   else {
                    rs = 1;
                    toth = this.GetRowHeight(cl.GetRow());
                  };
                  vs = (vs + rs) - 1;
                  vss = vss + toth;
                };
              };
            };
          };
        };
      };
      rhs = this.GetColumnPosition(ACell.GetColumn());
      if (AForceScroll) {
        var $tmp3 = this.GetHorizontalScrollMode();
        if ($tmp3 === $mod.TTMSFNCDataGridScrollMode.gsmPixelScrolling) {
          hs = rhs - this.GetTotalFixedColumnWidth(true)}
         else if ($tmp3 === $mod.TTMSFNCDataGridScrollMode.gsmCellScrolling) hs = ACell.GetColumn() - this.FFixedColumnCount - this.FFreezeColumnCount;
      } else {
        if (rhs < (hss + this.GetTotalFixedColumnWidth(true))) {
          var $tmp4 = this.GetHorizontalScrollMode();
          if ($tmp4 === $mod.TTMSFNCDataGridScrollMode.gsmPixelScrolling) {
            hs = rhs - this.GetTotalFixedColumnWidth(true)}
           else if ($tmp4 === $mod.TTMSFNCDataGridScrollMode.gsmCellScrolling) hs = ACell.GetColumn() - this.FFixedColumnCount - this.FFreezeColumnCount;
        } else {
          if (totalw < (cw - this.GetTotalFixedRightColumnWidth())) {
            var $tmp5 = this.GetHorizontalScrollMode();
            if ($tmp5 === $mod.TTMSFNCDataGridScrollMode.gsmPixelScrolling) {
              if ((rhs + totalw) > ((hss + cw) - this.GetTotalFixedRightColumnWidth())) hs = ((rhs + totalw) - cw - 1) + this.GetTotalFixedRightColumnWidth();
            } else if ($tmp5 === $mod.TTMSFNCDataGridScrollMode.gsmCellScrolling) {
              while ((rhs + totalw) > ((hss + cw) - this.GetTotalFixedRightColumnWidth())) {
                hs = hs + 1;
                cl.$assign(this.BaseCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(Math.round(hs),ACell.GetRow()))));
                cs = this.ColumnSpan(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(cl));
                if (cs > 0) {
                  totw = this.GetColumnPosition(cl.GetColumn()) - this.GetColumnPosition((cl.GetColumn() + cs) - 1)}
                 else {
                  cs = 1;
                  totw = this.GetColumnWidth(cl.GetColumn());
                };
                hs = (hs + cs) - 1;
                hss = hss + totw;
              };
            };
          };
        };
      };
      if (AIgnoreColumn) {
        this.Scroll(this.GetHScrollValue(),vs)}
       else if (AIgnoreRow) {
        this.Scroll(hs,this.GetVScrollValue())}
       else this.Scroll(hs,vs);
    };
    this.NextPage = function () {
      this.SetPageIndex(this.GetPageIndex() + 1);
    };
    this.PasteFromClipboard = function () {
      var cliptext = "";
      var endofRow = 0;
      var cr = 0;
      var ct = "";
      var line = "";
      var clipt = "";
      var ec = "";
      var s = 0;
      var ns = 0;
      var z = 0;
      var tabpos = 0;
      var Allow = false;
      var nc = false;
      var v = undefined;
      this.BeginUpdate();
      try {
        cliptext = pas["WEBLib.TMSFNCUtils"].TTMSFNCClipBoard.GetText();
        s = this.FSelection.StartCell.GetColumn();
        z = this.FSelection.StartCell.GetRow();
        if ((s === -1) || (z === -1)) return;
        endofRow = cliptext.length + 1;
        do {
          cr = pas.System.Pos("\r",cliptext);
          if (cr === 0) cr = endofRow;
          line = pas.System.Copy(cliptext,1,cr - 1);
          if ((line.length > 0) && (this.GetOptions().FClipboard.FPasteAction === $mod.TTMSFNCDataGridClipboardPasteAction.gpaInsert)) this.InsertRows(z,1);
          tabpos = -1;
          while (pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.VarPos("\t",line,{get: function () {
              return tabpos;
            }, set: function (v) {
              tabpos = v;
            }}) > 0) {
            ns = s;
            ns += 1;
            if ((ns > this.FColumnCount) && this.GetOptions().FClipboard.FAllowColumnGrow) this.SetColumnCount(ns);
            ct = pas.System.Copy(line,1,tabpos - 1);
            if (pas.System.Pos("\n",ct) > 0) {
              if (1 > 0) {
                if (pas.System.Pos('"',ct) === 1) pas.System.Delete({get: function () {
                    return ct;
                  }, set: function (v) {
                    ct = v;
                  }},1,1);
                if (pas.System.Pos('"',ct) === ct.length) pas.System.Delete({get: function () {
                    return ct;
                  }, set: function (v) {
                    ct = v;
                  }},ct.length,1);
                pas["WEBLib.TMSFNCDataGridUtil"].CSVToLineFeeds({get: function () {
                    return ct;
                  }, set: function (v) {
                    ct = v;
                  }});
              };
            };
            if ((s <= this.FColumnCount) && (z <= this.FRowCount)) {
              if (this.GetOptions().FClipboard.FIgnoreReadOnly || !this.IsCellReadOnly(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(s,z)))) {
                Allow = true;
                if (Allow) {
                  v = ct;
                  this.DoLoadCellData(s,z,{get: function () {
                      return v;
                    }, set: function (w) {
                      v = w;
                    }});
                  this.SetCell(s,z,v);
                };
              };
            };
            pas.System.Delete({get: function () {
                return line;
              }, set: function (v) {
                line = v;
              }},1,tabpos);
            s += 1;
            if ((s > this.FColumnCount) && this.GetOptions().FClipboard.FAllowColumnGrow) this.SetColumnCount(s);
          };
          nc = false;
          if ((s <= this.FColumnCount) && (z <= this.FRowCount)) {
            if (this.GetOptions().FClipboard.FIgnoreReadOnly || !this.IsCellReadOnly(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(s,z)))) {
              if ((cr !== endofRow) || (line !== "")) {
                nc = true;
                ns = s;
                if (nc) ns += 1;
                if ((ns > this.FColumnCount) && this.GetOptions().FClipboard.FAllowColumnGrow) this.SetColumnCount(ns);
                if (pas.System.Pos("\n",line) > 0) {
                  if (pas.System.Pos('"',line) === 1) pas.System.Delete({get: function () {
                      return line;
                    }, set: function (v) {
                      line = v;
                    }},1,1);
                  if (pas.System.Pos('"',line) === line.length) pas.System.Delete({get: function () {
                      return line;
                    }, set: function (v) {
                      line = v;
                    }},line.length,1);
                  pas["WEBLib.TMSFNCDataGridUtil"].CSVToLineFeeds({get: function () {
                      return line;
                    }, set: function (v) {
                      line = v;
                    }});
                };
                Allow = true;
                if (Allow && (s <= this.FColumnCount) && (z <= this.FRowCount)) {
                  v = line;
                  this.DoLoadCellData(s,z,{get: function () {
                      return v;
                    }, set: function (w) {
                      v = w;
                    }});
                  this.SetCell(s,z,v);
                };
              };
            };
          };
          if (nc) s += 1;
          if ((s > this.FColumnCount) && this.GetOptions().FClipboard.FAllowColumnGrow) this.SetColumnCount(s);
          clipt = pas.System.Copy(cliptext,cr + 1,cliptext.length - cr);
          if (pas.System.Copy(clipt,clipt.length,1) === "\n") clipt = pas.System.Copy(cliptext,cr + 2,cliptext.length - cr - 1);
          cliptext = clipt;
          s = this.FSelection.StartCell.GetColumn();
          ec = pas.System.Copy(cliptext,cliptext.length,1);
          if (ec !== "\x00") z += 1;
          if ((z === this.FRowCount) && (cr !== endofRow) && (ec !== "") && this.GetOptions().FClipboard.FAllowRowGrow) this.SetRowCount(this.FRowCount + 1);
        } while (!(cr === endofRow));
      } finally {
        this.EndUpdate();
      };
    };
    this.PreviousPage = function () {
      this.SetPageIndex(this.GetPageIndex() - 1);
    };
    this.RegisterRuntimeClasses = function () {
      pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridData.RegisterRuntimeClasses.call(this);
      pas.Classes.RegisterClass($mod.TTMSFNCDataGridColumn);
    };
    this.RemoveBitmap = function (ACell) {
      this.RemoveBitmap$1(ACell.GetColumn(),ACell.GetRow());
    };
    this.RemoveBitmap$1 = function (AColumn, ARow) {
      var cd = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      this.BeginUpdate();
      try {
        cd = this.GetCellData(AColumn,ARow);
        if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd) && (pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FType === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitBitmap)) pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FType = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitNormal;
      } finally {
        this.EndUpdate();
      };
    };
    this.RemoveButton = function (ACell) {
      this.RemoveButton$1(ACell.GetColumn(),ACell.GetRow());
    };
    this.RemoveButton$1 = function (AColumn, ARow) {
      var cd = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      this.BeginUpdate();
      try {
        cd = this.GetCellData(AColumn,ARow);
        if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd) && (pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FType === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitButton)) pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FType = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitNormal;
      } finally {
        this.EndUpdate();
      };
    };
    this.RemoveCheckBox = function (ACell) {
      this.RemoveCheckBox$1(ACell.GetColumn(),ACell.GetRow());
    };
    this.RemoveCheckBox$1 = function (AColumn, ARow) {
      var cd = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      this.BeginUpdate();
      try {
        cd = this.GetCellData(AColumn,ARow);
        if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd) && (pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FType === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitCheckBox)) pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FType = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitNormal;
      } finally {
        this.EndUpdate();
      };
    };
    this.RemoveDataCheckBox = function (ACell) {
      this.RemoveDataCheckBox$1(ACell.GetColumn(),ACell.GetRow());
    };
    this.RemoveDataCheckBox$1 = function (AColumn, ARow) {
      var cd = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      this.BeginUpdate();
      try {
        cd = this.GetCellData(AColumn,ARow);
        if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd) && (pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FType === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitDataCheckBox)) pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FType = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitNormal;
      } finally {
        this.EndUpdate();
      };
    };
    this.RemoveDataProgressBar = function (ACell) {
      this.RemoveDataProgressBar$1(ACell.GetColumn(),ACell.GetRow());
    };
    this.RemoveDataProgressBar$1 = function (AColumn, ARow) {
      var cd = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      this.BeginUpdate();
      try {
        cd = this.GetCellData(AColumn,ARow);
        if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd) && (pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FType === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitDataProgressBar)) pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FType = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitNormal;
      } finally {
        this.EndUpdate();
      };
    };
    this.RemoveDataRadioButton = function (ACell) {
      this.RemoveDataRadioButton$1(ACell.GetColumn(),ACell.GetRow());
    };
    this.RemoveDataRadioButton$1 = function (AColumn, ARow) {
      var cd = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      this.BeginUpdate();
      try {
        cd = this.GetCellData(AColumn,ARow);
        if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd) && (pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FType === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitDataRadioButton)) pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FType = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitNormal;
      } finally {
        this.EndUpdate();
      };
    };
    this.RemoveFilterEditor = function (ACell) {
      this.RemoveFilterEditor$1(ACell.GetColumn(),ACell.GetRow());
    };
    this.RemoveFilterEditor$1 = function (AColumn, ARow) {
      var cd = null;
      var o = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      this.BeginUpdate();
      try {
        cd = this.GetCellData(AColumn,ARow);
        if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd)) {
          o = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FFilterEditor;
          if (o != null) pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).DestroyFilterEditor();
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.RemoveGrid = function (ACell) {
      this.RemoveGrid$1(ACell.GetColumn(),ACell.GetRow());
    };
    this.RemoveGrid$1 = function (AColumn, ARow) {
      var cd = null;
      var o = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      this.BeginUpdate();
      try {
        cd = this.GetCellData(AColumn,ARow);
        if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd)) {
          o = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FRenderer;
          if (o != null) pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).DestroyRenderer();
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.RemoveLayout = function (ACell) {
      this.RemoveLayout$1(ACell.GetColumn(),ACell.GetRow());
    };
    this.RemoveLayout$1 = function (AColumn, ARow) {
      var cd = null;
      var o = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      this.BeginUpdate();
      try {
        cd = this.GetCellData(AColumn,ARow);
        if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd)) {
          o = pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FLayout;
          if (o != null) pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).DestroyLayout();
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.RemoveProgressBar = function (ACell) {
      this.RemoveProgressBar$1(ACell.GetColumn(),ACell.GetRow());
    };
    this.RemoveProgressBar$1 = function (AColumn, ARow) {
      var cd = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      this.BeginUpdate();
      try {
        cd = this.GetCellData(AColumn,ARow);
        if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd) && (pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FType === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitProgressBar)) pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FType = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitNormal;
      } finally {
        this.EndUpdate();
      };
    };
    this.RemoveRadioButton = function (ACell) {
      this.RemoveRadioButton$1(ACell.GetColumn(),ACell.GetRow());
    };
    this.RemoveRadioButton$1 = function (AColumn, ARow) {
      var cd = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      this.BeginUpdate();
      try {
        cd = this.GetCellData(AColumn,ARow);
        if ((cd != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(cd) && (pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FType === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitRadioButton)) pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(cd).FType = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitNormal;
      } finally {
        this.EndUpdate();
      };
    };
    this.ResetExportScale = function () {
      var I = 0;
      this.BeginUpdate();
      try {
        for (var $l = 0, $end = this.FColumnCount - 1; $l <= $end; $l++) {
          I = $l;
          this.SetColumnWidth(I,this.GetColumnWidth(I) / this.FScale);
        };
        for (var $l1 = 0, $end1 = this.FRowCount - 1; $l1 <= $end1; $l1++) {
          I = $l1;
          this.SetRowHeight(I,this.GetRowHeight(I) / this.FScale);
        };
        this.FScale = 1.0;
      } finally {
        this.EndUpdate();
      };
    };
    this.ResetToDefaultStyle = function () {
      var cs = null;
      var vs = null;
      this.FStyleApplied = false;
      this.BeginUpdate();
      try {
        this.FCellAppearance.FBandLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        this.FCellAppearance.FBandLayout.FFill.SetColor(14745599);
        this.FCellAppearance.FFixedLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        this.FCellAppearance.FFixedLayout.FFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(238,238,238),10));
        this.FCellAppearance.FNormalLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        this.FCellAppearance.FNormalLayout.FFill.SetColor(16777215);
        this.FCellAppearance.FGroupLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        this.FCellAppearance.FGroupLayout.FFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(238,238,238),10));
        this.FCellAppearance.FSummaryLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        this.FCellAppearance.FSummaryLayout.FFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(pas["WEBLib.TMSFNCGraphicsTypes"].MakeGraphicsColor(245,245,230),10));
        this.FCellAppearance.FSelectedLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        this.FCellAppearance.FSelectedLayout.FFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(14599344,80));
        this.FCellAppearance.FFocusedLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        this.FCellAppearance.FFocusedLayout.FFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(14599344,40));
        this.FCellAppearance.FFixedSelectedLayout.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        this.FCellAppearance.FFixedSelectedLayout.FFill.SetColor(pas["WEBLib.TMSFNCGraphicsTypes"].Lighter(14599344,80));
        this.FCellAppearance.FBandLayout.FFont.SetColor(0);
        this.FCellAppearance.FFixedLayout.FFont.SetColor(0);
        this.FCellAppearance.FNormalLayout.FFont.SetColor(0);
        this.FCellAppearance.FGroupLayout.FFont.SetColor(0);
        this.FCellAppearance.FSummaryLayout.FFont.SetColor(0);
        this.FCellAppearance.FSelectedLayout.FFont.SetColor(0);
        this.FCellAppearance.FFocusedLayout.FFont.SetColor(0);
        this.FCellAppearance.FFixedSelectedLayout.FFont.SetColor(0);
        this.FFilterAppearance.FFill.SetColor(16777215);
        this.FFilterAppearance.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
        this.FFilterAppearance.FStroke.SetColor(12632256);
        this.FFilterAppearance.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
        this.FFilterAppearance.FFont.SetColor(0);
        cs = this.GetCustomHorizontalScrollBar();
        if (cs != null) cs.ApplyStyle();
        vs = this.GetCustomVerticalScrollBar();
        if (vs != null) vs.ApplyStyle();
      } finally {
        this.EndUpdate();
      };
    };
    this.RestoreScrollPosition = function () {
      this.Scroll(this.FSaveHScrollPos,this.FSaveVScrollPos);
    };
    this.ResetDrag = function () {
      this.FDragging = false;
      this.GetDragTimer().SetEnabled(false);
      this.FDraggingMode = $mod.TTMSFNCDataGridDraggingMode.gdmNone;
      this.FDragCell.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(-1,-1));
      this.FDragCellTo.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(-1,-1));
      this.FDraggingType = $mod.TTMSFNCDataGridDraggingType.gdtNone;
      this.FDragFixed = false;
    };
    this.SaveScrollPosition = function () {
      this.FSaveHScrollPos = this.GetHScrollValue();
      this.FSaveVScrollPos = this.GetVScrollValue();
    };
    this.SaveToHTMLData = function (AFileName) {
      this.InternalSaveToHTML(AFileName,pas.SysUtils.TEncoding.GetDefault());
    };
    this.SaveToHTMLData$1 = function (AFileName, AEncoding) {
      this.InternalSaveToHTML(AFileName,AEncoding);
    };
    this.SaveToHTMLStreamData = function (AStream) {
      this.InternalSaveToHTMLStream(AStream,pas.SysUtils.TEncoding.GetDefault(),"");
    };
    this.SaveToHTMLStreamData$1 = function (AStream, AEncoding) {
      this.InternalSaveToHTMLStream(AStream,AEncoding,"");
    };
    this.SaveToImageData = function (AFileName) {
      this.InternalSaveToImage(AFileName);
    };
    this.SaveToImageStreamData = function (AStream) {
      this.InternalSaveToImageStream(AStream);
    };
    this.Scroll = function (AHorizontalPos, AVerticalPos) {
      var h = 0.0;
      var v = 0.0;
      var hv = false;
      this.FBlockScrollingUpdate = true;
      h = this.GetHScrollValue();
      this.SetHScrollValue(AHorizontalPos);
      v = this.GetVScrollValue();
      this.SetVScrollValue(AVerticalPos);
      hv = v !== this.GetVScrollValue();
      if (hv) this.DoVScroll(this.GetVScrollValue());
      if (h !== this.GetHScrollValue()) this.DoHScroll(this.GetHScrollValue());
      this.FBlockScrollingUpdate = false;
      this.Update();
      if (hv && (this.FAdapter != null) && $mod.TTMSFNCDataGridRendererDataAdapter.isPrototypeOf(this.FAdapter)) rtl.as(this.FAdapter,$mod.TTMSFNCDataGridRendererDataAdapter).Scroll();
    };
    this.SelectAllCells = function (AIncludeHidden) {
      var i = 0;
      var j = 0;
      var StartCell = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var EndCell = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var FocusCell = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var Allow = false;
      StartCell.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(this.FFixedColumnCount,this.FFixedRowCount));
      EndCell.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(this.FColumnCount - 1 - this.FFixedRightColumnCount,this.FRowCount - 1 - this.FFixedBottomRowCount));
      FocusCell.$assign(StartCell);
      if (this.IsAnchorMode() && (this.FSaveCell.GetRow() >= 0) && (this.FSaveCell.GetColumn() >= 0)) FocusCell.$assign(this.FSaveCell);
      Allow = true;
      this.DoSelectingCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(StartCell),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(EndCell),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(FocusCell),{get: function () {
          return Allow;
        }, set: function (v) {
          Allow = v;
        }});
      if (!Allow) return;
      if (this.GetOptions().FSelection.FMode in rtl.createSet($mod.TTMSFNCDataGridSelectionMode.gsmCellRange,$mod.TTMSFNCDataGridSelectionMode.gsmRowRange,$mod.TTMSFNCDataGridSelectionMode.gsmColumnRange,$mod.TTMSFNCDataGridSelectionMode.gsmDisjunctCell,$mod.TTMSFNCDataGridSelectionMode.gsmDisjunctCellRange,$mod.TTMSFNCDataGridSelectionMode.gsmDisjunctColumn,$mod.TTMSFNCDataGridSelectionMode.gsmDisjunctRow)) {
        this.SetStartCell(StartCell.GetColumn(),StartCell.GetRow());
        this.SetStopCell(EndCell.GetColumn(),EndCell.GetRow());
        this.SetFocusCell(FocusCell.GetColumn(),FocusCell.GetRow());
        this.FRealCell.$assign(FocusCell);
        this.FFocusedCell.$assign(FocusCell);
      };
      if (this.GetOptions().FSelection.FMode === $mod.TTMSFNCDataGridSelectionMode.gsmDisjunctRow) {
        this.IncUpdateCount();
        try {
          for (var $l = this.FFixedRowCount, $end = this.FRowCount - 1 - this.FFixedBottomRowCount; $l <= $end; $l++) {
            i = $l;
            if (AIncludeHidden || this.IsRowDisplayed(i)) this.SetSelectedRow(i,true);
          };
        } finally {
          this.DecUpdateCount();
        };
      };
      if (this.GetOptions().FSelection.FMode === $mod.TTMSFNCDataGridSelectionMode.gsmDisjunctColumn) {
        this.IncUpdateCount();
        try {
          for (var $l1 = this.FFixedColumnCount, $end1 = this.FColumnCount - 1 - this.FFixedRightColumnCount; $l1 <= $end1; $l1++) {
            i = $l1;
            if (AIncludeHidden || this.IsColumnDisplayed(i)) this.SetSelectedColumn(i,true);
          };
        } finally {
          this.DecUpdateCount();
        };
      };
      if (this.GetOptions().FSelection.FMode in rtl.createSet($mod.TTMSFNCDataGridSelectionMode.gsmDisjunctCell,$mod.TTMSFNCDataGridSelectionMode.gsmDisjunctCellRange)) {
        this.IncUpdateCount();
        try {
          for (var $l2 = this.FFixedColumnCount, $end2 = this.FColumnCount - 1 - this.FFixedRightColumnCount; $l2 <= $end2; $l2++) {
            i = $l2;
            for (var $l3 = this.FFixedRowCount, $end3 = this.FRowCount - 1 - this.FFixedBottomRowCount; $l3 <= $end3; $l3++) {
              j = $l3;
              if (AIncludeHidden || this.IsCellDisplayed(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(i,j)))) this.SetSelectedCell(i,j,true);
            };
          };
        } finally {
          this.DecUpdateCount();
        };
      };
      this.Navigate(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(FocusCell),false,false,false);
      this.DoSelectCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(StartCell),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(EndCell),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(FocusCell));
    };
    this.SelectCell = function (ACell, AShift, AMouseDragging, AIgnoreColumn, AIgnoreRow) {
      var sta = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var stc = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var rs = 0;
      var cs = 0;
      var rsstart = 0;
      var csstart = 0;
      var bs = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var ff = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var fc = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var a = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var f = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var cst = 0;
      var rst = 0;
      var ic = 0;
      var ir = 0;
      var c1 = 0;
      var c2 = 0;
      var r1 = 0;
      var r2 = 0;
      var I = 0;
      var J = 0;
      var doUpdate = false;
      var Allow = false;
      var cntr = 0;
      var cntc = 0;
      var cntcl = 0;
      var g = null;
      var c = false;
      var OldStartCell = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var OldStopCell = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var OldFocusCell = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var SelectionChanged = false;
      var IntendedFocus = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      OldStartCell.$assign(this.FSelection.StartCell);
      OldStopCell.$assign(this.FSelection.StopCell);
      OldFocusCell.$assign(this.GetFocusedCell());
      if ((ACell.GetRow() < this.FFixedRowCount) && (ACell.GetColumn() < this.FFixedColumnCount) && ($mod.TTMSFNCDataGridFixedCellSelectionMode.gfcsAll in this.GetOptions().FMouse.FFixedCellSelection)) {
        this.SelectAllCells(true);
        return;
      };
      ACell.SetRow(Math.max(this.FFixedRowCount,Math.min(ACell.GetRow(),this.FRowCount - 1 - this.FFixedBottomRowCount)));
      ACell.SetColumn(Math.max(this.FFixedColumnCount,Math.min(ACell.GetColumn(),this.FColumnCount - 1 - this.FFixedRightColumnCount)));
      this.FRealCell.$assign(ACell);
      ACell.$assign(this.BaseCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(ACell)));
      this.SetFocusCell(ACell.GetColumn(),ACell.GetRow());
      if (this.IsDisjunctMode() && (pas.Classes.TShiftState$a.ssShift in AShift)) {
        if ((this.FDisjunctAnchorCell.GetRow() >= 0) && (this.FDisjunctAnchorCell.GetColumn() >= 0)) this.FSaveCell.$assign(this.FDisjunctAnchorCell);
      };
      var $tmp = this.GetOptions().FSelection.FMode;
      if ($tmp === $mod.TTMSFNCDataGridSelectionMode.gsmSingleCell) {
        this.SetStartCell(this.GetFocusedCell().GetColumn(),this.GetFocusedCell().GetRow());
        this.SetStopCell(this.GetFocusedCell().GetColumn(),this.GetFocusedCell().GetRow());
      } else if ($tmp === $mod.TTMSFNCDataGridSelectionMode.gsmSingleRow) {
        this.SetStartCell(this.FFixedColumnCount,this.GetFocusedCell().GetRow());
        this.SetStopCell(this.FColumnCount - 1 - this.FFixedRightColumnCount,this.GetFocusedCell().GetRow());
      } else if ($tmp === $mod.TTMSFNCDataGridSelectionMode.gsmSingleColumn) {
        this.SetStartCell(this.GetFocusedCell().GetColumn(),this.FFixedRowCount);
        this.SetStopCell(this.GetFocusedCell().GetColumn(),this.FRowCount - 1 - this.FFixedBottomRowCount);
      } else if (($tmp === $mod.TTMSFNCDataGridSelectionMode.gsmCellRange) || ($tmp === $mod.TTMSFNCDataGridSelectionMode.gsmRowRange) || ($tmp === $mod.TTMSFNCDataGridSelectionMode.gsmColumnRange) || ($tmp === $mod.TTMSFNCDataGridSelectionMode.gsmDisjunctRow) || ($tmp === $mod.TTMSFNCDataGridSelectionMode.gsmDisjunctColumn) || ($tmp === $mod.TTMSFNCDataGridSelectionMode.gsmDisjunctCell) || ($tmp === $mod.TTMSFNCDataGridSelectionMode.gsmDisjunctCellRange)) {
        doUpdate = true;
        if (this.IsDisjunctMode()) {
          if (!(pas.Classes.TShiftState$a.ssCtrl in AShift) && !(pas.Classes.TShiftState$a.ssShift in AShift) && (!AMouseDragging || (this.FFirstCell.GetRow() === -1) || (this.FFirstCell.GetColumn() === -1))) {
            this.GetSelectedRowDictionary().Clear();
            this.GetSelectedColumnDictionary().Clear();
            this.GetSelectedCellDictionary().Clear();
            this.FDisjunctAnchorCell.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(-1,-1));
          };
        };
        if ((!AMouseDragging || (this.FFirstCell.GetRow() === -1) || (this.FFirstCell.GetColumn() === -1)) && !(pas.Classes.TShiftState$a.ssShift in AShift) && !(pas.Classes.TShiftState$a.ssCtrl in AShift)) {
          this.SetStartCell(this.FRealCell.GetColumn(),this.GetFocusedCell().GetRow());
          this.SetStopCell(this.GetFocusedCell().GetColumn(),this.GetFocusedCell().GetRow());
          this.FFirstCell.$assign(this.FSelection.StartCell);
          this.FSaveCell.$assign(this.FSelection.StartCell);
        } else if ((pas.Classes.TShiftState$a.ssShift in AShift) && ((this.FSaveCell.GetRow() === -1) || (this.FSaveCell.GetColumn() === -1))) {
          this.SetStartCell(this.GetFocusedCell().GetColumn(),this.GetFocusedCell().GetRow());
          this.SetStopCell(this.GetFocusedCell().GetColumn(),this.GetFocusedCell().GetRow());
          this.FSaveCell.$assign(this.FSelection.StartCell);
        };
        if ((pas.Classes.TShiftState$a.ssShift in AShift) || (pas.Classes.TShiftState$a.ssCtrl in AShift)) this.FFirstCell.$assign(this.FSaveCell);
        if (doUpdate) {
          if (this.GetFocusedCell().GetColumn() < this.FFirstCell.GetColumn()) {
            this.SetStartCell(this.GetFocusedCell().GetColumn(),this.FSelection.StartCell.GetRow());
            this.SetStopCell(this.FFirstCell.GetColumn(),this.FSelection.StopCell.GetRow());
          } else {
            this.SetStopCell(this.GetFocusedCell().GetColumn(),this.FSelection.StopCell.GetRow());
            this.SetStartCell(this.FFirstCell.GetColumn(),this.FSelection.StartCell.GetRow());
          };
          if (this.GetFocusedCell().GetRow() < this.FFirstCell.GetRow()) {
            this.SetStartCell(this.FSelection.StartCell.GetColumn(),this.GetFocusedCell().GetRow());
            this.SetStopCell(this.FSelection.StopCell.GetColumn(),this.FFirstCell.GetRow());
          } else {
            this.SetStopCell(this.FSelection.StopCell.GetColumn(),this.GetFocusedCell().GetRow());
            this.SetStartCell(this.FSelection.StartCell.GetColumn(),this.FFirstCell.GetRow());
          };
        };
        if (this.IsDisjunctMode()) {
          if (!(pas.Classes.TShiftState$a.ssCtrl in AShift) && !(pas.Classes.TShiftState$a.ssShift in AShift) && !(AMouseDragging && (this.FFirstCell.GetRow() >= 0) && (this.FFirstCell.GetColumn() >= 0))) {
            this.SetStartCell(this.GetFocusedCell().GetColumn(),this.GetFocusedCell().GetRow());
            this.SetStopCell(this.GetFocusedCell().GetColumn(),this.GetFocusedCell().GetRow());
            this.FSaveCell.$assign(this.GetFocusedCell());
            this.FDisjunctAnchorCell.$assign(this.GetFocusedCell());
          };
        };
        var $tmp1 = this.GetOptions().FSelection.FMode;
        if (($tmp1 === $mod.TTMSFNCDataGridSelectionMode.gsmRowRange) || ($tmp1 === $mod.TTMSFNCDataGridSelectionMode.gsmDisjunctRow)) {
          this.SetStartCell(this.FFixedColumnCount,this.FSelection.StartCell.GetRow());
          this.SetStopCell(this.FColumnCount - 1 - this.FFixedRightColumnCount,this.FSelection.StopCell.GetRow());
        } else if (($tmp1 === $mod.TTMSFNCDataGridSelectionMode.gsmColumnRange) || ($tmp1 === $mod.TTMSFNCDataGridSelectionMode.gsmDisjunctColumn)) {
          this.SetStartCell(this.FSelection.StartCell.GetColumn(),this.FFixedRowCount);
          this.SetStopCell(this.FSelection.StopCell.GetColumn(),this.FRowCount - 1 - this.FFixedBottomRowCount);
        };
      };
      stc.$assign(this.FSelection.StopCell);
      sta.$assign(this.FSelection.StartCell);
      if (this.FSelection.StopCell.GetColumn() < this.FSelection.StartCell.GetColumn()) {
        this.SetStopCell(sta.GetColumn(),this.FSelection.StopCell.GetRow());
        this.SetStartCell(stc.GetColumn(),this.FSelection.StartCell.GetRow());
      };
      if (this.FSelection.StopCell.GetRow() < this.FSelection.StartCell.GetRow()) {
        this.SetStopCell(this.FSelection.StopCell.GetColumn(),sta.GetRow());
        this.SetStartCell(this.FSelection.StartCell.GetColumn(),stc.GetRow());
      };
      cs = this.FSelection.StopCell.GetColumn();
      csstart = this.FSelection.StartCell.GetColumn();
      rs = this.FSelection.StopCell.GetRow();
      rsstart = this.FSelection.StartCell.GetRow();
      for (var $l = Math.max(this.GetStartColumn(),csstart), $end = Math.min(this.GetStopColumn(),cs); $l <= $end; $l++) {
        ic = $l;
        for (var $l1 = Math.max(this.GetStartRow(),rsstart), $end1 = Math.min(this.GetStopRow(),rs); $l1 <= $end1; $l1++) {
          ir = $l1;
          bs.$assign(this.BaseCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(ic,ir))));
          cst = this.ColumnSpan(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(bs));
          if (((bs.GetColumn() + cst) - 1) > cs) cs = (bs.GetColumn() + cst) - 1;
          if (bs.GetColumn() < csstart) csstart = bs.GetColumn();
          rst = this.RowSpan(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(bs));
          if (((bs.GetRow() + rst) - 1) > rs) rs = (bs.GetRow() + rst) - 1;
          if (bs.GetRow() < rsstart) rsstart = bs.GetRow();
        };
      };
      Allow = true;
      sta.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(csstart,rsstart));
      stc.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(cs,rs));
      IntendedFocus.$assign(this.GetFocusedCell());
      if (this.IsAnchorMode() && (this.FSaveCell.GetRow() >= 0) && (this.FSaveCell.GetColumn() >= 0)) IntendedFocus.$assign(this.FSaveCell);
      this.DoSelectingCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(sta),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(stc),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(IntendedFocus),{get: function () {
          return Allow;
        }, set: function (v) {
          Allow = v;
        }});
      if (!Allow) {
        if ((OldStartCell.GetColumn() >= 0) && (OldStartCell.GetRow() >= 0)) this.SetStartCell(OldStartCell.GetColumn(),OldStartCell.GetRow());
        if ((OldStopCell.GetColumn() >= 0) && (OldStopCell.GetRow() >= 0)) this.SetStopCell(OldStopCell.GetColumn(),OldStopCell.GetRow());
        if ((OldFocusCell.GetColumn() >= 0) && (OldFocusCell.GetRow() >= 0)) this.SetFocusCell(OldFocusCell.GetColumn(),OldFocusCell.GetRow());
        this.FRealCell.$assign(OldFocusCell);
        this.FFocusedCell.$assign(OldFocusCell);
        return;
      };
      this.SetStopCell(cs,rs);
      this.SetStartCell(csstart,rsstart);
      var $tmp2 = this.GetOptions().FSelection.FMode;
      if ($tmp2 === $mod.TTMSFNCDataGridSelectionMode.gsmDisjunctRow) {
        this.IncUpdateCount();
        try {
          if ((pas.Classes.TShiftState$a.ssShift in AShift) || (AMouseDragging && (this.FFirstCell.GetRow() >= 0))) {
            if (pas.Classes.TShiftState$a.ssShift in AShift) {
              a.$assign(this.FDisjunctAnchorCell);
              if ((a.GetRow() < 0) || (a.GetColumn() < 0)) a.$assign(this.FFirstCell);
            } else {
              if (!(pas.Classes.TShiftState$a.ssCtrl in AShift)) this.GetSelectedRowDictionary().Clear();
              a.$assign(this.FFirstCell);
            };
            r1 = Math.min(a.GetRow(),this.GetFocusedCell().GetRow());
            r2 = Math.max(a.GetRow(),this.GetFocusedCell().GetRow());
            for (var $l2 = r1, $end2 = r2; $l2 <= $end2; $l2++) {
              I = $l2;
              this.SetSelectedRow(I,true);
            };
            this.SetStartCell(this.FFixedColumnCount,r1);
            this.SetStopCell(this.FColumnCount - 1 - this.FFixedRightColumnCount,r2);
          } else if (pas.Classes.TShiftState$a.ssCtrl in AShift) {
            this.SetSelectedRow(this.GetFocusedCell().GetRow(),!this.GetSelectedRow(this.GetFocusedCell().GetRow()));
            cntr = this.GetSelectedRowCount();
            if (!this.GetSelectedRow(this.GetFocusedCell().GetRow()) && (cntr === 0)) this.SetSelectedRow(this.GetFocusedCell().GetRow(),true);
            this.FDisjunctAnchorCell.$assign(this.GetFocusedCell());
          } else {
            this.SetSelectedRow(this.GetFocusedCell().GetRow(),true);
            this.FDisjunctAnchorCell.$assign(this.GetFocusedCell());
          };
          if (!this.GetSelectedRow(this.GetFocusedCell().GetRow())) for (var $l3 = this.FSelection.StartCell.GetRow(), $end3 = this.FSelection.StopCell.GetRow(); $l3 <= $end3; $l3++) {
            I = $l3;
            if ((I !== this.GetFocusedCell().GetRow()) && this.GetSelectedRow(I)) this.SetFocusCell(this.GetFocusedCell().GetColumn(),I);
          };
        } finally {
          this.DecUpdateCount();
        };
      } else if ($tmp2 === $mod.TTMSFNCDataGridSelectionMode.gsmDisjunctColumn) {
        this.IncUpdateCount();
        try {
          if ((pas.Classes.TShiftState$a.ssShift in AShift) || (AMouseDragging && (this.FFirstCell.GetColumn() >= 0))) {
            if (pas.Classes.TShiftState$a.ssShift in AShift) {
              a.$assign(this.FDisjunctAnchorCell);
              if ((a.GetRow() < 0) || (a.GetColumn() < 0)) a.$assign(this.FFirstCell);
            } else {
              if (!(pas.Classes.TShiftState$a.ssCtrl in AShift)) this.GetSelectedColumnDictionary().Clear();
              a.$assign(this.FFirstCell);
            };
            c1 = Math.min(a.GetColumn(),this.GetFocusedCell().GetColumn());
            c2 = Math.max(a.GetColumn(),this.GetFocusedCell().GetColumn());
            for (var $l4 = c1, $end4 = c2; $l4 <= $end4; $l4++) {
              I = $l4;
              this.SetSelectedColumn(I,true);
            };
            this.SetStartCell(c1,this.FFixedRowCount);
            this.SetStopCell(c2,this.FRowCount - 1 - this.FFixedBottomRowCount);
          } else if (pas.Classes.TShiftState$a.ssCtrl in AShift) {
            this.SetSelectedColumn(this.GetFocusedCell().GetColumn(),!this.GetSelectedColumn(this.GetFocusedCell().GetColumn()));
            cntc = this.GetSelectedColumnCount();
            if (!this.GetSelectedColumn(this.GetFocusedCell().GetColumn()) && (cntc === 0)) this.SetSelectedColumn(this.GetFocusedCell().GetColumn(),true);
            this.FDisjunctAnchorCell.$assign(this.GetFocusedCell());
          } else {
            this.SetSelectedColumn(this.GetFocusedCell().GetColumn(),true);
            this.FDisjunctAnchorCell.$assign(this.GetFocusedCell());
          };
          if (!this.GetSelectedColumn(this.GetFocusedCell().GetColumn())) for (var $l5 = this.FSelection.StartCell.GetColumn(), $end5 = this.FSelection.StopCell.GetColumn(); $l5 <= $end5; $l5++) {
            I = $l5;
            if ((I !== this.GetFocusedCell().GetColumn()) && this.GetSelectedColumn(I)) this.SetFocusCell(I,this.GetFocusedCell().GetRow());
          };
        } finally {
          this.DecUpdateCount();
        };
      } else if (($tmp2 === $mod.TTMSFNCDataGridSelectionMode.gsmDisjunctCell) || ($tmp2 === $mod.TTMSFNCDataGridSelectionMode.gsmDisjunctCellRange)) {
        this.IncUpdateCount();
        try {
          if ((pas.Classes.TShiftState$a.ssShift in AShift) || (AMouseDragging && (this.FFirstCell.GetRow() >= 0) && (this.FFirstCell.GetColumn() >= 0))) {
            if (!(pas.Classes.TShiftState$a.ssShift in AShift) && !(pas.Classes.TShiftState$a.ssCtrl in AShift)) {
              this.GetSelectedCellDictionary().Clear();
              this.GetSelectedColumnDictionary().Clear();
              this.GetSelectedRowDictionary().Clear();
            };
            var $tmp3 = this.GetOptions().FSelection.FMode;
            if ($tmp3 === $mod.TTMSFNCDataGridSelectionMode.gsmDisjunctCell) {
              for (var $l6 = this.FSelection.StartCell.GetColumn(), $end6 = this.FSelection.StopCell.GetColumn(); $l6 <= $end6; $l6++) {
                I = $l6;
                for (var $l7 = this.FSelection.StartCell.GetRow(), $end7 = this.FSelection.StopCell.GetRow(); $l7 <= $end7; $l7++) {
                  J = $l7;
                  this.SetSelectedCell(I,J,true);
                };
              };
            } else if ($tmp3 === $mod.TTMSFNCDataGridSelectionMode.gsmDisjunctCellRange) {
              if (this.GetFocusedCell().GetRow() > this.FFirstCell.GetRow()) {
                ff.$assign(this.FFirstCell);
                fc.$assign(this.GetFocusedCell());
              } else {
                fc.$assign(this.FFirstCell);
                ff.$assign(this.GetFocusedCell());
              };
              for (var $l8 = this.FFixedColumnCount, $end8 = this.FColumnCount - 1 - this.FFixedRightColumnCount; $l8 <= $end8; $l8++) {
                I = $l8;
                for (var $l9 = this.FSelection.StartCell.GetRow(), $end9 = this.FSelection.StopCell.GetRow(); $l9 <= $end9; $l9++) {
                  J = $l9;
                  if ((J === this.FSelection.StartCell.GetRow()) && (J === this.FSelection.StopCell.GetRow()) && (I >= this.FSelection.StartCell.GetColumn()) && (I <= this.FSelection.StopCell.GetColumn())) {
                    this.SetSelectedCell(I,J,true)}
                   else if ((J === this.FSelection.StartCell.GetRow()) && (J < this.FSelection.StopCell.GetRow()) && (I >= ff.GetColumn())) {
                    this.SetSelectedCell(I,J,true)}
                   else if ((J > this.FSelection.StartCell.GetRow()) && (J < this.FSelection.StopCell.GetRow())) {
                    this.SetSelectedCell(I,J,true)}
                   else if ((J === this.FSelection.StopCell.GetRow()) && (J > this.FSelection.StartCell.GetRow()) && (I <= fc.GetColumn())) this.SetSelectedCell(I,J,true);
                };
              };
            };
          } else if (pas.Classes.TShiftState$a.ssCtrl in AShift) {
            this.SetSelectedCell(this.GetFocusedCell().GetColumn(),this.GetFocusedCell().GetRow(),!this.GetSelectedCell(this.GetFocusedCell().GetColumn(),this.GetFocusedCell().GetRow()));
            this.FDisjunctAnchorCell.$assign(this.GetFocusedCell());
            cntcl = this.GetSelectedCellCount();
            if (!this.GetSelectedCell(this.GetFocusedCell().GetColumn(),this.GetFocusedCell().GetRow()) && (cntcl === 0)) this.SetSelectedCell(this.GetFocusedCell().GetColumn(),this.GetFocusedCell().GetRow(),true);
          } else {
            this.SetSelectedCell(this.GetFocusedCell().GetColumn(),this.GetFocusedCell().GetRow(),true);
            this.FDisjunctAnchorCell.$assign(this.GetFocusedCell());
          };
          if (!this.GetSelectedCell(this.GetFocusedCell().GetColumn(),this.GetFocusedCell().GetRow())) for (var $l10 = this.FSelection.StartCell.GetColumn(), $end10 = this.FSelection.StopCell.GetColumn(); $l10 <= $end10; $l10++) {
            I = $l10;
            for (var $l11 = this.FSelection.StartCell.GetRow(), $end11 = this.FSelection.StopCell.GetRow(); $l11 <= $end11; $l11++) {
              J = $l11;
              if ((I !== this.GetFocusedCell().GetColumn()) && (J !== this.GetFocusedCell().GetRow()) && this.GetSelectedCell(I,J)) this.SetFocusCell(I,J);
            };
          };
        } finally {
          this.DecUpdateCount();
        };
      };
      f.$assign(this.GetFocusedCell());
      if (this.IsAnchorMode() && (this.FSaveCell.GetRow() >= 0) && (this.FSaveCell.GetColumn() >= 0)) this.SetFocusCell(this.FSaveCell.GetColumn(),this.FSaveCell.GetRow());
      this.Navigate(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(f),false,AIgnoreColumn,AIgnoreRow);
      SelectionChanged = !OldFocusCell.IsEqualTo(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(f)) || !OldStartCell.IsEqualTo(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FSelection.StartCell)) || !OldStopCell.IsEqualTo(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FSelection.StopCell));
      if (Allow && SelectionChanged && (this.FAdapter != null) && $mod.TTMSFNCDataGridRendererDataAdapter.isPrototypeOf(this.FAdapter)) {
        this.FBlockFocusedCell += 1;
        try {
          rtl.as(this.FAdapter,$mod.TTMSFNCDataGridRendererDataAdapter).SelectCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(f));
        } finally {
          this.FBlockFocusedCell -= 1;
        };
      };
      if (this.GetHasGrid(f.GetColumn(),f.GetRow())) {
        g = this.GetGrid(f.GetColumn(),f.GetRow());
        if (g != null) {
          g.Focus();
          g.FTabKey = this.FTabKey;
          g.HandleEnter();
        };
      };
      c = true;
      if ((this.FAdapter != null) && $mod.TTMSFNCDataGridRendererDataAdapter.isPrototypeOf(this.FAdapter)) c = rtl.as(this.FAdapter,$mod.TTMSFNCDataGridRendererDataAdapter).CanCallEvents();
      if (Allow && SelectionChanged && c) this.DoSelectCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FSelection.StartCell),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FSelection.StopCell),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.GetFocusedCell()));
    };
    this.SelectColumns = function (AFromColumn, AToColumn) {
      var NewStart = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var NewStop = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var SuggestedFocus = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var FinalFocus = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var i = 0;
      AFromColumn = Math.max(this.FFixedColumnCount,Math.min(AFromColumn,this.FColumnCount - 1 - this.FFixedRightColumnCount));
      AToColumn = Math.max(this.FFixedColumnCount,Math.min(AToColumn,this.FColumnCount - 1 - this.FFixedRightColumnCount));
      if (AToColumn < AFromColumn) this.SafeSwap({get: function () {
          return AFromColumn;
        }, set: function (v) {
          AFromColumn = v;
        }},{get: function () {
          return AToColumn;
        }, set: function (v) {
          AToColumn = v;
        }});
      NewStart.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AFromColumn,this.FFixedRowCount));
      NewStop.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AToColumn,this.FRowCount - 1 - this.FFixedBottomRowCount));
      if (this.IsAnchorMode() && this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FSaveCell))) {
        SuggestedFocus.$assign(this.FSaveCell)}
       else SuggestedFocus.$assign(NewStart);
      var $tmp = this.GetOptions().FSelection.FMode;
      if ($tmp === $mod.TTMSFNCDataGridSelectionMode.gsmSingleColumn) {
        NewStop.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AFromColumn,this.FRowCount - 1 - this.FFixedBottomRowCount));
      } else if ($tmp === $mod.TTMSFNCDataGridSelectionMode.gsmColumnRange) {}
      else if ($tmp === $mod.TTMSFNCDataGridSelectionMode.gsmDisjunctColumn) {}
      else {
        return;
      };
      if (!this.ApplySelectionRange(NewStart,NewStop,SuggestedFocus,FinalFocus)) return;
      if (this.GetOptions().FSelection.FMode === $mod.TTMSFNCDataGridSelectionMode.gsmDisjunctColumn) {
        this.IncUpdateCount();
        try {
          for (var $l = AFromColumn, $end = AToColumn; $l <= $end; $l++) {
            i = $l;
            this.SetSelectedColumn(i,true);
          };
        } finally {
          this.DecUpdateCount();
        };
      };
      this.Navigate(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(FinalFocus),false,false,false);
      this.DoSelectCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(NewStart),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(NewStop),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(FinalFocus));
    };
    this.SelectRows = function (AFromRow, AToRow) {
      var NewStart = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var NewStop = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var SuggestedFocus = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var FinalFocus = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var i = 0;
      AFromRow = Math.max(this.FFixedRowCount,Math.min(AFromRow,this.FRowCount - 1 - this.FFixedBottomRowCount));
      AToRow = Math.max(this.FFixedRowCount,Math.min(AToRow,this.FRowCount - 1 - this.FFixedBottomRowCount));
      if (AToRow < AFromRow) this.SafeSwap({get: function () {
          return AFromRow;
        }, set: function (v) {
          AFromRow = v;
        }},{get: function () {
          return AToRow;
        }, set: function (v) {
          AToRow = v;
        }});
      NewStart.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(this.FFixedColumnCount,AFromRow));
      NewStop.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(this.FColumnCount - 1 - this.FFixedRightColumnCount,AToRow));
      if (this.IsAnchorMode() && this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FSaveCell))) {
        SuggestedFocus.$assign(this.FSaveCell)}
       else SuggestedFocus.$assign(NewStart);
      var $tmp = this.GetOptions().FSelection.FMode;
      if ($tmp === $mod.TTMSFNCDataGridSelectionMode.gsmSingleRow) {
        NewStop.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(this.FColumnCount - 1 - this.FFixedRightColumnCount,AFromRow));
      } else if ($tmp === $mod.TTMSFNCDataGridSelectionMode.gsmRowRange) {}
      else if ($tmp === $mod.TTMSFNCDataGridSelectionMode.gsmDisjunctRow) {}
      else {
        return;
      };
      if (!this.ApplySelectionRange(NewStart,NewStop,SuggestedFocus,FinalFocus)) return;
      if (this.GetOptions().FSelection.FMode === $mod.TTMSFNCDataGridSelectionMode.gsmDisjunctRow) {
        this.IncUpdateCount();
        try {
          for (var $l = AFromRow, $end = AToRow; $l <= $end; $l++) {
            i = $l;
            this.SetSelectedRow(i,true);
          };
        } finally {
          this.DecUpdateCount();
        };
      };
      this.Navigate(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(FinalFocus),false,false,false);
      this.DoSelectCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(NewStart),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(NewStop),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(FinalFocus));
    };
    this.SelectCellRange = function (AFromCol, AFromRow, AToCol, AToRow) {
      var NewStart = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var NewStop = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var SuggestedFocus = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      var FinalFocus = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      AFromCol = Math.max(this.FFixedColumnCount,Math.min(AFromCol,this.FColumnCount - 1 - this.FFixedRightColumnCount));
      AToCol = Math.max(this.FFixedColumnCount,Math.min(AToCol,this.FColumnCount - 1 - this.FFixedRightColumnCount));
      AFromRow = Math.max(this.FFixedRowCount,Math.min(AFromRow,this.FRowCount - 1 - this.FFixedBottomRowCount));
      AToRow = Math.max(this.FFixedRowCount,Math.min(AToRow,this.FRowCount - 1 - this.FFixedBottomRowCount));
      if (AToCol < AFromCol) this.SafeSwap({get: function () {
          return AFromCol;
        }, set: function (v) {
          AFromCol = v;
        }},{get: function () {
          return AToCol;
        }, set: function (v) {
          AToCol = v;
        }});
      if (AToRow < AFromRow) this.SafeSwap({get: function () {
          return AFromRow;
        }, set: function (v) {
          AFromRow = v;
        }},{get: function () {
          return AToRow;
        }, set: function (v) {
          AToRow = v;
        }});
      NewStart.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AFromCol,AFromRow));
      NewStop.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AToCol,AToRow));
      if (this.IsAnchorMode() && this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FSaveCell))) {
        SuggestedFocus.$assign(this.FSaveCell)}
       else SuggestedFocus.$assign(NewStart);
      var $tmp = this.GetOptions().FSelection.FMode;
      if ($tmp === $mod.TTMSFNCDataGridSelectionMode.gsmSingleRow) {
        NewStart.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(this.FFixedColumnCount,AFromRow));
        NewStop.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(this.FColumnCount - 1 - this.FFixedRightColumnCount,AFromRow));
        if (!this.IsAnchorMode()) SuggestedFocus.$assign(NewStart);
      } else if ($tmp === $mod.TTMSFNCDataGridSelectionMode.gsmRowRange) {
        NewStart.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(this.FFixedColumnCount,AFromRow));
        NewStop.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(this.FColumnCount - 1 - this.FFixedRightColumnCount,AToRow));
        if (!this.IsAnchorMode()) SuggestedFocus.$assign(NewStart);
      } else if ($tmp === $mod.TTMSFNCDataGridSelectionMode.gsmSingleColumn) {
        NewStart.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AFromCol,this.FFixedRowCount));
        NewStop.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AFromCol,this.FRowCount - 1 - this.FFixedBottomRowCount));
        if (!this.IsAnchorMode()) SuggestedFocus.$assign(NewStart);
      } else if ($tmp === $mod.TTMSFNCDataGridSelectionMode.gsmColumnRange) {
        NewStart.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AFromCol,this.FFixedRowCount));
        NewStop.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(AToCol,this.FRowCount - 1 - this.FFixedBottomRowCount));
        if (!this.IsAnchorMode()) SuggestedFocus.$assign(NewStart);
      };
      if (!this.ApplySelectionRange(NewStart,NewStop,SuggestedFocus,FinalFocus)) return;
      this.Navigate(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(FinalFocus),false,false,false);
      this.DoSelectCell(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(NewStart),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(NewStop),pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(FinalFocus));
    };
    this.SetBitmap = function (ACell, ABitmap) {
      this.SetBitmap$2(ACell.GetColumn(),ACell.GetRow(),ABitmap);
    };
    this.SetBitmap$1 = function (ACell, AName) {
      this.SetBitmap$3(ACell.GetColumn(),ACell.GetRow(),AName);
    };
    this.SetBitmap$2 = function (AColumn, ARow, ABitmap) {
      var cd = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      this.BeginUpdate();
      try {
        cd = this.GetCellDataExtended(AColumn,ARow);
        if (cd != null) {
          cd.FType = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitBitmap;
          cd.GetBitmap().Assign(ABitmap);
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.SetBitmap$3 = function (AColumn, ARow, AName) {
      var cd = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      this.BeginUpdate();
      try {
        cd = this.GetCellDataExtended(AColumn,ARow);
        if (cd != null) {
          cd.FType = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitBitmap;
          cd.FBitmapName = AName;
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.SetBitmapColumn = function (AColumn, ABitmap) {
      var I = 0;
      this.BeginUpdate();
      try {
        for (var $l = this.FFixedRowCount, $end = this.FRowCount - 1 - this.FFixedBottomRowCount; $l <= $end; $l++) {
          I = $l;
          this.SetBitmap$2(AColumn,I,ABitmap);
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.SetBitmapColumn$1 = function (AColumn, AName) {
      var I = 0;
      this.BeginUpdate();
      try {
        for (var $l = this.FFixedRowCount, $end = this.FRowCount - 1 - this.FFixedBottomRowCount; $l <= $end; $l++) {
          I = $l;
          this.SetBitmap$3(AColumn,I,AName);
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.SetButton = function (ACell, AText) {
      this.SetButton$1(ACell.GetColumn(),ACell.GetRow(),AText);
    };
    this.SetButton$1 = function (AColumn, ARow, AText) {
      var cd = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      this.BeginUpdate();
      try {
        cd = this.GetCellDataExtended(AColumn,ARow);
        if (cd != null) {
          cd.FType = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitButton;
          cd.FControlText = AText;
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.SetButtonColumn = function (AColumn, AText) {
      var I = 0;
      this.BeginUpdate();
      try {
        for (var $l = this.FFixedRowCount, $end = this.FRowCount - 1 - this.FFixedBottomRowCount; $l <= $end; $l++) {
          I = $l;
          this.SetButton$1(AColumn,I,AText);
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.SetCheckBox = function (ACell, AValue) {
      this.SetCheckBox$1(ACell.GetColumn(),ACell.GetRow(),AValue);
    };
    this.SetCheckBox$1 = function (AColumn, ARow, AValue) {
      var cd = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      this.BeginUpdate();
      try {
        cd = this.GetCellDataExtended(AColumn,ARow);
        if (cd != null) {
          cd.FType = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitCheckBox;
          cd.FBooleanValue = AValue;
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.SetCheckBoxColumn = function (AColumn, AValue) {
      var I = 0;
      this.BeginUpdate();
      try {
        for (var $l = this.FFixedRowCount, $end = this.FRowCount - 1 - this.FFixedBottomRowCount; $l <= $end; $l++) {
          I = $l;
          this.SetCheckBox$1(AColumn,I,AValue);
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.SetDataCheckBox = function (ACell) {
      this.SetDataCheckBox$1(ACell.GetColumn(),ACell.GetRow());
    };
    this.SetDataCheckBox$1 = function (AColumn, ARow) {
      var cd = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      this.BeginUpdate();
      try {
        cd = this.GetCellDataExtended(AColumn,ARow);
        if (cd != null) cd.FType = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitDataCheckBox;
      } finally {
        this.EndUpdate();
      };
    };
    this.SetDataCheckBoxColumn = function (AColumn) {
      var I = 0;
      this.BeginUpdate();
      try {
        for (var $l = this.FFixedRowCount, $end = this.FRowCount - 1 - this.FFixedBottomRowCount; $l <= $end; $l++) {
          I = $l;
          this.SetDataCheckBox$1(AColumn,I);
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.SetDataProgressBar = function (ACell) {
      this.SetDataProgressBar$1(ACell.GetColumn(),ACell.GetRow());
    };
    this.SetDataProgressBar$1 = function (AColumn, ARow) {
      var cd = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      this.BeginUpdate();
      try {
        cd = this.GetCellDataExtended(AColumn,ARow);
        if (cd != null) cd.FType = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitDataProgressBar;
      } finally {
        this.EndUpdate();
      };
    };
    this.SetDataProgressBarColumn = function (AColumn) {
      var I = 0;
      this.BeginUpdate();
      try {
        for (var $l = this.FFixedRowCount, $end = this.FRowCount - 1 - this.FFixedBottomRowCount; $l <= $end; $l++) {
          I = $l;
          this.SetDataProgressBar$1(AColumn,I);
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.SetDataRadioButton = function (ACell, AValue, AGroupIndex) {
      this.SetDataRadioButton$1(ACell.GetColumn(),ACell.GetRow(),AValue,AGroupIndex);
    };
    this.SetDataRadioButton$1 = function (AColumn, ARow, AValue, AGroupIndex) {
      var cd = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      this.BeginUpdate();
      try {
        cd = this.GetCellDataExtended(AColumn,ARow);
        if (cd != null) {
          cd.FType = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitDataRadioButton;
          cd.FRadioGroupIndex = AGroupIndex;
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.SetDataRadioButtonColumn = function (AColumn, AValue, AGroupIndex) {
      var I = 0;
      this.BeginUpdate();
      try {
        for (var $l = this.FFixedRowCount, $end = this.FRowCount - 1 - this.FFixedBottomRowCount; $l <= $end; $l++) {
          I = $l;
          this.SetDataRadioButton$1(AColumn,I,AValue,AGroupIndex);
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.SetLocalRect = function (ARect) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.$assign(this.LocalRect());
      pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCore.SetLocalRect.apply(this,arguments);
      this.FLocalRectChanged = !pas["WEBLib.TMSFNCTypes"].EqualRectEx(r,this.LocalRect());
    };
    this.SetProgressBar = function (ACell, AValue) {
      this.SetProgressBar$1(ACell.GetColumn(),ACell.GetRow(),AValue);
    };
    this.SetProgressBar$1 = function (AColumn, ARow, AValue) {
      var cd = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      this.BeginUpdate();
      try {
        cd = this.GetCellDataExtended(AColumn,ARow);
        if (cd != null) {
          cd.FType = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitProgressBar;
          cd.FIntegerValue = AValue;
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.SetProgressBarColumn = function (AColumn, AValue) {
      var I = 0;
      this.BeginUpdate();
      try {
        for (var $l = this.FFixedRowCount, $end = this.FRowCount - 1 - this.FFixedBottomRowCount; $l <= $end; $l++) {
          I = $l;
          this.SetProgressBar$1(AColumn,I,AValue);
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.SetRadioButton = function (ACell, AValue, AGroupIndex) {
      this.SetRadioButton$1(ACell.GetColumn(),ACell.GetRow(),AValue,AGroupIndex);
    };
    this.SetRadioButton$1 = function (AColumn, ARow, AValue, AGroupIndex) {
      var cd = null;
      if (!this.IsCellValid$1(AColumn,ARow)) return;
      this.BeginUpdate();
      try {
        cd = this.GetCellDataExtended(AColumn,ARow);
        if (cd != null) {
          cd.FType = pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemType.gcitRadioButton;
          cd.FBooleanValue = AValue;
          cd.FRadioGroupIndex = AGroupIndex;
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.SetRadioButtonColumn = function (AColumn, AValue, AGroupIndex) {
      var I = 0;
      this.BeginUpdate();
      try {
        for (var $l = this.FFixedRowCount, $end = this.FRowCount - 1 - this.FFixedBottomRowCount; $l <= $end; $l++) {
          I = $l;
          this.SetRadioButton$1(AColumn,I,AValue,AGroupIndex);
        };
      } finally {
        this.EndUpdate();
      };
    };
    this.ShowColumnsEditor = function () {
      var o = null;
      o = this.GetColumnsEditor();
      if ((o != null) && pas["WEBLib.TMSFNCDataGridColumnsEditor"].TTMSFNCDataGridColumnsEditor.isPrototypeOf(o)) rtl.as(o,pas["WEBLib.TMSFNCDataGridColumnsEditor"].TTMSFNCDataGridColumnsEditor).Execute(null,false);
    };
    this.ShowFilterDialog = function () {
      var a = false;
      var f = null;
      if (!this.GetOptions().FFiltering.FAdvanced) throw pas.SysUtils.Exception.$create("Create$1",[rtl.getResStr($mod,"sTMSFNCDataGridAdvancedFilteringError")]);
      a = true;
      f = this.GetFilterDialog();
      if (f != null) {
        this.DoBeforeShowFilterDialog(f,{get: function () {
            return a;
          }, set: function (v) {
            a = v;
          }});
        if (a) {
          this.UpdateFilterBuilderColumns();
          f.Execute(null,false);
        };
      };
    };
    this.ShowFindDialog = function () {
      var a = false;
      var f = null;
      a = true;
      f = this.GetFindDialog();
      if (f != null) {
        this.DoBeforeShowFindDialog(f,{get: function () {
            return a;
          }, set: function (v) {
            a = v;
          }});
        if (a) {
          f.Execute(null,true);
          this.DoAfterShowFindDialog(f);
        };
      };
    };
    this.ShowReplaceDialog = function () {
      var a = false;
      var r = null;
      a = true;
      r = this.GetReplaceDialog();
      if (r != null) {
        this.DoBeforeShowReplaceDialog(r,{get: function () {
            return a;
          }, set: function (v) {
            a = v;
          }});
        if (a) {
          r.Execute(null,true);
          this.DoAfterShowReplaceDialog(r);
        };
      };
    };
    this.StartDragging = function (AMouseInfo, ACanStartDrag) {
      var Allow = false;
      Allow = this.GetOptions().FMouse.FColumnDragging;
      if (Allow) this.DoCanDragColumn(this.FDragCell.GetColumn(),{get: function () {
          return Allow;
        }, set: function (v) {
          Allow = v;
        }});
      if (((this.FDragCell.GetRow() < this.FFixedRowCount) || (this.FDragCell.GetRow() > (this.FRowCount - 1 - this.FFixedBottomRowCount))) && Allow) {
        if (!($mod.TTMSFNCDataGridColumnDragMode.gcdmReorder in this.GetOptions().FMouse.FColumnDragModes)) return;
        this.FDraggingMode = $mod.TTMSFNCDataGridDraggingMode.gdmColumnDragging;
        this.UpdateCursor(10);
        this.FDragCellTo.$assign(this.XYToCell(AMouseInfo.X,AMouseInfo.Y,false));
        if (this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FDragCellTo))) {
          this.FDragCellTo.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(this.FDragCellTo.GetColumn(),0))}
         else this.FDragCellTo.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(-1,-1));
        this.HandleDragBitmapStart(pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseInfo.$clone(AMouseInfo));
        this.Display();
        if (ACanStartDrag) this.BeginDrag();
      } else {
        Allow = this.GetOptions().FMouse.FRowDragging;
        if (Allow) this.DoCanDragRow(this.FDragCell.GetRow(),{get: function () {
            return Allow;
          }, set: function (v) {
            Allow = v;
          }});
        if (((this.FDragCell.GetColumn() < this.FFixedColumnCount) || (this.FDragCell.GetColumn() > (this.FColumnCount - 1 - this.FFixedRightColumnCount))) && Allow) {
          this.FDraggingMode = $mod.TTMSFNCDataGridDraggingMode.gdmRowDragging;
          this.UpdateCursor(10);
          this.FDragCellTo.$assign(this.XYToCell(AMouseInfo.X,AMouseInfo.Y,false));
          if (this.IsCellValid(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.FDragCellTo))) {
            this.FDragCellTo.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(0,this.FDragCellTo.GetRow()))}
           else this.FDragCellTo.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(-1,-1));
          this.HandleDragBitmapStart(pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridMouseInfo.$clone(AMouseInfo));
          this.Display();
          if (ACanStartDrag) this.BeginDrag();
        };
      };
    };
    this.UnhilightCells = function (AOptions) {
      var $tmp = AOptions.Mode;
      if ($tmp === $mod.TTMSFNCDataGridHilightMode.ghmCell) {
        this.InternalUnmarkCells("hi",AOptions.Column,AOptions.Row,AOptions.Column,AOptions.Row)}
       else if ($tmp === $mod.TTMSFNCDataGridHilightMode.ghmColumn) {
        if (AOptions.IncludeFixed) {
          this.InternalUnmarkCells("hi",AOptions.Column,0,AOptions.Column,this.FRowCount - 1)}
         else this.InternalUnmarkCells("hi",AOptions.Column,this.FFixedRowCount,AOptions.Column,this.FRowCount - 1 - this.FFixedBottomRowCount);
      } else if ($tmp === $mod.TTMSFNCDataGridHilightMode.ghmRow) {
        if (AOptions.IncludeFixed) {
          this.InternalUnmarkCells("hi",0,AOptions.Row,this.FColumnCount - 1,AOptions.Row)}
         else this.InternalUnmarkCells("hi",this.FFixedColumnCount,AOptions.Row,this.FColumnCount - 1 - this.FFixedRightColumnCount,AOptions.Row);
      } else if ($tmp === $mod.TTMSFNCDataGridHilightMode.ghmGrid) {
        if (AOptions.IncludeFixed) {
          this.InternalUnmarkCells("hi",0,0,this.FColumnCount - 1,this.FRowCount - 1)}
         else this.InternalUnmarkCells("hi",this.FFixedColumnCount,this.FFixedRowCount,this.FColumnCount - 1 - this.FFixedRightColumnCount,this.FRowCount - 1 - this.FFixedBottomRowCount);
      };
    };
    this.UnmarkCells = function (AOptions) {
      var $tmp = AOptions.Mode;
      if ($tmp === $mod.TTMSFNCDataGridHilightMode.ghmCell) {
        this.InternalUnmarkCells("e",AOptions.Column,AOptions.Row,AOptions.Column,AOptions.Row)}
       else if ($tmp === $mod.TTMSFNCDataGridHilightMode.ghmColumn) {
        if (AOptions.IncludeFixed) {
          this.InternalUnmarkCells("e",AOptions.Column,0,AOptions.Column,this.FRowCount - 1)}
         else this.InternalUnmarkCells("e",AOptions.Column,this.FFixedRowCount,AOptions.Column,this.FRowCount - 1 - this.FFixedBottomRowCount);
      } else if ($tmp === $mod.TTMSFNCDataGridHilightMode.ghmRow) {
        if (AOptions.IncludeFixed) {
          this.InternalUnmarkCells("e",0,AOptions.Row,this.FColumnCount - 1,AOptions.Row)}
         else this.InternalUnmarkCells("e",this.FFixedColumnCount,AOptions.Row,this.FColumnCount - 1 - this.FFixedRightColumnCount,AOptions.Row);
      } else if ($tmp === $mod.TTMSFNCDataGridHilightMode.ghmGrid) {
        if (AOptions.IncludeFixed) {
          this.InternalUnmarkCells("e",0,0,this.FColumnCount - 1,this.FRowCount - 1)}
         else this.InternalUnmarkCells("e",this.FFixedColumnCount,this.FFixedRowCount,this.FColumnCount - 1 - this.FFixedRightColumnCount,this.FRowCount - 1 - this.FFixedBottomRowCount);
      };
    };
    this.Update = function () {
      if (this.FOnBeforeCalculate != null) this.FOnBeforeCalculate(this);
      this.UpdateScrollBars(true,true);
      pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCore.Update.call(this);
      this.UpdateVisualRange();
      this.UpdateBounds();
      this.Calculate();
      if (this.FOnAfterCalculate != null) this.FOnAfterCalculate(this);
    };
    this.UpdateBounds = function () {
      if ((this.GetUpdateCount() > 0) || this.GetIsDestroying()) return;
      if (this.FLocalRectChanged && !this.IsBlocked()) {
        if ((this.FAdapter != null) && $mod.TTMSFNCDataGridRendererDataAdapter.isPrototypeOf(this.FAdapter)) rtl.as(this.FAdapter,$mod.TTMSFNCDataGridRendererDataAdapter).UpdateBounds();
        this.FLocalRectChanged = false;
      };
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
    rtl.addIntf(this,pas["WEBLib.TMSFNCGraphicsTypes"].ITMSFNCAppearanceGlobalFont);
    rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
    rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
    rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderGrid,{ClearData: "DataClearData"});
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCCustomReadWriteIO);
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("AdaptToStyle",3,rtl.boolean,"GetAdaptToStyle","SetAdaptToStyle",4,{Default: false});
    $r.addProperty("CellAppearance",2,$mod.$rtti["TTMSFNCDataGridCellAppearance"],"FCellAppearance","SetCellAppearance");
    $r.addProperty("Columns",2,$mod.$rtti["TTMSFNCDataGridColumns"],"FColumns","SetColumns");
    $r.addProperty("CustomScrollBars",2,rtl.boolean,"FCustomScrollBars","SetCustomScrollBars",4,{Default: false});
    $r.addProperty("DragAppearance",2,$mod.$rtti["TTMSFNCDataGridDragAppearance"],"FDragAppearance","SetDragAppearance");
    $r.addProperty("AutoFillAppearance",2,$mod.$rtti["TTMSFNCDataGridAutoFillAppearance"],"FAutoFillAppearance","SetAutoFillAppearance");
    $r.addProperty("FilterAppearance",2,$mod.$rtti["TTMSFNCDataGridFilterAppearance"],"FFilterAppearance","SetFilterAppearance");
    $r.addProperty("GlobalFont",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCAppearanceGlobalFont"],"FGlobalFont","SetGlobalFont");
    $r.addProperty("HorizontalScrollBarVisible",2,rtl.boolean,"FHorizontalScrollBarVisible","SetHorizontalScrollBarVisible",4,{Default: true});
    $r.addProperty("Icons",2,$mod.$rtti["TTMSFNCDataGridIcons"],"FIcons","SetIcons");
    $r.addProperty("Options",3,$mod.$rtti["TTMSFNCDataGridOptions"],"GetOptions","SetOptions$1");
    $r.addProperty("Padding",2,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCMargins"],"FPadding","SetPadding");
    $r.addProperty("Paging",2,rtl.boolean,"FPaging","SetPaging",4,{Default: false});
    $r.addProperty("ScrollMode",2,$mod.$rtti["TTMSFNCDataGridScrollMode"],"FScrollMode","SetScrollMode",4,{Default: $mod.TTMSFNCDataGridScrollMode.gsmPixelScrolling});
    $r.addProperty("ScrollUpdate",2,$mod.$rtti["TTMSFNCDataGridScrollUpdate"],"FScrollUpdate","SetScrollUpdate",4,{Default: $mod.TTMSFNCDataGridScrollUpdate.gsuContinuous});
    $r.addProperty("StretchScrollBars",2,rtl.boolean,"FStretchScrollBars","SetStretchScrollBars",4,{Default: false});
    $r.addProperty("Stroke",0,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","");
    $r.addProperty("VerticalScrollBarVisible",2,rtl.boolean,"FVerticalScrollBarVisible","SetVerticalScrollBarVisible",4,{Default: true});
  });
  this.$rtti.$ClassRef("TTMSFNCDataGridRendererClass",{instancetype: this.$rtti["TTMSFNCDataGridRenderer"]});
  rtl.createClass(this,"TTMSFNCDataGridRendererCell",pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCell,function () {
    this.$init = function () {
      pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCell.$init.call(this);
      this.FRenderRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FExportRenderer = null;
    };
    this.$final = function () {
      this.FRenderRect = undefined;
      this.FExportRenderer = undefined;
      pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCell.$final.call(this);
    };
    this.GetRenderer = function () {
      var Result = null;
      Result = null;
      if ((this.FData != null) && pas["WEBLib.TMSFNCDataGridCell"].IsExtendedCell(this.FData) && (pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(this.FData).FRenderer != null)) Result = rtl.as(pas["WEBLib.TMSFNCDataGridCell"].AsExtendedCell(this.FData).FRenderer,$mod.TTMSFNCDataGridRenderer);
      return Result;
    };
    this.GetDrawElements = function (AIsEditing) {
      var Result = {};
      Result = rtl.createSet(pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellDrawElement.gcdControl);
      return Result;
    };
    this.GetRendererRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rct = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var res = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.$assign(this.FRect);
      res.$assign(r);
      if (this.IsControlAssigned()) {
        rct.$assign(this.GetControlRectInternal(true));
        var $tmp = this.FControlAlign;
        if ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellControlAlign.gcaTop) {
          res.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,rct.Bottom,r.Right,r.Bottom))}
         else if ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellControlAlign.gcaBottom) {
          res.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top,r.Right,rct.Top))}
         else if ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellControlAlign.gcaLeft) {
          res.$assign(pas["WEBLib.TMSFNCTypes"].RectF(rct.Right,r.Top,r.Right,r.Bottom))}
         else if ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellControlAlign.gcaRight) {
          res.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top,rct.Left,r.Bottom))}
         else if ($tmp === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellControlAlign.gcaNone) {
          var $tmp1 = this.FControlPosition;
          if (($tmp1 === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellControlPosition.gcpTopLeft) || ($tmp1 === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellControlPosition.gcpTopCenter) || ($tmp1 === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellControlPosition.gcpTopRight)) {
            res.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,rct.Bottom,r.Right,r.Bottom))}
           else if ($tmp1 === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellControlPosition.gcpCenterLeft) {
            res.$assign(pas["WEBLib.TMSFNCTypes"].RectF(rct.Right,r.Top,r.Right,r.Bottom))}
           else if ($tmp1 === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellControlPosition.gcpCenterRight) {
            res.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top,rct.Left,r.Bottom))}
           else if (($tmp1 === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellControlPosition.gcpBottomLeft) || ($tmp1 === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellControlPosition.gcpBottomCenter) || ($tmp1 === pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellControlPosition.gcpBottomRight)) res.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top,r.Right,rct.Top));
        };
      };
      Result.$assign(res);
      return Result;
    };
    this.GetRequiredSize = function (AGraphics) {
      var Result = pas["WEBLib.TMSFNCTypes"].TSizeF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (this.GetRenderer() != null) {
        r.$assign(this.GetRenderer().LocalRect());
        Result.cx = r.Right - r.Left;
        Result.cy = r.Bottom - r.Top;
      } else {
        Result.cx = 0;
        Result.cy = 0;
      };
      return Result;
    };
    this.ApplyScale = function (AScale) {
      pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCell.ApplyScale.apply(this,arguments);
      if (this.FExportRenderer != null) this.FExportRenderer.ApplyExportScale(AScale);
    };
    this.Create$1 = function (ARect, AColumn, ARow, AData, AKind, ARoot) {
      pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCell.Create$1.apply(this,arguments);
      this.FRenderRect.$assign(pas["WEBLib.TMSFNCTypes"].EmptyRect());
      return this;
    };
    this.Destroy = function () {
      var r = null;
      var d = null;
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FExportRenderer;
        }, set: function (v) {
          this.p.FExportRenderer = v;
        }});
      r = this.GetRenderer();
      if (r != null) {
        if (r.FHost != null) {
          if (r.GetVerticalScrollBar() != null) r.GetVerticalScrollBar().SetVisible(false);
          if (r.GetHorizontalScrollBar() != null) r.GetHorizontalScrollBar().SetVisible(false);
          if (r.GetCustomVerticalScrollBar() != null) r.GetCustomVerticalScrollBar().SetVisible(false);
          if (r.GetCustomHorizontalScrollBar() != null) r.GetCustomHorizontalScrollBar().SetVisible(false);
        };
        d = r.FOnDisplay;
        r.FOnDisplay = null;
        r.Update();
        r.FOnDisplay = d;
      };
      pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCell.Destroy.call(this);
    };
    this.AfterExport = function () {
      pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCell.AfterExport.call(this);
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FExportRenderer;
        }, set: function (v) {
          this.p.FExportRenderer = v;
        }});
    };
    this.BeforeExport = function () {
      var r = null;
      pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCell.BeforeExport.call(this);
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FExportRenderer;
        }, set: function (v) {
          this.p.FExportRenderer = v;
        }});
      r = this.GetRenderer();
      if (r != null) {
        this.FExportRenderer = $mod.TTMSFNCDataGridRenderer.$create("Create$3",[r.FHost]);
        this.FExportRenderer.Assign(r);
      };
    };
    this.DrawContent = function (AGraphics) {
      var $Self = this;
      var r = null;
      var d = null;
      var rd = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      function FixRect() {
        rd.$assign(pas["WEBLib.TMSFNCTypes"].RectF(rd.Left - 0.5,rd.Top - 0.5,rd.Right + 0.5,rd.Bottom + 0.5));
      };
      pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCell.DrawContent.apply(this,arguments);
      if (this.FIsExporting) {
        r = this.FExportRenderer}
       else r = this.GetRenderer();
      if (r != null) {
        d = r.FOnDisplay;
        r.FOnDisplay = null;
        if (this.FIsExporting) r.BeforeExport();
        try {
          rd.$assign(this.GetRendererRect());
          if (pas["WEBLib.TMSFNCTypes"].RectIsEmpty(this.FRenderRect) || (rd.Left !== this.FRenderRect.Left) || (rd.Top !== this.FRenderRect.Top) || (rd.Bottom !== this.FRenderRect.Bottom) || (rd.Right !== this.FRenderRect.Right)) {
            r.BeginUpdate();
            this.FRenderRect.$assign(rd);
            FixRect();
            r.SetLocalRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(rd));
            r.SetClipRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.FClipRect));
            r.EndUpdate();
          } else FixRect();
          r.Draw(AGraphics);
        } finally {
          r.FOnDisplay = d;
          if (this.FIsExporting) r.AfterExport();
        };
      };
    };
  });
  this.DefaultHilightOptions = function () {
    var Result = $mod.TTMSFNCDataGridHilightOptions.$new();
    Result.IncludeFixed = false;
    Result.CaseSensitive = false;
    Result.FullText = false;
    Result.Mode = $mod.TTMSFNCDataGridHilightMode.ghmGrid;
    Result.Column = -1;
    Result.Row = -1;
    return Result;
  };
  this.DefaultMarkOptions = function () {
    var Result = $mod.TTMSFNCDataGridHilightOptions.$new();
    Result.$assign($mod.DefaultHilightOptions());
    return Result;
  };
  $mod.$resourcestrings = {sTMSFNCDataGridAdvancedFilteringError: {org: "To use the advanced filter dialog, please enable Options.Filtering.Advanced"}, sTMSFNCDataGridCreateDirectoryError: {org: "Cannot create %simages"}, sTMSFNCDataGridNotAvailableError: {org: "Grid not available, please call SetGrid/AddGrid first."}, sTMSFNCDataGridFilterAllText: {org: "(All)"}, sTMSFNCDataGridFilterEmptyText: {org: "(Empty)"}, sTMSFNCDataGridFilterNotEmptyText: {org: "(Not Empty)"}, sTMSFNCDataGridFilterClearButtonHint: {org: "Clear Filter"}, sTMSFNCDataGridFilterEditPrompt: {org: "Filter"}, sTMSFNCDataGridFilterSortButtonAscendingHint: {org: "Sort Ascending"}, sTMSFNCDataGridFilterSortButtonAscendingText: {org: "Sort Ascending"}, sTMSFNCDataGridFilterSortButtonDescendingHint: {org: "Sort Descending"}, sTMSFNCDataGridFilterSortButtonDescendingText: {org: "Sort Descending"}, sTMSFNCDataGridFilterTypeButtonHint: {org: "Filter Type"}, sTMSFNCDataGridFilterTypeContainsText: {org: "Contains"}, sTMSFNCDataGridFilterTypeEmptyText: {org: "Empty"}, sTMSFNCDataGridFilterTypeEndsWithText: {org: "Ends with"}, sTMSFNCDataGridFilterTypeEqualText: {org: "Equals"}, sTMSFNCDataGridFilterTypeLargerOrEqualThanText: {org: "Larger than or equal to"}, sTMSFNCDataGridFilterTypeLargerThanText: {org: "Larger than"}, sTMSFNCDataGridFilterTypeNotContainsText: {org: "Does not contain"}, sTMSFNCDataGridFilterTypeNotEmptyText: {org: "Not Empty"}, sTMSFNCDataGridFilterTypeNotEqualText: {org: "Does not equal"}, sTMSFNCDataGridFilterTypeSmallerOrEqualThanText: {org: "Smaller than or equal to"}, sTMSFNCDataGridFilterTypeSmallerThanText: {org: "Smaller than"}, sTMSFNCDataGridFilterTypeStartsWithText: {org: "Starts with"}};
  $mod.$implcode = function () {
    $impl.TTMSFNCDATAGRIDFIRSTPAGE = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMyIDMyIiBoZWlnaHQ9IjMyc" + "HgiIGlkPSLQodC70L7QuV8xIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCAzMiAzMiIgd2lkdGg9IjMycHgiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxnIGlkPSJEb3VibGVfQ2hldnJvbl9MZWZ0" + "Ij48cGF0aCBkPSJNMTAuNDU2LDE2bDYuMTk2LTYuMjg1YzAuMzkxLTAuMzk0LDAuMzkxLTEuMDM0LDAtMS40MjhjLTAuMzkxLTAuMzk0LTEuMDI0LTAuMzk0LTEuNDE0LDBsLTYuODk5LDYuOTk5ICAgYy0wLjM3NSwwLjM3OS0wLjM3NywxLjA0OCwwLDEuNDI5bDYuOSw2Ljk5OWMwLjM5LDAuMzk0LDEuMDI0LDAuMzk0LDEuNDE0LDBjMC4" + "zOTEtMC4zOTQsMC4zOTEtMS4wMzQsMC0xLjQyOEwxMC40NTYsMTZ6IiBmaWxsPSIjMTIxMzEzIi8+PHBhdGggZD0iTTE3LjQ1NiwxNmw2LjE5Ni02LjI4NWMwLjM5MS0wLjM5NCwwLjM5MS0xLjAzNCwwLTEuNDI4Yy0wLjM5MS0wLjM5NC0xLjAyNC0wLjM5NC0xLjQxNCwwbC02Ljg5OSw2Ljk5OSAgIGMtMC4zNzUsMC4zNzktMC4zNzcsMS" + "4wNDgsMCwxLjQyOWw2Ljg5OSw2Ljk5OWMwLjM5MSwwLjM5NCwxLjAyNCwwLjM5NCwxLjQxNCwwYzAuMzkxLTAuMzk0LDAuMzkxLTEuMDM0LDAtMS40MjhMMTcuNDU2LDE2eiIgZmlsbD0iIzEyMTMxMyIvPjwvZz48Zy8+PGcvPjxnLz48Zy8+PGcvPjxnLz48L3N2Zz4";
    $impl.TTMSFNCDATAGRIDLASTPAGE = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMyIDMyIiBoZWlnaHQ9IjMyc" + "HgiIGlkPSLQodC70L7QuV8xIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCAzMiAzMiIgd2lkdGg9IjMycHgiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxnIGlkPSJEb3VibGVfQ2hldnJvbl9SaWdo" + "dCI+PHBhdGggZD0iTTIzLjY2MiwxNS4yODZsLTYuOS02Ljk5OWMtMC4zOS0wLjM5NC0xLjAyNC0wLjM5NC0xLjQxNCwwYy0wLjM5MSwwLjM5NC0wLjM5MSwxLjAzNCwwLDEuNDI4TDIxLjU0NCwxNiAgIGwtNi4xOTYsNi4yODVjLTAuMzkxLDAuMzk0LTAuMzkxLDEuMDM0LDAsMS40MjhjMC4zOTEsMC4zOTQsMS4wMjQsMC4zOTQsMS40MTQ" + "sMGw2Ljg5OS02Ljk5OSAgIEMyNC4wMzgsMTYuMzM1LDI0LjAzOSwxNS42NjYsMjMuNjYyLDE1LjI4NnoiIGZpbGw9IiMxMjEzMTMiLz48cGF0aCBkPSJNMTYuNjYyLDE1LjI4Nkw5Ljc2Myw4LjI4N2MtMC4zOTEtMC4zOTQtMS4wMjQtMC4zOTQtMS40MTQsMGMtMC4zOTEsMC4zOTQtMC4zOTEsMS4wMzQsMCwxLjQyOEwxNC41NDQsMTYgIC" + "BsLTYuMTk2LDYuMjg1Yy0wLjM5MSwwLjM5NC0wLjM5MSwxLjAzNCwwLDEuNDI4YzAuMzkxLDAuMzk0LDEuMDI0LDAuMzk0LDEuNDE0LDBsNi44OTktNi45OTkgICBDMTcuMDM4LDE2LjMzNSwxNy4wMzksMTUuNjY2LDE2LjY2MiwxNS4yODZ6IiBmaWxsPSIjMTIxMzEzIi8+PC9nPjxnLz48Zy8+PGcvPjxnLz48Zy8+PGcvPjwvc3ZnPg";
    $impl.TTMSFNCDATAGRIDNEXTPAGE = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMyIDMyIiBoZWlnaHQ9IjMyc" + "HgiIGlkPSLQodC70L7QuV8xIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCAzMiAzMiIgd2lkdGg9IjMycHgiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxwYXRoIGNsaXAtcnVsZT0iZXZlbm9kZCIg" + "ZD0iTTIxLjY5OCwxNS4yODZsLTkuMDAyLTguOTk5ICBjLTAuMzk1LTAuMzk0LTEuMDM1LTAuMzk0LTEuNDMxLDBjLTAuMzk1LDAuMzk0LTAuMzk1LDEuMDM0LDAsMS40MjhMMTkuNTUzLDE2bC04LjI4Nyw4LjI4NWMtMC4zOTUsMC4zOTQtMC4zOTUsMS4wMzQsMCwxLjQyOSAgYzAuMzk1LDAuMzk0LDEuMDM2LDAuMzk0LDEuNDMxLDBsOS4" + "wMDItOC45OTlDMjIuMDg4LDE2LjMyNSwyMi4wODgsMTUuNjc1LDIxLjY5OCwxNS4yODZ6IiBmaWxsPSIjMTIxMzEzIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGlkPSJDaGV2cm9uX1JpZ2h0Ii8+PGcvPjxnLz48Zy8+PGcvPjxnLz48Zy8+PC9zdmc+";
    $impl.TTMSFNCDATAGRIDPREVIOUSPAGE = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMyIDMyIiBoZWlnaHQ9IjMyc" + "HgiIGlkPSLQodC70L7QuV8xIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCAzMiAzMiIgd2lkdGg9IjMycHgiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxwYXRoIGNsaXAtcnVsZT0iZXZlbm9kZCIg" + "ZD0iTTExLjI2MiwxNi43MTRsOS4wMDIsOC45OTkgIGMwLjM5NSwwLjM5NCwxLjAzNSwwLjM5NCwxLjQzMSwwYzAuMzk1LTAuMzk0LDAuMzk1LTEuMDM0LDAtMS40MjhMMTMuNDA3LDE2bDguMjg3LTguMjg1YzAuMzk1LTAuMzk0LDAuMzk1LTEuMDM0LDAtMS40MjkgIGMtMC4zOTUtMC4zOTQtMS4wMzYtMC4zOTQtMS40MzEsMGwtOS4wMDI" + "sOC45OTlDMTAuODcyLDE1LjY3NSwxMC44NzIsMTYuMzI1LDExLjI2MiwxNi43MTR6IiBmaWxsPSIjMTIxMzEzIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGlkPSJDaGV2cm9uX1JpZ2h0Ii8+PGcvPjxnLz48Zy8+PGcvPjxnLz48Zy8+PC9zdmc+";
    $impl.TTMSFNCDATAGRIDCLOSE = "data:image/svg+xml;base64,PCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KDTwhLS0gVXBsb2FkZWQgdG86IFNWRyBSZXBvLCB3d3cuc3ZncmVwby5jb20sIFRyYW5zZm9ybWVkIGJ5OiBTVkcgUmVwbyBNa" + "XhlciBUb29scyAtLT4KPHN2ZyB3aWR0aD0iNjRweCIgaGVpZ2h0PSI2NHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjMDAwMDAwIj4KDTxnIGlkPSJTVkdSZXBvX2JnQ2FycmllciIgc3Ryb2tlLXdpZHRoPSIwIi8+Cg08ZyBpZD0iU1ZHUmVw" + "b190cmFjZXJDYXJyaWVyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KDTxnIGlkPSJTVkdSZXBvX2ljb25DYXJyaWVyIj4gPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik01LjI5Mjg5IDUuMjkyODlDNS42ODM0MiA0LjkwMjM3IDYuMzE2NTggNC45MDI" + "zNyA2LjcwNzExIDUuMjkyODlMMTIgMTAuNTg1OEwxNy4yOTI5IDUuMjkyODlDMTcuNjgzNCA0LjkwMjM3IDE4LjMxNjYgNC45MDIzNyAxOC43MDcxIDUuMjkyODlDMTkuMDk3NiA1LjY4MzQyIDE5LjA5NzYgNi4zMTY1OCAxOC43MDcxIDYuNzA3MTFMMTMuNDE0MiAxMkwxOC43MDcxIDE3LjI5MjlDMTkuMDk3NiAxNy42ODM0IDE5LjA5Nz" + "YgMTguMzE2NiAxOC43MDcxIDE4LjcwNzFDMTguMzE2NiAxOS4wOTc2IDE3LjY4MzQgMTkuMDk3NiAxNy4yOTI5IDE4LjcwNzFMMTIgMTMuNDE0Mkw2LjcwNzExIDE4LjcwNzFDNi4zMTY1OCAxOS4wOTc2IDUuNjgzNDIgMTkuMDk3NiA1LjI5Mjg5IDE4LjcwNzFDNC45MDIzNyAxOC4zMTY2IDQuOTAyMzcgMTcuNjgzNCA1LjI5Mjg5IDE3L" + "jI5MjlMMTAuNTg1OCAxMkw1LjI5Mjg5IDYuNzA3MTFDNC45MDIzNyA2LjMxNjU4IDQuOTAyMzcgNS42ODM0MiA1LjI5Mjg5IDUuMjkyODlaIiBmaWxsPSIjMEYxNzI5Ii8+IDwvZz4KDTwvc3ZnPg==";
    $impl.TTMSFNCDATAGRIDFILTERACTIVE = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOm5vbmU7fS5jbHMtMntmaWxsOiM0N" + "jgyQjQ7fS5jbHMtM3tmaWxsOnVybCgjTmV3X1BhdHRlcm5fU3dhdGNoXzIpO30uY2xzLTR7ZmlsbDojM2EzYTM4O308L3N0eWxlPjxwYXR0ZXJuIGlkPSJOZXdfUGF0dGVybl9Td2F0Y2hfMiIgZGF0YS1uYW1lPSJOZXcgUGF0dGVybiBTd2F0Y2ggMiIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4IiBwYXR0ZXJuVW5pdHM9InVzZXJTcGFjZU9u" + "VXNlIiB2aWV3Qm94PSIwIDAgNjggNjgiPjxyZWN0IGNsYXNzPSJjbHMtMSIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9ImNscy0yIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48L3BhdHRlcm4+PC9kZWZzPjx0aXRsZT5GaWx0ZXI8L3RpdGxlPjxnIGlkPSJJY29uIj48cG9seWdvbiBjbGFzcz0iY2xzLTMiIHBvaW5" + "0cz0iMS41IDYgMTIuNSAxNSAxMi41IDMwLjUgMTguNSAzMC41IDE4LjUgMTUgMjkuNSA2IDI5LjUgMS41IDEuNSAxLjUgMS41IDYiLz48cGF0aCBjbGFzcz0iY2xzLTQiIGQ9Ik0xOSwzMUgxMlYxNS4yNGwtMTEtOVYxSDMwVjYuMjRsLTExLDlabS02LTFoNVYxNC43NmwxMS05VjJIMlY1Ljc2bDExLDlaIi8+PC9nPjwvc3ZnPg";
    $impl.TTMSFNCDATAGRIDFILTER = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOm5vbmU7fS5jbHMtMntmaWxsOiNmY" + "WZhZmE7fS5jbHMtM3tmaWxsOnVybCgjTmV3X1BhdHRlcm5fU3dhdGNoXzIpO30uY2xzLTR7ZmlsbDojM2EzYTM4O308L3N0eWxlPjxwYXR0ZXJuIGlkPSJOZXdfUGF0dGVybl9Td2F0Y2hfMiIgZGF0YS1uYW1lPSJOZXcgUGF0dGVybiBTd2F0Y2ggMiIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4IiBwYXR0ZXJuVW5pdHM9InVzZXJTcGFjZU9u" + "VXNlIiB2aWV3Qm94PSIwIDAgNjggNjgiPjxyZWN0IGNsYXNzPSJjbHMtMSIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9ImNscy0yIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48L3BhdHRlcm4+PC9kZWZzPjx0aXRsZT5GaWx0ZXI8L3RpdGxlPjxnIGlkPSJJY29uIj48cG9seWdvbiBjbGFzcz0iY2xzLTMiIHBvaW5" + "0cz0iMS41IDYgMTIuNSAxNSAxMi41IDMwLjUgMTguNSAzMC41IDE4LjUgMTUgMjkuNSA2IDI5LjUgMS41IDEuNSAxLjUgMS41IDYiLz48cGF0aCBjbGFzcz0iY2xzLTQiIGQ9Ik0xOSwzMUgxMlYxNS4yNGwtMTEtOVYxSDMwVjYuMjRsLTExLDlabS02LTFoNVYxNC43NmwxMS05VjJIMlY1Ljc2bDExLDlaIi8+PC9nPjwvc3ZnPg";
    $impl.TTMSFNCDATAGRIDFILTERCLEAR = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOm5vbmU7fS5jbHMtMntmaWxsOiNhN" + "zRhYjA7fS5jbHMtM3tmaWxsOiNkMzk0ZDY7fS5jbHMtNHtmaWxsOiNmYWZhZmE7fS5jbHMtNXtmaWxsOnVybCgjTmV3X1BhdHRlcm5fU3dhdGNoXzgpO30uY2xzLTZ7ZmlsbDp1cmwoI05ld19QYXR0ZXJuX1N3YXRjaF83KTt9PC9zdHlsZT48cGF0dGVybiBpZD0iTmV3X1BhdHRlcm5fU3dhdGNoXzgiIGRhdGEtbmFtZT0iTmV3IFBhdHRl" + "cm4gU3dhdGNoIDgiIHdpZHRoPSI2OCIgaGVpZ2h0PSI2OCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgdmlld0JveD0iMCAwIDY4IDY4Ij48cmVjdCBjbGFzcz0iY2xzLTEiIHdpZHRoPSI2OCIgaGVpZ2h0PSI2OCIvPjxyZWN0IGNsYXNzPSJjbHMtMyIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PC9wYXR0ZXJuPjxwYXR0ZXJ" + "uIGlkPSJOZXdfUGF0dGVybl9Td2F0Y2hfNyIgZGF0YS1uYW1lPSJOZXcgUGF0dGVybiBTd2F0Y2ggNyIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4IiBwYXR0ZXJuVW5pdHM9InVzZXJTcGFjZU9uVXNlIiB2aWV3Qm94PSIwIDAgNjggNjgiPjxyZWN0IGNsYXNzPSJjbHMtMSIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9Im" + "Nscy0yIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48L3BhdHRlcm4+PC9kZWZzPjx0aXRsZT5DbGVhcjwvdGl0bGU+PGcgaWQ9Ikljb24iPjxyZWN0IGNsYXNzPSJjbHMtNCIgeD0iMS44NiIgeT0iMTAuMzQiIHdpZHRoPSIyOC4yOCIgaGVpZ2h0PSIxMS4zMSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTYuNjMgMTYpIHJvdGF0ZSgtNDUpI" + "i8+PHBvbHlnb24gY2xhc3M9ImNscy01IiBwb2ludHM9IjIuNzEgMjIgMTAgMjkuMjkgMTUuNzkgMjMuNSA4LjUgMTYuMjEgMi43MSAyMiIvPjxwYXRoIGNsYXNzPSJjbHMtNiIgZD0iTTEwLjcxLDMwbDIwLTIwTDIyLDEuMjksMS4yOSwyMiwxMCwzMC43MVYzMUgzMVYzMFpNMjIsMi43MSwyOS4yOSwxMCwxNi41LDIyLjc5LDkuMjEsMTUu" + "NVpNMi43MSwyMiw4LjUsMTYuMjFsNy4yOSw3LjI5TDEwLDI5LjI5WiIvPjwvZz48L3N2Zz4";
    $impl.TTMSFNCDATAGRIDCOLLAPSE = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgdmlld0JveD0iMCAwIDMyIA0KMzIiPjxkZWZzPjxzdHlsZT4uY2xzLTF7ZmlsbDojMDAwMDA7fTwvc3R5bGU+PC9kZWZzPjx0aXRsZT5QbHVzPC90aXRsZT4gPGcgDQppZD0iSWNvbiI+PHJlY" + "3QgY2xhc3M9ImNscy0xIiB4PSI3IiB5PSIxNSIgd2lkdGg9IjE4IiBoZWlnaHQ9IjEiLz48cmVjdCBjbGFzcz0iY2xzLTEiIHg9IjEiIA0KeT0iMSIgd2lkdGg9IjEiIGhlaWdodD0iMzAiLz48cmVjdCBjbGFzcz0iY2xzLTEiIHg9IjEiIHk9IjEiIHdpZHRoPSIzMCIgDQpoZWlnaHQ9IjEiLz48cmVjdCBjbGFzcz0iY2xzLTEiIHg9IjMw" + "IiB5PSIxIiB3aWR0aD0iMSIgaGVpZ2h0PSIzMCIvPjxyZWN0IA0KY2xhc3M9ImNscy0xIiB4PSIxIiB5PSIzMCIgd2lkdGg9IjMwIiBoZWlnaHQ9IjEiLz48L2c+PC9zdmc+";
    $impl.TTMSFNCDATAGRIDEXPAND = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgdmlld0JveD0iMCAwIDMyIA0KMzIiPjxkZWZzPjxzdHlsZT4uY2xzLTF7ZmlsbDojMDAwMDA7fTwvc3R5bGU+PC9kZWZzPjx0aXRsZT5QbHVzPC90aXRsZT4gPGcgDQppZD0iSWNvbiI+PHJlY" + "3QgY2xhc3M9ImNscy0xIiB4PSI3IiB5PSIxNSIgd2lkdGg9IjE4IiBoZWlnaHQ9IjEiLz48cmVjdCANCmNsYXNzPSJjbHMtMSIgeD0iMTUiIHk9IjciIHdpZHRoPSIxIiBoZWlnaHQ9IjE4Ii8+PHJlY3QgY2xhc3M9ImNscy0xIiB4PSIxIiANCnk9IjEiIHdpZHRoPSIxIiBoZWlnaHQ9IjMwIi8+PHJlY3QgY2xhc3M9ImNscy0xIiB4PSIx" + "IiB5PSIxIiB3aWR0aD0iMzAiIA0KaGVpZ2h0PSIxIi8+PHJlY3QgY2xhc3M9ImNscy0xIiB4PSIzMCIgeT0iMSIgd2lkdGg9IjEiIGhlaWdodD0iMzAiLz48cmVjdCANCmNsYXNzPSJjbHMtMSIgeD0iMSIgeT0iMzAiIHdpZHRoPSIzMCIgaGVpZ2h0PSIxIi8+PC9nPjwvc3ZnPg";
    $impl.TTMSFNCDATAGRIDSORTASC = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOm5vbmU7fS5jbHMtMntmaWxsOiNhN" + "zRhYjA7fS5jbHMtM3tmaWxsOnVybCgjTmV3X1BhdHRlcm5fU3dhdGNoXzcpO30uY2xzLTR7ZmlsbDojMWU4YmNkO30uY2xzLTV7ZmlsbDojM2EzYTM4O308L3N0eWxlPjxwYXR0ZXJuIGlkPSJOZXdfUGF0dGVybl9Td2F0Y2hfNyIgZGF0YS1uYW1lPSJOZXcgUGF0dGVybiBTd2F0Y2ggNyIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4IiBwYXR0" + "ZXJuVW5pdHM9InVzZXJTcGFjZU9uVXNlIiB2aWV3Qm94PSIwIDAgNjggNjgiPjxyZWN0IGNsYXNzPSJjbHMtMSIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9ImNscy0yIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48L3BhdHRlcm4+PC9kZWZzPjx0aXRsZT5Tb3J0LUFaPC90aXRsZT48ZyBpZD0iSWNvbiI+PHBhdGg" + "gY2xhc3M9ImNscy0zIiBkPSJNMiwyOS42NGw3LTEwVjIwSDNWMThoOXYxLjQ0TDUsMjkuMzZWMjloN3YySDJaIi8+PHBhdGggY2xhc3M9ImNscy00IiBkPSJNNS43LDExLDQuNTIsMTVIMS45M0w2LjMzLDFIOS41NEwxNCwxNWgtMi43bC0xLjI0LTRaTTkuNjQsOS4xMSw4LjU2LDUuNjZjLS4yNy0uODUtLjQ5LTEuOC0uNjktMi42MWgwYy" + "0uMi44MS0uNCwxLjc4LS42NSwyLjYxTDYuMTEsOS4xMVoiLz48cG9seWdvbiBjbGFzcz0iY2xzLTUiIHBvaW50cz0iMjMgMjUuMTIgMjMgNiAyMiA2IDIyIDI1LjEyIDE2LjQ0IDE5LjU2IDE1LjU2IDIwLjQ0IDIyLjUgMjcuMzggMjkuNDQgMjAuNDQgMjguNTYgMTkuNTYgMjMgMjUuMTIiLz48L2c+PC9zdmc+";
    $impl.TTMSFNCDATAGRIDSORTDESC = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOm5vbmU7fS5jbHMtMntmaWxsOiNhN" + "zRhYjA7fS5jbHMtM3tmaWxsOnVybCgjTmV3X1BhdHRlcm5fU3dhdGNoXzcpO30uY2xzLTR7ZmlsbDojMWU4YmNkO30uY2xzLTV7ZmlsbDojM2EzYTM4O308L3N0eWxlPjxwYXR0ZXJuIGlkPSJOZXdfUGF0dGVybl9Td2F0Y2hfNyIgZGF0YS1uYW1lPSJOZXcgUGF0dGVybiBTd2F0Y2ggNyIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4IiBwYXR0" + "ZXJuVW5pdHM9InVzZXJTcGFjZU9uVXNlIiB2aWV3Qm94PSIwIDAgNjggNjgiPjxyZWN0IGNsYXNzPSJjbHMtMSIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9ImNscy0yIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48L3BhdHRlcm4+PC9kZWZzPjx0aXRsZT5Tb3J0LVpBPC90aXRsZT48ZyBpZD0iSWNvbiI+PHBhdGg" + "gY2xhc3M9ImNscy0zIiBkPSJNMiwxMi42NGw3LTEwVjNIM1YxaDlWMi40NEw1LDEyLjM2VjEyaDd2MkgyWiIvPjxwYXRoIGNsYXNzPSJjbHMtNCIgZD0iTTUuNywyNyw0LjUyLDMxSDEuOTNsNC40LTE0SDkuNTRMMTQsMzFoLTIuN2wtMS4yNC00Wm0zLjk0LTEuOTNMOC41NiwyMS42NmMtLjI3LS44NS0uNDktMS44LS42OS0yLjYxaDBjLS" + "4yLjgxLS40LDEuNzgtLjY1LDIuNjFMNi4xMSwyNS4xMVoiLz48cG9seWdvbiBjbGFzcz0iY2xzLTUiIHBvaW50cz0iMjMgMjUuMTIgMjMgNiAyMiA2IDIyIDI1LjEyIDE2LjQ0IDE5LjU2IDE1LjU2IDIwLjQ0IDIyLjUgMjcuMzggMjkuNDQgMjAuNDQgMjguNTYgMTkuNTYgMjMgMjUuMTIiLz48L2c+PC9zdmc+";
    $impl.TTMSFNCDATAGRIDFILTERTYPE = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOm5vbmU7fS5jbHMtMntmaWxsOiM3O" + "Tc3NzQ7fS5jbHMtM3tmaWxsOiNmYWZhZmE7fS5jbHMtNHtmaWxsOiMzYTNhMzg7fS5jbHMtNXtmaWxsOnVybCgjTmV3X1BhdHRlcm5fU3dhdGNoXzQpO308L3N0eWxlPjxwYXR0ZXJuIGlkPSJOZXdfUGF0dGVybl9Td2F0Y2hfNCIgZGF0YS1uYW1lPSJOZXcgUGF0dGVybiBTd2F0Y2ggNCIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4IiBwYXR0" + "ZXJuVW5pdHM9InVzZXJTcGFjZU9uVXNlIiB2aWV3Qm94PSIwIDAgNjggNjgiPjxyZWN0IGNsYXNzPSJjbHMtMSIgd2lkdGg9IjY4IiBoZWlnaHQ9IjY4Ii8+PHJlY3QgY2xhc3M9ImNscy0yIiB3aWR0aD0iNjgiIGhlaWdodD0iNjgiLz48L3BhdHRlcm4+PC9kZWZzPjx0aXRsZT5UZXh0LUZpbHRlcjwvdGl0bGU+PGcgaWQ9Ik1hc2siPjx" + "wb2x5Z29uIGNsYXNzPSJjbHMtMyIgcG9pbnRzPSIyNS41IDkgMTkgMi41IDE5IDkgMjUuNSA5Ii8+PHBhdGggY2xhc3M9ImNscy0zIiBkPSJNMTgsMTBWMkg2VjMwSDIxVjI2LjE4TDE5Ljg0LDI1SDhWMjRIMTguODVsLTItMkg4VjIxaDhWMTlIOFYxOGg4VjE2SDhWMTVIMjR2MWgyVjEwWk04LDloOHYxSDhabTAsNFYxMkgyNHYxWiIvPj" + "xwb2x5Z29uIGNsYXNzPSJjbHMtNCIgcG9pbnRzPSI1IDEgNSAzMSA2IDMxIDIxIDMxIDIxIDMwIDYgMzAgNiAyIDE4IDIgMTguNSAyIDE5IDIgMTkgMi41IDI1LjUgOSAyNiA5IDI2IDkuNSAyNiAxMCAyNiAxNiAyNyAxNiAyNyA5LjcgMjcgOSAxOSAxIDUgMSIvPjxwb2x5Z29uIGNsYXNzPSJjbHMtNCIgcG9pbnRzPSIyNiAxMCAyNiA5L" + "jUgMjYgOSAyNS41IDkgMTkgOSAxOSAyLjUgMTkgMiAxOC41IDIgMTggMiAxOCAxMCAyNiAxMCIvPjxyZWN0IGNsYXNzPSJjbHMtMyIgeD0iOCIgeT0iOSIgd2lkdGg9IjgiIGhlaWdodD0iMSIvPjxyZWN0IGNsYXNzPSJjbHMtNSIgeD0iOCIgeT0iOSIgd2lkdGg9IjgiIGhlaWdodD0iMSIvPjxyZWN0IGNsYXNzPSJjbHMtMyIgeD0iOCIg" + "eT0iMTIiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxIi8+PHJlY3QgY2xhc3M9ImNscy01IiB4PSI4IiB5PSIxMiIgd2lkdGg9IjE2IiBoZWlnaHQ9IjEiLz48cG9seWdvbiBjbGFzcz0iY2xzLTMiIHBvaW50cz0iOCAxNSA4IDE2IDE2IDE2IDI0IDE2IDI0IDE1IDggMTUiLz48cG9seWdvbiBjbGFzcz0iY2xzLTUiIHBvaW50cz0iOCAxNSA4IDE" + "2IDE2IDE2IDI0IDE2IDI0IDE1IDggMTUiLz48cmVjdCBjbGFzcz0iY2xzLTMiIHg9IjgiIHk9IjE4IiB3aWR0aD0iOCIgaGVpZ2h0PSIxIi8+PHJlY3QgY2xhc3M9ImNscy01IiB4PSI4IiB5PSIxOCIgd2lkdGg9IjgiIGhlaWdodD0iMSIvPjxwb2x5Z29uIGNsYXNzPSJjbHMtMyIgcG9pbnRzPSI4IDIyIDE2Ljg3IDIyIDE2IDIxLjEyID" + "E2IDIxIDggMjEgOCAyMiIvPjxwb2x5Z29uIGNsYXNzPSJjbHMtNSIgcG9pbnRzPSI4IDIyIDE2Ljg3IDIyIDE2IDIxLjEyIDE2IDIxIDggMjEgOCAyMiIvPjxwb2x5Z29uIGNsYXNzPSJjbHMtMyIgcG9pbnRzPSI4IDI1IDE5Ljg0IDI1IDE4Ljg1IDI0IDggMjQgOCAyNSIvPjxwb2x5Z29uIGNsYXNzPSJjbHMtNSIgcG9pbnRzPSI4IDI1I" + "DE5Ljg0IDI1IDE4Ljg1IDI0IDggMjQgOCAyNSIvPjwvZz48ZyBpZD0iT3ZlcmxheSI+PHBvbHlnb24gY2xhc3M9ImNscy0zIiBwb2ludHM9IjMxLjUgMTcuNSAxNy41IDE3LjUgMTcuNSAyMC41IDIyLjUgMjUuNTYgMjIuNSAzMS41IDI2LjUgMzEuNSAyNi41IDI1LjU2IDMxLjUgMjAuNSAzMS41IDE3LjUiLz48cGF0aCBjbGFzcz0iY2xz" + "LTQiIGQ9Ik0yNywzMkgyMlYyNS43N2wtNS01LjA2VjE3SDMydjMuNzFsLTUsNS4wNlptLTQtMWgzVjI1LjM2bDUtNS4wN1YxOEgxOHYyLjI5bDUsNS4wN1oiLz48L2c+PC9zdmc+";
    rtl.createClass($impl,"TTMSFNCDataGridBaseOpen",pas["WEBLib.TMSFNCDataGridBase"].TTMSFNCDataGridBase,function () {
      rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
      rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
      rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
      rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
      rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
      rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
      rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
      rtl.addIntf(this,pas.System.IUnknown);
    });
    rtl.createClass($impl,"TTMSFNCDataGridCellOpen",pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCell,function () {
    });
    rtl.createClass($impl,"TTMSFNCDataGridCellControlOpen",pas["WEBLib.Controls"].TWinControl,function () {
      rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
      rtl.addIntf(this,pas.System.IUnknown);
    });
    rtl.createClass($impl,"TTMSFNCDataGridNodeCellOpen",pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridNodeCell,function () {
    });
    rtl.createClass($impl,"TTMSFNCDataGridCellItemExtendedOpen",pas["WEBLib.TMSFNCDataGridCell"].TTMSFNCDataGridCellItemExtended,function () {
      rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCCustomReadWriteIO);
    });
    rtl.createClass($impl,"TTMSFNCDataGridInplaceEditorOpen",pas["WEBLib.Controls"].TWinControl,function () {
      rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
      rtl.addIntf(this,pas.System.IUnknown);
    });
    rtl.createClass($impl,"TFNCControlOpen",pas["WEBLib.TMSFNCCustomControl"].TTMSFNCCustomControl,function () {
      rtl.addIntf(this,pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport);
      rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
      rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
      rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderNotificationManagerReference);
      rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
      rtl.addIntf(this,pas["WEBLib.TMSFNCTypes"].ITMSFNCProductInfo);
      rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
      rtl.addIntf(this,pas.System.IUnknown);
    });
    rtl.createClass($impl,"TCustomEditOpen",pas["WEBLib.StdCtrls"].TCustomEdit,function () {
      rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
      rtl.addIntf(this,pas.System.IUnknown);
    });
    rtl.createClass($impl,"TCustomMemoOpen",pas["WEBLib.StdCtrls"].TCustomMemo,function () {
      rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
      rtl.addIntf(this,pas.System.IUnknown);
    });
    rtl.createClass($impl,"TCustomComboBoxOpen",pas["WEBLib.StdCtrls"].TCustomComboBox,function () {
      rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
      rtl.addIntf(this,pas.System.IUnknown);
    });
    $impl.SCROLLINGDELAY = 0;
    $impl.SWIPECOUNT = 300;
    $impl.FILTERDELAY = 40;
    $impl.GetTickCountX = function () {
      var Result = 0;
      var h = 0;
      var m = 0;
      var s = 0;
      var ms = 0;
      pas.SysUtils.DecodeTime(pas.SysUtils.Now(),{get: function () {
          return h;
        }, set: function (v) {
          h = v;
        }},{get: function () {
          return m;
        }, set: function (v) {
          m = v;
        }},{get: function () {
          return s;
        }, set: function (v) {
          s = v;
        }},{get: function () {
          return ms;
        }, set: function (v) {
          ms = v;
        }});
      Result = ms + (s * 1000) + (m * 60 * 1000) + (h * 60 * 60 * 1000);
      return Result;
    };
    $impl.AnimateDouble = function (Start, Stop, Delta, Margin) {
      var Result = false;
      Result = true;
      if ((Start.get() > (Stop.get() - Margin)) && (Start.get() < (Stop.get() + Margin))) {
        Start.set(Stop.get());
        Result = false;
      } else {
        Delta = Math.max(Margin,Delta);
        if (Start.get() < Stop.get()) {
          Start.set(Start.get() + Delta)}
         else Start.set(Start.get() - Delta);
      };
      return Result;
    };
    $impl.FindOptionsToParameters = function (AOptions) {
      var Result = {};
      var p = {};
      p = rtl.createSet(pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFindParameter.gfnIgnoreHTMLTags,pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFindParameter.gfnAutoGoto,pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFindParameter.gfnDirectionLeftRight);
      if (pas["WEBLib.TMSFNCFindDialog"].TTMSFNCFindDialogOption.fdoCaseSensitive in AOptions) p = rtl.unionSet(p,rtl.createSet(pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFindParameter.gfnMatchCase));
      if (pas["WEBLib.TMSFNCFindDialog"].TTMSFNCFindDialogOption.fdoWholeWordOnly in AOptions) p = rtl.unionSet(p,rtl.createSet(pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFindParameter.gfnMatchFull));
      if (pas["WEBLib.TMSFNCFindDialog"].TTMSFNCFindDialogOption.fdoExpression in AOptions) p = rtl.unionSet(p,rtl.createSet(pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFindParameter.gfnMatchRegular));
      Result = rtl.refSet(p);
      return Result;
    };
    $impl.ReplaceOptionsToParameters = function (AOptions) {
      var Result = {};
      var p = {};
      p = rtl.createSet(pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFindParameter.gfnIgnoreHTMLTags,pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFindParameter.gfnAutoGoto,pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFindParameter.gfnDirectionLeftRight);
      if (pas["WEBLib.TMSFNCReplaceDialog"].TTMSFNCReplaceDialogOption.rdoCaseSensitive in AOptions) p = rtl.unionSet(p,rtl.createSet(pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFindParameter.gfnMatchCase));
      if (pas["WEBLib.TMSFNCReplaceDialog"].TTMSFNCReplaceDialogOption.rdoWholeWordOnly in AOptions) p = rtl.unionSet(p,rtl.createSet(pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFindParameter.gfnMatchFull));
      if (pas["WEBLib.TMSFNCReplaceDialog"].TTMSFNCReplaceDialogOption.rdoExpression in AOptions) p = rtl.unionSet(p,rtl.createSet(pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridDataFindParameter.gfnMatchRegular));
      Result = rtl.refSet(p);
      return Result;
    };
  };
  $mod.$init = function () {
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($impl.TTMSFNCDATAGRIDCLOSE);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($impl.TTMSFNCDATAGRIDEXPAND);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($impl.TTMSFNCDATAGRIDCOLLAPSE);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($impl.TTMSFNCDATAGRIDFILTER);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($impl.TTMSFNCDATAGRIDFILTERACTIVE);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($impl.TTMSFNCDATAGRIDFILTERCLEAR);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($impl.TTMSFNCDATAGRIDSORTASC);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($impl.TTMSFNCDATAGRIDSORTDESC);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($impl.TTMSFNCDATAGRIDFILTERTYPE);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($impl.TTMSFNCDATAGRIDFIRSTPAGE);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($impl.TTMSFNCDATAGRIDLASTPAGE);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($impl.TTMSFNCDATAGRIDPREVIOUSPAGE);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($impl.TTMSFNCDATAGRIDNEXTPAGE);
  };
},["WEBLib.TMSFNCDataGridColumnsEditor","WEBLib.TMSFNCCustomTreeView","WEBLib.TMSFNCColorSelector","WEBLib.TMSFNCDataGridBase","WEBLib.TMSFNCCustomPicker","WEBLib.TMSFNCHTMLEngine","WEBLib.TMSFNCDataGridUtil","WEBLib.TMSFNCCustomComponent","WEBLib.Forms","Math","WEBLib.TMSFNCUtils","WEBLib.TMSFNCEditorsTools","RTTI","DateUtils"]);
rtl.module("WEBLib.TMSFNCDataGridCell",["System","Classes","WEBLib.Controls","WEBLib.TMSFNCPersistence","WEBLib.TMSFNCJSONReader","WEBLib.TMSFNCJSONWriter","WEBLib.TMSFNCCustomControl","WEBLib.TMSFNCTypes","WEBLib.TMSFNCDataGridCore","WEBLib.Graphics","WEBLib.TMSFNCGraphicsTypes","WEBLib.TMSFNCButton","WEBLib.TMSFNCBitmapContainer","WEBLib.StdCtrls","WEBLib.TMSFNCGraphics","SysUtils","RTTI","Generics.Collections","Generics.Defaults","Types","WEBLib.ComCtrls","Web"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.TTMSFNCDataGridCellState = {"0": "gcsNormal", gcsNormal: 0, "1": "gcsFocused", gcsFocused: 1, "2": "gcsFixed", gcsFixed: 2, "3": "gcsFixedSelected", gcsFixedSelected: 3, "4": "gcsSelected", gcsSelected: 4};
  this.$rtti.$Enum("TTMSFNCDataGridCellState",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TTMSFNCDataGridCellState});
  rtl.createClass(this,"TTMSFNCDataGridCellLayout",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FFill = null;
      this.FFont = null;
      this.FOnChange = null;
      this.FSides = {};
      this.FStroke = null;
      this.FTextAlign = 0;
      this.FTextAngle = 0.0;
      this.FTrimming = 0;
      this.FVerticalTextAlign = 0;
      this.FWordWrapping = false;
    };
    this.$final = function () {
      this.FFill = undefined;
      this.FFont = undefined;
      this.FOnChange = undefined;
      this.FSides = undefined;
      this.FStroke = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.IsTextAngleStored = function () {
      var Result = false;
      Result = this.FTextAngle !== 0;
      return Result;
    };
    this.SetFill = function (Value) {
      if (this.FFill !== Value) {
        this.FFill.Assign(Value);
        this.Changed();
      };
    };
    this.SetFont = function (Value) {
      if (this.FFont !== Value) {
        this.FFont.Assign(Value);
        this.Changed();
      };
    };
    this.SetSides = function (Value) {
      if (rtl.neSet(this.FSides,Value)) {
        this.FSides = rtl.refSet(Value);
        this.Changed();
      };
    };
    this.SetStroke = function (Value) {
      if (this.FStroke !== Value) {
        this.FStroke.Assign(Value);
        this.Changed();
      };
    };
    this.SetTextAlign = function (Value) {
      if (this.FTextAlign !== Value) {
        this.FTextAlign = Value;
        this.Changed();
      };
    };
    this.SetTextAngle = function (Value) {
      if (this.FTextAngle !== Value) {
        this.FTextAngle = Value;
        this.Changed();
      };
    };
    this.SetTrimming = function (Value) {
      if (this.FTrimming !== Value) {
        this.FTrimming = Value;
        this.Changed();
      };
    };
    this.SetVerticalTextAlign = function (Value) {
      if (this.FVerticalTextAlign !== Value) {
        this.FVerticalTextAlign = Value;
        this.Changed();
      };
    };
    this.SetWordWrapping = function (Value) {
      if (this.FWordWrapping !== Value) {
        this.FWordWrapping = Value;
        this.Changed();
      };
    };
    this.Changed = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.FillChanged = function (Sender) {
      this.Changed();
    };
    this.FontChanged = function (Sender) {
      this.Changed();
    };
    this.StrokeChanged = function (Sender) {
      this.Changed();
    };
    this.Create$1 = function (ADefaultFillColor) {
      this.FTextAngle = 0;
      this.FFill = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFill.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid,ADefaultFillColor,8421504,-1,-1]);
      this.FFill.FOnChanged = rtl.createCallback(this,"FillChanged");
      this.FStroke = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStroke.$create("Create$1",[pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid,12632256,1.0]);
      this.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskSolid);
      this.FStroke.SetColor(12632256);
      this.FStroke.FOnChanged = rtl.createCallback(this,"StrokeChanged");
      this.FFont = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFont.$create("Create$2");
      this.FFont.FOnChanged = rtl.createCallback(this,"FontChanged");
      this.FTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading;
      this.FVerticalTextAlign = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter;
      this.FWordWrapping = false;
      this.FTrimming = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone;
      this.FSides = rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsTop,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsRight,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsBottom);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FFont");
      rtl.free(this,"FFill");
      rtl.free(this,"FStroke");
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridCellLayout.isPrototypeOf(Source)) {
        this.FFill.Assign(rtl.as(Source,$mod.TTMSFNCDataGridCellLayout).FFill);
        this.FStroke.Assign(rtl.as(Source,$mod.TTMSFNCDataGridCellLayout).FStroke);
        this.FFont.Assign(rtl.as(Source,$mod.TTMSFNCDataGridCellLayout).FFont);
        this.FTextAlign = rtl.as(Source,$mod.TTMSFNCDataGridCellLayout).FTextAlign;
        this.FVerticalTextAlign = rtl.as(Source,$mod.TTMSFNCDataGridCellLayout).FVerticalTextAlign;
        this.FWordWrapping = rtl.as(Source,$mod.TTMSFNCDataGridCellLayout).FWordWrapping;
        this.FTrimming = rtl.as(Source,$mod.TTMSFNCDataGridCellLayout).FTrimming;
        this.FTextAngle = rtl.as(Source,$mod.TTMSFNCDataGridCellLayout).FTextAngle;
        this.FSides = rtl.refSet(rtl.as(Source,$mod.TTMSFNCDataGridCellLayout).FSides);
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Fill",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFill"],"FFill","SetFill");
    $r.addProperty("Font",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsFont"],"FFont","SetFont");
    $r.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChange","FOnChange");
    $r.addProperty("Sides",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsSides"],"FSides","SetSides",4,{Default: rtl.createSet(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsLeft,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsTop,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsRight,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsSide.gsBottom)});
    $r.addProperty("Stroke",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsStroke"],"FStroke","SetStroke");
    $r.addProperty("TextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FTextAlign","SetTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading});
    $r.addProperty("TextAngle",14,rtl.double,"FTextAngle","SetTextAngle",4,{stored: "IsTextAngleStored"});
    $r.addProperty("Trimming",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextTrimming"],"FTrimming","SetTrimming",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone});
    $r.addProperty("VerticalTextAlign",2,pas["WEBLib.TMSFNCGraphicsTypes"].$rtti["TTMSFNCGraphicsTextAlign"],"FVerticalTextAlign","SetVerticalTextAlign",4,{Default: pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter});
    $r.addProperty("WordWrapping",2,rtl.boolean,"FWordWrapping","SetWordWrapping",4,{Default: false});
  });
  this.TTMSFNCDataGridCellKind = {"0": "gckCell", gckCell: 0, "1": "gckFixedRootCell", gckFixedRootCell: 1, "2": "gckFixedRowCell", gckFixedRowCell: 2, "3": "gckFixedColumnCell", gckFixedColumnCell: 3, "4": "gckFreezeRootCell", gckFreezeRootCell: 4, "5": "gckFreezeRowCell", gckFreezeRowCell: 5, "6": "gckFreezeColumnCell", gckFreezeColumnCell: 6, "7": "gckFreezeFixedRowCell", gckFreezeFixedRowCell: 7, "8": "gckFreezeFixedColumnCell", gckFreezeFixedColumnCell: 8};
  this.$rtti.$Enum("TTMSFNCDataGridCellKind",{minvalue: 0, maxvalue: 8, ordtype: 1, enumtype: this.TTMSFNCDataGridCellKind});
  this.$rtti.$Class("TTMSFNCDataGridCellItem");
  rtl.createClass(this,"TTMSFNCDataGridRows",pas["Generics.Collections"].TObjectDictionary$$$G$$generics$collections$$Longint$$TTMSFNCDataGridCellItem,function () {
  });
  rtl.createClass(this,"TTMSFNCDataGridRowItem",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FData = null;
      this.FNodeChildCount = 0;
      this.FNodeLevel = 0;
      this.FNodeState = 0;
      this.FType = 0;
      this.FIndex = 0;
    };
    this.$final = function () {
      this.FData = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.GetData = function () {
      var Result = null;
      if (!(this.FData != null)) this.FData = $mod.TTMSFNCDataGridRows.$create("Create$5",[rtl.createSet(pas["Generics.Collections"].TDictionaryOwnership.doOwnsValues)]);
      Result = this.FData;
      return Result;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FData;
        }, set: function (v) {
          this.p.FData = v;
        }});
      pas.System.TObject.Destroy.call(this);
    };
    this.Assign$1 = function (Source, AHost) {
      var c = null;
      var ci = null;
      var k = 0;
      this.FType = rtl.as(Source,$mod.TTMSFNCDataGridRowItem).FType;
      this.FNodeChildCount = rtl.as(Source,$mod.TTMSFNCDataGridRowItem).FNodeChildCount;
      this.FNodeLevel = rtl.as(Source,$mod.TTMSFNCDataGridRowItem).FNodeLevel;
      this.FNodeState = rtl.as(Source,$mod.TTMSFNCDataGridRowItem).FNodeState;
      this.FIndex = rtl.as(Source,$mod.TTMSFNCDataGridRowItem).FIndex;
      this.GetData().Clear();
      var $in = Source.GetData().GetKeys().GetEnumerator$1();
      try {
        while ($in.MoveNext$1()) {
          k = $in.GetCurrent();
          c = Source.GetData().GetItem(k);
          if (c != null) {
            if ($mod.TTMSFNCDataGridCellItemExtended.isPrototypeOf(c)) {
              ci = $mod.TTMSFNCDataGridCellItemExtended.$create("Create$1",[AHost])}
             else ci = $mod.TTMSFNCDataGridCellItem.$create("Create$1",[AHost]);
            ci.Assign(c);
            this.GetData().AddOrSetValue(k,ci);
          };
        }
      } finally {
        $in = rtl.freeLoc($in)
      };
    };
    this.Init = function () {
      this.FType = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowType.grtDefault;
      this.FNodeChildCount = 0;
      this.FNodeLevel = 0;
      this.FNodeState = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowNodeState.grnsExpanded;
      this.FIndex = -1;
    };
    this.HasData = function () {
      var Result = false;
      Result = this.FData != null;
      return Result;
    };
    var $r = this.$rtti;
    $r.addProperty("Type",0,pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridRowType"],"FType","FType");
    $r.addProperty("NodeChildCount",0,rtl.longint,"FNodeChildCount","FNodeChildCount");
    $r.addProperty("NodeLevel",0,rtl.longint,"FNodeLevel","FNodeLevel");
    $r.addProperty("NodeState",0,pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridRowNodeState"],"FNodeState","FNodeState");
    $r.addProperty("Index",0,rtl.longint,"FIndex","FIndex");
  });
  rtl.recNewT(this,"TTMSFNCDataGridCellMergeInfo",function () {
    this.ColumnOffset = 0;
    this.RowOffset = 0;
    this.ColumnSpan = 0;
    this.RowSpan = 0;
    this.$eq = function (b) {
      return (this.ColumnOffset === b.ColumnOffset) && (this.RowOffset === b.RowOffset) && (this.ColumnSpan === b.ColumnSpan) && (this.RowSpan === b.RowSpan);
    };
    this.$assign = function (s) {
      this.ColumnOffset = s.ColumnOffset;
      this.RowOffset = s.RowOffset;
      this.ColumnSpan = s.ColumnSpan;
      this.RowSpan = s.RowSpan;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCDataGridCellMergeInfo",{},this);
    $r.addField("ColumnOffset",rtl.longint);
    $r.addField("RowOffset",rtl.longint);
    $r.addField("ColumnSpan",rtl.longint);
    $r.addField("RowSpan",rtl.longint);
  });
  this.TTMSFNCDataGridCellItemType = {"0": "gcitNormal", gcitNormal: 0, "1": "gcitCheckBox", gcitCheckBox: 1, "2": "gcitRadioButton", gcitRadioButton: 2, "3": "gcitDataCheckBox", gcitDataCheckBox: 3, "4": "gcitDataRadioButton", gcitDataRadioButton: 4, "5": "gcitButton", gcitButton: 5, "6": "gcitProgressBar", gcitProgressBar: 6, "7": "gcitDataProgressBar", gcitDataProgressBar: 7, "8": "gcitBitmap", gcitBitmap: 8};
  this.$rtti.$Enum("TTMSFNCDataGridCellItemType",{minvalue: 0, maxvalue: 8, ordtype: 1, enumtype: this.TTMSFNCDataGridCellItemType});
  this.TTMSFNCDataGridCellItemTypeRange = {"0": "gcirNormal", gcirNormal: 0, "1": "gcirFixed", gcirFixed: 1, "2": "gcirAll", gcirAll: 2};
  this.$rtti.$Enum("TTMSFNCDataGridCellItemTypeRange",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCDataGridCellItemTypeRange});
  this.$rtti.$Class("TTMSFNCDataGridCellItemExtended");
  rtl.createClass(this,"TTMSFNCDataGridCellItem",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FDisplayValue = "";
      this.FHost = null;
      this.FInvalid = false;
      this.FValue = undefined;
    };
    this.$final = function () {
      this.FHost = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetValue = function (V) {
      this.FValue = V;
      this.FInvalid = true;
    };
    this.Create$1 = function (AHost) {
      this.FHost = AHost;
      this.FValue = null;
      this.FDisplayValue = "";
      this.FInvalid = true;
      return this;
    };
    this.Destroy = function () {
      this.FHost = null;
      pas.System.TObject.Destroy.call(this);
    };
    this.Clear = function () {
      this.FValue = pas.RTTI.TValue.Empty();
      this.FDisplayValue = "";
      this.FInvalid = true;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridCellItem.isPrototypeOf(Source)) {
        this.FValue = rtl.as(Source,$mod.TTMSFNCDataGridCellItem).FValue;
        this.FDisplayValue = rtl.as(Source,$mod.TTMSFNCDataGridCellItem).FDisplayValue;
        this.FInvalid = rtl.as(Source,$mod.TTMSFNCDataGridCellItem).FInvalid;
      };
    };
  });
  this.TTMSFNCDataGridCellControlAlign = {"0": "gcaNone", gcaNone: 0, "1": "gcaLeft", gcaLeft: 1, "2": "gcaTop", gcaTop: 2, "3": "gcaRight", gcaRight: 3, "4": "gcaBottom", gcaBottom: 4, "5": "gcaClient", gcaClient: 5};
  this.$rtti.$Enum("TTMSFNCDataGridCellControlAlign",{minvalue: 0, maxvalue: 5, ordtype: 1, enumtype: this.TTMSFNCDataGridCellControlAlign});
  this.TTMSFNCDataGridCellControlPosition = {"0": "gcpTopLeft", gcpTopLeft: 0, "1": "gcpTopCenter", gcpTopCenter: 1, "2": "gcpTopRight", gcpTopRight: 2, "3": "gcpCenterLeft", gcpCenterLeft: 3, "4": "gcpCenterCenter", gcpCenterCenter: 4, "5": "gcpCenterRight", gcpCenterRight: 5, "6": "gcpBottomLeft", gcpBottomLeft: 6, "7": "gcpBottomCenter", gcpBottomCenter: 7, "8": "gcpBottomRight", gcpBottomRight: 8};
  this.$rtti.$Enum("TTMSFNCDataGridCellControlPosition",{minvalue: 0, maxvalue: 8, ordtype: 1, enumtype: this.TTMSFNCDataGridCellControlPosition});
  rtl.createClass(this,"TTMSFNCDataGridCellItemExtended",this.TTMSFNCDataGridCellItem,function () {
    this.$init = function () {
      $mod.TTMSFNCDataGridCellItem.$init.call(this);
      this.FOwnerInterface = null;
      this.FBitmap = null;
      this.FBitmapName = "";
      this.FBooleanValue = false;
      this.FComment = "";
      this.FControl = null;
      this.FControlAlign = 0;
      this.FControlHeight = 0;
      this.FControlMargins = null;
      this.FControlPosition = 0;
      this.FControlText = "";
      this.FControlWidth = 0;
      this.FDataBoolean = false;
      this.FDataInteger = 0;
      this.FDataObject = null;
      this.FDataPointer = null;
      this.FDataString = "";
      this.FFilterEditor = null;
      this.FHint = "";
      this.FIntegerValue = 0;
      this.FLayout = null;
      this.FManagedObject = null;
      this.FMergeInfo = $mod.TTMSFNCDataGridCellMergeInfo.$new();
      this.FObject = null;
      this.FRadioGroupIndex = 0;
      this.FReadOnly = false;
      this.FRenderer = null;
      this.FType = 0;
      this.FLayoutPersistence = 0;
      this.FBitmapAspectRatio = false;
      this.FBitmapCentered = false;
      this.FBitmapStretched = false;
      this.FBitmapCropped = false;
    };
    this.$final = function () {
      rtl.setIntfP(this,"FOwnerInterface",null);
      this.FBitmap = undefined;
      this.FControl = undefined;
      this.FControlMargins = undefined;
      this.FDataObject = undefined;
      this.FFilterEditor = undefined;
      this.FLayout = undefined;
      this.FManagedObject = undefined;
      this.FMergeInfo = undefined;
      this.FObject = undefined;
      this.FRenderer = undefined;
      $mod.TTMSFNCDataGridCellItem.$final.call(this);
    };
    this.GetBitmap = function () {
      var Result = null;
      if (!(this.FBitmap != null)) this.FBitmap = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      Result = this.FBitmap;
      return Result;
    };
    this.GetColumnOffset = function () {
      var Result = 0;
      Result = this.FMergeInfo.ColumnOffset;
      return Result;
    };
    this.GetColumnSpan = function () {
      var Result = 0;
      Result = this.FMergeInfo.ColumnSpan;
      return Result;
    };
    this.GetControlMargins = function () {
      var Result = null;
      if (!(this.FControlMargins != null)) this.FControlMargins = pas["WEBLib.TMSFNCTypes"].TTMSFNCMargins.$create("Create$1");
      Result = this.FControlMargins;
      return Result;
    };
    this.GetRowOffset = function () {
      var Result = 0;
      Result = this.FMergeInfo.RowOffset;
      return Result;
    };
    this.GetRowSpan = function () {
      var Result = 0;
      Result = this.FMergeInfo.RowSpan;
      return Result;
    };
    this.SetColumnOffset = function (Value) {
      var m = $mod.TTMSFNCDataGridCellMergeInfo.$new();
      m.$assign(this.FMergeInfo);
      m.ColumnOffset = Value;
      this.FMergeInfo.$assign(m);
    };
    this.SetColumnSpan = function (Value) {
      var m = $mod.TTMSFNCDataGridCellMergeInfo.$new();
      m.$assign(this.FMergeInfo);
      m.ColumnSpan = Value;
      this.FMergeInfo.$assign(m);
    };
    this.SetRowOffset = function (Value) {
      var m = $mod.TTMSFNCDataGridCellMergeInfo.$new();
      m.$assign(this.FMergeInfo);
      m.RowOffset = Value;
      this.FMergeInfo.$assign(m);
    };
    this.SetRowSpan = function (Value) {
      var m = $mod.TTMSFNCDataGridCellMergeInfo.$new();
      m.$assign(this.FMergeInfo);
      m.RowSpan = Value;
      this.FMergeInfo.$assign(m);
    };
    this.DestroyFilterEditor = function () {
      if (this.FFilterEditor != null) this.FFilterEditor.SetParent(null);
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FFilterEditor;
        }, set: function (v) {
          this.p.FFilterEditor = v;
        }});
    };
    this.DestroyLayout = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FLayout;
        }, set: function (v) {
          this.p.FLayout = v;
        }});
    };
    this.DestroyRenderer = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FRenderer;
        }, set: function (v) {
          this.p.FRenderer = v;
        }});
    };
    this.CustomReadProperty = function (AObject, APropertyName, APropertyKind, AReader, ACanRead) {
      var rd = null;
      if (ACanRead.get() && (APropertyName === "LayoutPersistence")) {
        ACanRead.set(false);
        rd = pas["WEBLib.TMSFNCPersistence"].TTMSFNCReader.$create("Create$2",[AReader]);
        try {
          if (!AReader.IsNull()) {
            if (this.FLayout === null) this.FLayout = $mod.TTMSFNCDataGridCellLayout.$create("Create$1",[16777215]);
            rd.Read$1(this.FLayout);
          };
        } finally {
          rd = rtl.freeLoc(rd);
        };
      };
    };
    this.CustomWriteProperty = function (AObject, APropertyName, APropertyKind, AWriter, ACanWrite) {
      var wr = null;
      if (ACanWrite.get() && (APropertyName === "LayoutPersistence")) {
        ACanWrite.set(false);
        wr = pas["WEBLib.TMSFNCPersistence"].TTMSFNCWriter.$create("Create$2",[AWriter]);
        try {
          AWriter.WriteName("LayoutPersistence");
          wr.Write(this.FLayout);
        } finally {
          wr = rtl.freeLoc(wr);
        };
      };
    };
    this._AddRef = function () {
      var Result = 0;
      if (this.FOwnerInterface !== null) {
        Result = this.FOwnerInterface._AddRef()}
       else Result = -1;
      return Result;
    };
    this._Release = function () {
      var Result = 0;
      if (this.FOwnerInterface !== null) {
        Result = this.FOwnerInterface._Release()}
       else Result = -1;
      return Result;
    };
    this.Create$1 = function (AHost) {
      $mod.TTMSFNCDataGridCellItem.Create$1.apply(this,arguments);
      this.FControl = null;
      this.FObject = null;
      this.FReadOnly = false;
      this.FType = $mod.TTMSFNCDataGridCellItemType.gcitNormal;
      this.FBitmap = null;
      this.FControlMargins = null;
      this.FBitmapName = "";
      this.FControlAlign = $mod.TTMSFNCDataGridCellControlAlign.gcaNone;
      this.FControlPosition = $mod.TTMSFNCDataGridCellControlPosition.gcpCenterRight;
      this.FControlText = "";
      this.FControlWidth = -1;
      this.FControlHeight = -1;
      this.FComment = "";
      this.FRadioGroupIndex = 0;
      this.FMergeInfo.$assign($mod.DefaultMergeInfo());
      this.FLayoutPersistence = 0;
      this.FBitmapAspectRatio = true;
      this.FBitmapCropped = false;
      this.FBitmapStretched = false;
      this.FBitmapCentered = true;
      return this;
    };
    this.Destroy = function () {
      if (this.FControl != null) this.FControl.SetParent(null);
      this.FControl = null;
      this.FObject = null;
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FControlMargins;
        }, set: function (v) {
          this.p.FControlMargins = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FBitmap;
        }, set: function (v) {
          this.p.FBitmap = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FManagedObject;
        }, set: function (v) {
          this.p.FManagedObject = v;
        }});
      this.DestroyRenderer();
      this.DestroyLayout();
      this.DestroyFilterEditor();
      $mod.TTMSFNCDataGridCellItem.Destroy.call(this);
    };
    var E_NOINTERFACE = 0x80004002;
    this.QueryInterface = function (IID, Obj) {
      var Result = 0;
      if (this.GetInterface(IID,Obj)) {
        Result = 0}
       else Result = -2147467262;
      return Result;
    };
    this.Clear = function () {
      $mod.TTMSFNCDataGridCellItem.Clear.call(this);
      if (this.FControl != null) this.FControl.SetParent(null);
      this.FControl = null;
      this.FObject = null;
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FControlMargins;
        }, set: function (v) {
          this.p.FControlMargins = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FBitmap;
        }, set: function (v) {
          this.p.FBitmap = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FManagedObject;
        }, set: function (v) {
          this.p.FManagedObject = v;
        }});
      this.DestroyRenderer();
      this.DestroyLayout();
      this.DestroyFilterEditor();
      this.FReadOnly = false;
      this.FBitmapAspectRatio = true;
      this.FBitmapCropped = false;
      this.FBitmapStretched = false;
      this.FBitmapCentered = true;
      this.FType = $mod.TTMSFNCDataGridCellItemType.gcitNormal;
      this.FBitmapName = "";
      this.FControlAlign = $mod.TTMSFNCDataGridCellControlAlign.gcaNone;
      this.FControlPosition = $mod.TTMSFNCDataGridCellControlPosition.gcpCenterRight;
      this.FControlText = "";
      this.FControlWidth = -1;
      this.FControlHeight = -1;
      this.FComment = "";
      this.FRadioGroupIndex = 0;
      this.FMergeInfo.$assign($mod.DefaultMergeInfo());
      this.FLayoutPersistence = 0;
    };
    this.HasMergeInfo = function () {
      var Result = false;
      Result = (this.FMergeInfo.ColumnOffset > -1) && (this.FMergeInfo.RowOffset > -1) && (this.FMergeInfo.ColumnSpan > 0) && (this.FMergeInfo.RowSpan > 0);
      return Result;
    };
    this.Assign = function (Source) {
      var o = null;
      $mod.TTMSFNCDataGridCellItem.Assign.apply(this,arguments);
      if ($mod.TTMSFNCDataGridCellItemExtended.isPrototypeOf(Source)) {
        this.FObject = rtl.as(Source,$mod.TTMSFNCDataGridCellItemExtended).FObject;
        this.FIntegerValue = rtl.as(Source,$mod.TTMSFNCDataGridCellItemExtended).FIntegerValue;
        this.FBooleanValue = rtl.as(Source,$mod.TTMSFNCDataGridCellItemExtended).FBooleanValue;
        this.FControl = rtl.as(Source,$mod.TTMSFNCDataGridCellItemExtended).FControl;
        this.FControlAlign = rtl.as(Source,$mod.TTMSFNCDataGridCellItemExtended).FControlAlign;
        this.FControlPosition = rtl.as(Source,$mod.TTMSFNCDataGridCellItemExtended).FControlPosition;
        this.FControlText = rtl.as(Source,$mod.TTMSFNCDataGridCellItemExtended).FControlText;
        this.FControlWidth = rtl.as(Source,$mod.TTMSFNCDataGridCellItemExtended).FControlWidth;
        this.FControlHeight = rtl.as(Source,$mod.TTMSFNCDataGridCellItemExtended).FControlHeight;
        if (rtl.as(Source,$mod.TTMSFNCDataGridCellItemExtended).FLayout != null) {
          this.DestroyLayout();
          this.FLayout = $mod.TTMSFNCDataGridCellLayout.$create("Create$1",[16777215]);
          this.FLayout.Assign(rtl.as(Source,$mod.TTMSFNCDataGridCellItemExtended).FLayout);
        };
        if (rtl.as(Source,$mod.TTMSFNCDataGridCellItemExtended).FFilterEditor != null) {
          this.DestroyFilterEditor();
          this.FFilterEditor = rtl.as(Source,$mod.TTMSFNCDataGridCellItemExtended).FFilterEditor;
          rtl.as(Source,$mod.TTMSFNCDataGridCellItemExtended).FFilterEditor = null;
        };
        if (rtl.as(Source,$mod.TTMSFNCDataGridCellItemExtended).FRenderer != null) {
          o = rtl.as(Source,$mod.TTMSFNCDataGridCellItemExtended).FRenderer;
          if (pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridRenderer.isPrototypeOf(o)) {
            this.DestroyRenderer();
            this.FRenderer = pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridRenderer.$create("Create$3",[this.FHost]);
            rtl.as(this.FRenderer,pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridRenderer).Assign(rtl.as(o,pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridRenderer));
          };
        };
        this.FMergeInfo.$assign(rtl.as(Source,$mod.TTMSFNCDataGridCellItemExtended).FMergeInfo);
        this.FReadOnly = rtl.as(Source,$mod.TTMSFNCDataGridCellItemExtended).FReadOnly;
        this.FType = rtl.as(Source,$mod.TTMSFNCDataGridCellItemExtended).FType;
        this.FComment = rtl.as(Source,$mod.TTMSFNCDataGridCellItemExtended).FComment;
        if (rtl.as(Source,$mod.TTMSFNCDataGridCellItemExtended).FBitmap != null) this.GetBitmap().Assign(rtl.as(Source,$mod.TTMSFNCDataGridCellItemExtended).FBitmap);
        this.FBitmapName = rtl.as(Source,$mod.TTMSFNCDataGridCellItemExtended).FBitmapName;
        this.FRadioGroupIndex = rtl.as(Source,$mod.TTMSFNCDataGridCellItemExtended).FRadioGroupIndex;
        if (rtl.as(Source,$mod.TTMSFNCDataGridCellItemExtended).FControlMargins != null) this.GetControlMargins().Assign(rtl.as(Source,$mod.TTMSFNCDataGridCellItemExtended).FControlMargins);
        this.FBitmapAspectRatio = rtl.as(Source,$mod.TTMSFNCDataGridCellItemExtended).FBitmapAspectRatio;
        this.FBitmapStretched = rtl.as(Source,$mod.TTMSFNCDataGridCellItemExtended).FBitmapStretched;
        this.FBitmapCentered = rtl.as(Source,$mod.TTMSFNCDataGridCellItemExtended).FBitmapCentered;
        this.FBitmapCropped = rtl.as(Source,$mod.TTMSFNCDataGridCellItemExtended).FBitmapCropped;
      };
    };
    rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCCustomReadWriteIO);
    var $r = this.$rtti;
    $r.addProperty("Type",0,$mod.$rtti["TTMSFNCDataGridCellItemType"],"FType","FType",4,{Default: $mod.TTMSFNCDataGridCellItemType.gcitNormal});
    $r.addProperty("Bitmap",1,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCBitmap"],"GetBitmap","");
    $r.addProperty("BitmapName",0,rtl.string,"FBitmapName","FBitmapName");
    $r.addProperty("BitmapAspectRatio",0,rtl.boolean,"FBitmapAspectRatio","FBitmapAspectRatio",4,{Default: true});
    $r.addProperty("BitmapCropped",0,rtl.boolean,"FBitmapCropped","FBitmapCropped",4,{Default: false});
    $r.addProperty("BitmapCentered",0,rtl.boolean,"FBitmapCentered","FBitmapCentered",4,{Default: true});
    $r.addProperty("BitmapStretched",0,rtl.boolean,"FBitmapStretched","FBitmapStretched",4,{Default: false});
    $r.addProperty("BooleanValue",0,rtl.boolean,"FBooleanValue","FBooleanValue");
    $r.addProperty("ColumnOffset",3,rtl.longint,"GetColumnOffset","SetColumnOffset");
    $r.addProperty("ColumnSpan",3,rtl.longint,"GetColumnSpan","SetColumnSpan");
    $r.addProperty("Comment",0,rtl.string,"FComment","FComment");
    $r.addProperty("ControlAlign",0,$mod.$rtti["TTMSFNCDataGridCellControlAlign"],"FControlAlign","FControlAlign",4,{Default: $mod.TTMSFNCDataGridCellControlAlign.gcaNone});
    $r.addProperty("ControlHeight",0,rtl.longint,"FControlHeight","FControlHeight",4,{Default: -1});
    $r.addProperty("ControlMargins",1,pas["WEBLib.TMSFNCTypes"].$rtti["TTMSFNCMargins"],"GetControlMargins","");
    $r.addProperty("ControlPosition",0,$mod.$rtti["TTMSFNCDataGridCellControlPosition"],"FControlPosition","FControlPosition",4,{Default: $mod.TTMSFNCDataGridCellControlPosition.gcpCenterRight});
    $r.addProperty("ControlText",0,rtl.string,"FControlText","FControlText");
    $r.addProperty("ControlWidth",0,rtl.longint,"FControlWidth","FControlWidth",4,{Default: -1});
    $r.addProperty("Hint",0,rtl.string,"FHint","FHint");
    $r.addProperty("IntegerValue",0,rtl.longint,"FIntegerValue","FIntegerValue");
    $r.addProperty("RadioGroupIndex",0,rtl.longint,"FRadioGroupIndex","FRadioGroupIndex",4,{Default: 0});
    $r.addProperty("ReadOnly",0,rtl.boolean,"FReadOnly","FReadOnly",4,{Default: false});
    $r.addProperty("RowOffset",3,rtl.longint,"GetRowOffset","SetRowOffset");
    $r.addProperty("RowSpan",3,rtl.longint,"GetRowSpan","SetRowSpan");
    $r.addProperty("LayoutPersistence",0,rtl.longint,"FLayoutPersistence","FLayoutPersistence",4,{Default: 0});
  });
  rtl.createHelper(this,"TTMSFNCDataGridCellItemHelper",null,function () {
    this.GetAsExtended = function () {
      var Result = null;
      Result = rtl.as(this,$mod.TTMSFNCDataGridCellItemExtended);
      return Result;
    };
    this.GetIsExtended = function () {
      var Result = false;
      Result = $mod.TTMSFNCDataGridCellItemExtended.isPrototypeOf(this);
      return Result;
    };
  });
  this.TTMSFNCDataGridKeyKind = {"0": "gkkNone", gkkNone: 0, "1": "gkkDown", gkkDown: 1, "2": "gkkUp", gkkUp: 2, "3": "gkkDialog", gkkDialog: 3, "4": "gkkPress", gkkPress: 4};
  this.$rtti.$Enum("TTMSFNCDataGridKeyKind",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TTMSFNCDataGridKeyKind});
  rtl.recNewT(this,"TTMSFNCDataGridKeyInfo",function () {
    this.Blocked = false;
    this.Handled = false;
    this.Key = 0;
    this.KeyChar = "\x00";
    this.Kind = 0;
    this.$new = function () {
      var r = Object.create(this);
      r.Shift = {};
      return r;
    };
    this.$eq = function (b) {
      return (this.Blocked === b.Blocked) && (this.Handled === b.Handled) && (this.Key === b.Key) && (this.KeyChar === b.KeyChar) && (this.Kind === b.Kind) && rtl.eqSet(this.Shift,b.Shift);
    };
    this.$assign = function (s) {
      this.Blocked = s.Blocked;
      this.Handled = s.Handled;
      this.Key = s.Key;
      this.KeyChar = s.KeyChar;
      this.Kind = s.Kind;
      this.Shift = rtl.refSet(s.Shift);
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCDataGridKeyInfo",{},this);
    $r.addField("Blocked",rtl.boolean);
    $r.addField("Handled",rtl.boolean);
    $r.addField("Key",rtl.word);
    $r.addField("KeyChar",rtl.char);
    $r.addField("Kind",$mod.$rtti["TTMSFNCDataGridKeyKind"]);
    $r.addField("Shift",pas.Classes.$rtti["TShiftState"]);
  });
  this.TTMSFNCDataGridMouseKind = {"0": "gmkNone", gmkNone: 0, "1": "gmkDown", gmkDown: 1, "2": "gmkMove", gmkMove: 2, "3": "gmkUp", gmkUp: 3, "4": "gmkWheel", gmkWheel: 4, "5": "gmkEnter", gmkEnter: 5, "6": "gmkLeave", gmkLeave: 6, "7": "gmkDouble", gmkDouble: 7, "8": "gmkDragOver", gmkDragOver: 8, "9": "gmkDragDrop", gmkDragDrop: 9};
  this.$rtti.$Enum("TTMSFNCDataGridMouseKind",{minvalue: 0, maxvalue: 9, ordtype: 1, enumtype: this.TTMSFNCDataGridMouseKind});
  rtl.recNewT(this,"TTMSFNCDataGridMouseInfo",function () {
    this.Blocked = false;
    this.Button = 0;
    this.Cursor = 0;
    this.Handled = false;
    this.Kind = 0;
    this.WheelDelta = 0;
    this.X = 0.0;
    this.Y = 0.0;
    this.$new = function () {
      var r = Object.create(this);
      r.Shift = {};
      return r;
    };
    this.$eq = function (b) {
      return (this.Blocked === b.Blocked) && (this.Button === b.Button) && (this.Cursor === b.Cursor) && (this.Handled === b.Handled) && (this.Kind === b.Kind) && rtl.eqSet(this.Shift,b.Shift) && (this.WheelDelta === b.WheelDelta) && (this.X === b.X) && (this.Y === b.Y);
    };
    this.$assign = function (s) {
      this.Blocked = s.Blocked;
      this.Button = s.Button;
      this.Cursor = s.Cursor;
      this.Handled = s.Handled;
      this.Kind = s.Kind;
      this.Shift = rtl.refSet(s.Shift);
      this.WheelDelta = s.WheelDelta;
      this.X = s.X;
      this.Y = s.Y;
      return this;
    };
    var $r = $mod.$rtti.$Record("TTMSFNCDataGridMouseInfo",{},this);
    $r.addField("Blocked",rtl.boolean);
    $r.addField("Button",pas["WEBLib.Controls"].$rtti["TMouseButton"]);
    $r.addField("Cursor",pas["WEBLib.Controls"].$rtti["TCursor"]);
    $r.addField("Handled",rtl.boolean);
    $r.addField("Kind",$mod.$rtti["TTMSFNCDataGridMouseKind"]);
    $r.addField("Shift",pas.Classes.$rtti["TShiftState"]);
    $r.addField("WheelDelta",rtl.longint);
    $r.addField("X",rtl.double);
    $r.addField("Y",rtl.double);
  });
  this.TTMSFNCDataGridCellDrawElement = {"0": "gcdFill", gcdFill: 0, "1": "gcdStroke", gcdStroke: 1, "2": "gcdText", gcdText: 2, "3": "gcdControl", gcdControl: 3, "4": "gcdNodeIcon", gcdNodeIcon: 4, "5": "gcdSortIndicator", gcdSortIndicator: 5, "6": "gcdFilterButton", gcdFilterButton: 6, "7": "gcdCommentIndicator", gcdCommentIndicator: 7};
  this.$rtti.$Enum("TTMSFNCDataGridCellDrawElement",{minvalue: 0, maxvalue: 7, ordtype: 1, enumtype: this.TTMSFNCDataGridCellDrawElement});
  this.$rtti.$Set("TTMSFNCDataGridCellDrawElements",{comptype: this.$rtti["TTMSFNCDataGridCellDrawElement"]});
  this.TTMSFNCDataGridCellSortIndicator = {"0": "gsiNone", gsiNone: 0, "1": "gsiAscending", gsiAscending: 1, "2": "gsiDescending", gsiDescending: 2};
  this.$rtti.$Enum("TTMSFNCDataGridCellSortIndicator",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCDataGridCellSortIndicator});
  rtl.createClass(this,"TTMSFNCDataGridCellControlWrapper",pas["WEBLib.Controls"].TCustomControl,function () {
    this.EnterChildren = function (AObject) {
      var Result = false;
      rtl._AddRef(AObject);
      try {
        Result = pas["WEBLib.Controls"].TControl.EnterChildren.call(this,AObject);
        if (this.FOnEnter != null) this.FOnEnter(this);
      } finally {
        rtl._Release(AObject);
      };
      return Result;
    };
    this.ExitChildren = function (AObject) {
      var Result = false;
      rtl._AddRef(AObject);
      try {
        Result = pas["WEBLib.Controls"].TControl.ExitChildren.call(this,AObject);
        if (this.FOnExit != null) this.FOnExit(this);
      } finally {
        rtl._Release(AObject);
      };
      return Result;
    };
    this.CreateElement = function () {
      var Result = null;
      Result = document.createElement("SPAN");
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCDataGridCellControlInfo",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FCaption = "";
      this.FFocused = false;
      this.FHeight = 0.0;
      this.FTag = 0;
      this.FText = "";
      this.FType = null;
      this.FWidth = 0.0;
    };
    this.$final = function () {
      this.FType = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function () {
      this.FType = null;
      this.FWidth = 0;
      this.FHeight = 0;
      this.FText = "";
      this.FCaption = "";
      this.FTag = 0;
      return this;
    };
    this.Compare = function (AInfo) {
      var Result = false;
      Result = (this.FType === AInfo.FType) && (this.FWidth === AInfo.FWidth) && (this.FHeight === AInfo.FHeight) && (this.FText === AInfo.FText) && (this.FCaption === AInfo.FCaption) && (this.FFocused === AInfo.FFocused) && (this.FTag === AInfo.FTag);
      return Result;
    };
    this.CopyInstance = function () {
      var Result = null;
      Result = $mod.TTMSFNCDataGridCellControlInfo.$create("Create$1");
      Result.Assign(this);
      return Result;
    };
    this.Assign = function (Source) {
      if ($mod.TTMSFNCDataGridCellControlInfo.isPrototypeOf(Source)) {
        this.FType = rtl.as(Source,$mod.TTMSFNCDataGridCellControlInfo).FType;
        this.FWidth = rtl.as(Source,$mod.TTMSFNCDataGridCellControlInfo).FWidth;
        this.FHeight = rtl.as(Source,$mod.TTMSFNCDataGridCellControlInfo).FHeight;
        this.FText = rtl.as(Source,$mod.TTMSFNCDataGridCellControlInfo).FText;
        this.FCaption = rtl.as(Source,$mod.TTMSFNCDataGridCellControlInfo).FCaption;
        this.FFocused = rtl.as(Source,$mod.TTMSFNCDataGridCellControlInfo).FFocused;
        this.FTag = rtl.as(Source,$mod.TTMSFNCDataGridCellControlInfo).FTag;
      };
    };
  });
  this.$rtti.$ClassRef("TTMSFNCDataGridCellControlInfoClass",{instancetype: this.$rtti["TTMSFNCDataGridCellControlInfo"]});
  rtl.createClass(this,"TTMSFNCDataGridCellControlCache",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FInfo = null;
      this.FBitmap = null;
    };
    this.$final = function () {
      this.FInfo = undefined;
      this.FBitmap = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.GetBitmap = function () {
      var Result = null;
      if (!(this.FBitmap != null)) this.FBitmap = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
      Result = this.FBitmap;
      return Result;
    };
    this.Create$1 = function (AInfo, ABitmap) {
      this.FInfo = AInfo.CopyInstance();
      this.GetBitmap().Assign(ABitmap);
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FBitmap;
        }, set: function (v) {
          this.p.FBitmap = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FInfo;
        }, set: function (v) {
          this.p.FInfo = v;
        }});
      pas.System.TObject.Destroy.call(this);
    };
  });
  rtl.createClass(this,"TTMSFNCDataGridCellControlCacheList",pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache,function () {
    this.GetCacheItem = function (AControlCacheInfo) {
      var Result = null;
      var I = 0;
      Result = null;
      for (var $l = 0, $end = this.FLength - 1; $l <= $end; $l++) {
        I = $l;
        if ((this.GetItem(I).FInfo != null) && this.GetItem(I).FInfo.Compare(AControlCacheInfo)) {
          Result = this.GetItem(I);
          break;
        };
      };
      return Result;
    };
    this.RemoveItem$1 = function (AControlCacheInfo) {
      var I = 0;
      for (var $l = this.FLength - 1; $l >= 0; $l--) {
        I = $l;
        if ((this.GetItem(I).FInfo != null) && this.GetItem(I).FInfo.Compare(AControlCacheInfo)) {
          this.Delete(I);
          break;
        };
      };
    };
  });
  this.FullElements = rtl.createSet(this.TTMSFNCDataGridCellDrawElement.gcdFill,this.TTMSFNCDataGridCellDrawElement.gcdStroke,this.TTMSFNCDataGridCellDrawElement.gcdText,this.TTMSFNCDataGridCellDrawElement.gcdControl,this.TTMSFNCDataGridCellDrawElement.gcdNodeIcon,this.TTMSFNCDataGridCellDrawElement.gcdSortIndicator,this.TTMSFNCDataGridCellDrawElement.gcdFilterButton,this.TTMSFNCDataGridCellDrawElement.gcdCommentIndicator);
  this.EditingElements = rtl.createSet(this.TTMSFNCDataGridCellDrawElement.gcdControl,this.TTMSFNCDataGridCellDrawElement.gcdSortIndicator,this.TTMSFNCDataGridCellDrawElement.gcdNodeIcon,this.TTMSFNCDataGridCellDrawElement.gcdFilterButton,this.TTMSFNCDataGridCellDrawElement.gcdCommentIndicator);
  this.ExportElements = rtl.createSet(this.TTMSFNCDataGridCellDrawElement.gcdFill,this.TTMSFNCDataGridCellDrawElement.gcdStroke,this.TTMSFNCDataGridCellDrawElement.gcdText,this.TTMSFNCDataGridCellDrawElement.gcdControl);
  this.$rtti.$MethodVar("TTMSFNCDataGridCellBeforeDrawEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]],["ACanDraw",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TTMSFNCDataGridCellAfterDrawEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AGraphics",pas["WEBLib.TMSFNCGraphics"].$rtti["TTMSFNCGraphics"]]]), methodkind: 0});
  rtl.createClass(this,"TTMSFNCDataGridCell",pas.System.TObject,function () {
    this.FControlCacheList = null;
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FBitmapContainer = null;
      this.FCalcRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FClipRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FColumn = 0;
      this.FComment = "";
      this.FCommentIndicator = false;
      this.FCommentIndicatorColor = 0;
      this.FControl = null;
      this.FControlActive = false;
      this.FControlAlign = 0;
      this.FControlCache = null;
      this.FControlInfo = null;
      this.FControlMargins = null;
      this.FControlPosition = 0;
      this.FControlRef = null;
      this.FControlWrapper = null;
      this.FData = null;
      this.FDownOnFilterButton = false;
      this.FDownOnComment = false;
      this.FDrawElements = {};
      this.FFilterButton = false;
      this.FFilterIcon = null;
      this.FIsExporting = false;
      this.FKind = 0;
      this.FLayout = null;
      this.FOnAfterDraw = null;
      this.FOnBeforeDraw = null;
      this.FOnCommentIndicatorClick = null;
      this.FOnFilterButtonClick = null;
      this.FRect = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      this.FRoot = null;
      this.FRow = 0;
      this.FScale = 0.0;
      this.FSortAscendingIcon = null;
      this.FSortDescendingIcon = null;
      this.FSortIndicator = 0;
      this.FControlClipping = false;
    };
    this.$final = function () {
      this.FBitmapContainer = undefined;
      this.FCalcRect = undefined;
      this.FClipRect = undefined;
      this.FControl = undefined;
      this.FControlCache = undefined;
      this.FControlInfo = undefined;
      this.FControlMargins = undefined;
      this.FControlRef = undefined;
      this.FControlWrapper = undefined;
      this.FData = undefined;
      this.FDrawElements = undefined;
      this.FFilterIcon = undefined;
      this.FLayout = undefined;
      this.FOnAfterDraw = undefined;
      this.FOnBeforeDraw = undefined;
      this.FOnCommentIndicatorClick = undefined;
      this.FOnFilterButtonClick = undefined;
      this.FRect = undefined;
      this.FRoot = undefined;
      this.FSortAscendingIcon = undefined;
      this.FSortDescendingIcon = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.GetBottom = function () {
      var Result = 0.0;
      Result = this.FRect.Bottom;
      return Result;
    };
    this.GetControlInfo = function () {
      var Result = null;
      if (!(this.FControlInfo != null)) this.FControlInfo = this.GetControlInfoClass().$create("Create$1");
      Result = this.FControlInfo;
      this.RetrieveControlInfo(Result);
      return Result;
    };
    this.GetControlMargins = function () {
      var Result = null;
      if (!(this.FControlMargins != null)) this.FControlMargins = pas["WEBLib.TMSFNCTypes"].TTMSFNCMargins.$create("Create$1");
      Result = this.FControlMargins;
      return Result;
    };
    this.GetControlWrapper = function () {
      var Result = null;
      var rd = null;
      if (!(this.FControlWrapper != null) && (this.FRoot != null) && pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridRenderer.isPrototypeOf(this.FRoot)) {
        rd = rtl.as(this.FRoot,pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridRenderer);
        rd.GetControlWrapperList().TryGetValue(this.GetCoordinate().GetToString(),{p: this, get: function () {
            return this.p.FControlWrapper;
          }, set: function (v) {
            this.p.FControlWrapper = v;
          }});
      };
      if (!(this.FControlWrapper != null)) {
        this.FControlWrapper = $mod.TTMSFNCDataGridCellControlWrapper.$create("Create$1",[null]);
        this.FControlWrapper.FOnEnter = rtl.createCallback(this,"DoControlWrapperEnter");
        this.FControlWrapper.FOnExit = rtl.createCallback(this,"DoControlWrapperExit");
      };
      Result = this.FControlWrapper;
      return Result;
    };
    this.GetControlRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign(this.GetControlRectInternal(true));
      return Result;
    };
    this.GetCoordinate = function () {
      var Result = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$new();
      Result.$assign(pas["WEBLib.TMSFNCDataGridCore"].MakeCell(this.FColumn,this.FRow));
      return Result;
    };
    this.GetHeight = function () {
      var Result = 0.0;
      Result = this.FRect.Bottom - this.FRect.Top;
      return Result;
    };
    this.GetLayout = function () {
      var Result = null;
      if (!(this.FLayout != null)) this.FLayout = $mod.TTMSFNCDataGridCellLayout.$create("Create$1",[16777215]);
      Result = this.FLayout;
      return Result;
    };
    this.GetLeft = function () {
      var Result = 0.0;
      Result = this.FRect.Left;
      return Result;
    };
    this.GetRight = function () {
      var Result = 0.0;
      Result = this.FRect.Right;
      return Result;
    };
    this.GetScale = function () {
      var Result = 0.0;
      Result = this.FScale;
      return Result;
    };
    this.GetText = function () {
      var Result = "";
      Result = this.GetDisplayValue();
      return Result;
    };
    this.GetTop = function () {
      var Result = 0.0;
      Result = this.FRect.Top;
      return Result;
    };
    this.GetWidth = function () {
      var Result = 0.0;
      Result = this.FRect.Right - this.FRect.Left;
      return Result;
    };
    this.SetControlMargins = function (Value) {
      if (this.FControlMargins != null) this.FControlMargins.Assign(Value);
    };
    this.CreateControl = function () {
      var Result = null;
      Result = null;
      return Result;
    };
    this.CreateControlCache = function () {
      var Result = null;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rd = null;
      var p = null;
      var hp = false;
      var cf = null;
      var crc = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var cr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var ci = null;
      var cif = null;
      Result = null;
      if (this.IsControlAssigned() && this.UsesControl() && (this.FRoot != null) && pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridRenderer.isPrototypeOf(this.FRoot)) {
        rd = rtl.as(this.FRoot,pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridRenderer);
        p = rd.GetParentHost();
        if (this.SupportsRealControl()) {
          if ((p != null) && (this.GetControlWrapper() != null)) {
            p.IncUpdateCount();
            this.GetControl().SetParent(this.GetControlWrapper());
            this.GetControlWrapper().SetParent(p);
            r.$assign(this.GetControlRectInternal(this.SupportsRealControl()));
            crc.$assign(this.GetControlClipRect());
            cr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Math.max(crc.Left,r.Left),Math.max(crc.Top,r.Top),Math.min(crc.Right,r.Right),Math.min(crc.Bottom,r.Bottom)));
            this.GetControlWrapper().SetBounds(Math.round(cr.Left),Math.round(cr.Top),Math.round(cr.Right - cr.Left),Math.round(cr.Bottom - cr.Top));
            this.GetControl().SetBounds(Math.round(r.Left - cr.Left),Math.round(r.Top - cr.Top),Math.round(r.Right - r.Left),Math.round(r.Bottom - r.Top));
            this.ApplyControlProperties();
            p.DecUpdateCount();
          };
        } else {
          pas.SysUtils.FreeAndNil({p: this, get: function () {
              return this.p.FControlCache;
            }, set: function (v) {
              this.p.FControlCache = v;
            }});
          if (p != null) {
            p.IncUpdateCount();
            hp = this.GetControl().FParent != null;
            if (!hp) {
              if (pas["WEBLib.Forms"].TCustomForm.isPrototypeOf(p)) {
                cf = rtl.as(p,pas["WEBLib.Forms"].TCustomForm)}
               else if (pas["WEBLib.Forms"].TCustomForm.isPrototypeOf(p.FOwner)) {
                cf = rtl.as(p.FOwner,pas["WEBLib.Forms"].TCustomForm)}
               else cf = pas["WEBLib.TMSFNCUtils"].TTMSFNCUtils.GetOwnerForm(p.FOwner);
              if (cf != null) this.GetControl().SetParent(cf);
              r.$assign(this.GetControlRectInternal(this.SupportsRealControl()));
              this.GetControl().SetBounds(-10000,-10000,Math.round(r.Right - r.Left),Math.round(r.Bottom - r.Top));
            };
            if (!hp) {
              this.ApplyControlProperties();
            };
            this.FControlCache = this.GetControlBitmap();
            cif = this.GetControlInfo();
            ci = this.FControlCacheList.GetCacheItem(cif);
            if (ci != null) {
              ci.GetBitmap().Assign(this.FControlCache)}
             else this.FControlCacheList.Add($mod.TTMSFNCDataGridCellControlCache.$create("Create$1",[cif,this.FControlCache]));
            if (!hp) this.GetControl().SetParent(null);
            Result = this.FControlCache;
            p.DecUpdateCount();
          };
        };
      };
      return Result;
    };
    this.GetActualTextRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var g = null;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var tr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var s = "";
      Result.$assign(pas["WEBLib.TMSFNCTypes"].EmptyRect());
      r.$assign(this.GetTextRect());
      g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[1,1,false,true]);
      try {
        g.GetContext().BeginScene();
        g.SetFont(this.GetLayout().FFont);
        s = this.GetText();
        if (s === "") s = "gh";
        tr.$assign(g.CalculateText(s,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.GetLayout().FWordWrapping,true));
        tr.Left = r.Left;
        tr.Right = r.Right;
        var $tmp = this.GetLayout().FTextAlign;
        if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter) {
          var $tmp1 = this.GetLayout().FVerticalTextAlign;
          if ($tmp1 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter) {
            tr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + ((r.Right - r.Left - (tr.Right - tr.Left)) / 2),r.Top + ((r.Bottom - r.Top - (tr.Bottom - tr.Top)) / 2),r.Left + ((r.Right - r.Left - (tr.Right - tr.Left)) / 2) + (tr.Right - tr.Left),r.Top + ((r.Bottom - r.Top - (tr.Bottom - tr.Top)) / 2) + (tr.Bottom - tr.Top)))}
           else if ($tmp1 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading) {
            tr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + ((r.Right - r.Left - (tr.Right - tr.Left)) / 2),r.Top,r.Left + ((r.Right - r.Left - (tr.Right - tr.Left)) / 2) + (tr.Right - tr.Left),r.Top + (tr.Bottom - tr.Top)))}
           else if ($tmp1 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaTrailing) tr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + ((r.Right - r.Left - (tr.Right - tr.Left)) / 2),r.Bottom - (tr.Bottom - tr.Top),r.Left + ((r.Right - r.Left - (tr.Right - tr.Left)) / 2) + (tr.Right - tr.Left),r.Bottom));
        } else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading) {
          var $tmp2 = this.GetLayout().FVerticalTextAlign;
          if ($tmp2 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter) {
            tr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top + ((r.Bottom - r.Top - (tr.Bottom - tr.Top)) / 2),r.Left + (tr.Right - tr.Left),r.Top + ((r.Bottom - r.Top - (tr.Bottom - tr.Top)) / 2) + (tr.Bottom - tr.Top)))}
           else if ($tmp2 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading) {
            tr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top,r.Left + (tr.Right - tr.Left),r.Top + (tr.Bottom - tr.Top)))}
           else if ($tmp2 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaTrailing) tr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Bottom - (tr.Bottom - tr.Top),r.Left + (tr.Right - tr.Left),r.Bottom));
        } else if ($tmp === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaTrailing) {
          var $tmp3 = this.GetLayout().FVerticalTextAlign;
          if ($tmp3 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaCenter) {
            tr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Right - (tr.Right - tr.Left),r.Top + ((r.Bottom - r.Top - (tr.Bottom - tr.Top)) / 2),r.Right,r.Top + ((r.Bottom - r.Top - (tr.Bottom - tr.Top)) / 2) + (tr.Bottom - tr.Top)))}
           else if ($tmp3 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaLeading) {
            tr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Right - (tr.Right - tr.Left),r.Top,r.Right,r.Top + (tr.Bottom - tr.Top)))}
           else if ($tmp3 === pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextAlign.gtaTrailing) tr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Right - (tr.Right - tr.Left),r.Bottom - (tr.Bottom - tr.Top),r.Right,r.Bottom));
        };
        Result.$assign(tr);
        Result.Top = Math.max(r.Top,Result.Top);
        Result.Left = Math.max(r.Left,Result.Left);
        Result.Right = r.Right;
        Result.Bottom = r.Bottom;
        g.GetContext().EndScene();
      } finally {
        g = rtl.freeLoc(g);
      };
      return Result;
    };
    this.GetCommentIndicatorRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var sz = 0.0;
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,0,0));
      if (this.FCommentIndicator && ($mod.TTMSFNCDataGridCellDrawElement.gcdCommentIndicator in this.FDrawElements)) {
        sz = this.GetCommentIndicatorSize();
        Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.FRect.Right - sz - 1,this.FRect.Top + 1,this.FRect.Right - 1,this.FRect.Top + sz + 1));
      };
      return Result;
    };
    this.GetCommentIndicatorSize = function () {
      var Result = 0.0;
      Result = 12 * this.FScale;
      return Result;
    };
    this.GetControl = function () {
      var Result = null;
      Result = null;
      if (this.FControl != null) {
        Result = this.FControl}
       else if (this.FControlRef != null) Result = this.FControlRef;
      return Result;
    };
    this.GetControlBitmap = function () {
      var Result = null;
      Result = this.GetControl().MakeScreenshot();
      return Result;
    };
    this.GetControlHeight = function () {
      var Result = 0.0;
      Result = 0;
      if (this.IsControlAssigned()) Result = this.GetControl().GetHeight();
      return Result;
    };
    this.GetControlInfoClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCDataGridCellControlInfo;
      return Result;
    };
    this.GetControlRectInternal = function (AApplySize) {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var cw = 0.0;
      var ch = 0.0;
      Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(0,0,0,0));
      if (this.IsControlAssigned() && ($mod.TTMSFNCDataGridCellDrawElement.gcdControl in this.FDrawElements)) {
        r.$assign(this.GetSortIndicatorRect());
        r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.FRect.Left,this.FRect.Top,r.Left,this.FRect.Bottom));
        if (AApplySize) {
          pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,-2 * this.FScale,-2 * this.FScale)}
         else pas["WEBLib.TMSFNCTypes"].InflateRectEx(r,-2,-2);
        cw = this.GetControlWidth();
        ch = this.GetControlHeight();
        if (AApplySize) {
          cw = Math.round(cw * this.FScale);
          ch = Math.round(ch * this.FScale);
        };
        var $tmp = this.FControlAlign;
        if ($tmp === $mod.TTMSFNCDataGridCellControlAlign.gcaNone) {
          var $tmp1 = this.FControlPosition;
          if ($tmp1 === $mod.TTMSFNCDataGridCellControlPosition.gcpTopLeft) {
            Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top,r.Left + cw,r.Top + ch))}
           else if ($tmp1 === $mod.TTMSFNCDataGridCellControlPosition.gcpTopCenter) {
            Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + ((r.Right - r.Left - cw) / 2),r.Top,r.Left + ((r.Right - r.Left - cw) / 2) + cw,r.Top + ch))}
           else if ($tmp1 === $mod.TTMSFNCDataGridCellControlPosition.gcpTopRight) {
            Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Right - cw,r.Top,r.Right,r.Top + ch))}
           else if ($tmp1 === $mod.TTMSFNCDataGridCellControlPosition.gcpCenterLeft) {
            Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top + ((r.Bottom - r.Top - ch) / 2),r.Left + cw,r.Top + ((r.Bottom - r.Top - ch) / 2) + ch))}
           else if ($tmp1 === $mod.TTMSFNCDataGridCellControlPosition.gcpCenterCenter) {
            Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + ((r.Right - r.Left - cw) / 2),r.Top + ((r.Bottom - r.Top - ch) / 2),r.Left + ((r.Right - r.Left - cw) / 2) + cw,r.Top + ((r.Bottom - r.Top - ch) / 2) + ch))}
           else if ($tmp1 === $mod.TTMSFNCDataGridCellControlPosition.gcpCenterRight) {
            Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Right - cw,r.Top + ((r.Bottom - r.Top - ch) / 2),r.Right,r.Top + ((r.Bottom - r.Top - ch) / 2) + ch))}
           else if ($tmp1 === $mod.TTMSFNCDataGridCellControlPosition.gcpBottomLeft) {
            Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Bottom - ch,r.Left + cw,r.Bottom))}
           else if ($tmp1 === $mod.TTMSFNCDataGridCellControlPosition.gcpBottomCenter) {
            Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left + ((r.Right - r.Left - cw) / 2),r.Bottom - ch,r.Left + ((r.Right - r.Left - cw) / 2) + cw,r.Bottom))}
           else if ($tmp1 === $mod.TTMSFNCDataGridCellControlPosition.gcpBottomRight) Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Right - cw,r.Bottom - ch,r.Right,r.Bottom));
        } else if ($tmp === $mod.TTMSFNCDataGridCellControlAlign.gcaClient) {
          Result.$assign(r);
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Result.Left + this.GetControlMargins().FLeft,Result.Top + this.GetControlMargins().FTop,Result.Right - this.GetControlMargins().FRight,Result.Bottom - this.GetControlMargins().FBottom));
        } else if ($tmp === $mod.TTMSFNCDataGridCellControlAlign.gcaLeft) {
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top,r.Left + cw,r.Bottom));
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Result.Left + this.GetControlMargins().FLeft,Result.Top + this.GetControlMargins().FTop,Result.Right + this.GetControlMargins().FLeft,Result.Bottom - this.GetControlMargins().FBottom));
        } else if ($tmp === $mod.TTMSFNCDataGridCellControlAlign.gcaTop) {
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top,r.Right,r.Top + ch));
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Result.Left + this.GetControlMargins().FLeft,Result.Top + this.GetControlMargins().FTop,Result.Right - this.GetControlMargins().FRight,Result.Bottom + this.GetControlMargins().FTop));
        } else if ($tmp === $mod.TTMSFNCDataGridCellControlAlign.gcaRight) {
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Right - cw,r.Top,r.Right,r.Bottom));
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Result.Left - this.GetControlMargins().FRight,Result.Top + this.GetControlMargins().FTop,Result.Right - this.GetControlMargins().FRight,Result.Bottom - this.GetControlMargins().FBottom));
        } else if ($tmp === $mod.TTMSFNCDataGridCellControlAlign.gcaBottom) {
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Bottom - ch,r.Right,r.Bottom));
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Result.Left + this.GetControlMargins().FLeft,Result.Top - this.GetControlMargins().FBottom,Result.Right - this.GetControlMargins().FRight,Result.Bottom - this.GetControlMargins().FBottom));
        };
        Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(pas.Math.Floor(Result.Left),pas.Math.Floor(Result.Top),pas.Math.Floor(Result.Right),pas.Math.Floor(Result.Bottom)));
      };
      return Result;
    };
    this.GetControlClipRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rd = null;
      Result.$assign(pas["WEBLib.TMSFNCTypes"].EmptyRect());
      if (this.FControlClipping) {
        Result.$assign(this.FClipRect)}
       else if ((this.FRoot != null) && pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridRenderer.isPrototypeOf(this.FRoot)) {
        rd = rtl.as(this.FRoot,pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridRenderer);
        Result.$assign(rd.GetContentRect());
        Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Result.Left + rd.FTotalFixedColumnWidth + 1,Result.Top + rd.FTotalFixedRowHeight + 1,Result.Right - rd.FTotalFixedRightColumnWidth - 1,Result.Bottom - rd.FTotalFixedBottomRowHeight - 1));
      };
      return Result;
    };
    this.GetControlWidth = function () {
      var Result = 0.0;
      Result = 0;
      if (this.IsControlAssigned()) Result = this.GetControl().GetWidth();
      return Result;
    };
    this.GetDisplayValue = function () {
      var Result = "";
      var d = null;
      Result = "";
      d = this.FData;
      if (d != null) Result = d.FDisplayValue;
      return Result;
    };
    this.GetDrawElements = function (AIsEditing) {
      var Result = {};
      if (this.FIsExporting) {
        Result = rtl.refSet($mod.ExportElements)}
       else {
        if (AIsEditing) {
          Result = rtl.refSet($mod.EditingElements)}
         else Result = rtl.refSet($mod.FullElements);
      };
      return Result;
    };
    this.GetFilterButtonRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var sz = 0.0;
      if (this.FFilterButton && ($mod.TTMSFNCDataGridCellDrawElement.gcdFilterButton in this.FDrawElements)) {
        sz = this.GetFilterButtonSize();
        Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.FRect.Right - sz - (4 * this.FScale),(this.FRect.Top + ((this.FRect.Bottom - this.FRect.Top) / 2)) - (sz / 2),this.FRect.Right - (2 * this.FScale),this.FRect.Top + ((this.FRect.Bottom - this.FRect.Top) / 2) + (sz / 2)));
      } else Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.FRect.Right,this.FRect.Top,this.FRect.Right,this.FRect.Bottom));
      return Result;
    };
    this.GetFilterButtonSize = function () {
      var Result = 0.0;
      Result = 16 * this.FScale;
      return Result;
    };
    this.GetRequiredSize = function (AGraphics) {
      var Result = pas["WEBLib.TMSFNCTypes"].TSizeF.$new();
      var cw = 0.0;
      var ch = 0.0;
      var sz = 0.0;
      var o = 0.0;
      Result.$assign(this.GetTextSize(AGraphics));
      o = 4 * this.FScale;
      if ((this.GetDisplayValue() !== "") && ($mod.TTMSFNCDataGridCellDrawElement.gcdText in this.FDrawElements)) {
        Result.cx = Result.cx + o;
        Result.cy = Result.cy + o;
      };
      if ((this.FSortIndicator !== $mod.TTMSFNCDataGridCellSortIndicator.gsiNone) && ($mod.TTMSFNCDataGridCellDrawElement.gcdSortIndicator in this.FDrawElements)) {
        sz = this.GetSortIndicatorSize();
        Result.cx = Result.cx + sz + o;
        Result.cy = Math.max(Result.cy,sz + o);
      };
      if (this.FFilterButton && ($mod.TTMSFNCDataGridCellDrawElement.gcdFilterButton in this.FDrawElements)) {
        sz = this.GetFilterButtonSize();
        Result.cx = Result.cx + sz + o;
        Result.cy = Math.max(Result.cy,sz + o);
      };
      if (this.IsControlAssigned() && ($mod.TTMSFNCDataGridCellDrawElement.gcdControl in this.FDrawElements)) {
        cw = this.GetControlWidth() * this.FScale;
        ch = this.GetControlHeight() * this.FScale;
        var $tmp = this.FControlAlign;
        if (($tmp === $mod.TTMSFNCDataGridCellControlAlign.gcaLeft) || ($tmp === $mod.TTMSFNCDataGridCellControlAlign.gcaRight)) {
          Result.cx = Result.cx + cw + o}
         else if (($tmp === $mod.TTMSFNCDataGridCellControlAlign.gcaTop) || ($tmp === $mod.TTMSFNCDataGridCellControlAlign.gcaBottom)) {
          Result.cy = Result.cy + ch + o}
         else if ($tmp === $mod.TTMSFNCDataGridCellControlAlign.gcaNone) {
          Result.cx = Math.max(Result.cx,cw + o);
          var $tmp1 = this.FControlPosition;
          if (($tmp1 === $mod.TTMSFNCDataGridCellControlPosition.gcpBottomLeft) || ($tmp1 === $mod.TTMSFNCDataGridCellControlPosition.gcpBottomCenter) || ($tmp1 === $mod.TTMSFNCDataGridCellControlPosition.gcpBottomRight) || ($tmp1 === $mod.TTMSFNCDataGridCellControlPosition.gcpTopLeft) || ($tmp1 === $mod.TTMSFNCDataGridCellControlPosition.gcpTopCenter) || ($tmp1 === $mod.TTMSFNCDataGridCellControlPosition.gcpTopRight)) {
            Result.cy = Result.cy + ch + o}
           else if (($tmp1 === $mod.TTMSFNCDataGridCellControlPosition.gcpCenterLeft) || ($tmp1 === $mod.TTMSFNCDataGridCellControlPosition.gcpCenterCenter) || ($tmp1 === $mod.TTMSFNCDataGridCellControlPosition.gcpCenterRight)) Result.cy = Math.max(Result.cy,ch + o);
        };
      };
      return Result;
    };
    this.GetSortIndicatorRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var sz = 0.0;
      Result.$assign(this.GetFilterButtonRect());
      if ((this.FSortIndicator !== $mod.TTMSFNCDataGridCellSortIndicator.gsiNone) && ($mod.TTMSFNCDataGridCellDrawElement.gcdSortIndicator in this.FDrawElements)) {
        sz = this.GetSortIndicatorSize();
        Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Result.Left - sz - (4 * this.FScale),(Result.Top + ((Result.Bottom - Result.Top) / 2)) - (sz / 2),Result.Left - (2 * this.FScale),Result.Top + ((Result.Bottom - Result.Top) / 2) + (sz / 2)));
      } else Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Result.Left,Result.Top,Result.Left,Result.Bottom));
      return Result;
    };
    this.GetSortIndicatorSize = function () {
      var Result = 0.0;
      Result = 16 * this.FScale;
      return Result;
    };
    this.GetTextRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rct = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var res = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.$assign(this.GetSortIndicatorRect());
      r.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.FRect.Left,this.FRect.Top,r.Left,this.FRect.Bottom));
      res.$assign(r);
      if (this.IsControlAssigned() && ($mod.TTMSFNCDataGridCellDrawElement.gcdControl in this.FDrawElements)) {
        rct.$assign(this.GetControlRectInternal(true));
        var $tmp = this.FControlAlign;
        if ($tmp === $mod.TTMSFNCDataGridCellControlAlign.gcaTop) {
          res.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,rct.Bottom,r.Right,r.Bottom))}
         else if ($tmp === $mod.TTMSFNCDataGridCellControlAlign.gcaBottom) {
          res.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top,r.Right,rct.Top))}
         else if ($tmp === $mod.TTMSFNCDataGridCellControlAlign.gcaLeft) {
          res.$assign(pas["WEBLib.TMSFNCTypes"].RectF(rct.Right,r.Top,r.Right,r.Bottom))}
         else if ($tmp === $mod.TTMSFNCDataGridCellControlAlign.gcaRight) {
          res.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top,rct.Left,r.Bottom))}
         else if ($tmp === $mod.TTMSFNCDataGridCellControlAlign.gcaNone) {
          var $tmp1 = this.FControlPosition;
          if (($tmp1 === $mod.TTMSFNCDataGridCellControlPosition.gcpTopLeft) || ($tmp1 === $mod.TTMSFNCDataGridCellControlPosition.gcpTopCenter) || ($tmp1 === $mod.TTMSFNCDataGridCellControlPosition.gcpTopRight)) {
            res.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,rct.Bottom,r.Right,r.Bottom))}
           else if ($tmp1 === $mod.TTMSFNCDataGridCellControlPosition.gcpCenterLeft) {
            res.$assign(pas["WEBLib.TMSFNCTypes"].RectF(rct.Right,r.Top,r.Right,r.Bottom))}
           else if ($tmp1 === $mod.TTMSFNCDataGridCellControlPosition.gcpCenterRight) {
            res.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top,rct.Left,r.Bottom))}
           else if (($tmp1 === $mod.TTMSFNCDataGridCellControlPosition.gcpBottomLeft) || ($tmp1 === $mod.TTMSFNCDataGridCellControlPosition.gcpBottomCenter) || ($tmp1 === $mod.TTMSFNCDataGridCellControlPosition.gcpBottomRight)) res.$assign(pas["WEBLib.TMSFNCTypes"].RectF(r.Left,r.Top,r.Right,rct.Top));
        };
      };
      pas["WEBLib.TMSFNCTypes"].InflateRectEx(res,-3 * this.FScale,-3 * this.FScale);
      Result.$assign(res);
      return Result;
    };
    this.GetTextSize = function (AGraphics) {
      var Result = pas["WEBLib.TMSFNCTypes"].TSizeF.$new();
      var str = "";
      var g = null;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var txtr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var w = 0.0;
      var h = 0.0;
      var c = 0.0;
      var s = 0.0;
      var cw = 0.0;
      var ch = 0.0;
      str = this.GetDisplayValue();
      Result.cx = 0;
      Result.cy = 0;
      if ((str !== "") && ($mod.TTMSFNCDataGridCellDrawElement.gcdText in this.FDrawElements)) {
        if (!(AGraphics != null)) {
          g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[1,1,false,true]);
          g.BeginScene();
        } else g = AGraphics;
        try {
          g.FBitmapContainer = this.FBitmapContainer;
          g.SetFont(this.GetLayout().FFont);
          r.$assign(this.GetTextRect());
          txtr.$assign(g.CalculateText(str,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),this.GetLayout().FWordWrapping,true));
          Result.cx = txtr.Right - txtr.Left;
          Result.cy = txtr.Bottom - txtr.Top;
          if (this.GetLayout().FTextAngle !== 0) {
            w = Result.cx;
            h = Result.cy;
            c = Math.cos(pas.Math.DegToRad(this.GetLayout().FTextAngle));
            s = Math.sin(pas.Math.DegToRad(this.GetLayout().FTextAngle));
            cw = Math.abs(w * c) + Math.abs(h * s);
            ch = Math.abs(w * s) + Math.abs(h * c);
            Result.cx = cw;
            Result.cy = ch;
          };
        } finally {
          if (!(AGraphics != null)) {
            g.EndScene();
            g = rtl.freeLoc(g);
          };
        };
      };
      return Result;
    };
    this.IsControlAssigned = function () {
      var Result = false;
      Result = this.GetControl() != null;
      return Result;
    };
    this.IsControlEnabled = function () {
      var Result = false;
      Result = this.IsControlAssigned() && this.GetControl().FEnabled;
      return Result;
    };
    this.SupportsRealControl = function () {
      var Result = false;
      if (this.FIsExporting) {
        Result = false}
       else {
        Result = true;
      };
      return Result;
    };
    this.UsesControl = function () {
      var Result = false;
      Result = true;
      return Result;
    };
    this.PrepareControl = function () {
      var b = null;
      var ci = null;
      if (this.IsControlAssigned() && this.UsesControl()) {
        if (!this.SupportsRealControl()) this.ApplyControlProperties();
        ci = this.FControlCacheList.GetCacheItem(this.GetControlInfo());
        if (ci != null) {
          b = ci.GetBitmap()}
         else b = this.FControlCache;
        if ((!this.SupportsRealControl() && !(b != null)) || this.SupportsRealControl()) this.CreateControlCache();
      };
    };
    this.ApplyControlColor = function () {
    };
    this.ApplyControlProperties = function () {
      this.ApplyControlColor();
    };
    this.ApplyScale = function (AScale) {
      this.FScale = AScale;
      if (this.GetLayout().FFont.FSize > 0) {
        this.GetLayout().FFont.SetSize(Math.round(this.GetLayout().FFont.FSize * this.FScale))}
       else this.GetLayout().FFont.SetSize(Math.round(12 * this.FScale));
      this.GetLayout().FStroke.SetWidth(this.GetLayout().FStroke.FWidth * this.FScale);
    };
    this.DoAfterDraw = function (AGraphics) {
      if (this.FOnAfterDraw != null) this.FOnAfterDraw(this,AGraphics);
    };
    this.DoBeforeDraw = function (AGraphics, ACanDraw) {
      if (this.FOnBeforeDraw != null) this.FOnBeforeDraw(this,AGraphics,ACanDraw);
    };
    this.DoCommentIndicatorClick = function () {
      if (this.FOnCommentIndicatorClick != null) this.FOnCommentIndicatorClick(this);
    };
    this.DoControlWrapperEnter = function (Sender) {
      var rd = null;
      if ((this.FRoot != null) && pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridRenderer.isPrototypeOf(this.FRoot) && (this.FControlWrapper != null)) {
        rd = rtl.as(this.FRoot,pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridRenderer);
        rd.GetControlWrapperList().Clear();
        rd.GetControlWrapperList().AddOrSetValue(this.GetCoordinate().GetToString(),this.FControlWrapper);
      };
    };
    this.DoControlWrapperExit = function (Sender) {
      var rd = null;
      if ((this.FRoot != null) && pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridRenderer.isPrototypeOf(this.FRoot) && (this.FControlWrapper != null)) {
        rd = rtl.as(this.FRoot,pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridRenderer);
        rd.GetControlWrapperList().Remove$1(this.GetCoordinate().GetToString());
      };
    };
    this.DoFilterButtonClick = function () {
      if (this.FOnFilterButtonClick != null) this.FOnFilterButtonClick(this);
    };
    this.InitializeControl = function () {
    };
    this.RetrieveControlInfo = function (AInfo) {
      var AContext = pas.RTTI.TRTTIContext.$new();
      var rt = null;
      var prop = null;
      var propv = pas.RTTI.TValue.$new();
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      if (this.IsControlAssigned() && this.UsesControl() && (AInfo != null)) {
        r.$assign(this.GetControlRectInternal(this.SupportsRealControl()));
        AInfo.FType = this.GetControl().$class.ClassType();
        AInfo.FWidth = r.Right - r.Left;
        AInfo.FHeight = r.Bottom - r.Top;
        AInfo.FTag = this.GetControl().FTag$1;
        AInfo.FFocused = this.GetControl().Focused();
        AContext.$assign(pas.RTTI.TRTTIContext.Create());
        try {
          rt = AContext.GetType(this.GetControl().$class.ClassInfo());
          prop = rt.GetProperty("Text");
          if ((prop != null) && prop.GetIsReadable()) {
            propv.$assign(prop.GetValue(this.GetControl()));
            AInfo.FText = propv.AsString();
          };
          prop = rt.GetProperty("Caption");
          if ((prop != null) && prop.GetIsReadable()) {
            propv.$assign(prop.GetValue(this.GetControl()));
            AInfo.FCaption = propv.AsString();
          };
        } finally {
          AContext.Free();
        };
      };
    };
    this.UpdateData = function (AData) {
      this.FData = AData;
    };
    this.Create$1 = function (ARect, AColumn, ARow, AData, AKind, ARoot) {
      this.FControlClipping = true;
      this.FRoot = ARoot;
      this.FScale = 1.0;
      this.FCalcRect.$assign(ARect);
      this.FRect.$assign(ARect);
      this.FColumn = AColumn;
      this.FRow = ARow;
      this.FData = AData;
      this.FKind = AKind;
      this.FControlAlign = $mod.TTMSFNCDataGridCellControlAlign.gcaNone;
      this.FControlPosition = $mod.TTMSFNCDataGridCellControlPosition.gcpCenterRight;
      this.FDrawElements = rtl.refSet($mod.FullElements);
      this.FLayout = null;
      this.FIsExporting = false;
      this.FSortIndicator = $mod.TTMSFNCDataGridCellSortIndicator.gsiNone;
      this.FFilterButton = false;
      this.FCommentIndicatorColor = 42495;
      this.FCommentIndicator = false;
      this.FControlActive = false;
      this.FControlCache = null;
      this.FControlRef = this.CreateControl();
      this.InitializeControl();
      pas.Classes.RegisterClass($mod.TTMSFNCDataGridCellControlWrapper);
      return this;
    };
    this.Destroy = function () {
      var ct = null;
      var p = null;
      var rd = null;
      var e = null;
      if ((this.FRoot != null) && pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridRenderer.isPrototypeOf(this.FRoot)) {
        rd = rtl.as(this.FRoot,pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridRenderer);
        if (!rd.GetIsDestroying() && !(rd.GetUpdateCount() > 0)) {
          if (!rd.IsCellVisible(pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridCellCoord.$clone(this.GetCoordinate())) && rd.GetControlWrapperList().TryGetValue(this.GetCoordinate().GetToString(),{get: function () {
              return e;
            }, set: function (v) {
              e = v;
            }})) {
            this.FControlWrapper = e;
            rd.GetControlWrapperList().Remove$1(this.GetCoordinate().GetToString());
          };
        };
      };
      e = null;
      if ((this.FRoot != null) && pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridRenderer.isPrototypeOf(this.FRoot) && !(this.FControlRef != null)) {
        rd = rtl.as(this.FRoot,pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridRenderer);
        if (!rd.GetIsDestroying()) rd.GetControlWrapperList().TryGetValue(this.GetCoordinate().GetToString(),{get: function () {
            return e;
          }, set: function (v) {
            e = v;
          }});
      };
      if (this.IsControlAssigned() && this.UsesControl() && !(e != null)) {
        ct = this.GetControl();
        if ((ct != null) && (ct.FParent != null) && !(pas.Classes.TComponentStateItem.csDestroying in ct.FComponentState) && (ct.FParent != null) && pas["WEBLib.Controls"].TWinControl.isPrototypeOf(ct.FParent)) {
          p = rtl.as(ct.FParent,pas["WEBLib.Controls"].TWinControl);
          p.IncUpdateCount();
          ct.SetParent(null);
          p.DecUpdateCount();
        };
      };
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FLayout;
        }, set: function (v) {
          this.p.FLayout = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FControlCache;
        }, set: function (v) {
          this.p.FControlCache = v;
        }});
      if (!(e != null)) {
        pas.SysUtils.FreeAndNil({p: this, get: function () {
            return this.p.FControlWrapper;
          }, set: function (v) {
            this.p.FControlWrapper = v;
          }})}
       else this.FControlWrapper = null;
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FControlInfo;
        }, set: function (v) {
          this.p.FControlInfo = v;
        }});
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FControlMargins;
        }, set: function (v) {
          this.p.FControlMargins = v;
        }});
      this.FData = null;
      this.FBitmapContainer = null;
      this.FOnCommentIndicatorClick = null;
      this.FOnFilterButtonClick = null;
      this.FFilterIcon = null;
      this.FSortDescendingIcon = null;
      this.FSortAscendingIcon = null;
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FControlRef;
        }, set: function (v) {
          this.p.FControlRef = v;
        }});
      pas.System.TObject.Destroy.call(this);
    };
    this.IsHTML = function () {
      var Result = false;
      Result = (pas.System.Pos("</",this.GetText()) > 0) || (pas.System.Pos("/>",this.GetText()) > 0) || (pas.System.Pos("<BR>",pas.SysUtils.UpperCase(this.GetText())) > 0);
      return Result;
    };
    this.XYToAnchor = function (X, Y) {
      var Result = "";
      var g = null;
      var ha = 0;
      var va = 0;
      Result = "";
      if (this.IsHTML()) {
        g = pas["WEBLib.TMSFNCGraphics"].TTMSFNCGraphics.$create("CreateBitmapCanvas",[1,1,false,true]);
        g.BeginScene();
        g.FBitmapContainer = this.FBitmapContainer;
        try {
          g.FFont.Assign(this.GetLayout().FFont);
          ha = this.GetLayout().FTextAlign;
          va = this.GetLayout().FVerticalTextAlign;
          Result = g.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.GetTextRect()),this.GetText(),false,ha,va,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsTextTrimming.gttNone,0,-1,-1,true,true,X,Y);
        } finally {
          g.EndScene();
          g = rtl.freeLoc(g);
        };
      };
      return Result;
    };
    this.AfterExport = function () {
      this.FIsExporting = false;
    };
    this.BeforeExport = function () {
      this.FIsExporting = true;
    };
    this.ClearControlCache = function () {
      if (this.FControlCacheList != null) this.FControlCacheList.RemoveItem$1(this.GetControlInfo());
    };
    this.Draw = function (AGraphics) {
      var b = false;
      AGraphics.SetFill(this.GetLayout().FFill);
      AGraphics.SetStroke(this.GetLayout().FStroke);
      AGraphics.SetFont(this.GetLayout().FFont);
      b = true;
      this.DoBeforeDraw(AGraphics,{get: function () {
          return b;
        }, set: function (v) {
          b = v;
        }});
      if (b) {
        this.DrawBackground(AGraphics);
        this.DrawContent(AGraphics);
        this.DoAfterDraw(AGraphics);
      };
    };
    this.DrawBackground = function (AGraphics) {
      if (($mod.TTMSFNCDataGridCellDrawElement.gcdFill in this.FDrawElements) || ($mod.TTMSFNCDataGridCellDrawElement.gcdStroke in this.FDrawElements)) {
        if (!($mod.TTMSFNCDataGridCellDrawElement.gcdFill in this.FDrawElements)) AGraphics.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkNone);
        if (!($mod.TTMSFNCDataGridCellDrawElement.gcdStroke in this.FDrawElements)) AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
        AGraphics.DrawRectangle$3(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.FRect),rtl.refSet(this.GetLayout().FSides),pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsModifyRectMode.gcrmNone);
      };
    };
    this.DrawCommentIndicator = function (AGraphics) {
      var pth = null;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      r.$assign(this.GetCommentIndicatorRect());
      AGraphics.FFill.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsFillKind.gfkSolid);
      AGraphics.FFill.SetColor(this.FCommentIndicatorColor);
      AGraphics.FStroke.SetKind(pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsStrokeKind.gskNone);
      pth = pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPath.$create("Create$1");
      try {
        pth.MoveTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Left,r.Top));
        pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Top));
        pth.LineTo(pas["WEBLib.TMSFNCTypes"].PointF(r.Right,r.Bottom));
        pth.ClosePath();
        AGraphics.DrawPath(pth,pas["WEBLib.TMSFNCGraphicsTypes"].TTMSFNCGraphicsPathDrawMode.pdmPolygon);
      } finally {
        pth = rtl.freeLoc(pth);
      };
    };
    this.DrawContent = function (AGraphics) {
      this.PrepareControl();
      if ($mod.TTMSFNCDataGridCellDrawElement.gcdText in this.FDrawElements) this.DrawText(AGraphics);
      if ($mod.TTMSFNCDataGridCellDrawElement.gcdControl in this.FDrawElements) this.DrawControl(AGraphics);
      if (this.FCommentIndicator && ($mod.TTMSFNCDataGridCellDrawElement.gcdCommentIndicator in this.FDrawElements)) this.DrawCommentIndicator(AGraphics);
      if ((this.FSortIndicator !== $mod.TTMSFNCDataGridCellSortIndicator.gsiNone) && ($mod.TTMSFNCDataGridCellDrawElement.gcdSortIndicator in this.FDrawElements)) this.DrawSortIndicator(AGraphics);
      if (this.FFilterButton && ($mod.TTMSFNCDataGridCellDrawElement.gcdFilterButton in this.FDrawElements)) this.DrawFilterButton(AGraphics);
    };
    this.DrawControl = function (AGraphics) {
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var st = null;
      var b = null;
      var ci = null;
      var e = null;
      var $ir = rtl.createIntfRefs();
      try {
        if (this.IsControlAssigned() && this.UsesControl()) {
          if (this.FIsExporting && pas.SysUtils.Supports$1($ir.ref(1,rtl.queryIntfT(this.GetControl(),pas.System.IUnknown)),rtl.getIntfGUIDR(pas["WEBLib.TMSFNCGraphics"].ITMSFNCGraphicsExport),{get: function () {
              return e;
            }, set: function (v) {
              e = v;
            }})) {
            r.$assign(this.GetControlRectInternal(true));
            st = AGraphics.SaveState(false);
            try {
              AGraphics.ClipRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.FRect));
              e.ApplyExportScale(this.GetScale());
              e.Export(AGraphics,pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r));
              e.ResetExportScale();
            } finally {
              AGraphics.RestoreState(st,false);
            };
          } else {
            ci = this.FControlCacheList.GetCacheItem(this.GetControlInfo());
            if (ci != null) {
              b = ci.GetBitmap()}
             else b = this.FControlCache;
            if (!this.SupportsRealControl() && (b != null) && !this.FControlActive) {
              r.$assign(this.GetControlRectInternal(true));
              st = AGraphics.SaveState(false);
              try {
                AGraphics.ClipRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.FRect));
                AGraphics.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(r),b,true,false,true,false);
              } finally {
                AGraphics.RestoreState(st,false);
              };
            };
          };
        };
      } finally {
        $ir.free();
        rtl._Release(e);
      };
    };
    this.DrawFilterButton = function (AGraphics) {
      var bmp = null;
      var bmpr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      bmpr.$assign(this.GetFilterButtonRect());
      bmp = this.FFilterIcon;
      if (bmp != null) AGraphics.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(bmpr),bmp,true,false,true,false);
    };
    this.DrawSortIndicator = function (AGraphics) {
      var bmp = null;
      var bmpr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      bmp = null;
      var $tmp = this.FSortIndicator;
      if ($tmp === $mod.TTMSFNCDataGridCellSortIndicator.gsiAscending) {
        bmp = this.FSortAscendingIcon}
       else if ($tmp === $mod.TTMSFNCDataGridCellSortIndicator.gsiDescending) bmp = this.FSortDescendingIcon;
      bmpr.$assign(this.GetSortIndicatorRect());
      if (bmp != null) AGraphics.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(bmpr),bmp,true,false,true,false);
    };
    this.DrawText = function (AGraphics) {
      var dr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var s = "";
      var st = null;
      dr.$assign(this.GetTextRect());
      s = this.GetDisplayValue();
      if (s !== "") {
        st = AGraphics.SaveState(false);
        try {
          AGraphics.ClipRect(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.FRect));
          AGraphics.DrawText$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(dr),s,this.GetLayout().FWordWrapping,this.GetLayout().FTextAlign,this.GetLayout().FVerticalTextAlign,this.GetLayout().FTrimming,this.GetLayout().FTextAngle,-1,-1,true,false,-1,-1);
        } finally {
          AGraphics.RestoreState(st,false);
        };
      };
    };
    this.HandleKey = function (AKeyInfo) {
    };
    this.HandleMouse = function (AMouseInfo) {
      var c = null;
      var cw = null;
      var r = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var crc = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var cr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var rd = null;
      var p = null;
      if (!AMouseInfo.Blocked) {
        var $tmp = AMouseInfo.Kind;
        if ($tmp === $mod.TTMSFNCDataGridMouseKind.gmkDown) {
          this.FDownOnFilterButton = pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetFilterButtonRect(),pas["WEBLib.TMSFNCTypes"].PointF(AMouseInfo.X,AMouseInfo.Y));
          AMouseInfo.Blocked = this.FDownOnFilterButton;
          if (!AMouseInfo.Blocked) {
            this.FDownOnComment = pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetCommentIndicatorRect(),pas["WEBLib.TMSFNCTypes"].PointF(AMouseInfo.X,AMouseInfo.Y));
            AMouseInfo.Blocked = this.FDownOnComment;
          };
        } else if ($tmp === $mod.TTMSFNCDataGridMouseKind.gmkMove) {
          AMouseInfo.Blocked = this.FDownOnFilterButton || this.FDownOnComment;
          if (this.IsControlAssigned() && this.UsesControl() && !AMouseInfo.Blocked) {
            if (!this.SupportsRealControl()) {
              c = this.GetControl();
              var $tmp1 = AMouseInfo.Kind;
              if ($tmp1 === $mod.TTMSFNCDataGridMouseKind.gmkMove) {
                if ((this.FRoot != null) && pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridRenderer.isPrototypeOf(this.FRoot)) {
                  rd = rtl.as(this.FRoot,pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridRenderer);
                  r.$assign(this.GetControlRectInternal(true));
                  if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(r,pas["WEBLib.TMSFNCTypes"].PointF(AMouseInfo.X,AMouseInfo.Y)) && !this.FControlActive) {
                    AMouseInfo.Blocked = true;
                    p = rd.GetParentHost();
                    if (p != null) {
                      cw = this.GetControlWrapper();
                      c.SetParent(cw);
                      cw.SetParent(p);
                      r.$assign(this.GetControlRectInternal(true));
                      crc.$assign(this.GetControlClipRect());
                      cr.$assign(pas["WEBLib.TMSFNCTypes"].RectF(Math.max(crc.Left,r.Left),Math.max(crc.Top,r.Top),Math.min(crc.Right,r.Right),Math.min(crc.Bottom,r.Bottom)));
                      cw.SetBounds(Math.round(cr.Left),Math.round(cr.Top),Math.round(cr.Right - cr.Left),Math.round(cr.Bottom - cr.Top));
                      c.SetBounds(Math.round(r.Left - cr.Left),Math.round(r.Top - cr.Top),Math.round(r.Right - r.Left),Math.round(r.Bottom - r.Top));
                      this.ApplyControlColor();
                      this.FControlActive = true;
                      rd.Display();
                    };
                  } else if (this.FControlActive) {
                    c.SetParent(null);
                    cw = this.GetControlWrapper();
                    cw.SetParent(null);
                    this.ApplyControlColor();
                    this.FControlActive = false;
                    pas.SysUtils.FreeAndNil({p: this, get: function () {
                        return this.p.FControlCache;
                      }, set: function (v) {
                        this.p.FControlCache = v;
                      }});
                    rd.Display();
                  };
                };
              };
            };
          } else {
            if (pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetCommentIndicatorRect(),pas["WEBLib.TMSFNCTypes"].PointF(AMouseInfo.X,AMouseInfo.Y))) {
              AMouseInfo.Blocked = true;
              AMouseInfo.Cursor = 21;
            };
          };
        } else if ($tmp === $mod.TTMSFNCDataGridMouseKind.gmkUp) {
          AMouseInfo.Blocked = this.FDownOnFilterButton || this.FDownOnComment;
          if (this.FDownOnFilterButton) {
            this.FDownOnFilterButton = false;
            this.DoFilterButtonClick();
          };
          if (this.FDownOnComment) {
            this.FDownOnComment = false;
            this.DoCommentIndicatorClick();
          };
        };
      };
    };
  });
  this.TTMSFNCDataGridNodeCellIconPosition = {"0": "gcipTop", gcipTop: 0, "1": "gcipCenter", gcipCenter: 1, "2": "gcipBottom", gcipBottom: 2};
  this.$rtti.$Enum("TTMSFNCDataGridNodeCellIconPosition",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTMSFNCDataGridNodeCellIconPosition});
  rtl.createClass(this,"TTMSFNCDataGridNodeCell",this.TTMSFNCDataGridCell,function () {
    this.$init = function () {
      $mod.TTMSFNCDataGridCell.$init.call(this);
      this.FCollapseIcon = null;
      this.FDownOnNode = false;
      this.FExpandIcon = null;
      this.FIconPosition = 0;
      this.FIconSize = 0.0;
      this.FOnCollapse = null;
      this.FOnExpand = null;
      this.FState = 0;
    };
    this.$final = function () {
      this.FCollapseIcon = undefined;
      this.FExpandIcon = undefined;
      this.FOnCollapse = undefined;
      this.FOnExpand = undefined;
      $mod.TTMSFNCDataGridCell.$final.call(this);
    };
    this.GetNodeRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      var sz = 0.0;
      Result.$assign(pas["WEBLib.TMSFNCTypes"].EmptyRect());
      if ($mod.TTMSFNCDataGridCellDrawElement.gcdNodeIcon in this.FDrawElements) {
        sz = this.GetNodeSize();
        var $tmp = this.FIconPosition;
        if ($tmp === $mod.TTMSFNCDataGridNodeCellIconPosition.gcipTop) {
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.FRect.Left + (5 * this.FScale),this.FRect.Top + (5 * this.FScale),this.FRect.Left + (5 * this.FScale) + sz,this.FRect.Top + (5 * this.FScale) + sz))}
         else if ($tmp === $mod.TTMSFNCDataGridNodeCellIconPosition.gcipCenter) {
          Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.FRect.Left + (5 * this.FScale),this.FRect.Top + ((this.FRect.Bottom - this.FRect.Top - sz) / 2),this.FRect.Left + (5 * this.FScale) + sz,this.FRect.Top + ((this.FRect.Bottom - this.FRect.Top - sz) / 2) + sz))}
         else if ($tmp === $mod.TTMSFNCDataGridNodeCellIconPosition.gcipBottom) Result.$assign(pas["WEBLib.TMSFNCTypes"].RectF(this.FRect.Left + (5 * this.FScale),this.FRect.Bottom - (5 * this.FScale) - sz,this.FRect.Left + (5 * this.FScale) + sz,this.FRect.Bottom - (5 * this.FScale)));
      };
      return Result;
    };
    this.GetNodeSize = function () {
      var Result = 0.0;
      Result = this.FIconSize * this.FScale;
      return Result;
    };
    this.GetRequiredSize = function (AGraphics) {
      var Result = pas["WEBLib.TMSFNCTypes"].TSizeF.$new();
      Result.$assign($mod.TTMSFNCDataGridCell.GetRequiredSize.call(this,AGraphics));
      if ($mod.TTMSFNCDataGridCellDrawElement.gcdNodeIcon in this.FDrawElements) Result.cx = Result.cx + this.GetNodeSize() + (10 * this.FScale);
      return Result;
    };
    this.GetTextRect = function () {
      var Result = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      Result.$assign($mod.TTMSFNCDataGridCell.GetTextRect.call(this));
      if ($mod.TTMSFNCDataGridCellDrawElement.gcdNodeIcon in this.FDrawElements) Result.Left = Result.Left + this.GetNodeSize() + (10 * this.FScale);
      return Result;
    };
    this.DoCollapse = function () {
      if (this.FOnCollapse != null) this.FOnCollapse(this);
    };
    this.DoExpand = function () {
      if (this.FOnExpand != null) this.FOnExpand(this);
    };
    this.Create$1 = function (ARect, AColumn, ARow, AData, AKind, ARoot) {
      $mod.TTMSFNCDataGridCell.Create$1.apply(this,arguments);
      this.FIconSize = 16;
      this.FState = pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowNodeState.grnsExpanded;
      this.FIconPosition = $mod.TTMSFNCDataGridNodeCellIconPosition.gcipCenter;
      return this;
    };
    this.Destroy = function () {
      this.FCollapseIcon = null;
      this.FExpandIcon = null;
      this.FOnCollapse = null;
      this.FOnExpand = null;
      $mod.TTMSFNCDataGridCell.Destroy.call(this);
    };
    this.HandleMouse = function (AMouseInfo) {
      $mod.TTMSFNCDataGridCell.HandleMouse.apply(this,arguments);
      if (!AMouseInfo.Blocked) {
        var $tmp = AMouseInfo.Kind;
        if ($tmp === $mod.TTMSFNCDataGridMouseKind.gmkDown) {
          this.FDownOnNode = pas["WEBLib.TMSFNCTypes"].PtInRectEx(this.GetNodeRect(),pas["WEBLib.TMSFNCTypes"].PointF(AMouseInfo.X,AMouseInfo.Y));
          AMouseInfo.Blocked = this.FDownOnNode;
        } else if ($tmp === $mod.TTMSFNCDataGridMouseKind.gmkMove) {
          AMouseInfo.Blocked = this.FDownOnNode}
         else if ($tmp === $mod.TTMSFNCDataGridMouseKind.gmkUp) {
          AMouseInfo.Blocked = this.FDownOnNode;
          if (this.FDownOnNode) {
            this.FDownOnNode = false;
            var $tmp1 = this.FState;
            if ($tmp1 === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowNodeState.grnsCollapsed) {
              this.DoExpand()}
             else if ($tmp1 === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowNodeState.grnsExpanded) this.DoCollapse();
          };
        };
      };
    };
    this.DrawContent = function (AGraphics) {
      var bmp = null;
      var bmpr = pas["WEBLib.TMSFNCTypes"].TRectF.$new();
      $mod.TTMSFNCDataGridCell.DrawContent.apply(this,arguments);
      if ($mod.TTMSFNCDataGridCellDrawElement.gcdNodeIcon in this.FDrawElements) {
        bmp = null;
        var $tmp = this.FState;
        if ($tmp === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowNodeState.grnsCollapsed) {
          bmp = this.FExpandIcon}
         else if ($tmp === pas["WEBLib.TMSFNCDataGridCore"].TTMSFNCDataGridRowNodeState.grnsExpanded) bmp = this.FCollapseIcon;
        if (bmp != null) {
          bmpr.$assign(this.GetNodeRect());
          AGraphics.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(bmpr),bmp,true,false,true,false);
        };
      };
    };
  });
  rtl.createClass(this,"TTMSFNCDataGridCheckedCellControlInfo",this.TTMSFNCDataGridCellControlInfo,function () {
    this.$init = function () {
      $mod.TTMSFNCDataGridCellControlInfo.$init.call(this);
      this.FChecked = false;
    };
    this.Create$1 = function () {
      $mod.TTMSFNCDataGridCellControlInfo.Create$1.call(this);
      this.FChecked = false;
      return this;
    };
    this.Compare = function (AInfo) {
      var Result = false;
      Result = $mod.TTMSFNCDataGridCellControlInfo.Compare.call(this,AInfo);
      if ($mod.TTMSFNCDataGridCheckedCellControlInfo.isPrototypeOf(AInfo)) Result = Result && (this.FChecked === rtl.as(AInfo,$mod.TTMSFNCDataGridCheckedCellControlInfo).FChecked);
      return Result;
    };
    this.CopyInstance = function () {
      var Result = null;
      Result = $mod.TTMSFNCDataGridCheckedCellControlInfo.$create("Create$1");
      Result.Assign(this);
      return Result;
    };
    this.Assign = function (Source) {
      $mod.TTMSFNCDataGridCellControlInfo.Assign.apply(this,arguments);
      if ($mod.TTMSFNCDataGridCheckedCellControlInfo.isPrototypeOf(Source)) this.FChecked = rtl.as(Source,$mod.TTMSFNCDataGridCheckedCellControlInfo).FChecked;
    };
  });
  rtl.createClass(this,"TTMSFNCDataGridCheckedCell",this.TTMSFNCDataGridCell,function () {
    this.$init = function () {
      $mod.TTMSFNCDataGridCell.$init.call(this);
      this.FChecked = false;
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      $mod.TTMSFNCDataGridCell.$final.call(this);
    };
    this.GetControlInfoClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCDataGridCheckedCellControlInfo;
      return Result;
    };
    this.SupportsRealControl = function () {
      var Result = false;
      if (this.FIsExporting) {
        Result = false}
       else {
        Result = true;
      };
      return Result;
    };
    this.RetrieveControlInfo = function (AInfo) {
      $mod.TTMSFNCDataGridCell.RetrieveControlInfo.apply(this,arguments);
      if ($mod.TTMSFNCDataGridCheckedCellControlInfo.isPrototypeOf(AInfo)) rtl.as(AInfo,$mod.TTMSFNCDataGridCheckedCellControlInfo).FChecked = this.FChecked;
    };
  });
  rtl.createClass(this,"TTMSFNCDataGridCheckBox",pas["WEBLib.StdCtrls"].TCheckBox,function () {
    this.UpdateElementVisual = function () {
      var chk = null;
      var btn = null;
      pas["WEBLib.StdCtrls"].TCheckBox.UpdateElementVisual.call(this);
      if (this.GetContainer() != null) {
        chk = this.GetCheckElement();
        if (!this.GetIsLinked()) {
          chk.style.setProperty("background","transparent");
          chk.style.setProperty("-webkit-appearance","none");
          chk.style.setProperty("-moz-appearance","none");
          chk.style.setProperty("margin","0px");
          if (this.GetChecked()) {
            chk.style.setProperty("content","url('" + $impl.TTMSFNCDATAGRIDCHECKBOXCHECKED + "')")}
           else chk.style.setProperty("content","url('" + $impl.TTMSFNCDATAGRIDCHECKBOXUNCHECKED + "')");
        };
      };
    };
    this.MakeScreenshot = function () {
      var Result = null;
      Result = pas["WEBLib.Graphics"].TBitmap.$create("Create$3");
      if (this.GetChecked()) {
        Result.LoadFromResource($impl.TTMSFNCDATAGRIDCHECKBOXCHECKED)}
       else Result.LoadFromResource($impl.TTMSFNCDATAGRIDCHECKBOXUNCHECKED);
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCDataGridCheckBoxCell",this.TTMSFNCDataGridCheckedCell,function () {
    this.GetCheckBox = function () {
      var Result = null;
      Result = null;
      if ((this.FControlRef != null) && $mod.TTMSFNCDataGridCheckBox.isPrototypeOf(this.FControlRef)) Result = rtl.as(this.FControlRef,$mod.TTMSFNCDataGridCheckBox);
      return Result;
    };
    this.CreateControl = function () {
      var Result = null;
      Result = $mod.TTMSFNCDataGridCheckBox.$create("Create$1",[null]);
      return Result;
    };
    this.ApplyControlProperties = function () {
      var cn = null;
      var c = null;
      $mod.TTMSFNCDataGridCell.ApplyControlProperties.call(this);
      c = this.GetCheckBox();
      if ((c != null) && (this.FData != null)) {
        cn = c.FOnClick;
        c.FOnClick = null;
        c.SetChecked(this.FChecked);
        c.FOnClick = cn;
      };
    };
    this.DoCheckChange = function (Sender) {
      var rd = null;
      var c = null;
      if ((this.FRoot != null) && pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridRenderer.isPrototypeOf(this.FRoot)) {
        c = this.GetCheckBox();
        if (c != null) {
          this.FChecked = c.GetChecked();
        };
        if (!this.SupportsRealControl()) {
          pas.SysUtils.FreeAndNil({p: this, get: function () {
              return this.p.FControlCache;
            }, set: function (v) {
              this.p.FControlCache = v;
            }});
          rd = rtl.as(this.FRoot,pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridRenderer);
          rd.Display();
          this.ApplyControlColor();
        };
        if (this.FOnChange != null) this.FOnChange(this);
      };
    };
    this.InitializeControl = function () {
      var c = null;
      c = this.GetCheckBox();
      if (c != null) {
        c.SetCaption("");
        c.FOnClick = rtl.createCallback(this,"DoCheckChange");
        c.SetTabStop(false);
        c.SetWidth(17);
        c.SetHeight(17);
      };
    };
    this.HandleKey = function (AKeyInfo) {
      var rd = null;
      $mod.TTMSFNCDataGridCell.HandleKey.apply(this,arguments);
      if ((this.FRoot != null) && pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridRenderer.isPrototypeOf(this.FRoot)) {
        var $tmp = AKeyInfo.Kind;
        if ($tmp === $mod.TTMSFNCDataGridKeyKind.gkkUp) {
          if (this.IsControlEnabled() && (AKeyInfo.Key === 32)) {
            this.FChecked = !this.FChecked;
            if (!this.SupportsRealControl()) {
              pas.SysUtils.FreeAndNil({p: this, get: function () {
                  return this.p.FControlCache;
                }, set: function (v) {
                  this.p.FControlCache = v;
                }});
              rd = rtl.as(this.FRoot,pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridRenderer);
              rd.Display();
            };
            if (this.FOnChange != null) this.FOnChange(this);
          };
        };
      };
    };
  });
  rtl.createClass(this,"TTMSFNCDataGridDataCheckBoxCell",this.TTMSFNCDataGridCheckBoxCell,function () {
  });
  rtl.createClass(this,"TTMSFNCDataGridRadioButton",pas["WEBLib.StdCtrls"].TRadioButton,function () {
    this.UpdateElementVisual = function () {
      var chk = null;
      var btn = null;
      pas["WEBLib.StdCtrls"].TRadioButton.UpdateElementVisual.call(this);
      if (this.GetContainer() != null) {
        chk = this.GetRadioElement();
        if (!this.GetIsLinked()) {
          chk.style.setProperty("background","transparent");
          chk.style.setProperty("-webkit-appearance","none");
          chk.style.setProperty("-moz-appearance","none");
          chk.style.setProperty("margin","0px");
          if (this.GetChecked()) {
            chk.style.setProperty("content","url('" + $impl.TTMSFNCDATAGRIDRADIOBUTTONCHECKED + "')")}
           else chk.style.setProperty("content","url('" + $impl.TTMSFNCDATAGRIDRADIOBUTTONUNCHECKED + "')");
        };
      };
    };
    this.MakeScreenshot = function () {
      var Result = null;
      Result = pas["WEBLib.Graphics"].TBitmap.$create("Create$3");
      if (this.GetChecked()) {
        Result.LoadFromResource($impl.TTMSFNCDATAGRIDRADIOBUTTONCHECKED)}
       else Result.LoadFromResource($impl.TTMSFNCDATAGRIDRADIOBUTTONUNCHECKED);
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTMSFNCDataGridRadioButtonCell",this.TTMSFNCDataGridCheckedCell,function () {
    this.GetRadioButton = function () {
      var Result = null;
      Result = null;
      if ((this.FControlRef != null) && $mod.TTMSFNCDataGridRadioButton.isPrototypeOf(this.FControlRef)) Result = rtl.as(this.FControlRef,$mod.TTMSFNCDataGridRadioButton);
      return Result;
    };
    this.CreateControl = function () {
      var Result = null;
      Result = $mod.TTMSFNCDataGridRadioButton.$create("Create$1",[null]);
      return Result;
    };
    this.ApplyControlProperties = function () {
      var c = null;
      var r = null;
      $mod.TTMSFNCDataGridCell.ApplyControlProperties.call(this);
      r = this.GetRadioButton();
      if ((r != null) && (this.FData != null)) {
        c = r.FOnClick;
        r.FOnClick = null;
        r.SetChecked(this.FChecked);
        r.FOnClick = c;
      };
    };
    this.DoRadioChange = function (Sender) {
      var rd = null;
      var r = null;
      if ((this.FRoot != null) && pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridRenderer.isPrototypeOf(this.FRoot)) {
        this.ApplyControlColor();
        r = this.GetRadioButton();
        if (r != null) {
          this.FChecked = r.GetChecked();
        };
        if (!this.SupportsRealControl()) {
          pas.SysUtils.FreeAndNil({p: this, get: function () {
              return this.p.FControlCache;
            }, set: function (v) {
              this.p.FControlCache = v;
            }});
          rd = rtl.as(this.FRoot,pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridRenderer);
          rd.Display();
          this.ApplyControlColor();
        };
        if (this.FOnChange != null) this.FOnChange(this);
      };
    };
    this.InitializeControl = function () {
      var r = null;
      r = this.GetRadioButton();
      if (r != null) {
        r.SetCaption("");
        r.FOnClick = rtl.createCallback(this,"DoRadioChange");
        r.SetTabStop(false);
        r.SetWidth(17);
        r.SetHeight(17);
      };
    };
    this.HandleKey = function (AKeyInfo) {
      var rd = null;
      $mod.TTMSFNCDataGridCell.HandleKey.apply(this,arguments);
      if ((this.FRoot != null) && pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridRenderer.isPrototypeOf(this.FRoot)) {
        var $tmp = AKeyInfo.Kind;
        if ($tmp === $mod.TTMSFNCDataGridKeyKind.gkkUp) {
          if (this.IsControlEnabled() && (AKeyInfo.Key === 32) && !this.FChecked) {
            this.FChecked = true;
            if (!this.SupportsRealControl()) {
              pas.SysUtils.FreeAndNil({p: this, get: function () {
                  return this.p.FControlCache;
                }, set: function (v) {
                  this.p.FControlCache = v;
                }});
              rd = rtl.as(this.FRoot,pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridRenderer);
              rd.Display();
            };
            if (this.FOnChange != null) this.FOnChange(this);
          };
        };
      };
    };
  });
  rtl.createClass(this,"TTMSFNCDataGridDataRadioButtonCell",this.TTMSFNCDataGridRadioButtonCell,function () {
  });
  rtl.createClass(this,"TTMSFNCDataGridButtonCell",this.TTMSFNCDataGridCell,function () {
    this.$init = function () {
      $mod.TTMSFNCDataGridCell.$init.call(this);
      this.FOnClick = null;
    };
    this.$final = function () {
      this.FOnClick = undefined;
      $mod.TTMSFNCDataGridCell.$final.call(this);
    };
    this.GetButton = function () {
      var Result = null;
      Result = null;
      if ((this.FControlRef != null) && pas["WEBLib.StdCtrls"].TButton.isPrototypeOf(this.FControlRef)) Result = rtl.as(this.FControlRef,pas["WEBLib.StdCtrls"].TButton);
      return Result;
    };
    this.CreateControl = function () {
      var Result = null;
      Result = pas["WEBLib.StdCtrls"].TButton.$create("Create$1",[null]);
      return Result;
    };
    this.SupportsRealControl = function () {
      var Result = false;
      if (this.FIsExporting) {
        Result = false}
       else {
        Result = true;
      };
      return Result;
    };
    this.DoButtonClick = function (Sender) {
      if (this.FOnClick != null) this.FOnClick(this);
    };
    this.InitializeControl = function () {
      var b = null;
      b = this.GetButton();
      if (b != null) {
        b.SetTabStop(false);
        b.FOnClick = rtl.createCallback(this,"DoButtonClick");
      };
    };
  });
  rtl.createClass(this,"TTMSFNCDataGridFNCButtonCell",this.TTMSFNCDataGridCell,function () {
    this.$init = function () {
      $mod.TTMSFNCDataGridCell.$init.call(this);
      this.FOnClick = null;
    };
    this.$final = function () {
      this.FOnClick = undefined;
      $mod.TTMSFNCDataGridCell.$final.call(this);
    };
    this.GetButton = function () {
      var Result = null;
      Result = null;
      if ((this.FControlRef != null) && pas["WEBLib.TMSFNCButton"].TTMSFNCButton.isPrototypeOf(this.FControlRef)) Result = rtl.as(this.FControlRef,pas["WEBLib.TMSFNCButton"].TTMSFNCButton);
      return Result;
    };
    this.CreateControl = function () {
      var Result = null;
      Result = pas["WEBLib.TMSFNCButton"].TTMSFNCButton.$create("Create$1",[null]);
      return Result;
    };
    this.SupportsRealControl = function () {
      var Result = false;
      if (this.FIsExporting) {
        Result = false}
       else {
        Result = true;
      };
      return Result;
    };
    this.DoButtonClick = function (Sender) {
      if (this.FOnClick != null) this.FOnClick(this);
    };
    this.InitializeControl = function () {
      var b = null;
      b = this.GetButton();
      if (b != null) {
        b.SetTabStop(false);
        b.FOnClick = rtl.createCallback(this,"DoButtonClick");
      };
    };
  });
  rtl.createClass(this,"TTMSFNCDataGridProgressBarCellControlInfo",this.TTMSFNCDataGridCellControlInfo,function () {
    this.$init = function () {
      $mod.TTMSFNCDataGridCellControlInfo.$init.call(this);
      this.FValue = 0;
    };
    this.Create$1 = function () {
      $mod.TTMSFNCDataGridCellControlInfo.Create$1.call(this);
      this.FValue = 0;
      return this;
    };
    this.Compare = function (AInfo) {
      var Result = false;
      Result = $mod.TTMSFNCDataGridCellControlInfo.Compare.call(this,AInfo);
      if ($mod.TTMSFNCDataGridProgressBarCellControlInfo.isPrototypeOf(AInfo)) Result = Result && (this.FValue === rtl.as(AInfo,$mod.TTMSFNCDataGridProgressBarCellControlInfo).FValue);
      return Result;
    };
    this.CopyInstance = function () {
      var Result = null;
      Result = $mod.TTMSFNCDataGridProgressBarCellControlInfo.$create("Create$1");
      Result.Assign(this);
      return Result;
    };
    this.Assign = function (Source) {
      $mod.TTMSFNCDataGridCellControlInfo.Assign.apply(this,arguments);
      if ($mod.TTMSFNCDataGridProgressBarCellControlInfo.isPrototypeOf(Source)) this.FValue = rtl.as(Source,$mod.TTMSFNCDataGridProgressBarCellControlInfo).FValue;
    };
  });
  rtl.createClass(this,"TTMSFNCDataGridProgressBarCell",this.TTMSFNCDataGridCell,function () {
    this.$init = function () {
      $mod.TTMSFNCDataGridCell.$init.call(this);
      this.FValue = 0;
    };
    this.GetProgressBar = function () {
      var Result = null;
      Result = null;
      if ((this.FControlRef != null) && pas["WEBLib.ComCtrls"].TProgressBar.isPrototypeOf(this.FControlRef)) Result = rtl.as(this.FControlRef,pas["WEBLib.ComCtrls"].TProgressBar);
      return Result;
    };
    this.CreateControl = function () {
      var Result = null;
      Result = pas["WEBLib.ComCtrls"].TProgressBar.$create("Create$1",[null]);
      return Result;
    };
    this.GetControlInfoClass = function () {
      var Result = null;
      Result = $mod.TTMSFNCDataGridProgressBarCellControlInfo;
      return Result;
    };
    this.ApplyControlProperties = function () {
      var p = null;
      $mod.TTMSFNCDataGridCell.ApplyControlProperties.call(this);
      p = this.GetProgressBar();
      if ((p != null) && (this.FData != null)) {
        p.SetPosition(this.FValue);
      };
    };
    this.InitializeControl = function () {
      var p = null;
      p = this.GetProgressBar();
      if (p != null) {
        p.SetTabStop(false);
      };
    };
    this.RetrieveControlInfo = function (AInfo) {
      $mod.TTMSFNCDataGridCell.RetrieveControlInfo.apply(this,arguments);
      if ($mod.TTMSFNCDataGridProgressBarCellControlInfo.isPrototypeOf(AInfo)) rtl.as(AInfo,$mod.TTMSFNCDataGridProgressBarCellControlInfo).FValue = this.FValue;
    };
  });
  rtl.createClass(this,"TTMSFNCDataGridDataProgressBarCell",this.TTMSFNCDataGridProgressBarCell,function () {
  });
  rtl.createClass(this,"TTMSFNCDataGridBitmapCell",this.TTMSFNCDataGridCell,function () {
    this.$init = function () {
      $mod.TTMSFNCDataGridCell.$init.call(this);
      this.FBitmap = null;
      this.FBitmapName = "";
      this.FBitmapAspectRatio = false;
      this.FBitmapCentered = false;
      this.FBitmapStretched = false;
      this.FBitmapCropped = false;
    };
    this.$final = function () {
      this.FBitmap = undefined;
      $mod.TTMSFNCDataGridCell.$final.call(this);
    };
    this.GetBitmap = function () {
      var Result = null;
      if (!(this.FBitmap != null)) {
        this.FBitmap = pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.$create("Create$3");
        this.FBitmap.FOnChange = rtl.createCallback(this,"DoBitmapChanged");
      };
      Result = this.FBitmap;
      return Result;
    };
    this.GetBitmapAlign = function () {
      var Result = 0;
      Result = this.FControlAlign;
      return Result;
    };
    this.GetBitmapHeight = function () {
      var Result = 0.0;
      Result = this.GetControlHeight();
      return Result;
    };
    this.GetBitmapWidth = function () {
      var Result = 0.0;
      Result = this.GetControlWidth();
      return Result;
    };
    this.SetBitmapAlign = function (Value) {
      this.FControlAlign = Value;
    };
    this.SetBitmapHeight = function (Value) {
      var c = null;
      c = this.GetControl();
      if (c != null) c.SetHeight(Math.round(Value));
    };
    this.SetBitmapName = function (Value) {
      this.FBitmapName = Value;
      this.DoBitmapChanged(null);
    };
    this.SetBitmapWidth = function (Value) {
      var c = null;
      c = this.GetControl();
      if (c != null) c.SetWidth(Math.round(Value));
    };
    this.SetBitmapAspectRatio = function (Value) {
      this.FBitmapAspectRatio = Value;
    };
    this.SetBitmapCentered = function (Value) {
      this.FBitmapCentered = Value;
    };
    this.SetBitmapCropped = function (Value) {
      this.FBitmapCropped = Value;
    };
    this.SetBitmapStretched = function (Value) {
      this.FBitmapStretched = Value;
    };
    this.CreateControl = function () {
      var Result = null;
      Result = pas["WEBLib.Controls"].TWinControl.$create("Create$1",[null]);
      return Result;
    };
    this.GetDrawBitmap = function () {
      var Result = null;
      var bmp = null;
      bmp = null;
      if ((this.GetBitmap() != null) && !pas["WEBLib.TMSFNCTypes"].IsBitmapEmpty(this.GetBitmap())) {
        bmp = this.GetBitmap()}
       else if ((this.FBitmapContainer != null) && (this.FBitmapName !== "")) bmp = this.FBitmapContainer.FindBitmap$1(this.FBitmapName);
      Result = bmp;
      return Result;
    };
    this.UsesControl = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    this.DoBitmapChanged = function (Sender) {
      var bmp = null;
      var c = null;
      bmp = this.GetDrawBitmap();
      if (bmp != null) {
        c = this.GetControl();
        if (c != null) {
          c.SetWidth(Math.round(bmp.GetWidth()));
          c.SetHeight(Math.round(bmp.GetHeight()));
        };
      };
    };
    this.Create$1 = function (ARect, AColumn, ARow, AData, AKind, ARoot) {
      $mod.TTMSFNCDataGridCell.Create$1.apply(this,arguments);
      this.FBitmapAspectRatio = true;
      this.FBitmapCentered = true;
      this.FBitmapStretched = false;
      this.FBitmapCropped = false;
      return this;
    };
    this.Destroy = function () {
      pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FBitmap;
        }, set: function (v) {
          this.p.FBitmap = v;
        }});
      $mod.TTMSFNCDataGridCell.Destroy.call(this);
    };
    this.DrawControl = function (AGraphics) {
      var bmp = null;
      bmp = this.GetDrawBitmap();
      if (bmp != null) AGraphics.DrawBitmap$1(pas["WEBLib.TMSFNCTypes"].TRectF.$clone(this.GetControlRectInternal(true)),bmp,this.FBitmapAspectRatio,this.FBitmapStretched,this.FBitmapCentered,this.FBitmapCropped);
    };
  });
  rtl.createClass(this,"TTMSFNCDataGridFilterEditorCell",this.TTMSFNCDataGridCell,function () {
    this.SupportsRealControl = function () {
      var Result = false;
      Result = true;
      return Result;
    };
  });
  this.$rtti.$ClassRef("TTMSFNCDataGridCellClass",{instancetype: this.$rtti["TTMSFNCDataGridCell"]});
  rtl.createHelper(this,"TTMSFNCDataGridCellHelper",null,function () {
    this.GetAsBitmapCell = function () {
      var Result = null;
      Result = rtl.as(this,$mod.TTMSFNCDataGridBitmapCell);
      return Result;
    };
    this.GetAsButtonCell = function () {
      var Result = null;
      Result = rtl.as(this,$mod.TTMSFNCDataGridButtonCell);
      return Result;
    };
    this.GetAsCheckBoxCell = function () {
      var Result = null;
      Result = rtl.as(this,$mod.TTMSFNCDataGridCheckBoxCell);
      return Result;
    };
    this.GetAsFNCButtonCell = function () {
      var Result = null;
      Result = rtl.as(this,$mod.TTMSFNCDataGridFNCButtonCell);
      return Result;
    };
    this.GetAsNodeCell = function () {
      var Result = null;
      Result = rtl.as(this,$mod.TTMSFNCDataGridNodeCell);
      return Result;
    };
    this.GetAsProgressBarCell = function () {
      var Result = null;
      Result = rtl.as(this,$mod.TTMSFNCDataGridProgressBarCell);
      return Result;
    };
    this.GetAsRadioButtonCell = function () {
      var Result = null;
      Result = rtl.as(this,$mod.TTMSFNCDataGridRadioButtonCell);
      return Result;
    };
    this.GetIsBitmapCell = function () {
      var Result = false;
      Result = $mod.TTMSFNCDataGridBitmapCell.isPrototypeOf(this);
      return Result;
    };
    this.GetIsButtonCell = function () {
      var Result = false;
      Result = $mod.TTMSFNCDataGridButtonCell.isPrototypeOf(this);
      return Result;
    };
    this.GetIsCheckBoxCell = function () {
      var Result = false;
      Result = $mod.TTMSFNCDataGridCheckBoxCell.isPrototypeOf(this);
      return Result;
    };
    this.GetIsFNCButtonCell = function () {
      var Result = false;
      Result = $mod.TTMSFNCDataGridFNCButtonCell.isPrototypeOf(this);
      return Result;
    };
    this.GetIsNodeCell = function () {
      var Result = false;
      Result = $mod.TTMSFNCDataGridNodeCell.isPrototypeOf(this);
      return Result;
    };
    this.GetIsProgressBarCell = function () {
      var Result = false;
      Result = $mod.TTMSFNCDataGridProgressBarCell.isPrototypeOf(this);
      return Result;
    };
    this.GetIsRadioButtonCell = function () {
      var Result = false;
      Result = $mod.TTMSFNCDataGridRadioButtonCell.isPrototypeOf(this);
      return Result;
    };
    this.GetAsCheckedCell = function () {
      var Result = null;
      Result = rtl.as(this,$mod.TTMSFNCDataGridCheckedCell);
      return Result;
    };
    this.GetIsCheckedCell = function () {
      var Result = false;
      Result = $mod.TTMSFNCDataGridCheckedCell.isPrototypeOf(this);
      return Result;
    };
    var $r = this.$rtti;
    $r.addProperty("AsBitmapCell",1,$mod.$rtti["TTMSFNCDataGridBitmapCell"],"GetAsBitmapCell","");
    $r.addProperty("AsButtonCell",1,$mod.$rtti["TTMSFNCDataGridButtonCell"],"GetAsButtonCell","");
    $r.addProperty("AsCheckBoxCell",1,$mod.$rtti["TTMSFNCDataGridCheckBoxCell"],"GetAsCheckBoxCell","");
    $r.addProperty("AsCheckedCell",1,$mod.$rtti["TTMSFNCDataGridCheckedCell"],"GetAsCheckedCell","");
    $r.addProperty("AsFNCButtonCell",1,$mod.$rtti["TTMSFNCDataGridFNCButtonCell"],"GetAsFNCButtonCell","");
    $r.addProperty("AsNodeCell",1,$mod.$rtti["TTMSFNCDataGridNodeCell"],"GetAsNodeCell","");
    $r.addProperty("AsProgressBarCell",1,$mod.$rtti["TTMSFNCDataGridProgressBarCell"],"GetAsProgressBarCell","");
    $r.addProperty("AsRadioButtonCell",1,$mod.$rtti["TTMSFNCDataGridRadioButtonCell"],"GetAsRadioButtonCell","");
    $r.addProperty("IsBitmapCell",1,rtl.boolean,"GetIsBitmapCell","");
    $r.addProperty("IsButtonCell",1,rtl.boolean,"GetIsButtonCell","");
    $r.addProperty("IsCheckBoxCell",1,rtl.boolean,"GetIsCheckBoxCell","");
    $r.addProperty("IsCheckedCell",1,rtl.boolean,"GetIsCheckedCell","");
    $r.addProperty("IsFNCButtonCell",1,rtl.boolean,"GetIsFNCButtonCell","");
    $r.addProperty("IsNodeCell",1,rtl.boolean,"GetIsNodeCell","");
    $r.addProperty("IsProgressBarCell",1,rtl.boolean,"GetIsProgressBarCell","");
    $r.addProperty("IsRadioButtonCell",1,rtl.boolean,"GetIsRadioButtonCell","");
  });
  this.AsExtendedCell = function (ACell) {
    var Result = null;
    Result = rtl.as(ACell,$mod.TTMSFNCDataGridCellItemExtended);
    return Result;
  };
  this.CreateMergeInfo = function (AColumnOffset, ARowOffset, AColumnSpan, ARowSpan) {
    var Result = $mod.TTMSFNCDataGridCellMergeInfo.$new();
    Result.ColumnOffset = AColumnOffset;
    Result.RowOffset = ARowOffset;
    Result.ColumnSpan = AColumnSpan;
    Result.RowSpan = ARowSpan;
    return Result;
  };
  this.DefaultKeyInfo = function () {
    var Result = $mod.TTMSFNCDataGridKeyInfo.$new();
    Result.Key = 0;
    Result.KeyChar = "\x00";
    Result.Shift = {};
    Result.Kind = $mod.TTMSFNCDataGridKeyKind.gkkNone;
    Result.Blocked = false;
    Result.Handled = false;
    return Result;
  };
  this.DefaultMergeInfo = function () {
    var Result = $mod.TTMSFNCDataGridCellMergeInfo.$new();
    Result.$assign($mod.CreateMergeInfo(-1,-1,0,0));
    return Result;
  };
  this.DefaultMouseInfo = function () {
    var Result = $mod.TTMSFNCDataGridMouseInfo.$new();
    Result.Button = pas["WEBLib.Controls"].TMouseButton.mbLeft;
    Result.X = -1;
    Result.Y = -1;
    Result.Shift = {};
    Result.Cursor = 0;
    Result.Kind = $mod.TTMSFNCDataGridMouseKind.gmkNone;
    Result.WheelDelta = 0;
    Result.Blocked = false;
    Result.Handled = false;
    return Result;
  };
  this.IsExtendedCell = function (ACell) {
    var Result = false;
    Result = $mod.TTMSFNCDataGridCellItemExtended.isPrototypeOf(ACell);
    return Result;
  };
  $mod.$implcode = function () {
    $impl.TTMSFNCDATAGRIDRADIOBUTTONCHECKED = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KDTwhLS0gVXBsb2FkZWQgdG86IFNWRyBSZXBvLCB3d3cuc3ZncmVwby5jb20sIEdlbmVyYXRvcjogU1ZHIFJlcG8gTWl4ZXIgVG9vbHMgLS0+Cjxzdmcgd2lkdGg9IjgwMHB4IiBoZWlnaHQ9IjgwMHB4IiB2aWV3Qm94PSIwIDAgMjQgM" + "jQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8Zz4KICAgICAgICA8cGF0aCBmaWxsPSJub25lIiBkPSJNMCAwaDI0djI0SDB6Ii8+CiAgICAgICAgPHBhdGggZD0iTTEyIDIyQzYuNDc3IDIyIDIgMTcuNTIzIDIgMTJTNi40NzcgMiAxMiAyczEwIDQuNDc3IDEwIDEwLTQuNDc3IDEwLTEwIDEwem0wLTJhOCA4" + "IDAgMSAwIDAtMTYgOCA4IDAgMCAwIDAgMTZ6bTAtM2E1IDUgMCAxIDEgMC0xMCA1IDUgMCAwIDEgMCAxMHoiLz4KICAgIDwvZz4KPC9zdmc+";
    $impl.TTMSFNCDATAGRIDRADIOBUTTONUNCHECKED = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPgo8c3ZnIHdpZHRoPSI4MDBweCIgaGVpZ2h0PSI4MDBweCIgdmlld0JveD0iMCAwIDI0IDI0I" + "iBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPg0KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMiAyMkMxNy41MjI4IDIyIDIyIDE3LjUyMjggMjIgMTJDMjIgNi40NzcxNSAxNy41MjI4IDIgMTIgMkM2LjQ3NzE1IDIgMiA2LjQ3NzE1IDIgMTJDMiAxNy41" + "MjI4IDYuNDc3MTUgMjIgMTIgMjJaTTEyIDIwQzE2LjQxODMgMjAgMjAgMTYuNDE4MyAyMCAxMkMyMCA3LjU4MTcyIDE2LjQxODMgNCAxMiA0QzcuNTgxNzIgNCA0IDcuNTgxNzIgNCAxMkM0IDE2LjQxODMgNy41ODE3MiAyMCAxMiAyMFoiIGZpbGw9IiMwMDAwMDAiLz4NCjwvc3ZnPg";
    $impl.TTMSFNCDATAGRIDCHECKBOXCHECKED = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iODAwcHgiIGhlaWdodD0iODAwcHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZ" + "y8xOTk5L3hsaW5rIj4KICAgIDwhLS0gVXBsb2FkZWQgdG86IFNWRyBSZXBvLCB3d3cuc3ZncmVwby5jb20sIEdlbmVyYXRvcjogU1ZHIFJlcG8gTWl4ZXIgVG9vbHMgLS0+CiAgICA8dGl0bGU+aWNfZmx1ZW50X2NoZWNrYm94X2NoZWNrZWRfMjRfcmVndWxhcjwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVz" + "Yz4KICAgIDxnIGlkPSLwn5SNLVByb2R1Y3QtSWNvbnMiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSJpY19mbHVlbnRfY2hlY2tib3hfY2hlY2tlZF8yNF9yZWd1bGFyIiBmaWxsPSIjMjEyMTIxIiBmaWxsLXJ1bGU9Im5vbnplcm8iPgogICA" + "gICAgICAgICA8cGF0aCBkPSJNMTguMjUsMyBDMTkuNzY4NzgzMSwzIDIxLDQuMjMxMjE2OTQgMjEsNS43NSBMMjEsMTguMjUgQzIxLDE5Ljc2ODc4MzEgMTkuNzY4NzgzMSwyMSAxOC4yNSwyMSBMNS43NSwyMSBDNC4yMzEyMTY5NCwyMSAzLDE5Ljc2ODc4MzEgMywxOC4yNSBMMyw1Ljc1IEMzLDQuMjMxMjE2OTQgNC4yMzEyMTY5NCwzID" + "UuNzUsMyBMMTguMjUsMyBaIE0xOC4yNSw0LjUgTDUuNzUsNC41IEM1LjA1OTY0NDA2LDQuNSA0LjUsNS4wNTk2NDQwNiA0LjUsNS43NSBMNC41LDE4LjI1IEM0LjUsMTguOTQwMzU1OSA1LjA1OTY0NDA2LDE5LjUgNS43NSwxOS41IEwxOC4yNSwxOS41IEMxOC45NDAzNTU5LDE5LjUgMTkuNSwxOC45NDAzNTU5IDE5LjUsMTguMjUgTDE5L" + "jUsNS43NSBDMTkuNSw1LjA1OTY0NDA2IDE4Ljk0MDM1NTksNC41IDE4LjI1LDQuNSBaIE0xMCwxNC40MzkzMzk4IEwxNi40Njk2Njk5LDcuOTY5NjY5OTEgQzE2Ljc2MjU2MzEsNy42NzY3NzY3IDE3LjIzNzQzNjksNy42NzY3NzY3IDE3LjUzMDMzMDEsNy45Njk2Njk5MSBDMTcuNzk2NTk2Niw4LjIzNTkzNjQ4IDE3LjgyMDgwMjcsOC42" + "NTI2MDAxNiAxNy42MDI5NDgyLDguOTQ2MjExNjUgTDE3LjUzMDMzMDEsOS4wMzAzMzAwOSBMMTAuNTMwMzMwMSwxNi4wMzAzMzAxIEMxMC4yNjQwNjM1LDE2LjI5NjU5NjYgOS44NDczOTk4NCwxNi4zMjA4MDI3IDkuNTUzNzg4MzUsMTYuMTAyOTQ4MiBMOS40Njk2Njk5MSwxNi4wMzAzMzAxIEw2LjQ2OTY2OTkxLDEzLjAzMDMzMDEgQzY" + "uMTc2Nzc2NywxMi43Mzc0MzY5IDYuMTc2Nzc2NywxMi4yNjI1NjMxIDYuNDY5NjY5OTEsMTEuOTY5NjY5OSBDNi43MzU5MzY0OCwxMS43MDM0MDM0IDcuMTUyNjAwMTYsMTEuNjc5MTk3MyA3LjQ0NjIxMTY1LDExLjg5NzA1MTggTDcuNTMwMzMwMDksMTEuOTY5NjY5OSBMMTAsMTQuNDM5MzM5OCBMMTYuNDY5NjY5OSw3Ljk2OTY2OTkxIE" + "wxMCwxNC40MzkzMzk4IFoiIGlkPSLwn46oQ29sb3IiPgoNPC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+";
    $impl.TTMSFNCDATAGRIDCHECKBOXUNCHECKED = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iODAwcHgiIGhlaWdodD0iODAwcHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZ" + "y8xOTk5L3hsaW5rIj4KICAgIDwhLS0gVXBsb2FkZWQgdG86IFNWRyBSZXBvLCB3d3cuc3ZncmVwby5jb20sIEdlbmVyYXRvcjogU1ZHIFJlcG8gTWl4ZXIgVG9vbHMgLS0+CiAgICA8dGl0bGU+aWNfZmx1ZW50X2NoZWNrYm94X3VuY2hlY2tlZF8yNF9yZWd1bGFyPC90aXRsZT4KICAgIDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9k" + "ZXNjPgogICAgPGcgaWQ9IvCflI0tUHJvZHVjdC1JY29ucyIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgaWQ9ImljX2ZsdWVudF9jaGVja2JveF91bmNoZWNrZWRfMjRfcmVndWxhciIgZmlsbD0iIzIxMjEyMSIgZmlsbC1ydWxlPSJub256ZXJvIj4" + "KICAgICAgICAgICAgPHBhdGggZD0iTTUuNzUsMyBMMTguMjUsMyBDMTkuNzY4NzgzMSwzIDIxLDQuMjMxMjE2OTQgMjEsNS43NSBMMjEsMTguMjUgQzIxLDE5Ljc2ODc4MzEgMTkuNzY4NzgzMSwyMSAxOC4yNSwyMSBMNS43NSwyMSBDNC4yMzEyMTY5NCwyMSAzLDE5Ljc2ODc4MzEgMywxOC4yNSBMMyw1Ljc1IEMzLDQuMjMxMjE2OTQgNC" + "4yMzEyMTY5NCwzIDUuNzUsMyBaIE01Ljc1LDQuNSBDNS4wNTk2NDQwNiw0LjUgNC41LDUuMDU5NjQ0MDYgNC41LDUuNzUgTDQuNSwxOC4yNSBDNC41LDE4Ljk0MDM1NTkgNS4wNTk2NDQwNiwxOS41IDUuNzUsMTkuNSBMMTguMjUsMTkuNSBDMTguOTQwMzU1OSwxOS41IDE5LjUsMTguOTQwMzU1OSAxOS41LDE4LjI1IEwxOS41LDUuNzUgQ" + "zE5LjUsNS4wNTk2NDQwNiAxOC45NDAzNTU5LDQuNSAxOC4yNSw0LjUgTDUuNzUsNC41IFoiIGlkPSLwn46oQ29sb3IiPgoNPC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+";
    rtl.createClass($impl,"TTMSFNCDataGridCellControlOpen",pas["WEBLib.Controls"].TWinControl,function () {
      rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
      rtl.addIntf(this,pas.System.IUnknown);
    });
    rtl.createClass($impl,"TTMSFNCDataGridRendererOpen",pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridRenderer,function () {
      rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderSelection);
      rtl.addIntf(this,pas["WEBLib.TMSFNCGraphicsTypes"].ITMSFNCAppearanceGlobalFont);
      rtl.addIntf(this,pas["WEBLib.TMSFNCBitmapContainer"].ITMSFNCBitmapContainer);
      rtl.addIntf(this,pas["WEBLib.TMSFNCStyles"].ITMSFNCAdaptToStyle);
      rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderGrid,{ClearData: "DataClearData"});
      rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCCustomReadWriteIO);
      rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
      rtl.addIntf(this,pas.System.IUnknown);
    });
    rtl.createClass($impl,"TTMSFNCDataGridDataOpen",pas["WEBLib.TMSFNCDataGridData"].TTMSFNCDataGridData,function () {
      rtl.addIntf(this,pas["WEBLib.TMSFNCDataBinding"].ITMSFNCDataBinderGrid,{ClearData: "DataClearData"});
      rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCCustomReadWriteIO);
      rtl.addIntf(this,pas["WEBLib.TMSFNCPersistence"].ITMSFNCPersistence);
      rtl.addIntf(this,pas.System.IUnknown);
    });
    rtl.createClass($impl,"TTMSFNCDataGridCellParentOpen",pas["WEBLib.Controls"].TWinControl,function () {
      rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
      rtl.addIntf(this,pas.System.IUnknown);
    });
    rtl.createClass($impl,"TCustomFormOpen",pas["WEBLib.Forms"].TCustomForm,function () {
      rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
      rtl.addIntf(this,pas.System.IUnknown);
    });
  };
  $mod.$init = function () {
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($impl.TTMSFNCDATAGRIDRADIOBUTTONCHECKED);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($impl.TTMSFNCDATAGRIDRADIOBUTTONUNCHECKED);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($impl.TTMSFNCDATAGRIDCHECKBOXCHECKED);
    pas["WEBLib.TMSFNCTypes"].TTMSFNCBitmap.CreateFromResource($impl.TTMSFNCDATAGRIDCHECKBOXUNCHECKED);
    if (!($mod.TTMSFNCDataGridCell.FControlCacheList != null)) $mod.TTMSFNCDataGridCell.FControlCacheList = $mod.TTMSFNCDataGridCellControlCacheList.$create("Create$4",[true]);
  };
},["Math","WEBLib.TMSFNCDataGridData","WEBLib.TMSFNCDataGridRenderer","WEBLib.TMSFNCUtils","WEBLib.Forms"]);
rtl.module("View.Tasks",["System","SysUtils","Classes","JS","Web","WEBLib.Graphics","WEBLib.Controls","WEBLib.Forms","WEBLib.Dialogs","WEBLib.TMSFNCTypes","WEBLib.TMSFNCUtils","WEBLib.TMSFNCGraphics","WEBLib.TMSFNCGraphicsTypes","WEBLib.TMSFNCDataGridCell","WEBLib.TMSFNCDataGridData","WEBLib.TMSFNCDataGridBase","WEBLib.TMSFNCDataGridCore","WEBLib.TMSFNCDataGridRenderer","WEBLib.TMSFNCCustomControl","WEBLib.TMSFNCDataGrid","XData.Web.Client","Utils","WEBLib.ExtCtrls","RTTI","WEBLib.Controls"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  rtl.createClass(this,"TFTasks",pas["WEBLib.Forms"].TForm,function () {
    this.$init = function () {
      pas["WEBLib.Forms"].TForm.$init.call(this);
      this.xdwcTasks = null;
      this.pnlGrid = null;
      this.grdTasks = null;
    };
    this.$final = function () {
      this.xdwcTasks = undefined;
      this.pnlGrid = undefined;
      this.grdTasks = undefined;
      pas["WEBLib.Forms"].TForm.$final.call(this);
    };
    this.WebFormCreate = function (Sender) {
      this.xdwcTasks.SetConnection(pas.ConnectionModule.DMConnection.ApiConnection);
      this.LoadTasks("WPR0001");
    };
    this.LoadTasks = async function (AProjectId) {
      var response = null;
      var resultObj = null;
      var tasksArray = null;
      var taskObj = null;
      var itemsArray = null;
      var itemObj = null;
      var taskIndex = 0;
      var itemIndex = 0;
      var gridRow = 0;
      var statusDateVal = undefined;
      pas.Utils.ShowSpinner("spinner");
      try {
        try {
          response = await this.xdwcTasks.RawInvokeAsync("IApiService.GetProjectTasks",[AProjectId]);
          if (!pas.System.Assigned(response.FResult)) return;
          resultObj = response.FResult;
          tasksArray = resultObj["data"];
          this.grdTasks.BeginUpdate();
          try {
            this.grdTasks.SetRowCount(1);
            gridRow = 1;
            for (var $l = 0, $end = tasksArray.length - 1; $l <= $end; $l++) {
              taskIndex = $l;
              taskObj = tasksArray[taskIndex];
              itemsArray = taskObj["items"];
              for (var $l1 = 0, $end1 = itemsArray.length - 1; $l1 <= $end1; $l1++) {
                itemIndex = $l1;
                itemObj = itemsArray[itemIndex];
                this.grdTasks.SetRowCount(gridRow + 1);
                this.grdTasks.SetCell(0,gridRow,"" + itemObj["taskItemId"]);
                this.grdTasks.SetCell(1,gridRow,"" + itemObj["taskId"]);
                this.grdTasks.SetCell(2,gridRow,"" + itemObj["application"]);
                this.grdTasks.SetCell(3,gridRow,"" + itemObj["version"]);
                this.grdTasks.SetCell(4,gridRow,"" + itemObj["taskDate"]);
                this.grdTasks.SetCell(5,gridRow,"" + itemObj["reportedBy"]);
                this.grdTasks.SetCell(6,gridRow,"" + itemObj["assignedTo"]);
                this.grdTasks.SetCell(7,gridRow,"" + itemObj["status"]);
                statusDateVal = itemObj["statusDate"];
                if (pas.JS.isNull(statusDateVal) || pas.JS.isUndefined(statusDateVal)) {
                  this.grdTasks.SetCell(8,gridRow,"")}
                 else this.grdTasks.SetCell(8,gridRow,"" + statusDateVal);
                this.grdTasks.SetCell(9,gridRow,"" + itemObj["fixedVersion"]);
                this.grdTasks.SetCell(10,gridRow,"" + itemObj["formSection"]);
                this.grdTasks.SetCell(11,gridRow,"" + itemObj["issue"]);
                this.grdTasks.SetCell(12,gridRow,"" + itemObj["notes"]);
                gridRow += 1;
              };
            };
          } finally {
            this.grdTasks.EndUpdate();
          };
        } catch ($e) {
          if (pas["XData.Web.Client"].EXDataClientRequestException.isPrototypeOf($e)) {
            var E = $e;
            pas.Utils.ShowErrorModal(E.FErrorResult.FErrorMessage);
          } else throw $e
        };
      } finally {
        pas.Utils.HideSpinner("spinner");
      };
    };
    this.LoadDFMValues = function () {
      pas["WEBLib.Forms"].TCustomForm.LoadDFMValues.call(this);
      this.pnlGrid = pas["WEBLib.ExtCtrls"].TPanel.$create("Create$2",["pnl_grid"]);
      this.grdTasks = pas["WEBLib.TMSFNCDataGrid"].TTMSFNCDataGrid.$create("Create$1",[this]);
      this.xdwcTasks = pas["XData.Web.Client"].TXDataWebClient.$create("Create$1",[this]);
      this.pnlGrid.BeforeLoadDFMValues();
      this.grdTasks.BeforeLoadDFMValues();
      this.xdwcTasks.BeforeLoadDFMValues();
      try {
        this.SetName("FTasks");
        this.SetWidth(1416);
        this.SetHeight(846);
        this.SetCSSLibrary(pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap);
        this.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
        this.SetFormContainer("tasks.root");
        this.SetEvent(this,"OnCreate","WebFormCreate");
        this.pnlGrid.SetParentComponent(this);
        this.pnlGrid.SetName("pnlGrid");
        this.pnlGrid.SetLeft(0);
        this.pnlGrid.SetTop(0);
        this.pnlGrid.SetWidth(1408);
        this.pnlGrid.SetHeight(841);
        this.pnlGrid.SetChildOrderEx(1);
        this.pnlGrid.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
        this.pnlGrid.SetTabOrder(0);
        this.grdTasks.SetParentComponent(this.pnlGrid);
        this.grdTasks.SetName("grdTasks");
        this.grdTasks.SetLeft(12);
        this.grdTasks.SetTop(14);
        this.grdTasks.SetWidth(1373);
        this.grdTasks.SetHeight(799);
        this.grdTasks.FParentDoubleBuffered = false;
        this.grdTasks.FDoubleBuffered = true;
        this.grdTasks.SetTabOrder(0);
        this.grdTasks.SetShowAcceleratorChar(false);
        this.grdTasks.GetHeader().FVisualGrouping.FLayout.FFont.FCharset = 1;
        this.grdTasks.GetHeader().FVisualGrouping.FLayout.FFont.SetColor(65793);
        this.grdTasks.GetHeader().FVisualGrouping.FLayout.FFont.SetHeight(-12);
        this.grdTasks.GetHeader().FVisualGrouping.FLayout.FFont.SetName("Segoe UI");
        this.grdTasks.GetHeader().FVisualGrouping.FLayout.FFont.SetStyle({});
        this.grdTasks.GetCellAppearance().FFilterMatchLayout.FFont.FCharset = 1;
        this.grdTasks.GetCellAppearance().FFilterMatchLayout.FFont.SetColor(65793);
        this.grdTasks.GetCellAppearance().FFilterMatchLayout.FFont.SetHeight(-12);
        this.grdTasks.GetCellAppearance().FFilterMatchLayout.FFont.SetName("Segoe UI");
        this.grdTasks.GetCellAppearance().FFilterMatchLayout.FFont.SetStyle({});
        this.grdTasks.GetCellAppearance().FFilterMatchLayout.SetWordWrapping(true);
        this.grdTasks.GetCellAppearance().FFilterInverseMatchLayout.FFont.FCharset = 1;
        this.grdTasks.GetCellAppearance().FFilterInverseMatchLayout.FFont.SetColor(65793);
        this.grdTasks.GetCellAppearance().FFilterInverseMatchLayout.FFont.SetHeight(-12);
        this.grdTasks.GetCellAppearance().FFilterInverseMatchLayout.FFont.SetName("Segoe UI");
        this.grdTasks.GetCellAppearance().FFilterInverseMatchLayout.FFont.SetStyle({});
        this.grdTasks.GetCellAppearance().FFilterInverseMatchLayout.SetWordWrapping(true);
        this.grdTasks.GetCellAppearance().FBandLayout.FFont.FCharset = 1;
        this.grdTasks.GetCellAppearance().FBandLayout.FFont.SetColor(0);
        this.grdTasks.GetCellAppearance().FBandLayout.FFont.SetHeight(-12);
        this.grdTasks.GetCellAppearance().FBandLayout.FFont.SetName("Segoe UI");
        this.grdTasks.GetCellAppearance().FBandLayout.FFont.SetStyle({});
        this.grdTasks.GetCellAppearance().FBandLayout.SetWordWrapping(true);
        this.grdTasks.GetCellAppearance().FFixedLayout.FFont.FCharset = 1;
        this.grdTasks.GetCellAppearance().FFixedLayout.FFont.SetColor(0);
        this.grdTasks.GetCellAppearance().FFixedLayout.FFont.SetHeight(-12);
        this.grdTasks.GetCellAppearance().FFixedLayout.FFont.SetName("Segoe UI");
        this.grdTasks.GetCellAppearance().FFixedLayout.FFont.SetStyle({});
        this.grdTasks.GetCellAppearance().FFixedLayout.SetWordWrapping(true);
        this.grdTasks.GetCellAppearance().FFixedSelectedLayout.FFont.FCharset = 1;
        this.grdTasks.GetCellAppearance().FFixedSelectedLayout.FFont.SetColor(0);
        this.grdTasks.GetCellAppearance().FFixedSelectedLayout.FFont.SetHeight(-12);
        this.grdTasks.GetCellAppearance().FFixedSelectedLayout.FFont.SetName("Segoe UI");
        this.grdTasks.GetCellAppearance().FFixedSelectedLayout.FFont.SetStyle({});
        this.grdTasks.GetCellAppearance().FFixedSelectedLayout.SetWordWrapping(true);
        this.grdTasks.GetCellAppearance().FFocusedLayout.FFont.FCharset = 1;
        this.grdTasks.GetCellAppearance().FFocusedLayout.FFont.SetColor(0);
        this.grdTasks.GetCellAppearance().FFocusedLayout.FFont.SetHeight(-12);
        this.grdTasks.GetCellAppearance().FFocusedLayout.FFont.SetName("Segoe UI");
        this.grdTasks.GetCellAppearance().FFocusedLayout.FFont.SetStyle({});
        this.grdTasks.GetCellAppearance().FFocusedLayout.SetWordWrapping(true);
        this.grdTasks.GetCellAppearance().FGroupLayout.FFont.FCharset = 1;
        this.grdTasks.GetCellAppearance().FGroupLayout.FFont.SetColor(0);
        this.grdTasks.GetCellAppearance().FGroupLayout.FFont.SetHeight(-12);
        this.grdTasks.GetCellAppearance().FGroupLayout.FFont.SetName("Segoe UI");
        this.grdTasks.GetCellAppearance().FGroupLayout.FFont.SetStyle({});
        this.grdTasks.GetCellAppearance().FGroupLayout.SetWordWrapping(true);
        this.grdTasks.GetCellAppearance().FNormalLayout.FFont.FCharset = 1;
        this.grdTasks.GetCellAppearance().FNormalLayout.FFont.SetColor(0);
        this.grdTasks.GetCellAppearance().FNormalLayout.FFont.SetHeight(-12);
        this.grdTasks.GetCellAppearance().FNormalLayout.FFont.SetName("Segoe UI");
        this.grdTasks.GetCellAppearance().FNormalLayout.FFont.SetStyle({});
        this.grdTasks.GetCellAppearance().FNormalLayout.SetWordWrapping(true);
        this.grdTasks.GetCellAppearance().FSelectedLayout.FFont.FCharset = 1;
        this.grdTasks.GetCellAppearance().FSelectedLayout.FFont.SetColor(0);
        this.grdTasks.GetCellAppearance().FSelectedLayout.FFont.SetHeight(-12);
        this.grdTasks.GetCellAppearance().FSelectedLayout.FFont.SetName("Segoe UI");
        this.grdTasks.GetCellAppearance().FSelectedLayout.FFont.SetStyle({});
        this.grdTasks.GetCellAppearance().FSummaryLayout.FFont.FCharset = 1;
        this.grdTasks.GetCellAppearance().FSummaryLayout.FFont.SetColor(0);
        this.grdTasks.GetCellAppearance().FSummaryLayout.FFont.SetHeight(-12);
        this.grdTasks.GetCellAppearance().FSummaryLayout.FFont.SetName("Segoe UI");
        this.grdTasks.GetCellAppearance().FSummaryLayout.FFont.SetStyle({});
        this.grdTasks.GetCellAppearance().FSummaryLayout.SetWordWrapping(true);
        this.grdTasks.SetColumnCount(13);
        this.grdTasks.GetColumns().Clear();
        var $with = this.grdTasks.GetColumns().Add$1();
        $with.FAppearance.FFilterMatchLayout.FFont.FCharset = 1;
        $with.FAppearance.FFilterMatchLayout.FFont.SetColor(65793);
        $with.FAppearance.FFilterMatchLayout.FFont.SetHeight(-12);
        $with.FAppearance.FFilterMatchLayout.FFont.SetName("Segoe UI");
        $with.FAppearance.FFilterMatchLayout.FFont.SetStyle({});
        $with.FAppearance.FFilterInverseMatchLayout.FFont.FCharset = 1;
        $with.FAppearance.FFilterInverseMatchLayout.FFont.SetColor(65793);
        $with.FAppearance.FFilterInverseMatchLayout.FFont.SetHeight(-12);
        $with.FAppearance.FFilterInverseMatchLayout.FFont.SetName("Segoe UI");
        $with.FAppearance.FFilterInverseMatchLayout.FFont.SetStyle({});
        $with.FAppearance.FBandLayout.FFont.FCharset = 1;
        $with.FAppearance.FBandLayout.FFont.SetColor(65793);
        $with.FAppearance.FBandLayout.FFont.SetHeight(-12);
        $with.FAppearance.FBandLayout.FFont.SetName("Segoe UI");
        $with.FAppearance.FBandLayout.FFont.SetStyle({});
        $with.FAppearance.FFixedLayout.FFont.FCharset = 1;
        $with.FAppearance.FFixedLayout.FFont.SetColor(65793);
        $with.FAppearance.FFixedLayout.FFont.SetHeight(-12);
        $with.FAppearance.FFixedLayout.FFont.SetName("Segoe UI");
        $with.FAppearance.FFixedLayout.FFont.SetStyle({});
        $with.FAppearance.FFixedSelectedLayout.FFont.FCharset = 1;
        $with.FAppearance.FFixedSelectedLayout.FFont.SetColor(65793);
        $with.FAppearance.FFixedSelectedLayout.FFont.SetHeight(-12);
        $with.FAppearance.FFixedSelectedLayout.FFont.SetName("Segoe UI");
        $with.FAppearance.FFixedSelectedLayout.FFont.SetStyle({});
        $with.FAppearance.FFocusedLayout.FFont.FCharset = 1;
        $with.FAppearance.FFocusedLayout.FFont.SetColor(65793);
        $with.FAppearance.FFocusedLayout.FFont.SetHeight(-12);
        $with.FAppearance.FFocusedLayout.FFont.SetName("Segoe UI");
        $with.FAppearance.FFocusedLayout.FFont.SetStyle({});
        $with.FAppearance.FGroupLayout.FFont.FCharset = 1;
        $with.FAppearance.FGroupLayout.FFont.SetColor(65793);
        $with.FAppearance.FGroupLayout.FFont.SetHeight(-12);
        $with.FAppearance.FGroupLayout.FFont.SetName("Segoe UI");
        $with.FAppearance.FGroupLayout.FFont.SetStyle({});
        $with.FAppearance.FNormalLayout.FFont.FCharset = 1;
        $with.FAppearance.FNormalLayout.FFont.SetColor(65793);
        $with.FAppearance.FNormalLayout.FFont.SetHeight(-12);
        $with.FAppearance.FNormalLayout.FFont.SetName("Segoe UI");
        $with.FAppearance.FNormalLayout.FFont.SetStyle({});
        $with.FAppearance.FSelectedLayout.FFont.FCharset = 1;
        $with.FAppearance.FSelectedLayout.FFont.SetColor(65793);
        $with.FAppearance.FSelectedLayout.FFont.SetHeight(-12);
        $with.FAppearance.FSelectedLayout.FFont.SetName("Segoe UI");
        $with.FAppearance.FSelectedLayout.FFont.SetStyle({});
        $with.FAppearance.FSummaryLayout.FFont.FCharset = 1;
        $with.FAppearance.FSummaryLayout.FFont.SetColor(65793);
        $with.FAppearance.FSummaryLayout.FFont.SetHeight(-12);
        $with.FAppearance.FSummaryLayout.FFont.SetName("Segoe UI");
        $with.FAppearance.FSummaryLayout.FFont.SetStyle({});
        $with.SetHeader("Task Item ID");
        $with.FName = "COL_TASK_ITEM_ID";
        $with.SetWidth(70.000000000000000000);
        var $with1 = this.grdTasks.GetColumns().Add$1();
        $with1.FAppearance.FFilterMatchLayout.FFont.FCharset = 1;
        $with1.FAppearance.FFilterMatchLayout.FFont.SetColor(65793);
        $with1.FAppearance.FFilterMatchLayout.FFont.SetHeight(-12);
        $with1.FAppearance.FFilterMatchLayout.FFont.SetName("Segoe UI");
        $with1.FAppearance.FFilterMatchLayout.FFont.SetStyle({});
        $with1.FAppearance.FFilterInverseMatchLayout.FFont.FCharset = 1;
        $with1.FAppearance.FFilterInverseMatchLayout.FFont.SetColor(65793);
        $with1.FAppearance.FFilterInverseMatchLayout.FFont.SetHeight(-12);
        $with1.FAppearance.FFilterInverseMatchLayout.FFont.SetName("Segoe UI");
        $with1.FAppearance.FFilterInverseMatchLayout.FFont.SetStyle({});
        $with1.FAppearance.FBandLayout.FFont.FCharset = 1;
        $with1.FAppearance.FBandLayout.FFont.SetColor(65793);
        $with1.FAppearance.FBandLayout.FFont.SetHeight(-12);
        $with1.FAppearance.FBandLayout.FFont.SetName("Segoe UI");
        $with1.FAppearance.FBandLayout.FFont.SetStyle({});
        $with1.FAppearance.FFixedLayout.FFont.FCharset = 1;
        $with1.FAppearance.FFixedLayout.FFont.SetColor(65793);
        $with1.FAppearance.FFixedLayout.FFont.SetHeight(-12);
        $with1.FAppearance.FFixedLayout.FFont.SetName("Segoe UI");
        $with1.FAppearance.FFixedLayout.FFont.SetStyle({});
        $with1.FAppearance.FFixedSelectedLayout.FFont.FCharset = 1;
        $with1.FAppearance.FFixedSelectedLayout.FFont.SetColor(65793);
        $with1.FAppearance.FFixedSelectedLayout.FFont.SetHeight(-12);
        $with1.FAppearance.FFixedSelectedLayout.FFont.SetName("Segoe UI");
        $with1.FAppearance.FFixedSelectedLayout.FFont.SetStyle({});
        $with1.FAppearance.FFocusedLayout.FFont.FCharset = 1;
        $with1.FAppearance.FFocusedLayout.FFont.SetColor(65793);
        $with1.FAppearance.FFocusedLayout.FFont.SetHeight(-12);
        $with1.FAppearance.FFocusedLayout.FFont.SetName("Segoe UI");
        $with1.FAppearance.FFocusedLayout.FFont.SetStyle({});
        $with1.FAppearance.FGroupLayout.FFont.FCharset = 1;
        $with1.FAppearance.FGroupLayout.FFont.SetColor(65793);
        $with1.FAppearance.FGroupLayout.FFont.SetHeight(-12);
        $with1.FAppearance.FGroupLayout.FFont.SetName("Segoe UI");
        $with1.FAppearance.FGroupLayout.FFont.SetStyle({});
        $with1.FAppearance.FNormalLayout.FFont.FCharset = 1;
        $with1.FAppearance.FNormalLayout.FFont.SetColor(65793);
        $with1.FAppearance.FNormalLayout.FFont.SetHeight(-12);
        $with1.FAppearance.FNormalLayout.FFont.SetName("Segoe UI");
        $with1.FAppearance.FNormalLayout.FFont.SetStyle({});
        $with1.FAppearance.FSelectedLayout.FFont.FCharset = 1;
        $with1.FAppearance.FSelectedLayout.FFont.SetColor(65793);
        $with1.FAppearance.FSelectedLayout.FFont.SetHeight(-12);
        $with1.FAppearance.FSelectedLayout.FFont.SetName("Segoe UI");
        $with1.FAppearance.FSelectedLayout.FFont.SetStyle({});
        $with1.FAppearance.FSummaryLayout.FFont.FCharset = 1;
        $with1.FAppearance.FSummaryLayout.FFont.SetColor(65793);
        $with1.FAppearance.FSummaryLayout.FFont.SetHeight(-12);
        $with1.FAppearance.FSummaryLayout.FFont.SetName("Segoe UI");
        $with1.FAppearance.FSummaryLayout.FFont.SetStyle({});
        $with1.SetHeader("Task ID");
        $with1.FName = "COL_TASK_ID";
        $with1.SetWidth(250.000000000000000000);
        var $with2 = this.grdTasks.GetColumns().Add$1();
        $with2.FAppearance.FFilterMatchLayout.FFont.FCharset = 1;
        $with2.FAppearance.FFilterMatchLayout.FFont.SetColor(65793);
        $with2.FAppearance.FFilterMatchLayout.FFont.SetHeight(-12);
        $with2.FAppearance.FFilterMatchLayout.FFont.SetName("Segoe UI");
        $with2.FAppearance.FFilterMatchLayout.FFont.SetStyle({});
        $with2.FAppearance.FFilterInverseMatchLayout.FFont.FCharset = 1;
        $with2.FAppearance.FFilterInverseMatchLayout.FFont.SetColor(65793);
        $with2.FAppearance.FFilterInverseMatchLayout.FFont.SetHeight(-12);
        $with2.FAppearance.FFilterInverseMatchLayout.FFont.SetName("Segoe UI");
        $with2.FAppearance.FFilterInverseMatchLayout.FFont.SetStyle({});
        $with2.FAppearance.FBandLayout.FFont.FCharset = 1;
        $with2.FAppearance.FBandLayout.FFont.SetColor(65793);
        $with2.FAppearance.FBandLayout.FFont.SetHeight(-12);
        $with2.FAppearance.FBandLayout.FFont.SetName("Segoe UI");
        $with2.FAppearance.FBandLayout.FFont.SetStyle({});
        $with2.FAppearance.FFixedLayout.FFont.FCharset = 1;
        $with2.FAppearance.FFixedLayout.FFont.SetColor(65793);
        $with2.FAppearance.FFixedLayout.FFont.SetHeight(-12);
        $with2.FAppearance.FFixedLayout.FFont.SetName("Segoe UI");
        $with2.FAppearance.FFixedLayout.FFont.SetStyle({});
        $with2.FAppearance.FFixedSelectedLayout.FFont.FCharset = 1;
        $with2.FAppearance.FFixedSelectedLayout.FFont.SetColor(65793);
        $with2.FAppearance.FFixedSelectedLayout.FFont.SetHeight(-12);
        $with2.FAppearance.FFixedSelectedLayout.FFont.SetName("Segoe UI");
        $with2.FAppearance.FFixedSelectedLayout.FFont.SetStyle({});
        $with2.FAppearance.FFocusedLayout.FFont.FCharset = 1;
        $with2.FAppearance.FFocusedLayout.FFont.SetColor(65793);
        $with2.FAppearance.FFocusedLayout.FFont.SetHeight(-12);
        $with2.FAppearance.FFocusedLayout.FFont.SetName("Segoe UI");
        $with2.FAppearance.FFocusedLayout.FFont.SetStyle({});
        $with2.FAppearance.FGroupLayout.FFont.FCharset = 1;
        $with2.FAppearance.FGroupLayout.FFont.SetColor(65793);
        $with2.FAppearance.FGroupLayout.FFont.SetHeight(-12);
        $with2.FAppearance.FGroupLayout.FFont.SetName("Segoe UI");
        $with2.FAppearance.FGroupLayout.FFont.SetStyle({});
        $with2.FAppearance.FNormalLayout.FFont.FCharset = 1;
        $with2.FAppearance.FNormalLayout.FFont.SetColor(65793);
        $with2.FAppearance.FNormalLayout.FFont.SetHeight(-12);
        $with2.FAppearance.FNormalLayout.FFont.SetName("Segoe UI");
        $with2.FAppearance.FNormalLayout.FFont.SetStyle({});
        $with2.FAppearance.FSelectedLayout.FFont.FCharset = 1;
        $with2.FAppearance.FSelectedLayout.FFont.SetColor(65793);
        $with2.FAppearance.FSelectedLayout.FFont.SetHeight(-12);
        $with2.FAppearance.FSelectedLayout.FFont.SetName("Segoe UI");
        $with2.FAppearance.FSelectedLayout.FFont.SetStyle({});
        $with2.FAppearance.FSummaryLayout.FFont.FCharset = 1;
        $with2.FAppearance.FSummaryLayout.FFont.SetColor(65793);
        $with2.FAppearance.FSummaryLayout.FFont.SetHeight(-12);
        $with2.FAppearance.FSummaryLayout.FFont.SetName("Segoe UI");
        $with2.FAppearance.FSummaryLayout.FFont.SetStyle({});
        $with2.SetHeader("Application");
        $with2.FName = "COL_APP";
        $with2.SetWidth(100.000000000000000000);
        var $with3 = this.grdTasks.GetColumns().Add$1();
        $with3.FAppearance.FFilterMatchLayout.FFont.FCharset = 1;
        $with3.FAppearance.FFilterMatchLayout.FFont.SetColor(65793);
        $with3.FAppearance.FFilterMatchLayout.FFont.SetHeight(-12);
        $with3.FAppearance.FFilterMatchLayout.FFont.SetName("Segoe UI");
        $with3.FAppearance.FFilterMatchLayout.FFont.SetStyle({});
        $with3.FAppearance.FFilterInverseMatchLayout.FFont.FCharset = 1;
        $with3.FAppearance.FFilterInverseMatchLayout.FFont.SetColor(65793);
        $with3.FAppearance.FFilterInverseMatchLayout.FFont.SetHeight(-12);
        $with3.FAppearance.FFilterInverseMatchLayout.FFont.SetName("Segoe UI");
        $with3.FAppearance.FFilterInverseMatchLayout.FFont.SetStyle({});
        $with3.FAppearance.FBandLayout.FFont.FCharset = 1;
        $with3.FAppearance.FBandLayout.FFont.SetColor(65793);
        $with3.FAppearance.FBandLayout.FFont.SetHeight(-12);
        $with3.FAppearance.FBandLayout.FFont.SetName("Segoe UI");
        $with3.FAppearance.FBandLayout.FFont.SetStyle({});
        $with3.FAppearance.FFixedLayout.FFont.FCharset = 1;
        $with3.FAppearance.FFixedLayout.FFont.SetColor(65793);
        $with3.FAppearance.FFixedLayout.FFont.SetHeight(-12);
        $with3.FAppearance.FFixedLayout.FFont.SetName("Segoe UI");
        $with3.FAppearance.FFixedLayout.FFont.SetStyle({});
        $with3.FAppearance.FFixedSelectedLayout.FFont.FCharset = 1;
        $with3.FAppearance.FFixedSelectedLayout.FFont.SetColor(65793);
        $with3.FAppearance.FFixedSelectedLayout.FFont.SetHeight(-12);
        $with3.FAppearance.FFixedSelectedLayout.FFont.SetName("Segoe UI");
        $with3.FAppearance.FFixedSelectedLayout.FFont.SetStyle({});
        $with3.FAppearance.FFocusedLayout.FFont.FCharset = 1;
        $with3.FAppearance.FFocusedLayout.FFont.SetColor(65793);
        $with3.FAppearance.FFocusedLayout.FFont.SetHeight(-12);
        $with3.FAppearance.FFocusedLayout.FFont.SetName("Segoe UI");
        $with3.FAppearance.FFocusedLayout.FFont.SetStyle({});
        $with3.FAppearance.FGroupLayout.FFont.FCharset = 1;
        $with3.FAppearance.FGroupLayout.FFont.SetColor(65793);
        $with3.FAppearance.FGroupLayout.FFont.SetHeight(-12);
        $with3.FAppearance.FGroupLayout.FFont.SetName("Segoe UI");
        $with3.FAppearance.FGroupLayout.FFont.SetStyle({});
        $with3.FAppearance.FNormalLayout.FFont.FCharset = 1;
        $with3.FAppearance.FNormalLayout.FFont.SetColor(65793);
        $with3.FAppearance.FNormalLayout.FFont.SetHeight(-12);
        $with3.FAppearance.FNormalLayout.FFont.SetName("Segoe UI");
        $with3.FAppearance.FNormalLayout.FFont.SetStyle({});
        $with3.FAppearance.FSelectedLayout.FFont.FCharset = 1;
        $with3.FAppearance.FSelectedLayout.FFont.SetColor(65793);
        $with3.FAppearance.FSelectedLayout.FFont.SetHeight(-12);
        $with3.FAppearance.FSelectedLayout.FFont.SetName("Segoe UI");
        $with3.FAppearance.FSelectedLayout.FFont.SetStyle({});
        $with3.FAppearance.FSummaryLayout.FFont.FCharset = 1;
        $with3.FAppearance.FSummaryLayout.FFont.SetColor(65793);
        $with3.FAppearance.FSummaryLayout.FFont.SetHeight(-12);
        $with3.FAppearance.FSummaryLayout.FFont.SetName("Segoe UI");
        $with3.FAppearance.FSummaryLayout.FFont.SetStyle({});
        $with3.SetHeader("Version");
        $with3.FName = "COL_VERSION";
        $with3.SetWidth(100.000000000000000000);
        var $with4 = this.grdTasks.GetColumns().Add$1();
        $with4.FAppearance.FFilterMatchLayout.FFont.FCharset = 1;
        $with4.FAppearance.FFilterMatchLayout.FFont.SetColor(65793);
        $with4.FAppearance.FFilterMatchLayout.FFont.SetHeight(-12);
        $with4.FAppearance.FFilterMatchLayout.FFont.SetName("Segoe UI");
        $with4.FAppearance.FFilterMatchLayout.FFont.SetStyle({});
        $with4.FAppearance.FFilterInverseMatchLayout.FFont.FCharset = 1;
        $with4.FAppearance.FFilterInverseMatchLayout.FFont.SetColor(65793);
        $with4.FAppearance.FFilterInverseMatchLayout.FFont.SetHeight(-12);
        $with4.FAppearance.FFilterInverseMatchLayout.FFont.SetName("Segoe UI");
        $with4.FAppearance.FFilterInverseMatchLayout.FFont.SetStyle({});
        $with4.FAppearance.FBandLayout.FFont.FCharset = 1;
        $with4.FAppearance.FBandLayout.FFont.SetColor(65793);
        $with4.FAppearance.FBandLayout.FFont.SetHeight(-12);
        $with4.FAppearance.FBandLayout.FFont.SetName("Segoe UI");
        $with4.FAppearance.FBandLayout.FFont.SetStyle({});
        $with4.FAppearance.FFixedLayout.FFont.FCharset = 1;
        $with4.FAppearance.FFixedLayout.FFont.SetColor(65793);
        $with4.FAppearance.FFixedLayout.FFont.SetHeight(-12);
        $with4.FAppearance.FFixedLayout.FFont.SetName("Segoe UI");
        $with4.FAppearance.FFixedLayout.FFont.SetStyle({});
        $with4.FAppearance.FFixedSelectedLayout.FFont.FCharset = 1;
        $with4.FAppearance.FFixedSelectedLayout.FFont.SetColor(65793);
        $with4.FAppearance.FFixedSelectedLayout.FFont.SetHeight(-12);
        $with4.FAppearance.FFixedSelectedLayout.FFont.SetName("Segoe UI");
        $with4.FAppearance.FFixedSelectedLayout.FFont.SetStyle({});
        $with4.FAppearance.FFocusedLayout.FFont.FCharset = 1;
        $with4.FAppearance.FFocusedLayout.FFont.SetColor(65793);
        $with4.FAppearance.FFocusedLayout.FFont.SetHeight(-12);
        $with4.FAppearance.FFocusedLayout.FFont.SetName("Segoe UI");
        $with4.FAppearance.FFocusedLayout.FFont.SetStyle({});
        $with4.FAppearance.FGroupLayout.FFont.FCharset = 1;
        $with4.FAppearance.FGroupLayout.FFont.SetColor(65793);
        $with4.FAppearance.FGroupLayout.FFont.SetHeight(-12);
        $with4.FAppearance.FGroupLayout.FFont.SetName("Segoe UI");
        $with4.FAppearance.FGroupLayout.FFont.SetStyle({});
        $with4.FAppearance.FNormalLayout.FFont.FCharset = 1;
        $with4.FAppearance.FNormalLayout.FFont.SetColor(65793);
        $with4.FAppearance.FNormalLayout.FFont.SetHeight(-12);
        $with4.FAppearance.FNormalLayout.FFont.SetName("Segoe UI");
        $with4.FAppearance.FNormalLayout.FFont.SetStyle({});
        $with4.FAppearance.FSelectedLayout.FFont.FCharset = 1;
        $with4.FAppearance.FSelectedLayout.FFont.SetColor(65793);
        $with4.FAppearance.FSelectedLayout.FFont.SetHeight(-12);
        $with4.FAppearance.FSelectedLayout.FFont.SetName("Segoe UI");
        $with4.FAppearance.FSelectedLayout.FFont.SetStyle({});
        $with4.FAppearance.FSummaryLayout.FFont.FCharset = 1;
        $with4.FAppearance.FSummaryLayout.FFont.SetColor(65793);
        $with4.FAppearance.FSummaryLayout.FFont.SetHeight(-12);
        $with4.FAppearance.FSummaryLayout.FFont.SetName("Segoe UI");
        $with4.FAppearance.FSummaryLayout.FFont.SetStyle({});
        $with4.SetHeader("Date");
        $with4.FName = "COL_TASK_DATE";
        var $with5 = this.grdTasks.GetColumns().Add$1();
        $with5.FAppearance.FFilterMatchLayout.FFont.FCharset = 1;
        $with5.FAppearance.FFilterMatchLayout.FFont.SetColor(65793);
        $with5.FAppearance.FFilterMatchLayout.FFont.SetHeight(-12);
        $with5.FAppearance.FFilterMatchLayout.FFont.SetName("Segoe UI");
        $with5.FAppearance.FFilterMatchLayout.FFont.SetStyle({});
        $with5.FAppearance.FFilterInverseMatchLayout.FFont.FCharset = 1;
        $with5.FAppearance.FFilterInverseMatchLayout.FFont.SetColor(65793);
        $with5.FAppearance.FFilterInverseMatchLayout.FFont.SetHeight(-12);
        $with5.FAppearance.FFilterInverseMatchLayout.FFont.SetName("Segoe UI");
        $with5.FAppearance.FFilterInverseMatchLayout.FFont.SetStyle({});
        $with5.FAppearance.FBandLayout.FFont.FCharset = 1;
        $with5.FAppearance.FBandLayout.FFont.SetColor(65793);
        $with5.FAppearance.FBandLayout.FFont.SetHeight(-12);
        $with5.FAppearance.FBandLayout.FFont.SetName("Segoe UI");
        $with5.FAppearance.FBandLayout.FFont.SetStyle({});
        $with5.FAppearance.FFixedLayout.FFont.FCharset = 1;
        $with5.FAppearance.FFixedLayout.FFont.SetColor(65793);
        $with5.FAppearance.FFixedLayout.FFont.SetHeight(-12);
        $with5.FAppearance.FFixedLayout.FFont.SetName("Segoe UI");
        $with5.FAppearance.FFixedLayout.FFont.SetStyle({});
        $with5.FAppearance.FFixedSelectedLayout.FFont.FCharset = 1;
        $with5.FAppearance.FFixedSelectedLayout.FFont.SetColor(65793);
        $with5.FAppearance.FFixedSelectedLayout.FFont.SetHeight(-12);
        $with5.FAppearance.FFixedSelectedLayout.FFont.SetName("Segoe UI");
        $with5.FAppearance.FFixedSelectedLayout.FFont.SetStyle({});
        $with5.FAppearance.FFocusedLayout.FFont.FCharset = 1;
        $with5.FAppearance.FFocusedLayout.FFont.SetColor(65793);
        $with5.FAppearance.FFocusedLayout.FFont.SetHeight(-12);
        $with5.FAppearance.FFocusedLayout.FFont.SetName("Segoe UI");
        $with5.FAppearance.FFocusedLayout.FFont.SetStyle({});
        $with5.FAppearance.FGroupLayout.FFont.FCharset = 1;
        $with5.FAppearance.FGroupLayout.FFont.SetColor(65793);
        $with5.FAppearance.FGroupLayout.FFont.SetHeight(-12);
        $with5.FAppearance.FGroupLayout.FFont.SetName("Segoe UI");
        $with5.FAppearance.FGroupLayout.FFont.SetStyle({});
        $with5.FAppearance.FNormalLayout.FFont.FCharset = 1;
        $with5.FAppearance.FNormalLayout.FFont.SetColor(65793);
        $with5.FAppearance.FNormalLayout.FFont.SetHeight(-12);
        $with5.FAppearance.FNormalLayout.FFont.SetName("Segoe UI");
        $with5.FAppearance.FNormalLayout.FFont.SetStyle({});
        $with5.FAppearance.FSelectedLayout.FFont.FCharset = 1;
        $with5.FAppearance.FSelectedLayout.FFont.SetColor(65793);
        $with5.FAppearance.FSelectedLayout.FFont.SetHeight(-12);
        $with5.FAppearance.FSelectedLayout.FFont.SetName("Segoe UI");
        $with5.FAppearance.FSelectedLayout.FFont.SetStyle({});
        $with5.FAppearance.FSummaryLayout.FFont.FCharset = 1;
        $with5.FAppearance.FSummaryLayout.FFont.SetColor(65793);
        $with5.FAppearance.FSummaryLayout.FFont.SetHeight(-12);
        $with5.FAppearance.FSummaryLayout.FFont.SetName("Segoe UI");
        $with5.FAppearance.FSummaryLayout.FFont.SetStyle({});
        $with5.SetHeader("Reported By");
        $with5.FName = "COL_REPORTED_BY";
        var $with6 = this.grdTasks.GetColumns().Add$1();
        $with6.FAppearance.FFilterMatchLayout.FFont.FCharset = 1;
        $with6.FAppearance.FFilterMatchLayout.FFont.SetColor(65793);
        $with6.FAppearance.FFilterMatchLayout.FFont.SetHeight(-12);
        $with6.FAppearance.FFilterMatchLayout.FFont.SetName("Segoe UI");
        $with6.FAppearance.FFilterMatchLayout.FFont.SetStyle({});
        $with6.FAppearance.FFilterInverseMatchLayout.FFont.FCharset = 1;
        $with6.FAppearance.FFilterInverseMatchLayout.FFont.SetColor(65793);
        $with6.FAppearance.FFilterInverseMatchLayout.FFont.SetHeight(-12);
        $with6.FAppearance.FFilterInverseMatchLayout.FFont.SetName("Segoe UI");
        $with6.FAppearance.FFilterInverseMatchLayout.FFont.SetStyle({});
        $with6.FAppearance.FBandLayout.FFont.FCharset = 1;
        $with6.FAppearance.FBandLayout.FFont.SetColor(65793);
        $with6.FAppearance.FBandLayout.FFont.SetHeight(-12);
        $with6.FAppearance.FBandLayout.FFont.SetName("Segoe UI");
        $with6.FAppearance.FBandLayout.FFont.SetStyle({});
        $with6.FAppearance.FFixedLayout.FFont.FCharset = 1;
        $with6.FAppearance.FFixedLayout.FFont.SetColor(65793);
        $with6.FAppearance.FFixedLayout.FFont.SetHeight(-12);
        $with6.FAppearance.FFixedLayout.FFont.SetName("Segoe UI");
        $with6.FAppearance.FFixedLayout.FFont.SetStyle({});
        $with6.FAppearance.FFixedSelectedLayout.FFont.FCharset = 1;
        $with6.FAppearance.FFixedSelectedLayout.FFont.SetColor(65793);
        $with6.FAppearance.FFixedSelectedLayout.FFont.SetHeight(-12);
        $with6.FAppearance.FFixedSelectedLayout.FFont.SetName("Segoe UI");
        $with6.FAppearance.FFixedSelectedLayout.FFont.SetStyle({});
        $with6.FAppearance.FFocusedLayout.FFont.FCharset = 1;
        $with6.FAppearance.FFocusedLayout.FFont.SetColor(65793);
        $with6.FAppearance.FFocusedLayout.FFont.SetHeight(-12);
        $with6.FAppearance.FFocusedLayout.FFont.SetName("Segoe UI");
        $with6.FAppearance.FFocusedLayout.FFont.SetStyle({});
        $with6.FAppearance.FGroupLayout.FFont.FCharset = 1;
        $with6.FAppearance.FGroupLayout.FFont.SetColor(65793);
        $with6.FAppearance.FGroupLayout.FFont.SetHeight(-12);
        $with6.FAppearance.FGroupLayout.FFont.SetName("Segoe UI");
        $with6.FAppearance.FGroupLayout.FFont.SetStyle({});
        $with6.FAppearance.FNormalLayout.FFont.FCharset = 1;
        $with6.FAppearance.FNormalLayout.FFont.SetColor(65793);
        $with6.FAppearance.FNormalLayout.FFont.SetHeight(-12);
        $with6.FAppearance.FNormalLayout.FFont.SetName("Segoe UI");
        $with6.FAppearance.FNormalLayout.FFont.SetStyle({});
        $with6.FAppearance.FSelectedLayout.FFont.FCharset = 1;
        $with6.FAppearance.FSelectedLayout.FFont.SetColor(65793);
        $with6.FAppearance.FSelectedLayout.FFont.SetHeight(-12);
        $with6.FAppearance.FSelectedLayout.FFont.SetName("Segoe UI");
        $with6.FAppearance.FSelectedLayout.FFont.SetStyle({});
        $with6.FAppearance.FSummaryLayout.FFont.FCharset = 1;
        $with6.FAppearance.FSummaryLayout.FFont.SetColor(65793);
        $with6.FAppearance.FSummaryLayout.FFont.SetHeight(-12);
        $with6.FAppearance.FSummaryLayout.FFont.SetName("Segoe UI");
        $with6.FAppearance.FSummaryLayout.FFont.SetStyle({});
        $with6.SetHeader("Assigned To");
        $with6.FName = "COL_ASSIGNED_TO";
        var $with7 = this.grdTasks.GetColumns().Add$1();
        $with7.FAppearance.FFilterMatchLayout.FFont.FCharset = 1;
        $with7.FAppearance.FFilterMatchLayout.FFont.SetColor(65793);
        $with7.FAppearance.FFilterMatchLayout.FFont.SetHeight(-12);
        $with7.FAppearance.FFilterMatchLayout.FFont.SetName("Segoe UI");
        $with7.FAppearance.FFilterMatchLayout.FFont.SetStyle({});
        $with7.FAppearance.FFilterInverseMatchLayout.FFont.FCharset = 1;
        $with7.FAppearance.FFilterInverseMatchLayout.FFont.SetColor(65793);
        $with7.FAppearance.FFilterInverseMatchLayout.FFont.SetHeight(-12);
        $with7.FAppearance.FFilterInverseMatchLayout.FFont.SetName("Segoe UI");
        $with7.FAppearance.FFilterInverseMatchLayout.FFont.SetStyle({});
        $with7.FAppearance.FBandLayout.FFont.FCharset = 1;
        $with7.FAppearance.FBandLayout.FFont.SetColor(65793);
        $with7.FAppearance.FBandLayout.FFont.SetHeight(-12);
        $with7.FAppearance.FBandLayout.FFont.SetName("Segoe UI");
        $with7.FAppearance.FBandLayout.FFont.SetStyle({});
        $with7.FAppearance.FFixedLayout.FFont.FCharset = 1;
        $with7.FAppearance.FFixedLayout.FFont.SetColor(65793);
        $with7.FAppearance.FFixedLayout.FFont.SetHeight(-12);
        $with7.FAppearance.FFixedLayout.FFont.SetName("Segoe UI");
        $with7.FAppearance.FFixedLayout.FFont.SetStyle({});
        $with7.FAppearance.FFixedSelectedLayout.FFont.FCharset = 1;
        $with7.FAppearance.FFixedSelectedLayout.FFont.SetColor(65793);
        $with7.FAppearance.FFixedSelectedLayout.FFont.SetHeight(-12);
        $with7.FAppearance.FFixedSelectedLayout.FFont.SetName("Segoe UI");
        $with7.FAppearance.FFixedSelectedLayout.FFont.SetStyle({});
        $with7.FAppearance.FFocusedLayout.FFont.FCharset = 1;
        $with7.FAppearance.FFocusedLayout.FFont.SetColor(65793);
        $with7.FAppearance.FFocusedLayout.FFont.SetHeight(-12);
        $with7.FAppearance.FFocusedLayout.FFont.SetName("Segoe UI");
        $with7.FAppearance.FFocusedLayout.FFont.SetStyle({});
        $with7.FAppearance.FGroupLayout.FFont.FCharset = 1;
        $with7.FAppearance.FGroupLayout.FFont.SetColor(65793);
        $with7.FAppearance.FGroupLayout.FFont.SetHeight(-12);
        $with7.FAppearance.FGroupLayout.FFont.SetName("Segoe UI");
        $with7.FAppearance.FGroupLayout.FFont.SetStyle({});
        $with7.FAppearance.FNormalLayout.FFont.FCharset = 1;
        $with7.FAppearance.FNormalLayout.FFont.SetColor(65793);
        $with7.FAppearance.FNormalLayout.FFont.SetHeight(-12);
        $with7.FAppearance.FNormalLayout.FFont.SetName("Segoe UI");
        $with7.FAppearance.FNormalLayout.FFont.SetStyle({});
        $with7.FAppearance.FSelectedLayout.FFont.FCharset = 1;
        $with7.FAppearance.FSelectedLayout.FFont.SetColor(65793);
        $with7.FAppearance.FSelectedLayout.FFont.SetHeight(-12);
        $with7.FAppearance.FSelectedLayout.FFont.SetName("Segoe UI");
        $with7.FAppearance.FSelectedLayout.FFont.SetStyle({});
        $with7.FAppearance.FSummaryLayout.FFont.FCharset = 1;
        $with7.FAppearance.FSummaryLayout.FFont.SetColor(65793);
        $with7.FAppearance.FSummaryLayout.FFont.SetHeight(-12);
        $with7.FAppearance.FSummaryLayout.FFont.SetName("Segoe UI");
        $with7.FAppearance.FSummaryLayout.FFont.SetStyle({});
        $with7.SetHeader("Status");
        $with7.FName = "COL_STATUS";
        var $with8 = this.grdTasks.GetColumns().Add$1();
        $with8.FAppearance.FFilterMatchLayout.FFont.FCharset = 1;
        $with8.FAppearance.FFilterMatchLayout.FFont.SetColor(65793);
        $with8.FAppearance.FFilterMatchLayout.FFont.SetHeight(-12);
        $with8.FAppearance.FFilterMatchLayout.FFont.SetName("Segoe UI");
        $with8.FAppearance.FFilterMatchLayout.FFont.SetStyle({});
        $with8.FAppearance.FFilterInverseMatchLayout.FFont.FCharset = 1;
        $with8.FAppearance.FFilterInverseMatchLayout.FFont.SetColor(65793);
        $with8.FAppearance.FFilterInverseMatchLayout.FFont.SetHeight(-12);
        $with8.FAppearance.FFilterInverseMatchLayout.FFont.SetName("Segoe UI");
        $with8.FAppearance.FFilterInverseMatchLayout.FFont.SetStyle({});
        $with8.FAppearance.FBandLayout.FFont.FCharset = 1;
        $with8.FAppearance.FBandLayout.FFont.SetColor(65793);
        $with8.FAppearance.FBandLayout.FFont.SetHeight(-12);
        $with8.FAppearance.FBandLayout.FFont.SetName("Segoe UI");
        $with8.FAppearance.FBandLayout.FFont.SetStyle({});
        $with8.FAppearance.FFixedLayout.FFont.FCharset = 1;
        $with8.FAppearance.FFixedLayout.FFont.SetColor(65793);
        $with8.FAppearance.FFixedLayout.FFont.SetHeight(-12);
        $with8.FAppearance.FFixedLayout.FFont.SetName("Segoe UI");
        $with8.FAppearance.FFixedLayout.FFont.SetStyle({});
        $with8.FAppearance.FFixedSelectedLayout.FFont.FCharset = 1;
        $with8.FAppearance.FFixedSelectedLayout.FFont.SetColor(65793);
        $with8.FAppearance.FFixedSelectedLayout.FFont.SetHeight(-12);
        $with8.FAppearance.FFixedSelectedLayout.FFont.SetName("Segoe UI");
        $with8.FAppearance.FFixedSelectedLayout.FFont.SetStyle({});
        $with8.FAppearance.FFocusedLayout.FFont.FCharset = 1;
        $with8.FAppearance.FFocusedLayout.FFont.SetColor(65793);
        $with8.FAppearance.FFocusedLayout.FFont.SetHeight(-12);
        $with8.FAppearance.FFocusedLayout.FFont.SetName("Segoe UI");
        $with8.FAppearance.FFocusedLayout.FFont.SetStyle({});
        $with8.FAppearance.FGroupLayout.FFont.FCharset = 1;
        $with8.FAppearance.FGroupLayout.FFont.SetColor(65793);
        $with8.FAppearance.FGroupLayout.FFont.SetHeight(-12);
        $with8.FAppearance.FGroupLayout.FFont.SetName("Segoe UI");
        $with8.FAppearance.FGroupLayout.FFont.SetStyle({});
        $with8.FAppearance.FNormalLayout.FFont.FCharset = 1;
        $with8.FAppearance.FNormalLayout.FFont.SetColor(65793);
        $with8.FAppearance.FNormalLayout.FFont.SetHeight(-12);
        $with8.FAppearance.FNormalLayout.FFont.SetName("Segoe UI");
        $with8.FAppearance.FNormalLayout.FFont.SetStyle({});
        $with8.FAppearance.FSelectedLayout.FFont.FCharset = 1;
        $with8.FAppearance.FSelectedLayout.FFont.SetColor(65793);
        $with8.FAppearance.FSelectedLayout.FFont.SetHeight(-12);
        $with8.FAppearance.FSelectedLayout.FFont.SetName("Segoe UI");
        $with8.FAppearance.FSelectedLayout.FFont.SetStyle({});
        $with8.FAppearance.FSummaryLayout.FFont.FCharset = 1;
        $with8.FAppearance.FSummaryLayout.FFont.SetColor(65793);
        $with8.FAppearance.FSummaryLayout.FFont.SetHeight(-12);
        $with8.FAppearance.FSummaryLayout.FFont.SetName("Segoe UI");
        $with8.FAppearance.FSummaryLayout.FFont.SetStyle({});
        $with8.SetHeader("Status Date");
        $with8.FName = "COL_STATUS_DATE";
        var $with9 = this.grdTasks.GetColumns().Add$1();
        $with9.FAppearance.FFilterMatchLayout.FFont.FCharset = 1;
        $with9.FAppearance.FFilterMatchLayout.FFont.SetColor(65793);
        $with9.FAppearance.FFilterMatchLayout.FFont.SetHeight(-12);
        $with9.FAppearance.FFilterMatchLayout.FFont.SetName("Segoe UI");
        $with9.FAppearance.FFilterMatchLayout.FFont.SetStyle({});
        $with9.FAppearance.FFilterInverseMatchLayout.FFont.FCharset = 1;
        $with9.FAppearance.FFilterInverseMatchLayout.FFont.SetColor(65793);
        $with9.FAppearance.FFilterInverseMatchLayout.FFont.SetHeight(-12);
        $with9.FAppearance.FFilterInverseMatchLayout.FFont.SetName("Segoe UI");
        $with9.FAppearance.FFilterInverseMatchLayout.FFont.SetStyle({});
        $with9.FAppearance.FBandLayout.FFont.FCharset = 1;
        $with9.FAppearance.FBandLayout.FFont.SetColor(65793);
        $with9.FAppearance.FBandLayout.FFont.SetHeight(-12);
        $with9.FAppearance.FBandLayout.FFont.SetName("Segoe UI");
        $with9.FAppearance.FBandLayout.FFont.SetStyle({});
        $with9.FAppearance.FFixedLayout.FFont.FCharset = 1;
        $with9.FAppearance.FFixedLayout.FFont.SetColor(65793);
        $with9.FAppearance.FFixedLayout.FFont.SetHeight(-12);
        $with9.FAppearance.FFixedLayout.FFont.SetName("Segoe UI");
        $with9.FAppearance.FFixedLayout.FFont.SetStyle({});
        $with9.FAppearance.FFixedSelectedLayout.FFont.FCharset = 1;
        $with9.FAppearance.FFixedSelectedLayout.FFont.SetColor(65793);
        $with9.FAppearance.FFixedSelectedLayout.FFont.SetHeight(-12);
        $with9.FAppearance.FFixedSelectedLayout.FFont.SetName("Segoe UI");
        $with9.FAppearance.FFixedSelectedLayout.FFont.SetStyle({});
        $with9.FAppearance.FFocusedLayout.FFont.FCharset = 1;
        $with9.FAppearance.FFocusedLayout.FFont.SetColor(65793);
        $with9.FAppearance.FFocusedLayout.FFont.SetHeight(-12);
        $with9.FAppearance.FFocusedLayout.FFont.SetName("Segoe UI");
        $with9.FAppearance.FFocusedLayout.FFont.SetStyle({});
        $with9.FAppearance.FGroupLayout.FFont.FCharset = 1;
        $with9.FAppearance.FGroupLayout.FFont.SetColor(65793);
        $with9.FAppearance.FGroupLayout.FFont.SetHeight(-12);
        $with9.FAppearance.FGroupLayout.FFont.SetName("Segoe UI");
        $with9.FAppearance.FGroupLayout.FFont.SetStyle({});
        $with9.FAppearance.FNormalLayout.FFont.FCharset = 1;
        $with9.FAppearance.FNormalLayout.FFont.SetColor(65793);
        $with9.FAppearance.FNormalLayout.FFont.SetHeight(-12);
        $with9.FAppearance.FNormalLayout.FFont.SetName("Segoe UI");
        $with9.FAppearance.FNormalLayout.FFont.SetStyle({});
        $with9.FAppearance.FSelectedLayout.FFont.FCharset = 1;
        $with9.FAppearance.FSelectedLayout.FFont.SetColor(65793);
        $with9.FAppearance.FSelectedLayout.FFont.SetHeight(-12);
        $with9.FAppearance.FSelectedLayout.FFont.SetName("Segoe UI");
        $with9.FAppearance.FSelectedLayout.FFont.SetStyle({});
        $with9.FAppearance.FSummaryLayout.FFont.FCharset = 1;
        $with9.FAppearance.FSummaryLayout.FFont.SetColor(65793);
        $with9.FAppearance.FSummaryLayout.FFont.SetHeight(-12);
        $with9.FAppearance.FSummaryLayout.FFont.SetName("Segoe UI");
        $with9.FAppearance.FSummaryLayout.FFont.SetStyle({});
        $with9.SetHeader("Fixed Version");
        $with9.FName = "COL_FIXED_VER";
        var $with10 = this.grdTasks.GetColumns().Add$1();
        $with10.FAppearance.FFilterMatchLayout.FFont.FCharset = 1;
        $with10.FAppearance.FFilterMatchLayout.FFont.SetColor(65793);
        $with10.FAppearance.FFilterMatchLayout.FFont.SetHeight(-12);
        $with10.FAppearance.FFilterMatchLayout.FFont.SetName("Segoe UI");
        $with10.FAppearance.FFilterMatchLayout.FFont.SetStyle({});
        $with10.FAppearance.FFilterInverseMatchLayout.FFont.FCharset = 1;
        $with10.FAppearance.FFilterInverseMatchLayout.FFont.SetColor(65793);
        $with10.FAppearance.FFilterInverseMatchLayout.FFont.SetHeight(-12);
        $with10.FAppearance.FFilterInverseMatchLayout.FFont.SetName("Segoe UI");
        $with10.FAppearance.FFilterInverseMatchLayout.FFont.SetStyle({});
        $with10.FAppearance.FBandLayout.FFont.FCharset = 1;
        $with10.FAppearance.FBandLayout.FFont.SetColor(65793);
        $with10.FAppearance.FBandLayout.FFont.SetHeight(-12);
        $with10.FAppearance.FBandLayout.FFont.SetName("Segoe UI");
        $with10.FAppearance.FBandLayout.FFont.SetStyle({});
        $with10.FAppearance.FFixedLayout.FFont.FCharset = 1;
        $with10.FAppearance.FFixedLayout.FFont.SetColor(65793);
        $with10.FAppearance.FFixedLayout.FFont.SetHeight(-12);
        $with10.FAppearance.FFixedLayout.FFont.SetName("Segoe UI");
        $with10.FAppearance.FFixedLayout.FFont.SetStyle({});
        $with10.FAppearance.FFixedSelectedLayout.FFont.FCharset = 1;
        $with10.FAppearance.FFixedSelectedLayout.FFont.SetColor(65793);
        $with10.FAppearance.FFixedSelectedLayout.FFont.SetHeight(-12);
        $with10.FAppearance.FFixedSelectedLayout.FFont.SetName("Segoe UI");
        $with10.FAppearance.FFixedSelectedLayout.FFont.SetStyle({});
        $with10.FAppearance.FFocusedLayout.FFont.FCharset = 1;
        $with10.FAppearance.FFocusedLayout.FFont.SetColor(65793);
        $with10.FAppearance.FFocusedLayout.FFont.SetHeight(-12);
        $with10.FAppearance.FFocusedLayout.FFont.SetName("Segoe UI");
        $with10.FAppearance.FFocusedLayout.FFont.SetStyle({});
        $with10.FAppearance.FGroupLayout.FFont.FCharset = 1;
        $with10.FAppearance.FGroupLayout.FFont.SetColor(65793);
        $with10.FAppearance.FGroupLayout.FFont.SetHeight(-12);
        $with10.FAppearance.FGroupLayout.FFont.SetName("Segoe UI");
        $with10.FAppearance.FGroupLayout.FFont.SetStyle({});
        $with10.FAppearance.FNormalLayout.FFont.FCharset = 1;
        $with10.FAppearance.FNormalLayout.FFont.SetColor(65793);
        $with10.FAppearance.FNormalLayout.FFont.SetHeight(-12);
        $with10.FAppearance.FNormalLayout.FFont.SetName("Segoe UI");
        $with10.FAppearance.FNormalLayout.FFont.SetStyle({});
        $with10.FAppearance.FSelectedLayout.FFont.FCharset = 1;
        $with10.FAppearance.FSelectedLayout.FFont.SetColor(65793);
        $with10.FAppearance.FSelectedLayout.FFont.SetHeight(-12);
        $with10.FAppearance.FSelectedLayout.FFont.SetName("Segoe UI");
        $with10.FAppearance.FSelectedLayout.FFont.SetStyle({});
        $with10.FAppearance.FSummaryLayout.FFont.FCharset = 1;
        $with10.FAppearance.FSummaryLayout.FFont.SetColor(65793);
        $with10.FAppearance.FSummaryLayout.FFont.SetHeight(-12);
        $with10.FAppearance.FSummaryLayout.FFont.SetName("Segoe UI");
        $with10.FAppearance.FSummaryLayout.FFont.SetStyle({});
        $with10.SetHeader("Form (Section)");
        $with10.FName = "COL_FORM_SECTION";
        $with10.SetSettings(rtl.createSet(pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridColumnSetting.gcsEditor));
        var $with11 = this.grdTasks.GetColumns().Add$1();
        $with11.FAppearance.FFilterMatchLayout.FFont.FCharset = 1;
        $with11.FAppearance.FFilterMatchLayout.FFont.SetColor(65793);
        $with11.FAppearance.FFilterMatchLayout.FFont.SetHeight(-12);
        $with11.FAppearance.FFilterMatchLayout.FFont.SetName("Segoe UI");
        $with11.FAppearance.FFilterMatchLayout.FFont.SetStyle({});
        $with11.FAppearance.FFilterInverseMatchLayout.FFont.FCharset = 1;
        $with11.FAppearance.FFilterInverseMatchLayout.FFont.SetColor(65793);
        $with11.FAppearance.FFilterInverseMatchLayout.FFont.SetHeight(-12);
        $with11.FAppearance.FFilterInverseMatchLayout.FFont.SetName("Segoe UI");
        $with11.FAppearance.FFilterInverseMatchLayout.FFont.SetStyle({});
        $with11.FAppearance.FBandLayout.FFont.FCharset = 1;
        $with11.FAppearance.FBandLayout.FFont.SetColor(65793);
        $with11.FAppearance.FBandLayout.FFont.SetHeight(-12);
        $with11.FAppearance.FBandLayout.FFont.SetName("Segoe UI");
        $with11.FAppearance.FBandLayout.FFont.SetStyle({});
        $with11.FAppearance.FFixedLayout.FFont.FCharset = 1;
        $with11.FAppearance.FFixedLayout.FFont.SetColor(65793);
        $with11.FAppearance.FFixedLayout.FFont.SetHeight(-12);
        $with11.FAppearance.FFixedLayout.FFont.SetName("Segoe UI");
        $with11.FAppearance.FFixedLayout.FFont.SetStyle({});
        $with11.FAppearance.FFixedSelectedLayout.FFont.FCharset = 1;
        $with11.FAppearance.FFixedSelectedLayout.FFont.SetColor(65793);
        $with11.FAppearance.FFixedSelectedLayout.FFont.SetHeight(-12);
        $with11.FAppearance.FFixedSelectedLayout.FFont.SetName("Segoe UI");
        $with11.FAppearance.FFixedSelectedLayout.FFont.SetStyle({});
        $with11.FAppearance.FFocusedLayout.FFont.FCharset = 1;
        $with11.FAppearance.FFocusedLayout.FFont.SetColor(65793);
        $with11.FAppearance.FFocusedLayout.FFont.SetHeight(-12);
        $with11.FAppearance.FFocusedLayout.FFont.SetName("Segoe UI");
        $with11.FAppearance.FFocusedLayout.FFont.SetStyle({});
        $with11.FAppearance.FGroupLayout.FFont.FCharset = 1;
        $with11.FAppearance.FGroupLayout.FFont.SetColor(65793);
        $with11.FAppearance.FGroupLayout.FFont.SetHeight(-12);
        $with11.FAppearance.FGroupLayout.FFont.SetName("Segoe UI");
        $with11.FAppearance.FGroupLayout.FFont.SetStyle({});
        $with11.FAppearance.FNormalLayout.FFont.FCharset = 1;
        $with11.FAppearance.FNormalLayout.FFont.SetColor(65793);
        $with11.FAppearance.FNormalLayout.FFont.SetHeight(-12);
        $with11.FAppearance.FNormalLayout.FFont.SetName("Segoe UI");
        $with11.FAppearance.FNormalLayout.FFont.SetStyle({});
        $with11.FAppearance.FSelectedLayout.FFont.FCharset = 1;
        $with11.FAppearance.FSelectedLayout.FFont.SetColor(65793);
        $with11.FAppearance.FSelectedLayout.FFont.SetHeight(-12);
        $with11.FAppearance.FSelectedLayout.FFont.SetName("Segoe UI");
        $with11.FAppearance.FSelectedLayout.FFont.SetStyle({});
        $with11.FAppearance.FSummaryLayout.FFont.FCharset = 1;
        $with11.FAppearance.FSummaryLayout.FFont.SetColor(65793);
        $with11.FAppearance.FSummaryLayout.FFont.SetHeight(-12);
        $with11.FAppearance.FSummaryLayout.FFont.SetName("Segoe UI");
        $with11.FAppearance.FSummaryLayout.FFont.SetStyle({});
        $with11.SetEditor(pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridInplaceEditorType.getMemo);
        $with11.SetHeader("Issue");
        $with11.FName = "COL_ISSUE";
        $with11.SetSettings(rtl.createSet(pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridColumnSetting.gcsEditor));
        $with11.SetWidth(300.000000000000000000);
        var $with12 = this.grdTasks.GetColumns().Add$1();
        $with12.FAppearance.FFilterMatchLayout.FFont.FCharset = 1;
        $with12.FAppearance.FFilterMatchLayout.FFont.SetColor(65793);
        $with12.FAppearance.FFilterMatchLayout.FFont.SetHeight(-12);
        $with12.FAppearance.FFilterMatchLayout.FFont.SetName("Segoe UI");
        $with12.FAppearance.FFilterMatchLayout.FFont.SetStyle({});
        $with12.FAppearance.FFilterInverseMatchLayout.FFont.FCharset = 1;
        $with12.FAppearance.FFilterInverseMatchLayout.FFont.SetColor(65793);
        $with12.FAppearance.FFilterInverseMatchLayout.FFont.SetHeight(-12);
        $with12.FAppearance.FFilterInverseMatchLayout.FFont.SetName("Segoe UI");
        $with12.FAppearance.FFilterInverseMatchLayout.FFont.SetStyle({});
        $with12.FAppearance.FBandLayout.FFont.FCharset = 1;
        $with12.FAppearance.FBandLayout.FFont.SetColor(65793);
        $with12.FAppearance.FBandLayout.FFont.SetHeight(-12);
        $with12.FAppearance.FBandLayout.FFont.SetName("Segoe UI");
        $with12.FAppearance.FBandLayout.FFont.SetStyle({});
        $with12.FAppearance.FFixedLayout.FFont.FCharset = 1;
        $with12.FAppearance.FFixedLayout.FFont.SetColor(65793);
        $with12.FAppearance.FFixedLayout.FFont.SetHeight(-12);
        $with12.FAppearance.FFixedLayout.FFont.SetName("Segoe UI");
        $with12.FAppearance.FFixedLayout.FFont.SetStyle({});
        $with12.FAppearance.FFixedSelectedLayout.FFont.FCharset = 1;
        $with12.FAppearance.FFixedSelectedLayout.FFont.SetColor(65793);
        $with12.FAppearance.FFixedSelectedLayout.FFont.SetHeight(-12);
        $with12.FAppearance.FFixedSelectedLayout.FFont.SetName("Segoe UI");
        $with12.FAppearance.FFixedSelectedLayout.FFont.SetStyle({});
        $with12.FAppearance.FFocusedLayout.FFont.FCharset = 1;
        $with12.FAppearance.FFocusedLayout.FFont.SetColor(65793);
        $with12.FAppearance.FFocusedLayout.FFont.SetHeight(-12);
        $with12.FAppearance.FFocusedLayout.FFont.SetName("Segoe UI");
        $with12.FAppearance.FFocusedLayout.FFont.SetStyle({});
        $with12.FAppearance.FGroupLayout.FFont.FCharset = 1;
        $with12.FAppearance.FGroupLayout.FFont.SetColor(65793);
        $with12.FAppearance.FGroupLayout.FFont.SetHeight(-12);
        $with12.FAppearance.FGroupLayout.FFont.SetName("Segoe UI");
        $with12.FAppearance.FGroupLayout.FFont.SetStyle({});
        $with12.FAppearance.FNormalLayout.FFont.FCharset = 1;
        $with12.FAppearance.FNormalLayout.FFont.SetColor(65793);
        $with12.FAppearance.FNormalLayout.FFont.SetHeight(-12);
        $with12.FAppearance.FNormalLayout.FFont.SetName("Segoe UI");
        $with12.FAppearance.FNormalLayout.FFont.SetStyle({});
        $with12.FAppearance.FSelectedLayout.FFont.FCharset = 1;
        $with12.FAppearance.FSelectedLayout.FFont.SetColor(65793);
        $with12.FAppearance.FSelectedLayout.FFont.SetHeight(-12);
        $with12.FAppearance.FSelectedLayout.FFont.SetName("Segoe UI");
        $with12.FAppearance.FSelectedLayout.FFont.SetStyle({});
        $with12.FAppearance.FSummaryLayout.FFont.FCharset = 1;
        $with12.FAppearance.FSummaryLayout.FFont.SetColor(65793);
        $with12.FAppearance.FSummaryLayout.FFont.SetHeight(-12);
        $with12.FAppearance.FSummaryLayout.FFont.SetName("Segoe UI");
        $with12.FAppearance.FSummaryLayout.FFont.SetStyle({});
        $with12.SetEditor(pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridInplaceEditorType.getMemo);
        $with12.SetHeader("Notes");
        $with12.FName = "COL_NOTES";
        $with12.SetSettings(rtl.createSet(pas["WEBLib.TMSFNCDataGridRenderer"].TTMSFNCDataGridColumnSetting.gcsEditor));
        $with12.SetWidth(300.000000000000000000);
        this.grdTasks.SetDesigner(false);
        this.grdTasks.GetFilterAppearance().FFont.FCharset = 1;
        this.grdTasks.GetFilterAppearance().FFont.SetColor(0);
        this.grdTasks.GetFilterAppearance().FFont.SetHeight(-12);
        this.grdTasks.GetFilterAppearance().FFont.SetName("Segoe UI");
        this.grdTasks.GetFilterAppearance().FFont.SetStyle({});
        this.grdTasks.GetIcons().FExpandIcon.LoadFromFile("View.Tasks.pnlGrid.grdTasks.Icons.ExpandIcon.svg",null);
        this.grdTasks.GetIcons().FCollapseIcon.LoadFromFile("View.Tasks.pnlGrid.grdTasks.Icons.CollapseIcon.svg",null);
        this.grdTasks.GetIcons().FFilterIcon.LoadFromFile("View.Tasks.pnlGrid.grdTasks.Icons.FilterIcon.svg",null);
        this.grdTasks.GetIcons().FFilterActiveIcon.LoadFromFile("View.Tasks.pnlGrid.grdTasks.Icons.FilterActiveIcon.svg",null);
        this.grdTasks.GetIcons().FFilterClearIcon.LoadFromFile("View.Tasks.pnlGrid.grdTasks.Icons.FilterClearIcon.svg",null);
        this.grdTasks.GetIcons().FFilterTypeIcon.LoadFromFile("View.Tasks.pnlGrid.grdTasks.Icons.FilterTypeIcon.svg",null);
        this.grdTasks.GetIcons().FSortAscendingIcon.LoadFromFile("View.Tasks.pnlGrid.grdTasks.Icons.SortAscendingIcon.svg",null);
        this.grdTasks.GetIcons().FSortDescendingIcon.LoadFromFile("View.Tasks.pnlGrid.grdTasks.Icons.SortDescendingIcon.svg",null);
        this.grdTasks.GetIcons().FCloseIcon.LoadFromFile("View.Tasks.pnlGrid.grdTasks.Icons.CloseIcon.svg",null);
        this.grdTasks.GetIcons().FFirstPageIcon.LoadFromFile("View.Tasks.pnlGrid.grdTasks.Icons.FirstPageIcon.svg",null);
        this.grdTasks.GetIcons().FLastPageIcon.LoadFromFile("View.Tasks.pnlGrid.grdTasks.Icons.LastPageIcon.svg",null);
        this.grdTasks.GetIcons().FNextPageIcon.LoadFromFile("View.Tasks.pnlGrid.grdTasks.Icons.NextPageIcon.svg",null);
        this.grdTasks.GetIcons().FPreviousPageIcon.LoadFromFile("View.Tasks.pnlGrid.grdTasks.Icons.PreviousPageIcon.svg",null);
        this.xdwcTasks.SetParentComponent(this);
        this.xdwcTasks.SetName("xdwcTasks");
        this.xdwcTasks.SetConnection(pas.ConnectionModule.DMConnection.ApiConnection);
        this.xdwcTasks.SetLeft(690);
        this.xdwcTasks.SetTop(246);
      } finally {
        this.pnlGrid.AfterLoadDFMValues();
        this.grdTasks.AfterLoadDFMValues();
        this.xdwcTasks.AfterLoadDFMValues();
      };
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addField("xdwcTasks",pas["XData.Web.Client"].$rtti["TXDataWebClient"],4);
    $r.addField("pnlGrid",pas["WEBLib.ExtCtrls"].$rtti["TPanel"],4);
    $r.addField("grdTasks",pas["WEBLib.TMSFNCDataGrid"].$rtti["TTMSFNCDataGrid"],4);
    $r.addMethod("WebFormCreate",0,[["Sender",pas.System.$rtti["TObject"]]],4);
  });
  this.FTasks = null;
  $mod.$implcode = function () {
    $impl.COL_TASK_ITEM_ID = 0;
    $impl.COL_TASK_ID = 1;
    $impl.COL_APP = 2;
    $impl.COL_VERSION = 3;
    $impl.COL_TASK_DATE = 4;
    $impl.COL_REPORTED_BY = 5;
    $impl.COL_ASSIGNED_TO = 6;
    $impl.COL_STATUS = 7;
    $impl.COL_STATUS_DATE = 8;
    $impl.COL_FIXED_VER = 9;
    $impl.COL_FORM_SECTION = 10;
    $impl.COL_ISSUE = 11;
    $impl.COL_NOTES = 12;
  };
},["ConnectionModule"]);
rtl.module("View.TasksHTML",["System","SysUtils","Classes","JS","Web","WEBLib.Graphics","WEBLib.Controls","WEBLib.Forms","WEBLib.Dialogs","WEBLib.ExtCtrls","XData.Web.Client","XData.Web.Dataset","Utils","DB","XData.Web.JsonDataset","WEBLib.Controls","WEBLib.StdCtrls","WEBLib.StdCtrls"],function () {
  "use strict";
  var $mod = this;
  rtl.createClass(this,"TFTasksHTML",pas["WEBLib.Forms"].TForm,function () {
    this.$init = function () {
      pas["WEBLib.Forms"].TForm.$init.call(this);
      this.xdwcTasks = null;
      this.xdwdsTasks = null;
      this.xdwdsTaskstaskId = null;
      this.xdwdsTasksapplication = null;
      this.xdwdsTasksversion = null;
      this.xdwdsTaskstaskDate = null;
      this.xdwdsTasksreportedBy = null;
      this.xdwdsTasksassignedTo = null;
      this.xdwdsTasksstatus = null;
      this.xdwdsTasksstatusDate = null;
      this.xdwdsTasksformSection = null;
      this.xdwdsTasksissue = null;
      this.xdwdsTasksnotes = null;
      this.btnReload = null;
      this.btnAddRow = null;
      this.xdwdsTaskstaskItemId = null;
      this.FTaskId = "";
    };
    this.$final = function () {
      this.xdwcTasks = undefined;
      this.xdwdsTasks = undefined;
      this.xdwdsTaskstaskId = undefined;
      this.xdwdsTasksapplication = undefined;
      this.xdwdsTasksversion = undefined;
      this.xdwdsTaskstaskDate = undefined;
      this.xdwdsTasksreportedBy = undefined;
      this.xdwdsTasksassignedTo = undefined;
      this.xdwdsTasksstatus = undefined;
      this.xdwdsTasksstatusDate = undefined;
      this.xdwdsTasksformSection = undefined;
      this.xdwdsTasksissue = undefined;
      this.xdwdsTasksnotes = undefined;
      this.btnReload = undefined;
      this.btnAddRow = undefined;
      this.xdwdsTaskstaskItemId = undefined;
      pas["WEBLib.Forms"].TForm.$final.call(this);
    };
    this.btnAddRowClick = function (Sender) {
      pas.Utils.ShowErrorModal("Add row is not enabled yet.");
    };
    this.btnReloadClick = function (Sender) {
      if (this.FTaskId === "") {
        pas.Utils.ShowErrorModal("Missing Task Id. Update url params or resend from emT3.");
        return;
      };
      this.LoadTasks(this.FTaskId);
    };
    this.WebFormShow = function (Sender) {
      var $Self = this;
      window.console.log("TFTasksHTML.WebFormShow fired");
      this.FTaskId = window.localStorage.getItem("EMT3_TASK_ID");
      window.console.log("The task id is: " + this.FTaskId);
      if (this.FTaskId === "") {
        pas.Utils.ShowErrorModal("Missing task_id. Please reopen from emt3.");
        return;
      };
      this.btnAddRow.SetEnabled(false);
      if (!pas.ConnectionModule.DMConnection.ApiConnection.GetConnected()) {
        pas.ConnectionModule.DMConnection.ApiConnection.Open(function () {
          $Self.LoadTasks($Self.FTaskId);
        },null);
      } else this.LoadTasks(this.FTaskId);
    };
    this.LoadTasks = async function (ATaskId) {
      var response = null;
      var resultObj = null;
      var taskObj = null;
      var tasksArray = null;
      var itemsArray = null;
      var flatItems = null;
      var taskIndex = 0;
      var itemIndex = 0;
      window.console.log("Load Tasks Fired");
      this.SetTaskLabel(ATaskId);
      pas.Utils.ShowSpinner("spinner");
      try {
        try {
          response = await this.xdwcTasks.RawInvokeAsync("IApiService.GetTaskItems",[ATaskId]);
        } catch ($e) {
          if (pas["XData.Web.Client"].EXDataClientRequestException.isPrototypeOf($e)) {
            var E = $e;
            pas.Utils.ShowErrorModal(E.FErrorResult.FErrorMessage);
            return;
          } else throw $e
        };
        if (!pas.System.Assigned(response.FResult)) return;
        resultObj = response.FResult;
        tasksArray = resultObj["data"];
        flatItems = new Array();
        for (var $l = 0, $end = tasksArray.length - 1; $l <= $end; $l++) {
          taskIndex = $l;
          taskObj = tasksArray[taskIndex];
          itemsArray = taskObj["items"];
          for (var $l1 = 0, $end1 = itemsArray.length - 1; $l1 <= $end1; $l1++) {
            itemIndex = $l1;
            flatItems.push(itemsArray[itemIndex]);
          };
        };
        this.xdwdsTasks.Close();
        this.xdwdsTasks.SetJsonData(flatItems);
        this.xdwdsTasks.Open();
        this.RenderTable();
      } finally {
        pas.Utils.HideSpinner("spinner");
      };
    };
    var Statuses = ["Open","In Progress","Blocked","Testing","Done","Closed"];
    this.RenderTable = function () {
      var $Self = this;
      var host = null;
      var html = "";
      var rowIdx = 0;
      function Th(s) {
        var Result = "";
        Result = '<th scope="col">' + s + "</th>";
        return Result;
      };
      function TdNowrap(s) {
        var Result = "";
        Result = '<td class="align-top nowrap-cell">' + s + "</td>";
        return Result;
      };
      function TdWrap(s) {
        var Result = "";
        Result = '<td class="align-top wrap-cell">' + s + "</td>";
        return Result;
      };
      function TextInput(FieldName, Value, AIdx, MinWidth) {
        var Result = "";
        var w = "";
        w = "";
        if (MinWidth > 0) w = ' style="min-width: ' + pas.SysUtils.IntToStr(MinWidth) + 'px;"';
        Result = '<input class="form-control form-control-sm cell-input task-editor w-100" ' + 'data-idx="' + pas.SysUtils.IntToStr(AIdx) + '" data-field="' + FieldName + '" ' + 'value="' + $Self.HtmlEncode(Value) + '"' + w + ">";
        return Result;
      };
      function TextArea(FieldName, Value, AIdx) {
        var Result = "";
        Result = '<textarea class="form-control form-control-sm cell-textarea task-editor w-100" ' + 'data-idx="' + pas.SysUtils.IntToStr(AIdx) + '" data-field="' + FieldName + '" ' + 'rows="2">' + $Self.HtmlEncode(Value) + "</textarea>";
        return Result;
      };
      function DateInput(FieldName, Value, AIdx, MinWidth) {
        var Result = "";
        var w = "";
        w = "";
        if (MinWidth > 0) w = ' style="min-width: ' + pas.SysUtils.IntToStr(MinWidth) + 'px;"';
        Result = '<input type="date" class="form-control form-control-sm cell-input task-editor w-100" ' + 'data-idx="' + pas.SysUtils.IntToStr(AIdx) + '" data-field="' + FieldName + '" ' + 'value="' + $Self.HtmlEncode(Value) + '"' + w + ">";
        return Result;
      };
      function SelectList(FieldName, Current, AIdx, Items) {
        var Result = "";
        var i = 0;
        var sel = "";
        Result = '<select class="form-select form-select-sm task-select" ' + 'data-idx="' + pas.SysUtils.IntToStr(AIdx) + '" data-field="' + FieldName + '">';
        sel = "";
        if (pas.SysUtils.Trim(Current) === "") sel = " selected";
        Result = Result + '<option value=""' + sel + "></option>";
        for (var $l = 0, $end = rtl.length(Items) - 1; $l <= $end; $l++) {
          i = $l;
          sel = "";
          if (pas.SysUtils.SameText(Current,Items[i])) sel = " selected";
          Result = Result + '<option value="' + $Self.HtmlEncode(Items[i]) + '"' + sel + ">" + $Self.HtmlEncode(Items[i]) + "</option>";
        };
        Result = Result + "</select>";
        return Result;
      };
      function StatusSelect(Current, AIdx) {
        var Result = "";
        var i = 0;
        var sel = "";
        Result = '<select class="form-select form-select-sm task-select" data-idx="' + pas.SysUtils.IntToStr(AIdx) + '" data-field="status">';
        for (i = 0; i <= 5; i++) {
          sel = "";
          if (pas.SysUtils.SameText(Current,Statuses[i])) sel = " selected";
          Result = Result + '<option value="' + $Self.HtmlEncode(Statuses[i]) + '"' + sel + ">" + $Self.HtmlEncode(Statuses[i]) + "</option>";
        };
        Result = Result + "</select>";
        return Result;
      };
      host = document.getElementById("tasks_table_host");
      if (!(host != null)) return;
      html = '<div class="tasks-vscroll">' + '<div class="tasks-hscroll">' + '<table class="table table-sm table-bordered table-hover align-middle mb-0">' + "<colgroup>" + '<col style="width:110px">' + '<col style="width:240px">' + '<col style="width:90px">' + '<col style="width:120px">' + '<col style="width:120px">' + '<col style="width:120px">' + '<col style="width:140px">' + '<col style="width:140px">' + '<col style="width:160px">' + '<col style="width:520px">' + '<col style="width:520px">' + "</colgroup>" + "<thead><tr>" + Th("Task") + Th("App") + Th("Version") + Th("Date") + Th("Reported") + Th("Assigned") + Th("Status") + Th("Status Date") + Th("Form") + Th("Issue") + Th("Notes") + "</tr></thead><tbody>";
      rowIdx = 0;
      this.xdwdsTasks.First();
      while (!this.xdwdsTasks.GetEOF()) {
        html = html + "<tr>" + TdNowrap(TextInput("taskId",this.xdwdsTaskstaskId.GetAsString(),rowIdx,90)) + TdNowrap(TextInput("application",this.xdwdsTasksapplication.GetAsString(),rowIdx,180)) + TdNowrap(TextInput("version",this.xdwdsTasksversion.GetAsString(),rowIdx,80)) + TdNowrap(DateInput("taskDate",this.xdwdsTaskstaskDate.GetAsString(),rowIdx,110)) + TdNowrap(SelectList("reportedBy",this.xdwdsTasksreportedBy.GetAsString(),rowIdx,["Elias","Mac","Mark"])) + TdNowrap(SelectList("assignedTo",this.xdwdsTasksassignedTo.GetAsString(),rowIdx,["Elias","Mac","Mark"])) + TdNowrap(StatusSelect(this.xdwdsTasksstatus.GetAsString(),rowIdx)) + TdNowrap(DateInput("statusDate",this.xdwdsTasksstatusDate.GetAsString(),rowIdx,110)) + TdNowrap(TextInput("formSection",this.xdwdsTasksformSection.GetAsString(),rowIdx,160)) + TdWrap(TextArea("issue",this.xdwdsTasksissue.GetAsString(),rowIdx)) + TdWrap(TextArea("notes",this.xdwdsTasksnotes.GetAsString(),rowIdx)) + "</tr>";
        this.xdwdsTasks.Next();
        rowIdx += 1;
      };
      html = html + "</tbody></table></div></div>";
      host.innerHTML = html;
      this.BindTableEditors();
      this.EnableAutoGrowTextAreas();
      this.EnableColumnResize();
    };
    this.BindTableEditors = function () {
      var nodes = null;
      var i = 0;
      var el = null;
      window.console.log("BindTableEditors: wiring handlers...");
      nodes = document.querySelectorAll(".task-editor");
      window.console.log("BindTableEditors: task-editor count=" + pas.SysUtils.IntToStr(nodes.length));
      for (var $l = 0, $end = nodes.length - 1; $l <= $end; $l++) {
        i = $l;
        el = nodes.item(i);
        el.addEventListener("input",rtl.createCallback(this,"EditorInput"));
        el.addEventListener("blur",rtl.createCallback(this,"EditorBlur"));
      };
      nodes = document.querySelectorAll(".task-select");
      window.console.log("BindTableEditors: task-select count=" + pas.SysUtils.IntToStr(nodes.length));
      for (var $l1 = 0, $end1 = nodes.length - 1; $l1 <= $end1; $l1++) {
        i = $l1;
        el = nodes.item(i);
        el.addEventListener("change",rtl.createCallback(this,"SelectChange"));
      };
    };
    this.EditorInput = function (Event) {
      var el = null;
      var idx = 0;
      var idxStr = "";
      var fieldName = "";
      var newVal = "";
      if (!this.xdwdsTasks.GetActive()) return;
      el = Event.target;
      idxStr = el.getAttribute("data-idx");
      fieldName = el.getAttribute("data-field");
      idx = pas.SysUtils.StrToIntDef(idxStr,-1);
      if ((idx < 0) || (fieldName === "")) return;
      this.GotoRowIndex(idx);
      if (this.xdwdsTasks.GetEOF()) return;
      newVal = "" + el["value"];
      window.console.log("EditorInput: idx=" + pas.SysUtils.IntToStr(idx) + " field=" + fieldName + " val=" + newVal);
      this.xdwdsTasks.Edit();
      this.xdwdsTasks.FieldByName(fieldName).SetAsString(newVal);
      this.xdwdsTasks.Post();
      el.setAttribute("data-unsaved-data","1");
    };
    this.SelectChange = function (Event) {
      var el = null;
      var idx = 0;
      var idxStr = "";
      var fieldName = "";
      var sel = null;
      if (!this.xdwdsTasks.GetActive()) return;
      el = Event.target;
      idxStr = el.getAttribute("data-idx");
      fieldName = el.getAttribute("data-field");
      idx = pas.SysUtils.StrToIntDef(idxStr,-1);
      if ((idx < 0) || (fieldName === "")) return;
      this.GotoRowIndex(idx);
      if (this.xdwdsTasks.GetEOF()) return;
      sel = el;
      window.console.log("SelectChange: idx=" + pas.SysUtils.IntToStr(idx) + " field=" + fieldName + " val=" + sel.value);
      this.xdwdsTasks.Edit();
      this.xdwdsTasks.FieldByName(fieldName).SetAsString(sel.value);
      this.xdwdsTasks.Post();
      el.setAttribute("data-unsaved-data","1");
      this.SaveRow(idx);
    };
    this.EnableColumnResize = function () {
      (function(){
            const host = document.getElementById('tasks_table_host');
            if(!host) return;
            const table = host.querySelector('table');
            if(!table) return;
            const ths = table.querySelectorAll('thead th');
            ths.forEach(th => {
              th.classList.add('th-resize');
              if(th.querySelector('.th-resize-handle')) return;
      
              const handle = document.createElement('div');
              handle.className = 'th-resize-handle';
              th.appendChild(handle);
      
              handle.addEventListener('mousedown', function(e){
                e.preventDefault();
                const startX = e.clientX;
                const startW = th.getBoundingClientRect().width;
      
                function onMove(ev){
                  const w = Math.max(40, startW + (ev.clientX - startX));
                  th.style.width = w + 'px';
                }
                function onUp(){
                  document.removeEventListener('mousemove', onMove);
                  document.removeEventListener('mouseup', onUp);
                }
                document.addEventListener('mousemove', onMove);
                document.addEventListener('mouseup', onUp);
              });
            });
          })();
    };
    this.EnableAutoGrowTextAreas = function () {
      (function(){
        const host = document.getElementById('tasks_table_host');
        if(!host) return;
        host.querySelectorAll('textarea.cell-textarea').forEach(ta => {
          const fit = () => { ta.style.height = 'auto'; ta.style.height = ta.scrollHeight + 'px'; };
          fit();
          ta.addEventListener('input', fit);
        });
      })();
    };
    this.GotoRowIndex = function (AIndex) {
      var i = 0;
      if ((AIndex < 0) || !this.xdwdsTasks.GetActive()) return;
      this.xdwdsTasks.First();
      i = 0;
      while ((i < AIndex) && !this.xdwdsTasks.GetEOF()) {
        this.xdwdsTasks.Next();
        i += 1;
      };
    };
    this.HtmlEncode = function (s) {
      var Result = "";
      Result = s;
      Result = pas.SysUtils.StringReplace(Result,"&","&amp;",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
      Result = pas.SysUtils.StringReplace(Result,"<","&lt;",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
      Result = pas.SysUtils.StringReplace(Result,">","&gt;",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
      Result = pas.SysUtils.StringReplace(Result,'"',"&quot;",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
      Result = pas.SysUtils.StringReplace(Result,"'","&#39;",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
      return Result;
    };
    this.SetTaskLabel = function (ATaskId) {
      var el = null;
      el = document.getElementById("lbl_project_name");
      if (el != null) el.innerText = "Tasks - " + ATaskId;
    };
    var ENABLE_SERVER_SAVE = true;
    this.SaveRow = async function (AIndex) {
      var response = null;
      var payload = null;
      var payloadJson = "";
      if (!this.xdwdsTasks.GetActive()) return;
      this.GotoRowIndex(AIndex);
      if (this.xdwdsTasks.GetEOF()) return;
      payload = new Object();
      payload["taskItemId"] = this.xdwdsTaskstaskItemId.GetAsString();
      payload["taskId"] = this.xdwdsTaskstaskId.GetAsString();
      payload["application"] = this.xdwdsTasksapplication.GetAsString();
      payload["version"] = this.xdwdsTasksversion.GetAsString();
      payload["taskDate"] = this.xdwdsTaskstaskDate.GetAsString();
      payload["reportedBy"] = this.xdwdsTasksreportedBy.GetAsString();
      payload["assignedTo"] = this.xdwdsTasksassignedTo.GetAsString();
      payload["status"] = this.xdwdsTasksstatus.GetAsString();
      payload["statusDate"] = this.xdwdsTasksstatusDate.GetAsString();
      payload["formSection"] = this.xdwdsTasksformSection.GetAsString();
      payload["issue"] = this.xdwdsTasksissue.GetAsString();
      payload["notes"] = this.xdwdsTasksnotes.GetAsString();
      payloadJson = JSON.stringify(payload);
      window.console.log("SaveRow: idx=" + pas.SysUtils.IntToStr(AIndex) + " payload=" + payloadJson);
      if (!true) return;
      try {
        response = await this.xdwcTasks.RawInvokeAsync("IApiService.SaveTaskRow",[payload]);
        window.console.log("SaveRow: response=" + JSON.stringify(response.FResult));
      } catch ($e) {
        if (pas["XData.Web.Client"].EXDataClientRequestException.isPrototypeOf($e)) {
          var E = $e;
          window.console.log("SaveRow ERROR: " + E.FErrorResult.FErrorMessage);
          pas.Utils.ShowErrorModal(E.FErrorResult.FErrorMessage);
        } else throw $e
      };
    };
    this.EditorBlur = function (Event) {
      var el = null;
      var idx = 0;
      var idxStr = "";
      var fieldName = "";
      el = Event.target;
      idxStr = el.getAttribute("data-idx");
      fieldName = el.getAttribute("data-field");
      if (el.getAttribute("data-unsaved-data") !== "1") {
        window.console.log("EditorBlur: skip (not unsaved) idx=" + idxStr + " field=" + fieldName);
        return;
      };
      el.removeAttribute("data-unsaved-data");
      idx = pas.SysUtils.StrToIntDef(idxStr,-1);
      if (idx < 0) return;
      window.console.log("EditorBlur: SAVE idx=" + pas.SysUtils.IntToStr(idx) + " field=" + fieldName);
      this.SaveRow(idx);
    };
    this.LoadDFMValues = function () {
      pas["WEBLib.Forms"].TCustomForm.LoadDFMValues.call(this);
      this.btnReload = pas["WEBLib.StdCtrls"].TButton.$create("Create$2",["btn_reload"]);
      this.btnAddRow = pas["WEBLib.StdCtrls"].TButton.$create("Create$2",["btn_add_row"]);
      this.xdwcTasks = pas["XData.Web.Client"].TXDataWebClient.$create("Create$1",[this]);
      this.xdwdsTasks = pas["XData.Web.Dataset"].TXDataWebDataSet.$create("Create$1",[this]);
      this.xdwdsTaskstaskId = pas.DB.TStringField.$create("Create$1",[this]);
      this.xdwdsTasksapplication = pas.DB.TStringField.$create("Create$1",[this]);
      this.xdwdsTasksversion = pas.DB.TStringField.$create("Create$1",[this]);
      this.xdwdsTaskstaskDate = pas.DB.TStringField.$create("Create$1",[this]);
      this.xdwdsTasksreportedBy = pas.DB.TStringField.$create("Create$1",[this]);
      this.xdwdsTasksassignedTo = pas.DB.TStringField.$create("Create$1",[this]);
      this.xdwdsTasksstatus = pas.DB.TStringField.$create("Create$1",[this]);
      this.xdwdsTasksstatusDate = pas.DB.TStringField.$create("Create$1",[this]);
      this.xdwdsTasksformSection = pas.DB.TStringField.$create("Create$1",[this]);
      this.xdwdsTasksissue = pas.DB.TStringField.$create("Create$1",[this]);
      this.xdwdsTasksnotes = pas.DB.TStringField.$create("Create$1",[this]);
      this.xdwdsTaskstaskItemId = pas.DB.TStringField.$create("Create$1",[this]);
      this.btnReload.BeforeLoadDFMValues();
      this.btnAddRow.BeforeLoadDFMValues();
      this.xdwcTasks.BeforeLoadDFMValues();
      this.xdwdsTasks.BeforeLoadDFMValues();
      this.xdwdsTaskstaskId.BeforeLoadDFMValues();
      this.xdwdsTasksapplication.BeforeLoadDFMValues();
      this.xdwdsTasksversion.BeforeLoadDFMValues();
      this.xdwdsTaskstaskDate.BeforeLoadDFMValues();
      this.xdwdsTasksreportedBy.BeforeLoadDFMValues();
      this.xdwdsTasksassignedTo.BeforeLoadDFMValues();
      this.xdwdsTasksstatus.BeforeLoadDFMValues();
      this.xdwdsTasksstatusDate.BeforeLoadDFMValues();
      this.xdwdsTasksformSection.BeforeLoadDFMValues();
      this.xdwdsTasksissue.BeforeLoadDFMValues();
      this.xdwdsTasksnotes.BeforeLoadDFMValues();
      this.xdwdsTaskstaskItemId.BeforeLoadDFMValues();
      try {
        this.SetName("FTasksHTML");
        this.SetWidth(640);
        this.SetHeight(480);
        this.SetCSSLibrary(pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap);
        this.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
        this.SetEvent(this,"OnShow","WebFormShow");
        this.btnReload.SetParentComponent(this);
        this.btnReload.SetName("btnReload");
        this.btnReload.SetLeft(78);
        this.btnReload.SetTop(88);
        this.btnReload.SetWidth(96);
        this.btnReload.SetHeight(25);
        this.btnReload.SetCaption("Reload");
        this.btnReload.SetHeightPercent(100.000000000000000000);
        this.btnReload.SetWidthPercent(100.000000000000000000);
        this.SetEvent$1(this.btnReload,this,"OnClick","btnReloadClick");
        this.btnAddRow.SetParentComponent(this);
        this.btnAddRow.SetName("btnAddRow");
        this.btnAddRow.SetLeft(78);
        this.btnAddRow.SetTop(119);
        this.btnAddRow.SetWidth(96);
        this.btnAddRow.SetHeight(25);
        this.btnAddRow.SetCaption("Add Row");
        this.btnAddRow.SetChildOrderEx(1);
        this.btnAddRow.SetHeightPercent(100.000000000000000000);
        this.btnAddRow.SetWidthPercent(100.000000000000000000);
        this.SetEvent$1(this.btnAddRow,this,"OnClick","btnAddRowClick");
        this.xdwcTasks.SetParentComponent(this);
        this.xdwcTasks.SetName("xdwcTasks");
        this.xdwcTasks.SetConnection(pas.ConnectionModule.DMConnection.ApiConnection);
        this.xdwcTasks.SetLeft(506);
        this.xdwcTasks.SetTop(92);
        this.xdwdsTasks.SetParentComponent(this);
        this.xdwdsTasks.SetName("xdwdsTasks");
        this.xdwdsTasks.SetLeft(506);
        this.xdwdsTasks.SetTop(148);
        this.xdwdsTaskstaskId.SetParentComponent(this.xdwdsTasks);
        this.xdwdsTaskstaskId.SetName("xdwdsTaskstaskID");
        this.xdwdsTaskstaskId.FFieldName = "taskId";
        this.xdwdsTasksapplication.SetParentComponent(this.xdwdsTasks);
        this.xdwdsTasksapplication.SetName("xdwdsTasksapplication");
        this.xdwdsTasksapplication.FFieldName = "application";
        this.xdwdsTasksversion.SetParentComponent(this.xdwdsTasks);
        this.xdwdsTasksversion.SetName("xdwdsTasksversion");
        this.xdwdsTasksversion.FFieldName = "version";
        this.xdwdsTaskstaskDate.SetParentComponent(this.xdwdsTasks);
        this.xdwdsTaskstaskDate.SetName("xdwdsTaskstaskDate");
        this.xdwdsTaskstaskDate.FFieldName = "taskDate";
        this.xdwdsTasksreportedBy.SetParentComponent(this.xdwdsTasks);
        this.xdwdsTasksreportedBy.SetName("xdwdsTasksreportedBy");
        this.xdwdsTasksreportedBy.FFieldName = "reportedBy";
        this.xdwdsTasksassignedTo.SetParentComponent(this.xdwdsTasks);
        this.xdwdsTasksassignedTo.SetName("xdwdsTasksassignedTo");
        this.xdwdsTasksassignedTo.FFieldName = "assignedTo";
        this.xdwdsTasksstatus.SetParentComponent(this.xdwdsTasks);
        this.xdwdsTasksstatus.SetName("xdwdsTasksstatus");
        this.xdwdsTasksstatus.FFieldName = "status";
        this.xdwdsTasksstatusDate.SetParentComponent(this.xdwdsTasks);
        this.xdwdsTasksstatusDate.SetName("xdwdsTasksstatusDate");
        this.xdwdsTasksstatusDate.FFieldName = "statusDate";
        this.xdwdsTasksformSection.SetParentComponent(this.xdwdsTasks);
        this.xdwdsTasksformSection.SetName("xdwdsTasksformSection");
        this.xdwdsTasksformSection.FFieldName = "formSection";
        this.xdwdsTasksissue.SetParentComponent(this.xdwdsTasks);
        this.xdwdsTasksissue.SetName("xdwdsTasksissue");
        this.xdwdsTasksissue.FFieldName = "issue";
        this.xdwdsTasksnotes.SetParentComponent(this.xdwdsTasks);
        this.xdwdsTasksnotes.SetName("xdwdsTasksnotes");
        this.xdwdsTasksnotes.FFieldName = "notes";
        this.xdwdsTaskstaskItemId.SetParentComponent(this.xdwdsTasks);
        this.xdwdsTaskstaskItemId.SetName("xdwdsTaskstaskItemId");
        this.xdwdsTaskstaskItemId.FFieldName = "taskItemId";
      } finally {
        this.btnReload.AfterLoadDFMValues();
        this.btnAddRow.AfterLoadDFMValues();
        this.xdwcTasks.AfterLoadDFMValues();
        this.xdwdsTasks.AfterLoadDFMValues();
        this.xdwdsTaskstaskId.AfterLoadDFMValues();
        this.xdwdsTasksapplication.AfterLoadDFMValues();
        this.xdwdsTasksversion.AfterLoadDFMValues();
        this.xdwdsTaskstaskDate.AfterLoadDFMValues();
        this.xdwdsTasksreportedBy.AfterLoadDFMValues();
        this.xdwdsTasksassignedTo.AfterLoadDFMValues();
        this.xdwdsTasksstatus.AfterLoadDFMValues();
        this.xdwdsTasksstatusDate.AfterLoadDFMValues();
        this.xdwdsTasksformSection.AfterLoadDFMValues();
        this.xdwdsTasksissue.AfterLoadDFMValues();
        this.xdwdsTasksnotes.AfterLoadDFMValues();
        this.xdwdsTaskstaskItemId.AfterLoadDFMValues();
      };
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addField("xdwcTasks",pas["XData.Web.Client"].$rtti["TXDataWebClient"],4);
    $r.addField("xdwdsTasks",pas["XData.Web.Dataset"].$rtti["TXDataWebDataSet"],4);
    $r.addField("xdwdsTaskstaskId",pas.DB.$rtti["TStringField"],4);
    $r.addField("xdwdsTasksapplication",pas.DB.$rtti["TStringField"],4);
    $r.addField("xdwdsTasksversion",pas.DB.$rtti["TStringField"],4);
    $r.addField("xdwdsTaskstaskDate",pas.DB.$rtti["TStringField"],4);
    $r.addField("xdwdsTasksreportedBy",pas.DB.$rtti["TStringField"],4);
    $r.addField("xdwdsTasksassignedTo",pas.DB.$rtti["TStringField"],4);
    $r.addField("xdwdsTasksstatus",pas.DB.$rtti["TStringField"],4);
    $r.addField("xdwdsTasksstatusDate",pas.DB.$rtti["TStringField"],4);
    $r.addField("xdwdsTasksformSection",pas.DB.$rtti["TStringField"],4);
    $r.addField("xdwdsTasksissue",pas.DB.$rtti["TStringField"],4);
    $r.addField("xdwdsTasksnotes",pas.DB.$rtti["TStringField"],4);
    $r.addField("btnReload",pas["WEBLib.StdCtrls"].$rtti["TButton"],4);
    $r.addField("btnAddRow",pas["WEBLib.StdCtrls"].$rtti["TButton"],4);
    $r.addField("xdwdsTaskstaskItemId",pas.DB.$rtti["TStringField"],4);
    $r.addMethod("btnAddRowClick",0,[["Sender",pas.System.$rtti["TObject"]]],4);
    $r.addMethod("btnReloadClick",0,[["Sender",pas.System.$rtti["TObject"]]],4);
    $r.addMethod("WebFormShow",0,[["Sender",pas.System.$rtti["TObject"]]],4);
  });
  this.FTasksHTML = null;
},["ConnectionModule"]);
rtl.module("WEBLib.DataGrid.Common",["System","Classes","SysUtils"],function () {
  "use strict";
  var $mod = this;
  this.TDGCellRendererType = {"0": "crtDefault", crtDefault: 0, "1": "crtText", crtText: 1, "2": "crtImage", crtImage: 2, "3": "crtURL", crtURL: 3, "4": "crtEmail", crtEmail: 4, "5": "crtTel", crtTel: 5, "6": "crtCustom", crtCustom: 6, "7": "crtCheckbox", crtCheckbox: 7, "8": "crtLocaleDateString", crtLocaleDateString: 8, "9": "crtLocaleNumber", crtLocaleNumber: 9};
  this.$rtti.$Enum("TDGCellRendererType",{minvalue: 0, maxvalue: 9, ordtype: 1, enumtype: this.TDGCellRendererType});
  this.TDGCellEditorType = {"0": "cetDefault", cetDefault: 0, "1": "cetText", cetText: 1, "2": "cetNumber", cetNumber: 2, "3": "cetDate", cetDate: 3, "4": "cetTime", cetTime: 4, "5": "cetRange", cetRange: 5, "6": "cetColor", cetColor: 6, "7": "cetWeek", cetWeek: 7, "8": "cetMonth", cetMonth: 8, "9": "cetURL", cetURL: 9, "10": "cetEmail", cetEmail: 10, "11": "cetTel", cetTel: 11, "12": "cetMemo", cetMemo: 12, "13": "cetNone", cetNone: 13, "14": "cetCustom", cetCustom: 14, "15": "cetCheckbox", cetCheckbox: 15, "16": "cetCombobox", cetCombobox: 16, "17": "cetDateTime", cetDateTime: 17};
  this.$rtti.$Enum("TDGCellEditorType",{minvalue: 0, maxvalue: 17, ordtype: 1, enumtype: this.TDGCellEditorType});
  this.TDGCellDataType = {"0": "cdtText", cdtText: 0, "1": "cdtNumber", cdtNumber: 1, "2": "cdtBoolean", cdtBoolean: 2, "3": "cdtDate", cdtDate: 3, "4": "cdtDateString", cdtDateString: 4, "5": "cdtObject", cdtObject: 5};
  this.$rtti.$Enum("TDGCellDataType",{minvalue: 0, maxvalue: 5, ordtype: 1, enumtype: this.TDGCellDataType});
  this.TDGBuiltInThemes = {"0": "agThemeAlpine", agThemeAlpine: 0, "1": "agThemeBalham", agThemeBalham: 1, "2": "agThemeMaterial", agThemeMaterial: 2, "3": "agThemeQuartz", agThemeQuartz: 3, "4": "agThemeCustom", agThemeCustom: 4};
  this.$rtti.$Enum("TDGBuiltInThemes",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TDGBuiltInThemes});
  this.TDGBuiltInThemeMode = {"0": "agLightMode", agLightMode: 0, "1": "agDarkMode", agDarkMode: 1, "2": "agAutoDarkMode", agAutoDarkMode: 2};
  this.$rtti.$Enum("TDGBuiltInThemeMode",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TDGBuiltInThemeMode});
});
rtl.module("jsdelphisystem",["System"],function () {
  "use strict";
  var $mod = this;
});
rtl.module("WEBLib.DataGrid.libjs",["System","WEBLib.DataGrid.Common","Classes","Web","JS","WEBLib.Controls","Generics.Collections","Generics.Defaults","WEBLib.Controls","Types","SysUtils","jsdelphisystem"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.$rtti.$RefToProcVar("TJSCallbackHandler",{procsig: rtl.newTIProcSig([["Event",pas.Web.$rtti["TJSEvent"]]])});
  this.$rtti.$ExtClass("TConsole",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "console"});
  this.$rtti.$MethodVar("TEmbeddedJavaScriptLoad",{procsig: rtl.newTIProcSig([],rtl.string), methodkind: 1});
  rtl.createClass(this,"TEmbeddedJavaScript",pas.System.TObject,function () {
  });
  rtl.createClass(this,"TRemoteJavaScript",this.TEmbeddedJavaScript,function () {
    this.$init = function () {
      $mod.TEmbeddedJavaScript.$init.call(this);
      this.FModuleName = "";
      this.FSource = "";
      this.FGlobalVariableName = "";
    };
    this.Create$1 = function (AModuleName, AGlobalVariableName, ASource) {
      pas.System.TObject.Create.call(this);
      this.FModuleName = AModuleName;
      this.FSource = ASource;
      this.FGlobalVariableName = AGlobalVariableName;
      return this;
    };
    this.ModuleName = function () {
      var Result = "";
      Result = this.FModuleName;
      return Result;
    };
    this.Source = function () {
      var Result = "";
      Result = this.FSource;
      return Result;
    };
    this.GlobalVariableName = function () {
      var Result = "";
      Result = this.FGlobalVariableName;
      return Result;
    };
  });
  rtl.createClass(this,"TTMSModuleCollectionItem",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FModuleName = "";
      this.FURL = "";
      this.FGlobalVariableName = "";
      this.FLoaded = false;
      this.FEmbeddedJavaScript = null;
    };
    this.$final = function () {
      this.FEmbeddedJavaScript = undefined;
      pas.Classes.TCollectionItem.$final.call(this);
    };
    this.Create$1 = function (ACollection) {
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      return this;
    };
    this.Destroy = function () {
      pas.Classes.TCollectionItem.Destroy.call(this);
    };
    this.Assign = function (Source) {
      var SourceItem = null;
      pas.Classes.TPersistent.Assign.apply(this,arguments);
      SourceItem = rtl.as(Source,$mod.TTMSModuleCollectionItem);
      if (SourceItem !== null) {
        this.FModuleName = SourceItem.FModuleName;
        this.FURL = SourceItem.FURL;
        this.FGlobalVariableName = SourceItem.FGlobalVariableName;
        this.FEmbeddedJavaScript = SourceItem.FEmbeddedJavaScript;
      };
    };
  });
  rtl.createClass(this,"TTMSModuleCollection",pas.Classes.TOwnedCollection,function () {
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      this.SetItem(Index,Value);
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,$mod.TTMSModuleCollectionItem);
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      return Result;
    };
    this.HasModule = function (ModuleName) {
      var Result = false;
      Result = this.FindModule(ModuleName) !== null;
      return Result;
    };
    this.FindModule = function (ModuleName) {
      var Result = null;
      var I = 0;
      Result = null;
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (this.GetItem$1(I).FModuleName === ModuleName) {
          Result = this.GetItem$1(I);
          return Result;
        };
      };
      return Result;
    };
  });
  rtl.createClass(this,"TTMSModuleLoader",pas.System.TObject,function () {
    this.FInstance = null;
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FModules = null;
      this.FStaticModules = null;
    };
    this.$final = function () {
      this.FModules = undefined;
      this.FStaticModules = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.GetUrl = function (URL) {
      var Result = "";
      var Request = null;
      Result = "";
      if (URL !== "") {
        Request = new XMLHttpRequest();
        Request.open("GET",URL,false);
        Request.send();
        if (Request.status === 200) Result = Request.responseText;
      };
      return Result;
    };
    this.FindHead = function (InDesigner) {
      var Result = null;
      var innerObjectElement = null;
      var headElement = null;
      var htmlDocument = null;
      if (InDesigner) {
        innerObjectElement = document.getElementById("projecthtml");
        if ($mod._NotNullOrUndefined(innerObjectElement)) {
          htmlDocument = innerObjectElement.ownerDocument;
          if ($mod._NotNullOrUndefined(htmlDocument)) {
            headElement = htmlDocument.head;
            if ($mod._NotNullOrUndefined(headElement)) {
              Result = headElement;
              return Result;
            };
          };
        };
      };
      Result = document.head;
      return Result;
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FModules = $mod.TTMSModuleCollection.$create("Create$3",[null]);
      this.FStaticModules = $mod.TTMSModuleCollection.$create("Create$3",[null]);
      return this;
    };
    this.Destroy = function () {
      if (this.FModules != null) pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FModules;
        }, set: function (v) {
          this.p.FModules = v;
        }});
      if (this.FStaticModules != null) pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FStaticModules;
        }, set: function (v) {
          this.p.FStaticModules = v;
        }});
      pas.System.TObject.Destroy.call(this);
    };
    this.LoadModules = function (InDesigner) {
      var Count = 0;
      var I = 0;
      var Module = null;
      var Modules = null;
      if (this.FInstance != null) {
        Modules = this.FInstance.FModules;
        Count = Modules.GetCount();
        for (var $l = 0, $end = Count - 1; $l <= $end; $l++) {
          I = $l;
          Module = Modules.GetItem$1(I);
          this.LoadModule(Module.FModuleName,InDesigner);
        };
      };
    };
    this.AddModule = function (Name, URL, GlobalVarName, UseExternalLink) {
      var StaticModule = null;
      if (!(this.FInstance != null)) $mod.TTMSModuleLoader.FInstance = $mod.TTMSModuleLoader.$create("Create$1");
      if (!this.FInstance.FModules.HasModule(Name)) {
        var $with = this.FInstance.FModules.Add$1();
        StaticModule = this.FInstance.FStaticModules.FindModule(Name);
        if ((StaticModule !== null) && !UseExternalLink) {
          $with.FModuleName = StaticModule.FModuleName;
          $with.FURL = StaticModule.FURL;
          if (GlobalVarName !== "") {
            $with.FGlobalVariableName = GlobalVarName}
           else $with.FGlobalVariableName = StaticModule.FGlobalVariableName;
          $with.FEmbeddedJavaScript = StaticModule.FEmbeddedJavaScript;
        } else {
          $with.FModuleName = Name;
          $with.FURL = URL;
          if (GlobalVarName !== "") {
            $with.FGlobalVariableName = GlobalVarName}
           else {
            if ((StaticModule !== null) && (StaticModule.FGlobalVariableName !== "")) {
              $with.FGlobalVariableName = StaticModule.FGlobalVariableName}
             else $with.FGlobalVariableName = Name;
          };
          $with.FEmbeddedJavaScript = null;
          $with.FEmbeddedJavaScript = $mod.TRemoteJavaScript.$create("Create$1",[$with.FModuleName,$with.FGlobalVariableName,this.GetUrl($with.FURL)]);
        };
      };
    };
    this.LoadModule = function (Name, InDesigner) {
      var $Self = this;
      var Result = false;
      var Module = null;
      var Source = "";
      var Element = null;
      function OnRemoteSourceLoaded(Event) {
        if (Module != null) Module.FLoaded = true;
      };
      Result = false;
      if (!(this.FInstance != null)) $mod.TTMSModuleLoader.FInstance = $mod.TTMSModuleLoader.$create("Create$1");
      Module = this.FInstance.FModules.FindModule(Name);
      if (Module !== null) {
        Result = Module.FLoaded;
        if (!Module.FLoaded) {
          if (Module.FEmbeddedJavaScript !== null) {
            Source = Module.FEmbeddedJavaScript.Source();
            if (Module.FGlobalVariableName !== "") {
              Source = "(function() { var exports = {}; var module = {};" + "\r\n" + Source;
              Source = Source + 'if (typeof(module.exports) != "undefined") { window.document.' + Module.FGlobalVariableName + " = module.exports; }" + ' else if (typeof(exports) != "undefined") { window.document.' + Module.FGlobalVariableName + " = exports; }" + "})();";
            };
            this.FInstance.$class.AddScriptSource(Module.FModuleName,Source,InDesigner);
            Module.FLoaded = true;
            Result = true;
          } else if (Module.FURL !== "") {
            this.FInstance.$class.AddScriptLink(Module.FModuleName,Module.FURL,InDesigner,OnRemoteSourceLoaded);
            Result = true;
          };
          if (Module.FLoaded && InDesigner) {
            Element = document.getElementById("projecthtml");
            if ((typeof(Element) === "object") && (typeof(Element.ownerDocument) === "object")) {
              document[Module.FGlobalVariableName] = Element.ownerDocument[Module.FGlobalVariableName];
            };
          };
        };
      };
      return Result;
    };
    this.RegisterEmbeddedJavaScript = function (EmbeddedJavaScript) {
      var CurrentModule = null;
      if (!(this.FInstance != null)) $mod.TTMSModuleLoader.FInstance = $mod.TTMSModuleLoader.$create("Create$1");
      if (this.FInstance != null) {
        CurrentModule = this.FInstance.FStaticModules.Add$1();
        CurrentModule.FModuleName = EmbeddedJavaScript.ModuleName();
        CurrentModule.FEmbeddedJavaScript = EmbeddedJavaScript;
        CurrentModule.FGlobalVariableName = EmbeddedJavaScript.GlobalVariableName();
      };
    };
    this.AddScriptLink = function (Name, Link, InDesigner, Callback) {
      var id = "";
      var script = null;
      id = this.$classname + "-" + Name;
      if (!(document.getElementById(id) != null)) {
        script = document.createElement("script");
        script.id = id;
        script.src = Link;
        script.type = "text/javascript";
        script.async = false;
        script.onreadystatechange = function(e) {
          if (this.readyState == 'complete') {
            if (typeof(Callback) == "function") {
              Callback(e);
            }
          }
        }
        script.onload = function(e) {
          if (typeof(Callback) == "function") {
            Callback(e);
          }
        };
        this.FindHead(InDesigner).appendChild(script);
      };
    };
    this.AddScriptSource = function (Name, Source, InDesigner) {
      var id = "";
      var script = null;
      id = this.$classname + "-" + Name + "-src";
      if (!(document.getElementById(id) != null)) {
        script = document.createElement("script");
        script.id = id;
        script.innerHTML = Source;
        script.type = "text/javascript";
        this.FindHead(InDesigner).appendChild(script);
      };
    };
  });
  this.$rtti.$ExtClass("TJSArrayEx",{ancestor: pas.JS.$rtti["TJSArray"], jsclass: "Array"});
  this.$rtti.$ExtClass("TJSMutationObserver");
  rtl.createClass(this,"TJSMutationObserverConfig",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.childList = false;
      this.subtree = false;
    };
  });
  this.$rtti.$RefToProcVar("TJSMutationObserverCallback",{procsig: rtl.newTIProcSig([["mutationList",pas.JS.$rtti["TJSArray"]],["observer",this.$rtti["TJSMutationObserver"]]])});
  this.$rtti.$ExtClass("TJSMutationObserver",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "MutationObserver"});
  rtl.createClassExt(this,"TJSFetchResponse",Object,"",function () {
    this.$init = function () {
    };
    this.$final = function () {
    };
  });
  this.$rtti.$ExtClass("TJSFetch",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "window"});
  rtl.createClass(this,"TStringComparer",pas.System.TObject,function () {
    this.Ordinal = function () {
      var $Self = this;
      var Result = null;
      var $ok = false;
      try {
        Result = rtl.setIntfL(Result,pas["Generics.Defaults"].TComparer$$$G$$generics$defaults$$String.Construct(function (Left, Right) {
          var Result = 0;
          if (Left > Right) {
            Result = 1}
           else if (Left < Right) {
            Result = -1}
           else Result = 0;
          return Result;
        }),true);
        $ok = true;
      } finally {
        if (!$ok) rtl._Release(Result);
      };
      return Result;
    };
  });
  this.$rtti.$RefToProcVar("TJSSetTimeoutCallBackRef",{procsig: rtl.newTIProcSig([])});
  this.$rtti.$RefToProcVar("TJSSetTimeoutCallBackRef1",{procsig: rtl.newTIProcSig([["param1",rtl.jsvalue]])});
  this.$rtti.$RefToProcVar("TJSSetTimeoutCallBackRef2",{procsig: rtl.newTIProcSig([["param1",rtl.jsvalue],["param2",rtl.jsvalue]])});
  this.$rtti.$RefToProcVar("TJSSetTimeoutCallBackRef3",{procsig: rtl.newTIProcSig([["param1",rtl.jsvalue],["param2",rtl.jsvalue],["param3",rtl.jsvalue]])});
  this.$rtti.$MethodVar("TJSSetTimeoutCallBack",{procsig: rtl.newTIProcSig([]), methodkind: 0});
  this.$rtti.$MethodVar("TJSSetTimeoutCallBack1",{procsig: rtl.newTIProcSig([["param1",rtl.jsvalue]]), methodkind: 0});
  this.$rtti.$MethodVar("TJSSetTimeoutCallBack2",{procsig: rtl.newTIProcSig([["param1",rtl.jsvalue],["param2",rtl.jsvalue]]), methodkind: 0});
  this.$rtti.$MethodVar("TJSSetTimeoutCallBack3",{procsig: rtl.newTIProcSig([["param1",rtl.jsvalue],["param2",rtl.jsvalue],["param3",rtl.jsvalue]]), methodkind: 0});
  this._NotNullOrUndefined = function (Value) {
    var Result = false;
    Result = false;
    if ((typeof(Value) !== "undefined") && (Value != null)) Result = true;
    return Result;
  };
  this._CreateInitialize = function (AComponent) {
    {
    if (typeof(AComponent.CreateInitialize) == "function")
      AComponent.CreateInitialize;
    };
  };
  this._Bind = function (Sender) {
    var Result = null;
    Result = Sender.bind(Sender);
    return Result;
  };
  $mod.$implcode = function () {
    rtl.createClass($impl,"TJSBindingCallback",pas.System.TObject,function () {
    });
  };
},[]);
rtl.module("libaggrid",["System","Classes","Web","JS","WEBLib.Controls","Types","SysUtils","jsdelphisystem","WEBLib.DataGrid.libjs"],function () {
  "use strict";
  var $mod = this;
  rtl.createClass(this,"TEmbeddedJSAgGrid",pas["WEBLib.DataGrid.libjs"].TEmbeddedJavaScript,function () {
    this.ModuleName = function () {
      var Result = "";
      Result = this.$classname;
      return Result;
    };
    this.Source = function () {
      var Result = "";
      var S = "";
      S = "";
      S = S + '!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.agGrid=t():e.agGrid=t()}(self,(function(){return function(){var e={7886:function(e,t,a){var n,o=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var a in t)o(e,a,{get:t[a],enumerable:!0})})(l,{ClientSideRowModelModule:()=>M}),e.exports=(n=l,((e,t,a,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===a||o(e,l,{get:()=>t[l],enumerable:!(n=r(t,l))||n.enumerable});return e})(o({},"__esModule",{value:!0}),n));var c=a(3423),g=a(3423),d=a(3423),h=class{constructor(e,t,a,n,o,r){this.nextId=0,this.rowCountReady=!1,this.allNodesMap={},this.rootNode=e,this.gos=t,this.eventService=a,this.funcColsService=n,this.beans=r,this.selectionService=o,this.rootNode.group=!0,this.rootNode.level=-1,this.rootNode.id="ROOT_NODE_ID",this.rootNode.allLeafChildren=[],this.rootNode.childrenAfterGroup=[],this.rootNode.childrenAfterSort=[],this.rootNode.childrenAfterAggFilter=[],this.rootNode.childrenAfterFilter=[]}getCopyOfNodesMap(){return(0,d._cloneObject)(this.allNodesMap)}getRowNode(e){return this.allNodesMap[e]}setRowData(e){if("string"==typeof e)return void(0,d._warnOnce)("rowData must be an array.");this.rowCountReady=!0,this.dispatchRowDataUpdateStartedEvent(e);const t=this.rootNode,a=this.rootNode.sibling;t.childrenAfterFilter=null,t.childrenAfterGroup=null,t.childrenAfterAggFilter=null,t.childrenAfterSort=null,t.childrenMapped=null,t.updateHasChildren(),this.nextId=0,this.allNodesMap={},e?t.allLeafChildren=e.map((e=>this.createNode(e,this.rootNode,0))):(t.allLeafChildren=[],t.childrenAfterGroup=[]),a&&(a.childrenAfterFilter=t.childrenAfterFilter,a.childrenAfterGroup=t.childrenAfterGroup,a.childrenAfterAggFilter=t.childrenAfterAggFilter,a.childrenAfterSort=t.childrenAfterSort,a.childrenMapped=t.childre';
      S = S + 'nMapped,a.allLeafChildren=t.allLeafChildren)}updateRowData(e,t){this.rowCountReady=!0,this.dispatchRowDataUpdateStartedEvent(e.add);const a={remove:[],update:[],add:[]},n=[];return this.executeRemove(e,a,n),this.executeUpdate(e,a,n),this.executeAdd(e,a),this.updateSelection(n,"rowDataChanged"),t&&(0,d._sortRowNodesByOrder)(this.rootNode.allLeafChildren,t),a}isRowCountReady(){return this.rowCountReady}dispatchRowDataUpdateStartedEvent(e){const t={type:"rowDataUpdateStarted",firstRowData:e?.length?e[0]:null};this.eventService.dispatchEvent(t)}updateSelection(e,t){const a=e.length>0;if(a&&this.selectionService.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:t}),this.selectionService.updateGroupsFromChildrenSelections(t),a){const e={type:"selectionChanged",source:t};this.eventService.dispatchEvent(e)}}executeAdd(e,t){const{add:a,addIndex:n}=e;if((0,d._missingOrEmpty)(a))return;const o=a.map((e=>this.createNode(e,this.rootNode,0))),r=this.rootNode.allLeafChildren;if("number"==typeof n&&n>=0){const e=r.length;let t=n;if(this.gos.get("treeData")&&n>0&&e>0)for(let a=0;a<e;a++)if(r[a]?.rowIndex==n-1){t=a+1;break}const a=r.slice(0,t),i=r.slice(t,r.length);this.rootNode.allLeafChildren=[...a,...o,...i]}else this.rootNode.allLeafChildren=[...r,...o];this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=r),t.add=o}executeRemove(e,t,a){const{remove:n}=e;if((0,d._missingOrEmpty)(n))return;const o={};n.forEach((e=>{const n=this.lookupRowNode(e);n&&(n.isSelected()&&a.push(n),n.clearRowTopAndRowIndex(),o[n.id]=!0,delete this.allNodesMap[n.id],t.remove.push(n))})),this.rootNode.allLeafChildren=this.rootNode.allLeafChildren?.filter((e=>!o[e.id]))??null,this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren)}executeUpdate(e,t,a){const{update:n}=e;(0,d._missingOrEmpty)(n)||n.forEach((e=>{const n=this.lookupRowNode(e);n&&(n.updateData(e),!n.selectable&&n.isSelected()&&a.push(n),this.setMasterForRow(n,e,0,!1),t.update.push(';
      S = S + 'n))}))}lookupRowNode(e){const t=this.gos.getRowIdCallback();let a;if(t){const n=t({data:e,level:0});if(a=this.allNodesMap[n],!a)return(0,d._errorOnce)(`could not find row id=${n}, data item was not found for this id`),null}else if(a=this.rootNode.allLeafChildren?.find((t=>t.data===e)),!a)return(0,d._errorOnce)("could not find data item as object was not found",e),(0,d._errorOnce)("Consider using getRowId to help the Grid find matching row data"),null;return a||null}createNode(e,t,a){const n=new d.RowNode(this.beans);return n.group=!1,this.setMasterForRow(n,e,a,!0),t&&(n.parent=t),n.level=a,n.setDataAndId(e,this.nextId.toString()),this.allNodesMap[n.id]&&(0,d._warnOnce)(`duplicate node id \'${n.id}\' detected from getRowId callback, this could cause issues in your grid.`),this.allNodesMap[n.id]=n,this.nextId++,n}setMasterForRow(e,t,a,n){if(this.gos.get("treeData"))e.setMaster(!1),n&&(e.expanded=!1);else{if(this.gos.get("masterDetail")){const a=this.gos.get("isRowMaster");a?e.setMaster(a(t)):e.setMaster(!0)}else e.setMaster(!1);if(n){const t=this.funcColsService.getRowGroupColumns(),n=a+(t?t.length:0);e.expanded=!!e.master&&this.isExpanded(n)}}}isExpanded(e){const t=this.gos.get("groupDefaultExpanded");return-1===t||e<t}},u=class extends g.BeanStub{constructor(){super(...arguments),this.beanName="rowModel",this.onRowHeightChanged_debounced=(0,g._debounce)(this.onRowHeightChanged.bind(this),100),this.rowsToDisplay=[],this.hasStarted=!1,this.shouldSkipSettingDataOnStart=!1,this.isRefreshingModel=!1,this.rowCountReady=!1}wireBeans(e){this.beans=e,this.columnModel=e.columnModel,this.funcColsService=e.funcColsService,this.selectionService=e.selectionService,this.valueCache=e.valueCache,this.environment=e.environment,this.filterStage=e.filterStage,this.sortStage=e.sortStage,this.flattenStage=e.flattenStage,this.groupStage=e.groupStage,this.aggregationStage=e.aggregationStage,this.pivotStage=e.pivotStage,this.filterAggregatesStage=e.filterAggregatesStage}postConstruct(){const ';
      S = S + 'e=this.refreshModel.bind(this,{step:g.ClientSideRowModelSteps.EVERYTHING}),t=!this.gos.get("suppressAnimationFrame"),a=this.refreshModel.bind(this,{step:g.ClientSideRowModelSteps.EVERYTHING,afterColumnsChanged:!0,keepRenderedRows:!0,animate:t});this.addManagedEventListeners({newColumnsLoaded:a,columnRowGroupChanged:e,columnValueChanged:this.onValueChanged.bind(this),columnPivotChanged:this.refreshModel.bind(this,{step:g.ClientSideRowModelSteps.PIVOT}),filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),columnPivotModeChanged:e,gridStylesChanged:this.onGridStylesChanges.bind(this),gridReady:this.onGridReady.bind(this)}),this.addPropertyListeners(),this.rootNode=new g.RowNode(this.beans),this.nodeManager=new h(this.rootNode,this.gos,this.eventService,this.funcColsService,this.selectionService,this.beans)}addPropertyListeners(){const e=new Set(["treeData","masterDetail"]),t=new Set(["groupDefaultExpanded","groupAllowUnbalanced","initialGroupOrderComparator","groupHideOpenParents","groupDisplayType"]),a=new Set(["excludeChildrenWhenTreeDataFiltering"]),n=new Set(["removePivotHeaderRowWhenSingleValueColumn","pivotRowTotals","pivotColumnGroupTotals","suppressExpandablePivotGroups"]),o=new Set(["getGroupRowAgg","alwaysAggregateAtRootLevel","groupIncludeTotalFooter","suppressAggFilteredOnly","grandTotalRow"]),r=new Set(["postSortRows","groupDisplayType","accentedSort"]),i=new Set([]),s=new Set(["groupRemoveSingleChildren","groupRemoveLowestSingleChildren","groupIncludeFooter","groupTotalRow"]),l=[...e,...t,...a,...n,...n,...o,...r,...i,...s];this.addManagedPropertyListeners(l,(l=>{const c=l.changeSet?.properties;if(!c)return;const d=e=>c.some((t=>e.has(t)));d(e)?this.setRowData(this.rootNode.allLeafChildren.map((e=>e.data))):d(t)?this.refreshModel({step:g.ClientSideRowModelSteps.EVERYTHING}):d(a)?this.refreshModel({step:g.ClientSideRowModelSteps.FILTER}):d(n)?this.refreshModel({step:g.ClientSideRowModelSteps.PIVOT}):d(o)?this.refreshModel';
      S = S + '({step:g.ClientSideRowModelSteps.AGGREGATE}):d(r)?this.refreshModel({step:g.ClientSideRowModelSteps.SORT}):d(i)?this.refreshModel({step:g.ClientSideRowModelSteps.FILTER_AGGREGATES}):d(s)&&this.refreshModel({step:g.ClientSideRowModelSteps.MAP})})),this.addManagedPropertyListener("rowHeight",(()=>this.resetRowHeights()))}start(){this.hasStarted=!0,this.shouldSkipSettingDataOnStart?this.dispatchUpdateEventsAndRefresh():this.setInitialData()}setInitialData(){const e=this.gos.get("rowData");e&&(this.shouldSkipSettingDataOnStart=!0,this.setRowData(e))}ensureRowHeightsValid(e,t,a,n){let o,r=!1;do{o=!1;const i=this.getRowIndexAtPixel(e),s=this.getRowIndexAtPixel(t),l=Math.max(i,a),c=Math.min(s,n);for(let e=l;e<=c;e++){const t=this.getRow(e);if(t.rowHeightEstimated){const e=this.gos.getRowHeightForNode(t);t.setRowHeight(e.height),o=!0,r=!0}}o&&this.setRowTopAndRowIndex()}while(o);return r}setRowTopAndRowIndex(){const e=this.environment.getDefaultRowHeight();let t=0;const a=new Set,n=this.gos.isDomLayout("normal");for(let o=0;o<this.rowsToDisplay.length;o++){const r=this.rowsToDisplay[o];if(null!=r.id&&a.add(r.id),null==r.rowHeight){const t=this.gos.getRowHeightForNode(r,n,e);r.setRowHeight(t.height,t.estimated)}r.setRowTop(t),r.setRowIndex(o),t+=r.rowHeight}return a}clearRowTopAndRowIndex(e,t){const a=e.isActive(),n=e=>{e&&null!=e.id&&!t.has(e.id)&&e.clearRowTopAndRowIndex()},o=e=>{if(n(e),n(e.detailNode),n(e.sibling),e.hasChildren()&&e.childrenAfterGroup){const t=-1==e.level;a&&!t&&!e.expanded||e.childrenAfterGroup.forEach(o)}};o(this.rootNode)}ensureRowsAtPixel(e,t,a=0){const n=this.getRowIndexAtPixel(t),o=this.getRow(n),r=!this.gos.get("suppressAnimationFrame");return o!==e[0]&&(e.forEach((e=>{(0,g._removeFromArray)(this.rootNode.allLeafChildren,e)})),e.forEach(((e,t)=>{(0,g._insertIntoArray)(this.rootNode.allLeafChildren,e,Math.max(n+a,0)+t)})),this.refreshModel({step:g.ClientSideRowModelSteps.EVERYTHING,keepRenderedRows:!0,keepEditingRows:!0,animate:r}),!0)}highlightRow';
      S = S + 'AtPixel(e,t){const a=null!=t?this.getRowIndexAtPixel(t):null,n=null!=a?this.getRow(a):null;if(!n||!e||n===e||null==t)return void(this.lastHighlightedRow&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null));const o=this.getHighlightPosition(t,n);this.lastHighlightedRow&&this.lastHighlightedRow!==n&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null),n.setHighlighted(o),this.lastHighlightedRow=n}getHighlightPosition(e,t){if(!t){const a=this.getRowIndexAtPixel(e);if(!(t=this.getRow(a||0)))return g.RowHighlightPosition.Below}const{rowTop:a,rowHeight:n}=t;return e-a<n/2?g.RowHighlightPosition.Above:g.RowHighlightPosition.Below}getLastHighlightedRowNode(){return this.lastHighlightedRow}isLastRowIndexKnown(){return!0}getRowCount(){return this.rowsToDisplay?this.rowsToDisplay.length:0}getTopLevelRowCount(){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return 1;const e=this.rootNode.sibling?1:0,t=this.rootNode.childrenAfterAggFilter;return(t?t.length:0)+e}getTopLevelRowDisplayedIndex(e){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return e;let t=e;if(this.rowsToDisplay[0].footer){if(0===e)return 0;t-=1}let a=this.rootNode.childrenAfterSort[t];if(this.gos.get("groupHideOpenParents"))for(;a.expanded&&a.childrenAfterSort&&a.childrenAfterSort.length>0;)a=a.childrenAfterSort[0];return a.rowIndex}getRowBounds(e){if((0,g._missing)(this.rowsToDisplay))return null;const t=this.rowsToDisplay[e];return t?{rowTop:t.rowTop,rowHeight:t.rowHeight}:null}onRowGroupOpened(){const e=this.gos.isAnimateRows();this.refreshModel({step:g.ClientSideRowModelSteps.MAP,keepRenderedRows:!0,animate:e})}onFilterChanged(e){if(e.afterDataChange)return;const t=this.gos.isAnimateRows(),a=0===e.columns.length||e.columns.some((e=>e.isPrimary()))?g.ClientSideRowModelSteps.FILTER:g.ClientSideRowModelSteps.FILTER_AGGREGATES;this.refreshModel({step:a,keepRenderedRows:!0,animate:t})}onSortChanged(){const e=this.gos.isAnimateRows();this.r';
      S = S + 'efreshModel({step:g.ClientSideRowModelSteps.SORT,keepRenderedRows:!0,animate:e,keepEditingRows:!0})}getType(){return"clientSide"}onValueChanged(){this.columnModel.isPivotActive()?this.refreshModel({step:g.ClientSideRowModelSteps.PIVOT}):this.refreshModel({step:g.ClientSideRowModelSteps.AGGREGATE})}createChangePath(e){const t=(0,g._missingOrEmpty)(e),a=new g.ChangedPath(!1,this.rootNode);return(t||this.gos.get("treeData"))&&a.setInactive(),a}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction"))return!1;if(null==e.rowNodeTransactions)return!1;const t=e.rowNodeTransactions.filter((e=>null!=e.add&&e.add.length>0||null!=e.remove&&e.remove.length>0));return null==t||0==t.length}buildRefreshModelParams(e){let t=g.ClientSideRowModelSteps.EVERYTHING;const a={everything:g.ClientSideRowModelSteps.EVERYTHING,group:g.ClientSideRowModelSteps.EVERYTHING,filter:g.ClientSideRowModelSteps.FILTER,map:g.ClientSideRowModelSteps.MAP,aggregate:g.ClientSideRowModelSteps.AGGREGATE,sort:g.ClientSideRowModelSteps.SORT,pivot:g.ClientSideRowModelSteps.PIVOT};if((0,g._exists)(e)&&(t=a[e]),(0,g._missing)(t))return void(0,g._errorOnce)(`invalid step ${e}, available steps are ${Object.keys(a).join(", ")}`);return{step:t,keepRenderedRows:!0,keepEditingRows:!0,animate:!this.gos.get("suppressAnimationFrame")}}refreshModel(e){if(!this.hasStarted||this.isRefreshingModel||this.columnModel.isChangeEventsDispatching())return;const t="object"==typeof e&&"step"in e?e:this.buildRefreshModelParams(e);if(!t)return;if(this.isSuppressModelUpdateAfterUpdateTransaction(t))return;const a=this.createChangePath(t.rowNodeTransactions);switch(this.isRefreshingModel=!0,t.step){case g.ClientSideRowModelSteps.EVERYTHING:this.doRowGrouping(t.rowNodeTransactions,t.rowNodeOrder,a,!!t.afterColumnsChanged);case g.ClientSideRowModelSteps.FILTER:this.doFilter(a);case g.ClientSideRowModelSteps.PIVOT:this.doPivot(a);case g.ClientSideRowModelSteps.AGGREGATE:this.doAggregate(a);';
      S = S + 'case g.ClientSideRowModelSteps.FILTER_AGGREGATES:this.doFilterAggregates(a);case g.ClientSideRowModelSteps.SORT:this.doSort(t.rowNodeTransactions,a);case g.ClientSideRowModelSteps.MAP:this.doRowsToDisplay()}const n=this.setRowTopAndRowIndex();this.clearRowTopAndRowIndex(a,n),this.isRefreshingModel=!1;const o={type:"modelUpdated",animate:t.animate,keepRenderedRows:t.keepRenderedRows,newData:t.newData,newPage:!1,keepUndoRedoStack:t.keepUndoRedoStack};this.eventService.dispatchEvent(o)}isEmpty(){const e=(0,g._missing)(this.rootNode.allLeafChildren)||0===this.rootNode.allLeafChildren.length;return(0,g._missing)(this.rootNode)||e||!this.columnModel.isReady()}isRowsToRender(){return(0,g._exists)(this.rowsToDisplay)&&this.rowsToDisplay.length>0}getNodesInRangeForSelection(e,t){let a=!1,n=!1;const o=[],r=this.gos.get("groupSelectsChildren");return this.forEachNodeAfterFilterAndSort((i=>{if(n)return;if(a&&(i===t||i===e)&&(n=!0,i.group&&r))return void o.push(...i.allLeafChildren);if(!a){if(i!==t&&i!==e)return;a=!0}(!i.group||!r)&&o.push(i)})),o}setDatasource(e){(0,g._errorOnce)("should never call setDatasource on clientSideRowController")}getTopLevelNodes(){return this.rootNode?this.rootNode.childrenAfterGroup:null}getRootNode(){return this.rootNode}getRow(e){return this.rowsToDisplay[e]}isRowPresent(e){return this.rowsToDisplay.indexOf(e)>=0}getRowIndexAtPixel(e){if(this.isEmpty()||0===this.rowsToDisplay.length)return-1;let t=0,a=this.rowsToDisplay.length-1;if(e<=0)return 0;if((0,g._last)(this.rowsToDisplay).rowTop<=e)return this.rowsToDisplay.length-1;let n=-1,o=-1;for(;;){const r=Math.floor((t+a)/2),i=this.rowsToDisplay[r];if(this.isRowInPixel(i,e))return r;i.rowTop<e?t=r+1:i.rowTop>e&&(a=r-1);if(n===t&&o===a)return r;n=t,o=a}}isRowInPixel(e,t){const a=e.rowTop,n=e.rowTop+e.rowHeight;return a<=t&&n>t}forEachLeafNode(e){this.rootNode.allLeafChildren&&this.rootNode.allLeafChildren.forEach(((t,a)=>e(t,a)))}forEachNode(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...th';
      S = S + 'is.rootNode.childrenAfterGroup||[]],callback:e,recursionType:0,index:0,includeFooterNodes:t})}forEachNodeAfterFilter(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterAggFilter||[]],callback:e,recursionType:1,index:0,includeFooterNodes:t})}forEachNodeAfterFilterAndSort(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterSort||[]],callback:e,recursionType:2,index:0,includeFooterNodes:t})}forEachPivotNode(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[this.rootNode],callback:e,recursionType:3,index:0,includeFooterNodes:t})}recursivelyWalkNodesAndCallback(e){const{nodes:t,callback:a,recursionType:n,includeFooterNodes:o}=e;let{index:r}=e;const i=e=>{const n=t[0]?.parent;if(!n)return;const i=o&&this.gos.getGrandTotalRow(),s=this.gos.getGroupTotalRowCallback(),l=o&&s({node:n});n===this.rootNode?i===e&&(n.createFooter(),a(n.sibling,r++)):l===e&&(n.createFooter(),a(n.sibling,r++))};i("top");for(let e=0;e<t.length;e++){const i=t[e];if(a(i,r++),i.hasChildren()&&!i.footer){let e=null;switch(n){case 0:e=i.childrenAfterGroup;break;case 1:e=i.childrenAfterAggFilter;break;case 2:e=i.childrenAfterSort;break;case 3:e=i.leafGroup?null:i.childrenAfterSort}e&&(r=this.recursivelyWalkNodesAndCallback({nodes:[...e],callback:a,recursionType:n,index:r,includeFooterNodes:o}))}}return i("bottom"),r}doAggregate(e){this.aggregationStage?.execute({rowNode:this.rootNode,changedPath:e})}doFilterAggregates(e){this.filterAggregatesStage?this.filterAggregatesStage.execute({rowNode:this.rootNode,changedPath:e}):this.rootNode.childrenAfterAggFilter=this.rootNode.childrenAfterFilter}expandOrCollapseAll(e){const t=this.gos.get("treeData"),a=this.columnModel.isPivotActive(),n=o=>{o&&o.forEach((o=>{const r=()=>{o.expanded=e,n(o.childrenAfterGroup)};if(t){return void((0,g._exists)(o.childrenAfterGroup)&&r())}if(a){return void(!o.leafGroup&&r())}o.group&&r()}))};this.rootNode&&n(this.rootNode.childrenAfterGroup),this.refreshModel({step:g.C';
      S = S + 'lientSideRowModelSteps.MAP});const o={type:"expandOrCollapseAll",source:e?"expandAll":"collapseAll"};this.eventService.dispatchEvent(o)}doSort(e,t){this.sortStage.execute({rowNode:this.rootNode,rowNodeTransactions:e,changedPath:t})}doRowGrouping(e,t,a,n){if(this.groupStage){if(e?this.groupStage.execute({rowNode:this.rootNode,rowNodeTransactions:e,rowNodeOrder:t,changedPath:a}):this.groupStage.execute({rowNode:this.rootNode,changedPath:a,afterColumnsChanged:n}),this.gos.get("groupSelectsChildren")){if(this.selectionService.updateGroupsFromChildrenSelections("rowGroupChanged",a)){const e={type:"selectionChanged",source:"rowGroupChanged"};this.eventService.dispatchEvent(e)}}}else this.rootNode.childrenAfterGroup=this.rootNode.allLeafChildren,this.rootNode.sibling&&(this.rootNode.sibling.childrenAfterGroup=this.rootNode.childrenAfterGroup),this.rootNode.updateHasChildren();this.nodeManager.isRowCountReady()&&(this.rowCountReady=!0,this.eventService.dispatchEventOnce({type:"rowCountReady"}))}doFilter(e){this.filterStage.execute({rowNode:this.rootNode,changedPath:e})}doPivot(e){this.pivotStage?.execute({rowNode:this.rootNode,changedPath:e})}getCopyOfNodesMap(){return this.nodeManager.getCopyOfNodesMap()}getRowNode(e){if("string"==typeof e&&0==e.indexOf(g.RowNode.ID_PREFIX_ROW_GROUP)){let t;return this.forEachNode((a=>{a.id===e&&(t=a)})),t}return this.nodeManager.getRowNode(e)}setRowData(e){this.selectionService.reset("rowDataChanged"),this.nodeManager.setRowData(e),this.hasStarted&&this.dispatchUpdateEventsAndRefresh()}dispatchUpdateEventsAndRefresh(){this.eventService.dispatchEvent({type:"rowDataUpdated"}),this.refreshModel({step:g.ClientSideRowModelSteps.EVERYTHING,newData:!0})}batchUpdateRowData(e,t){if(null==this.applyAsyncTransactionsTimeout){this.rowDataTransactionBatch=[];const e=this.gos.getAsyncTransactionWaitMillis();this.applyAsyncTransactionsTimeout=window.setTimeout((()=>{this.executeBatchUpdateRowData()}),e)}this.rowDataTransactionBatch.push({rowDataTransact';
      S = S + 'ion:e,callback:t})}flushAsyncTransactions(){null!=this.applyAsyncTransactionsTimeout&&(clearTimeout(this.applyAsyncTransactionsTimeout),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){this.valueCache.onDataChanged();const e=[],t=[];let a=!1;if(this.rowDataTransactionBatch&&this.rowDataTransactionBatch.forEach((n=>{const o=this.nodeManager.updateRowData(n.rowDataTransaction,void 0);t.push(o),n.callback&&e.push(n.callback.bind(null,o)),"number"==typeof n.rowDataTransaction.addIndex&&(a=!0)})),this.commonUpdateRowData(t,void 0,a),e.length>0&&window.setTimeout((()=>{e.forEach((e=>e()))}),0),t.length>0){const e={type:"asyncTransactionsFlushed",results:t};this.eventService.dispatchEvent(e)}this.rowDataTransactionBatch=null,this.applyAsyncTransactionsTimeout=void 0}updateRowData(e,t){this.valueCache.onDataChanged();const a=this.nodeManager.updateRowData(e,t),n="number"==typeof e.addIndex;return this.commonUpdateRowData([a],t,n),a}createRowNodeOrder(){if(this.gos.get("suppressMaintainUnsortedOrder"))return;const e={};if(this.rootNode&&this.rootNode.allLeafChildren)for(let t=0;t<this.rootNode.allLeafChildren.length;t++){e[this.rootNode.allLeafChildren[t].id]=t}return e}commonUpdateRowData(e,t,a){if(!this.hasStarted)return;const n=!this.gos.get("suppressAnimationFrame");a&&(t=this.createRowNodeOrder());this.eventService.dispatchEvent({type:"rowDataUpdated"}),this.refreshModel({step:g.ClientSideRowModelSteps.EVERYTHING,rowNodeTransactions:e,rowNodeOrder:t,keepRenderedRows:!0,keepEditingRows:!0,animate:n})}doRowsToDisplay(){this.rowsToDisplay=this.flattenStage.execute({rowNode:this.rootNode})}onRowHeightChanged(){this.refreshModel({step:g.ClientSideRowModelSteps.MAP,keepRenderedRows:!0,keepEditingRows:!0,keepUndoRedoStack:!0})}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}resetRowHeights(){const e=this.resetRowHeightsForAllRowNodes();this.rootNode.setRowHeight(this.rootNode.rowHeight,!0),this.rootNode.sibling&&this.rootNode.sibling.setRowHeight';
      S = S + '(this.rootNode.sibling.rowHeight,!0),e&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode((t=>{t.setRowHeight(t.rowHeight,!0);const a=t.detailNode;a&&a.setRowHeight(a.rowHeight,!0),t.sibling&&t.sibling.setRowHeight(t.sibling.rowHeight,!0),e=!0})),e}onGridStylesChanges(e){if(e.rowHeightChanged){if(this.columnModel.isAutoRowHeightActive())return;this.resetRowHeights()}}onGridReady(){this.hasStarted||this.setInitialData()}isRowDataLoaded(){return this.rowCountReady}},p=a(3423);var m=a(3423),f=class extends m.BeanStub{constructor(){super(...arguments),this.beanName="filterStage"}wireBeans(e){this.filterManager=e.filterManager}execute(e){const{changedPath:t}=e;this.filter(t)}filter(e){const t=!!this.filterManager?.isChildFilterPresent();this.filterNodes(t,e)}filterNodes(e,t){const a=(t,a)=>{t.hasChildren()?t.childrenAfterFilter=e&&!a?t.childrenAfterGroup.filter((e=>{const t=e.childrenAfterFilter&&e.childrenAfterFilter.length>0,a=e.data&&this.filterManager.doesRowPassFilter({rowNode:e});return t||a})):t.childrenAfterGroup:t.childrenAfterFilter=t.childrenAfterGroup,t.sibling&&(t.sibling.childrenAfterFilter=t.childrenAfterFilter)};if(this.doingTreeDataFiltering()){const e=(t,n)=>{if(t.childrenAfterGroup)for(let o=0;o<t.childrenAfterGroup.length;o++){const r=t.childrenAfterGroup[o],i=n||this.filterManager.doesRowPassFilter({rowNode:r});r.childrenAfterGroup?e(t.childrenAfterGroup[o],i):a(r,i)}a(t,n)},n=t=>e(t,!1);t.executeFromRootNode(n)}else{const e=e=>a(e,!1);t.forEachChangedNodeDepthFirst(e,!0)}}doingTreeDataFiltering(){return this.gos.get("treeData")&&!this.gos.get("excludeChildrenWhenTreeDataFiltering")}},v=a(3423),b=class extends v.BeanStub{constructor(){super(...arguments),this.beanName="flattenStage"}wireBeans(e){this.beans=e,this.columnModel=e.columnModel}execute(e){const t=e.rowNode,a=[],n=this.columnModel.isPivotMode(),o=n&&t.leafGroup,r=o?[t]:t.childrenAfterSort,i=this.getFlattenDetails();this.recursivelyAddToRowsToDisplay(';
      S = S + 'i,r,a,n,0);if(!o&&a.length>0&&i.grandTotalRow){t.createFooter();const e="top"===i.grandTotalRow;this.addRowNodeToRowsToDisplay(i,t.sibling,a,0,e)}return a}getFlattenDetails(){const e=this.gos.get("groupRemoveSingleChildren");return{groupRemoveLowestSingleChildren:!e&&this.gos.get("groupRemoveLowestSingleChildren"),groupRemoveSingleChildren:e,isGroupMultiAutoColumn:this.gos.isGroupMultiAutoColumn(),hideOpenParents:this.gos.get("groupHideOpenParents"),grandTotalRow:this.gos.getGrandTotalRow(),groupTotalRow:this.gos.getGroupTotalRowCallback()}}recursivelyAddToRowsToDisplay(e,t,a,n,o){if(!(0,v._missingOrEmpty)(t))for(let r=0;r<t.length;r++){const i=t[r],s=i.hasChildren(),l=n&&!s,c=e.groupRemoveSingleChildren&&s&&1===i.childrenAfterGroup.length,g=e.groupRemoveLowestSingleChildren&&s&&i.leafGroup&&1===i.childrenAfterGroup.length,d=n&&i.leafGroup,h=e.hideOpenParents&&i.expanded&&!i.master&&!d;if(!(l||h||c||g)&&this.addRowNodeToRowsToDisplay(e,i,a,o),!n||!i.leafGroup)if(s){const t=c||g;if(i.expanded||t){const r=e.groupTotalRow({node:i});r||i.destroyFooter();const s=t?o:o+1;"top"===r&&(i.createFooter(),this.addRowNodeToRowsToDisplay(e,i.sibling,a,s)),this.recursivelyAddToRowsToDisplay(e,i.childrenAfterSort,a,n,s),"bottom"===r&&(i.createFooter(),this.addRowNodeToRowsToDisplay(e,i.sibling,a,s))}}else if(i.master&&i.expanded){const t=this.createDetailNode(i);this.addRowNodeToRowsToDisplay(e,t,a,o)}}}addRowNodeToRowsToDisplay(e,t,a,n,o){o?a.unshift(t):a.push(t),t.setUiLevel(e.isGroupMultiAutoColumn?0:n)}createDetailNode(e){if((0,v._exists)(e.detailNode))return e.detailNode;const t=new v.RowNode(this.beans);return t.detail=!0,t.selectable=!1,t.parent=e,(0,v._exists)(e.id)&&(t.id="detail_"+e.id),t.data=e.data,t.level=e.level+1,e.detailNode=t,t}},C=a(3423),w=class extends C.BeanStub{constructor(){super(...arguments),this.beanName="immutableService"}wireBeans(e){this.rowModel=e.rowModel,this.selectionService=e.selectionService}postConstruct(){"clientSide"===this.rowModel.getType()&&';
      S = S + '(this.clientSideRowModel=this.rowModel,this.addManagedPropertyListener("rowData",(()=>this.onRowDataUpdated())))}isActive(){const e=this.gos.exists("getRowId");return!this.gos.get("resetRowDataOnUpdate")&&e}setRowData(e){const t=this.createTransactionForRowData(e);if(!t)return;const[a,n]=t;this.clientSideRowModel.updateRowData(a,n)}createTransactionForRowData(e){if((0,C._missing)(this.clientSideRowModel))return void(0,C._errorOnce)("ImmutableService only works with ClientSideRowModel");const t=this.gos.getRowIdCallback();if(null==t)return void(0,C._errorOnce)("ImmutableService requires getRowId() callback to be implemented, your row data needs IDs!");const a={remove:[],update:[],add:[]},n=this.clientSideRowModel.getCopyOfNodesMap(),o=this.gos.get("suppressMaintainUnsortedOrder")?void 0:{};return(0,C._exists)(e)&&e.forEach(((e,r)=>{const i=t({data:e,level:0}),s=n[i];if(o&&(o[i]=r),s){s.data!==e&&a.update.push(e),n[i]=void 0}else a.add.push(e)})),(0,C._iterateObject)(n,((e,t)=>{t&&a.remove.push(t.data)})),[a,o]}onRowDataUpdated(){const e=this.gos.get("rowData");e&&(this.isActive()?this.setRowData(e):(this.selectionService.reset("rowDataChanged"),this.clientSideRowModel.setRowData(e)))}},y=a(3423),S=class extends y.BeanStub{constructor(){super(...arguments),this.beanName="sortService"}wireBeans(e){this.columnModel=e.columnModel,this.funcColsService=e.funcColsService,this.rowNodeSorter=e.rowNodeSorter,this.showRowGroupColsService=e.showRowGroupColsService}sort(e,t,a,n,o,r){const i=this.gos.get("groupMaintainOrder"),s=this.columnModel.getCols().some((e=>e.isRowGroupActive()));let l={};a&&n&&(l=this.calculateDirtyNodes(n));const c=this.columnModel.isPivotMode(),g=this.gos.getCallback("postSortRows"),d=n=>{this.pullDownGroupDataForHideOpenParents(n.childrenAfterAggFilter,!0);const d=c&&n.leafGroup;if(i&&s&&!n.leafGroup&&!r){const e=this.funcColsService.getRowGroupColumns()?.[n.level+1],t=null===e?.getSort(),a=n.childrenAfterAggFilter.slice(0);if(n.childrenAfterSort&&!t){co';
      S = S + 'nst e={};n.childrenAfterSort.forEach(((t,a)=>{e[t.id]=a})),a.sort(((t,a)=>(e[t.id]??0)-(e[a.id]??0)))}n.childrenAfterSort=a}else n.childrenAfterSort=!t||d?n.childrenAfterAggFilter.slice(0):a?this.doDeltaSort(n,l,o,e):this.rowNodeSorter.doFullSort(n.childrenAfterAggFilter,e);if(n.sibling&&(n.sibling.childrenAfterSort=n.childrenAfterSort),this.updateChildIndexes(n),g){const e={nodes:n.childrenAfterSort};g(e)}};o&&o.forEachChangedNodeDepthFirst(d),this.updateGroupDataForHideOpenParents(o)}calculateDirtyNodes(e){const t={},a=e=>{e&&e.forEach((e=>t[e.id]=!0))};return e&&e.forEach((e=>{a(e.add),a(e.update),a(e.remove)})),t}doDeltaSort(e,t,a,n){const o=e.childrenAfterAggFilter,r=e.childrenAfterSort;if(!r)return this.rowNodeSorter.doFullSort(o,n);const i={},s=[];o.forEach((e=>{t[e.id]||!a.canSkip(e)?s.push(e):i[e.id]=!0}));const l=r.filter((e=>i[e.id])),c=(e,t)=>({currentPos:t,rowNode:e}),g=s.map(c).sort(((e,t)=>this.rowNodeSorter.compareRowNodes(n,e,t)));return this.mergeSortedArrays(n,g,l.map(c)).map((({rowNode:e})=>e))}mergeSortedArrays(e,t,a){const n=[];let o=0,r=0;for(;o<t.length&&r<a.length;){this.rowNodeSorter.compareRowNodes(e,t[o],a[r])<0?n.push(t[o++]):n.push(a[r++])}for(;o<t.length;)n.push(t[o++]);for(;r<a.length;)n.push(a[r++]);return n}updateChildIndexes(e){if((0,y._missing)(e.childrenAfterSort))return;const t=e.childrenAfterSort;for(let a=0;a<t.length;a++){const n=t[a],o=0===a,r=a===e.childrenAfterSort.length-1;n.setFirstChild(o),n.setLastChild(r),n.setChildIndex(a)}}updateGroupDataForHideOpenParents(e){if(!this.gos.get("groupHideOpenParents"))return;if(this.gos.get("treeData"))return(0,y._warnOnce)("The property hideOpenParents dose not work with Tree Data. This is because Tree Data has values at the group level, it doesn\'t make sense to hide them."),!1;const t=e=>{this.pullDownGroupDataForHideOpenParents(e.childrenAfterSort,!1),e.childrenAfterSort.forEach((e=>{e.hasChildren()&&t(e)}))};e&&e.executeFromRootNode((e=>t(e)))}pullDownGroupDataForHideOpenParents(e';
      S = S + ',t){this.gos.get("groupHideOpenParents")&&!(0,y._missing)(e)&&e.forEach((e=>{(this.showRowGroupColsService?.getShowRowGroupCols()??[]).forEach((a=>{const n=a.getColDef().showRowGroup;if("string"!=typeof n)return void(0,y._errorOnce)("groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup");const o=n,r=this.columnModel.getColDefCol(o);if(!(r===e.rowGroupColumn))if(t)e.setGroupValue(a.getId(),void 0);else{const t=e.getFirstChildOfFirstChild(r);t&&e.setGroupValue(a.getId(),t.key)}}))}))}},k=a(3423),x=class extends k.BeanStub{constructor(){super(...arguments),this.beanName="sortStage"}wireBeans(e){this.sortService=e.sortService,this.sortController=e.sortController}execute(e){const t=this.sortController.getSortOptions(),a=(0,k._exists)(t)&&t.length>0,n=a&&(0,k._exists)(e.rowNodeTransactions)&&this.gos.get("deltaSort"),o=t.some((e=>this.gos.isColumnsSortingCoupledToGroup()?e.column.isPrimary()&&e.column.isRowGroupActive():!!e.column.getColDef().showRowGroup));this.sortService.sort(t,a,n,e.rowNodeTransactions,e.changedPath,o)}},R="32.0.0",z={version:R,moduleName:`${c.ModuleNames.ClientSideRowModelModule}-core`,rowModel:"clientSide",beans:[u,f,x,b,S,w]},F={version:R,moduleName:`${c.ModuleNames.ClientSideRowModelModule}-api`,beans:[c.RowModelHelperService],apiFunctions:{onGroupExpandedOrCollapsed:function(e){e.expansionService.onGroupExpandedOrCollapsed()},refreshClientSideRowModel:function(e,t){e.rowModelHelperService?.getClientSideRowModel()?.refreshModel(t)},forEachLeafNode:function(e,t){e.rowModelHelperService?.getClientSideRowModel()?.forEachLeafNode(t)},forEachNodeAfterFilter:function(e,t){e.rowModelHelperService?.getClientSideRowModel()?.forEachNodeAfterFilter(t)},forEachNodeAfterFilterAndSort:function(e,t){e.rowModelHelperService?.getClientSideRowModel()?.forEachNodeAfterFilterAndSort(t)},resetRowHeights:function(e){e.columnModel.isAutoRowHeightActive()?(0,p._warnOnce)("calling gridApi.resetRowHeights() makes no sense when using Auto';
      S = S + ' Row Height."):e.rowModelHelperService?.getClientSideRowModel()?.resetRowHeights()},applyTransaction:function(e,t){return e.frameworkOverrides.wrapIncoming((()=>e.rowModelHelperService?.getClientSideRowModel()?.updateRowData(t)))},applyTransactionAsync:function(e,t,a){e.frameworkOverrides.wrapIncoming((()=>e.rowModelHelperService?.getClientSideRowModel()?.batchUpdateRowData(t,a)))},flushAsyncTransactions:function(e){e.frameworkOverrides.wrapIncoming((()=>e.rowModelHelperService?.getClientSideRowModel()?.flushAsyncTransactions()))},getBestCostNodeSelection:function(e){return e.selectionService.getBestCostNodeSelection()}},dependantModules:[z,c._CsrmSsrmSharedApiModule]},M={version:R,moduleName:c.ModuleNames.ClientSideRowModelModule,dependantModules:[z,F]}},3423:function(e,t,a){var n,o=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var a in t)o(e,a,{get:t[a],enumerable:!0})})(l,{ALWAYS_SYNC_GLOBAL_EVENTS:()=>Nc,AbstractHeaderCellCtrl:()=>sr,AgAbstractField:()=>nn,AgAbstractInputField:()=>on,AgAbstractLabel:()=>an,AgCheckbox:()=>rn,AgCheckboxSelector:()=>sn,AgColumn:()=>ae,AgColumnGroup:()=>Qe,AgInputDateField:()=>Ms,AgInputNumberField:()=>Do,AgInputNumberFieldSelector:()=>Eo,AgInputTextArea:()=>bs,AgInputTextField:()=>Fo,AgInputTextFieldSelector:()=>Mo,AgPickerField:()=>Co,AgPromise:()=>Cn,AgProvidedColumnGroup:()=>oe,AgRadioButton:()=>vo,AgSelect:()=>wo,AgSelectSelector:()=>yo,AgToggleButton:()=>nl,AgToggleButtonSelector:()=>ol,AnimateShowChangeCellRenderer:()=>$a,AnimateSlideCellRenderer:()=>en,AnimationFrameService:()=>ps,AriaAnnouncementService:()=>Yc,AutoScrollService:()=>_n,AutoWidthCalculator:()=>Ks,BarColumnLabelPlacement:()=>kg,BaseComponentWrapper:()=>wg,BeanStub:()=>A,BodyDropPivotTarget:()=>Nr,BodyDropTarget:()=>Wr,CellComp:()=>mi,CellCtrl:()=>Pi,CellNavigationService:()=>ul,CellPositionUtils:()=>El,CellRangeType:()=>zi,ChangedPath:()=>tg,ChartMappings:()=>Sg,Checkbox';
      S = S + "CellEditor:()=>Is,CheckboxCellRenderer:()=>ln,CheckboxSelectionComponent:()=>Ci,ClientSideRowModelSteps:()=>ms,ColumnApplyStateService:()=>Ie,ColumnAutosizeService:()=>Ae,ColumnFactory:()=>Fe,ColumnKeyCreator:()=>we,ColumnModel:()=>De,ColumnMoveService:()=>Oe,ColumnNameService:()=>Ve,ColumnSizeService:()=>Ue,CommunityFeaturesModule:()=>Lc,Component:()=>Ba,ComponentUtil:()=>ot,Context:()=>Wn,CssClassManager:()=>ft,CtrlsService:()=>Dl,DataTypeService:()=>Yl,DateCellEditor:()=>Ps,DateFilter:()=>$o,DateStringCellEditor:()=>Ts,DragAndDropService:()=>Yn,DragService:()=>Xn,DragSourceType:()=>Qn,Environment:()=>Ol,EventService:()=>ql,ExcelFactoryMode:()=>Un,ExpansionService:()=>fs,ExpressionService:()=>lg,FakeHScrollComp:()=>si,FakeVScrollComp:()=>gi,FilterManager:()=>ro,FilterWrapperComp:()=>io,FocusService:()=>Hl,FuncColsService:()=>Te,GROUP_AUTO_COLUMN_ID:()=>ye,Grid:()=>pg,GridBodyComp:()=>os,GridBodyCtrl:()=>pi,GridComp:()=>Ul,GridCoreCreator:()=>fg,GridCoreModule:()=>Tc,GridCtrl:()=>Wl,GridHeaderComp:()=>ei,GridHeaderCtrl:()=>Lr,GridOptionsService:()=>Vc,GroupInstanceIdCreator:()=>Ye,HeaderCellCtrl:()=>Kr,HeaderFilterCellComp:()=>Mr,HeaderFilterCellCtrl:()=>cr,HeaderGroupCellCtrl:()=>_r,HeaderNavigationDirection:()=>Tr,HeaderNavigationService:()=>Ir,HeaderPositionUtils:()=>Wc,HeaderRowComp:()=>Ar,HeaderRowContainerComp:()=>$r,HeaderRowContainerCtrl:()=>Xr,HeaderRowCtrl:()=>Zr,HeaderRowType:()=>Pr,HorizontalDirection:()=>Kn,HorizontalResizeService:()=>ds,KeyCode:()=>tn,LargeTextCellEditor:()=>ws,LayoutCssClasses:()=>ai,LocalEventService:()=>c,LocaleService:()=>Uc,ManagedFocusFeature:()=>ho,MenuService:()=>vs,ModuleNames:()=>Ja,ModuleRegistry:()=>Xa,MouseEventService:()=>cs,MoveColumnFeature:()=>Vr,NavigationService:()=>gs,NumberCellEditor:()=>Fs,NumberFilter:()=>Lo,NumberSequence:()=>Ia,OverlayWrapperComponent:()=>oi,PinnedRowModel:()=>Js,PivotResultColsService:()=>We,PopupComponent:()=>pn,PopupEditorWrapper:()=>ys,PopupService:()=>gl,PositionableFeature:()=>co,Propert";
      S = S + "yKeys:()=>at,ProvidedFilter:()=>fo,RefPlaceholder:()=>qa,ResizeObserverService:()=>us,RowContainerComp:()=>es,RowContainerCtrl:()=>$i,RowCtrl:()=>Ii,RowDragComp:()=>$n,RowHighlightPosition:()=>Jn,RowModelHelperService:()=>vg,RowNode:()=>oo,RowNodeBlock:()=>Xs,RowNodeBlockLoader:()=>$s,RowNodeSorter:()=>eg,RowPositionUtils:()=>Al,RowRenderer:()=>Ys,ScalarFilter:()=>xo,ScrollVisibleService:()=>is,SelectCellEditor:()=>Ss,SelectableService:()=>ng,SelectionHandleType:()=>Ri,ServerSideTransactionResultStatus:()=>Zs,SetLeftFeature:()=>er,SimpleFilter:()=>ko,SortController:()=>rg,SortIndicatorComp:()=>Ka,SortIndicatorSelector:()=>Qa,StandardMenuFactory:()=>hs,StylingService:()=>al,TabGuardClassNames:()=>rl,TabGuardComp:()=>ll,TabGuardCtrl:()=>il,TabGuardFeature:()=>sl,TextCellEditor:()=>Rs,TextFilter:()=>qo,TextFloatingFilter:()=>fr,TooltipFeature:()=>Na,TooltipStateManager:()=>Oa,TouchListener:()=>ja,UserComponentFactory:()=>Bn,UserComponentRegistry:()=>bn,ValueCache:()=>cg,ValueService:()=>gg,VanillaFrameworkOverrides:()=>hl,VerticalDirection:()=>jn,VisibleColsService:()=>_e,_ColumnFilterModule:()=>Cr,_CommunityMenuApiModule:()=>ec,_CsrmSsrmSharedApiModule:()=>bg,_EditCoreModule:()=>Bs,_FilterCoreModule:()=>vr,_FloatingFilterModule:()=>Sr,_ReadOnlyFloatingFilterModule:()=>kr,_RowNodeBlockModule:()=>el,_SsrmInfiniteSharedApiModule:()=>Cg,_addFocusableContainerListener:()=>oc,_areEqual:()=>h,_bindCellRendererToHtmlElement:()=>Ta,_capitalise:()=>Be,_clearElement:()=>ba,_cloneObject:()=>K,_combineAttributesAndGridOptions:()=>rt,_compose:()=>Ce,_createIcon:()=>Va,_createIconNoSpan:()=>Wa,_debounce:()=>fe,_defaultComparator:()=>W,_doOnce:()=>se,_errorOnce:()=>ge,_escapeString:()=>He,_exists:()=>L,_existsAndNotEmpty:()=>g,_flatten:()=>y,_forEachReverse:()=>k,_formatNumberCommas:()=>Uo,_formatNumberTwoDecimalPlacesAndCommas:()=>Wo,_fuzzySuggestions:()=>fn,_getAbsoluteHeight:()=>ha,_getAbsoluteWidth:()=>ua,_getAllValuesInObject:()=>Y,_getAriaPosInSet:()=>St,_getCtrlForEventTarget:";
      S = S + '()=>E,_getHeaderClassesFromColDef:()=>tr,_getInnerHeight:()=>ga,_getInnerWidth:()=>da,_getRowContainerOptions:()=>Ui,_getToolPanelClassesFromColDef:()=>ar,_includes:()=>w,_insertArrayIntoArray:()=>b,_insertIntoArray:()=>v,_isElementInEventPath:()=>P,_isEventFromPrintableCharacter:()=>Ro,_isIOSUserAgent:()=>Zt,_isNodeOrElement:()=>Ea,_isStopPropagationForAgGrid:()=>M,_isVisible:()=>ya,_iterateObject:()=>j,_jsonEquals:()=>V,_last:()=>d,_loadTemplate:()=>Sa,_log:()=>le,_makeNull:()=>I,_mergeDeep:()=>_,_missing:()=>O,_missingOrEmpty:()=>N,_parseDateTimeFromString:()=>Yo,_processOnChange:()=>it,_radioCssClass:()=>aa,_removeAriaExpanded:()=>At,_removeAriaSort:()=>Ht,_removeFromArray:()=>f,_removeFromParent:()=>Ca,_removeRepeatsFromArray:()=>p,_serialiseDate:()=>jo,_setAriaActiveDescendant:()=>Et,_setAriaChecked:()=>Wt,_setAriaColCount:()=>Nt,_setAriaColIndex:()=>Gt,_setAriaColSpan:()=>qt,_setAriaControls:()=>Ut,_setAriaDescribedBy:()=>Rt,_setAriaDisabled:()=>Mt,_setAriaExpanded:()=>Pt,_setAriaHidden:()=>Dt,_setAriaLabel:()=>kt,_setAriaLabelledBy:()=>xt,_setAriaLevel:()=>Ft,_setAriaPosInSet:()=>It,_setAriaRole:()=>yt,_setAriaRowCount:()=>Lt,_setAriaRowIndex:()=>Ot,_setAriaSelected:()=>Vt,_setAriaSetSize:()=>Tt,_setAriaSort:()=>Bt,_setDisabled:()=>sa,_setDisplayed:()=>ra,_setFixedWidth:()=>Fa,_setVisible:()=>ia,_shallowCompare:()=>u,_sortRowNodesByOrder:()=>yg,_stopPropagationForAgGrid:()=>F,_toStringOrNull:()=>G,_unwrapUserComp:()=>Hn,_utf8_encode:()=>qe,_values:()=>U,_waitUntil:()=>be,_warnOnce:()=>ce,createGrid:()=>ug,getDefaultFloatingFilterType:()=>dr,isColumn:()=>te,isColumnGroup:()=>Ke,isProvidedColumnGroup:()=>ne,isSelectionUIEvent:()=>Gc,provideGlobalGridOptions:()=>hg}),e.exports=(n=l,((e,t,a,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===a||o(e,l,{get:()=>t[l],enumerable:!(n=r(t,l))||n.enumerable});return e})(o({},"__esModule",{value:!0}),n));var c=class{constructor(){this.allSyncListeners=new Map,this.allAsyncListeners=new';
      S = S + ' Map,this.globalSyncListeners=new Set,this.globalAsyncListeners=new Set,this.asyncFunctionsQueue=[],this.scheduled=!1,this.firedEvents={}}setFrameworkOverrides(e){this.frameworkOverrides=e}getListeners(e,t,a){const n=t?this.allAsyncListeners:this.allSyncListeners;let o=n.get(e);return!o&&a&&(o=new Set,n.set(e,o)),o}noRegisteredListenersExist(){return 0===this.allSyncListeners.size&&0===this.allAsyncListeners.size&&0===this.globalSyncListeners.size&&0===this.globalAsyncListeners.size}addEventListener(e,t,a=!1){this.getListeners(e,a,!0).add(t)}removeEventListener(e,t,a=!1){const n=this.getListeners(e,a,!1);if(n&&(n.delete(t),0===n.size)){(a?this.allAsyncListeners:this.allSyncListeners).delete(e)}}addGlobalListener(e,t=!1){(t?this.globalAsyncListeners:this.globalSyncListeners).add(e)}removeGlobalListener(e,t=!1){(t?this.globalAsyncListeners:this.globalSyncListeners).delete(e)}dispatchEvent(e){const t=e;this.dispatchToListeners(t,!0),this.dispatchToListeners(t,!1),this.firedEvents[t.type]=!0}dispatchEventOnce(e){this.firedEvents[e.type]||this.dispatchEvent(e)}dispatchToListeners(e,t){const a=e.type;if(t&&"event"in e){const t=e.event;t instanceof Event&&(e.eventPath=t.composedPath())}const n=(a,n)=>a.forEach((a=>{if(!n.has(a))return;const o=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming((()=>a(e))):()=>a(e);t?this.dispatchAsync(o):o()})),o=this.getListeners(a,t,!1)??new Set,r=new Set(o);r.size>0&&n(r,o);new Set(t?this.globalAsyncListeners:this.globalSyncListeners).forEach((n=>{const o=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming((()=>n(a,e))):()=>n(a,e);t?this.dispatchAsync(o):o()}))}dispatchAsync(e){if(this.asyncFunctionsQueue.push(e),!this.scheduled){const e=()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)};this.frameworkOverrides?this.frameworkOverrides.wrapIncoming(e):e(),this.scheduled=!0}}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[],e.forEach((e=>e()))}};funct';
      S = S + 'ion g(e){return null!=e&&e.length>0}function d(e){if(e&&e.length)return e[e.length-1]}function h(e,t,a){return null==e&&null==t||null!=e&&null!=t&&e.length===t.length&&e.every(((e,n)=>a?a(e,t[n]):t[n]===e))}function u(e,t){return h(e,t)}function p(e,t){if(e)for(let a=e.length-2;a>=0;a--){const n=e[a]===t,o=e[a+1]===t;n&&o&&e.splice(a+1,1)}}function m(e,t){const a=e.indexOf(t);a>=0&&(e[a]=e[e.length-1],e.pop())}function f(e,t){const a=e.indexOf(t);a>=0&&e.splice(a,1)}function v(e,t,a){e.splice(a,0,t)}function b(e,t,a){if(null!=e&&null!=t)for(let n=t.length-1;n>=0;n--){v(e,t[n],a)}}function C(e,t,a){!function(e,t){for(let a=0;a<t.length;a++)f(e,t[a])}(e,t),t.slice().reverse().forEach((t=>v(e,t,a)))}function w(e,t){return e.indexOf(t)>-1}function y(e){return[].concat.apply([],e)}function S(e,t){null!=t&&null!=e&&t.forEach((t=>e.push(t)))}function k(e,t){if(null!=e)for(let a=e.length-1;a>=0;a--)t(e[a],a)}var x="__ag_Grid_Stop_Propagation",R=["touchstart","touchend","touchmove","touchcancel","scroll"],z={};function F(e){e[x]=!0}function M(e){return!0===e[x]}var D=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return t=>{if("boolean"==typeof z[t])return z[t];const a=document.createElement(e[t]||"div");return z[t="on"+t]=t in a}})();function E(e,t,a){let n=t;for(;n;){const t=e.getDomData(n,a);if(t)return t;n=n.parentElement}return null}function P(e,t){return!(!t||!e)&&function(e){const t=e;if(t.path)return t.path;if(t.composedPath)return t.composedPath();return function(e){const t=[];let a=e.target;for(;a;)t.push(a),a=a.parentElement;return t}(t)}(t).indexOf(e)>=0}var A=class{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.propertyListenerId=0,this.lastChangeSetIdLookup={},this.isAlive=()=>!this.destroyed}preWireBeans(e){this.gridId=e.context.getGridId(),this.frameworkOverrides=e.frameworkOverrides,this.stubContext=e.context,this.eventService=e.eventService,this.gos=e.gos,this.local';
      S = S + 'eService=e.localeService}getFrameworkOverrides(){return this.frameworkOverrides}destroy(){for(let e=0;e<this.destroyFunctions.length;e++)this.destroyFunctions[e]();this.destroyFunctions.length=0,this.destroyed=!0,this.dispatchLocalEvent({type:"destroyed"})}addEventListener(e,t){this.localEventService||(this.localEventService=new c),this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService&&this.localEventService.removeEventListener(e,t)}dispatchLocalEvent(e){this.localEventService&&this.localEventService.dispatchEvent(e)}addManagedElementListeners(e,t){return this._setupListeners(e,t)}addManagedEventListeners(e){return this._setupListeners(this.eventService,e)}addManagedListeners(e,t){return this._setupListeners(e,t)}_setupListeners(e,t){const a=[];for(const n in t){const o=t[n];o&&a.push(this._setupListener(e,n,o))}return a}_setupListener(e,t,a){if(this.destroyed)return()=>null;e instanceof HTMLElement?function(e,t,a,n){const o=w(R,a)?{passive:!0}:void 0;e&&e.addEventListener&&e.addEventListener(t,a,n,o)}(this.getFrameworkOverrides(),e,t,a):e.addEventListener(t,a);const n=()=>(e.removeEventListener(t,a),null);return this.destroyFunctions.push(n),()=>(n(),this.destroyFunctions=this.destroyFunctions.filter((e=>e!==n)),null)}setupGridOptionListener(e,t){this.gos.addPropertyEventListener(e,t);const a=()=>(this.gos.removePropertyEventListener(e,t),null);return this.destroyFunctions.push(a),()=>(a(),this.destroyFunctions=this.destroyFunctions.filter((e=>e!==a)),null)}addManagedPropertyListener(e,t){return this.destroyed?()=>null:this.setupGridOptionListener(e,t)}addManagedPropertyListeners(e,t){if(this.destroyed)return;const a=e.join("-")+this.propertyListenerId++,n=e=>{if(e.changeSet){if(e.changeSet&&e.changeSet.id===this.lastChangeSetIdLookup[a])return;this.lastChangeSetIdLookup[a]=e.changeSet.id}const n={type:"gridPropertyChanged",changeSet:e.changeSet,source:e.source};t(n)};e.forEach((e=>this.setupGridOptionListener(e,n)))}addDestro';
      S = S + 'yFunc(e){this.isAlive()?this.destroyFunctions.push(e):e()}createManagedBean(e,t){const a=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),a}createBean(e,t,a){return(t||this.stubContext).createBean(e,a)}destroyBean(e,t){return(t||this.stubContext).destroyBean(e)}destroyBeans(e,t){return(t||this.stubContext).destroyBeans(e)}},T=class{constructor(e){this.frameworkOverrides=e,this.wrappedListeners=new Map,this.wrappedGlobalListeners=new Map}wrap(e){let t=e;return this.frameworkOverrides.shouldWrapOutgoing&&(t=t=>{this.frameworkOverrides.wrapOutgoing((()=>e(t)))},this.wrappedListeners.set(e,t)),t}wrapGlobal(e){let t=e;return this.frameworkOverrides.shouldWrapOutgoing&&(t=(t,a)=>{this.frameworkOverrides.wrapOutgoing((()=>e(t,a)))},this.wrappedGlobalListeners.set(e,t)),t}unwrap(e){return this.wrappedListeners.get(e)??e}unwrapGlobal(e){return this.wrappedGlobalListeners.get(e)??e}};function I(e){return null==e||""===e?null:e}function L(e,t=!1){return null!=e&&(""!==e||t)}function O(e){return!L(e)}function N(e){return null==e||0===e.length}function G(e){return null!=e&&"function"==typeof e.toString?e.toString():null}function q(e){if(void 0===e)return;if(null===e||""===e)return null;if("number"==typeof e)return isNaN(e)?void 0:e;const t=parseInt(e,10);return isNaN(t)?void 0:t}function B(e){if(void 0!==e)return null!==e&&""!==e&&H(e)}function H(e){return"boolean"==typeof e?e:"string"==typeof e&&("TRUE"===e.toUpperCase()||""==e)}function V(e,t){return(e?JSON.stringify(e):null)===(t?JSON.stringify(t):null)}function W(e,t,a=!1){const n=null==e,o=null==t;if(e&&e.toNumber&&(e=e.toNumber()),t&&t.toNumber&&(t=t.toNumber()),n&&o)return 0;if(n)return-1;if(o)return 1;function r(e,t){return e>t?1:e<t?-1:0}if("string"!=typeof e)return r(e,t);if(!a)return r(e,t);try{return e.localeCompare(t)}catch(a){return r(e,t)}}function U(e){if(e instanceof Set||e instanceof Map){const t=[];return e.forEach((e=>t.push(e))),t}return Object.values(e)}function j(e,t){if(nul';
      S = S + 'l!=e)if(Array.isArray(e))for(let a=0;a<e.length;a++)t(a.toString(),e[a]);else for(const[a,n]of Object.entries(e))t(a,n)}function K(e){const t={},a=Object.keys(e);for(let n=0;n<a.length;n++){const o=a[n],r=e[o];t[o]=r}return t}function Q(e,t){if(!e)return;const a=e,n={};return Object.keys(a).forEach((e=>{if(t&&t.indexOf(e)>=0)return;const o=a[e],r=Z(o)&&o.constructor===Object;n[e]=r?Q(o):o})),n}function Y(e){if(!e)return[];const t=Object;if("function"==typeof t.values)return t.values(e);const a=[];for(const t in e)e.hasOwnProperty(t)&&e.propertyIsEnumerable(t)&&a.push(e[t]);return a}function _(e,t,a=!0,n=!1){L(t)&&j(t,((t,o)=>{let r=e[t];if(r!==o){if(n){if(null==r&&null!=o){"object"==typeof o&&o.constructor===Object&&(r={},e[t]=r)}}Z(o)&&Z(r)&&!Array.isArray(r)?_(r,o,a,n):(a||void 0!==o)&&(e[t]=o)}}))}function J(e,t,a){if(!t||!e)return;if(!a)return e[t];const n=t.split(".");let o=e;for(let e=0;e<n.length;e++){if(null==o)return;o=o[n[e]]}return o}function Z(e){return"object"==typeof e&&null!==e}var X={resizable:!0,sortable:!0},$=0;function ee(){return $++}function te(e){return e instanceof ae}var ae=class extends A{constructor(e,t,a,n){super(),this.isColumn=!0,this.instanceId=ee(),this.autoHeaderHeight=null,this.moving=!1,this.menuVisible=!1,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.columnEventService=new c,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.colDef=e,this.userProvidedColDef=t,this.colId=a,this.primary=n,this.setState(e)}wireBeans(e){this.columnHoverService=e.columnHoverService}getInstanceId(){return this.instanceId}setState(e){void 0!==e.sort?"asc"!==e.sort&&"desc"!==e.sort||(this.sort=e.sort):"asc"!==e.initialSort&&"desc"!==e.initialSort||(this.sort=e.initialSort);const t=e.sortIndex,a=e.initialSortIndex;void 0!==t?null!==t&&(this.sortIndex=t):null!==a&&(this.sortIndex=a);const n=e.hide,o=e.initialHide;this.visible=void 0!==n?!n:!o,void 0!==e.pinned?this.setPinned(e.pinned):';
      S = S + 'this.setPinned(e.initialPinned);const r=e.flex,i=e.initialFlex;void 0!==r?this.flex=r:void 0!==i&&(this.flex=i)}setColDef(e,t,a){this.colDef=e,this.userProvidedColDef=t,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),this.columnEventService.dispatchEvent(this.createColumnEvent("colDefChanged",a))}getUserProvidedColDef(){return this.userProvidedColDef}setParent(e){this.parent=e}getParent(){return this.parent}setOriginalParent(e){this.originalParent=e}getOriginalParent(){return this.originalParent}postConstruct(){this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.initTooltip()}initDotNotation(){const e=this.gos.get("suppressFieldDotNotation");this.fieldContainsDots=L(this.colDef.field)&&this.colDef.field.indexOf(".")>=0&&!e,this.tooltipFieldContainsDots=L(this.colDef.tooltipField)&&this.colDef.tooltipField.indexOf(".")>=0&&!e}initMinAndMaxWidths(){const e=this.colDef;this.minWidth=e.minWidth??20,this.maxWidth=e.maxWidth??Number.MAX_SAFE_INTEGER}initTooltip(){this.tooltipEnabled=L(this.colDef.tooltipField)||L(this.colDef.tooltipValueGetter)||L(this.colDef.tooltipComponent)}resetActualWidth(e){const t=this.calculateColInitialWidth(this.colDef);this.setActualWidth(t,e,!0)}calculateColInitialWidth(e){let t;const a=q(e.width),n=q(e.initialWidth);return t=null!=a?a:null!=n?n:200,Math.max(Math.min(t,this.maxWidth),this.minWidth)}isEmptyGroup(){return!1}isRowGroupDisplayed(e){if(O(this.colDef)||O(this.colDef.showRowGroup))return!1;const t=!0===this.colDef.showRowGroup,a=this.colDef.showRowGroup===e;return t||a}isPrimary(){return this.primary}isFilterAllowed(){return!!this.colDef.filter}isFieldContainsDots(){return this.fieldContainsDots}isTooltipEnabled(){return this.tooltipEnabled}isTooltipFieldContainsDots(){return this.tooltipFieldContainsDots}addEventListener(e,t){this.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.columnEventService.setFrameworkOverrides(this.frameworkOv';
      S = S + 'errides),this.frameworkEventListenerService=new T(this.frameworkOverrides));const a=this.frameworkEventListenerService?.wrap(t)??t;this.columnEventService.addEventListener(e,a)}removeEventListener(e,t){const a=this.frameworkEventListenerService?.unwrap(t)??t;this.columnEventService.removeEventListener(e,a)}createColumnFunctionCallbackParams(e){return this.gos.addGridCommonParams({node:e,data:e.data,column:this,colDef:this.colDef})}isSuppressNavigable(e){if("boolean"==typeof this.colDef.suppressNavigable)return this.colDef.suppressNavigable;if("function"==typeof this.colDef.suppressNavigable){const t=this.createColumnFunctionCallbackParams(e);return(0,this.colDef.suppressNavigable)(t)}return!1}isCellEditable(e){return!(e.group&&!this.gos.get("enableGroupEdit"))&&this.isColumnFunc(e,this.colDef.editable)}isSuppressFillHandle(){return!!this.colDef.suppressFillHandle}isAutoHeight(){return!!this.colDef.autoHeight}isAutoHeaderHeight(){return!!this.colDef.autoHeaderHeight}isRowDrag(e){return this.isColumnFunc(e,this.colDef.rowDrag)}isDndSource(e){return this.isColumnFunc(e,this.colDef.dndSource)}isCellCheckboxSelection(e){return this.isColumnFunc(e,this.colDef.checkboxSelection)}isSuppressPaste(e){return this.isColumnFunc(e,this.colDef?this.colDef.suppressPaste:null)}isResizable(){return!!this.getColDefValue("resizable")}getColDefValue(e){return this.colDef[e]??X[e]}isColumnFunc(e,t){if("boolean"==typeof t)return t;if("function"==typeof t){return t(this.createColumnFunctionCallbackParams(e))}return!1}setMoving(e,t){this.moving=e,this.columnEventService.dispatchEvent(this.createColumnEvent("movingChanged",t))}createColumnEvent(e,t){return this.gos.addGridCommonParams({type:e,column:this,columns:[this],source:t})}isMoving(){return this.moving}getSort(){return this.sort}setSort(e,t){this.sort!==e&&(this.sort=e,this.columnEventService.dispatchEvent(this.createColumnEvent("sortChanged",t))),this.dispatchStateUpdatedEvent("sort")}isSortable(){return!!this.getColDefValue("sortabl';
      S = S + 'e")}isSortAscending(){return"asc"===this.sort}isSortDescending(){return"desc"===this.sort}isSortNone(){return O(this.sort)}isSorting(){return L(this.sort)}getSortIndex(){return this.sortIndex}setSortIndex(e){this.sortIndex=e,this.dispatchStateUpdatedEvent("sortIndex")}setMenuVisible(e,t){this.menuVisible!==e&&(this.menuVisible=e,this.columnEventService.dispatchEvent(this.createColumnEvent("menuVisibleChanged",t)))}isMenuVisible(){return this.menuVisible}setAggFunc(e){this.aggFunc=e,this.dispatchStateUpdatedEvent("aggFunc")}getAggFunc(){return this.aggFunc}getLeft(){return this.left}getOldLeft(){return this.oldLeft}getRight(){return this.left+this.actualWidth}setLeft(e,t){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.columnEventService.dispatchEvent(this.createColumnEvent("leftChanged",t)))}isFilterActive(){return this.filterActive}setFilterActive(e,t,a){this.filterActive!==e&&(this.filterActive=e,this.columnEventService.dispatchEvent(this.createColumnEvent("filterActiveChanged",t)));const n=this.createColumnEvent("filterChanged",t);a&&_(n,a),this.columnEventService.dispatchEvent(n)}isHovered(){return this.columnHoverService.isHovered(this)}setPinned(e){this.pinned=!0===e||"left"===e?"left":"right"===e?"right":null,this.dispatchStateUpdatedEvent("pinned")}setFirstRightPinned(e,t){this.firstRightPinned!==e&&(this.firstRightPinned=e,this.columnEventService.dispatchEvent(this.createColumnEvent("firstRightPinnedChanged",t)))}setLastLeftPinned(e,t){this.lastLeftPinned!==e&&(this.lastLeftPinned=e,this.columnEventService.dispatchEvent(this.createColumnEvent("lastLeftPinnedChanged",t)))}isFirstRightPinned(){return this.firstRightPinned}isLastLeftPinned(){return this.lastLeftPinned}isPinned(){return"left"===this.pinned||"right"===this.pinned}isPinnedLeft(){return"left"===this.pinned}isPinnedRight(){return"right"===this.pinned}getPinned(){return this.pinned}setVisible(e,t){const a=!0===e;this.visible!==a&&(this.visible=a,this.columnEventService.dispatchEvent(this.cre';
      S = S + 'ateColumnEvent("visibleChanged",t))),this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){const e=this.getColDef();return!e.suppressSpanHeaderHeight&&!e.autoHeaderHeight}getColumnGroupPaddingInfo(){let e=this.getParent();if(!e||!e.isPadding())return{numberOfParents:0,isSpanningTotal:!1};const t=e.getPaddingLevel()+1;let a=!0;for(;e;){if(!e.isPadding()){a=!1;break}e=e.getParent()}return{numberOfParents:t,isSpanningTotal:a}}getColDef(){return this.colDef}getDefinition(){return this.colDef}getColumnGroupShow(){return this.colDef.columnGroupShow}getColId(){return this.colId}getId(){return this.colId}getUniqueId(){return this.colId}getActualWidth(){return this.actualWidth}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){const t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}createBaseColDefParams(e){return this.gos.addGridCommonParams({node:e,data:e.data,colDef:this.colDef,column:this})}getColSpan(e){if(O(this.colDef.colSpan))return 1;const t=this.createBaseColDefParams(e),a=this.colDef.colSpan(t);return Math.max(a,1)}getRowSpan(e){if(O(this.colDef.rowSpan))return 1;const t=this.createBaseColDefParams(e),a=this.colDef.rowSpan(t);return Math.max(a,1)}setActualWidth(e,t,a=!1){e=Math.max(e,this.minWidth),e=Math.min(e,this.maxWidth),this.actualWidth!==e&&(this.actualWidth=e,this.flex&&"flex"!==t&&"gridInitializing"!==t&&(this.flex=null),a||this.fireColumnWidthChangedEvent(t)),this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(e){this.columnEventService.dispatchEvent(this.createColumnEvent("widthChanged",e))}isGreaterThanMax(e){return e>this.maxWidth}getMinWidth(){return this.minWidth}getMaxWidth(){return this.maxWidth}getFlex(){return this.flex||0}setFlex(e){this.flex!==e&&(this.flex=e),this.dispatchStateUpdatedEvent("flex")}setMinimum(e){this.setActualWidth(this.minWidth,e)}setRowGroupActive(e,t){this.rowGroupActive!==e&&(this.rowGroupActive=e,this.columnEventService.dispatchEvent(t';
      S = S + 'his.createColumnEvent("columnRowGroupChanged",t))),this.dispatchStateUpdatedEvent("rowGroup")}isRowGroupActive(){return this.rowGroupActive}setPivotActive(e,t){this.pivotActive!==e&&(this.pivotActive=e,this.columnEventService.dispatchEvent(this.createColumnEvent("columnPivotChanged",t))),this.dispatchStateUpdatedEvent("pivot")}isPivotActive(){return this.pivotActive}isAnyFunctionActive(){return this.isPivotActive()||this.isRowGroupActive()||this.isValueActive()}isAnyFunctionAllowed(){return this.isAllowPivot()||this.isAllowRowGroup()||this.isAllowValue()}setValueActive(e,t){this.aggregationActive!==e&&(this.aggregationActive=e,this.columnEventService.dispatchEvent(this.createColumnEvent("columnValueChanged",t)))}isValueActive(){return this.aggregationActive}isAllowPivot(){return!0===this.colDef.enablePivot}isAllowValue(){return!0===this.colDef.enableValue}isAllowRowGroup(){return!0===this.colDef.enableRowGroup}dispatchStateUpdatedEvent(e){this.columnEventService.dispatchEvent({type:"columnStateUpdated",key:e})}};function ne(e){return e instanceof oe}var oe=class extends A{constructor(e,t,a,n){super(),this.isColumn=!1,this.expandable=!1,this.instanceId=ee(),this.expandableListenerRemoveCallback=null,this.colGroupDef=e,this.groupId=t,this.expanded=!!e&&!!e.openByDefault,this.padding=a,this.level=n}destroy(){this.expandableListenerRemoveCallback&&this.reset(null,void 0),super.destroy()}reset(e,t){this.colGroupDef=e,this.level=t,this.originalParent=null,this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback(),this.children=void 0,this.expandable=void 0}getInstanceId(){return this.instanceId}setOriginalParent(e){this.originalParent=e}getOriginalParent(){return this.originalParent}getLevel(){return this.level}isVisible(){return!!this.children&&this.children.some((e=>e.isVisible()))}isPadding(){return this.padding}setExpanded(e){this.expanded=void 0!==e&&e,this.dispatchLocalEvent({type:"expandedChanged"})}isExpandable(){return this.expandable}isExpand';
      S = S + 'ed(){return this.expanded}getGroupId(){return this.groupId}getId(){return this.getGroupId()}setChildren(e){this.children=e}getChildren(){return this.children}getColGroupDef(){return this.colGroupDef}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}addLeafColumns(e){this.children&&this.children.forEach((t=>{te(t)?e.push(t):ne(t)&&t.addLeafColumns(e)}))}getColumnGroupShow(){const e=this.colGroupDef;if(e)return e.columnGroupShow}setupExpandable(){this.setExpandable(),this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback();const e=this.onColumnVisibilityChanged.bind(this);this.getLeafColumns().forEach((t=>t.addEventListener("visibleChanged",e))),this.expandableListenerRemoveCallback=()=>{this.getLeafColumns().forEach((t=>t.removeEventListener("visibleChanged",e))),this.expandableListenerRemoveCallback=null}}setExpandable(){if(this.isPadding())return;let e=!1,t=!1,a=!1;const n=this.findChildrenRemovingPadding();for(let o=0,r=n.length;o<r;o++){const r=n[o];if(!r.isVisible())continue;const i=r.getColumnGroupShow();"open"===i?(e=!0,a=!0):"closed"===i?(t=!0,a=!0):(e=!0,t=!0)}const o=e&&t&&a;this.expandable!==o&&(this.expandable=o,this.dispatchLocalEvent({type:"expandableChanged"}))}findChildrenRemovingPadding(){const e=[],t=a=>{a.forEach((a=>{ne(a)&&a.isPadding()?t(a.children):e.push(a)}))};return t(this.children),e}onColumnVisibilityChanged(){this.setExpandable()}},re={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}},ie={};function se(e,t){ie[t]||(e(),ie[t]=!0)}function le(e,...t){console.log("AG Grid: "+e,...t)}function ce(e,...t){se((()=>console.warn("AG Grid: "+e,...t)),e)}function ge(e,...t){se((()=>console.error("AG Grid: "+e,...t)),e)}function de(e){return!!(e&&e.constructor&&e.call&&e.apply)}function he(e){!function(e,t=0){e.length>0&&window.setTimeout((()=>e.forEach((e=>e()))),t)}(e,400)}var ue=[],pe=!1;func';
      S = S + 'tion me(e){ue.push(e),pe||(pe=!0,window.setTimeout((()=>{const e=ue.slice();ue.length=0,pe=!1,e.forEach((e=>e()))}),0))}function fe(e,t){let a;return function(...n){const o=this;window.clearTimeout(a),a=window.setTimeout((function(){e.apply(o,n)}),t)}}function ve(e,t){let a=0;return function(...n){const o=(new Date).getTime();o-a<t||(a=o,e.apply(this,n))}}function be(e,t,a=100,n){const o=(new Date).getTime();let r=null,i=!1;const s=()=>{const s=(new Date).getTime()-o>a;(e()||s)&&(t(),i=!0,null!=r&&(window.clearInterval(r),r=null),s&&n&&ce(n))};s(),i||(r=window.setInterval(s,10))}function Ce(...e){return t=>e.reduce(((e,t)=>t(e)),t)}var we=class{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t<e.length;t++)this.existingKeys[e[t]]=!0}getUniqueKey(e,t){e=G(e);let a=0;for(;;){let n;if(e?(n=e,0!==a&&(n+="_"+a)):t?(n=t,0!==a&&(n+="_"+a)):n=a,!this.existingKeys[n])return this.existingKeys[n]=!0,String(n);a++}}},ye="ag-Grid-AutoColumn";function Se(e){const t=[],a=e=>{for(let n=0;n<e.length;n++){const o=e[n];te(o)?t.push(o):ne(o)&&a(o.getChildren())}};return a(e),t}function ke(e){return e.reduce(((e,t)=>e+t.getActualWidth()),0)}function xe(e,t,a){const n={};if(!t)return;Me(null,t,(e=>{n[e.getInstanceId()]=e})),a&&Me(null,a,(e=>{n[e.getInstanceId()]=null}));const o=Object.values(n).filter((e=>null!=e));e.destroyBeans(o)}function Re(e){return e.getId().startsWith(ye)}function ze(e){let t=[];if(e instanceof Array){e.some((e=>"string"!=typeof e))?ce("if colDef.type is supplied an array it should be of type \'string[]\'"):t=e}else"string"==typeof e?t=e.split(","):ce("colDef.type should be of type \'string\' | \'string[]\'");return t}var Fe=class extends A{constructor(){super(...arguments),this.beanName="columnFactory"}wireBeans(e){this.dataTypeService=e.dataTypeService}createColumnTree(e,t,a,n){const o=new we,{existingCols:r,existingGroups:i,existingColKeys:s}=this.extractExistingTreeData(a);o.addExistingKeys(s);const l=this.recursivelyCreateColumns(e,0,t,r,o,i,n),c=';
      S = S + "this.findMaxDept(l,0),g=this.balanceColumnTree(l,0,c,o);return Me(null,g,((e,t)=>{ne(e)&&e.setupExpandable(),e.setOriginalParent(t)})),{columnTree:g,treeDept:c}}extractExistingTreeData(e){const t=[],a=[],n=[];return e&&Me(null,e,(e=>{if(ne(e)){const t=e;a.push(t)}else{const a=e;n.push(a.getId()),t.push(a)}})),{existingCols:t,existingGroups:a,existingColKeys:n}}createForAutoGroups(e,t){const a=[],n=this.findDepth(t);return e.forEach((e=>{let t=e;for(let a=n-1;a>=0;a--){const n=new oe(null,`FAKE_PATH_${e.getId()}}_${a}`,!0,a);this.createBean(n),n.setChildren([t]),t.setOriginalParent(n),t=n}0===n&&e.setOriginalParent(null),a.push(t)})),[a,n]}findDepth(e){let t=0,a=e;for(;a&&a[0]&&ne(a[0]);)t++,a=a[0].getChildren();return t}balanceColumnTree(e,t,a,n){const o=[];for(let r=0;r<e.length;r++){const i=e[r];if(ne(i)){const e=i,r=this.balanceColumnTree(e.getChildren(),t+1,a,n);e.setChildren(r),o.push(e)}else{let r,s;for(let e=a-1;e>=t;e--){const e=n.getUniqueKey(null,null),a=this.createMergedColGroupDef(null),o=new oe(a,e,!0,t);this.createBean(o),s&&s.setChildren([o]),s=o,r||(r=s)}if(r&&s){o.push(r);if(e.some((e=>ne(e)))){s.setChildren([i]);continue}s.setChildren(e);break}o.push(i)}}return o}findMaxDept(e,t){let a=t;for(let n=0;n<e.length;n++){const o=e[n];if(ne(o)){const e=o,n=this.findMaxDept(e.getChildren(),t+1);a<n&&(a=n)}}return a}recursivelyCreateColumns(e,t,a,n,o,r,i){if(!e)return[];const s=new Array(e.length);for(let l=0;l<s.length;l++){const c=e[l];this.isColumnGroup(c)?s[l]=this.createColumnGroup(a,c,t,n,o,r,i):s[l]=this.createColumn(a,c,n,o,i)}return s}createColumnGroup(e,t,a,n,o,r,i){const s=this.createMergedColGroupDef(t),l=o.getUniqueKey(s.groupId||null,null),c=new oe(s,l,!1,a);this.createBean(c);const g=this.findExistingGroup(t,r);g&&r.splice(g.idx,1);const d=g?.group;d&&c.setExpanded(d.isExpanded());const h=this.recursivelyCreateColumns(s.children,a+1,e,n,o,r,i);return c.setChildren(h),c}createMergedColGroupDef(e){const t={};return Object.assign(t,this.gos.get(";
      S = S + '"defaultColGroupDef")),Object.assign(t,e),t}createColumn(e,t,a,n,o){const r=this.findExistingColumn(t,a);r&&a?.splice(r.idx,1);let i=r?.column;if(i){const e=this.addColumnDefaultAndTypes(t,i.getColId());i.setColDef(e,t,o),this.applyColumnState(i,e,o)}else{const a=n.getUniqueKey(t.colId,t.field),o=this.addColumnDefaultAndTypes(t,a);i=new ae(o,t,a,e),this.createBean(i)}return this.dataTypeService?.addColumnListeners(i),i}applyColumnState(e,t,a){const n=q(t.flex);void 0!==n&&e.setFlex(n);if(e.getFlex()<=0){const n=q(t.width);if(null!=n)e.setActualWidth(n,a);else{const t=e.getActualWidth();e.setActualWidth(t,a)}}void 0!==t.sort&&("asc"==t.sort||"desc"==t.sort?e.setSort(t.sort,a):e.setSort(void 0,a));const o=q(t.sortIndex);void 0!==o&&e.setSortIndex(o);const r=B(t.hide);void 0!==r&&e.setVisible(!r,a),void 0!==t.pinned&&e.setPinned(t.pinned)}findExistingColumn(e,t){if(t)for(let a=0;a<t.length;a++){const n=t[a].getUserProvidedColDef();if(!n)continue;if(null!=e.colId){if(t[a].getId()===e.colId)return{idx:a,column:t[a]};continue}if(null!=e.field){if(n.field===e.field)return{idx:a,column:t[a]}}else if(n===e)return{idx:a,column:t[a]}}}findExistingGroup(e,t){if(null!=e.groupId)for(let a=0;a<t.length;a++){const n=t[a];if(n.getColGroupDef()&&n.getId()===e.groupId)return{idx:a,group:n}}}addColumnDefaultAndTypes(e,t){const a={};_(a,this.gos.get("defaultColDef"),!1,!0);const n=this.updateColDefAndGetColumnType(a,e,t);n&&this.assignColumnTypes(n,a),_(a,e,!1,!0);const o=this.gos.get("autoGroupColumnDef"),r=this.gos.isColumnsSortingCoupledToGroup();return e.rowGroup&&o&&r&&_(a,{sort:o.sort,initialSort:o.initialSort},!1,!0),this.dataTypeService?.validateColDef(a),a}updateColDefAndGetColumnType(e,t,a){const n=this.dataTypeService?.updateColDefAndGetColumnType(e,t,a),o=t.type??n??e.type;return e.type=o,o?ze(o):void 0}assignColumnTypes(e,t){if(!e.length)return;const a=Object.assign({},re);j(this.gos.get("columnTypes")||{},((e,t)=>{if(e in a)ce(`the column type \'${e}\' is a default column ty';
      S = S + 'pe and cannot be overridden.`);else{t.type&&ce("Column type definitions \'columnTypes\' with a \'type\' attribute are not supported because a column type cannot refer to another column type. Only column definitions \'columnDefs\' can use the \'type\' attribute to refer to a column type."),a[e]=t}})),e.forEach((e=>{const n=a[e.trim()];n?_(t,n,!1,!0):ce("colDef.type \'"+e+"\' does not correspond to defined gridOptions.columnTypes")}))}isColumnGroup(e){return void 0!==e.children}};function Me(e,t,a){if(t)for(let n=0;n<t.length;n++){const o=t[n];ne(o)&&Me(o,o.getChildren(),a),a(o,e)}}var De=class extends A{constructor(){super(...arguments),this.beanName="columnModel",this.pivotMode=!1,this.autoHeightActiveAtLeastOnce=!1,this.ready=!1,this.changeEventsDispatching=!1,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}wireBeans(e){this.context=e.context,this.columnFactory=e.columnFactory,this.columnSizeService=e.columnSizeService,this.visibleColsService=e.visibleColsService,this.columnViewportService=e.columnViewportService,this.pivotResultColsService=e.pivotResultColsService,this.columnAnimationService=e.columnAnimationService,this.autoColService=e.autoColService,this.valueCache=e.valueCache,this.columnDefFactory=e.columnDefFactory,this.columnApplyStateService=e.columnApplyStateService,this.columnGroupStateService=e.columnGroupStateService,this.eventDispatcher=e.columnEventDispatcher,this.columnMoveService=e.columnMoveService,this.columnAutosizeService=e.columnAutosizeService,this.funcColsService=e.funcColsService,this.quickFilterService=e.quickFilterService,this.showRowGroupColsService=e.showRowGroupColsService,this.environment=e.environment}postConstruct(){const e=this.gos.get("pivotMode");this.isPivotSettingAllowed(e)&&(this.pivotMode=e),this.addManagedPropertyListeners(["groupDisplayType","treeData","treeDataDisplayType","groupHideOpenParents"],(e=>this.refreshAll(Ee(e.source)))),this.addManagedPropertyListener("autoGroupColumnDef",(e=>this.onAutoGroupColumnDefCha';
      S = S + 'nged(Ee(e.source)))),this.addManagedPropertyListeners(["defaultColDef","columnTypes","suppressFieldDotNotation"],(e=>this.recreateColumnDefs(Ee(e.source)))),this.addManagedPropertyListener("pivotMode",(e=>this.setPivotMode(this.gos.get("pivotMode"),Ee(e.source)))),this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered()})}createColsFromColDefs(e,t){const a=e?this.columnApplyStateService.compareColumnStatesAndDispatchEvents(t):void 0;this.valueCache.expire();const n=this.colDefCols&&this.colDefCols.list,o=this.colDefCols&&this.colDefCols.tree,r=this.columnFactory.createColumnTree(this.colDefs,!0,o,t);xe(this.context,this.colDefCols?.tree,r.columnTree);const i=r.columnTree,s=r.treeDept,l=Se(i),c={};l.forEach((e=>c[e.getId()]=e)),this.colDefCols={tree:i,treeDepth:s,list:l,map:c},this.funcColsService.extractCols(t,n),this.ready=!0,this.refreshCols();e&&!this.showingPivotResult&&!this.gos.get("maintainColumnOrder")&&this.orderColsLikeColDefCols(),this.visibleColsService.refresh(t),this.columnViewportService.checkViewportColumns(),this.eventDispatcher.everythingChanged(t),a&&(this.changeEventsDispatching=!0,a(),this.changeEventsDispatching=!1),this.eventDispatcher.newColumnsLoaded(t),"gridInitializing"===t&&this.columnSizeService.applyAutosizeStrategy()}refreshCols(){if(!this.colDefCols)return;const e=this.cols?.tree;this.saveColOrder(),this.selectCols(),this.createAutoCols(),this.addAutoCols(),this.restoreColOrder(),this.positionLockedCols(),this.showRowGroupColsService?.refresh(),this.quickFilterService?.refreshQuickFilterCols(),this.setColSpanActive(),this.setAutoHeightActive(),this.visibleColsService.clear(),this.columnViewportService.clear();!h(e,this.cols.tree)&&this.eventDispatcher.gridColumns()}selectCols(){const e=this.pivotResultColsService.getPivotResultCols();if(this.showingPivotResult=null!=e,e){const{map:t,list:a,tree:n,treeDepth:o}=e;this.cols={list:a.slice(),map:{...t},tree:n.slice(),treeDepth:o};e.list.some((e=>void 0!==this.cols?.m';
      S = S + 'ap[e.getColId()]))||(this.lastPivotOrder=null)}else{const{map:e,list:t,tree:a,treeDepth:n}=this.colDefCols;this.cols={list:t.slice(),map:{...e},tree:a.slice(),treeDepth:n}}}getColsToShow(){const e=this.isPivotMode()&&!this.isShowingPivotResult(),t=this.funcColsService.getValueColumns();return this.cols.list.filter((a=>{const n=Re(a);if(e){const e=t&&w(t,a);return n||e}return n||a.isVisible()}))}addAutoCols(){var e;null!=this.autoCols&&(this.cols.list=this.autoCols.list.concat(this.cols.list),this.cols.tree=this.autoCols.tree.concat(this.cols.tree),(e=this.cols).map={},e.list.forEach((t=>e.map[t.getId()]=t)))}createAutoCols(){const e=this.gos.isGroupUseEntireRow(this.pivotMode),t=this.pivotMode?this.gos.get("pivotSuppressAutoColumn"):this.isSuppressAutoCol(),a=this.funcColsService.getRowGroupColumns(),n=()=>{this.autoCols&&(xe(this.context,this.autoCols.tree),this.autoCols=null)};if(!(a.length>0||this.gos.get("treeData"))||t||e||!this.autoColService)return void n();const o=this.autoColService.createAutoCols(a)??[],r=(i=o,s=this.autoCols?.list||null,h(i,s,((e,t)=>e.getColId()===t.getColId())));var i,s;const l=this.cols.treeDepth,c=this.autoCols?this.autoCols.treeDepth:-1;if(r&&c==l)return;n();const[g,d]=this.columnFactory.createForAutoGroups(o,this.cols?.tree);this.autoCols={list:o,tree:g,treeDepth:d,map:{}};const u=e=>{if(!e)return null;const t=e.filter((e=>!Re(e)));return[...o,...t]};this.lastOrder=u(this.lastOrder),this.lastPivotOrder=u(this.lastPivotOrder)}refreshAll(e){this.isReady()&&(this.refreshCols(),this.visibleColsService.refresh(e))}setColsVisible(e,t=!1,a){this.columnApplyStateService.applyColumnState({state:e.map((e=>({colId:"string"==typeof e?e:e.getColId(),hide:!t})))},a)}setColsPinned(e,t,a){if(!this.cols)return;if(N(e))return;if(this.gos.isDomLayout("print"))return void ce("Changing the column pinning status is not allowed with domLayout=\'print\'");let n;this.columnAnimationService.start(),n=!0===t||"left"===t?"left":"right"===t?"right":null;const o=[';
      S = S + '];e.forEach((e=>{if(!e)return;const t=this.getCol(e);t&&t.getPinned()!==n&&(t.setPinned(n),o.push(t))})),o.length&&(this.visibleColsService.refresh(a),this.eventDispatcher.columnPinned(o,a)),this.columnAnimationService.finish()}setColumnGroupOpened(e,t,a){let n;n=ne(e)?e.getId():e||"",this.columnGroupStateService.setColumnGroupState([{groupId:n,open:t}],a)}getProvidedColGroup(e){let t=null;return Me(null,this.cols?.tree,(a=>{ne(a)&&a.getId()===e&&(t=a)})),t}isColGroupLocked(e){const t=this.gos.get("groupLockGroupColumns");if(!e.isRowGroupActive()||0===t)return!1;if(-1===t)return!0;return t>this.funcColsService.getRowGroupColumns().findIndex((t=>t.getColId()===e.getColId()))}isSuppressAutoCol(){if("custom"===this.gos.get("groupDisplayType"))return!0;return"custom"===this.gos.get("treeDataDisplayType")}setAutoHeightActive(){if(this.autoHeightActive=this.cols.list.some((e=>e.isAutoHeight())),this.autoHeightActive){this.autoHeightActiveAtLeastOnce=!0;this.gos.isRowModelType("clientSide")||this.gos.isRowModelType("serverSide")||ce("autoHeight columns only work with Client Side Row Model and Server Side Row Model.")}}restoreColOrder(){const e=this.showingPivotResult?this.lastPivotOrder:this.lastOrder;if(!e)return;const t=new Map(e.map(((e,t)=>[e,t])));if(!this.cols.list.some((e=>t.has(e))))return;const a=new Map(this.cols.list.map((e=>[e,!0]))),n=e.filter((e=>a.has(e))),o=new Map(n.map((e=>[e,!0]))),r=this.cols.list.filter((e=>!o.has(e))),i=n.slice();r.forEach((e=>{let t=e.getOriginalParent();if(!t)return void i.push(e);const a=[];for(;!a.length&&t;){t.getLeafColumns().forEach((e=>{const t=i.indexOf(e)>=0,n=a.indexOf(e)<0;t&&n&&a.push(e)})),t=t.getOriginalParent()}if(!a.length)return void i.push(e);const n=a.map((e=>i.indexOf(e))),o=Math.max(...n);v(i,e,o+1)})),this.cols.list=i}orderColsLikeColDefCols(){if(!this.colDefCols||!this.cols)return;const e=this.colDefCols.list.filter((e=>this.cols.list.indexOf(e)>=0)),t=this.cols.list.filter((t=>e.indexOf(t)<0));this.cols.list=[';
      S = S + '...t,...e],this.cols.list=this.columnMoveService.placeLockedColumns(this.cols.list)}sortColsLikeKeys(e){if(null==this.cols)return;let t=[];const a={};e.forEach((e=>{if(a[e])return;const n=this.cols.map[e];n&&(t.push(n),a[e]=!0)}));let n=0;this.cols.list.forEach((e=>{const o=e.getColId();if(null!=a[o])return;o.startsWith(ye)?v(t,e,n++):t.push(e)})),t=this.columnMoveService.placeLockedColumns(t),this.columnMoveService.doesMovePassMarryChildren(t)?this.cols.list=t:ce("Applying column order broke a group where columns should be married together. Applying new order has been discarded.")}sortColsLikeCols(e){if(!e||e.length<=1)return;e.filter((e=>this.cols.list.indexOf(e)<0)).length>0||e.sort(((e,t)=>this.cols.list.indexOf(e)-this.cols.list.indexOf(t)))}resetColDefIntoCol(e,t){const a=e.getUserProvidedColDef();if(!a)return!1;const n=this.columnFactory.addColumnDefaultAndTypes(a,e.getColId());return e.setColDef(n,a,t),!0}queueResizeOperations(){this.shouldQueueResizeOperations=!0}isShouldQueueResizeOperations(){return this.shouldQueueResizeOperations}processResizeOperations(){this.shouldQueueResizeOperations=!1,this.resizeOperationQueue.forEach((e=>e())),this.resizeOperationQueue=[]}pushResizeOperation(e){this.resizeOperationQueue.push(e)}moveInCols(e,t,a){C(this.cols?.list,e,t),this.visibleColsService.refresh(a)}positionLockedCols(){this.cols.list=this.columnMoveService.placeLockedColumns(this.cols.list)}saveColOrder(){this.showingPivotResult?this.lastPivotOrder=this.cols?.list:this.lastOrder=this.cols?.list}getColumnDefs(){if(!this.colDefCols)return;const e=this.colDefCols.list.slice();this.showingPivotResult?e.sort(((e,t)=>this.lastOrder.indexOf(e)-this.lastOrder.indexOf(t))):this.lastOrder&&e.sort(((e,t)=>this.cols.list.indexOf(e)-this.cols.list.indexOf(t)));const t=this.funcColsService.getRowGroupColumns(),a=this.funcColsService.getPivotColumns();return this.columnDefFactory.buildColumnDefs(e,t,a)}isShowingPivotResult(){return this.showingPivotResult}isChangeEventsDisp';
      S = S + 'atching(){return this.changeEventsDispatching}isColSpanActive(){return this.colSpanActive}isProvidedColGroupsPresent(){return this.colDefCols?.treeDepth>0}setColSpanActive(){this.colSpanActive=this.cols.list.some((e=>null!=e.getColDef().colSpan))}isAutoRowHeightActive(){return this.autoHeightActive}wasAutoRowHeightEverActive(){return this.autoHeightActiveAtLeastOnce}getHeaderRowCount(){return this.cols?this.cols.treeDepth+1:-1}isReady(){return this.ready}isPivotMode(){return this.pivotMode}setPivotMode(e,t){e!==this.pivotMode&&this.isPivotSettingAllowed(this.pivotMode)&&(this.pivotMode=e,this.ready&&(this.refreshCols(),this.visibleColsService.refresh(t),this.eventDispatcher.pivotModeChanged()))}isPivotSettingAllowed(e){return!e||!this.gos.get("treeData")||(ce("Pivot mode not available with treeData."),!1)}isPivotActive(){const e=this.funcColsService.getPivotColumns();return this.pivotMode&&!N(e)}recreateColumnDefs(e){this.cols&&(this.autoCols&&this.autoColService.updateAutoCols(this.autoCols.list,e),this.createColsFromColDefs(!0,e))}setColumnDefs(e,t){const a=!!this.colDefs;this.colDefs=e,this.createColsFromColDefs(a,t)}destroy(){xe(this.context,this.colDefCols?.tree),xe(this.context,this.autoCols?.tree),super.destroy()}getColTree(){return this.cols.tree}getColDefColTree(){return this.colDefCols.tree}getColDefCols(){return this.colDefCols?.list?this.colDefCols.list:null}getCols(){return this.cols?.list??[]}getAllCols(){const e=this.pivotResultColsService.getPivotResultCols(),t=e?.list;return[].concat(this.colDefCols?.list||[],this.autoCols?.list||[],t||[])}getColsForKeys(e){if(!e)return[];return e.map((e=>this.getCol(e))).filter((e=>null!=e))}getColDefCol(e){return this.colDefCols?.list?this.getColFromCollection(e,this.colDefCols):null}getCol(e){return null==e?null:this.getColFromCollection(e,this.cols)}getColFromCollection(e,t){if(null==t)return null;const{map:a,list:n}=t;if("string"==typeof e&&a[e])return a[e];for(let t=0;t<n.length;t++)if(Pe(n[t],e))return n[t];r';
      S = S + 'eturn this.getAutoCol(e)}getAutoCol(e){return null==this.autoCols?null:this.autoCols.list.find((t=>Pe(t,e)))||null}getAutoCols(){return this.autoCols?.list||null}setColHeaderHeight(e,t){e.setAutoHeaderHeight(t)&&this.eventDispatcher.headerHeight(e)}getColumnGroupHeaderRowHeight(){return this.isPivotMode()?this.getPivotGroupHeaderHeight():this.getGroupHeaderHeight()}getColumnHeaderRowHeight(){const e=this.isPivotMode()?this.getPivotHeaderHeight():this.getHeaderHeight(),t=this.visibleColsService.getAllCols().filter((e=>e.isAutoHeaderHeight())).map((e=>e.getAutoHeaderHeight()||0));return Math.max(e,...t)}getHeaderHeight(){return this.gos.get("headerHeight")??this.environment.getDefaultHeaderHeight()}getFloatingFiltersHeight(){return this.gos.get("floatingFiltersHeight")??this.getHeaderHeight()}getGroupHeaderHeight(){return this.gos.get("groupHeaderHeight")??this.getHeaderHeight()}getPivotHeaderHeight(){return this.gos.get("pivotHeaderHeight")??this.getHeaderHeight()}getPivotGroupHeaderHeight(){return this.gos.get("pivotGroupHeaderHeight")??this.getGroupHeaderHeight()}onFirstDataRendered(){const e=this.gos.get("autoSizeStrategy");if("fitCellContents"!==e?.type)return;const{colIds:t,skipHeader:a}=e;setTimeout((()=>{t?this.columnAutosizeService.autoSizeCols({colKeys:t,skipHeader:a,source:"autosizeColumns"}):this.columnAutosizeService.autoSizeAllColumns("autosizeColumns",a)}))}onAutoGroupColumnDefChanged(e){this.autoCols&&this.autoColService.updateAutoCols(this.autoCols.list,e)}};function Ee(e){return"gridOptionsUpdated"===e?"gridOptionsChanged":e}function Pe(e,t){const a=e===t,n=e.getColDef()===t,o=e.getColId()==t;return a||n||o}var Ae=class extends A{constructor(){super(...arguments),this.beanName="columnAutosizeService",this.timesDelayed=0}wireBeans(e){this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.animationFrameService=e.animationFrameService,this.autoWidthCalculator=e.autoWidthCalculator,this.eventDispatcher=e.columnEventDispatcher,th';
      S = S + 'is.ctrlsService=e.ctrlsService,this.renderStatusService=e.renderStatusService}autoSizeCols(e){if(this.columnModel.isShouldQueueResizeOperations())return void this.columnModel.pushResizeOperation((()=>this.autoSizeCols(e)));const{colKeys:t,skipHeader:a,skipHeaderGroups:n,stopAtGroup:o,source:r="api"}=e;if(this.animationFrameService.flushAllFrames(),this.timesDelayed<5&&this.renderStatusService&&!this.renderStatusService.areHeaderCellsRendered())return this.timesDelayed++,void setTimeout((()=>this.autoSizeCols(e)));this.timesDelayed=0;const i=[];let s=-1;const l=null!=a?a:this.gos.get("skipHeaderOnAutoSize"),c=null!=n?n:l;for(;0!==s;){s=0;const e=[];t.forEach((t=>{if(!t)return;const a=this.columnModel.getCol(t);if(!a)return;if(i.indexOf(a)>=0)return;const n=this.autoWidthCalculator.getPreferredWidthForColumn(a,l);if(n>0){const e=this.normaliseColumnWidth(a,n);a.setActualWidth(e,r),i.push(a),s++}e.push(a)})),e.length&&this.visibleColsService.refresh(r)}c||this.autoSizeColumnGroupsByColumns(t,r,o),this.eventDispatcher.columnResized(i,!0,"autosizeColumns")}autoSizeColumn(e,t,a){e&&this.autoSizeCols({colKeys:[e],skipHeader:a,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,a){const n=new Set;let o;this.columnModel.getColsForKeys(e).forEach((e=>{let t=e.getParent();for(;t&&t!=a;)t.isPadding()||n.add(t),t=t.getParent()}));for(const e of n){for(const t of this.ctrlsService.getHeaderRowContainerCtrls())if(o=t.getHeaderCtrlForColumn(e),o)break;o&&o.resizeLeafColumnsToFit(t)}return[]}autoSizeAllColumns(e,t){if(this.columnModel.isShouldQueueResizeOperations())return void this.columnModel.pushResizeOperation((()=>this.autoSizeAllColumns(e,t)));const a=this.visibleColsService.getAllCols();this.autoSizeCols({colKeys:a,skipHeader:t,source:e})}normaliseColumnWidth(e,t){const a=e.getMinWidth();t<a&&(t=a);const n=e.getMaxWidth();return e.isGreaterThanMax(t)&&(t=n),t}},Te=class extends A{constructor(){super(...arguments),this.beanName="funcColsService",this.rowGroupCols=';
      S = S + '[],this.valueCols=[],this.pivotCols=[]}wireBeans(e){this.columnModel=e.columnModel,this.eventDispatcher=e.columnEventDispatcher,this.aggFuncService=e.aggFuncService,this.visibleColsService=e.visibleColsService}getModifyColumnsNoEventsCallbacks(){return{addGroupCol:e=>this.rowGroupCols.push(e),removeGroupCol:e=>f(this.rowGroupCols,e),addPivotCol:e=>this.pivotCols.push(e),removePivotCol:e=>f(this.pivotCols,e),addValueCol:e=>this.valueCols.push(e),removeValueCol:e=>f(this.valueCols,e)}}getSourceColumnsForGroupColumn(e){const t=e.getColDef().showRowGroup;if(!t)return null;if(!0===t)return this.rowGroupCols.slice(0);const a=this.columnModel.getColDefCol(t);return a?[a]:null}sortRowGroupColumns(e){this.rowGroupCols.sort(e)}sortPivotColumns(e){this.pivotCols.sort(e)}getValueColumns(){return this.valueCols?this.valueCols:[]}getPivotColumns(){return this.pivotCols?this.pivotCols:[]}getRowGroupColumns(){return this.rowGroupCols?this.rowGroupCols:[]}isRowGroupEmpty(){return N(this.rowGroupCols)}setColumnAggFunc(e,t,a){if(!e)return;const n=this.columnModel.getColDefCol(e);n&&(n.setAggFunc(t),this.eventDispatcher.columnChanged("columnValueChanged",[n],a))}setRowGroupColumns(e,t){this.setColList(e,this.rowGroupCols,"columnRowGroupChanged",!0,!0,((e,a)=>this.setRowGroupActive(e,a,t)),t)}setRowGroupActive(e,t,a){e!==t.isRowGroupActive()&&(t.setRowGroupActive(e,a),e&&!this.gos.get("suppressRowGroupHidesColumns")&&this.columnModel.setColsVisible([t],!1,a),e||this.gos.get("suppressMakeColumnVisibleAfterUnGroup")||this.columnModel.setColsVisible([t],!0,a))}addRowGroupColumns(e,t){this.updateColList(e,this.rowGroupCols,!0,!0,(e=>this.setRowGroupActive(!0,e,t)),"columnRowGroupChanged",t)}removeRowGroupColumns(e,t){this.updateColList(e,this.rowGroupCols,!1,!0,(e=>this.setRowGroupActive(!1,e,t)),"columnRowGroupChanged",t)}addPivotColumns(e,t){this.updateColList(e,this.pivotCols,!0,!1,(e=>e.setPivotActive(!0,t)),"columnPivotChanged",t)}setPivotColumns(e,t){this.setColList(e,this.pivotCols,"';
      S = S + 'columnPivotChanged",!0,!1,((e,a)=>{a.setPivotActive(e,t)}),t)}removePivotColumns(e,t){this.updateColList(e,this.pivotCols,!1,!1,(e=>e.setPivotActive(!1,t)),"columnPivotChanged",t)}setValueColumns(e,t){this.setColList(e,this.valueCols,"columnValueChanged",!1,!1,((e,a)=>this.setValueActive(e,a,t)),t)}setValueActive(e,t,a){if(e!==t.isValueActive()&&(t.setValueActive(e,a),e&&!t.getAggFunc()&&this.aggFuncService)){const e=this.aggFuncService.getDefaultAggFunc(t);t.setAggFunc(e)}}addValueColumns(e,t){this.updateColList(e,this.valueCols,!0,!1,(e=>this.setValueActive(!0,e,t)),"columnValueChanged",t)}removeValueColumns(e,t){this.updateColList(e,this.valueCols,!1,!1,(e=>this.setValueActive(!1,e,t)),"columnValueChanged",t)}moveRowGroupColumn(e,t,a){if(this.isRowGroupEmpty())return;const n=this.rowGroupCols[e],o=this.rowGroupCols.slice(e,t);this.rowGroupCols.splice(e,1),this.rowGroupCols.splice(t,0,n),this.eventDispatcher.rowGroupChanged(o,a)}setColList(e,t,a,n,o,r,i){if(N(this.columnModel.getCols()))return;const s=new Map;t.forEach(((e,t)=>s.set(e,t))),t.length=0,L(e)&&e.forEach((e=>{const a=this.columnModel.getColDefCol(e);a&&t.push(a)})),t.forEach(((e,t)=>{const a=s.get(e);void 0!==a?n&&a!==t||s.delete(e):s.set(e,0)}));(this.columnModel.getColDefCols()||[]).forEach((e=>{const a=t.indexOf(e)>=0;r(a,e)})),o&&this.columnModel.refreshCols(),this.visibleColsService.refresh(i),this.eventDispatcher.columnChanged(a,[...s.keys()],i)}updateColList(e,t,a,n,o,r,i){if(!e||N(e))return;let s=!1;e.forEach((e=>{if(!e)return;const n=this.columnModel.getColDefCol(e);if(n){if(a){if(t.indexOf(n)>=0)return;t.push(n)}else{if(t.indexOf(n)<0)return;f(t,n)}o(n),s=!0}})),s&&(n&&this.columnModel.refreshCols(),this.visibleColsService.refresh(i),this.eventDispatcher.genericColumnEvent(r,t,i))}extractCols(e,t){this.extractRowGroupCols(e,t),this.extractPivotCols(e,t),this.extractValueCols(e,t)}extractValueCols(e,t){this.valueCols=this.extractColsCommon(t,this.valueCols,((t,a)=>t.setValueActive(a,e)),(()=>{';
      S = S + '}),(()=>{}),(e=>{const t=e.aggFunc;return null===t||""===t?null:void 0!==t?!!t:void 0}),(e=>null!=e.initialAggFunc&&""!=e.initialAggFunc)),this.valueCols.forEach((e=>{const t=e.getColDef();null!=t.aggFunc&&""!=t.aggFunc?e.setAggFunc(t.aggFunc):e.getAggFunc()||e.setAggFunc(t.initialAggFunc)}))}extractRowGroupCols(e,t){this.rowGroupCols=this.extractColsCommon(t,this.rowGroupCols,((t,a)=>t.setRowGroupActive(a,e)),(e=>e.rowGroupIndex),(e=>e.initialRowGroupIndex),(e=>e.rowGroup),(e=>e.initialRowGroup))}extractPivotCols(e,t){this.pivotCols=this.extractColsCommon(t,this.pivotCols,((t,a)=>t.setPivotActive(a,e)),(e=>e.pivotIndex),(e=>e.initialPivotIndex),(e=>e.pivot),(e=>e.initialPivot))}extractColsCommon(e=[],t=[],a,n,o,r,i){const s=[],l=[];(this.columnModel.getColDefCols()||[]).forEach((a=>{const c=e.indexOf(a)<0,g=a.getColDef(),d=B(r(g)),h=B(i(g)),u=q(n(g)),p=q(o(g));let m;if(m=void 0!==d?d:void 0!==u?null!==u&&u>=0:c?void 0!==h?h:!!(void 0!==p)&&(null!=p&&p>=0):t.indexOf(a)>=0,m){(c?null!=u||null!=p:null!=u)?s.push(a):l.push(a)}}));const c=e=>{const t=n(e.getColDef()),a=o(e.getColDef());return null!=t?t:a};s.sort(((e,t)=>{const a=c(e),n=c(t);return a===n?0:a<n?-1:1}));const g=[].concat(s);return t.forEach((e=>{l.indexOf(e)>=0&&g.push(e)})),l.forEach((e=>{g.indexOf(e)<0&&g.push(e)})),t.forEach((e=>{g.indexOf(e)<0&&a(e,!1)})),g.forEach((e=>{t.indexOf(e)<0&&a(e,!0)})),g}generateColumnStateForRowGroupAndPivotIndexes(e,t){const a={},n=(e,t,n,o,r,i)=>{const s=this.columnModel.getColDefCols();if(!t.length||!s)return[];const l=Object.keys(e),c=new Set(l),g=new Set(l),d=new Set(t.map((e=>{const t=e.getColId();return g.delete(t),t})).concat(l)),h=[],u={};let p=0;for(let e=0;e<s.length;e++){const t=s[e].getColId();d.has(t)&&(h.push(t),u[t]=p++)}let m=1e3,f=!1,v=0;const b=t=>{const a=u[t];for(let t=v;t<a;t++){const a=h[t];g.has(a)&&(e[a][r]=m++,g.delete(a))}v=a};t.forEach((t=>{const s=t.getColId();if(c.has(s))b(s),e[s][r]=m++;else{const l=t.getColDef();if(null===l[r]||void 0===l[r]&';
      S = S + '&null==l[i]){if(!f){l[n]||void 0===l[n]&&l[o]?b(s):(g.forEach((t=>{e[t][r]=m+u[t]})),m+=h.length,f=!0)}a[s]||(a[s]={colId:s}),a[s][r]=m++}}}))};return n(e,this.rowGroupCols,"rowGroup","initialRowGroup","rowGroupIndex","initialRowGroupIndex"),n(t,this.pivotCols,"pivot","initialPivot","pivotIndex","initialPivotIndex"),Object.values(a)}},Ie=class extends A{constructor(){super(...arguments),this.beanName="columnApplyStateService"}wireBeans(e){this.columnModel=e.columnModel,this.eventDispatcher=e.columnEventDispatcher,this.sortController=e.sortController,this.columnGetStateService=e.columnGetStateService,this.funcColsService=e.funcColsService,this.visibleColsService=e.visibleColsService,this.columnAnimationService=e.columnAnimationService,this.pivotResultColsService=e.pivotResultColsService}applyColumnState(e,t){const a=this.columnModel.getColDefCols()||[];if(N(a))return!1;if(e&&e.state&&!e.state.forEach)return ce("applyColumnState() - the state attribute should be an array, however an array was not found. Please provide an array of items (one for each col you want to change) for state."),!1;const n=this.funcColsService.getModifyColumnsNoEventsCallbacks(),o=(a,o,r)=>{const i=this.compareColumnStatesAndDispatchEvents(t),s=o.slice(),l={},c={},g=[],d=[];let h=0;const u=this.funcColsService.getRowGroupColumns().slice(),p=this.funcColsService.getPivotColumns().slice();a.forEach((a=>{const o=a.colId||"";if(o.startsWith(ye))return g.push(a),void d.push(a);const i=r(o);i?(this.syncColumnWithStateItem(i,a,e.defaultState,l,c,!1,t,n),f(s,i)):(d.push(a),h+=1)}));const m=a=>this.syncColumnWithStateItem(a,null,e.defaultState,l,c,!1,t,n);s.forEach(m),this.funcColsService.sortRowGroupColumns(Le.bind(this,l,u)),this.funcColsService.sortPivotColumns(Le.bind(this,c,p)),this.columnModel.refreshCols();const v=(this.columnModel.getAutoCols()||[]).slice();return g.forEach((a=>{const o=this.columnModel.getAutoCol(a.colId);f(v,o),this.syncColumnWithStateItem(o,a,e.defaultState,null,null,!0,t,n)}';
      S = S + ')),v.forEach(m),this.orderLiveColsLikeState(e),this.visibleColsService.refresh(t),this.eventDispatcher.everythingChanged(t),i(),{unmatchedAndAutoStates:d,unmatchedCount:h}};this.columnAnimationService.start();let{unmatchedAndAutoStates:r,unmatchedCount:i}=o(e.state||[],a,(e=>this.columnModel.getColDefCol(e)));if(r.length>0||L(e.defaultState)){const e=this.pivotResultColsService.getPivotResultCols(),t=e?.list;i=o(r,t||[],(e=>this.pivotResultColsService.getPivotResultCol(e))).unmatchedCount}return this.columnAnimationService.finish(),0===i}resetColumnState(e){if(N(this.columnModel.getColDefCols()))return;const t=Se(this.columnModel.getColDefColTree()),a=[];let n=1e3,o=1e3,r=[];const i=this.columnModel.getAutoCols();i&&(r=r.concat(i)),t&&(r=r.concat(t)),r.forEach((e=>{const t=this.getColumnStateFromColDef(e);O(t.rowGroupIndex)&&t.rowGroup&&(t.rowGroupIndex=n++),O(t.pivotIndex)&&t.pivot&&(t.pivotIndex=o++),a.push(t)})),this.applyColumnState({state:a,applyOrder:!0},e)}getColumnStateFromColDef(e){const t=(e,t)=>null!=e?e:null!=t?t:null,a=e.getColDef(),n=t(a.sort,a.initialSort),o=t(a.sortIndex,a.initialSortIndex),r=t(a.hide,a.initialHide),i=t(a.pinned,a.initialPinned),s=t(a.width,a.initialWidth),l=t(a.flex,a.initialFlex);let c=t(a.rowGroupIndex,a.initialRowGroupIndex),g=t(a.rowGroup,a.initialRowGroup);null!=c||null!=g&&0!=g||(c=null,g=null);let d=t(a.pivotIndex,a.initialPivotIndex),h=t(a.pivot,a.initialPivot);null!=d||null!=h&&0!=h||(d=null,h=null);const u=t(a.aggFunc,a.initialAggFunc);return{colId:e.getColId(),sort:n,sortIndex:o,hide:r,pinned:i,width:s,flex:l,rowGroup:g,rowGroupIndex:c,pivot:h,pivotIndex:d,aggFunc:u}}syncColumnWithStateItem(e,t,a,n,o,r,i,s){if(!e)return;const l=(e,n)=>{const o={value1:void 0,value2:void 0};let r=!1;return t&&(void 0!==t[e]&&(o.value1=t[e],r=!0),L(n)&&void 0!==t[n]&&(o.value2=t[n],r=!0)),!r&&a&&(void 0!==a[e]&&(o.value1=a[e]),L(n)&&void 0!==a[n]&&(o.value2=a[n])),o},c=l("hide").value1;void 0!==c&&e.setVisible(!c,i);const g=l("pinned").valu';
      S = S + 'e1;void 0!==g&&e.setPinned(g);const d=e.getColDef().minWidth??20,h=l("flex").value1;if(void 0!==h&&e.setFlex(h),null==h){const t=l("width").value1;null!=t&&null!=d&&t>=d&&e.setActualWidth(t,i)}const u=l("sort").value1;void 0!==u&&("desc"===u||"asc"===u?e.setSort(u,i):e.setSort(void 0,i));const p=l("sortIndex").value1;if(void 0!==p&&e.setSortIndex(p),r||!e.isPrimary())return;const m=l("aggFunc").value1;void 0!==m&&("string"==typeof m?(e.setAggFunc(m),e.isValueActive()||(e.setValueActive(!0,i),s.addValueCol(e))):(L(m)&&ce("stateItem.aggFunc must be a string. if using your own aggregation functions, register the functions first before using them in get/set state. This is because it is intended for the column state to be stored and retrieved as simple JSON."),e.isValueActive()&&(e.setValueActive(!1,i),s.removeValueCol(e))));const{value1:f,value2:v}=l("rowGroup","rowGroupIndex");void 0===f&&void 0===v||("number"==typeof v||f?(e.isRowGroupActive()||(e.setRowGroupActive(!0,i),s.addGroupCol(e)),n&&"number"==typeof v&&(n[e.getId()]=v)):e.isRowGroupActive()&&(e.setRowGroupActive(!1,i),s.removeGroupCol(e)));const{value1:b,value2:C}=l("pivot","pivotIndex");void 0===b&&void 0===C||("number"==typeof C||b?(e.isPivotActive()||(e.setPivotActive(!0,i),s.addPivotCol(e)),o&&"number"==typeof C&&(o[e.getId()]=C)):e.isPivotActive()&&(e.setPivotActive(!1,i),s.removePivotCol(e)))}orderLiveColsLikeState(e){if(!e.applyOrder||!e.state)return;const t=[];e.state.forEach((e=>{null!=e.colId&&t.push(e.colId)})),this.columnModel.sortColsLikeKeys(t)}compareColumnStatesAndDispatchEvents(e){const t={rowGroupColumns:this.funcColsService.getRowGroupColumns().slice(),pivotColumns:this.funcColsService.getPivotColumns().slice(),valueColumns:this.funcColsService.getValueColumns().slice()},a=this.columnGetStateService.getColumnState(),n={};return a.forEach((e=>{n[e.colId]=e})),()=>{const o=this.columnModel.getAllCols(),r=(t,a,n,o)=>{if(h(a.map(o),n.map(o)))return;const r=new Set(a);n.forEach((e=>{r.delete(e)|';
      S = S + '|r.add(e)}));const i=[...r],s={type:t,columns:i,column:1===i.length?i[0]:null,source:e};this.eventService.dispatchEvent(s)},i=e=>{const t=[];return o.forEach((a=>{const o=n[a.getColId()];o&&e(o,a)&&t.push(a)})),t},s=e=>e.getColId();r("columnRowGroupChanged",t.rowGroupColumns,this.funcColsService.getRowGroupColumns(),s),r("columnPivotChanged",t.pivotColumns,this.funcColsService.getPivotColumns(),s);const l=i(((e,t)=>{const a=null!=e.aggFunc,n=a!=t.isValueActive(),o=a&&e.aggFunc!=t.getAggFunc();return n||o}));l.length>0&&this.eventDispatcher.columnChanged("columnValueChanged",l,e);this.eventDispatcher.columnResized(i(((e,t)=>e.width!=t.getActualWidth())),!0,e);this.eventDispatcher.columnPinned(i(((e,t)=>e.pinned!=t.getPinned())),e);this.eventDispatcher.columnVisible(i(((e,t)=>e.hide==t.isVisible())),e);const c=i(((e,t)=>e.sort!=t.getSort()||e.sortIndex!=t.getSortIndex()));c.length>0&&this.sortController.dispatchSortChangedEvents(e,c),this.normaliseColumnMovedEventForColumnState(a,e)}}normaliseColumnMovedEventForColumnState(e,t){const a=this.columnGetStateService.getColumnState(),n={};a.forEach((e=>n[e.colId]=e));const o={};e.forEach((e=>{n[e.colId]&&(o[e.colId]=!0)}));const r=e.filter((e=>o[e.colId])),i=a.filter((e=>o[e.colId])),s=[];i.forEach(((e,t)=>{const a=r&&r[t];if(a&&a.colId!==e.colId){const e=this.columnModel.getCol(a.colId);e&&s.push(e)}})),s.length&&this.eventDispatcher.columnMoved({movedColumns:s,source:t,finished:!0})}},Le=(e,t,a,n)=>{const o=e[a.getId()],r=e[n.getId()],i=null!=o,s=null!=r;if(i&&s)return o-r;if(i)return-1;if(s)return 1;const l=t.indexOf(a),c=t.indexOf(n),g=l>=0;return g&&c>=0?l-c:g?-1:1},Oe=class extends A{constructor(){super(...arguments),this.beanName="columnMoveService"}wireBeans(e){this.columnModel=e.columnModel,this.columnAnimationService=e.columnAnimationService,this.eventDispatcher=e.columnEventDispatcher}moveColumnByIndex(e,t,a){const n=this.columnModel.getCols();if(!n)return;const o=n[e];this.moveColumns([o],t,a)}moveColumns(e,t,a';
      S = S + ',n=!0){const o=this.columnModel.getCols();if(!o)return;if(this.columnAnimationService.start(),t>o.length-e.length)return ce("tried to insert columns in invalid location, toIndex = ",t),void ce("remember that you should not count the moving columns when calculating the new index");const r=this.columnModel.getColsForKeys(e);!this.doesMovePassRules(r,t)||(this.columnModel.moveInCols(r,t,a),this.eventDispatcher.columnMoved({movedColumns:r,source:a,toIndex:t,finished:n}),this.columnAnimationService.finish())}doesMovePassRules(e,t){const a=this.getProposedColumnOrder(e,t);return this.doesOrderPassRules(a)}doesOrderPassRules(e){return!!this.doesMovePassMarryChildren(e)&&!!this.doesMovePassLockedPositions(e)}getProposedColumnOrder(e,t){const a=this.columnModel.getCols().slice();return C(a,e,t),a}doesMovePassLockedPositions(e){let t=0,a=!0;return e.forEach((e=>{const n=(o=e.getColDef().lockPosition)?!0===o||"left"===o?0:2:1;var o;n<t&&(a=!1),t=n})),a}doesMovePassMarryChildren(e){let t=!0;return Me(null,this.columnModel.getColTree(),(a=>{if(!ne(a))return;const n=a,o=n.getColGroupDef();if(!(o&&o.marryChildren))return;const r=[];n.getLeafColumns().forEach((t=>{const a=e.indexOf(t);r.push(a)}));Math.max.apply(Math,r)-Math.min.apply(Math,r)>n.getLeafColumns().length-1&&(t=!1)})),t}placeLockedColumns(e){const t=[],a=[],n=[];e.forEach((e=>{const o=e.getColDef().lockPosition;"right"===o?n.push(e):"left"===o||!0===o?t.push(e):a.push(e)}));return this.gos.get("enableRtl")?[...n,...a,...t]:[...t,...a,...n]}},Ne=/[&<>"\']/g,Ge={"&":"&amp;","<":"&lt;",">":"&gt;",\'"\':"&quot;","\'":"&#39;"};function qe(e){const t=String.fromCharCode;function a(e,a){return t(e>>a&63|128)}function n(e){if(!(4294967168&e))return t(e);let n="";return 4294965248&e?4294901760&e?4292870144&e||(n=t(e>>18&7|240),n+=a(e,12),n+=a(e,6)):(!function(e){if(e>=55296&&e<=57343)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}(e),n=t(e>>12&15|224),n+=a(e,6)):n=t(e>>6&31|192),n+=t(63&e|128';
      S = S + '),n}const o=function(e){const t=[];if(!e)return[];const a=e.length;let n,o,r=0;for(;r<a;)n=e.charCodeAt(r++),n>=55296&&n<=56319&&r<a?(o=e.charCodeAt(r++),56320==(64512&o)?t.push(((1023&n)<<10)+(1023&o)+65536):(t.push(n),r--)):t.push(n);return t}(e),r=o.length;let i,s=-1,l="";for(;++s<r;)i=o[s],l+=n(i);return l}function Be(e){return e[0].toUpperCase()+e.substring(1).toLowerCase()}function He(e,t){if(null==e)return null;const a=e.toString().toString();return t?a:a.replace(Ne,(e=>Ge[e]))}var Ve=class extends A{constructor(){super(...arguments),this.beanName="columnNameService"}wireBeans(e){this.expressionService=e.expressionService,this.funcColsService=e.funcColsService,this.columnModel=e.columnModel}getDisplayNameForColumn(e,t,a=!1){if(!e)return null;const n=this.getHeaderName(e.getColDef(),e,null,null,t);return a?this.wrapHeaderNameWithAggFunc(e,n):n}getDisplayNameForProvidedColumnGroup(e,t,a){const n=t?t.getColGroupDef():null;return n?this.getHeaderName(n,null,e,t,a):null}getDisplayNameForColumnGroup(e,t){return this.getDisplayNameForProvidedColumnGroup(e,e.getProvidedColumnGroup(),t)}getHeaderName(e,t,a,n,o){const r=e.headerValueGetter;if(r){const i=this.gos.addGridCommonParams({colDef:e,column:t,columnGroup:a,providedColumnGroup:n,location:o});return"function"==typeof r?r(i):"string"==typeof r?this.expressionService.evaluate(r,i):(ce("headerValueGetter must be a function or a string"),"")}return null!=e.headerName?e.headerName:e.field?(i=e.field)&&null!=i?i.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z])([a-z])/g,"$1 $2$3").replace(/\\./g," ").split(" ").map((e=>e.substring(0,1).toUpperCase()+(e.length>1?e.substring(1,e.length):""))).join(" "):null:"";var i}wrapHeaderNameWithAggFunc(e,t){if(this.gos.get("suppressAggFuncInHeader"))return t;const a=e.getColDef().pivotValueColumn;let n,o=null;if(L(a)){const r=this.funcColsService.getValueColumns(),i=this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&1===r.length,s=void 0!==e.getColDef().pivotTotalC';
      S = S + 'olumnIds;if(i&&!s)return t;o=a?a.getAggFunc():null,n=!0}else{const t=e.isValueActive(),a=this.columnModel.isPivotMode()||!this.funcColsService.isRowGroupEmpty();t&&a?(o=e.getAggFunc(),n=!0):n=!1}if(n){const e="string"==typeof o?o:"func";return`${this.localeService.getLocaleTextFunc()(e,e)}(${t})`}return t}},We=class extends A{constructor(){super(...arguments),this.beanName="pivotResultColsService"}wireBeans(e){this.context=e.context,this.columnModel=e.columnModel,this.columnFactory=e.columnFactory,this.visibleColsService=e.visibleColsService}destroy(){xe(this.context,this.pivotResultCols?.tree),super.destroy()}isPivotResultColsPresent(){return null!=this.pivotResultCols}lookupPivotResultCol(e,t){if(null==this.pivotResultCols)return null;const a=this.columnModel.getColDefCol(t);let n=null;return this.pivotResultCols.list.forEach((t=>{const o=t.getColDef().pivotKeys,r=t.getColDef().pivotValueColumn;h(o,e)&&r===a&&(n=t)})),n}getPivotResultCols(){return this.pivotResultCols}getPivotResultCol(e){return this.pivotResultCols?this.columnModel.getColFromCollection(e,this.pivotResultCols):null}setPivotResultCols(e,t){if(this.columnModel.isReady()&&(null!=e||null!=this.pivotResultCols)){if(e){this.processPivotResultColDef(e);const a=this.columnFactory.createColumnTree(e,!1,this.pivotResultCols?.tree||this.previousPivotResultCols||void 0,t);xe(this.context,this.pivotResultCols?.tree,a.columnTree);const n=a.columnTree,o=a.treeDept,r=Se(n),i={};this.pivotResultCols={tree:n,treeDepth:o,list:r,map:i},this.pivotResultCols.list.forEach((e=>this.pivotResultCols.map[e.getId()]=e)),this.previousPivotResultCols=null}else this.previousPivotResultCols=this.pivotResultCols?this.pivotResultCols.tree:null,this.pivotResultCols=null;this.columnModel.refreshCols(),this.visibleColsService.refresh(t)}}processPivotResultColDef(e){const t=this.gos.get("processPivotResultColDef"),a=this.gos.get("processPivotResultColGroupDef");if(!t&&!a)return;const n=e=>{e.forEach((e=>{if(L(e.children)){const t=e;a&';
      S = S + '&a(t),n(t.children)}else{t&&t(e)}}))};e&&n(e)}},Ue=class extends A{constructor(){super(...arguments),this.beanName="columnSizeService"}wireBeans(e){this.columnModel=e.columnModel,this.columnViewportService=e.columnViewportService,this.eventDispatcher=e.columnEventDispatcher,this.visibleColsService=e.visibleColsService,this.ctrlsService=e.ctrlsService}setColumnWidths(e,t,a,n){const o=[];e.forEach((e=>{const a=this.columnModel.getColDefCol(e.key)||this.columnModel.getCol(e.key);if(!a)return;o.push({width:e.newWidth,ratios:[1],columns:[a]});if("shift"===this.gos.get("colResizeDefault")&&(t=!t),t){const t=this.visibleColsService.getColAfter(a);if(!t)return;const n=a.getActualWidth()-e.newWidth,r=t.getActualWidth()+n;o.push({width:r,ratios:[1],columns:[t]})}})),0!==o.length&&this.resizeColumnSets({resizeSets:o,finished:a,source:n})}resizeColumnSets(e){const{resizeSets:t,finished:a,source:n}=e;if(!(!t||t.every((e=>this.checkMinAndMaxWidthsForSet(e))))){if(a){const e=t&&t.length>0?t[0].columns:null;this.eventDispatcher.columnResized(e,a,n)}return}const o=[],r=[];t.forEach((e=>{const{width:t,columns:a,ratios:i}=e,s={},l={};a.forEach((e=>r.push(e)));let c=!0,g=0;for(;c;){if(g++,g>1e3){ge("infinite loop in resizeColumnSets");break}c=!1;const e=[];let n=0,o=t;a.forEach(((t,a)=>{if(l[t.getId()])o-=s[t.getId()];else{e.push(t);const o=i[a];n+=o}}));const r=1/n;e.forEach(((a,n)=>{let g;n===e.length-1?g=o:(g=Math.round(i[n]*t*r),o-=g);const d=a.getMinWidth(),h=a.getMaxWidth();g<d?(g=d,l[a.getId()]=!0,c=!0):h>0&&g>h&&(g=h,l[a.getId()]=!0,c=!0),s[a.getId()]=g}))}a.forEach((e=>{const t=s[e.getId()];e.getActualWidth()!==t&&(e.setActualWidth(t,n),o.push(e))}))}));const i=o.length>0;let s=[];i&&(s=this.refreshFlexedColumns({resizingCols:r,skipSetLeft:!0}),this.visibleColsService.setLeftValues(n),this.visibleColsService.updateBodyWidths(),this.columnViewportService.checkViewportColumns());const l=r.concat(s);(i||a)&&this.eventDispatcher.columnResized(l,a,n,s)}checkMinAndMaxWidthsForSet(e)';
      S = S + '{const{columns:t,width:a}=e;let n=0,o=0,r=!0;t.forEach((e=>{const t=e.getMinWidth();n+=t||0;const a=e.getMaxWidth();a>0?o+=a:r=!1}));return a>=n&&(!r||a<=o)}refreshFlexedColumns(e={}){const t=e.source?e.source:"flex";if(null!=e.viewportWidth&&(this.flexViewportWidth=e.viewportWidth),!this.flexViewportWidth)return[];const a=this.visibleColsService.getCenterCols();let n=-1;if(e.resizingCols){const t=new Set(e.resizingCols);for(let e=a.length-1;e>=0;e--)if(t.has(a[e])){n=e;break}}let o=0,r=[],i=0,s=0;for(let e=0;e<a.length;e++){a[e].getFlex()&&e>n?(r.push(a[e]),s+=a[e].getFlex(),i+=a[e].getMinWidth()):o+=a[e].getActualWidth()}if(!r.length)return[];let l=[];o+i>this.flexViewportWidth&&(r.forEach((e=>e.setActualWidth(e.getMinWidth(),t))),l=r,r=[]);const c=[];let g;e:for(;;){g=this.flexViewportWidth-o;const e=g/s;for(let a=0;a<r.length;a++){const n=r[a],i=e*n.getFlex();let g=0;const d=n.getMinWidth(),h=n.getMaxWidth();if(i<d?g=d:i>h&&(g=h),g){n.setActualWidth(g,t),m(r,n),s-=n.getFlex(),l.push(n),o+=n.getActualWidth();continue e}c[a]=Math.round(i)}break}let d=g;return r.forEach(((e,a)=>{e.setActualWidth(Math.min(c[a],d),t),l.push(e),d-=c[a]})),e.skipSetLeft||this.visibleColsService.setLeftValues(t),e.updateBodyWidths&&this.visibleColsService.updateBodyWidths(),e.fireResizedEvent&&this.eventDispatcher.columnResized(l,!0,t,r),r}sizeColumnsToFit(e,t="sizeColumnsToFit",a,n){if(this.columnModel.isShouldQueueResizeOperations())return void this.columnModel.pushResizeOperation((()=>this.sizeColumnsToFit(e,t,a,n)));const o={};n&&n?.columnLimits?.forEach((({key:e,...t})=>{o["string"==typeof e?e:e.getColId()]=t}));const r=this.visibleColsService.getAllCols(),i=e===ke(r);if(e<=0||!r.length||i)return;const s=[],l=[];r.forEach((e=>{!0===e.getColDef().suppressSizeToFit?l.push(e):s.push(e)}));const c=s.slice(0);let g=!1;const d=e=>{f(s,e),l.push(e)};for(s.forEach((e=>{e.resetActualWidth(t);const a=o?.[e.getId()],r=a?.minWidth??n?.defaultMinWidth,i=a?.maxWidth??n?.defaultMaxWidth,s=e.getAc';
      S = S + 'tualWidth();"number"==typeof r&&s<r?e.setActualWidth(r,t,!0):"number"==typeof i&&s>i&&e.setActualWidth(i,t,!0)}));!g;){g=!0;const a=e-ke(l);if(a<=0)s.forEach((e=>{const a=o?.[e.getId()]?.minWidth??n?.defaultMinWidth;"number"!=typeof a?e.setMinimum(t):e.setActualWidth(a,t,!0)}));else{const e=a/ke(s);let r=a;for(let a=s.length-1;a>=0;a--){const i=s[a],l=o?.[i.getId()],c=l?.minWidth??n?.defaultMinWidth,h=l?.maxWidth??n?.defaultMaxWidth,u=i.getMinWidth(),p=i.getMaxWidth(),m="number"==typeof c&&c>u?c:u,f="number"==typeof h&&h<p?h:p;let v=Math.round(i.getActualWidth()*e);v<m?(v=m,d(i),g=!1):v>f?(v=f,d(i),g=!1):0===a&&(v=r),i.setActualWidth(v,t,!0),r-=v}}}c.forEach((e=>{e.fireColumnWidthChangedEvent(t)})),this.visibleColsService.setLeftValues(t),this.visibleColsService.updateBodyWidths(),a||this.eventDispatcher.columnResized(c,!0,t)}applyAutosizeStrategy(){const e=this.gos.get("autoSizeStrategy");if(!e)return;const{type:t}=e;setTimeout((()=>{if("fitGridWidth"===t){const{columnLimits:t,defaultMinWidth:a,defaultMaxWidth:n}=e,o=t?.map((({colId:e,minWidth:t,maxWidth:a})=>({key:e,minWidth:t,maxWidth:a})));this.ctrlsService.getGridBodyCtrl().sizeColumnsToFit({defaultMinWidth:a,defaultMaxWidth:n,columnLimits:o})}else"fitProvidedWidth"===t&&this.sizeColumnsToFit(e.width,"sizeColumnsToFit")}))}};function je(e,t){return e+"_"+t}function Ke(e){return e instanceof Qe}var Qe=class extends A{constructor(e,t,a,n){super(),this.isColumn=!1,this.displayedChildren=[],this.parent=null,this.groupId=t,this.partId=a,this.providedColumnGroup=e,this.pinned=n}reset(){this.parent=null,this.children=null,this.displayedChildren=null}getParent(){return this.parent}setParent(e){this.parent=e}getUniqueId(){return je(this.groupId,this.partId)}isEmptyGroup(){return 0===this.displayedChildren.length}isMoving(){const e=this.getProvidedColumnGroup().getLeafColumns();return!(!e||0===e.length)&&e.every((e=>e.isMoving()))}checkLeft(){if(this.displayedChildren.forEach((e=>{Ke(e)&&e.checkLeft()})),this.displayedCh';
      S = S + 'ildren.length>0)if(this.gos.get("enableRtl")){const e=d(this.displayedChildren).getLeft();this.setLeft(e)}else{const e=this.displayedChildren[0].getLeft();this.setLeft(e)}else this.setLeft(null)}getLeft(){return this.left}getOldLeft(){return this.oldLeft}setLeft(e){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.dispatchLocalEvent({type:"leftChanged"}))}getPinned(){return this.pinned}getGroupId(){return this.groupId}getPartId(){return this.partId}getActualWidth(){let e=0;return this.displayedChildren&&this.displayedChildren.forEach((t=>{e+=t.getActualWidth()})),e}isResizable(){if(!this.displayedChildren)return!1;let e=!1;return this.displayedChildren.forEach((t=>{t.isResizable()&&(e=!0)})),e}getMinWidth(){let e=0;return this.displayedChildren.forEach((t=>{e+=t.getMinWidth()})),e}addChild(e){this.children||(this.children=[]),this.children.push(e)}getDisplayedChildren(){return this.displayedChildren}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}getDisplayedLeafColumns(){const e=[];return this.addDisplayedLeafColumns(e),e}getDefinition(){return this.providedColumnGroup.getColGroupDef()}getColGroupDef(){return this.providedColumnGroup.getColGroupDef()}isPadding(){return this.providedColumnGroup.isPadding()}isExpandable(){return this.providedColumnGroup.isExpandable()}isExpanded(){return this.providedColumnGroup.isExpanded()}setExpanded(e){this.providedColumnGroup.setExpanded(e)}addDisplayedLeafColumns(e){this.displayedChildren.forEach((t=>{te(t)?e.push(t):Ke(t)&&t.addDisplayedLeafColumns(e)}))}addLeafColumns(e){this.children.forEach((t=>{te(t)?e.push(t):Ke(t)&&t.addLeafColumns(e)}))}getChildren(){return this.children}getColumnGroupShow(){return this.providedColumnGroup.getColumnGroupShow()}getProvidedColumnGroup(){return this.providedColumnGroup}getPaddingLevel(){const e=this.getParent();return this.isPadding()&&e&&e.isPadding()?1+e.getPaddingLevel():0}calculateDisplayedColumns(){this.displayedChildren=[];let e=this;for(;null!=e&&e.isPadding();)e=e';
      S = S + '.getParent();if(!(!!e&&e.getProvidedColumnGroup().isExpandable()))return this.displayedChildren=this.children,void this.dispatchLocalEvent({type:"displayedChildrenChanged"});this.children.forEach((t=>{if(Ke(t)&&(!t.displayedChildren||!t.displayedChildren.length))return;switch(t.getColumnGroupShow()){case"open":e.getProvidedColumnGroup().isExpanded()&&this.displayedChildren.push(t);break;case"closed":e.getProvidedColumnGroup().isExpanded()||this.displayedChildren.push(t);break;default:this.displayedChildren.push(t)}})),this.dispatchLocalEvent({type:"displayedChildrenChanged"})}},Ye=class{constructor(){this.existingIds={}}getInstanceIdForKey(e){const t=this.existingIds[e];let a;return a="number"!=typeof t?0:t+1,this.existingIds[e]=a,a}},_e=class extends A{constructor(){super(...arguments),this.beanName="visibleColsService",this.colsAndGroupsMap={},this.columnsLeft=[],this.columnsRight=[],this.columnsCenter=[],this.columns=[],this.bodyWidth=0,this.leftWidth=0,this.rightWidth=0,this.bodyWidthDirty=!0}wireBeans(e){this.columnModel=e.columnModel,this.columnSizeService=e.columnSizeService,this.columnViewportService=e.columnViewportService,this.eventDispatcher=e.columnEventDispatcher}refresh(e,t=!1){t||this.buildTrees(),this.updateOpenClosedVisibilityInColumnGroups(),this.columnsLeft=Ze(this.treeLeft),this.columnsCenter=Ze(this.treeCenter),this.columnsRight=Ze(this.treeRight),this.joinColsAriaOrder(),this.joinCols(),this.setLeftValues(e),this.autoHeightCols=this.columns.filter((e=>e.isAutoHeight())),this.columnSizeService.refreshFlexedColumns(),this.updateBodyWidths(),this.columnViewportService.checkViewportColumns(!1),this.setFirstRightAndLastLeftPinned(e),this.eventDispatcher.visibleCols()}updateBodyWidths(){const e=ke(this.columnsCenter),t=ke(this.columnsLeft),a=ke(this.columnsRight);this.bodyWidthDirty=this.bodyWidth!==e;if(this.bodyWidth!==e||this.leftWidth!==t||this.rightWidth!==a){this.bodyWidth=e,this.leftWidth=t,this.rightWidth=a;const n={type:"columnContainerWidth';
      S = S + 'Changed"};this.eventService.dispatchEvent(n);const o={type:"displayedColumnsWidthChanged"};this.eventService.dispatchEvent(o)}}setLeftValues(e){this.setLeftValuesOfCols(e),this.setLeftValuesOfGroups()}setFirstRightAndLastLeftPinned(e){let t,a;this.gos.get("enableRtl")?(t=this.columnsLeft?this.columnsLeft[0]:null,a=this.columnsRight?d(this.columnsRight):null):(t=this.columnsLeft?d(this.columnsLeft):null,a=this.columnsRight?this.columnsRight[0]:null),this.columnModel.getCols().forEach((n=>{n.setLastLeftPinned(n===t,e),n.setFirstRightPinned(n===a,e)}))}buildTrees(){const e=this.columnModel.getColsToShow(),t=e.filter((e=>"left"==e.getPinned())),a=e.filter((e=>"right"==e.getPinned())),n=e.filter((e=>"left"!=e.getPinned()&&"right"!=e.getPinned())),o=new Ye;this.treeLeft=this.createGroups({columns:t,idCreator:o,pinned:"left",oldDisplayedGroups:this.treeLeft}),this.treeRight=this.createGroups({columns:a,idCreator:o,pinned:"right",oldDisplayedGroups:this.treeRight}),this.treeCenter=this.createGroups({columns:n,idCreator:o,pinned:null,oldDisplayedGroups:this.treeCenter}),this.updateColsAndGroupsMap()}clear(){this.columnsLeft=[],this.columnsRight=[],this.columnsCenter=[],this.columns=[],this.ariaOrderColumns=[]}joinColsAriaOrder(){const e=this.columnModel.getCols(),t=[],a=[],n=[];for(const o of e){const e=o.getPinned();e?!0===e||"left"===e?t.push(o):n.push(o):a.push(o)}this.ariaOrderColumns=t.concat(a).concat(n)}getAriaColIndex(e){let t;return t=Ke(e)?e.getLeafColumns()[0]:e,this.ariaOrderColumns.indexOf(t)+1}getAllAutoHeightCols(){return this.autoHeightCols}setLeftValuesOfGroups(){[this.treeLeft,this.treeRight,this.treeCenter].forEach((e=>{e.forEach((e=>{if(Ke(e)){e.checkLeft()}}))}))}setLeftValuesOfCols(e){if(!this.columnModel.getColDefCols())return;const t=this.columnModel.getCols().slice(0),a=this.gos.get("enableRtl");[this.columnsLeft,this.columnsRight,this.columnsCenter].forEach((n=>{if(a){let t=ke(n);n.forEach((a=>{t-=a.getActualWidth(),a.setLeft(t,e)}))}else{let t=0;n.';
      S = S + 'forEach((a=>{a.setLeft(t,e),t+=a.getActualWidth()}))}!function(e,t){for(let a=0;a<t.length;a++)m(e,t[a])}(t,n)})),t.forEach((t=>{t.setLeft(null,e)}))}joinCols(){this.gos.get("enableRtl")?this.columns=this.columnsRight.concat(this.columnsCenter).concat(this.columnsLeft):this.columns=this.columnsLeft.concat(this.columnsCenter).concat(this.columnsRight)}getColsCenter(){return this.columnsCenter}getAllTrees(){return this.treeLeft&&this.treeRight&&this.treeCenter?this.treeLeft.concat(this.treeCenter).concat(this.treeRight):null}getTreeLeft(){return this.treeLeft}getTreeRight(){return this.treeRight}getTreeCenter(){return this.treeCenter}getAllCols(){return this.columns}isColDisplayed(e){return this.getAllCols().indexOf(e)>=0}getLeftColsForRow(e){return this.columnModel.isColSpanActive()?this.getColsForRow(e,this.columnsLeft):this.columnsLeft}getRightColsForRow(e){return this.columnModel.isColSpanActive()?this.getColsForRow(e,this.columnsRight):this.columnsRight}getColsForRow(e,t,a,n){const o=[];let r=null;for(let i=0;i<t.length;i++){const s=t[i],l=t.length-i,c=Math.min(s.getColSpan(e),l),g=[s];if(c>1){const e=c-1;for(let a=1;a<=e;a++)g.push(t[i+a]);i+=e}let d;if(a?(d=!1,g.forEach((e=>{a(e)&&(d=!0)}))):d=!0,d){if(0===o.length&&r){!!n&&n(s)&&o.push(r)}o.push(s)}r=s}return o}getBodyContainerWidth(){return this.bodyWidth}getContainerWidth(e){switch(e){case"left":return this.leftWidth;case"right":return this.rightWidth;default:return this.bodyWidth}}getCenterCols(){return this.columnsCenter}getLeftCols(){return this.columnsLeft}getRightCols(){return this.columnsRight}getColBefore(e){const t=this.getAllCols(),a=t.indexOf(e);return a>0?t[a-1]:null}getGroupAtDirection(e,t){const a=e.getProvidedColumnGroup().getLevel()+e.getPaddingLevel(),n=e.getDisplayedLeafColumns(),o="After"===t?d(n):n[0],r=`getCol${t}`;for(;;){const t=this[r](o);if(!t)return null;const n=this.getColGroupAtLevel(t,a);if(n!==e)return n}}getColGroupAtLevel(e,t){let a,n,o=e.getParent();for(;;){if(a=o.getProvidedC';
      S = S + 'olumnGroup().getLevel(),n=o.getPaddingLevel(),a+n<=t)break;o=o.getParent()}return o}isPinningLeft(){return this.columnsLeft.length>0}isPinningRight(){return this.columnsRight.length>0}updateColsAndGroupsMap(){this.colsAndGroupsMap={};const e=e=>{this.colsAndGroupsMap[e.getUniqueId()]=e};Je(this.treeCenter,!1,e),Je(this.treeLeft,!1,e),Je(this.treeRight,!1,e)}isVisible(e){return this.colsAndGroupsMap[e.getUniqueId()]===e}updateOpenClosedVisibilityInColumnGroups(){Je(this.getAllTrees(),!1,(e=>{Ke(e)&&e.calculateDisplayedColumns()}))}getFirstColumn(){const e=this.gos.get("enableRtl"),t=["getLeftCols","getCenterCols","getRightCols"];e&&t.reverse();for(let a=0;a<t.length;a++){const n=this[t[a]]();if(n.length)return e?d(n):n[0]}return null}getColumnGroup(e,t){if(!e)return null;if(Ke(e))return e;const a=this.getAllTrees(),n="number"==typeof t;let o=null;return Je(a,!1,(a=>{if(Ke(a)){const r=a;let i;i=n?e===r.getGroupId()&&t===r.getPartId():e===r.getGroupId(),i&&(o=r)}})),o}getColAfter(e){const t=this.getAllCols(),a=t.indexOf(e);return a<t.length-1?t[a+1]:null}isBodyWidthDirty(){return this.bodyWidthDirty}setBodyWidthDirty(){this.bodyWidthDirty=!0}getColsLeftWidth(){return ke(this.columnsLeft)}getDisplayedColumnsRightWidth(){return ke(this.columnsRight)}isColAtEdge(e,t){const a=this.getAllCols();if(!a.length)return!1;const n="first"===t;let o;if(Ke(e)){const t=e.getDisplayedLeafColumns();if(!t.length)return!1;o=n?t[0]:d(t)}else o=e;return(n?a[0]:d(a))===o}createGroups(e){const{columns:t,idCreator:a,pinned:n,oldDisplayedGroups:o,isStandaloneStructure:r}=e,i=this.mapOldGroupsById(o),s=[];let l=t;for(;l.length;){const e=l;l=[];let t=0;const o=o=>{const c=t;t=o;const g=e[c],d=(Ke(g)?g.getProvidedColumnGroup():g).getOriginalParent();if(null==d){for(let t=c;t<o;t++)s.push(e[t]);return}const h=this.createColGroup(d,a,i,n,r);for(let t=c;t<o;t++)h.addChild(e[t]);l.push(h)};for(let a=1;a<e.length;a++){const n=e[a],r=(Ke(n)?n.getProvidedColumnGroup():n).getOriginalParent(),i=e[t];r!==(';
      S = S + 'Ke(i)?i.getProvidedColumnGroup():i).getOriginalParent()&&o(a)}t<e.length&&o(e.length)}return r||this.setupParentsIntoCols(s,null),s}createColGroup(e,t,a,n,o){const r=e.getGroupId(),i=t.getInstanceIdForKey(r);let s=a[je(r,i)];return s&&s.getProvidedColumnGroup()!==e&&(s=null),L(s)?s.reset():(s=new Qe(e,r,i,n),o||this.createBean(s)),s}mapOldGroupsById(e){const t={},a=e=>{e.forEach((e=>{if(Ke(e)){const n=e;t[e.getUniqueId()]=n,a(n.getChildren())}}))};return e&&a(e),t}setupParentsIntoCols(e,t){e.forEach((e=>{if(e.setParent(t),Ke(e)){const t=e;this.setupParentsIntoCols(t.getChildren(),t)}}))}};function Je(e,t,a){if(e)for(let n=0;n<e.length;n++){const o=e[n];if(Ke(o)){Je(t?o.getDisplayedChildren():o.getChildren(),t,a)}a(o)}}function Ze(e){const t=[];return Je(e,!0,(e=>{te(e)&&t.push(e)})),t}var Xe=["columnEverythingChanged","newColumnsLoaded","columnPivotModeChanged","pivotMaxColumnsExceeded","columnRowGroupChanged","expandOrCollapseAll","columnPivotChanged","gridColumnsChanged","columnValueChanged","columnMoved","columnVisible","columnPinned","columnGroupOpened","columnResized","displayedColumnsChanged","virtualColumnsChanged","columnHeaderMouseOver","columnHeaderMouseLeave","columnHeaderClicked","columnHeaderContextMenu","asyncTransactionsFlushed","rowGroupOpened","rowDataUpdated","pinnedRowDataChanged","rangeSelectionChanged","chartCreated","chartRangeSelectionChanged","chartOptionsChanged","chartDestroyed","toolPanelVisibleChanged","toolPanelSizeChanged","modelUpdated","cutStart","cutEnd","pasteStart","pasteEnd","fillStart","fillEnd","rangeDeleteStart","rangeDeleteEnd","undoStarted","undoEnded","redoStarted","redoEnded","cellClicked","cellDoubleClicked","cellMouseDown","cellContextMenu","cellValueChanged","cellEditRequest","rowValueChanged","headerFocused","cellFocused","rowSelected","selectionChanged","tooltipShow","tooltipHide","cellKeyDown","cellMouseOver","cellMouseOut","filterChanged","filterModified","filterOpened","advancedFilterBuilderVisibleChanged","sortChan';
      S = S + 'ged","virtualRowRemoved","rowClicked","rowDoubleClicked","gridReady","gridPreDestroyed","gridSizeChanged","viewportChanged","firstDataRendered","dragStarted","dragStopped","rowEditingStarted","rowEditingStopped","cellEditingStarted","cellEditingStopped","bodyScroll","bodyScrollEnd","paginationChanged","componentStateChanged","storeRefreshed","stateUpdated","columnMenuVisibleChanged","contextMenuVisibleChanged","rowDragEnter","rowDragMove","rowDragLeave","rowDragEnd"],$e=[...Xe,"scrollbarWidthChanged","keyShortcutChangedCellStart","keyShortcutChangedCellEnd","pinnedHeightChanged","cellFocusCleared","fullWidthRowFocused","checkboxChanged","heightScaleChanged","suppressMovableColumns","suppressMenuHide","suppressFieldDotNotation","columnPanelItemDragStart","columnPanelItemDragEnd","bodyHeightChanged","columnContainerWidthChanged","displayedColumnsWidthChanged","scrollVisibilityChanged","columnHoverChanged","flashCells","paginationPixelOffsetChanged","displayedRowsChanged","leftPinnedWidthChanged","rightPinnedWidthChanged","rowContainerHeightChanged","headerHeightChanged","columnHeaderHeightChanged","gridStylesChanged","storeUpdated","filterDestroyed","rowDataUpdateStarted","rowCountReady","advancedFilterEnabledChanged","dataTypesInferred","fieldValueChanged","fieldPickerValueSelected","richSelectListRowSelected","sideBarUpdated","alignedGridScroll","alignedGridColumn","gridOptionsChanged","chartTitleEdit","recalculateRowBounds","stickyTopOffsetChanged"],et={enableBrowserTooltips:!0,tooltipTrigger:!0,tooltipMouseTrack:!0,tooltipShowMode:!0,tooltipInteraction:!0,defaultColGroupDef:!0,suppressAutoSize:!0,skipHeaderOnAutoSize:!0,autoSizeStrategy:!0,components:!0,stopEditingWhenCellsLoseFocus:!0,undoRedoCellEditing:!0,undoRedoCellEditingLimit:!0,excelStyles:!0,cacheQuickFilter:!0,advancedFilterModel:!0,customChartThemes:!0,chartThemeOverrides:!0,chartToolPanelsDef:!0,loadingCellRendererSelector:!0,localeText:!0,keepDetailRows:!0,keepDetailRowsCount:!0,detailRowHeight:!0,det';
      S = S + 'ailRowAutoHeight:!0,tabIndex:!0,valueCache:!0,valueCacheNeverExpires:!0,enableCellExpressions:!0,suppressTouch:!0,suppressAsyncEvents:!0,suppressBrowserResizeObserver:!0,suppressPropertyNamesCheck:!0,debug:!0,loadingOverlayComponent:!0,suppressLoadingOverlay:!0,noRowsOverlayComponent:!0,paginationPageSizeSelector:!0,paginateChildRows:!0,pivotPanelShow:!0,pivotSuppressAutoColumn:!0,suppressExpandablePivotGroups:!0,aggFuncs:!0,suppressAggFuncInHeader:!0,removePivotHeaderRowWhenSingleValueColumn:!0,allowShowChangeAfterFilter:!0,ensureDomOrder:!0,enableRtl:!0,suppressColumnVirtualisation:!0,suppressMaxRenderedRowRestriction:!0,suppressRowVirtualisation:!0,rowDragText:!0,suppressGroupMaintainValueType:!0,groupLockGroupColumns:!0,rowGroupPanelSuppressSort:!0,suppressGroupRowsSticky:!0,rowModelType:!0,cacheOverflowSize:!0,infiniteInitialRowCount:!0,serverSideInitialRowCount:!0,suppressServerSideInfiniteScroll:!0,maxBlocksInCache:!0,maxConcurrentDatasourceRequests:!0,blockLoadDebounceMillis:!0,serverSideOnlyRefreshFilteredGroups:!0,serverSidePivotResultFieldSeparator:!0,viewportRowModelPageSize:!0,viewportRowModelBufferSize:!0,debounceVerticalScrollbar:!0,suppressAnimationFrame:!0,suppressPreventDefaultOnMouseWheel:!0,scrollbarWidth:!0,icons:!0,suppressRowTransform:!0,gridId:!0,enableGroupEdit:!0,initialState:!0,processUnpinnedColumns:!0,createChartContainer:!0,getLocaleText:!0,getRowId:!0,reactiveCustomComponents:!0,columnMenu:!0},tt=class{};tt.STRING_PROPERTIES=["rowSelection","overlayLoadingTemplate","overlayNoRowsTemplate","gridId","quickFilterText","rowModelType","editType","domLayout","clipboardDelimiter","rowGroupPanelShow","multiSortKey","pivotColumnGroupTotals","pivotRowTotals","pivotPanelShow","fillHandleDirection","groupDisplayType","treeDataDisplayType","colResizeDefault","tooltipTrigger","serverSidePivotResultFieldSeparator","columnMenu","tooltipShowMode","grandTotalRow"],tt.OBJECT_PROPERTIES=["components","rowStyle","context","autoGroupColumnDef","localeText",';
      S = S + '"icons","datasource","serverSideDatasource","viewportDatasource","groupRowRendererParams","aggFuncs","fullWidthCellRendererParams","defaultColGroupDef","defaultColDef","defaultCsvExportParams","defaultExcelExportParams","columnTypes","rowClassRules","detailCellRendererParams","loadingCellRendererParams","loadingOverlayComponentParams","noRowsOverlayComponentParams","popupParent","statusBar","sideBar","chartThemeOverrides","customChartThemes","chartToolPanelsDef","dataTypeDefinitions","advancedFilterModel","advancedFilterParent","advancedFilterBuilderParams","initialState","autoSizeStrategy"],tt.ARRAY_PROPERTIES=["sortingOrder","alignedGrids","rowData","columnDefs","excelStyles","pinnedTopRowData","pinnedBottomRowData","chartThemes","rowClass","paginationPageSizeSelector"],tt.NUMBER_PROPERTIES=["rowHeight","detailRowHeight","rowBuffer","headerHeight","groupHeaderHeight","groupLockGroupColumns","floatingFiltersHeight","pivotHeaderHeight","pivotGroupHeaderHeight","groupDefaultExpanded","pivotDefaultExpanded","viewportRowModelPageSize","viewportRowModelBufferSize","autoSizePadding","maxBlocksInCache","maxConcurrentDatasourceRequests","tooltipShowDelay","tooltipHideDelay","cacheOverflowSize","paginationPageSize","cacheBlockSize","infiniteInitialRowCount","serverSideInitialRowCount","scrollbarWidth","asyncTransactionWaitMillis","blockLoadDebounceMillis","keepDetailRowsCount","undoRedoCellEditingLimit","cellFlashDelay","cellFadeDelay","cellFlashDuration","cellFadeDuration","tabIndex","pivotMaxGeneratedColumns"],tt.BOOLEAN_PROPERTIES=["suppressMakeColumnVisibleAfterUnGroup","suppressRowClickSelection","suppressCellFocus","suppressHeaderFocus","suppressHorizontalScroll","groupSelectsChildren","alwaysShowHorizontalScroll","alwaysShowVerticalScroll","debug","enableBrowserTooltips","enableCellExpressions","groupIncludeTotalFooter","groupSuppressBlankHeader","suppressMenuHide","suppressRowDeselection","unSortIcon","suppressMultiSort","alwaysMultiSort","singleClickEdit","suppress';
      S = S + 'LoadingOverlay","suppressNoRowsOverlay","suppressAutoSize","skipHeaderOnAutoSize","suppressColumnMoveAnimation","suppressMovableColumns","suppressFieldDotNotation","enableRangeSelection","enableRangeHandle","enableFillHandle","suppressClearOnFillReduction","deltaSort","suppressTouch","suppressAsyncEvents","allowContextMenuWithControlKey","suppressContextMenu","enableCellChangeFlash","suppressDragLeaveHidesColumns","suppressRowGroupHidesColumns","suppressMiddleClickScrolls","suppressPreventDefaultOnMouseWheel","suppressCopyRowsToClipboard","copyHeadersToClipboard","copyGroupHeadersToClipboard","pivotMode","suppressAggFuncInHeader","suppressColumnVirtualisation","alwaysAggregateAtRootLevel","suppressFocusAfterRefresh","functionsReadOnly","animateRows","groupSelectsFiltered","groupRemoveSingleChildren","groupRemoveLowestSingleChildren","enableRtl","suppressClickEdit","rowDragEntireRow","rowDragManaged","suppressRowDrag","suppressMoveWhenRowDragging","rowDragMultiRow","enableGroupEdit","embedFullWidthRows","suppressPaginationPanel","groupHideOpenParents","groupAllowUnbalanced","pagination","paginationAutoPageSize","suppressScrollOnNewData","suppressScrollWhenPopupsAreOpen","purgeClosedRowNodes","cacheQuickFilter","includeHiddenColumnsInQuickFilter","ensureDomOrder","accentedSort","suppressChangeDetection","valueCache","valueCacheNeverExpires","aggregateOnlyChangedColumns","suppressAnimationFrame","suppressExcelExport","suppressCsvExport","includeHiddenColumnsInAdvancedFilter","suppressMultiRangeSelection","enterNavigatesVerticallyAfterEdit","enterNavigatesVertically","suppressPropertyNamesCheck","rowMultiSelectWithClick","suppressRowHoverHighlight","suppressRowTransform","suppressClipboardPaste","suppressLastEmptyLineOnPaste","enableCharts","suppressMaintainUnsortedOrder","enableCellTextSelection","suppressBrowserResizeObserver","suppressMaxRenderedRowRestriction","excludeChildrenWhenTreeDataFiltering","tooltipMouseTrack","tooltipInteraction","keepDetailRows","paginateC';
      S = S + 'hildRows","preventDefaultOnContextMenu","undoRedoCellEditing","allowDragFromColumnsToolPanel","pivotSuppressAutoColumn","suppressExpandablePivotGroups","debounceVerticalScrollbar","detailRowAutoHeight","serverSideSortAllLevels","serverSideEnableClientSideSort","serverSideOnlyRefreshFilteredGroups","serverSideSortOnServer","serverSideFilterOnServer","suppressAggFilteredOnly","showOpenedGroup","suppressClipboardApi","suppressModelUpdateAfterUpdateTransaction","stopEditingWhenCellsLoseFocus","maintainColumnOrder","groupMaintainOrder","columnHoverHighlight","readOnlyEdit","suppressRowVirtualisation","enableCellEditingOnBackspace","resetRowDataOnUpdate","removePivotHeaderRowWhenSingleValueColumn","suppressCopySingleCellRanges","suppressGroupRowsSticky","suppressCutToClipboard","suppressServerSideInfiniteScroll","rowGroupPanelSuppressSort","allowShowChangeAfterFilter","enableAdvancedFilter","masterDetail","treeData","suppressGroupMaintainValueType","reactiveCustomComponents","applyQuickFilterBeforePivotOrAgg","suppressServerSideFullWidthLoadingRow","suppressAdvancedFilterEval","loading"],tt.OTHER_PROPERTIES=["suppressStickyTotalRow"],tt.FUNCTION_PROPERTIES=["doesExternalFilterPass","processPivotResultColDef","processPivotResultColGroupDef","getBusinessKeyForNode","isRowSelectable","rowDragText","groupRowRenderer","fullWidthCellRenderer","loadingCellRenderer","loadingOverlayComponent","noRowsOverlayComponent","detailCellRenderer","quickFilterParser","quickFilterMatcher","getLocaleText","isExternalFilterPresent","getRowHeight","getRowClass","getRowStyle","getContextMenuItems","getMainMenuItems","processRowPostCreate","processCellForClipboard","getGroupRowAgg","isFullWidthRow","sendToClipboard","focusGridInnerElement","navigateToNextHeader","tabToNextHeader","navigateToNextCell","tabToNextCell","processCellFromClipboard","getDocument","postProcessPopup","getChildCount","getDataPath","isRowMaster","postSortRows","processHeaderForClipboard","processUnpinnedColumns","processGro';
      S = S + 'upHeaderForClipboard","paginationNumberFormatter","processDataFromClipboard","getServerSideGroupKey","isServerSideGroup","createChartContainer","getChartToolbarItems","fillOperation","isApplyServerSideTransaction","getServerSideGroupLevelParams","isServerSideGroupOpenByDefault","isGroupOpenByDefault","initialGroupOrderComparator","groupIncludeFooter","loadingCellRendererSelector","getRowId","groupAggFiltering","chartMenuItems","groupTotalRow"],tt.ALL_PROPERTIES=[...tt.ARRAY_PROPERTIES,...tt.OBJECT_PROPERTIES,...tt.STRING_PROPERTIES,...tt.NUMBER_PROPERTIES,...tt.FUNCTION_PROPERTIES,...tt.BOOLEAN_PROPERTIES,...tt.OTHER_PROPERTIES];var at=tt,nt=class{static getCallbackForEvent(e){return!e||e.length<2?e:"on"+e[0].toUpperCase()+e.substring(1)}};nt.VUE_OMITTED_PROPERTY="AG-VUE-OMITTED-PROPERTY",nt.PUBLIC_EVENTS=Xe,nt.EVENT_CALLBACKS=$e.map((e=>nt.getCallbackForEvent(e))),nt.BOOLEAN_PROPERTIES=at.BOOLEAN_PROPERTIES,nt.ALL_PROPERTIES=at.ALL_PROPERTIES,nt.ALL_PROPERTIES_AND_CALLBACKS=[...nt.ALL_PROPERTIES,...nt.EVENT_CALLBACKS],nt.ALL_PROPERTIES_AND_CALLBACKS_SET=new Set(nt.ALL_PROPERTIES_AND_CALLBACKS);var ot=nt;function rt(e,t){"object"!=typeof e&&(e={});const a={...e};return ot.ALL_PROPERTIES_AND_CALLBACKS.forEach((e=>{const n=t[e];void 0!==n&&n!==ot.VUE_OMITTED_PROPERTY&&(a[e]=n)})),a}function it(e,t){if(!e)return;const a={};let n=!1;if(Object.keys(e).filter((e=>ot.ALL_PROPERTIES_AND_CALLBACKS_SET.has(e))).forEach((t=>{a[t]=e[t],n=!0})),!n)return;const o={type:"gridOptionsChanged",options:a};t.dispatchEvent(o);const r={type:"componentStateChanged"};j(a,((e,t)=>{r[e]=t})),t.dispatchEvent(r)}var st,lt,ct,gt,dt,ht,ut,pt,mt,ft=class{constructor(e){this.cssClassStates={},this.getGui=e}addCssClass(e){const t=(e||"").split(" ");if(t.length>1)return void t.forEach((e=>this.addCssClass(e)));if(!0!==this.cssClassStates[e]&&e.length){const t=this.getGui();t&&t.classList.add(e),this.cssClassStates[e]=!0}}removeCssClass(e){const t=(e||"").split(" ");if(t.length>1)return void t.forEac';
      S = S + 'h((e=>this.removeCssClass(e)));if(!1!==this.cssClassStates[e]&&e.length){const t=this.getGui();t&&t.classList.remove(e),this.cssClassStates[e]=!1}}containsCssClass(e){const t=this.getGui();return!!t&&t.classList.contains(e)}addOrRemoveCssClass(e,t){if(!e)return;if(e.indexOf(" ")>=0){const a=(e||"").split(" ");if(a.length>1)return void a.forEach((e=>this.addOrRemoveCssClass(e,t)))}if(this.cssClassStates[e]!==t&&e.length){const a=this.getGui();a&&a.classList.toggle(e,t),this.cssClassStates[e]=t}}};function vt(e,t,a){null==a||"string"==typeof a&&""==a?Ct(e,t):bt(e,t,a)}function bt(e,t,a){e.setAttribute(wt(t),a.toString())}function Ct(e,t){e.removeAttribute(wt(t))}function wt(e){return`aria-${e}`}function yt(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function St(e){return parseInt(e.getAttribute("aria-posinset"),10)}function kt(e,t){vt(e,"label",t)}function xt(e,t){vt(e,"labelledby",t)}function Rt(e,t){vt(e,"describedby",t)}function zt(e,t){vt(e,"live",t)}function Ft(e,t){vt(e,"level",t)}function Mt(e,t){vt(e,"disabled",t)}function Dt(e,t){vt(e,"hidden",t)}function Et(e,t){vt(e,"activedescendant",t)}function Pt(e,t){bt(e,"expanded",t)}function At(e){Ct(e,"expanded")}function Tt(e,t){bt(e,"setsize",t)}function It(e,t){bt(e,"posinset",t)}function Lt(e,t){bt(e,"rowcount",t)}function Ot(e,t){bt(e,"rowindex",t)}function Nt(e,t){bt(e,"colcount",t)}function Gt(e,t){bt(e,"colindex",t)}function qt(e,t){bt(e,"colspan",t)}function Bt(e,t){bt(e,"sort",t)}function Ht(e){Ct(e,"sort")}function Vt(e,t){vt(e,"selected",t)}function Wt(e,t){bt(e,"checked",void 0===t?"mixed":t)}function Ut(e,t){vt(e,"controls",t.id),xt(t,e.id)}function jt(e,t){return void 0===t?e("ariaIndeterminate","indeterminate"):!0===t?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}function Kt(){return void 0===st&&(st=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),st}function Qt(){if(void 0===lt)if(Kt()){const e=navigator.userAgent.match(/version\\/(\\d+)/i);e&&(lt=null!=e[1]?parse';
      S = S + 'Float(e[1]):0)}else lt=0;return lt}function Yt(){if(void 0===ct){const e=window;ct=!!e.chrome&&(!!e.chrome.webstore||!!e.chrome.runtime)||/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}return ct}function _t(){return void 0===gt&&(gt=/(firefox)/i.test(navigator.userAgent)),gt}function Jt(){return void 0===dt&&(dt=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),dt}function Zt(){return void 0===ht&&(ht=/iPad|iPhone|iPod/.test(navigator.platform)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1),ht}function Xt(){return!Kt()||Qt()>=15}function $t(e){if(!e)return null;const t=e.tabIndex,a=e.getAttribute("tabIndex");return-1!==t||null!==a&&(""!==a||_t())?t.toString():null}function ea(){const e=document.body,t=document.createElement("div");t.style.width=t.style.height="100px",t.style.opacity="0",t.style.overflow="scroll",t.style.msOverflowStyle="scrollbar",t.style.position="absolute",e.appendChild(t);let a=t.offsetWidth-t.clientWidth;0===a&&0===t.clientWidth&&(a=null),t.parentNode&&t.parentNode.removeChild(t),null!=a&&(pt=a,ut=0===a)}function ta(){return null==ut&&ea(),ut}function aa(e,t,a){const n=e.parentElement;let o=n&&n.firstChild;for(;o;)t&&o.classList.toggle(t,o===e),a&&o.classList.toggle(a,o!==e),o=o.nextSibling}var na="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function oa(e){const t=Element.prototype.matches||Element.prototype.msMatchesSelector,a=t.call(e,"input, select, button, textarea"),n=t.call(e,na),o=ya(e);return a&&!n&&o}function ra(e,t,a={}){const{skipAriaHidden:n}=a;e.classList.toggle("ag-hidden",!t),n||Dt(e,!t)}function ia(e,t,a={}){const{skipAriaHidden:n}=a;e.classList.toggle("ag-invisible",!t),n||Dt(e,!t)}function sa(e,t){const a="disabled",n=t?e=>e.setAttribute(a,""):e=>e.removeAttribute(a);n(e),Aa(e.querySelectorAll("input"),(e=>n(e)))}function la(e,t,a){let n=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,"number"==typeof a){if(++n>a)break}else if(e===a)break}return!1}funct';
      S = S + 'ion ca(e){const{height:t,width:a,borderTopWidth:n,borderRightWidth:o,borderBottomWidth:r,borderLeftWidth:i,paddingTop:s,paddingRight:l,paddingBottom:c,paddingLeft:g,marginTop:d,marginRight:h,marginBottom:u,marginLeft:p,boxSizing:m}=window.getComputedStyle(e);return{height:parseFloat(t||"0"),width:parseFloat(a||"0"),borderTopWidth:parseFloat(n||"0"),borderRightWidth:parseFloat(o||"0"),borderBottomWidth:parseFloat(r||"0"),borderLeftWidth:parseFloat(i||"0"),paddingTop:parseFloat(s||"0"),paddingRight:parseFloat(l||"0"),paddingBottom:parseFloat(c||"0"),paddingLeft:parseFloat(g||"0"),marginTop:parseFloat(d||"0"),marginRight:parseFloat(h||"0"),marginBottom:parseFloat(u||"0"),marginLeft:parseFloat(p||"0"),boxSizing:m}}function ga(e){const t=ca(e);return"border-box"===t.boxSizing?t.height-t.paddingTop-t.paddingBottom:t.height}function da(e){const t=ca(e);return"border-box"===t.boxSizing?t.width-t.paddingLeft-t.paddingRight:t.width}function ha(e){const{height:t,marginBottom:a,marginTop:n}=ca(e);return Math.floor(t+a+n)}function ua(e){const{width:t,marginLeft:a,marginRight:n}=ca(e);return Math.floor(t+a+n)}function pa(e){const t=e.getBoundingClientRect(),{borderTopWidth:a,borderLeftWidth:n,borderRightWidth:o,borderBottomWidth:r}=ca(e);return{top:t.top+(a||0),left:t.left+(n||0),right:t.right+(o||0),bottom:t.bottom+(r||0)}}function ma(){if("boolean"==typeof mt)return mt;const e=document.createElement("div");return e.style.direction="rtl",e.style.width="1px",e.style.height="1px",e.style.position="fixed",e.style.top="0px",e.style.overflow="hidden",e.dir="rtl",e.innerHTML=\'<div style="width: 2px">\\n            <span style="display: inline-block; width: 1px"></span>\\n            <span style="display: inline-block; width: 1px"></span>\\n        </div>\',document.body.appendChild(e),e.scrollLeft=1,mt=0===Math.floor(e.scrollLeft),document.body.removeChild(e),mt}function fa(e,t){let a=e.scrollLeft;return t&&(a=Math.abs(a),Yt()&&!ma()&&(a=e.scrollWidth-e.clientWidth-a)),a}function va(e,t,a';
      S = S + '){a&&(ma()?t*=-1:(Kt()||Yt())&&(t=e.scrollWidth-e.clientWidth-t)),e.scrollLeft=t}function ba(e){for(;e&&e.firstChild;)e.removeChild(e.firstChild)}function Ca(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function wa(e){return!!e.offsetParent}function ya(e){const t=e;if(t.checkVisibility)return t.checkVisibility({checkVisibilityCSS:!0});return!(!wa(e)||"visible"!==window.getComputedStyle(e).visibility)}function Sa(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function ka(e,t,a){a&&a.nextSibling===t||(a?a.nextSibling?e.insertBefore(t,a.nextSibling):e.appendChild(t):e.firstChild&&e.firstChild!==t&&e.insertAdjacentElement("afterbegin",t))}function xa(e,t){for(let a=0;a<t.length;a++){const n=t[a],o=e.children[a];o!==n&&e.insertBefore(n,o)}}function Ra(e,t){if(t)for(const[a,n]of Object.entries(t)){if(!a||!a.length||null==n)continue;const t=a.replace(/[A-Z]/g,(e=>`-${e.toLocaleLowerCase()}`)),o=n.toString(),r=o.replace(/\\s*!important/g,""),i=r.length!=o.length?"important":void 0;e.style.setProperty(t,r,i)}}function za(e,t){"flex"===t?(e.style.removeProperty("width"),e.style.removeProperty("minWidth"),e.style.removeProperty("maxWidth"),e.style.flex="1 1 auto"):Fa(e,t)}function Fa(e,t){t=Da(t),e.style.width=t.toString(),e.style.maxWidth=t.toString(),e.style.minWidth=t.toString()}function Ma(e,t){t=Da(t),e.style.height=t.toString(),e.style.maxHeight=t.toString(),e.style.minHeight=t.toString()}function Da(e){return"number"==typeof e?`${e}px`:e}function Ea(e){return e instanceof Node||e instanceof HTMLElement}function Pa(e,t,a){null==a?e.removeAttribute(t):e.setAttribute(t,a.toString())}function Aa(e,t){if(null!=e)for(let a=0;a<e.length;a++)t(e[a])}function Ta(e,t){e.then((e=>{const a=e.getGui();null!=a&&("object"==typeof a?t.appendChild(a):t.innerHTML=a)}))}var Ia=class{constructor(e=0,t=1){this.nextValue=e,this.step=t}next(){const e=this.nextValue;return this.nextValue+=this.step,e}peek(){return this.nextValue}skip(e){this.nextValue';
      S = S + '+=e}},La=class e extends A{constructor(e,t,a,n){super(),this.parentComp=e,this.tooltipShowDelayOverride=t,this.tooltipHideDelayOverride=a,this.shouldDisplayTooltip=n,this.interactionEnabled=!1,this.isInteractingWithTooltip=!1,this.state=0,this.tooltipInstanceCount=0,this.tooltipMouseTrack=!1}wireBeans(e){this.popupService=e.popupService,this.userComponentFactory=e.userComponentFactory}postConstruct(){this.gos.get("tooltipInteraction")&&(this.interactionEnabled=!0),this.tooltipTrigger=this.getTooltipTrigger(),this.tooltipMouseTrack=this.gos.get("tooltipMouseTrack");const e=this.parentComp.getGui();0===this.tooltipTrigger&&this.addManagedListeners(e,{mouseenter:this.onMouseEnter.bind(this),mouseleave:this.onMouseLeave.bind(this)}),1===this.tooltipTrigger&&this.addManagedListeners(e,{focusin:this.onFocusIn.bind(this),focusout:this.onFocusOut.bind(this)}),this.addManagedListeners(e,{mousemove:this.onMouseMove.bind(this)}),this.interactionEnabled||this.addManagedListeners(e,{mousedown:this.onMouseDown.bind(this),keydown:this.onKeyDown.bind(this)})}getGridOptionsTooltipDelay(e){const t=this.gos.get(e);return t<0&&ce(`${e} should not be lower than 0`),Math.max(200,t)}getTooltipDelay(e){return"show"===e?this.tooltipShowDelayOverride??this.getGridOptionsTooltipDelay("tooltipShowDelay"):this.tooltipHideDelayOverride??this.getGridOptionsTooltipDelay("tooltipHideDelay")}destroy(){this.setToDoNothing(),super.destroy()}getTooltipTrigger(){const e=this.gos.get("tooltipTrigger");return e&&"hover"!==e?1:0}onMouseEnter(t){this.interactionEnabled&&this.interactiveTooltipTimeoutId&&(this.unlockService(),this.startHideTimeout()),Zt()||(e.isLocked?this.showTooltipTimeoutId=window.setTimeout((()=>{this.prepareToShowTooltip(t)}),100):this.prepareToShowTooltip(t))}onMouseMove(e){this.lastMouseEvent&&(this.lastMouseEvent=e),this.tooltipMouseTrack&&2===this.state&&this.tooltipComp&&this.positionTooltip()}onMouseDown(){this.setToDoNothing()}onMouseLeave(){this.interactionEnabled?this.lockServi';
      S = S + 'ce():this.setToDoNothing()}onFocusIn(){this.prepareToShowTooltip()}onFocusOut(e){const t=e.relatedTarget,a=this.parentComp.getGui(),n=this.tooltipComp?.getGui();this.isInteractingWithTooltip||a.contains(t)||this.interactionEnabled&&n?.contains(t)||this.setToDoNothing()}onKeyDown(){this.setToDoNothing()}prepareToShowTooltip(t){if(0!=this.state||e.isLocked)return;let a=0;t&&(a=this.isLastTooltipHiddenRecently()?200:this.getTooltipDelay("show")),this.lastMouseEvent=t||null,this.showTooltipTimeoutId=window.setTimeout(this.showTooltip.bind(this),a),this.state=1}isLastTooltipHiddenRecently(){return(new Date).getTime()-e.lastTooltipHideTime<1e3}setToDoNothing(){2===this.state&&this.hideTooltip(),this.onBodyScrollEventCallback&&(this.onBodyScrollEventCallback(),this.onBodyScrollEventCallback=void 0),this.onColumnMovedEventCallback&&(this.onColumnMovedEventCallback(),this.onColumnMovedEventCallback=void 0),this.clearTimeouts(),this.state=0,this.lastMouseEvent=null}showTooltip(){const e={...this.parentComp.getTooltipParams()};if(!L(e.value)||this.shouldDisplayTooltip&&!this.shouldDisplayTooltip())return void this.setToDoNothing();this.state=2,this.tooltipInstanceCount++;const t=this.newTooltipComponentCallback.bind(this,this.tooltipInstanceCount);this.userComponentFactory.getTooltipCompDetails(e).newAgStackInstance().then(t)}hideTooltip(t){if(!t&&this.isInteractingWithTooltip)return;this.tooltipComp&&(this.destroyTooltipComp(),e.lastTooltipHideTime=(new Date).getTime());const a={type:"tooltipHide",parentGui:this.parentComp.getGui()};this.eventService.dispatchEvent(a),t&&(this.isInteractingWithTooltip=!1),this.state=0}newTooltipComponentCallback(e,t){if(2!==this.state||this.tooltipInstanceCount!==e)return void this.destroyBean(t);const a=t.getGui();this.tooltipComp=t,a.classList.contains("ag-tooltip")||a.classList.add("ag-tooltip-custom"),0===this.tooltipTrigger&&a.classList.add("ag-tooltip-animate"),this.interactionEnabled&&a.classList.add("ag-tooltip-interactive");const n=th';
      S = S + 'is.localeService.getLocaleTextFunc(),o=this.popupService.addPopup({eChild:a,ariaLabel:n("ariaLabelTooltip","Tooltip")});if(o&&(this.tooltipPopupDestroyFunc=o.hideFunc),this.positionTooltip(),1===this.tooltipTrigger){const e=this.setToDoNothing.bind(this);[this.onBodyScrollEventCallback,this.onColumnMovedEventCallback]=this.addManagedEventListeners({bodyScroll:e,columnMoved:e})}this.interactionEnabled&&(0===this.tooltipTrigger?[this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener]=this.addManagedElementListeners(a,{mouseenter:this.onTooltipMouseEnter.bind(this),mouseleave:this.onTooltipMouseLeave.bind(this)}):[this.tooltipFocusInListener,this.tooltipFocusOutListener]=this.addManagedElementListeners(a,{focusin:this.onTooltipFocusIn.bind(this),focusout:this.onTooltipFocusOut.bind(this)}));const r={type:"tooltipShow",tooltipGui:a,parentGui:this.parentComp.getGui()};this.eventService.dispatchEvent(r),this.startHideTimeout()}onTooltipMouseEnter(){this.isInteractingWithTooltip=!0,this.unlockService()}onTooltipMouseLeave(){this.isInteractingWithTooltip=!1,this.lockService()}onTooltipFocusIn(){this.isInteractingWithTooltip=!0}onTooltipFocusOut(e){const t=this.parentComp.getGui(),a=this.tooltipComp?.getGui(),n=e.relatedTarget;a?.contains(n)||(this.isInteractingWithTooltip=!1,t.contains(n)?this.startHideTimeout():this.hideTooltip())}positionTooltip(){const e={type:"tooltip",ePopup:this.tooltipComp.getGui(),nudgeY:18,skipObserver:this.tooltipMouseTrack};this.lastMouseEvent?this.popupService.positionPopupUnderMouseEvent({...e,mouseEvent:this.lastMouseEvent}):this.popupService.positionPopupByComponent({...e,eventSource:this.parentComp.getGui(),position:"under",keepWithinBounds:!0,nudgeY:5})}destroyTooltipComp(){this.tooltipComp.getGui().classList.add("ag-tooltip-hiding");const e=this.tooltipPopupDestroyFunc,t=this.tooltipComp,a=0===this.tooltipTrigger?1e3:0;window.setTimeout((()=>{e(),this.destroyBean(t)}),a),this.clearTooltipListeners(),this.tooltipPopupDestroyFunc=void';
      S = S + ' 0,this.tooltipComp=void 0}clearTooltipListeners(){[this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener,this.tooltipFocusInListener,this.tooltipFocusOutListener].forEach((e=>{e&&e()})),this.tooltipMouseEnterListener=this.tooltipMouseLeaveListener=this.tooltipFocusInListener=this.tooltipFocusOutListener=null}lockService(){e.isLocked=!0,this.interactiveTooltipTimeoutId=window.setTimeout((()=>{this.unlockService(),this.setToDoNothing()}),100)}unlockService(){e.isLocked=!1,this.clearInteractiveTimeout()}startHideTimeout(){this.clearHideTimeout(),this.hideTooltipTimeoutId=window.setTimeout(this.hideTooltip.bind(this),this.getTooltipDelay("hide"))}clearShowTimeout(){this.showTooltipTimeoutId&&(window.clearTimeout(this.showTooltipTimeoutId),this.showTooltipTimeoutId=void 0)}clearHideTimeout(){this.hideTooltipTimeoutId&&(window.clearTimeout(this.hideTooltipTimeoutId),this.hideTooltipTimeoutId=void 0)}clearInteractiveTimeout(){this.interactiveTooltipTimeoutId&&(window.clearTimeout(this.interactiveTooltipTimeoutId),this.interactiveTooltipTimeoutId=void 0)}clearTimeouts(){this.clearShowTimeout(),this.clearHideTimeout(),this.clearInteractiveTimeout()}};La.isLocked=!1;var Oa=La,Na=class extends A{constructor(e,t){super(),this.ctrl=e,t&&(this.beans=t)}wireBeans(e){this.beans=e}postConstruct(){this.refreshToolTip()}setBrowserTooltip(e){const t="title",a=this.ctrl.getGui();a&&(null!=e&&""!=e?a.setAttribute(t,e):a.removeAttribute(t))}updateTooltipText(){this.tooltip=this.ctrl.getTooltipValue()}createTooltipFeatureIfNeeded(){if(null!=this.tooltipManager)return;const e={getTooltipParams:()=>this.getTooltipParams(),getGui:()=>this.ctrl.getGui()};this.tooltipManager=this.createBean(new Oa(e,this.ctrl.getTooltipShowDelayOverride?.(),this.ctrl.getTooltipHideDelayOverride?.(),this.ctrl.shouldDisplayTooltip),this.beans.context)}refreshToolTip(){this.browserTooltips=this.beans.gos.get("enableBrowserTooltips"),this.updateTooltipText(),this.browserTooltips?(this.setBrowserTooltip(thi';
      S = S + 's.tooltip),this.tooltipManager&&(this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context))):(this.setBrowserTooltip(null),this.createTooltipFeatureIfNeeded())}getTooltipParams(){const e=this.ctrl,t=e.getColumn?e.getColumn():void 0,a=e.getColDef?e.getColDef():void 0,n=e.getRowNode?e.getRowNode():void 0;return{location:e.getLocation(),colDef:a,column:t,rowIndex:e.getRowIndex?e.getRowIndex():void 0,node:n,data:n?n.data:void 0,value:this.getTooltipText(),valueFormatted:e.getValueFormatted?e.getValueFormatted():void 0,hideTooltipCallback:()=>this.tooltipManager?.hideTooltip(!0)}}getTooltipText(){return this.tooltip}destroy(){this.tooltipManager&&(this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context)),super.destroy()}},Ga=new Ia,qa=null,Ba=class e extends A{constructor(e,t){super(),this.suppressDataRefValidation=!1,this.displayed=!0,this.visible=!0,this.compId=Ga.next(),this.cssClassManager=new ft((()=>this.eGui)),this.componentSelectors=new Map((t??[]).map((e=>[e.selector,e]))),e&&this.setTemplate(e)}preWireBeans(e){super.preWireBeans(e)}preConstruct(){this.usingBrowserTooltips=this.gos.get("enableBrowserTooltips"),this.wireTemplate(this.getGui())}wireTemplate(e,t){e&&this.gos&&(this.applyElementsToComponent(e),this.createChildComponentsFromTags(e,t))}getCompId(){return this.compId}getTooltipParams(){return{value:this.tooltipText,location:"UNKNOWN"}}setTooltip(e){const{newTooltipText:t,showDelayOverride:a,hideDelayOverride:n,location:o,shouldDisplayTooltip:r}=e||{};this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),this.tooltipText!==t&&(this.tooltipText=t);const i=()=>this.tooltipText;null!=t&&(this.tooltipFeature=this.createBean(new Na({getTooltipValue:i,getGui:()=>this.getGui(),getLocation:()=>o??"UNKNOWN",getColDef:e?.getColDef,getColumn:e?.getColumn,getTooltipShowDelayOverride:null!=a?()=>a:void 0,getTooltipHideDelayOverride:null!=n?()=>n:void 0,shouldDisplayTooltip:r})))}applyElementsToCompone';
      S = S + 'nt(e,t,a,n=null){if(void 0===t&&(t=e.getAttribute("data-ref")),t){const o=this[t];if(o===qa)this[t]=n??e;else{const e=a&&a[t];this.suppressDataRefValidation||e||ce(`Issue with data-ref: ${t} on ${this.constructor.name} with ${o}`)}}}createChildComponentsFromTags(e,t){(function(e){if(null==e)return[];const t=[];return Aa(e,(e=>t.push(e))),t})(e.childNodes).forEach((a=>{if(!(a instanceof HTMLElement))return;const n=this.createComponentFromElement(a,(e=>{e.getGui()&&this.copyAttributesFromNode(a,e.getGui())}),t);if(n){if(n.addItems&&a.children.length){this.createChildComponentsFromTags(a,t);const e=Array.prototype.slice.call(a.children);n.addItems(e)}this.swapComponentForNode(n,e,a)}else a.childNodes&&this.createChildComponentsFromTags(a,t)}))}createComponentFromElement(t,a,n){const o=t.nodeName,r=t.getAttribute("data-ref"),i=0===o.indexOf("AG-"),s=i?this.componentSelectors.get(o):null;let l=null;if(s){e.elementGettingCreated=t;const o=n&&r?n[r]:void 0;l=new s.component(o),l.setParentComponent(this),this.createBean(l,null,a)}else i&&ce(`Missing selector: ${o}`);return this.applyElementsToComponent(t,r,n,l),l}copyAttributesFromNode(e,t){!function(e,t){if(e)for(let a=0;a<e.length;a++){const n=e[a];t(n.name,n.value)}}(e.attributes,((e,a)=>t.setAttribute(e,a)))}swapComponentForNode(e,t,a){const n=e.getGui();t.replaceChild(n,a),t.insertBefore(document.createComment(a.nodeName),n),this.addDestroyFunc(this.destroyBean.bind(this,e))}activateTabIndex(e){const t=this.gos.get("tabIndex");e||(e=[]),e.length||e.push(this.getGui()),e.forEach((e=>e.setAttribute("tabindex",t.toString())))}setTemplate(e,t,a){const n=Sa(e);this.setTemplateFromElement(n,t,a)}setTemplateFromElement(e,t,a,n=!1){if(this.eGui=e,this.suppressDataRefValidation=n,t)for(let e=0;e<t.length;e++){const a=t[e];this.componentSelectors.set(a.selector,a)}this.wireTemplate(e,a)}getGui(){return this.eGui}getFocusableElement(){return this.eGui}getAriaElement(){return this.getFocusableElement()}setParentComponent(e){this.p';
      S = S + 'arentComponent=e}getParentComponent(){return this.parentComponent}setGui(e){this.eGui=e}queryForHtmlElement(e){return this.eGui.querySelector(e)}getContainerAndElement(e,t){let a=t;return null==e?null:(a||(a=this.eGui),Ea(e)?{element:e,parent:a}:{element:e.getGui(),parent:a})}prependChild(e,t){const{element:a,parent:n}=this.getContainerAndElement(e,t)||{};a&&n&&n.insertAdjacentElement("afterbegin",a)}appendChild(e,t){const{element:a,parent:n}=this.getContainerAndElement(e,t)||{};a&&n&&n.appendChild(a)}isDisplayed(){return this.displayed}setVisible(e,t={}){if(e!==this.visible){this.visible=e;const{skipAriaHidden:a}=t;ia(this.eGui,e,{skipAriaHidden:a})}}setDisplayed(e,t={}){if(e!==this.displayed){this.displayed=e;const{skipAriaHidden:a}=t;ra(this.eGui,e,{skipAriaHidden:a});const n={type:"displayChanged",visible:this.displayed};this.dispatchLocalEvent(n)}}destroy(){this.parentComponent&&(this.parentComponent=void 0),this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),super.destroy()}addGuiEventListener(e,t,a){this.eGui.addEventListener(e,t,a),this.addDestroyFunc((()=>this.eGui.removeEventListener(e,t)))}addCssClass(e){this.cssClassManager.addCssClass(e)}removeCssClass(e){this.cssClassManager.removeCssClass(e)}containsCssClass(e){return this.cssClassManager.containsCssClass(e)}addOrRemoveCssClass(e,t){this.cssClassManager.addOrRemoveCssClass(e,t)}},Ha={columnGroupOpened:"expanded",columnGroupClosed:"contracted",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",columnSelectIndeterminate:"tree-indeterminate",columnMovePin:"pin",columnMoveHide:"eye-slash",columnMoveMove:"arrows",columnMoveLeft:"left",columnMoveRight:"right",columnMoveGroup:"group",columnMoveValue:"aggregation",columnMovePivot:"pivot",dropNotAllowed:"not-allowed",groupContracted:"tree-closed",groupExpanded:"tree-open",setFilterGroupClosed:"tree-closed",setFilterGroupOpen:"tree-open",setFilterGroupIndeterminate:"tree-indeterminate",chart:"chart",close:"cross",cancel:"';
      S = S + 'cancel",check:"tick",first:"first",previous:"previous",next:"next",last:"last",linked:"linked",unlinked:"unlinked",colorPicker:"color-picker",groupLoading:"loading",menu:"menu",menuAlt:"menu-alt",filter:"filter",columns:"columns",maximize:"maximize",minimize:"minimize",menuPin:"pin",menuValue:"aggregation",menuAddRowGroup:"group",menuRemoveRowGroup:"group",clipboardCopy:"copy",clipboardCut:"cut",clipboardPaste:"paste",pivotPanel:"pivot",rowGroupPanel:"group",valuePanel:"aggregation",columnDrag:"grip",rowDrag:"grip",save:"save",csvExport:"csv",excelExport:"excel",smallDown:"small-down",smallLeft:"small-left",smallRight:"small-right",smallUp:"small-up",sortAscending:"asc",sortDescending:"desc",sortUnSort:"none",advancedFilterBuilder:"group",advancedFilterBuilderDrag:"grip",advancedFilterBuilderInvalid:"not-allowed",advancedFilterBuilderMoveUp:"up",advancedFilterBuilderMoveDown:"down",advancedFilterBuilderAdd:"plus",advancedFilterBuilderRemove:"minus",chartsMenuEdit:"chart",chartsMenuAdvancedSettings:"settings",chartsMenuAdd:"plus",checkboxChecked:"checkbox-checked",checkboxIndeterminate:"checkbox-indeterminate",checkboxUnchecked:"checkbox-unchecked",radioButtonOn:"radio-button-on",radioButtonOff:"radio-button-off"};function Va(e,t,a){const n=Wa(e,t,a);if(n){const{className:e}=n;if("string"==typeof e&&e.indexOf("ag-icon")>-1||"object"==typeof e&&e["ag-icon"])return n}const o=document.createElement("span");return o.appendChild(n),o}function Wa(e,t,a,n){let o=null;const r=a&&a.getColDef().icons;if(r&&(o=r[e]),t&&!o){const a=t.get("icons");a&&(o=a[e])}if(!o){const t=document.createElement("span");let a=Ha[e];return a||(n?a=e:(ce(`Did not find icon ${e}`),a="")),t.setAttribute("class",`ag-icon ag-icon-${a}`),t.setAttribute("unselectable","on"),yt(t,"presentation"),t}{let e;if("function"==typeof o)e=o();else{if("string"!=typeof o)throw new Error("icon from grid options needs to be a string or a function");e=o}if("string"==typeof e)return Sa(e);if(Ea(e))return e;ce("iconRend';
      S = S + 'erer should return back a string or a dom object")}}function Ua(e,t,a){if(0===a)return!1;const n=Math.abs(e.clientX-t.clientX),o=Math.abs(e.clientY-t.clientY);return Math.max(n,o)<=a}var ja=class{constructor(e,t=!1){this.DOUBLE_TAP_MILLIS=500,this.destroyFuncs=[],this.touching=!1,this.localEventService=new c,this.eElement=e,this.preventMouseClick=t;const a=this.onTouchStart.bind(this),n=this.onTouchMove.bind(this),o=this.onTouchEnd.bind(this);this.eElement.addEventListener("touchstart",a,{passive:!0}),this.eElement.addEventListener("touchmove",n,{passive:!0}),this.eElement.addEventListener("touchend",o,{passive:!1}),this.destroyFuncs.push((()=>{this.eElement.removeEventListener("touchstart",a,{passive:!0}),this.eElement.removeEventListener("touchmove",n,{passive:!0}),this.eElement.removeEventListener("touchend",o,{passive:!1})}))}getActiveTouch(e){for(let t=0;t<e.length;t++){if(e[t].identifier===this.touchStart.identifier)return e[t]}return null}addEventListener(e,t){this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService.removeEventListener(e,t)}onTouchStart(e){if(this.touching)return;this.touchStart=e.touches[0],this.touching=!0,this.moved=!1;const t=this.touchStart;window.setTimeout((()=>{const a=this.touchStart===t;if(this.touching&&a&&!this.moved){this.moved=!0;const t={type:"longTap",touchStart:this.touchStart,touchEvent:e};this.localEventService.dispatchEvent(t)}}),500)}onTouchMove(e){if(!this.touching)return;const t=this.getActiveTouch(e.touches);if(!t)return;!Ua(t,this.touchStart,4)&&(this.moved=!0)}onTouchEnd(e){if(this.touching){if(!this.moved){const e={type:"tap",touchStart:this.touchStart};this.localEventService.dispatchEvent(e),this.checkForDoubleTap()}this.preventMouseClick&&e.cancelable&&e.preventDefault(),this.touching=!1}}checkForDoubleTap(){const e=(new Date).getTime();if(this.lastTapTime&&this.lastTapTime>0){if(e-this.lastTapTime>this.DOUBLE_TAP_MILLIS){const e={type:"doubleTap",touchStart:this.touchStart};thi';
      S = S + 's.localEventService.dispatchEvent(e),this.lastTapTime=null}else this.lastTapTime=e}else this.lastTapTime=e}destroy(){this.destroyFuncs.forEach((e=>e()))}},Ka=class extends Ba{constructor(e){super(),this.eSortOrder=qa,this.eSortAsc=qa,this.eSortDesc=qa,this.eSortMixed=qa,this.eSortNone=qa,e||this.setTemplate(\'<span class="ag-sort-indicator-container">\\n        <span data-ref="eSortOrder" class="ag-sort-indicator-icon ag-sort-order ag-hidden" aria-hidden="true"></span>\\n        <span data-ref="eSortAsc" class="ag-sort-indicator-icon ag-sort-ascending-icon ag-hidden" aria-hidden="true"></span>\\n        <span data-ref="eSortDesc" class="ag-sort-indicator-icon ag-sort-descending-icon ag-hidden" aria-hidden="true"></span>\\n        <span data-ref="eSortMixed" class="ag-sort-indicator-icon ag-sort-mixed-icon ag-hidden" aria-hidden="true"></span>\\n        <span data-ref="eSortNone" class="ag-sort-indicator-icon ag-sort-none-icon ag-hidden" aria-hidden="true"></span>\\n    </span>\')}wireBeans(e){this.sortController=e.sortController}attachCustomElements(e,t,a,n,o){this.eSortOrder=e,this.eSortAsc=t,this.eSortDesc=a,this.eSortMixed=n,this.eSortNone=o}setupSort(e,t=!1){this.column=e,this.suppressOrder=t,this.setupMultiSortIndicator(),(this.column.isSortable()||this.column.getColDef().showRowGroup)&&(this.addInIcon("sortAscending",this.eSortAsc,e),this.addInIcon("sortDescending",this.eSortDesc,e),this.addInIcon("sortUnSort",this.eSortNone,e),this.addManagedPropertyListener("unSortIcon",(()=>this.updateIcons())),this.addManagedEventListeners({newColumnsLoaded:this.updateIcons.bind(this),sortChanged:this.onSortChanged.bind(this),columnRowGroupChanged:this.onSortChanged.bind(this)}),this.onSortChanged())}addInIcon(e,t,a){if(null==t)return;const n=Wa(e,this.gos,a);n&&t.appendChild(n)}onSortChanged(){this.updateIcons(),this.suppressOrder||this.updateSortOrder()}updateIcons(){const e=this.sortController.getDisplaySortForColumn(this.column);if(this.eSortAsc){const t="asc"===e;ra(this.eSor';
      S = S + 'tAsc,t,{skipAriaHidden:!0})}if(this.eSortDesc){const t="desc"===e;ra(this.eSortDesc,t,{skipAriaHidden:!0})}if(this.eSortNone){const t=!this.column.getColDef().unSortIcon&&!this.gos.get("unSortIcon"),a=null==e;ra(this.eSortNone,!t&&a,{skipAriaHidden:!0})}}setupMultiSortIndicator(){this.addInIcon("sortUnSort",this.eSortMixed,this.column);const e=this.column.getColDef().showRowGroup;this.gos.isColumnsSortingCoupledToGroup()&&e&&(this.addManagedEventListeners({sortChanged:this.updateMultiSortIndicator.bind(this),columnRowGroupChanged:this.updateMultiSortIndicator.bind(this)}),this.updateMultiSortIndicator())}updateMultiSortIndicator(){if(this.eSortMixed){const e="mixed"===this.sortController.getDisplaySortForColumn(this.column);ra(this.eSortMixed,e,{skipAriaHidden:!0})}}updateSortOrder(){if(!this.eSortOrder)return;const e=this.sortController.getColumnsWithSortingOrdered(),t=this.sortController.getDisplaySortIndexForColumn(this.column)??-1,a=e.some((e=>this.sortController.getDisplaySortIndexForColumn(e)??!1)),n=t>=0&&a;ra(this.eSortOrder,n,{skipAriaHidden:!0}),t>=0?this.eSortOrder.textContent=(t+1).toString():ba(this.eSortOrder)}},Qa={selector:"AG-SORT-INDICATOR",component:Ka},Ya=class extends Ba{constructor(){super(...arguments),this.eFilter=qa,this.eFilterButton=qa,this.eSortIndicator=qa,this.eMenu=qa,this.eLabel=qa,this.eText=qa,this.eSortOrder=qa,this.eSortAsc=qa,this.eSortDesc=qa,this.eSortMixed=qa,this.eSortNone=qa,this.lastMovingChanged=0}wireBeans(e){this.sortController=e.sortController,this.menuService=e.menuService,this.funcColsService=e.funcColsService}destroy(){super.destroy()}refresh(e){const t=this.params;return this.params=e,this.workOutTemplate()==this.currentTemplate&&this.workOutShowMenu()==this.currentShowMenu&&this.workOutSort()==this.currentSort&&this.shouldSuppressMenuHide()==this.currentSuppressMenuHide&&t.enableFilterButton==e.enableFilterButton&&t.enableFilterIcon==e.enableFilterIcon&&(this.setDisplayName(e),!0)}workOutTemplate(){let e=this.param';
      S = S + 's.template??\'<div class="ag-cell-label-container" role="presentation">\\n        <span data-ref="eMenu" class="ag-header-icon ag-header-cell-menu-button" aria-hidden="true"></span>\\n        <span data-ref="eFilterButton" class="ag-header-icon ag-header-cell-filter-button" aria-hidden="true"></span>\\n        <div data-ref="eLabel" class="ag-header-cell-label" role="presentation">\\n            <span data-ref="eText" class="ag-header-cell-text"></span>\\n            <span data-ref="eFilter" class="ag-header-icon ag-header-label-icon ag-filter-icon" aria-hidden="true"></span>\\n            <ag-sort-indicator data-ref="eSortIndicator"></ag-sort-indicator>\\n        </div>\\n    </div>\';return e=e&&e.trim?e.trim():e,e}init(e){this.params=e,this.currentTemplate=this.workOutTemplate(),this.setTemplate(this.currentTemplate,[Qa]),this.setupTap(),this.setMenu(),this.setupSort(),this.setupFilterIcon(),this.setupFilterButton(),this.setDisplayName(e)}setDisplayName(e){if(this.currentDisplayName!=e.displayName){this.currentDisplayName=e.displayName;const t=He(this.currentDisplayName,!0);this.eText&&(this.eText.textContent=t)}}addInIcon(e,t,a){if(null==t)return;const n=Wa(e,this.gos,a);n&&t.appendChild(n)}setupTap(){const{gos:e}=this;if(e.get("suppressTouch"))return;const t=new ja(this.getGui(),!0),a=this.shouldSuppressMenuHide(),n=a&&L(this.eMenu),o=n?new ja(this.eMenu,!0):t;if(this.params.enableMenu){const e=n?"tap":"longTap",t=e=>this.params.showColumnMenuAfterMouseClick(e.touchStart);this.addManagedListeners(o,{[e]:t})}if(this.params.enableSorting){const e=e=>{const t=e.touchStart.target;a&&(this.eMenu?.contains(t)||this.eFilterButton?.contains(t))||this.sortController.progressSort(this.params.column,!1,"uiColumnSorted")};this.addManagedListeners(t,{tap:e})}if(this.params.enableFilterButton){const e=new ja(this.eFilterButton,!0);this.addManagedListeners(e,{tap:()=>this.params.showFilter(this.eFilterButton)}),this.addDestroyFunc((()=>e.destroy()))}this.addDestroyFunc((()=>t.destroy()';
      S = S + ')),n&&this.addDestroyFunc((()=>o.destroy()))}workOutShowMenu(){return this.params.enableMenu&&this.menuService.isHeaderMenuButtonEnabled()}shouldSuppressMenuHide(){return this.menuService.isHeaderMenuButtonAlwaysShowEnabled()}setMenu(){if(!this.eMenu)return;if(this.currentShowMenu=this.workOutShowMenu(),!this.currentShowMenu)return Ca(this.eMenu),void(this.eMenu=void 0);const e=this.menuService.isLegacyMenuEnabled();this.addInIcon(e?"menu":"menuAlt",this.eMenu,this.params.column),this.eMenu.classList.toggle("ag-header-menu-icon",!e),this.currentSuppressMenuHide=this.shouldSuppressMenuHide(),this.addManagedElementListeners(this.eMenu,{click:()=>this.params.showColumnMenu(this.eMenu)}),this.eMenu.classList.toggle("ag-header-menu-always-show",this.currentSuppressMenuHide)}onMenuKeyboardShortcut(e){const t=this.params.column,a=this.menuService.isLegacyMenuEnabled();if(e&&!a){if(this.menuService.isFilterMenuInHeaderEnabled(t))return this.params.showFilter(this.eFilterButton??this.eMenu??this.getGui()),!0}else if(this.params.enableMenu)return this.params.showColumnMenu(this.eMenu??this.eFilterButton??this.getGui()),!0;return!1}workOutSort(){return this.params.enableSorting}setupSort(){if(this.currentSort=this.params.enableSorting,this.eSortIndicator||(this.eSortIndicator=this.createBean(new Ka(!0)),this.eSortIndicator.attachCustomElements(this.eSortOrder,this.eSortAsc,this.eSortDesc,this.eSortMixed,this.eSortNone)),this.eSortIndicator.setupSort(this.params.column),!this.currentSort)return;this.addManagedListeners(this.params.column,{movingChanged:()=>{this.lastMovingChanged=(new Date).getTime()}}),this.eLabel&&this.addManagedElementListeners(this.eLabel,{click:e=>{const t=this.params.column.isMoving(),a=(new Date).getTime()-this.lastMovingChanged<50;if(!(t||a)){const t="ctrl"===this.gos.get("multiSortKey")?e.ctrlKey||e.metaKey:e.shiftKey;this.params.progressSort(t)}}});const e=()=>{const e=this.params.column.getSort();if(this.addOrRemoveCssClass("ag-header-cell-sorted-asc';
      S = S + '","asc"===e),this.addOrRemoveCssClass("ag-header-cell-sorted-desc","desc"===e),this.addOrRemoveCssClass("ag-header-cell-sorted-none",!e),this.params.column.getColDef().showRowGroup){const e=this.funcColsService.getSourceColumnsForGroupColumn(this.params.column),t=e?.every((e=>this.params.column.getSort()==e.getSort())),a=!t;this.addOrRemoveCssClass("ag-header-cell-sorted-mixed",a)}};this.addManagedEventListeners({sortChanged:e,columnRowGroupChanged:e})}setupFilterIcon(){this.eFilter&&this.configureFilter(this.params.enableFilterIcon,this.eFilter,this.onFilterChangedIcon.bind(this))}setupFilterButton(){if(!this.eFilterButton)return;this.configureFilter(this.params.enableFilterButton,this.eFilterButton,this.onFilterChangedButton.bind(this))?this.addManagedElementListeners(this.eFilterButton,{click:()=>this.params.showFilter(this.eFilterButton)}):this.eFilterButton=void 0}configureFilter(e,t,a){if(!e)return Ca(t),!1;const n=this.params.column;return this.addInIcon("filter",t,n),this.addManagedListeners(n,{filterChanged:a}),a(),!0}onFilterChangedIcon(){const e=this.params.column.isFilterActive();ra(this.eFilter,e,{skipAriaHidden:!0})}onFilterChangedButton(){const e=this.params.column.isFilterActive();this.eFilterButton.classList.toggle("ag-filter-active",e)}getAnchorElementForMenu(e){return e?this.eFilterButton??this.eMenu??this.getGui():this.eMenu??this.eFilterButton??this.getGui()}},_a=class extends Ba{constructor(){super(\'<div class="ag-header-group-cell-label" role="presentation">\\n            <span data-ref="agLabel" class="ag-header-group-text" role="presentation"></span>\\n            <span data-ref="agOpened" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-expanded"></span>\\n            <span data-ref="agClosed" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-collapsed"></span>\\n        </div>\'),this.agOpened=qa,this.agClosed=qa,this.agLabel=qa}wireBeans(e){this.columnModel=e.columnModel}destroy(){super.destroy()}init(e){this.p';
      S = S + 'arams=e,this.checkWarnings(),this.setupLabel(),this.addGroupExpandIcon(),this.setupExpandIcons()}checkWarnings(){this.params.template&&ce("A template was provided for Header Group Comp - templates are only supported for Header Comps (not groups)")}setupExpandIcons(){this.addInIcon("columnGroupOpened",this.agOpened),this.addInIcon("columnGroupClosed",this.agClosed);const e=e=>{if(M(e))return;const t=!this.params.columnGroup.isExpanded();this.columnModel.setColumnGroupOpened(this.params.columnGroup.getProvidedColumnGroup(),t,"uiColumnExpanded")};this.addTouchAndClickListeners(this.agClosed,e),this.addTouchAndClickListeners(this.agOpened,e);const t=e=>{F(e)};this.addManagedElementListeners(this.agClosed,{dblclick:t}),this.addManagedElementListeners(this.agOpened,{dblclick:t}),this.addManagedElementListeners(this.getGui(),{dblclick:e}),this.updateIconVisibility();const a=this.params.columnGroup.getProvidedColumnGroup(),n=this.updateIconVisibility.bind(this);this.addManagedListeners(a,{expandedChanged:n,expandableChanged:n})}addTouchAndClickListeners(e,t){const a=new ja(e,!0);this.addManagedListeners(a,{tap:t}),this.addDestroyFunc((()=>a.destroy())),this.addManagedElementListeners(e,{click:t})}updateIconVisibility(){if(this.params.columnGroup.isExpandable()){const e=this.params.columnGroup.isExpanded();ra(this.agOpened,e),ra(this.agClosed,!e)}else ra(this.agOpened,!1),ra(this.agClosed,!1)}addInIcon(e,t){const a=Wa(e,this.gos,null);a&&t.appendChild(a)}addGroupExpandIcon(){if(!this.params.columnGroup.isExpandable())return ra(this.agOpened,!1),void ra(this.agClosed,!1)}setupLabel(){const{displayName:e,columnGroup:t}=this.params;if(L(e)){const t=He(e,!0);this.agLabel.textContent=t}this.addOrRemoveCssClass("ag-sticky-label",!t.getColGroupDef()?.suppressStickyLabel)}},Ja=(e=>(e.CommunityCoreModule="@ag-grid-community/core",e.InfiniteRowModelModule="@ag-grid-community/infinite-row-model",e.ClientSideRowModelModule="@ag-grid-community/client-side-row-model",e.CsvExportModule="@a';
      S = S + 'g-grid-community/csv-export",e.EnterpriseCoreModule="@ag-grid-enterprise/core",e.RowGroupingModule="@ag-grid-enterprise/row-grouping",e.ColumnsToolPanelModule="@ag-grid-enterprise/column-tool-panel",e.FiltersToolPanelModule="@ag-grid-enterprise/filter-tool-panel",e.MenuModule="@ag-grid-enterprise/menu",e.SetFilterModule="@ag-grid-enterprise/set-filter",e.MultiFilterModule="@ag-grid-enterprise/multi-filter",e.StatusBarModule="@ag-grid-enterprise/status-bar",e.SideBarModule="@ag-grid-enterprise/side-bar",e.RangeSelectionModule="@ag-grid-enterprise/range-selection",e.MasterDetailModule="@ag-grid-enterprise/master-detail",e.RichSelectModule="@ag-grid-enterprise/rich-select",e.GridChartsModule="@ag-grid-enterprise/charts",e.ViewportRowModelModule="@ag-grid-enterprise/viewport-row-model",e.ServerSideRowModelModule="@ag-grid-enterprise/server-side-row-model",e.ExcelExportModule="@ag-grid-enterprise/excel-export",e.ClipboardModule="@ag-grid-enterprise/clipboard",e.SparklinesModule="@ag-grid-enterprise/sparklines",e.AdvancedFilterModule="@ag-grid-enterprise/advanced-filter",e.AngularModule="@ag-grid-community/angular",e.ReactModule="@ag-grid-community/react",e.VueModule="@ag-grid-community/vue",e))(Ja||{}),Za=class e{static register(t){e.__register(t,!0,void 0)}static registerModules(t){e.__registerModules(t,!0,void 0)}static __register(t,a,n){e.runVersionChecks(t),void 0!==n?(e.areGridScopedModules=!0,void 0===e.gridModulesMap[n]&&(e.gridModulesMap[n]={}),e.gridModulesMap[n][t.moduleName]=t):e.globalModulesMap[t.moduleName]=t,e.setModuleBased(a)}static __unRegisterGridModules(t){delete e.gridModulesMap[t]}static __registerModules(t,a,n){e.setModuleBased(a),t&&t.forEach((t=>e.__register(t,a,n)))}static isValidModuleVersion(t){const[a,n]=t.version.split(".")||[],[o,r]=e.currentModuleVersion.split(".")||[];return a===o&&n===r}static runVersionChecks(t){e.currentModuleVersion||(e.currentModuleVersion=t.version);const a=e=>`You are using incompatible versions of AG Grid modules.';
      S = S + ' Major and minor versions should always match across modules. ${e} Please update all modules to the same version.`;if(t.version?e.isValidModuleVersion(t)||ge(a(`\'${t.moduleName}\' is version ${t.version} but the other modules are version ${e.currentModuleVersion}.`)):ge(a(`\'${t.moduleName}\' is incompatible.`)),t.validate){const e=t.validate();if(!e.isValid){ge(`${e.message}`)}}}static setModuleBased(t){void 0===e.moduleBased?e.moduleBased=t:e.moduleBased!==t&&(ge("AG Grid: You are mixing modules (i.e. @ag-grid-community/core) and packages (ag-grid-community) - you can only use one or the other of these mechanisms."),ge("Please see https://www.ag-grid.com/javascript-grid/modules/ for more information."))}static __setIsBundled(){e.isBundled=!0}static __assertRegistered(t,a,n){if(this.__isRegistered(t,n))return!0;let o;if(e.isBundled)o=`AG Grid: unable to use ${a} as \'ag-grid-enterprise\' has not been loaded. Check you are using the Enterprise bundle:\\n        \\n        <script src="https://cdn.jsdelivr.net/npm/ag-grid-enterprise@AG_GRID_VERSION/dist/ag-grid-enterprise.min.js"><\\/script>\\n        \\nFor more info see: https://ag-grid.com/javascript-data-grid/getting-started/#getting-started-with-ag-grid-enterprise`;else if(e.moduleBased||void 0===e.moduleBased){const r=Object.entries(Ja).find((([e,a])=>a===t))?.[0];o=`AG Grid: unable to use ${a} as the ${r} is not registered${e.areGridScopedModules?` for gridId: ${n}`:""}. Check if you have registered the module:\\n           \\n    import { ModuleRegistry } from \'@ag-grid-community/core\';\\n    import { ${r} } from \'${t}\';\\n    \\n    ModuleRegistry.registerModules([ ${r} ]);\\n\\nFor more info see: https://www.ag-grid.com/javascript-grid/modules/`}else o=`AG Grid: unable to use ${a} as package \'ag-grid-enterprise\' has not been imported. Check that you have imported the package:\\n            \\n    import \'ag-grid-enterprise\';`;return ge(o),!1}static __isRegistered(t,a){return!!e.globalModulesMap[t]||!!e.gridModulesMap[a]?.[t]}';
      S = S + 'static __getRegisteredModules(t){return[...U(e.globalModulesMap),...U(e.gridModulesMap[t]||{})]}static __getGridRegisteredModules(t){return U(e.gridModulesMap[t]??{})||[]}static __isPackageBased(){return!e.moduleBased}};Za.globalModulesMap={},Za.gridModulesMap={},Za.areGridScopedModules=!1;var Xa=Za,$a=class extends Ba{constructor(){super(),this.refreshCount=0;const e=document.createElement("span"),t=document.createElement("span");t.setAttribute("class","ag-value-change-delta");const a=document.createElement("span");a.setAttribute("class","ag-value-change-value"),e.appendChild(t),e.appendChild(a),this.setTemplateFromElement(e)}wireBeans(e){this.filterManager=e.filterManager}init(e){this.eValue=this.queryForHtmlElement(".ag-value-change-value"),this.eDelta=this.queryForHtmlElement(".ag-value-change-delta"),this.refresh(e,!0)}showDelta(e,t){const a=Math.abs(t),n=e.formatValue(a),o=L(n)?n:a,r=t>=0;this.eDelta.textContent=r?"↑"+o:"↓"+o,this.eDelta.classList.toggle("ag-value-change-delta-up",r),this.eDelta.classList.toggle("ag-value-change-delta-down",!r)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.getFrameworkOverrides().wrapIncoming((()=>{window.setTimeout((()=>{e===this.refreshCount&&this.hideDeltaValue()}),2e3)}))}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),ba(this.eDelta)}refresh(e,t=!1){const a=e.value;if(a===this.lastValue)return!1;if(L(e.valueFormatted)?this.eValue.textContent=e.valueFormatted:L(e.value)?this.eValue.textContent=a:ba(this.eValue),this.filterManager?.isSuppressFlashingCellsBecauseFiltering())return!1;if("number"==typeof a&&"number"==typeof this.lastValue){const t=a-this.lastValue;this.showDelta(e,t)}return this.lastValue&&this.eValue.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=a,!0}},en=class extends Ba{constructor(){super(),this.refreshCount=0;const e=document.createElement("span"),t=document.createElement("span");t.setAttrib';
      S = S + 'ute("class","ag-value-slide-current"),e.appendChild(t),this.setTemplateFromElement(e),this.eCurrent=this.queryForHtmlElement(".ag-value-slide-current")}wireBeans(e){this.filterManager=e.filterManager}init(e){this.refresh(e,!0)}addSlideAnimation(){this.refreshCount++;const e=this.refreshCount;this.ePrevious&&this.getGui().removeChild(this.ePrevious);const t=document.createElement("span");t.setAttribute("class","ag-value-slide-previous ag-value-slide-out"),this.ePrevious=t,this.ePrevious.textContent=this.eCurrent.textContent,this.getGui().insertBefore(this.ePrevious,this.eCurrent),this.getFrameworkOverrides().wrapIncoming((()=>{window.setTimeout((()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")}),50),window.setTimeout((()=>{e===this.refreshCount&&(this.getGui().removeChild(this.ePrevious),this.ePrevious=null)}),3e3)}))}refresh(e,t=!1){let a=e.value;return O(a)&&(a=""),a!==this.lastValue&&(!this.filterManager?.isSuppressFlashingCellsBecauseFiltering()&&(t||this.addSlideAnimation(),this.lastValue=a,L(e.valueFormatted)?this.eCurrent.textContent=e.valueFormatted:L(e.value)?this.eCurrent.textContent=a:ba(this.eCurrent),!0))}},tn=class{};tn.BACKSPACE="Backspace",tn.TAB="Tab",tn.ENTER="Enter",tn.ESCAPE="Escape",tn.SPACE=" ",tn.LEFT="ArrowLeft",tn.UP="ArrowUp",tn.RIGHT="ArrowRight",tn.DOWN="ArrowDown",tn.DELETE="Delete",tn.F2="F2",tn.PAGE_UP="PageUp",tn.PAGE_DOWN="PageDown",tn.PAGE_HOME="Home",tn.PAGE_END="End",tn.A="KeyA",tn.C="KeyC",tn.D="KeyD",tn.V="KeyV",tn.X="KeyX",tn.Y="KeyY",tn.Z="KeyZ";var an=class extends Ba{constructor(e,t,a){super(t,a),this.labelSeparator="",this.labelAlignment="left",this.disabled=!1,this.label="",this.config=e||{}}postConstruct(){this.addCssClass("ag-labeled"),this.eLabel.classList.add("ag-label");const{labelSeparator:e,label:t,labelWidth:a,labelAlignment:n,disabled:o}=this.config;null!=o&&this.setDisabled(o),null!=e&&this.setLabelSeparator(e),null!=t&&this.setLabel(t),null!=a&&this.setLabelWidth(a),this.setLabel';
      S = S + 'Alignment(n||this.labelAlignment),this.refreshLabel()}refreshLabel(){ba(this.eLabel),"string"==typeof this.label?this.eLabel.innerText=this.label+this.labelSeparator:this.label&&this.eLabel.appendChild(this.label),""===this.label?(ra(this.eLabel,!1),yt(this.eLabel,"presentation")):(ra(this.eLabel,!0),yt(this.eLabel,null))}setLabelSeparator(e){return this.labelSeparator===e||(this.labelSeparator=e,null!=this.label&&this.refreshLabel()),this}getLabelId(){return this.eLabel.id=this.eLabel.id||`ag-${this.getCompId()}-label`,this.eLabel.id}getLabel(){return this.label}setLabel(e){return this.label===e||(this.label=e,this.refreshLabel()),this}setLabelAlignment(e){const t=this.getGui().classList;return t.toggle("ag-label-align-left","left"===e),t.toggle("ag-label-align-right","right"===e),t.toggle("ag-label-align-top","top"===e),this}setLabelEllipsis(e){return this.eLabel.classList.toggle("ag-label-ellipsis",e),this}setLabelWidth(e){return null==this.label||za(this.eLabel,e),this}setDisabled(e){e=!!e;const t=this.getGui();return sa(t,e),t.classList.toggle("ag-disabled",e),this.disabled=e,this}isDisabled(){return!!this.disabled}},nn=class extends an{constructor(e,t,a,n){super(e,t,a),this.className=n}postConstruct(){super.postConstruct();const{width:e,value:t,onValueChange:a}=this.config;null!=e&&this.setWidth(e),null!=t&&this.setValue(t),null!=a&&this.onValueChange(a),this.className&&this.addCssClass(this.className),this.refreshAriaLabelledBy()}setLabel(e){return super.setLabel(e),this.refreshAriaLabelledBy(),this}refreshAriaLabelledBy(){const e=this.getAriaElement(),t=this.getLabelId(),a=this.getLabel();null==a||""==a||null!==e.getAttribute("aria-label")?xt(e,""):xt(e,t??"")}setAriaLabel(e){return kt(this.getAriaElement(),e),this.refreshAriaLabelledBy(),this}onValueChange(e){return this.addManagedListeners(this,{fieldValueChanged:()=>e(this.getValue())}),this}getWidth(){return this.getGui().clientWidth}setWidth(e){return Fa(this.getGui(),e),this}getPreviousValue(){return t';
      S = S + 'his.previousValue}getValue(){return this.value}setValue(e,t){return this.value===e||(this.previousValue=this.value,this.value=e,t||this.dispatchLocalEvent({type:"fieldValueChanged"})),this}},on=class extends nn{constructor(e,t,a="text",n="input"){super(e,e?.template??`\\n            <div role="presentation">\\n                <div data-ref="eLabel" class="ag-input-field-label"></div>\\n                <div data-ref="eWrapper" class="ag-wrapper ag-input-wrapper" role="presentation">\\n                    <${n} data-ref="eInput" class="ag-input-field-input"></${n}>\\n                </div>\\n            </div>`,[],t),this.inputType=a,this.displayFieldTag=n,this.eLabel=qa,this.eWrapper=qa,this.eInput=qa}postConstruct(){super.postConstruct(),this.setInputType(),this.eLabel.classList.add(`${this.className}-label`),this.eWrapper.classList.add(`${this.className}-input-wrapper`),this.eInput.classList.add(`${this.className}-input`),this.addCssClass("ag-input-field"),this.eInput.id=this.eInput.id||`ag-${this.getCompId()}-input`;const{inputName:e,inputWidth:t}=this.config;null!=e&&this.setInputName(e),null!=t&&this.setInputWidth(t),this.addInputListeners(),this.activateTabIndex([this.eInput])}addInputListeners(){this.addManagedElementListeners(this.eInput,{input:e=>this.setValue(e.target.value)})}setInputType(){"input"===this.displayFieldTag&&this.eInput.setAttribute("type",this.inputType)}getInputElement(){return this.eInput}setInputWidth(e){return za(this.eWrapper,e),this}setInputName(e){return this.getInputElement().setAttribute("name",e),this}getFocusableElement(){return this.eInput}setMaxLength(e){return this.eInput.maxLength=e,this}setInputPlaceholder(e){return Pa(this.eInput,"placeholder",e),this}setInputAriaLabel(e){return kt(this.eInput,e),this.refreshAriaLabelledBy(),this}setDisabled(e){return sa(this.eInput,e),super.setDisabled(e)}setAutoComplete(e){if(!0===e)Pa(this.eInput,"autocomplete",null);else{const t="string"==typeof e?e:"off";Pa(this.eInput,"autocomplete",t)}retur';
      S = S + 'n this}},rn=class extends on{constructor(e,t="ag-checkbox",a="checkbox"){super(e,t,a),this.labelAlignment="right",this.selected=!1,this.readOnly=!1,this.passive=!1}postConstruct(){super.postConstruct();const{readOnly:e,passive:t}=this.config;"boolean"==typeof e&&this.setReadOnly(e),"boolean"==typeof t&&this.setPassive(t)}addInputListeners(){this.addManagedElementListeners(this.eInput,{click:this.onCheckboxClick.bind(this)}),this.addManagedElementListeners(this.eLabel,{click:this.toggle.bind(this)})}getNextValue(){return void 0===this.selected||!this.selected}setPassive(e){this.passive=e}isReadOnly(){return this.readOnly}setReadOnly(e){this.eWrapper.classList.toggle("ag-disabled",e),this.eInput.disabled=e,this.readOnly=e}setDisabled(e){return this.eWrapper.classList.toggle("ag-disabled",e),super.setDisabled(e)}toggle(){if(this.eInput.disabled)return;const e=this.isSelected(),t=this.getNextValue();this.passive?this.dispatchChange(t,e):this.setValue(t)}getValue(){return this.isSelected()}setValue(e,t){return this.refreshSelectedClass(e),this.setSelected(e,t),this}setName(e){return this.getInputElement().name=e,this}isSelected(){return this.selected}setSelected(e,t){this.isSelected()!==e&&(this.previousValue=this.isSelected(),e=this.selected="boolean"==typeof e?e:void 0,this.eInput.checked=e,this.eInput.indeterminate=void 0===e,t||this.dispatchChange(this.selected,this.previousValue))}dispatchChange(e,t,a){this.dispatchLocalEvent({type:"fieldValueChanged",selected:e,previousValue:t,event:a});const n=this.getInputElement(),o={type:"checkboxChanged",id:n.id,name:n.name,selected:e,previousValue:t};this.eventService.dispatchEvent(o)}onCheckboxClick(e){if(this.passive||this.eInput.disabled)return;const t=this.isSelected(),a=this.selected=e.target.checked;this.refreshSelectedClass(a),this.dispatchChange(a,t,e)}refreshSelectedClass(e){this.eWrapper.classList.toggle("ag-checked",!0===e),this.eWrapper.classList.toggle("ag-indeterminate",null==e)}},sn={selector:"AG-CHECKBOX",comp';
      S = S + 'onent:rn},ln=class extends Ba{constructor(){super(\'\\n            <div class="ag-cell-wrapper ag-checkbox-cell" role="presentation">\\n                <ag-checkbox role="presentation" data-ref="eCheckbox"></ag-checkbox>\\n            </div>\',[sn]),this.eCheckbox=qa}init(e){this.params=e,this.updateCheckbox(e);const t=this.eCheckbox.getInputElement();t.setAttribute("tabindex","-1"),zt(t,"polite"),this.addManagedListeners(t,{click:e=>{if(F(e),this.eCheckbox.isDisabled())return;const t=this.eCheckbox.getValue();this.onCheckboxChanged(t)},dblclick:e=>{F(e)}}),this.addManagedElementListeners(this.params.eGridCell,{keydown:e=>{if(e.key===tn.SPACE&&!this.eCheckbox.isDisabled()){this.params.eGridCell===this.gos.getActiveDomElement()&&this.eCheckbox.toggle();const t=this.eCheckbox.getValue();this.onCheckboxChanged(t),e.preventDefault()}}})}refresh(e){return this.params=e,this.updateCheckbox(e),!0}updateCheckbox(e){let t,a=!0;if(e.node.group&&e.column){const n=e.column.getColId();n.startsWith(ye)?t=null==e.value||""===e.value?void 0:"true"===e.value:e.node.aggData&&void 0!==e.node.aggData[n]?t=e.value??void 0:a=!1}else t=e.value??void 0;if(!a)return void this.eCheckbox.setDisplayed(!1);this.eCheckbox.setValue(t);const n=null!=e.disabled?e.disabled:!e.column?.isCellEditable(e.node);this.eCheckbox.setDisabled(n);const o=this.localeService.getLocaleTextFunc(),r=jt(o,t),i=n?r:`${o("ariaToggleCellValue","Press SPACE to toggle cell value")} (${r})`;this.eCheckbox.setInputAriaLabel(i)}onCheckboxChanged(e){const{column:t,node:a,value:n}=this.params,o={type:"cellEditingStarted",column:t,colDef:t?.getColDef(),data:a.data,node:a,rowIndex:a.rowIndex,rowPinned:a.rowPinned,value:n};this.eventService.dispatchEvent(o);const r=this.params.node.setDataValue(this.params.column,e,"edit"),i={type:"cellEditingStopped",column:t,colDef:t?.getColDef(),data:a.data,node:a,rowIndex:a.rowIndex,rowPinned:a.rowPinned,value:n,oldValue:n,newValue:e,valueChanged:r};this.eventService.dispatchEvent(i)}},cn=class e';
      S = S + 'xtends Ba{constructor(){super(\'<div class="ag-loading">\\n            <span class="ag-loading-icon" data-ref="eLoadingIcon"></span>\\n            <span class="ag-loading-text" data-ref="eLoadingText"></span>\\n        </div>\'),this.eLoadingIcon=qa,this.eLoadingText=qa}init(e){e.node.failedLoad?this.setupFailed():this.setupLoading()}setupFailed(){const e=this.localeService.getLocaleTextFunc();this.eLoadingText.innerText=e("loadingError","ERR")}setupLoading(){const e=Wa("groupLoading",this.gos,null);e&&this.eLoadingIcon.appendChild(e);const t=this.localeService.getLocaleTextFunc();this.eLoadingText.innerText=t("loadingOoo","Loading")}refresh(e){return!1}destroy(){super.destroy()}},gn=class extends Ba{constructor(){super(\'<div class="ag-skeleton-container"></div>\')}init(e){const t=`ag-cell-skeleton-renderer-${this.getCompId()}`;this.getGui().setAttribute("id",t),this.addDestroyFunc((()=>xt(e.eParentOfValue))),xt(e.eParentOfValue,t),e.node.failedLoad?this.setupFailed():this.setupLoading(e)}setupFailed(){const e=this.localeService.getLocaleTextFunc();this.getGui().innerText=e("loadingError","ERR");const t=e("ariaSkeletonCellLoadingFailed","Row failed to load");kt(this.getGui(),t)}setupLoading(e){const t=this.gos.getDocument().createElement("div");t.classList.add("ag-skeleton-effect");const a=e.node.rowIndex;if(null!=a){const e=75+25*(a%2==0?Math.sin(a):Math.cos(a));t.style.width=`${e}%`}this.getGui().appendChild(t);const n=this.localeService.getLocaleTextFunc()("ariaSkeletonCellLoading","Row data is loading");kt(this.getGui(),n)}refresh(e){return!1}destroy(){super.destroy()}},dn=class extends Ba{constructor(){super()}destroy(){super.destroy()}},hn=class extends dn{init(){const e=this.gos.get("overlayLoadingTemplate");if(this.setTemplate(e??\'<span aria-live="polite" aria-atomic="true" class="ag-overlay-loading-center"></span>\'),!e){const e=this.localeService.getLocaleTextFunc();setTimeout((()=>{this.getGui().textContent=e("loadingOoo","Loading...")}))}}},un=class extends dn{';
      S = S + 'init(){const e=this.gos.get("overlayNoRowsTemplate");if(this.setTemplate(e??\'<span class="ag-overlay-no-rows-center"></span>\'),!e){const e=this.localeService.getLocaleTextFunc();setTimeout((()=>{this.getGui().textContent=e("noRowsToShow","No Rows To Show")}))}}},pn=class extends Ba{isPopup(){return!0}setParentComponent(e){e.addCssClass("ag-has-popup"),super.setParentComponent(e)}destroy(){const e=this.parentComponent;e&&e.isAlive()&&e.getGui().classList.remove("ag-has-popup"),super.destroy()}},mn=class extends pn{constructor(){super(\'<div class="ag-tooltip"></div>\')}init(e){const{value:t}=e;this.getGui().textContent=He(t,!0)}};function fn(e,t,a,n){let o=t.map(((t,a)=>({value:t,relevance:vn(e.toLowerCase(),t.toLocaleLowerCase()),idx:a})));if(o.sort(((e,t)=>t.relevance-e.relevance)),a&&(o=o.filter((e=>0!==e.relevance))),o.length>0&&n&&n>0){const e=o[0].relevance*n;o=o.filter((t=>e-t.relevance<0))}const r=[],i=[];for(const e of o)r.push(e.value),i.push(e.idx);return{values:r,indices:i}}function vn(e,t){const a=e.replace(/\\s/g,""),n=t.replace(/\\s/g,"");let o=0,r=-1;for(let e=0;e<a.length;e++){const t=n.indexOf(a[e],r+1);-1!==t&&(r=t,o+=100-100*r/1e4*100)}return o}var bn=class extends A{constructor(){super(...arguments),this.beanName="userComponentRegistry",this.agGridDefaults={agColumnHeader:Ya,agColumnGroupHeader:_a,agSortIndicator:Ka,agAnimateShowChangeCellRenderer:$a,agAnimateSlideCellRenderer:en,agLoadingCellRenderer:cn,agSkeletonCellRenderer:gn,agCheckboxCellRenderer:ln,agLoadingOverlay:hn,agNoRowsOverlay:un,agTooltipComponent:mn},this.enterpriseAgDefaultCompsModule={agSetColumnFilter:"@ag-grid-enterprise/set-filter",agSetColumnFloatingFilter:"@ag-grid-enterprise/set-filter",agMultiColumnFilter:"@ag-grid-enterprise/multi-filter",agMultiColumnFloatingFilter:"@ag-grid-enterprise/multi-filter",agGroupColumnFilter:"@ag-grid-enterprise/row-grouping",agGroupColumnFloatingFilter:"@ag-grid-enterprise/row-grouping",agGroupCellRenderer:"@ag-grid-enterprise/row-grouping",agGr';
      S = S + 'oupRowRenderer:"@ag-grid-enterprise/row-grouping",agRichSelect:"@ag-grid-enterprise/rich-select",agRichSelectCellEditor:"@ag-grid-enterprise/rich-select",agDetailCellRenderer:"@ag-grid-enterprise/master-detail",agSparklineCellRenderer:"@ag-grid-enterprise/sparklines"},this.jsComps={}}postConstruct(){const e=this.gos.get("components");null!=e&&j(e,((e,t)=>this.registerJsComponent(e,t)))}registerDefaultComponent(e,t){this.agGridDefaults[e]=t}registerJsComponent(e,t){this.jsComps[e]=t}retrieve(e,t){const a=(e,t)=>({componentFromFramework:t,component:e}),n=this.getFrameworkOverrides().frameworkComponent(t,this.gos.get("components"));if(null!=n)return a(n,!0);const o=this.jsComps[t];if(o){return a(o,this.getFrameworkOverrides().isFrameworkComponent(o))}const r=this.agGridDefaults[t];if(r)return a(r,!1);const i=this.enterpriseAgDefaultCompsModule[t];return i?Xa.__assertRegistered(i,`AG Grid \'${e}\' component: ${t}`,this.gridId):se((()=>{this.warnAboutMissingComponent(e,t)}),"MissingComp"+t),null}warnAboutMissingComponent(e,t){const a=fn(t,[...Object.keys(this.agGridDefaults).filter((e=>!["agCellEditor","agGroupRowRenderer","agSortIndicator"].includes(e))),...Object.keys(this.jsComps)],!0,.8).values;ce(`Could not find \'${t}\' component. It was configured as "${e}: \'${t}\'" but it wasn\'t found in the list of registered components.`),a.length>0&&ce(`         Did you mean: [${a.slice(0,3)}]?`),ce(`If using a custom component check it has been registered as described in: ${this.getFrameworkOverrides().getDocLink("components/")}`)}},Cn=class e{constructor(e){this.status=0,this.resolution=null,this.waiters=[],e((e=>this.onDone(e)),(e=>this.onReject(e)))}static all(t){return t.length?new e((e=>{let a=t.length;const n=new Array(a);t.forEach(((t,o)=>{t.then((t=>{n[o]=t,a--,0===a&&e(n)}))}))})):e.resolve()}static resolve(t=null){return new e((e=>e(t)))}then(t){return new e((e=>{1===this.status?e(t(this.resolution)):this.waiters.push((a=>e(t(a))))}))}onDone(e){this.status=1,this.resolut';
      S = S + 'ion=e,this.waiters.forEach((t=>t(e)))}onReject(e){}},wn={propertyName:"dateComponent",cellRenderer:!1},yn={propertyName:"headerComponent",cellRenderer:!1},Sn={propertyName:"headerGroupComponent",cellRenderer:!1},kn={propertyName:"cellRenderer",cellRenderer:!0},xn={propertyName:"cellRenderer",cellRenderer:!1},Rn={propertyName:"loadingCellRenderer",cellRenderer:!0},zn={propertyName:"cellEditor",cellRenderer:!1},Fn={propertyName:"innerRenderer",cellRenderer:!0},Mn={propertyName:"loadingOverlayComponent",cellRenderer:!1},Dn={propertyName:"noRowsOverlayComponent",cellRenderer:!1},En={propertyName:"tooltipComponent",cellRenderer:!1},Pn={propertyName:"filter",cellRenderer:!1},An={propertyName:"floatingFilterComponent",cellRenderer:!1},Tn={propertyName:"toolPanel",cellRenderer:!1},In={propertyName:"statusPanel",cellRenderer:!1},Ln={propertyName:"fullWidthCellRenderer",cellRenderer:!0},On={propertyName:"loadingCellRenderer",cellRenderer:!0},Nn={propertyName:"groupRowRenderer",cellRenderer:!0},Gn={propertyName:"detailCellRenderer",cellRenderer:!0},qn={propertyName:"menuItem",cellRenderer:!1},Bn=class e extends A{constructor(){super(...arguments),this.beanName="userComponentFactory"}wireBeans(e){this.agComponentUtils=e.agComponentUtils,this.componentMetadataProvider=e.componentMetadataProvider,this.userComponentRegistry=e.userComponentRegistry,this.frameworkComponentWrapper=e.frameworkComponentWrapper,this.gridOptions=e.gridOptions}getHeaderCompDetails(e,t){return this.getCompDetails(e,yn,"agColumnHeader",t)}getHeaderGroupCompDetails(e){const t=e.columnGroup.getColGroupDef();return this.getCompDetails(t,Sn,"agColumnGroupHeader",e)}getFullWidthCellRendererDetails(e){return this.getCompDetails(this.gridOptions,Ln,null,e,!0)}getFullWidthLoadingCellRendererDetails(e){return this.getCompDetails(this.gridOptions,On,"agLoadingCellRenderer",e,!0)}getFullWidthGroupCellRendererDetails(e){return this.getCompDetails(this.gridOptions,Nn,"agGroupRowRenderer",e,!0)}getFullWidthDetailCellRend';
      S = S + 'ererDetails(e){return this.getCompDetails(this.gridOptions,Gn,"agDetailCellRenderer",e,!0)}getInnerRendererDetails(e,t){return this.getCompDetails(e,Fn,null,t)}getFullWidthGroupRowInnerCellRenderer(e,t){return this.getCompDetails(e,Fn,null,t)}getCellRendererDetails(e,t){return this.getCompDetails(e,kn,null,t)}getEditorRendererDetails(e,t){return this.getCompDetails(e,xn,null,t)}getLoadingCellRendererDetails(e,t){return this.getCompDetails(e,Rn,"agSkeletonCellRenderer",t,!0)}getCellEditorDetails(e,t){return this.getCompDetails(e,zn,"agCellEditor",t,!0)}getFilterDetails(e,t,a){return this.getCompDetails(e,Pn,a,t,!0)}getDateCompDetails(e){return this.getCompDetails(this.gridOptions,wn,"agDateInput",e,!0)}getLoadingOverlayCompDetails(e){return this.getCompDetails(this.gridOptions,Mn,"agLoadingOverlay",e,!0)}getNoRowsOverlayCompDetails(e){return this.getCompDetails(this.gridOptions,Dn,"agNoRowsOverlay",e,!0)}getTooltipCompDetails(e){return this.getCompDetails(e.colDef,En,"agTooltipComponent",e,!0)}getSetFilterCellRendererDetails(e,t){return this.getCompDetails(e,kn,null,t)}getFloatingFilterCompDetails(e,t,a){return this.getCompDetails(e,An,a,t)}getToolPanelCompDetails(e,t){return this.getCompDetails(e,Tn,null,t,!0)}getStatusPanelCompDetails(e,t){return this.getCompDetails(e,In,null,t,!0)}getMenuItemCompDetails(e,t){return this.getCompDetails(e,qn,"agMenuItem",t,!0)}getCompDetails(t,a,n,o,r=!1){const{propertyName:i,cellRenderer:s}=a;let{compName:l,jsComp:c,fwComp:g,paramsFromSelector:d,popupFromSelector:h,popupPositionFromSelector:u}=e.getCompKeys(this.frameworkOverrides,t,a,o);const p=e=>{const t=this.userComponentRegistry.retrieve(i,e);t&&(c=t.componentFromFramework?void 0:t.component,g=t.componentFromFramework?t.component:void 0)};if(null!=l&&p(l),null==c&&null==g&&null!=n&&p(n),c&&s&&!this.agComponentUtils.doesImplementIComponent(c)&&(c=this.agComponentUtils.adaptFunction(i,c)),!c&&!g)return void(r&&ge(`Could not find component ${l}, did you forget to configure this c';
      S = S + 'omponent?`));const m=this.mergeParamsWithApplicationProvidedParams(t,a,o,d),f=null==c,v=c||g;return{componentFromFramework:f,componentClass:v,params:m,type:a,popupFromSelector:h,popupPositionFromSelector:u,newAgStackInstance:()=>this.newAgStackInstance(v,f,m,a)}}static getCompKeys(e,t,a,n){const{propertyName:o}=a;let r,i,s,l,c,g;if(t){const a=t,d=a[o+"Selector"],h=d?d(n):null,u=t=>{if("string"==typeof t)r=t;else if(null!=t&&!0!==t){e.isFrameworkComponent(t)?s=t:i=t}};h?(u(h.component),l=h.params,c=h.popup,g=h.popupPosition):u(a[o])}return{compName:r,jsComp:i,fwComp:s,paramsFromSelector:l,popupFromSelector:c,popupPositionFromSelector:g}}newAgStackInstance(e,t,a,n){const o=n.propertyName;let r;if(!t)r=new e;else{const t=this.componentMetadataProvider.retrieve(o);r=this.frameworkComponentWrapper.wrap(e,t.mandatoryMethodList,t.optionalMethodList,n)}const i=this.initComponent(r,a);return null==i?Cn.resolve(r):i.then((()=>r))}mergeParamsWithApplicationProvidedParams(e,t,a,n=null){const o=this.gos.getGridCommonParams();_(o,a);const r=e&&e[t.propertyName+"Params"];if("function"==typeof r){_(o,r(a))}else"object"==typeof r&&_(o,r);return _(o,n),o}initComponent(e,t){if(this.createBean(e),null!=e.init)return e.init(t)}};function Hn(e){const t=e;return null!=t&&null!=t.getFrameworkComponentInstance?t.getFrameworkComponentInstance():e}var Vn=class{constructor(e){this.beans={},this.createdBeans=[],this.destroyed=!1,e&&e.beanClasses&&(this.beanDestroyComparator=e.beanDestroyComparator,this.init(e))}init(e){Object.entries(e.providedBeanInstances).forEach((([e,t])=>{this.beans[e]=t})),e.beanClasses.forEach((e=>{const t=new e;t.beanName?this.beans[t.beanName]=t:console.error(`Bean ${e.name} is missing beanName`),this.createdBeans.push(t)})),e.derivedBeans?.forEach((e=>{const{beanName:t,bean:a}=e(this);this.beans[t]=a,this.createdBeans.push(a)})),e.beanInitComparator&&this.createdBeans.sort(e.beanInitComparator),this.initBeans(this.createdBeans)}getBeanInstances(){return Object.values(';
      S = S + 'this.beans)}createBean(e,t){if(!e)throw Error("Can\'t wire to bean since it is null");return this.initBeans([e],t),e}initBeans(e,t){e.forEach((e=>{e.preWireBeans?.(this.beans),e.wireBeans?.(this.beans)})),e.forEach((e=>e.preConstruct?.())),t&&e.forEach(t),e.forEach((e=>e.postConstruct?.()))}getBeans(){return this.beans}getBean(e){return this.beans[e]}destroy(){if(this.destroyed)return;this.destroyed=!0;const e=this.getBeanInstances();this.beanDestroyComparator&&e.sort(this.beanDestroyComparator),this.destroyBeans(e),this.beans={},this.createdBeans=[]}destroyBean(e){e?.destroy?.()}destroyBeans(e){if(e)for(let t=0;t<e.length;t++)this.destroyBean(e[t]);return[]}isDestroyed(){return this.destroyed}},Wn=class extends Vn{init(e){this.gridId=e.gridId,this.beans.context=this,super.init(e)}destroy(){super.destroy(),Xa.__unRegisterGridModules(this.gridId)}getGridId(){return this.gridId}},Un=(e=>(e[e.SINGLE_SHEET=0]="SINGLE_SHEET",e[e.MULTI_SHEET=1]="MULTI_SHEET",e))(Un||{}),jn=(e=>(e[e.Up=0]="Up",e[e.Down=1]="Down",e))(jn||{}),Kn=(e=>(e[e.Left=0]="Left",e[e.Right=1]="Right",e))(Kn||{}),Qn=(e=>(e[e.ToolPanel=0]="ToolPanel",e[e.HeaderCell=1]="HeaderCell",e[e.RowDrag=2]="RowDrag",e[e.ChartPanel=3]="ChartPanel",e[e.AdvancedFilterBuilder=4]="AdvancedFilterBuilder",e))(Qn||{}),Yn=class extends A{constructor(){super(...arguments),this.beanName="dragAndDropService",this.dragSourceAndParamsList=[],this.dropTargets=[]}wireBeans(e){this.dragService=e.dragService,this.mouseEventService=e.mouseEventService,this.environment=e.environment}postConstruct(){this.dropIconMap={pinned:Va("columnMovePin",this.gos,null),hide:Va("columnMoveHide",this.gos,null),move:Va("columnMoveMove",this.gos,null),left:Va("columnMoveLeft",this.gos,null),right:Va("columnMoveRight",this.gos,null),group:Va("columnMoveGroup",this.gos,null),aggregate:Va("columnMoveValue",this.gos,null),pivot:Va("columnMovePivot",this.gos,null),notAllowed:Va("dropNotAllowed",this.gos,null)}}addDragSource(e,t=!1){const a={eElement:e.eElem';
      S = S + "ent,dragStartPixels:e.dragStartPixels,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this),onDragging:this.onDragging.bind(this),includeTouch:t};this.dragSourceAndParamsList.push({params:a,dragSource:e}),this.dragService.addDragSource(a)}removeDragSource(e){const t=this.dragSourceAndParamsList.find((t=>t.dragSource===e));t&&(this.dragService.removeDragSource(t.params),f(this.dragSourceAndParamsList,t))}destroy(){this.dragSourceAndParamsList.forEach((e=>this.dragService.removeDragSource(e.params))),this.dragSourceAndParamsList.length=0,this.dropTargets.length=0,super.destroy()}nudge(){this.dragging&&this.onDragging(this.eventLastTime,!0)}onDragStart(e,t){this.dragging=!0,this.dragSource=e,this.eventLastTime=t,this.dragItem=this.dragSource.getDragItem(),this.dragSource.onDragStarted&&this.dragSource.onDragStarted(),this.createGhost()}onDragStop(e){if(this.eventLastTime=null,this.dragging=!1,this.dragSource.onDragStopped&&this.dragSource.onDragStopped(),this.lastDropTarget&&this.lastDropTarget.onDragStop){const t=this.createDropTargetEvent(this.lastDropTarget,e,null,null,!1);this.lastDropTarget.onDragStop(t)}this.lastDropTarget=void 0,this.dragItem=null,this.removeGhost()}onDragging(e,t){const a=this.getHorizontalDirection(e),n=this.getVerticalDirection(e);this.eventLastTime=e,this.positionGhost(e);const o=this.dropTargets.filter((t=>this.isMouseOnDropTarget(e,t))),r=this.findCurrentDropTarget(e,o);if(r!==this.lastDropTarget)this.leaveLastTargetIfExists(e,a,n,t),null!==this.lastDropTarget&&null===r&&this.dragSource.onGridExit?.(this.dragItem),null===this.lastDropTarget&&null!==r&&this.dragSource.onGridEnter?.(this.dragItem),this.enterDragTargetIfExists(r,e,a,n,t),this.lastDropTarget=r;else if(r&&r.onDragging){const o=this.createDropTargetEvent(r,e,a,n,t);r.onDragging(o)}}getAllContainersFromDropTarget(e){const t=e.getSecondaryContainers?e.getSecondaryContainers():null,a=[[e.getContainer()]];return t?a.concat(t):a}allContainersIntersect(e,t){f";
      S = S + "or(const a of t){const t=a.getBoundingClientRect();if(0===t.width||0===t.height)return!1;const n=e.clientX>=t.left&&e.clientX<t.right,o=e.clientY>=t.top&&e.clientY<t.bottom;if(!n||!o)return!1}return!0}isMouseOnDropTarget(e,t){const a=this.getAllContainersFromDropTarget(t);let n=!1;for(const t of a)if(this.allContainersIntersect(e,t)){n=!0;break}return!(t.targetContainsSource&&!t.getContainer().contains(this.dragSource.eElement))&&(n&&t.isInterestedIn(this.dragSource.type,this.dragSource.eElement))}findCurrentDropTarget(e,t){const a=t.length;if(0===a)return null;if(1===a)return t[0];const n=this.gos.getRootNode().elementsFromPoint(e.clientX,e.clientY);for(const e of n)for(const a of t){if(-1!==y(this.getAllContainersFromDropTarget(a)).indexOf(e))return a}return null}enterDragTargetIfExists(e,t,a,n,o){if(e){if(e.onDragEnter){const r=this.createDropTargetEvent(e,t,a,n,o);e.onDragEnter(r)}this.setGhostIcon(e.getIconName?e.getIconName():null)}}leaveLastTargetIfExists(e,t,a,n){if(this.lastDropTarget){if(this.lastDropTarget.onDragLeave){const o=this.createDropTargetEvent(this.lastDropTarget,e,t,a,n);this.lastDropTarget.onDragLeave(o)}this.setGhostIcon(null)}}addDropTarget(e){this.dropTargets.push(e)}removeDropTarget(e){this.dropTargets=this.dropTargets.filter((t=>t.getContainer()!==e.getContainer()))}hasExternalDropZones(){return this.dropTargets.some((e=>e.external))}findExternalZone(e){return this.dropTargets.filter((e=>e.external)).find((t=>t.getContainer()===e.getContainer()))||null}getHorizontalDirection(e){const t=this.eventLastTime&&this.eventLastTime.clientX,a=e.clientX;return t===a?null:t>a?0:1}getVerticalDirection(e){const t=this.eventLastTime&&this.eventLastTime.clientY,a=e.clientY;return t===a?null:t>a?0:1}createDropTargetEvent(e,t,a,n,o){const r=e.getContainer(),i=r.getBoundingClientRect(),{dragItem:s,dragSource:l}=this,c=t.clientX-i.left,g=t.clientY-i.top;return this.gos.addGridCommonParams({event:t,x:c,y:g,vDirection:n,hDirection:a,dragSource:l,fromNudge:o,d";
      S = S + 'ragItem:s,dropZoneTarget:r})}positionGhost(e){const t=this.eGhost;if(!t)return;const a=t.getBoundingClientRect().height,n=(document.body?.clientWidth??(window.innerHeight||document.documentElement?.clientWidth||-1))-2,o=(document.body?.clientHeight??(window.innerHeight||document.documentElement?.clientHeight||-1))-2,r=pa(t.offsetParent),{clientY:i,clientX:s}=e;let l=i-r.top-a/2,c=s-r.left-10;const g=this.gos.getDocument(),d=g.defaultView||window,h=d.pageYOffset||g.documentElement.scrollTop,u=d.pageXOffset||g.documentElement.scrollLeft;n>0&&c+t.clientWidth>n+u&&(c=n+u-t.clientWidth),c<0&&(c=0),o>0&&l+t.clientHeight>o+h&&(l=o+h-t.clientHeight),l<0&&(l=0),t.style.left=`${c}px`,t.style.top=`${l}px`}removeGhost(){this.eGhost&&this.eGhostParent&&this.eGhostParent.removeChild(this.eGhost),this.eGhost=null}createGhost(){this.eGhost=Sa(\'<div class="ag-dnd-ghost ag-unselectable">\\n<span class="ag-dnd-ghost-icon ag-shake-left-to-right"></span>\\n<div class="ag-dnd-ghost-label"></div>\\n</div>\'),this.mouseEventService.stampTopLevelGridCompWithGridInstance(this.eGhost),this.environment.applyThemeClasses(this.eGhost),this.eGhostIcon=this.eGhost.querySelector(".ag-dnd-ghost-icon"),this.setGhostIcon(null);const e=this.eGhost.querySelector(".ag-dnd-ghost-label");let t=this.dragSource.dragItemName;de(t)&&(t=t()),e.innerHTML=He(t)||"",this.eGhost.style.height="25px",this.eGhost.style.top="20px",this.eGhost.style.left="20px";const a=this.gos.getDocument();let n=null,o=null;try{n=a.fullscreenElement}catch(e){}finally{n||(n=this.gos.getRootNode());const e=n.querySelector("body");o=e||(n instanceof ShadowRoot?n:n instanceof Document?n?.documentElement:n)}this.eGhostParent=o,this.eGhostParent?this.eGhostParent.appendChild(this.eGhost):ce("Could not find document body, it is needed for dragging columns")}setGhostIcon(e,t=!1){ba(this.eGhostIcon);let a=null;e||(e=this.dragSource.getDefaultIconName?this.dragSource.getDefaultIconName():"notAllowed"),a=this.dropIconMap[e],this.eGhostIcon.classList';
      S = S + '.toggle("ag-shake-left-to-right",t),a===this.dropIconMap.hide&&this.gos.get("suppressDragLeaveHidesColumns")||a&&this.eGhostIcon.appendChild(a)}},_n=class{constructor(e){this.tickingInterval=null,this.onScrollCallback=null,this.scrollContainer=e.scrollContainer,this.scrollHorizontally=-1!==e.scrollAxis.indexOf("x"),this.scrollVertically=-1!==e.scrollAxis.indexOf("y"),this.scrollByTick=null!=e.scrollByTick?e.scrollByTick:20,e.onScrollCallback&&(this.onScrollCallback=e.onScrollCallback),this.scrollVertically&&(this.getVerticalPosition=e.getVerticalPosition,this.setVerticalPosition=e.setVerticalPosition),this.scrollHorizontally&&(this.getHorizontalPosition=e.getHorizontalPosition,this.setHorizontalPosition=e.setHorizontalPosition),this.shouldSkipVerticalScroll=e.shouldSkipVerticalScroll||(()=>!1),this.shouldSkipHorizontalScroll=e.shouldSkipHorizontalScroll||(()=>!1)}check(e,t=!1){const a=t||this.shouldSkipVerticalScroll();if(a&&this.shouldSkipHorizontalScroll())return;const n=this.scrollContainer.getBoundingClientRect(),o=this.scrollByTick;this.tickLeft=e.clientX<n.left+o,this.tickRight=e.clientX>n.right-o,this.tickUp=e.clientY<n.top+o&&!a,this.tickDown=e.clientY>n.bottom-o&&!a,this.tickLeft||this.tickRight||this.tickUp||this.tickDown?this.ensureTickingStarted():this.ensureCleared()}ensureTickingStarted(){null===this.tickingInterval&&(this.tickingInterval=window.setInterval(this.doTick.bind(this),100),this.tickCount=0)}doTick(){this.tickCount++;const e=this.tickCount>20?200:this.tickCount>10?80:40;if(this.scrollVertically){const t=this.getVerticalPosition();this.tickUp&&this.setVerticalPosition(t-e),this.tickDown&&this.setVerticalPosition(t+e)}if(this.scrollHorizontally){const t=this.getHorizontalPosition();this.tickLeft&&this.setHorizontalPosition(t-e),this.tickRight&&this.setHorizontalPosition(t+e)}this.onScrollCallback&&this.onScrollCallback()}ensureCleared(){this.tickingInterval&&(window.clearInterval(this.tickingInterval),this.tickingInterval=null)}},Jn=(e=>(e[e.A';
      S = S + 'bove=0]="Above",e[e.Below=1]="Below",e))(Jn||{}),Zn=class extends A{wireBeans(e){this.dragAndDropService=e.dragAndDropService,this.rowModel=e.rowModel,this.pageBoundsService=e.pageBoundsService,this.focusService=e.focusService,this.sortController=e.sortController,this.filterManager=e.filterManager,this.selectionService=e.selectionService,this.mouseEventService=e.mouseEventService,this.ctrlsService=e.ctrlsService,this.funcColsService=e.funcColsService,this.rangeService=e.rangeService}constructor(e){super(),this.eContainer=e}postConstruct(){this.gos.isRowModelType("clientSide")&&(this.clientSideRowModel=this.rowModel),this.ctrlsService.whenReady((e=>{const t=e.gridBodyCtrl;this.autoScrollService=new _n({scrollContainer:t.getBodyViewportElement(),scrollAxis:"y",getVerticalPosition:()=>t.getScrollFeature().getVScrollPosition().top,setVerticalPosition:e=>t.getScrollFeature().setVerticalScrollPosition(e),onScrollCallback:()=>{this.onDragging(this.lastDraggingEvent)}})}))}getContainer(){return this.eContainer}isInterestedIn(e){return 2===e}getIconName(){return this.gos.get("rowDragManaged")&&this.shouldPreventRowMove()?"notAllowed":"move"}shouldPreventRowMove(){if(this.funcColsService.getRowGroupColumns().length)return!0;const e=this.filterManager?.isAnyFilterPresent();if(e)return!0;return!!this.sortController.isSortActive()}getRowNodes(e){if(!this.isFromThisGrid(e))return e.dragItem.rowNodes||[];const t=e.dragItem.rowNode;if(this.gos.get("rowDragMultiRow")){const e=[...this.selectionService.getSelectedNodes()].sort(((e,t)=>null==e.rowIndex||null==t.rowIndex?0:this.getRowIndexNumber(e)-this.getRowIndexNumber(t)));if(-1!==e.indexOf(t))return e}return[t]}onDragEnter(e){e.dragItem.rowNodes=this.getRowNodes(e),this.dispatchGridEvent("rowDragEnter",e),this.getRowNodes(e).forEach((e=>{e.setDragging(!0)})),this.onEnterOrDragging(e)}onDragging(e){this.onEnterOrDragging(e)}isFromThisGrid(e){const{dragSourceDomDataKey:t}=e.dragSource;return t===this.gos.getDomDataKey()}isDropZoneWit';
      S = S + 'hinThisGrid(e){const t=this.ctrlsService.getGridBodyCtrl().getGui(),{dropZoneTarget:a}=e;return!t.contains(a)}onEnterOrDragging(e){this.dispatchGridEvent("rowDragMove",e),this.lastDraggingEvent=e;const t=this.mouseEventService.getNormalisedPosition(e).y;this.gos.get("rowDragManaged")&&this.doManagedDrag(e,t),this.autoScrollService.check(e.event)}doManagedDrag(e,t){const a=this.isFromThisGrid(e),n=this.gos.get("rowDragManaged"),o=e.dragItem.rowNodes;n&&this.shouldPreventRowMove()||(this.gos.get("suppressMoveWhenRowDragging")||!a?this.isDropZoneWithinThisGrid(e)||this.clientSideRowModel.highlightRowAtPixel(o[0],t):this.moveRows(o,t))}getRowIndexNumber(e){const t=e.getRowIndexString();return parseInt(d(t.split("-")),10)}moveRowAndClearHighlight(e){const t=this.clientSideRowModel.getLastHighlightedRowNode(),a=t&&1===t.highlighted,n=this.mouseEventService.getNormalisedPosition(e).y,o=e.dragItem.rowNodes;let r=a?1:0;if(this.isFromThisGrid(e))o.forEach((e=>{e.rowTop<n&&(r-=1)})),this.moveRows(o,n,r);else{const e=this.gos.getRowIdCallback();let t=this.clientSideRowModel.getRowIndexAtPixel(n)+1;0===this.clientSideRowModel.getHighlightPosition(n)&&t--,this.clientSideRowModel.updateRowData({add:o.map((e=>e.data)).filter((t=>!this.clientSideRowModel.getRowNode(e?.({data:t,level:0})??t.id))),addIndex:t})}this.clearRowHighlight()}clearRowHighlight(){this.clientSideRowModel.highlightRowAtPixel(null)}moveRows(e,t,a=0){this.clientSideRowModel.ensureRowsAtPixel(e,t,a)&&(this.focusService.clearFocusedCell(),this.rangeService?.removeAllCellRanges())}addRowDropZone(e){if(!e.getContainer())return void ce("addRowDropZone - A container target needs to be provided");if(this.dragAndDropService.findExternalZone(e))return void ce("addRowDropZone - target already exists in the list of DropZones. Use `removeRowDropZone` before adding it again.");let t={getContainer:e.getContainer};e.fromGrid?t=e:(e.onDragEnter&&(t.onDragEnter=t=>{e.onDragEnter(this.draggingToRowDragEvent("rowDragEnter",t))}),e.o';
      S = S + 'nDragLeave&&(t.onDragLeave=t=>{e.onDragLeave(this.draggingToRowDragEvent("rowDragLeave",t))}),e.onDragging&&(t.onDragging=t=>{e.onDragging(this.draggingToRowDragEvent("rowDragMove",t))}),e.onDragStop&&(t.onDragStop=t=>{e.onDragStop(this.draggingToRowDragEvent("rowDragEnd",t))})),this.dragAndDropService.addDropTarget({isInterestedIn:e=>2===e,getIconName:()=>"move",external:!0,...t})}getRowDropZone(e){const t=this.getContainer.bind(this),a=this.onDragEnter.bind(this),n=this.onDragLeave.bind(this),o=this.onDragging.bind(this),r=this.onDragStop.bind(this);return e?{getContainer:t,onDragEnter:e.onDragEnter?t=>{a(t),e.onDragEnter(this.draggingToRowDragEvent("rowDragEnter",t))}:a,onDragLeave:e.onDragLeave?t=>{n(t),e.onDragLeave(this.draggingToRowDragEvent("rowDragLeave",t))}:n,onDragging:e.onDragging?t=>{o(t),e.onDragging(this.draggingToRowDragEvent("rowDragMove",t))}:o,onDragStop:e.onDragStop?t=>{r(t),e.onDragStop(this.draggingToRowDragEvent("rowDragEnd",t))}:r,fromGrid:!0}:{getContainer:t,onDragEnter:a,onDragLeave:n,onDragging:o,onDragStop:r,fromGrid:!0}}draggingToRowDragEvent(e,t){const a=this.mouseEventService.getNormalisedPosition(t).y;let n,o,r=-1;switch(a>this.pageBoundsService.getCurrentPageHeight()||(r=this.rowModel.getRowIndexAtPixel(a),n=this.rowModel.getRow(r)),t.vDirection){case 1:o="down";break;case 0:o="up";break;default:o=null}return this.gos.addGridCommonParams({type:e,event:t.event,node:t.dragItem.rowNode,nodes:t.dragItem.rowNodes,overIndex:r,overNode:n,y:a,vDirection:o})}dispatchGridEvent(e,t){const a=this.draggingToRowDragEvent(e,t);this.eventService.dispatchEvent(a)}onDragLeave(e){this.dispatchGridEvent("rowDragLeave",e),this.stopDragging(e),this.gos.get("rowDragManaged")&&this.clearRowHighlight()}onDragStop(e){this.dispatchGridEvent("rowDragEnd",e),this.stopDragging(e),!this.gos.get("rowDragManaged")||!this.gos.get("suppressMoveWhenRowDragging")&&this.isFromThisGrid(e)||this.isDropZoneWithinThisGrid(e)||this.moveRowAndClearHighlight(e)}stopDragging(e)';
      S = S + '{this.autoScrollService.ensureCleared(),this.getRowNodes(e).forEach((e=>{e.setDragging(!1)}))}},Xn=class extends A{constructor(){super(...arguments),this.beanName="dragService",this.dragEndFunctions=[],this.dragSources=[]}wireBeans(e){this.mouseEventService=e.mouseEventService}destroy(){this.dragSources.forEach(this.removeListener.bind(this)),this.dragSources.length=0,super.destroy()}removeListener(e){const t=e.dragSource.eElement,a=e.mouseDownListener;if(t.removeEventListener("mousedown",a),e.touchEnabled){const a=e.touchStartListener;t.removeEventListener("touchstart",a,{passive:!0})}}removeDragSource(e){const t=this.dragSources.find((t=>t.dragSource===e));t&&(this.removeListener(t),f(this.dragSources,t))}isDragging(){return this.dragging}addDragSource(e){const t=this.onMouseDown.bind(this,e),{eElement:a,includeTouch:n,stopPropagationForTouch:o}=e;a.addEventListener("mousedown",t);let r=null;const i=this.gos.get("suppressTouch");n&&!i&&(r=t=>{oa(t.target)||(t.cancelable&&(t.preventDefault(),o&&t.stopPropagation()),this.onTouchStart(e,t))},a.addEventListener("touchstart",r,{passive:!1})),this.dragSources.push({dragSource:e,mouseDownListener:t,touchStartListener:r,touchEnabled:!!n})}getStartTarget(){return this.startTarget}onTouchStart(e,t){this.currentDragParams=e,this.dragging=!1;const a=t.touches[0];this.touchLastTime=a,this.touchStart=a;const n=t=>this.onTouchUp(t,e.eElement),o=t.target,r=[{target:this.gos.getRootNode(),type:"touchmove",listener:e=>{e.cancelable&&e.preventDefault()},options:{passive:!1}},{target:o,type:"touchmove",listener:t=>this.onTouchMove(t,e.eElement),options:{passive:!0}},{target:o,type:"touchend",listener:n,options:{passive:!0}},{target:o,type:"touchcancel",listener:n,options:{passive:!0}}];this.addTemporaryEvents(r),0===e.dragStartPixels&&this.onCommonMove(a,this.touchStart,e.eElement)}onMouseDown(e,t){const a=t;if(e.skipMouseEvent&&e.skipMouseEvent(t))return;if(a._alreadyProcessedByDragService)return;if(a._alreadyProcessedByDragService=';
      S = S + '!0,0!==t.button)return;this.shouldPreventMouseEvent(t)&&t.preventDefault(),this.currentDragParams=e,this.dragging=!1,this.mouseStartEvent=t,this.startTarget=t.target;const n=this.gos.getRootNode(),o=[{target:n,type:"mousemove",listener:t=>this.onMouseMove(t,e.eElement)},{target:n,type:"mouseup",listener:t=>this.onMouseUp(t,e.eElement)},{target:n,type:"contextmenu",listener:e=>e.preventDefault()}];this.addTemporaryEvents(o),0===e.dragStartPixels&&this.onMouseMove(t,e.eElement)}addTemporaryEvents(e){e.forEach((e=>{const{target:t,type:a,listener:n,options:o}=e;t.addEventListener(a,n,o)})),this.dragEndFunctions.push((()=>{e.forEach((e=>{const{target:t,type:a,listener:n,options:o}=e;t.removeEventListener(a,n,o)}))}))}isEventNearStartEvent(e,t){const{dragStartPixels:a}=this.currentDragParams;return Ua(e,t,L(a)?a:4)}getFirstActiveTouch(e){for(let t=0;t<e.length;t++)if(e[t].identifier===this.touchStart.identifier)return e[t];return null}onCommonMove(e,t,a){if(!this.dragging){if(!this.dragging&&this.isEventNearStartEvent(e,t))return;this.dragging=!0;const n={type:"dragStarted",target:a};this.eventService.dispatchEvent(n),this.currentDragParams.onDragStart(t),this.currentDragParams.onDragging(t)}this.currentDragParams.onDragging(e)}onTouchMove(e,t){const a=this.getFirstActiveTouch(e.touches);a&&this.onCommonMove(a,this.touchStart,t)}onMouseMove(e,t){if(Kt()){const e=this.gos.getDocument();e.getSelection()?.removeAllRanges()}this.shouldPreventMouseEvent(e)&&e.preventDefault(),this.onCommonMove(e,this.mouseStartEvent,t)}shouldPreventMouseEvent(e){const t=this.gos.get("enableCellTextSelection"),a="mousemove"===e.type;return t&&a&&e.cancelable&&this.mouseEventService.isEventFromThisGrid(e)&&!this.isOverFormFieldElement(e)}isOverFormFieldElement(e){const t=e.target,a=t?.tagName.toLocaleLowerCase();return!!a?.match("^a$|textarea|input|select|button")}onTouchUp(e,t){let a=this.getFirstActiveTouch(e.changedTouches);a||(a=this.touchLastTime),this.onUpCommon(a,t)}onMouseUp(e,t){this.on';
      S = S + 'UpCommon(e,t)}onUpCommon(e,t){if(this.dragging){this.dragging=!1,this.currentDragParams.onDragStop(e);const a={type:"dragStopped",target:t};this.eventService.dispatchEvent(a)}this.mouseStartEvent=null,this.startTarget=null,this.touchStart=null,this.touchLastTime=null,this.currentDragParams=null,this.dragEndFunctions.forEach((e=>e())),this.dragEndFunctions.length=0}},$n=class extends Ba{constructor(e,t,a,n,o,r){super(),this.cellValueFn=e,this.rowNode=t,this.column=a,this.customGui=n,this.dragStartPixels=o,this.suppressVisibilityChange=r,this.dragSource=null}wireBeans(e){this.beans=e}isCustomGui(){return null!=this.customGui}postConstruct(){if(this.customGui?this.setDragElement(this.customGui,this.dragStartPixels):(this.setTemplate(\'<div class="ag-drag-handle ag-row-drag" aria-hidden="true"></div>\'),this.getGui().appendChild(Wa("rowDrag",this.gos,null)),this.addDragSource()),this.checkCompatibility(),!this.suppressVisibilityChange){const e=this.gos.get("rowDragManaged")?new ao(this,this.beans,this.rowNode,this.column):new to(this,this.beans,this.rowNode,this.column);this.createManagedBean(e,this.beans.context)}}setDragElement(e,t){this.setTemplateFromElement(e),this.addDragSource(t)}getSelectedNodes(){if(!this.gos.get("rowDragMultiRow"))return[this.rowNode];const e=this.beans.selectionService.getSelectedNodes();return-1!==e.indexOf(this.rowNode)?e:[this.rowNode]}checkCompatibility(){const e=this.gos.get("rowDragManaged");this.gos.get("treeData")&&e&&ce("If using row drag with tree data, you cannot have rowDragManaged=true")}getDragItem(){return{rowNode:this.rowNode,rowNodes:this.getSelectedNodes(),columns:this.column?[this.column]:void 0,defaultTextValue:this.cellValueFn()}}getRowDragText(e){if(e){const t=e.getColDef();if(t.rowDragText)return t.rowDragText}return this.gos.get("rowDragText")}addDragSource(e=4){this.dragSource&&this.removeDragSource();const t=this.localeService.getLocaleTextFunc();this.dragSource={type:2,eElement:this.getGui(),dragItemName:()=>{const e=';
      S = S + 'this.getDragItem(),a=e.rowNodes?.length||1,n=this.getRowDragText(this.column);return n?n(e,a):1===a?this.cellValueFn():`${a} ${t("rowDragRows","rows")}`},getDragItem:()=>this.getDragItem(),dragStartPixels:e,dragSourceDomDataKey:this.gos.getDomDataKey()},this.beans.dragAndDropService.addDragSource(this.dragSource,!0)}destroy(){this.removeDragSource(),super.destroy()}removeDragSource(){this.dragSource&&this.beans.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null}},eo=class extends A{constructor(e,t,a){super(),this.parent=e,this.rowNode=t,this.column=a}setDisplayedOrVisible(e){const t={skipAriaHidden:!0};if(e)this.parent.setDisplayed(!1,t);else{let e=!0,a=!1;this.column&&(e=this.column.isRowDrag(this.rowNode)||this.parent.isCustomGui(),a=de(this.column.getColDef().rowDrag)),a?(this.parent.setDisplayed(!0,t),this.parent.setVisible(e,t)):(this.parent.setDisplayed(e,t),this.parent.setVisible(!0,t))}}},to=class extends eo{constructor(e,t,a,n){super(e,a,n),this.beans=t}postConstruct(){this.addManagedPropertyListener("suppressRowDrag",this.onSuppressRowDrag.bind(this));const e=this.workOutVisibility.bind(this);this.addManagedListeners(this.rowNode,{dataChanged:e,cellChanged:e}),this.addManagedListeners(this.beans.eventService,{newColumnsLoaded:e}),this.workOutVisibility()}onSuppressRowDrag(){this.workOutVisibility()}workOutVisibility(){const e=this.gos.get("suppressRowDrag");this.setDisplayedOrVisible(e)}},ao=class extends eo{constructor(e,t,a,n){super(e,a,n),this.beans=t}postConstruct(){const e=this.workOutVisibility.bind(this);this.addManagedListeners(this.beans.eventService,{sortChanged:e,filterChanged:e,columnRowGroupChanged:e,newColumnsLoaded:e}),this.addManagedListeners(this.rowNode,{dataChanged:e,cellChanged:e}),this.addManagedPropertyListener("suppressRowDrag",this.onSuppressRowDrag.bind(this)),this.workOutVisibility()}onSuppressRowDrag(){this.workOutVisibility()}workOutVisibility(){const e=this.beans.ctrlsService.getGridBodyCtrl().getRowDragF';
      S = S + 'eature(),t=e&&e.shouldPreventRowMove(),a=this.gos.get("suppressRowDrag"),n=this.beans.dragAndDropService.hasExternalDropZones(),o=t&&!n||a;this.setDisplayedOrVisible(o)}},no=class e{constructor(t){this.rowIndex=null,this.key=null,this.childrenMapped={},this.displayed=!1,this.rowTop=null,this.oldRowTop=null,this.selectable=!0,this.__objectId=e.OBJECT_ID_SEQUENCE++,this.__autoHeights={},this.alreadyRendered=!1,this.highlighted=null,this.hovered=!1,this.selected=!1,this.beans=t}setData(e){this.setDataCommon(e,!1)}updateData(e){this.setDataCommon(e,!0)}setDataCommon(e,t){const a=this.data;this.data=e,this.beans.valueCache.onDataChanged(),this.updateDataOnDetailNode(),this.checkRowSelectable(),this.resetQuickFilterAggregateText();const n=this.createDataChangedEvent(e,a,t);this.localEventService?.dispatchEvent(n)}updateDataOnDetailNode(){this.detailNode&&(this.detailNode.data=this.data)}createDataChangedEvent(e,t,a){return{type:"dataChanged",node:this,oldData:t,newData:e,update:a}}getRowIndexString(){return null==this.rowIndex?(ge("Could not find rowIndex, this means tasks are being executed on a rowNode that has been removed from the grid."),null):"top"===this.rowPinned?"t-"+this.rowIndex:"bottom"===this.rowPinned?"b-"+this.rowIndex:this.rowIndex.toString()}createDaemonNode(){const t=new e(this.beans);return t.id=this.id,t.data=this.data,t.__daemon=!0,t.selected=this.selected,t.level=this.level,t}setDataAndId(e,t){const a=L(this.id)?this.createDaemonNode():null,n=this.data;this.data=e,this.updateDataOnDetailNode(),this.setId(t),this.checkRowSelectable(),this.beans.selectionService.syncInRowNode(this,a);const o=this.createDataChangedEvent(e,n,!1);this.localEventService?.dispatchEvent(o)}checkRowSelectable(){const e=this.beans.gos.get("isRowSelectable");this.setRowSelectable(!e||e(this))}setRowSelectable(e,t){if(this.selectable!==e){if(this.selectable=e,this.dispatchRowEvent("selectableChanged"),t)return;if(this.beans.gos.get("groupSelectsChildren")){const e=this.calculate';
      S = S + 'SelectedFromChildren();return void this.setSelectedParams({newValue:e??!1,source:"selectableChanged"})}this.isSelected()&&!this.selectable&&this.setSelectedParams({newValue:!1,source:"selectableChanged"})}}setId(t){const a=this.beans.gos.getRowIdCallback();if(a)if(this.data){const t=this.getGroupKeys(!0);this.id=a({data:this.data,parentKeys:t.length>0?t:void 0,level:this.level}),this.id.startsWith(e.ID_PREFIX_ROW_GROUP)&&ge(`Row IDs cannot start with ${e.ID_PREFIX_ROW_GROUP}, this is a reserved prefix for AG Grid\'s row grouping feature.`)}else this.id=void 0;else this.id=t}getGroupKeys(e=!1){const t=[];let a=this;for(e&&(a=a.parent);a&&a.level>=0;)t.push(a.key),a=a.parent;return t.reverse(),t}isPixelInRange(e){return!(!L(this.rowTop)||!L(this.rowHeight))&&(e>=this.rowTop&&e<this.rowTop+this.rowHeight)}updateIfDifferent(e,t,a){this[e]!==t&&(this[e]=t,this.dispatchRowEvent(a))}setFirstChild(e){this.updateIfDifferent("firstChild",e,"firstChildChanged")}setLastChild(e){this.updateIfDifferent("lastChild",e,"lastChildChanged")}setChildIndex(e){this.updateIfDifferent("childIndex",e,"childIndexChanged")}setRowTop(e){this.oldRowTop=this.rowTop,this.rowTop!==e&&(this.rowTop=e,this.dispatchRowEvent("topChanged"),this.setDisplayed(null!==e))}clearRowTopAndRowIndex(){this.oldRowTop=null,this.setRowTop(null),this.setRowIndex(null)}setDisplayed(e){this.updateIfDifferent("displayed",e,"displayedChanged")}setDragging(e){this.updateIfDifferent("dragging",e,"draggingChanged")}setHighlighted(e){this.updateIfDifferent("highlighted",e,"rowHighlightChanged")}setHovered(e){this.hovered!==e&&(this.hovered=e)}isHovered(){return this.hovered}setAllChildrenCount(e){this.updateIfDifferent("allChildrenCount",e,"allChildrenCountChanged")}setMaster(e){this.master!==e&&(this.master&&!e&&(this.expanded=!1),this.master=e,this.dispatchRowEvent("masterChanged"))}setGroup(e){this.group!==e&&(this.group&&!e&&(this.expanded=!1),this.group=e,this.updateHasChildren(),this.checkRowSelectable(),this.dispatchR';
      S = S + 'owEvent("groupChanged"))}setRowHeight(e,t=!1){this.rowHeight=e,this.rowHeightEstimated=t,this.dispatchRowEvent("heightChanged")}setRowAutoHeight(e,t){this.__autoHeights||(this.__autoHeights={}),this.__autoHeights[t.getId()]=e,null!=e&&(null==this.checkAutoHeightsDebounced&&(this.checkAutoHeightsDebounced=fe(this.checkAutoHeights.bind(this),1)),this.checkAutoHeightsDebounced())}checkAutoHeights(){let e=!1,t=!0,a=0;const n=this.__autoHeights;if(null==n)return;if(this.beans.visibleColsService.getAllAutoHeightCols().forEach((o=>{let r=n[o.getId()];if(null==r){if(!this.beans.columnModel.isColSpanActive())return void(e=!0);{let t=[];switch(o.getPinned()){case"left":t=this.beans.visibleColsService.getLeftColsForRow(this);break;case"right":t=this.beans.visibleColsService.getRightColsForRow(this);break;case null:t=this.beans.columnViewportService.getColsWithinViewport(this)}if(t.includes(o))return void(e=!0);r=-1}}else t=!1;r>a&&(a=r)})),e)return;if((t||a<10)&&(a=this.beans.gos.getRowHeightForNode(this).height),a==this.rowHeight)return;this.setRowHeight(a);const o=this.beans.rowModel;o.onRowHeightChangedDebounced&&o.onRowHeightChangedDebounced()}setRowIndex(e){this.updateIfDifferent("rowIndex",e,"rowIndexChanged")}setUiLevel(e){this.updateIfDifferent("uiLevel",e,"uiLevelChanged")}setExpanded(e,t,a){if(this.expanded===e)return;this.expanded=e,this.dispatchRowEvent("expandedChanged");const n={...this.createGlobalRowEvent("rowGroupOpened"),expanded:e,event:t||null};this.beans.rowNodeEventThrottle.dispatchExpanded(n,a),this.beans.rowRenderer.refreshCells({rowNodes:[this]})}createGlobalRowEvent(e){return this.beans.gos.addGridCommonParams({type:e,node:this,data:this.data,rowIndex:this.rowIndex,rowPinned:this.rowPinned})}setDataValue(e,t,a){const n=(()=>"string"!=typeof e?e:this.beans.columnModel.getCol(e)??this.beans.columnModel.getColDefCol(e))(),o=this.getValueFromValueService(n);if(this.beans.gos.get("readOnlyEdit"))return this.dispatchEventForSaveValueReadOnly(n,o,t,a),!1;con';
      S = S + 'st r=this.beans.valueService.setValue(this,n,t,a);return this.dispatchCellChangedEvent(n,t,o),this.checkRowSelectable(),r}getValueFromValueService(e){const t=this.leafGroup&&this.beans.columnModel.isPivotMode(),a=this.group&&this.expanded&&!this.footer&&!t;let n=!1;const o=this.beans.gos.get("groupTotalRow")??this.beans.gos.get("groupIncludeFooter");if("function"!=typeof o)n=!!o;else{n=!!(this.beans.gos.getCallback("groupTotalRow")??this.beans.gos.getCallback("groupIncludeFooter"))({node:this})}const r=this.beans.gos.get("groupSuppressBlankHeader"),i=a&&n&&!r;return this.beans.valueService.getValue(e,this,!1,i)}dispatchEventForSaveValueReadOnly(e,t,a,n){const o=this.beans.gos.addGridCommonParams({type:"cellEditRequest",event:null,rowIndex:this.rowIndex,rowPinned:this.rowPinned,column:e,colDef:e.getColDef(),data:this.data,node:this,oldValue:t,newValue:a,value:a,source:n});this.beans.eventService.dispatchEvent(o)}setGroupValue(e,t){const a=this.beans.columnModel.getCol(e);O(this.groupData)&&(this.groupData={});const n=a.getColId(),o=this.groupData[n];o!==t&&(this.groupData[n]=t,this.dispatchCellChangedEvent(a,t,o))}setAggData(e){const t=this.aggData;if(this.aggData=e,this.localEventService){const a=e=>{const a=this.aggData?this.aggData[e]:void 0,n=t?t[e]:void 0;if(a===n)return;const o=this.beans.columnModel.getCol(e);o&&this.dispatchCellChangedEvent(o,a,n)};for(const e in this.aggData)a(e);for(const t in e)t in this.aggData||a(t)}}updateHasChildren(){let e=this.group&&!this.footer||this.childrenAfterGroup&&this.childrenAfterGroup.length>0;if(this.beans.gos.isRowModelType("serverSide")){const t=this.beans.gos.get("treeData"),a=this.beans.gos.get("isServerSideGroup");e=!this.stub&&!this.footer&&(t?!!a&&a(this.data):!!this.group)}e!==this.__hasChildren&&(this.__hasChildren=!!e,this.dispatchRowEvent("hasChildrenChanged"))}hasChildren(){return null==this.__hasChildren&&this.updateHasChildren(),this.__hasChildren}isEmptyRowGroupNode(){return(this.group&&N(this.childrenAfter';
      S = S + 'Group))??!1}dispatchCellChangedEvent(e,t,a){const n={type:"cellChanged",node:this,column:e,newValue:t,oldValue:a};this.localEventService?.dispatchEvent(n)}resetQuickFilterAggregateText(){this.quickFilterAggregateText=null}isExpandable(){return!this.footer&&(this.beans.columnModel.isPivotMode()?this.hasChildren()&&!this.leafGroup:this.hasChildren()||!!this.master)}isSelected(){return this.footer?this.sibling.isSelected():this.selected}depthFirstSearch(e){this.childrenAfterGroup&&this.childrenAfterGroup.forEach((t=>t.depthFirstSearch(e))),e(this)}calculateSelectedFromChildren(){let e=!1,t=!1,a=!1;if(!this.childrenAfterGroup?.length)return this.selectable?this.selected:null;for(let n=0;n<this.childrenAfterGroup.length;n++){const o=this.childrenAfterGroup[n];let r=o.isSelected();if(!o.selectable){const e=o.calculateSelectedFromChildren();if(null===e)continue;r=e}switch(r){case!0:e=!0;break;case!1:t=!0;break;default:a=!0}}return a||e&&t?void 0:!!e||!t&&(this.selectable?this.selected:null)}setSelectedInitialValue(e){this.selected=e}dispatchRowEvent(e){const t={type:e,node:this};this.localEventService?.dispatchEvent(t)}selectThisNode(e,t,a="api"){const n=!this.selectable&&e,o=this.selected===e;if(n||o)return!1;this.selected=e,this.dispatchRowEvent("rowSelected");const r=this.sibling;r&&r.footer&&r.localEventService&&r.dispatchRowEvent("rowSelected");const i={...this.createGlobalRowEvent("rowSelected"),event:t||null,source:a};return this.beans.eventService.dispatchEvent(i),!0}setSelected(e,t=!1,a="api"){"boolean"!=typeof a?this.setSelectedParams({newValue:e,clearSelection:t,rangeSelect:!1,source:a}):ce("since version v30, rowNode.setSelected() property `suppressFinishActions` has been removed, please use `gridApi.setNodesSelected()` for bulk actions, and the event `source` property for ignoring events instead.")}setSelectedParams(e){return this.rowPinned?(ce("cannot select pinned rows"),0):void 0===this.id?(ce("cannot select node until id for node is known"),0):this.beans.s';
      S = S + 'electionService.setNodesSelected({...e,nodes:[this.footer?this.sibling:this]})}isRowPinned(){return"top"===this.rowPinned||"bottom"===this.rowPinned}isParentOfNode(e){let t=this.parent;for(;t;){if(t===e)return!0;t=t.parent}return!1}addEventListener(e,t){this.localEventService||(this.localEventService=new c),this.beans.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.localEventService.setFrameworkOverrides(this.beans.frameworkOverrides),this.frameworkEventListenerService=new T(this.beans.frameworkOverrides));const a=this.frameworkEventListenerService?.wrap(t)??t;this.localEventService.addEventListener(e,a)}removeEventListener(e,t){if(!this.localEventService)return;const a=this.frameworkEventListenerService?.unwrap(t)??t;this.localEventService.removeEventListener(e,a),this.localEventService.noRegisteredListenersExist()&&(this.localEventService=null)}onMouseEnter(){this.dispatchRowEvent("mouseEnter")}onMouseLeave(){this.dispatchRowEvent("mouseLeave")}getFirstChildOfFirstChild(e){let t=this,a=!0,n=!1,o=null;for(;a&&!n;){const r=t.parent;L(r)&&t.firstChild?r.rowGroupColumn===e&&(n=!0,o=r):a=!1,t=r}return n?o:null}isFullWidthCell(){if(this.detail)return!0;const e=this.beans.gos.getCallback("isFullWidthRow");return!!e&&e({rowNode:this})}getRoute(){if(null==this.key)return;const e=[];let t=this;for(;t&&null!=t.key;)e.push(t.key),t=t.parent;return e.reverse()}createFooter(){if(this.sibling)return;const t=new Set(["eventService","__objectId","sticky"]),a=new e(this.beans);Object.keys(this).forEach((e=>{t.has(e)||(a[e]=this[e])})),a.footer=!0,a.setRowTop(null),a.setRowIndex(null),a.oldRowTop=null,a.id="rowGroupFooter_"+this.id,a.sibling=this,this.sibling=a}destroyFooter(){this.sibling&&(this.sibling.setRowTop(null),this.sibling.setRowIndex(null),this.sibling=void 0)}};no.ID_PREFIX_ROW_GROUP="row-group-",no.ID_PREFIX_TOP_PINNED="t-",no.ID_PREFIX_BOTTOM_PINNED="b-",no.OBJECT_ID_SEQUENCE=0;var oo=no,ro=class extends A{constructor(){super(...argume';
      S = S + 'nts),this.beanName="filterManager",this.advancedFilterModelUpdateQueue=[]}wireBeans(e){this.columnModel=e.columnModel,this.dataTypeService=e.dataTypeService,this.quickFilterService=e.quickFilterService,this.advancedFilterService=e.advancedFilterService,this.columnFilterService=e.columnFilterService}postConstruct(){this.addManagedEventListeners({columnValueChanged:this.refreshFiltersForAggregations.bind(this),columnPivotChanged:this.refreshFiltersForAggregations.bind(this),columnPivotModeChanged:this.refreshFiltersForAggregations.bind(this),newColumnsLoaded:this.updateAdvancedFilterColumns.bind(this),columnVisible:this.updateAdvancedFilterColumns.bind(this),advancedFilterEnabledChanged:({enabled:e})=>this.onAdvancedFilterEnabledChanged(e),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.addManagedPropertyListeners(["isExternalFilterPresent","doesExternalFilterPass"],(()=>{this.onFilterChanged({source:"api"})})),this.updateAggFiltering(),this.addManagedPropertyListener("groupAggFiltering",(()=>{this.updateAggFiltering(),this.onFilterChanged()})),this.addManagedPropertyListener("advancedFilterModel",(e=>this.setAdvancedFilterModel(e.currentValue))),this.quickFilterService&&this.addManagedListeners(this.quickFilterService,{quickFilterChanged:()=>this.onFilterChanged({source:"quickFilter"})})}isExternalFilterPresentCallback(){const e=this.gos.getCallback("isExternalFilterPresent");return"function"==typeof e&&e({})}doesExternalFilterPass(e){const t=this.gos.get("doesExternalFilterPass");return"function"==typeof t&&t(e)}setFilterModel(e,t="api"){this.isAdvancedFilterEnabled()?this.warnAdvancedFilters():this.columnFilterService?.setFilterModel(e,t)}getFilterModel(){return this.columnFilterService?.getFilterModel()??{}}isColumnFilterPresent(){return!!this.columnFilterService?.isColumnFilterPresent()}isAggregateFilterPresent(){return!!this.columnFilterService?.isAggregateFilterPresent()}is';
      S = S + 'ExternalFilterPresent(){return this.externalFilterPresent}isChildFilterPresent(){return this.isColumnFilterPresent()||this.isQuickFilterPresent()||this.isExternalFilterPresent()||this.isAdvancedFilterPresent()}isAdvancedFilterPresent(){return this.isAdvancedFilterEnabled()&&this.advancedFilterService.isFilterPresent()}onAdvancedFilterEnabledChanged(e){e?this.columnFilterService?.disableColumnFilters()&&this.onFilterChanged({source:"advancedFilter"}):this.advancedFilterService?.isFilterPresent()&&(this.advancedFilterService.setModel(null),this.onFilterChanged({source:"advancedFilter"}))}isAdvancedFilterEnabled(){return!!this.advancedFilterService?.isEnabled()}isAdvancedFilterHeaderActive(){return this.isAdvancedFilterEnabled()&&this.advancedFilterService.isHeaderActive()}isAnyFilterPresent(){return this.isQuickFilterPresent()||this.isColumnFilterPresent()||this.isAggregateFilterPresent()||this.isExternalFilterPresent()||this.isAdvancedFilterPresent()}resetQuickFilterCache(){this.quickFilterService?.resetQuickFilterCache()}refreshFiltersForAggregations(){this.gos.getGroupAggFiltering()&&this.onFilterChanged()}onFilterChanged(e={}){const{source:t,additionalEventAttributes:a,columns:n=[]}=e;this.externalFilterPresent=this.isExternalFilterPresentCallback(),(this.columnFilterService?this.columnFilterService.updateBeforeFilterChanged(e):Cn.resolve()).then((()=>{const e={source:t,type:"filterChanged",columns:n};a&&_(e,a),this.eventService.dispatchEvent(e),this.columnFilterService?.updateAfterFilterChanged()}))}isSuppressFlashingCellsBecauseFiltering(){return!!this.columnFilterService?.isSuppressFlashingCellsBecauseFiltering()}isQuickFilterPresent(){return!!this.quickFilterService?.isQuickFilterPresent()}updateAggFiltering(){this.aggFiltering=!!this.gos.getGroupAggFiltering()}isAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&this.shouldApplyQuickFilterAfterAgg()}isNonAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&!this.shouldApplyQuickFil';
      S = S + 'terAfterAgg()}shouldApplyQuickFilterAfterAgg(){return(this.aggFiltering||this.columnModel.isPivotMode())&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")}doesRowPassOtherFilters(e,t){return this.doesRowPassFilter({rowNode:t,filterInstanceToSkip:e})}doesRowPassAggregateFilters(e){return!(this.isAggregateQuickFilterPresent()&&!this.quickFilterService.doesRowPassQuickFilter(e.rowNode))&&!(this.isAggregateFilterPresent()&&!this.columnFilterService.doAggregateFiltersPass(e.rowNode,e.filterInstanceToSkip))}doesRowPassFilter(e){return!(this.isNonAggregateQuickFilterPresent()&&!this.quickFilterService.doesRowPassQuickFilter(e.rowNode))&&(!(this.isExternalFilterPresent()&&!this.doesExternalFilterPass(e.rowNode))&&(!(this.isColumnFilterPresent()&&!this.columnFilterService.doColumnFiltersPass(e.rowNode,e.filterInstanceToSkip))&&!(this.isAdvancedFilterPresent()&&!this.advancedFilterService.doesFilterPass(e.rowNode))))}isFilterActive(e){return!!this.columnFilterService?.isFilterActive(e)}getOrCreateFilterWrapper(e){return this.columnFilterService?.getOrCreateFilterWrapper(e)??null}getDefaultFloatingFilter(e){return this.columnFilterService.getDefaultFloatingFilter(e)}createFilterParams(e,t){return this.columnFilterService.createFilterParams(e,t)}isFilterAllowed(e){return!this.isAdvancedFilterEnabled()&&!!this.columnFilterService?.isFilterAllowed(e)}getFloatingFilterCompDetails(e,t){return this.columnFilterService?.getFloatingFilterCompDetails(e,t)}getCurrentFloatingFilterParentModel(e){return this.columnFilterService?.getCurrentFloatingFilterParentModel(e)}destroyFilter(e,t="api"){this.columnFilterService?.destroyFilter(e,t)}areFilterCompsDifferent(e,t){return!!this.columnFilterService?.areFilterCompsDifferent(e,t)}getAdvancedFilterModel(){return this.isAdvancedFilterEnabled()?this.advancedFilterService.getModel():null}setAdvancedFilterModel(e){this.isAdvancedFilterEnabled()&&(this.dataTypeService?.isPendingInference()?this.advancedFilterModelUpdateQueue.push(e):(this.advanced';
      S = S + 'FilterService.setModel(e??null),this.onFilterChanged({source:"advancedFilter"})))}toggleAdvancedFilterBuilder(e,t){this.isAdvancedFilterEnabled()&&this.advancedFilterService.getCtrl().toggleFilterBuilder(t,e)}updateAdvancedFilterColumns(){this.isAdvancedFilterEnabled()&&this.advancedFilterService.updateValidity()&&this.onFilterChanged({source:"advancedFilter"})}hasFloatingFilters(){return!this.isAdvancedFilterEnabled()&&!!this.columnFilterService?.hasFloatingFilters()}getFilterInstance(e,t){if(!this.isAdvancedFilterEnabled())return this.columnFilterService?.getFilterInstance(e,t);this.warnAdvancedFilters()}getColumnFilterInstance(e){return this.isAdvancedFilterEnabled()?(this.warnAdvancedFilters(),Promise.resolve(void 0)):this.columnFilterService?.getColumnFilterInstance(e)??Promise.resolve(void 0)}warnAdvancedFilters(){ce("Column Filter API methods have been disabled as Advanced Filters are enabled.")}setupAdvancedFilterHeaderComp(e){this.advancedFilterService?.getCtrl().setupHeaderComp(e)}getHeaderRowCount(){return this.isAdvancedFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvancedFilterHeaderActive()?this.advancedFilterService.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){this.advancedFilterModelUpdateQueue.forEach((e=>this.setAdvancedFilterModel(e))),this.advancedFilterModelUpdateQueue=[]}getColumnFilterModel(e){return this.columnFilterService?.getColumnFilterModel(e)}setColumnFilterModel(e,t){return this.isAdvancedFilterEnabled()?(this.warnAdvancedFilters(),Promise.resolve()):this.columnFilterService?.setColumnFilterModel(e,t)??Promise.resolve()}},io=class extends Ba{constructor(e,t){super(\'<div class="ag-filter"></div>\'),this.column=e,this.source=t,this.filterWrapper=null}wireBeans(e){this.filterManager=e.filterManager,this.columnModel=e.columnModel}postConstruct(){this.createFilter(!0),this.addManagedEventListeners({filterDestroyed:this.onFilterDestroyed.bind(this)})}hasFilter(){return!!this.filterWrapper}getFilter(){return this.f';
      S = S + 'ilterWrapper?.filterPromise??null}afterInit(){return this.filterWrapper?.filterPromise?.then((()=>{}))??Cn.resolve()}afterGuiAttached(e){this.filterWrapper?.filterPromise?.then((t=>{t?.afterGuiAttached?.(e)}))}afterGuiDetached(){this.filterWrapper?.filterPromise?.then((e=>{e?.afterGuiDetached?.()}))}createFilter(e){const{column:t,source:a}=this;this.filterWrapper=this.filterManager?.getOrCreateFilterWrapper(t)??null,this.filterWrapper?.filterPromise&&this.filterWrapper.filterPromise.then((n=>{const o=n.getGui();if(L(o)||ce(`getGui method from filter returned ${o}; it should be a DOM element.`),this.appendChild(o),e){const e={type:"filterOpened",column:t,source:a,eGui:this.getGui()};this.eventService.dispatchEvent(e)}}))}onFilterDestroyed(e){"api"!==e.source&&"paramsUpdated"!==e.source||e.column.getId()!==this.column.getId()||!this.columnModel.getColDefCol(this.column)||(ba(this.getGui()),this.createFilter())}destroy(){this.filterWrapper=null,super.destroy()}},so="ag-resizer-wrapper",lo=`<div class="${so}">\\n        <div data-ref="eTopLeftResizer" class="ag-resizer ag-resizer-topLeft"></div>\\n        <div data-ref="eTopResizer" class="ag-resizer ag-resizer-top"></div>\\n        <div data-ref="eTopRightResizer" class="ag-resizer ag-resizer-topRight"></div>\\n        <div data-ref="eRightResizer" class="ag-resizer ag-resizer-right"></div>\\n        <div data-ref="eBottomRightResizer" class="ag-resizer ag-resizer-bottomRight"></div>\\n        <div data-ref="eBottomResizer" class="ag-resizer ag-resizer-bottom"></div>\\n        <div data-ref="eBottomLeftResizer" class="ag-resizer ag-resizer-bottomLeft"></div>\\n        <div data-ref="eLeftResizer" class="ag-resizer ag-resizer-left"></div>\\n    </div>`,co=class extends A{constructor(e,t){super(),this.element=e,this.dragStartPosition={x:0,y:0},this.position={x:0,y:0},this.lastSize={width:-1,height:-1},this.positioned=!1,this.resizersAdded=!1,this.resizeListeners=[],this.boundaryEl=null,this.isResizing=!1,this.isMoving=!1,this.res';
      S = S + 'izable={},this.movable=!1,this.currentResizer=null,this.config=Object.assign({},{popup:!1},t)}wireBeans(e){this.popupService=e.popupService,this.resizeObserverService=e.resizeObserverService,this.dragService=e.dragService}center(){const{clientHeight:e,clientWidth:t}=this.offsetParent,a=t/2-this.getWidth()/2,n=e/2-this.getHeight()/2;this.offsetElement(a,n)}initialisePosition(){if(this.positioned)return;const{centered:e,forcePopupParentAsOffsetParent:t,minWidth:a,width:n,minHeight:o,height:r,x:i,y:s}=this.config;this.offsetParent||this.setOffsetParent();let l=0,c=0;const g=ya(this.element);if(g){const e=this.findBoundaryElement(),t=window.getComputedStyle(e);if(null!=t.minWidth){const a=e.offsetWidth-this.element.offsetWidth;c=parseInt(t.minWidth,10)-a}if(null!=t.minHeight){const a=e.offsetHeight-this.element.offsetHeight;l=parseInt(t.minHeight,10)-a}}if(this.minHeight=o||l,this.minWidth=a||c,n&&this.setWidth(n),r&&this.setHeight(r),n&&r||this.refreshSize(),e)this.center();else if(i||s)this.offsetElement(i,s);else if(g&&t){let e=this.boundaryEl,t=!0;if(e||(e=this.findBoundaryElement(),t=!1),e){const a=parseFloat(e.style.top),n=parseFloat(e.style.left);t?this.offsetElement(isNaN(n)?0:n,isNaN(a)?0:a):this.setPosition(n,a)}}this.positioned=!!this.offsetParent}isPositioned(){return this.positioned}getPosition(){return this.position}setMovable(e,t){if(!this.config.popup||e===this.movable)return;this.movable=e;const a=this.moveElementDragListener||{eElement:t,onDragStart:this.onMoveStart.bind(this),onDragging:this.onMove.bind(this),onDragStop:this.onMoveEnd.bind(this)};e?(this.dragService.addDragSource(a),this.moveElementDragListener=a):(this.dragService.removeDragSource(a),this.moveElementDragListener=void 0)}setResizable(e){if(this.clearResizeListeners(),e?this.addResizers():this.removeResizers(),"boolean"==typeof e){if(!1===e)return;e={topLeft:e,top:e,topRight:e,right:e,bottomRight:e,bottom:e,bottomLeft:e,left:e}}Object.keys(e).forEach((t=>{const a=!!e[t],n=this.getResiz';
      S = S + 'erElement(t),o={dragStartPixels:0,eElement:n,onDragStart:e=>this.onResizeStart(e,t),onDragging:this.onResize.bind(this),onDragStop:e=>this.onResizeEnd(e,t)};(a||!this.isAlive()&&!a)&&(a?(this.dragService.addDragSource(o),this.resizeListeners.push(o),n.style.pointerEvents="all"):n.style.pointerEvents="none",this.resizable[t]=a)}))}removeSizeFromEl(){this.element.style.removeProperty("height"),this.element.style.removeProperty("width"),this.element.style.removeProperty("flex")}restoreLastSize(){this.element.style.flex="0 0 auto";const{height:e,width:t}=this.lastSize;-1!==t&&(this.element.style.width=`${t}px`),-1!==e&&(this.element.style.height=`${e}px`)}getHeight(){return this.element.offsetHeight}setHeight(e){const{popup:t}=this.config,a=this.element;let n=!1;if("string"==typeof e&&-1!==e.indexOf("%"))Ma(a,e),e=ha(a),n=!0;else if(e=Math.max(this.minHeight,e),this.positioned){const t=this.getAvailableHeight();t&&e>t&&(e=t)}this.getHeight()!==e&&(n?(a.style.maxHeight="unset",a.style.minHeight="unset"):t?Ma(a,e):(a.style.height=`${e}px`,a.style.flex="0 0 auto",this.lastSize.height="number"==typeof e?e:parseFloat(e)))}getAvailableHeight(){const{popup:e,forcePopupParentAsOffsetParent:t}=this.config;this.positioned||this.initialisePosition();const{clientHeight:a}=this.offsetParent;if(!a)return null;const n=this.element.getBoundingClientRect(),o=this.offsetParent.getBoundingClientRect(),r=e?this.position.y:n.top,i=e?0:o.top;let s=0;if(t){const e=this.element.parentElement;if(e){const{bottom:t}=e.getBoundingClientRect();s=t-n.bottom}}return a+i-r-s}getWidth(){return this.element.offsetWidth}setWidth(e){const t=this.element,{popup:a}=this.config;let n=!1;if("string"==typeof e&&-1!==e.indexOf("%"))Fa(t,e),e=ua(t),n=!0;else if(this.positioned){e=Math.max(this.minWidth,e);const{clientWidth:t}=this.offsetParent,n=a?this.position.x:this.element.getBoundingClientRect().left;t&&e+n>t&&(e=t-n)}this.getWidth()!==e&&(n?(t.style.maxWidth="unset",t.style.minWidth="unset"):this.config.pop';
      S = S + 'up?Fa(t,e):(t.style.width=`${e}px`,t.style.flex=" unset",this.lastSize.width="number"==typeof e?e:parseFloat(e)))}offsetElement(e=0,t=0){const{forcePopupParentAsOffsetParent:a}=this.config,n=a?this.boundaryEl:this.element;n&&(this.popupService.positionPopup({ePopup:n,keepWithinBounds:!0,skipObserver:this.movable||this.isResizable(),updatePosition:()=>({x:e,y:t})}),this.setPosition(parseFloat(n.style.left),parseFloat(n.style.top)))}constrainSizeToAvailableHeight(e){if(!this.config.forcePopupParentAsOffsetParent)return;const t=()=>{const e=this.getAvailableHeight();this.element.style.setProperty("max-height",`${e}px`)};e?this.resizeObserverSubscriber=this.resizeObserverService.observeResize(this.popupService.getPopupParent(),t):(this.element.style.removeProperty("max-height"),this.resizeObserverSubscriber&&(this.resizeObserverSubscriber(),this.resizeObserverSubscriber=void 0))}setPosition(e,t){this.position.x=e,this.position.y=t}updateDragStartPosition(e,t){this.dragStartPosition={x:e,y:t}}calculateMouseMovement(e){const{e:t,isLeft:a,isTop:n,anywhereWithin:o,topBuffer:r}=e,i=t.clientX-this.dragStartPosition.x,s=t.clientY-this.dragStartPosition.y;return{movementX:this.shouldSkipX(t,!!a,!!o,i)?0:i,movementY:this.shouldSkipY(t,!!n,r,s)?0:s}}shouldSkipX(e,t,a,n){const o=this.element.getBoundingClientRect(),r=this.offsetParent.getBoundingClientRect(),i=this.boundaryEl.getBoundingClientRect(),s=this.config.popup?this.position.x:o.left;let l=s<=0&&r.left>=e.clientX||r.right<=e.clientX&&r.right<=i.right;return!!l||(l=t?n<0&&e.clientX>s+r.left||n>0&&e.clientX<s+r.left:a?n<0&&e.clientX>i.right||n>0&&e.clientX<s+r.left:n<0&&e.clientX>i.right||n>0&&e.clientX<i.right,l)}shouldSkipY(e,t,a=0,n){const o=this.element.getBoundingClientRect(),r=this.offsetParent.getBoundingClientRect(),i=this.boundaryEl.getBoundingClientRect(),s=this.config.popup?this.position.y:o.top;let l=s<=0&&r.top>=e.clientY||r.bottom<=e.clientY&&r.bottom<=i.bottom;return!!l||(l=t?n<0&&e.clientY>s+r.top+a||n>0&&e.c';
      S = S + 'lientY<s+r.top:n<0&&e.clientY>i.bottom||n>0&&e.clientY<i.bottom,l)}createResizeMap(){const e=this.element;this.resizerMap={topLeft:{element:e.querySelector("[data-ref=eTopLeftResizer]")},top:{element:e.querySelector("[data-ref=eTopResizer]")},topRight:{element:e.querySelector("[data-ref=eTopRightResizer]")},right:{element:e.querySelector("[data-ref=eRightResizer]")},bottomRight:{element:e.querySelector("[data-ref=eBottomRightResizer]")},bottom:{element:e.querySelector("[data-ref=eBottomResizer]")},bottomLeft:{element:e.querySelector("[data-ref=eBottomLeftResizer]")},left:{element:e.querySelector("[data-ref=eLeftResizer]")}}}addResizers(){if(this.resizersAdded)return;const e=this.element;if(!e)return;const t=(new DOMParser).parseFromString(lo,"text/html").body;e.appendChild(t.firstChild),this.createResizeMap(),this.resizersAdded=!0}removeResizers(){this.resizerMap=void 0;const e=this.element.querySelector(`.${so}`);e&&this.element.removeChild(e),this.resizersAdded=!1}getResizerElement(e){return this.resizerMap[e].element}onResizeStart(e,t){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.currentResizer={isTop:!!t.match(/top/i),isRight:!!t.match(/right/i),isBottom:!!t.match(/bottom/i),isLeft:!!t.match(/left/i)},this.element.classList.add("ag-resizing"),this.resizerMap[t].element.classList.add("ag-active");const{popup:a,forcePopupParentAsOffsetParent:n}=this.config;a||n||this.applySizeToSiblings(this.currentResizer.isBottom||this.currentResizer.isTop),this.isResizing=!0,this.updateDragStartPosition(e.clientX,e.clientY)}getSiblings(){const e=this.element.parentElement;return e?Array.prototype.slice.call(e.children).filter((e=>!e.classList.contains("ag-hidden"))):null}getMinSizeOfSiblings(){const e=this.getSiblings()||[];let t=0,a=0;for(let n=0;n<e.length;n++){const o=e[n],r=!!o.style.flex&&"0 0 auto"!==o.style.flex;if(o===this.element)continue;let i=this.minHeight||0,s=this.minWidth||0;if(r){const e=window.getComputedStyle(o);e.';
      S = S + 'minHeight&&(i=parseInt(e.minHeight,10)),e.minWidth&&(s=parseInt(e.minWidth,10))}else i=o.offsetHeight,s=o.offsetWidth;t+=i,a+=s}return{height:t,width:a}}applySizeToSiblings(e){let t=null;const a=this.getSiblings();if(a){for(let n=0;n<a.length;n++){const o=a[n];o!==t&&(e?o.style.height=`${o.offsetHeight}px`:o.style.width=`${o.offsetWidth}px`,o.style.flex="0 0 auto",o===this.element&&(t=a[n+1]))}t&&(t.style.removeProperty("height"),t.style.removeProperty("min-height"),t.style.removeProperty("max-height"),t.style.flex="1 1 auto")}}isResizable(){return Object.values(this.resizable).some((e=>e))}onResize(e){if(!this.isResizing||!this.currentResizer)return;const{popup:t,forcePopupParentAsOffsetParent:a}=this.config,{isTop:n,isRight:o,isBottom:r,isLeft:i}=this.currentResizer,s=o||i,l=r||n,{movementX:c,movementY:g}=this.calculateMouseMovement({e:e,isLeft:i,isTop:n}),d=this.position.x,h=this.position.y;let u=0,p=0;if(s&&c){const e=i?-1:1,t=this.getWidth(),a=t+c*e;let n=!1;i&&(u=t-a,(d+u<=0||a<=this.minWidth)&&(n=!0,u=0)),n||this.setWidth(a)}if(l&&g){const e=n?-1:1,t=this.getHeight(),a=t+g*e;let o=!1;n?(p=t-a,(h+p<=0||a<=this.minHeight)&&(o=!0,p=0)):!this.config.popup&&!this.config.forcePopupParentAsOffsetParent&&t<a&&this.getMinSizeOfSiblings().height+a>this.element.parentElement.offsetHeight&&(o=!0),o||this.setHeight(a)}this.updateDragStartPosition(e.clientX,e.clientY),((t||a)&&u||p)&&this.offsetElement(d+u,h+p)}onResizeEnd(e,t){this.isResizing=!1,this.currentResizer=null,this.boundaryEl=null,this.element.classList.remove("ag-resizing"),this.resizerMap[t].element.classList.remove("ag-active"),this.dispatchLocalEvent({type:"resize"})}refreshSize(){const e=this.element;this.config.popup&&(this.config.width||this.setWidth(e.offsetWidth),this.config.height||this.setHeight(e.offsetHeight))}onMoveStart(e){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.isMoving=!0,this.element.classList.add("ag-moving"),this.updateDragStartPosition(e.cli';
      S = S + 'entX,e.clientY)}onMove(e){if(!this.isMoving)return;const{x:t,y:a}=this.position;let n;this.config.calculateTopBuffer&&(n=this.config.calculateTopBuffer());const{movementX:o,movementY:r}=this.calculateMouseMovement({e:e,isTop:!0,anywhereWithin:!0,topBuffer:n});this.offsetElement(t+o,a+r),this.updateDragStartPosition(e.clientX,e.clientY)}onMoveEnd(){this.isMoving=!1,this.boundaryEl=null,this.element.classList.remove("ag-moving")}setOffsetParent(){this.config.forcePopupParentAsOffsetParent?this.offsetParent=this.popupService.getPopupParent():this.offsetParent=this.element.offsetParent}findBoundaryElement(){let e=this.element;for(;e;){if("static"!==window.getComputedStyle(e).position)return e;e=e.parentElement}return this.element}clearResizeListeners(){for(;this.resizeListeners.length;){const e=this.resizeListeners.pop();this.dragService.removeDragSource(e)}}destroy(){super.destroy(),this.moveElementDragListener&&this.dragService.removeDragSource(this.moveElementDragListener),this.constrainSizeToAvailableHeight(!1),this.clearResizeListeners(),this.removeResizers()}},go=class e extends A{constructor(e,t={}){super(),this.eFocusableElement=e,this.callbacks=t,this.callbacks={shouldStopEventPropagation:()=>!1,onTabKeyDown:e=>{if(e.defaultPrevented)return;const t=this.focusService.findNextFocusableElement(this.eFocusableElement,!1,e.shiftKey);t&&(t.focus(),e.preventDefault())},...t}}wireBeans(e){this.focusService=e.focusService}postConstruct(){this.eFocusableElement.classList.add(e.FOCUS_MANAGED_CLASS),this.addKeyDownListeners(this.eFocusableElement),this.callbacks.onFocusIn&&this.addManagedElementListeners(this.eFocusableElement,{focusin:this.callbacks.onFocusIn}),this.callbacks.onFocusOut&&this.addManagedElementListeners(this.eFocusableElement,{focusout:this.callbacks.onFocusOut})}addKeyDownListeners(e){this.addManagedElementListeners(e,{keydown:e=>{e.defaultPrevented||M(e)||(this.callbacks.shouldStopEventPropagation(e)?F(e):e.key===tn.TAB?this.callbacks.onTabKeyDown(e):thi';
      S = S + 's.callbacks.handleKeyDown&&this.callbacks.handleKeyDown(e))}})}};go.FOCUS_MANAGED_CLASS="ag-focus-managed";var ho=go,uo={applyFilter:"Apply",clearFilter:"Clear",resetFilter:"Reset",cancelFilter:"Cancel",textFilter:"Text Filter",numberFilter:"Number Filter",dateFilter:"Date Filter",setFilter:"Set Filter",filterOoo:"Filter...",empty:"Choose one",equals:"Equals",notEqual:"Does not equal",lessThan:"Less than",greaterThan:"Greater than",inRange:"Between",inRangeStart:"From",inRangeEnd:"To",lessThanOrEqual:"Less than or equal to",greaterThanOrEqual:"Greater than or equal to",contains:"Contains",notContains:"Does not contain",startsWith:"Begins with",endsWith:"Ends with",blank:"Blank",notBlank:"Not blank",before:"Before",after:"After",andCondition:"AND",orCondition:"OR",dateFormatOoo:"yyyy-mm-dd"};function po(e,t){return mo(e)?(null!=e.debounceMs&&ce("debounceMs is ignored when apply button is present"),0):null!=e.debounceMs?e.debounceMs:t}function mo(e){return!!e.buttons&&e.buttons.indexOf("apply")>=0}var fo=class extends Ba{constructor(e){super(),this.filterNameKey=e,this.applyActive=!1,this.hidePopup=null,this.debouncePending=!1,this.appliedModel=null,this.eFilterBody=qa,this.buttonListeners=[]}wireBeans(e){this.rowModel=e.rowModel}postConstruct(){this.resetTemplate(),this.createManagedBean(new ho(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.positionableFeature=new co(this.getPositionableElement(),{forcePopupParentAsOffsetParent:!0}),this.createBean(this.positionableFeature)}handleKeyDown(e){}getFilterTitle(){return this.translate(this.filterNameKey)}isFilterActive(){return!!this.appliedModel}resetTemplate(e){let t=this.getGui();t&&t.removeEventListener("submit",this.onFormSubmit);const a=`\\n            <form class="ag-filter-wrapper">\\n                <div class="ag-filter-body-wrapper ag-${this.getCssIdentifier()}-body-wrapper" data-ref="eFilterBody">\\n                    ${this.createBodyTemplate()}\\n                </div>\\n        ';
      S = S + '    </form>`;this.setTemplate(a,this.getAgComponents(),e),t=this.getGui(),t&&t.addEventListener("submit",this.onFormSubmit)}isReadOnly(){return!!this.providedFilterParams.readOnly}init(e){this.setParams(e),this.resetUiToDefaults(!0).then((()=>{this.updateUiVisibility(),this.setupOnBtApplyDebounce()}))}setParams(e){this.providedFilterParams=e,this.applyActive=mo(e),this.resetButtonsPanel()}updateParams(e){this.providedFilterParams=e,this.applyActive=mo(e),this.resetUiToActiveModel(this.getModel(),(()=>{this.updateUiVisibility(),this.setupOnBtApplyDebounce()}))}resetButtonsPanel(){const{buttons:e}=this.providedFilterParams,t=e&&e.length>0&&!this.isReadOnly();if(this.eButtonsPanel?(ba(this.eButtonsPanel),this.buttonListeners.forEach((e=>e())),this.buttonListeners=[]):t&&(this.eButtonsPanel=document.createElement("div"),this.eButtonsPanel.classList.add("ag-filter-apply-panel")),!t)return void(this.eButtonsPanel&&Ca(this.eButtonsPanel));const a=document.createDocumentFragment(),n=e=>{let t,n;switch(e){case"apply":t=this.translate("applyFilter"),n=e=>this.onBtApply(!1,!1,e);break;case"clear":t=this.translate("clearFilter"),n=()=>this.onBtClear();break;case"reset":t=this.translate("resetFilter"),n=()=>this.onBtReset();break;case"cancel":t=this.translate("cancelFilter"),n=e=>{this.onBtCancel(e)};break;default:return void ce("Unknown button type specified")}const o=Sa(`<button\\n                    type="${"apply"===e?"submit":"button"}"\\n                    data-ref="${e}FilterButton"\\n                    class="ag-button ag-standard-button ag-filter-apply-panel-button"\\n                >${t}\\n                </button>`);this.buttonListeners.push(...this.addManagedElementListeners(o,{click:n})),a.append(o)};e.forEach((e=>n(e))),this.eButtonsPanel.append(a),this.getGui().appendChild(this.eButtonsPanel)}getDefaultDebounceMs(){return 0}setupOnBtApplyDebounce(){const e=po(this.providedFilterParams,this.getDefaultDebounceMs()),t=fe(this.checkApplyDebounce.bind(this),e);this.onBtA';
      S = S + 'pplyDebounce=()=>{this.debouncePending=!0,t()}}checkApplyDebounce(){this.debouncePending&&(this.debouncePending=!1,this.onBtApply())}getModel(){return this.appliedModel?this.appliedModel:null}setModel(e){return(null!=e?this.setModelIntoUi(e):this.resetUiToDefaults()).then((()=>{this.updateUiVisibility(),this.applyModel("api")}))}onBtCancel(e){this.resetUiToActiveModel(this.getModel(),(()=>{this.handleCancelEnd(e)}))}handleCancelEnd(e){this.providedFilterParams.closeOnApply&&this.close(e)}resetUiToActiveModel(e,t){const a=()=>{this.onUiChanged(!1,"prevent"),t?.()};null!=e?this.setModelIntoUi(e).then(a):this.resetUiToDefaults().then(a)}onBtClear(){this.resetUiToDefaults().then((()=>this.onUiChanged()))}onBtReset(){this.onBtClear(),this.onBtApply()}applyModel(e="api"){const t=this.getModelFromUi();if(!this.isModelValid(t))return!1;const a=this.appliedModel;return this.appliedModel=t,!this.areModelsEqual(a,t)}isModelValid(e){return!0}onFormSubmit(e){e.preventDefault()}onBtApply(e=!1,t=!1,a){if(a&&a.preventDefault(),this.applyModel(t?"rowDataUpdated":"ui")){const a="columnFilter";this.providedFilterParams.filterChangedCallback({afterFloatingFilter:e,afterDataChange:t,source:a})}const{closeOnApply:n}=this.providedFilterParams;n&&this.applyActive&&!e&&!t&&this.close(a)}onNewRowsLoaded(){}close(e){if(!this.hidePopup)return;const t=e,a=t&&t.key;let n;"Enter"!==a&&"Space"!==a||(n={keyboardEvent:t}),this.hidePopup(n),this.hidePopup=null}onUiChanged(e=!1,t){if(this.updateUiVisibility(),this.providedFilterParams.filterModifiedCallback(),this.applyActive&&!this.isReadOnly()){const e=this.isModelValid(this.getModelFromUi()),t=this.queryForHtmlElement(\'[data-ref="applyFilterButton"]\');t&&sa(t,!e)}e&&!t||"immediately"===t?this.onBtApply(e):(this.applyActive||t)&&"debounce"!==t||this.onBtApplyDebounce()}afterGuiAttached(e){e&&(this.hidePopup=e.hidePopup),this.refreshFilterResizer(e?.container)}refreshFilterResizer(e){if(!this.positionableFeature||"toolPanel"===e)return;const t="float';
      S = S + 'ingFilter"===e||"columnFilter"===e,{positionableFeature:a,gos:n}=this;t?(a.restoreLastSize(),a.setResizable(n.get("enableRtl")?{bottom:!0,bottomLeft:!0,left:!0}:{bottom:!0,bottomRight:!0,right:!0})):(this.positionableFeature.removeSizeFromEl(),this.positionableFeature.setResizable(!1)),this.positionableFeature.constrainSizeToAvailableHeight(!0)}afterGuiDetached(){this.checkApplyDebounce(),this.positionableFeature&&this.positionableFeature.constrainSizeToAvailableHeight(!1)}refresh(e){return this.providedFilterParams=e,!0}destroy(){const e=this.getGui();e&&e.removeEventListener("submit",this.onFormSubmit),this.hidePopup=null,this.positionableFeature&&(this.positionableFeature=this.destroyBean(this.positionableFeature)),this.appliedModel=null,super.destroy()}translate(e){return this.localeService.getLocaleTextFunc()(e,uo[e])}getCellValue(e){return this.providedFilterParams.getValue(e)}getPositionableElement(){return this.eFilterBody}},vo=class extends rn{constructor(e){super(e,"ag-radio-button","radio")}isSelected(){return this.eInput.checked}toggle(){this.eInput.disabled||this.isSelected()||this.setValue(!0)}addInputListeners(){super.addInputListeners(),this.addManagedEventListeners({checkboxChanged:this.onChange.bind(this)})}onChange(e){e.selected&&e.name&&this.eInput.name&&this.eInput.name===e.name&&e.id&&this.eInput.id!==e.id&&this.setValue(!1,!0)}},bo=class extends Ba{constructor(e="default",t=!1){super(`<div class="ag-list ag-${e}-list" role="listbox"></div>`),this.cssIdentifier=e,this.unFocusable=t,this.activeClass="ag-active-item",this.options=[],this.itemEls=[]}postConstruct(){const e=this.getGui();this.addManagedElementListeners(e,{mouseleave:()=>this.clearHighlighted()}),this.unFocusable||this.addManagedElementListeners(e,{keydown:this.handleKeyDown.bind(this)})}handleKeyDown(e){const t=e.key;switch(t){case tn.ENTER:if(this.highlightedEl){const e=this.itemEls.indexOf(this.highlightedEl);this.setValueByIndex(e)}else this.setValue(this.getValue());break;case ';
      S = S + 'tn.DOWN:case tn.UP:e.preventDefault(),this.navigate(t);break;case tn.PAGE_DOWN:case tn.PAGE_UP:case tn.PAGE_HOME:case tn.PAGE_END:e.preventDefault(),this.navigateToPage(t)}}navigate(e){const t=e===tn.DOWN;let a;if(this.highlightedEl){let e=this.itemEls.indexOf(this.highlightedEl)+(t?1:-1);e=Math.min(Math.max(e,0),this.itemEls.length-1),a=this.itemEls[e]}else a=this.itemEls[t?0:this.itemEls.length-1];this.highlightItem(a)}navigateToPage(e){if(!this.highlightedEl||0===this.itemEls.length)return;const t=this.itemEls.indexOf(this.highlightedEl),a=this.options.length-1,n=this.itemEls[0].clientHeight,o=Math.floor(this.getGui().clientHeight/n);let r=-1;e===tn.PAGE_HOME?r=0:e===tn.PAGE_END?r=a:e===tn.PAGE_DOWN?r=Math.min(t+o,a):e===tn.PAGE_UP&&(r=Math.max(t-o,0)),-1!==r&&this.highlightItem(this.itemEls[r])}addOptions(e){return e.forEach((e=>this.addOption(e))),this}addOption(e){const{value:t,text:a}=e,n=a||t;return this.options.push({value:t,text:n}),this.renderOption(t,n),this.updateIndices(),this}clearOptions(){this.options=[],this.reset(!0),this.itemEls.forEach((e=>{Ca(e)})),this.itemEls=[]}updateIndices(){const e=this.getGui().querySelectorAll(".ag-list-item");e.forEach(((t,a)=>{It(t,a+1),Tt(t,e.length)}))}renderOption(e,t){const a=this.gos.getDocument(),n=a.createElement("div");yt(n,"option"),n.classList.add("ag-list-item",`ag-${this.cssIdentifier}-list-item`);const o=a.createElement("span");n.appendChild(o),o.textContent=t,this.unFocusable||(n.tabIndex=-1),this.itemEls.push(n),this.addManagedListeners(n,{mouseover:()=>this.highlightItem(n),mousedown:t=>{t.preventDefault(),t.stopPropagation(),this.setValue(e)}}),this.createManagedBean(new Na({getTooltipValue:()=>t,getGui:()=>n,getLocation:()=>"UNKNOWN",shouldDisplayTooltip:()=>o.scrollWidth>o.clientWidth})),this.getGui().appendChild(n)}setValue(e,t){if(this.value===e)return this.fireItemSelected(),this;if(null==e)return this.reset(t),this;const a=this.options.findIndex((t=>t.value===e));if(-1!==a){const e=this.options[';
      S = S + 'a];this.value=e.value,this.displayValue=e.text,this.highlightItem(this.itemEls[a]),t||this.fireChangeEvent()}return this}setValueByIndex(e){return this.setValue(this.options[e].value)}getValue(){return this.value}getDisplayValue(){return this.displayValue}refreshHighlighted(){this.clearHighlighted();const e=this.options.findIndex((e=>e.value===this.value));-1!==e&&this.highlightItem(this.itemEls[e])}reset(e){this.value=null,this.displayValue=null,this.clearHighlighted(),e||this.fireChangeEvent()}highlightItem(e){if(!ya(e))return;this.clearHighlighted(),this.highlightedEl=e,this.highlightedEl.classList.add(this.activeClass),Vt(this.highlightedEl,!0);const t=this.getGui(),{scrollTop:a,clientHeight:n}=t,{offsetTop:o,offsetHeight:r}=e;(o+r>a+n||o<a)&&this.highlightedEl.scrollIntoView({block:"nearest"}),this.unFocusable||this.highlightedEl.focus()}clearHighlighted(){this.highlightedEl&&ya(this.highlightedEl)&&(this.highlightedEl.classList.remove(this.activeClass),Vt(this.highlightedEl,!1),this.highlightedEl=null)}fireChangeEvent(){this.dispatchLocalEvent({type:"fieldValueChanged"}),this.fireItemSelected()}fireItemSelected(){this.dispatchLocalEvent({type:"selectedItem"})}},Co=class extends nn{constructor(e){if(super(e,e?.template||\'\\n            <div class="ag-picker-field" role="presentation">\\n                <div data-ref="eLabel"></div>\\n                    <div data-ref="eWrapper" class="ag-wrapper ag-picker-field-wrapper ag-picker-collapsed">\\n                    <div data-ref="eDisplayField" class="ag-picker-field-display"></div>\\n                    <div data-ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div>\\n                </div>\\n            </div>\',e?.agComponents||[],e?.className),this.isPickerDisplayed=!1,this.skipClick=!1,this.pickerGap=4,this.hideCurrentPicker=null,this.eLabel=qa,this.eWrapper=qa,this.eDisplayField=qa,this.eIcon=qa,this.ariaRole=e?.ariaRole,this.onPickerFocusIn=this.onPickerFocusIn.bind(this),this.onPickerFocusOut=this.onP';
      S = S + 'ickerFocusOut.bind(this),!e)return;const{pickerGap:t,maxPickerHeight:a,variableWidth:n,minPickerWidth:o,maxPickerWidth:r}=e;null!=t&&(this.pickerGap=t),this.variableWidth=!!n,null!=a&&this.setPickerMaxHeight(a),null!=o&&this.setPickerMinWidth(o),null!=r&&this.setPickerMaxWidth(r)}wireBeans(e){this.popupService=e.popupService}postConstruct(){super.postConstruct(),this.setupAria();const e=`ag-${this.getCompId()}-display`;this.eDisplayField.setAttribute("id",e);const t=this.getAriaElement();this.addManagedElementListeners(t,{keydown:this.onKeyDown.bind(this)}),this.addManagedElementListeners(this.eLabel,{mousedown:this.onLabelOrWrapperMouseDown.bind(this)}),this.addManagedElementListeners(this.eWrapper,{mousedown:this.onLabelOrWrapperMouseDown.bind(this)});const{pickerIcon:a,inputWidth:n}=this.config;if(a){const e=Wa(a,this.gos);e&&this.eIcon.appendChild(e)}null!=n&&this.setInputWidth(n)}setupAria(){const e=this.getAriaElement();e.setAttribute("tabindex",this.gos.get("tabIndex").toString()),Pt(e,!1),this.ariaRole&&yt(e,this.ariaRole)}onLabelOrWrapperMouseDown(e){if(e){const t=this.getFocusableElement();if(t!==this.eWrapper&&e?.target===t)return;e.preventDefault(),this.getFocusableElement().focus()}this.skipClick?this.skipClick=!1:this.isDisabled()||(this.isPickerDisplayed?this.hidePicker():this.showPicker())}onKeyDown(e){switch(e.key){case tn.UP:case tn.DOWN:case tn.ENTER:case tn.SPACE:e.preventDefault(),this.onLabelOrWrapperMouseDown();break;case tn.ESCAPE:this.isPickerDisplayed&&(e.preventDefault(),e.stopPropagation(),this.hideCurrentPicker&&this.hideCurrentPicker())}}showPicker(){this.isPickerDisplayed=!0,this.pickerComponent||(this.pickerComponent=this.createPickerComponent());const e=this.pickerComponent.getGui();e.addEventListener("focusin",this.onPickerFocusIn),e.addEventListener("focusout",this.onPickerFocusOut),this.hideCurrentPicker=this.renderAndPositionPicker(),this.toggleExpandedStyles(!0)}renderAndPositionPicker(){const e=this.gos.getDocument(),t=this.pic';
      S = S + 'kerComponent.getGui();this.gos.get("suppressScrollWhenPopupsAreOpen")||([this.destroyMouseWheelFunc]=this.addManagedEventListeners({bodyScroll:()=>{this.hidePicker()}}));const a=this.localeService.getLocaleTextFunc(),{pickerAriaLabelKey:n,pickerAriaLabelValue:o,modalPicker:r=!0}=this.config,i={modal:r,eChild:t,closeOnEsc:!0,closedCallback:()=>{const t=this.gos.getActiveDomElement(),a=!t||t===e.body;this.beforeHidePicker(),a&&this.isAlive()&&this.getFocusableElement().focus()},ariaLabel:a(n,o)},s=this.popupService.addPopup(i),{maxPickerHeight:l,minPickerWidth:c,maxPickerWidth:g,variableWidth:d}=this;d?(c&&(t.style.minWidth=c),t.style.width=Da(ua(this.eWrapper)),g&&(t.style.maxWidth=g)):za(t,g??ua(this.eWrapper));const h=l??`${ga(this.popupService.getPopupParent())}px`;return t.style.setProperty("max-height",h),t.style.position="absolute",this.alignPickerToComponent(),s.hideFunc}alignPickerToComponent(){if(!this.pickerComponent)return;const{pickerType:e}=this.config,{pickerGap:t}=this,a=this.gos.get("enableRtl")?"right":"left";this.popupService.positionPopupByComponent({type:e,eventSource:this.eWrapper,ePopup:this.pickerComponent.getGui(),position:"under",alignSide:a,keepWithinBounds:!0,nudgeY:t})}beforeHidePicker(){this.destroyMouseWheelFunc&&(this.destroyMouseWheelFunc(),this.destroyMouseWheelFunc=void 0),this.toggleExpandedStyles(!1);const e=this.pickerComponent.getGui();e.removeEventListener("focusin",this.onPickerFocusIn),e.removeEventListener("focusout",this.onPickerFocusOut),this.isPickerDisplayed=!1,this.pickerComponent=void 0,this.hideCurrentPicker=null}toggleExpandedStyles(e){if(!this.isAlive())return;Pt(this.getAriaElement(),e),this.eWrapper.classList.toggle("ag-picker-expanded",e),this.eWrapper.classList.toggle("ag-picker-collapsed",!e)}onPickerFocusIn(){this.togglePickerHasFocus(!0)}onPickerFocusOut(e){this.pickerComponent?.getGui().contains(e.relatedTarget)||this.togglePickerHasFocus(!1)}togglePickerHasFocus(e){this.pickerComponent&&this.eWrapper.classLi';
      S = S + 'st.toggle("ag-picker-has-focus",e)}hidePicker(){this.hideCurrentPicker&&this.hideCurrentPicker()}setInputWidth(e){return za(this.eWrapper,e),this}getFocusableElement(){return this.eWrapper}setPickerGap(e){return this.pickerGap=e,this}setPickerMinWidth(e){return"number"==typeof e&&(e=`${e}px`),this.minPickerWidth=null==e?void 0:e,this}setPickerMaxWidth(e){return"number"==typeof e&&(e=`${e}px`),this.maxPickerWidth=null==e?void 0:e,this}setPickerMaxHeight(e){return"number"==typeof e&&(e=`${e}px`),this.maxPickerHeight=null==e?void 0:e,this}destroy(){this.hidePicker(),super.destroy()}},wo=class extends Co{constructor(e){super({pickerAriaLabelKey:"ariaLabelSelectField",pickerAriaLabelValue:"Select Field",pickerType:"ag-list",className:"ag-select",pickerIcon:"smallDown",ariaRole:"combobox",...e})}postConstruct(){super.postConstruct(),this.createListComponent(),this.eWrapper.tabIndex=this.gos.get("tabIndex");const{options:e,value:t,placeholder:a}=this.config;null!=e&&this.addOptions(e),null!=t&&this.setValue(t,!0),a&&null==t&&(this.eDisplayField.textContent=a),this.addManagedElementListeners(this.eWrapper,{focusout:this.onWrapperFocusOut.bind(this)})}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}createListComponent(){this.listComponent=this.createBean(new bo("select",!0)),this.listComponent.setParentComponent(this);const e=this.listComponent.getAriaElement(),t=`ag-select-list-${this.listComponent.getCompId()}`;e.setAttribute("id",t),Ut(this.getAriaElement(),e),this.listComponent.addManagedListeners(this.listComponent,{selectedItem:()=>{this.hidePicker(),this.dispatchLocalEvent({type:"selectedItem"})}}),this.listComponent.addManagedListeners(this.listComponent,{fieldValueChanged:()=>{this.listComponent&&(this.setValue(this.listComponent.getValue(),!1,!0),this.hidePicker())}})}createPickerComponent(){return this.listComponent}onKeyDown(e){const{key:t}=e;switch(t===tn.TAB&&this.hidePicker(),t){case tn.ENTER:case tn.UP:case tn.DOWN:case tn.PAGE';
      S = S + '_UP:case tn.PAGE_DOWN:case tn.PAGE_HOME:case tn.PAGE_END:e.preventDefault(),this.isPickerDisplayed?this.listComponent?.handleKeyDown(e):super.onKeyDown(e);break;case tn.ESCAPE:super.onKeyDown(e)}}showPicker(){this.listComponent&&(super.showPicker(),this.listComponent.refreshHighlighted())}addOptions(e){return e.forEach((e=>this.addOption(e))),this}addOption(e){return this.listComponent.addOption(e),this}clearOptions(){return this.listComponent?.clearOptions(),this}setValue(e,t,a){if(this.value===e||!this.listComponent)return this;a||this.listComponent.setValue(e,!0);if(this.listComponent.getValue()===this.getValue())return this;let n=this.listComponent.getDisplayValue();return null==n&&this.config.placeholder&&(n=this.config.placeholder),this.eDisplayField.textContent=n,this.setTooltip({newTooltipText:n??null,shouldDisplayTooltip:()=>this.eDisplayField.scrollWidth>this.eDisplayField.clientWidth}),super.setValue(e,t)}destroy(){this.listComponent&&(this.listComponent=this.destroyBean(this.listComponent)),super.destroy()}},yo={selector:"AG-SELECT",component:wo},So=class{constructor(){this.customFilterOptions={}}init(e,t){this.filterOptions=e.filterOptions||t,this.mapCustomOptions(),this.selectDefaultItem(e)}getFilterOptions(){return this.filterOptions}mapCustomOptions(){this.filterOptions&&this.filterOptions.forEach((e=>{if("string"==typeof e)return;[["displayKey"],["displayName"],["predicate","test"]].every((t=>!!t.some((t=>null!=e[t]))||(ce(`ignoring FilterOptionDef as it doesn\'t contain one of \'${t}\'`),!1)))?this.customFilterOptions[e.displayKey]=e:this.filterOptions=this.filterOptions.filter((t=>t===e))||[]}))}selectDefaultItem(e){if(e.defaultOption)this.defaultOption=e.defaultOption;else if(this.filterOptions.length>=1){const e=this.filterOptions[0];"string"==typeof e?this.defaultOption=e:e.displayKey?this.defaultOption=e.displayKey:ce("invalid FilterOptionDef supplied as it doesn\'t contain a \'displayKey\'")}else ce("no filter options for filter")}getDefaultOption(';
      S = S + '){return this.defaultOption}getCustomOption(e){return this.customFilterOptions[e]}},ko=class extends fo{constructor(){super(...arguments),this.eTypes=[],this.eJoinOperatorPanels=[],this.eJoinOperatorsAnd=[],this.eJoinOperatorsOr=[],this.eConditionBodies=[],this.listener=()=>this.onUiChanged(),this.lastUiCompletePosition=null,this.joinOperatorId=0}getNumberOfInputs(e){const t=this.optionsFactory.getCustomOption(e);if(t){const{numberOfInputs:e}=t;return null!=e?e:1}return e&&["empty","notBlank","blank"].indexOf(e)>=0?0:"inRange"===e?2:1}onFloatingFilterChanged(e,t){this.setTypeFromFloatingFilter(e),this.setValueFromFloatingFilter(t),this.onUiChanged(!0)}setTypeFromFloatingFilter(e){this.eTypes.forEach(((t,a)=>{0===a?t.setValue(e,!0):t.setValue(this.optionsFactory.getDefaultOption(),!0)}))}getModelFromUi(){const e=this.getUiCompleteConditions();return 0===e.length?null:this.maxNumConditions>1&&e.length>1?{filterType:this.getFilterType(),operator:this.getJoinOperator(),conditions:e}:e[0]}getConditionTypes(){return this.eTypes.map((e=>e.getValue()))}getConditionType(e){return this.eTypes[e].getValue()}getJoinOperator(){return 0===this.eJoinOperatorsOr.length?this.defaultJoinOperator:!0===this.eJoinOperatorsOr[0].getValue()?"OR":"AND"}areModelsEqual(e,t){if(!e&&!t)return!0;if(!e&&t||e&&!t)return!1;const a=!e.operator,n=!t.operator;if(!a&&n||a&&!n)return!1;let o;if(a){const a=e,n=t;o=this.areSimpleModelsEqual(a,n)}else{const a=e,n=t;o=a.operator===n.operator&&h(a.conditions,n.conditions,((e,t)=>this.areSimpleModelsEqual(e,t)))}return o}shouldRefresh(e){const t=this.getModel(),a=t?t.conditions??[t]:null,n=e.filterOptions?.map((e=>"string"==typeof e?e:e.displayKey))??this.getDefaultFilterOptions();return!(a&&!a.every((e=>void 0!==n.find((t=>t===e.type)))))&&!("number"==typeof e.maxNumConditions&&a&&a.length>e.maxNumConditions)}refresh(e){if(!this.shouldRefresh(e))return!1;return!!super.refresh(e)&&(this.setParams(e),this.removeConditionsAndOperators(0),this.createOption(),th';
      S = S + 'is.setModel(this.getModel()),!0)}setModelIntoUi(e){if(e.operator){const t=e;let a=t.conditions;null==a&&(a=[],ce("Filter model is missing \'conditions\'"));const n=this.validateAndUpdateConditions(a),o=this.getNumConditions();if(n<o)this.removeConditionsAndOperators(n);else if(n>o)for(let e=o;e<n;e++)this.createJoinOperatorPanel(),this.createOption();const r="OR"===t.operator;this.eJoinOperatorsAnd.forEach((e=>e.setValue(!r,!0))),this.eJoinOperatorsOr.forEach((e=>e.setValue(r,!0))),a.forEach(((e,t)=>{this.eTypes[t].setValue(e.type,!0),this.setConditionIntoUi(e,t)}))}else{const t=e;this.getNumConditions()>1&&this.removeConditionsAndOperators(1),this.eTypes[0].setValue(t.type,!0),this.setConditionIntoUi(t,0)}return this.lastUiCompletePosition=this.getNumConditions()-1,this.createMissingConditionsAndOperators(),this.onUiChanged(),Cn.resolve()}validateAndUpdateConditions(e){let t=e.length;return t>this.maxNumConditions&&(e.splice(this.maxNumConditions),ce(\'Filter Model contains more conditions than "filterParams.maxNumConditions". Additional conditions have been ignored.\'),t=this.maxNumConditions),t}doesFilterPass(e){const t=this.getModel();if(null==t)return!0;const{operator:a}=t,n=[];if(a){const e=t;n.push(...e.conditions??[])}else n.push(t);return n[a&&"OR"===a?"some":"every"]((t=>this.individualConditionPasses(e,t)))}setParams(e){super.setParams(e),this.setNumConditions(e),this.defaultJoinOperator=this.getDefaultJoinOperator(e.defaultJoinOperator),this.filterPlaceholder=e.filterPlaceholder,this.optionsFactory=new So,this.optionsFactory.init(e,this.getDefaultFilterOptions()),this.createFilterListOptions(),this.createOption(),this.createMissingConditionsAndOperators(),this.isReadOnly()&&this.eFilterBody.setAttribute("tabindex","-1")}setNumConditions(e){this.maxNumConditions=e.maxNumConditions??2,this.maxNumConditions<1&&(ce(\'"filterParams.maxNumConditions" must be greater than or equal to zero.\'),this.maxNumConditions=1),this.numAlwaysVisibleConditions=e.numAlwaysVisible';
      S = S + 'Conditions??1,this.numAlwaysVisibleConditions<1&&(ce(\'"filterParams.numAlwaysVisibleConditions" must be greater than or equal to zero.\'),this.numAlwaysVisibleConditions=1),this.numAlwaysVisibleConditions>this.maxNumConditions&&(ce(\'"filterParams.numAlwaysVisibleConditions" cannot be greater than "filterParams.maxNumConditions".\'),this.numAlwaysVisibleConditions=this.maxNumConditions)}createOption(){const e=this.createManagedBean(new wo);this.eTypes.push(e),e.addCssClass("ag-filter-select"),this.eFilterBody.appendChild(e.getGui());const t=this.createValueElement();this.eConditionBodies.push(t),this.eFilterBody.appendChild(t),this.putOptionsIntoDropdown(e),this.resetType(e);const a=this.getNumConditions()-1;this.forEachPositionInput(a,(e=>this.resetInput(e))),this.addChangedListeners(e,a)}createJoinOperatorPanel(){const e=document.createElement("div");this.eJoinOperatorPanels.push(e),e.classList.add("ag-filter-condition");const t=this.createJoinOperator(this.eJoinOperatorsAnd,e,"and"),a=this.createJoinOperator(this.eJoinOperatorsOr,e,"or");this.eFilterBody.appendChild(e);const n=this.eJoinOperatorPanels.length-1,o=this.joinOperatorId++;this.resetJoinOperatorAnd(t,n,o),this.resetJoinOperatorOr(a,n,o),this.isReadOnly()||(t.onValueChange(this.listener),a.onValueChange(this.listener))}createJoinOperator(e,t,a){const n=this.createManagedBean(new vo);return e.push(n),n.addCssClass("ag-filter-condition-operator"),n.addCssClass(`ag-filter-condition-operator-${a}`),t.appendChild(n.getGui()),n}getDefaultJoinOperator(e){return"AND"===e||"OR"===e?e:"AND"}createFilterListOptions(){const e=this.optionsFactory.getFilterOptions();this.filterListOptions=e.map((e=>"string"==typeof e?this.createBoilerplateListOption(e):this.createCustomListOption(e)))}putOptionsIntoDropdown(e){this.filterListOptions.forEach((t=>{e.addOption(t)})),e.setDisabled(this.filterListOptions.length<=1)}createBoilerplateListOption(e){return{value:e,text:this.translate(e)}}createCustomListOption(e){const{displayKe';
      S = S + 'y:t}=e,a=this.optionsFactory.getCustomOption(e.displayKey);return{value:t,text:a?this.localeService.getLocaleTextFunc()(a.displayKey,a.displayName):this.translate(t)}}createBodyTemplate(){return""}getAgComponents(){return[]}getCssIdentifier(){return"simple-filter"}updateUiVisibility(){const e=this.getJoinOperator();this.updateNumConditions(),this.updateConditionStatusesAndValues(this.lastUiCompletePosition,e)}updateNumConditions(){let e=-1,t=!0;for(let a=0;a<this.getNumConditions();a++)this.isConditionUiComplete(a)?e=a:t=!1;if(this.shouldAddNewConditionAtEnd(t))this.createJoinOperatorPanel(),this.createOption();else{const t=this.lastUiCompletePosition??this.getNumConditions()-2;if(e<t){this.removeConditionsAndOperators(t+1);const a=e+1,n=t-a;n>0&&this.removeConditionsAndOperators(a,n),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=e}updateConditionStatusesAndValues(e,t){this.eTypes.forEach(((t,a)=>{const n=this.isConditionDisabled(a,e);t.setDisabled(n||this.filterListOptions.length<=1),1===a&&(sa(this.eJoinOperatorPanels[0],n),this.eJoinOperatorsAnd[0].setDisabled(n),this.eJoinOperatorsOr[0].setDisabled(n))})),this.eConditionBodies.forEach(((e,t)=>{ra(e,this.isConditionBodyVisible(t))}));const a="OR"===(t??this.getJoinOperator());this.eJoinOperatorsAnd.forEach((e=>{e.setValue(!a,!0)})),this.eJoinOperatorsOr.forEach((e=>{e.setValue(a,!0)})),this.forEachInput(((t,a,n,o)=>{this.setElementDisplayed(t,a<o),this.setElementDisabled(t,this.isConditionDisabled(n,e))})),this.resetPlaceholder()}shouldAddNewConditionAtEnd(e){return e&&this.getNumConditions()<this.maxNumConditions&&!this.isReadOnly()}removeConditionsAndOperators(e,t){if(e>=this.getNumConditions())return;this.removeComponents(this.eTypes,e,t),this.removeElements(this.eConditionBodies,e,t),this.removeValueElements(e,t);const a=Math.max(e-1,0);this.removeElements(this.eJoinOperatorPanels,a,t),this.removeComponents(this.eJoinOperatorsAnd,a,t),this.removeComponents(this.eJoinOperatorsOr,a,t)}';
      S = S + 'removeElements(e,t,a){this.removeItems(e,t,a).forEach((e=>Ca(e)))}removeComponents(e,t,a){this.removeItems(e,t,a).forEach((e=>{Ca(e.getGui()),this.destroyBean(e)}))}removeItems(e,t,a){return null==a?e.splice(t):e.splice(t,a)}afterGuiAttached(e){if(super.afterGuiAttached(e),this.resetPlaceholder(),!e?.suppressFocus)if(this.isReadOnly())this.eFilterBody.focus();else{const e=this.getInputs(0)[0];if(!e)return;e instanceof on&&e.getInputElement().focus()}}afterGuiDetached(){super.afterGuiDetached();const e=this.getModel();this.resetUiToActiveModel(e);let t=-1,a=-1,n=!1;const o=this.getJoinOperator();for(let e=this.getNumConditions()-1;e>=0;e--)if(this.isConditionUiComplete(e))-1===t&&(t=e,a=e);else{const o=e<t;(e>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(e-1)||o)&&(this.removeConditionsAndOperators(e,1),n=!0,o&&a--)}let r=!1;this.getNumConditions()<this.numAlwaysVisibleConditions&&(this.createMissingConditionsAndOperators(),r=!0),this.shouldAddNewConditionAtEnd(a===this.getNumConditions()-1)&&(this.createJoinOperatorPanel(),this.createOption(),r=!0),r&&this.updateConditionStatusesAndValues(a,o),n&&this.updateJoinOperatorsDisabled(),this.lastUiCompletePosition=a}getPlaceholderText(e,t){let a=this.translate(e);if(de(this.filterPlaceholder)){const e=this.filterPlaceholder,n=this.eTypes[t].getValue();a=e({filterOptionKey:n,filterOption:this.translate(n),placeholder:a})}else"string"==typeof this.filterPlaceholder&&(a=this.filterPlaceholder);return a}resetPlaceholder(){const e=this.localeService.getLocaleTextFunc();this.forEachInput(((t,a,n,o)=>{if(!(t instanceof on))return;const r=0===a&&o>1?"inRangeStart":0===a?"filterOoo":"inRangeEnd",i=0===a&&o>1?e("ariaFilterFromValue","Filter from value"):0===a?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value");t.setInputPlaceholder(this.getPlaceholderText(r,n)),t.setInputAriaLabel(i)}))}setElementValue(e,t,a){e instanceof on&&e.setValue(null!=t?String(t):null,!0)}setElementDisplayed(e,t){e i';
      S = S + 'nstanceof Ba&&ra(e.getGui(),t)}setElementDisabled(e,t){e instanceof Ba&&sa(e.getGui(),t)}attachElementOnChange(e,t){e instanceof on&&e.onValueChange(t)}forEachInput(e){this.getConditionTypes().forEach(((t,a)=>{this.forEachPositionTypeInput(a,t,e)}))}forEachPositionInput(e,t){const a=this.getConditionType(e);this.forEachPositionTypeInput(e,a,t)}forEachPositionTypeInput(e,t,a){const n=this.getNumberOfInputs(t),o=this.getInputs(e);for(let t=0;t<o.length;t++){const r=o[t];null!=r&&a(r,t,e,n)}}isConditionDisabled(e,t){return!!this.isReadOnly()||0!==e&&e>t+1}isConditionBodyVisible(e){const t=this.getConditionType(e);return this.getNumberOfInputs(t)>0}isConditionUiComplete(e){if(e>=this.getNumConditions())return!1;return"empty"!==this.getConditionType(e)&&!this.getValues(e).some((e=>null==e))}getNumConditions(){return this.eTypes.length}getUiCompleteConditions(){const e=[];for(let t=0;t<this.getNumConditions();t++)this.isConditionUiComplete(t)&&e.push(this.createCondition(t));return e}createMissingConditionsAndOperators(){if(!this.isReadOnly())for(let e=this.getNumConditions();e<this.numAlwaysVisibleConditions;e++)this.createJoinOperatorPanel(),this.createOption()}resetUiToDefaults(e){return this.removeConditionsAndOperators(this.isReadOnly()?1:this.numAlwaysVisibleConditions),this.eTypes.forEach((e=>this.resetType(e))),this.eJoinOperatorsAnd.forEach(((e,t)=>this.resetJoinOperatorAnd(e,t,this.joinOperatorId+t))),this.eJoinOperatorsOr.forEach(((e,t)=>this.resetJoinOperatorOr(e,t,this.joinOperatorId+t))),this.joinOperatorId++,this.forEachInput((e=>this.resetInput(e))),this.resetPlaceholder(),this.createMissingConditionsAndOperators(),this.lastUiCompletePosition=null,e||this.onUiChanged(),Cn.resolve()}resetType(e){const t=this.localeService.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");e.setValue(this.optionsFactory.getDefaultOption(),!0).setAriaLabel(t).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(e,t,a){this.reset';
      S = S + 'JoinOperator(e,t,this.isDefaultOperator("AND"),this.translate("andCondition"),a)}resetJoinOperatorOr(e,t,a){this.resetJoinOperator(e,t,this.isDefaultOperator("OR"),this.translate("orCondition"),a)}resetJoinOperator(e,t,a,n,o){this.updateJoinOperatorDisabled(e.setValue(a,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${o}`).setLabel(n),t)}updateJoinOperatorsDisabled(){this.eJoinOperatorsAnd.forEach(((e,t)=>this.updateJoinOperatorDisabled(e,t))),this.eJoinOperatorsOr.forEach(((e,t)=>this.updateJoinOperatorDisabled(e,t)))}updateJoinOperatorDisabled(e,t){e.setDisabled(this.isReadOnly()||t>0)}resetInput(e){this.setElementValue(e,null),this.setElementDisabled(e,this.isReadOnly())}setConditionIntoUi(e,t){const a=this.mapValuesFromModel(e);this.forEachInput(((e,n,o)=>{o===t&&this.setElementValue(e,null!=a[n]?a[n]:null)}))}setValueFromFloatingFilter(e){this.forEachInput(((t,a,n)=>{this.setElementValue(t,0===a&&0===n?e:null,!0)}))}isDefaultOperator(e){return e===this.defaultJoinOperator}addChangedListeners(e,t){this.isReadOnly()||(e.onValueChange(this.listener),this.forEachPositionInput(t,(e=>{this.attachElementOnChange(e,this.listener)})))}individualConditionPasses(e,t){const a=this.getCellValue(e.node),n=this.mapValuesFromModel(t),o=this.optionsFactory.getCustomOption(t.type),r=this.evaluateCustomFilter(o,n,a);return null!=r?r:null==a?this.evaluateNullValue(t.type):this.evaluateNonNullValue(n,a,t,e)}evaluateCustomFilter(e,t,a){if(null==e)return;const{predicate:n}=e;return null==n||t.some((e=>null==e))?void 0:n(t,a)}isBlank(e){return null==e||"string"==typeof e&&0===e.trim().length}hasInvalidInputs(){return!1}},xo=class extends ko{setParams(e){super.setParams(e),this.scalarFilterParams=e}evaluateNullValue(e){switch(e){case"equals":case"notEqual":if(this.scalarFilterParams.includeBlanksInEquals)return!0;break;case"greaterThan":case"greaterThanOrEqual":if(this.scalarFilterParams.includeBlanksInGreaterThan)return!0;break;case"lessThan":case"lessThanOrEqual":if(this.sc';
      S = S + 'alarFilterParams.includeBlanksInLessThan)return!0;break;case"inRange":if(this.scalarFilterParams.includeBlanksInRange)return!0;break;case"blank":return!0;case"notBlank":return!1}return!1}evaluateNonNullValue(e,t,a){const n=this.comparator(),o=null!=e[0]?n(e[0],t):0;switch(a.type){case"equals":return 0===o;case"notEqual":return 0!==o;case"greaterThan":return o>0;case"greaterThanOrEqual":return o>=0;case"lessThan":return o<0;case"lessThanOrEqual":return o<=0;case"inRange":{const a=n(e[1],t);return this.scalarFilterParams.inRangeInclusive?o>=0&&a<=0:o>0&&a<0}case"blank":return this.isBlank(t);case"notBlank":return!this.isBlank(t);default:return ce(\'Unexpected type of filter "\'+a.type+\'", it looks like the filter was configured with incorrect Filter Options\'),!0}}};function Ro(e){if(e.altKey||e.ctrlKey||e.metaKey)return!1;return 1===e.key.length}function zo(e,t,a,n,o){const r=n?n.getColDef().suppressKeyboardEvent:void 0;if(!r)return!1;const i=e.addGridCommonParams({event:t,editing:o,column:n,node:a,data:a.data,colDef:n.getColDef()});if(r){if(r(i))return!0}return!1}var Fo=class extends on{constructor(e,t="ag-text-field",a="text"){super(e,t,a)}postConstruct(){super.postConstruct(),this.config.allowedCharPattern&&this.preventDisallowedCharacters()}setValue(e,t){return this.eInput.value!==e&&(this.eInput.value=L(e)?e:""),super.setValue(e,t)}setStartValue(e){this.setValue(e,!0)}preventDisallowedCharacters(){const e=new RegExp(`[${this.config.allowedCharPattern}]`);this.addManagedListeners(this.eInput,{keydown:t=>{Ro(t)&&t.key&&!e.test(t.key)&&t.preventDefault()},paste:t=>{const a=t.clipboardData?.getData("text");a&&a.split("").some((t=>!e.test(t)))&&t.preventDefault()}})}},Mo={selector:"AG-INPUT-TEXT-FIELD",component:Fo},Do=class extends Fo{constructor(e){super(e,"ag-number-field","number")}postConstruct(){super.postConstruct(),this.addManagedListeners(this.eInput,{blur:()=>{const e=parseFloat(this.eInput.value),t=isNaN(e)?"":this.normalizeValue(e.toString());this.value!==t&';
      S = S + '&this.setValue(t)},wheel:this.onWheel.bind(this)}),this.eInput.step="any";const{precision:e,min:t,max:a,step:n}=this.config;"number"==typeof e&&this.setPrecision(e),"number"==typeof t&&this.setMin(t),"number"==typeof a&&this.setMax(a),"number"==typeof n&&this.setStep(n)}onWheel(e){this.gos.getActiveDomElement()===this.eInput&&e.preventDefault()}normalizeValue(e){if(""===e)return"";null!=this.precision&&(e=this.adjustPrecision(e));const t=parseFloat(e);return null!=this.min&&t<this.min?e=this.min.toString():null!=this.max&&t>this.max&&(e=this.max.toString()),e}adjustPrecision(e,t){if(null==this.precision)return e;if(t){const t=parseFloat(e).toFixed(this.precision);return parseFloat(t).toString()}const a=String(e).split(".");if(a.length>1){if(a[1].length<=this.precision)return e;if(this.precision>0)return`${a[0]}.${a[1].slice(0,this.precision)}`}return a[0]}setMin(e){return this.min===e||(this.min=e,Pa(this.eInput,"min",e)),this}setMax(e){return this.max===e||(this.max=e,Pa(this.eInput,"max",e)),this}setPrecision(e){return this.precision=e,this}setStep(e){return this.step===e||(this.step=e,Pa(this.eInput,"step",e)),this}setValue(e,t){return this.setValueOrInputValue((e=>super.setValue(e,t)),(()=>this),e)}setStartValue(e){return this.setValueOrInputValue((e=>super.setValue(e,!0)),(e=>{this.eInput.value=e}),e)}setValueOrInputValue(e,t,a){if(L(a)){let n=this.isScientificNotation(a);if(n&&this.eInput.validity.valid)return e(a);if(!n){n=(a=this.adjustPrecision(a))!=this.normalizeValue(a)}if(n)return t(a)}return e(a)}getValue(){if(!this.eInput.validity.valid)return;const e=this.eInput.value;return this.isScientificNotation(e)?this.adjustPrecision(e,!0):super.getValue()}isScientificNotation(e){return"string"==typeof e&&e.includes("e")}},Eo={selector:"AG-INPUT-NUMBER-FIELD",component:Do},Po=["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"],Ao=class{constructor(e,t,a){this.localeService=e,this.optionsFactory=t,th';
      S = S + 'is.valueFormatter=a}getModelAsString(e){if(!e)return null;const t=null!=e.operator,a=this.localeService.getLocaleTextFunc();if(t){const t=e,n=(t.conditions??[]).map((e=>this.getModelAsString(e))),o="AND"===t.operator?"andCondition":"orCondition";return n.join(` ${a(o,uo[o])} `)}if("blank"===e.type||"notBlank"===e.type)return a(e.type,e.type);{const t=e,n=this.optionsFactory.getCustomOption(t.type),{displayKey:o,displayName:r,numberOfInputs:i}=n||{};return o&&r&&0===i?(a(o,r),r):this.conditionToString(t,n)}}updateParams(e){this.optionsFactory=e.optionsFactory}formatValue(e){return this.valueFormatter?this.valueFormatter(e??null)??"":String(e)}},To=class extends Ao{conditionToString(e,t){const{numberOfInputs:a}=t||{};return"inRange"==e.type||2===a?`${this.formatValue(e.filter)}-${this.formatValue(e.filterTo)}`:null!=e.filter?this.formatValue(e.filter):`${e.type}`}};function Io(e){const{allowedCharPattern:t}=e??{};return t??null}var Lo=class extends xo{constructor(){super("numberFilter"),this.eValuesFrom=[],this.eValuesTo=[]}refresh(e){return this.numberFilterParams.allowedCharPattern===e.allowedCharPattern&&super.refresh(e)}mapValuesFromModel(e){const{filter:t,filterTo:a,type:n}=e||{};return[this.processValue(t),this.processValue(a)].slice(0,this.getNumberOfInputs(n))}getDefaultDebounceMs(){return 500}comparator(){return(e,t)=>e===t?0:e<t?1:-1}setParams(e){this.numberFilterParams=e,super.setParams(e),this.filterModelFormatter=new To(this.localeService,this.optionsFactory,this.numberFilterParams.numberFormatter)}getDefaultFilterOptions(){return Po}setElementValue(e,t,a){const n=!a&&this.numberFilterParams.numberFormatter?this.numberFilterParams.numberFormatter(t??null):t;super.setElementValue(e,n)}createValueElement(){const e=Io(this.numberFilterParams),t=document.createElement("div");return t.classList.add("ag-filter-body"),yt(t,"presentation"),this.createFromToElement(t,this.eValuesFrom,"from",e),this.createFromToElement(t,this.eValuesTo,"to",e),t}createFromToElement';
      S = S + '(e,t,a,n){const o=this.createManagedBean(n?new Fo({allowedCharPattern:n}):new Do);o.addCssClass(`ag-filter-${a}`),o.addCssClass("ag-filter-filter"),t.push(o),e.appendChild(o.getGui())}removeValueElements(e,t){this.removeComponents(this.eValuesFrom,e,t),this.removeComponents(this.eValuesTo,e,t)}getValues(e){const t=[];return this.forEachPositionInput(e,((e,a,n,o)=>{a<o&&t.push(this.processValue(this.stringToFloat(e.getValue())))})),t}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getFilterType(){return"number"}processValue(e){return null==e||isNaN(e)?null:e}stringToFloat(e){if("number"==typeof e)return e;let t=I(e);return null!=t&&""===t.trim()&&(t=null),this.numberFilterParams.numberParser?this.numberFilterParams.numberParser(t):null==t||"-"===t.trim()?null:parseFloat(t)}createCondition(e){const t=this.getConditionType(e),a={filterType:this.getFilterType(),type:t},n=this.getValues(e);return n.length>0&&(a.filter=n[0]),n.length>1&&(a.filterTo=n[1]),a}getInputs(e){return e>=this.eValuesFrom.length?[null,null]:[this.eValuesFrom[e],this.eValuesTo[e]]}getModelAsString(e){return this.filterModelFormatter.getModelAsString(e)??""}hasInvalidInputs(){let e=!1;return this.forEachInput((t=>{t.getInputElement().validity.valid||(e=!0)})),e}},Oo=["contains","notContains","equals","notEqual","startsWith","endsWith","blank","notBlank"],No=class extends Ao{conditionToString(e,t){const{numberOfInputs:a}=t||{};return"inRange"==e.type||2===a?`${e.filter}-${e.filterTo}`:null!=e.filter?`${e.filter}`:`${e.type}`}};function Go(e){const t=e&&e.trim();return""===t?e:t}var qo=class extends ko{constructor(){super("textFilter"),this.defaultFormatter=e=>e,this.defaultLowercaseFormatter=e=>null==e?null:e.toString().toLowerCase(),this.defaultMatcher=({filterOption:e,value:t,filterText:a})=>{if(null==a)return!1;switch(e){case"contains":return t.indexOf(a)>=0;case"notContains":return t.indexOf(a)<0;case"equals":return t===a;case"notEqual":return t!=a;ca';
      S = S + 'se"startsWith":return 0===t.indexOf(a);case"endsWith":{const e=t.lastIndexOf(a);return e>=0&&e===t.length-a.length}default:return!1}},this.eValuesFrom=[],this.eValuesTo=[]}getDefaultDebounceMs(){return 500}setParams(e){this.textFilterParams=e,super.setParams(e),this.matcher=this.getTextMatcher(),this.formatter=this.textFilterParams.textFormatter||(this.textFilterParams.caseSensitive?this.defaultFormatter:this.defaultLowercaseFormatter),this.filterModelFormatter=new No(this.localeService,this.optionsFactory)}getTextMatcher(){const e=this.textFilterParams.textCustomComparator;return e?(ce("textCustomComparator is deprecated, use textMatcher instead."),({filterOption:t,value:a,filterText:n})=>e(t,a,n)):this.textFilterParams.textMatcher||this.defaultMatcher}createCondition(e){const t=this.getConditionType(e),a={filterType:this.getFilterType(),type:t},n=this.getValuesWithSideEffects(e,!0);return n.length>0&&(a.filter=n[0]),n.length>1&&(a.filterTo=n[1]),a}getFilterType(){return"text"}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getInputs(e){return e>=this.eValuesFrom.length?[null,null]:[this.eValuesFrom[e],this.eValuesTo[e]]}getValues(e){return this.getValuesWithSideEffects(e,!1)}getValuesWithSideEffects(e,t){const a=[];return this.forEachPositionInput(e,((e,n,o,r)=>{if(n<r){let n=I(e.getValue());t&&this.textFilterParams.trimInput&&(n=Go(n)??null,e.setValue(n,!0)),a.push(n)}})),a}getDefaultFilterOptions(){return Oo}createValueElement(){const e=document.createElement("div");return e.classList.add("ag-filter-body"),yt(e,"presentation"),this.createFromToElement(e,this.eValuesFrom,"from"),this.createFromToElement(e,this.eValuesTo,"to"),e}createFromToElement(e,t,a){const n=this.createManagedBean(new Fo);n.addCssClass(`ag-filter-${a}`),n.addCssClass("ag-filter-filter"),t.push(n),e.appendChild(n.getGui())}removeValueElements(e,t){this.removeComponents(this.eValuesFrom,e,t),this.removeComponents(this.eValuesTo,e,t)}mapValuesFromMo';
      S = S + 'del(e){const{filter:t,filterTo:a,type:n}=e||{};return[t||null,a||null].slice(0,this.getNumberOfInputs(n))}evaluateNullValue(e){return!!e&&["notEqual","notContains","blank"].indexOf(e)>=0}evaluateNonNullValue(e,t,a,n){const o=e.map((e=>this.formatter(e)))||[],r=this.formatter(t),{api:i,colDef:s,column:l,context:c,textFormatter:g}=this.textFilterParams;if("blank"===a.type)return this.isBlank(t);if("notBlank"===a.type)return!this.isBlank(t);const d={api:i,colDef:s,column:l,context:c,node:n.node,data:n.data,filterOption:a.type,value:r,textFormatter:g};return o.some((e=>this.matcher({...d,filterText:e})))}getModelAsString(e){return this.filterModelFormatter.getModelAsString(e)??""}};function Bo(e){if("number"==typeof e)return e;if("string"==typeof e){const t=parseInt(e);if(isNaN(t))return;return t}}function Ho(e,t=Number.MAX_VALUE){return a=>{const n=Bo(a);if(!(null==n||n<e||n>t))return n}}function Vo(e,t){return e.toString().padStart(t,"0")}function Wo(e,t,a){return"number"!=typeof e?"":Uo(Math.round(100*e)/100,t,a)}function Uo(e,t,a){return"number"!=typeof e?"":e.toString().replace(".",a).replace(/(\\d)(?=(\\d{3})+(?!\\d))/g,`$1${t}`)}function jo(e,t=!0,a="-"){if(!e)return null;let n=[e.getFullYear(),e.getMonth()+1,e.getDate()].map((e=>Vo(e,2))).join(a);return t&&(n+=" "+[e.getHours(),e.getMinutes(),e.getSeconds()].map((e=>Vo(e,2))).join(":")),n}var Ko=e=>{if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd"}return"th"};function Qo(e,t="YYYY-MM-DD"){const a=Vo(e.getFullYear(),4),n=["January","February","March","April","May","June","July","August","September","October","November","December"],o=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],r={YYYY:()=>a.slice(a.length-4,a.length),YY:()=>a.slice(a.length-2,a.length),Y:()=>`${e.getFullYear()}`,MMMM:()=>n[e.getMonth()],MMM:()=>n[e.getMonth()].slice(0,3),MM:()=>Vo(e.getMonth()+1,2),Mo:()=>`${e.getMonth()+1}${Ko(e.getMonth()+1)}`,M:()=>`${e.getMonth()+1}`,Do:()=>`$';
      S = S + '{e.getDate()}${Ko(e.getDate())}`,DD:()=>Vo(e.getDate(),2),D:()=>`${e.getDate()}`,dddd:()=>o[e.getDay()],ddd:()=>o[e.getDay()].slice(0,3),dd:()=>o[e.getDay()].slice(0,2),do:()=>`${e.getDay()}${Ko(e.getDay())}`,d:()=>`${e.getDay()}`},i=new RegExp(Object.keys(r).join("|"),"g");return t.replace(i,(e=>e in r?r[e]():e))}function Yo(e){if(!e)return null;const[t,a]=e.split(" ");if(!t)return null;const n=t.split("-").map((e=>parseInt(e,10)));if(3!==n.filter((e=>!isNaN(e))).length)return null;const[o,r,i]=n,s=new Date(o,r-1,i);if(s.getFullYear()!==o||s.getMonth()!==r-1||s.getDate()!==i)return null;if(!a||"00:00:00"===a)return s;const[l,c,g]=a.split(":").map((e=>parseInt(e,10)));return l>=0&&l<24&&s.setHours(l),c>=0&&c<60&&s.setMinutes(c),g>=0&&g<60&&s.setSeconds(g),s}var _o=class{constructor(e,t,a,n,o){this.alive=!0,this.context=e,this.eParent=n;t.getDateCompDetails(a).newAgStackInstance().then((t=>{this.alive?(this.dateComp=t,t&&(n.appendChild(t.getGui()),t.afterGuiAttached&&t.afterGuiAttached(),this.tempValue&&t.setDate(this.tempValue),null!=this.disabled&&this.setDateCompDisabled(this.disabled),o?.(this))):e.destroyBean(t)}))}destroy(){this.alive=!1,this.dateComp=this.context.destroyBean(this.dateComp)}getDate(){return this.dateComp?this.dateComp.getDate():this.tempValue}setDate(e){this.dateComp?this.dateComp.setDate(e):this.tempValue=e}setDisabled(e){this.dateComp?this.setDateCompDisabled(e):this.disabled=e}setDisplayed(e){ra(this.eParent,e)}setInputPlaceholder(e){this.dateComp&&this.dateComp.setInputPlaceholder&&this.dateComp.setInputPlaceholder(e)}setInputAriaLabel(e){this.dateComp&&this.dateComp.setInputAriaLabel&&this.dateComp.setInputAriaLabel(e)}afterGuiAttached(e){this.dateComp&&"function"==typeof this.dateComp.afterGuiAttached&&this.dateComp.afterGuiAttached(e)}updateParams(e){let t=!1;if(this.dateComp?.refresh&&"function"==typeof this.dateComp.refresh){null!==this.dateComp.refresh(e)&&(t=!0)}if(!t&&this.dateComp?.onParamsUpdated&&"function"==typeof this.dateComp.';
      S = S + 'onParamsUpdated){null!==this.dateComp.onParamsUpdated(e)&&ce("Custom date component method \'onParamsUpdated\' is deprecated. Use \'refresh\' instead.")}}setDateCompDisabled(e){null!=this.dateComp&&null!=this.dateComp.setDisabled&&this.dateComp.setDisabled(e)}},Jo=["equals","notEqual","lessThan","greaterThan","inRange","blank","notBlank"],Zo=class extends Ao{constructor(e,t,a){super(t,a),this.dateFilterParams=e}conditionToString(e,t){const{type:a}=e,{numberOfInputs:n}=t||{},o="inRange"==a||2===n,r=Yo(e.dateFrom),i=Yo(e.dateTo),s=this.dateFilterParams.inRangeFloatingFilterDateFormat;if(o){return`${null!==r?Qo(r,s):"null"}-${null!==i?Qo(i,s):"null"}`}return null!=r?Qo(r,s):`${a}`}updateParams(e){super.updateParams(e),this.dateFilterParams=e.dateFilterParams}},Xo=1/0,$o=class extends xo{constructor(){super("dateFilter"),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=1e3,this.maxValidYear=Xo,this.minValidDate=null,this.maxValidDate=null}wireBeans(e){super.wireBeans(e),this.context=e.context,this.userComponentFactory=e.userComponentFactory}afterGuiAttached(e){super.afterGuiAttached(e),this.dateConditionFromComps[0].afterGuiAttached(e)}mapValuesFromModel(e){const{dateFrom:t,dateTo:a,type:n}=e||{};return[t&&Yo(t)||null,a&&Yo(a)||null].slice(0,this.getNumberOfInputs(n))}comparator(){return this.dateFilterParams.comparator?this.dateFilterParams.comparator:this.defaultComparator.bind(this)}defaultComparator(e,t){return null==t||t<e?-1:t>e?1:0}setParams(e){this.dateFilterParams=e,super.setParams(e);const t=(t,a)=>{if(null!=e[t]){if(!isNaN(e[t]))return null==e[t]?a:Number(e[t]);ce(`DateFilter ${t} is not a number`)}return a};this.minValidYear=t("minValidYear",1e3),this.maxValidYear=t("maxValidYear",Xo),this.minValidYear>this.maxValidYear&&ce("DateFilter minValidYear should be <= maxValidYear"),e.minValidDate?this.minValidDate=e.minValidDate instanceof Date?e.minValidDate:Yo(e.minValidDate):this.m';
      S = S + 'inValidDate=null,e.maxValidDate?this.maxValidDate=e.maxValidDate instanceof Date?e.maxValidDate:Yo(e.maxValidDate):this.maxValidDate=null,this.minValidDate&&this.maxValidDate&&this.minValidDate>this.maxValidDate&&ce("DateFilter minValidDate should be <= maxValidDate"),this.filterModelFormatter=new Zo(this.dateFilterParams,this.localeService,this.optionsFactory)}createDateCompWrapper(e){const t=new _o(this.context,this.userComponentFactory,{onDateChanged:()=>this.onUiChanged(),filterParams:this.dateFilterParams},e);return this.addDestroyFunc((()=>t.destroy())),t}setElementValue(e,t){e.setDate(t)}setElementDisplayed(e,t){e.setDisplayed(t)}setElementDisabled(e,t){e.setDisabled(t)}getDefaultFilterOptions(){return Jo}createValueElement(){const e=this.gos.getDocument().createElement("div");return e.classList.add("ag-filter-body"),this.createFromToElement(e,this.eConditionPanelsFrom,this.dateConditionFromComps,"from"),this.createFromToElement(e,this.eConditionPanelsTo,this.dateConditionToComps,"to"),e}createFromToElement(e,t,a,n){const o=this.gos.getDocument().createElement("div");o.classList.add(`ag-filter-${n}`),o.classList.add(`ag-filter-date-${n}`),t.push(o),e.appendChild(o),a.push(this.createDateCompWrapper(o))}removeValueElements(e,t){this.removeDateComps(this.dateConditionFromComps,e,t),this.removeDateComps(this.dateConditionToComps,e,t),this.removeItems(this.eConditionPanelsFrom,e,t),this.removeItems(this.eConditionPanelsTo,e,t)}removeDateComps(e,t,a){this.removeItems(e,t,a).forEach((e=>e.destroy()))}isValidDateValue(e){if(null===e)return!1;if(this.minValidDate){if(e<this.minValidDate)return!1}else if(e.getUTCFullYear()<this.minValidYear)return!1;if(this.maxValidDate){if(e>this.maxValidDate)return!1}else if(e.getUTCFullYear()>this.maxValidYear)return!1;return!0}isConditionUiComplete(e){if(!super.isConditionUiComplete(e))return!1;let t=!0;return this.forEachInput(((a,n,o,r)=>{o!==e||!t||n>=r||(t=t&&this.isValidDateValue(a.getDate()))})),t}areSimpleModelsEqual(e,t){r';
      S = S + 'eturn e.dateFrom===t.dateFrom&&e.dateTo===t.dateTo&&e.type===t.type}getFilterType(){return"date"}createCondition(e){const t=this.getConditionType(e),a={},n=this.getValues(e);return n.length>0&&(a.dateFrom=jo(n[0])),n.length>1&&(a.dateTo=jo(n[1])),{dateFrom:null,dateTo:null,filterType:this.getFilterType(),type:t,...a}}resetPlaceholder(){const e=this.localeService.getLocaleTextFunc(),t=this.translate("dateFormatOoo"),a=e("ariaFilterValue","Filter Value");this.forEachInput((e=>{e.setInputPlaceholder(t),e.setInputAriaLabel(a)}))}getInputs(e){return e>=this.dateConditionFromComps.length?[null,null]:[this.dateConditionFromComps[e],this.dateConditionToComps[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,((e,a,n,o)=>{a<o&&t.push(e.getDate())})),t}translate(e){return"lessThan"===e?super.translate("before"):"greaterThan"===e?super.translate("after"):super.translate(e)}getModelAsString(e){return this.filterModelFormatter.getModelAsString(e)??""}},er=class extends A{constructor(e,t,a,n){super(),this.columnOrGroup=e,this.columnOrGroup=e,this.eCell=t,this.ariaEl=this.eCell.querySelector("[role=columnheader]")||this.eCell,this.colsSpanning=n,this.beans=a}setColsSpanning(e){this.colsSpanning=e,this.onLeftChanged()}getColumnOrGroup(){return this.beans.gos.get("enableRtl")&&this.colsSpanning?d(this.colsSpanning):this.columnOrGroup}postConstruct(){const e=this.onLeftChanged.bind(this);this.addManagedListeners(this.columnOrGroup,{leftChanged:e}),this.setLeftFirstTime(),this.addManagedEventListeners({displayedColumnsWidthChanged:e}),this.addManagedPropertyListener("domLayout",e)}setLeftFirstTime(){const e=this.beans.gos.get("suppressColumnMoveAnimation"),t=L(this.columnOrGroup.getOldLeft());this.beans.columnAnimationService.isActive()&&t&&!e?this.animateInLeft():this.onLeftChanged()}animateInLeft(){const e=this.getColumnOrGroup(),t=e.getLeft(),a=e.getOldLeft(),n=this.modifyLeftForPrintLayout(e,a),o=this.modifyLeftForPrintLayout(e,t);this.setLeft(n),this.actualLeft=o,this';
      S = S + '.beans.columnAnimationService.executeNextVMTurn((()=>{this.actualLeft===o&&this.setLeft(o)}))}onLeftChanged(){const e=this.getColumnOrGroup(),t=e.getLeft();this.actualLeft=this.modifyLeftForPrintLayout(e,t),this.setLeft(this.actualLeft)}modifyLeftForPrintLayout(e,t){if(!this.beans.gos.isDomLayout("print"))return t;if("left"===e.getPinned())return t;const a=this.beans.visibleColsService.getColsLeftWidth();if("right"===e.getPinned()){return a+this.beans.visibleColsService.getBodyContainerWidth()+t}return a+t}setLeft(e){if(L(e)&&(this.eCell.style.left=`${e}px`),Ke(this.columnOrGroup)){const e=this.columnOrGroup.getLeafColumns();if(!e.length)return;e.length>1&&qt(this.ariaEl,e.length)}}};function tr(e,t,a,n){return O(e)?[]:or(e.headerClass,e,t,a,n)}function ar(e,t,a,n){return O(e)?[]:or(e.toolPanelClass,e,t,a,n)}function nr(e,t,a){e.addOrRemoveCssClass("ag-column-first",a.isColAtEdge(t,"first")),e.addOrRemoveCssClass("ag-column-last",a.isColAtEdge(t,"last"))}function or(e,t,a,n,o){if(O(e))return[];let r;if("function"==typeof e){const i=function(e,t,a,n){return t.addGridCommonParams({colDef:e,column:a,columnGroup:n})}(t,a,n,o);r=e(i)}else r=e;return"string"==typeof r?[r]:Array.isArray(r)?[...r]:[]}var rr=0,ir=class e extends A{constructor(e,t,a){super(),this.resizeToggleTimeout=0,this.resizeMultiplier=1,this.resizeFeature=null,this.lastFocusEvent=null,this.dragSource=null,this.columnGroupChild=e,this.parentRowCtrl=a,this.beans=t,this.instanceId=e.getUniqueId()+"-"+rr++}wireBeans(e){this.pinnedWidthService=e.pinnedWidthService,this.focusService=e.focusService,this.userComponentFactory=e.userComponentFactory,this.ctrlsService=e.ctrlsService,this.dragAndDropService=e.dragAndDropService,this.menuService=e.menuService}postConstruct(){this.addManagedPropertyListeners(["suppressHeaderFocus"],(()=>this.refreshTabIndex()))}shouldStopEventPropagation(e){const{headerRowIndex:t,column:a}=this.focusService.getFocusedHeader();return function(e,t,a,n){const o=n.getDefinition(),r=o&&o.s';
      S = S + 'uppressHeaderKeyboardEvent;return!!L(r)&&!!r(e.addGridCommonParams({colDef:o,column:n,headerRowIndex:a,event:t}))}(this.gos,e,t,a)}getWrapperHasFocus(){return this.gos.getActiveDomElement()===this.eGui}setGui(e){this.eGui=e,this.addDomData(),this.addManagedListeners(this.beans.eventService,{displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this)}),this.addManagedElementListeners(this.eGui,{focus:this.onGuiFocus.bind(this)}),this.onDisplayedColumnsChanged(),this.refreshTabIndex()}onGuiFocus(){const e={type:"headerFocused",column:this.column};this.eventService.dispatchEvent(e)}onDisplayedColumnsChanged(){this.comp&&this.column&&(this.refreshFirstAndLastStyles(),this.refreshAriaColIndex())}refreshFirstAndLastStyles(){const{comp:e,column:t,beans:a}=this;nr(e,t,a.visibleColsService)}refreshAriaColIndex(){const{beans:e,column:t}=this,a=e.visibleColsService.getAriaColIndex(t);Gt(this.eGui,a)}addResizeAndMoveKeyboardListeners(){this.resizeFeature&&this.addManagedListeners(this.eGui,{keydown:this.onGuiKeyDown.bind(this),keyup:this.onGuiKeyUp.bind(this)})}refreshTabIndex(){this.gos.get("suppressHeaderFocus")?this.eGui.removeAttribute("tabindex"):this.eGui.setAttribute("tabindex","-1")}onGuiKeyDown(e){const t=this.gos.getActiveDomElement(),a=e.key===tn.LEFT||e.key===tn.RIGHT;if(this.isResizing&&(e.preventDefault(),e.stopImmediatePropagation()),t!==this.eGui||!e.shiftKey&&!e.altKey)return;if((this.isResizing||a)&&(e.preventDefault(),e.stopImmediatePropagation()),!a)return;const n=e.key===tn.LEFT!==this.gos.get("enableRtl"),o=Kn[n?"Left":"Right"];if(e.altKey){this.isResizing=!0,this.resizeMultiplier+=1;const t=this.getViewportAdjustedResizeDiff(e);this.resizeHeader(t,e.shiftKey),this.resizeFeature?.toggleColumnResizing(!0)}else this.moveHeader(o)}getViewportAdjustedResizeDiff(e){let t=this.getResizeDiff(e);if(this.column.getPinned()){const e=this.pinnedWidthService.getPinnedLeftWidth(),a=this.pinnedWidthService.getPinnedRightWidth(),n=da(this.ctrlsService.getGridBodyCt';
      S = S + 'rl().getBodyViewportElement())-50;if(e+a+t>n){if(!(n>e+a))return 0;t=n-e-a}}return t}getResizeDiff(e){let t=e.key===tn.LEFT!==this.gos.get("enableRtl");const a=this.column.getPinned(),n=this.gos.get("enableRtl");return a&&n!==("right"===a)&&(t=!t),(t?-1:1)*this.resizeMultiplier}onGuiKeyUp(){this.isResizing&&(this.resizeToggleTimeout&&(window.clearTimeout(this.resizeToggleTimeout),this.resizeToggleTimeout=0),this.isResizing=!1,this.resizeMultiplier=1,this.resizeToggleTimeout=window.setTimeout((()=>{this.resizeFeature?.toggleColumnResizing(!1)}),150))}handleKeyDown(e){const t=this.getWrapperHasFocus();switch(e.key){case tn.PAGE_DOWN:case tn.PAGE_UP:case tn.PAGE_HOME:case tn.PAGE_END:t&&e.preventDefault()}}addDomData(){const t=e.DOM_DATA_KEY_HEADER_CTRL;this.gos.setDomData(this.eGui,t,this),this.addDestroyFunc((()=>this.gos.setDomData(this.eGui,t,null)))}getGui(){return this.eGui}focus(e){return!!this.eGui&&(this.lastFocusEvent=e||null,this.eGui.focus(),!0)}getRowIndex(){return this.parentRowCtrl.getRowIndex()}getParentRowCtrl(){return this.parentRowCtrl}getPinned(){return this.parentRowCtrl.getPinned()}getInstanceId(){return this.instanceId}getColumnGroupChild(){return this.columnGroupChild}removeDragSource(){this.dragSource&&(this.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null)}handleContextMenuMouseEvent(e,t,a){const n=e??t;this.gos.get("preventDefaultOnContextMenu")&&n.preventDefault();const o=te(a)?a:void 0;this.menuService.isHeaderContextMenuEnabled(o)&&this.menuService.showHeaderContextMenu(o,e,t),this.dispatchColumnMouseEvent("columnHeaderContextMenu",a)}dispatchColumnMouseEvent(e,t){const a={type:e,column:t};this.eventService.dispatchEvent(a)}destroy(){super.destroy(),this.removeDragSource(),this.comp=null,this.column=null,this.resizeFeature=null,this.lastFocusEvent=null,this.columnGroupChild=null,this.parentRowCtrl=null,this.eGui=null}};ir.DOM_DATA_KEY_HEADER_CTRL="headerCtrl";var sr=ir,lr=class extends A{wireBeans(e){this.columnHov';
      S = S + 'erService=e.columnHoverService}constructor(e,t){super(),this.columns=e,this.element=t}postConstruct(){this.gos.get("columnHoverHighlight")&&this.addMouseHoverListeners()}addMouseHoverListeners(){this.addManagedListeners(this.element,{mouseout:this.onMouseOut.bind(this),mouseover:this.onMouseOver.bind(this)})}onMouseOut(){this.columnHoverService.clearMouseOver()}onMouseOver(){this.columnHoverService.setMouseOver(this.columns)}},cr=class extends sr{constructor(e,t,a){super(e,t,a),this.iconCreated=!1,this.column=e}setComp(e,t,a,n){this.comp=e,this.eButtonShowMainFilter=a,this.eFloatingFilterBody=n,this.setGui(t),this.setupActive(),this.setupWidth(),this.setupLeft(),this.setupHover(),this.setupFocus(),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(),this.setupUi(),this.addManagedElementListeners(this.eButtonShowMainFilter,{click:this.showParentFilter.bind(this)}),this.setupFilterChangedListener(),this.addManagedListeners(this.column,{colDefChanged:this.onColDefChanged.bind(this)})}resizeHeader(){}moveHeader(){}setupActive(){const e=this.column.getColDef(),t=!!e.filter,a=!!e.floatingFilter;this.active=t&&a}setupUi(){if(this.comp.setButtonWrapperDisplayed(!this.suppressFilterButton&&this.active),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-full-body",this.suppressFilterButton),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-body",!this.suppressFilterButton),!this.active||this.iconCreated)return;const e=Wa("filter",this.gos,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(){this.createManagedBean(new ho(this.eGui,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)}))}setupAria(){const e=this.localeService.getLocaleTextFunc();kt(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){if(this.gos.getActiveDomE';
      S = S + 'lement()===this.eGui)return;const t=this.focusService.findNextFocusableElement(this.eGui,null,e.shiftKey);if(t)return this.beans.headerNavigationService.scrollToColumn(this.column),e.preventDefault(),void t.focus();const a=this.findNextColumnWithFloatingFilter(e.shiftKey);a&&this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:this.getParentRowCtrl().getRowIndex(),column:a},event:e})&&e.preventDefault()}findNextColumnWithFloatingFilter(e){const t=this.beans.visibleColsService;let a=this.column;do{if(a=e?t.getColBefore(a):t.getColAfter(a),!a)break}while(!a.getColDef().filter||!a.getColDef().floatingFilter);return a}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();switch(e.key){case tn.UP:case tn.DOWN:t||e.preventDefault();case tn.LEFT:case tn.RIGHT:if(t)return;e.stopPropagation();case tn.ENTER:t&&this.focusService.focusInto(this.eGui)&&e.preventDefault();break;case tn.ESCAPE:t||this.eGui.focus()}}onFocusIn(e){if(this.eGui.contains(e.relatedTarget))return;const t=!!e.relatedTarget&&!e.relatedTarget.classList.contains("ag-floating-filter"),a=!!e.relatedTarget&&la(e.relatedTarget,"ag-floating-filter");if(t&&a&&e.target===this.eGui){const e=this.lastFocusEvent,t=!(!e||e.key!==tn.TAB);if(e&&t){const t=e.shiftKey;this.focusService.focusInto(this.eGui,t)}}const n=this.getRowIndex();this.beans.focusService.setFocusedHeader(n,this.column)}setupHover(){this.createManagedBean(new lr([this.column],this.eGui));const e=()=>{if(!this.gos.get("columnHoverHighlight"))return;const e=this.beans.columnHoverService.isHovered(this.column);this.comp.addOrRemoveCssClass("ag-column-hover",e)};this.addManagedEventListeners({columnHoverChanged:e}),e()}setupLeft(){const e=new er(this.column,this.eGui,this.beans);this.createManagedBean(e)}setupFilterButton(){this.suppressFilterButton=!this.menuService.isFloatingFilterButtonEnabled(this.column),this.highlightFilterButtonWhenActive=!this.menuService.isLegacyMenuEnabled()}setupUserComp(){if(!this.active)ret';
      S = S + 'urn;const e=this.beans.filterManager?.getFloatingFilterCompDetails(this.column,(()=>this.showParentFilter()));e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setCompDetails(e)}showParentFilter(){const e=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;this.menuService.showFilterMenu({column:this.column,buttonElement:e,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(){if(!this.active)return;const{filterManager:e}=this.beans,t=t=>{if("filterDestroyed"===t?.source&&!this.isAlive())return;const a=this.comp.getFloatingFilterComp();a&&a.then((a=>{if(a){const n=e?.getCurrentFloatingFilterParentModel(this.column),o=t?{...t,columns:t.columns??[],source:"api"===t.source?"api":"columnFilter"}:null;a.onParentModelChanged(n,o)}}))};[this.destroySyncListener]=this.addManagedListeners(this.column,{filterChanged:t}),e?.isFilterActive(this.column)&&t(null)}setupWidth(){const e=()=>{const e=`${this.column.getActualWidth()}px`;this.comp.setWidth(e)};this.addManagedListeners(this.column,{widthChanged:e}),e()}setupFilterChangedListener(){this.active&&([this.destroyFilterChangedListener]=this.addManagedListeners(this.column,{filterChanged:this.updateFilterButton.bind(this)}),this.updateFilterButton())}updateFilterButton(){if(!this.suppressFilterButton&&this.comp){const e=!!this.beans.filterManager?.isFilterAllowed(this.column);this.comp.setButtonWrapperDisplayed(e),this.highlightFilterButtonWhenActive&&e&&this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(){const e=this.active;this.setupActive();const t=!e&&this.active;e&&!this.active&&(this.destroySyncListener(),this.destroyFilterChangedListener());const a=this.active?this.beans.filterManager?.getFloatingFilterCompDetails(this.column,(()=>this.showParentFilter())):null,n=this.comp.getFloatingFilterComp();n&&a?n.then((e=>{!e||this.beans.filterManager?.areFilterCompsDifferent(this.userCompDetails??n';
      S = S + 'ull,a)?this.updateCompDetails(a,t):this.updateFloatingFilterParams(a)})):this.updateCompDetails(a,t)}updateCompDetails(e,t){this.isAlive()&&(this.setCompDetails(e),this.setupFilterButton(),this.setupUi(),t&&(this.setupSyncWithFilter(),this.setupFilterChangedListener()))}updateFloatingFilterParams(e){if(!e)return;const t=e.params;this.comp.getFloatingFilterComp()?.then((e=>{let a=!1;if(e?.refresh&&"function"==typeof e.refresh){null!==e.refresh(t)&&(a=!0)}if(!a&&e?.onParamsUpdated&&"function"==typeof e.onParamsUpdated){null!==e.onParamsUpdated(t)&&ce("Custom floating filter method \'onParamsUpdated\' is deprecated. Use \'refresh\' instead.")}}))}destroy(){super.destroy(),this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.destroySyncListener=null,this.destroyFilterChangedListener=null}},gr="32.0.0";function dr(e,t,a){if(null==t)return null;let n=null;const{compName:o,jsComp:r,fwComp:i}=Bn.getCompKeys(e,t,Pn);if(o){n={set:"agSetColumnFloatingFilter",agSetColumnFilter:"agSetColumnFloatingFilter",multi:"agMultiColumnFloatingFilter",agMultiColumnFilter:"agMultiColumnFloatingFilter",group:"agGroupColumnFloatingFilter",agGroupColumnFilter:"agGroupColumnFloatingFilter",number:"agNumberColumnFloatingFilter",agNumberColumnFilter:"agNumberColumnFloatingFilter",date:"agDateColumnFloatingFilter",agDateColumnFilter:"agDateColumnFloatingFilter",text:"agTextColumnFloatingFilter",agTextColumnFilter:"agTextColumnFloatingFilter"}[o]}else{null==r&&null==i&&!0===t.filter&&(n=a())}return n}var hr=class extends Ba{wireBeans(e){this.columnNameService=e.columnNameService}getDefaultDebounceMs(){return 0}destroy(){super.destroy()}isEventFromFloatingFilter(e){return e&&e.afterFloatingFilter}isEventFromDataChange(e){return e?.afterDataChange}getLastType(){return this.lastType}isReadOnly(){return this.readOnly}setLastTypeFromModel(e){if(!e)return void(this.lastType=this.optionsFactory.getDefaultOption());let t;if(e.operator){t=e.conditions[0]}else t=e;this.las';
      S = S + 'tType=t.type}canWeEditAfterModelFromParentFilter(e){if(!e)return this.isTypeEditable(this.lastType);if(e.operator)return!1;const t=e;return this.isTypeEditable(t.type)}init(e){this.setSimpleParams(e,!1)}setSimpleParams(e,t=!0){this.optionsFactory=new So,this.optionsFactory.init(e.filterParams,this.getDefaultFilterOptions()),t||(this.lastType=this.optionsFactory.getDefaultOption()),this.readOnly=!!e.filterParams.readOnly;const a=this.isTypeEditable(this.optionsFactory.getDefaultOption());this.setEditable(a)}onParamsUpdated(e){this.refresh(e)}refresh(e){this.setSimpleParams(e)}doesFilterHaveSingleInput(e){const t=this.optionsFactory.getCustomOption(e),{numberOfInputs:a}=t||{};return null==a||1==a}isTypeEditable(e){return!!e&&!this.isReadOnly()&&this.doesFilterHaveSingleInput(e)&&["inRange","empty","blank","notBlank"].indexOf(e)<0}getAriaLabel(e){return`${this.columnNameService.getDisplayNameForColumn(e.column,"header",!0)} ${this.localeService.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`}},ur=class extends A{constructor(e){super(),this.params=e,this.eFloatingFilterTextInput=qa,this.valueChangedListener=()=>{}}setupGui(e){this.eFloatingFilterTextInput=this.createManagedBean(new Fo(this.params?.config));const t=this.eFloatingFilterTextInput.getGui();e.appendChild(t);const a=e=>this.valueChangedListener(e);this.addManagedListeners(t,{input:a,keydown:a})}setEditable(e){this.eFloatingFilterTextInput.setDisabled(!e)}setAutoComplete(e){this.eFloatingFilterTextInput.setAutoComplete(e)}getValue(){return this.eFloatingFilterTextInput.getValue()}setValue(e,t){this.eFloatingFilterTextInput.setValue(e,t)}setValueChangedListener(e){this.valueChangedListener=e}setParams(e){this.setAriaLabel(e.ariaLabel),void 0!==e.autoComplete&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eFloatingFilterTextInput.setInputAriaLabel(e)}},pr=class extends hr{constructor(){super(...arguments),this.eFloatingFilterInputContainer=qa}postConstruct(){this.setTemplate(\'\\n            <d';
      S = S + 'iv class="ag-floating-filter-input" role="presentation" data-ref="eFloatingFilterInputContainer"></div>\\n        \')}getDefaultDebounceMs(){return 500}onParentModelChanged(e,t){this.isEventFromFloatingFilter(t)||this.isEventFromDataChange(t)||(this.setLastTypeFromModel(e),this.setEditable(this.canWeEditAfterModelFromParentFilter(e)),this.floatingFilterInputService.setValue(this.getFilterModelFormatter().getModelAsString(e)))}init(e){this.setupFloatingFilterInputService(e),super.init(e),this.setTextInputParams(e)}setupFloatingFilterInputService(e){this.floatingFilterInputService=this.createFloatingFilterInputService(e),this.floatingFilterInputService.setupGui(this.eFloatingFilterInputContainer)}setTextInputParams(e){this.params=e;const t=e.browserAutoComplete??!1;if(this.floatingFilterInputService.setParams({ariaLabel:this.getAriaLabel(e),autoComplete:t}),this.applyActive=mo(this.params.filterParams),!this.isReadOnly()){const e=po(this.params.filterParams,this.getDefaultDebounceMs()),t=fe(this.syncUpWithParentFilter.bind(this),e);this.floatingFilterInputService.setValueChangedListener(t)}}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.setTextInputParams(e)}recreateFloatingFilterInputService(e){const t=this.floatingFilterInputService.getValue();ba(this.eFloatingFilterInputContainer),this.destroyBean(this.floatingFilterInputService),this.setupFloatingFilterInputService(e),this.floatingFilterInputService.setValue(t,!0)}syncUpWithParentFilter(e){const t=e.key===tn.ENTER;if(this.applyActive&&!t)return;let a=this.floatingFilterInputService.getValue();this.params.filterParams.trimInput&&(a=Go(a),this.floatingFilterInputService.setValue(a,!0)),this.params.parentFilterInstance((e=>{e&&e.onFloatingFilterChanged(this.getLastType()||null,a||null)}))}setEditable(e){this.floatingFilterInputService.setEditable(e)}},mr=class extends A{constructor(){super(...arguments),this.valueChangedListener=()=>{},this.numberInputActive=!0}setupGui(e){this.eFloatingFilterNumbe';
      S = S + 'rInput=this.createManagedBean(new Do),this.eFloatingFilterTextInput=this.createManagedBean(new Fo),this.eFloatingFilterTextInput.setDisabled(!0);const t=this.eFloatingFilterNumberInput.getGui(),a=this.eFloatingFilterTextInput.getGui();e.appendChild(t),e.appendChild(a),this.setupListeners(t,(e=>this.valueChangedListener(e))),this.setupListeners(a,(e=>this.valueChangedListener(e)))}setEditable(e){this.numberInputActive=e,this.eFloatingFilterNumberInput.setDisplayed(this.numberInputActive),this.eFloatingFilterTextInput.setDisplayed(!this.numberInputActive)}setAutoComplete(e){this.eFloatingFilterNumberInput.setAutoComplete(e),this.eFloatingFilterTextInput.setAutoComplete(e)}getValue(){return this.getActiveInputElement().getValue()}setValue(e,t){this.getActiveInputElement().setValue(e,t)}getActiveInputElement(){return this.numberInputActive?this.eFloatingFilterNumberInput:this.eFloatingFilterTextInput}setValueChangedListener(e){this.valueChangedListener=e}setupListeners(e,t){this.addManagedListeners(e,{input:t,keydown:t})}setParams(e){this.setAriaLabel(e.ariaLabel),void 0!==e.autoComplete&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eFloatingFilterNumberInput.setInputAriaLabel(e),this.eFloatingFilterTextInput.setInputAriaLabel(e)}},fr=class extends pr{init(e){super.init(e),this.filterModelFormatter=new No(this.localeService,this.optionsFactory)}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory})}getDefaultFilterOptions(){return Oo}getFilterModelFormatter(){return this.filterModelFormatter}createFloatingFilterInputService(){return this.createManagedBean(new ur)}};var vr={version:gr,moduleName:"@ag-grid-community/filter-core",beans:[ro]},br={version:gr,moduleName:"@ag-grid-community/filter-api",apiFunctions:{isAnyFilterPresent:function(e){return!!e.filterManager?.isAnyFilterPresent()},onFilterChanged:function(e,t="api"){e.filterManager?.onFilterChanged({source:t})}},depend';
      S = S + 'antModules:[vr]},Cr={version:gr,moduleName:"@ag-grid-community/column-filter",beans:[class extends A{constructor(){super(...arguments),this.beanName="columnFilterService",this.allColumnFilters=new Map,this.allColumnListeners=new Map,this.activeAggregateFilters=[],this.activeColumnFilters=[],this.processingFilterChange=!1,this.filterModelUpdateQueue=[],this.columnFilterModelUpdateQueue=[]}wireBeans(e){this.valueService=e.valueService,this.columnModel=e.columnModel,this.rowModel=e.rowModel,this.userComponentFactory=e.userComponentFactory,this.rowRenderer=e.rowRenderer,this.dataTypeService=e.dataTypeService,this.filterManager=e.filterManager}postConstruct(){this.addManagedEventListeners({gridColumnsChanged:this.onColumnsChanged.bind(this),rowDataUpdated:()=>this.onNewRowsLoaded("rowDataUpdated"),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.initialFilterModel={...this.gos.get("initialState")?.filter?.filterModel??{}}}setFilterModel(e,t="api"){if(this.dataTypeService?.isPendingInference())return void this.filterModelUpdateQueue.push({model:e,source:t});const a=[],n=this.getFilterModel();if(e){const t=new Set(Object.keys(e));this.allColumnFilters.forEach(((n,o)=>{const r=e[o];a.push(this.setModelOnFilterWrapper(n.filterPromise,r)),t.delete(o)})),t.forEach((t=>{const n=this.columnModel.getColDefCol(t)||this.columnModel.getCol(t);if(!n)return void ce("setFilterModel() - no column found for colId: "+t);if(!n.isFilterAllowed())return void ce("setFilterModel() - unable to fully apply model, filtering disabled for colId: "+t);const o=this.getOrCreateFilterWrapper(n);o?a.push(this.setModelOnFilterWrapper(o.filterPromise,e[t])):ce("setFilterModel() - unable to fully apply model, unable to create filter for colId: "+t)}))}else this.allColumnFilters.forEach((e=>{a.push(this.setModelOnFilterWrapper(e.filterPromise,null))}));Cn.all(a).then((()=>{const e=this.getFilterModel(),a=[];this.allColumnFilters.forEach(((t,o)=>{V(n?n[o]:null,e?e[o]:null)||a.push(t.col';
      S = S + 'umn)})),a.length>0&&this.filterManager?.onFilterChanged({columns:a,source:t})}))}setModelOnFilterWrapper(e,t){return new Cn((a=>{e.then((e=>{"function"!=typeof e.setModel&&(ce("filter missing setModel method, which is needed for setFilterModel"),a()),(e.setModel(t)||Cn.resolve()).then((()=>a()))}))}))}getFilterModel(){const e={};return this.allColumnFilters.forEach(((t,a)=>{const n=this.getModelFromFilterWrapper(t);L(n)&&(e[a]=n)})),e}getModelFromFilterWrapper(e){const{filter:t}=e;return t?"function"!=typeof t.getModel?(ce("filter API missing getModel method, which is needed for getFilterModel"),null):t.getModel():this.getModelFromInitialState(e.column)}getModelFromInitialState(e){return this.initialFilterModel[e.getColId()]??null}isColumnFilterPresent(){return this.activeColumnFilters.length>0}isAggregateFilterPresent(){return!!this.activeAggregateFilters.length}disableColumnFilters(){return!!this.allColumnFilters.size&&(this.allColumnFilters.forEach((e=>this.disposeFilterWrapper(e,"advancedFilterEnabled"))),!0)}doAggregateFiltersPass(e,t){return this.doColumnFiltersPass(e,t,!0)}updateActiveFilters(){const e=!!this.gos.getGroupAggFiltering(),t=t=>{if(!t.isPrimary())return!0;const a=!this.columnModel.isPivotActive();return!(!t.isValueActive()||!a)&&(!!this.columnModel.isPivotMode()||e)},a=[],n=[];return this.forEachColumnFilter(((e,o)=>{const r=(e=>!!e&&(e.isFilterActive?e.isFilterActive():(ce("Filter is missing isFilterActive() method"),!1)))(e);r&&(t(o.column)?a.push(e):n.push(e))})).then((()=>{this.activeAggregateFilters=a,this.activeColumnFilters=n}))}updateFilterFlagInColumns(e,t){return this.forEachColumnFilter(((a,n)=>n.column.setFilterActive(a.isFilterActive(),e,t)))}forEachColumnFilter(e){return Cn.all(Array.from(this.allColumnFilters.values()).map((t=>t.filterPromise.then((a=>e(a,t))))))}doColumnFiltersPass(e,t,a){const{data:n,aggData:o}=e,r=a?this.activeAggregateFilters:this.activeColumnFilters,i=a?o:n;for(let a=0;a<r.length;a++){const n=r[a];if(null!=n&&';
      S = S + 'n!==t){if("function"!=typeof n.doesFilterPass)throw new Error("Filter is missing method doesFilterPass");if(!n.doesFilterPass({node:e,data:i}))return!1}}return!0}callOnFilterChangedOutsideRenderCycle(e){const t=()=>this.filterManager?.onFilterChanged(e);this.rowRenderer.isRefreshInProgress()?setTimeout(t,0):t()}updateBeforeFilterChanged(e={}){const{filterInstance:t,additionalEventAttributes:a}=e;return this.updateDependentFilters(),this.updateActiveFilters().then((()=>this.updateFilterFlagInColumns("filterChanged",a).then((()=>{this.allColumnFilters.forEach((e=>{e.filterPromise&&e.filterPromise.then((e=>{e&&e!==t&&e.onAnyFilterChanged&&e.onAnyFilterChanged()}))})),this.processingFilterChange=!0}))))}updateAfterFilterChanged(){this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){return!(this.gos.get("allowShowChangeAfterFilter")??!1)&&this.processingFilterChange}onNewRowsLoaded(e){this.forEachColumnFilter((e=>{e.onNewRowsLoaded&&e.onNewRowsLoaded()})).then((()=>this.updateFilterFlagInColumns(e,{afterDataChange:!0}))).then((()=>this.updateActiveFilters()))}createValueGetter(e){return({node:t})=>this.valueService.getValue(e,t,!0)}createGetValue(e){return(t,a)=>{const n=a?this.columnModel.getCol(a):e;return n?this.valueService.getValue(n,t,!0):void 0}}isFilterActive(e){const{filter:t}=this.cachedFilter(e)??{};return t?t.isFilterActive():null!=this.getModelFromInitialState(e)}getOrCreateFilterWrapper(e){if(!e.isFilterAllowed())return null;let t=this.cachedFilter(e);return t||(t=this.createFilterWrapper(e),this.setColumnFilterWrapper(e,t)),t}cachedFilter(e){return this.allColumnFilters.get(e.getColId())}getDefaultFilter(e){let t;if(Xa.__isRegistered("@ag-grid-enterprise/set-filter",this.gridId))t="agSetColumnFilter";else{const a=this.dataTypeService?.getBaseDataType(e);t="number"===a?"agNumberColumnFilter":"date"===a||"dateString"===a?"agDateColumnFilter":"agTextColumnFilter"}return t}getDefaultFloatingFilter(e){let t;if(Xa.__isRegistered("@ag-grid-ent';
      S = S + 'erprise/set-filter",this.gridId))t="agSetColumnFloatingFilter";else{const a=this.dataTypeService?.getBaseDataType(e);t="number"===a?"agNumberColumnFloatingFilter":"date"===a||"dateString"===a?"agDateColumnFloatingFilter":"agTextColumnFloatingFilter"}return t}createFilterInstance(e,t){const a=this.getDefaultFilter(e),n=e.getColDef();let o;const r={...this.createFilterParams(e,n),filterModifiedCallback:()=>this.filterModifiedCallbackFactory(o,e)(),filterChangedCallback:t=>this.filterChangedCallbackFactory(o,e)(t),doesRowPassOtherFilter:e=>!this.filterManager||this.filterManager.doesRowPassOtherFilters(o,e)},i=this.userComponentFactory.getFilterDetails(n,r,a);return i?{filterPromise:()=>{const e=i.newAgStackInstance();return null!=e&&e.then((e=>{o=e,t&&(t.filter=e)})),e},compDetails:i}:{filterPromise:null,compDetails:null}}createFilterParams(e,t){return this.gos.addGridCommonParams({column:e,colDef:K(t),rowModel:this.rowModel,filterChangedCallback:()=>{},filterModifiedCallback:()=>{},valueGetter:this.createValueGetter(e),getValue:this.createGetValue(e),doesRowPassOtherFilter:()=>!0})}createFilterWrapper(e){const t={column:e,filterPromise:null,compiledElement:null,compDetails:null},{filterPromise:a,compDetails:n}=this.createFilterInstance(e,t);return t.filterPromise=a?.()??null,t.compDetails=n,t}onColumnsChanged(){const e=[];this.allColumnFilters.forEach(((t,a)=>{let n;n=t.column.isPrimary()?this.columnModel.getColDefCol(a):this.columnModel.getCol(a),n&&n===t.column||(e.push(t.column),this.disposeFilterWrapper(t,"columnChanged"),this.disposeColumnListener(a))})),e.length>0?this.filterManager?.onFilterChanged({columns:e,source:"api"}):this.updateDependentFilters()}updateDependentFilters(){const e=this.columnModel.getAutoCols();e?.forEach((e=>{"agGroupColumnFilter"===e.getColDef().filter&&this.getOrCreateFilterWrapper(e)}))}isFilterAllowed(e){if(!e.isFilterAllowed())return!1;const{filter:t}=this.allColumnFilters.get(e.getColId())??{};return!t||("function"!=typeof t?.isFil';
      S = S + 'terAllowed||t.isFilterAllowed())}getFloatingFilterCompDetails(e,t){const a=t=>{const a=this.getOrCreateFilterWrapper(e)?.filterPromise;null!=a&&a.then((e=>{t(Hn(e))}))},n=e.getColDef(),o={...this.createFilterParams(e,n),filterChangedCallback:()=>a((t=>this.filterChangedCallbackFactory(t,e)()))},r=this.userComponentFactory.mergeParamsWithApplicationProvidedParams(n,Pn,o);let i=dr(this.frameworkOverrides,n,(()=>this.getDefaultFloatingFilter(e)));null==i&&(i="agReadOnlyFloatingFilter");const s={column:e,filterParams:r,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:a,showParentFilter:t,suppressFilterButton:!1};return this.userComponentFactory.getFloatingFilterCompDetails(n,s,i)}getCurrentFloatingFilterParentModel(e){return this.getModelFromFilterWrapper(this.cachedFilter(e)??{column:e})}destroyFilter(e,t="api"){const a=e.getColId(),n=this.allColumnFilters.get(a);this.disposeColumnListener(a),delete this.initialFilterModel[a],n&&(this.disposeFilterWrapper(n,t),this.filterManager?.onFilterChanged({columns:[e],source:"api"}))}disposeColumnListener(e){const t=this.allColumnListeners.get(e);t&&(this.allColumnListeners.delete(e),t())}disposeFilterWrapper(e,t){e.filterPromise.then((a=>{this.destroyBean(a),e.column.setFilterActive(!1,"filterDestroyed"),this.allColumnFilters.delete(e.column.getColId());const n={type:"filterDestroyed",source:t,column:e.column};this.eventService.dispatchEvent(n)}))}filterModifiedCallbackFactory(e,t){return()=>{const a={type:"filterModified",column:t,filterInstance:e};this.eventService.dispatchEvent(a)}}filterChangedCallbackFactory(e,t){return a=>{const n={filter:e,additionalEventAttributes:a,columns:[t],source:a?.source??"columnFilter"};this.callOnFilterChangedOutsideRenderCycle(n)}}checkDestroyFilter(e){const t=this.allColumnFilters.get(e);if(!t)return;const a=t.column,{compDetails:n}=a.isFilterAllowed()?this.createFilterInstance(a):{compDetails:null};if(this.areFilterCompsDifferent(t.compDetails,n))return';
      S = S + ' void this.destroyFilter(a,"paramsUpdated");const o=a.getColDef().filterParams;t.filterPromise?t.filterPromise.then((e=>{!1===(!e?.refresh||e.refresh({...this.createFilterParams(a,a.getColDef()),filterModifiedCallback:this.filterModifiedCallbackFactory(e,a),filterChangedCallback:this.filterChangedCallbackFactory(e,a),doesRowPassOtherFilter:t=>!this.filterManager||this.filterManager.doesRowPassOtherFilters(e,t),...o}))&&this.destroyFilter(a,"paramsUpdated")})):this.destroyFilter(a,"paramsUpdated")}setColumnFilterWrapper(e,t){const a=e.getColId();this.allColumnFilters.set(a,t),this.allColumnListeners.set(a,this.addManagedListeners(e,{colDefChanged:()=>this.checkDestroyFilter(a)})[0])}areFilterCompsDifferent(e,t){if(!t||!e)return!0;const{componentClass:a}=e,{componentClass:n}=t;return!(a===n||a?.render&&n?.render&&a.render===n.render)}hasFloatingFilters(){return this.columnModel.getCols().some((e=>e.getColDef().floatingFilter))}getFilterInstance(e,t){t&&this.getFilterInstanceImpl(e).then((e=>{const a=Hn(e);t(a)}))}getColumnFilterInstance(e){return new Promise((t=>{this.getFilterInstanceImpl(e).then((e=>{t(Hn(e))}))}))}getFilterInstanceImpl(e){const t=this.columnModel.getColDefCol(e);if(!t)return Cn.resolve(void 0);const a=this.getOrCreateFilterWrapper(t)?.filterPromise;return a??Cn.resolve(null)}processFilterModelUpdateQueue(){this.filterModelUpdateQueue.forEach((({model:e,source:t})=>this.setFilterModel(e,t))),this.filterModelUpdateQueue=[],this.columnFilterModelUpdateQueue.forEach((({key:e,model:t,resolve:a})=>{this.setColumnFilterModel(e,t).then((()=>a()))})),this.columnFilterModelUpdateQueue=[]}getColumnFilterModel(e){const t=this.getFilterWrapper(e);return t?this.getModelFromFilterWrapper(t):null}setColumnFilterModel(e,t){if(this.dataTypeService?.isPendingInference()){let a=()=>{};const n=new Promise((e=>{a=e}));return this.columnFilterModelUpdateQueue.push({key:e,model:t,resolve:a}),n}const a=this.columnModel.getColDefCol(e),n=a?this.getOrCreateFilterWrapper(a):n';
      S = S + 'ull;return n?(o=this.setModelOnFilterWrapper(n.filterPromise,t),new Promise((e=>{o.then((t=>e(t)))}))):Promise.resolve();var o}getFilterWrapper(e){const t=this.columnModel.getColDefCol(e);return t?this.cachedFilter(t)??null:null}destroy(){super.destroy(),this.allColumnFilters.forEach((e=>this.disposeFilterWrapper(e,"gridDestroyed"))),this.allColumnListeners.clear()}}],dependantModules:[vr]},wr={version:gr,moduleName:"@ag-grid-community/column-filter-api",apiFunctions:{isColumnFilterPresent:function(e){return!!e.filterManager?.isColumnFilterPresent()||!!e.filterManager?.isAggregateFilterPresent()},getFilterInstance:function(e,t,a){return e.filterManager?.getFilterInstance(t,a)},getColumnFilterInstance:function(e,t){return e.filterManager?.getColumnFilterInstance(t)??Promise.resolve(void 0)},destroyFilter:function(e,t){const a=e.columnModel.getColDefCol(t);if(a)return e.filterManager?.destroyFilter(a,"api")},setFilterModel:function(e,t){e.frameworkOverrides.wrapIncoming((()=>e.filterManager?.setFilterModel(t)))},getFilterModel:function(e){return e.filterManager?.getFilterModel()??{}},getColumnFilterModel:function(e,t){return e.filterManager?.getColumnFilterModel(t)??null},setColumnFilterModel:function(e,t,a){return e.filterManager?.setColumnFilterModel(t,a)??Promise.resolve()},showColumnFilter:function(e,t){const a=e.columnModel.getCol(t);a?e.menuService.showFilterMenu({column:a,containerType:"columnFilter",positionBy:"auto"}):ge(`column \'${t}\' not found`)}},dependantModules:[Cr,br]},yr={version:gr,moduleName:"@ag-grid-community/floating-filter-core",controllers:[{name:"headerFilterCell",classImp:cr}],dependantModules:[Cr]},Sr={version:gr,moduleName:"@ag-grid-community/floating-filter",dependantModules:[yr,Cr]},kr={version:gr,moduleName:"@ag-grid-community/read-only-floating-filter",userComponents:[{name:"agReadOnlyFloatingFilter",classImp:class extends Ba{constructor(){super(\'\\n            <div class="ag-floating-filter-input" role="presentation">\\n                <a';
      S = S + 'g-input-text-field data-ref="eFloatingFilterText"></ag-input-text-field>\\n            </div>\',[Mo]),this.eFloatingFilterText=qa}wireBeans(e){this.columnNameService=e.columnNameService}destroy(){super.destroy()}init(e){this.params=e;const t=this.columnNameService.getDisplayNameForColumn(e.column,"header",!0),a=this.localeService.getLocaleTextFunc();this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(`${t} ${a("ariaFilterInput","Filter Input")}`)}onParentModelChanged(e){null!=e?this.params.parentFilterInstance((t=>{if(t.getModelAsString){const a=t.getModelAsString(e);this.eFloatingFilterText.setValue(a)}})):this.eFloatingFilterText.setValue("")}onParamsUpdated(e){this.refresh(e)}refresh(e){this.init(e)}}}],dependantModules:[yr]},xr={version:gr,moduleName:"@ag-grid-community/simple-floating-filter",dependantModules:[{version:gr,moduleName:"@ag-grid-community/simple-filter",dependantModules:[Cr],userComponents:[{name:"agTextColumnFilter",classImp:qo},{name:"agNumberColumnFilter",classImp:Lo},{name:"agDateColumnFilter",classImp:$o},{name:"agDateInput",classImp:class extends Ba{constructor(){super(\'\\n            <div class="ag-filter-filter">\\n                <ag-input-text-field class="ag-date-filter" data-ref="eDateInput"></ag-input-text-field>\\n            </div>\',[Mo]),this.eDateInput=qa}destroy(){super.destroy()}init(e){this.params=e,this.setParams(e);const t=this.eDateInput.getInputElement();this.addManagedListeners(t,{mouseDown:()=>{this.eDateInput.isDisabled()||this.usingSafariDatePicker||t.focus()},input:e=>{e.target===this.gos.getActiveDomElement()&&(this.eDateInput.isDisabled()||this.params.onDateChanged())}})}setParams(e){const t=this.eDateInput.getInputElement(),a=this.shouldUseBrowserDatePicker(e);this.usingSafariDatePicker=a&&Kt(),t.type=a?"date":"text";const{minValidYear:n,maxValidYear:o,minValidDate:r,maxValidDate:i}=e.filterParams||{};if(r&&n&&ce("DateFilter should not have both minValidDate and minValidYear parameters set at the same time! minVal';
      S = S + 'idYear will be ignored."),i&&o&&ce("DateFilter should not have both maxValidDate and maxValidYear parameters set at the same time! maxValidYear will be ignored."),r&&i){const[e,t]=[r,i].map((e=>e instanceof Date?e:Yo(e)));e&&t&&e.getTime()>t.getTime()&&ce("DateFilter parameter minValidDate should always be lower than or equal to parameter maxValidDate.")}r?r instanceof Date?t.min=Qo(r):t.min=r:n&&(t.min=`${n}-01-01`),i?i instanceof Date?t.max=Qo(i):t.max=i:o&&(t.max=`${o}-12-31`)}onParamsUpdated(e){this.refresh(e)}refresh(e){this.params=e,this.setParams(e)}getDate(){return Yo(this.eDateInput.getValue())}setDate(e){this.eDateInput.setValue(jo(e,!1))}setInputPlaceholder(e){this.eDateInput.setInputPlaceholder(e)}setInputAriaLabel(e){this.eDateInput.setAriaLabel(e)}setDisabled(e){this.eDateInput.setDisabled(e)}afterGuiAttached(e){e&&e.suppressFocus||this.eDateInput.getInputElement().focus()}shouldUseBrowserDatePicker(e){return e.filterParams&&null!=e.filterParams.browserDatePicker?e.filterParams.browserDatePicker:Yt()||_t()||Kt()&&Qt()>=14.1}}}]},yr],userComponents:[{name:"agTextColumnFloatingFilter",classImp:fr},{name:"agNumberColumnFloatingFilter",classImp:class extends pr{init(e){super.init(e),this.filterModelFormatter=new To(this.localeService,this.optionsFactory,e.filterParams?.numberFormatter)}onParamsUpdated(e){this.refresh(e)}refresh(e){Io(e.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),super.refresh(e),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory})}getDefaultFilterOptions(){return Po}getFilterModelFormatter(){return this.filterModelFormatter}createFloatingFilterInputService(e){return this.allowedCharPattern=Io(e.filterParams),this.allowedCharPattern?this.createManagedBean(new ur({config:{allowedCharPattern:this.allowedCharPattern}})):this.createManagedBean(new mr)}}},{name:"agDateColumnFloatingFilter",classImp:class extends hr{constructor(){super(\'\\n            <div class="ag-floating-filter-in';
      S = S + 'put" role="presentation">\\n                <ag-input-text-field data-ref="eReadOnlyText"></ag-input-text-field>\\n                <div data-ref="eDateWrapper" style="display: flex;"></div>\\n            </div>\',[Mo]),this.eReadOnlyText=qa,this.eDateWrapper=qa}wireBeans(e){super.wireBeans(e),this.context=e.context,this.userComponentFactory=e.userComponentFactory}getDefaultFilterOptions(){return Jo}init(e){super.init(e),this.params=e,this.filterParams=e.filterParams,this.createDateComponent(),this.filterModelFormatter=new Zo(this.filterParams,this.localeService,this.optionsFactory);const t=this.localeService.getLocaleTextFunc();this.eReadOnlyText.setDisabled(!0).setInputAriaLabel(t("ariaDateFilterInput","Date Filter Input"))}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.params=e,this.filterParams=e.filterParams,this.updateDateComponent(),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory,dateFilterParams:this.filterParams}),this.updateCompOnModelChange(e.currentParentModel())}updateCompOnModelChange(e){const t=!this.isReadOnly()&&this.canWeEditAfterModelFromParentFilter(e);if(this.setEditable(t),t){if(e){const t=e;this.dateComp.setDate(Yo(t.dateFrom))}else this.dateComp.setDate(null);this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)),this.dateComp.setDate(null)}setEditable(e){ra(this.eDateWrapper,e),ra(this.eReadOnlyText.getGui(),!e)}onParentModelChanged(e,t){this.isEventFromFloatingFilter(t)||this.isEventFromDataChange(t)||(super.setLastTypeFromModel(e),this.updateCompOnModelChange(e))}onDateChanged(){const e=jo(this.dateComp.getDate());this.params.parentFilterInstance((t=>{if(t){const a=Yo(e);t.onFloatingFilterChanged(this.getLastType()||null,a)}}))}getDateComponentParams(){const e=po(this.params.filterParams,this.getDefaultDebounceMs());return{onDateChanged:fe(this.onDateChanged.bind(this),e),filterParams:this.params.column.getColDef().filterParams}}createDateCo';
      S = S + 'mponent(){this.dateComp=new _o(this.context,this.userComponentFactory,this.getDateComponentParams(),this.eDateWrapper,(e=>{e.setInputAriaLabel(this.getAriaLabel(this.params))})),this.addDestroyFunc((()=>this.dateComp.destroy()))}updateDateComponent(){const e=this.gos.addGridCommonParams(this.getDateComponentParams());this.dateComp.updateParams(e)}getFilterModelFormatter(){return this.filterModelFormatter}}}]},Rr={version:gr,moduleName:"@ag-grid-community/quick-filter-core",beans:[class extends A{constructor(){super(...arguments),this.beanName="quickFilterService",this.quickFilter=null,this.quickFilterParts=null}wireBeans(e){this.valueService=e.valueService,this.columnModel=e.columnModel,this.rowModel=e.rowModel,this.pivotResultColsService=e.pivotResultColsService}postConstruct(){const e=this.resetQuickFilterCache.bind(this);this.addManagedEventListeners({columnPivotModeChanged:e,newColumnsLoaded:e,columnRowGroupChanged:e,columnVisible:()=>{this.gos.get("includeHiddenColumnsInQuickFilter")||this.resetQuickFilterCache()}}),this.addManagedPropertyListener("quickFilterText",(e=>this.setQuickFilter(e.currentValue))),this.addManagedPropertyListeners(["includeHiddenColumnsInQuickFilter","applyQuickFilterBeforePivotOrAgg"],(()=>this.onQuickFilterColumnConfigChanged())),this.quickFilter=this.parseQuickFilter(this.gos.get("quickFilterText")),this.parser=this.gos.get("quickFilterParser"),this.matcher=this.gos.get("quickFilterMatcher"),this.setQuickFilterParts(),this.addManagedPropertyListeners(["quickFilterMatcher","quickFilterParser"],(()=>this.setQuickFilterParserAndMatcher()))}refreshQuickFilterCols(){const e=this.columnModel.isPivotMode(),t=this.columnModel.getAutoCols(),a=this.columnModel.getColDefCols();let n=(e&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")?this.pivotResultColsService.getPivotResultCols()?.list:a)??[];t&&(n=n.concat(t)),this.colsForQuickFilter=this.gos.get("includeHiddenColumnsInQuickFilter")?n:n.filter((e=>e.isVisible()||e.isRowGroupActive()))}isQu';
      S = S + 'ickFilterPresent(){return null!==this.quickFilter}doesRowPassQuickFilter(e){const t=this.gos.get("cacheQuickFilter");return this.matcher?this.doesRowPassQuickFilterMatcher(t,e):this.quickFilterParts.every((a=>t?this.doesRowPassQuickFilterCache(e,a):this.doesRowPassQuickFilterNoCache(e,a)))}resetQuickFilterCache(){this.rowModel.forEachNode((e=>e.quickFilterAggregateText=null))}setQuickFilterParts(){const{quickFilter:e,parser:t}=this;this.quickFilterParts=e?t?t(e):e.split(" "):null}parseQuickFilter(e){return L(e)?this.gos.isRowModelType("clientSide")?e.toUpperCase():(ce("Quick filtering only works with the Client-Side Row Model"),null):null}setQuickFilter(e){if(null!=e&&"string"!=typeof e)return void ce("Grid option quickFilterText only supports string inputs, received: "+typeof e);const t=this.parseQuickFilter(e);this.quickFilter!==t&&(this.quickFilter=t,this.setQuickFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}setQuickFilterParserAndMatcher(){const e=this.gos.get("quickFilterParser"),t=this.gos.get("quickFilterMatcher"),a=e!==this.parser||t!==this.matcher;this.parser=e,this.matcher=t,a&&(this.setQuickFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}onQuickFilterColumnConfigChanged(){this.refreshQuickFilterCols(),this.resetQuickFilterCache(),this.isQuickFilterPresent()&&this.dispatchLocalEvent({type:"quickFilterChanged"})}doesRowPassQuickFilterNoCache(e,t){return this.colsForQuickFilter.some((a=>{const n=this.getQuickFilterTextForColumn(a,e);return L(n)&&n.indexOf(t)>=0}))}doesRowPassQuickFilterCache(e,t){return this.checkGenerateQuickFilterAggregateText(e),e.quickFilterAggregateText.indexOf(t)>=0}doesRowPassQuickFilterMatcher(e,t){let a;e?(this.checkGenerateQuickFilterAggregateText(t),a=t.quickFilterAggregateText):a=this.getQuickFilterAggregateText(t);const{quickFilterParts:n,matcher:o}=this;return o(n,a)}checkGenerateQuickFilterAggregateText(e){e.quickFilterAggregateText||(e.quickFilterAggregateText=this.getQuickFilterAggre';
      S = S + 'gateText(e))}getQuickFilterTextForColumn(e,t){let a=this.valueService.getValue(e,t,!0);const n=e.getColDef();if(n.getQuickFilterText){const o=this.gos.addGridCommonParams({value:a,node:t,data:t.data,column:e,colDef:n});a=n.getQuickFilterText(o)}return L(a)?a.toString().toUpperCase():null}getQuickFilterAggregateText(e){const t=[];return this.colsForQuickFilter.forEach((a=>{const n=this.getQuickFilterTextForColumn(a,e);L(n)&&t.push(n)})),t.join("\\n")}}],dependantModules:[vr]},zr={version:gr,moduleName:"@ag-grid-community/filter",dependantModules:[xr,kr,{version:gr,moduleName:"@ag-grid-community/quick-filter",dependantModules:[Rr,{version:gr,moduleName:"@ag-grid-community/quick-filter-api",apiFunctions:{isQuickFilterPresent:function(e){return!!e.filterManager?.isQuickFilterPresent()},getQuickFilter:function(e){return e.gos.get("quickFilterText")},resetQuickFilter:function(e){e.filterManager?.resetQuickFilterCache()}},dependantModules:[Rr]}]},wr]},Fr=class extends Ba{constructor(e,t){super(e),this.ctrl=t}getCtrl(){return this.ctrl}},Mr=class extends Fr{constructor(e){super(\'<div class="ag-header-cell ag-floating-filter" role="gridcell">\\n            <div data-ref="eFloatingFilterBody" role="presentation"></div>\\n            <div class="ag-floating-filter-button ag-hidden" data-ref="eButtonWrapper" role="presentation">\\n                <button type="button" class="ag-button ag-floating-filter-button-button" data-ref="eButtonShowMainFilter" tabindex="-1"></button>\\n            </div>\\n        </div>\',e),this.eFloatingFilterBody=qa,this.eButtonWrapper=qa,this.eButtonShowMainFilter=qa}postConstruct(){const e=this.getGui(),t={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),addOrRemoveBodyCssClass:(e,t)=>this.eFloatingFilterBody.classList.toggle(e,t),setButtonWrapperDisplayed:e=>ra(this.eButtonWrapper,e),setCompDetails:e=>this.setCompDetails(e),getFloatingFilterComp:()=>this.compPromise,setWidth:t=>e.style.width=t,setMenuIcon:e=>this.eButtonShowMainFilter.appendChild';
      S = S + '(e)};this.ctrl.setComp(t,e,this.eButtonShowMainFilter,this.eFloatingFilterBody)}setCompDetails(e){if(!e)return this.destroyFloatingFilterComp(),void(this.compPromise=null);this.compPromise=e.newAgStackInstance(),this.compPromise.then((e=>this.afterCompCreated(e)))}destroy(){this.destroyFloatingFilterComp(),super.destroy()}destroyFloatingFilterComp(){this.floatingFilterComp&&(this.eFloatingFilterBody.removeChild(this.floatingFilterComp.getGui()),this.floatingFilterComp=this.destroyBean(this.floatingFilterComp))}afterCompCreated(e){e&&(this.isAlive()?(this.destroyFloatingFilterComp(),this.floatingFilterComp=e,this.eFloatingFilterBody.appendChild(e.getGui()),e.afterGuiAttached&&e.afterGuiAttached()):this.destroyBean(e))}},Dr=class extends Fr{constructor(e){super(\'<div class="ag-header-cell" role="columnheader">\\n            <div data-ref="eResize" class="ag-header-cell-resize" role="presentation"></div>\\n            <div data-ref="eHeaderCompWrapper" class="ag-header-cell-comp-wrapper" role="presentation"></div>\\n        </div>\',e),this.eResize=qa,this.eHeaderCompWrapper=qa,this.headerCompVersion=0,this.column=e.getColumnGroupChild(),this.pinned=e.getPinned()}postConstruct(){const e=this.getGui();var t,a;t="col-id",null!=(a=this.column.getColId())&&""!=a?e.setAttribute(t,a):e.removeAttribute(t);const n={setWidth:t=>e.style.width=t,addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setAriaSort:t=>t?Bt(e,t):Ht(e),setUserCompDetails:e=>this.setUserCompDetails(e),getUserCompInstance:()=>this.headerComp};this.ctrl.setComp(n,this.getGui(),this.eResize,this.eHeaderCompWrapper);const o=this.ctrl.getSelectAllGui();this.eResize.insertAdjacentElement("afterend",o)}destroy(){this.destroyHeaderComp(),super.destroy()}destroyHeaderComp(){this.headerComp&&(this.eHeaderCompWrapper.removeChild(this.headerCompGui),this.headerComp=this.destroyBean(this.headerComp),this.headerCompGui=void 0)}setUserCompDetails(e){this.headerCompVersion++;const t=this.headerCompVersion;e.newAgStackIns';
      S = S + 'tance().then((e=>this.afterCompCreated(t,e)))}afterCompCreated(e,t){e==this.headerCompVersion&&this.isAlive()?(this.destroyHeaderComp(),this.headerComp=t,this.headerCompGui=t.getGui(),this.eHeaderCompWrapper.appendChild(this.headerCompGui),this.ctrl.setDragSource(this.getGui())):this.destroyBean(t)}},Er=class extends Fr{constructor(e){super(\'<div class="ag-header-group-cell" role="columnheader">\\n            <div data-ref="eResize" class="ag-header-cell-resize" role="presentation"></div>\\n        </div>\',e),this.eResize=qa}postConstruct(){const e=this.getGui();e.setAttribute("col-id",this.ctrl.getColId());const t={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setResizableDisplayed:e=>ra(this.eResize,e),setWidth:t=>e.style.width=t,setAriaExpanded:t=>{return a="aria-expanded",null!=(n=t)?e.setAttribute(a,n):e.removeAttribute(a);var a,n},setUserCompDetails:e=>this.setUserCompDetails(e),getUserCompInstance:()=>this.headerGroupComp};this.ctrl.setComp(t,e,this.eResize)}setUserCompDetails(e){e.newAgStackInstance().then((e=>this.afterHeaderCompCreated(e)))}afterHeaderCompCreated(e){const t=()=>this.destroyBean(e);if(!this.isAlive())return void t();const a=this.getGui(),n=e.getGui();a.appendChild(n),this.addDestroyFunc(t),this.headerGroupComp=e,this.ctrl.setDragSource(a)}},Pr=(e=>(e.COLUMN_GROUP="group",e.COLUMN="column",e.FLOATING_FILTER="filter",e))(Pr||{}),Ar=class extends Ba{constructor(e){super(),this.headerComps={},this.ctrl=e,this.setTemplate(`<div class="${this.ctrl.getHeaderRowClass()}" role="row"></div>`)}postConstruct(){Ot(this.getGui(),this.ctrl.getAriaRowIndex());const e={setHeight:e=>this.getGui().style.height=e,setTop:e=>this.getGui().style.top=e,setHeaderCtrls:(e,t)=>this.setHeaderCtrls(e,t),setWidth:e=>this.getGui().style.width=e};this.ctrl.setComp(e)}destroy(){this.setHeaderCtrls([],!1),super.destroy()}setHeaderCtrls(e,t){if(!this.isAlive())return;const a=this.headerComps;if(this.headerComps={},e.forEach((e=>{const t=e.getInstanceId();let n=a[t];';
      S = S + 'delete a[t],null==n&&(n=this.createHeaderComp(e),this.getGui().appendChild(n.getGui())),this.headerComps[t]=n})),j(a,((e,t)=>{this.getGui().removeChild(t.getGui()),this.destroyBean(t)})),t){const e=Y(this.headerComps);e.sort(((e,t)=>e.getCtrl().getColumnGroupChild().getLeft()-t.getCtrl().getColumnGroupChild().getLeft()));const t=e.map((e=>e.getGui()));xa(this.getGui(),t)}}createHeaderComp(e){let t;switch(this.ctrl.getType()){case"group":t=new Er(e);break;case"filter":t=new Mr(e);break;default:t=new Dr(e)}return this.createBean(t),t.setParentComponent(this),t}},Tr=(e=>(e[e.UP=0]="UP",e[e.DOWN=1]="DOWN",e[e.LEFT=2]="LEFT",e[e.RIGHT=3]="RIGHT",e))(Tr||{}),Ir=class extends A{constructor(){super(...arguments),this.beanName="headerNavigationService",this.currentHeaderRowWithoutSpan=-1}wireBeans(e){this.focusService=e.focusService,this.headerPositionUtils=e.headerPositionUtils,this.ctrlsService=e.ctrlsService,this.columnModel=e.columnModel,this.visibleColService=e.visibleColsService}postConstruct(){this.ctrlsService.whenReady((e=>{this.gridBodyCon=e.gridBodyCtrl}));const e=this.gos.getDocument();this.addManagedElementListeners(e,{mousedown:()=>this.setCurrentHeaderRowWithoutSpan(-1)})}getHeaderRowCount(){const e=this.ctrlsService.getHeaderRowContainerCtrl();return e?e.getRowCount():0}getHeaderPositionForColumn(e,t){let a;if("string"==typeof e?(a=this.columnModel.getCol(e),a||(a=this.visibleColService.getColumnGroup(e))):a=e,!a)return null;const n="filter"===d(this.ctrlsService.getHeaderRowContainerCtrl().getAllCtrls()).getType(),o=this.getHeaderRowCount()-1;let r=-1,i=a;for(;i;)r++,i=i.getParent();let s=r;return t&&n&&s===o-1&&s++,-1===s?null:{headerRowIndex:s,column:a}}navigateVertically(e,t,a){if(t||(t=this.focusService.getFocusedHeader()),!t)return!1;const{headerRowIndex:n}=t,o=t.column,r=this.getHeaderRowCount(),i=0===e;let{headerRowIndex:s,column:l,headerRowIndexWithoutSpan:c}=i?this.headerPositionUtils.getColumnVisibleParent(o,n):this.headerPositionUtils.getColumnVis';
      S = S + 'ibleChild(o,n),g=!1;return s<0&&(s=0,l=o,g=!0),s>=r?(s=-1,this.setCurrentHeaderRowWithoutSpan(-1)):void 0!==c&&(this.currentHeaderRowWithoutSpan=c),!(!g&&!l)&&this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:s,column:l},allowUserOverride:!0,event:a})}setCurrentHeaderRowWithoutSpan(e){this.currentHeaderRowWithoutSpan=e}navigateHorizontally(e,t=!1,a){const n=this.focusService.getFocusedHeader(),o=2===e,r=this.gos.get("enableRtl");let i,s;if(-1!==this.currentHeaderRowWithoutSpan?n.headerRowIndex=this.currentHeaderRowWithoutSpan:this.currentHeaderRowWithoutSpan=n.headerRowIndex,o!==r?(s="Before",i=this.headerPositionUtils.findHeader(n,s)):(s="After",i=this.headerPositionUtils.findHeader(n,s)),i||!t)return this.focusService.focusHeaderPosition({headerPosition:i,direction:s,fromTab:t,allowUserOverride:!0,event:a});if(t){const e=this.gos.getCallback("tabToNextHeader");if(e)return this.focusService.focusHeaderPositionFromUserFunc({userFunc:e,headerPosition:i,direction:s})}return this.focusNextHeaderRow(n,s,a)}focusNextHeaderRow(e,t,a){const n=e.headerRowIndex;let o,r=null;if("Before"===t?n>0&&(o=n-1,this.currentHeaderRowWithoutSpan-=1,r=this.headerPositionUtils.findColAtEdgeForHeaderRow(o,"end")):(o=n+1,this.currentHeaderRowWithoutSpan<this.getHeaderRowCount()?this.currentHeaderRowWithoutSpan+=1:this.setCurrentHeaderRowWithoutSpan(-1),r=this.headerPositionUtils.findColAtEdgeForHeaderRow(o,"start")),!r)return!1;const{column:i,headerRowIndex:s}=this.headerPositionUtils.getHeaderIndexToFocus(r.column,r?.headerRowIndex);return this.focusService.focusHeaderPosition({headerPosition:{column:i,headerRowIndex:s},direction:t,fromTab:!0,allowUserOverride:!0,event:a})}scrollToColumn(e,t="After"){if(e.getPinned())return;let a;if(Ke(e)){const n=e.getDisplayedLeafColumns();a="Before"===t?d(n):n[0]}else a=e;this.gridBodyCon.getScrollFeature().ensureColumnVisible(a)}},Lr=class extends A{wireBeans(e){this.headerNavigationService=e.headerNavigationService,this.focusServic';
      S = S + 'e=e.focusService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.ctrlsService=e.ctrlsService,this.filterManager=e.filterManager,this.menuService=e.menuService}setComp(e,t,a){this.comp=e,this.eGui=t,this.createManagedBean(new ho(a,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addManagedEventListeners({columnPivotModeChanged:this.onPivotModeChanged.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this)}),this.onPivotModeChanged(),this.setupHeaderHeight();const n=this.onHeaderContextMenu.bind(this);this.addManagedElementListeners(this.eGui,{contextmenu:n}),this.mockContextMenuForIPad(n),this.ctrlsService.register("gridHeaderCtrl",this)}setupHeaderHeight(){const e=this.setHeaderHeight.bind(this);e(),this.addManagedPropertyListener("headerHeight",e),this.addManagedPropertyListener("pivotHeaderHeight",e),this.addManagedPropertyListener("groupHeaderHeight",e),this.addManagedPropertyListener("pivotGroupHeaderHeight",e),this.addManagedPropertyListener("floatingFiltersHeight",e),this.addManagedEventListeners({displayedColumnsChanged:e,columnHeaderHeightChanged:e,gridStylesChanged:e,advancedFilterEnabledChanged:e})}getHeaderHeight(){return this.headerHeight}setHeaderHeight(){const{columnModel:e}=this;let t,a=0,n=e.getHeaderRowCount();const o=this.filterManager?.hasFloatingFilters();o&&(n++,a=1);const r=this.columnModel.getColumnGroupHeaderRowHeight(),i=this.columnModel.getColumnHeaderRowHeight(),s=n-(1+a);if(t=a*e.getFloatingFiltersHeight(),t+=s*r,t+=i,this.headerHeight===t)return;this.headerHeight=t;const l=`${t+1}px`;this.comp.setHeightAndMinHeight(l),this.eventService.dispatchEvent({type:"headerHeightChanged"})}onPivotModeChanged(){const e=this.columnModel.isPivotMode();this.comp.addOrRemoveCssClass("ag-pivot-on",e),this.comp.addOrRemoveCssClass("ag-pivot-off",!e)}onDisplayedColumnsChanged(){const e=this.visibleColsService.getAllCols(';
      S = S + ').some((e=>e.isSpanHeaderHeight()));this.comp.addOrRemoveCssClass("ag-header-allow-overflow",e)}onTabKeyDown(e){const t=this.gos.get("enableRtl"),a=e.shiftKey!==t?2:3;(this.headerNavigationService.navigateHorizontally(a,!0,e)||this.focusService.focusNextGridCoreContainer(e.shiftKey))&&e.preventDefault()}handleKeyDown(e){let t=null;switch(e.key){case tn.LEFT:t=2;case tn.RIGHT:L(t)||(t=3),this.headerNavigationService.navigateHorizontally(t,!1,e);break;case tn.UP:t=0;case tn.DOWN:L(t)||(t=1),this.headerNavigationService.navigateVertically(t,null,e)&&e.preventDefault();break;default:return}}onFocusOut(e){const{relatedTarget:t}=e;!t&&this.eGui.contains(this.gos.getActiveDomElement())||this.eGui.contains(t)||this.focusService.clearFocusedHeader()}onHeaderContextMenu(e,t,a){if(!e&&!a||!this.menuService.isHeaderContextMenuEnabled())return;const{target:n}=e??t;n!==this.eGui&&n!==this.ctrlsService.getHeaderRowContainerCtrl().getViewport()||this.menuService.showHeaderContextMenu(void 0,e,a)}mockContextMenuForIPad(e){if(!Zt())return;const t=new ja(this.eGui);this.addManagedListeners(t,{longTap:t=>{e(void 0,t.touchStart,t.touchEvent)}}),this.addDestroyFunc((()=>t.destroy()))}},Or=class extends A{constructor(e,t=!1){super(),this.callback=e,this.addSpacer=t}wireBeans(e){this.visibleColsService=e.visibleColsService,this.scrollVisibleService=e.scrollVisibleService}postConstruct(){const e=this.setWidth.bind(this);this.addManagedPropertyListener("domLayout",e),this.addManagedEventListeners({columnContainerWidthChanged:e,displayedColumnsChanged:e,leftPinnedWidthChanged:e}),this.addSpacer&&this.addManagedEventListeners({rightPinnedWidthChanged:e,scrollVisibilityChanged:e,scrollbarWidthChanged:e}),this.setWidth()}setWidth(){const e=this.gos.isDomLayout("print"),t=this.visibleColsService.getBodyContainerWidth(),a=this.visibleColsService.getColsLeftWidth(),n=this.visibleColsService.getDisplayedColumnsRightWidth();let o;if(e)o=t+a+n;else if(o=t,this.addSpacer){0===(this.gos.get("enableRtl")';
      S = S + '?a:n)&&this.scrollVisibleService.isVerticalScrollShowing()&&(o+=this.gos.getScrollbarWidth())}this.callback(o)}},Nr=class extends A{constructor(e){super(),this.columnsToAggregate=[],this.columnsToGroup=[],this.columnsToPivot=[],this.pinned=e}wireBeans(e){this.funcColsService=e.funcColsService}onDragEnter(e){if(this.clearColumnsList(),this.gos.get("functionsReadOnly"))return;const t=e.dragItem.columns;t&&t.forEach((e=>{e.isPrimary()&&(e.isAnyFunctionActive()||(e.isAllowValue()?this.columnsToAggregate.push(e):e.isAllowRowGroup()?this.columnsToGroup.push(e):e.isAllowPivot()&&this.columnsToPivot.push(e)))}))}getIconName(){return this.columnsToAggregate.length+this.columnsToGroup.length+this.columnsToPivot.length>0?this.pinned?"pinned":"move":null}onDragLeave(e){this.clearColumnsList()}clearColumnsList(){this.columnsToAggregate.length=0,this.columnsToGroup.length=0,this.columnsToPivot.length=0}onDragging(e){}onDragStop(e){this.columnsToAggregate.length>0&&this.funcColsService.addValueColumns(this.columnsToAggregate,"toolPanelDragAndDrop"),this.columnsToGroup.length>0&&this.funcColsService.addRowGroupColumns(this.columnsToGroup,"toolPanelDragAndDrop"),this.columnsToPivot.length>0&&this.funcColsService.addPivotColumns(this.columnsToPivot,"toolPanelDragAndDrop")}};function Gr(e){const{isFromHeader:t,hDirection:a,xPosition:n,fromEnter:o,fakeEvent:r,pinned:i,gos:s,columnModel:l,columnMoveService:c,presentedColsService:g}=e,u=0===a,p=1===a;let{allMovingColumns:m}=e;if(t){const e=[];m.forEach((t=>{let a=null,n=t.getParent();for(;null!=n&&1===n.getDisplayedLeafColumns().length;)a=n,n=n.getParent();if(null!=a){(!!a.getColGroupDef()?.marryChildren?a.getProvidedColumnGroup().getLeafColumns():a.getLeafColumns()).forEach((t=>{e.includes(t)||e.push(t)}))}else e.includes(t)||e.push(t)})),m=e}const f=m.slice();l.sortColsLikeCols(f);const v=function(e){const{movingCols:t,draggingRight:a,xPosition:n,pinned:o,gos:r,columnModel:i,presentedColsService:s}=e,l=r.get("suppressMovableColumns")||';
      S = S + 't.some((e=>e.getColDef().suppressMovable));if(l)return[];const c=function(e,t){switch(t){case"left":return e.getLeftCols();case"right":return e.getRightCols();default:return e.getCenterCols()}}(s,o),g=i.getCols(),d=c.filter((e=>w(t,e))),h=c.filter((e=>!w(t,e))),u=g.filter((e=>!w(t,e)));let p,m=0,f=n;if(a){let e=0;d.forEach((t=>e+=t.getActualWidth())),f-=e}if(f>0){for(let e=0;e<h.length;e++){if(f-=h[e].getActualWidth(),f<0)break;m++}a&&m++}if(m>0){const e=h[m-1];p=u.indexOf(e)+1}else p=u.indexOf(h[0]),-1===p&&(p=0);const v=[p],b=(e,t)=>e-t;if(a){let e=p+1;const t=g.length-1;for(;e<=t;)v.push(e),e++;v.sort(b)}else{let e=p;const t=g.length-1;let a=g[e];for(;e<=t&&c.indexOf(a)<0;)e++,v.push(e),a=g[e];e=p-1;const n=0;for(;e>=n;)v.push(e),e--;v.sort(b).reverse()}return v}({movingCols:f,draggingRight:p,xPosition:n,pinned:i,gos:s,columnModel:l,presentedColsService:g}),b=function(e,t){const a=t.getCols(),n=(i=e.map((e=>a.indexOf(e))),i.sort(((e,t)=>e-t))),o=n[0],r=d(n);var i;return r-o!=n.length-1?null:o}(f,l);if(0===v.length)return;const C=v[0];let y=null!==b&&!o;if(t&&(y=null!==b),y&&!r){if(u&&C>=b)return;if(p&&C<=b)return}const S=g.getAllCols(),k=[];let x=null;for(let e=0;e<v.length;e++){const t=v[e],a=c.getProposedColumnOrder(f,t);if(!c.doesOrderPassRules(a))continue;const n=a.filter((e=>S.includes(e)));if(null===x)x=n;else if(!h(n,x))break;const o=Br(a);k.push({move:t,fragCount:o})}return 0!==k.length?(k.sort(((e,t)=>e.fragCount-t.fragCount)),qr(m,k[0].move,"uiColumnMoved",!1,c)):void 0}function qr(e,t,a,n,o){return o.moveColumns(e,t,a,n),n?null:{columns:e,toIndex:t}}function Br(e){function t(e){const t=[];let a=e.getOriginalParent();for(;null!=a;)t.push(a),a=a.getOriginalParent();return t}let a=0;for(let n=0;n<e.length-1;n++){let o=t(e[n]),r=t(e[n+1]);[o,r]=o.length>r.length?[o,r]:[r,o],o.forEach((e=>{-1===r.indexOf(e)&&a++}))}return a}function Hr(e,t,a,n,o){const r=o.getHeaderRowContainerCtrl(t).getViewport();if(a&&(e-=r.getBoundingClientRect().left),n.get("enableRtl"';
      S = S + ')){e=r.clientWidth-e}return null==t&&(e+=o.get("center").getCenterViewportScrollLeft()),e}var Vr=class extends A{constructor(e){super(),this.needToMoveLeft=!1,this.needToMoveRight=!1,this.lastMovedInfo=null,this.pinned=e,this.isCenterContainer=!L(e)}wireBeans(e){this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.columnMoveService=e.columnMoveService,this.dragAndDropService=e.dragAndDropService,this.ctrlsService=e.ctrlsService}postConstruct(){this.ctrlsService.whenReady((e=>{this.gridBodyCon=e.gridBodyCtrl}))}getIconName(){return this.pinned?"pinned":"move"}onDragEnter(e){const t=e.dragItem.columns;if(0===e.dragSource.type)this.setColumnsVisible(t,!0,"uiColumnDragged");else{const a=e.dragItem.visibleState,n=(t||[]).filter((e=>a[e.getId()]));this.setColumnsVisible(n,!0,"uiColumnDragged")}this.setColumnsPinned(t,this.pinned,"uiColumnDragged"),this.onDragging(e,!0,!0)}onDragLeave(){this.ensureIntervalCleared(),this.lastMovedInfo=null}setColumnsVisible(e,t,a){if(e){const n=e.filter((e=>!e.getColDef().lockVisible));this.columnModel.setColsVisible(n,t,a)}}setColumnsPinned(e,t,a){if(e){const n=e.filter((e=>!e.getColDef().lockPinned));this.columnModel.setColsPinned(n,t,a)}}onDragStop(){this.onDragging(this.lastDraggingEvent,!1,!0,!0),this.ensureIntervalCleared(),this.lastMovedInfo=null}checkCenterForScrolling(e){if(this.isCenterContainer){const t=this.ctrlsService.get("center"),a=t.getCenterViewportScrollLeft(),n=a+t.getCenterWidth();this.gos.get("enableRtl")?(this.needToMoveRight=e<a+50,this.needToMoveLeft=e>n-50):(this.needToMoveLeft=e<a+50,this.needToMoveRight=e>n-50),this.needToMoveLeft||this.needToMoveRight?this.ensureIntervalStarted():this.ensureIntervalCleared()}}onDragging(e=this.lastDraggingEvent,t=!1,a=!1,n=!1){if(n){if(this.lastMovedInfo){const{columns:e,toIndex:t}=this.lastMovedInfo;qr(e,t,"uiColumnMoved",!0,this.columnMoveService)}return}if(this.lastDraggingEvent=e,O(e.hDirection))return;const o=Hr(e.x,this.pinned,!1,this.gos,this.c';
      S = S + 'trlsService);t||this.checkCenterForScrolling(o);const r=this.normaliseDirection(e.hDirection),i=e.dragSource.type,s=Gr({allMovingColumns:e.dragSource.getDragItem().columns?.filter((e=>!e.getColDef().lockPinned||e.getPinned()==this.pinned))||[],isFromHeader:1===i,hDirection:r,xPosition:o,pinned:this.pinned,fromEnter:t,fakeEvent:a,gos:this.gos,columnModel:this.columnModel,columnMoveService:this.columnMoveService,presentedColsService:this.visibleColsService});s&&(this.lastMovedInfo=s)}normaliseDirection(e){if(!this.gos.get("enableRtl"))return e;switch(e){case 0:return 1;case 1:return 0;default:ge(`Unknown direction ${e}`)}}ensureIntervalStarted(){this.movingIntervalId||(this.intervalCount=0,this.failedMoveAttempts=0,this.movingIntervalId=window.setInterval(this.moveInterval.bind(this),100),this.dragAndDropService.setGhostIcon(this.needToMoveLeft?"left":"right",!0))}ensureIntervalCleared(){this.movingIntervalId&&(window.clearInterval(this.movingIntervalId),this.movingIntervalId=null,this.dragAndDropService.setGhostIcon("move"))}moveInterval(){let e;this.intervalCount++,e=10+5*this.intervalCount,e>100&&(e=100);let t=null;const a=this.gridBodyCon.getScrollFeature();if(this.needToMoveLeft?t=a.scrollHorizontally(-e):this.needToMoveRight&&(t=a.scrollHorizontally(e)),0!==t)this.onDragging(this.lastDraggingEvent),this.failedMoveAttempts=0;else{this.failedMoveAttempts++;const e=this.lastDraggingEvent.dragItem.columns.filter((e=>!e.getColDef().lockPinned));if(e.length>0&&(this.dragAndDropService.setGhostIcon("pinned"),this.failedMoveAttempts>7)){const t=this.needToMoveLeft?"left":"right";this.setColumnsPinned(e,t,"uiColumnDragged"),this.dragAndDropService.nudge()}}}},Wr=class extends A{wireBeans(e){this.dragAndDropService=e.dragAndDropService,this.columnModel=e.columnModel,this.ctrlsService=e.ctrlsService}constructor(e,t){super(),this.pinned=e,this.eContainer=t}postConstruct(){this.ctrlsService.whenReady((e=>{switch(this.pinned){case"left":this.eSecondaryContainers=[[e.gridBodyC';
      S = S + 'trl.getBodyViewportElement(),e.left.getContainerElement()],[e.bottomLeft.getContainerElement()],[e.topLeft.getContainerElement()]];break;case"right":this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.right.getContainerElement()],[e.bottomRight.getContainerElement()],[e.topRight.getContainerElement()]];break;default:this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.center.getViewportElement()],[e.bottomCenter.getViewportElement()],[e.topCenter.getViewportElement()]]}})),this.moveColumnFeature=this.createManagedBean(new Vr(this.pinned)),this.bodyDropPivotTarget=this.createManagedBean(new Nr(this.pinned)),this.dragAndDropService.addDropTarget(this)}isInterestedIn(e){return 1===e||0===e&&this.gos.get("allowDragFromColumnsToolPanel")}getSecondaryContainers(){return this.eSecondaryContainers}getContainer(){return this.eContainer}getIconName(){return this.currentDropListener.getIconName()}isDropColumnInPivotMode(e){return this.columnModel.isPivotMode()&&0===e.dragSource.type}onDragEnter(e){this.currentDropListener=this.isDropColumnInPivotMode(e)?this.bodyDropPivotTarget:this.moveColumnFeature,this.currentDropListener.onDragEnter(e)}onDragLeave(e){this.currentDropListener.onDragLeave(e)}onDragging(e){this.currentDropListener.onDragging(e)}onDragStop(e){this.currentDropListener.onDragStop(e)}},Ur=class extends A{wireBeans(e){this.horizontalResizeService=e.horizontalResizeService,this.pinnedWidthService=e.pinnedWidthService,this.ctrlsService=e.ctrlsService,this.columnSizeService=e.columnSizeService,this.columnAutosizeService=e.columnAutosizeService}constructor(e,t,a,n,o){super(),this.pinned=e,this.column=t,this.eResize=a,this.comp=n,this.ctrl=o}postConstruct(){const e=[];let t,a;const n=()=>{if(ra(this.eResize,t),!t)return;const n=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(e.push(n),a';
      S = S + '){const t=this.gos.get("skipHeaderOnAutoSize"),a=()=>{this.columnAutosizeService.autoSizeColumn(this.column,"uiColumnResized",t)};this.eResize.addEventListener("dblclick",a);const n=new ja(this.eResize);n.addEventListener("doubleTap",a),e.push((()=>{this.eResize.removeEventListener("dblclick",a),n.removeEventListener("doubleTap",a),n.destroy()}))}},o=()=>{e.forEach((e=>e())),e.length=0},r=()=>{const e=this.column.isResizable(),r=!this.gos.get("suppressAutoSize")&&!this.column.getColDef().suppressAutoSize;(e!==t||r!==a)&&(t=e,a=r,o(),n())};r(),this.addDestroyFunc(o),this.ctrl.addRefreshFunction(r)}onResizing(e,t){const{column:a,lastResizeAmount:n,resizeStartWidth:o}=this,r=this.normaliseResizeAmount(t),i=[{key:a,newWidth:o+r}];if(this.column.getPinned()){if(this.pinnedWidthService.getPinnedLeftWidth()+this.pinnedWidthService.getPinnedRightWidth()+(r-n)>da(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement())-50)return}this.lastResizeAmount=r,this.columnSizeService.setColumnWidths(i,this.resizeWithShiftKey,e,"uiColumnResized"),e&&this.toggleColumnResizing(!1)}onResizeStart(e){this.resizeStartWidth=this.column.getActualWidth(),this.lastResizeAmount=0,this.resizeWithShiftKey=e,this.toggleColumnResizing(!0)}toggleColumnResizing(e){this.comp.addOrRemoveCssClass("ag-column-resizing",e)}normaliseResizeAmount(e){let t=e;const a="left"!==this.pinned,n="right"===this.pinned;return this.gos.get("enableRtl")?a&&(t*=-1):n&&(t*=-1),t}},jr=class extends A{constructor(e){super(),this.cbSelectAllVisible=!1,this.processingEventFromCheckbox=!1,this.column=e}wireBeans(e){this.rowModel=e.rowModel,this.selectionService=e.selectionService}onSpaceKeyDown(e){const t=this.cbSelectAll;t.isDisplayed()&&!t.getGui().contains(this.gos.getActiveDomElement())&&(e.preventDefault(),t.setValue(!t.getValue()))}getCheckboxGui(){return this.cbSelectAll.getGui()}setComp(e){this.headerCellCtrl=e,this.cbSelectAll=this.createManagedBean(new rn),this.cbSelectAll.addCssClass("ag-header-select-all"),yt(t';
      S = S + 'his.cbSelectAll.getGui(),"presentation"),this.showOrHideSelectAll(),this.addManagedEventListeners({newColumnsLoaded:this.onNewColumnsLoaded.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),selectionChanged:this.onSelectionChanged.bind(this),paginationChanged:this.onSelectionChanged.bind(this),modelUpdated:this.onModelChanged.bind(this)}),this.addManagedListeners(this.cbSelectAll,{fieldValueChanged:this.onCbSelectAll.bind(this)}),Dt(this.cbSelectAll.getGui(),!0),this.cbSelectAll.getInputElement().setAttribute("tabindex","-1"),this.refreshSelectAllLabel()}onNewColumnsLoaded(){this.showOrHideSelectAll()}onDisplayedColumnsChanged(){this.isAlive()&&this.showOrHideSelectAll()}showOrHideSelectAll(){this.cbSelectAllVisible=this.isCheckboxSelection(),this.cbSelectAll.setDisplayed(this.cbSelectAllVisible,{skipAriaHidden:!0}),this.cbSelectAllVisible&&(this.checkRightRowModelType("selectAllCheckbox"),this.checkSelectionType("selectAllCheckbox"),this.updateStateOfCheckbox()),this.refreshSelectAllLabel()}onModelChanged(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()}onSelectionChanged(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()}updateStateOfCheckbox(){if(this.processingEventFromCheckbox)return;this.processingEventFromCheckbox=!0;const e=this.selectionService.getSelectAllState(this.isFilteredOnly(),this.isCurrentPageOnly());this.cbSelectAll.setValue(e);const t=this.selectionService.hasNodesToSelect(this.isFilteredOnly(),this.isCurrentPageOnly());this.cbSelectAll.setDisabled(!t),this.refreshSelectAllLabel(),this.processingEventFromCheckbox=!1}refreshSelectAllLabel(){const e=this.localeService.getLocaleTextFunc(),t=this.cbSelectAll.getValue()?e("ariaChecked","checked"):e("ariaUnchecked","unchecked"),a=e("ariaRowSelectAll","Press Space to toggle all rows selection");this.cbSelectAllVisible?this.headerCellCtrl.setAriaDescriptionProperty("selectAll",`${a} (${t})`):this.headerCellCtrl.setAriaDescriptionProperty("selectAll",null),this.cbSel';
      S = S + 'ectAll.setInputAriaLabel(`${a} (${t})`),this.headerCellCtrl.announceAriaDescription()}checkSelectionType(e){return!("multiple"!==this.gos.get("rowSelection"))||(ce(`${e} is only available if using \'multiple\' rowSelection.`),!1)}checkRightRowModelType(e){const t=this.rowModel.getType();return!("clientSide"!==t&&"serverSide"!==t)||(ce(`${e} is only available if using \'clientSide\' or \'serverSide\' rowModelType, you are using ${t}.`),!1)}onCbSelectAll(){if(this.processingEventFromCheckbox)return;if(!this.cbSelectAllVisible)return;const e=this.cbSelectAll.getValue(),t=this.isFilteredOnly(),a=this.isCurrentPageOnly();let n="uiSelectAll";a?n="uiSelectAllCurrentPage":t&&(n="uiSelectAllFiltered");const o={source:n,justFiltered:t,justCurrentPage:a};e?this.selectionService.selectAllRowNodes(o):this.selectionService.deselectAllRowNodes(o)}isCheckboxSelection(){let e=this.column.getColDef().headerCheckboxSelection;if("function"==typeof e){e=e(this.gos.addGridCommonParams({column:this.column,colDef:this.column.getColDef()}))}return!!e&&(this.checkRightRowModelType("headerCheckboxSelection")&&this.checkSelectionType("headerCheckboxSelection"))}isFilteredOnly(){return!!this.column.getColDef().headerCheckboxSelectionFilteredOnly}isCurrentPageOnly(){return!!this.column.getColDef().headerCheckboxSelectionCurrentPageOnly}},Kr=class extends sr{constructor(e,t,a){super(e,t,a),this.refreshFunctions=[],this.userHeaderClasses=new Set,this.ariaDescriptionProperties=new Map,this.column=e}setComp(e,t,a,n){this.comp=e,this.setGui(t),this.updateState(),this.setupWidth(),this.setupMovingCss(),this.setupMenuClass(),this.setupSortableClass(),this.setupWrapTextClass(),this.refreshSpanHeaderHeight(),this.setupAutoHeight(n),this.addColumnHoverListener(),this.setupFilterClass(),this.setupClassesFromColDef(),this.setupTooltip(),this.addActiveHeaderMouseListeners(),this.setupSelectAll(),this.setupUserComp(),this.refreshAria(),this.resizeFeature=this.createManagedBean(new Ur(this.getPinned(),this.column,a,';
      S = S + 'e,this)),this.createManagedBean(new lr([this.column],t)),this.createManagedBean(new er(this.column,t,this.beans)),this.createManagedBean(new ho(t,{shouldStopEventPropagation:e=>this.shouldStopEventPropagation(e),onTabKeyDown:()=>null,handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addResizeAndMoveKeyboardListeners(),this.addManagedPropertyListeners(["suppressMovableColumns","suppressMenuHide","suppressAggFuncInHeader"],this.refresh.bind(this)),this.addManagedListeners(this.column,{colDefChanged:this.refresh.bind(this)}),this.addManagedEventListeners({columnValueChanged:this.onColumnValueChanged.bind(this),columnRowGroupChanged:this.onColumnRowGroupChanged.bind(this),columnPivotChanged:this.onColumnPivotChanged.bind(this),headerHeightChanged:this.onHeaderHeightChanged.bind(this)})}resizeHeader(e,t){if(!this.column.isResizable())return;const a=this.column.getActualWidth(),n=this.column.getMinWidth(),o=this.column.getMaxWidth(),r=Math.min(Math.max(a+e,n),o);this.beans.columnSizeService.setColumnWidths([{key:this.column,newWidth:r}],t,!0,"uiColumnResized")}moveHeader(e){const{eGui:t,column:a,gos:n,ctrlsService:o}=this,r=this.getPinned(),i=t.getBoundingClientRect().left,s=a.getActualWidth();Gr({allMovingColumns:[a],isFromHeader:!0,hDirection:e,xPosition:Hr(0===e!==n.get("enableRtl")?i-20:i+s+20,r,!0,n,o),pinned:r,fromEnter:!1,fakeEvent:!1,gos:n,columnModel:this.beans.columnModel,columnMoveService:this.beans.columnMoveService,presentedColsService:this.beans.visibleColsService}),o.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(a,"auto")}setupUserComp(){const e=this.lookupUserCompDetails();this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setUserCompDetails(e)}lookupUserCompDetails(){const e=this.createParams(),t=this.column.getColDef();return this.userComponentFactory.getHeaderCompDetails(t,e)}createParams(){return this.gos.addGridCommonParams({column:this.column';
      S = S + ',displayName:this.displayName,enableSorting:this.column.isSortable(),enableMenu:this.menuEnabled,enableFilterButton:this.openFilterEnabled&&this.menuService.isHeaderFilterButtonEnabled(this.column),enableFilterIcon:!this.openFilterEnabled||this.menuService.isLegacyMenuEnabled(),showColumnMenu:e=>{this.menuService.showColumnMenu({column:this.column,buttonElement:e,positionBy:"button"})},showColumnMenuAfterMouseClick:e=>{this.menuService.showColumnMenu({column:this.column,mouseEvent:e,positionBy:"mouse"})},showFilter:e=>{this.menuService.showFilterMenu({column:this.column,buttonElement:e,containerType:"columnFilter",positionBy:"button"})},progressSort:e=>{this.beans.sortController.progressSort(this.column,!!e,"uiColumnSorted")},setSort:(e,t)=>{this.beans.sortController.setSortForColumn(this.column,e,!!t,"uiColumnSorted")},eGridHeader:this.getGui(),setTooltip:(e,t)=>{this.setupTooltip(e,t)}})}setupSelectAll(){this.selectAllFeature=this.createManagedBean(new jr(this.column)),this.selectAllFeature.setComp(this)}getSelectAllGui(){return this.selectAllFeature.getCheckboxGui()}handleKeyDown(e){super.handleKeyDown(e),e.key===tn.SPACE&&this.selectAllFeature.onSpaceKeyDown(e),e.key===tn.ENTER&&this.onEnterKeyDown(e),e.key===tn.DOWN&&e.altKey&&this.showMenuOnKeyPress(e,!1)}onEnterKeyDown(e){if(e.ctrlKey||e.metaKey)this.showMenuOnKeyPress(e,!0);else if(this.sortable){const t=e.shiftKey;this.beans.sortController.progressSort(this.column,t,"uiColumnSorted")}}showMenuOnKeyPress(e,t){const a=this.comp.getUserCompInstance();a&&a instanceof Ya&&a.onMenuKeyboardShortcut(t)&&e.preventDefault()}onFocusIn(e){if(!this.getGui().contains(e.relatedTarget)){const e=this.getRowIndex();this.focusService.setFocusedHeader(e,this.column),this.announceAriaDescription()}this.focusService.isKeyboardMode()&&this.setActiveHeader(!0)}onFocusOut(e){this.getGui().contains(e.relatedTarget)||this.setActiveHeader(!1)}setupTooltip(e,t){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeat';
      S = S + 'ure));const a="whenTruncated"===this.gos.get("tooltipShowMode"),n=this.eGui,o=this.column.getColDef();t||!a||o.headerComponent||(t=()=>{const e=n.querySelector(".ag-header-cell-text");return!e||e.scrollWidth>e.clientWidth});const r={getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getGui:()=>n,getLocation:()=>"header",getTooltipValue:()=>{if(null!=e)return e;return this.column.getColDef().headerTooltip},shouldDisplayTooltip:t},i=this.createManagedBean(new Na(r));this.refreshFunctions.push((()=>i.refreshToolTip()))}setupClassesFromColDef(){const e=()=>{const e=tr(this.column.getColDef(),this.gos,this.column,null),t=this.userHeaderClasses;this.userHeaderClasses=new Set(e),e.forEach((e=>{t.has(e)?t.delete(e):this.comp.addOrRemoveCssClass(e,!0)})),t.forEach((e=>this.comp.addOrRemoveCssClass(e,!1)))};this.refreshFunctions.push(e),e()}setDragSource(e){if(this.dragSourceElement=e,this.removeDragSource(),!e||!this.draggable)return;const{column:t,beans:a,displayName:n,dragAndDropService:o,gos:r}=this,{columnModel:i}=a;let s=!this.gos.get("suppressDragLeaveHidesColumns");const l=this.dragSource={type:1,eElement:e,getDefaultIconName:()=>s?"hide":"notAllowed",getDragItem:()=>this.createDragItem(t),dragItemName:n,onDragStarted:()=>{s=!r.get("suppressDragLeaveHidesColumns"),t.setMoving(!0,"uiColumnMoved")},onDragStopped:()=>t.setMoving(!1,"uiColumnMoved"),onGridEnter:e=>{if(s){const t=e?.columns?.filter((e=>!e.getColDef().lockVisible))||[];i.setColsVisible(t,!0,"uiColumnMoved")}},onGridExit:e=>{if(s){const t=e?.columns?.filter((e=>!e.getColDef().lockVisible))||[];i.setColsVisible(t,!1,"uiColumnMoved")}}};o.addDragSource(l,!0)}createDragItem(e){const t={};return t[e.getId()]=e.isVisible(),{columns:[e],visibleState:t}}updateState(){this.menuEnabled=this.menuService.isColumnMenuInHeaderEnabled(this.column),this.openFilterEnabled=this.menuService.isFilterMenuInHeaderEnabled(this.column),this.sortable=this.column.isSortable(),this.displayName=this.calculateDisplayName()';
      S = S + ',this.draggable=this.workOutDraggable()}addRefreshFunction(e){this.refreshFunctions.push(e)}refresh(){this.updateState(),this.refreshHeaderComp(),this.refreshAria(),this.refreshFunctions.forEach((e=>e()))}refreshHeaderComp(){const e=this.lookupUserCompDetails();!!(null!=this.comp.getUserCompInstance()&&this.userCompDetails.componentClass==e.componentClass)&&this.attemptHeaderCompRefresh(e.params)?this.setDragSource(this.dragSourceElement):this.setCompDetails(e)}attemptHeaderCompRefresh(e){const t=this.comp.getUserCompInstance();if(!t)return!1;if(!t.refresh)return!1;return t.refresh(e)}calculateDisplayName(){return this.beans.columnNameService.getDisplayNameForColumn(this.column,"header",!0)}checkDisplayName(){this.displayName!==this.calculateDisplayName()&&this.refresh()}workOutDraggable(){const e=this.column.getColDef();return!!(!this.gos.get("suppressMovableColumns")&&!e.suppressMovable&&!e.lockPosition)||!!e.enableRowGroup||!!e.enablePivot}onColumnRowGroupChanged(){this.checkDisplayName()}onColumnPivotChanged(){this.checkDisplayName()}onColumnValueChanged(){this.checkDisplayName()}setupWidth(){const e=()=>{const e=this.column.getActualWidth();this.comp.setWidth(`${e}px`)};this.addManagedListeners(this.column,{widthChanged:e}),e()}setupMovingCss(){const e=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving())};this.addManagedListeners(this.column,{movingChanged:e}),e()}setupMenuClass(){const e=()=>{this.comp.addOrRemoveCssClass("ag-column-menu-visible",this.column.isMenuVisible())};this.addManagedListeners(this.column,{menuVisibleChanged:e}),e()}setupSortableClass(){const e=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-sortable",!!this.sortable)};e(),this.addRefreshFunction(e),this.addManagedEventListeners({sortChanged:this.refreshAriaSort.bind(this)})}setupFilterClass(){const e=()=>{const e=this.column.isFilterActive();this.comp.addOrRemoveCssClass("ag-header-cell-filtered",e),this.refreshAria()};this.addManagedListeners(this.colu';
      S = S + 'mn,{filterActiveChanged:e}),e()}setupWrapTextClass(){const e=()=>{const e=!!this.column.getColDef().wrapHeaderText;this.comp.addOrRemoveCssClass("ag-header-cell-wrap-text",e)};e(),this.addRefreshFunction(e)}onDisplayedColumnsChanged(){super.onDisplayedColumnsChanged(),this.isAlive()&&this.onHeaderHeightChanged()}onHeaderHeightChanged(){this.refreshSpanHeaderHeight()}refreshSpanHeaderHeight(){const{eGui:e,column:t,comp:a,beans:n}=this;if(!t.isSpanHeaderHeight())return e.style.removeProperty("top"),e.style.removeProperty("height"),a.addOrRemoveCssClass("ag-header-span-height",!1),void a.addOrRemoveCssClass("ag-header-span-total",!1);const{numberOfParents:o,isSpanningTotal:r}=this.column.getColumnGroupPaddingInfo();a.addOrRemoveCssClass("ag-header-span-height",o>0);const{columnModel:i}=n,s=i.getColumnHeaderRowHeight();if(0===o)return a.addOrRemoveCssClass("ag-header-span-total",!1),e.style.setProperty("top","0px"),void e.style.setProperty("height",`${s}px`);a.addOrRemoveCssClass("ag-header-span-total",r);const l=o*(i.isPivotMode()?i.getPivotGroupHeaderHeight():i.getGroupHeaderHeight());e.style.setProperty("top",-l+"px"),e.style.setProperty("height",`${s+l}px`)}setupAutoHeight(e){const{columnModel:t,resizeObserverService:a}=this.beans,n=a=>{if(!this.isAlive())return;const{paddingTop:o,paddingBottom:r,borderBottomWidth:i,borderTopWidth:s}=ca(this.getGui()),l=o+r+i+s,c=e.offsetHeight+l;if(a<5){const t=this.beans.gos.getDocument();if(!t||!t.contains(e)||0==c)return void window.setTimeout((()=>n(a+1)),0)}t.setColHeaderHeight(this.column,c)};let o,r=!1;const i=()=>{const e=this.column.isAutoHeaderHeight();e&&!r&&s(),!e&&r&&l()},s=()=>{r=!0,n(0),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!0),o=a.observeResize(e,(()=>n(0)))},l=()=>{r=!1,o&&o(),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!1),o=void 0};i(),this.addDestroyFunc((()=>l())),this.addManagedListeners(this.column,{widthChanged:()=>r&&n(0)}),this.addManagedEventListeners({sortChanged:()=>{';
      S = S + 'r&&window.setTimeout((()=>n(0)))}}),this.addRefreshFunction(i)}refreshAriaSort(){if(this.sortable){const e=this.localeService.getLocaleTextFunc(),t=this.beans.sortController.getDisplaySortForColumn(this.column)||null;this.comp.setAriaSort(function(e){let t;return t="asc"===e?"ascending":"desc"===e?"descending":"mixed"===e?"other":"none",t}(t)),this.setAriaDescriptionProperty("sort",e("ariaSortableColumn","Press ENTER to sort"))}else this.comp.setAriaSort(),this.setAriaDescriptionProperty("sort",null)}refreshAriaMenu(){if(this.menuEnabled){const e=this.localeService.getLocaleTextFunc();this.setAriaDescriptionProperty("menu",e("ariaMenuColumn","Press ALT DOWN to open column menu"))}else this.setAriaDescriptionProperty("menu",null)}refreshAriaFilterButton(){if(this.openFilterEnabled&&!this.menuService.isLegacyMenuEnabled()){const e=this.localeService.getLocaleTextFunc();this.setAriaDescriptionProperty("filterButton",e("ariaFilterColumn","Press CTRL ENTER to open filter"))}else this.setAriaDescriptionProperty("filterButton",null)}refreshAriaFiltered(){const e=this.localeService.getLocaleTextFunc();this.column.isFilterActive()?this.setAriaDescriptionProperty("filter",e("ariaColumnFiltered","Column Filtered")):this.setAriaDescriptionProperty("filter",null)}setAriaDescriptionProperty(e,t){null!=t?this.ariaDescriptionProperties.set(e,t):this.ariaDescriptionProperties.delete(e)}announceAriaDescription(){if(!this.eGui.contains(this.beans.gos.getActiveDomElement()))return;const e=Array.from(this.ariaDescriptionProperties.keys()).sort(((e,t)=>"filter"===e?-1:t.charCodeAt(0)-e.charCodeAt(0))).map((e=>this.ariaDescriptionProperties.get(e))).join(". ");this.beans.ariaAnnouncementService.announceValue(e)}refreshAria(){this.refreshAriaSort(),this.refreshAriaMenu(),this.refreshAriaFilterButton(),this.refreshAriaFiltered()}addColumnHoverListener(){const e=()=>{if(!this.gos.get("columnHoverHighlight"))return;const e=this.beans.columnHoverService.isHovered(this.column);this.comp.addOrRe';
      S = S + 'moveCssClass("ag-column-hover",e)};this.addManagedEventListeners({columnHoverChanged:e}),e()}getColId(){return this.column.getColId()}addActiveHeaderMouseListeners(){const e=e=>this.handleMouseOverChange("mouseenter"===e.type);this.addManagedListeners(this.getGui(),{mouseenter:e,mouseleave:e,click:()=>this.dispatchColumnMouseEvent("columnHeaderClicked",this.column),contextmenu:e=>this.handleContextMenuMouseEvent(e,void 0,this.column)})}handleMouseOverChange(e){this.setActiveHeader(e);const t={type:e?"columnHeaderMouseOver":"columnHeaderMouseLeave",column:this.column};this.eventService.dispatchEvent(t)}setActiveHeader(e){this.comp.addOrRemoveCssClass("ag-header-active",e)}getAnchorElementForMenu(e){const t=this.comp.getUserCompInstance();return t instanceof Ya?t.getAnchorElementForMenu(e):this.getGui()}destroy(){super.destroy(),this.refreshFunctions=null,this.selectAllFeature=null,this.dragSourceElement=null,this.userCompDetails=null,this.userHeaderClasses=null,this.ariaDescriptionProperties=null}},Qr=class extends A{wireBeans(e){this.horizontalResizeService=e.horizontalResizeService,this.autoWidthCalculator=e.autoWidthCalculator,this.visibleColsService=e.visibleColsService,this.columnSizeService=e.columnSizeService,this.columnAutosizeService=e.columnAutosizeService}constructor(e,t,a,n){super(),this.eResize=t,this.comp=e,this.pinned=a,this.columnGroup=n}postConstruct(){if(!this.columnGroup.isResizable())return void this.comp.setResizableDisplayed(!1);const e=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(this.addDestroyFunc(e),!this.gos.get("suppressAutoSize")){const e=this.gos.get("skipHeaderOnAutoSize");this.eResize.addEventListener("dblclick",(()=>{const t=[];this.columnGroup.getDisplayedLeafColumns().forEach((e=>{e.getColDef().suppressAutoSize||t.push(e.getColId())})),t.length>0&&this.columnAutosizeService.autoSiz';
      S = S + 'eCols({colKeys:t,skipHeader:e,stopAtGroup:this.columnGroup,source:"uiColumnResized"}),this.resizeLeafColumnsToFit("uiColumnResized")}))}}onResizeStart(e){const t=this.getInitialValues(e);this.storeLocalValues(t),this.toggleColumnResizing(!0)}onResizing(e,t,a="uiColumnResized"){const n=this.normaliseDragChange(t),o=this.resizeStartWidth+n;this.resizeColumnsFromLocalValues(o,a,e)}getInitialValues(e){const t=this.getColumnsToResize(),a=this.getInitialSizeOfColumns(t),n={columnsToResize:t,resizeStartWidth:a,resizeRatios:this.getSizeRatiosOfColumns(t,a)};let o=null;if(e&&(o=this.visibleColsService.getGroupAtDirection(this.columnGroup,"After")),o){const e=o.getDisplayedLeafColumns(),t=n.groupAfterColumns=e.filter((e=>e.isResizable())),a=n.groupAfterStartWidth=this.getInitialSizeOfColumns(t);n.groupAfterRatios=this.getSizeRatiosOfColumns(t,a)}else n.groupAfterColumns=void 0,n.groupAfterStartWidth=void 0,n.groupAfterRatios=void 0;return n}storeLocalValues(e){const{columnsToResize:t,resizeStartWidth:a,resizeRatios:n,groupAfterColumns:o,groupAfterStartWidth:r,groupAfterRatios:i}=e;this.resizeCols=t,this.resizeStartWidth=a,this.resizeRatios=n,this.resizeTakeFromCols=o,this.resizeTakeFromStartWidth=r,this.resizeTakeFromRatios=i}clearLocalValues(){this.resizeCols=void 0,this.resizeRatios=void 0,this.resizeTakeFromCols=void 0,this.resizeTakeFromRatios=void 0}resizeLeafColumnsToFit(e){const t=this.autoWidthCalculator.getPreferredWidthForColumnGroup(this.columnGroup),a=this.getInitialValues();t>a.resizeStartWidth&&this.resizeColumns(a,t,e,!0)}resizeColumnsFromLocalValues(e,t,a=!0){if(!this.resizeCols||!this.resizeRatios)return;const n={columnsToResize:this.resizeCols,resizeStartWidth:this.resizeStartWidth,resizeRatios:this.resizeRatios,groupAfterColumns:this.resizeTakeFromCols??void 0,groupAfterStartWidth:this.resizeTakeFromStartWidth??void 0,groupAfterRatios:this.resizeTakeFromRatios??void 0};this.resizeColumns(n,e,t,a)}resizeColumns(e,t,a,n=!0){const{columnsToResize:o,resizeStart';
      S = S + 'Width:r,resizeRatios:i,groupAfterColumns:s,groupAfterStartWidth:l,groupAfterRatios:c}=e,g=[];if(g.push({columns:o,ratios:i,width:t}),s){const e=t-r;g.push({columns:s,ratios:c,width:l-e})}this.columnSizeService.resizeColumnSets({resizeSets:g,finished:n,source:a}),n&&this.toggleColumnResizing(!1)}toggleColumnResizing(e){this.comp.addOrRemoveCssClass("ag-column-resizing",e)}getColumnsToResize(){return this.columnGroup.getDisplayedLeafColumns().filter((e=>e.isResizable()))}getInitialSizeOfColumns(e){return e.reduce(((e,t)=>e+t.getActualWidth()),0)}getSizeRatiosOfColumns(e,t){return e.map((e=>e.getActualWidth()/t))}normaliseDragChange(e){let t=e;return this.gos.get("enableRtl")?"left"!==this.pinned&&(t*=-1):"right"===this.pinned&&(t*=-1),t}destroy(){super.destroy(),this.clearLocalValues()}},Yr=class extends A{constructor(e,t){super(),this.removeChildListenersFuncs=[],this.columnGroup=t,this.comp=e}postConstruct(){this.addListenersToChildrenColumns(),this.addManagedListeners(this.columnGroup,{displayedChildrenChanged:this.onDisplayedChildrenChanged.bind(this)}),this.onWidthChanged(),this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this))}addListenersToChildrenColumns(){this.removeListenersOnChildrenColumns();const e=this.onWidthChanged.bind(this);this.columnGroup.getLeafColumns().forEach((t=>{t.addEventListener("widthChanged",e),t.addEventListener("visibleChanged",e),this.removeChildListenersFuncs.push((()=>{t.removeEventListener("widthChanged",e),t.removeEventListener("visibleChanged",e)}))}))}removeListenersOnChildrenColumns(){this.removeChildListenersFuncs.forEach((e=>e())),this.removeChildListenersFuncs=[]}onDisplayedChildrenChanged(){this.addListenersToChildrenColumns(),this.onWidthChanged()}onWidthChanged(){const e=this.columnGroup.getActualWidth();this.comp.setWidth(`${e}px`),this.comp.addOrRemoveCssClass("ag-hidden",0===e)}},_r=class extends sr{constructor(e,t,a){super(e,t,a),this.onSuppressColMoveChange=()=>{if(!this.isAlive()||this.isSuppressMoving';
      S = S + '())this.removeDragSource();else if(!this.dragSource){const e=this.getGui();this.setDragSource(e)}},this.column=e}setComp(e,t,a){this.comp=e,this.setGui(t),this.displayName=this.beans.columnNameService.getDisplayNameForColumnGroup(this.column,"header"),this.addClasses(),this.setupMovingCss(),this.setupExpandable(),this.setupTooltip(),this.addDestroyFunc((()=>{this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature))})),this.setupUserComp(),this.addHeaderMouseListeners();const n=this.getParentRowCtrl().getPinned(),o=this.column.getProvidedColumnGroup().getLeafColumns();this.createManagedBean(new lr(o,t)),this.createManagedBean(new er(this.column,t,this.beans)),this.createManagedBean(new Yr(e,this.column)),this.resizeFeature=this.createManagedBean(new Qr(e,a,n,this.column)),this.createManagedBean(new ho(t,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:()=>{},handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)})),this.addManagedPropertyListener("suppressMovableColumns",this.onSuppressColMoveChange),this.addResizeAndMoveKeyboardListeners()}resizeHeader(e,t){if(!this.resizeFeature)return;const a=this.resizeFeature.getInitialValues(t);this.resizeFeature.resizeColumns(a,a.resizeStartWidth+e,"uiColumnResized",!0)}moveHeader(e){const{beans:t,eGui:a,column:n,gos:o,ctrlsService:r}=this,i=o.get("enableRtl"),s=0===e,l=this.getPinned(),c=a.getBoundingClientRect(),g=c.left,h=c.width,u=Hr(s!==i?g-20:g+h+20,l,!0,o,r),p=n.getGroupId(),m=this.focusService.getFocusedHeader();Gr({allMovingColumns:this.column.getLeafColumns(),isFromHeader:!0,hDirection:e,xPosition:u,pinned:l,fromEnter:!1,fakeEvent:!1,gos:o,columnModel:t.columnModel,columnMoveService:t.columnMoveService,presentedColsService:t.visibleColsService});const f=n.getDisplayedLeafColumns(),v=s?f[0]:d(f);this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(v,"auto"),!this.isAlive()&&m&&this.restoreFocus(p,n,m)}restoreFocus(';
      S = S + 'e,t,a){const n=t.getLeafColumns();if(!n.length)return;const o=n[0].getParent();if(!o)return;const r=this.findGroupWidthId(o,e);r&&this.focusService.focusHeaderPosition({headerPosition:{...a,column:r}})}findGroupWidthId(e,t){for(;e;){if(e.getGroupId()===t)return e;e=e.getParent()}return null}resizeLeafColumnsToFit(e){this.resizeFeature&&this.resizeFeature.resizeLeafColumnsToFit(e)}setupUserComp(){const e=this.gos.addGridCommonParams({displayName:this.displayName,columnGroup:this.column,setExpanded:e=>{this.beans.columnModel.setColumnGroupOpened(this.column.getProvidedColumnGroup(),e,"gridInitializing")},setTooltip:(e,t)=>{this.setupTooltip(e,t)}}),t=this.userComponentFactory.getHeaderGroupCompDetails(e);this.comp.setUserCompDetails(t)}addHeaderMouseListeners(){const e=e=>this.handleMouseOverChange("mouseenter"===e.type);this.addManagedListeners(this.getGui(),{mouseenter:e,mouseleave:e,click:()=>this.dispatchColumnMouseEvent("columnHeaderClicked",this.column.getProvidedColumnGroup()),contextmenu:e=>this.handleContextMenuMouseEvent(e,void 0,this.column.getProvidedColumnGroup())})}handleMouseOverChange(e){const t={type:e?"columnHeaderMouseOver":"columnHeaderMouseLeave",column:this.column.getProvidedColumnGroup()};this.eventService.dispatchEvent(t)}setupTooltip(e,t){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const a=this.column.getColGroupDef(),n="whenTruncated"===this.gos.get("tooltipShowMode"),o=this.eGui;t||!n||a?.headerGroupComponent||(t=()=>{const e=o.querySelector(".ag-header-group-text");return!e||e.scrollWidth>e.clientWidth});const r={getColumn:()=>this.column,getGui:()=>o,getLocation:()=>"headerGroup",getTooltipValue:()=>e??(a&&a.headerTooltip),shouldDisplayTooltip:t};a&&(r.getColDef=()=>a),this.createManagedBean(new Na(r))}setupExpandable(){const e=this.column.getProvidedColumnGroup();this.refreshExpanded();const t=this.refreshExpanded.bind(this);this.addManagedListeners(e,{expandedChanged:t,expandableChanged:t})}refreshExp';
      S = S + 'anded(){const{column:e}=this;this.expandable=e.isExpandable();const t=e.isExpanded();this.expandable?this.comp.setAriaExpanded(t?"true":"false"):this.comp.setAriaExpanded(void 0)}getColId(){return this.column.getUniqueId()}addClasses(){const e=tr(this.column.getColGroupDef(),this.gos,null,this.column);if(this.column.isPadding()){e.push("ag-header-group-cell-no-group");this.column.getLeafColumns().every((e=>e.isSpanHeaderHeight()))&&e.push("ag-header-span-height")}else e.push("ag-header-group-cell-with-group");e.forEach((e=>this.comp.addOrRemoveCssClass(e,!0)))}setupMovingCss(){const e=this.column.getProvidedColumnGroup().getLeafColumns(),t=()=>this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving());e.forEach((e=>{this.addManagedListeners(e,{movingChanged:t})})),t()}onFocusIn(e){if(!this.eGui.contains(e.relatedTarget)){const e=this.getRowIndex();this.beans.focusService.setFocusedHeader(e,this.column)}}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();if(this.expandable&&t&&e.key===tn.ENTER){const e=this.column,t=!e.isExpanded();this.beans.columnModel.setColumnGroupOpened(e.getProvidedColumnGroup(),t,"uiColumnExpanded")}}setDragSource(e){if(!this.isAlive()||this.isSuppressMoving())return;if(this.removeDragSource(),!e)return;const{beans:t,column:a,displayName:n,gos:o,dragAndDropService:r}=this,{columnModel:i}=t,s=a.getProvidedColumnGroup().getLeafColumns();let l=!o.get("suppressDragLeaveHidesColumns");const c=this.dragSource={type:1,eElement:e,getDefaultIconName:()=>l?"hide":"notAllowed",dragItemName:n,getDragItem:()=>this.getDragItemForGroup(a),onDragStarted:()=>{l=!o.get("suppressDragLeaveHidesColumns"),s.forEach((e=>e.setMoving(!0,"uiColumnDragged")))},onDragStopped:()=>s.forEach((e=>e.setMoving(!1,"uiColumnDragged"))),onGridEnter:e=>{if(l){const t=e?.columns?.filter((e=>!e.getColDef().lockVisible))||[];i.setColsVisible(t,!0,"uiColumnMoved")}},onGridExit:e=>{if(l){const t=e?.columns?.filter((e=>!e.getColDef().lockVisible';
      S = S + '))||[];i.setColsVisible(t,!1,"uiColumnMoved")}}};r.addDragSource(c,!0)}getDragItemForGroup(e){const t=e.getProvidedColumnGroup().getLeafColumns(),a={};t.forEach((e=>a[e.getId()]=e.isVisible()));const n=[];return this.beans.visibleColsService.getAllCols().forEach((e=>{t.indexOf(e)>=0&&(n.push(e),f(t,e))})),t.forEach((e=>n.push(e))),{columns:n,visibleState:a}}isSuppressMoving(){let e=!1;this.column.getLeafColumns().forEach((t=>{(t.getColDef().suppressMovable||t.getColDef().lockPosition)&&(e=!0)}));return e||this.gos.get("suppressMovableColumns")}},Jr=0,Zr=class extends A{constructor(e,t,a){super(),this.instanceId=Jr++,this.rowIndex=e,this.pinned=t,this.type=a;const n="group"==a?"ag-header-row-column-group":"filter"==a?"ag-header-row-column-filter":"ag-header-row-column";this.headerRowClass=`ag-header-row ${n}`}wireBeans(e){this.beans=e}postConstruct(){this.isPrintLayout=this.gos.isDomLayout("print"),this.isEnsureDomOrder=this.gos.get("ensureDomOrder")}getInstanceId(){return this.instanceId}areCellsRendered(){return!!this.comp&&this.getHeaderCellCtrls().every((e=>null!=e.getGui()))}setComp(e,t=!0){this.comp=e,t&&(this.onRowHeightChanged(),this.onVirtualColumnsChanged()),this.setWidth(),this.addEventListeners()}getHeaderRowClass(){return this.headerRowClass}getAriaRowIndex(){return this.rowIndex+1}addEventListeners(){const e=this.onRowHeightChanged.bind(this);this.addManagedEventListeners({columnResized:this.onColumnResized.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),virtualColumnsChanged:e=>this.onVirtualColumnsChanged(e.afterScroll),columnHeaderHeightChanged:e,gridStylesChanged:e,advancedFilterEnabledChanged:e}),this.addManagedPropertyListener("domLayout",this.onDisplayedColumnsChanged.bind(this)),this.addManagedPropertyListener("ensureDomOrder",(e=>this.isEnsureDomOrder=e.currentValue)),this.addManagedPropertyListeners(["headerHeight","pivotHeaderHeight","groupHeaderHeight","pivotGroupHeaderHeight","floatingFiltersHeight"],e)}getHeade';
      S = S + 'rCellCtrl(e){if(this.headerCellCtrls)return U(this.headerCellCtrls).find((t=>t.getColumnGroupChild()===e))}onDisplayedColumnsChanged(){this.isPrintLayout=this.gos.isDomLayout("print"),this.onVirtualColumnsChanged(),this.setWidth(),this.onRowHeightChanged()}getType(){return this.type}onColumnResized(){this.setWidth()}setWidth(){const e=this.getWidthForRow();this.comp.setWidth(`${e}px`)}getWidthForRow(){const{visibleColsService:e}=this.beans;if(this.isPrintLayout){return null!=this.pinned?0:e.getContainerWidth("right")+e.getContainerWidth("left")+e.getContainerWidth(null)}return e.getContainerWidth(this.pinned)}onRowHeightChanged(){const{topOffset:e,rowHeight:t}=this.getTopAndHeight();this.comp.setTop(e+"px"),this.comp.setHeight(t+"px")}getTopAndHeight(){const{columnModel:e,filterManager:t}=this.beans;let a=e.getHeaderRowCount();const n=[];let o=0;t?.hasFloatingFilters()&&(a++,o=1);const r=e.getColumnGroupHeaderRowHeight(),i=e.getColumnHeaderRowHeight(),s=a-(1+o);for(let e=0;e<s;e++)n.push(r);n.push(i);for(let t=0;t<o;t++)n.push(e.getFloatingFiltersHeight());let l=0;for(let e=0;e<this.rowIndex;e++)l+=n[e];return{topOffset:l,rowHeight:n[this.rowIndex]}}getPinned(){return this.pinned}getRowIndex(){return this.rowIndex}onVirtualColumnsChanged(e=!1){const t=this.getHeaderCtrls(),a=this.isEnsureDomOrder||this.isPrintLayout;this.comp.setHeaderCtrls(t,a,e)}getHeaderCtrls(){const e=this.headerCellCtrls;this.headerCellCtrls=new Map;const t=this.getColumnsInViewport();for(const a of t)this.recycleAndCreateHeaderCtrls(a,e);const a=e=>{const{focusService:t,visibleColsService:a}=this.beans;if(!t.isHeaderWrapperFocused(e))return!1;return a.isVisible(e.getColumnGroupChild())};if(e)for(const[t,n]of e){a(n)?this.headerCellCtrls.set(t,n):this.destroyBean(n)}return this.getHeaderCellCtrls()}getHeaderCellCtrls(){return Array.from(this.headerCellCtrls?.values()??[])}recycleAndCreateHeaderCtrls(e,t){if(!this.headerCellCtrls)return;if(e.isEmptyGroup())return;const a=e.getUniqueId();let n;t&';
      S = S + '&(n=t.get(a),t.delete(a));if(n&&n.getColumnGroupChild()!=e&&(this.destroyBean(n),n=void 0),null==n)switch(this.type){case"filter":n=this.createBean(this.beans.ctrlsFactory.getInstance("headerFilterCell",e,this.beans,this));break;case"group":n=this.createBean(new _r(e,this.beans,this));break;default:n=this.createBean(new Kr(e,this.beans,this))}this.headerCellCtrls.set(a,n)}getColumnsInViewport(){return this.isPrintLayout?this.getColumnsInViewportPrintLayout():this.getColumnsInViewportNormalLayout()}getColumnsInViewportPrintLayout(){if(null!=this.pinned)return[];let e=[];const t=this.getActualDepth(),{columnViewportService:a}=this.beans;return["left",null,"right"].forEach((n=>{const o=a.getHeadersToRender(n,t);e=e.concat(o)})),e}getActualDepth(){return"filter"==this.type?this.rowIndex-1:this.rowIndex}getColumnsInViewportNormalLayout(){return this.beans.columnViewportService.getHeadersToRender(this.pinned,this.getActualDepth())}findHeaderCellCtrl(e){if(!this.headerCellCtrls)return;return this.getHeaderCellCtrls().find((t=>t.getColumnGroupChild()==e))}focusHeader(e,t){const a=this.findHeaderCellCtrl(e);if(!a)return!1;return a.focus(t)}destroy(){this.headerCellCtrls&&this.headerCellCtrls.forEach((e=>{this.destroyBean(e)})),this.headerCellCtrls=void 0,super.destroy()}},Xr=class extends A{constructor(e){super(),this.hidden=!1,this.includeFloatingFilter=!1,this.groupsRowCtrls=[],this.pinned=e}wireBeans(e){this.ctrlsService=e.ctrlsService,this.scrollVisibleService=e.scrollVisibleService,this.pinnedWidthService=e.pinnedWidthService,this.columnModel=e.columnModel,this.focusService=e.focusService,this.filterManager=e.filterManager}setComp(e,t){this.comp=e,this.eViewport=t,this.setupCenterWidth(),this.setupPinnedWidth(),this.setupDragAndDrop(this.eViewport);const a=this.onDisplayedColumnsChanged.bind(this);this.addManagedEventListeners({gridColumnsChanged:this.onGridColumnsChanged.bind(this),displayedColumnsChanged:a,advancedFilterEnabledChanged:a}),this.ctrlsService.registerHea';
      S = S + 'derContainer(this,this.pinned),this.columnModel.isReady()&&this.refresh()}getAllCtrls(){const e=[...this.groupsRowCtrls];return this.columnsRowCtrl&&e.push(this.columnsRowCtrl),this.filtersRowCtrl&&e.push(this.filtersRowCtrl),e}refresh(e=!1){const t=new Ia,a=this.focusService.getFocusHeaderToUseAfterRefresh();(()=>{const e=this.columnModel.getHeaderRowCount()-1;this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls);for(let a=0;a<e;a++){const e=this.createBean(new Zr(t.next(),this.pinned,"group"));this.groupsRowCtrls.push(e)}})(),(()=>{const a=t.next(),n=!(this.hidden||null!=this.columnsRowCtrl&&e&&this.columnsRowCtrl.getRowIndex()===a);(n||this.hidden)&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),n&&(this.columnsRowCtrl=this.createBean(new Zr(a,this.pinned,"column")))})(),(()=>{this.includeFloatingFilter=!!this.filterManager?.hasFloatingFilters()&&!this.hidden;const a=()=>{this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)};if(!this.includeFloatingFilter)return void a();const n=t.next();if(this.filtersRowCtrl){const t=this.filtersRowCtrl.getRowIndex()!==n;e&&!t||a()}this.filtersRowCtrl||(this.filtersRowCtrl=this.createBean(new Zr(n,this.pinned,"filter")))})();const n=this.getAllCtrls();this.comp.setCtrls(n),this.restoreFocusOnHeader(a)}getHeaderCtrlForColumn(e){if(te(e)){if(!this.columnsRowCtrl)return;return this.columnsRowCtrl.getHeaderCellCtrl(e)}if(0!==this.groupsRowCtrls.length)for(let t=0;t<this.groupsRowCtrls.length;t++){const a=this.groupsRowCtrls[t].getHeaderCellCtrl(e);if(a)return a}}getHtmlElementForColumnHeader(e){const t=this.getHeaderCtrlForColumn(e);return t?t.getGui():null}getRowType(e){const t=this.getAllCtrls()[e];return t?t.getType():void 0}focusHeader(e,t,a){const n=this.getAllCtrls()[e];return!!n&&n.focusHeader(t,a)}getViewport(){return this.eViewport}getRowCount(){return this.groupsRowCtrls.length+(this.columnsRowCtrl?1:0)+(this.filtersRowCtrl?1:0)}setHorizontalScroll(e){this.comp.setViewportScrollLeft(e)}destroy(){thi';
      S = S + 's.filtersRowCtrl&&(this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)),this.columnsRowCtrl&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),this.groupsRowCtrls&&this.groupsRowCtrls.length&&(this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls)),super.destroy()}setupDragAndDrop(e){const t=new Wr(this.pinned,e);this.createManagedBean(t)}restoreFocusOnHeader(e){if(!e)return;const{column:t}=e;t.getPinned()==this.pinned&&this.focusService.focusHeaderPosition({headerPosition:e})}onGridColumnsChanged(){this.refresh(!0)}onDisplayedColumnsChanged(){const e=this.filterManager?.hasFloatingFilters()&&!this.hidden;this.includeFloatingFilter!==e&&this.refresh(!0)}setupCenterWidth(){null==this.pinned&&this.createManagedBean(new Or((e=>this.comp.setCenterWidth(`${e}px`)),!0))}setupPinnedWidth(){if(null==this.pinned)return;const e="left"===this.pinned,t="right"===this.pinned;this.hidden=!0;const a=()=>{const a=e?this.pinnedWidthService.getPinnedLeftWidth():this.pinnedWidthService.getPinnedRightWidth();if(null==a)return;const n=0==a,o=this.hidden!==n,r=this.gos.get("enableRtl"),i=this.gos.getScrollbarWidth(),s=this.scrollVisibleService.isVerticalScrollShowing()&&(r&&e||!r&&t)?a+i:a;this.comp.setPinnedContainerWidth(`${s}px`),this.comp.setDisplayed(!n),o&&(this.hidden=n,this.refresh())};this.addManagedEventListeners({leftPinnedWidthChanged:a,rightPinnedWidthChanged:a,scrollVisibilityChanged:a,scrollbarWidthChanged:a})}},$r=class extends Ba{constructor(e){super(),this.eCenterContainer=qa,this.headerRowComps={},this.rowCompsList=[],this.pinned=e}postConstruct(){this.selectAndSetTemplate();const e={setDisplayed:e=>this.setDisplayed(e),setCtrls:e=>this.setCtrls(e),setCenterWidth:e=>this.eCenterContainer.style.width=e,setViewportScrollLeft:e=>this.getGui().scrollLeft=e,setPinnedContainerWidth:e=>{const t=this.getGui();t.style.width=e,t.style.maxWidth=e,t.style.minWidth=e}};this.createManagedBean(new Xr(this.pinned)).setComp(e,this.getGui())}selectAndSetTemplate(){co';
      S = S + 'nst e="left"==this.pinned,t="right"==this.pinned,a=e?\'<div class="ag-pinned-left-header" role="rowgroup"></div>\':t?\'<div class="ag-pinned-right-header" role="rowgroup"></div>\':\'<div class="ag-header-viewport" role="presentation">\\n        <div class="ag-header-container" data-ref="eCenterContainer" role="rowgroup"></div>\\n    </div>\';this.setTemplate(a),this.eRowContainer=this.eCenterContainer!==qa?this.eCenterContainer:this.getGui()}destroy(){this.setCtrls([]),super.destroy()}destroyRowComp(e){this.destroyBean(e),this.eRowContainer.removeChild(e.getGui())}setCtrls(e){const t=this.headerRowComps;let a;this.headerRowComps={},this.rowCompsList=[];const n=e=>{const t=e.getGui();t.parentElement!=this.eRowContainer&&this.eRowContainer.appendChild(t),a&&ka(this.eRowContainer,t,a),a=t};e.forEach((e=>{const a=e.getInstanceId(),o=t[a];delete t[a];const r=o||this.createBean(new Ar(e));this.headerRowComps[a]=r,this.rowCompsList.push(r),n(r)})),Y(t).forEach((e=>this.destroyRowComp(e)))}},ei=class extends Ba{constructor(){super(\'<div class="ag-header" role="presentation"/>\')}postConstruct(){const e={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setHeightAndMinHeight:e=>{this.getGui().style.height=e,this.getGui().style.minHeight=e}};this.createManagedBean(new Lr).setComp(e,this.getGui(),this.getFocusableElement());const t=e=>{this.createManagedBean(e),this.appendChild(e)};t(new $r("left")),t(new $r(null)),t(new $r("right"))}},ti={selector:"AG-HEADER-ROOT",component:ei},ai=(e=>(e.AUTO_HEIGHT="ag-layout-auto-height",e.NORMAL="ag-layout-normal",e.PRINT="ag-layout-print",e))(ai||{}),ni=class extends A{constructor(e){super(),this.view=e}postConstruct(){this.addManagedPropertyListener("domLayout",this.updateLayoutClasses.bind(this)),this.updateLayoutClasses()}updateLayoutClasses(){const e=this.getDomLayout(),t={autoHeight:"autoHeight"===e,normal:"normal"===e,print:"print"===e},a=t.autoHeight?"ag-layout-auto-height":t.print?"ag-layout-print":"ag-layout-normal";this.view.updat';
      S = S + 'eLayoutClasses(a,t)}getDomLayout(){const e=this.gos.get("domLayout")??"normal";return-1===["normal","print","autoHeight"].indexOf(e)?(ce(`${e} is not valid for DOM Layout, valid values are \'normal\', \'autoHeight\', \'print\'.`),"normal"):e}},oi=class extends Ba{constructor(){super(\'\\n            <div class="ag-overlay" role="presentation">\\n                <div class="ag-overlay-panel" role="presentation">\\n                    <div class="ag-overlay-wrapper" data-ref="eOverlayWrapper" role="presentation"></div>\\n                </div>\\n            </div>\'),this.eOverlayWrapper=qa,this.activePromise=null,this.activeOverlay=null,this.updateListenerDestroyFunc=null,this.activeOverlayWrapperCssClass=null}wireBeans(e){this.overlayService=e.overlayService}updateLayoutClasses(e,t){const a=this.eOverlayWrapper.classList;a.toggle("ag-layout-auto-height",t.autoHeight),a.toggle("ag-layout-normal",t.normal),a.toggle("ag-layout-print",t.print)}postConstruct(){this.createManagedBean(new ni(this)),this.setDisplayed(!1,{skipAriaHidden:!0}),this.overlayService.registerOverlayWrapperComp(this)}setWrapperTypeClass(e){const t=this.eOverlayWrapper.classList;this.activeOverlayWrapperCssClass&&t.toggle(this.activeOverlayWrapperCssClass,!1),this.activeOverlayWrapperCssClass=e,t.toggle(e,!0)}showOverlay(e,t,a){this.setWrapperTypeClass(t),this.destroyActiveOverlay(),this.activePromise=e,e?.then((t=>{if(this.activePromise===e){if(this.activePromise=null,t&&this.activeOverlay!=t&&(this.eOverlayWrapper.appendChild(t.getGui()),this.activeOverlay=t,a)){const e=t;this.updateListenerDestroyFunc=this.addManagedPropertyListener(a,(({currentValue:t})=>{e.refresh?.(this.gos.addGridCommonParams({...t??{}}))}))}}else this.activeOverlay!==t&&(this.destroyBean(t),t=null)})),this.setDisplayed(!0,{skipAriaHidden:!0})}destroyActiveOverlay(){this.activePromise=null;const e=this.activeOverlay;if(!e)return;this.activeOverlay=null;const t=this.updateListenerDestroyFunc;t&&(t(),this.updateListenerDestroyFunc=null),thi';
      S = S + 's.destroyBean(e),ba(this.eOverlayWrapper)}hideOverlay(){this.destroyActiveOverlay(),this.setDisplayed(!1,{skipAriaHidden:!0})}destroy(){this.destroyActiveOverlay(),super.destroy()}},ri={selector:"AG-OVERLAY-WRAPPER",component:oi},ii=class extends Ba{constructor(e,t){super(),this.direction=t,this.eViewport=qa,this.eContainer=qa,this.hideTimeout=null,this.setTemplate(e)}wireBeans(e){this.animationFrameService=e.animationFrameService}postConstruct(){this.addManagedEventListeners({scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this)}),this.onScrollVisibilityChanged(),this.addOrRemoveCssClass("ag-apple-scrollbar",Jt()||Zt())}initialiseInvisibleScrollbar(){void 0===this.invisibleScrollbar&&(this.invisibleScrollbar=ta(),this.invisibleScrollbar&&(this.hideAndShowInvisibleScrollAsNeeded(),this.addActiveListenerToggles()))}addActiveListenerToggles(){const e=this.getGui(),t=()=>this.addOrRemoveCssClass("ag-scrollbar-active",!0),a=()=>this.addOrRemoveCssClass("ag-scrollbar-active",!1);this.addManagedListeners(e,{mouseenter:t,mousedown:t,touchstart:t,mouseleave:a,touchend:a})}onScrollVisibilityChanged(){void 0===this.invisibleScrollbar&&this.initialiseInvisibleScrollbar(),this.animationFrameService.requestAnimationFrame((()=>this.setScrollVisible()))}hideAndShowInvisibleScrollAsNeeded(){this.addManagedEventListeners({bodyScroll:e=>{e.direction===this.direction&&(null!==this.hideTimeout&&(window.clearTimeout(this.hideTimeout),this.hideTimeout=null),this.addOrRemoveCssClass("ag-scrollbar-scrolling",!0))},bodyScrollEnd:()=>{this.hideTimeout=window.setTimeout((()=>{this.addOrRemoveCssClass("ag-scrollbar-scrolling",!1),this.hideTimeout=null}),400)}})}attemptSettingScrollPosition(e){const t=this.getViewport();be((()=>ya(t)),(()=>this.setScrollPosition(e)),100)}getViewport(){return this.eViewport}getContainer(){return this.eContainer}onScrollCallback(e){this.addManagedElementListeners(this.getViewport(),{scroll:e})}},si=class extends ii{constructor(){super(\'<div class="ag-';
      S = S + 'body-horizontal-scroll" aria-hidden="true">\\n            <div class="ag-horizontal-left-spacer" data-ref="eLeftSpacer"></div>\\n            <div class="ag-body-horizontal-scroll-viewport" data-ref="eViewport">\\n                <div class="ag-body-horizontal-scroll-container" data-ref="eContainer"></div>\\n            </div>\\n            <div class="ag-horizontal-right-spacer" data-ref="eRightSpacer"></div>\\n        </div>\',"horizontal"),this.eLeftSpacer=qa,this.eRightSpacer=qa}wireBeans(e){super.wireBeans(e),this.visibleColsService=e.visibleColsService,this.pinnedRowModel=e.pinnedRowModel,this.ctrlsService=e.ctrlsService,this.scrollVisibleService=e.scrollVisibleService}postConstruct(){super.postConstruct();const e=this.setFakeHScrollSpacerWidths.bind(this);this.addManagedEventListeners({displayedColumnsChanged:e,displayedColumnsWidthChanged:e,pinnedRowDataChanged:this.onPinnedRowDataChanged.bind(this)}),this.addManagedPropertyListener("domLayout",e),this.ctrlsService.register("fakeHScrollComp",this),this.createManagedBean(new Or((e=>this.eContainer.style.width=`${e}px`))),this.addManagedPropertyListeners(["suppressHorizontalScroll"],this.onScrollVisibilityChanged.bind(this))}initialiseInvisibleScrollbar(){void 0===this.invisibleScrollbar&&(this.enableRtl=this.gos.get("enableRtl"),super.initialiseInvisibleScrollbar(),this.invisibleScrollbar&&this.refreshCompBottom())}onPinnedRowDataChanged(){this.refreshCompBottom()}refreshCompBottom(){if(!this.invisibleScrollbar)return;const e=this.pinnedRowModel.getPinnedBottomTotalHeight();this.getGui().style.bottom=`${e}px`}onScrollVisibilityChanged(){super.onScrollVisibilityChanged(),this.setFakeHScrollSpacerWidths()}setFakeHScrollSpacerWidths(){const e=this.scrollVisibleService.isVerticalScrollShowing();let t=this.visibleColsService.getDisplayedColumnsRightWidth();const a=!this.enableRtl&&e,n=this.gos.getScrollbarWidth();a&&(t+=n),Fa(this.eRightSpacer,t),this.eRightSpacer.classList.toggle("ag-scroller-corner",t<=n);let o=this.vis';
      S = S + 'ibleColsService.getColsLeftWidth();this.enableRtl&&e&&(o+=n),Fa(this.eLeftSpacer,o),this.eLeftSpacer.classList.toggle("ag-scroller-corner",o<=n)}setScrollVisible(){const e=this.scrollVisibleService.isHorizontalScrollShowing(),t=this.invisibleScrollbar,a=this.gos.get("suppressHorizontalScroll"),n=e&&this.gos.getScrollbarWidth()||0,o=a?0:0===n&&t?16:n;this.addOrRemoveCssClass("ag-scrollbar-invisible",t),Ma(this.getGui(),o),Ma(this.eViewport,o),Ma(this.eContainer,o),this.setDisplayed(e,{skipAriaHidden:!0})}getScrollPosition(){return fa(this.getViewport(),this.enableRtl)}setScrollPosition(e){ya(this.getViewport())||this.attemptSettingScrollPosition(e),va(this.getViewport(),e,this.enableRtl)}},li={selector:"AG-FAKE-HORIZONTAL-SCROLL",component:si},ci=class extends A{wireBeans(e){this.maxDivHeightScaler=e.rowContainerHeightService}constructor(e,t){super(),this.eContainer=e,this.eViewport=t}postConstruct(){this.addManagedEventListeners({rowContainerHeightChanged:this.onHeightChanged.bind(this)})}onHeightChanged(){const e=this.maxDivHeightScaler.getUiContainerHeight(),t=null!=e?`${e}px`:"";this.eContainer.style.height=t,this.eViewport&&(this.eViewport.style.height=t)}},gi=class extends ii{wireBeans(e){super.wireBeans(e),this.ctrlsService=e.ctrlsService,this.scrollVisibleService=e.scrollVisibleService}constructor(){super(\'<div class="ag-body-vertical-scroll" aria-hidden="true">\\n            <div class="ag-body-vertical-scroll-viewport" data-ref="eViewport">\\n                <div class="ag-body-vertical-scroll-container" data-ref="eContainer"></div>\\n            </div>\\n        </div>\',"vertical")}postConstruct(){super.postConstruct(),this.createManagedBean(new ci(this.eContainer)),this.ctrlsService.register("fakeVScrollComp",this),this.addManagedEventListeners({rowContainerHeightChanged:this.onRowContainerHeightChanged.bind(this)})}setScrollVisible(){const e=this.scrollVisibleService.isVerticalScrollShowing(),t=this.invisibleScrollbar,a=e&&this.gos.getScrollbarWidth()||0,n=0';
      S = S + '===a&&t?16:a;this.addOrRemoveCssClass("ag-scrollbar-invisible",t),Fa(this.getGui(),n),Fa(this.eViewport,n),Fa(this.eContainer,n),this.setDisplayed(e,{skipAriaHidden:!0})}onRowContainerHeightChanged(){const{ctrlsService:e}=this,t=e.getGridBodyCtrl().getBodyViewportElement(),a=this.getScrollPosition(),n=t.scrollTop;a!=n&&this.setScrollPosition(n,!0)}getScrollPosition(){return this.getViewport().scrollTop}setScrollPosition(e,t){t||ya(this.getViewport())||this.attemptSettingScrollPosition(e),this.getViewport().scrollTop=e}},di={selector:"AG-FAKE-VERTICAL-SCROLL",component:gi},hi=class extends A{constructor(e){super(),this.lastScrollSource=[null,null],this.scrollLeft=-1,this.nextScrollTop=-1,this.scrollTop=-1,this.lastOffsetHeight=-1,this.lastScrollTop=-1,this.eBodyViewport=e,this.resetLastHScrollDebounced=fe((()=>this.lastScrollSource[1]=null),500),this.resetLastVScrollDebounced=fe((()=>this.lastScrollSource[0]=null),500)}wireBeans(e){this.ctrlsService=e.ctrlsService,this.animationFrameService=e.animationFrameService,this.paginationService=e.paginationService,this.pageBoundsService=e.pageBoundsService,this.rowModel=e.rowModel,this.heightScaler=e.rowContainerHeightService,this.rowRenderer=e.rowRenderer,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.addManagedEventListeners({displayedColumnsWidthChanged:this.onDisplayedColumnsWidthChanged.bind(this)}),this.ctrlsService.whenReady((e=>{this.centerRowsCtrl=e.center,this.onDisplayedColumnsWidthChanged(),this.addScrollListener()}))}addScrollListener(){const{fakeHScrollComp:e,fakeVScrollComp:t}=this.ctrlsService.getParams();this.addManagedElementListeners(this.centerRowsCtrl.getViewportElement(),{scroll:this.onHScroll.bind(this)}),e.onScrollCallback(this.onFakeHScroll.bind(this));const a=this.gos.get("debounceVerticalScrollbar"),n=a?fe(this.onVScroll.bind(this),100):this.onVScroll.bind(this),o=a?fe(this.onFakeVScroll.bind(this),100):this.';
      S = S + 'onFakeVScroll.bind(this);this.addManagedElementListeners(this.eBodyViewport,{scroll:n}),t.onScrollCallback(o)}onDisplayedColumnsWidthChanged(){this.enableRtl&&this.horizontallyScrollHeaderCenterAndFloatingCenter()}horizontallyScrollHeaderCenterAndFloatingCenter(e){if(null==this.centerRowsCtrl)return;void 0===e&&(e=this.centerRowsCtrl.getCenterViewportScrollLeft());const t=this.enableRtl?e:-e,{topCenter:a,stickyTopCenter:n,stickyBottomCenter:o,centerHeader:r,bottomCenter:i,fakeHScrollComp:s}=this.ctrlsService.getParams();r.setHorizontalScroll(-t),i.setContainerTranslateX(t),a.setContainerTranslateX(t),n.setContainerTranslateX(t),o.setContainerTranslateX(t);const l=this.centerRowsCtrl.getViewportElement(),c=0===this.lastScrollSource[1];e=Math.abs(e),c?s.setScrollPosition(e):va(l,e,this.enableRtl)}isControllingScroll(e,t){return null==this.lastScrollSource[t]?(this.lastScrollSource[t]=e,!0):this.lastScrollSource[t]===e}onFakeHScroll(){this.isControllingScroll(1,1)&&this.onHScrollCommon(1)}onHScroll(){this.isControllingScroll(0,1)&&this.onHScrollCommon(0)}onHScrollCommon(e){const t=this.centerRowsCtrl.getViewportElement(),{scrollLeft:a}=t;if(this.shouldBlockScrollUpdate(1,a,!0))return;let n;n=0===e?fa(t,this.enableRtl):this.ctrlsService.get("fakeHScrollComp").getScrollPosition(),this.doHorizontalScroll(Math.round(n)),this.resetLastHScrollDebounced()}onFakeVScroll(){this.isControllingScroll(1,0)&&this.onVScrollCommon(1)}onVScroll(){this.isControllingScroll(0,0)&&this.onVScrollCommon(0)}onVScrollCommon(e){let t;t=0===e?this.eBodyViewport.scrollTop:this.ctrlsService.get("fakeVScrollComp").getScrollPosition(),this.shouldBlockScrollUpdate(0,t,!0)||(this.animationFrameService.setScrollTop(t),this.nextScrollTop=t,0===e?this.ctrlsService.get("fakeVScrollComp").setScrollPosition(t):this.eBodyViewport.scrollTop=t,this.gos.get("suppressAnimationFrame")?this.scrollGridIfNeeded():this.animationFrameService.schedule(),this.resetLastVScrollDebounced())}doHorizontalScroll(e){const t=th';
      S = S + 'is.ctrlsService.get("fakeHScrollComp").getScrollPosition();this.scrollLeft===e&&e===t||(this.scrollLeft=e,this.fireScrollEvent(1),this.horizontallyScrollHeaderCenterAndFloatingCenter(e),this.centerRowsCtrl.onHorizontalViewportChanged(!0))}fireScrollEvent(e){const t={type:"bodyScroll",direction:1===e?"horizontal":"vertical",left:this.scrollLeft,top:this.scrollTop};this.eventService.dispatchEvent(t),window.clearTimeout(this.scrollTimer),this.scrollTimer=void 0,this.scrollTimer=window.setTimeout((()=>{const e={...t,type:"bodyScrollEnd"};this.eventService.dispatchEvent(e)}),100)}shouldBlockScrollUpdate(e,t,a=!1){return!(a&&!Zt())&&(0===e?this.shouldBlockVerticalScroll(t):this.shouldBlockHorizontalScroll(t))}shouldBlockVerticalScroll(e){const t=ga(this.eBodyViewport),{scrollHeight:a}=this.eBodyViewport;return e<0||e+t>a}shouldBlockHorizontalScroll(e){const t=this.centerRowsCtrl.getCenterWidth(),{scrollWidth:a}=this.centerRowsCtrl.getViewportElement();if(this.enableRtl&&ma()){if(e>0)return!0}else if(e<0)return!0;return Math.abs(e)+t>a}redrawRowsAfterScroll(){this.fireScrollEvent(0)}checkScrollLeft(){this.scrollLeft!==this.centerRowsCtrl.getCenterViewportScrollLeft()&&this.onHScrollCommon(0)}scrollGridIfNeeded(){const e=this.scrollTop!=this.nextScrollTop;return e&&(this.scrollTop=this.nextScrollTop,this.redrawRowsAfterScroll()),e}setHorizontalScrollPosition(e,t=!1){const a=this.centerRowsCtrl.getViewportElement().scrollWidth-this.centerRowsCtrl.getCenterWidth();!t&&this.shouldBlockScrollUpdate(1,e)&&(e=this.enableRtl&&ma()?e>0?0:a:Math.min(Math.max(e,0),a)),va(this.centerRowsCtrl.getViewportElement(),Math.abs(e),this.enableRtl),this.doHorizontalScroll(e)}setVerticalScrollPosition(e){this.eBodyViewport.scrollTop=e}getVScrollPosition(){this.lastScrollTop=this.eBodyViewport.scrollTop,this.lastOffsetHeight=this.eBodyViewport.offsetHeight;return{top:this.lastScrollTop,bottom:this.lastScrollTop+this.lastOffsetHeight}}getApproximateVScollPosition(){return this.lastScrollTop>=0&&t';
      S = S + 'his.lastOffsetHeight>=0?{top:this.scrollTop,bottom:this.scrollTop+this.lastOffsetHeight}:this.getVScrollPosition()}getHScrollPosition(){return this.centerRowsCtrl.getHScrollPosition()}isHorizontalScrollShowing(){return this.centerRowsCtrl.isHorizontalScrollShowing()}scrollHorizontally(e){const t=this.centerRowsCtrl.getViewportElement().scrollLeft;return this.setHorizontalScrollPosition(t+e),this.centerRowsCtrl.getViewportElement().scrollLeft-t}scrollToTop(){this.eBodyViewport.scrollTop=0}ensureNodeVisible(e,t=null){const a=this.rowModel.getRowCount();let n=-1;for(let t=0;t<a;t++){const a=this.rowModel.getRow(t);if("function"==typeof e){if(a&&e(a)){n=t;break}}else if(e===a||e===a.data){n=t;break}}n>=0&&this.ensureIndexVisible(n,t)}ensureIndexVisible(e,t){if(this.gos.isDomLayout("print"))return;const a=this.rowModel.getRowCount();if("number"!=typeof e||e<0||e>=a)return void ce("Invalid row index for ensureIndexVisible: "+e);const n=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.getFrameworkOverrides().wrapIncoming((()=>{n||this.paginationService?.goToPageWithIndex(e);const a=this.ctrlsService.getGridBodyCtrl(),o=a.getStickyTopHeight(),r=a.getStickyBottomHeight(),i=this.rowModel.getRow(e);let s;do{const e=i.rowTop,a=i.rowHeight,n=this.pageBoundsService.getPixelOffset(),l=i.rowTop-n,c=l+i.rowHeight,g=this.getVScrollPosition(),d=this.heightScaler.getDivStretchOffset(),h=g.top+d,u=g.bottom+d,p=u-h,m=this.heightScaler.getScrollPositionForPixel(l),f=this.heightScaler.getScrollPositionForPixel(c-p),v=Math.min((m+f)/2,l);let b=null;"top"===t?b=m:"bottom"===t?b=f:"middle"===t?b=v:h+o>l?b=m-o:u-r<c&&(b=f+r),null!==b&&(this.setVerticalScrollPosition(b),this.rowRenderer.redraw({afterScroll:!0})),s=e!==i.rowTop||a!==i.rowHeight}while(s);this.animationFrameService.flushAllFrames()}))}ensureColumnVisible(e,t="auto"){const a=this.columnModel.getCol(e);if(!a)return;if(a.isPinned())return;if(!this.visibleColsService.isColDisplayed(a))return;const n=this.getPo';
      S = S + 'sitionedHorizontalScroll(a,t);this.getFrameworkOverrides().wrapIncoming((()=>{null!==n&&this.centerRowsCtrl.setCenterViewportScrollLeft(n),this.centerRowsCtrl.onHorizontalViewportChanged(),this.animationFrameService.flushAllFrames()}))}setScrollPosition(e,t){this.getFrameworkOverrides().wrapIncoming((()=>{this.centerRowsCtrl.setCenterViewportScrollLeft(t),this.setVerticalScrollPosition(e),this.rowRenderer.redraw({afterScroll:!0}),this.animationFrameService.flushAllFrames()}))}getPositionedHorizontalScroll(e,t){const{columnBeforeStart:a,columnAfterEnd:n}=this.isColumnOutsideViewport(e),o=this.centerRowsCtrl.getCenterWidth()<e.getActualWidth(),r=this.centerRowsCtrl.getCenterWidth(),i=this.enableRtl;let s=(i?a:n)||o,l=i?n:a;"auto"!==t&&(s="start"===t,l="end"===t);const c="middle"===t;if(s||l||c){const{colLeft:t,colMiddle:a,colRight:n}=this.getColumnBounds(e);return c?a-r/2:s?i?n:t:i?t-r:n-r}return null}isColumnOutsideViewport(e){const{start:t,end:a}=this.getViewportBounds(),{colLeft:n,colRight:o}=this.getColumnBounds(e),r=this.enableRtl;return{columnBeforeStart:r?t>o:a<o,columnAfterEnd:r?a<n:t>n}}getColumnBounds(e){const t=this.enableRtl,a=this.visibleColsService.getBodyContainerWidth(),n=e.getActualWidth(),o=e.getLeft(),r=t?-1:1,i=t?a-o:o;return{colLeft:i,colMiddle:i+n/2*r,colRight:i+n*r}}getViewportBounds(){const e=this.centerRowsCtrl.getCenterWidth(),t=this.centerRowsCtrl.getCenterViewportScrollLeft();return{start:t,end:e+t,width:e}}},ui="ag-force-vertical-scroll",pi=class extends A{constructor(){super(...arguments),this.stickyTopHeight=0,this.stickyBottomHeight=0}wireBeans(e){this.animationFrameService=e.animationFrameService,this.rowContainerHeightService=e.rowContainerHeightService,this.ctrlsService=e.ctrlsService,this.columnModel=e.columnModel,this.columnSizeService=e.columnSizeService,this.scrollVisibleService=e.scrollVisibleService,this.menuService=e.menuService,this.headerNavigationService=e.headerNavigationService,this.dragAndDropService=e.dragAndDropService';
      S = S + ',this.pinnedRowModel=e.pinnedRowModel,this.rowRenderer=e.rowRenderer,this.popupService=e.popupService,this.mouseEventService=e.mouseEventService,this.rowModel=e.rowModel,this.filterManager=e.filterManager,this.environment=e.environment}getScrollFeature(){return this.bodyScrollFeature}getBodyViewportElement(){return this.eBodyViewport}setComp(e,t,a,n,o,r,i){this.comp=e,this.eGridBody=t,this.eBodyViewport=a,this.eTop=n,this.eBottom=o,this.eStickyTop=r,this.eStickyBottom=i,this.setCellTextSelection(this.gos.get("enableCellTextSelection")),this.addManagedPropertyListener("enableCellTextSelection",(e=>this.setCellTextSelection(e.currentValue))),this.createManagedBean(new ni(this.comp)),this.bodyScrollFeature=this.createManagedBean(new hi(this.eBodyViewport)),this.addRowDragListener(),this.setupRowAnimationCssClass(),this.addEventListeners(),this.addFocusListeners([n,a,o,r,i]),this.onGridColumnsChanged(),this.addBodyViewportListener(),this.setFloatingHeights(),this.disableBrowserDragging(),this.addStopEditingWhenGridLosesFocus(),this.filterManager?.setupAdvancedFilterHeaderComp(n),this.ctrlsService.register("gridBodyCtrl",this)}getComp(){return this.comp}addEventListeners(){this.addManagedEventListeners({gridColumnsChanged:this.onGridColumnsChanged.bind(this),scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this),pinnedRowDataChanged:this.setFloatingHeights.bind(this),pinnedHeightChanged:this.setFloatingHeights.bind(this),headerHeightChanged:this.onHeaderHeightChanged.bind(this)})}addFocusListeners(e){e.forEach((e=>{this.addManagedElementListeners(e,{focusin:t=>{const{target:a}=t,n=la(a,"ag-root",e);e.classList.toggle("ag-has-focus",!n)},focusout:t=>{const{target:a,relatedTarget:n}=t,o=e.contains(n),r=la(n,"ag-root",e);la(a,"ag-root",e)||o&&!r||e.classList.remove("ag-has-focus")}})}))}setColumnMovingCss(e){this.comp.setColumnMovingCss("ag-column-moving",e)}setCellTextSelection(e=!1){this.comp.setCellSelectableCss("ag-selectable",e)}onScrollVisibilityChanged(){c';
      S = S + 'onst e=this.scrollVisibleService.isVerticalScrollShowing();this.setVerticalScrollPaddingVisible(e),this.setStickyWidth(e),this.setStickyBottomOffsetBottom();const t=`calc(100% + ${(e&&this.gos.getScrollbarWidth()||0)+(ta()?16:0)}px)`;this.animationFrameService.requestAnimationFrame((()=>this.comp.setBodyViewportWidth(t)))}onGridColumnsChanged(){const e=this.columnModel.getCols();this.comp.setColumnCount(e.length)}disableBrowserDragging(){this.addManagedElementListeners(this.eGridBody,{dragstart:e=>{if(e.target instanceof HTMLImageElement)return e.preventDefault(),!1}})}addStopEditingWhenGridLosesFocus(){if(!this.gos.get("stopEditingWhenCellsLoseFocus"))return;const e=e=>{const a=e.relatedTarget;if(null===$t(a))return void this.rowRenderer.stopEditing();let n=t.some((e=>e.contains(a)))&&this.mouseEventService.isElementInThisGrid(a);if(!n){const e=this.popupService;n=e.getActivePopups().some((e=>e.contains(a)))||e.isElementWithinCustomPopup(a)}n||this.rowRenderer.stopEditing()},t=[this.eBodyViewport,this.eBottom,this.eTop,this.eStickyTop,this.eStickyBottom];t.forEach((t=>this.addManagedElementListeners(t,{focusout:e})))}updateRowCount(){const e=this.headerNavigationService.getHeaderRowCount()+(this.filterManager?.getHeaderRowCount()??0),t=this.rowModel.isLastRowIndexKnown()?this.rowModel.getRowCount():-1,a=-1===t?-1:e+t;this.comp.setRowCount(a)}registerBodyViewportResizeListener(e){this.comp.registerBodyViewportResizeListener(e)}setVerticalScrollPaddingVisible(e){const t=e?"scroll":"hidden";this.comp.setPinnedTopBottomOverflowY(t)}isVerticalScrollShowing(){const e=this.gos.get("alwaysShowVerticalScroll"),t=e?ui:null,a=this.gos.isDomLayout("normal");return this.comp.setAlwaysVerticalScrollClass(t,e),e||a&&(n=this.eBodyViewport).clientHeight<n.scrollHeight;var n}setupRowAnimationCssClass(){let e=this.environment.hasMeasuredSizes();const t=()=>{const t=e&&this.gos.isAnimateRows()&&!this.rowContainerHeightService.isStretching(),a=t?"ag-row-animation":"ag-row-no-animation"';
      S = S + ';this.comp.setRowAnimationCssOnBodyViewport(a,t)};t(),this.addManagedEventListeners({heightScaleChanged:t}),this.addManagedPropertyListener("animateRows",t),this.addManagedEventListeners({gridStylesChanged:()=>{!e&&this.environment.hasMeasuredSizes()&&(e=!0,t())}})}getGridBodyElement(){return this.eGridBody}addBodyViewportListener(){const e=this.onBodyViewportContextMenu.bind(this);this.addManagedElementListeners(this.eBodyViewport,{contextmenu:e}),this.mockContextMenuForIPad(e),this.addManagedElementListeners(this.eBodyViewport,{wheel:this.onBodyViewportWheel.bind(this)}),this.addManagedElementListeners(this.eStickyTop,{wheel:this.onStickyWheel.bind(this)}),this.addManagedElementListeners(this.eStickyBottom,{wheel:this.onStickyWheel.bind(this)}),this.addFullWidthContainerWheelListener()}addFullWidthContainerWheelListener(){const e=this.eBodyViewport.querySelector(".ag-full-width-container"),t=this.eBodyViewport.querySelector(".ag-center-cols-viewport");e&&t&&this.addManagedElementListeners(e,{wheel:e=>this.onFullWidthContainerWheel(e,t)})}onFullWidthContainerWheel(e,t){!e.deltaX||Math.abs(e.deltaY)>Math.abs(e.deltaX)||!this.mouseEventService.isEventFromThisGrid(e)||(e.preventDefault(),t.scrollBy({left:e.deltaX}))}onBodyViewportContextMenu(e,t,a){if(!e&&!a)return;if(this.gos.get("preventDefaultOnContextMenu")){(e||a).preventDefault()}const{target:n}=e||t;n!==this.eBodyViewport&&n!==this.ctrlsService.get("center").getViewportElement()||this.menuService.showContextMenu({mouseEvent:e,touchEvent:a,value:null,anchorToElement:this.eGridBody})}mockContextMenuForIPad(e){if(!Zt())return;const t=new ja(this.eBodyViewport);this.addManagedListeners(t,{longTap:t=>{e(void 0,t.touchStart,t.touchEvent)}}),this.addDestroyFunc((()=>t.destroy()))}onBodyViewportWheel(e){this.gos.get("suppressScrollWhenPopupsAreOpen")&&this.popupService.hasAnchoredPopup()&&e.preventDefault()}onStickyWheel(e){e.preventDefault(),e.offsetY&&this.scrollVertically(e.deltaY)}getGui(){return this.eGridBody}scr';
      S = S + 'ollVertically(e){const t=this.eBodyViewport.scrollTop;return this.bodyScrollFeature.setVerticalScrollPosition(t+e),this.eBodyViewport.scrollTop-t}addRowDragListener(){this.rowDragFeature=this.createManagedBean(new Zn(this.eBodyViewport)),this.dragAndDropService.addDropTarget(this.rowDragFeature)}getRowDragFeature(){return this.rowDragFeature}setFloatingHeights(){const{pinnedRowModel:e}=this,t=e.getPinnedTopTotalHeight(),a=e.getPinnedBottomTotalHeight();this.comp.setTopHeight(t),this.comp.setBottomHeight(a),this.comp.setTopDisplay(t?"inherit":"none"),this.comp.setBottomDisplay(a?"inherit":"none"),this.setStickyTopOffsetTop(),this.setStickyBottomOffsetBottom()}setStickyTopHeight(e=0){this.comp.setStickyTopHeight(`${e}px`),this.stickyTopHeight=e}getStickyTopHeight(){return this.stickyTopHeight}setStickyBottomHeight(e=0){this.comp.setStickyBottomHeight(`${e}px`),this.stickyBottomHeight=e}getStickyBottomHeight(){return this.stickyBottomHeight}setStickyWidth(e){if(e){const e=this.gos.getScrollbarWidth();this.comp.setStickyTopWidth(`calc(100% - ${e}px)`),this.comp.setStickyBottomWidth(`calc(100% - ${e}px)`)}else this.comp.setStickyTopWidth("100%"),this.comp.setStickyBottomWidth("100%")}onHeaderHeightChanged(){this.setStickyTopOffsetTop()}setStickyTopOffsetTop(){const e=this.ctrlsService.get("gridHeaderCtrl").getHeaderHeight()+(this.filterManager?.getHeaderHeight()??0),t=this.pinnedRowModel.getPinnedTopTotalHeight();let a=0;e>0&&(a+=e),t>0&&(a+=t),a>0&&(a+=1),this.comp.setStickyTopTop(`${a}px`)}setStickyBottomOffsetBottom(){const e=this.pinnedRowModel.getPinnedBottomTotalHeight()+(this.scrollVisibleService.isHorizontalScrollShowing()&&this.gos.getScrollbarWidth()||0);this.comp.setStickyBottomBottom(`${e}px`)}sizeColumnsToFit(e,t){const a=this.isVerticalScrollShowing()?this.gos.getScrollbarWidth():0,n=da(this.eGridBody)-a;n>0?this.columnSizeService.sizeColumnsToFit(n,"sizeColumnsToFit",!1,e):void 0===t?window.setTimeout((()=>{this.sizeColumnsToFit(e,100)}),0):100===t?window.';
      S = S + 'setTimeout((()=>{this.sizeColumnsToFit(e,500)}),100):500===t?window.setTimeout((()=>{this.sizeColumnsToFit(e,-1)}),500):ce("tried to call sizeColumnsToFit() but the grid is coming back with zero width, maybe the grid is not visible yet on the screen?")}addScrollEventListener(e){this.eBodyViewport.addEventListener("scroll",e,{passive:!0})}removeScrollEventListener(e){this.eBodyViewport.removeEventListener("scroll",e)}},mi=class extends Ba{constructor(e,t,a,n,o){super(),this.rendererVersion=0,this.editorVersion=0,this.beans=e,this.column=t.getColumn(),this.rowNode=t.getRowNode(),this.rowCtrl=t.getRowCtrl(),this.eRow=n,this.cellCtrl=t;const r=document.createElement("div");r.setAttribute("comp-id",`${this.getCompId()}`),this.setTemplateFromElement(r);const i=this.getGui();this.forceWrapper=t.isForceWrapper(),this.refreshWrapper(!1);const s=(e,t)=>{null!=t&&""!=t?i.setAttribute(e,t):i.removeAttribute(e)};yt(i,t.getCellAriaRole()),s("col-id",t.getColumnIdSanitised());const l=t.getTabIndex();void 0!==l&&s("tabindex",l.toString());const c={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setUserStyles:e=>Ra(i,e),getFocusableElement:()=>this.getFocusableElement(),setIncludeSelection:e=>this.includeSelection=e,setIncludeRowDrag:e=>this.includeRowDrag=e,setIncludeDndSource:e=>this.includeDndSource=e,setRenderDetails:(e,t,a)=>this.setRenderDetails(e,t,a),setEditDetails:(e,t,a)=>this.setEditDetails(e,t,a),getCellEditor:()=>this.cellEditor||null,getCellRenderer:()=>this.cellRenderer||null,getParentOfValue:()=>this.getParentOfValue()};t.setComp(c,this.getGui(),this.eCellWrapper,a,o)}getParentOfValue(){return this.eCellValue?this.eCellValue:this.eCellWrapper?this.eCellWrapper:this.getGui()}setRenderDetails(e,t,a){if(this.cellEditor&&!this.cellEditorPopupWrapper)return;this.firstRender=null==this.firstRender;const n=this.refreshWrapper(!1);if(this.refreshEditStyles(!1),e){!(a||n)&&this.refreshCellRenderer(e)||(this.destroyRenderer(),this.createCellRendererInstance(e))}else t';
      S = S + 'his.destroyRenderer(),this.insertValueWithoutCellRenderer(t)}setEditDetails(e,t,a){e?this.createCellEditorInstance(e,t,a):this.destroyEditor()}removeControls(){this.checkboxSelectionComp=this.beans.context.destroyBean(this.checkboxSelectionComp),this.dndSourceComp=this.beans.context.destroyBean(this.dndSourceComp),this.rowDraggingComp=this.beans.context.destroyBean(this.rowDraggingComp)}refreshWrapper(e){const t=this.includeRowDrag||this.includeDndSource||this.includeSelection,a=t||this.forceWrapper,n=a&&null==this.eCellWrapper;if(n){const e=document.createElement("div");e.setAttribute("role","presentation"),e.setAttribute("class","ag-cell-wrapper"),this.eCellWrapper=e,this.getGui().appendChild(this.eCellWrapper)}const o=!a&&null!=this.eCellWrapper;o&&(Ca(this.eCellWrapper),this.eCellWrapper=void 0),this.addOrRemoveCssClass("ag-cell-value",!a);const r=!e&&a,i=r&&null==this.eCellValue;if(i){const e=document.createElement("span");e.setAttribute("role","presentation"),e.setAttribute("class","ag-cell-value"),this.eCellValue=e,this.eCellWrapper.appendChild(this.eCellValue)}const s=!r&&null!=this.eCellValue;s&&(Ca(this.eCellValue),this.eCellValue=void 0);const l=n||o||i||s;return l&&this.removeControls(),e||t&&this.addControls(),l}addControls(){this.includeRowDrag&&null==this.rowDraggingComp&&(this.rowDraggingComp=this.cellCtrl.createRowDragComp(),this.rowDraggingComp&&this.eCellWrapper.insertBefore(this.rowDraggingComp.getGui(),this.eCellValue)),this.includeDndSource&&null==this.dndSourceComp&&(this.dndSourceComp=this.cellCtrl.createDndSource(),this.eCellWrapper.insertBefore(this.dndSourceComp.getGui(),this.eCellValue)),this.includeSelection&&null==this.checkboxSelectionComp&&(this.checkboxSelectionComp=this.cellCtrl.createSelectionCheckbox(),this.eCellWrapper.insertBefore(this.checkboxSelectionComp.getGui(),this.eCellValue))}createCellEditorInstance(e,t,a){const n=this.editorVersion,o=e.newAgStackInstance();if(null==o)return;const{params:r}=e;o.then((e=>this.afterCellEd';
      S = S + 'itorCreated(n,e,r,t,a)));O(this.cellEditor)&&r.cellStartedEdit&&this.cellCtrl.focusCell(!0)}insertValueWithoutCellRenderer(e){const t=this.getParentOfValue();ba(t);const a=null!=e?He(e,!0):null;null!=a&&(t.textContent=a)}destroyEditorAndRenderer(){this.destroyRenderer(),this.destroyEditor()}destroyRenderer(){const{context:e}=this.beans;this.cellRenderer=e.destroyBean(this.cellRenderer),Ca(this.cellRendererGui),this.cellRendererGui=null,this.rendererVersion++}destroyEditor(){const{context:e}=this.beans;this.hideEditorPopup&&this.hideEditorPopup(),this.hideEditorPopup=void 0,this.cellEditor=e.destroyBean(this.cellEditor),this.cellEditorPopupWrapper=e.destroyBean(this.cellEditorPopupWrapper),Ca(this.cellEditorGui),this.cellEditorGui=null,this.editorVersion++}refreshCellRenderer(e){if(null==this.cellRenderer||null==this.cellRenderer.refresh)return!1;if(this.cellRendererClass!==e.componentClass)return!1;const t=this.cellRenderer.refresh(e.params);return!0===t||void 0===t}createCellRendererInstance(e){const t=!this.beans.gos.get("suppressAnimationFrame"),a=this.rendererVersion,{componentClass:n}=e,o=()=>{if(this.rendererVersion!==a||!this.isAlive())return;const t=e.newAgStackInstance(),o=this.afterCellRendererCreated.bind(this,a,n);t&&t.then(o)};t&&this.firstRender?this.beans.animationFrameService.createTask(o,this.rowNode.rowIndex,"createTasksP2"):o()}getCtrl(){return this.cellCtrl}getRowCtrl(){return this.rowCtrl}getCellRenderer(){return this.cellRenderer}getCellEditor(){return this.cellEditor}afterCellRendererCreated(e,t,a){if(!this.isAlive()||e!==this.rendererVersion)this.beans.context.destroyBean(a);else if(this.cellRenderer=a,this.cellRendererClass=t,this.cellRendererGui=this.cellRenderer.getGui(),null!=this.cellRendererGui){const e=this.getParentOfValue();ba(e),e.appendChild(this.cellRendererGui)}}afterCellEditorCreated(e,t,a,n,o){if(e!==this.editorVersion)return void this.beans.context.destroyBean(t);if(t.isCancelBeforeStart&&t.isCancelBeforeStart())return this.be';
      S = S + 'ans.context.destroyBean(t),void this.cellCtrl.stopEditing(!0);if(!t.getGui)return ce(`cellEditor for column ${this.column.getId()} is missing getGui() method`),void this.beans.context.destroyBean(t);this.cellEditor=t,this.cellEditorGui=t.getGui();const r=n||void 0!==t.isPopup&&t.isPopup();r?this.addPopupCellEditor(a,o):this.addInCellEditor(),this.refreshEditStyles(!0,r),t.afterGuiAttached&&t.afterGuiAttached()}refreshEditStyles(e,t){this.addOrRemoveCssClass("ag-cell-inline-editing",e&&!t),this.addOrRemoveCssClass("ag-cell-popup-editing",e&&!!t),this.addOrRemoveCssClass("ag-cell-not-inline-editing",!e||!!t),this.rowCtrl?.setInlineEditingCss(e)}addInCellEditor(){const e=this.getGui();if(e.contains(this.beans.gos.getActiveDomElement())&&e.focus(),this.destroyRenderer(),this.refreshWrapper(!0),this.clearParentOfValue(),this.cellEditorGui){this.getParentOfValue().appendChild(this.cellEditorGui)}}addPopupCellEditor(e,t){"fullRow"===this.beans.gos.get("editType")&&ce("popup cellEditor does not work with fullRowEdit - you cannot use them both - either turn off fullRowEdit, or stop using popup editors.");const a=this.cellEditor;this.cellEditorPopupWrapper=this.beans.context.createBean(this.beans.editService.createPopupEditorWrapper(e));const n=this.cellEditorPopupWrapper.getGui();this.cellEditorGui&&n.appendChild(this.cellEditorGui);const o=this.beans.popupService,r=this.beans.gos.get("stopEditingWhenCellsLoseFocus"),i=null!=t?t:a.getPopupPosition?a.getPopupPosition():"over",s=this.beans.gos.get("enableRtl"),l={ePopup:n,column:this.column,rowNode:this.rowNode,type:"popupCellEditor",eventSource:this.getGui(),position:i,alignSide:s?"right":"left",keepWithinBounds:!0},c=o.positionPopupByComponent.bind(o,l),g=this.beans.localeService.getLocaleTextFunc(),d=o.addPopup({modal:r,eChild:n,closeOnEsc:!0,closedCallback:()=>{this.cellCtrl.onPopupEditorClosed()},anchorToElement:this.getGui(),positionCallback:c,ariaLabel:g("ariaLabelCellEditor","Cell Editor")});d&&(this.hideEditorPopup=d.';
      S = S + 'hideFunc)}detach(){this.eRow.removeChild(this.getGui())}destroy(){this.cellCtrl.stopEditing(),this.destroyEditorAndRenderer(),this.removeControls(),super.destroy()}clearParentOfValue(){const e=this.getGui();e.contains(this.beans.gos.getActiveDomElement())&&Xt()&&e.focus({preventScroll:!0}),ba(this.getParentOfValue())}},fi=class extends Ba{constructor(e,t,a){super(),this.cellComps={},this.beans=t,this.rowCtrl=e;const n=document.createElement("div");n.setAttribute("comp-id",`${this.getCompId()}`),n.setAttribute("style",this.getInitialStyle(a)),this.setTemplateFromElement(n);const o=this.getGui(),r=o.style;this.domOrder=this.rowCtrl.getDomOrder(),yt(o,"row");const i=this.rowCtrl.getTabIndex();null!=i&&o.setAttribute("tabindex",i.toString());const s={setDomOrder:e=>this.domOrder=e,setCellCtrls:e=>this.setCellCtrls(e),showFullWidth:e=>this.showFullWidth(e),getFullWidthCellRenderer:()=>this.getFullWidthCellRenderer(),addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setUserStyles:e=>Ra(o,e),setTop:e=>r.top=e,setTransform:e=>r.transform=e,setRowIndex:e=>o.setAttribute("row-index",e),setRowId:e=>o.setAttribute("row-id",e),setRowBusinessKey:e=>o.setAttribute("row-business-key",e),refreshFullWidth:e=>this.refreshFullWidth(e)};e.setComp(s,this.getGui(),a),this.addDestroyFunc((()=>{e.unsetComp(a)}))}getInitialStyle(e){const t=this.rowCtrl.getInitialTransform(e);return t?`transform: ${t}`:`top: ${this.rowCtrl.getInitialRowTop(e)}`}showFullWidth(e){const t=e.newAgStackInstance();t&&t.then((e=>{if(this.isAlive()){const t=e.getGui();this.getGui().appendChild(t),this.rowCtrl.setupDetailRowAutoHeight(t),this.setFullWidthRowComp(e)}else this.beans.context.destroyBean(e)}))}setCellCtrls(e){const t=Object.assign({},this.cellComps);e.forEach((e=>{const a=e.getInstanceId();null==this.cellComps[a]?this.newCellComp(e):t[a]=null}));const a=Y(t).filter((e=>null!=e));this.destroyCells(a),this.ensureDomOrder(e)}ensureDomOrder(e){if(!this.domOrder)return;const t=[];e.forEach((e=>{const a=';
      S = S + 'this.cellComps[e.getInstanceId()];a&&t.push(a.getGui())})),xa(this.getGui(),t)}newCellComp(e){const t=new mi(this.beans,e,this.rowCtrl.isPrintLayout(),this.getGui(),this.rowCtrl.isEditing());this.cellComps[e.getInstanceId()]=t,this.getGui().appendChild(t.getGui())}destroy(){super.destroy(),this.destroyAllCells()}destroyAllCells(){const e=Y(this.cellComps).filter((e=>null!=e));this.destroyCells(e)}setFullWidthRowComp(e){this.fullWidthCellRenderer&&ge("should not be setting fullWidthRowComponent twice"),this.fullWidthCellRenderer=e,this.addDestroyFunc((()=>{this.fullWidthCellRenderer=this.beans.context.destroyBean(this.fullWidthCellRenderer)}))}getFullWidthCellRenderer(){return this.fullWidthCellRenderer}destroyCells(e){e.forEach((e=>{if(!e)return;const t=e.getCtrl().getInstanceId();this.cellComps[t]===e&&(e.detach(),e.destroy(),this.cellComps[t]=null)}))}refreshFullWidth(e){const{fullWidthCellRenderer:t}=this;if(!t||!t.refresh)return!1;const a=e();return t.refresh(a)}},vi=class extends A{wireBeans(e){this.ctrlsService=e.ctrlsService,this.pinnedWidthService=e.pinnedWidthService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.columnSizeService=e.columnSizeService,this.scrollVisibleService=e.scrollVisibleService,this.columnViewportService=e.columnViewportService}constructor(e){super(),this.centerContainerCtrl=e}postConstruct(){this.ctrlsService.whenReady((e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.listenForResize()})),this.addManagedEventListeners({scrollbarWidthChanged:this.onScrollbarWidthChanged.bind(this)}),this.addManagedPropertyListeners(["alwaysShowHorizontalScroll","alwaysShowVerticalScroll"],(()=>{this.checkViewportAndScrolls()}))}listenForResize(){const e=()=>this.onCenterViewportResized();this.centerContainerCtrl.registerViewportResizeListener(e),this.gridBodyCtrl.registerBodyViewportResizeListener(e)}onScrollbarWidthChanged(){this.checkViewportAndScrolls()}onCenterViewportResized(){if(this.centerContainerCtrl.isViewportInTheDO';
      S = S + 'MTree()){this.keepPinnedColumnsNarrowerThanViewport(),this.checkViewportAndScrolls();const e=this.centerContainerCtrl.getCenterWidth();e!==this.centerWidth&&(this.centerWidth=e,this.columnSizeService.refreshFlexedColumns({viewportWidth:this.centerWidth,updateBodyWidths:!0,fireResizedEvent:!0}))}else this.bodyHeight=0}keepPinnedColumnsNarrowerThanViewport(){const e=da(this.gridBodyCtrl.getBodyViewportElement());if(e<=50)return;let t=this.getPinnedColumnsOverflowingViewport(e-50);const a=this.gos.getCallback("processUnpinnedColumns");if(t.length){if(a){t=a({columns:t,viewportWidth:e})}this.columnModel.setColsPinned(t,null,"viewportSizeFeature")}}getPinnedColumnsOverflowingViewport(e){const t=this.pinnedWidthService.getPinnedRightWidth()+this.pinnedWidthService.getPinnedLeftWidth();if(t<e)return[];const a=[...this.visibleColsService.getLeftCols()],n=[...this.visibleColsService.getRightCols()];let o=0,r=0;const i=[];let s=t-0-e;for(;(r<a.length||o<n.length)&&s>0;){if(o<n.length){const e=n[o++];s-=e.getActualWidth(),i.push(e)}if(r<a.length&&s>0){const e=a[r++];s-=e.getActualWidth(),i.push(e)}}return i}checkViewportAndScrolls(){this.updateScrollVisibleService(),this.checkBodyHeight(),this.onHorizontalViewportChanged(),this.gridBodyCtrl.getScrollFeature().checkScrollLeft()}getBodyHeight(){return this.bodyHeight}checkBodyHeight(){const e=ga(this.gridBodyCtrl.getBodyViewportElement());if(this.bodyHeight!==e){this.bodyHeight=e;const t={type:"bodyHeightChanged"};this.eventService.dispatchEvent(t)}}updateScrollVisibleService(){this.updateScrollVisibleServiceImpl(),setTimeout(this.updateScrollVisibleServiceImpl.bind(this),500)}updateScrollVisibleServiceImpl(){const e={horizontalScrollShowing:this.isHorizontalScrollShowing(),verticalScrollShowing:this.gridBodyCtrl.isVerticalScrollShowing()};this.scrollVisibleService.setScrollsVisible(e)}isHorizontalScrollShowing(){return this.centerContainerCtrl.isHorizontalScrollShowing()}onHorizontalViewportChanged(){const e=this.centerContaine';
      S = S + 'rCtrl.getCenterWidth(),t=this.centerContainerCtrl.getViewportScrollLeft();this.columnViewportService.setScrollPosition(e,t)}},bi=class extends A{wireBeans(e){this.dragService=e.dragService,this.rangeService=e.rangeService}constructor(e){super(),this.eContainer=e}postConstruct(){if(!this.rangeService)return;this.params={eElement:this.eContainer,onDragStart:this.rangeService.onDragStart.bind(this.rangeService),onDragStop:this.rangeService.onDragStop.bind(this.rangeService),onDragging:this.rangeService.onDragging.bind(this.rangeService)},this.addManagedPropertyListener("enableRangeSelection",(e=>{e.currentValue?this.enableFeature():this.disableFeature()})),this.addDestroyFunc((()=>this.disableFeature()));this.gos.get("enableRangeSelection")&&this.enableFeature()}enableFeature(){this.dragService.addDragSource(this.params)}disableFeature(){this.dragService.removeDragSource(this.params)}},Ci=class extends Ba{constructor(){super(\'\\n            <div class="ag-selection-checkbox" role="presentation">\\n                <ag-checkbox role="presentation" data-ref="eCheckbox"></ag-checkbox>\\n            </div>\',[sn]),this.eCheckbox=qa}postConstruct(){this.eCheckbox.setPassive(!0)}getCheckboxId(){return this.eCheckbox.getInputElement().id}onDataChanged(){this.onSelectionChanged()}onSelectableChanged(){this.showOrHideSelect()}onSelectionChanged(){const e=this.localeService.getLocaleTextFunc(),t=this.rowNode.isSelected(),a=jt(e,t),[n,o]=this.rowNode.selectable?["ariaRowToggleSelection","Press Space to toggle row selection"]:["ariaRowSelectionDisabled","Row Selection is disabled for this row"],r=e(n,o);this.eCheckbox.setValue(t,!0),this.eCheckbox.setInputAriaLabel(`${r} (${a})`)}onClicked(e,t,a){return this.rowNode.setSelectedParams({newValue:e,rangeSelect:a.shiftKey,groupSelectsFiltered:t,event:a,source:"checkboxSelected"})}init(e){this.rowNode=e.rowNode,this.column=e.column,this.overrides=e.overrides,this.onSelectionChanged(),this.addManagedListeners(this.eCheckbox.getInputElement()';
      S = S + ',{dblclick:e=>F(e),click:e=>{F(e);const t=this.gos.get("groupSelectsFiltered"),a=this.eCheckbox.getValue();if(this.shouldHandleIndeterminateState(a,t)){0===this.onClicked(!0,t,e||{})&&this.onClicked(!1,t,e)}else a?this.onClicked(!1,t,e):this.onClicked(!0,t,e||{})}}),this.addManagedListeners(this.rowNode,{rowSelected:this.onSelectionChanged.bind(this),dataChanged:this.onDataChanged.bind(this),selectableChanged:this.onSelectableChanged.bind(this)});if(this.gos.get("isRowSelectable")||"function"==typeof this.getIsVisible()){const e=this.showOrHideSelect.bind(this);this.addManagedEventListeners({displayedColumnsChanged:e}),this.addManagedListeners(this.rowNode,{dataChanged:e,cellChanged:e}),this.showOrHideSelect()}this.eCheckbox.getInputElement().setAttribute("tabindex","-1")}shouldHandleIndeterminateState(e,t){return t&&(void 0===this.eCheckbox.getPreviousValue()||void 0===e)&&this.gos.isRowModelType("clientSide")}showOrHideSelect(){let e=this.rowNode.selectable;const t=this.getIsVisible();if(e)if("function"==typeof t){const a=this.overrides?.callbackParams;if(this.column){const n=this.column.createColumnFunctionCallbackParams(this.rowNode);e=t({...a,...n})}else e=t({...a,node:this.rowNode,data:this.rowNode.data})}else e=t??!1;const a=this.column?.getColDef().showDisabledCheckboxes;if(a)return this.eCheckbox.setDisabled(!e),this.setVisible(!0),void this.setDisplayed(!0);this.overrides?.removeHidden?this.setDisplayed(e):this.setVisible(e)}getIsVisible(){return this.overrides?this.overrides.isVisible:this.column?.getColDef()?.checkboxSelection}},wi=class extends Ba{constructor(e,t,a){super(\'<div class="ag-drag-handle ag-row-drag" draggable="true"></div>\'),this.rowNode=e,this.column=t,this.eCell=a}postConstruct(){this.getGui().appendChild(Wa("rowDrag",this.gos,null)),this.addGuiEventListener("mousedown",(e=>{e.stopPropagation()})),this.addDragSource(),this.checkVisibility()}addDragSource(){this.addGuiEventListener("dragstart",this.onDragStart.bind(this))}onDragStart(e){co';
      S = S + 'nst t=this.column.getColDef().dndSourceOnRowDrag;e.dataTransfer.setDragImage(this.eCell,0,0);const a=()=>{try{const t=JSON.stringify(this.rowNode.data);e.dataTransfer.setData("application/json",t),e.dataTransfer.setData("text/plain",t)}catch(e){}};if(t){t(this.gos.addGridCommonParams({rowNode:this.rowNode,dragEvent:e}))}else a()}checkVisibility(){const e=this.column.isDndSource(this.rowNode);this.setDisplayed(e)}},yi=class extends A{constructor(e,t){super(),this.staticClasses=[],this.cellCtrl=e,this.beans=t,this.column=e.getColumn(),this.rowNode=e.getRowNode()}setComp(e){this.cellComp=e,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){const e=this.column.getColDef(),{cellClassRules:t}=e,a=this.beans.gos.addGridCommonParams({value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,colDef:e,column:this.column,rowIndex:this.rowNode.rowIndex});this.beans.stylingService.processClassRules(t===this.cellClassRules?void 0:this.cellClassRules,t,a,(e=>this.cellComp.addOrRemoveCssClass(e,!0)),(e=>this.cellComp.addOrRemoveCssClass(e,!1))),this.cellClassRules=t}applyUserStyles(){const e=this.column.getColDef();if(!e.cellStyle)return;let t;if("function"==typeof e.cellStyle){const a=this.beans.gos.addGridCommonParams({column:this.column,value:this.cellCtrl.getValue(),colDef:e,data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex});t=(0,e.cellStyle)(a)}else t=e.cellStyle;t&&this.cellComp.setUserStyles(t)}applyClassesFromColDef(){const e=this.column.getColDef(),t=this.beans.gos.addGridCommonParams({value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,column:this.column,colDef:e,rowIndex:this.rowNode.rowIndex});this.staticClasses.length&&this.staticClasses.forEach((e=>this.cellComp.addOrRemoveCssClass(e,!1))),this.staticClasses=this.beans.stylingService.getStaticCellClasses(e,t),this.staticClasses.length&&this.staticClasses.forEach((e=>this.cellComp.addOrRemoveCssClass(e,!0)))}dest';
      S = S + 'roy(){super.destroy()}},Si=class extends A{constructor(e,t,a,n,o){super(),this.cellCtrl=e,this.beans=t,this.rowNode=n,this.rowCtrl=o}setComp(e){this.eGui=e}onKeyDown(e){const t=e.key;switch(t){case tn.ENTER:this.onEnterKeyDown(e);break;case tn.F2:this.onF2KeyDown(e);break;case tn.ESCAPE:this.onEscapeKeyDown(e);break;case tn.TAB:this.onTabKeyDown(e);break;case tn.BACKSPACE:case tn.DELETE:this.onBackspaceOrDeleteKeyDown(t,e);break;case tn.DOWN:case tn.UP:case tn.RIGHT:case tn.LEFT:this.onNavigationKeyDown(e,t)}}onNavigationKeyDown(e,t){this.cellCtrl.isEditing()||(e.shiftKey&&this.cellCtrl.isRangeSelectionEnabled()?this.onShiftRangeSelect(e):this.beans.navigationService.navigateToNextCell(e,t,this.cellCtrl.getCellPosition(),!0),e.preventDefault())}onShiftRangeSelect(e){if(!this.beans.rangeService)return;const t=this.beans.rangeService.extendLatestRangeInDirection(e);t&&this.beans.navigationService.ensureCellVisible(t)}onTabKeyDown(e){this.beans.navigationService.onTabKeyDown(this.cellCtrl,e)}onBackspaceOrDeleteKeyDown(e,t){const{cellCtrl:a,beans:n,rowNode:o}=this,{gos:r,rangeService:i,eventService:s}=n;if(!a.isEditing()){if(s.dispatchEvent({type:"keyShortcutChangedCellStart"}),function(e,t=!1){return e===tn.DELETE||!t&&e===tn.BACKSPACE&&Jt()}(e,r.get("enableCellEditingOnBackspace"))){if(i&&r.get("enableRangeSelection"))i.clearCellRangeCellValues({dispatchWrapperEvents:!0,wrapperEventSource:"deleteKey"});else if(a.isCellEditable()){const e=a.getColumn(),t=this.beans.valueService.parseValue(e,o,"",o.getValueFromValueService(e))??null;o.setDataValue(e,t,"cellClear")}}else a.startRowOrCellEdit(e,t);s.dispatchEvent({type:"keyShortcutChangedCellEnd"})}}onEnterKeyDown(e){if(this.cellCtrl.isEditing()||this.rowCtrl.isEditing())this.cellCtrl.stopEditingAndFocus(!1,e.shiftKey);else if(this.beans.gos.get("enterNavigatesVertically")){const t=e.shiftKey?tn.UP:tn.DOWN;this.beans.navigationService.navigateToNextCell(null,t,this.cellCtrl.getCellPosition(),!1)}else this.cellCtrl.startRo';
      S = S + 'wOrCellEdit(tn.ENTER,e),this.cellCtrl.isEditing()&&e.preventDefault()}onF2KeyDown(e){this.cellCtrl.isEditing()||this.cellCtrl.startRowOrCellEdit(tn.F2,e)}onEscapeKeyDown(e){this.cellCtrl.isEditing()&&(this.cellCtrl.stopRowOrCellEdit(!0),this.cellCtrl.focusCell(!0))}processCharacter(e){if(e.target!==this.eGui||this.cellCtrl.isEditing())return;const t=e.key;" "===t?this.onSpaceKeyDown(e):(this.cellCtrl.startRowOrCellEdit(t,e),e.preventDefault())}onSpaceKeyDown(e){const{gos:t}=this.beans;if(!this.cellCtrl.isEditing()&&t.isRowSelection()){const a=this.rowNode.isSelected(),n=!a;if(n||!t.get("suppressRowDeselection")){const t=this.beans.gos.get("groupSelectsFiltered"),o=this.rowNode.setSelectedParams({newValue:n,rangeSelect:e.shiftKey,groupSelectsFiltered:t,event:e,source:"spaceKey"});void 0===a&&0===o&&this.rowNode.setSelectedParams({newValue:!1,rangeSelect:e.shiftKey,groupSelectsFiltered:t,event:e,source:"spaceKey"})}}e.preventDefault()}destroy(){super.destroy()}},ki=class extends A{constructor(e,t,a){super(),this.cellCtrl=e,this.beans=t,this.column=a}onMouseEvent(e,t){if(!M(t))switch(e){case"click":this.onCellClicked(t);break;case"mousedown":case"touchstart":this.onMouseDown(t);break;case"dblclick":this.onCellDoubleClicked(t);break;case"mouseout":this.onMouseOut(t);break;case"mouseover":this.onMouseOver(t)}}onCellClicked(e){if(this.isDoubleClickOnIPad())return this.onCellDoubleClicked(e),void e.preventDefault();const{eventService:t,rangeService:a,gos:n}=this.beans,o=e.ctrlKey||e.metaKey;a&&o&&a.getCellRangeCount(this.cellCtrl.getCellPosition())>1&&a.intersectLastRange(!0);const r=this.cellCtrl.createEvent(e,"cellClicked");t.dispatchEvent(r);const i=this.column.getColDef();i.onCellClicked&&window.setTimeout((()=>{this.beans.frameworkOverrides.wrapOutgoing((()=>{i.onCellClicked(r)}))}),0);!((n.get("singleClickEdit")||i.singleClickEdit)&&!n.get("suppressClickEdit"))||e.shiftKey&&0!=a?.getCellRanges().length||this.cellCtrl.startRowOrCellEdit()}isDoubleClickOnIPad(){if(!Zt(';
      S = S + ')||D("dblclick"))return!1;const e=(new Date).getTime(),t=e-this.lastIPadMouseClickEvent<200;return this.lastIPadMouseClickEvent=e,t}onCellDoubleClicked(e){const t=this.column.getColDef(),a=this.cellCtrl.createEvent(e,"cellDoubleClicked");this.beans.eventService.dispatchEvent(a),"function"==typeof t.onCellDoubleClicked&&window.setTimeout((()=>{this.beans.frameworkOverrides.wrapOutgoing((()=>{t.onCellDoubleClicked(a)}))}),0);!this.beans.gos.get("singleClickEdit")&&!this.beans.gos.get("suppressClickEdit")&&this.cellCtrl.startRowOrCellEdit(null,e)}onMouseDown(e){const{ctrlKey:t,metaKey:a,shiftKey:n}=e,o=e.target,{cellCtrl:r,beans:i}=this,{eventService:s,rangeService:l,focusService:c}=i;if(this.isRightClickInExistingRange(e))return;const g=l&&0!=l.getCellRanges().length;if(!n||!g){const e=Kt()&&!r.isEditing()&&!oa(o);r.focusCell(e)}if(n&&g&&!c.isCellFocused(r.getCellPosition())){e.preventDefault();const t=c.getFocusedCell();if(t){const{column:e,rowIndex:a,rowPinned:n}=t,o=i.rowRenderer.getRowByPosition({rowIndex:a,rowPinned:n}),r=o?.getCellCtrl(e);r?.isEditing()&&r.stopEditing(),c.setFocusedCell({column:e,rowIndex:a,rowPinned:n,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}}if(!this.containsWidget(o)){if(l){const e=this.cellCtrl.getCellPosition();if(n)l.extendLatestRangeToCell(e);else{const n=t||a;l.setRangeToCell(e,n)}}s.dispatchEvent(this.cellCtrl.createEvent(e,"cellMouseDown"))}}isRightClickInExistingRange(e){const{rangeService:t}=this.beans;if(t){const a=t.isCellInAnyRange(this.cellCtrl.getCellPosition()),n=2===e.button||e.ctrlKey&&this.beans.gos.get("allowContextMenuWithControlKey");if(a&&n)return!0}return!1}containsWidget(e){return la(e,"ag-selection-checkbox",3)}onMouseOut(e){if(this.mouseStayingInsideCell(e))return;const t=this.cellCtrl.createEvent(e,"cellMouseOut");this.beans.eventService.dispatchEvent(t),this.beans.columnHoverService.clearMouseOver()}onMouseOver(e){if(this.mouseStayingInsideCell(e))return;const t=this.cellCtrl.createEvent(e,"cellMouseOv';
      S = S + 'er");this.beans.eventService.dispatchEvent(t),this.beans.columnHoverService.setMouseOver([this.column])}mouseStayingInsideCell(e){if(!e.target||!e.relatedTarget)return!1;const t=this.cellCtrl.getGui(),a=t.contains(e.target),n=t.contains(e.relatedTarget);return a&&n}destroy(){super.destroy()}},xi=class extends A{constructor(e,t){super(),this.cellCtrl=e,this.beans=t,this.column=e.getColumn(),this.rowNode=e.getRowNode()}setupRowSpan(){this.rowSpan=this.column.getRowSpan(this.rowNode),this.addManagedListeners(this.beans.eventService,{newColumnsLoaded:()=>this.onNewColumnsLoaded()})}setComp(e){this.eGui=e,this.setupColSpan(),this.setupRowSpan(),this.onLeftChanged(),this.onWidthChanged(),this.applyRowSpan()}onNewColumnsLoaded(){const e=this.column.getRowSpan(this.rowNode);this.rowSpan!==e&&(this.rowSpan=e,this.applyRowSpan(!0))}onDisplayColumnsChanged(){const e=this.getColSpanningList();h(this.colsSpanning,e)||(this.colsSpanning=e,this.onWidthChanged(),this.onLeftChanged())}setupColSpan(){null!=this.column.getColDef().colSpan&&(this.colsSpanning=this.getColSpanningList(),this.addManagedListeners(this.beans.eventService,{displayedColumnsChanged:this.onDisplayColumnsChanged.bind(this),displayedColumnsWidthChanged:this.onWidthChanged.bind(this)}))}onWidthChanged(){if(!this.eGui)return;const e=this.getCellWidth();this.eGui.style.width=`${e}px`}getCellWidth(){return this.colsSpanning?this.colsSpanning.reduce(((e,t)=>e+t.getActualWidth()),0):this.column.getActualWidth()}getColSpanningList(){const e=this.column.getColSpan(this.rowNode),t=[];if(1===e)t.push(this.column);else{let a=this.column;const n=this.column.getPinned();for(let o=0;a&&o<e&&(t.push(a),a=this.beans.visibleColsService.getColAfter(a),a&&!O(a))&&n===a.getPinned();o++);}return t}onLeftChanged(){if(!this.eGui)return;const e=this.modifyLeftForPrintLayout(this.getCellLeft());this.eGui.style.left=e+"px"}getCellLeft(){let e;return e=this.beans.gos.get("enableRtl")&&this.colsSpanning?d(this.colsSpanning):this.column,e.ge';
      S = S + 'tLeft()}modifyLeftForPrintLayout(e){if(!this.cellCtrl.isPrintLayout()||"left"===this.column.getPinned())return e;const t=this.beans.visibleColsService.getColsLeftWidth();if("right"===this.column.getPinned()){return t+this.beans.visibleColsService.getBodyContainerWidth()+(e||0)}return t+(e||0)}applyRowSpan(e){if(1===this.rowSpan&&!e)return;const t=this.beans.gos.getRowHeightAsNumber()*this.rowSpan;this.eGui.style.height=`${t}px`,this.eGui.style.zIndex="1"}destroy(){super.destroy()}},Ri=(e=>(e[e.FILL=0]="FILL",e[e.RANGE=1]="RANGE",e))(Ri||{}),zi=(e=>(e[e.VALUE=0]="VALUE",e[e.DIMENSION=1]="DIMENSION",e))(zi||{}),Fi="ag-cell-range-selected",Mi=class{constructor(e,t){this.beans=e,this.rangeService=e.rangeService,this.selectionHandleFactory=e.selectionHandleFactory,this.cellCtrl=t}setComp(e,t){this.cellComp=e,this.eGui=t,this.onRangeSelectionChanged()}onRangeSelectionChanged(){this.cellComp&&(this.rangeCount=this.rangeService.getCellRangeCount(this.cellCtrl.getCellPosition()),this.hasChartRange=this.getHasChartRange(),this.cellComp.addOrRemoveCssClass(Fi,0!==this.rangeCount),this.cellComp.addOrRemoveCssClass(`${Fi}-1`,1===this.rangeCount),this.cellComp.addOrRemoveCssClass(`${Fi}-2`,2===this.rangeCount),this.cellComp.addOrRemoveCssClass(`${Fi}-3`,3===this.rangeCount),this.cellComp.addOrRemoveCssClass(`${Fi}-4`,this.rangeCount>=4),this.cellComp.addOrRemoveCssClass("ag-cell-range-chart",this.hasChartRange),Vt(this.eGui,this.rangeCount>0||void 0),this.cellComp.addOrRemoveCssClass("ag-cell-range-single-cell",this.isSingleCell()),this.updateRangeBorders(),this.refreshHandle())}updateRangeBorders(){const e=this.getRangeBorders(),t=this.isSingleCell(),a=!t&&e.top,n=!t&&e.right,o=!t&&e.bottom,r=!t&&e.left;this.cellComp.addOrRemoveCssClass("ag-cell-range-top",a),this.cellComp.addOrRemoveCssClass("ag-cell-range-right",n),this.cellComp.addOrRemoveCssClass("ag-cell-range-bottom",o),this.cellComp.addOrRemoveCssClass("ag-cell-range-left",r)}isSingleCell(){const{rangeService:e}=this.bean';
      S = S + 's;return 1===this.rangeCount&&!!e&&!e.isMoreThanOneCell()}getHasChartRange(){const{rangeService:e}=this.beans;if(!this.rangeCount||!e)return!1;const t=e.getCellRanges();return t.length>0&&t.every((e=>w([1,0],e.type)))}updateRangeBordersIfRangeCount(){this.rangeCount>0&&(this.updateRangeBorders(),this.refreshHandle())}getRangeBorders(){const e=this.beans.gos.get("enableRtl");let t=!1,a=!1,n=!1,o=!1;const r=this.cellCtrl.getCellPosition().column,i=this.beans.visibleColsService;let s,l;e?(s=i.getColAfter(r),l=i.getColBefore(r)):(s=i.getColBefore(r),l=i.getColAfter(r));const c=this.rangeService.getCellRanges().filter((e=>this.rangeService.isCellInSpecificRange(this.cellCtrl.getCellPosition(),e)));s||(o=!0),l||(a=!0);for(let e=0;e<c.length&&!(t&&a&&n&&o);e++){const r=c[e],i=this.rangeService.getRangeStartRow(r),g=this.rangeService.getRangeEndRow(r);!t&&this.beans.rowPositionUtils.sameRow(i,this.cellCtrl.getCellPosition())&&(t=!0),!n&&this.beans.rowPositionUtils.sameRow(g,this.cellCtrl.getCellPosition())&&(n=!0),!o&&s&&r.columns.indexOf(s)<0&&(o=!0),!a&&l&&r.columns.indexOf(l)<0&&(a=!0)}return{top:t,right:a,bottom:n,left:o}}refreshHandle(){if(this.beans.context.isDestroyed())return;const e=this.shouldHaveSelectionHandle();this.selectionHandle&&!e&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),e&&this.addSelectionHandle(),this.cellComp.addOrRemoveCssClass("ag-cell-range-handle",!!this.selectionHandle)}shouldHaveSelectionHandle(){const e=this.beans.gos,t=this.rangeService.getCellRanges(),a=t.length;if(this.rangeCount<1||a<1)return!1;const n=d(t),o=this.cellCtrl.getCellPosition(),r=e.get("enableFillHandle")&&!this.cellCtrl.isSuppressFillHandle(),i=e.get("enableRangeHandle");let s=1===a&&!this.cellCtrl.isEditing()&&(r||i);if(this.hasChartRange){const e=1===t[0].type&&this.rangeService.isCellInSpecificRange(o,t[0]);this.cellComp.addOrRemoveCssClass("ag-cell-range-chart-category",e),s=0===n.type}return s&&null!=n.endRow&&this.rangeService.isContigu';
      S = S + 'ousRange(n)&&this.rangeService.isBottomRightCell(n,o)}addSelectionHandle(){const e=this.beans.gos,t=d(this.rangeService.getCellRanges()).type,a=e.get("enableFillHandle")&&O(t)?0:1;this.selectionHandle&&this.selectionHandle.getType()!==a&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),this.selectionHandle||(this.selectionHandle=this.selectionHandleFactory.createSelectionHandle(a)),this.selectionHandle.refresh(this.cellCtrl)}destroy(){this.beans.context.destroyBean(this.selectionHandle)}},Di=0,Ei=class e extends A{constructor(e,t,a,n){super(),this.column=e,this.rowNode=t,this.beans=a,this.rowCtrl=n,this.cellRangeFeature=null,this.cellPositionFeature=null,this.cellCustomStyleFeature=null,this.tooltipFeature=null,this.cellMouseListenerFeature=null,this.cellKeyboardListenerFeature=null,this.suppressRefreshCell=!1,this.onCellCompAttachedFuncs=[],this.instanceId=e.getId()+"-"+Di++,this.colIdSanitised=He(this.column.getId()),a.gos.get("suppressCellFocus")||(this.tabIndex=-1),this.createCellPosition(),this.addFeatures(),this.updateAndFormatValue(!1)}shouldRestoreFocus(){return this.beans.focusService.shouldRestoreFocus(this.cellPosition)}addFeatures(){this.cellPositionFeature=new xi(this,this.beans),this.addDestroyFunc((()=>{this.cellPositionFeature?.destroy(),this.cellPositionFeature=null})),this.cellCustomStyleFeature=new yi(this,this.beans),this.addDestroyFunc((()=>{this.cellCustomStyleFeature?.destroy(),this.cellCustomStyleFeature=null})),this.cellMouseListenerFeature=new ki(this,this.beans,this.column),this.addDestroyFunc((()=>{this.cellMouseListenerFeature?.destroy(),this.cellMouseListenerFeature=null})),this.cellKeyboardListenerFeature=new Si(this,this.beans,this.column,this.rowNode,this.rowCtrl),this.addDestroyFunc((()=>{this.cellKeyboardListenerFeature?.destroy(),this.cellKeyboardListenerFeature=null})),this.column.isTooltipEnabled()&&(this.enableTooltipFeature(),this.addDestroyFunc((()=>{this.disableTooltipFeature()})));this.beans.range';
      S = S + 'Service&&this.beans.gos.get("enableRangeSelection")&&(this.cellRangeFeature=new Mi(this.beans,this),this.addDestroyFunc((()=>{this.cellRangeFeature?.destroy(),this.cellRangeFeature=null})))}enableTooltipFeature(e,t){const a="whenTruncated"===this.beans.gos.get("tooltipShowMode");t||!a||this.isCellRenderer()||(t=()=>{const e=this.getGui(),t=0===e.children.length?e:e.querySelector(".ag-cell-value");return!t||t.scrollWidth>t.clientWidth});const n={getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getRowIndex:()=>this.cellPosition.rowIndex,getRowNode:()=>this.rowNode,getGui:()=>this.getGui(),getLocation:()=>"cell",getTooltipValue:null!=e?()=>e:()=>{const e=this.column.getColDef(),t=this.rowNode.data;if(e.tooltipField&&L(t))return J(t,e.tooltipField,this.column.isTooltipFieldContainsDots());const a=e.tooltipValueGetter;return a?a(this.beans.gos.addGridCommonParams({location:"cell",colDef:this.column.getColDef(),column:this.column,rowIndex:this.cellPosition.rowIndex,node:this.rowNode,data:this.rowNode.data,value:this.value,valueFormatted:this.valueFormatted})):null},getValueFormatted:()=>this.valueFormatted,shouldDisplayTooltip:t};this.tooltipFeature=new Na(n,this.beans)}disableTooltipFeature(){this.tooltipFeature&&(this.tooltipFeature.destroy(),this.tooltipFeature=null)}setComp(e,t,a,n,o){this.cellComp=e,this.eGui=t,this.printLayout=n,this.addDomData(),this.onCellFocused(this.focusEventToRestore),this.applyStaticCssClasses(),this.setWrapText(),this.onFirstRightPinnedChanged(),this.onLastLeftPinnedChanged(),this.onColumnHover(),this.setupControlComps(),this.setupAutoHeight(a),this.refreshFirstAndLastStyles(),this.refreshAriaColIndex(),this.cellPositionFeature?.setComp(t),this.cellCustomStyleFeature?.setComp(e),this.tooltipFeature?.refreshToolTip(),this.cellKeyboardListenerFeature?.setComp(this.eGui),this.cellRangeFeature&&this.cellRangeFeature.setComp(e,t),o&&this.isCellEditable()?this.startEditing():this.showValue(),this.onCellCompAttachedFuncs.length&&(thi';
      S = S + 's.onCellCompAttachedFuncs.forEach((e=>e())),this.onCellCompAttachedFuncs=[])}setupAutoHeight(e){if(this.isAutoHeight=this.column.isAutoHeight(),!this.isAutoHeight||!e)return;const t=e.parentElement,a=this.beans.gos.getRowHeightForNode(this.rowNode).height,n=o=>{if(this.editing)return;if(!this.isAlive())return;const{paddingTop:r,paddingBottom:i,borderBottomWidth:s,borderTopWidth:l}=ca(t),c=r+i+s+l,g=e.offsetHeight+c;if(o<5){const t=this.beans.gos.getDocument();if(!t||!t.contains(e)||0==g)return void window.setTimeout((()=>n(o+1)),0)}const d=Math.max(g,a);this.rowNode.setRowAutoHeight(d,this.column)},o=()=>n(0);o();const r=this.beans.resizeObserverService.observeResize(e,o);this.addDestroyFunc((()=>{r(),this.rowNode.setRowAutoHeight(void 0,this.column)}))}getCellAriaRole(){return this.column.getColDef().cellAriaRole??"gridcell"}getInstanceId(){return this.instanceId}getColumnIdSanitised(){return this.colIdSanitised}getTabIndex(){return this.tabIndex}isCellRenderer(){const e=this.column.getColDef();return null!=e.cellRenderer||null!=e.cellRendererSelector}getValueToDisplay(){return this.valueFormatted??this.value}showValue(e=!1){const t=this.getValueToDisplay();let a;if(this.rowNode.stub){const e=this.createCellRendererParams();a=this.beans.userComponentFactory.getLoadingCellRendererDetails(this.column.getColDef(),e)}else if(this.isCellRenderer()){const e=this.createCellRendererParams();a=this.beans.userComponentFactory.getCellRendererDetails(this.column.getColDef(),e)}this.cellComp.setRenderDetails(a,t,e),this.cellRangeFeature?.refreshHandle()}setupControlComps(){const e=this.column.getColDef();this.includeSelection=this.isIncludeControl(e.checkboxSelection),this.includeRowDrag=this.isIncludeControl(e.rowDrag),this.includeDndSource=this.isIncludeControl(e.dndSource),this.cellComp.setIncludeSelection(this.includeSelection),this.cellComp.setIncludeDndSource(this.includeDndSource),this.cellComp.setIncludeRowDrag(this.includeRowDrag)}isForceWrapper(){return this.beans.gos';
      S = S + '.get("enableCellTextSelection")||this.column.isAutoHeight()}isIncludeControl(e){return!(null!=this.rowNode.rowPinned)&&("function"==typeof e||!0===e)}refreshShouldDestroy(){const e=this.column.getColDef(),t=this.includeSelection!=this.isIncludeControl(e.checkboxSelection),a=this.includeRowDrag!=this.isIncludeControl(e.rowDrag),n=this.includeDndSource!=this.isIncludeControl(e.dndSource),o=this.isAutoHeight!=this.column.isAutoHeight();return t||a||n||o}startEditing(e=null,t=!1,a=null){const{editService:n}=this.beans;this.isCellEditable()&&!this.editing&&n&&(this.cellComp?n.startEditing(this,e,t,a):this.onCellCompAttachedFuncs.push((()=>{this.startEditing(e,t,a)})))}setEditing(e,t){this.editCompDetails=t,this.editing!==e&&(this.editing=e,this.cellRangeFeature?.refreshHandle())}stopRowOrCellEdit(e=!1){"fullRow"===this.beans.gos.get("editType")?this.rowCtrl.stopEditing(e):this.stopEditing(e)}onPopupEditorClosed(){this.editing&&this.stopEditingAndFocus()}stopEditing(e=!1){const{editService:t}=this.beans;return!(!this.editing||!t)&&t.stopEditing(this,e)}createCellRendererParams(){return this.beans.gos.addGridCommonParams({value:this.value,valueFormatted:this.valueFormatted,getValue:()=>this.rowNode.getValueFromValueService(this.column),setValue:e=>this.beans.valueService.setValue(this.rowNode,this.column,e),formatValue:this.formatValue.bind(this),data:this.rowNode.data,node:this.rowNode,pinned:this.column.getPinned(),colDef:this.column.getColDef(),column:this.column,refreshCell:this.refreshCell.bind(this),eGridCell:this.getGui(),eParentOfValue:this.cellComp.getParentOfValue(),registerRowDragger:(e,t,a,n)=>this.registerRowDragger(e,t,n),setTooltip:(e,t)=>{this.tooltipFeature&&this.disableTooltipFeature(),this.enableTooltipFeature(e,t),this.tooltipFeature?.refreshToolTip()}})}setFocusOutOnEditor(){this.editing&&this.beans.editService?.setFocusOutOnEditor(this)}setFocusInOnEditor(){this.editing&&this.beans.editService?.setFocusInOnEditor(this)}onCellChanged(e){e.column===this';
      S = S + '.column&&this.refreshCell({})}refreshOrDestroyCell(e){this.refreshShouldDestroy()?this.rowCtrl?.recreateCell(this):this.refreshCell(e)}refreshCell(e){if(this.suppressRefreshCell||this.editing)return;const t=this.column.getColDef(),a=null!=e&&!!e.newData,n=null!=e&&!!e.suppressFlash||!!t.suppressCellFlash,o=null==t.field&&null==t.valueGetter&&null==t.showRowGroup,r=e&&e.forceRefresh||o||a,i=!!this.cellComp,s=this.updateAndFormatValue(i);if(i){if(r||s){this.showValue(a);const e=this.beans.filterManager?.isSuppressFlashingCellsBecauseFiltering();!n&&!e&&(this.beans.gos.get("enableCellChangeFlash")||t.enableCellChangeFlash)&&this.flashCell(),this.cellCustomStyleFeature?.applyUserStyles(),this.cellCustomStyleFeature?.applyClassesFromColDef()}this.tooltipFeature?.refreshToolTip(),this.cellCustomStyleFeature?.applyCellClassRules()}}stopEditingAndFocus(e=!1,t=!1){this.beans.editService?.stopEditingAndFocus(this,e,t)}flashCell(e){const t=e?.flashDuration??e?.flashDelay,a=e?.fadeDuration??e?.fadeDelay;this.animateCell("data-changed",t,a)}animateCell(e,t,a){if(!this.cellComp)return;const n=`ag-cell-${e}`,o=`ag-cell-${e}-animation`,{gos:r}=this.beans;t||(t=r.get("cellFlashDuration")),L(a)||(a=r.get("cellFadeDuration")),this.cellComp.addOrRemoveCssClass(n,!0),this.cellComp.addOrRemoveCssClass(o,!1),this.beans.frameworkOverrides.wrapIncoming((()=>{window.setTimeout((()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(n,!1),this.cellComp.addOrRemoveCssClass(o,!0),this.eGui.style.transition=`background-color ${a}ms`,window.setTimeout((()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(o,!1),this.eGui.style.transition="")}),a))}),t)}))}onFlashCells(e){if(!this.cellComp)return;const t=this.beans.cellPositionUtils.createId(this.getCellPosition());e.cells[t]&&this.animateCell("highlight")}isCellEditable(){return this.column.isCellEditable(this.rowNode)}isSuppressFillHandle(){return this.column.isSuppressFillHandle()}formatValue(e){return this.callValueFormatter(e)??e}callValue';
      S = S + 'Formatter(e){return this.beans.valueService.formatValue(this.column,this.rowNode,e)}updateAndFormatValue(e){const t=this.value,a=this.valueFormatted;return this.value=this.rowNode.getValueFromValueService(this.column),this.valueFormatted=this.callValueFormatter(this.value),!e||(!this.valuesAreEqual(t,this.value)||this.valueFormatted!=a)}valuesAreEqual(e,t){const a=this.column.getColDef();return a.equals?a.equals(e,t):e===t}getComp(){return this.cellComp}getValue(){return this.value}addDomData(){const t=this.getGui();this.beans.gos.setDomData(t,e.DOM_DATA_KEY_CELL_CTRL,this),this.addDestroyFunc((()=>this.beans.gos.setDomData(t,e.DOM_DATA_KEY_CELL_CTRL,null)))}createEvent(e,t){return this.beans.gos.addGridCommonParams({type:t,node:this.rowNode,data:this.rowNode.data,value:this.value,column:this.column,colDef:this.column.getColDef(),rowPinned:this.rowNode.rowPinned,event:e,rowIndex:this.rowNode.rowIndex})}processCharacter(e){this.cellKeyboardListenerFeature?.processCharacter(e)}onKeyDown(e){this.cellKeyboardListenerFeature?.onKeyDown(e)}onMouseEvent(e,t){this.cellMouseListenerFeature?.onMouseEvent(e,t)}getGui(){return this.eGui}getColSpanningList(){return this.cellPositionFeature.getColSpanningList()}onLeftChanged(){this.cellComp&&this.cellPositionFeature?.onLeftChanged()}onDisplayedColumnsChanged(){this.eGui&&(this.refreshAriaColIndex(),this.refreshFirstAndLastStyles())}refreshFirstAndLastStyles(){const{cellComp:e,column:t,beans:a}=this;nr(e,t,a.visibleColsService)}refreshAriaColIndex(){const e=this.beans.visibleColsService.getAriaColIndex(this.column);Gt(this.getGui(),e)}isSuppressNavigable(){return this.column.isSuppressNavigable(this.rowNode)}onWidthChanged(){return this.cellPositionFeature?.onWidthChanged()}getColumn(){return this.column}getRowNode(){return this.rowNode}isPrintLayout(){return this.printLayout}getCellPosition(){return this.cellPosition}isEditing(){return this.editing}startRowOrCellEdit(e,t=null){this.cellComp?"fullRow"===this.beans.gos.get("editTyp';
      S = S + 'e")?this.rowCtrl.startRowEditing(e,this):this.startEditing(e,!0,t):this.onCellCompAttachedFuncs.push((()=>{this.startRowOrCellEdit(e,t)}))}getRowCtrl(){return this.rowCtrl}getRowPosition(){return{rowIndex:this.cellPosition.rowIndex,rowPinned:this.cellPosition.rowPinned}}updateRangeBordersIfRangeCount(){this.cellComp&&this.cellRangeFeature&&this.cellRangeFeature.updateRangeBordersIfRangeCount()}onRangeSelectionChanged(){this.cellComp&&this.cellRangeFeature&&this.cellRangeFeature.onRangeSelectionChanged()}isRangeSelectionEnabled(){return null!=this.cellRangeFeature}focusCell(e=!1){this.beans.focusService.setFocusedCell({rowIndex:this.getCellPosition().rowIndex,column:this.column,rowPinned:this.rowNode.rowPinned,forceBrowserFocus:e})}onRowIndexChanged(){this.createCellPosition(),this.onCellFocused(),this.cellRangeFeature&&this.cellRangeFeature.onRangeSelectionChanged()}onFirstRightPinnedChanged(){if(!this.cellComp)return;const e=this.column.isFirstRightPinned();this.cellComp.addOrRemoveCssClass("ag-cell-first-right-pinned",e)}onLastLeftPinnedChanged(){if(!this.cellComp)return;const e=this.column.isLastLeftPinned();this.cellComp.addOrRemoveCssClass("ag-cell-last-left-pinned",e)}onCellFocused(e){if(this.beans.gos.get("suppressCellFocus"))return;const t=this.beans.focusService.isCellFocused(this.cellPosition);if(!this.cellComp)return void(t&&e?.forceBrowserFocus&&(this.focusEventToRestore=e));if(this.focusEventToRestore=void 0,this.cellComp.addOrRemoveCssClass("ag-cell-focus",t),t&&e&&e.forceBrowserFocus){let t=this.cellComp.getFocusableElement();if(this.editing){const e=this.beans.focusService.findFocusableElements(t,null,!0);e.length&&(t=e[0])}t.focus({preventScroll:!!e.preventScrollOnBrowserFocus})}const a="fullRow"===this.beans.gos.get("editType");t||a||!this.editing||this.stopRowOrCellEdit(),t&&this.rowCtrl.announceDescription()}createCellPosition(){this.cellPosition={rowIndex:this.rowNode.rowIndex,rowPinned:I(this.rowNode.rowPinned),column:this.column}}applyStaticCs';
      S = S + 'sClasses(){this.cellComp.addOrRemoveCssClass("ag-cell",!0),this.cellComp.addOrRemoveCssClass("ag-cell-not-inline-editing",!0);const e=1==this.column.isAutoHeight();this.cellComp.addOrRemoveCssClass("ag-cell-auto-height",e),this.cellComp.addOrRemoveCssClass("ag-cell-normal-height",!e)}onColumnHover(){if(!this.cellComp)return;if(!this.beans.gos.get("columnHoverHighlight"))return;const e=this.beans.columnHoverService.isHovered(this.column);this.cellComp.addOrRemoveCssClass("ag-column-hover",e)}onColDefChanged(){if(!this.cellComp)return;this.column.isTooltipEnabled()?(this.disableTooltipFeature(),this.enableTooltipFeature()):this.disableTooltipFeature(),this.setWrapText(),this.editing?this.beans.editService?.handleColDefChanged(this):this.refreshOrDestroyCell({forceRefresh:!0,suppressFlash:!0})}setWrapText(){const e=1==this.column.getColDef().wrapText;this.cellComp.addOrRemoveCssClass("ag-cell-wrap-text",e)}dispatchCellContextMenuEvent(e){const t=this.column.getColDef(),a=this.createEvent(e,"cellContextMenu");this.beans.eventService.dispatchEvent(a),t.onCellContextMenu&&window.setTimeout((()=>{this.beans.frameworkOverrides.wrapOutgoing((()=>{t.onCellContextMenu(a)}))}),0)}getCellRenderer(){return this.cellComp?this.cellComp.getCellRenderer():null}getCellEditor(){return this.cellComp?this.cellComp.getCellEditor():null}destroy(){this.onCellCompAttachedFuncs=[],super.destroy()}createSelectionCheckbox(){const e=new Ci;return this.beans.context.createBean(e),e.init({rowNode:this.rowNode,column:this.column}),e}createDndSource(){const e=new wi(this.rowNode,this.column,this.eGui);return this.beans.context.createBean(e),e}registerRowDragger(e,t,a){if(this.customRowDragComp)return void this.customRowDragComp.setDragElement(e,t);const n=this.createRowDragComp(e,t,a);n&&(this.customRowDragComp=n,this.addDestroyFunc((()=>{this.beans.context.destroyBean(n),this.customRowDragComp=null})))}createRowDragComp(e,t,a){const n=this.beans.gos.get("pagination"),o=this.beans.gos.get("rowDragMa';
      S = S + 'naged"),r=this.beans.gos.isRowModelType("clientSide");if(o){if(!r)return void ce("managed row dragging is only allowed in the Client Side Row Model");if(n)return void ce("managed row dragging is not possible when doing pagination")}const i=new $n((()=>this.value),this.rowNode,this.column,e,t,a);return this.beans.context.createBean(i),i}setSuppressRefreshCell(e){this.suppressRefreshCell=e}getEditCompDetails(){return this.editCompDetails}};Ei.DOM_DATA_KEY_CELL_CTRL="cellCtrl";var Pi=Ei,Ai=0,Ti=class e extends A{constructor(e,t,a,n,o){super(),this.allRowGuis=[],this.active=!0,this.centerCellCtrls={list:[],map:{}},this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}},this.slideInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.fadeInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.rowDragComps=[],this.lastMouseDownOnDragger=!1,this.emptyStyle={},this.updateColumnListsPending=!1,this.rowId=null,this.businessKeySanitised=null,this.beans=t,this.gos=t.gos,this.rowNode=e,this.paginationPage=t.paginationService?.getCurrentPage()??0,this.useAnimationFrameForCreate=n,this.printLayout=o,this.suppressRowTransform=this.gos.get("suppressRowTransform"),this.instanceId=e.id+"-"+Ai++,this.rowId=He(e.id),this.initRowBusinessKey(),this.rowFocused=t.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned),this.rowLevel=t.rowCssClassCalculator.calculateRowLevel(this.rowNode),this.setRowType(),this.setAnimateFlags(a),this.rowStyles=this.processStylesFromGridOptions(),this.isFullWidth()&&!this.gos.get("suppressCellFocus")&&(this.tabIndex=-1),this.addListeners()}initRowBusinessKey(){this.businessKeyForNodeFunc=this.gos.get("getBusinessKeyForNode"),this.updateRowBusinessKey()}updateRowBusinessKey(){if("function"!=typeof this.businessKeyForNodeFunc)return;const e=this.businessKeyForNodeFunc(this.rowNode);this.businessKeySanitised=He(e)}getRowId(){return this.rowId}getRowStyles(){return this.rowStyles}getTabIndex(){return this.tabIndex}isSticky(';
      S = S + '){return this.rowNode.sticky}getInstanceId(){return this.instanceId}updateGui(e,t){"left"===e?this.leftGui=t:"right"===e?this.rightGui=t:"fullWidth"===e?this.fullWidthGui=t:this.centerGui=t}setComp(e,t,a){const n={rowComp:e,element:t,containerType:a};this.allRowGuis.push(n),this.updateGui(a,n),this.initialiseRowComp(n),"FullWidthLoading"===this.rowType||this.rowNode.rowPinned||this.beans.rowRenderer.dispatchFirstDataRenderedEvent()}unsetComp(e){this.allRowGuis=this.allRowGuis.filter((t=>t.containerType!==e)),this.updateGui(e,void 0)}isCacheable(){return"FullWidthDetail"===this.rowType&&this.gos.get("keepDetailRows")}setCached(e){const t=e?"none":"";this.allRowGuis.forEach((e=>e.element.style.display=t))}initialiseRowComp(t){const a=this.gos;this.listenOnDomOrder(t),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights(),this.onRowHeightChanged(t),this.updateRowIndexes(t),this.setFocusedClasses(t),this.setStylesFromGridOptions(!1,t),a.isRowSelection()&&this.rowNode.selectable&&this.onRowSelected(t),this.updateColumnLists(!this.useAnimationFrameForCreate);const n=t.rowComp;this.getInitialRowClasses(t.containerType).forEach((e=>n.addOrRemoveCssClass(e,!0))),this.executeSlideAndFadeAnimations(t),this.rowNode.group&&Pt(t.element,1==this.rowNode.expanded),this.setRowCompRowId(n),this.setRowCompRowBusinessKey(n),a.setDomData(t.element,e.DOM_DATA_KEY_ROW_CTRL,this),this.addDestroyFunc((()=>a.setDomData(t.element,e.DOM_DATA_KEY_ROW_CTRL,null))),this.useAnimationFrameForCreate?this.beans.animationFrameService.createTask(this.addHoverFunctionality.bind(this,t.element),this.rowNode.rowIndex,"createTasksP2"):this.addHoverFunctionality(t.element),this.isFullWidth()&&this.setupFullWidth(t),a.get("rowDragEntireRow")&&this.addRowDraggerToRow(t),this.useAnimationFrameForCreate&&this.beans.animationFrameService.addDestroyTask((()=>{this.isAlive()&&t.rowComp.addOrRemoveCssClass("ag-after-created",!0)})),this.executeProcessRowPostCreateFunc()}setRowCompRowBu';
      S = S + 'sinessKey(e){null!=this.businessKeySanitised&&e.setRowBusinessKey(this.businessKeySanitised)}getBusinessKey(){return this.businessKeySanitised}setRowCompRowId(e){this.rowId=He(this.rowNode.id),null!=this.rowId&&e.setRowId(this.rowId)}executeSlideAndFadeAnimations(e){const{containerType:t}=e;this.slideInAnimation[t]&&(me((()=>{this.onTopChanged()})),this.slideInAnimation[t]=!1);this.fadeInAnimation[t]&&(me((()=>{e.rowComp.addOrRemoveCssClass("ag-opacity-zero",!1)})),this.fadeInAnimation[t]=!1)}addRowDraggerToRow(e){if(this.gos.get("enableRangeSelection"))return void ce("Setting `rowDragEntireRow: true` in the gridOptions doesn\'t work with `enableRangeSelection: true`");const t=this.beans.localeService.getLocaleTextFunc(),a=new $n((()=>`1 ${t("rowDragRow","row")}`),this.rowNode,void 0,e.element,void 0,!0),n=this.createBean(a,this.beans.context);this.rowDragComps.push(n)}setupFullWidth(e){const t=this.getPinnedForContainer(e.containerType);if("FullWidthDetail"==this.rowType&&!Xa.__assertRegistered("@ag-grid-enterprise/master-detail","cell renderer \'agDetailCellRenderer\' (for master detail)",this.beans.context.getGridId()))return;const a=this.createFullWidthCompDetails(e.element,t);e.rowComp.showFullWidth(a)}isPrintLayout(){return this.printLayout}getFullWidthCellRenderers(){return this.gos.get("embedFullWidthRows")?this.allRowGuis.map((e=>e?.rowComp?.getFullWidthCellRenderer())):[this.fullWidthGui?.rowComp?.getFullWidthCellRenderer()]}getCellElement(e){const t=this.getCellCtrl(e);return t?t.getGui():null}executeProcessRowPostCreateFunc(){const e=this.gos.getCallback("processRowPostCreate");if(!e||!this.areAllContainersReady())return;e({eRow:this.centerGui.element,ePinnedLeftRow:this.leftGui?this.leftGui.element:void 0,ePinnedRightRow:this.rightGui?this.rightGui.element:void 0,node:this.rowNode,rowIndex:this.rowNode.rowIndex,addRenderedRowListener:this.addEventListener.bind(this)})}areAllContainersReady(){const e=!!this.leftGui||!this.beans.visibleColsService.isPinningL';
      S = S + 'eft(),t=!!this.centerGui,a=!!this.rightGui||!this.beans.visibleColsService.isPinningRight();return e&&t&&a}setRowType(){const e=this.rowNode.stub&&!this.gos.get("suppressServerSideFullWidthLoadingRow"),t=this.rowNode.isFullWidthCell(),a=this.gos.get("masterDetail")&&this.rowNode.detail,n=this.beans.columnModel.isPivotMode(),o=!!this.rowNode.group&&!this.rowNode.footer&&this.gos.isGroupUseEntireRow(n);this.rowType=e?"FullWidthLoading":a?"FullWidthDetail":t?"FullWidth":o?"FullWidthGroup":"Normal"}updateColumnLists(e=!1,t=!1){if(this.isFullWidth())return;e||this.gos.get("suppressAnimationFrame")||this.printLayout?this.updateColumnListsImpl(t):this.updateColumnListsPending||(this.beans.animationFrameService.createTask((()=>{this.active&&this.updateColumnListsImpl(!0)}),this.rowNode.rowIndex,"createTasksP1"),this.updateColumnListsPending=!0)}createCellCtrls(e,t,a=null){const n={list:[],map:{}},o=(e,t)=>{n.list.push(t),n.map[e]=t};return t.forEach((t=>{const a=t.getInstanceId();let n=e.map[a];n||(n=new Pi(t,this.rowNode,this.beans,this)),o(a,n)})),e.list.forEach((e=>{if(null!=n.map[e.getColumn().getInstanceId()])return;this.isCellEligibleToBeRemoved(e,a)?e.destroy():o(e.getColumn().getInstanceId(),e)})),n}updateColumnListsImpl(e){this.updateColumnListsPending=!1,this.createAllCellCtrls(),this.setCellCtrls(e)}setCellCtrls(e){this.allRowGuis.forEach((t=>{const a=this.getCellCtrlsForContainer(t.containerType);t.rowComp.setCellCtrls(a,e)}))}getCellCtrlsForContainer(e){switch(e){case"left":return this.leftCellCtrls.list;case"right":return this.rightCellCtrls.list;case"fullWidth":return[];case"center":return this.centerCellCtrls.list}}createAllCellCtrls(){const e=this.beans.columnViewportService,t=this.beans.visibleColsService;if(this.printLayout)this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,t.getAllCols()),this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}};else{const a=e.getColsWithinViewport(this.rowNode);this.centerCellCtrls=this.create';
      S = S + 'CellCtrls(this.centerCellCtrls,a);const n=t.getLeftColsForRow(this.rowNode);this.leftCellCtrls=this.createCellCtrls(this.leftCellCtrls,n,"left");const o=t.getRightColsForRow(this.rowNode);this.rightCellCtrls=this.createCellCtrls(this.rightCellCtrls,o,"right")}}isCellEligibleToBeRemoved(e,t){const a=!0;if(e.getColumn().getPinned()!=t)return a;const n=e.isEditing(),o=this.beans.focusService.isCellFocused(e.getCellPosition());if(n||o){const t=e.getColumn();return!(this.beans.visibleColsService.getAllCols().indexOf(t)>=0)&&a}return a}getDomOrder(){return this.gos.get("ensureDomOrder")||this.gos.isDomLayout("print")}listenOnDomOrder(e){const t=()=>{e.rowComp.setDomOrder(this.getDomOrder())};this.addManagedPropertyListener("domLayout",t),this.addManagedPropertyListener("ensureDomOrder",t)}setAnimateFlags(e){if(this.isSticky()||!e)return;const t=L(this.rowNode.oldRowTop),a=this.beans.visibleColsService.isPinningLeft(),n=this.beans.visibleColsService.isPinningRight();if(t){if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows"))return void(this.slideInAnimation.fullWidth=!0);this.slideInAnimation.center=!0,this.slideInAnimation.left=a,this.slideInAnimation.right=n}else{if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows"))return void(this.fadeInAnimation.fullWidth=!0);this.fadeInAnimation.center=!0,this.fadeInAnimation.left=a,this.fadeInAnimation.right=n}}isEditing(){return this.editingRow}isFullWidth(){return"Normal"!==this.rowType}refreshFullWidth(){const e=(e,t)=>!e||e.rowComp.refreshFullWidth((()=>this.createFullWidthCompDetails(e.element,t).params)),t=e(this.fullWidthGui,null),a=e(this.centerGui,null),n=e(this.leftGui,"left"),o=e(this.rightGui,"right");return t&&a&&n&&o}addListeners(){this.addManagedListeners(this.rowNode,{heightChanged:()=>this.onRowHeightChanged(),rowSelected:()=>this.onRowSelected(),rowIndexChanged:this.onRowIndexChanged.bind(this),topChanged:this.onTopChanged.bind(this),expandedChanged:this.updateExpandedCss.bind(this),hasChildrenChanged:th';
      S = S + 'is.updateExpandedCss.bind(this)}),this.rowNode.detail&&this.addManagedListeners(this.rowNode.parent,{dataChanged:this.onRowNodeDataChanged.bind(this)}),this.addManagedListeners(this.rowNode,{dataChanged:this.onRowNodeDataChanged.bind(this),cellChanged:this.postProcessCss.bind(this),rowHighlightChanged:this.onRowNodeHighlightChanged.bind(this),draggingChanged:this.postProcessRowDragging.bind(this),uiLevelChanged:this.onUiLevelChanged.bind(this)}),this.addManagedListeners(this.beans.eventService,{paginationPixelOffsetChanged:this.onPaginationPixelOffsetChanged.bind(this),heightScaleChanged:this.onTopChanged.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),virtualColumnsChanged:this.onVirtualColumnsChanged.bind(this),cellFocused:this.onCellFocusChanged.bind(this),cellFocusCleared:this.onCellFocusChanged.bind(this),paginationChanged:this.onPaginationChanged.bind(this),modelUpdated:this.refreshFirstAndLastRowStyles.bind(this),columnMoved:()=>this.updateColumnLists()}),this.addDestroyFunc((()=>{this.destroyBeans(this.rowDragComps,this.beans.context),this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature,this.beans.context))})),this.addManagedPropertyListeners(["rowDragEntireRow"],(()=>{this.gos.get("rowDragEntireRow")?this.allRowGuis.forEach((e=>{this.addRowDraggerToRow(e)})):this.rowDragComps=this.destroyBeans(this.rowDragComps,this.beans.context)})),this.addListenersForCellComps()}addListenersForCellComps(){this.addManagedListeners(this.rowNode,{rowIndexChanged:()=>{this.getAllCellCtrls().forEach((e=>e.onRowIndexChanged()))},cellChanged:e=>{this.getAllCellCtrls().forEach((t=>t.onCellChanged(e)))}})}onRowNodeDataChanged(e){if(this.isFullWidth()!==!!this.rowNode.isFullWidthCell())this.beans.rowRenderer.redrawRow(this.rowNode);else if(this.isFullWidth()){this.refreshFullWidth()||this.beans.rowRenderer.redrawRow(this.rowNode)}else this.getAllCellCtrls().forEach((t=>t.refreshCell({suppressFlash:!e.update,newData:!e.update})';
      S = S + ')),this.allRowGuis.forEach((e=>{this.setRowCompRowId(e.rowComp),this.updateRowBusinessKey(),this.setRowCompRowBusinessKey(e.rowComp)})),this.onRowSelected(),this.postProcessCss()}postProcessCss(){this.setStylesFromGridOptions(!0),this.postProcessClassesFromGridOptions(),this.postProcessRowClassRules(),this.postProcessRowDragging()}onRowNodeHighlightChanged(){const e=this.rowNode.highlighted;this.allRowGuis.forEach((t=>{const a=0===e,n=1===e;t.rowComp.addOrRemoveCssClass("ag-row-highlight-above",a),t.rowComp.addOrRemoveCssClass("ag-row-highlight-below",n)}))}postProcessRowDragging(){const e=this.rowNode.dragging;this.allRowGuis.forEach((t=>t.rowComp.addOrRemoveCssClass("ag-row-dragging",e)))}updateExpandedCss(){const e=this.rowNode.isExpandable(),t=1==this.rowNode.expanded;this.allRowGuis.forEach((a=>{a.rowComp.addOrRemoveCssClass("ag-row-group",e),a.rowComp.addOrRemoveCssClass("ag-row-group-expanded",e&&t),a.rowComp.addOrRemoveCssClass("ag-row-group-contracted",e&&!t),Pt(a.element,e&&t)}))}onDisplayedColumnsChanged(){this.updateColumnLists(!0),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights()}onVirtualColumnsChanged(){this.updateColumnLists(!1,!0)}getRowPosition(){return{rowPinned:I(this.rowNode.rowPinned),rowIndex:this.rowNode.rowIndex}}onKeyboardNavigate(e){const t=this.allRowGuis.find((t=>t.element.contains(e.target)));if(!((t?t.element:null)===e.target))return;const a=this.rowNode,n=this.beans.focusService.getFocusedCell(),o={rowIndex:a.rowIndex,rowPinned:a.rowPinned,column:n&&n.column};this.beans.navigationService.navigateToNextCell(e,e.key,o,!0),e.preventDefault()}onTabKeyDown(e){if(e.defaultPrevented||M(e))return;const t=this.allRowGuis.find((t=>t.element.contains(e.target))),a=t?t.element:null,n=a===e.target;let o=null;n||(o=this.beans.focusService.findNextFocusableElement(a,!1,e.shiftKey)),(this.isFullWidth()&&n||!o)&&this.beans.navigationService.onTabKeyDown(this,e)}getFullWidthElement(){return this.fullWidthGui?this.full';
      S = S + 'WidthGui.element:null}getRowYPosition(){const e=this.allRowGuis.find((e=>ya(e.element)))?.element;return e?e.getBoundingClientRect().top:0}onFullWidthRowFocused(e){const t=this.rowNode,a=!!e&&(this.isFullWidth()&&e.rowIndex===t.rowIndex&&e.rowPinned==t.rowPinned),n=this.fullWidthGui?this.fullWidthGui.element:this.centerGui?.element;n&&(n.classList.toggle("ag-full-width-focus",a),a&&e?.forceBrowserFocus&&n.focus({preventScroll:!0}))}recreateCell(e){this.centerCellCtrls=this.removeCellCtrl(this.centerCellCtrls,e),this.leftCellCtrls=this.removeCellCtrl(this.leftCellCtrls,e),this.rightCellCtrls=this.removeCellCtrl(this.rightCellCtrls,e),e.destroy(),this.updateColumnLists()}removeCellCtrl(e,t){const a={list:[],map:{}};return e.list.forEach((e=>{e!==t&&(a.list.push(e),a.map[e.getColumn().getInstanceId()]=e)})),a}onMouseEvent(e,t){switch(e){case"dblclick":this.onRowDblClick(t);break;case"click":this.onRowClick(t);break;case"touchstart":case"mousedown":this.onRowMouseDown(t)}}createRowEvent(e,t){return this.gos.addGridCommonParams({type:e,node:this.rowNode,data:this.rowNode.data,rowIndex:this.rowNode.rowIndex,rowPinned:this.rowNode.rowPinned,event:t})}createRowEventWithSource(e,t){const a=this.createRowEvent(e,t);return a.source=this,a}onRowDblClick(e){if(M(e))return;const t=this.createRowEventWithSource("rowDoubleClicked",e);this.beans.eventService.dispatchEvent(t)}onRowMouseDown(e){if(this.lastMouseDownOnDragger=la(e.target,"ag-row-drag",3),!this.isFullWidth())return;const t=this.rowNode,a=this.beans.visibleColsService;this.beans.rangeService&&this.beans.rangeService.removeAllCellRanges();const n=this.getFullWidthElement(),o=e.target;let r=!0;n&&n.contains(o)&&oa(o)&&(r=!1),this.beans.focusService.setFocusedCell({rowIndex:t.rowIndex,column:a.getAllCols()[0],rowPinned:t.rowPinned,forceBrowserFocus:r})}onRowClick(e){if(M(e)||this.lastMouseDownOnDragger)return;const t=this.createRowEventWithSource("rowClicked",e);this.beans.eventService.dispatchEvent(t);const a=e.ctrlKey||e.';
      S = S + 'metaKey,n=e.shiftKey;if(this.gos.get("groupSelectsChildren")&&this.rowNode.group||this.isRowSelectionBlocked()||this.gos.get("suppressRowClickSelection"))return;const o=this.gos.get("rowMultiSelectWithClick"),r=!this.gos.get("suppressRowDeselection"),i="rowClicked";if(this.rowNode.isSelected())o?this.rowNode.setSelectedParams({newValue:!1,event:e,source:i}):a?r&&this.rowNode.setSelectedParams({newValue:!1,event:e,source:i}):this.rowNode.setSelectedParams({newValue:!0,clearSelection:!n,rangeSelect:n,event:e,source:i});else{const t=!o&&!a;this.rowNode.setSelectedParams({newValue:!0,clearSelection:t,rangeSelect:n,event:e,source:i})}}isRowSelectionBlocked(){return!this.rowNode.selectable||!!this.rowNode.rowPinned||!this.gos.isRowSelection()}setupDetailRowAutoHeight(e){if("FullWidthDetail"!==this.rowType)return;if(!this.gos.get("detailRowAutoHeight"))return;const t=()=>{const t=e.clientHeight;if(null!=t&&t>0){const e=()=>{this.rowNode.setRowHeight(t),("clientSide"===this.beans.rowModel.getType()||"serverSide"===this.beans.rowModel.getType())&&this.beans.rowModel.onRowHeightChanged()};window.setTimeout(e,0)}},a=this.beans.resizeObserverService.observeResize(e,t);this.addDestroyFunc(a),t()}createFullWidthCompDetails(e,t){const{gos:a,rowNode:n}=this,o=a.addGridCommonParams({fullWidth:!0,data:n.data,node:n,value:n.key,valueFormatted:n.key,eGridCell:e,eParentOfValue:e,pinned:t,addRenderedRowListener:this.addEventListener.bind(this),registerRowDragger:(e,t,a,n)=>this.addFullWidthRowDragging(e,t,a,n),setTooltip:(e,t)=>this.refreshRowTooltip(e,t)}),r=this.beans.userComponentFactory;switch(this.rowType){case"FullWidthDetail":return r.getFullWidthDetailCellRendererDetails(o);case"FullWidthGroup":return r.getFullWidthGroupCellRendererDetails(o);case"FullWidthLoading":return r.getFullWidthLoadingCellRendererDetails(o);default:return r.getFullWidthCellRendererDetails(o)}}refreshRowTooltip(e,t){if(!this.fullWidthGui)return;const a={getGui:()=>this.fullWidthGui.element,getTooltipValue:';
      S = S + '()=>e,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:t};this.tooltipFeature&&this.destroyBean(this.tooltipFeature,this.beans.context),this.tooltipFeature=this.createBean(new Na(a,this.beans))}addFullWidthRowDragging(e,t,a="",n){if(!this.isFullWidth())return;const o=new $n((()=>a),this.rowNode,void 0,e,t,n);this.createBean(o,this.beans.context),this.addDestroyFunc((()=>{this.destroyBean(o,this.beans.context)}))}onUiLevelChanged(){const e=this.beans.rowCssClassCalculator.calculateRowLevel(this.rowNode);if(this.rowLevel!=e){const t="ag-row-level-"+e,a="ag-row-level-"+this.rowLevel;this.allRowGuis.forEach((e=>{e.rowComp.addOrRemoveCssClass(t,!0),e.rowComp.addOrRemoveCssClass(a,!1)}))}this.rowLevel=e}isFirstRowOnPage(){return this.rowNode.rowIndex===this.beans.pageBoundsService.getFirstRow()}isLastRowOnPage(){return this.rowNode.rowIndex===this.beans.pageBoundsService.getLastRow()}refreshFirstAndLastRowStyles(){const e=this.isFirstRowOnPage(),t=this.isLastRowOnPage();this.firstRowOnPage!==e&&(this.firstRowOnPage=e,this.allRowGuis.forEach((t=>t.rowComp.addOrRemoveCssClass("ag-row-first",e)))),this.lastRowOnPage!==t&&(this.lastRowOnPage=t,this.allRowGuis.forEach((e=>e.rowComp.addOrRemoveCssClass("ag-row-last",t))))}stopEditing(e=!1){this.stoppingRowEdit||this.beans.rowEditService?.stopEditing(this,e)}setInlineEditingCss(e){this.allRowGuis.forEach((t=>{t.rowComp.addOrRemoveCssClass("ag-row-inline-editing",e),t.rowComp.addOrRemoveCssClass("ag-row-not-inline-editing",!e)}))}setEditingRow(e){this.editingRow=e}startRowEditing(e=null,t=null,a=null){this.editingRow||this.beans.rowEditService?.startEditing(this,e,t,a)}getAllCellCtrls(){if(0===this.leftCellCtrls.list.length&&0===this.rightCellCtrls.list.length)return this.centerCellCtrls.list;return[...this.centerCellCtrls.list,...this.leftCellCtrls.list,...this.rightCellCtrls.list]}postProcessClassesFromGridOptions(){const e=this.beans.rowCssClassCalculator.processClassesFromGridOptions(this.rowNode);e&&e.length&&e.forEach((e';
      S = S + '=>{this.allRowGuis.forEach((t=>t.rowComp.addOrRemoveCssClass(e,!0)))}))}postProcessRowClassRules(){this.beans.rowCssClassCalculator.processRowClassRules(this.rowNode,(e=>{this.allRowGuis.forEach((t=>t.rowComp.addOrRemoveCssClass(e,!0)))}),(e=>{this.allRowGuis.forEach((t=>t.rowComp.addOrRemoveCssClass(e,!1)))}))}setStylesFromGridOptions(e,t){e&&(this.rowStyles=this.processStylesFromGridOptions()),this.forEachGui(t,(e=>e.rowComp.setUserStyles(this.rowStyles)))}getPinnedForContainer(e){return"left"===e||"right"===e?e:null}getInitialRowClasses(e){const t=this.getPinnedForContainer(e),a={rowNode:this.rowNode,rowFocused:this.rowFocused,fadeRowIn:this.fadeInAnimation[e],rowIsEven:this.rowNode.rowIndex%2==0,rowLevel:this.rowLevel,fullWidthRow:this.isFullWidth(),firstRowOnPage:this.isFirstRowOnPage(),lastRowOnPage:this.isLastRowOnPage(),printLayout:this.printLayout,expandable:this.rowNode.isExpandable(),pinned:t};return this.beans.rowCssClassCalculator.getInitialRowClasses(a)}processStylesFromGridOptions(){const e=this.gos.get("rowStyle");if(e&&"function"==typeof e)return void ce("rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead");const t=this.gos.getCallback("getRowStyle");let a;if(t){a=t({data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex})}return a||e?Object.assign({},e,a):this.emptyStyle}onRowSelected(e){const t=!!this.rowNode.isSelected();this.forEachGui(e,(e=>{e.rowComp.addOrRemoveCssClass("ag-row-selected",t),Vt(e.element,t);!e.element.contains(this.gos.getActiveDomElement())||e!==this.centerGui&&e!==this.fullWidthGui||this.announceDescription()}))}announceDescription(){if(this.isRowSelectionBlocked())return;const e=this.rowNode.isSelected();if(e&&this.gos.get("suppressRowDeselection"))return;const t=this.beans.localeService.getLocaleTextFunc()(e?"ariaRowDeselect":"ariaRowSelect",`Press SPACE to ${e?"deselect":"select"} this row.`);this.beans.ariaAnnouncementService.announceValue(t)}addHoverFunctionali';
      S = S + 'ty(e){if(!this.active)return;const{rowNode:t,beans:a,gos:n}=this;this.addManagedListeners(e,{mouseenter:()=>t.onMouseEnter(),mouseleave:()=>t.onMouseLeave()}),this.addManagedListeners(t,{mouseEnter:()=>{a.dragService.isDragging()||n.get("suppressRowHoverHighlight")||(e.classList.add("ag-row-hover"),t.setHovered(!0))},mouseLeave:()=>{e.classList.remove("ag-row-hover"),t.setHovered(!1)}})}roundRowTopToBounds(e){const t=this.beans.ctrlsService.getGridBodyCtrl().getScrollFeature().getApproximateVScollPosition(),a=this.applyPaginationOffset(t.top,!0)-100,n=this.applyPaginationOffset(t.bottom,!0)+100;return Math.min(Math.max(a,e),n)}getFrameworkOverrides(){return this.beans.frameworkOverrides}forEachGui(e,t){e?t(e):this.allRowGuis.forEach(t)}onRowHeightChanged(e){if(null==this.rowNode.rowHeight)return;const t=this.rowNode.rowHeight,a=this.beans.environment.getDefaultRowHeight(),n=this.gos.isGetRowHeightFunction()?this.gos.getRowHeightForNode(this.rowNode).height:void 0,o=n?Math.min(a,n)-2+"px":void 0;this.forEachGui(e,(e=>{e.element.style.height=`${t}px`,o&&e.element.style.setProperty("--ag-line-height",o)}))}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}destroyFirstPass(e=!1){if(this.active=!1,!e&&this.gos.isAnimateRows()&&!this.isSticky()){if(null!=this.rowNode.rowTop){const e=this.roundRowTopToBounds(this.rowNode.rowTop);this.setRowTop(e)}else this.allRowGuis.forEach((e=>e.rowComp.addOrRemoveCssClass("ag-opacity-zero",!0)))}this.rowNode.setHovered(!1);const t=this.createRowEvent("virtualRowRemoved");this.dispatchLocalEvent(t),this.beans.eventService.dispatchEvent(t),super.destroy()}destroySecondPass(){this.allRowGuis.length=0,this.stopEditing();const e=e=>(e.list.forEach((e=>e.destroy())),{list:[],map:{}});this.centerCellCtrls=e(this.centerCellCtrls),this.leftCellCtrls=e(this.leftCellCtrls),this.rightCellCtrls=e(this.rightCellCtrls)}setFocusedClasses(e){this.forEachGui(e,(e=>{e.rowComp.addOrRemoveCssClass("ag-';
      S = S + 'row-focus",this.rowFocused),e.rowComp.addOrRemoveCssClass("ag-row-no-focus",!this.rowFocused)}))}onCellFocusChanged(){const e=this.beans.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned);e!==this.rowFocused&&(this.rowFocused=e,this.setFocusedClasses()),!e&&this.editingRow&&this.stopEditing(!1)}onPaginationChanged(){const e=this.beans.paginationService?.getCurrentPage()??0;this.paginationPage!==e&&(this.paginationPage=e,this.onTopChanged()),this.refreshFirstAndLastRowStyles()}onTopChanged(){this.setRowTop(this.rowNode.rowTop)}onPaginationPixelOffsetChanged(){this.onTopChanged()}applyPaginationOffset(e,t=!1){if(this.rowNode.isRowPinned()||this.rowNode.sticky)return e;return e+this.beans.pageBoundsService.getPixelOffset()*(t?1:-1)}setRowTop(e){if(!this.printLayout&&L(e)){const t=this.applyPaginationOffset(e),a=`${this.rowNode.isRowPinned()||this.rowNode.sticky?t:this.beans.rowContainerHeightService.getRealPixelPosition(t)}px`;this.setRowTopStyle(a)}}getInitialRowTop(e){return this.suppressRowTransform?this.getInitialRowTopShared(e):void 0}getInitialTransform(e){return this.suppressRowTransform?void 0:`translateY(${this.getInitialRowTopShared(e)})`}getInitialRowTopShared(e){if(this.printLayout)return"";const t=this.rowNode;let a;if(this.isSticky())a=t.stickyRowTop;else{const n=this.slideInAnimation[e]?this.roundRowTopToBounds(t.oldRowTop):t.rowTop,o=this.applyPaginationOffset(n);a=t.isRowPinned()?o:this.beans.rowContainerHeightService.getRealPixelPosition(o)}return a+"px"}setRowTopStyle(e){this.allRowGuis.forEach((t=>this.suppressRowTransform?t.rowComp.setTop(e):t.rowComp.setTransform(`translateY(${e})`)))}getRowNode(){return this.rowNode}getCellCtrl(e){let t=null;return this.getAllCellCtrls().forEach((a=>{a.getColumn()==e&&(t=a)})),null!=t||this.getAllCellCtrls().forEach((a=>{a.getColSpanningList().indexOf(e)>=0&&(t=a)})),t}onRowIndexChanged(){null!=this.rowNode.rowIndex&&(this.onCellFocusChanged(),this.updateRowIndexes(),this.postProcessCss())}ge';
      S = S + 'tRowIndex(){return this.rowNode.getRowIndexString()}updateRowIndexes(e){const t=this.rowNode.getRowIndexString();if(null===t)return;const a=this.beans.headerNavigationService.getHeaderRowCount()+(this.beans.filterManager?.getHeaderRowCount()??0),n=this.rowNode.rowIndex%2==0,o=a+this.rowNode.rowIndex+1;this.forEachGui(e,(e=>{e.rowComp.setRowIndex(t),e.rowComp.addOrRemoveCssClass("ag-row-even",n),e.rowComp.addOrRemoveCssClass("ag-row-odd",!n),Ot(e.element,o)}))}setStoppingRowEdit(e){this.stoppingRowEdit=e}};Ti.DOM_DATA_KEY_ROW_CTRL="renderedRow";var Ii=Ti,Li=class extends A{wireBeans(e){this.mouseEventService=e.mouseEventService,this.valueService=e.valueService,this.menuService=e.menuService,this.ctrlsService=e.ctrlsService,this.navigationService=e.navigationService,this.focusService=e.focusService,this.undoRedoService=e.undoRedoService,this.visibleColsService=e.visibleColsService,this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel,this.rangeService=e.rangeService,this.clipboardService=e.clipboardService}constructor(e){super(),this.element=e}postConstruct(){this.addKeyboardListeners(),this.addMouseListeners(),this.mockContextMenuForIPad()}addKeyboardListeners(){const e="keydown",t=this.processKeyboardEvent.bind(this,e);this.addManagedElementListeners(this.element,{[e]:t})}addMouseListeners(){["dblclick","contextmenu","mouseover","mouseout","click",D("touchstart")?"touchstart":"mousedown"].forEach((e=>{const t=this.processMouseEvent.bind(this,e);this.addManagedElementListeners(this.element,{[e]:t})}))}processMouseEvent(e,t){if(!this.mouseEventService.isEventFromThisGrid(t)||M(t))return;const a=this.getRowForEvent(t),n=this.mouseEventService.getRenderedCellForEvent(t);"contextmenu"===e?this.handleContextMenuMouseEvent(t,void 0,a,n):(n&&n.onMouseEvent(e,t),a&&a.onMouseEvent(e,t))}mockContextMenuForIPad(){if(!Zt())return;const e=new ja(this.element);this.addManagedListeners(e,{longTap:e=>{const t=this.getRowForEvent(e.touchEvent),a=this.mouseEventService.getRend';
      S = S + 'eredCellForEvent(e.touchEvent);this.handleContextMenuMouseEvent(void 0,e.touchEvent,t,a)}}),this.addDestroyFunc((()=>e.destroy()))}getRowForEvent(e){let t=e.target;for(;t;){const e=this.gos.getDomData(t,Ii.DOM_DATA_KEY_ROW_CTRL);if(e)return e;t=t.parentElement}return null}handleContextMenuMouseEvent(e,t,a,n){const o=a?a.getRowNode():null,r=n?n.getColumn():null;let i=null;if(r){const a=e||t;n.dispatchCellContextMenuEvent(a??null),i=this.valueService.getValue(r,o)}const s=this.ctrlsService.getGridBodyCtrl(),l=n?n.getGui():s.getGridBodyElement();this.menuService.showContextMenu({mouseEvent:e,touchEvent:t,rowNode:o,column:r,value:i,anchorToElement:l})}getControlsForEventTarget(e){return{cellCtrl:E(this.gos,e,Pi.DOM_DATA_KEY_CELL_CTRL),rowCtrl:E(this.gos,e,Ii.DOM_DATA_KEY_ROW_CTRL)}}processKeyboardEvent(e,t){const{cellCtrl:a,rowCtrl:n}=this.getControlsForEventTarget(t.target);t.defaultPrevented||(a?this.processCellKeyboardEvent(a,e,t):n&&n.isFullWidth()&&this.processFullWidthRowKeyboardEvent(n,e,t))}processCellKeyboardEvent(e,t,a){const n=e.getRowNode(),o=e.getColumn(),r=e.isEditing();if(!zo(this.gos,a,n,o,r)&&"keydown"===t){!r&&this.navigationService.handlePageScrollingKey(a)||e.onKeyDown(a),this.doGridOperations(a,e.isEditing()),Ro(a)&&e.processCharacter(a)}if("keydown"===t){const t=e.createEvent(a,"cellKeyDown");this.eventService.dispatchEvent(t)}}processFullWidthRowKeyboardEvent(e,t,a){const n=e.getRowNode(),o=this.focusService.getFocusedCell(),r=o&&o.column;if(!zo(this.gos,a,n,r,!1)){const n=a.key;if("keydown"===t)switch(n){case tn.PAGE_HOME:case tn.PAGE_END:case tn.PAGE_UP:case tn.PAGE_DOWN:this.navigationService.handlePageScrollingKey(a,!0);break;case tn.UP:case tn.DOWN:e.onKeyboardNavigate(a);break;case tn.TAB:e.onTabKeyDown(a)}}if("keydown"===t){const t=e.createRowEvent("cellKeyDown",a);this.eventService.dispatchEvent(t)}}doGridOperations(e,t){if(!e.ctrlKey&&!e.metaKey)return;if(t)return;if(!this.mouseEventService.isEventFromThisGrid(e))return;const a=function(e';
      S = S + '){const{keyCode:t}=e;let a;switch(t){case 65:a=tn.A;break;case 67:a=tn.C;break;case 86:a=tn.V;break;case 68:a=tn.D;break;case 90:a=tn.Z;break;case 89:a=tn.Y;break;default:a=e.code}return a}(e);return a===tn.A?this.onCtrlAndA(e):a===tn.C?this.onCtrlAndC(e):a===tn.D?this.onCtrlAndD(e):a===tn.V?this.onCtrlAndV(e):a===tn.X?this.onCtrlAndX(e):a===tn.Y?this.onCtrlAndY():a===tn.Z?this.onCtrlAndZ(e):void 0}onCtrlAndA(e){const{pinnedRowModel:t,rowModel:a,rangeService:n}=this;if(n&&a.isRowsToRender()){const[e,o]=[t.isEmpty("top"),t.isEmpty("bottom")],r=e?null:"top";let i,s;o?(i=null,s=a.getRowCount()-1):(i="bottom",s=t.getPinnedBottomRowNodes().length-1);const l=this.visibleColsService.getAllCols();if(N(l))return;n.setCellRange({rowStartIndex:0,rowStartPinned:r,rowEndIndex:s,rowEndPinned:i,columnStart:l[0],columnEnd:d(l)})}e.preventDefault()}onCtrlAndC(e){if(!this.clipboardService||this.gos.get("enableCellTextSelection"))return;const{cellCtrl:t,rowCtrl:a}=this.getControlsForEventTarget(e.target);t?.isEditing()||a?.isEditing()||(e.preventDefault(),this.clipboardService.copyToClipboard())}onCtrlAndX(e){if(!this.clipboardService||this.gos.get("enableCellTextSelection")||this.gos.get("suppressCutToClipboard"))return;const{cellCtrl:t,rowCtrl:a}=this.getControlsForEventTarget(e.target);t?.isEditing()||a?.isEditing()||(e.preventDefault(),this.clipboardService.cutToClipboard(void 0,"ui"))}onCtrlAndV(e){const{cellCtrl:t,rowCtrl:a}=this.getControlsForEventTarget(e.target);t?.isEditing()||a?.isEditing()||this.clipboardService&&!this.gos.get("suppressClipboardPaste")&&this.clipboardService.pasteFromClipboard()}onCtrlAndD(e){this.clipboardService&&!this.gos.get("suppressClipboardPaste")&&this.clipboardService.copyRangeDown(),e.preventDefault()}onCtrlAndZ(e){this.gos.get("undoRedoCellEditing")&&this.undoRedoService&&(e.preventDefault(),e.shiftKey?this.undoRedoService.redo("ui"):this.undoRedoService.undo("ui"))}onCtrlAndY(){this.undoRedoService?.redo("ui")}},Oi=class extends A{wireBeans(e){';
      S = S + 'this.pinnedWidthService=e.pinnedWidthService}constructor(e){super(),this.element=e}postConstruct(){this.addManagedEventListeners({leftPinnedWidthChanged:this.onPinnedLeftWidthChanged.bind(this)})}onPinnedLeftWidthChanged(){const e=this.pinnedWidthService.getPinnedLeftWidth(),t=e>0;ra(this.element,t),Fa(this.element,e)}getWidth(){return this.pinnedWidthService.getPinnedLeftWidth()}},Ni=class extends A{wireBeans(e){this.pinnedWidthService=e.pinnedWidthService}constructor(e){super(),this.element=e}postConstruct(){this.addManagedEventListeners({rightPinnedWidthChanged:this.onPinnedRightWidthChanged.bind(this)})}onPinnedRightWidthChanged(){const e=this.pinnedWidthService.getPinnedRightWidth(),t=e>0;ra(this.element,t),Fa(this.element,e)}getWidth(){return this.pinnedWidthService.getPinnedRightWidth()}},Gi=e=>e.getTopRowCtrls(),qi=e=>e.getStickyTopRowCtrls(),Bi=e=>e.getStickyBottomRowCtrls(),Hi=e=>e.getBottomRowCtrls(),Vi=e=>e.getCentreRowCtrls(),Wi={center:{type:"center",container:"ag-center-cols-container",viewport:"ag-center-cols-viewport",getRowCtrls:Vi},left:{type:"left",container:"ag-pinned-left-cols-container",pinnedType:"left",getRowCtrls:Vi},right:{type:"right",container:"ag-pinned-right-cols-container",pinnedType:"right",getRowCtrls:Vi},fullWidth:{type:"fullWidth",container:"ag-full-width-container",fullWidth:!0,getRowCtrls:Vi},topCenter:{type:"center",container:"ag-floating-top-container",viewport:"ag-floating-top-viewport",getRowCtrls:Gi},topLeft:{type:"left",container:"ag-pinned-left-floating-top",pinnedType:"left",getRowCtrls:Gi},topRight:{type:"right",container:"ag-pinned-right-floating-top",pinnedType:"right",getRowCtrls:Gi},topFullWidth:{type:"fullWidth",container:"ag-floating-top-full-width-container",fullWidth:!0,getRowCtrls:Gi},stickyTopCenter:{type:"center",container:"ag-sticky-top-container",viewport:"ag-sticky-top-viewport",getRowCtrls:qi},stickyTopLeft:{type:"left",container:"ag-pinned-left-sticky-top",pinnedType:"left",getRowCtrls:qi},stickyTopRight';
      S = S + ':{type:"right",container:"ag-pinned-right-sticky-top",pinnedType:"right",getRowCtrls:qi},stickyTopFullWidth:{type:"fullWidth",container:"ag-sticky-top-full-width-container",fullWidth:!0,getRowCtrls:qi},stickyBottomCenter:{type:"center",container:"ag-sticky-bottom-container",viewport:"ag-sticky-bottom-viewport",getRowCtrls:Bi},stickyBottomLeft:{type:"left",container:"ag-pinned-left-sticky-bottom",pinnedType:"left",getRowCtrls:Bi},stickyBottomRight:{type:"right",container:"ag-pinned-right-sticky-bottom",pinnedType:"right",getRowCtrls:Bi},stickyBottomFullWidth:{type:"fullWidth",container:"ag-sticky-bottom-full-width-container",fullWidth:!0,getRowCtrls:Bi},bottomCenter:{type:"center",container:"ag-floating-bottom-container",viewport:"ag-floating-bottom-viewport",getRowCtrls:Hi},bottomLeft:{type:"left",container:"ag-pinned-left-floating-bottom",pinnedType:"left",getRowCtrls:Hi},bottomRight:{type:"right",container:"ag-pinned-right-floating-bottom",pinnedType:"right",getRowCtrls:Hi},bottomFullWidth:{type:"fullWidth",container:"ag-floating-bottom-full-width-container",fullWidth:!0,getRowCtrls:Hi}};function Ui(e){return Wi[e]}var ji=["center","left","right","fullWidth"],Ki=["stickyTopCenter","stickyBottomCenter","center","topCenter","bottomCenter"],Qi=["left","bottomLeft","topLeft","stickyTopLeft","stickyBottomLeft"],Yi=["right","bottomRight","topRight","stickyTopRight","stickyBottomRight"],_i=["stickyTopCenter","stickyTopLeft","stickyTopRight"],Ji=["stickyBottomCenter","stickyBottomLeft","stickyBottomRight"],Zi=[..._i,"stickyTopFullWidth",...Ji,"stickyBottomFullWidth"],Xi=["topCenter","topLeft","topRight","bottomCenter","bottomLeft","bottomRight","center","left","right",..._i,...Ji],$i=class extends A{constructor(e){super(),this.visible=!0,this.EMPTY_CTRLS=[],this.name=e,this.options=Ui(e)}wireBeans(e){this.dragService=e.dragService,this.ctrlsService=e.ctrlsService,this.columnViewportService=e.columnViewportService,this.resizeObserverService=e.resizeObserverService,this.row';
      S = S + 'Renderer=e.rowRenderer}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.forContainers(["center"],(()=>{this.viewportSizeFeature=this.createManagedBean(new vi(this)),this.addManagedEventListeners({stickyTopOffsetChanged:this.onStickyTopOffsetChanged.bind(this)})}))}onStickyTopOffsetChanged(e){this.comp.setOffsetTop(`${e.offset}px`)}registerWithCtrlsService(){this.options.fullWidth||this.ctrlsService.register(this.name,this)}forContainers(e,t){e.indexOf(this.name)>=0&&t()}getContainerElement(){return this.eContainer}getViewportSizeFeature(){return this.viewportSizeFeature}setComp(e,t,a){this.comp=e,this.eContainer=t,this.eViewport=a,this.createManagedBean(new Li(this.eContainer)),this.addPreventScrollWhileDragging(),this.listenOnDomOrder(),this.stopHScrollOnPinnedRows(),this.forContainers(Qi,(()=>{this.pinnedWidthFeature=this.createManagedBean(new Oi(this.eContainer)),this.addManagedEventListeners({leftPinnedWidthChanged:()=>this.onPinnedWidthChanged()})})),this.forContainers(Yi,(()=>{this.pinnedWidthFeature=this.createManagedBean(new Ni(this.eContainer)),this.addManagedEventListeners({rightPinnedWidthChanged:()=>this.onPinnedWidthChanged()})})),this.forContainers(ji,(()=>this.createManagedBean(new ci(this.eContainer,"center"===this.name?a:void 0)))),this.forContainers(Xi,(()=>this.createManagedBean(new bi(this.eContainer)))),this.forContainers(Ki,(()=>this.createManagedBean(new Or((e=>this.comp.setContainerWidth(`${e}px`)))))),this.addListeners(),this.registerWithCtrlsService()}addListeners(){this.addManagedEventListeners({displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),displayedColumnsWidthChanged:this.onDisplayedColumnsWidthChanged.bind(this),displayedRowsChanged:e=>this.onDisplayedRowsChanged(e.afterScroll)}),this.onDisplayedColumnsChanged(),this.onDisplayedColumnsWidthChanged(),this.onDisplayedRowsChanged()}listenOnDomOrder(){if(Zi.indexOf(this.name)>=0)return void this.comp.setDomOrder(!0);const e=()=>{const e=this.gos.get("ensureD';
      S = S + 'omOrder"),t=this.gos.isDomLayout("print");this.comp.setDomOrder(e||t)};this.addManagedPropertyListener("domLayout",e),e()}stopHScrollOnPinnedRows(){this.forContainers(["topCenter","stickyTopCenter","bottomCenter","stickyBottomCenter"],(()=>{this.addManagedElementListeners(this.eViewport,{scroll:()=>this.eViewport.scrollLeft=0})}))}onDisplayedColumnsChanged(){this.forContainers(["center"],(()=>this.onHorizontalViewportChanged()))}onDisplayedColumnsWidthChanged(){this.forContainers(["center"],(()=>this.onHorizontalViewportChanged()))}addPreventScrollWhileDragging(){const e=e=>{this.dragService.isDragging()&&e.cancelable&&e.preventDefault()};this.eContainer.addEventListener("touchmove",e,{passive:!1}),this.addDestroyFunc((()=>this.eContainer.removeEventListener("touchmove",e)))}onHorizontalViewportChanged(e=!1){const t=this.getCenterWidth(),a=this.getCenterViewportScrollLeft();this.columnViewportService.setScrollPosition(t,a,e)}getCenterWidth(){return da(this.eViewport)}getCenterViewportScrollLeft(){return fa(this.eViewport,this.enableRtl)}registerViewportResizeListener(e){const t=this.resizeObserverService.observeResize(this.eViewport,e);this.addDestroyFunc((()=>t()))}isViewportInTheDOMTree(){return wa(this.eViewport)}getViewportScrollLeft(){return fa(this.eViewport,this.enableRtl)}isHorizontalScrollShowing(){return this.gos.get("alwaysShowHorizontalScroll")||(e=this.eViewport).clientWidth<e.scrollWidth;var e}getViewportElement(){return this.eViewport}setContainerTranslateX(e){this.eContainer.style.transform=`translateX(${e}px)`}getHScrollPosition(){return{left:this.eViewport.scrollLeft,right:this.eViewport.scrollLeft+this.eViewport.offsetWidth}}setCenterViewportScrollLeft(e){va(this.eViewport,e,this.enableRtl)}isContainerVisible(){return!(null!=this.options.pinnedType)||!!this.pinnedWidthFeature&&this.pinnedWidthFeature.getWidth()>0}onPinnedWidthChanged(){const e=this.isContainerVisible();this.visible!=e&&(this.visible=e,this.onDisplayedRowsChanged())}onDisplayedRows';
      S = S + 'Changed(e=!1){const t=this.options.getRowCtrls(this.rowRenderer);if(!this.visible||0===t.length)return void this.comp.setRowCtrls({rowCtrls:this.EMPTY_CTRLS});const a=this.gos.isDomLayout("print"),n=this.gos.get("embedFullWidthRows")||a,o=t.filter((e=>{const t=e.isFullWidth();return this.options.fullWidth?!n&&t:n||!t}));this.comp.setRowCtrls({rowCtrls:o,useFlushSync:e})}};var es=class extends Ba{constructor(){super(),this.eViewport=qa,this.eContainer=qa,this.rowComps={},this.name=Ba.elementGettingCreated.getAttribute("name"),this.options=Ui(this.name),this.setTemplate(function(e){let t;return t="center"===e.type?`<div class="${e.viewport}" data-ref="eViewport" role="presentation">\\n                <div class="${e.container}" data-ref="eContainer"></div>\\n            </div>`:`<div class="${e.container}" data-ref="eContainer"></div>`,t}(this.options))}wireBeans(e){this.beans=e}postConstruct(){const e={setViewportHeight:e=>this.eViewport.style.height=e,setRowCtrls:({rowCtrls:e})=>this.setRowCtrls(e),setDomOrder:e=>{this.domOrder=e},setContainerWidth:e=>this.eContainer.style.width=e,setOffsetTop:e=>this.eContainer.style.transform=`translateY(${e})`};this.createManagedBean(new $i(this.name)).setComp(e,this.eContainer,this.eViewport)}destroy(){this.setRowCtrls([]),super.destroy()}setRowCtrls(e){const t={...this.rowComps};this.rowComps={},this.lastPlacedElement=null;e.forEach((e=>{const a=e.getInstanceId(),n=t[a];if(n)this.rowComps[a]=n,delete t[a],this.ensureDomOrder(n.getGui());else{if(!e.getRowNode().displayed)return;const t=new fi(e,this.beans,this.options.type);this.rowComps[a]=t,this.appendRow(t.getGui())}})),Y(t).forEach((e=>{this.eContainer.removeChild(e.getGui()),e.destroy()})),yt(this.eContainer,"rowgroup")}appendRow(e){var t,a,n;this.domOrder?(t=this.eContainer,a=e,(n=this.lastPlacedElement)?n.insertAdjacentElement("afterend",a):t.firstChild?t.insertAdjacentElement("afterbegin",a):t.appendChild(a)):this.eContainer.appendChild(e),this.lastPlacedElement=e}ensureDo';
      S = S + 'mOrder(e){this.domOrder&&(ka(this.eContainer,e,this.lastPlacedElement),this.lastPlacedElement=e)}},ts={selector:"AG-ROW-CONTAINER",component:es};function as(e){return e.map((e=>`<ag-row-container name="${e}"></ag-row-container>`)).join("")}var ns=`<div class="ag-root ag-unselectable" role="treegrid">\\n        <ag-header-root></ag-header-root>\\n        <div class="ag-floating-top" data-ref="eTop" role="presentation">\\n            ${as(["topLeft","topCenter","topRight","topFullWidth"])}\\n        </div>\\n        <div class="ag-body" data-ref="eBody" role="presentation">\\n            <div class="ag-body-viewport" data-ref="eBodyViewport" role="presentation">\\n            ${as(["left","center","right","fullWidth"])}\\n            </div>\\n            <ag-fake-vertical-scroll></ag-fake-vertical-scroll>\\n        </div>\\n        <div class="ag-sticky-top" data-ref="eStickyTop" role="presentation">\\n            ${as(["stickyTopLeft","stickyTopCenter","stickyTopRight","stickyTopFullWidth"])}\\n        </div>\\n        <div class="ag-sticky-bottom" data-ref="eStickyBottom" role="presentation">\\n            ${as(["stickyBottomLeft","stickyBottomCenter","stickyBottomRight","stickyBottomFullWidth"])}\\n        </div>\\n        <div class="ag-floating-bottom" data-ref="eBottom" role="presentation">\\n            ${as(["bottomLeft","bottomCenter","bottomRight","bottomFullWidth"])}\\n        </div>\\n        <ag-fake-horizontal-scroll></ag-fake-horizontal-scroll>\\n        <ag-overlay-wrapper></ag-overlay-wrapper>\\n    </div>`,os=class extends Ba{constructor(){super(ns,[ri,li,di,ti,ts]),this.eBodyViewport=qa,this.eStickyTop=qa,this.eStickyBottom=qa,this.eTop=qa,this.eBottom=qa,this.eBody=qa}wireBeans(e){this.resizeObserverService=e.resizeObserverService,this.rangeService=e.rangeService}postConstruct(){const e=(e,t)=>{const a=`${e}px`;t.style.minHeight=a,t.style.height=a},t={setRowAnimationCssOnBodyViewport:(e,t)=>this.setRowAnimationCssOnBodyViewport(e,t),setColumnCount:e=>Nt(this.getGui(),e)';
      S = S + ',setRowCount:e=>Lt(this.getGui(),e),setTopHeight:t=>e(t,this.eTop),setBottomHeight:t=>e(t,this.eBottom),setTopDisplay:e=>this.eTop.style.display=e,setBottomDisplay:e=>this.eBottom.style.display=e,setStickyTopHeight:e=>this.eStickyTop.style.height=e,setStickyTopTop:e=>this.eStickyTop.style.top=e,setStickyTopWidth:e=>this.eStickyTop.style.width=e,setStickyBottomHeight:e=>this.eStickyBottom.style.height=e,setStickyBottomBottom:e=>this.eStickyBottom.style.bottom=e,setStickyBottomWidth:e=>this.eStickyBottom.style.width=e,setColumnMovingCss:(e,t)=>this.addOrRemoveCssClass(e,t),updateLayoutClasses:(e,t)=>{[this.eBodyViewport.classList,this.eBody.classList].forEach((e=>{e.toggle("ag-layout-auto-height",t.autoHeight),e.toggle("ag-layout-normal",t.normal),e.toggle("ag-layout-print",t.print)})),this.addOrRemoveCssClass("ag-layout-auto-height",t.autoHeight),this.addOrRemoveCssClass("ag-layout-normal",t.normal),this.addOrRemoveCssClass("ag-layout-print",t.print)},setAlwaysVerticalScrollClass:(e,t)=>this.eBodyViewport.classList.toggle(ui,t),registerBodyViewportResizeListener:e=>{const t=this.resizeObserverService.observeResize(this.eBodyViewport,e);this.addDestroyFunc((()=>t()))},setPinnedTopBottomOverflowY:e=>this.eTop.style.overflowY=this.eBottom.style.overflowY=e,setCellSelectableCss:(e,t)=>{[this.eTop,this.eBodyViewport,this.eBottom].forEach((a=>a.classList.toggle(e,t)))},setBodyViewportWidth:e=>this.eBodyViewport.style.width=e};this.ctrl=this.createManagedBean(new pi),this.ctrl.setComp(t,this.getGui(),this.eBodyViewport,this.eTop,this.eBottom,this.eStickyTop,this.eStickyBottom),(this.rangeService&&this.gos.get("enableRangeSelection")||"multiple"===this.gos.get("rowSelection"))&&bt(this.getGui(),"multiselectable",!0)}setRowAnimationCssOnBodyViewport(e,t){const a=this.eBodyViewport.classList;a.toggle("ag-row-animation",t),a.toggle("ag-row-no-animation",!t)}getFloatingTopBottom(){return[this.eTop,this.eBottom]}},rs={selector:"AG-GRID-BODY",component:os},is=class extends A{const';
      S = S + 'ructor(){super(...arguments),this.beanName="scrollVisibleService"}wireBeans(e){this.ctrlsService=e.ctrlsService,this.columnAnimationService=e.columnAnimationService}postConstruct(){this.addManagedEventListeners({displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),displayedColumnsWidthChanged:this.onDisplayedColumnsWidthChanged.bind(this)})}onDisplayedColumnsChanged(){this.update()}onDisplayedColumnsWidthChanged(){this.update()}update(){this.columnAnimationService.isActive()?this.columnAnimationService.executeLaterVMTurn((()=>{this.columnAnimationService.executeLaterVMTurn((()=>this.updateImpl()))})):this.updateImpl()}updateImpl(){const e=this.ctrlsService.get("center");if(!e||this.columnAnimationService.isActive())return;const t={horizontalScrollShowing:e.isHorizontalScrollShowing(),verticalScrollShowing:this.isVerticalScrollShowing()};this.setScrollsVisible(t)}setScrollsVisible(e){if(this.horizontalScrollShowing!==e.horizontalScrollShowing||this.verticalScrollShowing!==e.verticalScrollShowing){this.horizontalScrollShowing=e.horizontalScrollShowing,this.verticalScrollShowing=e.verticalScrollShowing;const t={type:"scrollVisibilityChanged"};this.eventService.dispatchEvent(t)}}isHorizontalScrollShowing(){return this.horizontalScrollShowing}isVerticalScrollShowing(){return this.verticalScrollShowing}},ss="__ag_grid_instance",ls=class e extends A{constructor(){super(...arguments),this.beanName="mouseEventService",this.gridInstanceId=e.gridInstanceSequence.next()}wireBeans(e){this.ctrlsService=e.ctrlsService}stampTopLevelGridCompWithGridInstance(e){e[ss]=this.gridInstanceId}getRenderedCellForEvent(e){return E(this.gos,e.target,Pi.DOM_DATA_KEY_CELL_CTRL)}isEventFromThisGrid(e){return this.isElementInThisGrid(e.target)}isElementInThisGrid(e){let t=e;for(;t;){const e=t[ss];if(L(e)){return e===this.gridInstanceId}t=t.parentElement}return!1}getCellPositionForEvent(e){const t=this.getRenderedCellForEvent(e);return t?t.getCellPosition():null}getNormalisedPosition(e';
      S = S + '){const t=this.gos.isDomLayout("normal"),a=e;let n,o;if(null!=a.clientX||null!=a.clientY?(n=a.clientX,o=a.clientY):(n=a.x,o=a.y),t){const e=this.ctrlsService.getGridBodyCtrl(),t=e.getScrollFeature().getVScrollPosition();n+=e.getScrollFeature().getHScrollPosition().left,o+=t.top}return{x:n,y:o}}};ls.gridInstanceSequence=new Ia;var cs=ls,gs=class extends A{constructor(){super(),this.beanName="navigationService",this.onPageDown=ve(this.onPageDown,100),this.onPageUp=ve(this.onPageUp,100)}wireBeans(e){this.mouseEventService=e.mouseEventService,this.pageBoundsService=e.pageBoundsService,this.focusService=e.focusService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.rowModel=e.rowModel,this.ctrlsService=e.ctrlsService,this.rowRenderer=e.rowRenderer,this.headerNavigationService=e.headerNavigationService,this.rowPositionUtils=e.rowPositionUtils,this.cellNavigationService=e.cellNavigationService,this.pinnedRowModel=e.pinnedRowModel,this.rangeService=e.rangeService}postConstruct(){this.ctrlsService.whenReady((e=>{this.gridBodyCon=e.gridBodyCtrl}))}handlePageScrollingKey(e,t=!1){const a=e.key,n=e.altKey,o=e.ctrlKey||e.metaKey,r=!!this.rangeService&&e.shiftKey,i=this.mouseEventService.getCellPositionForEvent(e);let s=!1;switch(a){case tn.PAGE_HOME:case tn.PAGE_END:o||n||(this.onHomeOrEndKey(a),s=!0);break;case tn.LEFT:case tn.RIGHT:case tn.UP:case tn.DOWN:if(!i)return!1;!o||n||r||(this.onCtrlUpDownLeftRight(a,i),s=!0);break;case tn.PAGE_DOWN:case tn.PAGE_UP:o||n||(s=this.handlePageUpDown(a,i,t))}return s&&e.preventDefault(),s}handlePageUpDown(e,t,a){return a&&(t=this.focusService.getFocusedCell()),!!t&&(e===tn.PAGE_UP?this.onPageUp(t):this.onPageDown(t),!0)}navigateTo(e){const{scrollIndex:t,scrollType:a,scrollColumn:n,focusIndex:o,focusColumn:r}=e;L(n)&&!n.isPinned()&&this.gridBodyCon.getScrollFeature().ensureColumnVisible(n),L(t)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(t,a),e.isAsync||this.gridBodyCon.getScrollFeature().ensureIn';
      S = S + 'dexVisible(o),this.focusService.setFocusedCell({rowIndex:o,column:r,rowPinned:null,forceBrowserFocus:!0}),this.rangeService?.setRangeToCell({rowIndex:o,rowPinned:null,column:r})}onPageDown(e){const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),a=this.getViewportHeight(),n=this.pageBoundsService.getPixelOffset(),o=t.top+a,r=this.rowModel.getRowIndexAtPixel(o+n);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(e,r):this.navigateToNextPage(e,r)}onPageUp(e){const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),a=this.pageBoundsService.getPixelOffset(),n=t.top,o=this.rowModel.getRowIndexAtPixel(n+a);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(e,o,!0):this.navigateToNextPage(e,o,!0)}navigateToNextPage(e,t,a=!1){const n=this.getViewportHeight(),o=this.pageBoundsService.getFirstRow(),r=this.pageBoundsService.getLastRow(),i=this.pageBoundsService.getPixelOffset(),s=this.rowModel.getRow(e.rowIndex),l=a?s?.rowHeight-n-i:n-i,c=s?.rowTop+l;let g,d=this.rowModel.getRowIndexAtPixel(c+i);if(d===e.rowIndex){const n=a?-1:1;t=d=e.rowIndex+n}a?(g="bottom",d<o&&(d=o),t<o&&(t=o)):(g="top",d>r&&(d=r),t>r&&(t=r)),this.isRowTallerThanView(d)&&(t=d,g="top"),this.navigateTo({scrollIndex:t,scrollType:g,scrollColumn:null,focusIndex:d,focusColumn:e.column})}navigateToNextPageWithAutoHeight(e,t,a=!1){this.navigateTo({scrollIndex:t,scrollType:a?"bottom":"top",scrollColumn:null,focusIndex:t,focusColumn:e.column}),setTimeout((()=>{const n=this.getNextFocusIndexForAutoHeight(e,a);this.navigateTo({scrollIndex:t,scrollType:a?"bottom":"top",scrollColumn:null,focusIndex:n,focusColumn:e.column,isAsync:!0})}),50)}getNextFocusIndexForAutoHeight(e,t=!1){const a=t?-1:1,n=this.getViewportHeight(),o=this.pageBoundsService.getLastRow();let r=0,i=e.rowIndex;for(;i>=0&&i<=o;){const e=this.rowModel.getRow(i);if(e){const t=e.rowHeight??0;if(r+t>n)break;r+=t}i+=a}return Math.max(0,Math.min(i,';
      S = S + 'o))}getViewportHeight(){const{gridBodyCtrl:e,center:t}=this.ctrlsService.getParams(),a=e.getScrollFeature().getVScrollPosition(),n=this.gos.getScrollbarWidth();let o=a.bottom-a.top;return t.isHorizontalScrollShowing()&&(o-=n),o}isRowTallerThanView(e){const t=this.rowModel.getRow(e);if(!t)return!1;const a=t.rowHeight;return"number"==typeof a&&a>this.getViewportHeight()}onCtrlUpDownLeftRight(e,t){const a=this.cellNavigationService.getNextCellToFocus(e,t,!0),{rowIndex:n}=a,o=a.column;this.navigateTo({scrollIndex:n,scrollType:null,scrollColumn:o,focusIndex:n,focusColumn:o})}onHomeOrEndKey(e){const t=e===tn.PAGE_HOME,a=this.visibleColsService.getAllCols(),n=t?a[0]:d(a),o=t?this.pageBoundsService.getFirstRow():this.pageBoundsService.getLastRow();this.navigateTo({scrollIndex:o,scrollType:null,scrollColumn:n,focusIndex:o,focusColumn:n})}onTabKeyDown(e,t){const a=t.shiftKey,n=this.tabToNextCellCommon(e,a,t);if(!1===n)if(a){const{rowIndex:a,rowPinned:n}=e.getRowPosition();(n?0===a:a===this.pageBoundsService.getFirstRow())&&(0===this.gos.get("headerHeight")||this.gos.get("suppressHeaderFocus")?this.focusService.focusNextGridCoreContainer(!0,!0):(t.preventDefault(),this.focusService.focusPreviousFromFirstCell(t)))}else e instanceof Pi&&e.focusCell(!0),this.focusService.focusNextGridCoreContainer(a)&&t.preventDefault();else n&&t.preventDefault()}tabToNextCell(e,t){const a=this.focusService.getFocusedCell();if(!a)return!1;let n=this.getCellByPosition(a);return!!(n||(n=this.rowRenderer.getRowByPosition(a),n&&n.isFullWidth()))&&!!this.tabToNextCellCommon(n,e,t)}tabToNextCellCommon(e,t,a){let n,o=e.isEditing();if(!o&&e instanceof Pi){const t=e.getRowCtrl();t&&(o=t.isEditing())}return n=o?"fullRow"===this.gos.get("editType")?this.moveToNextEditingRow(e,t,a):this.moveToNextEditingCell(e,t,a):this.moveToNextCellNotEditing(e,t),null===n?n:n||!!this.focusService.getFocusedHeader()}moveToNextEditingCell(e,t,a=null){const n=e.getCellPosition();e.getGui().focus(),e.stopEditing();const o=thi';
      S = S + 's.findNextCellToFocusOn(n,t,!0);return!1===o?null:null!=o&&(o.startEditing(null,!0,a),o.focusCell(!1),!0)}moveToNextEditingRow(e,t,a=null){const n=e.getCellPosition(),o=this.findNextCellToFocusOn(n,t,!0);if(!1===o)return null;if(null==o)return!1;const r=o.getCellPosition(),i=this.isCellEditable(n),s=this.isCellEditable(r),l=r&&n.rowIndex===r.rowIndex&&n.rowPinned===r.rowPinned;if(i&&e.setFocusOutOnEditor(),!l){e.getRowCtrl().stopEditing();o.getRowCtrl().startRowEditing(void 0,void 0,a)}return s?(o.setFocusInOnEditor(),o.focusCell()):o.focusCell(!0),!0}moveToNextCellNotEditing(e,t){const a=this.visibleColsService.getAllCols();let n;n=e instanceof Ii?{...e.getRowPosition(),column:t?a[0]:d(a)}:e.getCellPosition();const o=this.findNextCellToFocusOn(n,t,!1);if(!1===o)return null;if(o instanceof Pi)o.focusCell(!0);else if(o)return this.tryToFocusFullWidthRow(o.getRowPosition(),t);return L(o)}findNextCellToFocusOn(e,t,a){let n=e;for(;;){e!==n&&(e=n),t||(n=this.getLastCellOfColSpan(n)),n=this.cellNavigationService.getNextTabbedCell(n,t);const o=this.gos.getCallback("tabToNextCell");if(L(o)){const r=o({backwards:t,editing:a,previousCellPosition:e,nextCellPosition:n||null});if(!0===r||null===r)null===r&&ce("Returning `null` from tabToNextCell is deprecated. Return `true` to stay on the current cell, or `false` to let the browser handle the tab behaviour."),n=e;else{if(!1===r)return!1;n={rowIndex:r.rowIndex,column:r.column,rowPinned:r.rowPinned}}}if(!n)return null;if(n.rowIndex<0){const e=this.headerNavigationService.getHeaderRowCount();return this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:e+n.rowIndex,column:n.column},fromCell:!0}),null}const r="fullRow"===this.gos.get("editType");if(a&&!r){if(!this.isCellEditable(n))continue}this.ensureCellVisible(n);const i=this.getCellByPosition(n);if(!i){const e=this.rowRenderer.getRowByPosition(n);if(!e||!e.isFullWidth()||a)continue;return e}if(!i.isSuppressNavigable())return this.rangeService?.setRangeToCell(n),i}';
      S = S + '}isCellEditable(e){const t=this.lookupRowNodeForCell(e);return!!t&&e.column.isCellEditable(t)}getCellByPosition(e){const t=this.rowRenderer.getRowByPosition(e);return t?t.getCellCtrl(e.column):null}lookupRowNodeForCell(e){return"top"===e.rowPinned?this.pinnedRowModel.getPinnedTopRow(e.rowIndex):"bottom"===e.rowPinned?this.pinnedRowModel.getPinnedBottomRow(e.rowIndex):this.rowModel.getRow(e.rowIndex)}navigateToNextCell(e,t,a,n){let o=a,r=!1;for(;o&&(o===a||!this.isValidNavigateCell(o));)this.gos.get("enableRtl")?t===tn.LEFT&&(o=this.getLastCellOfColSpan(o)):t===tn.RIGHT&&(o=this.getLastCellOfColSpan(o)),o=this.cellNavigationService.getNextCellToFocus(t,o),r=O(o);if(r&&e&&e.key===tn.UP&&(o={rowIndex:-1,rowPinned:null,column:a.column}),n){const n=this.gos.getCallback("navigateToNextCell");if(L(n)){const r=n({key:t,previousCellPosition:a,nextCellPosition:o||null,event:e});o=L(r)?{rowPinned:r.rowPinned,rowIndex:r.rowIndex,column:r.column}:null}}if(!o)return;if(o.rowIndex<0){const t=this.headerNavigationService.getHeaderRowCount();return void this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:t+o.rowIndex,column:a.column},event:e||void 0,fromCell:!0})}const i=this.getNormalisedPosition(o);i?this.focusPosition(i):this.tryToFocusFullWidthRow(o)}getNormalisedPosition(e){this.ensureCellVisible(e);const t=this.getCellByPosition(e);return t?(e=t.getCellPosition(),this.ensureCellVisible(e),e):null}tryToFocusFullWidthRow(e,t=!1){const a=this.visibleColsService.getAllCols(),n=this.rowRenderer.getRowByPosition(e);if(!n||!n.isFullWidth())return!1;const o=this.focusService.getFocusedCell(),r={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column||(t?d(a):a[0])};this.focusPosition(r);const i=null!=o&&this.rowPositionUtils.before(r,o),s={type:"fullWidthRowFocused",rowIndex:r.rowIndex,rowPinned:r.rowPinned,column:r.column,isFullWidthCell:!0,fromBelow:i};return this.eventService.dispatchEvent(s),!0}focusPosition(e){this.focusService.setFocusedCell({rowIndex:e.rowIn';
      S = S + 'dex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0}),this.rangeService?.setRangeToCell(e)}isValidNavigateCell(e){return!!this.rowPositionUtils.getRowNode(e)}getLastCellOfColSpan(e){const t=this.getCellByPosition(e);if(!t)return e;const a=t.getColSpanningList();return 1===a.length?e:{rowIndex:e.rowIndex,column:d(a),rowPinned:e.rowPinned}}ensureCellVisible(e){const t=this.gos.isGroupRowsSticky(),a=this.rowModel.getRow(e.rowIndex);!(t&&a?.sticky)&&O(e.rowPinned)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(e.rowIndex),e.column.isPinned()||this.gridBodyCon.getScrollFeature().ensureColumnVisible(e.column)}},ds=class extends A{constructor(){super(...arguments),this.beanName="horizontalResizeService"}wireBeans(e){this.dragService=e.dragService,this.ctrlsService=e.ctrlsService}addResizeBar(e){const t={dragStartPixels:e.dragStartPixels||0,eElement:e.eResizeBar,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this,e),onDragging:this.onDragging.bind(this,e),includeTouch:!0,stopPropagationForTouch:!0};this.dragService.addDragSource(t);return()=>this.dragService.removeDragSource(t)}onDragStart(e,t){this.dragStartX=t.clientX,this.setResizeIcons();const a=t instanceof MouseEvent&&!0===t.shiftKey;e.onResizeStart(a)}setResizeIcons(){const e=this.ctrlsService.get("gridCtrl");e.setResizeCursor(!0),e.disableUserSelect(!0)}onDragStop(e,t){e.onResizeEnd(this.resizeAmount),this.resetIcons()}resetIcons(){const e=this.ctrlsService.get("gridCtrl");e.setResizeCursor(!1),e.disableUserSelect(!1)}onDragging(e,t){this.resizeAmount=t.clientX-this.dragStartX,e.onResizing(this.resizeAmount)}},hs=class extends A{constructor(){super(...arguments),this.beanName="filterMenuFactory"}wireBeans(e){this.popupService=e.popupService,this.focusService=e.focusService,this.ctrlsService=e.ctrlsService,this.menuService=e.menuService}hideActiveMenu(){this.hidePopup&&this.hidePopup()}showMenuAfterMouseEvent(e,t,a){this.showPopup(e,(n=>{this.popupService.positionPopupUn';
      S = S + 'derMouseEvent({column:e,type:a,mouseEvent:t,ePopup:n})}),a,t.target,this.menuService.isLegacyMenuEnabled())}showMenuAfterButtonClick(e,t,a){let n=-1,o="left";const r=this.menuService.isLegacyMenuEnabled();!r&&this.gos.get("enableRtl")&&(n=1,o="right");const i=r?void 0:4*n,s=r?void 0:4;this.showPopup(e,(n=>{this.popupService.positionPopupByComponent({type:a,eventSource:t,ePopup:n,nudgeX:i,nudgeY:s,alignSide:o,keepWithinBounds:!0,position:"under",column:e})}),a,t,r)}showPopup(e,t,a,n,o){const r=e?this.createBean(new io(e,"COLUMN_MENU")):void 0;if(this.activeMenu=r,!r?.hasFilter()||!e)throw new Error("AG Grid - unable to show popup filter, filter instantiation failed");const i=document.createElement("div");let s;yt(i,"presentation"),i.classList.add("ag-menu"),o||i.classList.add("ag-filter-menu"),[this.tabListener]=this.addManagedElementListeners(i,{keydown:e=>this.trapFocusWithin(e,i)}),i.appendChild(r?.getGui());const l=this.menuService.isColumnMenuAnchoringEnabled()?n??this.ctrlsService.getGridBodyCtrl().getGui():void 0,c=this.localeService.getLocaleTextFunc(),g=o&&"columnFilter"!==a?c("ariaLabelColumnMenu","Column Menu"):c("ariaLabelColumnFilter","Column Filter"),d=this.popupService.addPopup({modal:!0,eChild:i,closeOnEsc:!0,closedCallback:t=>{e.setMenuVisible(!1,"contextMenu");const o=t instanceof KeyboardEvent;if(this.tabListener&&(this.tabListener=this.tabListener()),o&&n&&ya(n)){const e=this.focusService.findTabbableParent(n);e&&e.focus()}r?.afterGuiDetached(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,a,e)},positionCallback:()=>t(i),anchorToElement:l,ariaLabel:g});d&&(this.hidePopup=s=d.hideFunc),r.afterInit().then((()=>{t(i),r.afterGuiAttached({container:a,hidePopup:s})})),e.setMenuVisible(!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,a,e)}trapFocusWithin(e,t){e.key!==tn.TAB||e.defaultPrevented||this.focusService.findNextFocusableElement(t,!1,e.shiftKey)||(e.preventDefault(),this.focusService.focusInto(t,e.shiftKey))}dispatchV';
      S = S + 'isibleChangedEvent(e,t,a){const n={type:"columnMenuVisibleChanged",visible:e,switchingTab:!1,key:t,column:a??null};this.eventService.dispatchEvent(n)}isMenuEnabled(e){return e.isFilterAllowed()&&(e.getColDef().menuTabs??["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}destroy(){this.destroyBean(this.activeMenu),super.destroy()}},us=class extends A{constructor(){super(...arguments),this.beanName="resizeObserverService",this.polyfillFunctions=[]}observeResize(e,t){const a=this.gos.getWindow(),n=()=>{let a=e?.clientWidth??0,n=e?.clientHeight??0,o=!0;const r=()=>{if(o){const o=e?.clientWidth??0,i=e?.clientHeight??0;(o!==a||i!==n)&&(a=o,n=i,t()),this.doNextPolyfillTurn(r)}};return r(),()=>o=!1},o=this.gos.get("suppressBrowserResizeObserver");return!!a.ResizeObserver&&!o?(()=>{const n=new a.ResizeObserver(t);return n.observe(e),()=>n.disconnect()})():this.getFrameworkOverrides().wrapIncoming((()=>n()),"resize-observer")}doNextPolyfillTurn(e){this.polyfillFunctions.push(e),this.schedulePolyfill()}schedulePolyfill(){if(this.polyfillScheduled)return;this.polyfillScheduled=!0,window.setTimeout((()=>{const e=this.polyfillFunctions;this.polyfillScheduled=!1,this.polyfillFunctions=[],e.forEach((e=>e()))}),50)}},ps=class extends A{constructor(){super(...arguments),this.beanName="animationFrameService",this.createTasksP1={list:[],sorted:!1},this.createTasksP2={list:[],sorted:!1},this.destroyTasks=[],this.ticking=!1,this.scrollGoingDown=!0,this.lastPage=0,this.lastScrollTop=0,this.taskCount=0,this.cancelledTasks=new Set}wireBeans(e){this.ctrlsService=e.ctrlsService,this.paginationService=e.paginationService}setScrollTop(e){const t=this.gos.get("pagination");if(this.scrollGoingDown=e>=this.lastScrollTop,t&&0===e){const e=this.paginationService?.getCurrentPage()??0;e!==this.lastPage&&(this.lastPage=e,this.scrollGoingDown=!0)}this.lastScrollTop=e}postConstruct(){this.useAnimationFrame=!this.gos.get("suppressAnimationFrame")}isOn(){return this.useAnimationF';
      S = S + 'rame}verifyAnimationFrameOn(e){!1===this.useAnimationFrame&&ce(`AnimationFrameService.${e} called but animation frames are off`)}createTask(e,t,a){this.verifyAnimationFrameOn(a);const n={task:e,index:t,createOrder:++this.taskCount};this.addTaskToList(this[a],n),this.schedule()}cancelTask(e){this.cancelledTasks.add(e)}addTaskToList(e,t){e.list.push(t),e.sorted=!1}sortTaskList(e){if(e.sorted)return;const t=this.scrollGoingDown?1:-1;e.list.sort(((e,a)=>e.index!==a.index?t*(a.index-e.index):a.createOrder-e.createOrder)),e.sorted=!0}addDestroyTask(e){this.verifyAnimationFrameOn("createTasksP3"),this.destroyTasks.push(e),this.schedule()}executeFrame(e){this.verifyAnimationFrameOn("executeFrame");const t=this.createTasksP1,a=t.list,n=this.createTasksP2,o=n.list,r=this.destroyTasks,i=(new Date).getTime();let s=(new Date).getTime()-i;const l=e<=0,c=this.ctrlsService.getGridBodyCtrl();for(;l||s<e;){if(!c.getScrollFeature().scrollGridIfNeeded()){let e;if(a.length)this.sortTaskList(t),e=a.pop().task;else if(o.length)this.sortTaskList(n),e=o.pop().task;else{if(!r.length){this.cancelledTasks.clear();break}e=r.pop()}this.cancelledTasks.has(e)||e()}s=(new Date).getTime()-i}a.length||o.length||r.length?this.requestFrame():this.stopTicking()}stopTicking(){this.ticking=!1}flushAllFrames(){this.useAnimationFrame&&this.executeFrame(-1)}schedule(){this.useAnimationFrame&&(this.ticking||(this.ticking=!0,this.requestFrame()))}requestFrame(){const e=this.executeFrame.bind(this,60);this.requestAnimationFrame(e)}requestAnimationFrame(e){const t=this.gos.getWindow();t.requestAnimationFrame?t.requestAnimationFrame(e):t.webkitRequestAnimationFrame?t.webkitRequestAnimationFrame(e):t.setTimeout(e,0)}isQueueEmpty(){return!this.ticking}debounce(e){let t=!1;return()=>{this.isOn()?t||(t=!0,this.addDestroyTask((()=>{t=!1,e()}))):window.setTimeout(e,0)}}},ms=(e=>(e.EVERYTHING="group",e.FILTER="filter",e.SORT="sort",e.MAP="map",e.AGGREGATE="aggregate",e.FILTER_AGGREGATES="filter_aggregates",e.PIVOT="pivo';
      S = S + 't",e.NOTHING="nothing",e))(ms||{}),fs=class extends A{constructor(){super(...arguments),this.beanName="expansionService"}wireBeans(e){this.rowModel=e.rowModel}postConstruct(){this.isClientSideRowModel="clientSide"===this.rowModel.getType()}expandRows(e){if(!this.isClientSideRowModel)return;const t=new Set(e);this.rowModel.forEachNode((e=>{e.id&&t.has(e.id)&&(e.expanded=!0)})),this.onGroupExpandedOrCollapsed()}getExpandedRows(){const e=[];return this.rowModel.forEachNode((({expanded:t,id:a})=>{t&&a&&e.push(a)})),e}expandAll(e){this.isClientSideRowModel&&this.rowModel.expandOrCollapseAll(e)}setRowNodeExpanded(e,t,a,n){e&&(a&&e.parent&&-1!==e.parent.level&&this.setRowNodeExpanded(e.parent,t,a,n),e.setExpanded(t,void 0,n))}onGroupExpandedOrCollapsed(){this.isClientSideRowModel&&this.rowModel.refreshModel({step:"map"})}},vs=class extends A{constructor(){super(...arguments),this.beanName="menuService"}wireBeans(e){this.filterMenuFactory=e.filterMenuFactory,this.ctrlsService=e.ctrlsService,this.animationFrameService=e.animationFrameService,this.filterManager=e.filterManager,this.rowRenderer=e.rowRenderer,this.columnChooserFactory=e.columnChooserFactory,this.contextMenuFactory=e.contextMenuFactory,this.enterpriseMenuFactory=e.enterpriseMenuFactory}postConstruct(){this.activeMenuFactory=this.enterpriseMenuFactory??this.filterMenuFactory}showColumnMenu(e){this.showColumnMenuCommon(this.activeMenuFactory,e,"columnMenu")}showFilterMenu(e){const t=this.enterpriseMenuFactory&&this.isLegacyMenuEnabled()?this.enterpriseMenuFactory:this.filterMenuFactory;this.showColumnMenuCommon(t,e,e.containerType,!0)}showHeaderContextMenu(e,t,a){this.activeMenuFactory.showMenuAfterContextMenuEvent(e,t,a)}getContextMenuPosition(e,t){const a=this.getRowCtrl(e),n=this.getCellGui(a,t);if(!n)return a?{x:0,y:a.getRowYPosition()}:{x:0,y:0};const o=n.getBoundingClientRect();return{x:o.x+o.width/2,y:o.y+o.height/2}}showContextMenu(e){const{rowNode:t}=e,a=e.column;let{anchorToElement:n,value:o}=e;t&&a&&nul';
      S = S + 'l==o&&(o=t.getValueFromValueService(a)),null==n&&(n=this.getContextMenuAnchorElement(t,a)),this.contextMenuFactory?.onContextMenu(e.mouseEvent??null,e.touchEvent??null,t??null,a??null,o,n)}showColumnChooser(e){this.columnChooserFactory?.showColumnChooser(e)}hidePopupMenu(){this.contextMenuFactory?.hideActiveMenu(),this.activeMenuFactory.hideActiveMenu()}hideColumnChooser(){this.columnChooserFactory?.hideActiveColumnChooser()}isColumnMenuInHeaderEnabled(e){const{suppressMenu:t,suppressHeaderMenuButton:a}=e.getColDef();return!(a??t)&&this.activeMenuFactory.isMenuEnabled(e)&&(this.isLegacyMenuEnabled()||!!this.enterpriseMenuFactory)}isFilterMenuInHeaderEnabled(e){return!e.getColDef().suppressHeaderFilterButton&&!!this.filterManager?.isFilterAllowed(e)}isHeaderContextMenuEnabled(e){return!e?.getColDef().suppressHeaderContextMenu&&"new"===this.getColumnMenuType()}isHeaderMenuButtonAlwaysShowEnabled(){return this.isSuppressMenuHide()}isHeaderMenuButtonEnabled(){const e=!this.isSuppressMenuHide();return!(Zt()&&e)}isHeaderFilterButtonEnabled(e){return this.isFilterMenuInHeaderEnabled(e)&&!this.isLegacyMenuEnabled()&&!this.isFloatingFilterButtonDisplayed(e)}isFilterMenuItemEnabled(e){return!(!this.filterManager?.isFilterAllowed(e)||this.isLegacyMenuEnabled()||this.isFilterMenuInHeaderEnabled(e)||this.isFloatingFilterButtonDisplayed(e))}isColumnMenuAnchoringEnabled(){return!this.isLegacyMenuEnabled()}areAdditionalColumnMenuItemsEnabled(){return"new"===this.getColumnMenuType()}isLegacyMenuEnabled(){return"legacy"===this.getColumnMenuType()}isFloatingFilterButtonEnabled(e){const t=e.getColDef(),a=t.floatingFilterComponentParams?.suppressFilterButton;return null!=a&&ce("As of v31.1, \'colDef.floatingFilterComponentParams.suppressFilterButton\' is deprecated. Use \'colDef.suppressFloatingFilterButton\' instead."),null==t.suppressFloatingFilterButton?!a:!t.suppressFloatingFilterButton}getColumnMenuType(){return this.gos.get("columnMenu")}isFloatingFilterButtonDisplayed(e){return!!e.ge';
      S = S + 'tColDef().floatingFilter&&this.isFloatingFilterButtonEnabled(e)}isSuppressMenuHide(){const e=this.gos.get("suppressMenuHide");return this.isLegacyMenuEnabled()?!!this.gos.exists("suppressMenuHide")&&e:e}showColumnMenuCommon(e,t,a,n){const{positionBy:o}=t,r=t.column;if("button"===o){const{buttonElement:o}=t;e.showMenuAfterButtonClick(r,o,a,n)}else if("mouse"===o){const{mouseEvent:o}=t;e.showMenuAfterMouseEvent(r,o,a,n)}else r&&(this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(r,"auto"),this.animationFrameService.requestAnimationFrame((()=>{const t=this.ctrlsService.getHeaderRowContainerCtrl(r.getPinned()).getHeaderCtrlForColumn(r);e.showMenuAfterButtonClick(r,t.getAnchorElementForMenu(n),a,!0)})))}getRowCtrl(e){const{rowIndex:t,rowPinned:a}=e||{};if(null!=t)return this.rowRenderer.getRowByPosition({rowIndex:t,rowPinned:a})||void 0}getCellGui(e,t){if(!e||!t)return;const a=e.getCellCtrl(t);return a?.getGui()||void 0}getContextMenuAnchorElement(e,t){const a=this.ctrlsService.getGridBodyCtrl().getGridBodyElement(),n=this.getRowCtrl(e);if(!n)return a;const o=this.getCellGui(n,t);return o||(n.isFullWidth()?n.getFullWidthElement():a)}},bs=class extends on{constructor(e){super(e,"ag-text-area",null,"textarea")}setValue(e,t){const a=super.setValue(e,t);return this.eInput.value=e,a}setCols(e){return this.eInput.cols=e,this}setRows(e){return this.eInput.rows=e,this}},Cs={selector:"AG-INPUT-TEXT-AREA",component:bs},ws=class extends pn{constructor(){super(\'<div class="ag-large-text">\\n        <ag-input-text-area data-ref="eTextArea" class="ag-large-text-input"></ag-input-text-area>\\n        </div>\',[Cs]),this.eTextArea=qa}init(e){this.params=e,this.focusAfterAttached=e.cellStartedEdit,this.eTextArea.setMaxLength(e.maxLength||200).setCols(e.cols||60).setRows(e.rows||10),L(e.value,!0)&&this.eTextArea.setValue(e.value.toString(),!0),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.activateTabIndex()}onKeyDown(e){const t=e.key;(t===tn.LEFT|';
      S = S + '|t===tn.UP||t===tn.RIGHT||t===tn.DOWN||e.shiftKey&&t===tn.ENTER)&&e.stopPropagation()}afterGuiAttached(){const e=this.localeService.getLocaleTextFunc();this.eTextArea.setInputAriaLabel(e("ariaInputEditor","Input Editor")),this.focusAfterAttached&&this.eTextArea.getFocusableElement().focus()}getValue(){const e=this.eTextArea.getValue();return L(e)||L(this.params.value)?this.params.parseValue(e):this.params.value}},ys=class extends pn{constructor(e){super(\'<div class="ag-popup-editor" tabindex="-1"/>\'),this.params=e}postConstruct(){this.gos.setDomData(this.getGui(),"popupEditorWrapper",!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params;this.addManagedElementListeners(e,{keydown:e=>{zo(this.gos,e,t.node,t.column,!0)||t.onKeyDown(e)}})}},Ss=class extends pn{constructor(){super(\'<div class="ag-cell-edit-wrapper">\\n                <ag-select class="ag-cell-editor" data-ref="eSelect"></ag-select>\\n            </div>\',[yo]),this.eSelect=qa,this.startedByEnter=!1}wireBeans(e){this.valueService=e.valueService}init(e){this.focusAfterAttached=e.cellStartedEdit;const{eSelect:t,valueService:a,gos:n}=this,{values:o,value:r,eventKey:i}=e;if(O(o))return void ce("no values found for select cellEditor");this.startedByEnter=null!=i&&i===tn.ENTER;let s=!1;o.forEach((n=>{const o={value:n},i=a.formatValue(e.column,null,n),l=null!=i;o.text=l?i:n,t.addOption(o),s=s||r===n})),s?t.setValue(e.value,!0):e.values.length&&t.setValue(e.values[0],!0);const{valueListGap:l,valueListMaxWidth:c,valueListMaxHeight:g}=e;null!=l&&t.setPickerGap(l),null!=g&&t.setPickerMaxHeight(g),null!=c&&t.setPickerMaxWidth(c),"fullRow"!==n.get("editType")&&this.addManagedListeners(this.eSelect,{selectedItem:()=>e.stopEditing()})}afterGuiAttached(){this.focusAfterAttached&&this.eSelect.getFocusableElement().focus(),this.startedByEnter&&setTimeout((()=>{this.isAlive()&&this.eSelect.showPicker()}))}focusIn(){this.eSelect.getFocusableElement().focus()}getValue(){return this.eSelect.getVal';
      S = S + 'ue()}isPopup(){return!1}},ks=class extends pn{constructor(e){super(`\\n            <div class="ag-cell-edit-wrapper">\\n                ${e.getTemplate()}\\n            </div>`,e.getAgComponents()),this.cellEditorInput=e,this.eInput=qa}init(e){this.params=e;const t=this.eInput;let a;if(this.cellEditorInput.init(t,e),e.cellStartedEdit){this.focusAfterAttached=!0;const t=e.eventKey;t===tn.BACKSPACE||e.eventKey===tn.DELETE?a="":t&&1===t.length?a=t:(a=this.cellEditorInput.getStartValue(),t!==tn.F2&&(this.highlightAllOnFocus=!0))}else this.focusAfterAttached=!1,a=this.cellEditorInput.getStartValue();null!=a&&t.setStartValue(a),this.addManagedElementListeners(t.getGui(),{keydown:e=>{const{key:t}=e;t!==tn.PAGE_UP&&t!==tn.PAGE_DOWN||e.preventDefault()}})}afterGuiAttached(){const e=this.localeService.getLocaleTextFunc(),t=this.eInput;if(t.setInputAriaLabel(e("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;Kt()||t.getFocusableElement().focus();const a=t.getInputElement();this.highlightAllOnFocus?a.select():this.cellEditorInput.setCaret?.()}focusIn(){const e=this.eInput,t=e.getFocusableElement(),a=e.getInputElement();t.focus(),a.select()}getValue(){return this.cellEditorInput.getValue()}isPopup(){return!1}},xs=class{getTemplate(){return\'<ag-input-text-field class="ag-cell-editor" data-ref="eInput"></ag-input-text-field>\'}getAgComponents(){return[Mo]}init(e,t){this.eInput=e,this.params=t,null!=t.maxLength&&e.setMaxLength(t.maxLength)}getValue(){const e=this.eInput.getValue();return L(e)||L(this.params.value)?this.params.parseValue(e):this.params.value}getStartValue(){return this.params.useFormatter||this.params.column.getColDef().refData?this.params.formatValue(this.params.value):this.params.value}setCaret(){const e=this.eInput.getValue(),t=L(e)&&e.length||0;t&&this.eInput.getInputElement().setSelectionRange(t,t)}},Rs=class extends ks{constructor(){super(new xs)}},zs=class{getTemplate(){return\'<ag-input-number-field class="ag-cell-editor" data-ref="eInput"></ag-';
      S = S + 'input-number-field>\'}getAgComponents(){return[Eo]}init(e,t){this.eInput=e,this.params=t,null!=t.max&&e.setMax(t.max),null!=t.min&&e.setMin(t.min),null!=t.precision&&e.setPrecision(t.precision),null!=t.step&&e.setStep(t.step);const a=e.getInputElement();t.preventStepping?e.addManagedElementListeners(a,{keydown:this.preventStepping}):t.showStepperButtons&&a.classList.add("ag-number-field-input-stepper")}preventStepping(e){e.key!==tn.UP&&e.key!==tn.DOWN||e.preventDefault()}getValue(){const e=this.eInput.getValue();if(!L(e)&&!L(this.params.value))return this.params.value;let t=this.params.parseValue(e);if(null==t)return t;if("string"==typeof t){if(""===t)return null;t=Number(t)}return isNaN(t)?null:t}getStartValue(){return this.params.value}},Fs=class extends ks{constructor(){super(new zs)}},Ms=class extends Fo{constructor(e){super(e,"ag-date-field","date")}postConstruct(){super.postConstruct();const e=Kt();this.addManagedListeners(this.eInput,{wheel:this.onWheel.bind(this),mousedown:()=>{this.isDisabled()||e||this.eInput.focus()}}),this.eInput.step="any"}onWheel(e){this.gos.getActiveDomElement()===this.eInput&&e.preventDefault()}setMin(e){const t=e instanceof Date?jo(e??null,!1)??void 0:e;return this.min===t||(this.min=t,Pa(this.eInput,"min",t)),this}setMax(e){const t=e instanceof Date?jo(e??null,!1)??void 0:e;return this.max===t||(this.max=t,Pa(this.eInput,"max",t)),this}setStep(e){return this.step===e||(this.step=e,Pa(this.eInput,"step",e)),this}getDate(){if(this.eInput.validity.valid)return Yo(this.getValue())??void 0}setDate(e,t){this.setValue(jo(e??null,!1),t)}},Ds={selector:"AG-INPUT-DATE-FIELD",component:Ms},Es=class{getTemplate(){return\'<ag-input-date-field class="ag-cell-editor" data-ref="eInput"></ag-input-date-field>\'}getAgComponents(){return[Ds]}init(e,t){this.eInput=e,this.params=t,null!=t.min&&e.setMin(t.min),null!=t.max&&e.setMax(t.max),null!=t.step&&e.setStep(t.step)}getValue(){const e=this.eInput.getDate();return L(e)||L(this.params.value)?e??null:this';
      S = S + '.params.value}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return jo(e,!1)}},Ps=class extends ks{constructor(){super(new Es)}},As=class{constructor(e){this.getDataTypeService=e}getTemplate(){return\'<ag-input-date-field class="ag-cell-editor" data-ref="eInput"></ag-input-date-field>\'}getAgComponents(){return[Ds]}init(e,t){this.eInput=e,this.params=t,null!=t.min&&e.setMin(t.min),null!=t.max&&e.setMax(t.max),null!=t.step&&e.setStep(t.step)}getValue(){const e=this.formatDate(this.eInput.getDate());return L(e)||L(this.params.value)?this.params.parseValue(e??""):this.params.value}getStartValue(){return jo(this.parseDate(this.params.value??void 0)??null,!1)}parseDate(e){const t=this.getDataTypeService();return t?t.getDateParserFunction(this.params.column)(e):Yo(e)??void 0}formatDate(e){const t=this.getDataTypeService();return t?t.getDateFormatterFunction(this.params.column)(e):jo(e??null,!1)??void 0}},Ts=class extends ks{wireBeans(e){this.dataTypeService=e.dataTypeService}constructor(){super(new As((()=>this.dataTypeService)))}},Is=class extends pn{constructor(){super(\'\\n            <div class="ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit">\\n                <ag-checkbox role="presentation" data-ref="eCheckbox"></ag-checkbox>\\n            </div>\',[sn]),this.eCheckbox=qa}init(e){this.params=e;const t=e.value??void 0;this.eCheckbox.setValue(t);this.eCheckbox.getInputElement().setAttribute("tabindex","-1"),this.setAriaLabel(t),this.addManagedListeners(this.eCheckbox,{fieldValueChanged:e=>this.setAriaLabel(e.selected)})}getValue(){return this.eCheckbox.getValue()}focusIn(){this.eCheckbox.getFocusableElement().focus()}afterGuiAttached(){this.params.cellStartedEdit&&this.focusIn()}isPopup(){return!1}setAriaLabel(e){const t=this.localeService.getLocaleTextFunc(),a=jt(t,e),n=t("ariaToggleCellValue","Press SPACE to toggle cell value");this.eCheckbox.setInputAriaLabel(`${n} (${a})`)}},Ls=class{constructor(e){this.cellValueChanges=e}},Os=class extends Ls{co';
      S = S + 'nstructor(e,t,a,n){super(e),this.initialRange=t,this.finalRange=a,this.ranges=n}},Ns=class{constructor(e){this.actionStack=[],this.maxStackSize=e||10,this.actionStack=new Array(this.maxStackSize)}pop(){return this.actionStack.pop()}push(e){e.cellValueChanges&&e.cellValueChanges.length>0&&(this.actionStack.length===this.maxStackSize&&this.actionStack.shift(),this.actionStack.push(e))}clear(){this.actionStack=[]}getCurrentStackSize(){return this.actionStack.length}};function Gs(e,t,a="auto"){e.frameworkOverrides.wrapIncoming((()=>e.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(t,a)),"ensureVisible")}function qs(e,t,a){e.frameworkOverrides.wrapIncoming((()=>e.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureIndexVisible(t,a)),"ensureVisible")}var Bs={version:gr,moduleName:"@ag-grid-community/edit-core",beans:[class extends A{constructor(){super(...arguments),this.beanName="editService"}wireBeans(e){this.navigationService=e.navigationService,this.userComponentFactory=e.userComponentFactory,this.valueService=e.valueService}startEditing(e,t=null,a=!1,n=null){const o=this.createCellEditorParams(e,t,a),r=e.getColumn().getColDef(),i=this.userComponentFactory.getCellEditorDetails(r,o),s=null!=i?.popupFromSelector?i.popupFromSelector:!!r.cellEditorPopup,l=null!=i?.popupPositionFromSelector?i.popupPositionFromSelector:r.cellEditorPopupPosition;e.setEditing(!0,i),e.getComp().setEditDetails(i,s,l,this.gos.get("reactiveCustomComponents"));const c=e.createEvent(n,"cellEditingStarted");this.eventService.dispatchEvent(c)}stopEditing(e,t){const a=e.getComp(),{newValue:n,newValueExists:o}=this.takeValueFromCellEditor(t,a),r=e.getRowNode(),i=e.getColumn(),s=r.getValueFromValueService(i);let l=!1;o&&(l=this.saveNewValue(e,s,n,r,i)),e.setEditing(!1,void 0),a.setEditDetails(),e.updateAndFormatValue(!1),e.refreshCell({forceRefresh:!0,suppressFlash:!0});const c={...e.createEvent(null,"cellEditingStopped"),oldValue:s,newValue:n,valueChanged:l};return this.eventS';
      S = S + 'ervice.dispatchEvent(c),l}handleColDefChanged(e){const t=e.getCellEditor();if(t?.refresh){const{eventKey:a,cellStartedEdit:n}=e.getEditCompDetails().params,o=this.createCellEditorParams(e,a,n),r=e.getColumn().getColDef(),i=this.userComponentFactory.getCellEditorDetails(r,o);t.refresh(i.params)}}setFocusOutOnEditor(e){const t=e.getComp().getCellEditor();t&&t.focusOut&&t.focusOut()}setFocusInOnEditor(e){const t=e.getComp().getCellEditor();t&&t.focusIn?t.focusIn():e.focusCell(!0)}stopEditingAndFocus(e,t=!1,a=!1){e.stopRowOrCellEdit(),e.focusCell(!0),t||this.navigateAfterEdit(a,e.getCellPosition())}createPopupEditorWrapper(e){return new ys(e)}takeValueFromCellEditor(e,t){const a={newValueExists:!1};if(e)return a;const n=t.getCellEditor();if(!n)return a;if(n.isCancelAfterEnd&&n.isCancelAfterEnd())return a;return{newValue:n.getValue(),newValueExists:!0}}saveNewValue(e,t,a,n,o){if(a===t)return!1;e.setSuppressRefreshCell(!0);const r=n.setDataValue(o,a,"edit");return e.setSuppressRefreshCell(!1),r}createCellEditorParams(e,t,a){const n=e.getColumn(),o=e.getRowNode();return this.gos.addGridCommonParams({value:o.getValueFromValueService(n),eventKey:t,column:n,colDef:n.getColDef(),rowIndex:e.getCellPosition().rowIndex,node:o,data:o.data,cellStartedEdit:a,onKeyDown:e.onKeyDown.bind(e),stopEditing:e.stopEditingAndFocus.bind(e),eGridCell:e.getGui(),parseValue:t=>this.valueService.parseValue(n,o,t,e.getValue()),formatValue:e.formatValue.bind(e)})}navigateAfterEdit(e,t){if(this.gos.get("enterNavigatesVerticallyAfterEdit")){const a=e?tn.UP:tn.DOWN;this.navigationService.navigateToNextCell(null,a,t,!1)}}}]},Hs={version:gr,moduleName:"@ag-grid-community/edit-api",apiFunctions:{undoCellEditing:function(e){e.undoRedoService?.undo("api")},redoCellEditing:function(e){e.undoRedoService?.redo("api")},getCellEditorInstances:function(e,t={}){return e.rowRenderer.getCellEditorInstances(t).map(Hn)},getEditingCells:function(e){return e.rowRenderer.getEditingCells()},stopEditing:function(e,t=!1){e.';
      S = S + 'rowRenderer.stopEditing(t)},startEditingCell:function(e,t){const a=e.columnModel.getCol(t.colKey);if(!a)return void ce(`no column found for ${t.colKey}`);const n={rowIndex:t.rowIndex,rowPinned:t.rowPinned||null,column:a};null==t.rowPinned&&qs(e,t.rowIndex),Gs(e,t.colKey);const o=e.navigationService.getCellByPosition(n);o&&(e.focusService.isCellFocused(n)||e.focusService.setFocusedCell(n),o.startRowOrCellEdit(t.key))},getCurrentUndoSize:function(e){return e.undoRedoService?.getCurrentUndoStackSize()??0},getCurrentRedoSize:function(e){return e.undoRedoService?.getCurrentRedoStackSize()??0}},dependantModules:[Bs]},Vs={version:gr,moduleName:"@ag-grid-community/undo-redo-edit",beans:[class extends A{constructor(){super(...arguments),this.beanName="undoRedoService",this.cellValueChanges=[],this.activeCellEdit=null,this.activeRowEdit=null,this.isPasting=!1,this.isRangeInAction=!1,this.onCellValueChanged=e=>{const t={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned},a=null!==this.activeCellEdit&&this.cellPositionUtils.equals(this.activeCellEdit,t),n=null!==this.activeRowEdit&&this.rowPositionUtils.sameRow(this.activeRowEdit,t);if(!(a||n||this.isPasting||this.isRangeInAction))return;const{rowPinned:o,rowIndex:r,column:i,oldValue:s,value:l}=e,c={rowPinned:o,rowIndex:r,columnId:i.getColId(),newValue:l,oldValue:s};this.cellValueChanges.push(c)},this.clearStacks=()=>{this.undoStack.clear(),this.redoStack.clear()}}wireBeans(e){this.focusService=e.focusService,this.ctrlsService=e.ctrlsService,this.cellPositionUtils=e.cellPositionUtils,this.rowPositionUtils=e.rowPositionUtils,this.columnModel=e.columnModel,this.rangeService=e.rangeService}postConstruct(){if(!this.gos.get("undoRedoCellEditing"))return;const e=this.gos.get("undoRedoCellEditingLimit");if(e<=0)return;this.undoStack=new Ns(e),this.redoStack=new Ns(e),this.addListeners();const t=this.clearStacks.bind(this);this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this),modelUpdated:e=>{e.keepU';
      S = S + 'ndoRedoStack||this.clearStacks()},columnPivotModeChanged:t,newColumnsLoaded:t,columnGroupOpened:t,columnRowGroupChanged:t,columnMoved:t,columnPinned:t,columnVisible:t,rowDragEnd:t}),this.ctrlsService.whenReady((e=>{this.gridBodyCtrl=e.gridBodyCtrl}))}getCurrentUndoStackSize(){return this.undoStack?this.undoStack.getCurrentStackSize():0}getCurrentRedoStackSize(){return this.redoStack?this.redoStack.getCurrentStackSize():0}undo(e){const t={type:"undoStarted",source:e};this.eventService.dispatchEvent(t);const a={type:"undoEnded",source:e,operationPerformed:this.undoRedo(this.undoStack,this.redoStack,"initialRange","oldValue","undo")};this.eventService.dispatchEvent(a)}redo(e){const t={type:"redoStarted",source:e};this.eventService.dispatchEvent(t);const a={type:"redoEnded",source:e,operationPerformed:this.undoRedo(this.redoStack,this.undoStack,"finalRange","newValue","redo")};this.eventService.dispatchEvent(a)}undoRedo(e,t,a,n,o){if(!e)return!1;const r=e.pop();return!(!r||!r.cellValueChanges)&&(this.processAction(r,(e=>e[n]),o),r instanceof Os?this.processRange(this.rangeService,r.ranges||[r[a]]):this.processCell(r.cellValueChanges),t.push(r),!0)}processAction(e,t,a){e.cellValueChanges.forEach((e=>{const{rowIndex:n,rowPinned:o,columnId:r}=e,i={rowIndex:n,rowPinned:o},s=this.rowPositionUtils.getRowNode(i);s.displayed&&s.setDataValue(r,t(e),a)}))}processRange(e,t){let a;e.removeAllCellRanges(!0),t.forEach(((n,o)=>{if(!n)return;const r=n.startRow,i=n.endRow;o===t.length-1&&(a={rowPinned:r.rowPinned,rowIndex:r.rowIndex,columnId:n.startColumn.getColId()},this.setLastFocusedCell(a));const s={rowStartIndex:r.rowIndex,rowStartPinned:r.rowPinned,rowEndIndex:i.rowIndex,rowEndPinned:i.rowPinned,columnStart:n.startColumn,columns:n.columns};e.addCellRange(s)}))}processCell(e){const t=e[0],{rowIndex:a,rowPinned:n}=t,o={rowIndex:a,rowPinned:n},r=this.rowPositionUtils.getRowNode(o),i={rowPinned:t.rowPinned,rowIndex:r.rowIndex,columnId:t.columnId};this.setLastFocusedCell(i,this.rangeSe';
      S = S + 'rvice)}setLastFocusedCell(e,t){const{rowIndex:a,columnId:n,rowPinned:o}=e,r=this.gridBodyCtrl.getScrollFeature(),i=this.columnModel.getCol(n);if(!i)return;r.ensureIndexVisible(a),r.ensureColumnVisible(i);const s={rowIndex:a,column:i,rowPinned:o};this.focusService.setFocusedCell({...s,forceBrowserFocus:!0}),t?.setRangeToCell(s)}addListeners(){this.addManagedEventListeners({rowEditingStarted:e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}},rowEditingStopped:()=>{const e=new Ls(this.cellValueChanges);this.pushActionsToUndoStack(e),this.activeRowEdit=null},cellEditingStarted:e=>{this.activeCellEdit={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned}},cellEditingStopped:e=>{this.activeCellEdit=null;if(e.valueChanged&&!this.activeRowEdit&&!this.isPasting&&!this.isRangeInAction){const e=new Ls(this.cellValueChanges);this.pushActionsToUndoStack(e)}},pasteStart:()=>{this.isPasting=!0},pasteEnd:()=>{const e=new Ls(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1},fillStart:()=>{this.isRangeInAction=!0},fillEnd:e=>{const t=new Os(this.cellValueChanges,e.initialRange,e.finalRange);this.pushActionsToUndoStack(t),this.isRangeInAction=!1},keyShortcutChangedCellStart:()=>{this.isRangeInAction=!0},keyShortcutChangedCellEnd:()=>{let e;e=this.rangeService&&this.gos.get("enableRangeSelection")?new Os(this.cellValueChanges,void 0,void 0,[...this.rangeService.getCellRanges()]):new Ls(this.cellValueChanges),this.pushActionsToUndoStack(e),this.isRangeInAction=!1}})}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}}],dependantModules:[Bs]},Ws={version:gr,moduleName:"@ag-grid-community/full-row-edit",beans:[class extends A{constructor(){super(...arguments),this.beanName="rowEditService"}startEditing(e,t=null,a=null,n=null){e.getAllCellCtrls().reduce(((e,o)=>{const r=o===a;return r?o.startEditing(t,r,n):o.startEditing(null,r,n),!!e||o.isEditing()}),!1)&&this.setEditing(e,!0)}stopEditing(e,t=!1){c';
      S = S + 'onst a=e.getAllCellCtrls(),n=e.isEditing();e.setStoppingRowEdit(!0);let o=!1;for(const e of a){const a=e.stopEditing(t);n&&!t&&!o&&a&&(o=!0)}if(o){const t=e.createRowEvent("rowValueChanged");this.eventService.dispatchEvent(t)}n&&this.setEditing(e,!1),e.setStoppingRowEdit(!1)}setEditing(e,t){e.setEditingRow(t),e.forEachGui(void 0,(e=>e.rowComp.addOrRemoveCssClass("ag-row-editing",t)));const a=t?e.createRowEvent("rowEditingStarted"):e.createRowEvent("rowEditingStopped");this.eventService.dispatchEvent(a)}}],dependantModules:[Bs]},Us={version:gr,moduleName:"@ag-grid-community/default-editor",userComponents:[{name:"agCellEditor",classImp:Rs}],dependantModules:[Bs]},js={version:gr,moduleName:"@ag-grid-community/editing",dependantModules:[Bs,Vs,Ws,{version:gr,moduleName:"@ag-grid-community/all-editors",dependantModules:[Us,{version:gr,moduleName:"@ag-grid-community/data-type-editors",userComponents:[{name:"agTextCellEditor",classImp:Rs},{name:"agNumberCellEditor",classImp:Fs},{name:"agDateCellEditor",classImp:Ps},{name:"agDateStringCellEditor",classImp:Ts},{name:"agCheckboxCellEditor",classImp:Is}],dependantModules:[Us]},{version:gr,moduleName:"@ag-grid-community/select-editor",userComponents:[{name:"agSelectCellEditor",classImp:Ss}],dependantModules:[Bs]},{version:gr,moduleName:"@ag-grid-community/large-text-editor",userComponents:[{name:"agLargeTextCellEditor",classImp:ws}],dependantModules:[Bs]}]},Hs]},Ks=class extends A{constructor(){super(...arguments),this.beanName="autoWidthCalculator"}wireBeans(e){this.rowRenderer=e.rowRenderer,this.ctrlsService=e.ctrlsService}postConstruct(){this.ctrlsService.whenReady((e=>{this.centerRowContainerCtrl=e.center}))}getPreferredWidthForColumn(e,t){const a=this.getHeaderCellForColumn(e);if(!a)return-1;const n=this.rowRenderer.getAllCellsForColumn(e);return t||n.push(a),this.addElementsToContainerAndGetWidth(n)}getPreferredWidthForColumnGroup(e){const t=this.getHeaderCellForColumn(e);return t?this.addElementsToContainerAndGetWidth([t]';
      S = S + '):-1}addElementsToContainerAndGetWidth(e){const t=document.createElement("form");t.style.position="fixed";const a=this.centerRowContainerCtrl.getContainerElement();e.forEach((e=>this.cloneItemIntoDummy(e,t))),a.appendChild(t);const n=t.offsetWidth;a.removeChild(t);return n+this.getAutoSizePadding()}getAutoSizePadding(){return this.gos.get("autoSizePadding")}getHeaderCellForColumn(e){let t=null;return this.ctrlsService.getHeaderRowContainerCtrls().forEach((a=>{const n=a.getHtmlElementForColumnHeader(e);null!=n&&(t=n)})),t}cloneItemIntoDummy(e,t){const a=e.cloneNode(!0);a.style.width="",a.style.position="static",a.style.left="";const n=document.createElement("div"),o=n.classList;["ag-header-cell","ag-header-group-cell"].some((e=>a.classList.contains(e)))?(o.add("ag-header","ag-header-row"),n.style.position="static"):o.add("ag-row");let r=e.parentElement;for(;r;){if(["ag-header-row","ag-row"].some((e=>r.classList.contains(e)))){for(let e=0;e<r.classList.length;e++){const t=r.classList[e];"ag-row-position-absolute"!=t&&o.add(t)}break}r=r.parentElement}n.appendChild(a),t.appendChild(n)}},Qs=class extends A{constructor(e,t){super(),this.createRowCon=e,this.destroyRowCtrls=t,this.stickyTopRowCtrls=[],this.stickyBottomRowCtrls=[],this.topContainerHeight=0,this.bottomContainerHeight=0,this.extraTopHeight=0,this.extraBottomHeight=0}wireBeans(e){this.rowModel=e.rowModel,this.rowRenderer=e.rowRenderer,this.ctrlsService=e.ctrlsService,this.pageBoundsService=e.pageBoundsService}postConstruct(){this.isClientSide="clientSide"===this.rowModel.getType(),this.ctrlsService.whenReady((e=>{this.gridBodyCtrl=e.gridBodyCtrl}))}getStickyTopRowCtrls(){return this.stickyTopRowCtrls}getStickyBottomRowCtrls(){return this.stickyBottomRowCtrls}setOffsetTop(e){if(this.extraTopHeight===e)return;this.extraTopHeight=e;const t={type:"stickyTopOffsetChanged",offset:e};this.eventService.dispatchEvent(t)}setOffsetBottom(e){this.extraBottomHeight!==e&&(this.extraBottomHeight=e)}resetOffsets(){this.setOffs';
      S = S + 'etBottom(0),this.setOffsetTop(0)}getExtraTopHeight(){return this.extraTopHeight}getExtraBottomHeight(){return this.extraBottomHeight}getLastPixelOfGroup(e){return this.isClientSide?this.getClientSideLastPixelOfGroup(e):this.getServerSideLastPixelOfGroup(e)}getFirstPixelOfGroup(e){return e.footer?e.sibling.rowTop+e.sibling.rowHeight-1:e.hasChildren()?e.rowTop-1:0}getServerSideLastPixelOfGroup(e){if(this.isClientSide)throw new Error("This func should only be called in server side row model.");if(e.isExpandable()||e.footer){if(e.master)return e.detailNode.rowTop+e.detailNode.rowHeight;if(!e.sibling||1===Math.abs(e.sibling.rowIndex-e.rowIndex)){let t=e.childStore?.getStoreBounds();return e.footer&&(t=e.sibling.childStore?.getStoreBounds()),(t?.heightPx??0)+(t?.topPx??0)}return e.footer?e.rowTop+e.rowHeight:e.sibling.rowTop+e.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}getClientSideLastPixelOfGroup(e){if(!this.isClientSide)throw new Error("This func should only be called in client side row model.");if(e.isExpandable()||e.footer){if(e.footer&&0===e.rowIndex)return Number.MAX_SAFE_INTEGER;if(!e.sibling||1===Math.abs(e.sibling.rowIndex-e.rowIndex)){let t=e.footer?e.sibling:e;for(;t.isExpandable()&&t.expanded;)if(t.master)t=t.detailNode;else if(t.childrenAfterSort){if(0===t.childrenAfterSort.length)break;t=d(t.childrenAfterSort)}return t.rowTop+t.rowHeight}return e.footer?e.rowTop+e.rowHeight:e.sibling.rowTop+e.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}updateStickyRows(e){const t="top"===e;let a=0;if(!this.canRowsBeSticky())return this.refreshNodesAndContainerHeight(e,new Set,a);const n=t?this.rowRenderer.getFirstVisibleVerticalPixel()-this.extraTopHeight:this.rowRenderer.getLastVisibleVerticalPixel()-this.extraTopHeight,o=new Set,r=e=>{if(o.add(e),t){const t=this.getLastPixelOfGroup(e),o=n+a+e.rowHeight;e.stickyRowTop=t<o?a+(t-o):a}else{const t=this.getFirstPixelOfGroup(e),o=n-(a+e.rowHeight);e.stickyRowTop=t>o?a-(t-o):a}a=0,o.forEach((e=>{const t=e.stickyRowTop';
      S = S + '+e.rowHeight;a<t&&(a=t)}))},i=this.areFooterRowsStickySuppressed(),s=this.gos.get("suppressGroupRowsSticky"),l=e=>{if(!e.displayed)return!1;if(e.footer){if(!0===i)return!1;if("grand"===i&&-1===e.level)return!1;if("group"===i&&e.level>-1)return!1;return!o.has(e)}if(e.isExpandable()){if(!0===s)return!1;return!o.has(e)&&e.expanded}return!1};for(let e=0;e<100;e++){let e=n+a;t||(e=n-a);const o=this.rowModel.getRowIndexAtPixel(e),i=this.rowModel.getRow(o);if(null==i)break;const s=this.getStickyAncestors(i).find((e=>(t?e.rowIndex<o:e.rowIndex>o)&&l(e)));if(s){r(s);continue}if(!(t?i.rowTop<e:i.rowTop+i.rowHeight>e)||!l(i))break;r(i)}return t||o.forEach((e=>{e.stickyRowTop=a-(e.stickyRowTop+e.rowHeight)})),this.refreshNodesAndContainerHeight(e,o,a)}areFooterRowsStickySuppressed(){const e=this.gos.get("suppressStickyTotalRow");if(!0===e)return!0;const t=!!this.gos.get("groupIncludeFooter")||"group"===e,a=!!this.gos.get("groupIncludeTotalFooter")||"grand"===e;return!(!t||!a)||(a?"grand":!!t&&"group")}canRowsBeSticky(){const e=this.gos.isGroupRowsSticky(),t=this.areFooterRowsStickySuppressed(),a=this.gos.get("suppressGroupRowsSticky");return e&&(!t||!a)}getStickyAncestors(e){const t=[];let a=e.footer?e.sibling:e.parent;for(;a;)a.sibling&&t.push(a.sibling),t.push(a),a=a.parent;return t.reverse()}checkStickyRows(){const e=this.updateStickyRows("top"),t=this.updateStickyRows("bottom");return e||t}destroyStickyCtrls(){this.refreshNodesAndContainerHeight("top",new Set,0),this.refreshNodesAndContainerHeight("bottom",new Set,0)}refreshStickyNode(e){const t=new Set;if(this.stickyTopRowCtrls.some((t=>t.getRowNode()===e))){for(let a=0;a<this.stickyTopRowCtrls.length;a++){const n=this.stickyTopRowCtrls[a].getRowNode();n!==e&&t.add(n)}this.refreshNodesAndContainerHeight("top",t,this.topContainerHeight)&&this.checkStickyRows()}else{for(let a=0;a<this.stickyBottomRowCtrls.length;a++){const n=this.stickyBottomRowCtrls[a].getRowNode();n!==e&&t.add(n)}this.refreshNodesAndContainerHeight("bottom';
      S = S + '",t,this.bottomContainerHeight)&&this.checkStickyRows()}}refreshNodesAndContainerHeight(e,t,a){const n="top"===e,o=n?this.stickyTopRowCtrls:this.stickyBottomRowCtrls,r={},i=[];for(let e=0;e<o.length;e++){const a=o[e].getRowNode();!t.has(a)?(r[a.id]=o[e],a.sticky=!1):i.push(o[e])}const s=new Set;for(let e=0;e<i.length;e++)s.add(i[e].getRowNode());const l=[];t.forEach((e=>{s.has(e)||(e.sticky=!0,l.push(this.createRowCon(e,!1,!1)))}));let c=!!l.length||i.length!==o.length;n?this.topContainerHeight!==a&&(this.topContainerHeight=a,this.gridBodyCtrl.setStickyTopHeight(a),c=!0):this.bottomContainerHeight!==a&&(this.bottomContainerHeight=a,this.gridBodyCtrl.setStickyBottomHeight(a),c=!0),this.destroyRowCtrls(r,!1);const g=[...i,...l];g.sort(((e,t)=>t.getRowNode().rowIndex-e.getRowNode().rowIndex)),n||g.reverse(),g.forEach((e=>e.setRowTop(e.getRowNode().stickyRowTop)));let d=0;return n?(t.forEach((e=>{e.rowIndex<this.pageBoundsService.getFirstRow()&&(d+=e.rowHeight)})),d>this.topContainerHeight&&(d=this.topContainerHeight),this.setOffsetTop(d)):(t.forEach((e=>{e.rowIndex>this.pageBoundsService.getLastRow()&&(d+=e.rowHeight)})),d>this.bottomContainerHeight&&(d=this.bottomContainerHeight),this.setOffsetBottom(d)),!!c&&(n?this.stickyTopRowCtrls=g:this.stickyBottomRowCtrls=g,!0)}ensureRowHeightsValid(){let e=!1;const t=t=>{const a=t.getRowNode();if(a.rowHeightEstimated){const t=this.gos.getRowHeightForNode(a);a.setRowHeight(t.height),e=!0}};return this.stickyTopRowCtrls.forEach(t),this.stickyBottomRowCtrls.forEach(t),e}},Ys=class extends A{constructor(){super(...arguments),this.beanName="rowRenderer",this.destroyFuncsForColumnListeners=[],this.rowCtrlsByRowIndex={},this.zombieRowCtrls={},this.allRowCtrls=[],this.topRowCtrls=[],this.bottomRowCtrls=[],this.refreshInProgress=!1,this.dataFirstRenderedFired=!1,this.setupRangeSelectionListeners=()=>{const e=()=>{this.getAllCellCtrls().forEach((e=>e.onRangeSelectionChanged()))},t=()=>{this.getAllCellCtrls().forEach((e=>e.updateRangeBor';
      S = S + 'dersIfRangeCount()))},a=()=>{this.eventService.addEventListener("rangeSelectionChanged",e),this.eventService.addEventListener("columnMoved",t),this.eventService.addEventListener("columnPinned",t),this.eventService.addEventListener("columnVisible",t)},n=()=>{this.eventService.removeEventListener("rangeSelectionChanged",e),this.eventService.removeEventListener("columnMoved",t),this.eventService.removeEventListener("columnPinned",t),this.eventService.removeEventListener("columnVisible",t)};this.addDestroyFunc((()=>n())),this.addManagedPropertyListener("enableRangeSelection",(e=>{e.currentValue?a():n()}));this.gos.get("enableRangeSelection")&&a()}}wireBeans(e){this.animationFrameService=e.animationFrameService,this.paginationService=e.paginationService,this.pageBoundsService=e.pageBoundsService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.pinnedRowModel=e.pinnedRowModel,this.rowModel=e.rowModel,this.focusService=e.focusService,this.beans=e,this.rowContainerHeightService=e.rowContainerHeightService,this.ctrlsService=e.ctrlsService,this.environment=e.environment}postConstruct(){this.ctrlsService.whenReady((e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.initialise()}))}initialise(){if(this.addManagedEventListeners({paginationChanged:this.onPageLoaded.bind(this),pinnedRowDataChanged:this.onPinnedRowDataChanged.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),bodyScroll:this.onBodyScroll.bind(this),bodyHeightChanged:this.redraw.bind(this)}),this.addManagedPropertyListeners(["domLayout","embedFullWidthRows"],(()=>this.onDomLayoutChanged())),this.addManagedPropertyListeners(["suppressMaxRenderedRowRestriction","rowBuffer"],(()=>this.redraw())),this.addManagedPropertyListeners(["suppressCellFocus","getBusinessKeyForNode","fullWidthCellRenderer","fullWidthCellRendererParams","rowStyle","getRowStyle","rowClass","getRowClass","rowClassRules","suppressStickyTotalRow","groupRowRenderer","groupRowRendererParams","loadingCellR';
      S = S + 'enderer","loadingCellRendererParams","detailCellRenderer","detailCellRendererParams","enableRangeSelection","enableCellTextSelection"],(()=>this.redrawRows())),this.gos.isGroupRowsSticky()){const e=this.rowModel.getType();"clientSide"!==e&&"serverSide"!==e||(this.stickyRowFeature=this.createManagedBean(new Qs(this.createRowCon.bind(this),this.destroyRowCtrls.bind(this))))}this.registerCellEventListeners(),this.initialiseCache(),this.printLayout=this.gos.isDomLayout("print"),this.embedFullWidthRows=this.printLayout||this.gos.get("embedFullWidthRows"),this.redrawAfterModelUpdate()}initialiseCache(){if(this.gos.get("keepDetailRows")){const e=this.getKeepDetailRowsCount(),t=null!=e?e:3;this.cachedRowCtrls=new _s(t)}}getKeepDetailRowsCount(){return this.gos.get("keepDetailRowsCount")}getStickyTopRowCtrls(){return this.stickyRowFeature?this.stickyRowFeature.getStickyTopRowCtrls():[]}getStickyBottomRowCtrls(){return this.stickyRowFeature?this.stickyRowFeature.getStickyBottomRowCtrls():[]}updateAllRowCtrls(){const e=Y(this.rowCtrlsByRowIndex),t=Y(this.zombieRowCtrls),a=this.cachedRowCtrls?this.cachedRowCtrls.getEntries():[];t.length>0||a.length>0?this.allRowCtrls=[...e,...t,...a]:this.allRowCtrls=e}onCellFocusChanged(e){this.getAllCellCtrls().forEach((t=>t.onCellFocused(e))),this.getFullWidthRowCtrls().forEach((t=>t.onFullWidthRowFocused(e)))}registerCellEventListeners(){this.addManagedEventListeners({cellFocused:e=>{this.onCellFocusChanged(e)},cellFocusCleared:()=>this.onCellFocusChanged(),flashCells:e=>{this.getAllCellCtrls().forEach((t=>t.onFlashCells(e)))},columnHoverChanged:()=>{this.getAllCellCtrls().forEach((e=>e.onColumnHover()))},displayedColumnsChanged:()=>{this.getAllCellCtrls().forEach((e=>e.onDisplayedColumnsChanged()))},displayedColumnsWidthChanged:()=>{this.printLayout&&this.getAllCellCtrls().forEach((e=>e.onLeftChanged()))}}),this.setupRangeSelectionListeners(),this.refreshListenersToColumnsForCellComps(),this.addManagedEventListeners({gridColumnsChanged:thi';
      S = S + 's.refreshListenersToColumnsForCellComps.bind(this)}),this.addDestroyFunc(this.removeGridColumnListeners.bind(this))}removeGridColumnListeners(){this.destroyFuncsForColumnListeners.forEach((e=>e())),this.destroyFuncsForColumnListeners.length=0}refreshListenersToColumnsForCellComps(){this.removeGridColumnListeners();this.columnModel.getCols().forEach((e=>{const t=t=>{this.getAllCellCtrls().forEach((a=>{a.getColumn()===e&&t(a)}))},a=()=>{t((e=>e.onLeftChanged()))},n=()=>{t((e=>e.onWidthChanged()))},o=()=>{t((e=>e.onFirstRightPinnedChanged()))},r=()=>{t((e=>e.onLastLeftPinnedChanged()))},i=()=>{t((e=>e.onColDefChanged()))};e.addEventListener("leftChanged",a),e.addEventListener("widthChanged",n),e.addEventListener("firstRightPinnedChanged",o),e.addEventListener("lastLeftPinnedChanged",r),e.addEventListener("colDefChanged",i),this.destroyFuncsForColumnListeners.push((()=>{e.removeEventListener("leftChanged",a),e.removeEventListener("widthChanged",n),e.removeEventListener("firstRightPinnedChanged",o),e.removeEventListener("lastLeftPinnedChanged",r),e.removeEventListener("colDefChanged",i)}))}))}onDomLayoutChanged(){const e=this.gos.isDomLayout("print"),t=e||this.gos.get("embedFullWidthRows"),a=t!==this.embedFullWidthRows||this.printLayout!==e;this.printLayout=e,this.embedFullWidthRows=t,a&&this.redrawAfterModelUpdate({domLayoutChanged:!0})}datasourceChanged(){this.firstRenderedRow=0,this.lastRenderedRow=-1;const e=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(e)}onPageLoaded(e){const t={recycleRows:e.keepRenderedRows,animate:e.animate,newData:e.newData,newPage:e.newPage,onlyBody:!0};this.redrawAfterModelUpdate(t)}getAllCellsForColumn(e){const t=[];return this.getAllRowCtrls().forEach((a=>{const n=a.getCellElement(e);n&&t.push(n)})),t}refreshFloatingRowComps(){this.refreshFloatingRows(this.topRowCtrls,this.pinnedRowModel.getPinnedTopRowNodes()),this.refreshFloatingRows(this.bottomRowCtrls,this.pinnedRowModel.getPinnedBottomRowNodes())}getTopRowCtrls(){return this';
      S = S + '.topRowCtrls}getCentreRowCtrls(){return this.allRowCtrls}getBottomRowCtrls(){return this.bottomRowCtrls}refreshFloatingRows(e,t){const a=Object.fromEntries(t.map((e=>[e.id,e]))),n=Object.fromEntries(e.map((e=>[e.getRowNode().id,e])));for(let o=0;o<t.length;o++){const r=t[o],i=e[o];i&&void 0===a[i.getRowNode().id]&&(i.destroyFirstPass(),i.destroySecondPass()),r.id in n?(e[o]=n[r.id],delete n[r.id]):e[o]=new Ii(r,this.beans,!1,!1,this.printLayout)}e.length=t.length}onPinnedRowDataChanged(){this.redrawAfterModelUpdate({recycleRows:!0})}redrawRow(e,t=!1){if(e.sticky)this.stickyRowFeature.refreshStickyNode(e);else{if(this.cachedRowCtrls?.has(e))return void this.cachedRowCtrls.removeRow(e);{const t=t=>{const a=t[e.rowIndex];a&&a.getRowNode()===e&&(a.destroyFirstPass(),a.destroySecondPass(),t[e.rowIndex]=this.createRowCon(e,!1,!1))};switch(e.rowPinned){case"top":t(this.topRowCtrls);break;case"bottom":t(this.bottomRowCtrls);break;default:t(this.rowCtrlsByRowIndex),this.updateAllRowCtrls()}}}t||this.dispatchDisplayedRowsChanged(!1)}redrawRows(e){if(null!=e)return e?.forEach((e=>this.redrawRow(e,!0))),void this.dispatchDisplayedRowsChanged(!1);this.redrawAfterModelUpdate()}getCellToRestoreFocusToAfterRefresh(e){const t=e?.suppressKeepFocus?null:this.focusService.getFocusCellToUseAfterRefresh();if(null==t)return null;const a=this.gos.getActiveDomElement(),n=this.gos.getDomData(a,Pi.DOM_DATA_KEY_CELL_CTRL),o=this.gos.getDomData(a,Ii.DOM_DATA_KEY_ROW_CTRL);return n||o?t:null}redrawAfterModelUpdate(e={}){this.getLockOnRefresh();const t=this.getCellToRestoreFocusToAfterRefresh(e);this.updateContainerHeights(),this.scrollToTopIfNewData(e);const a=!e.domLayoutChanged&&!!e.recycleRows,n=e.animate&&this.gos.isAnimateRows(),o=a?this.getRowsToRecycle():null;if(a||this.removeAllRowComps(),this.workOutFirstAndLastRowsToRender(),this.stickyRowFeature){this.stickyRowFeature.checkStickyRows();const e=this.stickyRowFeature.getExtraTopHeight()+this.stickyRowFeature.getExtraBottomHeight();e&&th';
      S = S + 'is.updateContainerHeights(e)}this.recycleRows(o,n),this.gridBodyCtrl.updateRowCount(),e.onlyBody||this.refreshFloatingRowComps(),this.dispatchDisplayedRowsChanged(),null!=t&&this.restoreFocusedCell(t),this.releaseLockOnRefresh()}scrollToTopIfNewData(e){const t=e.newData||e.newPage,a=this.gos.get("suppressScrollOnNewData");t&&!a&&(this.gridBodyCtrl.getScrollFeature().scrollToTop(),this.stickyRowFeature?.resetOffsets())}updateContainerHeights(e=0){if(this.printLayout)return void this.rowContainerHeightService.setModelHeight(null);let t=this.pageBoundsService.getCurrentPageHeight();0===t&&(t=1),this.rowContainerHeightService.setModelHeight(t+e)}getLockOnRefresh(){if(this.refreshInProgress){const e=this.frameworkOverrides.getLockOnRefreshError?.()??"";throw new Error("AG Grid: cannot get grid to draw rows when it is in the middle of drawing rows. Your code probably called a grid API method while the grid was in the render stage. To overcome this, put the API call into a timeout, e.g. instead of api.redrawRows(), call setTimeout(function() { api.redrawRows(); }, 0). To see what part of your code that caused the refresh check this stacktrace."+e)}this.refreshInProgress=!0,this.frameworkOverrides.getLockOnRefresh?.()}releaseLockOnRefresh(){this.refreshInProgress=!1,this.frameworkOverrides.releaseLockOnRefresh?.()}isRefreshInProgress(){return this.refreshInProgress}restoreFocusedCell(e){e&&setTimeout((()=>{this.focusService.setRestoreFocusedCell(e),this.onCellFocusChanged(this.gos.addGridCommonParams({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0,type:"cellFocused"}))}))}stopEditing(e=!1){this.getAllRowCtrls().forEach((t=>{t.stopEditing(e)}))}getAllCellCtrls(){const e=[],t=this.getAllRowCtrls(),a=t.length;for(let n=0;n<a;n++){const a=t[n].getAllCellCtrls(),o=a.length;for(let t=0;t<o;t++)e.push(a[t])}return e}getAllRowCtrls(){const e=this.stickyRowFeature&&this.stickyRowFeature.getStickyTopRowCtrls()||[],t=this.';
      S = S + 'stickyRowFeature&&this.stickyRowFeature.getStickyBottomRowCtrls()||[],a=[...this.topRowCtrls,...this.bottomRowCtrls,...e,...t];for(const e in this.rowCtrlsByRowIndex)a.push(this.rowCtrlsByRowIndex[e]);return a}addRenderedRowListener(e,t,a){const n=this.rowCtrlsByRowIndex[t];n&&n.addEventListener(e,a)}flashCells(e={}){this.getCellCtrls(e.rowNodes,e.columns).forEach((t=>t.flashCell(e)))}refreshCells(e={}){const t={forceRefresh:e.force,newData:!1,suppressFlash:e.suppressFlash};for(const a of this.getCellCtrls(e.rowNodes,e.columns))a.refreshOrDestroyCell(t);this.refreshFullWidth(e.rowNodes)}refreshFullWidth(e){if(!e)return;let t=null;this.stickyRowFeature&&Xt()&&(t=this.getCellToRestoreFocusToAfterRefresh()||null);for(const t of this.getRowCtrls(e)){if(!t.isFullWidth())continue;t.refreshFullWidth()||this.redrawRow(t.getRowNode(),!0)}this.dispatchDisplayedRowsChanged(!1),t&&this.restoreFocusedCell(t)}getCellRendererInstances(e){const t=this.getCellCtrls(e.rowNodes,e.columns).map((e=>e.getCellRenderer())).filter((e=>null!=e));if(e.columns?.length)return t;const a=[],n=this.mapRowNodes(e.rowNodes);return this.getAllRowCtrls().forEach((e=>{if(n&&!this.isRowInMap(e.getRowNode(),n))return;if(!e.isFullWidth())return;const t=e.getFullWidthCellRenderers();for(let e=0;e<t.length;e++){const n=t[e];null!=n&&a.push(n)}})),[...a,...t]}getCellEditorInstances(e){const t=[];return this.getCellCtrls(e.rowNodes,e.columns).forEach((e=>{const a=e.getCellEditor();a&&t.push(a)})),t}getEditingCells(){const e=[];return this.getAllCellCtrls().forEach((t=>{if(t.isEditing()){const a=t.getCellPosition();e.push(a)}})),e}mapRowNodes(e){if(!e)return;const t={top:{},bottom:{},normal:{}};return e.forEach((e=>{const a=e.id;switch(e.rowPinned){case"top":t.top[a]=e;break;case"bottom":t.bottom[a]=e;break;default:t.normal[a]=e}})),t}isRowInMap(e,t){const a=e.id;switch(e.rowPinned){case"top":return null!=t.top[a];case"bottom":return null!=t.bottom[a];default:return null!=t.normal[a]}}getRowCtrls(e){const t=th';
      S = S + 'is.mapRowNodes(e),a=this.getAllRowCtrls();return e&&t?a.filter((e=>{const a=e.getRowNode();return this.isRowInMap(a,t)})):a}getCellCtrls(e,t){let a;L(t)&&(a={},t.forEach((e=>{const t=this.columnModel.getCol(e);L(t)&&(a[t.getId()]=!0)})));const n=[];return this.getRowCtrls(e).forEach((e=>{e.getAllCellCtrls().forEach((e=>{const t=e.getColumn().getId();a&&!a[t]||n.push(e)}))})),n}destroy(){this.removeAllRowComps(),super.destroy()}removeAllRowComps(){const e=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(e),this.stickyRowFeature&&this.stickyRowFeature.destroyStickyCtrls()}getRowsToRecycle(){const e=[];j(this.rowCtrlsByRowIndex,((t,a)=>{null==a.getRowNode().id&&e.push(t)})),this.removeRowCtrls(e);const t={};return j(this.rowCtrlsByRowIndex,((e,a)=>{const n=a.getRowNode();t[n.id]=a})),this.rowCtrlsByRowIndex={},t}removeRowCtrls(e,t=!1){e.forEach((e=>{const a=this.rowCtrlsByRowIndex[e];a&&(a.destroyFirstPass(t),a.destroySecondPass()),delete this.rowCtrlsByRowIndex[e]}))}onBodyScroll(e){"vertical"===e.direction&&this.redraw({afterScroll:!0})}redraw(e={}){const{afterScroll:t}=e;let a;this.stickyRowFeature&&Xt()&&(a=this.getCellToRestoreFocusToAfterRefresh()||void 0);const n=this.firstRenderedRow,o=this.lastRenderedRow;this.workOutFirstAndLastRowsToRender();let r=!1;if(this.stickyRowFeature){r=this.stickyRowFeature.checkStickyRows();const e=this.stickyRowFeature.getExtraTopHeight()+this.stickyRowFeature.getExtraBottomHeight();e&&this.updateContainerHeights(e)}const i=this.firstRenderedRow!==n||this.lastRenderedRow!==o;if((!t||r||i)&&(this.getLockOnRefresh(),this.recycleRows(null,!1,t),this.releaseLockOnRefresh(),this.dispatchDisplayedRowsChanged(t&&!r),null!=a)){const e=this.getCellToRestoreFocusToAfterRefresh();null!=a&&null==e&&(this.animationFrameService.flushAllFrames(),this.restoreFocusedCell(a))}}removeRowCompsNotToDraw(e,t){const a={};e.forEach((e=>a[e]=!0));const n=Object.keys(this.rowCtrlsByRowIndex).filter((e=>!a[e]));this.removeRowCtrls(n,t)}calculateInde';
      S = S + 'xesToDraw(e){const t=function(e,t){const a=[];for(let n=e;n<=t;n++)a.push(n);return a}(this.firstRenderedRow,this.lastRenderedRow),a=(e,a)=>{const n=a.getRowNode().rowIndex;null!=n&&(n<this.firstRenderedRow||n>this.lastRenderedRow)&&this.doNotUnVirtualiseRow(a)&&t.push(n)};j(this.rowCtrlsByRowIndex,a),j(e,a),t.sort(((e,t)=>e-t));const n=[];for(let e=0;e<t.length;e++){const a=t[e],o=this.rowModel.getRow(a);o&&!o.sticky&&n.push(a)}return n}recycleRows(e,t=!1,a=!1){const n=this.calculateIndexesToDraw(e);(this.printLayout||a)&&(t=!1),this.removeRowCompsNotToDraw(n,!t);const o=[];if(n.forEach((n=>{const r=this.createOrUpdateRowCtrl(n,e,t,a);L(r)&&o.push(r)})),e){a&&!this.gos.get("suppressAnimationFrame")&&!this.printLayout?this.beans.animationFrameService.addDestroyTask((()=>{this.destroyRowCtrls(e,t),this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()})):this.destroyRowCtrls(e,t)}this.updateAllRowCtrls()}dispatchDisplayedRowsChanged(e=!1){const t={type:"displayedRowsChanged",afterScroll:e};this.eventService.dispatchEvent(t)}onDisplayedColumnsChanged(){const e=this.visibleColsService.isPinningLeft(),t=this.visibleColsService.isPinningRight();(this.pinningLeft!==e||t!==this.pinningRight)&&(this.pinningLeft=e,this.pinningRight=t,this.embedFullWidthRows&&this.redrawFullWidthEmbeddedRows())}redrawFullWidthEmbeddedRows(){const e=[];this.getFullWidthRowCtrls().forEach((t=>{const a=t.getRowNode().rowIndex;e.push(a.toString())})),this.refreshFloatingRowComps(),this.removeRowCtrls(e),this.redraw({afterScroll:!0})}getFullWidthRowCtrls(e){const t=this.mapRowNodes(e);return this.getAllRowCtrls().filter((e=>{if(!e.isFullWidth())return!1;const a=e.getRowNode();return!(null!=t&&!this.isRowInMap(a,t))}))}createOrUpdateRowCtrl(e,t,a,n){let o,r=this.rowCtrlsByRowIndex[e];r||(o=this.rowModel.getRow(e),L(o)&&L(t)&&t[o.id]&&o.alreadyRendered&&(r=t[o.id],t[o.id]=null));if(!r){if(o||(o=this.rowModel.getRow(e)),!L(o))return;r=this.createRowCon(o,a,n)}return o&&(o.alreadyRendered=!0),th';
      S = S + 'is.rowCtrlsByRowIndex[e]=r,r}destroyRowCtrls(e,t){const a=[];j(e,((e,n)=>{n&&(this.cachedRowCtrls&&n.isCacheable()?this.cachedRowCtrls.addRow(n):(n.destroyFirstPass(!t),t?(this.zombieRowCtrls[n.getInstanceId()]=n,a.push((()=>{n.destroySecondPass(),delete this.zombieRowCtrls[n.getInstanceId()]}))):n.destroySecondPass()))})),t&&(a.push((()=>{this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()})),he(a))}getRowBuffer(){return this.gos.get("rowBuffer")}getRowBufferInPixels(){return this.getRowBuffer()*this.gos.getRowHeightAsNumber()}workOutFirstAndLastRowsToRender(){let e,t;if(this.rowContainerHeightService.updateOffset(),this.rowModel.isRowsToRender())if(this.printLayout)this.environment.refreshRowHeightVariable(),e=this.pageBoundsService.getFirstRow(),t=this.pageBoundsService.getLastRow();else{const a=this.getRowBufferInPixels(),n=this.ctrlsService.getGridBodyCtrl(),o=this.gos.get("suppressRowVirtualisation");let r,i,s=!1;do{const e=this.pageBoundsService.getPixelOffset(),{pageFirstPixel:t,pageLastPixel:l}=this.pageBoundsService.getCurrentPagePixelRange(),c=this.rowContainerHeightService.getDivStretchOffset(),g=n.getScrollFeature().getVScrollPosition(),d=g.top,h=g.bottom;o?(r=t+c,i=l+c):(r=Math.max(d+e-a,t)+c,i=Math.min(h+e+a,l)+c),this.firstVisibleVPixel=Math.max(d+e,t)+c,this.lastVisibleVPixel=Math.min(h+e,l)+c,s=this.ensureAllRowsInRangeHaveHeightsCalculated(r,i)}while(s);let l=this.rowModel.getRowIndexAtPixel(r),c=this.rowModel.getRowIndexAtPixel(i);const g=this.pageBoundsService.getFirstRow(),d=this.pageBoundsService.getLastRow();l<g&&(l=g),c>d&&(c=d),e=l,t=c}else e=0,t=-1;const a=this.gos.isDomLayout("normal"),n=this.gos.get("suppressMaxRenderedRowRestriction"),o=Math.max(this.getRowBuffer(),500);a&&!n&&t-e>o&&(t=e+o);const r=e!==this.firstRenderedRow,i=t!==this.lastRenderedRow;if(r||i){this.firstRenderedRow=e,this.lastRenderedRow=t;const a={type:"viewportChanged",firstRow:e,lastRow:t};this.eventService.dispatchEvent(a)}}dispatchFirstDataRenderedEvent(){';
      S = S + 'if(this.dataFirstRenderedFired)return;this.dataFirstRenderedFired=!0;const e={type:"firstDataRendered",firstRow:this.firstRenderedRow,lastRow:this.lastRenderedRow};window.requestAnimationFrame((()=>{this.beans.eventService.dispatchEvent(e)}))}ensureAllRowsInRangeHaveHeightsCalculated(e,t){const a=this.pinnedRowModel?.ensureRowHeightsValid(),n=this.stickyRowFeature?.ensureRowHeightsValid(),o=this.rowModel.ensureRowHeightsValid(e,t,this.pageBoundsService.getFirstRow(),this.pageBoundsService.getLastRow());return(o||n)&&this.eventService.dispatchEvent({type:"recalculateRowBounds"}),!!(n||o||a)&&(this.updateContainerHeights(),!0)}getFirstVisibleVerticalPixel(){return this.firstVisibleVPixel}getLastVisibleVerticalPixel(){return this.lastVisibleVPixel}getFirstVirtualRenderedRow(){return this.firstRenderedRow}getLastVirtualRenderedRow(){return this.lastRenderedRow}doNotUnVirtualiseRow(e){const t=!1,a=e.getRowNode(),n=this.focusService.isRowNodeFocused(a),o=e.isEditing(),r=a.detail;if(!(n||o||r))return t;return!!this.isRowPresent(a)||t}isRowPresent(e){return!!this.rowModel.isRowPresent(e)&&(!this.paginationService||this.paginationService.isRowPresent(e))}createRowCon(e,t,a){const n=this.cachedRowCtrls?this.cachedRowCtrls.getRow(e):null;if(n)return n;const o=this.gos.get("suppressAnimationFrame"),r=a&&!o&&!this.printLayout;return new Ii(e,this.beans,t,r,this.printLayout)}getRenderedNodes(){const e=this.rowCtrlsByRowIndex;return Object.values(e).map((e=>e.getRowNode()))}getRowByPosition(e){let t;const{rowIndex:a}=e;switch(e.rowPinned){case"top":t=this.topRowCtrls[a];break;case"bottom":t=this.bottomRowCtrls[a];break;default:t=this.rowCtrlsByRowIndex[a],t||(t=this.getStickyTopRowCtrls().find((e=>e.getRowNode().rowIndex===a))||null,t||(t=this.getStickyBottomRowCtrls().find((e=>e.getRowNode().rowIndex===a))||null))}return t}isRangeInRenderedViewport(e,t){if(null==e||null==t)return!1;const a=e>this.lastRenderedRow;return!(t<this.firstRenderedRow)&&!a}},_s=class{constructor(e){this.';
      S = S + 'entriesMap={},this.entriesList=[],this.maxCount=e}addRow(e){if(this.entriesMap[e.getRowNode().id]=e,this.entriesList.push(e),e.setCached(!0),this.entriesList.length>this.maxCount){const e=this.entriesList[0];e.destroyFirstPass(),e.destroySecondPass(),this.removeFromCache(e)}}getRow(e){if(null==e||null==e.id)return null;const t=this.entriesMap[e.id];if(!t)return null;this.removeFromCache(t),t.setCached(!1);return t.getRowNode()!=e?null:t}has(e){return null!=this.entriesMap[e.id]}removeRow(e){const t=e.id,a=this.entriesMap[t];delete this.entriesMap[t],f(this.entriesList,a)}removeFromCache(e){const t=e.getRowNode().id;delete this.entriesMap[t],f(this.entriesList,e)}getEntries(){return this.entriesList}},Js=class extends A{constructor(){super(...arguments),this.beanName="pinnedRowModel"}wireBeans(e){this.beans=e}postConstruct(){this.setPinnedTopRowData(),this.setPinnedBottomRowData(),this.addManagedPropertyListener("pinnedTopRowData",(()=>this.setPinnedTopRowData())),this.addManagedPropertyListener("pinnedBottomRowData",(()=>this.setPinnedBottomRowData())),this.addManagedEventListeners({gridStylesChanged:this.onGridStylesChanges.bind(this)})}isEmpty(e){return N("top"===e?this.pinnedTopRows:this.pinnedBottomRows)}isRowsToRender(e){return!this.isEmpty(e)}getRowAtPixel(e,t){const a="top"===t?this.pinnedTopRows:this.pinnedBottomRows;if(N(a))return 0;for(let t=0;t<a.length;t++){const n=a[t];if(n.rowTop+n.rowHeight-1>=e)return t}return a.length-1}onGridStylesChanges(e){if(e.rowHeightChanged){const e=e=>{e.setRowHeight(e.rowHeight,!0)};this.pinnedBottomRows.forEach(e),this.pinnedTopRows.forEach(e)}}ensureRowHeightsValid(){let e=!1,t=0;const a=a=>{if(a.rowHeightEstimated){const n=this.gos.getRowHeightForNode(a);a.setRowTop(t),a.setRowHeight(n.height),t+=n.height,e=!0}};this.pinnedBottomRows?.forEach(a),t=0,this.pinnedTopRows?.forEach(a);return this.eventService.dispatchEvent({type:"pinnedHeightChanged"}),e}setPinnedTopRowData(){const e=this.gos.get("pinnedTopRowData");this.pinn';
      S = S + 'edTopRows=this.createNodesFromData(e,!0);this.eventService.dispatchEvent({type:"pinnedRowDataChanged"})}setPinnedBottomRowData(){const e=this.gos.get("pinnedBottomRowData");this.pinnedBottomRows=this.createNodesFromData(e,!1);this.eventService.dispatchEvent({type:"pinnedRowDataChanged"})}createNodesFromData(e,t){const a=[];if(e){const n=this.gos.getRowIdCallback(),o=t?oo.ID_PREFIX_TOP_PINNED:oo.ID_PREFIX_BOTTOM_PINNED;let r=0;e.forEach(((e,i)=>{const s=new oo(this.beans);s.data=e,s.id=n?.({data:e,level:0})??o+i,s.rowPinned=t?"top":"bottom",s.setRowTop(r),s.setRowHeight(this.gos.getRowHeightForNode(s).height),s.setRowIndex(i),r+=s.rowHeight,a.push(s)}))}return a}getPinnedTopRowNodes(){return this.pinnedTopRows}getPinnedBottomRowNodes(){return this.pinnedBottomRows}getPinnedTopTotalHeight(){return this.getTotalHeight(this.pinnedTopRows)}getPinnedTopRowCount(){return this.pinnedTopRows?this.pinnedTopRows.length:0}getPinnedBottomRowCount(){return this.pinnedBottomRows?this.pinnedBottomRows.length:0}getPinnedTopRow(e){return this.pinnedTopRows[e]}getPinnedBottomRow(e){return this.pinnedBottomRows[e]}forEachPinnedTopRow(e){N(this.pinnedTopRows)||this.pinnedTopRows.forEach(e)}forEachPinnedBottomRow(e){N(this.pinnedBottomRows)||this.pinnedBottomRows.forEach(e)}getPinnedBottomTotalHeight(){return this.getTotalHeight(this.pinnedBottomRows)}getTotalHeight(e){if(!e||0===e.length)return 0;const t=d(e);return t.rowTop+t.rowHeight}},Zs=(e=>(e.Applied="Applied",e.StoreNotFound="StoreNotFound",e.StoreLoading="StoreLoading",e.StoreWaitingToLoad="StoreWaitingToLoad",e.StoreLoadingFailed="StoreLoadingFailed",e.StoreWrongType="StoreWrongType",e.Cancelled="Cancelled",e.StoreNotStarted="StoreNotStarted",e))(Zs||{}),Xs=class extends A{constructor(e){super(),this.state="needsLoading",this.version=0,this.id=e}getId(){return this.id}load(){this.state="loading",this.loadFromDatasource()}getVersion(){return this.version}setStateWaitingToLoad(){this.version++,this.state="needsLoading"}getState()';
      S = S + '{return this.state}pageLoadFailed(e){this.isRequestMostRecentAndLive(e)&&(this.state="failed",this.processServerFail()),this.dispatchLoadCompleted(!1)}success(e,t){this.successCommon(e,t)}pageLoaded(e,t,a){this.successCommon(e,{rowData:t,rowCount:a})}isRequestMostRecentAndLive(e){const t=e===this.version,a=this.isAlive();return t&&a}successCommon(e,t){this.dispatchLoadCompleted();this.isRequestMostRecentAndLive(e)&&(this.state="loaded",this.processServerResult(t))}dispatchLoadCompleted(e=!0){const t={type:"loadComplete",success:e,block:this};this.dispatchLocalEvent(t)}},$s=class extends A{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}wireBeans(e){this.rowModel=e.rowModel}postConstruct(){this.maxConcurrentRequests=this.getMaxConcurrentDatasourceRequests();const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=fe(this.performCheckBlocksToLoad.bind(this),e))}getMaxConcurrentDatasourceRequests(){const e=this.gos.get("maxConcurrentDatasourceRequests");return null==e?2:e<=0?void 0:e}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){f(this.blocks,e)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad(),this.dispatchLocalEvent({type:"blockLoaded"}),0==this.activeBlockLoadsCount&&this.dispatchLocalEvent({type:"blockLoaderFinished"})}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),null!=this.maxConcurrentRequests&&this.activeBlockLoadsCount>=this.maxConcurrentRequests)return void(this.gos.get("debug")&&le("RowNodeBlockLoader - checkBlockToLoad: max loads exceeded"));const e=this.getAvailableLoadingCount(),t=this.blocks.filter((e=>"needsLoading"===e.getState())).slice(0,e);this.registerLo';
      S = S + 'ads(t.length),t.forEach((e=>e.load())),this.printCacheStatus()}getBlockState(){if(this.gos.isRowModelType("serverSide")){return this.rowModel.getBlockStates()}const e={};return this.blocks.forEach((t=>{const{id:a,state:n}=t.getBlockStateJson();e[a]=n})),e}printCacheStatus(){this.gos.get("debug")&&le(`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}isLoading(){return this.activeBlockLoadsCount>0}registerLoads(e){this.activeBlockLoadsCount+=e}getAvailableLoadingCount(){return void 0!==this.maxConcurrentRequests?this.maxConcurrentRequests-this.activeBlockLoadsCount:void 0}},el={version:gr,moduleName:"@ag-grid-community/row-node-block",beans:[$s]},tl=class{constructor(){this.root=null,this.end=null,this.cachedRange=[]}init(e){this.rowModel=e}reset(){this.root=null,this.end=null,this.cachedRange.length=0}setRoot(e){this.root=e,this.end=null,this.cachedRange.length=0}setEndRange(e){this.end=e,this.cachedRange.length=0}getRange(){if(0===this.cachedRange.length){const e=this.getRoot(),t=this.getEnd();if(null==e||null==t)return this.cachedRange;this.cachedRange=this.rowModel.getNodesInRangeForSelection(e,t)}return this.cachedRange}isInRange(e){return null!==this.root&&this.getRange().some((t=>t.id===e.id))}getRoot(){return this.root&&null===this.root?.key&&(this.root=this.rowModel.getRowNode(this.root.id)??null),this.root}getEnd(){return this.end&&null===this.end?.key&&(this.end=this.rowModel.getRowNode(this.end.id)??null),this.end}truncate(e){const t=this.getRange();if(0===t.length)return{keep:[],discard:[]};const a=t[0].id===this.root.id,n=t.findIndex((t=>t.id===e.id));if(n>-1){const o=t.slice(0,n),r=t.slice(n+1);return this.setEndRange(e),a?{keep:o,discard:r}:{keep:r,discard:o}}return{keep:t,discard:[]}}extend(e,t=!1){const a=this.getRoot();if(null==a){const a=this.getRange().slice();return t&&e.depthFirstSearch((e=>!e.group&&a.push(e))),a.push(e),this.setRoot(e),{keep:a,discar';
      S = S + 'd:[]}}if(this.rowModel.getNodesInRangeForSelection(a,e).find((e=>e.id===this.end?.id)))return this.setEndRange(e),{keep:this.getRange(),discard:[]};{const t=this.getRange().slice();return this.setEndRange(e),{keep:this.getRange(),discard:t}}}},al=class extends A{constructor(){super(...arguments),this.beanName="stylingService"}wireBeans(e){this.expressionService=e.expressionService}processAllCellClasses(e,t,a,n){this.processClassRules(void 0,e.cellClassRules,t,a,n),this.processStaticCellClasses(e,t,a)}processClassRules(e,t,a,n,o){if(null==t&&null==e)return;const r={},i={},s=(e,t)=>{e.split(" ").forEach((e=>{""!=e.trim()&&t(e)}))};if(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const o=e[n],l=t[o];let c;"string"==typeof l?c=this.expressionService.evaluate(l,a):"function"==typeof l&&(c=l(a)),s(o,(e=>{c?r[e]=!0:i[e]=!0}))}}e&&o&&Object.keys(e).forEach((e=>s(e,(e=>{r[e]||(i[e]=!0)})))),o&&Object.keys(i).forEach(o),Object.keys(r).forEach(n)}getStaticCellClasses(e,t){const{cellClass:a}=e;if(!a)return[];let n;if("function"==typeof a){n=a(t)}else n=a;return"string"==typeof n&&(n=[n]),n||[]}processStaticCellClasses(e,t,a){this.getStaticCellClasses(e,t).forEach((e=>{a(e)}))}},nl=class extends rn{constructor(e){super(e,"ag-toggle-button")}setValue(e,t){return super.setValue(e,t),this.addOrRemoveCssClass("ag-selected",this.getValue()),this}},ol={selector:"AG-TOGGLE-BUTTON",component:nl},rl=(e=>(e.TAB_GUARD="ag-tab-guard",e.TAB_GUARD_TOP="ag-tab-guard-top",e.TAB_GUARD_BOTTOM="ag-tab-guard-bottom",e))(rl||{}),il=class extends A{constructor(e){super(),this.skipTabGuardFocus=!1,this.forcingFocusOut=!1,this.allowFocus=!1;const{comp:t,eTopGuard:a,eBottomGuard:n,focusTrapActive:o,forceFocusOutWhenTabGuardsAreEmpty:r,isFocusableContainer:i,focusInnerElement:s,onFocusIn:l,onFocusOut:c,shouldStopEventPropagation:g,onTabKeyDown:d,handleKeyDown:h,eFocusableElement:u}=e;this.comp=t,this.eTopGuard=a,this.eBottomGuard=n,this.providedFocusInnerElement=s,this.eFocusableElement=u,this.fo';
      S = S + 'cusTrapActive=!!o,this.forceFocusOutWhenTabGuardsAreEmpty=!!r,this.isFocusableContainer=!!i,this.providedFocusIn=l,this.providedFocusOut=c,this.providedShouldStopEventPropagation=g,this.providedOnTabKeyDown=d,this.providedHandleKeyDown=h}wireBeans(e){this.focusService=e.focusService}postConstruct(){this.createManagedBean(new ho(this.eFocusableElement,{shouldStopEventPropagation:()=>this.shouldStopEventPropagation(),onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e),onFocusIn:e=>this.onFocusIn(e),onFocusOut:e=>this.onFocusOut(e)})),this.activateTabGuards(),[this.eTopGuard,this.eBottomGuard].forEach((e=>this.addManagedElementListeners(e,{focus:this.onFocus.bind(this)})))}handleKeyDown(e){this.providedHandleKeyDown&&this.providedHandleKeyDown(e)}tabGuardsAreActive(){return!!this.eTopGuard&&this.eTopGuard.hasAttribute("tabIndex")}shouldStopEventPropagation(){return!!this.providedShouldStopEventPropagation&&this.providedShouldStopEventPropagation()}activateTabGuards(){if(this.forcingFocusOut)return;const e=this.gos.get("tabIndex");this.comp.setTabIndex(e.toString())}deactivateTabGuards(){this.comp.setTabIndex()}onFocus(e){if(this.isFocusableContainer&&!this.eFocusableElement.contains(e.relatedTarget)&&!this.allowFocus)return void this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);if(this.skipTabGuardFocus)return void(this.skipTabGuardFocus=!1);if(this.forceFocusOutWhenTabGuardsAreEmpty){if(0===this.focusService.findFocusableElements(this.eFocusableElement,".ag-tab-guard").length)return void this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard)}if(this.isFocusableContainer&&this.eFocusableElement.contains(e.relatedTarget))return;const t=e.target===this.eBottomGuard;this.providedFocusInnerElement?this.providedFocusInnerElement(t):this.focusInnerElement(t)}findNextElementOutsideAndFocus(e){const t=this.gos.getDocument(),a=this.focusService.findFocusableElements(t.body,null,!0),n=a.indexOf(e?this.eTopGuard:this.eBottomGuard';
      S = S + ');if(-1===n)return;let o,r;e?(o=0,r=n):(o=n+1,r=a.length);const i=a.slice(o,r),s=this.gos.get("tabIndex");i.sort(((e,t)=>{const a=parseInt(e.getAttribute("tabindex")||"0"),n=parseInt(t.getAttribute("tabindex")||"0");return n===s?1:a===s?-1:0===a?1:0===n?-1:a-n})),i[e?i.length-1:0].focus()}onFocusIn(e){this.focusTrapActive||this.forcingFocusOut||(this.providedFocusIn&&this.providedFocusIn(e),this.isFocusableContainer||this.deactivateTabGuards())}onFocusOut(e){this.focusTrapActive||(this.providedFocusOut&&this.providedFocusOut(e),this.eFocusableElement.contains(e.relatedTarget)||this.activateTabGuards())}onTabKeyDown(e){if(this.providedOnTabKeyDown)return void this.providedOnTabKeyDown(e);if(this.focusTrapActive)return;if(e.defaultPrevented)return;const t=this.tabGuardsAreActive();t&&this.deactivateTabGuards();const a=this.getNextFocusableElement(e.shiftKey);t&&setTimeout((()=>this.activateTabGuards()),0),a&&(a.focus(),e.preventDefault())}focusInnerElement(e=!1){const t=this.focusService.findFocusableElements(this.eFocusableElement);this.tabGuardsAreActive()&&(t.splice(0,1),t.splice(t.length-1,1)),t.length&&t[e?t.length-1:0].focus({preventScroll:!0})}getNextFocusableElement(e){return this.focusService.findNextFocusableElement(this.eFocusableElement,!1,e)}forceFocusOutOfContainer(e=!1){if(this.forcingFocusOut)return;const t=e?this.eTopGuard:this.eBottomGuard;this.activateTabGuards(),this.skipTabGuardFocus=!0,this.forcingFocusOut=!0,t.focus(),window.setTimeout((()=>{this.forcingFocusOut=!1,this.activateTabGuards()}))}isTabGuard(e,t){return e===this.eTopGuard&&!t||e===this.eBottomGuard&&(t??!0)}setAllowFocus(e){this.allowFocus=e}},sl=class extends A{constructor(e){super(),this.comp=e}initialiseTabGuard(e){this.eTopGuard=this.createTabGuard("top"),this.eBottomGuard=this.createTabGuard("bottom"),this.eFocusableElement=this.comp.getFocusableElement();const{eTopGuard:t,eBottomGuard:a,eFocusableElement:n}=this,o=[t,a],r={setTabIndex:e=>{o.forEach((t=>null!=e?t.setAttribute("t';
      S = S + 'abindex",e):t.removeAttribute("tabindex")))}};this.addTabGuards(t,a);const{focusTrapActive:i=!1,onFocusIn:s,onFocusOut:l,focusInnerElement:c,handleKeyDown:g,onTabKeyDown:d,shouldStopEventPropagation:h,forceFocusOutWhenTabGuardsAreEmpty:u,isFocusableContainer:p}=e;this.tabGuardCtrl=this.createManagedBean(new il({comp:r,focusTrapActive:i,eTopGuard:t,eBottomGuard:a,eFocusableElement:n,onFocusIn:s,onFocusOut:l,focusInnerElement:c,handleKeyDown:g,onTabKeyDown:d,shouldStopEventPropagation:h,forceFocusOutWhenTabGuardsAreEmpty:u,isFocusableContainer:p}))}getTabGuardCtrl(){return this.tabGuardCtrl}createTabGuard(e){const t=this.gos.getDocument().createElement("div"),a="top"===e?"ag-tab-guard-top":"ag-tab-guard-bottom";return t.classList.add("ag-tab-guard",a),yt(t,"presentation"),t}addTabGuards(e,t){this.eFocusableElement.insertAdjacentElement("afterbegin",e),this.eFocusableElement.insertAdjacentElement("beforeend",t)}removeAllChildrenExceptTabGuards(){const e=[this.eTopGuard,this.eBottomGuard];ba(this.comp.getFocusableElement()),this.addTabGuards(...e)}forceFocusOutOfContainer(e=!1){this.tabGuardCtrl.forceFocusOutOfContainer(e)}appendChild(e,t,a){Ea(t)||(t=t.getGui());const{eBottomGuard:n}=this;n?n.insertAdjacentElement("beforebegin",t):e(t,a)}},ll=class extends Ba{initialiseTabGuard(e){this.tabGuardFeature=this.createManagedBean(new sl(this)),this.tabGuardFeature.initialiseTabGuard(e)}forceFocusOutOfContainer(e=!1){this.tabGuardFeature.forceFocusOutOfContainer(e)}appendChild(e,t){this.tabGuardFeature.appendChild(super.appendChild.bind(this),e,t)}},cl=0,gl=class extends A{constructor(){super(...arguments),this.beanName="popupService",this.popupList=[]}wireBeans(e){this.ctrlsService=e.ctrlsService,this.resizeObserverService=e.resizeObserverService,this.environment=e.environment}postConstruct(){this.ctrlsService.whenReady((e=>{this.gridCtrl=e.gridCtrl})),this.addManagedEventListeners({gridStylesChanged:this.handleThemeChange.bind(this)})}getPopupParent(){const e=this.gos.get("';
      S = S + 'popupParent");return e||this.gridCtrl.getGui()}positionPopupForMenu(e){const{eventSource:t,ePopup:a}=e,n=this.getPopupIndex(a);if(-1!==n){this.popupList[n].alignedToElement=t}const o=t.getBoundingClientRect(),r=this.getParentRect(),i=this.keepXYWithinBounds(a,o.top-r.top,0),s=a.clientWidth>0?a.clientWidth:200;a.style.minWidth=`${s}px`;const l=r.right-r.left-s;let c;function g(){return o.right-r.left-2}function d(){return o.left-r.left-s}this.gos.get("enableRtl")?(c=d(),c<0&&(c=g(),this.setAlignedStyles(a,"left")),c>l&&(c=0,this.setAlignedStyles(a,"right"))):(c=g(),c>l&&(c=d(),this.setAlignedStyles(a,"right")),c<0&&(c=0,this.setAlignedStyles(a,"left"))),a.style.left=`${c}px`,a.style.top=`${i}px`}positionPopupUnderMouseEvent(e){const{ePopup:t,nudgeX:a,nudgeY:n,skipObserver:o}=e;this.positionPopup({ePopup:t,nudgeX:a,nudgeY:n,keepWithinBounds:!0,skipObserver:o,updatePosition:()=>this.calculatePointerAlign(e.mouseEvent),postProcessCallback:()=>this.callPostProcessPopup(e.type,e.ePopup,null,e.mouseEvent,e.column,e.rowNode)})}calculatePointerAlign(e){const t=this.getParentRect();return{x:e.clientX-t.left,y:e.clientY-t.top}}positionPopupByComponent(e){const{ePopup:t,nudgeX:a,nudgeY:n,keepWithinBounds:o,eventSource:r,alignSide:i="left",position:s="over",column:l,rowNode:c,type:g}=e,d=r.getBoundingClientRect(),h=this.getParentRect(),u=this.getPopupIndex(t);if(-1!==u){this.popupList[u].alignedToElement=r}this.positionPopup({ePopup:t,nudgeX:a,nudgeY:n,keepWithinBounds:o,updatePosition:()=>{let a,o=d.left-h.left;if("right"===i&&(o-=t.offsetWidth-d.width),"over"===s)a=d.top-h.top,this.setAlignedStyles(t,"over");else{this.setAlignedStyles(t,"under");a="under"===this.shouldRenderUnderOrAbove(t,d,h,e.nudgeY||0)?d.top-h.top+d.height:d.top-t.offsetHeight-2*(n||0)-h.top}return{x:o,y:a}},postProcessCallback:()=>this.callPostProcessPopup(g,t,r,null,l,c)})}shouldRenderUnderOrAbove(e,t,a,n){const o=a.bottom-t.bottom,r=t.top-a.top,i=e.offsetHeight+n;return o>i?"under":r>i||r>o?"above":"unde';
      S = S + 'r"}setAlignedStyles(e,t){const a=this.getPopupIndex(e);if(-1===a)return;const n=this.popupList[a],{alignedToElement:o}=n;if(!o)return;["right","left","over","above","under"].forEach((t=>{o.classList.remove(`ag-has-popup-positioned-${t}`),e.classList.remove(`ag-popup-positioned-${t}`)})),t&&(o.classList.add(`ag-has-popup-positioned-${t}`),e.classList.add(`ag-popup-positioned-${t}`))}callPostProcessPopup(e,t,a,n,o,r){const i=this.gos.getCallback("postProcessPopup");if(i){i({column:o,rowNode:r,ePopup:t,type:e,eventSource:a,mouseEvent:n})}}positionPopup(e){const{ePopup:t,keepWithinBounds:a,nudgeX:n,nudgeY:o,skipObserver:r,updatePosition:i}=e,s={width:0,height:0},l=(r=!1)=>{let{x:l,y:c}=i();r&&t.clientWidth===s.width&&t.clientHeight===s.height||(s.width=t.clientWidth,s.height=t.clientHeight,n&&(l+=n),o&&(c+=o),a&&(l=this.keepXYWithinBounds(t,l,1),c=this.keepXYWithinBounds(t,c,0)),t.style.left=`${l}px`,t.style.top=`${c}px`,e.postProcessCallback&&e.postProcessCallback())};if(l(),!r){const e=this.resizeObserverService.observeResize(t,(()=>l(!0)));setTimeout((()=>e()),200)}}getActivePopups(){return this.popupList.map((e=>e.element))}getPopupList(){return this.popupList}getParentRect(){const e=this.gos.getDocument();let t=this.getPopupParent();return t===e.body?t=e.documentElement:"static"===getComputedStyle(t).position&&(t=t.offsetParent),pa(t)}keepXYWithinBounds(e,t,a){const n=0===a,o=n?"clientHeight":"clientWidth",r=n?"top":"left",i=n?"height":"width",s=n?"scrollTop":"scrollLeft",l=this.gos.getDocument(),c=l.documentElement,g=this.getPopupParent(),d=e.getBoundingClientRect(),h=g.getBoundingClientRect(),u=l.documentElement.getBoundingClientRect(),p=g===l.body,m=Math.ceil(d[i]);let f=p?(n?ha:ua)(c)+c[s]:g[o];p&&(f-=Math.abs(u[r]-h[r]));const v=f-m;return Math.min(Math.max(t,0),Math.abs(v))}addPopup(e){const t=this.gos.getDocument(),{eChild:a,ariaLabel:n,alwaysOnTop:o,positionCallback:r,anchorToElement:i}=e;if(!t)return ce("could not find the document, document is empty"),{hi';
      S = S + 'deFunc:()=>{}};const s=this.getPopupIndex(a);if(-1!==s){return{hideFunc:this.popupList[s].hideFunc}}this.initialisePopupPosition(a);const l=this.createPopupWrapper(a,n,!!o),c=this.addEventListenersToPopup({...e,wrapperEl:l});return r&&r(),this.addPopupToPopupList(a,l,c,i),{hideFunc:c}}initialisePopupPosition(e){const t=this.getPopupParent().getBoundingClientRect();L(e.style.top)||(e.style.top=-1*t.top+"px"),L(e.style.left)||(e.style.left=-1*t.left+"px")}createPopupWrapper(e,t,a){const n=this.getPopupParent(),o=document.createElement("div");return this.environment.applyThemeClasses(o),o.classList.add("ag-popup"),e.classList.add(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr","ag-popup-child"),e.hasAttribute("role")||yt(e,"dialog"),kt(e,t),o.appendChild(e),n.appendChild(o),a?this.setAlwaysOnTop(e,!0):this.bringPopupToFront(e),o}handleThemeChange(e){if(e.themeChanged)for(const e of this.popupList)this.environment.applyThemeClasses(e.wrapper)}addEventListenersToPopup(e){const t=this.gos.getDocument(),a=this.getPopupParent(),{wrapperEl:n,eChild:o,closedCallback:r,afterGuiAttached:i,closeOnEsc:s,modal:l}=e;let c=!1;const g=e=>{if(!n.contains(this.gos.getActiveDomElement()))return;e.key!==tn.ESCAPE||M(e)||u({keyboardEvent:e})},d=e=>u({mouseEvent:e}),h=e=>u({touchEvent:e}),u=(e={})=>{const{mouseEvent:i,touchEvent:s,keyboardEvent:l,forceHide:u}=e;(u||!this.isEventFromCurrentPopup({mouseEvent:i,touchEvent:s},o)&&!c)&&(c=!0,a.removeChild(n),t.removeEventListener("keydown",g),t.removeEventListener("mousedown",d),t.removeEventListener("touchstart",h),t.removeEventListener("contextmenu",d),this.eventService.removeEventListener("dragStarted",d),r&&r(i||s||l),this.removePopupFromPopupList(o))};return i&&i({hidePopup:u}),window.setTimeout((()=>{s&&t.addEventListener("keydown",g),l&&(t.addEventListener("mousedown",d),this.eventService.addEventListener("dragStarted",d),t.addEventListener("touchstart",h),t.addEventListener("contextmenu",d))}),0),u}addPopupToPopupList(e,t,a,n){this.popupLis';
      S = S + 't.push({element:e,wrapper:t,hideFunc:a,instanceId:cl++,isAnchored:!!n}),n&&this.setPopupPositionRelatedToElement(e,n)}getPopupIndex(e){return this.popupList.findIndex((t=>t.element===e))}setPopupPositionRelatedToElement(e,t){const a=this.getPopupIndex(e);if(-1===a)return;const n=this.popupList[a];if(n.stopAnchoringPromise&&n.stopAnchoringPromise.then((e=>e&&e())),n.stopAnchoringPromise=void 0,n.isAnchored=!1,!t)return;const o=this.keepPopupPositionedRelativeTo({element:t,ePopup:e,hidePopup:n.hideFunc});return n.stopAnchoringPromise=o,n.isAnchored=!0,o}removePopupFromPopupList(e){this.setAlignedStyles(e,null),this.setPopupPositionRelatedToElement(e,null),this.popupList=this.popupList.filter((t=>t.element!==e))}keepPopupPositionedRelativeTo(e){const t=this.getPopupParent(),a=t.getBoundingClientRect(),{element:n,ePopup:o}=e,r=n.getBoundingClientRect(),i=a.top-r.top,s=a.left-r.left;let l=i,c=s;const g=o.style.top,d=parseInt(g.substring(0,g.length-1),10),h=o.style.left,u=parseInt(h.substring(0,h.length-1),10),p=this.getFrameworkOverrides();return new Cn((a=>{p.wrapIncoming((()=>{p.setInterval((()=>{const a=t.getBoundingClientRect(),r=n.getBoundingClientRect();if(0==r.top&&0==r.left&&0==r.height&&0==r.width)return void e.hidePopup();const g=a.top-r.top;if(g!=l){const e=this.keepXYWithinBounds(o,d+i-g,0);o.style.top=`${e}px`}l=g;const h=a.left-r.left;if(h!=c){const e=this.keepXYWithinBounds(o,u+s-h,1);o.style.left=`${e}px`}c=h}),200).then((e=>{a((()=>{null!=e&&window.clearInterval(e)}))}))}),"popupPositioning")}))}hasAnchoredPopup(){return this.popupList.some((e=>e.isAnchored))}isEventFromCurrentPopup(e,t){const{mouseEvent:a,touchEvent:n}=e,o=a||n;if(!o)return!1;const r=this.getPopupIndex(t);if(-1===r)return!1;for(let e=r;e<this.popupList.length;e++){if(P(this.popupList[e].element,o))return!0}return this.isElementWithinCustomPopup(o.target)}isElementWithinCustomPopup(e){const t=this.gos.getDocument();for(;e&&e!==t.body;){if(e.classList.contains("ag-custom-component-popup")';
      S = S + '||null===e.parentElement)return!0;e=e.parentElement}return!1}getWrapper(e){for(;!e.classList.contains("ag-popup")&&e.parentElement;)e=e.parentElement;return e.classList.contains("ag-popup")?e:null}setAlwaysOnTop(e,t){const a=this.getWrapper(e);a&&(a.classList.toggle("ag-always-on-top",!!t),t&&this.bringPopupToFront(a))}bringPopupToFront(e){const t=this.getPopupParent(),a=Array.prototype.slice.call(t.querySelectorAll(".ag-popup")),n=a.length,o=Array.prototype.slice.call(t.querySelectorAll(".ag-popup.ag-always-on-top")),r=o.length,i=this.getWrapper(e);if(!i||n<=1||!t.contains(e))return!1;const s=a.indexOf(i),l=i.querySelectorAll("div"),c=[];l.forEach((e=>{0!==e.scrollTop&&c.push([e,e.scrollTop])}));let g=!1;if(r){i.classList.contains("ag-always-on-top")?s!==n-1&&(d(o).insertAdjacentElement("afterend",i),g=!0):s!==n-r-1&&(o[0].insertAdjacentElement("beforebegin",i),g=!0)}else s!==n-1&&(d(a).insertAdjacentElement("afterend",i),g=!0);for(;c.length;){const e=c.pop();e[0].scrollTop=e[1]}return g}},dl=["touchstart","touchend","touchmove","touchcancel"],hl=class{constructor(e="javascript"){this.frameworkName=e,this.renderingEngine="vanilla",this.wrapIncoming=e=>e(),this.wrapOutgoing=e=>e()}setInterval(e,t){return new Cn((a=>{a(window.setInterval(e,t))}))}addEventListener(e,t,a,n){const o=w(dl,t);e.addEventListener(t,a,{capture:!!n,passive:o})}get shouldWrapOutgoing(){return!1}frameworkComponent(e){return null}isFrameworkComponent(e){return!1}getDocLink(e){return`https://www.ag-grid.com/${"solid"===this.frameworkName?"react":this.frameworkName}-data-grid${e?`/${e}`:""}`}},ul=class extends A{constructor(){super(...arguments),this.beanName="cellNavigationService"}wireBeans(e){this.visibleColsService=e.visibleColsService,this.rowModel=e.rowModel,this.rowRenderer=e.rowRenderer,this.pinnedRowModel=e.pinnedRowModel,this.paginationService=e.paginationService,this.pageBoundsService=e.pageBoundsService}getNextCellToFocus(e,t,a=!1){return a?this.getNextCellToFocusWithCtrlPressed(e,t):t';
      S = S + 'his.getNextCellToFocusWithoutCtrlPressed(e,t)}getNextCellToFocusWithCtrlPressed(e,t){const a=e===tn.UP,n=e===tn.DOWN,o=e===tn.LEFT;let r,i;if(a||n)i=a?this.pageBoundsService.getFirstRow():this.pageBoundsService.getLastRow(),r=t.column;else{const e=this.visibleColsService.getAllCols(),a=this.gos.get("enableRtl");i=t.rowIndex,r=o!==a?e[0]:d(e)}return{rowIndex:i,rowPinned:null,column:r}}getNextCellToFocusWithoutCtrlPressed(e,t){let a=t,n=!1;for(;!n;){switch(e){case tn.UP:a=this.getCellAbove(a);break;case tn.DOWN:a=this.getCellBelow(a);break;case tn.RIGHT:a=this.gos.get("enableRtl")?this.getCellToLeft(a):this.getCellToRight(a);break;case tn.LEFT:a=this.gos.get("enableRtl")?this.getCellToRight(a):this.getCellToLeft(a);break;default:a=null,ce("unknown key for navigation ",e)}n=!a||this.isCellGoodToFocusOn(a)}return a}isCellGoodToFocusOn(e){const t=e.column;let a;switch(e.rowPinned){case"top":a=this.pinnedRowModel.getPinnedTopRow(e.rowIndex);break;case"bottom":a=this.pinnedRowModel.getPinnedBottomRow(e.rowIndex);break;default:a=this.rowModel.getRow(e.rowIndex)}if(!a)return!1;return!t.isSuppressNavigable(a)}getCellToLeft(e){if(!e)return null;const t=this.visibleColsService.getColBefore(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getCellToRight(e){if(!e)return null;const t=this.visibleColsService.getColAfter(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getRowBelow(e){const t=e.rowIndex,a=e.rowPinned;if(this.isLastRowInContainer(e))switch(a){case"bottom":return null;case"top":return this.rowModel.isRowsToRender()?{rowIndex:this.pageBoundsService.getFirstRow(),rowPinned:null}:this.pinnedRowModel.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null;default:return this.pinnedRowModel.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null}const n=this.rowModel.getRow(e.rowIndex),o=this.getNextStickyPosition(n);return o||{rowIndex:t+1,rowPinned:a}}getNextStickyPosition(e,t){if(!this.gos.isGroupRowsSti';
      S = S + 'cky()||!e||!e.sticky)return;let a=[];a=this.rowRenderer.getStickyTopRowCtrls().some((t=>t.getRowNode().rowIndex===e.rowIndex))?[...this.rowRenderer.getStickyTopRowCtrls()].sort(((e,t)=>e.getRowNode().rowIndex-t.getRowNode().rowIndex)):[...this.rowRenderer.getStickyBottomRowCtrls()].sort(((e,t)=>t.getRowNode().rowIndex-e.getRowNode().rowIndex));const n=t?-1:1,o=a.findIndex((t=>t.getRowNode().rowIndex===e.rowIndex)),r=a[o+n];return r?{rowIndex:r.getRowNode().rowIndex,rowPinned:null}:void 0}getCellBelow(e){if(!e)return null;const t=this.getRowBelow(e);return t?{rowIndex:t.rowIndex,column:e.column,rowPinned:t.rowPinned}:null}isLastRowInContainer(e){const t=e.rowPinned,a=e.rowIndex;if("top"===t){return this.pinnedRowModel.getPinnedTopRowNodes().length-1<=a}if("bottom"===t){return this.pinnedRowModel.getPinnedBottomRowNodes().length-1<=a}return this.pageBoundsService.getLastRow()<=a}getRowAbove(e){const t=e.rowIndex,a=e.rowPinned;if(a?0===t:t===this.pageBoundsService.getFirstRow())return"top"===a?null:a&&this.rowModel.isRowsToRender()?this.getLastBodyCell():this.pinnedRowModel.isRowsToRender("top")?this.getLastFloatingTopRow():null;const n=this.rowModel.getRow(e.rowIndex),o=this.getNextStickyPosition(n,!0);return o||{rowIndex:t-1,rowPinned:a}}getCellAbove(e){if(!e)return null;const t=this.getRowAbove({rowIndex:e.rowIndex,rowPinned:e.rowPinned});return t?{rowIndex:t.rowIndex,column:e.column,rowPinned:t.rowPinned}:null}getLastBodyCell(){return{rowIndex:this.pageBoundsService.getLastRow(),rowPinned:null}}getLastFloatingTopRow(){return{rowIndex:this.pinnedRowModel.getPinnedTopRowNodes().length-1,rowPinned:"top"}}getNextTabbedCell(e,t){return t?this.getNextTabbedCellBackwards(e):this.getNextTabbedCellForwards(e)}getNextTabbedCellForwards(e){const t=this.visibleColsService.getAllCols();let a=e.rowIndex,n=e.rowPinned,o=this.visibleColsService.getColAfter(e.column);if(!o){o=t[0];const r=this.getRowBelow(e);if(O(r))return null;if(!r.rowPinned&&!(this.paginationService?.isRowInPage';
      S = S + '(r)??1))return null;a=r?r.rowIndex:null,n=r?r.rowPinned:null}return{rowIndex:a,column:o,rowPinned:n}}getNextTabbedCellBackwards(e){const t=this.visibleColsService.getAllCols();let a=e.rowIndex,n=e.rowPinned,o=this.visibleColsService.getColBefore(e.column);if(!o){o=d(t);const r=this.getRowAbove({rowIndex:e.rowIndex,rowPinned:e.rowPinned});if(O(r))return null;if(!r.rowPinned&&!(this.paginationService?.isRowInPage(r)??1))return null;a=r?r.rowIndex:null,n=r?r.rowPinned:null}return{rowIndex:a,column:o,rowPinned:n}}};function pl(e,t){e.eventService.dispatchEvent(t)}var ml=class extends A{constructor(){super(...arguments),this.beanName="apiFunctionService",this.functions={dispatchEvent:pl},this.isDestroyed=!1}wireBeans(e){this.beans=e}postConstruct(){this.preDestroyLink=this.frameworkOverrides.getDocLink("grid-lifecycle/#grid-pre-destroyed")}callFunction(e,t){const a=this.functions[e];return a?a.apply(a,[this.beans,...t]):this.isDestroyed?this.destroyedHandler(e):void(this.isFrameworkMethod(e)||this.beans.validationService?.warnMissingApiFunction(e))}addFunction(e,t){const{validationService:a}=this.beans;a&&(t=a.validateApiFunction(e,t)),this.functions[e]=t}destroy(){this.functions={},this.isDestroyed=!0,super.destroy()}destroyedHandler(e){if("isDestroyed"===e)return!0;"destroy"!==e&&ce(`Grid API function ${e}() cannot be called as the grid has been destroyed.\\nEither clear local references to the grid api, when it is destroyed, or check gridApi.isDestroyed() to avoid calling methods against a destroyed grid.\\nTo run logic when the grid is about to be destroyed use the gridPreDestroy event. See: ${this.preDestroyLink}`)}isFrameworkMethod(e){return["preWireBeans","wireBeans","preConstruct","postConstruct"].includes(e)}};function fl(e){const t=e.getBean("apiFunctionService");return new Proxy(t,{get(e,t){return(...a)=>e.callFunction(t,a)}})}function vl(e){return{beanName:"gridApi",bean:fl(e)}}var bl=class extends A{constructor(){super(...arguments),this.beanName="columnDefFac';
      S = S + 'tory"}buildColumnDefs(e,t,a){const n=[],o={};return e.forEach((e=>{let r=!0,i=this.createDefFromColumn(e,t,a),s=e.getOriginalParent(),l=null;for(;s;){let e=null;if(s.isPadding()){s=s.getOriginalParent();continue}const t=o[s.getGroupId()];if(t){t.children.push(i),r=!1;break}if(e=this.createDefFromGroup(s),e&&(e.children=[i],o[e.groupId]=e,i=e,s=s.getOriginalParent()),null!=s&&l===s){r=!1;break}l=s}r&&n.push(i)})),n}createDefFromGroup(e){const t=Q(e.getColGroupDef(),["children"]);return t&&(t.groupId=e.getGroupId()),t}createDefFromColumn(e,t,a){const n=Q(e.getColDef());return n.colId=e.getColId(),n.width=e.getActualWidth(),n.rowGroup=e.isRowGroupActive(),n.rowGroupIndex=e.isRowGroupActive()?t.indexOf(e):null,n.pivot=e.isPivotActive(),n.pivotIndex=e.isPivotActive()?a.indexOf(e):null,n.aggFunc=e.isValueActive()?e.getAggFunc():null,n.hide=!e.isVisible()||void 0,n.pinned=e.isPinned()?e.getPinned():null,n.sort=e.getSort()?e.getSort():null,n.sortIndex=null!=e.getSortIndex()?e.getSortIndex():null,n}},Cl=class extends A{constructor(){super(...arguments),this.beanName="columnEventDispatcher"}visibleCols(){this.eventService.dispatchEvent({type:"displayedColumnsChanged"})}gridColumns(){this.eventService.dispatchEvent({type:"gridColumnsChanged"})}headerHeight(e){const t={type:"columnHeaderHeightChanged",column:e,columns:[e],source:"autosizeColumnHeaderHeight"};this.eventService.dispatchEvent(t)}groupOpened(e){const t={type:"columnGroupOpened",columnGroup:1===e.length?e[0]:void 0,columnGroups:e};this.eventService.dispatchEvent(t)}rowGroupChanged(e,t){const a={type:"columnRowGroupChanged",columns:e,column:1===e.length?e[0]:null,source:t};this.eventService.dispatchEvent(a)}genericColumnEvent(e,t,a){const n={type:e,columns:t,column:1===t.length?t[0]:null,source:a};this.eventService.dispatchEvent(n)}pivotModeChanged(){this.eventService.dispatchEvent({type:"columnPivotModeChanged"})}virtualColumnsChanged(e){const t={type:"virtualColumnsChanged",afterScroll:e};this.eventService.dispatch';
      S = S + 'Event(t)}newColumnsLoaded(e){const t={type:"newColumnsLoaded",source:e};this.eventService.dispatchEvent(t)}everythingChanged(e){const t={type:"columnEverythingChanged",source:e};this.eventService.dispatchEvent(t)}columnMoved(e){const{movedColumns:t,source:a,toIndex:n,finished:o}=e,r={type:"columnMoved",columns:t,column:t&&1===t.length?t[0]:null,toIndex:n,finished:o,source:a};this.eventService.dispatchEvent(r)}columnPinned(e,t){if(!e.length)return;const a=1===e.length?e[0]:null,n=this.getCommonValue(e,(e=>e.getPinned())),o={type:"columnPinned",pinned:null!=n?n:null,columns:e,column:a,source:t};this.eventService.dispatchEvent(o)}columnVisible(e,t){if(!e.length)return;const a=1===e.length?e[0]:null,n={type:"columnVisible",visible:this.getCommonValue(e,(e=>e.isVisible())),columns:e,column:a,source:t};this.eventService.dispatchEvent(n)}getCommonValue(e,t){if(!e||0==e.length)return;const a=t(e[0]);for(let n=1;n<e.length;n++)if(a!==t(e[n]))return;return a}columnChanged(e,t,a){const n={type:e,columns:t,column:t&&1==t.length?t[0]:null,source:a};this.eventService.dispatchEvent(n)}columnResized(e,t,a,n=null){if(e&&e.length){const o={type:"columnResized",columns:e,column:1===e.length?e[0]:null,flexColumns:n,finished:t,source:a};this.eventService.dispatchEvent(o)}}},wl=class extends A{constructor(){super(...arguments),this.beanName="columnGetStateService"}wireBeans(e){this.columnModel=e.columnModel,this.funcColsService=e.funcColsService}getColumnState(){if(O(this.columnModel.getColDefCols())||!this.columnModel.isAlive())return[];const e=this.columnModel.getAllCols().map(this.createStateItemFromColumn.bind(this));return this.orderColumnStateList(e),e}createStateItemFromColumn(e){const t=this.funcColsService.getRowGroupColumns(),a=this.funcColsService.getPivotColumns(),n=e.isRowGroupActive()?t.indexOf(e):null,o=e.isPivotActive()?a.indexOf(e):null,r=e.isValueActive()?e.getAggFunc():null,i=null!=e.getSort()?e.getSort():null,s=null!=e.getSortIndex()?e.getSortIndex():null,l=null!=e.ge';
      S = S + 'tFlex()&&e.getFlex()>0?e.getFlex():null;return{colId:e.getColId(),width:e.getActualWidth(),hide:!e.isVisible(),pinned:e.getPinned(),sort:i,sortIndex:s,aggFunc:r,rowGroup:e.isRowGroupActive(),rowGroupIndex:n,pivot:e.isPivotActive(),pivotIndex:o,flex:l}}orderColumnStateList(e){const t=this.columnModel.getCols(),a=new Map(t.map(((e,t)=>[e.getColId(),t])));e.sort(((e,t)=>(a.has(e.colId)?a.get(e.colId):-1)-(a.has(t.colId)?a.get(t.colId):-1)))}},yl=class extends A{constructor(){super(...arguments),this.beanName="columnGroupStateService"}wireBeans(e){this.columnModel=e.columnModel,this.columnAnimationService=e.columnAnimationService,this.eventDispatcher=e.columnEventDispatcher,this.visibleColsService=e.visibleColsService}getColumnGroupState(){const e=[];return Me(null,this.columnModel.getColTree(),(t=>{ne(t)&&e.push({groupId:t.getGroupId(),open:t.isExpanded()})})),e}resetColumnGroupState(e){const t=this.columnModel.getColDefColTree();if(!t)return;const a=[];Me(null,t,(e=>{if(ne(e)){const t=e.getColGroupDef(),n={groupId:e.getGroupId(),open:t?t.openByDefault:void 0};a.push(n)}})),this.setColumnGroupState(a,e)}setColumnGroupState(e,t){if(!this.columnModel.getColTree())return;this.columnAnimationService.start();const a=[];e.forEach((e=>{const t=e.groupId,n=e.open,o=this.columnModel.getProvidedColGroup(t);o&&o.isExpanded()!==n&&(o.setExpanded(n),a.push(o))})),this.visibleColsService.refresh(t,!0),a.length&&this.eventDispatcher.groupOpened(a),this.columnAnimationService.finish()}},Sl=class extends A{constructor(){super(...arguments),this.beanName="columnViewportService",this.colsWithinViewport=[],this.headerColsWithinViewport=[],this.colsWithinViewportHash="",this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={}}wireBeans(e){this.visibleColsService=e.visibleColsService,this.columnModel=e.columnModel,this.eventDispatcher=e.columnEventDispatcher}postConstruct(){this.suppressColumnVirtualisation=this.gos.get("suppressColumnVirtuali';
      S = S + 'sation")}setScrollPosition(e,t,a=!1){const n=this.visibleColsService.isBodyWidthDirty();if(!(e===this.scrollWidth&&t===this.scrollPosition&&!n)){if(this.scrollWidth=e,this.scrollPosition=t,this.visibleColsService.setBodyWidthDirty(),this.gos.get("enableRtl")){const e=this.visibleColsService.getBodyContainerWidth();this.viewportLeft=e-this.scrollPosition-this.scrollWidth,this.viewportRight=e-this.scrollPosition}else this.viewportLeft=this.scrollPosition,this.viewportRight=this.scrollWidth+this.scrollPosition;this.columnModel.isReady()&&this.checkViewportColumns(a)}}getHeadersToRender(e,t){let a;switch(e){case"left":a=this.rowsOfHeadersToRenderLeft[t];break;case"right":a=this.rowsOfHeadersToRenderRight[t];break;default:a=this.rowsOfHeadersToRenderCenter[t]}return a||[]}extractViewportColumns(){const e=this.visibleColsService.getCenterCols();this.isColumnVirtualisationSuppressed()?(this.colsWithinViewport=e,this.headerColsWithinViewport=e):(this.colsWithinViewport=e.filter(this.isColumnInRowViewport.bind(this)),this.headerColsWithinViewport=e.filter(this.isColumnInHeaderViewport.bind(this)))}isColumnVirtualisationSuppressed(){return this.suppressColumnVirtualisation||0===this.viewportRight}clear(){this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={},this.colsWithinViewportHash=""}isColumnInHeaderViewport(e){return!!e.isAutoHeaderHeight()||this.isColumnInRowViewport(e)}isColumnInRowViewport(e){if(e.isAutoHeight())return!0;const t=e.getLeft()||0,a=t+e.getActualWidth(),n=this.viewportLeft-200,o=this.viewportRight+200;return!(t<n&&a<n)&&!(t>o&&a>o)}getViewportColumns(){const e=this.visibleColsService.getLeftCols(),t=this.visibleColsService.getRightCols();return this.colsWithinViewport.concat(e).concat(t)}getColsWithinViewport(e){if(!this.columnModel.isColSpanActive())return this.colsWithinViewport;const t=this.isColumnVirtualisationSuppressed()?null:this.isColumnInRowViewport.bind(this),a=this.visibleColsService.getColsCe';
      S = S + 'nter();return this.visibleColsService.getColsForRow(e,a,t,(e=>{const t=e.getLeft();return L(t)&&t>this.viewportLeft}))}checkViewportColumns(e=!1){this.extractViewport()&&this.eventDispatcher.virtualColumnsChanged(e)}calculateHeaderRows(){this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={};const e={},t=this.visibleColsService.getLeftCols(),a=this.visibleColsService.getRightCols();this.headerColsWithinViewport.concat(t).concat(a).forEach((t=>e[t.getId()]=!0));const n=(t,a,o)=>{let r=!1;for(let i=0;i<t.length;i++){const s=t[i];let l=!1;if(te(s))l=!0===e[s.getId()];else{const e=s.getDisplayedChildren();e&&(l=n(e,a,o+1))}l&&(r=!0,a[o]||(a[o]=[]),a[o].push(s))}return r};n(this.visibleColsService.getTreeLeft(),this.rowsOfHeadersToRenderLeft,0),n(this.visibleColsService.getTreeRight(),this.rowsOfHeadersToRenderRight,0),n(this.visibleColsService.getTreeCenter(),this.rowsOfHeadersToRenderCenter,0)}extractViewport(){this.extractViewportColumns();const e=this.getViewportColumns().map((e=>`${e.getId()}-${e.getPinned()||"normal"}`)).join("#"),t=this.colsWithinViewportHash!==e;return t&&(this.colsWithinViewportHash=e,this.calculateHeaderRows()),t}},kl=class extends A{constructor(){super(...arguments),this.beanName="agComponentUtils"}wireBeans(e){this.componentMetadataProvider=e.componentMetadataProvider}adaptFunction(e,t){const a=this.componentMetadataProvider.retrieve(e);return a&&a.functionAdapter?a.functionAdapter(t):null}adaptCellRendererFunction(e){return class{refresh(){return!1}getGui(){return this.eGui}init(t){const a=e(t),n=typeof a;this.eGui="string"!==n&&"number"!==n&&"boolean"!==n?null!=a?a:Sa("<span></span>"):Sa("<span>"+a+"</span>")}}}doesImplementIComponent(e){return!!e&&(e.prototype&&"getGui"in e.prototype)}},xl=class extends A{constructor(){super(...arguments),this.beanName="componentMetadataProvider"}wireBeans(e){this.agComponentUtils=e.agComponentUtils}postConstruct(){this.componentMetaData={dateComponent:{man';
      S = S + 'datoryMethodList:["getDate","setDate"],optionalMethodList:["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled","onParamsUpdated","refresh"]},detailCellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},headerComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},headerGroupComponent:{mandatoryMethodList:[],optionalMethodList:[]},loadingCellRenderer:{mandatoryMethodList:[],optionalMethodList:[],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},loadingOverlayComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},noRowsOverlayComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},floatingFilterComponent:{mandatoryMethodList:["onParentModelChanged"],optionalMethodList:["afterGuiAttached","onParamsUpdated","refresh"]},cellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},cellEditor:{mandatoryMethodList:["getValue"],optionalMethodList:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached","refresh"]},innerRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},fullWidthCellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},groupRowRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},filter:{mandatoryMethodList:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethodList:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModel';
      S = S + 'AsString","onFloatingFilterChanged","onAnyFilterChanged","refresh"]},statusPanel:{mandatoryMethodList:[],optionalMethodList:["refresh"]},toolPanel:{mandatoryMethodList:[],optionalMethodList:["refresh","getState"]},tooltipComponent:{mandatoryMethodList:[],optionalMethodList:[]},menuItem:{mandatoryMethodList:[],optionalMethodList:["setActive","select","setExpanded","configureDefaults"]}}}retrieve(e){return this.componentMetaData[e]}},Rl=Object.fromEntries(["rowPositionUtils","cellPositionUtils","headerPositionUtils","paginationAutoPageSizeService","apiFunctionService","gridApi","userComponentRegistry","agComponentUtils","componentMetadataProvider","resizeObserverService","userComponentFactory","rowContainerHeightService","horizontalResizeService","localeService","validationService","pinnedRowModel","dragService","visibleColsService","eventService","gos","popupService","selectionService","columnFilterService","quickFilterService","filterManager","columnModel","headerNavigationService","pageBoundsService","paginationService","pageBoundsListener","rowRenderer","expressionService","columnFactory","alignedGridsService","navigationService","valueCache","valueService","loggerFactory","autoWidthCalculator","filterMenuFactory","dragAndDropService","focusService","mouseEventService","environment","cellNavigationService","stylingService","scrollVisibleService","sortController","columnHoverService","columnAnimationService","selectableService","autoColService","changeDetectionService","animationFrameService","undoRedoService","columnDefFactory","rowCssClassCalculator","rowNodeBlockLoader","rowNodeSorter","ctrlsService","pinnedWidthService","rowNodeEventThrottle","ctrlsFactory","dataTypeService","syncService","overlayService","stateService","expansionService","apiEventService","ariaAnnouncementService","menuService","columnApplyStateService","columnEventDispatcher","columnMoveService","columnAutosizeService","columnGetStateService","columnGroupStateService","columnSizeService","fun';
      S = S + 'cColsService","columnNameService","columnViewportService","pivotResultColsService","showRowGroupColsService"].map(((e,t)=>[e,t])));function zl(e,t){return((e.beanName?Rl[e.beanName]:void 0)??Number.MAX_SAFE_INTEGER)-((t.beanName?Rl[t.beanName]:void 0)??Number.MAX_SAFE_INTEGER)}function Fl(e,t){return"gridDestroyService"===e?.beanName?-1:0}var Ml=class extends A{constructor(){super(...arguments),this.beanName="ctrlsFactory",this.registry={}}register(e){this.registry[e.name]=e.classImp}getInstance(e,...t){const a=this.registry[e];if(null!=a)return new a(...t)}},Dl=class extends A{constructor(){super(...arguments),this.beanName="ctrlsService",this.params={},this.ready=!1,this.readyCallbacks=[]}checkReady(){const e=this.params;this.ready=null!=e.gridCtrl&&null!=e.gridBodyCtrl&&null!=e.center&&null!=e.left&&null!=e.right&&null!=e.bottomCenter&&null!=e.bottomLeft&&null!=e.bottomRight&&null!=e.topCenter&&null!=e.topLeft&&null!=e.topRight&&null!=e.stickyTopCenter&&null!=e.stickyTopLeft&&null!=e.stickyTopRight&&null!=e.stickyBottomCenter&&null!=e.stickyBottomLeft&&null!=e.stickyBottomRight&&null!=e.centerHeader&&null!=e.leftHeader&&null!=e.rightHeader&&null!=e.fakeHScrollComp&&null!=e.fakeVScrollComp&&null!=e.gridHeaderCtrl,this.ready&&(this.readyCallbacks.forEach((t=>t(e))),this.readyCallbacks.length=0)}whenReady(e){this.ready?e(this.params):this.readyCallbacks.push(e)}register(e,t){this.params[e]=t,this.checkReady()}registerHeaderContainer(e,t){const a=this.params;switch(t){case"left":a.leftHeader=e;break;case"right":a.rightHeader=e;break;default:a.centerHeader=e}this.checkReady()}get(e){return this.params[e]}getParams(){return this.params}getGridBodyCtrl(){return this.params.gridBodyCtrl}getHeaderRowContainerCtrls(){const{leftHeader:e,centerHeader:t,rightHeader:a}=this.params;return[e,a,t]}getHeaderRowContainerCtrl(e){const t=this.params;switch(e){case"left":return t.leftHeader;case"right":return t.rightHeader;default:return t.centerHeader}}},El=class extends A{constructo';
      S = S + 'r(){super(...arguments),this.beanName="cellPositionUtils"}createId(e){const{rowIndex:t,rowPinned:a,column:n}=e;return this.createIdFromValues({rowIndex:t,column:n,rowPinned:a})}createIdFromValues(e){const{rowIndex:t,rowPinned:a,column:n}=e;return`${t}.${null==a?"null":a}.${n.getId()}`}equals(e,t){const a=e.column===t.column,n=e.rowPinned===t.rowPinned,o=e.rowIndex===t.rowIndex;return a&&n&&o}},Pl=class extends A{constructor(){super(...arguments),this.beanName="rowNodeEventThrottle",this.events=[]}wireBeans(e){this.animationFrameService=e.animationFrameService,this.rowModel=e.rowModel}postConstruct(){"clientSide"==this.rowModel.getType()&&(this.clientSideRowModel=this.rowModel)}dispatchExpanded(e,t){if(null==this.clientSideRowModel)return void this.eventService.dispatchEvent(e);this.events.push(e);const a=()=>{this.clientSideRowModel&&this.clientSideRowModel.onRowGroupOpened(),this.events.forEach((e=>this.eventService.dispatchEvent(e))),this.events=[]};t?a():(null==this.dispatchExpandedDebounced&&(this.dispatchExpandedDebounced=this.animationFrameService.debounce(a)),this.dispatchExpandedDebounced())}},Al=class extends A{constructor(){super(...arguments),this.beanName="rowPositionUtils"}wireBeans(e){this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel,this.pageBoundsService=e.pageBoundsService}getFirstRow(){let e,t=0;return this.pinnedRowModel.getPinnedTopRowCount()?e="top":this.rowModel.getRowCount()?(e=null,t=this.pageBoundsService.getFirstRow()):this.pinnedRowModel.getPinnedBottomRowCount()&&(e="bottom"),void 0===e?null:{rowIndex:t,rowPinned:e}}getLastRow(){let e,t=null;const a=this.pinnedRowModel.getPinnedBottomRowCount(),n=this.pinnedRowModel.getPinnedTopRowCount();return a?(t="bottom",e=a-1):this.rowModel.getRowCount()?(t=null,e=this.pageBoundsService.getLastRow()):n&&(t="top",e=n-1),void 0===e?null:{rowIndex:e,rowPinned:t}}getRowNode(e){switch(e.rowPinned){case"top":return this.pinnedRowModel.getPinnedTopRowNodes()[e.rowIndex];case"bottom":return this';
      S = S + '.pinnedRowModel.getPinnedBottomRowNodes()[e.rowIndex];default:return this.rowModel.getRow(e.rowIndex)}}sameRow(e,t){return!e&&!t||!(e&&!t||!e&&t)&&(e.rowIndex===t.rowIndex&&e.rowPinned==t.rowPinned)}before(e,t){switch(e.rowPinned){case"top":if("top"!==t.rowPinned)return!0;break;case"bottom":if("bottom"!==t.rowPinned)return!1;break;default:if(L(t.rowPinned))return"top"!==t.rowPinned}return e.rowIndex<t.rowIndex}},Tl={cssName:"--ag-row-height",changeKey:"rowHeightChanged",defaultValue:42},Il={cssName:"--ag-header-height",changeKey:"headerHeightChanged",defaultValue:48},Ll={cssName:"--ag-list-item-height",changeKey:"listItemHeightChanged",defaultValue:24},Ol=class extends A{constructor(){super(...arguments),this.beanName="environment",this.sizeEls=new Map,this.lastKnownValues=new Map,this.themeClasses=[],this.eThemeAncestor=null,this.eMeasurementContainer=null,this.sizesMeasured=!1}wireBeans(e){this.resizeObserverService=e.resizeObserverService,this.eGridDiv=e.eGridDiv}postConstruct(){this.addManagedPropertyListener("rowHeight",(()=>this.refreshRowHeightVariable())),this.themeClasses=this.getAncestorThemeClasses(),this.setUpThemeClassObservers(),this.getSizeEl(Tl),this.getSizeEl(Il),this.getSizeEl(Ll)}getDefaultRowHeight(){return this.getCSSVariablePixelValue(Tl)}getDefaultHeaderHeight(){return this.getCSSVariablePixelValue(Il)}getDefaultListItemHeight(){return this.getCSSVariablePixelValue(Ll)}hasMeasuredSizes(){return this.sizesMeasured}getThemeClasses(){return this.themeClasses}applyThemeClasses(e){for(const t of Array.from(e.classList))t.startsWith("ag-theme-")&&!this.themeClasses.includes(t)&&e.classList.remove(t);for(const t of this.themeClasses)e.classList.contains(t)||e.classList.add(t)}getThemeAncestorElement(){return this.eThemeAncestor}refreshRowHeightVariable(){const e=this.eGridDiv.style.getPropertyValue("--ag-line-height").trim(),t=this.gos.get("rowHeight");if(null==t||isNaN(t)||!isFinite(t))return null!==e&&this.eGridDiv.style.setProperty("--ag-line-heig';
      S = S + 'ht",null),-1;const a=`${t}px`;return e!=a?(this.eGridDiv.style.setProperty("--ag-line-height",a),t):""!=e?parseFloat(e):-1}getCSSVariablePixelValue(e){const t=this.lastKnownValues.get(e);if(null!=t)return t;const a=this.measureSizeEl(e);return"detached"===a||"no-styles"===a?e.defaultValue:(this.lastKnownValues.set(e,a),a)}measureSizeEl(e){const t=this.getSizeEl(e);if(null==t.offsetParent)return"detached";const a=t.offsetWidth;return a===Gl?"no-styles":(this.sizesMeasured=!0,a)}getSizeEl(e){let t=this.sizeEls.get(e);if(t)return t;let a=this.eMeasurementContainer;a||(a=this.eMeasurementContainer=document.createElement("div"),a.className="ag-measurement-container",this.eGridDiv.appendChild(a)),t=document.createElement("div"),t.style.width=`var(${e.cssName}, ${Gl}px)`,a.appendChild(t),this.sizeEls.set(e,t);let n=this.measureSizeEl(e);"no-styles"===n&&ce(`no value for ${e.cssName}. This usually means that the grid has been initialised before styles have been loaded. The default value of ${e.defaultValue} will be used and updated when styles load.`);const o=this.resizeObserverService.observeResize(t,(()=>{const t=this.measureSizeEl(e);"detached"!==t&&"no-styles"!==t&&(this.lastKnownValues.set(e,t),t!==n&&(n=t,this.fireGridStylesChangedEvent(e.changeKey)))}));return this.addDestroyFunc((()=>o())),t}fireGridStylesChangedEvent(e){const t={type:"gridStylesChanged",[e]:!0};this.eventService.dispatchEvent(t)}setUpThemeClassObservers(){const e=new MutationObserver((()=>{const e=this.getAncestorThemeClasses();Nl(e,this.themeClasses)||(this.themeClasses=e,this.fireGridStylesChangedEvent("themeChanged"))}));let t=this.eGridDiv;for(;t;)e.observe(t||this.eGridDiv,{attributes:!0,attributeFilter:["class"]}),t=t.parentElement}getAncestorThemeClasses(){let e=this.eGridDiv;const t=[];for(this.eThemeAncestor=null;e;){const a=Array.from(e.classList).filter((e=>e.startsWith("ag-theme-")));for(const n of a)this.eThemeAncestor=e,t.includes(n)||t.unshift(n);e=e.parentElement}return Object.freez';
      S = S + 'e(t)}},Nl=(e,t)=>e.length===t.length&&-1===e.findIndex(((a,n)=>e[n]!==t[n])),Gl=15538,ql=class extends A{constructor(){super(...arguments),this.beanName="eventService",this.globalEventService=new c}wireBeans(e){this.globalEventListener=e.globalEventListener,this.globalSyncEventListener=e.globalSyncEventListener}postConstruct(){if(this.globalEventListener){const e=this.gos.useAsyncEvents();this.addGlobalListener(this.globalEventListener,e)}this.globalSyncEventListener&&this.addGlobalListener(this.globalSyncEventListener,!1)}addEventListener(e,t,a){this.globalEventService.addEventListener(e,t,a)}removeEventListener(e,t,a){this.globalEventService.removeEventListener(e,t,a)}addGlobalListener(e,t=!1){this.globalEventService.addGlobalListener(e,t)}removeGlobalListener(e,t=!1){this.globalEventService.removeGlobalListener(e,t)}dispatchLocalEvent(){}dispatchEvent(e){this.globalEventService.dispatchEvent(this.gos.addGridCommonParams(e))}dispatchEventOnce(e){this.globalEventService.dispatchEventOnce(this.gos.addGridCommonParams(e))}},Bl=class e extends A{constructor(){super(...arguments),this.beanName="focusService"}wireBeans(e){this.eGridDiv=e.eGridDiv,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.headerNavigationService=e.headerNavigationService,this.headerPositionUtils=e.headerPositionUtils,this.rowRenderer=e.rowRenderer,this.rowPositionUtils=e.rowPositionUtils,this.cellPositionUtils=e.cellPositionUtils,this.navigationService=e.navigationService,this.ctrlsService=e.ctrlsService,this.filterManager=e.filterManager,this.rangeService=e.rangeService,this.advancedFilterService=e.advancedFilterService}static addKeyboardModeEvents(t){this.instanceCount>0||(t.addEventListener("keydown",e.toggleKeyboardMode),t.addEventListener("mousedown",e.toggleKeyboardMode))}static removeKeyboardModeEvents(t){this.instanceCount>0||(t.addEventListener("keydown",e.toggleKeyboardMode),t.addEventListener("mousedown",e.toggleKeyboardMode))}static toggleKeyboardMode(t)';
      S = S + '{const a=e.keyboardModeActive,n="keydown"===t.type;n&&(t.ctrlKey||t.metaKey||t.altKey)||a!==n&&(e.keyboardModeActive=n)}static unregisterGridCompController(t){e.removeKeyboardModeEvents(t)}postConstruct(){const e=this.clearFocusedCell.bind(this);this.addManagedEventListeners({columnPivotModeChanged:e,newColumnsLoaded:this.onColumnEverythingChanged.bind(this),columnGroupOpened:e,columnRowGroupChanged:e}),this.registerKeyboardFocusEvents(),this.ctrlsService.whenReady((e=>{this.gridCtrl=e.gridCtrl}))}registerKeyboardFocusEvents(){const t=this.gos.getDocument();e.addKeyboardModeEvents(t),e.instanceCount++,this.addDestroyFunc((()=>{e.instanceCount--,e.unregisterGridCompController(t)}))}onColumnEverythingChanged(){if(!this.focusedCellPosition)return;const e=this.focusedCellPosition.column,t=this.columnModel.getCol(e.getId());e!==t&&this.clearFocusedCell()}isKeyboardMode(){return e.keyboardModeActive}getFocusCellToUseAfterRefresh(){return this.gos.get("suppressFocusAfterRefresh")||!this.focusedCellPosition||this.isDomDataMissingInHierarchy(this.gos.getActiveDomElement(),Ii.DOM_DATA_KEY_ROW_CTRL)?null:this.focusedCellPosition}getFocusHeaderToUseAfterRefresh(){return this.gos.get("suppressFocusAfterRefresh")||!this.focusedHeaderPosition||this.isDomDataMissingInHierarchy(this.gos.getActiveDomElement(),sr.DOM_DATA_KEY_HEADER_CTRL)?null:this.focusedHeaderPosition}isDomDataMissingInHierarchy(e,t){let a=e;for(;a;){if(this.gos.getDomData(a,t))return!1;a=a.parentNode}return!0}getFocusedCell(){return this.focusedCellPosition}shouldRestoreFocus(e){return!!this.isCellRestoreFocused(e)&&(setTimeout((()=>{this.restoredFocusedCellPosition=null}),0),!0)}isCellRestoreFocused(e){return null!=this.restoredFocusedCellPosition&&this.cellPositionUtils.equals(e,this.restoredFocusedCellPosition)}setRestoreFocusedCell(e){"react"===this.getFrameworkOverrides().renderingEngine&&(this.restoredFocusedCellPosition=e)}getFocusEventParams(){const{rowIndex:e,rowPinned:t,column:a}=this.focusedCellPosition,';
      S = S + 'n={rowIndex:e,rowPinned:t,column:a,isFullWidthCell:!1},o=this.rowRenderer.getRowByPosition({rowIndex:e,rowPinned:t});return o&&(n.isFullWidthCell=o.isFullWidth()),n}clearFocusedCell(){if(this.restoredFocusedCellPosition=null,null==this.focusedCellPosition)return;const e={type:"cellFocusCleared",...this.getFocusEventParams()};this.focusedCellPosition=null,this.eventService.dispatchEvent(e)}setFocusedCell(e){const{column:t,rowIndex:a,rowPinned:n,forceBrowserFocus:o=!1,preventScrollOnBrowserFocus:r=!1}=e,i=this.columnModel.getCol(t);if(!i)return void(this.focusedCellPosition=null);this.focusedCellPosition=i?{rowIndex:a,rowPinned:I(n),column:i}:null;const s={type:"cellFocused",...this.getFocusEventParams(),forceBrowserFocus:o,preventScrollOnBrowserFocus:r};this.eventService.dispatchEvent(s)}isCellFocused(e){return null!=this.focusedCellPosition&&this.cellPositionUtils.equals(e,this.focusedCellPosition)}isRowNodeFocused(e){return this.isRowFocused(e.rowIndex,e.rowPinned)}isHeaderWrapperFocused(e){if(null==this.focusedHeaderPosition)return!1;const t=e.getColumnGroupChild(),a=e.getRowIndex(),n=e.getPinned(),{column:o,headerRowIndex:r}=this.focusedHeaderPosition;return t===o&&a===r&&n==o.getPinned()}clearFocusedHeader(){this.focusedHeaderPosition=null}getFocusedHeader(){return this.focusedHeaderPosition}setFocusedHeader(e,t){this.focusedHeaderPosition={headerRowIndex:e,column:t}}focusHeaderPosition(e){if(this.gos.get("suppressHeaderFocus"))return!1;const{direction:t,fromTab:a,allowUserOverride:n,event:o,fromCell:r,rowWithoutSpanValue:i}=e;let{headerPosition:s}=e;if(r&&this.filterManager?.isAdvancedFilterHeaderActive())return this.focusAdvancedFilter(s);if(n){const e=this.getFocusedHeader(),n=this.headerNavigationService.getHeaderRowCount();if(a){const a=this.gos.getCallback("tabToNextHeader");a&&(s=this.getHeaderPositionFromUserFunc({userFunc:a,direction:t,currentPosition:e,headerPosition:s,headerRowCount:n}))}else{const t=this.gos.getCallback("navigateToNextHeader");if(t&&';
      S = S + 'o){s=t({key:o.key,previousHeaderPosition:e,nextHeaderPosition:s,headerRowCount:n,event:o})}}}return!!s&&this.focusProvidedHeaderPosition({headerPosition:s,direction:t,event:o,fromCell:r,rowWithoutSpanValue:i})}focusHeaderPositionFromUserFunc(e){if(this.gos.get("suppressHeaderFocus"))return!1;const{userFunc:t,headerPosition:a,direction:n,event:o}=e,r=this.getFocusedHeader(),i=this.headerNavigationService.getHeaderRowCount(),s=this.getHeaderPositionFromUserFunc({userFunc:t,direction:n,currentPosition:r,headerPosition:a,headerRowCount:i});return!!s&&this.focusProvidedHeaderPosition({headerPosition:s,direction:n,event:o})}getHeaderPositionFromUserFunc(e){const{userFunc:t,direction:a,currentPosition:n,headerPosition:o,headerRowCount:r}=e,i=t({backwards:"Before"===a,previousHeaderPosition:n,nextHeaderPosition:o,headerRowCount:r});return!0===i||null===i?(null===i&&ce("Since v31.3 Returning `null` from tabToNextHeader is deprecated. Return `true` to stay on the current header, or `false` to let the browser handle the tab behaviour."),n):!1===i?null:i}focusProvidedHeaderPosition(e){const{headerPosition:t,direction:a,fromCell:n,rowWithoutSpanValue:o,event:r}=e,{column:i,headerRowIndex:s}=t;if(-1===s)return this.filterManager?.isAdvancedFilterHeaderActive()?this.focusAdvancedFilter(t):this.focusGridView(i);this.headerNavigationService.scrollToColumn(i,a);const l=this.ctrlsService.getHeaderRowContainerCtrl(i.getPinned()).focusHeader(t.headerRowIndex,i,r);return l&&(null!=o||n)&&this.headerNavigationService.setCurrentHeaderRowWithoutSpan(o??-1),l}focusFirstHeader(){let e=this.visibleColsService.getAllCols()[0];if(!e)return!1;e.getParent()&&(e=this.visibleColsService.getColGroupAtLevel(e,0));const t=this.headerPositionUtils.getHeaderIndexToFocus(e,0);return this.focusHeaderPosition({headerPosition:t,rowWithoutSpanValue:0})}focusLastHeader(e){const t=this.headerNavigationService.getHeaderRowCount()-1,a=d(this.visibleColsService.getAllCols());return this.focusHeaderPosition({header';
      S = S + 'Position:{headerRowIndex:t,column:a},rowWithoutSpanValue:-1,event:e})}focusPreviousFromFirstCell(e){return this.filterManager?.isAdvancedFilterHeaderActive()?this.focusAdvancedFilter(null):this.focusLastHeader(e)}isAnyCellFocused(){return!!this.focusedCellPosition}isRowFocused(e,t){return null!=this.focusedCellPosition&&(this.focusedCellPosition.rowIndex===e&&this.focusedCellPosition.rowPinned===I(t))}findFocusableElements(e,t,a=!1){let n=na;t&&(n+=", "+t),a&&(n+=\', [tabindex="-1"]\');const o=Array.prototype.slice.apply(e.querySelectorAll("[tabindex], input, select, button, textarea, [href]")).filter((e=>ya(e))),r=Array.prototype.slice.apply(e.querySelectorAll(n));if(!r.length)return o;return i=r,o.filter((e=>-1===i.indexOf(e)));var i}focusInto(e,t=!1,a=!1){const n=this.findFocusableElements(e,null,a),o=t?d(n):n[0];return!!o&&(o.focus({preventScroll:!0}),!0)}findFocusableElementBeforeTabGuard(e,t){if(!t)return null;const a=this.findFocusableElements(e),n=a.indexOf(t);if(-1===n)return null;let o=-1;for(let e=n-1;e>=0;e--)if(a[e].classList.contains("ag-tab-guard-top")){o=e;break}return o<=0?null:a[o-1]}findNextFocusableElement(e=this.eGridDiv,t,a){const n=this.findFocusableElements(e,t?\':not([tabindex="-1"])\':null),o=this.gos.getActiveDomElement();let r;r=t?n.findIndex((e=>e.contains(o))):n.indexOf(o);const i=r+(a?-1:1);return i<0||i>=n.length?null:n[i]}isTargetUnderManagedComponent(e,t){if(!t)return!1;const a=e.querySelectorAll(`.${ho.FOCUS_MANAGED_CLASS}`);if(!a.length)return!1;for(let e=0;e<a.length;e++)if(a[e].contains(t))return!0;return!1}findTabbableParent(e,t=5){let a=0;for(;e&&null===$t(e)&&++a<=t;)e=e.parentElement;return null===$t(e)?null:e}focusGridView(e,t){if(this.gos.get("suppressCellFocus"))return t?this.gos.get("suppressHeaderFocus")?this.focusNextGridCoreContainer(!0,!0):this.focusLastHeader():this.focusNextGridCoreContainer(!1);const a=t?this.rowPositionUtils.getLastRow():this.rowPositionUtils.getFirstRow();if(!a)return!1;const{rowIndex:n,rowPinned:o}';
      S = S + '=a,r=this.getFocusedHeader();return!e&&r&&(e=r.column),!(null==n||!e)&&(this.navigationService.ensureCellVisible({rowIndex:n,column:e,rowPinned:o}),this.setFocusedCell({rowIndex:n,column:e,rowPinned:I(o),forceBrowserFocus:!0}),this.rangeService?.setRangeToCell({rowIndex:n,rowPinned:o,column:e}),!0)}focusNextGridCoreContainer(e,t=!1){return!(t||!this.gridCtrl.focusNextInnerContainer(e))||((t||!e&&!this.gridCtrl.isDetailGrid())&&this.gridCtrl.forceFocusOutOfContainer(e),!1)}focusAdvancedFilter(e){return this.advancedFilterFocusColumn=e?.column,this.advancedFilterService?.getCtrl().focusHeaderComp()??!1}focusNextFromAdvancedFilter(e,t){const a=(t?void 0:this.advancedFilterFocusColumn)??this.visibleColsService.getAllCols()?.[0];return e?this.focusHeaderPosition({headerPosition:{column:a,headerRowIndex:this.headerNavigationService.getHeaderRowCount()-1}}):this.focusGridView(a)}clearAdvancedFilterColumn(){this.advancedFilterFocusColumn=void 0}addFocusableContainer(e){this.gridCtrl.addFocusableContainer(e)}removeFocusableContainer(e){this.gridCtrl.removeFocusableContainer(e)}focusGridInnerElement(e){return this.gridCtrl.focusInnerElement(e)}};Bl.keyboardModeActive=!1,Bl.instanceCount=0;var Hl=Bl,Vl=class extends A{constructor(){super(...arguments),this.beanName="pinnedWidthService"}wireBeans(e){this.visibleColsService=e.visibleColsService}postConstruct(){const e=this.checkContainerWidths.bind(this);this.addManagedEventListeners({displayedColumnsChanged:e,displayedColumnsWidthChanged:e}),this.addManagedPropertyListener("domLayout",e)}checkContainerWidths(){const e=this.gos.isDomLayout("print"),t=e?0:this.visibleColsService.getColsLeftWidth(),a=e?0:this.visibleColsService.getDisplayedColumnsRightWidth();t!=this.leftWidth&&(this.leftWidth=t,this.eventService.dispatchEvent({type:"leftPinnedWidthChanged"})),a!=this.rightWidth&&(this.rightWidth=a,this.eventService.dispatchEvent({type:"rightPinnedWidthChanged"}))}getPinnedRightWidth(){return this.rightWidth}getPinnedLeftWidth(){r';
      S = S + 'eturn this.leftWidth}},Wl=class extends A{constructor(){super(...arguments),this.additionalFocusableContainers=new Set}wireBeans(e){this.beans=e,this.focusService=e.focusService,this.visibleColsService=e.visibleColsService}setComp(e,t,a){this.view=e,this.eGridHostDiv=t,this.eGui=a,this.eGui.setAttribute("grid-id",this.gridId);const{dragAndDropService:n,mouseEventService:o,ctrlsService:r,resizeObserverService:i}=this.beans;n.addDropTarget({getContainer:()=>this.eGui,isInterestedIn:e=>1===e||0===e,getIconName:()=>"notAllowed"}),o.stampTopLevelGridCompWithGridInstance(t),this.createManagedBean(new ni(this.view)),this.addRtlSupport();const s=i.observeResize(this.eGridHostDiv,this.onGridSizeChanged.bind(this));this.addDestroyFunc((()=>s())),r.register("gridCtrl",this)}isDetailGrid(){const e=this.focusService.findTabbableParent(this.getGui());return e?.getAttribute("row-id")?.startsWith("detail")||!1}getOptionalSelectors(){const e=this.beans;return{paginationSelector:e.paginationService?.getPaginationSelector(),gridHeaderDropZonesSelector:e.columnDropZonesService?.getDropZoneSelector(),sideBarSelector:e.sideBarService?.getSideBarSelector(),statusBarSelector:e.statusBarService?.getStatusPanelSelector(),watermarkSelector:e.licenseManager?.getWatermarkSelector()}}onGridSizeChanged(){const e={type:"gridSizeChanged",clientWidth:this.eGridHostDiv.clientWidth,clientHeight:this.eGridHostDiv.clientHeight};this.eventService.dispatchEvent(e)}addRtlSupport(){const e=this.gos.get("enableRtl")?"ag-rtl":"ag-ltr";this.view.setRtlClass(e)}destroyGridUi(){this.view.destroyGridUi()}getGui(){return this.eGui}setResizeCursor(e){this.view.setCursor(e?"ew-resize":null)}disableUserSelect(e){this.view.setUserSelect(e?"none":null)}focusNextInnerContainer(e){const t=this.getFocusableContainers(),a=this.gos.getActiveDomElement(),n=t.findIndex((e=>e.getGui().contains(a))),o=n+(e?-1:1);if(o<0||o>=t.length)return!1;if(0===o){if(n>0){const e=d(this.visibleColsService.getAllCols());if(this.focusService.f';
      S = S + 'ocusGridView(e,!0))return!0}return!1}return this.focusContainer(t[o],e)}focusInnerElement(e){const t=this.getFocusableContainers(),a=this.visibleColsService.getAllCols(),n=this.gos.getCallback("focusGridInnerElement");if(n&&n({fromBottom:!!e}))return!0;if(e){if(t.length>1)return this.focusContainer(d(t),!0);const e=d(a);if(this.focusService.focusGridView(e,!0))return!0}if(0===this.gos.get("headerHeight")||this.gos.get("suppressHeaderFocus")){if(this.focusService.focusGridView(a[0]))return!0;for(let e=1;e<t.length;e++)if(this.focusService.focusInto(t[e].getGui()))return!0;return!1}return this.focusService.focusFirstHeader()}forceFocusOutOfContainer(e=!1){this.view.forceFocusOutOfContainer(e)}addFocusableContainer(e){this.additionalFocusableContainers.add(e)}removeFocusableContainer(e){this.additionalFocusableContainers.delete(e)}focusContainer(e,t){e?.setAllowFocus?.(!0);const a=this.focusService.focusInto(e.getGui(),t);return e?.setAllowFocus?.(!1),a}getFocusableContainers(){return[...this.view.getFocusableContainers(),...this.additionalFocusableContainers.values()]}destroy(){this.additionalFocusableContainers.clear(),super.destroy()}},Ul=class extends ll{constructor(e){super(),this.gridBody=qa,this.sideBar=qa,this.pagination=qa,this.rootWrapperBody=qa,this.eGridDiv=e}postConstruct(){const e={destroyGridUi:()=>this.destroyBean(this),setRtlClass:e=>this.addCssClass(e),forceFocusOutOfContainer:this.forceFocusOutOfContainer.bind(this),updateLayoutClasses:this.updateLayoutClasses.bind(this),getFocusableContainers:this.getFocusableContainers.bind(this),setUserSelect:e=>{this.getGui().style.userSelect=null!=e?e:"",this.getGui().style.webkitUserSelect=null!=e?e:""},setCursor:e=>{this.getGui().style.cursor=null!=e?e:""}},t=this.createManagedBean(new Wl),a=t.getOptionalSelectors(),n=this.createTemplate(a),o=[rs,...Object.values(a).filter((e=>!!e))];this.setTemplate(n,o),t.setComp(e,this.eGridDiv,this.getGui()),this.insertGridIntoDom(),this.initialiseTabGuard({onTabKeyDown:()';
      S = S + '=>{},focusInnerElement:e=>t.focusInnerElement(e),forceFocusOutWhenTabGuardsAreEmpty:!0})}insertGridIntoDom(){const e=this.getGui();this.eGridDiv.appendChild(e),this.addDestroyFunc((()=>{this.eGridDiv.removeChild(e),this.gos.get("debug")&&le("Grid removed from DOM")}))}updateLayoutClasses(e,t){const a=this.rootWrapperBody.classList;a.toggle("ag-layout-auto-height",t.autoHeight),a.toggle("ag-layout-normal",t.normal),a.toggle("ag-layout-print",t.print),this.addOrRemoveCssClass("ag-layout-auto-height",t.autoHeight),this.addOrRemoveCssClass("ag-layout-normal",t.normal),this.addOrRemoveCssClass("ag-layout-print",t.print)}createTemplate(e){const t=e.gridHeaderDropZonesSelector?"<ag-grid-header-drop-zones></ag-grid-header-drop-zones>":"",a=e.sideBarSelector?\'<ag-side-bar data-ref="sideBar"></ag-side-bar>\':"",n=e.statusBarSelector?"<ag-status-bar></ag-status-bar>":"",o=e.watermarkSelector?"<ag-watermark></ag-watermark>":"";return`<div class="ag-root-wrapper" role="presentation">\\n                ${t}\\n                <div class="ag-root-wrapper-body" data-ref="rootWrapperBody" role="presentation">\\n                    <ag-grid-body data-ref="gridBody"></ag-grid-body>\\n                    ${a}\\n                </div>\\n                ${n}\\n                ${e.paginationSelector?\'<ag-pagination data-ref="pagination"></ag-pagination>\':""}\\n                ${o}\\n            </div>`}getFocusableElement(){return this.rootWrapperBody}forceFocusOutOfContainer(e=!1){e||!this.pagination?.isDisplayed()?super.forceFocusOutOfContainer(e):this.pagination.forceFocusOutOfContainer(e)}getFocusableContainers(){const e=[this.gridBody];return[this.sideBar,this.pagination].forEach((t=>{t&&e.push(t)})),e.filter((e=>ya(e.getGui())))}},jl={version:gr,moduleName:"@ag-grid-community/aligned-grid",beans:[class extends A{constructor(){super(...arguments),this.beanName="alignedGridsService",this.consuming=!1}wireBeans(e){this.columnModel=e.columnModel,this.columnSizeService=e.columnSizeService,this.ctrl';
      S = S + 'sService=e.ctrlsService,this.columnApplyStateService=e.columnApplyStateService}getAlignedGridApis(){let e=this.gos.get("alignedGrids")??[];const t="function"==typeof e;"function"==typeof e&&(e=e());const a=()=>`See ${this.getFrameworkOverrides().getDocLink("aligned-grids")}`;return e.map((e=>{if(!e)return ge("alignedGrids contains an undefined option."),t||ge(\'You may want to configure via a callback to avoid setup race conditions:\\n                     "alignedGrids: () => [linkedGrid]"\'),void ge(a());if(this.isGridApi(e))return e;const n=e;return"current"in n?n.current?.api:(n.api||ge(`alignedGrids - No api found on the linked grid. If you are passing gridOptions to alignedGrids since v31 this is no longer valid. ${a()}`),n.api)})).filter((e=>!!e&&!e.isDestroyed()))}isGridApi(e){return!!e&&!!e.dispatchEvent}postConstruct(){const e=this.fireColumnEvent.bind(this);this.addManagedEventListeners({columnMoved:e,columnVisible:e,columnPinned:e,columnGroupOpened:e,columnResized:e,bodyScroll:this.fireScrollEvent.bind(this),alignedGridColumn:({event:e})=>this.onColumnEvent(e),alignedGridScroll:({event:e})=>this.onScrollEvent(e)})}fireEvent(e){this.consuming||this.getAlignedGridApis().forEach((t=>{t.isDestroyed()||t.dispatchEvent(e)}))}onEvent(e){this.consuming=!0,e(),this.consuming=!1}fireColumnEvent(e){const t={type:"alignedGridColumn",event:e};this.fireEvent(t)}fireScrollEvent(e){if("horizontal"!==e.direction)return;const t={type:"alignedGridScroll",event:e};this.fireEvent(t)}onScrollEvent(e){this.onEvent((()=>{this.ctrlsService.getGridBodyCtrl().getScrollFeature().setHorizontalScrollPosition(e.left,!0)}))}getMasterColumns(e){const t=[];return e.columns?e.columns.forEach((e=>{t.push(e)})):e.column&&t.push(e.column),t}getColumnIds(e){const t=[];return e.columns?e.columns.forEach((e=>{t.push(e.getColId())})):e.column&&t.push(e.column.getColId()),t}onColumnEvent(e){this.onEvent((()=>{switch(e.type){case"columnMoved":case"columnVisible":case"columnPinned":case"columnResized":';
      S = S + '{const t=e;this.processColumnEvent(t);break}case"columnGroupOpened":{const t=e;this.processGroupOpenedEvent(t);break}case"columnPivotChanged":ce("pivoting is not supported with aligned grids. You can only use one of these features at a time in a grid.")}}))}processGroupOpenedEvent(e){e.columnGroups.forEach((e=>{let t=null;if(e){const a=e.getGroupId();t=this.columnModel.getProvidedColGroup(a)}e&&!t||this.columnModel.setColumnGroupOpened(t,e.isExpanded(),"alignedGridChanged")}))}processColumnEvent(e){const t=e.column;let a=null;if(t&&(a=this.columnModel.getColDefCol(t.getColId())),t&&!a)return;const n=this.getMasterColumns(e);switch(e.type){case"columnMoved":{const t=e.api.getColumnState().map((e=>({colId:e.colId})));this.columnApplyStateService.applyColumnState({state:t,applyOrder:!0},"alignedGridChanged")}break;case"columnVisible":{const t=e.api.getColumnState().map((e=>({colId:e.colId,hide:e.hide})));this.columnApplyStateService.applyColumnState({state:t},"alignedGridChanged")}break;case"columnPinned":{const t=e.api.getColumnState().map((e=>({colId:e.colId,pinned:e.pinned})));this.columnApplyStateService.applyColumnState({state:t},"alignedGridChanged")}break;case"columnResized":{const t=e,a={};n.forEach((e=>{a[e.getId()]={key:e.getColId(),newWidth:e.getActualWidth()}})),t.flexColumns?.forEach((e=>{a[e.getId()]&&delete a[e.getId()]})),this.columnSizeService.setColumnWidths(Object.values(a),!1,t.finished,"alignedGridChanged");break}}const o=this.ctrlsService.getGridBodyCtrl().isVerticalScrollShowing();this.getAlignedGridApis().forEach((e=>{e.setGridOption("alwaysShowVerticalScroll",o)}))}}]};var Kl={january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},Ql=["january","february","march","april","may","june","july","august","september","october","november","december"],Yl=class extends A{constructor(){super(...arguments),this.bean';
      S = S + 'Name="dataTypeService",this.dataTypeDefinitions={},this.isWaitingForRowData=!1,this.isColumnTypeOverrideInDataTypeDefinitions=!1,this.columnStateUpdatesPendingInference={},this.columnStateUpdateListenerDestroyFuncs=[]}wireBeans(e){this.rowModel=e.rowModel,this.columnModel=e.columnModel,this.funcColsService=e.funcColsService,this.valueService=e.valueService,this.columnApplyStateService=e.columnApplyStateService}postConstruct(){this.groupHideOpenParents=this.gos.get("groupHideOpenParents"),this.addManagedPropertyListener("groupHideOpenParents",(()=>{this.groupHideOpenParents=this.gos.get("groupHideOpenParents")})),this.processDataTypeDefinitions(),this.addManagedPropertyListener("dataTypeDefinitions",(e=>{this.processDataTypeDefinitions(),this.columnModel.recreateColumnDefs(Ee(e.source))}))}processDataTypeDefinitions(){const e=this.getDefaultDataTypes();this.dataTypeDefinitions={},this.formatValueFuncs={};const t=e=>t=>{const{column:a,node:n,value:o}=t;let r=a.getColDef().valueFormatter;return r===e.groupSafeValueFormatter&&(r=e.valueFormatter),this.valueService.formatValue(a,n,o,r)};Object.entries(e).forEach((([e,a])=>{const n={...a,groupSafeValueFormatter:this.createGroupSafeValueFormatter(a)};this.dataTypeDefinitions[e]=n,this.formatValueFuncs[e]=t(n)}));const a=this.gos.get("dataTypeDefinitions")??{};this.dataTypeMatchers={},Object.entries(a).forEach((([n,o])=>{const r=this.processDataTypeDefinition(o,a,[n],e);r&&(this.dataTypeDefinitions[n]=r,o.dataTypeMatcher&&(this.dataTypeMatchers[n]=o.dataTypeMatcher),this.formatValueFuncs[n]=t(r))})),this.checkObjectValueHandlers(e),["dateString","text","number","boolean","date"].forEach((t=>{const a=this.dataTypeMatchers[t];a&&delete this.dataTypeMatchers[t],this.dataTypeMatchers[t]=a??e[t].dataTypeMatcher}))}mergeDataTypeDefinitions(e,t){const a={...e,...t};return e.columnTypes&&t.columnTypes&&t.appendColumnTypes&&(a.columnTypes=[...ze(e.columnTypes),...ze(t.columnTypes)]),a}processDataTypeDefinition(e,t,a,n){let o;const r';
      S = S + '=e.extendsDataType;if(e.columnTypes&&(this.isColumnTypeOverrideInDataTypeDefinitions=!0),e.extendsDataType===e.baseDataType){let a=n[r];const i=t[r];if(a&&i&&(a=i),!this.validateDataTypeDefinition(e,a,r))return;o=this.mergeDataTypeDefinitions(a,e)}else{if(a.includes(r))return void ce(\'Data type definition hierarchies (via the "extendsDataType" property) cannot contain circular references.\');const i=t[r];if(!this.validateDataTypeDefinition(e,i,r))return;const s=this.processDataTypeDefinition(i,t,[...a,r],n);if(!s)return;o=this.mergeDataTypeDefinitions(s,e)}return{...o,groupSafeValueFormatter:this.createGroupSafeValueFormatter(o)}}validateDataTypeDefinition(e,t,a){return t?t.baseDataType===e.baseDataType||(ce(\'The "baseDataType" property of a data type definition must match that of its parent.\'),!1):(ce(`The data type definition ${a} does not exist.`),!1)}createGroupSafeValueFormatter(e){if(e.valueFormatter)return t=>{if(t.node?.group){const a=t.column.getAggFunc();if(a){if("first"===a||"last"===a)return e.valueFormatter(t);if("number"===e.baseDataType&&"count"!==a){if("number"==typeof t.value)return e.valueFormatter(t);if("object"==typeof t.value){if(!t.value)return;if("toNumber"in t.value)return e.valueFormatter({...t,value:t.value.toNumber()});if("value"in t.value)return e.valueFormatter({...t,value:t.value.value})}}}if(!this.gos.get("suppressGroupMaintainValueType"))return}else if(this.groupHideOpenParents&&t.column.isRowGroupActive()){if("string"!=typeof t.value||e.dataTypeMatcher?.(t.value))return e.valueFormatter(t);if(!this.gos.get("suppressGroupMaintainValueType"))return}return e.valueFormatter(t)}}updateColDefAndGetColumnType(e,t,a){let{cellDataType:n}=t;const{field:o}=t;if(void 0===n&&(n=e.cellDataType),null!=n&&!0!==n||(n=!!this.canInferCellDataType(e,t)&&this.inferCellDataType(o,a)),!n)return void(e.cellDataType=!1);const r=this.dataTypeDefinitions[n];if(r)return e.cellDataType=n,r.groupSafeValueFormatter&&(e.valueFormatter=r.groupSafeValueFormatter),r.va';
      S = S + 'lueParser&&(e.valueParser=r.valueParser),r.suppressDefaultProperties||this.setColDefPropertiesForBaseDataType(e,n,r,a),r.columnTypes;ce(`Missing data type definition - "${n}"`)}addColumnListeners(e){if(!this.isWaitingForRowData)return;const t=this.columnStateUpdatesPendingInference[e.getColId()];if(!t)return;const a=e=>{t.add(e.key)};e.addEventListener("columnStateUpdated",a),this.columnStateUpdateListenerDestroyFuncs.push((()=>e.removeEventListener("columnStateUpdated",a)))}canInferCellDataType(e,t){if("clientSide"!==this.rowModel.getType())return!1;const a={cellRenderer:!0,valueGetter:!0,valueParser:!0,refData:!0};if(this.doColDefPropsPreventInference(t,a))return!1;const n=null===t.type?e.type:t.type;if(n){const e=this.gos.get("columnTypes")??{};if(ze(n).some((t=>{const n=e[t.trim()];return n&&this.doColDefPropsPreventInference(n,a)})))return!1}return!this.doColDefPropsPreventInference(e,a)}doColDefPropsPreventInference(e,t){return[["cellRenderer","agSparklineCellRenderer"],["valueGetter",void 0],["valueParser",void 0],["refData",void 0]].some((([a,n])=>this.doesColDefPropPreventInference(e,t,a,n)))}doesColDefPropPreventInference(e,t,a,n){if(!t[a])return!1;const o=e[a];return null===o?(t[a]=!1,!1):void 0===n?!!o:o===n}inferCellDataType(e,t){if(!e)return;let a;const n=this.getInitialData();if(n){const t=e.indexOf(".")>=0&&!this.gos.get("suppressFieldDotNotation");a=J(n,e,t)}else this.initWaitForRowData(t);if(null==a)return;const[o]=Object.entries(this.dataTypeMatchers).find((([e,t])=>t(a)))??["object"];return o}getInitialData(){const e=this.gos.get("rowData");if(e?.length)return e[0];if(this.initialData)return this.initialData;{const e=this.rowModel.getRootNode().allLeafChildren;if(e?.length)return e[0].data}return null}initWaitForRowData(e){if(this.columnStateUpdatesPendingInference[e]=new Set,this.isWaitingForRowData)return;this.isWaitingForRowData=!0;const t=this.isColumnTypeOverrideInDataTypeDefinitions;t&&this.columnModel.queueResizeOperations();const[a]=this.';
      S = S + 'addManagedEventListeners({rowDataUpdateStarted:e=>{const{firstRowData:n}=e;if(!n)return;a?.(),this.isWaitingForRowData=!1,this.processColumnsPendingInference(n,t),this.columnStateUpdatesPendingInference={},t&&this.columnModel.processResizeOperations();this.eventService.dispatchEvent({type:"dataTypesInferred"})}})}isPendingInference(){return this.isWaitingForRowData}processColumnsPendingInference(e,t){this.initialData=e;const a=[];this.destroyColumnStateUpdateListeners();const n={},o={};Object.entries(this.columnStateUpdatesPendingInference).forEach((([e,r])=>{const i=this.columnModel.getCol(e);if(!i)return;const s=i.getColDef();if(!this.columnModel.resetColDefIntoCol(i,"cellDataTypeInferred"))return;const l=i.getColDef();if(t&&l.type&&l.type!==s.type){const t=this.getUpdatedColumnState(i,r);t.rowGroup&&null==t.rowGroupIndex&&(n[e]=t),t.pivot&&null==t.pivotIndex&&(o[e]=t),a.push(t)}})),t&&a.push(...this.funcColsService.generateColumnStateForRowGroupAndPivotIndexes(n,o)),a.length&&this.columnApplyStateService.applyColumnState({state:a},"cellDataTypeInferred"),this.initialData=null}getUpdatedColumnState(e,t){const a=this.columnApplyStateService.getColumnStateFromColDef(e);return t.forEach((e=>{delete a[e],"rowGroup"===e?delete a.rowGroupIndex:"pivot"===e&&delete a.pivotIndex})),a}checkObjectValueHandlers(e){const t=this.dataTypeDefinitions.object,a=e.object;this.hasObjectValueParser=t.valueParser!==a.valueParser,this.hasObjectValueFormatter=t.valueFormatter!==a.valueFormatter}getDateStringTypeDefinition(e){return e?this.getDataTypeDefinition(e)??this.dataTypeDefinitions.dateString:this.dataTypeDefinitions.dateString}getDateParserFunction(e){return this.getDateStringTypeDefinition(e).dateParser}getDateFormatterFunction(e){return this.getDateStringTypeDefinition(e).dateFormatter}getDataTypeDefinition(e){const t=e.getColDef();if(t.cellDataType)return this.dataTypeDefinitions[t.cellDataType]}getBaseDataType(e){return this.getDataTypeDefinition(e)?.baseDataType}checkType(e,';
      S = S + 't){if(null==t)return!0;const a=this.getDataTypeDefinition(e)?.dataTypeMatcher;return!a||a(t)}validateColDef(e){"object"===e.cellDataType&&(e.valueFormatter!==this.dataTypeDefinitions.object.groupSafeValueFormatter||this.hasObjectValueFormatter||ce(\'Cell data type is "object" but no value formatter has been provided. Please either provide an object data type definition with a value formatter, or set "colDef.valueFormatter"\'),e.editable&&e.valueParser===this.dataTypeDefinitions.object.valueParser&&!this.hasObjectValueParser&&ce(\'Cell data type is "object" but no value parser has been provided. Please either provide an object data type definition with a value parser, or set "colDef.valueParser"\'))}getFormatValue(e){return this.formatValueFuncs[e]}setColDefPropertiesForBaseDataType(e,t,a,n){const o=this.formatValueFuncs[t],r=Xa.__isRegistered("@ag-grid-enterprise/set-filter",this.gridId),i=this.localeService.getLocaleTextFunc(),s=t=>{const{filterParams:a}=e;e.filterParams="object"==typeof a?{...a,...t}:t};switch(a.baseDataType){case"number":e.cellEditor="agNumberCellEditor",r&&s({comparator:(e,t)=>{const a=null==e?0:parseInt(e),n=null==t?0:parseInt(t);return a===n?0:a>n?1:-1}});break;case"boolean":e.cellEditor="agCheckboxCellEditor",e.cellRenderer="agCheckboxCellRenderer",e.suppressKeyboardEvent=e=>!!e.colDef.editable&&e.event.key===tn.SPACE,s(r?{valueFormatter:e=>L(e.value)?i(String(e.value),e.value?"True":"False"):i("blanks","(Blanks)")}:{maxNumConditions:1,debounceMs:0,filterOptions:["empty",{displayKey:"true",displayName:"True",predicate:(e,t)=>t,numberOfInputs:0},{displayKey:"false",displayName:"False",predicate:(e,t)=>!1===t,numberOfInputs:0}]});break;case"date":e.cellEditor="agDateCellEditor",e.keyCreator=o,r&&s({valueFormatter:e=>{const t=o(e);return L(t)?t:i("blanks","(Blanks)")},treeList:!0,treeListFormatter:(e,t)=>{if(1===t&&null!=e){const t=Ql[Number(e)-1];return i(t,Kl[t])}return e??i("blanks","(Blanks)")}});break;case"dateString":{e.cellEditor="agDateStrin';
      S = S + 'gCellEditor",e.keyCreator=o;const t=a.dateParser;s(r?{valueFormatter:e=>{const t=o(e);return L(t)?t:i("blanks","(Blanks)")},treeList:!0,treeListPathGetter:e=>{const a=t(e??void 0);return a?[String(a.getFullYear()),String(a.getMonth()+1),String(a.getDate())]:null},treeListFormatter:(e,t)=>{if(1===t&&null!=e){const t=Ql[Number(e)-1];return i(t,Kl[t])}return e??i("blanks","(Blanks)")}}:{comparator:(e,a)=>{const n=t(a);return null==a||n<e?-1:n>e?1:0}});break}case"object":e.cellEditorParams={useFormatter:!0},e.comparator=(e,t)=>{const a=this.columnModel.getColDefCol(n),r=a?.getColDef();if(!a||!r)return 0;const i=null==e?"":o({column:a,node:null,value:e}),s=null==t?"":o({column:a,node:null,value:t});return i===s?0:i>s?1:-1},e.keyCreator=o,r?s({valueFormatter:e=>{const t=o(e);return L(t)?t:i("blanks","(Blanks)")}}):e.filterValueGetter=e=>o({column:e.column,node:e.node,value:this.valueService.getValue(e.column,e.node)})}}getDefaultDataTypes(){const e=e=>!!e.match("^\\\\d{4}-\\\\d{2}-\\\\d{2}$"),t=this.localeService.getLocaleTextFunc();return{number:{baseDataType:"number",valueParser:e=>""===e.newValue?.trim?.()?null:Number(e.newValue),valueFormatter:e=>null==e.value?"":"number"!=typeof e.value||isNaN(e.value)?t("invalidNumber","Invalid Number"):String(e.value),dataTypeMatcher:e=>"number"==typeof e},text:{baseDataType:"text",valueParser:e=>""===e.newValue?null:G(e.newValue),dataTypeMatcher:e=>"string"==typeof e},boolean:{baseDataType:"boolean",valueParser:e=>null==e.newValue?e.newValue:""===e.newValue?.trim?.()?null:"true"===String(e.newValue).toLowerCase(),valueFormatter:e=>null==e.value?"":String(e.value),dataTypeMatcher:e=>"boolean"==typeof e},date:{baseDataType:"date",valueParser:e=>Yo(null==e.newValue?null:String(e.newValue)),valueFormatter:e=>null==e.value?"":e.value instanceof Date&&!isNaN(e.value.getTime())?jo(e.value,!1)??"":t("invalidDate","Invalid Date"),dataTypeMatcher:e=>e instanceof Date},dateString:{baseDataType:"dateString",dateParser:e=>Yo(e)??void 0,dateFormatter';
      S = S + ':e=>jo(e??null,!1)??void 0,valueParser:t=>e(String(t.newValue))?t.newValue:null,valueFormatter:t=>e(String(t.value))?t.value:"",dataTypeMatcher:t=>"string"==typeof t&&e(t)},object:{baseDataType:"object",valueParser:()=>null,valueFormatter:e=>G(e.value)??""}}}destroyColumnStateUpdateListeners(){this.columnStateUpdateListenerDestroyFuncs.forEach((e=>e())),this.columnStateUpdateListenerDestroyFuncs=[]}destroy(){this.dataTypeDefinitions={},this.dataTypeMatchers={},this.formatValueFuncs={},this.columnStateUpdatesPendingInference={},this.destroyColumnStateUpdateListeners(),super.destroy()}},_l={version:gr,moduleName:"@ag-grid-community/data-type",beans:[Yl]};function Jl(e,t){const{colKey:a,rowNode:n,useFormatter:o}=t,r=e.columnModel.getColDefCol(a)??e.columnModel.getCol(a);if(O(r))return null;const i=e.valueService.getValue(r,n);if(o){return e.valueService.formatValue(r,n,i)??He(i,!0)}return i}function Zl(e,t){e.gos.updateGridOptions({options:t})}function Xl(e){return e.rowRenderer.getFirstVirtualRenderedRow()}function $l(e){return e.rowRenderer.getLastVirtualRenderedRow()}var ec={version:gr,moduleName:"@ag-grid-community/menu-api",apiFunctions:{showColumnMenuAfterButtonClick:function(e,t,a){const n=e.columnModel.getCol(t);e.menuService.showColumnMenu({column:n,buttonElement:a,positionBy:"button"})},showColumnMenuAfterMouseClick:function(e,t,a){let n=e.columnModel.getCol(t);n||(n=e.columnModel.getColDefCol(t)),n?e.menuService.showColumnMenu({column:n,mouseEvent:a,positionBy:"mouse"}):ge(`column \'${t}\' not found`)},showColumnMenu:function(e,t){const a=e.columnModel.getCol(t);a?e.menuService.showColumnMenu({column:a,positionBy:"auto"}):ge(`column \'${t}\' not found`)},hidePopupMenu:function(e){e.menuService.hidePopupMenu()}}},tc={version:gr,moduleName:"@ag-grid-community/api",dependantModules:[{version:gr,moduleName:"@ag-grid-community/core-api",apiFunctions:{getGridId:function(e){return e.context.getGridId()},destroy:function(e){e.gridDestroyService.destroy()},isDestroyed:fu';
      S = S + 'nction(e){return e.gridDestroyService.isDestroyCalled()},getGridOption:function(e,t){return e.gos.get(t)},setGridOption:function(e,t,a){Zl(e,{[t]:a})},updateGridOptions:Zl}},{version:gr,moduleName:"@ag-grid-community/pinned-row-api",apiFunctions:{getPinnedTopRowCount:function(e){return e.pinnedRowModel.getPinnedTopRowCount()},getPinnedBottomRowCount:function(e){return e.pinnedRowModel.getPinnedBottomRowCount()},getPinnedTopRow:function(e,t){return e.pinnedRowModel.getPinnedTopRow(t)},getPinnedBottomRow:function(e,t){return e.pinnedRowModel.getPinnedBottomRow(t)}}},{version:gr,moduleName:"@ag-grid-community/row-selection-api",apiFunctions:{setNodesSelected:function(e,t){if(!t.nodes.every((e=>e.rowPinned?(ce("cannot select pinned rows"),!1):void 0!==e.id||(ce("cannot select node until id for node is known"),!1))))return;const{nodes:a,source:n,newValue:o}=t,r=a;e.selectionService.setNodesSelected({nodes:r,source:n??"api",newValue:o})},selectAll:function(e,t="apiSelectAll"){e.selectionService.selectAllRowNodes({source:t})},deselectAll:function(e,t="apiSelectAll"){e.selectionService.deselectAllRowNodes({source:t})},selectAllFiltered:function(e,t="apiSelectAllFiltered"){e.selectionService.selectAllRowNodes({source:t,justFiltered:!0})},deselectAllFiltered:function(e,t="apiSelectAllFiltered"){e.selectionService.deselectAllRowNodes({source:t,justFiltered:!0})},selectAllOnCurrentPage:function(e,t="apiSelectAllCurrentPage"){e.selectionService.selectAllRowNodes({source:t,justCurrentPage:!0})},deselectAllOnCurrentPage:function(e,t="apiSelectAllCurrentPage"){e.selectionService.deselectAllRowNodes({source:t,justCurrentPage:!0})},getSelectedNodes:function(e){return e.selectionService.getSelectedNodes()},getSelectedRows:function(e){return e.selectionService.getSelectedRows()}}},{version:gr,moduleName:"@ag-grid-community/column-api",apiFunctions:{getColumnDef:function(e,t){const a=e.columnModel.getColDefCol(t);return a?a.getColDef():null},getColumnDefs:function(e){return e.columnMode';
      S = S + 'l.getColumnDefs()},sizeColumnsToFit:function(e,t){"number"==typeof t?e.columnSizeService.sizeColumnsToFit(t,"api"):e.ctrlsService.getGridBodyCtrl().sizeColumnsToFit(t)},setColumnGroupOpened:function(e,t,a){e.columnModel.setColumnGroupOpened(t,a,"api")},getColumnGroup:function(e,t,a){return e.visibleColsService.getColumnGroup(t,a)},getProvidedColumnGroup:function(e,t){return e.columnModel.getProvidedColGroup(t)},getDisplayNameForColumn:function(e,t,a){return e.columnNameService.getDisplayNameForColumn(t,a)||""},getDisplayNameForColumnGroup:function(e,t,a){return e.columnNameService.getDisplayNameForColumnGroup(t,a)||""},getColumn:function(e,t){return e.columnModel.getColDefCol(t)},getColumns:function(e){return e.columnModel.getColDefCols()},applyColumnState:function(e,t){return e.columnApplyStateService.applyColumnState(t,"api")},getColumnState:function(e){return e.columnGetStateService.getColumnState()},resetColumnState:function(e){e.columnApplyStateService.resetColumnState("api")},getColumnGroupState:function(e){return e.columnGroupStateService.getColumnGroupState()},setColumnGroupState:function(e,t){e.columnGroupStateService.setColumnGroupState(t,"api")},resetColumnGroupState:function(e){e.columnGroupStateService.resetColumnGroupState("api")},isPinning:function(e){return e.visibleColsService.isPinningLeft()||e.visibleColsService.isPinningRight()},isPinningLeft:function(e){return e.visibleColsService.isPinningLeft()},isPinningRight:function(e){return e.visibleColsService.isPinningRight()},getDisplayedColAfter:function(e,t){return e.visibleColsService.getColAfter(t)},getDisplayedColBefore:function(e,t){return e.visibleColsService.getColBefore(t)},setColumnVisible:function(e,t,a){e.columnModel.setColsVisible([t],a,"api")},setColumnsVisible:function(e,t,a){e.columnModel.setColsVisible(t,a,"api")},setColumnPinned:function(e,t,a){e.columnModel.setColsPinned([t],a,"api")},setColumnsPinned:function(e,t,a){e.columnModel.setColsPinned(t,a,"api")},getAllGridColumns:function(';
      S = S + 'e){return e.columnModel.getCols()},getDisplayedLeftColumns:function(e){return e.visibleColsService.getLeftCols()},getDisplayedCenterColumns:function(e){return e.visibleColsService.getCenterCols()},getDisplayedRightColumns:function(e){return e.visibleColsService.getRightCols()},getAllDisplayedColumns:function(e){return e.visibleColsService.getAllCols()},getAllDisplayedVirtualColumns:function(e){return e.columnViewportService.getViewportColumns()},moveColumn:function(e,t,a){e.columnMoveService.moveColumns([t],a,"api")},moveColumnByIndex:function(e,t,a){e.columnMoveService.moveColumnByIndex(t,a,"api")},moveColumns:function(e,t,a){e.columnMoveService.moveColumns(t,a,"api")},setColumnWidth:function(e,t,a,n=!0,o="api"){e.columnSizeService.setColumnWidths([{key:t,newWidth:a}],!1,n,o)},setColumnWidths:function(e,t,a=!0,n="api"){e.columnSizeService.setColumnWidths(t,!1,a,n)},getLeftDisplayedColumnGroups:function(e){return e.visibleColsService.getTreeLeft()},getCenterDisplayedColumnGroups:function(e){return e.visibleColsService.getTreeCenter()},getRightDisplayedColumnGroups:function(e){return e.visibleColsService.getTreeRight()},getAllDisplayedColumnGroups:function(e){return e.visibleColsService.getAllTrees()},autoSizeColumn:function(e,t,a){return e.columnAutosizeService.autoSizeCols({colKeys:[t],skipHeader:a,source:"api"})},autoSizeColumns:function(e,t,a){e.columnAutosizeService.autoSizeCols({colKeys:t,skipHeader:a,source:"api"})},autoSizeAllColumns:function(e,t){e.columnAutosizeService.autoSizeAllColumns("api",t)}}},{version:gr,moduleName:"@ag-grid-community/row-api",apiFunctions:{redrawRows:function(e,t={}){const a=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming((()=>e.rowRenderer.redrawRows(a)))},setRowNodeExpanded:function(e,t,a,n,o){e.expansionService.setRowNodeExpanded(t,a,n,o)},getRowNode:function(e,t){return e.rowModel.getRowNode(t)},addRenderedRowListener:function(e,t,a,n){e.rowRenderer.addRenderedRowListener(t,a,n)},getRenderedNodes:function(e){return e.rowRe';
      S = S + 'nderer.getRenderedNodes()},forEachNode:function(e,t,a){e.rowModel.forEachNode(t,a)},getFirstDisplayedRow:function(e){return Xl(e)},getFirstDisplayedRowIndex:Xl,getLastDisplayedRow:function(e){return $l(e)},getLastDisplayedRowIndex:$l,getDisplayedRowAtIndex:function(e,t){return e.rowModel.getRow(t)},getDisplayedRowCount:function(e){return e.rowModel.getRowCount()},getModel:function(e){return e.rowModel}}},{version:gr,moduleName:"@ag-grid-community/drag-api",apiFunctions:{addRowDropZone:function(e,t){e.ctrlsService.getGridBodyCtrl().getRowDragFeature().addRowDropZone(t)},removeRowDropZone:function(e,t){const a=e.dragAndDropService.findExternalZone(t);a&&e.dragAndDropService.removeDropTarget(a)},getRowDropZoneParams:function(e,t){return e.ctrlsService.getGridBodyCtrl().getRowDragFeature().getRowDropZone(t)}}},{version:gr,moduleName:"@ag-grid-community/scroll-api",apiFunctions:{getVerticalPixelRange:function(e){return e.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition()},getHorizontalPixelRange:function(e){return e.ctrlsService.getGridBodyCtrl().getScrollFeature().getHScrollPosition()},ensureColumnVisible:Gs,ensureIndexVisible:qs,ensureNodeVisible:function(e,t,a=null){e.frameworkOverrides.wrapIncoming((()=>e.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureNodeVisible(t,a)),"ensureVisible")}}},{version:gr,moduleName:"@ag-grid-community/overlay-api",apiFunctions:{showLoadingOverlay:function(e){e.overlayService.showLoadingOverlay()},showNoRowsOverlay:function(e){e.overlayService.showNoRowsOverlay()},hideOverlay:function(e){e.overlayService.hideOverlay()}}},{version:gr,moduleName:"@ag-grid-community/keyboard-navigation-api",apiFunctions:{getFocusedCell:function(e){return e.focusService.getFocusedCell()},clearFocusedCell:function(e){return e.focusService.clearFocusedCell()},setFocusedCell:function(e,t,a,n){e.focusService.setFocusedCell({rowIndex:t,column:a,rowPinned:n,forceBrowserFocus:!0})},setFocusedHeader:function(e,t,a=!1){const n=e.headerNavi';
      S = S + 'gationService.getHeaderPositionForColumn(t,a);n&&e.focusService.focusHeaderPosition({headerPosition:n})},tabToNextCell:function(e,t){return e.navigationService.tabToNextCell(!1,t)},tabToPreviousCell:function(e,t){return e.navigationService.tabToNextCell(!0,t)}}},{version:gr,moduleName:"@ag-grid-community/event-api",apiFunctions:{addEventListener:function(e,t,a){e.apiEventService.addEventListener(t,a)},addGlobalListener:function(e,t){e.apiEventService.addGlobalListener(t)},removeEventListener:function(e,t,a){e.apiEventService.removeEventListener(t,a)},removeGlobalListener:function(e,t){e.apiEventService.removeGlobalListener(t)}}},{version:gr,moduleName:"@ag-grid-community/render-api",apiFunctions:{setGridAriaProperty:function(e,t,a){if(!t)return;const n=e.ctrlsService.getGridBodyCtrl().getGui(),o=`aria-${t}`;null===a?n.removeAttribute(o):n.setAttribute(o,a)},refreshCells:function(e,t={}){e.frameworkOverrides.wrapIncoming((()=>e.rowRenderer.refreshCells(t)))},flashCells:function(e,t={}){const a=e=>ce(`Since v31.1 api.flashCells parameter \'${e}Delay\' is deprecated. Please use \'${e}Duration\' instead.`);L(t.fadeDelay)&&a("fade"),L(t.flashDelay)&&a("flash"),e.frameworkOverrides.wrapIncoming((()=>e.rowRenderer.flashCells(t)))},refreshHeader:function(e){e.frameworkOverrides.wrapIncoming((()=>e.ctrlsService.getHeaderRowContainerCtrls().forEach((e=>e.refresh()))))},isAnimationFrameQueueEmpty:function(e){return e.animationFrameService.isQueueEmpty()},flushAllAnimationFrames:function(e){e.animationFrameService.flushAllFrames()},getSizesForCurrentTheme:function(e){return{rowHeight:e.gos.getRowHeightAsNumber(),headerHeight:e.columnModel.getHeaderHeight()}},getCellRendererInstances:function(e,t={}){return e.rowRenderer.getCellRendererInstances(t).map(Hn)}}},{version:gr,moduleName:"@ag-grid-community/cell-api",apiFunctions:{expireValueCache:function(e){e.valueCache.expire()},getValue:function(e,t,a){return Jl(e,{colKey:t,rowNode:a})},getCellValue:Jl}},ec,{version:gr,moduleName:"@ag';
      S = S + '-grid-community/sort-api",apiFunctions:{onSortChanged:function(e){e.sortController.onSortChanged("api")}}}]};var ac={version:gr,moduleName:"@ag-grid-community/state-core",beans:[class extends A{constructor(){super(...arguments),this.beanName="stateService",this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=fe((()=>this.dispatchQueuedStateUpdateEvents()),0),this.onRowGroupOpenedDebounced=fe((()=>this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState())),0),this.onRowSelectedDebounced=fe((()=>{this.staleStateKeys.delete("rowSelection"),this.updateCachedState("rowSelection",this.getRowSelectionState())}),0),this.staleStateKeys=new Set}wireBeans(e){this.filterManager=e.filterManager,this.ctrlsService=e.ctrlsService,this.pivotResultColsService=e.pivotResultColsService,this.focusService=e.focusService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.columnGroupStateService=e.columnGroupStateService,this.columnGetStateService=e.columnGetStateService,this.paginationService=e.paginationService,this.rowModel=e.rowModel,this.selectionService=e.selectionService,this.expansionService=e.expansionService,this.columnAnimationService=e.columnAnimationService,this.columnApplyStateService=e.columnApplyStateService,this.sideBarService=e.sideBarService,this.rangeService=e.rangeService}postConstruct(){this.isClientSideRowModel="clientSide"===this.rowModel.getType(),this.cachedState=this.gos.get("initialState")??{},this.ctrlsService.whenReady((()=>this.suppressEventsAndDispatchInitEvent((()=>this.setupStateOnGridReady()))));const[e,t,a]=this.addManagedEventListeners({newColumnsLoaded:({source:t})=>{"gridInitializing"===t&&(e(),this.suppressEventsAndDispatchInitEvent((()=>this.setupStateOnColumnsInitialised())))},rowCountReady:()=>{t?.(),this.suppressEventsAndDispatchInitEvent((()=>this.setupStateOnRowCountReady()))},firstDataRendered:()=>{a?.(),this.suppressEventsAndDispatchInitEvent((()=>this.s';
      S = S + 'etupStateOnFirstDataRendered()))}})}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setupStateOnGridReady(){this.updateCachedState("sideBar",this.getSideBarState());const e=()=>this.updateCachedState("sideBar",this.getSideBarState());this.addManagedEventListeners({toolPanelVisibleChanged:e,sideBarUpdated:e})}setupStateOnColumnsInitialised(){const e=this.gos.get("initialState")??{};this.setColumnState(e),this.setColumnGroupState(e),this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState()),this.addManagedEventListeners({columnValueChanged:()=>this.updateColumnState(["aggregation"]),columnMoved:()=>this.updateColumnState(["columnOrder"]),columnPinned:()=>this.updateColumnState(["columnPinning"]),columnResized:()=>this.updateColumnState(["columnSizing"]),columnVisible:()=>this.updateColumnState(["columnVisibility"]),columnPivotChanged:()=>this.updateColumnState(["pivot"]),columnPivotModeChanged:()=>this.updateColumnState(["pivot"]),columnRowGroupChanged:()=>this.updateColumnState(["rowGroup"]),sortChanged:()=>this.updateColumnState(["sort"]),newColumnsLoaded:()=>this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","rowGroup","sort"]),columnGroupOpened:()=>this.updateCachedState("columnGroup",this.getColumnGroupState())})}setupStateOnRowCountReady(){const{filter:e,rowGroupExpansion:t,rowSelection:a,pagination:n}=this.gos.get("initialState")??{},o=this.gos.get("advancedFilterModel");(e||o)&&this.setFilterState(e,o),t&&this.setRowGroupExpansionState(t),a&&this.setRowSelectionState(a),n&&this.setPaginationState(n),this.updateCachedState("filter",this.getFilterState()),this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("rowSelection",this.getRowSelectionState()),this.updateCachedState("pagin';
      S = S + 'ation",this.getPaginationState()),this.addManagedEventListeners({filterChanged:()=>this.updateCachedState("filter",this.getFilterState()),rowGroupOpened:()=>this.onRowGroupOpenedDebounced(),expandOrCollapseAll:()=>this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:e=>{(e.newPage||e.newPageSize)&&this.updateCachedState("pagination",this.getPaginationState())}})}setupStateOnFirstDataRendered(){const{scroll:e,rangeSelection:t,focusedCell:a,columnOrder:n}=this.gos.get("initialState")??{};a&&this.setFocusedCellState(a),t&&this.setRangeSelectionState(t),e&&this.setScrollState(e),this.setColumnPivotState(!!n?.orderedColIds),this.updateCachedState("sideBar",this.getSideBarState()),this.updateCachedState("focusedCell",this.getFocusedCellState()),this.updateCachedState("rangeSelection",this.getRangeSelectionState()),this.updateCachedState("scroll",this.getScrollState()),this.addManagedEventListeners({cellFocused:()=>this.updateCachedState("focusedCell",this.getFocusedCellState()),rangeSelectionChanged:e=>{e.finished&&this.updateCachedState("rangeSelection",this.getRangeSelectionState())},bodyScrollEnd:()=>this.updateCachedState("scroll",this.getScrollState())})}getColumnState(){const e=this.columnModel.isPivotMode(),t=[],a=[],n=[],o=[],r=[],i=[],s=[],l=[],c=[],g=this.columnGetStateService.getColumnState();for(let e=0;e<g.length;e++){const{colId:d,sort:h,sortIndex:u,rowGroup:p,rowGroupIndex:m,aggFunc:f,pivot:v,pivotIndex:b,pinned:C,hide:w,width:y,flex:S}=g[e];c.push(d),h&&(t[u??0]={colId:d,sort:h}),p&&(a[m??0]=d),"string"==typeof f&&n.push({colId:d,aggFunc:f}),v&&(o[b??0]=d),C&&("right"===C?i:r).push(d),w&&s.push(d),(S||y)&&l.push({colId:d,flex:S??void 0,width:y})}return{sort:t.length?{sortModel:t}:void 0,rowGroup:a.length?{groupColIds:a}:void 0,aggregation:n.length?{aggregationModel:n}:void 0,pivot:o.length||e?{pivotMode:e,pivotColIds:o}:voi';
      S = S + 'd 0,columnPinning:r.length||i.length?{leftColIds:r,rightColIds:i}:void 0,columnVisibility:s.length?{hiddenColIds:s}:void 0,columnSizing:l.length?{columnSizingModel:l}:void 0,columnOrder:c.length?{orderedColIds:c}:void 0}}setColumnState(e){const{sort:t,rowGroup:a,aggregation:n,pivot:o,columnPinning:r,columnVisibility:i,columnSizing:s,columnOrder:l}=e,c={},g=e=>{let t=c[e];return t||(t={colId:e},c[e]=t,t)};t&&t.sortModel.forEach((({colId:e,sort:t},a)=>{const n=g(e);n.sort=t,n.sortIndex=a})),a&&a.groupColIds.forEach(((e,t)=>{const a=g(e);a.rowGroup=!0,a.rowGroupIndex=t})),n&&n.aggregationModel.forEach((({colId:e,aggFunc:t})=>{g(e).aggFunc=t})),o&&(o.pivotColIds.forEach(((e,t)=>{const a=g(e);a.pivot=!0,a.pivotIndex=t})),this.gos.updateGridOptions({options:{pivotMode:o.pivotMode},source:"gridInitializing"})),r&&(r.leftColIds.forEach((e=>{g(e).pinned="left"})),r.rightColIds.forEach((e=>{g(e).pinned="right"}))),i&&i.hiddenColIds.forEach((e=>{g(e).hide=!0})),s&&s.columnSizingModel.forEach((({colId:e,flex:t,width:a})=>{const n=g(e);n.flex=t??null,n.width=a}));const d=l?.orderedColIds,h=!!d?.length,u=h?d.map((e=>g(e))):Object.values(c);if(u.length){this.columnStates=u;const e={sort:null,sortIndex:null,rowGroup:null,rowGroupIndex:null,aggFunc:null,pivot:null,pivotIndex:null,pinned:null,hide:null,flex:null};this.columnApplyStateService.applyColumnState({state:u,applyOrder:h,defaultState:e},"gridInitializing")}}setColumnPivotState(e){const t=this.columnStates;this.columnStates=void 0;const a=this.columnGroupStates;if(this.columnGroupStates=void 0,this.pivotResultColsService.isPivotResultColsPresent()){if(t){const a=[];for(const e of t)this.pivotResultColsService.getPivotResultCol(e.colId)&&a.push(e);this.columnApplyStateService.applyColumnState({state:a,applyOrder:e},"gridInitializing")}a&&this.columnGroupStateService.setColumnGroupState(a,"gridInitializing")}}getColumnGroupState(){const e=this.columnGroupStateService.getColumnGroupState(),t=[];return e.forEach((({groupId:e,open';
      S = S + ':a})=>{a&&t.push(e)})),t.length?{openColumnGroupIds:t}:void 0}setColumnGroupState(e){if(!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const t=new Set(e.columnGroup?.openColumnGroupIds),a=this.columnGroupStateService.getColumnGroupState().map((({groupId:e})=>{const a=t.has(e);return a&&t.delete(e),{groupId:e,open:a}}));t.forEach((e=>{a.push({groupId:e,open:!0})})),a.length&&(this.columnGroupStates=a),this.columnGroupStateService.setColumnGroupState(a,"gridInitializing")}getFilterState(){let e=this.filterManager?.getFilterModel();e&&0===Object.keys(e).length&&(e=void 0);const t=this.filterManager?.getAdvancedFilterModel()??void 0;return e||t?{filterModel:e,advancedFilterModel:t}:void 0}setFilterState(e,t){const{filterModel:a,advancedFilterModel:n}=e??{advancedFilterModel:t};a&&this.filterManager?.setFilterModel(a,"columnFilter"),n&&this.filterManager?.setAdvancedFilterModel(n)}getRangeSelectionState(){const e=this.rangeService?.getCellRanges().map((e=>{const{id:t,type:a,startRow:n,endRow:o,columns:r,startColumn:i}=e;return{id:t,type:a,startRow:n,endRow:o,colIds:r.map((e=>e.getColId())),startColId:i.getColId()}}));return e?.length?{cellRanges:e}:void 0}setRangeSelectionState(e){if(!this.gos.get("enableRangeSelection")||!this.rangeService)return;const t=[];e.cellRanges.forEach((e=>{const a=[];if(e.colIds.forEach((e=>{const t=this.columnModel.getCol(e);t&&a.push(t)})),!a.length)return;let n=this.columnModel.getCol(e.startColId);if(!n){const e=this.visibleColsService.getAllCols(),t=new Set(a);n=e.find((e=>t.has(e)))}t.push({...e,columns:a,startColumn:n})})),this.rangeService.setCellRanges(t)}getScrollState(){if(!this.isClientSideRowModel)return;const e=this.ctrlsService.getGridBodyCtrl()?.getScrollFeature(),{left:t}=e?.getHScrollPosition()??{left:0},{top:a}=e?.getVScrollPosition()??{top:0};return a||t?{top:a,left:t}:void 0}setScrollState(e){if(!this.isClientSideRowModel)return;const{top:t,left:a}=e;this.ctrlsService.getGridBodyCtrl()?.getScrollFeature().se';
      S = S + 'tScrollPosition(t,a)}getSideBarState(){return this.sideBarService?.getSideBarComp()?.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.focusService.getFocusedCell();if(e){const{column:t,rowIndex:a,rowPinned:n}=e;return{colId:t.getColId(),rowIndex:a,rowPinned:n}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{colId:t,rowIndex:a,rowPinned:n}=e;this.focusService.setFocusedCell({column:this.columnModel.getCol(t),rowIndex:a,rowPinned:n,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){if(!this.paginationService)return;const e=this.paginationService.getCurrentPage(),t=this.gos.get("paginationAutoPageSize")?void 0:this.paginationService.getPageSize();return e||t?{page:e,pageSize:t}:void 0}setPaginationState(e){this.paginationService&&(e.pageSize&&!this.gos.get("paginationAutoPageSize")&&this.paginationService.setPageSize(e.pageSize,"initialState"),"number"==typeof e.page&&this.paginationService.setPage(e.page))}getRowSelectionState(){const e=this.selectionService.getSelectionState();return!e||!Array.isArray(e)&&(!1===e.selectAll||!1===e.selectAllChildren)&&!e?.toggledNodes?.length?void 0:e}setRowSelectionState(e){this.selectionService.setSelectionState(e,"gridInitializing")}getRowGroupExpansionState(){const e=this.expansionService.getExpandedRows();return e.length?{expandedRowGroupIds:e}:void 0}setRowGroupExpansionState(e){this.expansionService.expandRows(e.expandedRowGroupIds)}updateColumnState(e){const t=this.getColumnState();let a=!1;Object.entries(t).forEach((([e,t])=>{V(t,this.cachedState[e])||(a=!0)})),this.cachedState={...this.cachedState,...t},a&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const a=this.cachedState[e];this.setCachedStateValue(e,t),V(t,a)||this.dispatchStateUpdateEvent([e])}setCachedStateValue(e,t){this.cachedState={...this.cachedState,[e]:t}}refreshStaleState(){this.staleStateKeys.forEach((e=>{if("rowSelection"===e)this.setCachedStateValue(e,this.getRowSelection';
      S = S + 'State())})),this.staleStateKeys.clear()}dispatchStateUpdateEvent(e){this.suppressEvents||(e.forEach((e=>this.queuedUpdateSources.add(e))),this.dispatchStateUpdateEventDebounced())}dispatchQueuedStateUpdateEvents(){const e=Array.from(this.queuedUpdateSources);this.queuedUpdateSources.clear();const t={type:"stateUpdated",sources:e,state:this.cachedState};this.eventService.dispatchEvent(t)}suppressEventsAndDispatchInitEvent(e){this.suppressEvents=!0,this.columnAnimationService.setSuppressAnimation(!0),e(),setTimeout((()=>{this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&(this.columnAnimationService.setSuppressAnimation(!1),this.dispatchStateUpdateEvent(["gridInitializing"]))}))}}]},nc={version:gr,moduleName:"@ag-grid-community/state",dependantModules:[ac,{version:gr,moduleName:"@ag-grid-community/state-api",apiFunctions:{getState:function(e){return e.stateService?.getState()??{}}},dependantModules:[ac]}]};function oc(e,t,a){e.addManagedElementListeners(t,{keydown:e=>{if(!e.defaultPrevented&&e.key===tn.TAB){const n=e.shiftKey;a.findNextFocusableElement(t,!1,n)||a.focusNextGridCoreContainer(n)&&e.preventDefault()}}})}var rc={selector:"AG-PAGE-SIZE-SELECTOR",component:class extends Ba{constructor(){super(\'<span class="ag-paging-page-size"></span>\'),this.hasEmptyOption=!1,this.handlePageSizeItemSelected=()=>{if(!this.selectPageSizeComp)return;const e=this.selectPageSizeComp.getValue();if(!e)return;const t=Number(e);isNaN(t)||t<1||t===this.paginationService.getPageSize()||(this.paginationService.setPageSize(t,"pageSizeSelector"),this.hasEmptyOption&&this.toggleSelectDisplay(!0),this.selectPageSizeComp.getFocusableElement().focus())}}wireBeans(e){this.paginationService=e.paginationService}postConstruct(){this.addManagedPropertyListener("paginationPageSizeSelector",(()=>{this.onPageSizeSelectorValuesChange()})),this.addManagedEventListeners({paginationChanged:e=>this.handlePaginationChanged(e)})}handlePaginationChanged(e){if(!this.selectPageSizeComp||!e';
      S = S + '?.newPageSize)return;const t=this.paginationService.getPageSize();this.getPageSizeSelectorValues().includes(t)?this.selectPageSizeComp.setValue(t.toString()):this.hasEmptyOption?this.selectPageSizeComp.setValue(""):this.toggleSelectDisplay(!0)}toggleSelectDisplay(e){this.selectPageSizeComp&&this.reset(),e&&(this.reloadPageSizesSelector(),this.selectPageSizeComp&&this.appendChild(this.selectPageSizeComp))}reset(){ba(this.getGui()),this.selectPageSizeComp&&(this.selectPageSizeComp=this.destroyBean(this.selectPageSizeComp))}onPageSizeSelectorValuesChange(){this.selectPageSizeComp&&this.shouldShowPageSizeSelector()&&this.reloadPageSizesSelector()}shouldShowPageSizeSelector(){return this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel")&&!this.gos.get("paginationAutoPageSize")&&!1!==this.gos.get("paginationPageSizeSelector")}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.paginationService.getPageSize(),a=!t||!e.includes(t);a&&(e.unshift(""),ce("The paginationPageSize grid option is set to a value that is not in the list of page size options.\\n                Please make sure that the paginationPageSize grid option is set to one of the values in the \\n                paginationPageSizeSelector array, or set the paginationPageSizeSelector to false to hide the page size selector.")),this.selectPageSizeComp&&(this.selectPageSizeComp=this.destroyBean(this.selectPageSizeComp));const n=this.localeService.getLocaleTextFunc(),o=n("pageSizeSelectorLabel","Page Size:"),r=e.map((e=>({value:String(e),text:String(e)}))),i=n("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new wo).addOptions(r).setValue(String(a?"":t)).setAriaLabel(i).setLabel(o).onValueChange((()=>this.handlePageSizeItemSelected())),this.hasEmptyOption=a}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get("paginationPageSizeSelector");return Array.isArray(t)&&this.validateValues(t)?[...t].sort(((e,t)=>e-t)):e}validateValues(e){i';
      S = S + 'f(!e.length)return ce("The paginationPageSizeSelector grid option is an empty array. This is most likely a mistake.\\n                If you want to hide the page size selector, please set the paginationPageSizeSelector to false."),!1;for(let t=0;t<e.length;t++){const a=e[t],n=a>0;if(!("number"==typeof a))return ce("The paginationPageSizeSelector grid option contains a non-numeric value.\\n                    Please make sure that all values in the paginationPageSizeSelector array are numbers."),!1;if(!n)return ce("The paginationPageSizeSelector grid option contains a negative number or zero.\\n                    Please make sure that all values in the paginationPageSizeSelector array are positive."),!1}return!0}destroy(){this.toggleSelectDisplay(!1),super.destroy()}}},ic={selector:"AG-PAGINATION",component:class extends ll{constructor(){super(),this.btFirst=qa,this.btPrevious=qa,this.btNext=qa,this.btLast=qa,this.lbRecordCount=qa,this.lbFirstRowOnPage=qa,this.lbLastRowOnPage=qa,this.lbCurrent=qa,this.lbTotal=qa,this.pageSizeComp=qa,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1}wireBeans(e){this.rowNodeBlockLoader=e.rowNodeBlockLoader,this.rowModel=e.rowModel,this.paginationService=e.paginationService,this.focusService=e.focusService}postConstruct(){const e=this.gos.get("enableRtl");this.setTemplate(this.getTemplate(),[rc]);const{btFirst:t,btPrevious:a,btNext:n,btLast:o}=this;this.activateTabIndex([t,a,n,o]),t.insertAdjacentElement("afterbegin",Wa(e?"last":"first",this.gos)),a.insertAdjacentElement("afterbegin",Wa(e?"next":"previous",this.gos)),n.insertAdjacentElement("afterbegin",Wa(e?"previous":"next",this.gos)),o.insertAdjacentElement("afterbegin",Wa(e?"first":"last",this.gos)),this.addManagedPropertyListener("pagination",this.onPaginationChanged.bind(this)),this.addManagedPropertyListener("suppressPaginationPanel",this.onPaginationChanged.bind(this)),this.addMa';
      S = S + 'nagedPropertyListeners(["paginationPageSizeSelector","paginationAutoPageSize","suppressPaginationPanel"],(()=>this.onPageSizeRelatedOptionsChange())),this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:e=>{this.allowFocusInnerElement?this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(e):this.focusService.focusGridInnerElement(e)},forceFocusOutWhenTabGuardsAreEmpty:!0}),this.onPaginationChanged()}setAllowFocus(e){this.allowFocusInnerElement=e}onPaginationChanged(){const e=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.setDisplayed(e),e&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateRowLabels(),this.setCurrentPageLabel(),this.setTotalLabels(),this.onPageSizeRelatedOptionsChange())}onPageSizeRelatedOptionsChange(){this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector())}setupListeners(){this.areListenersSetup||(this.addManagedEventListeners({paginationChanged:this.onPaginationChanged.bind(this)}),[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}].forEach((e=>{const{el:t,fn:a}=e;this.addManagedListeners(t,{click:a,keydown:e=>{e.key!==tn.ENTER&&e.key!==tn.SPACE||(e.preventDefault(),a())}})})),oc(this,this.getGui(),this.focusService),this.areListenersSetup=!0)}onBtFirst(){this.previousAndFirstButtonsDisabled||this.paginationService.goToFirstPage()}setCurrentPageLabel(){const e=this.paginationService.getTotalPages()>0,t=this.paginationService.getCurrentPage(),a=e?t+1:0;this.lbCurrent.textContent=this.formatNumber(a)}formatNumber(e){const t=this.gos.getCallback("paginationNumberFormatter");if(t){return t({value:e})}const a=this.localeService.getLocaleTextFunc();return Uo(e,a("thousandSeparator",","),a("decimalSeparator","."))}getTemplate(){const e=this.localeSer';
      S = S + 'vice.getLocaleTextFunc(),t=e("page","Page"),a=e("to","to"),n=e("of","of"),o=e("firstPage","First Page"),r=e("previousPage","Previous Page"),i=e("nextPage","Next Page"),s=e("lastPage","Last Page"),l=this.getCompId();return`<div class="ag-paging-panel ag-unselectable" id="ag-${l}">\\n                <ag-page-size-selector data-ref="pageSizeComp"></ag-page-size-selector>\\n                <span class="ag-paging-row-summary-panel" role="status">\\n                    <span id="ag-${l}-first-row" data-ref="lbFirstRowOnPage" class="ag-paging-row-summary-panel-number"></span>\\n                    <span id="ag-${l}-to">${a}</span>\\n                    <span id="ag-${l}-last-row" data-ref="lbLastRowOnPage" class="ag-paging-row-summary-panel-number"></span>\\n                    <span id="ag-${l}-of">${n}</span>\\n                    <span id="ag-${l}-row-count" data-ref="lbRecordCount" class="ag-paging-row-summary-panel-number"></span>\\n                </span>\\n                <span class="ag-paging-page-summary-panel" role="presentation">\\n                    <div data-ref="btFirst" class="ag-button ag-paging-button" role="button" aria-label="${o}"></div>\\n                    <div data-ref="btPrevious" class="ag-button ag-paging-button" role="button" aria-label="${r}"></div>\\n                    <span class="ag-paging-description" role="status">\\n                        <span id="ag-${l}-start-page">${t}</span>\\n                        <span id="ag-${l}-start-page-number" data-ref="lbCurrent" class="ag-paging-number"></span>\\n                        <span id="ag-${l}-of-page">${n}</span>\\n                        <span id="ag-${l}-of-page-number" data-ref="lbTotal" class="ag-paging-number"></span>\\n                    </span>\\n                    <div data-ref="btNext" class="ag-button ag-paging-button" role="button" aria-label="${i}"></div>\\n                    <div data-ref="btLast" class="ag-button ag-paging-button" role="button" aria-label="${s}"></div>\\n                </spa';
      S = S + 'n>\\n            </div>`}onBtNext(){this.nextButtonDisabled||this.paginationService.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.paginationService.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.paginationService.goToLastPage()}enableOrDisableButtons(){const e=this.paginationService.getCurrentPage(),t=this.rowModel.isLastRowIndexKnown(),a=this.paginationService.getTotalPages();this.previousAndFirstButtonsDisabled=0===e,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const n=this.isZeroPagesToDisplay(),o=e===a-1;this.nextButtonDisabled=o||n,this.lastButtonDisabled=!t||n||e===a-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){Mt(e,t),e.classList.toggle("ag-disabled",t)}updateRowLabels(){const e=this.paginationService.getCurrentPage(),t=this.paginationService.getPageSize(),a=this.rowModel.isLastRowIndexKnown(),n=this.rowModel.isLastRowIndexKnown()?this.paginationService.getMasterRowCount():null;let o,r;if(this.isZeroPagesToDisplay()?o=r=0:(o=t*e+1,r=o+t-1,a&&r>n&&(r=n)),this.lbFirstRowOnPage.textContent=this.formatNumber(o),this.rowNodeBlockLoader?.isLoading()){const e=this.localeService.getLocaleTextFunc();this.lbLastRowOnPage.innerHTML=e("pageLastRowUnknown","?")}else this.lbLastRowOnPage.textContent=this.formatNumber(r)}isZeroPagesToDisplay(){const e=this.rowModel.isLastRowIndexKnown(),t=this.paginationService.getTotalPages();return e&&0===t}setTotalLabels(){const e=this.rowModel.isLastRowIndexKnown(),t=this.paginationService.getTotalPages(),a=e?this.paginationService.getMasterRowCount():null;if(1===a){const e=this.rowModel.getRow(0);if(e&&e.group&&!(e.groupData||e.aggData))return void this.setTotalLabelsToZero()}if(e)this.lbTotal.textContent=this.formatNumber(t),this.lbRecordCount.textContent=this.formatNumber(a);els';
      S = S + 'e{const e=this.localeService.getLocaleTextFunc()("more","more");this.lbTotal.innerHTML=e,this.lbRecordCount.innerHTML=e}}setTotalLabelsToZero(){this.lbFirstRowOnPage.textContent=this.formatNumber(0),this.lbCurrent.textContent=this.formatNumber(0),this.lbLastRowOnPage.textContent=this.formatNumber(0),this.lbTotal.textContent=this.formatNumber(0),this.lbRecordCount.textContent=this.formatNumber(0)}}},sc={version:gr,moduleName:"@ag-grid-community/pagination-core",beans:[class extends A{constructor(){super(...arguments),this.beanName="paginationService",this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=0,this.masterRowCount=0}wireBeans(e){this.rowModel=e.rowModel,this.pageBoundsService=e.pageBoundsService}postConstruct(){this.active=this.gos.get("pagination"),this.pageSizeFromGridOptions=this.gos.get("paginationPageSize"),this.paginateChildRows=this.isPaginateChildRows(),this.addManagedPropertyListener("pagination",this.onPaginationGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPageSizeGridOptionChanged.bind(this))}getPaginationSelector(){return ic}isPaginateChildRows(){return!(!this.gos.get("groupRemoveSingleChildren")&&!this.gos.get("groupRemoveLowestSingleChildren"))||this.gos.get("paginateChildRows")}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages(),this.dispatchPaginationChangedEvent({keepRenderedRows:!0})}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}goToPage(e){this.active&&this.currentPage!==e&&"number"==typeof this.currentPage&&(this.currentPage=e,this.calculatePages(),this.dispatchPaginationChangedEvent({newPage:!0}))}isRowPresent(e){return e.rowIndex>=this.topDisplayedRowIndex&&e.rowIndex<=this.bottomDisplayedRowIndex}getPageForIndex(e){return Math.floor(e/this.pageSize)}goToPageWithIndex(e){if(!this.active)return;const t=this.getPageForIndex(e);this.goToPage(t)}isRowInPage(e){if(!this.active)return';
      S = S + '!0;return this.getPageForIndex(e.rowIndex)===this.currentPage}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){return L(this.pageSizeAutoCalculated)?this.pageSizeAutoCalculated:L(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:L(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:L(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.pageBoundsService.calculateBounds(this.topDisplayedRowIndex,this.bottomDisplayedRowIndex)}unsetAutoCalculatedPageSize(){if(void 0===this.pageSizeAutoCalculated)return;const e=this.pageSizeAutoCalculated;this.pageSizeAutoCalculated=void 0,this.pageSize!==e&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0}))}setPageSize(e,t){const a=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,0!==this.currentPage&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"gridOptions":this.pageSizeFromGridOptions=e,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,0!==this.currentPage&&this.goToFirstPage()}a!==this.pageSize&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0,keepRenderedRows:!0}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){this.currentPage>=this.totalPages&&(this.currentPage=t';
      S = S + 'his.totalPages-1),(!isFinite(this.currentPage)||isNaN(this.currentPage)||this.currentPage<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){if(this.masterRowCount=this.rowModel.getTopLevelRowCount(),this.masterRowCount<=0)return void this.setZeroRows();const e=this.masterRowCount-1;this.totalPages=Math.floor(e/this.pageSize)+1,this.adjustCurrentPageIfInvalid();const t=this.pageSize*this.currentPage;let a=this.pageSize*(this.currentPage+1)-1;if(a>e&&(a=e),this.topDisplayedRowIndex=this.rowModel.getTopLevelRowDisplayedIndex(t),a===e)this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1;else{const e=this.rowModel.getTopLevelRowDisplayedIndex(a+1);this.bottomDisplayedRowIndex=e-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){if(this.masterRowCount=this.rowModel.getRowCount(),0===this.masterRowCount)return void this.setZeroRows();const e=this.masterRowCount-1;this.totalPages=Math.floor(e/this.pageSize)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=this.pageSize*this.currentPage,this.bottomDisplayedRowIndex=this.pageSize*(this.currentPage+1)-1,this.bottomDisplayedRowIndex>e&&(this.bottomDisplayedRowIndex=e)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1}dispatchPaginationChangedEvent(e){const{keepRenderedRows:t=!1,newPage:a=!1,newPageSize:n=!1}=e,o={type:"paginationChanged",animate:!1,newData:!1,newPage:a,newPageSize:n,keepRenderedRows:t};this.eventService.dispatchEvent(o)}},class extends A{constructor(){super(...arguments),this.beanName="paginationAutoPageSizeService"}wireBeans(e){this.ctrlsService=e.ctrlsService,this.paginationService=e.paginationService}postConstruct(){this.ctrlsService.whenReady((e=>{this.centerRowsCtrl=e.center;const t=this.checkPageSize.bind(this);this.addManagedEventListeners({bodyHeightChanged:t,scrollVisibilityChanged:t}),this.addManagedPropertyListen';
      S = S + 'er("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()}))}notActive(){return!this.gos.get("paginationAutoPageSize")||null==this.centerRowsCtrl}onPaginationAutoSizeChanged(){this.notActive()?this.paginationService.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.centerRowsCtrl.getViewportSizeFeature().getBodyHeight();if(e>0){const t=()=>{const t=Math.max(this.gos.getRowHeightAsNumber(),1),a=Math.floor(e/t);this.paginationService.setPageSize(a,"autoCalculated")};this.isBodyRendered?fe((()=>t()),50)():(t(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}}]},lc={version:gr,moduleName:"@ag-grid-community/pagination",dependantModules:[sc,{version:gr,moduleName:"@ag-grid-community/pagination-api",dependantModules:[sc],apiFunctions:{paginationIsLastPageFound:function(e){return e.rowModel.isLastRowIndexKnown()},paginationGetPageSize:function(e){return e.paginationService?.getPageSize()??100},paginationGetCurrentPage:function(e){return e.paginationService?.getCurrentPage()??0},paginationGetTotalPages:function(e){return e.paginationService?.getTotalPages()??1},paginationGetRowCount:function(e){return e.paginationService?e.paginationService.getMasterRowCount():e.rowModel.getRowCount()},paginationGoToNextPage:function(e){e.paginationService?.goToNextPage()},paginationGoToPreviousPage:function(e){e.paginationService?.goToPreviousPage()},paginationGoToFirstPage:function(e){e.paginationService?.goToFirstPage()},paginationGoToLastPage:function(e){e.paginationService?.goToLastPage()},paginationGoToPage:function(e,t){e.paginationService?.goToPage(t)}}}]},cc="@ag-grid-community/core",gc="@ag-grid-community/client-side-row-model",dc="@ag-grid-community/csv-export",hc="@ag-grid-community/infinite-row-model",uc="@ag-grid-enterprise/advanced-filter",pc="@ag-grid-enterprise/charts",mc="@ag-grid-enterprise/clipboard",fc="@ag-grid-enterprise/excel-export",vc="@ag-grid-enterprise/master-detail"';
      S = S + ',bc="@ag-grid-enterprise/menu",Cc="@ag-grid-enterprise/range-selection",wc="@ag-grid-enterprise/row-grouping",yc="@ag-grid-enterprise/server-side-row-model",Sc="@ag-grid-enterprise/side-bar",kc={dispatchEvent:cc,getState:cc,getGridId:cc,destroy:cc,isDestroyed:cc,getGridOption:cc,setGridOption:cc,updateGridOptions:cc,setNodesSelected:cc,selectAll:cc,deselectAll:cc,selectAllFiltered:cc,deselectAllFiltered:cc,selectAllOnCurrentPage:cc,deselectAllOnCurrentPage:cc,getSelectedNodes:cc,getSelectedRows:cc,redrawRows:cc,setRowNodeExpanded:cc,getRowNode:cc,addRenderedRowListener:cc,getRenderedNodes:cc,forEachNode:cc,getFirstDisplayedRow:cc,getFirstDisplayedRowIndex:cc,getLastDisplayedRow:cc,getLastDisplayedRowIndex:cc,getDisplayedRowAtIndex:cc,getDisplayedRowCount:cc,getModel:cc,getVerticalPixelRange:cc,getHorizontalPixelRange:cc,ensureColumnVisible:cc,ensureIndexVisible:cc,ensureNodeVisible:cc,getFocusedCell:cc,clearFocusedCell:cc,setFocusedCell:cc,tabToNextCell:cc,tabToPreviousCell:cc,setFocusedHeader:cc,addEventListener:cc,addGlobalListener:cc,removeEventListener:cc,removeGlobalListener:cc,expireValueCache:cc,getValue:cc,getCellValue:cc,showColumnMenuAfterButtonClick:cc,showColumnMenuAfterMouseClick:cc,showColumnMenu:cc,hidePopupMenu:cc,onSortChanged:cc,getPinnedTopRowCount:cc,getPinnedBottomRowCount:cc,getPinnedTopRow:cc,getPinnedBottomRow:cc,showLoadingOverlay:cc,showNoRowsOverlay:cc,hideOverlay:cc,setGridAriaProperty:cc,refreshCells:cc,flashCells:cc,refreshHeader:cc,isAnimationFrameQueueEmpty:cc,flushAllAnimationFrames:cc,getSizesForCurrentTheme:cc,getCellRendererInstances:cc,addRowDropZone:cc,removeRowDropZone:cc,getRowDropZoneParams:cc,getColumnDef:cc,getColumnDefs:cc,sizeColumnsToFit:cc,setColumnGroupOpened:cc,getColumnGroup:cc,getProvidedColumnGroup:cc,getDisplayNameForColumn:cc,getDisplayNameForColumnGroup:cc,getColumn:cc,getColumns:cc,applyColumnState:cc,getColumnState:cc,resetColumnState:cc,getColumnGroupState:cc,setColumnGroupState:cc,resetColumnGroupState:cc,is';
      S = S + "Pinning:cc,isPinningLeft:cc,isPinningRight:cc,getDisplayedColAfter:cc,getDisplayedColBefore:cc,setColumnVisible:cc,setColumnsVisible:cc,setColumnPinned:cc,setColumnsPinned:cc,getAllGridColumns:cc,getDisplayedLeftColumns:cc,getDisplayedCenterColumns:cc,getDisplayedRightColumns:cc,getAllDisplayedColumns:cc,getAllDisplayedVirtualColumns:cc,moveColumn:cc,moveColumnByIndex:cc,moveColumns:cc,setColumnWidth:cc,setColumnWidths:cc,getLeftDisplayedColumnGroups:cc,getCenterDisplayedColumnGroups:cc,getRightDisplayedColumnGroups:cc,getAllDisplayedColumnGroups:cc,autoSizeColumn:cc,autoSizeColumns:cc,autoSizeAllColumns:cc,undoCellEditing:cc,redoCellEditing:cc,getCellEditorInstances:cc,getEditingCells:cc,stopEditing:cc,startEditingCell:cc,getCurrentUndoSize:cc,getCurrentRedoSize:cc,isAnyFilterPresent:cc,onFilterChanged:cc,isColumnFilterPresent:cc,getFilterInstance:cc,getColumnFilterInstance:cc,destroyFilter:cc,setFilterModel:cc,getFilterModel:cc,getColumnFilterModel:cc,setColumnFilterModel:cc,showColumnFilter:cc,isQuickFilterPresent:cc,getQuickFilter:cc,resetQuickFilter:cc,paginationIsLastPageFound:cc,paginationGetPageSize:cc,paginationGetCurrentPage:cc,paginationGetTotalPages:cc,paginationGetRowCount:cc,paginationGoToNextPage:cc,paginationGoToPreviousPage:cc,paginationGoToFirstPage:cc,paginationGoToLastPage:cc,paginationGoToPage:cc,expandAll:cc,collapseAll:cc,onRowHeightChanged:cc,setRowCount:cc,getCacheBlockState:cc,onGroupExpandedOrCollapsed:gc,refreshClientSideRowModel:gc,forEachLeafNode:gc,forEachNodeAfterFilter:gc,forEachNodeAfterFilterAndSort:gc,resetRowHeights:gc,applyTransaction:gc,applyTransactionAsync:gc,flushAsyncTransactions:gc,getBestCostNodeSelection:gc,getDataAsCsv:dc,exportDataAsCsv:dc,refreshInfiniteCache:hc,purgeInfiniteCache:hc,getInfiniteRowCount:hc,isLastRowIndexKnown:hc,getAdvancedFilterModel:uc,setAdvancedFilterModel:uc,showAdvancedFilterBuilder:uc,hideAdvancedFilterBuilder:uc,getChartModels:pc,getChartRef:pc,getChartImageDataURL:pc,downloadChart:pc,openChar";
      S = S + 'tToolPanel:pc,closeChartToolPanel:pc,createRangeChart:pc,createPivotChart:pc,createCrossFilterChart:pc,updateChart:pc,restoreChart:pc,copyToClipboard:mc,cutToClipboard:mc,copySelectedRowsToClipboard:mc,copySelectedRangeToClipboard:mc,copySelectedRangeDown:mc,pasteFromClipboard:mc,getDataAsExcel:fc,exportDataAsExcel:fc,getSheetDataForExcel:fc,getMultipleSheetsAsExcel:fc,exportMultipleSheetsAsExcel:fc,addDetailGridInfo:vc,removeDetailGridInfo:vc,getDetailGridInfo:vc,forEachDetailGridInfo:vc,showContextMenu:bc,showColumnChooser:bc,hideColumnChooser:bc,getCellRanges:Cc,addCellRange:Cc,clearRangeSelection:Cc,addAggFunc:wc,addAggFuncs:wc,clearAggFuncs:wc,setColumnAggFunc:wc,isPivotMode:wc,getPivotResultColumn:wc,setValueColumns:wc,getValueColumns:wc,removeValueColumn:wc,removeValueColumns:wc,addValueColumn:wc,addValueColumns:wc,setRowGroupColumns:wc,removeRowGroupColumn:wc,removeRowGroupColumns:wc,addRowGroupColumn:wc,addRowGroupColumns:wc,getRowGroupColumns:wc,moveRowGroupColumn:wc,setPivotColumns:wc,removePivotColumn:wc,removePivotColumns:wc,addPivotColumn:wc,addPivotColumns:wc,getPivotColumns:wc,setPivotResultColumns:wc,getPivotResultColumns:wc,getServerSideSelectionState:yc,setServerSideSelectionState:yc,applyServerSideTransaction:yc,applyServerSideTransactionAsync:yc,applyServerSideRowData:yc,retryServerSideLoads:yc,flushServerSideAsyncTransactions:yc,refreshServerSide:yc,getServerSideGroupLevelState:yc,isSideBarVisible:Sc,setSideBarVisible:Sc,setSideBarPosition:Sc,openToolPanel:Sc,closeToolPanel:Sc,getOpenedToolPanel:Sc,refreshToolPanel:Sc,isToolPanelShowing:Sc,getToolPanelInstance:Sc,getSideBar:Sc,getStatusPanel:"@ag-grid-enterprise/status-bar"},xc="clientSide",Rc="serverSide",zc="infinite",Fc={onGroupExpandedOrCollapsed:[xc],refreshClientSideRowModel:[xc],forEachLeafNode:[xc],forEachNodeAfterFilter:[xc],forEachNodeAfterFilterAndSort:[xc],resetRowHeights:[xc],applyTransaction:[xc],applyTransactionAsync:[xc],flushAsyncTransactions:[xc],getBestCostNodeSelection:[xc],';
      S = S + 'getServerSideSelectionState:[Rc],setServerSideSelectionState:[Rc],applyServerSideTransaction:[Rc],applyServerSideTransactionAsync:[Rc],applyServerSideRowData:[Rc],retryServerSideLoads:[Rc],flushServerSideAsyncTransactions:[Rc],refreshServerSide:[Rc],getServerSideGroupLevelState:[Rc],refreshInfiniteCache:[zc],purgeInfiniteCache:[zc],getInfiniteRowCount:[zc],isLastRowIndexKnown:[zc],expandAll:[xc,Rc],collapseAll:[xc,Rc],onRowHeightChanged:[xc,Rc],setRowCount:[zc,Rc],getCacheBlockState:[zc,Rc]},Mc={getValue:{version:"v31.3",new:"getCellValue"},getFirstDisplayedRow:{version:"v31.1",new:"getFirstDisplayedRowIndex"},getLastDisplayedRow:{version:"v31.1",new:"getLastDisplayedRowIndex"},getModel:{version:"v31.1",message:"Please use the appropriate grid API methods instead."},setColumnVisible:{version:"v31.1",old:"setColumnVisible(key,visible)",new:"setColumnsVisible([key],visible)"},setColumnPinned:{version:"v31.1",old:"setColumnPinned(key,pinned)",new:"setColumnsPinned([key],pinned)"},moveColumn:{version:"v31.1",old:"moveColumn(key, toIndex)",new:"moveColumns([key], toIndex)"},setColumnWidth:{version:"v31.1",old:"setColumnWidth(col, width)",new:"setColumnWidths([{key: col, newWidth: width}])"},autoSizeColumn:{version:"v31.1",old:"autoSizeColumn(key, skipHeader)",new:"autoSizeColumns([key], skipHeader)"},addAggFunc:{version:"v31.1",old:"addAggFunc(key, func)",new:"addAggFuncs({ key: func })"},removeValueColumn:{version:"v31.1",old:"removeValueColumn(colKey)",new:"removeValueColumns([colKey])"},addValueColumn:{version:"v31.1",old:"addValueColumn(colKey)",new:"addValueColumns([colKey])"},removeRowGroupColumn:{version:"v31.1",old:"removeRowGroupColumn(colKey)",new:"removeRowGroupColumns([colKey])"},addRowGroupColumn:{version:"v31.1",old:"addRowGroupColumn(colKey)",new:"addRowGroupColumns([colKey])"},removePivotColumn:{version:"v31.1",old:"removePivotColumn(colKey)",new:"removePivotColumns([colKey])"},addPivotColumn:{version:"v31.1",old:"addPivotColumn(colKey)",new:"addPivotColu';
      S = S + 'mns([colKey])"},showColumnMenuAfterButtonClick:{version:"v31.1",message:"Use \'IHeaderParams.showColumnMenu\' within a header component, or \'api.showColumnMenu\' elsewhere."},showColumnMenuAfterMouseClick:{version:"v31.1",message:"Use \'IHeaderParams.showColumnMenuAfterMouseClick\' within a header component, or \'api.showColumnMenu\' elsewhere."},getFilterInstance:{version:"v31.1",message:"\'getFilterInstance\' is deprecated. To get/set individual filter models, use \'getColumnFilterModel\' or \'setColumnFilterModel\' instead. To get hold of the filter instance, use \'getColumnFilterInstance\' which returns the instance asynchronously."},showLoadingOverlay:{version:"v32",message:\'`showLoadingOverlay` is deprecated. Use the grid option "loading"=true instead or setGridOption("loading", true).\'}};var Dc=(e,t)=>"clientSide"===(t.rowModelType??"clientSide")?{module:"@ag-grid-enterprise/row-grouping"}:null,Ec={enableRowGroup:Dc,rowGroup:Dc,rowGroupIndex:Dc,enablePivot:Dc,enableValue:Dc,pivot:Dc,pivotIndex:Dc,aggFunc:Dc,cellEditor:e=>"agRichSelect"===e.cellEditor||"agRichSelectCellEditor"===e.cellEditor?{module:"@ag-grid-enterprise/rich-select"}:null,menuTabs:e=>{const t=["columnsMenuTab","generalMenuTab"];return e.menuTabs?.some((e=>t.includes(e)))?{module:"@ag-grid-enterprise/menu"}:null},columnsMenuParams:{module:["@ag-grid-enterprise/menu","@ag-grid-enterprise/column-tool-panel"]},columnChooserParams:{module:["@ag-grid-enterprise/menu","@ag-grid-enterprise/column-tool-panel"]},headerCheckboxSelection:{supportedRowModels:["clientSide","serverSide"],dependencies:(e,{rowSelection:t})=>"multiple"===t?null:"headerCheckboxSelection is only supported with rowSelection=multiple"},headerCheckboxSelectionFilteredOnly:{supportedRowModels:["clientSide"],dependencies:(e,{rowSelection:t})=>"multiple"===t?null:"headerCheckboxSelectionFilteredOnly is only supported with rowSelection=multiple"},headerCheckboxSelectionCurrentPageOnly:{supportedRowModels:["clientSide"],dependencies:(e,{rowSelection:t}';
      S = S + ')=>"multiple"===t?null:"headerCheckboxSelectionCurrentPageOnly is only supported with rowSelection=multiple"},children:()=>Pc},Pc={objectName:"colDef",allProperties:Object.keys({headerName:void 0,columnGroupShow:void 0,headerClass:void 0,toolPanelClass:void 0,headerValueGetter:void 0,pivotKeys:void 0,groupId:void 0,colId:void 0,sort:void 0,initialSort:void 0,field:void 0,type:void 0,cellDataType:void 0,tooltipComponent:void 0,tooltipField:void 0,headerTooltip:void 0,cellClass:void 0,showRowGroup:void 0,filter:void 0,initialAggFunc:void 0,defaultAggFunc:void 0,aggFunc:void 0,pinned:void 0,initialPinned:void 0,chartDataType:void 0,cellAriaRole:void 0,cellEditorPopupPosition:void 0,headerGroupComponent:void 0,headerGroupComponentParams:void 0,cellStyle:void 0,cellRenderer:void 0,cellRendererParams:void 0,cellEditor:void 0,cellEditorParams:void 0,filterParams:void 0,pivotValueColumn:void 0,headerComponent:void 0,headerComponentParams:void 0,floatingFilterComponent:void 0,floatingFilterComponentParams:void 0,tooltipComponentParams:void 0,refData:void 0,columnsMenuParams:void 0,columnChooserParams:void 0,children:void 0,sortingOrder:void 0,allowedAggFuncs:void 0,menuTabs:void 0,pivotTotalColumnIds:void 0,cellClassRules:void 0,icons:void 0,sortIndex:void 0,initialSortIndex:void 0,flex:void 0,initialFlex:void 0,width:void 0,initialWidth:void 0,minWidth:void 0,maxWidth:void 0,rowGroupIndex:void 0,initialRowGroupIndex:void 0,pivotIndex:void 0,initialPivotIndex:void 0,suppressCellFlash:void 0,suppressColumnsToolPanel:void 0,suppressFiltersToolPanel:void 0,openByDefault:void 0,marryChildren:void 0,suppressStickyLabel:void 0,hide:void 0,initialHide:void 0,rowGroup:void 0,initialRowGroup:void 0,pivot:void 0,initialPivot:void 0,checkboxSelection:void 0,showDisabledCheckboxes:void 0,headerCheckboxSelection:void 0,headerCheckboxSelectionFilteredOnly:void 0,headerCheckboxSelectionCurrentPageOnly:void 0,suppressMenu:void 0,suppressHeaderMenuButton:void 0,suppressMovable:void 0,lockPos';
      S = S + 'ition:void 0,lockVisible:void 0,lockPinned:void 0,unSortIcon:void 0,suppressSizeToFit:void 0,suppressAutoSize:void 0,enableRowGroup:void 0,enablePivot:void 0,enableValue:void 0,editable:void 0,suppressPaste:void 0,suppressNavigable:void 0,enableCellChangeFlash:void 0,rowDrag:void 0,dndSource:void 0,autoHeight:void 0,wrapText:void 0,sortable:void 0,resizable:void 0,singleClickEdit:void 0,floatingFilter:void 0,cellEditorPopup:void 0,suppressFillHandle:void 0,wrapHeaderText:void 0,autoHeaderHeight:void 0,dndSourceOnRowDrag:void 0,valueGetter:void 0,valueSetter:void 0,filterValueGetter:void 0,keyCreator:void 0,valueFormatter:void 0,valueParser:void 0,comparator:void 0,equals:void 0,pivotComparator:void 0,suppressKeyboardEvent:void 0,suppressHeaderKeyboardEvent:void 0,colSpan:void 0,rowSpan:void 0,getQuickFilterText:void 0,onCellValueChanged:void 0,onCellClicked:void 0,onCellDoubleClicked:void 0,onCellContextMenu:void 0,rowDragText:void 0,tooltipValueGetter:void 0,cellRendererSelector:void 0,cellEditorSelector:void 0,suppressSpanHeaderHeight:void 0,useValueFormatterForExport:void 0,useValueParserForImport:void 0,mainMenuItems:void 0,contextMenuItems:void 0,suppressFloatingFilterButton:void 0,suppressHeaderFilterButton:void 0,suppressHeaderContextMenu:void 0,loadingCellRenderer:void 0,loadingCellRendererParams:void 0,loadingCellRendererSelector:void 0,context:void 0}),docsUrl:"column-properties/",deprecations:{columnsMenuParams:{version:"31.1",message:"Use `columnChooserParams` instead."},suppressMenu:{version:"31.1",message:"Use `suppressHeaderMenuButton` instead."},suppressCellFlash:{version:"31.2",message:"Use `enableCellChangeFlash={false}` in the ColDef"}},validations:Ec},Ac={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!0,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2e3,tooltipHideDelay:1e4,tooltipMouseTrack:!1,tooltipShowMode:"standard",tooltipInteraction:!1,copyHeadersToClipboard:!1,co';
      S = S + 'pyGroupHeadersToClipboard:!1,clipboardDelimiter:"\\t",suppressCopyRowsToClipboard:!1,suppressCopySingleCellRanges:!1,suppressLastEmptyLineOnPaste:!1,suppressClipboardPaste:!1,suppressClipboardApi:!1,suppressCutToClipboard:!1,maintainColumnOrder:!1,suppressFieldDotNotation:!1,allowDragFromColumnsToolPanel:!1,suppressMovableColumns:!1,suppressColumnMoveAnimation:!1,suppressDragLeaveHidesColumns:!1,suppressRowGroupHidesColumns:!1,suppressAutoSize:!1,autoSizePadding:20,skipHeaderOnAutoSize:!1,singleClickEdit:!1,suppressClickEdit:!1,readOnlyEdit:!1,stopEditingWhenCellsLoseFocus:!1,enterNavigatesVertically:!1,enterNavigatesVerticallyAfterEdit:!1,enableCellEditingOnBackspace:!1,undoRedoCellEditing:!1,undoRedoCellEditingLimit:10,suppressCsvExport:!1,suppressExcelExport:!1,cacheQuickFilter:!1,includeHiddenColumnsInQuickFilter:!1,excludeChildrenWhenTreeDataFiltering:!1,enableAdvancedFilter:!1,includeHiddenColumnsInAdvancedFilter:!1,enableCharts:!1,masterDetail:!1,keepDetailRows:!1,keepDetailRowsCount:10,detailRowAutoHeight:!1,tabIndex:0,rowBuffer:10,valueCache:!1,valueCacheNeverExpires:!1,enableCellExpressions:!1,suppressTouch:!1,suppressFocusAfterRefresh:!1,suppressAsyncEvents:!1,suppressBrowserResizeObserver:!1,suppressPropertyNamesCheck:!1,suppressChangeDetection:!1,debug:!1,suppressLoadingOverlay:!1,suppressNoRowsOverlay:!1,pagination:!1,paginationPageSize:100,paginationPageSizeSelector:!0,paginationAutoPageSize:!1,paginateChildRows:!1,suppressPaginationPanel:!1,pivotMode:!1,pivotPanelShow:"never",pivotDefaultExpanded:0,pivotSuppressAutoColumn:!1,suppressExpandablePivotGroups:!1,functionsReadOnly:!1,suppressAggFuncInHeader:!1,alwaysAggregateAtRootLevel:!1,aggregateOnlyChangedColumns:!1,suppressAggFilteredOnly:!1,removePivotHeaderRowWhenSingleValueColumn:!1,animateRows:!0,enableCellChangeFlash:!1,cellFlashDelay:500,cellFlashDuration:500,cellFadeDelay:1e3,cellFadeDuration:1e3,allowShowChangeAfterFilter:!1,domLayout:"normal",ensureDomOrder:!1,enableRtl:!1,suppressColumnVirtua';
      S = S + 'lisation:!1,suppressMaxRenderedRowRestriction:!1,suppressRowVirtualisation:!1,rowDragManaged:!1,suppressRowDrag:!1,suppressMoveWhenRowDragging:!1,rowDragEntireRow:!1,rowDragMultiRow:!1,embedFullWidthRows:!1,groupDisplayType:"singleColumn",groupDefaultExpanded:0,groupMaintainOrder:!1,groupSelectsChildren:!1,groupIncludeTotalFooter:!1,groupSuppressBlankHeader:!1,groupSelectsFiltered:!1,showOpenedGroup:!1,groupRemoveSingleChildren:!1,groupRemoveLowestSingleChildren:!1,groupHideOpenParents:!1,groupAllowUnbalanced:!1,rowGroupPanelShow:"never",suppressMakeColumnVisibleAfterUnGroup:!1,treeData:!1,rowGroupPanelSuppressSort:!1,suppressGroupRowsSticky:!1,rowModelType:"clientSide",asyncTransactionWaitMillis:50,suppressModelUpdateAfterUpdateTransaction:!1,cacheOverflowSize:1,infiniteInitialRowCount:1,serverSideInitialRowCount:1,suppressServerSideInfiniteScroll:!1,cacheBlockSize:100,maxBlocksInCache:-1,maxConcurrentDatasourceRequests:2,blockLoadDebounceMillis:0,purgeClosedRowNodes:!1,serverSideSortAllLevels:!1,serverSideOnlyRefreshFilteredGroups:!1,serverSideSortOnServer:!1,serverSideFilterOnServer:!1,serverSidePivotResultFieldSeparator:"_",viewportRowModelPageSize:5,viewportRowModelBufferSize:5,alwaysShowHorizontalScroll:!1,alwaysShowVerticalScroll:!1,debounceVerticalScrollbar:!1,suppressHorizontalScroll:!1,suppressScrollOnNewData:!1,suppressScrollWhenPopupsAreOpen:!1,suppressAnimationFrame:!1,suppressMiddleClickScrolls:!1,suppressPreventDefaultOnMouseWheel:!1,rowMultiSelectWithClick:!1,suppressRowDeselection:!1,suppressRowClickSelection:!1,suppressCellFocus:!1,suppressHeaderFocus:!1,suppressMultiRangeSelection:!1,enableCellTextSelection:!1,enableRangeSelection:!1,enableRangeHandle:!1,enableFillHandle:!1,fillHandleDirection:"xy",suppressClearOnFillReduction:!1,accentedSort:!1,unSortIcon:!1,suppressMultiSort:!1,alwaysMultiSort:!1,suppressMaintainUnsortedOrder:!1,suppressRowHoverHighlight:!1,suppressRowTransform:!1,columnHoverHighlight:!1,deltaSort:!1,enableGroupEdit:!1,suppressG';
      S = S + 'roupMaintainValueType:!1,groupLockGroupColumns:0,serverSideEnableClientSideSort:!1,suppressServerSideFullWidthLoadingRow:!1,pivotMaxGeneratedColumns:-1,columnMenu:"new",reactiveCustomComponents:!0},Tc={version:gr,moduleName:"@ag-grid-community/core"},Ic={version:gr,moduleName:"@ag-grid-community/core-validations",beans:[class extends A{constructor(){super(...arguments),this.beanName="validationService"}wireBeans(e){this.beans=e,this.gridOptions=e.gridOptions}postConstruct(){this.processGridOptions(this.gridOptions)}processGridOptions(e){this.processOptions(e,{objectName:"gridOptions",allProperties:[...at.ALL_PROPERTIES,...ot.EVENT_CALLBACKS],propertyExceptions:["api"],docsUrl:"grid-options/",deprecations:{advancedFilterModel:{version:"31",message:"Use `initialState.filter.advancedFilterModel` instead."},suppressAsyncEvents:{version:"31",message:"Events should be handled asynchronously."},cellFadeDelay:{version:"31.1",renamed:"cellFadeDuration"},cellFlashDelay:{version:"31.1",renamed:"cellFlashDuration"},suppressServerSideInfiniteScroll:{version:"31.1"},serverSideSortOnServer:{version:"31.1"},serverSideFilterOnServer:{version:"31.1"},enableCellChangeFlash:{version:"31.2",message:"Use `enableCellChangeFlash` in the `ColDef` or `defaultColDef` for all columns."},groupIncludeFooter:{version:"31.3",message:"Use `groupTotalRow` instead."},groupIncludeTotalFooter:{version:"31.3",message:"Use `grandTotalRow` instead."},suppressLoadingOverlay:{version:"32",message:"Use `loading`=false instead."}},validations:{sideBar:{module:"@ag-grid-enterprise/side-bar"},statusBar:{module:"@ag-grid-enterprise/status-bar"},enableCharts:{module:"@ag-grid-enterprise/charts"},getMainMenuItems:{module:"@ag-grid-enterprise/menu"},getContextMenuItems:{module:"@ag-grid-enterprise/menu"},allowContextMenuWithControlKey:{module:"@ag-grid-enterprise/menu"},enableAdvancedFilter:{module:"@ag-grid-enterprise/advanced-filter"},treeData:{supportedRowModels:["clientSide","serverSide"],module:"@ag-grid-enter';
      S = S + 'prise/row-grouping",dependencies:e=>{const t=e.rowModelType??"clientSide";switch(t){case"clientSide":{const a=`treeData requires \'getDataPath\' in the ${t} row model.`;return e.getDataPath?null:a}case"serverSide":{const a=`treeData requires \'isServerSideGroup\' and \'getServerSideGroupKey\' in the ${t} row model.`;return e.isServerSideGroup&&e.getServerSideGroupKey?null:a}}return null}},masterDetail:{module:"@ag-grid-enterprise/master-detail"},enableRangeSelection:{module:"@ag-grid-enterprise/range-selection"},enableRangeHandle:{dependencies:{enableRangeSelection:[!0]}},enableFillHandle:{dependencies:{enableRangeSelection:[!0]}},groupDefaultExpanded:{supportedRowModels:["clientSide"]},groupIncludeFooter:{supportedRowModels:["clientSide","serverSide"],dependencies:e=>{switch(e.rowModelType??"clientSide"){case"clientSide":return null;case"serverSide":{const t="groupIncludeFooter is not supported alongside suppressServerSideInfiniteScroll";return e.suppressServerSideInfiniteScroll?t:null}}return null}},groupHideOpenParents:{supportedRowModels:["clientSide"],dependencies:{groupTotalRow:[void 0,"bottom"]}},groupIncludeTotalFooter:{supportedRowModels:["clientSide"]},groupRemoveSingleChildren:{dependencies:{groupHideOpenParents:[void 0,!1],groupRemoveLowestSingleChildren:[void 0,!1]}},groupRemoveLowestSingleChildren:{dependencies:{groupHideOpenParents:[void 0,!1],groupRemoveSingleChildren:[void 0,!1]}},groupSelectsChildren:{dependencies:{rowSelection:["multiple"]}},viewportDatasource:{supportedRowModels:["viewport"],module:"@ag-grid-enterprise/viewport-row-model"},serverSideDatasource:{supportedRowModels:["serverSide"],module:"@ag-grid-enterprise/server-side-row-model"},cacheBlockSize:{supportedRowModels:["serverSide","infinite"]},datasource:{supportedRowModels:["infinite"],module:"@ag-grid-community/infinite-row-model"},rowData:{supportedRowModels:["clientSide"],module:"@ag-grid-community/client-side-row-model"},columnDefs:()=>Pc,defaultColDef:()=>Pc,defaultColGroupDef:()=>Pc';
      S = S + ',autoGroupColumnDef:()=>Pc}})}processColumnDefs(e){this.processOptions(e,Pc)}warnMissingApiFunction(e){!function(e,t){const a=kc[e];a?Xa.__assertRegistered(a,`api.${e}`,t)&&ce(`API function \'${e}\' not registered to module \'${a}\'`):ge(`Unknown API function: \'${e}\' on GridApi.`)}(e,this.gridId)}validateApiFunction(e,t){return function(e,t,a){const n=Mc[e];if(n){const{version:a,new:o,old:r,message:i}=n,s=r??e;return(...e)=>(ce(`Since ${a} api.${s} is deprecated. ${o?`Please use ${o} instead. `:""}${i??""}`),t.apply(t,e))}const o=Fc[e];return o?(...n)=>{const r=a.rowModel.getType();if(o.includes(r))return t.apply(t,n);ge(`api.${e} can only be called when gridOptions.rowModelType is ${o.join(" or ")}`)}:t}(e,t,this.beans)}processOptions(e,t){const{validations:a,deprecations:n,allProperties:o,propertyExceptions:r,objectName:i,docsUrl:s}=t;o&&!0!==this.gridOptions.suppressPropertyNamesCheck&&this.checkProperties(e,[...r??[],...Object.keys(n)],o,i,s);const l=new Set;Object.keys(e).forEach((t=>{const o=n[t];if(o)if("renamed"in o){const{renamed:a,version:n}=o;l.add(`As of v${n}, ${String(t)} is deprecated. Please use ${String(a)} instead.`),e[a]=e[t]}else{const{message:e,version:a}=o;l.add(`As of v${a}, ${String(t)} is deprecated. ${e??""}`)}const r=e[t];if(null==r||!1===r)return;const i=a[t];let s;if(!i)return;if("function"==typeof i){const a=i(e,this.gridOptions);if(!a)return;if("objectName"in a){const n=e[t];return Array.isArray(n)?void n.forEach((e=>{this.processOptions(e,a)})):void this.processOptions(e[t],a)}s=a}else s=i;const{module:c,dependencies:g,supportedRowModels:d}=s;if(d){const e=this.gridOptions.rowModelType??"clientSide";if(!d.includes(e))return void l.add(`${String(t)} is not supported with the \'${e}\' row model.`)}if(c){const e=Array.isArray(c)?c:[c];let a=!0;if(e.forEach((e=>{Xa.__assertRegistered(e,String(t),this.gridId)||(a=!1,l.add(`${String(t)} is only available when ${e} is loaded.`))})),!a)return}if(g){const a=this.checkForWarning(t,g,e);if(a)return vo';
      S = S + 'id l.add(a)}})),l.size>0&&l.forEach((e=>{ce(e)}))}checkForWarning(e,t,a){if("function"==typeof t)return t(a,this.gridOptions);const n=Object.entries(t).find((([e,t])=>{const n=a[e];return!t.includes(n)}));if(!n)return null;const[o,r]=n;return r.length>1?`\'${String(e)}\' requires \'${o}\' to be one of [${r.join(", ")}].`:`\'${String(e)}\' requires \'${o}\' to be ${r[0]}.`}checkProperties(e,t,a,n,o){const r=function(e,t,a){const n={},o=e.filter((e=>!t.some((t=>t===e))));return o.length>0&&o.forEach((e=>n[e]=fn(e,a).values)),n}(Object.getOwnPropertyNames(e),["__ob__","__v_skip","__metadata__",...t,...a],a);if(j(r,((e,t)=>{let o=`invalid ${n} property \'${e}\' did you mean any of these: ${t.slice(0,8).join(", ")}.`;a.includes("context")&&(o+=`\\nIf you are trying to annotate ${n} with application data, use the \'${n}.context\' property instead.`),ce(o)})),Object.keys(r).length>0&&o){const e=this.getFrameworkOverrides().getDocLink(o);ce(`to see all the valid ${n} properties please check: ${e}`)}}}]},Lc={version:gr,moduleName:"@ag-grid-community/core-community-features",dependantModules:[Tc,Ic,js,zr,nc,_l,jl,lc,tc]},Oc=class extends A{constructor(){super(...arguments),this.beanName="gridDestroyService",this.destroyCalled=!1}wireBeans(e){this.beans=e}destroy(){if(this.destroyCalled)return;const e={type:"gridPreDestroyed",state:this.beans.stateService?.getState()??{}};this.eventService.dispatchEvent(e),this.destroyCalled=!0,this.beans.ctrlsService.get("gridCtrl")?.destroyGridUi(),this.beans.context.destroy(),super.destroy()}isDestroyCalled(){return this.destroyCalled}},Nc=new Set(["gridPreDestroyed","fillStart","pasteStart"]),Gc=e=>"checkboxSelected"===e||"rowClicked"===e||"spaceKey"===e||"uiSelectAll"===e||"uiSelectAllCurrentPage"===e||"uiSelectAllFiltered"===e,qc=new Map([...at.BOOLEAN_PROPERTIES.map((e=>[e,H])),...at.NUMBER_PROPERTIES.map((e=>[e,Bo])),["groupAggFiltering",e=>"function"==typeof e?e:H(e)],["pageSize",Ho(1)],["autoSizePadding",Ho(0)],["keepDetailRowsCount",Ho(1)],["row';
      S = S + 'Buffer",Ho(0)],["infiniteInitialRowCount",Ho(1)],["cacheOverflowSize",Ho(1)],["cacheBlockSize",Ho(1)],["serverSideInitialRowCount",Ho(1)],["viewportRowModelPageSize",Ho(1)],["viewportRowModelBufferSize",Ho(0)]]);function Bc(e,t){const a=qc.get(e);return a?a(t):t}var Hc=class e extends A{constructor(){super(...arguments),this.beanName="gos",this.domDataKey="__AG_"+Math.random().toString(),this.propertyEventService=new c,this.globalEventHandlerFactory=e=>(t,a)=>{if(!this.isAlive())return;const n=Nc.has(t);if(n&&!e||!n&&e)return;const o=ot.getCallbackForEvent(t),r=this.gridOptions[o];"function"==typeof r&&this.frameworkOverrides.wrapOutgoing((()=>{r(a)}))}}wireBeans(e){this.gridOptions=e.gridOptions,this.eGridDiv=e.eGridDiv,this.validationService=e.validationService,this.environment=e.environment,this.api=e.gridApi}get gridOptionsContext(){return this.gridOptions.context}postConstruct(){const e=!this.get("suppressAsyncEvents");this.eventService.addGlobalListener(this.globalEventHandlerFactory().bind(this),e),this.eventService.addGlobalListener(this.globalEventHandlerFactory(!0).bind(this),!1),this.propertyEventService.setFrameworkOverrides(this.frameworkOverrides),this.getScrollbarWidth(),this.addManagedEventListeners({gridOptionsChanged:({options:e})=>{this.updateGridOptions({options:e,force:!0,source:"gridOptionsUpdated"})}})}get(e){return this.gridOptions[e]??Ac[e]}getCallback(e){return this.mergeGridCommonParams(this.gridOptions[e])}exists(e){return L(this.gridOptions[e])}mergeGridCommonParams(e){if(e){return t=>{const a=t;return a.api=this.api,a.context=this.gridOptionsContext,e(a)}}return e}updateGridOptions({options:t,force:a,source:n="api"}){const o={id:e.changeSetId++,properties:[]},r=[];Object.entries(t).forEach((([e,t])=>{"api"===n&&et[e]&&ce(`${e} is an initial property and cannot be updated.`);const i=Bc(e,t),s=a||"object"==typeof i&&"api"===n,l=this.gridOptions[e];if(s||l!==i){this.gridOptions[e]=i;const t={type:e,currentValue:i,previousValue:l,changeSet:';
      S = S + 'o,source:n};r.push(t)}})),this.validationService?.processGridOptions(this.gridOptions),o.properties=r.map((e=>e.type)),r.forEach((e=>{this.gridOptions.debug&&le(`Updated property ${e.type} from`,e.previousValue," to ",e.currentValue),this.propertyEventService.dispatchEvent(e)}))}addPropertyEventListener(e,t){this.propertyEventService.addEventListener(e,t)}removePropertyEventListener(e,t){this.propertyEventService.removeEventListener(e,t)}getScrollbarWidth(){if(null==this.scrollbarWidth){const e="number"==typeof this.gridOptions.scrollbarWidth&&this.gridOptions.scrollbarWidth>=0?this.gridOptions.scrollbarWidth:(null==pt&&ea(),pt);null!=e&&(this.scrollbarWidth=e,this.eventService.dispatchEvent({type:"scrollbarWidthChanged"}))}return this.scrollbarWidth}isRowModelType(e){return this.gridOptions.rowModelType===e||"clientSide"===e&&O(this.gridOptions.rowModelType)}isDomLayout(e){return(this.gridOptions.domLayout??"normal")===e}isRowSelection(){return"single"===this.gridOptions.rowSelection||"multiple"===this.gridOptions.rowSelection}useAsyncEvents(){return!this.get("suppressAsyncEvents")}isGetRowHeightFunction(){return"function"==typeof this.gridOptions.getRowHeight}getRowHeightForNode(e,t=!1,a){if(null==a&&(a=this.environment.getDefaultRowHeight()),this.isGetRowHeightFunction()){if(t)return{height:a,estimated:!0};const n={node:e,data:e.data},o=this.getCallback("getRowHeight")(n);if(this.isNumeric(o))return 0===o&&ce("The return of `getRowHeight` cannot be zero. If the intention is to hide rows, use a filter instead."),{height:Math.max(1,o),estimated:!1}}if(e.detail&&this.get("masterDetail"))return this.getMasterDetailRowHeight();return{height:this.gridOptions.rowHeight&&this.isNumeric(this.gridOptions.rowHeight)?this.gridOptions.rowHeight:a,estimated:!1}}getMasterDetailRowHeight(){return this.get("detailRowAutoHeight")?{height:1,estimated:!1}:this.isNumeric(this.gridOptions.detailRowHeight)?{height:this.gridOptions.detailRowHeight,estimated:!1}:{height:300,estimated:!1}';
      S = S + '}getRowHeightAsNumber(){if(!this.gridOptions.rowHeight||O(this.gridOptions.rowHeight))return this.environment.getDefaultRowHeight();const e=this.environment.refreshRowHeightVariable();return-1!==e?e:(ce("row height must be a number if not using standard row model"),this.environment.getDefaultRowHeight())}isNumeric(e){return!isNaN(e)&&"number"==typeof e&&isFinite(e)}getDomDataKey(){return this.domDataKey}getDomData(e,t){const a=e[this.getDomDataKey()];return a?a[t]:void 0}setDomData(e,t,a){const n=this.getDomDataKey();let o=e[n];O(o)&&(o={},e[n]=o),o[t]=a}getDocument(){let e=null;return this.gridOptions.getDocument&&L(this.gridOptions.getDocument)?e=this.gridOptions.getDocument():this.eGridDiv&&(e=this.eGridDiv.ownerDocument),e&&L(e)?e:document}getWindow(){return this.getDocument().defaultView||window}getRootNode(){return this.eGridDiv.getRootNode()}getActiveDomElement(){return this.getRootNode().activeElement}getAsyncTransactionWaitMillis(){return L(this.gridOptions.asyncTransactionWaitMillis)?this.gridOptions.asyncTransactionWaitMillis:50}isAnimateRows(){return!this.get("ensureDomOrder")&&this.get("animateRows")}isGroupRowsSticky(){return!(this.get("paginateChildRows")||this.get("groupHideOpenParents")||this.isDomLayout("print"))}isColumnsSortingCoupledToGroup(){const e=this.gridOptions.autoGroupColumnDef;return!e?.comparator&&!this.get("treeData")}getGroupAggFiltering(){const e=this.gridOptions.groupAggFiltering;return"function"==typeof e?this.getCallback("groupAggFiltering"):!0===e?()=>!0:void 0}getGrandTotalRow(){const e=this.gridOptions.grandTotalRow;if(e)return e;return this.gridOptions.groupIncludeTotalFooter?"bottom":void 0}getGroupTotalRowCallback(){const e=this.get("groupTotalRow");if("function"==typeof e)return this.getCallback("groupTotalRow");if(e)return()=>e;const t=this.get("groupIncludeFooter");if("function"==typeof t){const e=this.getCallback("groupIncludeFooter");return t=>e(t)?"bottom":void 0}return()=>t?"bottom":void 0}isGroupMultiAutoColumn(){re';
      S = S + 'turn this.gridOptions.groupDisplayType?"multipleColumns"===this.gridOptions.groupDisplayType:this.get("groupHideOpenParents")}isGroupUseEntireRow(e){return!e&&"groupRows"===this.gridOptions.groupDisplayType}getGridCommonParams(){return{api:this.api,context:this.gridOptionsContext}}addGridCommonParams(e){const t=e;return t.api=this.api,t.context=this.gridOptionsContext,t}getRowIdCallback(){const e=this.getCallback("getRowId");return void 0===e?e:t=>{let a=e(t);return"string"!=typeof a&&(ce(`The getRowId callback must return a string. The ID ${a} is being cast to a string.`),a=String(a)),a}}};Hc.changeSetId=0;var Vc=Hc,Wc=class extends A{constructor(){super(...arguments),this.beanName="headerPositionUtils"}wireBeans(e){this.visibleColsService=e.visibleColsService,this.ctrlsService=e.ctrlsService}findHeader(e,t){let a,n;if(Ke(e.column)?a=this.visibleColsService.getGroupAtDirection(e.column,t):(n=`getCol${t}`,a=this.visibleColsService[n](e.column)),!a)return;const{headerRowIndex:o}=e;if("filter"!==this.getHeaderRowType(o)){const e=[a];for(;a.getParent();)a=a.getParent(),e.push(a);a=e[e.length-1-o]}const{column:r,headerRowIndex:i}=this.getHeaderIndexToFocus(a,o);return{column:r,headerRowIndex:i}}getHeaderIndexToFocus(e,t){let a;if(Ke(e)&&this.isAnyChildSpanningHeaderHeight(e)&&e.isPadding()){const n=e;a=n.getLeafColumns()[0];let o=a;for(;o!==n;)t++,o=o.getParent()}return{column:a||e,headerRowIndex:t}}isAnyChildSpanningHeaderHeight(e){return!!e&&e.getLeafColumns().some((e=>e.isSpanHeaderHeight()))}getColumnVisibleParent(e,t){const a=this.getHeaderRowType(t),n="column"===a;let o="filter"===a?e:e.getParent(),r=t-1,i=r;if(n&&this.isAnyChildSpanningHeaderHeight(e.getParent())){for(;o&&o.isPadding();)o=o.getParent(),r--;i=r,r<0&&(o=e,r=t,i=void 0)}return{column:o,headerRowIndex:r,headerRowIndexWithoutSpan:i}}getColumnVisibleChild(e,t,a="After"){let n=e,o=t+1;const r=o;if("group"===this.getHeaderRowType(t)){const t=e.getDisplayedLeafColumns(),r="After"===a?t[0]:d(t),i=[];let s=';
      S = S + 'r;for(;s.getParent()!==e;)s=s.getParent(),i.push(s);if(n=r,r.isSpanHeaderHeight())for(let e=i.length-1;e>=0;e--){const t=i[e];if(!t.isPadding()){n=t;break}o++}else n=d(i),n||(n=r)}return{column:n,headerRowIndex:o,headerRowIndexWithoutSpan:r}}getHeaderRowType(e){const t=this.ctrlsService.getHeaderRowContainerCtrl();if(t)return t.getRowType(e)}findColAtEdgeForHeaderRow(e,t){const a=this.visibleColsService.getAllCols(),n=a["start"===t?0:a.length-1];if(!n)return;const o=this.ctrlsService.getHeaderRowContainerCtrl(n.getPinned()).getRowType(e);if("group"==o){return{headerRowIndex:e,column:this.visibleColsService.getColGroupAtLevel(n,e)}}return{headerRowIndex:null==o?-1:e,column:n}}},Uc=class extends A{constructor(){super(...arguments),this.beanName="localeService"}getLocaleTextFunc(){const e=this.gos.getCallback("getLocaleText");if(e)return(t,a,n)=>e({key:t,defaultValue:a,variableValues:n});const t=this.gos.get("localeText");return(e,a,n)=>{let o=t&&t[e];if(o&&n&&n.length){let e=0;for(;!(e>=n.length);){if(-1===o.indexOf("${variable}"))break;o=o.replace("${variable}",n[e++])}}return o??a}}},jc=class extends A{constructor(){super(...arguments),this.beanName="apiEventService",this.syncEventListeners=new Map,this.asyncEventListeners=new Map,this.syncGlobalEventListeners=new Set,this.globalEventListenerPairs=new Map}postConstruct(){this.frameworkEventWrappingService=new T(this.getFrameworkOverrides())}addEventListener(e,t){const a=this.frameworkEventWrappingService.wrap(t),n=this.gos.useAsyncEvents()&&!Nc.has(e),o=n?this.asyncEventListeners:this.syncEventListeners;o.has(e)||o.set(e,new Set),o.get(e).add(a),this.eventService.addEventListener(e,a,n)}removeEventListener(e,t){const a=this.frameworkEventWrappingService.unwrap(t),n=this.asyncEventListeners.get(e),o=!!n?.delete(a);o||this.syncEventListeners.get(e)?.delete(a),this.eventService.removeEventListener(e,a,o)}addGlobalListener(e){const t=this.frameworkEventWrappingService.wrapGlobal(e);if(this.gos.useAsyncEvents()){const a=';
      S = S + '(e,a)=>{Nc.has(e)&&t(e,a)},n=(e,a)=>{Nc.has(e)||t(e,a)};this.globalEventListenerPairs.set(e,{syncListener:a,asyncListener:n}),this.eventService.addGlobalListener(a,!1),this.eventService.addGlobalListener(n,!0)}else this.syncGlobalEventListeners.add(t),this.eventService.addGlobalListener(t,!1)}removeGlobalListener(e){const t=this.frameworkEventWrappingService.unwrapGlobal(e);if(this.globalEventListenerPairs.has(t)){const{syncListener:a,asyncListener:n}=this.globalEventListenerPairs.get(t);this.eventService.removeGlobalListener(a,!1),this.eventService.removeGlobalListener(n,!0),this.globalEventListenerPairs.delete(e)}else this.syncGlobalEventListeners.delete(t),this.eventService.removeGlobalListener(t,!1)}destroyEventListeners(e,t){e.forEach(((e,a)=>{e.forEach((e=>this.eventService.removeEventListener(a,e,t))),e.clear()})),e.clear()}destroyGlobalListeners(e,t){e.forEach((e=>this.eventService.removeGlobalListener(e,t))),e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncEventListeners,!1),this.destroyEventListeners(this.asyncEventListeners,!0),this.destroyGlobalListeners(this.syncGlobalEventListeners,!1),this.globalEventListenerPairs.forEach((({syncListener:e,asyncListener:t})=>{this.eventService.removeGlobalListener(e,!1),this.eventService.removeGlobalListener(t,!0)})),this.globalEventListenerPairs.clear()}},Kc=class extends A{constructor(){super(...arguments),this.beanName="pageBoundsListener"}wireBeans(e){this.rowModel=e.rowModel,this.paginationService=e.paginationService,this.pageBoundsService=e.pageBoundsService}postConstruct(){this.addManagedEventListeners({modelUpdated:this.onModelUpdated.bind(this),recalculateRowBounds:this.calculatePages.bind(this)}),this.onModelUpdated()}onModelUpdated(e){this.calculatePages();const t={type:"paginationChanged",animate:!!e&&e.animate,newData:!!e&&e.newData,newPage:!!e&&e.newPage,newPageSize:!!e&&e.newPageSize,keepRenderedRows:!!e&&e.keepRenderedRows};this.eventService.dispatchEvent(t)}calculatePages(){this';
      S = S + '.paginationService?this.paginationService.calculatePages():this.pageBoundsService.calculateBounds(0,this.rowModel.getRowCount()-1)}},Qc=class extends A{constructor(){super(...arguments),this.beanName="pageBoundsService",this.pixelOffset=0}wireBeans(e){this.rowModel=e.rowModel}getFirstRow(){return this.topRowBounds?this.topRowBounds.rowIndex:-1}getLastRow(){return this.bottomRowBounds?this.bottomRowBounds.rowIndex:-1}getCurrentPageHeight(){return O(this.topRowBounds)||O(this.bottomRowBounds)?0:Math.max(this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight-this.topRowBounds.rowTop,0)}getCurrentPagePixelRange(){return{pageFirstPixel:this.topRowBounds?this.topRowBounds.rowTop:0,pageLastPixel:this.bottomRowBounds?this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight:0}}calculateBounds(e,t){this.topRowBounds=this.rowModel.getRowBounds(e),this.topRowBounds&&(this.topRowBounds.rowIndex=e),this.bottomRowBounds=this.rowModel.getRowBounds(t),this.bottomRowBounds&&(this.bottomRowBounds.rowIndex=t),this.calculatePixelOffset()}getPixelOffset(){return this.pixelOffset}calculatePixelOffset(){const e=L(this.topRowBounds)?this.topRowBounds.rowTop:0;this.pixelOffset!==e&&(this.pixelOffset=e,this.eventService.dispatchEvent({type:"paginationPixelOffsetChanged"}))}},Yc=class extends A{constructor(){super(),this.beanName="ariaAnnouncementService",this.descriptionContainer=null,this.announceValue=fe(this.announceValue.bind(this),200)}wireBeans(e){this.eGridDiv=e.eGridDiv}postConstruct(){const e=this.gos.getDocument(),t=this.descriptionContainer=e.createElement("div");t.classList.add("ag-aria-description-container"),zt(t,"polite"),vt(t,"relevant","additions text"),function(e,t){vt(e,"atomic",t)}(t,!0),this.eGridDiv.appendChild(t)}announceValue(e){this.descriptionContainer&&(this.descriptionContainer.textContent="",setTimeout((()=>{this.isAlive()&&this.descriptionContainer&&(this.descriptionContainer.textContent=e)}),50))}destroy(){super.destroy();const{descriptionContainer:e}=this';
      S = S + ';e&&(ba(e),e.parentElement&&e.parentElement.removeChild(e)),this.descriptionContainer=null,this.eGridDiv=null}},_c=class extends A{constructor(){super(...arguments),this.beanName="columnAnimationService",this.executeNextFuncs=[],this.executeLaterFuncs=[],this.active=!1,this.suppressAnimation=!1,this.animationThreadCount=0}wireBeans(e){this.ctrlsService=e.ctrlsService}postConstruct(){this.ctrlsService.whenReady((e=>this.gridBodyCtrl=e.gridBodyCtrl))}isActive(){return this.active&&!this.suppressAnimation}setSuppressAnimation(e){this.suppressAnimation=e}start(){this.active||this.gos.get("suppressColumnMoveAnimation")||this.gos.get("enableRtl")||(this.ensureAnimationCssClassPresent(),this.active=!0)}finish(){this.active&&this.flush((()=>{this.active=!1}))}executeNextVMTurn(e){this.active?this.executeNextFuncs.push(e):e()}executeLaterVMTurn(e){this.active?this.executeLaterFuncs.push(e):e()}ensureAnimationCssClassPresent(){this.animationThreadCount++;const e=this.animationThreadCount;this.gridBodyCtrl.setColumnMovingCss(!0),this.executeLaterFuncs.push((()=>{this.animationThreadCount===e&&this.gridBodyCtrl.setColumnMovingCss(!1)}))}flush(e){if(0===this.executeNextFuncs.length&&0===this.executeLaterFuncs.length)return void e();const t=e=>{for(;e.length;){const t=e.pop();t&&t()}};this.getFrameworkOverrides().wrapIncoming((()=>{window.setTimeout((()=>t(this.executeNextFuncs)),0),window.setTimeout((()=>{e(),t(this.executeLaterFuncs)}),200)}))}},Jc=class extends A{constructor(){super(...arguments),this.beanName="columnHoverService"}setMouseOver(e){this.selectedColumns=e;this.eventService.dispatchEvent({type:"columnHoverChanged"})}clearMouseOver(){this.selectedColumns=null;this.eventService.dispatchEvent({type:"columnHoverChanged"})}isHovered(e){return!!this.selectedColumns&&this.selectedColumns.indexOf(e)>=0}},Zc=class extends A{constructor(){super(...arguments),this.beanName="overlayService",this.state=0,this.showInitialOverlay=!0}wireBeans(e){this.userComponentFactory=e.userC';
      S = S + 'omponentFactory,this.rowModel=e.rowModel,this.columnModel=e.columnModel}postConstruct(){const e=()=>this.updateOverlayVisibility();this.addManagedEventListeners({newColumnsLoaded:e,rowDataUpdated:e}),this.addManagedPropertyListener("loading",e)}registerOverlayWrapperComp(e){this.overlayWrapperComp=e,this.updateOverlayVisibility()}showLoadingOverlay(){this.showInitialOverlay=!1;const e=this.gos.get("loading");(e||void 0===e&&!this.gos.get("suppressLoadingOverlay"))&&this.doShowLoadingOverlay()}showNoRowsOverlay(){this.showInitialOverlay=!1,this.gos.get("loading")||this.gos.get("suppressNoRowsOverlay")||this.doShowNoRowsOverlay()}hideOverlay(){this.showInitialOverlay=!1,this.gos.get("loading")||this.doHideOverlay()}updateOverlayVisibility(){let e=this.gos.get("loading");this.showInitialOverlay&&void 0===e&&!this.gos.get("suppressLoadingOverlay")&&(e=!this.gos.get("columnDefs")||!this.columnModel.isReady()||!this.gos.get("rowData")&&this.gos.isRowModelType("clientSide")),e?1!==this.state&&this.doShowLoadingOverlay():(this.showInitialOverlay=!1,this.rowModel.isEmpty()&&!this.gos.get("suppressNoRowsOverlay")&&this.gos.isRowModelType("clientSide")?2!==this.state&&this.doShowNoRowsOverlay():0!==this.state&&this.doHideOverlay())}doShowLoadingOverlay(){this.state=1,this.showOverlay(this.userComponentFactory.getLoadingOverlayCompDetails({}),"ag-overlay-loading-wrapper","loadingOverlayComponentParams")}doShowNoRowsOverlay(){this.state=2,this.showOverlay(this.userComponentFactory.getNoRowsOverlayCompDetails({}),"ag-overlay-no-rows-wrapper","noRowsOverlayComponentParams")}doHideOverlay(){this.state=0,this.overlayWrapperComp.hideOverlay()}showOverlay(e,t,a){const n=e.newAgStackInstance();this.overlayWrapperComp.showOverlay(n,t,a)}},Xc=class extends A{constructor(){super(...arguments),this.beanName="rowCssClassCalculator"}wireBeans(e){this.stylingService=e.stylingService}getInitialRowClasses(e){const t=[];return L(e.extraCssClass)&&t.push(e.extraCssClass),t.push("ag-row"),t.push(e';
      S = S + '.rowFocused?"ag-row-focus":"ag-row-no-focus"),e.fadeRowIn&&t.push("ag-opacity-zero"),t.push(e.rowIsEven?"ag-row-even":"ag-row-odd"),e.rowNode.isRowPinned()&&t.push("ag-row-pinned"),e.rowNode.isSelected()&&t.push("ag-row-selected"),e.rowNode.footer&&t.push("ag-row-footer"),t.push("ag-row-level-"+e.rowLevel),e.rowNode.stub&&t.push("ag-row-loading"),e.fullWidthRow&&t.push("ag-full-width-row"),e.expandable&&(t.push("ag-row-group"),t.push(e.rowNode.expanded?"ag-row-group-expanded":"ag-row-group-contracted")),e.rowNode.dragging&&t.push("ag-row-dragging"),S(t,this.processClassesFromGridOptions(e.rowNode)),S(t,this.preProcessRowClassRules(e.rowNode)),t.push(e.printLayout?"ag-row-position-relative":"ag-row-position-absolute"),e.firstRowOnPage&&t.push("ag-row-first"),e.lastRowOnPage&&t.push("ag-row-last"),e.fullWidthRow&&("left"===e.pinned&&t.push("ag-cell-last-left-pinned"),"right"===e.pinned&&t.push("ag-cell-first-right-pinned")),t}processClassesFromGridOptions(e){const t=[],a=e=>{"string"==typeof e?t.push(e):Array.isArray(e)&&e.forEach((e=>t.push(e)))},n=this.gos.get("rowClass");if(n){if("function"==typeof n)return ce("rowClass should not be a function, please use getRowClass instead"),[];a(n)}const o=this.gos.getCallback("getRowClass");if(o){a(o({data:e.data,node:e,rowIndex:e.rowIndex}))}return t}preProcessRowClassRules(e){const t=[];return this.processRowClassRules(e,(e=>{t.push(e)}),(()=>{})),t}processRowClassRules(e,t,a){const n=this.gos.addGridCommonParams({data:e.data,node:e,rowIndex:e.rowIndex});this.stylingService.processClassRules(void 0,this.gos.get("rowClassRules"),n,t,a)}calculateRowLevel(e){return e.group?e.level:e.parent?e.parent.level+1:0}},$c=class extends A{constructor(){super(...arguments),this.beanName="rowContainerHeightService",this.scrollY=0,this.uiBodyHeight=0}wireBeans(e){this.ctrlsService=e.ctrlsService}postConstruct(){this.addManagedEventListeners({bodyHeightChanged:this.updateOffset.bind(this)}),this.maxDivHeight=function(){if(!document.body)retu';
      S = S + 'rn-1;let e=1e6;const t=navigator.userAgent.toLowerCase().match(/firefox/)?6e6:1e9,a=document.createElement("div");for(document.body.appendChild(a);;){const n=2*e;if(a.style.height=n+"px",n>t||a.clientHeight!==n)break;e=n}return document.body.removeChild(a),e}(),this.gos.get("debug")&&le("RowContainerHeightService - maxDivHeight = "+this.maxDivHeight)}isStretching(){return this.stretching}getDivStretchOffset(){return this.divStretchOffset}updateOffset(){if(!this.stretching)return;const e=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition().top,t=this.getUiBodyHeight();(e!==this.scrollY||t!==this.uiBodyHeight)&&(this.scrollY=e,this.uiBodyHeight=t,this.calculateOffset())}calculateOffset(){this.setUiContainerHeight(this.maxDivHeight),this.pixelsToShave=this.modelHeight-this.uiContainerHeight,this.maxScrollY=this.uiContainerHeight-this.uiBodyHeight;const e=this.scrollY/this.maxScrollY,t=e*this.pixelsToShave;this.gos.get("debug")&&le(`RowContainerHeightService - Div Stretch Offset = ${t} (${this.pixelsToShave} * ${e})`),this.setDivStretchOffset(t)}setUiContainerHeight(e){e!==this.uiContainerHeight&&(this.uiContainerHeight=e,this.eventService.dispatchEvent({type:"rowContainerHeightChanged"}))}clearOffset(){this.setUiContainerHeight(this.modelHeight),this.pixelsToShave=0,this.setDivStretchOffset(0)}setDivStretchOffset(e){const t="number"==typeof e?Math.floor(e):null;this.divStretchOffset!==t&&(this.divStretchOffset=t,this.eventService.dispatchEvent({type:"heightScaleChanged"}))}setModelHeight(e){this.modelHeight=e,this.stretching=null!=e&&this.maxDivHeight>0&&e>this.maxDivHeight,this.stretching?this.calculateOffset():this.clearOffset()}getUiContainerHeight(){return this.uiContainerHeight}getRealPixelPosition(e){return e-this.divStretchOffset}getUiBodyHeight(){const e=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition();return e.bottom-e.top}getScrollPositionForPixel(e){if(this.pixelsToShave<=0)return e;const t=e/(this.modelHeigh';
      S = S + 't-this.getUiBodyHeight());return this.maxScrollY*t}},eg=class extends A{constructor(){super(...arguments),this.beanName="rowNodeSorter"}wireBeans(e){this.valueService=e.valueService,this.columnModel=e.columnModel,this.showRowGroupColsService=e.showRowGroupColsService}postConstruct(){this.isAccentedSort=this.gos.get("accentedSort"),this.primaryColumnsSortGroups=this.gos.isColumnsSortingCoupledToGroup(),this.addManagedPropertyListener("accentedSort",(e=>this.isAccentedSort=e.currentValue)),this.addManagedPropertyListener("autoGroupColumnDef",(()=>this.primaryColumnsSortGroups=this.gos.isColumnsSortingCoupledToGroup()))}doFullSort(e,t){const a=e.map(((e,t)=>({currentPos:t,rowNode:e})));return a.sort(this.compareRowNodes.bind(this,t)),a.map((e=>e.rowNode))}compareRowNodes(e,t,a){const n=t.rowNode,o=a.rowNode;for(let t=0,a=e.length;t<a;t++){const a=e[t],r="desc"===a.sort,i=this.getValue(n,a.column),s=this.getValue(o,a.column);let l;const c=this.getComparator(a,n);l=c?c(i,s,n,o,r):W(i,s,this.isAccentedSort);if(!isNaN(l)&&0!==l)return"asc"===a.sort?l:-1*l}return t.currentPos-a.currentPos}getComparator(e,t){const a=e.column,n=a.getColDef().comparator;if(null!=n)return n;if(!a.getColDef().showRowGroup)return;const o=!t.group&&a.getColDef().field;if(!o)return;const r=this.columnModel.getColDefCol(o);return r?r.getColDef().comparator:void 0}getValue(e,t){if(!this.primaryColumnsSortGroups)return this.valueService.getValue(t,e,!1,!1);if(e.rowGroupColumn===t){if(this.gos.isGroupUseEntireRow(this.columnModel.isPivotActive())){const a=e.allLeafChildren?.[0];return a?this.valueService.getValue(t,a,!1,!1):void 0}const a=this.showRowGroupColsService?.getShowRowGroupCol(t.getId());if(!a)return;return e.groupData?.[a.getId()]}return e.group&&t.getColDef().showRowGroup?void 0:this.valueService.getValue(t,e,!1,!1)}},tg=class{constructor(e,t){this.active=!0,this.nodeIdsToColumns={},this.mapToItems={},this.keepingColumns=e,this.pathRoot={rowNode:t,children:null},this.mapToItems[t.id]=this.p';
      S = S + 'athRoot}setInactive(){this.active=!1}isActive(){return this.active}depthFirstSearchChangedPath(e,t){if(e.children)for(let a=0;a<e.children.length;a++)this.depthFirstSearchChangedPath(e.children[a],t);t(e.rowNode)}depthFirstSearchEverything(e,t,a){if(e.childrenAfterGroup)for(let n=0;n<e.childrenAfterGroup.length;n++){const o=e.childrenAfterGroup[n];o.childrenAfterGroup?this.depthFirstSearchEverything(e.childrenAfterGroup[n],t,a):a&&t(o)}t(e)}forEachChangedNodeDepthFirst(e,t=!1,a=!1){this.active&&!a?this.depthFirstSearchChangedPath(this.pathRoot,e):this.depthFirstSearchEverything(this.pathRoot.rowNode,e,t)}executeFromRootNode(e){e(this.pathRoot.rowNode)}createPathItems(e){let t=e,a=0;for(;!this.mapToItems[t.id];){const e={rowNode:t,children:null};this.mapToItems[t.id]=e,a++,t=t.parent}return a}populateColumnsMap(e,t){if(!this.keepingColumns||!t)return;let a=e;for(;a;)this.nodeIdsToColumns[a.id]||(this.nodeIdsToColumns[a.id]={}),t.forEach((e=>this.nodeIdsToColumns[a.id][e.getId()]=!0)),a=a.parent}linkPathItems(e,t){let a=e;for(let e=0;e<t;e++){const e=this.mapToItems[a.id],t=this.mapToItems[a.parent.id];t.children||(t.children=[]),t.children.push(e),a=a.parent}}addParentNode(e,t){if(!e||e.isRowPinned())return;const a=this.createPathItems(e);this.linkPathItems(e,a),this.populateColumnsMap(e,t)}canSkip(e){return this.active&&!this.mapToItems[e.id]}getValueColumnsForNode(e,t){if(!this.keepingColumns)return t;const a=this.nodeIdsToColumns[e.id];return t.filter((e=>a[e.getId()]))}getNotValueColumnsForNode(e,t){if(!this.keepingColumns)return null;const a=this.nodeIdsToColumns[e.id];return t.filter((e=>!a[e.getId()]))}},ag=class extends A{constructor(){super(...arguments),this.beanName="selectionService",this.selectedNodes=new Map,this.selectionCtx=new tl}wireBeans(e){this.rowModel=e.rowModel,this.pageBoundsService=e.pageBoundsService}postConstruct(){this.selectionCtx.init(this.rowModel),this.rowSelection=this.gos.get("rowSelection"),this.groupSelectsChildren=this.gos.get("gr';
      S = S + 'oupSelectsChildren"),this.addManagedPropertyListeners(["groupSelectsChildren","rowSelection"],(()=>{this.groupSelectsChildren=this.gos.get("groupSelectsChildren"),this.rowSelection=this.gos.get("rowSelection"),this.deselectAllRowNodes({source:"api"})})),this.addManagedEventListeners({rowSelected:this.onRowSelected.bind(this)})}destroy(){super.destroy(),this.resetNodes(),this.selectionCtx.reset()}isMultiselect(){return"multiple"===this.rowSelection}overrideSelectionValue(e,t){if(!Gc(t))return e;const a=this.selectionCtx.getRoot();return!a||(a.isSelected()??!1)}setNodesSelected(e){const{newValue:t,clearSelection:a,suppressFinishActions:n,rangeSelect:o,nodes:r,event:i,source:s}=e;if(0===r.length)return 0;if(r.length>1&&!this.isMultiselect())return ce("cannot multi select while rowSelection=\'single\'"),0;const l=this.groupSelectsChildren&&!0===e.groupSelectsFiltered,c=r.map((e=>e.footer?e.sibling:e));if(o){if(c.length>1)return ce("cannot range select while selecting multiple rows"),0;const e=c[0],a=this.overrideSelectionValue(t,s);if(this.isMultiselect()){if(this.selectionCtx.isInRange(e)){const t=this.selectionCtx.truncate(e);return a&&this.selectRange(t.discard,!1,s),this.selectRange(t.keep,a,s)}if(this.selectionCtx.getRoot()!==e){const t=this.selectionCtx.extend(e,this.groupSelectsChildren);return a&&this.selectRange(t.discard,!1,s),this.selectRange(t.keep,a,s)}}else;}n||this.selectionCtx.setRoot(c[0]);let g=0;for(let e=0;e<c.length;e++){const a=c[e];if(!(l&&a.group)){a.selectThisNode(t,i,s)&&g++}this.groupSelectsChildren&&a.childrenAfterGroup?.length&&(g+=this.selectChildren(a,t,l,s))}if(!n){t&&(a||!this.isMultiselect())&&(g+=this.clearOtherNodes(c[0],s)),g>0&&(this.updateGroupsFromChildrenSelections(s),this.dispatchSelectionChanged(s))}return g}selectRange(e,t,a){let n=0;return e.forEach((e=>{if(e.group&&this.groupSelectsChildren)return;e.selectThisNode(t,void 0,a)&&n++})),n>0&&(this.updateGroupsFromChildrenSelections(a),this.dispatchSelectionChanged(a)),n}selectChi';
      S = S + 'ldren(e,t,a,n){const o=a?e.childrenAfterAggFilter:e.childrenAfterGroup;return O(o)?0:this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,groupSelectsFiltered:a,source:n,nodes:o})}getSelectedNodes(){const e=[];return this.selectedNodes.forEach((t=>{t&&e.push(t)})),e}getSelectedRows(){const e=[];return this.selectedNodes.forEach((t=>{t&&t.data&&e.push(t.data)})),e}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(e){const t=new Map;this.selectedNodes.forEach(((a,n)=>{a&&e(a)&&t.set(n,a)})),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsChildren)return!1;if("clientSide"!==this.rowModel.getType())return!1;const a=this.rowModel.getRootNode();t||(t=new tg(!0,a)).setInactive();let n=!1;return t.forEachChangedNodeDepthFirst((t=>{if(t!==a){const a=t.calculateSelectedFromChildren();n=t.selectThisNode(null!==a&&a,void 0,e)||n}})),n}clearOtherNodes(e,t){const a=new Map;let n=0;return this.selectedNodes.forEach((o=>{if(o&&o.id!==e.id){const e=this.selectedNodes.get(o.id);n+=e.setSelectedParams({newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:t}),this.groupSelectsChildren&&o.parent&&a.set(o.parent.id,o.parent)}})),a.forEach((e=>{const a=e.calculateSelectedFromChildren();e.selectThisNode(null!==a&&a,void 0,t)})),n}onRowSelected(e){const t=e.node;this.groupSelectsChildren&&t.group||(t.isSelected()?this.selectedNodes.set(t.id,t):this.selectedNodes.delete(t.id))}syncInRowNode(e,t){this.syncInOldRowNode(e,t),this.syncInNewRowNode(e)}syncInOldRowNode(e,t){if(L(t)&&e.id!==t.id&&t){const a=t.id;this.selectedNodes.get(a)==e&&this.selectedNodes.set(t.id,t)}}syncInNewRowNode(e){this.selectedNodes.has(e.id)?(e.setSelectedInitialValue(!0),this.selectedNodes.set(e.id,e)):e.setSelectedInitialValue(!1)}reset(e){const t=this.getSelectionCount();this.resetNodes(),t&&this.dispatchSelectionChanged(e)}resetNodes(){this.selectedNodes?.clear()}getBestCostNodeSelection(){if("clientSide"!==this.rowModel.getType';
      S = S + '())return;const e=this.rowModel.getTopLevelNodes();if(null===e)return;const t=[];return function e(a){for(let n=0,o=a.length;n<o;n++){const o=a[n];if(o.isSelected())t.push(o);else{const t=o;t.group&&t.children&&e(t.children)}}}(e),t}isEmpty(){let e=0;return this.selectedNodes.forEach((t=>{t&&e++})),0===e}deselectAllRowNodes(e){const t=e=>e.selectThisNode(!1,void 0,n),a="clientSide"===this.rowModel.getType(),{source:n,justFiltered:o,justCurrentPage:r}=e;if(r||o){if(!a)return void ge("selecting just filtered only works when gridOptions.rowModelType=\'clientSide\'");this.getNodesToSelect(o,r).forEach(t)}else this.selectedNodes.forEach((e=>{e&&t(e)})),this.reset(n);this.selectionCtx.reset(),a&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(n),this.dispatchSelectionChanged(n)}getSelectedCounts(e,t){let a=0,n=0;return this.getNodesToSelect(e,t).forEach((e=>{this.groupSelectsChildren&&e.group||(e.isSelected()?a++:e.selectable&&n++)})),{selectedCount:a,notSelectedCount:n}}getSelectAllState(e,t){const{selectedCount:a,notSelectedCount:n}=this.getSelectedCounts(e,t);return(0!==a||0!==n)&&(a>0&&n>0?null:a>0)}hasNodesToSelect(e=!1,t=!1){return this.getNodesToSelect(e,t).filter((e=>e.selectable)).length>0}getNodesToSelect(e=!1,t=!1){if("clientSide"!==this.rowModel.getType())throw new Error(`selectAll only available when rowModelType=\'clientSide\', ie not ${this.rowModel.getType()}`);const a=[];if(t)return this.forEachNodeOnPage((e=>{if(e.group)if(e.expanded)this.groupSelectsChildren||a.push(e);else{const t=e=>{a.push(e),e.childrenAfterFilter?.length&&e.childrenAfterFilter.forEach(t)};t(e)}else a.push(e)})),a;const n=this.rowModel;return e?(n.forEachNodeAfterFilter((e=>{a.push(e)})),a):(n.forEachNode((e=>{a.push(e)})),a)}forEachNodeOnPage(e){const t=this.pageBoundsService.getFirstRow(),a=this.pageBoundsService.getLastRow();for(let n=t;n<=a;n++){const t=this.rowModel.getRow(n);t&&e(t)}}selectAllRowNodes(e){if("clientSide"!==this.rowModel.getType())throw new Error(`';
      S = S + 'selectAll only available when rowModelType=\'clientSide\', ie not ${this.rowModel.getType()}`);const{source:t,justFiltered:a,justCurrentPage:n}=e,o=this.getNodesToSelect(a,n);o.forEach((e=>e.selectThisNode(!0,void 0,t))),this.selectionCtx.setRoot(o[0]??null),this.selectionCtx.setEndRange(d(o)??null),"clientSide"===this.rowModel.getType()&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(t),this.dispatchSelectionChanged(t)}getSelectionState(){const e=[];return this.selectedNodes.forEach((t=>{t?.id&&e.push(t.id)})),e.length?e:null}setSelectionState(e,t){if(!Array.isArray(e))return;const a=new Set(e),n=[];this.rowModel.forEachNode((e=>{a.has(e.id)&&n.push(e)})),this.setNodesSelected({newValue:!0,nodes:n,source:t})}dispatchSelectionChanged(e){const t={type:"selectionChanged",source:e};this.eventService.dispatchEvent(t)}},ng=class extends A{constructor(){super(...arguments),this.beanName="selectableService"}wireBeans(e){this.rowModel=e.rowModel,this.selectionService=e.selectionService}postConstruct(){this.addManagedPropertyListener("isRowSelectable",(()=>this.updateSelectable()))}updateSelectableAfterGrouping(){this.updateSelectable(!0)}updateSelectable(e=!1){const t=!!this.gos.get("rowSelection"),a=this.gos.get("isRowSelectable");if(!t||!a)return;const n=this.gos.get("groupSelectsChildren"),o="clientSide"===this.rowModel.getType()&&n,r=[],i=t=>{if(e&&!t.group)return;if(o&&t.group){const e=t.childrenAfterGroup.some((e=>!0===e.selectable));return void t.setRowSelectable(e,!0)}const n=!a||a(t);t.setRowSelectable(n,!0),!n&&t.isSelected()&&r.push(t)};if(o){const e=this.rowModel;new tg(!1,e.getRootNode()).forEachChangedNodeDepthFirst(i,!0,!0)}else this.rowModel.forEachNode(i);r.length&&this.selectionService.setNodesSelected({nodes:r,newValue:!1,source:"selectableChanged"}),o&&this.selectionService instanceof ag&&this.selectionService.updateGroupsFromChildrenSelections("selectableChanged")}},og=["asc","desc",null],rg=class extends A{constructor(){super(...argum';
      S = S + 'ents),this.beanName="sortController"}wireBeans(e){this.columnModel=e.columnModel,this.funcColsService=e.funcColsService,this.showRowGroupColsService=e.showRowGroupColsService}progressSort(e,t,a){const n=this.getNextSortDirection(e);this.setSortForColumn(e,n,t,a)}setSortForColumn(e,t,a,n){"asc"!==t&&"desc"!==t&&(t=null);let o=[e];if(this.gos.isColumnsSortingCoupledToGroup()&&e.getColDef().showRowGroup){const t=this.funcColsService.getSourceColumnsForGroupColumn(e),a=t?.filter((e=>e.isSortable()));a&&(o=[e,...a])}o.forEach((e=>e.setSort(t,n)));const r=[];if(!((a||this.gos.get("alwaysMultiSort"))&&!this.gos.get("suppressMultiSort"))){const e=this.clearSortBarTheseColumns(o,n);r.push(...e)}this.updateSortIndex(e),r.push(...o),this.dispatchSortChangedEvents(n,r)}updateSortIndex(e){const t=this.gos.isColumnsSortingCoupledToGroup(),a=this.showRowGroupColsService?.getShowRowGroupCol(e.getId()),n=t&&a||e,o=this.getColumnsWithSortingOrdered();this.columnModel.getAllCols().forEach((e=>e.setSortIndex(null)));const r=o.filter((e=>(!t||!e.getColDef().showRowGroup)&&e!==n));(n.getSort()?[...r,n]:r).forEach(((e,t)=>{e.setSortIndex(t)}))}onSortChanged(e,t){this.dispatchSortChangedEvents(e,t)}isSortActive(){const e=this.columnModel.getAllCols().filter((e=>!!e.getSort()));return e&&e.length>0}dispatchSortChangedEvents(e,t){const a={type:"sortChanged",source:e};t&&(a.columns=t),this.eventService.dispatchEvent(a)}clearSortBarTheseColumns(e,t){const a=[];return this.columnModel.getAllCols().forEach((n=>{e.includes(n)||(n.getSort()&&a.push(n),n.setSort(void 0,t))})),a}getNextSortDirection(e){let t;if(t=e.getColDef().sortingOrder?e.getColDef().sortingOrder:this.gos.get("sortingOrder")?this.gos.get("sortingOrder"):og,!Array.isArray(t)||t.length<=0)return ce(`sortingOrder must be an array with at least one element, currently it\'s ${t}`),null;const a=t.indexOf(e.getSort()),n=a<0,o=a==t.length-1;let r;return r=n||o?t[0]:t[a+1],og.indexOf(r)<0?(ce("invalid sort type ",r),null):r}getIndexedSortM';
      S = S + 'ap(){let e=this.columnModel.getAllCols().filter((e=>!!e.getSort()));if(this.columnModel.isPivotMode()){const t=this.gos.isColumnsSortingCoupledToGroup();e=e.filter((e=>{const a=!!e.getAggFunc(),n=!e.isPrimary(),o=t?this.showRowGroupColsService?.getShowRowGroupCol(e.getId()):e.getColDef().showRowGroup;return a||n||o}))}const t=this.funcColsService.getRowGroupColumns().filter((e=>!!e.getSort())),a={};e.forEach(((e,t)=>a[e.getId()]=t)),e.sort(((e,t)=>{const n=e.getSortIndex(),o=t.getSortIndex();if(null!=n&&null!=o)return n-o;if(null==n&&null==o){return a[e.getId()]>a[t.getId()]?1:-1}return null==o?-1:1}));const n=this.gos.isColumnsSortingCoupledToGroup()&&!!t.length;n&&(e=[...new Set(e.map((e=>this.showRowGroupColsService?.getShowRowGroupCol(e.getId())??e)))]);const o=new Map;return e.forEach(((e,t)=>o.set(e,t))),n&&t.forEach((e=>{const t=this.showRowGroupColsService.getShowRowGroupCol(e.getId());o.set(e,o.get(t))})),o}getColumnsWithSortingOrdered(){return[...this.getIndexedSortMap().entries()].sort((([e,t],[a,n])=>t-n)).map((([e])=>e))}getSortModel(){return this.getColumnsWithSortingOrdered().filter((e=>e.getSort())).map((e=>({sort:e.getSort(),colId:e.getId()})))}getSortOptions(){return this.getColumnsWithSortingOrdered().filter((e=>e.getSort())).map((e=>({sort:e.getSort(),column:e})))}canColumnDisplayMixedSort(e){const t=this.gos.isColumnsSortingCoupledToGroup(),a=!!e.getColDef().showRowGroup;return t&&a}getDisplaySortForColumn(e){const t=this.funcColsService.getSourceColumnsForGroupColumn(e);if(!this.canColumnDisplayMixedSort(e)||!t?.length)return e.getSort();const a=null!=e.getColDef().field||!!e.getColDef().valueGetter?[e,...t]:t,n=a[0].getSort();return a.every((e=>e.getSort()==n))?n:"mixed"}getDisplaySortIndexForColumn(e){return this.getIndexedSortMap().get(e)}},ig=class extends A{constructor(){super(...arguments),this.beanName="syncService",this.waitingForColumns=!1}wireBeans(e){this.ctrlsService=e.ctrlsService,this.columnModel=e.columnModel,this.rowModel=e.rowM';
      S = S + 'odel}postConstruct(){this.addManagedPropertyListener("columnDefs",(e=>this.setColumnDefs(e)))}start(){this.ctrlsService.whenReady((()=>{const e=this.gos.get("columnDefs");e?this.setColumnsAndData(e):this.waitingForColumns=!0,this.gridReady()}))}setColumnsAndData(e){this.columnModel.setColumnDefs(e??[],"gridInitializing"),this.rowModel.start()}gridReady(){this.dispatchGridReadyEvent();const e=Xa.__isRegistered("@ag-grid-enterprise/core",this.gridId);this.gos.get("debug")&&le(`initialised successfully, enterprise = ${e}`)}dispatchGridReadyEvent(){this.eventService.dispatchEvent({type:"gridReady"})}setColumnDefs(e){const t=this.gos.get("columnDefs");if(t)return this.waitingForColumns?(this.waitingForColumns=!1,void this.setColumnsAndData(t)):void this.columnModel.setColumnDefs(t,Ee(e.source))}},sg=class extends A{constructor(){super(...arguments),this.beanName="changeDetectionService"}wireBeans(e){this.rowModel=e.rowModel,this.rowRenderer=e.rowRenderer}postConstruct(){"clientSide"===this.rowModel.getType()&&(this.clientSideRowModel=this.rowModel),this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this)})}onCellValueChanged(e){"paste"!==e.source&&this.doChangeDetection(e.node,e.column)}doChangeDetection(e,t){if(this.gos.get("suppressChangeDetection"))return;const a=[e];if(this.clientSideRowModel&&!e.isRowPinned()){const n=this.gos.get("aggregateOnlyChangedColumns"),o=new tg(n,this.clientSideRowModel.getRootNode());o.addParentNode(e.parent,[t]),this.clientSideRowModel.doAggregate(o),o.forEachChangedNodeDepthFirst((e=>{a.push(e)}))}this.rowRenderer.refreshCells({rowNodes:a})}},lg=class extends A{constructor(){super(...arguments),this.beanName="expressionService",this.expressionToFunctionCache={}}evaluate(e,t){if("string"==typeof e)return this.evaluateExpression(e,t);ge("value should be either a string or a function",e)}evaluateExpression(e,t){try{const a=this.createExpressionFunction(e);return a(t.value,t.context,t.oldValue,t.newValue,t.value,t.n';
      S = S + 'ode,t.data,t.colDef,t.rowIndex,t.api,t.getValue,t.column,t.columnGroup)}catch(a){return le("Processing of the expression failed"),le("Expression = ",e),le("Params = ",t),le("Exception = ",a),null}}createExpressionFunction(e){if(this.expressionToFunctionCache[e])return this.expressionToFunctionCache[e];const t=this.createFunctionBody(e),a=new Function("x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, getValue, column, columnGroup",t);return this.expressionToFunctionCache[e]=a,a}createFunctionBody(e){return e.indexOf("return")>=0?e:"return "+e+";"}},cg=class extends A{constructor(){super(...arguments),this.beanName="valueCache",this.cacheVersion=0}postConstruct(){this.active=this.gos.get("valueCache"),this.neverExpires=this.gos.get("valueCacheNeverExpires")}onDataChanged(){this.neverExpires||this.expire()}expire(){this.cacheVersion++}setValue(e,t,a){this.active&&(e.__cacheVersion!==this.cacheVersion&&(e.__cacheVersion=this.cacheVersion,e.__cacheData={}),e.__cacheData[t]=a)}getValue(e,t){if(this.active&&e.__cacheVersion===this.cacheVersion)return e.__cacheData[t]}},gg=class extends A{constructor(){super(...arguments),this.beanName="valueService",this.initialised=!1,this.isSsrm=!1}wireBeans(e){this.expressionService=e.expressionService,this.columnModel=e.columnModel,this.valueCache=e.valueCache,this.dataTypeService=e.dataTypeService}postConstruct(){this.initialised||this.init()}init(){this.isSsrm=this.gos.isRowModelType("serverSide"),this.cellExpressions=this.gos.get("enableCellExpressions"),this.isTreeData=this.gos.get("treeData"),this.initialised=!0;const e=e=>this.callColumnCellValueChangedHandler(e),t=this.gos.useAsyncEvents();this.eventService.addEventListener("cellValueChanged",e,t),this.addDestroyFunc((()=>this.eventService.removeEventListener("cellValueChanged",e,t))),this.addManagedPropertyListener("treeData",(e=>this.isTreeData=e.currentValue))}getValue(e,t,a=!1,n=!1){if(this.initialised||this.init(),!t)return;const o=e.getColDef(),r=o.fie';
      S = S + 'ld,i=e.getColId(),s=t.data;let l;const c=t.groupData&&void 0!==t.groupData[i],g=!n&&t.aggData&&void 0!==t.aggData[i],d=this.isSsrm&&n&&!!e.getColDef().aggFunc,h=this.isSsrm&&t.footer&&t.field&&(!0===e.getColDef().showRowGroup||e.getColDef().showRowGroup===t.field);if(a&&o.filterValueGetter?l=this.executeFilterValueGetter(o.filterValueGetter,s,e,t):this.isTreeData&&g?l=t.aggData[i]:this.isTreeData&&o.valueGetter?l=this.executeValueGetter(o.valueGetter,s,e,t):this.isTreeData&&r&&s?l=J(s,r,e.isFieldContainsDots()):c?l=t.groupData[i]:g?l=t.aggData[i]:o.valueGetter?l=this.executeValueGetter(o.valueGetter,s,e,t):h?l=J(s,t.field,e.isFieldContainsDots()):r&&s&&!d&&(l=J(s,r,e.isFieldContainsDots())),this.cellExpressions&&"string"==typeof l&&0===l.indexOf("=")){const a=l.substring(1);l=this.executeValueGetter(a,s,e,t)}if(null==l){const a=this.getOpenedGroup(t,e);if(null!=a)return a}return l}parseValue(e,t,a,n){const o=e.getColDef(),r=this.gos.addGridCommonParams({node:t,data:t?.data,oldValue:n,newValue:a,colDef:o,column:e}),i=o.valueParser;return L(i)?"function"==typeof i?i(r):this.expressionService.evaluate(i,r):a}formatValue(e,t,a,n,o=!0){let r,i=null;const s=e.getColDef();if(n?r=n:o&&(r=s.valueFormatter),r){const n=this.gos.addGridCommonParams({value:a,node:t,data:t?t.data:null,colDef:s,column:e});i="function"==typeof r?r(n):this.expressionService.evaluate(r,n)}else if(s.refData)return s.refData[a]||"";return null==i&&Array.isArray(a)&&(i=a.join(", ")),i}getOpenedGroup(e,t){if(!this.gos.get("showOpenedGroup"))return;if(!t.getColDef().showRowGroup)return;const a=t.getColDef().showRowGroup;let n=e.parent;for(;null!=n;){if(n.rowGroupColumn&&(!0===a||a===n.rowGroupColumn.getColId()))return n.key;n=n.parent}}setValue(e,t,a,n){const o=this.columnModel.getColDefCol(t);if(!e||!o)return!1;O(e.data)&&(e.data={});const{field:r,valueSetter:i}=o.getColDef();if(O(r)&&O(i))return ce("you need either field or valueSetter set on colDef for editing to work"),!1;if(this.dataTypeService&&!thi';
      S = S + 's.dataTypeService.checkType(o,a))return ce("Data type of the new value does not match the cell data type of the column"),!1;const s=this.gos.addGridCommonParams({node:e,data:e.data,oldValue:this.getValue(o,e),newValue:a,colDef:o.getColDef(),column:o});let l;if(s.newValue=a,l=L(i)?"function"==typeof i?i(s):this.expressionService.evaluate(i,s):this.setValueUsingField(e.data,r,a,o.isFieldContainsDots()),void 0===l&&(l=!0),!l)return!1;e.resetQuickFilterAggregateText(),this.valueCache.onDataChanged(),s.newValue=this.getValue(o,e);const c={type:"cellValueChanged",event:null,rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:s.column,api:s.api,colDef:s.colDef,context:s.context,data:e.data,node:e,oldValue:s.oldValue,newValue:s.newValue,value:s.newValue,source:n};return this.eventService.dispatchEvent(c),!0}callColumnCellValueChangedHandler(e){const t=e.colDef.onCellValueChanged;"function"==typeof t&&this.getFrameworkOverrides().wrapOutgoing((()=>{t({node:e.node,data:e.data,oldValue:e.oldValue,newValue:e.newValue,colDef:e.colDef,column:e.column,api:e.api,context:e.context})}))}setValueUsingField(e,t,a,n){if(!t)return!1;let o=!1;if(n){const n=t.split(".");let r=e;for(;n.length>0&&r;){const e=n.shift();0===n.length?(o=r[e]===a,o||(r[e]=a)):r=r[e]}}else o=e[t]===a,o||(e[t]=a);return!o}executeFilterValueGetter(e,t,a,n){const o=this.gos.addGridCommonParams({data:t,node:n,column:a,colDef:a.getColDef(),getValue:this.getValueCallback.bind(this,n)});return"function"==typeof e?e(o):this.expressionService.evaluate(e,o)}executeValueGetter(e,t,a,n){const o=a.getColId(),r=this.valueCache.getValue(n,o);if(void 0!==r)return r;const i=this.gos.addGridCommonParams({data:t,node:n,column:a,colDef:a.getColDef(),getValue:this.getValueCallback.bind(this,n)});let s;return s="function"==typeof e?e(i):this.expressionService.evaluate(e,i),this.valueCache.setValue(n,o,s),s}getValueCallback(e,t){const a=this.columnModel.getColDefCol(t);return a?this.getValue(a,e):null}getKeyForNode(e,t){const a=this.getVa';
      S = S + 'lue(e,t),n=e.getColDef().keyCreator;let o=a;if(n){o=n(this.gos.addGridCommonParams({value:a,colDef:e.getColDef(),column:e,node:t,data:t.data}))}return"string"==typeof o||null==o||(o=String(o),"[object Object]"===o&&ce("a column you are grouping or pivoting by has objects as values. If you want to group by complex objects then either a) use a colDef.keyCreator (se AG Grid docs) or b) to toString() on the object to return a key")),o}},dg=class{};function hg(e){dg.gridOptions=e}function ug(e,t,a){if(!t)return ge("No gridOptions provided to createGrid"),{};const n=(new fg).create(e,t,(t=>{const a=new Ul(e);t.createBean(a)}),void 0,a);if(!Object.isFrozen(t)&&!a?.frameworkOverrides){const e="https://ag-grid.com/javascript-data-grid/grid-interface/#grid-api";Object.defineProperty(t,"api",{get:()=>{ge(`gridOptions.api is no longer supported. See ${e}.`)},configurable:!0})}return n}dg.gridOptions=void 0;var pg=class{constructor(e,t,a){if(ce("Since v31 new Grid(...) is deprecated. Use createGrid instead: `const gridApi = createGrid(...)`. The grid api is returned from createGrid and will not be available on gridOptions."),!t)return void ge("No gridOptions provided to the grid");this.gridOptions=t;const n=(new fg).create(e,t,(t=>{const a=new Ul(e);t.createBean(a).addDestroyFunc((()=>{this.destroy()}))}),void 0,a);this.gridOptions.api=n}destroy(){this.gridOptions&&(this.gridOptions.api?.destroy(),delete this.gridOptions.api)}},mg=1,fg=class{create(e,t,a,n,o){let r={};dg.gridOptions?(_(r,dg.gridOptions,!0,!0),r={...r,...t}):r=t;const i=function(e){const t={};return Object.entries(e).forEach((([e,a])=>{const n=Bc(e,a);t[e]=n})),t}(r),s=i.gridId??String(mg++),l=this.getRegisteredModules(o,s),c=this.createBeansList(i.rowModelType,l,s),g=this.createProvidedBeans(e,i,o);if(!c)return void ge("Failed to create grid.");const d=new Wn({providedBeanInstances:g,beanClasses:c,gridId:s,beanInitComparator:zl,beanDestroyComparator:Fl,derivedBeans:[vl]});return this.registerModuleUserComponents';
      S = S + '(d,l),this.registerControllers(d,l),this.registerModuleApiFunctions(d,l),a(d),d.getBean("syncService").start(),n&&n(d),d.getBean("gridApi")}registerControllers(e,t){const a=e.getBean("ctrlsFactory");t.forEach((e=>{e.controllers&&e.controllers.forEach((e=>a.register(e)))}))}getRegisteredModules(e,t){const a=e?e.modules:null,n=Xa.__getRegisteredModules(t),o=[],r={},i=(e,t,a)=>{var n;r[(n=t).moduleName]||(r[n.moduleName]=!0,o.push(n),Xa.__register(n,e,a)),t.dependantModules&&t.dependantModules.forEach((t=>i(e,t,a)))};return i(!!a?.length||!Xa.__isPackageBased(),Lc,void 0),a&&a.forEach((e=>i(!0,e,t))),n&&n.forEach((e=>i(!Xa.__isPackageBased(),e,void 0))),o}registerModuleUserComponents(e,t){const a=this.extractModuleEntity(t,(e=>e.userComponents?e.userComponents:[])),n=e.getBean("userComponentRegistry");a.forEach((e=>{n.registerDefaultComponent(e.name,e.classImp)}))}registerModuleApiFunctions(e,t){const a=e.getBean("apiFunctionService");t.forEach((e=>{const t=e.apiFunctions??{};Object.keys(t).forEach((e=>{a?.addFunction(e,t[e])}))}))}createProvidedBeans(e,t,a){let n=a?a.frameworkOverrides:null;O(n)&&(n=new hl);const o={gridOptions:t,eGridDiv:e,globalEventListener:a?a.globalEventListener:null,globalSyncEventListener:a?a.globalSyncEventListener:null,frameworkOverrides:n};return a&&a.providedBeanInstances&&Object.assign(o,a.providedBeanInstances),o}createBeansList(e="clientSide",t,a){const n=t.filter((t=>!t.rowModel||t.rowModel===e)),o={clientSide:"@ag-grid-community/client-side-row-model",infinite:"@ag-grid-community/infinite-row-model",serverSide:"@ag-grid-enterprise/server-side-row-model",viewport:"@ag-grid-enterprise/viewport-row-model"};if(!o[e])return void ge("Could not find row model for rowModelType = ",e);if(!Xa.__assertRegistered(o[e],`rowModelType = \'${e}\'`,a))return;const r=[Al,El,Wc,Oc,ml,bn,kl,xl,us,Bn,$c,ds,Uc,Js,Xn,_e,ql,Vc,gl,ag,De,Ir,Qc,Kc,Ys,lg,Fe,gs,cg,gg,Ks,hs,Yn,Hl,cs,Ol,ul,al,is,rg,Jc,_c,ng,sg,ps,bl,Xc,eg,Dl,Vl,Pl,Ml,ig,Zc,fs,jc,Yc,vs,Ie,Cl,Oe,Ae,wl,y';
      S = S + 'l,Ue,Te,Ve,Sl,We],i=this.extractModuleEntity(n,(e=>e.beans?e.beans:[]));r.push(...i);const s=[];return r.forEach((e=>{s.indexOf(e)<0&&s.push(e)})),s}extractModuleEntity(e,t){return[].concat(...e.map(t))}},vg=class extends A{constructor(){super(...arguments),this.beanName="rowModelHelperService"}wireBeans(e){this.rowModel=e.rowModel}postConstruct(){const e=this.rowModel;switch(e.getType()){case"clientSide":this.clientSideRowModel=e;break;case"infinite":this.infiniteRowModel=e;break;case"serverSide":this.serverSideRowModel=e}}getClientSideRowModel(){return this.clientSideRowModel}getInfiniteRowModel(){return this.infiniteRowModel}getServerSideRowModel(){return this.serverSideRowModel}};var bg={version:gr,moduleName:"@ag-grid-community/csrm-ssrm-shared-api",apiFunctions:{expandAll:function(e){e.expansionService.expandAll(!0)},collapseAll:function(e){e.expansionService.expandAll(!1)},onRowHeightChanged:function(e){const t=e.rowModelHelperService?.getClientSideRowModel(),a=e.rowModelHelperService?.getServerSideRowModel();t?t.onRowHeightChanged():a&&a.onRowHeightChanged()}}},Cg={version:gr,moduleName:"@ag-grid-community/ssrm-infinite-shared-api",apiFunctions:{setRowCount:function(e,t,a){const n=e.rowModelHelperService?.getServerSideRowModel();if(n)return e.funcColsService.isRowGroupEmpty()?void n.setRowCount(t,a):void ge("setRowCount cannot be used while using row grouping.");const o=e.rowModelHelperService?.getInfiniteRowModel();o&&o.setRowCount(t,a)},getCacheBlockState:function(e){return e.rowNodeBlockLoader?.getBlockState()??{}}}},wg=class{wrap(e,t,a=[],n){const o=this.createWrapper(e,n);return t.forEach((e=>{this.createMethod(o,e,!0)})),a.forEach((e=>{this.createMethod(o,e,!1)})),o}unwrap(e){return e}createMethod(e,t,a){e.addMethod(t,this.createMethodProxy(e,t,a))}createMethodProxy(e,t,a){return function(){return e.hasMethod(t)?e.callMethod(t,arguments):(a&&ce("Framework component is missing the method "+t+"()"),null)}}};function yg(e,t){if(!e)return!1;const a=(e,a)=>';
      S = S + '{const n=t[e.id],o=t[a.id],r=void 0!==n,i=void 0!==o;return r&&i?n-o:!r&&!i?e.__objectId-a.__objectId:r?1:-1};let n,o,r=!1;for(let t=0;t<e.length-1;t++)if(n=e[t],o=e[t+1],a(n,o)>0){r=!0;break}return!!r&&(e.sort(a),!0)}var Sg=class{};Sg.CHART_TYPE_TO_SERIES_TYPE={column:"bar",groupedColumn:"bar",stackedColumn:"bar",normalizedColumn:"bar",bar:"bar",groupedBar:"bar",stackedBar:"bar",normalizedBar:"bar",line:"line",scatter:"scatter",bubble:"bubble",pie:"pie",donut:"donut",doughnut:"donut",area:"area",stackedArea:"area",normalizedArea:"area",histogram:"histogram",radarLine:"radar-line",radarArea:"radar-area",nightingale:"nightingale",radialColumn:"radial-column",radialBar:"radial-bar",sunburst:"sunburst",rangeBar:"range-bar",rangeArea:"range-area",boxPlot:"box-plot",treemap:"treemap",heatmap:"heatmap",waterfall:"waterfall"},Sg.COMBO_CHART_TYPES=["columnLineCombo","areaColumnCombo","customCombo"],Sg.SERIES_GROUP_TYPES=["grouped","stacked","normalized"];var kg=(e=>(e.InsideBase="insideBase",e.InsideEnd="insideEnd",e.Center="center",e.OutsideEnd="outsideEnd",e))(kg||{}),xg=void 0===a.g?{}:a.g;xg.HTMLElement="undefined"==typeof HTMLElement?{}:HTMLElement,xg.HTMLButtonElement="undefined"==typeof HTMLButtonElement?{}:HTMLButtonElement,xg.HTMLSelectElement="undefined"==typeof HTMLSelectElement?{}:HTMLSelectElement,xg.HTMLInputElement="undefined"==typeof HTMLInputElement?{}:HTMLInputElement,xg.Node="undefined"==typeof Node?{}:Node,xg.MouseEvent="undefined"==typeof MouseEvent?{}:MouseEvent},9209:function(e,t,a){var n,o=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var a in t)o(e,a,{get:t[a],enumerable:!0})})(l,{BaseCreator:()=>g,BaseGridSerializingSession:()=>d,CsvCreator:()=>v,CsvExportModule:()=>R,Downloader:()=>p,GridSerializer:()=>y,RowType:()=>w,XmlFactory:()=>M,ZipContainer:()=>q,_CsvExportCoreModule:()=>k}),e.exports=(n=l,((e,t,a,n)=>{if(t&&"object"==typeof t||"function"==typeof t)fo';
      S = S + 'r(let l of i(t))s.call(e,l)||l===a||o(e,l,{get:()=>t[l],enumerable:!(n=r(t,l))||n.enumerable});return e})(o({},"__esModule",{value:!0}),n));var c=a(3423),g=class extends c.BeanStub{setBeans(e){this.beans=e}getFileName(e){const t=this.getDefaultFileExtension();return null!=e&&e.length||(e=this.getDefaultFileName()),-1===e.indexOf(".")?`${e}.${t}`:e}getData(e){const t=this.createSerializingSession(e);return this.beans.gridSerializer.serialize(t,e)}getDefaultFileName(){return`export.${this.getDefaultFileExtension()}`}},d=class{constructor(e){this.groupColumns=[];const{columnModel:t,funcColsService:a,columnNameService:n,valueService:o,gos:r,processCellCallback:i,processHeaderCallback:s,processGroupHeaderCallback:l,processRowGroupCallback:c}=e;this.columnModel=t,this.funcColsService=a,this.columnNameService=n,this.valueService=o,this.gos=r,this.processCellCallback=i,this.processHeaderCallback=s,this.processGroupHeaderCallback=l,this.processRowGroupCallback=c}prepare(e){this.groupColumns=e.filter((e=>!!e.getColDef().showRowGroup))}extractHeaderValue(e){return this.getHeaderName(this.processHeaderCallback,e)??""}extractRowCellValue(e,t,a,n,o){const r=this.gos.get("groupHideOpenParents")&&!o.footer||!this.shouldRenderGroupSummaryCell(o,e,t)?this.valueService.getValue(e,o):this.createValueForGroupNode(e,o);return this.processCell({accumulatedRowIndex:a,rowNode:o,column:e,value:r,processCellCallback:this.processCellCallback,type:n})}shouldRenderGroupSummaryCell(e,t,a){if(!(e&&e.group))return!1;if(-1!==this.groupColumns.indexOf(t)){if(null!=e.groupData?.[t.getId()])return!0;if(this.gos.isRowModelType("serverSide")&&e.group)return!0;if(e.footer&&-1===e.level){const e=t.getColDef();return null==e||!0===e.showRowGroup||e.showRowGroup===this.funcColsService.getRowGroupColumns()[0].getId()}}const n=this.gos.isGroupUseEntireRow(this.columnModel.isPivotMode());return 0===a&&n}getHeaderName(e,t){return e?e(this.gos.addGridCommonParams({column:t})):this.columnNameService.getDisplayName';
      S = S + 'ForColumn(t,"csv",!0)}createValueForGroupNode(e,t){if(this.processRowGroupCallback)return this.processRowGroupCallback(this.gos.addGridCommonParams({column:e,node:t}));const a=this.gos.get("treeData"),n=this.gos.get("suppressGroupMaintainValueType"),o=t=>{if(a||n)return t.key;const o=t.groupData?.[e.getId()];return o&&t.rowGroupColumn&&!1!==t.rowGroupColumn.getColDef().useValueFormatterForExport?this.valueService.formatValue(t.rowGroupColumn,t,o)??o:o},r=t.footer,i=[o(t)];if(!this.gos.isGroupMultiAutoColumn())for(;t.parent;)t=t.parent,i.push(o(t));const s=i.reverse().join(" -> ");return r?`Total ${s}`:s}processCell(e){const{accumulatedRowIndex:t,rowNode:a,column:n,value:o,processCellCallback:r,type:i}=e;return r?{value:r(this.gos.addGridCommonParams({accumulatedRowIndex:t,column:n,node:a,value:o,type:i,parseValue:e=>this.valueService.parseValue(n,a,e,this.valueService.getValue(n,a)),formatValue:e=>this.valueService.formatValue(n,a,e)??e}))??""}:!1!==n.getColDef().useValueFormatterForExport?{value:o??"",valueFormatted:this.valueService.formatValue(n,a,o)}:{value:o??""}}},h=a(3423),u=a(3423),p=class{static download(e,t){const a=document.defaultView||window;if(!a)return void(0,u._warnOnce)("There is no `window` associated with the current `document`");const n=document.createElement("a"),o=a.URL.createObjectURL(t);n.setAttribute("href",o),n.setAttribute("download",e),n.style.display="none",document.body.appendChild(n),n.dispatchEvent(new MouseEvent("click",{bubbles:!1,cancelable:!0,view:a})),document.body.removeChild(n),a.setTimeout((()=>{a.URL.revokeObjectURL(o)}),0)}},m=a(3423),f=class extends d{constructor(e){super(e),this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:a}=e;this.suppressQuotes=t,this.columnSeparator=a}addCustomContent(e){e&&("string"==typeof e?(/^\\s*\\n/.test(e)||this.beginNewLine(),e=e.replace(/\\r?\\n/g,"\\r\\n"),this.result+=e):e.forEach((e=>{this.beginNewLine(),e.forEach(((e,t)=>{0!==t&&(this.result+=this.columnSeparator),this.re';
      S = S + 'sult+=this.putInQuotes(e.data.value||""),e.mergeAcross&&this.appendEmptyCells(e.mergeAcross)}))})))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,a,n){0!=a&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(n)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){0!=t&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,a){0!=t&&(this.result+=this.columnSeparator);const n=this.extractRowCellValue(e,t,t,"csv",a);this.result+=this.putInQuotes(n.valueFormatted??n.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(null==e)return\'""\';let t;"string"==typeof e?t=e:"function"==typeof e.toString?t=e.toString():((0,m._warnOnce)("unknown value type during csv conversion"),t="");return\'"\'+t.replace(/"/g,\'""\')+\'"\'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+="\\r\\n"),this.isFirstLine=!1}},v=class extends g{constructor(){super(...arguments),this.beanName="csvCreator"}wireBeans(e){this.columnModel=e.columnModel,this.columnNameService=e.columnNameService,this.funcColsService=e.funcColsService,this.valueService=e.valueService,this.gridSerializer=e.gridSerializer}postConstruct(){this.setBeans({gridSerializer:this.gridSerializer,gos:this.gos})}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed())return void(0,h._warnOnce)("Export cancelled. Export is not allowed as per your configuration.");const t=this.getMergedParams(e),a=this.getData(t),n=new Blob(["\\ufeff",a],{type:"text/plain"}),o="function"==typeof t.fileName?t.fileName(this.';
      S = S + 'gos.getGridCommonParams()):t.fileName;p.download(this.getFileName(o),n)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const a=t?Object.assign({},e):this.getMergedParams(e);return this.getData(a)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{columnModel:t,columnNameService:a,funcColsService:n,valueService:o,gos:r}=this,{processCellCallback:i,processHeaderCallback:s,processGroupHeaderCallback:l,processRowGroupCallback:c,suppressQuotes:g,columnSeparator:d}=e;return new f({columnModel:t,columnNameService:a,funcColsService:n,valueService:o,gos:r,processCellCallback:i||void 0,processHeaderCallback:s||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:c||void 0,suppressQuotes:g||!1,columnSeparator:d||","})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}},b=a(3423);var C=a(3423),w=(e=>(e[e.HEADER_GROUPING=0]="HEADER_GROUPING",e[e.HEADER=1]="HEADER",e[e.BODY=2]="BODY",e))(w||{}),y=class extends C.BeanStub{constructor(){super(...arguments),this.beanName="gridSerializer"}wireBeans(e){this.visibleColsService=e.visibleColsService,this.columnModel=e.columnModel,this.columnNameService=e.columnNameService,this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel,this.selectionService=e.selectionService,this.rowNodeSorter=e.rowNodeSorter,this.sortController=e.sortController}serialize(e,t={}){const{allColumns:a,columnKeys:n,skipRowGroups:o}=t,r=this.getColumnsToExport(a,o,n);return(0,C._compose)(this.prepareSession(r),this.prependContent(t),this.exportColumnGroups(t,r),this.exportHeaders(t,r),this.processPinnedTopRows(t,r),this.processRows(t,r),this.processPinnedBottomRows(t,r),this.appendContent(t))(e).parse()}processRow(e,t,a,n){const o=t.shouldRowBeSkipped||(()=>!1),r=this.gos.get("groupRemoveSingleChildren"),i=this.gos.get("groupRemoveLowestSingleChildren"),s=null!=t.rowPositions||!!t.onlySelected,l=this.gos.get("groupHideOpenParents")&&!s,c=this.columnModel.isPivotMode()?n.leafGroup:!n.group,g=!!n.footer,d=i&';
      S = S + '&n.leafGroup,h=1===n.allChildrenCount&&1===n.childrenAfterGroup?.length&&(r||d);if(!c&&!g&&(t.skipRowGroups||h||l)||t.onlySelected&&!n.isSelected()||t.skipPinnedTop&&"top"===n.rowPinned||t.skipPinnedBottom&&"bottom"===n.rowPinned)return;if(-1===n.level&&!c&&!g)return;if(o(this.gos.addGridCommonParams({node:n})))return;const u=e.onNewBodyRow(n);if(a.forEach(((e,t)=>{u.onColumn(e,t,n)})),t.getCustomContentBelowRow){const a=t.getCustomContentBelowRow(this.gos.addGridCommonParams({node:n}));a&&e.addCustomContent(a)}}appendContent(e){return t=>{const a=e.appendContent;return a&&t.addCustomContent(a),t}}prependContent(e){return t=>{const a=e.prependContent;return a&&t.addCustomContent(a),t}}prepareSession(e){return t=>(t.prepare(e),t)}exportColumnGroups(e,t){return a=>{if(!e.skipColumnGroupHeaders){const n=new C.GroupInstanceIdCreator,o=this.visibleColsService.createGroups({columns:t,idCreator:n,pinned:null,isStandaloneStructure:!0});this.recursivelyAddHeaderGroups(o,a,e.processGroupHeaderCallback)}return a}}exportHeaders(e,t){return a=>{if(!e.skipColumnHeaders){const e=a.onNewHeaderRow();t.forEach(((t,a)=>{e.onColumn(t,a,void 0)}))}return a}}processPinnedTopRows(e,t){return a=>{const n=this.processRow.bind(this,a,e,t);return e.rowPositions?e.rowPositions.filter((e=>"top"===e.rowPinned)).sort(((e,t)=>e.rowIndex-t.rowIndex)).map((e=>this.pinnedRowModel.getPinnedTopRow(e.rowIndex))).forEach(n):this.pinnedRowModel.forEachPinnedTopRow(n),a}}processRows(e,t){return a=>{const n=this.rowModel,o=n.getType(),r="clientSide"===o,i="serverSide"===o,s=!r&&e.onlySelected,l=this.processRow.bind(this,a,e,t),{exportedRows:c="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter((e=>null==e.rowPinned)).sort(((e,t)=>e.rowIndex-t.rowIndex)).map((e=>n.getRow(e.rowIndex))).forEach(l);else if(this.columnModel.isPivotMode())r?n.forEachPivotNode(l,!0):i?n.forEachNodeAfterFilterAndSort(l,!0):n.forEachNode(l);else if(e.onlySelectedAllPages||s){const e=this.selectionService.getSelectedNodes(';
      S = S + ');this.replicateSortedOrder(e),e.forEach(l)}else"all"===c?n.forEachNode(l):r||i?n.forEachNodeAfterFilterAndSort(l,!0):n.forEachNode(l);return a}}replicateSortedOrder(e){const t=this.sortController.getSortOptions(),a=(e,n)=>null!=e.rowIndex&&null!=n.rowIndex?e.rowIndex-n.rowIndex:e.level===n.level?e.parent?.id===n.parent?.id?this.rowNodeSorter.compareRowNodes(t,{rowNode:e,currentPos:e.rowIndex??-1},{rowNode:n,currentPos:n.rowIndex??-1}):a(e.parent,n.parent):e.level>n.level?a(e.parent,n):a(e,n.parent);e.sort(a)}processPinnedBottomRows(e,t){return a=>{const n=this.processRow.bind(this,a,e,t);return e.rowPositions?e.rowPositions.filter((e=>"bottom"===e.rowPinned)).sort(((e,t)=>e.rowIndex-t.rowIndex)).map((e=>this.pinnedRowModel.getPinnedBottomRow(e.rowIndex))).forEach(n):this.pinnedRowModel.forEachPinnedBottomRow(n),a}}getColumnsToExport(e=!1,t=!1,a){const n=this.columnModel.isPivotMode();if(a&&a.length)return this.columnModel.getColsForKeys(a);const o=this.gos.get("treeData");let r=[];return r=e&&!n?this.columnModel.getCols():this.visibleColsService.getAllCols(),t&&!o&&(r=r.filter((e=>e.getColId()!==C.GROUP_AUTO_COLUMN_ID))),r}recursivelyAddHeaderGroups(e,t,a){const n=[];e.forEach((e=>{const t=e;t.getChildren&&t.getChildren().forEach((e=>n.push(e)))})),e.length>0&&(0,C.isColumnGroup)(e[0])&&this.doAddHeaderHeader(t,e,a),n&&n.length>0&&this.recursivelyAddHeaderGroups(n,t,a)}doAddHeaderHeader(e,t,a){const n=e.onNewHeaderGroupingRow();let o=0;t.forEach((e=>{const t=e;let r;r=a?a(this.gos.addGridCommonParams({columnGroup:t})):this.columnNameService.getDisplayNameForColumnGroup(t,"header");const i=t.getLeafColumns().reduce(((e,t,a,n)=>{let o=(0,C._last)(e);return"open"===t.getColumnGroupShow()?o&&null==o[1]||(o=[a],e.push(o)):o&&null==o[1]&&(o[1]=a-1),a===n.length-1&&o&&null==o[1]&&(o[1]=a),e}),[]);n.onColumn(t,r||"",o++,t.getLeafColumns().length-1,i)}))}},S="32.0.0",k={version:S,moduleName:`${b.ModuleNames.CsvExportModule}-core`,beans:[v,y]},x={version:S,moduleName:`${b.Mo';
      S = S + 'duleNames.CsvExportModule}-api`,apiFunctions:{getDataAsCsv:function(e,t){return e.csvCreator?.getDataAsCsv(t)},exportDataAsCsv:function(e,t){e.csvCreator?.exportDataAsCsv(t)}},dependantModules:[k]},R={version:S,moduleName:b.ModuleNames.CsvExportModule,dependantModules:[k,x]},z="\\r\\n";function F(e,t,a){if(!t&&""!==t&&0!==t)return"";let n=t;return"boolean"==typeof t&&a&&(n=a(t)),` ${e}="${n}"`}var M=class{static createHeader(e={}){const t=["version"];e.version||(e.version="1.0"),e.encoding&&t.push("encoding"),e.standalone&&t.push("standalone");return`<?xml ${t.map((t=>`${t}="${e[t]}"`)).join(" ")} ?>`}static createXml(e,t){let a="";e.properties&&(e.properties.prefixedAttributes&&e.properties.prefixedAttributes.forEach((e=>{Object.keys(e.map).forEach((n=>{a+=F(e.prefix+n,e.map[n],t)}))})),e.properties.rawMap&&Object.keys(e.properties.rawMap).forEach((n=>{a+=F(n,e.properties.rawMap[n],t)})));let n="<"+e.name+a;return e.children||null!=e.textNode?null!=e.textNode?n+">"+e.textNode+"</"+e.name+">"+z:(n+=">\\r\\n",e.children&&e.children.forEach((e=>{n+=this.createXml(e,t)})),n+"</"+e.name+">"+z):n+"/>"+z}},D=a(3423),E=async e=>{const t=new Blob([e]),{size:a,content:n}=await(async e=>{let t=0;const a=[],n=new WritableStream({write:e=>{a.push(e),t+=e.length}}),o=new ReadableStream({start:t=>{const a=new FileReader;a.onload=e=>{e.target?.result&&t.enqueue(e.target.result),t.close()},a.readAsArrayBuffer(e)}}),r=new window.CompressionStream("deflate-raw");return await o.pipeThrough(r).pipeTo(n),{size:t,content:new Blob(a)}})(t);return{size:a,content:new Uint8Array(await n.arrayBuffer())}};function P(e,t){let a="";for(let n=0;n<t;n++)a+=String.fromCharCode(255&e),e>>>=8;return a}var A=e=>{if(!e.length)return 0;let t=~0,a=0,n=0,o=0;for(let r=0;r<e.length;r++)a=e[r],n=255&(t^a),o=I[n],t=t>>>8^o;return~t},T=e=>e.length?A("string"==typeof e?(new TextEncoder).encode(e):e):0,I=new Uint32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508';
      S = S + "324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,407354";
      S = S + '98,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]),L=(e,t,a,n,o,r)=>{const{content:i,path:s,created:l}=e,c=(e=>{let t=e.getHours();return t<<=6,t|=e.getMinutes(),t<<=5,t|=e.getSeconds()/2,t})(l),g=(e=>{let t=e.getFullYear()-1980;return t<<=4,t|=e.getMonth()+1,t<<=5,t|=e.getDate(),t})(l),d=T(o),h=void 0!==r?r:n,u=(0,D._utf8_encode)(s),p=u!==s;let m="";if(p){const e=P(1,1)+P(T(u),4)+u;m="up"+P(e.length,2)+e}const f="\x14\\0"+(p?"\\0\\b":"\\0\\0")+P(t?8:0,2)+P(c,2)+P(g,2)+P(h?d:0,4)+P(r??n,4)+P(n,4)+P(u.length,2)+P(m.length,2),v="PK\x03\x04"+f+u+m,b="PK\x01\x02\x14\\0"+f+"\\0\\0\\0\\0\\0\\0"+(i?"\\0\\0\\0\\0":"\x10\\0\\0\\0")+P(a,4)+u+m;return{localFileHeader:Uint8Array.from(v,(e=>e.charCodeAt(0))),centralDirectoryHeader:Uint8Array.from(b,(e=>e.charCodeAt(0)))}},O=e=>{let t;if("string"==typeof e){const a=atob(e.split(";base64,")[1]);t=Uint8Array.from(a,(e=>e.charCodeAt(0)))}else t=e;return{size:t.length,content:t}},N=async(e,t)=>{const{content:a}=e,{size:n,content:o}=a?O(a):{size:0,content:Uint8Array.from([])};let r,i,s=!1;if("file"===e.type&&o&&n>0){const e=await E(o);r=e.content,i=e.size,s=!0}return{...L(e,s,t,n,o,i),content:r||o,isCompressed:s}},G=(e,t)=>{const{content:a}=e,{content:n}=a?O(a):{content:Uint8Array.from([])};return{...L(e,!1,t,n.length,n,void 0),content:n,isCompressed:!1}},q=class{static addFolders(e){e.forEach(this.addFolder.bind(this))}static addFolder(e){this.folders.push({path:e,created:new Date,isBas';
      S = S + 'e64:!1,type:"folder"})}static addFile(e,t,a=!1){this.files.push({path:e,created:new Date,content:a?t:(new TextEncoder).encode(t),isBase64:a,type:"file"})}static async getZipFile(e="application/zip"){const t=await this.buildCompressedFileStream();return this.clearStream(),new Blob([t],{type:e})}static getUncompressedZipFile(e="application/zip"){const t=this.buildFileStream();return this.clearStream(),new Blob([t],{type:e})}static clearStream(){this.folders=[],this.files=[]}static packageFiles(e){let t=0,a=0;for(const n of e){const{localFileHeader:e,centralDirectoryHeader:o,content:r}=n;t+=e.length+r.length,a+=o.length}const n=new Uint8Array(t),o=new Uint8Array(a);let r=0,i=0;for(const t of e){const{localFileHeader:e,centralDirectoryHeader:a,content:s}=t;n.set(e,r),r+=e.length,n.set(s,r),r+=s.length,o.set(a,i),i+=a.length}const s=((e,t,a)=>{const n="PK\x05\x06\\0\\0\\0\\0"+P(e,2)+P(e,2)+P(t,4)+P(a,4)+"\\0\\0";return Uint8Array.from(n,(e=>e.charCodeAt(0)))})(e.length,a,t),l=new Uint8Array(n.length+o.length+s.length);return l.set(n),l.set(o,n.length),l.set(s,n.length+o.length),l}static async buildCompressedFileStream(){const e=[...this.folders,...this.files],t=[];let a=0;for(const n of e){const e=await N(n,a),{localFileHeader:o,content:r}=e;t.push(e),a+=o.length+r.length}return this.packageFiles(t)}static buildFileStream(){const e=[...this.folders,...this.files],t=[];let a=0;for(const n of e){const e=G(n,a),{localFileHeader:o,content:r}=e;t.push(e),a+=o.length+r.length}return this.packageFiles(t)}};q.folders=[],q.files=[]},9773:function(e,t,a){var n,o=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var a in t)o(e,a,{get:t[a],enumerable:!0})})(l,{InfiniteRowModelModule:()=>C}),e.exports=(n=l,((e,t,a,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===a||o(e,l,{get:()=>t[l],enumerable:!(n=r(t,l))||n.enumerable});return e})(o({},"__esModule",{value:!0}),n));var c';
      S = S + '=a(3423),g=a(3423),d=a(3423),h=a(3423),u=class extends h.RowNodeBlock{wireBeans(e){this.beans=e}constructor(e,t,a){super(e),this.parentCache=t,this.params=a,this.startRow=e*a.blockSize,this.endRow=this.startRow+a.blockSize}postConstruct(){this.createRowNodes()}getBlockStateJson(){return{id:""+this.getId(),state:{blockNumber:this.getId(),startRow:this.getStartRow(),endRow:this.getEndRow(),pageStatus:this.getState()}}}setDataAndId(e,t,a){(0,h._exists)(t)?e.setDataAndId(t,a.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();(0,h._missing)(this.params.datasource.getRows)?(0,h._warnOnce)("datasource is missing getRows method"):window.setTimeout((()=>{this.params.datasource.getRows(e)}),0)}processServerFail(){}createLoadParams(){return{startRow:this.getStartRow(),endRow:this.getEndRow(),successCallback:this.pageLoaded.bind(this,this.getVersion()),failCallback:this.pageLoadFailed.bind(this,this.getVersion()),sortModel:this.params.sortModel,filterModel:this.params.filterModel,context:this.gos.getGridCommonParams().context}}forEachNode(e,t,a){this.rowNodes.forEach(((n,o)=>{this.startRow+o<a&&e(n,t.next())}))}getLastAccessed(){return this.lastAccessed}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.next());const a=e-this.startRow;return this.rowNodes[a]}getStartRow(){return this.startRow}getEndRow(){return this.endRow}createRowNodes(){this.rowNodes=[];for(let e=0;e<this.params.blockSize;e++){const t=this.startRow+e,a=new h.RowNode(this.beans);a.setRowHeight(this.params.rowHeight),a.uiLevel=0,a.setRowIndex(t),a.setRowTop(this.params.rowHeight*t),this.rowNodes.push(a)}}processServerResult(e){this.rowNodes.forEach(((t,a)=>{const n=e.rowData?e.rowData[a]:void 0;!t.id&&t.alreadyRendered&&n&&(this.rowNodes[a]=new h.RowNode(this.beans),this.rowNodes[a].setRowIndex(t.rowIndex),this.rowNodes[a].setRowTop(t.rowTop),this.rowNodes[a].setRowHeight(t.rowHeight),t.clearRowTopAndRowIndex()),this.setDataAndId(this.rowNodes[a],n';
      S = S + ',this.startRow+a)}));const t=null!=e.rowCount&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,t)}destroy(){this.rowNodes.forEach((e=>{e.clearRowTopAndRowIndex()})),super.destroy()}},p=class extends d.BeanStub{constructor(e){super(),this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount,this.params=e}wireBeans(e){this.rowRenderer=e.rowRenderer,this.focusService=e.focusService}getRow(e,t=!1){const a=Math.floor(e/this.params.blockSize);let n=this.blocks[a];if(!n){if(t)return;n=this.createBlock(a)}return n.getRow(e)}createBlock(e){const t=this.createBean(new u(e,this,this.params));return this.blocks[t.getId()]=t,this.blockCount++,this.purgeBlocksIfNeeded(t),this.params.rowNodeBlockLoader.addBlock(t),t}refreshCache(){0==this.blockCount?this.purgeCache():(this.getBlocksInOrder().forEach((e=>e.setStateWaitingToLoad())),this.params.rowNodeBlockLoader.checkBlockToLoad())}destroy(){this.getBlocksInOrder().forEach((e=>this.destroyBlock(e))),super.destroy()}getRowCount(){return this.rowCount}isLastRowIndexKnown(){return this.lastRowIndexKnown}pageLoaded(e,t){this.isAlive()&&(this.gos.get("debug")&&(0,d._log)(`InfiniteCache - onPageLoaded: page = ${e.getId()}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter((t=>t!=e));t.sort(((e,t)=>t.getLastAccessed()-e.getLastAccessed()));const a=this.params.maxBlocksInCache>0,n=a?this.params.maxBlocksInCache-1:null;t.forEach(((e,t)=>{if("needsLoading"===e.getState()&&t>=1||!!a&&t>=n){if(this.isBlockCurrentlyDisplayed(e))return;if(this.isBlockFocused(e))return;this.removeBlockFromCache(e)}}))}isBlockFocused(e){const t=this.focusService.getFocusCellToUseAfterRefresh();if(!t)return!1;if(null!=t.rowPinned)return!1;const a=e.getStartRow(),n=e.getEndRow();return t.rowIndex>=a&&t.rowIndex<n}isBlockCurrentlyDisplayed(e){const t=e.getStartRow(),a=e.getEndRow()-1;return this.rowRenderer.isRangeInRenderedViewport(t,a)}remov';
      S = S + 'eBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if("number"==typeof t&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const t=(e.getId()+1)*this.params.blockSize+this.params.overflowSize;this.rowCount<t&&(this.rowCount=t)}}setRowCount(e,t){this.rowCount=e,(0,d._exists)(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize==0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t=new d.NumberSequence;this.getBlocksInOrder().forEach((a=>a.forEachNode(e,t,this.rowCount)))}getBlocksInOrder(){return(0,d._getAllValuesInObject)(this.blocks).sort(((e,t)=>e.getId()-t.getId()))}destroyBlock(e){delete this.blocks[e.getId()],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){if(this.isAlive()){this.destroyAllBlocksPastVirtualRowCount();const e={type:"storeUpdated"};this.eventService.dispatchEvent(e)}}destroyAllBlocksPastVirtualRowCount(){const e=[];this.getBlocksInOrder().forEach((t=>{t.getId()*this.params.blockSize>=this.rowCount&&e.push(t)})),e.length>0&&e.forEach((e=>this.destroyBlock(e)))}purgeCache(){this.getBlocksInOrder().forEach((e=>this.removeBlockFromCache(e))),this.lastRowIndexKnown=!1,0===this.rowCount&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const a=[];let n=-1,o=!1;const r=new d.NumberSequence;let i=!1;this.getBlocksInOrder().forEach((s=>{i||(o&&n+1!==s.getId()?i=!0:(n=s.getId(),s.forEachNode((n=>{const r=n===e||n===t;(o||r)&&a.push(n),r&&(o=!o)}),r,this.rowCount)))}));return i||o?[]:a}},m=class extends g.BeanStub{constructor(){super(...arguments),this.beanName="rowModel"}wireBeans(e){this.filterManager=e.filterManager,this.sortController=e.sortController,this.selectionService=e.selectionService,this.rowRenderer=e.rowRenderer,this.rowNodeBlockLoader=e.rowNodeBlockLoader}getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(){return!';
      S = S + '1}postConstruct(){this.gos.isRowModelType("infinite")&&(this.rowHeight=this.gos.getRowHeightAsNumber(),this.addEventListeners(),this.addDestroyFunc((()=>this.destroyCache())),this.verifyProps())}verifyProps(){this.gos.exists("initialGroupOrderComparator")&&(0,g._warnOnce)("initialGroupOrderComparator cannot be used with Infinite Row Model as sorting is done on the server side")}start(){this.setDatasource(this.gos.get("datasource"))}destroy(){this.destroyDatasource(),super.destroy()}destroyDatasource(){this.datasource&&(this.destroyBean(this.datasource),this.rowRenderer.datasourceChanged(),this.datasource=null)}addEventListeners(){this.addManagedEventListeners({filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),newColumnsLoaded:this.onColumnEverything.bind(this),storeUpdated:this.onCacheUpdated.bind(this)}),this.addManagedPropertyListener("datasource",(()=>this.setDatasource(this.gos.get("datasource")))),this.addManagedPropertyListener("cacheBlockSize",(()=>this.resetCache())),this.addManagedPropertyListener("rowHeight",(()=>{this.rowHeight=this.gos.getRowHeightAsNumber(),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()}))}onFilterChanged(){this.reset()}onSortChanged(){this.reset()}onColumnEverything(){let e;e=!this.cacheParams||this.isSortModelDifferent(),e&&this.reset()}isSortModelDifferent(){return!(0,g._jsonEquals)(this.cacheParams.sortModel,this.sortController.getSortModel())}getType(){return"infinite"}setDatasource(e){this.destroyDatasource(),this.datasource=e,e&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getNodesInRangeForSelection(e,t){return this.infiniteCache?this.infiniteCache.getRowNodesInRange(e,t):[]}reset(){if(!this.datasource)return;null!=this.gos.getRowIdCallback()||this.selectionService.reset("rowDataChanged"),this.resetCache()}createModelUpdatedEvent(){return{type:"modelUpdated",newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1}';
      S = S + '}resetCache(){this.destroyCache(),this.cacheParams={datasource:this.datasource,filterModel:this.filterManager?.getFilterModel()??{},sortModel:this.sortController.getSortModel(),rowNodeBlockLoader:this.rowNodeBlockLoader,initialRowCount:this.gos.get("infiniteInitialRowCount"),maxBlocksInCache:this.gos.get("maxBlocksInCache"),rowHeight:this.gos.getRowHeightAsNumber(),overflowSize:this.gos.get("cacheOverflowSize"),blockSize:this.gos.get("cacheBlockSize"),lastAccessedSequence:new g.NumberSequence},this.infiniteCache=this.createBean(new p(this.cacheParams)),this.eventService.dispatchEventOnce({type:"rowCountReady"});const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}updateRowHeights(){this.forEachNode((e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)}));const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}destroyCache(){this.infiniteCache&&(this.infiniteCache=this.destroyBean(this.infiniteCache))}onCacheUpdated(){const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}getRow(e){if(this.infiniteCache&&!(e>=this.infiniteCache.getRowCount()))return this.infiniteCache.getRow(e)}getRowNode(e){let t;return this.forEachNode((a=>{a.id===e&&(t=a)})),t}forEachNode(e){this.infiniteCache&&this.infiniteCache.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(0!==this.rowHeight){const t=Math.floor(e/this.rowHeight),a=this.getRowCount()-1;return t>a?a:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){this.infiniteCache&&this.infiniteCache.refreshCache()}purgeCache(){this.infiniteCache&&this.infiniteCache.purgeCache()}isLastRowIndexKnown(){return!!this.infiniteCache&&this.infiniteCache.isLastRowIndexKnown()}setRowCount(e,t){this.infiniteCache&&this.infiniteCache.setRowCount(e,t)}};var f="32.0.0",v={version:f,moduleName:`${c.M';
      S = S + 'oduleNames.InfiniteRowModelModule}-core`,rowModel:"infinite",beans:[m],dependantModules:[c._RowNodeBlockModule]},b={version:f,moduleName:`${c.ModuleNames.InfiniteRowModelModule}-api`,beans:[c.RowModelHelperService],apiFunctions:{refreshInfiniteCache:function(e){e.rowModelHelperService?.getInfiniteRowModel()?.refreshCache()},purgeInfiniteCache:function(e){e.rowModelHelperService?.getInfiniteRowModel()?.purgeCache()},getInfiniteRowCount:function(e){return e.rowModelHelperService?.getInfiniteRowModel()?.getRowCount()},isLastRowIndexKnown:function(e){return e.rowModelHelperService?.getInfiniteRowModel()?.isLastRowIndexKnown()}},dependantModules:[v,c._SsrmInfiniteSharedApiModule]},C={version:f,moduleName:c.ModuleNames.InfiniteRowModelModule,dependantModules:[v,b]}},8956:function(e,t,a){"use strict";var n=a(6758),o=a.n(n),r=a(935),i=a.n(r),s=a(62),l=a.n(s),c=new URL(a(2487),a.b),g=new URL(a(6080),a.b),d=i()(o()),h=l()(c),u=l()(g);d.push([e.id,\'.ag-icon {\\n  font-family: var(--ag-icon-font-family);\\n  font-weight: var(--ag-icon-font-weight);\\n  color: var(--ag-icon-font-color);\\n  font-size: var(--ag-icon-size);\\n  line-height: var(--ag-icon-size);\\n  font-style: normal;\\n  font-feature-settings: normal;\\n  font-variant: normal;\\n  text-transform: none;\\n  -webkit-font-smoothing: antialiased;\\n  -moz-osx-font-smoothing: grayscale;\\n  width: var(--ag-icon-size);\\n  height: var(--ag-icon-size);\\n  position: relative;\\n}\\n.ag-icon::before {\\n  content: "";\\n  font-family: inherit;\\n}\\n.ag-icon::after {\\n  background: transparent none center/contain no-repeat;\\n  background: transparent var(--ag-icon-image, none) center/contain no-repeat;\\n  display: var(--ag-icon-image-display);\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity, 0.9);\\n  position: absolute;\\n  top: 0;\\n  right: 0;\\n  bottom: 0;\\n  left: 0;\\n  content: "";\\n}\\n\\n.ag-icon-aggregation {\\n  font-family: var(--ag-icon-font-family-aggregation, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-w';
      S = S + 'eight-aggregation, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-aggregation, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-aggregation::before {\\n  content: "\\\\f101";\\n  content: var(--ag-icon-font-code-aggregation, "\\\\f101");\\n  display: var(--ag-icon-font-display-aggregation, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-aggregation::after {\\n  background-image: var(--ag-icon-image-aggregation, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-aggregation, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-aggregation, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-arrows {\\n  font-family: var(--ag-icon-font-family-arrows, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-arrows, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-arrows, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-arrows::before {\\n  content: "\\\\f102";\\n  content: var(--ag-icon-font-code-arrows, "\\\\f102");\\n  display: var(--ag-icon-font-display-arrows, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-arrows::after {\\n  background-image: var(--ag-icon-image-arrows, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-arrows, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-arrows, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-asc {\\n  font-family: var(--ag-icon-font-family-asc, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-asc, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-asc, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-asc::before {\\n  content: "\\\\f103";\\n  content: var(--ag-icon-font-code-asc, "\\\\f103");\\n  display: var(--ag-icon-font-display-asc, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-asc::after {\\n  background-image: var(--ag-icon-image-asc, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-asc, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-as';
      S = S + 'c, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-cancel {\\n  font-family: var(--ag-icon-font-family-cancel, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-cancel, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-cancel, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-cancel::before {\\n  content: "\\\\f104";\\n  content: var(--ag-icon-font-code-cancel, "\\\\f104");\\n  display: var(--ag-icon-font-display-cancel, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-cancel::after {\\n  background-image: var(--ag-icon-image-cancel, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-cancel, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-cancel, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-chart {\\n  font-family: var(--ag-icon-font-family-chart, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-chart, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-chart, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-chart::before {\\n  content: "\\\\f105";\\n  content: var(--ag-icon-font-code-chart, "\\\\f105");\\n  display: var(--ag-icon-font-display-chart, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-chart::after {\\n  background-image: var(--ag-icon-image-chart, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-chart, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-chart, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-checkbox-checked {\\n  font-family: var(--ag-icon-font-family-checkbox-checked, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-checkbox-checked, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-checkbox-checked, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-checkbox-checked::before {\\n  content: "\\\\f106";\\n  content: var(--ag-icon-font-code-checkbox-checked, "\\\\f106");\\n  display: var(--ag-icon-font-display-checkbox-checked, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-chec';
      S = S + 'kbox-checked::after {\\n  background-image: var(--ag-icon-image-checkbox-checked, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-checkbox-checked, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-checkbox-checked, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-checkbox-indeterminate {\\n  font-family: var(--ag-icon-font-family-checkbox-indeterminate, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-checkbox-indeterminate, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-checkbox-indeterminate, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-checkbox-indeterminate::before {\\n  content: "\\\\f107";\\n  content: var(--ag-icon-font-code-checkbox-indeterminate, "\\\\f107");\\n  display: var(--ag-icon-font-display-checkbox-indeterminate, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-checkbox-indeterminate::after {\\n  background-image: var(--ag-icon-image-checkbox-indeterminate, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-checkbox-indeterminate, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-checkbox-indeterminate, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-checkbox-unchecked {\\n  font-family: var(--ag-icon-font-family-checkbox-unchecked, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-checkbox-unchecked, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-checkbox-unchecked, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-checkbox-unchecked::before {\\n  content: "\\\\f108";\\n  content: var(--ag-icon-font-code-checkbox-unchecked, "\\\\f108");\\n  display: var(--ag-icon-font-display-checkbox-unchecked, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-checkbox-unchecked::after {\\n  background-image: var(--ag-icon-image-checkbox-unchecked, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-checkbox-unchecked, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-';
      S = S + 'checkbox-unchecked, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-color-picker {\\n  font-family: var(--ag-icon-font-family-color-picker, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-color-picker, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-color-picker, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-color-picker::before {\\n  content: "\\\\f109";\\n  content: var(--ag-icon-font-code-color-picker, "\\\\f109");\\n  display: var(--ag-icon-font-display-color-picker, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-color-picker::after {\\n  background-image: var(--ag-icon-image-color-picker, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-color-picker, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-color-picker, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-columns {\\n  font-family: var(--ag-icon-font-family-columns, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-columns, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-columns, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-columns::before {\\n  content: "\\\\f10a";\\n  content: var(--ag-icon-font-code-columns, "\\\\f10a");\\n  display: var(--ag-icon-font-display-columns, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-columns::after {\\n  background-image: var(--ag-icon-image-columns, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-columns, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-columns, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-contracted {\\n  font-family: var(--ag-icon-font-family-contracted, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-contracted, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-contracted, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-contracted::before {\\n  content: "\\\\f10b";\\n  content: var(--ag-icon-font-code-contracted, "\\\\f10b");\\n  display: var(--ag-icon-font-displa';
      S = S + 'y-contracted, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-contracted::after {\\n  background-image: var(--ag-icon-image-contracted, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-contracted, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-contracted, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-copy {\\n  font-family: var(--ag-icon-font-family-copy, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-copy, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-copy, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-copy::before {\\n  content: "\\\\f10c";\\n  content: var(--ag-icon-font-code-copy, "\\\\f10c");\\n  display: var(--ag-icon-font-display-copy, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-copy::after {\\n  background-image: var(--ag-icon-image-copy, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-copy, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-copy, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-cross {\\n  font-family: var(--ag-icon-font-family-cross, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-cross, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-cross, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-cross::before {\\n  content: "\\\\f10d";\\n  content: var(--ag-icon-font-code-cross, "\\\\f10d");\\n  display: var(--ag-icon-font-display-cross, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-cross::after {\\n  background-image: var(--ag-icon-image-cross, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-cross, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-cross, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-csv {\\n  font-family: var(--ag-icon-font-family-csv, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-csv, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-csv, var(--ag-icon-font-color));\\n}\\n\\';
      S = S + 'n.ag-icon-csv::before {\\n  content: "\\\\f10e";\\n  content: var(--ag-icon-font-code-csv, "\\\\f10e");\\n  display: var(--ag-icon-font-display-csv, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-csv::after {\\n  background-image: var(--ag-icon-image-csv, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-csv, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-csv, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-cut {\\n  font-family: var(--ag-icon-font-family-cut, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-cut, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-cut, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-cut::before {\\n  content: "\\\\f10f";\\n  content: var(--ag-icon-font-code-cut, "\\\\f10f");\\n  display: var(--ag-icon-font-display-cut, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-cut::after {\\n  background-image: var(--ag-icon-image-cut, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-cut, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-cut, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-desc {\\n  font-family: var(--ag-icon-font-family-desc, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-desc, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-desc, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-desc::before {\\n  content: "\\\\f110";\\n  content: var(--ag-icon-font-code-desc, "\\\\f110");\\n  display: var(--ag-icon-font-display-desc, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-desc::after {\\n  background-image: var(--ag-icon-image-desc, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-desc, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-desc, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-excel {\\n  font-family: var(--ag-icon-font-family-excel, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-excel, var(--ag-icon-font';
      S = S + '-weight));\\n  color: var(--ag-icon-font-color-excel, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-excel::before {\\n  content: "\\\\f111";\\n  content: var(--ag-icon-font-code-excel, "\\\\f111");\\n  display: var(--ag-icon-font-display-excel, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-excel::after {\\n  background-image: var(--ag-icon-image-excel, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-excel, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-excel, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-expanded {\\n  font-family: var(--ag-icon-font-family-expanded, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-expanded, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-expanded, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-expanded::before {\\n  content: "\\\\f112";\\n  content: var(--ag-icon-font-code-expanded, "\\\\f112");\\n  display: var(--ag-icon-font-display-expanded, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-expanded::after {\\n  background-image: var(--ag-icon-image-expanded, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-expanded, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-expanded, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-eye-slash {\\n  font-family: var(--ag-icon-font-family-eye-slash, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-eye-slash, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-eye-slash, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-eye-slash::before {\\n  content: "\\\\f113";\\n  content: var(--ag-icon-font-code-eye-slash, "\\\\f113");\\n  display: var(--ag-icon-font-display-eye-slash, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-eye-slash::after {\\n  background-image: var(--ag-icon-image-eye-slash, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-eye-slash, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-eye-s';
      S = S + 'lash, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-eye {\\n  font-family: var(--ag-icon-font-family-eye, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-eye, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-eye, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-eye::before {\\n  content: "\\\\f114";\\n  content: var(--ag-icon-font-code-eye, "\\\\f114");\\n  display: var(--ag-icon-font-display-eye, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-eye::after {\\n  background-image: var(--ag-icon-image-eye, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-eye, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-eye, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-filter {\\n  font-family: var(--ag-icon-font-family-filter, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-filter, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-filter, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-filter::before {\\n  content: "\\\\f115";\\n  content: var(--ag-icon-font-code-filter, "\\\\f115");\\n  display: var(--ag-icon-font-display-filter, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-filter::after {\\n  background-image: var(--ag-icon-image-filter, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-filter, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-filter, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-first {\\n  font-family: var(--ag-icon-font-family-first, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-first, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-first, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-first::before {\\n  content: "\\\\f116";\\n  content: var(--ag-icon-font-code-first, "\\\\f116");\\n  display: var(--ag-icon-font-display-first, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-first::after {\\n  background-image: var(--ag-icon-image-first, var(--ag-icon-image));\\n  display: va';
      S = S + 'r(--ag-icon-image-display-first, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-first, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-grip {\\n  font-family: var(--ag-icon-font-family-grip, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-grip, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-grip, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-grip::before {\\n  content: "\\\\f117";\\n  content: var(--ag-icon-font-code-grip, "\\\\f117");\\n  display: var(--ag-icon-font-display-grip, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-grip::after {\\n  background-image: var(--ag-icon-image-grip, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-grip, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-grip, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-group {\\n  font-family: var(--ag-icon-font-family-group, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-group, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-group, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-group::before {\\n  content: "\\\\f118";\\n  content: var(--ag-icon-font-code-group, "\\\\f118");\\n  display: var(--ag-icon-font-display-group, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-group::after {\\n  background-image: var(--ag-icon-image-group, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-group, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-group, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-last {\\n  font-family: var(--ag-icon-font-family-last, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-last, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-last, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-last::before {\\n  content: "\\\\f119";\\n  content: var(--ag-icon-font-code-last, "\\\\f119");\\n  display: var(--ag-icon-font-display-last, var(--ag-icon-font-display));\\';
      S = S + 'n}\\n\\n.ag-icon-last::after {\\n  background-image: var(--ag-icon-image-last, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-last, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-last, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-left {\\n  font-family: var(--ag-icon-font-family-left, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-left, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-left, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-left::before {\\n  content: "\\\\f11a";\\n  content: var(--ag-icon-font-code-left, "\\\\f11a");\\n  display: var(--ag-icon-font-display-left, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-left::after {\\n  background-image: var(--ag-icon-image-left, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-left, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-left, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-linked {\\n  font-family: var(--ag-icon-font-family-linked, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-linked, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-linked, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-linked::before {\\n  content: "\\\\f11b";\\n  content: var(--ag-icon-font-code-linked, "\\\\f11b");\\n  display: var(--ag-icon-font-display-linked, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-linked::after {\\n  background-image: var(--ag-icon-image-linked, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-linked, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-linked, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-loading {\\n  font-family: var(--ag-icon-font-family-loading, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-loading, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-loading, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-loading::before {\\n  content: "';
      S = S + '\\\\f11c";\\n  content: var(--ag-icon-font-code-loading, "\\\\f11c");\\n  display: var(--ag-icon-font-display-loading, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-loading::after {\\n  background-image: var(--ag-icon-image-loading, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-loading, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-loading, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-maximize {\\n  font-family: var(--ag-icon-font-family-maximize, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-maximize, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-maximize, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-maximize::before {\\n  content: "\\\\f11d";\\n  content: var(--ag-icon-font-code-maximize, "\\\\f11d");\\n  display: var(--ag-icon-font-display-maximize, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-maximize::after {\\n  background-image: var(--ag-icon-image-maximize, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-maximize, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-maximize, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-menu {\\n  font-family: var(--ag-icon-font-family-menu, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-menu, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-menu, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-menu::before {\\n  content: "\\\\f11e";\\n  content: var(--ag-icon-font-code-menu, "\\\\f11e");\\n  display: var(--ag-icon-font-display-menu, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-menu::after {\\n  background-image: var(--ag-icon-image-menu, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-menu, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-menu, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-minimize {\\n  font-family: var(--ag-icon-font-family-minimize, var(--ag-icon-font-family));\\n  font-weight: var';
      S = S + '(--ag-icon-font-weight-minimize, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-minimize, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-minimize::before {\\n  content: "\\\\f11f";\\n  content: var(--ag-icon-font-code-minimize, "\\\\f11f");\\n  display: var(--ag-icon-font-display-minimize, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-minimize::after {\\n  background-image: var(--ag-icon-image-minimize, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-minimize, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-minimize, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-next {\\n  font-family: var(--ag-icon-font-family-next, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-next, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-next, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-next::before {\\n  content: "\\\\f120";\\n  content: var(--ag-icon-font-code-next, "\\\\f120");\\n  display: var(--ag-icon-font-display-next, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-next::after {\\n  background-image: var(--ag-icon-image-next, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-next, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-next, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-none {\\n  font-family: var(--ag-icon-font-family-none, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-none, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-none, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-none::before {\\n  content: "\\\\f121";\\n  content: var(--ag-icon-font-code-none, "\\\\f121");\\n  display: var(--ag-icon-font-display-none, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-none::after {\\n  background-image: var(--ag-icon-image-none, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-none, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-none, var(--ag-icon-imag';
      S = S + 'e-opacity, 0.9));\\n}\\n\\n.ag-icon-not-allowed {\\n  font-family: var(--ag-icon-font-family-not-allowed, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-not-allowed, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-not-allowed, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-not-allowed::before {\\n  content: "\\\\f122";\\n  content: var(--ag-icon-font-code-not-allowed, "\\\\f122");\\n  display: var(--ag-icon-font-display-not-allowed, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-not-allowed::after {\\n  background-image: var(--ag-icon-image-not-allowed, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-not-allowed, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-not-allowed, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-paste {\\n  font-family: var(--ag-icon-font-family-paste, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-paste, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-paste, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-paste::before {\\n  content: "\\\\f123";\\n  content: var(--ag-icon-font-code-paste, "\\\\f123");\\n  display: var(--ag-icon-font-display-paste, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-paste::after {\\n  background-image: var(--ag-icon-image-paste, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-paste, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-paste, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-pin {\\n  font-family: var(--ag-icon-font-family-pin, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-pin, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-pin, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-pin::before {\\n  content: "\\\\f124";\\n  content: var(--ag-icon-font-code-pin, "\\\\f124");\\n  display: var(--ag-icon-font-display-pin, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-pin::after {\\n  background-image: var(--ag-icon-image-pin, va';
      S = S + 'r(--ag-icon-image));\\n  display: var(--ag-icon-image-display-pin, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-pin, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-pivot {\\n  font-family: var(--ag-icon-font-family-pivot, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-pivot, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-pivot, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-pivot::before {\\n  content: "\\\\f125";\\n  content: var(--ag-icon-font-code-pivot, "\\\\f125");\\n  display: var(--ag-icon-font-display-pivot, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-pivot::after {\\n  background-image: var(--ag-icon-image-pivot, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-pivot, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-pivot, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-previous {\\n  font-family: var(--ag-icon-font-family-previous, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-previous, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-previous, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-previous::before {\\n  content: "\\\\f126";\\n  content: var(--ag-icon-font-code-previous, "\\\\f126");\\n  display: var(--ag-icon-font-display-previous, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-previous::after {\\n  background-image: var(--ag-icon-image-previous, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-previous, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-previous, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-radio-button-off {\\n  font-family: var(--ag-icon-font-family-radio-button-off, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-radio-button-off, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-radio-button-off, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-radio-button-off::before {\\n  content: "\\\\';
      S = S + 'f127";\\n  content: var(--ag-icon-font-code-radio-button-off, "\\\\f127");\\n  display: var(--ag-icon-font-display-radio-button-off, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-radio-button-off::after {\\n  background-image: var(--ag-icon-image-radio-button-off, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-radio-button-off, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-radio-button-off, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-radio-button-on {\\n  font-family: var(--ag-icon-font-family-radio-button-on, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-radio-button-on, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-radio-button-on, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-radio-button-on::before {\\n  content: "\\\\f128";\\n  content: var(--ag-icon-font-code-radio-button-on, "\\\\f128");\\n  display: var(--ag-icon-font-display-radio-button-on, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-radio-button-on::after {\\n  background-image: var(--ag-icon-image-radio-button-on, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-radio-button-on, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-radio-button-on, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-right {\\n  font-family: var(--ag-icon-font-family-right, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-right, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-right, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-right::before {\\n  content: "\\\\f129";\\n  content: var(--ag-icon-font-code-right, "\\\\f129");\\n  display: var(--ag-icon-font-display-right, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-right::after {\\n  background-image: var(--ag-icon-image-right, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-right, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-right, var(--ag-icon-image-op';
      S = S + 'acity, 0.9));\\n}\\n\\n.ag-icon-save {\\n  font-family: var(--ag-icon-font-family-save, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-save, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-save, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-save::before {\\n  content: "\\\\f12a";\\n  content: var(--ag-icon-font-code-save, "\\\\f12a");\\n  display: var(--ag-icon-font-display-save, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-save::after {\\n  background-image: var(--ag-icon-image-save, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-save, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-save, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-small-down {\\n  font-family: var(--ag-icon-font-family-small-down, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-small-down, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-small-down, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-small-down::before {\\n  content: "\\\\f12b";\\n  content: var(--ag-icon-font-code-small-down, "\\\\f12b");\\n  display: var(--ag-icon-font-display-small-down, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-small-down::after {\\n  background-image: var(--ag-icon-image-small-down, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-small-down, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-small-down, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-small-left {\\n  font-family: var(--ag-icon-font-family-small-left, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-small-left, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-small-left, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-small-left::before {\\n  content: "\\\\f12c";\\n  content: var(--ag-icon-font-code-small-left, "\\\\f12c");\\n  display: var(--ag-icon-font-display-small-left, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-small-left::after {\\n  background-imag';
      S = S + 'e: var(--ag-icon-image-small-left, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-small-left, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-small-left, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-small-right {\\n  font-family: var(--ag-icon-font-family-small-right, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-small-right, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-small-right, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-small-right::before {\\n  content: "\\\\f12d";\\n  content: var(--ag-icon-font-code-small-right, "\\\\f12d");\\n  display: var(--ag-icon-font-display-small-right, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-small-right::after {\\n  background-image: var(--ag-icon-image-small-right, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-small-right, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-small-right, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-small-up {\\n  font-family: var(--ag-icon-font-family-small-up, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-small-up, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-small-up, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-small-up::before {\\n  content: "\\\\f12e";\\n  content: var(--ag-icon-font-code-small-up, "\\\\f12e");\\n  display: var(--ag-icon-font-display-small-up, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-small-up::after {\\n  background-image: var(--ag-icon-image-small-up, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-small-up, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-small-up, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-tick {\\n  font-family: var(--ag-icon-font-family-tick, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-tick, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-tick, var(--ag-icon-fo';
      S = S + 'nt-color));\\n}\\n\\n.ag-icon-tick::before {\\n  content: "\\\\f12f";\\n  content: var(--ag-icon-font-code-tick, "\\\\f12f");\\n  display: var(--ag-icon-font-display-tick, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-tick::after {\\n  background-image: var(--ag-icon-image-tick, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-tick, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-tick, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-tree-closed {\\n  font-family: var(--ag-icon-font-family-tree-closed, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-tree-closed, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-tree-closed, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-tree-closed::before {\\n  content: "\\\\f130";\\n  content: var(--ag-icon-font-code-tree-closed, "\\\\f130");\\n  display: var(--ag-icon-font-display-tree-closed, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-tree-closed::after {\\n  background-image: var(--ag-icon-image-tree-closed, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-tree-closed, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-tree-closed, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-tree-indeterminate {\\n  font-family: var(--ag-icon-font-family-tree-indeterminate, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-tree-indeterminate, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-tree-indeterminate, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-tree-indeterminate::before {\\n  content: "\\\\f131";\\n  content: var(--ag-icon-font-code-tree-indeterminate, "\\\\f131");\\n  display: var(--ag-icon-font-display-tree-indeterminate, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-tree-indeterminate::after {\\n  background-image: var(--ag-icon-image-tree-indeterminate, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-tree-indeterminate, var(--ag-icon-image-display));\\n  opacity: 0.9';
      S = S + ';\\n  opacity: var(--ag-icon-image-opacity-tree-indeterminate, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-tree-open {\\n  font-family: var(--ag-icon-font-family-tree-open, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-tree-open, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-tree-open, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-tree-open::before {\\n  content: "\\\\f132";\\n  content: var(--ag-icon-font-code-tree-open, "\\\\f132");\\n  display: var(--ag-icon-font-display-tree-open, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-tree-open::after {\\n  background-image: var(--ag-icon-image-tree-open, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-tree-open, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-tree-open, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-unlinked {\\n  font-family: var(--ag-icon-font-family-unlinked, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-unlinked, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-unlinked, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-unlinked::before {\\n  content: "\\\\f133";\\n  content: var(--ag-icon-font-code-unlinked, "\\\\f133");\\n  display: var(--ag-icon-font-display-unlinked, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-unlinked::after {\\n  background-image: var(--ag-icon-image-unlinked, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-unlinked, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-unlinked, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-up {\\n  font-family: var(--ag-icon-font-family-up, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-up, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-up, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-up::before {\\n  content: "\\\\f134";\\n  content: var(--ag-icon-font-code-up, "\\\\f134");\\n  display: var(--ag-icon-font-display-up, var(--ag-icon-font-dis';
      S = S + 'play));\\n}\\n\\n.ag-icon-up::after {\\n  background-image: var(--ag-icon-image-up, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-up, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-up, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-down {\\n  font-family: var(--ag-icon-font-family-down, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-down, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-down, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-down::before {\\n  content: "\\\\f135";\\n  content: var(--ag-icon-font-code-down, "\\\\f135");\\n  display: var(--ag-icon-font-display-down, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-down::after {\\n  background-image: var(--ag-icon-image-down, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-down, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-down, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-plus {\\n  font-family: var(--ag-icon-font-family-plus, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-plus, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-plus, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-plus::before {\\n  content: "\\\\f136";\\n  content: var(--ag-icon-font-code-plus, "\\\\f136");\\n  display: var(--ag-icon-font-display-plus, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-plus::after {\\n  background-image: var(--ag-icon-image-plus, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-plus, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-plus, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-minus {\\n  font-family: var(--ag-icon-font-family-minus, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-minus, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-minus, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-minus::before {\\n  content: "\\\\f137";\\n  content: var(--ag-ic';
      S = S + 'on-font-code-minus, "\\\\f137");\\n  display: var(--ag-icon-font-display-minus, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-minus::after {\\n  background-image: var(--ag-icon-image-minus, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-minus, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-minus, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-menu-alt {\\n  font-family: var(--ag-icon-font-family-menu-alt, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-menu-alt, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-menu-alt, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-menu-alt::before {\\n  content: "\\\\f138";\\n  content: var(--ag-icon-font-code-menu-alt, "\\\\f138");\\n  display: var(--ag-icon-font-display-menu-alt, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-menu-alt::after {\\n  background-image: var(--ag-icon-image-menu-alt, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-menu-alt, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-menu-alt, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-settings {\\n  font-family: var(--ag-icon-font-family-settings, var(--ag-icon-font-family));\\n  font-weight: var(--ag-icon-font-weight-settings, var(--ag-icon-font-weight));\\n  color: var(--ag-icon-font-color-settings, var(--ag-icon-font-color));\\n}\\n\\n.ag-icon-settings::before {\\n  content: "\\\\f139";\\n  content: var(--ag-icon-font-code-settings, "\\\\f139");\\n  display: var(--ag-icon-font-display-settings, var(--ag-icon-font-display));\\n}\\n\\n.ag-icon-settings::after {\\n  background-image: var(--ag-icon-image-settings, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-settings, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-settings, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-icon-row-drag::before {\\n  content: var(--ag-icon-font-code-grip);\\n}\\n\\n.ag-left-arrow::before {\\n  content: var(--';
      S = S + "ag-icon-font-code-left);\\n}\\n\\n.ag-right-arrow::before {\\n  content: var(--ag-icon-font-code-right);\\n}\\n\\n[class*=ag-theme-] {\\n  --ag-foreground-color: #000;\\n  --ag-data-color: var(--ag-foreground-color);\\n  --ag-secondary-foreground-color: var(--ag-foreground-color);\\n  --ag-header-foreground-color: var(--ag-secondary-foreground-color);\\n  --ag-disabled-foreground-color: rgba(0, 0, 0, 0.5);\\n  --ag-background-color: #fff;\\n  --ag-header-background-color: transparent;\\n  --ag-tooltip-background-color: transparent;\\n  --ag-subheader-background-color: transparent;\\n  --ag-subheader-toolbar-background-color: transparent;\\n  --ag-control-panel-background-color: transparent;\\n  --ag-side-button-selected-background-color: var(--ag-control-panel-background-color);\\n  --ag-selected-row-background-color: #bbb;\\n  --ag-odd-row-background-color: var(--ag-background-color);\\n  --ag-modal-overlay-background-color: rgba(255, 255, 255, 0.66);\\n  --ag-menu-background-color: var(--ag-background-color);\\n  --ag-menu-border-color: var(--ag-border-color);\\n  --ag-panel-background-color: var(--ag-background-color);\\n  --ag-panel-border-color: var(--ag-border-color);\\n  --ag-row-hover-color: transparent;\\n  --ag-column-hover-color: transparent;\\n  --ag-range-selection-border-color: var(--ag-foreground-color);\\n  --ag-range-selection-border-style: solid;\\n  --ag-range-selection-background-color: rgba(0, 0, 0, 0.2);\\n  --ag-range-selection-background-color-2: var(--ag-range-selection-background-color);\\n  --ag-range-selection-background-color-3: var(--ag-range-selection-background-color);\\n  --ag-range-selection-background-color-4: var(--ag-range-selection-background-color);\\n  --ag-range-selection-highlight-color: var(--ag-range-selection-border-color);\\n  --ag-selected-tab-underline-color: var(--ag-range-selection-border-color);\\n  --ag-selected-tab-underline-width: 0;\\n  --ag-selected-tab-underline-transition-speed: 0s;\\n  --ag-range-selection-chart-category-background-color: rgba(0,";
      S = S + " 255, 132, 0.1);\\n  --ag-range-selection-chart-background-color: rgba(0, 88, 255, 0.1);\\n  --ag-header-cell-hover-background-color: transparent;\\n  --ag-header-cell-moving-background-color: var(--ag-background-color);\\n  --ag-value-change-value-highlight-background-color: rgba(22, 160, 133, 0.5);\\n  --ag-value-change-delta-up-color: #43a047;\\n  --ag-value-change-delta-down-color: #e53935;\\n  --ag-row-loading-skeleton-effect-color: rgba(66, 66, 66, 0.2);\\n  --ag-chip-background-color: transparent;\\n  --ag-chip-border-color: var(--ag-chip-background-color);\\n  --ag-borders: solid 1px;\\n  --ag-border-color: rgba(0, 0, 0, 0.25);\\n  --ag-borders-critical: var(--ag-borders);\\n  --ag-borders-secondary: var(--ag-borders);\\n  --ag-secondary-border-color: var(--ag-border-color);\\n  --ag-row-border-style: solid;\\n  --ag-row-border-color: var(--ag-secondary-border-color);\\n  --ag-row-border-width: 1px;\\n  --ag-cell-horizontal-border: solid transparent;\\n  --ag-borders-input: var(--ag-borders-secondary);\\n  --ag-input-border-color: var(--ag-secondary-border-color);\\n  --ag-borders-input-invalid: solid 2px;\\n  --ag-input-border-color-invalid: var(--ag-invalid-color);\\n  --ag-borders-side-button: var(--ag-borders);\\n  --ag-border-radius: 0px;\\n  --ag-wrapper-border-radius: var(--ag-border-radius);\\n  --ag-row-border-color: var(--ag-secondary-border-color);\\n  --ag-header-column-separator-display: none;\\n  --ag-header-column-separator-height: 100%;\\n  --ag-header-column-separator-width: 1px;\\n  --ag-header-column-separator-color: var(--ag-secondary-border-color);\\n  --ag-header-column-resize-handle-display: none;\\n  --ag-header-column-resize-handle-height: 50%;\\n  --ag-header-column-resize-handle-width: 1px;\\n  --ag-header-column-resize-handle-color: var(--ag-secondary-border-color);\\n  --ag-invalid-color: red;\\n  --ag-input-disabled-border-color: var(--ag-input-border-color);\\n  --ag-input-disabled-background-color: transparent;\\n  --ag-checkbox-background-color: transparent;\\n  -";
      S = S + "-ag-checkbox-border-radius: var(--ag-border-radius);\\n  --ag-checkbox-checked-color: var(--ag-foreground-color);\\n  --ag-checkbox-unchecked-color: var(--ag-foreground-color);\\n  --ag-checkbox-indeterminate-color: var(--ag-checkbox-unchecked-color);\\n  --ag-toggle-button-off-border-color: var(--ag-checkbox-unchecked-color);\\n  --ag-toggle-button-off-background-color: var(--ag-checkbox-unchecked-color);\\n  --ag-toggle-button-on-border-color: var(--ag-checkbox-checked-color);\\n  --ag-toggle-button-on-background-color: var(--ag-checkbox-checked-color);\\n  --ag-toggle-button-switch-background-color: var(--ag-background-color);\\n  --ag-toggle-button-switch-border-color: var(--ag-toggle-button-off-border-color);\\n  --ag-toggle-button-border-width: 1px;\\n  --ag-toggle-button-height: var(--ag-icon-size);\\n  --ag-toggle-button-width: calc(var(--ag-toggle-button-height) * 2);\\n  --ag-input-focus-box-shadow: none;\\n  --ag-input-focus-border-color: none;\\n  --ag-minichart-selected-chart-color: var(--ag-checkbox-checked-color);\\n  --ag-minichart-selected-page-color: var(--ag-checkbox-checked-color);\\n  --ag-grid-size: 4px;\\n  --ag-icon-size: 12px;\\n  --ag-icon-font-weight: normal;\\n  --ag-icon-font-color: var(--ag-foreground-color);\\n  --ag-icon-image-display: block;\\n  --ag-widget-container-horizontal-padding: calc(var(--ag-grid-size) * 1.5);\\n  --ag-widget-container-vertical-padding: calc(var(--ag-grid-size) * 1.5);\\n  --ag-widget-horizontal-spacing: calc(var(--ag-grid-size) * 2);\\n  --ag-widget-vertical-spacing: var(--ag-grid-size);\\n  --ag-cell-horizontal-padding: calc(var(--ag-grid-size) * 3);\\n  --ag-cell-widget-spacing: var(--ag-cell-horizontal-padding);\\n  --ag-row-height: calc(var(--ag-grid-size) * 6 + 1px);\\n  --ag-header-height: var(--ag-row-height);\\n  --ag-list-item-height: calc(var(--ag-grid-size) * 5);\\n  --ag-column-select-indent-size: calc(var(--ag-grid-size) + var(--ag-icon-size));\\n  --ag-set-filter-indent-size: calc(var(--ag-grid-size) + var(--ag-icon-size));\\";
      S = S + 'n  --ag-advanced-filter-builder-indent-size: calc(var(--ag-grid-size) * 2 + var(--ag-icon-size));\\n  --ag-row-group-indent-size: calc(var(--ag-cell-widget-spacing) + var(--ag-icon-size));\\n  --ag-filter-tool-panel-group-indent: 16px;\\n  --ag-tab-min-width: 220px;\\n  --ag-chart-menu-panel-width: var(--ag-tab-min-width);\\n  --ag-menu-min-width: 181px;\\n  --ag-side-bar-panel-width: 200px;\\n  --ag-font-family: "Helvetica Neue", sans-serif;\\n  --ag-font-size: 14px;\\n  --ag-card-radius: var(--ag-border-radius);\\n  --ag-card-shadow: none;\\n  --ag-popup-shadow: 5px 5px 10px rgba(0, 0, 0, 0.3);\\n  --ag-advanced-filter-join-pill-color: #f08e8d;\\n  --ag-advanced-filter-column-pill-color: #a6e194;\\n  --ag-advanced-filter-option-pill-color: #f3c08b;\\n  --ag-advanced-filter-value-pill-color: #85c0e4;\\n}\\n\\n.ag-root-wrapper,\\n.ag-sticky-top,\\n.ag-sticky-bottom,\\n.ag-dnd-ghost {\\n  background-color: var(--ag-background-color);\\n}\\n\\n.ag-root-wrapper,\\n.ag-popup {\\n  --ag-indentation-level: 0;\\n}\\n\\n[class*=ag-theme-] {\\n  -webkit-font-smoothing: antialiased;\\n  font-family: var(--ag-font-family);\\n  font-size: var(--ag-font-size);\\n  line-height: normal;\\n  color: var(--ag-foreground-color);\\n}\\n\\nag-grid,\\nag-grid-angular,\\nag-grid-ng2,\\nag-grid-polymer,\\nag-grid-aurelia {\\n  display: block;\\n}\\n\\n.ag-aria-description-container {\\n  z-index: 9999;\\n  border: 0px;\\n  clip: rect(1px, 1px, 1px, 1px);\\n  height: 1px;\\n  width: 1px;\\n  position: absolute;\\n  overflow: hidden;\\n  padding: 0px;\\n  white-space: nowrap;\\n}\\n\\n.ag-hidden {\\n  display: none !important;\\n}\\n\\n.ag-invisible {\\n  visibility: hidden !important;\\n}\\n\\n.ag-drag-handle {\\n  cursor: grab;\\n}\\n\\n.ag-column-drop-wrapper {\\n  display: flex;\\n}\\n\\n.ag-column-drop-horizontal-half-width {\\n  display: inline-block;\\n  width: 50% !important;\\n}\\n\\n.ag-unselectable {\\n  -moz-user-select: none;\\n  -webkit-user-select: none;\\n  user-select: none;\\n}\\n\\n.ag-selectable {\\n  -moz-user-select: text;\\n  -webkit-user-select: text;\\n';
      S = S + '  user-select: text;\\n}\\n\\n.ag-tab {\\n  position: relative;\\n}\\n\\n.ag-tab-guard {\\n  position: absolute;\\n  width: 0;\\n  height: 0;\\n  display: block;\\n}\\n\\n.ag-virtual-list-viewport .ag-tab-guard {\\n  position: sticky;\\n}\\n\\n.ag-tab-guard-top {\\n  top: 1px;\\n}\\n\\n.ag-tab-guard-bottom {\\n  bottom: 1px;\\n}\\n\\n.ag-select-agg-func-popup {\\n  position: absolute;\\n}\\n\\n.ag-input-wrapper,\\n.ag-picker-field-wrapper {\\n  display: flex;\\n  flex: 1 1 auto;\\n  align-items: center;\\n  line-height: normal;\\n  position: relative;\\n}\\n\\n.ag-shake-left-to-right {\\n  animation-direction: alternate;\\n  animation-duration: 0.2s;\\n  animation-iteration-count: infinite;\\n  animation-name: ag-shake-left-to-right;\\n}\\n\\n@keyframes ag-shake-left-to-right {\\n  from {\\n    padding-left: 6px;\\n    padding-right: 2px;\\n  }\\n  to {\\n    padding-left: 2px;\\n    padding-right: 6px;\\n  }\\n}\\n.ag-root-wrapper {\\n  cursor: default;\\n  position: relative;\\n  display: flex;\\n  flex-direction: column;\\n  overflow: hidden;\\n  white-space: normal;\\n}\\n.ag-root-wrapper.ag-layout-normal {\\n  height: 100%;\\n}\\n\\n.ag-watermark {\\n  position: absolute;\\n  bottom: 20px;\\n  right: 25px;\\n  opacity: 0.7;\\n  transition: opacity 1s ease-out 3s;\\n  color: #9b9b9b;\\n}\\n.ag-watermark::before {\\n  content: "";\\n  background-image: url(\'+h+");\\n  background-repeat: no-repeat;\\n  background-size: 170px 40px;\\n  display: block;\\n  height: 40px;\\n  width: 170px;\\n}\\n\\n.ag-watermark-text {\\n  opacity: 0.5;\\n  font-weight: bold;\\n  font-family: Impact, sans-serif;\\n  font-size: 19px;\\n  padding-left: 0.7rem;\\n}\\n\\n.ag-root-wrapper-body {\\n  display: flex;\\n  flex-direction: row;\\n}\\n.ag-root-wrapper-body.ag-layout-normal {\\n  flex: 1 1 auto;\\n  height: 0;\\n  min-height: 0;\\n}\\n\\n.ag-root {\\n  position: relative;\\n  display: flex;\\n  flex-direction: column;\\n}\\n.ag-root.ag-layout-normal, .ag-root.ag-layout-auto-height {\\n  overflow: hidden;\\n  flex: 1 1 auto;\\n  width: 0;\\n}\\n.ag-root.ag-layout-normal {\\n  height: 100%;\\n}\\n';
      S = S + "\\n.ag-header-viewport,\\n.ag-floating-top-viewport,\\n.ag-body-viewport,\\n.ag-center-cols-viewport,\\n.ag-floating-bottom-viewport,\\n.ag-body-horizontal-scroll-viewport,\\n.ag-body-vertical-scroll-viewport,\\n.ag-virtual-list-viewport,\\n.ag-sticky-top-viewport,\\n.ag-sticky-bottom-viewport {\\n  position: relative;\\n  height: 100%;\\n  min-width: 0px;\\n  overflow: hidden;\\n  flex: 1 1 auto;\\n}\\n\\n.ag-body-viewport,\\n.ag-center-cols-viewport {\\n  -ms-overflow-style: none !important;\\n  scrollbar-width: none !important;\\n}\\n.ag-body-viewport::-webkit-scrollbar,\\n.ag-center-cols-viewport::-webkit-scrollbar {\\n  display: none !important;\\n}\\n\\n.ag-body-viewport {\\n  display: flex;\\n}\\n.ag-body-viewport.ag-layout-normal {\\n  overflow-y: auto;\\n  -webkit-overflow-scrolling: touch;\\n}\\n\\n.ag-center-cols-viewport {\\n  min-height: 100%;\\n  width: 100%;\\n  overflow-x: auto;\\n}\\n\\n.ag-body-horizontal-scroll-viewport {\\n  overflow-x: scroll;\\n}\\n\\n.ag-body-vertical-scroll-viewport {\\n  overflow-y: scroll;\\n}\\n\\n.ag-virtual-list-viewport {\\n  overflow: auto;\\n  width: 100%;\\n}\\n\\n.ag-header-container,\\n.ag-floating-top-container,\\n.ag-body-container,\\n.ag-pinned-right-cols-container,\\n.ag-center-cols-container,\\n.ag-pinned-left-cols-container,\\n.ag-floating-bottom-container,\\n.ag-body-horizontal-scroll-container,\\n.ag-body-vertical-scroll-container,\\n.ag-full-width-container,\\n.ag-floating-bottom-full-width-container,\\n.ag-virtual-list-container,\\n.ag-sticky-top-container,\\n.ag-sticky-bottom-container {\\n  position: relative;\\n}\\n\\n.ag-header-container,\\n.ag-floating-top-container,\\n.ag-floating-bottom-container,\\n.ag-sticky-top-container,\\n.ag-sticky-bottom-container {\\n  height: 100%;\\n  white-space: nowrap;\\n}\\n\\n.ag-center-cols-container {\\n  display: block;\\n}\\n\\n.ag-pinned-right-cols-container {\\n  display: block;\\n}\\n\\n.ag-body-horizontal-scroll-container {\\n  height: 100%;\\n}\\n\\n.ag-body-vertical-scroll-container {\\n  width: 100%;\\n}\\n\\n.ag-full-width-container,\\n.ag-floating-to";
      S = S + "p-full-width-container,\\n.ag-floating-bottom-full-width-container,\\n.ag-sticky-top-full-width-container,\\n.ag-sticky-bottom-full-width-container {\\n  position: absolute;\\n  top: 0px;\\n  pointer-events: none;\\n}\\n.ag-ltr .ag-full-width-container,\\n.ag-ltr .ag-floating-top-full-width-container,\\n.ag-ltr .ag-floating-bottom-full-width-container,\\n.ag-ltr .ag-sticky-top-full-width-container,\\n.ag-ltr .ag-sticky-bottom-full-width-container {\\n  left: 0;\\n}\\n.ag-rtl .ag-full-width-container,\\n.ag-rtl .ag-floating-top-full-width-container,\\n.ag-rtl .ag-floating-bottom-full-width-container,\\n.ag-rtl .ag-sticky-top-full-width-container,\\n.ag-rtl .ag-sticky-bottom-full-width-container {\\n  right: 0;\\n}\\n\\n.ag-full-width-container {\\n  width: 100%;\\n}\\n\\n.ag-floating-bottom-full-width-container,\\n.ag-floating-top-full-width-container {\\n  display: inline-block;\\n  overflow: hidden;\\n  height: 100%;\\n  width: 100%;\\n}\\n\\n.ag-virtual-list-container {\\n  overflow: hidden;\\n}\\n\\n.ag-body {\\n  position: relative;\\n  display: flex;\\n  flex: 1 1 auto;\\n  flex-direction: row !important;\\n  min-height: 0;\\n}\\n\\n.ag-body-horizontal-scroll,\\n.ag-body-vertical-scroll {\\n  min-height: 0;\\n  min-width: 0;\\n  display: flex;\\n  position: relative;\\n}\\n.ag-body-horizontal-scroll.ag-scrollbar-invisible,\\n.ag-body-vertical-scroll.ag-scrollbar-invisible {\\n  position: absolute;\\n  bottom: 0;\\n}\\n.ag-body-horizontal-scroll.ag-scrollbar-invisible.ag-apple-scrollbar,\\n.ag-body-vertical-scroll.ag-scrollbar-invisible.ag-apple-scrollbar {\\n  opacity: 0;\\n  transition: opacity 400ms;\\n  visibility: hidden;\\n}\\n.ag-body-horizontal-scroll.ag-scrollbar-invisible.ag-apple-scrollbar.ag-scrollbar-scrolling, .ag-body-horizontal-scroll.ag-scrollbar-invisible.ag-apple-scrollbar.ag-scrollbar-active,\\n.ag-body-vertical-scroll.ag-scrollbar-invisible.ag-apple-scrollbar.ag-scrollbar-scrolling,\\n.ag-body-vertical-scroll.ag-scrollbar-invisible.ag-apple-scrollbar.ag-scrollbar-active {\\n  visibility: visible;\\n  opacity:";
      S = S + " 1;\\n}\\n\\n.ag-body-horizontal-scroll {\\n  width: 100%;\\n}\\n.ag-body-horizontal-scroll.ag-scrollbar-invisible {\\n  left: 0;\\n  right: 0;\\n}\\n\\n.ag-body-vertical-scroll {\\n  height: 100%;\\n}\\n.ag-body-vertical-scroll.ag-scrollbar-invisible {\\n  top: 0;\\n  z-index: 10;\\n}\\n.ag-ltr .ag-body-vertical-scroll.ag-scrollbar-invisible {\\n  right: 0;\\n}\\n.ag-rtl .ag-body-vertical-scroll.ag-scrollbar-invisible {\\n  left: 0;\\n}\\n\\n.ag-force-vertical-scroll {\\n  overflow-y: scroll !important;\\n}\\n\\n.ag-horizontal-left-spacer,\\n.ag-horizontal-right-spacer {\\n  height: 100%;\\n  min-width: 0;\\n  overflow-x: scroll;\\n}\\n.ag-horizontal-left-spacer.ag-scroller-corner,\\n.ag-horizontal-right-spacer.ag-scroller-corner {\\n  overflow-x: hidden;\\n}\\n\\n.ag-header,\\n.ag-pinned-left-header,\\n.ag-pinned-right-header {\\n  display: inline-block;\\n  overflow: hidden;\\n  position: relative;\\n}\\n\\n.ag-header-cell-sortable .ag-header-cell-label {\\n  cursor: pointer;\\n}\\n\\n.ag-header {\\n  display: flex;\\n  width: 100%;\\n  white-space: nowrap;\\n}\\n\\n.ag-pinned-left-header {\\n  height: 100%;\\n}\\n\\n.ag-pinned-right-header {\\n  height: 100%;\\n}\\n\\n.ag-header-row {\\n  position: absolute;\\n}\\n\\n.ag-header-row:not(.ag-header-row-column-group) {\\n  overflow: hidden;\\n}\\n\\n.ag-header.ag-header-allow-overflow .ag-header-row {\\n  overflow: visible;\\n}\\n\\n.ag-header-cell {\\n  display: inline-flex;\\n  align-items: center;\\n  position: absolute;\\n  height: 100%;\\n}\\n\\n.ag-header-cell.ag-header-active .ag-header-cell-menu-button,\\n.ag-header-cell-filter-button {\\n  opacity: 1;\\n}\\n\\n.ag-header-cell-menu-button:not(.ag-header-menu-always-show) {\\n  transition: opacity 0.2s;\\n  opacity: 0;\\n}\\n\\n.ag-header-group-cell-label,\\n.ag-header-cell-label {\\n  display: flex;\\n  flex: 1 1 auto;\\n  align-self: stretch;\\n  align-items: center;\\n}\\n\\n.ag-header-cell-label {\\n  overflow: hidden;\\n  text-overflow: ellipsis;\\n}\\n\\n.ag-header-group-cell-label.ag-sticky-label {\\n  position: sticky;\\n  flex: none;\\n  max-width: 100%;\\n}\\";
      S = S + "n\\n.ag-header-group-text {\\n  overflow: hidden;\\n  text-overflow: ellipsis;\\n  white-space: nowrap;\\n}\\n\\n.ag-header-cell-text {\\n  overflow: hidden;\\n  text-overflow: ellipsis;\\n  word-break: break-word;\\n}\\n\\n.ag-header-cell:not(.ag-header-cell-auto-height) .ag-header-cell-comp-wrapper {\\n  height: 100%;\\n  display: flex;\\n  align-items: center;\\n}\\n\\n.ag-header-cell-comp-wrapper {\\n  width: 100%;\\n}\\n\\n.ag-header-cell-wrap-text .ag-header-cell-comp-wrapper {\\n  white-space: normal;\\n}\\n\\n.ag-right-aligned-header .ag-header-cell-label {\\n  flex-direction: row-reverse;\\n}\\n\\n.ag-header-cell-resize {\\n  position: absolute;\\n  z-index: 2;\\n  height: 100%;\\n  width: 8px;\\n  top: 0;\\n  cursor: ew-resize;\\n}\\n.ag-ltr .ag-header-cell-resize {\\n  right: -4px;\\n}\\n.ag-rtl .ag-header-cell-resize {\\n  left: -4px;\\n}\\n\\n.ag-pinned-left-header .ag-header-cell-resize {\\n  right: -4px;\\n}\\n\\n.ag-pinned-right-header .ag-header-cell-resize {\\n  left: -4px;\\n}\\n\\n.ag-header-select-all {\\n  display: flex;\\n}\\n\\n.ag-header-cell-menu-button,\\n.ag-header-cell-filter-button,\\n.ag-side-button-button,\\n.ag-panel-title-bar-button,\\n.ag-floating-filter-button-button {\\n  cursor: pointer;\\n}\\n\\n.ag-column-moving .ag-cell {\\n  transition: left 0.2s;\\n}\\n.ag-column-moving .ag-header-cell {\\n  transition: left 0.2s;\\n}\\n.ag-column-moving .ag-header-group-cell {\\n  transition: left 0.2s, width 0.2s;\\n}\\n\\n.ag-column-panel {\\n  display: flex;\\n  flex-direction: column;\\n  overflow: hidden;\\n  flex: 1 1 auto;\\n}\\n\\n.ag-column-select {\\n  position: relative;\\n  display: flex;\\n  flex-direction: column;\\n  overflow: hidden;\\n  flex: 3 1 0px;\\n}\\n\\n.ag-column-select-header {\\n  position: relative;\\n  display: flex;\\n  flex: none;\\n}\\n\\n.ag-column-select-header-icon {\\n  position: relative;\\n}\\n\\n.ag-column-select-header-filter-wrapper {\\n  flex: 1 1 auto;\\n}\\n\\n.ag-column-select-header-filter {\\n  width: 100%;\\n}\\n\\n.ag-column-select-list {\\n  flex: 1 1 0px;\\n  overflow: hidden;\\n}\\n\\n.ag-column-drop";
      S = S + " {\\n  position: relative;\\n  display: inline-flex;\\n  align-items: center;\\n  overflow: auto;\\n  width: 100%;\\n}\\n\\n.ag-column-drop-list {\\n  display: flex;\\n  align-items: center;\\n}\\n\\n.ag-column-drop-cell {\\n  position: relative;\\n  display: flex;\\n  align-items: center;\\n}\\n\\n.ag-column-drop-cell-text {\\n  overflow: hidden;\\n  flex: 1 1 auto;\\n  text-overflow: ellipsis;\\n  white-space: nowrap;\\n}\\n\\n.ag-column-drop-vertical {\\n  display: flex;\\n  flex-direction: column;\\n  overflow: hidden;\\n  align-items: stretch;\\n  flex: 1 1 0px;\\n}\\n\\n.ag-column-drop-vertical-title-bar {\\n  display: flex;\\n  align-items: center;\\n  flex: none;\\n}\\n\\n.ag-column-drop-vertical-list {\\n  position: relative;\\n  align-items: stretch;\\n  flex-grow: 1;\\n  flex-direction: column;\\n  overflow-x: auto;\\n}\\n.ag-column-drop-vertical-list > * {\\n  flex: none;\\n}\\n\\n.ag-column-drop-empty .ag-column-drop-vertical-list {\\n  overflow: hidden;\\n}\\n\\n.ag-column-drop-vertical-empty-message {\\n  display: block;\\n}\\n\\n.ag-column-drop.ag-column-drop-horizontal {\\n  white-space: nowrap;\\n  overflow: hidden;\\n}\\n\\n.ag-column-drop-cell-button {\\n  cursor: pointer;\\n}\\n\\n.ag-filter-toolpanel {\\n  flex: 1 1 0px;\\n  min-width: 0;\\n}\\n\\n.ag-filter-toolpanel-header {\\n  position: relative;\\n}\\n\\n.ag-filter-toolpanel-header,\\n.ag-filter-toolpanel-search {\\n  display: flex;\\n  align-items: center;\\n}\\n.ag-filter-toolpanel-header > *,\\n.ag-filter-toolpanel-search > * {\\n  display: flex;\\n  align-items: center;\\n}\\n\\n.ag-filter-apply-panel {\\n  display: flex;\\n  justify-content: flex-end;\\n  overflow: hidden;\\n}\\n\\n.ag-row-animation .ag-row {\\n  transition: transform 0.4s, top 0.4s, opacity 0.2s;\\n}\\n\\n.ag-row-animation .ag-row.ag-after-created {\\n  transition: transform 0.4s, top 0.4s, height 0.4s, opacity 0.2s;\\n}\\n\\n.ag-row-no-animation .ag-row {\\n  transition: none;\\n}\\n\\n.ag-row {\\n  white-space: nowrap;\\n  width: 100%;\\n}\\n\\n.ag-row-loading {\\n  display: flex;\\n  align-items: center;\\n}\\n\\n.ag-row-positi";
      S = S + "on-absolute {\\n  position: absolute;\\n}\\n\\n.ag-row-position-relative {\\n  position: relative;\\n}\\n\\n.ag-full-width-row {\\n  overflow: hidden;\\n  pointer-events: all;\\n}\\n\\n.ag-row-inline-editing {\\n  z-index: 1;\\n}\\n\\n.ag-row-dragging {\\n  z-index: 2;\\n}\\n\\n.ag-stub-cell {\\n  display: flex;\\n  align-items: center;\\n}\\n\\n.ag-cell {\\n  display: inline-block;\\n  position: absolute;\\n  white-space: nowrap;\\n  height: 100%;\\n}\\n\\n.ag-cell-value {\\n  flex: 1 1 auto;\\n}\\n\\n.ag-cell-value,\\n.ag-group-value {\\n  overflow: hidden;\\n  text-overflow: ellipsis;\\n}\\n\\n.ag-cell-wrap-text {\\n  white-space: normal;\\n  word-break: break-word;\\n}\\n\\n.ag-cell-wrapper {\\n  display: flex;\\n  align-items: center;\\n}\\n.ag-cell-wrapper.ag-row-group {\\n  align-items: flex-start;\\n}\\n\\n.ag-sparkline-wrapper {\\n  position: absolute;\\n  height: 100%;\\n  width: 100%;\\n  left: 0;\\n  top: 0;\\n}\\n\\n.ag-full-width-row .ag-cell-wrapper.ag-row-group {\\n  height: 100%;\\n  align-items: center;\\n}\\n\\n.ag-cell-inline-editing {\\n  z-index: 1;\\n}\\n.ag-cell-inline-editing .ag-cell-wrapper,\\n.ag-cell-inline-editing .ag-cell-edit-wrapper,\\n.ag-cell-inline-editing .ag-cell-editor,\\n.ag-cell-inline-editing .ag-cell-editor .ag-wrapper,\\n.ag-cell-inline-editing .ag-cell-editor input {\\n  height: 100%;\\n  width: 100%;\\n  line-height: normal;\\n}\\n\\n.ag-cell .ag-icon {\\n  display: inline-block;\\n  vertical-align: middle;\\n}\\n\\n.ag-set-filter-item {\\n  display: flex;\\n  align-items: center;\\n  height: 100%;\\n}\\n\\n.ag-set-filter-item-checkbox {\\n  display: flex;\\n  width: 100%;\\n  height: 100%;\\n}\\n\\n.ag-set-filter-group-icons {\\n  display: block;\\n}\\n.ag-set-filter-group-icons > * {\\n  cursor: pointer;\\n}\\n\\n.ag-filter-body-wrapper {\\n  display: flex;\\n  flex-direction: column;\\n}\\n\\n.ag-filter-filter {\\n  flex: 1 1 0px;\\n}\\n\\n.ag-filter-condition {\\n  display: flex;\\n  justify-content: center;\\n}\\n\\n.ag-floating-filter-body {\\n  position: relative;\\n  display: flex;\\n  flex: 1 1 auto;\\n  height: 100%;\\n}\\n\\n.ag-float";
      S = S + "ing-filter-full-body {\\n  display: flex;\\n  flex: 1 1 auto;\\n  height: 100%;\\n  width: 100%;\\n  align-items: center;\\n  overflow: hidden;\\n}\\n\\n.ag-floating-filter-full-body > div {\\n  flex: 1 1 auto;\\n}\\n\\n.ag-floating-filter-input {\\n  align-items: center;\\n  display: flex;\\n  width: 100%;\\n}\\n.ag-floating-filter-input > * {\\n  flex: 1 1 auto;\\n}\\n\\n.ag-floating-filter-button {\\n  display: flex;\\n  flex: none;\\n}\\n\\n.ag-set-floating-filter-input input[disabled] {\\n  pointer-events: none;\\n}\\n\\n.ag-dnd-ghost {\\n  position: absolute;\\n  display: inline-flex;\\n  align-items: center;\\n  cursor: move;\\n  white-space: nowrap;\\n  z-index: 9999;\\n}\\n\\n.ag-overlay {\\n  height: 100%;\\n  left: 0;\\n  pointer-events: none;\\n  position: absolute;\\n  top: 0;\\n  width: 100%;\\n  z-index: 2;\\n}\\n\\n.ag-overlay-panel {\\n  display: flex;\\n  height: 100%;\\n  width: 100%;\\n}\\n\\n.ag-overlay-wrapper {\\n  display: flex;\\n  flex: none;\\n  width: 100%;\\n  height: 100%;\\n  align-items: center;\\n  justify-content: center;\\n  text-align: center;\\n}\\n\\n.ag-overlay-loading-wrapper {\\n  pointer-events: all;\\n}\\n\\n.ag-popup-child {\\n  z-index: 5;\\n  top: 0;\\n}\\n\\n.ag-popup-editor {\\n  position: absolute;\\n  -moz-user-select: none;\\n  -webkit-user-select: none;\\n  user-select: none;\\n}\\n\\n.ag-large-text-input {\\n  display: block;\\n}\\n\\n.ag-virtual-list-item {\\n  position: absolute;\\n  width: 100%;\\n}\\n\\n.ag-floating-top {\\n  overflow: hidden;\\n  white-space: nowrap;\\n  width: 100%;\\n  position: relative;\\n  display: flex;\\n}\\n\\n.ag-pinned-left-floating-top {\\n  display: inline-block;\\n  overflow: hidden;\\n  position: relative;\\n  min-width: 0px;\\n}\\n\\n.ag-pinned-right-floating-top {\\n  display: inline-block;\\n  overflow: hidden;\\n  position: relative;\\n  min-width: 0px;\\n}\\n\\n.ag-floating-bottom {\\n  overflow: hidden;\\n  white-space: nowrap;\\n  width: 100%;\\n  position: relative;\\n  display: flex;\\n}\\n\\n.ag-pinned-left-floating-bottom {\\n  display: inline-block;\\n  overflow: hidden;\\n  position: rel";
      S = S + "ative;\\n  min-width: 0px;\\n}\\n\\n.ag-pinned-right-floating-bottom {\\n  display: inline-block;\\n  overflow: hidden;\\n  position: relative;\\n  min-width: 0px;\\n}\\n\\n.ag-sticky-top,\\n.ag-sticky-bottom {\\n  position: absolute;\\n  display: flex;\\n  width: 100%;\\n}\\n\\n.ag-pinned-left-sticky-top,\\n.ag-pinned-right-sticky-top {\\n  position: relative;\\n  height: 100%;\\n  overflow: hidden;\\n}\\n\\n.ag-sticky-top-full-width-container,\\n.ag-sticky-bottom-full-width-container {\\n  overflow: hidden;\\n  width: 100%;\\n  height: 100%;\\n}\\n\\n.ag-dialog,\\n.ag-panel {\\n  display: flex;\\n  flex-direction: column;\\n  position: relative;\\n  overflow: hidden;\\n}\\n\\n.ag-panel-title-bar {\\n  display: flex;\\n  flex: none;\\n  align-items: center;\\n  cursor: default;\\n}\\n\\n.ag-panel-title-bar-title {\\n  flex: 1 1 auto;\\n}\\n\\n.ag-panel-title-bar-buttons {\\n  display: flex;\\n}\\n\\n.ag-panel-title-bar-button {\\n  cursor: pointer;\\n}\\n\\n.ag-panel-content-wrapper {\\n  display: flex;\\n  flex: 1 1 auto;\\n  position: relative;\\n  overflow: hidden;\\n}\\n\\n.ag-dialog {\\n  position: absolute;\\n}\\n\\n.ag-resizer {\\n  position: absolute;\\n  pointer-events: none;\\n  z-index: 1;\\n  -moz-user-select: none;\\n  -webkit-user-select: none;\\n  user-select: none;\\n}\\n.ag-resizer.ag-resizer-topLeft {\\n  top: 0;\\n  left: 0;\\n  height: 5px;\\n  width: 5px;\\n  cursor: nwse-resize;\\n}\\n.ag-resizer.ag-resizer-top {\\n  top: 0;\\n  left: 5px;\\n  right: 5px;\\n  height: 5px;\\n  cursor: ns-resize;\\n}\\n.ag-resizer.ag-resizer-topRight {\\n  top: 0;\\n  right: 0;\\n  height: 5px;\\n  width: 5px;\\n  cursor: nesw-resize;\\n}\\n.ag-resizer.ag-resizer-right {\\n  top: 5px;\\n  right: 0;\\n  bottom: 5px;\\n  width: 5px;\\n  cursor: ew-resize;\\n}\\n.ag-resizer.ag-resizer-bottomRight {\\n  bottom: 0;\\n  right: 0;\\n  height: 5px;\\n  width: 5px;\\n  cursor: nwse-resize;\\n}\\n.ag-resizer.ag-resizer-bottom {\\n  bottom: 0;\\n  left: 5px;\\n  right: 5px;\\n  height: 5px;\\n  cursor: ns-resize;\\n}\\n.ag-resizer.ag-resizer-bottomLeft {\\n  bottom: 0;\\n  left: 0;\\n  height:";
      S = S + " 5px;\\n  width: 5px;\\n  cursor: nesw-resize;\\n}\\n.ag-resizer.ag-resizer-left {\\n  left: 0;\\n  top: 5px;\\n  bottom: 5px;\\n  width: 5px;\\n  cursor: ew-resize;\\n}\\n\\n.ag-tooltip {\\n  position: absolute;\\n  z-index: 99999;\\n}\\n\\n.ag-tooltip-custom {\\n  position: absolute;\\n  z-index: 99999;\\n}\\n\\n.ag-tooltip:not(.ag-tooltip-interactive),\\n.ag-tooltip-custom:not(.ag-tooltip-interactive) {\\n  pointer-events: none;\\n}\\n\\n.ag-value-slide-out {\\n  margin-right: 5px;\\n  opacity: 1;\\n  transition: opacity 3s, margin-right 3s;\\n  transition-timing-function: linear;\\n}\\n\\n.ag-value-slide-out-end {\\n  margin-right: 10px;\\n  opacity: 0;\\n}\\n\\n.ag-opacity-zero {\\n  opacity: 0 !important;\\n}\\n\\n.ag-menu {\\n  max-height: 100%;\\n  overflow-y: auto;\\n  position: absolute;\\n  -moz-user-select: none;\\n  -webkit-user-select: none;\\n  user-select: none;\\n}\\n\\n.ag-menu-column-select-wrapper {\\n  height: 265px;\\n  overflow: auto;\\n}\\n.ag-menu-column-select-wrapper .ag-column-select {\\n  height: 100%;\\n}\\n\\n.ag-dialog .ag-panel-content-wrapper .ag-column-select {\\n  -webkit-user-select: none;\\n     -moz-user-select: none;\\n          user-select: none;\\n}\\n\\n.ag-menu-list {\\n  display: table;\\n  width: 100%;\\n}\\n\\n.ag-menu-option,\\n.ag-menu-separator {\\n  display: table-row;\\n}\\n\\n.ag-menu-option-part,\\n.ag-menu-separator-part {\\n  display: table-cell;\\n  vertical-align: middle;\\n}\\n\\n.ag-menu-option-text {\\n  white-space: nowrap;\\n}\\n\\n.ag-menu-option-custom {\\n  display: contents;\\n}\\n\\n.ag-compact-menu-option {\\n  width: 100%;\\n  display: flex;\\n  flex-wrap: nowrap;\\n}\\n\\n.ag-compact-menu-option-text {\\n  white-space: nowrap;\\n  flex: 1 1 auto;\\n}\\n\\n.ag-pill-container {\\n  display: flex;\\n  gap: 0.25rem;\\n  flex-wrap: nowrap;\\n}\\n\\n.ag-pill {\\n  display: flex;\\n  white-space: nowrap;\\n  padding: 0 0.25rem;\\n  align-items: center;\\n}\\n\\n.ag-pill .ag-pill-button {\\n  border: none;\\n  padding: 0;\\n}\\n\\n.ag-rich-select {\\n  cursor: default;\\n  outline: none;\\n  height: 100%;\\n}\\n\\n.ag-rich-sel";
      S = S + "ect-value {\\n  display: flex;\\n  align-items: center;\\n  height: 100%;\\n}\\n.ag-rich-select-value .ag-picker-field-display {\\n  overflow: hidden;\\n  text-overflow: ellipsis;\\n}\\n.ag-rich-select-value .ag-picker-field-display.ag-display-as-placeholder {\\n  opacity: 0.5;\\n}\\n\\n.ag-rich-select-list {\\n  position: relative;\\n}\\n.ag-rich-select-list .ag-loading-text {\\n  min-height: 2rem;\\n}\\n\\n.ag-rich-select-row {\\n  display: flex;\\n  flex: 1 1 auto;\\n  align-items: center;\\n  white-space: nowrap;\\n  overflow: hidden;\\n  height: 100%;\\n}\\n\\n.ag-rich-select-field-input {\\n  flex: 1 1 auto;\\n}\\n.ag-rich-select-field-input .ag-input-field-input {\\n  padding: 0 !important;\\n  border: none !important;\\n  box-shadow: none !important;\\n  text-overflow: ellipsis;\\n}\\n.ag-rich-select-field-input .ag-input-field-input::-moz-placeholder {\\n  opacity: 0.8;\\n}\\n.ag-rich-select-field-input .ag-input-field-input::placeholder {\\n  opacity: 0.8;\\n}\\n\\n.ag-autocomplete {\\n  align-items: center;\\n  display: flex;\\n}\\n.ag-autocomplete > * {\\n  flex: 1 1 auto;\\n}\\n\\n.ag-autocomplete-list-popup {\\n  position: absolute;\\n  -moz-user-select: none;\\n  -webkit-user-select: none;\\n  user-select: none;\\n}\\n\\n.ag-autocomplete-list {\\n  position: relative;\\n}\\n\\n.ag-autocomplete-virtual-list-item {\\n  display: flex;\\n}\\n\\n.ag-autocomplete-row {\\n  display: flex;\\n  flex: 1 1 auto;\\n  align-items: center;\\n  overflow: hidden;\\n}\\n\\n.ag-autocomplete-row-label {\\n  white-space: nowrap;\\n  overflow: hidden;\\n  text-overflow: ellipsis;\\n}\\n\\n.ag-paging-panel {\\n  align-items: center;\\n  display: flex;\\n  justify-content: flex-end;\\n}\\n\\n.ag-paging-page-summary-panel {\\n  display: flex;\\n  align-items: center;\\n}\\n\\n.ag-paging-button {\\n  position: relative;\\n}\\n\\n.ag-disabled .ag-paging-page-summary-panel {\\n  pointer-events: none;\\n}\\n\\n.ag-tool-panel-wrapper {\\n  display: flex;\\n  overflow-y: auto;\\n  overflow-x: hidden;\\n  cursor: default;\\n  -moz-user-select: none;\\n  -webkit-user-select: none;\\n  us";
      S = S + "er-select: none;\\n}\\n\\n.ag-column-select-column,\\n.ag-column-select-column-group,\\n.ag-select-agg-func-item {\\n  position: relative;\\n  align-items: center;\\n  display: flex;\\n  flex-direction: row;\\n  flex-wrap: nowrap;\\n  height: 100%;\\n}\\n.ag-column-select-column > *,\\n.ag-column-select-column-group > *,\\n.ag-select-agg-func-item > * {\\n  flex: none;\\n}\\n\\n.ag-select-agg-func-item,\\n.ag-column-select-column-label {\\n  flex: 1 1 auto;\\n  overflow: hidden;\\n  text-overflow: ellipsis;\\n  white-space: nowrap;\\n}\\n\\n.ag-column-select-checkbox {\\n  display: flex;\\n}\\n\\n.ag-tool-panel-horizontal-resize {\\n  cursor: ew-resize;\\n  height: 100%;\\n  position: absolute;\\n  top: 0;\\n  width: 5px;\\n  z-index: 1;\\n}\\n\\n.ag-ltr .ag-side-bar-left .ag-tool-panel-horizontal-resize {\\n  right: -3px;\\n}\\n.ag-rtl .ag-side-bar-left .ag-tool-panel-horizontal-resize {\\n  left: -3px;\\n}\\n\\n.ag-ltr .ag-side-bar-right .ag-tool-panel-horizontal-resize {\\n  left: -3px;\\n}\\n.ag-rtl .ag-side-bar-right .ag-tool-panel-horizontal-resize {\\n  right: -3px;\\n}\\n\\n.ag-details-row {\\n  width: 100%;\\n}\\n\\n.ag-details-row-fixed-height {\\n  height: 100%;\\n}\\n\\n.ag-details-grid {\\n  width: 100%;\\n}\\n\\n.ag-details-grid-fixed-height {\\n  height: 100%;\\n}\\n\\n.ag-header-group-cell {\\n  display: flex;\\n  align-items: center;\\n  height: 100%;\\n  position: absolute;\\n}\\n\\n.ag-header-group-cell-no-group.ag-header-span-height .ag-header-cell-resize {\\n  display: none;\\n}\\n\\n.ag-cell-label-container {\\n  display: flex;\\n  justify-content: space-between;\\n  flex-direction: row-reverse;\\n  align-items: center;\\n  height: 100%;\\n  width: 100%;\\n  padding: 5px 0px;\\n}\\n\\n.ag-right-aligned-header .ag-cell-label-container {\\n  flex-direction: row;\\n}\\n.ag-right-aligned-header .ag-header-cell-text {\\n  text-align: right;\\n}\\n\\n.ag-side-bar {\\n  display: flex;\\n  flex-direction: row-reverse;\\n}\\n\\n.ag-side-bar-left {\\n  order: -1;\\n  flex-direction: row;\\n}\\n\\n.ag-side-button-button {\\n  position: relative;\\n  display: flex";
      S = S + ";\\n  flex-direction: column;\\n  align-items: center;\\n  justify-content: center;\\n  flex-wrap: nowrap;\\n  white-space: nowrap;\\n  outline: none;\\n  cursor: pointer;\\n}\\n\\n.ag-side-button-label {\\n  writing-mode: vertical-lr;\\n}\\n\\n.ag-status-bar {\\n  display: flex;\\n  justify-content: space-between;\\n  overflow: hidden;\\n}\\n\\n.ag-status-panel {\\n  display: inline-flex;\\n}\\n\\n.ag-status-name-value {\\n  white-space: nowrap;\\n}\\n\\n.ag-status-bar-left {\\n  display: inline-flex;\\n}\\n\\n.ag-status-bar-center {\\n  display: inline-flex;\\n}\\n\\n.ag-status-bar-right {\\n  display: inline-flex;\\n}\\n\\n.ag-icon {\\n  display: block;\\n  speak: none;\\n}\\n\\n.ag-group {\\n  position: relative;\\n  width: 100%;\\n}\\n\\n.ag-group-title-bar {\\n  display: flex;\\n  align-items: center;\\n}\\n\\n.ag-group-title {\\n  display: inline;\\n  min-width: 0;\\n  overflow: hidden;\\n  white-space: nowrap;\\n  text-overflow: ellipsis;\\n}\\n\\n.ag-group-title-bar .ag-group-title {\\n  cursor: default;\\n}\\n\\n.ag-group-toolbar {\\n  display: flex;\\n  align-items: center;\\n}\\n\\n.ag-group-container {\\n  display: flex;\\n}\\n\\n.ag-disabled .ag-group-container {\\n  pointer-events: none;\\n}\\n\\n.ag-group-container-horizontal {\\n  flex-direction: row;\\n  flex-wrap: wrap;\\n}\\n\\n.ag-group-container-vertical {\\n  flex-direction: column;\\n}\\n\\n.ag-column-group-icons {\\n  display: block;\\n}\\n.ag-column-group-icons > * {\\n  cursor: pointer;\\n}\\n\\n.ag-group-item-alignment-stretch .ag-group-item {\\n  align-items: stretch;\\n}\\n\\n.ag-group-item-alignment-start .ag-group-item {\\n  align-items: flex-start;\\n}\\n\\n.ag-group-item-alignment-end .ag-group-item {\\n  align-items: flex-end;\\n}\\n\\n.ag-toggle-button-icon {\\n  transition: right 0.3s;\\n  position: absolute;\\n  top: -1px;\\n}\\n\\n.ag-input-field,\\n.ag-select {\\n  display: flex;\\n  flex-direction: row;\\n  align-items: center;\\n}\\n\\n.ag-input-field-input {\\n  flex: 1 1 auto;\\n}\\n\\n.ag-floating-filter-input .ag-input-field-input[type=date] {\\n  width: 1px;\\n}\\n\\n.ag-range-field {\\n  display:";
      S = S + ' flex;\\n  align-items: center;\\n}\\n\\n.ag-angle-select {\\n  display: flex;\\n  align-items: center;\\n}\\n\\n.ag-angle-select-wrapper {\\n  display: flex;\\n}\\n\\n.ag-angle-select-parent-circle {\\n  display: block;\\n  position: relative;\\n}\\n\\n.ag-angle-select-child-circle {\\n  position: absolute;\\n}\\n\\n.ag-slider-wrapper {\\n  display: flex;\\n}\\n.ag-slider-wrapper .ag-input-field {\\n  flex: 1 1 auto;\\n}\\n\\n.ag-picker-field-display {\\n  flex: 1 1 auto;\\n}\\n\\n.ag-picker-field {\\n  display: flex;\\n  align-items: center;\\n}\\n\\n.ag-picker-field-icon {\\n  display: flex;\\n  border: 0;\\n  padding: 0;\\n  margin: 0;\\n  cursor: pointer;\\n}\\n\\n.ag-picker-field-wrapper {\\n  overflow: hidden;\\n}\\n\\n.ag-label-align-right .ag-label {\\n  order: 1;\\n}\\n.ag-label-align-right > * {\\n  flex: none;\\n}\\n\\n.ag-label-align-top {\\n  flex-direction: column;\\n  align-items: flex-start;\\n}\\n.ag-label-align-top > * {\\n  align-self: stretch;\\n}\\n\\n.ag-label-ellipsis {\\n  overflow: hidden;\\n  text-overflow: ellipsis;\\n  white-space: nowrap;\\n  flex: 1;\\n}\\n\\n.ag-color-panel {\\n  width: 100%;\\n  display: flex;\\n  flex-direction: column;\\n  text-align: center;\\n}\\n\\n.ag-spectrum-color {\\n  flex: 1 1 auto;\\n  position: relative;\\n  overflow: visible;\\n  cursor: default;\\n}\\n\\n.ag-spectrum-fill {\\n  position: absolute;\\n  top: 0;\\n  left: 0;\\n  right: 0;\\n  bottom: 0;\\n}\\n\\n.ag-spectrum-val {\\n  cursor: pointer;\\n}\\n\\n.ag-spectrum-dragger {\\n  position: absolute;\\n  pointer-events: none;\\n  cursor: pointer;\\n}\\n\\n.ag-spectrum-hue,\\n.ag-spectrum-alpha {\\n  cursor: default;\\n}\\n\\n.ag-spectrum-hue-background {\\n  background: linear-gradient(to left, #ff0000 3%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);\\n  width: 100%;\\n  height: 100%;\\n}\\n\\n.ag-spectrum-alpha {\\n  --ag-spectrum-alpha-background-checked: url("+u+\');\\n}\\n\\n.ag-spectrum-alpha-background {\\n  background: linear-gradient(to right, var(--ag-internal-spectrum-alpha-color-from), var(--ag-internal-spectrum-alpha-colo';
      S = S + "r-to)), var(--ag-spectrum-alpha-background-checked) top left/4px 4px;\\n  width: 100%;\\n  height: 100%;\\n}\\n\\n.ag-spectrum-tool {\\n  cursor: pointer;\\n  position: relative;\\n}\\n\\n.ag-spectrum-slider {\\n  position: absolute;\\n  pointer-events: none;\\n}\\n\\n.ag-spectrum-alpha .ag-spectrum-slider {\\n  background: linear-gradient(to bottom, var(--ag-internal-spectrum-alpha-color), var(--ag-internal-spectrum-alpha-color)) white;\\n}\\n\\n.ag-recent-colors {\\n  display: flex;\\n}\\n\\n.ag-recent-color {\\n  cursor: pointer;\\n}\\n\\n.ag-pill-select {\\n  display: flex;\\n  flex-direction: column;\\n}\\n.ag-pill-select .ag-column-drop {\\n  flex: initial;\\n}\\n\\n.ag-ltr {\\n  direction: ltr;\\n}\\n.ag-ltr .ag-body,\\n.ag-ltr .ag-floating-top,\\n.ag-ltr .ag-floating-bottom,\\n.ag-ltr .ag-header,\\n.ag-ltr .ag-sticky-top,\\n.ag-ltr .ag-sticky-bottom,\\n.ag-ltr .ag-body-viewport,\\n.ag-ltr .ag-body-horizontal-scroll {\\n  flex-direction: row;\\n}\\n\\n.ag-rtl {\\n  direction: rtl;\\n}\\n.ag-rtl .ag-body,\\n.ag-rtl .ag-floating-top,\\n.ag-rtl .ag-floating-bottom,\\n.ag-rtl .ag-header,\\n.ag-rtl .ag-sticky-top,\\n.ag-rtl .ag-sticky-bottom,\\n.ag-rtl .ag-body-viewport,\\n.ag-rtl .ag-body-horizontal-scroll {\\n  flex-direction: row-reverse;\\n}\\n.ag-rtl .ag-icon-contracted,\\n.ag-rtl .ag-icon-expanded,\\n.ag-rtl .ag-icon-tree-closed {\\n  display: block;\\n  transform: rotate(180deg);\\n}\\n\\n.ag-body .ag-body-viewport {\\n  -webkit-overflow-scrolling: touch;\\n}\\n\\n.ag-measurement-container {\\n  width: 0;\\n  overflow: hidden;\\n  visibility: hidden;\\n}\\n.ag-measurement-container div {\\n  position: absolute;\\n}\\n\\n.ag-layout-print.ag-body {\\n  display: block;\\n  height: auto;\\n  height: initial;\\n}\\n.ag-layout-print.ag-root-wrapper {\\n  display: inline-block;\\n}\\n.ag-layout-print .ag-body-vertical-scroll {\\n  display: none;\\n}\\n.ag-layout-print .ag-body-horizontal-scroll {\\n  display: none;\\n}\\n.ag-layout-print.ag-force-vertical-scroll {\\n  overflow-y: visible !important;\\n}\\n\\n@media print {\\n  .ag-root-wrapper.ag-layout-print {\\n";
      S = S + "    display: table;\\n  }\\n  .ag-root-wrapper.ag-layout-print .ag-root-wrapper-body,\\n  .ag-root-wrapper.ag-layout-print .ag-root,\\n  .ag-root-wrapper.ag-layout-print .ag-body-viewport,\\n  .ag-root-wrapper.ag-layout-print .ag-center-cols-container,\\n  .ag-root-wrapper.ag-layout-print .ag-center-cols-viewport,\\n  .ag-root-wrapper.ag-layout-print .ag-body-horizontal-scroll-viewport,\\n  .ag-root-wrapper.ag-layout-print .ag-virtual-list-viewport {\\n    height: auto !important;\\n    overflow: hidden !important;\\n    display: block !important;\\n  }\\n  .ag-root-wrapper.ag-layout-print .ag-row,\\n  .ag-root-wrapper.ag-layout-print .ag-cell {\\n    page-break-inside: avoid;\\n    -moz-column-break-inside: avoid;\\n         break-inside: avoid;\\n  }\\n}\\n[class^=ag-],\\n[class^=ag-]:focus,\\n[class^=ag-]:after,\\n[class^=ag-]:before {\\n  box-sizing: border-box;\\n  outline: none;\\n}\\n\\n[class^=ag-]::-ms-clear {\\n  display: none;\\n}\\n\\n.ag-checkbox .ag-input-wrapper,\\n.ag-radio-button .ag-input-wrapper {\\n  overflow: visible;\\n}\\n\\n.ag-range-field .ag-input-wrapper {\\n  height: 100%;\\n}\\n\\n.ag-toggle-button {\\n  flex: none;\\n  width: auto;\\n  width: initial;\\n  min-width: 0;\\n  min-width: initial;\\n}\\n\\n.ag-button {\\n  border-radius: 0px;\\n  color: var(--ag-foreground-color);\\n}\\n\\n.ag-button:hover {\\n  background-color: transparent;\\n}\\n\\n.ag-ltr .ag-label-align-right .ag-label {\\n  margin-left: var(--ag-grid-size);\\n}\\n.ag-rtl .ag-label-align-right .ag-label {\\n  margin-right: var(--ag-grid-size);\\n}\\n\\ninput[class^=ag-] {\\n  margin: 0;\\n  background-color: var(--ag-background-color);\\n}\\n\\ntextarea[class^=ag-],\\nselect[class^=ag-] {\\n  background-color: var(--ag-background-color);\\n}\\n\\ninput[class^=ag-]:not([type]),\\ninput[class^=ag-][type=text],\\ninput[class^=ag-][type=number],\\ninput[class^=ag-][type=tel],\\ninput[class^=ag-][type=date],\\ninput[class^=ag-][type=datetime-local],\\ntextarea[class^=ag-] {\\n  font-size: inherit;\\n  line-height: inherit;\\n  color: inherit;\\n  font-family";
      S = S + ": inherit;\\n  border: var(--ag-borders-input) var(--ag-input-border-color);\\n}\\ninput[class^=ag-]:not([type]):disabled,\\ninput[class^=ag-][type=text]:disabled,\\ninput[class^=ag-][type=number]:disabled,\\ninput[class^=ag-][type=tel]:disabled,\\ninput[class^=ag-][type=date]:disabled,\\ninput[class^=ag-][type=datetime-local]:disabled,\\ntextarea[class^=ag-]:disabled {\\n  color: var(--ag-disabled-foreground-color);\\n  background-color: var(--ag-input-disabled-background-color);\\n  border-color: var(--ag-input-disabled-border-color);\\n}\\ninput[class^=ag-]:not([type]):focus,\\ninput[class^=ag-][type=text]:focus,\\ninput[class^=ag-][type=number]:focus,\\ninput[class^=ag-][type=tel]:focus,\\ninput[class^=ag-][type=date]:focus,\\ninput[class^=ag-][type=datetime-local]:focus,\\ntextarea[class^=ag-]:focus {\\n  outline: none;\\n  box-shadow: var(--ag-input-focus-box-shadow);\\n  border-color: var(--ag-input-focus-border-color);\\n}\\ninput[class^=ag-]:not([type]):invalid,\\ninput[class^=ag-][type=text]:invalid,\\ninput[class^=ag-][type=number]:invalid,\\ninput[class^=ag-][type=tel]:invalid,\\ninput[class^=ag-][type=date]:invalid,\\ninput[class^=ag-][type=datetime-local]:invalid,\\ntextarea[class^=ag-]:invalid {\\n  border: var(--ag-borders-input-invalid) var(--ag-input-border-color-invalid);\\n}\\n\\ninput[class^=ag-][type=number]:not(.ag-number-field-input-stepper) {\\n  -moz-appearance: textfield;\\n}\\ninput[class^=ag-][type=number]:not(.ag-number-field-input-stepper)::-webkit-outer-spin-button, input[class^=ag-][type=number]:not(.ag-number-field-input-stepper)::-webkit-inner-spin-button {\\n  -webkit-appearance: none;\\n  margin: 0;\\n}\\n\\ninput[class^=ag-][type=range] {\\n  padding: 0;\\n}\\n\\ninput[class^=ag-][type=button]:focus,\\nbutton[class^=ag-]:focus {\\n  box-shadow: var(--ag-input-focus-box-shadow);\\n}\\n\\n.ag-drag-handle {\\n  color: var(--ag-secondary-foreground-color);\\n}\\n\\n.ag-list-item,\\n.ag-virtual-list-item {\\n  height: var(--ag-list-item-height);\\n}\\n\\n.ag-virtual-list-item:focus-visible {\\n";
      S = S + '  outline: none;\\n}\\n.ag-virtual-list-item:focus-visible::after {\\n  content: "";\\n  position: absolute;\\n  background-color: transparent;\\n  pointer-events: none;\\n  top: 4px;\\n  left: 4px;\\n  display: block;\\n  width: calc(100% - 8px);\\n  height: calc(100% - 8px);\\n  border: 1px solid;\\n  border-color: var(--ag-input-focus-border-color);\\n}\\n\\n.ag-select-list {\\n  background-color: var(--ag-background-color);\\n  overflow-y: auto;\\n  overflow-x: hidden;\\n  border-radius: var(--ag-border-radius);\\n  border: var(--ag-borders) var(--ag-border-color);\\n}\\n\\n.ag-list-item {\\n  display: flex;\\n  align-items: center;\\n  white-space: nowrap;\\n  overflow: hidden;\\n  text-overflow: ellipsis;\\n}\\n.ag-list-item.ag-active-item {\\n  background-color: var(--ag-row-hover-color);\\n}\\n\\n.ag-select-list-item {\\n  -moz-user-select: none;\\n  -webkit-user-select: none;\\n  user-select: none;\\n  cursor: default;\\n}\\n.ag-ltr .ag-select-list-item {\\n  padding-left: calc(var(--ag-cell-horizontal-padding) / 2);\\n}\\n.ag-rtl .ag-select-list-item {\\n  padding-right: calc(var(--ag-cell-horizontal-padding) / 2);\\n}\\n.ag-select-list-item span {\\n  white-space: nowrap;\\n  text-overflow: ellipsis;\\n  overflow: hidden;\\n}\\n\\n.ag-row-drag,\\n.ag-selection-checkbox,\\n.ag-group-expanded,\\n.ag-group-contracted {\\n  color: var(--ag-secondary-foreground-color);\\n}\\n.ag-ltr .ag-row-drag,\\n.ag-ltr .ag-selection-checkbox,\\n.ag-ltr .ag-group-expanded,\\n.ag-ltr .ag-group-contracted {\\n  margin-right: var(--ag-cell-widget-spacing);\\n}\\n.ag-rtl .ag-row-drag,\\n.ag-rtl .ag-selection-checkbox,\\n.ag-rtl .ag-group-expanded,\\n.ag-rtl .ag-group-contracted {\\n  margin-left: var(--ag-cell-widget-spacing);\\n}\\n\\n.ag-cell-wrapper > *:not(.ag-cell-value):not(.ag-group-value) {\\n  --ag-internal-calculated-line-height: var(\\n      --ag-line-height,\\n      calc(var(--ag-row-height) - var(--ag-row-border-width))\\n  );\\n  --ag-internal-padded-row-height: calc(var(--ag-row-height) - var(--ag-row-border-width));\\n  height: min(var(--';
      S = S + "ag-internal-calculated-line-height), var(--ag-internal-padded-row-height));\\n  display: flex;\\n  align-items: center;\\n  flex: none;\\n}\\n\\n.ag-group-expanded,\\n.ag-group-contracted {\\n  cursor: pointer;\\n}\\n\\n.ag-group-title-bar-icon {\\n  cursor: pointer;\\n  flex: none;\\n  color: var(--ag-secondary-foreground-color);\\n}\\n\\n.ag-ltr .ag-group-child-count {\\n  margin-left: 2px;\\n}\\n.ag-rtl .ag-group-child-count {\\n  margin-right: 2px;\\n}\\n\\n.ag-group-title-bar {\\n  background-color: var(--ag-subheader-background-color);\\n  padding: var(--ag-grid-size);\\n}\\n\\n.ag-group-toolbar {\\n  padding: var(--ag-grid-size);\\n  background-color: var(--ag-subheader-toolbar-background-color);\\n}\\n\\n.ag-disabled-group-title-bar,\\n.ag-disabled-group-container {\\n  opacity: 0.5;\\n}\\n\\n.group-item {\\n  margin: calc(var(--ag-grid-size) * 0.5) 0;\\n}\\n\\n.ag-label {\\n  white-space: nowrap;\\n}\\n.ag-ltr .ag-label {\\n  margin-right: var(--ag-grid-size);\\n}\\n.ag-rtl .ag-label {\\n  margin-left: var(--ag-grid-size);\\n}\\n\\n.ag-label-align-top .ag-label {\\n  margin-bottom: calc(var(--ag-grid-size) * 0.5);\\n}\\n\\n.ag-angle-select[disabled] {\\n  color: var(--ag-disabled-foreground-color);\\n  pointer-events: none;\\n}\\n.ag-angle-select[disabled] .ag-angle-select-field {\\n  opacity: 0.4;\\n}\\n\\n.ag-ltr .ag-slider-field,\\n.ag-ltr .ag-angle-select-field {\\n  margin-right: calc(var(--ag-grid-size) * 2);\\n}\\n.ag-rtl .ag-slider-field,\\n.ag-rtl .ag-angle-select-field {\\n  margin-left: calc(var(--ag-grid-size) * 2);\\n}\\n\\n.ag-angle-select-parent-circle {\\n  width: 24px;\\n  height: 24px;\\n  border-radius: 12px;\\n  border: solid 1px;\\n  border-color: var(--ag-border-color);\\n  background-color: var(--ag-background-color);\\n}\\n\\n.ag-angle-select-child-circle {\\n  top: 4px;\\n  left: 12px;\\n  width: 6px;\\n  height: 6px;\\n  margin-left: -3px;\\n  margin-top: -4px;\\n  border-radius: 3px;\\n  background-color: var(--ag-secondary-foreground-color);\\n}\\n\\n.ag-picker-field-wrapper {\\n  border: var(--ag-borders);\\n  border-color";
      S = S + ": var(--ag-border-color);\\n  border-radius: 5px;\\n  background-color: var(--ag-background-color);\\n}\\n.ag-picker-field-wrapper:disabled {\\n  color: var(--ag-disabled-foreground-color);\\n  background-color: var(--ag-input-disabled-background-color);\\n  border-color: var(--ag-input-disabled-border-color);\\n}\\n.ag-picker-field-wrapper.ag-picker-has-focus, .ag-picker-field-wrapper:focus-within {\\n  outline: none;\\n  box-shadow: var(--ag-input-focus-box-shadow);\\n  border-color: var(--ag-input-focus-border-color);\\n}\\n\\n.ag-picker-field-button {\\n  background-color: var(--ag-background-color);\\n  color: var(--ag-secondary-foreground-color);\\n}\\n\\n.ag-dialog.ag-color-dialog {\\n  border-radius: 5px;\\n}\\n\\n.ag-color-picker .ag-picker-field-wrapper {\\n  padding-left: var(--ag-grid-size);\\n  padding-right: var(--ag-grid-size);\\n}\\n.ag-color-picker .ag-picker-field-display {\\n  display: flex;\\n  flex-direction: row;\\n  align-items: center;\\n  min-height: var(--ag-list-item-height);\\n}\\n\\n.ag-ltr .ag-color-picker-color,\\n.ag-ltr .ag-color-picker-value {\\n  margin-right: var(--ag-grid-size);\\n}\\n.ag-rtl .ag-color-picker-color,\\n.ag-rtl .ag-color-picker-value {\\n  margin-left: var(--ag-grid-size);\\n}\\n\\n.ag-color-panel {\\n  padding: var(--ag-grid-size);\\n}\\n\\n.ag-spectrum-color {\\n  background-color: rgb(255, 0, 0);\\n  border-radius: 2px;\\n}\\n\\n.ag-spectrum-tools {\\n  padding: 10px;\\n}\\n\\n.ag-spectrum-sat {\\n  background-image: linear-gradient(to right, white, rgba(204, 154, 129, 0));\\n}\\n\\n.ag-spectrum-val {\\n  background-image: linear-gradient(to top, black, rgba(204, 154, 129, 0));\\n}\\n\\n.ag-spectrum-dragger {\\n  border-radius: 12px;\\n  height: 12px;\\n  width: 12px;\\n  border: 2px solid white;\\n  background: black;\\n  box-shadow: 0 0 2px 0px rgba(0, 0, 0, 0.24);\\n}\\n\\n.ag-spectrum-hue-background {\\n  border-radius: 2px;\\n}\\n\\n.ag-spectrum-alpha-background {\\n  border-radius: 2px;\\n}\\n\\n.ag-spectrum-tool {\\n  margin-bottom: 10px;\\n  height: 11px;\\n  border-radius: 2px;\\n}\\n\\n.a";
      S = S + "g-spectrum-slider {\\n  margin-top: -12px;\\n  width: 13px;\\n  height: 13px;\\n  border-radius: 13px;\\n  border: 2px solid white;\\n  box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.37);\\n}\\n\\n.ag-recent-colors {\\n  margin-top: 10px;\\n}\\n\\n.ag-recent-color {\\n  margin: 0 3px;\\n}\\n.ag-recent-color:first-child {\\n  margin-left: 0;\\n}\\n.ag-recent-color:last-child {\\n  margin-right: 0;\\n}\\n\\n.ag-spectrum-color:focus-visible:not(:disabled):not([readonly]),\\n.ag-spectrum-slider:focus-visible:not(:disabled):not([readonly]),\\n.ag-recent-color:focus-visible:not(:disabled):not([readonly]) {\\n  box-shadow: var(--ag-input-focus-box-shadow);\\n}\\n\\n.ag-ltr .ag-color-input input[class^=ag-][type=text].ag-input-field-input {\\n  padding-left: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\\n}\\n.ag-rtl .ag-color-input input[class^=ag-][type=text].ag-input-field-input {\\n  padding-right: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\\n}\\n.ag-color-input .ag-color-input-color {\\n  position: absolute;\\n}\\n.ag-ltr .ag-color-input .ag-color-input-color {\\n  margin-left: var(--ag-grid-size);\\n}\\n.ag-rtl .ag-color-input .ag-color-input-color {\\n  margin-right: var(--ag-grid-size);\\n}\\n\\n.ag-color-picker-color,\\n.ag-color-input-color {\\n  width: var(--ag-icon-size);\\n  height: var(--ag-icon-size);\\n  border: var(--ag-borders-secondary) var(--ag-secondary-border-color);\\n  border-radius: 2px;\\n}\\n\\n.ag-dnd-ghost {\\n  border: var(--ag-borders) var(--ag-border-color);\\n  background: var(--ag-background-color);\\n  border-radius: var(--ag-card-radius);\\n  box-shadow: var(--ag-card-shadow);\\n  padding: var(--ag-grid-size);\\n  overflow: hidden;\\n  text-overflow: ellipsis;\\n  border: var(--ag-borders-secondary) var(--ag-secondary-border-color);\\n  color: var(--ag-secondary-foreground-color);\\n  height: var(--ag-header-height) !important;\\n  line-height: var(--ag-header-height);\\n  margin: 0;\\n  padding: 0 calc(var(--ag-grid-size) * 2);\\n  transform: translateY(calc(var(--ag-grid-size) * 2));\\n}\\n\\n.a";
      S = S + "g-dnd-ghost-icon {\\n  margin-right: var(--ag-grid-size);\\n  color: var(--ag-foreground-color);\\n}\\n\\n.ag-popup-child:not(.ag-tooltip-custom) {\\n  box-shadow: var(--ag-popup-shadow);\\n}\\n\\n.ag-select .ag-picker-field-wrapper {\\n  min-height: var(--ag-list-item-height);\\n  cursor: default;\\n}\\n.ag-ltr .ag-select .ag-picker-field-wrapper {\\n  padding-left: calc(var(--ag-cell-horizontal-padding) / 2);\\n}\\n.ag-rtl .ag-select .ag-picker-field-wrapper {\\n  padding-right: calc(var(--ag-cell-horizontal-padding) / 2);\\n}\\n.ag-ltr .ag-select .ag-picker-field-wrapper {\\n  padding-right: var(--ag-grid-size);\\n}\\n.ag-rtl .ag-select .ag-picker-field-wrapper {\\n  padding-left: var(--ag-grid-size);\\n}\\n.ag-select.ag-disabled .ag-picker-field-wrapper:focus {\\n  box-shadow: none;\\n}\\n.ag-select:not(.ag-cell-editor):not(.ag-label-align-top) {\\n  min-height: var(--ag-list-item-height);\\n}\\n.ag-select .ag-picker-field-display {\\n  white-space: nowrap;\\n  overflow: hidden;\\n  text-overflow: ellipsis;\\n}\\n.ag-select .ag-picker-field-icon {\\n  display: flex;\\n  align-items: center;\\n}\\n.ag-select.ag-disabled {\\n  opacity: 0.5;\\n}\\n\\n.ag-rich-select-value,\\n.ag-rich-select-list {\\n  background-color: var(--ag-background-color);\\n}\\n\\n.ag-rich-select-list {\\n  width: 100%;\\n  height: auto;\\n  border-radius: var(--ag-border-radius);\\n  border: var(--ag-borders) var(--ag-border-color);\\n}\\n.ag-rich-select-list .ag-loading-text {\\n  padding: var(--ag-widget-vertical-spacing) var(--ag-widget-horizontal-spacing);\\n}\\n\\n.ag-rich-select-value {\\n  border-bottom: var(--ag-borders-secondary) var(--ag-secondary-border-color);\\n  padding-top: 0;\\n  padding-bottom: 0;\\n}\\n.ag-ltr .ag-rich-select-value {\\n  padding-left: calc(var(--ag-cell-horizontal-padding) / 2);\\n}\\n.ag-rtl .ag-rich-select-value {\\n  padding-right: calc(var(--ag-cell-horizontal-padding) / 2);\\n}\\n.ag-ltr .ag-rich-select-value {\\n  padding-right: var(--ag-grid-size);\\n}\\n.ag-rtl .ag-rich-select-value {\\n  padding-left: var(--ag-grid-siz";
      S = S + "e);\\n}\\n\\n.ag-ltr .ag-rich-select-field-input {\\n  left: calc(var(--ag-cell-horizontal-padding));\\n}\\n.ag-rtl .ag-rich-select-field-input {\\n  right: calc(var(--ag-cell-horizontal-padding));\\n}\\n\\n.ag-popup-editor .ag-rich-select-value {\\n  height: var(--ag-row-height);\\n  min-width: 200px;\\n}\\n\\n.ag-rich-select-virtual-list-item {\\n  cursor: default;\\n  height: var(--ag-list-item-height);\\n}\\n.ag-rich-select-virtual-list-item:focus-visible::after {\\n  content: none;\\n}\\n\\n.ag-ltr .ag-rich-select-row {\\n  padding-left: calc(var(--ag-cell-horizontal-padding) / 2);\\n}\\n.ag-rtl .ag-rich-select-row {\\n  padding-right: calc(var(--ag-cell-horizontal-padding) / 2);\\n}\\n\\n.ag-rich-select-row-selected {\\n  background-color: var(--ag-selected-row-background-color);\\n}\\n\\n.ag-rich-select-row:hover,\\n.ag-rich-select-row-highlighted {\\n  background-image: linear-gradient(var(--ag-row-hover-color), var(--ag-row-hover-color));\\n}\\n\\n.ag-rich-select-row-text-highlight {\\n  font-weight: bold;\\n}\\n\\n.ag-autocomplete {\\n  width: 100%;\\n}\\n\\n.ag-autocomplete-list {\\n  width: 100%;\\n  min-width: 200px;\\n  height: calc(var(--ag-row-height) * 6.5);\\n}\\n\\n.ag-autocomplete-virtual-list-item {\\n  cursor: default;\\n  height: var(--ag-list-item-height);\\n}\\n.ag-autocomplete-virtual-list-item:focus-visible::after {\\n  content: none;\\n}\\n.ag-autocomplete-virtual-list-item:hover {\\n  background-color: var(--ag-row-hover-color);\\n}\\n\\n.ag-autocomplete-row-label {\\n  margin: 0px var(--ag-widget-container-horizontal-padding);\\n}\\n\\n.ag-autocomplete-row-selected {\\n  background-color: var(--ag-selected-row-background-color);\\n}\\n\\n.ag-pill {\\n  border: 1px solid var(--ag-chip-border-color);\\n  border-radius: var(--ag-border-radius);\\n  background-color: var(--ag-chip-background-color);\\n}\\n\\n.ag-ltr .ag-pill .ag-pill-button {\\n  margin-left: var(--ag-grid-size);\\n}\\n.ag-rtl .ag-pill .ag-pill-button {\\n  margin-right: var(--ag-grid-size);\\n}\\n\\n.ag-pill:focus-visible {\\n  border-color: var(--ag-input-";
      S = S + 'focus-border-color);\\n}\\n\\n.ag-pill .ag-pill-button:hover {\\n  color: var(--ag-active-color);\\n  cursor: pointer;\\n}\\n\\n.ag-dragging-range-handle .ag-dialog,\\n.ag-dragging-fill-handle .ag-dialog {\\n  opacity: 0.7;\\n  pointer-events: none;\\n}\\n\\n.ag-dialog {\\n  border-radius: var(--ag-border-radius);\\n  border: var(--ag-borders) var(--ag-border-color);\\n  box-shadow: var(--ag-popup-shadow);\\n}\\n\\n.ag-panel {\\n  background-color: var(--ag-panel-background-color);\\n  border-color: var(--ag-panel-border-color);\\n}\\n\\n.ag-panel-title-bar {\\n  color: var(--ag-header-foreground-color);\\n  height: var(--ag-header-height);\\n  padding: var(--ag-grid-size) var(--ag-cell-horizontal-padding);\\n  border-bottom: var(--ag-borders) var(--ag-border-color);\\n}\\n\\n.ag-ltr .ag-panel-title-bar-button {\\n  margin-left: var(--ag-grid-size);\\n}\\n.ag-rtl .ag-panel-title-bar-button {\\n  margin-right: var(--ag-grid-size);\\n}\\n\\n.ag-tooltip {\\n  background-color: var(--ag-tooltip-background-color);\\n  color: var(--ag-foreground-color);\\n  padding: var(--ag-grid-size);\\n  border: var(--ag-borders) var(--ag-border-color);\\n  border-radius: var(--ag-card-radius);\\n  white-space: normal;\\n}\\n\\n.ag-tooltip.ag-tooltip-animate,\\n.ag-tooltip-custom.ag-tooltip-animate {\\n  transition: opacity 1s;\\n}\\n.ag-tooltip.ag-tooltip-animate.ag-tooltip-hiding,\\n.ag-tooltip-custom.ag-tooltip-animate.ag-tooltip-hiding {\\n  opacity: 0;\\n}\\n\\n.ag-ltr .ag-column-select-column,\\n.ag-ltr .ag-column-select-column-group {\\n  padding-left: calc(var(--ag-indentation-level) * var(--ag-column-select-indent-size));\\n}\\n.ag-rtl .ag-column-select-column,\\n.ag-rtl .ag-column-select-column-group {\\n  padding-right: calc(var(--ag-indentation-level) * var(--ag-column-select-indent-size));\\n}\\n\\n.ag-column-select-header-icon {\\n  cursor: pointer;\\n}\\n\\n.ag-column-select-header-icon:focus-visible {\\n  outline: none;\\n}\\n.ag-column-select-header-icon:focus-visible::after {\\n  content: "";\\n  position: absolute;\\n  background-color: tran';
      S = S + 'sparent;\\n  pointer-events: none;\\n  top: 0px;\\n  left: 0px;\\n  display: block;\\n  width: calc(100% - 0px);\\n  height: calc(100% - 0px);\\n  border: 1px solid;\\n  border-color: var(--ag-input-focus-border-color);\\n}\\n\\n.ag-ltr .ag-column-group-icons:not(:last-child),\\n.ag-ltr .ag-column-select-header-icon:not(:last-child),\\n.ag-ltr .ag-column-select-header-checkbox:not(:last-child),\\n.ag-ltr .ag-column-select-header-filter-wrapper:not(:last-child),\\n.ag-ltr .ag-column-select-checkbox:not(:last-child),\\n.ag-ltr .ag-column-select-column-drag-handle:not(:last-child),\\n.ag-ltr .ag-column-select-column-group-drag-handle:not(:last-child),\\n.ag-ltr .ag-column-select-column-label:not(:last-child) {\\n  margin-right: var(--ag-widget-horizontal-spacing);\\n}\\n.ag-rtl .ag-column-group-icons:not(:last-child),\\n.ag-rtl .ag-column-select-header-icon:not(:last-child),\\n.ag-rtl .ag-column-select-header-checkbox:not(:last-child),\\n.ag-rtl .ag-column-select-header-filter-wrapper:not(:last-child),\\n.ag-rtl .ag-column-select-checkbox:not(:last-child),\\n.ag-rtl .ag-column-select-column-drag-handle:not(:last-child),\\n.ag-rtl .ag-column-select-column-group-drag-handle:not(:last-child),\\n.ag-rtl .ag-column-select-column-label:not(:last-child) {\\n  margin-left: var(--ag-widget-horizontal-spacing);\\n}\\n\\n.ag-column-select-virtual-list-item:focus-visible {\\n  outline: none;\\n}\\n.ag-column-select-virtual-list-item:focus-visible::after {\\n  content: "";\\n  position: absolute;\\n  background-color: transparent;\\n  pointer-events: none;\\n  top: 1px;\\n  left: 1px;\\n  display: block;\\n  width: calc(100% - 2px);\\n  height: calc(100% - 2px);\\n  border: 1px solid;\\n  border-color: var(--ag-input-focus-border-color);\\n}\\n\\n.ag-column-select-column-group:not(:last-child),\\n.ag-column-select-column:not(:last-child) {\\n  margin-bottom: var(--ag-widget-vertical-spacing);\\n}\\n\\n.ag-column-select-column-readonly,\\n.ag-column-select-column-group-readonly {\\n  color: var(--ag-disabled-foreground-color);\\n  pointer';
      S = S + "-events: none;\\n}\\n\\n.ag-ltr .ag-column-select-add-group-indent {\\n  margin-left: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\\n}\\n.ag-rtl .ag-column-select-add-group-indent {\\n  margin-right: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\\n}\\n\\n.ag-column-select-virtual-list-viewport {\\n  padding: calc(var(--ag-widget-container-vertical-padding) * 0.5) 0px;\\n}\\n\\n.ag-column-select-virtual-list-item {\\n  padding: 0 var(--ag-widget-container-horizontal-padding);\\n}\\n\\n.ag-checkbox-edit {\\n  padding-left: var(--ag-cell-horizontal-padding);\\n  padding-right: var(--ag-cell-horizontal-padding);\\n}\\n\\n.ag-pill-select .ag-column-drop {\\n  border-bottom: 0;\\n  min-height: 0;\\n  min-height: initial;\\n}\\n.ag-pill-select .ag-column-drop-list {\\n  padding: 0;\\n}\\n.ag-pill-select .ag-select {\\n  padding-top: var(--ag-grid-size);\\n}\\n.ag-pill-select .ag-picker-field-wrapper {\\n  background-color: transparent;\\n  border: 0;\\n}\\n.ag-pill-select .ag-picker-field-display {\\n  cursor: pointer;\\n}\\n\\n.ag-rtl {\\n  text-align: right;\\n}\\n\\n.ag-root-wrapper {\\n  border-radius: var(--ag-wrapper-border-radius);\\n  border: var(--ag-borders) var(--ag-border-color);\\n}\\n\\n.ag-row > .ag-cell-wrapper.ag-row-group {\\n  padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * var(--ag-indentation-level));\\n}\\n\\n.ag-cell-wrapper.ag-row-group,\\n.ag-cell-wrapper.ag-row-group-leaf-indent,\\n.ag-cell-wrapper.ag-pivot-leaf-group {\\n  padding-left: calc(var(--ag-indentation-level) * var(--ag-row-group-indent-size));\\n}\\n\\n.ag-pivot-leaf-group {\\n  margin-left: min(var(--ag-row-group-indent-size), var(--ag-row-group-indent-size) * var(--ag-indentation-level));\\n}\\n\\n.ag-ltr .ag-row-group-leaf-indent {\\n  margin-left: var(--ag-row-group-indent-size);\\n}\\n.ag-rtl .ag-row-group-leaf-indent {\\n  margin-right: var(--ag-row-group-indent-size);\\n}\\n\\n.ag-value-change-delta {\\n  padding-right: 2px;\\n}\\n\\n.ag-value-change-delta-up {\\n  color: var(--ag-value-change-delta";
      S = S + '-up-color);\\n}\\n\\n.ag-value-change-delta-down {\\n  color: var(--ag-value-change-delta-down-color);\\n}\\n\\n.ag-value-change-value {\\n  background-color: transparent;\\n  border-radius: 1px;\\n  padding-left: 1px;\\n  padding-right: 1px;\\n  transition: background-color 1s;\\n}\\n\\n.ag-value-change-value-highlight {\\n  background-color: var(--ag-value-change-value-highlight-background-color);\\n  transition: background-color 0.1s;\\n}\\n\\n.ag-cell-data-changed {\\n  background-color: var(--ag-value-change-value-highlight-background-color) !important;\\n}\\n\\n.ag-cell-data-changed-animation {\\n  background-color: transparent;\\n}\\n\\n.ag-cell-highlight {\\n  background-color: var(--ag-range-selection-highlight-color) !important;\\n}\\n\\n.ag-row {\\n  height: var(--ag-row-height);\\n  background-color: var(--ag-background-color);\\n  color: var(--ag-data-color);\\n  border-bottom: var(--ag-row-border-style) var(--ag-row-border-color) var(--ag-row-border-width);\\n}\\n\\n.ag-sticky-bottom::after {\\n  content: "";\\n  position: absolute;\\n  top: 0;\\n  left: 0;\\n  width: 100%;\\n  height: 1px;\\n  border-top: var(--ag-row-border-style) var(--ag-row-border-color) var(--ag-row-border-width);\\n}\\n\\n.ag-row-highlight-above::after,\\n.ag-row-highlight-below::after {\\n  content: "";\\n  position: absolute;\\n  width: calc(100% - 1px);\\n  height: 1px;\\n  background-color: var(--ag-range-selection-border-color);\\n  left: 1px;\\n}\\n\\n.ag-row-highlight-above::after {\\n  top: -1px;\\n}\\n\\n.ag-row-highlight-above.ag-row-first::after {\\n  top: 0;\\n}\\n\\n.ag-row-highlight-below::after {\\n  bottom: 0px;\\n}\\n\\n.ag-row-odd {\\n  background-color: var(--ag-odd-row-background-color);\\n}\\n\\n.ag-body-horizontal-scroll:not(.ag-scrollbar-invisible) .ag-horizontal-left-spacer:not(.ag-scroller-corner) {\\n  border-right: var(--ag-borders-critical) var(--ag-border-color);\\n}\\n.ag-body-horizontal-scroll:not(.ag-scrollbar-invisible) .ag-horizontal-right-spacer:not(.ag-scroller-corner) {\\n  border-left: var(--ag-borders-critical) var(--';
      S = S + 'ag-border-color);\\n}\\n\\n.ag-row-selected::before {\\n  content: "";\\n  background-color: var(--ag-selected-row-background-color);\\n  display: block;\\n  position: absolute;\\n  top: 0;\\n  left: 0;\\n  right: 0;\\n  bottom: 0;\\n}\\n\\n.ag-row-hover:not(.ag-full-width-row)::before,\\n.ag-row-hover.ag-full-width-row.ag-row-group::before {\\n  content: "";\\n  background-color: var(--ag-row-hover-color);\\n  display: block;\\n  position: absolute;\\n  top: 0;\\n  left: 0;\\n  right: 0;\\n  bottom: 0;\\n  pointer-events: none;\\n}\\n\\n.ag-row-hover.ag-full-width-row.ag-row-group > * {\\n  position: relative;\\n}\\n\\n.ag-row-hover.ag-row-selected::before {\\n  background-color: var(--ag-row-hover-color);\\n  background-image: linear-gradient(var(--ag-selected-row-background-color), var(--ag-selected-row-background-color));\\n}\\n\\n.ag-column-hover {\\n  background-color: var(--ag-column-hover-color);\\n}\\n\\n.ag-ltr .ag-right-aligned-cell {\\n  text-align: right;\\n}\\n.ag-rtl .ag-right-aligned-cell {\\n  text-align: left;\\n}\\n\\n.ag-ltr .ag-right-aligned-cell .ag-cell-value,\\n.ag-ltr .ag-right-aligned-cell .ag-group-value {\\n  margin-left: auto;\\n}\\n.ag-rtl .ag-right-aligned-cell .ag-cell-value,\\n.ag-rtl .ag-right-aligned-cell .ag-group-value {\\n  margin-right: auto;\\n}\\n\\n.ag-ltr .ag-right-aligned-cell .ag-skeleton-effect {\\n  margin-left: auto;\\n}\\n.ag-rtl .ag-right-aligned-cell .ag-skeleton-effect {\\n  margin-right: auto;\\n}\\n\\n.ag-cell,\\n.ag-full-width-row .ag-cell-wrapper.ag-row-group {\\n  --ag-internal-calculated-line-height: var(\\n      --ag-line-height,\\n      calc(var(--ag-row-height) - var(--ag-row-border-width))\\n  );\\n  --ag-internal-padded-row-height: calc(var(--ag-row-height) - var(--ag-row-border-width));\\n  border: 1px solid transparent;\\n  line-height: min(var(--ag-internal-calculated-line-height), var(--ag-internal-padded-row-height));\\n  padding-left: calc(var(--ag-cell-horizontal-padding) - 1px + var(--ag-row-group-indent-size) * var(--ag-indentation-level));\\n  padding-right: calc(va';
      S = S + "r(--ag-cell-horizontal-padding) - 1px);\\n  -webkit-font-smoothing: subpixel-antialiased;\\n}\\n\\n.ag-row > .ag-cell-wrapper {\\n  padding-left: calc(var(--ag-cell-horizontal-padding) - 1px);\\n  padding-right: calc(var(--ag-cell-horizontal-padding) - 1px);\\n}\\n\\n.ag-row-dragging {\\n  cursor: move;\\n  opacity: 0.5;\\n}\\n\\n.ag-cell-inline-editing {\\n  border: 1px solid var(--ag-border-color);\\n  border-radius: var(--ag-card-radius);\\n  box-shadow: var(--ag-card-shadow);\\n  padding: 0;\\n  background-color: var(--ag-control-panel-background-color);\\n}\\n\\n.ag-popup-editor .ag-large-text,\\n.ag-autocomplete-list-popup {\\n  border: var(--ag-borders) var(--ag-border-color);\\n  background: var(--ag-background-color);\\n  border-radius: var(--ag-card-radius);\\n  box-shadow: var(--ag-card-shadow);\\n  padding: var(--ag-grid-size);\\n  background-color: var(--ag-control-panel-background-color);\\n  padding: 0;\\n}\\n\\n.ag-large-text-input {\\n  height: auto;\\n  padding: var(--ag-cell-horizontal-padding);\\n}\\n\\n.ag-rtl .ag-large-text-input textarea {\\n  resize: none;\\n}\\n\\n.ag-details-row {\\n  padding: calc(var(--ag-grid-size) * 5);\\n  background-color: var(--ag-background-color);\\n}\\n\\n.ag-layout-auto-height .ag-center-cols-viewport,\\n.ag-layout-auto-height .ag-center-cols-container,\\n.ag-layout-print .ag-center-cols-viewport,\\n.ag-layout-print .ag-center-cols-container {\\n  min-height: 50px;\\n}\\n\\n.ag-overlay-loading-wrapper {\\n  background-color: var(--ag-modal-overlay-background-color);\\n}\\n\\n.ag-overlay-loading-center {\\n  border: var(--ag-borders) var(--ag-border-color);\\n  background: var(--ag-background-color);\\n  border-radius: var(--ag-card-radius);\\n  box-shadow: var(--ag-card-shadow);\\n  padding: var(--ag-grid-size);\\n}\\n\\n.ag-overlay-no-rows-wrapper.ag-layout-auto-height {\\n  padding-top: 30px;\\n}\\n\\n.ag-skeleton-container {\\n  width: 100%;\\n  height: 100%;\\n  align-content: center;\\n}\\n\\n.ag-skeleton-effect {\\n  background-color: var(--ag-row-loading-skeleton-effect-color);\\n  ";
      S = S + "width: 100%;\\n  height: 1em;\\n  border-radius: 0.25rem;\\n  animation: ag-skeleton-loading 1.5s ease-in-out 0.5s infinite;\\n}\\n\\n@keyframes ag-skeleton-loading {\\n  0% {\\n    opacity: 1;\\n  }\\n  50% {\\n    opacity: 0.4;\\n  }\\n  100% {\\n    opacity: 1;\\n  }\\n}\\n.ag-loading {\\n  display: flex;\\n  height: 100%;\\n  align-items: center;\\n}\\n.ag-ltr .ag-loading {\\n  padding-left: var(--ag-cell-horizontal-padding);\\n}\\n.ag-rtl .ag-loading {\\n  padding-right: var(--ag-cell-horizontal-padding);\\n}\\n\\n.ag-ltr .ag-loading-icon {\\n  padding-right: var(--ag-cell-widget-spacing);\\n}\\n.ag-rtl .ag-loading-icon {\\n  padding-left: var(--ag-cell-widget-spacing);\\n}\\n\\n.ag-icon-loading {\\n  animation-name: spin;\\n  animation-duration: 1000ms;\\n  animation-iteration-count: infinite;\\n  animation-timing-function: linear;\\n}\\n\\n@keyframes spin {\\n  from {\\n    transform: rotate(0deg);\\n  }\\n  to {\\n    transform: rotate(360deg);\\n  }\\n}\\n.ag-floating-top {\\n  border-bottom: var(--ag-borders-critical) var(--ag-border-color);\\n}\\n\\n.ag-floating-bottom {\\n  border-top: var(--ag-borders-critical) var(--ag-border-color);\\n}\\n\\n.ag-ltr .ag-cell {\\n  border-right: var(--ag-cell-horizontal-border);\\n}\\n.ag-rtl .ag-cell {\\n  border-left: var(--ag-cell-horizontal-border);\\n}\\n.ag-ltr .ag-cell {\\n  border-right-width: 1px;\\n}\\n.ag-rtl .ag-cell {\\n  border-left-width: 1px;\\n}\\n\\n.ag-cell.ag-cell-first-right-pinned:not(.ag-cell-range-left):not(.ag-cell-range-single-cell) {\\n  border-left: var(--ag-borders-critical) var(--ag-border-color);\\n}\\n\\n.ag-cell.ag-cell-last-left-pinned:not(.ag-cell-range-right):not(.ag-cell-range-single-cell) {\\n  border-right: var(--ag-borders-critical) var(--ag-border-color);\\n}\\n\\n.ag-cell-range-selected:not(.ag-cell-focus),\\n.ag-body-viewport:not(.ag-has-focus) .ag-cell-range-single-cell:not(.ag-cell-inline-editing) {\\n  background-color: var(--ag-range-selection-background-color);\\n}\\n.ag-cell-range-selected:not(.ag-cell-focus).ag-cell-range-chart,\\n.ag-body-viewport:not(";
      S = S + ".ag-has-focus) .ag-cell-range-single-cell:not(.ag-cell-inline-editing).ag-cell-range-chart {\\n  background-color: var(--ag-range-selection-chart-background-color) !important;\\n}\\n.ag-cell-range-selected:not(.ag-cell-focus).ag-cell-range-chart.ag-cell-range-chart-category,\\n.ag-body-viewport:not(.ag-has-focus) .ag-cell-range-single-cell:not(.ag-cell-inline-editing).ag-cell-range-chart.ag-cell-range-chart-category {\\n  background-color: var(--ag-range-selection-chart-category-background-color) !important;\\n}\\n\\n.ag-cell-range-selected-1:not(.ag-cell-focus),\\n.ag-root:not(.ag-context-menu-open) .ag-body-viewport:not(.ag-has-focus) .ag-cell-range-selected-1:not(.ag-cell-inline-editing) {\\n  background-color: var(--ag-range-selection-background-color);\\n}\\n\\n.ag-cell-range-selected-2:not(.ag-cell-focus),\\n.ag-body-viewport:not(.ag-has-focus) .ag-cell-range-selected-2 {\\n  background-color: var(--ag-range-selection-background-color-2);\\n}\\n\\n.ag-cell-range-selected-3:not(.ag-cell-focus),\\n.ag-body-viewport:not(.ag-has-focus) .ag-cell-range-selected-3 {\\n  background-color: var(--ag-range-selection-background-color-3);\\n}\\n\\n.ag-cell-range-selected-4:not(.ag-cell-focus),\\n.ag-body-viewport:not(.ag-has-focus) .ag-cell-range-selected-4 {\\n  background-color: var(--ag-range-selection-background-color-4);\\n}\\n\\n.ag-cell.ag-cell-range-selected:not(.ag-cell-range-single-cell).ag-cell-range-top {\\n  border-top-color: var(--ag-range-selection-border-color);\\n  border-top-style: var(--ag-range-selection-border-style);\\n}\\n.ag-cell.ag-cell-range-selected:not(.ag-cell-range-single-cell).ag-cell-range-right {\\n  border-right-color: var(--ag-range-selection-border-color);\\n  border-right-style: var(--ag-range-selection-border-style);\\n}\\n.ag-cell.ag-cell-range-selected:not(.ag-cell-range-single-cell).ag-cell-range-bottom {\\n  border-bottom-color: var(--ag-range-selection-border-color);\\n  border-bottom-style: var(--ag-range-selection-border-style);\\n}\\n.ag-cell.ag-cell-range-selected:n";
      S = S + "ot(.ag-cell-range-single-cell).ag-cell-range-left {\\n  border-left-color: var(--ag-range-selection-border-color);\\n  border-left-style: var(--ag-range-selection-border-style);\\n}\\n\\n.ag-ltr .ag-cell-focus:not(.ag-cell-range-selected):focus-within,\\n.ag-ltr .ag-context-menu-open .ag-cell-focus:not(.ag-cell-range-selected),\\n.ag-ltr .ag-full-width-row.ag-row-focus:focus .ag-cell-wrapper.ag-row-group,\\n.ag-ltr .ag-cell-range-single-cell,\\n.ag-ltr .ag-cell-range-single-cell.ag-cell-range-handle,\\n.ag-rtl .ag-cell-focus:not(.ag-cell-range-selected):focus-within,\\n.ag-rtl .ag-context-menu-open .ag-cell-focus:not(.ag-cell-range-selected),\\n.ag-rtl .ag-full-width-row.ag-row-focus:focus .ag-cell-wrapper.ag-row-group,\\n.ag-rtl .ag-cell-range-single-cell,\\n.ag-rtl .ag-cell-range-single-cell.ag-cell-range-handle {\\n  border: 1px solid;\\n  border-color: var(--ag-range-selection-border-color);\\n  border-style: var(--ag-range-selection-border-style);\\n  outline: medium none currentcolor;\\n  outline: initial;\\n}\\n\\n.ag-cell.ag-selection-fill-top,\\n.ag-cell.ag-selection-fill-top.ag-cell-range-selected {\\n  border-top: 1px dashed;\\n  border-top-color: var(--ag-range-selection-border-color);\\n}\\n\\n.ag-ltr .ag-cell.ag-selection-fill-right,\\n.ag-ltr .ag-cell.ag-selection-fill-right.ag-cell-range-selected {\\n  border-right: 1px dashed var(--ag-range-selection-border-color) !important;\\n}\\n.ag-rtl .ag-cell.ag-selection-fill-right,\\n.ag-rtl .ag-cell.ag-selection-fill-right.ag-cell-range-selected {\\n  border-left: 1px dashed var(--ag-range-selection-border-color) !important;\\n}\\n\\n.ag-cell.ag-selection-fill-bottom,\\n.ag-cell.ag-selection-fill-bottom.ag-cell-range-selected {\\n  border-bottom: 1px dashed;\\n  border-bottom-color: var(--ag-range-selection-border-color);\\n}\\n\\n.ag-ltr .ag-cell.ag-selection-fill-left,\\n.ag-ltr .ag-cell.ag-selection-fill-left.ag-cell-range-selected {\\n  border-left: 1px dashed var(--ag-range-selection-border-color) !important;\\n}\\n.ag-rtl .ag-cell.ag-selection-fil";
      S = S + 'l-left,\\n.ag-rtl .ag-cell.ag-selection-fill-left.ag-cell-range-selected {\\n  border-right: 1px dashed var(--ag-range-selection-border-color) !important;\\n}\\n\\n.ag-fill-handle,\\n.ag-range-handle {\\n  position: absolute;\\n  width: 6px;\\n  height: 6px;\\n  bottom: -1px;\\n  background-color: var(--ag-range-selection-border-color);\\n}\\n.ag-ltr .ag-fill-handle,\\n.ag-ltr .ag-range-handle {\\n  right: -1px;\\n}\\n.ag-rtl .ag-fill-handle,\\n.ag-rtl .ag-range-handle {\\n  left: -1px;\\n}\\n\\n.ag-fill-handle {\\n  cursor: cell;\\n}\\n\\n.ag-range-handle {\\n  cursor: nwse-resize;\\n}\\n\\n.ag-cell-inline-editing {\\n  border-color: var(--ag-input-focus-border-color) !important;\\n}\\n\\n.ag-menu {\\n  border: var(--ag-borders) var(--ag-border-color);\\n  background: var(--ag-background-color);\\n  border-radius: var(--ag-card-radius);\\n  box-shadow: var(--ag-card-shadow);\\n  padding: var(--ag-grid-size);\\n  background-color: var(--ag-menu-background-color);\\n  border-color: var(--ag-menu-border-color);\\n  padding: 0;\\n}\\n\\n.ag-menu.ag-tabs {\\n  min-width: var(--ag-tab-min-width);\\n}\\n\\n.ag-menu-list {\\n  cursor: default;\\n  padding: var(--ag-grid-size) 0;\\n}\\n\\n.ag-menu-separator {\\n  height: calc(var(--ag-grid-size) * 2 + 1px);\\n}\\n\\n.ag-menu-separator-part::after {\\n  content: "";\\n  display: block;\\n  border-top: var(--ag-borders-critical) var(--ag-border-color);\\n}\\n\\n.ag-menu-option-active,\\n.ag-compact-menu-option-active {\\n  background-color: var(--ag-row-hover-color);\\n}\\n\\n.ag-menu-option-part,\\n.ag-compact-menu-option-part {\\n  line-height: var(--ag-icon-size);\\n  padding: calc(var(--ag-grid-size) + 2px) 0;\\n}\\n\\n.ag-menu-option-disabled,\\n.ag-compact-menu-option-disabled {\\n  opacity: 0.5;\\n}\\n\\n.ag-menu-option-icon,\\n.ag-compact-menu-option-icon {\\n  width: var(--ag-icon-size);\\n}\\n.ag-ltr .ag-menu-option-icon,\\n.ag-ltr .ag-compact-menu-option-icon {\\n  padding-left: calc(var(--ag-grid-size) * 2);\\n}\\n.ag-rtl .ag-menu-option-icon,\\n.ag-rtl .ag-compact-menu-option-icon {\\n  padding-right:';
      S = S + ' calc(var(--ag-grid-size) * 2);\\n}\\n\\n.ag-menu-option-text,\\n.ag-compact-menu-option-text {\\n  padding-left: calc(var(--ag-grid-size) * 2);\\n  padding-right: calc(var(--ag-grid-size) * 2);\\n}\\n\\n.ag-ltr .ag-menu-option-shortcut,\\n.ag-ltr .ag-compact-menu-option-shortcut {\\n  padding-right: var(--ag-grid-size);\\n}\\n.ag-rtl .ag-menu-option-shortcut,\\n.ag-rtl .ag-compact-menu-option-shortcut {\\n  padding-left: var(--ag-grid-size);\\n}\\n\\n.ag-ltr .ag-menu-option-popup-pointer,\\n.ag-ltr .ag-compact-menu-option-popup-pointer {\\n  padding-right: var(--ag-grid-size);\\n}\\n.ag-rtl .ag-menu-option-popup-pointer,\\n.ag-rtl .ag-compact-menu-option-popup-pointer {\\n  padding-left: var(--ag-grid-size);\\n}\\n\\n.ag-tabs-header {\\n  display: flex;\\n}\\n\\n.ag-tabs-header-wrapper {\\n  display: flex;\\n}\\n.ag-tabs-header-wrapper .ag-tabs-header {\\n  flex: 1;\\n}\\n\\n.ag-tabs-close-button-wrapper {\\n  border: 0;\\n  border-right: var(--ag-borders) var(--ag-border-color);\\n  padding: var(--ag-grid-size);\\n}\\n\\n.ag-tabs-close-button {\\n  border: 0;\\n  background-color: transparent;\\n  background-color: initial;\\n  cursor: pointer;\\n  padding: 0;\\n}\\n\\n.ag-tab {\\n  border-bottom: var(--ag-selected-tab-underline-width) solid transparent;\\n  transition: border-bottom var(--ag-selected-tab-underline-transition-speed);\\n  display: flex;\\n  flex: none;\\n  align-items: center;\\n  justify-content: center;\\n  cursor: pointer;\\n}\\n\\n.ag-tab:focus-visible {\\n  outline: none;\\n}\\n.ag-tab:focus-visible::after {\\n  content: "";\\n  position: absolute;\\n  background-color: transparent;\\n  pointer-events: none;\\n  top: 4px;\\n  left: 4px;\\n  display: block;\\n  width: calc(100% - 8px);\\n  height: calc(100% - 8px);\\n  border: 1px solid;\\n  border-color: var(--ag-input-focus-border-color);\\n}\\n\\n.ag-tab-selected {\\n  border-bottom-color: var(--ag-selected-tab-underline-color);\\n}\\n\\n.ag-menu-header {\\n  color: var(--ag-secondary-foreground-color);\\n}\\n\\n.ag-filter-separator {\\n  border-top: var(--ag-borders-critical) ';
      S = S + "var(--ag-border-color);\\n}\\n\\n.ag-filter-select .ag-picker-field-wrapper {\\n  width: 0;\\n}\\n\\n.ag-filter-condition-operator {\\n  height: 17px;\\n}\\n\\n.ag-ltr .ag-filter-condition-operator-or {\\n  margin-left: calc(var(--ag-grid-size) * 2);\\n}\\n.ag-rtl .ag-filter-condition-operator-or {\\n  margin-right: calc(var(--ag-grid-size) * 2);\\n}\\n\\n.ag-set-filter-select-all {\\n  padding-top: var(--ag-widget-container-vertical-padding);\\n}\\n\\n.ag-set-filter-list,\\n.ag-filter-no-matches {\\n  height: calc(var(--ag-list-item-height) * 6);\\n}\\n\\n.ag-set-filter-tree-list {\\n  height: calc(var(--ag-list-item-height) * 10);\\n}\\n\\n.ag-set-filter-filter {\\n  margin-top: var(--ag-widget-container-vertical-padding);\\n  margin-left: var(--ag-widget-container-horizontal-padding);\\n  margin-right: var(--ag-widget-container-horizontal-padding);\\n}\\n\\n.ag-filter-to {\\n  margin-top: var(--ag-widget-vertical-spacing);\\n}\\n\\n.ag-mini-filter {\\n  margin: var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);\\n}\\n\\n.ag-set-filter {\\n  --ag-indentation-level: 0;\\n}\\n\\n.ag-ltr .ag-set-filter-item {\\n  padding-left: calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level) * var(--ag-set-filter-indent-size));\\n}\\n.ag-rtl .ag-set-filter-item {\\n  padding-right: calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level) * var(--ag-set-filter-indent-size));\\n}\\n\\n.ag-ltr .ag-set-filter-add-group-indent {\\n  margin-left: calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding));\\n}\\n.ag-rtl .ag-set-filter-add-group-indent {\\n  margin-right: calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding));\\n}\\n\\n.ag-ltr .ag-set-filter-group-icons {\\n  margin-right: var(--ag-widget-container-horizontal-padding);\\n}\\n.ag-rtl .ag-set-filter-group-icons {\\n  margin-left: var(--ag-widget-container-horizontal-padding);\\n}\\n\\n.ag-filter-menu .ag-set-filter-list {\\n  min-width: 200px;\\n}\\n\\n.ag-filter-virtual-";
      S = S + 'list-item:focus-visible {\\n  outline: none;\\n}\\n.ag-filter-virtual-list-item:focus-visible::after {\\n  content: "";\\n  position: absolute;\\n  background-color: transparent;\\n  pointer-events: none;\\n  top: 1px;\\n  left: 1px;\\n  display: block;\\n  width: calc(100% - 2px);\\n  height: calc(100% - 2px);\\n  border: 1px solid;\\n  border-color: var(--ag-input-focus-border-color);\\n}\\n\\n.ag-filter-apply-panel {\\n  padding: var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);\\n  border-top: var(--ag-borders-secondary) var(--ag-secondary-border-color);\\n}\\n\\n.ag-filter-apply-panel-button {\\n  line-height: 1.5;\\n}\\n.ag-ltr .ag-filter-apply-panel-button {\\n  margin-left: calc(var(--ag-grid-size) * 2);\\n}\\n.ag-rtl .ag-filter-apply-panel-button {\\n  margin-right: calc(var(--ag-grid-size) * 2);\\n}\\n\\n.ag-simple-filter-body-wrapper {\\n  padding: var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);\\n  padding-bottom: calc(var(--ag-widget-container-vertical-padding) - var(--ag-widget-vertical-spacing));\\n  overflow-y: auto;\\n  min-height: calc(var(--ag-list-item-height) + var(--ag-widget-container-vertical-padding) + var(--ag-widget-vertical-spacing));\\n}\\n.ag-simple-filter-body-wrapper > * {\\n  margin-bottom: var(--ag-widget-vertical-spacing);\\n}\\n.ag-simple-filter-body-wrapper .ag-resizer-wrapper {\\n  margin: 0;\\n}\\n\\n.ag-menu:not(.ag-tabs) .ag-filter .ag-filter-body-wrapper,\\n.ag-menu:not(.ag-tabs) .ag-filter > *:not(.ag-filter-wrapper) {\\n  min-width: calc(var(--ag-menu-min-width) - 2px);\\n}\\n\\n.ag-filter-no-matches {\\n  padding: var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);\\n}\\n\\n.ag-multi-filter-menu-item {\\n  margin: var(--ag-grid-size) 0;\\n}\\n\\n.ag-multi-filter-group-title-bar {\\n  padding: calc(var(--ag-grid-size) * 2) var(--ag-grid-size);\\n  background-color: transparent;\\n}\\n\\n.ag-group-filter-field-select-wrapper {\\n  padding: var(--ag-widget-container-';
      S = S + 'vertical-padding) var(--ag-widget-container-horizontal-padding);\\n  padding-bottom: calc(var(--ag-widget-container-vertical-padding) - var(--ag-widget-vertical-spacing));\\n}\\n.ag-group-filter-field-select-wrapper > * {\\n  margin-bottom: var(--ag-widget-vertical-spacing);\\n}\\n\\n.ag-multi-filter-group-title-bar:focus-visible {\\n  outline: none;\\n}\\n.ag-multi-filter-group-title-bar:focus-visible::after {\\n  content: "";\\n  position: absolute;\\n  background-color: transparent;\\n  pointer-events: none;\\n  top: 4px;\\n  left: 4px;\\n  display: block;\\n  width: calc(100% - 8px);\\n  height: calc(100% - 8px);\\n  border: 1px solid;\\n  border-color: var(--ag-input-focus-border-color);\\n}\\n\\n.ag-side-bar {\\n  position: relative;\\n}\\n\\n.ag-tool-panel-wrapper {\\n  width: var(--ag-side-bar-panel-width);\\n  background-color: var(--ag-control-panel-background-color);\\n}\\n\\n.ag-side-buttons {\\n  padding-top: calc(var(--ag-grid-size) * 4);\\n  width: calc(var(--ag-icon-size) + 4px);\\n  position: relative;\\n  overflow: hidden;\\n}\\n\\nbutton.ag-side-button-button {\\n  color: inherit;\\n  font-family: inherit;\\n  font-size: inherit;\\n  font-weight: inherit;\\n  line-height: inherit;\\n  background: transparent;\\n  padding: calc(var(--ag-grid-size) * 2) 0 calc(var(--ag-grid-size) * 2) 0;\\n  width: 100%;\\n  margin: 0;\\n  min-height: calc(var(--ag-grid-size) * 18);\\n  background-position-y: center;\\n  background-position-x: center;\\n  background-repeat: no-repeat;\\n  border: none;\\n  border-top: var(--ag-borders-side-button) var(--ag-border-color);\\n  border-bottom: var(--ag-borders-side-button) var(--ag-border-color);\\n}\\nbutton.ag-side-button-button:focus {\\n  box-shadow: none;\\n}\\n\\n.ag-side-button-button:focus-visible {\\n  outline: none;\\n}\\n.ag-side-button-button:focus-visible::after {\\n  content: "";\\n  position: absolute;\\n  background-color: transparent;\\n  pointer-events: none;\\n  top: 4px;\\n  left: 4px;\\n  display: block;\\n  width: calc(100% - 8px);\\n  height: calc(100% - 8px);\\n  border';
      S = S + ": 1px solid;\\n  border-color: var(--ag-input-focus-border-color);\\n}\\n\\n.ag-selected button.ag-side-button-button {\\n  background-color: var(--ag-side-button-selected-background-color);\\n}\\n\\n.ag-side-button-icon-wrapper {\\n  margin-bottom: 3px;\\n}\\n\\n.ag-ltr .ag-side-bar-left,\\n.ag-rtl .ag-side-bar-right {\\n  border-right: var(--ag-borders) var(--ag-border-color);\\n}\\n.ag-ltr .ag-side-bar-left .ag-tool-panel-wrapper,\\n.ag-rtl .ag-side-bar-right .ag-tool-panel-wrapper {\\n  border-left: var(--ag-borders) var(--ag-border-color);\\n}\\n.ag-ltr .ag-side-bar-left .ag-side-button-button,\\n.ag-rtl .ag-side-bar-right .ag-side-button-button {\\n  border-right: var(--ag-selected-tab-underline-width) solid transparent;\\n  transition: border-right var(--ag-selected-tab-underline-transition-speed);\\n}\\n.ag-ltr .ag-side-bar-left .ag-selected .ag-side-button-button,\\n.ag-rtl .ag-side-bar-right .ag-selected .ag-side-button-button {\\n  border-right-color: var(--ag-selected-tab-underline-color);\\n}\\n\\n.ag-rtl .ag-side-bar-left,\\n.ag-ltr .ag-side-bar-right {\\n  border-left: var(--ag-borders) var(--ag-border-color);\\n}\\n.ag-rtl .ag-side-bar-left .ag-tool-panel-wrapper,\\n.ag-ltr .ag-side-bar-right .ag-tool-panel-wrapper {\\n  border-right: var(--ag-borders) var(--ag-border-color);\\n}\\n.ag-rtl .ag-side-bar-left .ag-side-button-button,\\n.ag-ltr .ag-side-bar-right .ag-side-button-button {\\n  border-left: var(--ag-selected-tab-underline-width) solid transparent;\\n  transition: border-left var(--ag-selected-tab-underline-transition-speed);\\n}\\n.ag-rtl .ag-side-bar-left .ag-selected .ag-side-button-button,\\n.ag-ltr .ag-side-bar-right .ag-selected .ag-side-button-button {\\n  border-left-color: var(--ag-selected-tab-underline-color);\\n}\\n\\n.ag-filter-toolpanel-header {\\n  height: calc(var(--ag-grid-size) * 6);\\n}\\n\\n.ag-filter-toolpanel-header,\\n.ag-filter-toolpanel-search {\\n  padding: 0 var(--ag-grid-size);\\n}\\n\\n.ag-filter-toolpanel-header:focus-visible {\\n  outline: none;\\n}\\n.ag-filter-toolpan";
      S = S + 'el-header:focus-visible::after {\\n  content: "";\\n  position: absolute;\\n  background-color: transparent;\\n  pointer-events: none;\\n  top: 4px;\\n  left: 4px;\\n  display: block;\\n  width: calc(100% - 8px);\\n  height: calc(100% - 8px);\\n  border: 1px solid;\\n  border-color: var(--ag-input-focus-border-color);\\n}\\n\\n.ag-filter-toolpanel-group:not(.ag-has-filter) > .ag-group-title-bar .ag-filter-toolpanel-group-instance-header-icon {\\n  display: none;\\n}\\n\\n.ag-filter-toolpanel-group-level-0-header {\\n  height: calc(var(--ag-grid-size) * 8);\\n}\\n\\n.ag-filter-toolpanel-group-item {\\n  margin-top: calc(var(--ag-grid-size) * 0.5);\\n  margin-bottom: calc(var(--ag-grid-size) * 0.5);\\n}\\n\\n.ag-filter-toolpanel-search {\\n  height: var(--ag-header-height);\\n}\\n\\n.ag-filter-toolpanel-search-input {\\n  flex-grow: 1;\\n  height: calc(var(--ag-grid-size) * 4);\\n}\\n.ag-ltr .ag-filter-toolpanel-search-input {\\n  margin-right: var(--ag-grid-size);\\n}\\n.ag-rtl .ag-filter-toolpanel-search-input {\\n  margin-left: var(--ag-grid-size);\\n}\\n\\n.ag-filter-toolpanel-group-level-0 {\\n  border-top: var(--ag-borders-secondary) var(--ag-secondary-border-color);\\n}\\n\\n.ag-ltr .ag-filter-toolpanel-expand,\\n.ag-ltr .ag-filter-toolpanel-group-title-bar-icon {\\n  margin-right: var(--ag-grid-size);\\n}\\n.ag-rtl .ag-filter-toolpanel-expand,\\n.ag-rtl .ag-filter-toolpanel-group-title-bar-icon {\\n  margin-left: var(--ag-grid-size);\\n}\\n\\n.ag-filter-toolpanel-group-title-bar {\\n  background-color: transparent;\\n}\\n\\n.ag-ltr .ag-filter-toolpanel-header {\\n  padding-left: calc(var(--ag-filter-tool-panel-group-indent) * 0 + var(--ag-grid-size));\\n  padding-left: calc(var(--ag-filter-tool-panel-group-indent) * var(--ag-indentation-level, 0) + var(--ag-grid-size));\\n}\\n.ag-rtl .ag-filter-toolpanel-header {\\n  padding-right: calc(var(--ag-filter-tool-panel-group-indent) * 0 + var(--ag-grid-size));\\n  padding-right: calc(var(--ag-filter-tool-panel-group-indent) * var(--ag-indentation-level, 0) + var(--ag-grid-size));';
      S = S + '\\n}\\n\\n.ag-filter-toolpanel-instance-filter {\\n  border-bottom: var(--ag-borders) var(--ag-border-color);\\n  border-top: var(--ag-borders) var(--ag-border-color);\\n  margin-top: var(--ag-grid-size);\\n}\\n\\n.ag-ltr .ag-filter-toolpanel-group-instance-header-icon,\\n.ag-ltr .ag-filter-toolpanel-instance-header-icon {\\n  margin-left: var(--ag-grid-size);\\n}\\n.ag-rtl .ag-filter-toolpanel-group-instance-header-icon,\\n.ag-rtl .ag-filter-toolpanel-instance-header-icon {\\n  margin-right: var(--ag-grid-size);\\n}\\n\\n.ag-set-filter-group-icons {\\n  color: var(--ag-secondary-foreground-color);\\n}\\n\\n.ag-pivot-mode-panel {\\n  min-height: var(--ag-header-height);\\n  height: var(--ag-header-height);\\n  display: flex;\\n}\\n\\n.ag-pivot-mode-select {\\n  display: flex;\\n  align-items: center;\\n}\\n.ag-ltr .ag-pivot-mode-select {\\n  margin-left: var(--ag-widget-container-horizontal-padding);\\n}\\n.ag-rtl .ag-pivot-mode-select {\\n  margin-right: var(--ag-widget-container-horizontal-padding);\\n}\\n\\n.ag-column-select-header:focus-visible {\\n  outline: none;\\n}\\n.ag-column-select-header:focus-visible::after {\\n  content: "";\\n  position: absolute;\\n  background-color: transparent;\\n  pointer-events: none;\\n  top: 4px;\\n  left: 4px;\\n  display: block;\\n  width: calc(100% - 8px);\\n  height: calc(100% - 8px);\\n  border: 1px solid;\\n  border-color: var(--ag-input-focus-border-color);\\n}\\n\\n.ag-column-select-header {\\n  height: var(--ag-header-height);\\n  align-items: center;\\n  padding: 0 var(--ag-widget-container-horizontal-padding);\\n  border-bottom: var(--ag-borders-secondary) var(--ag-secondary-border-color);\\n}\\n\\n.ag-column-panel-column-select {\\n  border-bottom: var(--ag-borders-secondary) var(--ag-secondary-border-color);\\n  border-top: var(--ag-borders-secondary) var(--ag-secondary-border-color);\\n}\\n\\n.ag-column-group-icons,\\n.ag-column-select-header-icon {\\n  color: var(--ag-secondary-foreground-color);\\n}\\n\\n.ag-column-select-list .ag-list-item-hovered::after {\\n  content: "";\\n  positi';
      S = S + "on: absolute;\\n  left: 0;\\n  right: 0;\\n  height: 1px;\\n  background-color: var(--ag-range-selection-border-color);\\n}\\n.ag-column-select-list .ag-item-highlight-top::after {\\n  top: 0;\\n}\\n.ag-column-select-list .ag-item-highlight-bottom::after {\\n  bottom: 0;\\n}\\n\\n.ag-header,\\n.ag-advanced-filter-header {\\n  background-color: var(--ag-header-background-color);\\n  border-bottom: var(--ag-borders-critical) var(--ag-border-color);\\n}\\n\\n.ag-header-row {\\n  color: var(--ag-header-foreground-color);\\n  height: var(--ag-header-height);\\n}\\n\\n.ag-pinned-right-header {\\n  border-left: var(--ag-borders-critical) var(--ag-border-color);\\n}\\n\\n.ag-pinned-left-header {\\n  border-right: var(--ag-borders-critical) var(--ag-border-color);\\n}\\n\\n.ag-ltr .ag-header-cell:not(.ag-right-aligned-header) .ag-header-label-icon,\\n.ag-ltr .ag-header-cell:not(.ag-right-aligned-header) .ag-header-menu-icon {\\n  margin-left: var(--ag-grid-size);\\n}\\n.ag-rtl .ag-header-cell:not(.ag-right-aligned-header) .ag-header-label-icon,\\n.ag-rtl .ag-header-cell:not(.ag-right-aligned-header) .ag-header-menu-icon {\\n  margin-right: var(--ag-grid-size);\\n}\\n\\n.ag-ltr .ag-header-cell.ag-right-aligned-header .ag-header-label-icon,\\n.ag-ltr .ag-header-cell.ag-right-aligned-header .ag-header-menu-icon {\\n  margin-right: var(--ag-grid-size);\\n}\\n.ag-rtl .ag-header-cell.ag-right-aligned-header .ag-header-label-icon,\\n.ag-rtl .ag-header-cell.ag-right-aligned-header .ag-header-menu-icon {\\n  margin-left: var(--ag-grid-size);\\n}\\n\\n.ag-header-cell,\\n.ag-header-group-cell {\\n  padding-left: var(--ag-cell-horizontal-padding);\\n  padding-right: var(--ag-cell-horizontal-padding);\\n}\\n.ag-header-cell.ag-header-cell-moving,\\n.ag-header-group-cell.ag-header-cell-moving {\\n  background-color: var(--ag-header-cell-moving-background-color);\\n}\\n\\n.ag-ltr .ag-header-group-cell-label.ag-sticky-label {\\n  left: var(--ag-cell-horizontal-padding);\\n}\\n.ag-rtl .ag-header-group-cell-label.ag-sticky-label {\\n  right: var(--ag-cell-";
      S = S + 'horizontal-padding);\\n}\\n\\n.ag-header-cell:focus-visible {\\n  outline: none;\\n}\\n.ag-header-cell:focus-visible::after {\\n  content: "";\\n  position: absolute;\\n  background-color: transparent;\\n  pointer-events: none;\\n  top: 4px;\\n  left: 4px;\\n  display: block;\\n  width: calc(100% - 8px);\\n  height: calc(100% - 8px);\\n  border: 1px solid;\\n  border-color: var(--ag-input-focus-border-color);\\n}\\n\\n.ag-header-group-cell:focus-visible {\\n  outline: none;\\n}\\n.ag-header-group-cell:focus-visible::after {\\n  content: "";\\n  position: absolute;\\n  background-color: transparent;\\n  pointer-events: none;\\n  top: 4px;\\n  left: 4px;\\n  display: block;\\n  width: calc(100% - 8px);\\n  height: calc(100% - 8px);\\n  border: 1px solid;\\n  border-color: var(--ag-input-focus-border-color);\\n}\\n\\n.ag-advanced-filter-header-cell:focus-visible {\\n  outline: none;\\n}\\n.ag-advanced-filter-header-cell:focus-visible::after {\\n  content: "";\\n  position: absolute;\\n  background-color: transparent;\\n  pointer-events: none;\\n  top: 4px;\\n  left: 4px;\\n  display: block;\\n  width: calc(100% - 8px);\\n  height: calc(100% - 8px);\\n  border: 1px solid;\\n  border-color: var(--ag-input-focus-border-color);\\n}\\n\\n.ag-header-icon {\\n  color: var(--ag-secondary-foreground-color);\\n}\\n\\n.ag-header-expand-icon {\\n  cursor: pointer;\\n}\\n.ag-ltr .ag-header-expand-icon {\\n  margin-left: 4px;\\n}\\n.ag-rtl .ag-header-expand-icon {\\n  margin-right: 4px;\\n}\\n\\n.ag-header-row:not(:first-child) .ag-header-cell:not(.ag-header-span-height.ag-header-span-total),\\n.ag-header-row:not(:first-child) .ag-header-group-cell.ag-header-group-cell-with-group {\\n  border-top: var(--ag-borders-critical) var(--ag-border-color);\\n}\\n\\n.ag-header-group-cell:not(.ag-column-resizing) + .ag-header-group-cell:not(.ag-column-hover):not(.ag-header-cell-moving):hover, .ag-header-group-cell:not(.ag-column-resizing) + .ag-header-group-cell:not(.ag-column-hover).ag-column-resizing,\\n.ag-header-cell:not(.ag-column-resizing) + .ag-header-cell:no';
      S = S + 't(.ag-column-hover):not(.ag-header-cell-moving):hover,\\n.ag-header-cell:not(.ag-column-resizing) + .ag-header-cell:not(.ag-column-hover).ag-column-resizing,\\n.ag-header-group-cell:first-of-type:not(.ag-header-cell-moving):hover,\\n.ag-header-group-cell:first-of-type.ag-column-resizing,\\n.ag-header-cell:not(.ag-column-hover):first-of-type:not(.ag-header-cell-moving):hover,\\n.ag-header-cell:not(.ag-column-hover):first-of-type.ag-column-resizing {\\n  background-color: var(--ag-header-cell-hover-background-color);\\n}\\n\\n.ag-header-cell::before,\\n.ag-header-group-cell:not(.ag-header-span-height.ag-header-group-cell-no-group)::before {\\n  content: "";\\n  position: absolute;\\n  z-index: 1;\\n  display: var(--ag-header-column-separator-display);\\n  width: var(--ag-header-column-separator-width);\\n  height: var(--ag-header-column-separator-height);\\n  top: calc(50% - var(--ag-header-column-separator-height) * 0.5);\\n  background-color: var(--ag-header-column-separator-color);\\n}\\n.ag-ltr .ag-header-cell::before,\\n.ag-ltr .ag-header-group-cell:not(.ag-header-span-height.ag-header-group-cell-no-group)::before {\\n  right: 0;\\n}\\n.ag-rtl .ag-header-cell::before,\\n.ag-rtl .ag-header-group-cell:not(.ag-header-span-height.ag-header-group-cell-no-group)::before {\\n  left: 0;\\n}\\n\\n.ag-header-cell-resize {\\n  display: flex;\\n  align-items: center;\\n}\\n\\n.ag-header-cell-resize::after {\\n  content: "";\\n  position: absolute;\\n  z-index: 1;\\n  display: var(--ag-header-column-resize-handle-display);\\n  width: var(--ag-header-column-resize-handle-width);\\n  height: var(--ag-header-column-resize-handle-height);\\n  top: calc(50% - var(--ag-header-column-resize-handle-height) * 0.5);\\n  background-color: var(--ag-header-column-resize-handle-color);\\n}\\n.ag-header-cell.ag-header-span-height .ag-header-cell-resize::after {\\n  height: calc(100% - var(--ag-grid-size) * 4);\\n  top: calc(var(--ag-grid-size) * 2);\\n}\\n\\n.ag-ltr .ag-header-viewport .ag-header-cell-resize::after {\\n  left: calc(50% - v';
      S = S + 'ar(--ag-header-column-resize-handle-width));\\n}\\n.ag-rtl .ag-header-viewport .ag-header-cell-resize::after {\\n  right: calc(50% - var(--ag-header-column-resize-handle-width));\\n}\\n\\n.ag-pinned-left-header .ag-header-cell-resize::after {\\n  left: calc(50% - var(--ag-header-column-resize-handle-width));\\n}\\n\\n.ag-pinned-right-header .ag-header-cell-resize::after {\\n  left: 50%;\\n}\\n\\n.ag-ltr .ag-header-select-all {\\n  margin-right: var(--ag-cell-horizontal-padding);\\n}\\n.ag-rtl .ag-header-select-all {\\n  margin-left: var(--ag-cell-horizontal-padding);\\n}\\n\\n.ag-ltr .ag-floating-filter-button {\\n  margin-left: var(--ag-cell-widget-spacing);\\n}\\n.ag-rtl .ag-floating-filter-button {\\n  margin-right: var(--ag-cell-widget-spacing);\\n}\\n\\n.ag-floating-filter-button-button {\\n  color: inherit;\\n  font-family: inherit;\\n  font-size: inherit;\\n  font-weight: inherit;\\n  line-height: inherit;\\n  -webkit-appearance: none;\\n     -moz-appearance: none;\\n          appearance: none;\\n  background: transparent;\\n  border: none;\\n  height: var(--ag-icon-size);\\n  padding: 0;\\n  width: var(--ag-icon-size);\\n}\\n\\n.ag-filter-loading {\\n  background-color: var(--ag-control-panel-background-color);\\n  height: 100%;\\n  padding: var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);\\n  position: absolute;\\n  width: 100%;\\n  z-index: 1;\\n}\\n\\n.ag-paging-panel {\\n  border-top: 1px solid;\\n  border-top-color: var(--ag-border-color);\\n  color: var(--ag-secondary-foreground-color);\\n  height: var(--ag-header-height);\\n}\\n.ag-paging-panel > * {\\n  margin: 0 var(--ag-cell-horizontal-padding);\\n}\\n.ag-paging-panel > .ag-paging-page-size .ag-wrapper {\\n  min-width: calc(var(--ag-grid-size) * 10);\\n}\\n\\n.ag-paging-button {\\n  cursor: pointer;\\n}\\n\\n.ag-paging-button.ag-disabled {\\n  cursor: default;\\n  color: var(--ag-disabled-foreground-color);\\n}\\n\\n.ag-paging-button:focus-visible {\\n  outline: none;\\n}\\n.ag-paging-button:focus-visible::after {\\n  content: "";\\n  ';
      S = S + 'position: absolute;\\n  background-color: transparent;\\n  pointer-events: none;\\n  top: 0px;\\n  left: 0px;\\n  display: block;\\n  width: calc(100% - 0px);\\n  height: calc(100% - 0px);\\n  border: 1px solid;\\n  border-color: var(--ag-input-focus-border-color);\\n}\\n\\n.ag-paging-button,\\n.ag-paging-description {\\n  margin: 0 var(--ag-grid-size);\\n}\\n\\n.ag-status-bar {\\n  border-top: var(--ag-borders) var(--ag-border-color);\\n  color: var(--ag-disabled-foreground-color);\\n  padding-right: calc(var(--ag-grid-size) * 4);\\n  padding-left: calc(var(--ag-grid-size) * 4);\\n  line-height: 1.5;\\n}\\n\\n.ag-status-name-value-value {\\n  color: var(--ag-foreground-color);\\n}\\n\\n.ag-status-bar-center {\\n  text-align: center;\\n}\\n\\n.ag-status-name-value {\\n  margin-left: var(--ag-grid-size);\\n  margin-right: var(--ag-grid-size);\\n  padding-top: calc(var(--ag-grid-size) * 2);\\n  padding-bottom: calc(var(--ag-grid-size) * 2);\\n}\\n\\n.ag-column-drop-cell {\\n  background: var(--ag-chip-background-color);\\n  border-radius: calc(var(--ag-grid-size) * 4);\\n  height: calc(var(--ag-grid-size) * 4);\\n  padding: 0 calc(var(--ag-grid-size) * 0.5);\\n  border: 1px solid var(--ag-chip-border-color);\\n}\\n\\n.ag-column-drop-cell:focus-visible {\\n  outline: none;\\n}\\n.ag-column-drop-cell:focus-visible::after {\\n  content: "";\\n  position: absolute;\\n  background-color: transparent;\\n  pointer-events: none;\\n  top: 2px;\\n  left: 2px;\\n  display: block;\\n  width: calc(100% - 4px);\\n  height: calc(100% - 4px);\\n  border: 1px solid;\\n  border-color: var(--ag-input-focus-border-color);\\n}\\n\\n.ag-column-drop-cell-text {\\n  margin: 0 var(--ag-grid-size);\\n}\\n\\n.ag-column-drop-cell-button {\\n  min-width: calc(var(--ag-grid-size) * 4);\\n  margin: 0 calc(var(--ag-grid-size) * 0.5);\\n  color: var(--ag-secondary-foreground-color);\\n}\\n\\n.ag-column-drop-cell-drag-handle {\\n  margin-left: calc(var(--ag-grid-size) * 2);\\n}\\n\\n.ag-column-drop-cell-ghost {\\n  opacity: 0.5;\\n}\\n\\n.ag-column-drop-horizontal {\\n  background-co';
      S = S + "lor: var(--ag-header-background-color);\\n  color: var(--ag-secondary-foreground-color);\\n  height: var(--ag-header-height);\\n  border-bottom: var(--ag-borders) var(--ag-border-color);\\n}\\n.ag-ltr .ag-column-drop-horizontal {\\n  padding-left: var(--ag-cell-horizontal-padding);\\n}\\n.ag-rtl .ag-column-drop-horizontal {\\n  padding-right: var(--ag-cell-horizontal-padding);\\n}\\n\\n.ag-ltr .ag-column-drop-horizontal-half-width:not(:last-child) {\\n  border-right: var(--ag-borders) var(--ag-border-color);\\n}\\n.ag-rtl .ag-column-drop-horizontal-half-width:not(:last-child) {\\n  border-left: var(--ag-borders) var(--ag-border-color);\\n}\\n\\n.ag-column-drop-horizontal-cell-separator {\\n  margin: 0 var(--ag-grid-size);\\n  color: var(--ag-secondary-foreground-color);\\n}\\n\\n.ag-column-drop-horizontal-empty-message {\\n  color: var(--ag-disabled-foreground-color);\\n}\\n\\n.ag-ltr .ag-column-drop-horizontal-icon {\\n  margin-right: var(--ag-cell-horizontal-padding);\\n}\\n.ag-rtl .ag-column-drop-horizontal-icon {\\n  margin-left: var(--ag-cell-horizontal-padding);\\n}\\n\\n.ag-column-drop-vertical-list {\\n  padding-bottom: var(--ag-grid-size);\\n  padding-right: var(--ag-grid-size);\\n  padding-left: var(--ag-grid-size);\\n}\\n\\n.ag-column-drop-vertical-cell {\\n  margin-top: var(--ag-grid-size);\\n}\\n\\n.ag-column-drop-vertical {\\n  min-height: 50px;\\n  border-bottom: var(--ag-borders-secondary) var(--ag-secondary-border-color);\\n}\\n.ag-column-drop-vertical.ag-last-column-drop {\\n  border-bottom: none;\\n}\\n\\n.ag-column-drop-vertical-icon {\\n  margin-left: var(--ag-grid-size);\\n  margin-right: var(--ag-grid-size);\\n}\\n\\n.ag-column-drop-vertical-empty-message {\\n  position: absolute;\\n  top: 0;\\n  bottom: 0;\\n  left: 0;\\n  right: 0;\\n  overflow: hidden;\\n  color: var(--ag-disabled-foreground-color);\\n  margin-top: var(--ag-grid-size);\\n}\\n\\n.ag-select-agg-func-popup {\\n  border: var(--ag-borders) var(--ag-border-color);\\n  background: var(--ag-background-color);\\n  border-radius: var(--ag-card-radius);\\n";
      S = S + '  box-shadow: var(--ag-card-shadow);\\n  padding: var(--ag-grid-size);\\n  background: var(--ag-background-color);\\n  height: calc(var(--ag-grid-size) * 5 * 3.5);\\n  padding: 0;\\n}\\n\\n.ag-select-agg-func-virtual-list-item {\\n  cursor: default;\\n}\\n.ag-ltr .ag-select-agg-func-virtual-list-item {\\n  padding-left: calc(var(--ag-grid-size) * 2);\\n}\\n.ag-rtl .ag-select-agg-func-virtual-list-item {\\n  padding-right: calc(var(--ag-grid-size) * 2);\\n}\\n.ag-select-agg-func-virtual-list-item:hover {\\n  background-color: var(--ag-selected-row-background-color);\\n}\\n\\n.ag-select-agg-func-virtual-list-item:focus-visible {\\n  outline: none;\\n}\\n.ag-select-agg-func-virtual-list-item:focus-visible::after {\\n  content: "";\\n  position: absolute;\\n  background-color: transparent;\\n  pointer-events: none;\\n  top: 1px;\\n  left: 1px;\\n  display: block;\\n  width: calc(100% - 2px);\\n  height: calc(100% - 2px);\\n  border: 1px solid;\\n  border-color: var(--ag-input-focus-border-color);\\n}\\n\\n.ag-sort-indicator-container {\\n  display: flex;\\n}\\n\\n.ag-ltr .ag-sort-indicator-icon {\\n  padding-left: var(--ag-grid-size);\\n}\\n.ag-rtl .ag-sort-indicator-icon {\\n  padding-right: var(--ag-grid-size);\\n}\\n\\n.ag-chart {\\n  position: relative;\\n  display: flex;\\n  overflow: hidden;\\n  width: 100%;\\n  height: 100%;\\n}\\n\\n.ag-chart-components-wrapper {\\n  position: relative;\\n  display: flex;\\n  flex: 1 1 auto;\\n  overflow: hidden;\\n}\\n\\n.ag-chart-canvas-wrapper {\\n  position: relative;\\n  flex: 1 1 auto;\\n  overflow: hidden;\\n}\\n\\n.ag-chart-menu {\\n  position: absolute;\\n  top: 16px;\\n  display: flex;\\n  flex-direction: column;\\n}\\n.ag-ltr .ag-chart-menu {\\n  right: 20px;\\n}\\n.ag-rtl .ag-chart-menu {\\n  left: 20px;\\n}\\n\\n.ag-chart-docked-container {\\n  position: relative;\\n  min-width: var(--ag-chart-menu-panel-width);\\n}\\n\\n.ag-chart-menu-hidden ~ .ag-chart-docked-container {\\n  display: none;\\n}\\n\\n.ag-chart-tabbed-menu {\\n  width: 100%;\\n  height: 100%;\\n  display: flex;\\n  flex-direction: column;\\n  o';
      S = S + 'verflow: hidden;\\n}\\n\\n.ag-chart-tabbed-menu-header {\\n  flex: none;\\n  -moz-user-select: none;\\n  -webkit-user-select: none;\\n  user-select: none;\\n  cursor: default;\\n}\\n\\n.ag-chart-tabbed-menu-body {\\n  display: flex;\\n  flex: 1 1 auto;\\n  align-items: stretch;\\n  overflow: hidden;\\n}\\n\\n.ag-chart-tab {\\n  width: 100%;\\n  overflow: hidden;\\n  overflow-y: auto;\\n}\\n\\n.ag-chart-settings {\\n  overflow-x: hidden;\\n}\\n\\n.ag-chart-settings-wrapper {\\n  position: relative;\\n  flex-direction: column;\\n  width: 100%;\\n  height: 100%;\\n  display: flex;\\n  overflow: hidden;\\n}\\n\\n.ag-chart-settings-nav-bar {\\n  display: flex;\\n  align-items: center;\\n  width: 100%;\\n  height: 30px;\\n  padding: 0 10px;\\n  -moz-user-select: none;\\n  -webkit-user-select: none;\\n  user-select: none;\\n}\\n\\n.ag-chart-settings-card-selector {\\n  display: flex;\\n  align-items: center;\\n  justify-content: space-around;\\n  flex: 1 1 auto;\\n  height: 100%;\\n  padding: 0 10px;\\n}\\n\\n.ag-chart-settings-card-item {\\n  cursor: pointer;\\n  width: 10px;\\n  height: 10px;\\n  background-color: #000;\\n  position: relative;\\n}\\n.ag-chart-settings-card-item.ag-not-selected {\\n  opacity: 0.2;\\n}\\n.ag-chart-settings-card-item::before {\\n  content: " ";\\n  display: block;\\n  position: absolute;\\n  background-color: transparent;\\n  left: 50%;\\n  top: 50%;\\n  margin-left: -10px;\\n  margin-top: -10px;\\n  width: 20px;\\n  height: 20px;\\n}\\n\\n.ag-chart-settings-prev,\\n.ag-chart-settings-next {\\n  position: relative;\\n  flex: none;\\n}\\n.ag-chart-settings-prev:focus-within,\\n.ag-chart-settings-next:focus-within {\\n  box-shadow: var(--ag-input-focus-box-shadow);\\n  border-radius: 1px;\\n}\\n\\n.ag-chart-settings-prev-button,\\n.ag-chart-settings-next-button {\\n  position: absolute;\\n  top: 0;\\n  left: 0;\\n  width: 100%;\\n  height: 100%;\\n  cursor: pointer;\\n  opacity: 0;\\n}\\n\\n.ag-chart-settings-mini-charts-container {\\n  position: relative;\\n  flex: 1 1 auto;\\n  overflow-x: hidden;\\n  overflow-y: auto;\\n}\\n\\n.ag-chart-settings-';
      S = S + "mini-wrapper {\\n  position: absolute;\\n  top: 0;\\n  left: 0;\\n  display: flex;\\n  flex-direction: column;\\n  width: 100%;\\n  min-height: 100%;\\n  overflow: hidden;\\n}\\n.ag-chart-settings-mini-wrapper.ag-animating {\\n  transition: left 0.3s;\\n  transition-timing-function: ease-in-out;\\n}\\n\\n.ag-chart-mini-thumbnail {\\n  cursor: pointer;\\n}\\n\\n.ag-chart-mini-thumbnail-canvas {\\n  display: block;\\n}\\n\\n.ag-chart-data-wrapper,\\n.ag-chart-format-wrapper,\\n.ag-chart-advanced-settings-wrapper {\\n  display: flex;\\n  flex-direction: column;\\n  position: relative;\\n  -moz-user-select: none;\\n  -webkit-user-select: none;\\n  user-select: none;\\n  padding-bottom: 16px;\\n}\\n\\n.ag-chart-data-wrapper,\\n.ag-chart-advanced-settings-wrapper {\\n  height: 100%;\\n  overflow-y: auto;\\n}\\n\\n.ag-chart-advanced-settings {\\n  background-color: var(--ag-control-panel-background-color);\\n}\\n\\n.ag-chart-advanced-settings-wrapper,\\n.ag-chart-advanced-settings {\\n  width: 100%;\\n}\\n\\n.ag-chart-advanced-settings-wrapper {\\n  padding-bottom: 0;\\n}\\n\\n.ag-chart-data-section,\\n.ag-chart-format-section,\\n.ag-chart-advanced-settings-section {\\n  display: flex;\\n  margin: 0;\\n}\\n\\n.ag-chart-advanced-settings-section {\\n  padding-top: var(--ag-grid-size);\\n  padding-bottom: var(--ag-grid-size);\\n}\\n.ag-chart-advanced-settings-section:not(:last-child) {\\n  border-bottom: 1px solid var(--ag-secondary-border-color);\\n}\\n\\n.ag-chart-empty-text {\\n  display: flex;\\n  top: 0;\\n  width: 100%;\\n  height: 100%;\\n  align-items: center;\\n  justify-content: center;\\n  background-color: var(--ag-background-color);\\n}\\n\\n.ag-chart .ag-chart-menu {\\n  display: none;\\n}\\n\\n.ag-chart-menu-hidden:hover .ag-chart-menu {\\n  display: block;\\n}\\n\\n.ag-chart .ag-chart-menu-wrapper .ag-chart-menu {\\n  display: flex;\\n  flex-direction: row;\\n  top: 8px;\\n  gap: 20px;\\n  width: auto;\\n}\\n.ag-ltr .ag-chart .ag-chart-menu-wrapper .ag-chart-menu {\\n  right: calc(var(--ag-cell-horizontal-padding) + var(--ag-grid-size) - 4px);\\n  justi";
      S = S + "fy-content: right;\\n}\\n.ag-rtl .ag-chart .ag-chart-menu-wrapper .ag-chart-menu {\\n  left: calc(var(--ag-cell-horizontal-padding) + var(--ag-grid-size) - 4px);\\n  justify-content: left;\\n}\\n\\n.ag-charts-font-size-color {\\n  display: flex;\\n  align-self: stretch;\\n  justify-content: space-between;\\n}\\n\\n.ag-charts-data-group-item {\\n  position: relative;\\n}\\n\\n.ag-charts-data-group-item:not(:last-child) {\\n  margin-bottom: var(--ag-grid-size);\\n}\\n\\n.ag-chart-menu {\\n  border-radius: var(--ag-card-radius);\\n  background: var(--ag-background-color);\\n}\\n\\n.ag-chart-menu-icon {\\n  opacity: 0.5;\\n  margin: 2px 0;\\n  cursor: pointer;\\n  border-radius: var(--ag-card-radius);\\n  color: var(--ag-secondary-foreground-color);\\n}\\n.ag-chart-menu-icon:hover {\\n  opacity: 1;\\n}\\n\\n.ag-chart-menu-toolbar-button {\\n  border: 0;\\n  background-color: transparent;\\n  background-color: initial;\\n  padding: 0 2px;\\n  border-radius: 1px;\\n}\\n\\n.ag-chart-mini-thumbnail {\\n  border: 1px solid var(--ag-secondary-border-color);\\n  border-radius: 5px;\\n}\\n.ag-chart-mini-thumbnail.ag-selected {\\n  border-color: var(--ag-minichart-selected-chart-color);\\n  border-width: 2px;\\n}\\n.ag-chart-mini-thumbnail:focus-visible {\\n  outline: none;\\n  border-color: var(--ag-minichart-selected-chart-color);\\n  box-shadow: var(--ag-input-focus-box-shadow);\\n}\\n\\n.ag-chart-settings-card-item {\\n  background: var(--ag-foreground-color);\\n  width: 8px;\\n  height: 8px;\\n  border-radius: 4px;\\n}\\n.ag-chart-settings-card-item.ag-selected {\\n  background-color: var(--ag-minichart-selected-page-color);\\n}\\n\\n.ag-chart-data-column-drag-handle {\\n  margin-left: var(--ag-grid-size);\\n}\\n\\n.ag-charts-settings-group-title-bar,\\n.ag-charts-data-group-title-bar,\\n.ag-charts-format-top-level-group-title-bar {\\n  border-top: var(--ag-borders-secondary) var(--ag-secondary-border-color);\\n  position: relative;\\n}\\n\\n.ag-charts-advanced-settings-top-level-group-title-bar {\\n  position: relative;\\n  background-color: transparent";
      S = S + ';\\n  background-color: initial;\\n}\\n\\n.ag-charts-data-group-title-bar:focus-visible {\\n  outline: none;\\n}\\n.ag-charts-data-group-title-bar:focus-visible::after {\\n  content: "";\\n  position: absolute;\\n  background-color: transparent;\\n  pointer-events: none;\\n  top: 4px;\\n  left: 4px;\\n  display: block;\\n  width: calc(100% - 8px);\\n  height: calc(100% - 8px);\\n  border: 1px solid;\\n  border-color: var(--ag-input-focus-border-color);\\n}\\n\\n.ag-charts-format-top-level-group-title-bar:focus-visible {\\n  outline: none;\\n}\\n.ag-charts-format-top-level-group-title-bar:focus-visible::after {\\n  content: "";\\n  position: absolute;\\n  background-color: transparent;\\n  pointer-events: none;\\n  top: 4px;\\n  left: 4px;\\n  display: block;\\n  width: calc(100% - 8px);\\n  height: calc(100% - 8px);\\n  border: 1px solid;\\n  border-color: var(--ag-input-focus-border-color);\\n}\\n\\n.ag-charts-data-group-title-bar .ag-charts-data-group-title,\\n.ag-charts-format-top-level-group-title-bar .ag-charts-format-top-level-group-title {\\n  cursor: pointer;\\n}\\n\\n.ag-charts-data-group-container {\\n  padding: calc(var(--ag-widget-container-vertical-padding) * 0.5) var(--ag-widget-container-horizontal-padding);\\n}\\n.ag-charts-data-group-container .ag-charts-data-group-item:not(.ag-charts-format-sub-level-group):not(.ag-pill-select):not(.ag-select) {\\n  height: var(--ag-list-item-height);\\n}\\n.ag-charts-data-group-container .ag-charts-data-group-item.ag-picker-field {\\n  margin-top: var(--ag-grid-size);\\n}\\n.ag-charts-data-group-container .ag-list-item-hovered::after {\\n  content: "";\\n  position: absolute;\\n  left: 0;\\n  right: 0;\\n  height: 1px;\\n  background-color: var(--ag-range-selection-border-color);\\n}\\n.ag-charts-data-group-container .ag-item-highlight-top::after {\\n  top: 0;\\n}\\n.ag-charts-data-group-container .ag-item-highlight-bottom::after {\\n  bottom: 0;\\n}\\n\\n.ag-charts-format-top-level-group-container,\\n.ag-charts-advanced-settings-top-level-group-container {\\n  padding: var(--ag-gr';
      S = S + "id-size);\\n}\\n.ag-ltr .ag-charts-format-top-level-group-container,\\n.ag-ltr .ag-charts-advanced-settings-top-level-group-container {\\n  margin-left: calc(var(--ag-grid-size) * 2);\\n}\\n.ag-rtl .ag-charts-format-top-level-group-container,\\n.ag-rtl .ag-charts-advanced-settings-top-level-group-container {\\n  margin-right: calc(var(--ag-grid-size) * 2);\\n}\\n\\n.ag-charts-format-top-level-group-item,\\n.ag-charts-advanced-settings-top-level-group-item {\\n  margin: var(--ag-grid-size) 0;\\n}\\n\\n.ag-charts-format-sub-level-group-container {\\n  padding: var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);\\n  padding-bottom: calc(var(--ag-widget-container-vertical-padding) - var(--ag-widget-vertical-spacing));\\n}\\n.ag-charts-format-sub-level-group-container > * {\\n  margin-bottom: var(--ag-widget-vertical-spacing);\\n}\\n\\n.ag-charts-format-sub-level-no-header-group-container > * {\\n  margin-bottom: var(--ag-widget-vertical-spacing);\\n}\\n\\n.ag-charts-format-sub-level-group-container .ag-charts-format-sub-level-group-item.ag-font-panel-no-header {\\n  margin: 0;\\n}\\n\\n.ag-charts-settings-group-container {\\n  padding: var(--ag-grid-size);\\n  grid-row-gap: 8px;\\n  row-gap: 8px;\\n  display: grid;\\n  grid-template-columns: 60px 1fr 60px 1fr 60px;\\n}\\n.ag-charts-settings-group-container .ag-chart-mini-thumbnail:nth-child(3n+1) {\\n  grid-column: 1;\\n}\\n.ag-charts-settings-group-container .ag-chart-mini-thumbnail:nth-child(3n+2) {\\n  grid-column: 3;\\n}\\n.ag-charts-settings-group-container .ag-chart-mini-thumbnail:nth-child(3n+3) {\\n  grid-column: 5;\\n}\\n\\n.ag-chart-menu-panel {\\n  background-color: var(--ag-control-panel-background-color);\\n}\\n.ag-ltr .ag-chart-menu-panel {\\n  border-left: solid 1px var(--ag-border-color);\\n}\\n.ag-rtl .ag-chart-menu-panel {\\n  border-right: solid 1px var(--ag-border-color);\\n}\\n\\n.ag-charts-theme-default {\\n  --ag-charts-align: none !important;\\n  --ag-charts-justify: none !important;\\n}\\n\\n.ag-date-time-list-page-titl";
      S = S + "e-bar {\\n  display: flex;\\n}\\n\\n.ag-date-time-list-page-title {\\n  flex-grow: 1;\\n  text-align: center;\\n}\\n\\n.ag-date-time-list-page-column-labels-row,\\n.ag-date-time-list-page-entries-row {\\n  display: flex;\\n}\\n\\n.ag-date-time-list-page-column-label,\\n.ag-date-time-list-page-entry {\\n  flex-basis: 0;\\n  flex-grow: 1;\\n}\\n\\n.ag-date-time-list-page-entry {\\n  cursor: pointer;\\n  text-align: center;\\n}\\n\\n.ag-date-time-list-page-column-label {\\n  text-align: center;\\n}\\n\\n.ag-advanced-filter-header {\\n  position: relative;\\n  display: flex;\\n  align-items: center;\\n  padding-left: var(--ag-cell-horizontal-padding);\\n  padding-right: var(--ag-cell-horizontal-padding);\\n}\\n\\n.ag-advanced-filter {\\n  display: flex;\\n  align-items: center;\\n  width: 100%;\\n}\\n\\n.ag-advanced-filter-apply-button,\\n.ag-advanced-filter-builder-button {\\n  line-height: normal;\\n  white-space: nowrap;\\n}\\n.ag-ltr .ag-advanced-filter-apply-button,\\n.ag-ltr .ag-advanced-filter-builder-button {\\n  margin-left: calc(var(--ag-grid-size) * 2);\\n}\\n.ag-rtl .ag-advanced-filter-apply-button,\\n.ag-rtl .ag-advanced-filter-builder-button {\\n  margin-right: calc(var(--ag-grid-size) * 2);\\n}\\n\\n.ag-advanced-filter-builder-button {\\n  display: flex;\\n  align-items: center;\\n  border: 0;\\n  background-color: transparent;\\n  background-color: initial;\\n  color: var(--ag-foreground-color);\\n  font-size: var(--ag-font-size);\\n  font-weight: 600;\\n}\\n.ag-advanced-filter-builder-button:hover:not(:disabled) {\\n  background-color: var(--ag-row-hover-color);\\n}\\n.ag-advanced-filter-builder-button:not(:disabled) {\\n  cursor: pointer;\\n}\\n\\n.ag-advanced-filter-builder-button-label {\\n  margin-left: var(--ag-grid-size);\\n}\\n\\n.ag-advanced-filter-builder {\\n  -moz-user-select: none;\\n  -webkit-user-select: none;\\n  user-select: none;\\n  width: 100%;\\n  background-color: var(--ag-control-panel-background-color);\\n  display: flex;\\n  flex-direction: column;\\n}\\n\\n.ag-advanced-filter-builder-list {\\n  flex: 1;\\n  overflow:";
      S = S + ' auto;\\n}\\n.ag-advanced-filter-builder-list .ag-list-item-hovered::after {\\n  content: "";\\n  position: absolute;\\n  left: 0;\\n  right: 0;\\n  height: 1px;\\n  background-color: var(--ag-range-selection-border-color);\\n}\\n.ag-advanced-filter-builder-list .ag-item-highlight-top::after {\\n  top: 0;\\n}\\n.ag-advanced-filter-builder-list .ag-item-highlight-bottom::after {\\n  bottom: 0;\\n}\\n\\n.ag-advanced-filter-builder-button-panel {\\n  display: flex;\\n  justify-content: flex-end;\\n  padding: var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);\\n  border-top: var(--ag-borders-secondary) var(--ag-secondary-border-color);\\n}\\n\\n.ag-advanced-filter-builder .ag-advanced-filter-builder-button-panel .ag-advanced-filter-builder-apply-button,\\n.ag-advanced-filter-builder .ag-advanced-filter-builder-button-panel .ag-advanced-filter-builder-cancel-button {\\n  margin-left: calc(var(--ag-grid-size) * 2);\\n}\\n\\n.ag-advanced-filter-builder-item-wrapper {\\n  display: flex;\\n  flex: 1 1 auto;\\n  align-items: center;\\n  justify-content: space-between;\\n  overflow: hidden;\\n  padding-left: calc(var(--ag-icon-size) / 2);\\n  padding-right: var(--ag-icon-size);\\n}\\n\\n.ag-virtual-list-viewport .ag-advanced-filter-builder-item-wrapper .ag-tab-guard {\\n  position: absolute;\\n}\\n\\n.ag-advanced-filter-builder-item-tree-lines > * {\\n  width: var(--ag-advanced-filter-builder-indent-size);\\n}\\n\\n.ag-advanced-filter-builder-item-tree-lines .ag-advanced-filter-builder-item-tree-line-root {\\n  width: var(--ag-icon-size);\\n}\\n.ag-advanced-filter-builder-item-tree-lines .ag-advanced-filter-builder-item-tree-line-root::before {\\n  top: 50%;\\n  height: 50%;\\n}\\n\\n.ag-advanced-filter-builder-item-tree-line-horizontal,\\n.ag-advanced-filter-builder-item-tree-line-vertical,\\n.ag-advanced-filter-builder-item-tree-line-vertical-top,\\n.ag-advanced-filter-builder-item-tree-line-vertical-bottom {\\n  position: relative;\\n  height: 100%;\\n  display: flex;\\n  align-items: center;\\n}';
      S = S + '\\n.ag-advanced-filter-builder-item-tree-line-horizontal::before, .ag-advanced-filter-builder-item-tree-line-horizontal::after,\\n.ag-advanced-filter-builder-item-tree-line-vertical::before,\\n.ag-advanced-filter-builder-item-tree-line-vertical::after,\\n.ag-advanced-filter-builder-item-tree-line-vertical-top::before,\\n.ag-advanced-filter-builder-item-tree-line-vertical-top::after,\\n.ag-advanced-filter-builder-item-tree-line-vertical-bottom::before,\\n.ag-advanced-filter-builder-item-tree-line-vertical-bottom::after {\\n  content: "";\\n  position: absolute;\\n  height: 100%;\\n}\\n\\n.ag-advanced-filter-builder-item-tree-line-horizontal::after {\\n  height: 50%;\\n  width: calc(var(--ag-advanced-filter-builder-indent-size) - var(--ag-icon-size));\\n  top: 0;\\n  left: calc(var(--ag-icon-size) / 2);\\n  border-bottom: 1px solid;\\n  border-color: var(--ag-border-color);\\n}\\n\\n.ag-advanced-filter-builder-item-tree-line-vertical::before {\\n  width: calc(var(--ag-advanced-filter-builder-indent-size) - var(--ag-icon-size) / 2);\\n  top: 0;\\n  left: calc(var(--ag-icon-size) / 2);\\n  border-left: 1px solid;\\n  border-color: var(--ag-border-color);\\n}\\n\\n.ag-advanced-filter-builder-item-tree-line-vertical-top::before {\\n  height: 50%;\\n  width: calc(var(--ag-advanced-filter-builder-indent-size) - var(--ag-icon-size) / 2);\\n  top: 0;\\n  left: calc(var(--ag-icon-size) / 2);\\n  border-left: 1px solid;\\n  border-color: var(--ag-border-color);\\n}\\n\\n.ag-advanced-filter-builder-item-tree-line-vertical-bottom::before {\\n  height: calc((100% - 1.5 * var(--ag-icon-size)) / 2);\\n  width: calc(var(--ag-icon-size) / 2);\\n  top: calc((100% + 1.5 * var(--ag-icon-size)) / 2);\\n  left: calc(var(--ag-icon-size) / 2);\\n  border-left: 1px solid;\\n  border-color: var(--ag-border-color);\\n}\\n\\n.ag-advanced-filter-builder-item-condition {\\n  padding-top: var(--ag-grid-size);\\n  padding-bottom: var(--ag-grid-size);\\n}\\n\\n.ag-advanced-filter-builder-item,\\n.ag-advanced-filter-builder-item-condition,\\n.ag-advanced-';
      S = S + 'filter-builder-pill-wrapper,\\n.ag-advanced-filter-builder-pill,\\n.ag-advanced-filter-builder-item-buttons,\\n.ag-advanced-filter-builder-item-tree-lines {\\n  display: flex;\\n  align-items: center;\\n  height: 100%;\\n}\\n\\n.ag-advanced-filter-builder-pill-wrapper {\\n  margin: 0px var(--ag-grid-size);\\n}\\n\\n.ag-advanced-filter-builder-pill {\\n  position: relative;\\n  border-radius: var(--ag-border-radius);\\n  padding: var(--ag-grid-size) calc(var(--ag-grid-size) * 2);\\n  min-height: calc(100% - var(--ag-grid-size) * 3);\\n  min-width: calc(var(--ag-grid-size) * 2);\\n}\\n.ag-advanced-filter-builder-pill .ag-picker-field-display {\\n  margin-right: var(--ag-grid-size);\\n}\\n.ag-advanced-filter-builder-pill .ag-advanced-filter-builder-value-number {\\n  font-family: monospace;\\n  font-weight: 700;\\n}\\n.ag-advanced-filter-builder-pill .ag-advanced-filter-builder-value-empty {\\n  color: var(--ag-disabled-foreground-color);\\n}\\n\\n.ag-advanced-filter-builder-pill:focus-visible {\\n  outline: none;\\n}\\n.ag-advanced-filter-builder-pill:focus-visible::after {\\n  content: "";\\n  position: absolute;\\n  background-color: transparent;\\n  pointer-events: none;\\n  top: -4px;\\n  left: -4px;\\n  display: block;\\n  width: calc(100% - -8px);\\n  height: calc(100% - -8px);\\n  border: 1px solid;\\n  border-color: var(--ag-input-focus-border-color);\\n}\\n\\n.ag-advanced-filter-builder-item-button:focus-visible {\\n  outline: none;\\n}\\n.ag-advanced-filter-builder-item-button:focus-visible::after {\\n  content: "";\\n  position: absolute;\\n  background-color: transparent;\\n  pointer-events: none;\\n  top: -4px;\\n  left: -4px;\\n  display: block;\\n  width: calc(100% - -8px);\\n  height: calc(100% - -8px);\\n  border: 1px solid;\\n  border-color: var(--ag-input-focus-border-color);\\n}\\n\\n.ag-advanced-filter-builder-pill-display {\\n  overflow: hidden;\\n  text-overflow: ellipsis;\\n  white-space: nowrap;\\n  font-weight: 500;\\n}\\n\\n.ag-advanced-filter-builder-join-pill {\\n  color: var(--ag-foreground-color);\\n  backgrou';
      S = S + "nd-color: var(--ag-advanced-filter-join-pill-color);\\n  cursor: pointer;\\n}\\n\\n.ag-advanced-filter-builder-column-pill {\\n  color: var(--ag-foreground-color);\\n  background-color: var(--ag-advanced-filter-column-pill-color);\\n  cursor: pointer;\\n}\\n\\n.ag-advanced-filter-builder-option-pill {\\n  color: var(--ag-foreground-color);\\n  background-color: var(--ag-advanced-filter-option-pill-color);\\n  cursor: pointer;\\n}\\n\\n.ag-advanced-filter-builder-value-pill {\\n  color: var(--ag-foreground-color);\\n  background-color: var(--ag-advanced-filter-value-pill-color);\\n  cursor: text;\\n  max-width: 140px;\\n}\\n.ag-advanced-filter-builder-value-pill .ag-advanced-filter-builder-pill-display {\\n  display: block;\\n}\\n\\n.ag-advanced-filter-builder-item-buttons > * {\\n  margin: 0 calc(var(--ag-grid-size) * 0.5);\\n}\\n\\n.ag-advanced-filter-builder-item-button {\\n  position: relative;\\n  cursor: pointer;\\n  color: var(--ag-secondary-foreground-color);\\n  opacity: 0.5;\\n}\\n\\n.ag-advanced-filter-builder-item-button-disabled {\\n  color: var(--ag-disabled-foreground-color);\\n  cursor: default;\\n}\\n\\n.ag-advanced-filter-builder-virtual-list-container {\\n  top: var(--ag-grid-size);\\n}\\n\\n.ag-advanced-filter-builder-virtual-list-item {\\n  display: flex;\\n  cursor: default;\\n  height: var(--ag-list-item-height);\\n}\\n.ag-advanced-filter-builder-virtual-list-item:hover {\\n  background-color: var(--ag-row-hover-color);\\n}\\n.ag-advanced-filter-builder-virtual-list-item:hover .ag-advanced-filter-builder-item-button {\\n  opacity: 1;\\n}\\n\\n.ag-advanced-filter-builder-virtual-list-item-highlight .ag-advanced-filter-builder-item-button:focus-visible,\\n.ag-advanced-filter-builder-validation .ag-advanced-filter-builder-invalid {\\n  opacity: 1;\\n}\\n\\n.ag-advanced-filter-builder-invalid {\\n  margin: 0 var(--ag-grid-size);\\n  color: var(--ag-invalid-color);\\n  cursor: default;\\n}\\n\\n.ag-input-field-input {\\n  width: 100%;\\n  min-width: 0;\\n}\\n\\n.ag-checkbox-input-wrapper {\\n  font-family: var(--ag-icon-fo";
      S = S + 'nt-family);\\n  font-weight: var(--ag-icon-font-weight);\\n  color: var(--ag-icon-font-color);\\n  font-size: var(--ag-icon-size);\\n  line-height: var(--ag-icon-size);\\n  font-style: normal;\\n  font-feature-settings: normal;\\n  font-variant: normal;\\n  text-transform: none;\\n  -webkit-font-smoothing: antialiased;\\n  -moz-osx-font-smoothing: grayscale;\\n  width: var(--ag-icon-size);\\n  height: var(--ag-icon-size);\\n  background-color: var(--ag-checkbox-background-color);\\n  border-radius: var(--ag-checkbox-border-radius);\\n  display: inline-block;\\n  vertical-align: middle;\\n  flex: none;\\n}\\n.ag-checkbox-input-wrapper input,\\n.ag-checkbox-input-wrapper input {\\n  -webkit-appearance: none;\\n  opacity: 0;\\n  width: 100%;\\n  height: 100%;\\n}\\n.ag-checkbox-input-wrapper:focus-within, .ag-checkbox-input-wrapper:active {\\n  outline: none;\\n  box-shadow: var(--ag-input-focus-box-shadow);\\n}\\n.ag-checkbox-input-wrapper.ag-disabled {\\n  opacity: 0.5;\\n}\\n.ag-checkbox-input-wrapper::after {\\n  content: "\\\\f108";\\n  content: var(--ag-icon-font-code-checkbox-unchecked, "\\\\f108");\\n  font-family: inherit;\\n  color: var(--ag-checkbox-unchecked-color);\\n  display: var(--ag-icon-font-display-checkbox-unchecked, var(--ag-icon-font-display));\\n  position: absolute;\\n  top: 0;\\n  left: 0;\\n  pointer-events: none;\\n}\\n.ag-checkbox-input-wrapper.ag-checked::after {\\n  content: "\\\\f106";\\n  content: var(--ag-icon-font-code-checkbox-checked, "\\\\f106");\\n  color: var(--ag-checkbox-checked-color);\\n  display: var(--ag-icon-font-display-checkbox-checked, var(--ag-icon-font-display));\\n  position: absolute;\\n  top: 0;\\n  left: 0;\\n  pointer-events: none;\\n}\\n.ag-checkbox-input-wrapper.ag-indeterminate::after {\\n  content: "\\\\f107";\\n  content: var(--ag-icon-font-code-checkbox-indeterminate, "\\\\f107");\\n  color: var(--ag-checkbox-indeterminate-color);\\n  display: var(--ag-icon-font-display-checkbox-indeterminate, var(--ag-icon-font-display));\\n  position: absolute;\\n  top: 0;\\n  left: 0;\\n  point';
      S = S + 'er-events: none;\\n}\\n.ag-checkbox-input-wrapper::before {\\n  content: "";\\n  background: transparent center/contain no-repeat;\\n  position: absolute;\\n  top: 0;\\n  right: 0;\\n  bottom: 0;\\n  left: 0;\\n  background-image: var(--ag-icon-image-checkbox-unchecked, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-checkbox-unchecked, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-checkbox-unchecked, var(--ag-icon-image-opacity, 0.9));\\n}\\n.ag-checkbox-input-wrapper.ag-checked::before {\\n  background-image: var(--ag-icon-image-checkbox-checked, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-checkbox-checked, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-checkbox-checked, var(--ag-icon-image-opacity, 0.9));\\n}\\n.ag-checkbox-input-wrapper.ag-indeterminate::before {\\n  background-image: var(--ag-icon-image-checkbox-indeterminate, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-checkbox-indeterminate, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-checkbox-indeterminate, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\n.ag-toggle-button-input-wrapper {\\n  box-sizing: border-box;\\n  width: var(--ag-toggle-button-width);\\n  min-width: var(--ag-toggle-button-width);\\n  max-width: var(--ag-toggle-button-width);\\n  height: var(--ag-toggle-button-height);\\n  background-color: var(--ag-toggle-button-off-background-color);\\n  border-radius: calc(var(--ag-toggle-button-height) * 0.5);\\n  position: relative;\\n  flex: none;\\n  border: var(--ag-toggle-button-border-width) solid;\\n  border-color: var(--ag-toggle-button-off-border-color);\\n}\\n.ag-toggle-button-input-wrapper input {\\n  opacity: 0;\\n  height: 100%;\\n  width: 100%;\\n}\\n.ag-toggle-button-input-wrapper:focus-within {\\n  outline: none;\\n  box-shadow: var(--ag-input-focus-box-shadow);\\n}\\n.ag-toggle-button-input-wrapper.ag-disabled {\\n  opacity: 0.5;\\n}\\n.ag-toggle-button';
      S = S + '-input-wrapper.ag-checked {\\n  background-color: var(--ag-toggle-button-on-background-color);\\n  border-color: var(--ag-toggle-button-on-border-color);\\n}\\n.ag-toggle-button-input-wrapper::before {\\n  content: " ";\\n  position: absolute;\\n  top: calc(0px - var(--ag-toggle-button-border-width));\\n  left: calc(0px - var(--ag-toggle-button-border-width));\\n  display: block;\\n  box-sizing: border-box;\\n  height: var(--ag-toggle-button-height);\\n  width: var(--ag-toggle-button-height);\\n  background-color: var(--ag-toggle-button-switch-background-color);\\n  border-radius: 100%;\\n  transition: left 100ms;\\n  border: var(--ag-toggle-button-border-width) solid;\\n  border-color: var(--ag-toggle-button-switch-border-color);\\n}\\n.ag-toggle-button-input-wrapper.ag-checked::before {\\n  left: calc(100% - var(--ag-toggle-button-height) + var(--ag-toggle-button-border-width));\\n  border-color: var(--ag-toggle-button-on-border-color);\\n}\\n\\n.ag-radio-button-input-wrapper {\\n  font-family: var(--ag-icon-font-family);\\n  font-weight: var(--ag-icon-font-weight);\\n  color: var(--ag-icon-font-color);\\n  font-size: var(--ag-icon-size);\\n  line-height: var(--ag-icon-size);\\n  font-style: normal;\\n  font-feature-settings: normal;\\n  font-variant: normal;\\n  text-transform: none;\\n  -webkit-font-smoothing: antialiased;\\n  -moz-osx-font-smoothing: grayscale;\\n  width: var(--ag-icon-size);\\n  height: var(--ag-icon-size);\\n  background-color: var(--ag-checkbox-background-color);\\n  border-radius: var(--ag-checkbox-border-radius);\\n  display: inline-block;\\n  vertical-align: middle;\\n  flex: none;\\n  border-radius: var(--ag-icon-size);\\n}\\n.ag-radio-button-input-wrapper input,\\n.ag-radio-button-input-wrapper input {\\n  -webkit-appearance: none;\\n  opacity: 0;\\n  width: 100%;\\n  height: 100%;\\n}\\n.ag-radio-button-input-wrapper:focus-within, .ag-radio-button-input-wrapper:active {\\n  outline: none;\\n  box-shadow: var(--ag-input-focus-box-shadow);\\n}\\n.ag-radio-button-input-wrapper.ag-disabled {\\n ';
      S = S + ' opacity: 0.5;\\n}\\n.ag-radio-button-input-wrapper::after {\\n  content: "\\\\f127";\\n  content: var(--ag-icon-font-code-radio-button-off, "\\\\f127");\\n  color: var(--ag-checkbox-unchecked-color);\\n  display: var(--ag-icon-font-display-radio-button-off, var(--ag-icon-font-display));\\n  position: absolute;\\n  top: 0;\\n  left: 0;\\n  pointer-events: none;\\n}\\n.ag-radio-button-input-wrapper.ag-checked::after {\\n  content: "\\\\f128";\\n  content: var(--ag-icon-font-code-radio-button-on, "\\\\f128");\\n  color: var(--ag-checkbox-checked-color);\\n  display: var(--ag-icon-font-display-radio-button-on, var(--ag-icon-font-display));\\n  position: absolute;\\n  top: 0;\\n  left: 0;\\n  pointer-events: none;\\n}\\n.ag-radio-button-input-wrapper::before {\\n  content: "";\\n  background: transparent center/contain no-repeat;\\n  position: absolute;\\n  top: 0;\\n  right: 0;\\n  bottom: 0;\\n  left: 0;\\n  background-image: var(--ag-icon-image-radio-button-off, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-radio-button-off, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-radio-button-off, var(--ag-icon-image-opacity, 0.9));\\n}\\n.ag-radio-button-input-wrapper.ag-checked::before {\\n  background-image: var(--ag-icon-image-radio-button-on, var(--ag-icon-image));\\n  display: var(--ag-icon-image-display-radio-button-on, var(--ag-icon-image-display));\\n  opacity: 0.9;\\n  opacity: var(--ag-icon-image-opacity-radio-button-on, var(--ag-icon-image-opacity, 0.9));\\n}\\n\\ninput[class^=ag-][type=range] {\\n  -webkit-appearance: none;\\n  width: 100%;\\n  height: 100%;\\n  background: none;\\n  overflow: visible;\\n}\\ninput[class^=ag-][type=range]::-webkit-slider-runnable-track {\\n  margin: 0;\\n  padding: 0;\\n  width: 100%;\\n  height: 3px;\\n  background-color: var(--ag-border-color);\\n  border-radius: var(--ag-border-radius);\\n  border-radius: var(--ag-checkbox-border-radius);\\n}\\ninput[class^=ag-][type=range]::-moz-range-track {\\n  margin: 0;\\n  padding: 0;\\n  width: ';
      S = S + "100%;\\n  height: 3px;\\n  background-color: var(--ag-border-color);\\n  border-radius: var(--ag-border-radius);\\n  border-radius: var(--ag-checkbox-border-radius);\\n}\\ninput[class^=ag-][type=range]::-ms-track {\\n  margin: 0;\\n  padding: 0;\\n  width: 100%;\\n  height: 3px;\\n  background-color: var(--ag-border-color);\\n  border-radius: var(--ag-border-radius);\\n  border-radius: var(--ag-checkbox-border-radius);\\n  color: transparent;\\n  width: calc(100% - 2px);\\n}\\ninput[class^=ag-][type=range]::-webkit-slider-thumb {\\n  margin: 0;\\n  padding: 0;\\n  -webkit-appearance: none;\\n  width: var(--ag-icon-size);\\n  height: var(--ag-icon-size);\\n  background-color: var(--ag-background-color);\\n  border: 1px solid;\\n  border-color: var(--ag-checkbox-unchecked-color);\\n  border-radius: var(--ag-icon-size);\\n  transform: translateY(calc(var(--ag-icon-size) * -0.5 + 1.5px));\\n}\\ninput[class^=ag-][type=range]::-ms-thumb {\\n  margin: 0;\\n  padding: 0;\\n  -webkit-appearance: none;\\n  width: var(--ag-icon-size);\\n  height: var(--ag-icon-size);\\n  background-color: var(--ag-background-color);\\n  border: 1px solid;\\n  border-color: var(--ag-checkbox-unchecked-color);\\n  border-radius: var(--ag-icon-size);\\n}\\ninput[class^=ag-][type=range]::-moz-ag-range-thumb {\\n  margin: 0;\\n  padding: 0;\\n  -webkit-appearance: none;\\n  width: var(--ag-icon-size);\\n  height: var(--ag-icon-size);\\n  background-color: var(--ag-background-color);\\n  border: 1px solid;\\n  border-color: var(--ag-checkbox-unchecked-color);\\n  border-radius: var(--ag-icon-size);\\n}\\ninput[class^=ag-][type=range]:focus {\\n  outline: none;\\n}\\ninput[class^=ag-][type=range]:focus::-webkit-slider-thumb {\\n  box-shadow: var(--ag-input-focus-box-shadow);\\n  border-color: var(--ag-checkbox-checked-color);\\n}\\ninput[class^=ag-][type=range]:focus::-ms-thumb {\\n  box-shadow: var(--ag-input-focus-box-shadow);\\n  border-color: var(--ag-checkbox-checked-color);\\n}\\ninput[class^=ag-][type=range]:focus::-moz-ag-range-thumb {\\n  box-shadow: va";
      S = S + 'r(--ag-input-focus-box-shadow);\\n  border-color: var(--ag-checkbox-checked-color);\\n}\\ninput[class^=ag-][type=range]:active::-webkit-slider-runnable-track {\\n  background-color: var(--ag-input-focus-border-color);\\n}\\ninput[class^=ag-][type=range]:active::-moz-ag-range-track {\\n  background-color: var(--ag-input-focus-border-color);\\n}\\ninput[class^=ag-][type=range]:active::-ms-track {\\n  background-color: var(--ag-input-focus-border-color);\\n}\\ninput[class^=ag-][type=range]:disabled {\\n  opacity: 0.5;\\n}\\n\',""]),t.A=d},8483:function(e,t,a){"use strict";var n=a(6758),o=a.n(n),r=a(935),i=a.n(r)()(o());i.push([e.id,\'.ag-theme-alpine,\\n.ag-theme-alpine-dark,\\n.ag-theme-alpine-auto-dark {\\n  --ag-alpine-active-color: #2196f3;\\n  --ag-selected-row-background-color: rgba(33, 150, 243, 0.3);\\n  --ag-row-hover-color: rgba(33, 150, 243, 0.1);\\n  --ag-column-hover-color: rgba(33, 150, 243, 0.1);\\n  --ag-input-focus-border-color: rgba(33, 150, 243, 0.4);\\n  --ag-range-selection-background-color: rgba(33, 150, 243, 0.2);\\n  --ag-range-selection-background-color-2: rgba(33, 150, 243, 0.36);\\n  --ag-range-selection-background-color-3: rgba(33, 150, 243, 0.49);\\n  --ag-range-selection-background-color-4: rgba(33, 150, 243, 0.59);\\n  --ag-background-color: #fff;\\n  --ag-foreground-color: #181d1f;\\n  --ag-border-color: #babfc7;\\n  --ag-secondary-border-color: #dde2eb;\\n  --ag-header-background-color: #f8f8f8;\\n  --ag-tooltip-background-color: #f8f8f8;\\n  --ag-odd-row-background-color: #fcfcfc;\\n  --ag-control-panel-background-color: #f8f8f8;\\n  --ag-subheader-background-color: #fff;\\n  --ag-invalid-color: #e02525;\\n  --ag-checkbox-unchecked-color: #999;\\n  --ag-advanced-filter-join-pill-color: #f08e8d;\\n  --ag-advanced-filter-column-pill-color: #a6e194;\\n  --ag-advanced-filter-option-pill-color: #f3c08b;\\n  --ag-advanced-filter-value-pill-color: #85c0e4;\\n  --ag-checkbox-background-color: var(--ag-background-color);\\n  --ag-checkbox-checked-color: var(--ag-alpine-active-color);\\n  -';
      S = S + '-ag-range-selection-border-color: var(--ag-alpine-active-color);\\n  --ag-secondary-foreground-color: var(--ag-foreground-color);\\n  --ag-input-border-color: var(--ag-border-color);\\n  --ag-input-border-color-invalid: var(--ag-invalid-color);\\n  --ag-input-focus-box-shadow: 0 0 2px 0.1rem var(--ag-input-focus-border-color);\\n  --ag-panel-background-color: var(--ag-header-background-color);\\n  --ag-menu-background-color: var(--ag-header-background-color);\\n  --ag-disabled-foreground-color: rgba(24, 29, 31, 0.5);\\n  --ag-chip-background-color: rgba(24, 29, 31, 0.07);\\n  --ag-input-disabled-border-color: rgba(186, 191, 199, 0.3);\\n  --ag-input-disabled-background-color: rgba(186, 191, 199, 0.15);\\n  --ag-borders: solid 1px;\\n  --ag-border-radius: 3px;\\n  --ag-borders-side-button: none;\\n  --ag-side-button-selected-background-color: transparent;\\n  --ag-header-column-resize-handle-display: block;\\n  --ag-header-column-resize-handle-width: 2px;\\n  --ag-header-column-resize-handle-height: 30%;\\n  --ag-grid-size: 6px;\\n  --ag-icon-size: 16px;\\n  --ag-row-height: calc(var(--ag-grid-size) * 7);\\n  --ag-header-height: calc(var(--ag-grid-size) * 8);\\n  --ag-list-item-height: calc(var(--ag-grid-size) * 4);\\n  --ag-column-select-indent-size: var(--ag-icon-size);\\n  --ag-set-filter-indent-size: var(--ag-icon-size);\\n  --ag-advanced-filter-builder-indent-size: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\\n  --ag-cell-horizontal-padding: calc(var(--ag-grid-size) * 3);\\n  --ag-cell-widget-spacing: calc(var(--ag-grid-size) * 2);\\n  --ag-widget-container-vertical-padding: calc(var(--ag-grid-size) * 2);\\n  --ag-widget-container-horizontal-padding: calc(var(--ag-grid-size) * 2);\\n  --ag-widget-vertical-spacing: calc(var(--ag-grid-size) * 1.5);\\n  --ag-toggle-button-height: 18px;\\n  --ag-toggle-button-width: 28px;\\n  --ag-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell,\\n      "Helvetica Neue", sans-serif;\\n  --ag-font-size: 13px;';
      S = S + "\\n  --ag-icon-font-family: agGridAlpine;\\n  --ag-selected-tab-underline-color: var(--ag-alpine-active-color);\\n  --ag-selected-tab-underline-width: 2px;\\n  --ag-selected-tab-underline-transition-speed: 0.3s;\\n  --ag-tab-min-width: 240px;\\n  --ag-card-shadow: 0 1px 4px 1px rgba(186, 191, 199, 0.4);\\n  --ag-popup-shadow: var(--ag-card-shadow);\\n  --ag-side-bar-panel-width: 250px;\\n}\\n\\n.ag-theme-alpine-dark {\\n  --ag-background-color: #181d1f;\\n  --ag-foreground-color: #fff;\\n  --ag-border-color: #68686e;\\n  --ag-secondary-border-color: rgba(88, 86, 82, 0.5);\\n  --ag-modal-overlay-background-color: rgba(24, 29, 31, 0.66);\\n  --ag-header-background-color: #222628;\\n  --ag-tooltip-background-color: #222628;\\n  --ag-odd-row-background-color: #222628;\\n  --ag-control-panel-background-color: #222628;\\n  --ag-subheader-background-color: #000;\\n  --ag-input-disabled-background-color: #282c2f;\\n  --ag-input-focus-box-shadow: 0 0 2px 0.5px rgba(255, 255, 255, 0.5), 0 0 4px 3px var(--ag-input-focus-border-color);\\n  --ag-card-shadow: 0 1px 20px 1px black;\\n  --ag-disabled-foreground-color: rgba(255, 255, 255, 0.5);\\n  --ag-chip-background-color: rgba(255, 255, 255, 0.07);\\n  --ag-input-disabled-border-color: rgba(104, 104, 110, 0.3);\\n  --ag-input-disabled-background-color: rgba(104, 104, 110, 0.07);\\n  --ag-advanced-filter-join-pill-color: #7a3a37;\\n  --ag-advanced-filter-column-pill-color: #355f2d;\\n  --ag-advanced-filter-option-pill-color: #5a3168;\\n  --ag-advanced-filter-value-pill-color: #374c86;\\n  --ag-row-loading-skeleton-effect-color: rgba(202, 203, 204, 0.4);\\n  --csstools-color-scheme--dark: initial;\\n  color-scheme: dark;\\n}\\n\\n@media (prefers-color-scheme: dark) {\\n  .ag-theme-alpine-auto-dark {\\n    --ag-background-color: #181d1f;\\n    --ag-foreground-color: #fff;\\n    --ag-border-color: #68686e;\\n    --ag-secondary-border-color: rgba(88, 86, 82, 0.5);\\n    --ag-modal-overlay-background-color: rgba(24, 29, 31, 0.66);\\n    --ag-header-background-color: #222628;\\n  ";
      S = S + "  --ag-tooltip-background-color: #222628;\\n    --ag-odd-row-background-color: #222628;\\n    --ag-control-panel-background-color: #222628;\\n    --ag-subheader-background-color: #000;\\n    --ag-input-disabled-background-color: #282c2f;\\n    --ag-input-focus-box-shadow: 0 0 2px 0.5px rgba(255, 255, 255, 0.5), 0 0 4px 3px var(--ag-input-focus-border-color);\\n    --ag-card-shadow: 0 1px 20px 1px black;\\n    --ag-disabled-foreground-color: rgba(255, 255, 255, 0.5);\\n    --ag-chip-background-color: rgba(255, 255, 255, 0.07);\\n    --ag-input-disabled-border-color: rgba(104, 104, 110, 0.3);\\n    --ag-input-disabled-background-color: rgba(104, 104, 110, 0.07);\\n    --ag-advanced-filter-join-pill-color: #7a3a37;\\n    --ag-advanced-filter-column-pill-color: #355f2d;\\n    --ag-advanced-filter-option-pill-color: #5a3168;\\n    --ag-advanced-filter-value-pill-color: #374c86;\\n    --ag-row-loading-skeleton-effect-color: rgba(202, 203, 204, 0.4);\\n    --csstools-color-scheme--dark: initial;\\n    color-scheme: dark;\\n  }\\n}\\n.ag-theme-alpine .ag-filter-toolpanel-header,\\n.ag-theme-alpine .ag-filter-toolpanel-search,\\n.ag-theme-alpine .ag-status-bar,\\n.ag-theme-alpine .ag-header-row,\\n.ag-theme-alpine .ag-panel-title-bar-title,\\n.ag-theme-alpine .ag-multi-filter-group-title-bar,\\n.ag-theme-alpine-dark .ag-filter-toolpanel-header,\\n.ag-theme-alpine-dark .ag-filter-toolpanel-search,\\n.ag-theme-alpine-dark .ag-status-bar,\\n.ag-theme-alpine-dark .ag-header-row,\\n.ag-theme-alpine-dark .ag-panel-title-bar-title,\\n.ag-theme-alpine-dark .ag-multi-filter-group-title-bar,\\n.ag-theme-alpine-auto-dark .ag-filter-toolpanel-header,\\n.ag-theme-alpine-auto-dark .ag-filter-toolpanel-search,\\n.ag-theme-alpine-auto-dark .ag-status-bar,\\n.ag-theme-alpine-auto-dark .ag-header-row,\\n.ag-theme-alpine-auto-dark .ag-panel-title-bar-title,\\n.ag-theme-alpine-auto-dark .ag-multi-filter-group-title-bar {\\n  font-weight: 700;\\n  color: var(--ag-header-foreground-color);\\n}\\n.ag-theme-alpine .ag-row,\\n.ag-theme-alpi";
      S = S + "ne-dark .ag-row,\\n.ag-theme-alpine-auto-dark .ag-row {\\n  font-size: calc(var(--ag-font-size) + 1px);\\n}\\n.ag-theme-alpine input[class^=ag-]:not([type]),\\n.ag-theme-alpine input[class^=ag-][type=text],\\n.ag-theme-alpine input[class^=ag-][type=number],\\n.ag-theme-alpine input[class^=ag-][type=tel],\\n.ag-theme-alpine input[class^=ag-][type=date],\\n.ag-theme-alpine input[class^=ag-][type=datetime-local],\\n.ag-theme-alpine textarea[class^=ag-],\\n.ag-theme-alpine-dark input[class^=ag-]:not([type]),\\n.ag-theme-alpine-dark input[class^=ag-][type=text],\\n.ag-theme-alpine-dark input[class^=ag-][type=number],\\n.ag-theme-alpine-dark input[class^=ag-][type=tel],\\n.ag-theme-alpine-dark input[class^=ag-][type=date],\\n.ag-theme-alpine-dark input[class^=ag-][type=datetime-local],\\n.ag-theme-alpine-dark textarea[class^=ag-],\\n.ag-theme-alpine-auto-dark input[class^=ag-]:not([type]),\\n.ag-theme-alpine-auto-dark input[class^=ag-][type=text],\\n.ag-theme-alpine-auto-dark input[class^=ag-][type=number],\\n.ag-theme-alpine-auto-dark input[class^=ag-][type=tel],\\n.ag-theme-alpine-auto-dark input[class^=ag-][type=date],\\n.ag-theme-alpine-auto-dark input[class^=ag-][type=datetime-local],\\n.ag-theme-alpine-auto-dark textarea[class^=ag-] {\\n  min-height: calc(var(--ag-grid-size) * 4);\\n  border-radius: var(--ag-border-radius);\\n}\\n.ag-theme-alpine .ag-ltr input[class^=ag-]:not([type]), .ag-theme-alpine .ag-ltr input[class^=ag-][type=text], .ag-theme-alpine .ag-ltr input[class^=ag-][type=number], .ag-theme-alpine .ag-ltr input[class^=ag-][type=tel], .ag-theme-alpine .ag-ltr input[class^=ag-][type=date], .ag-theme-alpine .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-alpine .ag-ltr textarea[class^=ag-], .ag-theme-alpine-dark .ag-ltr input[class^=ag-]:not([type]), .ag-theme-alpine-dark .ag-ltr input[class^=ag-][type=text], .ag-theme-alpine-dark .ag-ltr input[class^=ag-][type=number], .ag-theme-alpine-dark .ag-ltr input[class^=ag-][type=tel], .ag-theme-alpine-dark .ag-ltr input[class^=ag";
      S = S + "-][type=date], .ag-theme-alpine-dark .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-alpine-dark .ag-ltr textarea[class^=ag-], .ag-theme-alpine-auto-dark .ag-ltr input[class^=ag-]:not([type]), .ag-theme-alpine-auto-dark .ag-ltr input[class^=ag-][type=text], .ag-theme-alpine-auto-dark .ag-ltr input[class^=ag-][type=number], .ag-theme-alpine-auto-dark .ag-ltr input[class^=ag-][type=tel], .ag-theme-alpine-auto-dark .ag-ltr input[class^=ag-][type=date], .ag-theme-alpine-auto-dark .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-alpine-auto-dark .ag-ltr textarea[class^=ag-] {\\n  padding-left: var(--ag-grid-size);\\n}\\n\\n.ag-theme-alpine .ag-rtl input[class^=ag-]:not([type]), .ag-theme-alpine .ag-rtl input[class^=ag-][type=text], .ag-theme-alpine .ag-rtl input[class^=ag-][type=number], .ag-theme-alpine .ag-rtl input[class^=ag-][type=tel], .ag-theme-alpine .ag-rtl input[class^=ag-][type=date], .ag-theme-alpine .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-alpine .ag-rtl textarea[class^=ag-], .ag-theme-alpine-dark .ag-rtl input[class^=ag-]:not([type]), .ag-theme-alpine-dark .ag-rtl input[class^=ag-][type=text], .ag-theme-alpine-dark .ag-rtl input[class^=ag-][type=number], .ag-theme-alpine-dark .ag-rtl input[class^=ag-][type=tel], .ag-theme-alpine-dark .ag-rtl input[class^=ag-][type=date], .ag-theme-alpine-dark .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-alpine-dark .ag-rtl textarea[class^=ag-], .ag-theme-alpine-auto-dark .ag-rtl input[class^=ag-]:not([type]), .ag-theme-alpine-auto-dark .ag-rtl input[class^=ag-][type=text], .ag-theme-alpine-auto-dark .ag-rtl input[class^=ag-][type=number], .ag-theme-alpine-auto-dark .ag-rtl input[class^=ag-][type=tel], .ag-theme-alpine-auto-dark .ag-rtl input[class^=ag-][type=date], .ag-theme-alpine-auto-dark .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-alpine-auto-dark .ag-rtl textarea[class^=ag-] {\\n  padding-right: var(--ag-grid-size);\\n}\\n\\n.ag-theme-alpine .ag-tab,\\n.ag-theme-alpi";
      S = S + "ne-dark .ag-tab,\\n.ag-theme-alpine-auto-dark .ag-tab {\\n  padding: calc(var(--ag-grid-size) * 1.5);\\n  transition: color 0.4s;\\n  flex: 1 1 auto;\\n}\\n.ag-theme-alpine .ag-tab-selected,\\n.ag-theme-alpine-dark .ag-tab-selected,\\n.ag-theme-alpine-auto-dark .ag-tab-selected {\\n  color: var(--ag-alpine-active-color);\\n}\\n.ag-theme-alpine .ag-menu,\\n.ag-theme-alpine-dark .ag-menu,\\n.ag-theme-alpine-auto-dark .ag-menu {\\n  background-color: var(--ag-control-panel-background-color);\\n}\\n.ag-theme-alpine .ag-panel-content-wrapper .ag-column-select,\\n.ag-theme-alpine-dark .ag-panel-content-wrapper .ag-column-select,\\n.ag-theme-alpine-auto-dark .ag-panel-content-wrapper .ag-column-select {\\n  background-color: var(--ag-control-panel-background-color);\\n}\\n.ag-theme-alpine .ag-menu-header,\\n.ag-theme-alpine-dark .ag-menu-header,\\n.ag-theme-alpine-auto-dark .ag-menu-header {\\n  background-color: var(--ag-control-panel-background-color);\\n  padding-top: 1px;\\n}\\n.ag-theme-alpine .ag-tabs-header,\\n.ag-theme-alpine-dark .ag-tabs-header,\\n.ag-theme-alpine-auto-dark .ag-tabs-header {\\n  border-bottom: var(--ag-borders) var(--ag-border-color);\\n}\\n.ag-theme-alpine .ag-charts-settings-group-title-bar,\\n.ag-theme-alpine .ag-charts-data-group-title-bar,\\n.ag-theme-alpine .ag-charts-format-top-level-group-title-bar,\\n.ag-theme-alpine .ag-charts-advanced-settings-top-level-group-title-bar,\\n.ag-theme-alpine-dark .ag-charts-settings-group-title-bar,\\n.ag-theme-alpine-dark .ag-charts-data-group-title-bar,\\n.ag-theme-alpine-dark .ag-charts-format-top-level-group-title-bar,\\n.ag-theme-alpine-dark .ag-charts-advanced-settings-top-level-group-title-bar,\\n.ag-theme-alpine-auto-dark .ag-charts-settings-group-title-bar,\\n.ag-theme-alpine-auto-dark .ag-charts-data-group-title-bar,\\n.ag-theme-alpine-auto-dark .ag-charts-format-top-level-group-title-bar,\\n.ag-theme-alpine-auto-dark .ag-charts-advanced-settings-top-level-group-title-bar {\\n  padding: var(--ag-grid-size) calc(var(--ag-grid-size) * 2);\\n";
      S = S + "  line-height: calc(var(--ag-icon-size) + var(--ag-grid-size) - 2px);\\n}\\n.ag-theme-alpine .ag-chart-mini-thumbnail,\\n.ag-theme-alpine-dark .ag-chart-mini-thumbnail,\\n.ag-theme-alpine-auto-dark .ag-chart-mini-thumbnail {\\n  background-color: var(--ag-background-color);\\n}\\n.ag-theme-alpine .ag-chart-settings-nav-bar,\\n.ag-theme-alpine-dark .ag-chart-settings-nav-bar,\\n.ag-theme-alpine-auto-dark .ag-chart-settings-nav-bar {\\n  border-top: var(--ag-borders-secondary) var(--ag-secondary-border-color);\\n}\\n.ag-theme-alpine .ag-ltr .ag-group-title-bar-icon, .ag-theme-alpine-dark .ag-ltr .ag-group-title-bar-icon, .ag-theme-alpine-auto-dark .ag-ltr .ag-group-title-bar-icon {\\n  margin-right: var(--ag-grid-size);\\n}\\n\\n.ag-theme-alpine .ag-rtl .ag-group-title-bar-icon, .ag-theme-alpine-dark .ag-rtl .ag-group-title-bar-icon, .ag-theme-alpine-auto-dark .ag-rtl .ag-group-title-bar-icon {\\n  margin-left: var(--ag-grid-size);\\n}\\n\\n.ag-theme-alpine .ag-charts-format-top-level-group-toolbar,\\n.ag-theme-alpine .ag-charts-advanced-settings-top-level-group-toolbar,\\n.ag-theme-alpine-dark .ag-charts-format-top-level-group-toolbar,\\n.ag-theme-alpine-dark .ag-charts-advanced-settings-top-level-group-toolbar,\\n.ag-theme-alpine-auto-dark .ag-charts-format-top-level-group-toolbar,\\n.ag-theme-alpine-auto-dark .ag-charts-advanced-settings-top-level-group-toolbar {\\n  margin-top: var(--ag-grid-size);\\n}\\n.ag-theme-alpine .ag-ltr .ag-charts-format-top-level-group-toolbar, .ag-theme-alpine .ag-ltr .ag-charts-advanced-settings-top-level-group-toolbar, .ag-theme-alpine-dark .ag-ltr .ag-charts-format-top-level-group-toolbar, .ag-theme-alpine-dark .ag-ltr .ag-charts-advanced-settings-top-level-group-toolbar, .ag-theme-alpine-auto-dark .ag-ltr .ag-charts-format-top-level-group-toolbar, .ag-theme-alpine-auto-dark .ag-ltr .ag-charts-advanced-settings-top-level-group-toolbar {\\n  padding-left: calc(var(--ag-icon-size) * 0.5 + var(--ag-grid-size) * 2);\\n}\\n\\n.ag-theme-alpine .ag-rtl .ag-charts-format-t";
      S = S + "op-level-group-toolbar, .ag-theme-alpine .ag-rtl .ag-charts-advanced-settings-top-level-group-toolbar, .ag-theme-alpine-dark .ag-rtl .ag-charts-format-top-level-group-toolbar, .ag-theme-alpine-dark .ag-rtl .ag-charts-advanced-settings-top-level-group-toolbar, .ag-theme-alpine-auto-dark .ag-rtl .ag-charts-format-top-level-group-toolbar, .ag-theme-alpine-auto-dark .ag-rtl .ag-charts-advanced-settings-top-level-group-toolbar {\\n  padding-right: calc(var(--ag-icon-size) * 0.5 + var(--ag-grid-size) * 2);\\n}\\n\\n.ag-theme-alpine .ag-charts-format-sub-level-group,\\n.ag-theme-alpine-dark .ag-charts-format-sub-level-group,\\n.ag-theme-alpine-auto-dark .ag-charts-format-sub-level-group {\\n  border-left: dashed 1px;\\n  border-left-color: var(--ag-border-color);\\n  padding-left: var(--ag-grid-size);\\n  margin-bottom: calc(var(--ag-grid-size) * 2);\\n}\\n.ag-theme-alpine .ag-charts-format-sub-level-group-title-bar,\\n.ag-theme-alpine-dark .ag-charts-format-sub-level-group-title-bar,\\n.ag-theme-alpine-auto-dark .ag-charts-format-sub-level-group-title-bar {\\n  padding-top: 0;\\n  padding-bottom: 0;\\n  background: none;\\n  font-weight: 700;\\n}\\n.ag-theme-alpine .ag-charts-format-sub-level-group-container,\\n.ag-theme-alpine-dark .ag-charts-format-sub-level-group-container,\\n.ag-theme-alpine-auto-dark .ag-charts-format-sub-level-group-container {\\n  padding-bottom: 0;\\n}\\n.ag-theme-alpine .ag-charts-format-sub-level-group-item:last-child,\\n.ag-theme-alpine-dark .ag-charts-format-sub-level-group-item:last-child,\\n.ag-theme-alpine-auto-dark .ag-charts-format-sub-level-group-item:last-child {\\n  margin-bottom: 0;\\n}\\n.ag-theme-alpine.ag-dnd-ghost,\\n.ag-theme-alpine-dark.ag-dnd-ghost,\\n.ag-theme-alpine-auto-dark.ag-dnd-ghost {\\n  font-size: calc(var(--ag-font-size) - 1px);\\n  font-weight: 700;\\n}\\n.ag-theme-alpine .ag-side-buttons,\\n.ag-theme-alpine-dark .ag-side-buttons,\\n.ag-theme-alpine-auto-dark .ag-side-buttons {\\n  width: calc(var(--ag-grid-size) * 5);\\n}\\n.ag-theme-alpine .ag-standard-b";
      S = S + "utton,\\n.ag-theme-alpine-dark .ag-standard-button,\\n.ag-theme-alpine-auto-dark .ag-standard-button {\\n  font-family: inherit;\\n  -moz-appearance: none;\\n       appearance: none;\\n  -webkit-appearance: none;\\n  border-radius: var(--ag-border-radius);\\n  border: 1px solid;\\n  border-color: var(--ag-alpine-active-color);\\n  color: var(--ag-alpine-active-color);\\n  background-color: var(--ag-background-color);\\n  font-weight: 600;\\n  padding: var(--ag-grid-size) calc(var(--ag-grid-size) * 2);\\n}\\n.ag-theme-alpine .ag-standard-button:hover,\\n.ag-theme-alpine-dark .ag-standard-button:hover,\\n.ag-theme-alpine-auto-dark .ag-standard-button:hover {\\n  border-color: var(--ag-alpine-active-color);\\n  background-color: var(--ag-row-hover-color);\\n}\\n.ag-theme-alpine .ag-standard-button:active,\\n.ag-theme-alpine-dark .ag-standard-button:active,\\n.ag-theme-alpine-auto-dark .ag-standard-button:active {\\n  border-color: var(--ag-alpine-active-color);\\n  background-color: var(--ag-alpine-active-color);\\n  color: var(--ag-background-color);\\n}\\n.ag-theme-alpine .ag-standard-button:disabled,\\n.ag-theme-alpine-dark .ag-standard-button:disabled,\\n.ag-theme-alpine-auto-dark .ag-standard-button:disabled {\\n  color: var(--ag-disabled-foreground-color);\\n  background-color: var(--ag-input-disabled-background-color);\\n  border-color: var(--ag-input-disabled-border-color);\\n}\\n.ag-theme-alpine .ag-column-drop-vertical,\\n.ag-theme-alpine-dark .ag-column-drop-vertical,\\n.ag-theme-alpine-auto-dark .ag-column-drop-vertical {\\n  min-height: 75px;\\n}\\n.ag-theme-alpine .ag-column-drop-vertical-title-bar,\\n.ag-theme-alpine-dark .ag-column-drop-vertical-title-bar,\\n.ag-theme-alpine-auto-dark .ag-column-drop-vertical-title-bar {\\n  padding: calc(var(--ag-grid-size) * 2);\\n  padding-bottom: 0px;\\n}\\n.ag-theme-alpine .ag-column-drop-vertical-empty-message,\\n.ag-theme-alpine-dark .ag-column-drop-vertical-empty-message,\\n.ag-theme-alpine-auto-dark .ag-column-drop-vertical-empty-message {\\n  display: flex;\\";
      S = S + "n  align-items: center;\\n  border: dashed 1px;\\n  border-color: var(--ag-border-color);\\n  margin: calc(var(--ag-grid-size) * 2);\\n  padding: calc(var(--ag-grid-size) * 2);\\n}\\n.ag-theme-alpine .ag-column-drop-empty-message,\\n.ag-theme-alpine-dark .ag-column-drop-empty-message,\\n.ag-theme-alpine-auto-dark .ag-column-drop-empty-message {\\n  color: var(--ag-foreground-color);\\n  opacity: 0.75;\\n}\\n.ag-theme-alpine .ag-pill-select .ag-column-drop,\\n.ag-theme-alpine-dark .ag-pill-select .ag-column-drop,\\n.ag-theme-alpine-auto-dark .ag-pill-select .ag-column-drop {\\n  min-height: 0;\\n  min-height: initial;\\n}\\n.ag-theme-alpine .ag-status-bar,\\n.ag-theme-alpine-dark .ag-status-bar,\\n.ag-theme-alpine-auto-dark .ag-status-bar {\\n  font-weight: normal;\\n}\\n.ag-theme-alpine .ag-status-name-value-value,\\n.ag-theme-alpine-dark .ag-status-name-value-value,\\n.ag-theme-alpine-auto-dark .ag-status-name-value-value {\\n  font-weight: 700;\\n}\\n.ag-theme-alpine .ag-paging-number,\\n.ag-theme-alpine .ag-paging-row-summary-panel-number,\\n.ag-theme-alpine-dark .ag-paging-number,\\n.ag-theme-alpine-dark .ag-paging-row-summary-panel-number,\\n.ag-theme-alpine-auto-dark .ag-paging-number,\\n.ag-theme-alpine-auto-dark .ag-paging-row-summary-panel-number {\\n  font-weight: 700;\\n}\\n.ag-theme-alpine .ag-column-drop-cell-button,\\n.ag-theme-alpine-dark .ag-column-drop-cell-button,\\n.ag-theme-alpine-auto-dark .ag-column-drop-cell-button {\\n  opacity: 0.5;\\n}\\n.ag-theme-alpine .ag-column-drop-cell-button:hover,\\n.ag-theme-alpine-dark .ag-column-drop-cell-button:hover,\\n.ag-theme-alpine-auto-dark .ag-column-drop-cell-button:hover {\\n  opacity: 0.75;\\n}\\n.ag-theme-alpine .ag-column-select-column-readonly.ag-icon-grip,\\n.ag-theme-alpine .ag-column-select-column-readonly .ag-icon-grip,\\n.ag-theme-alpine-dark .ag-column-select-column-readonly.ag-icon-grip,\\n.ag-theme-alpine-dark .ag-column-select-column-readonly .ag-icon-grip,\\n.ag-theme-alpine-auto-dark .ag-column-select-column-readonly.ag-icon-grip,\\n.ag-t";
      S = S + "heme-alpine-auto-dark .ag-column-select-column-readonly .ag-icon-grip {\\n  opacity: 0.35;\\n}\\n.ag-theme-alpine .ag-header-cell-menu-button:hover,\\n.ag-theme-alpine .ag-header-cell-filter-button:hover,\\n.ag-theme-alpine .ag-side-button-button:hover,\\n.ag-theme-alpine .ag-tab:hover,\\n.ag-theme-alpine .ag-panel-title-bar-button:hover,\\n.ag-theme-alpine .ag-header-expand-icon:hover,\\n.ag-theme-alpine .ag-column-group-icons:hover,\\n.ag-theme-alpine .ag-set-filter-group-icons:hover,\\n.ag-theme-alpine .ag-group-expanded .ag-icon:hover,\\n.ag-theme-alpine .ag-group-contracted .ag-icon:hover,\\n.ag-theme-alpine .ag-chart-settings-prev:hover,\\n.ag-theme-alpine .ag-chart-settings-next:hover,\\n.ag-theme-alpine .ag-group-title-bar-icon:hover,\\n.ag-theme-alpine .ag-column-select-header-icon:hover,\\n.ag-theme-alpine .ag-floating-filter-button-button:hover,\\n.ag-theme-alpine .ag-filter-toolpanel-expand:hover,\\n.ag-theme-alpine .ag-chart-menu-icon:hover,\\n.ag-theme-alpine-dark .ag-header-cell-menu-button:hover,\\n.ag-theme-alpine-dark .ag-header-cell-filter-button:hover,\\n.ag-theme-alpine-dark .ag-side-button-button:hover,\\n.ag-theme-alpine-dark .ag-tab:hover,\\n.ag-theme-alpine-dark .ag-panel-title-bar-button:hover,\\n.ag-theme-alpine-dark .ag-header-expand-icon:hover,\\n.ag-theme-alpine-dark .ag-column-group-icons:hover,\\n.ag-theme-alpine-dark .ag-set-filter-group-icons:hover,\\n.ag-theme-alpine-dark .ag-group-expanded .ag-icon:hover,\\n.ag-theme-alpine-dark .ag-group-contracted .ag-icon:hover,\\n.ag-theme-alpine-dark .ag-chart-settings-prev:hover,\\n.ag-theme-alpine-dark .ag-chart-settings-next:hover,\\n.ag-theme-alpine-dark .ag-group-title-bar-icon:hover,\\n.ag-theme-alpine-dark .ag-column-select-header-icon:hover,\\n.ag-theme-alpine-dark .ag-floating-filter-button-button:hover,\\n.ag-theme-alpine-dark .ag-filter-toolpanel-expand:hover,\\n.ag-theme-alpine-dark .ag-chart-menu-icon:hover,\\n.ag-theme-alpine-auto-dark .ag-header-cell-menu-button:hover,\\n.ag-theme-alpine-auto-dark .ag-header-cell-f";
      S = S + "ilter-button:hover,\\n.ag-theme-alpine-auto-dark .ag-side-button-button:hover,\\n.ag-theme-alpine-auto-dark .ag-tab:hover,\\n.ag-theme-alpine-auto-dark .ag-panel-title-bar-button:hover,\\n.ag-theme-alpine-auto-dark .ag-header-expand-icon:hover,\\n.ag-theme-alpine-auto-dark .ag-column-group-icons:hover,\\n.ag-theme-alpine-auto-dark .ag-set-filter-group-icons:hover,\\n.ag-theme-alpine-auto-dark .ag-group-expanded .ag-icon:hover,\\n.ag-theme-alpine-auto-dark .ag-group-contracted .ag-icon:hover,\\n.ag-theme-alpine-auto-dark .ag-chart-settings-prev:hover,\\n.ag-theme-alpine-auto-dark .ag-chart-settings-next:hover,\\n.ag-theme-alpine-auto-dark .ag-group-title-bar-icon:hover,\\n.ag-theme-alpine-auto-dark .ag-column-select-header-icon:hover,\\n.ag-theme-alpine-auto-dark .ag-floating-filter-button-button:hover,\\n.ag-theme-alpine-auto-dark .ag-filter-toolpanel-expand:hover,\\n.ag-theme-alpine-auto-dark .ag-chart-menu-icon:hover {\\n  color: var(--ag-alpine-active-color);\\n}\\n.ag-theme-alpine .ag-header-cell-menu-button:hover .ag-icon,\\n.ag-theme-alpine .ag-header-cell-filter-button:hover .ag-icon,\\n.ag-theme-alpine .ag-side-button-button:hover .ag-icon,\\n.ag-theme-alpine .ag-panel-title-bar-button:hover .ag-icon,\\n.ag-theme-alpine .ag-floating-filter-button-button:hover .ag-icon,\\n.ag-theme-alpine-dark .ag-header-cell-menu-button:hover .ag-icon,\\n.ag-theme-alpine-dark .ag-header-cell-filter-button:hover .ag-icon,\\n.ag-theme-alpine-dark .ag-side-button-button:hover .ag-icon,\\n.ag-theme-alpine-dark .ag-panel-title-bar-button:hover .ag-icon,\\n.ag-theme-alpine-dark .ag-floating-filter-button-button:hover .ag-icon,\\n.ag-theme-alpine-auto-dark .ag-header-cell-menu-button:hover .ag-icon,\\n.ag-theme-alpine-auto-dark .ag-header-cell-filter-button:hover .ag-icon,\\n.ag-theme-alpine-auto-dark .ag-side-button-button:hover .ag-icon,\\n.ag-theme-alpine-auto-dark .ag-panel-title-bar-button:hover .ag-icon,\\n.ag-theme-alpine-auto-dark .ag-floating-filter-button-button:hover .ag-icon {\\n  color: inherit;\\n}\\n.";
      S = S + "ag-theme-alpine .ag-filter-active .ag-icon-filter,\\n.ag-theme-alpine-dark .ag-filter-active .ag-icon-filter,\\n.ag-theme-alpine-auto-dark .ag-filter-active .ag-icon-filter {\\n  color: var(--ag-alpine-active-color);\\n}\\n.ag-theme-alpine .ag-chart-settings-card-item.ag-not-selected:hover,\\n.ag-theme-alpine-dark .ag-chart-settings-card-item.ag-not-selected:hover,\\n.ag-theme-alpine-auto-dark .ag-chart-settings-card-item.ag-not-selected:hover {\\n  opacity: 0.35;\\n}\\n.ag-theme-alpine .ag-ltr .ag-panel-title-bar-button, .ag-theme-alpine-dark .ag-ltr .ag-panel-title-bar-button, .ag-theme-alpine-auto-dark .ag-ltr .ag-panel-title-bar-button {\\n  margin-left: calc(var(--ag-grid-size) * 2);\\n  margin-right: var(--ag-grid-size);\\n}\\n\\n.ag-theme-alpine .ag-rtl .ag-panel-title-bar-button, .ag-theme-alpine-dark .ag-rtl .ag-panel-title-bar-button, .ag-theme-alpine-auto-dark .ag-rtl .ag-panel-title-bar-button {\\n  margin-right: calc(var(--ag-grid-size) * 2);\\n  margin-left: var(--ag-grid-size);\\n}\\n\\n.ag-theme-alpine .ag-ltr .ag-filter-toolpanel-group-container, .ag-theme-alpine-dark .ag-ltr .ag-filter-toolpanel-group-container, .ag-theme-alpine-auto-dark .ag-ltr .ag-filter-toolpanel-group-container {\\n  padding-left: var(--ag-grid-size);\\n}\\n\\n.ag-theme-alpine .ag-rtl .ag-filter-toolpanel-group-container, .ag-theme-alpine-dark .ag-rtl .ag-filter-toolpanel-group-container, .ag-theme-alpine-auto-dark .ag-rtl .ag-filter-toolpanel-group-container {\\n  padding-right: var(--ag-grid-size);\\n}\\n\\n.ag-theme-alpine .ag-filter-toolpanel-instance-filter,\\n.ag-theme-alpine-dark .ag-filter-toolpanel-instance-filter,\\n.ag-theme-alpine-auto-dark .ag-filter-toolpanel-instance-filter {\\n  border: none;\\n  background-color: var(--ag-control-panel-background-color);\\n}\\n.ag-theme-alpine .ag-ltr .ag-filter-toolpanel-instance-filter, .ag-theme-alpine-dark .ag-ltr .ag-filter-toolpanel-instance-filter, .ag-theme-alpine-auto-dark .ag-ltr .ag-filter-toolpanel-instance-filter {\\n  border-left: dashed 1px;\\n  b";
      S = S + "order-left-color: var(--ag-border-color);\\n  margin-left: calc(var(--ag-icon-size) * 0.5);\\n}\\n\\n.ag-theme-alpine .ag-rtl .ag-filter-toolpanel-instance-filter, .ag-theme-alpine-dark .ag-rtl .ag-filter-toolpanel-instance-filter, .ag-theme-alpine-auto-dark .ag-rtl .ag-filter-toolpanel-instance-filter {\\n  border-right: dashed 1px;\\n  border-right-color: var(--ag-border-color);\\n  margin-right: calc(var(--ag-icon-size) * 0.5);\\n}\\n\\n.ag-theme-alpine .ag-set-filter-list,\\n.ag-theme-alpine-dark .ag-set-filter-list,\\n.ag-theme-alpine-auto-dark .ag-set-filter-list {\\n  padding-top: calc(var(--ag-grid-size) * 0.5);\\n  padding-bottom: calc(var(--ag-grid-size) * 0.5);\\n}\\n.ag-theme-alpine .ag-layout-auto-height .ag-center-cols-viewport,\\n.ag-theme-alpine .ag-layout-auto-height .ag-center-cols-container,\\n.ag-theme-alpine .ag-layout-print .ag-center-cols-viewport,\\n.ag-theme-alpine .ag-layout-print .ag-center-cols-container,\\n.ag-theme-alpine-dark .ag-layout-auto-height .ag-center-cols-viewport,\\n.ag-theme-alpine-dark .ag-layout-auto-height .ag-center-cols-container,\\n.ag-theme-alpine-dark .ag-layout-print .ag-center-cols-viewport,\\n.ag-theme-alpine-dark .ag-layout-print .ag-center-cols-container,\\n.ag-theme-alpine-auto-dark .ag-layout-auto-height .ag-center-cols-viewport,\\n.ag-theme-alpine-auto-dark .ag-layout-auto-height .ag-center-cols-container,\\n.ag-theme-alpine-auto-dark .ag-layout-print .ag-center-cols-viewport,\\n.ag-theme-alpine-auto-dark .ag-layout-print .ag-center-cols-container {\\n  min-height: 150px;\\n}\\n.ag-theme-alpine .ag-overlay-no-rows-wrapper.ag-layout-auto-height,\\n.ag-theme-alpine-dark .ag-overlay-no-rows-wrapper.ag-layout-auto-height,\\n.ag-theme-alpine-auto-dark .ag-overlay-no-rows-wrapper.ag-layout-auto-height {\\n  padding-top: 60px;\\n}\\n.ag-theme-alpine .ag-date-time-list-page-entry-is-current,\\n.ag-theme-alpine-dark .ag-date-time-list-page-entry-is-current,\\n.ag-theme-alpine-auto-dark .ag-date-time-list-page-entry-is-current {\\n  background-color: var(-";
      S = S + '-ag-alpine-active-color);\\n}\\n.ag-theme-alpine .ag-advanced-filter-builder-button,\\n.ag-theme-alpine-dark .ag-advanced-filter-builder-button,\\n.ag-theme-alpine-auto-dark .ag-advanced-filter-builder-button {\\n  padding: var(--ag-grid-size);\\n  font-weight: 600;\\n}\\n\',""]),t.A=i},7521:function(e,t,a){"use strict";var n=a(6758),o=a.n(n),r=a(935),i=a.n(r),s=a(62),l=a.n(s),c=new URL(a(8430),a.b),g=i()(o()),d=l()(c);g.push([e.id,\'@font-face {\\n  font-family: "agGridAlpine";\\n  src: url(\'+d+\');\\n  font-weight: normal;\\n  font-style: normal;\\n}\\n.ag-theme-alpine,\\n.ag-theme-alpine-dark,\\n.ag-theme-alpine-auto-dark {\\n  --ag-alpine-active-color: #2196f3;\\n  --ag-selected-row-background-color: rgba(33, 150, 243, 0.3);\\n  --ag-row-hover-color: rgba(33, 150, 243, 0.1);\\n  --ag-column-hover-color: rgba(33, 150, 243, 0.1);\\n  --ag-input-focus-border-color: rgba(33, 150, 243, 0.4);\\n  --ag-range-selection-background-color: rgba(33, 150, 243, 0.2);\\n  --ag-range-selection-background-color-2: rgba(33, 150, 243, 0.36);\\n  --ag-range-selection-background-color-3: rgba(33, 150, 243, 0.49);\\n  --ag-range-selection-background-color-4: rgba(33, 150, 243, 0.59);\\n  --ag-background-color: #fff;\\n  --ag-foreground-color: #181d1f;\\n  --ag-border-color: #babfc7;\\n  --ag-secondary-border-color: #dde2eb;\\n  --ag-header-background-color: #f8f8f8;\\n  --ag-tooltip-background-color: #f8f8f8;\\n  --ag-odd-row-background-color: #fcfcfc;\\n  --ag-control-panel-background-color: #f8f8f8;\\n  --ag-subheader-background-color: #fff;\\n  --ag-invalid-color: #e02525;\\n  --ag-checkbox-unchecked-color: #999;\\n  --ag-advanced-filter-join-pill-color: #f08e8d;\\n  --ag-advanced-filter-column-pill-color: #a6e194;\\n  --ag-advanced-filter-option-pill-color: #f3c08b;\\n  --ag-advanced-filter-value-pill-color: #85c0e4;\\n  --ag-checkbox-background-color: var(--ag-background-color);\\n  --ag-checkbox-checked-color: var(--ag-alpine-active-color);\\n  --ag-range-selection-border-color: var(--ag-alpine-active-color);\\n  --ag-secon';
      S = S + 'dary-foreground-color: var(--ag-foreground-color);\\n  --ag-input-border-color: var(--ag-border-color);\\n  --ag-input-border-color-invalid: var(--ag-invalid-color);\\n  --ag-input-focus-box-shadow: 0 0 2px 0.1rem var(--ag-input-focus-border-color);\\n  --ag-panel-background-color: var(--ag-header-background-color);\\n  --ag-menu-background-color: var(--ag-header-background-color);\\n  --ag-disabled-foreground-color: rgba(24, 29, 31, 0.5);\\n  --ag-chip-background-color: rgba(24, 29, 31, 0.07);\\n  --ag-input-disabled-border-color: rgba(186, 191, 199, 0.3);\\n  --ag-input-disabled-background-color: rgba(186, 191, 199, 0.15);\\n  --ag-borders: solid 1px;\\n  --ag-border-radius: 3px;\\n  --ag-borders-side-button: none;\\n  --ag-side-button-selected-background-color: transparent;\\n  --ag-header-column-resize-handle-display: block;\\n  --ag-header-column-resize-handle-width: 2px;\\n  --ag-header-column-resize-handle-height: 30%;\\n  --ag-grid-size: 6px;\\n  --ag-icon-size: 16px;\\n  --ag-row-height: calc(var(--ag-grid-size) * 7);\\n  --ag-header-height: calc(var(--ag-grid-size) * 8);\\n  --ag-list-item-height: calc(var(--ag-grid-size) * 4);\\n  --ag-column-select-indent-size: var(--ag-icon-size);\\n  --ag-set-filter-indent-size: var(--ag-icon-size);\\n  --ag-advanced-filter-builder-indent-size: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\\n  --ag-cell-horizontal-padding: calc(var(--ag-grid-size) * 3);\\n  --ag-cell-widget-spacing: calc(var(--ag-grid-size) * 2);\\n  --ag-widget-container-vertical-padding: calc(var(--ag-grid-size) * 2);\\n  --ag-widget-container-horizontal-padding: calc(var(--ag-grid-size) * 2);\\n  --ag-widget-vertical-spacing: calc(var(--ag-grid-size) * 1.5);\\n  --ag-toggle-button-height: 18px;\\n  --ag-toggle-button-width: 28px;\\n  --ag-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell,\\n      "Helvetica Neue", sans-serif;\\n  --ag-font-size: 13px;\\n  --ag-icon-font-family: agGridAlpine;\\n  --ag-selected-tab-underline-color:';
      S = S + " var(--ag-alpine-active-color);\\n  --ag-selected-tab-underline-width: 2px;\\n  --ag-selected-tab-underline-transition-speed: 0.3s;\\n  --ag-tab-min-width: 240px;\\n  --ag-card-shadow: 0 1px 4px 1px rgba(186, 191, 199, 0.4);\\n  --ag-popup-shadow: var(--ag-card-shadow);\\n  --ag-side-bar-panel-width: 250px;\\n}\\n\\n.ag-theme-alpine-dark {\\n  --ag-background-color: #181d1f;\\n  --ag-foreground-color: #fff;\\n  --ag-border-color: #68686e;\\n  --ag-secondary-border-color: rgba(88, 86, 82, 0.5);\\n  --ag-modal-overlay-background-color: rgba(24, 29, 31, 0.66);\\n  --ag-header-background-color: #222628;\\n  --ag-tooltip-background-color: #222628;\\n  --ag-odd-row-background-color: #222628;\\n  --ag-control-panel-background-color: #222628;\\n  --ag-subheader-background-color: #000;\\n  --ag-input-disabled-background-color: #282c2f;\\n  --ag-input-focus-box-shadow: 0 0 2px 0.5px rgba(255, 255, 255, 0.5), 0 0 4px 3px var(--ag-input-focus-border-color);\\n  --ag-card-shadow: 0 1px 20px 1px black;\\n  --ag-disabled-foreground-color: rgba(255, 255, 255, 0.5);\\n  --ag-chip-background-color: rgba(255, 255, 255, 0.07);\\n  --ag-input-disabled-border-color: rgba(104, 104, 110, 0.3);\\n  --ag-input-disabled-background-color: rgba(104, 104, 110, 0.07);\\n  --ag-advanced-filter-join-pill-color: #7a3a37;\\n  --ag-advanced-filter-column-pill-color: #355f2d;\\n  --ag-advanced-filter-option-pill-color: #5a3168;\\n  --ag-advanced-filter-value-pill-color: #374c86;\\n  --ag-row-loading-skeleton-effect-color: rgba(202, 203, 204, 0.4);\\n  --csstools-color-scheme--dark: initial;\\n  color-scheme: dark;\\n}\\n\\n@media (prefers-color-scheme: dark) {\\n  .ag-theme-alpine-auto-dark {\\n    --ag-background-color: #181d1f;\\n    --ag-foreground-color: #fff;\\n    --ag-border-color: #68686e;\\n    --ag-secondary-border-color: rgba(88, 86, 82, 0.5);\\n    --ag-modal-overlay-background-color: rgba(24, 29, 31, 0.66);\\n    --ag-header-background-color: #222628;\\n    --ag-tooltip-background-color: #222628;\\n    --ag-odd-row-background-color: ";
      S = S + "#222628;\\n    --ag-control-panel-background-color: #222628;\\n    --ag-subheader-background-color: #000;\\n    --ag-input-disabled-background-color: #282c2f;\\n    --ag-input-focus-box-shadow: 0 0 2px 0.5px rgba(255, 255, 255, 0.5), 0 0 4px 3px var(--ag-input-focus-border-color);\\n    --ag-card-shadow: 0 1px 20px 1px black;\\n    --ag-disabled-foreground-color: rgba(255, 255, 255, 0.5);\\n    --ag-chip-background-color: rgba(255, 255, 255, 0.07);\\n    --ag-input-disabled-border-color: rgba(104, 104, 110, 0.3);\\n    --ag-input-disabled-background-color: rgba(104, 104, 110, 0.07);\\n    --ag-advanced-filter-join-pill-color: #7a3a37;\\n    --ag-advanced-filter-column-pill-color: #355f2d;\\n    --ag-advanced-filter-option-pill-color: #5a3168;\\n    --ag-advanced-filter-value-pill-color: #374c86;\\n    --ag-row-loading-skeleton-effect-color: rgba(202, 203, 204, 0.4);\\n    --csstools-color-scheme--dark: initial;\\n    color-scheme: dark;\\n  }\\n}\\n.ag-theme-alpine .ag-filter-toolpanel-header,\\n.ag-theme-alpine .ag-filter-toolpanel-search,\\n.ag-theme-alpine .ag-status-bar,\\n.ag-theme-alpine .ag-header-row,\\n.ag-theme-alpine .ag-panel-title-bar-title,\\n.ag-theme-alpine .ag-multi-filter-group-title-bar,\\n.ag-theme-alpine-dark .ag-filter-toolpanel-header,\\n.ag-theme-alpine-dark .ag-filter-toolpanel-search,\\n.ag-theme-alpine-dark .ag-status-bar,\\n.ag-theme-alpine-dark .ag-header-row,\\n.ag-theme-alpine-dark .ag-panel-title-bar-title,\\n.ag-theme-alpine-dark .ag-multi-filter-group-title-bar,\\n.ag-theme-alpine-auto-dark .ag-filter-toolpanel-header,\\n.ag-theme-alpine-auto-dark .ag-filter-toolpanel-search,\\n.ag-theme-alpine-auto-dark .ag-status-bar,\\n.ag-theme-alpine-auto-dark .ag-header-row,\\n.ag-theme-alpine-auto-dark .ag-panel-title-bar-title,\\n.ag-theme-alpine-auto-dark .ag-multi-filter-group-title-bar {\\n  font-weight: 700;\\n  color: var(--ag-header-foreground-color);\\n}\\n.ag-theme-alpine .ag-row,\\n.ag-theme-alpine-dark .ag-row,\\n.ag-theme-alpine-auto-dark .ag-row {\\n  font-size: calc(var(";
      S = S + "--ag-font-size) + 1px);\\n}\\n.ag-theme-alpine input[class^=ag-]:not([type]),\\n.ag-theme-alpine input[class^=ag-][type=text],\\n.ag-theme-alpine input[class^=ag-][type=number],\\n.ag-theme-alpine input[class^=ag-][type=tel],\\n.ag-theme-alpine input[class^=ag-][type=date],\\n.ag-theme-alpine input[class^=ag-][type=datetime-local],\\n.ag-theme-alpine textarea[class^=ag-],\\n.ag-theme-alpine-dark input[class^=ag-]:not([type]),\\n.ag-theme-alpine-dark input[class^=ag-][type=text],\\n.ag-theme-alpine-dark input[class^=ag-][type=number],\\n.ag-theme-alpine-dark input[class^=ag-][type=tel],\\n.ag-theme-alpine-dark input[class^=ag-][type=date],\\n.ag-theme-alpine-dark input[class^=ag-][type=datetime-local],\\n.ag-theme-alpine-dark textarea[class^=ag-],\\n.ag-theme-alpine-auto-dark input[class^=ag-]:not([type]),\\n.ag-theme-alpine-auto-dark input[class^=ag-][type=text],\\n.ag-theme-alpine-auto-dark input[class^=ag-][type=number],\\n.ag-theme-alpine-auto-dark input[class^=ag-][type=tel],\\n.ag-theme-alpine-auto-dark input[class^=ag-][type=date],\\n.ag-theme-alpine-auto-dark input[class^=ag-][type=datetime-local],\\n.ag-theme-alpine-auto-dark textarea[class^=ag-] {\\n  min-height: calc(var(--ag-grid-size) * 4);\\n  border-radius: var(--ag-border-radius);\\n}\\n.ag-theme-alpine .ag-ltr input[class^=ag-]:not([type]), .ag-theme-alpine .ag-ltr input[class^=ag-][type=text], .ag-theme-alpine .ag-ltr input[class^=ag-][type=number], .ag-theme-alpine .ag-ltr input[class^=ag-][type=tel], .ag-theme-alpine .ag-ltr input[class^=ag-][type=date], .ag-theme-alpine .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-alpine .ag-ltr textarea[class^=ag-], .ag-theme-alpine-dark .ag-ltr input[class^=ag-]:not([type]), .ag-theme-alpine-dark .ag-ltr input[class^=ag-][type=text], .ag-theme-alpine-dark .ag-ltr input[class^=ag-][type=number], .ag-theme-alpine-dark .ag-ltr input[class^=ag-][type=tel], .ag-theme-alpine-dark .ag-ltr input[class^=ag-][type=date], .ag-theme-alpine-dark .ag-ltr input[class^=ag-][type=datetime-l";
      S = S + "ocal], .ag-theme-alpine-dark .ag-ltr textarea[class^=ag-], .ag-theme-alpine-auto-dark .ag-ltr input[class^=ag-]:not([type]), .ag-theme-alpine-auto-dark .ag-ltr input[class^=ag-][type=text], .ag-theme-alpine-auto-dark .ag-ltr input[class^=ag-][type=number], .ag-theme-alpine-auto-dark .ag-ltr input[class^=ag-][type=tel], .ag-theme-alpine-auto-dark .ag-ltr input[class^=ag-][type=date], .ag-theme-alpine-auto-dark .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-alpine-auto-dark .ag-ltr textarea[class^=ag-] {\\n  padding-left: var(--ag-grid-size);\\n}\\n\\n.ag-theme-alpine .ag-rtl input[class^=ag-]:not([type]), .ag-theme-alpine .ag-rtl input[class^=ag-][type=text], .ag-theme-alpine .ag-rtl input[class^=ag-][type=number], .ag-theme-alpine .ag-rtl input[class^=ag-][type=tel], .ag-theme-alpine .ag-rtl input[class^=ag-][type=date], .ag-theme-alpine .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-alpine .ag-rtl textarea[class^=ag-], .ag-theme-alpine-dark .ag-rtl input[class^=ag-]:not([type]), .ag-theme-alpine-dark .ag-rtl input[class^=ag-][type=text], .ag-theme-alpine-dark .ag-rtl input[class^=ag-][type=number], .ag-theme-alpine-dark .ag-rtl input[class^=ag-][type=tel], .ag-theme-alpine-dark .ag-rtl input[class^=ag-][type=date], .ag-theme-alpine-dark .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-alpine-dark .ag-rtl textarea[class^=ag-], .ag-theme-alpine-auto-dark .ag-rtl input[class^=ag-]:not([type]), .ag-theme-alpine-auto-dark .ag-rtl input[class^=ag-][type=text], .ag-theme-alpine-auto-dark .ag-rtl input[class^=ag-][type=number], .ag-theme-alpine-auto-dark .ag-rtl input[class^=ag-][type=tel], .ag-theme-alpine-auto-dark .ag-rtl input[class^=ag-][type=date], .ag-theme-alpine-auto-dark .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-alpine-auto-dark .ag-rtl textarea[class^=ag-] {\\n  padding-right: var(--ag-grid-size);\\n}\\n\\n.ag-theme-alpine .ag-tab,\\n.ag-theme-alpine-dark .ag-tab,\\n.ag-theme-alpine-auto-dark .ag-tab {\\n  padding: calc(var(--";
      S = S + "ag-grid-size) * 1.5);\\n  transition: color 0.4s;\\n  flex: 1 1 auto;\\n}\\n.ag-theme-alpine .ag-tab-selected,\\n.ag-theme-alpine-dark .ag-tab-selected,\\n.ag-theme-alpine-auto-dark .ag-tab-selected {\\n  color: var(--ag-alpine-active-color);\\n}\\n.ag-theme-alpine .ag-menu,\\n.ag-theme-alpine-dark .ag-menu,\\n.ag-theme-alpine-auto-dark .ag-menu {\\n  background-color: var(--ag-control-panel-background-color);\\n}\\n.ag-theme-alpine .ag-panel-content-wrapper .ag-column-select,\\n.ag-theme-alpine-dark .ag-panel-content-wrapper .ag-column-select,\\n.ag-theme-alpine-auto-dark .ag-panel-content-wrapper .ag-column-select {\\n  background-color: var(--ag-control-panel-background-color);\\n}\\n.ag-theme-alpine .ag-menu-header,\\n.ag-theme-alpine-dark .ag-menu-header,\\n.ag-theme-alpine-auto-dark .ag-menu-header {\\n  background-color: var(--ag-control-panel-background-color);\\n  padding-top: 1px;\\n}\\n.ag-theme-alpine .ag-tabs-header,\\n.ag-theme-alpine-dark .ag-tabs-header,\\n.ag-theme-alpine-auto-dark .ag-tabs-header {\\n  border-bottom: var(--ag-borders) var(--ag-border-color);\\n}\\n.ag-theme-alpine .ag-charts-settings-group-title-bar,\\n.ag-theme-alpine .ag-charts-data-group-title-bar,\\n.ag-theme-alpine .ag-charts-format-top-level-group-title-bar,\\n.ag-theme-alpine .ag-charts-advanced-settings-top-level-group-title-bar,\\n.ag-theme-alpine-dark .ag-charts-settings-group-title-bar,\\n.ag-theme-alpine-dark .ag-charts-data-group-title-bar,\\n.ag-theme-alpine-dark .ag-charts-format-top-level-group-title-bar,\\n.ag-theme-alpine-dark .ag-charts-advanced-settings-top-level-group-title-bar,\\n.ag-theme-alpine-auto-dark .ag-charts-settings-group-title-bar,\\n.ag-theme-alpine-auto-dark .ag-charts-data-group-title-bar,\\n.ag-theme-alpine-auto-dark .ag-charts-format-top-level-group-title-bar,\\n.ag-theme-alpine-auto-dark .ag-charts-advanced-settings-top-level-group-title-bar {\\n  padding: var(--ag-grid-size) calc(var(--ag-grid-size) * 2);\\n  line-height: calc(var(--ag-icon-size) + var(--ag-grid-size) - 2px);\\n}\\n.ag-";
      S = S + "theme-alpine .ag-chart-mini-thumbnail,\\n.ag-theme-alpine-dark .ag-chart-mini-thumbnail,\\n.ag-theme-alpine-auto-dark .ag-chart-mini-thumbnail {\\n  background-color: var(--ag-background-color);\\n}\\n.ag-theme-alpine .ag-chart-settings-nav-bar,\\n.ag-theme-alpine-dark .ag-chart-settings-nav-bar,\\n.ag-theme-alpine-auto-dark .ag-chart-settings-nav-bar {\\n  border-top: var(--ag-borders-secondary) var(--ag-secondary-border-color);\\n}\\n.ag-theme-alpine .ag-ltr .ag-group-title-bar-icon, .ag-theme-alpine-dark .ag-ltr .ag-group-title-bar-icon, .ag-theme-alpine-auto-dark .ag-ltr .ag-group-title-bar-icon {\\n  margin-right: var(--ag-grid-size);\\n}\\n\\n.ag-theme-alpine .ag-rtl .ag-group-title-bar-icon, .ag-theme-alpine-dark .ag-rtl .ag-group-title-bar-icon, .ag-theme-alpine-auto-dark .ag-rtl .ag-group-title-bar-icon {\\n  margin-left: var(--ag-grid-size);\\n}\\n\\n.ag-theme-alpine .ag-charts-format-top-level-group-toolbar,\\n.ag-theme-alpine .ag-charts-advanced-settings-top-level-group-toolbar,\\n.ag-theme-alpine-dark .ag-charts-format-top-level-group-toolbar,\\n.ag-theme-alpine-dark .ag-charts-advanced-settings-top-level-group-toolbar,\\n.ag-theme-alpine-auto-dark .ag-charts-format-top-level-group-toolbar,\\n.ag-theme-alpine-auto-dark .ag-charts-advanced-settings-top-level-group-toolbar {\\n  margin-top: var(--ag-grid-size);\\n}\\n.ag-theme-alpine .ag-ltr .ag-charts-format-top-level-group-toolbar, .ag-theme-alpine .ag-ltr .ag-charts-advanced-settings-top-level-group-toolbar, .ag-theme-alpine-dark .ag-ltr .ag-charts-format-top-level-group-toolbar, .ag-theme-alpine-dark .ag-ltr .ag-charts-advanced-settings-top-level-group-toolbar, .ag-theme-alpine-auto-dark .ag-ltr .ag-charts-format-top-level-group-toolbar, .ag-theme-alpine-auto-dark .ag-ltr .ag-charts-advanced-settings-top-level-group-toolbar {\\n  padding-left: calc(var(--ag-icon-size) * 0.5 + var(--ag-grid-size) * 2);\\n}\\n\\n.ag-theme-alpine .ag-rtl .ag-charts-format-top-level-group-toolbar, .ag-theme-alpine .ag-rtl .ag-charts-advanced-settings-";
      S = S + "top-level-group-toolbar, .ag-theme-alpine-dark .ag-rtl .ag-charts-format-top-level-group-toolbar, .ag-theme-alpine-dark .ag-rtl .ag-charts-advanced-settings-top-level-group-toolbar, .ag-theme-alpine-auto-dark .ag-rtl .ag-charts-format-top-level-group-toolbar, .ag-theme-alpine-auto-dark .ag-rtl .ag-charts-advanced-settings-top-level-group-toolbar {\\n  padding-right: calc(var(--ag-icon-size) * 0.5 + var(--ag-grid-size) * 2);\\n}\\n\\n.ag-theme-alpine .ag-charts-format-sub-level-group,\\n.ag-theme-alpine-dark .ag-charts-format-sub-level-group,\\n.ag-theme-alpine-auto-dark .ag-charts-format-sub-level-group {\\n  border-left: dashed 1px;\\n  border-left-color: var(--ag-border-color);\\n  padding-left: var(--ag-grid-size);\\n  margin-bottom: calc(var(--ag-grid-size) * 2);\\n}\\n.ag-theme-alpine .ag-charts-format-sub-level-group-title-bar,\\n.ag-theme-alpine-dark .ag-charts-format-sub-level-group-title-bar,\\n.ag-theme-alpine-auto-dark .ag-charts-format-sub-level-group-title-bar {\\n  padding-top: 0;\\n  padding-bottom: 0;\\n  background: none;\\n  font-weight: 700;\\n}\\n.ag-theme-alpine .ag-charts-format-sub-level-group-container,\\n.ag-theme-alpine-dark .ag-charts-format-sub-level-group-container,\\n.ag-theme-alpine-auto-dark .ag-charts-format-sub-level-group-container {\\n  padding-bottom: 0;\\n}\\n.ag-theme-alpine .ag-charts-format-sub-level-group-item:last-child,\\n.ag-theme-alpine-dark .ag-charts-format-sub-level-group-item:last-child,\\n.ag-theme-alpine-auto-dark .ag-charts-format-sub-level-group-item:last-child {\\n  margin-bottom: 0;\\n}\\n.ag-theme-alpine.ag-dnd-ghost,\\n.ag-theme-alpine-dark.ag-dnd-ghost,\\n.ag-theme-alpine-auto-dark.ag-dnd-ghost {\\n  font-size: calc(var(--ag-font-size) - 1px);\\n  font-weight: 700;\\n}\\n.ag-theme-alpine .ag-side-buttons,\\n.ag-theme-alpine-dark .ag-side-buttons,\\n.ag-theme-alpine-auto-dark .ag-side-buttons {\\n  width: calc(var(--ag-grid-size) * 5);\\n}\\n.ag-theme-alpine .ag-standard-button,\\n.ag-theme-alpine-dark .ag-standard-button,\\n.ag-theme-alpine-auto-dark";
      S = S + " .ag-standard-button {\\n  font-family: inherit;\\n  -moz-appearance: none;\\n       appearance: none;\\n  -webkit-appearance: none;\\n  border-radius: var(--ag-border-radius);\\n  border: 1px solid;\\n  border-color: var(--ag-alpine-active-color);\\n  color: var(--ag-alpine-active-color);\\n  background-color: var(--ag-background-color);\\n  font-weight: 600;\\n  padding: var(--ag-grid-size) calc(var(--ag-grid-size) * 2);\\n}\\n.ag-theme-alpine .ag-standard-button:hover,\\n.ag-theme-alpine-dark .ag-standard-button:hover,\\n.ag-theme-alpine-auto-dark .ag-standard-button:hover {\\n  border-color: var(--ag-alpine-active-color);\\n  background-color: var(--ag-row-hover-color);\\n}\\n.ag-theme-alpine .ag-standard-button:active,\\n.ag-theme-alpine-dark .ag-standard-button:active,\\n.ag-theme-alpine-auto-dark .ag-standard-button:active {\\n  border-color: var(--ag-alpine-active-color);\\n  background-color: var(--ag-alpine-active-color);\\n  color: var(--ag-background-color);\\n}\\n.ag-theme-alpine .ag-standard-button:disabled,\\n.ag-theme-alpine-dark .ag-standard-button:disabled,\\n.ag-theme-alpine-auto-dark .ag-standard-button:disabled {\\n  color: var(--ag-disabled-foreground-color);\\n  background-color: var(--ag-input-disabled-background-color);\\n  border-color: var(--ag-input-disabled-border-color);\\n}\\n.ag-theme-alpine .ag-column-drop-vertical,\\n.ag-theme-alpine-dark .ag-column-drop-vertical,\\n.ag-theme-alpine-auto-dark .ag-column-drop-vertical {\\n  min-height: 75px;\\n}\\n.ag-theme-alpine .ag-column-drop-vertical-title-bar,\\n.ag-theme-alpine-dark .ag-column-drop-vertical-title-bar,\\n.ag-theme-alpine-auto-dark .ag-column-drop-vertical-title-bar {\\n  padding: calc(var(--ag-grid-size) * 2);\\n  padding-bottom: 0px;\\n}\\n.ag-theme-alpine .ag-column-drop-vertical-empty-message,\\n.ag-theme-alpine-dark .ag-column-drop-vertical-empty-message,\\n.ag-theme-alpine-auto-dark .ag-column-drop-vertical-empty-message {\\n  display: flex;\\n  align-items: center;\\n  border: dashed 1px;\\n  border-color: var(--ag-borde";
      S = S + "r-color);\\n  margin: calc(var(--ag-grid-size) * 2);\\n  padding: calc(var(--ag-grid-size) * 2);\\n}\\n.ag-theme-alpine .ag-column-drop-empty-message,\\n.ag-theme-alpine-dark .ag-column-drop-empty-message,\\n.ag-theme-alpine-auto-dark .ag-column-drop-empty-message {\\n  color: var(--ag-foreground-color);\\n  opacity: 0.75;\\n}\\n.ag-theme-alpine .ag-pill-select .ag-column-drop,\\n.ag-theme-alpine-dark .ag-pill-select .ag-column-drop,\\n.ag-theme-alpine-auto-dark .ag-pill-select .ag-column-drop {\\n  min-height: 0;\\n  min-height: initial;\\n}\\n.ag-theme-alpine .ag-status-bar,\\n.ag-theme-alpine-dark .ag-status-bar,\\n.ag-theme-alpine-auto-dark .ag-status-bar {\\n  font-weight: normal;\\n}\\n.ag-theme-alpine .ag-status-name-value-value,\\n.ag-theme-alpine-dark .ag-status-name-value-value,\\n.ag-theme-alpine-auto-dark .ag-status-name-value-value {\\n  font-weight: 700;\\n}\\n.ag-theme-alpine .ag-paging-number,\\n.ag-theme-alpine .ag-paging-row-summary-panel-number,\\n.ag-theme-alpine-dark .ag-paging-number,\\n.ag-theme-alpine-dark .ag-paging-row-summary-panel-number,\\n.ag-theme-alpine-auto-dark .ag-paging-number,\\n.ag-theme-alpine-auto-dark .ag-paging-row-summary-panel-number {\\n  font-weight: 700;\\n}\\n.ag-theme-alpine .ag-column-drop-cell-button,\\n.ag-theme-alpine-dark .ag-column-drop-cell-button,\\n.ag-theme-alpine-auto-dark .ag-column-drop-cell-button {\\n  opacity: 0.5;\\n}\\n.ag-theme-alpine .ag-column-drop-cell-button:hover,\\n.ag-theme-alpine-dark .ag-column-drop-cell-button:hover,\\n.ag-theme-alpine-auto-dark .ag-column-drop-cell-button:hover {\\n  opacity: 0.75;\\n}\\n.ag-theme-alpine .ag-column-select-column-readonly.ag-icon-grip,\\n.ag-theme-alpine .ag-column-select-column-readonly .ag-icon-grip,\\n.ag-theme-alpine-dark .ag-column-select-column-readonly.ag-icon-grip,\\n.ag-theme-alpine-dark .ag-column-select-column-readonly .ag-icon-grip,\\n.ag-theme-alpine-auto-dark .ag-column-select-column-readonly.ag-icon-grip,\\n.ag-theme-alpine-auto-dark .ag-column-select-column-readonly .ag-icon-grip {\\n  opa";
      S = S + "city: 0.35;\\n}\\n.ag-theme-alpine .ag-header-cell-menu-button:hover,\\n.ag-theme-alpine .ag-header-cell-filter-button:hover,\\n.ag-theme-alpine .ag-side-button-button:hover,\\n.ag-theme-alpine .ag-tab:hover,\\n.ag-theme-alpine .ag-panel-title-bar-button:hover,\\n.ag-theme-alpine .ag-header-expand-icon:hover,\\n.ag-theme-alpine .ag-column-group-icons:hover,\\n.ag-theme-alpine .ag-set-filter-group-icons:hover,\\n.ag-theme-alpine .ag-group-expanded .ag-icon:hover,\\n.ag-theme-alpine .ag-group-contracted .ag-icon:hover,\\n.ag-theme-alpine .ag-chart-settings-prev:hover,\\n.ag-theme-alpine .ag-chart-settings-next:hover,\\n.ag-theme-alpine .ag-group-title-bar-icon:hover,\\n.ag-theme-alpine .ag-column-select-header-icon:hover,\\n.ag-theme-alpine .ag-floating-filter-button-button:hover,\\n.ag-theme-alpine .ag-filter-toolpanel-expand:hover,\\n.ag-theme-alpine .ag-chart-menu-icon:hover,\\n.ag-theme-alpine-dark .ag-header-cell-menu-button:hover,\\n.ag-theme-alpine-dark .ag-header-cell-filter-button:hover,\\n.ag-theme-alpine-dark .ag-side-button-button:hover,\\n.ag-theme-alpine-dark .ag-tab:hover,\\n.ag-theme-alpine-dark .ag-panel-title-bar-button:hover,\\n.ag-theme-alpine-dark .ag-header-expand-icon:hover,\\n.ag-theme-alpine-dark .ag-column-group-icons:hover,\\n.ag-theme-alpine-dark .ag-set-filter-group-icons:hover,\\n.ag-theme-alpine-dark .ag-group-expanded .ag-icon:hover,\\n.ag-theme-alpine-dark .ag-group-contracted .ag-icon:hover,\\n.ag-theme-alpine-dark .ag-chart-settings-prev:hover,\\n.ag-theme-alpine-dark .ag-chart-settings-next:hover,\\n.ag-theme-alpine-dark .ag-group-title-bar-icon:hover,\\n.ag-theme-alpine-dark .ag-column-select-header-icon:hover,\\n.ag-theme-alpine-dark .ag-floating-filter-button-button:hover,\\n.ag-theme-alpine-dark .ag-filter-toolpanel-expand:hover,\\n.ag-theme-alpine-dark .ag-chart-menu-icon:hover,\\n.ag-theme-alpine-auto-dark .ag-header-cell-menu-button:hover,\\n.ag-theme-alpine-auto-dark .ag-header-cell-filter-button:hover,\\n.ag-theme-alpine-auto-dark .ag-side-button-button:hover,\\";
      S = S + "n.ag-theme-alpine-auto-dark .ag-tab:hover,\\n.ag-theme-alpine-auto-dark .ag-panel-title-bar-button:hover,\\n.ag-theme-alpine-auto-dark .ag-header-expand-icon:hover,\\n.ag-theme-alpine-auto-dark .ag-column-group-icons:hover,\\n.ag-theme-alpine-auto-dark .ag-set-filter-group-icons:hover,\\n.ag-theme-alpine-auto-dark .ag-group-expanded .ag-icon:hover,\\n.ag-theme-alpine-auto-dark .ag-group-contracted .ag-icon:hover,\\n.ag-theme-alpine-auto-dark .ag-chart-settings-prev:hover,\\n.ag-theme-alpine-auto-dark .ag-chart-settings-next:hover,\\n.ag-theme-alpine-auto-dark .ag-group-title-bar-icon:hover,\\n.ag-theme-alpine-auto-dark .ag-column-select-header-icon:hover,\\n.ag-theme-alpine-auto-dark .ag-floating-filter-button-button:hover,\\n.ag-theme-alpine-auto-dark .ag-filter-toolpanel-expand:hover,\\n.ag-theme-alpine-auto-dark .ag-chart-menu-icon:hover {\\n  color: var(--ag-alpine-active-color);\\n}\\n.ag-theme-alpine .ag-header-cell-menu-button:hover .ag-icon,\\n.ag-theme-alpine .ag-header-cell-filter-button:hover .ag-icon,\\n.ag-theme-alpine .ag-side-button-button:hover .ag-icon,\\n.ag-theme-alpine .ag-panel-title-bar-button:hover .ag-icon,\\n.ag-theme-alpine .ag-floating-filter-button-button:hover .ag-icon,\\n.ag-theme-alpine-dark .ag-header-cell-menu-button:hover .ag-icon,\\n.ag-theme-alpine-dark .ag-header-cell-filter-button:hover .ag-icon,\\n.ag-theme-alpine-dark .ag-side-button-button:hover .ag-icon,\\n.ag-theme-alpine-dark .ag-panel-title-bar-button:hover .ag-icon,\\n.ag-theme-alpine-dark .ag-floating-filter-button-button:hover .ag-icon,\\n.ag-theme-alpine-auto-dark .ag-header-cell-menu-button:hover .ag-icon,\\n.ag-theme-alpine-auto-dark .ag-header-cell-filter-button:hover .ag-icon,\\n.ag-theme-alpine-auto-dark .ag-side-button-button:hover .ag-icon,\\n.ag-theme-alpine-auto-dark .ag-panel-title-bar-button:hover .ag-icon,\\n.ag-theme-alpine-auto-dark .ag-floating-filter-button-button:hover .ag-icon {\\n  color: inherit;\\n}\\n.ag-theme-alpine .ag-filter-active .ag-icon-filter,\\n.ag-theme-alpine-dark .ag-";
      S = S + "filter-active .ag-icon-filter,\\n.ag-theme-alpine-auto-dark .ag-filter-active .ag-icon-filter {\\n  color: var(--ag-alpine-active-color);\\n}\\n.ag-theme-alpine .ag-chart-settings-card-item.ag-not-selected:hover,\\n.ag-theme-alpine-dark .ag-chart-settings-card-item.ag-not-selected:hover,\\n.ag-theme-alpine-auto-dark .ag-chart-settings-card-item.ag-not-selected:hover {\\n  opacity: 0.35;\\n}\\n.ag-theme-alpine .ag-ltr .ag-panel-title-bar-button, .ag-theme-alpine-dark .ag-ltr .ag-panel-title-bar-button, .ag-theme-alpine-auto-dark .ag-ltr .ag-panel-title-bar-button {\\n  margin-left: calc(var(--ag-grid-size) * 2);\\n  margin-right: var(--ag-grid-size);\\n}\\n\\n.ag-theme-alpine .ag-rtl .ag-panel-title-bar-button, .ag-theme-alpine-dark .ag-rtl .ag-panel-title-bar-button, .ag-theme-alpine-auto-dark .ag-rtl .ag-panel-title-bar-button {\\n  margin-right: calc(var(--ag-grid-size) * 2);\\n  margin-left: var(--ag-grid-size);\\n}\\n\\n.ag-theme-alpine .ag-ltr .ag-filter-toolpanel-group-container, .ag-theme-alpine-dark .ag-ltr .ag-filter-toolpanel-group-container, .ag-theme-alpine-auto-dark .ag-ltr .ag-filter-toolpanel-group-container {\\n  padding-left: var(--ag-grid-size);\\n}\\n\\n.ag-theme-alpine .ag-rtl .ag-filter-toolpanel-group-container, .ag-theme-alpine-dark .ag-rtl .ag-filter-toolpanel-group-container, .ag-theme-alpine-auto-dark .ag-rtl .ag-filter-toolpanel-group-container {\\n  padding-right: var(--ag-grid-size);\\n}\\n\\n.ag-theme-alpine .ag-filter-toolpanel-instance-filter,\\n.ag-theme-alpine-dark .ag-filter-toolpanel-instance-filter,\\n.ag-theme-alpine-auto-dark .ag-filter-toolpanel-instance-filter {\\n  border: none;\\n  background-color: var(--ag-control-panel-background-color);\\n}\\n.ag-theme-alpine .ag-ltr .ag-filter-toolpanel-instance-filter, .ag-theme-alpine-dark .ag-ltr .ag-filter-toolpanel-instance-filter, .ag-theme-alpine-auto-dark .ag-ltr .ag-filter-toolpanel-instance-filter {\\n  border-left: dashed 1px;\\n  border-left-color: var(--ag-border-color);\\n  margin-left: calc(var(--ag-icon-s";
      S = S + "ize) * 0.5);\\n}\\n\\n.ag-theme-alpine .ag-rtl .ag-filter-toolpanel-instance-filter, .ag-theme-alpine-dark .ag-rtl .ag-filter-toolpanel-instance-filter, .ag-theme-alpine-auto-dark .ag-rtl .ag-filter-toolpanel-instance-filter {\\n  border-right: dashed 1px;\\n  border-right-color: var(--ag-border-color);\\n  margin-right: calc(var(--ag-icon-size) * 0.5);\\n}\\n\\n.ag-theme-alpine .ag-set-filter-list,\\n.ag-theme-alpine-dark .ag-set-filter-list,\\n.ag-theme-alpine-auto-dark .ag-set-filter-list {\\n  padding-top: calc(var(--ag-grid-size) * 0.5);\\n  padding-bottom: calc(var(--ag-grid-size) * 0.5);\\n}\\n.ag-theme-alpine .ag-layout-auto-height .ag-center-cols-viewport,\\n.ag-theme-alpine .ag-layout-auto-height .ag-center-cols-container,\\n.ag-theme-alpine .ag-layout-print .ag-center-cols-viewport,\\n.ag-theme-alpine .ag-layout-print .ag-center-cols-container,\\n.ag-theme-alpine-dark .ag-layout-auto-height .ag-center-cols-viewport,\\n.ag-theme-alpine-dark .ag-layout-auto-height .ag-center-cols-container,\\n.ag-theme-alpine-dark .ag-layout-print .ag-center-cols-viewport,\\n.ag-theme-alpine-dark .ag-layout-print .ag-center-cols-container,\\n.ag-theme-alpine-auto-dark .ag-layout-auto-height .ag-center-cols-viewport,\\n.ag-theme-alpine-auto-dark .ag-layout-auto-height .ag-center-cols-container,\\n.ag-theme-alpine-auto-dark .ag-layout-print .ag-center-cols-viewport,\\n.ag-theme-alpine-auto-dark .ag-layout-print .ag-center-cols-container {\\n  min-height: 150px;\\n}\\n.ag-theme-alpine .ag-overlay-no-rows-wrapper.ag-layout-auto-height,\\n.ag-theme-alpine-dark .ag-overlay-no-rows-wrapper.ag-layout-auto-height,\\n.ag-theme-alpine-auto-dark .ag-overlay-no-rows-wrapper.ag-layout-auto-height {\\n  padding-top: 60px;\\n}\\n.ag-theme-alpine .ag-date-time-list-page-entry-is-current,\\n.ag-theme-alpine-dark .ag-date-time-list-page-entry-is-current,\\n.ag-theme-alpine-auto-dark .ag-date-time-list-page-entry-is-current {\\n  background-color: var(--ag-alpine-active-color);\\n}\\n.ag-theme-alpine .ag-advanced-filter-builder-but";
      S = S + 'ton,\\n.ag-theme-alpine-dark .ag-advanced-filter-builder-button,\\n.ag-theme-alpine-auto-dark .ag-advanced-filter-builder-button {\\n  padding: var(--ag-grid-size);\\n  font-weight: 600;\\n}\\n\',""]),t.A=g},4991:function(e,t,a){"use strict";var n=a(6758),o=a.n(n),r=a(935),i=a.n(r)()(o());i.push([e.id,\'.ag-theme-balham,\\n.ag-theme-balham-dark,\\n.ag-theme-balham-auto-dark {\\n  --ag-balham-active-color: #0091ea;\\n  --ag-foreground-color: #000;\\n  --ag-background-color: #fff;\\n  --ag-header-background-color: #f5f7f7;\\n  --ag-tooltip-background-color: #cbd0d3;\\n  --ag-subheader-background-color: #e2e9eb;\\n  --ag-control-panel-background-color: #f5f7f7;\\n  --ag-border-color: #bdc3c7;\\n  --ag-odd-row-background-color: #fcfdfe;\\n  --ag-row-hover-color: #ecf0f1;\\n  --ag-column-hover-color: #ecf0f1;\\n  --ag-input-border-color: #95a5a6;\\n  --ag-invalid-color: #e02525;\\n  --ag-input-disabled-background-color: #ebebeb;\\n  --ag-checkbox-unchecked-color: #7f8c8d;\\n  --ag-input-focus-border-color: #719ece;\\n  --ag-advanced-filter-join-pill-color: #f08e8d;\\n  --ag-advanced-filter-column-pill-color: #a6e194;\\n  --ag-advanced-filter-option-pill-color: #f3c08b;\\n  --ag-advanced-filter-value-pill-color: #85c0e4;\\n  --ag-input-focus-box-shadow: 0 0 2px 1px var(--ag-input-focus-border-color);\\n  --ag-range-selection-border-color: var(--ag-balham-active-color);\\n  --ag-checkbox-checked-color: var(--ag-balham-active-color);\\n  --ag-checkbox-background-color: var(--ag-background-color);\\n  --ag-panel-background-color: var(--ag-header-background-color);\\n  --ag-secondary-foreground-color: rgba(0, 0, 0, 0.54);\\n  --ag-disabled-foreground-color: rgba(0, 0, 0, 0.38);\\n  --ag-subheader-toolbar-background-color: rgba(226, 233, 235, 0.5);\\n  --ag-row-border-color: rgba(189, 195, 199, 0.58);\\n  --ag-chip-background-color: rgba(0, 0, 0, 0.1);\\n  --ag-range-selection-background-color: rgba(0, 145, 234, 0.2);\\n  --ag-range-selection-background-color-2: rgba(0, 145, 234, 0.36);\\n  --ag-range-selection-backgro';
      S = S + 'und-color-3: rgba(0, 145, 234, 0.49);\\n  --ag-range-selection-background-color-4: rgba(0, 145, 234, 0.59);\\n  --ag-selected-row-background-color: rgba(0, 145, 234, 0.28);\\n  --ag-header-column-separator-color: rgba(189, 195, 199, 0.5);\\n  --ag-input-disabled-border-color: rgba(149, 165, 166, 0.3);\\n  --ag-header-column-separator-display: block;\\n  --ag-header-column-separator-height: 50%;\\n  --ag-grid-size: 4px;\\n  --ag-icon-size: 16px;\\n  --ag-row-height: calc(var(--ag-grid-size) * 7);\\n  --ag-header-height: calc(var(--ag-grid-size) * 8);\\n  --ag-list-item-height: calc(var(--ag-grid-size) * 6);\\n  --ag-row-group-indent-size: calc(var(--ag-grid-size) * 3 + var(--ag-icon-size));\\n  --ag-cell-horizontal-padding: calc(var(--ag-grid-size) * 3);\\n  --ag-input-height: calc(var(--ag-grid-size) * 4);\\n  --ag-chart-menu-panel-width: 240px;\\n  --ag-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell,\\n      "Helvetica Neue", sans-serif;\\n  --ag-font-size: 12px;\\n  --ag-icon-font-family: agGridBalham;\\n  --ag-border-radius: 2px;\\n  --ag-checkbox-border-radius: 3px;\\n  --ag-card-shadow: none;\\n}\\n\\n.ag-theme-balham-dark {\\n  --ag-balham-active-color: #00b0ff;\\n  --ag-foreground-color: #f5f5f5;\\n  --ag-background-color: #2d3436;\\n  --ag-header-background-color: #1c1c1c;\\n  --ag-tooltip-background-color: #1c1f20;\\n  --ag-subheader-background-color: #111;\\n  --ag-control-panel-background-color: #202020;\\n  --ag-border-color: #424242;\\n  --ag-odd-row-background-color: #262c2e;\\n  --ag-row-hover-color: #3d4749;\\n  --ag-column-hover-color: #3d4749;\\n  --ag-input-border-color: #f0f0f0;\\n  --ag-input-disabled-background-color: rgba(48, 46, 46, 0.3);\\n  --ag-modal-overlay-background-color: rgba(45, 52, 54, 0.66);\\n  --ag-checkbox-unchecked-color: #ecf0f1;\\n  --ag-advanced-filter-join-pill-color: #7a3a37;\\n  --ag-advanced-filter-column-pill-color: #355f2d;\\n  --ag-advanced-filter-option-pill-color: #5a3168;\\n  --ag-advanced-filter-value-pill';
      S = S + "-color: #374c86;\\n  --ag-secondary-foreground-color: var(--ag-foreground-color);\\n  --ag-disabled-foreground-color: rgba(245, 245, 245, 0.38);\\n  --ag-subheader-toolbar-background-color: rgba(17, 17, 17, 0.5);\\n  --ag-row-border-color: #5c5c5c;\\n  --ag-chip-background-color: rgba(245, 245, 245, 0.08);\\n  --ag-range-selection-background-color: rgba(0, 176, 255, 0.2);\\n  --ag-range-selection-background-color-2: rgba(0, 176, 255, 0.36);\\n  --ag-range-selection-background-color-3: rgba(0, 176, 255, 0.49);\\n  --ag-range-selection-background-color-4: rgba(0, 176, 255, 0.59);\\n  --ag-selected-row-background-color: rgba(0, 176, 255, 0.28);\\n  --ag-header-column-separator-color: rgba(66, 66, 66, 0.5);\\n  --ag-input-disabled-border-color: rgba(240, 240, 240, 0.3);\\n  --ag-header-foreground-color: rgba(245, 245, 245, 0.64);\\n  --ag-toggle-button-off-background-color: transparent;\\n  --ag-toggle-button-off-border-color: var(--ag-foreground-color);\\n  --ag-range-selection-chart-category-background-color: rgba(26, 177, 74, 0.5);\\n  --ag-range-selection-chart-background-color: rgba(45, 166, 255, 0.5);\\n  --ag-input-focus-box-shadow: 0 0 4px 1.5px var(--ag-input-focus-border-color);\\n  --ag-row-loading-skeleton-effect-color: rgba(202, 203, 204, 0.4);\\n  --csstools-color-scheme--dark: initial;\\n  color-scheme: dark;\\n}\\n\\n@media (prefers-color-scheme: dark) {\\n  .ag-theme-balham-auto-dark {\\n    --ag-balham-active-color: #00b0ff;\\n    --ag-foreground-color: #f5f5f5;\\n    --ag-background-color: #2d3436;\\n    --ag-header-background-color: #1c1c1c;\\n    --ag-tooltip-background-color: #1c1f20;\\n    --ag-subheader-background-color: #111;\\n    --ag-control-panel-background-color: #202020;\\n    --ag-border-color: #424242;\\n    --ag-odd-row-background-color: #262c2e;\\n    --ag-row-hover-color: #3d4749;\\n    --ag-column-hover-color: #3d4749;\\n    --ag-input-border-color: #f0f0f0;\\n    --ag-input-disabled-background-color: rgba(48, 46, 46, 0.3);\\n    --ag-modal-overlay-background-color: rgba(";
      S = S + "45, 52, 54, 0.66);\\n    --ag-checkbox-unchecked-color: #ecf0f1;\\n    --ag-advanced-filter-join-pill-color: #7a3a37;\\n    --ag-advanced-filter-column-pill-color: #355f2d;\\n    --ag-advanced-filter-option-pill-color: #5a3168;\\n    --ag-advanced-filter-value-pill-color: #374c86;\\n    --ag-secondary-foreground-color: var(--ag-foreground-color);\\n    --ag-disabled-foreground-color: rgba(245, 245, 245, 0.38);\\n    --ag-subheader-toolbar-background-color: rgba(17, 17, 17, 0.5);\\n    --ag-row-border-color: #5c5c5c;\\n    --ag-chip-background-color: rgba(245, 245, 245, 0.08);\\n    --ag-range-selection-background-color: rgba(0, 176, 255, 0.2);\\n    --ag-range-selection-background-color-2: rgba(0, 176, 255, 0.36);\\n    --ag-range-selection-background-color-3: rgba(0, 176, 255, 0.49);\\n    --ag-range-selection-background-color-4: rgba(0, 176, 255, 0.59);\\n    --ag-selected-row-background-color: rgba(0, 176, 255, 0.28);\\n    --ag-header-column-separator-color: rgba(66, 66, 66, 0.5);\\n    --ag-input-disabled-border-color: rgba(240, 240, 240, 0.3);\\n    --ag-header-foreground-color: rgba(245, 245, 245, 0.64);\\n    --ag-toggle-button-off-background-color: transparent;\\n    --ag-toggle-button-off-border-color: var(--ag-foreground-color);\\n    --ag-range-selection-chart-category-background-color: rgba(26, 177, 74, 0.5);\\n    --ag-range-selection-chart-background-color: rgba(45, 166, 255, 0.5);\\n    --ag-input-focus-box-shadow: 0 0 4px 1.5px var(--ag-input-focus-border-color);\\n    --ag-row-loading-skeleton-effect-color: rgba(202, 203, 204, 0.4);\\n    --csstools-color-scheme--dark: initial;\\n    color-scheme: dark;\\n  }\\n}\\n.ag-theme-balham .ag-filter-toolpanel-header,\\n.ag-theme-balham .ag-filter-toolpanel-search,\\n.ag-theme-balham .ag-status-bar,\\n.ag-theme-balham .ag-header-row,\\n.ag-theme-balham .ag-multi-filter-group-title-bar,\\n.ag-theme-balham-dark .ag-filter-toolpanel-header,\\n.ag-theme-balham-dark .ag-filter-toolpanel-search,\\n.ag-theme-balham-dark .ag-status-bar,\\n.ag-theme-b";
      S = S + "alham-dark .ag-header-row,\\n.ag-theme-balham-dark .ag-multi-filter-group-title-bar,\\n.ag-theme-balham-auto-dark .ag-filter-toolpanel-header,\\n.ag-theme-balham-auto-dark .ag-filter-toolpanel-search,\\n.ag-theme-balham-auto-dark .ag-status-bar,\\n.ag-theme-balham-auto-dark .ag-header-row,\\n.ag-theme-balham-auto-dark .ag-multi-filter-group-title-bar {\\n  font-weight: 600;\\n  color: var(--ag-header-foreground-color);\\n}\\n.ag-theme-balham .ag-ltr input[class^=ag-]:not([type]), .ag-theme-balham .ag-ltr input[class^=ag-][type=text], .ag-theme-balham .ag-ltr input[class^=ag-][type=number], .ag-theme-balham .ag-ltr input[class^=ag-][type=tel], .ag-theme-balham .ag-ltr input[class^=ag-][type=date], .ag-theme-balham .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-balham .ag-ltr textarea[class^=ag-], .ag-theme-balham-dark .ag-ltr input[class^=ag-]:not([type]), .ag-theme-balham-dark .ag-ltr input[class^=ag-][type=text], .ag-theme-balham-dark .ag-ltr input[class^=ag-][type=number], .ag-theme-balham-dark .ag-ltr input[class^=ag-][type=tel], .ag-theme-balham-dark .ag-ltr input[class^=ag-][type=date], .ag-theme-balham-dark .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-balham-dark .ag-ltr textarea[class^=ag-], .ag-theme-balham-auto-dark .ag-ltr input[class^=ag-]:not([type]), .ag-theme-balham-auto-dark .ag-ltr input[class^=ag-][type=text], .ag-theme-balham-auto-dark .ag-ltr input[class^=ag-][type=number], .ag-theme-balham-auto-dark .ag-ltr input[class^=ag-][type=tel], .ag-theme-balham-auto-dark .ag-ltr input[class^=ag-][type=date], .ag-theme-balham-auto-dark .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-balham-auto-dark .ag-ltr textarea[class^=ag-] {\\n  padding-left: var(--ag-grid-size);\\n}\\n\\n.ag-theme-balham .ag-rtl input[class^=ag-]:not([type]), .ag-theme-balham .ag-rtl input[class^=ag-][type=text], .ag-theme-balham .ag-rtl input[class^=ag-][type=number], .ag-theme-balham .ag-rtl input[class^=ag-][type=tel], .ag-theme-balham .ag-rtl input[class^=ag-]";
      S = S + "[type=date], .ag-theme-balham .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-balham .ag-rtl textarea[class^=ag-], .ag-theme-balham-dark .ag-rtl input[class^=ag-]:not([type]), .ag-theme-balham-dark .ag-rtl input[class^=ag-][type=text], .ag-theme-balham-dark .ag-rtl input[class^=ag-][type=number], .ag-theme-balham-dark .ag-rtl input[class^=ag-][type=tel], .ag-theme-balham-dark .ag-rtl input[class^=ag-][type=date], .ag-theme-balham-dark .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-balham-dark .ag-rtl textarea[class^=ag-], .ag-theme-balham-auto-dark .ag-rtl input[class^=ag-]:not([type]), .ag-theme-balham-auto-dark .ag-rtl input[class^=ag-][type=text], .ag-theme-balham-auto-dark .ag-rtl input[class^=ag-][type=number], .ag-theme-balham-auto-dark .ag-rtl input[class^=ag-][type=tel], .ag-theme-balham-auto-dark .ag-rtl input[class^=ag-][type=date], .ag-theme-balham-auto-dark .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-balham-auto-dark .ag-rtl textarea[class^=ag-] {\\n  padding-right: var(--ag-grid-size);\\n}\\n\\n.ag-theme-balham .ag-column-drop-vertical-empty-message,\\n.ag-theme-balham .ag-status-bar,\\n.ag-theme-balham-dark .ag-column-drop-vertical-empty-message,\\n.ag-theme-balham-dark .ag-status-bar,\\n.ag-theme-balham-auto-dark .ag-column-drop-vertical-empty-message,\\n.ag-theme-balham-auto-dark .ag-status-bar {\\n  font-weight: 600;\\n  color: var(--ag-disabled-foreground-color);\\n}\\n.ag-theme-balham.ag-dnd-ghost,\\n.ag-theme-balham-dark.ag-dnd-ghost,\\n.ag-theme-balham-auto-dark.ag-dnd-ghost {\\n  font-size: var(--ag-font-size);\\n  font-weight: 600;\\n}\\n.ag-theme-balham .ag-tab,\\n.ag-theme-balham-dark .ag-tab,\\n.ag-theme-balham-auto-dark .ag-tab {\\n  border: 1px solid transparent;\\n  padding: var(--ag-grid-size) calc(var(--ag-grid-size) * 2);\\n  margin: var(--ag-grid-size);\\n  margin-bottom: -1px;\\n}\\n.ag-theme-balham .ag-tab-selected,\\n.ag-theme-balham-dark .ag-tab-selected,\\n.ag-theme-balham-auto-dark .ag-tab-selected {\\n  background-color: ";
      S = S + "var(--ag-background-color);\\n  border-color: var(--ag-border-color);\\n  border-bottom-color: transparent;\\n}\\n.ag-theme-balham .ag-tabs-header,\\n.ag-theme-balham-dark .ag-tabs-header,\\n.ag-theme-balham-auto-dark .ag-tabs-header {\\n  border-bottom: 1px solid var(--ag-border-color);\\n}\\n.ag-theme-balham .ag-column-drop-cell,\\n.ag-theme-balham-dark .ag-column-drop-cell,\\n.ag-theme-balham-auto-dark .ag-column-drop-cell {\\n  height: calc(var(--ag-grid-size) * 6);\\n}\\n.ag-theme-balham .ag-column-drop-vertical-title,\\n.ag-theme-balham-dark .ag-column-drop-vertical-title,\\n.ag-theme-balham-auto-dark .ag-column-drop-vertical-title {\\n  color: var(--ag-foreground-color);\\n}\\n.ag-theme-balham .ag-column-drop-vertical-cell,\\n.ag-theme-balham-dark .ag-column-drop-vertical-cell,\\n.ag-theme-balham-auto-dark .ag-column-drop-vertical-cell {\\n  margin-left: calc(var(--ag-grid-size) * 2);\\n  margin-right: calc(var(--ag-grid-size) * 2);\\n}\\n.ag-theme-balham .ag-column-drop-vertical-cell-text,\\n.ag-theme-balham-dark .ag-column-drop-vertical-cell-text,\\n.ag-theme-balham-auto-dark .ag-column-drop-vertical-cell-text {\\n  margin-left: calc(var(--ag-grid-size) * 2);\\n}\\n.ag-theme-balham .ag-column-drop-vertical-icon,\\n.ag-theme-balham-dark .ag-column-drop-vertical-icon,\\n.ag-theme-balham-auto-dark .ag-column-drop-vertical-icon {\\n  color: var(--ag-secondary-foreground-color);\\n}\\n.ag-theme-balham .ag-ltr .ag-column-drop-vertical-empty-message, .ag-theme-balham-dark .ag-ltr .ag-column-drop-vertical-empty-message, .ag-theme-balham-auto-dark .ag-ltr .ag-column-drop-vertical-empty-message {\\n  padding-left: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\\n  padding-right: var(--ag-grid-size);\\n}\\n\\n.ag-theme-balham .ag-rtl .ag-column-drop-vertical-empty-message, .ag-theme-balham-dark .ag-rtl .ag-column-drop-vertical-empty-message, .ag-theme-balham-auto-dark .ag-rtl .ag-column-drop-vertical-empty-message {\\n  padding-right: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\\n  padding-left";
      S = S + ": var(--ag-grid-size);\\n}\\n\\n.ag-theme-balham .ag-column-drop-horizontal,\\n.ag-theme-balham-dark .ag-column-drop-horizontal,\\n.ag-theme-balham-auto-dark .ag-column-drop-horizontal {\\n  height: var(--ag-header-height);\\n}\\n.ag-theme-balham .ag-column-drop-empty,\\n.ag-theme-balham-dark .ag-column-drop-empty,\\n.ag-theme-balham-auto-dark .ag-column-drop-empty {\\n  color: var(--ag-disabled-foreground-color);\\n}\\n.ag-theme-balham .ag-column-drop-horizontal-cell-text,\\n.ag-theme-balham-dark .ag-column-drop-horizontal-cell-text,\\n.ag-theme-balham-auto-dark .ag-column-drop-horizontal-cell-text {\\n  margin-left: calc(var(--ag-grid-size) * 2);\\n}\\n.ag-theme-balham .ag-column-drop-vertical,\\n.ag-theme-balham-dark .ag-column-drop-vertical,\\n.ag-theme-balham-auto-dark .ag-column-drop-vertical {\\n  padding-top: calc(var(--ag-grid-size) * 2);\\n}\\n.ag-theme-balham .ag-column-select-column-readonly.ag-icon-grip,\\n.ag-theme-balham .ag-column-select-column-readonly .ag-icon-grip,\\n.ag-theme-balham-dark .ag-column-select-column-readonly.ag-icon-grip,\\n.ag-theme-balham-dark .ag-column-select-column-readonly .ag-icon-grip,\\n.ag-theme-balham-auto-dark .ag-column-select-column-readonly.ag-icon-grip,\\n.ag-theme-balham-auto-dark .ag-column-select-column-readonly .ag-icon-grip {\\n  opacity: 0.35;\\n}\\n.ag-theme-balham .ag-menu-header,\\n.ag-theme-balham-dark .ag-menu-header,\\n.ag-theme-balham-auto-dark .ag-menu-header {\\n  background-color: var(--ag-header-background-color);\\n}\\n.ag-theme-balham .ag-overlay-loading-center,\\n.ag-theme-balham-dark .ag-overlay-loading-center,\\n.ag-theme-balham-auto-dark .ag-overlay-loading-center {\\n  background-color: var(--ag-background-color);\\n  border: 1px solid var(--ag-border-color);\\n  color: var(--ag-foreground-color);\\n  padding: calc(var(--ag-grid-size) * 4);\\n}\\n.ag-theme-balham .ag-tooltip,\\n.ag-theme-balham-dark .ag-tooltip,\\n.ag-theme-balham-auto-dark .ag-tooltip {\\n  border: none;\\n}\\n.ag-theme-balham .ag-panel-title-bar-button-icon,\\n.ag-theme-balh";
      S = S + "am-dark .ag-panel-title-bar-button-icon,\\n.ag-theme-balham-auto-dark .ag-panel-title-bar-button-icon {\\n  font-size: calc(var(--ag-icon-size) + var(--ag-grid-size));\\n}\\n.ag-theme-balham .ag-panel,\\n.ag-theme-balham-dark .ag-panel,\\n.ag-theme-balham-auto-dark .ag-panel {\\n  background-color: var(--ag-header-background-color);\\n}\\n.ag-theme-balham .ag-chart-data-section,\\n.ag-theme-balham .ag-chart-format-section,\\n.ag-theme-balham .ag-chart-advanced-settings-section,\\n.ag-theme-balham-dark .ag-chart-data-section,\\n.ag-theme-balham-dark .ag-chart-format-section,\\n.ag-theme-balham-dark .ag-chart-advanced-settings-section,\\n.ag-theme-balham-auto-dark .ag-chart-data-section,\\n.ag-theme-balham-auto-dark .ag-chart-format-section,\\n.ag-theme-balham-auto-dark .ag-chart-advanced-settings-section {\\n  padding-bottom: calc(var(--ag-grid-size) * 0.5);\\n}\\n.ag-theme-balham .ag-group-toolbar,\\n.ag-theme-balham-dark .ag-group-toolbar,\\n.ag-theme-balham-auto-dark .ag-group-toolbar {\\n  background-color: var(--ag-subheader-toolbar-background-color);\\n}\\n.ag-theme-balham .ag-chart-tab,\\n.ag-theme-balham-dark .ag-chart-tab,\\n.ag-theme-balham-auto-dark .ag-chart-tab {\\n  padding-top: calc(var(--ag-grid-size) * 0.5);\\n}\\n.ag-theme-balham .ag-charts-format-sub-level-group-item,\\n.ag-theme-balham-dark .ag-charts-format-sub-level-group-item,\\n.ag-theme-balham-auto-dark .ag-charts-format-sub-level-group-item {\\n  margin-bottom: calc(var(--ag-grid-size) * 1.5);\\n}\\n.ag-theme-balham .ag-filter-active .ag-icon-filter,\\n.ag-theme-balham-dark .ag-filter-active .ag-icon-filter,\\n.ag-theme-balham-auto-dark .ag-filter-active .ag-icon-filter {\\n  color: var(--ag-balham-active-color);\\n}\\n.ag-theme-balham .ag-color-input input[class^=ag-][type=text].ag-input-field-input,\\n.ag-theme-balham-dark .ag-color-input input[class^=ag-][type=text].ag-input-field-input,\\n.ag-theme-balham-auto-dark .ag-color-input input[class^=ag-][type=text].ag-input-field-input {\\n  min-height: calc(var(--ag-icon-size) + 4px);";
      S = S + '\\n}\\n\',""]),t.A=i},2621:function(e,t,a){"use strict";var n=a(6758),o=a.n(n),r=a(935),i=a.n(r),s=a(62),l=a.n(s),c=new URL(a(9377),a.b),g=i()(o()),d=l()(c);g.push([e.id,\'@font-face {\\n  font-family: "agGridBalham";\\n  src: url(\'+d+\');\\n  font-weight: normal;\\n  font-style: normal;\\n}\\n.ag-theme-balham,\\n.ag-theme-balham-dark,\\n.ag-theme-balham-auto-dark {\\n  --ag-balham-active-color: #0091ea;\\n  --ag-foreground-color: #000;\\n  --ag-background-color: #fff;\\n  --ag-header-background-color: #f5f7f7;\\n  --ag-tooltip-background-color: #cbd0d3;\\n  --ag-subheader-background-color: #e2e9eb;\\n  --ag-control-panel-background-color: #f5f7f7;\\n  --ag-border-color: #bdc3c7;\\n  --ag-odd-row-background-color: #fcfdfe;\\n  --ag-row-hover-color: #ecf0f1;\\n  --ag-column-hover-color: #ecf0f1;\\n  --ag-input-border-color: #95a5a6;\\n  --ag-invalid-color: #e02525;\\n  --ag-input-disabled-background-color: #ebebeb;\\n  --ag-checkbox-unchecked-color: #7f8c8d;\\n  --ag-input-focus-border-color: #719ece;\\n  --ag-advanced-filter-join-pill-color: #f08e8d;\\n  --ag-advanced-filter-column-pill-color: #a6e194;\\n  --ag-advanced-filter-option-pill-color: #f3c08b;\\n  --ag-advanced-filter-value-pill-color: #85c0e4;\\n  --ag-input-focus-box-shadow: 0 0 2px 1px var(--ag-input-focus-border-color);\\n  --ag-range-selection-border-color: var(--ag-balham-active-color);\\n  --ag-checkbox-checked-color: var(--ag-balham-active-color);\\n  --ag-checkbox-background-color: var(--ag-background-color);\\n  --ag-panel-background-color: var(--ag-header-background-color);\\n  --ag-secondary-foreground-color: rgba(0, 0, 0, 0.54);\\n  --ag-disabled-foreground-color: rgba(0, 0, 0, 0.38);\\n  --ag-subheader-toolbar-background-color: rgba(226, 233, 235, 0.5);\\n  --ag-row-border-color: rgba(189, 195, 199, 0.58);\\n  --ag-chip-background-color: rgba(0, 0, 0, 0.1);\\n  --ag-range-selection-background-color: rgba(0, 145, 234, 0.2);\\n  --ag-range-selection-background-color-2: rgba(0, 145, 234, 0.36);\\n  --ag-range-selection-background-color-3: ';
      S = S + 'rgba(0, 145, 234, 0.49);\\n  --ag-range-selection-background-color-4: rgba(0, 145, 234, 0.59);\\n  --ag-selected-row-background-color: rgba(0, 145, 234, 0.28);\\n  --ag-header-column-separator-color: rgba(189, 195, 199, 0.5);\\n  --ag-input-disabled-border-color: rgba(149, 165, 166, 0.3);\\n  --ag-header-column-separator-display: block;\\n  --ag-header-column-separator-height: 50%;\\n  --ag-grid-size: 4px;\\n  --ag-icon-size: 16px;\\n  --ag-row-height: calc(var(--ag-grid-size) * 7);\\n  --ag-header-height: calc(var(--ag-grid-size) * 8);\\n  --ag-list-item-height: calc(var(--ag-grid-size) * 6);\\n  --ag-row-group-indent-size: calc(var(--ag-grid-size) * 3 + var(--ag-icon-size));\\n  --ag-cell-horizontal-padding: calc(var(--ag-grid-size) * 3);\\n  --ag-input-height: calc(var(--ag-grid-size) * 4);\\n  --ag-chart-menu-panel-width: 240px;\\n  --ag-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell,\\n      "Helvetica Neue", sans-serif;\\n  --ag-font-size: 12px;\\n  --ag-icon-font-family: agGridBalham;\\n  --ag-border-radius: 2px;\\n  --ag-checkbox-border-radius: 3px;\\n  --ag-card-shadow: none;\\n}\\n\\n.ag-theme-balham-dark {\\n  --ag-balham-active-color: #00b0ff;\\n  --ag-foreground-color: #f5f5f5;\\n  --ag-background-color: #2d3436;\\n  --ag-header-background-color: #1c1c1c;\\n  --ag-tooltip-background-color: #1c1f20;\\n  --ag-subheader-background-color: #111;\\n  --ag-control-panel-background-color: #202020;\\n  --ag-border-color: #424242;\\n  --ag-odd-row-background-color: #262c2e;\\n  --ag-row-hover-color: #3d4749;\\n  --ag-column-hover-color: #3d4749;\\n  --ag-input-border-color: #f0f0f0;\\n  --ag-input-disabled-background-color: rgba(48, 46, 46, 0.3);\\n  --ag-modal-overlay-background-color: rgba(45, 52, 54, 0.66);\\n  --ag-checkbox-unchecked-color: #ecf0f1;\\n  --ag-advanced-filter-join-pill-color: #7a3a37;\\n  --ag-advanced-filter-column-pill-color: #355f2d;\\n  --ag-advanced-filter-option-pill-color: #5a3168;\\n  --ag-advanced-filter-value-pill-color: #374c';
      S = S + "86;\\n  --ag-secondary-foreground-color: var(--ag-foreground-color);\\n  --ag-disabled-foreground-color: rgba(245, 245, 245, 0.38);\\n  --ag-subheader-toolbar-background-color: rgba(17, 17, 17, 0.5);\\n  --ag-row-border-color: #5c5c5c;\\n  --ag-chip-background-color: rgba(245, 245, 245, 0.08);\\n  --ag-range-selection-background-color: rgba(0, 176, 255, 0.2);\\n  --ag-range-selection-background-color-2: rgba(0, 176, 255, 0.36);\\n  --ag-range-selection-background-color-3: rgba(0, 176, 255, 0.49);\\n  --ag-range-selection-background-color-4: rgba(0, 176, 255, 0.59);\\n  --ag-selected-row-background-color: rgba(0, 176, 255, 0.28);\\n  --ag-header-column-separator-color: rgba(66, 66, 66, 0.5);\\n  --ag-input-disabled-border-color: rgba(240, 240, 240, 0.3);\\n  --ag-header-foreground-color: rgba(245, 245, 245, 0.64);\\n  --ag-toggle-button-off-background-color: transparent;\\n  --ag-toggle-button-off-border-color: var(--ag-foreground-color);\\n  --ag-range-selection-chart-category-background-color: rgba(26, 177, 74, 0.5);\\n  --ag-range-selection-chart-background-color: rgba(45, 166, 255, 0.5);\\n  --ag-input-focus-box-shadow: 0 0 4px 1.5px var(--ag-input-focus-border-color);\\n  --ag-row-loading-skeleton-effect-color: rgba(202, 203, 204, 0.4);\\n  --csstools-color-scheme--dark: initial;\\n  color-scheme: dark;\\n}\\n\\n@media (prefers-color-scheme: dark) {\\n  .ag-theme-balham-auto-dark {\\n    --ag-balham-active-color: #00b0ff;\\n    --ag-foreground-color: #f5f5f5;\\n    --ag-background-color: #2d3436;\\n    --ag-header-background-color: #1c1c1c;\\n    --ag-tooltip-background-color: #1c1f20;\\n    --ag-subheader-background-color: #111;\\n    --ag-control-panel-background-color: #202020;\\n    --ag-border-color: #424242;\\n    --ag-odd-row-background-color: #262c2e;\\n    --ag-row-hover-color: #3d4749;\\n    --ag-column-hover-color: #3d4749;\\n    --ag-input-border-color: #f0f0f0;\\n    --ag-input-disabled-background-color: rgba(48, 46, 46, 0.3);\\n    --ag-modal-overlay-background-color: rgba(45, 52, 54, 0";
      S = S + ".66);\\n    --ag-checkbox-unchecked-color: #ecf0f1;\\n    --ag-advanced-filter-join-pill-color: #7a3a37;\\n    --ag-advanced-filter-column-pill-color: #355f2d;\\n    --ag-advanced-filter-option-pill-color: #5a3168;\\n    --ag-advanced-filter-value-pill-color: #374c86;\\n    --ag-secondary-foreground-color: var(--ag-foreground-color);\\n    --ag-disabled-foreground-color: rgba(245, 245, 245, 0.38);\\n    --ag-subheader-toolbar-background-color: rgba(17, 17, 17, 0.5);\\n    --ag-row-border-color: #5c5c5c;\\n    --ag-chip-background-color: rgba(245, 245, 245, 0.08);\\n    --ag-range-selection-background-color: rgba(0, 176, 255, 0.2);\\n    --ag-range-selection-background-color-2: rgba(0, 176, 255, 0.36);\\n    --ag-range-selection-background-color-3: rgba(0, 176, 255, 0.49);\\n    --ag-range-selection-background-color-4: rgba(0, 176, 255, 0.59);\\n    --ag-selected-row-background-color: rgba(0, 176, 255, 0.28);\\n    --ag-header-column-separator-color: rgba(66, 66, 66, 0.5);\\n    --ag-input-disabled-border-color: rgba(240, 240, 240, 0.3);\\n    --ag-header-foreground-color: rgba(245, 245, 245, 0.64);\\n    --ag-toggle-button-off-background-color: transparent;\\n    --ag-toggle-button-off-border-color: var(--ag-foreground-color);\\n    --ag-range-selection-chart-category-background-color: rgba(26, 177, 74, 0.5);\\n    --ag-range-selection-chart-background-color: rgba(45, 166, 255, 0.5);\\n    --ag-input-focus-box-shadow: 0 0 4px 1.5px var(--ag-input-focus-border-color);\\n    --ag-row-loading-skeleton-effect-color: rgba(202, 203, 204, 0.4);\\n    --csstools-color-scheme--dark: initial;\\n    color-scheme: dark;\\n  }\\n}\\n.ag-theme-balham .ag-filter-toolpanel-header,\\n.ag-theme-balham .ag-filter-toolpanel-search,\\n.ag-theme-balham .ag-status-bar,\\n.ag-theme-balham .ag-header-row,\\n.ag-theme-balham .ag-multi-filter-group-title-bar,\\n.ag-theme-balham-dark .ag-filter-toolpanel-header,\\n.ag-theme-balham-dark .ag-filter-toolpanel-search,\\n.ag-theme-balham-dark .ag-status-bar,\\n.ag-theme-balham-dark .a";
      S = S + "g-header-row,\\n.ag-theme-balham-dark .ag-multi-filter-group-title-bar,\\n.ag-theme-balham-auto-dark .ag-filter-toolpanel-header,\\n.ag-theme-balham-auto-dark .ag-filter-toolpanel-search,\\n.ag-theme-balham-auto-dark .ag-status-bar,\\n.ag-theme-balham-auto-dark .ag-header-row,\\n.ag-theme-balham-auto-dark .ag-multi-filter-group-title-bar {\\n  font-weight: 600;\\n  color: var(--ag-header-foreground-color);\\n}\\n.ag-theme-balham .ag-ltr input[class^=ag-]:not([type]), .ag-theme-balham .ag-ltr input[class^=ag-][type=text], .ag-theme-balham .ag-ltr input[class^=ag-][type=number], .ag-theme-balham .ag-ltr input[class^=ag-][type=tel], .ag-theme-balham .ag-ltr input[class^=ag-][type=date], .ag-theme-balham .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-balham .ag-ltr textarea[class^=ag-], .ag-theme-balham-dark .ag-ltr input[class^=ag-]:not([type]), .ag-theme-balham-dark .ag-ltr input[class^=ag-][type=text], .ag-theme-balham-dark .ag-ltr input[class^=ag-][type=number], .ag-theme-balham-dark .ag-ltr input[class^=ag-][type=tel], .ag-theme-balham-dark .ag-ltr input[class^=ag-][type=date], .ag-theme-balham-dark .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-balham-dark .ag-ltr textarea[class^=ag-], .ag-theme-balham-auto-dark .ag-ltr input[class^=ag-]:not([type]), .ag-theme-balham-auto-dark .ag-ltr input[class^=ag-][type=text], .ag-theme-balham-auto-dark .ag-ltr input[class^=ag-][type=number], .ag-theme-balham-auto-dark .ag-ltr input[class^=ag-][type=tel], .ag-theme-balham-auto-dark .ag-ltr input[class^=ag-][type=date], .ag-theme-balham-auto-dark .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-balham-auto-dark .ag-ltr textarea[class^=ag-] {\\n  padding-left: var(--ag-grid-size);\\n}\\n\\n.ag-theme-balham .ag-rtl input[class^=ag-]:not([type]), .ag-theme-balham .ag-rtl input[class^=ag-][type=text], .ag-theme-balham .ag-rtl input[class^=ag-][type=number], .ag-theme-balham .ag-rtl input[class^=ag-][type=tel], .ag-theme-balham .ag-rtl input[class^=ag-][type=date], ";
      S = S + ".ag-theme-balham .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-balham .ag-rtl textarea[class^=ag-], .ag-theme-balham-dark .ag-rtl input[class^=ag-]:not([type]), .ag-theme-balham-dark .ag-rtl input[class^=ag-][type=text], .ag-theme-balham-dark .ag-rtl input[class^=ag-][type=number], .ag-theme-balham-dark .ag-rtl input[class^=ag-][type=tel], .ag-theme-balham-dark .ag-rtl input[class^=ag-][type=date], .ag-theme-balham-dark .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-balham-dark .ag-rtl textarea[class^=ag-], .ag-theme-balham-auto-dark .ag-rtl input[class^=ag-]:not([type]), .ag-theme-balham-auto-dark .ag-rtl input[class^=ag-][type=text], .ag-theme-balham-auto-dark .ag-rtl input[class^=ag-][type=number], .ag-theme-balham-auto-dark .ag-rtl input[class^=ag-][type=tel], .ag-theme-balham-auto-dark .ag-rtl input[class^=ag-][type=date], .ag-theme-balham-auto-dark .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-balham-auto-dark .ag-rtl textarea[class^=ag-] {\\n  padding-right: var(--ag-grid-size);\\n}\\n\\n.ag-theme-balham .ag-column-drop-vertical-empty-message,\\n.ag-theme-balham .ag-status-bar,\\n.ag-theme-balham-dark .ag-column-drop-vertical-empty-message,\\n.ag-theme-balham-dark .ag-status-bar,\\n.ag-theme-balham-auto-dark .ag-column-drop-vertical-empty-message,\\n.ag-theme-balham-auto-dark .ag-status-bar {\\n  font-weight: 600;\\n  color: var(--ag-disabled-foreground-color);\\n}\\n.ag-theme-balham.ag-dnd-ghost,\\n.ag-theme-balham-dark.ag-dnd-ghost,\\n.ag-theme-balham-auto-dark.ag-dnd-ghost {\\n  font-size: var(--ag-font-size);\\n  font-weight: 600;\\n}\\n.ag-theme-balham .ag-tab,\\n.ag-theme-balham-dark .ag-tab,\\n.ag-theme-balham-auto-dark .ag-tab {\\n  border: 1px solid transparent;\\n  padding: var(--ag-grid-size) calc(var(--ag-grid-size) * 2);\\n  margin: var(--ag-grid-size);\\n  margin-bottom: -1px;\\n}\\n.ag-theme-balham .ag-tab-selected,\\n.ag-theme-balham-dark .ag-tab-selected,\\n.ag-theme-balham-auto-dark .ag-tab-selected {\\n  background-color: var(--ag-back";
      S = S + "ground-color);\\n  border-color: var(--ag-border-color);\\n  border-bottom-color: transparent;\\n}\\n.ag-theme-balham .ag-tabs-header,\\n.ag-theme-balham-dark .ag-tabs-header,\\n.ag-theme-balham-auto-dark .ag-tabs-header {\\n  border-bottom: 1px solid var(--ag-border-color);\\n}\\n.ag-theme-balham .ag-column-drop-cell,\\n.ag-theme-balham-dark .ag-column-drop-cell,\\n.ag-theme-balham-auto-dark .ag-column-drop-cell {\\n  height: calc(var(--ag-grid-size) * 6);\\n}\\n.ag-theme-balham .ag-column-drop-vertical-title,\\n.ag-theme-balham-dark .ag-column-drop-vertical-title,\\n.ag-theme-balham-auto-dark .ag-column-drop-vertical-title {\\n  color: var(--ag-foreground-color);\\n}\\n.ag-theme-balham .ag-column-drop-vertical-cell,\\n.ag-theme-balham-dark .ag-column-drop-vertical-cell,\\n.ag-theme-balham-auto-dark .ag-column-drop-vertical-cell {\\n  margin-left: calc(var(--ag-grid-size) * 2);\\n  margin-right: calc(var(--ag-grid-size) * 2);\\n}\\n.ag-theme-balham .ag-column-drop-vertical-cell-text,\\n.ag-theme-balham-dark .ag-column-drop-vertical-cell-text,\\n.ag-theme-balham-auto-dark .ag-column-drop-vertical-cell-text {\\n  margin-left: calc(var(--ag-grid-size) * 2);\\n}\\n.ag-theme-balham .ag-column-drop-vertical-icon,\\n.ag-theme-balham-dark .ag-column-drop-vertical-icon,\\n.ag-theme-balham-auto-dark .ag-column-drop-vertical-icon {\\n  color: var(--ag-secondary-foreground-color);\\n}\\n.ag-theme-balham .ag-ltr .ag-column-drop-vertical-empty-message, .ag-theme-balham-dark .ag-ltr .ag-column-drop-vertical-empty-message, .ag-theme-balham-auto-dark .ag-ltr .ag-column-drop-vertical-empty-message {\\n  padding-left: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\\n  padding-right: var(--ag-grid-size);\\n}\\n\\n.ag-theme-balham .ag-rtl .ag-column-drop-vertical-empty-message, .ag-theme-balham-dark .ag-rtl .ag-column-drop-vertical-empty-message, .ag-theme-balham-auto-dark .ag-rtl .ag-column-drop-vertical-empty-message {\\n  padding-right: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\\n  padding-left: var(--ag-gr";
      S = S + "id-size);\\n}\\n\\n.ag-theme-balham .ag-column-drop-horizontal,\\n.ag-theme-balham-dark .ag-column-drop-horizontal,\\n.ag-theme-balham-auto-dark .ag-column-drop-horizontal {\\n  height: var(--ag-header-height);\\n}\\n.ag-theme-balham .ag-column-drop-empty,\\n.ag-theme-balham-dark .ag-column-drop-empty,\\n.ag-theme-balham-auto-dark .ag-column-drop-empty {\\n  color: var(--ag-disabled-foreground-color);\\n}\\n.ag-theme-balham .ag-column-drop-horizontal-cell-text,\\n.ag-theme-balham-dark .ag-column-drop-horizontal-cell-text,\\n.ag-theme-balham-auto-dark .ag-column-drop-horizontal-cell-text {\\n  margin-left: calc(var(--ag-grid-size) * 2);\\n}\\n.ag-theme-balham .ag-column-drop-vertical,\\n.ag-theme-balham-dark .ag-column-drop-vertical,\\n.ag-theme-balham-auto-dark .ag-column-drop-vertical {\\n  padding-top: calc(var(--ag-grid-size) * 2);\\n}\\n.ag-theme-balham .ag-column-select-column-readonly.ag-icon-grip,\\n.ag-theme-balham .ag-column-select-column-readonly .ag-icon-grip,\\n.ag-theme-balham-dark .ag-column-select-column-readonly.ag-icon-grip,\\n.ag-theme-balham-dark .ag-column-select-column-readonly .ag-icon-grip,\\n.ag-theme-balham-auto-dark .ag-column-select-column-readonly.ag-icon-grip,\\n.ag-theme-balham-auto-dark .ag-column-select-column-readonly .ag-icon-grip {\\n  opacity: 0.35;\\n}\\n.ag-theme-balham .ag-menu-header,\\n.ag-theme-balham-dark .ag-menu-header,\\n.ag-theme-balham-auto-dark .ag-menu-header {\\n  background-color: var(--ag-header-background-color);\\n}\\n.ag-theme-balham .ag-overlay-loading-center,\\n.ag-theme-balham-dark .ag-overlay-loading-center,\\n.ag-theme-balham-auto-dark .ag-overlay-loading-center {\\n  background-color: var(--ag-background-color);\\n  border: 1px solid var(--ag-border-color);\\n  color: var(--ag-foreground-color);\\n  padding: calc(var(--ag-grid-size) * 4);\\n}\\n.ag-theme-balham .ag-tooltip,\\n.ag-theme-balham-dark .ag-tooltip,\\n.ag-theme-balham-auto-dark .ag-tooltip {\\n  border: none;\\n}\\n.ag-theme-balham .ag-panel-title-bar-button-icon,\\n.ag-theme-balham-dark .ag-p";
      S = S + 'anel-title-bar-button-icon,\\n.ag-theme-balham-auto-dark .ag-panel-title-bar-button-icon {\\n  font-size: calc(var(--ag-icon-size) + var(--ag-grid-size));\\n}\\n.ag-theme-balham .ag-panel,\\n.ag-theme-balham-dark .ag-panel,\\n.ag-theme-balham-auto-dark .ag-panel {\\n  background-color: var(--ag-header-background-color);\\n}\\n.ag-theme-balham .ag-chart-data-section,\\n.ag-theme-balham .ag-chart-format-section,\\n.ag-theme-balham .ag-chart-advanced-settings-section,\\n.ag-theme-balham-dark .ag-chart-data-section,\\n.ag-theme-balham-dark .ag-chart-format-section,\\n.ag-theme-balham-dark .ag-chart-advanced-settings-section,\\n.ag-theme-balham-auto-dark .ag-chart-data-section,\\n.ag-theme-balham-auto-dark .ag-chart-format-section,\\n.ag-theme-balham-auto-dark .ag-chart-advanced-settings-section {\\n  padding-bottom: calc(var(--ag-grid-size) * 0.5);\\n}\\n.ag-theme-balham .ag-group-toolbar,\\n.ag-theme-balham-dark .ag-group-toolbar,\\n.ag-theme-balham-auto-dark .ag-group-toolbar {\\n  background-color: var(--ag-subheader-toolbar-background-color);\\n}\\n.ag-theme-balham .ag-chart-tab,\\n.ag-theme-balham-dark .ag-chart-tab,\\n.ag-theme-balham-auto-dark .ag-chart-tab {\\n  padding-top: calc(var(--ag-grid-size) * 0.5);\\n}\\n.ag-theme-balham .ag-charts-format-sub-level-group-item,\\n.ag-theme-balham-dark .ag-charts-format-sub-level-group-item,\\n.ag-theme-balham-auto-dark .ag-charts-format-sub-level-group-item {\\n  margin-bottom: calc(var(--ag-grid-size) * 1.5);\\n}\\n.ag-theme-balham .ag-filter-active .ag-icon-filter,\\n.ag-theme-balham-dark .ag-filter-active .ag-icon-filter,\\n.ag-theme-balham-auto-dark .ag-filter-active .ag-icon-filter {\\n  color: var(--ag-balham-active-color);\\n}\\n.ag-theme-balham .ag-color-input input[class^=ag-][type=text].ag-input-field-input,\\n.ag-theme-balham-dark .ag-color-input input[class^=ag-][type=text].ag-input-field-input,\\n.ag-theme-balham-auto-dark .ag-color-input input[class^=ag-][type=text].ag-input-field-input {\\n  min-height: calc(var(--ag-icon-size) + 4px);\\n}\\n\',""]),t';
      S = S + '.A=g},8981:function(e,t,a){"use strict";var n=a(6758),o=a.n(n),r=a(935),i=a.n(r)()(o());i.push([e.id,\'.ag-theme-material,\\n.ag-theme-material-dark,\\n.ag-theme-material-auto-dark {\\n  --ag-material-primary-color: #3f51b5;\\n  --ag-material-accent-color: #ff4081;\\n  --ag-foreground-color: rgba(0, 0, 0, 0.87);\\n  --ag-secondary-foreground-color: rgba(0, 0, 0, 0.54);\\n  --ag-disabled-foreground-color: rgba(0, 0, 0, 0.38);\\n  --ag-background-color: #fff;\\n  --ag-header-background-color: #fff;\\n  --ag-tooltip-background-color: #fff;\\n  --ag-subheader-background-color: #eee;\\n  --ag-subheader-toolbar-background-color: rgba(238, 238, 238, 0.5);\\n  --ag-header-cell-hover-background-color: #f2f2f2;\\n  --ag-chip-background-color: #e2e2e2;\\n  --ag-range-selection-background-color: rgba(122, 134, 203, 0.1);\\n  --ag-range-selection-background-color-2: rgba(122, 134, 203, 0.19);\\n  --ag-range-selection-background-color-3: rgba(122, 134, 203, 0.27);\\n  --ag-range-selection-background-color-4: rgba(122, 134, 203, 0.34);\\n  --ag-range-selection-highlight-color: #fce4ec;\\n  --ag-row-hover-color: #fafafa;\\n  --ag-column-hover-color: #fafafa;\\n  --ag-control-panel-background-color: #fafafa;\\n  --ag-selected-row-background-color: rgba(33, 150, 243, 0.3);\\n  --ag-checkbox-unchecked-color: #333;\\n  --ag-value-change-value-highlight-background-color: #00acc1;\\n  --ag-side-button-selected-background-color: transparent;\\n  --ag-advanced-filter-join-pill-color: #f08e8d;\\n  --ag-advanced-filter-column-pill-color: #a6e194;\\n  --ag-advanced-filter-option-pill-color: #f3c08b;\\n  --ag-advanced-filter-value-pill-color: #85c0e4;\\n  --ag-range-selection-border-color: var(--ag-material-primary-color);\\n  --ag-checkbox-checked-color: var(--ag-material-accent-color);\\n  --ag-borders: none;\\n  --ag-borders-critical: solid 1px;\\n  --ag-border-color: #e2e2e2;\\n  --ag-grid-size: 8px;\\n  --ag-icon-size: 18px;\\n  --ag-header-height: calc(var(--ag-grid-size) * 7);\\n  --ag-row-height: calc(var(--ag-grid-size) * 6';
      S = S + ');\\n  --ag-cell-horizontal-padding: calc(var(--ag-grid-size) * 3);\\n  --ag-list-item-height: calc(var(--ag-grid-size) * 4);\\n  --ag-row-group-indent-size: calc(var(--ag-grid-size) * 3 + var(--ag-icon-size));\\n  --ag-filter-tool-panel-sub-level-row-height: calc(var(--ag-grid-size) * 4);\\n  --ag-checkbox-border-radius: 2px;\\n  --ag-toggle-button-switch-border-width: 2px;\\n  --ag-toggle-button-height: var(--ag-icon-size);\\n  --ag-widget-container-horizontal-padding: calc(var(--ag-grid-size) * 1.5);\\n  --ag-widget-container-vertical-padding: calc(var(--ag-grid-size) * 2);\\n  --ag-widget-vertical-spacing: calc(var(--ag-grid-size) * 1.75);\\n  --ag-font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Oxygen-Sans, Ubuntu, Cantarell,\\n      "Helvetica Neue", sans-serif;\\n  --ag-font-size: 13px;\\n  --ag-icon-font-family: agGridMaterial;\\n  --ag-selected-tab-underline-color: var(--ag-material-primary-color);\\n  --ag-selected-tab-underline-width: 2px;\\n  --ag-input-focus-border-color: var(--ag-material-primary-color);\\n  --ag-input-focus-box-shadow: 0 0 0 5px rgba(32, 33, 36, 0.122);\\n  --ag-card-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14),\\n      0 1px 5px 0 rgba(0, 0, 0, 0.12);\\n  --ag-card-radius: 2px;\\n  --ag-invalid-color: #e02525;\\n}\\n\\n.ag-theme-material-dark {\\n  --ag-material-primary-color: #3f51b5;\\n  --ag-material-accent-color: rgba(187,134,252,1);\\n  --ag-range-selection-border-color: var(--ag-material-accent-color);\\n  --ag-background-color: rgba(18,18,18,1);\\n  --ag-foreground-color: rgba(255,255,255,1);\\n  --ag-data-color: rgba(245,245,245,1);\\n  --ag-header-cell-hover-background-color: rgba(0,0,0,1);\\n  --ag-advanced-filter-join-pill-color: rgba(122,58,55,1);\\n  --ag-advanced-filter-column-pill-color: rgba(53,95,45,1);\\n  --ag-advanced-filter-option-pill-color: rgba(90,49,104,1);\\n  --ag-advanced-filter-value-pill-color: rgba(55,76,134,1);\\n  --ag-input-disabled-border-color: rgba(58,67,78,1);\\n  --ag-input-disabled-';
      S = S + "background-color: rgba(104,104,110,0.07059);\\n  --ag-selected-row-background-color: rgba(187,134,252,0.2);\\n  --ag-row-hover-color: rgba(187,134,252,0.2);\\n  --ag-column-hover-color: rgba(245,245,245,0.05098);\\n  --ag-range-selection-background-color: rgba(187,134,252,0.10196);\\n  --ag-range-selection-background-color-2: rgba(187,134,252,0.18824);\\n  --ag-range-selection-background-color-3: rgba(187,134,252,0.27059);\\n  --ag-range-selection-background-color-4: rgba(187,134,252,0.34118);\\n  --ag-border-color: rgba(56,56,56,1);\\n  --ag-secondary-border-color: rgba(56,56,56,1);\\n  --ag-header-background-color: rgba(18,18,18,1);\\n  --ag-tooltip-background-color: rgba(33,43,56,1);\\n  --ag-odd-row-background-color: rgba(18,18,18,1);\\n  --ag-control-panel-background-color: rgba(44,44,44,1);\\n  --ag-subheader-background-color: rgba(255,255,255,0.05098);\\n  --ag-subheader-toolbar-background-color: rgba(44,44,44,1);\\n  --ag-invalid-color: rgba(224,37,37,1);\\n  --ag-checkbox-unchecked-color: rgba(121,126,135,1);\\n  --ag-checkbox-background-color: rgba(18,18,18,1);\\n  --ag-secondary-foreground-color: rgba(245,245,245,1);\\n  --ag-input-border-color: rgba(56,56,56,1);\\n  --ag-input-border-color-invalid: rgba(224,37,37,1);\\n  --ag-disabled-foreground-color: rgba(245,245,245,0.50196);\\n  --ag-chip-background-color: rgba(34,38,40,0.07059);\\n  --ag-side-button-selected-background-color: rgba(44,44,44,1);\\n  --ag-selected-tab-underline-color: rgba(63,81,181,1);\\n  --ag-modal-overlay-background-color: rgba(18,18,18,0.65882);\\n  --ag-value-change-delta-up-color: rgba(67,160,71,0.65882);\\n  --ag-value-change-delta-down-color: rgba(229,57,53,1);\\n  --ag-menu-background-color: rgba(44,44,44,1);\\n  --ag-row-loading-skeleton-effect-color: rgba(202, 203, 204, 0.4);\\n  --csstools-color-scheme--dark: initial;\\n  color-scheme: dark;\\n}\\n\\n@media (prefers-color-scheme: dark) {\\n  .ag-theme-material-auto-dark {\\n    --ag-material-primary-color: #3f51b5;\\n    --ag-material-accent-color: rgba(187,13";
      S = S + "4,252,1);\\n    --ag-range-selection-border-color: var(--ag-material-accent-color);\\n    --ag-background-color: rgba(18,18,18,1);\\n    --ag-foreground-color: rgba(255,255,255,1);\\n    --ag-data-color: rgba(245,245,245,1);\\n    --ag-header-cell-hover-background-color: rgba(0,0,0,1);\\n    --ag-advanced-filter-join-pill-color: rgba(122,58,55,1);\\n    --ag-advanced-filter-column-pill-color: rgba(53,95,45,1);\\n    --ag-advanced-filter-option-pill-color: rgba(90,49,104,1);\\n    --ag-advanced-filter-value-pill-color: rgba(55,76,134,1);\\n    --ag-input-disabled-border-color: rgba(58,67,78,1);\\n    --ag-input-disabled-background-color: rgba(104,104,110,0.07059);\\n    --ag-selected-row-background-color: rgba(187,134,252,0.2);\\n    --ag-row-hover-color: rgba(187,134,252,0.2);\\n    --ag-column-hover-color: rgba(245,245,245,0.05098);\\n    --ag-range-selection-background-color: rgba(187,134,252,0.10196);\\n    --ag-range-selection-background-color-2: rgba(187,134,252,0.18824);\\n    --ag-range-selection-background-color-3: rgba(187,134,252,0.27059);\\n    --ag-range-selection-background-color-4: rgba(187,134,252,0.34118);\\n    --ag-border-color: rgba(56,56,56,1);\\n    --ag-secondary-border-color: rgba(56,56,56,1);\\n    --ag-header-background-color: rgba(18,18,18,1);\\n    --ag-tooltip-background-color: rgba(33,43,56,1);\\n    --ag-odd-row-background-color: rgba(18,18,18,1);\\n    --ag-control-panel-background-color: rgba(44,44,44,1);\\n    --ag-subheader-background-color: rgba(255,255,255,0.05098);\\n    --ag-subheader-toolbar-background-color: rgba(44,44,44,1);\\n    --ag-invalid-color: rgba(224,37,37,1);\\n    --ag-checkbox-unchecked-color: rgba(121,126,135,1);\\n    --ag-checkbox-background-color: rgba(18,18,18,1);\\n    --ag-secondary-foreground-color: rgba(245,245,245,1);\\n    --ag-input-border-color: rgba(56,56,56,1);\\n    --ag-input-border-color-invalid: rgba(224,37,37,1);\\n    --ag-disabled-foreground-color: rgba(245,245,245,0.50196);\\n    --ag-chip-background-color: rgba(34,38,40,0.0";
      S = S + "7059);\\n    --ag-side-button-selected-background-color: rgba(44,44,44,1);\\n    --ag-selected-tab-underline-color: rgba(63,81,181,1);\\n    --ag-modal-overlay-background-color: rgba(18,18,18,0.65882);\\n    --ag-value-change-delta-up-color: rgba(67,160,71,0.65882);\\n    --ag-value-change-delta-down-color: rgba(229,57,53,1);\\n    --ag-menu-background-color: rgba(44,44,44,1);\\n    --ag-row-loading-skeleton-effect-color: rgba(202, 203, 204, 0.4);\\n    --csstools-color-scheme--dark: initial;\\n    color-scheme: dark;\\n  }\\n}\\n.ag-theme-material .ag-filter-toolpanel-header,\\n.ag-theme-material .ag-filter-toolpanel-search,\\n.ag-theme-material .ag-status-bar,\\n.ag-theme-material .ag-header-row,\\n.ag-theme-material .ag-panel-title-bar-title,\\n.ag-theme-material .ag-multi-filter-group-title-bar,\\n.ag-theme-material-dark .ag-filter-toolpanel-header,\\n.ag-theme-material-dark .ag-filter-toolpanel-search,\\n.ag-theme-material-dark .ag-status-bar,\\n.ag-theme-material-dark .ag-header-row,\\n.ag-theme-material-dark .ag-panel-title-bar-title,\\n.ag-theme-material-dark .ag-multi-filter-group-title-bar,\\n.ag-theme-material-auto-dark .ag-filter-toolpanel-header,\\n.ag-theme-material-auto-dark .ag-filter-toolpanel-search,\\n.ag-theme-material-auto-dark .ag-status-bar,\\n.ag-theme-material-auto-dark .ag-header-row,\\n.ag-theme-material-auto-dark .ag-panel-title-bar-title,\\n.ag-theme-material-auto-dark .ag-multi-filter-group-title-bar {\\n  font-size: calc(var(--ag-font-size) - 1px);\\n  font-weight: 600;\\n  color: var(--ag-header-foreground-color);\\n}\\n.ag-theme-material .ag-tab,\\n.ag-theme-material-dark .ag-tab,\\n.ag-theme-material-auto-dark .ag-tab {\\n  height: calc(var(--ag-grid-size) * 4.5);\\n  flex: 1 1 auto;\\n}\\n.ag-theme-material .ag-tabs-header,\\n.ag-theme-material .ag-column-drop-horizontal,\\n.ag-theme-material-dark .ag-tabs-header,\\n.ag-theme-material-dark .ag-column-drop-horizontal,\\n.ag-theme-material-auto-dark .ag-tabs-header,\\n.ag-theme-material-auto-dark .ag-column-drop-horizontal {\\n ";
      S = S + " background-color: var(--ag-subheader-background-color);\\n}\\n.ag-theme-material .ag-tabs-body,\\n.ag-theme-material-dark .ag-tabs-body,\\n.ag-theme-material-auto-dark .ag-tabs-body {\\n  padding: calc(var(--ag-grid-size) * 0.5) 0;\\n}\\n.ag-theme-material .ag-tabs-body .ag-menu-list,\\n.ag-theme-material-dark .ag-tabs-body .ag-menu-list,\\n.ag-theme-material-auto-dark .ag-tabs-body .ag-menu-list {\\n  padding-top: 0;\\n  padding-bottom: 0;\\n}\\n.ag-theme-material .ag-header-cell,\\n.ag-theme-material .ag-header-group-cell,\\n.ag-theme-material-dark .ag-header-cell,\\n.ag-theme-material-dark .ag-header-group-cell,\\n.ag-theme-material-auto-dark .ag-header-cell,\\n.ag-theme-material-auto-dark .ag-header-group-cell {\\n  transition: background-color 0.5s;\\n}\\n.ag-theme-material .ag-row-last:not(.ag-row-first) .ag-cell-inline-editing,\\n.ag-theme-material-dark .ag-row-last:not(.ag-row-first) .ag-cell-inline-editing,\\n.ag-theme-material-auto-dark .ag-row-last:not(.ag-row-first) .ag-cell-inline-editing {\\n  bottom: 0;\\n}\\n.ag-theme-material .ag-cell-inline-editing,\\n.ag-theme-material-dark .ag-cell-inline-editing,\\n.ag-theme-material-auto-dark .ag-cell-inline-editing {\\n  padding: var(--ag-grid-size);\\n  height: calc(var(--ag-row-height) + var(--ag-grid-size) * 3);\\n  border-color: var(--ag-border-color) !important;\\n}\\n.ag-theme-material .ag-has-focus .ag-cell-inline-editing,\\n.ag-theme-material-dark .ag-has-focus .ag-cell-inline-editing,\\n.ag-theme-material-auto-dark .ag-has-focus .ag-cell-inline-editing {\\n  border-color: var(--ag-input-focus-border-color) !important;\\n}\\n.ag-theme-material .ag-column-drop-vertical,\\n.ag-theme-material-dark .ag-column-drop-vertical,\\n.ag-theme-material-auto-dark .ag-column-drop-vertical {\\n  border-bottom: solid 1px;\\n  border-bottom-color: var(--ag-border-color);\\n  padding-top: var(--ag-grid-size);\\n}\\n.ag-theme-material .ag-column-drop-vertical.ag-last-column-drop,\\n.ag-theme-material-dark .ag-column-drop-vertical.ag-last-column-drop,\\n.ag-theme-mat";
      S = S + "erial-auto-dark .ag-column-drop-vertical.ag-last-column-drop {\\n  border-bottom: none;\\n}\\n.ag-theme-material .ag-column-drop-vertical-cell,\\n.ag-theme-material-dark .ag-column-drop-vertical-cell,\\n.ag-theme-material-auto-dark .ag-column-drop-vertical-cell {\\n  margin-left: 0;\\n}\\n.ag-theme-material .ag-column-drop-vertical-empty-message,\\n.ag-theme-material-dark .ag-column-drop-vertical-empty-message,\\n.ag-theme-material-auto-dark .ag-column-drop-vertical-empty-message {\\n  font-size: calc(var(--ag-font-size) - 1px);\\n  font-weight: 600;\\n  color: var(--ag-disabled-foreground-color);\\n}\\n.ag-theme-material .ag-ltr .ag-column-drop-vertical-empty-message, .ag-theme-material-dark .ag-ltr .ag-column-drop-vertical-empty-message, .ag-theme-material-auto-dark .ag-ltr .ag-column-drop-vertical-empty-message {\\n  padding-left: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\\n  padding-right: var(--ag-grid-size);\\n}\\n\\n.ag-theme-material .ag-rtl .ag-column-drop-vertical-empty-message, .ag-theme-material-dark .ag-rtl .ag-column-drop-vertical-empty-message, .ag-theme-material-auto-dark .ag-rtl .ag-column-drop-vertical-empty-message {\\n  padding-right: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\\n  padding-left: var(--ag-grid-size);\\n}\\n\\n.ag-theme-material .ag-status-bar,\\n.ag-theme-material-dark .ag-status-bar,\\n.ag-theme-material-auto-dark .ag-status-bar {\\n  border: solid 1px;\\n  border-color: var(--ag-border-color);\\n}\\n.ag-theme-material .ag-column-panel-column-select,\\n.ag-theme-material-dark .ag-column-panel-column-select,\\n.ag-theme-material-auto-dark .ag-column-panel-column-select {\\n  border-top: solid 1px;\\n  border-top-color: var(--ag-border-color);\\n}\\n.ag-theme-material .ag-column-select,\\n.ag-theme-material .ag-column-select-header,\\n.ag-theme-material-dark .ag-column-select,\\n.ag-theme-material-dark .ag-column-select-header,\\n.ag-theme-material-auto-dark .ag-column-select,\\n.ag-theme-material-auto-dark .ag-column-select-header {\\n  border-bottom: s";
      S = S + "olid 1px;\\n  border-bottom-color: var(--ag-border-color);\\n}\\n.ag-theme-material .ag-column-select-header,\\n.ag-theme-material-dark .ag-column-select-header,\\n.ag-theme-material-auto-dark .ag-column-select-header {\\n  height: var(--ag-header-height);\\n}\\n.ag-theme-material .ag-group-title-bar,\\n.ag-theme-material-dark .ag-group-title-bar,\\n.ag-theme-material-auto-dark .ag-group-title-bar {\\n  padding: calc(var(--ag-grid-size) * 0.75) var(--ag-grid-size);\\n}\\n.ag-theme-material .ag-charts-format-sub-level-group-title-bar,\\n.ag-theme-material-dark .ag-charts-format-sub-level-group-title-bar,\\n.ag-theme-material-auto-dark .ag-charts-format-sub-level-group-title-bar {\\n  padding: calc(var(--ag-grid-size) * 0.5) var(--ag-grid-size);\\n}\\n.ag-theme-material .ag-chart-data-section,\\n.ag-theme-material .ag-chart-format-section,\\n.ag-theme-material .ag-chart-advanced-settings-section,\\n.ag-theme-material-dark .ag-chart-data-section,\\n.ag-theme-material-dark .ag-chart-format-section,\\n.ag-theme-material-dark .ag-chart-advanced-settings-section,\\n.ag-theme-material-auto-dark .ag-chart-data-section,\\n.ag-theme-material-auto-dark .ag-chart-format-section,\\n.ag-theme-material-auto-dark .ag-chart-advanced-settings-section {\\n  padding-bottom: calc(var(--ag-grid-size) * 0.5);\\n}\\n.ag-theme-material input[class^=ag-]:not([type]),\\n.ag-theme-material input[class^=ag-][type=text],\\n.ag-theme-material input[class^=ag-][type=number],\\n.ag-theme-material input[class^=ag-][type=tel],\\n.ag-theme-material input[class^=ag-][type=date],\\n.ag-theme-material input[class^=ag-][type=datetime-local],\\n.ag-theme-material textarea[class^=ag-],\\n.ag-theme-material-dark input[class^=ag-]:not([type]),\\n.ag-theme-material-dark input[class^=ag-][type=text],\\n.ag-theme-material-dark input[class^=ag-][type=number],\\n.ag-theme-material-dark input[class^=ag-][type=tel],\\n.ag-theme-material-dark input[class^=ag-][type=date],\\n.ag-theme-material-dark input[class^=ag-][type=datetime-local],\\n.ag-theme-material-d";
      S = S + "ark textarea[class^=ag-],\\n.ag-theme-material-auto-dark input[class^=ag-]:not([type]),\\n.ag-theme-material-auto-dark input[class^=ag-][type=text],\\n.ag-theme-material-auto-dark input[class^=ag-][type=number],\\n.ag-theme-material-auto-dark input[class^=ag-][type=tel],\\n.ag-theme-material-auto-dark input[class^=ag-][type=date],\\n.ag-theme-material-auto-dark input[class^=ag-][type=datetime-local],\\n.ag-theme-material-auto-dark textarea[class^=ag-] {\\n  background: transparent;\\n  color: var(--ag-foreground-color);\\n  font-family: inherit;\\n  font-size: inherit;\\n  height: calc(var(--ag-grid-size) * 5);\\n  padding-bottom: var(--ag-grid-size);\\n  border-width: 0;\\n  border-radius: 0;\\n  border-bottom: 2px solid;\\n  border-bottom-color: var(--ag-border-color);\\n}\\n.ag-theme-material input[class^=ag-]:not([type]):focus,\\n.ag-theme-material input[class^=ag-][type=text]:focus,\\n.ag-theme-material input[class^=ag-][type=number]:focus,\\n.ag-theme-material input[class^=ag-][type=tel]:focus,\\n.ag-theme-material input[class^=ag-][type=date]:focus,\\n.ag-theme-material input[class^=ag-][type=datetime-local]:focus,\\n.ag-theme-material textarea[class^=ag-]:focus,\\n.ag-theme-material-dark input[class^=ag-]:not([type]):focus,\\n.ag-theme-material-dark input[class^=ag-][type=text]:focus,\\n.ag-theme-material-dark input[class^=ag-][type=number]:focus,\\n.ag-theme-material-dark input[class^=ag-][type=tel]:focus,\\n.ag-theme-material-dark input[class^=ag-][type=date]:focus,\\n.ag-theme-material-dark input[class^=ag-][type=datetime-local]:focus,\\n.ag-theme-material-dark textarea[class^=ag-]:focus,\\n.ag-theme-material-auto-dark input[class^=ag-]:not([type]):focus,\\n.ag-theme-material-auto-dark input[class^=ag-][type=text]:focus,\\n.ag-theme-material-auto-dark input[class^=ag-][type=number]:focus,\\n.ag-theme-material-auto-dark input[class^=ag-][type=tel]:focus,\\n.ag-theme-material-auto-dark input[class^=ag-][type=date]:focus,\\n.ag-theme-material-auto-dark input[class^=ag-][type=datetime-local]:focu";
      S = S + "s,\\n.ag-theme-material-auto-dark textarea[class^=ag-]:focus {\\n  border-bottom: 2px solid;\\n  border-bottom-color: var(--ag-material-primary-color);\\n  outline: none;\\n  box-shadow: none;\\n}\\n.ag-theme-material input[class^=ag-]:not([type])::-moz-placeholder, .ag-theme-material input[class^=ag-][type=text]::-moz-placeholder, .ag-theme-material input[class^=ag-][type=number]::-moz-placeholder, .ag-theme-material input[class^=ag-][type=tel]::-moz-placeholder, .ag-theme-material input[class^=ag-][type=date]::-moz-placeholder, .ag-theme-material input[class^=ag-][type=datetime-local]::-moz-placeholder, .ag-theme-material textarea[class^=ag-]::-moz-placeholder, .ag-theme-material-dark input[class^=ag-]:not([type])::-moz-placeholder, .ag-theme-material-dark input[class^=ag-][type=text]::-moz-placeholder, .ag-theme-material-dark input[class^=ag-][type=number]::-moz-placeholder, .ag-theme-material-dark input[class^=ag-][type=tel]::-moz-placeholder, .ag-theme-material-dark input[class^=ag-][type=date]::-moz-placeholder, .ag-theme-material-dark input[class^=ag-][type=datetime-local]::-moz-placeholder, .ag-theme-material-dark textarea[class^=ag-]::-moz-placeholder, .ag-theme-material-auto-dark input[class^=ag-]:not([type])::-moz-placeholder, .ag-theme-material-auto-dark input[class^=ag-][type=text]::-moz-placeholder, .ag-theme-material-auto-dark input[class^=ag-][type=number]::-moz-placeholder, .ag-theme-material-auto-dark input[class^=ag-][type=tel]::-moz-placeholder, .ag-theme-material-auto-dark input[class^=ag-][type=date]::-moz-placeholder, .ag-theme-material-auto-dark input[class^=ag-][type=datetime-local]::-moz-placeholder, .ag-theme-material-auto-dark textarea[class^=ag-]::-moz-placeholder {\\n  color: var(--ag-disabled-foreground-color);\\n}\\n.ag-theme-material input[class^=ag-]:not([type])::placeholder,\\n.ag-theme-material input[class^=ag-][type=text]::placeholder,\\n.ag-theme-material input[class^=ag-][type=number]::placeholder,\\n.ag-theme-material input[class^=ag-][typ";
      S = S + "e=tel]::placeholder,\\n.ag-theme-material input[class^=ag-][type=date]::placeholder,\\n.ag-theme-material input[class^=ag-][type=datetime-local]::placeholder,\\n.ag-theme-material textarea[class^=ag-]::placeholder,\\n.ag-theme-material-dark input[class^=ag-]:not([type])::placeholder,\\n.ag-theme-material-dark input[class^=ag-][type=text]::placeholder,\\n.ag-theme-material-dark input[class^=ag-][type=number]::placeholder,\\n.ag-theme-material-dark input[class^=ag-][type=tel]::placeholder,\\n.ag-theme-material-dark input[class^=ag-][type=date]::placeholder,\\n.ag-theme-material-dark input[class^=ag-][type=datetime-local]::placeholder,\\n.ag-theme-material-dark textarea[class^=ag-]::placeholder,\\n.ag-theme-material-auto-dark input[class^=ag-]:not([type])::placeholder,\\n.ag-theme-material-auto-dark input[class^=ag-][type=text]::placeholder,\\n.ag-theme-material-auto-dark input[class^=ag-][type=number]::placeholder,\\n.ag-theme-material-auto-dark input[class^=ag-][type=tel]::placeholder,\\n.ag-theme-material-auto-dark input[class^=ag-][type=date]::placeholder,\\n.ag-theme-material-auto-dark input[class^=ag-][type=datetime-local]::placeholder,\\n.ag-theme-material-auto-dark textarea[class^=ag-]::placeholder {\\n  color: var(--ag-disabled-foreground-color);\\n}\\n.ag-theme-material input[class^=ag-]:not([type]):disabled,\\n.ag-theme-material input[class^=ag-][type=text]:disabled,\\n.ag-theme-material input[class^=ag-][type=number]:disabled,\\n.ag-theme-material input[class^=ag-][type=tel]:disabled,\\n.ag-theme-material input[class^=ag-][type=date]:disabled,\\n.ag-theme-material input[class^=ag-][type=datetime-local]:disabled,\\n.ag-theme-material textarea[class^=ag-]:disabled,\\n.ag-theme-material-dark input[class^=ag-]:not([type]):disabled,\\n.ag-theme-material-dark input[class^=ag-][type=text]:disabled,\\n.ag-theme-material-dark input[class^=ag-][type=number]:disabled,\\n.ag-theme-material-dark input[class^=ag-][type=tel]:disabled,\\n.ag-theme-material-dark input[class^=ag-][type=date]:disabled,\\n.a";
      S = S + "g-theme-material-dark input[class^=ag-][type=datetime-local]:disabled,\\n.ag-theme-material-dark textarea[class^=ag-]:disabled,\\n.ag-theme-material-auto-dark input[class^=ag-]:not([type]):disabled,\\n.ag-theme-material-auto-dark input[class^=ag-][type=text]:disabled,\\n.ag-theme-material-auto-dark input[class^=ag-][type=number]:disabled,\\n.ag-theme-material-auto-dark input[class^=ag-][type=tel]:disabled,\\n.ag-theme-material-auto-dark input[class^=ag-][type=date]:disabled,\\n.ag-theme-material-auto-dark input[class^=ag-][type=datetime-local]:disabled,\\n.ag-theme-material-auto-dark textarea[class^=ag-]:disabled {\\n  border-bottom: 1px solid;\\n  border-bottom-color: var(--ag-border-color);\\n}\\n.ag-theme-material input[class^=ag-]:not([type]):invalid,\\n.ag-theme-material input[class^=ag-][type=text]:invalid,\\n.ag-theme-material input[class^=ag-][type=number]:invalid,\\n.ag-theme-material input[class^=ag-][type=tel]:invalid,\\n.ag-theme-material input[class^=ag-][type=date]:invalid,\\n.ag-theme-material input[class^=ag-][type=datetime-local]:invalid,\\n.ag-theme-material textarea[class^=ag-]:invalid,\\n.ag-theme-material-dark input[class^=ag-]:not([type]):invalid,\\n.ag-theme-material-dark input[class^=ag-][type=text]:invalid,\\n.ag-theme-material-dark input[class^=ag-][type=number]:invalid,\\n.ag-theme-material-dark input[class^=ag-][type=tel]:invalid,\\n.ag-theme-material-dark input[class^=ag-][type=date]:invalid,\\n.ag-theme-material-dark input[class^=ag-][type=datetime-local]:invalid,\\n.ag-theme-material-dark textarea[class^=ag-]:invalid,\\n.ag-theme-material-auto-dark input[class^=ag-]:not([type]):invalid,\\n.ag-theme-material-auto-dark input[class^=ag-][type=text]:invalid,\\n.ag-theme-material-auto-dark input[class^=ag-][type=number]:invalid,\\n.ag-theme-material-auto-dark input[class^=ag-][type=tel]:invalid,\\n.ag-theme-material-auto-dark input[class^=ag-][type=date]:invalid,\\n.ag-theme-material-auto-dark input[class^=ag-][type=datetime-local]:invalid,\\n.ag-theme-material-auto-dark ";
      S = S + "textarea[class^=ag-]:invalid {\\n  border-width: 0;\\n  border-bottom: 1px solid;\\n  border-bottom-color: var(--ag-invalid-color);\\n  color: var(--ag-invalid-color);\\n}\\n.ag-theme-material .ag-standard-button,\\n.ag-theme-material-dark .ag-standard-button,\\n.ag-theme-material-auto-dark .ag-standard-button {\\n  -webkit-appearance: none;\\n     -moz-appearance: none;\\n          appearance: none;\\n  background-color: transparent;\\n  border: 0;\\n  color: var(--ag-material-primary-color);\\n  font-family: inherit;\\n  font-size: inherit;\\n  margin: 0;\\n  padding: 0;\\n  text-transform: uppercase;\\n}\\n.ag-theme-material .ag-standard-button:disabled,\\n.ag-theme-material-dark .ag-standard-button:disabled,\\n.ag-theme-material-auto-dark .ag-standard-button:disabled {\\n  color: var(--ag-disabled-foreground-color);\\n  background-color: var(--ag-input-disabled-background-color);\\n  border-color: var(--ag-input-disabled-border-color);\\n}\\n.ag-theme-material.ag-dnd-ghost,\\n.ag-theme-material-dark.ag-dnd-ghost,\\n.ag-theme-material-auto-dark.ag-dnd-ghost {\\n  font-size: calc(var(--ag-font-size) - 1px);\\n  font-weight: 600;\\n}\\n.ag-theme-material .ag-filter-toolpanel-header,\\n.ag-theme-material-dark .ag-filter-toolpanel-header,\\n.ag-theme-material-auto-dark .ag-filter-toolpanel-header {\\n  height: calc(var(--ag-grid-size) * 4);\\n}\\n.ag-theme-material .ag-filter-toolpanel-group-level-0-header,\\n.ag-theme-material-dark .ag-filter-toolpanel-group-level-0-header,\\n.ag-theme-material-auto-dark .ag-filter-toolpanel-group-level-0-header {\\n  height: calc(var(--ag-grid-size) * 7);\\n}\\n.ag-theme-material .ag-ltr .ag-filter-apply-panel-button, .ag-theme-material .ag-ltr .ag-advanced-filter-apply-button, .ag-theme-material .ag-ltr .ag-advanced-filter-builder-button, .ag-theme-material-dark .ag-ltr .ag-filter-apply-panel-button, .ag-theme-material-dark .ag-ltr .ag-advanced-filter-apply-button, .ag-theme-material-dark .ag-ltr .ag-advanced-filter-builder-button, .ag-theme-material-auto-dark .ag-ltr .ag-f";
      S = S + "ilter-apply-panel-button, .ag-theme-material-auto-dark .ag-ltr .ag-advanced-filter-apply-button, .ag-theme-material-auto-dark .ag-ltr .ag-advanced-filter-builder-button {\\n  margin-left: var(--ag-grid-size);\\n}\\n\\n.ag-theme-material .ag-rtl .ag-filter-apply-panel-button, .ag-theme-material .ag-rtl .ag-advanced-filter-apply-button, .ag-theme-material .ag-rtl .ag-advanced-filter-builder-button, .ag-theme-material-dark .ag-rtl .ag-filter-apply-panel-button, .ag-theme-material-dark .ag-rtl .ag-advanced-filter-apply-button, .ag-theme-material-dark .ag-rtl .ag-advanced-filter-builder-button, .ag-theme-material-auto-dark .ag-rtl .ag-filter-apply-panel-button, .ag-theme-material-auto-dark .ag-rtl .ag-advanced-filter-apply-button, .ag-theme-material-auto-dark .ag-rtl .ag-advanced-filter-builder-button {\\n  margin-right: var(--ag-grid-size);\\n}\\n\\n.ag-theme-material .ag-layout-auto-height .ag-center-cols-viewport,\\n.ag-theme-material .ag-layout-auto-height .ag-center-cols-container,\\n.ag-theme-material .ag-layout-print .ag-center-cols-viewport,\\n.ag-theme-material .ag-layout-print .ag-center-cols-container,\\n.ag-theme-material-dark .ag-layout-auto-height .ag-center-cols-viewport,\\n.ag-theme-material-dark .ag-layout-auto-height .ag-center-cols-container,\\n.ag-theme-material-dark .ag-layout-print .ag-center-cols-viewport,\\n.ag-theme-material-dark .ag-layout-print .ag-center-cols-container,\\n.ag-theme-material-auto-dark .ag-layout-auto-height .ag-center-cols-viewport,\\n.ag-theme-material-auto-dark .ag-layout-auto-height .ag-center-cols-container,\\n.ag-theme-material-auto-dark .ag-layout-print .ag-center-cols-viewport,\\n.ag-theme-material-auto-dark .ag-layout-print .ag-center-cols-container {\\n  min-height: 150px;\\n}\\n.ag-theme-material .ag-overlay-no-rows-wrapper.ag-layout-auto-height,\\n.ag-theme-material-dark .ag-overlay-no-rows-wrapper.ag-layout-auto-height,\\n.ag-theme-material-auto-dark .ag-overlay-no-rows-wrapper.ag-layout-auto-height {\\n  padding-top: 60px;\\n}\\n.ag-theme-ma";
      S = S + 'terial .ag-picker-field-wrapper:focus-within,\\n.ag-theme-material-dark .ag-picker-field-wrapper:focus-within,\\n.ag-theme-material-auto-dark .ag-picker-field-wrapper:focus-within {\\n  box-shadow: 0 0 0 1px var(--ag-material-primary-color);\\n}\\n.ag-theme-material .ag-rich-select-list,\\n.ag-theme-material-dark .ag-rich-select-list,\\n.ag-theme-material-auto-dark .ag-rich-select-list {\\n  box-shadow: rgba(0, 0, 0, 0.2) 0px 5px 5px -3px, rgba(0, 0, 0, 0.14) 0px 8px 10px 1px, rgba(0, 0, 0, 0.12) 0px 3px 14px 2px;\\n}\\n.ag-theme-material .ag-advanced-filter-builder-button-label,\\n.ag-theme-material-dark .ag-advanced-filter-builder-button-label,\\n.ag-theme-material-auto-dark .ag-advanced-filter-builder-button-label {\\n  text-transform: uppercase;\\n}\\n.ag-theme-material .ag-filter-active .ag-icon-filter,\\n.ag-theme-material-dark .ag-filter-active .ag-icon-filter,\\n.ag-theme-material-auto-dark .ag-filter-active .ag-icon-filter {\\n  color: var(--ag-material-accent-color);\\n}\\n\',""]),t.A=i},2935:function(e,t,a){"use strict";var n=a(6758),o=a.n(n),r=a(935),i=a.n(r),s=a(62),l=a.n(s),c=new URL(a(6055),a.b),g=i()(o()),d=l()(c);g.push([e.id,\'@font-face {\\n  font-family: "agGridMaterial";\\n  src: url(\'+d+\');\\n  font-weight: normal;\\n  font-style: normal;\\n}\\n.ag-theme-material,\\n.ag-theme-material-dark,\\n.ag-theme-material-auto-dark {\\n  --ag-material-primary-color: #3f51b5;\\n  --ag-material-accent-color: #ff4081;\\n  --ag-foreground-color: rgba(0, 0, 0, 0.87);\\n  --ag-secondary-foreground-color: rgba(0, 0, 0, 0.54);\\n  --ag-disabled-foreground-color: rgba(0, 0, 0, 0.38);\\n  --ag-background-color: #fff;\\n  --ag-header-background-color: #fff;\\n  --ag-tooltip-background-color: #fff;\\n  --ag-subheader-background-color: #eee;\\n  --ag-subheader-toolbar-background-color: rgba(238, 238, 238, 0.5);\\n  --ag-header-cell-hover-background-color: #f2f2f2;\\n  --ag-chip-background-color: #e2e2e2;\\n  --ag-range-selection-background-color: rgba(122, 134, 203, 0.1);\\n  --ag-range-selection-background-col';
      S = S + 'or-2: rgba(122, 134, 203, 0.19);\\n  --ag-range-selection-background-color-3: rgba(122, 134, 203, 0.27);\\n  --ag-range-selection-background-color-4: rgba(122, 134, 203, 0.34);\\n  --ag-range-selection-highlight-color: #fce4ec;\\n  --ag-row-hover-color: #fafafa;\\n  --ag-column-hover-color: #fafafa;\\n  --ag-control-panel-background-color: #fafafa;\\n  --ag-selected-row-background-color: rgba(33, 150, 243, 0.3);\\n  --ag-checkbox-unchecked-color: #333;\\n  --ag-value-change-value-highlight-background-color: #00acc1;\\n  --ag-side-button-selected-background-color: transparent;\\n  --ag-advanced-filter-join-pill-color: #f08e8d;\\n  --ag-advanced-filter-column-pill-color: #a6e194;\\n  --ag-advanced-filter-option-pill-color: #f3c08b;\\n  --ag-advanced-filter-value-pill-color: #85c0e4;\\n  --ag-range-selection-border-color: var(--ag-material-primary-color);\\n  --ag-checkbox-checked-color: var(--ag-material-accent-color);\\n  --ag-borders: none;\\n  --ag-borders-critical: solid 1px;\\n  --ag-border-color: #e2e2e2;\\n  --ag-grid-size: 8px;\\n  --ag-icon-size: 18px;\\n  --ag-header-height: calc(var(--ag-grid-size) * 7);\\n  --ag-row-height: calc(var(--ag-grid-size) * 6);\\n  --ag-cell-horizontal-padding: calc(var(--ag-grid-size) * 3);\\n  --ag-list-item-height: calc(var(--ag-grid-size) * 4);\\n  --ag-row-group-indent-size: calc(var(--ag-grid-size) * 3 + var(--ag-icon-size));\\n  --ag-filter-tool-panel-sub-level-row-height: calc(var(--ag-grid-size) * 4);\\n  --ag-checkbox-border-radius: 2px;\\n  --ag-toggle-button-switch-border-width: 2px;\\n  --ag-toggle-button-height: var(--ag-icon-size);\\n  --ag-widget-container-horizontal-padding: calc(var(--ag-grid-size) * 1.5);\\n  --ag-widget-container-vertical-padding: calc(var(--ag-grid-size) * 2);\\n  --ag-widget-vertical-spacing: calc(var(--ag-grid-size) * 1.75);\\n  --ag-font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Oxygen-Sans, Ubuntu, Cantarell,\\n      "Helvetica Neue", sans-serif;\\n  --ag-font-size: 13px;\\n  --ag-icon-font-family: agGri';
      S = S + "dMaterial;\\n  --ag-selected-tab-underline-color: var(--ag-material-primary-color);\\n  --ag-selected-tab-underline-width: 2px;\\n  --ag-input-focus-border-color: var(--ag-material-primary-color);\\n  --ag-input-focus-box-shadow: 0 0 0 5px rgba(32, 33, 36, 0.122);\\n  --ag-card-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14),\\n      0 1px 5px 0 rgba(0, 0, 0, 0.12);\\n  --ag-card-radius: 2px;\\n  --ag-invalid-color: #e02525;\\n}\\n\\n.ag-theme-material-dark {\\n  --ag-material-primary-color: #3f51b5;\\n  --ag-material-accent-color: rgba(187,134,252,1);\\n  --ag-range-selection-border-color: var(--ag-material-accent-color);\\n  --ag-background-color: rgba(18,18,18,1);\\n  --ag-foreground-color: rgba(255,255,255,1);\\n  --ag-data-color: rgba(245,245,245,1);\\n  --ag-header-cell-hover-background-color: rgba(0,0,0,1);\\n  --ag-advanced-filter-join-pill-color: rgba(122,58,55,1);\\n  --ag-advanced-filter-column-pill-color: rgba(53,95,45,1);\\n  --ag-advanced-filter-option-pill-color: rgba(90,49,104,1);\\n  --ag-advanced-filter-value-pill-color: rgba(55,76,134,1);\\n  --ag-input-disabled-border-color: rgba(58,67,78,1);\\n  --ag-input-disabled-background-color: rgba(104,104,110,0.07059);\\n  --ag-selected-row-background-color: rgba(187,134,252,0.2);\\n  --ag-row-hover-color: rgba(187,134,252,0.2);\\n  --ag-column-hover-color: rgba(245,245,245,0.05098);\\n  --ag-range-selection-background-color: rgba(187,134,252,0.10196);\\n  --ag-range-selection-background-color-2: rgba(187,134,252,0.18824);\\n  --ag-range-selection-background-color-3: rgba(187,134,252,0.27059);\\n  --ag-range-selection-background-color-4: rgba(187,134,252,0.34118);\\n  --ag-border-color: rgba(56,56,56,1);\\n  --ag-secondary-border-color: rgba(56,56,56,1);\\n  --ag-header-background-color: rgba(18,18,18,1);\\n  --ag-tooltip-background-color: rgba(33,43,56,1);\\n  --ag-odd-row-background-color: rgba(18,18,18,1);\\n  --ag-control-panel-background-color: rgba(44,44,44,1);\\n  --ag-subheader-background-color: rgba(255,255";
      S = S + ",255,0.05098);\\n  --ag-subheader-toolbar-background-color: rgba(44,44,44,1);\\n  --ag-invalid-color: rgba(224,37,37,1);\\n  --ag-checkbox-unchecked-color: rgba(121,126,135,1);\\n  --ag-checkbox-background-color: rgba(18,18,18,1);\\n  --ag-secondary-foreground-color: rgba(245,245,245,1);\\n  --ag-input-border-color: rgba(56,56,56,1);\\n  --ag-input-border-color-invalid: rgba(224,37,37,1);\\n  --ag-disabled-foreground-color: rgba(245,245,245,0.50196);\\n  --ag-chip-background-color: rgba(34,38,40,0.07059);\\n  --ag-side-button-selected-background-color: rgba(44,44,44,1);\\n  --ag-selected-tab-underline-color: rgba(63,81,181,1);\\n  --ag-modal-overlay-background-color: rgba(18,18,18,0.65882);\\n  --ag-value-change-delta-up-color: rgba(67,160,71,0.65882);\\n  --ag-value-change-delta-down-color: rgba(229,57,53,1);\\n  --ag-menu-background-color: rgba(44,44,44,1);\\n  --ag-row-loading-skeleton-effect-color: rgba(202, 203, 204, 0.4);\\n  --csstools-color-scheme--dark: initial;\\n  color-scheme: dark;\\n}\\n\\n@media (prefers-color-scheme: dark) {\\n  .ag-theme-material-auto-dark {\\n    --ag-material-primary-color: #3f51b5;\\n    --ag-material-accent-color: rgba(187,134,252,1);\\n    --ag-range-selection-border-color: var(--ag-material-accent-color);\\n    --ag-background-color: rgba(18,18,18,1);\\n    --ag-foreground-color: rgba(255,255,255,1);\\n    --ag-data-color: rgba(245,245,245,1);\\n    --ag-header-cell-hover-background-color: rgba(0,0,0,1);\\n    --ag-advanced-filter-join-pill-color: rgba(122,58,55,1);\\n    --ag-advanced-filter-column-pill-color: rgba(53,95,45,1);\\n    --ag-advanced-filter-option-pill-color: rgba(90,49,104,1);\\n    --ag-advanced-filter-value-pill-color: rgba(55,76,134,1);\\n    --ag-input-disabled-border-color: rgba(58,67,78,1);\\n    --ag-input-disabled-background-color: rgba(104,104,110,0.07059);\\n    --ag-selected-row-background-color: rgba(187,134,252,0.2);\\n    --ag-row-hover-color: rgba(187,134,252,0.2);\\n    --ag-column-hover-color: rgba(245,245,245,0.05098);\\n    --ag-r";
      S = S + "ange-selection-background-color: rgba(187,134,252,0.10196);\\n    --ag-range-selection-background-color-2: rgba(187,134,252,0.18824);\\n    --ag-range-selection-background-color-3: rgba(187,134,252,0.27059);\\n    --ag-range-selection-background-color-4: rgba(187,134,252,0.34118);\\n    --ag-border-color: rgba(56,56,56,1);\\n    --ag-secondary-border-color: rgba(56,56,56,1);\\n    --ag-header-background-color: rgba(18,18,18,1);\\n    --ag-tooltip-background-color: rgba(33,43,56,1);\\n    --ag-odd-row-background-color: rgba(18,18,18,1);\\n    --ag-control-panel-background-color: rgba(44,44,44,1);\\n    --ag-subheader-background-color: rgba(255,255,255,0.05098);\\n    --ag-subheader-toolbar-background-color: rgba(44,44,44,1);\\n    --ag-invalid-color: rgba(224,37,37,1);\\n    --ag-checkbox-unchecked-color: rgba(121,126,135,1);\\n    --ag-checkbox-background-color: rgba(18,18,18,1);\\n    --ag-secondary-foreground-color: rgba(245,245,245,1);\\n    --ag-input-border-color: rgba(56,56,56,1);\\n    --ag-input-border-color-invalid: rgba(224,37,37,1);\\n    --ag-disabled-foreground-color: rgba(245,245,245,0.50196);\\n    --ag-chip-background-color: rgba(34,38,40,0.07059);\\n    --ag-side-button-selected-background-color: rgba(44,44,44,1);\\n    --ag-selected-tab-underline-color: rgba(63,81,181,1);\\n    --ag-modal-overlay-background-color: rgba(18,18,18,0.65882);\\n    --ag-value-change-delta-up-color: rgba(67,160,71,0.65882);\\n    --ag-value-change-delta-down-color: rgba(229,57,53,1);\\n    --ag-menu-background-color: rgba(44,44,44,1);\\n    --ag-row-loading-skeleton-effect-color: rgba(202, 203, 204, 0.4);\\n    --csstools-color-scheme--dark: initial;\\n    color-scheme: dark;\\n  }\\n}\\n.ag-theme-material .ag-filter-toolpanel-header,\\n.ag-theme-material .ag-filter-toolpanel-search,\\n.ag-theme-material .ag-status-bar,\\n.ag-theme-material .ag-header-row,\\n.ag-theme-material .ag-panel-title-bar-title,\\n.ag-theme-material .ag-multi-filter-group-title-bar,\\n.ag-theme-material-dark .ag-filter-toolpanel-hea";
      S = S + "der,\\n.ag-theme-material-dark .ag-filter-toolpanel-search,\\n.ag-theme-material-dark .ag-status-bar,\\n.ag-theme-material-dark .ag-header-row,\\n.ag-theme-material-dark .ag-panel-title-bar-title,\\n.ag-theme-material-dark .ag-multi-filter-group-title-bar,\\n.ag-theme-material-auto-dark .ag-filter-toolpanel-header,\\n.ag-theme-material-auto-dark .ag-filter-toolpanel-search,\\n.ag-theme-material-auto-dark .ag-status-bar,\\n.ag-theme-material-auto-dark .ag-header-row,\\n.ag-theme-material-auto-dark .ag-panel-title-bar-title,\\n.ag-theme-material-auto-dark .ag-multi-filter-group-title-bar {\\n  font-size: calc(var(--ag-font-size) - 1px);\\n  font-weight: 600;\\n  color: var(--ag-header-foreground-color);\\n}\\n.ag-theme-material .ag-tab,\\n.ag-theme-material-dark .ag-tab,\\n.ag-theme-material-auto-dark .ag-tab {\\n  height: calc(var(--ag-grid-size) * 4.5);\\n  flex: 1 1 auto;\\n}\\n.ag-theme-material .ag-tabs-header,\\n.ag-theme-material .ag-column-drop-horizontal,\\n.ag-theme-material-dark .ag-tabs-header,\\n.ag-theme-material-dark .ag-column-drop-horizontal,\\n.ag-theme-material-auto-dark .ag-tabs-header,\\n.ag-theme-material-auto-dark .ag-column-drop-horizontal {\\n  background-color: var(--ag-subheader-background-color);\\n}\\n.ag-theme-material .ag-tabs-body,\\n.ag-theme-material-dark .ag-tabs-body,\\n.ag-theme-material-auto-dark .ag-tabs-body {\\n  padding: calc(var(--ag-grid-size) * 0.5) 0;\\n}\\n.ag-theme-material .ag-tabs-body .ag-menu-list,\\n.ag-theme-material-dark .ag-tabs-body .ag-menu-list,\\n.ag-theme-material-auto-dark .ag-tabs-body .ag-menu-list {\\n  padding-top: 0;\\n  padding-bottom: 0;\\n}\\n.ag-theme-material .ag-header-cell,\\n.ag-theme-material .ag-header-group-cell,\\n.ag-theme-material-dark .ag-header-cell,\\n.ag-theme-material-dark .ag-header-group-cell,\\n.ag-theme-material-auto-dark .ag-header-cell,\\n.ag-theme-material-auto-dark .ag-header-group-cell {\\n  transition: background-color 0.5s;\\n}\\n.ag-theme-material .ag-row-last:not(.ag-row-first) .ag-cell-inline-editing,\\n.ag-theme-mater";
      S = S + "ial-dark .ag-row-last:not(.ag-row-first) .ag-cell-inline-editing,\\n.ag-theme-material-auto-dark .ag-row-last:not(.ag-row-first) .ag-cell-inline-editing {\\n  bottom: 0;\\n}\\n.ag-theme-material .ag-cell-inline-editing,\\n.ag-theme-material-dark .ag-cell-inline-editing,\\n.ag-theme-material-auto-dark .ag-cell-inline-editing {\\n  padding: var(--ag-grid-size);\\n  height: calc(var(--ag-row-height) + var(--ag-grid-size) * 3);\\n  border-color: var(--ag-border-color) !important;\\n}\\n.ag-theme-material .ag-has-focus .ag-cell-inline-editing,\\n.ag-theme-material-dark .ag-has-focus .ag-cell-inline-editing,\\n.ag-theme-material-auto-dark .ag-has-focus .ag-cell-inline-editing {\\n  border-color: var(--ag-input-focus-border-color) !important;\\n}\\n.ag-theme-material .ag-column-drop-vertical,\\n.ag-theme-material-dark .ag-column-drop-vertical,\\n.ag-theme-material-auto-dark .ag-column-drop-vertical {\\n  border-bottom: solid 1px;\\n  border-bottom-color: var(--ag-border-color);\\n  padding-top: var(--ag-grid-size);\\n}\\n.ag-theme-material .ag-column-drop-vertical.ag-last-column-drop,\\n.ag-theme-material-dark .ag-column-drop-vertical.ag-last-column-drop,\\n.ag-theme-material-auto-dark .ag-column-drop-vertical.ag-last-column-drop {\\n  border-bottom: none;\\n}\\n.ag-theme-material .ag-column-drop-vertical-cell,\\n.ag-theme-material-dark .ag-column-drop-vertical-cell,\\n.ag-theme-material-auto-dark .ag-column-drop-vertical-cell {\\n  margin-left: 0;\\n}\\n.ag-theme-material .ag-column-drop-vertical-empty-message,\\n.ag-theme-material-dark .ag-column-drop-vertical-empty-message,\\n.ag-theme-material-auto-dark .ag-column-drop-vertical-empty-message {\\n  font-size: calc(var(--ag-font-size) - 1px);\\n  font-weight: 600;\\n  color: var(--ag-disabled-foreground-color);\\n}\\n.ag-theme-material .ag-ltr .ag-column-drop-vertical-empty-message, .ag-theme-material-dark .ag-ltr .ag-column-drop-vertical-empty-message, .ag-theme-material-auto-dark .ag-ltr .ag-column-drop-vertical-empty-message {\\n  padding-left: calc(var(--ag";
      S = S + "-icon-size) + var(--ag-grid-size) * 2);\\n  padding-right: var(--ag-grid-size);\\n}\\n\\n.ag-theme-material .ag-rtl .ag-column-drop-vertical-empty-message, .ag-theme-material-dark .ag-rtl .ag-column-drop-vertical-empty-message, .ag-theme-material-auto-dark .ag-rtl .ag-column-drop-vertical-empty-message {\\n  padding-right: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\\n  padding-left: var(--ag-grid-size);\\n}\\n\\n.ag-theme-material .ag-status-bar,\\n.ag-theme-material-dark .ag-status-bar,\\n.ag-theme-material-auto-dark .ag-status-bar {\\n  border: solid 1px;\\n  border-color: var(--ag-border-color);\\n}\\n.ag-theme-material .ag-column-panel-column-select,\\n.ag-theme-material-dark .ag-column-panel-column-select,\\n.ag-theme-material-auto-dark .ag-column-panel-column-select {\\n  border-top: solid 1px;\\n  border-top-color: var(--ag-border-color);\\n}\\n.ag-theme-material .ag-column-select,\\n.ag-theme-material .ag-column-select-header,\\n.ag-theme-material-dark .ag-column-select,\\n.ag-theme-material-dark .ag-column-select-header,\\n.ag-theme-material-auto-dark .ag-column-select,\\n.ag-theme-material-auto-dark .ag-column-select-header {\\n  border-bottom: solid 1px;\\n  border-bottom-color: var(--ag-border-color);\\n}\\n.ag-theme-material .ag-column-select-header,\\n.ag-theme-material-dark .ag-column-select-header,\\n.ag-theme-material-auto-dark .ag-column-select-header {\\n  height: var(--ag-header-height);\\n}\\n.ag-theme-material .ag-group-title-bar,\\n.ag-theme-material-dark .ag-group-title-bar,\\n.ag-theme-material-auto-dark .ag-group-title-bar {\\n  padding: calc(var(--ag-grid-size) * 0.75) var(--ag-grid-size);\\n}\\n.ag-theme-material .ag-charts-format-sub-level-group-title-bar,\\n.ag-theme-material-dark .ag-charts-format-sub-level-group-title-bar,\\n.ag-theme-material-auto-dark .ag-charts-format-sub-level-group-title-bar {\\n  padding: calc(var(--ag-grid-size) * 0.5) var(--ag-grid-size);\\n}\\n.ag-theme-material .ag-chart-data-section,\\n.ag-theme-material .ag-chart-format-section,\\n.ag-theme-m";
      S = S + "aterial .ag-chart-advanced-settings-section,\\n.ag-theme-material-dark .ag-chart-data-section,\\n.ag-theme-material-dark .ag-chart-format-section,\\n.ag-theme-material-dark .ag-chart-advanced-settings-section,\\n.ag-theme-material-auto-dark .ag-chart-data-section,\\n.ag-theme-material-auto-dark .ag-chart-format-section,\\n.ag-theme-material-auto-dark .ag-chart-advanced-settings-section {\\n  padding-bottom: calc(var(--ag-grid-size) * 0.5);\\n}\\n.ag-theme-material input[class^=ag-]:not([type]),\\n.ag-theme-material input[class^=ag-][type=text],\\n.ag-theme-material input[class^=ag-][type=number],\\n.ag-theme-material input[class^=ag-][type=tel],\\n.ag-theme-material input[class^=ag-][type=date],\\n.ag-theme-material input[class^=ag-][type=datetime-local],\\n.ag-theme-material textarea[class^=ag-],\\n.ag-theme-material-dark input[class^=ag-]:not([type]),\\n.ag-theme-material-dark input[class^=ag-][type=text],\\n.ag-theme-material-dark input[class^=ag-][type=number],\\n.ag-theme-material-dark input[class^=ag-][type=tel],\\n.ag-theme-material-dark input[class^=ag-][type=date],\\n.ag-theme-material-dark input[class^=ag-][type=datetime-local],\\n.ag-theme-material-dark textarea[class^=ag-],\\n.ag-theme-material-auto-dark input[class^=ag-]:not([type]),\\n.ag-theme-material-auto-dark input[class^=ag-][type=text],\\n.ag-theme-material-auto-dark input[class^=ag-][type=number],\\n.ag-theme-material-auto-dark input[class^=ag-][type=tel],\\n.ag-theme-material-auto-dark input[class^=ag-][type=date],\\n.ag-theme-material-auto-dark input[class^=ag-][type=datetime-local],\\n.ag-theme-material-auto-dark textarea[class^=ag-] {\\n  background: transparent;\\n  color: var(--ag-foreground-color);\\n  font-family: inherit;\\n  font-size: inherit;\\n  height: calc(var(--ag-grid-size) * 5);\\n  padding-bottom: var(--ag-grid-size);\\n  border-width: 0;\\n  border-radius: 0;\\n  border-bottom: 2px solid;\\n  border-bottom-color: var(--ag-border-color);\\n}\\n.ag-theme-material input[class^=ag-]:not([type]):focus,\\n.ag-theme-materia";
      S = S + "l input[class^=ag-][type=text]:focus,\\n.ag-theme-material input[class^=ag-][type=number]:focus,\\n.ag-theme-material input[class^=ag-][type=tel]:focus,\\n.ag-theme-material input[class^=ag-][type=date]:focus,\\n.ag-theme-material input[class^=ag-][type=datetime-local]:focus,\\n.ag-theme-material textarea[class^=ag-]:focus,\\n.ag-theme-material-dark input[class^=ag-]:not([type]):focus,\\n.ag-theme-material-dark input[class^=ag-][type=text]:focus,\\n.ag-theme-material-dark input[class^=ag-][type=number]:focus,\\n.ag-theme-material-dark input[class^=ag-][type=tel]:focus,\\n.ag-theme-material-dark input[class^=ag-][type=date]:focus,\\n.ag-theme-material-dark input[class^=ag-][type=datetime-local]:focus,\\n.ag-theme-material-dark textarea[class^=ag-]:focus,\\n.ag-theme-material-auto-dark input[class^=ag-]:not([type]):focus,\\n.ag-theme-material-auto-dark input[class^=ag-][type=text]:focus,\\n.ag-theme-material-auto-dark input[class^=ag-][type=number]:focus,\\n.ag-theme-material-auto-dark input[class^=ag-][type=tel]:focus,\\n.ag-theme-material-auto-dark input[class^=ag-][type=date]:focus,\\n.ag-theme-material-auto-dark input[class^=ag-][type=datetime-local]:focus,\\n.ag-theme-material-auto-dark textarea[class^=ag-]:focus {\\n  border-bottom: 2px solid;\\n  border-bottom-color: var(--ag-material-primary-color);\\n  outline: none;\\n  box-shadow: none;\\n}\\n.ag-theme-material input[class^=ag-]:not([type])::-moz-placeholder, .ag-theme-material input[class^=ag-][type=text]::-moz-placeholder, .ag-theme-material input[class^=ag-][type=number]::-moz-placeholder, .ag-theme-material input[class^=ag-][type=tel]::-moz-placeholder, .ag-theme-material input[class^=ag-][type=date]::-moz-placeholder, .ag-theme-material input[class^=ag-][type=datetime-local]::-moz-placeholder, .ag-theme-material textarea[class^=ag-]::-moz-placeholder, .ag-theme-material-dark input[class^=ag-]:not([type])::-moz-placeholder, .ag-theme-material-dark input[class^=ag-][type=text]::-moz-placeholder, .ag-theme-material-dark input[cla";
      S = S + "ss^=ag-][type=number]::-moz-placeholder, .ag-theme-material-dark input[class^=ag-][type=tel]::-moz-placeholder, .ag-theme-material-dark input[class^=ag-][type=date]::-moz-placeholder, .ag-theme-material-dark input[class^=ag-][type=datetime-local]::-moz-placeholder, .ag-theme-material-dark textarea[class^=ag-]::-moz-placeholder, .ag-theme-material-auto-dark input[class^=ag-]:not([type])::-moz-placeholder, .ag-theme-material-auto-dark input[class^=ag-][type=text]::-moz-placeholder, .ag-theme-material-auto-dark input[class^=ag-][type=number]::-moz-placeholder, .ag-theme-material-auto-dark input[class^=ag-][type=tel]::-moz-placeholder, .ag-theme-material-auto-dark input[class^=ag-][type=date]::-moz-placeholder, .ag-theme-material-auto-dark input[class^=ag-][type=datetime-local]::-moz-placeholder, .ag-theme-material-auto-dark textarea[class^=ag-]::-moz-placeholder {\\n  color: var(--ag-disabled-foreground-color);\\n}\\n.ag-theme-material input[class^=ag-]:not([type])::placeholder,\\n.ag-theme-material input[class^=ag-][type=text]::placeholder,\\n.ag-theme-material input[class^=ag-][type=number]::placeholder,\\n.ag-theme-material input[class^=ag-][type=tel]::placeholder,\\n.ag-theme-material input[class^=ag-][type=date]::placeholder,\\n.ag-theme-material input[class^=ag-][type=datetime-local]::placeholder,\\n.ag-theme-material textarea[class^=ag-]::placeholder,\\n.ag-theme-material-dark input[class^=ag-]:not([type])::placeholder,\\n.ag-theme-material-dark input[class^=ag-][type=text]::placeholder,\\n.ag-theme-material-dark input[class^=ag-][type=number]::placeholder,\\n.ag-theme-material-dark input[class^=ag-][type=tel]::placeholder,\\n.ag-theme-material-dark input[class^=ag-][type=date]::placeholder,\\n.ag-theme-material-dark input[class^=ag-][type=datetime-local]::placeholder,\\n.ag-theme-material-dark textarea[class^=ag-]::placeholder,\\n.ag-theme-material-auto-dark input[class^=ag-]:not([type])::placeholder,\\n.ag-theme-material-auto-dark input[class^=ag-][type=text]::placeholder,\\n.ag";
      S = S + "-theme-material-auto-dark input[class^=ag-][type=number]::placeholder,\\n.ag-theme-material-auto-dark input[class^=ag-][type=tel]::placeholder,\\n.ag-theme-material-auto-dark input[class^=ag-][type=date]::placeholder,\\n.ag-theme-material-auto-dark input[class^=ag-][type=datetime-local]::placeholder,\\n.ag-theme-material-auto-dark textarea[class^=ag-]::placeholder {\\n  color: var(--ag-disabled-foreground-color);\\n}\\n.ag-theme-material input[class^=ag-]:not([type]):disabled,\\n.ag-theme-material input[class^=ag-][type=text]:disabled,\\n.ag-theme-material input[class^=ag-][type=number]:disabled,\\n.ag-theme-material input[class^=ag-][type=tel]:disabled,\\n.ag-theme-material input[class^=ag-][type=date]:disabled,\\n.ag-theme-material input[class^=ag-][type=datetime-local]:disabled,\\n.ag-theme-material textarea[class^=ag-]:disabled,\\n.ag-theme-material-dark input[class^=ag-]:not([type]):disabled,\\n.ag-theme-material-dark input[class^=ag-][type=text]:disabled,\\n.ag-theme-material-dark input[class^=ag-][type=number]:disabled,\\n.ag-theme-material-dark input[class^=ag-][type=tel]:disabled,\\n.ag-theme-material-dark input[class^=ag-][type=date]:disabled,\\n.ag-theme-material-dark input[class^=ag-][type=datetime-local]:disabled,\\n.ag-theme-material-dark textarea[class^=ag-]:disabled,\\n.ag-theme-material-auto-dark input[class^=ag-]:not([type]):disabled,\\n.ag-theme-material-auto-dark input[class^=ag-][type=text]:disabled,\\n.ag-theme-material-auto-dark input[class^=ag-][type=number]:disabled,\\n.ag-theme-material-auto-dark input[class^=ag-][type=tel]:disabled,\\n.ag-theme-material-auto-dark input[class^=ag-][type=date]:disabled,\\n.ag-theme-material-auto-dark input[class^=ag-][type=datetime-local]:disabled,\\n.ag-theme-material-auto-dark textarea[class^=ag-]:disabled {\\n  border-bottom: 1px solid;\\n  border-bottom-color: var(--ag-border-color);\\n}\\n.ag-theme-material input[class^=ag-]:not([type]):invalid,\\n.ag-theme-material input[class^=ag-][type=text]:invalid,\\n.ag-theme-material input[class";
      S = S + "^=ag-][type=number]:invalid,\\n.ag-theme-material input[class^=ag-][type=tel]:invalid,\\n.ag-theme-material input[class^=ag-][type=date]:invalid,\\n.ag-theme-material input[class^=ag-][type=datetime-local]:invalid,\\n.ag-theme-material textarea[class^=ag-]:invalid,\\n.ag-theme-material-dark input[class^=ag-]:not([type]):invalid,\\n.ag-theme-material-dark input[class^=ag-][type=text]:invalid,\\n.ag-theme-material-dark input[class^=ag-][type=number]:invalid,\\n.ag-theme-material-dark input[class^=ag-][type=tel]:invalid,\\n.ag-theme-material-dark input[class^=ag-][type=date]:invalid,\\n.ag-theme-material-dark input[class^=ag-][type=datetime-local]:invalid,\\n.ag-theme-material-dark textarea[class^=ag-]:invalid,\\n.ag-theme-material-auto-dark input[class^=ag-]:not([type]):invalid,\\n.ag-theme-material-auto-dark input[class^=ag-][type=text]:invalid,\\n.ag-theme-material-auto-dark input[class^=ag-][type=number]:invalid,\\n.ag-theme-material-auto-dark input[class^=ag-][type=tel]:invalid,\\n.ag-theme-material-auto-dark input[class^=ag-][type=date]:invalid,\\n.ag-theme-material-auto-dark input[class^=ag-][type=datetime-local]:invalid,\\n.ag-theme-material-auto-dark textarea[class^=ag-]:invalid {\\n  border-width: 0;\\n  border-bottom: 1px solid;\\n  border-bottom-color: var(--ag-invalid-color);\\n  color: var(--ag-invalid-color);\\n}\\n.ag-theme-material .ag-standard-button,\\n.ag-theme-material-dark .ag-standard-button,\\n.ag-theme-material-auto-dark .ag-standard-button {\\n  -webkit-appearance: none;\\n     -moz-appearance: none;\\n          appearance: none;\\n  background-color: transparent;\\n  border: 0;\\n  color: var(--ag-material-primary-color);\\n  font-family: inherit;\\n  font-size: inherit;\\n  margin: 0;\\n  padding: 0;\\n  text-transform: uppercase;\\n}\\n.ag-theme-material .ag-standard-button:disabled,\\n.ag-theme-material-dark .ag-standard-button:disabled,\\n.ag-theme-material-auto-dark .ag-standard-button:disabled {\\n  color: var(--ag-disabled-foreground-color);\\n  background-color: var(--ag-input";
      S = S + "-disabled-background-color);\\n  border-color: var(--ag-input-disabled-border-color);\\n}\\n.ag-theme-material.ag-dnd-ghost,\\n.ag-theme-material-dark.ag-dnd-ghost,\\n.ag-theme-material-auto-dark.ag-dnd-ghost {\\n  font-size: calc(var(--ag-font-size) - 1px);\\n  font-weight: 600;\\n}\\n.ag-theme-material .ag-filter-toolpanel-header,\\n.ag-theme-material-dark .ag-filter-toolpanel-header,\\n.ag-theme-material-auto-dark .ag-filter-toolpanel-header {\\n  height: calc(var(--ag-grid-size) * 4);\\n}\\n.ag-theme-material .ag-filter-toolpanel-group-level-0-header,\\n.ag-theme-material-dark .ag-filter-toolpanel-group-level-0-header,\\n.ag-theme-material-auto-dark .ag-filter-toolpanel-group-level-0-header {\\n  height: calc(var(--ag-grid-size) * 7);\\n}\\n.ag-theme-material .ag-ltr .ag-filter-apply-panel-button, .ag-theme-material .ag-ltr .ag-advanced-filter-apply-button, .ag-theme-material .ag-ltr .ag-advanced-filter-builder-button, .ag-theme-material-dark .ag-ltr .ag-filter-apply-panel-button, .ag-theme-material-dark .ag-ltr .ag-advanced-filter-apply-button, .ag-theme-material-dark .ag-ltr .ag-advanced-filter-builder-button, .ag-theme-material-auto-dark .ag-ltr .ag-filter-apply-panel-button, .ag-theme-material-auto-dark .ag-ltr .ag-advanced-filter-apply-button, .ag-theme-material-auto-dark .ag-ltr .ag-advanced-filter-builder-button {\\n  margin-left: var(--ag-grid-size);\\n}\\n\\n.ag-theme-material .ag-rtl .ag-filter-apply-panel-button, .ag-theme-material .ag-rtl .ag-advanced-filter-apply-button, .ag-theme-material .ag-rtl .ag-advanced-filter-builder-button, .ag-theme-material-dark .ag-rtl .ag-filter-apply-panel-button, .ag-theme-material-dark .ag-rtl .ag-advanced-filter-apply-button, .ag-theme-material-dark .ag-rtl .ag-advanced-filter-builder-button, .ag-theme-material-auto-dark .ag-rtl .ag-filter-apply-panel-button, .ag-theme-material-auto-dark .ag-rtl .ag-advanced-filter-apply-button, .ag-theme-material-auto-dark .ag-rtl .ag-advanced-filter-builder-button {\\n  margin-right: var(--ag-grid-size);";
      S = S + "\\n}\\n\\n.ag-theme-material .ag-layout-auto-height .ag-center-cols-viewport,\\n.ag-theme-material .ag-layout-auto-height .ag-center-cols-container,\\n.ag-theme-material .ag-layout-print .ag-center-cols-viewport,\\n.ag-theme-material .ag-layout-print .ag-center-cols-container,\\n.ag-theme-material-dark .ag-layout-auto-height .ag-center-cols-viewport,\\n.ag-theme-material-dark .ag-layout-auto-height .ag-center-cols-container,\\n.ag-theme-material-dark .ag-layout-print .ag-center-cols-viewport,\\n.ag-theme-material-dark .ag-layout-print .ag-center-cols-container,\\n.ag-theme-material-auto-dark .ag-layout-auto-height .ag-center-cols-viewport,\\n.ag-theme-material-auto-dark .ag-layout-auto-height .ag-center-cols-container,\\n.ag-theme-material-auto-dark .ag-layout-print .ag-center-cols-viewport,\\n.ag-theme-material-auto-dark .ag-layout-print .ag-center-cols-container {\\n  min-height: 150px;\\n}\\n.ag-theme-material .ag-overlay-no-rows-wrapper.ag-layout-auto-height,\\n.ag-theme-material-dark .ag-overlay-no-rows-wrapper.ag-layout-auto-height,\\n.ag-theme-material-auto-dark .ag-overlay-no-rows-wrapper.ag-layout-auto-height {\\n  padding-top: 60px;\\n}\\n.ag-theme-material .ag-picker-field-wrapper:focus-within,\\n.ag-theme-material-dark .ag-picker-field-wrapper:focus-within,\\n.ag-theme-material-auto-dark .ag-picker-field-wrapper:focus-within {\\n  box-shadow: 0 0 0 1px var(--ag-material-primary-color);\\n}\\n.ag-theme-material .ag-rich-select-list,\\n.ag-theme-material-dark .ag-rich-select-list,\\n.ag-theme-material-auto-dark .ag-rich-select-list {\\n  box-shadow: rgba(0, 0, 0, 0.2) 0px 5px 5px -3px, rgba(0, 0, 0, 0.14) 0px 8px 10px 1px, rgba(0, 0, 0, 0.12) 0px 3px 14px 2px;\\n}\\n.ag-theme-material .ag-advanced-filter-builder-button-label,\\n.ag-theme-material-dark .ag-advanced-filter-builder-button-label,\\n.ag-theme-material-auto-dark .ag-advanced-filter-builder-button-label {\\n  text-transform: uppercase;\\n}\\n.ag-theme-material .ag-filter-active .ag-icon-filter,\\n.ag-theme-material-dark .ag-filter-ac";
      S = S + 'tive .ag-icon-filter,\\n.ag-theme-material-auto-dark .ag-filter-active .ag-icon-filter {\\n  color: var(--ag-material-accent-color);\\n}\\n\',""]),t.A=g},7899:function(e,t,a){"use strict";var n=a(6758),o=a.n(n),r=a(935),i=a.n(r),s=a(62),l=a.n(s),c=new URL(a(7249),a.b),g=i()(o()),d=l()(c);g.push([e.id,\'.ag-theme-quartz,\\n.ag-theme-quartz-dark,\\n.ag-theme-quartz-auto-dark {\\n  --ag-active-color: #2196f3;\\n  --ag-background-color: #fff;\\n  --ag-foreground-color: #181d1f;\\n  --ag-border-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 15%);\\n  --ag-secondary-border-color: var(--ag-border-color);\\n  --ag-header-background-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 2%);\\n  --ag-tooltip-background-color: var(--ag-header-background-color);\\n  --ag-control-panel-background-color: var(--ag-header-background-color);\\n  --ag-subheader-background-color: transparent;\\n  --ag-invalid-color: #e02525;\\n  --ag-checkbox-unchecked-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 30%);\\n  --ag-advanced-filter-join-pill-color: #f08e8d;\\n  --ag-advanced-filter-column-pill-color: #a6e194;\\n  --ag-advanced-filter-option-pill-color: #f3c08b;\\n  --ag-advanced-filter-value-pill-color: #85c0e4;\\n  --ag-header-column-resize-handle-color: var(--ag-secondary-border-color);\\n  --ag-icon-font-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 90%);\\n  --ag-panel-background-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 3%);\\n  --ag-panel-border-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 20%);\\n  --ag-menu-background-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 3%);\\n  --ag-menu-border-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 20%);\\n  --ag-selected-row-background-color: color-mix(in srgb, transparent, var(--ag-active-color) 8%);\\n  --ag-row-hover-color: color-mix(in srgb, transparent, var(';
      S = S + "--ag-active-color) 12%);\\n  --ag-column-hover-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 5%);\\n  --ag-input-focus-border-color: var(--ag-active-color);\\n  --ag-input-focus-box-shadow: 0 0 0 3px color-mix(in srgb, transparent, var(--ag-input-focus-border-color) 47%);\\n  --ag-range-selection-background-color: color-mix(in srgb, transparent, var(--ag-active-color) 20%);\\n  --ag-range-selection-background-color-2: color-mix(in srgb, transparent, var(--ag-active-color) 36%);\\n  --ag-range-selection-background-color-3: color-mix(in srgb, transparent, var(--ag-active-color) 49%);\\n  --ag-range-selection-background-color-4: color-mix(in srgb, transparent, var(--ag-active-color) 59%);\\n  --ag-checkbox-background-color: var(--ag-background-color);\\n  --ag-checkbox-checked-color: var(--ag-active-color);\\n  --ag-range-selection-border-color: var(--ag-active-color);\\n  --ag-secondary-foreground-color: var(--ag-foreground-color);\\n  --ag-input-border-color: var(--ag-border-color);\\n  --ag-input-border-color-invalid: var(--ag-invalid-color);\\n  --ag-disabled-foreground-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 50%);\\n  --ag-chip-background-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 7%);\\n  --ag-chip-border-color: color-mix(in srgb, var(--ag-header-background-color), var(--ag-foreground-color) 13%);\\n  --ag-input-disabled-border-color: var(--ag-border-color);\\n  --ag-input-disabled-background-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 6%);\\n  --ag-modal-overlay-background-color: color-mix(in srgb, transparent, var(--ag-background-color) 66%);\\n  --ag-chart-menu-label-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 80%);\\n  --ag-chart-menu-pill-select-button-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 70%);\\n  --ag-borders: solid 1px;\\n  --ag-border-radius: 4px;\\n  --ag-wrapper-border-radius: 8px;\\n  --ag-borders-side-button: none;\\n  --";
      S = S + 'ag-side-button-selected-background-color: transparent;\\n  --ag-header-column-resize-handle-display: block;\\n  --ag-header-column-resize-handle-width: 2px;\\n  --ag-header-column-resize-handle-height: 30%;\\n  --ag-grid-size: 8px;\\n  --ag-icon-size: 16px;\\n  --ag-header-height: calc(var(--ag-font-size) + var(--ag-grid-size) * 4.25);\\n  --ag-row-height: calc(var(--ag-font-size) + var(--ag-grid-size) * 3.5);\\n  --ag-list-item-height: calc(\\n      var(--ag-icon-size) + var(--ag-widget-vertical-spacing)\\n  );\\n  --ag-column-select-indent-size: var(--ag-icon-size);\\n  --ag-set-filter-indent-size: var(--ag-icon-size);\\n  --ag-filter-tool-panel-group-indent: var(--ag-grid-size);\\n  --ag-advanced-filter-builder-indent-size: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\\n  --ag-cell-horizontal-padding: calc(var(--ag-grid-size) * 2);\\n  --ag-cell-widget-spacing: calc(var(--ag-grid-size) * 1.5);\\n  --ag-widget-container-vertical-padding: calc(var(--ag-grid-size) * 1.5);\\n  --ag-widget-container-horizontal-padding: calc(var(--ag-grid-size) * 1.5);\\n  --ag-widget-horizontal-spacing: calc(var(--ag-grid-size) * 1.5);\\n  --ag-widget-vertical-spacing: calc(var(--ag-grid-size) * 1);\\n  --ag-toggle-button-height: 18px;\\n  --ag-toggle-button-width: 28px;\\n  --ag-toggle-button-border-width: 2px;\\n  --ag-font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu,\\n      Cantarell, "Helvetica Neue", sans-serif;\\n  --ag-font-size: 14px;\\n  --ag-icon-font-family: agGridQuartz;\\n  --ag-tab-min-width: 290px;\\n  --ag-chart-menu-panel-width: 260px;\\n  --ag-card-shadow: 0 1px 4px 1px rgba(186, 191, 199, 0.4);\\n  --ag-popup-shadow: 0 0 16px 0 rgba(0, 0, 0, 0.15);\\n  --ag-side-bar-panel-width: 250px;\\n}\\n\\n.ag-theme-quartz-dark {\\n  --ag-background-color: rgb(31, 41, 54);\\n  --ag-foreground-color: #fff;\\n  --ag-border-color: rgba(255, 255, 255, 0.16);\\n  --ag-secondary-border-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 10%);\\n';
      S = S + "  --ag-header-background-color: rgb(40, 49, 62);\\n  --ag-tooltip-background-color: rgb(33, 43, 56);\\n  --ag-control-panel-background-color: rgb(40, 49, 62);\\n  --ag-input-disabled-background-color: rgba(104,104,110,0.07059);\\n  --ag-card-shadow: 0 1px 20px 1px black;\\n  --ag-input-border-color: var(--ag-border-color);\\n  --ag-input-disabled-border-color: rgba(255, 255, 255, 0.07);\\n  --ag-checkbox-unchecked-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 40%);\\n  --ag-row-hover-color: color-mix(in srgb, transparent, var(--ag-active-color) 20%);\\n  --ag-selected-row-background-color: var(--ag-row-hover-color);\\n  --ag-panel-background-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 10%);\\n  --ag-panel-border-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 10%);\\n  --ag-menu-background-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 10%);\\n  --ag-menu-border-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 10%);\\n  --ag-advanced-filter-join-pill-color: #7a3a37;\\n  --ag-advanced-filter-column-pill-color: #355f2d;\\n  --ag-advanced-filter-option-pill-color: #5a3168;\\n  --ag-advanced-filter-value-pill-color: #374c86;\\n  --ag-popup-shadow: 0 0px 20px rgba(0, 0, 0, 0.3);\\n  --ag-row-loading-skeleton-effect-color: rgba(202, 203, 204, 0.4);\\n  --csstools-color-scheme--dark: initial;\\n  color-scheme: dark;\\n}\\n\\n@media (prefers-color-scheme: dark) {\\n  .ag-theme-quartz-auto-dark {\\n    --ag-background-color: rgb(31, 41, 54);\\n    --ag-foreground-color: #fff;\\n    --ag-border-color: rgba(255, 255, 255, 0.16);\\n    --ag-secondary-border-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 10%);\\n    --ag-header-background-color: rgb(40, 49, 62);\\n    --ag-tooltip-background-color: rgb(33, 43, 56);\\n    --ag-control-panel-background-color: rgb(40, 49, 62);\\n    --ag-input-disabled-background-color: rgba(104,104,110,0.07059);\\n    --ag-";
      S = S + "card-shadow: 0 1px 20px 1px black;\\n    --ag-input-border-color: var(--ag-border-color);\\n    --ag-input-disabled-border-color: rgba(255, 255, 255, 0.07);\\n    --ag-checkbox-unchecked-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 40%);\\n    --ag-row-hover-color: color-mix(in srgb, transparent, var(--ag-active-color) 20%);\\n    --ag-selected-row-background-color: var(--ag-row-hover-color);\\n    --ag-panel-background-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 10%);\\n    --ag-panel-border-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 10%);\\n    --ag-menu-background-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 10%);\\n    --ag-menu-border-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 10%);\\n    --ag-advanced-filter-join-pill-color: #7a3a37;\\n    --ag-advanced-filter-column-pill-color: #355f2d;\\n    --ag-advanced-filter-option-pill-color: #5a3168;\\n    --ag-advanced-filter-value-pill-color: #374c86;\\n    --ag-popup-shadow: 0 0px 20px rgba(0, 0, 0, 0.3);\\n    --ag-row-loading-skeleton-effect-color: rgba(202, 203, 204, 0.4);\\n    --csstools-color-scheme--dark: initial;\\n    color-scheme: dark;\\n  }\\n}\\n.ag-theme-quartz .ag-filter-toolpanel-header,\\n.ag-theme-quartz .ag-filter-toolpanel-search,\\n.ag-theme-quartz .ag-status-bar,\\n.ag-theme-quartz .ag-header-row,\\n.ag-theme-quartz .ag-panel-title-bar-title,\\n.ag-theme-quartz .ag-multi-filter-group-title-bar,\\n.ag-theme-quartz-dark .ag-filter-toolpanel-header,\\n.ag-theme-quartz-dark .ag-filter-toolpanel-search,\\n.ag-theme-quartz-dark .ag-status-bar,\\n.ag-theme-quartz-dark .ag-header-row,\\n.ag-theme-quartz-dark .ag-panel-title-bar-title,\\n.ag-theme-quartz-dark .ag-multi-filter-group-title-bar,\\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-header,\\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-search,\\n.ag-theme-quartz-auto-dark .ag-status-bar,\\n.ag-theme-quartz-auto-dark .ag-he";
      S = S + "ader-row,\\n.ag-theme-quartz-auto-dark .ag-panel-title-bar-title,\\n.ag-theme-quartz-auto-dark .ag-multi-filter-group-title-bar {\\n  font-weight: 500;\\n  color: var(--ag-header-foreground-color);\\n}\\n.ag-theme-quartz input[class^=ag-]:not([type]),\\n.ag-theme-quartz input[class^=ag-][type=text],\\n.ag-theme-quartz input[class^=ag-][type=number],\\n.ag-theme-quartz input[class^=ag-][type=tel],\\n.ag-theme-quartz input[class^=ag-][type=date],\\n.ag-theme-quartz input[class^=ag-][type=datetime-local],\\n.ag-theme-quartz textarea[class^=ag-],\\n.ag-theme-quartz-dark input[class^=ag-]:not([type]),\\n.ag-theme-quartz-dark input[class^=ag-][type=text],\\n.ag-theme-quartz-dark input[class^=ag-][type=number],\\n.ag-theme-quartz-dark input[class^=ag-][type=tel],\\n.ag-theme-quartz-dark input[class^=ag-][type=date],\\n.ag-theme-quartz-dark input[class^=ag-][type=datetime-local],\\n.ag-theme-quartz-dark textarea[class^=ag-],\\n.ag-theme-quartz-auto-dark input[class^=ag-]:not([type]),\\n.ag-theme-quartz-auto-dark input[class^=ag-][type=text],\\n.ag-theme-quartz-auto-dark input[class^=ag-][type=number],\\n.ag-theme-quartz-auto-dark input[class^=ag-][type=tel],\\n.ag-theme-quartz-auto-dark input[class^=ag-][type=date],\\n.ag-theme-quartz-auto-dark input[class^=ag-][type=datetime-local],\\n.ag-theme-quartz-auto-dark textarea[class^=ag-] {\\n  min-height: calc(var(--ag-grid-size) * 4);\\n  border-radius: var(--ag-border-radius);\\n}\\n.ag-theme-quartz .ag-ltr input[class^=ag-]:not([type]), .ag-theme-quartz .ag-ltr input[class^=ag-][type=text], .ag-theme-quartz .ag-ltr input[class^=ag-][type=number], .ag-theme-quartz .ag-ltr input[class^=ag-][type=tel], .ag-theme-quartz .ag-ltr input[class^=ag-][type=date], .ag-theme-quartz .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-quartz .ag-ltr textarea[class^=ag-], .ag-theme-quartz-dark .ag-ltr input[class^=ag-]:not([type]), .ag-theme-quartz-dark .ag-ltr input[class^=ag-][type=text], .ag-theme-quartz-dark .ag-ltr input[class^=ag-][type=number], .ag-theme-qu";
      S = S + "artz-dark .ag-ltr input[class^=ag-][type=tel], .ag-theme-quartz-dark .ag-ltr input[class^=ag-][type=date], .ag-theme-quartz-dark .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-quartz-dark .ag-ltr textarea[class^=ag-], .ag-theme-quartz-auto-dark .ag-ltr input[class^=ag-]:not([type]), .ag-theme-quartz-auto-dark .ag-ltr input[class^=ag-][type=text], .ag-theme-quartz-auto-dark .ag-ltr input[class^=ag-][type=number], .ag-theme-quartz-auto-dark .ag-ltr input[class^=ag-][type=tel], .ag-theme-quartz-auto-dark .ag-ltr input[class^=ag-][type=date], .ag-theme-quartz-auto-dark .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-quartz-auto-dark .ag-ltr textarea[class^=ag-] {\\n  padding-left: var(--ag-grid-size);\\n}\\n\\n.ag-theme-quartz .ag-rtl input[class^=ag-]:not([type]), .ag-theme-quartz .ag-rtl input[class^=ag-][type=text], .ag-theme-quartz .ag-rtl input[class^=ag-][type=number], .ag-theme-quartz .ag-rtl input[class^=ag-][type=tel], .ag-theme-quartz .ag-rtl input[class^=ag-][type=date], .ag-theme-quartz .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-quartz .ag-rtl textarea[class^=ag-], .ag-theme-quartz-dark .ag-rtl input[class^=ag-]:not([type]), .ag-theme-quartz-dark .ag-rtl input[class^=ag-][type=text], .ag-theme-quartz-dark .ag-rtl input[class^=ag-][type=number], .ag-theme-quartz-dark .ag-rtl input[class^=ag-][type=tel], .ag-theme-quartz-dark .ag-rtl input[class^=ag-][type=date], .ag-theme-quartz-dark .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-quartz-dark .ag-rtl textarea[class^=ag-], .ag-theme-quartz-auto-dark .ag-rtl input[class^=ag-]:not([type]), .ag-theme-quartz-auto-dark .ag-rtl input[class^=ag-][type=text], .ag-theme-quartz-auto-dark .ag-rtl input[class^=ag-][type=number], .ag-theme-quartz-auto-dark .ag-rtl input[class^=ag-][type=tel], .ag-theme-quartz-auto-dark .ag-rtl input[class^=ag-][type=date], .ag-theme-quartz-auto-dark .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-quartz-auto-dark .ag-rtl textarea[class^=a";
      S = S + "g-] {\\n  padding-right: var(--ag-grid-size);\\n}\\n\\n.ag-theme-quartz .ag-picker-field-wrapper,\\n.ag-theme-quartz-dark .ag-picker-field-wrapper,\\n.ag-theme-quartz-auto-dark .ag-picker-field-wrapper {\\n  min-height: calc(var(--ag-grid-size) * 4);\\n}\\n.ag-theme-quartz .ag-tab,\\n.ag-theme-quartz-dark .ag-tab,\\n.ag-theme-quartz-auto-dark .ag-tab {\\n  padding: var(--ag-grid-size);\\n  border-left: var(--ag-borders) transparent;\\n  border-right: var(--ag-borders) transparent;\\n  flex: 1 1 auto;\\n}\\n.ag-theme-quartz .ag-tab-selected,\\n.ag-theme-quartz-dark .ag-tab-selected,\\n.ag-theme-quartz-auto-dark .ag-tab-selected {\\n  background-color: var(--ag-background-color);\\n}\\n.ag-theme-quartz .ag-ltr .ag-tab-selected:not(:first-of-type), .ag-theme-quartz-dark .ag-ltr .ag-tab-selected:not(:first-of-type), .ag-theme-quartz-auto-dark .ag-ltr .ag-tab-selected:not(:first-of-type) {\\n  border-left-color: var(--ag-border-color);\\n}\\n\\n.ag-theme-quartz .ag-rtl .ag-tab-selected:not(:first-of-type), .ag-theme-quartz-dark .ag-rtl .ag-tab-selected:not(:first-of-type), .ag-theme-quartz-auto-dark .ag-rtl .ag-tab-selected:not(:first-of-type) {\\n  border-right-color: var(--ag-border-color);\\n}\\n\\n.ag-theme-quartz .ag-ltr .ag-tab-selected:not(:last-of-type), .ag-theme-quartz-dark .ag-ltr .ag-tab-selected:not(:last-of-type), .ag-theme-quartz-auto-dark .ag-ltr .ag-tab-selected:not(:last-of-type) {\\n  border-right-color: var(--ag-border-color);\\n}\\n\\n.ag-theme-quartz .ag-rtl .ag-tab-selected:not(:last-of-type), .ag-theme-quartz-dark .ag-rtl .ag-tab-selected:not(:last-of-type), .ag-theme-quartz-auto-dark .ag-rtl .ag-tab-selected:not(:last-of-type) {\\n  border-left-color: var(--ag-border-color);\\n}\\n\\n.ag-theme-quartz .ag-tab:not(.ag-tab-selected),\\n.ag-theme-quartz-dark .ag-tab:not(.ag-tab-selected),\\n.ag-theme-quartz-auto-dark .ag-tab:not(.ag-tab-selected) {\\n  opacity: 0.7;\\n}\\n.ag-theme-quartz .ag-tab:not(.ag-tab-selected):hover,\\n.ag-theme-quartz-dark .ag-tab:not(.ag-tab-selected):hover,\\n.ag-the";
      S = S + "me-quartz-auto-dark .ag-tab:not(.ag-tab-selected):hover {\\n  opacity: 1;\\n}\\n.ag-theme-quartz .ag-menu,\\n.ag-theme-quartz-dark .ag-menu,\\n.ag-theme-quartz-auto-dark .ag-menu {\\n  color: color-mix(in srgb, transparent, var(--ag-foreground-color) 95%);\\n}\\n.ag-theme-quartz .ag-panel-content-wrapper .ag-column-select,\\n.ag-theme-quartz-dark .ag-panel-content-wrapper .ag-column-select,\\n.ag-theme-quartz-auto-dark .ag-panel-content-wrapper .ag-column-select {\\n  background-color: var(--ag-control-panel-background-color);\\n  color: color-mix(in srgb, transparent, var(--ag-foreground-color) 95%);\\n}\\n.ag-theme-quartz .ag-menu-option .ag-icon,\\n.ag-theme-quartz-dark .ag-menu-option .ag-icon,\\n.ag-theme-quartz-auto-dark .ag-menu-option .ag-icon {\\n  opacity: 0.65;\\n}\\n.ag-theme-quartz .ag-menu-header,\\n.ag-theme-quartz-dark .ag-menu-header,\\n.ag-theme-quartz-auto-dark .ag-menu-header {\\n  background-color: var(--ag-control-panel-background-color);\\n}\\n.ag-theme-quartz .ag-menu-option,\\n.ag-theme-quartz-dark .ag-menu-option,\\n.ag-theme-quartz-auto-dark .ag-menu-option {\\n  font-weight: 500;\\n  cursor: pointer;\\n}\\n.ag-theme-quartz .ag-ltr .ag-menu-option-popup-pointer .ag-icon, .ag-theme-quartz-dark .ag-ltr .ag-menu-option-popup-pointer .ag-icon, .ag-theme-quartz-auto-dark .ag-ltr .ag-menu-option-popup-pointer .ag-icon {\\n  text-align: right;\\n}\\n\\n.ag-theme-quartz .ag-rtl .ag-menu-option-popup-pointer .ag-icon, .ag-theme-quartz-dark .ag-rtl .ag-menu-option-popup-pointer .ag-icon, .ag-theme-quartz-auto-dark .ag-rtl .ag-menu-option-popup-pointer .ag-icon {\\n  text-align: left;\\n}\\n\\n.ag-theme-quartz .ag-tabs-header,\\n.ag-theme-quartz-dark .ag-tabs-header,\\n.ag-theme-quartz-auto-dark .ag-tabs-header {\\n  border-bottom: var(--ag-borders) var(--ag-border-color);\\n  display: flex;\\n  background-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 5%);\\n}\\n.ag-theme-quartz .ag-side-bar,\\n.ag-theme-quartz-dark .ag-side-bar,\\n.ag-theme-quartz-auto-dark .ag-side-bar {\\n  ";
      S = S + 'background-color: var(--ag-control-panel-background-color);\\n  min-width: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\\n}\\n.ag-theme-quartz .ag-side-buttons,\\n.ag-theme-quartz-dark .ag-side-buttons,\\n.ag-theme-quartz-auto-dark .ag-side-buttons {\\n  padding: 0;\\n  align-self: stretch;\\n  width: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\\n  background: var(--ag-control-panel-background-color);\\n}\\n.ag-theme-quartz .ag-side-button,\\n.ag-theme-quartz-dark .ag-side-button,\\n.ag-theme-quartz-auto-dark .ag-side-button {\\n  border-top: var(--ag-borders) transparent;\\n  border-bottom: var(--ag-borders) transparent;\\n}\\n@media (-webkit-max-device-pixel-ratio: 1.5), (max-resolution: 1.5x) {\\n  .ag-theme-quartz .ag-side-button-label,\\n  .ag-theme-quartz-dark .ag-side-button-label,\\n  .ag-theme-quartz-auto-dark .ag-side-button-label {\\n    font-family: "Segoe UI", var(--ag-font-family);\\n    transform: rotate(0.05deg);\\n  }\\n}\\n.ag-theme-quartz .ag-side-button.ag-selected,\\n.ag-theme-quartz-dark .ag-side-button.ag-selected,\\n.ag-theme-quartz-auto-dark .ag-side-button.ag-selected {\\n  border-bottom-color: var(--ag-border-color);\\n  background-color: var(--ag-background-color);\\n}\\n.ag-theme-quartz .ag-side-button.ag-selected:not(:first-of-type),\\n.ag-theme-quartz-dark .ag-side-button.ag-selected:not(:first-of-type),\\n.ag-theme-quartz-auto-dark .ag-side-button.ag-selected:not(:first-of-type) {\\n  border-top-color: var(--ag-border-color);\\n}\\n.ag-theme-quartz .ag-column-panel-column-select,\\n.ag-theme-quartz-dark .ag-column-panel-column-select,\\n.ag-theme-quartz-auto-dark .ag-column-panel-column-select {\\n  border-top: none;\\n  border-bottom: 1px solid var(--ag-secondary-border-color);\\n}\\n.ag-theme-quartz .ag-filter-toolpanel-search,\\n.ag-theme-quartz-dark .ag-filter-toolpanel-search,\\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-search {\\n  height: auto;\\n  height: initial;\\n  margin-top: var(--ag-widget-container-vertical-padding);\\n}\\n.ag-theme-quartz .ag-f';
      S = S + 'ilter-toolpanel-search-input,\\n.ag-theme-quartz-dark .ag-filter-toolpanel-search-input,\\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-search-input {\\n  margin: 0;\\n}\\n.ag-theme-quartz .ag-filter-apply-panel,\\n.ag-theme-quartz-dark .ag-filter-apply-panel,\\n.ag-theme-quartz-auto-dark .ag-filter-apply-panel {\\n  border: none;\\n  padding-top: var(--ag-widget-vertical-spacing);\\n}\\n.ag-theme-quartz .ag-chart-tabbed-menu-body,\\n.ag-theme-quartz-dark .ag-chart-tabbed-menu-body,\\n.ag-theme-quartz-auto-dark .ag-chart-tabbed-menu-body {\\n  position: relative;\\n}\\n.ag-theme-quartz .ag-chart-tabbed-menu-body::after,\\n.ag-theme-quartz-dark .ag-chart-tabbed-menu-body::after,\\n.ag-theme-quartz-auto-dark .ag-chart-tabbed-menu-body::after {\\n  content: "";\\n  position: absolute;\\n  display: block;\\n  top: 0;\\n  left: 0;\\n  right: 0;\\n  height: 16px;\\n  background: linear-gradient(var(--ag-control-panel-background-color), transparent);\\n}\\n.ag-theme-quartz .ag-charts-settings-group-title-bar,\\n.ag-theme-quartz .ag-charts-data-group-title-bar,\\n.ag-theme-quartz .ag-charts-format-top-level-group-title-bar,\\n.ag-theme-quartz .ag-charts-advanced-settings-top-level-group-title-bar,\\n.ag-theme-quartz .ag-charts-settings-group-container,\\n.ag-theme-quartz-dark .ag-charts-settings-group-title-bar,\\n.ag-theme-quartz-dark .ag-charts-data-group-title-bar,\\n.ag-theme-quartz-dark .ag-charts-format-top-level-group-title-bar,\\n.ag-theme-quartz-dark .ag-charts-advanced-settings-top-level-group-title-bar,\\n.ag-theme-quartz-dark .ag-charts-settings-group-container,\\n.ag-theme-quartz-auto-dark .ag-charts-settings-group-title-bar,\\n.ag-theme-quartz-auto-dark .ag-charts-data-group-title-bar,\\n.ag-theme-quartz-auto-dark .ag-charts-format-top-level-group-title-bar,\\n.ag-theme-quartz-auto-dark .ag-charts-advanced-settings-top-level-group-title-bar,\\n.ag-theme-quartz-auto-dark .ag-charts-settings-group-container {\\n  border-top: none;\\n  font-weight: 500;\\n}\\n.ag-theme-quartz .ag-chart-mini-thumbnail,\\n.a';
      S = S + "g-theme-quartz-dark .ag-chart-mini-thumbnail,\\n.ag-theme-quartz-auto-dark .ag-chart-mini-thumbnail {\\n  background-color: var(--ag-background-color);\\n  margin-top: 0;\\n  margin-bottom: 0;\\n}\\n.ag-theme-quartz .ag-chart-settings-nav-bar,\\n.ag-theme-quartz-dark .ag-chart-settings-nav-bar,\\n.ag-theme-quartz-auto-dark .ag-chart-settings-nav-bar {\\n  border-top: var(--ag-borders-secondary) var(--ag-secondary-border-color);\\n}\\n.ag-theme-quartz .ag-charts-format-sub-level-group-title-bar,\\n.ag-theme-quartz-dark .ag-charts-format-sub-level-group-title-bar,\\n.ag-theme-quartz-auto-dark .ag-charts-format-sub-level-group-title-bar {\\n  background: none;\\n  font-weight: 500;\\n}\\n.ag-theme-quartz .ag-chart-data-section .ag-label:not(.ag-group-title-bar),\\n.ag-theme-quartz .ag-chart-format-section .ag-label:not(.ag-group-title-bar),\\n.ag-theme-quartz-dark .ag-chart-data-section .ag-label:not(.ag-group-title-bar),\\n.ag-theme-quartz-dark .ag-chart-format-section .ag-label:not(.ag-group-title-bar),\\n.ag-theme-quartz-auto-dark .ag-chart-data-section .ag-label:not(.ag-group-title-bar),\\n.ag-theme-quartz-auto-dark .ag-chart-format-section .ag-label:not(.ag-group-title-bar) {\\n  color: var(--ag-chart-menu-label-color);\\n}\\n.ag-theme-quartz .ag-chart-data-section .ag-label-align-top .ag-label,\\n.ag-theme-quartz .ag-chart-format-section .ag-label-align-top .ag-label,\\n.ag-theme-quartz-dark .ag-chart-data-section .ag-label-align-top .ag-label,\\n.ag-theme-quartz-dark .ag-chart-format-section .ag-label-align-top .ag-label,\\n.ag-theme-quartz-auto-dark .ag-chart-data-section .ag-label-align-top .ag-label,\\n.ag-theme-quartz-auto-dark .ag-chart-format-section .ag-label-align-top .ag-label {\\n  margin-top: calc(var(--ag-widget-vertical-spacing) * 0.5);\\n  margin-bottom: var(--ag-widget-vertical-spacing);\\n}\\n.ag-theme-quartz .ag-chart-data-section .ag-slider.ag-label-align-top .ag-label,\\n.ag-theme-quartz .ag-chart-format-section .ag-slider.ag-label-align-top .ag-label,\\n.ag-theme-quartz-dark .a";
      S = S + "g-chart-data-section .ag-slider.ag-label-align-top .ag-label,\\n.ag-theme-quartz-dark .ag-chart-format-section .ag-slider.ag-label-align-top .ag-label,\\n.ag-theme-quartz-auto-dark .ag-chart-data-section .ag-slider.ag-label-align-top .ag-label,\\n.ag-theme-quartz-auto-dark .ag-chart-format-section .ag-slider.ag-label-align-top .ag-label {\\n  margin-bottom: 0;\\n}\\n.ag-theme-quartz .ag-chart-data-section label,\\n.ag-theme-quartz .ag-chart-format-section label,\\n.ag-theme-quartz-dark .ag-chart-data-section label,\\n.ag-theme-quartz-dark .ag-chart-format-section label,\\n.ag-theme-quartz-auto-dark .ag-chart-data-section label,\\n.ag-theme-quartz-auto-dark .ag-chart-format-section label {\\n  display: inline-block;\\n}\\n.ag-theme-quartz .ag-chart-format-wrapper,\\n.ag-theme-quartz .ag-chart-data-wrapper,\\n.ag-theme-quartz .ag-charts-format-top-level-group,\\n.ag-theme-quartz .ag-charts-format-top-level-group-title-bar,\\n.ag-theme-quartz .ag-charts-format-top-level-group .ag-charts-format-top-level-group-container,\\n.ag-theme-quartz .ag-charts-format-top-level-group-item,\\n.ag-theme-quartz .ag-charts-format-sub-level-group,\\n.ag-theme-quartz .ag-charts-format-sub-level-group-title-bar,\\n.ag-theme-quartz .ag-charts-format-sub-level-group-container,\\n.ag-theme-quartz .ag-charts-format-sub-level-group-item:last-child,\\n.ag-theme-quartz .ag-charts-format-sub-level-group-container > *,\\n.ag-theme-quartz .ag-charts-data-group-title-bar,\\n.ag-theme-quartz .ag-charts-data-group-container,\\n.ag-theme-quartz .ag-charts-settings-group-title-bar,\\n.ag-theme-quartz .ag-charts-settings-group-container,\\n.ag-theme-quartz-dark .ag-chart-format-wrapper,\\n.ag-theme-quartz-dark .ag-chart-data-wrapper,\\n.ag-theme-quartz-dark .ag-charts-format-top-level-group,\\n.ag-theme-quartz-dark .ag-charts-format-top-level-group-title-bar,\\n.ag-theme-quartz-dark .ag-charts-format-top-level-group .ag-charts-format-top-level-group-container,\\n.ag-theme-quartz-dark .ag-charts-format-top-level-group-item,\\n.ag-theme-qu";
      S = S + "artz-dark .ag-charts-format-sub-level-group,\\n.ag-theme-quartz-dark .ag-charts-format-sub-level-group-title-bar,\\n.ag-theme-quartz-dark .ag-charts-format-sub-level-group-container,\\n.ag-theme-quartz-dark .ag-charts-format-sub-level-group-item:last-child,\\n.ag-theme-quartz-dark .ag-charts-format-sub-level-group-container > *,\\n.ag-theme-quartz-dark .ag-charts-data-group-title-bar,\\n.ag-theme-quartz-dark .ag-charts-data-group-container,\\n.ag-theme-quartz-dark .ag-charts-settings-group-title-bar,\\n.ag-theme-quartz-dark .ag-charts-settings-group-container,\\n.ag-theme-quartz-auto-dark .ag-chart-format-wrapper,\\n.ag-theme-quartz-auto-dark .ag-chart-data-wrapper,\\n.ag-theme-quartz-auto-dark .ag-charts-format-top-level-group,\\n.ag-theme-quartz-auto-dark .ag-charts-format-top-level-group-title-bar,\\n.ag-theme-quartz-auto-dark .ag-charts-format-top-level-group .ag-charts-format-top-level-group-container,\\n.ag-theme-quartz-auto-dark .ag-charts-format-top-level-group-item,\\n.ag-theme-quartz-auto-dark .ag-charts-format-sub-level-group,\\n.ag-theme-quartz-auto-dark .ag-charts-format-sub-level-group-title-bar,\\n.ag-theme-quartz-auto-dark .ag-charts-format-sub-level-group-container,\\n.ag-theme-quartz-auto-dark .ag-charts-format-sub-level-group-item:last-child,\\n.ag-theme-quartz-auto-dark .ag-charts-format-sub-level-group-container > *,\\n.ag-theme-quartz-auto-dark .ag-charts-data-group-title-bar,\\n.ag-theme-quartz-auto-dark .ag-charts-data-group-container,\\n.ag-theme-quartz-auto-dark .ag-charts-settings-group-title-bar,\\n.ag-theme-quartz-auto-dark .ag-charts-settings-group-container {\\n  padding: 0;\\n  margin: 0;\\n}\\n.ag-theme-quartz .ag-charts-format-top-level-group,\\n.ag-theme-quartz .ag-charts-data-group,\\n.ag-theme-quartz-dark .ag-charts-format-top-level-group,\\n.ag-theme-quartz-dark .ag-charts-data-group,\\n.ag-theme-quartz-auto-dark .ag-charts-format-top-level-group,\\n.ag-theme-quartz-auto-dark .ag-charts-data-group {\\n  border-top: var(--ag-borders-secondary) var(--ag-secondary";
      S = S + "-border-color);\\n}\\n.ag-theme-quartz .ag-charts-format-top-level-group-title-bar,\\n.ag-theme-quartz .ag-charts-data-group-title-bar,\\n.ag-theme-quartz .ag-charts-settings-group-title-bar,\\n.ag-theme-quartz-dark .ag-charts-format-top-level-group-title-bar,\\n.ag-theme-quartz-dark .ag-charts-data-group-title-bar,\\n.ag-theme-quartz-dark .ag-charts-settings-group-title-bar,\\n.ag-theme-quartz-auto-dark .ag-charts-format-top-level-group-title-bar,\\n.ag-theme-quartz-auto-dark .ag-charts-data-group-title-bar,\\n.ag-theme-quartz-auto-dark .ag-charts-settings-group-title-bar {\\n  padding: var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);\\n}\\n.ag-theme-quartz .ag-charts-format-top-level-group .ag-charts-format-top-level-group-container,\\n.ag-theme-quartz .ag-charts-data-group .ag-charts-data-group-container,\\n.ag-theme-quartz .ag-charts-settings-group .ag-charts-settings-group-container,\\n.ag-theme-quartz-dark .ag-charts-format-top-level-group .ag-charts-format-top-level-group-container,\\n.ag-theme-quartz-dark .ag-charts-data-group .ag-charts-data-group-container,\\n.ag-theme-quartz-dark .ag-charts-settings-group .ag-charts-settings-group-container,\\n.ag-theme-quartz-auto-dark .ag-charts-format-top-level-group .ag-charts-format-top-level-group-container,\\n.ag-theme-quartz-auto-dark .ag-charts-data-group .ag-charts-data-group-container,\\n.ag-theme-quartz-auto-dark .ag-charts-settings-group .ag-charts-settings-group-container {\\n  padding: 0 var(--ag-widget-container-horizontal-padding);\\n}\\n.ag-theme-quartz .ag-charts-format-sub-level-group-title-bar,\\n.ag-theme-quartz-dark .ag-charts-format-sub-level-group-title-bar,\\n.ag-theme-quartz-auto-dark .ag-charts-format-sub-level-group-title-bar {\\n  padding: var(--ag-widget-vertical-spacing) 0;\\n}\\n.ag-theme-quartz .ag-charts-format-sub-level-group-container,\\n.ag-theme-quartz-dark .ag-charts-format-sub-level-group-container,\\n.ag-theme-quartz-auto-dark .ag-charts-format-sub-level-group-container";
      S = S + " {\\n  padding-top: var(--ag-widget-vertical-spacing);\\n  padding-bottom: var(--ag-widget-container-vertical-padding);\\n}\\n.ag-theme-quartz .ag-charts-format-top-level-group-container > *,\\n.ag-theme-quartz .ag-charts-format-sub-level-group-container > *,\\n.ag-theme-quartz-dark .ag-charts-format-top-level-group-container > *,\\n.ag-theme-quartz-dark .ag-charts-format-sub-level-group-container > *,\\n.ag-theme-quartz-auto-dark .ag-charts-format-top-level-group-container > *,\\n.ag-theme-quartz-auto-dark .ag-charts-format-sub-level-group-container > * {\\n  margin-bottom: var(--ag-widget-vertical-spacing);\\n}\\n.ag-theme-quartz .ag-charts-data-group-item,\\n.ag-theme-quartz-dark .ag-charts-data-group-item,\\n.ag-theme-quartz-auto-dark .ag-charts-data-group-item {\\n  padding-bottom: var(--ag-widget-container-vertical-padding);\\n}\\n.ag-theme-quartz .ag-chart-settings-mini-wrapper,\\n.ag-theme-quartz-dark .ag-chart-settings-mini-wrapper,\\n.ag-theme-quartz-auto-dark .ag-chart-settings-mini-wrapper {\\n  padding-bottom: var(--ag-widget-container-vertical-padding);\\n}\\n.ag-theme-quartz .ag-chart-advanced-settings-section,\\n.ag-theme-quartz-dark .ag-chart-advanced-settings-section,\\n.ag-theme-quartz-auto-dark .ag-chart-advanced-settings-section {\\n  padding-top: var(--ag-widget-container-vertical-padding);\\n  padding-bottom: var(--ag-widget-container-vertical-padding);\\n}\\n.ag-theme-quartz .ag-charts-advanced-settings-top-level-group .ag-charts-advanced-settings-top-level-group-title-bar,\\n.ag-theme-quartz .ag-charts-advanced-settings-top-level-group .ag-charts-advanced-settings-top-level-group-container,\\n.ag-theme-quartz-dark .ag-charts-advanced-settings-top-level-group .ag-charts-advanced-settings-top-level-group-title-bar,\\n.ag-theme-quartz-dark .ag-charts-advanced-settings-top-level-group .ag-charts-advanced-settings-top-level-group-container,\\n.ag-theme-quartz-auto-dark .ag-charts-advanced-settings-top-level-group .ag-charts-advanced-settings-top-level-group-title-bar,\\n.ag-them";
      S = S + "e-quartz-auto-dark .ag-charts-advanced-settings-top-level-group .ag-charts-advanced-settings-top-level-group-container {\\n  padding: 0 var(--ag-widget-container-horizontal-padding);\\n}\\n.ag-theme-quartz .ag-charts-advanced-settings-top-level-group-container,\\n.ag-theme-quartz-dark .ag-charts-advanced-settings-top-level-group-container,\\n.ag-theme-quartz-auto-dark .ag-charts-advanced-settings-top-level-group-container {\\n  margin: 0;\\n}\\n.ag-theme-quartz .ag-charts-advanced-settings-top-level-group-item,\\n.ag-theme-quartz-dark .ag-charts-advanced-settings-top-level-group-item,\\n.ag-theme-quartz-auto-dark .ag-charts-advanced-settings-top-level-group-item {\\n  margin-top: calc(var(--ag-widget-vertical-spacing) * 2);\\n  margin-bottom: 0;\\n}\\n.ag-theme-quartz .ag-ltr .ag-group-title-bar-icon, .ag-theme-quartz-dark .ag-ltr .ag-group-title-bar-icon, .ag-theme-quartz-auto-dark .ag-ltr .ag-group-title-bar-icon {\\n  margin-right: var(--ag-grid-size);\\n}\\n\\n.ag-theme-quartz .ag-rtl .ag-group-title-bar-icon, .ag-theme-quartz-dark .ag-rtl .ag-group-title-bar-icon, .ag-theme-quartz-auto-dark .ag-rtl .ag-group-title-bar-icon {\\n  margin-left: var(--ag-grid-size);\\n}\\n\\n.ag-theme-quartz .ag-spectrum-color,\\n.ag-theme-quartz .ag-spectrum-fill,\\n.ag-theme-quartz-dark .ag-spectrum-color,\\n.ag-theme-quartz-dark .ag-spectrum-fill,\\n.ag-theme-quartz-auto-dark .ag-spectrum-color,\\n.ag-theme-quartz-auto-dark .ag-spectrum-fill {\\n  border-radius: var(--ag-border-radius);\\n}\\n.ag-theme-quartz .ag-spectrum-dragger,\\n.ag-theme-quartz-dark .ag-spectrum-dragger,\\n.ag-theme-quartz-auto-dark .ag-spectrum-dragger {\\n  border-radius: 18px;\\n  height: 18px;\\n  width: 18px;\\n  border: 3px solid white;\\n}\\n.ag-theme-quartz .ag-spectrum-tools,\\n.ag-theme-quartz-dark .ag-spectrum-tools,\\n.ag-theme-quartz-auto-dark .ag-spectrum-tools {\\n  padding-left: 0;\\n  padding-right: 0;\\n  padding-bottom: 0;\\n}\\n.ag-theme-quartz .ag-spectrum-tool,\\n.ag-theme-quartz-dark .ag-spectrum-tool,\\n.ag-theme-quartz-auto-dark";
      S = S + " .ag-spectrum-tool {\\n  height: 12px;\\n}\\n.ag-theme-quartz .ag-spectrum-hue-background,\\n.ag-theme-quartz .ag-spectrum-alpha-background,\\n.ag-theme-quartz-dark .ag-spectrum-hue-background,\\n.ag-theme-quartz-dark .ag-spectrum-alpha-background,\\n.ag-theme-quartz-auto-dark .ag-spectrum-hue-background,\\n.ag-theme-quartz-auto-dark .ag-spectrum-alpha-background {\\n  border-radius: 12px;\\n}\\n.ag-theme-quartz .ag-spectrum-slider,\\n.ag-theme-quartz-dark .ag-spectrum-slider,\\n.ag-theme-quartz-auto-dark .ag-spectrum-slider {\\n  margin-top: -15px;\\n  width: 18px;\\n  height: 18px;\\n  border-radius: 18px;\\n  border: 3px solid rgb(248, 248, 248);\\n}\\n.ag-theme-quartz .ag-recent-colors,\\n.ag-theme-quartz-dark .ag-recent-colors,\\n.ag-theme-quartz-auto-dark .ag-recent-colors {\\n  margin-left: var(--ag-grid-size);\\n  margin-right: var(--ag-grid-size);\\n  margin-bottom: 2px;\\n}\\n.ag-theme-quartz .ag-color-input-color,\\n.ag-theme-quartz .ag-color-picker-color,\\n.ag-theme-quartz .ag-recent-color,\\n.ag-theme-quartz-dark .ag-color-input-color,\\n.ag-theme-quartz-dark .ag-color-picker-color,\\n.ag-theme-quartz-dark .ag-recent-color,\\n.ag-theme-quartz-auto-dark .ag-color-input-color,\\n.ag-theme-quartz-auto-dark .ag-color-picker-color,\\n.ag-theme-quartz-auto-dark .ag-recent-color {\\n  border-radius: 4px;\\n}\\n.ag-theme-quartz .ag-recent-color,\\n.ag-theme-quartz-dark .ag-recent-color,\\n.ag-theme-quartz-auto-dark .ag-recent-color {\\n  border: var(--ag-borders-secondary) var(--ag-secondary-border-color);\\n}\\n.ag-theme-quartz.ag-dnd-ghost,\\n.ag-theme-quartz-dark.ag-dnd-ghost,\\n.ag-theme-quartz-auto-dark.ag-dnd-ghost {\\n  font-weight: 500;\\n}\\n.ag-theme-quartz .ag-standard-button,\\n.ag-theme-quartz-dark .ag-standard-button,\\n.ag-theme-quartz-auto-dark .ag-standard-button {\\n  font-family: inherit;\\n  -moz-appearance: none;\\n       appearance: none;\\n  -webkit-appearance: none;\\n  border-radius: var(--ag-border-radius);\\n  border: solid 1px var(--ag-input-border-color);\\n  background-color: var(--ag-b";
      S = S + "ackground-color);\\n  padding: var(--ag-grid-size) calc(var(--ag-grid-size) * 2);\\n  cursor: pointer;\\n}\\n.ag-theme-quartz .ag-standard-button:hover,\\n.ag-theme-quartz-dark .ag-standard-button:hover,\\n.ag-theme-quartz-auto-dark .ag-standard-button:hover {\\n  background-color: var(--ag-row-hover-color);\\n}\\n.ag-theme-quartz .ag-standard-button:active,\\n.ag-theme-quartz-dark .ag-standard-button:active,\\n.ag-theme-quartz-auto-dark .ag-standard-button:active {\\n  border-color: var(--ag-active-color);\\n}\\n.ag-theme-quartz .ag-standard-button:disabled,\\n.ag-theme-quartz-dark .ag-standard-button:disabled,\\n.ag-theme-quartz-auto-dark .ag-standard-button:disabled {\\n  color: var(--ag-disabled-foreground-color);\\n  background-color: var(--ag-input-disabled-background-color);\\n  border-color: var(--ag-input-disabled-border-color);\\n}\\n.ag-theme-quartz .ag-column-drop-cell,\\n.ag-theme-quartz-dark .ag-column-drop-cell,\\n.ag-theme-quartz-auto-dark .ag-column-drop-cell {\\n  border-radius: calc(var(--ag-grid-size) * 3);\\n  height: calc(var(--ag-grid-size) * 3);\\n  padding: 0 var(--ag-grid-size);\\n}\\n.ag-theme-quartz .ag-column-drop-cell-button,\\n.ag-theme-quartz-dark .ag-column-drop-cell-button,\\n.ag-theme-quartz-auto-dark .ag-column-drop-cell-button {\\n  min-width: 0;\\n  margin: 0;\\n}\\n.ag-theme-quartz .ag-column-drop-cell-drag-handle,\\n.ag-theme-quartz-dark .ag-column-drop-cell-drag-handle,\\n.ag-theme-quartz-auto-dark .ag-column-drop-cell-drag-handle {\\n  margin-left: 0;\\n}\\n.ag-theme-quartz .ag-column-drop-vertical,\\n.ag-theme-quartz-dark .ag-column-drop-vertical,\\n.ag-theme-quartz-auto-dark .ag-column-drop-vertical {\\n  min-height: 75px;\\n}\\n.ag-theme-quartz .ag-column-drop-vertical-title-bar,\\n.ag-theme-quartz-dark .ag-column-drop-vertical-title-bar,\\n.ag-theme-quartz-auto-dark .ag-column-drop-vertical-title-bar {\\n  padding: var(--ag-widget-container-vertical-padding) calc(var(--ag-grid-size) * 2) 0;\\n}\\n.ag-theme-quartz .ag-ltr .ag-column-drop-vertical-icon, .ag-theme-quartz-";
      S = S + "dark .ag-ltr .ag-column-drop-vertical-icon, .ag-theme-quartz-auto-dark .ag-ltr .ag-column-drop-vertical-icon {\\n  margin-left: 0;\\n  margin-right: var(--ag-widget-horizontal-spacing);\\n}\\n\\n.ag-theme-quartz .ag-rtl .ag-column-drop-vertical-icon, .ag-theme-quartz-dark .ag-rtl .ag-column-drop-vertical-icon, .ag-theme-quartz-auto-dark .ag-rtl .ag-column-drop-vertical-icon {\\n  margin-right: 0;\\n  margin-left: var(--ag-widget-horizontal-spacing);\\n}\\n\\n.ag-theme-quartz .ag-column-drop-vertical-empty-message,\\n.ag-theme-quartz-dark .ag-column-drop-vertical-empty-message,\\n.ag-theme-quartz-auto-dark .ag-column-drop-vertical-empty-message {\\n  display: flex;\\n  align-items: center;\\n  justify-content: center;\\n  border: dashed 1px;\\n  border-color: var(--ag-border-color);\\n  margin: calc(var(--ag-grid-size) * 1.5) calc(var(--ag-grid-size) * 2);\\n  padding: calc(var(--ag-grid-size) * 2);\\n}\\n.ag-theme-quartz .ag-column-drop-empty-message,\\n.ag-theme-quartz-dark .ag-column-drop-empty-message,\\n.ag-theme-quartz-auto-dark .ag-column-drop-empty-message {\\n  color: var(--ag-foreground-color);\\n}\\n.ag-theme-quartz .ag-pill-select .ag-column-drop,\\n.ag-theme-quartz-dark .ag-pill-select .ag-column-drop,\\n.ag-theme-quartz-auto-dark .ag-pill-select .ag-column-drop {\\n  min-height: 0;\\n  min-height: initial;\\n}\\n.ag-theme-quartz .ag-pill-select .ag-picker-field-display,\\n.ag-theme-quartz-dark .ag-pill-select .ag-picker-field-display,\\n.ag-theme-quartz-auto-dark .ag-pill-select .ag-picker-field-display {\\n  font-weight: 500;\\n  color: var(--ag-chart-menu-pill-select-button-color);\\n}\\n.ag-theme-quartz .ag-pill-select .ag-picker-field-icon .ag-icon,\\n.ag-theme-quartz-dark .ag-pill-select .ag-picker-field-icon .ag-icon,\\n.ag-theme-quartz-auto-dark .ag-pill-select .ag-picker-field-icon .ag-icon {\\n  color: var(--ag-chart-menu-pill-select-button-color);\\n}\\n.ag-theme-quartz .ag-status-bar,\\n.ag-theme-quartz-dark .ag-status-bar,\\n.ag-theme-quartz-auto-dark .ag-status-bar {\\n  font-weight: n";
      S = S + "ormal;\\n}\\n.ag-theme-quartz .ag-status-name-value,\\n.ag-theme-quartz-dark .ag-status-name-value,\\n.ag-theme-quartz-auto-dark .ag-status-name-value {\\n  padding: var(--ag-widget-container-vertical-padding) 0;\\n}\\n.ag-theme-quartz .ag-status-name-value-value,\\n.ag-theme-quartz .ag-paging-number,\\n.ag-theme-quartz .ag-paging-row-summary-panel-number,\\n.ag-theme-quartz-dark .ag-status-name-value-value,\\n.ag-theme-quartz-dark .ag-paging-number,\\n.ag-theme-quartz-dark .ag-paging-row-summary-panel-number,\\n.ag-theme-quartz-auto-dark .ag-status-name-value-value,\\n.ag-theme-quartz-auto-dark .ag-paging-number,\\n.ag-theme-quartz-auto-dark .ag-paging-row-summary-panel-number {\\n  font-weight: 500;\\n}\\n.ag-theme-quartz .ag-column-drop-cell-button,\\n.ag-theme-quartz-dark .ag-column-drop-cell-button,\\n.ag-theme-quartz-auto-dark .ag-column-drop-cell-button {\\n  opacity: 0.75;\\n}\\n.ag-theme-quartz .ag-column-drop-cell-button:hover,\\n.ag-theme-quartz-dark .ag-column-drop-cell-button:hover,\\n.ag-theme-quartz-auto-dark .ag-column-drop-cell-button:hover {\\n  opacity: 1;\\n}\\n.ag-theme-quartz .ag-header-cell-menu-button,\\n.ag-theme-quartz .ag-header-cell-filter-button,\\n.ag-theme-quartz .ag-panel-title-bar-button,\\n.ag-theme-quartz .ag-header-expand-icon,\\n.ag-theme-quartz .ag-column-group-icons,\\n.ag-theme-quartz .ag-set-filter-group-icons,\\n.ag-theme-quartz .ag-group-expanded .ag-icon,\\n.ag-theme-quartz .ag-group-contracted .ag-icon,\\n.ag-theme-quartz .ag-chart-settings-prev,\\n.ag-theme-quartz .ag-chart-settings-next,\\n.ag-theme-quartz .ag-group-title-bar-icon,\\n.ag-theme-quartz .ag-column-select-header-icon,\\n.ag-theme-quartz .ag-floating-filter-button-button,\\n.ag-theme-quartz .ag-filter-toolpanel-expand,\\n.ag-theme-quartz .ag-panel-title-bar-button-icon,\\n.ag-theme-quartz .ag-chart-menu-icon,\\n.ag-theme-quartz-dark .ag-header-cell-menu-button,\\n.ag-theme-quartz-dark .ag-header-cell-filter-button,\\n.ag-theme-quartz-dark .ag-panel-title-bar-button,\\n.ag-theme-quartz-dark .ag-header-exp";
      S = S + "and-icon,\\n.ag-theme-quartz-dark .ag-column-group-icons,\\n.ag-theme-quartz-dark .ag-set-filter-group-icons,\\n.ag-theme-quartz-dark .ag-group-expanded .ag-icon,\\n.ag-theme-quartz-dark .ag-group-contracted .ag-icon,\\n.ag-theme-quartz-dark .ag-chart-settings-prev,\\n.ag-theme-quartz-dark .ag-chart-settings-next,\\n.ag-theme-quartz-dark .ag-group-title-bar-icon,\\n.ag-theme-quartz-dark .ag-column-select-header-icon,\\n.ag-theme-quartz-dark .ag-floating-filter-button-button,\\n.ag-theme-quartz-dark .ag-filter-toolpanel-expand,\\n.ag-theme-quartz-dark .ag-panel-title-bar-button-icon,\\n.ag-theme-quartz-dark .ag-chart-menu-icon,\\n.ag-theme-quartz-auto-dark .ag-header-cell-menu-button,\\n.ag-theme-quartz-auto-dark .ag-header-cell-filter-button,\\n.ag-theme-quartz-auto-dark .ag-panel-title-bar-button,\\n.ag-theme-quartz-auto-dark .ag-header-expand-icon,\\n.ag-theme-quartz-auto-dark .ag-column-group-icons,\\n.ag-theme-quartz-auto-dark .ag-set-filter-group-icons,\\n.ag-theme-quartz-auto-dark .ag-group-expanded .ag-icon,\\n.ag-theme-quartz-auto-dark .ag-group-contracted .ag-icon,\\n.ag-theme-quartz-auto-dark .ag-chart-settings-prev,\\n.ag-theme-quartz-auto-dark .ag-chart-settings-next,\\n.ag-theme-quartz-auto-dark .ag-group-title-bar-icon,\\n.ag-theme-quartz-auto-dark .ag-column-select-header-icon,\\n.ag-theme-quartz-auto-dark .ag-floating-filter-button-button,\\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-expand,\\n.ag-theme-quartz-auto-dark .ag-panel-title-bar-button-icon,\\n.ag-theme-quartz-auto-dark .ag-chart-menu-icon {\\n  --ag-quartz-icon-hover-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 10%);\\n}\\n.ag-theme-quartz .ag-header-cell-menu-button:hover,\\n.ag-theme-quartz .ag-header-cell-filter-button:hover,\\n.ag-theme-quartz .ag-panel-title-bar-button:hover,\\n.ag-theme-quartz .ag-header-expand-icon:hover,\\n.ag-theme-quartz .ag-column-group-icons:hover,\\n.ag-theme-quartz .ag-set-filter-group-icons:hover,\\n.ag-theme-quartz .ag-group-expanded .ag-icon:hover,\\n.ag-theme-quartz";
      S = S + " .ag-group-contracted .ag-icon:hover,\\n.ag-theme-quartz .ag-chart-settings-prev:hover,\\n.ag-theme-quartz .ag-chart-settings-next:hover,\\n.ag-theme-quartz .ag-group-title-bar-icon:hover,\\n.ag-theme-quartz .ag-column-select-header-icon:hover,\\n.ag-theme-quartz .ag-floating-filter-button-button:hover,\\n.ag-theme-quartz .ag-filter-toolpanel-expand:hover,\\n.ag-theme-quartz .ag-panel-title-bar-button-icon:hover,\\n.ag-theme-quartz .ag-chart-menu-icon:hover,\\n.ag-theme-quartz-dark .ag-header-cell-menu-button:hover,\\n.ag-theme-quartz-dark .ag-header-cell-filter-button:hover,\\n.ag-theme-quartz-dark .ag-panel-title-bar-button:hover,\\n.ag-theme-quartz-dark .ag-header-expand-icon:hover,\\n.ag-theme-quartz-dark .ag-column-group-icons:hover,\\n.ag-theme-quartz-dark .ag-set-filter-group-icons:hover,\\n.ag-theme-quartz-dark .ag-group-expanded .ag-icon:hover,\\n.ag-theme-quartz-dark .ag-group-contracted .ag-icon:hover,\\n.ag-theme-quartz-dark .ag-chart-settings-prev:hover,\\n.ag-theme-quartz-dark .ag-chart-settings-next:hover,\\n.ag-theme-quartz-dark .ag-group-title-bar-icon:hover,\\n.ag-theme-quartz-dark .ag-column-select-header-icon:hover,\\n.ag-theme-quartz-dark .ag-floating-filter-button-button:hover,\\n.ag-theme-quartz-dark .ag-filter-toolpanel-expand:hover,\\n.ag-theme-quartz-dark .ag-panel-title-bar-button-icon:hover,\\n.ag-theme-quartz-dark .ag-chart-menu-icon:hover,\\n.ag-theme-quartz-auto-dark .ag-header-cell-menu-button:hover,\\n.ag-theme-quartz-auto-dark .ag-header-cell-filter-button:hover,\\n.ag-theme-quartz-auto-dark .ag-panel-title-bar-button:hover,\\n.ag-theme-quartz-auto-dark .ag-header-expand-icon:hover,\\n.ag-theme-quartz-auto-dark .ag-column-group-icons:hover,\\n.ag-theme-quartz-auto-dark .ag-set-filter-group-icons:hover,\\n.ag-theme-quartz-auto-dark .ag-group-expanded .ag-icon:hover,\\n.ag-theme-quartz-auto-dark .ag-group-contracted .ag-icon:hover,\\n.ag-theme-quartz-auto-dark .ag-chart-settings-prev:hover,\\n.ag-theme-quartz-auto-dark .ag-chart-settings-next:hover,\\n.ag-theme-quartz-";
      S = S + 'auto-dark .ag-group-title-bar-icon:hover,\\n.ag-theme-quartz-auto-dark .ag-column-select-header-icon:hover,\\n.ag-theme-quartz-auto-dark .ag-floating-filter-button-button:hover,\\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-expand:hover,\\n.ag-theme-quartz-auto-dark .ag-panel-title-bar-button-icon:hover,\\n.ag-theme-quartz-auto-dark .ag-chart-menu-icon:hover {\\n  border-radius: 1px;\\n  background-color: var(--ag-quartz-icon-hover-color);\\n  box-shadow: 0 0 0 4px var(--ag-quartz-icon-hover-color);\\n}\\n.ag-theme-quartz .ag-filter-active,\\n.ag-theme-quartz-dark .ag-filter-active,\\n.ag-theme-quartz-auto-dark .ag-filter-active {\\n  --ag-quartz-icon-active-color: color-mix(in srgb, transparent, var(--ag-active-color) 14%);\\n  --ag-quartz-icon-hover-color: color-mix(in srgb, transparent, var(--ag-active-color) 28%);\\n  position: relative;\\n  border-radius: 1px;\\n  background-color: var(--ag-quartz-icon-active-color);\\n  box-shadow: 0 0 0 4px var(--ag-quartz-icon-active-color);\\n}\\n.ag-theme-quartz .ag-filter-active::after,\\n.ag-theme-quartz-dark .ag-filter-active::after,\\n.ag-theme-quartz-auto-dark .ag-filter-active::after {\\n  content: "";\\n  position: absolute;\\n  width: 6px;\\n  height: 6px;\\n  top: -1px;\\n  right: -1px;\\n  border-radius: 50%;\\n  background-color: var(--ag-active-color);\\n}\\n.ag-theme-quartz .ag-filter-active .ag-icon-filter,\\n.ag-theme-quartz-dark .ag-filter-active .ag-icon-filter,\\n.ag-theme-quartz-auto-dark .ag-filter-active .ag-icon-filter {\\n  clip-path: path("M8,0C8,4.415 11.585,8 16,8L16,16L0,16L0,0L8,0Z");\\n}\\n.ag-theme-quartz .ag-chart-menu,\\n.ag-theme-quartz-dark .ag-chart-menu,\\n.ag-theme-quartz-auto-dark .ag-chart-menu {\\n  --ag-icon-size: 20px;\\n  background-color: color-mix(in srgb, transparent, var(--ag-background-color) 30%);\\n  padding: 4px 2px;\\n}\\n.ag-theme-quartz .ag-chart-menu-icon,\\n.ag-theme-quartz-dark .ag-chart-menu-icon,\\n.ag-theme-quartz-auto-dark .ag-chart-menu-icon {\\n  opacity: 0.8;\\n}\\n.ag-theme-quartz .ag-drag-handle,\\n.ag-';
      S = S + "theme-quartz-dark .ag-drag-handle,\\n.ag-theme-quartz-auto-dark .ag-drag-handle {\\n  color: var(--ag-icon-font-color);\\n}\\n.ag-theme-quartz .ag-menu-option-icon,\\n.ag-theme-quartz .ag-compact-menu-option-icon,\\n.ag-theme-quartz-dark .ag-menu-option-icon,\\n.ag-theme-quartz-dark .ag-compact-menu-option-icon,\\n.ag-theme-quartz-auto-dark .ag-menu-option-icon,\\n.ag-theme-quartz-auto-dark .ag-compact-menu-option-icon {\\n  width: var(--ag-icon-size);\\n  cursor: pointer;\\n}\\n.ag-theme-quartz .ag-ltr .ag-menu-option-icon, .ag-theme-quartz .ag-ltr .ag-compact-menu-option-icon, .ag-theme-quartz-dark .ag-ltr .ag-menu-option-icon, .ag-theme-quartz-dark .ag-ltr .ag-compact-menu-option-icon, .ag-theme-quartz-auto-dark .ag-ltr .ag-menu-option-icon, .ag-theme-quartz-auto-dark .ag-ltr .ag-compact-menu-option-icon {\\n  padding-left: calc(var(--ag-grid-size) * 1.5);\\n}\\n\\n.ag-theme-quartz .ag-rtl .ag-menu-option-icon, .ag-theme-quartz .ag-rtl .ag-compact-menu-option-icon, .ag-theme-quartz-dark .ag-rtl .ag-menu-option-icon, .ag-theme-quartz-dark .ag-rtl .ag-compact-menu-option-icon, .ag-theme-quartz-auto-dark .ag-rtl .ag-menu-option-icon, .ag-theme-quartz-auto-dark .ag-rtl .ag-compact-menu-option-icon {\\n  padding-right: calc(var(--ag-grid-size) * 1.5);\\n}\\n\\n.ag-theme-quartz .ag-chart-settings-card-item.ag-not-selected:hover,\\n.ag-theme-quartz-dark .ag-chart-settings-card-item.ag-not-selected:hover,\\n.ag-theme-quartz-auto-dark .ag-chart-settings-card-item.ag-not-selected:hover {\\n  opacity: 0.35;\\n}\\n.ag-theme-quartz .ag-ltr .ag-panel-title-bar-button, .ag-theme-quartz-dark .ag-ltr .ag-panel-title-bar-button, .ag-theme-quartz-auto-dark .ag-ltr .ag-panel-title-bar-button {\\n  margin-left: calc(var(--ag-grid-size) * 2);\\n  margin-right: var(--ag-grid-size);\\n}\\n\\n.ag-theme-quartz .ag-rtl .ag-panel-title-bar-button, .ag-theme-quartz-dark .ag-rtl .ag-panel-title-bar-button, .ag-theme-quartz-auto-dark .ag-rtl .ag-panel-title-bar-button {\\n  margin-right: calc(var(--ag-grid-size) * 2);\\n  mar";
      S = S + "gin-left: var(--ag-grid-size);\\n}\\n\\n.ag-theme-quartz .ag-multi-filter-group-title-bar,\\n.ag-theme-quartz-dark .ag-multi-filter-group-title-bar,\\n.ag-theme-quartz-auto-dark .ag-multi-filter-group-title-bar {\\n  padding: calc(var(--ag-grid-size) * 1.5) var(--ag-grid-size);\\n}\\n.ag-theme-quartz .ag-ltr .ag-filter-toolpanel-instance-body, .ag-theme-quartz-dark .ag-ltr .ag-filter-toolpanel-instance-body, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-toolpanel-instance-body {\\n  padding-left: var(--ag-grid-size);\\n}\\n\\n.ag-theme-quartz .ag-rtl .ag-filter-toolpanel-instance-body, .ag-theme-quartz-dark .ag-rtl .ag-filter-toolpanel-instance-body, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-toolpanel-instance-body {\\n  padding-right: var(--ag-grid-size);\\n}\\n\\n.ag-theme-quartz .ag-filter-toolpanel-instance-filter,\\n.ag-theme-quartz-dark .ag-filter-toolpanel-instance-filter,\\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-instance-filter {\\n  border: none;\\n  background-color: var(--ag-control-panel-background-color);\\n}\\n.ag-theme-quartz .ag-ltr .ag-filter-toolpanel-instance-filter, .ag-theme-quartz-dark .ag-ltr .ag-filter-toolpanel-instance-filter, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-toolpanel-instance-filter {\\n  margin-left: calc(var(--ag-icon-size) * 0.5);\\n}\\n\\n.ag-theme-quartz .ag-rtl .ag-filter-toolpanel-instance-filter, .ag-theme-quartz-dark .ag-rtl .ag-filter-toolpanel-instance-filter, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-toolpanel-instance-filter {\\n  margin-right: calc(var(--ag-icon-size) * 0.5);\\n}\\n\\n.ag-theme-quartz .ag-filter-toolpanel-group-level-0,\\n.ag-theme-quartz-dark .ag-filter-toolpanel-group-level-0,\\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-group-level-0 {\\n  border-top: none;\\n}\\n.ag-theme-quartz .ag-filter-toolpanel-header,\\n.ag-theme-quartz-dark .ag-filter-toolpanel-header,\\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-header {\\n  height: auto;\\n  height: initial;\\n  padding-top: var(--ag-grid-size);\\n  padding-botto";
      S = S + "m: var(--ag-grid-size);\\n}\\n.ag-theme-quartz .ag-filter-toolpanel-group-item,\\n.ag-theme-quartz-dark .ag-filter-toolpanel-group-item,\\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-group-item {\\n  margin: 0;\\n}\\n.ag-theme-quartz .ag-layout-auto-height .ag-center-cols-viewport,\\n.ag-theme-quartz .ag-layout-auto-height .ag-center-cols-container,\\n.ag-theme-quartz .ag-layout-print .ag-center-cols-viewport,\\n.ag-theme-quartz .ag-layout-print .ag-center-cols-container,\\n.ag-theme-quartz-dark .ag-layout-auto-height .ag-center-cols-viewport,\\n.ag-theme-quartz-dark .ag-layout-auto-height .ag-center-cols-container,\\n.ag-theme-quartz-dark .ag-layout-print .ag-center-cols-viewport,\\n.ag-theme-quartz-dark .ag-layout-print .ag-center-cols-container,\\n.ag-theme-quartz-auto-dark .ag-layout-auto-height .ag-center-cols-viewport,\\n.ag-theme-quartz-auto-dark .ag-layout-auto-height .ag-center-cols-container,\\n.ag-theme-quartz-auto-dark .ag-layout-print .ag-center-cols-viewport,\\n.ag-theme-quartz-auto-dark .ag-layout-print .ag-center-cols-container {\\n  min-height: 150px;\\n}\\n.ag-theme-quartz .ag-overlay-no-rows-wrapper.ag-layout-auto-height,\\n.ag-theme-quartz-dark .ag-overlay-no-rows-wrapper.ag-layout-auto-height,\\n.ag-theme-quartz-auto-dark .ag-overlay-no-rows-wrapper.ag-layout-auto-height {\\n  padding-top: 60px;\\n}\\n.ag-theme-quartz .ag-date-time-list-page-entry-is-current,\\n.ag-theme-quartz-dark .ag-date-time-list-page-entry-is-current,\\n.ag-theme-quartz-auto-dark .ag-date-time-list-page-entry-is-current {\\n  background-color: var(--ag-active-color);\\n}\\n.ag-theme-quartz .ag-advanced-filter-builder-button,\\n.ag-theme-quartz-dark .ag-advanced-filter-builder-button,\\n.ag-theme-quartz-auto-dark .ag-advanced-filter-builder-button {\\n  padding: var(--ag-grid-size);\\n  font-weight: 600;\\n}\\n.ag-theme-quartz .ag-advanced-filter-builder-item-button-disabled .ag-icon,\\n.ag-theme-quartz .ag-disabled .ag-icon,\\n.ag-theme-quartz .ag-column-select-column-group-readonly .ag-icon,\\n.ag-theme-qua";
      S = S + "rtz [disabled] .ag-icon,\\n.ag-theme-quartz-dark .ag-advanced-filter-builder-item-button-disabled .ag-icon,\\n.ag-theme-quartz-dark .ag-disabled .ag-icon,\\n.ag-theme-quartz-dark .ag-column-select-column-group-readonly .ag-icon,\\n.ag-theme-quartz-dark [disabled] .ag-icon,\\n.ag-theme-quartz-auto-dark .ag-advanced-filter-builder-item-button-disabled .ag-icon,\\n.ag-theme-quartz-auto-dark .ag-disabled .ag-icon,\\n.ag-theme-quartz-auto-dark .ag-column-select-column-group-readonly .ag-icon,\\n.ag-theme-quartz-auto-dark [disabled] .ag-icon {\\n  opacity: 0.6;\\n}\\n.ag-theme-quartz .ag-icon-grip,\\n.ag-theme-quartz-dark .ag-icon-grip,\\n.ag-theme-quartz-auto-dark .ag-icon-grip {\\n  opacity: 0.7;\\n}\\n.ag-theme-quartz .ag-column-select-column-readonly.ag-icon-grip,\\n.ag-theme-quartz .ag-column-select-column-readonly .ag-icon-grip,\\n.ag-theme-quartz-dark .ag-column-select-column-readonly.ag-icon-grip,\\n.ag-theme-quartz-dark .ag-column-select-column-readonly .ag-icon-grip,\\n.ag-theme-quartz-auto-dark .ag-column-select-column-readonly.ag-icon-grip,\\n.ag-theme-quartz-auto-dark .ag-column-select-column-readonly .ag-icon-grip {\\n  opacity: 0.35;\\n}\\n.ag-theme-quartz .ag-column-select-header-filter-wrapper .ag-input-wrapper::before,\\n.ag-theme-quartz .ag-filter-toolpanel-search .ag-input-wrapper::before,\\n.ag-theme-quartz .ag-mini-filter .ag-input-wrapper::before,\\n.ag-theme-quartz .ag-filter-filter .ag-input-wrapper::before,\\n.ag-theme-quartz-dark .ag-column-select-header-filter-wrapper .ag-input-wrapper::before,\\n.ag-theme-quartz-dark .ag-filter-toolpanel-search .ag-input-wrapper::before,\\n.ag-theme-quartz-dark .ag-mini-filter .ag-input-wrapper::before,\\n.ag-theme-quartz-dark .ag-filter-filter .ag-input-wrapper::before,\\n.ag-theme-quartz-auto-dark .ag-column-select-header-filter-wrapper .ag-input-wrapper::before,\\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-search .ag-input-wrapper::before,\\n.ag-theme-quartz-auto-dark .ag-mini-filter .ag-input-wrapper::before,\\n.ag-theme-quartz-auto-da";
      S = S + 'rk .ag-filter-filter .ag-input-wrapper::before {\\n  position: absolute;\\n  display: block;\\n  width: 12px;\\n  height: 12px;\\n  background-image: url(\'+d+\');\\n  background-position: 50% 50%;\\n  background-size: contain;\\n  opacity: 0.4;\\n  content: "";\\n  filter: var(--ag-icon-filter);\\n}\\n.ag-theme-quartz .ag-ltr .ag-column-select-header-filter-wrapper .ag-input-wrapper::before, .ag-theme-quartz .ag-ltr .ag-filter-toolpanel-search .ag-input-wrapper::before, .ag-theme-quartz .ag-ltr .ag-mini-filter .ag-input-wrapper::before, .ag-theme-quartz .ag-ltr .ag-filter-filter .ag-input-wrapper::before, .ag-theme-quartz-dark .ag-ltr .ag-column-select-header-filter-wrapper .ag-input-wrapper::before, .ag-theme-quartz-dark .ag-ltr .ag-filter-toolpanel-search .ag-input-wrapper::before, .ag-theme-quartz-dark .ag-ltr .ag-mini-filter .ag-input-wrapper::before, .ag-theme-quartz-dark .ag-ltr .ag-filter-filter .ag-input-wrapper::before, .ag-theme-quartz-auto-dark .ag-ltr .ag-column-select-header-filter-wrapper .ag-input-wrapper::before, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-toolpanel-search .ag-input-wrapper::before, .ag-theme-quartz-auto-dark .ag-ltr .ag-mini-filter .ag-input-wrapper::before, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-filter .ag-input-wrapper::before {\\n  margin-left: var(--ag-grid-size);\\n}\\n\\n.ag-theme-quartz .ag-rtl .ag-column-select-header-filter-wrapper .ag-input-wrapper::before, .ag-theme-quartz .ag-rtl .ag-filter-toolpanel-search .ag-input-wrapper::before, .ag-theme-quartz .ag-rtl .ag-mini-filter .ag-input-wrapper::before, .ag-theme-quartz .ag-rtl .ag-filter-filter .ag-input-wrapper::before, .ag-theme-quartz-dark .ag-rtl .ag-column-select-header-filter-wrapper .ag-input-wrapper::before, .ag-theme-quartz-dark .ag-rtl .ag-filter-toolpanel-search .ag-input-wrapper::before, .ag-theme-quartz-dark .ag-rtl .ag-mini-filter .ag-input-wrapper::before, .ag-theme-quartz-dark .ag-rtl .ag-filter-filter .ag-input-wrapper::before, .ag-theme-quartz-auto-dark .ag-rtl .';
      S = S + "ag-column-select-header-filter-wrapper .ag-input-wrapper::before, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-toolpanel-search .ag-input-wrapper::before, .ag-theme-quartz-auto-dark .ag-rtl .ag-mini-filter .ag-input-wrapper::before, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-filter .ag-input-wrapper::before {\\n  margin-right: var(--ag-grid-size);\\n}\\n\\n.ag-theme-quartz .ag-ltr .ag-column-select-header-filter-wrapper input.ag-text-field-input, .ag-theme-quartz .ag-ltr .ag-column-select-header-filter-wrapper input.ag-number-field-input, .ag-theme-quartz .ag-ltr .ag-filter-toolpanel-search input.ag-text-field-input, .ag-theme-quartz .ag-ltr .ag-filter-toolpanel-search input.ag-number-field-input, .ag-theme-quartz .ag-ltr .ag-mini-filter input.ag-text-field-input, .ag-theme-quartz .ag-ltr .ag-mini-filter input.ag-number-field-input, .ag-theme-quartz .ag-ltr .ag-filter-filter input.ag-text-field-input, .ag-theme-quartz .ag-ltr .ag-filter-filter input.ag-number-field-input, .ag-theme-quartz-dark .ag-ltr .ag-column-select-header-filter-wrapper input.ag-text-field-input, .ag-theme-quartz-dark .ag-ltr .ag-column-select-header-filter-wrapper input.ag-number-field-input, .ag-theme-quartz-dark .ag-ltr .ag-filter-toolpanel-search input.ag-text-field-input, .ag-theme-quartz-dark .ag-ltr .ag-filter-toolpanel-search input.ag-number-field-input, .ag-theme-quartz-dark .ag-ltr .ag-mini-filter input.ag-text-field-input, .ag-theme-quartz-dark .ag-ltr .ag-mini-filter input.ag-number-field-input, .ag-theme-quartz-dark .ag-ltr .ag-filter-filter input.ag-text-field-input, .ag-theme-quartz-dark .ag-ltr .ag-filter-filter input.ag-number-field-input, .ag-theme-quartz-auto-dark .ag-ltr .ag-column-select-header-filter-wrapper input.ag-text-field-input, .ag-theme-quartz-auto-dark .ag-ltr .ag-column-select-header-filter-wrapper input.ag-number-field-input, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-toolpanel-search input.ag-text-field-input, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-too";
      S = S + "lpanel-search input.ag-number-field-input, .ag-theme-quartz-auto-dark .ag-ltr .ag-mini-filter input.ag-text-field-input, .ag-theme-quartz-auto-dark .ag-ltr .ag-mini-filter input.ag-number-field-input, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-filter input.ag-text-field-input, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-filter input.ag-number-field-input {\\n  padding-left: 26px;\\n}\\n\\n.ag-theme-quartz .ag-rtl .ag-column-select-header-filter-wrapper input.ag-text-field-input, .ag-theme-quartz .ag-rtl .ag-column-select-header-filter-wrapper input.ag-number-field-input, .ag-theme-quartz .ag-rtl .ag-filter-toolpanel-search input.ag-text-field-input, .ag-theme-quartz .ag-rtl .ag-filter-toolpanel-search input.ag-number-field-input, .ag-theme-quartz .ag-rtl .ag-mini-filter input.ag-text-field-input, .ag-theme-quartz .ag-rtl .ag-mini-filter input.ag-number-field-input, .ag-theme-quartz .ag-rtl .ag-filter-filter input.ag-text-field-input, .ag-theme-quartz .ag-rtl .ag-filter-filter input.ag-number-field-input, .ag-theme-quartz-dark .ag-rtl .ag-column-select-header-filter-wrapper input.ag-text-field-input, .ag-theme-quartz-dark .ag-rtl .ag-column-select-header-filter-wrapper input.ag-number-field-input, .ag-theme-quartz-dark .ag-rtl .ag-filter-toolpanel-search input.ag-text-field-input, .ag-theme-quartz-dark .ag-rtl .ag-filter-toolpanel-search input.ag-number-field-input, .ag-theme-quartz-dark .ag-rtl .ag-mini-filter input.ag-text-field-input, .ag-theme-quartz-dark .ag-rtl .ag-mini-filter input.ag-number-field-input, .ag-theme-quartz-dark .ag-rtl .ag-filter-filter input.ag-text-field-input, .ag-theme-quartz-dark .ag-rtl .ag-filter-filter input.ag-number-field-input, .ag-theme-quartz-auto-dark .ag-rtl .ag-column-select-header-filter-wrapper input.ag-text-field-input, .ag-theme-quartz-auto-dark .ag-rtl .ag-column-select-header-filter-wrapper input.ag-number-field-input, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-toolpanel-search input.ag-text-field-input, .ag-theme-quart";
      S = S + "z-auto-dark .ag-rtl .ag-filter-toolpanel-search input.ag-number-field-input, .ag-theme-quartz-auto-dark .ag-rtl .ag-mini-filter input.ag-text-field-input, .ag-theme-quartz-auto-dark .ag-rtl .ag-mini-filter input.ag-number-field-input, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-filter input.ag-text-field-input, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-filter input.ag-number-field-input {\\n  padding-right: 26px;\\n}\\n\\n.ag-theme-quartz .ag-ltr .ag-column-select-add-group-indent, .ag-theme-quartz-dark .ag-ltr .ag-column-select-add-group-indent, .ag-theme-quartz-auto-dark .ag-ltr .ag-column-select-add-group-indent {\\n  margin-left: calc(var(--ag-icon-size) + var(--ag-grid-size) * 1.5);\\n}\\n\\n.ag-theme-quartz .ag-rtl .ag-column-select-add-group-indent, .ag-theme-quartz-dark .ag-rtl .ag-column-select-add-group-indent, .ag-theme-quartz-auto-dark .ag-rtl .ag-column-select-add-group-indent {\\n  margin-right: calc(var(--ag-icon-size) + var(--ag-grid-size) * 1.5);\\n}\\n\\n.ag-theme-quartz .ag-text-field-input[disabled],\\n.ag-theme-quartz .ag-menu-option-disabled,\\n.ag-theme-quartz-dark .ag-text-field-input[disabled],\\n.ag-theme-quartz-dark .ag-menu-option-disabled,\\n.ag-theme-quartz-auto-dark .ag-text-field-input[disabled],\\n.ag-theme-quartz-auto-dark .ag-menu-option-disabled {\\n  cursor: not-allowed;\\n}\\n.ag-theme-quartz .ag-checkbox-input-wrapper.ag-checked.ag-disabled,\\n.ag-theme-quartz-dark .ag-checkbox-input-wrapper.ag-checked.ag-disabled,\\n.ag-theme-quartz-auto-dark .ag-checkbox-input-wrapper.ag-checked.ag-disabled {\\n  --ag-checkbox-checked-color: var(--ag-checkbox-unchecked-color);\\n}\\n.ag-theme-quartz .ag-checkbox-input,\\n.ag-theme-quartz .ag-toggle-button-input,\\n.ag-theme-quartz .ag-radio-button-input,\\n.ag-theme-quartz input[class^=ag-][type=range],\\n.ag-theme-quartz-dark .ag-checkbox-input,\\n.ag-theme-quartz-dark .ag-toggle-button-input,\\n.ag-theme-quartz-dark .ag-radio-button-input,\\n.ag-theme-quartz-dark input[class^=ag-][type=range],\\n.ag-theme-quartz-auto";
      S = S + '-dark .ag-checkbox-input,\\n.ag-theme-quartz-auto-dark .ag-toggle-button-input,\\n.ag-theme-quartz-auto-dark .ag-radio-button-input,\\n.ag-theme-quartz-auto-dark input[class^=ag-][type=range] {\\n  cursor: pointer;\\n}\\n.ag-theme-quartz .ag-details-row,\\n.ag-theme-quartz-dark .ag-details-row,\\n.ag-theme-quartz-auto-dark .ag-details-row {\\n  padding: calc(var(--ag-grid-size) * 3.75);\\n}\\n\\n.ag-theme-quartz-dark .ag-column-select-header-filter-wrapper .ag-input-wrapper::before,\\n.ag-theme-quartz-dark .ag-filter-toolpanel-search .ag-input-wrapper::before,\\n.ag-theme-quartz-dark .ag-mini-filter .ag-input-wrapper::before,\\n.ag-theme-quartz-dark .ag-filter-filter .ag-input-wrapper::before {\\n  opacity: 0.66;\\n  filter: invert(100%);\\n}\\n.ag-theme-quartz-dark .ag-chart-menu {\\n  background-color: color-mix(in srgb, rgba(24, 39, 50, 0.3), var(--ag-background-color) 30%);\\n}\\n.ag-theme-quartz-dark .ag-text-field-input::-moz-placeholder {\\n  color: var(--ag-data-color);\\n  opacity: 0.8;\\n}\\n.ag-theme-quartz-dark .ag-text-field-input::placeholder {\\n  color: var(--ag-data-color);\\n  opacity: 0.8;\\n}\\n\',""]),t.A=g},9561:function(e,t,a){"use strict";var n=a(6758),o=a.n(n),r=a(935),i=a.n(r),s=a(62),l=a.n(s),c=new URL(a(2006),a.b),g=new URL(a(7249),a.b),d=i()(o()),h=l()(c),u=l()(g);d.push([e.id,\'@font-face {\\n  font-family: "agGridQuartz";\\n  src: url(\'+h+\');\\n  font-weight: normal;\\n  font-style: normal;\\n}\\n.ag-theme-quartz,\\n.ag-theme-quartz-dark,\\n.ag-theme-quartz-auto-dark {\\n  --ag-active-color: #2196f3;\\n  --ag-background-color: #fff;\\n  --ag-foreground-color: #181d1f;\\n  --ag-border-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 15%);\\n  --ag-secondary-border-color: var(--ag-border-color);\\n  --ag-header-background-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 2%);\\n  --ag-tooltip-background-color: var(--ag-header-background-color);\\n  --ag-control-panel-background-color: var(--ag-header-background-color);\\n  --ag-subheader-';
      S = S + "background-color: transparent;\\n  --ag-invalid-color: #e02525;\\n  --ag-checkbox-unchecked-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 30%);\\n  --ag-advanced-filter-join-pill-color: #f08e8d;\\n  --ag-advanced-filter-column-pill-color: #a6e194;\\n  --ag-advanced-filter-option-pill-color: #f3c08b;\\n  --ag-advanced-filter-value-pill-color: #85c0e4;\\n  --ag-header-column-resize-handle-color: var(--ag-secondary-border-color);\\n  --ag-icon-font-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 90%);\\n  --ag-panel-background-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 3%);\\n  --ag-panel-border-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 20%);\\n  --ag-menu-background-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 3%);\\n  --ag-menu-border-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 20%);\\n  --ag-selected-row-background-color: color-mix(in srgb, transparent, var(--ag-active-color) 8%);\\n  --ag-row-hover-color: color-mix(in srgb, transparent, var(--ag-active-color) 12%);\\n  --ag-column-hover-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 5%);\\n  --ag-input-focus-border-color: var(--ag-active-color);\\n  --ag-input-focus-box-shadow: 0 0 0 3px color-mix(in srgb, transparent, var(--ag-input-focus-border-color) 47%);\\n  --ag-range-selection-background-color: color-mix(in srgb, transparent, var(--ag-active-color) 20%);\\n  --ag-range-selection-background-color-2: color-mix(in srgb, transparent, var(--ag-active-color) 36%);\\n  --ag-range-selection-background-color-3: color-mix(in srgb, transparent, var(--ag-active-color) 49%);\\n  --ag-range-selection-background-color-4: color-mix(in srgb, transparent, var(--ag-active-color) 59%);\\n  --ag-checkbox-background-color: var(--ag-background-color);\\n  --ag-checkbox-checked-color: var(--ag-active-color);\\n  --ag-range-selection-border-color: var(--ag-active-colo";
      S = S + "r);\\n  --ag-secondary-foreground-color: var(--ag-foreground-color);\\n  --ag-input-border-color: var(--ag-border-color);\\n  --ag-input-border-color-invalid: var(--ag-invalid-color);\\n  --ag-disabled-foreground-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 50%);\\n  --ag-chip-background-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 7%);\\n  --ag-chip-border-color: color-mix(in srgb, var(--ag-header-background-color), var(--ag-foreground-color) 13%);\\n  --ag-input-disabled-border-color: var(--ag-border-color);\\n  --ag-input-disabled-background-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 6%);\\n  --ag-modal-overlay-background-color: color-mix(in srgb, transparent, var(--ag-background-color) 66%);\\n  --ag-chart-menu-label-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 80%);\\n  --ag-chart-menu-pill-select-button-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 70%);\\n  --ag-borders: solid 1px;\\n  --ag-border-radius: 4px;\\n  --ag-wrapper-border-radius: 8px;\\n  --ag-borders-side-button: none;\\n  --ag-side-button-selected-background-color: transparent;\\n  --ag-header-column-resize-handle-display: block;\\n  --ag-header-column-resize-handle-width: 2px;\\n  --ag-header-column-resize-handle-height: 30%;\\n  --ag-grid-size: 8px;\\n  --ag-icon-size: 16px;\\n  --ag-header-height: calc(var(--ag-font-size) + var(--ag-grid-size) * 4.25);\\n  --ag-row-height: calc(var(--ag-font-size) + var(--ag-grid-size) * 3.5);\\n  --ag-list-item-height: calc(\\n      var(--ag-icon-size) + var(--ag-widget-vertical-spacing)\\n  );\\n  --ag-column-select-indent-size: var(--ag-icon-size);\\n  --ag-set-filter-indent-size: var(--ag-icon-size);\\n  --ag-filter-tool-panel-group-indent: var(--ag-grid-size);\\n  --ag-advanced-filter-builder-indent-size: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\\n  --ag-cell-horizontal-padding: calc(var(--ag-grid-size) * 2);\\n  --ag-cell-widget-spacing: calc(var(--ag-gr";
      S = S + 'id-size) * 1.5);\\n  --ag-widget-container-vertical-padding: calc(var(--ag-grid-size) * 1.5);\\n  --ag-widget-container-horizontal-padding: calc(var(--ag-grid-size) * 1.5);\\n  --ag-widget-horizontal-spacing: calc(var(--ag-grid-size) * 1.5);\\n  --ag-widget-vertical-spacing: calc(var(--ag-grid-size) * 1);\\n  --ag-toggle-button-height: 18px;\\n  --ag-toggle-button-width: 28px;\\n  --ag-toggle-button-border-width: 2px;\\n  --ag-font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu,\\n      Cantarell, "Helvetica Neue", sans-serif;\\n  --ag-font-size: 14px;\\n  --ag-icon-font-family: agGridQuartz;\\n  --ag-tab-min-width: 290px;\\n  --ag-chart-menu-panel-width: 260px;\\n  --ag-card-shadow: 0 1px 4px 1px rgba(186, 191, 199, 0.4);\\n  --ag-popup-shadow: 0 0 16px 0 rgba(0, 0, 0, 0.15);\\n  --ag-side-bar-panel-width: 250px;\\n}\\n\\n.ag-theme-quartz-dark {\\n  --ag-background-color: rgb(31, 41, 54);\\n  --ag-foreground-color: #fff;\\n  --ag-border-color: rgba(255, 255, 255, 0.16);\\n  --ag-secondary-border-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 10%);\\n  --ag-header-background-color: rgb(40, 49, 62);\\n  --ag-tooltip-background-color: rgb(33, 43, 56);\\n  --ag-control-panel-background-color: rgb(40, 49, 62);\\n  --ag-input-disabled-background-color: rgba(104,104,110,0.07059);\\n  --ag-card-shadow: 0 1px 20px 1px black;\\n  --ag-input-border-color: var(--ag-border-color);\\n  --ag-input-disabled-border-color: rgba(255, 255, 255, 0.07);\\n  --ag-checkbox-unchecked-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 40%);\\n  --ag-row-hover-color: color-mix(in srgb, transparent, var(--ag-active-color) 20%);\\n  --ag-selected-row-background-color: var(--ag-row-hover-color);\\n  --ag-panel-background-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 10%);\\n  --ag-panel-border-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 10%);\\n  --ag-menu-background-color:';
      S = S + " color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 10%);\\n  --ag-menu-border-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 10%);\\n  --ag-advanced-filter-join-pill-color: #7a3a37;\\n  --ag-advanced-filter-column-pill-color: #355f2d;\\n  --ag-advanced-filter-option-pill-color: #5a3168;\\n  --ag-advanced-filter-value-pill-color: #374c86;\\n  --ag-popup-shadow: 0 0px 20px rgba(0, 0, 0, 0.3);\\n  --ag-row-loading-skeleton-effect-color: rgba(202, 203, 204, 0.4);\\n  --csstools-color-scheme--dark: initial;\\n  color-scheme: dark;\\n}\\n\\n@media (prefers-color-scheme: dark) {\\n  .ag-theme-quartz-auto-dark {\\n    --ag-background-color: rgb(31, 41, 54);\\n    --ag-foreground-color: #fff;\\n    --ag-border-color: rgba(255, 255, 255, 0.16);\\n    --ag-secondary-border-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 10%);\\n    --ag-header-background-color: rgb(40, 49, 62);\\n    --ag-tooltip-background-color: rgb(33, 43, 56);\\n    --ag-control-panel-background-color: rgb(40, 49, 62);\\n    --ag-input-disabled-background-color: rgba(104,104,110,0.07059);\\n    --ag-card-shadow: 0 1px 20px 1px black;\\n    --ag-input-border-color: var(--ag-border-color);\\n    --ag-input-disabled-border-color: rgba(255, 255, 255, 0.07);\\n    --ag-checkbox-unchecked-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 40%);\\n    --ag-row-hover-color: color-mix(in srgb, transparent, var(--ag-active-color) 20%);\\n    --ag-selected-row-background-color: var(--ag-row-hover-color);\\n    --ag-panel-background-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 10%);\\n    --ag-panel-border-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 10%);\\n    --ag-menu-background-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 10%);\\n    --ag-menu-border-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 10%);\\n    --ag-advanced-filter-join-pill-color:";
      S = S + " #7a3a37;\\n    --ag-advanced-filter-column-pill-color: #355f2d;\\n    --ag-advanced-filter-option-pill-color: #5a3168;\\n    --ag-advanced-filter-value-pill-color: #374c86;\\n    --ag-popup-shadow: 0 0px 20px rgba(0, 0, 0, 0.3);\\n    --ag-row-loading-skeleton-effect-color: rgba(202, 203, 204, 0.4);\\n    --csstools-color-scheme--dark: initial;\\n    color-scheme: dark;\\n  }\\n}\\n.ag-theme-quartz .ag-filter-toolpanel-header,\\n.ag-theme-quartz .ag-filter-toolpanel-search,\\n.ag-theme-quartz .ag-status-bar,\\n.ag-theme-quartz .ag-header-row,\\n.ag-theme-quartz .ag-panel-title-bar-title,\\n.ag-theme-quartz .ag-multi-filter-group-title-bar,\\n.ag-theme-quartz-dark .ag-filter-toolpanel-header,\\n.ag-theme-quartz-dark .ag-filter-toolpanel-search,\\n.ag-theme-quartz-dark .ag-status-bar,\\n.ag-theme-quartz-dark .ag-header-row,\\n.ag-theme-quartz-dark .ag-panel-title-bar-title,\\n.ag-theme-quartz-dark .ag-multi-filter-group-title-bar,\\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-header,\\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-search,\\n.ag-theme-quartz-auto-dark .ag-status-bar,\\n.ag-theme-quartz-auto-dark .ag-header-row,\\n.ag-theme-quartz-auto-dark .ag-panel-title-bar-title,\\n.ag-theme-quartz-auto-dark .ag-multi-filter-group-title-bar {\\n  font-weight: 500;\\n  color: var(--ag-header-foreground-color);\\n}\\n.ag-theme-quartz input[class^=ag-]:not([type]),\\n.ag-theme-quartz input[class^=ag-][type=text],\\n.ag-theme-quartz input[class^=ag-][type=number],\\n.ag-theme-quartz input[class^=ag-][type=tel],\\n.ag-theme-quartz input[class^=ag-][type=date],\\n.ag-theme-quartz input[class^=ag-][type=datetime-local],\\n.ag-theme-quartz textarea[class^=ag-],\\n.ag-theme-quartz-dark input[class^=ag-]:not([type]),\\n.ag-theme-quartz-dark input[class^=ag-][type=text],\\n.ag-theme-quartz-dark input[class^=ag-][type=number],\\n.ag-theme-quartz-dark input[class^=ag-][type=tel],\\n.ag-theme-quartz-dark input[class^=ag-][type=date],\\n.ag-theme-quartz-dark input[class^=ag-][type=datetime-local],\\n.ag-theme-quartz-";
      S = S + "dark textarea[class^=ag-],\\n.ag-theme-quartz-auto-dark input[class^=ag-]:not([type]),\\n.ag-theme-quartz-auto-dark input[class^=ag-][type=text],\\n.ag-theme-quartz-auto-dark input[class^=ag-][type=number],\\n.ag-theme-quartz-auto-dark input[class^=ag-][type=tel],\\n.ag-theme-quartz-auto-dark input[class^=ag-][type=date],\\n.ag-theme-quartz-auto-dark input[class^=ag-][type=datetime-local],\\n.ag-theme-quartz-auto-dark textarea[class^=ag-] {\\n  min-height: calc(var(--ag-grid-size) * 4);\\n  border-radius: var(--ag-border-radius);\\n}\\n.ag-theme-quartz .ag-ltr input[class^=ag-]:not([type]), .ag-theme-quartz .ag-ltr input[class^=ag-][type=text], .ag-theme-quartz .ag-ltr input[class^=ag-][type=number], .ag-theme-quartz .ag-ltr input[class^=ag-][type=tel], .ag-theme-quartz .ag-ltr input[class^=ag-][type=date], .ag-theme-quartz .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-quartz .ag-ltr textarea[class^=ag-], .ag-theme-quartz-dark .ag-ltr input[class^=ag-]:not([type]), .ag-theme-quartz-dark .ag-ltr input[class^=ag-][type=text], .ag-theme-quartz-dark .ag-ltr input[class^=ag-][type=number], .ag-theme-quartz-dark .ag-ltr input[class^=ag-][type=tel], .ag-theme-quartz-dark .ag-ltr input[class^=ag-][type=date], .ag-theme-quartz-dark .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-quartz-dark .ag-ltr textarea[class^=ag-], .ag-theme-quartz-auto-dark .ag-ltr input[class^=ag-]:not([type]), .ag-theme-quartz-auto-dark .ag-ltr input[class^=ag-][type=text], .ag-theme-quartz-auto-dark .ag-ltr input[class^=ag-][type=number], .ag-theme-quartz-auto-dark .ag-ltr input[class^=ag-][type=tel], .ag-theme-quartz-auto-dark .ag-ltr input[class^=ag-][type=date], .ag-theme-quartz-auto-dark .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-quartz-auto-dark .ag-ltr textarea[class^=ag-] {\\n  padding-left: var(--ag-grid-size);\\n}\\n\\n.ag-theme-quartz .ag-rtl input[class^=ag-]:not([type]), .ag-theme-quartz .ag-rtl input[class^=ag-][type=text], .ag-theme-quartz .ag-rtl input[class^=ag-";
      S = S + "][type=number], .ag-theme-quartz .ag-rtl input[class^=ag-][type=tel], .ag-theme-quartz .ag-rtl input[class^=ag-][type=date], .ag-theme-quartz .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-quartz .ag-rtl textarea[class^=ag-], .ag-theme-quartz-dark .ag-rtl input[class^=ag-]:not([type]), .ag-theme-quartz-dark .ag-rtl input[class^=ag-][type=text], .ag-theme-quartz-dark .ag-rtl input[class^=ag-][type=number], .ag-theme-quartz-dark .ag-rtl input[class^=ag-][type=tel], .ag-theme-quartz-dark .ag-rtl input[class^=ag-][type=date], .ag-theme-quartz-dark .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-quartz-dark .ag-rtl textarea[class^=ag-], .ag-theme-quartz-auto-dark .ag-rtl input[class^=ag-]:not([type]), .ag-theme-quartz-auto-dark .ag-rtl input[class^=ag-][type=text], .ag-theme-quartz-auto-dark .ag-rtl input[class^=ag-][type=number], .ag-theme-quartz-auto-dark .ag-rtl input[class^=ag-][type=tel], .ag-theme-quartz-auto-dark .ag-rtl input[class^=ag-][type=date], .ag-theme-quartz-auto-dark .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-quartz-auto-dark .ag-rtl textarea[class^=ag-] {\\n  padding-right: var(--ag-grid-size);\\n}\\n\\n.ag-theme-quartz .ag-picker-field-wrapper,\\n.ag-theme-quartz-dark .ag-picker-field-wrapper,\\n.ag-theme-quartz-auto-dark .ag-picker-field-wrapper {\\n  min-height: calc(var(--ag-grid-size) * 4);\\n}\\n.ag-theme-quartz .ag-tab,\\n.ag-theme-quartz-dark .ag-tab,\\n.ag-theme-quartz-auto-dark .ag-tab {\\n  padding: var(--ag-grid-size);\\n  border-left: var(--ag-borders) transparent;\\n  border-right: var(--ag-borders) transparent;\\n  flex: 1 1 auto;\\n}\\n.ag-theme-quartz .ag-tab-selected,\\n.ag-theme-quartz-dark .ag-tab-selected,\\n.ag-theme-quartz-auto-dark .ag-tab-selected {\\n  background-color: var(--ag-background-color);\\n}\\n.ag-theme-quartz .ag-ltr .ag-tab-selected:not(:first-of-type), .ag-theme-quartz-dark .ag-ltr .ag-tab-selected:not(:first-of-type), .ag-theme-quartz-auto-dark .ag-ltr .ag-tab-selected:not(:first-of-type) {\\n  border";
      S = S + "-left-color: var(--ag-border-color);\\n}\\n\\n.ag-theme-quartz .ag-rtl .ag-tab-selected:not(:first-of-type), .ag-theme-quartz-dark .ag-rtl .ag-tab-selected:not(:first-of-type), .ag-theme-quartz-auto-dark .ag-rtl .ag-tab-selected:not(:first-of-type) {\\n  border-right-color: var(--ag-border-color);\\n}\\n\\n.ag-theme-quartz .ag-ltr .ag-tab-selected:not(:last-of-type), .ag-theme-quartz-dark .ag-ltr .ag-tab-selected:not(:last-of-type), .ag-theme-quartz-auto-dark .ag-ltr .ag-tab-selected:not(:last-of-type) {\\n  border-right-color: var(--ag-border-color);\\n}\\n\\n.ag-theme-quartz .ag-rtl .ag-tab-selected:not(:last-of-type), .ag-theme-quartz-dark .ag-rtl .ag-tab-selected:not(:last-of-type), .ag-theme-quartz-auto-dark .ag-rtl .ag-tab-selected:not(:last-of-type) {\\n  border-left-color: var(--ag-border-color);\\n}\\n\\n.ag-theme-quartz .ag-tab:not(.ag-tab-selected),\\n.ag-theme-quartz-dark .ag-tab:not(.ag-tab-selected),\\n.ag-theme-quartz-auto-dark .ag-tab:not(.ag-tab-selected) {\\n  opacity: 0.7;\\n}\\n.ag-theme-quartz .ag-tab:not(.ag-tab-selected):hover,\\n.ag-theme-quartz-dark .ag-tab:not(.ag-tab-selected):hover,\\n.ag-theme-quartz-auto-dark .ag-tab:not(.ag-tab-selected):hover {\\n  opacity: 1;\\n}\\n.ag-theme-quartz .ag-menu,\\n.ag-theme-quartz-dark .ag-menu,\\n.ag-theme-quartz-auto-dark .ag-menu {\\n  color: color-mix(in srgb, transparent, var(--ag-foreground-color) 95%);\\n}\\n.ag-theme-quartz .ag-panel-content-wrapper .ag-column-select,\\n.ag-theme-quartz-dark .ag-panel-content-wrapper .ag-column-select,\\n.ag-theme-quartz-auto-dark .ag-panel-content-wrapper .ag-column-select {\\n  background-color: var(--ag-control-panel-background-color);\\n  color: color-mix(in srgb, transparent, var(--ag-foreground-color) 95%);\\n}\\n.ag-theme-quartz .ag-menu-option .ag-icon,\\n.ag-theme-quartz-dark .ag-menu-option .ag-icon,\\n.ag-theme-quartz-auto-dark .ag-menu-option .ag-icon {\\n  opacity: 0.65;\\n}\\n.ag-theme-quartz .ag-menu-header,\\n.ag-theme-quartz-dark .ag-menu-header,\\n.ag-theme-quartz-auto-dark .ag-menu-head";
      S = S + 'er {\\n  background-color: var(--ag-control-panel-background-color);\\n}\\n.ag-theme-quartz .ag-menu-option,\\n.ag-theme-quartz-dark .ag-menu-option,\\n.ag-theme-quartz-auto-dark .ag-menu-option {\\n  font-weight: 500;\\n  cursor: pointer;\\n}\\n.ag-theme-quartz .ag-ltr .ag-menu-option-popup-pointer .ag-icon, .ag-theme-quartz-dark .ag-ltr .ag-menu-option-popup-pointer .ag-icon, .ag-theme-quartz-auto-dark .ag-ltr .ag-menu-option-popup-pointer .ag-icon {\\n  text-align: right;\\n}\\n\\n.ag-theme-quartz .ag-rtl .ag-menu-option-popup-pointer .ag-icon, .ag-theme-quartz-dark .ag-rtl .ag-menu-option-popup-pointer .ag-icon, .ag-theme-quartz-auto-dark .ag-rtl .ag-menu-option-popup-pointer .ag-icon {\\n  text-align: left;\\n}\\n\\n.ag-theme-quartz .ag-tabs-header,\\n.ag-theme-quartz-dark .ag-tabs-header,\\n.ag-theme-quartz-auto-dark .ag-tabs-header {\\n  border-bottom: var(--ag-borders) var(--ag-border-color);\\n  display: flex;\\n  background-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 5%);\\n}\\n.ag-theme-quartz .ag-side-bar,\\n.ag-theme-quartz-dark .ag-side-bar,\\n.ag-theme-quartz-auto-dark .ag-side-bar {\\n  background-color: var(--ag-control-panel-background-color);\\n  min-width: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\\n}\\n.ag-theme-quartz .ag-side-buttons,\\n.ag-theme-quartz-dark .ag-side-buttons,\\n.ag-theme-quartz-auto-dark .ag-side-buttons {\\n  padding: 0;\\n  align-self: stretch;\\n  width: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\\n  background: var(--ag-control-panel-background-color);\\n}\\n.ag-theme-quartz .ag-side-button,\\n.ag-theme-quartz-dark .ag-side-button,\\n.ag-theme-quartz-auto-dark .ag-side-button {\\n  border-top: var(--ag-borders) transparent;\\n  border-bottom: var(--ag-borders) transparent;\\n}\\n@media (-webkit-max-device-pixel-ratio: 1.5), (max-resolution: 1.5x) {\\n  .ag-theme-quartz .ag-side-button-label,\\n  .ag-theme-quartz-dark .ag-side-button-label,\\n  .ag-theme-quartz-auto-dark .ag-side-button-label {\\n    font-family: "Segoe UI", var';
      S = S + '(--ag-font-family);\\n    transform: rotate(0.05deg);\\n  }\\n}\\n.ag-theme-quartz .ag-side-button.ag-selected,\\n.ag-theme-quartz-dark .ag-side-button.ag-selected,\\n.ag-theme-quartz-auto-dark .ag-side-button.ag-selected {\\n  border-bottom-color: var(--ag-border-color);\\n  background-color: var(--ag-background-color);\\n}\\n.ag-theme-quartz .ag-side-button.ag-selected:not(:first-of-type),\\n.ag-theme-quartz-dark .ag-side-button.ag-selected:not(:first-of-type),\\n.ag-theme-quartz-auto-dark .ag-side-button.ag-selected:not(:first-of-type) {\\n  border-top-color: var(--ag-border-color);\\n}\\n.ag-theme-quartz .ag-column-panel-column-select,\\n.ag-theme-quartz-dark .ag-column-panel-column-select,\\n.ag-theme-quartz-auto-dark .ag-column-panel-column-select {\\n  border-top: none;\\n  border-bottom: 1px solid var(--ag-secondary-border-color);\\n}\\n.ag-theme-quartz .ag-filter-toolpanel-search,\\n.ag-theme-quartz-dark .ag-filter-toolpanel-search,\\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-search {\\n  height: auto;\\n  height: initial;\\n  margin-top: var(--ag-widget-container-vertical-padding);\\n}\\n.ag-theme-quartz .ag-filter-toolpanel-search-input,\\n.ag-theme-quartz-dark .ag-filter-toolpanel-search-input,\\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-search-input {\\n  margin: 0;\\n}\\n.ag-theme-quartz .ag-filter-apply-panel,\\n.ag-theme-quartz-dark .ag-filter-apply-panel,\\n.ag-theme-quartz-auto-dark .ag-filter-apply-panel {\\n  border: none;\\n  padding-top: var(--ag-widget-vertical-spacing);\\n}\\n.ag-theme-quartz .ag-chart-tabbed-menu-body,\\n.ag-theme-quartz-dark .ag-chart-tabbed-menu-body,\\n.ag-theme-quartz-auto-dark .ag-chart-tabbed-menu-body {\\n  position: relative;\\n}\\n.ag-theme-quartz .ag-chart-tabbed-menu-body::after,\\n.ag-theme-quartz-dark .ag-chart-tabbed-menu-body::after,\\n.ag-theme-quartz-auto-dark .ag-chart-tabbed-menu-body::after {\\n  content: "";\\n  position: absolute;\\n  display: block;\\n  top: 0;\\n  left: 0;\\n  right: 0;\\n  height: 16px;\\n  background: linear-gradient(var(--';
      S = S + "ag-control-panel-background-color), transparent);\\n}\\n.ag-theme-quartz .ag-charts-settings-group-title-bar,\\n.ag-theme-quartz .ag-charts-data-group-title-bar,\\n.ag-theme-quartz .ag-charts-format-top-level-group-title-bar,\\n.ag-theme-quartz .ag-charts-advanced-settings-top-level-group-title-bar,\\n.ag-theme-quartz .ag-charts-settings-group-container,\\n.ag-theme-quartz-dark .ag-charts-settings-group-title-bar,\\n.ag-theme-quartz-dark .ag-charts-data-group-title-bar,\\n.ag-theme-quartz-dark .ag-charts-format-top-level-group-title-bar,\\n.ag-theme-quartz-dark .ag-charts-advanced-settings-top-level-group-title-bar,\\n.ag-theme-quartz-dark .ag-charts-settings-group-container,\\n.ag-theme-quartz-auto-dark .ag-charts-settings-group-title-bar,\\n.ag-theme-quartz-auto-dark .ag-charts-data-group-title-bar,\\n.ag-theme-quartz-auto-dark .ag-charts-format-top-level-group-title-bar,\\n.ag-theme-quartz-auto-dark .ag-charts-advanced-settings-top-level-group-title-bar,\\n.ag-theme-quartz-auto-dark .ag-charts-settings-group-container {\\n  border-top: none;\\n  font-weight: 500;\\n}\\n.ag-theme-quartz .ag-chart-mini-thumbnail,\\n.ag-theme-quartz-dark .ag-chart-mini-thumbnail,\\n.ag-theme-quartz-auto-dark .ag-chart-mini-thumbnail {\\n  background-color: var(--ag-background-color);\\n  margin-top: 0;\\n  margin-bottom: 0;\\n}\\n.ag-theme-quartz .ag-chart-settings-nav-bar,\\n.ag-theme-quartz-dark .ag-chart-settings-nav-bar,\\n.ag-theme-quartz-auto-dark .ag-chart-settings-nav-bar {\\n  border-top: var(--ag-borders-secondary) var(--ag-secondary-border-color);\\n}\\n.ag-theme-quartz .ag-charts-format-sub-level-group-title-bar,\\n.ag-theme-quartz-dark .ag-charts-format-sub-level-group-title-bar,\\n.ag-theme-quartz-auto-dark .ag-charts-format-sub-level-group-title-bar {\\n  background: none;\\n  font-weight: 500;\\n}\\n.ag-theme-quartz .ag-chart-data-section .ag-label:not(.ag-group-title-bar),\\n.ag-theme-quartz .ag-chart-format-section .ag-label:not(.ag-group-title-bar),\\n.ag-theme-quartz-dark .ag-chart-data-section .ag-lab";
      S = S + "el:not(.ag-group-title-bar),\\n.ag-theme-quartz-dark .ag-chart-format-section .ag-label:not(.ag-group-title-bar),\\n.ag-theme-quartz-auto-dark .ag-chart-data-section .ag-label:not(.ag-group-title-bar),\\n.ag-theme-quartz-auto-dark .ag-chart-format-section .ag-label:not(.ag-group-title-bar) {\\n  color: var(--ag-chart-menu-label-color);\\n}\\n.ag-theme-quartz .ag-chart-data-section .ag-label-align-top .ag-label,\\n.ag-theme-quartz .ag-chart-format-section .ag-label-align-top .ag-label,\\n.ag-theme-quartz-dark .ag-chart-data-section .ag-label-align-top .ag-label,\\n.ag-theme-quartz-dark .ag-chart-format-section .ag-label-align-top .ag-label,\\n.ag-theme-quartz-auto-dark .ag-chart-data-section .ag-label-align-top .ag-label,\\n.ag-theme-quartz-auto-dark .ag-chart-format-section .ag-label-align-top .ag-label {\\n  margin-top: calc(var(--ag-widget-vertical-spacing) * 0.5);\\n  margin-bottom: var(--ag-widget-vertical-spacing);\\n}\\n.ag-theme-quartz .ag-chart-data-section .ag-slider.ag-label-align-top .ag-label,\\n.ag-theme-quartz .ag-chart-format-section .ag-slider.ag-label-align-top .ag-label,\\n.ag-theme-quartz-dark .ag-chart-data-section .ag-slider.ag-label-align-top .ag-label,\\n.ag-theme-quartz-dark .ag-chart-format-section .ag-slider.ag-label-align-top .ag-label,\\n.ag-theme-quartz-auto-dark .ag-chart-data-section .ag-slider.ag-label-align-top .ag-label,\\n.ag-theme-quartz-auto-dark .ag-chart-format-section .ag-slider.ag-label-align-top .ag-label {\\n  margin-bottom: 0;\\n}\\n.ag-theme-quartz .ag-chart-data-section label,\\n.ag-theme-quartz .ag-chart-format-section label,\\n.ag-theme-quartz-dark .ag-chart-data-section label,\\n.ag-theme-quartz-dark .ag-chart-format-section label,\\n.ag-theme-quartz-auto-dark .ag-chart-data-section label,\\n.ag-theme-quartz-auto-dark .ag-chart-format-section label {\\n  display: inline-block;\\n}\\n.ag-theme-quartz .ag-chart-format-wrapper,\\n.ag-theme-quartz .ag-chart-data-wrapper,\\n.ag-theme-quartz .ag-charts-format-top-level-group,\\n.ag-theme-quartz .ag-charts-f";
      S = S + "ormat-top-level-group-title-bar,\\n.ag-theme-quartz .ag-charts-format-top-level-group .ag-charts-format-top-level-group-container,\\n.ag-theme-quartz .ag-charts-format-top-level-group-item,\\n.ag-theme-quartz .ag-charts-format-sub-level-group,\\n.ag-theme-quartz .ag-charts-format-sub-level-group-title-bar,\\n.ag-theme-quartz .ag-charts-format-sub-level-group-container,\\n.ag-theme-quartz .ag-charts-format-sub-level-group-item:last-child,\\n.ag-theme-quartz .ag-charts-format-sub-level-group-container > *,\\n.ag-theme-quartz .ag-charts-data-group-title-bar,\\n.ag-theme-quartz .ag-charts-data-group-container,\\n.ag-theme-quartz .ag-charts-settings-group-title-bar,\\n.ag-theme-quartz .ag-charts-settings-group-container,\\n.ag-theme-quartz-dark .ag-chart-format-wrapper,\\n.ag-theme-quartz-dark .ag-chart-data-wrapper,\\n.ag-theme-quartz-dark .ag-charts-format-top-level-group,\\n.ag-theme-quartz-dark .ag-charts-format-top-level-group-title-bar,\\n.ag-theme-quartz-dark .ag-charts-format-top-level-group .ag-charts-format-top-level-group-container,\\n.ag-theme-quartz-dark .ag-charts-format-top-level-group-item,\\n.ag-theme-quartz-dark .ag-charts-format-sub-level-group,\\n.ag-theme-quartz-dark .ag-charts-format-sub-level-group-title-bar,\\n.ag-theme-quartz-dark .ag-charts-format-sub-level-group-container,\\n.ag-theme-quartz-dark .ag-charts-format-sub-level-group-item:last-child,\\n.ag-theme-quartz-dark .ag-charts-format-sub-level-group-container > *,\\n.ag-theme-quartz-dark .ag-charts-data-group-title-bar,\\n.ag-theme-quartz-dark .ag-charts-data-group-container,\\n.ag-theme-quartz-dark .ag-charts-settings-group-title-bar,\\n.ag-theme-quartz-dark .ag-charts-settings-group-container,\\n.ag-theme-quartz-auto-dark .ag-chart-format-wrapper,\\n.ag-theme-quartz-auto-dark .ag-chart-data-wrapper,\\n.ag-theme-quartz-auto-dark .ag-charts-format-top-level-group,\\n.ag-theme-quartz-auto-dark .ag-charts-format-top-level-group-title-bar,\\n.ag-theme-quartz-auto-dark .ag-charts-format-top-level-group .ag-charts-format-top-";
      S = S + "level-group-container,\\n.ag-theme-quartz-auto-dark .ag-charts-format-top-level-group-item,\\n.ag-theme-quartz-auto-dark .ag-charts-format-sub-level-group,\\n.ag-theme-quartz-auto-dark .ag-charts-format-sub-level-group-title-bar,\\n.ag-theme-quartz-auto-dark .ag-charts-format-sub-level-group-container,\\n.ag-theme-quartz-auto-dark .ag-charts-format-sub-level-group-item:last-child,\\n.ag-theme-quartz-auto-dark .ag-charts-format-sub-level-group-container > *,\\n.ag-theme-quartz-auto-dark .ag-charts-data-group-title-bar,\\n.ag-theme-quartz-auto-dark .ag-charts-data-group-container,\\n.ag-theme-quartz-auto-dark .ag-charts-settings-group-title-bar,\\n.ag-theme-quartz-auto-dark .ag-charts-settings-group-container {\\n  padding: 0;\\n  margin: 0;\\n}\\n.ag-theme-quartz .ag-charts-format-top-level-group,\\n.ag-theme-quartz .ag-charts-data-group,\\n.ag-theme-quartz-dark .ag-charts-format-top-level-group,\\n.ag-theme-quartz-dark .ag-charts-data-group,\\n.ag-theme-quartz-auto-dark .ag-charts-format-top-level-group,\\n.ag-theme-quartz-auto-dark .ag-charts-data-group {\\n  border-top: var(--ag-borders-secondary) var(--ag-secondary-border-color);\\n}\\n.ag-theme-quartz .ag-charts-format-top-level-group-title-bar,\\n.ag-theme-quartz .ag-charts-data-group-title-bar,\\n.ag-theme-quartz .ag-charts-settings-group-title-bar,\\n.ag-theme-quartz-dark .ag-charts-format-top-level-group-title-bar,\\n.ag-theme-quartz-dark .ag-charts-data-group-title-bar,\\n.ag-theme-quartz-dark .ag-charts-settings-group-title-bar,\\n.ag-theme-quartz-auto-dark .ag-charts-format-top-level-group-title-bar,\\n.ag-theme-quartz-auto-dark .ag-charts-data-group-title-bar,\\n.ag-theme-quartz-auto-dark .ag-charts-settings-group-title-bar {\\n  padding: var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);\\n}\\n.ag-theme-quartz .ag-charts-format-top-level-group .ag-charts-format-top-level-group-container,\\n.ag-theme-quartz .ag-charts-data-group .ag-charts-data-group-container,\\n.ag-theme-quartz .ag-charts-settings";
      S = S + "-group .ag-charts-settings-group-container,\\n.ag-theme-quartz-dark .ag-charts-format-top-level-group .ag-charts-format-top-level-group-container,\\n.ag-theme-quartz-dark .ag-charts-data-group .ag-charts-data-group-container,\\n.ag-theme-quartz-dark .ag-charts-settings-group .ag-charts-settings-group-container,\\n.ag-theme-quartz-auto-dark .ag-charts-format-top-level-group .ag-charts-format-top-level-group-container,\\n.ag-theme-quartz-auto-dark .ag-charts-data-group .ag-charts-data-group-container,\\n.ag-theme-quartz-auto-dark .ag-charts-settings-group .ag-charts-settings-group-container {\\n  padding: 0 var(--ag-widget-container-horizontal-padding);\\n}\\n.ag-theme-quartz .ag-charts-format-sub-level-group-title-bar,\\n.ag-theme-quartz-dark .ag-charts-format-sub-level-group-title-bar,\\n.ag-theme-quartz-auto-dark .ag-charts-format-sub-level-group-title-bar {\\n  padding: var(--ag-widget-vertical-spacing) 0;\\n}\\n.ag-theme-quartz .ag-charts-format-sub-level-group-container,\\n.ag-theme-quartz-dark .ag-charts-format-sub-level-group-container,\\n.ag-theme-quartz-auto-dark .ag-charts-format-sub-level-group-container {\\n  padding-top: var(--ag-widget-vertical-spacing);\\n  padding-bottom: var(--ag-widget-container-vertical-padding);\\n}\\n.ag-theme-quartz .ag-charts-format-top-level-group-container > *,\\n.ag-theme-quartz .ag-charts-format-sub-level-group-container > *,\\n.ag-theme-quartz-dark .ag-charts-format-top-level-group-container > *,\\n.ag-theme-quartz-dark .ag-charts-format-sub-level-group-container > *,\\n.ag-theme-quartz-auto-dark .ag-charts-format-top-level-group-container > *,\\n.ag-theme-quartz-auto-dark .ag-charts-format-sub-level-group-container > * {\\n  margin-bottom: var(--ag-widget-vertical-spacing);\\n}\\n.ag-theme-quartz .ag-charts-data-group-item,\\n.ag-theme-quartz-dark .ag-charts-data-group-item,\\n.ag-theme-quartz-auto-dark .ag-charts-data-group-item {\\n  padding-bottom: var(--ag-widget-container-vertical-padding);\\n}\\n.ag-theme-quartz .ag-chart-settings-mini-wrapper,\\n.a";
      S = S + "g-theme-quartz-dark .ag-chart-settings-mini-wrapper,\\n.ag-theme-quartz-auto-dark .ag-chart-settings-mini-wrapper {\\n  padding-bottom: var(--ag-widget-container-vertical-padding);\\n}\\n.ag-theme-quartz .ag-chart-advanced-settings-section,\\n.ag-theme-quartz-dark .ag-chart-advanced-settings-section,\\n.ag-theme-quartz-auto-dark .ag-chart-advanced-settings-section {\\n  padding-top: var(--ag-widget-container-vertical-padding);\\n  padding-bottom: var(--ag-widget-container-vertical-padding);\\n}\\n.ag-theme-quartz .ag-charts-advanced-settings-top-level-group .ag-charts-advanced-settings-top-level-group-title-bar,\\n.ag-theme-quartz .ag-charts-advanced-settings-top-level-group .ag-charts-advanced-settings-top-level-group-container,\\n.ag-theme-quartz-dark .ag-charts-advanced-settings-top-level-group .ag-charts-advanced-settings-top-level-group-title-bar,\\n.ag-theme-quartz-dark .ag-charts-advanced-settings-top-level-group .ag-charts-advanced-settings-top-level-group-container,\\n.ag-theme-quartz-auto-dark .ag-charts-advanced-settings-top-level-group .ag-charts-advanced-settings-top-level-group-title-bar,\\n.ag-theme-quartz-auto-dark .ag-charts-advanced-settings-top-level-group .ag-charts-advanced-settings-top-level-group-container {\\n  padding: 0 var(--ag-widget-container-horizontal-padding);\\n}\\n.ag-theme-quartz .ag-charts-advanced-settings-top-level-group-container,\\n.ag-theme-quartz-dark .ag-charts-advanced-settings-top-level-group-container,\\n.ag-theme-quartz-auto-dark .ag-charts-advanced-settings-top-level-group-container {\\n  margin: 0;\\n}\\n.ag-theme-quartz .ag-charts-advanced-settings-top-level-group-item,\\n.ag-theme-quartz-dark .ag-charts-advanced-settings-top-level-group-item,\\n.ag-theme-quartz-auto-dark .ag-charts-advanced-settings-top-level-group-item {\\n  margin-top: calc(var(--ag-widget-vertical-spacing) * 2);\\n  margin-bottom: 0;\\n}\\n.ag-theme-quartz .ag-ltr .ag-group-title-bar-icon, .ag-theme-quartz-dark .ag-ltr .ag-group-title-bar-icon, .ag-theme-quartz-auto-dark .ag";
      S = S + "-ltr .ag-group-title-bar-icon {\\n  margin-right: var(--ag-grid-size);\\n}\\n\\n.ag-theme-quartz .ag-rtl .ag-group-title-bar-icon, .ag-theme-quartz-dark .ag-rtl .ag-group-title-bar-icon, .ag-theme-quartz-auto-dark .ag-rtl .ag-group-title-bar-icon {\\n  margin-left: var(--ag-grid-size);\\n}\\n\\n.ag-theme-quartz .ag-spectrum-color,\\n.ag-theme-quartz .ag-spectrum-fill,\\n.ag-theme-quartz-dark .ag-spectrum-color,\\n.ag-theme-quartz-dark .ag-spectrum-fill,\\n.ag-theme-quartz-auto-dark .ag-spectrum-color,\\n.ag-theme-quartz-auto-dark .ag-spectrum-fill {\\n  border-radius: var(--ag-border-radius);\\n}\\n.ag-theme-quartz .ag-spectrum-dragger,\\n.ag-theme-quartz-dark .ag-spectrum-dragger,\\n.ag-theme-quartz-auto-dark .ag-spectrum-dragger {\\n  border-radius: 18px;\\n  height: 18px;\\n  width: 18px;\\n  border: 3px solid white;\\n}\\n.ag-theme-quartz .ag-spectrum-tools,\\n.ag-theme-quartz-dark .ag-spectrum-tools,\\n.ag-theme-quartz-auto-dark .ag-spectrum-tools {\\n  padding-left: 0;\\n  padding-right: 0;\\n  padding-bottom: 0;\\n}\\n.ag-theme-quartz .ag-spectrum-tool,\\n.ag-theme-quartz-dark .ag-spectrum-tool,\\n.ag-theme-quartz-auto-dark .ag-spectrum-tool {\\n  height: 12px;\\n}\\n.ag-theme-quartz .ag-spectrum-hue-background,\\n.ag-theme-quartz .ag-spectrum-alpha-background,\\n.ag-theme-quartz-dark .ag-spectrum-hue-background,\\n.ag-theme-quartz-dark .ag-spectrum-alpha-background,\\n.ag-theme-quartz-auto-dark .ag-spectrum-hue-background,\\n.ag-theme-quartz-auto-dark .ag-spectrum-alpha-background {\\n  border-radius: 12px;\\n}\\n.ag-theme-quartz .ag-spectrum-slider,\\n.ag-theme-quartz-dark .ag-spectrum-slider,\\n.ag-theme-quartz-auto-dark .ag-spectrum-slider {\\n  margin-top: -15px;\\n  width: 18px;\\n  height: 18px;\\n  border-radius: 18px;\\n  border: 3px solid rgb(248, 248, 248);\\n}\\n.ag-theme-quartz .ag-recent-colors,\\n.ag-theme-quartz-dark .ag-recent-colors,\\n.ag-theme-quartz-auto-dark .ag-recent-colors {\\n  margin-left: var(--ag-grid-size);\\n  margin-right: var(--ag-grid-size);\\n  margin-bottom: 2px;\\n}\\n.ag-theme-qua";
      S = S + "rtz .ag-color-input-color,\\n.ag-theme-quartz .ag-color-picker-color,\\n.ag-theme-quartz .ag-recent-color,\\n.ag-theme-quartz-dark .ag-color-input-color,\\n.ag-theme-quartz-dark .ag-color-picker-color,\\n.ag-theme-quartz-dark .ag-recent-color,\\n.ag-theme-quartz-auto-dark .ag-color-input-color,\\n.ag-theme-quartz-auto-dark .ag-color-picker-color,\\n.ag-theme-quartz-auto-dark .ag-recent-color {\\n  border-radius: 4px;\\n}\\n.ag-theme-quartz .ag-recent-color,\\n.ag-theme-quartz-dark .ag-recent-color,\\n.ag-theme-quartz-auto-dark .ag-recent-color {\\n  border: var(--ag-borders-secondary) var(--ag-secondary-border-color);\\n}\\n.ag-theme-quartz.ag-dnd-ghost,\\n.ag-theme-quartz-dark.ag-dnd-ghost,\\n.ag-theme-quartz-auto-dark.ag-dnd-ghost {\\n  font-weight: 500;\\n}\\n.ag-theme-quartz .ag-standard-button,\\n.ag-theme-quartz-dark .ag-standard-button,\\n.ag-theme-quartz-auto-dark .ag-standard-button {\\n  font-family: inherit;\\n  -moz-appearance: none;\\n       appearance: none;\\n  -webkit-appearance: none;\\n  border-radius: var(--ag-border-radius);\\n  border: solid 1px var(--ag-input-border-color);\\n  background-color: var(--ag-background-color);\\n  padding: var(--ag-grid-size) calc(var(--ag-grid-size) * 2);\\n  cursor: pointer;\\n}\\n.ag-theme-quartz .ag-standard-button:hover,\\n.ag-theme-quartz-dark .ag-standard-button:hover,\\n.ag-theme-quartz-auto-dark .ag-standard-button:hover {\\n  background-color: var(--ag-row-hover-color);\\n}\\n.ag-theme-quartz .ag-standard-button:active,\\n.ag-theme-quartz-dark .ag-standard-button:active,\\n.ag-theme-quartz-auto-dark .ag-standard-button:active {\\n  border-color: var(--ag-active-color);\\n}\\n.ag-theme-quartz .ag-standard-button:disabled,\\n.ag-theme-quartz-dark .ag-standard-button:disabled,\\n.ag-theme-quartz-auto-dark .ag-standard-button:disabled {\\n  color: var(--ag-disabled-foreground-color);\\n  background-color: var(--ag-input-disabled-background-color);\\n  border-color: var(--ag-input-disabled-border-color);\\n}\\n.ag-theme-quartz .ag-column-drop-cell,\\n.ag-theme-";
      S = S + "quartz-dark .ag-column-drop-cell,\\n.ag-theme-quartz-auto-dark .ag-column-drop-cell {\\n  border-radius: calc(var(--ag-grid-size) * 3);\\n  height: calc(var(--ag-grid-size) * 3);\\n  padding: 0 var(--ag-grid-size);\\n}\\n.ag-theme-quartz .ag-column-drop-cell-button,\\n.ag-theme-quartz-dark .ag-column-drop-cell-button,\\n.ag-theme-quartz-auto-dark .ag-column-drop-cell-button {\\n  min-width: 0;\\n  margin: 0;\\n}\\n.ag-theme-quartz .ag-column-drop-cell-drag-handle,\\n.ag-theme-quartz-dark .ag-column-drop-cell-drag-handle,\\n.ag-theme-quartz-auto-dark .ag-column-drop-cell-drag-handle {\\n  margin-left: 0;\\n}\\n.ag-theme-quartz .ag-column-drop-vertical,\\n.ag-theme-quartz-dark .ag-column-drop-vertical,\\n.ag-theme-quartz-auto-dark .ag-column-drop-vertical {\\n  min-height: 75px;\\n}\\n.ag-theme-quartz .ag-column-drop-vertical-title-bar,\\n.ag-theme-quartz-dark .ag-column-drop-vertical-title-bar,\\n.ag-theme-quartz-auto-dark .ag-column-drop-vertical-title-bar {\\n  padding: var(--ag-widget-container-vertical-padding) calc(var(--ag-grid-size) * 2) 0;\\n}\\n.ag-theme-quartz .ag-ltr .ag-column-drop-vertical-icon, .ag-theme-quartz-dark .ag-ltr .ag-column-drop-vertical-icon, .ag-theme-quartz-auto-dark .ag-ltr .ag-column-drop-vertical-icon {\\n  margin-left: 0;\\n  margin-right: var(--ag-widget-horizontal-spacing);\\n}\\n\\n.ag-theme-quartz .ag-rtl .ag-column-drop-vertical-icon, .ag-theme-quartz-dark .ag-rtl .ag-column-drop-vertical-icon, .ag-theme-quartz-auto-dark .ag-rtl .ag-column-drop-vertical-icon {\\n  margin-right: 0;\\n  margin-left: var(--ag-widget-horizontal-spacing);\\n}\\n\\n.ag-theme-quartz .ag-column-drop-vertical-empty-message,\\n.ag-theme-quartz-dark .ag-column-drop-vertical-empty-message,\\n.ag-theme-quartz-auto-dark .ag-column-drop-vertical-empty-message {\\n  display: flex;\\n  align-items: center;\\n  justify-content: center;\\n  border: dashed 1px;\\n  border-color: var(--ag-border-color);\\n  margin: calc(var(--ag-grid-size) * 1.5) calc(var(--ag-grid-size) * 2);\\n  padding: calc(var(--ag-grid-size";
      S = S + ") * 2);\\n}\\n.ag-theme-quartz .ag-column-drop-empty-message,\\n.ag-theme-quartz-dark .ag-column-drop-empty-message,\\n.ag-theme-quartz-auto-dark .ag-column-drop-empty-message {\\n  color: var(--ag-foreground-color);\\n}\\n.ag-theme-quartz .ag-pill-select .ag-column-drop,\\n.ag-theme-quartz-dark .ag-pill-select .ag-column-drop,\\n.ag-theme-quartz-auto-dark .ag-pill-select .ag-column-drop {\\n  min-height: 0;\\n  min-height: initial;\\n}\\n.ag-theme-quartz .ag-pill-select .ag-picker-field-display,\\n.ag-theme-quartz-dark .ag-pill-select .ag-picker-field-display,\\n.ag-theme-quartz-auto-dark .ag-pill-select .ag-picker-field-display {\\n  font-weight: 500;\\n  color: var(--ag-chart-menu-pill-select-button-color);\\n}\\n.ag-theme-quartz .ag-pill-select .ag-picker-field-icon .ag-icon,\\n.ag-theme-quartz-dark .ag-pill-select .ag-picker-field-icon .ag-icon,\\n.ag-theme-quartz-auto-dark .ag-pill-select .ag-picker-field-icon .ag-icon {\\n  color: var(--ag-chart-menu-pill-select-button-color);\\n}\\n.ag-theme-quartz .ag-status-bar,\\n.ag-theme-quartz-dark .ag-status-bar,\\n.ag-theme-quartz-auto-dark .ag-status-bar {\\n  font-weight: normal;\\n}\\n.ag-theme-quartz .ag-status-name-value,\\n.ag-theme-quartz-dark .ag-status-name-value,\\n.ag-theme-quartz-auto-dark .ag-status-name-value {\\n  padding: var(--ag-widget-container-vertical-padding) 0;\\n}\\n.ag-theme-quartz .ag-status-name-value-value,\\n.ag-theme-quartz .ag-paging-number,\\n.ag-theme-quartz .ag-paging-row-summary-panel-number,\\n.ag-theme-quartz-dark .ag-status-name-value-value,\\n.ag-theme-quartz-dark .ag-paging-number,\\n.ag-theme-quartz-dark .ag-paging-row-summary-panel-number,\\n.ag-theme-quartz-auto-dark .ag-status-name-value-value,\\n.ag-theme-quartz-auto-dark .ag-paging-number,\\n.ag-theme-quartz-auto-dark .ag-paging-row-summary-panel-number {\\n  font-weight: 500;\\n}\\n.ag-theme-quartz .ag-column-drop-cell-button,\\n.ag-theme-quartz-dark .ag-column-drop-cell-button,\\n.ag-theme-quartz-auto-dark .ag-column-drop-cell-button {\\n  opacity: 0.75;\\n}\\n.ag-them";
      S = S + "e-quartz .ag-column-drop-cell-button:hover,\\n.ag-theme-quartz-dark .ag-column-drop-cell-button:hover,\\n.ag-theme-quartz-auto-dark .ag-column-drop-cell-button:hover {\\n  opacity: 1;\\n}\\n.ag-theme-quartz .ag-header-cell-menu-button,\\n.ag-theme-quartz .ag-header-cell-filter-button,\\n.ag-theme-quartz .ag-panel-title-bar-button,\\n.ag-theme-quartz .ag-header-expand-icon,\\n.ag-theme-quartz .ag-column-group-icons,\\n.ag-theme-quartz .ag-set-filter-group-icons,\\n.ag-theme-quartz .ag-group-expanded .ag-icon,\\n.ag-theme-quartz .ag-group-contracted .ag-icon,\\n.ag-theme-quartz .ag-chart-settings-prev,\\n.ag-theme-quartz .ag-chart-settings-next,\\n.ag-theme-quartz .ag-group-title-bar-icon,\\n.ag-theme-quartz .ag-column-select-header-icon,\\n.ag-theme-quartz .ag-floating-filter-button-button,\\n.ag-theme-quartz .ag-filter-toolpanel-expand,\\n.ag-theme-quartz .ag-panel-title-bar-button-icon,\\n.ag-theme-quartz .ag-chart-menu-icon,\\n.ag-theme-quartz-dark .ag-header-cell-menu-button,\\n.ag-theme-quartz-dark .ag-header-cell-filter-button,\\n.ag-theme-quartz-dark .ag-panel-title-bar-button,\\n.ag-theme-quartz-dark .ag-header-expand-icon,\\n.ag-theme-quartz-dark .ag-column-group-icons,\\n.ag-theme-quartz-dark .ag-set-filter-group-icons,\\n.ag-theme-quartz-dark .ag-group-expanded .ag-icon,\\n.ag-theme-quartz-dark .ag-group-contracted .ag-icon,\\n.ag-theme-quartz-dark .ag-chart-settings-prev,\\n.ag-theme-quartz-dark .ag-chart-settings-next,\\n.ag-theme-quartz-dark .ag-group-title-bar-icon,\\n.ag-theme-quartz-dark .ag-column-select-header-icon,\\n.ag-theme-quartz-dark .ag-floating-filter-button-button,\\n.ag-theme-quartz-dark .ag-filter-toolpanel-expand,\\n.ag-theme-quartz-dark .ag-panel-title-bar-button-icon,\\n.ag-theme-quartz-dark .ag-chart-menu-icon,\\n.ag-theme-quartz-auto-dark .ag-header-cell-menu-button,\\n.ag-theme-quartz-auto-dark .ag-header-cell-filter-button,\\n.ag-theme-quartz-auto-dark .ag-panel-title-bar-button,\\n.ag-theme-quartz-auto-dark .ag-header-expand-icon,\\n.ag-theme-quartz-auto-dark .ag-column";
      S = S + "-group-icons,\\n.ag-theme-quartz-auto-dark .ag-set-filter-group-icons,\\n.ag-theme-quartz-auto-dark .ag-group-expanded .ag-icon,\\n.ag-theme-quartz-auto-dark .ag-group-contracted .ag-icon,\\n.ag-theme-quartz-auto-dark .ag-chart-settings-prev,\\n.ag-theme-quartz-auto-dark .ag-chart-settings-next,\\n.ag-theme-quartz-auto-dark .ag-group-title-bar-icon,\\n.ag-theme-quartz-auto-dark .ag-column-select-header-icon,\\n.ag-theme-quartz-auto-dark .ag-floating-filter-button-button,\\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-expand,\\n.ag-theme-quartz-auto-dark .ag-panel-title-bar-button-icon,\\n.ag-theme-quartz-auto-dark .ag-chart-menu-icon {\\n  --ag-quartz-icon-hover-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 10%);\\n}\\n.ag-theme-quartz .ag-header-cell-menu-button:hover,\\n.ag-theme-quartz .ag-header-cell-filter-button:hover,\\n.ag-theme-quartz .ag-panel-title-bar-button:hover,\\n.ag-theme-quartz .ag-header-expand-icon:hover,\\n.ag-theme-quartz .ag-column-group-icons:hover,\\n.ag-theme-quartz .ag-set-filter-group-icons:hover,\\n.ag-theme-quartz .ag-group-expanded .ag-icon:hover,\\n.ag-theme-quartz .ag-group-contracted .ag-icon:hover,\\n.ag-theme-quartz .ag-chart-settings-prev:hover,\\n.ag-theme-quartz .ag-chart-settings-next:hover,\\n.ag-theme-quartz .ag-group-title-bar-icon:hover,\\n.ag-theme-quartz .ag-column-select-header-icon:hover,\\n.ag-theme-quartz .ag-floating-filter-button-button:hover,\\n.ag-theme-quartz .ag-filter-toolpanel-expand:hover,\\n.ag-theme-quartz .ag-panel-title-bar-button-icon:hover,\\n.ag-theme-quartz .ag-chart-menu-icon:hover,\\n.ag-theme-quartz-dark .ag-header-cell-menu-button:hover,\\n.ag-theme-quartz-dark .ag-header-cell-filter-button:hover,\\n.ag-theme-quartz-dark .ag-panel-title-bar-button:hover,\\n.ag-theme-quartz-dark .ag-header-expand-icon:hover,\\n.ag-theme-quartz-dark .ag-column-group-icons:hover,\\n.ag-theme-quartz-dark .ag-set-filter-group-icons:hover,\\n.ag-theme-quartz-dark .ag-group-expanded .ag-icon:hover,\\n.ag-theme-quartz-dark .ag-group-c";
      S = S + "ontracted .ag-icon:hover,\\n.ag-theme-quartz-dark .ag-chart-settings-prev:hover,\\n.ag-theme-quartz-dark .ag-chart-settings-next:hover,\\n.ag-theme-quartz-dark .ag-group-title-bar-icon:hover,\\n.ag-theme-quartz-dark .ag-column-select-header-icon:hover,\\n.ag-theme-quartz-dark .ag-floating-filter-button-button:hover,\\n.ag-theme-quartz-dark .ag-filter-toolpanel-expand:hover,\\n.ag-theme-quartz-dark .ag-panel-title-bar-button-icon:hover,\\n.ag-theme-quartz-dark .ag-chart-menu-icon:hover,\\n.ag-theme-quartz-auto-dark .ag-header-cell-menu-button:hover,\\n.ag-theme-quartz-auto-dark .ag-header-cell-filter-button:hover,\\n.ag-theme-quartz-auto-dark .ag-panel-title-bar-button:hover,\\n.ag-theme-quartz-auto-dark .ag-header-expand-icon:hover,\\n.ag-theme-quartz-auto-dark .ag-column-group-icons:hover,\\n.ag-theme-quartz-auto-dark .ag-set-filter-group-icons:hover,\\n.ag-theme-quartz-auto-dark .ag-group-expanded .ag-icon:hover,\\n.ag-theme-quartz-auto-dark .ag-group-contracted .ag-icon:hover,\\n.ag-theme-quartz-auto-dark .ag-chart-settings-prev:hover,\\n.ag-theme-quartz-auto-dark .ag-chart-settings-next:hover,\\n.ag-theme-quartz-auto-dark .ag-group-title-bar-icon:hover,\\n.ag-theme-quartz-auto-dark .ag-column-select-header-icon:hover,\\n.ag-theme-quartz-auto-dark .ag-floating-filter-button-button:hover,\\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-expand:hover,\\n.ag-theme-quartz-auto-dark .ag-panel-title-bar-button-icon:hover,\\n.ag-theme-quartz-auto-dark .ag-chart-menu-icon:hover {\\n  border-radius: 1px;\\n  background-color: var(--ag-quartz-icon-hover-color);\\n  box-shadow: 0 0 0 4px var(--ag-quartz-icon-hover-color);\\n}\\n.ag-theme-quartz .ag-filter-active,\\n.ag-theme-quartz-dark .ag-filter-active,\\n.ag-theme-quartz-auto-dark .ag-filter-active {\\n  --ag-quartz-icon-active-color: color-mix(in srgb, transparent, var(--ag-active-color) 14%);\\n  --ag-quartz-icon-hover-color: color-mix(in srgb, transparent, var(--ag-active-color) 28%);\\n  position: relative;\\n  border-radius: 1px;\\n  background-color";
      S = S + ': var(--ag-quartz-icon-active-color);\\n  box-shadow: 0 0 0 4px var(--ag-quartz-icon-active-color);\\n}\\n.ag-theme-quartz .ag-filter-active::after,\\n.ag-theme-quartz-dark .ag-filter-active::after,\\n.ag-theme-quartz-auto-dark .ag-filter-active::after {\\n  content: "";\\n  position: absolute;\\n  width: 6px;\\n  height: 6px;\\n  top: -1px;\\n  right: -1px;\\n  border-radius: 50%;\\n  background-color: var(--ag-active-color);\\n}\\n.ag-theme-quartz .ag-filter-active .ag-icon-filter,\\n.ag-theme-quartz-dark .ag-filter-active .ag-icon-filter,\\n.ag-theme-quartz-auto-dark .ag-filter-active .ag-icon-filter {\\n  clip-path: path("M8,0C8,4.415 11.585,8 16,8L16,16L0,16L0,0L8,0Z");\\n}\\n.ag-theme-quartz .ag-chart-menu,\\n.ag-theme-quartz-dark .ag-chart-menu,\\n.ag-theme-quartz-auto-dark .ag-chart-menu {\\n  --ag-icon-size: 20px;\\n  background-color: color-mix(in srgb, transparent, var(--ag-background-color) 30%);\\n  padding: 4px 2px;\\n}\\n.ag-theme-quartz .ag-chart-menu-icon,\\n.ag-theme-quartz-dark .ag-chart-menu-icon,\\n.ag-theme-quartz-auto-dark .ag-chart-menu-icon {\\n  opacity: 0.8;\\n}\\n.ag-theme-quartz .ag-drag-handle,\\n.ag-theme-quartz-dark .ag-drag-handle,\\n.ag-theme-quartz-auto-dark .ag-drag-handle {\\n  color: var(--ag-icon-font-color);\\n}\\n.ag-theme-quartz .ag-menu-option-icon,\\n.ag-theme-quartz .ag-compact-menu-option-icon,\\n.ag-theme-quartz-dark .ag-menu-option-icon,\\n.ag-theme-quartz-dark .ag-compact-menu-option-icon,\\n.ag-theme-quartz-auto-dark .ag-menu-option-icon,\\n.ag-theme-quartz-auto-dark .ag-compact-menu-option-icon {\\n  width: var(--ag-icon-size);\\n  cursor: pointer;\\n}\\n.ag-theme-quartz .ag-ltr .ag-menu-option-icon, .ag-theme-quartz .ag-ltr .ag-compact-menu-option-icon, .ag-theme-quartz-dark .ag-ltr .ag-menu-option-icon, .ag-theme-quartz-dark .ag-ltr .ag-compact-menu-option-icon, .ag-theme-quartz-auto-dark .ag-ltr .ag-menu-option-icon, .ag-theme-quartz-auto-dark .ag-ltr .ag-compact-menu-option-icon {\\n  padding-left: calc(var(--ag-grid-size) * 1.5);\\n}\\n\\n.ag-theme-quartz .ag-';
      S = S + "rtl .ag-menu-option-icon, .ag-theme-quartz .ag-rtl .ag-compact-menu-option-icon, .ag-theme-quartz-dark .ag-rtl .ag-menu-option-icon, .ag-theme-quartz-dark .ag-rtl .ag-compact-menu-option-icon, .ag-theme-quartz-auto-dark .ag-rtl .ag-menu-option-icon, .ag-theme-quartz-auto-dark .ag-rtl .ag-compact-menu-option-icon {\\n  padding-right: calc(var(--ag-grid-size) * 1.5);\\n}\\n\\n.ag-theme-quartz .ag-chart-settings-card-item.ag-not-selected:hover,\\n.ag-theme-quartz-dark .ag-chart-settings-card-item.ag-not-selected:hover,\\n.ag-theme-quartz-auto-dark .ag-chart-settings-card-item.ag-not-selected:hover {\\n  opacity: 0.35;\\n}\\n.ag-theme-quartz .ag-ltr .ag-panel-title-bar-button, .ag-theme-quartz-dark .ag-ltr .ag-panel-title-bar-button, .ag-theme-quartz-auto-dark .ag-ltr .ag-panel-title-bar-button {\\n  margin-left: calc(var(--ag-grid-size) * 2);\\n  margin-right: var(--ag-grid-size);\\n}\\n\\n.ag-theme-quartz .ag-rtl .ag-panel-title-bar-button, .ag-theme-quartz-dark .ag-rtl .ag-panel-title-bar-button, .ag-theme-quartz-auto-dark .ag-rtl .ag-panel-title-bar-button {\\n  margin-right: calc(var(--ag-grid-size) * 2);\\n  margin-left: var(--ag-grid-size);\\n}\\n\\n.ag-theme-quartz .ag-multi-filter-group-title-bar,\\n.ag-theme-quartz-dark .ag-multi-filter-group-title-bar,\\n.ag-theme-quartz-auto-dark .ag-multi-filter-group-title-bar {\\n  padding: calc(var(--ag-grid-size) * 1.5) var(--ag-grid-size);\\n}\\n.ag-theme-quartz .ag-ltr .ag-filter-toolpanel-instance-body, .ag-theme-quartz-dark .ag-ltr .ag-filter-toolpanel-instance-body, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-toolpanel-instance-body {\\n  padding-left: var(--ag-grid-size);\\n}\\n\\n.ag-theme-quartz .ag-rtl .ag-filter-toolpanel-instance-body, .ag-theme-quartz-dark .ag-rtl .ag-filter-toolpanel-instance-body, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-toolpanel-instance-body {\\n  padding-right: var(--ag-grid-size);\\n}\\n\\n.ag-theme-quartz .ag-filter-toolpanel-instance-filter,\\n.ag-theme-quartz-dark .ag-filter-toolpanel-instance-filter,\\n.ag-";
      S = S + "theme-quartz-auto-dark .ag-filter-toolpanel-instance-filter {\\n  border: none;\\n  background-color: var(--ag-control-panel-background-color);\\n}\\n.ag-theme-quartz .ag-ltr .ag-filter-toolpanel-instance-filter, .ag-theme-quartz-dark .ag-ltr .ag-filter-toolpanel-instance-filter, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-toolpanel-instance-filter {\\n  margin-left: calc(var(--ag-icon-size) * 0.5);\\n}\\n\\n.ag-theme-quartz .ag-rtl .ag-filter-toolpanel-instance-filter, .ag-theme-quartz-dark .ag-rtl .ag-filter-toolpanel-instance-filter, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-toolpanel-instance-filter {\\n  margin-right: calc(var(--ag-icon-size) * 0.5);\\n}\\n\\n.ag-theme-quartz .ag-filter-toolpanel-group-level-0,\\n.ag-theme-quartz-dark .ag-filter-toolpanel-group-level-0,\\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-group-level-0 {\\n  border-top: none;\\n}\\n.ag-theme-quartz .ag-filter-toolpanel-header,\\n.ag-theme-quartz-dark .ag-filter-toolpanel-header,\\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-header {\\n  height: auto;\\n  height: initial;\\n  padding-top: var(--ag-grid-size);\\n  padding-bottom: var(--ag-grid-size);\\n}\\n.ag-theme-quartz .ag-filter-toolpanel-group-item,\\n.ag-theme-quartz-dark .ag-filter-toolpanel-group-item,\\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-group-item {\\n  margin: 0;\\n}\\n.ag-theme-quartz .ag-layout-auto-height .ag-center-cols-viewport,\\n.ag-theme-quartz .ag-layout-auto-height .ag-center-cols-container,\\n.ag-theme-quartz .ag-layout-print .ag-center-cols-viewport,\\n.ag-theme-quartz .ag-layout-print .ag-center-cols-container,\\n.ag-theme-quartz-dark .ag-layout-auto-height .ag-center-cols-viewport,\\n.ag-theme-quartz-dark .ag-layout-auto-height .ag-center-cols-container,\\n.ag-theme-quartz-dark .ag-layout-print .ag-center-cols-viewport,\\n.ag-theme-quartz-dark .ag-layout-print .ag-center-cols-container,\\n.ag-theme-quartz-auto-dark .ag-layout-auto-height .ag-center-cols-viewport,\\n.ag-theme-quartz-auto-dark .ag-layout-auto-height .ag-cent";
      S = S + "er-cols-container,\\n.ag-theme-quartz-auto-dark .ag-layout-print .ag-center-cols-viewport,\\n.ag-theme-quartz-auto-dark .ag-layout-print .ag-center-cols-container {\\n  min-height: 150px;\\n}\\n.ag-theme-quartz .ag-overlay-no-rows-wrapper.ag-layout-auto-height,\\n.ag-theme-quartz-dark .ag-overlay-no-rows-wrapper.ag-layout-auto-height,\\n.ag-theme-quartz-auto-dark .ag-overlay-no-rows-wrapper.ag-layout-auto-height {\\n  padding-top: 60px;\\n}\\n.ag-theme-quartz .ag-date-time-list-page-entry-is-current,\\n.ag-theme-quartz-dark .ag-date-time-list-page-entry-is-current,\\n.ag-theme-quartz-auto-dark .ag-date-time-list-page-entry-is-current {\\n  background-color: var(--ag-active-color);\\n}\\n.ag-theme-quartz .ag-advanced-filter-builder-button,\\n.ag-theme-quartz-dark .ag-advanced-filter-builder-button,\\n.ag-theme-quartz-auto-dark .ag-advanced-filter-builder-button {\\n  padding: var(--ag-grid-size);\\n  font-weight: 600;\\n}\\n.ag-theme-quartz .ag-advanced-filter-builder-item-button-disabled .ag-icon,\\n.ag-theme-quartz .ag-disabled .ag-icon,\\n.ag-theme-quartz .ag-column-select-column-group-readonly .ag-icon,\\n.ag-theme-quartz [disabled] .ag-icon,\\n.ag-theme-quartz-dark .ag-advanced-filter-builder-item-button-disabled .ag-icon,\\n.ag-theme-quartz-dark .ag-disabled .ag-icon,\\n.ag-theme-quartz-dark .ag-column-select-column-group-readonly .ag-icon,\\n.ag-theme-quartz-dark [disabled] .ag-icon,\\n.ag-theme-quartz-auto-dark .ag-advanced-filter-builder-item-button-disabled .ag-icon,\\n.ag-theme-quartz-auto-dark .ag-disabled .ag-icon,\\n.ag-theme-quartz-auto-dark .ag-column-select-column-group-readonly .ag-icon,\\n.ag-theme-quartz-auto-dark [disabled] .ag-icon {\\n  opacity: 0.6;\\n}\\n.ag-theme-quartz .ag-icon-grip,\\n.ag-theme-quartz-dark .ag-icon-grip,\\n.ag-theme-quartz-auto-dark .ag-icon-grip {\\n  opacity: 0.7;\\n}\\n.ag-theme-quartz .ag-column-select-column-readonly.ag-icon-grip,\\n.ag-theme-quartz .ag-column-select-column-readonly .ag-icon-grip,\\n.ag-theme-quartz-dark .ag-column-select-column-readonly.ag-i";
      S = S + 'con-grip,\\n.ag-theme-quartz-dark .ag-column-select-column-readonly .ag-icon-grip,\\n.ag-theme-quartz-auto-dark .ag-column-select-column-readonly.ag-icon-grip,\\n.ag-theme-quartz-auto-dark .ag-column-select-column-readonly .ag-icon-grip {\\n  opacity: 0.35;\\n}\\n.ag-theme-quartz .ag-column-select-header-filter-wrapper .ag-input-wrapper::before,\\n.ag-theme-quartz .ag-filter-toolpanel-search .ag-input-wrapper::before,\\n.ag-theme-quartz .ag-mini-filter .ag-input-wrapper::before,\\n.ag-theme-quartz .ag-filter-filter .ag-input-wrapper::before,\\n.ag-theme-quartz-dark .ag-column-select-header-filter-wrapper .ag-input-wrapper::before,\\n.ag-theme-quartz-dark .ag-filter-toolpanel-search .ag-input-wrapper::before,\\n.ag-theme-quartz-dark .ag-mini-filter .ag-input-wrapper::before,\\n.ag-theme-quartz-dark .ag-filter-filter .ag-input-wrapper::before,\\n.ag-theme-quartz-auto-dark .ag-column-select-header-filter-wrapper .ag-input-wrapper::before,\\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-search .ag-input-wrapper::before,\\n.ag-theme-quartz-auto-dark .ag-mini-filter .ag-input-wrapper::before,\\n.ag-theme-quartz-auto-dark .ag-filter-filter .ag-input-wrapper::before {\\n  position: absolute;\\n  display: block;\\n  width: 12px;\\n  height: 12px;\\n  background-image: url(\'+u+\');\\n  background-position: 50% 50%;\\n  background-size: contain;\\n  opacity: 0.4;\\n  content: "";\\n  filter: var(--ag-icon-filter);\\n}\\n.ag-theme-quartz .ag-ltr .ag-column-select-header-filter-wrapper .ag-input-wrapper::before, .ag-theme-quartz .ag-ltr .ag-filter-toolpanel-search .ag-input-wrapper::before, .ag-theme-quartz .ag-ltr .ag-mini-filter .ag-input-wrapper::before, .ag-theme-quartz .ag-ltr .ag-filter-filter .ag-input-wrapper::before, .ag-theme-quartz-dark .ag-ltr .ag-column-select-header-filter-wrapper .ag-input-wrapper::before, .ag-theme-quartz-dark .ag-ltr .ag-filter-toolpanel-search .ag-input-wrapper::before, .ag-theme-quartz-dark .ag-ltr .ag-mini-filter .ag-input-wrapper::before, .ag-theme-quartz-dark .ag-ltr ';
      S = S + ".ag-filter-filter .ag-input-wrapper::before, .ag-theme-quartz-auto-dark .ag-ltr .ag-column-select-header-filter-wrapper .ag-input-wrapper::before, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-toolpanel-search .ag-input-wrapper::before, .ag-theme-quartz-auto-dark .ag-ltr .ag-mini-filter .ag-input-wrapper::before, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-filter .ag-input-wrapper::before {\\n  margin-left: var(--ag-grid-size);\\n}\\n\\n.ag-theme-quartz .ag-rtl .ag-column-select-header-filter-wrapper .ag-input-wrapper::before, .ag-theme-quartz .ag-rtl .ag-filter-toolpanel-search .ag-input-wrapper::before, .ag-theme-quartz .ag-rtl .ag-mini-filter .ag-input-wrapper::before, .ag-theme-quartz .ag-rtl .ag-filter-filter .ag-input-wrapper::before, .ag-theme-quartz-dark .ag-rtl .ag-column-select-header-filter-wrapper .ag-input-wrapper::before, .ag-theme-quartz-dark .ag-rtl .ag-filter-toolpanel-search .ag-input-wrapper::before, .ag-theme-quartz-dark .ag-rtl .ag-mini-filter .ag-input-wrapper::before, .ag-theme-quartz-dark .ag-rtl .ag-filter-filter .ag-input-wrapper::before, .ag-theme-quartz-auto-dark .ag-rtl .ag-column-select-header-filter-wrapper .ag-input-wrapper::before, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-toolpanel-search .ag-input-wrapper::before, .ag-theme-quartz-auto-dark .ag-rtl .ag-mini-filter .ag-input-wrapper::before, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-filter .ag-input-wrapper::before {\\n  margin-right: var(--ag-grid-size);\\n}\\n\\n.ag-theme-quartz .ag-ltr .ag-column-select-header-filter-wrapper input.ag-text-field-input, .ag-theme-quartz .ag-ltr .ag-column-select-header-filter-wrapper input.ag-number-field-input, .ag-theme-quartz .ag-ltr .ag-filter-toolpanel-search input.ag-text-field-input, .ag-theme-quartz .ag-ltr .ag-filter-toolpanel-search input.ag-number-field-input, .ag-theme-quartz .ag-ltr .ag-mini-filter input.ag-text-field-input, .ag-theme-quartz .ag-ltr .ag-mini-filter input.ag-number-field-input, .ag-theme-quartz .ag-ltr .ag-filter-filt";
      S = S + "er input.ag-text-field-input, .ag-theme-quartz .ag-ltr .ag-filter-filter input.ag-number-field-input, .ag-theme-quartz-dark .ag-ltr .ag-column-select-header-filter-wrapper input.ag-text-field-input, .ag-theme-quartz-dark .ag-ltr .ag-column-select-header-filter-wrapper input.ag-number-field-input, .ag-theme-quartz-dark .ag-ltr .ag-filter-toolpanel-search input.ag-text-field-input, .ag-theme-quartz-dark .ag-ltr .ag-filter-toolpanel-search input.ag-number-field-input, .ag-theme-quartz-dark .ag-ltr .ag-mini-filter input.ag-text-field-input, .ag-theme-quartz-dark .ag-ltr .ag-mini-filter input.ag-number-field-input, .ag-theme-quartz-dark .ag-ltr .ag-filter-filter input.ag-text-field-input, .ag-theme-quartz-dark .ag-ltr .ag-filter-filter input.ag-number-field-input, .ag-theme-quartz-auto-dark .ag-ltr .ag-column-select-header-filter-wrapper input.ag-text-field-input, .ag-theme-quartz-auto-dark .ag-ltr .ag-column-select-header-filter-wrapper input.ag-number-field-input, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-toolpanel-search input.ag-text-field-input, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-toolpanel-search input.ag-number-field-input, .ag-theme-quartz-auto-dark .ag-ltr .ag-mini-filter input.ag-text-field-input, .ag-theme-quartz-auto-dark .ag-ltr .ag-mini-filter input.ag-number-field-input, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-filter input.ag-text-field-input, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-filter input.ag-number-field-input {\\n  padding-left: 26px;\\n}\\n\\n.ag-theme-quartz .ag-rtl .ag-column-select-header-filter-wrapper input.ag-text-field-input, .ag-theme-quartz .ag-rtl .ag-column-select-header-filter-wrapper input.ag-number-field-input, .ag-theme-quartz .ag-rtl .ag-filter-toolpanel-search input.ag-text-field-input, .ag-theme-quartz .ag-rtl .ag-filter-toolpanel-search input.ag-number-field-input, .ag-theme-quartz .ag-rtl .ag-mini-filter input.ag-text-field-input, .ag-theme-quartz .ag-rtl .ag-mini-filter input.ag-number-field-input, .ag-th";
      S = S + "eme-quartz .ag-rtl .ag-filter-filter input.ag-text-field-input, .ag-theme-quartz .ag-rtl .ag-filter-filter input.ag-number-field-input, .ag-theme-quartz-dark .ag-rtl .ag-column-select-header-filter-wrapper input.ag-text-field-input, .ag-theme-quartz-dark .ag-rtl .ag-column-select-header-filter-wrapper input.ag-number-field-input, .ag-theme-quartz-dark .ag-rtl .ag-filter-toolpanel-search input.ag-text-field-input, .ag-theme-quartz-dark .ag-rtl .ag-filter-toolpanel-search input.ag-number-field-input, .ag-theme-quartz-dark .ag-rtl .ag-mini-filter input.ag-text-field-input, .ag-theme-quartz-dark .ag-rtl .ag-mini-filter input.ag-number-field-input, .ag-theme-quartz-dark .ag-rtl .ag-filter-filter input.ag-text-field-input, .ag-theme-quartz-dark .ag-rtl .ag-filter-filter input.ag-number-field-input, .ag-theme-quartz-auto-dark .ag-rtl .ag-column-select-header-filter-wrapper input.ag-text-field-input, .ag-theme-quartz-auto-dark .ag-rtl .ag-column-select-header-filter-wrapper input.ag-number-field-input, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-toolpanel-search input.ag-text-field-input, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-toolpanel-search input.ag-number-field-input, .ag-theme-quartz-auto-dark .ag-rtl .ag-mini-filter input.ag-text-field-input, .ag-theme-quartz-auto-dark .ag-rtl .ag-mini-filter input.ag-number-field-input, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-filter input.ag-text-field-input, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-filter input.ag-number-field-input {\\n  padding-right: 26px;\\n}\\n\\n.ag-theme-quartz .ag-ltr .ag-column-select-add-group-indent, .ag-theme-quartz-dark .ag-ltr .ag-column-select-add-group-indent, .ag-theme-quartz-auto-dark .ag-ltr .ag-column-select-add-group-indent {\\n  margin-left: calc(var(--ag-icon-size) + var(--ag-grid-size) * 1.5);\\n}\\n\\n.ag-theme-quartz .ag-rtl .ag-column-select-add-group-indent, .ag-theme-quartz-dark .ag-rtl .ag-column-select-add-group-indent, .ag-theme-quartz-auto-dark .ag-rtl .ag-column-select-a";
      S = S + "dd-group-indent {\\n  margin-right: calc(var(--ag-icon-size) + var(--ag-grid-size) * 1.5);\\n}\\n\\n.ag-theme-quartz .ag-text-field-input[disabled],\\n.ag-theme-quartz .ag-menu-option-disabled,\\n.ag-theme-quartz-dark .ag-text-field-input[disabled],\\n.ag-theme-quartz-dark .ag-menu-option-disabled,\\n.ag-theme-quartz-auto-dark .ag-text-field-input[disabled],\\n.ag-theme-quartz-auto-dark .ag-menu-option-disabled {\\n  cursor: not-allowed;\\n}\\n.ag-theme-quartz .ag-checkbox-input-wrapper.ag-checked.ag-disabled,\\n.ag-theme-quartz-dark .ag-checkbox-input-wrapper.ag-checked.ag-disabled,\\n.ag-theme-quartz-auto-dark .ag-checkbox-input-wrapper.ag-checked.ag-disabled {\\n  --ag-checkbox-checked-color: var(--ag-checkbox-unchecked-color);\\n}\\n.ag-theme-quartz .ag-checkbox-input,\\n.ag-theme-quartz .ag-toggle-button-input,\\n.ag-theme-quartz .ag-radio-button-input,\\n.ag-theme-quartz input[class^=ag-][type=range],\\n.ag-theme-quartz-dark .ag-checkbox-input,\\n.ag-theme-quartz-dark .ag-toggle-button-input,\\n.ag-theme-quartz-dark .ag-radio-button-input,\\n.ag-theme-quartz-dark input[class^=ag-][type=range],\\n.ag-theme-quartz-auto-dark .ag-checkbox-input,\\n.ag-theme-quartz-auto-dark .ag-toggle-button-input,\\n.ag-theme-quartz-auto-dark .ag-radio-button-input,\\n.ag-theme-quartz-auto-dark input[class^=ag-][type=range] {\\n  cursor: pointer;\\n}\\n.ag-theme-quartz .ag-details-row,\\n.ag-theme-quartz-dark .ag-details-row,\\n.ag-theme-quartz-auto-dark .ag-details-row {\\n  padding: calc(var(--ag-grid-size) * 3.75);\\n}\\n\\n.ag-theme-quartz-dark .ag-column-select-header-filter-wrapper .ag-input-wrapper::before,\\n.ag-theme-quartz-dark .ag-filter-toolpanel-search .ag-input-wrapper::before,\\n.ag-theme-quartz-dark .ag-mini-filter .ag-input-wrapper::before,\\n.ag-theme-quartz-dark .ag-filter-filter .ag-input-wrapper::before {\\n  opacity: 0.66;\\n  filter: invert(100%);\\n}\\n.ag-theme-quartz-dark .ag-chart-menu {\\n  background-color: color-mix(in srgb, rgba(24, 39, 50, 0.3), var(--ag-background-color) 30%);\\n}\\n.ag-theme-";
      S = S + 'quartz-dark .ag-text-field-input::-moz-placeholder {\\n  color: var(--ag-data-color);\\n  opacity: 0.8;\\n}\\n.ag-theme-quartz-dark .ag-text-field-input::placeholder {\\n  color: var(--ag-data-color);\\n  opacity: 0.8;\\n}\\n\',""]),t.A=d},4131:function(e,t,a){"use strict";var n=a(6758),o=a.n(n),r=a(935),i=a.n(r),s=a(62),l=a.n(s),c=new URL(a(8430),a.b),g=i()(o()),d=l()(c);g.push([e.id,\'@font-face {\\n  font-family: "agGridAlpine";\\n  src: url(\'+d+");\\n  font-weight: normal;\\n  font-style: normal;\\n}\\n",""]),t.A=g},679:function(e,t,a){"use strict";var n=a(6758),o=a.n(n),r=a(935),i=a.n(r),s=a(62),l=a.n(s),c=new URL(a(9377),a.b),g=i()(o()),d=l()(c);g.push([e.id,\'@font-face {\\n  font-family: "agGridBalham";\\n  src: url(\'+d+");\\n  font-weight: normal;\\n  font-style: normal;\\n}\\n",""]),t.A=g},4086:function(e,t,a){"use strict";var n=a(6758),o=a.n(n),r=a(935),i=a.n(r),s=a(62),l=a.n(s),c=new URL(a(7738),a.b),g=i()(o()),d=l()(c);g.push([e.id,\'@font-face {\\n  font-family: "agGridClassic";\\n  src: url(\'+d+");\\n  font-weight: normal;\\n  font-style: normal;\\n}\\n",""]),t.A=g},2249:function(e,t,a){"use strict";var n=a(6758),o=a.n(n),r=a(935),i=a.n(r),s=a(62),l=a.n(s),c=new URL(a(6055),a.b),g=i()(o()),d=l()(c);g.push([e.id,\'@font-face {\\n  font-family: "agGridMaterial";\\n  src: url(\'+d+");\\n  font-weight: normal;\\n  font-style: normal;\\n}\\n",""]),t.A=g},4011:function(e,t,a){"use strict";var n=a(6758),o=a.n(n),r=a(935),i=a.n(r),s=a(62),l=a.n(s),c=new URL(a(2006),a.b),g=i()(o()),d=l()(c);g.push([e.id,\'@font-face {\\n  font-family: "agGridQuartz";\\n  src: url(\'+d+");\\n  font-weight: normal;\\n  font-style: normal;\\n}\\n",""]),t.A=g},935:function(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var a="",n=void 0!==t[5];return t[4]&&(a+="@supports (".concat(t[4],") {")),t[2]&&(a+="@media ".concat(t[2]," {")),n&&(a+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),a+=e(t),n&&(a+="}"),t[2]&&(a+="}"),t[4]&&(a+="}"),a})).join("")},t.i=functi';
      S = S + 'on(e,a,n,o,r){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(n)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(i[l]=!0)}for(var c=0;c<e.length;c++){var g=[].concat(e[c]);n&&i[g[0]]||(void 0!==r&&(void 0===g[5]||(g[1]="@layer".concat(g[5].length>0?" ".concat(g[5]):""," {").concat(g[1],"}")),g[5]=r),a&&(g[2]?(g[1]="@media ".concat(g[2]," {").concat(g[1],"}"),g[2]=a):g[2]=a),o&&(g[4]?(g[1]="@supports (".concat(g[4],") {").concat(g[1],"}"),g[4]=o):g[4]="".concat(o)),t.push(g))}},t}},62:function(e){"use strict";e.exports=function(e,t){return t||(t={}),e?(e=String(e.__esModule?e.default:e),/^[\'"].*[\'"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["\'() \\t\\n]|(%20)/.test(e)||t.needQuotes?\'"\'.concat(e.replace(/"/g,\'\\\\"\').replace(/\\n/g,"\\\\n"),\'"\'):e):e}},6758:function(e){"use strict";e.exports=function(e){return e[1]}},1906:function(e,t,a){"use strict";a.r(t);var n=a(2591),o=a.n(n),r=a(1740),i=a.n(r),s=a(8128),l=a.n(s),c=a(855),g=a.n(c),d=a(3051),h=a.n(d),u=a(3656),p=a.n(u),m=a(8956),f={};f.styleTagTransform=p(),f.setAttributes=g(),f.insert=l().bind(null,"head"),f.domAPI=i(),f.insertStyleElement=h();o()(m.A,f);t.default=m.A&&m.A.locals?m.A.locals:void 0},9601:function(e,t,a){"use strict";a.r(t);var n=a(2591),o=a.n(n),r=a(1740),i=a.n(r),s=a(8128),l=a.n(s),c=a(855),g=a.n(c),d=a(3051),h=a.n(d),u=a(3656),p=a.n(u),m=a(8483),f={};f.styleTagTransform=p(),f.setAttributes=g(),f.insert=l().bind(null,"head"),f.domAPI=i(),f.insertStyleElement=h();o()(m.A,f);t.default=m.A&&m.A.locals?m.A.locals:void 0},7075:function(e,t,a){"use strict";a.r(t);var n=a(2591),o=a.n(n),r=a(1740),i=a.n(r),s=a(8128),l=a.n(s),c=a(855),g=a.n(c),d=a(3051),h=a.n(d),u=a(3656),p=a.n(u),m=a(7521),f={};f.styleTagTransform=p(),f.setAttributes=g(),f.insert=l().bind(null,"head"),f.domAPI=i(),f.insertStyleElement=h();o()(m.A,f);t.default=m.A&&m.A.locals?m.A.locals:void 0},8477:function(e,t,a){"use strict";a.r(t);var n=a(2591),o=a.n(n),r=a(1740),i=a.n(r),s=a(8128),l=a.n(s),c=a(855),g=a.n(c),d=a(3051),';
      S = S + 'h=a.n(d),u=a(3656),p=a.n(u),m=a(4991),f={};f.styleTagTransform=p(),f.setAttributes=g(),f.insert=l().bind(null,"head"),f.domAPI=i(),f.insertStyleElement=h();o()(m.A,f);t.default=m.A&&m.A.locals?m.A.locals:void 0},815:function(e,t,a){"use strict";a.r(t);var n=a(2591),o=a.n(n),r=a(1740),i=a.n(r),s=a(8128),l=a.n(s),c=a(855),g=a.n(c),d=a(3051),h=a.n(d),u=a(3656),p=a.n(u),m=a(2621),f={};f.styleTagTransform=p(),f.setAttributes=g(),f.insert=l().bind(null,"head"),f.domAPI=i(),f.insertStyleElement=h();o()(m.A,f);t.default=m.A&&m.A.locals?m.A.locals:void 0},6915:function(e,t,a){"use strict";a.r(t);var n=a(2591),o=a.n(n),r=a(1740),i=a.n(r),s=a(8128),l=a.n(s),c=a(855),g=a.n(c),d=a(3051),h=a.n(d),u=a(3656),p=a.n(u),m=a(8981),f={};f.styleTagTransform=p(),f.setAttributes=g(),f.insert=l().bind(null,"head"),f.domAPI=i(),f.insertStyleElement=h();o()(m.A,f);t.default=m.A&&m.A.locals?m.A.locals:void 0},897:function(e,t,a){"use strict";a.r(t);var n=a(2591),o=a.n(n),r=a(1740),i=a.n(r),s=a(8128),l=a.n(s),c=a(855),g=a.n(c),d=a(3051),h=a.n(d),u=a(3656),p=a.n(u),m=a(2935),f={};f.styleTagTransform=p(),f.setAttributes=g(),f.insert=l().bind(null,"head"),f.domAPI=i(),f.insertStyleElement=h();o()(m.A,f);t.default=m.A&&m.A.locals?m.A.locals:void 0},8525:function(e,t,a){"use strict";a.r(t);var n=a(2591),o=a.n(n),r=a(1740),i=a.n(r),s=a(8128),l=a.n(s),c=a(855),g=a.n(c),d=a(3051),h=a.n(d),u=a(3656),p=a.n(u),m=a(7899),f={};f.styleTagTransform=p(),f.setAttributes=g(),f.insert=l().bind(null,"head"),f.domAPI=i(),f.insertStyleElement=h();o()(m.A,f);t.default=m.A&&m.A.locals?m.A.locals:void 0},4255:function(e,t,a){"use strict";a.r(t);var n=a(2591),o=a.n(n),r=a(1740),i=a.n(r),s=a(8128),l=a.n(s),c=a(855),g=a.n(c),d=a(3051),h=a.n(d),u=a(3656),p=a.n(u),m=a(9561),f={};f.styleTagTransform=p(),f.setAttributes=g(),f.insert=l().bind(null,"head"),f.domAPI=i(),f.insertStyleElement=h();o()(m.A,f);t.default=m.A&&m.A.locals?m.A.locals:void 0},8349:function(e,t,a){"use strict";a.r(t);var n=a(2591),o=a.n(n),r=a(1740),i=a.n(';
      S = S + 'r),s=a(8128),l=a.n(s),c=a(855),g=a.n(c),d=a(3051),h=a.n(d),u=a(3656),p=a.n(u),m=a(4131),f={};f.styleTagTransform=p(),f.setAttributes=g(),f.insert=l().bind(null,"head"),f.domAPI=i(),f.insertStyleElement=h();o()(m.A,f);t.default=m.A&&m.A.locals?m.A.locals:void 0},2553:function(e,t,a){"use strict";a.r(t);var n=a(2591),o=a.n(n),r=a(1740),i=a.n(r),s=a(8128),l=a.n(s),c=a(855),g=a.n(c),d=a(3051),h=a.n(d),u=a(3656),p=a.n(u),m=a(679),f={};f.styleTagTransform=p(),f.setAttributes=g(),f.insert=l().bind(null,"head"),f.domAPI=i(),f.insertStyleElement=h();o()(m.A,f);t.default=m.A&&m.A.locals?m.A.locals:void 0},1184:function(e,t,a){"use strict";a.r(t);var n=a(2591),o=a.n(n),r=a(1740),i=a.n(r),s=a(8128),l=a.n(s),c=a(855),g=a.n(c),d=a(3051),h=a.n(d),u=a(3656),p=a.n(u),m=a(4086),f={};f.styleTagTransform=p(),f.setAttributes=g(),f.insert=l().bind(null,"head"),f.domAPI=i(),f.insertStyleElement=h();o()(m.A,f);t.default=m.A&&m.A.locals?m.A.locals:void 0},1683:function(e,t,a){"use strict";a.r(t);var n=a(2591),o=a.n(n),r=a(1740),i=a.n(r),s=a(8128),l=a.n(s),c=a(855),g=a.n(c),d=a(3051),h=a.n(d),u=a(3656),p=a.n(u),m=a(2249),f={};f.styleTagTransform=p(),f.setAttributes=g(),f.insert=l().bind(null,"head"),f.domAPI=i(),f.insertStyleElement=h();o()(m.A,f);t.default=m.A&&m.A.locals?m.A.locals:void 0},1145:function(e,t,a){"use strict";a.r(t);var n=a(2591),o=a.n(n),r=a(1740),i=a.n(r),s=a(8128),l=a.n(s),c=a(855),g=a.n(c),d=a(3051),h=a.n(d),u=a(3656),p=a.n(u),m=a(4011),f={};f.styleTagTransform=p(),f.setAttributes=g(),f.insert=l().bind(null,"head"),f.domAPI=i(),f.insertStyleElement=h();o()(m.A,f);t.default=m.A&&m.A.locals?m.A.locals:void 0},2591:function(e){"use strict";var t=[];function a(e){for(var a=-1,n=0;n<t.length;n++)if(t[n].identifier===e){a=n;break}return a}function n(e,n){for(var r={},i=[],s=0;s<e.length;s++){var l=e[s],c=n.base?l[0]+n.base:l[0],g=r[c]||0,d="".concat(c," ").concat(g);r[c]=g+1;var h=a(d),u={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==h)t[h].references++,t';
      S = S + '[h].updater(u);else{var p=o(u,n);n.byIndex=s,t.splice(s,0,{identifier:d,updater:p,references:1})}i.push(d)}return i}function o(e,t){var a=t.domAPI(t);a.update(e);return function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;a.update(e=t)}else a.remove()}}e.exports=function(e,o){var r=n(e=e||[],o=o||{});return function(e){e=e||[];for(var i=0;i<r.length;i++){var s=a(r[i]);t[s].references--}for(var l=n(e,o),c=0;c<r.length;c++){var g=a(r[c]);0===t[g].references&&(t[g].updater(),t.splice(g,1))}r=l}}},8128:function(e){"use strict";var t={};e.exports=function(e,a){var n=function(e){if(void 0===t[e]){var a=document.querySelector(e);if(window.HTMLIFrameElement&&a instanceof window.HTMLIFrameElement)try{a=a.contentDocument.head}catch(e){a=null}t[e]=a}return t[e]}(e);if(!n)throw new Error("Couldn\'t find a style target. This probably means that the value for the \'insert\' parameter is invalid.");n.appendChild(a)}},3051:function(e){"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},855:function(e,t,a){"use strict";e.exports=function(e){var t=a.nc;t&&e.setAttribute("nonce",t)}},1740:function(e){"use strict";e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(a){!function(e,t,a){var n="";a.supports&&(n+="@supports (".concat(a.supports,") {")),a.media&&(n+="@media ".concat(a.media," {"));var o=void 0!==a.layer;o&&(n+="@layer".concat(a.layer.length>0?" ".concat(a.layer):""," {")),n+=a.css,o&&(n+="}"),a.media&&(n+="}"),a.supports&&(n+="}");var r=a.sourceMap;r&&"undefined"!=typeof btoa&&(n+="\\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),t.styleTagTransform(n,e,t.options)}(t,e,a)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.pare';
      S = S + 'ntNode.removeChild(e)}(t)}}}},3656:function(e){"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},6387:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=a(5608),o=a(7886),r=a(3423),i=a(9209),s=a(9773);a(1906),a(9601),a(7075),a(8477),a(815),a(6915),a(897),a(8525),a(4255),a(8349),a(2553),a(1184),a(1683),a(1145),r.ModuleRegistry.__registerModules([r.CommunityFeaturesModule,o.ClientSideRowModelModule,s.InfiniteRowModelModule,i.CsvExportModule],!1,void 0),n.__exportStar(a(3423),t),n.__exportStar(a(7886),t),n.__exportStar(a(9209),t),n.__exportStar(a(9773),t)},6055:function(e){"use strict";e.exports="data:font/woff2;charset=utf-8;base64,d09GMgABAAAAABFoAAsAAAAAJkgAABEYAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHIlWBmAAi34KpXCfVQE2AiQDgjgLgR4ABCAFhF4HhS8bxyFFJCOtoY6iYlKLqKCkZP8fEsghg77xKkhaKGEaKwO6lrY1b6YxxKUASMSl4yPDHPYi3fdu5d7Kbyt/D7IwsJrgsEOSoklQjLW9F0MTJZloool4ZIiE5jESEkOm+Y9zva9J2iPCtkn5CP82BQzCslEzenpGo3H/f2ibX7ASC3CC3NngEivpEQsOIwpWEdyKBWcsq26Fe49b3PJQZ96ZEt9JdgpIe5phJkHoAcugxVrltchzh61rR6AGJKAwOOmWsCZ3P9Vt6tS1P0wVC9REYIX14V1qYpH9qflReps9LPYlGfP23PRL3XUgMAmWeEL4SgRkAEDYvHO9dhkBqnmXpDlI0x5wf+5Y9XN/Rx0gy6kvR9j2PqwDRGOA3d7snCFhJiXx//QXQ9lnn3hR1u4csqjxACBAiT03VdHjEVrYjiUjwOGyN1M6c6rPjJCGzZexSaiPAhujUVH27FsRQEGfAQ0OTy7y7i2fHUgiwpYBbieNve3NZfbtMNLTOdivLbXHq+i8136FN86iPVGPafw6OT/5NxmnSZhdXhfHRWrPT0ZJRIxCpUEEcjOmSmfA3GBGyoLi+GjxtY0YQqbYJCvWtFXhJ1qmmHZhZo1hh+qCat9ub5Wv9/5pangKyQRDOGX1aUIctqgFg0VkbI0fZDe3IV7cErUUwJszUZYwPBrP1/atXdbFZfRQVg71DCVb3WfiFnW17hF6k0VlpM30OGKnV21Qmg5CYZoWs0tTYVoVsyCyZjbTi7sQ1ByTR3K8PErgVaU557a3WlxWM9iioCR/0JgtxpbJttQ0D17VQu0xbfZGv7YxZs+QseysJIY6QrRrrtctae2p7zqd8Obdp38Ol2MTNWkOv2lqRjUv1tbtgiPB2m9Gdp5aEvhHzKW3zMFNLVeFbGFTVD0lc3HSMzKR+YJlS062scXWVjQGQqgDsvSUN+OESMZ46nU0g8GNqlt8y1vTZTs+uAKLEU5JdUPppKRCVY0kBV+Tt8gSxeMG9skkRWcoN+a/zw3mNVkkznPXb/Gpoww70ZxSOvWAytlcoT1qPQKovK4fzgw/DXiNG7LJ8S1+sf3H9dlprDdWgSGbFyxrklif';
      S = S + "kTIZtfu84QSpIv7Nc6qcmO0qtvcAgXt5CU6nRwRhkdxla9lZdDST51ZwvMRvD8YWQG+yLK0q71L2SOIhvnMCiZvEEeD+8u3HB9QFAgl8UriM2Y2hNT9VfTH8H1hK5Xy3zeHSKoA0kAQqgRRIVPQXohzwdVklzBl7OMRvFLNDiI4Hnvv4xU5PUeWGR15+cffcQQnuVp9WJYGl4DPmJ4DtP5mjKaYsTKsmUgy6dj66ua0DDoIRPKG5WDsHJxc3Dy8fv4CgUGnb71ExcQk/gClpGVk5LnkFRSVlQRVVNXUNTS1tHS5dPX2Y38DQyBhERrh5yLemAXNJ99JEgWnvSKf6vv9/N1vvuubbKV7FgJr5hHmg6nRDwPKagJUNAKvrAdY2DKyvFdjYJLC5ZmBrfcD22oHd9QN76wX2NwIcrBM4XAdwtDHgZC3A6bqBs7UB5xsFLjYBXK4LuNogcL1x4OaaAl9cLiEBC0TgBUGwCXbBITgFl+AWPIJX8Al+ISAEhZAQFiJCVIgJcSEhJIWUkBYyQlbICXmHIvBVyGNFoSSUhYpQ9eSqJn3qQkNoCi2hLXSErtAT+g5F4GuQcYbCSBg7JMGXeCgHX1LmkwUqMEYpBUyfn+QRuAXpQ5B9FVJx5yqKfAsz1FJ8wLhfhpSA78H3ySFNT7aO18k5ieFtls9iuDZHS2b44//lC2stKBqhd77BnZSsF9afpeMWYZ7lLSLWYDpGd6R5Bfc5bmscF9ohKR8qkEMbvIEky5J8A1kfb7YxbPDITY5mIvoSm5XZZEtEKpcXecwssiRbS3YGxBqijLb4s3ECFuZBorBGXmJko1gRKo18zQABgyEgbWnSsxHHerDqQh2uzhIinVWRdZYFetyWrlF9awba9tQcR3S+2YQsA7lWuLDDrdp9hWs+Xd7nG37vbX7V6nO69BCbCyxd1rJNrnNqtauXV8ZW60dxEfYG+FX/eV9si22DSDMEKIBAqxYY5wM6wiA66aWuVj3rRPjh4lTqMFf9Qtm9WOr/mkUqXV8ZCaMeGPdEoAnzFhgon/ss4f2G1M/irR48s1hZIhEQQjGbzcV7//Y5rE83OSZFT7B1grDDcUbV9VTzClVD0sYJCAX6CqWOb7VqsF7nvS2UEOrckrfXiwej1lbmOq5EOJoWn/85UPvXEJF9msh31moSd2Uy1at6gpCwsY+gdUnDPC4Hvb8GJVOdciVfq5fSRWN4KaKd93df4eOmuv3kuhDVfQEJi/r7Hn2KiBi3dI/EFJnuyjRojV7GSWFYR5ORuGl7EFgNp6gOPdZZDSihBAGWMQBCjPdzNeqgPZh7b+4ohZciw2CNCNFfcZn5lgueFRlJPwLhK4Ve3xKNHDAIAqXmv6ifJcHOQVA+ky+dVUms/hoQ9J8VqA++Xs9YTUiF8TicbEibp+r5trx11gWRVqHE6xetcsvYga9nlSNyBZSXSyxuyWrnBdA5EGjr112fzVwWUyMb8vvvcO4oh4yUtha2v7wyMHLi77+5WhcwrggRytedVqwsEQArva1uPohcGGOe0ntWKwbSygChMrZXZ6uRh2zRkAJXQmEhiOh44WatBIESFDFYlJ/37RPq9tEJYU1Kl69oT6DGc5eE00hZojenMppGF2zz8rqAqKNSRInJ6wOGlEEin1Md27Ry+KiqhmPo2aPOEN72mqGdFct9QDsgTpMEfE5EcrHbaxvxrK42wEvtflXHotUIOcAydySwfu4NXiEzNB9gCoaoQhe0k4YOGNkzK8+0s1zqagFS9c65qLgcXdumxPMWvvlAx3xJ23tKn7NG0OjmVM715/aseO9Kjdh7x8UAcEnvnaG1P0Wab+rvGE6fBv3+d6E2qbbzg7vuB0hsYnOafwH3AAHdN9bFUPHGBS6FP/lf/ZV+hFBZog8NaJb29H2LdC7PF4bHOYOOt1AZoqUCXFF9Bbq/zqb03jRHG1Djwm9cN4SDZTxhNJ5kMWNiWGKUD/RQMkYk5K8JCDtOkr+x3+/J";
      S = S + "To0G+JJlg8qTShMSSpPKXwkmUJowS381g0iYly0lNTu+ZeIu4Xr9OPO4D4qhyqEkPezXMEhcQrrz4m7x3Hm34njo3RGg7oGBWu35c1arVlevzhWKTKLywCj33VZPi7HWHD6etFjwykoGIz3tPM/5/Lnz29O3bJn30cBBQAYIB/s0Dwic6BBtdoHVh4VBmsZsnQDrqIVUgyVf8KPHeP44TYOQeYxCAVFgCmrswMsIoAoEkMAJUaAgwC8rLkOvyU87STane16QcOt9Xc0w4yTpToeouqheUbVRCc5/UzZz942Q18NHznK44xqd5fvIwWi55zk/9FaAb12vX+ukgciZYUz/4NRIlttar1FpQ/v4BO/uHXaoJiwvjzPee80Obw47MCjU+xLF8pjnPbre9MnTL5flbQn+lrABuge8CmKNdRwRuM6rIUX3ksfycitszwkK2nSOtTp1XuyhmMPsWAgc5TFc4+7EFt9mt67wOVDC7n21u6v7OtYgENm9Dh+yPXrET4p2NnvyYSc+cKV9YuzhwjnP/UCIgLNIsshN4rYQ4c5WMT6HiyQ/S7KQg3APqFSPHpXyQexHXUQLZV88t1vn80f2bZzX3Dco08cP+ZFakFmw9iZ2xtWnh6efRtusH3lsKWseO4Adnzc+d1T8DCdXnzAfFszbdZzgoiP2EmGJb/UTCRIlaK/RaPJ71/VX8GS8hpYQeTNWYdJqpJMldQ5mnURqchMkjJfUXJUiUeH/5LIcjlIKNF5FRFn/zMKiyX2mzrgcHRY/D+zveoCELpfxFDxLpkc3ebcp+i0VqYRCVb5g/PliWiGDe3G1ePVFsXduYKEJPYFa9Da9CaUwCr6Ljx+j2Ana4ZIdozAQswbhetxMuHmQa4LO76naArWmIBPx9CIvpYytQiMrNRmfthprMvB1V3tphKHh/SbJDg2lHQf+uLDBjnJ3oUQ/IrksMbF0sGBocqoIuovb4azDdMOtRiZWHtugbdkgUxCOqq7R6WqqF5oWXvi2qa6Ze66iZmpxVpZtAS63m2x6G4ylPXWcDbPd2EUN0NcpPZVHhK5PB7+ghQvlgXK1Ry1FIo1QrRZqREXJdej6W7e4aJ3GP/InVzlBrylN28/87f/3zjYEkFWOrAw04X4z0BkIPp74i3IVNs4yDoPC+Nmza3VNz54LhU+fdo08bMC6ujDD4ZFdT0Hsm4TzRaf4N3NKxBcJVgCxNvapR6YdCd1q66pF9nUOd+8SbcSn7rX/u+ZM8NPcem2g9Rnx7KmVou0zJ2uLI/MjZs+OyI8sviKYwOzZ320XR14pMXeumtpSnFAgFhckFD8aOLUXiIsTHuWmBPsX6eCcnMEzG7Z/pvjtJPQ4Bb4ku+PqFS6lGaHXJCpcGa4P37PacE1IUxN+nXnxp3QJBmhRzKHotN9uDtoOnXNeLQO3bOl4T9rtZrgeqsSUsGvesXtrsINmSTh9+vyzQ0UJUvxKSkZFWrL1qRXWYr3eVdE0aeIKRX1W8ll7Lajgfo7dYOBjg0tLlEqC6HPgIHjeDsEzVxIaPHToykwCZo5UJZmA3b5NFlBuml8Y2AkEpHwdAlpcEygbbJOsBrkJk+89kHFgHyYzGWTEJE5GtKw/mhhSI4dPrMoezDy4NxBGuXUiOz3a0B+jDRhg7IT//+n/P4GZIBszBwAA74QQyDlp77IWsJcNAW8xklld1w8tYNg2m8g8LjPO6R9mK/OzN25mk52tzNNlywIGGUhNJIp+1HXLYQzaSinTHbuhtWOcldxJADdxThVb2OBm2rMrcjPUbWcxM3bZpaIfOssokUrG8ASusgKuYnpizmbwcMrGWDDGkk1juWgUKVWDTtd/py/y401kaZlP2jdXDyYJwBW6vT42kaDD1YxM2SH6wnf97fN4c/lP7PpLgGt+GZzvnzPuwPG14EZVBABOshrAf/KUH84d6hQHhbQKgKCRIhbFQt6AAWmxbwQPDGeoUNaiPcIJx6Dv6V2wDoYBE9DRDRC2";
      S = S + 'w0w8IoICPtEYt9hFE9zi2ogUNsJHb4YODjCCwCZE+uuDCuLlcanJf0MjTZh/U2wZp3NJvYn/pDUJd6/DS6G6JCZdPk7frbZdneObWeiCytR9CBvlLF1R+SRnw2hW3heLMD+Pwcm0h6IllXjfaDdDKsp+EyVqYvuRSs13OftPacXvumCdV4MXabBknCZlWq+zsvW01Sx6W3YxQRsoMQn2oRhL0sypLFkpVz8RR/lg7KAW7xZ8aUGWD5wScmvvAAXs5NOBMMYEU8ywgU3Mv+W4QPnz/WdsBYKhcCQaiyeSqXQmm8sXiqVypVqrN5qtdqfb6w+Go7EoyZQpqqYbpmViamZuYWllbWNrZ+/g6KQL0TEqRbQkfIyqsq4HWN2xQ3aUj9yIarfWk/tayaYPM+SfM2dJ7MlIp8RodF8UbSxlvHSSRfuSEm305D62ieu5EzZFZ+QPnZTtkVOp9cDV+cA1O/RU3RFthvaeOlhQuaU/oy31NWMdD0TuOKQ8oPcoTlrtMGoqR1GllcNKCzvMFOw4Jx75fE+yoE8cTyfcpCnt6HAibqdASeo4LEwXLNZjzrJG8Ki0DtABjHxU0ix2q8s3I/2qmQn3EsJNxomPNMXRDivOdF4nBRW9lzVHWAvpAgtNpNMFgkhtX9Ryb0p06NhZdkIpxKeNwWsOS271qApaPIWNQCIVCpnt0IupgBBBgcAggQDDGio4yDDCF6xgA/0aTNCgwBZmCLDbAw=="},8430:function(e){"use strict";e.exports="data:font/woff2;charset=utf-8;base64,d09GMgABAAAAABMUAAsAAAAAKMwAABLCAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHIlWBmAAi34KqmyjKwE2AiQDgkALgSIABCAFhEYHhUEbnyMzg/aatGqziOpJNvu/JGhLhnjjdVVKiQVRRpQIMYb+arBrcnXzpDWxiZ/03+6d7uYA0kgNGvfxjeHHsZxySFI0efhYa+/v7iGeriQ0iXmiiXjIROjWyEwnREJiiNL8r7ned9lNjoj/UviIZqqAwagvZXWN7vQH2uY/PCuxGixE3Zco9c7GTcI4jGiM5Ixl6zZYJOu4deqq/4JF6qJ74B9A4MjcdjWnBf6vzeoX1p0qiEwH0j3ielqTJCVtAmTUucAVrqMqJHm7J9HDZROQwmB/an6zL7XMHhb7kozZWv+/7xgEJkGCJ4SvEGy5v2EaHaSESvAJKgL+b+1f7X9BlMATAqHj4/Ts7Pz/9965+zA0mU+02dBmQ5sfphJYIEX8Xjanfa8cAFStrQKWdRW+vpqEqbN1cToVOJ6CtsfmMoLfUD/X9o81JEiwSx5ix9/Y/D1YFRZgNHb89HY+AigxopP6BiQ4BLYXmusgA7t/bICvlWN7o7wQXGc5eKRfcJ1eti2g4qav/kYgjmNd0tLkOJ2Z/s9UagziUjLg4EUfjozhKEJQaXQSBRvG1xhMyJishB+RIifj9w6SMEZ1KBbXsdcUQmxLtN9Y2RPEjbehOT882Zbg6JXTtclU1IKAeRSMqKLcjrgNk40wT889wmXtgNBtcVthsjULZ4tB2WK6N7J190VFqlzEbaj5YYFjdj8VOa0t8WaELTaNWbZ2zJ36dM0BpxvCVJZlmP07Ku01wgZhT+xoxJdg3JpQhms8MU4R0KC64anv+rx2E9QmUFl/ortRSm2LPVbXu/6mNu5MGHAN4b2DK64KlaiuEGXqwIjTcKY+GVvvXXv07MWrT/8ARxGnhMUgqnrxK5p1WI/vEslM7FNW4qVzW4pQxmZGfTcfLa5FzMYh1DDHeHmEBYawVuhveThz4/Z2dCZM6QPZepCtu0Awgr9fxzGZfEA7NUeBnvZPglAHxmEeGS0TuaKyQz0dlSU+5CaqdHjGJPZMGbqSalOhn8ZkfcgmGZmvf+NtZ3kuxJoanXfBFT1apf/pNpfg7r5/jDDbG8TMmArFxZdY2Ru';
      S = S + "nTLjo7A1bhEgOKxy/44qp4TPcaX8TBaqr5I03XL2wOnWsmcJR+qYaVC4sUcTEa3fttqtEtmJTFzkEkKOHEg0IW2xbu847njOcPMS1HEguk4O4evv+401DJCAhp+5PaGo1rgT+qPli3jGfRZOPcxsxeZA4fApUAxlI8uONUTX04VdDPKlrg/1DGRcJ1vfKR7+/mgs1Hnnj81f8qLjXwfcQzmm4Aq0wK9YeoM575jiqJZvSu0mGAXtHYlg7unCQIJhMGY7Vxc3Dy8cvICgkLCIabTAhKSXtT4BZOXkFRSVlFVU1dQ1NLW0dXT19A0MlI2MTSMjUzNwViAL3M3lQqcZ+K0F0pgsVlj2jUW27//+7xP6ErY9y4JcBemZdmAFqntggsMAagUXWDyyxbmCZDQErrAVYZRPAGmsC1lkvsMHagC3WB2yzHmCHDQO7rAPYY+3APhsFDlkzcMS6gGPWCpywEeCUjQNnrBM4ZwPABRsDLkdPgi8AvREIIQhCMIQQCKEQwiCEQ4iAEAkhCkI0hBgIsRDiIMRDSICQCCEJQjKEFAipENIgpEPIgJAJIQtCNoQcCLkQ8iDkQyiAUAihCEIxhBIIpRDKIJRDqIBQCaEKQjWEGgi1EOog1LM3nQboL40QmiA0m0QKvha7bbRCebRBaIfQAWjE1KT6Mbe4oaAEFD15V8c1Npu8CiuJ+AgmZ+ibQWlcWmSAxALcWmEZSyAXGzLeJkSCSHP7vut0TVNSh01dwfysllW0nFagpJbIKHpGxmNm9hthJGqxHh2r9a1LpXoZteJbRCtpSsJSTEsukVAcjaubhmElaof2qUe+BlVN1Giq1mAaAZwEyNjKPVCn9M/ombCZRJqctqcDmwMD6YIbHZTN5WLZAkbni25GeSMT81p3zBduRVryQiIyK7q2F9KY/XxW7heJar+AV/4A237mtCB4kYk89YiCOQFcIhL20uGLC5C//SXJRK8vo5pgx6uNrmAl9nqbrUmU8rR0zekKrHF/ZrbTLBjbkj1RfwZ8jD6jIGTXaC+ppjqxRFrkNJGP9hy7FDGeHl4FhagGY/X+NWKIFlCDQdymq8aSUjqFqWvzkiu8bbxidd5BC5FI3fF2jDbWGGyHuZOQtm5/x4kTONSe2rVrHwpWnb9Nov1nwZZwm7XrFA63gb0no9N9tm+PtjL/zA0c+m27WJbiO3duJdFGFKiPWcdOnQvOn15mzcmdkfJv2xWeAFu3msOOmlv/ywgmtudQ7OBWH57bsiXY22Zxy0oiunOJu23/6avmojw/8UbZj+OwUkFBDKcnL4LlKINqlUTcrvDGGf/szej2+eDcraXhh5YpEnwqsZbt+05dyXoFKq+nwn92ShXNCF6yaHCcROsbmMjVyCpwAIykbGupvSPhMYsX7aOP4HADCurdUp6yJYUFrFqsL8zM7IV47ry5hRjHlQq3cper7EY8sVz1JEovtIkocwPG87er0DaWVUVFTeGaqMp0HFOhdHeVMhkVV0tzq8tXBfsy//f1KNCUo9RSBsUQa7goUOYSCQuMCJP3Zbl1eg901ANJ1JRAwAFWOYEiMGh9B6P5mSBGbmFdFGynyI2W4PF7ElIWwub1lx8hNmUO1YOBRJcelh+8wWAXdQFOYZnMheiyn3mxR0fGUhmEAcuc0OnNoWUCwy9APEPC6JLB3qh3kZxqcakMAz8X5/svbeB0nmCM8gVMTMCsHehWTxx6nn2v4oSV+aW7ZfBDrePhfZfDN33xNOiUOjI9Wu+fCE8FpxclVQIGIiWe206+Due/uv6F2Dfh9JzjOWfkmZE3plNza8PBsWdmDuV0/pIj2R1mA3029clIJ3d6wO7BvYW5lWx1PN6He1fL5X6/NO6J46m/dV+rVPr/2rK/Wp3xZ1dSKYvrnwdUl/rm3o/ThqFSdj1Ba/Tqqdhcb67xvOzTGc/HnB6w3B9EEI8HEiTC8ENfShDpAdJ/36fp3UfwVDATzzCQDf0hai8P8iAP1iG7MWw";
      S = S + "He49R29iVpyW9Jvtm//FoVsNrHYxLzl1zj65MQXIJUXDHTCplOz0lt6XklEpsrSs6PLMb6BSjDSNiDdgbT82/rqLjG1PMyGr2IobBMyLY+X4EAyY1FNd7H4onDuKwRiWMHcCARyf3nsBnvo5KE1xM9KRgXZq0hw+FgIGlhoMR4oeQzvBT8Dn66H9YSWzWsLV9s7jHRfgE/EbI/8Ej2I93AzqCDlA9AK8XIc7u5PFcBFOLkAMDS9PTM9JhLmbk04cZURi0w2qd7hf+66VugwSKgGdMv7JAkMfj5QkKnobP8+fxCgRPHXzPW9Q/37AIkv38NMC12IJgEeQP4ifR2kq0EcCfpzP1CB70OLWDwR7ww/Gmm9rbS6VnTq9ZI5UFe9OZQQ1B3ukO03qi/5bXB+aH18eWL1cXFenpRYSf8ZmdOX1ma8SmTTNeK5xpEAc0Z/zNDGBd/alkK3erypElW5WytjZwbAoWVH/+gx9HCEzk8AgdaGJcPKJKuUADupgGNFpHE9PBedUXxBdgmJuRGR2dKetggTA4nAwcEfAGX5aXttT3xW6n+Jf7h/qX+fPke2vc5J1XXf9vbZ9CuW4cEGl9l1K//Kb5TPdBO+vy0J/LYu1pJ1sQW8cwP6rJUouO8Ga2leNOlteBUq/0dOduyyXbLJ2d7B3cLc+PUM1mWHZWNLwxt0mjWi53/MJbCSF2Tx2oKv02+2UWlSLZEw+qhUnWumgHh9WnqYvDZgQeYJBOgWDfYdYqMTVw4gw51S2w2pfrxLoUYmy6jKqEzebc7sO8W6mXh6IiGWxFKEtRln4KVtmHhyrYaGRhe26Tf7YX2+mU4QwUoWw/9+WJLucWczXnuPs13MX7EYp/m7xNhgMG5WFjfnJSewnFh4FjMzKGtkvD3L7BMxntY6pm1IxxwKxsaN/CMrHMpdfwk8ZWo8xtJNKa1PbD86kznOycuOndaR3cSQbGVl5WVGgg+ZUTvO++r47jqoukWKwIyE/TxDR1uskZgbyYnOOXyNIcVnUaaGKbOlzlImGitKTA+GJMSqhzZEFRLy8hOYG+fimXmcBgxDO5pkb5bexUo6AYZ4vFUhE9yymyUKBtBiBO4uEPv+XJmZWmgiLnyPjrip65yps6NTGb8zyI4WYOucqFEzWBqfHwSSm4Bt6OItctPkBmdBu2NRm9W6u/W3znLnzlHDls3FCbwPlhfASHOb0+gZIqjMAOqPgDsVDnDCKsDIooUQHKJzEWptpNYETVo8QPFQtuacUEmOqHGXb71sLHHTli235ZDtXjl063vvdgfVcWhZXDdJcddK1cK8zn8/MawweElsPRd7jQ1zNkuKx1za4W4gLD9MxX5gEXCUcy2ffr1zJhoDJdWWY4R8LZmZjNabLmXvN8MuyroYrDbrStLeMBhRIVRaE8MBqy/fTKvF/oPrCuCZWoklBi8rNRJaC78aN5225GCoBjavCGP+/x1wv48Mz9Y3fy5FzmBH27rG6nemh5dpCEmZjIlARlC8vpKwYHXejlEltICf1KQei46i3X/yT9ObmVBjSNTAk0EG8ziT6JBl9+zrsEDU4sJ3BIIubMMXYRyaadUeuqigpmrwtHPW67uyfufhofX15ioO/kI5Kfrurv//9/8tnMUbN2EF80mtxGqqmzc0uxg1GTzfz+pnlmj286fhoaglDb9Q2xDEasEeJmx4j8hQa2B8R5BTt+CfnvDd4Ze7Opxu++XbSxorK9P3btt1xI4ngqTk5uCGDExwUqmyeT5iuEk4s+chzm3jDhuccbqbo7D8FofaIH/c5JbNGHvE4MO9il6qTE/mh3vW3C2aqew6oGcXcPbP60YUXV6//8adz8urIcvwzfqVN9M/xyLoZPeurU+4lz/C565DcsHl+bw8vkcDJ5OXfF9fyZnBzeXcfqMPwutjE6unEyOVOT+X8u5kc+jZ4xUeuXsvKJUAvPdIOnmFvGNmyb4B3KQuGZ2lLqemDsRLRBliB5lnsm8Ti6Spdv36K";
      S = S + 'jRUIPj6goIKOUeUr4tHlcZtT8VqqGEycmUYwZL1Z9UYQWhgvnzK8JWJOTmmosru7rXSCuiBROt9PwvhU9rFB44o15uQkJWi17334wH3JVYwu1Gd7cvBDT8tnEsljHw4eG0DaKtfuJw3C/f5mMzPX7wbsMnxaIVr7vW6OIb8Djd+9D9+3B4xoUcdo+ZzQgLglliur21l6/uv3Y/t3DEY1f0+sUEaBIwvEHKEDV86+/PX/hvdTfI8H/fqEb8m4cgE20TZ1+lAcpS6tpR0rACZbtRdvoIL3IEWc22wH0G6lD3qJHLUPupbURVMZxp6VZQd1qGPjt791g2KxXZdkyeqdw1T/kYxszbYM3jeNchQ3ulriPeY5Y12m2mjIbFdIFzhZvIlqZh5Eg1TAA0dPwvg+C0AqvZmsQ27zdGORuyWvX6jzLUXOUVJC/L7O75APlycErPsjuSM39f5PI/wGg5sSf93y0cf9U14K0beNCvem/gM1t/pdv/YhgcZT0X4L81ycKtSDt2zC32xwwPgjgI0h12mmkkIA0tAQ1Jwkgc7cOEkrnAUwFAmOYBjpMB+zhRsOnE6hTSwakJABBvd4dkyAJO0B+dNaCAp0PMxUsN0GDzm8ZBh7Kb0ZgeDQva7gn9uYmJE/wG1wJiu2boG/zHzj7SM1ld+F2ek9AwErANP2iyaO7ErGN5YjNY6R1QiHEJnH8Ai3dIJKup1OLz7jTEVcU5wnzjBtB4hHwG5xeuSJQWGCrkP4PjpDhhxaRxqXOhWDiSVCRBwgEjUZvoUazkXNFiLYa2WMRcvWYqhCEQCDeVfL2vgCNTWeI4SXXpmR3VtR0dCpyLiujaovvj5+KtUgji1wURGEURfHfW2t7xN78uHdWCaIkK6qmG6ZlO67nB2EUJ2mWF2VVN23XD+M0L+u2H+d1P+/3c+PWnXsPHj159uLVm3cfPv3w06+1E4djcEp8pIkajrO8rrae6CANodanYjnsMOjvPs5bVgvm3PY5ngwIMHpSAsduswsJRXd1h8ht8qbuvHEFC1Le1k3CSguYSnda1Hpizut6j+v6lcpk1jV8WTubnUkq9YJmC35oc1B5WOf1E1shw7y1Lc5SufGpPvWxpMrXEQTTyiQU5XykG6GV8eQ2MeYe/RIqTCqbJZWWI6WcS0VNsEMtrQohzsDUKYUjhPVUVKcao2ymgdHHkg85oe8mtn0RidRGaw9spajmcoNUOUbYzvdjUWvijHRRJNoBOwxt3qwSgzTM8xwLA7Sk2rIvHxPQZnnqEqjSVXLtxxs3a2EV10pDp0j97k5eVRwGhBeRmUwLBt96c+0fKpKFkbVcKwAA"},7738:function(e){"use strict";e.exports="data:font/woff2;charset=utf-8;base64,d09GMgABAAAAABNoAAsAAAAAKoQAABMVAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHIlWBmAAi34KriymRAE2AiQDgjwLgSAABCAFhFIHhTUbNCUzknRW7aMozZsi+78ccEMm/EOtKgRDQSEYBAs2sTnBtoyyhWXQ7ZzDpZ2n2EhQikvgUQwtXY2+7tuK6T8uk/t2KCUBtd/r3t37P4AqPh4YJzKOuW10gYWsRiFRV1WoTnUdq8D/zgX+NGn5CKjXlI9whCjkHLGasKw3YWYZ1N4QB7cDUCCWeQZFWbhmOy3PFlCp1ngMFPlJAsfm9IM234AEFAb/V2dKgUUKFGIXiST9IwgU2Yv9Xid7jR044DZQAJ7u2HBEmzbhmkb07tDWacq9GHidkHJQwl0EiwmBmpOaQ1UgQm2TklRF/r1Ojbf9qfnXXPJbmz0s9iUZs6X/1ndOCI4ESzwhfIVgy/0N0+ggJVSCT1ARcKRTVzsl4mHsuv1LtvPXtxwDvVllhVVk2EgKK6ykQLR246k8LR3mZt4Kz/f3Jn8LQW46cRDe9vPOTjjzJhTa0jlVqACHQtHMUrBUDklDD3';
      S = S + "sgdc3bzJ9uFIMiBMiceULHDuuBKsU8xhCGMSKoHfNWBKBYn40ZWR8vBe/eTY/eD0mE2DiAxbhh7647bgLhyoVU1A+Ea8vuBa+iKz3qi3jRo+g1U8cafhS/xD9kqXUETJDXhcimgT4NNaXSGUwWBkeb9WiyOXDQ4UqSguJYaeY7ezGExrA3llnTXo2famNi8rWlHZ3+IK2ZTsGW1vkq75+lgWWYmtMRkqw+U4jogFpzzKicy5sPEqzsqSwb1EYAa8VFzYRhZUocyrauTWjQyhRqzVAfXUdptkWqXkY7ZIXRXTMmx2y0RZQVbdqjLD2EwbVwZoOm4uQm3ZpqplnJzjyPoFZ0BcTGgiiOV5XpYrd6vE1hqzGd1w6t21+1TsnyxthlS/v+qzPUia5LmC3u7E0IFmbdurumHE2E6jj7qCJp634veeuLb7776T+CCoEXNZ8lq66/ZFo562pBULHa7bmSm1MbHL/COZUDkcJ010iztnfqIqWRSSzqNCq3xcGGhFddtrNlcRDcOKgPfYfl6JxKo/OM1w0Oh6JjXpYD75geHPngEbiMkCTVDaWN1kdozzKVIuX1PuaE84pDPzLrTs+MbdlfLA43rw9SYSnjd/ncWYZAtWK4rndG5bhosEorYxXt7sZP0Y2OhjQvjqzxtEit3R43ILDMejbCGPsWc9NRnSoDDXU83pKBgxK294WqGM7HEVuGiCsHjjJsLrVQwiK2d2fDnqPKWdMdIV7q2SPrA7DomtnYjrznnJD4NnoJciBeMh+A5+nvhx8aAwMQsQnEixY2VrfC52p/0fQTlrIhkM5zp3heFZADElADZCBWVR+GSsD5oAYmyT6H+A6lBAyi4y4PevoXvb1FrZvc4+FfqNAU+4ESLKZVqWAoypJ7BOTTkbnBsDCTrdFUd0Znx0NsKwdnCAMjWNzsqQKRRKbw8PLxCwgKuXY2KiYuwR/AlLSMrJy8gqKSsoqqmrqGppa2jq6ejr6WAcxvaGRsAkIexC6Pua9txN3Q03RuwGJwa5nb/f/367ujvTqcgUEpYMwchUWgNooxYDnagJUYAVZjAFiLcWA9OoGNmAU2ox3YiiFgO7qB3RgG9mIQ2I8J4CB6gcPoAY5iCjiJDuA0+oGz6ALOYxK4iBngTvQBd2MUuBfTwOXqHPiFkMoAxAAJQBYgB5AHKAAUAUoAZYAKQA9AL0AfQD/AAMAgwBDAMMAIwCjAGMA4wATAJMAUwDTADMAswBzAPMACwCLAEsAywArAKsAawDrABsAmwBbANsAOwC7AHsA+tWoHoOyQmjlHoMoxOyTwa7JDJfilQscpQA0gxR2AIZhPCniFx+S/UnQfRDi8h8wcUPZDLDAR5XJAaRKBkAInlRgKdk7RgpNRosXJAV2azuVcsiAKBMy6JUT3xdWiEvYTNIFPUTk5XOBvNBWBcEoASy0tU/OIgvgM7eruk3E5HPNyK3JE0OxcxomTaVwwY+XrU+Q5b8LvEwRP2Mv//FwiIskjekUsBuBJuexXiFjemIhL7DVkTVgqs2n0FcYBZ8JX/tcIQqlG3F+qz8I3/acSTAR4ywiAMr4q3YNIHPyNs9qfIVo1Bn6hvn72PwQKGRTvobxapXSdpkizCqepTVljAbLRou5UHSxudq2r+Xp7XRFC+Po6byVP83iiCjhPxwqTnyIjxhgOK/NLm1EJ46NFVaVzXWP6OBUKIQPN456mQpj4w7yUCldhihRfOrWmhyXjIpUExRKu3KAPo32NaD6LMbwk7ufL/E/KUa3dqtlCgcTHpXy+HYeeF19o8ukZktYtOV8i8SXSVkR9WiZjmFx9+pHEhZYKLoi5nEm7oRDyj+XHpefaizLBvmJuo7JZeb2AmKa0oE8yizngkJmEteWmim7S6WrJkoUcrWPi3KWk1VF+J11os1DHUW1bd10c9glWfIUKZdQ8jyYbGvWPT9Vnn4wvL7Tnny/rw+778bTRFK/OtJfexlJBDYCN2+kA0bGJtSc0KU7hMG";
      S = S + "mLcH9lyGLGzU5LvfpjWfTsrPeSWMJh73PDlK6340v957qOn/ZxzlbGkh9gEyL6+r9dUfnfdefaxqlQhjO2cMXg2d/Cg0RNOvXDpaWtnfZmZSOHzbx4D7wCJ/E5sA7nAL1zmy0MYu+3D/Mvhz4cUsbf6nMAGuScU/TfcHCWcaDCaGmOiwLLBFNFEUYlEEQp57ZQWj1IUi5QNO0Zt0oPTNPrXpzjLFWQJIOoPA537NNsuOfEjQcJ3jnIGH1S1xozG1tcsJ0Rx1sGZc9dapUw2pftyjyR+pakRoXLNMplc+dMcQE1n0zaVZ6pydiSS64qfrhBe/HidFZ6NcfsMybBGHjCvQecUaE1AvE8gfuO779irDXq4WjkNKB0m8EJOMNSwM4oFRRUQzT3mirAdl56FlIM9jqapnaD+YxEfeNuMFcMPsxMZfbepLo7mAbeg7zx9gB3aOJn6OEgXu8Vg8IlcZ/nh3Bnj0IzkSDFlHNf+H3hey3nNI749BDMtlvhu5gXoPsp8KCS6Z6+aeti4KdlYLsv4ExMrq9IFScefly4FL1DVO0cNaAaIWbw7vI+7yPN2VZQ3mHs8zXwPlJC5TGKj96i7glIxAVEoKQqfuI7Ah3pBpfjnaXp1/rq/pQKvB7i1amEcnuHfaIUr49K5eFbjR1ETomXLfe46KgyDwTzocFYWq2y3FvdwwmXM3iw62VNfmjpse1LG5iGcoIcA72qIHXOiOjD/qxqwKacUCg722g4c2jYKKoFUiKdNrEt4UaVp8c7T+FVynNDekkr0872b+LukNonnjxydmi02nRId+oQx7K0/rSYQq/PYjHsgqxCDZomnHbraUSW5XCUTKjq2SwOvD+8udlZWS6QtZqa+Kvhd62e3r5923aajhHV9duqb9Pr2Q5qkPOy4yKh+K1YuKjjS/Gi2FwzdhGHXP4mdTT+GvekvsHdqYLLYbZ0spjXW5CmqbcGraBa+/uaC4o3XpR1k59I3734h48nR9rGWU/rdpR/TJ68YxHrKcMfR4Pv+CsqOByr+2ldz+lTpzdbzc3z/rCJxKAHscj65zx450sD26CLelhvRizSedYzJQbq9iaYUPyqZireevqqMb/1DQ68jBDgSlNciswGFKAhh9f8KBxGkT/3C4MfBS3zU1oi8P4uHB81CscvdIHq2q/uqlFDpvTeGkW5KSnlolTe/1Xv3X6l9fPR1b6oG7FfaVPvRQ0J3kqc3/YaN9UtjdT35olPjMJIQTcJEVeXNKb7SHmKYLusw76qDg6HaGJy7ZZkkZDHb5t8LkwkzEse23fon4m4nUgOCj6o1kCX+4xPjG/h4dUn9evKPm1HJMVd3ajj89edImq6zftm39f7hd8Ab0zCaHN8dFxxXTh4RcqeYqHs4g+x8W8Tw2BjonLiIdVty6Xr6dqv5TapzOaq+jaZK3epTd5TW15dPIIq7CAvExfXYZPKJW2Dma3O1kwCZ5V7A8qavVhUzZPlYT1ZtLubKaIwlkflIfigOjmY2NTkdJaXCXneuOXvyLXTedWm/vMGmvi9UnDxp275vfLrrlpPxKb0EnEzM9BSfWgpMU/IFSodE+1jlLOiY335FOIAeq/mmVEYQZBMVpc+1c3ExuYMNTmmzh3ovqnI0Mo+3etMvGuKKrPE91w36uLEVj+LbYXqbo6lGVK54aeMORUML1eQHd++qHV+XFmsTX5j3tfSPvkzRmbedmX9pC++xrc/ilvT1bIPcsd5Mzljc+u9wSld7Tk6S0ZJx8pO5dH9oovVN+d+LTXlTRtummwdsuH6XerlKFaVq93RQ6JLVTZpn8prfNvj2N36Arfc01dJF6/qw0lMfxPPgoOOz08zjXDYtwIrH6BjzKvXowhYkRV6vgxbwikfHTsqh+eLaA7oMvJ+WR+vg/f1yxD0J4YkOQBZ2Ahba6ABMXmihYkw1tQfNFg9Uf1LdAlajayRaEHvc+OTwP//WcKWtmVV9Y2NTuceJ+XWsWFD1wZ4boKXZEgTtd";
      S = S + "IzbZo3k5OZpJkcNiyGzKXHzngNhpWi9kncKIHU5guRBtyoN5JGIjR12j7cQBhC3qGpgM/yenKWleIE4dUYlfROm+ahVj7n78XZqOU5npUePPUMtC9EMOHUaSEjYST1eKMjU59NKojiJrUXrTQY+sE1nx7oAytXjhqVW3gHfZWlvGyYXV4ezpszaKmIo49o+mGKP+AJBB6Mpx8/pqHmQyECzY6cidIpOjJIhwysN2/MNZge/VD5/0DA7Q/IF9OPHtFvIKNrA7ha6vbm/i19+4FEINBeaOxNntA+4w9XIZXf2efrnE8VXSi0JvbNzu9cKDlfJJEYZhskcRKDr7RF1Maw0Ziv5afzDcPKNCUqVbGmfJjhnGzIMqOxj5avu6tfrFKXpmyYUZDO1y6D8ghhJOAPRCxooDawiuEwvHxZotnSN5L7RSTy7ImmxBLe2jaLXqMXVCYZGiwKsNCGdlZLn7qdDz0okkP7Dx/en3/wgYGX6XaInoi7YK7d2LY6VUUWK4yzEVUKLRYbfRGqympTrOyZpnyhF53WZ9szUl3+TF2WUFyapw7zOK27JFld9kxdrm975rrQM01ZGxN463vrhg/XeQutBG+eClPp0Iajpn5jo1p1MCWcZkyzpIlBbIzkaebWAwb4Lwvif0qxxArI7zczYH7PmP0Qvp5+IzFA5iQvBrpWXP3hB4Vi1MhDh/bsub4hINqP/HDRJRfpstsnoMNuXy0yZjv38zJ39DCjzZhA6B2ayK3quDFGG0ISRtiIKxZy2NdyM2ZDAnmBiD8ueVQ6TkvY/1DyUPm8JEG7FvVgXJDpJM7//gv55cnKnLDsPeViA5s0q3p7dEhd251yMbieFr8WlUOe7sz6qyUi91H7SNTypZNNf+0KL8iQqJzg/vf/OFnt21k+cq2T/XcCN0Q1caH0f1H3YUhSYQPShnZsrj2+0jkEtzf4J+x3eiFVY06yDB7hdxnRBQ+ZwGQAt1f4fuwvwvXY/TYW8DKjqfBpTJ0KApNxA53xn77wCIdlAx8eGcTs/592wP/if7wZvVkVPXGejrw1dh3c3sqEP0wvMKDvs1S1qMxIo3rMbhug4+IEsAZst6QW2bCEMENxYWNfSZpMaU2OZEjMxUIe8Yf5j+Mrg9/Oi19KU7p/iJXxTyAUxD0/9KI3o5lwITA/p5l/Wnek3yoMO6s/Zcw/yXHVFSDCvasIJv99QYPzrHV/YvDuhuJgBfDHVLgSTs3DATzKEhH4gukSUi6EMWZVCsEcyH/7cwLysiq0SzG0gC66BEIwDDBALURAkITpXhcGvPAWYKo0A6HKqS4sROEJcFT5GJLg8j/kMH9ehmqduT38vQR7HU3OAX6jL9FIeealj/2PkgNTdzaczl/HPRKKUbTd5tDlyZ+rus4Jj90dk2KM3CXhBwQdtqrpYr12M10D8DgzvHsisK7FJ8hBZgH4DXmlvKSiModS9h9ecosvlZHOmcGpqvGekjozdA4WtnFIWDY9sHMaMKeLJMHGnN6Z5RQhBsD3NMmlBwi84GCrISUX1sGinGpwAEZMxzQ1wmYrCq4sEEYEsYhDPBKQ+Ekef+tKEP9PH/IHgqFwJBqLJ5KpdCabyxeKpXKlWqs3mq12p9vrD4aj8USdalQ3TMt2XJeuXLtx6869jz757Iuvvvnuh5/raRxe0BsNTLUZ4V1emg01BAHGCk4j+sqjIzxueN9nUbQfXpQQyKKijIGM4ptVnkJKEz+Djix9Cks1pLmPZaT8BJpUDCjaFXQ6VDCc8xL2tIRXVzYzVPg1TVo7kjGuak/wxz5Hk7fLXKxdxQYVK1eSdeUnpGqKXNLqv0SRp9M6FrWst4ltbCDfjrEPYzjiakwqbU9NhRjlXrN5Ez5V097EyDu0VTKQDpepqGqNibVNg1Pgkl9JTZ+G+01RZerZuZcvtKiS8ltd5ZjwSb4fUnrLO3rmumR9Cr+Otb3DPQbdMYd4o4LoyFBbHgtkq3SVXK1AHtT2HXcSa7JUte";
      S = S + 'rF5LnhCaQCRnYyEG092tjrbzUqkoOJc1wzAAAA"},9377:function(e){"use strict";e.exports="data:font/woff2;charset=utf-8;base64,d09GMgABAAAAABYUAAsAAAAALgQAABXCAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHIlWBmAAi34KtgCsbgE2AiQDgiwLgRgABCAFhEYHhQgbFShVBoWNAwDFdIdHRcnM5KKoz4JRSvb/dQI3RERcg94LUYNDlJRRFMzQjtavWYLQT3ERFiy0h+AmMcl3xzOrdBEOnrkyLmf//l46s40Rjx2SFE0Caj9+e+++iEZTS4aYhazJQmMIWTOJkBiSNv9p6u81uXStcTtz9aNQWCTCegJgeNrmv7sD5QiVg1YMBCdgEQYIh4Vg9KEuylihU6xYtNtcVeF+1IqVkb9CXZQrtz8H3y0/gdMEmCGnwuiZzJlL5Mx56v1pf9Nf8JlgE/fK64B8AP77qu3R9TZnWJIDRkb4Ze+zzlYKOJKfrKsR8H9rqT0suIAssWuFrjDkzMzs3GX/TjbAmwldUtrw3AYIimgBFdBurgSgKlsF7Mj2Vem+qlpZV4LlofSmgUjUeQAQ7gbkYx89r5NZUyFU/7Kkb0cwOCTCSaCmjituLjwUGo2RIMVpbsTFjAopWV+KrMgbH6NzVxPqwfUQBt6IAGR5cyiz86u78i4dv3VFFeRp2QDeSoZL588el3EZCy0JCspXlnJJnq0/bvkY8sKt8CppjIPxVnwcv6b40VZFZWtPBTWkd3YUQ2CcIOkURbSaUDKYVG6yGnK6xrTGwLF55RBKSMICXX3VacPCiMqBSXP68Xs9MCjvrWy91tK7pzvRCISDQ6qW3iw9Fak+gRE2zLy4/q4y37xuulCfUCGNbxRj61PXJuniW+ZAK06xe3Xg3sgxVDTJ8AXUet41jKNskhmb3qTSdPJBiT66G0SwuNkMvtpUlrhANzvRaQTOhjC+fmuojcdjipqOLL+dcmeXapTAgozS9tsvdZrYTNiyuu7d645hcv2uypVxzrwu5RYy3jorwnSGYFl1tXVTmSuevv7gk89++l8oZCgZcirSqo33DPKztfyy7pr2uUirYfuZUJr2Gg0szclUJ/OVRwXms2pkqJoqnaPwBePrhmYpBYrNGmJCimVAux401R0YxTXKdTyTqQ7kBV+QV9I5mXxqAQZCqqbOsHkoLVBdR8yQF3qIrDJ73MQ/mTTrTGkba09yk/VCO4lr6uUbOLCuVhnmG8id/tVnZWlBnxnwZmdqXD6ce30ayAkfsQwnb2RnOx57KNPZB5YXKZId5lxx3mckh2KyzxsJgO0JPXjO7INZVrD8CeUyZ8SOGkd2wPsGbVftbmfDtRlNzStowt8ejHeA0WILzRbehSxJSR6Fp1JB8iB5g4f1uw9fdIUEJLTo6SI2z8yd8kHbr5XId+ylTH+31XNhZUAqEIFWIAUkZcuzQgH1JaeVqtp0f5D/yFGmQB7+uebBr5VjY9r8ddGNX3DC+6QF9Z5x7oiDruCe0U8Ayz+Z4wkuGxsqJpoNiCknw3wLlgUKFaIpVrdlFVU1dQ1NLW0dXb3c9qGRsYkHcGZuYWmlZm1ja2ev6+Do5Oyiq+bqpubu4kHV9vTy9gEhzVPytK170gpZTpwB7tisLo/7/yP9c9mwny5TOYCSmbCNtoFpHNcNnDCJk0aBU2ZwWh9wxhLO6gHOGQfOGwAumgAuGQMum8UVQ8BVg8A187ihF7hpBLilH7htDncs4q5h4J4p3LeAB7HMrwIxNUVQBSRoQlEoCWWhIlSFmlAXGkJTaAltoSN0hZ7QFwbCUBgJY2EiTIWZMBcWwlJYCWuLbPBrk1lbYSfshYNwNG11kmXOwkW4CjfhbiI8LLLBr2dSvIS3We4j6bCJQyQKtYjgF5tuw2UXhCAF3eGHldGfZ7yUkQ2yH3r6EEBL6vkNeOA/2N27vo335BeCo';
      S = S + "pd9dwodW+/6Zdh2/dhfniJvNPmCvTvsF4u3ABwiE/OFIb4oh0MnJbHZLklEDfEgIfQ5igeDzkSoiihRIINBQddfEuQi4XFQ1IvFYAq5LiQUxxdCCRcSiiqCbWJdXYUzR1Eeh06ho74oW+LJRykCMhl1dSELOMJRJbmhLuEjcfjCLKDEYaNRD/rkGi93dYn68nd1dmp+L7jS3e3dP3FvT0/kX9NWPvIiOoFi3f04/I/Cqx0+AxP2tEd0U1d2TqdCVBCR2d0/zjku2N4ZuCnwGvsYwBANOHTPq1Yek2KWL+dLZQMPAtka6BylaxhfS5x2so5rI2xOFqTRDpsFhnj795c5SBZEV5BCjSCNW0EqM2OIxiqKrWKCYgEMB8Pe8bEQC05iG6qrLUAcA7TEJUwTFqqWhRdphgEKFF3/zyVeXVKjL782R7+96rKPXHlD5tghGvKZP+SCi+RLGxSgsx/93eTvC/vp3PwIpzTsTpflgfJZ+wrVjmRgFhXicd7+R8zvcxmP+RnF5LArOHa7zTeBxCcFPpvgqzX/ModS0pzAcW77fal1OcpMbwtFgyKP9kVPfQLBf4qdNO5JYDw+o8TTaSTOZpPJo1A9dfEu1m6fB0pYRL3JLBKXgHIko+UqYzEtQpX8LSRaon4wc+REIoK1HFSTZ71nsxfUiznjZzKJQOcWTYo0UCIRT/MZTyST4JTHfDC0GFGAm4TD7nrUy7zeKPpIfL8QTeXOeObPFQqvSSGrqFclRjKXwTUp0RdpzUTcyivnb2t3L6oX7jiP1Uc2jMaS2dPu3ztJd3BhoznLHahp6Zlyyn2lwpkWgOInNJJz/bQ462XZE08jkYXq3xVYeCH0vcWxET5alvdTvxUH1jBd7186S3ZUpsDq6b6DQXpL73IbdOHHz7UG3qFzWdWS5u9avT4zcnSyNmc122Uqun8mDxTDwNrq4EWomiYSK+So59VJtHMsi9frrhLA1ySmSFJNuF4UGj5T6DqIsIxmWVCO+9O6A2ve+cMAkP9WQ9SbPWgGHkC46AfFkzlgLL9fDfZBSrIiueBXKQYLuOMpG7JzBDHlu/MT28LTgW18u/C0AzpnZNrFX7ZvkR3/vd8JHAfIQmiIHmJO6OAH/w67PbeNqsN+ktYHbnypOWpJEjxaA/33yvJ69Ym1941dNyX+0Oq5sGpU6H5yT+8+v1KK+bx3zM6UxHNW/3WjSrnk93uOVEPpYeVFq+akueoG+jldMjr06TUsOKvDDzxwgB/NQOBoo5QyzsgsY5RQLo9sFfIeo8cxItTncNbp/OSTDWpw5EJaMuaLCSgUyqJUqAsxJTHTJJpevpzdbp292LkqNPfcCj5svNrDjB0r556EeHr7PvL6Z7vfdV3q5mdltSLZkhX+02VxgMS7R8CmPH6PndrHp9CuPvmAiJZR0iKr5r51iAfH8g8xBk6Itfue9Hsh5otRy4vbbm7hRztzq8/55jua1a0B4omUn2jLr2iqhJ/R96fdcU85edH3zD/vy9WmGiq4J4IjvnOVrJH1aVeBwdsWrF6F2zmzGYbchVe8oza5D3km83NxPx98KeVqf1LqMWR6HYZc9AwRQzwLcE2X6GvmNOoDmL9AAM/qdEVXdNXAyiEcagv67Gj+viC5gzy545538oOcUAdwkgOcyTaXHdnmDH/7FD9A2KHpxG9uIUi5PJtCKMDdDtLQ5CLgkoV7TVjxGPM0ovmCMdVrLrDocFo32s8bhhU8tG7/PX3V2QcVvVU7tC7UL8X9aw/l7rbedKO60TI7rphoskN4xjY94HymfuVWD8IryQIbYiH+2hGFoFoqBM5mHyHt4ckHz+6duM8Vu3ANlz9+X0YnTaHXFf74JwzNasRT4ov6Vfus9FEfldMMeABKjjHUQgviYKZkHS9PkMkSXBEvCa6yhARZudIJYj4Dfqy0mgRG4b0ZS5HZmNpPRF2anxoTQcQ85Rx4dswoHPloNI4iLr+Tb7sGsvd/QjdUP30/6ZcZHqNGY";
      S = S + "3MtNVRTGD8QEzoQNyVz4L83rIdwfC241Wk2OzaQTXWYzQzGUQT6zqVL7z0G+d454m0c+MTbZuSqCKWSUOU6c/uVBKHMVTlNpsUGq0VukslMcssJ0AgmmUV+HCiSMRUcl60KEfRDh52Ha+Ahp0c9c/BxVvP25iFzlaVq8GP1aDXQLFBmh4ZmKwftZbNDlczh4TcnF4u8vhEtEX3jJcIf63Ev9++/d89v27a5ZSH3ZMxjvUUP1PGDgaanXGgyB8Pf7tu3o6AAhg36W7r6Wz/dOms4dap12CoQAxMQC4gnreB6v1FlvKHEVbhDiR0qEax/477I8Re5DAfIN40oLHK5RaFWyCwWeRBjl4tS5ecAa4Ce98g/0qc3MZhCZrbIFZuN26UJUvDGpzLPZqD9v5nF1WULE85D42aOU46bMS4C/VtNKy4+8vyrpq4F6qQExnj0Q2X7uulrRO1sj5nK0b0JHPEP1QiLFx2AoXsY9foqtTvvosr3RrFvXp5gntvuc24CPocrcrs7gtFa3RpmlT+hM3Mxt328txEHQAf7Ty7WRKrl7GXM1qX/4Y0x0AnH4rjcQz9hu6Jb5TdkDr4ccOppNalUMl/TwZ+71f3aZL7qfgiFuhezg7vulIT6wLBFLVtfj0kCZpnMbE2fWWZNVA+rEKnZRY3FTWyTSG4hE6AJqPB/HhsovLNLs+uOZqnt8rwOsdfDr97cybb/zmoJDNtQD7CU7twiNfPc2m/l1yXPaS1J5hrdmeL30eON4/c8Jn6guIfSmalpJTl1X23CWvlsfnjevNz68OVkiruvOwbW97QpuJNXGjS8nBI2C8YmwsfSFiz3z7sHiY7vfJnvdFgsyZLjzExWDjs+LFMbZh0NXnz00P8jbcNtDsOWLyl5RZA0P9OQrp/GKmJPFFm1jh1J+kKdrjBayo1NWRYyljxUBInMlaWb9HvgZD+/i7FcaXSRTluol3DiUpR9W0Pl8rrxC53t2BKqqDBZ/q4LfDr8M3HS5LQS/9niuQy7W74xQ6vMzcCX4MTXhTbELQVarS+1eSccintlChZUidOTLWP21k2L0k6ryqBp2io56kGgH+9qh5poIGGeWw7rdwmo2gepIehYw82y+jp6pWMVIMAuoM6sy4zVt66VmOwqnFlXv/oKq9eSFv1KUEM+jqluTKuvY4IP1XkJezkj+AjoI96MO5qMzcYbTeqCVLh5Moa/B8zGh0xhzXhzjUGLa2tw5HhT+o3hCn4FBMa46S8oPoKDgLXPWtpaKrpFSuT7Knwfamr6E/9zv3AQ8CWsoBVRhVnbNrfZ5jizsSa9vjibY2phIhckgBk/csWt4LeX/icahcv2vLDNuc9bdrd0TyFFnurjnDPnOXfxjbKzv9RRi9L5halHmDZbYKvmMxHpDFGRmgkfWJypb/tF1qRd++LS26fKATYZH8XLvG/dcqTyLZrEwVeO4qNKQ0zyZDZ2ssIh+uMxT+bgyS24rxc2mez2zMya5+5uxgKoHgvsRnuzHYfqRjt48Ar5vxdxySlf9xXc6y+4PDPLRJuxalF/v7PP2X8MN2MvKWNvskjyMP9XUHuwZhJkVWeGlRxBJ9OKZBOkGamRFs1VSR57EicOv2XcDeVAuZIkn5jSgpXhMXgGZFbEyyaspmRQCEmqND0rOE3eRkqTEUEyq9jiSrhm5q81yZOCttz+TN5ONqU3fRvrn+SiQYvrGzxmhdqESzb/hcrb7sVCrdX19Th1PS9GEJe/K4vU2h7FS5ks/PJlCLSyRNjFntY/cv9o7bmINYsX8sVXxPyF4hFV/OjBXO67XMxbUKeOCDWCK0K18D5895txYbzwiiABZDavX08R6tJX3doxOKdg2rpjety7VyRKufxnYuLMIjKJL9Fl/DRn8+be8cv095rQtRea3+7cObkCowoE1YVc10rmps2VG2m/d/NedXR02nL1n7SRz8nPKB1VoDx772S6b87yZeN1t20OgsghHCvKA2WJJrm9aoXj+ioIx";
      S = S + '/aXGu6GLjRClOjaNK/hJthBap6Pf9CkdPyKEw1GY1tjUwO0uSL4nHZd0/yvmsrN8+YDn/jBGZMC8qUrV0rzAyY5Ew16N5wvnRTgtDEtNtQWRxdotQXRxc8d+ZwCbbHuOcRk07l0f2F0jCt99rL1cSTixENLNRDJHJFKW1qGZ0JYy7iE+8QadC8ckVgkORIxEFt4UZLqabPteAjyjlNtIwHC4ma4uw/0PNAVu8gxXWFL682lpefPty1dFhsLHNgYOSqgVtpgpppJZu7YGRk5NKgkqz1criwihoaY7st/8c6CynhmWYbpHgXe6l+cv4hn0XbMZ9gq2Uk7bmFfkizNx2ljBp4v+tuq9HT1yH9uZ/Trcx8reWLevgJdFBj+bDYLpvOnCLVv7drpAkXmg55GzIJnpSOLnU6Rp9bWsjV0NWLO/7hwGB/mfrvIzd0XYjgG3lwWxiOasJqjFvQJExo0TIzgkhnFFSLxQHfg+cLD1sRyIvHyNfzaFcJUbjUdWSjAA02ZsllT62oWOGVcN16/PIjyiYcX8A2B1kwCZ1jB/LEY2tg3UcgZAKmWt0FkwT8h7EnZtqQTmU/02JgpBpEhBMYGl/E6pEhIMOKWBW9EyJPhaalR8E+qBsDYkZ+Qp5FtWnZRpyksJfUooqtV/0hnsHt0mWD4+SGHNYVWIJ6qnbxK0jL5fzwpzoeqODL8xKEOQhYhtbwEaaQ21d6ceE+8uVgeGd54qn4X7WSnliIlOWlXdxIPq3cFJ7rI8z/kkh72pfOmuuvfUjAyCAA0Af3rqwUYVy98xZ8C8O2YkAjoL1QcMtgKDf2/9Hy9Ju6N8KS1vNAk/IeA358yqLbC9/zfk+oXqHguAP7ZpnqAnxCDfFBdg0HxhgIgqroM7CR37RgywEACFzv3AFDXahycnAaWgVKAAEhCAQRlYAEeYwMuEAc7uI9AAbi/GlMIvKAbisD9dAwCDCJ9MwxaoAnDsfqpjX/HUGP7i6pzQDXWQ2/yjzQ1wtlL8Wx1ZT+JSdHIZ6d7li7Vq1mZlSpt9kPYLioEyaLKJzkrarP4djyW+KwLJ+0TVj+18e8Y6jNC+0Ub7RxQ19RHk7D2j9aQ4H0Tzl6KZ5/2n4x9T4hGXjvdRS1dTtqrUa3MeF2lVdmPWIlPCBTkyKK9/kkO86IOoce3I+2o9MsLFwsdt6xXNUrOEmBFgS70oA8DGMIIxjCBKXxhkr4c/utWnW6vPxiOxpPpbL5Yrtab7W5/OJ7Ol+vt/ni+3h9MKONC6oZp2Y7r8QVCkVgilcl9/fg1bAVWlVKF1ggPUFWuqYvJDRyyo9B3Naqt2kju6yS3XEknfzCcpmFPRto2jEYbq/gz+yo/cxJE89hcDdThXTy3nCZO2BSdke85ife+U0mp69Kl687W85Rcn25Jy6OOjhg7+KfYcpSngKnuqr5B2YQE5f6U1WS9SpvY3z45x56jbIhU2iA0nPLZDoOgb7gatXhr2uZBvZb4PMopZY7AwjRlsRxDkCvR/Rg4irpEcb/0i9hKg74dyU9nM+FcynJpOBr3talq6yW80CS1MRTJvVx5pOHMgJV5PRtTokpKGZ05c0IvhnPqW6BWRtnCmRBslMgsw88mAUIFCgQGDQgwXCGBgwA1fMEJbpB7aOEMEe5wgRIeTwAA"},2006:function(e){"use strict";e.exports="data:font/woff2;charset=utf-8;base64,d09GMgABAAAAABmsAAsAAAAANbQAABlcAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHIlWBmAAi34KxFS3OAE2AiQDgkALgSIABCAFhEYHhUIbrS1lhhRsHMDmjYY+2f9fJnBjSJQDf3Gmak2UmCoRplwn+JpsYTlytdwFD68gMxAuB6741XeLNiaMyYN/Iiaja7H1EUOGUhLUj/323jcjUYJlMU80EU94ogRKZmiBUH/jr7U+X0/3AC4BDOAS/7sQgIpQqZPx';
      S = S + "wEKiCutUygMLnSGasyZsKRo2YYIFiy8EPEDFongwrRhWQbxiSLopNaEOFUqTmm5qTrZHFe66WzFSMeAFzgogYN7fKmG3GmaqyKkJcuZTdX6S1pPWgQysvt4IsiLS+voh/7c/Nf9aap09LHbKmLfn5uSXXQaBSUDiCeFyEfB/OrPWEGLnEOaAq4q6TjMaaT1/vryWIS+yorfn9ZGikFbLXqKkOkCurrTXB3ZYQawu1RUll1g0V7TXpT5oqytTnm411z0+bukoMcg+f00X2lun4IUXCmKEACE+kpAE6lenRyKAsj4HNb6eX6ecPHBzJomInhng2DlOntjfxL1nkYIlgTuw7NOgKLrdy34IBb2MPkp1rOGX8duZ37On0REwTl4XItLicDqDRmWy2BwUhj67sc3lwbZnluMFxdG5tfcOYgid5cCtVtNehZ9qy6N8Y2XPZC7cDds5fr5VvsKT56ihWTQLJkKQ1WcJ4R0ZNjxzKu/t8IM4awcqx5ZhK4C2NmOYC8PMrLy/b+tuPdg6Y2FYi6DJoNulpfrW0iUyBGfmbB7flj4+b9u2A4Ojg7DMLMlc2lQot5k2VPOScbe2iDCsmfKIjHtnYCiqLNc97FUtol0JuSGUyx9tDMmTW27PdDTn33bOcGZq42bBvYMpTkJpSldN46kjVKfZwUqStp51wye+1u2lz/6LoCKwohYzJtX7X7GtyXp2TpAxum+e5Xx6wxbDzzBCoceT2HSt1W0cSA0adCIBQZNONWvQ2xKwrLX2dhwegjEDrnpBo/+CSmeSzfUGHo9E2G/2kWLS3okPNsBahCCpbijNlRuo69CkwPZcRJkgz/aYlslJl5Rs0p+2PbM9V5JNk8y39txZBke1ZlHnXhhyeLrFuZgzETWMvfnYprE1sMD2ZLmzI2vss+MGOI65YGuHKIcGvaYpz0Y8neFkb4yDKAZceNtQ5ixPBmuPECo9TwnmxxqwwyKyG3O1yyiz1MuuRRSq95CmAoIzc1s7w9uTM5LejRtokJ6oz4Gv5IePP2FBASR0BqK9WN6b2PG1oKaO/AnYyM592zB8fiuQAzJAh2/MpdbiUrQA3nsdMCHv9BC/Aqo4FKLjCc97s6n/+y86PeApLzZRSo+sIMXBtKopUIW9MrMAebbMG1iW5qRjTJwMsUcY19rRBULBCBoz210OTyCSyBQ+fgFBIWr9UTFxCZwFmJKWkZUjyisoKikLqqiqqWtoamnr6OrpGxjyGxmbmILIQ3QnT2nUNTGb7j1rCwuWozODdrf/+4fN/WlofVwCrwowGQ9WVctXZArYJF3AFpkAtskIsEOmgV3SC+yRRWCfdAMHZAw4JP3AMRkHTsgocEpmgDMyCJyTAeCCzAFXpAe4JsPADekDbskscEcWgHsyBDyQSeCRzANP1y6BJgIJUgBADAAkAEAaAMgAAFkAIAcA5AGAAgBQBABKAEAZAKgAAH0AQD8AMAAADAIAQwDAMAAwAgCMAgBjAMA4ADABAEwCAFMAwDQAMAMAzAIAcwDAPFS5sQBwiUUAYAkAWAYAVgCAVaiyYg2gCOsAwAYAsAkAbAEA2wDADgCwCwDsAQD7AMABAHAIABwBAMcAwAlUteEUgA1VAKAGANQhoITlzRa+gU9Q/qf2I3Li106LExgVpVnKQxjkqZk/ObMidiGpueT8tqQ2PGZHiVYjBBKD4ckloivb1pN5uXp2kE1l4ymJSctRdtYwWPKH0wEsDNwsX+Kl5KFbL1yOteU6L8pqSyE+NCvSSZVQMl+QJUlW5JWZil+coEQqEKEj0QVJNaqyP9zNF/ORTFrCwSAOBeVwPJlMRxIZgVz+iGI8gvM6LXJp4jHgR9hn2dRlE/KX0iwKLg8JpHDBKZOuXrEc3cK8bFR4RNpbktpLK/3TUFBQzHwxKHPEPemSPVYh52btL5tI2tUqu0rTu4ys7eWL8y9Eomq1uFDYnSrdfQfjF733Za2SVpL1SMCWKrm88qJqYfczJVegXwuo";
      S = S + "OvGYrLjFJ1Fw+2ResiOlvW4hH7sMWNWJZPWWbf+E84zw80iIImUxujRJtJnWM+JYtWLw+IU8A4YNd5ccTnjnCqK1wtoj9om+aLEsCpZyVDD5k9kt9HqSllAqEDPwm55gmtD4VPQz+F60fNGZSQOJEi59194/82c03/ySrw4PGT+Kf8ULrK+kh8lR+pMueTU3jJYrXifpXpkhEB70Qh2mYbYHVeKKvfd3OTFyFLH4tiOzmFZzehnv6crh4CgZH0ZrnBVdKZNR2UxJsG0Fh9CDbu55MjrIEDgwAp7DY0P0HXS9YrgMjuUYmUU+UFIlaRKwt0pBieFxOiULAVVdq82vlDTVQjoKdEYluGHl0NiWVMvIwKySisFRjgRl78c+q12XyYB8PnsTjwyc0EKRFooqyR0aAzr9tPl7D2S07t8zqipKmfvm/Q3EB7qlxuItPMEwcFLUA3jE3gDsJ0+nlaxgc9z1O5AvX5RbUqibURkH9bC+myOLzen2dGgYoiU6Po9zfPlsON32RAk9k1JiKrCGzy3JrbBmWCyipmnbZrbFIoeVKr1aHaqXiiQvmDakMWnR5wDLZZ5VL4SMhp6tKRqVWEo5IpiQIUHJnceWJaozXBElto57YC/pR30ySpIoKq5SMrTVq+Dv1UZhXBhPxckNou2a2hGnLrOJu5YgyillKpS6xmIaHLTzPxEpQ8scv5Dj5UdAe8IVLVQU2uROV7SZbsL5qcc812Wl3b2gkcMFcYUqaBtg+BLSe7CHYtpZN1cQ36lF+ojOEiWKewqjd9rTwn1GS/+Gq187dGDqRAzwopxfGSwtyma5Wz5ErfagXSKzJ+xC42QvbVVpld/Gh6Gcnb5zW+3m4P5KghzLIJKczT7ojhCwWB27MHQguUKJ8KkJXSx+ZqGrVXv7z45rSaP1To/u7p1td7bXz/j9wpAacwmWw4PZNzEvW9vafRf1k17Yg/s0HIYwikiSIPKmHd/bP7esu7V2WvW5AUbAZQ7mwNQCp769c3rF7t7To0pEtOQmCrjnix50Ndz0lZN4OprysAs9Tk9XLQKv067qMWg+a+M2pwavN81EaFZ2THFMgZu+dTHrLiO5Dc+Rzt5a7Ve90qv4AAiPXb7RhljaAvecls4kD2deTuBtn6iLh69pzFTZo7IBFGkTBh+qN2vaAySq1TVIvU/+729GTX1dAGB/tpIjUc6BoZbu+QB39DTAxt7OXFaTCXCvplGSenqq0rqHp3SnOrXkKF/zDIVyt6VLxrsazWmTn9XIq32Y//YDz4I3PEkMO5RkRhLeHdRvaZJO8+Ls0aU+aFDjYABF0V6evXhjRuEqYs9nwXOG39QWgx3haO2P55NcfSsWgQmPTk6WYhIr3fjeCKcPUG93jfzRXaMFOJBWEi0hIIPMvIMOqnVBdA3ijDasjkdmAV84g5S6++tZuTQ/CU9SlrGXy1haGczkpmHeHqjryd7OCh/IgOUumfNa1aoK2l2zlSv4E3VOSzn4aNoXDYxsYmBbs62DU7l8rtPm8NZ2d2LZtrE4GQasevPrbd0Hxvu7jqh2DX0ZAclTrv0+MFGgHNpq9ZFSIWlPPisaHp9M4OObNZqbEn63TJkdpoPIYnpi6uFjWS1n4fTIC2XyZGxMPpJVhmYQpUC0PbgekWJXMM/xkKnYgrfEOa5Tiapmfn2g4tKlNCotLo+ve2FXT2sIcbzBQTPL6qX+o+13e9vMUPnolMocb1ZJaUIhLevTVkmjxDNSatY9nLKgmBeUUlGnvqJTzs37GZfKHJs+b5osE9hHhauZ+7fIe9WYVcE1kSnO3rW+hihvY+yw4GYVHTVazHt2VoAc0tsYBw9wRLr/e4gaaKFdqneOTgyAQgP/9jbChrdsC2qcZyqymh8T7uprQs265WP36WtMusxf6esqKIeOl75ulFE1V7Hmb17GouDmAGiGvjr7Or5XwmokqVIiTLnkcL50USoDJ8kjNIUnSneznkjq4gc24hY5Es1nV317AVSH";
      S = S + "Xqz53SJ4+MKcHs0y/HiB7u0kkpo/nzkICc4KaJKYYFrJTccW35Y67SVpkJAQnOUcAg4y55/zWPhh3IfxC7iAn36OltCLF5PWOySUmQFGSGuDhFq8OKOBXqdj5xS1XgLgJ7ym+WDgmSrjl3QBhrk1O4fdXDu/EZVyWEJeQj12FvBmBdMY7e5OWh+WU/fvXUcIzMC5/sgFlXo4COu/3FT3np7e3hcSg+Syiz09rcX8LB3eG5n1Oh5bKsZ7ewBPVQ4NnB0cA7YxmUMp2VZVsg1lJ55CE2aEwwX1hgFz08ctyjGafIILMtarAhdNLC5JRJFwpM6eLCpCE0PDQ1FtSVESumIyuMgG7nbHeIgtZ9Qeq4q66oWaqi3LZzbxqe8ys5ExWuzIcD2SwrimqOzaBoSqcPamHetb+za02VbU8IfS11TFHg093NzF81e8Xd+//vGK+c3ZgZm3UpMv21VTX6JYlZraGeIe0pqeRjzmPCYsWlOhO1NTVz32BKjwHIUZMHN5OUXhLCVLQWFVxmDEIKOwgMboxMT1Nys6uok2pxiszXSmvX2E69QLN24YvAysJbzNgs08r7UlbiBhw0+N9HTMaakGNMSz3XLWZrQ7nH/bsvPteQc000cDbFWz2QPcGNG+AGHcULpPFCM8JQ3JnTRf9FqN1u/aPXX31no0ExUNbaUVyQ0GRNt2VTqVA2EWSkvooSH4qKvt1mRv5KMlwO4mxiLaVvWgETNBRLovtC10nxRpe839IrWaBMz+2KHO52ROG8IqfJZwo4dwg5C7YT23nRvOY58ARD7+i6oZMdrV1c2VxEwYldzIlcYIjKSvYMgOBaIe9xUV1JStUJ9kYEVYGFaIRa3OkRr8dLfnu9p6PeOprZ+c9QejrO05OuHs3h+fXU4Wb5IITuugs5v3nwfgCPs11zQx/qlF3fYT5v1y98pNr3Vil2g8ljrtPuHk4TE0LnSF/EHlMo7Dnmur1Q1fHNmZkHmq4expl+G7OJBj8ZAsainGXfYyI6L8tG9Z14RMu3zV7+9cD9xxPjZ2nZTwN7lLgdtKaweti721e8QTt7JOp84yt7B7Mlv7vc6ad3Cn8/lmBamgFVSXNmpCzmxREVeTaj9nT0NjQCCl1oOhf/5UM9KF8crwVGayu8kt2TE1XBkvTLdSNUS7U5MPkoICk43n+KTCrKAU9Nq6Owo9PfQ2HODLgqABIzhvHz+hphskpFBAY2sTLxqUb06N/slj4s7k47s59fFzVs+Pd0vuZuM/2sflTsq9eUT1zLY71JGdmDQvo37n/Fi4x5ZjG+2uKchaENn51K5byXQG/kIjYYbRsbWomK2r1WvMOYKuAl9VDCifEZ7oJ1ePk/slle5rr2zwlt99mN4T/fBDPnMg7ofWL9etUtAXvUTw2P13cuSLC530qpbL0y+6kla5HnmuSqVrnkcuj5reED5cMC1rWBlUslAQ11DZ3l667Iy0W65O9JsRXh4SAlTLxLOHa5Kzhy7f944EuVrsddwAc1z5hhQiWiOESrON0aQehYG5lkb/hIKtcle163Ip3smtBQn+jUokJ0zRa39bGagKTvBI92qDAmWUXfO2fa8iLAeZ6M2j5XE3bVdIUlBQ0lQpbp66f8Ldcg6bUDbaC2j/hgT8zrOX1d8h0fHBRy4INRaM5zh70YGAMbQDZH9zmXLQ3vofG+r9hbTenkKRXNR/pOP7/QDwW8ejFTqyYoi3n2ssjVLPQTYZLxcVaxsB6U0ZhdGCadyBiEke7U1UM8J2NAOdJsCLsxV6BzwtncLI9LSy0DRolBihaMQKpPpZmaDPQem0sU9DTu4D9AOOsGq4ZoaKkh/2IA/D60ykLhCqPEnJ4RQqIKA/jh/Xb6rbuy0m+yxmSGAENIOeWu6IaNUYVfSgZ6xr6R4bnCacpORnTNGaiYp0UXDOtEvduYNZsjGyrEFuLF0VOLFB6aKJCn7m5IvekhMGhXbM2Mm3yiTOXhIQCpsnIdmxmTsIs/BQeyvW";
      S = S + "9JEYXVNjtjakmF2iMcl9D6gMJXoOu/iBsIqRsAzd5O8pyjGeZshlqXw1NZTEYL0tkdh73QSsjLmyXupAHQ6kiKFvHX1/v5W29v/CeRtuPwwJOIxMHxsBjpKMpYj/6qdbUYPu7wfz/4Ym3jGNiRwzP8KtfuIEn4N79lMDjDu9i8bovj5cal4Rq7K/3mIxY6HsgdAT1vitdCvrLRa938QbBvz01eJnf/utzuSxrHqckhit6b1ava7Z2cxoJivQnid2/tgxgM6KBG7uCsWY0fLcKcnB2qAgbXAyIcVpbdDeNPFZkZ1dN7ZgzMyZYwrGfT/KUUbZDvg27rz1GygY+9pgXEEdcEXuCxx5XNGpgJGrPOCUaNBjQDWJa2APoWp0kHVHYiqzuCGaOslncV1miBr9yPRrJyCdO0k94KEOzsRFNjtfTHxx4imHgOKsLHKEIYU62EFhdJ1YXFfLLirGszLF0AScbjY6D3C1opNShsZzM2+bQ1tTnBgtFcdxDJwYSHDW11eKxoub2hy2zfjqGYMm1HqiGh81KoUmeEdcCuJFTe323M9c+/bNcSJQKr4DjRx/ltpHw2pDSsruFvm7OQRwhIkjpIgZWnzlZqL3RKKxsxQjPC3toBSO1kH+fY4RdnUpP9+1K5Fd6st23dG1zJ3dwUk38u6YoQECb1nfPJurhfLshJmwaVTOKLRwRkfKhJnxTbAqpyqf2ZoyRu43vsEhKftPDtgUP3N8yvGCWY4DYcpM5ubcQj0nfX6MOFDIzJ2ybWNhtnPr9NYUFp47tREmL41JjFnqXXXoUJW3LqxxeRqjkYzzuN9CG0bK0vxnaur1m/rrlfpZtd/wVRxw+ktrUQ6/diXuAeizaamvz8yDz2IBPioDEVbP4cMWda+EHBp2BfPwMK7lsGpr8Z82PZCAgq/kVISxkMBMELzf4aRlD+BXNQLn4u8ixe3YXHxoCF+/HbjCEXg6xb7BBu8T7xoQJUNJCfngvgXMkVD9OjtpjASZvVPdMP9L56yHszB2INLmHdC74RbNWQxZOOjNKV2Tm+xvv7qdOsrL9LXN/Jzi1ppfD2liOvnTaWGwLBjrAQdtOkOPvIjRb1wf9WlMJ/YiljuYLRstA3yhIGQzf3OIo+MzfMZsNWUkzbDqdTUCCJzCyqvm5EVky2TZEXlPI/Kdzpbt3NP8z0h+LE9BHW3zTHGuKKu5OUuUK74txcq8tyhLnHs7x3wXpJbs/FLXky0t1Uu6RSK1xgimIHN4DmlEbzaSPzPvBTVrZ86HLrL/nGkIxhBTxhsDtgxghUlxKmw3qycIWPvHY4VabOHNFFl4Zma4TDE7+evIjvZto2Pkt9lJCllmWHjmOpWEJfAi6K/ZSfIMWXhzUr6zfy/xogWw7N9o0T9K2BuZlyRvUcV5ociEODMRhFSg5S/hkaGXWWZAWi6h2hDvxH3EUGsukgjA/39lSpGvs0Q5cuMZY5DJeXlqP4x7vAxKhGU7kKA89aso4W31KtGCKA2nMBGDzE2YrH488wlyNsCFPPT0/dR/kR0i86KEDnlgKGG0JPe0IJ/0JoxR4TLEaucrqA2IU6Dn5XCFaE2UJGKsZDbPaj+MS7ycECQGG1mSPJWG5A5q/1abjvlv19sf09Dx/7F1KP4YlGf37sryhNIZtzj5iqi/8FKgLm0zwj9BtL8BWcG/jtVfP5ZBoP0ZLnQTUA4eBv4R47T4hnInSMwuCZvibyKzN0KIZmfmSI6oRfIkU1LWMt92RcgzMJTlAYl7a0YoincEzpv5gSCY+SWhRf0sGMz8lwhuDfK7iapx5wXg9xLsVwXRwzf6GkHOhwXf5T9KCUzNW7efdWB7JBRQtE2/NGX076quccKp+WSKvYqRmyz8g0a7QTV/vPQeDUN2htMKeHsisL5UEPjVwTdc2FW8GBPDmPKs//BNFPzYGGm86bwyRveSmG8MFLJWb9lYxbiw3mlsOc2qXLCk8cmVMYoYCp7LnO/+QCa0O0MJN/vwEm/K";
      S = S + 'sdodw4XbsmRUo0b/B+RdUQgjgmjEIBZxiEcCEpGEZKQgH/IHgqFwJBqLJ5KpdCabyxeKpXKlWqs3mq12p9vrD4aj8WSqarphWrbjerP5Yrlab7a7/eF4Ol+uLPxaieC9oAcNTMcgwlPZQjHHBshgPDLDInnbQTS/Pc/trgXt89kOAllUlBQIFO+z8pWYel4ajixtDidz5eQk1kTl3DCpgFG0O8N5OTLCpWxNGbem6s5iMUc41508bTMD96r2DBdsS4QybPfFYxdijSGOXJCiOy8hH3nhmndXk1p+dHocAzUc9iQy2ED+NMEcUjjgLiHVU0F5qg4x4QWxthAjTzCP8t1p3CJNR7c7st7Kvd8Pt31VZWrZuZuzRnQkwQ+6KzDieUkc1raWJzqwVuAF1Fvw9JuKKPRRVLhQQWxN5AJ5Hw6nUZ6dt+eMdFpJErEp5eZYy1Gh0nDaDdpqWqWFqh08M4UG+hLrkNNpacbD3/15a6d1vhy7BwA="},2487:function(e){"use strict";e.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjA5IiBoZWlnaHQ9IjM2IiB2aWV3Qm94PSIwIDAgMjA5IDM2IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMTkyLjk5MyAyMy42NTgyVjE1LjcxMTdIMTc5LjQ1MkwxNzEuNTA1IDIzLjY1ODJIMTkyLjk5M1oiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTIwOC4yNSAzLjk1MDgxSDE5MS4yNzZMMTgzLjI2NiAxMS44OTczSDIwOC4yNVYzLjk1MDgxWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMTYzLjYyMiAzMS42MDQ4TDE2Ny42OTEgMjcuNTM2MUgxODEuNDIzVjM1LjQ4MjdIMTYzLjYyMlYzMS42MDQ4WiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMTY2LjYxIDE5Ljc4MDNIMTc1LjM4M0wxODMuMzkzIDExLjgzMzdIMTY2LjYxVjE5Ljc4MDNaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0xNTcuMDExIDMxLjYwNDdIMTYzLjYyMkwxNzEuNTA1IDIzLjY1ODJIMTU3LjAxMVYzMS42MDQ3WiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMTkxLjI3NiAzLjk1MDgxTDE4Ny4yMDggOC4wMTk0MUgxNjEuMjdWMC4wNzI4NzZIMTkxLjI3NlYzLjk1MDgxWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjAuODM5MSAzMC4yMDYxSDguMzc4OTJMNi4yMTc0NSAzNS41NDYySDAuNzUwMjQ0TDEyLjI1NjggOC41OTE1NUgxNy4wMjQ3TDI4LjUzMTMgMzUuNTQ2MkgyMy4wMDA1TDIwLjgzOTEgMzAuMjA2MVpNMTkuMTIyNyAyNS45NDY4TDE0LjYwOSAxNC45NDg4TDEwLjA5NTQgMjUuOTQ2OEgxOS4xMjI3WiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMTA0LjQzNyAxOC41MDg5QzEwNi4wMjYgMTYuMTU2NyAxMTAuMDMxIDE1LjkwMjQgMTExLjY4NCAxNS45MDI0VjIwLjQ3OTZDMTA5LjY1IDIwLjQ3OTYgMTA3LjYxNSAyMC41NDMyIDEwNi40MDcgMjEuNDMzMkMxMDUuMiAyMi4zMjMyIDEwNC41NjQgMjMuNTMxMSAxMDQuNTY0IDI0Ljk5MzJWMzUuNTQ2Mkg5OS42MDUxVjE1LjkwMjRIMTA0LjM3M0wxMDQuNDM3IDE4LjUwODlaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0xMT';
      S = S + "kuMzc2IDE1LjkwMjRIMTE0LjQxOFYzNS41NDYySDExOS4zNzZWMTUuOTAyNFoiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTExOS4zNzYgNy4xMjkzOUgxMTQuNDE4VjEyLjk3OEgxMTkuMzc2VjcuMTI5MzlaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0xNDMuOTc5IDcuMTI5MzlWMzUuNTQ2MkgxMzkuMjExTDEzOS4wODQgMzIuNTU4M0MxMzguMzg0IDMzLjU3NTUgMTM3LjQ5NCAzNC40MDE5IDEzNi40MTQgMzUuMDM3NkMxMzUuMzMzIDM1LjYwOTggMTMzLjk5OCAzNS45Mjc2IDEzMi40NzIgMzUuOTI3NkMxMzEuMTM3IDM1LjkyNzYgMTI5Ljg2NiAzNS42NzMzIDEyOC43ODUgMzUuMjI4M0MxMjcuNjQxIDM0LjcxOTcgMTI2LjYyMyAzNC4wODQgMTI1Ljc5NyAzMy4xOTRDMTI0Ljk3MSAzMi4zMDQgMTI0LjI3MSAzMS4yMjMzIDEyMy44MjYgMzAuMDE1NEMxMjMuMzE4IDI4LjgwNzUgMTIzLjEyNyAyNy40MDkgMTIzLjEyNyAyNS44ODMyQzEyMy4xMjcgMjQuMzU3NSAxMjMuMzgxIDIyLjk1ODkgMTIzLjgyNiAyMS42ODc0QzEyNC4zMzUgMjAuNDE2IDEyNC45NzEgMTkuMzM1MyAxMjUuNzk3IDE4LjQ0NTNDMTI2LjYyMyAxNy41NTUyIDEyNy42NDEgMTYuODU2IDEyOC43ODUgMTYuMzQ3NEMxMjkuOTI5IDE1LjgzODggMTMxLjEzNyAxNS41ODQ1IDEzMi40NzIgMTUuNTg0NUMxMzMuOTk4IDE1LjU4NDUgMTM1LjI2OSAxNS44Mzg4IDEzNi4zNSAxNi40MTA5QzEzNy40MzEgMTYuOTgzMSAxMzguMzIxIDE3Ljc0NTkgMTM5LjAyIDE4LjgyNjdWNy4xOTI5NUgxNDMuOTc5VjcuMTI5MzlaTTEzMy41NTMgMzEuNjY4M0MxMzUuMjA2IDMxLjY2ODMgMTM2LjQ3NyAzMS4wOTYyIDEzNy40OTQgMzAuMDE1NEMxMzguNTExIDI4LjkzNDcgMTM5LjAyIDI3LjQ3MjUgMTM5LjAyIDI1LjY5MjVDMTM5LjAyIDIzLjkxMjUgMTM4LjUxMSAyMi41MTM5IDEzNy40OTQgMjEuMzY5NkMxMzYuNDc3IDIwLjI4ODggMTM1LjIwNiAxOS43MTY3IDEzMy41NTMgMTkuNzE2N0MxMzEuOTYzIDE5LjcxNjcgMTMwLjYyOCAyMC4yODg4IDEyOS42NzUgMjEuMzY5NkMxMjguNjU4IDIyLjQ1MDMgMTI4LjE0OSAyMy45MTI1IDEyOC4xNDkgMjUuNjkyNUMxMjguMTQ5IDI3LjQ3MjUgMTI4LjY1OCAyOC44NzExIDEyOS42NzUgMjkuOTUxOEMxMzAuNjkyIDMxLjA5NjEgMTMxLjk2MyAzMS42NjgzIDEzMy41NTMgMzEuNjY4M1oiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTU3LjIwMjQgMjAuMzUyNUg0NC45MzNWMjQuNjExOEg1MS45MjU5QzUxLjczNTIgMjYuNzczMyA1MC45MDg4IDI4LjQyNjEgNDkuNTEwMiAyOS43NjExQzQ4LjExMTYgMzEuMDMyNiA0Ni4zMzE1IDMxLjY2ODMgNDQuMDQyOSAzMS42NjgzQzQyLjc3MTUgMzEuNjY4MyA0MS41NjM2IDMxLjQxNCA0MC41NDY1IDMwLjk2OUMzOS40NjU3IDMwLjUyNCAzOC41NzU3IDI5Ljg4ODMgMzcuODEyOSAyOC45OTgzQzM3LjA1IDI4LjE3MTggMzYuNDc3OCAyNy4xNTQ3IDM2LjAzMjggMjUuOTQ2OEMzNS41ODc4ID";
      S = S + "I0LjczODkgMzUuMzk3MSAyMy40Njc1IDM1LjM5NzEgMjIuMDA1M0MzNS4zOTcxIDIwLjU0MzIgMzUuNTg3OCAxOS4yNzE3IDM2LjAzMjggMTguMDYzOEMzNi40MTQzIDE2Ljg1NiAzNy4wNSAxNS45MDI0IDM3LjgxMjkgMTUuMDEyNEMzOC41NzU3IDE0LjE4NTkgMzkuNDY1NyAxMy41NTAyIDQwLjU0NjUgMTMuMDQxNkM0MS42MjcyIDEyLjU5NjYgNDIuNzcxNSAxMi4zNDIzIDQ0LjEwNjUgMTIuMzQyM0M0Ni43NzY2IDEyLjM0MjMgNDguODEwOSAxMi45NzggNTAuMjA5NSAxNC4yNDk1TDUzLjUxNTIgMTAuOTQzOEM1MS4wMzU5IDkuMDM2NTkgNDcuODU3MyA4LjAxOTQxIDQ0LjEwNjUgOC4wMTk0MUM0Mi4wMDg2IDguMDE5NDEgNDAuMTAxNSA4LjMzNzI5IDM4LjM4NSA5LjAzNjU5QzM2LjY2ODYgOS43MzU4OCAzNS4yMDY0IDEwLjYyNTkgMzMuOTk4NSAxMS44MzM3QzMyLjc5MDYgMTMuMDQxNiAzMS44MzcxIDE0LjUwMzggMzEuMjAxNCAxNi4yMjAzQzMwLjU2NTYgMTcuOTM2NyAzMC4yNDc4IDE5Ljg0MzggMzAuMjQ3OCAyMS44NzgyQzMwLjI0NzggMjMuOTEyNSAzMC41NjU2IDI1LjgxOTcgMzEuMjY0OSAyNy41MzYxQzMxLjk2NDIgMjkuMjUyNiAzMi44NTQyIDMwLjcxNDcgMzQuMDYyMSAzMS45MjI2QzM1LjI3IDMzLjEzMDUgMzYuNzMyMSAzNC4wODQxIDM4LjQ0ODYgMzQuNzE5OEM0MC4xNjUgMzUuNDE5MSA0Mi4wNzIyIDM1LjczNyA0NC4xMDY1IDM1LjczN0M0Ni4xNDA4IDM1LjczNyA0Ny45ODQ0IDM1LjQxOTEgNDkuNjM3MyAzNC43MTk4QzUxLjI5MDIgMzQuMDIwNSA1Mi42ODg4IDMzLjEzMDUgNTMuODMzMSAzMS45MjI2QzU0Ljk3NzQgMzAuNzE0NyA1NS44Njc0IDI5LjI1MjYgNTYuNTAzMSAyNy41MzYxQzU3LjEzODggMjUuODE5NyA1Ny40NTY3IDIzLjkxMjUgNTcuNDU2NyAyMS44NzgyVjIxLjA1MTdDNTcuMjY2IDIwLjkyNDYgNTcuMjAyNCAyMC42MDY3IDU3LjIwMjQgMjAuMzUyNVoiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTk1Ljk4MTUgMjAuMzUyNUg4My43MTIxVjI0LjYxMThIOTAuNzA1QzkwLjUxNDMgMjYuNzczMyA4OS42ODc5IDI4LjQyNjEgODguMjg5MyAyOS43NjExQzg2Ljg5MDcgMzEuMDMyNiA4NS4xMTA2IDMxLjY2ODMgODIuODIyIDMxLjY2ODNDODEuNTUwNiAzMS42NjgzIDgwLjM0MjcgMzEuNDE0IDc5LjMyNTYgMzAuOTY5Qzc4LjI0NDggMzAuNTI0IDc3LjM1NDggMjkuODg4MyA3Ni41OTIgMjguOTk4M0M3NS44MjkxIDI4LjE3MTggNzUuMjU3IDI3LjE1NDcgNzQuODExOSAyNS45NDY4Qzc0LjM2NjkgMjQuNzM4OSA3NC4xNzYyIDIzLjQ2NzUgNzQuMTc2MiAyMi4wMDUzQzc0LjE3NjIgMjAuNTQzMiA3NC4zNjY5IDE5LjI3MTcgNzQuODExOSAxOC4wNjM4Qzc1LjE5MzQgMTYuODU2IDc1LjgyOTEgMTUuOTAyNCA3Ni41OTIgMTUuMDEyNEM3Ny4zNTQ4IDE0LjE4NTkgNzguMjQ0OCAxMy41NTAyIDc5LjMyNTYgMTMuMDQxNkM4MC40MDYzIDEyLjU5NjYgODEuNTUwNiAxMi4zNDIzIDgyLjg4NTYgMTIuMz";
      S = S + 'QyM0M4NS41NTU3IDEyLjM0MjMgODcuNTkgMTIuOTc4IDg4Ljk4ODYgMTQuMjQ5NUw5Mi4yOTQzIDEwLjk0MzhDODkuODE1IDkuMDM2NTkgODYuNjM2NCA4LjAxOTQxIDgyLjg4NTYgOC4wMTk0MUM4MC43ODc4IDguMDE5NDEgNzguODgwNiA4LjMzNzI5IDc3LjE2NDEgOS4wMzY1OUM3NS40NDc3IDkuNzM1ODggNzMuOTg1NSAxMC42MjU5IDcyLjc3NzYgMTEuODMzN0M3MS41Njk4IDEzLjA0MTYgNzAuNjE2MiAxNC41MDM4IDY5Ljk4MDUgMTYuMjIwM0M2OS4zNDQ3IDE3LjkzNjcgNjkuMDI2OSAxOS44NDM4IDY5LjAyNjkgMjEuODc4MkM2OS4wMjY5IDIzLjkxMjUgNjkuMzQ0NyAyNS44MTk3IDcwLjA0NCAyNy41MzYxQzcwLjc0MzMgMjkuMjUyNiA3MS42MzM0IDMwLjcxNDcgNzIuODQxMiAzMS45MjI2Qzc0LjA0OTEgMzMuMTMwNSA3NS41MTEyIDM0LjA4NDEgNzcuMjI3NyAzNC43MTk4Qzc4Ljk0NDEgMzUuNDE5MSA4MC44NTEzIDM1LjczNyA4Mi44ODU2IDM1LjczN0M4NC45MiAzNS43MzcgODYuNzYzNiAzNS40MTkxIDg4LjQxNjQgMzQuNzE5OEM5MC4wNjkzIDM0LjAyMDUgOTEuNDY3OSAzMy4xMzA1IDkyLjYxMjIgMzEuOTIyNkM5My43NTY1IDMwLjcxNDcgOTQuNjQ2NSAyOS4yNTI2IDk1LjI4MjIgMjcuNTM2MUM5NS45MTggMjUuODE5NyA5Ni4yMzU4IDIzLjkxMjUgOTYuMjM1OCAyMS44NzgyVjIxLjA1MTdDOTYuMDQ1MSAyMC45MjQ2IDk1Ljk4MTUgMjAuNjA2NyA5NS45ODE1IDIwLjM1MjVaIiBmaWxsPSIjOUI5QjlCIi8+Cjwvc3ZnPgo="},7249:function(e){"use strict";e.exports="data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMS41Ij48cGF0aCBkPSJNNS4zIDlhMy43IDMuNyAwIDEgMCAwLTcuNSAzLjcgMy43IDAgMCAwIDAgNy41Wk0xMC41IDEwLjUgOC4zIDguMiIvPjwvc3ZnPg=="},6080:function(e){"use strict";e.exports=\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="4" height="4"><rect x="0" y="0" width="4" height="4" fill="%23fff"/><path d="M0 0H2V4H4V2H0Z" fill="%23b2b2b2"/></svg>\'},5608:function(e,t,a){"use strict";a.r(t),a.d(t,{__addDisposableResource:function(){return I},__assign:function(){return r},__asyncDelegator:function(){return R},__asyncGenerator:function(){return x},__asyncValues:function(){return z},__await:function(){return k},__awaiter:function(){return p},__classPrivateFieldGet:function(){return P},__cl';
      S = S + 'assPrivateFieldIn:function(){return T},__classPrivateFieldSet:function(){return A},__createBinding:function(){return f},__decorate:function(){return s},__disposeResources:function(){return O},__esDecorate:function(){return c},__exportStar:function(){return v},__extends:function(){return o},__generator:function(){return m},__importDefault:function(){return E},__importStar:function(){return D},__makeTemplateObject:function(){return F},__metadata:function(){return u},__param:function(){return l},__propKey:function(){return d},__read:function(){return C},__rest:function(){return i},__runInitializers:function(){return g},__setFunctionName:function(){return h},__spread:function(){return w},__spreadArray:function(){return S},__spreadArrays:function(){return y},__values:function(){return b}});var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])},n(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function a(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(a.prototype=t.prototype,new a)}var r=function(){return r=Object.assign||function(e){for(var t,a=1,n=arguments.length;a<n;a++)for(var o in t=arguments[a])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};function i(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(a[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(a[n[o]]=e[n[o]])}return a}function s(e,t,a,n){var o,r=arguments.length,i=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,a):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,a,n);else for(var ';
      S = S + 's=e.length-1;s>=0;s--)(o=e[s])&&(i=(r<3?o(i):r>3?o(t,a,i):o(t,a))||i);return r>3&&i&&Object.defineProperty(t,a,i),i}function l(e,t){return function(a,n){t(a,n,e)}}function c(e,t,a,n,o,r){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",g=!t&&e?n.static?e:e.prototype:null,d=t||(g?Object.getOwnPropertyDescriptor(g,n.name):{}),h=!1,u=a.length-1;u>=0;u--){var p={};for(var m in n)p[m]="access"===m?{}:n[m];for(var m in n.access)p.access[m]=n.access[m];p.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");r.push(i(e||null))};var f=(0,a[u])("accessor"===l?{get:d.get,set:d.set}:d[c],p);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(s=i(f.get))&&(d.get=s),(s=i(f.set))&&(d.set=s),(s=i(f.init))&&o.unshift(s)}else(s=i(f))&&("field"===l?o.unshift(s):d[c]=s)}g&&Object.defineProperty(g,n.name,d),h=!0}function g(e,t,a){for(var n=arguments.length>2,o=0;o<t.length;o++)a=n?t[o].call(e,a):t[o].call(e);return n?a:void 0}function d(e){return"symbol"==typeof e?e:"".concat(e)}function h(e,t,a){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:a?"".concat(a," ",t):t})}function u(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function p(e,t,a,n){return new(a||(a=Promise))((function(o,r){function i(e){try{l(n.next(e))}catch(e){r(e)}}function s(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(i,s)}l((n=n.apply(e,t||[])).next())}))}function m(e,t){var a,n,o,r,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return ';
      S = S + 'this}),r;function s(s){return function(l){return function(s){if(a)throw new TypeError("Generator is already executing.");for(;r&&(r=0,s[0]&&(i=0)),i;)try{if(a=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,n=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],n=0}finally{a=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}var f=Object.create?function(e,t,a,n){void 0===n&&(n=a);var o=Object.getOwnPropertyDescriptor(t,a);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,n,o)}:function(e,t,a,n){void 0===n&&(n=a),e[n]=t[a]};function v(e,t){for(var a in e)"default"===a||Object.prototype.hasOwnProperty.call(t,a)||f(t,e,a)}function b(e){var t="function"==typeof Symbol&&Symbol.iterator,a=t&&e[t],n=0;if(a)return a.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function C(e,t){var a="function"==typeof Symbol&&e[Symbol.iterator];if(!a)return e;var n,o,r=a.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=r.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(o)throw o.error}}return i}function w(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(C(arguments[t]));return e}function y(){for(var e=0,t=0,a=arguments.length;t<a;t++)e+=arguments[t].length;va';
      S = S + 'r n=Array(e),o=0;for(t=0;t<a;t++)for(var r=arguments[t],i=0,s=r.length;i<s;i++,o++)n[o]=r[i];return n}function S(e,t,a){if(a||2===arguments.length)for(var n,o=0,r=t.length;o<r;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}function k(e){return this instanceof k?(this.v=e,this):new k(e)}function x(e,t,a){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=a.apply(e,t||[]),r=[];return n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n;function i(e){o[e]&&(n[e]=function(t){return new Promise((function(a,n){r.push([e,t,a,n])>1||s(e,t)}))})}function s(e,t){try{(a=o[e](t)).value instanceof k?Promise.resolve(a.value.v).then(l,c):g(r[0][2],a)}catch(e){g(r[0][3],e)}var a}function l(e){s("next",e)}function c(e){s("throw",e)}function g(e,t){e(t),r.shift(),r.length&&s(r[0][0],r[0][1])}}function R(e){var t,a;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,o){t[n]=e[n]?function(t){return(a=!a)?{value:k(e[n](t)),done:!1}:o?o(t):t}:o}}function z(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,a=e[Symbol.asyncIterator];return a?a.call(e):(e=b(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(a){t[a]=e[a]&&function(t){return new Promise((function(n,o){(function(e,t,a,n){Promise.resolve(n).then((function(t){e({value:t,done:a})}),t)})(n,o,(t=e[a](t)).done,t.value)}))}}}function F(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var M=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function D(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&f(t,e,a);return M(t,e),t}function E(e){return e&&e.';
      S = S + '__esModule?e:{default:e}}function P(e,t,a,n){if("a"===a&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===a?n:"a"===a?n.call(e):n?n.value:t.get(e)}function A(e,t,a,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,a):o?o.value=a:t.set(e,a),a}function T(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use \'in\' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function I(e,t,a){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var n;if(a){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose]}if("function"!=typeof n)throw new TypeError("Object not disposable.");e.stack.push({value:t,dispose:n,async:a})}else a&&e.stack.push({async:!0});return t}var L="function"==typeof SuppressedError?SuppressedError:function(e,t,a){var n=new Error(a);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function O(e){function t(t){e.error=e.hasError?new L(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}return function a(){for(;e.stack.length;){var n=e.stack.pop();try{var o=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(o).then(a,(function(e){return t(e),a()}))}catch(e){t(e)}}if(e.hasError)throw e.error}()}t.default={__extends:o,__assign:r,__rest:i,__decorate:s,__param:l,__metadata:u,__awaiter:p,__generator:m,__createBinding:f,__exportStar:v,__val';
      S = S + 'ues:b,__read:C,__spread:w,__spreadArrays:y,__spreadArray:S,__await:k,__asyncGenerator:x,__asyncDelegator:R,__asyncValues:z,__makeTemplateObject:F,__importStar:D,__importDefault:E,__classPrivateFieldGet:P,__classPrivateFieldSet:A,__classPrivateFieldIn:T,__addDisposableResource:I,__disposeResources:O}}},t={};function a(n){var o=t[n];if(void 0!==o)return o.exports;var r=t[n]={id:n,exports:{}};return e[n](r,r.exports,a),r.exports}return a.m=e,a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,{a:t}),t},a.d=function(e,t){for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.b=document.baseURI||self.location.href,a.nc=void 0,a(6387)}()}));' + "\r\n";
      Result = S;
      return Result;
    };
    this.GlobalVariableName = function () {
      var Result = "";
      Result = "agGrid";
      return Result;
    };
  });
  $mod.$init = function () {
    pas["WEBLib.DataGrid.libjs"].TTMSModuleLoader.RegisterEmbeddedJavaScript($mod.TEmbeddedJSAgGrid.$create("Create"));
  };
});
rtl.module("WEBLib.DataGrid.liblocale",["System","Classes","Web","JS","WEBLib.Controls","Types","SysUtils","jsdelphisystem","WEBLib.DataGrid.libjs"],function () {
  "use strict";
  var $mod = this;
  rtl.createClass(this,"TEmbeddedJSAgGridLocale",pas["WEBLib.DataGrid.libjs"].TEmbeddedJavaScript,function () {
    this.ModuleName = function () {
      var Result = "";
      Result = this.$classname;
      return Result;
    };
    this.Source = function () {
      var Result = "";
      var S = "";
      S = "";
      S = S + '(function(o,i){var r=typeof exports=="object";if(typeof define=="function"&&define.amd)define([],i);else if(typeof module=="object"&&module.exports)module.exports=i();else{var n=i(),C=r?exports:o;for(var d in n)C[d]=n[d]}})(typeof self<"u"?self:this,()=>{var o={},i={exports:o},r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,C=Object.getOwnPropertyNames,d=Object.prototype.hasOwnProperty,E=(e,u)=>{for(var t in u)r(e,t,{get:u[t],enumerable:!0})},D=(e,u,t,l)=>{if(u&&typeof u=="object"||typeof u=="function")for(let a of C(u))!d.call(e,a)&&a!==t&&r(e,a,{get:()=>u[a],enumerable:!(l=n(u,a))||l.enumerable});return e},F=e=>D(r({},"__esModule",{value:!0}),e),s={};E(s,{AG_GRID_LOCALE_BG:()=>B,AG_GRID_LOCALE_BR:()=>O,AG_GRID_LOCALE_CN:()=>P,AG_GRID_LOCALE_CZ:()=>p,AG_GRID_LOCALE_DE:()=>g,AG_GRID_LOCALE_DK:()=>m,AG_GRID_LOCALE_EG:()=>A,AG_GRID_LOCALE_EN:()=>c,AG_GRID_LOCALE_ES:()=>V,AG_GRID_LOCALE_FI:()=>v,AG_GRID_LOCALE_FR:()=>h,AG_GRID_LOCALE_GR:()=>x,AG_GRID_LOCALE_HK:()=>f,AG_GRID_LOCALE_HR:()=>T,AG_GRID_LOCALE_HU:()=>S,AG_GRID_LOCALE_IL:()=>b,AG_GRID_LOCALE_IR:()=>G,AG_GRID_LOCALE_IT:()=>k,AG_GRID_LOCALE_JP:()=>y,AG_GRID_LOCALE_KR:()=>M,AG_GRID_LOCALE_NL:()=>z,AG_GRID_LOCALE_NO:()=>L,AG_GRID_LOCALE_PK:()=>K,AG_GRID_LOCALE_PL:()=>Y,AG_GRID_LOCALE_PT:()=>w,AG_GRID_LOCALE_RO:()=>I,AG_GRID_LOCALE_SE:()=>j,AG_GRID_LOCALE_SK:()=>N,AG_GRID_LOCALE_TR:()=>H,AG_GRID_LOCALE_TW:()=>R,AG_GRID_LOCALE_UA:()=>q,AG_GRID_LOCALE_VN:()=>Z}),i.exports=F(s);var c={selectAll:"(Select All)",selectAllSearchResults:"(Select All Search Results)",addCurrentSelectionToFilter:"Add current selection to filter",searchOoo:"Search...",blanks:"(Blanks)",noMatches:"No matches",filterOoo:"Filter...",equals:"Equals",notEqual:"Does not equal",blank:"Blank",notBlank:"Not blank",empty:"Choose one",lessThan:"Less than",greaterThan:"Greater than",lessThanOrEqual:"Less than or equal to",greaterThanOrEqual:"Greater than or equal to",inRange:"Between",inRangeStart:"From",inRangeEnd:"To",contains:"Contains",not';
      S = S + 'Contains:"Does not contain",startsWith:"Begins with",endsWith:"Ends with",dateFormatOoo:"yyyy-mm-dd",before:"Before",after:"After",andCondition:"AND",orCondition:"OR",applyFilter:"Apply",resetFilter:"Reset",clearFilter:"Clear",cancelFilter:"Cancel",textFilter:"Text Filter",numberFilter:"Number Filter",dateFilter:"Date Filter",setFilter:"Set Filter",groupFilterSelect:"Select field:",advancedFilterContains:"contains",advancedFilterNotContains:"does not contain",advancedFilterTextEquals:"equals",advancedFilterTextNotEqual:"does not equal",advancedFilterStartsWith:"begins with",advancedFilterEndsWith:"ends with",advancedFilterBlank:"is blank",advancedFilterNotBlank:"is not blank",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"is true",advancedFilterFalse:"is false",advancedFilterAnd:"AND",advancedFilterOr:"OR",advancedFilterApply:"Apply",advancedFilterBuilder:"Builder",advancedFilterValidationMissingColumn:"Column is missing",advancedFilterValidationMissingOption:"Option is missing",advancedFilterValidationMissingValue:"Value is missing",advancedFilterValidationInvalidColumn:"Column not found",advancedFilterValidationInvalidOption:"Option not found",advancedFilterValidationMissingQuote:"Value is missing an end quote",advancedFilterValidationNotANumber:"Value is not a number",advancedFilterValidationInvalidDate:"Value is not a valid date",advancedFilterValidationMissingCondition:"Condition is missing",advancedFilterValidationJoinOperatorMismatch:"Join operators within a condition must be the same",advancedFilterValidationInvalidJoinOperator:"Join operator not found",advancedFilterValidationMissingEndBracket:"Missing end bracket",advancedFilterValidationExtraEndBracket:"Too many end brackets",advancedFilterValidationMessage:"Expression has an error. ${variable} - ${variable}.",advancedFilterValidationMessageAtEnd:"Expr';
      S = S + 'ession has an error. ${variable} at end of expression.",advancedFilterBuilderTitle:"Advanced Filter",advancedFilterBuilderApply:"Apply",advancedFilterBuilderCancel:"Cancel",advancedFilterBuilderAddButtonTooltip:"Add Filter or Group",advancedFilterBuilderRemoveButtonTooltip:"Remove",advancedFilterBuilderMoveUpButtonTooltip:"Move Up",advancedFilterBuilderMoveDownButtonTooltip:"Move Down",advancedFilterBuilderAddJoin:"Add Group",advancedFilterBuilderAddCondition:"Add Filter",advancedFilterBuilderSelectColumn:"Select a column",advancedFilterBuilderSelectOption:"Select an option",advancedFilterBuilderEnterValue:"Enter a value...",advancedFilterBuilderValidationAlreadyApplied:"Current filter already applied.",advancedFilterBuilderValidationIncomplete:"Not all conditions are complete.",advancedFilterBuilderValidationSelectColumn:"Must select a column.",advancedFilterBuilderValidationSelectOption:"Must select an option.",advancedFilterBuilderValidationEnterValue:"Must enter a value.",columns:"Columns",filters:"Filters",pivotMode:"Pivot Mode",groups:"Row Groups",rowGroupColumnsEmptyMessage:"Drag here to set row groups",values:"Values",valueColumnsEmptyMessage:"Drag here to aggregate",pivots:"Column Labels",pivotColumnsEmptyMessage:"Drag here to set column labels",group:"Group",rowDragRow:"row",rowDragRows:"rows",loadingOoo:"Loading...",loadingError:"ERR",noRowsToShow:"No Rows To Show",enabled:"Enabled",pinColumn:"Pin Column",pinLeft:"Pin Left",pinRight:"Pin Right",noPin:"No Pin",valueAggregation:"Value Aggregation",noAggregation:"None",autosizeThisColumn:"Autosize This Column",autosizeAllColumns:"Autosize All Columns",groupBy:"Group by",ungroupBy:"Un-Group by",ungroupAll:"Un-Group All",addToValues:"Add ${variable} to values",removeFromValues:"Remove ${variable} from values",addToLabels:"Add ${variable} to labels",removeFromLabels:"Remove ${variable} from labels",resetColumns:"Reset Columns",expandAll:"Expand All Row Groups",collapseAll:"Close All Row Groups",copy:"Copy",ctrl';
      S = S + 'C:"Ctrl+C",ctrlX:"Ctrl+X",copyWithHeaders:"Copy With Headers",copyWithGroupHeaders:"Copy with Group Headers",cut:"Cut",paste:"Paste",ctrlV:"Ctrl+V",export:"Export",csvExport:"CSV Export",excelExport:"Excel Export",columnFilter:"Column Filter",columnChooser:"Choose Columns",sortAscending:"Sort Ascending",sortDescending:"Sort Descending",sortUnSort:"Clear Sort",sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",none:"None",count:"Count",avg:"Average",filteredRows:"Filtered",selectedRows:"Selected",totalRows:"Total Rows",totalAndFilteredRows:"Rows",more:"More",to:"to",of:"of",page:"Page",pageLastRowUnknown:"?",nextPage:"Next Page",lastPage:"Last Page",firstPage:"First Page",previousPage:"Previous Page",pageSizeSelectorLabel:"Page Size:",footerTotal:"Total",pivotColumnGroupTotals:"Total",pivotChartAndPivotMode:"Pivot Chart & Pivot Mode",pivotChart:"Pivot Chart",chartRange:"Chart Range",columnChart:"Column",groupedColumn:"Grouped",stackedColumn:"Stacked",normalizedColumn:"100% Stacked",barChart:"Bar",groupedBar:"Grouped",stackedBar:"Stacked",normalizedBar:"100% Stacked",pieChart:"Pie",pie:"Pie",donut:"Donut",line:"Line",xyChart:"X Y (Scatter)",scatter:"Scatter",bubble:"Bubble",areaChart:"Area",area:"Area",stackedArea:"Stacked",normalizedArea:"100% Stacked",histogramChart:"Histogram",polarChart:"Polar",radarLine:"Radar Line",radarArea:"Radar Area",nightingale:"Nightingale",radialColumn:"Radial Column",radialBar:"Radial Bar",statisticalChart:"Statistical",boxPlot:"Box Plot",rangeBar:"Range Bar",rangeArea:"Range Area",hierarchicalChart:"Hierarchical",treemap:"Treemap",sunburst:"Sunburst",specializedChart:"Specialized",waterfall:"Waterfall",heatmap:"Heatmap",combinationChart:"Combination",columnLineCombo:"Column & Line",AreaColumnCombo:"Area & Column",pivotChartTitle:"Pivot Chart",rangeChartTitle:"Range Chart",settings:"Chart",data:"Set Up",format:"Customize",categories:"Categories",defaultCategory:"(None)",series:"Series",switchCategorySeries:"Switch Category / Series"';
      S = S + ',categoryValues:"Category Values",seriesLabels:"Series Labels",aggregate:"Aggregate",xyValues:"X Y Values",paired:"Paired Mode",axis:"Axis",xAxis:"Horizontal Axis",yAxis:"Vertical Axis",polarAxis:"Polar Axis",radiusAxis:"Radius Axis",navigator:"Navigator",zoom:"Zoom",animation:"Animation",crosshair:"Crosshair",color:"Color",thickness:"Thickness",preferredLength:"Preferred Length",xType:"X Type",axisType:"Axis Type",automatic:"Automatic",category:"Category",number:"Number",time:"Time",timeFormat:"Time Format",autoRotate:"Auto Rotate",labelRotation:"Rotation",circle:"Circle",polygon:"Polygon",square:"Square",cross:"Cross",diamond:"Diamond",plus:"Plus",triangle:"Triangle",heart:"Heart",orientation:"Orientation",fixed:"Fixed",parallel:"Parallel",perpendicular:"Perpendicular",radiusAxisPosition:"Position",ticks:"Ticks",gridLines:"Grid Lines",width:"Width",height:"Height",length:"Length",padding:"Padding",spacing:"Spacing",chartStyle:"Chart Style",title:"Title",chartTitles:"Titles",chartTitle:"Chart Title",chartSubtitle:"Subtitle",horizontalAxisTitle:"Horizontal Axis Title",verticalAxisTitle:"Vertical Axis Title",polarAxisTitle:"Polar Axis Title",titlePlaceholder:"Chart Title",background:"Background",font:"Font",weight:"Weight",top:"Top",right:"Right",bottom:"Bottom",left:"Left",labels:"Labels",calloutLabels:"Callout Labels",sectorLabels:"Sector Labels",positionRatio:"Position Ratio",size:"Size",shape:"Shape",minSize:"Minimum Size",maxSize:"Maximum Size",legend:"Legend",position:"Position",markerSize:"Marker Size",markerStroke:"Marker Stroke",markerPadding:"Marker Padding",itemSpacing:"Item Spacing",itemPaddingX:"Item Padding X",itemPaddingY:"Item Padding Y",layoutHorizontalSpacing:"Horizontal Spacing",layoutVerticalSpacing:"Vertical Spacing",strokeWidth:"Stroke Width",offset:"Offset",offsets:"Offsets",tooltips:"Tooltips",callout:"Callout",markers:"Markers",shadow:"Shadow",blur:"Blur",xOffset:"X Offset",yOffset:"Y Offset",lineWidth:"Line Width",lineDash:"Line Dash",lineDa';
      S = S + 'shOffset:"Dash Offset",scrollingZoom:"Scrolling",scrollingStep:"Scrolling Step",selectingZoom:"Selecting",durationMillis:"Duration (ms)",crosshairLabel:"Label",crosshairSnap:"Snap to Node",normal:"Normal",bold:"Bold",italic:"Italic",boldItalic:"Bold Italic",predefined:"Predefined",fillOpacity:"Fill Opacity",strokeColor:"Line Color",strokeOpacity:"Line Opacity",miniChart:"Mini-Chart",histogramBinCount:"Bin count",connectorLine:"Connector Line",seriesItems:"Series Items",seriesItemType:"Item Type",seriesItemPositive:"Positive",seriesItemNegative:"Negative",seriesItemLabels:"Item Labels",columnGroup:"Column",barGroup:"Bar",pieGroup:"Pie",lineGroup:"Line",scatterGroup:"X Y (Scatter)",areaGroup:"Area",polarGroup:"Polar",statisticalGroup:"Statistical",hierarchicalGroup:"Hierarchical",specializedGroup:"Specialized",combinationGroup:"Combination",groupedColumnTooltip:"Grouped",stackedColumnTooltip:"Stacked",normalizedColumnTooltip:"100% Stacked",groupedBarTooltip:"Grouped",stackedBarTooltip:"Stacked",normalizedBarTooltip:"100% Stacked",pieTooltip:"Pie",donutTooltip:"Donut",lineTooltip:"Line",groupedAreaTooltip:"Area",stackedAreaTooltip:"Stacked",normalizedAreaTooltip:"100% Stacked",scatterTooltip:"Scatter",bubbleTooltip:"Bubble",histogramTooltip:"Histogram",radialColumnTooltip:"Radial Column",radialBarTooltip:"Radial Bar",radarLineTooltip:"Radar Line",radarAreaTooltip:"Radar Area",nightingaleTooltip:"Nightingale",rangeBarTooltip:"Range Bar",rangeAreaTooltip:"Range Area",boxPlotTooltip:"Box Plot",treemapTooltip:"Treemap",sunburstTooltip:"Sunburst",waterfallTooltip:"Waterfall",heatmapTooltip:"Heatmap",columnLineComboTooltip:"Column & Line",areaColumnComboTooltip:"Area & Column",customComboTooltip:"Custom Combination",innerRadius:"Inner Radius",startAngle:"Start Angle",endAngle:"End Angle",reverseDirection:"Reverse Direction",groupPadding:"Group Padding",seriesPadding:"Series Padding",tile:"Tile",whisker:"Whisker",cap:"Cap",capLengthRatio:"Length Ratio",labelPlacement:"Placeme';
      S = S + 'nt",inside:"Inside",outside:"Outside",noDataToChart:"No data available to be charted.",pivotChartRequiresPivotMode:"Pivot Chart requires Pivot Mode enabled.",chartSettingsToolbarTooltip:"Menu",chartLinkToolbarTooltip:"Linked to Grid",chartUnlinkToolbarTooltip:"Unlinked from Grid",chartDownloadToolbarTooltip:"Download Chart",chartMenuToolbarTooltip:"Menu",chartEdit:"Edit Chart",chartAdvancedSettings:"Advanced Settings",chartLink:"Link to Grid",chartUnlink:"Unlink from Grid",chartDownload:"Download Chart",histogramFrequency:"Frequency",seriesChartType:"Series Chart Type",seriesType:"Series Type",secondaryAxis:"Secondary Axis",seriesAdd:"Add a series",categoryAdd:"Add a category",bar:"Bar",column:"Column",histogram:"Histogram",advancedSettings:"Advanced Settings",direction:"Direction",horizontal:"Horizontal",vertical:"Vertical",seriesGroupType:"Group Type",groupedSeriesGroupType:"Grouped",stackedSeriesGroupType:"Stacked",normalizedSeriesGroupType:"100% Stacked",legendEnabled:"Enabled",invalidColor:"Color value is invalid",groupedColumnFull:"Grouped Column",stackedColumnFull:"Stacked Column",normalizedColumnFull:"100% Stacked Column",groupedBarFull:"Grouped Bar",stackedBarFull:"Stacked Bar",normalizedBarFull:"100% Stacked Bar",stackedAreaFull:"Stacked Area",normalizedAreaFull:"100% Stacked Area",customCombo:"Custom Combination",ariaAdvancedFilterBuilderItem:"${variable}. Level ${variable}. Press ENTER to edit",ariaAdvancedFilterBuilderItemValidation:"${variable}. Level ${variable}. ${variable} Press ENTER to edit",ariaAdvancedFilterBuilderList:"Advanced Filter Builder List",ariaAdvancedFilterBuilderFilterItem:"Filter Condition",ariaAdvancedFilterBuilderGroupItem:"Filter Group",ariaAdvancedFilterBuilderColumn:"Column",ariaAdvancedFilterBuilderOption:"Option",ariaAdvancedFilterBuilderValueP:"Value",ariaAdvancedFilterBuilderJoinOperator:"Join Operator",ariaAdvancedFilterInput:"Advanced Filter Input",ariaChecked:"checked",ariaColumn:"Column",ariaColumnGroup:"Column Group",a';
      S = S + 'riaColumnFiltered:"Column Filtered",ariaColumnSelectAll:"Toggle Select All Columns",ariaDateFilterInput:"Date Filter Input",ariaDefaultListName:"List",ariaFilterColumnsInput:"Filter Columns Input",ariaFilterFromValue:"Filter from value",ariaFilterInput:"Filter Input",ariaFilterList:"Filter List",ariaFilterToValue:"Filter to value",ariaFilterValue:"Filter Value",ariaFilterMenuOpen:"Open Filter Menu",ariaFilteringOperator:"Filtering Operator",ariaHidden:"hidden",ariaIndeterminate:"indeterminate",ariaInputEditor:"Input Editor",ariaMenuColumn:"Press ALT DOWN to open column menu",ariaFilterColumn:"Press CTRL ENTER to open filter",ariaRowDeselect:"Press SPACE to deselect this row",ariaRowSelectAll:"Press Space to toggle all rows selection",ariaRowToggleSelection:"Press Space to toggle row selection",ariaRowSelect:"Press SPACE to select this row",ariaRowSelectionDisabled:"Row Selection is disabled for this row",ariaSearch:"Search",ariaSortableColumn:"Press ENTER to sort",ariaToggleVisibility:"Press SPACE to toggle visibility",ariaToggleCellValue:"Press SPACE to toggle cell value",ariaUnchecked:"unchecked",ariaVisible:"visible",ariaSearchFilterValues:"Search filter values",ariaPageSizeSelectorLabel:"Page Size",ariaChartMenuClose:"Close Chart Edit Menu",ariaChartSelected:"Selected",ariaSkeletonCellLoadingFailed:"Row failed to load",ariaSkeletonCellLoading:"Row data is loading",ariaRowGroupDropZonePanelLabel:"Row Groups",ariaValuesDropZonePanelLabel:"Values",ariaPivotDropZonePanelLabel:"Column Labels",ariaDropZoneColumnComponentDescription:"Press DELETE to remove",ariaDropZoneColumnValueItemDescription:"Press ENTER to change the aggregation type",ariaDropZoneColumnGroupItemDescription:"Press ENTER to sort",ariaDropZoneColumnComponentAggFuncSeparator:" of ",ariaDropZoneColumnComponentSortAscending:"ascending",ariaDropZoneColumnComponentSortDescending:"descending",ariaLabelDialog:"Dialog",ariaLabelColumnMenu:"Column Menu",ariaLabelColumnFilter:"Column Filter",ariaLabelCellEdito';
      S = S + 'r:"Cell Editor",ariaLabelSelectField:"Select Field",ariaLabelRichSelectField:"Rich Select Field",ariaLabelRichSelectToggleSelection:"Press SPACE to toggle selection",ariaLabelRichSelectDeselectAllItems:"Press DELETE to deselect all items",ariaLabelRichSelectDeleteSelection:"Press DELETE to deselect item",ariaLabelTooltip:"Tooltip",ariaLabelContextMenu:"Context Menu",ariaLabelSubMenu:"SubMenu",ariaLabelAggregationFunction:"Aggregation Function",ariaLabelAdvancedFilterAutocomplete:"Advanced Filter Autocomplete",ariaLabelAdvancedFilterBuilderAddField:"Advanced Filter Builder Add Field",ariaLabelAdvancedFilterBuilderColumnSelectField:"Advanced Filter Builder Column Select Field",ariaLabelAdvancedFilterBuilderOptionSelectField:"Advanced Filter Builder Option Select Field",ariaLabelAdvancedFilterBuilderJoinSelectField:"Advanced Filter Builder Join Operator Select Field",ariaColumnPanelList:"Column List",ariaFilterPanelList:"Filter List",thousandSeparator:",",decimalSeparator:".",true:"True",false:"False",invalidDate:"Invalid Date",invalidNumber:"Invalid Number",january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December",timeFormatSlashesDDMMYYYY:"DD/MM/YYYY",timeFormatSlashesMMDDYYYY:"MM/DD/YYYY",timeFormatSlashesDDMMYY:"DD/MM/YY",timeFormatSlashesMMDDYY:"MM/DD/YY",timeFormatDotsDDMYY:"DD.M.YY",timeFormatDotsMDDYY:"M.DD.YY",timeFormatDashesYYYYMMDD:"YYYY-MM-DD",timeFormatSpacesDDMMMMYYYY:"DD MMMM YYYY",timeFormatHHMMSS:"HH:MM:SS",timeFormatHHMMSSAmPm:"HH:MM:SS AM/PM"},A={selectAll:"(\\u062A\\u062D\\u062F\\u064A\\u062F \\u0627\\u0644\\u0643\\u0644)",selectAllSearchResults:"(\\u062A\\u062D\\u062F\\u064A\\u062F \\u0643\\u0644 \\u0646\\u062A\\u0627\\u0626\\u062C \\u0627\\u0644\\u0628\\u062D\\u062B)",addCurrentSelectionToFilter:"\\u0625\\u0636\\u0627\\u0641\\u0629 \\u0627\\u0644\\u062A\\u062D\\u062F\\u064A\\u062F \\u0627\\u0644\\u062D\\u0627\\u0644\\u064A \\u0625\\u0644\\u0649 \\u0627\\u0644';
      S = S + '\\u0641\\u0644\\u062A\\u0631",searchOoo:"\\u0628\\u062D\\u062B...",blanks:"(\\u0641\\u0627\\u0631\\u063A)",noMatches:"\\u0644\\u0627 \\u062A\\u0648\\u062C\\u062F \\u062A\\u0637\\u0627\\u0628\\u0642\\u0627\\u062A",filterOoo:"\\u062A\\u0635\\u0641\\u064A\\u0629...",equals:"\\u064A\\u0633\\u0627\\u0648\\u064A",notEqual:"\\u0644\\u0627 \\u064A\\u0633\\u0627\\u0648\\u064A",blank:"\\u0641\\u0627\\u0631\\u063A",notBlank:"\\u0644\\u064A\\u0633 \\u0641\\u0627\\u0631\\u063A",empty:"\\u0627\\u062E\\u062A\\u0631 \\u0648\\u0627\\u062D\\u062F",lessThan:"\\u0623\\u0642\\u0644 \\u0645\\u0646",greaterThan:"\\u0623\\u0643\\u0628\\u0631 \\u0645\\u0646",lessThanOrEqual:"\\u0623\\u0642\\u0644 \\u0645\\u0646 \\u0623\\u0648 \\u064A\\u0633\\u0627\\u0648\\u064A",greaterThanOrEqual:"\\u0623\\u0643\\u0628\\u0631 \\u0645\\u0646 \\u0623\\u0648 \\u064A\\u0633\\u0627\\u0648\\u064A",inRange:"\\u0628\\u064A\\u0646",inRangeStart:"\\u0645\\u0646",inRangeEnd:"\\u0625\\u0644\\u0649",contains:"\\u064A\\u062D\\u062A\\u0648\\u064A \\u0639\\u0644\\u0649",notContains:"\\u0644\\u0627 \\u064A\\u062D\\u062A\\u0648\\u064A \\u0639\\u0644\\u0649",startsWith:"\\u064A\\u0628\\u062F\\u0623 \\u0628\\u0640",endsWith:"\\u064A\\u0646\\u062A\\u0647\\u064A \\u0628\\u0640",dateFormatOoo:"yyyy-mm-dd",before:"\\u0642\\u0628\\u0644",after:"\\u0628\\u0639\\u062F",andCondition:"\\u0648",orCondition:"\\u0623\\u0648",applyFilter:"\\u062A\\u0637\\u0628\\u064A\\u0642",resetFilter:"\\u0625\\u0639\\u0627\\u062F\\u0629 \\u062A\\u0639\\u064A\\u064A\\u0646",clearFilter:"\\u0645\\u0633\\u062D",cancelFilter:"\\u0625\\u0644\\u063A\\u0627\\u0621",textFilter:"\\u0641\\u0644\\u062A\\u0631 \\u0627\\u0644\\u0646\\u0635",numberFilter:"\\u0641\\u0644\\u062A\\u0631 \\u0627\\u0644\\u0623\\u0631\\u0642\\u0627\\u0645",dateFilter:"\\u0641\\u0644\\u062A\\u0631 \\u0627\\u0644\\u062A\\u0627\\u0631\\u064A\\u062E",setFilter:"\\u0641\\u0644\\u062A\\u0631 \\u0627\\u0644\\u0645\\u062C\\u0645\\u0648\\u0639\\u0629",groupFilterSelect:"\\u0627\\u062E\\u062A\\u0631 \\u0627\\u0644\\u062D\\u0642\\u0644:",advancedFilterContains:"\\u064A\\u062D\\u062A\\u0648\\u064A \\u0639\\u0644\\u0649",advancedFilterNotContains:"\\u0644\\u0627 \\u064A\\u062D\\u062A\\u0648\\u064A \\u0639\\u0644\\u0649",advancedFilt';
      S = S + 'erTextEquals:"\\u064A\\u0633\\u0627\\u0648\\u064A",advancedFilterTextNotEqual:"\\u0644\\u0627 \\u064A\\u0633\\u0627\\u0648\\u064A",advancedFilterStartsWith:"\\u064A\\u0628\\u062F\\u0623 \\u0628\\u0640",advancedFilterEndsWith:"\\u064A\\u0646\\u062A\\u0647\\u064A \\u0628\\u0640",advancedFilterBlank:"\\u0641\\u0627\\u0631\\u063A",advancedFilterNotBlank:"\\u063A\\u064A\\u0631 \\u0641\\u0627\\u0631\\u063A",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"\\u0635\\u062D\\u064A\\u062D",advancedFilterFalse:"\\u062E\\u0627\\u0637\\u0626",advancedFilterAnd:"\\u0648",advancedFilterOr:"\\u0623\\u0648",advancedFilterApply:"\\u062A\\u0637\\u0628\\u064A\\u0642",advancedFilterBuilder:"\\u0627\\u0644\\u0645\\u0646\\u0634\\u0626",advancedFilterValidationMissingColumn:"\\u0627\\u0644\\u0639\\u0645\\u0648\\u062F \\u0645\\u0641\\u0642\\u0648\\u062F",advancedFilterValidationMissingOption:"\\u0627\\u0644\\u062E\\u064A\\u0627\\u0631 \\u0645\\u0641\\u0642\\u0648\\u062F",advancedFilterValidationMissingValue:"\\u0627\\u0644\\u0642\\u064A\\u0645\\u0629 \\u0645\\u0641\\u0642\\u0648\\u062F\\u0629",advancedFilterValidationInvalidColumn:"\\u0627\\u0644\\u0639\\u0645\\u0648\\u062F \\u063A\\u064A\\u0631 \\u0645\\u0648\\u062C\\u0648\\u062F",advancedFilterValidationInvalidOption:"\\u0627\\u0644\\u062E\\u064A\\u0627\\u0631 \\u063A\\u064A\\u0631 \\u0645\\u0648\\u062C\\u0648\\u062F",advancedFilterValidationMissingQuote:"\\u0627\\u0644\\u0642\\u064A\\u0645\\u0629 \\u062A\\u0641\\u062A\\u0642\\u062F \\u0639\\u0644\\u0627\\u0645\\u0629 \\u0627\\u0644\\u0627\\u0642\\u062A\\u0628\\u0627\\u0633 \\u0627\\u0644\\u0646\\u0647\\u0627\\u0626\\u064A\\u0629",advancedFilterValidationNotANumber:"\\u0627\\u0644\\u0642\\u064A\\u0645\\u0629 \\u0644\\u064A\\u0633\\u062A \\u0631\\u0642\\u0645\\u0627\\u064B",advancedFilterValidationInvalidDate:"\\u0627\\u0644\\u0642\\u064A\\u0645\\u0629 \\u0644\\u064A\\u0633\\u062A \\u062A\\u0627\\u0631\\u064A\\u062E\\u0627\\u064B \\u0635\\u062D\\u064A\\u062D\\u0627\\u064B",advancedFilterValidationMissingCondition:"\\u0627\\u064';
      S = S + '4\\u0634\\u0631\\u0637 \\u0645\\u0641\\u0642\\u0648\\u062F",advancedFilterValidationJoinOperatorMismatch:"\\u064A\\u062C\\u0628 \\u0623\\u0646 \\u062A\\u0643\\u0648\\u0646 \\u0639\\u0648\\u0627\\u0645\\u0644 \\u0627\\u0644\\u0631\\u0628\\u0637 \\u062F\\u0627\\u062E\\u0644 \\u0627\\u0644\\u0634\\u0631\\u0637 \\u0646\\u0641\\u0633\\u0647\\u0627",advancedFilterValidationInvalidJoinOperator:"\\u0639\\u0627\\u0645\\u0644 \\u0627\\u0644\\u0631\\u0628\\u0637 \\u063A\\u064A\\u0631 \\u0645\\u0648\\u062C\\u0648\\u062F",advancedFilterValidationMissingEndBracket:"\\u0627\\u0644\\u0642\\u0648\\u0633 \\u0627\\u0644\\u062E\\u062A\\u0627\\u0645\\u064A \\u0645\\u0641\\u0642\\u0648\\u062F",advancedFilterValidationExtraEndBracket:"\\u0623\\u0642\\u0648\\u0627\\u0633 \\u062E\\u062A\\u0627\\u0645\\u064A\\u0629 \\u0643\\u062B\\u064A\\u0631\\u0629 \\u062C\\u062F\\u0627\\u064B",advancedFilterValidationMessage:"\\u0627\\u0644\\u062A\\u0639\\u0628\\u064A\\u0631 \\u064A\\u062D\\u062A\\u0648\\u064A \\u0639\\u0644\\u0649 \\u062E\\u0637\\u0623. ${variable} - ${variable}.",advancedFilterValidationMessageAtEnd:"\\u0627\\u0644\\u062A\\u0639\\u0628\\u064A\\u0631 \\u064A\\u062D\\u062A\\u0648\\u064A \\u0639\\u0644\\u0649 \\u062E\\u0637\\u0623. ${variable} \\u0641\\u064A \\u0646\\u0647\\u0627\\u064A\\u0629 \\u0627\\u0644\\u062A\\u0639\\u0628\\u064A\\u0631.",advancedFilterBuilderTitle:"\\u0639\\u0627\\u0645\\u0644 \\u062A\\u0635\\u0641\\u064A\\u0629 \\u0645\\u062A\\u0642\\u062F\\u0645",advancedFilterBuilderApply:"\\u062A\\u0637\\u0628\\u064A\\u0642",advancedFilterBuilderCancel:"\\u0625\\u0644\\u063A\\u0627\\u0621",advancedFilterBuilderAddButtonTooltip:"\\u0625\\u0636\\u0627\\u0641\\u0629 \\u0639\\u0627\\u0645\\u0644 \\u062A\\u0635\\u0641\\u064A\\u0629 \\u0623\\u0648 \\u0645\\u062C\\u0645\\u0648\\u0639\\u0629",advancedFilterBuilderRemoveButtonTooltip:"\\u0625\\u0632\\u0627\\u0644\\u0629",advancedFilterBuilderMoveUpButtonTooltip:"\\u062A\\u062D\\u0631\\u064A\\u0643 \\u0644\\u0644\\u0623\\u0639\\u0644\\u0649",advancedFilterBuilderMoveDownButtonTooltip:"\\u062A\\u062D\\u0631\\u064A\\u0643 \\u0644\\u0644\\u0623\\u0633\\u0641\\u0644",advancedFilterBuilderAddJoin:"\\u0625\\u0636\\u0627\\u0641\\u0629 \\u0645\\u062C\\u0645\\u0648\\u063';
      S = S + '9\\u0629",advancedFilterBuilderAddCondition:"\\u0625\\u0636\\u0627\\u0641\\u0629 \\u0639\\u0627\\u0645\\u0644 \\u062A\\u0635\\u0641\\u064A\\u0629",advancedFilterBuilderSelectColumn:"\\u0627\\u062E\\u062A\\u0631 \\u0639\\u0645\\u0648\\u062F\\u064B\\u0627",advancedFilterBuilderSelectOption:"\\u0627\\u062E\\u062A\\u0631 \\u062E\\u064A\\u0627\\u0631\\u064B\\u0627",advancedFilterBuilderEnterValue:"\\u0623\\u062F\\u062E\\u0644 \\u0642\\u064A\\u0645\\u0629...",advancedFilterBuilderValidationAlreadyApplied:"\\u0639\\u0627\\u0645\\u0644 \\u0627\\u0644\\u062A\\u0635\\u0641\\u064A\\u0629 \\u0627\\u0644\\u062D\\u0627\\u0644\\u064A \\u0645\\u064F\\u0637\\u0628\\u0651\\u064E\\u0642 \\u0628\\u0627\\u0644\\u0641\\u0639\\u0644.",advancedFilterBuilderValidationIncomplete:"\\u0644\\u0645 \\u064A\\u062A\\u0645 \\u0625\\u0643\\u0645\\u0627\\u0644 \\u0643\\u0644 \\u0627\\u0644\\u0634\\u0631\\u0648\\u0637.",advancedFilterBuilderValidationSelectColumn:"\\u064A\\u062C\\u0628 \\u0627\\u062E\\u062A\\u064A\\u0627\\u0631 \\u0639\\u0645\\u0648\\u062F.",advancedFilterBuilderValidationSelectOption:"\\u064A\\u062C\\u0628 \\u0627\\u062E\\u062A\\u064A\\u0627\\u0631 \\u062E\\u064A\\u0627\\u0631.",advancedFilterBuilderValidationEnterValue:"\\u064A\\u062C\\u0628 \\u0625\\u062F\\u062E\\u0627\\u0644 \\u0642\\u064A\\u0645\\u0629.",columns:"\\u0623\\u0639\\u0645\\u062F\\u0629",filters:"\\u0645\\u0631\\u0634\\u062D\\u0627\\u062A",pivotMode:"\\u0648\\u0636\\u0639 \\u0627\\u0644\\u0645\\u062D\\u0648\\u0631",groups:"\\u0645\\u062C\\u0645\\u0648\\u0639\\u0627\\u062A \\u0627\\u0644\\u0635\\u0641\\u0648\\u0641",rowGroupColumnsEmptyMessage:"\\u0627\\u0633\\u062D\\u0628 \\u0647\\u0646\\u0627 \\u0644\\u062A\\u0639\\u064A\\u064A\\u0646 \\u0645\\u062C\\u0645\\u0648\\u0639\\u0627\\u062A \\u0627\\u0644\\u0635\\u0641\\u0648\\u0641",values:"\\u0627\\u0644\\u0642\\u064A\\u0645",valueColumnsEmptyMessage:"\\u0627\\u0633\\u062D\\u0628 \\u0647\\u0646\\u0627 \\u0644\\u0644\\u062A\\u062C\\u0645\\u064A\\u0639",pivots:"\\u062A\\u0633\\u0645\\u064A\\u0627\\u062A \\u0627\\u0644\\u0623\\u0639\\u0645\\u062F\\u0629",pivotColumnsEmptyMessage:"\\u0627\\u0633\\u062D\\u0628 \\u0647\\u0646\\u0627 \\u0644\\u062A\\u0639\\u064A\\u064A\\u0646 \\u062A\\u0633\\u0645\\u064A\\u0627\\';
      S = S + 'u062A \\u0627\\u0644\\u0623\\u0639\\u0645\\u062F\\u0629",group:"\\u0645\\u062C\\u0645\\u0648\\u0639\\u0629",rowDragRow:"\\u0635\\u0641",rowDragRows:"\\u0635\\u0641\\u0648\\u0641",loadingOoo:"\\u062C\\u0627\\u0631\\u064D \\u0627\\u0644\\u062A\\u062D\\u0645\\u064A\\u0644...",loadingError:"\\u062E\\u0637\\u0623",noRowsToShow:"\\u0644\\u0627 \\u062A\\u0648\\u062C\\u062F \\u0635\\u0641\\u0648\\u0641 \\u0644\\u0644\\u0639\\u0631\\u0636",enabled:"\\u0645\\u064F\\u0645\\u0643\\u0651\\u0646",pinColumn:"\\u062A\\u062B\\u0628\\u064A\\u062A \\u0627\\u0644\\u0639\\u0645\\u0648\\u062F",pinLeft:"\\u062A\\u062B\\u0628\\u064A\\u062A \\u0644\\u0644\\u064A\\u0633\\u0627\\u0631",pinRight:"\\u062A\\u062B\\u0628\\u064A\\u062A \\u0644\\u0644\\u064A\\u0645\\u064A\\u0646",noPin:"\\u0628\\u062F\\u0648\\u0646 \\u062A\\u062B\\u0628\\u064A\\u062A",valueAggregation:"\\u062A\\u062C\\u0645\\u064A\\u0639 \\u0627\\u0644\\u0642\\u064A\\u0645\\u0629",noAggregation:"\\u0628\\u062F\\u0648\\u0646 \\u062A\\u062C\\u0645\\u064A\\u0639",autosizeThisColumn:"\\u062A\\u063A\\u064A\\u064A\\u0631 \\u062D\\u062C\\u0645 \\u0647\\u0630\\u0627 \\u0627\\u0644\\u0639\\u0645\\u0648\\u062F \\u062A\\u0644\\u0642\\u0627\\u0626\\u064A\\u064B\\u0627",autosizeAllColumns:"\\u062A\\u063A\\u064A\\u064A\\u0631 \\u062D\\u062C\\u0645 \\u062C\\u0645\\u064A\\u0639 \\u0627\\u0644\\u0623\\u0639\\u0645\\u062F\\u0629 \\u062A\\u0644\\u0642\\u0627\\u0626\\u064A\\u064B\\u0627",groupBy:"\\u062A\\u062C\\u0645\\u064A\\u0639 \\u0628\\u0648\\u0627\\u0633\\u0637\\u0629",ungroupBy:"\\u0625\\u0644\\u063A\\u0627\\u0621 \\u0627\\u0644\\u062A\\u062C\\u0645\\u064A\\u0639 \\u0628\\u0648\\u0627\\u0633\\u0637\\u0629",ungroupAll:"\\u0625\\u0644\\u063A\\u0627\\u0621 \\u0627\\u0644\\u062A\\u062C\\u0645\\u064A\\u0639 \\u0627\\u0644\\u0643\\u0644",addToValues:"\\u0625\\u0636\\u0627\\u0641\\u0629 ${variable} \\u0625\\u0644\\u0649 \\u0627\\u0644\\u0642\\u064A\\u0645",removeFromValues:"\\u0625\\u0632\\u0627\\u0644\\u0629 ${variable} \\u0645\\u0646 \\u0627\\u0644\\u0642\\u064A\\u0645",addToLabels:"\\u0625\\u0636\\u0627\\u0641\\u0629 ${variable} \\u0625\\u0644\\u0649 \\u0627\\u0644\\u062A\\u0633\\u0645\\u064A\\u0627\\u062A",removeFromLabels:"\\u0625\\u0632\\u0627\\u0644\\u0629 ${variable} \\u0645\\u0646 \\u0627\\u0644\\u062';
      S = S + 'A\\u0633\\u0645\\u064A\\u0627\\u062A",resetColumns:"\\u0625\\u0639\\u0627\\u062F\\u0629 \\u0636\\u0628\\u0637 \\u0627\\u0644\\u0623\\u0639\\u0645\\u062F\\u0629",expandAll:"\\u062A\\u0648\\u0633\\u064A\\u0639 \\u062C\\u0645\\u064A\\u0639 \\u0645\\u062C\\u0645\\u0648\\u0639\\u0627\\u062A \\u0627\\u0644\\u0635\\u0641\\u0648\\u0641",collapseAll:"\\u0625\\u063A\\u0644\\u0627\\u0642 \\u062C\\u0645\\u064A\\u0639 \\u0645\\u062C\\u0645\\u0648\\u0639\\u0627\\u062A \\u0627\\u0644\\u0635\\u0641\\u0648\\u0641",copy:"\\u0646\\u0633\\u062E",ctrlC:"Ctrl+C",ctrlX:"Ctrl+X",copyWithHeaders:"\\u0646\\u0633\\u062E \\u0645\\u0639 \\u0627\\u0644\\u0631\\u0624\\u0648\\u0633",copyWithGroupHeaders:"\\u0646\\u0633\\u062E \\u0645\\u0639 \\u0631\\u0624\\u0648\\u0633 \\u0627\\u0644\\u0645\\u062C\\u0645\\u0648\\u0639\\u0627\\u062A",cut:"\\u0642\\u0635",paste:"\\u0644\\u0635\\u0642",ctrlV:"Ctrl+V",export:"\\u062A\\u0635\\u062F\\u064A\\u0631",csvExport:"\\u062A\\u0635\\u062F\\u064A\\u0631 CSV",excelExport:"\\u062A\\u0635\\u062F\\u064A\\u0631 Excel",columnFilter:"\\u062A\\u0635\\u0641\\u064A\\u0629 \\u0627\\u0644\\u0639\\u0645\\u0648\\u062F",columnChooser:"\\u0627\\u062E\\u062A\\u064A\\u0627\\u0631 \\u0627\\u0644\\u0623\\u0639\\u0645\\u062F\\u0629",sortAscending:"\\u062A\\u0631\\u062A\\u064A\\u0628 \\u062A\\u0635\\u0627\\u0639\\u062F\\u064A",sortDescending:"\\u062A\\u0631\\u062A\\u064A\\u0628 \\u062A\\u0646\\u0627\\u0632\\u0644\\u064A",sortUnSort:"\\u0625\\u0644\\u063A\\u0627\\u0621 \\u0627\\u0644\\u062A\\u0631\\u062A\\u064A\\u0628",sum:"\\u0627\\u0644\\u0645\\u062C\\u0645\\u0648\\u0639",first:"\\u0627\\u0644\\u0623\\u0648\\u0644",last:"\\u0627\\u0644\\u0623\\u062E\\u064A\\u0631",min:"\\u0627\\u0644\\u062D\\u062F \\u0627\\u0644\\u0623\\u062F\\u0646\\u0649",max:"\\u0627\\u0644\\u062D\\u062F \\u0627\\u0644\\u0623\\u0642\\u0635\\u0649",none:"\\u0628\\u062F\\u0648\\u0646",count:"\\u0627\\u0644\\u0639\\u062F\\u062F",avg:"\\u0627\\u0644\\u0645\\u062A\\u0648\\u0633\\u0637",filteredRows:"\\u0627\\u0644\\u0645\\u0631\\u0634\\u062D\\u0629",selectedRows:"\\u0627\\u0644\\u0645\\u062D\\u062F\\u062F\\u0629",totalRows:"\\u0625\\u062C\\u0645\\u0627\\u0644\\u064A \\u0627\\u0644\\u0635\\u0641\\u0648\\u0641",totalAndFilteredRows:"\\u0627\\u0644\\u0635\\u0641\\u0648\\u0641"';
      S = S + ',more:"\\u0627\\u0644\\u0645\\u0632\\u064A\\u062F",to:"\\u0625\\u0644\\u0649",of:"\\u0645\\u0646",page:"\\u0627\\u0644\\u0635\\u0641\\u062D\\u0629",pageLastRowUnknown:"?",nextPage:"\\u0627\\u0644\\u0635\\u0641\\u062D\\u0629 \\u0627\\u0644\\u062A\\u0627\\u0644\\u064A\\u0629",lastPage:"\\u0627\\u0644\\u0635\\u0641\\u062D\\u0629 \\u0627\\u0644\\u0623\\u062E\\u064A\\u0631\\u0629",firstPage:"\\u0627\\u0644\\u0635\\u0641\\u062D\\u0629 \\u0627\\u0644\\u0623\\u0648\\u0644\\u0649",previousPage:"\\u0627\\u0644\\u0635\\u0641\\u062D\\u0629 \\u0627\\u0644\\u0633\\u0627\\u0628\\u0642\\u0629",pageSizeSelectorLabel:"\\u062D\\u062C\\u0645 \\u0627\\u0644\\u0635\\u0641\\u062D\\u0629:",footerTotal:"\\u0627\\u0644\\u0645\\u062C\\u0645\\u0648\\u0639",pivotColumnGroupTotals:"\\u0627\\u0644\\u0645\\u062C\\u0645\\u0648\\u0639",pivotChartAndPivotMode:"\\u0627\\u0644\\u0631\\u0633\\u0645 \\u0627\\u0644\\u0645\\u062D\\u0648\\u0631\\u064A \\u0648\\u0648\\u0636\\u0639 \\u0627\\u0644\\u0645\\u062D\\u0648\\u0631\\u064A",pivotChart:"\\u0627\\u0644\\u0631\\u0633\\u0645 \\u0627\\u0644\\u0645\\u062D\\u0648\\u0631\\u064A",chartRange:"\\u0646\\u0637\\u0627\\u0642 \\u0627\\u0644\\u0631\\u0633\\u0645",columnChart:"\\u0639\\u0645\\u0648\\u062F",groupedColumn:"\\u0645\\u062C\\u0645\\u0648\\u0639\\u0629",stackedColumn:"\\u0645\\u0643\\u062F\\u0633",normalizedColumn:"100% \\u0645\\u0643\\u062F\\u0633",barChart:"\\u0634\\u0631\\u064A\\u0637",groupedBar:"\\u0645\\u062C\\u0645\\u0648\\u0639\\u0629",stackedBar:"\\u0645\\u0643\\u062F\\u0633",normalizedBar:"100% \\u0645\\u0643\\u062F\\u0633",pieChart:"\\u062F\\u0627\\u0626\\u0631\\u0629",pie:"\\u062F\\u0627\\u0626\\u0631\\u0629",donut:"\\u062F\\u0648\\u0646\\u0627\\u062A",line:"\\u062E\\u0637",xyChart:"\\u0633 \\u0633 (\\u0646\\u0642\\u0637\\u0629)",scatter:"\\u0646\\u0642\\u0627\\u0637 \\u0645\\u0628\\u0639\\u062B\\u0631\\u0629",bubble:"\\u0641\\u0642\\u0627\\u0639\\u0629",areaChart:"\\u0645\\u0646\\u0637\\u0642\\u0629",area:"\\u0645\\u0646\\u0637\\u0642\\u0629",stackedArea:"\\u0645\\u0643\\u062F\\u0633",normalizedArea:"100% \\u0645\\u0643\\u062F\\u0633",histogramChart:"\\u0627\\u0644\\u0631\\u0633\\u0645 \\u0627\\u0644\\u0628\\u064A\\u0627\\u0646\\u064A \\u0644\\u0644\\u062A\\u0648\\u0632\\u064A\\u0639",';
      S = S + 'polarChart:"\\u0642\\u0637\\u0628\\u064A",radarLine:"\\u062E\\u0637 \\u0627\\u0644\\u0631\\u0627\\u062F\\u0627\\u0631",radarArea:"\\u0645\\u0646\\u0637\\u0642\\u0629 \\u0627\\u0644\\u0631\\u0627\\u062F\\u0627\\u0631",nightingale:"\\u0646\\u0627\\u064A\\u062A\\u0646\\u062C\\u064A\\u0644",radialColumn:"\\u0639\\u0645\\u0648\\u062F \\u0634\\u0639\\u0627\\u0639\\u064A",radialBar:"\\u0634\\u0631\\u064A\\u0637 \\u0634\\u0639\\u0627\\u0639\\u064A",statisticalChart:"\\u0625\\u062D\\u0635\\u0627\\u0626\\u064A",boxPlot:"\\u0635\\u0646\\u062F\\u0648\\u0642 \\u0645\\u062E\\u0637\\u0637",rangeBar:"\\u0634\\u0631\\u064A\\u0637 \\u0627\\u0644\\u0645\\u062F\\u0649",rangeArea:"\\u0645\\u0646\\u0637\\u0642\\u0629 \\u0627\\u0644\\u0645\\u062F\\u0649",hierarchicalChart:"\\u0627\\u0644\\u062A\\u0633\\u0644\\u0633\\u0644 \\u0627\\u0644\\u0647\\u0631\\u0645\\u064A",treemap:"\\u062E\\u0631\\u064A\\u0637\\u0629 \\u0627\\u0644\\u0634\\u062C\\u0631\\u0629",sunburst:"\\u0627\\u0646\\u0641\\u062C\\u0627\\u0631 \\u0634\\u0645\\u0633\\u064A",specializedChart:"\\u062A\\u062E\\u0635\\u0635\\u064A",waterfall:"\\u0634\\u0644\\u0627\\u0644",heatmap:"\\u062E\\u0631\\u064A\\u0637\\u0629 \\u0627\\u0644\\u062D\\u0631\\u0627\\u0631\\u0629",combinationChart:"\\u0645\\u0632\\u064A\\u062C",columnLineCombo:"\\u0639\\u0645\\u0648\\u062F \\u0648\\u062E\\u0637",AreaColumnCombo:"\\u0645\\u0646\\u0637\\u0642\\u0629 \\u0648\\u0639\\u0645\\u0648\\u062F",pivotChartTitle:"\\u0631\\u0633\\u0645 \\u0645\\u062D\\u0648\\u0631\\u064A",rangeChartTitle:"\\u0631\\u0633\\u0645 \\u0646\\u0637\\u0627\\u0642",settings:"\\u0625\\u0639\\u062F\\u0627\\u062F\\u0627\\u062A",data:"\\u0625\\u0639\\u062F\\u0627\\u062F \\u0627\\u0644\\u0628\\u064A\\u0627\\u0646\\u0627\\u062A",format:"\\u062A\\u062E\\u0635\\u064A\\u0635",categories:"\\u0627\\u0644\\u0641\\u0626\\u0627\\u062A",defaultCategory:"(\\u0644\\u0627 \\u0634\\u064A\\u0621)",series:"\\u0627\\u0644\\u0633\\u0644\\u0633\\u0644\\u0629",switchCategorySeries:"\\u062A\\u0628\\u062F\\u064A\\u0644 \\u0627\\u0644\\u0641\\u0626\\u0629 / \\u0627\\u0644\\u0633\\u0644\\u0633\\u0644\\u0629",categoryValues:"\\u0642\\u064A\\u0645 \\u0627\\u0644\\u0641\\u0626\\u0629",seriesLabels:"\\u062A\\u0633\\u0645\\u064A\\u0627\\u062A \\u0627\\u0644\\u0633\\u06';
      S = S + '44\\u0633\\u0644\\u0629",aggregate:"\\u0645\\u062C\\u0645\\u0648\\u0639\\u0629",xyValues:"\\u0642\\u064A\\u0645 \\u0625\\u062D\\u062F\\u0627\\u062B\\u064A\\u0627\\u062A X Y",paired:"\\u0627\\u0644\\u0648\\u0636\\u0639 \\u0627\\u0644\\u0645\\u0642\\u062A\\u0631\\u0646",axis:"\\u0645\\u062D\\u0648\\u0631",xAxis:"\\u0627\\u0644\\u0645\\u062D\\u0648\\u0631 \\u0627\\u0644\\u0623\\u0641\\u0642\\u064A",yAxis:"\\u0627\\u0644\\u0645\\u062D\\u0648\\u0631 \\u0627\\u0644\\u0631\\u0623\\u0633\\u064A",polarAxis:"\\u0645\\u062D\\u0648\\u0631 \\u0642\\u0637\\u0628\\u064A",radiusAxis:"\\u0645\\u062D\\u0648\\u0631 \\u0646\\u0635\\u0641 \\u0627\\u0644\\u0642\\u0637\\u0631",navigator:"\\u0645\\u0633\\u062A\\u0643\\u0634\\u0641",zoom:"\\u062A\\u0643\\u0628\\u064A\\u0631",animation:"\\u062A\\u062D\\u0631\\u064A\\u0643",crosshair:"\\u0645\\u0624\\u0634\\u0631",color:"\\u0644\\u0648\\u0646",thickness:"\\u0633\\u064F\\u0645\\u0643",preferredLength:"\\u0627\\u0644\\u0637\\u0648\\u0644 \\u0627\\u0644\\u0645\\u0641\\u0636\\u0644",xType:"\\u0646\\u0648\\u0639 X",axisType:"\\u0646\\u0648\\u0639 \\u0627\\u0644\\u0645\\u062D\\u0648\\u0631",automatic:"\\u062A\\u0644\\u0642\\u0627\\u0626\\u064A",category:"\\u0641\\u0626\\u0629",number:"\\u0631\\u0642\\u0645",time:"\\u0648\\u0642\\u062A",timeFormat:"\\u0635\\u064A\\u063A\\u0629 \\u0627\\u0644\\u0648\\u0642\\u062A",autoRotate:"\\u062A\\u062F\\u0648\\u064A\\u0631 \\u062A\\u0644\\u0642\\u0627\\u0626\\u064A",labelRotation:"\\u062A\\u062F\\u0648\\u064A\\u0631 \\u0627\\u0644\\u062A\\u0633\\u0645\\u064A\\u0627\\u062A",circle:"\\u062F\\u0627\\u0626\\u0631\\u0629",polygon:"\\u0645\\u0636\\u0644\\u0639",square:"\\u0645\\u0631\\u0628\\u0639",cross:"\\u0635\\u0644\\u064A\\u0628",diamond:"\\u0645\\u0627\\u0633",plus:"\\u0632\\u0627\\u0626\\u062F",triangle:"\\u0645\\u062B\\u0644\\u062B",heart:"\\u0642\\u0644\\u0628",orientation:"\\u0627\\u062A\\u062C\\u0627\\u0647",fixed:"\\u062B\\u0627\\u0628\\u062A",parallel:"\\u0645\\u062A\\u0648\\u0627\\u0632\\u064A",perpendicular:"\\u0639\\u0645\\u0648\\u062F\\u064A",radiusAxisPosition:"\\u0627\\u0644\\u0645\\u0648\\u0642\\u0639",ticks:"\\u0639\\u0644\\u0627\\u0645\\u0627\\u062A",gridLines:"\\u062E\\u0637\\u0648\\u0637 \\u0627\\u0644\\u0634\\u0628\\u0643\\u0629",width:"\\u';
      S = S + '0639\\u0631\\u0636",height:"\\u0627\\u0631\\u062A\\u0641\\u0627\\u0639",length:"\\u0637\\u0648\\u0644",padding:"\\u062D\\u0634\\u0648\\u0629",spacing:"\\u062A\\u0628\\u0627\\u0639\\u062F",chartStyle:"\\u0646\\u0645\\u0637 \\u0627\\u0644\\u0631\\u0633\\u0645 \\u0627\\u0644\\u0628\\u064A\\u0627\\u0646\\u064A",title:"\\u0639\\u0646\\u0648\\u0627\\u0646",chartTitles:"\\u0639\\u0646\\u0627\\u0648\\u064A\\u0646 \\u0627\\u0644\\u0631\\u0633\\u0648\\u0645 \\u0627\\u0644\\u0628\\u064A\\u0627\\u0646\\u064A\\u0629",chartTitle:"\\u0639\\u0646\\u0648\\u0627\\u0646 \\u0627\\u0644\\u0631\\u0633\\u0645 \\u0627\\u0644\\u0628\\u064A\\u0627\\u0646\\u064A",chartSubtitle:"\\u0627\\u0644\\u0639\\u0646\\u0648\\u0627\\u0646 \\u0627\\u0644\\u0641\\u0631\\u0639\\u064A",horizontalAxisTitle:"\\u0639\\u0646\\u0648\\u0627\\u0646 \\u0627\\u0644\\u0645\\u062D\\u0648\\u0631 \\u0627\\u0644\\u0623\\u0641\\u0642\\u064A",verticalAxisTitle:"\\u0639\\u0646\\u0648\\u0627\\u0646 \\u0627\\u0644\\u0645\\u062D\\u0648\\u0631 \\u0627\\u0644\\u0631\\u0623\\u0633\\u064A",polarAxisTitle:"\\u0639\\u0646\\u0648\\u0627\\u0646 \\u0627\\u0644\\u0645\\u062D\\u0648\\u0631 \\u0627\\u0644\\u0642\\u0637\\u0628\\u064A",titlePlaceholder:"\\u0639\\u0646\\u0648\\u0627\\u0646 \\u0627\\u0644\\u0631\\u0633\\u0645 \\u0627\\u0644\\u0628\\u064A\\u0627\\u0646\\u064A",background:"\\u062E\\u0644\\u0641\\u064A\\u0629",font:"\\u062E\\u0637",weight:"\\u0648\\u0632\\u0646",top:"\\u0623\\u0639\\u0644\\u0649",right:"\\u064A\\u0645\\u064A\\u0646",bottom:"\\u0623\\u0633\\u0641\\u0644",left:"\\u064A\\u0633\\u0627\\u0631",labels:"\\u0627\\u0644\\u062A\\u0633\\u0645\\u064A\\u0627\\u062A",calloutLabels:"\\u062A\\u0633\\u0645\\u064A\\u0627\\u062A \\u0627\\u0644\\u062A\\u0646\\u0628\\u064A\\u0647",sectorLabels:"\\u062A\\u0633\\u0645\\u064A\\u0627\\u062A \\u0627\\u0644\\u0642\\u0637\\u0627\\u0639",positionRatio:"\\u0646\\u0633\\u0628\\u0629 \\u0627\\u0644\\u0645\\u0648\\u0642\\u0639",size:"\\u062D\\u062C\\u0645",shape:"\\u0634\\u0643\\u0644",minSize:"\\u0627\\u0644\\u062D\\u062F \\u0627\\u0644\\u0623\\u062F\\u0646\\u0649 \\u0644\\u0644\\u062D\\u062C\\u0645",maxSize:"\\u0627\\u0644\\u062D\\u062F \\u0627\\u0644\\u0623\\u0642\\u0635\\u0649 \\u0644\\u0644\\u062D\\u062C\\u0645",legend:"\\u0648\\u0633\\u064A\\u0644\\u06';
      S = S + '29 \\u0627\\u0644\\u0625\\u064A\\u0636\\u0627\\u062D",position:"\\u0627\\u0644\\u0645\\u0648\\u0642\\u0639",markerSize:"\\u062D\\u062C\\u0645 \\u0627\\u0644\\u0639\\u0644\\u0627\\u0645\\u0629",markerStroke:"\\u062E\\u0637 \\u0627\\u0644\\u0639\\u0644\\u0627\\u0645\\u0629",markerPadding:"\\u062D\\u0634\\u0648\\u0629 \\u0627\\u0644\\u0639\\u0644\\u0627\\u0645\\u0629",itemSpacing:"\\u062A\\u0628\\u0627\\u0639\\u062F \\u0627\\u0644\\u0639\\u0646\\u0627\\u0635\\u0631",itemPaddingX:"\\u062D\\u0634\\u0648\\u0629 \\u0627\\u0644\\u0639\\u0646\\u0635\\u0631 X",itemPaddingY:"\\u062D\\u0634\\u0648\\u0629 \\u0627\\u0644\\u0639\\u0646\\u0635\\u0631 Y",layoutHorizontalSpacing:"\\u0627\\u0644\\u062A\\u0628\\u0627\\u0639\\u062F \\u0627\\u0644\\u0623\\u0641\\u0642\\u064A",layoutVerticalSpacing:"\\u0627\\u0644\\u062A\\u0628\\u0627\\u0639\\u062F \\u0627\\u0644\\u0631\\u0623\\u0633\\u064A",strokeWidth:"\\u0633\\u0645\\u0643 \\u0627\\u0644\\u062E\\u0637",offset:"\\u0625\\u0632\\u0627\\u062D\\u0629",offsets:"\\u0625\\u0632\\u0627\\u062D\\u0627\\u062A",tooltips:"\\u0623\\u062F\\u0648\\u0627\\u062A \\u0627\\u0644\\u0625\\u0631\\u0634\\u0627\\u062F",callout:"\\u062A\\u0646\\u0628\\u064A\\u0647",markers:"\\u0639\\u0644\\u0627\\u0645\\u0627\\u062A",shadow:"\\u0638\\u0644",blur:"\\u0636\\u0628\\u0627\\u0628\\u064A\\u0629",xOffset:"\\u0625\\u0632\\u0627\\u062D\\u0629 X",yOffset:"\\u0625\\u0632\\u0627\\u062D\\u0629 Y",lineWidth:"\\u0639\\u0631\\u0636 \\u0627\\u0644\\u062E\\u0637",lineDash:"\\u062E\\u0637 \\u0645\\u0646\\u0642\\u0637",lineDashOffset:"\\u0625\\u0632\\u0627\\u062D\\u0629 \\u0627\\u0644\\u0646\\u0642\\u0637\\u0629",scrollingZoom:"\\u062A\\u0643\\u0628\\u064A\\u0631 \\u0627\\u0644\\u062A\\u0645\\u0631\\u064A\\u0631",scrollingStep:"\\u062E\\u0637\\u0648\\u0629 \\u0627\\u0644\\u062A\\u0645\\u0631\\u064A\\u0631",selectingZoom:"\\u062A\\u0643\\u0628\\u064A\\u0631 \\u0627\\u0644\\u062A\\u062D\\u062F\\u064A\\u062F",durationMillis:"\\u0627\\u0644\\u0645\\u062F\\u0629 (\\u0645\\u0644\\u0644\\u064A \\u062B\\u0627\\u0646\\u064A\\u0629)",crosshairLabel:"\\u062A\\u0633\\u0645\\u064A\\u0629 \\u0627\\u0644\\u0645\\u0624\\u0634\\u0631",crosshairSnap:"\\u0627\\u0644\\u062A\\u0642\\u0627\\u0637 \\u0627\\u0644\\u0645\\u0624\\u0634\\u0631",normal:"\\u0639';
      S = S + '\\u0627\\u062F\\u064A",bold:"\\u063A\\u0627\\u0645\\u0642",italic:"\\u0645\\u0627\\u0626\\u0644",boldItalic:"\\u063A\\u0627\\u0645\\u0642 \\u0648\\u0645\\u0627\\u0626\\u0644",predefined:"\\u0645\\u062D\\u062F\\u062F \\u0645\\u0633\\u0628\\u0642\\u064B\\u0627",fillOpacity:"\\u0634\\u0641\\u0627\\u0641\\u064A\\u0629 \\u0627\\u0644\\u062A\\u0639\\u0628\\u0626\\u0629",strokeColor:"\\u0644\\u0648\\u0646 \\u0627\\u0644\\u062E\\u0637",strokeOpacity:"\\u0634\\u0641\\u0627\\u0641\\u064A\\u0629 \\u0627\\u0644\\u062E\\u0637",miniChart:"\\u0631\\u0633\\u0645 \\u0635\\u063A\\u064A\\u0631",histogramBinCount:"\\u0639\\u062F\\u062F \\u0627\\u0644\\u0635\\u0646\\u0627\\u062F\\u064A\\u0642",connectorLine:"\\u062E\\u0637 \\u0627\\u0644\\u0645\\u0648\\u0635\\u0644",seriesItems:"\\u0639\\u0646\\u0627\\u0635\\u0631 \\u0627\\u0644\\u0633\\u0644\\u0633\\u0644\\u0629",seriesItemType:"\\u0646\\u0648\\u0639 \\u0627\\u0644\\u0639\\u0646\\u0635\\u0631",seriesItemPositive:"\\u0625\\u064A\\u062C\\u0627\\u0628\\u064A",seriesItemNegative:"\\u0633\\u0644\\u0628\\u064A",seriesItemLabels:"\\u062A\\u0633\\u0645\\u064A\\u0627\\u062A \\u0627\\u0644\\u0639\\u0646\\u0627\\u0635\\u0631",columnGroup:"\\u0639\\u0645\\u0648\\u062F",barGroup:"\\u0634\\u0631\\u064A\\u0637",pieGroup:"\\u0641\\u0637\\u064A\\u0631\\u0629",lineGroup:"\\u062E\\u0637",scatterGroup:"X Y (\\u0645\\u0628\\u0639\\u062B\\u0631)",areaGroup:"\\u0645\\u0633\\u0627\\u062D\\u0629",polarGroup:"\\u0642\\u0637\\u0628\\u064A",statisticalGroup:"\\u0625\\u062D\\u0635\\u0627\\u0626\\u064A",hierarchicalGroup:"\\u0647\\u0631\\u0645\\u064A",specializedGroup:"\\u0645\\u062A\\u062E\\u0635\\u0635",combinationGroup:"\\u0645\\u0632\\u064A\\u062C",groupedColumnTooltip:"\\u0645\\u062C\\u0645\\u0648\\u0639\\u0629",stackedColumnTooltip:"\\u0645\\u0643\\u062F\\u0633",normalizedColumnTooltip:"100% \\u0645\\u0643\\u062F\\u0633",groupedBarTooltip:"\\u0645\\u062C\\u0645\\u0648\\u0639\\u0629",stackedBarTooltip:"\\u0645\\u0643\\u062F\\u0633",normalizedBarTooltip:"100% \\u0645\\u0643\\u062F\\u0633",pieTooltip:"\\u0641\\u0637\\u064A\\u0631\\u0629",donutTooltip:"\\u062F\\u0648\\u0646\\u0627\\u062A",lineTooltip:"\\u062E\\u0637",groupedAreaTooltip:"\\u0645\\u0633\\u0627\\u062D\\u0629 \\u0645\\u0';
      S = S + '62C\\u0645\\u0648\\u0639\\u0629",stackedAreaTooltip:"\\u0645\\u0633\\u0627\\u062D\\u0629 \\u0645\\u0643\\u062F\\u0633\\u0629",normalizedAreaTooltip:"100% \\u0645\\u0643\\u062F\\u0633\\u0629",scatterTooltip:"\\u0645\\u0628\\u0639\\u062B\\u0631",bubbleTooltip:"\\u0641\\u0642\\u0627\\u0639\\u0629",histogramTooltip:"\\u0631\\u0633\\u0645 \\u0628\\u064A\\u0627\\u0646\\u064A",radialColumnTooltip:"\\u0639\\u0645\\u0648\\u062F \\u0634\\u0639\\u0627\\u0639\\u064A",radialBarTooltip:"\\u0634\\u0631\\u064A\\u0637 \\u0634\\u0639\\u0627\\u0639\\u064A",radarLineTooltip:"\\u062E\\u0637 \\u0631\\u0627\\u062F\\u0627\\u0631\\u064A",radarAreaTooltip:"\\u0645\\u0633\\u0627\\u062D\\u0629 \\u0631\\u0627\\u062F\\u0627\\u0631\\u064A\\u0629",nightingaleTooltip:"\\u0646\\u0627\\u064A\\u062A\\u0646\\u062C\\u064A\\u0644",rangeBarTooltip:"\\u0634\\u0631\\u064A\\u0637 \\u0627\\u0644\\u0646\\u0637\\u0627\\u0642",rangeAreaTooltip:"\\u0645\\u0633\\u0627\\u062D\\u0629 \\u0627\\u0644\\u0646\\u0637\\u0627\\u0642",boxPlotTooltip:"\\u0645\\u0631\\u0628\\u0639 \\u0645\\u062E\\u0637\\u0637",treemapTooltip:"\\u062E\\u0631\\u064A\\u0637\\u0629 \\u0627\\u0644\\u0634\\u062C\\u0631\\u0629",sunburstTooltip:"\\u0634\\u0645\\u0633 \\u0645\\u062A\\u0641\\u062C\\u0631\\u0629",waterfallTooltip:"\\u0634\\u0644\\u0627\\u0644",heatmapTooltip:"\\u062E\\u0631\\u064A\\u0637\\u0629 \\u062D\\u0631\\u0627\\u0631\\u064A\\u0629",columnLineComboTooltip:"\\u0639\\u0645\\u0648\\u062F \\u0648\\u062E\\u0637",areaColumnComboTooltip:"\\u0645\\u0633\\u0627\\u062D\\u0629 \\u0648\\u0639\\u0645\\u0648\\u062F",customComboTooltip:"\\u0645\\u0632\\u064A\\u062C \\u0645\\u062E\\u0635\\u0635",innerRadius:"\\u0646\\u0635\\u0641 \\u0627\\u0644\\u0642\\u0637\\u0631 \\u0627\\u0644\\u062F\\u0627\\u062E\\u0644\\u064A",startAngle:"\\u0632\\u0627\\u0648\\u064A\\u0629 \\u0627\\u0644\\u0628\\u062F\\u0627\\u064A\\u0629",endAngle:"\\u0632\\u0627\\u0648\\u064A\\u0629 \\u0627\\u0644\\u0646\\u0647\\u0627\\u064A\\u0629",reverseDirection:"\\u0639\\u0643\\u0633 \\u0627\\u0644\\u0627\\u062A\\u062C\\u0627\\u0647",groupPadding:"\\u062D\\u0634\\u0648\\u0629 \\u0627\\u0644\\u0645\\u062C\\u0645\\u0648\\u0639\\u0629",seriesPadding:"\\u062D\\u0634\\u0648\\u0629 \\u0627\\u0644\\u0633\\u0644\\u0633\\u0644\\u062';
      S = S + '9",tile:"\\u0628\\u0644\\u0627\\u0637\\u0629",whisker:"\\u0634\\u0639\\u0631",cap:"\\u063A\\u0637\\u0627\\u0621",capLengthRatio:"\\u0646\\u0633\\u0628\\u0629 \\u0637\\u0648\\u0644 \\u0627\\u0644\\u063A\\u0637\\u0627\\u0621",labelPlacement:"\\u0645\\u0648\\u0636\\u0639 \\u0627\\u0644\\u062A\\u0633\\u0645\\u064A\\u0629",inside:"\\u062F\\u0627\\u062E\\u0644",outside:"\\u062E\\u0627\\u0631\\u062C",noDataToChart:"\\u0644\\u0627 \\u062A\\u0648\\u062C\\u062F \\u0628\\u064A\\u0627\\u0646\\u0627\\u062A \\u0644\\u0639\\u0631\\u0636\\u0647\\u0627 \\u0641\\u064A \\u0627\\u0644\\u0631\\u0633\\u0645.",pivotChartRequiresPivotMode:"\\u064A\\u062A\\u0637\\u0644\\u0628 \\u0627\\u0644\\u0631\\u0633\\u0645 \\u0627\\u0644\\u0645\\u062D\\u0648\\u0631\\u064A \\u062A\\u0641\\u0639\\u064A\\u0644 \\u0648\\u0636\\u0639 \\u0627\\u0644\\u0645\\u062D\\u0648\\u0631\\u064A\\u0629.",chartSettingsToolbarTooltip:"\\u0642\\u0627\\u0626\\u0645\\u0629",chartLinkToolbarTooltip:"\\u0645\\u0631\\u062A\\u0628\\u0637 \\u0628\\u0627\\u0644\\u0634\\u0628\\u0643\\u0629",chartUnlinkToolbarTooltip:"\\u063A\\u064A\\u0631 \\u0645\\u0631\\u062A\\u0628\\u0637 \\u0628\\u0627\\u0644\\u0634\\u0628\\u0643\\u0629",chartDownloadToolbarTooltip:"\\u062A\\u0646\\u0632\\u064A\\u0644 \\u0627\\u0644\\u0631\\u0633\\u0645 \\u0627\\u0644\\u0628\\u064A\\u0627\\u0646\\u064A",chartMenuToolbarTooltip:"\\u0642\\u0627\\u0626\\u0645\\u0629",chartEdit:"\\u062A\\u062D\\u0631\\u064A\\u0631 \\u0627\\u0644\\u0631\\u0633\\u0645 \\u0627\\u0644\\u0628\\u064A\\u0627\\u0646\\u064A",chartAdvancedSettings:"\\u0625\\u0639\\u062F\\u0627\\u062F\\u0627\\u062A \\u0645\\u062A\\u0642\\u062F\\u0645\\u0629",chartLink:"\\u0631\\u0627\\u0628\\u0637 \\u0644\\u0644\\u0634\\u0628\\u0643\\u0629",chartUnlink:"\\u0625\\u0644\\u063A\\u0627\\u0621 \\u0627\\u0644\\u0631\\u0627\\u0628\\u0637 \\u0645\\u0646 \\u0627\\u0644\\u0634\\u0628\\u0643\\u0629",chartDownload:"\\u062A\\u0646\\u0632\\u064A\\u0644 \\u0627\\u0644\\u0631\\u0633\\u0645 \\u0627\\u0644\\u0628\\u064A\\u0627\\u0646\\u064A",histogramFrequency:"\\u0627\\u0644\\u062A\\u0631\\u062F\\u062F",seriesChartType:"\\u0646\\u0648\\u0639 \\u0631\\u0633\\u0645 \\u0627\\u0644\\u0633\\u0644\\u0633\\u0644\\u0629",seriesType:"\\u0646\\u0648\\u0639 \\u0627\\u0644\\u0633\\u0644\\u063';
      S = S + '3\\u0644\\u0629",secondaryAxis:"\\u0645\\u062D\\u0648\\u0631 \\u062B\\u0627\\u0646\\u0648\\u064A",seriesAdd:"\\u0625\\u0636\\u0627\\u0641\\u0629 \\u0633\\u0644\\u0633\\u0644\\u0629",categoryAdd:"\\u0625\\u0636\\u0627\\u0641\\u0629 \\u0641\\u0626\\u0629",bar:"\\u0634\\u0631\\u064A\\u0637",column:"\\u0639\\u0645\\u0648\\u062F",histogram:"\\u0631\\u0633\\u0645 \\u0628\\u064A\\u0627\\u0646\\u064A",advancedSettings:"\\u0627\\u0644\\u0625\\u0639\\u062F\\u0627\\u062F\\u0627\\u062A \\u0627\\u0644\\u0645\\u062A\\u0642\\u062F\\u0645\\u0629",direction:"\\u0627\\u062A\\u062C\\u0627\\u0647",horizontal:"\\u0623\\u0641\\u0642\\u064A",vertical:"\\u0631\\u0623\\u0633\\u064A",seriesGroupType:"\\u0646\\u0648\\u0639 \\u0627\\u0644\\u0645\\u062C\\u0645\\u0648\\u0639\\u0629",groupedSeriesGroupType:"\\u0645\\u062C\\u0645\\u0648\\u0639\\u0629",stackedSeriesGroupType:"\\u0645\\u0643\\u062F\\u0633",normalizedSeriesGroupType:"100% \\u0645\\u0643\\u062F\\u0633",legendEnabled:"\\u0645\\u0645\\u0643\\u0651\\u0646",invalidColor:"\\u0642\\u064A\\u0645\\u0629 \\u0627\\u0644\\u0644\\u0648\\u0646 \\u063A\\u064A\\u0631 \\u0635\\u062D\\u064A\\u062D\\u0629",groupedColumnFull:"\\u0639\\u0645\\u0648\\u062F \\u0645\\u062C\\u0645\\u0639",stackedColumnFull:"\\u0639\\u0645\\u0648\\u062F \\u0645\\u0643\\u062F\\u0633",normalizedColumnFull:"100% \\u0639\\u0645\\u0648\\u062F \\u0645\\u0643\\u062F\\u0633",groupedBarFull:"\\u0634\\u0631\\u064A\\u0637 \\u0645\\u062C\\u0645\\u0639",stackedBarFull:"\\u0634\\u0631\\u064A\\u0637 \\u0645\\u0643\\u062F\\u0633",normalizedBarFull:"100% \\u0634\\u0631\\u064A\\u0637 \\u0645\\u0643\\u062F\\u0633",stackedAreaFull:"\\u0645\\u0633\\u0627\\u062D\\u0629 \\u0645\\u0643\\u062F\\u0633\\u0629",normalizedAreaFull:"100% \\u0645\\u0633\\u0627\\u062D\\u0629 \\u0645\\u0643\\u062F\\u0633\\u0629",customCombo:"\\u0645\\u0632\\u064A\\u062C \\u0645\\u062E\\u0635\\u0635",ariaAdvancedFilterBuilderItem:"${variable}. \\u0627\\u0644\\u0645\\u0633\\u062A\\u0648\\u0649 ${variable}. \\u0627\\u0636\\u063A\\u0637 ENTER \\u0644\\u062A\\u0639\\u062F\\u064A\\u0644.",ariaAdvancedFilterBuilderItemValidation:"${variable}. \\u0627\\u0644\\u0645\\u0633\\u062A\\u0648\\u0649 ${variable}. ${variable} \\u0627\\u0636\\u063A\\u0637 ENTER \\u';
      S = S + '0644\\u062A\\u0639\\u062F\\u064A\\u0644.",ariaAdvancedFilterBuilderList:"\\u0642\\u0627\\u0626\\u0645\\u0629 \\u0645\\u064F\\u0646\\u0634\\u0626 \\u0627\\u0644\\u0641\\u0644\\u062A\\u0631\\u0629 \\u0627\\u0644\\u0645\\u062A\\u0642\\u062F\\u0645\\u0629",ariaAdvancedFilterBuilderFilterItem:"\\u0634\\u0631\\u0637 \\u0627\\u0644\\u0641\\u0644\\u062A\\u0631\\u0629",ariaAdvancedFilterBuilderGroupItem:"\\u0645\\u062C\\u0645\\u0648\\u0639\\u0629 \\u0627\\u0644\\u0641\\u0644\\u062A\\u0631\\u0629",ariaAdvancedFilterBuilderColumn:"\\u0627\\u0644\\u0639\\u0645\\u0648\\u062F",ariaAdvancedFilterBuilderOption:"\\u0627\\u0644\\u062E\\u064A\\u0627\\u0631",ariaAdvancedFilterBuilderValueP:"\\u0627\\u0644\\u0642\\u064A\\u0645\\u0629",ariaAdvancedFilterBuilderJoinOperator:"\\u0627\\u0644\\u0639\\u0645\\u0644\\u064A\\u0629 \\u0627\\u0644\\u0631\\u0628\\u0637",ariaAdvancedFilterInput:"\\u0625\\u062F\\u062E\\u0627\\u0644 \\u0627\\u0644\\u0641\\u0644\\u062A\\u0631\\u0629 \\u0627\\u0644\\u0645\\u062A\\u0642\\u062F\\u0645\\u0629",ariaChecked:"\\u0645\\u062D\\u062F\\u062F",ariaColumn:"\\u0627\\u0644\\u0639\\u0645\\u0648\\u062F",ariaColumnGroup:"\\u0645\\u062C\\u0645\\u0648\\u0639\\u0629 \\u0627\\u0644\\u0623\\u0639\\u0645\\u062F\\u0629",ariaColumnFiltered:"\\u0627\\u0644\\u0639\\u0645\\u0648\\u062F \\u0645\\u0641\\u0644\\u062A\\u0631",ariaColumnSelectAll:"\\u062A\\u0628\\u062F\\u064A\\u0644 \\u062A\\u062D\\u062F\\u064A\\u062F \\u0643\\u0644 \\u0627\\u0644\\u0623\\u0639\\u0645\\u062F\\u0629",ariaDateFilterInput:"\\u0625\\u062F\\u062E\\u0627\\u0644 \\u0641\\u0644\\u062A\\u0631 \\u0627\\u0644\\u062A\\u0627\\u0631\\u064A\\u062E",ariaDefaultListName:"\\u0642\\u0627\\u0626\\u0645\\u0629",ariaFilterColumnsInput:"\\u0625\\u062F\\u062E\\u0627\\u0644 \\u0641\\u0644\\u062A\\u0631\\u0629 \\u0627\\u0644\\u0623\\u0639\\u0645\\u062F\\u0629",ariaFilterFromValue:"\\u0627\\u0644\\u0641\\u0644\\u062A\\u0631\\u0629 \\u0645\\u0646 \\u0627\\u0644\\u0642\\u064A\\u0645\\u0629",ariaFilterInput:"\\u0625\\u062F\\u062E\\u0627\\u0644 \\u0627\\u0644\\u0641\\u0644\\u062A\\u0631\\u0629",ariaFilterList:"\\u0642\\u0627\\u0626\\u0645\\u0629 \\u0627\\u0644\\u0641\\u0644\\u062A\\u0631\\u0629",ariaFilterToValue:"\\u0627\\u0644\\u0641\\u0644\\u062A\\u0631\\u0629 \\u06';
      S = S + '25\\u0644\\u0649 \\u0627\\u0644\\u0642\\u064A\\u0645\\u0629",ariaFilterValue:"\\u0642\\u064A\\u0645\\u0629 \\u0627\\u0644\\u0641\\u0644\\u062A\\u0631\\u0629",ariaFilterMenuOpen:"\\u0641\\u062A\\u062D \\u0642\\u0627\\u0626\\u0645\\u0629 \\u0627\\u0644\\u0641\\u0644\\u062A\\u0631\\u0629",ariaFilteringOperator:"\\u0645\\u0634\\u063A\\u0644 \\u0627\\u0644\\u0641\\u0644\\u062A\\u0631\\u0629",ariaHidden:"\\u0645\\u062E\\u0641\\u064A",ariaIndeterminate:"\\u063A\\u064A\\u0631 \\u0645\\u062D\\u062F\\u062F",ariaInputEditor:"\\u0645\\u062D\\u0631\\u0631 \\u0627\\u0644\\u0625\\u062F\\u062E\\u0627\\u0644",ariaMenuColumn:"\\u0627\\u0636\\u063A\\u0637 ALT DOWN \\u0644\\u0641\\u062A\\u062D \\u0642\\u0627\\u0626\\u0645\\u0629 \\u0627\\u0644\\u0639\\u0645\\u0648\\u062F",ariaFilterColumn:"\\u0627\\u0636\\u063A\\u0637 CTRL ENTER \\u0644\\u0641\\u062A\\u062D \\u0627\\u0644\\u0641\\u0644\\u062A\\u0631\\u0629",ariaRowDeselect:"\\u0627\\u0636\\u063A\\u0637 SPACE \\u0644\\u0625\\u0644\\u063A\\u0627\\u0621 \\u062A\\u062D\\u062F\\u064A\\u062F \\u0647\\u0630\\u0627 \\u0627\\u0644\\u0635\\u0641",ariaRowSelectAll:"\\u0627\\u0636\\u063A\\u0637 Space \\u0644\\u062A\\u0628\\u062F\\u064A\\u0644 \\u062A\\u062D\\u062F\\u064A\\u062F \\u0643\\u0644 \\u0627\\u0644\\u0635\\u0641\\u0648\\u0641",ariaRowToggleSelection:"\\u0627\\u0636\\u063A\\u0637 Space \\u0644\\u062A\\u0628\\u062F\\u064A\\u0644 \\u062A\\u062D\\u062F\\u064A\\u062F \\u0627\\u0644\\u0635\\u0641",ariaRowSelect:"\\u0627\\u0636\\u063A\\u0637 SPACE \\u0644\\u062A\\u062D\\u062F\\u064A\\u062F \\u0647\\u0630\\u0627 \\u0627\\u0644\\u0635\\u0641",ariaRowSelectionDisabled:"\\u062A\\u062D\\u062F\\u064A\\u062F \\u0627\\u0644\\u0635\\u0641 \\u0645\\u0639\\u0637\\u0644 \\u0644\\u0647\\u0630\\u0627 \\u0627\\u0644\\u0635\\u0641",ariaSearch:"\\u0628\\u062D\\u062B",ariaSortableColumn:"\\u0627\\u0636\\u063A\\u0637 ENTER \\u0644\\u0641\\u0631\\u0632",ariaToggleVisibility:"\\u0627\\u0636\\u063A\\u0637 SPACE \\u0644\\u062A\\u0628\\u062F\\u064A\\u0644 \\u0627\\u0644\\u0631\\u0624\\u064A\\u0629",ariaToggleCellValue:"\\u0627\\u0636\\u063A\\u0637 SPACE \\u0644\\u062A\\u0628\\u062F\\u064A\\u0644 \\u0642\\u064A\\u0645\\u0629 \\u0627\\u0644\\u062E\\u0644\\u064A\\u0629",ariaUnchecked:"\\u063A\\u064A\\u0631 \\u0645\\u062D\\';
      S = S + 'u062F\\u062F",ariaVisible:"\\u0645\\u0631\\u0626\\u064A",ariaSearchFilterValues:"\\u0642\\u064A\\u0645\\u0629 \\u0641\\u0644\\u062A\\u0631\\u0629 \\u0627\\u0644\\u0628\\u062D\\u062B",ariaPageSizeSelectorLabel:"\\u062D\\u062C\\u0645 \\u0627\\u0644\\u0635\\u0641\\u062D\\u0629",ariaChartMenuClose:"\\u0625\\u063A\\u0644\\u0627\\u0642 \\u0642\\u0627\\u0626\\u0645\\u0629 \\u062A\\u062D\\u0631\\u064A\\u0631 \\u0627\\u0644\\u0631\\u0633\\u0645 \\u0627\\u0644\\u0628\\u064A\\u0627\\u0646\\u064A",ariaChartSelected:"\\u0645\\u062D\\u062F\\u062F",ariaSkeletonCellLoadingFailed:"\\u0641\\u0634\\u0644 \\u062A\\u062D\\u0645\\u064A\\u0644 \\u0627\\u0644\\u0635\\u0641",ariaSkeletonCellLoading:"\\u062C\\u0627\\u0631\\u064A \\u062A\\u062D\\u0645\\u064A\\u0644 \\u0628\\u064A\\u0627\\u0646\\u0627\\u062A \\u0627\\u0644\\u0635\\u0641",ariaRowGroupDropZonePanelLabel:"\\u0645\\u062C\\u0645\\u0648\\u0639\\u0627\\u062A \\u0627\\u0644\\u0635\\u0641\\u0648\\u0641",ariaValuesDropZonePanelLabel:"\\u0627\\u0644\\u0642\\u064A\\u0645",ariaPivotDropZonePanelLabel:"\\u062A\\u0633\\u0645\\u064A\\u0627\\u062A \\u0627\\u0644\\u0623\\u0639\\u0645\\u062F\\u0629",ariaDropZoneColumnComponentDescription:"\\u0627\\u0636\\u063A\\u0637 \\u0639\\u0644\\u0649 DELETE \\u0644\\u0644\\u0625\\u0632\\u0627\\u0644\\u0629",ariaDropZoneColumnValueItemDescription:"\\u0627\\u0636\\u063A\\u0637 \\u0639\\u0644\\u0649 ENTER \\u0644\\u062A\\u063A\\u064A\\u064A\\u0631 \\u0646\\u0648\\u0639 \\u0627\\u0644\\u062A\\u062C\\u0645\\u064A\\u0639",ariaDropZoneColumnGroupItemDescription:"\\u0627\\u0636\\u063A\\u0637 \\u0639\\u0644\\u0649 ENTER \\u0644\\u0644\\u0641\\u0631\\u0632",ariaDropZoneColumnComponentAggFuncSeparator:" \\u0645\\u0646 ",ariaDropZoneColumnComponentSortAscending:"\\u062A\\u0635\\u0627\\u0639\\u062F\\u064A",ariaDropZoneColumnComponentSortDescending:"\\u062A\\u0646\\u0627\\u0632\\u0644\\u064A",ariaLabelDialog:"\\u062D\\u0648\\u0627\\u0631",ariaLabelColumnMenu:"\\u0642\\u0627\\u0626\\u0645\\u0629 \\u0627\\u0644\\u0623\\u0639\\u0645\\u062F\\u0629",ariaLabelColumnFilter:"\\u062A\\u0635\\u0641\\u064A\\u0629 \\u0627\\u0644\\u0639\\u0645\\u0648\\u062F",ariaLabelCellEditor:"\\u0645\\u062D\\u0631\\u0631 \\u0627\\u0644\\u062E\\u0644\\u064A\\u0629"';
      S = S + ',ariaLabelSelectField:"\\u0627\\u062E\\u062A\\u064A\\u0627\\u0631 \\u0627\\u0644\\u062D\\u0642\\u0644",ariaLabelRichSelectField:"\\u062D\\u0642\\u0644 \\u0627\\u062E\\u062A\\u064A\\u0627\\u0631 \\u0645\\u062A\\u0642\\u062F\\u0645",ariaLabelRichSelectToggleSelection:"\\u0627\\u0636\\u063A\\u0637 SPACE \\u0644\\u062A\\u063A\\u064A\\u064A\\u0631 \\u0627\\u0644\\u062A\\u062D\\u062F\\u064A\\u062F",ariaLabelRichSelectDeselectAllItems:"\\u0627\\u0636\\u063A\\u0637 DELETE \\u0644\\u0625\\u0644\\u063A\\u0627\\u0621 \\u062A\\u062D\\u062F\\u064A\\u062F \\u0643\\u0644 \\u0627\\u0644\\u0639\\u0646\\u0627\\u0635\\u0631",ariaLabelRichSelectDeleteSelection:"\\u0627\\u0636\\u063A\\u0637 DELETE \\u0644\\u0625\\u0644\\u063A\\u0627\\u0621 \\u062A\\u062D\\u062F\\u064A\\u062F \\u0627\\u0644\\u0639\\u0646\\u0635\\u0631",ariaLabelTooltip:"\\u062A\\u0644\\u0645\\u064A\\u062D",ariaLabelContextMenu:"\\u0642\\u0627\\u0626\\u0645\\u0629 \\u0627\\u0644\\u0633\\u064A\\u0627\\u0642",ariaLabelSubMenu:"\\u0627\\u0644\\u0642\\u0627\\u0626\\u0645\\u0629 \\u0627\\u0644\\u0641\\u0631\\u0639\\u064A\\u0629",ariaLabelAggregationFunction:"\\u062F\\u0627\\u0644\\u0629 \\u0627\\u0644\\u062A\\u062C\\u0645\\u064A\\u0639",ariaLabelAdvancedFilterAutocomplete:"\\u0627\\u0644\\u0625\\u0643\\u0645\\u0627\\u0644 \\u0627\\u0644\\u062A\\u0644\\u0642\\u0627\\u0626\\u064A \\u0644\\u0644\\u0641\\u0644\\u0627\\u062A\\u0631 \\u0627\\u0644\\u0645\\u062A\\u0642\\u062F\\u0645\\u0629",ariaLabelAdvancedFilterBuilderAddField:"\\u0625\\u0636\\u0627\\u0641\\u0629 \\u062D\\u0642\\u0644 \\u0645\\u0646\\u0634\\u0626 \\u0627\\u0644\\u0641\\u0644\\u0627\\u062A\\u0631 \\u0627\\u0644\\u0645\\u062A\\u0642\\u062F\\u0645\\u0629",ariaLabelAdvancedFilterBuilderColumnSelectField:"\\u062D\\u0642\\u0644 \\u0627\\u062E\\u062A\\u064A\\u0627\\u0631 \\u0627\\u0644\\u0623\\u0639\\u0645\\u062F\\u0629 \\u0641\\u064A \\u0645\\u0646\\u0634\\u0626 \\u0627\\u0644\\u0641\\u0644\\u0627\\u062A\\u0631 \\u0627\\u0644\\u0645\\u062A\\u0642\\u062F\\u0645\\u0629",ariaLabelAdvancedFilterBuilderOptionSelectField:"\\u062D\\u0642\\u0644 \\u0627\\u062E\\u062A\\u064A\\u0627\\u0631 \\u0627\\u0644\\u062E\\u064A\\u0627\\u0631\\u0627\\u062A \\u0641\\u064A \\u0645\\u0646\\u0634\\u0626 \\u0627\\u0644\\u0641\\u0644\\u0627\\u';
      S = S + '062A\\u0631 \\u0627\\u0644\\u0645\\u062A\\u0642\\u062F\\u0645\\u0629",ariaLabelAdvancedFilterBuilderJoinSelectField:"\\u062D\\u0642\\u0644 \\u0627\\u062E\\u062A\\u064A\\u0627\\u0631 \\u0645\\u0634\\u063A\\u0644 \\u0627\\u0644\\u0631\\u0628\\u0637 \\u0641\\u064A \\u0645\\u0646\\u0634\\u0626 \\u0627\\u0644\\u0641\\u0644\\u0627\\u062A\\u0631 \\u0627\\u0644\\u0645\\u062A\\u0642\\u062F\\u0645\\u0629",ariaColumnPanelList:"\\u0642\\u0627\\u0626\\u0645\\u0629 \\u0627\\u0644\\u0623\\u0639\\u0645\\u062F\\u0629",ariaFilterPanelList:"\\u0642\\u0627\\u0626\\u0645\\u0629 \\u0627\\u0644\\u0645\\u0631\\u0634\\u062D\\u0627\\u062A",thousandSeparator:"\\u060C",decimalSeparator:".",true:"\\u0635\\u062D",false:"\\u062E\\u0637\\u0623",invalidDate:"\\u062A\\u0627\\u0631\\u064A\\u062E \\u063A\\u064A\\u0631 \\u0635\\u0627\\u0644\\u062D",invalidNumber:"\\u0631\\u0642\\u0645 \\u063A\\u064A\\u0631 \\u0635\\u0627\\u0644\\u062D",january:"\\u064A\\u0646\\u0627\\u064A\\u0631",february:"\\u0641\\u0628\\u0631\\u0627\\u064A\\u0631",march:"\\u0645\\u0627\\u0631\\u0633",april:"\\u0623\\u0628\\u0631\\u064A\\u0644",may:"\\u0645\\u0627\\u064A\\u0648",june:"\\u064A\\u0648\\u0646\\u064A\\u0648",july:"\\u064A\\u0648\\u0644\\u064A\\u0648",august:"\\u0623\\u063A\\u0633\\u0637\\u0633",september:"\\u0633\\u0628\\u062A\\u0645\\u0628\\u0631",october:"\\u0623\\u0643\\u062A\\u0648\\u0628\\u0631",november:"\\u0646\\u0648\\u0641\\u0645\\u0628\\u0631",december:"\\u062F\\u064A\\u0633\\u0645\\u0628\\u0631",timeFormatSlashesDDMMYYYY:"DD/MM/YYYY",timeFormatSlashesMMDDYYYY:"MM/DD/YYYY",timeFormatSlashesDDMMYY:"DD/MM/YY",timeFormatSlashesMMDDYY:"MM/DD/YY",timeFormatDotsDDMYY:"DD.M.YY",timeFormatDotsMDDYY:"M.DD.YY",timeFormatDashesYYYYMMDD:"YYYY-MM-DD",timeFormatSpacesDDMMMMYYYY:"DD MMMM YYYY",timeFormatHHMMSS:"\\u0633\\u0627\\u0639\\u0627\\u062A:\\u062F\\u0642\\u0627\\u0626\\u0642:\\u062B\\u0648\\u0627\\u0646\\u064A",timeFormatHHMMSSAmPm:"\\u0633\\u0627\\u0639\\u0627\\u062A:\\u062F\\u0642\\u0627\\u0626\\u0642:\\u062B\\u0648\\u0627\\u0646\\u064A \\u0635/\\u0645"},B={selectAll:"(\\u0418\\u0437\\u0431\\u0435\\u0440\\u0438 \\u0412\\u0441\\u0438\\u0447\\u043A\\u0438)",selectAllSearchResults:"(\\u0418\\u0437\\u0431\\u0435\\u0440\\u0438 \\u04';
      S = S + '12\\u0441\\u0438\\u0447\\u043A\\u0438 \\u0420\\u0435\\u0437\\u0443\\u043B\\u0442\\u0430\\u0442\\u0438 \\u043E\\u0442 \\u0422\\u044A\\u0440\\u0441\\u0435\\u043D\\u0435\\u0442\\u043E)",addCurrentSelectionToFilter:"\\u0414\\u043E\\u0431\\u0430\\u0432\\u0438 \\u0442\\u0435\\u043A\\u0443\\u0449\\u0438\\u044F \\u0438\\u0437\\u0431\\u043E\\u0440 \\u043A\\u044A\\u043C \\u0444\\u0438\\u043B\\u0442\\u044A\\u0440\\u0430",searchOoo:"\\u0422\\u044A\\u0440\\u0441\\u0435\\u043D\\u0435...",blanks:"(\\u041F\\u0440\\u0430\\u0437\\u043D\\u0438)",noMatches:"\\u041D\\u044F\\u043C\\u0430 \\u0441\\u044A\\u0432\\u043F\\u0430\\u0434\\u0435\\u043D\\u0438\\u044F",filterOoo:"\\u0424\\u0438\\u043B\\u0442\\u044A\\u0440...",equals:"\\u0420\\u0430\\u0432\\u043D\\u043E \\u043D\\u0430",notEqual:"\\u041D\\u0435 \\u0435 \\u0440\\u0430\\u0432\\u043D\\u043E \\u043D\\u0430",blank:"\\u041F\\u0440\\u0430\\u0437\\u043D\\u043E",notBlank:"\\u041D\\u0435 \\u0435 \\u043F\\u0440\\u0430\\u0437\\u043D\\u043E",empty:"\\u0418\\u0437\\u0431\\u0435\\u0440\\u0435\\u0442\\u0435 \\u0435\\u0434\\u043D\\u043E",lessThan:"\\u041F\\u043E-\\u043C\\u0430\\u043B\\u043A\\u043E \\u043E\\u0442",greaterThan:"\\u041F\\u043E\\u0432\\u0435\\u0447\\u0435 \\u043E\\u0442",lessThanOrEqual:"\\u041F\\u043E-\\u043C\\u0430\\u043B\\u043A\\u043E \\u0438\\u043B\\u0438 \\u0440\\u0430\\u0432\\u043D\\u043E \\u043D\\u0430",greaterThanOrEqual:"\\u041F\\u043E\\u0432\\u0435\\u0447\\u0435 \\u0438\\u043B\\u0438 \\u0440\\u0430\\u0432\\u043D\\u043E \\u043D\\u0430",inRange:"\\u041C\\u0435\\u0436\\u0434\\u0443",inRangeStart:"\\u041E\\u0442",inRangeEnd:"\\u0414\\u043E",contains:"\\u0421\\u044A\\u0434\\u044A\\u0440\\u0436\\u0430",notContains:"\\u041D\\u0435 \\u0441\\u044A\\u0434\\u044A\\u0440\\u0436\\u0430",startsWith:"\\u0417\\u0430\\u043F\\u043E\\u0447\\u0432\\u0430 \\u0441",endsWith:"\\u0417\\u0430\\u0432\\u044A\\u0440\\u0448\\u0432\\u0430 \\u0441",dateFormatOoo:"yyyy-mm-dd",before:"\\u041F\\u0440\\u0435\\u0434\\u0438",after:"\\u0421\\u043B\\u0435\\u0434",andCondition:"\\u0418",orCondition:"\\u0418\\u041B\\u0418",applyFilter:"\\u041F\\u0440\\u0438\\u043B\\u043E\\u0436\\u0438",resetFilter:"\\u041D\\u0443\\u043B\\u0438\\u0440\\u0430\\u043D\\u0435",clearFilter:"\\u0418\\u0437\\u0447\\u0438\\u0441\\u0442\\u0438",c';
      S = S + 'ancelFilter:"\\u041E\\u0442\\u043A\\u0430\\u0437",textFilter:"\\u0424\\u0438\\u043B\\u0442\\u044A\\u0440 \\u0437\\u0430 \\u0442\\u0435\\u043A\\u0441\\u0442",numberFilter:"\\u0424\\u0438\\u043B\\u0442\\u044A\\u0440 \\u0437\\u0430 \\u0447\\u0438\\u0441\\u043B\\u043E",dateFilter:"\\u0424\\u0438\\u043B\\u0442\\u044A\\u0440 \\u0437\\u0430 \\u0434\\u0430\\u0442\\u0430",setFilter:"\\u041D\\u0430\\u0431\\u043E\\u0440\\u0435\\u043D \\u0444\\u0438\\u043B\\u0442\\u044A\\u0440",groupFilterSelect:"\\u0418\\u0437\\u0431\\u0435\\u0440\\u0435\\u0442\\u0435 \\u043F\\u043E\\u043B\\u0435:",advancedFilterContains:"\\u0441\\u044A\\u0434\\u044A\\u0440\\u0436\\u0430",advancedFilterNotContains:"\\u043D\\u0435 \\u0441\\u044A\\u0434\\u044A\\u0440\\u0436\\u0430",advancedFilterTextEquals:"\\u0440\\u0430\\u0432\\u0435\\u043D \\u0435 \\u043D\\u0430",advancedFilterTextNotEqual:"\\u043D\\u0435 \\u0435 \\u0440\\u0430\\u0432\\u0435\\u043D \\u043D\\u0430",advancedFilterStartsWith:"\\u0437\\u0430\\u043F\\u043E\\u0447\\u0432\\u0430 \\u0441",advancedFilterEndsWith:"\\u0437\\u0430\\u0432\\u044A\\u0440\\u0448\\u0432\\u0430 \\u0441",advancedFilterBlank:"\\u0435 \\u043F\\u0440\\u0430\\u0437\\u043D\\u043E",advancedFilterNotBlank:"\\u043D\\u0435 \\u0435 \\u043F\\u0440\\u0430\\u0437\\u043D\\u043E",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"\\u0435 \\u0432\\u044F\\u0440\\u043D\\u043E",advancedFilterFalse:"\\u0435 \\u043D\\u0435\\u0432\\u044F\\u0440\\u043D\\u043E",advancedFilterAnd:"\\u0418",advancedFilterOr:"\\u0418\\u041B\\u0418",advancedFilterApply:"\\u041F\\u0440\\u0438\\u043B\\u043E\\u0436\\u0438",advancedFilterBuilder:"\\u0421\\u044A\\u0437\\u0434\\u0430\\u0442\\u0435\\u043B",advancedFilterValidationMissingColumn:"\\u041A\\u043E\\u043B\\u043E\\u043D\\u0430\\u0442\\u0430 \\u043B\\u0438\\u043F\\u0441\\u0432\\u0430",advancedFilterValidationMissingOption:"\\u041E\\u043F\\u0446\\u0438\\u044F\\u0442\\u0430 \\u043B\\u0438\\u043F\\u0441\\u0432\\u0430",advancedFilterValidationMissingValue:"\\u0421\\u0442\\u043E\\u0439\\u043D\\u043E\\u0441\\u0442\\u0442\\u0430';
      S = S + ' \\u043B\\u0438\\u043F\\u0441\\u0432\\u0430",advancedFilterValidationInvalidColumn:"\\u041A\\u043E\\u043B\\u043E\\u043D\\u0430\\u0442\\u0430 \\u043D\\u0435 \\u0435 \\u043D\\u0430\\u043C\\u0435\\u0440\\u0435\\u043D\\u0430",advancedFilterValidationInvalidOption:"\\u041E\\u043F\\u0446\\u0438\\u044F\\u0442\\u0430 \\u043D\\u0435 \\u0435 \\u043D\\u0430\\u043C\\u0435\\u0440\\u0435\\u043D\\u0430",advancedFilterValidationMissingQuote:"\\u041B\\u0438\\u043F\\u0441\\u0432\\u0430 \\u043A\\u0440\\u0430\\u0439\\u043D\\u0430 \\u043A\\u0430\\u0432\\u0438\\u0447\\u043A\\u0430 \\u043D\\u0430 \\u0441\\u0442\\u043E\\u0439\\u043D\\u043E\\u0441\\u0442\\u0442\\u0430",advancedFilterValidationNotANumber:"\\u0421\\u0442\\u043E\\u0439\\u043D\\u043E\\u0441\\u0442\\u0442\\u0430 \\u043D\\u0435 \\u0435 \\u0447\\u0438\\u0441\\u043B\\u043E",advancedFilterValidationInvalidDate:"\\u0421\\u0442\\u043E\\u0439\\u043D\\u043E\\u0441\\u0442\\u0442\\u0430 \\u043D\\u0435 \\u0435 \\u0432\\u0430\\u043B\\u0438\\u0434\\u043D\\u0430 \\u0434\\u0430\\u0442\\u0430",advancedFilterValidationMissingCondition:"\\u041B\\u0438\\u043F\\u0441\\u0432\\u0430 \\u0443\\u0441\\u043B\\u043E\\u0432\\u0438\\u0435",advancedFilterValidationJoinOperatorMismatch:"\\u041E\\u043F\\u0435\\u0440\\u0430\\u0446\\u0438\\u043E\\u043D\\u043D\\u0438\\u0442\\u0435 \\u0441\\u044A\\u0435\\u0434\\u0438\\u043D\\u0438\\u0442\\u0435\\u043B\\u0438 \\u0432 \\u0435\\u0434\\u043D\\u043E \\u0443\\u0441\\u043B\\u043E\\u0432\\u0438\\u0435 \\u0442\\u0440\\u044F\\u0431\\u0432\\u0430 \\u0434\\u0430 \\u0441\\u0430 \\u0435\\u0434\\u043D\\u0430\\u043A\\u0432\\u0438",advancedFilterValidationInvalidJoinOperator:"\\u041E\\u043F\\u0435\\u0440\\u0430\\u0446\\u0438\\u043E\\u043D\\u043D\\u0438\\u044F\\u0442 \\u0441\\u044A\\u0435\\u0434\\u0438\\u043D\\u0438\\u0442\\u0435\\u043B \\u043D\\u0435 \\u0435 \\u043D\\u0430\\u043C\\u0435\\u0440\\u0435\\u043D",advancedFilterValidationMissingEndBracket:"\\u041B\\u0438\\u043F\\u0441\\u0432\\u0430 \\u043A\\u0440\\u0430\\u0439\\u043D\\u0430 \\u0441\\u043A\\u043E\\u0431\\u0430",advancedFilterValidationExtraEndBracket:"\\u041F\\u0440\\u0435\\u043A\\u0430\\u043B\\u0435\\u043D\\u043E \\u043C\\u043D\\u043E\\u0433\\u043E \\u043A\\u0440\\u0430\\u0439\\u043D\\u0438 \\u0441\\u043A\\u043E\\u0431\\u';
      S = S + '0438",advancedFilterValidationMessage:"\\u0418\\u043C\\u0430 \\u0433\\u0440\\u0435\\u0448\\u043A\\u0430 \\u0432 \\u0438\\u0437\\u0440\\u0430\\u0437\\u0430. ${variable} - ${variable}.",advancedFilterValidationMessageAtEnd:"\\u0418\\u043C\\u0430 \\u0433\\u0440\\u0435\\u0448\\u043A\\u0430 \\u0432 \\u0438\\u0437\\u0440\\u0430\\u0437\\u0430. ${variable} \\u0432 \\u043A\\u0440\\u0430\\u044F \\u043D\\u0430 \\u0438\\u0437\\u0440\\u0430\\u0437\\u0430.",advancedFilterBuilderTitle:"\\u0420\\u0430\\u0437\\u0448\\u0438\\u0440\\u0435\\u043D \\u0444\\u0438\\u043B\\u0442\\u044A\\u0440",advancedFilterBuilderApply:"\\u041F\\u0440\\u0438\\u043B\\u043E\\u0436\\u0438",advancedFilterBuilderCancel:"\\u041E\\u0442\\u043C\\u0435\\u043D\\u0438",advancedFilterBuilderAddButtonTooltip:"\\u0414\\u043E\\u0431\\u0430\\u0432\\u0438 \\u0444\\u0438\\u043B\\u0442\\u044A\\u0440 \\u0438\\u043B\\u0438 \\u0433\\u0440\\u0443\\u043F\\u0430",advancedFilterBuilderRemoveButtonTooltip:"\\u041F\\u0440\\u0435\\u043C\\u0430\\u0445\\u043D\\u0438",advancedFilterBuilderMoveUpButtonTooltip:"\\u041F\\u0440\\u0435\\u043C\\u0435\\u0441\\u0442\\u0438 \\u043D\\u0430\\u0433\\u043E\\u0440\\u0435",advancedFilterBuilderMoveDownButtonTooltip:"\\u041F\\u0440\\u0435\\u043C\\u0435\\u0441\\u0442\\u0438 \\u043D\\u0430\\u0434\\u043E\\u043B\\u0443",advancedFilterBuilderAddJoin:"\\u0414\\u043E\\u0431\\u0430\\u0432\\u0438 \\u0433\\u0440\\u0443\\u043F\\u0430",advancedFilterBuilderAddCondition:"\\u0414\\u043E\\u0431\\u0430\\u0432\\u0438 \\u0444\\u0438\\u043B\\u0442\\u044A\\u0440",advancedFilterBuilderSelectColumn:"\\u0418\\u0437\\u0431\\u0435\\u0440\\u0438 \\u043A\\u043E\\u043B\\u043E\\u043D\\u0430",advancedFilterBuilderSelectOption:"\\u0418\\u0437\\u0431\\u0435\\u0440\\u0438 \\u043E\\u043F\\u0446\\u0438\\u044F",advancedFilterBuilderEnterValue:"\\u0412\\u044A\\u0432\\u0435\\u0434\\u0438 \\u0441\\u0442\\u043E\\u0439\\u043D\\u043E\\u0441\\u0442...",advancedFilterBuilderValidationAlreadyApplied:"\\u0422\\u0435\\u043A\\u0443\\u0449\\u0438\\u044F\\u0442 \\u0444\\u0438\\u043B\\u0442\\u044A\\u0440 \\u0432\\u0435\\u0447\\u0435 \\u0435 \\u043F\\u0440\\u0438\\u043B\\u043E\\u0436\\u0435\\u043D.",advancedFilterBuilderValidationIncomplete:"\\u041D\\u0435 \\u0432\\u0';
      S = S + '441\\u0438\\u0447\\u043A\\u0438 \\u0443\\u0441\\u043B\\u043E\\u0432\\u0438\\u044F \\u0441\\u0430 \\u0437\\u0430\\u0432\\u044A\\u0440\\u0448\\u0435\\u043D\\u0438.",advancedFilterBuilderValidationSelectColumn:"\\u0422\\u0440\\u044F\\u0431\\u0432\\u0430 \\u0434\\u0430 \\u0438\\u0437\\u0431\\u0435\\u0440\\u0435\\u0442\\u0435 \\u043A\\u043E\\u043B\\u043E\\u043D\\u0430.",advancedFilterBuilderValidationSelectOption:"\\u0422\\u0440\\u044F\\u0431\\u0432\\u0430 \\u0434\\u0430 \\u0438\\u0437\\u0431\\u0435\\u0440\\u0435\\u0442\\u0435 \\u043E\\u043F\\u0446\\u0438\\u044F.",advancedFilterBuilderValidationEnterValue:"\\u0422\\u0440\\u044F\\u0431\\u0432\\u0430 \\u0434\\u0430 \\u0432\\u044A\\u0432\\u0435\\u0434\\u0435\\u0442\\u0435 \\u0441\\u0442\\u043E\\u0439\\u043D\\u043E\\u0441\\u0442.",columns:"\\u041A\\u043E\\u043B\\u043E\\u043D\\u0438",filters:"\\u0424\\u0438\\u043B\\u0442\\u0440\\u0438",pivotMode:"\\u0420\\u0435\\u0436\\u0438\\u043C \\u043D\\u0430 \\u043E\\u0431\\u043E\\u0431\\u0449\\u0435\\u043D\\u0438\\u0435",groups:"\\u0413\\u0440\\u0443\\u043F\\u0438 \\u043F\\u043E \\u0440\\u0435\\u0434\\u043E\\u0432\\u0435",rowGroupColumnsEmptyMessage:"\\u041F\\u043B\\u044A\\u0437\\u043D\\u0435\\u0442\\u0435 \\u0442\\u0443\\u043A, \\u0437\\u0430 \\u0434\\u0430 \\u0437\\u0430\\u0434\\u0430\\u0434\\u0435\\u0442\\u0435 \\u0433\\u0440\\u0443\\u043F\\u0438 \\u043F\\u043E \\u0440\\u0435\\u0434\\u043E\\u0432\\u0435",values:"\\u0421\\u0442\\u043E\\u0439\\u043D\\u043E\\u0441\\u0442\\u0438",valueColumnsEmptyMessage:"\\u041F\\u043B\\u044A\\u0437\\u043D\\u0435\\u0442\\u0435 \\u0442\\u0443\\u043A, \\u0437\\u0430 \\u0434\\u0430 \\u0430\\u0433\\u0440\\u0435\\u0433\\u0438\\u0440\\u0430\\u043D\\u0435",pivots:"\\u0415\\u0442\\u0438\\u043A\\u0435\\u0442\\u0438 \\u043D\\u0430 \\u043A\\u043E\\u043B\\u043E\\u043D\\u0438",pivotColumnsEmptyMessage:"\\u041F\\u043B\\u044A\\u0437\\u043D\\u0435\\u0442\\u0435 \\u0442\\u0443\\u043A, \\u0437\\u0430 \\u0434\\u0430 \\u0437\\u0430\\u0434\\u0430\\u0434\\u0435\\u0442\\u0435 \\u0435\\u0442\\u0438\\u043A\\u0435\\u0442\\u0438 \\u043D\\u0430 \\u043A\\u043E\\u043B\\u043E\\u043D\\u0438",group:"\\u0413\\u0440\\u0443\\u043F\\u0430",rowDragRow:"\\u0440\\u0435\\u0434",rowDragRows:"\\u0440\\u0435\\u0434\\u043E\\u0432\\u0435",loadingOoo:"\\u0417\\u0';
      S = S + '430\\u0440\\u0435\\u0436\\u0434\\u0430\\u043D\\u0435...",loadingError:"\\u0413\\u0420\\u0415\\u0428\\u041A\\u0410",noRowsToShow:"\\u041D\\u044F\\u043C\\u0430 \\u0440\\u0435\\u0434\\u043E\\u0432\\u0435 \\u0437\\u0430 \\u043F\\u043E\\u043A\\u0430\\u0437\\u0432\\u0430\\u043D\\u0435",enabled:"\\u0410\\u043A\\u0442\\u0438\\u0432\\u0438\\u0440\\u0430\\u043D",pinColumn:"\\u0417\\u0430\\u043A\\u0440\\u0435\\u043F\\u0432\\u0430\\u043D\\u0435 \\u043D\\u0430 \\u043A\\u043E\\u043B\\u043E\\u043D\\u0430\\u0442\\u0430",pinLeft:"\\u0417\\u0430\\u043A\\u0440\\u0435\\u043F\\u0432\\u0430\\u043D\\u0435 \\u043D\\u0430\\u043B\\u044F\\u0432\\u043E",pinRight:"\\u0417\\u0430\\u043A\\u0440\\u0435\\u043F\\u0432\\u0430\\u043D\\u0435 \\u043D\\u0430\\u0434\\u044F\\u0441\\u043D\\u043E",noPin:"\\u0411\\u0435\\u0437 \\u0437\\u0430\\u043A\\u0440\\u0435\\u043F\\u0432\\u0430\\u043D\\u0435",valueAggregation:"\\u0410\\u0433\\u0440\\u0435\\u0433\\u0438\\u0440\\u0430\\u043D\\u0435 \\u043D\\u0430 \\u0441\\u0442\\u043E\\u0439\\u043D\\u043E\\u0441\\u0442\\u0438",noAggregation:"\\u041D\\u044F\\u043C\\u0430",autosizeThisColumn:"\\u0410\\u0432\\u0442\\u043E\\u043C\\u0430\\u0442\\u0438\\u0447\\u043D\\u043E \\u043E\\u0440\\u0430\\u0437\\u043C\\u0435\\u0440\\u044F\\u0432\\u0430\\u043D\\u0435 \\u043D\\u0430 \\u0442\\u0430\\u0437\\u0438 \\u043A\\u043E\\u043B\\u043E\\u043D\\u0430",autosizeAllColumns:"\\u0410\\u0432\\u0442\\u043E\\u043C\\u0430\\u0442\\u0438\\u0447\\u043D\\u043E \\u043E\\u0440\\u0430\\u0437\\u043C\\u0435\\u0440\\u044F\\u0432\\u0430\\u043D\\u0435 \\u043D\\u0430 \\u0432\\u0441\\u0438\\u0447\\u043A\\u0438 \\u043A\\u043E\\u043B\\u043E\\u043D\\u0438",groupBy:"\\u0413\\u0440\\u0443\\u043F\\u0438\\u0440\\u0430\\u043D\\u0435 \\u043F\\u043E",ungroupBy:"\\u0420\\u0430\\u0437\\u0433\\u0440\\u0443\\u043F\\u0438\\u0440\\u0430\\u043D\\u0435 \\u043F\\u043E",ungroupAll:"\\u0420\\u0430\\u0437\\u0433\\u0440\\u0443\\u043F\\u0438\\u0440\\u0430\\u043D\\u0435 \\u043D\\u0430 \\u0432\\u0441\\u0438\\u0447\\u043A\\u0438",addToValues:"\\u0414\\u043E\\u0431\\u0430\\u0432\\u044F\\u043D\\u0435 \\u043D\\u0430 ${variable} \\u043A\\u044A\\u043C \\u0441\\u0442\\u043E\\u0439\\u043D\\u043E\\u0441\\u0442\\u0438",removeFromValues:"\\u041F\\u0440\\u0435\\u043C\\u0430\\u0445\\u0432\\u0430\\u043D\\u0435 \\u043D\\u0430 ${v';
      S = S + 'ariable} \\u043E\\u0442 \\u0441\\u0442\\u043E\\u0439\\u043D\\u043E\\u0441\\u0442\\u0438",addToLabels:"\\u0414\\u043E\\u0431\\u0430\\u0432\\u044F\\u043D\\u0435 \\u043D\\u0430 ${variable} \\u043A\\u044A\\u043C \\u0435\\u0442\\u0438\\u043A\\u0435\\u0442\\u0438",removeFromLabels:"\\u041F\\u0440\\u0435\\u043C\\u0430\\u0445\\u0432\\u0430\\u043D\\u0435 \\u043D\\u0430 ${variable} \\u043E\\u0442 \\u0435\\u0442\\u0438\\u043A\\u0435\\u0442\\u0438",resetColumns:"\\u041D\\u0443\\u043B\\u0438\\u0440\\u0430\\u043D\\u0435 \\u043D\\u0430 \\u043A\\u043E\\u043B\\u043E\\u043D\\u0438",expandAll:"\\u0420\\u0430\\u0437\\u0448\\u0438\\u0440\\u044F\\u0432\\u0430\\u043D\\u0435 \\u043D\\u0430 \\u0432\\u0441\\u0438\\u0447\\u043A\\u0438 \\u0433\\u0440\\u0443\\u043F\\u0438 \\u0440\\u0435\\u0434\\u043E\\u0432\\u0435",collapseAll:"\\u0417\\u0430\\u0442\\u0432\\u0430\\u0440\\u044F\\u043D\\u0435 \\u043D\\u0430 \\u0432\\u0441\\u0438\\u0447\\u043A\\u0438 \\u0433\\u0440\\u0443\\u043F\\u0438 \\u0440\\u0435\\u0434\\u043E\\u0432\\u0435",copy:"\\u041A\\u043E\\u043F\\u0438\\u0440\\u0430\\u043D\\u0435",ctrlC:"Ctrl+C",ctrlX:"Ctrl+X",copyWithHeaders:"\\u041A\\u043E\\u043F\\u0438\\u0440\\u0430\\u043D\\u0435 \\u0441 \\u0437\\u0430\\u0433\\u043B\\u0430\\u0432\\u0438\\u044F",copyWithGroupHeaders:"\\u041A\\u043E\\u043F\\u0438\\u0440\\u0430\\u043D\\u0435 \\u0441 \\u0433\\u0440\\u0443\\u043F\\u043E\\u0432\\u0438 \\u0437\\u0430\\u0433\\u043B\\u0430\\u0432\\u0438\\u044F",cut:"\\u0418\\u0437\\u0440\\u044F\\u0437\\u0432\\u0430\\u043D\\u0435",paste:"\\u041F\\u043E\\u0441\\u0442\\u0430\\u0432\\u044F\\u043D\\u0435",ctrlV:"Ctrl+V",export:"\\u0415\\u043A\\u0441\\u043F\\u043E\\u0440\\u0442\\u0438\\u0440\\u0430\\u043D\\u0435",csvExport:"\\u0415\\u043A\\u0441\\u043F\\u043E\\u0440\\u0442\\u0438\\u0440\\u0430\\u043D\\u0435 \\u0432 CSV",excelExport:"\\u0415\\u043A\\u0441\\u043F\\u043E\\u0440\\u0442\\u0438\\u0440\\u0430\\u043D\\u0435 \\u0432 Excel",columnFilter:"\\u0424\\u0438\\u043B\\u0442\\u044A\\u0440 \\u043D\\u0430 \\u043A\\u043E\\u043B\\u043E\\u043D\\u0430",columnChooser:"\\u0418\\u0437\\u0431\\u043E\\u0440 \\u043D\\u0430 \\u043A\\u043E\\u043B\\u043E\\u043D\\u0438",sortAscending:"\\u0421\\u043E\\u0440\\u0442\\u0438\\u0440\\u0430\\u043D\\u0435 \\u0432\\u044A\\u0432 \\u0432\\u044A\\u0437\\u0445\\u04';
      S = S + '3E\\u0434\\u044F\\u0449 \\u0440\\u0435\\u0434",sortDescending:"\\u0421\\u043E\\u0440\\u0442\\u0438\\u0440\\u0430\\u043D\\u0435 \\u0432 \\u043D\\u0438\\u0437\\u0445\\u043E\\u0434\\u044F\\u0449 \\u0440\\u0435\\u0434",sortUnSort:"\\u0418\\u0437\\u0447\\u0438\\u0441\\u0442\\u0432\\u0430\\u043D\\u0435 \\u043D\\u0430 \\u0441\\u043E\\u0440\\u0442\\u0438\\u0440\\u0430\\u043D\\u0435\\u0442\\u043E",sum:"\\u0421\\u0443\\u043C\\u0430",first:"\\u041F\\u044A\\u0440\\u0432\\u0438",last:"\\u041F\\u043E\\u0441\\u043B\\u0435\\u0434\\u0435\\u043D",min:"\\u041C\\u0438\\u043D\\u0438\\u043C\\u0430\\u043B\\u0435\\u043D",max:"\\u041C\\u0430\\u043A\\u0441\\u0438\\u043C\\u0430\\u043B\\u0435\\u043D",none:"\\u041D\\u044F\\u043C\\u0430",count:"\\u0411\\u0440\\u043E\\u0439",avg:"\\u0421\\u0440\\u0435\\u0434\\u043D\\u043E",filteredRows:"\\u0424\\u0438\\u043B\\u0442\\u0440\\u0438\\u0440\\u0430\\u043D\\u0438",selectedRows:"\\u0418\\u0437\\u0431\\u0440\\u0430\\u043D\\u0438",totalRows:"\\u041E\\u0431\\u0449\\u043E \\u0420\\u0435\\u0434\\u043E\\u0432\\u0435",totalAndFilteredRows:"\\u0420\\u0435\\u0434\\u043E\\u0432\\u0435",more:"\\u041E\\u0449\\u0435",to:"\\u0434\\u043E",of:"\\u043E\\u0442",page:"\\u0421\\u0442\\u0440\\u0430\\u043D\\u0438\\u0446\\u0430",pageLastRowUnknown:"?",nextPage:"\\u0421\\u043B\\u0435\\u0434\\u0432\\u0430\\u0449\\u0430 \\u0421\\u0442\\u0440\\u0430\\u043D\\u0438\\u0446\\u0430",lastPage:"\\u041F\\u043E\\u0441\\u043B\\u0435\\u0434\\u043D\\u0430 \\u0421\\u0442\\u0440\\u0430\\u043D\\u0438\\u0446\\u0430",firstPage:"\\u041F\\u044A\\u0440\\u0432\\u0430 \\u0421\\u0442\\u0440\\u0430\\u043D\\u0438\\u0446\\u0430",previousPage:"\\u041F\\u0440\\u0435\\u0434\\u0438\\u0448\\u043D\\u0430 \\u0421\\u0442\\u0440\\u0430\\u043D\\u0438\\u0446\\u0430",pageSizeSelectorLabel:"\\u0420\\u0430\\u0437\\u043C\\u0435\\u0440 \\u043D\\u0430 \\u0421\\u0442\\u0440\\u0430\\u043D\\u0438\\u0446\\u0430\\u0442\\u0430:",footerTotal:"\\u041E\\u0431\\u0449\\u043E",pivotColumnGroupTotals:"\\u041E\\u0431\\u0449\\u043E",pivotChartAndPivotMode:"\\u0412\\u044A\\u0440\\u0442\\u044F\\u0449\\u0430 \\u0434\\u0438\\u0430\\u0433\\u0440\\u0430\\u043C\\u0430 \\u0438 \\u0432\\u044A\\u0440\\u0442\\u044F\\u0449 \\u0440\\u0435\\u0436\\u0438\\u043C",pivotChart:"\\u0412\\u044A\\u0440\\u0442\\u044F\\u044';
      S = S + '9\\u0430 \\u0434\\u0438\\u0430\\u0433\\u0440\\u0430\\u043C\\u0430",chartRange:"\\u0414\\u0438\\u0430\\u043F\\u0430\\u0437\\u043E\\u043D \\u043D\\u0430 \\u0434\\u0438\\u0430\\u0433\\u0440\\u0430\\u043C\\u0430\\u0442\\u0430",columnChart:"\\u041A\\u043E\\u043B\\u043E\\u043D\\u0430",groupedColumn:"\\u0413\\u0440\\u0443\\u043F\\u0438\\u0440\\u0430\\u043D\\u0438",stackedColumn:"\\u041F\\u043E\\u0434\\u0440\\u0435\\u0434\\u0435\\u043D\\u0438",normalizedColumn:"100% \\u041F\\u043E\\u0434\\u0440\\u0435\\u0434\\u0435\\u043D\\u0438",barChart:"\\u041B\\u0435\\u043D\\u0442\\u0430",groupedBar:"\\u0413\\u0440\\u0443\\u043F\\u0438\\u0440\\u0430\\u043D\\u0438",stackedBar:"\\u041F\\u043E\\u0434\\u0440\\u0435\\u0434\\u0435\\u043D\\u0438",normalizedBar:"100% \\u041F\\u043E\\u0434\\u0440\\u0435\\u0434\\u0435\\u043D\\u0438",pieChart:"\\u041A\\u0440\\u044A\\u0433\\u043E\\u0432\\u0430 \\u0434\\u0438\\u0430\\u0433\\u0440\\u0430\\u043C\\u0430",pie:"\\u041A\\u0440\\u044A\\u0433",donut:"\\u0420\\u0438\\u043D\\u0433",line:"\\u041B\\u0438\\u043D\\u0438\\u044F",xyChart:"X Y (\\u0420\\u0430\\u0437\\u043F\\u0440\\u044A\\u0441\\u043D\\u0430\\u0442\\u043E)",scatter:"\\u0420\\u0430\\u0437\\u043F\\u0440\\u044A\\u0441\\u043D\\u0430\\u0442\\u043E",bubble:"\\u041C\\u0435\\u0445\\u0443\\u0440\\u0447\\u0435\\u0441\\u0442\\u0430",areaChart:"\\u041E\\u0431\\u043B\\u0430\\u0441\\u0442",area:"\\u041E\\u0431\\u043B\\u0430\\u0441\\u0442",stackedArea:"\\u041F\\u043E\\u0434\\u0440\\u0435\\u0434\\u0435\\u043D\\u0430",normalizedArea:"100% \\u041F\\u043E\\u0434\\u0440\\u0435\\u0434\\u0435\\u043D\\u0430",histogramChart:"\\u0425\\u0438\\u0441\\u0442\\u043E\\u0433\\u0440\\u0430\\u043C\\u0430",polarChart:"\\u041F\\u043E\\u043B\\u044F\\u0440\\u043D\\u0430",radarLine:"\\u0420\\u0430\\u0434\\u0430\\u0440\\u043D\\u0430 \\u043B\\u0438\\u043D\\u0438\\u044F",radarArea:"\\u0420\\u0430\\u0434\\u0430\\u0440\\u043D\\u0430 \\u043E\\u0431\\u043B\\u0430\\u0441\\u0442",nightingale:"\\u041D\\u0430\\u0439\\u0442\\u0438\\u043D\\u0433\\u0435\\u0439\\u043B",radialColumn:"\\u0420\\u0430\\u0434\\u0438\\u0430\\u043B\\u043D\\u0430 \\u043A\\u043E\\u043B\\u043E\\u043D\\u0430",radialBar:"\\u0420\\u0430\\u0434\\u0438\\u0430\\u043B\\u043D\\u0430 \\u043B\\u0435\\u043D\\u0442\\u0430",statisticalChart:"\\u0421\\u';
      S = S + '0442\\u0430\\u0442\\u0438\\u0441\\u0442\\u0438\\u0447\\u0435\\u0441\\u043A\\u0430",boxPlot:"\\u041A\\u0443\\u0442\\u0438\\u0435\\u0432\\u0430 \\u0434\\u0438\\u0430\\u0433\\u0440\\u0430\\u043C\\u0430",rangeBar:"\\u0414\\u0438\\u0430\\u043F\\u0430\\u0437\\u043E\\u043D\\u043D\\u0430 \\u043B\\u0435\\u043D\\u0442\\u0430",rangeArea:"\\u0414\\u0438\\u0430\\u043F\\u0430\\u0437\\u043E\\u043D\\u043D\\u0430 \\u043E\\u0431\\u043B\\u0430\\u0441\\u0442",hierarchicalChart:"\\u0419\\u0435\\u0440\\u0430\\u0440\\u0445\\u0438\\u0447\\u043D\\u0430",treemap:"\\u0414\\u044A\\u0440\\u0432\\u043E\\u0432\\u0438\\u0434\\u043D\\u0430 \\u043A\\u0430\\u0440\\u0442\\u0430",sunburst:"\\u0421\\u043B\\u044A\\u043D\\u0447\\u0435\\u0432 \\u0438\\u0437\\u0440\\u0438\\u0433\\u0432\\u0430\\u043D\\u0435",specializedChart:"\\u0421\\u043F\\u0435\\u0446\\u0438\\u0430\\u043B\\u0438\\u0437\\u0438\\u0440\\u0430\\u043D\\u0430",waterfall:"\\u041A\\u0430\\u0441\\u043A\\u0430\\u0434\\u043D\\u0430",heatmap:"\\u0422\\u043E\\u043F\\u043B\\u0438\\u043D\\u043D\\u0430 \\u043A\\u0430\\u0440\\u0442\\u0430",combinationChart:"\\u041A\\u043E\\u043C\\u0431\\u0438\\u043D\\u0438\\u0440\\u0430\\u043D\\u0430",columnLineCombo:"\\u041A\\u043E\\u043B\\u043E\\u043D\\u0430 \\u0438 \\u043B\\u0438\\u043D\\u0438\\u044F",AreaColumnCombo:"\\u041E\\u0431\\u043B\\u0430\\u0441\\u0442 \\u0438 \\u043A\\u043E\\u043B\\u043E\\u043D\\u0430",pivotChartTitle:"\\u0421\\u0432\\u043E\\u0434\\u043D\\u0430 \\u0414\\u0438\\u0430\\u0433\\u0440\\u0430\\u043C\\u0430",rangeChartTitle:"\\u0414\\u0438\\u0430\\u043F\\u0430\\u0437\\u043E\\u043D \\u0414\\u0438\\u0430\\u0433\\u0440\\u0430\\u043C\\u0430",settings:"\\u0413\\u0440\\u0430\\u0444\\u0438\\u043A\\u0430",data:"\\u041D\\u0430\\u0441\\u0442\\u0440\\u043E\\u0439\\u043A\\u0438",format:"\\u041F\\u0435\\u0440\\u0441\\u043E\\u043D\\u0430\\u043B\\u0438\\u0437\\u0438\\u0440\\u0430\\u043D\\u0435",categories:"\\u041A\\u0430\\u0442\\u0435\\u0433\\u043E\\u0440\\u0438\\u0438",defaultCategory:"(\\u041D\\u044F\\u043C\\u0430)",series:"\\u0421\\u0435\\u0440\\u0438\\u0438",switchCategorySeries:"\\u0421\\u043C\\u044F\\u043D\\u0430 \\u043D\\u0430 \\u041A\\u0430\\u0442\\u0435\\u0433\\u043E\\u0440\\u0438\\u044F/\\u0421\\u0435\\u0440\\u0438\\u044F",categoryValues:"\\u0421\\u0442\\u043E\\u0439\\u043D';
      S = S + '\\u043E\\u0441\\u0442\\u0438 \\u043D\\u0430 \\u041A\\u0430\\u0442\\u0435\\u0433\\u043E\\u0440\\u0438\\u044F",seriesLabels:"\\u0415\\u0442\\u0438\\u043A\\u0435\\u0442\\u0438 \\u043D\\u0430 \\u0421\\u0435\\u0440\\u0438\\u0438",aggregate:"\\u0410\\u0433\\u0440\\u0435\\u0433\\u0430\\u0446\\u0438\\u044F",xyValues:"X Y \\u0421\\u0442\\u043E\\u0439\\u043D\\u043E\\u0441\\u0442\\u0438",paired:"\\u0421\\u0432\\u044A\\u0440\\u0437\\u0430\\u043D \\u0420\\u0435\\u0436\\u0438\\u043C",axis:"\\u041E\\u0441",xAxis:"\\u0425\\u043E\\u0440\\u0438\\u0437\\u043E\\u043D\\u0442\\u0430\\u043B\\u043D\\u0430 \\u041E\\u0441",yAxis:"\\u0412\\u0435\\u0440\\u0442\\u0438\\u043A\\u0430\\u043B\\u043D\\u0430 \\u041E\\u0441",polarAxis:"\\u041F\\u043E\\u043B\\u044F\\u0440\\u043D\\u0430 \\u041E\\u0441",radiusAxis:"\\u0420\\u0430\\u0434\\u0438\\u0443\\u0441 \\u041E\\u0441",navigator:"\\u041D\\u0430\\u0432\\u0438\\u0433\\u0430\\u0442\\u043E\\u0440",zoom:"\\u0423\\u0432\\u0435\\u043B\\u0438\\u0447\\u0430\\u0432\\u0430\\u043D\\u0435",animation:"\\u0410\\u043D\\u0438\\u043C\\u0430\\u0446\\u0438\\u044F",crosshair:"\\u041F\\u0440\\u0438\\u0446\\u0435\\u043B",color:"\\u0426\\u0432\\u044F\\u0442",thickness:"\\u0414\\u0435\\u0431\\u0435\\u043B\\u0438\\u043D\\u0430",preferredLength:"\\u041F\\u0440\\u0435\\u0434\\u043F\\u043E\\u0447\\u0438\\u0442\\u0430\\u043D\\u0430 \\u0414\\u044A\\u043B\\u0436\\u0438\\u043D\\u0430",xType:"X \\u0422\\u0438\\u043F",axisType:"\\u0422\\u0438\\u043F \\u041E\\u0441",automatic:"\\u0410\\u0432\\u0442\\u043E\\u043C\\u0430\\u0442\\u0438\\u0447\\u043D\\u043E",category:"\\u041A\\u0430\\u0442\\u0435\\u0433\\u043E\\u0440\\u0438\\u044F",number:"\\u0427\\u0438\\u0441\\u043B\\u043E",time:"\\u0412\\u0440\\u0435\\u043C\\u0435",timeFormat:"\\u0424\\u043E\\u0440\\u043C\\u0430\\u0442 \\u043D\\u0430 \\u0412\\u0440\\u0435\\u043C\\u0435\\u0442\\u043E",autoRotate:"\\u0410\\u0432\\u0442\\u043E\\u043C\\u0430\\u0442\\u0438\\u0447\\u043D\\u043E \\u0417\\u0430\\u0432\\u044A\\u0440\\u0442\\u0430\\u043D\\u0435",labelRotation:"\\u0417\\u0430\\u0432\\u044A\\u0440\\u0442\\u0430\\u043D\\u0435 \\u043D\\u0430 \\u0415\\u0442\\u0438\\u043A\\u0435\\u0442\\u0438",circle:"\\u041A\\u0440\\u044A\\u0433",polygon:"\\u041C\\u043D\\u043E\\u0433\\u043E\\u044A\\u0433\\u044A\\u043B\\u043D\\u0438\\u043A';
      S = S + '",square:"\\u041A\\u0432\\u0430\\u0434\\u0440\\u0430\\u0442",cross:"\\u041A\\u0440\\u044A\\u0441\\u0442",diamond:"\\u0420\\u043E\\u043C\\u0431",plus:"\\u041F\\u043B\\u044E\\u0441",triangle:"\\u0422\\u0440\\u0438\\u044A\\u0433\\u044A\\u043B\\u043D\\u0438\\u043A",heart:"\\u0421\\u044A\\u0440\\u0446\\u0435",orientation:"\\u041E\\u0440\\u0438\\u0435\\u043D\\u0442\\u0430\\u0446\\u0438\\u044F",fixed:"\\u0424\\u0438\\u043A\\u0441\\u0438\\u0440\\u0430\\u043D",parallel:"\\u041F\\u0430\\u0440\\u0430\\u043B\\u0435\\u043B\\u0435\\u043D",perpendicular:"\\u041F\\u0435\\u0440\\u043F\\u0435\\u043D\\u0434\\u0438\\u043A\\u0443\\u043B\\u044F\\u0440\\u0435\\u043D",radiusAxisPosition:"\\u041F\\u043E\\u0437\\u0438\\u0446\\u0438\\u044F",ticks:"\\u041C\\u0435\\u0440\\u043A\\u0438",gridLines:"\\u0412\\u043E\\u0434\\u0435\\u0449\\u0438 \\u041B\\u0438\\u043D\\u0438\\u0438",width:"\\u0428\\u0438\\u0440\\u0438\\u043D\\u0430",height:"\\u0412\\u0438\\u0441\\u043E\\u0447\\u0438\\u043D\\u0430",length:"\\u0414\\u044A\\u043B\\u0436\\u0438\\u043D\\u0430",padding:"\\u041F\\u043E\\u043F\\u044A\\u043B\\u0432\\u0430\\u043D\\u0435",spacing:"\\u0420\\u0430\\u0437\\u0441\\u0442\\u043E\\u044F\\u043D\\u0438\\u0435",chartStyle:"\\u0421\\u0442\\u0438\\u043B \\u043D\\u0430 \\u0414\\u0438\\u0430\\u0433\\u0440\\u0430\\u043C\\u0430",title:"\\u0417\\u0430\\u0433\\u043B\\u0430\\u0432\\u0438\\u0435",chartTitles:"\\u0417\\u0430\\u0433\\u043B\\u0430\\u0432\\u0438\\u044F \\u043D\\u0430 \\u0414\\u0438\\u0430\\u0433\\u0440\\u0430\\u043C\\u0430",chartTitle:"\\u0417\\u0430\\u0433\\u043B\\u0430\\u0432\\u0438\\u0435 \\u043D\\u0430 \\u0414\\u0438\\u0430\\u0433\\u0440\\u0430\\u043C\\u0430",chartSubtitle:"\\u041F\\u043E\\u0434\\u0437\\u0430\\u0433\\u043B\\u0430\\u0432\\u0438\\u0435",horizontalAxisTitle:"\\u0417\\u0430\\u0433\\u043B\\u0430\\u0432\\u0438\\u0435 \\u043D\\u0430 \\u0425\\u043E\\u0440\\u0438\\u0437\\u043E\\u043D\\u0442\\u0430\\u043B\\u043D\\u0430 \\u041E\\u0441",verticalAxisTitle:"\\u0417\\u0430\\u0433\\u043B\\u0430\\u0432\\u0438\\u0435 \\u043D\\u0430 \\u0412\\u0435\\u0440\\u0442\\u0438\\u043A\\u0430\\u043B\\u043D\\u0430 \\u041E\\u0441",polarAxisTitle:"\\u0417\\u0430\\u0433\\u043B\\u0430\\u0432\\u0438\\u0435 \\u043D\\u0430 \\u041F\\u043E\\u043B\\u044F\\u0440\\u043D\\u0430 \\u041E\\u0441",';
      S = S + 'titlePlaceholder:"\\u0417\\u0430\\u0433\\u043B\\u0430\\u0432\\u0438\\u0435 \\u043D\\u0430 \\u0414\\u0438\\u0430\\u0433\\u0440\\u0430\\u043C\\u0430",background:"\\u0424\\u043E\\u043D",font:"\\u0428\\u0440\\u0438\\u0444\\u0442",weight:"\\u0422\\u0435\\u0433\\u043B\\u043E",top:"\\u0413\\u043E\\u0440\\u0435",right:"\\u0414\\u044F\\u0441\\u043D\\u043E",bottom:"\\u0414\\u043E\\u043B\\u0443",left:"\\u041B\\u044F\\u0432\\u043E",labels:"\\u0415\\u0442\\u0438\\u043A\\u0435\\u0442\\u0438",calloutLabels:"\\u041E\\u0431\\u0430\\u0436\\u0434\\u0430\\u0449\\u0438 \\u0415\\u0442\\u0438\\u043A\\u0435\\u0442\\u0438",sectorLabels:"\\u0415\\u0442\\u0438\\u043A\\u0435\\u0442\\u0438 \\u043D\\u0430 \\u0421\\u0435\\u043A\\u0442\\u043E\\u0440\\u0438",positionRatio:"\\u0421\\u044A\\u043E\\u0442\\u043D\\u043E\\u0448\\u0435\\u043D\\u0438\\u0435 \\u043D\\u0430 \\u041F\\u043E\\u0437\\u0438\\u0446\\u0438\\u044F",size:"\\u0420\\u0430\\u0437\\u043C\\u0435\\u0440",shape:"\\u0424\\u043E\\u0440\\u043C\\u0430",minSize:"\\u041C\\u0438\\u043D\\u0438\\u043C\\u0430\\u043B\\u0435\\u043D \\u0420\\u0430\\u0437\\u043C\\u0435\\u0440",maxSize:"\\u041C\\u0430\\u043A\\u0441\\u0438\\u043C\\u0430\\u043B\\u0435\\u043D \\u0420\\u0430\\u0437\\u043C\\u0435\\u0440",legend:"\\u041B\\u0435\\u0433\\u0435\\u043D\\u0434\\u0430",position:"\\u041F\\u043E\\u0437\\u0438\\u0446\\u0438\\u044F",markerSize:"\\u0420\\u0430\\u0437\\u043C\\u0435\\u0440 \\u043D\\u0430 \\u041C\\u0430\\u0440\\u043A\\u0435\\u0440\\u0430",markerStroke:"\\u041A\\u043E\\u043D\\u0442\\u0443\\u0440 \\u043D\\u0430 \\u041C\\u0430\\u0440\\u043A\\u0435\\u0440\\u0430",markerPadding:"\\u041F\\u043E\\u043F\\u044A\\u043B\\u0432\\u0430\\u043D\\u0435 \\u043D\\u0430 \\u041C\\u0430\\u0440\\u043A\\u0435\\u0440\\u0430",itemSpacing:"\\u0420\\u0430\\u0437\\u0441\\u0442\\u043E\\u044F\\u043D\\u0438\\u0435 \\u041C\\u0435\\u0436\\u0434\\u0443 \\u0410\\u0440\\u0442\\u0438\\u043A\\u0443\\u043B\\u0438",itemPaddingX:"\\u0425\\u043E\\u0440\\u0438\\u0437\\u043E\\u043D\\u0442\\u0430\\u043B\\u043D\\u043E \\u041F\\u043E\\u043F\\u044A\\u043B\\u0432\\u0430\\u043D\\u0435 \\u043D\\u0430 \\u0410\\u0440\\u0442\\u0438\\u043A\\u0443\\u043B",itemPaddingY:"\\u0412\\u0435\\u0440\\u0442\\u0438\\u043A\\u0430\\u043B\\u043D\\u043E \\u041F\\u043E\\u043F\\u044A\\u043B\\u0432\\u0430';
      S = S + '\\u043D\\u0435 \\u043D\\u0430 \\u0410\\u0440\\u0442\\u0438\\u043A\\u0443\\u043B",layoutHorizontalSpacing:"\\u0425\\u043E\\u0440\\u0438\\u0437\\u043E\\u043D\\u0442\\u0430\\u043B\\u043D\\u043E \\u0420\\u0430\\u0437\\u0441\\u0442\\u043E\\u044F\\u043D\\u0438\\u0435",layoutVerticalSpacing:"\\u0412\\u0435\\u0440\\u0442\\u0438\\u043A\\u0430\\u043B\\u043D\\u043E \\u0420\\u0430\\u0437\\u0441\\u0442\\u043E\\u044F\\u043D\\u0438\\u0435",strokeWidth:"\\u0414\\u0435\\u0431\\u0435\\u043B\\u0438\\u043D\\u0430 \\u043D\\u0430 \\u041B\\u0438\\u043D\\u0438\\u044F\\u0442\\u0430",offset:"\\u0418\\u0437\\u043C\\u0435\\u0441\\u0442\\u0432\\u0430\\u043D\\u0435",offsets:"\\u0418\\u0437\\u043C\\u0435\\u0441\\u0442\\u0432\\u0430\\u043D\\u0438\\u044F",tooltips:"\\u041F\\u043E\\u0434\\u0441\\u043A\\u0430\\u0437\\u043A\\u0438",callout:"\\u041E\\u0431\\u0430\\u0436\\u0434\\u0430\\u043D\\u0435",markers:"\\u041C\\u0430\\u0440\\u043A\\u0435\\u0440\\u0438",shadow:"\\u0421\\u044F\\u043D\\u043A\\u0430",blur:"\\u0420\\u0430\\u0437\\u043C\\u0430\\u0437\\u0432\\u0430\\u043D\\u0435",xOffset:"\\u0418\\u0437\\u043C\\u0435\\u0441\\u0442\\u0432\\u0430\\u043D\\u0435 \\u043F\\u043E X",yOffset:"\\u0418\\u0437\\u043C\\u0435\\u0441\\u0442\\u0432\\u0430\\u043D\\u0435 \\u043F\\u043E Y",lineWidth:"\\u0428\\u0438\\u0440\\u0438\\u043D\\u0430 \\u043D\\u0430 \\u041B\\u0438\\u043D\\u0438\\u044F\\u0442\\u0430",lineDash:"\\u041F\\u0440\\u0435\\u043A\\u044A\\u0441\\u043D\\u0430\\u0442\\u0438 \\u041B\\u0438\\u043D\\u0438\\u0438",lineDashOffset:"\\u0418\\u0437\\u043C\\u0435\\u0441\\u0442\\u0432\\u0430\\u043D\\u0435 \\u043D\\u0430 \\u041F\\u0440\\u0435\\u043A\\u044A\\u0441\\u043D\\u0430\\u0442\\u0438 \\u041B\\u0438\\u043D\\u0438\\u0438",scrollingZoom:"\\u041F\\u0440\\u0435\\u0432\\u044A\\u0440\\u0442\\u0430\\u043D\\u0435",scrollingStep:"\\u0421\\u0442\\u044A\\u043F\\u043A\\u0430 \\u043F\\u0440\\u0438 \\u041F\\u0440\\u0435\\u0432\\u044A\\u0440\\u0442\\u0430\\u043D\\u0435",selectingZoom:"\\u0418\\u0437\\u0431\\u0438\\u0440\\u0430\\u043D\\u0435",durationMillis:"\\u041F\\u0440\\u043E\\u0434\\u044A\\u043B\\u0436\\u0438\\u0442\\u0435\\u043B\\u043D\\u043E\\u0441\\u0442 (ms)",crosshairLabel:"\\u0415\\u0442\\u0438\\u043A\\u0435\\u0442",crosshairSnap:"\\u041F\\u0440\\u0438\\u0432\\u044A\\u0440\\u0437\\u0432\\u04';
      S = S + '30\\u043D\\u0435 \\u043A\\u044A\\u043C \\u0412\\u0440\\u044A\\u0437\\u043A\\u0430",normal:"\\u041D\\u043E\\u0440\\u043C\\u0430\\u043B\\u0435\\u043D",bold:"\\u0423\\u0434\\u0435\\u0431\\u0435\\u043B\\u0435\\u043D",italic:"\\u041D\\u0430\\u043A\\u043B\\u043E\\u043D\\u0435\\u043D",boldItalic:"\\u0423\\u0434\\u0435\\u0431\\u0435\\u043B\\u0435\\u043D \\u0438 \\u041D\\u0430\\u043A\\u043B\\u043E\\u043D\\u0435\\u043D",predefined:"\\u041F\\u0440\\u0435\\u0434\\u0432\\u0430\\u0440\\u0438\\u0442\\u0435\\u043B\\u043D\\u043E \\u041E\\u043F\\u0440\\u0435\\u0434\\u0435\\u043B\\u0435\\u043D",fillOpacity:"\\u041F\\u0440\\u043E\\u0437\\u0440\\u0430\\u0447\\u043D\\u043E\\u0441\\u0442 \\u043D\\u0430 \\u0417\\u0430\\u043F\\u044A\\u043B\\u0432\\u0430\\u043D\\u0435",strokeColor:"\\u0426\\u0432\\u044F\\u0442 \\u043D\\u0430 \\u041B\\u0438\\u043D\\u0438\\u044F\\u0442\\u0430",strokeOpacity:"\\u041F\\u0440\\u043E\\u0437\\u0440\\u0430\\u0447\\u043D\\u043E\\u0441\\u0442 \\u043D\\u0430 \\u041B\\u0438\\u043D\\u0438\\u044F\\u0442\\u0430",miniChart:"\\u041C\\u0438\\u043D\\u0438 \\u0414\\u0438\\u0430\\u0433\\u0440\\u0430\\u043C\\u0430",histogramBinCount:"\\u0411\\u0440\\u043E\\u0439 \\u043D\\u0430 \\u041A\\u043E\\u0444\\u0438",connectorLine:"\\u0421\\u0432\\u044A\\u0440\\u0437\\u0432\\u0430\\u0449\\u0430 \\u041B\\u0438\\u043D\\u0438\\u044F",seriesItems:"\\u041E\\u0431\\u0435\\u043A\\u0442\\u0438 \\u0432 \\u0421\\u0435\\u0440\\u0438\\u044F",seriesItemType:"\\u0422\\u0438\\u043F \\u041E\\u0431\\u0435\\u043A\\u0442",seriesItemPositive:"\\u041F\\u043E\\u043B\\u043E\\u0436\\u0438\\u0442\\u0435\\u043B\\u043D\\u043E",seriesItemNegative:"\\u041E\\u0442\\u0440\\u0438\\u0446\\u0430\\u0442\\u0435\\u043B\\u043D\\u043E",seriesItemLabels:"\\u0415\\u0442\\u0438\\u043A\\u0435\\u0442\\u0438 \\u043D\\u0430 \\u041E\\u0431\\u0435\\u043A\\u0442\\u0438",columnGroup:"\\u041A\\u043E\\u043B\\u043E\\u043D\\u0430",barGroup:"\\u041B\\u0435\\u043D\\u0442\\u0430",pieGroup:"\\u041F\\u0430\\u0439",lineGroup:"\\u041B\\u0438\\u043D\\u0438\\u044F",scatterGroup:"X Y (\\u0422\\u043E\\u0447\\u043A\\u0438)",areaGroup:"\\u041E\\u0431\\u043B\\u0430\\u0441\\u0442",polarGroup:"\\u041F\\u043E\\u043B\\u044F\\u0440\\u043D\\u0430",statisticalGroup:"\\u0421\\u0442\\u0430\\u0442\\u0438\\u0441\\u0442\\u0438\\u04';
      S = S + '47\\u0435\\u0441\\u043A\\u0430",hierarchicalGroup:"\\u0419\\u0435\\u0440\\u0430\\u0440\\u0445\\u0438\\u0447\\u043D\\u0430",specializedGroup:"\\u0421\\u043F\\u0435\\u0446\\u0438\\u0430\\u043B\\u0438\\u0437\\u0438\\u0440\\u0430\\u043D\\u0430",combinationGroup:"\\u041A\\u043E\\u043C\\u0431\\u0438\\u043D\\u0438\\u0440\\u0430\\u043D\\u0430",groupedColumnTooltip:"\\u0413\\u0440\\u0443\\u043F\\u0438\\u0440\\u0430\\u043D\\u043E",stackedColumnTooltip:"\\u0421\\u043B\\u043E\\u0435\\u043D\\u043E",normalizedColumnTooltip:"100% \\u0421\\u043B\\u043E\\u0435\\u043D\\u043E",groupedBarTooltip:"\\u0413\\u0440\\u0443\\u043F\\u0438\\u0440\\u0430\\u043D\\u043E",stackedBarTooltip:"\\u0421\\u043B\\u043E\\u0435\\u043D\\u043E",normalizedBarTooltip:"100% \\u0421\\u043B\\u043E\\u0435\\u043D\\u043E",pieTooltip:"\\u041F\\u0430\\u0439",donutTooltip:"\\u041F\\u043E\\u043D\\u0438\\u0447\\u043A\\u0430",lineTooltip:"\\u041B\\u0438\\u043D\\u0438\\u044F",groupedAreaTooltip:"\\u041E\\u0431\\u043B\\u0430\\u0441\\u0442",stackedAreaTooltip:"\\u0421\\u043B\\u043E\\u0435\\u043D\\u0430",normalizedAreaTooltip:"100% \\u0421\\u043B\\u043E\\u0435\\u043D\\u0430",scatterTooltip:"\\u0422\\u043E\\u0447\\u043A\\u0438",bubbleTooltip:"\\u041C\\u0435\\u0445\\u0443\\u0440\\u0447\\u0435",histogramTooltip:"\\u0425\\u0438\\u0441\\u0442\\u043E\\u0433\\u0440\\u0430\\u043C\\u0430",radialColumnTooltip:"\\u0420\\u0430\\u0434\\u0438\\u0430\\u0446\\u0438\\u043E\\u043D\\u043D\\u0430 \\u041A\\u043E\\u043B\\u043E\\u043D\\u0430",radialBarTooltip:"\\u0420\\u0430\\u0434\\u0438\\u0430\\u0446\\u0438\\u043E\\u043D\\u043D\\u0430 \\u041B\\u0435\\u043D\\u0442\\u0430",radarLineTooltip:"\\u0420\\u0430\\u0434\\u0430\\u0440\\u043D\\u0430 \\u041B\\u0438\\u043D\\u0438\\u044F",radarAreaTooltip:"\\u0420\\u0430\\u0434\\u0430\\u0440\\u043D\\u0430 \\u041E\\u0431\\u043B\\u0430\\u0441\\u0442",nightingaleTooltip:"\\u041D\\u0430\\u0439\\u0442\\u0438\\u043D\\u0433\\u0435\\u0439\\u043B",rangeBarTooltip:"\\u0414\\u0438\\u0430\\u043F\\u0430\\u0437\\u043E\\u043D\\u043D\\u0430 \\u041B\\u0435\\u043D\\u0442\\u0430",rangeAreaTooltip:"\\u0414\\u0438\\u0430\\u043F\\u0430\\u0437\\u043E\\u043D\\u043D\\u0430 \\u041E\\u0431\\u043B\\u0430\\u0441\\u0442",boxPlotTooltip:"\\u041A\\u0443\\u0442\\u0438\\u0435\\u04';
      S = S + '32\\u043E \\u0420\\u0430\\u0437\\u043F\\u0440\\u0435\\u0434\\u0435\\u043B\\u0435\\u043D\\u0438\\u0435",treemapTooltip:"\\u0414\\u044A\\u0440\\u0432\\u0435\\u0441\\u043D\\u0430 \\u041A\\u0430\\u0440\\u0442\\u0430",sunburstTooltip:"\\u0421\\u043B\\u044A\\u043D\\u0447\\u0435\\u0432\\u043E \\u0418\\u0437\\u043B\\u044A\\u0447\\u0432\\u0430\\u043D\\u0435",waterfallTooltip:"\\u0412\\u043E\\u0434\\u043E\\u043E\\u043F\\u0430\\u0434",heatmapTooltip:"\\u0422\\u043E\\u043F\\u043B\\u0438\\u043D\\u043D\\u0430 \\u041A\\u0430\\u0440\\u0442\\u0430",columnLineComboTooltip:"\\u041A\\u043E\\u043B\\u043E\\u043D\\u0430 \\u0438 \\u041B\\u0438\\u043D\\u0438\\u044F",areaColumnComboTooltip:"\\u041E\\u0431\\u043B\\u0430\\u0441\\u0442 \\u0438 \\u041A\\u043E\\u043B\\u043E\\u043D\\u0430",customComboTooltip:"\\u041F\\u0435\\u0440\\u0441\\u043E\\u043D\\u0430\\u043B\\u0438\\u0437\\u0438\\u0440\\u0430\\u043D\\u0430 \\u041A\\u043E\\u043C\\u0431\\u0438\\u043D\\u0430\\u0446\\u0438\\u044F",innerRadius:"\\u0412\\u044A\\u0442\\u0440\\u0435\\u0448\\u0435\\u043D \\u0420\\u0430\\u0434\\u0438\\u0443\\u0441",startAngle:"\\u041D\\u0430\\u0447\\u0430\\u043B\\u0435\\u043D \\u042A\\u0433\\u044A\\u043B",endAngle:"\\u041A\\u0440\\u0430\\u0435\\u043D \\u042A\\u0433\\u044A\\u043B",reverseDirection:"\\u041E\\u0431\\u0440\\u0430\\u0442\\u043D\\u0430 \\u041F\\u043E\\u0441\\u043E\\u043A\\u0430",groupPadding:"\\u041F\\u043E\\u043F\\u044A\\u043B\\u0432\\u0430\\u043D\\u0435 \\u043D\\u0430 \\u0413\\u0440\\u0443\\u043F\\u0430",seriesPadding:"\\u041F\\u043E\\u043F\\u044A\\u043B\\u0432\\u0430\\u043D\\u0435 \\u043D\\u0430 \\u0421\\u0435\\u0440\\u0438\\u044F",tile:"\\u041F\\u043B\\u043E\\u0447\\u043A\\u0430",whisker:"\\u0423\\u0438\\u0441\\u043A\\u0438",cap:"\\u0421\\u0430\\u043F\\u0443\\u043D",capLengthRatio:"\\u0421\\u044A\\u043E\\u0442\\u043D\\u043E\\u0448\\u0435\\u043D\\u0438\\u0435 \\u043D\\u0430 \\u0414\\u044A\\u043B\\u0436\\u0438\\u043D\\u0430",labelPlacement:"\\u041F\\u043E\\u0441\\u0442\\u0430\\u0432\\u044F\\u043D\\u0435 \\u043D\\u0430 \\u0415\\u0442\\u0438\\u043A\\u0435\\u0442\\u0430",inside:"\\u0412\\u044A\\u0442\\u0440\\u0435",outside:"\\u041D\\u0430\\u0432\\u044A\\u043D",noDataToChart:"\\u041D\\u044F\\u043C\\u0430 \\u043D\\u0430\\u043B\\u0438\\u0447\\u043D\\u0438 \\u0434\\u0430\\u043D';
      S = S + '\\u043D\\u0438 \\u0437\\u0430 \\u0438\\u0437\\u043E\\u0431\\u0440\\u0430\\u0437\\u044F\\u0432\\u0430\\u043D\\u0435.",pivotChartRequiresPivotMode:"\\u0421\\u0432\\u043E\\u0434\\u043D\\u0430\\u0442\\u0430 \\u0414\\u0438\\u0430\\u0433\\u0440\\u0430\\u043C\\u0430 \\u0438\\u0437\\u0438\\u0441\\u043A\\u0432\\u0430 \\u0420\\u0435\\u0436\\u0438\\u043C \\u043D\\u0430 \\u0421\\u0432\\u043E\\u0434.",chartSettingsToolbarTooltip:"\\u041C\\u0435\\u043D\\u044E",chartLinkToolbarTooltip:"\\u0421\\u0432\\u044A\\u0440\\u0437\\u0430\\u043D\\u043E \\u0441 \\u0420\\u0435\\u0448\\u0435\\u0442\\u043A\\u0430\\u0442\\u0430",chartUnlinkToolbarTooltip:"\\u0420\\u0430\\u0437\\u0434\\u0435\\u043B\\u0435\\u043D\\u043E \\u043E\\u0442 \\u0420\\u0435\\u0448\\u0435\\u0442\\u043A\\u0430\\u0442\\u0430",chartDownloadToolbarTooltip:"\\u0418\\u0437\\u0442\\u0435\\u0433\\u043B\\u0438 \\u0414\\u0438\\u0430\\u0433\\u0440\\u0430\\u043C\\u0430",chartMenuToolbarTooltip:"\\u041C\\u0435\\u043D\\u044E",chartEdit:"\\u0420\\u0435\\u0434\\u0430\\u043A\\u0442\\u0438\\u0440\\u0430\\u0439 \\u0414\\u0438\\u0430\\u0433\\u0440\\u0430\\u043C\\u0430",chartAdvancedSettings:"\\u0420\\u0430\\u0437\\u0448\\u0438\\u0440\\u0435\\u043D\\u0438 \\u041D\\u0430\\u0441\\u0442\\u0440\\u043E\\u0439\\u043A\\u0438",chartLink:"\\u0421\\u0432\\u044A\\u0440\\u0436\\u0438 \\u0441 \\u0420\\u0435\\u0448\\u0435\\u0442\\u043A\\u0430\\u0442\\u0430",chartUnlink:"\\u0420\\u0430\\u0437\\u0434\\u0435\\u043B\\u0438 \\u043E\\u0442 \\u0420\\u0435\\u0448\\u0435\\u0442\\u043A\\u0430\\u0442\\u0430",chartDownload:"\\u0418\\u0437\\u0442\\u0435\\u0433\\u043B\\u0438 \\u0414\\u0438\\u0430\\u0433\\u0440\\u0430\\u043C\\u0430",histogramFrequency:"\\u0427\\u0435\\u0441\\u0442\\u043E\\u0442\\u0430",seriesChartType:"\\u0422\\u0438\\u043F \\u043D\\u0430 \\u0414\\u0438\\u0430\\u0433\\u0440\\u0430\\u043C\\u0430\\u0442\\u0430",seriesType:"\\u0422\\u0438\\u043F \\u043D\\u0430 \\u0421\\u0435\\u0440\\u0438\\u044F\\u0442\\u0430",secondaryAxis:"\\u0412\\u0442\\u043E\\u0440\\u0438\\u0447\\u043D\\u0430 \\u041E\\u0441",seriesAdd:"\\u0414\\u043E\\u0431\\u0430\\u0432\\u0438 \\u0421\\u0435\\u0440\\u0438\\u044F",categoryAdd:"\\u0414\\u043E\\u0431\\u0430\\u0432\\u0438 \\u041A\\u0430\\u0442\\u0435\\u0433\\u043E\\u0440\\u0438\\u044F",bar:"\\u041B\\u04';
      S = S + '35\\u043D\\u0442\\u0430",column:"\\u041A\\u043E\\u043B\\u043E\\u043D\\u0430",histogram:"\\u0425\\u0438\\u0441\\u0442\\u043E\\u0433\\u0440\\u0430\\u043C\\u0430",advancedSettings:"\\u0420\\u0430\\u0437\\u0448\\u0438\\u0440\\u0435\\u043D\\u0438 \\u041D\\u0430\\u0441\\u0442\\u0440\\u043E\\u0439\\u043A\\u0438",direction:"\\u041F\\u043E\\u0441\\u043E\\u043A\\u0430",horizontal:"\\u0425\\u043E\\u0440\\u0438\\u0437\\u043E\\u043D\\u0442\\u0430\\u043B\\u043D\\u043E",vertical:"\\u0412\\u0435\\u0440\\u0442\\u0438\\u043A\\u0430\\u043B\\u043D\\u043E",seriesGroupType:"\\u0422\\u0438\\u043F \\u043D\\u0430 \\u0413\\u0440\\u0443\\u043F\\u0430\\u0442\\u0430",groupedSeriesGroupType:"\\u0413\\u0440\\u0443\\u043F\\u0438\\u0440\\u0430\\u043D\\u043E",stackedSeriesGroupType:"\\u0421\\u043B\\u043E\\u0435\\u043D\\u043E",normalizedSeriesGroupType:"100% \\u0421\\u043B\\u043E\\u0435\\u043D\\u043E",legendEnabled:"\\u0410\\u043A\\u0442\\u0438\\u0432\\u0438\\u0440\\u0430\\u043D\\u043E",invalidColor:"\\u041D\\u0435\\u0432\\u0430\\u043B\\u0438\\u0434\\u043D\\u0430 \\u0421\\u0442\\u043E\\u0439\\u043D\\u043E\\u0441\\u0442 \\u043D\\u0430 \\u0426\\u0432\\u044F\\u0442",groupedColumnFull:"\\u0413\\u0440\\u0443\\u043F\\u0438\\u0440\\u0430\\u043D\\u0430 \\u041A\\u043E\\u043B\\u043E\\u043D\\u0430",stackedColumnFull:"\\u0421\\u043B\\u043E\\u0435\\u043D\\u0430 \\u041A\\u043E\\u043B\\u043E\\u043D\\u0430",normalizedColumnFull:"100% \\u0421\\u043B\\u043E\\u0435\\u043D\\u0430 \\u041A\\u043E\\u043B\\u043E\\u043D\\u0430",groupedBarFull:"\\u0413\\u0440\\u0443\\u043F\\u0438\\u0440\\u0430\\u043D\\u0430 \\u041B\\u0435\\u043D\\u0442\\u0430",stackedBarFull:"\\u0421\\u043B\\u043E\\u0435\\u043D\\u0430 \\u041B\\u0435\\u043D\\u0442\\u0430",normalizedBarFull:"100% \\u0421\\u043B\\u043E\\u0435\\u043D\\u0430 \\u041B\\u0435\\u043D\\u0442\\u0430",stackedAreaFull:"\\u0421\\u043B\\u043E\\u0435\\u043D\\u0430 \\u041E\\u0431\\u043B\\u0430\\u0441\\u0442",normalizedAreaFull:"100% \\u0421\\u043B\\u043E\\u0435\\u043D\\u0430 \\u041E\\u0431\\u043B\\u0430\\u0441\\u0442",customCombo:"\\u041F\\u0435\\u0440\\u0441\\u043E\\u043D\\u0430\\u043B\\u0438\\u0437\\u0438\\u0440\\u0430\\u043D\\u0430 \\u041A\\u043E\\u043C\\u0431\\u0438\\u043D\\u0430\\u0446\\u0438\\u044F",ariaAdvancedFilterBuilderItem:"${vari';
      S = S + 'able}. \\u041D\\u0438\\u0432\\u043E ${variable}. \\u041D\\u0430\\u0442\\u0438\\u0441\\u043D\\u0435\\u0442\\u0435 ENTER \\u0437\\u0430 \\u0440\\u0435\\u0434\\u0430\\u043A\\u0442\\u0438\\u0440\\u0430\\u043D\\u0435",ariaAdvancedFilterBuilderItemValidation:"${variable}. \\u041D\\u0438\\u0432\\u043E ${variable}. ${variable} \\u041D\\u0430\\u0442\\u0438\\u0441\\u043D\\u0435\\u0442\\u0435 ENTER \\u0437\\u0430 \\u0440\\u0435\\u0434\\u0430\\u043A\\u0442\\u0438\\u0440\\u0430\\u043D\\u0435.",ariaAdvancedFilterBuilderList:"\\u0420\\u0430\\u0437\\u0448\\u0438\\u0440\\u0435\\u043D \\u0441\\u043F\\u0438\\u0441\\u044A\\u043A \\u0437\\u0430 \\u0441\\u044A\\u0437\\u0434\\u0430\\u0432\\u0430\\u043D\\u0435 \\u043D\\u0430 \\u0444\\u0438\\u043B\\u0442\\u0440\\u0438",ariaAdvancedFilterBuilderFilterItem:"\\u0423\\u0441\\u043B\\u043E\\u0432\\u0438\\u0435 \\u0437\\u0430 \\u0444\\u0438\\u043B\\u0442\\u0440\\u0438\\u0440\\u0430\\u043D\\u0435",ariaAdvancedFilterBuilderGroupItem:"\\u0413\\u0440\\u0443\\u043F\\u0430 \\u0437\\u0430 \\u0444\\u0438\\u043B\\u0442\\u0440\\u0438\\u0440\\u0430\\u043D\\u0435",ariaAdvancedFilterBuilderColumn:"\\u041A\\u043E\\u043B\\u043E\\u043D\\u0430",ariaAdvancedFilterBuilderOption:"\\u041E\\u043F\\u0446\\u0438\\u044F",ariaAdvancedFilterBuilderValueP:"\\u0421\\u0442\\u043E\\u0439\\u043D\\u043E\\u0441\\u0442",ariaAdvancedFilterBuilderJoinOperator:"\\u041E\\u043F\\u0435\\u0440\\u0430\\u0442\\u043E\\u0440 \\u0437\\u0430 \\u0441\\u0432\\u044A\\u0440\\u0437\\u0432\\u0430\\u043D\\u0435",ariaAdvancedFilterInput:"\\u0412\\u0445\\u043E\\u0434 \\u0437\\u0430 \\u0440\\u0430\\u0437\\u0448\\u0438\\u0440\\u0435\\u043D \\u0444\\u0438\\u043B\\u0442\\u044A\\u0440",ariaChecked:"\\u043C\\u0430\\u0440\\u043A\\u0438\\u0440\\u0430\\u043D\\u043E",ariaColumn:"\\u041A\\u043E\\u043B\\u043E\\u043D\\u0430",ariaColumnGroup:"\\u0413\\u0440\\u0443\\u043F\\u0430 \\u043A\\u043E\\u043B\\u043E\\u043D\\u0438",ariaColumnFiltered:"\\u041A\\u043E\\u043B\\u043E\\u043D\\u0430\\u0442\\u0430 \\u0435 \\u0444\\u0438\\u043B\\u0442\\u0440\\u0438\\u0440\\u0430\\u043D\\u0430",ariaColumnSelectAll:"\\u041F\\u0440\\u0435\\u0432\\u043A\\u043B\\u044E\\u0447\\u0432\\u0430\\u043D\\u0435 \\u0437\\u0430 \\u0438\\u0437\\u0431\\u043E\\u0440 \\u043D\\u0430 \\u0432\\u0441\\';
      S = S + 'u0438\\u0447\\u043A\\u0438 \\u043A\\u043E\\u043B\\u043E\\u043D\\u0438",ariaDateFilterInput:"\\u0412\\u0445\\u043E\\u0434 \\u0437\\u0430 \\u0444\\u0438\\u043B\\u0442\\u044A\\u0440 \\u043F\\u043E \\u0434\\u0430\\u0442\\u0430",ariaDefaultListName:"\\u0421\\u043F\\u0438\\u0441\\u044A\\u043A",ariaFilterColumnsInput:"\\u0412\\u0445\\u043E\\u0434 \\u0437\\u0430 \\u0444\\u0438\\u043B\\u0442\\u0440\\u0438\\u0440\\u0430\\u043D\\u0435 \\u043D\\u0430 \\u043A\\u043E\\u043B\\u043E\\u043D\\u0438",ariaFilterFromValue:"\\u0424\\u0438\\u043B\\u0442\\u044A\\u0440 \\u043E\\u0442 \\u0441\\u0442\\u043E\\u0439\\u043D\\u043E\\u0441\\u0442",ariaFilterInput:"\\u0412\\u0445\\u043E\\u0434 \\u0437\\u0430 \\u0444\\u0438\\u043B\\u0442\\u044A\\u0440",ariaFilterList:"\\u0421\\u043F\\u0438\\u0441\\u044A\\u043A \\u0437\\u0430 \\u0444\\u0438\\u043B\\u0442\\u0440\\u0438\\u0440\\u0430\\u043D\\u0435",ariaFilterToValue:"\\u0424\\u0438\\u043B\\u0442\\u044A\\u0440 \\u0434\\u043E \\u0441\\u0442\\u043E\\u0439\\u043D\\u043E\\u0441\\u0442",ariaFilterValue:"\\u0421\\u0442\\u043E\\u0439\\u043D\\u043E\\u0441\\u0442 \\u043D\\u0430 \\u0444\\u0438\\u043B\\u0442\\u044A\\u0440\\u0430",ariaFilterMenuOpen:"\\u041E\\u0442\\u0432\\u043E\\u0440\\u0435\\u0442\\u0435 \\u043C\\u0435\\u043D\\u044E\\u0442\\u043E \\u0437\\u0430 \\u0444\\u0438\\u043B\\u0442\\u044A\\u0440",ariaFilteringOperator:"\\u041E\\u043F\\u0435\\u0440\\u0430\\u0442\\u043E\\u0440 \\u0437\\u0430 \\u0444\\u0438\\u043B\\u0442\\u0440\\u0438\\u0440\\u0430\\u043D\\u0435",ariaHidden:"\\u0441\\u043A\\u0440\\u0438\\u0442\\u043E",ariaIndeterminate:"\\u043D\\u0435\\u043E\\u043F\\u0440\\u0435\\u0434\\u0435\\u043B\\u0435\\u043D\\u043E",ariaInputEditor:"\\u0420\\u0435\\u0434\\u0430\\u043A\\u0442\\u043E\\u0440 \\u0437\\u0430 \\u0432\\u0445\\u043E\\u0434",ariaMenuColumn:"\\u041D\\u0430\\u0442\\u0438\\u0441\\u043D\\u0435\\u0442\\u0435 ALT + \\u0421\\u0422\\u0420\\u0415\\u041B\\u041A\\u0410 \\u041D\\u0410\\u0414\\u041E\\u041B\\u0423, \\u0437\\u0430 \\u0434\\u0430 \\u043E\\u0442\\u0432\\u043E\\u0440\\u0438\\u0442\\u0435 \\u043C\\u0435\\u043D\\u044E\\u0442\\u043E \\u043D\\u0430 \\u043A\\u043E\\u043B\\u043E\\u043D\\u0430\\u0442\\u0430",ariaFilterColumn:"\\u041D\\u0430\\u0442\\u0438\\u0441\\u043D\\u0435\\u0442\\u0435 CTRL + ENTER, \\u0437\\u0430 \\';
      S = S + 'u0434\\u0430 \\u043E\\u0442\\u0432\\u043E\\u0440\\u0438\\u0442\\u0435 \\u0444\\u0438\\u043B\\u0442\\u044A\\u0440\\u0430",ariaRowDeselect:"\\u041D\\u0430\\u0442\\u0438\\u0441\\u043D\\u0435\\u0442\\u0435 SPACE, \\u0437\\u0430 \\u0434\\u0430 \\u043E\\u0442\\u043C\\u0430\\u0440\\u043A\\u0438\\u0440\\u0430\\u0442\\u0435 \\u0442\\u043E\\u0437\\u0438 \\u0440\\u0435\\u0434",ariaRowSelectAll:"\\u041D\\u0430\\u0442\\u0438\\u0441\\u043D\\u0435\\u0442\\u0435 SPACE, \\u0437\\u0430 \\u0434\\u0430 \\u043F\\u0440\\u0435\\u0432\\u043A\\u043B\\u044E\\u0447\\u0438\\u0442\\u0435 \\u0438\\u0437\\u0431\\u043E\\u0440\\u0430 \\u043D\\u0430 \\u0432\\u0441\\u0438\\u0447\\u043A\\u0438 \\u0440\\u0435\\u0434\\u043E\\u0432\\u0435",ariaRowToggleSelection:"\\u041D\\u0430\\u0442\\u0438\\u0441\\u043D\\u0435\\u0442\\u0435 SPACE, \\u0437\\u0430 \\u0434\\u0430 \\u043F\\u0440\\u0435\\u0432\\u043A\\u043B\\u044E\\u0447\\u0438\\u0442\\u0435 \\u0438\\u0437\\u0431\\u043E\\u0440\\u0430 \\u043D\\u0430 \\u0440\\u0435\\u0434\\u0430",ariaRowSelect:"\\u041D\\u0430\\u0442\\u0438\\u0441\\u043D\\u0435\\u0442\\u0435 SPACE, \\u0437\\u0430 \\u0434\\u0430 \\u0438\\u0437\\u0431\\u0435\\u0440\\u0435\\u0442\\u0435 \\u0442\\u043E\\u0437\\u0438 \\u0440\\u0435\\u0434",ariaRowSelectionDisabled:"\\u0418\\u0437\\u0431\\u043E\\u0440\\u044A\\u0442 \\u043D\\u0430 \\u0440\\u0435\\u0434\\u043E\\u0432\\u0435 \\u0435 \\u0434\\u0435\\u0430\\u043A\\u0442\\u0438\\u0432\\u0438\\u0440\\u0430\\u043D \\u0437\\u0430 \\u0442\\u043E\\u0437\\u0438 \\u0440\\u0435\\u0434",ariaSearch:"\\u0422\\u044A\\u0440\\u0441\\u0435\\u043D\\u0435",ariaSortableColumn:"\\u041D\\u0430\\u0442\\u0438\\u0441\\u043D\\u0435\\u0442\\u0435 ENTER, \\u0437\\u0430 \\u0434\\u0430 \\u0441\\u043E\\u0440\\u0442\\u0438\\u0440\\u0430\\u0442\\u0435",ariaToggleVisibility:"\\u041D\\u0430\\u0442\\u0438\\u0441\\u043D\\u0435\\u0442\\u0435 SPACE, \\u0437\\u0430 \\u0434\\u0430 \\u043F\\u0440\\u0435\\u0432\\u043A\\u043B\\u044E\\u0447\\u0438\\u0442\\u0435 \\u0432\\u0438\\u0434\\u0438\\u043C\\u043E\\u0441\\u0442\\u0442\\u0430",ariaToggleCellValue:"\\u041D\\u0430\\u0442\\u0438\\u0441\\u043D\\u0435\\u0442\\u0435 SPACE, \\u0437\\u0430 \\u0434\\u0430 \\u043F\\u0440\\u0435\\u0432\\u043A\\u043B\\u044E\\u0447\\u0438\\u0442\\u0435 \\u0441\\u0442\\u043E\\u0439\\u043D\\u043E\\u0441';
      S = S + '\\u0442\\u0442\\u0430 \\u043D\\u0430 \\u043A\\u043B\\u0435\\u0442\\u043A\\u0430\\u0442\\u0430",ariaUnchecked:"\\u043D\\u0435\\u043C\\u0430\\u0440\\u043A\\u0438\\u0440\\u0430\\u043D\\u043E",ariaVisible:"\\u0432\\u0438\\u0434\\u0438\\u043C\\u043E",ariaSearchFilterValues:"\\u0422\\u044A\\u0440\\u0441\\u0435\\u043D\\u0435 \\u043D\\u0430 \\u0441\\u0442\\u043E\\u0439\\u043D\\u043E\\u0441\\u0442\\u0438 \\u0437\\u0430 \\u0444\\u0438\\u043B\\u0442\\u044A\\u0440",ariaPageSizeSelectorLabel:"\\u0420\\u0430\\u0437\\u043C\\u0435\\u0440 \\u043D\\u0430 \\u0441\\u0442\\u0440\\u0430\\u043D\\u0438\\u0446\\u0430\\u0442\\u0430",ariaChartMenuClose:"\\u0417\\u0430\\u0442\\u0432\\u043E\\u0440\\u0435\\u0442\\u0435 \\u043C\\u0435\\u043D\\u044E\\u0442\\u043E \\u0437\\u0430 \\u0440\\u0435\\u0434\\u0430\\u043A\\u0442\\u0438\\u0440\\u0430\\u043D\\u0435 \\u043D\\u0430 \\u0434\\u0438\\u0430\\u0433\\u0440\\u0430\\u043C\\u0430\\u0442\\u0430",ariaChartSelected:"\\u0418\\u0437\\u0431\\u0440\\u0430\\u043D\\u043E",ariaSkeletonCellLoadingFailed:"\\u0420\\u0435\\u0434\\u044A\\u0442 \\u043D\\u0435 \\u043C\\u043E\\u0436\\u0430 \\u0434\\u0430 \\u0441\\u0435 \\u0437\\u0430\\u0440\\u0435\\u0434\\u0438",ariaSkeletonCellLoading:"\\u0414\\u0430\\u043D\\u043D\\u0438\\u0442\\u0435 \\u043D\\u0430 \\u0440\\u0435\\u0434\\u0430 \\u0441\\u0435 \\u0437\\u0430\\u0440\\u0435\\u0436\\u0434\\u0430\\u0442",ariaRowGroupDropZonePanelLabel:"\\u0420\\u0435\\u0434\\u043E\\u0432\\u0438 \\u0433\\u0440\\u0443\\u043F\\u0438",ariaValuesDropZonePanelLabel:"\\u0421\\u0442\\u043E\\u0439\\u043D\\u043E\\u0441\\u0442\\u0438",ariaPivotDropZonePanelLabel:"\\u0415\\u0442\\u0438\\u043A\\u0435\\u0442\\u0438 \\u043D\\u0430 \\u043A\\u043E\\u043B\\u043E\\u043D\\u0438",ariaDropZoneColumnComponentDescription:"\\u041D\\u0430\\u0442\\u0438\\u0441\\u043D\\u0435\\u0442\\u0435 DELETE, \\u0437\\u0430 \\u0434\\u0430 \\u043F\\u0440\\u0435\\u043C\\u0430\\u0445\\u043D\\u0435\\u0442\\u0435",ariaDropZoneColumnValueItemDescription:"\\u041D\\u0430\\u0442\\u0438\\u0441\\u043D\\u0435\\u0442\\u0435 ENTER, \\u0437\\u0430 \\u0434\\u0430 \\u043F\\u0440\\u043E\\u043C\\u0435\\u043D\\u0438\\u0442\\u0435 \\u0442\\u0438\\u043F\\u0430 \\u043D\\u0430 \\u0430\\u0433\\u0440\\u0435\\u0433\\u0430\\u0446\\u0438\\u044F",ariaDropZoneColumn';
      S = S + 'GroupItemDescription:"\\u041D\\u0430\\u0442\\u0438\\u0441\\u043D\\u0435\\u0442\\u0435 ENTER, \\u0437\\u0430 \\u0434\\u0430 \\u0441\\u043E\\u0440\\u0442\\u0438\\u0440\\u0430\\u0442\\u0435",ariaDropZoneColumnComponentAggFuncSeparator:" \\u043E\\u0442 ",ariaDropZoneColumnComponentSortAscending:"\\u0432\\u044A\\u0437\\u0445\\u043E\\u0434\\u044F\\u0449\\u043E",ariaDropZoneColumnComponentSortDescending:"\\u043D\\u0438\\u0437\\u0445\\u043E\\u0434\\u044F\\u0449\\u043E",ariaLabelDialog:"\\u0414\\u0438\\u0430\\u043B\\u043E\\u0433",ariaLabelColumnMenu:"\\u041C\\u0435\\u043D\\u044E \\u043D\\u0430 \\u043A\\u043E\\u043B\\u043E\\u043D\\u0430",ariaLabelColumnFilter:"\\u0424\\u0438\\u043B\\u0442\\u044A\\u0440 \\u043D\\u0430 \\u043A\\u043E\\u043B\\u043E\\u043D\\u0430",ariaLabelCellEditor:"\\u0420\\u0435\\u0434\\u0430\\u043A\\u0442\\u043E\\u0440 \\u043D\\u0430 \\u043A\\u043B\\u0435\\u0442\\u043A\\u0430",ariaLabelSelectField:"\\u0418\\u0437\\u0431\\u043E\\u0440 \\u043D\\u0430 \\u043F\\u043E\\u043B\\u0435",ariaLabelRichSelectField:"\\u041F\\u043E\\u043B\\u0435 \\u0437\\u0430 \\u0431\\u043E\\u0433\\u0430\\u0442\\u043E \\u0438\\u0437\\u0431\\u0438\\u0440\\u0430\\u043D\\u0435",ariaLabelRichSelectToggleSelection:"\\u041D\\u0430\\u0442\\u0438\\u0441\\u043D\\u0435\\u0442\\u0435 SPACE, \\u0437\\u0430 \\u0434\\u0430 \\u043F\\u0440\\u0435\\u0432\\u043A\\u043B\\u044E\\u0447\\u0438\\u0442\\u0435 \\u0438\\u0437\\u0431\\u043E\\u0440\\u0430",ariaLabelRichSelectDeselectAllItems:"\\u041D\\u0430\\u0442\\u0438\\u0441\\u043D\\u0435\\u0442\\u0435 DELETE, \\u0437\\u0430 \\u0434\\u0430 \\u043E\\u0442\\u043C\\u0435\\u043D\\u0438\\u0442\\u0435 \\u0438\\u0437\\u0431\\u043E\\u0440\\u0430 \\u043D\\u0430 \\u0432\\u0441\\u0438\\u0447\\u043A\\u0438 \\u0435\\u043B\\u0435\\u043C\\u0435\\u043D\\u0442\\u0438",ariaLabelRichSelectDeleteSelection:"\\u041D\\u0430\\u0442\\u0438\\u0441\\u043D\\u0435\\u0442\\u0435 DELETE, \\u0437\\u0430 \\u0434\\u0430 \\u043E\\u0442\\u043C\\u0435\\u043D\\u0438\\u0442\\u0435 \\u0438\\u0437\\u0431\\u043E\\u0440\\u0430 \\u043D\\u0430 \\u0435\\u043B\\u0435\\u043C\\u0435\\u043D\\u0442",ariaLabelTooltip:"\\u041F\\u043E\\u044F\\u0441\\u043D\\u0435\\u043D\\u0438\\u0435",ariaLabelContextMenu:"\\u041A\\u043E\\u043D\\u0442\\u0435\\u043A\\u0441\\u';
      S = S + '0442\\u043D\\u043E \\u043C\\u0435\\u043D\\u044E",ariaLabelSubMenu:"\\u041F\\u043E\\u0434\\u043C\\u0435\\u043D\\u044E",ariaLabelAggregationFunction:"\\u0424\\u0443\\u043D\\u043A\\u0446\\u0438\\u044F \\u0437\\u0430 \\u0430\\u0433\\u0440\\u0435\\u0433\\u0438\\u0440\\u0430\\u043D\\u0435",ariaLabelAdvancedFilterAutocomplete:"\\u0420\\u0430\\u0437\\u0448\\u0438\\u0440\\u0435\\u043D\\u043E \\u0444\\u0438\\u043B\\u0442\\u0440\\u0438\\u0440\\u0430\\u043D\\u0435 \\u0441 \\u0430\\u0432\\u0442\\u043E\\u043C\\u0430\\u0442\\u0438\\u0447\\u043D\\u043E \\u0434\\u043E\\u043F\\u044A\\u043B\\u0432\\u0430\\u043D\\u0435",ariaLabelAdvancedFilterBuilderAddField:"\\u0420\\u0430\\u0437\\u0448\\u0438\\u0440\\u0435\\u043D \\u043A\\u043E\\u043D\\u0441\\u0442\\u0440\\u0443\\u043A\\u0442\\u043E\\u0440 \\u043D\\u0430 \\u0444\\u0438\\u043B\\u0442\\u0440\\u0438 - \\u0414\\u043E\\u0431\\u0430\\u0432\\u044F\\u043D\\u0435 \\u043D\\u0430 \\u043F\\u043E\\u043B\\u0435",ariaLabelAdvancedFilterBuilderColumnSelectField:"\\u0420\\u0430\\u0437\\u0448\\u0438\\u0440\\u0435\\u043D \\u043A\\u043E\\u043D\\u0441\\u0442\\u0440\\u0443\\u043A\\u0442\\u043E\\u0440 \\u043D\\u0430 \\u0444\\u0438\\u043B\\u0442\\u0440\\u0438 - \\u0418\\u0437\\u0431\\u0438\\u0440\\u0430\\u043D\\u0435 \\u043D\\u0430 \\u043F\\u043E\\u043B\\u0435 \\u0437\\u0430 \\u043A\\u043E\\u043B\\u043E\\u043D\\u0430",ariaLabelAdvancedFilterBuilderOptionSelectField:"\\u0420\\u0430\\u0437\\u0448\\u0438\\u0440\\u0435\\u043D \\u043A\\u043E\\u043D\\u0441\\u0442\\u0440\\u0443\\u043A\\u0442\\u043E\\u0440 \\u043D\\u0430 \\u0444\\u0438\\u043B\\u0442\\u0440\\u0438 - \\u0418\\u0437\\u0431\\u0438\\u0440\\u0430\\u043D\\u0435 \\u043D\\u0430 \\u043F\\u043E\\u043B\\u0435 \\u0437\\u0430 \\u043E\\u043F\\u0446\\u0438\\u044F",ariaLabelAdvancedFilterBuilderJoinSelectField:"\\u0420\\u0430\\u0437\\u0448\\u0438\\u0440\\u0435\\u043D \\u043A\\u043E\\u043D\\u0441\\u0442\\u0440\\u0443\\u043A\\u0442\\u043E\\u0440 \\u043D\\u0430 \\u0444\\u0438\\u043B\\u0442\\u0440\\u0438 - \\u0418\\u0437\\u0431\\u0438\\u0440\\u0430\\u043D\\u0435 \\u043D\\u0430 \\u043E\\u043F\\u0435\\u0440\\u0430\\u0442\\u043E\\u0440 \\u0437\\u0430 \\u0438\\u043D\\u0438\\u0446\\u0438\\u0438\\u0440\\u0430\\u043D\\u0435",ariaColumnPanelList:"\\u0421\\u043F\\u0438\\u0441\\u044A\\u043A \\u044';
      S = S + '1 \\u043A\\u043E\\u043B\\u043E\\u043D\\u0438",ariaFilterPanelList:"\\u0421\\u043F\\u0438\\u0441\\u044A\\u043A \\u0441 \\u0444\\u0438\\u043B\\u0442\\u0440\\u0438",thousandSeparator:",",decimalSeparator:".",true:"\\u0412\\u044F\\u0440\\u043D\\u043E",false:"\\u041D\\u0435\\u0432\\u044F\\u0440\\u043D\\u043E",invalidDate:"\\u041D\\u0435\\u0432\\u0430\\u043B\\u0438\\u0434\\u043D\\u0430 \\u0434\\u0430\\u0442\\u0430",invalidNumber:"\\u041D\\u0435\\u0432\\u0430\\u043B\\u0438\\u0434\\u0435\\u043D \\u043D\\u043E\\u043C\\u0435\\u0440",january:"\\u042F\\u043D\\u0443\\u0430\\u0440\\u0438",february:"\\u0424\\u0435\\u0432\\u0440\\u0443\\u0430\\u0440\\u0438",march:"\\u041C\\u0430\\u0440\\u0442",april:"\\u0410\\u043F\\u0440\\u0438\\u043B",may:"\\u041C\\u0430\\u0439",june:"\\u042E\\u043D\\u0438",july:"\\u042E\\u043B\\u0438",august:"\\u0410\\u0432\\u0433\\u0443\\u0441\\u0442",september:"\\u0421\\u0435\\u043F\\u0442\\u0435\\u043C\\u0432\\u0440\\u0438",october:"\\u041E\\u043A\\u0442\\u043E\\u043C\\u0432\\u0440\\u0438",november:"\\u041D\\u043E\\u0435\\u043C\\u0432\\u0440\\u0438",december:"\\u0414\\u0435\\u043A\\u0435\\u043C\\u0432\\u0440\\u0438",timeFormatSlashesDDMMYYYY:"\\u0414\\u0414/\\u041C\\u041C/\\u0413\\u0413\\u0413\\u0413",timeFormatSlashesMMDDYYYY:"\\u041C\\u041C/\\u0414\\u0414/\\u0413\\u0413\\u0413\\u0413",timeFormatSlashesDDMMYY:"\\u0414\\u0414/\\u041C\\u041C/\\u0413\\u0413",timeFormatSlashesMMDDYY:"\\u041C\\u041C/\\u0414\\u0414/\\u0413\\u0413",timeFormatDotsDDMYY:"\\u0414\\u0414.\\u041C.\\u0413\\u0413",timeFormatDotsMDDYY:"\\u041C.\\u0414\\u0414.\\u0413\\u0413",timeFormatDashesYYYYMMDD:"\\u0413\\u0413\\u0413\\u0413-\\u041C\\u041C-\\u0414\\u0414",timeFormatSpacesDDMMMMYYYY:"\\u0414\\u0414 \\u041CMMM \\u0413\\u0413\\u0413\\u0413",timeFormatHHMMSS:"\\u0427\\u0427:\\u041C\\u041C:\\u0421\\u0421",timeFormatHHMMSSAmPm:"\\u0427\\u0427:\\u041C\\u041C:\\u0421\\u0421 AM/PM"},p={selectAll:"(Vybrat v\\u0161e)",selectAllSearchResults:"(Vybrat v\\u0161echny v\\xFDsledky hled\\xE1n\\xED)",addCurrentSelectionToFilter:"P\\u0159idat aktu\\xE1ln\\xED v\\xFDb\\u011Br do filtru",searchOoo:"Hledat...",blanks:"(Pr\\xE1zdn\\xE9)",noMatches:"\\u017D\\xE1dn\\xE9 shody",filterOoo:"Filtr...",equals:"Rovn\\xE1 ';
      S = S + 'se",notEqual:"Nerovn\\xE1 se",blank:"Pr\\xE1zdn\\xFD",notBlank:"Nen\\xED pr\\xE1zdn\\xFD",empty:"Vyberte jednu",lessThan:"M\\xE9n\\u011B ne\\u017E",greaterThan:"V\\xEDce ne\\u017E",lessThanOrEqual:"M\\xE9n\\u011B ne\\u017E nebo rovno",greaterThanOrEqual:"V\\xEDce ne\\u017E nebo rovno",inRange:"Mezi",inRangeStart:"Od",inRangeEnd:"Do",contains:"Obsahuje",notContains:"Neobsahuje",startsWith:"Za\\u010D\\xEDn\\xE1 na",endsWith:"Kon\\u010D\\xED na",dateFormatOoo:"yyyy-mm-dd",before:"P\\u0159ed",after:"Po",andCondition:"A",orCondition:"NEBO",applyFilter:"Pou\\u017E\\xEDt",resetFilter:"Obnovit",clearFilter:"Vymazat",cancelFilter:"Zru\\u0161it",textFilter:"Textov\\xFD filtr",numberFilter:"\\u010C\\xEDseln\\xFD filtr",dateFilter:"Datumov\\xFD filtr",setFilter:"Sada filtr\\u016F",groupFilterSelect:"Vyberte pole:",advancedFilterContains:"obsahuje",advancedFilterNotContains:"neobsahuje",advancedFilterTextEquals:"rovn\\xE1 se",advancedFilterTextNotEqual:"nerovn\\xE1 se",advancedFilterStartsWith:"za\\u010D\\xEDn\\xE1 na",advancedFilterEndsWith:"kon\\u010D\\xED na",advancedFilterBlank:"je pr\\xE1zdn\\xE9",advancedFilterNotBlank:"nen\\xED pr\\xE1zdn\\xE9",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"je pravda",advancedFilterFalse:"je nepravda",advancedFilterAnd:"A",advancedFilterOr:"NEBO",advancedFilterApply:"Pou\\u017E\\xEDt",advancedFilterBuilder:"Stavitel",advancedFilterValidationMissingColumn:"Chyb\\xED sloupec",advancedFilterValidationMissingOption:"Chyb\\xED mo\\u017Enost",advancedFilterValidationMissingValue:"Chyb\\xED hodnota",advancedFilterValidationInvalidColumn:"Sloupec nenalezen",advancedFilterValidationInvalidOption:"Mo\\u017Enost nenalezena",advancedFilterValidationMissingQuote:"Hodnota postr\\xE1d\\xE1 ukon\\u010Dovac\\xED uvozovku",advancedFilterValidationNotANumber:"Hodnota nen\\xED \\u010D\\xEDslo",advancedFilterValidationInvalidDate:"Hodnota nen\\xED platn\\xE9 datum';
      S = S + '",advancedFilterValidationMissingCondition:"Chyb\\xED podm\\xEDnka",advancedFilterValidationJoinOperatorMismatch:"Oper\\xE1tory spojen\\xED v r\\xE1mci podm\\xEDnky mus\\xED b\\xFDt stejn\\xE9",advancedFilterValidationInvalidJoinOperator:"Oper\\xE1tor spojen\\xED nenalezen",advancedFilterValidationMissingEndBracket:"Chyb\\xED koncov\\xE1 z\\xE1vorka",advancedFilterValidationExtraEndBracket:"P\\u0159\\xEDli\\u0161 mnoho koncov\\xFDch z\\xE1vorek",advancedFilterValidationMessage:"V\\xFDraz obsahuje chybu. ${variable} - ${variable}.",advancedFilterValidationMessageAtEnd:"V\\xFDraz obsahuje chybu. ${variable} na konci v\\xFDrazu.",advancedFilterBuilderTitle:"Pokro\\u010Dil\\xFD filtr",advancedFilterBuilderApply:"Pou\\u017E\\xEDt",advancedFilterBuilderCancel:"Zru\\u0161it",advancedFilterBuilderAddButtonTooltip:"P\\u0159idat filtr nebo skupinu",advancedFilterBuilderRemoveButtonTooltip:"Odebrat",advancedFilterBuilderMoveUpButtonTooltip:"Posunout nahoru",advancedFilterBuilderMoveDownButtonTooltip:"Posunout dol\\u016F",advancedFilterBuilderAddJoin:"P\\u0159idat skupinu",advancedFilterBuilderAddCondition:"P\\u0159idat filtr",advancedFilterBuilderSelectColumn:"Vyberte sloupec",advancedFilterBuilderSelectOption:"Vyberte mo\\u017Enost",advancedFilterBuilderEnterValue:"Zadejte hodnotu...",advancedFilterBuilderValidationAlreadyApplied:"Aktu\\xE1ln\\xED filtr ji\\u017E pou\\u017Eit.",advancedFilterBuilderValidationIncomplete:"V\\u0161echny podm\\xEDnky nejsou kompletn\\xED.",advancedFilterBuilderValidationSelectColumn:"Mus\\xEDte vybrat sloupec.",advancedFilterBuilderValidationSelectOption:"Mus\\xEDte vybrat mo\\u017Enost.",advancedFilterBuilderValidationEnterValue:"Mus\\xEDte zadat hodnotu.",columns:"Sloupce",filters:"Filtry",pivotMode:"Re\\u017Eim Pivot",groups:"Skupiny \\u0159\\xE1dk\\u016F",rowGroupColumnsEmptyMessage:"P\\u0159et\\xE1hn\\u011Bte sem pro nastaven\\xED skupin \\u0159\\xE1dk\\u016F",values:"Hodnoty",valueColumnsEmptyMessage:"P\\u0159et\\xE1hn\\u011Bte sem pro agregaci",pivots:"\\u0160t\\xEDtky sloupc\\u016F",pivotColumnsEm';
      S = S + 'ptyMessage:"P\\u0159et\\xE1hn\\u011Bte sem pro nastaven\\xED \\u0161t\\xEDtk\\u016F sloupc\\u016F",group:"Skupina",rowDragRow:"\\u0159\\xE1dek",rowDragRows:"\\u0159\\xE1dky",loadingOoo:"Na\\u010D\\xEDt\\xE1n\\xED...",loadingError:"CHYBA",noRowsToShow:"\\u017D\\xE1dn\\xE9 \\u0159\\xE1dky k zobrazen\\xED",enabled:"Povoleno",pinColumn:"P\\u0159ipnout sloupec",pinLeft:"P\\u0159ipnout vlevo",pinRight:"P\\u0159ipnout vpravo",noPin:"Nep\\u0159ip\\xEDnat",valueAggregation:"Agregace hodnot",noAggregation:"\\u017D\\xE1dn\\xE1",autosizeThisColumn:"Automatick\\xE1 velikost tohoto sloupce",autosizeAllColumns:"Automatick\\xE1 velikost v\\u0161ech sloupc\\u016F",groupBy:"Seskupit podle",ungroupBy:"Zru\\u0161it seskupen\\xED podle",ungroupAll:"Zru\\u0161it seskupen\\xED v\\u0161ech",addToValues:"P\\u0159idat ${variable} k hodnot\\xE1m",removeFromValues:"Odebrat ${variable} z hodnot",addToLabels:"P\\u0159idat ${variable} k popisk\\u016Fm",removeFromLabels:"Odebrat ${variable} z popisk\\u016F",resetColumns:"Resetovat sloupce",expandAll:"Rozbalit v\\u0161echny skupiny \\u0159\\xE1dk\\u016F",collapseAll:"Sbalit v\\u0161echny skupiny \\u0159\\xE1dk\\u016F",copy:"Kop\\xEDrovat",ctrlC:"Ctrl+C",ctrlX:"Ctrl+X",copyWithHeaders:"Kop\\xEDrovat s hlavi\\u010Dkami",copyWithGroupHeaders:"Kop\\xEDrovat se skupinov\\xFDmi hlavi\\u010Dkami",cut:"Vyjmout",paste:"Vlo\\u017Eit",ctrlV:"Ctrl+V",export:"Export",csvExport:"Export CSV",excelExport:"Export Excel",columnFilter:"Filtr sloupce",columnChooser:"Vybrat sloupce",sortAscending:"T\\u0159\\xEDdit vzestupn\\u011B",sortDescending:"T\\u0159\\xEDdit sestupn\\u011B",sortUnSort:"Zru\\u0161it t\\u0159\\xEDd\\u011Bn\\xED",sum:"Sou\\u010Det",first:"Prvn\\xED",last:"Posledn\\xED",min:"Min",max:"Max",none:"\\u017D\\xE1dn\\xE9",count:"Po\\u010Det",avg:"Pr\\u016Fm\\u011Br",filteredRows:"Filtrovan\\xE9",selectedRows:"Vybran\\xE9",totalRows:"Celkem \\u0159\\xE1dk\\u016F",totalAndFilteredRows:"\\u0158\\xE1dky",more:"V\\xEDce",to:"do",of:"z",page:"Str\\xE1nka",pageLastRowUnknown:"?",nextPage:"Dal\\u0161\\xED str\\xE1nka",lastPage:"Posledn\\xED str\\xE1nka",fi';
      S = S + 'rstPage:"Prvn\\xED str\\xE1nka",previousPage:"P\\u0159edchoz\\xED str\\xE1nka",pageSizeSelectorLabel:"Velikost str\\xE1nky:",footerTotal:"Celkem",pivotColumnGroupTotals:"Celkem",pivotChartAndPivotMode:"Kontingen\\u010Dn\\xED graf a re\\u017Eim kontingen\\u010Dn\\xED tabulky",pivotChart:"Kontingen\\u010Dn\\xED graf",chartRange:"Rozsah grafu",columnChart:"Sloupcov\\xFD graf",groupedColumn:"Seskupen\\xFD",stackedColumn:"Skl\\xE1dan\\xFD",normalizedColumn:"100% skl\\xE1dan\\xFD",barChart:"Pruhov\\xFD graf",groupedBar:"Seskupen\\xFD",stackedBar:"Skl\\xE1dan\\xFD",normalizedBar:"100% skl\\xE1dan\\xFD",pieChart:"Kol\\xE1\\u010Dov\\xFD graf",pie:"Kol\\xE1\\u010D",donut:"Prstenec",line:"\\u010C\\xE1ra",xyChart:"X Y (Rozptylov\\xFD graf)",scatter:"Rozptylov\\xFD graf",bubble:"Bublinkov\\xFD graf",areaChart:"Plo\\u0161n\\xFD graf",area:"Plocha",stackedArea:"Skl\\xE1dan\\xE1 plocha",normalizedArea:"100% skl\\xE1dan\\xE1 plocha",histogramChart:"Histogram",polarChart:"Pol\\xE1rn\\xED graf",radarLine:"Radarov\\xE1 \\u010D\\xE1ra",radarArea:"Radarov\\xE1 plocha",nightingale:"Nightingale",radialColumn:"Radi\\xE1ln\\xED sloupec",radialBar:"Radi\\xE1ln\\xED pruh",statisticalChart:"Statistick\\xFD graf",boxPlot:"Krabicov\\xFD graf",rangeBar:"Pruhov\\xFD graf s rozsahem",rangeArea:"Plo\\u0161n\\xFD graf s rozsahem",hierarchicalChart:"Hierarchick\\xFD graf",treemap:"Stromov\\xE1 mapa",sunburst:"Slune\\u010Dn\\xED mapa",specializedChart:"Specializovan\\xFD graf",waterfall:"Vodop\\xE1dov\\xFD graf",heatmap:"Heatmapa",combinationChart:"Kombina\\u010Dn\\xED graf",columnLineCombo:"Sloupcov\\xFD a \\u010D\\xE1rov\\xFD graf",AreaColumnCombo:"Plo\\u0161n\\xFD a sloupcov\\xFD graf",pivotChartTitle:"Kontingen\\u010Dn\\xED graf",rangeChartTitle:"Rozsahov\\xFD graf",settings:"Graf",data:"Nastaven\\xED",format:"P\\u0159izp\\u016Fsobit",categories:"Kategorie",defaultCategory:"(\\u017D\\xE1dn\\xE1)",series:"S\\xE9rie",switchCategorySeries:"P\\u0159epnout Kategorie / S\\xE9rie",categoryValues:"Hodnoty kategori\\xED",seriesLabels:"\\u0160t\\xEDtky s\\xE9ri\\xED",aggregate:"Souhrn",xyValues:"';
      S = S + 'Hodnoty XY",paired:"Re\\u017Eim P\\u0159i\\u0159azen\\xED",axis:"Osa",xAxis:"Vodorovn\\xE1 osa",yAxis:"Svisl\\xE1 osa",polarAxis:"Pol\\xE1rn\\xED osa",radiusAxis:"Polom\\u011Brn\\xE1 osa",navigator:"Navig\\xE1tor",zoom:"P\\u0159ibl\\xED\\u017Een\\xED",animation:"Animace",crosshair:"Zam\\u011B\\u0159ova\\u010D",color:"Barva",thickness:"Tlou\\u0161\\u0165ka",preferredLength:"Preferovan\\xE1 d\\xE9lka",xType:"Typ osy X",axisType:"Typ osy",automatic:"Automaticky",category:"Kategorie",number:"\\u010C\\xEDslo",time:"\\u010Cas",timeFormat:"Form\\xE1t \\u010Dasu",autoRotate:"Automatick\\xE9 ot\\xE1\\u010Den\\xED",labelRotation:"Rotace",circle:"Kruh",polygon:"Mnoho\\xFAheln\\xEDk",square:"\\u010Ctverec",cross:"K\\u0159\\xED\\u017E",diamond:"Koso\\u010Dtverec",plus:"Plus",triangle:"Troj\\xFAheln\\xEDk",heart:"Srdce",orientation:"Orientace",fixed:"Pevn\\xFD",parallel:"Rovnob\\u011B\\u017En\\xFD",perpendicular:"Kolm\\xFD",radiusAxisPosition:"Pozice",ticks:"Rysky",gridLines:"M\\u0159\\xED\\u017Ekov\\xE9 \\u010D\\xE1ry",width:"\\u0160\\xED\\u0159ka",height:"V\\xFD\\u0161ka",length:"D\\xE9lka",padding:"Odsazen\\xED",spacing:"Mezera",chartStyle:"Styl grafu",title:"N\\xE1zev",chartTitles:"N\\xE1zvy",chartTitle:"N\\xE1zev grafu",chartSubtitle:"Podn\\xE1zev",horizontalAxisTitle:"N\\xE1zev vodorovn\\xE9 osy",verticalAxisTitle:"N\\xE1zev svisl\\xE9 osy",polarAxisTitle:"N\\xE1zev pol\\xE1rn\\xED osy",titlePlaceholder:"N\\xE1zev grafu",background:"Pozad\\xED",font:"P\\xEDsmo",weight:"V\\xE1ha",top:"Naho\\u0159e",right:"Vpravo",bottom:"Dole",left:"Vlevo",labels:"\\u0160t\\xEDtky",calloutLabels:"\\u0160t\\xEDtky s odkazem",sectorLabels:"\\u0160t\\xEDtky sektor\\u016F",positionRatio:"Pom\\u011Br pozice",size:"Velikost",shape:"Tvar",minSize:"Minim\\xE1ln\\xED velikost",maxSize:"Maxim\\xE1ln\\xED velikost",legend:"Legenda",position:"Pozice",markerSize:"Velikost zna\\u010Dky",markerStroke:"Obrys zna\\u010Dky",markerPadding:"Odsazen\\xED zna\\u010Dky",itemSpacing:"Odstupy polo\\u017Eek",itemPaddingX:"Odsazen\\xED polo\\u017Eky X",itemPaddingY:"Odsazen\\xED polo\\u017Eky Y",layoutHorizonta';
      S = S + 'lSpacing:"Horizont\\xE1ln\\xED odstupy",layoutVerticalSpacing:"Vertik\\xE1ln\\xED odstupy",strokeWidth:"\\u0160\\xED\\u0159ka \\u010D\\xE1ry",offset:"Posunut\\xED",offsets:"Posunut\\xED",tooltips:"Popisky",callout:"Popisek",markers:"Zna\\u010Dky",shadow:"St\\xEDn",blur:"Rozost\\u0159en\\xED",xOffset:"Posunut\\xED X",yOffset:"Posunut\\xED Y",lineWidth:"\\u0160\\xED\\u0159ka \\u010D\\xE1ry",lineDash:"P\\u0159eru\\u0161ovan\\xE1 \\u010D\\xE1ra",lineDashOffset:"Posun p\\u0159eru\\u0161ovan\\xE9 \\u010D\\xE1ry",scrollingZoom:"P\\u0159ibl\\xED\\u017Een\\xED rolov\\xE1n\\xEDm",scrollingStep:"Krok rolov\\xE1n\\xED",selectingZoom:"P\\u0159ibl\\xED\\u017Een\\xED v\\xFDb\\u011Brem",durationMillis:"Doba trv\\xE1n\\xED (ms)",crosshairLabel:"\\u0160t\\xEDtek",crosshairSnap:"P\\u0159ichytit k bodu",normal:"Norm\\xE1ln\\xED",bold:"Tu\\u010Dn\\xE9",italic:"Kurz\\xEDva",boldItalic:"Tu\\u010Dn\\xE1 kurz\\xEDva",predefined:"P\\u0159eddefinovan\\xE9",fillOpacity:"Pr\\u016Fhlednost v\\xFDpln\\u011B",strokeColor:"Barva \\u010D\\xE1ry",strokeOpacity:"Pr\\u016Fhlednost \\u010D\\xE1ry",miniChart:"Mini-graf",histogramBinCount:"Po\\u010Det bal\\xEDk\\u016F",connectorLine:"Spojovac\\xED \\u010D\\xE1ra",seriesItems:"Polo\\u017Eky s\\xE9rie",seriesItemType:"Typ polo\\u017Eky",seriesItemPositive:"Pozitivn\\xED",seriesItemNegative:"Negativn\\xED",seriesItemLabels:"\\u0160t\\xEDtky polo\\u017Eek",columnGroup:"Sloupec",barGroup:"Li\\u0161ta",pieGroup:"Kol\\xE1\\u010D",lineGroup:"\\u010C\\xE1ra",scatterGroup:"XY (Rozptyl)",areaGroup:"Oblast",polarGroup:"Pol\\xE1rn\\xED",statisticalGroup:"Statistick\\xFD",hierarchicalGroup:"Hierarchick\\xFD",specializedGroup:"Specializovan\\xFD",combinationGroup:"Kombinovan\\xFD",groupedColumnTooltip:"Seskupen\\xFD",stackedColumnTooltip:"Stohovan\\xFD",normalizedColumnTooltip:"100% stohovan\\xFD",groupedBarTooltip:"Seskupen\\xFD",stackedBarTooltip:"Stohovan\\xFD",normalizedBarTooltip:"100% stohovan\\xFD",pieTooltip:"Kol\\xE1\\u010D",donutTooltip:"Prstencov\\xFD",lineTooltip:"\\u010C\\xE1ra",groupedAreaTooltip:"Oblast",stackedAreaTooltip:"Stohovan\\xFD",normalizedAreaToolti';
      S = S + 'p:"100% stohovan\\xFD",scatterTooltip:"Rozptyl",bubbleTooltip:"Bublina",histogramTooltip:"Histogram",radialColumnTooltip:"Radi\\xE1ln\\xED sloupec",radialBarTooltip:"Radi\\xE1ln\\xED li\\u0161ta",radarLineTooltip:"Radarov\\xE1 \\u010D\\xE1ra",radarAreaTooltip:"Radarov\\xE1 oblast",nightingaleTooltip:"Nightingale",rangeBarTooltip:"Rozsahov\\xE1 li\\u0161ta",rangeAreaTooltip:"Rozsahov\\xE1 oblast",boxPlotTooltip:"Krabicov\\xFD graf",treemapTooltip:"Stromov\\xE1 mapa",sunburstTooltip:"V\\xFDbuch slunce",waterfallTooltip:"Vodop\\xE1d",heatmapTooltip:"Tepeln\\xE1 mapa",columnLineComboTooltip:"Sloupec a \\u010D\\xE1ra",areaColumnComboTooltip:"Oblast a sloupec",customComboTooltip:"Vlastn\\xED kombinace",innerRadius:"Vnit\\u0159n\\xED polom\\u011Br",startAngle:"Po\\u010D\\xE1te\\u010Dn\\xED \\xFAhel",endAngle:"Koncov\\xFD \\xFAhel",reverseDirection:"Obr\\xE1tit sm\\u011Br",groupPadding:"Odsazen\\xED skupiny",seriesPadding:"Odsazen\\xED s\\xE9rie",tile:"Dla\\u017Edice",whisker:"Vous",cap:"Uz\\xE1v\\u011Br",capLengthRatio:"Pom\\u011Br d\\xE9lky",labelPlacement:"Um\\xEDst\\u011Bn\\xED \\u0161t\\xEDtku",inside:"Uvnit\\u0159",outside:"Vn\\u011B",noDataToChart:"Nejsou k dispozici \\u017E\\xE1dn\\xE1 data k vykreslen\\xED.",pivotChartRequiresPivotMode:"Kontingen\\u010Dn\\xED graf vy\\u017Eaduje zapnut\\xFD kontingen\\u010Dn\\xED re\\u017Eim.",chartSettingsToolbarTooltip:"Menu",chartLinkToolbarTooltip:"Propojen\\xFD s m\\u0159\\xED\\u017Ekou",chartUnlinkToolbarTooltip:"Odpojen\\xFD od m\\u0159\\xED\\u017Eky",chartDownloadToolbarTooltip:"St\\xE1hnout graf",chartMenuToolbarTooltip:"Menu",chartEdit:"Upravit graf",chartAdvancedSettings:"Pokro\\u010Dil\\xE1 nastaven\\xED",chartLink:"Propojit s m\\u0159\\xED\\u017Ekou",chartUnlink:"Odpojit od m\\u0159\\xED\\u017Eky",chartDownload:"St\\xE1hnout graf",histogramFrequency:"Frekvence",seriesChartType:"Typ grafu s\\xE9rie",seriesType:"Typ s\\xE9rie",secondaryAxis:"Sekund\\xE1rn\\xED osa",seriesAdd:"P\\u0159idat s\\xE9rii",categoryAdd:"P\\u0159idat kategorii",bar:"Li\\u0161ta",column:"Sloupec",histogram:"Histogram",advancedSetti';
      S = S + 'ngs:"Pokro\\u010Dil\\xE1 nastaven\\xED",direction:"Sm\\u011Br",horizontal:"Horizont\\xE1ln\\xED",vertical:"Vertik\\xE1ln\\xED",seriesGroupType:"Typ skupiny",groupedSeriesGroupType:"Seskupen\\xE1",stackedSeriesGroupType:"Stohovan\\xE1",normalizedSeriesGroupType:"100% stohovan\\xE1",legendEnabled:"Povoleno",invalidColor:"Neplatn\\xE1 hodnota barvy",groupedColumnFull:"Seskupen\\xFD sloupec",stackedColumnFull:"Stohovan\\xFD sloupec",normalizedColumnFull:"100% stohovan\\xFD sloupec",groupedBarFull:"Seskupen\\xE1 li\\u0161ta",stackedBarFull:"Stohovan\\xE1 li\\u0161ta",normalizedBarFull:"100% stohovan\\xE1 li\\u0161ta",stackedAreaFull:"Stohovan\\xE1 oblast",normalizedAreaFull:"100% stohovan\\xE1 oblast",customCombo:"Vlastn\\xED kombinace",ariaAdvancedFilterBuilderItem:"${variable}. \\xDArove\\u0148 ${variable}. Stiskn\\u011Bte ENTER pro \\xFApravu.",ariaAdvancedFilterBuilderItemValidation:"${variable}. \\xDArove\\u0148 ${variable}. ${variable} Stiskn\\u011Bte ENTER pro \\xFApravu.",ariaAdvancedFilterBuilderList:"Seznam pokro\\u010Dil\\xFDch filtr\\u016F",ariaAdvancedFilterBuilderFilterItem:"Podm\\xEDnka filtru",ariaAdvancedFilterBuilderGroupItem:"Skupina filtr\\u016F",ariaAdvancedFilterBuilderColumn:"Sloupec",ariaAdvancedFilterBuilderOption:"Mo\\u017Enost",ariaAdvancedFilterBuilderValueP:"Hodnota",ariaAdvancedFilterBuilderJoinOperator:"Spojovac\\xED oper\\xE1tor",ariaAdvancedFilterInput:"Vstup pokro\\u010Dil\\xE9ho filtru",ariaChecked:"za\\u0161krtnuto",ariaColumn:"Sloupec",ariaColumnGroup:"Skupina sloupc\\u016F",ariaColumnFiltered:"Sloupec filtrov\\xE1n",ariaColumnSelectAll:"P\\u0159epnout v\\xFDb\\u011Br v\\u0161ech sloupc\\u016F",ariaDateFilterInput:"Vstup datov\\xE9ho filtru",ariaDefaultListName:"Seznam",ariaFilterColumnsInput:"Vstup filtru sloupc\\u016F",ariaFilterFromValue:"Filtrovat od hodnoty",ariaFilterInput:"Vstup filtru",ariaFilterList:"Seznam filtr\\u016F",ariaFilterToValue:"Filtrovat do hodnoty",ariaFilterValue:"Hodnota filtru",ariaFilterMenuOpen:"Otev\\u0159\\xEDt nab\\xEDdku filtru",ariaFilteringOperator:"Oper\\xE';
      S = S + '1tor filtrov\\xE1n\\xED",ariaHidden:"skryto",ariaIndeterminate:"neur\\u010Deno",ariaInputEditor:"Editor vstupu",ariaMenuColumn:"Stiskn\\u011Bte ALT DOL\\u016E pro otev\\u0159en\\xED nab\\xEDdky sloupce",ariaFilterColumn:"Stiskn\\u011Bte CTRL ENTER pro otev\\u0159en\\xED filtru",ariaRowDeselect:"Stiskn\\u011Bte SPACE pro zru\\u0161en\\xED v\\xFDb\\u011Bru tohoto \\u0159\\xE1dku",ariaRowSelectAll:"Stiskn\\u011Bte SPACE pro p\\u0159epnut\\xED v\\xFDb\\u011Bru v\\u0161ech \\u0159\\xE1dk\\u016F",ariaRowToggleSelection:"Stiskn\\u011Bte SPACE pro p\\u0159epnut\\xED v\\xFDb\\u011Bru \\u0159\\xE1dku",ariaRowSelect:"Stiskn\\u011Bte SPACE pro v\\xFDb\\u011Br tohoto \\u0159\\xE1dku",ariaRowSelectionDisabled:"V\\xFDb\\u011Br \\u0159\\xE1dku je pro tento \\u0159\\xE1dek zak\\xE1z\\xE1n",ariaSearch:"Hledat",ariaSortableColumn:"Stiskn\\u011Bte ENTER pro t\\u0159\\xEDd\\u011Bn\\xED",ariaToggleVisibility:"Stiskn\\u011Bte SPACE pro p\\u0159epnut\\xED viditelnosti",ariaToggleCellValue:"Stiskn\\u011Bte SPACE pro p\\u0159epnut\\xED hodnoty bu\\u0148ky",ariaUnchecked:"neza\\u0161krtnuto",ariaVisible:"viditeln\\xE9",ariaSearchFilterValues:"Hled\\xE1n\\xED hodnot filtru",ariaPageSizeSelectorLabel:"Velikost str\\xE1nky",ariaChartMenuClose:"Zav\\u0159\\xEDt nab\\xEDdku \\xFApravy grafu",ariaChartSelected:"Vybr\\xE1no",ariaSkeletonCellLoadingFailed:"\\u0158\\xE1dek se nepoda\\u0159ilo na\\u010D\\xEDst",ariaSkeletonCellLoading:"Data \\u0159\\xE1dku se na\\u010D\\xEDtaj\\xED",ariaRowGroupDropZonePanelLabel:"Skupiny \\u0159\\xE1dk\\u016F",ariaValuesDropZonePanelLabel:"Hodnoty",ariaPivotDropZonePanelLabel:"Popisky sloupc\\u016F",ariaDropZoneColumnComponentDescription:"Stiskn\\u011Bte DELETE pro odstran\\u011Bn\\xED",ariaDropZoneColumnValueItemDescription:"Stiskn\\u011Bte ENTER pro zm\\u011Bnu typu agregace",ariaDropZoneColumnGroupItemDescription:"Stiskn\\u011Bte ENTER pro se\\u0159azen\\xED",ariaDropZoneColumnComponentAggFuncSeparator:" z ",ariaDropZoneColumnComponentSortAscending:"vzestupn\\u011B",ariaDropZoneColumnComponentSortDescending:"sestupn\\u011B",ariaLabelDialog:"Dialog",ariaLab';
      S = S + 'elColumnMenu:"Nab\\xEDdka sloupc\\u016F",ariaLabelColumnFilter:"Filtr sloupc\\u016F",ariaLabelCellEditor:"Editor bu\\u0148ky",ariaLabelSelectField:"Vyberte pole",ariaLabelRichSelectField:"V\\xFDb\\u011Brov\\xE9 pole",ariaLabelRichSelectToggleSelection:"Stiskn\\u011Bte MEZERN\\xCDK pro p\\u0159epnut\\xED v\\xFDb\\u011Bru",ariaLabelRichSelectDeselectAllItems:"Stiskn\\u011Bte DELETE pro zru\\u0161en\\xED v\\xFDb\\u011Bru v\\u0161ech polo\\u017Eek",ariaLabelRichSelectDeleteSelection:"Stiskn\\u011Bte DELETE pro zru\\u0161en\\xED v\\xFDb\\u011Bru polo\\u017Eky",ariaLabelTooltip:"Tooltip",ariaLabelContextMenu:"Kontextov\\xE1 nab\\xEDdka",ariaLabelSubMenu:"Podnab\\xEDdka",ariaLabelAggregationFunction:"Agrega\\u010Dn\\xED funkce",ariaLabelAdvancedFilterAutocomplete:"Pokro\\u010Dil\\xFD filtr Autocomplete",ariaLabelAdvancedFilterBuilderAddField:"Pokro\\u010Dil\\xFD filtr P\\u0159idat pole",ariaLabelAdvancedFilterBuilderColumnSelectField:"Pokro\\u010Dil\\xFD filtr V\\xFDb\\u011Br sloupce",ariaLabelAdvancedFilterBuilderOptionSelectField:"Pokro\\u010Dil\\xFD filtr V\\xFDb\\u011Br mo\\u017Enosti",ariaLabelAdvancedFilterBuilderJoinSelectField:"Pokro\\u010Dil\\xFD filtr V\\xFDb\\u011Br oper\\xE1tora spojen\\xED",ariaColumnPanelList:"Seznam sloupc\\u016F",ariaFilterPanelList:"Seznam filtr\\u016F",thousandSeparator:"\\u201A",decimalSeparator:",",true:"Pravda",false:"Nepravda",invalidDate:"Neplatn\\xE9 datum",invalidNumber:"Neplatn\\xE9 \\u010D\\xEDslo",january:"Leden",february:"\\xDAnor",march:"B\\u0159ezen",april:"Duben",may:"Kv\\u011Bten",june:"\\u010Cerven",july:"\\u010Cervenec",august:"Srpen",september:"Z\\xE1\\u0159\\xED",october:"\\u0158\\xEDjen",november:"Listopad",december:"Prosinec",timeFormatSlashesDDMMYYYY:"DD/MM/RRRR",timeFormatSlashesMMDDYYYY:"MM/DD/RRRR",timeFormatSlashesDDMMYY:"DD/MM/RR",timeFormatSlashesMMDDYY:"MM/DD/RR",timeFormatDotsDDMYY:"DD.M.RR",timeFormatDotsMDDYY:"M.DD.RR",timeFormatDashesYYYYMMDD:"RRRR-MM-DD",timeFormatSpacesDDMMMMYYYY:"DD MMMM RRRR",timeFormatHHMMSS:"HH:MM:SS",timeFormatHHMMSSAmPm:"HH:MM:SS AM/PM"},m={selectA';
      S = S + 'll:"(V\\xE6lg alle)",selectAllSearchResults:"(V\\xE6lg alle s\\xF8geresultater)",addCurrentSelectionToFilter:"Tilf\\xF8j aktuelle valg til filter",searchOoo:"S\\xF8g...",blanks:"(Tomt)",noMatches:"Ingen resultater",filterOoo:"Filter...",equals:"Lige med",notEqual:"Ikke lige med",blank:"Tom",notBlank:"Ikke tom",empty:"V\\xE6lg \\xE9n",lessThan:"Mindre end",greaterThan:"St\\xF8rre end",lessThanOrEqual:"Mindre end eller lig med",greaterThanOrEqual:"St\\xF8rre end eller lig med",inRange:"Mellem",inRangeStart:"Fra",inRangeEnd:"Til",contains:"Indeholder",notContains:"Indeholder ikke",startsWith:"Begynder med",endsWith:"Slutter med",dateFormatOoo:"yyyy-mm-dd",before:"F\\xF8r",after:"Efter",andCondition:"OG",orCondition:"ELLER",applyFilter:"Anvend",resetFilter:"Nulstil",clearFilter:"Ryd",cancelFilter:"Annuller",textFilter:"Tekstfilter",numberFilter:"Nummerfilter",dateFilter:"Dato filter",setFilter:"S\\xE6tfilter",groupFilterSelect:"V\\xE6lg felt:",advancedFilterContains:"indeholder",advancedFilterNotContains:"indeholder ikke",advancedFilterTextEquals:"er lig med",advancedFilterTextNotEqual:"er ikke lig med",advancedFilterStartsWith:"begynder med",advancedFilterEndsWith:"slutter med",advancedFilterBlank:"er tom",advancedFilterNotBlank:"er ikke tom",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"er sand",advancedFilterFalse:"er falsk",advancedFilterAnd:"OG",advancedFilterOr:"ELLER",advancedFilterApply:"Anvend",advancedFilterBuilder:"Builder",advancedFilterValidationMissingColumn:"Kolonne mangler",advancedFilterValidationMissingOption:"Valgmulighed mangler",advancedFilterValidationMissingValue:"V\\xE6rdi mangler",advancedFilterValidationInvalidColumn:"Kolonne ikke fundet",advancedFilterValidationInvalidOption:"Valgmulighed ikke fundet",advancedFilterValidationMissingQuote:"V\\xE6rdi mangler et afsluttende anf\\xF8rselstegn",advancedFilter';
      S = S + 'ValidationNotANumber:"V\\xE6rdi er ikke et tal",advancedFilterValidationInvalidDate:"V\\xE6rdi er ikke en gyldig dato",advancedFilterValidationMissingCondition:"Betingelse mangler",advancedFilterValidationJoinOperatorMismatch:"Join-operat\\xF8rer inden for en betingelse skal v\\xE6re ens",advancedFilterValidationInvalidJoinOperator:"Join-operator ikke fundet",advancedFilterValidationMissingEndBracket:"Mangler afsluttende parentes",advancedFilterValidationExtraEndBracket:"For mange afsluttende parenteser",advancedFilterValidationMessage:"Udtrykket har en fejl. ${variable} - ${variable}.",advancedFilterValidationMessageAtEnd:"Udtrykket har en fejl. ${variable} i slutningen af udtrykket.",advancedFilterBuilderTitle:"Avanceret Filter",advancedFilterBuilderApply:"Anvend",advancedFilterBuilderCancel:"Annuller",advancedFilterBuilderAddButtonTooltip:"Tilf\\xF8j Filter eller Gruppe",advancedFilterBuilderRemoveButtonTooltip:"Fjern",advancedFilterBuilderMoveUpButtonTooltip:"Flyt op",advancedFilterBuilderMoveDownButtonTooltip:"Flyt ned",advancedFilterBuilderAddJoin:"Tilf\\xF8j Gruppe",advancedFilterBuilderAddCondition:"Tilf\\xF8j Filter",advancedFilterBuilderSelectColumn:"V\\xE6lg en kolonne",advancedFilterBuilderSelectOption:"V\\xE6lg en valgmulighed",advancedFilterBuilderEnterValue:"Indtast en v\\xE6rdi...",advancedFilterBuilderValidationAlreadyApplied:"Aktuelt filter allerede anvendt.",advancedFilterBuilderValidationIncomplete:"Ikke alle betingelser er fuldf\\xF8rt.",advancedFilterBuilderValidationSelectColumn:"Skal v\\xE6lge en kolonne.",advancedFilterBuilderValidationSelectOption:"Skal v\\xE6lge en valgmulighed.",advancedFilterBuilderValidationEnterValue:"Skal indtaste en v\\xE6rdi.",columns:"Kolonner",filters:"Filtre",pivotMode:"Pivot-tilstand",groups:"R\\xE6kkegrupper",rowGroupColumnsEmptyMessage:"Tr\\xE6k her for at s\\xE6tte r\\xE6kkegrupper",values:"V\\xE6rdier",valueColumnsEmptyMessage:"Tr\\xE6k her for at samle",pivots:"Kolonneetiketter",pivotColumnsEmptyMessage:"Tr\\xE6k her for at s\\x';
      S = S + 'E6tte kolonneetiketter",group:"Gruppe",rowDragRow:"r\\xE6kke",rowDragRows:"r\\xE6kker",loadingOoo:"Indl\\xE6ser...",loadingError:"FEJL",noRowsToShow:"Ingen r\\xE6kker at vise",enabled:"Aktiveret",pinColumn:"Fastg\\xF8r Kolonne",pinLeft:"Fastg\\xF8r Venstre",pinRight:"Fastg\\xF8r H\\xF8jre",noPin:"Ingen Fastg\\xF8relse",valueAggregation:"V\\xE6rdi Aggregering",noAggregation:"Ingen",autosizeThisColumn:"Autosize Denne Kolonne",autosizeAllColumns:"Autosize Alle Kolonner",groupBy:"Grupp\\xE9r efter",ungroupBy:"Fjern Grupp\\xE9r efter",ungroupAll:"Fjern Alle Grupp\\xE9r",addToValues:"Tilf\\xF8j ${variable} til v\\xE6rdier",removeFromValues:"Fjern ${variable} fra v\\xE6rdier",addToLabels:"Tilf\\xF8j ${variable} til etiketter",removeFromLabels:"Fjern ${variable} fra etiketter",resetColumns:"Nulstil Kolonner",expandAll:"Udvid Alle R\\xE6kkegrupper",collapseAll:"Luk Alle R\\xE6kkegrupper",copy:"Kopier",ctrlC:"Ctrl+C",ctrlX:"Ctrl+X",copyWithHeaders:"Kopier Med Overskrifter",copyWithGroupHeaders:"Kopier med Gruppeoverskrifter",cut:"Klip",paste:"S\\xE6t Ind",ctrlV:"Ctrl+V",export:"Eksporter",csvExport:"CSV Eksport",excelExport:"Excel Eksport",columnFilter:"Kolonne Filter",columnChooser:"V\\xE6lg Kolonner",sortAscending:"Sorter Stigende",sortDescending:"Sorter Faldende",sortUnSort:"Ryd Sortering",sum:"Sum",first:"F\\xF8rste",last:"Sidste",min:"Min",max:"Maks",none:"Ingen",count:"T\\xE6lle",avg:"Gennemsnit",filteredRows:"Filtreret",selectedRows:"Valgte",totalRows:"Total R\\xE6kker",totalAndFilteredRows:"R\\xE6kker",more:"Mere",to:"til",of:"af",page:"Side",pageLastRowUnknown:"?",nextPage:"N\\xE6ste Side",lastPage:"Sidste Side",firstPage:"F\\xF8rste Side",previousPage:"Forrige Side",pageSizeSelectorLabel:"Side St\\xF8rrelse:",footerTotal:"Total",pivotColumnGroupTotals:"Totaler",pivotChartAndPivotMode:"Pivotdiagram og pivottilstand",pivotChart:"Pivotdiagram",chartRange:"Diagramomr\\xE5de",columnChart:"S\\xF8jlediagram",groupedColumn:"Gruperet",stackedColumn:"Stablet",normalizedColumn:"100% Stablet",barChart:"S\\xF';
      S = S + '8jlediagram",groupedBar:"Gruperet",stackedBar:"Stablet",normalizedBar:"100% Stablet",pieChart:"Cirkeldiagram",pie:"Cirkeldiagram",donut:"Donut",line:"Linjediagram",xyChart:"X Y (Punktdiagram)",scatter:"Punktdiagram",bubble:"Boblediagram",areaChart:"Arealdiagram",area:"Areal",stackedArea:"Stablet",normalizedArea:"100% Stablet",histogramChart:"Histogram",polarChart:"Polardiagram",radarLine:"Radarlinje",radarArea:"Radarareal",nightingale:"Nightingale",radialColumn:"Radial S\\xF8jle",radialBar:"Radial S\\xF8jle",statisticalChart:"Statistisk diagram",boxPlot:"Box Plot",rangeBar:"Intervalls\\xF8jle",rangeArea:"Intervallsareal",hierarchicalChart:"Hierarkisk diagram",treemap:"Tr\\xE6diagram",sunburst:"Solstr\\xE5lediagram",specializedChart:"Specialiseret diagram",waterfall:"Vandfaldsdiagram",heatmap:"Heatmap",combinationChart:"Kombinationsdiagram",columnLineCombo:"S\\xF8jle & Linje",AreaColumnCombo:"Areal & S\\xF8jle",pivotChartTitle:"Pivot Diagram",rangeChartTitle:"R\\xE6kkediagram",settings:"Diagram",data:"Ops\\xE6tning",format:"Tilpas",categories:"Kategorier",defaultCategory:"(Ingen)",series:"Serier",switchCategorySeries:"Skift Kategori / Serier",categoryValues:"Kategoriv\\xE6rdier",seriesLabels:"Seriem\\xE6rker",aggregate:"Aggregeret",xyValues:"X Y V\\xE6rdier",paired:"Parret Tilstand",axis:"Akse",xAxis:"Horisontal Akse",yAxis:"Vertikal Akse",polarAxis:"Polar Akse",radiusAxis:"Radius Akse",navigator:"Navigator",zoom:"Zoom",animation:"Animation",crosshair:"Tv\\xE6rh\\xE5r",color:"Farve",thickness:"Tykkelse",preferredLength:"Foretrukken L\\xE6ngde",xType:"X Type",axisType:"Akse Type",automatic:"Automatisk",category:"Kategori",number:"Nummer",time:"Tid",timeFormat:"Tidsformat",autoRotate:"Auto Rotate",labelRotation:"Rotation",circle:"Cirkel",polygon:"Polygon",square:"Firkant",cross:"Kryds",diamond:"Diamant",plus:"Plus",triangle:"Trekant",heart:"Hjerte",orientation:"Orientering",fixed:"Fast",parallel:"Parallelt",perpendicular:"Vinkelret",radiusAxisPosition:"Position",ticks:"Markeringer",g';
      S = S + 'ridLines:"Gitterlinjer",width:"Bredde",height:"H\\xF8jde",length:"L\\xE6ngde",padding:"Polstring",spacing:"Mellemrum",chartStyle:"Diagramstil",title:"Titel",chartTitles:"Titler",chartTitle:"Diagramtitel",chartSubtitle:"Undertitel",horizontalAxisTitle:"Horisontal Akse Titel",verticalAxisTitle:"Vertikal Akse Titel",polarAxisTitle:"Polar Akse Titel",titlePlaceholder:"Diagramtitel",background:"Baggrund",font:"Skrifttype",weight:"V\\xE6gt",top:"Top",right:"H\\xF8jre",bottom:"Bund",left:"Venstre",labels:"M\\xE6rker",calloutLabels:"Callout M\\xE6rker",sectorLabels:"Sektorm\\xE6rker",positionRatio:"Positionsforhold",size:"St\\xF8rrelse",shape:"Form",minSize:"Minimumsst\\xF8rrelse",maxSize:"Maksimalst\\xF8rrelse",legend:"Legende",position:"Position",markerSize:"Mark\\xF8rst\\xF8rrelse",markerStroke:"Mark\\xF8rstr\\xF8g",markerPadding:"Mark\\xF8rpolstring",itemSpacing:"Vareafstand",itemPaddingX:"Varepolstring X",itemPaddingY:"Varepolstring Y",layoutHorizontalSpacing:"Horisontal Afstand",layoutVerticalSpacing:"Vertikal Afstand",strokeWidth:"Str\\xF8gtykkelse",offset:"Forskydning",offsets:"Forskydninger",tooltips:"Tooltips",callout:"Callout",markers:"Mark\\xF8rer",shadow:"Skygge",blur:"Sl\\xF8ring",xOffset:"X Forskydning",yOffset:"Y Forskydning",lineWidth:"Linjetykkelse",lineDash:"Linje Markering",lineDashOffset:"Markering Forskydning",scrollingZoom:"Rulning",scrollingStep:"Rulnigstrin",selectingZoom:"Valg",durationMillis:"Varighed (ms)",crosshairLabel:"M\\xE6rkat",crosshairSnap:"Snap til knude",normal:"Normal",bold:"Fed",italic:"Kursiv",boldItalic:"Fed Kursiv",predefined:"Foruddefineret",fillOpacity:"Fyld Opacitet",strokeColor:"Linje Farve",strokeOpacity:"Linjegennemsigtighed",miniChart:"Mini-diagram",histogramBinCount:"Bin t\\xE6lling",connectorLine:"Forbindelselinje",seriesItems:"Seriens Elementer",seriesItemType:"Varetype",seriesItemPositive:"Positiv",seriesItemNegative:"Negativ",seriesItemLabels:"Varem\\xE6rker",columnGroup:"Kolonne",barGroup:"S\\xF8jle",pieGroup:"T\\xE6rte",lineGroup:"Linje",sc';
      S = S + 'atterGroup:"X Y (Spredning)",areaGroup:"Areal",polarGroup:"Polar",statisticalGroup:"Statistisk",hierarchicalGroup:"Hierarkisk",specializedGroup:"Specialiseret",combinationGroup:"Kombination",groupedColumnTooltip:"Grupperet",stackedColumnTooltip:"Stablet",normalizedColumnTooltip:"100% Stablet",groupedBarTooltip:"Grupperet",stackedBarTooltip:"Stablet",normalizedBarTooltip:"100% Stablet",pieTooltip:"T\\xE6rte",donutTooltip:"Donut",lineTooltip:"Linje",groupedAreaTooltip:"Areal",stackedAreaTooltip:"Stablet",normalizedAreaTooltip:"100% Stablet",scatterTooltip:"Spredning",bubbleTooltip:"Boble",histogramTooltip:"Histogram",radialColumnTooltip:"Radial Kolonne",radialBarTooltip:"Radial S\\xF8jle",radarLineTooltip:"Radar Linje",radarAreaTooltip:"Radar Areal",nightingaleTooltip:"Nattergal",rangeBarTooltip:"Omr\\xE5de S\\xF8jle",rangeAreaTooltip:"Omr\\xE5de Areal",boxPlotTooltip:"Boksplot",treemapTooltip:"Trekort",sunburstTooltip:"Solstr\\xE5le",waterfallTooltip:"Vandfald",heatmapTooltip:"Varmekort",columnLineComboTooltip:"Kolonne & Linje",areaColumnComboTooltip:"Areal & Kolonne",customComboTooltip:"Brugerdefineret Kombination",innerRadius:"Indre Radius",startAngle:"Startvinkel",endAngle:"Slutvinkel",reverseDirection:"Omvendt Retning",groupPadding:"Gruppepolstring",seriesPadding:"Seriepolstring",tile:"Flise",whisker:"Vibrisse",cap:"H\\xE6tte",capLengthRatio:"L\\xE6ngdeforhold",labelPlacement:"M\\xE6rkeplacering",inside:"Inde",outside:"Ude",noDataToChart:"Ingen data til r\\xE5dighed til at lave diagram",pivotChartRequiresPivotMode:"Pivot Diagrams kr\\xE6ver at Pivot Tilstand er aktiveret",chartSettingsToolbarTooltip:"Menu",chartLinkToolbarTooltip:"Knyttet til Gitter",chartUnlinkToolbarTooltip:"Ikke knyttet til Gitter",chartDownloadToolbarTooltip:"Download Diagram",chartMenuToolbarTooltip:"Menu",chartEdit:"Rediger Diagram",chartAdvancedSettings:"Avancerede Indstillinger",chartLink:"Knyt til Gitter",chartUnlink:"Fjern Knytning fra Gitter",chartDownload:"Download Diagram",histogramFrequency:"F';
      S = S + 'rekvens",seriesChartType:"Serie Diagram Type",seriesType:"Serietype",secondaryAxis:"Sekund\\xE6r Akse",seriesAdd:"Tilf\\xF8j en serie",categoryAdd:"Tilf\\xF8j en kategori",bar:"S\\xF8jle",column:"Kolonne",histogram:"Histogram",advancedSettings:"Avancerede Indstillinger",direction:"Retning",horizontal:"Horisontal",vertical:"Vertikal",seriesGroupType:"Gruppetype",groupedSeriesGroupType:"Grupperet",stackedSeriesGroupType:"Stablet",normalizedSeriesGroupType:"100% Stablet",legendEnabled:"Aktiveret",invalidColor:"Farvev\\xE6rdien er ugyldig",groupedColumnFull:"Grupperet Kolonne",stackedColumnFull:"Stablet Kolonne",normalizedColumnFull:"100% Stablet Kolonne",groupedBarFull:"Grupperet S\\xF8jle",stackedBarFull:"Stablet S\\xF8jle",normalizedBarFull:"100% Stablet S\\xF8jle",stackedAreaFull:"Stablet Areal",normalizedAreaFull:"100% Stablet Areal",customCombo:"Brugerdefineret Kombination",ariaAdvancedFilterBuilderItem:"${variable}. Niveau ${variable}. Tryk p\\xE5 ENTER for at redigere.",ariaAdvancedFilterBuilderItemValidation:"${variable}. Niveau ${variable}. ${variable} Tryk p\\xE5 ENTER for at redigere.",ariaAdvancedFilterBuilderList:"Avanceret Filter Builder Liste",ariaAdvancedFilterBuilderFilterItem:"Filterbetingelse",ariaAdvancedFilterBuilderGroupItem:"Filtergruppe",ariaAdvancedFilterBuilderColumn:"Kolonne",ariaAdvancedFilterBuilderOption:"Valgmulighed",ariaAdvancedFilterBuilderValueP:"V\\xE6rdi",ariaAdvancedFilterBuilderJoinOperator:"Sammenk\\xE6dningsoperator",ariaAdvancedFilterInput:"Avanceret Filter Input",ariaChecked:"markeret",ariaColumn:"Kolonne",ariaColumnGroup:"Kolonnegruppe",ariaColumnFiltered:"Kolonne Filtreret",ariaColumnSelectAll:"Skift valg af alle kolonner",ariaDateFilterInput:"Dato Filter Input",ariaDefaultListName:"Liste",ariaFilterColumnsInput:"Filtrer Kolonner Input",ariaFilterFromValue:"Filtrer fra v\\xE6rdi",ariaFilterInput:"Filter Input",ariaFilterList:"Filterliste",ariaFilterToValue:"Filtrer til v\\xE6rdi",ariaFilterValue:"Filtrerv\\xE6rdi",ariaFilterMenuOpen:"\\xC5b';
      S = S + 'n Filtermenu",ariaFilteringOperator:"Filtreringsoperator",ariaHidden:"skjult",ariaIndeterminate:"ubestemt",ariaInputEditor:"Inputredakt\\xF8r",ariaMenuColumn:"Tryk p\\xE5 ALT NED for at \\xE5bne kolonnemenu",ariaFilterColumn:"Tryk p\\xE5 CTRL ENTER for at \\xE5bne filter",ariaRowDeselect:"Tryk p\\xE5 MELLEMRUM for at frav\\xE6lge denne r\\xE6kke",ariaRowSelectAll:"Tryk p\\xE5 MELLEMRUM for at skifte alle r\\xE6kkers valg",ariaRowToggleSelection:"Tryk p\\xE5 MELLEMRUM for at skifte r\\xE6kkes valg",ariaRowSelect:"Tryk p\\xE5 MELLEMRUM for at v\\xE6lge denne r\\xE6kke",ariaRowSelectionDisabled:"R\\xE6kkevalg er deaktiveret for denne r\\xE6kke",ariaSearch:"S\\xF8g",ariaSortableColumn:"Tryk p\\xE5 ENTER for at sortere",ariaToggleVisibility:"Tryk p\\xE5 MELLEMRUM for at skifte synlighed",ariaToggleCellValue:"Tryk p\\xE5 MELLEMRUM for at skifte cellev\\xE6rdi",ariaUnchecked:"umarkeret",ariaVisible:"synlig",ariaSearchFilterValues:"S\\xF8g filterv\\xE6rdier",ariaPageSizeSelectorLabel:"Sidest\\xF8rrelse",ariaChartMenuClose:"Luk Diagram Redigeringsmenu",ariaChartSelected:"Valgt",ariaSkeletonCellLoadingFailed:"R\\xE6kke kunne ikke indl\\xE6ses",ariaSkeletonCellLoading:"R\\xE6kke data indl\\xE6ses",ariaRowGroupDropZonePanelLabel:"R\\xE6kkegrupper",ariaValuesDropZonePanelLabel:"V\\xE6rdier",ariaPivotDropZonePanelLabel:"Kolonneetiketter",ariaDropZoneColumnComponentDescription:"Tryk DELETE for at fjerne",ariaDropZoneColumnValueItemDescription:"Tryk ENTER for at \\xE6ndre aggregattypen",ariaDropZoneColumnGroupItemDescription:"Tryk ENTER for at sortere",ariaDropZoneColumnComponentAggFuncSeparator:" of ",ariaDropZoneColumnComponentSortAscending:"stigende",ariaDropZoneColumnComponentSortDescending:"faldende",ariaLabelDialog:"Dialog",ariaLabelColumnMenu:"Kolonnemenu",ariaLabelColumnFilter:"Kolonnefilter",ariaLabelCellEditor:"Celleredigering",ariaLabelSelectField:"V\\xE6lg felt",ariaLabelRichSelectField:"Rich Select Felt",ariaLabelRichSelectToggleSelection:"Tryk p\\xE5 MELLEMRUM for at skifte valg",ariaLabelRichSelectDe';
      S = S + 'selectAllItems:"Tryk p\\xE5 DELETE for at fjerne markeringen af alle emner",ariaLabelRichSelectDeleteSelection:"Tryk p\\xE5 DELETE for at fjerne markeringen af emne",ariaLabelTooltip:"V\\xE6rkt\\xF8jstip",ariaLabelContextMenu:"Kontekstmenu",ariaLabelSubMenu:"UnderMenu",ariaLabelAggregationFunction:"Aggregeringsfunktion",ariaLabelAdvancedFilterAutocomplete:"Avanceret Filter Autocomplete",ariaLabelAdvancedFilterBuilderAddField:"Avanceret Filter Builder Tilf\\xF8j Felt",ariaLabelAdvancedFilterBuilderColumnSelectField:"Avanceret Filter Builder Kolonne V\\xE6lg Felt",ariaLabelAdvancedFilterBuilderOptionSelectField:"Avanceret Filter Builder Valg V\\xE6lg Felt",ariaLabelAdvancedFilterBuilderJoinSelectField:"Avanceret Filter Builder Join Operator V\\xE6lg Felt",ariaColumnPanelList:"Kolonner Liste",ariaFilterPanelList:"Filter Liste",thousandSeparator:",",decimalSeparator:".",true:"True",false:"False",invalidDate:"Ugyldig Dato",invalidNumber:"Ugyldigt Nummer",january:"Januar",february:"Februar",march:"Marts",april:"April",may:"Maj",june:"Juni",july:"Juli",august:"August",september:"September",october:"Oktober",november:"November",december:"December",timeFormatSlashesDDMMYYYY:"DD/MM/YYYY",timeFormatSlashesMMDDYYYY:"MM/DD/YYYY",timeFormatSlashesDDMMYY:"DD/MM/YY",timeFormatSlashesMMDDYY:"MM/DD/YY",timeFormatDotsDDMYY:"DD.M.YY",timeFormatDotsMDDYY:"M.DD.YY",timeFormatDashesYYYYMMDD:"YYYY-MM-DD",timeFormatSpacesDDMMMMYYYY:"DD MMMM YYYY",timeFormatHHMMSS:"TT:MM:SS",timeFormatHHMMSSAmPm:"TT:MM:SS AM/PM"},g={selectAll:"(Alles ausw\\xE4hlen)",selectAllSearchResults:"(Alle Suchergebnisse ausw\\xE4hlen)",addCurrentSelectionToFilter:"Aktuelle Auswahl zum Filter hinzuf\\xFCgen",searchOoo:"Suchen...",blanks:"(Leer)",noMatches:"Keine \\xDCbereinstimmungen",filterOoo:"Filter...",equals:"Gleich",notEqual:"Ungleich",blank:"Leer",notBlank:"Nicht leer",empty:"W\\xE4hlen Sie eine",lessThan:"Weniger als",greaterThan:"Gr\\xF6\\xDFer als",lessThanOrEqual:"Weniger als oder gleich",greaterThanOrEqual:"Gr\\xF6\\xDFer a';
      S = S + 'ls oder gleich",inRange:"Zwischen",inRangeStart:"Von",inRangeEnd:"Bis",contains:"Enth\\xE4lt",notContains:"Enth\\xE4lt nicht",startsWith:"Beginnt mit",endsWith:"Endet mit",dateFormatOoo:"yyyy-mm-dd",before:"Vor",after:"Nach",andCondition:"UND",orCondition:"ODER",applyFilter:"Anwenden",resetFilter:"Zur\\xFCcksetzen",clearFilter:"L\\xF6schen",cancelFilter:"Abbrechen",textFilter:"Textfilter",numberFilter:"Zahlenfilter",dateFilter:"Datumsfilter",setFilter:"Satzfilter",groupFilterSelect:"Feld ausw\\xE4hlen:",advancedFilterContains:"enth\\xE4lt",advancedFilterNotContains:"enth\\xE4lt nicht",advancedFilterTextEquals:"gleich",advancedFilterTextNotEqual:"ungleich",advancedFilterStartsWith:"beginnt mit",advancedFilterEndsWith:"endet mit",advancedFilterBlank:"ist leer",advancedFilterNotBlank:"ist nicht leer",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"ist wahr",advancedFilterFalse:"ist falsch",advancedFilterAnd:"UND",advancedFilterOr:"ODER",advancedFilterApply:"Anwenden",advancedFilterBuilder:"Ersteller",advancedFilterValidationMissingColumn:"Spalte fehlt",advancedFilterValidationMissingOption:"Option fehlt",advancedFilterValidationMissingValue:"Wert fehlt",advancedFilterValidationInvalidColumn:"Spalte nicht gefunden",advancedFilterValidationInvalidOption:"Option nicht gefunden",advancedFilterValidationMissingQuote:"Wert fehlt ein Schlusszeichen",advancedFilterValidationNotANumber:"Wert ist keine Nummer",advancedFilterValidationInvalidDate:"Wert ist kein g\\xFCltiges Datum",advancedFilterValidationMissingCondition:"Bedingung fehlt",advancedFilterValidationJoinOperatorMismatch:"Verkn\\xFCpfungsoperatoren innerhalb einer Bedingung m\\xFCssen gleich sein",advancedFilterValidationInvalidJoinOperator:"Verkn\\xFCpfungsoperator nicht gefunden",advancedFilterValidationMissingEndBracket:"Endklammer fehlt",advancedFilterValidationExtraEndBra';
      S = S + 'cket:"Zu viele Endklammern",advancedFilterValidationMessage:"Ausdruck enth\\xE4lt einen Fehler. ${variable} - ${variable}.",advancedFilterValidationMessageAtEnd:"Ausdruck enth\\xE4lt einen Fehler. ${variable} am Ende des Ausdrucks.",advancedFilterBuilderTitle:"Erweiterter Filter",advancedFilterBuilderApply:"Anwenden",advancedFilterBuilderCancel:"Abbrechen",advancedFilterBuilderAddButtonTooltip:"Filter oder Gruppe hinzuf\\xFCgen",advancedFilterBuilderRemoveButtonTooltip:"Entfernen",advancedFilterBuilderMoveUpButtonTooltip:"Nach oben bewegen",advancedFilterBuilderMoveDownButtonTooltip:"Nach unten bewegen",advancedFilterBuilderAddJoin:"Gruppe hinzuf\\xFCgen",advancedFilterBuilderAddCondition:"Filter hinzuf\\xFCgen",advancedFilterBuilderSelectColumn:"Eine Spalte ausw\\xE4hlen",advancedFilterBuilderSelectOption:"Eine Option ausw\\xE4hlen",advancedFilterBuilderEnterValue:"Einen Wert eingeben...",advancedFilterBuilderValidationAlreadyApplied:"Aktueller Filter bereits angewendet.",advancedFilterBuilderValidationIncomplete:"Nicht alle Bedingungen sind vollst\\xE4ndig.",advancedFilterBuilderValidationSelectColumn:"Eine Spalte muss ausgew\\xE4hlt werden.",advancedFilterBuilderValidationSelectOption:"Eine Option muss ausgew\\xE4hlt werden.",advancedFilterBuilderValidationEnterValue:"Ein Wert muss eingegeben werden.",columns:"Spalten",filters:"Filter",pivotMode:"Pivot-Modus",groups:"Zeilengruppen",rowGroupColumnsEmptyMessage:"Ziehen Sie hierher, um Zeilengruppen festzulegen",values:"Werte",valueColumnsEmptyMessage:"Ziehen Sie hierher, um zu aggregieren",pivots:"Spaltenbezeichnungen",pivotColumnsEmptyMessage:"Ziehen Sie hierher, um Spaltenbezeichnungen festzulegen",group:"Gruppe",rowDragRow:"Reihe",rowDragRows:"Reihen",loadingOoo:"Wird geladen...",loadingError:"FEHLER",noRowsToShow:"Keine Zeilen zum Anzeigen",enabled:"Aktiviert",pinColumn:"Spalte anheften",pinLeft:"Links anheften",pinRight:"Rechts anheften",noPin:"Nicht anheften",valueAggregation:"Wertaggregation",noAggregation:"Keine",aut';
      S = S + 'osizeThisColumn:"Diese Spalte automatisch anpassen",autosizeAllColumns:"Alle Spalten automatisch anpassen",groupBy:"Gruppieren nach",ungroupBy:"Gruppierung aufheben nach",ungroupAll:"Alle Gruppierungen aufheben",addToValues:"F\\xFCge ${variable} zu Werten hinzu",removeFromValues:"Entferne ${variable} aus Werten",addToLabels:"F\\xFCge ${variable} zu Labels hinzu",removeFromLabels:"Entferne ${variable} aus Labels",resetColumns:"Spalten zur\\xFCcksetzen",expandAll:"Alle Zeilengruppen erweitern",collapseAll:"Alle Zeilengruppen schlie\\xDFen",copy:"Kopieren",ctrlC:"Strg+C",ctrlX:"Strg+X",copyWithHeaders:"Mit Kopfzeilen kopieren",copyWithGroupHeaders:"Mit Gruppenkopfzeilen kopieren",cut:"Ausschneiden",paste:"Einf\\xFCgen",ctrlV:"Strg+V",export:"Exportieren",csvExport:"CSV-Export",excelExport:"Excel-Export",columnFilter:"Spaltenfilter",columnChooser:"Spalten ausw\\xE4hlen",sortAscending:"Aufsteigend sortieren",sortDescending:"Absteigend sortieren",sortUnSort:"Sortierung aufheben",sum:"Summe",first:"Erste",last:"Letzte",min:"Min",max:"Max",none:"Keine",count:"Anzahl",avg:"Durchschnitt",filteredRows:"Gefiltert",selectedRows:"Ausgew\\xE4hlt",totalRows:"Gesamtanzahl Zeilen",totalAndFilteredRows:"Zeilen",more:"Mehr",to:"bis",of:"von",page:"Seite",pageLastRowUnknown:"?",nextPage:"N\\xE4chste Seite",lastPage:"Letzte Seite",firstPage:"Erste Seite",previousPage:"Vorherige Seite",pageSizeSelectorLabel:"Seitengr\\xF6\\xDFe:",footerTotal:"Gesamt",pivotColumnGroupTotals:"Gesamt",pivotChartAndPivotMode:"Pivot-Diagramm & Pivot-Modus",pivotChart:"Pivot-Diagramm",chartRange:"Diagrammbereich",columnChart:"S\\xE4ule",groupedColumn:"Gruppiert",stackedColumn:"Gestapelt",normalizedColumn:"100% Gestapelt",barChart:"Balken",groupedBar:"Gruppiert",stackedBar:"Gestapelt",normalizedBar:"100% Gestapelt",pieChart:"Kreisdiagramm",pie:"Kreis",donut:"Donut",line:"Linie",xyChart:"X Y (Streudiagramm)",scatter:"Streu",bubble:"Blase",areaChart:"Fl\\xE4che",area:"Fl\\xE4che",stackedArea:"Gestapelt",normalizedArea:"100% Ge';
      S = S + 'stapelt",histogramChart:"Histogramm",polarChart:"Polar",radarLine:"Radarlinie",radarArea:"Radarfl\\xE4che",nightingale:"Nachtigall",radialColumn:"Radiale S\\xE4ule",radialBar:"Radialer Balken",statisticalChart:"Statistisch",boxPlot:"Box-Plot",rangeBar:"Bereichsbalken",rangeArea:"Bereichsfl\\xE4che",hierarchicalChart:"Hierarchisch",treemap:"Baumkarte",sunburst:"Sonnenstrahl",specializedChart:"Spezialisiert",waterfall:"Wasserfall",heatmap:"Heatmap",combinationChart:"Kombination",columnLineCombo:"S\\xE4ule & Linie",AreaColumnCombo:"Fl\\xE4che & S\\xE4ule",pivotChartTitle:"Pivot-Diagramm",rangeChartTitle:"Bereichsdiagramm",settings:"Diagramm",data:"Einrichten",format:"Anpassen",categories:"Kategorien",defaultCategory:"(Keine)",series:"Reihen",switchCategorySeries:"Kategorie / Serie wechseln",categoryValues:"Kategorie Werte",seriesLabels:"Serienbeschriftungen",aggregate:"Aggregieren",xyValues:"X Y Werte",paired:"Gekoppelter Modus",axis:"Achse",xAxis:"Horizontale Achse",yAxis:"Vertikale Achse",polarAxis:"Polare Achse",radiusAxis:"Radius-Achse",navigator:"Navigator",zoom:"Zoom",animation:"Animation",crosshair:"Fadenkreuz",color:"Farbe",thickness:"Dicke",preferredLength:"Bevorzugte L\\xE4nge",xType:"X-Typ",axisType:"Achsentyp",automatic:"Automatisch",category:"Kategorie",number:"Zahl",time:"Zeit",timeFormat:"Zeit Format",autoRotate:"Automatisch Rotieren",labelRotation:"Drehung",circle:"Kreis",polygon:"Polygon",square:"Quadrat",cross:"Kreuz",diamond:"Diamant",plus:"Plus",triangle:"Dreieck",heart:"Herz",orientation:"Ausrichtung",fixed:"Fest",parallel:"Parallel",perpendicular:"Senkrecht",radiusAxisPosition:"Position",ticks:"Striche",gridLines:"Gitternetzlinien",width:"Breite",height:"H\\xF6he",length:"L\\xE4nge",padding:"Abstand",spacing:"Abstand",chartStyle:"Diagrammstil",title:"Titel",chartTitles:"Titel",chartTitle:"Diagrammtitel",chartSubtitle:"Untertitel",horizontalAxisTitle:"Titel der horizontalen Achse",verticalAxisTitle:"Titel der vertikalen Achse",polarAxisTitle:"Titel der Pola';
      S = S + 'rakse",titlePlaceholder:"Diagrammtitel",background:"Hintergrund",font:"Schriftart",weight:"Gewicht",top:"Oben",right:"Rechts",bottom:"Unten",left:"Links",labels:"Beschriftungen",calloutLabels:"Beschriftungen",sectorLabels:"Sektorbeschriftungen",positionRatio:"Positionsverh\\xE4ltnis",size:"Gr\\xF6\\xDFe",shape:"Form",minSize:"Mindestgr\\xF6\\xDFe",maxSize:"Maximalgr\\xF6\\xDFe",legend:"Legende",position:"Position",markerSize:"Markierungsgr\\xF6\\xDFe",markerStroke:"Markierungsstrich",markerPadding:"Markierungsabstand",itemSpacing:"Elementabstand",itemPaddingX:"Elementabstand X",itemPaddingY:"Elementabstand Y",layoutHorizontalSpacing:"Horizontaler Abstand",layoutVerticalSpacing:"Vertikaler Abstand",strokeWidth:"Strichbreite",offset:"Versatz",offsets:"Vers\\xE4tze",tooltips:"Tooltips",callout:"Beschriftung",markers:"Markierungen",shadow:"Schatten",blur:"Unsch\\xE4rfe",xOffset:"X-Versatz",yOffset:"Y-Versatz",lineWidth:"Linienbreite",lineDash:"Linienstrich",lineDashOffset:"Strichversatz",scrollingZoom:"Scrollen",scrollingStep:"Scrollschritt",selectingZoom:"Ausw\\xE4hlen",durationMillis:"Dauer (ms)",crosshairLabel:"Beschriftung",crosshairSnap:"An Knoten schnappen",normal:"Normal",bold:"Fett",italic:"Kursiv",boldItalic:"Fett Kursiv",predefined:"Vordefiniert",fillOpacity:"F\\xFCllopazit\\xE4t",strokeColor:"Linienfarbe",strokeOpacity:"Linienopazit\\xE4t",miniChart:"Mini-Diagramm",histogramBinCount:"Anzahl der Bins",connectorLine:"Verbindungslinie",seriesItems:"Serienartikel",seriesItemType:"Artikeltyp",seriesItemPositive:"Positiv",seriesItemNegative:"Negativ",seriesItemLabels:"Artikel Beschriftungen",columnGroup:"Spalte",barGroup:"Balken",pieGroup:"Kreis",lineGroup:"Linie",scatterGroup:"X Y (Streudiagramm)",areaGroup:"Bereich",polarGroup:"Polar",statisticalGroup:"Statistisch",hierarchicalGroup:"Hierarchisch",specializedGroup:"Spezialisiert",combinationGroup:"Kombination",groupedColumnTooltip:"Gruppiert",stackedColumnTooltip:"Gestapelt",normalizedColumnTooltip:"100% Gestapelt",groupedBarTo';
      S = S + 'oltip:"Gruppiert",stackedBarTooltip:"Gestapelt",normalizedBarTooltip:"100% Gestapelt",pieTooltip:"Kreis",donutTooltip:"Donut",lineTooltip:"Linie",groupedAreaTooltip:"Bereich",stackedAreaTooltip:"Gestapelt",normalizedAreaTooltip:"100% Gestapelt",scatterTooltip:"Streudiagramm",bubbleTooltip:"Blase",histogramTooltip:"Histogramm",radialColumnTooltip:"Radiale Spalte",radialBarTooltip:"Radialer Balken",radarLineTooltip:"Radarlinie",radarAreaTooltip:"Radarbereich",nightingaleTooltip:"Nachtigall",rangeBarTooltip:"Bereichsbalken",rangeAreaTooltip:"Bereichsbereich",boxPlotTooltip:"Boxplot",treemapTooltip:"Baumkarte",sunburstTooltip:"Sunburst",waterfallTooltip:"Wasserfall",heatmapTooltip:"Heatmap",columnLineComboTooltip:"Spalte & Linie",areaColumnComboTooltip:"Bereich & Spalte",customComboTooltip:"Benutzerdefinierte Kombination",innerRadius:"Innerer Radius",startAngle:"Startwinkel",endAngle:"Endwinkel",reverseDirection:"Richtung umkehren",groupPadding:"Gruppenabstand",seriesPadding:"Serienabstand",tile:"Kachel",whisker:"Schnurrbart",cap:"Kappe",capLengthRatio:"L\\xE4ngenverh\\xE4ltnis",labelPlacement:"Platzierung",inside:"Innen",outside:"Au\\xDFen",noDataToChart:"Keine Daten zum Chart vorhanden.",pivotChartRequiresPivotMode:"Pivot-Diagramm erfordert aktivierten Pivot-Modus.",chartSettingsToolbarTooltip:"Men\\xFC",chartLinkToolbarTooltip:"Mit Gitter verbunden",chartUnlinkToolbarTooltip:"Vom Gitter getrennt",chartDownloadToolbarTooltip:"Diagramm herunterladen",chartMenuToolbarTooltip:"Men\\xFC",chartEdit:"Diagramm bearbeiten",chartAdvancedSettings:"Erweiterte Einstellungen",chartLink:"Mit Gitter verkn\\xFCpfen",chartUnlink:"Vom Gitter trennen",chartDownload:"Diagramm herunterladen",histogramFrequency:"H\\xE4ufigkeit",seriesChartType:"Serien-Diagrammtyp",seriesType:"Serientyp",secondaryAxis:"Sekund\\xE4re Achse",seriesAdd:"Eine Serie hinzuf\\xFCgen",categoryAdd:"Eine Kategorie hinzuf\\xFCgen",bar:"Balken",column:"Spalte",histogram:"Histogramm",advancedSettings:"Erweiterte Einstellungen",di';
      S = S + 'rection:"Richtung",horizontal:"Horizontal",vertical:"Vertikal",seriesGroupType:"Gruppentyp",groupedSeriesGroupType:"Gruppiert",stackedSeriesGroupType:"Gestapelt",normalizedSeriesGroupType:"100% Gestapelt",legendEnabled:"Aktiviert",invalidColor:"Farbwert ist ung\\xFCltig",groupedColumnFull:"Gruppierte Spalte",stackedColumnFull:"Gestapelte Spalte",normalizedColumnFull:"100% Gestapelte Spalte",groupedBarFull:"Gruppierter Balken",stackedBarFull:"Gestapelter Balken",normalizedBarFull:"100% Gestapelter Balken",stackedAreaFull:"Gestapelter Bereich",normalizedAreaFull:"100% Gestapelter Bereich",customCombo:"Benutzerdefinierte Kombination",ariaAdvancedFilterBuilderItem:"${variable}. Ebene ${variable}. Dr\\xFCcken Sie ENTER, um zu bearbeiten.",ariaAdvancedFilterBuilderItemValidation:"${variable}. Ebene ${variable}. ${variable} Dr\\xFCcken Sie ENTER, um zu bearbeiten.",ariaAdvancedFilterBuilderList:"Erweiterte Filter-Builder-Liste",ariaAdvancedFilterBuilderFilterItem:"Filterbedingung",ariaAdvancedFilterBuilderGroupItem:"Filtergruppe",ariaAdvancedFilterBuilderColumn:"Spalte",ariaAdvancedFilterBuilderOption:"Option",ariaAdvancedFilterBuilderValueP:"Wert",ariaAdvancedFilterBuilderJoinOperator:"Verkn\\xFCpfungsoperator",ariaAdvancedFilterInput:"Erweiterter Filtereingang",ariaChecked:"gepr\\xFCft",ariaColumn:"Spalte",ariaColumnGroup:"Spaltengruppe",ariaColumnFiltered:"Spalte gefiltert",ariaColumnSelectAll:"Alle Spalten ausw\\xE4hlen umschalten",ariaDateFilterInput:"Datum-Filtereingang",ariaDefaultListName:"Liste",ariaFilterColumnsInput:"Filterspalteneingang",ariaFilterFromValue:"Filter vom Wert",ariaFilterInput:"Filtereingang",ariaFilterList:"Filterliste",ariaFilterToValue:"Filter zum Wert",ariaFilterValue:"Filterwert",ariaFilterMenuOpen:"Filtermen\\xFC \\xF6ffnen",ariaFilteringOperator:"Filteroperator",ariaHidden:"versteckt",ariaIndeterminate:"unbestimmt",ariaInputEditor:"Eingabeeditor",ariaMenuColumn:"Dr\\xFCcken Sie ALT NACH UNTEN, um das Spaltenmen\\xFC zu \\xF6ffnen",ariaFilterColumn:"Dr';
      S = S + '\\xFCcken Sie STRG EINGABETASTE, um den Filter zu \\xF6ffnen",ariaRowDeselect:"Dr\\xFCcken Sie LEERTASTE, um diese Zeile abzuwaehlen",ariaRowSelectAll:"Dr\\xFCcken Sie LEERTASTE, um die Auswahl aller Zeilen umzuschalten",ariaRowToggleSelection:"Dr\\xFCcken Sie LEERTASTE, um die Zeilenauswahl umzuschalten",ariaRowSelect:"Dr\\xFCcken Sie LEERTASTE, um diese Zeile auszuw\\xE4hlen",ariaRowSelectionDisabled:"Zeilenauswahl ist f\\xFCr diese Zeile deaktiviert",ariaSearch:"Suche",ariaSortableColumn:"Dr\\xFCcken Sie EINGABETASTE, um zu sortieren",ariaToggleVisibility:"Dr\\xFCcken Sie LEERTASTE, um die Sichtbarkeit umzuschalten",ariaToggleCellValue:"Dr\\xFCcken Sie LEERTASTE, um den Zellenwert umzuschalten",ariaUnchecked:"ungepr\\xFCft",ariaVisible:"sichtbar",ariaSearchFilterValues:"Filterwerte suchen",ariaPageSizeSelectorLabel:"Seitengr\\xF6\\xDFe",ariaChartMenuClose:"Diagramm-Bearbeitungsmen\\xFC schlie\\xDFen",ariaChartSelected:"Ausgew\\xE4hlt",ariaSkeletonCellLoadingFailed:"Das Laden der Zeile ist fehlgeschlagen",ariaSkeletonCellLoading:"Zeilendaten werden geladen",ariaRowGroupDropZonePanelLabel:"Zeilengruppen",ariaValuesDropZonePanelLabel:"Werte",ariaPivotDropZonePanelLabel:"Spaltenbeschriftungen",ariaDropZoneColumnComponentDescription:"Dr\\xFCcken Sie DELETE, um zu entfernen",ariaDropZoneColumnValueItemDescription:"Dr\\xFCcken Sie ENTER, um den Aggregationstyp zu \\xE4ndern",ariaDropZoneColumnGroupItemDescription:"Dr\\xFCcken Sie ENTER, um zu sortieren",ariaDropZoneColumnComponentAggFuncSeparator:" von ",ariaDropZoneColumnComponentSortAscending:"aufsteigend",ariaDropZoneColumnComponentSortDescending:"absteigend",ariaLabelDialog:"Dialog",ariaLabelColumnMenu:"Spaltenmen\\xFC",ariaLabelColumnFilter:"Spaltenfilter",ariaLabelCellEditor:"Zelleneditor",ariaLabelSelectField:"Feld ausw\\xE4hlen",ariaLabelRichSelectField:"Rich-Select-Feld",ariaLabelRichSelectToggleSelection:"Dr\\xFCcken Sie die LEERTASTE, um die Auswahl umzuschalten",ariaLabelRichSelectDeselectAllItems:"Dr\\xFCcken Sie ENTFERNEN, um alle';
      S = S + ' Elemente abzuw\\xE4hlen",ariaLabelRichSelectDeleteSelection:"Dr\\xFCcken Sie ENTFERNEN, um das Element abzuw\\xE4hlen",ariaLabelTooltip:"Tooltip",ariaLabelContextMenu:"Kontextmen\\xFC",ariaLabelSubMenu:"Untermen\\xFC",ariaLabelAggregationFunction:"Aggregationsfunktion",ariaLabelAdvancedFilterAutocomplete:"Erweiterte Filter-Autovervollst\\xE4ndigung",ariaLabelAdvancedFilterBuilderAddField:"Erweiterte Filtererstellung Feld hinzuf\\xFCgen",ariaLabelAdvancedFilterBuilderColumnSelectField:"Erweiterte Filtererstellung Spaltenauswahlfeld",ariaLabelAdvancedFilterBuilderOptionSelectField:"Erweiterte Filtererstellung Optionsauswahlfeld",ariaLabelAdvancedFilterBuilderJoinSelectField:"Erweiterte Filtererstellung Verkn\\xFCpfungsoperatore Auswahlfeld",ariaColumnPanelList:"Spaltenliste",ariaFilterPanelList:"Filterliste",thousandSeparator:".",decimalSeparator:",",true:"Wahr",false:"Falsch",invalidDate:"Ung\\xFCltiges Datum",invalidNumber:"Ung\\xFCltige Nummer",january:"Januar",february:"Februar",march:"M\\xE4rz",april:"April",may:"Mai",june:"Juni",july:"Juli",august:"August",september:"September",october:"Oktober",november:"November",december:"Dezember",timeFormatSlashesDDMMYYYY:"TT/MM/JJJJ",timeFormatSlashesMMDDYYYY:"MM/TT/JJJJ",timeFormatSlashesDDMMYY:"TT/MM/JJ",timeFormatSlashesMMDDYY:"MM/TT/JJ",timeFormatDotsDDMYY:"TT.M.JJ",timeFormatDotsMDDYY:"M.TT.JJ",timeFormatDashesYYYYMMDD:"JJJJ-MM-TT",timeFormatSpacesDDMMMMYYYY:"TT MMMM JJJJ",timeFormatHHMMSS:"SS:MM:SS",timeFormatHHMMSSAmPm:"SS:MM:SS VM/NM"},x={selectAll:"(\\u0395\\u03C0\\u03B9\\u03BB\\u03BF\\u03B3\\u03AE \\u03CC\\u03BB\\u03C9\\u03BD)",selectAllSearchResults:"(\\u0395\\u03C0\\u03B9\\u03BB\\u03BF\\u03B3\\u03AE \\u03CC\\u03BB\\u03C9\\u03BD \\u03C4\\u03C9\\u03BD \\u03B1\\u03C0\\u03BF\\u03C4\\u03B5\\u03BB\\u03B5\\u03C3\\u03BC\\u03AC\\u03C4\\u03C9\\u03BD \\u03B1\\u03BD\\u03B1\\u03B6\\u03AE\\u03C4\\u03B7\\u03C3\\u03B7\\u03C2)",addCurrentSelectionToFilter:"\\u03A0\\u03C1\\u03BF\\u03C3\\u03B8\\u03AE\\u03BA\\u03B7 \\u03C4\\u03C1\\u03AD\\u03C7\\u03BF\\u03C5\\u03C3\\u03B1\\u03C2 \\u03B5\\u03C0\\u03B9\\u03BB\\u';
      S = S + '03BF\\u03B3\\u03AE\\u03C2 \\u03C3\\u03C4\\u03BF \\u03C6\\u03AF\\u03BB\\u03C4\\u03C1\\u03BF",searchOoo:"\\u0391\\u03BD\\u03B1\\u03B6\\u03AE\\u03C4\\u03B7\\u03C3\\u03B7...",blanks:"(\\u039A\\u03B5\\u03BD\\u03AC)",noMatches:"\\u0394\\u03B5\\u03BD \\u03B2\\u03C1\\u03AD\\u03B8\\u03B7\\u03BA\\u03B1\\u03BD \\u03B1\\u03C0\\u03BF\\u03C4\\u03B5\\u03BB\\u03AD\\u03C3\\u03BC\\u03B1\\u03C4\\u03B1",filterOoo:"\\u03A6\\u03AF\\u03BB\\u03C4\\u03C1\\u03BF...",equals:"\\u038A\\u03C3\\u03BF \\u03BC\\u03B5",notEqual:"\\u0394\\u03B5\\u03BD \\u03B5\\u03AF\\u03BD\\u03B1\\u03B9 \\u03AF\\u03C3\\u03BF \\u03BC\\u03B5",blank:"\\u039A\\u03B5\\u03BD\\u03CC",notBlank:"\\u0394\\u03B5\\u03BD \\u03B5\\u03AF\\u03BD\\u03B1\\u03B9 \\u03BA\\u03B5\\u03BD\\u03CC",empty:"\\u0395\\u03C0\\u03B9\\u03BB\\u03AD\\u03BE\\u03C4\\u03B5 \\u03AD\\u03BD\\u03B1",lessThan:"\\u039B\\u03B9\\u03B3\\u03CC\\u03C4\\u03B5\\u03C1\\u03BF \\u03B1\\u03C0\\u03CC",greaterThan:"\\u039C\\u03B5\\u03B3\\u03B1\\u03BB\\u03CD\\u03C4\\u03B5\\u03C1\\u03BF \\u03B1\\u03C0\\u03CC",lessThanOrEqual:"\\u039B\\u03B9\\u03B3\\u03CC\\u03C4\\u03B5\\u03C1\\u03BF \\u03AE \\u03AF\\u03C3\\u03BF \\u03BC\\u03B5",greaterThanOrEqual:"\\u039C\\u03B5\\u03B3\\u03B1\\u03BB\\u03CD\\u03C4\\u03B5\\u03C1\\u03BF \\u03AE \\u03AF\\u03C3\\u03BF \\u03BC\\u03B5",inRange:"\\u0391\\u03BD\\u03AC\\u03BC\\u03B5\\u03C3\\u03B1",inRangeStart:"\\u0391\\u03C0\\u03CC",inRangeEnd:"\\u0388\\u03C9\\u03C2",contains:"\\u03A0\\u03B5\\u03C1\\u03B9\\u03AD\\u03C7\\u03B5\\u03B9",notContains:"\\u0394\\u03B5\\u03BD \\u03C0\\u03B5\\u03C1\\u03B9\\u03AD\\u03C7\\u03B5\\u03B9",startsWith:"\\u039E\\u03B5\\u03BA\\u03B9\\u03BD\\u03AC \\u03BC\\u03B5",endsWith:"\\u03A4\\u03B5\\u03BB\\u03B5\\u03B9\\u03CE\\u03BD\\u03B5\\u03B9 \\u03BC\\u03B5",dateFormatOoo:"yyyy-mm-dd",before:"\\u03A0\\u03C1\\u03B9\\u03BD",after:"\\u039C\\u03B5\\u03C4\\u03AC",andCondition:"\\u039A\\u0391\\u0399",orCondition:"\\u0389",applyFilter:"\\u0395\\u03C6\\u03B1\\u03C1\\u03BC\\u03BF\\u03B3\\u03AE",resetFilter:"\\u0395\\u03C0\\u03B1\\u03BD\\u03B1\\u03C6\\u03BF\\u03C1\\u03AC",clearFilter:"\\u0395\\u03BA\\u03BA\\u03B1\\u03B8\\u03AC\\u03C1\\u03B9\\u03C3\\u03B7",cancelFilter:"\\u0391\\u03BA\\u03CD\\u03C1\\u03C9\\u03C3\\u03B7",textFilter:"\\u03A6\\u03AF\\u03BB\\u03C4\\u03C1\\u03BF \\u039A\\u03B5\\u';
      S = S + '03B9\\u03BC\\u03AD\\u03BD\\u03BF\\u03C5",numberFilter:"\\u03A6\\u03AF\\u03BB\\u03C4\\u03C1\\u03BF \\u0391\\u03C1\\u03B9\\u03B8\\u03BC\\u03BF\\u03CD",dateFilter:"\\u03A6\\u03AF\\u03BB\\u03C4\\u03C1\\u03BF \\u0397\\u03BC\\u03B5\\u03C1\\u03BF\\u03BC\\u03B7\\u03BD\\u03AF\\u03B1\\u03C2",setFilter:"\\u03A6\\u03AF\\u03BB\\u03C4\\u03C1\\u03BF \\u03A3\\u03C5\\u03BD\\u03CC\\u03BB\\u03BF\\u03C5",groupFilterSelect:"\\u0395\\u03C0\\u03B9\\u03BB\\u03AD\\u03BE\\u03C4\\u03B5 \\u03C0\\u03B5\\u03B4\\u03AF\\u03BF:",advancedFilterContains:"\\u03C0\\u03B5\\u03C1\\u03B9\\u03AD\\u03C7\\u03B5\\u03B9",advancedFilterNotContains:"\\u03B4\\u03B5\\u03BD \\u03C0\\u03B5\\u03C1\\u03B9\\u03AD\\u03C7\\u03B5\\u03B9",advancedFilterTextEquals:"\\u03B5\\u03AF\\u03BD\\u03B1\\u03B9 \\u03AF\\u03C3\\u03BF \\u03BC\\u03B5",advancedFilterTextNotEqual:"\\u03B4\\u03B5\\u03BD \\u03B5\\u03AF\\u03BD\\u03B1\\u03B9 \\u03AF\\u03C3\\u03BF \\u03BC\\u03B5",advancedFilterStartsWith:"\\u03B1\\u03C1\\u03C7\\u03AF\\u03B6\\u03B5\\u03B9 \\u03BC\\u03B5",advancedFilterEndsWith:"\\u03C4\\u03B5\\u03BB\\u03B5\\u03B9\\u03CE\\u03BD\\u03B5\\u03B9 \\u03BC\\u03B5",advancedFilterBlank:"\\u03B5\\u03AF\\u03BD\\u03B1\\u03B9 \\u03BA\\u03B5\\u03BD\\u03CC",advancedFilterNotBlank:"\\u03B4\\u03B5\\u03BD \\u03B5\\u03AF\\u03BD\\u03B1\\u03B9 \\u03BA\\u03B5\\u03BD\\u03CC",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"\\u03B5\\u03AF\\u03BD\\u03B1\\u03B9 \\u03B1\\u03BB\\u03B7\\u03B8\\u03AD\\u03C2",advancedFilterFalse:"\\u03B5\\u03AF\\u03BD\\u03B1\\u03B9 \\u03C8\\u03B5\\u03C5\\u03B4\\u03AD\\u03C2",advancedFilterAnd:"\\u039A\\u0391\\u0399",advancedFilterOr:"\\u0389",advancedFilterApply:"\\u0395\\u03C6\\u03B1\\u03C1\\u03BC\\u03BF\\u03B3\\u03AE",advancedFilterBuilder:"\\u039A\\u03B1\\u03C4\\u03B1\\u03C3\\u03BA\\u03B5\\u03C5\\u03B1\\u03C3\\u03C4\\u03AE\\u03C2",advancedFilterValidationMissingColumn:"\\u0397 \\u03C3\\u03C4\\u03AE\\u03BB\\u03B7 \\u03BB\\u03B5\\u03AF\\u03C0\\u03B5\\u03B9",advancedFilterValidationMissingOption:"\\u0397 \\u03B5\\u03C0\\u03B9\\u03BB\\u03BF\\u03B3\\u03AE \\u03BB\\u03B5\\u03AF\\u03C0\\u03B';
      S = S + '5\\u03B9",advancedFilterValidationMissingValue:"\\u0397 \\u03C4\\u03B9\\u03BC\\u03AE \\u03BB\\u03B5\\u03AF\\u03C0\\u03B5\\u03B9",advancedFilterValidationInvalidColumn:"\\u0397 \\u03C3\\u03C4\\u03AE\\u03BB\\u03B7 \\u03B4\\u03B5\\u03BD \\u03B2\\u03C1\\u03AD\\u03B8\\u03B7\\u03BA\\u03B5",advancedFilterValidationInvalidOption:"\\u0397 \\u03B5\\u03C0\\u03B9\\u03BB\\u03BF\\u03B3\\u03AE \\u03B4\\u03B5\\u03BD \\u03B2\\u03C1\\u03AD\\u03B8\\u03B7\\u03BA\\u03B5",advancedFilterValidationMissingQuote:"\\u0397 \\u03C4\\u03B9\\u03BC\\u03AE \\u03BB\\u03B5\\u03AF\\u03C0\\u03B5\\u03B9 \\u03C4\\u03B5\\u03BB\\u03B9\\u03BA\\u03AE \\u03B5\\u03B9\\u03C3\\u03B1\\u03B3\\u03C9\\u03B3\\u03B9\\u03BA\\u03AE",advancedFilterValidationNotANumber:"\\u0397 \\u03C4\\u03B9\\u03BC\\u03AE \\u03B4\\u03B5\\u03BD \\u03B5\\u03AF\\u03BD\\u03B1\\u03B9 \\u03B1\\u03C1\\u03B9\\u03B8\\u03BC\\u03CC\\u03C2",advancedFilterValidationInvalidDate:"\\u0397 \\u03C4\\u03B9\\u03BC\\u03AE \\u03B4\\u03B5\\u03BD \\u03B5\\u03AF\\u03BD\\u03B1\\u03B9 \\u03AD\\u03B3\\u03BA\\u03C5\\u03C1\\u03B7 \\u03B7\\u03BC\\u03B5\\u03C1\\u03BF\\u03BC\\u03B7\\u03BD\\u03AF\\u03B1",advancedFilterValidationMissingCondition:"\\u0397 \\u03C3\\u03C5\\u03BD\\u03B8\\u03AE\\u03BA\\u03B7 \\u03BB\\u03B5\\u03AF\\u03C0\\u03B5\\u03B9",advancedFilterValidationJoinOperatorMismatch:"\\u039F\\u03B9 \\u03C4\\u03B5\\u03BB\\u03B5\\u03C3\\u03C4\\u03AD\\u03C2 \\u03AD\\u03BD\\u03C9\\u03C3\\u03B7\\u03C2 \\u03B5\\u03BD\\u03C4\\u03CC\\u03C2 \\u03C3\\u03C5\\u03BD\\u03B8\\u03AE\\u03BA\\u03B7\\u03C2 \\u03C0\\u03C1\\u03AD\\u03C0\\u03B5\\u03B9 \\u03BD\\u03B1 \\u03B5\\u03AF\\u03BD\\u03B1\\u03B9 \\u03BF\\u03B9 \\u03AF\\u03B4\\u03B9\\u03BF\\u03B9",advancedFilterValidationInvalidJoinOperator:"\\u039F \\u03C4\\u03B5\\u03BB\\u03B5\\u03C3\\u03C4\\u03AE\\u03C2 \\u03AD\\u03BD\\u03C9\\u03C3\\u03B7\\u03C2 \\u03B4\\u03B5\\u03BD \\u03B2\\u03C1\\u03AD\\u03B8\\u03B7\\u03BA\\u03B5",advancedFilterValidationMissingEndBracket:"\\u039B\\u03B5\\u03AF\\u03C0\\u03B5\\u03B9 \\u03C4\\u03BF \\u03C4\\u03B5\\u03BB\\u03B9\\u03BA\\u03AC \\u03C3\\u03C4\\u03B7\\u03C1\\u03AF\\u03B3\\u03BC\\u03B1",advancedFilterValidationExtraEndBracket:"\\u03A0\\u03B5\\u03C1\\u03B9\\u03C3\\u03C3\\u03CC\\u03C4\\u03B5\\u03C1\\u03B1 \\u03B1\\u03C0\\u03CC \\u03AD\\u03BD\\u03';
      S = S + 'B1 \\u03C4\\u03B5\\u03BB\\u03B9\\u03BA\\u03AC \\u03C3\\u03C4\\u03B7\\u03C1\\u03AF\\u03B3\\u03BC\\u03B1\\u03C4\\u03B1",advancedFilterValidationMessage:"\\u0397 \\u03AD\\u03BA\\u03C6\\u03C1\\u03B1\\u03C3\\u03B7 \\u03AD\\u03C7\\u03B5\\u03B9 \\u03C3\\u03C6\\u03AC\\u03BB\\u03BC\\u03B1. ${variable} - ${variable}.",advancedFilterValidationMessageAtEnd:"\\u0397 \\u03AD\\u03BA\\u03C6\\u03C1\\u03B1\\u03C3\\u03B7 \\u03AD\\u03C7\\u03B5\\u03B9 \\u03C3\\u03C6\\u03AC\\u03BB\\u03BC\\u03B1. ${variable} \\u03C3\\u03C4\\u03BF \\u03C4\\u03AD\\u03BB\\u03BF\\u03C2 \\u03C4\\u03B7\\u03C2 \\u03AD\\u03BA\\u03C6\\u03C1\\u03B1\\u03C3\\u03B7\\u03C2.",advancedFilterBuilderTitle:"\\u03A0\\u03C1\\u03BF\\u03B7\\u03B3\\u03BC\\u03AD\\u03BD\\u03BF \\u03A6\\u03AF\\u03BB\\u03C4\\u03C1\\u03BF",advancedFilterBuilderApply:"\\u0395\\u03C6\\u03B1\\u03C1\\u03BC\\u03BF\\u03B3\\u03AE",advancedFilterBuilderCancel:"\\u0386\\u03BA\\u03C5\\u03C1\\u03BF",advancedFilterBuilderAddButtonTooltip:"\\u03A0\\u03C1\\u03BF\\u03C3\\u03B8\\u03AE\\u03BA\\u03B7 \\u03A6\\u03AF\\u03BB\\u03C4\\u03C1\\u03BF\\u03C5 \\u03AE \\u039F\\u03BC\\u03AC\\u03B4\\u03B1\\u03C2",advancedFilterBuilderRemoveButtonTooltip:"\\u0391\\u03C6\\u03B1\\u03AF\\u03C1\\u03B5\\u03C3\\u03B7",advancedFilterBuilderMoveUpButtonTooltip:"\\u039C\\u03B5\\u03C4\\u03B1\\u03BA\\u03AF\\u03BD\\u03B7\\u03C3\\u03B7 \\u03A0\\u03AC\\u03BD\\u03C9",advancedFilterBuilderMoveDownButtonTooltip:"\\u039C\\u03B5\\u03C4\\u03B1\\u03BA\\u03AF\\u03BD\\u03B7\\u03C3\\u03B7 \\u039A\\u03AC\\u03C4\\u03C9",advancedFilterBuilderAddJoin:"\\u03A0\\u03C1\\u03BF\\u03C3\\u03B8\\u03AE\\u03BA\\u03B7 \\u039F\\u03BC\\u03AC\\u03B4\\u03B1\\u03C2",advancedFilterBuilderAddCondition:"\\u03A0\\u03C1\\u03BF\\u03C3\\u03B8\\u03AE\\u03BA\\u03B7 \\u03A6\\u03AF\\u03BB\\u03C4\\u03C1\\u03BF\\u03C5",advancedFilterBuilderSelectColumn:"\\u0395\\u03C0\\u03B9\\u03BB\\u03AD\\u03BE\\u03C4\\u03B5 \\u03BC\\u03B9\\u03B1 \\u03C3\\u03C4\\u03AE\\u03BB\\u03B7",advancedFilterBuilderSelectOption:"\\u0395\\u03C0\\u03B9\\u03BB\\u03AD\\u03BE\\u03C4\\u03B5 \\u03BC\\u03B9\\u03B1 \\u03B5\\u03C0\\u03B9\\u03BB\\u03BF\\u03B3\\u03AE",advancedFilterBuilderEnterValue:"\\u0395\\u03B9\\u03C3\\u03AC\\u03B3\\u03B5\\u03C4\\u03B5 \\u03BC\\u03B9\\u03B1 \\u03C4\\u03B9\\u03BC\\u03AE.';
      S = S + '..",advancedFilterBuilderValidationAlreadyApplied:"\\u03A4\\u03BF \\u03C4\\u03C1\\u03AD\\u03C7\\u03BF\\u03BD \\u03C6\\u03AF\\u03BB\\u03C4\\u03C1\\u03BF \\u03AD\\u03C7\\u03B5\\u03B9 \\u03AE\\u03B4\\u03B7 \\u03B5\\u03C6\\u03B1\\u03C1\\u03BC\\u03BF\\u03C3\\u03C4\\u03B5\\u03AF.",advancedFilterBuilderValidationIncomplete:"\\u0394\\u03B5\\u03BD \\u03AD\\u03C7\\u03BF\\u03C5\\u03BD \\u03BF\\u03BB\\u03BF\\u03BA\\u03BB\\u03B7\\u03C1\\u03C9\\u03B8\\u03B5\\u03AF \\u03CC\\u03BB\\u03B5\\u03C2 \\u03BF\\u03B9 \\u03C3\\u03C5\\u03BD\\u03B8\\u03AE\\u03BA\\u03B5\\u03C2.",advancedFilterBuilderValidationSelectColumn:"\\u03A0\\u03C1\\u03AD\\u03C0\\u03B5\\u03B9 \\u03BD\\u03B1 \\u03B5\\u03C0\\u03B9\\u03BB\\u03AD\\u03BE\\u03B5\\u03C4\\u03B5 \\u03BC\\u03B9\\u03B1 \\u03C3\\u03C4\\u03AE\\u03BB\\u03B7.",advancedFilterBuilderValidationSelectOption:"\\u03A0\\u03C1\\u03AD\\u03C0\\u03B5\\u03B9 \\u03BD\\u03B1 \\u03B5\\u03C0\\u03B9\\u03BB\\u03AD\\u03BE\\u03B5\\u03C4\\u03B5 \\u03BC\\u03B9\\u03B1 \\u03B5\\u03C0\\u03B9\\u03BB\\u03BF\\u03B3\\u03AE.",advancedFilterBuilderValidationEnterValue:"\\u03A0\\u03C1\\u03AD\\u03C0\\u03B5\\u03B9 \\u03BD\\u03B1 \\u03B5\\u03B9\\u03C3\\u03AC\\u03B3\\u03B5\\u03C4\\u03B5 \\u03BC\\u03B9\\u03B1 \\u03C4\\u03B9\\u03BC\\u03AE.",columns:"\\u03A3\\u03C4\\u03AE\\u03BB\\u03B5\\u03C2",filters:"\\u03A6\\u03AF\\u03BB\\u03C4\\u03C1\\u03B1",pivotMode:"\\u039B\\u03B5\\u03B9\\u03C4\\u03BF\\u03C5\\u03C1\\u03B3\\u03AF\\u03B1 \\u03A0\\u03B5\\u03C1\\u03B9\\u03C3\\u03C4\\u03C1\\u03BF\\u03C6\\u03AE\\u03C2",groups:"\\u039F\\u03BC\\u03AC\\u03B4\\u03B5\\u03C2 \\u0393\\u03C1\\u03B1\\u03BC\\u03BC\\u03CE\\u03BD",rowGroupColumnsEmptyMessage:"\\u03A3\\u03CD\\u03C1\\u03B5\\u03C4\\u03B5 \\u03B5\\u03B4\\u03CE \\u03B3\\u03B9\\u03B1 \\u03BD\\u03B1 \\u03BF\\u03C1\\u03AF\\u03C3\\u03B5\\u03C4\\u03B5 \\u03BF\\u03BC\\u03AC\\u03B4\\u03B5\\u03C2 \\u03B3\\u03C1\\u03B1\\u03BC\\u03BC\\u03CE\\u03BD",values:"\\u03A4\\u03B9\\u03BC\\u03AD\\u03C2",valueColumnsEmptyMessage:"\\u03A3\\u03CD\\u03C1\\u03B5\\u03C4\\u03B5 \\u03B5\\u03B4\\u03CE \\u03B3\\u03B9\\u03B1 \\u03BD\\u03B1 \\u03C3\\u03C5\\u03B3\\u03BA\\u03B5\\u03BD\\u03C4\\u03C1\\u03CE\\u03C3\\u03B5\\u03C4\\u03B5",pivots:"\\u0395\\u03C4\\u03B9\\u03BA\\u03AD\\u03C4\\u03B5\\u03C2 \\u03A3\\u03C4\\u03B7\\u03BB\\u03CE\\u03BD",pivotColu';
      S = S + 'mnsEmptyMessage:"\\u03A3\\u03CD\\u03C1\\u03B5\\u03C4\\u03B5 \\u03B5\\u03B4\\u03CE \\u03B3\\u03B9\\u03B1 \\u03BD\\u03B1 \\u03BF\\u03C1\\u03AF\\u03C3\\u03B5\\u03C4\\u03B5 \\u03B5\\u03C4\\u03B9\\u03BA\\u03AD\\u03C4\\u03B5\\u03C2 \\u03C3\\u03C4\\u03B7\\u03BB\\u03CE\\u03BD",group:"\\u039F\\u03BC\\u03AC\\u03B4\\u03B1",rowDragRow:"\\u03B3\\u03C1\\u03B1\\u03BC\\u03BC\\u03AE",rowDragRows:"\\u03B3\\u03C1\\u03B1\\u03BC\\u03BC\\u03AD\\u03C2",loadingOoo:"\\u03A6\\u03CC\\u03C1\\u03C4\\u03C9\\u03C3\\u03B7...",loadingError:"\\u03A3\\u03A6\\u0391\\u039B\\u039C\\u0391",noRowsToShow:"\\u0394\\u03B5\\u03BD \\u03C5\\u03C0\\u03AC\\u03C1\\u03C7\\u03BF\\u03C5\\u03BD \\u03B3\\u03C1\\u03B1\\u03BC\\u03BC\\u03AD\\u03C2 \\u03B3\\u03B9\\u03B1 \\u03B5\\u03BC\\u03C6\\u03AC\\u03BD\\u03B9\\u03C3\\u03B7",enabled:"\\u0395\\u03BD\\u03B5\\u03C1\\u03B3\\u03BF\\u03C0\\u03BF\\u03B9\\u03B7\\u03BC\\u03AD\\u03BD\\u03BF",pinColumn:"\\u039A\\u03B1\\u03C1\\u03C6\\u03AF\\u03C4\\u03C3\\u03C9\\u03BC\\u03B1 \\u03A3\\u03C4\\u03AE\\u03BB\\u03B7\\u03C2",pinLeft:"\\u039A\\u03B1\\u03C1\\u03C6\\u03AF\\u03C4\\u03C3\\u03C9\\u03BC\\u03B1 \\u0391\\u03C1\\u03B9\\u03C3\\u03C4\\u03B5\\u03C1\\u03AC",pinRight:"\\u039A\\u03B1\\u03C1\\u03C6\\u03AF\\u03C4\\u03C3\\u03C9\\u03BC\\u03B1 \\u0394\\u03B5\\u03BE\\u03B9\\u03AC",noPin:"\\u03A7\\u03C9\\u03C1\\u03AF\\u03C2 \\u039A\\u03B1\\u03C1\\u03C6\\u03AF\\u03C4\\u03C3\\u03C9\\u03BC\\u03B1",valueAggregation:"\\u03A3\\u03C5\\u03B3\\u03BA\\u03AD\\u03BD\\u03C4\\u03C1\\u03C9\\u03C3\\u03B7 \\u03A4\\u03B9\\u03BC\\u03CE\\u03BD",noAggregation:"\\u039A\\u03B1\\u03BC\\u03AF\\u03B1",autosizeThisColumn:"\\u0391\\u03C5\\u03C4\\u03CC\\u03BC\\u03B1\\u03C4\\u03BF \\u039C\\u03AD\\u03B3\\u03B5\\u03B8\\u03BF\\u03C2 \\u0391\\u03C5\\u03C4\\u03AE\\u03C2 \\u03C4\\u03B7\\u03C2 \\u03A3\\u03C4\\u03AE\\u03BB\\u03B7\\u03C2",autosizeAllColumns:"\\u0391\\u03C5\\u03C4\\u03CC\\u03BC\\u03B1\\u03C4\\u03BF \\u039C\\u03AD\\u03B3\\u03B5\\u03B8\\u03BF\\u03C2 \\u038C\\u03BB\\u03C9\\u03BD \\u03C4\\u03C9\\u03BD \\u03A3\\u03C4\\u03B7\\u03BB\\u03CE\\u03BD",groupBy:"\\u039F\\u03BC\\u03B1\\u03B4\\u03BF\\u03C0\\u03BF\\u03AF\\u03B7\\u03C3\\u03B7 \\u03BA\\u03B1\\u03C4\\u03AC",ungroupBy:"\\u0394\\u03B9\\u03B1\\u03BA\\u03BF\\u03C0\\u03AE \\u039F\\u03BC\\u03B1\\u03B4\\u03BF\\u03C0\\u03BF\\u03AF\\u03B7\\u03C3\\u03B7\\u03C2';
      S = S + ' \\u03BA\\u03B1\\u03C4\\u03AC",ungroupAll:"\\u0394\\u03B9\\u03B1\\u03BA\\u03BF\\u03C0\\u03AE \\u039F\\u03BC\\u03B1\\u03B4\\u03BF\\u03C0\\u03BF\\u03AF\\u03B7\\u03C3\\u03B7\\u03C2 \\u038C\\u03BB\\u03C9\\u03BD",addToValues:"\\u03A0\\u03C1\\u03BF\\u03C3\\u03B8\\u03AE\\u03BA\\u03B7 ${variable} \\u03C3\\u03C4\\u03B9\\u03C2 \\u03C4\\u03B9\\u03BC\\u03AD\\u03C2",removeFromValues:"\\u0391\\u03C6\\u03B1\\u03AF\\u03C1\\u03B5\\u03C3\\u03B7 ${variable} \\u03B1\\u03C0\\u03CC \\u03C4\\u03B9\\u03C2 \\u03C4\\u03B9\\u03BC\\u03AD\\u03C2",addToLabels:"\\u03A0\\u03C1\\u03BF\\u03C3\\u03B8\\u03AE\\u03BA\\u03B7 ${variable} \\u03C3\\u03C4\\u03B9\\u03C2 \\u03B5\\u03C4\\u03B9\\u03BA\\u03AD\\u03C4\\u03B5\\u03C2",removeFromLabels:"\\u0391\\u03C6\\u03B1\\u03AF\\u03C1\\u03B5\\u03C3\\u03B7 ${variable} \\u03B1\\u03C0\\u03CC \\u03C4\\u03B9\\u03C2 \\u03B5\\u03C4\\u03B9\\u03BA\\u03AD\\u03C4\\u03B5\\u03C2",resetColumns:"\\u0395\\u03C0\\u03B1\\u03BD\\u03B1\\u03C6\\u03BF\\u03C1\\u03AC \\u03A3\\u03C4\\u03B7\\u03BB\\u03CE\\u03BD",expandAll:"\\u0395\\u03C0\\u03AD\\u03BA\\u03C4\\u03B1\\u03C3\\u03B7 \\u038C\\u03BB\\u03C9\\u03BD \\u03C4\\u03C9\\u03BD \\u039F\\u03BC\\u03AC\\u03B4\\u03C9\\u03BD \\u0393\\u03C1\\u03B1\\u03BC\\u03BC\\u03CE\\u03BD",collapseAll:"\\u039A\\u03BB\\u03B5\\u03AF\\u03C3\\u03B9\\u03BC\\u03BF \\u038C\\u03BB\\u03C9\\u03BD \\u03C4\\u03C9\\u03BD \\u039F\\u03BC\\u03AC\\u03B4\\u03C9\\u03BD \\u0393\\u03C1\\u03B1\\u03BC\\u03BC\\u03CE\\u03BD",copy:"\\u0391\\u03BD\\u03C4\\u03B9\\u03B3\\u03C1\\u03B1\\u03C6\\u03AE",ctrlC:"Ctrl+C",ctrlX:"Ctrl+X",copyWithHeaders:"\\u0391\\u03BD\\u03C4\\u03B9\\u03B3\\u03C1\\u03B1\\u03C6\\u03AE \\u03BC\\u03B5 \\u039A\\u03B5\\u03C6\\u03B1\\u03BB\\u03AF\\u03B4\\u03B5\\u03C2",copyWithGroupHeaders:"\\u0391\\u03BD\\u03C4\\u03B9\\u03B3\\u03C1\\u03B1\\u03C6\\u03AE \\u03BC\\u03B5 \\u039F\\u03BC\\u03B1\\u03B4\\u03B9\\u03BA\\u03AD\\u03C2 \\u039A\\u03B5\\u03C6\\u03B1\\u03BB\\u03AF\\u03B4\\u03B5\\u03C2",cut:"\\u0391\\u03C0\\u03BF\\u03BA\\u03BF\\u03C0\\u03AE",paste:"\\u0395\\u03C0\\u03B9\\u03BA\\u03CC\\u03BB\\u03BB\\u03B7\\u03C3\\u03B7",ctrlV:"Ctrl+V",export:"\\u0395\\u03BE\\u03B1\\u03B3\\u03C9\\u03B3\\u03AE",csvExport:"\\u0395\\u03BE\\u03B1\\u03B3\\u03C9\\u03B3\\u03AE \\u03C3\\u03B5 CSV",excelExport:"\\u0395\\u03BE\\u03B1\\u03B3\\u03C9\\u03B3\\u03AE \\u0';
      S = S + '3C3\\u03B5 Excel",columnFilter:"\\u03A6\\u03AF\\u03BB\\u03C4\\u03C1\\u03BF \\u03A3\\u03C4\\u03B7\\u03BB\\u03CE\\u03BD",columnChooser:"\\u0395\\u03C0\\u03B9\\u03BB\\u03BF\\u03B3\\u03AE \\u03A3\\u03C4\\u03B7\\u03BB\\u03CE\\u03BD",sortAscending:"\\u0395\\u03C0\\u03B9\\u03BB\\u03BF\\u03B3\\u03AE \\u0391\\u03CD\\u03BE\\u03BF\\u03C5\\u03C3\\u03B1\\u03C2 \\u03A4\\u03B1\\u03BE\\u03B9\\u03BD\\u03CC\\u03BC\\u03B7\\u03C3\\u03B7\\u03C2",sortDescending:"\\u0395\\u03C0\\u03B9\\u03BB\\u03BF\\u03B3\\u03AE \\u03A6\\u03B8\\u03AF\\u03BD\\u03BF\\u03C5\\u03C3\\u03B1\\u03C2 \\u03A4\\u03B1\\u03BE\\u03B9\\u03BD\\u03CC\\u03BC\\u03B7\\u03C3\\u03B7\\u03C2",sortUnSort:"\\u039A\\u03B1\\u03B8\\u03B1\\u03C1\\u03B9\\u03C3\\u03BC\\u03CC\\u03C2 \\u03A4\\u03B1\\u03BE\\u03B9\\u03BD\\u03CC\\u03BC\\u03B7\\u03C3\\u03B7\\u03C2",sum:"\\u0386\\u03B8\\u03C1\\u03BF\\u03B9\\u03C3\\u03BC\\u03B1",first:"\\u03A0\\u03C1\\u03CE\\u03C4\\u03BF",last:"\\u03A4\\u03B5\\u03BB\\u03B5\\u03C5\\u03C4\\u03B1\\u03AF\\u03BF",min:"\\u0395\\u03BB\\u03AC\\u03C7.",max:"\\u039C\\u03AD\\u03B3.",none:"\\u039A\\u03B1\\u03BD\\u03AD\\u03BD\\u03B1",count:"\\u0391\\u03C1\\u03B9\\u03B8\\u03BC\\u03CC\\u03C2",avg:"\\u039C\\u03AD\\u03C3\\u03BF\\u03C2 \\u038C\\u03C1\\u03BF\\u03C2",filteredRows:"\\u03A6\\u03B9\\u03BB\\u03C4\\u03C1\\u03AC\\u03C1\\u03B9\\u03C3\\u03BC\\u03B1",selectedRows:"\\u0395\\u03C0\\u03B9\\u03BB\\u03B5\\u03B3\\u03BC\\u03AD\\u03BD\\u03B5\\u03C2",totalRows:"\\u03A3\\u03C5\\u03BD\\u03BF\\u03BB\\u03B9\\u03BA\\u03AD\\u03C2 \\u0393\\u03C1\\u03B1\\u03BC\\u03BC\\u03AD\\u03C2",totalAndFilteredRows:"\\u0393\\u03C1\\u03B1\\u03BC\\u03BC\\u03AD\\u03C2",more:"\\u03A0\\u03B5\\u03C1\\u03B9\\u03C3\\u03C3\\u03CC\\u03C4\\u03B5\\u03C1\\u03B1",to:"\\u03AD\\u03C9\\u03C2",of:"\\u03B1\\u03C0\\u03CC",page:"\\u03A3\\u03B5\\u03BB\\u03AF\\u03B4\\u03B1",pageLastRowUnknown:"?",nextPage:"\\u0395\\u03C0\\u03CC\\u03BC\\u03B5\\u03BD\\u03B7 \\u03A3\\u03B5\\u03BB\\u03AF\\u03B4\\u03B1",lastPage:"\\u03A4\\u03B5\\u03BB\\u03B5\\u03C5\\u03C4\\u03B1\\u03AF\\u03B1 \\u03A3\\u03B5\\u03BB\\u03AF\\u03B4\\u03B1",firstPage:"\\u03A0\\u03C1\\u03CE\\u03C4\\u03B7 \\u03A3\\u03B5\\u03BB\\u03AF\\u03B4\\u03B1",previousPage:"\\u03A0\\u03C1\\u03BF\\u03B7\\u03B3\\u03BF\\u03CD\\u03BC\\u03B5\\u03BD\\u03B7 \\u03A3\\u03B5\\u03BB\\u03AF\\u03B4\\u03B1",pageSiz';
      S = S + 'eSelectorLabel:"\\u039C\\u03AD\\u03B3\\u03B5\\u03B8\\u03BF\\u03C2 \\u03A3\\u03B5\\u03BB\\u03AF\\u03B4\\u03B1\\u03C2:",footerTotal:"\\u03A3\\u03CD\\u03BD\\u03BF\\u03BB\\u03BF",pivotColumnGroupTotals:"\\u03A3\\u03CD\\u03BD\\u03BF\\u03BB\\u03BF",pivotChartAndPivotMode:"\\u0393\\u03C1\\u03AC\\u03C6\\u03B7\\u03BC\\u03B1 \\u03A0\\u03B5\\u03C1\\u03B9\\u03C3\\u03C4\\u03C1\\u03BF\\u03C6\\u03AE\\u03C2 & \\u039B\\u03B5\\u03B9\\u03C4\\u03BF\\u03C5\\u03C1\\u03B3\\u03AF\\u03B1 \\u03A0\\u03B5\\u03C1\\u03B9\\u03C3\\u03C4\\u03C1\\u03BF\\u03C6\\u03AE\\u03C2",pivotChart:"\\u0393\\u03C1\\u03AC\\u03C6\\u03B7\\u03BC\\u03B1 \\u03A0\\u03B5\\u03C1\\u03B9\\u03C3\\u03C4\\u03C1\\u03BF\\u03C6\\u03AE\\u03C2",chartRange:"\\u0395\\u03CD\\u03C1\\u03BF\\u03C2 \\u0393\\u03C1\\u03B1\\u03C6\\u03AE\\u03BC\\u03B1\\u03C4\\u03BF\\u03C2",columnChart:"\\u03A3\\u03C4\\u03AE\\u03BB\\u03B7",groupedColumn:"\\u039F\\u03BC\\u03B1\\u03B4\\u03BF\\u03C0\\u03BF\\u03B9\\u03B7\\u03BC\\u03AD\\u03BD\\u03B7",stackedColumn:"\\u03A3\\u03C9\\u03C1\\u03B5\\u03C5\\u03C4\\u03B9\\u03BA\\u03AE",normalizedColumn:"100% \\u03A3\\u03C9\\u03C1\\u03B5\\u03C5\\u03C4\\u03B9\\u03BA\\u03AE",barChart:"\\u03A1\\u03AC\\u03B2\\u03B4\\u03BF\\u03C2",groupedBar:"\\u039F\\u03BC\\u03B1\\u03B4\\u03BF\\u03C0\\u03BF\\u03B9\\u03B7\\u03BC\\u03AD\\u03BD\\u03B7",stackedBar:"\\u03A3\\u03C9\\u03C1\\u03B5\\u03C5\\u03C4\\u03B9\\u03BA\\u03AE",normalizedBar:"100% \\u03A3\\u03C9\\u03C1\\u03B5\\u03C5\\u03C4\\u03B9\\u03BA\\u03AE",pieChart:"\\u03A0\\u03AF\\u03C4\\u03B1",pie:"\\u03A0\\u03AF\\u03C4\\u03B1",donut:"\\u039D\\u03C4\\u03CC\\u03BD\\u03B1\\u03C4",line:"\\u0393\\u03C1\\u03B1\\u03BC\\u03BC\\u03AE",xyChart:"X Y (Scatter)",scatter:"\\u0394\\u03B9\\u03B1\\u03C3\\u03C0\\u03BF\\u03C1\\u03AC",bubble:"\\u03A6\\u03BF\\u03CD\\u03C3\\u03BA\\u03B1",areaChart:"\\u03A0\\u03B5\\u03C1\\u03B9\\u03BF\\u03C7\\u03AE",area:"\\u03A0\\u03B5\\u03C1\\u03B9\\u03BF\\u03C7\\u03AE",stackedArea:"\\u03A3\\u03C9\\u03C1\\u03B5\\u03C5\\u03C4\\u03B9\\u03BA\\u03AE",normalizedArea:"100% \\u03A3\\u03C9\\u03C1\\u03B5\\u03C5\\u03C4\\u03B9\\u03BA\\u03AE",histogramChart:"\\u0399\\u03C3\\u03C4\\u03CC\\u03B3\\u03C1\\u03B1\\u03BC\\u03BC\\u03B1",polarChart:"\\u03A0\\u03BF\\u03BB\\u03B9\\u03BA\\u03CC",radarLine:"Radar \\u0393\\u03C1\\u03B1\\u03BC\\u03BC\\u03A';
      S = S + 'E\\u03C2",radarArea:"Radar \\u03A0\\u03B5\\u03C1\\u03B9\\u03BF\\u03C7\\u03AE\\u03C2",nightingale:"Nightingale",radialColumn:"\\u0391\\u03BA\\u03C4\\u03B9\\u03BD\\u03C9\\u03C4\\u03AE \\u03A3\\u03C4\\u03AE\\u03BB\\u03B7",radialBar:"\\u0391\\u03BA\\u03C4\\u03B9\\u03BD\\u03C9\\u03C4\\u03AE \\u03A1\\u03AC\\u03B2\\u03B4\\u03BF\\u03C2",statisticalChart:"\\u03A3\\u03C4\\u03B1\\u03C4\\u03B9\\u03C3\\u03C4\\u03B9\\u03BA\\u03CC",boxPlot:"\\u0394\\u03B9\\u03AC\\u03B3\\u03C1\\u03B1\\u03BC\\u03BC\\u03B1 \\u039A\\u03BF\\u03C5\\u03C4\\u03B9\\u03BF\\u03CD",rangeBar:"\\u03A1\\u03AC\\u03B2\\u03B4\\u03BF\\u03C2 \\u0395\\u03CD\\u03C1\\u03BF\\u03C5\\u03C2",rangeArea:"\\u03A0\\u03B5\\u03C1\\u03B9\\u03BF\\u03C7\\u03AE \\u0395\\u03CD\\u03C1\\u03BF\\u03C5\\u03C2",hierarchicalChart:"\\u0399\\u03B5\\u03C1\\u03B1\\u03C1\\u03C7\\u03B9\\u03BA\\u03CC",treemap:"\\u03A7\\u03AC\\u03C1\\u03C4\\u03B7\\u03C2 \\u0394\\u03AD\\u03BD\\u03C4\\u03C1\\u03BF\\u03C5",sunburst:"\\u0389\\u03BB\\u03B9\\u03BF\\u03C2",specializedChart:"\\u0395\\u03BE\\u03B5\\u03B9\\u03B4\\u03B9\\u03BA\\u03B5\\u03C5\\u03BC\\u03AD\\u03BD\\u03BF",waterfall:"\\u039A\\u03B1\\u03C4\\u03B1\\u03C1\\u03C1\\u03AC\\u03BA\\u03C4\\u03B7\\u03C2",heatmap:"\\u0398\\u03B5\\u03C1\\u03BC\\u03B9\\u03BA\\u03CC\\u03C2 \\u03A7\\u03AC\\u03C1\\u03C4\\u03B7\\u03C2",combinationChart:"\\u03A3\\u03C5\\u03BD\\u03B4\\u03C5\\u03B1\\u03C3\\u03BC\\u03AD\\u03BD\\u03BF",columnLineCombo:"\\u03A3\\u03C4\\u03AE\\u03BB\\u03B7 \\u03BA\\u03B1\\u03B9 \\u0393\\u03C1\\u03B1\\u03BC\\u03BC\\u03AE",AreaColumnCombo:"\\u03A0\\u03B5\\u03C1\\u03B9\\u03BF\\u03C7\\u03AE & \\u03A3\\u03C4\\u03AE\\u03BB\\u03B7",pivotChartTitle:"\\u03A3\\u03C5\\u03B3\\u03BA\\u03B5\\u03BD\\u03C4\\u03C1\\u03C9\\u03C4\\u03B9\\u03BA\\u03CC \\u0393\\u03C1\\u03AC\\u03C6\\u03B7\\u03BC\\u03B1",rangeChartTitle:"\\u0393\\u03C1\\u03AC\\u03C6\\u03B7\\u03BC\\u03B1 \\u0395\\u03CD\\u03C1\\u03BF\\u03C5\\u03C2",settings:"\\u0393\\u03C1\\u03AC\\u03C6\\u03B7\\u03BC\\u03B1",data:"\\u03A1\\u03CD\\u03B8\\u03BC\\u03B9\\u03C3\\u03B7",format:"\\u0395\\u03BE\\u03B1\\u03C4\\u03BF\\u03BC\\u03AF\\u03BA\\u03B5\\u03C5\\u03C3\\u03B7",categories:"\\u039A\\u03B1\\u03C4\\u03B7\\u03B3\\u03BF\\u03C1\\u03AF\\u03B5\\u03C2",defaultCategory:"(\\u039A\\u03B1\\u03BC\\u03AF\\u03B1)",series:"\\u03A3\\u03B5\\u03B9';
      S = S + '\\u03C1\\u03AD\\u03C2",switchCategorySeries:"\\u0391\\u03BB\\u03BB\\u03B1\\u03B3\\u03AE \\u039A\\u03B1\\u03C4\\u03B7\\u03B3\\u03BF\\u03C1\\u03AF\\u03B1\\u03C2 / \\u03A3\\u03B5\\u03B9\\u03C1\\u03AC\\u03C2",categoryValues:"\\u03A4\\u03B9\\u03BC\\u03AD\\u03C2 \\u039A\\u03B1\\u03C4\\u03B7\\u03B3\\u03BF\\u03C1\\u03AF\\u03B1\\u03C2",seriesLabels:"\\u0395\\u03C4\\u03B9\\u03BA\\u03AD\\u03C4\\u03B5\\u03C2 \\u03A3\\u03B5\\u03B9\\u03C1\\u03CE\\u03BD",aggregate:"\\u03A3\\u03C5\\u03B3\\u03BA\\u03B5\\u03BD\\u03C4\\u03C1\\u03C9\\u03C4\\u03B9\\u03BA\\u03AC",xyValues:"\\u03A4\\u03B9\\u03BC\\u03AD\\u03C2 \\u03A7 \\u03A5",paired:"\\u03A3\\u03C5\\u03BD\\u03B4\\u03C5\\u03B1\\u03C3\\u03BC\\u03AD\\u03BD\\u03B7 \\u039B\\u03B5\\u03B9\\u03C4\\u03BF\\u03C5\\u03C1\\u03B3\\u03AF\\u03B1",axis:"\\u0386\\u03BE\\u03BF\\u03BD\\u03B1\\u03C2",xAxis:"\\u039F\\u03C1\\u03B9\\u03B6\\u03CC\\u03BD\\u03C4\\u03B9\\u03BF\\u03C2 \\u0386\\u03BE\\u03BF\\u03BD\\u03B1\\u03C2",yAxis:"\\u039A\\u03B1\\u03C4\\u03B1\\u03BA\\u03CC\\u03C1\\u03C5\\u03C6\\u03BF\\u03C2 \\u0386\\u03BE\\u03BF\\u03BD\\u03B1\\u03C2",polarAxis:"\\u03A0\\u03BF\\u03BB\\u03B9\\u03BA\\u03CC\\u03C2 \\u0386\\u03BE\\u03BF\\u03BD\\u03B1\\u03C2",radiusAxis:"\\u0386\\u03BE\\u03BF\\u03BD\\u03B1\\u03C2 \\u0391\\u03BA\\u03C4\\u03AF\\u03BD\\u03B1\\u03C2",navigator:"\\u03A0\\u03BB\\u03BF\\u03B7\\u03B3\\u03CC\\u03C2",zoom:"\\u039C\\u03B5\\u03B3\\u03AD\\u03B8\\u03C5\\u03BD\\u03C3\\u03B7",animation:"\\u039A\\u03B9\\u03BD\\u03BF\\u03CD\\u03BC\\u03B5\\u03BD\\u03B1 \\u0393\\u03C1\\u03B1\\u03C6\\u03B9\\u03BA\\u03AC",crosshair:"\\u0394\\u03B9\\u03C7\\u03CE\\u03C2",color:"\\u03A7\\u03C1\\u03CE\\u03BC\\u03B1",thickness:"\\u03A0\\u03AC\\u03C7\\u03BF\\u03C2",preferredLength:"\\u03A0\\u03C1\\u03BF\\u03C4\\u03B9\\u03BC\\u03CE\\u03BC\\u03B5\\u03BD\\u03BF \\u039C\\u03AE\\u03BA\\u03BF\\u03C2",xType:"\\u03A4\\u03CD\\u03C0\\u03BF\\u03C2 \\u03A7",axisType:"\\u03A4\\u03CD\\u03C0\\u03BF\\u03C2 \\u0386\\u03BE\\u03BF\\u03BD\\u03B1",automatic:"\\u0391\\u03C5\\u03C4\\u03CC\\u03BC\\u03B1\\u03C4\\u03BF",category:"\\u039A\\u03B1\\u03C4\\u03B7\\u03B3\\u03BF\\u03C1\\u03AF\\u03B1",number:"\\u0391\\u03C1\\u03B9\\u03B8\\u03BC\\u03CC\\u03C2",time:"\\u03A7\\u03C1\\u03CC\\u03BD\\u03BF\\u03C2",timeFormat:"\\u039C\\u03BF\\u03C1\\u03C6\\u03AE \\u03A7\\u03C1\\u03CC\\u03BD\\u';
      S = S + '03BF\\u03C5",autoRotate:"\\u0391\\u03C5\\u03C4\\u03CC\\u03BC\\u03B1\\u03C4\\u03B7 \\u03A0\\u03B5\\u03C1\\u03B9\\u03C3\\u03C4\\u03C1\\u03BF\\u03C6\\u03AE",labelRotation:"\\u03A0\\u03B5\\u03C1\\u03B9\\u03C3\\u03C4\\u03C1\\u03BF\\u03C6\\u03AE",circle:"\\u039A\\u03CD\\u03BA\\u03BB\\u03BF\\u03C2",polygon:"\\u03A0\\u03BF\\u03BB\\u03CD\\u03B3\\u03C9\\u03BD\\u03BF",square:"\\u03A4\\u03B5\\u03C4\\u03C1\\u03AC\\u03B3\\u03C9\\u03BD\\u03BF",cross:"\\u03A3\\u03C4\\u03B1\\u03C5\\u03C1\\u03CC\\u03C2",diamond:"\\u0394\\u03B9\\u03B1\\u03BC\\u03AC\\u03BD\\u03C4\\u03B9",plus:"\\u03A3\\u03C5\\u03BD",triangle:"\\u03A4\\u03C1\\u03AF\\u03B3\\u03C9\\u03BD\\u03BF",heart:"\\u039A\\u03B1\\u03C1\\u03B4\\u03B9\\u03AC",orientation:"\\u03A0\\u03C1\\u03BF\\u03C3\\u03B1\\u03BD\\u03B1\\u03C4\\u03BF\\u03BB\\u03B9\\u03C3\\u03BC\\u03CC\\u03C2",fixed:"\\u03A3\\u03C4\\u03B1\\u03B8\\u03B5\\u03C1\\u03CC",parallel:"\\u03A0\\u03B1\\u03C1\\u03AC\\u03BB\\u03BB\\u03B7\\u03BB\\u03BF",perpendicular:"\\u039A\\u03B1\\u03C4\\u03B1\\u03BA\\u03CC\\u03C1\\u03C5\\u03C6\\u03BF",radiusAxisPosition:"\\u0398\\u03AD\\u03C3\\u03B7",ticks:"\\u03A4\\u03B9\\u03BA",gridLines:"\\u0393\\u03C1\\u03B1\\u03BC\\u03BC\\u03AD\\u03C2 \\u03A0\\u03BB\\u03AD\\u03B3\\u03BC\\u03B1\\u03C4\\u03BF\\u03C2",width:"\\u03A0\\u03BB\\u03AC\\u03C4\\u03BF\\u03C2",height:"\\u038E\\u03C8\\u03BF\\u03C2",length:"\\u039C\\u03AE\\u03BA\\u03BF\\u03C2",padding:"\\u0395\\u03C3\\u03BF\\u03C7\\u03AE",spacing:"\\u0394\\u03B9\\u03AC\\u03BA\\u03B5\\u03BD\\u03BF",chartStyle:"\\u03A3\\u03C4\\u03C5\\u03BB \\u0393\\u03C1\\u03B1\\u03C6\\u03AE\\u03BC\\u03B1\\u03C4\\u03BF\\u03C2",title:"\\u03A4\\u03AF\\u03C4\\u03BB\\u03BF\\u03C2",chartTitles:"\\u03A4\\u03AF\\u03C4\\u03BB\\u03BF\\u03B9",chartTitle:"\\u03A4\\u03AF\\u03C4\\u03BB\\u03BF\\u03C2 \\u0393\\u03C1\\u03B1\\u03C6\\u03AE\\u03BC\\u03B1\\u03C4\\u03BF\\u03C2",chartSubtitle:"\\u03A5\\u03C0\\u03CC\\u03C4\\u03B9\\u03C4\\u03BB\\u03BF\\u03C2",horizontalAxisTitle:"\\u03A4\\u03AF\\u03C4\\u03BB\\u03BF\\u03C2 \\u039F\\u03C1\\u03B9\\u03B6\\u03CC\\u03BD\\u03C4\\u03B9\\u03BF\\u03C5 \\u0386\\u03BE\\u03BF\\u03BD\\u03B1",verticalAxisTitle:"\\u03A4\\u03AF\\u03C4\\u03BB\\u03BF\\u03C2 \\u039A\\u03B1\\u03C4\\u03B1\\u03BA\\u03CC\\u03C1\\u03C5\\u03C6\\u03BF\\u03C5 \\u0386\\u03BE\\u03BF\\u03BD\\u03B1",polarA';
      S = S + 'xisTitle:"\\u03A4\\u03AF\\u03C4\\u03BB\\u03BF\\u03C2 \\u03A0\\u03BF\\u03BB\\u03B9\\u03BA\\u03BF\\u03CD \\u0386\\u03BE\\u03BF\\u03BD\\u03B1",titlePlaceholder:"\\u03A4\\u03AF\\u03C4\\u03BB\\u03BF\\u03C2 \\u0393\\u03C1\\u03B1\\u03C6\\u03AE\\u03BC\\u03B1\\u03C4\\u03BF\\u03C2",background:"\\u0399\\u03C3\\u03C4\\u03BF\\u03C1\\u03B9\\u03BA\\u03CC",font:"\\u0393\\u03C1\\u03B1\\u03BC\\u03BC\\u03B1\\u03C4\\u03BF\\u03C3\\u03B5\\u03B9\\u03C1\\u03AC",weight:"\\u0392\\u03AC\\u03C1\\u03BF\\u03C2",top:"\\u03A0\\u03AC\\u03BD\\u03C9",right:"\\u0394\\u03B5\\u03BE\\u03B9\\u03AC",bottom:"\\u039A\\u03AC\\u03C4\\u03C9",left:"\\u0391\\u03C1\\u03B9\\u03C3\\u03C4\\u03B5\\u03C1\\u03AC",labels:"\\u0395\\u03C4\\u03B9\\u03BA\\u03AD\\u03C4\\u03B5\\u03C2",calloutLabels:"\\u0395\\u03C4\\u03B9\\u03BA\\u03AD\\u03C4\\u03B5\\u03C2 \\u039A\\u03BB\\u03AE\\u03C3\\u03B7\\u03C2",sectorLabels:"\\u0395\\u03C4\\u03B9\\u03BA\\u03AD\\u03C4\\u03B5\\u03C2 \\u03A4\\u03BF\\u03BC\\u03AD\\u03C9\\u03BD",positionRatio:"\\u0391\\u03BD\\u03B1\\u03BB\\u03BF\\u03B3\\u03AF\\u03B1 \\u0398\\u03AD\\u03C3\\u03B7\\u03C2",size:"\\u039C\\u03AD\\u03B3\\u03B5\\u03B8\\u03BF\\u03C2",shape:"\\u03A3\\u03C7\\u03AE\\u03BC\\u03B1",minSize:"\\u0395\\u03BB\\u03AC\\u03C7\\u03B9\\u03C3\\u03C4\\u03BF \\u039C\\u03AD\\u03B3\\u03B5\\u03B8\\u03BF\\u03C2",maxSize:"\\u039C\\u03AD\\u03B3\\u03B9\\u03C3\\u03C4\\u03BF \\u039C\\u03AD\\u03B3\\u03B5\\u03B8\\u03BF\\u03C2",legend:"\\u03A5\\u03C0\\u03CC\\u03BC\\u03BD\\u03B7\\u03BC\\u03B1",position:"\\u0398\\u03AD\\u03C3\\u03B7",markerSize:"\\u039C\\u03AD\\u03B3\\u03B5\\u03B8\\u03BF\\u03C2 \\u0394\\u03B5\\u03AF\\u03BA\\u03C4\\u03B7",markerStroke:"\\u0392\\u03AC\\u03C1\\u03BF\\u03C2 \\u0394\\u03B5\\u03AF\\u03BA\\u03C4\\u03B7",markerPadding:"\\u039F\\u03BB\\u03BF\\u03BA\\u03BB\\u03B7\\u03C1\\u03C9\\u03C4\\u03B9\\u03BA\\u03AE \\u0395\\u03C3\\u03BF\\u03C7\\u03AE",itemSpacing:"\\u0394\\u03B9\\u03AC\\u03BA\\u03B5\\u03BD\\u03BF \\u03A3\\u03C4\\u03BF\\u03B9\\u03C7\\u03B5\\u03AF\\u03BF\\u03C5",itemPaddingX:"\\u0395\\u03C3\\u03BF\\u03C7\\u03AE \\u03A3\\u03C4\\u03BF\\u03B9\\u03C7\\u03B5\\u03AF\\u03BF\\u03C5 X",itemPaddingY:"\\u0395\\u03C3\\u03BF\\u03C7\\u03AE \\u03A3\\u03C4\\u03BF\\u03B9\\u03C7\\u03B5\\u03AF\\u03BF\\u03C5 Y",layoutHorizontalSpacing:"\\u039F\\u03C1\\u03B9\\u03B6\\u03CC\\u03BD';
      S = S + '\\u03C4\\u03B9\\u03BF \\u0394\\u03B9\\u03AC\\u03BA\\u03B5\\u03BD\\u03BF",layoutVerticalSpacing:"\\u039A\\u03B1\\u03C4\\u03B1\\u03BA\\u03CC\\u03C1\\u03C5\\u03C6\\u03BF \\u0394\\u03B9\\u03AC\\u03BA\\u03B5\\u03BD\\u03BF",strokeWidth:"\\u03A0\\u03AC\\u03C7\\u03BF\\u03C2 \\u0393\\u03C1\\u03B1\\u03BC\\u03BC\\u03AE\\u03C2",offset:"\\u039C\\u03B5\\u03C4\\u03B1\\u03C4\\u03CC\\u03C0\\u03B9\\u03C3\\u03B7",offsets:"\\u039C\\u03B5\\u03C4\\u03B1\\u03C4\\u03BF\\u03C0\\u03AF\\u03C3\\u03B5\\u03B9\\u03C2",tooltips:"\\u03A5\\u03C0\\u03BF\\u03B4\\u03B5\\u03AF\\u03BE\\u03B5\\u03B9\\u03C2",callout:"\\u039A\\u03BB\\u03AE\\u03C3\\u03B7",markers:"\\u0394\\u03B5\\u03AF\\u03BA\\u03C4\\u03B5\\u03C2",shadow:"\\u03A3\\u03BA\\u03B9\\u03AC",blur:"\\u0398\\u03AC\\u03BC\\u03C0\\u03C9\\u03BC\\u03B1",xOffset:"\\u039C\\u03B5\\u03C4\\u03B1\\u03C4\\u03CC\\u03C0\\u03B9\\u03C3\\u03B7 \\u03A7",yOffset:"\\u039C\\u03B5\\u03C4\\u03B1\\u03C4\\u03CC\\u03C0\\u03B9\\u03C3\\u03B7 \\u03A5",lineWidth:"\\u03A0\\u03AC\\u03C7\\u03BF\\u03C2 \\u0393\\u03C1\\u03B1\\u03BC\\u03BC\\u03AE\\u03C2",lineDash:"\\u03A0\\u03B1\\u03CD\\u03BB\\u03B1 \\u0393\\u03C1\\u03B1\\u03BC\\u03BC\\u03AE\\u03C2",lineDashOffset:"\\u039C\\u03B5\\u03C4\\u03B1\\u03C4\\u03CC\\u03C0\\u03B9\\u03C3\\u03B7 \\u03A0\\u03B1\\u03C5\\u03BB\\u03B1\\u03C2",scrollingZoom:"\\u039A\\u03CD\\u03BB\\u03B9\\u03C3\\u03B7",scrollingStep:"\\u0392\\u03AE\\u03BC\\u03B1 \\u039A\\u03CD\\u03BB\\u03B9\\u03C3\\u03B7\\u03C2",selectingZoom:"\\u0395\\u03C0\\u03B9\\u03BB\\u03BF\\u03B3\\u03AE",durationMillis:"\\u0394\\u03B9\\u03AC\\u03C1\\u03BA\\u03B5\\u03B9\\u03B1 (\\u03BC\\u03C3)",crosshairLabel:"\\u0395\\u03C4\\u03B9\\u03BA\\u03AD\\u03C4\\u03B1",crosshairSnap:"\\u03A3\\u03C5\\u03BB\\u03BB\\u03AE\\u03C8\\u03C4\\u03B5 \\u03C4\\u03BF\\u03BD \\u039A\\u03CC\\u03BC\\u03B2\\u03BF",normal:"\\u039A\\u03B1\\u03BD\\u03BF\\u03BD\\u03B9\\u03BA\\u03CC",bold:"\\u0388\\u03BD\\u03C4\\u03BF\\u03BD\\u03BF",italic:"\\u03A0\\u03BB\\u03AC\\u03B3\\u03B9\\u03BF",boldItalic:"\\u0388\\u03BD\\u03C4\\u03BF\\u03BD\\u03BF \\u03A0\\u03BB\\u03AC\\u03B3\\u03B9\\u03BF",predefined:"\\u03A0\\u03C1\\u03BF\\u03BA\\u03B1\\u03B8\\u03BF\\u03C1\\u03B9\\u03C3\\u03BC\\u03AD\\u03BD\\u03BF",fillOpacity:"\\u0391\\u03B4\\u03B9\\u03B1\\u03C6\\u03AC\\u03BD\\u03B5\\u03B9\\u03B1 \\u03A3\\u03C5\\u03B';
      S = S + 'C\\u03C0\\u03BB\\u03AE\\u03C1\\u03C9\\u03C3\\u03B7\\u03C2",strokeColor:"\\u03A7\\u03C1\\u03CE\\u03BC\\u03B1 \\u0393\\u03C1\\u03B1\\u03BC\\u03BC\\u03AE\\u03C2",strokeOpacity:"\\u0391\\u03B4\\u03B9\\u03B1\\u03C6\\u03AC\\u03BD\\u03B5\\u03B9\\u03B1 \\u0393\\u03C1\\u03B1\\u03BC\\u03BC\\u03AE\\u03C2",miniChart:"\\u039C\\u03AF\\u03BD\\u03B9-\\u0393\\u03C1\\u03AC\\u03C6\\u03B7\\u03BC\\u03B1",histogramBinCount:"\\u03A0\\u03BB\\u03AE\\u03B8\\u03BF\\u03C2 \\u039A\\u03AC\\u03B4\\u03C9\\u03BD",connectorLine:"\\u0393\\u03C1\\u03B1\\u03BC\\u03BC\\u03AE \\u03A3\\u03CD\\u03BD\\u03B4\\u03B5\\u03C3\\u03B7\\u03C2",seriesItems:"\\u03A3\\u03C4\\u03BF\\u03B9\\u03C7\\u03B5\\u03AF\\u03B1 \\u03A3\\u03B5\\u03B9\\u03C1\\u03CE\\u03BD",seriesItemType:"\\u03A4\\u03CD\\u03C0\\u03BF\\u03C2 \\u03A3\\u03C4\\u03BF\\u03B9\\u03C7\\u03B5\\u03AF\\u03BF\\u03C5",seriesItemPositive:"\\u0398\\u03B5\\u03C4\\u03B9\\u03BA\\u03CC",seriesItemNegative:"\\u0391\\u03C1\\u03BD\\u03B7\\u03C4\\u03B9\\u03BA\\u03CC",seriesItemLabels:"\\u0395\\u03C4\\u03B9\\u03BA\\u03AD\\u03C4\\u03B5\\u03C2 \\u03A3\\u03C4\\u03BF\\u03B9\\u03C7\\u03B5\\u03AF\\u03C9\\u03BD",columnGroup:"\\u039F\\u03BC\\u03AC\\u03B4\\u03B1 \\u03A3\\u03C4\\u03AE\\u03BB\\u03B7\\u03C2",barGroup:"\\u039F\\u03BC\\u03AC\\u03B4\\u03B1 \\u03A1\\u03B1\\u03B2\\u03B4\\u03BF\\u03B3\\u03C1\\u03AC\\u03C6\\u03B7\\u03BC\\u03B1",pieGroup:"\\u039F\\u03BC\\u03AC\\u03B4\\u03B1 \\u03A0\\u03AF\\u03C4\\u03B1\\u03C2",lineGroup:"\\u039F\\u03BC\\u03AC\\u03B4\\u03B1 \\u0393\\u03C1\\u03B1\\u03BC\\u03BC\\u03AE\\u03C2",scatterGroup:"\\u03A7 \\u03A5 (\\u03A3\\u03BA\\u03CC\\u03C1\\u03C0\\u03B9\\u03BF)",areaGroup:"\\u039F\\u03BC\\u03AC\\u03B4\\u03B1 \\u03A0\\u03B5\\u03C1\\u03B9\\u03BF\\u03C7\\u03AE\\u03C2",polarGroup:"\\u03A0\\u03BF\\u03BB\\u03B9\\u03BA\\u03AE \\u039F\\u03BC\\u03AC\\u03B4\\u03B1",statisticalGroup:"\\u03A3\\u03C4\\u03B1\\u03C4\\u03B9\\u03C3\\u03C4\\u03B9\\u03BA\\u03AE \\u039F\\u03BC\\u03AC\\u03B4\\u03B1",hierarchicalGroup:"\\u0399\\u03B5\\u03C1\\u03B1\\u03C1\\u03C7\\u03B9\\u03BA\\u03AE \\u039F\\u03BC\\u03AC\\u03B4\\u03B1",specializedGroup:"\\u0395\\u03B9\\u03B4\\u03B9\\u03BA\\u03B5\\u03C5\\u03BC\\u03AD\\u03BD\\u03B7 \\u039F\\u03BC\\u03AC\\u03B4\\u03B1",combinationGroup:"\\u03A3\\u03C5\\u03BD\\u03B4\\u03C5\\u03B1\\u03C3\\u03C4\\u03B9\\u03BA\\u';
      S = S + '03AE \\u039F\\u03BC\\u03AC\\u03B4\\u03B1",groupedColumnTooltip:"\\u039F\\u03BC\\u03B1\\u03B4\\u03BF\\u03C0\\u03BF\\u03B9\\u03B7\\u03BC\\u03AD\\u03BD\\u03BF",stackedColumnTooltip:"\\u03A3\\u03C4\\u03BF\\u03B9\\u03B2\\u03B1\\u03B3\\u03BC\\u03AD\\u03BD\\u03BF",normalizedColumnTooltip:"100% \\u03A3\\u03C4\\u03BF\\u03B9\\u03B2\\u03B1\\u03B3\\u03BC\\u03AD\\u03BD\\u03BF",groupedBarTooltip:"\\u039F\\u03BC\\u03B1\\u03B4\\u03BF\\u03C0\\u03BF\\u03B9\\u03B7\\u03BC\\u03AD\\u03BD\\u03BF",stackedBarTooltip:"\\u03A3\\u03C4\\u03BF\\u03B9\\u03B2\\u03B1\\u03B3\\u03BC\\u03AD\\u03BD\\u03BF",normalizedBarTooltip:"100% \\u03A3\\u03C4\\u03BF\\u03B9\\u03B2\\u03B1\\u03B3\\u03BC\\u03AD\\u03BD\\u03BF",pieTooltip:"\\u03A0\\u03AF\\u03C4\\u03B1",donutTooltip:"\\u039D\\u03C4\\u03CC\\u03BD\\u03B1\\u03C4",lineTooltip:"\\u0393\\u03C1\\u03B1\\u03BC\\u03BC\\u03AE",groupedAreaTooltip:"\\u03A0\\u03B5\\u03C1\\u03B9\\u03BF\\u03C7\\u03AE",stackedAreaTooltip:"\\u03A3\\u03C4\\u03BF\\u03B9\\u03B2\\u03B1\\u03B3\\u03BC\\u03AD\\u03BD\\u03B7",normalizedAreaTooltip:"100% \\u03A3\\u03C4\\u03BF\\u03B9\\u03B2\\u03B1\\u03B3\\u03BC\\u03AD\\u03BD\\u03B7",scatterTooltip:"\\u03A3\\u03BA\\u03CC\\u03C1\\u03C0\\u03B9\\u03BF",bubbleTooltip:"\\u03A6\\u03BF\\u03CD\\u03C3\\u03BA\\u03B1",histogramTooltip:"\\u0399\\u03C3\\u03C4\\u03CC\\u03B3\\u03C1\\u03B1\\u03BC\\u03BC\\u03B1",radialColumnTooltip:"\\u0391\\u03BA\\u03C4\\u03B9\\u03BD\\u03B9\\u03BA\\u03AE \\u03A3\\u03C4\\u03AE\\u03BB\\u03B7",radialBarTooltip:"\\u0391\\u03BA\\u03C4\\u03B9\\u03BD\\u03B9\\u03BA\\u03CC \\u03A1\\u03B1\\u03B2\\u03B4\\u03BF\\u03B3\\u03C1\\u03AC\\u03C6\\u03B7\\u03BC\\u03B1",radarLineTooltip:"\\u03A1\\u03B1\\u03BD\\u03C4\\u03AC\\u03C1 \\u0393\\u03C1\\u03B1\\u03BC\\u03BC\\u03AE",radarAreaTooltip:"\\u03A1\\u03B1\\u03BD\\u03C4\\u03AC\\u03C1 \\u03A0\\u03B5\\u03C1\\u03B9\\u03BF\\u03C7\\u03AE",nightingaleTooltip:"\\u0391\\u03B7\\u03B4\\u03CC\\u03BD\\u03B9",rangeBarTooltip:"\\u039C\\u03C0\\u03AC\\u03C1\\u03B1 \\u0395\\u03CD\\u03C1\\u03BF\\u03C5\\u03C2",rangeAreaTooltip:"\\u03A0\\u03B5\\u03C1\\u03B9\\u03BF\\u03C7\\u03AE \\u0395\\u03CD\\u03C1\\u03BF\\u03C5\\u03C2",boxPlotTooltip:"\\u039A\\u03BF\\u03C5\\u03C4\\u03AF \\u03A3\\u03C7\\u03B5\\u03B4\\u03AF\\u03BF\\u03C5",treemapTooltip:"\\u03A7\\u03AC\\u03C1\\u03C4\\';
      S = S + 'u03B7\\u03C2 \\u0394\\u03AD\\u03BD\\u03C4\\u03C1\\u03BF\\u03C5",sunburstTooltip:"\\u0397\\u03BB\\u03B9\\u03B1\\u03BA\\u03AE \\u0388\\u03BA\\u03BB\\u03B1\\u03BC\\u03C8\\u03B7",waterfallTooltip:"\\u039A\\u03B1\\u03C4\\u03B1\\u03C1\\u03C1\\u03AC\\u03BA\\u03C4\\u03B7\\u03C2",heatmapTooltip:"\\u03A7\\u03AC\\u03C1\\u03C4\\u03B7\\u03C2 \\u0398\\u03B5\\u03C1\\u03BC\\u03CC\\u03C4\\u03B7\\u03C4\\u03B1\\u03C2",columnLineComboTooltip:"\\u03A3\\u03C4\\u03AE\\u03BB\\u03B7 & \\u0393\\u03C1\\u03B1\\u03BC\\u03BC\\u03AE",areaColumnComboTooltip:"\\u03A0\\u03B5\\u03C1\\u03B9\\u03BF\\u03C7\\u03AE & \\u03A3\\u03C4\\u03AE\\u03BB\\u03B7",customComboTooltip:"\\u03A0\\u03C1\\u03BF\\u03C3\\u03B1\\u03C1\\u03BC\\u03BF\\u03C3\\u03BC\\u03AD\\u03BD\\u03BF\\u03C2 \\u03A3\\u03C5\\u03BD\\u03B4\\u03C5\\u03B1\\u03C3\\u03BC\\u03CC\\u03C2",innerRadius:"\\u0395\\u03C3\\u03C9\\u03C4\\u03B5\\u03C1\\u03B9\\u03BA\\u03AE \\u0391\\u03BA\\u03C4\\u03AF\\u03BD\\u03B1",startAngle:"\\u0393\\u03C9\\u03BD\\u03AF\\u03B1 \\u0395\\u03BA\\u03BA\\u03AF\\u03BD\\u03B7\\u03C3\\u03B7\\u03C2",endAngle:"\\u03A4\\u03B5\\u03BB\\u03B9\\u03BA\\u03AE \\u0393\\u03C9\\u03BD\\u03AF\\u03B1",reverseDirection:"\\u0391\\u03BD\\u03C4\\u03AF\\u03B8\\u03B5\\u03C4\\u03B7 \\u039A\\u03B1\\u03C4\\u03B5\\u03CD\\u03B8\\u03C5\\u03BD\\u03C3\\u03B7",groupPadding:"\\u0395\\u03C3\\u03BF\\u03C7\\u03AE \\u039F\\u03BC\\u03AC\\u03B4\\u03B1\\u03C2",seriesPadding:"\\u0395\\u03C3\\u03BF\\u03C7\\u03AE \\u03A3\\u03B5\\u03B9\\u03C1\\u03AC\\u03C2",tile:"\\u03A0\\u03BB\\u03B1\\u03BA\\u03AC\\u03BA\\u03B9",whisker:"\\u039C\\u03BF\\u03C5\\u03C3\\u03C4\\u03AC\\u03BA\\u03B9",cap:"\\u039A\\u03B1\\u03C0\\u03AC\\u03BA\\u03B9",capLengthRatio:"\\u039B\\u03CC\\u03B3\\u03BF\\u03C2 \\u039C\\u03AE\\u03BA\\u03BF\\u03C5\\u03C2",labelPlacement:"\\u03A4\\u03BF\\u03C0\\u03BF\\u03B8\\u03AD\\u03C4\\u03B7\\u03C3\\u03B7 \\u0395\\u03C4\\u03B9\\u03BA\\u03AD\\u03C4\\u03B1\\u03C2",inside:"\\u0395\\u03C3\\u03C9\\u03C4\\u03B5\\u03C1\\u03B9\\u03BA\\u03AC",outside:"\\u0395\\u03BE\\u03C9\\u03C4\\u03B5\\u03C1\\u03B9\\u03BA\\u03AC",noDataToChart:"\\u0394\\u03B5\\u03BD \\u03C5\\u03C0\\u03AC\\u03C1\\u03C7\\u03BF\\u03C5\\u03BD \\u03B4\\u03B9\\u03B1\\u03B8\\u03AD\\u03C3\\u03B9\\u03BC\\u03B1 \\u03B4\\u03B5\\u03B4\\u03BF\\u03BC\\u03AD\\u03BD\\u03B1 \\u03B3\\u03B9\\u03B1 \\u0';
      S = S + '3C4\\u03BF \\u03B3\\u03C1\\u03AC\\u03C6\\u03B7\\u03BC\\u03B1.",pivotChartRequiresPivotMode:"\\u03A4\\u03BF \\u03A3\\u03C5\\u03B3\\u03BA\\u03B5\\u03BD\\u03C4\\u03C1\\u03C9\\u03C4\\u03B9\\u03BA\\u03CC \\u0393\\u03C1\\u03AC\\u03C6\\u03B7\\u03BC\\u03B1 \\u03B1\\u03C0\\u03B1\\u03B9\\u03C4\\u03B5\\u03AF \\u03C4\\u03B7\\u03BD \\u03B5\\u03BD\\u03B5\\u03C1\\u03B3\\u03BF\\u03C0\\u03BF\\u03AF\\u03B7\\u03C3\\u03B7 \\u03C4\\u03B7\\u03C2 \\u03BB\\u03B5\\u03B9\\u03C4\\u03BF\\u03C5\\u03C1\\u03B3\\u03AF\\u03B1\\u03C2 \\u03A3\\u03C5\\u03B3\\u03BA\\u03B5\\u03BD\\u03C4\\u03C1\\u03C9\\u03C4\\u03B9\\u03BA\\u03BF\\u03CD.",chartSettingsToolbarTooltip:"\\u039C\\u03B5\\u03BD\\u03BF\\u03CD",chartLinkToolbarTooltip:"\\u03A3\\u03C5\\u03BD\\u03B4\\u03B5\\u03B4\\u03B5\\u03BC\\u03AD\\u03BD\\u03BF \\u03C3\\u03C4\\u03BF \\u03A0\\u03BB\\u03AD\\u03B3\\u03BC\\u03B1",chartUnlinkToolbarTooltip:"\\u0391\\u03C0\\u03BF\\u03C3\\u03C5\\u03BD\\u03B4\\u03B5\\u03B4\\u03B5\\u03BC\\u03AD\\u03BD\\u03BF \\u03B1\\u03C0\\u03CC \\u03C4\\u03BF \\u03A0\\u03BB\\u03AD\\u03B3\\u03BC\\u03B1",chartDownloadToolbarTooltip:"\\u039B\\u03AE\\u03C8\\u03B7 \\u0393\\u03C1\\u03B1\\u03C6\\u03AE\\u03BC\\u03B1\\u03C4\\u03BF\\u03C2",chartMenuToolbarTooltip:"\\u039C\\u03B5\\u03BD\\u03BF\\u03CD",chartEdit:"\\u0395\\u03C0\\u03B5\\u03BE\\u03B5\\u03C1\\u03B3\\u03B1\\u03C3\\u03AF\\u03B1 \\u0393\\u03C1\\u03B1\\u03C6\\u03AE\\u03BC\\u03B1\\u03C4\\u03BF\\u03C2",chartAdvancedSettings:"\\u03A0\\u03C1\\u03BF\\u03C7\\u03C9\\u03C1\\u03B7\\u03BC\\u03AD\\u03BD\\u03B5\\u03C2 \\u03A1\\u03C5\\u03B8\\u03BC\\u03AF\\u03C3\\u03B5\\u03B9\\u03C2",chartLink:"\\u03A3\\u03CD\\u03BD\\u03B4\\u03B5\\u03C3\\u03B7 \\u03C3\\u03C4\\u03BF \\u03A0\\u03BB\\u03AD\\u03B3\\u03BC\\u03B1",chartUnlink:"\\u0391\\u03C0\\u03BF\\u03C3\\u03CD\\u03BD\\u03B4\\u03B5\\u03C3\\u03B7 \\u03B1\\u03C0\\u03CC \\u03C4\\u03BF \\u03A0\\u03BB\\u03AD\\u03B3\\u03BC\\u03B1",chartDownload:"\\u039B\\u03AE\\u03C8\\u03B7 \\u0393\\u03C1\\u03B1\\u03C6\\u03AE\\u03BC\\u03B1\\u03C4\\u03BF\\u03C2",histogramFrequency:"\\u03A3\\u03C5\\u03C7\\u03BD\\u03CC\\u03C4\\u03B7\\u03C4\\u03B1",seriesChartType:"\\u03A4\\u03CD\\u03C0\\u03BF\\u03C2 \\u0393\\u03C1\\u03B1\\u03C6\\u03AE\\u03BC\\u03B1\\u03C4\\u03BF\\u03C2 \\u03A3\\u03B5\\u03B9\\u03C1\\u03AC\\u03C2",seriesType:"\\u03A4\\u03CD\\u03C0\\u03BF';
      S = S + '\\u03C2 \\u03A3\\u03B5\\u03B9\\u03C1\\u03AC\\u03C2",secondaryAxis:"\\u0394\\u03B5\\u03C5\\u03C4\\u03B5\\u03C1\\u03B5\\u03CD\\u03C9\\u03BD \\u0386\\u03BE\\u03BF\\u03BD\\u03B1\\u03C2",seriesAdd:"\\u03A0\\u03C1\\u03BF\\u03C3\\u03B8\\u03AE\\u03BA\\u03B7 \\u03C3\\u03B5\\u03B9\\u03C1\\u03AC\\u03C2",categoryAdd:"\\u03A0\\u03C1\\u03BF\\u03C3\\u03B8\\u03AE\\u03BA\\u03B7 \\u03BA\\u03B1\\u03C4\\u03B7\\u03B3\\u03BF\\u03C1\\u03AF\\u03B1\\u03C2",bar:"\\u03A1\\u03B1\\u03B2\\u03B4\\u03BF\\u03B3\\u03C1\\u03AC\\u03C6\\u03B7\\u03BC\\u03B1",column:"\\u03A3\\u03C4\\u03AE\\u03BB\\u03B7",histogram:"\\u0399\\u03C3\\u03C4\\u03CC\\u03B3\\u03C1\\u03B1\\u03BC\\u03BC\\u03B1",advancedSettings:"\\u03A0\\u03C1\\u03BF\\u03C7\\u03C9\\u03C1\\u03B7\\u03BC\\u03AD\\u03BD\\u03B5\\u03C2 \\u03A1\\u03C5\\u03B8\\u03BC\\u03AF\\u03C3\\u03B5\\u03B9\\u03C2",direction:"\\u039A\\u03B1\\u03C4\\u03B5\\u03CD\\u03B8\\u03C5\\u03BD\\u03C3\\u03B7",horizontal:"\\u039F\\u03C1\\u03B9\\u03B6\\u03CC\\u03BD\\u03C4\\u03B9\\u03BF",vertical:"\\u039A\\u03B1\\u03C4\\u03B1\\u03BA\\u03CC\\u03C1\\u03C5\\u03C6\\u03BF",seriesGroupType:"\\u03A4\\u03CD\\u03C0\\u03BF\\u03C2 \\u039F\\u03BC\\u03AC\\u03B4\\u03B1\\u03C2",groupedSeriesGroupType:"\\u039F\\u03BC\\u03B1\\u03B4\\u03BF\\u03C0\\u03BF\\u03B9\\u03B7\\u03BC\\u03AD\\u03BD\\u03BF",stackedSeriesGroupType:"\\u03A3\\u03C4\\u03BF\\u03B9\\u03B2\\u03B1\\u03B3\\u03BC\\u03AD\\u03BD\\u03BF",normalizedSeriesGroupType:"100% \\u03A3\\u03C4\\u03BF\\u03B9\\u03B2\\u03B1\\u03B3\\u03BC\\u03AD\\u03BD\\u03BF",legendEnabled:"\\u0395\\u03BD\\u03B5\\u03C1\\u03B3\\u03BF\\u03C0\\u03BF\\u03B9\\u03B7\\u03BC\\u03AD\\u03BD\\u03BF",invalidColor:"\\u0397 \\u03C4\\u03B9\\u03BC\\u03AE \\u03C4\\u03BF\\u03C5 \\u03C7\\u03C1\\u03CE\\u03BC\\u03B1\\u03C4\\u03BF\\u03C2 \\u03B4\\u03B5\\u03BD \\u03B5\\u03AF\\u03BD\\u03B1\\u03B9 \\u03AD\\u03B3\\u03BA\\u03C5\\u03C1\\u03B7",groupedColumnFull:"\\u039F\\u03BC\\u03B1\\u03B4\\u03BF\\u03C0\\u03BF\\u03B9\\u03B7\\u03BC\\u03AD\\u03BD\\u03B7 \\u03A3\\u03C4\\u03AE\\u03BB\\u03B7",stackedColumnFull:"\\u03A3\\u03C4\\u03BF\\u03B9\\u03B2\\u03B1\\u03B3\\u03BC\\u03AD\\u03BD\\u03B7 \\u03A3\\u03C4\\u03AE\\u03BB\\u03B7",normalizedColumnFull:"100% \\u03A3\\u03C4\\u03BF\\u03B9\\u03B2\\u03B1\\u03B3\\u03BC\\u03AD\\u03BD\\u03B7 \\u03A3\\u03C4\\u03AE\\u03BB\\u03B7",groupedB';
      S = S + 'arFull:"\\u039F\\u03BC\\u03B1\\u03B4\\u03BF\\u03C0\\u03BF\\u03B9\\u03B7\\u03BC\\u03AD\\u03BD\\u03BF \\u03A1\\u03B1\\u03B2\\u03B4\\u03BF\\u03B3\\u03C1\\u03AC\\u03C6\\u03B7\\u03BC\\u03B1",stackedBarFull:"\\u03A3\\u03C4\\u03BF\\u03B9\\u03B2\\u03B1\\u03B3\\u03BC\\u03AD\\u03BD\\u03BF \\u03A1\\u03B1\\u03B2\\u03B4\\u03BF\\u03B3\\u03C1\\u03AC\\u03C6\\u03B7\\u03BC\\u03B1",normalizedBarFull:"100% \\u03A3\\u03C4\\u03BF\\u03B9\\u03B2\\u03B1\\u03B3\\u03BC\\u03AD\\u03BD\\u03BF \\u03A1\\u03B1\\u03B2\\u03B4\\u03BF\\u03B3\\u03C1\\u03AC\\u03C6\\u03B7\\u03BC\\u03B1",stackedAreaFull:"\\u03A3\\u03C4\\u03BF\\u03B9\\u03B2\\u03B1\\u03B3\\u03BC\\u03AD\\u03BD\\u03B7 \\u03A0\\u03B5\\u03C1\\u03B9\\u03BF\\u03C7\\u03AE",normalizedAreaFull:"100% \\u03A3\\u03C4\\u03BF\\u03B9\\u03B2\\u03B1\\u03B3\\u03BC\\u03AD\\u03BD\\u03B7 \\u03A0\\u03B5\\u03C1\\u03B9\\u03BF\\u03C7\\u03AE",customCombo:"\\u03A0\\u03C1\\u03BF\\u03C3\\u03B1\\u03C1\\u03BC\\u03BF\\u03C3\\u03BC\\u03AD\\u03BD\\u03BF\\u03C2 \\u03A3\\u03C5\\u03BD\\u03B4\\u03C5\\u03B1\\u03C3\\u03BC\\u03CC\\u03C2",ariaAdvancedFilterBuilderItem:"${variable}. \\u0395\\u03C0\\u03AF\\u03C0\\u03B5\\u03B4\\u03BF ${variable}. \\u03A0\\u03B1\\u03C4\\u03AE\\u03C3\\u03C4\\u03B5 ENTER \\u03B3\\u03B9\\u03B1 \\u03B5\\u03C0\\u03B5\\u03BE\\u03B5\\u03C1\\u03B3\\u03B1\\u03C3\\u03AF\\u03B1",ariaAdvancedFilterBuilderItemValidation:"${variable}. \\u0395\\u03C0\\u03AF\\u03C0\\u03B5\\u03B4\\u03BF ${variable}. ${variable} \\u03A0\\u03B1\\u03C4\\u03AE\\u03C3\\u03C4\\u03B5 ENTER \\u03B3\\u03B9\\u03B1 \\u03B5\\u03C0\\u03B5\\u03BE\\u03B5\\u03C1\\u03B3\\u03B1\\u03C3\\u03AF\\u03B1.",ariaAdvancedFilterBuilderList:"\\u039B\\u03AF\\u03C3\\u03C4\\u03B1 \\u03A0\\u03C1\\u03BF\\u03C7\\u03C9\\u03C1\\u03B7\\u03BC\\u03AD\\u03BD\\u03BF\\u03C5 \\u039A\\u03B1\\u03C4\\u03B1\\u03C3\\u03BA\\u03B5\\u03C5\\u03B1\\u03C3\\u03C4\\u03AE \\u03A6\\u03AF\\u03BB\\u03C4\\u03C1\\u03C9\\u03BD",ariaAdvancedFilterBuilderFilterItem:"\\u03A3\\u03C5\\u03BD\\u03B8\\u03AE\\u03BA\\u03B7 \\u03A6\\u03AF\\u03BB\\u03C4\\u03C1\\u03BF\\u03C5",ariaAdvancedFilterBuilderGroupItem:"\\u039F\\u03BC\\u03AC\\u03B4\\u03B1 \\u03A6\\u03AF\\u03BB\\u03C4\\u03C1\\u03BF\\u03C5",ariaAdvancedFilterBuilderColumn:"\\u03A3\\u03C4\\u03AE\\u03BB\\u03B7",ariaAdvancedFilterBuilderOption:"\\u0395\\u03C0\\';
      S = S + 'u03B9\\u03BB\\u03BF\\u03B3\\u03AE",ariaAdvancedFilterBuilderValueP:"\\u03A4\\u03B9\\u03BC\\u03AE",ariaAdvancedFilterBuilderJoinOperator:"\\u03A4\\u03B5\\u03BB\\u03B5\\u03C3\\u03C4\\u03AE\\u03C2 \\u03A3\\u03C5\\u03BD\\u03AD\\u03BD\\u03C9\\u03C3\\u03B7\\u03C2",ariaAdvancedFilterInput:"\\u0395\\u03B9\\u03C3\\u03B1\\u03B3\\u03C9\\u03B3\\u03AE \\u03A0\\u03C1\\u03BF\\u03C7\\u03C9\\u03C1\\u03B7\\u03BC\\u03AD\\u03BD\\u03BF\\u03C5 \\u03A6\\u03AF\\u03BB\\u03C4\\u03C1\\u03BF\\u03C5",ariaChecked:"\\u03B5\\u03BB\\u03B5\\u03B3\\u03BC\\u03AD\\u03BD\\u03BF",ariaColumn:"\\u03A3\\u03C4\\u03AE\\u03BB\\u03B7",ariaColumnGroup:"\\u039F\\u03BC\\u03AC\\u03B4\\u03B1 \\u03A3\\u03C4\\u03AE\\u03BB\\u03B7\\u03C2",ariaColumnFiltered:"\\u03A6\\u03B9\\u03BB\\u03C4\\u03C1\\u03B1\\u03C1\\u03B9\\u03C3\\u03BC\\u03AD\\u03BD\\u03B7 \\u03A3\\u03C4\\u03AE\\u03BB\\u03B7",ariaColumnSelectAll:"\\u0395\\u03BD\\u03B1\\u03BB\\u03BB\\u03B1\\u03B3\\u03AE \\u0395\\u03C0\\u03B9\\u03BB\\u03BF\\u03B3\\u03AE\\u03C2 \\u038C\\u03BB\\u03C9\\u03BD \\u03C4\\u03C9\\u03BD \\u03A3\\u03C4\\u03B7\\u03BB\\u03CE\\u03BD",ariaDateFilterInput:"\\u0395\\u03B9\\u03C3\\u03B1\\u03B3\\u03C9\\u03B3\\u03AE \\u03A6\\u03AF\\u03BB\\u03C4\\u03C1\\u03BF\\u03C5 \\u0397\\u03BC\\u03B5\\u03C1\\u03BF\\u03BC\\u03B7\\u03BD\\u03AF\\u03B1\\u03C2",ariaDefaultListName:"\\u039B\\u03AF\\u03C3\\u03C4\\u03B1",ariaFilterColumnsInput:"\\u0395\\u03B9\\u03C3\\u03B1\\u03B3\\u03C9\\u03B3\\u03AE \\u03A6\\u03B9\\u03BB\\u03C4\\u03C1\\u03B1\\u03C1\\u03AF\\u03C3\\u03BC\\u03B1\\u03C4\\u03BF\\u03C2 \\u03A3\\u03C4\\u03B7\\u03BB\\u03CE\\u03BD",ariaFilterFromValue:"\\u03A6\\u03AF\\u03BB\\u03C4\\u03C1\\u03BF \\u03B1\\u03C0\\u03CC \\u03C4\\u03B9\\u03BC\\u03AE",ariaFilterInput:"\\u0395\\u03B9\\u03C3\\u03B1\\u03B3\\u03C9\\u03B3\\u03AE \\u03A6\\u03AF\\u03BB\\u03C4\\u03C1\\u03BF\\u03C5",ariaFilterList:"\\u039B\\u03AF\\u03C3\\u03C4\\u03B1 \\u03A6\\u03AF\\u03BB\\u03C4\\u03C1\\u03C9\\u03BD",ariaFilterToValue:"\\u03A6\\u03AF\\u03BB\\u03C4\\u03C1\\u03BF \\u03C3\\u03B5 \\u03C4\\u03B9\\u03BC\\u03AE",ariaFilterValue:"\\u03A4\\u03B9\\u03BC\\u03AE \\u03A6\\u03AF\\u03BB\\u03C4\\u03C1\\u03BF\\u03C5",ariaFilterMenuOpen:"\\u0386\\u03BD\\u03BF\\u03B9\\u03B3\\u03BC\\u03B1 \\u039C\\u03B5\\u03BD\\u03BF\\u03CD \\u03A6\\u03AF\\u03BB\\u03C4\\u03C1\\u03BF\\u03C';
      S = S + '5",ariaFilteringOperator:"\\u03A4\\u03B5\\u03BB\\u03B5\\u03C3\\u03C4\\u03AE\\u03C2 \\u03A6\\u03B9\\u03BB\\u03C4\\u03C1\\u03B1\\u03C1\\u03AF\\u03C3\\u03BC\\u03B1\\u03C4\\u03BF\\u03C2",ariaHidden:"\\u03BA\\u03C1\\u03C5\\u03C6\\u03CC",ariaIndeterminate:"\\u03B1\\u03C0\\u03C1\\u03BF\\u03C3\\u03B4\\u03B9\\u03CC\\u03C1\\u03B9\\u03C3\\u03C4\\u03BF",ariaInputEditor:"\\u0395\\u03C0\\u03B5\\u03BE\\u03B5\\u03C1\\u03B3\\u03B1\\u03C3\\u03C4\\u03AE\\u03C2 \\u0395\\u03B9\\u03C3\\u03B1\\u03B3\\u03C9\\u03B3\\u03AE\\u03C2",ariaMenuColumn:"\\u03A0\\u03B1\\u03C4\\u03AE\\u03C3\\u03C4\\u03B5 ALT DOWN \\u03B3\\u03B9\\u03B1 \\u03AC\\u03BD\\u03BF\\u03B9\\u03B3\\u03BC\\u03B1 \\u03BC\\u03B5\\u03BD\\u03BF\\u03CD \\u03C3\\u03C4\\u03AE\\u03BB\\u03B7\\u03C2",ariaFilterColumn:"\\u03A0\\u03B1\\u03C4\\u03AE\\u03C3\\u03C4\\u03B5 CTRL ENTER \\u03B3\\u03B9\\u03B1 \\u03AC\\u03BD\\u03BF\\u03B9\\u03B3\\u03BC\\u03B1 \\u03C6\\u03AF\\u03BB\\u03C4\\u03C1\\u03BF\\u03C5",ariaRowDeselect:"\\u03A0\\u03B1\\u03C4\\u03AE\\u03C3\\u03C4\\u03B5 SPACE \\u03B3\\u03B9\\u03B1 \\u03B1\\u03C0\\u03BF\\u03B5\\u03C0\\u03B9\\u03BB\\u03BF\\u03B3\\u03AE \\u03B1\\u03C5\\u03C4\\u03AE\\u03C2 \\u03C4\\u03B7\\u03C2 \\u03B3\\u03C1\\u03B1\\u03BC\\u03BC\\u03AE\\u03C2",ariaRowSelectAll:"\\u03A0\\u03B1\\u03C4\\u03AE\\u03C3\\u03C4\\u03B5 SPACE \\u03B3\\u03B9\\u03B1 \\u03B1\\u03BB\\u03BB\\u03B1\\u03B3\\u03AE \\u03B5\\u03C0\\u03B9\\u03BB\\u03BF\\u03B3\\u03AE\\u03C2 \\u03CC\\u03BB\\u03C9\\u03BD \\u03C4\\u03C9\\u03BD \\u03B3\\u03C1\\u03B1\\u03BC\\u03BC\\u03CE\\u03BD",ariaRowToggleSelection:"\\u03A0\\u03B1\\u03C4\\u03AE\\u03C3\\u03C4\\u03B5 SPACE \\u03B3\\u03B9\\u03B1 \\u03B5\\u03BD\\u03B1\\u03BB\\u03BB\\u03B1\\u03B3\\u03AE \\u03B5\\u03C0\\u03B9\\u03BB\\u03BF\\u03B3\\u03AE\\u03C2 \\u03B3\\u03C1\\u03B1\\u03BC\\u03BC\\u03AE\\u03C2",ariaRowSelect:"\\u03A0\\u03B1\\u03C4\\u03AE\\u03C3\\u03C4\\u03B5 SPACE \\u03B3\\u03B9\\u03B1 \\u03B5\\u03C0\\u03B9\\u03BB\\u03BF\\u03B3\\u03AE \\u03B1\\u03C5\\u03C4\\u03AE\\u03C2 \\u03C4\\u03B7\\u03C2 \\u03B3\\u03C1\\u03B1\\u03BC\\u03BC\\u03AE\\u03C2",ariaRowSelectionDisabled:"\\u0397 \\u03B5\\u03C0\\u03B9\\u03BB\\u03BF\\u03B3\\u03AE \\u03B3\\u03C1\\u03B1\\u03BC\\u03BC\\u03AE\\u03C2 \\u03AD\\u03C7\\u03B5\\u03B9 \\u03B1\\u03C0\\u03B5\\u03BD\\u03B5\\u03C1\\u03B3\\u03BF\\u03C0\\u03BF\\u03B9\\u03B7\\u0';
      S = S + '3B8\\u03B5\\u03AF \\u03B3\\u03B9\\u03B1 \\u03B1\\u03C5\\u03C4\\u03AE \\u03C4\\u03B7 \\u03B3\\u03C1\\u03B1\\u03BC\\u03BC\\u03AE",ariaSearch:"\\u0391\\u03BD\\u03B1\\u03B6\\u03AE\\u03C4\\u03B7\\u03C3\\u03B7",ariaSortableColumn:"\\u03A0\\u03B1\\u03C4\\u03AE\\u03C3\\u03C4\\u03B5 ENTER \\u03B3\\u03B9\\u03B1 \\u03C4\\u03B1\\u03BE\\u03B9\\u03BD\\u03CC\\u03BC\\u03B7\\u03C3\\u03B7",ariaToggleVisibility:"\\u03A0\\u03B1\\u03C4\\u03AE\\u03C3\\u03C4\\u03B5 SPACE \\u03B3\\u03B9\\u03B1 \\u03B1\\u03BB\\u03BB\\u03B1\\u03B3\\u03AE \\u03BF\\u03C1\\u03B1\\u03C4\\u03CC\\u03C4\\u03B7\\u03C4\\u03B1\\u03C2",ariaToggleCellValue:"\\u03A0\\u03B1\\u03C4\\u03AE\\u03C3\\u03C4\\u03B5 SPACE \\u03B3\\u03B9\\u03B1 \\u03B5\\u03BD\\u03B1\\u03BB\\u03BB\\u03B1\\u03B3\\u03AE \\u03C4\\u03B9\\u03BC\\u03AE\\u03C2 \\u03BA\\u03B5\\u03BB\\u03B9\\u03BF\\u03CD",ariaUnchecked:"\\u03BC\\u03B7 \\u03B5\\u03BB\\u03B5\\u03B3\\u03BC\\u03AD\\u03BD\\u03BF",ariaVisible:"\\u03BF\\u03C1\\u03B1\\u03C4\\u03CC",ariaSearchFilterValues:"\\u0391\\u03BD\\u03B1\\u03B6\\u03AE\\u03C4\\u03B7\\u03C3\\u03B7 \\u03C4\\u03B9\\u03BC\\u03CE\\u03BD \\u03C6\\u03AF\\u03BB\\u03C4\\u03C1\\u03BF\\u03C5",ariaPageSizeSelectorLabel:"\\u039C\\u03AD\\u03B3\\u03B5\\u03B8\\u03BF\\u03C2 \\u03A3\\u03B5\\u03BB\\u03AF\\u03B4\\u03B1\\u03C2",ariaChartMenuClose:"\\u039A\\u03BB\\u03B5\\u03AF\\u03C3\\u03B9\\u03BC\\u03BF \\u039C\\u03B5\\u03BD\\u03BF\\u03CD \\u0395\\u03C0\\u03B5\\u03BE\\u03B5\\u03C1\\u03B3\\u03B1\\u03C3\\u03AF\\u03B1\\u03C2 \\u0393\\u03C1\\u03B1\\u03C6\\u03AE\\u03BC\\u03B1\\u03C4\\u03BF\\u03C2",ariaChartSelected:"\\u0395\\u03C0\\u03B9\\u03BB\\u03B5\\u03B3\\u03BC\\u03AD\\u03BD\\u03BF",ariaSkeletonCellLoadingFailed:"\\u0391\\u03C0\\u03BF\\u03C4\\u03C5\\u03C7\\u03AF\\u03B1 \\u03C6\\u03CC\\u03C1\\u03C4\\u03C9\\u03C3\\u03B7\\u03C2 \\u03B3\\u03C1\\u03B1\\u03BC\\u03BC\\u03AE\\u03C2",ariaSkeletonCellLoading:"\\u03A4\\u03B1 \\u03B4\\u03B5\\u03B4\\u03BF\\u03BC\\u03AD\\u03BD\\u03B1 \\u03B3\\u03C1\\u03B1\\u03BC\\u03BC\\u03AE\\u03C2 \\u03C6\\u03BF\\u03C1\\u03C4\\u03CE\\u03BD\\u03BF\\u03BD\\u03C4\\u03B1\\u03B9",ariaRowGroupDropZonePanelLabel:"\\u039F\\u03BC\\u03AC\\u03B4\\u03B5\\u03C2 \\u03A3\\u03B5\\u03B9\\u03C1\\u03CE\\u03BD",ariaValuesDropZonePanelLabel:"\\u03A4\\u03B9\\u03BC\\u03AD\\u03C2",ariaPivotDropZonePanelLabel:';
      S = S + '"\\u0395\\u03C4\\u03B9\\u03BA\\u03AD\\u03C4\\u03B5\\u03C2 \\u03A3\\u03C4\\u03B7\\u03BB\\u03CE\\u03BD",ariaDropZoneColumnComponentDescription:"\\u03A0\\u03B9\\u03AD\\u03C3\\u03C4\\u03B5 DELETE \\u03B3\\u03B9\\u03B1 \\u03BD\\u03B1 \\u03B1\\u03C6\\u03B1\\u03B9\\u03C1\\u03AD\\u03C3\\u03B5\\u03C4\\u03B5",ariaDropZoneColumnValueItemDescription:"\\u03A0\\u03B9\\u03AD\\u03C3\\u03C4\\u03B5 ENTER \\u03B3\\u03B9\\u03B1 \\u03BD\\u03B1 \\u03B1\\u03BB\\u03BB\\u03AC\\u03BE\\u03B5\\u03C4\\u03B5 \\u03C4\\u03BF\\u03BD \\u03C4\\u03CD\\u03C0\\u03BF \\u03C3\\u03C5\\u03BD\\u03AC\\u03B8\\u03C1\\u03BF\\u03B9\\u03C3\\u03B7\\u03C2",ariaDropZoneColumnGroupItemDescription:"\\u03A0\\u03B9\\u03AD\\u03C3\\u03C4\\u03B5 ENTER \\u03B3\\u03B9\\u03B1 \\u03BD\\u03B1 \\u03C4\\u03B1\\u03BE\\u03B9\\u03BD\\u03BF\\u03BC\\u03AE\\u03C3\\u03B5\\u03C4\\u03B5",ariaDropZoneColumnComponentAggFuncSeparator:" \\u03B1\\u03C0\\u03CC ",ariaDropZoneColumnComponentSortAscending:"\\u03B1\\u03CD\\u03BE\\u03BF\\u03C5\\u03C3\\u03B1",ariaDropZoneColumnComponentSortDescending:"\\u03C6\\u03B8\\u03AF\\u03BD\\u03BF\\u03C5\\u03C3\\u03B1",ariaLabelDialog:"\\u0394\\u03B9\\u03B1\\u03BB\\u03BF\\u03B3\\u03AE",ariaLabelColumnMenu:"\\u039C\\u03B5\\u03BD\\u03BF\\u03CD \\u03A3\\u03C4\\u03AE\\u03BB\\u03B7\\u03C2",ariaLabelColumnFilter:"\\u03A6\\u03AF\\u03BB\\u03C4\\u03C1\\u03BF \\u03A3\\u03C4\\u03AE\\u03BB\\u03B7\\u03C2",ariaLabelCellEditor:"\\u0395\\u03C0\\u03B5\\u03BE\\u03B5\\u03C1\\u03B3\\u03B1\\u03C3\\u03C4\\u03AE\\u03C2 \\u039A\\u03B5\\u03BB\\u03B9\\u03BF\\u03CD",ariaLabelSelectField:"\\u0395\\u03C0\\u03B9\\u03BB\\u03BF\\u03B3\\u03AE \\u03A0\\u03B5\\u03B4\\u03AF\\u03BF\\u03C5",ariaLabelRichSelectField:"\\u03A0\\u03B5\\u03B4\\u03AF\\u03BF Rich Select",ariaLabelRichSelectToggleSelection:"\\u03A0\\u03B1\\u03C4\\u03AE\\u03C3\\u03C4\\u03B5 SPACE \\u03B3\\u03B9\\u03B1 \\u03B5\\u03BD\\u03B1\\u03BB\\u03BB\\u03B1\\u03B3\\u03AE \\u03B5\\u03C0\\u03B9\\u03BB\\u03BF\\u03B3\\u03AE\\u03C2",ariaLabelRichSelectDeselectAllItems:"\\u03A0\\u03B1\\u03C4\\u03AE\\u03C3\\u03C4\\u03B5 DELETE \\u03B3\\u03B9\\u03B1 \\u03B1\\u03C0\\u03BF\\u03B5\\u03C0\\u03B9\\u03BB\\u03BF\\u03B3\\u03AE \\u03CC\\u03BB\\u03C9\\u03BD \\u03C4\\u03C9\\u03BD \\u03B1\\u03BD\\u03C4\\u03B9\\u03BA\\u03B5\\u03B9\\u03BC\\u03AD\\';
      S = S + 'u03BD\\u03C9\\u03BD",ariaLabelRichSelectDeleteSelection:"\\u03A0\\u03B1\\u03C4\\u03AE\\u03C3\\u03C4\\u03B5 DELETE \\u03B3\\u03B9\\u03B1 \\u03B1\\u03C0\\u03BF\\u03B5\\u03C0\\u03B9\\u03BB\\u03BF\\u03B3\\u03AE \\u03B1\\u03BD\\u03C4\\u03B9\\u03BA\\u03B5\\u03B9\\u03BC\\u03AD\\u03BD\\u03BF\\u03C5",ariaLabelTooltip:"\\u0395\\u03C1\\u03B3\\u03B1\\u03BB\\u03B5\\u03AF\\u03BF \\u03A3\\u03C5\\u03BC\\u03B2\\u03BF\\u03C5\\u03BB\\u03CE\\u03BD",ariaLabelContextMenu:"\\u039C\\u03B5\\u03BD\\u03BF\\u03CD \\u03A0\\u03B5\\u03C1\\u03B9\\u03B5\\u03C7\\u03BF\\u03BC\\u03AD\\u03BD\\u03BF\\u03C5",ariaLabelSubMenu:"\\u03A5\\u03C0\\u03BF\\u03BC\\u03B5\\u03BD\\u03BF\\u03CD",ariaLabelAggregationFunction:"\\u03A3\\u03C5\\u03BD\\u03AC\\u03C1\\u03C4\\u03B7\\u03C3\\u03B7 \\u03A3\\u03C5\\u03BD\\u03BF\\u03BB\\u03B9\\u03BA\\u03BF\\u03C0\\u03BF\\u03AF\\u03B7\\u03C3\\u03B7\\u03C2",ariaLabelAdvancedFilterAutocomplete:"\\u0391\\u03C5\\u03C4\\u03CC\\u03BC\\u03B1\\u03C4\\u03B7 \\u03A3\\u03C5\\u03BC\\u03C0\\u03BB\\u03AE\\u03C1\\u03C9\\u03C3\\u03B7 \\u03A0\\u03C1\\u03BF\\u03C7\\u03C9\\u03C1\\u03B7\\u03BC\\u03AD\\u03BD\\u03BF\\u03C5 \\u03A6\\u03AF\\u03BB\\u03C4\\u03C1\\u03BF\\u03C5",ariaLabelAdvancedFilterBuilderAddField:"\\u03A0\\u03C1\\u03BF\\u03C3\\u03B8\\u03AE\\u03BA\\u03B7 \\u03A0\\u03B5\\u03B4\\u03AF\\u03BF\\u03C5 \\u0394\\u03B7\\u03BC\\u03B9\\u03BF\\u03C5\\u03C1\\u03B3\\u03BF\\u03CD \\u03A0\\u03C1\\u03BF\\u03C7\\u03C9\\u03C1\\u03B7\\u03BC\\u03AD\\u03BD\\u03BF\\u03C5 \\u03A6\\u03AF\\u03BB\\u03C4\\u03C1\\u03BF\\u03C5",ariaLabelAdvancedFilterBuilderColumnSelectField:"\\u0395\\u03C0\\u03B9\\u03BB\\u03BF\\u03B3\\u03AE \\u03A3\\u03C4\\u03AE\\u03BB\\u03B7\\u03C2 \\u0394\\u03B7\\u03BC\\u03B9\\u03BF\\u03C5\\u03C1\\u03B3\\u03BF\\u03CD \\u03A0\\u03C1\\u03BF\\u03C7\\u03C9\\u03C1\\u03B7\\u03BC\\u03AD\\u03BD\\u03BF\\u03C5 \\u03A6\\u03AF\\u03BB\\u03C4\\u03C1\\u03BF\\u03C5",ariaLabelAdvancedFilterBuilderOptionSelectField:"\\u0395\\u03C0\\u03B9\\u03BB\\u03BF\\u03B3\\u03AE \\u0395\\u03C0\\u03B9\\u03BB\\u03BF\\u03B3\\u03AE\\u03C2 \\u0394\\u03B7\\u03BC\\u03B9\\u03BF\\u03C5\\u03C1\\u03B3\\u03BF\\u03CD \\u03A0\\u03C1\\u03BF\\u03C7\\u03C9\\u03C1\\u03B7\\u03BC\\u03AD\\u03BD\\u03BF\\u03C5 \\u03A6\\u03AF\\u03BB\\u03C4\\u03C1\\u03BF\\u03C5",ariaLabelAdvancedFilterBuilderJoinSelectField:"\\u039';
      S = S + '5\\u03C0\\u03B9\\u03BB\\u03BF\\u03B3\\u03AE \\u03A4\\u03B5\\u03BB\\u03B5\\u03C3\\u03C4\\u03AE \\u03A3\\u03CD\\u03BD\\u03B4\\u03B5\\u03C3\\u03B7\\u03C2 \\u0394\\u03B7\\u03BC\\u03B9\\u03BF\\u03C5\\u03C1\\u03B3\\u03BF\\u03CD \\u03A0\\u03C1\\u03BF\\u03C7\\u03C9\\u03C1\\u03B7\\u03BC\\u03AD\\u03BD\\u03BF\\u03C5 \\u03A6\\u03AF\\u03BB\\u03C4\\u03C1\\u03BF\\u03C5",ariaColumnPanelList:"\\u039B\\u03AF\\u03C3\\u03C4\\u03B1 \\u03A3\\u03C4\\u03B7\\u03BB\\u03CE\\u03BD",ariaFilterPanelList:"\\u039B\\u03AF\\u03C3\\u03C4\\u03B1 \\u03A6\\u03AF\\u03BB\\u03C4\\u03C1\\u03C9\\u03BD",thousandSeparator:".",decimalSeparator:",",true:"\\u0391\\u03BB\\u03B7\\u03B8\\u03AD\\u03C2",false:"\\u03A8\\u03B5\\u03C5\\u03B4\\u03AD\\u03C2",invalidDate:"\\u039C\\u03B7 \\u03AD\\u03B3\\u03BA\\u03C5\\u03C1\\u03B7 \\u03B7\\u03BC\\u03B5\\u03C1\\u03BF\\u03BC\\u03B7\\u03BD\\u03AF\\u03B1",invalidNumber:"\\u039C\\u03B7 \\u03AD\\u03B3\\u03BA\\u03C5\\u03C1\\u03BF\\u03C2 \\u03B1\\u03C1\\u03B9\\u03B8\\u03BC\\u03CC\\u03C2",january:"\\u0399\\u03B1\\u03BD\\u03BF\\u03C5\\u03AC\\u03C1\\u03B9\\u03BF\\u03C2",february:"\\u03A6\\u03B5\\u03B2\\u03C1\\u03BF\\u03C5\\u03AC\\u03C1\\u03B9\\u03BF\\u03C2",march:"\\u039C\\u03AC\\u03C1\\u03C4\\u03B9\\u03BF\\u03C2",april:"\\u0391\\u03C0\\u03C1\\u03AF\\u03BB\\u03B9\\u03BF\\u03C2",may:"\\u039C\\u03AC\\u03B9\\u03BF\\u03C2",june:"\\u0399\\u03BF\\u03CD\\u03BD\\u03B9\\u03BF\\u03C2",july:"\\u0399\\u03BF\\u03CD\\u03BB\\u03B9\\u03BF\\u03C2",august:"\\u0391\\u03CD\\u03B3\\u03BF\\u03C5\\u03C3\\u03C4\\u03BF\\u03C2",september:"\\u03A3\\u03B5\\u03C0\\u03C4\\u03AD\\u03BC\\u03B2\\u03C1\\u03B9\\u03BF\\u03C2",october:"\\u039F\\u03BA\\u03C4\\u03CE\\u03B2\\u03C1\\u03B9\\u03BF\\u03C2",november:"\\u039D\\u03BF\\u03AD\\u03BC\\u03B2\\u03C1\\u03B9\\u03BF\\u03C2",december:"\\u0394\\u03B5\\u03BA\\u03AD\\u03BC\\u03B2\\u03C1\\u03B9\\u03BF\\u03C2",timeFormatSlashesDDMMYYYY:"\\u0397\\u0397/\\u039C\\u039C/\\u0395\\u0395\\u0395\\u0395",timeFormatSlashesMMDDYYYY:"\\u039C\\u039C/\\u0397\\u0397/\\u0395\\u0395\\u0395\\u0395",timeFormatSlashesDDMMYY:"\\u0397\\u0397/\\u039C\\u039C/\\u0395\\u0395",timeFormatSlashesMMDDYY:"\\u039C\\u039C/\\u0397\\u0397/\\u0395\\u0395",timeFormatDotsDDMYY:"\\u0397\\u0397.\\u039C.\\u0395\\u0395",timeFormatDotsMDDYY:"\\u039C.\\u0397\\u0397.\\u0395\\u03';
      S = S + '95",timeFormatDashesYYYYMMDD:"\\u0395\\u0395\\u0395\\u0395-\\u039C\\u039C-\\u0397\\u0397",timeFormatSpacesDDMMMMYYYY:"\\u0397\\u0397 \\u039C\\u039C\\u039C\\u039C \\u0395\\u0395\\u0395\\u0395",timeFormatHHMMSS:"\\u03A9\\u03A9:\\u039B\\u039B:\\u0394\\u0394",timeFormatHHMMSSAmPm:"\\u03A9\\u03A9:\\u039B\\u039B:\\u0394\\u0394 \\u03A0\\u039C/\\u039C\\u039C"},v={selectAll:"(Valitse kaikki)",selectAllSearchResults:"(Valitse kaikki hakutulokset)",addCurrentSelectionToFilter:"Lis\\xE4\\xE4 nykyinen valinta suodattimeen",searchOoo:"Haku...",blanks:"(Tyhj\\xE4t)",noMatches:"Ei osumia",filterOoo:"Suodata...",equals:"Yht\\xE4 kuin",notEqual:"Eri kuin",blank:"Tyhj\\xE4",notBlank:"Ei tyhj\\xE4",empty:"Valitse yksi",lessThan:"V\\xE4hemm\\xE4n kuin",greaterThan:"Enemm\\xE4n kuin",lessThanOrEqual:"V\\xE4hemm\\xE4n tai yht\\xE4 paljon kuin",greaterThanOrEqual:"Enemm\\xE4n tai yht\\xE4 paljon kuin",inRange:"V\\xE4lill\\xE4",inRangeStart:"Alkaen",inRangeEnd:"Loppuun",contains:"Sis\\xE4lt\\xE4\\xE4",notContains:"Ei sis\\xE4ll\\xE4",startsWith:"Alkaa",endsWith:"P\\xE4\\xE4ttyy",dateFormatOoo:"yyyy-mm-dd",before:"Ennen",after:"J\\xE4lkeen",andCondition:"JA",orCondition:"TAI",applyFilter:"K\\xE4yt\\xE4",resetFilter:"Nollaa",clearFilter:"Tyhjenn\\xE4",cancelFilter:"Peruuta",textFilter:"Tekstisuodatin",numberFilter:"Numerosuodatin",dateFilter:"P\\xE4iv\\xE4m\\xE4\\xE4r\\xE4suodatin",setFilter:"Joukko suodatin",groupFilterSelect:"Valitse kentt\\xE4:",advancedFilterContains:"sis\\xE4lt\\xE4\\xE4",advancedFilterNotContains:"ei sis\\xE4ll\\xE4",advancedFilterTextEquals:"on yht\\xE4 kuin",advancedFilterTextNotEqual:"ei ole yht\\xE4 kuin",advancedFilterStartsWith:"alkaa",advancedFilterEndsWith:"p\\xE4\\xE4ttyy",advancedFilterBlank:"on tyhj\\xE4",advancedFilterNotBlank:"ei ole tyhj\\xE4",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"on tosi",advancedFilterFalse:"on ep\\xE4tosi",advancedFilterAnd:"JA",advancedFilterOr:"TAI",';
      S = S + 'advancedFilterApply:"K\\xE4yt\\xE4",advancedFilterBuilder:"Rakentaja",advancedFilterValidationMissingColumn:"Sarake puuttuu",advancedFilterValidationMissingOption:"Valinta puuttuu",advancedFilterValidationMissingValue:"Arvo puuttuu",advancedFilterValidationInvalidColumn:"Sarake ei l\\xF6ydy",advancedFilterValidationInvalidOption:"Valintaa ei l\\xF6ydy",advancedFilterValidationMissingQuote:"Arvosta puuttuu p\\xE4\\xE4te lainausmerkki",advancedFilterValidationNotANumber:"Arvo ei ole numero",advancedFilterValidationInvalidDate:"Arvo ei ole kelvollinen p\\xE4iv\\xE4m\\xE4\\xE4r\\xE4",advancedFilterValidationMissingCondition:"Ehto puuttuu",advancedFilterValidationJoinOperatorMismatch:"Yhdisteoperaattoreiden t\\xE4ytyy olla samat ehdon sis\\xE4ll\\xE4",advancedFilterValidationInvalidJoinOperator:"Yhdisteoperaattori ei l\\xF6ydy",advancedFilterValidationMissingEndBracket:"P\\xE4\\xE4tt\\xE4v\\xE4 sulje puuttuu",advancedFilterValidationExtraEndBracket:"Liian monta p\\xE4\\xE4tt\\xE4v\\xE4\\xE4 suljetta",advancedFilterValidationMessage:"Lausekkeessa on virhe. ${variable} - ${variable}.",advancedFilterValidationMessageAtEnd:"Lausekkeessa on virhe. ${variable} lausekkeen lopussa.",advancedFilterBuilderTitle:"Tarkennettu suodatin",advancedFilterBuilderApply:"K\\xE4yt\\xE4",advancedFilterBuilderCancel:"Peruuta",advancedFilterBuilderAddButtonTooltip:"Lis\\xE4\\xE4 suodatin tai ryhm\\xE4",advancedFilterBuilderRemoveButtonTooltip:"Poista",advancedFilterBuilderMoveUpButtonTooltip:"Siirr\\xE4 yl\\xF6s",advancedFilterBuilderMoveDownButtonTooltip:"Siirr\\xE4 alas",advancedFilterBuilderAddJoin:"Lis\\xE4\\xE4 ryhm\\xE4",advancedFilterBuilderAddCondition:"Lis\\xE4\\xE4 suodatin",advancedFilterBuilderSelectColumn:"Valitse sarake",advancedFilterBuilderSelectOption:"Valitse vaihtoehto",advancedFilterBuilderEnterValue:"Sy\\xF6t\\xE4 arvo...",advancedFilterBuilderValidationAlreadyApplied:"Nykyinen suodatin on jo k\\xE4yt\\xF6ss\\xE4.",advancedFilterBuilderValidationIncomplete:"Kaikki ehdot eiv\\xE4t ole valmiita.",advancedFilterBuilder';
      S = S + 'ValidationSelectColumn:"T\\xE4ytyy valita sarake.",advancedFilterBuilderValidationSelectOption:"T\\xE4ytyy valita vaihtoehto.",advancedFilterBuilderValidationEnterValue:"T\\xE4ytyy sy\\xF6tt\\xE4\\xE4 arvo.",columns:"Sarakkeet",filters:"Suodattimet",pivotMode:"Pivot-tila",groups:"Riviryhm\\xE4t",rowGroupColumnsEmptyMessage:"Ved\\xE4 t\\xE4nne asettaaksesi riviryhm\\xE4t",values:"Arvot",valueColumnsEmptyMessage:"Ved\\xE4 t\\xE4nne tehd\\xE4ksesi aggregaatin",pivots:"Sarakemerkinn\\xE4t",pivotColumnsEmptyMessage:"Ved\\xE4 t\\xE4nne asettaaksesi sarakemerkinn\\xE4t",group:"Ryhm\\xE4",rowDragRow:"rivi",rowDragRows:"rivit",loadingOoo:"Ladataan...",loadingError:"VIRHE",noRowsToShow:"Ei n\\xE4ytett\\xE4vi\\xE4 rivej\\xE4",enabled:"K\\xE4yt\\xF6ss\\xE4",pinColumn:"Kiinnit\\xE4 sarake",pinLeft:"Kiinnit\\xE4 vasemmalle",pinRight:"Kiinnit\\xE4 oikealle",noPin:"Ei kiinnityst\\xE4",valueAggregation:"Arvon yhteenveto",noAggregation:"Ei yhteenvetoa",autosizeThisColumn:"Automaattinen koko t\\xE4lle sarakkeelle",autosizeAllColumns:"Automaattinen koko kaikille sarakkeille",groupBy:"Ryhmittele",ungroupBy:"Poista ryhmittely",ungroupAll:"Poista kaikkien ryhmien ryhmittely",addToValues:"Lis\\xE4\\xE4 ${variable} arvoihin",removeFromValues:"Poista ${variable} arvoista",addToLabels:"Lis\\xE4\\xE4 ${variable} etiketteihin",removeFromLabels:"Poista ${variable} etiketeist\\xE4",resetColumns:"Palauta sarakkeet",expandAll:"Laajenna kaikki riviryhm\\xE4t",collapseAll:"Sulje kaikki riviryhm\\xE4t",copy:"Kopioi",ctrlC:"Ctrl+C",ctrlX:"Ctrl+X",copyWithHeaders:"Kopioi otsikoiden kanssa",copyWithGroupHeaders:"Kopioi ryhm\\xE4otsikoiden kanssa",cut:"Leikkaa",paste:"Liit\\xE4",ctrlV:"Ctrl+V",export:"Vie",csvExport:"Vie CSV-muodossa",excelExport:"Vie Excel-muodossa",columnFilter:"Sarakkeen suodatus",columnChooser:"Valitse sarakkeet",sortAscending:"Lajittele nousevasti",sortDescending:"Lajittele laskevasti",sortUnSort:"Tyhjenn\\xE4 lajittelu",sum:"Summa",first:"Ensimm\\xE4inen",last:"Viimeinen",min:"Minimi",max:"Maksimi",none:"Ei mit\\xE4\\xE4n",c';
      S = S + 'ount:"Lukum\\xE4\\xE4r\\xE4",avg:"Keskiarvo",filteredRows:"Suodatettu",selectedRows:"Valitut",totalRows:"Rivit yhteens\\xE4",totalAndFilteredRows:"Rivit",more:"Lis\\xE4\\xE4",to:"-",of:" / ",page:"Sivu",pageLastRowUnknown:"?",nextPage:"Seuraava sivu",lastPage:"Viimeinen sivu",firstPage:"Ensimm\\xE4inen sivu",previousPage:"Edellinen sivu",pageSizeSelectorLabel:"Sivun koko:",footerTotal:"Yhteens\\xE4",pivotColumnGroupTotals:"Yhteens\\xE4",pivotChartAndPivotMode:"Pivot Kaavio & Pivot Tila",pivotChart:"Pivot Kaavio",chartRange:"Kaavion Alue",columnChart:"Pylv\\xE4s",groupedColumn:"Ryhmitelty",stackedColumn:"Pinottu",normalizedColumn:"100% Pinottu",barChart:"Palkki",groupedBar:"Ryhmitelty",stackedBar:"Pinottu",normalizedBar:"100% Pinottu",pieChart:"Piirakka",pie:"Piirakka",donut:"Donitsi",line:"Viiva",xyChart:"X Y (Hajontakaavio)",scatter:"Hajonta",bubble:"Kupla",areaChart:"Alue",area:"Alue",stackedArea:"Pinottu",normalizedArea:"100% Pinottu",histogramChart:"Histogrammi",polarChart:"Polaarinen",radarLine:"Tutkaviiva",radarArea:"Tutka-alue",nightingale:"Nightingale",radialColumn:"S\\xE4depylv\\xE4s",radialBar:"S\\xE4depalkki",statisticalChart:"Tilastollinen",boxPlot:"Laatikkokaavio",rangeBar:"Aluepalkki",rangeArea:"Aluekaavio",hierarchicalChart:"Hierarkkinen",treemap:"Puukaavio",sunburst:"Auringonpurkaus",specializedChart:"Erikoistunut",waterfall:"Vesiputous",heatmap:"L\\xE4mp\\xF6kartta",combinationChart:"Yhdistelm\\xE4",columnLineCombo:"Pylv\\xE4s & Viiva",AreaColumnCombo:"Alue & Pylv\\xE4s",pivotChartTitle:"Pivot-kaavio",rangeChartTitle:"Aluekaavio",settings:"Kaavio",data:"M\\xE4\\xE4ritys",format:"Mukauta",categories:"Luokat",defaultCategory:"(Ei mit\\xE4\\xE4n)",series:"Sarjat",switchCategorySeries:"Vaihda luokkaa / sarjaa",categoryValues:"Luokka-arvot",seriesLabels:"Sarjojen tunnisteet",aggregate:"Yhdist\\xE4",xyValues:"X Y -arvot",paired:"Paritettu tila",axis:"Akseli",xAxis:"Vaaka-akseli",yAxis:"Pysty-akseli",polarAxis:"Polaarinen akseli",radiusAxis:"S\\xE4deakseli",navigator:"Navigator",';
      S = S + 'zoom:"Zoomaa",animation:"Animaatio",crosshair:"Ristikko",color:"V\\xE4ri",thickness:"Paksuus",preferredLength:"Suositeltu pituus",xType:"X-tyyppi",axisType:"Akseleiden tyyppi",automatic:"Automaattinen",category:"Luokka",number:"Numero",time:"Aika",timeFormat:"Aikaformaatti",autoRotate:"Automaattinen kierto",labelRotation:"Kierr\\xE4",circle:"Ympyr\\xE4",polygon:"Monikulmio",square:"Neli\\xF6",cross:"Risti",diamond:"Timantti",plus:"Plus",triangle:"Kolmio",heart:"Syd\\xE4n",orientation:"Orientaatio",fixed:"Kiinnitetty",parallel:"Rinnakkainen",perpendicular:"Kohtisuora",radiusAxisPosition:"Sijainti",ticks:"Merkit",gridLines:"Ruudukko viivat",width:"Leveys",height:"Korkeus",length:"Pituus",padding:"T\\xE4ytt\\xF6",spacing:"V\\xE4li",chartStyle:"Kaavion tyyli",title:"Otsikko",chartTitles:"Kaavio-otsikot",chartTitle:"Kaavio-otsikko",chartSubtitle:"Alaotsikko",horizontalAxisTitle:"Vaaka-akselin otsikko",verticalAxisTitle:"Pysty-akselin otsikko",polarAxisTitle:"Polaarisen akselin otsikko",titlePlaceholder:"Kaavion otsikko",background:"Tausta",font:"Fontti",weight:"Paksuus",top:"Yl\\xE4",right:"Oikea",bottom:"Ala",left:"Vasen",labels:"Tunnisteet",calloutLabels:"Huomautustunnisteet",sectorLabels:"Sektoritunnisteet",positionRatio:"Suhteen sijainti",size:"Koko",shape:"Muoto",minSize:"Minimikoko",maxSize:"Maksimikoko",legend:"Selite",position:"Sijainti",markerSize:"Merkin koko",markerStroke:"Merkki veto",markerPadding:"Merkin t\\xE4ytt\\xF6",itemSpacing:"Kohteen v\\xE4li",itemPaddingX:"Kohteen t\\xE4ytt\\xF6 X",itemPaddingY:"Kohteen t\\xE4ytt\\xF6 Y",layoutHorizontalSpacing:"Vaakasuuntainen v\\xE4li",layoutVerticalSpacing:"Pystysuuntainen v\\xE4li",strokeWidth:"Viivan leveys",offset:"Siirtym\\xE4",offsets:"Offsetit",tooltips:"Ty\\xF6kaluvihjeet",callout:"Huomautus",markers:"Merkit",shadow:"Varjo",blur:"Sumennus",xOffset:"X-siirtym\\xE4",yOffset:"Y-siirtym\\xE4",lineWidth:"Viivan leveys",lineDash:"Viivan viivaus",lineDashOffset:"Viivaus siirtym\\xE4",scrollingZoom:"Vieritys",scrollingStep:"Vieritys ask';
      S = S + 'el",selectingZoom:"Valinta",durationMillis:"Kesto (ms)",crosshairLabel:"Tunniste",crosshairSnap:"Napsauta solmuun",normal:"Normaali",bold:"Lihavoitu",italic:"Kursiivi",boldItalic:"Lihavoitu kursiivi",predefined:"Ennalta m\\xE4\\xE4ritelty",fillOpacity:"T\\xE4ytt\\xF6peitt\\xE4vyys",strokeColor:"Viivav\\xE4ri",strokeOpacity:"Viivapeitt\\xE4vyys",miniChart:"Mini-kaavio",histogramBinCount:"Bin count",connectorLine:"Liit\\xE4nt\\xE4viiva",seriesItems:"Sarjan kohteet",seriesItemType:"Kohteen tyyppi",seriesItemPositive:"Positiivinen",seriesItemNegative:"Negatiivinen",seriesItemLabels:"Kohteen tunnisteet",columnGroup:"Pylv\\xE4s",barGroup:"Palkki",pieGroup:"Piirakka",lineGroup:"Viiva",scatterGroup:"X Y (Hajanaisuus)",areaGroup:"Alue",polarGroup:"Polaarinen",statisticalGroup:"Tilastollinen",hierarchicalGroup:"Hierarkkinen",specializedGroup:"Erikoistunut",combinationGroup:"Yhdistelm\\xE4",groupedColumnTooltip:"Ryhmitetty",stackedColumnTooltip:"Pinottu",normalizedColumnTooltip:"100 % pinottu",groupedBarTooltip:"Ryhmitetty",stackedBarTooltip:"Pinottu",normalizedBarTooltip:"100 % pinottu",pieTooltip:"Piirakka",donutTooltip:"Donitsi",lineTooltip:"Viiva",groupedAreaTooltip:"Alue",stackedAreaTooltip:"Pinottu",normalizedAreaTooltip:"100 % pinottu",scatterTooltip:"Hajanaisuus",bubbleTooltip:"Kupla",histogramTooltip:"Histogrammi",radialColumnTooltip:"S\\xE4teitt\\xE4inen pylv\\xE4s",radialBarTooltip:"S\\xE4teitt\\xE4inen palkki",radarLineTooltip:"Tutka viiva",radarAreaTooltip:"Tutka-alue",nightingaleTooltip:"Nightingale",rangeBarTooltip:"Alue palkki",rangeAreaTooltip:"Alue",boxPlotTooltip:"Box plot",treemapTooltip:"Puukartta",sunburstTooltip:"Sunburst",waterfallTooltip:"Vesiputous",heatmapTooltip:"L\\xE4mp\\xF6kartta",columnLineComboTooltip:"Pylv\\xE4s & viiva",areaColumnComboTooltip:"Alue & pylv\\xE4s",customComboTooltip:"Mukautettu yhdistelm\\xE4",innerRadius:"Sis\\xE4inen s\\xE4de",startAngle:"Alkukulma",endAngle:"P\\xE4\\xE4tekulma",reverseDirection:"K\\xE4\\xE4nteinen suunta",groupPadding:"Ryhm\\xE4 T\\xE4y';
      S = S + 'tt\\xF6",seriesPadding:"Sarjan T\\xE4ytt\\xF6",tile:"Laatoittaa",whisker:"Viikset",cap:"Korkki",capLengthRatio:"Pituusosuus",labelPlacement:"Sijoitus",inside:"Sis\\xE4ll\\xE4",outside:"Ulkopuolella",noDataToChart:"Ei dataa kaavioon.",pivotChartRequiresPivotMode:"Pivot-kaavio tarvitsee Pivot-tilan aktivoidun.",chartSettingsToolbarTooltip:"Valikko",chartLinkToolbarTooltip:"Linkitetty ruudukkoon",chartUnlinkToolbarTooltip:"Irrotettu ruudukosta",chartDownloadToolbarTooltip:"Lataa kaavio",chartMenuToolbarTooltip:"Valikko",chartEdit:"Muokkaa kaaviota",chartAdvancedSettings:"Edistyneemm\\xE4t asetukset",chartLink:"Linkit\\xE4 ruudukkoon",chartUnlink:"Irrota ruudukosta",chartDownload:"Lataa kaavio",histogramFrequency:"Taajuus",seriesChartType:"Sarjakaavion tyyppi",seriesType:"Sarjan tyyppi",secondaryAxis:"Toissijainen akseli",seriesAdd:"Lis\\xE4\\xE4 sarjat",categoryAdd:"Lis\\xE4\\xE4 luokka",bar:"Palkki",column:"Pylv\\xE4s",histogram:"Histogrammi",advancedSettings:"Edistyneemm\\xE4t asetukset",direction:"Suunta",horizontal:"Vaakasuora",vertical:"Pystysuora",seriesGroupType:"Ryhm\\xE4tyyppi",groupedSeriesGroupType:"Ryhmitetty",stackedSeriesGroupType:"Pinottu",normalizedSeriesGroupType:"100 % pinottu",legendEnabled:"K\\xE4yt\\xF6ss\\xE4",invalidColor:"V\\xE4riarvo on virheellinen",groupedColumnFull:"Ryhmitetty pylv\\xE4s",stackedColumnFull:"Pinottu pylv\\xE4s",normalizedColumnFull:"100 % pinottu pylv\\xE4s",groupedBarFull:"Ryhmitetty palkki",stackedBarFull:"Pinottu palkki",normalizedBarFull:"100 % pinottu palkki",stackedAreaFull:"Pinottu alue",normalizedAreaFull:"100 % pinottu alue",customCombo:"Mukautettu yhdistelm\\xE4",ariaAdvancedFilterBuilderItem:"${variable}. Taso ${variable}. Paina ENTER muokataksesi.",ariaAdvancedFilterBuilderItemValidation:"${variable}. Taso ${variable}. ${variable} Paina ENTER muokataksesi.",ariaAdvancedFilterBuilderList:"Tarkennettu suodattimen rakentaja lista",ariaAdvancedFilterBuilderFilterItem:"Suodatusehto",ariaAdvancedFilterBuilderGroupItem:"Suodatuksen ryhm\\xE4",';
      S = S + 'ariaAdvancedFilterBuilderColumn:"Sarake",ariaAdvancedFilterBuilderOption:"Vaihtoehto",ariaAdvancedFilterBuilderValueP:"Arvo",ariaAdvancedFilterBuilderJoinOperator:"Liitosoperaattori",ariaAdvancedFilterInput:"Tarkennettu suodattimen sy\\xF6te",ariaChecked:"valittu",ariaColumn:"Sarake",ariaColumnGroup:"Sarakeryhm\\xE4",ariaColumnFiltered:"Suodatettu sarake",ariaColumnSelectAll:"Vaihda kaikkien sarakkeiden valinta",ariaDateFilterInput:"P\\xE4iv\\xE4m\\xE4\\xE4r\\xE4n suodattimen sy\\xF6te",ariaDefaultListName:"Lista",ariaFilterColumnsInput:"Suodata sarakkeiden sy\\xF6te",ariaFilterFromValue:"Suodata arvosta",ariaFilterInput:"Suodattimen sy\\xF6te",ariaFilterList:"Suodatinlista",ariaFilterToValue:"Suodata arvoon",ariaFilterValue:"Suodattimen arvo",ariaFilterMenuOpen:"Avaa suodattimen valikko",ariaFilteringOperator:"Suodatuksen operaattori",ariaHidden:"piilotettu",ariaIndeterminate:"ep\\xE4m\\xE4\\xE4r\\xE4inen",ariaInputEditor:"Sy\\xF6tteen muokkaaja",ariaMenuColumn:"Paina ALT ALAS avataksesi sarakevalikon",ariaFilterColumn:"Paina CTRL ENTER avataksesi suodattimen",ariaRowDeselect:"Paina V\\xC4LILY\\xD6NTI poistaaksesi t\\xE4m\\xE4n rivin valinnan",ariaRowSelectAll:"Paina V\\xC4LILY\\xD6NTI vaihtaaksesi kaikkien rivien valintaa",ariaRowToggleSelection:"Paina V\\xC4LILY\\xD6NTI vaihtaaksesi rivin valintaa",ariaRowSelect:"Paina V\\xC4LILY\\xD6NTI valitaksesi t\\xE4m\\xE4n rivin",ariaRowSelectionDisabled:"Rivin valinta on poistettu k\\xE4yt\\xF6st\\xE4 t\\xE4lle riville",ariaSearch:"Haku",ariaSortableColumn:"Paina ENTER lajitellaksesi",ariaToggleVisibility:"Paina V\\xC4LILY\\xD6NTI vaihtaaksesi n\\xE4kyvyytt\\xE4",ariaToggleCellValue:"Paina V\\xC4LILY\\xD6NTI vaihtaaksesi solun arvoa",ariaUnchecked:"valitsematon",ariaVisible:"n\\xE4kyv\\xE4",ariaSearchFilterValues:"Etsi suodattimen arvoja",ariaPageSizeSelectorLabel:"Sivun koko",ariaChartMenuClose:"Sulje kaavion muokkausvalikko",ariaChartSelected:"Valittu",ariaSkeletonCellLoadingFailed:"Rivin lataus ep\\xE4onnistui",ariaSkeletonCellLoading:"Rivin tietoja ladataan';
      S = S + '",ariaRowGroupDropZonePanelLabel:"Riviryhm\\xE4t",ariaValuesDropZonePanelLabel:"Arvot",ariaPivotDropZonePanelLabel:"Sarakkeet",ariaDropZoneColumnComponentDescription:"Poista painamalla DELETE",ariaDropZoneColumnValueItemDescription:"Vaihda aggregaatiotyyppi\\xE4 painamalla ENTER",ariaDropZoneColumnGroupItemDescription:"J\\xE4rjest\\xE4 painamalla ENTER",ariaDropZoneColumnComponentAggFuncSeparator:" kohta ",ariaDropZoneColumnComponentSortAscending:"nouseva",ariaDropZoneColumnComponentSortDescending:"laskeva",ariaLabelDialog:"Dialogi",ariaLabelColumnMenu:"Sarakkeen valikko",ariaLabelColumnFilter:"Sarakkeen suodatin",ariaLabelCellEditor:"Solun muokkaus",ariaLabelSelectField:"Valitse kentt\\xE4",ariaLabelRichSelectField:"Rikas valintakentt\\xE4",ariaLabelRichSelectToggleSelection:"Paina V\\xC4LILY\\xD6NTI\\xC4 vaihtaaksesi valintaa",ariaLabelRichSelectDeselectAllItems:"Paina DELETE poistaaksesi kaikkien kohteiden valinnan",ariaLabelRichSelectDeleteSelection:"Paina DELETE poistaaksesi kohteen valinnan",ariaLabelTooltip:"Vihje",ariaLabelContextMenu:"Kontekstivalikko",ariaLabelSubMenu:"Alivalikko",ariaLabelAggregationFunction:"Aggregointitoiminto",ariaLabelAdvancedFilterAutocomplete:"Edistynyt suodatin automaattinen t\\xE4ydennys",ariaLabelAdvancedFilterBuilderAddField:"Edistynyt suodattimen luonti lis\\xE4\\xE4 kentt\\xE4",ariaLabelAdvancedFilterBuilderColumnSelectField:"Edistynyt suodattimen luonti sarakkeen valintakentt\\xE4",ariaLabelAdvancedFilterBuilderOptionSelectField:"Edistynyt suodattimen luonti vaihtoehdon valintakentt\\xE4",ariaLabelAdvancedFilterBuilderJoinSelectField:"Edistynyt suodattimen luonti liittymisoperaattorin valintakentt\\xE4",ariaColumnPanelList:"Sarakeluettelo",ariaFilterPanelList:"Suodatinluettelo",thousandSeparator:" ",decimalSeparator:",",true:"Totta",false:"V\\xE4\\xE4rin",invalidDate:"Virheellinen p\\xE4iv\\xE4m\\xE4\\xE4r\\xE4",invalidNumber:"Virheellinen numero",january:"Tammikuu",february:"Helmikuu",march:"Maaliskuu",april:"Huhtikuu",may:"Toukokuu",june:"Kes\\xE4';
      S = S + 'kuu",july:"Hein\\xE4kuu",august:"Elokuu",september:"Syyskuu",october:"Lokakuu",november:"Marraskuu",december:"Joulukuu",timeFormatSlashesDDMMYYYY:"PP/KK/VVVV",timeFormatSlashesMMDDYYYY:"KK/PP/VVVV",timeFormatSlashesDDMMYY:"PP/KK/VV",timeFormatSlashesMMDDYY:"KK/PP/VV",timeFormatDotsDDMYY:"PP.K.VV",timeFormatDotsMDDYY:"K.PP.VV",timeFormatDashesYYYYMMDD:"VVVV-KK-PP",timeFormatSpacesDDMMMMYYYY:"PP KKKK VVVV",timeFormatHHMMSS:"HH:MM:SS",timeFormatHHMMSSAmPm:"HH:MM:SS AM/PM"},h={selectAll:"(S\\xE9lectionner tout)",selectAllSearchResults:"(S\\xE9lectionner tous les r\\xE9sultats de recherche)",addCurrentSelectionToFilter:"Ajouter la s\\xE9lection actuelle au filtre",searchOoo:"Chercher...",blanks:"(Vides)",noMatches:"Aucune correspondance",filterOoo:"Filtrer...",equals:"\\xC9gal \\xE0",notEqual:"N\'est pas \\xE9gal \\xE0",blank:"Vide",notBlank:"Non vide",empty:"Choisissez-en un",lessThan:"Moins de",greaterThan:"Plus de",lessThanOrEqual:"Moins de ou \\xE9gal \\xE0",greaterThanOrEqual:"Plus de ou \\xE9gal \\xE0",inRange:"Entre",inRangeStart:"De",inRangeEnd:"\\xC0",contains:"Contient",notContains:"Ne contient pas",startsWith:"Commence par",endsWith:"Se termine par",dateFormatOoo:"yyyy-mm-dd",before:"Avant",after:"Apr\\xE8s",andCondition:"ET",orCondition:"OU",applyFilter:"Appliquer",resetFilter:"R\\xE9initialiser",clearFilter:"Effacer",cancelFilter:"Annuler",textFilter:"Filtre de texte",numberFilter:"Filtre num\\xE9rique",dateFilter:"Filtre de date",setFilter:"Filtre de jeu",groupFilterSelect:"S\\xE9lectionner le champ :",advancedFilterContains:"contient",advancedFilterNotContains:"ne contient pas",advancedFilterTextEquals:"\\xE9gal",advancedFilterTextNotEqual:"n\'est pas \\xE9gal",advancedFilterStartsWith:"commence par",advancedFilterEndsWith:"se termine par",advancedFilterBlank:"est vide",advancedFilterNotBlank:"n\'est pas vide",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanO';
      S = S + 'rEqual:"<=",advancedFilterTrue:"est vrai",advancedFilterFalse:"est faux",advancedFilterAnd:"ET",advancedFilterOr:"OU",advancedFilterApply:"Appliquer",advancedFilterBuilder:"Constructeur",advancedFilterValidationMissingColumn:"La colonne est manquante",advancedFilterValidationMissingOption:"L\'option est manquante",advancedFilterValidationMissingValue:"La valeur est manquante",advancedFilterValidationInvalidColumn:"Colonne non trouv\\xE9e",advancedFilterValidationInvalidOption:"Option non trouv\\xE9e",advancedFilterValidationMissingQuote:"Il manque une guillemet de fin \\xE0 la valeur",advancedFilterValidationNotANumber:"La valeur n\'est pas un nombre",advancedFilterValidationInvalidDate:"La valeur n\'est pas une date valide",advancedFilterValidationMissingCondition:"La condition est manquante",advancedFilterValidationJoinOperatorMismatch:"Les op\\xE9rateurs de jonction au sein d\'une condition doivent \\xEAtre identiques",advancedFilterValidationInvalidJoinOperator:"Op\\xE9rateur de jonction non trouv\\xE9",advancedFilterValidationMissingEndBracket:"Guillemet de fin manquante",advancedFilterValidationExtraEndBracket:"Trop de crochets de fin",advancedFilterValidationMessage:"L\'expression contient une erreur. ${variable} - ${variable}.",advancedFilterValidationMessageAtEnd:"L\'expression contient une erreur. ${variable} \\xE0 la fin de l\'expression.",advancedFilterBuilderTitle:"Filtre Avanc\\xE9",advancedFilterBuilderApply:"Appliquer",advancedFilterBuilderCancel:"Annuler",advancedFilterBuilderAddButtonTooltip:"Ajouter un filtre ou un groupe",advancedFilterBuilderRemoveButtonTooltip:"Supprimer",advancedFilterBuilderMoveUpButtonTooltip:"Monter",advancedFilterBuilderMoveDownButtonTooltip:"Descendre",advancedFilterBuilderAddJoin:"Ajouter un groupe",advancedFilterBuilderAddCondition:"Ajouter un filtre",advancedFilterBuilderSelectColumn:"S\\xE9lectionner une colonne",advancedFilterBuilderSelectOption:"S\\xE9lectionner une option",advancedFilterBuilderEnterValue:"Entrer une valeur...",advan';
      S = S + 'cedFilterBuilderValidationAlreadyApplied:"Le filtre actuel est d\\xE9j\\xE0 appliqu\\xE9.",advancedFilterBuilderValidationIncomplete:"Toutes les conditions ne sont pas remplies.",advancedFilterBuilderValidationSelectColumn:"Vous devez s\\xE9lectionner une colonne.",advancedFilterBuilderValidationSelectOption:"Vous devez s\\xE9lectionner une option.",advancedFilterBuilderValidationEnterValue:"Vous devez entrer une valeur.",columns:"Colonnes",filters:"Filtres",pivotMode:"Mode pivot",groups:"Groupes de lignes",rowGroupColumnsEmptyMessage:"Faites glisser ici pour d\\xE9finir les groupes de lignes",values:"Valeurs",valueColumnsEmptyMessage:"Faites glisser ici pour agr\\xE9ger",pivots:"\\xC9tiquettes de colonnes",pivotColumnsEmptyMessage:"Faites glisser ici pour d\\xE9finir les \\xE9tiquettes de colonnes",group:"Groupe",rowDragRow:"rang",rowDragRows:"rangs",loadingOoo:"Chargement...",loadingError:"ERR",noRowsToShow:"Aucune ligne \\xE0 afficher",enabled:"Activ\\xE9",pinColumn:"\\xC9pingler la colonne",pinLeft:"\\xC9pingler \\xE0 gauche",pinRight:"\\xC9pingler \\xE0 droite",noPin:"Pas d\'\\xE9pingle",valueAggregation:"Agr\\xE9gation de valeur",noAggregation:"Aucun",autosizeThisColumn:"Ajuster automatiquement cette colonne",autosizeAllColumns:"Ajuster automatiquement toutes les colonnes",groupBy:"Grouper par",ungroupBy:"D\\xE9grouper par",ungroupAll:"D\\xE9grouper tout",addToValues:"Ajouter ${variable} aux valeurs",removeFromValues:"Retirer ${variable} des valeurs",addToLabels:"Ajouter ${variable} aux \\xE9tiquettes",removeFromLabels:"Retirer ${variable} des \\xE9tiquettes",resetColumns:"R\\xE9initialiser les colonnes",expandAll:"D\\xE9velopper tous les groupes de lignes",collapseAll:"Fermer tous les groupes de lignes",copy:"Copier",ctrlC:"Ctrl+C",ctrlX:"Ctrl+X",copyWithHeaders:"Copier avec en-t\\xEAtes",copyWithGroupHeaders:"Copier avec en-t\\xEAtes de groupe",cut:"Couper",paste:"Coller",ctrlV:"Ctrl+V",export:"Exporter",csvExport:"Export CSV",excelExport:"Export Excel",columnFilter:"Filtre de colonne"';
      S = S + ',columnChooser:"Choisir les colonnes",sortAscending:"Trier par ordre croissant",sortDescending:"Trier par ordre d\\xE9croissant",sortUnSort:"Effacer le tri",sum:"Somme",first:"Premier",last:"Dernier",min:"Min",max:"Max",none:"Aucun",count:"Nombre",avg:"Moyenne",filteredRows:"Filtr\\xE9",selectedRows:"S\\xE9lectionn\\xE9",totalRows:"Total des Lignes",totalAndFilteredRows:"Lignes",more:"Plus",to:"\\xE0",of:"de",page:"Page",pageLastRowUnknown:"?",nextPage:"Page Suivante",lastPage:"Derni\\xE8re Page",firstPage:"Premi\\xE8re Page",previousPage:"Page Pr\\xE9c\\xE9dente",pageSizeSelectorLabel:"Taille de la Page :",footerTotal:"Total",pivotColumnGroupTotals:"Total",pivotChartAndPivotMode:"Graphique pivot et mode pivot",pivotChart:"Graphique pivot",chartRange:"Plage de graphique",columnChart:"Colonne",groupedColumn:"Group\\xE9",stackedColumn:"Empil\\xE9",normalizedColumn:"100% empil\\xE9",barChart:"Barre",groupedBar:"Group\\xE9",stackedBar:"Empil\\xE9",normalizedBar:"100% empil\\xE9",pieChart:"Camembert",pie:"Camembert",donut:"Donut",line:"Ligne",xyChart:"X Y (Nuage de points)",scatter:"Nuage de points",bubble:"Bulle",areaChart:"Aire",area:"Aire",stackedArea:"Empil\\xE9",normalizedArea:"100% empil\\xE9",histogramChart:"Histogramme",polarChart:"Polaire",radarLine:"Ligne radar",radarArea:"Aire radar",nightingale:"Nightingale",radialColumn:"Colonne radiale",radialBar:"Barre radiale",statisticalChart:"Statistique",boxPlot:"Bo\\xEEte \\xE0 moustaches",rangeBar:"Barre de plage",rangeArea:"Aire de plage",hierarchicalChart:"Hi\\xE9rarchique",treemap:"Arborescence",sunburst:"Rayonnement",specializedChart:"Sp\\xE9cialis\\xE9",waterfall:"Cascade",heatmap:"Carte thermique",combinationChart:"Combinaison",columnLineCombo:"Colonne et ligne",AreaColumnCombo:"Aire et colonne",pivotChartTitle:"Graphique crois\\xE9 dynamique",rangeChartTitle:"Graphique en plage",settings:"Graphique",data:"Configurer",format:"Personnaliser",categories:"Cat\\xE9gories",defaultCategory:"(Aucun)",series:"S\\xE9ries",switchCategorySeries:"';
      S = S + 'Changer Cat\\xE9gorie / S\\xE9ries",categoryValues:"Valeurs de cat\\xE9gorie",seriesLabels:"\\xC9tiquettes de s\\xE9ries",aggregate:"Agr\\xE9gat",xyValues:"Valeurs X Y",paired:"Mode appari\\xE9",axis:"Axe",xAxis:"Axe horizontal",yAxis:"Axe vertical",polarAxis:"Axe polaire",radiusAxis:"Axe de rayon",navigator:"Navigateur",zoom:"Zoom",animation:"Animation",crosshair:"R\\xE9ticule",color:"Couleur",thickness:"\\xC9paisseur",preferredLength:"Longueur pr\\xE9f\\xE9r\\xE9e",xType:"Type X",axisType:"Type d\'axe",automatic:"Automatique",category:"Cat\\xE9gorie",number:"Nombre",time:"Temps",timeFormat:"Format de temps",autoRotate:"Rotation auto",labelRotation:"Rotation",circle:"Cercle",polygon:"Polygone",square:"Carr\\xE9",cross:"Croix",diamond:"Diamant",plus:"Plus",triangle:"Triangle",heart:"C\\u0153ur",orientation:"Orientation",fixed:"Fix\\xE9",parallel:"Parall\\xE8le",perpendicular:"Perpendiculaire",radiusAxisPosition:"Position",ticks:"Graduations",gridLines:"Lignes de grille",width:"Largeur",height:"Hauteur",length:"Longueur",padding:"Rembourrage",spacing:"Espacement",chartStyle:"Style de graphique",title:"Titre",chartTitles:"Titres",chartTitle:"Titre du graphique",chartSubtitle:"Sous-titre",horizontalAxisTitle:"Titre de l\'axe horizontal",verticalAxisTitle:"Titre de l\'axe vertical",polarAxisTitle:"Titre de l\'axe polaire",titlePlaceholder:"Titre du graphique",background:"Arri\\xE8re-plan",font:"Police",weight:"Poids",top:"Haut",right:"Droite",bottom:"Bas",left:"Gauche",labels:"\\xC9tiquettes",calloutLabels:"\\xC9tiquettes d\'appel",sectorLabels:"\\xC9tiquettes de secteur",positionRatio:"Ratio de position",size:"Taille",shape:"Forme",minSize:"Taille minimum",maxSize:"Taille maximum",legend:"L\\xE9gende",position:"Position",markerSize:"Taille du marqueur",markerStroke:"Contour du marqueur",markerPadding:"Rembourrage du marqueur",itemSpacing:"Espacement des \\xE9l\\xE9ments",itemPaddingX:"Rembourrage d\'\\xE9l\\xE9ment X",itemPaddingY:"Rembourrage d\'\\xE9l\\xE9ment Y",layoutHorizontalSpacing:"Espacement ho';
      S = S + 'rizontal",layoutVerticalSpacing:"Espacement vertical",strokeWidth:"\\xC9paisseur du trait",offset:"D\\xE9calage",offsets:"D\\xE9calages",tooltips:"Info-bulles",callout:"Appel",markers:"Marqueurs",shadow:"Ombre",blur:"Flou",xOffset:"D\\xE9calage X",yOffset:"D\\xE9calage Y",lineWidth:"\\xC9paisseur de la ligne",lineDash:"Tirets de la ligne",lineDashOffset:"D\\xE9calage des tirets",scrollingZoom:"D\\xE9filement",scrollingStep:"\\xC9tape de d\\xE9filement",selectingZoom:"S\\xE9lection",durationMillis:"Dur\\xE9e (ms)",crosshairLabel:"\\xC9tiquette",crosshairSnap:"Accrocher au n\\u0153ud",normal:"Normal",bold:"Gras",italic:"Italique",boldItalic:"Gras Italique",predefined:"Pr\\xE9d\\xE9fini",fillOpacity:"Opacit\\xE9 de remplissage",strokeColor:"Couleur du trait",strokeOpacity:"Opacit\\xE9 du trait",miniChart:"Mini-Graphique",histogramBinCount:"Nombre de bins",connectorLine:"Ligne de connexion",seriesItems:"\\xC9l\\xE9ments de s\\xE9rie",seriesItemType:"Type d\'\\xE9l\\xE9ment",seriesItemPositive:"Positif",seriesItemNegative:"N\\xE9gatif",seriesItemLabels:"\\xC9tiquettes d\'\\xE9l\\xE9ments",columnGroup:"Colonne",barGroup:"Barre",pieGroup:"Camembert",lineGroup:"Ligne",scatterGroup:"X Y (Nuage de points)",areaGroup:"Zone",polarGroup:"Polaire",statisticalGroup:"Statistique",hierarchicalGroup:"Hi\\xE9rarchique",specializedGroup:"Sp\\xE9cialis\\xE9",combinationGroup:"Combinaison",groupedColumnTooltip:"Groupe",stackedColumnTooltip:"Empil\\xE9",normalizedColumnTooltip:"100% Empil\\xE9",groupedBarTooltip:"Groupe",stackedBarTooltip:"Empil\\xE9",normalizedBarTooltip:"100% Empil\\xE9",pieTooltip:"Camembert",donutTooltip:"Donut",lineTooltip:"Ligne",groupedAreaTooltip:"Zone",stackedAreaTooltip:"Empil\\xE9",normalizedAreaTooltip:"100% Empil\\xE9",scatterTooltip:"Nuage de points",bubbleTooltip:"Bulle",histogramTooltip:"Histogramme",radialColumnTooltip:"Colonne radiale",radialBarTooltip:"Barre radiale",radarLineTooltip:"Ligne radar",radarAreaTooltip:"Zone radar",nightingaleTooltip:"Nightingale",rangeBarTooltip:"Barre de plage';
      S = S + '",rangeAreaTooltip:"Zone de plage",boxPlotTooltip:"Bo\\xEEte \\xE0 moustaches",treemapTooltip:"Treemap",sunburstTooltip:"Rayon de soleil",waterfallTooltip:"Chute d\'eau",heatmapTooltip:"Carte thermique",columnLineComboTooltip:"Colonne & Ligne",areaColumnComboTooltip:"Zone & Colonne",customComboTooltip:"Combinaison Personnalis\\xE9e",innerRadius:"Rayon int\\xE9rieur",startAngle:"Angle de d\\xE9part",endAngle:"Angle de fin",reverseDirection:"Inverser la direction",groupPadding:"Rembourrage de groupe",seriesPadding:"Rembourrage de s\\xE9ries",tile:"Tuile",whisker:"Moustache",cap:"Capuchon",capLengthRatio:"Ratio de longueur",labelPlacement:"Placement",inside:"\\xC0 l\'int\\xE9rieur",outside:"\\xC0 l\'ext\\xE9rieur",noDataToChart:"Aucune donn\\xE9e disponible \\xE0 afficher.",pivotChartRequiresPivotMode:"Le graphique crois\\xE9 dynamique n\\xE9cessite le mode crois\\xE9 activ\\xE9.",chartSettingsToolbarTooltip:"Menu",chartLinkToolbarTooltip:"Li\\xE9 \\xE0 la grille",chartUnlinkToolbarTooltip:"D\\xE9tach\\xE9 de la grille",chartDownloadToolbarTooltip:"T\\xE9l\\xE9charger le graphique",chartMenuToolbarTooltip:"Menu",chartEdit:"Modifier le graphique",chartAdvancedSettings:"Param\\xE8tres avanc\\xE9s",chartLink:"Lier \\xE0 la grille",chartUnlink:"D\\xE9tacher de la grille",chartDownload:"T\\xE9l\\xE9charger le graphique",histogramFrequency:"Fr\\xE9quence",seriesChartType:"Type de graphique de s\\xE9ries",seriesType:"Type de s\\xE9rie",secondaryAxis:"Axe secondaire",seriesAdd:"Ajouter une s\\xE9rie",categoryAdd:"Ajouter une cat\\xE9gorie",bar:"Barre",column:"Colonne",histogram:"Histogramme",advancedSettings:"Param\\xE8tres avanc\\xE9s",direction:"Direction",horizontal:"Horizontal",vertical:"Vertical",seriesGroupType:"Type de groupe",groupedSeriesGroupType:"Group\\xE9",stackedSeriesGroupType:"Empil\\xE9",normalizedSeriesGroupType:"100% Empil\\xE9",legendEnabled:"Activ\\xE9",invalidColor:"La valeur de couleur est invalide",groupedColumnFull:"Colonne group\\xE9e",stackedColumnFull:"Colonne empil\\xE9e",normalizedColumnFul';
      S = S + 'l:"Colonne 100% empil\\xE9e",groupedBarFull:"Barre group\\xE9e",stackedBarFull:"Barre empil\\xE9e",normalizedBarFull:"Barre 100% empil\\xE9e",stackedAreaFull:"Zone empil\\xE9e",normalizedAreaFull:"Zone 100% empil\\xE9e",customCombo:"Combinaison personnalis\\xE9e",ariaAdvancedFilterBuilderItem:"${variable}. Niveau ${variable}. Appuyez sur ENTER pour \\xE9diter.",ariaAdvancedFilterBuilderItemValidation:"${variable}. Niveau ${variable}. ${variable} Appuyez sur ENTER pour \\xE9diter.",ariaAdvancedFilterBuilderList:"Liste de cadre de filtre avanc\\xE9",ariaAdvancedFilterBuilderFilterItem:"Condition de filtre",ariaAdvancedFilterBuilderGroupItem:"Groupe de filtre",ariaAdvancedFilterBuilderColumn:"Colonne",ariaAdvancedFilterBuilderOption:"Option",ariaAdvancedFilterBuilderValueP:"Valeur",ariaAdvancedFilterBuilderJoinOperator:"Op\\xE9rateur de jonction",ariaAdvancedFilterInput:"Entr\\xE9e de filtre avanc\\xE9",ariaChecked:"coch\\xE9",ariaColumn:"Colonne",ariaColumnGroup:"Groupe de colonnes",ariaColumnFiltered:"Colonne filtr\\xE9e",ariaColumnSelectAll:"Basculer la s\\xE9lection de toutes les colonnes",ariaDateFilterInput:"Entr\\xE9e de filtre de date",ariaDefaultListName:"Liste",ariaFilterColumnsInput:"Entr\\xE9e de filtre de colonnes",ariaFilterFromValue:"Filtrer depuis la valeur",ariaFilterInput:"Entr\\xE9e de filtre",ariaFilterList:"Liste de filtres",ariaFilterToValue:"Filtrer jusqu\'\\xE0 la valeur",ariaFilterValue:"Valeur du filtre",ariaFilterMenuOpen:"Ouvrir le menu de filtre",ariaFilteringOperator:"Op\\xE9rateur de filtrage",ariaHidden:"cach\\xE9",ariaIndeterminate:"ind\\xE9termin\\xE9",ariaInputEditor:"\\xC9diteur d\'entr\\xE9e",ariaMenuColumn:"Appuyez sur ALT BAS pour ouvrir le menu de colonne",ariaFilterColumn:"Appuyez sur CTRL ENTER pour ouvrir le filtre",ariaRowDeselect:"Appuyez sur ESPACE pour d\\xE9s\\xE9lectionner cette ligne",ariaRowSelectAll:"Appuyez sur ESPACE pour basculer la s\\xE9lection de toutes les lignes",ariaRowToggleSelection:"Appuyez sur ESPACE pour basculer la s\\xE9lection de la';
      S = S + ' ligne",ariaRowSelect:"Appuyez sur ESPACE pour s\\xE9lectionner cette ligne",ariaRowSelectionDisabled:"La s\\xE9lection de lignes est d\\xE9sactiv\\xE9e pour cette ligne",ariaSearch:"Rechercher",ariaSortableColumn:"Appuyez sur ENTER pour trier",ariaToggleVisibility:"Appuyez sur ESPACE pour basculer la visibilit\\xE9",ariaToggleCellValue:"Appuyez sur ESPACE pour basculer la valeur de la cellule",ariaUnchecked:"non coch\\xE9",ariaVisible:"visible",ariaSearchFilterValues:"Rechercher les valeurs de filtre",ariaPageSizeSelectorLabel:"Taille de page",ariaChartMenuClose:"Fermer le menu d\'\\xE9dition de graphique",ariaChartSelected:"S\\xE9lectionn\\xE9",ariaSkeletonCellLoadingFailed:"Le chargement de la ligne a \\xE9chou\\xE9",ariaSkeletonCellLoading:"Les donn\\xE9es de la ligne sont en cours de chargement",ariaRowGroupDropZonePanelLabel:"Groupes de lignes",ariaValuesDropZonePanelLabel:"Valeurs",ariaPivotDropZonePanelLabel:"\\xC9tiquettes de colonnes",ariaDropZoneColumnComponentDescription:"Appuyez sur SUPPRIMER pour enlever",ariaDropZoneColumnValueItemDescription:"Appuyez sur ENTR\\xC9E pour changer le type d\'agr\\xE9gation",ariaDropZoneColumnGroupItemDescription:"Appuyez sur ENTR\\xC9E pour trier",ariaDropZoneColumnComponentAggFuncSeparator:" de ",ariaDropZoneColumnComponentSortAscending:"ascendant",ariaDropZoneColumnComponentSortDescending:"descendant",ariaLabelDialog:"Dialogue",ariaLabelColumnMenu:"Menu de colonne",ariaLabelColumnFilter:"Filtre de colonne",ariaLabelCellEditor:"\\xC9diteur de cellule",ariaLabelSelectField:"Champ de s\\xE9lection",ariaLabelRichSelectField:"Champ de s\\xE9lection enrichie",ariaLabelRichSelectToggleSelection:"Appuyez sur ESPACE pour basculer la s\\xE9lection",ariaLabelRichSelectDeselectAllItems:"Appuyez sur SUPPRIMER pour d\\xE9s\\xE9lectionner tous les \\xE9l\\xE9ments",ariaLabelRichSelectDeleteSelection:"Appuyez sur SUPPRIMER pour d\\xE9s\\xE9lectionner l\'\\xE9l\\xE9ment",ariaLabelTooltip:"Info-bulle",ariaLabelContextMenu:"Menu contextuel",ariaLabelSubMenu:"Sous-men';
      S = S + 'u",ariaLabelAggregationFunction:"Fonction d\'agr\\xE9gation",ariaLabelAdvancedFilterAutocomplete:"Filtre avanc\\xE9 auto-compl\\xE9tion",ariaLabelAdvancedFilterBuilderAddField:"Filtre avanc\\xE9 constructeur Ajouter un champ",ariaLabelAdvancedFilterBuilderColumnSelectField:"Filtre avanc\\xE9 constructeur S\\xE9lectionnez le champ de colonne",ariaLabelAdvancedFilterBuilderOptionSelectField:"Filtre avanc\\xE9 constructeur S\\xE9lectionnez le champ d\'option",ariaLabelAdvancedFilterBuilderJoinSelectField:"Filtre avanc\\xE9 constructeur S\\xE9lectionnez le champ de l\'op\\xE9rateur de jointure",ariaColumnPanelList:"Liste des colonnes",ariaFilterPanelList:"Liste des filtres",thousandSeparator:",",decimalSeparator:".",true:"Vrai",false:"Faux",invalidDate:"Date invalide",invalidNumber:"Nombre invalide",january:"Janvier",february:"F\\xE9vrier",march:"Mars",april:"Avril",may:"Mai",june:"Juin",july:"Juillet",august:"Ao\\xFBt",september:"Septembre",october:"Octobre",november:"Novembre",december:"D\\xE9cembre",timeFormatSlashesDDMMYYYY:"JJ/MM/AAAA",timeFormatSlashesMMDDYYYY:"MM/JJ/AAAA",timeFormatSlashesDDMMYY:"JJ/MM/AA",timeFormatSlashesMMDDYY:"MM/JJ/AA",timeFormatDotsDDMYY:"JJ.M.AA",timeFormatDotsMDDYY:"M.JJ.AA",timeFormatDashesYYYYMMDD:"AAAA-MM-JJ",timeFormatSpacesDDMMMMYYYY:"JJ MMMM AAAA",timeFormatHHMMSS:"HH:MM:SS",timeFormatHHMMSSAmPm:"HH:MM:SS AM/PM"},b={selectAll:"(\\u05D1\\u05D7\\u05E8 \\u05D4\\u05DB\\u05DC)",selectAllSearchResults:"(\\u05D1\\u05D7\\u05E8 \\u05D0\\u05EA \\u05DB\\u05DC \\u05EA\\u05D5\\u05E6\\u05D0\\u05D5\\u05EA \\u05D4\\u05D7\\u05D9\\u05E4\\u05D5\\u05E9)",addCurrentSelectionToFilter:"\\u05D4\\u05D5\\u05E1\\u05E3 \\u05D0\\u05EA \\u05D4\\u05D1\\u05D7\\u05D9\\u05E8\\u05D4 \\u05D4\\u05E0\\u05D5\\u05DB\\u05D7\\u05D9\\u05EA \\u05DC\\u05E1\\u05D9\\u05E0\\u05D5\\u05DF",searchOoo:"\\u05D7\\u05E4\\u05E9...",blanks:"(\\u05E8\\u05D9\\u05E7\\u05D9\\u05DD)",noMatches:"\\u05D0\\u05D9\\u05DF \\u05D4\\u05EA\\u05D0\\u05DE\\u05D5\\u05EA",filterOoo:"\\u05E1\\u05D9\\u05E0\\u05D5\\u05DF...",equals:"\\u05E9\\u05D5\\u05D5\\u05D4",notEqual:"\\u05DC\\u05D0 \\u05E9\\u05D5\\u0';
      S = S + '5D5\\u05D4",blank:"\\u05E8\\u05D9\\u05E7",notBlank:"\\u05DC\\u05D0 \\u05E8\\u05D9\\u05E7",empty:"\\u05D1\\u05D7\\u05E8 \\u05D0\\u05D7\\u05D3",lessThan:"\\u05E4\\u05D7\\u05D5\\u05EA \\u05DE",greaterThan:"\\u05D9\\u05D5\\u05EA\\u05E8 \\u05DE",lessThanOrEqual:"\\u05E4\\u05D7\\u05D5\\u05EA \\u05D0\\u05D5 \\u05E9\\u05D5\\u05D5\\u05D4 \\u05DC",greaterThanOrEqual:"\\u05D9\\u05D5\\u05EA\\u05E8 \\u05D0\\u05D5 \\u05E9\\u05D5\\u05D5\\u05D4 \\u05DC",inRange:"\\u05D1\\u05D9\\u05DF",inRangeStart:"\\u05DE",inRangeEnd:"\\u05E2\\u05D3",contains:"\\u05DE\\u05DB\\u05D9\\u05DC",notContains:"\\u05D0\\u05D9\\u05E0\\u05D5 \\u05DE\\u05DB\\u05D9\\u05DC",startsWith:"\\u05DE\\u05EA\\u05D7\\u05D9\\u05DC \\u05D1",endsWith:"\\u05DE\\u05E1\\u05EA\\u05D9\\u05D9\\u05DD \\u05D1",dateFormatOoo:"yyyy-mm-dd",before:"\\u05DC\\u05E4\\u05E0\\u05D9",after:"\\u05D0\\u05D7\\u05E8\\u05D9",andCondition:"\\u05D5\\u05D2\\u05DD",orCondition:"\\u05D0\\u05D5",applyFilter:"\\u05D4\\u05D7\\u05DC",resetFilter:"\\u05D0\\u05E4\\u05E1",clearFilter:"\\u05E0\\u05E7\\u05D4",cancelFilter:"\\u05D1\\u05D8\\u05DC",textFilter:"\\u05DE\\u05E1\\u05E0\\u05DF \\u05D8\\u05E7\\u05E1\\u05D8",numberFilter:"\\u05DE\\u05E1\\u05E0\\u05DF \\u05DE\\u05E1\\u05E4\\u05E8",dateFilter:"\\u05DE\\u05E1\\u05E0\\u05DF \\u05EA\\u05D0\\u05E8\\u05D9\\u05DA",setFilter:"\\u05DE\\u05E1\\u05E0\\u05DF \\u05E1\\u05D8",groupFilterSelect:"\\u05D1\\u05D7\\u05E8 \\u05E9\\u05D3\\u05D4:",advancedFilterContains:"\\u05DE\\u05DB\\u05D9\\u05DC",advancedFilterNotContains:"\\u05DC\\u05D0 \\u05DE\\u05DB\\u05D9\\u05DC",advancedFilterTextEquals:"\\u05E9\\u05D5\\u05D5\\u05D4 \\u05DC",advancedFilterTextNotEqual:"\\u05DC\\u05D0 \\u05E9\\u05D5\\u05D5\\u05D4 \\u05DC",advancedFilterStartsWith:"\\u05DE\\u05EA\\u05D7\\u05D9\\u05DC \\u05D1",advancedFilterEndsWith:"\\u05DE\\u05E1\\u05EA\\u05D9\\u05D9\\u05DD \\u05D1",advancedFilterBlank:"\\u05E8\\u05D9\\u05E7",advancedFilterNotBlank:"\\u05DC\\u05D0 \\u05E8\\u05D9\\u05E7",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"\\u05D0\\u05DE\\u05EA",advancedFilterFalse:"\\u0';
      S = S + '5E9\\u05E7\\u05E8",advancedFilterAnd:"\\u05D5\\u05D2\\u05DD",advancedFilterOr:"\\u05D0\\u05D5",advancedFilterApply:"\\u05D4\\u05D7\\u05DC",advancedFilterBuilder:"\\u05D1\\u05D5\\u05E0\\u05D4",advancedFilterValidationMissingColumn:"\\u05E2\\u05DE\\u05D5\\u05D3\\u05D4 \\u05D7\\u05E1\\u05E8\\u05D4",advancedFilterValidationMissingOption:"\\u05D0\\u05E4\\u05E9\\u05E8\\u05D5\\u05EA \\u05D7\\u05E1\\u05E8\\u05D4",advancedFilterValidationMissingValue:"\\u05E2\\u05E8\\u05DA \\u05D7\\u05E1\\u05E8",advancedFilterValidationInvalidColumn:"\\u05E2\\u05DE\\u05D5\\u05D3\\u05D4 \\u05DC\\u05D0 \\u05E0\\u05DE\\u05E6\\u05D0\\u05D4",advancedFilterValidationInvalidOption:"\\u05D0\\u05E4\\u05E9\\u05E8\\u05D5\\u05EA \\u05DC\\u05D0 \\u05E0\\u05DE\\u05E6\\u05D0\\u05D4",advancedFilterValidationMissingQuote:"\\u05DC\\u05E2\\u05E8\\u05DA \\u05D7\\u05E1\\u05E8 \\u05E6\\u05D9\\u05D8\\u05D5\\u05D8 \\u05E1\\u05D9\\u05D5\\u05DD",advancedFilterValidationNotANumber:"\\u05D4\\u05E2\\u05E8\\u05DA \\u05D0\\u05D9\\u05E0\\u05D5 \\u05DE\\u05E1\\u05E4\\u05E8",advancedFilterValidationInvalidDate:"\\u05D4\\u05E2\\u05E8\\u05DA \\u05D0\\u05D9\\u05E0\\u05D5 \\u05EA\\u05D0\\u05E8\\u05D9\\u05DA \\u05D7\\u05D5\\u05E7\\u05D9",advancedFilterValidationMissingCondition:"\\u05D7\\u05E1\\u05E8 \\u05EA\\u05E0\\u05D0\\u05D9",advancedFilterValidationJoinOperatorMismatch:"\\u05D4\\u05DE\\u05E4\\u05E2\\u05D9\\u05DC\\u05D9\\u05DD \\u05D1\\u05EA\\u05E0\\u05D0\\u05D9 \\u05D7\\u05D9\\u05D9\\u05D1\\u05D9\\u05DD \\u05DC\\u05D4\\u05D9\\u05D5\\u05EA \\u05D0\\u05D5\\u05EA\\u05D5 \\u05D3\\u05D1\\u05E8",advancedFilterValidationInvalidJoinOperator:"\\u05D0\\u05D5\\u05E4\\u05E8\\u05D8\\u05D5\\u05E8 \\u05E6\\u05E8\\u05D5\\u05E3 \\u05DC\\u05D0 \\u05E0\\u05DE\\u05E6\\u05D0",advancedFilterValidationMissingEndBracket:"\\u05D7\\u05E1\\u05E8 \\u05E1\\u05D5\\u05D2\\u05E8 \\u05E1\\u05D9\\u05D5\\u05DD",advancedFilterValidationExtraEndBracket:"\\u05D9\\u05D5\\u05EA\\u05E8 \\u05DE\\u05D3\\u05D9 \\u05E1\\u05D5\\u05D2\\u05E8\\u05D9 \\u05E1\\u05D9\\u05D5\\u05DD",advancedFilterValidationMessage:"\\u05D9\\u05E9 \\u05E9\\u05D2\\u05D9\\u05D0\\u05D4 \\u05D1\\u05D1\\u05D9\\u05D8\\u05D5\\u05D9. ${variable} - ${variable}.",advancedFilterValidationMessageAtEnd:"\\u';
      S = S + '05D9\\u05E9 \\u05E9\\u05D2\\u05D9\\u05D0\\u05D4 \\u05D1\\u05D1\\u05D9\\u05D8\\u05D5\\u05D9. ${variable} \\u05D1\\u05E1\\u05D5\\u05E3 \\u05D4\\u05D1\\u05D9\\u05D8\\u05D5\\u05D9.",advancedFilterBuilderTitle:"\\u05DE\\u05E1\\u05E0\\u05DF \\u05DE\\u05EA\\u05E7\\u05D3\\u05DD",advancedFilterBuilderApply:"\\u05D4\\u05D7\\u05DC",advancedFilterBuilderCancel:"\\u05D1\\u05D8\\u05DC",advancedFilterBuilderAddButtonTooltip:"\\u05D4\\u05D5\\u05E1\\u05E3 \\u05DE\\u05E1\\u05E0\\u05DF \\u05D0\\u05D5 \\u05E7\\u05D1\\u05D5\\u05E6\\u05D4",advancedFilterBuilderRemoveButtonTooltip:"\\u05D4\\u05E1\\u05E8",advancedFilterBuilderMoveUpButtonTooltip:"\\u05D4\\u05E2\\u05D1\\u05E8 \\u05DE\\u05E2\\u05DC\\u05D4",advancedFilterBuilderMoveDownButtonTooltip:"\\u05D4\\u05E2\\u05D1\\u05E8 \\u05DE\\u05D8\\u05D4",advancedFilterBuilderAddJoin:"\\u05D4\\u05D5\\u05E1\\u05E3 \\u05E7\\u05D1\\u05D5\\u05E6\\u05D4",advancedFilterBuilderAddCondition:"\\u05D4\\u05D5\\u05E1\\u05E3 \\u05DE\\u05E1\\u05E0\\u05DF",advancedFilterBuilderSelectColumn:"\\u05D1\\u05D7\\u05E8 \\u05E2\\u05DE\\u05D5\\u05D3\\u05D4",advancedFilterBuilderSelectOption:"\\u05D1\\u05D7\\u05E8 \\u05D0\\u05E4\\u05E9\\u05E8\\u05D5\\u05EA",advancedFilterBuilderEnterValue:"\\u05D4\\u05DB\\u05E0\\u05E1 \\u05E2\\u05E8\\u05DA...",advancedFilterBuilderValidationAlreadyApplied:"\\u05D4\\u05DE\\u05E1\\u05E0\\u05DF \\u05D4\\u05E0\\u05D5\\u05DB\\u05D7\\u05D9 \\u05DB\\u05D1\\u05E8 \\u05D4\\u05D5\\u05D7\\u05DC.",advancedFilterBuilderValidationIncomplete:"\\u05DC\\u05D0 \\u05DB\\u05DC \\u05D4\\u05EA\\u05E0\\u05D0\\u05D9\\u05DD \\u05D4\\u05D5\\u05E9\\u05DC\\u05DE\\u05D5.",advancedFilterBuilderValidationSelectColumn:"\\u05D7\\u05D5\\u05D1\\u05D4 \\u05DC\\u05D1\\u05D7\\u05D5\\u05E8 \\u05E2\\u05DE\\u05D5\\u05D3\\u05D4.",advancedFilterBuilderValidationSelectOption:"\\u05D7\\u05D5\\u05D1\\u05D4 \\u05DC\\u05D1\\u05D7\\u05D5\\u05E8 \\u05D0\\u05E4\\u05E9\\u05E8\\u05D5\\u05EA.",advancedFilterBuilderValidationEnterValue:"\\u05D7\\u05D5\\u05D1\\u05D4 \\u05DC\\u05D4\\u05D6\\u05D9\\u05DF \\u05E2\\u05E8\\u05DA.",columns:"\\u05E2\\u05DE\\u05D5\\u05D3\\u05D5\\u05EA",filters:"\\u05DE\\u05E1\\u05E0\\u05E0\\u05D9\\u05DD",pivotMode:"\\u05DE\\u05E6\\u05D1 \\u05E1\\u05D9\\u05DB\\u05D5\\u05';
      S = S + 'DD",groups:"\\u05E7\\u05D1\\u05D5\\u05E6\\u05D5\\u05EA \\u05E9\\u05D5\\u05E8\\u05D5\\u05EA",rowGroupColumnsEmptyMessage:"\\u05D2\\u05E8\\u05D5\\u05E8 \\u05DC\\u05DB\\u05D0\\u05DF \\u05DB\\u05D3\\u05D9 \\u05DC\\u05D4\\u05D2\\u05D3\\u05D9\\u05E8 \\u05E7\\u05D1\\u05D5\\u05E6\\u05D5\\u05EA \\u05E9\\u05D5\\u05E8\\u05D5\\u05EA",values:"\\u05E2\\u05E8\\u05DB\\u05D9\\u05DD",valueColumnsEmptyMessage:"\\u05D2\\u05E8\\u05D5\\u05E8 \\u05DC\\u05DB\\u05D0\\u05DF \\u05DB\\u05D3\\u05D9 \\u05DC\\u05D1\\u05E6\\u05E2 \\u05D7\\u05D9\\u05E9\\u05D5\\u05D1",pivots:"\\u05EA\\u05D5\\u05D5\\u05D9\\u05D5\\u05EA \\u05E2\\u05DE\\u05D5\\u05D3\\u05D5\\u05EA",pivotColumnsEmptyMessage:"\\u05D2\\u05E8\\u05D5\\u05E8 \\u05DC\\u05DB\\u05D0\\u05DF \\u05DB\\u05D3\\u05D9 \\u05DC\\u05D4\\u05D2\\u05D3\\u05D9\\u05E8 \\u05EA\\u05D5\\u05D5\\u05D9\\u05D5\\u05EA \\u05E2\\u05DE\\u05D5\\u05D3\\u05D5\\u05EA",group:"\\u05E7\\u05D1\\u05D5\\u05E6\\u05D4",rowDragRow:"\\u05E9\\u05D5\\u05E8\\u05D4",rowDragRows:"\\u05E9\\u05D5\\u05E8\\u05D5\\u05EA",loadingOoo:"\\u05D8\\u05D5\\u05E2\\u05DF...",loadingError:"\\u05E9\\u05D2\\u05D9\\u05D0\\u05D4",noRowsToShow:"\\u05D0\\u05D9\\u05DF \\u05E9\\u05D5\\u05E8\\u05D5\\u05EA \\u05DC\\u05D4\\u05E6\\u05D9\\u05D2",enabled:"\\u05DE\\u05D5\\u05E4\\u05E2\\u05DC",pinColumn:"\\u05E0\\u05E2\\u05DC \\u05E2\\u05DE\\u05D5\\u05D3\\u05D4",pinLeft:"\\u05E0\\u05E2\\u05DC \\u05DC\\u05E9\\u05DE\\u05D0\\u05DC",pinRight:"\\u05E0\\u05E2\\u05DC \\u05DC\\u05D9\\u05DE\\u05D9\\u05DF",noPin:"\\u05DC\\u05DC\\u05D0 \\u05E0\\u05E2\\u05D9\\u05DC\\u05D4",valueAggregation:"\\u05E6\\u05D1\\u05D9\\u05E8\\u05D4 \\u05E2\\u05E8\\u05DB\\u05D9\\u05EA",noAggregation:"\\u05DC\\u05DC\\u05D0",autosizeThisColumn:"\\u05DB\\u05D5\\u05D5\\u05E0\\u05D5\\u05DF \\u05D0\\u05D5\\u05D8\\u05D5\\u05DE\\u05D8\\u05D9 \\u05E9\\u05DC \\u05E2\\u05DE\\u05D5\\u05D3\\u05D4 \\u05D6\\u05D5",autosizeAllColumns:"\\u05DB\\u05D5\\u05D5\\u05E0\\u05D5\\u05DF \\u05D0\\u05D5\\u05D8\\u05D5\\u05DE\\u05D8\\u05D9 \\u05E9\\u05DC \\u05DB\\u05DC \\u05D4\\u05E2\\u05DE\\u05D5\\u05D3\\u05D5\\u05EA",groupBy:"\\u05E7\\u05D1\\u05E5 \\u05DC\\u05E4\\u05D9",ungroupBy:"\\u05D1\\u05D8\\u05DC \\u05E7\\u05D9\\u05D1\\u05D5\\u05E5 \\u05DC\\u05E4\\u05D9",ungroupAll:"\\u05D1\\u05D8\\u05DC \\u05E7\\u05D9\\u05D1\\u05D5\\u05E5 \\u05E9\\u05D';
      S = S + 'C \\u05D4\\u05DB\\u05D5\\u05DC",addToValues:"\\u05D4\\u05D5\\u05E1\\u05E3 \\u05D0\\u05EA ${variable} \\u05DC\\u05E2\\u05E8\\u05DB\\u05D9\\u05DD",removeFromValues:"\\u05D4\\u05E1\\u05E8 \\u05D0\\u05EA ${variable} \\u05DE\\u05D4\\u05E2\\u05E8\\u05DB\\u05D9\\u05DD",addToLabels:"\\u05D4\\u05D5\\u05E1\\u05E3 \\u05D0\\u05EA ${variable} \\u05DC\\u05EA\\u05D5\\u05D5\\u05D9\\u05D5\\u05EA",removeFromLabels:"\\u05D4\\u05E1\\u05E8 \\u05D0\\u05EA ${variable} \\u05DE\\u05D4\\u05EA\\u05D5\\u05D5\\u05D9\\u05D5\\u05EA",resetColumns:"\\u05D0\\u05E4\\u05E1 \\u05E2\\u05DE\\u05D5\\u05D3\\u05D5\\u05EA",expandAll:"\\u05D4\\u05E8\\u05D7\\u05D1 \\u05D0\\u05EA \\u05DB\\u05DC \\u05E7\\u05D1\\u05D5\\u05E6\\u05D5\\u05EA \\u05D4\\u05E9\\u05D5\\u05E8\\u05D5\\u05EA",collapseAll:"\\u05E1\\u05D2\\u05D5\\u05E8 \\u05D0\\u05EA \\u05DB\\u05DC \\u05E7\\u05D1\\u05D5\\u05E6\\u05D5\\u05EA \\u05D4\\u05E9\\u05D5\\u05E8\\u05D5\\u05EA",copy:"\\u05D4\\u05E2\\u05EA\\u05E7",ctrlC:"Ctrl+C",ctrlX:"Ctrl+X",copyWithHeaders:"\\u05D4\\u05E2\\u05EA\\u05E7 \\u05E2\\u05DD \\u05DB\\u05D5\\u05EA\\u05E8\\u05D5\\u05EA",copyWithGroupHeaders:"\\u05D4\\u05E2\\u05EA\\u05E7 \\u05E2\\u05DD \\u05DB\\u05D5\\u05EA\\u05E8\\u05D5\\u05EA \\u05E7\\u05D1\\u05D5\\u05E6\\u05D4",cut:"\\u05D2\\u05D6\\u05D5\\u05E8",paste:"\\u05D4\\u05D3\\u05D1\\u05E7",ctrlV:"Ctrl+V",export:"\\u05D9\\u05D9\\u05E6\\u05D5\\u05D0",csvExport:"\\u05D9\\u05D9\\u05E6\\u05D5\\u05D0 CSV",excelExport:"\\u05D9\\u05D9\\u05E6\\u05D5\\u05D0 Excel",columnFilter:"\\u05E1\\u05D9\\u05E0\\u05D5\\u05DF \\u05E2\\u05DE\\u05D5\\u05D3\\u05D4",columnChooser:"\\u05D1\\u05D7\\u05E8 \\u05E2\\u05DE\\u05D5\\u05D3\\u05D5\\u05EA",sortAscending:"\\u05DE\\u05D9\\u05D9\\u05DF \\u05D1\\u05E1\\u05D3\\u05E8 \\u05E2\\u05D5\\u05DC\\u05D4",sortDescending:"\\u05DE\\u05D9\\u05D9\\u05DF \\u05D1\\u05E1\\u05D3\\u05E8 \\u05D9\\u05D5\\u05E8\\u05D3",sortUnSort:"\\u05E0\\u05E7\\u05D4 \\u05DE\\u05D9\\u05D5\\u05DF",sum:"\\u05E1\\u05DB\\u05D5\\u05DD",first:"\\u05E8\\u05D0\\u05E9\\u05D5\\u05DF",last:"\\u05D0\\u05D7\\u05E8\\u05D5\\u05DF",min:"\\u05DE\\u05D9\\u05E0",max:"\\u05DE\\u05E7\\u05E1",none:"\\u05D0\\u05D9\\u05DF",count:"\\u05E1\\u05E4\\u05D9\\u05E8\\u05D4",avg:"\\u05DE\\u05DE\\u05D5\\u05E6\\u05E2",filteredRows:"\\u05DE\\u05E1\\u05D5\\u05E0\\u05DF",sel';
      S = S + 'ectedRows:"\\u05E0\\u05D1\\u05D7\\u05E8",totalRows:\'\\u05E1\\u05D4"\\u05DB \\u05E9\\u05D5\\u05E8\\u05D5\\u05EA\',totalAndFilteredRows:"\\u05E9\\u05D5\\u05E8\\u05D5\\u05EA",more:"\\u05E2\\u05D5\\u05D3",to:"\\u05D0\\u05DC",of:"\\u05E9\\u05DC",page:"\\u05D3\\u05E3",pageLastRowUnknown:"?",nextPage:"\\u05E2\\u05DE\\u05D5\\u05D3 \\u05D4\\u05D1\\u05D0",lastPage:"\\u05E2\\u05DE\\u05D5\\u05D3 \\u05D0\\u05D7\\u05E8\\u05D5\\u05DF",firstPage:"\\u05E2\\u05DE\\u05D5\\u05D3 \\u05E8\\u05D0\\u05E9\\u05D5\\u05DF",previousPage:"\\u05E2\\u05DE\\u05D5\\u05D3 \\u05E7\\u05D5\\u05D3\\u05DD",pageSizeSelectorLabel:"\\u05D2\\u05D5\\u05D3\\u05DC \\u05E2\\u05DE\\u05D5\\u05D3:",footerTotal:\'\\u05E1\\u05D4"\\u05DB\',pivotColumnGroupTotals:"\\u05E1\\u05D4\\u05F4\\u05DB",pivotChartAndPivotMode:"\\u05EA\\u05E8\\u05E9\\u05D9\\u05DD \\u05E6\\u05D9\\u05E8 \\u05D5\\u05DE\\u05E6\\u05D1 \\u05E6\\u05D9\\u05E8",pivotChart:"\\u05EA\\u05E8\\u05E9\\u05D9\\u05DD \\u05E6\\u05D9\\u05E8",chartRange:"\\u05D8\\u05D5\\u05D5\\u05D7 \\u05EA\\u05E8\\u05E9\\u05D9\\u05DD",columnChart:"\\u05E2\\u05DE\\u05D5\\u05D3\\u05D4",groupedColumn:"\\u05DE\\u05E7\\u05D5\\u05D1\\u05E5",stackedColumn:"\\u05DE\\u05D5\\u05BC\\u05E2\\u05E8\\u05B8\\u05DD",normalizedColumn:"100% \\u05DE\\u05D5\\u05E2\\u05E8\\u05DD",barChart:"\\u05D1\\u05E8",groupedBar:"\\u05DE\\u05E7\\u05D5\\u05D1\\u05E5",stackedBar:"\\u05DE\\u05D5\\u05BC\\u05E2\\u05E8\\u05B8\\u05DD",normalizedBar:"100% \\u05DE\\u05D5\\u05E2\\u05E8\\u05DD",pieChart:"\\u05E2\\u05D5\\u05D2\\u05D4",pie:"\\u05E2\\u05D5\\u05D2\\u05D4",donut:"\\u05D3\\u05D5\\u05E0\\u05D0\\u05D8",line:"\\u05E7\\u05D5",xyChart:"X Y (Scatter)",scatter:"\\u05E4\\u05D9\\u05D6\\u05D5\\u05E8",bubble:"\\u05D1\\u05D5\\u05E2\\u05D4",areaChart:"\\u05D0\\u05D6\\u05D5\\u05E8",area:"\\u05D0\\u05D6\\u05D5\\u05E8",stackedArea:"\\u05DE\\u05D5\\u05BC\\u05E2\\u05E8\\u05B8\\u05DD",normalizedArea:"100% \\u05DE\\u05D5\\u05E2\\u05E8\\u05DD",histogramChart:"\\u05D4\\u05D9\\u05E1\\u05D8\\u05D5\\u05D2\\u05E8\\u05DE\\u05D4",polarChart:"\\u05E4\\u05D5\\u05DC\\u05D0\\u05E8\\u05D9",radarLine:"\\u05E7\\u05D5 \\u05DE\\u05DB\\u05F4\\u05DD",radarArea:"\\u05D0\\u05D6\\u05D5\\u05E8 \\u05DE\\u05DB\\u05F4\\u05DD",nightingale:"\\u05E0\\u05D9\\u05D9\\u05D8\\u05D9\\u05E0\\u05D2\\';
      S = S + 'u05D9\\u05D9\\u05DC",radialColumn:"\\u05E2\\u05DE\\u05D5\\u05D3\\u05D4 \\u05E8\\u05D3\\u05D9\\u05D0\\u05DC\\u05D9\\u05EA",radialBar:"\\u05D1\\u05E8 \\u05E8\\u05D3\\u05D9\\u05D0\\u05DC\\u05D9",statisticalChart:"\\u05E1\\u05D8\\u05D8\\u05D9\\u05E1\\u05D8\\u05D9",boxPlot:"\\u05E2\\u05DC\\u05D9\\u05DC\\u05EA \\u05E7\\u05D5\\u05E4\\u05E1\\u05D4",rangeBar:"\\u05D8\\u05D5\\u05D5\\u05D7 \\u05D1\\u05E8",rangeArea:"\\u05D8\\u05D5\\u05D5\\u05D7 \\u05D0\\u05D6\\u05D5\\u05E8",hierarchicalChart:"\\u05D4\\u05D9\\u05E8\\u05E8\\u05DB\\u05D9",treemap:"\\u05DE\\u05E4\\u05EA \\u05E2\\u05E5",sunburst:"\\u05D4\\u05EA\\u05E4\\u05E8\\u05E6\\u05D5\\u05EA \\u05E9\\u05DE\\u05E9",specializedChart:"\\u05DE\\u05D5\\u05DE\\u05D7\\u05D4",waterfall:"\\u05DE\\u05E4\\u05DC",heatmap:"\\u05DE\\u05E4\\u05EA \\u05D7\\u05D5\\u05DD",combinationChart:"\\u05EA\\u05E8\\u05E9\\u05D9\\u05DD \\u05DE\\u05E9\\u05D5\\u05DC\\u05D1",columnLineCombo:"\\u05E2\\u05DE\\u05D5\\u05D3\\u05D4 \\u05D5\\u05E7\\u05D5",AreaColumnCombo:"\\u05D0\\u05D6\\u05D5\\u05E8 \\u05D5\\u05E2\\u05DE\\u05D5\\u05D3\\u05D4",pivotChartTitle:"\\u05EA\\u05E8\\u05E9\\u05D9\\u05DD \\u05E6\\u05D9\\u05E8",rangeChartTitle:"\\u05EA\\u05E8\\u05E9\\u05D9\\u05DD \\u05D8\\u05D5\\u05D5\\u05D7",settings:"\\u05EA\\u05E8\\u05E9\\u05D9\\u05DD",data:"\\u05D4\\u05D2\\u05D3\\u05E8\\u05D5\\u05EA",format:"\\u05D4\\u05EA\\u05D0\\u05DE\\u05D4 \\u05D0\\u05D9\\u05E9\\u05D9\\u05EA",categories:"\\u05E7\\u05D8\\u05D2\\u05D5\\u05E8\\u05D9\\u05D5\\u05EA",defaultCategory:"(\\u05DC\\u05DC\\u05D0)",series:"\\u05E1\\u05D3\\u05E8\\u05D5\\u05EA",switchCategorySeries:"\\u05D4\\u05D7\\u05DC\\u05E3 \\u05E7\\u05D8\\u05D2\\u05D5\\u05E8\\u05D9\\u05D4 / \\u05E1\\u05D3\\u05E8\\u05D4",categoryValues:"\\u05E2\\u05E8\\u05DB\\u05D9 \\u05E7\\u05D8\\u05D2\\u05D5\\u05E8\\u05D9\\u05D4",seriesLabels:"\\u05EA\\u05D5\\u05D5\\u05D9\\u05D5\\u05EA \\u05E1\\u05D3\\u05E8\\u05D4",aggregate:"\\u05E7\\u05D9\\u05D1\\u05D5\\u05E5 \\u05E0\\u05EA\\u05D5\\u05E0\\u05D9\\u05DD",xyValues:"\\u05E2\\u05E8\\u05DB\\u05D9 X Y",paired:"\\u05DE\\u05E6\\u05D1 \\u05D6\\u05D9\\u05D5\\u05D5\\u05D2",axis:"\\u05E6\\u05D9\\u05E8",xAxis:"\\u05E6\\u05D9\\u05E8 \\u05D0\\u05D5\\u05E4\\u05E7\\u05D9",yAxis:"\\u05E6\\u05D9\\u05E8 \\u05D0\\u05E0\\u05DB\\u05D9",polarAxis:"\\u05E6\\u0';
      S = S + '5D9\\u05E8 \\u05E7\\u05D5\\u05D8\\u05D1",radiusAxis:"\\u05E6\\u05D9\\u05E8 \\u05E8\\u05D3\\u05D9\\u05D5\\u05E1",navigator:"\\u05DE\\u05E0\\u05D5\\u05D5\\u05D8",zoom:"\\u05D6\\u05D5\\u05DD",animation:"\\u05D0\\u05E0\\u05D9\\u05DE\\u05E6\\u05D9\\u05D4",crosshair:"\\u05E7\\u05D5 \\u05D7\\u05D5\\u05E6\\u05D4",color:"\\u05E6\\u05D1\\u05E2",thickness:"\\u05E2\\u05D5\\u05D1\\u05D9",preferredLength:"\\u05D0\\u05D5\\u05E8\\u05DA \\u05DE\\u05D5\\u05E2\\u05D3\\u05E3",xType:"\\u05E1\\u05D5\\u05D2 X",axisType:"\\u05E1\\u05D5\\u05D2 \\u05E6\\u05D9\\u05E8",automatic:"\\u05D0\\u05D5\\u05D8\\u05D5\\u05DE\\u05D8\\u05D9",category:"\\u05E7\\u05D8\\u05D2\\u05D5\\u05E8\\u05D9\\u05D4",number:"\\u05DE\\u05E1\\u05E4\\u05E8",time:"\\u05D6\\u05DE\\u05DF",timeFormat:"\\u05E4\\u05D5\\u05E8\\u05DE\\u05D8 \\u05D6\\u05DE\\u05DF",autoRotate:"\\u05E1\\u05D9\\u05D1\\u05D5\\u05D1 \\u05D0\\u05D5\\u05D8\\u05D5\\u05DE\\u05D8\\u05D9",labelRotation:"\\u05E1\\u05D9\\u05D1\\u05D5\\u05D1 \\u05EA\\u05D5\\u05D5\\u05D9\\u05EA",circle:"\\u05DE\\u05E2\\u05D2\\u05DC",polygon:"\\u05DE\\u05E6\\u05D5\\u05DC\\u05E2",square:"\\u05E8\\u05D9\\u05D1\\u05D5\\u05E2",cross:"\\u05E6\\u05DC\\u05D1",diamond:"\\u05D9\\u05D4\\u05DC\\u05D5\\u05DD",plus:"\\u05E4\\u05DC\\u05D5\\u05E1",triangle:"\\u05DE\\u05E9\\u05D5\\u05DC\\u05E9",heart:"\\u05DC\\u05D1",orientation:"\\u05DB\\u05D9\\u05D5\\u05D5\\u05DF",fixed:"\\u05E7\\u05D1\\u05D5\\u05E2",parallel:"\\u05DE\\u05E7\\u05D1\\u05D9\\u05DC",perpendicular:"\\u05E0\\u05D9\\u05E6\\u05D1",radiusAxisPosition:"\\u05DE\\u05D9\\u05E7\\u05D5\\u05DD",ticks:"\\u05E1\\u05D9\\u05DE\\u05E0\\u05D9 \\u05E7\\u05D5",gridLines:"\\u05E7\\u05D5\\u05D5\\u05D9 \\u05E8\\u05E9\\u05EA",width:"\\u05E8\\u05D5\\u05D7\\u05D1",height:"\\u05D2\\u05D5\\u05D1\\u05D4",length:"\\u05D0\\u05D5\\u05E8\\u05DA",padding:"\\u05E8\\u05D9\\u05E4\\u05D5\\u05D3",spacing:"\\u05E8\\u05D5\\u05D5\\u05D7",chartStyle:"\\u05E1\\u05D2\\u05E0\\u05D5\\u05DF \\u05EA\\u05E8\\u05E9\\u05D9\\u05DD",title:"\\u05DB\\u05D5\\u05EA\\u05E8\\u05EA",chartTitles:"\\u05DB\\u05D5\\u05EA\\u05E8\\u05D5\\u05EA",chartTitle:"\\u05DB\\u05D5\\u05EA\\u05E8\\u05EA \\u05EA\\u05E8\\u05E9\\u05D9\\u05DD",chartSubtitle:"\\u05DB\\u05D5\\u05EA\\u05E8\\u05EA \\u05DE\\u05E9\\u05E0\\u05D4",horizontalAxisTitle:"\\u05D';
      S = S + 'B\\u05D5\\u05EA\\u05E8\\u05EA \\u05E6\\u05D9\\u05E8 \\u05D0\\u05D5\\u05E4\\u05E7\\u05D9",verticalAxisTitle:"\\u05DB\\u05D5\\u05EA\\u05E8\\u05EA \\u05E6\\u05D9\\u05E8 \\u05D0\\u05E0\\u05DB\\u05D9",polarAxisTitle:"\\u05DB\\u05D5\\u05EA\\u05E8\\u05EA \\u05E6\\u05D9\\u05E8 \\u05E7\\u05D5\\u05D8\\u05D1",titlePlaceholder:"\\u05DB\\u05D5\\u05EA\\u05E8\\u05EA \\u05EA\\u05E8\\u05E9\\u05D9\\u05DD",background:"\\u05E8\\u05E7\\u05E2",font:"\\u05D2\\u05D5\\u05E4\\u05DF",weight:"\\u05E2\\u05D5\\u05D1\\u05D9",top:"\\u05DC\\u05DE\\u05E2\\u05DC\\u05D4",right:"\\u05D9\\u05DE\\u05D9\\u05DF",bottom:"\\u05DC\\u05DE\\u05D8\\u05D4",left:"\\u05E9\\u05DE\\u05D0\\u05DC",labels:"\\u05EA\\u05D5\\u05D5\\u05D9\\u05D5\\u05EA",calloutLabels:"\\u05EA\\u05D5\\u05D5\\u05D9\\u05D5\\u05EA \\u05D4\\u05E1\\u05D1\\u05E8",sectorLabels:"\\u05EA\\u05D5\\u05D5\\u05D9\\u05D5\\u05EA \\u05DE\\u05D2\\u05D6\\u05E8",positionRatio:"\\u05D9\\u05D7\\u05E1 \\u05DE\\u05D9\\u05E7\\u05D5\\u05DD",size:"\\u05D2\\u05D5\\u05D3\\u05DC",shape:"\\u05E6\\u05D5\\u05E8\\u05D4",minSize:"\\u05D2\\u05D5\\u05D3\\u05DC \\u05DE\\u05D9\\u05E0\\u05D9\\u05DE\\u05DC\\u05D9",maxSize:"\\u05D2\\u05D5\\u05D3\\u05DC \\u05DE\\u05E7\\u05E1\\u05D9\\u05DE\\u05DC\\u05D9",legend:"\\u05DE\\u05E7\\u05E8\\u05D0",position:"\\u05DE\\u05D9\\u05E7\\u05D5\\u05DD",markerSize:"\\u05D2\\u05D5\\u05D3\\u05DC \\u05E1\\u05D9\\u05DE\\u05DF",markerStroke:"\\u05E7\\u05D5\\u05D8\\u05E8 \\u05E1\\u05D9\\u05DE\\u05DF",markerPadding:"\\u05E8\\u05D9\\u05E4\\u05D5\\u05D3 \\u05E1\\u05D9\\u05DE\\u05DF",itemSpacing:"\\u05E8\\u05D5\\u05D5\\u05D7 \\u05E4\\u05E8\\u05D9\\u05D8\\u05D9\\u05DD",itemPaddingX:"\\u05E8\\u05D9\\u05E4\\u05D5\\u05D3 \\u05E4\\u05E8\\u05D9\\u05D8\\u05D9\\u05DD X",itemPaddingY:"\\u05E8\\u05D9\\u05E4\\u05D5\\u05D3 \\u05E4\\u05E8\\u05D9\\u05D8\\u05D9\\u05DD Y",layoutHorizontalSpacing:"\\u05E8\\u05D5\\u05D5\\u05D7 \\u05D0\\u05D5\\u05E4\\u05E7\\u05D9",layoutVerticalSpacing:"\\u05E8\\u05D5\\u05D5\\u05D7 \\u05D0\\u05E0\\u05DB\\u05D9",strokeWidth:"\\u05E2\\u05D5\\u05D1\\u05D9 \\u05E7\\u05D5",offset:"\\u05D4\\u05D9\\u05E1\\u05D8",offsets:"\\u05D4\\u05D9\\u05E1\\u05D8\\u05D9\\u05DD",tooltips:"\\u05D4\\u05E1\\u05D1\\u05E8\\u05D9\\u05DD",callout:"\\u05D4\\u05E1\\u05D1\\u05E8",markers:"\\u05E1\\u05D9\\u05DE\\u05E0\\u05D9';
      S = S + '\\u05DD",shadow:"\\u05E6\\u05DC",blur:"\\u05D8\\u05E9\\u05D8\\u05D5\\u05E9",xOffset:"\\u05D4\\u05D9\\u05E1\\u05D8 X",yOffset:"\\u05D4\\u05D9\\u05E1\\u05D8 Y",lineWidth:"\\u05E2\\u05D5\\u05D1\\u05D9 \\u05E7\\u05D5",lineDash:"\\u05E7\\u05D5 \\u05DE\\u05E7\\u05D5\\u05D5\\u05E7\\u05D5",lineDashOffset:"\\u05E7\\u05D9\\u05D6\\u05D5\\u05D6 \\u05E7\\u05D5 \\u05DE\\u05E7\\u05D5\\u05D5\\u05E7\\u05D5",scrollingZoom:"\\u05D2\\u05DC\\u05D9\\u05DC\\u05D4",scrollingStep:"\\u05E9\\u05DC\\u05D1 \\u05D2\\u05DC\\u05D9\\u05DC\\u05D4",selectingZoom:"\\u05D1\\u05D7\\u05D9\\u05E8\\u05EA \\u05D6\\u05D5\\u05DD",durationMillis:"\\u05DE\\u05E9\\u05DA (\\u05DE\\u05D9\\u05DC\\u05D9\\u05E9\\u05E0\\u05D9\\u05D5\\u05EA)",crosshairLabel:"\\u05EA\\u05D5\\u05D5\\u05D9\\u05EA",crosshairSnap:"\\u05D4\\u05E6\\u05DE\\u05D3 \\u05DC\\u05E6\\u05D5\\u05DE\\u05EA",normal:"\\u05E8\\u05D2\\u05D9\\u05DC",bold:"\\u05DE\\u05D5\\u05D3\\u05D2\\u05E9",italic:"\\u05E0\\u05D8\\u05D5\\u05D9",boldItalic:"\\u05DE\\u05D5\\u05D3\\u05D2\\u05E9 \\u05D5\\u05E0\\u05D8\\u05D5\\u05D9",predefined:"\\u05DE\\u05D5\\u05D2\\u05D3\\u05E8 \\u05DE\\u05E8\\u05D0\\u05E9",fillOpacity:"\\u05D0\\u05D8\\u05D9\\u05DE\\u05D5\\u05EA \\u05DE\\u05D9\\u05DC\\u05D5\\u05D9",strokeColor:"\\u05E6\\u05D1\\u05E2 \\u05E7\\u05D5",strokeOpacity:"\\u05D0\\u05D8\\u05D9\\u05DE\\u05D5\\u05EA \\u05E7\\u05D5",miniChart:"\\u05EA\\u05E8\\u05E9\\u05D9\\u05DD \\u05E7\\u05D8\\u05DF",histogramBinCount:"\\u05DE\\u05E1\\u05E4\\u05E8 \\u05D0\\u05D6\\u05D5\\u05E8\\u05D9\\u05DD",connectorLine:"\\u05E7\\u05D5 \\u05D7\\u05D9\\u05D1\\u05D5\\u05E8",seriesItems:"\\u05E4\\u05E8\\u05D9\\u05D8\\u05D9 \\u05E1\\u05D3\\u05E8\\u05D4",seriesItemType:"\\u05E1\\u05D5\\u05D2 \\u05E4\\u05E8\\u05D9\\u05D8",seriesItemPositive:"\\u05D7\\u05D9\\u05D5\\u05D1\\u05D9",seriesItemNegative:"\\u05E9\\u05DC\\u05D9\\u05DC\\u05D9",seriesItemLabels:"\\u05EA\\u05D5\\u05D5\\u05D9\\u05D5\\u05EA \\u05E4\\u05E8\\u05D9\\u05D8",columnGroup:"\\u05E2\\u05DE\\u05D5\\u05D3\\u05D4",barGroup:"\\u05E4\\u05E1",pieGroup:"\\u05E2\\u05D5\\u05D2\\u05D4",lineGroup:"\\u05E7\\u05D5",scatterGroup:"X Y (\\u05E4\\u05D9\\u05D6\\u05D5\\u05E8)",areaGroup:"\\u05E9\\u05D8\\u05D7",polarGroup:"\\u05E7\\u05D5\\u05D8\\u05D1",statisticalGroup:"\\u05E1\\u05D8\\u05D8\\u05D9';
      S = S + '\\u05E1\\u05D8\\u05D9",hierarchicalGroup:"\\u05D4\\u05D9\\u05E8\\u05E8\\u05DB\\u05D9",specializedGroup:"\\u05DE\\u05EA\\u05DE\\u05D7\\u05D4",combinationGroup:"\\u05E9\\u05D9\\u05DC\\u05D5\\u05D1",groupedColumnTooltip:"\\u05DE\\u05E7\\u05D5\\u05D1\\u05E5",stackedColumnTooltip:"\\u05DE\\u05D5\\u05E2\\u05E8\\u05DD",normalizedColumnTooltip:"\\u05DE\\u05D5\\u05E2\\u05E8\\u05DD 100%",groupedBarTooltip:"\\u05DE\\u05E7\\u05D5\\u05D1\\u05E5",stackedBarTooltip:"\\u05DE\\u05D5\\u05E2\\u05E8\\u05DD",normalizedBarTooltip:"\\u05DE\\u05D5\\u05E2\\u05E8\\u05DD 100%",pieTooltip:"\\u05E2\\u05D5\\u05D2\\u05D4",donutTooltip:"\\u05E1\\u05D5\\u05E4\\u05D2\\u05E0\\u05D9\\u05D9\\u05D4",lineTooltip:"\\u05E7\\u05D5",groupedAreaTooltip:"\\u05E9\\u05D8\\u05D7 \\u05DE\\u05D7\\u05D5\\u05DC\\u05E7",stackedAreaTooltip:"\\u05E9\\u05D8\\u05D7 \\u05DE\\u05D5\\u05E2\\u05E8\\u05DD",normalizedAreaTooltip:"\\u05E9\\u05D8\\u05D7 \\u05DE\\u05D5\\u05E2\\u05E8\\u05DD 100%",scatterTooltip:"\\u05E4\\u05D9\\u05D6\\u05D5\\u05E8",bubbleTooltip:"\\u05D1\\u05D5\\u05E2\\u05D4",histogramTooltip:"\\u05D4\\u05D9\\u05E1\\u05D8\\u05D5\\u05D2\\u05E8\\u05DE\\u05D4",radialColumnTooltip:"\\u05E2\\u05DE\\u05D5\\u05D3\\u05D4 \\u05E8\\u05D3\\u05D9\\u05D0\\u05DC\\u05D9\\u05EA",radialBarTooltip:"\\u05E4\\u05E1 \\u05E8\\u05D3\\u05D9\\u05D0\\u05DC\\u05D9",radarLineTooltip:"\\u05E7\\u05D5 \\u05E8\\u05D3\\u05D0\\u05E8",radarAreaTooltip:"\\u05E9\\u05D8\\u05D7 \\u05E8\\u05D3\\u05D0\\u05E8",nightingaleTooltip:"\\u05E0\\u05D9\\u05D9\\u05D8\\u05D9\\u05E0\\u05D2\\u05D9\\u05D9\\u05DC",rangeBarTooltip:"\\u05D8\\u05D5\\u05D5\\u05D7 \\u05E4\\u05E1",rangeAreaTooltip:"\\u05D8\\u05D5\\u05D5\\u05D7 \\u05E9\\u05D8\\u05D7",boxPlotTooltip:"\\u05EA\\u05E8\\u05E9\\u05D9\\u05DD \\u05E7\\u05D5\\u05E4\\u05E1\\u05D4",treemapTooltip:"\\u05EA\\u05E8\\u05E9\\u05D9\\u05DD \\u05E2\\u05E5",sunburstTooltip:"\\u05D4\\u05EA\\u05E4\\u05E8\\u05E6\\u05D5\\u05EA \\u05E9\\u05DE\\u05E9",waterfallTooltip:"\\u05DE\\u05E4\\u05DC",heatmapTooltip:"\\u05DE\\u05E4\\u05EA \\u05D7\\u05D5\\u05DD",columnLineComboTooltip:"\\u05E2\\u05DE\\u05D5\\u05D3\\u05D4 & \\u05E7\\u05D5",areaColumnComboTooltip:"\\u05E9\\u05D8\\u05D7 & \\u05E2\\u05DE\\u05D5\\u05D3\\u05D4",customComboTooltip:"\\u05E9\\u05D9';
      S = S + '\\u05DC\\u05D5\\u05D1 \\u05DE\\u05D5\\u05EA\\u05D0\\u05DD \\u05D0\\u05D9\\u05E9\\u05D9\\u05EA",innerRadius:"\\u05E8\\u05D3\\u05D9\\u05D5\\u05E1 \\u05E4\\u05E0\\u05D9\\u05DE\\u05D9",startAngle:"\\u05D6\\u05D5\\u05D5\\u05D9\\u05EA \\u05D4\\u05EA\\u05D7\\u05DC\\u05D4",endAngle:"\\u05D6\\u05D5\\u05D5\\u05D9\\u05EA \\u05E1\\u05D9\\u05D5\\u05DD",reverseDirection:"\\u05DB\\u05D9\\u05D5\\u05D5\\u05DF \\u05D4\\u05E4\\u05D5\\u05DA",groupPadding:"\\u05E8\\u05D9\\u05E4\\u05D5\\u05D3 \\u05E7\\u05D1\\u05D5\\u05E6\\u05D4",seriesPadding:"\\u05E8\\u05D9\\u05E4\\u05D5\\u05D3 \\u05E1\\u05D3\\u05E8\\u05D4",tile:"\\u05D0\\u05E8\\u05D9\\u05D7",whisker:"\\u05D3\\u05D5\\u05BC\\u05D0\\u05B7\\u05D6\\u05B0\\u05E8\\u05B7\\u05EA",cap:"\\u05DB\\u05BC\\u05B4\\u05E4\\u05BC\\u05B8\\u05D4",capLengthRatio:"\\u05D9\\u05D7\\u05E1 \\u05D0\\u05D5\\u05E8\\u05DA",labelPlacement:"\\u05DE\\u05D9\\u05E7\\u05D5\\u05DD \\u05EA\\u05D5\\u05D5\\u05D9\\u05EA",inside:"\\u05D1\\u05E4\\u05E0\\u05D9\\u05DD",outside:"\\u05D1\\u05D7\\u05D5\\u05E5",noDataToChart:"\\u05D0\\u05D9\\u05DF \\u05E0\\u05EA\\u05D5\\u05E0\\u05D9\\u05DD \\u05DC\\u05D4\\u05E6\\u05D2\\u05D4.",pivotChartRequiresPivotMode:"\\u05EA\\u05E8\\u05E9\\u05D9\\u05DD \\u05E6\\u05D9\\u05E8 \\u05D3\\u05D5\\u05E8\\u05E9 \\u05D4\\u05E4\\u05E2\\u05DC\\u05EA \\u05DE\\u05E6\\u05D1 \\u05E6\\u05D9\\u05E8.",chartSettingsToolbarTooltip:"\\u05EA\\u05E4\\u05E8\\u05D9\\u05D8",chartLinkToolbarTooltip:"\\u05DE\\u05E7\\u05D5\\u05E9\\u05E8 \\u05DC\\u05D2\\u05E8\\u05D9\\u05D3",chartUnlinkToolbarTooltip:"\\u05DE\\u05E0\\u05D5\\u05EA\\u05E7 \\u05DE\\u05D4\\u05D2\\u05E8\\u05D9\\u05D3",chartDownloadToolbarTooltip:"\\u05D4\\u05D5\\u05E8\\u05D3 \\u05EA\\u05E8\\u05E9\\u05D9\\u05DD",chartMenuToolbarTooltip:"\\u05EA\\u05E4\\u05E8\\u05D9\\u05D8",chartEdit:"\\u05E2\\u05E8\\u05D5\\u05DA \\u05EA\\u05E8\\u05E9\\u05D9\\u05DD",chartAdvancedSettings:"\\u05D4\\u05D2\\u05D3\\u05E8\\u05D5\\u05EA \\u05DE\\u05EA\\u05E7\\u05D3\\u05DE\\u05D5\\u05EA",chartLink:"\\u05E7\\u05D9\\u05E9\\u05D5\\u05E8 \\u05DC\\u05D2\\u05E8\\u05D9\\u05D3",chartUnlink:"\\u05E0\\u05EA\\u05E7 \\u05DE\\u05D4\\u05D2\\u05E8\\u05D9\\u05D3",chartDownload:"\\u05D4\\u05D5\\u05E8\\u05D3 \\u05EA\\u05E8\\u05E9\\u05D9\\u05DD",histogramFrequency:"\\u05EA\\u05D3\\u05D9\\u05E8\\u05D5\\u05';
      S = S + 'EA",seriesChartType:"\\u05E1\\u05D5\\u05D2 \\u05EA\\u05E8\\u05E9\\u05D9\\u05DD \\u05E1\\u05D3\\u05E8\\u05D4",seriesType:"\\u05E1\\u05D5\\u05D2 \\u05E1\\u05D3\\u05E8\\u05D4",secondaryAxis:"\\u05E6\\u05D9\\u05E8 \\u05DE\\u05E9\\u05E0\\u05D9",seriesAdd:"\\u05D4\\u05D5\\u05E1\\u05E3 \\u05E1\\u05D3\\u05E8\\u05D4",categoryAdd:"\\u05D4\\u05D5\\u05E1\\u05E3 \\u05E7\\u05D8\\u05D2\\u05D5\\u05E8\\u05D9\\u05D4",bar:"\\u05E4\\u05E1",column:"\\u05E2\\u05DE\\u05D5\\u05D3\\u05D4",histogram:"\\u05D4\\u05D9\\u05E1\\u05D8\\u05D5\\u05D2\\u05E8\\u05DE\\u05D4",advancedSettings:"\\u05D4\\u05D2\\u05D3\\u05E8\\u05D5\\u05EA \\u05DE\\u05EA\\u05E7\\u05D3\\u05DE\\u05D5\\u05EA",direction:"\\u05DB\\u05D9\\u05D5\\u05D5\\u05DF",horizontal:"\\u05D0\\u05D5\\u05E4\\u05E7\\u05D9",vertical:"\\u05D0\\u05E0\\u05DB\\u05D9",seriesGroupType:"\\u05E1\\u05D5\\u05D2 \\u05E7\\u05D1\\u05D5\\u05E6\\u05EA \\u05E1\\u05D3\\u05E8\\u05D4",groupedSeriesGroupType:"\\u05DE\\u05E7\\u05D5\\u05D1\\u05E5",stackedSeriesGroupType:"\\u05DE\\u05D5\\u05E2\\u05E8\\u05DD",normalizedSeriesGroupType:"\\u05DE\\u05D5\\u05E2\\u05E8\\u05DD 100%",legendEnabled:"\\u05DE\\u05D5\\u05E4\\u05E2\\u05DC",invalidColor:"\\u05E2\\u05E8\\u05DA \\u05E6\\u05D1\\u05E2 \\u05DC\\u05D0 \\u05D7\\u05D5\\u05E7\\u05D9",groupedColumnFull:"\\u05E2\\u05DE\\u05D5\\u05D3\\u05D4 \\u05DE\\u05E7\\u05D5\\u05D1\\u05E6\\u05EA",stackedColumnFull:"\\u05E2\\u05DE\\u05D5\\u05D3\\u05D4 \\u05DE\\u05D5\\u05E2\\u05E8\\u05DE\\u05EA",normalizedColumnFull:"\\u05E2\\u05DE\\u05D5\\u05D3\\u05D4 \\u05DE\\u05D5\\u05E2\\u05E8\\u05DE\\u05EA 100%",groupedBarFull:"\\u05E4\\u05E1 \\u05DE\\u05E7\\u05D5\\u05D1\\u05E5",stackedBarFull:"\\u05E4\\u05E1 \\u05DE\\u05D5\\u05E2\\u05E8\\u05DD",normalizedBarFull:"\\u05E4\\u05E1 \\u05DE\\u05D5\\u05E2\\u05E8\\u05DD 100%",stackedAreaFull:"\\u05E9\\u05D8\\u05D7 \\u05DE\\u05D5\\u05E2\\u05E8\\u05DD",normalizedAreaFull:"\\u05E9\\u05D8\\u05D7 \\u05DE\\u05D5\\u05E2\\u05E8\\u05DD 100%",customCombo:"\\u05E9\\u05D9\\u05DC\\u05D5\\u05D1 \\u05DE\\u05D5\\u05EA\\u05D0\\u05DD \\u05D0\\u05D9\\u05E9\\u05D9\\u05EA",ariaAdvancedFilterBuilderItem:"${variable}. \\u05E8\\u05DE\\u05D4 ${variable}. \\u05DC\\u05D7\\u05E5 \\u05E2\\u05DC ENTER \\u05DB\\u05D3\\u05D9 \\u05DC\\u05E2\\u05E8\\u05D5\\u05DA.",ariaAdv';
      S = S + 'ancedFilterBuilderItemValidation:"${variable}. \\u05E8\\u05DE\\u05D4 ${variable}. ${variable} \\u05DC\\u05D7\\u05E5 \\u05E2\\u05DC ENTER \\u05DB\\u05D3\\u05D9 \\u05DC\\u05E2\\u05E8\\u05D5\\u05DA.",ariaAdvancedFilterBuilderList:"\\u05E8\\u05E9\\u05D9\\u05DE\\u05EA \\u05D1\\u05D5\\u05E0\\u05D4 \\u05E4\\u05D9\\u05DC\\u05D8\\u05E8 \\u05DE\\u05EA\\u05E7\\u05D3\\u05DD",ariaAdvancedFilterBuilderFilterItem:"\\u05EA\\u05E0\\u05D0\\u05D9 \\u05E1\\u05D9\\u05E0\\u05D5\\u05DF",ariaAdvancedFilterBuilderGroupItem:"\\u05E7\\u05D1\\u05D5\\u05E6\\u05EA \\u05E1\\u05D9\\u05E0\\u05D5\\u05DF",ariaAdvancedFilterBuilderColumn:"\\u05E2\\u05DE\\u05D5\\u05D3\\u05D4",ariaAdvancedFilterBuilderOption:"\\u05D0\\u05E4\\u05E9\\u05E8\\u05D5\\u05EA",ariaAdvancedFilterBuilderValueP:"\\u05E2\\u05E8\\u05DA",ariaAdvancedFilterBuilderJoinOperator:"\\u05DE\\u05E4\\u05E2\\u05D9\\u05DC \\u05D7\\u05D9\\u05D1\\u05D5\\u05E8",ariaAdvancedFilterInput:"\\u05E7\\u05DC\\u05D8 \\u05E1\\u05D9\\u05E0\\u05D5\\u05DF \\u05DE\\u05EA\\u05E7\\u05D3\\u05DD",ariaChecked:"\\u05DE\\u05E1\\u05D5\\u05DE\\u05DF",ariaColumn:"\\u05E2\\u05DE\\u05D5\\u05D3\\u05D4",ariaColumnGroup:"\\u05E7\\u05D1\\u05D5\\u05E6\\u05EA \\u05E2\\u05DE\\u05D5\\u05D3\\u05D5\\u05EA",ariaColumnFiltered:"\\u05E2\\u05DE\\u05D5\\u05D3\\u05D4 \\u05DE\\u05E1\\u05D5\\u05E0\\u05E0\\u05EA",ariaColumnSelectAll:"\\u05D4\\u05D7\\u05DC\\u05E3 \\u05D0\\u05EA \\u05D1\\u05D7\\u05D9\\u05E8\\u05EA \\u05DB\\u05DC \\u05D4\\u05E2\\u05DE\\u05D5\\u05D3\\u05D5\\u05EA",ariaDateFilterInput:"\\u05E7\\u05DC\\u05D8 \\u05E1\\u05D9\\u05E0\\u05D5\\u05DF \\u05EA\\u05D0\\u05E8\\u05D9\\u05DA",ariaDefaultListName:"\\u05E8\\u05E9\\u05D9\\u05DE\\u05D4",ariaFilterColumnsInput:"\\u05E7\\u05DC\\u05D8 \\u05E1\\u05D9\\u05E0\\u05D5\\u05DF \\u05E2\\u05DE\\u05D5\\u05D3\\u05D5\\u05EA",ariaFilterFromValue:"\\u05E1\\u05E0\\u05DF \\u05DE\\u05E2\\u05E8\\u05DA",ariaFilterInput:"\\u05E7\\u05DC\\u05D8 \\u05E1\\u05D9\\u05E0\\u05D5\\u05DF",ariaFilterList:"\\u05E8\\u05E9\\u05D9\\u05DE\\u05EA \\u05E1\\u05D9\\u05E0\\u05D5\\u05DF",ariaFilterToValue:"\\u05E1\\u05E0\\u05DF \\u05DC\\u05E2\\u05E8\\u05DA",ariaFilterValue:"\\u05E2\\u05E8\\u05DA \\u05E1\\u05D9\\u05E0\\u05D5\\u05DF",ariaFilterMenuOpen:"\\u05E4\\u05EA\\u05D7 \\u05EA\\u05E4\\u0';
      S = S + '5E8\\u05D9\\u05D8 \\u05E1\\u05D9\\u05E0\\u05D5\\u05DF",ariaFilteringOperator:"\\u05DE\\u05E4\\u05E2\\u05D9\\u05DC \\u05E1\\u05D9\\u05E0\\u05D5\\u05DF",ariaHidden:"\\u05E0\\u05E1\\u05EA\\u05E8",ariaIndeterminate:"\\u05D1\\u05DC\\u05EA\\u05D9 \\u05E7\\u05D1\\u05D5\\u05E2",ariaInputEditor:"\\u05E2\\u05D5\\u05E8\\u05DA \\u05E7\\u05DC\\u05D8",ariaMenuColumn:"\\u05DC\\u05D7\\u05E5 ALT \\u05DC\\u05DE\\u05D8\\u05D4 \\u05DB\\u05D3\\u05D9 \\u05DC\\u05E4\\u05EA\\u05D5\\u05D7 \\u05EA\\u05E4\\u05E8\\u05D9\\u05D8 \\u05E2\\u05DE\\u05D5\\u05D3\\u05D4",ariaFilterColumn:"\\u05DC\\u05D7\\u05E5 CTRL ENTER \\u05DB\\u05D3\\u05D9 \\u05DC\\u05E4\\u05EA\\u05D5\\u05D7 \\u05E1\\u05D9\\u05E0\\u05D5\\u05DF",ariaRowDeselect:"\\u05DC\\u05D7\\u05E5 \\u05E2\\u05DC SPACE \\u05DB\\u05D3\\u05D9 \\u05DC\\u05D1\\u05D8\\u05DC \\u05D0\\u05EA \\u05D1\\u05D7\\u05D9\\u05E8\\u05EA \\u05E9\\u05D5\\u05E8\\u05D4 \\u05D6\\u05D5",ariaRowSelectAll:"\\u05DC\\u05D7\\u05E5 \\u05E2\\u05DC Space \\u05DB\\u05D3\\u05D9 \\u05DC\\u05D4\\u05D7\\u05DC\\u05D9\\u05E3 \\u05D0\\u05EA \\u05D1\\u05D7\\u05D9\\u05E8\\u05EA \\u05DB\\u05DC \\u05D4\\u05E9\\u05D5\\u05E8\\u05D5\\u05EA",ariaRowToggleSelection:"\\u05DC\\u05D7\\u05E5 \\u05E2\\u05DC Space \\u05DB\\u05D3\\u05D9 \\u05DC\\u05D4\\u05D7\\u05DC\\u05D9\\u05E3 \\u05D0\\u05EA \\u05D1\\u05D7\\u05D9\\u05E8\\u05EA \\u05D4\\u05E9\\u05D5\\u05E8\\u05D4",ariaRowSelect:"\\u05DC\\u05D7\\u05E5 \\u05E2\\u05DC SPACE \\u05DB\\u05D3\\u05D9 \\u05DC\\u05D1\\u05D7\\u05D5\\u05E8 \\u05E9\\u05D5\\u05E8\\u05D4 \\u05D6\\u05D5",ariaRowSelectionDisabled:"\\u05D1\\u05D7\\u05D9\\u05E8\\u05EA \\u05E9\\u05D5\\u05E8\\u05D5\\u05EA \\u05DE\\u05D5\\u05E9\\u05D1\\u05EA\\u05EA \\u05E2\\u05D1\\u05D5\\u05E8 \\u05E9\\u05D5\\u05E8\\u05D4 \\u05D6\\u05D5",ariaSearch:"\\u05D7\\u05D9\\u05E4\\u05D5\\u05E9",ariaSortableColumn:"\\u05DC\\u05D7\\u05E5 \\u05E2\\u05DC ENTER \\u05DC\\u05DE\\u05D9\\u05D5\\u05DF",ariaToggleVisibility:"\\u05DC\\u05D7\\u05E5 \\u05E2\\u05DC SPACE \\u05DB\\u05D3\\u05D9 \\u05DC\\u05D4\\u05D7\\u05DC\\u05D9\\u05E3 \\u05E0\\u05E8\\u05D0\\u05D5\\u05EA",ariaToggleCellValue:"\\u05DC\\u05D7\\u05E5 \\u05E2\\u05DC SPACE \\u05DB\\u05D3\\u05D9 \\u05DC\\u05D4\\u05D7\\u05DC\\u05D9\\u05E3 \\u05E2\\u05E8\\u05DA \\u05EA\\u05D0",ariaUnchecked:"\\u05DC\\u05D0 \\u05DE\\u05E1\\u05D';
      S = S + '5\\u05DE\\u05DF",ariaVisible:"\\u05D2\\u05DC\\u05D5\\u05D9",ariaSearchFilterValues:"\\u05E2\\u05E8\\u05DB\\u05D9 \\u05D7\\u05D9\\u05E4\\u05D5\\u05E9 \\u05E1\\u05D9\\u05E0\\u05D5\\u05DF",ariaPageSizeSelectorLabel:"\\u05D2\\u05D5\\u05D3\\u05DC \\u05E2\\u05DE\\u05D5\\u05D3",ariaChartMenuClose:"\\u05E1\\u05D2\\u05D5\\u05E8 \\u05EA\\u05E4\\u05E8\\u05D9\\u05D8 \\u05E2\\u05E8\\u05D9\\u05DB\\u05EA \\u05EA\\u05E8\\u05E9\\u05D9\\u05DD",ariaChartSelected:"\\u05E0\\u05D1\\u05D7\\u05E8",ariaSkeletonCellLoadingFailed:"\\u05D4\\u05D8\\u05E2\\u05D9\\u05E0\\u05EA \\u05D4\\u05E9\\u05D5\\u05E8\\u05D4 \\u05E0\\u05DB\\u05E9\\u05DC\\u05D4",ariaSkeletonCellLoading:"\\u05E0\\u05EA\\u05D5\\u05E0\\u05D9 \\u05D4\\u05E9\\u05D5\\u05E8\\u05D4 \\u05E0\\u05D8\\u05E2\\u05E0\\u05D9\\u05DD",ariaRowGroupDropZonePanelLabel:"\\u05E7\\u05D1\\u05D5\\u05E6\\u05D5\\u05EA \\u05E9\\u05D5\\u05E8\\u05D5\\u05EA",ariaValuesDropZonePanelLabel:"\\u05E2\\u05E8\\u05DB\\u05D9\\u05DD",ariaPivotDropZonePanelLabel:"\\u05EA\\u05D5\\u05D5\\u05D9\\u05D5\\u05EA \\u05E2\\u05DE\\u05D5\\u05D3\\u05D5\\u05EA",ariaDropZoneColumnComponentDescription:"\\u05DC\\u05D7\\u05E5 DELETE \\u05DB\\u05D3\\u05D9 \\u05DC\\u05D4\\u05E1\\u05D9\\u05E8",ariaDropZoneColumnValueItemDescription:"\\u05DC\\u05D7\\u05E5 ENTER \\u05DB\\u05D3\\u05D9 \\u05DC\\u05E9\\u05E0\\u05D5\\u05EA \\u05D0\\u05EA \\u05E1\\u05D5\\u05D2 \\u05D4\\u05D0\\u05D2\\u05E8\\u05D2\\u05E6\\u05D9\\u05D4",ariaDropZoneColumnGroupItemDescription:"\\u05DC\\u05D7\\u05E5 ENTER \\u05DB\\u05D3\\u05D9 \\u05DC\\u05DE\\u05D9\\u05D9\\u05DF",ariaDropZoneColumnComponentAggFuncSeparator:" \\u05E9\\u05DC ",ariaDropZoneColumnComponentSortAscending:"\\u05E2\\u05D5\\u05DC\\u05D4",ariaDropZoneColumnComponentSortDescending:"\\u05D9\\u05D5\\u05E8\\u05D3",ariaLabelDialog:"\\u05D3\\u05D9\\u05D0\\u05DC\\u05D5\\u05D2",ariaLabelColumnMenu:"\\u05EA\\u05E4\\u05E8\\u05D9\\u05D8 \\u05E2\\u05DE\\u05D5\\u05D3\\u05D4",ariaLabelColumnFilter:"\\u05DE\\u05E1\\u05E0\\u05DF \\u05E2\\u05DE\\u05D5\\u05D3\\u05D4",ariaLabelCellEditor:"\\u05E2\\u05D5\\u05E8\\u05DA \\u05EA\\u05D0",ariaLabelSelectField:"\\u05E9\\u05D3\\u05D4 \\u05D1\\u05D7\\u05D9\\u05E8\\u05D4",ariaLabelRichSelectField:"\\u05E9\\u05D3\\u05D4 \\u05D1\\u05D7\\u05D9\\u05E8';
      S = S + '\\u05D4 \\u05E2\\u05E9\\u05D9\\u05E8",ariaLabelRichSelectToggleSelection:"\\u05DC\\u05D7\\u05E5 \\u05E2\\u05DC \\u05DE\\u05E7\\u05E9 \\u05D4\\u05E8\\u05D5\\u05D5\\u05D7 \\u05DB\\u05D3\\u05D9 \\u05DC\\u05D4\\u05D7\\u05DC\\u05D9\\u05E3 \\u05D1\\u05D7\\u05D9\\u05E8\\u05D4",ariaLabelRichSelectDeselectAllItems:"\\u05DC\\u05D7\\u05E5 \\u05E2\\u05DC \\u05DE\\u05E7\\u05E9 \\u05DE\\u05D7\\u05D9\\u05E7\\u05D4 \\u05DB\\u05D3\\u05D9 \\u05DC\\u05D1\\u05D8\\u05DC \\u05D0\\u05EA \\u05D4\\u05D1\\u05D7\\u05D9\\u05E8\\u05D4 \\u05D1\\u05DB\\u05DC \\u05D4\\u05E4\\u05E8\\u05D9\\u05D8\\u05D9\\u05DD",ariaLabelRichSelectDeleteSelection:"\\u05DC\\u05D7\\u05E5 \\u05E2\\u05DC \\u05DE\\u05E7\\u05E9 \\u05DE\\u05D7\\u05D9\\u05E7\\u05D4 \\u05DB\\u05D3\\u05D9 \\u05DC\\u05D1\\u05D8\\u05DC \\u05D0\\u05EA \\u05D1\\u05D7\\u05D9\\u05E8\\u05EA \\u05D4\\u05E4\\u05E8\\u05D9\\u05D8",ariaLabelTooltip:"\\u05EA\\u05D5\\u05D5\\u05D9\\u05EA",ariaLabelContextMenu:"\\u05EA\\u05E4\\u05E8\\u05D9\\u05D8 \\u05D4\\u05E7\\u05E9\\u05E8",ariaLabelSubMenu:"\\u05EA\\u05E4\\u05E8\\u05D9\\u05D8 \\u05DE\\u05E9\\u05E0\\u05D4",ariaLabelAggregationFunction:"\\u05E4\\u05D5\\u05E0\\u05E7\\u05E6\\u05D9\\u05D9\\u05EA \\u05E6\\u05D1\\u05D9\\u05E8\\u05D4",ariaLabelAdvancedFilterAutocomplete:"\\u05D4\\u05E9\\u05DC\\u05DE\\u05D4 \\u05D0\\u05D5\\u05D8\\u05D5\\u05DE\\u05D8\\u05D9\\u05EA \\u05DC\\u05E1\\u05D9\\u05E0\\u05D5\\u05DF \\u05DE\\u05EA\\u05E7\\u05D3\\u05DD",ariaLabelAdvancedFilterBuilderAddField:"\\u05D4\\u05D5\\u05E1\\u05E3 \\u05E9\\u05D3\\u05D4 \\u05D1\\u05D1\\u05D5\\u05E0\\u05D4 \\u05D4\\u05E1\\u05D9\\u05E0\\u05D5\\u05DF \\u05D4\\u05DE\\u05EA\\u05E7\\u05D3\\u05DD",ariaLabelAdvancedFilterBuilderColumnSelectField:"\\u05D1\\u05D7\\u05E8 \\u05E9\\u05D3\\u05D4 \\u05E2\\u05DE\\u05D5\\u05D3\\u05D4 \\u05D1\\u05D1\\u05D5\\u05E0\\u05D4 \\u05D4\\u05E1\\u05D9\\u05E0\\u05D5\\u05DF \\u05D4\\u05DE\\u05EA\\u05E7\\u05D3\\u05DD",ariaLabelAdvancedFilterBuilderOptionSelectField:"\\u05D1\\u05D7\\u05E8 \\u05E9\\u05D3\\u05D4 \\u05D0\\u05E4\\u05E9\\u05E8\\u05D5\\u05EA \\u05D1\\u05D1\\u05D5\\u05E0\\u05D4 \\u05D4\\u05E1\\u05D9\\u05E0\\u05D5\\u05DF \\u05D4\\u05DE\\u05EA\\u05E7\\u05D3\\u05DD",ariaLabelAdvancedFilterBuilderJoinSelectField:"\\u05D1\\u05D7\\u05E8 \\u05E9\\u05D3\\u05D4 \\u05D0\\u05D5\\u05E';
      S = S + '4\\u05E8\\u05D8\\u05D5\\u05E8 \\u05D4\\u05E6\\u05D8\\u05E8\\u05E4\\u05D5\\u05EA \\u05D1\\u05D1\\u05D5\\u05E0\\u05D4 \\u05D4\\u05E1\\u05D9\\u05E0\\u05D5\\u05DF \\u05D4\\u05DE\\u05EA\\u05E7\\u05D3\\u05DD",ariaColumnPanelList:"\\u05E8\\u05E9\\u05D9\\u05DE\\u05EA \\u05E2\\u05DE\\u05D5\\u05D3\\u05D5\\u05EA",ariaFilterPanelList:"\\u05E8\\u05E9\\u05D9\\u05DE\\u05EA \\u05DE\\u05E1\\u05E0\\u05E0\\u05D9\\u05DD",thousandSeparator:",",decimalSeparator:".",true:"True",false:"False",invalidDate:"\\u05EA\\u05D0\\u05E8\\u05D9\\u05DA \\u05DC\\u05D0 \\u05D7\\u05D5\\u05E7\\u05D9",invalidNumber:"\\u05DE\\u05E1\\u05E4\\u05E8 \\u05DC\\u05D0 \\u05D7\\u05D5\\u05E7\\u05D9",january:"\\u05D9\\u05E0\\u05D5\\u05D0\\u05E8",february:"\\u05E4\\u05D1\\u05E8\\u05D5\\u05D0\\u05E8",march:"\\u05DE\\u05E8\\u05E5",april:"\\u05D0\\u05E4\\u05E8\\u05D9\\u05DC",may:"\\u05DE\\u05D0\\u05D9",june:"\\u05D9\\u05D5\\u05E0\\u05D9",july:"\\u05D9\\u05D5\\u05DC\\u05D9",august:"\\u05D0\\u05D5\\u05D2\\u05D5\\u05E1\\u05D8",september:"\\u05E1\\u05E4\\u05D8\\u05DE\\u05D1\\u05E8",october:"\\u05D0\\u05D5\\u05E7\\u05D8\\u05D5\\u05D1\\u05E8",november:"\\u05E0\\u05D5\\u05D1\\u05DE\\u05D1\\u05E8",december:"\\u05D3\\u05E6\\u05DE\\u05D1\\u05E8",timeFormatSlashesDDMMYYYY:"DD/MM/YYYY",timeFormatSlashesMMDDYYYY:"MM/DD/YYYY",timeFormatSlashesDDMMYY:"DD/MM/YY",timeFormatSlashesMMDDYY:"MM/DD/YY",timeFormatDotsDDMYY:"DD.M.YY",timeFormatDotsMDDYY:"M.DD.YY",timeFormatDashesYYYYMMDD:"YYYY-MM-DD",timeFormatSpacesDDMMMMYYYY:"DD MMMM YYYY",timeFormatHHMMSS:"\\u05E9\\u05E2\\u05D4:\\u05D3\\u05E7\\u05D4:\\u05E9\\u05E0\\u05D9\\u05D9\\u05D4",timeFormatHHMMSSAmPm:"\\u05E9\\u05E2\\u05D4:\\u05D3\\u05E7\\u05D4:\\u05E9\\u05E0\\u05D9\\u05D9\\u05D4 \\u05DC\\u05E4\\u05E0\\u05D4\\u05F4\\u05E6/\\u05D0\\u05D7\\u05D4\\u05F4\\u05E6"},T={selectAll:"(Odaberi sve)",selectAllSearchResults:"(Odaberi sve rezultate pretra\\u017Eivanja)",addCurrentSelectionToFilter:"Dodaj trenutni odabir u filter",searchOoo:"Tra\\u017Ei...",blanks:"(Praznine)",noMatches:"Nema podudaranja",filterOoo:"Filtriraj...",equals:"Jednako",notEqual:"Nije jednako",blank:"Prazno",notBlank:"Nije prazno",empty:"Odaberite jedan",lessThan:"Manje od",greaterThan:"V';
      S = S + 'e\\u0107e od",lessThanOrEqual:"Manje ili jednako",greaterThanOrEqual:"Ve\\u0107e ili jednako",inRange:"Izme\\u0111u",inRangeStart:"Od",inRangeEnd:"Do",contains:"Sadr\\u017Ei",notContains:"Ne sadr\\u017Ei",startsWith:"Po\\u010Dinje s",endsWith:"Zavr\\u0161ava s",dateFormatOoo:"yyyy-mm-dd",before:"Prije",after:"Poslije",andCondition:"I",orCondition:"ILI",applyFilter:"Primijeni",resetFilter:"Poni\\u0161ti",clearFilter:"O\\u010Disti",cancelFilter:"Odustani",textFilter:"Tekstualni filter",numberFilter:"Numeri\\u010Dki filter",dateFilter:"Filtar datuma",setFilter:"Filtar skupa",groupFilterSelect:"Odaberite polje:",advancedFilterContains:"sadr\\u017Ei",advancedFilterNotContains:"ne sadr\\u017Ei",advancedFilterTextEquals:"jednako",advancedFilterTextNotEqual:"nije jednako",advancedFilterStartsWith:"zapo\\u010Dinje s",advancedFilterEndsWith:"zavr\\u0161ava s",advancedFilterBlank:"je prazno",advancedFilterNotBlank:"nije prazno",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"je to\\u010Dno",advancedFilterFalse:"je neto\\u010Dno",advancedFilterAnd:"I",advancedFilterOr:"ILI",advancedFilterApply:"Primijeni",advancedFilterBuilder:"Graditelj",advancedFilterValidationMissingColumn:"Nedostaje stupac",advancedFilterValidationMissingOption:"Nedostaje opcija",advancedFilterValidationMissingValue:"Nedostaje vrijednost",advancedFilterValidationInvalidColumn:"Stupac nije prona\\u0111en",advancedFilterValidationInvalidOption:"Opcija nije prona\\u0111ena",advancedFilterValidationMissingQuote:"Vrijednosti nedostaje zavr\\u0161na navodna oznaka",advancedFilterValidationNotANumber:"Vrijednost nije broj",advancedFilterValidationInvalidDate:"Vrijednost nije valjani datum",advancedFilterValidationMissingCondition:"Nedostaje uvjet",advancedFilterValidationJoinOperatorMismatch:"Spojni operatori unutar uvjeta moraju biti isti",advancedFilterValidationInvalidJoinOpera';
      S = S + 'tor:"Spojni operator nije prona\\u0111en",advancedFilterValidationMissingEndBracket:"Nedostaje zavr\\u0161na zagrada",advancedFilterValidationExtraEndBracket:"Previ\\u0161e zavr\\u0161nih zagrada",advancedFilterValidationMessage:"Izraz ima gre\\u0161ku. ${variable} - ${variable}.",advancedFilterValidationMessageAtEnd:"Izraz ima gre\\u0161ku. ${variable} na kraju izraza.",advancedFilterBuilderTitle:"Napredni filter",advancedFilterBuilderApply:"Primijeni",advancedFilterBuilderCancel:"Odustani",advancedFilterBuilderAddButtonTooltip:"Dodaj filter ili grupu",advancedFilterBuilderRemoveButtonTooltip:"Ukloni",advancedFilterBuilderMoveUpButtonTooltip:"Pomakni gore",advancedFilterBuilderMoveDownButtonTooltip:"Pomakni dolje",advancedFilterBuilderAddJoin:"Dodaj grupu",advancedFilterBuilderAddCondition:"Dodaj filter",advancedFilterBuilderSelectColumn:"Odaberi stupac",advancedFilterBuilderSelectOption:"Odaberi opciju",advancedFilterBuilderEnterValue:"Unesi vrijednost...",advancedFilterBuilderValidationAlreadyApplied:"Trenutni filter je ve\\u0107 primijenjen.",advancedFilterBuilderValidationIncomplete:"Nisu svi uvjeti ispunjeni.",advancedFilterBuilderValidationSelectColumn:"Mora\\u0161 odabrati stupac.",advancedFilterBuilderValidationSelectOption:"Mora\\u0161 odabrati opciju.",advancedFilterBuilderValidationEnterValue:"Mora\\u0161 unijeti vrijednost.",columns:"Stupci",filters:"Filteri",pivotMode:"Na\\u010Din okretanja",groups:"Grupiranja redaka",rowGroupColumnsEmptyMessage:"Povucite ovdje za postavljanje grupiranja redaka",values:"Vrijednosti",valueColumnsEmptyMessage:"Povucite ovdje za izvo\\u0111enje agregacije",pivots:"Oznake stupaca",pivotColumnsEmptyMessage:"Povucite ovdje za postavljanje oznaka stupaca",group:"Grupa",rowDragRow:"redak",rowDragRows:"redci",loadingOoo:"U\\u010Ditavanje...",loadingError:"GRE\\u0160KA",noRowsToShow:"Nema redaka za prikaz",enabled:"Omogu\\u0107eno",pinColumn:"Prikva\\u010Di stupac",pinLeft:"Prikva\\u010Di lijevo",pinRight:"Prikva\\u010Di desno",noPin:"Bez prikva\\';
      S = S + 'u010Divanja",valueAggregation:"Agregacija vrijednosti",noAggregation:"Nema",autosizeThisColumn:"Automatski prilagodi ovaj stupac",autosizeAllColumns:"Automatski prilagodi sve stupce",groupBy:"Grupiraj po",ungroupBy:"Razgrupiraj po",ungroupAll:"Razgrupiraj sve",addToValues:"Dodaj ${variable} u vrijednosti",removeFromValues:"Ukloni ${variable} iz vrijednosti",addToLabels:"Dodaj ${variable} u oznake",removeFromLabels:"Ukloni ${variable} iz oznaka",resetColumns:"Resetiraj stupce",expandAll:"Pro\\u0161iri sve grupe redova",collapseAll:"Zatvori sve grupe redova",copy:"Kopiraj",ctrlC:"Ctrl+C",ctrlX:"Ctrl+X",copyWithHeaders:"Kopiraj s zaglavljima",copyWithGroupHeaders:"Kopiraj s grupnim zaglavljima",cut:"Izre\\u017Ei",paste:"Zalijepi",ctrlV:"Ctrl+V",export:"Izvoz",csvExport:"Izvoz u CSV",excelExport:"Izvoz u Excel",columnFilter:"Filter stupca",columnChooser:"Izbor stupaca",sortAscending:"Sortiraj uzlazno",sortDescending:"Sortiraj silazno",sortUnSort:"O\\u010Disti sortiranje",sum:"Zbroj",first:"Prvi",last:"Zadnji",min:"Min",max:"Max",none:"Ni\\u0161ta",count:"Broj",avg:"Prosjek",filteredRows:"Filtrirano",selectedRows:"Odabrano",totalRows:"Ukupno redaka",totalAndFilteredRows:"Redaka",more:"Vi\\u0161e",to:"do",of:"od",page:"Stranica",pageLastRowUnknown:"?",nextPage:"Sljede\\u0107a stranica",lastPage:"Zadnja stranica",firstPage:"Prva stranica",previousPage:"Prethodna stranica",pageSizeSelectorLabel:"Veli\\u010Dina stranice:",footerTotal:"Ukupno",pivotColumnGroupTotals:"Ukupno",pivotChartAndPivotMode:"Zakretna tabela i na\\u010Din zakretanja",pivotChart:"Zakretna tabela",chartRange:"Raspon grafikona",columnChart:"Stupac",groupedColumn:"Grupirano",stackedColumn:"Slo\\u017Eeno",normalizedColumn:"100% Slo\\u017Eeno",barChart:"Traka",groupedBar:"Grupirano",stackedBar:"Slo\\u017Eeno",normalizedBar:"100% Slo\\u017Eeno",pieChart:"Pita",pie:"Pita",donut:"Krafna",line:"Linija",xyChart:"X Y (Raspr\\u0161enost)",scatter:"Raspr\\u0161enost",bubble:"Mjehuri\\u0107",areaChart:"Podru\\u010Dje",area:"Podru\\u01';
      S = S + '0Dje",stackedArea:"Slo\\u017Eeno",normalizedArea:"100% Slo\\u017Eeno",histogramChart:"Histogram",polarChart:"Polarni",radarLine:"Radarska linija",radarArea:"Radarsko podru\\u010Dje",nightingale:"Nightingale",radialColumn:"Radijalni stupac",radialBar:"Radijalna traka",statisticalChart:"Statisti\\u010Dki",boxPlot:"Kutija graf",rangeBar:"Raspon traka",rangeArea:"Raspon podru\\u010Dje",hierarchicalChart:"Hijerarhijski",treemap:"Karta stabla",sunburst:"Sun\\u010Dev prasak",specializedChart:"Specijalizirani",waterfall:"Vodopad",heatmap:"Toplinska karta",combinationChart:"Kombinacija",columnLineCombo:"Stupac i linija",AreaColumnCombo:"Podru\\u010Dje i stupac",pivotChartTitle:"Pivot Graf",rangeChartTitle:"Graf Raspona",settings:"Graf",data:"Postavke",format:"Prilagodba",categories:"Kategorije",defaultCategory:"(Nijedna)",series:"Serije",switchCategorySeries:"Promijeni Kategoriju / Serije",categoryValues:"Vrijednosti Kategorije",seriesLabels:"Oznake Serija",aggregate:"Zbir",xyValues:"X Y Vrijednosti",paired:"Upareni Na\\u010Din",axis:"Os",xAxis:"Horizontalna Os",yAxis:"Vertikalna Os",polarAxis:"Polarna Os",radiusAxis:"Radijus Os",navigator:"Navigator",zoom:"Zum",animation:"Animacija",crosshair:"Kri\\u017E",color:"Boja",thickness:"Debljina",preferredLength:"Po\\u017Eeljna Duljina",xType:"X Tip",axisType:"Tip Osi",automatic:"Automatski",category:"Kategorija",number:"Broj",time:"Vrijeme",timeFormat:"Format Vremena",autoRotate:"Auto Rotacija",labelRotation:"Rotacija",circle:"Krug",polygon:"Poligon",square:"Kvadrat",cross:"Kri\\u017E",diamond:"Dijamant",plus:"Plus",triangle:"Trokut",heart:"Srce",orientation:"Orijentacija",fixed:"Fiksno",parallel:"Paralelno",perpendicular:"Okomito",radiusAxisPosition:"Pozicija",ticks:"Oznake",gridLines:"Mre\\u017Ene Linije",width:"\\u0160irina",height:"Visina",length:"Duljina",padding:"Razmak",spacing:"Razmak",chartStyle:"Stil Grafa",title:"Naslov",chartTitles:"Naslovi",chartTitle:"Naslov Grafa",chartSubtitle:"Podnaslov",horizontalAxisTitle:"Naslov Horizontaln';
      S = S + 'e Osi",verticalAxisTitle:"Naslov Vertikalne Osi",polarAxisTitle:"Naslov Polarne Osi",titlePlaceholder:"Naslov Grafa",background:"Pozadina",font:"Font",weight:"Te\\u017Eina",top:"Gore",right:"Desno",bottom:"Dolje",left:"Lijevo",labels:"Oznake",calloutLabels:"Natpisne Oznake",sectorLabels:"Oznake Sektora",positionRatio:"Omjer Pozicije",size:"Veli\\u010Dina",shape:"Oblik",minSize:"Minimalna Veli\\u010Dina",maxSize:"Maksimalna Veli\\u010Dina",legend:"Legenda",position:"Pozicija",markerSize:"Veli\\u010Dina Oznake",markerStroke:"Obrub Oznake",markerPadding:"Razmak Oznake",itemSpacing:"Razmak Stavki",itemPaddingX:"Razmak Stavki X",itemPaddingY:"Razmak Stavki Y",layoutHorizontalSpacing:"Horizontalni Razmak",layoutVerticalSpacing:"Vertikalni Razmak",strokeWidth:"Debljina Obruba",offset:"Pomak",offsets:"Pomaci",tooltips:"Savjeti",callout:"Natpis",markers:"Oznake",shadow:"Sjena",blur:"Zamagljenje",xOffset:"X Pomak",yOffset:"Y Pomak",lineWidth:"Debljina Linije",lineDash:"Isprekidana Linija",lineDashOffset:"Pomak Isprekidanih Linija",scrollingZoom:"Pomi\\u010Dni Zum",scrollingStep:"Korak Pomicanja",selectingZoom:"Odabir",durationMillis:"Trajanje (ms)",crosshairLabel:"Oznaka",crosshairSnap:"Snap na \\u010Cvor",normal:"Normalno",bold:"Podebljano",italic:"Kurziv",boldItalic:"Podebljano Kurziv",predefined:"Predefinirano",fillOpacity:"Prozirnost Ispune",strokeColor:"Boja Linije",strokeOpacity:"Prozirnost Linije",miniChart:"Mini Graf",histogramBinCount:"Broj Kanta",connectorLine:"Poveziva\\u010Dka Linija",seriesItems:"Stavke Serija",seriesItemType:"Tip Stavke",seriesItemPositive:"Pozitivno",seriesItemNegative:"Negativno",seriesItemLabels:"Oznake Stavki",columnGroup:"Stupac",barGroup:"Traka",pieGroup:"Pita",lineGroup:"Linija",scatterGroup:"X Y (Raspr\\u0161enje)",areaGroup:"Podru\\u010Dje",polarGroup:"Polarni",statisticalGroup:"Statisti\\u010Dki",hierarchicalGroup:"Hijerarhijski",specializedGroup:"Specijalizirani",combinationGroup:"Kombinacija",groupedColumnTooltip:"Grupirani",stackedColumnToolti';
      S = S + 'p:"Naslagani",normalizedColumnTooltip:"100% Naslagani",groupedBarTooltip:"Grupirani",stackedBarTooltip:"Naslagani",normalizedBarTooltip:"100% Naslagani",pieTooltip:"Pita",donutTooltip:"Krafna",lineTooltip:"Linija",groupedAreaTooltip:"Podru\\u010Dje",stackedAreaTooltip:"Naslagano",normalizedAreaTooltip:"100% Naslagano",scatterTooltip:"Raspr\\u0161enje",bubbleTooltip:"Balon",histogramTooltip:"Histograma",radialColumnTooltip:"Radijalni Stupac",radialBarTooltip:"Radijalna Traka",radarLineTooltip:"Radar Linija",radarAreaTooltip:"Radar Podru\\u010Dje",nightingaleTooltip:"Nightingale",rangeBarTooltip:"Raspon Trake",rangeAreaTooltip:"Raspon Podru\\u010Dja",boxPlotTooltip:"Box Plot",treemapTooltip:"Treemap",sunburstTooltip:"Sunburst",waterfallTooltip:"Slap",heatmapTooltip:"Toplinska Mapa",columnLineComboTooltip:"Stupac i Linija",areaColumnComboTooltip:"Podru\\u010Dje i Stupac",customComboTooltip:"Prilago\\u0111ena Kombinacija",innerRadius:"Unutarnji Radijus",startAngle:"Po\\u010Detni Kut",endAngle:"Zavr\\u0161ni Kut",reverseDirection:"Obrnuti Smjer",groupPadding:"Razmak Grupe",seriesPadding:"Razmak Serija",tile:"Plo\\u010Dica",whisker:"Brk",cap:"Poklopac",capLengthRatio:"Omjer Duljine",labelPlacement:"Postavljanje Oznake",inside:"Unutra",outside:"Vani",noDataToChart:"Nema podataka za prikaz.",pivotChartRequiresPivotMode:"Pivot Graf zahtijeva uklju\\u010Den Pivot na\\u010Din.",chartSettingsToolbarTooltip:"Izbornik",chartLinkToolbarTooltip:"Povezano s Mre\\u017Eom",chartUnlinkToolbarTooltip:"Nepovezano od Mre\\u017Ee",chartDownloadToolbarTooltip:"Preuzmi Graf",chartMenuToolbarTooltip:"Izbornik",chartEdit:"Uredi Graf",chartAdvancedSettings:"Napredne Postavke",chartLink:"Pove\\u017Ei s Mre\\u017Eom",chartUnlink:"Odspoji od Mre\\u017Ee",chartDownload:"Preuzmi Graf",histogramFrequency:"Frekvencija",seriesChartType:"Tip Serije Grafa",seriesType:"Tip Serije",secondaryAxis:"Sekundarna Os",seriesAdd:"Dodaj seriju",categoryAdd:"Dodaj kategoriju",bar:"Traka",column:"Stupac",histogram:"Histograma",advan';
      S = S + 'cedSettings:"Napredne Postavke",direction:"Smjer",horizontal:"Horizontalno",vertical:"Vertikalno",seriesGroupType:"Tip Grupe Serije",groupedSeriesGroupType:"Grupirani",stackedSeriesGroupType:"Naslagani",normalizedSeriesGroupType:"100% Naslagani",legendEnabled:"Omogu\\u0107eno",invalidColor:"Neva\\u017Ee\\u0107a vrijednost boje",groupedColumnFull:"Grupirani Stupac",stackedColumnFull:"Naslagani Stupac",normalizedColumnFull:"100% Naslagani Stupac",groupedBarFull:"Grupirana Traka",stackedBarFull:"Naslagana Traka",normalizedBarFull:"100% Naslagana Traka",stackedAreaFull:"Naslagano Podru\\u010Dje",normalizedAreaFull:"100% Naslagano Podru\\u010Dje",customCombo:"Prilago\\u0111ena Kombinacija",ariaAdvancedFilterBuilderItem:"${variable}. Razina ${variable}. Pritisnite ENTER za ure\\u0111ivanje.",ariaAdvancedFilterBuilderItemValidation:"${variable}. Razina ${variable}. ${variable} Pritisnite ENTER za ure\\u0111ivanje.",ariaAdvancedFilterBuilderList:"Popis naprednog graditelja filtera",ariaAdvancedFilterBuilderFilterItem:"Uvjet filtera",ariaAdvancedFilterBuilderGroupItem:"Grupa filtera",ariaAdvancedFilterBuilderColumn:"Stupac",ariaAdvancedFilterBuilderOption:"Opcija",ariaAdvancedFilterBuilderValueP:"Vrijednost",ariaAdvancedFilterBuilderJoinOperator:"Operator spajanja",ariaAdvancedFilterInput:"Unos naprednog filtera",ariaChecked:"ozna\\u010Deno",ariaColumn:"Stupac",ariaColumnGroup:"Grupa stupaca",ariaColumnFiltered:"Stupac filtriran",ariaColumnSelectAll:"Prebaci odabir svih stupaca",ariaDateFilterInput:"Unos filtera datuma",ariaDefaultListName:"Popis",ariaFilterColumnsInput:"Unos za filtriranje stupaca",ariaFilterFromValue:"Filtriraj od vrijednosti",ariaFilterInput:"Unos filtera",ariaFilterList:"Popis filtera",ariaFilterToValue:"Filtriraj do vrijednosti",ariaFilterValue:"Vrijednost filtera",ariaFilterMenuOpen:"Otvori izbornik filtera",ariaFilteringOperator:"Operator filtriranja",ariaHidden:"skriveno",ariaIndeterminate:"neodre\\u0111eno",ariaInputEditor:"Ure\\u0111iva\\u010D unosa",ariaMenuC';
      S = S + 'olumn:"Pritisnite ALT DOLJE za otvaranje izbornika stupca",ariaFilterColumn:"Pritisnite CTRL ENTER za otvaranje filtera",ariaRowDeselect:"Pritisnite SPACE za poni\\u0161tavanje odabira ovog retka",ariaRowSelectAll:"Pritisnite SPACE za uklju\\u010Divanje/isklju\\u010Divanje odabira svih redaka",ariaRowToggleSelection:"Pritisnite SPACE za uklju\\u010Divanje/isklju\\u010Divanje odabira retka",ariaRowSelect:"Pritisnite SPACE za odabir ovog retka",ariaRowSelectionDisabled:"Odabir retka je onemogu\\u0107en za ovaj redak",ariaSearch:"Pretra\\u017Eivanje",ariaSortableColumn:"Pritisnite ENTER za sortiranje",ariaToggleVisibility:"Pritisnite SPACE za uklju\\u010Divanje/isklju\\u010Divanje vidljivosti",ariaToggleCellValue:"Pritisnite SPACE za uklju\\u010Divanje/isklju\\u010Divanje vrijednosti \\u0107elije",ariaUnchecked:"neozna\\u010Deno",ariaVisible:"vidljivo",ariaSearchFilterValues:"Pretra\\u017Ei vrijednosti filtera",ariaPageSizeSelectorLabel:"Veli\\u010Dina stranice",ariaChartMenuClose:"Zatvori izbornik ure\\u0111ivanja grafikona",ariaChartSelected:"Odabrano",ariaSkeletonCellLoadingFailed:"Redak nije uspje\\u0161no u\\u010Ditan",ariaSkeletonCellLoading:"Podaci retka se u\\u010Ditavaju",ariaRowGroupDropZonePanelLabel:"Grupe redaka",ariaValuesDropZonePanelLabel:"Vrijednosti",ariaPivotDropZonePanelLabel:"Oznake stupaca",ariaDropZoneColumnComponentDescription:"Pritisnite DELETE za uklanjanje",ariaDropZoneColumnValueItemDescription:"Pritisnite ENTER za promjenu tipa agregacije",ariaDropZoneColumnGroupItemDescription:"Pritisnite ENTER za sortiranje",ariaDropZoneColumnComponentAggFuncSeparator:" od ",ariaDropZoneColumnComponentSortAscending:"uzlazno",ariaDropZoneColumnComponentSortDescending:"silazno",ariaLabelDialog:"Dijalog",ariaLabelColumnMenu:"Izbornik stupca",ariaLabelColumnFilter:"Filtar stupca",ariaLabelCellEditor:"Ure\\u0111iva\\u010D \\u0107elija",ariaLabelSelectField:"Odaberi polje",ariaLabelRichSelectField:"Polje s bogatim izborom",ariaLabelRichSelectToggleSelection:"Pritisnite RAZMAKNICU za';
      S = S + ' prebacivanje odabira",ariaLabelRichSelectDeselectAllItems:"Pritisnite DELETE za poni\\u0161tavanje odabira svih stavki",ariaLabelRichSelectDeleteSelection:"Pritisnite DELETE za poni\\u0161tavanje odabira stavke",ariaLabelTooltip:"Alatni savjet",ariaLabelContextMenu:"Kontekstni izbornik",ariaLabelSubMenu:"Podizbornik",ariaLabelAggregationFunction:"Funkcija agregacije",ariaLabelAdvancedFilterAutocomplete:"Napredna funkcija automatskog dovr\\u0161avanja filtera",ariaLabelAdvancedFilterBuilderAddField:"Napredni graditelj filtera - dodajte polje",ariaLabelAdvancedFilterBuilderColumnSelectField:"Napredni graditelj filtera - odaberite polje stupca",ariaLabelAdvancedFilterBuilderOptionSelectField:"Napredni graditelj filtera - odaberite polje opcije",ariaLabelAdvancedFilterBuilderJoinSelectField:"Napredni graditelj filtera - odaberite polje operatera za spajanje",ariaColumnPanelList:"Popis stupaca",ariaFilterPanelList:"Popis filtara",thousandSeparator:",",decimalSeparator:".",true:"Istina",false:"La\\u017Eno",invalidDate:"Neva\\u017Ee\\u0107i datum",invalidNumber:"Neva\\u017Ee\\u0107i broj",january:"Sije\\u010Danj",february:"Velja\\u010Da",march:"O\\u017Eujak",april:"Travanj",may:"Svibanj",june:"Lipanj",july:"Srpanj",august:"Kolovoz",september:"Rujan",october:"Listopad",november:"Studeni",december:"Prosinac",timeFormatSlashesDDMMYYYY:"DD/MM/GGGG",timeFormatSlashesMMDDYYYY:"MM/DD/GGGG",timeFormatSlashesDDMMYY:"DD/MM/GG",timeFormatSlashesMMDDYY:"MM/DD/GG",timeFormatDotsDDMYY:"DD.M.GG",timeFormatDotsMDDYY:"M.DD.GG",timeFormatDashesYYYYMMDD:"GGGG-MM-DD",timeFormatSpacesDDMMMMYYYY:"DD MMMM GGGG",timeFormatHHMMSS:"SS:MM:VV",timeFormatHHMMSSAmPm:"SS:MM:VV AM/PM"},S={selectAll:"(Mindet kiv\\xE1laszt)",selectAllSearchResults:"(\\xD6sszes keres\\xE9si tal\\xE1lat kiv\\xE1laszt\\xE1sa)",addCurrentSelectionToFilter:"Aktu\\xE1lis kiv\\xE1laszt\\xE1s hozz\\xE1ad\\xE1sa a sz\\u0171r\\u0151h\\xF6z",searchOoo:"Keres\\xE9s...",blanks:"(\\xDCres)",noMatches:"Nincs tal\\xE1lat",filterOoo:"Sz\\u0171r\\u0151...",equals:"Egye';
      S = S + 'nl\\u0151",notEqual:"Nem egyenl\\u0151",blank:"\\xDCres",notBlank:"Nem \\xFCres",empty:"V\\xE1lasszon egyet",lessThan:"Kevesebb mint",greaterThan:"T\\xF6bb mint",lessThanOrEqual:"Kevesebb vagy egyenl\\u0151",greaterThanOrEqual:"T\\xF6bb vagy egyenl\\u0151",inRange:"K\\xF6z\\xF6tt",inRangeStart:"Innen",inRangeEnd:"Eddig",contains:"Tartalmazza",notContains:"Nem tartalmazza",startsWith:"Ezzel kezd\\u0151dik",endsWith:"Ezzel v\\xE9gz\\u0151dik",dateFormatOoo:"yyyy-mm-dd",before:"El\\u0151tte",after:"Ut\\xE1na",andCondition:"\\xC9S",orCondition:"VAGY",applyFilter:"Alkalmaz",resetFilter:"Vissza\\xE1ll\\xEDt\\xE1s",clearFilter:"T\\xF6rl\\xE9s",cancelFilter:"M\\xE9gse",textFilter:"Sz\\xF6vegsz\\u0171r\\u0151",numberFilter:"Sz\\xE1m sz\\u0171r\\u0151",dateFilter:"D\\xE1tum sz\\u0171r\\u0151",setFilter:"K\\xE9szlet sz\\u0171r\\u0151",groupFilterSelect:"V\\xE1lassza ki a mez\\u0151t:",advancedFilterContains:"tartalmazza",advancedFilterNotContains:"nem tartalmazza",advancedFilterTextEquals:"egyenl\\u0151",advancedFilterTextNotEqual:"nem egyenl\\u0151",advancedFilterStartsWith:"ezzel kezd\\u0151dik",advancedFilterEndsWith:"ezzel v\\xE9gz\\u0151dik",advancedFilterBlank:"\\xFCres",advancedFilterNotBlank:"nem \\xFCres",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"igaz",advancedFilterFalse:"hamis",advancedFilterAnd:"\\xC9S",advancedFilterOr:"VAGY",advancedFilterApply:"Alkalmaz",advancedFilterBuilder:"Sz\\u0171r\\u0151 K\\xE9sz\\xEDt\\u0151",advancedFilterValidationMissingColumn:"Oszlop hi\\xE1nyzik",advancedFilterValidationMissingOption:"Opci\\xF3 hi\\xE1nyzik",advancedFilterValidationMissingValue:"\\xC9rt\\xE9k hi\\xE1nyzik",advancedFilterValidationInvalidColumn:"Oszlop nem tal\\xE1lhat\\xF3",advancedFilterValidationInvalidOption:"Opci\\xF3 nem tal\\xE1lhat\\xF3",advancedFilterValidationMissingQuote:"Id\\xE9z\\u0151jel hi\\xE1nyzik az \\xE9rt\\xE9k v\\xE9g\\xE9r\\u0151l",advancedFilterValidatio';
      S = S + 'nNotANumber:"\\xC9rt\\xE9k nem sz\\xE1m",advancedFilterValidationInvalidDate:"\\xC9rt\\xE9k nem \\xE9rv\\xE9nyes d\\xE1tum",advancedFilterValidationMissingCondition:"Felt\\xE9tel hi\\xE1nyzik",advancedFilterValidationJoinOperatorMismatch:"A felt\\xE9telek \\xF6sszekapcsol\\xF3 oper\\xE1torai azonosak kell, hogy legyenek",advancedFilterValidationInvalidJoinOperator:"\\xD6sszekapcsol\\xF3 oper\\xE1tor nem tal\\xE1lhat\\xF3",advancedFilterValidationMissingEndBracket:"Hi\\xE1nyz\\xF3 z\\xE1r\\xF3z\\xE1r\\xF3jelek",advancedFilterValidationExtraEndBracket:"T\\xFAl sok z\\xE1r\\xF3z\\xE1r\\xF3jel",advancedFilterValidationMessage:"A kifejez\\xE9s hib\\xE1t tartalmaz. ${variable} - ${variable}.",advancedFilterValidationMessageAtEnd:"A kifejez\\xE9s hib\\xE1t tartalmaz. ${variable} a kifejez\\xE9s v\\xE9g\\xE9n.",advancedFilterBuilderTitle:"Speci\\xE1lis Sz\\u0171r\\u0151",advancedFilterBuilderApply:"Alkalmaz",advancedFilterBuilderCancel:"M\\xE9gsem",advancedFilterBuilderAddButtonTooltip:"Sz\\u0171r\\u0151 vagy Csoport hozz\\xE1ad\\xE1sa",advancedFilterBuilderRemoveButtonTooltip:"Elt\\xE1vol\\xEDt\\xE1s",advancedFilterBuilderMoveUpButtonTooltip:"Mozgat\\xE1s felfel\\xE9",advancedFilterBuilderMoveDownButtonTooltip:"Mozgat\\xE1s lefel\\xE9",advancedFilterBuilderAddJoin:"Csoport hozz\\xE1ad\\xE1sa",advancedFilterBuilderAddCondition:"Sz\\u0171r\\u0151 hozz\\xE1ad\\xE1sa",advancedFilterBuilderSelectColumn:"Oszlop kiv\\xE1laszt\\xE1sa",advancedFilterBuilderSelectOption:"Opci\\xF3 kiv\\xE1laszt\\xE1sa",advancedFilterBuilderEnterValue:"\\xC9rt\\xE9k megad\\xE1sa...",advancedFilterBuilderValidationAlreadyApplied:"Az aktu\\xE1lis sz\\u0171r\\u0151 m\\xE1r alkalmazva.",advancedFilterBuilderValidationIncomplete:"Nem minden felt\\xE9tel teljes.",advancedFilterBuilderValidationSelectColumn:"Oszlopot kell v\\xE1lasztani.",advancedFilterBuilderValidationSelectOption:"Opci\\xF3t kell v\\xE1lasztani.",advancedFilterBuilderValidationEnterValue:"\\xC9rt\\xE9ket kell megadni.",columns:"Oszlopok",filters:"Sz\\u0171r\\u0151k",pivotMode:"Forgat\\xE1si m\\xF3d",groups:"Sor csopo';
      S = S + 'rtok",rowGroupColumnsEmptyMessage:"H\\xFAzza ide a sorcsoportok be\\xE1ll\\xEDt\\xE1s\\xE1hoz",values:"\\xC9rt\\xE9kek",valueColumnsEmptyMessage:"H\\xFAzza ide az \\xF6sszes\\xEDt\\xE9shez",pivots:"Oszlop c\\xEDmk\\xE9k",pivotColumnsEmptyMessage:"H\\xFAzza ide az oszlopc\\xEDmk\\xE9k be\\xE1ll\\xEDt\\xE1s\\xE1hoz",group:"Csoport",rowDragRow:"sor",rowDragRows:"sorok",loadingOoo:"Bet\\xF6lt\\xE9s...",loadingError:"HIBA",noRowsToShow:"Nincs megjelen\\xEDthet\\u0151 sor",enabled:"Enged\\xE9lyezve",pinColumn:"Oszlop r\\xF6gz\\xEDt\\xE9se",pinLeft:"R\\xF6gz\\xEDt\\xE9s balra",pinRight:"R\\xF6gz\\xEDt\\xE9s jobbra",noPin:"Nincs r\\xF6gz\\xEDt\\xE9s",valueAggregation:"\\xC9rt\\xE9k \\xF6sszes\\xEDt\\xE9s",noAggregation:"Nincs",autosizeThisColumn:"Oszlop automatikus \\xE1tm\\xE9retez\\xE9se",autosizeAllColumns:"\\xD6sszes oszlop automatikus \\xE1tm\\xE9retez\\xE9se",groupBy:"Csoportos\\xEDt\\xE1s",ungroupBy:"Csoportbont\\xE1s",ungroupAll:"\\xD6sszes csoport bont\\xE1sa",addToValues:"${variable} hozz\\xE1ad\\xE1sa az \\xE9rt\\xE9kekhez",removeFromValues:"${variable} elt\\xE1vol\\xEDt\\xE1sa az \\xE9rt\\xE9kek k\\xF6z\\xFCl",addToLabels:"${variable} hozz\\xE1ad\\xE1sa a c\\xEDmk\\xE9khez",removeFromLabels:"${variable} elt\\xE1vol\\xEDt\\xE1sa a c\\xEDmk\\xE9k k\\xF6z\\xFCl",resetColumns:"Oszlopok vissza\\xE1ll\\xEDt\\xE1sa",expandAll:"\\xD6sszes sorcsoport kibont\\xE1sa",collapseAll:"\\xD6sszes sorcsoport bez\\xE1r\\xE1sa",copy:"M\\xE1sol\\xE1s",ctrlC:"Ctrl+C",ctrlX:"Ctrl+X",copyWithHeaders:"M\\xE1sol\\xE1s fejl\\xE9cekkel",copyWithGroupHeaders:"M\\xE1sol\\xE1s csoportos fejl\\xE9cekkel",cut:"Kiv\\xE1g\\xE1s",paste:"Beilleszt\\xE9s",ctrlV:"Ctrl+V",export:"Export\\xE1l\\xE1s",csvExport:"CSV export\\xE1l\\xE1s",excelExport:"Excel export\\xE1l\\xE1s",columnFilter:"Oszlopsz\\u0171r\\xE9s",columnChooser:"Oszlopok kiv\\xE1laszt\\xE1sa",sortAscending:"Rendez\\xE9s n\\xF6vekv\\u0151 sorrendben",sortDescending:"Rendez\\xE9s cs\\xF6kken\\u0151 sorrendben",sortUnSort:"Rendez\\xE9s t\\xF6rl\\xE9se",sum:"\\xD6sszeg",first:"Els\\u0151",last:"Utols\\xF3",min:"Minimum",max:"Maximum",none:"Nincs",count:"Dara';
      S = S + 'bsz\\xE1m",avg:"\\xC1tlag",filteredRows:"Sz\\u0171rt",selectedRows:"Kiv\\xE1lasztott",totalRows:"\\xD6sszes sor",totalAndFilteredRows:"Sorok",more:"T\\xF6bb",to:"t\\xF3l",of:" -b\\u0151l",page:"Oldal",pageLastRowUnknown:"?",nextPage:"K\\xF6vetkez\\u0151 oldal",lastPage:"Utols\\xF3 oldal",firstPage:"Els\\u0151 oldal",previousPage:"El\\u0151z\\u0151 oldal",pageSizeSelectorLabel:"Oldalm\\xE9ret:",footerTotal:"\\xD6sszesen",pivotColumnGroupTotals:"\\xD6sszesen",pivotChartAndPivotMode:"Pivot Diagram & Pivot M\\xF3d",pivotChart:"Pivot Diagram",chartRange:"Diagram Tartom\\xE1ny",columnChart:"Oszlopdiagram",groupedColumn:"Csoportos\\xEDtott",stackedColumn:"Halmozott",normalizedColumn:"100% Halmozott",barChart:"S\\xE1vdiagram",groupedBar:"Csoportos\\xEDtott",stackedBar:"Halmozott",normalizedBar:"100% Halmozott",pieChart:"Tortadiagram",pie:"Torta",donut:"Donut",line:"Vonal",xyChart:"X Y (Sz\\xF3rt)",scatter:"Sz\\xF3rt",bubble:"Bubor\\xE9k",areaChart:"Ter\\xFCletdiagram",area:"Ter\\xFClet",stackedArea:"Halmozott",normalizedArea:"100% Halmozott",histogramChart:"Hisztogram",polarChart:"Pol\\xE1ris",radarLine:"Radar Vonal",radarArea:"Radar Ter\\xFClet",nightingale:"Nightingale",radialColumn:"Radi\\xE1lis Oszlop",radialBar:"Radi\\xE1lis S\\xE1v",statisticalChart:"Statisztikai",boxPlot:"Box Plot",rangeBar:"Tartom\\xE1ny S\\xE1v",rangeArea:"Tartom\\xE1ny Ter\\xFClet",hierarchicalChart:"Hierarchikus",treemap:"Fa diagram",sunburst:"Napkit\\xF6r\\xE9s",specializedChart:"Speci\\xE1lis",waterfall:"V\\xEDzese\\xE9s",heatmap:"H\\u0151t\\xE9rk\\xE9p",combinationChart:"Kombin\\xE1lt Diagram",columnLineCombo:"Oszlop & Vonal",AreaColumnCombo:"Ter\\xFClet & Oszlop",pivotChartTitle:"Forgat\\xF3diagram",rangeChartTitle:"Tartom\\xE1nydiagram",settings:"Diagram",data:"Be\\xE1ll\\xEDt\\xE1sok",format:"Testreszab\\xE1s",categories:"Kateg\\xF3ri\\xE1k",defaultCategory:"(Nincs)",series:"Sorozat",switchCategorySeries:"Kateg\\xF3ria / Sorozat v\\xE1lt\\xE1sa",categoryValues:"Kateg\\xF3ria\\xE9rt\\xE9kek",seriesLabels:"Sorozatc\\xEDmk\\xE9k",aggregate:"\\xD6sszegz\\xE';
      S = S + '9s",xyValues:"X Y \\xE9rt\\xE9kek",paired:"P\\xE1ros\\xEDtott m\\xF3d",axis:"Tengely",xAxis:"V\\xEDzszintes tengely",yAxis:"F\\xFCgg\\u0151leges tengely",polarAxis:"Pol\\xE1ris tengely",radiusAxis:"Sug\\xE1rtengely",navigator:"Navig\\xE1tor",zoom:"Nagy\\xEDt\\xE1s",animation:"Anim\\xE1ci\\xF3",crosshair:"C\\xE9lkereszt",color:"Sz\\xEDn",thickness:"Vastags\\xE1g",preferredLength:"El\\u0151nyben r\\xE9szes\\xEDtett hossz",xType:"X t\\xEDpus",axisType:"Tengely t\\xEDpusa",automatic:"Automatikus",category:"Kateg\\xF3ria",number:"Sz\\xE1m",time:"Id\\u0151",timeFormat:"Id\\u0151form\\xE1tum",autoRotate:"Automatikus forgat\\xE1s",labelRotation:"C\\xEDmkeforgat\\xE1s",circle:"K\\xF6r",polygon:"Soksz\\xF6g",square:"N\\xE9gyzet",cross:"Kereszt",diamond:"Rombusz",plus:"Plusz",triangle:"H\\xE1romsz\\xF6g",heart:"Sz\\xEDv",orientation:"T\\xE1jol\\xE1s",fixed:"R\\xF6gz\\xEDtett",parallel:"P\\xE1rhuzamos",perpendicular:"Mer\\u0151leges",radiusAxisPosition:"Poz\\xEDci\\xF3",ticks:"Jel\\xF6l\\xE9sek",gridLines:"R\\xE1csvonalak",width:"Sz\\xE9less\\xE9g",height:"Magass\\xE1g",length:"Hossz",padding:"Kihagy\\xE1s",spacing:"T\\xE1vols\\xE1g",chartStyle:"Diagram st\\xEDlus",title:"C\\xEDm",chartTitles:"C\\xEDmek",chartTitle:"Diagram c\\xEDme",chartSubtitle:"Alc\\xEDm",horizontalAxisTitle:"V\\xEDzszintes tengely c\\xEDme",verticalAxisTitle:"F\\xFCgg\\u0151leges tengely c\\xEDme",polarAxisTitle:"Pol\\xE1ris tengely c\\xEDme",titlePlaceholder:"Diagram c\\xEDme",background:"H\\xE1tt\\xE9r",font:"Bet\\u0171t\\xEDpus",weight:"S\\xFAly",top:"Fels\\u0151",right:"Jobb",bottom:"Als\\xF3",left:"Bal",labels:"C\\xEDmk\\xE9k",calloutLabels:"Figyelmeztet\\u0151 c\\xEDmk\\xE9k",sectorLabels:"Szeletc\\xEDmk\\xE9k",positionRatio:"Poz\\xEDci\\xF3 ar\\xE1ny",size:"M\\xE9ret",shape:"Alak",minSize:"Minim\\xE1lis m\\xE9ret",maxSize:"Maxim\\xE1lis m\\xE9ret",legend:"Jelmagyar\\xE1zat",position:"Poz\\xEDci\\xF3",markerSize:"Jelz\\u0151 m\\xE9ret",markerStroke:"Jelz\\u0151 vonal",markerPadding:"Jelz\\u0151 kihagy\\xE1s",itemSpacing:"Elemk\\xF6z",itemPaddingX:"Elem kihagy\\xE1s X",itemPaddingY:"Elem kihagy\\xE1';
      S = S + 's Y",layoutHorizontalSpacing:"V\\xEDzszintes t\\xE1vols\\xE1g",layoutVerticalSpacing:"F\\xFCgg\\u0151leges t\\xE1vols\\xE1g",strokeWidth:"Vonalvastags\\xE1g",offset:"Eltol\\xE1s",offsets:"Eltol\\xE1sok",tooltips:"Eszk\\xF6ztippek",callout:"Figyelmeztet\\xE9s",markers:"Jelz\\u0151k",shadow:"\\xC1rny\\xE9k",blur:"Elmos\\xE1s",xOffset:"X eltol\\xE1s",yOffset:"Y eltol\\xE1s",lineWidth:"Vonalvastags\\xE1g",lineDash:"Szaggatott vonal",lineDashOffset:"Szaggatott vonal eltol\\xE1s",scrollingZoom:"G\\xF6rget\\xE9s",scrollingStep:"G\\xF6rget\\xE9si l\\xE9p\\xE9s",selectingZoom:"Kiv\\xE1laszt\\xE1s",durationMillis:"Id\\u0151tartam (ms)",crosshairLabel:"C\\xEDmke",crosshairSnap:"Csom\\xF3ponthoz r\\xF6gz\\xEDt\\xE9s",normal:"Norm\\xE1l",bold:"F\\xE9lk\\xF6v\\xE9r",italic:"D\\u0151lt",boldItalic:"F\\xE9lk\\xF6v\\xE9r d\\u0151lt",predefined:"El\\u0151re defini\\xE1lt",fillOpacity:"Kit\\xF6lt\\xE9si \\xE1tl\\xE1tszatlans\\xE1g",strokeColor:"Vonal sz\\xEDn",strokeOpacity:"Vonal \\xE1tl\\xE1tszatlans\\xE1g",miniChart:"Mini-diagram",histogramBinCount:"Bin sz\\xE1m",connectorLine:"\\xD6sszek\\xF6t\\u0151 vonal",seriesItems:"Sorozat elemek",seriesItemType:"Elem t\\xEDpusa",seriesItemPositive:"Pozit\\xEDv",seriesItemNegative:"Negat\\xEDv",seriesItemLabels:"Elemc\\xEDmk\\xE9k",columnGroup:"Oszlop",barGroup:"S\\xE1v",pieGroup:"Torta",lineGroup:"Vonal",scatterGroup:"X Y (Sz\\xF3r\\xE1s)",areaGroup:"Ter\\xFClet",polarGroup:"Pol\\xE1ris",statisticalGroup:"Statisztikai",hierarchicalGroup:"Hierarchikus",specializedGroup:"Speci\\xE1lis",combinationGroup:"Kombin\\xE1lt",groupedColumnTooltip:"Csoportos\\xEDtott",stackedColumnTooltip:"Halmozott",normalizedColumnTooltip:"100% Halmozott",groupedBarTooltip:"Csoportos\\xEDtott",stackedBarTooltip:"Halmozott",normalizedBarTooltip:"100% Halmozott",pieTooltip:"Torta",donutTooltip:"F\\xE1nk",lineTooltip:"Vonal",groupedAreaTooltip:"Ter\\xFClet",stackedAreaTooltip:"Halmozott",normalizedAreaTooltip:"100% Halmozott",scatterTooltip:"Sz\\xF3r\\xE1s",bubbleTooltip:"Bubor\\xE9k",histogramTooltip:"Hisztogram",radialColumnTooltip:"Radi\\xE1li';
      S = S + 's oszlop",radialBarTooltip:"Radi\\xE1lis s\\xE1v",radarLineTooltip:"Radar vonal",radarAreaTooltip:"Radar ter\\xFClet",nightingaleTooltip:"Nightingale",rangeBarTooltip:"Tartom\\xE1nys\\xE1v",rangeAreaTooltip:"Tartom\\xE1nyter\\xFClet",boxPlotTooltip:"Box diagram",treemapTooltip:"Fastrukt\\xFAra",sunburstTooltip:"Napkit\\xF6r\\xE9s",waterfallTooltip:"V\\xEDzes\\xE9s",heatmapTooltip:"H\\u0151t\\xE9rk\\xE9p",columnLineComboTooltip:"Oszlop \\xE9s vonal",areaColumnComboTooltip:"Ter\\xFClet \\xE9s oszlop",customComboTooltip:"Egyedi kombin\\xE1ci\\xF3",innerRadius:"Bels\\u0151 sug\\xE1r",startAngle:"Kezd\\u0151sz\\xF6g",endAngle:"V\\xE9gsz\\xF6g",reverseDirection:"Ir\\xE1ny megford\\xEDt\\xE1sa",groupPadding:"Csoportkifut\\xE1s",seriesPadding:"Sorozatkifut\\xE1s",tile:"Csempe",whisker:"Sz\\xE1l",cap:"Sapka",capLengthRatio:"Hosszarany",labelPlacement:"C\\xEDmkeelhelyez\\xE9s",inside:"Belsej\\xE9ben",outside:"K\\xEDv\\xFCl",noDataToChart:"Nincs el\\xE9rhet\\u0151 adat diagramra.",pivotChartRequiresPivotMode:"A forgat\\xF3diagramhoz pivot m\\xF3d bekapcsol\\xE1sa sz\\xFCks\\xE9ges.",chartSettingsToolbarTooltip:"Men\\xFC",chartLinkToolbarTooltip:"R\\xE1cshoz csatolva",chartUnlinkToolbarTooltip:"R\\xE1cst\\xF3l lev\\xE1lasztva",chartDownloadToolbarTooltip:"Diagram let\\xF6lt\\xE9se",chartMenuToolbarTooltip:"Men\\xFC",chartEdit:"Diagram szerkeszt\\xE9se",chartAdvancedSettings:"Speci\\xE1lis be\\xE1ll\\xEDt\\xE1sok",chartLink:"Csatol\\xE1s a r\\xE1cshoz",chartUnlink:"Lev\\xE1laszt\\xE1s a r\\xE1csr\\xF3l",chartDownload:"Diagram let\\xF6lt\\xE9se",histogramFrequency:"Gyakoris\\xE1g",seriesChartType:"Sorozatdiagram t\\xEDpusa",seriesType:"Sorozat t\\xEDpusa",secondaryAxis:"M\\xE1sodlagos tengely",seriesAdd:"Sorozat hozz\\xE1ad\\xE1sa",categoryAdd:"Kateg\\xF3ria hozz\\xE1ad\\xE1sa",bar:"S\\xE1v",column:"Oszlop",histogram:"Hisztogram",advancedSettings:"Speci\\xE1lis be\\xE1ll\\xEDt\\xE1sok",direction:"Ir\\xE1ny",horizontal:"V\\xEDzszintes",vertical:"F\\xFCgg\\u0151leges",seriesGroupType:"Csoport t\\xEDpusa",groupedSeriesGroupType:"Csoportos\\xEDtott",stackedSeriesGrou';
      S = S + 'pType:"Halmozott",normalizedSeriesGroupType:"100% Halmozott",legendEnabled:"Bekapcsolva",invalidColor:"Sz\\xEDn\\xE9rt\\xE9k \\xE9rv\\xE9nytelen",groupedColumnFull:"Csoportos\\xEDtott oszlop",stackedColumnFull:"Halmozott oszlop",normalizedColumnFull:"100% Halmozott oszlop",groupedBarFull:"Csoportos\\xEDtott s\\xE1v",stackedBarFull:"Halmozott s\\xE1v",normalizedBarFull:"100% Halmozott s\\xE1v",stackedAreaFull:"Halmozott ter\\xFClet",normalizedAreaFull:"100% Halmozott ter\\xFClet",customCombo:"Egyedi kombin\\xE1ci\\xF3",ariaAdvancedFilterBuilderItem:"${variable}. Szint ${variable}. Nyomja meg az ENTER billenty\\u0171t a szerkeszt\\xE9shez.",ariaAdvancedFilterBuilderItemValidation:"${variable}. Szint ${variable}. ${variable} Nyomja meg az ENTER billenty\\u0171t a szerkeszt\\xE9shez.",ariaAdvancedFilterBuilderList:"Speci\\xE1lis sz\\u0171r\\u0151 k\\xE9sz\\xEDt\\u0151 lista",ariaAdvancedFilterBuilderFilterItem:"Sz\\u0171r\\xE9si felt\\xE9tel",ariaAdvancedFilterBuilderGroupItem:"Sz\\u0171r\\xE9si csoport",ariaAdvancedFilterBuilderColumn:"Oszlop",ariaAdvancedFilterBuilderOption:"Opci\\xF3",ariaAdvancedFilterBuilderValueP:"\\xC9rt\\xE9k",ariaAdvancedFilterBuilderJoinOperator:"Egyes\\xEDt\\u0151 oper\\xE1tor",ariaAdvancedFilterInput:"Speci\\xE1lis sz\\u0171r\\u0151 bevitel",ariaChecked:"kiv\\xE1lasztva",ariaColumn:"Oszlop",ariaColumnGroup:"Oszlop csoport",ariaColumnFiltered:"Sz\\u0171rt oszlop",ariaColumnSelectAll:"\\xD6sszes oszlop kiv\\xE1laszt\\xE1sa v\\xE1lt\\xE1sa",ariaDateFilterInput:"D\\xE1tum sz\\u0171r\\u0151 bevitel",ariaDefaultListName:"Lista",ariaFilterColumnsInput:"Oszlopok sz\\u0171r\\xE9se bevitel",ariaFilterFromValue:"Sz\\u0171r\\xE9s \\xE9rt\\xE9kt\\u0151l",ariaFilterInput:"Sz\\u0171r\\u0151 bevitel",ariaFilterList:"Sz\\u0171r\\u0151 lista",ariaFilterToValue:"Sz\\u0171r\\xE9s \\xE9rt\\xE9kig",ariaFilterValue:"Sz\\u0171r\\u0151 \\xE9rt\\xE9k",ariaFilterMenuOpen:"Sz\\u0171r\\u0151 men\\xFC megnyit\\xE1sa",ariaFilteringOperator:"Sz\\u0171r\\u0151 oper\\xE1tor",ariaHidden:"elrejtve",ariaIndeterminate:"hat\\xE1rozatlan",ariaInputEditor';
      S = S + ':"Bevitel szerkeszt\\u0151",ariaMenuColumn:"Nyomja le az ALT + LE billenty\\u0171t az oszlop men\\xFC megnyit\\xE1s\\xE1hoz",ariaFilterColumn:"Nyomja meg a CTRL + ENTER billenty\\u0171ket a sz\\u0171r\\u0151 megnyit\\xE1s\\xE1hoz",ariaRowDeselect:"Nyomja le a SPACE billenty\\u0171t ezen sor kiv\\xE1laszt\\xE1s\\xE1nak megsz\\xFCntet\\xE9s\\xE9hez",ariaRowSelectAll:"Nyomja le a SPACE billenty\\u0171t az \\xF6sszes sor kiv\\xE1laszt\\xE1s\\xE1nak v\\xE1lt\\xE1s\\xE1hoz",ariaRowToggleSelection:"Nyomja le a SPACE billenty\\u0171t a sor kiv\\xE1laszt\\xE1s\\xE1nak v\\xE1lt\\xE1s\\xE1hoz",ariaRowSelect:"Nyomja le a SPACE billenty\\u0171t ezen sor kiv\\xE1laszt\\xE1s\\xE1hoz",ariaRowSelectionDisabled:"A sor kiv\\xE1laszt\\xE1sa le van tiltva ehhez a sorhoz",ariaSearch:"Keres\\xE9s",ariaSortableColumn:"Nyomja meg az ENTER billenty\\u0171t a rendez\\xE9shez",ariaToggleVisibility:"Nyomja meg a SPACE billenty\\u0171t a l\\xE1that\\xF3s\\xE1g v\\xE1lt\\xE1s\\xE1hoz",ariaToggleCellValue:"Nyomja meg a SPACE billenty\\u0171t a cella \\xE9rt\\xE9k\\xE9nek v\\xE1lt\\xE1s\\xE1hoz",ariaUnchecked:"nincs kiv\\xE1lasztva",ariaVisible:"l\\xE1that\\xF3",ariaSearchFilterValues:"Keres\\xE9s sz\\u0171r\\u0151 \\xE9rt\\xE9kek k\\xF6z\\xF6tt",ariaPageSizeSelectorLabel:"Oldal m\\xE9ret",ariaChartMenuClose:"Diagram szerkeszt\\xE9si men\\xFC bez\\xE1r\\xE1sa",ariaChartSelected:"Kiv\\xE1lasztva",ariaSkeletonCellLoadingFailed:"A sor bet\\xF6lt\\xE9se sikertelen volt",ariaSkeletonCellLoading:"A sor adatai bet\\xF6lt\\u0151dnek",ariaRowGroupDropZonePanelLabel:"Sor csoportok",ariaValuesDropZonePanelLabel:"\\xC9rt\\xE9kek",ariaPivotDropZonePanelLabel:"Oszlop c\\xEDmk\\xE9k",ariaDropZoneColumnComponentDescription:"Nyomja meg a DELETE-t\\xE1, hogy elt\\xE1vol\\xEDtsa",ariaDropZoneColumnValueItemDescription:"Nyomja meg az ENTER-t, hogy megv\\xE1ltoztassa az aggreg\\xE1ci\\xF3 t\\xEDpus\\xE1t",ariaDropZoneColumnGroupItemDescription:"Nyomja meg az ENTER-t, hogy rendezze",ariaDropZoneColumnComponentAggFuncSeparator:" k\\xF6z\\xFCl ",ariaDropZoneColumnComponentSortAscending:"n\\xF6vekv\\u0151",ariaD';
      S = S + 'ropZoneColumnComponentSortDescending:"cs\\xF6kken\\u0151",ariaLabelDialog:"P\\xE1rbesz\\xE9dpanel",ariaLabelColumnMenu:"Oszlop men\\xFC",ariaLabelColumnFilter:"Oszlop sz\\u0171r\\u0151",ariaLabelCellEditor:"Cella szerkeszt\\u0151",ariaLabelSelectField:"Mez\\u0151 kiv\\xE1laszt\\xE1sa",ariaLabelRichSelectField:"Gazdag kiv\\xE1laszt\\xE1si mez\\u0151",ariaLabelRichSelectToggleSelection:"Nyomja meg a SPACE-t a kiv\\xE1laszt\\xE1s v\\xE1lt\\xE1s\\xE1hoz",ariaLabelRichSelectDeselectAllItems:"Nyomja meg a DELETE-t minden elem kiv\\xE1laszt\\xE1s\\xE1nak megsz\\xFCntet\\xE9s\\xE9hez",ariaLabelRichSelectDeleteSelection:"Nyomja meg a DELETE-t az elem kiv\\xE1laszt\\xE1s\\xE1nak megsz\\xFCntet\\xE9s\\xE9hez",ariaLabelTooltip:"Tooltip",ariaLabelContextMenu:"Kontekstusmen\\xFC",ariaLabelSubMenu:"Almen\\xFC",ariaLabelAggregationFunction:"\\xD6sszes\\xEDt\\u0151 f\\xFCggv\\xE9ny",ariaLabelAdvancedFilterAutocomplete:"Fejlett sz\\u0171r\\u0151 automatikus kieg\\xE9sz\\xEDt\\xE9s",ariaLabelAdvancedFilterBuilderAddField:"Fejlett sz\\u0171r\\u0151 k\\xE9sz\\xEDt\\u0151 mez\\u0151 hozz\\xE1ad\\xE1sa",ariaLabelAdvancedFilterBuilderColumnSelectField:"Fejlett sz\\u0171r\\u0151 k\\xE9sz\\xEDt\\u0151 oszlop kiv\\xE1laszt\\xF3 mez\\u0151",ariaLabelAdvancedFilterBuilderOptionSelectField:"Fejlett sz\\u0171r\\u0151 k\\xE9sz\\xEDt\\u0151 opci\\xF3 kiv\\xE1laszt\\xF3 mez\\u0151",ariaLabelAdvancedFilterBuilderJoinSelectField:"Fejlett sz\\u0171r\\u0151 k\\xE9sz\\xEDt\\u0151 \\xF6sszekapcsol\\xF3 oper\\xE1tor mez\\u0151",ariaColumnPanelList:"Oszloplista",ariaFilterPanelList:"Sz\\u0171r\\u0151lista",thousandSeparator:".",decimalSeparator:",",true:"Igaz",false:"Hamis",invalidDate:"\\xC9rv\\xE9nytelen d\\xE1tum",invalidNumber:"\\xC9rv\\xE9nytelen sz\\xE1m",january:"Janu\\xE1r",february:"Febru\\xE1r",march:"M\\xE1rcius",april:"\\xC1prilis",may:"M\\xE1jus",june:"J\\xFAnius",july:"J\\xFAlius",august:"Augusztus",september:"Szeptember",october:"Okt\\xF3ber",november:"November",december:"December",timeFormatSlashesDDMMYYYY:"NN/HH/\\xC9\\xC9\\xC9\\xC9",timeFormatSlashesMMDDYYYY:"HH/NN/\\xC9\\xC9\\xC9\\xC9",t';
      S = S + 'imeFormatSlashesDDMMYY:"NN/HH/\\xC9\\xC9",timeFormatSlashesMMDDYY:"HH/NN/\\xC9\\xC9",timeFormatDotsDDMYY:"NN.H.\\xC9\\xC9",timeFormatDotsMDDYY:"H.NN.\\xC9\\xC9",timeFormatDashesYYYYMMDD:"\\xC9\\xC9\\xC9\\xC9-HH-NN",timeFormatSpacesDDMMMMYYYY:"NN MMMM \\xC9\\xC9\\xC9\\xC9",timeFormatHHMMSS:"\\xD3\\xD3:PP:MP",timeFormatHHMMSSAmPm:"\\xD3\\xD3:PP:MP DE/DU"},k={selectAll:"(Seleziona tutto)",selectAllSearchResults:"(Seleziona tutti i risultati della ricerca)",addCurrentSelectionToFilter:"Aggiungi selezione corrente al filtro",searchOoo:"Cerca...",blanks:"(Vuoti)",noMatches:"Nessuna corrispondenza",filterOoo:"Filtra...",equals:"Uguale",notEqual:"Diverso",blank:"Vuoto",notBlank:"Non vuoto",empty:"Scegli uno",lessThan:"Meno di",greaterThan:"Pi\\xF9 di",lessThanOrEqual:"Minore o uguale a",greaterThanOrEqual:"Maggiore o uguale a",inRange:"Tra",inRangeStart:"Da",inRangeEnd:"A",contains:"Contiene",notContains:"Non contiene",startsWith:"Inizia con",endsWith:"Finisce con",dateFormatOoo:"yyyy-mm-dd",before:"Prima",after:"Dopo",andCondition:"E",orCondition:"O",applyFilter:"Applica",resetFilter:"Reimposta",clearFilter:"Pulisci",cancelFilter:"Annulla",textFilter:"Filtro di testo",numberFilter:"Filtro numerico",dateFilter:"Filtro data",setFilter:"Filtro set",groupFilterSelect:"Seleziona campo:",advancedFilterContains:"contiene",advancedFilterNotContains:"non contiene",advancedFilterTextEquals:"\\xE8 uguale a",advancedFilterTextNotEqual:"non \\xE8 uguale a",advancedFilterStartsWith:"inizia con",advancedFilterEndsWith:"termina con",advancedFilterBlank:"\\xE8 vuoto",advancedFilterNotBlank:"non \\xE8 vuoto",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"\\xE8 vero",advancedFilterFalse:"\\xE8 falso",advancedFilterAnd:"E",advancedFilterOr:"O",advancedFilterApply:"Applica",advancedFilterBuilder:"Costruttore",advancedFilterValidationMissingColumn:"Colonna mancante",a';
      S = S + 'dvancedFilterValidationMissingOption:"Opzione mancante",advancedFilterValidationMissingValue:"Valore mancante",advancedFilterValidationInvalidColumn:"Colonna non trovata",advancedFilterValidationInvalidOption:"Opzione non trovata",advancedFilterValidationMissingQuote:"Il valore manca di una virgolette finale",advancedFilterValidationNotANumber:"Il valore non \\xE8 un numero",advancedFilterValidationInvalidDate:"Il valore non \\xE8 una data valida",advancedFilterValidationMissingCondition:"Condizione mancante",advancedFilterValidationJoinOperatorMismatch:"Gli operatori di unione all\'interno di una condizione devono essere uguali",advancedFilterValidationInvalidJoinOperator:"Operatore di unione non trovato",advancedFilterValidationMissingEndBracket:"Parentesi di chiusura mancante",advancedFilterValidationExtraEndBracket:"Troppe parentesi di chiusura",advancedFilterValidationMessage:"L\'espressione ha un errore. ${variable} - ${variable}.",advancedFilterValidationMessageAtEnd:"L\'espressione ha un errore. ${variable} alla fine dell\'espressione.",advancedFilterBuilderTitle:"Filtro Avanzato",advancedFilterBuilderApply:"Applica",advancedFilterBuilderCancel:"Annulla",advancedFilterBuilderAddButtonTooltip:"Aggiungi Filtro o Gruppo",advancedFilterBuilderRemoveButtonTooltip:"Rimuovi",advancedFilterBuilderMoveUpButtonTooltip:"Sposta Su",advancedFilterBuilderMoveDownButtonTooltip:"Sposta Gi\\xF9",advancedFilterBuilderAddJoin:"Aggiungi Gruppo",advancedFilterBuilderAddCondition:"Aggiungi Filtro",advancedFilterBuilderSelectColumn:"Seleziona una colonna",advancedFilterBuilderSelectOption:"Seleziona un\'opzione",advancedFilterBuilderEnterValue:"Inserisci un valore...",advancedFilterBuilderValidationAlreadyApplied:"Filtro corrente gi\\xE0 applicato.",advancedFilterBuilderValidationIncomplete:"Non tutte le condizioni sono complete.",advancedFilterBuilderValidationSelectColumn:"Devi selezionare una colonna.",advancedFilterBuilderValidationSelectOption:"Devi selezionare un\'opzione.",advancedFi';
      S = S + 'lterBuilderValidationEnterValue:"Devi inserire un valore.",columns:"Colonne",filters:"Filtri",pivotMode:"Modalit\\xE0 pivot",groups:"Raggruppamenti di righe",rowGroupColumnsEmptyMessage:"Trascina qui per impostare i gruppi di righe",values:"Valori",valueColumnsEmptyMessage:"Trascina qui per aggregare",pivots:"Etichette di colonna",pivotColumnsEmptyMessage:"Trascina qui per impostare le etichette di colonna",group:"Gruppo",rowDragRow:"riga",rowDragRows:"righe",loadingOoo:"Caricamento...",loadingError:"ERR",noRowsToShow:"Nessuna riga da mostrare",enabled:"Abilitato",pinColumn:"Blocca Colonna",pinLeft:"Blocca a Sinistra",pinRight:"Blocca a Destra",noPin:"Non Bloccare",valueAggregation:"Aggregazione Valori",noAggregation:"Nessuna",autosizeThisColumn:"Dimensiona Automaticamente Questa Colonna",autosizeAllColumns:"Dimensiona Automaticamente Tutte le Colonne",groupBy:"Raggruppa per",ungroupBy:"Separa gruppo per",ungroupAll:"Separa Tutti i Gruppi",addToValues:"Aggiungi ${variable} ai valori",removeFromValues:"Rimuovi ${variable} dai valori",addToLabels:"Aggiungi ${variable} alle etichette",removeFromLabels:"Rimuovi ${variable} dalle etichette",resetColumns:"Reimposta Colonne",expandAll:"Espandi Tutti i Gruppi di Righe",collapseAll:"Chiudi Tutti i Gruppi di Righe",copy:"Copia",ctrlC:"Ctrl+C",ctrlX:"Ctrl+X",copyWithHeaders:"Copia con Intestazioni",copyWithGroupHeaders:"Copia con Intestazioni di Gruppo",cut:"Taglia",paste:"Incolla",ctrlV:"Ctrl+V",export:"Esporta",csvExport:"Esporta CSV",excelExport:"Esporta Excel",columnFilter:"Filtro Colonna",columnChooser:"Scegli Colonne",sortAscending:"Ordina in modo Ascendente",sortDescending:"Ordina in modo Discendente",sortUnSort:"Annulla Ordinamento",sum:"Somma",first:"Primo",last:"Ultimo",min:"Minimo",max:"Massimo",none:"Nessuno",count:"Conteggio",avg:"Media",filteredRows:"Filtrati",selectedRows:"Selezionati",totalRows:"Righe Totali",totalAndFilteredRows:"Righe",more:"Altro",to:"a",of:"di",page:"Pagina",pageLastRowUnknown:"?",nextPage:"';
      S = S + 'Pagina Successiva",lastPage:"Ultima Pagina",firstPage:"Prima Pagina",previousPage:"Pagina Precedente",pageSizeSelectorLabel:"Dimensione Pagina:",footerTotal:"Totale",pivotColumnGroupTotals:"Totale",pivotChartAndPivotMode:"Grafico Pivot e Modalit\\xE0 Pivot",pivotChart:"Grafico Pivot",chartRange:"Intervallo Grafico",columnChart:"Colonna",groupedColumn:"Raggruppato",stackedColumn:"Impilato",normalizedColumn:"100% Impilato",barChart:"Barra",groupedBar:"Raggruppato",stackedBar:"Impilato",normalizedBar:"100% Impilato",pieChart:"Torta",pie:"Torta",donut:"Ciambella",line:"Linea",xyChart:"X Y (Dispersione)",scatter:"Dispersione",bubble:"Bolla",areaChart:"Area",area:"Area",stackedArea:"Impilata",normalizedArea:"100% Impilata",histogramChart:"Istogramma",polarChart:"Polare",radarLine:"Linea Radar",radarArea:"Area Radar",nightingale:"Rosa di Nightingale",radialColumn:"Colonna Radiale",radialBar:"Barra Radiale",statisticalChart:"Statistico",boxPlot:"Box Plot",rangeBar:"Barra Intervallo",rangeArea:"Area Intervallo",hierarchicalChart:"Gerarchico",treemap:"Mappa ad Albero",sunburst:"Raggiera",specializedChart:"Specializzato",waterfall:"Cascata",heatmap:"Mappa di Calore",combinationChart:"Combinazione",columnLineCombo:"Colonna e Linea",AreaColumnCombo:"Area e Colonna",pivotChartTitle:"Grafico Pivot",rangeChartTitle:"Grafico a Intervallo",settings:"Grafico",data:"Impostazioni",format:"Personalizza",categories:"Categorie",defaultCategory:"(Nessuno)",series:"Serie",switchCategorySeries:"Scambia Categoria / Serie",categoryValues:"Valori Categorie",seriesLabels:"Etichette Serie",aggregate:"Aggrega",xyValues:"Valori X Y",paired:"Modalit\\xE0 Abbinata",axis:"Asse",xAxis:"Asse Orizzontale",yAxis:"Asse Verticale",polarAxis:"Asse Polare",radiusAxis:"Asse del Raggio",navigator:"Navigatore",zoom:"Zoom",animation:"Animazione",crosshair:"Mirino",color:"Colore",thickness:"Spessore",preferredLength:"Lunghezza Preferita",xType:"Tipo X",axisType:"Tipo di Asse",automatic:"Automatico",category:"Categori';
      S = S + 'a",number:"Numero",time:"Tempo",timeFormat:"Formato Ora",autoRotate:"Rotazione Automatica",labelRotation:"Rotazione",circle:"Cerchio",polygon:"Poligono",square:"Quadrato",cross:"Croce",diamond:"Diamante",plus:"Pi\\xF9",triangle:"Triangolo",heart:"Cuore",orientation:"Orientamento",fixed:"Fisso",parallel:"Parallelo",perpendicular:"Perpendicolare",radiusAxisPosition:"Posizione",ticks:"Ticchettii",gridLines:"Linee della Griglia",width:"Larghezza",height:"Altezza",length:"Lunghezza",padding:"Margine Interno",spacing:"Spaziatura",chartStyle:"Stile del Grafico",title:"Titolo",chartTitles:"Titoli",chartTitle:"Titolo del Grafico",chartSubtitle:"Sottotitolo",horizontalAxisTitle:"Titolo dell\'Asse Orizzontale",verticalAxisTitle:"Titolo dell\'Asse Verticale",polarAxisTitle:"Titolo dell\'Asse Polare",titlePlaceholder:"Titolo del Grafico",background:"Sfondo",font:"Carattere",weight:"Peso",top:"Sopra",right:"Destra",bottom:"Sotto",left:"Sinistra",labels:"Etichette",calloutLabels:"Etichette di Richiamo",sectorLabels:"Etichette Settori",positionRatio:"Rapporto di Posizione",size:"Dimensione",shape:"Forma",minSize:"Dimensione Minima",maxSize:"Dimensione Massima",legend:"Legenda",position:"Posizione",markerSize:"Dimensione Marcatore",markerStroke:"Tratto Marcatore",markerPadding:"Margine Interno Marcatore",itemSpacing:"Spaziatura Elementi",itemPaddingX:"Margine Interno Elemento X",itemPaddingY:"Margine Interno Elemento Y",layoutHorizontalSpacing:"Spaziatura Orizzontale",layoutVerticalSpacing:"Spaziatura Verticale",strokeWidth:"Spessore Linea",offset:"Offset",offsets:"Offsets",tooltips:"Suggerimenti",callout:"Richiamo",markers:"Marcatori",shadow:"Ombra",blur:"Sfocatura",xOffset:"Offset X",yOffset:"Offset Y",lineWidth:"Spessore Linea",lineDash:"Tratteggio Linea",lineDashOffset:"Offset Linea Tratteggiata",scrollingZoom:"Scorrimento",scrollingStep:"Intervallo Scorrimento",selectingZoom:"Selezione",durationMillis:"Durata (ms)",crosshairLabel:"Etichetta",crosshairSnap:"Aggancio al Nodo",normal:';
      S = S + '"Normale",bold:"Grassetto",italic:"Corsivo",boldItalic:"Grassetto Corsivo",predefined:"Predefinito",fillOpacity:"Opacit\\xE0 Riempimento",strokeColor:"Colore Linea",strokeOpacity:"Opacit\\xE0 Linea",miniChart:"Mini-Grafico",histogramBinCount:"Conteggio Bin",connectorLine:"Linea di Connessione",seriesItems:"Elementi Serie",seriesItemType:"Tipo Elemento",seriesItemPositive:"Positivo",seriesItemNegative:"Negativo",seriesItemLabels:"Etichette degli Elementi",columnGroup:"Colonna",barGroup:"Barra",pieGroup:"Torta",lineGroup:"Linea",scatterGroup:"X Y (Dispersione)",areaGroup:"Area",polarGroup:"Polare",statisticalGroup:"Statistico",hierarchicalGroup:"Gerarchico",specializedGroup:"Specializzato",combinationGroup:"Combinazione",groupedColumnTooltip:"Raggruppato",stackedColumnTooltip:"Impilato",normalizedColumnTooltip:"100% Impilato",groupedBarTooltip:"Raggruppato",stackedBarTooltip:"Impilato",normalizedBarTooltip:"100% Impilato",pieTooltip:"Torta",donutTooltip:"Ciambella",lineTooltip:"Linea",groupedAreaTooltip:"Area",stackedAreaTooltip:"Impilato",normalizedAreaTooltip:"100% Impilato",scatterTooltip:"Dispersione",bubbleTooltip:"Bolla",histogramTooltip:"Istogramma",radialColumnTooltip:"Colonna Radiale",radialBarTooltip:"Barra Radiale",radarLineTooltip:"Linea Radar",radarAreaTooltip:"Area Radar",nightingaleTooltip:"Nightingale",rangeBarTooltip:"Barra di Intervallo",rangeAreaTooltip:"Area di Intervallo",boxPlotTooltip:"Box Plot",treemapTooltip:"Treemap",sunburstTooltip:"Esplosione Solare",waterfallTooltip:"Cascata",heatmapTooltip:"Heatmap",columnLineComboTooltip:"Colonna & Linea",areaColumnComboTooltip:"Area & Colonna",customComboTooltip:"Combinazione Personalizzata",innerRadius:"Raggio Interno",startAngle:"Angolo di Inizio",endAngle:"Angolo di Fine",reverseDirection:"Inversione Direzione",groupPadding:"Margine Interno di Gruppo",seriesPadding:"Margine Interno Serie",tile:"Mattonella",whisker:"Antennule",cap:"Tappo",capLengthRatio:"Rapporto Lunghezza",labelPlacement:"Posizionament';
      S = S + 'o Etichetta",inside:"Interno",outside:"Esterno",noDataToChart:"Nessun dato disponibile per il grafico.",pivotChartRequiresPivotMode:"Il Grafico Pivot richiede la Modalit\\xE0 Pivot abilitata.",chartSettingsToolbarTooltip:"Menu",chartLinkToolbarTooltip:"Collegato alla Griglia",chartUnlinkToolbarTooltip:"Scollegato dalla Griglia",chartDownloadToolbarTooltip:"Scarica Grafico",chartMenuToolbarTooltip:"Menu",chartEdit:"Modifica Grafico",chartAdvancedSettings:"Impostazioni Avanzate",chartLink:"Collega alla Griglia",chartUnlink:"Scollega dalla Griglia",chartDownload:"Scarica Grafico",histogramFrequency:"Frequenza",seriesChartType:"Tipo di Grafico Serie",seriesType:"Tipo di Serie",secondaryAxis:"Asse Secondario",seriesAdd:"Aggiungi una serie",categoryAdd:"Aggiungi una categoria",bar:"Barra",column:"Colonna",histogram:"Istogramma",advancedSettings:"Impostazioni Avanzate",direction:"Direzione",horizontal:"Orizzontale",vertical:"Verticale",seriesGroupType:"Tipo di Gruppo",groupedSeriesGroupType:"Raggruppato",stackedSeriesGroupType:"Impilato",normalizedSeriesGroupType:"100% Impilato",legendEnabled:"Abilitato",invalidColor:"Valore colore non valido",groupedColumnFull:"Colonna Raggruppata",stackedColumnFull:"Colonna Impilata",normalizedColumnFull:"Colonna 100% Impilata",groupedBarFull:"Barra Raggruppata",stackedBarFull:"Barra Impilata",normalizedBarFull:"Barra 100% Impilata",stackedAreaFull:"Area Impilata",normalizedAreaFull:"Area 100% Impilata",customCombo:"Combinazione Personalizzata",ariaAdvancedFilterBuilderItem:"${variable}. Livello ${variable}. Premi INVIO per modificare.",ariaAdvancedFilterBuilderItemValidation:"${variable}. Livello ${variable}. ${variable} Premi INVIO per modificare.",ariaAdvancedFilterBuilderList:"Lista di Costruzione Filtro Avanzato",ariaAdvancedFilterBuilderFilterItem:"Condizione del Filtro",ariaAdvancedFilterBuilderGroupItem:"Gruppo di Filtri",ariaAdvancedFilterBuilderColumn:"Colonna",ariaAdvancedFilterBuilderOption:"Opzione",ariaAdvancedFilterBuilderV';
      S = S + 'alueP:"Valore",ariaAdvancedFilterBuilderJoinOperator:"Operatore di Unione",ariaAdvancedFilterInput:"Inserimento Filtro Avanzato",ariaChecked:"selezionato",ariaColumn:"Colonna",ariaColumnGroup:"Gruppo di Colonne",ariaColumnFiltered:"Colonna Filtrata",ariaColumnSelectAll:"Attiva/Disattiva Seleziona Tutte le Colonne",ariaDateFilterInput:"Inserimento Filtro Data",ariaDefaultListName:"Lista",ariaFilterColumnsInput:"Inserimento Filtro Colonne",ariaFilterFromValue:"Filtra dal valore",ariaFilterInput:"Inserimento Filtro",ariaFilterList:"Lista dei Filtri",ariaFilterToValue:"Filtra al valore",ariaFilterValue:"Valore del Filtro",ariaFilterMenuOpen:"Apri Menu Filtri",ariaFilteringOperator:"Operatore di Filtro",ariaHidden:"nascosto",ariaIndeterminate:"indeterminato",ariaInputEditor:"Editor di Inserimento",ariaMenuColumn:"Premi ALT GI\\xD9 per aprire il menu della colonna",ariaFilterColumn:"Premi CTRL INVIO per aprire il filtro",ariaRowDeselect:"Premi SPAZIO per deselezionare questa riga",ariaRowSelectAll:"Premi SPAZIO per attivare/disattivare la selezione di tutte le righe",ariaRowToggleSelection:"Premi SPAZIO per attivare/disattivare la selezione della riga",ariaRowSelect:"Premi SPAZIO per selezionare questa riga",ariaRowSelectionDisabled:"La selezione della riga \\xE8 disabilitata per questa riga",ariaSearch:"Cerca",ariaSortableColumn:"Premi INVIO per ordinare",ariaToggleVisibility:"Premi SPAZIO per attivare/disattivare la visibilit\\xE0",ariaToggleCellValue:"Premi SPAZIO per attivare/disattivare il valore della cella",ariaUnchecked:"non selezionato",ariaVisible:"visibile",ariaSearchFilterValues:"Cerca valori del filtro",ariaPageSizeSelectorLabel:"Dimensione della Pagina",ariaChartMenuClose:"Chiudi Menu Modifica Grafico",ariaChartSelected:"Selezionato",ariaSkeletonCellLoadingFailed:"Caricamento della riga fallito",ariaSkeletonCellLoading:"Caricamento dati della riga in corso",ariaRowGroupDropZonePanelLabel:"Gruppi di Righe",ariaValuesDropZonePanelLabel:"Valori",ariaPivotDropZoneP';
      S = S + 'anelLabel:"Etichette di Colonna",ariaDropZoneColumnComponentDescription:"Premi CANC per rimuovere",ariaDropZoneColumnValueItemDescription:"Premi INVIO per cambiare il tipo di aggregazione",ariaDropZoneColumnGroupItemDescription:"Premi INVIO per ordinare",ariaDropZoneColumnComponentAggFuncSeparator:" di ",ariaDropZoneColumnComponentSortAscending:"crescendo",ariaDropZoneColumnComponentSortDescending:"decrescendo",ariaLabelDialog:"Dialogo",ariaLabelColumnMenu:"Men\\xF9 Colonna",ariaLabelColumnFilter:"Filtro Colonna",ariaLabelCellEditor:"Editor di Celle",ariaLabelSelectField:"Seleziona Campo",ariaLabelRichSelectField:"Campo di Selezione Ricco",ariaLabelRichSelectToggleSelection:"Premi SPAZIO per alternare la selezione",ariaLabelRichSelectDeselectAllItems:"Premi CANC per deselezionare tutti gli elementi",ariaLabelRichSelectDeleteSelection:"Premi CANC per deselezionare l\'elemento",ariaLabelTooltip:"Suggerimento",ariaLabelContextMenu:"Menu Contestuale",ariaLabelSubMenu:"Sottomenu",ariaLabelAggregationFunction:"Funzione di Aggregazione",ariaLabelAdvancedFilterAutocomplete:"Completamento Automatico Filtro Avanzato",ariaLabelAdvancedFilterBuilderAddField:"Aggiungi Campo al Costruttore di Filtri Avanzato",ariaLabelAdvancedFilterBuilderColumnSelectField:"Seleziona Campo della Colonna nel Costruttore di Filtri Avanzato",ariaLabelAdvancedFilterBuilderOptionSelectField:"Seleziona Opzione del Campo nel Costruttore di Filtri Avanzato",ariaLabelAdvancedFilterBuilderJoinSelectField:"Seleziona Operatore di Join nel Costruttore di Filtri Avanzato",ariaColumnPanelList:"Elenco delle colonne",ariaFilterPanelList:"Elenco dei filtri",thousandSeparator:",",decimalSeparator:".",true:"Vero",false:"Falso",invalidDate:"Data non valida",invalidNumber:"Numero non valido",january:"Gennaio",february:"Febbraio",march:"Marzo",april:"Aprile",may:"Maggio",june:"Giugno",july:"Luglio",august:"Agosto",september:"Settembre",october:"Ottobre",november:"Novembre",december:"Dicembre",timeFormatSlashesDDMMYYYY:"G';
      S = S + 'G/MM/AAAA",timeFormatSlashesMMDDYYYY:"MM/GG/AAAA",timeFormatSlashesDDMMYY:"GG/MM/AA",timeFormatSlashesMMDDYY:"MM/GG/AA",timeFormatDotsDDMYY:"GG.M.AA",timeFormatDotsMDDYY:"M.GG.AA",timeFormatDashesYYYYMMDD:"AAAA-MM-GG",timeFormatSpacesDDMMMMYYYY:"GG MMMM AAAA",timeFormatHHMMSS:"OO:MM:SS",timeFormatHHMMSSAmPm:"OO:MM:SS AM/PM"},y={selectAll:"(\\u3059\\u3079\\u3066\\u9078\\u629E)",selectAllSearchResults:"(\\u691C\\u7D22\\u7D50\\u679C\\u3092\\u3059\\u3079\\u3066\\u9078\\u629E)",addCurrentSelectionToFilter:"\\u73FE\\u5728\\u306E\\u9078\\u629E\\u3092\\u30D5\\u30A3\\u30EB\\u30BF\\u30FC\\u306B\\u8FFD\\u52A0",searchOoo:"\\u691C\\u7D22...",blanks:"(\\u7A7A\\u767D)",noMatches:"\\u4E00\\u81F4\\u3059\\u308B\\u3082\\u306E\\u304C\\u3042\\u308A\\u307E\\u305B\\u3093",filterOoo:"\\u30D5\\u30A3\\u30EB\\u30BF\\u30FC...",equals:"\\u7B49\\u3057\\u3044",notEqual:"\\u7B49\\u3057\\u304F\\u306A\\u3044",blank:"\\u7A7A\\u767D",notBlank:"\\u7A7A\\u767D\\u3067\\u306F\\u306A\\u3044",empty:"\\u9078\\u629E\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044",lessThan:"\\u672A\\u6E80",greaterThan:"\\u3088\\u308A\\u5927\\u304D\\u3044",lessThanOrEqual:"\\u4EE5\\u4E0B",greaterThanOrEqual:"\\u4EE5\\u4E0A",inRange:"\\u9593",inRangeStart:"\\u304B\\u3089",inRangeEnd:"\\u307E\\u3067",contains:"\\u542B\\u3080",notContains:"\\u542B\\u307E\\u306A\\u3044",startsWith:"\\u3067\\u59CB\\u307E\\u308B",endsWith:"\\u3067\\u7D42\\u308F\\u308B",dateFormatOoo:"yyyy-mm-dd",before:"\\u524D",after:"\\u5F8C",andCondition:"AND",orCondition:"OR",applyFilter:"\\u9069\\u7528",resetFilter:"\\u30EA\\u30BB\\u30C3\\u30C8",clearFilter:"\\u30AF\\u30EA\\u30A2",cancelFilter:"\\u30AD\\u30E3\\u30F3\\u30BB\\u30EB",textFilter:"\\u30C6\\u30AD\\u30B9\\u30C8\\u30D5\\u30A3\\u30EB\\u30BF\\u30FC",numberFilter:"\\u6570\\u5024\\u30D5\\u30A3\\u30EB\\u30BF\\u30FC",dateFilter:"\\u65E5\\u4ED8\\u30D5\\u30A3\\u30EB\\u30BF\\u30FC",setFilter:"\\u30BB\\u30C3\\u30C8\\u30D5\\u30A3\\u30EB\\u30BF\\u30FC",groupFilterSelect:"\\u30D5\\u30A3\\u30FC\\u30EB\\u30C9\\u3092\\u9078\\u629E:",advancedFilterContains:"\\u542B\\u3080",advancedFilterNotContains:"\\u542B\\u307E\\u306A\\u3044",advancedFilterTextEquals:"\\u7B49\\u3057\\u3044",advancedFilt';
      S = S + 'erTextNotEqual:"\\u7B49\\u3057\\u304F\\u306A\\u3044",advancedFilterStartsWith:"\\u3067\\u59CB\\u307E\\u308B",advancedFilterEndsWith:"\\u3067\\u7D42\\u308F\\u308B",advancedFilterBlank:"\\u7A7A\\u767D",advancedFilterNotBlank:"\\u7A7A\\u767D\\u3067\\u306A\\u3044",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"\\u771F",advancedFilterFalse:"\\u507D",advancedFilterAnd:"\\u304B\\u3064",advancedFilterOr:"\\u307E\\u305F\\u306F",advancedFilterApply:"\\u9069\\u7528",advancedFilterBuilder:"\\u30D3\\u30EB\\u30C0\\u30FC",advancedFilterValidationMissingColumn:"\\u5217\\u304C\\u6B20\\u843D\\u3057\\u3066\\u3044\\u307E\\u3059",advancedFilterValidationMissingOption:"\\u30AA\\u30D7\\u30B7\\u30E7\\u30F3\\u304C\\u6B20\\u843D\\u3057\\u3066\\u3044\\u307E\\u3059",advancedFilterValidationMissingValue:"\\u5024\\u304C\\u6B20\\u843D\\u3057\\u3066\\u3044\\u307E\\u3059",advancedFilterValidationInvalidColumn:"\\u5217\\u304C\\u898B\\u3064\\u304B\\u308A\\u307E\\u305B\\u3093",advancedFilterValidationInvalidOption:"\\u30AA\\u30D7\\u30B7\\u30E7\\u30F3\\u304C\\u898B\\u3064\\u304B\\u308A\\u307E\\u305B\\u3093",advancedFilterValidationMissingQuote:"\\u5024\\u306E\\u7D42\\u7AEF\\u306E\\u5F15\\u7528\\u7B26\\u304C\\u6B20\\u843D\\u3057\\u3066\\u3044\\u307E\\u3059",advancedFilterValidationNotANumber:"\\u5024\\u304C\\u6570\\u5024\\u3067\\u306F\\u3042\\u308A\\u307E\\u305B\\u3093",advancedFilterValidationInvalidDate:"\\u5024\\u304C\\u6709\\u52B9\\u306A\\u65E5\\u4ED8\\u3067\\u306F\\u3042\\u308A\\u307E\\u305B\\u3093",advancedFilterValidationMissingCondition:"\\u6761\\u4EF6\\u304C\\u6B20\\u843D\\u3057\\u3066\\u3044\\u307E\\u3059",advancedFilterValidationJoinOperatorMismatch:"\\u6761\\u4EF6\\u5185\\u306E\\u7D50\\u5408\\u6F14\\u7B97\\u5B50\\u306F\\u540C\\u3058\\u3067\\u3042\\u308B\\u5FC5\\u8981\\u304C\\u3042\\u308A\\u307E\\u3059",advancedFilterValidationInvalidJoinOperator:"\\u7D50\\u5408\\u6F14\\u7B97\\u5B50\\u304C\\u898B\\u3064\\u304B\\u308A\\u307E\\u305B\\u3093",advancedFilterValidationMissingEndBracket:"\\u7D42\\u7AEF\\u306E\\u62EC\\u5';
      S = S + 'F27\\u304C\\u6B20\\u843D\\u3057\\u3066\\u3044\\u307E\\u3059",advancedFilterValidationExtraEndBracket:"\\u7D42\\u7AEF\\u306E\\u62EC\\u5F27\\u304C\\u591A\\u3059\\u304E\\u307E\\u3059",advancedFilterValidationMessage:"\\u5F0F\\u306B\\u30A8\\u30E9\\u30FC\\u304C\\u3042\\u308A\\u307E\\u3059\\u3002${variable} - ${variable}\\u3002",advancedFilterValidationMessageAtEnd:"\\u5F0F\\u306B\\u30A8\\u30E9\\u30FC\\u304C\\u3042\\u308A\\u307E\\u3059\\u3002\\u5F0F\\u306E\\u6700\\u5F8C\\u306B${variable}\\u3002",advancedFilterBuilderTitle:"\\u9AD8\\u5EA6\\u306A\\u30D5\\u30A3\\u30EB\\u30BF\\u30FC",advancedFilterBuilderApply:"\\u9069\\u7528",advancedFilterBuilderCancel:"\\u30AD\\u30E3\\u30F3\\u30BB\\u30EB",advancedFilterBuilderAddButtonTooltip:"\\u30D5\\u30A3\\u30EB\\u30BF\\u30FC\\u307E\\u305F\\u306F\\u30B0\\u30EB\\u30FC\\u30D7\\u3092\\u8FFD\\u52A0",advancedFilterBuilderRemoveButtonTooltip:"\\u524A\\u9664",advancedFilterBuilderMoveUpButtonTooltip:"\\u4E0A\\u3078\\u79FB\\u52D5",advancedFilterBuilderMoveDownButtonTooltip:"\\u4E0B\\u3078\\u79FB\\u52D5",advancedFilterBuilderAddJoin:"\\u30B0\\u30EB\\u30FC\\u30D7\\u3092\\u8FFD\\u52A0",advancedFilterBuilderAddCondition:"\\u30D5\\u30A3\\u30EB\\u30BF\\u30FC\\u3092\\u8FFD\\u52A0",advancedFilterBuilderSelectColumn:"\\u5217\\u3092\\u9078\\u629E",advancedFilterBuilderSelectOption:"\\u30AA\\u30D7\\u30B7\\u30E7\\u30F3\\u3092\\u9078\\u629E",advancedFilterBuilderEnterValue:"\\u5024\\u3092\\u5165\\u529B...",advancedFilterBuilderValidationAlreadyApplied:"\\u73FE\\u5728\\u306E\\u30D5\\u30A3\\u30EB\\u30BF\\u30FC\\u306F\\u65E2\\u306B\\u9069\\u7528\\u3055\\u308C\\u3066\\u3044\\u307E\\u3059\\u3002",advancedFilterBuilderValidationIncomplete:"\\u3059\\u3079\\u3066\\u306E\\u6761\\u4EF6\\u304C\\u5B8C\\u4E86\\u3057\\u3066\\u3044\\u307E\\u305B\\u3093\\u3002",advancedFilterBuilderValidationSelectColumn:"\\u5217\\u3092\\u9078\\u629E\\u3059\\u308B\\u5FC5\\u8981\\u304C\\u3042\\u308A\\u307E\\u3059\\u3002",advancedFilterBuilderValidationSelectOption:"\\u30AA\\u30D7\\u30B7\\u30E7\\u30F3\\u3092\\u9078\\u629E\\u3059\\u308B\\u5FC5\\u8981\\u304C\\u3042\\u308A\\u307E\\u3059\\u3002",advancedFilterBuilderValidationEnterValue:"\\u5024\\u3092\\u5165\\u529B\\u3059\\u308B\\u5FC';
      S = S + '5\\u8981\\u304C\\u3042\\u308A\\u307E\\u3059\\u3002",columns:"\\u5217",filters:"\\u30D5\\u30A3\\u30EB\\u30BF\\u30FC",pivotMode:"\\u30D4\\u30DC\\u30C3\\u30C8\\u30E2\\u30FC\\u30C9",groups:"\\u884C\\u30B0\\u30EB\\u30FC\\u30D7",rowGroupColumnsEmptyMessage:"\\u3053\\u3053\\u306B\\u30C9\\u30E9\\u30C3\\u30B0\\u3057\\u3066\\u884C\\u30B0\\u30EB\\u30FC\\u30D7\\u3092\\u8A2D\\u5B9A\\u3057\\u307E\\u3059",values:"\\u5024",valueColumnsEmptyMessage:"\\u3053\\u3053\\u306B\\u30C9\\u30E9\\u30C3\\u30B0\\u3057\\u3066\\u96C6\\u8A08\\u3057\\u307E\\u3059",pivots:"\\u5217\\u30E9\\u30D9\\u30EB",pivotColumnsEmptyMessage:"\\u3053\\u3053\\u306B\\u30C9\\u30E9\\u30C3\\u30B0\\u3057\\u3066\\u5217\\u30E9\\u30D9\\u30EB\\u3092\\u8A2D\\u5B9A\\u3057\\u307E\\u3059",group:"\\u30B0\\u30EB\\u30FC\\u30D7",rowDragRow:"\\u884C",rowDragRows:"\\u884C",loadingOoo:"\\u8AAD\\u307F\\u8FBC\\u307F\\u4E2D...",loadingError:"\\u30A8\\u30E9\\u30FC",noRowsToShow:"\\u8868\\u793A\\u3059\\u308B\\u884C\\u304C\\u3042\\u308A\\u307E\\u305B\\u3093",enabled:"\\u6709\\u52B9",pinColumn:"\\u5217\\u306E\\u56FA\\u5B9A",pinLeft:"\\u5DE6\\u306B\\u56FA\\u5B9A",pinRight:"\\u53F3\\u306B\\u56FA\\u5B9A",noPin:"\\u56FA\\u5B9A\\u306A\\u3057",valueAggregation:"\\u5024\\u306E\\u96C6\\u8A08",noAggregation:"\\u306A\\u3057",autosizeThisColumn:"\\u3053\\u306E\\u5217\\u306E\\u81EA\\u52D5\\u30B5\\u30A4\\u30BA\\u8ABF\\u6574",autosizeAllColumns:"\\u3059\\u3079\\u3066\\u306E\\u5217\\u306E\\u81EA\\u52D5\\u30B5\\u30A4\\u30BA\\u8ABF\\u6574",groupBy:"\\u30B0\\u30EB\\u30FC\\u30D7\\u5316",ungroupBy:"\\u30B0\\u30EB\\u30FC\\u30D7\\u5316\\u89E3\\u9664",ungroupAll:"\\u3059\\u3079\\u3066\\u306E\\u30B0\\u30EB\\u30FC\\u30D7\\u5316\\u3092\\u89E3\\u9664",addToValues:"${variable}\\u3092\\u5024\\u306B\\u8FFD\\u52A0",removeFromValues:"${variable}\\u3092\\u5024\\u304B\\u3089\\u524A\\u9664",addToLabels:"${variable}\\u3092\\u30E9\\u30D9\\u30EB\\u306B\\u8FFD\\u52A0",removeFromLabels:"${variable}\\u3092\\u30E9\\u30D9\\u30EB\\u304B\\u3089\\u524A\\u9664",resetColumns:"\\u5217\\u3092\\u30EA\\u30BB\\u30C3\\u30C8",expandAll:"\\u3059\\u3079\\u3066\\u306E\\u884C\\u30B0\\u30EB\\u30FC\\u30D7\\u3092\\u5C55\\u958B",collapseAll:"\\u3059\\u3079\\u3066\\u306E\\u884C\\u30B0\\u30EB\\u30FC\\u30D7\\u3092\\u9589\\u3058\\u308B",cop';
      S = S + 'y:"\\u30B3\\u30D4\\u30FC",ctrlC:"Ctrl+C",ctrlX:"Ctrl+X",copyWithHeaders:"\\u30D8\\u30C3\\u30C0\\u30FC\\u4ED8\\u304D\\u3067\\u30B3\\u30D4\\u30FC",copyWithGroupHeaders:"\\u30B0\\u30EB\\u30FC\\u30D7\\u30D8\\u30C3\\u30C0\\u30FC\\u4ED8\\u304D\\u3067\\u30B3\\u30D4\\u30FC",cut:"\\u30AB\\u30C3\\u30C8",paste:"\\u30DA\\u30FC\\u30B9\\u30C8",ctrlV:"Ctrl+V",export:"\\u30A8\\u30AF\\u30B9\\u30DD\\u30FC\\u30C8",csvExport:"CSV\\u30A8\\u30AF\\u30B9\\u30DD\\u30FC\\u30C8",excelExport:"Excel\\u30A8\\u30AF\\u30B9\\u30DD\\u30FC\\u30C8",columnFilter:"\\u5217\\u30D5\\u30A3\\u30EB\\u30BF\\u30FC",columnChooser:"\\u5217\\u306E\\u9078\\u629E",sortAscending:"\\u6607\\u9806\\u3067\\u4E26\\u3079\\u66FF\\u3048",sortDescending:"\\u964D\\u9806\\u3067\\u4E26\\u3079\\u66FF\\u3048",sortUnSort:"\\u30BD\\u30FC\\u30C8\\u89E3\\u9664",sum:"\\u5408\\u8A08",first:"\\u6700\\u521D",last:"\\u6700\\u5F8C",min:"\\u6700\\u5C0F",max:"\\u6700\\u5927",none:"\\u306A\\u3057",count:"\\u30AB\\u30A6\\u30F3\\u30C8",avg:"\\u5E73\\u5747",filteredRows:"\\u30D5\\u30A3\\u30EB\\u30BF\\u6E08\\u307F",selectedRows:"\\u9078\\u629E\\u6E08\\u307F",totalRows:"\\u7DCF\\u884C\\u6570",totalAndFilteredRows:"\\u884C",more:"\\u3082\\u3063\\u3068",to:"\\u304B\\u3089",of:"\\u306E",page:"\\u30DA\\u30FC\\u30B8",pageLastRowUnknown:"?",nextPage:"\\u6B21\\u306E\\u30DA\\u30FC\\u30B8",lastPage:"\\u6700\\u5F8C\\u306E\\u30DA\\u30FC\\u30B8",firstPage:"\\u6700\\u521D\\u306E\\u30DA\\u30FC\\u30B8",previousPage:"\\u524D\\u306E\\u30DA\\u30FC\\u30B8",pageSizeSelectorLabel:"\\u30DA\\u30FC\\u30B8\\u30B5\\u30A4\\u30BA\\uFF1A",footerTotal:"\\u5408\\u8A08",pivotColumnGroupTotals:"\\u5408\\u8A08",pivotChartAndPivotMode:"\\u30D4\\u30DC\\u30C3\\u30C8\\u30C1\\u30E3\\u30FC\\u30C8\\u3068\\u30D4\\u30DC\\u30C3\\u30C8\\u30E2\\u30FC\\u30C9",pivotChart:"\\u30D4\\u30DC\\u30C3\\u30C8\\u30C1\\u30E3\\u30FC\\u30C8",chartRange:"\\u30C1\\u30E3\\u30FC\\u30C8\\u7BC4\\u56F2",columnChart:"\\u30AB\\u30E9\\u30E0",groupedColumn:"\\u30B0\\u30EB\\u30FC\\u30D7\\u5316",stackedColumn:"\\u7A4D\\u307F\\u91CD\\u306D",normalizedColumn:"100% \\u7A4D\\u307F\\u91CD\\u306D",barChart:"\\u30D0\\u30FC",groupedBar:"\\u30B0\\u30EB\\u30FC\\u30D7\\u5316",stackedBar:"\\u7A4D\\u307F\\u91CD\\u306D",normalizedBar:"100% \\u';
      S = S + '7A4D\\u307F\\u91CD\\u306D",pieChart:"\\u30D1\\u30A4",pie:"\\u30D1\\u30A4",donut:"\\u30C9\\u30FC\\u30CA\\u30C4",line:"\\u30E9\\u30A4\\u30F3",xyChart:"X Y (\\u6563\\u5E03\\u56F3)",scatter:"\\u6563\\u5E03\\u56F3",bubble:"\\u30D0\\u30D6\\u30EB",areaChart:"\\u30A8\\u30EA\\u30A2",area:"\\u30A8\\u30EA\\u30A2",stackedArea:"\\u7A4D\\u307F\\u91CD\\u306D",normalizedArea:"100% \\u7A4D\\u307F\\u91CD\\u306D",histogramChart:"\\u30D2\\u30B9\\u30C8\\u30B0\\u30E9\\u30E0",polarChart:"\\u6975\\u5EA7\\u6A19",radarLine:"\\u30EC\\u30FC\\u30C0\\u30FC\\u30E9\\u30A4\\u30F3",radarArea:"\\u30EC\\u30FC\\u30C0\\u30FC\\u30A8\\u30EA\\u30A2",nightingale:"\\u30CA\\u30A4\\u30C1\\u30F3\\u30B2\\u30FC\\u30EB",radialColumn:"\\u653E\\u5C04\\u72B6\\u30AB\\u30E9\\u30E0",radialBar:"\\u653E\\u5C04\\u72B6\\u30D0\\u30FC",statisticalChart:"\\u7D71\\u8A08",boxPlot:"\\u30DC\\u30C3\\u30AF\\u30B9\\u30D7\\u30ED\\u30C3\\u30C8",rangeBar:"\\u30EC\\u30F3\\u30B8\\u30D0\\u30FC",rangeArea:"\\u30EC\\u30F3\\u30B8\\u30A8\\u30EA\\u30A2",hierarchicalChart:"\\u968E\\u5C64",treemap:"\\u30C4\\u30EA\\u30FC\\u30DE\\u30C3\\u30D7",sunburst:"\\u30B5\\u30F3\\u30D0\\u30FC\\u30B9\\u30C8",specializedChart:"\\u7279\\u6B8A",waterfall:"\\u30A6\\u30A9\\u30FC\\u30BF\\u30FC\\u30D5\\u30A9\\u30FC\\u30EB",heatmap:"\\u30D2\\u30FC\\u30C8\\u30DE\\u30C3\\u30D7",combinationChart:"\\u30B3\\u30F3\\u30D3\\u30CD\\u30FC\\u30B7\\u30E7\\u30F3",columnLineCombo:"\\u30AB\\u30E9\\u30E0\\u3068\\u30E9\\u30A4\\u30F3",AreaColumnCombo:"\\u30A8\\u30EA\\u30A2\\u3068\\u30AB\\u30E9\\u30E0",pivotChartTitle:"\\u30D4\\u30DC\\u30C3\\u30C8\\u30C1\\u30E3\\u30FC\\u30C8",rangeChartTitle:"\\u7BC4\\u56F2\\u30C1\\u30E3\\u30FC\\u30C8",settings:"\\u30C1\\u30E3\\u30FC\\u30C8",data:"\\u8A2D\\u5B9A",format:"\\u30AB\\u30B9\\u30BF\\u30DE\\u30A4\\u30BA",categories:"\\u30AB\\u30C6\\u30B4\\u30EA\\u30FC",defaultCategory:"(\\u306A\\u3057)",series:"\\u30B7\\u30EA\\u30FC\\u30BA",switchCategorySeries:"\\u30AB\\u30C6\\u30B4\\u30EA\\u30FC/\\u30B7\\u30EA\\u30FC\\u30BA\\u306E\\u5207\\u308A\\u66FF\\u3048",categoryValues:"\\u30AB\\u30C6\\u30B4\\u30EA\\u30FC\\u5024",seriesLabels:"\\u30B7\\u30EA\\u30FC\\u30BA\\u30E9\\u30D9\\u30EB",aggregate:"\\u96C6\\u8A08",xyValues:"X Y\\u5024",paired:"\\u30DA\\u30A2\\u30E2\\u30FC\\u30C9",axi';
      S = S + 's:"\\u8EF8",xAxis:"\\u6C34\\u5E73\\u8EF8",yAxis:"\\u5782\\u76F4\\u8EF8",polarAxis:"\\u6975\\u8EF8",radiusAxis:"\\u534A\\u5F84\\u8EF8",navigator:"\\u30CA\\u30D3\\u30B2\\u30FC\\u30BF\\u30FC",zoom:"\\u30BA\\u30FC\\u30E0",animation:"\\u30A2\\u30CB\\u30E1\\u30FC\\u30B7\\u30E7\\u30F3",crosshair:"\\u30AF\\u30ED\\u30B9\\u30D8\\u30A2",color:"\\u8272",thickness:"\\u539A\\u3055",preferredLength:"\\u63A8\\u5968\\u9577\\u3055",xType:"X\\u30BF\\u30A4\\u30D7",axisType:"\\u8EF8\\u30BF\\u30A4\\u30D7",automatic:"\\u81EA\\u52D5",category:"\\u30AB\\u30C6\\u30B4\\u30EA\\u30FC",number:"\\u6570\\u5024",time:"\\u6642\\u9593",timeFormat:"\\u6642\\u9593\\u5F62\\u5F0F",autoRotate:"\\u81EA\\u52D5\\u56DE\\u8EE2",labelRotation:"\\u56DE\\u8EE2",circle:"\\u5186",polygon:"\\u591A\\u89D2\\u5F62",square:"\\u56DB\\u89D2\\u5F62",cross:"\\u30AF\\u30ED\\u30B9",diamond:"\\u30C0\\u30A4\\u30E4\\u30E2\\u30F3\\u30C9",plus:"\\u30D7\\u30E9\\u30B9",triangle:"\\u4E09\\u89D2\\u5F62",heart:"\\u30CF\\u30FC\\u30C8",orientation:"\\u65B9\\u5411",fixed:"\\u56FA\\u5B9A",parallel:"\\u5E73\\u884C",perpendicular:"\\u5782\\u76F4",radiusAxisPosition:"\\u4F4D\\u7F6E",ticks:"\\u76EE\\u76DB",gridLines:"\\u30B0\\u30EA\\u30C3\\u30C9\\u7DDA",width:"\\u5E45",height:"\\u9AD8\\u3055",length:"\\u9577\\u3055",padding:"\\u30D1\\u30C7\\u30A3\\u30F3\\u30B0",spacing:"\\u9593\\u9694",chartStyle:"\\u30C1\\u30E3\\u30FC\\u30C8\\u30B9\\u30BF\\u30A4\\u30EB",title:"\\u30BF\\u30A4\\u30C8\\u30EB",chartTitles:"\\u30BF\\u30A4\\u30C8\\u30EB",chartTitle:"\\u30C1\\u30E3\\u30FC\\u30C8\\u30BF\\u30A4\\u30C8\\u30EB",chartSubtitle:"\\u30B5\\u30D6\\u30BF\\u30A4\\u30C8\\u30EB",horizontalAxisTitle:"\\u6C34\\u5E73\\u8EF8\\u30BF\\u30A4\\u30C8\\u30EB",verticalAxisTitle:"\\u5782\\u76F4\\u8EF8\\u30BF\\u30A4\\u30C8\\u30EB",polarAxisTitle:"\\u6975\\u8EF8\\u30BF\\u30A4\\u30C8\\u30EB",titlePlaceholder:"\\u30C1\\u30E3\\u30FC\\u30C8\\u30BF\\u30A4\\u30C8\\u30EB",background:"\\u80CC\\u666F",font:"\\u30D5\\u30A9\\u30F3\\u30C8",weight:"\\u592A\\u3055",top:"\\u4E0A",right:"\\u53F3",bottom:"\\u4E0B",left:"\\u5DE6",labels:"\\u30E9\\u30D9\\u30EB",calloutLabels:"\\u30B3\\u30FC\\u30EB\\u30A2\\u30A6\\u30C8\\u30E9\\u30D9\\u30EB",sectorLabels:"\\u30BB\\u30AF\\u30BF\\u30FC\\u30E9\\u30D9\\u30EB';
      S = S + '",positionRatio:"\\u4F4D\\u7F6E\\u6BD4\\u7387",size:"\\u30B5\\u30A4\\u30BA",shape:"\\u5F62\\u72B6",minSize:"\\u6700\\u5C0F\\u30B5\\u30A4\\u30BA",maxSize:"\\u6700\\u5927\\u30B5\\u30A4\\u30BA",legend:"\\u51E1\\u4F8B",position:"\\u4F4D\\u7F6E",markerSize:"\\u30DE\\u30FC\\u30AB\\u30FC\\u30B5\\u30A4\\u30BA",markerStroke:"\\u30DE\\u30FC\\u30AB\\u30FC\\u30B9\\u30C8\\u30ED\\u30FC\\u30AF",markerPadding:"\\u30DE\\u30FC\\u30AB\\u30FC\\u30D1\\u30C7\\u30A3\\u30F3\\u30B0",itemSpacing:"\\u9805\\u76EE\\u9593\\u9694",itemPaddingX:"\\u9805\\u76EE\\u30D1\\u30C7\\u30A3\\u30F3\\u30B0X",itemPaddingY:"\\u9805\\u76EE\\u30D1\\u30C7\\u30A3\\u30F3\\u30B0Y",layoutHorizontalSpacing:"\\u6C34\\u5E73\\u9593\\u9694",layoutVerticalSpacing:"\\u5782\\u76F4\\u9593\\u9694",strokeWidth:"\\u30B9\\u30C8\\u30ED\\u30FC\\u30AF\\u5E45",offset:"\\u30AA\\u30D5\\u30BB\\u30C3\\u30C8",offsets:"\\u30AA\\u30D5\\u30BB\\u30C3\\u30C8",tooltips:"\\u30C4\\u30FC\\u30EB\\u30C1\\u30C3\\u30D7",callout:"\\u30B3\\u30FC\\u30EB\\u30A2\\u30A6\\u30C8",markers:"\\u30DE\\u30FC\\u30AB\\u30FC",shadow:"\\u5F71",blur:"\\u307C\\u304B\\u3057",xOffset:"X\\u30AA\\u30D5\\u30BB\\u30C3\\u30C8",yOffset:"Y\\u30AA\\u30D5\\u30BB\\u30C3\\u30C8",lineWidth:"\\u7DDA\\u306E\\u5E45",lineDash:"\\u7DDA\\u306E\\u7834\\u7DDA",lineDashOffset:"\\u7834\\u7DDA\\u30AA\\u30D5\\u30BB\\u30C3\\u30C8",scrollingZoom:"\\u30B9\\u30AF\\u30ED\\u30FC\\u30EB",scrollingStep:"\\u30B9\\u30AF\\u30ED\\u30FC\\u30EB\\u30B9\\u30C6\\u30C3\\u30D7",selectingZoom:"\\u9078\\u629E",durationMillis:"\\u671F\\u9593 (ms)",crosshairLabel:"\\u30E9\\u30D9\\u30EB",crosshairSnap:"\\u30CE\\u30FC\\u30C9\\u306B\\u30B9\\u30CA\\u30C3\\u30D7",normal:"\\u666E\\u901A",bold:"\\u592A\\u5B57",italic:"\\u30A4\\u30BF\\u30EA\\u30C3\\u30AF",boldItalic:"\\u592A\\u5B57\\u30A4\\u30BF\\u30EA\\u30C3\\u30AF",predefined:"\\u5B9A\\u7FA9\\u6E08\\u307F",fillOpacity:"\\u5857\\u308A\\u306E\\u4E0D\\u900F\\u660E\\u5EA6",strokeColor:"\\u7DDA\\u306E\\u8272",strokeOpacity:"\\u7DDA\\u306E\\u4E0D\\u900F\\u660E\\u5EA6",miniChart:"\\u30DF\\u30CB\\u30C1\\u30E3\\u30FC\\u30C8",histogramBinCount:"\\u30D3\\u30F3\\u306E\\u6570",connectorLine:"\\u30B3\\u30CD\\u30AF\\u30BF\\u30FC\\u7DDA",seriesItems:"\\u30B7\\u30EA\\u30FC\\u30BA\\u30A2\\u30A4\\u30C6\\u30E0",s';
      S = S + 'eriesItemType:"\\u30A2\\u30A4\\u30C6\\u30E0\\u30BF\\u30A4\\u30D7",seriesItemPositive:"\\u30DD\\u30B8\\u30C6\\u30A3\\u30D6",seriesItemNegative:"\\u30CD\\u30AC\\u30C6\\u30A3\\u30D6",seriesItemLabels:"\\u30A2\\u30A4\\u30C6\\u30E0\\u30E9\\u30D9\\u30EB",columnGroup:"\\u30AB\\u30E9\\u30E0",barGroup:"\\u30D0\\u30FC",pieGroup:"\\u30D1\\u30A4",lineGroup:"\\u30E9\\u30A4\\u30F3",scatterGroup:"X Y (\\u6563\\u5E03\\u56F3)",areaGroup:"\\u30A8\\u30EA\\u30A2",polarGroup:"\\u6975",statisticalGroup:"\\u7D71\\u8A08",hierarchicalGroup:"\\u968E\\u5C64",specializedGroup:"\\u5C02\\u9580",combinationGroup:"\\u30B3\\u30F3\\u30D3\\u30CD\\u30FC\\u30B7\\u30E7\\u30F3",groupedColumnTooltip:"\\u30B0\\u30EB\\u30FC\\u30D7\\u5316",stackedColumnTooltip:"\\u7A4D\\u307F\\u4E0A\\u3052",normalizedColumnTooltip:"100%\\u7A4D\\u307F\\u4E0A\\u3052",groupedBarTooltip:"\\u30B0\\u30EB\\u30FC\\u30D7\\u5316",stackedBarTooltip:"\\u7A4D\\u307F\\u4E0A\\u3052",normalizedBarTooltip:"100%\\u7A4D\\u307F\\u4E0A\\u3052",pieTooltip:"\\u30D1\\u30A4",donutTooltip:"\\u30C9\\u30FC\\u30CA\\u30C4",lineTooltip:"\\u30E9\\u30A4\\u30F3",groupedAreaTooltip:"\\u30A8\\u30EA\\u30A2",stackedAreaTooltip:"\\u7A4D\\u307F\\u4E0A\\u3052",normalizedAreaTooltip:"100%\\u7A4D\\u307F\\u4E0A\\u3052",scatterTooltip:"\\u6563\\u5E03\\u56F3",bubbleTooltip:"\\u30D0\\u30D6\\u30EB",histogramTooltip:"\\u30D2\\u30B9\\u30C8\\u30B0\\u30E9\\u30E0",radialColumnTooltip:"\\u30E9\\u30B8\\u30A2\\u30EB\\u30AB\\u30E9\\u30E0",radialBarTooltip:"\\u30E9\\u30B8\\u30A2\\u30EB\\u30D0\\u30FC",radarLineTooltip:"\\u30EC\\u30FC\\u30C0\\u30FC\\u30E9\\u30A4\\u30F3",radarAreaTooltip:"\\u30EC\\u30FC\\u30C0\\u30FC\\u30A8\\u30EA\\u30A2",nightingaleTooltip:"\\u30CA\\u30A4\\u30C1\\u30F3\\u30B2\\u30FC\\u30EB",rangeBarTooltip:"\\u7BC4\\u56F2\\u30D0\\u30FC",rangeAreaTooltip:"\\u7BC4\\u56F2\\u30A8\\u30EA\\u30A2",boxPlotTooltip:"\\u30DC\\u30C3\\u30AF\\u30B9\\u30D7\\u30ED\\u30C3\\u30C8",treemapTooltip:"\\u30C4\\u30EA\\u30FC\\u30DE\\u30C3\\u30D7",sunburstTooltip:"\\u30B5\\u30F3\\u30D0\\u30FC\\u30B9\\u30C8",waterfallTooltip:"\\u30A6\\u30A9\\u30FC\\u30BF\\u30FC\\u30D5\\u30A9\\u30FC\\u30EB",heatmapTooltip:"\\u30D2\\u30FC\\u30C8\\u30DE\\u30C3\\u30D7",columnLineComboTooltip:"\\u30AB\\u';
      S = S + '30E9\\u30E0\\uFF06\\u30E9\\u30A4\\u30F3",areaColumnComboTooltip:"\\u30A8\\u30EA\\u30A2\\uFF06\\u30AB\\u30E9\\u30E0",customComboTooltip:"\\u30AB\\u30B9\\u30BF\\u30E0\\u30B3\\u30F3\\u30D3\\u30CD\\u30FC\\u30B7\\u30E7\\u30F3",innerRadius:"\\u5185\\u5074\\u534A\\u5F84",startAngle:"\\u958B\\u59CB\\u89D2\\u5EA6",endAngle:"\\u7D42\\u4E86\\u89D2\\u5EA6",reverseDirection:"\\u9006\\u65B9\\u5411",groupPadding:"\\u30B0\\u30EB\\u30FC\\u30D7\\u30D1\\u30C7\\u30A3\\u30F3\\u30B0",seriesPadding:"\\u30B7\\u30EA\\u30FC\\u30BA\\u30D1\\u30C7\\u30A3\\u30F3\\u30B0",tile:"\\u30BF\\u30A4\\u30EB",whisker:"\\u30A6\\u30A3\\u30B9\\u30AB\\u30FC",cap:"\\u30AD\\u30E3\\u30C3\\u30D7",capLengthRatio:"\\u9577\\u3055\\u6BD4\\u7387",labelPlacement:"\\u914D\\u7F6E",inside:"\\u5185\\u5074",outside:"\\u5916\\u5074",noDataToChart:"\\u30C1\\u30E3\\u30FC\\u30C8\\u306B\\u3059\\u308B\\u30C7\\u30FC\\u30BF\\u304C\\u3042\\u308A\\u307E\\u305B\\u3093\\u3002",pivotChartRequiresPivotMode:"\\u30D4\\u30DC\\u30C3\\u30C8\\u30C1\\u30E3\\u30FC\\u30C8\\u306B\\u306F\\u30D4\\u30DC\\u30C3\\u30C8\\u30E2\\u30FC\\u30C9\\u304C\\u5FC5\\u8981\\u3067\\u3059\\u3002",chartSettingsToolbarTooltip:"\\u30E1\\u30CB\\u30E5\\u30FC",chartLinkToolbarTooltip:"\\u30B0\\u30EA\\u30C3\\u30C9\\u306B\\u30EA\\u30F3\\u30AF",chartUnlinkToolbarTooltip:"\\u30B0\\u30EA\\u30C3\\u30C9\\u304B\\u3089\\u30EA\\u30F3\\u30AF\\u89E3\\u9664",chartDownloadToolbarTooltip:"\\u30C1\\u30E3\\u30FC\\u30C8\\u3092\\u30C0\\u30A6\\u30F3\\u30ED\\u30FC\\u30C9",chartMenuToolbarTooltip:"\\u30E1\\u30CB\\u30E5\\u30FC",chartEdit:"\\u30C1\\u30E3\\u30FC\\u30C8\\u3092\\u7DE8\\u96C6",chartAdvancedSettings:"\\u8A73\\u7D30\\u8A2D\\u5B9A",chartLink:"\\u30B0\\u30EA\\u30C3\\u30C9\\u306B\\u30EA\\u30F3\\u30AF",chartUnlink:"\\u30B0\\u30EA\\u30C3\\u30C9\\u304B\\u3089\\u30EA\\u30F3\\u30AF\\u89E3\\u9664",chartDownload:"\\u30C1\\u30E3\\u30FC\\u30C8\\u3092\\u30C0\\u30A6\\u30F3\\u30ED\\u30FC\\u30C9",histogramFrequency:"\\u983B\\u5EA6",seriesChartType:"\\u30B7\\u30EA\\u30FC\\u30BA\\u30C1\\u30E3\\u30FC\\u30C8\\u30BF\\u30A4\\u30D7",seriesType:"\\u30B7\\u30EA\\u30FC\\u30BA\\u30BF\\u30A4\\u30D7",secondaryAxis:"\\u7B2C\\u4E8C\\u8EF8",seriesAdd:"\\u30B7\\u30EA\\u30FC\\u30BA\\u3092\\u8FFD\\u52A0",categoryAdd:"\\u30AB\\u30C6\\u30B4\\u30EA\\u3';
      S = S + '092\\u8FFD\\u52A0",bar:"\\u30D0\\u30FC",column:"\\u30AB\\u30E9\\u30E0",histogram:"\\u30D2\\u30B9\\u30C8\\u30B0\\u30E9\\u30E0",advancedSettings:"\\u8A73\\u7D30\\u8A2D\\u5B9A",direction:"\\u65B9\\u5411",horizontal:"\\u6C34\\u5E73",vertical:"\\u5782\\u76F4",seriesGroupType:"\\u30B0\\u30EB\\u30FC\\u30D7\\u30BF\\u30A4\\u30D7",groupedSeriesGroupType:"\\u30B0\\u30EB\\u30FC\\u30D7\\u5316",stackedSeriesGroupType:"\\u7A4D\\u307F\\u4E0A\\u3052",normalizedSeriesGroupType:"100%\\u7A4D\\u307F\\u4E0A\\u3052",legendEnabled:"\\u6709\\u52B9",invalidColor:"\\u8272\\u306E\\u5024\\u304C\\u7121\\u52B9\\u3067\\u3059",groupedColumnFull:"\\u30B0\\u30EB\\u30FC\\u30D7\\u5316\\u30AB\\u30E9\\u30E0",stackedColumnFull:"\\u7A4D\\u307F\\u4E0A\\u3052\\u30AB\\u30E9\\u30E0",normalizedColumnFull:"100%\\u7A4D\\u307F\\u4E0A\\u3052\\u30AB\\u30E9\\u30E0",groupedBarFull:"\\u30B0\\u30EB\\u30FC\\u30D7\\u5316\\u30D0\\u30FC",stackedBarFull:"\\u7A4D\\u307F\\u4E0A\\u3052\\u30D0\\u30FC",normalizedBarFull:"100%\\u7A4D\\u307F\\u4E0A\\u3052\\u30D0\\u30FC",stackedAreaFull:"\\u7A4D\\u307F\\u4E0A\\u3052\\u30A8\\u30EA\\u30A2",normalizedAreaFull:"100%\\u7A4D\\u307F\\u4E0A\\u3052\\u30A8\\u30EA\\u30A2",customCombo:"\\u30AB\\u30B9\\u30BF\\u30E0\\u30B3\\u30F3\\u30D3\\u30CD\\u30FC\\u30B7\\u30E7\\u30F3",ariaAdvancedFilterBuilderItem:"${variable}\\u3002 \\u30EC\\u30D9\\u30EB ${variable}\\u3002 \\u7DE8\\u96C6\\u3059\\u308B\\u306B\\u306FENTER\\u3092\\u62BC\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044\\u3002",ariaAdvancedFilterBuilderItemValidation:"${variable}\\u3002 \\u30EC\\u30D9\\u30EB ${variable}\\u3002 ${variable} \\u7DE8\\u96C6\\u3059\\u308B\\u306B\\u306FENTER\\u3092\\u62BC\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044\\u3002",ariaAdvancedFilterBuilderList:"\\u9AD8\\u5EA6\\u306A\\u30D5\\u30A3\\u30EB\\u30BF\\u30FC\\u30D3\\u30EB\\u30C0\\u30EA\\u30B9\\u30C8",ariaAdvancedFilterBuilderFilterItem:"\\u30D5\\u30A3\\u30EB\\u30BF\\u30FC\\u6761\\u4EF6",ariaAdvancedFilterBuilderGroupItem:"\\u30D5\\u30A3\\u30EB\\u30BF\\u30FC\\u30B0\\u30EB\\u30FC\\u30D7",ariaAdvancedFilterBuilderColumn:"\\u5217",ariaAdvancedFilterBuilderOption:"\\u30AA\\u30D7\\u30B7\\u30E7\\u30F3",ariaAdvancedFilterBuilderValueP:"\\u5024",ariaAdvancedFilterBuilderJoinOper';
      S = S + 'ator:"\\u7D50\\u5408\\u6F14\\u7B97\\u5B50",ariaAdvancedFilterInput:"\\u9AD8\\u5EA6\\u306A\\u30D5\\u30A3\\u30EB\\u30BF\\u30FC\\u5165\\u529B",ariaChecked:"\\u30C1\\u30A7\\u30C3\\u30AF\\u6E08\\u307F",ariaColumn:"\\u5217",ariaColumnGroup:"\\u5217\\u30B0\\u30EB\\u30FC\\u30D7",ariaColumnFiltered:"\\u30D5\\u30A3\\u30EB\\u30BF\\u30FC\\u304C\\u9069\\u7528\\u3055\\u308C\\u305F\\u5217",ariaColumnSelectAll:"\\u3059\\u3079\\u3066\\u306E\\u5217\\u3092\\u9078\\u629E/\\u9078\\u629E\\u89E3\\u9664",ariaDateFilterInput:"\\u65E5\\u4ED8\\u30D5\\u30A3\\u30EB\\u30BF\\u30FC\\u5165\\u529B",ariaDefaultListName:"\\u30EA\\u30B9\\u30C8",ariaFilterColumnsInput:"\\u30D5\\u30A3\\u30EB\\u30BF\\u30FC\\u5217\\u5165\\u529B",ariaFilterFromValue:"\\u5024\\u304B\\u3089\\u30D5\\u30A3\\u30EB\\u30BF\\u30FC",ariaFilterInput:"\\u30D5\\u30A3\\u30EB\\u30BF\\u30FC\\u5165\\u529B",ariaFilterList:"\\u30D5\\u30A3\\u30EB\\u30BF\\u30FC\\u30EA\\u30B9\\u30C8",ariaFilterToValue:"\\u5024\\u307E\\u3067\\u30D5\\u30A3\\u30EB\\u30BF\\u30FC",ariaFilterValue:"\\u30D5\\u30A3\\u30EB\\u30BF\\u30FC\\u5024",ariaFilterMenuOpen:"\\u30D5\\u30A3\\u30EB\\u30BF\\u30FC\\u30E1\\u30CB\\u30E5\\u30FC\\u3092\\u958B\\u304F",ariaFilteringOperator:"\\u30D5\\u30A3\\u30EB\\u30BF\\u30FC\\u6F14\\u7B97\\u5B50",ariaHidden:"\\u975E\\u8868\\u793A",ariaIndeterminate:"\\u4E0D\\u78BA\\u5B9A",ariaInputEditor:"\\u5165\\u529B\\u30A8\\u30C7\\u30A3\\u30BF\\u30FC",ariaMenuColumn:"\\u5217\\u30E1\\u30CB\\u30E5\\u30FC\\u3092\\u958B\\u304F\\u306B\\u306FALT+\\u2193\\u3092\\u62BC\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044",ariaFilterColumn:"\\u30D5\\u30A3\\u30EB\\u30BF\\u30FC\\u3092\\u958B\\u304F\\u306B\\u306FCTRL+ENTER\\u3092\\u62BC\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044",ariaRowDeselect:"\\u3053\\u306E\\u884C\\u306E\\u9078\\u629E\\u3092\\u89E3\\u9664\\u3059\\u308B\\u306B\\u306FSPACE\\u3092\\u62BC\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044",ariaRowSelectAll:"\\u3059\\u3079\\u3066\\u306E\\u884C\\u306E\\u9078\\u629E\\u3092\\u5207\\u308A\\u66FF\\u3048\\u308B\\u306B\\u306FSPACE\\u3092\\u62BC\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044",ariaRowToggleSelection:"\\u884C\\u306E\\u9078\\u629E\\u3092\\u5207\\u308A\\u66FF\\u3048\\u308B\\u306B\\u306FSPACE\\u3092\\u62BC\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044",ariaRowS';
      S = S + 'elect:"\\u3053\\u306E\\u884C\\u3092\\u9078\\u629E\\u3059\\u308B\\u306B\\u306FSPACE\\u3092\\u62BC\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044",ariaRowSelectionDisabled:"\\u3053\\u306E\\u884C\\u306E\\u9078\\u629E\\u306F\\u7121\\u52B9\\u3067\\u3059",ariaSearch:"\\u691C\\u7D22",ariaSortableColumn:"\\u4E26\\u3079\\u66FF\\u3048\\u308B\\u306B\\u306FENTER\\u3092\\u62BC\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044",ariaToggleVisibility:"\\u8868\\u793A\\u3092\\u5207\\u308A\\u66FF\\u3048\\u308B\\u306B\\u306FSPACE\\u3092\\u62BC\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044",ariaToggleCellValue:"\\u30BB\\u30EB\\u306E\\u5024\\u3092\\u5207\\u308A\\u66FF\\u3048\\u308B\\u306B\\u306FSPACE\\u3092\\u62BC\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044",ariaUnchecked:"\\u672A\\u30C1\\u30A7\\u30C3\\u30AF",ariaVisible:"\\u8868\\u793A",ariaSearchFilterValues:"\\u30D5\\u30A3\\u30EB\\u30BF\\u30FC\\u5024\\u3092\\u691C\\u7D22",ariaPageSizeSelectorLabel:"\\u30DA\\u30FC\\u30B8\\u30B5\\u30A4\\u30BA",ariaChartMenuClose:"\\u30C1\\u30E3\\u30FC\\u30C8\\u7DE8\\u96C6\\u30E1\\u30CB\\u30E5\\u30FC\\u3092\\u9589\\u3058\\u308B",ariaChartSelected:"\\u9078\\u629E\\u6E08\\u307F",ariaSkeletonCellLoadingFailed:"\\u884C\\u306E\\u8AAD\\u307F\\u8FBC\\u307F\\u306B\\u5931\\u6557\\u3057\\u307E\\u3057\\u305F",ariaSkeletonCellLoading:"\\u884C\\u30C7\\u30FC\\u30BF\\u3092\\u8AAD\\u307F\\u8FBC\\u307F\\u4E2D",ariaRowGroupDropZonePanelLabel:"\\u884C\\u30B0\\u30EB\\u30FC\\u30D7",ariaValuesDropZonePanelLabel:"\\u5024",ariaPivotDropZonePanelLabel:"\\u5217\\u30E9\\u30D9\\u30EB",ariaDropZoneColumnComponentDescription:"\\u524A\\u9664\\u3059\\u308B\\u306B\\u306F DELETE \\u3092\\u62BC\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044",ariaDropZoneColumnValueItemDescription:"\\u96C6\\u8A08\\u30BF\\u30A4\\u30D7\\u3092\\u5909\\u66F4\\u3059\\u308B\\u306B\\u306F ENTER \\u3092\\u62BC\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044",ariaDropZoneColumnGroupItemDescription:"\\u30BD\\u30FC\\u30C8\\u3059\\u308B\\u306B\\u306F ENTER \\u3092\\u62BC\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044",ariaDropZoneColumnComponentAggFuncSeparator:" \\u306E ",ariaDropZoneColumnComponentSortAscending:"\\u6607\\u9806",ariaDropZoneColumnComponentSortDescending:"\\u964D\\u9806",ariaLabelDialog:"\\u30';
      S = S + 'C0\\u30A4\\u30A2\\u30ED\\u30B0",ariaLabelColumnMenu:"\\u5217\\u30E1\\u30CB\\u30E5\\u30FC",ariaLabelColumnFilter:"\\u5217\\u30D5\\u30A3\\u30EB\\u30BF\\u30FC",ariaLabelCellEditor:"\\u30BB\\u30EB\\u30A8\\u30C7\\u30A3\\u30BF\\u30FC",ariaLabelSelectField:"\\u30D5\\u30A3\\u30FC\\u30EB\\u30C9\\u3092\\u9078\\u629E",ariaLabelRichSelectField:"\\u30EA\\u30C3\\u30C1\\u30BB\\u30EC\\u30AF\\u30C8\\u30D5\\u30A3\\u30FC\\u30EB\\u30C9",ariaLabelRichSelectToggleSelection:"\\u9078\\u629E\\u3092\\u5207\\u308A\\u66FF\\u3048\\u308B\\u306B\\u306F\\u30B9\\u30DA\\u30FC\\u30B9\\u3092\\u62BC\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044",ariaLabelRichSelectDeselectAllItems:"\\u3059\\u3079\\u3066\\u306E\\u30A2\\u30A4\\u30C6\\u30E0\\u306E\\u9078\\u629E\\u3092\\u89E3\\u9664\\u3059\\u308B\\u306B\\u306FDELETE\\u3092\\u62BC\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044",ariaLabelRichSelectDeleteSelection:"\\u30A2\\u30A4\\u30C6\\u30E0\\u306E\\u9078\\u629E\\u3092\\u89E3\\u9664\\u3059\\u308B\\u306B\\u306FDELETE\\u3092\\u62BC\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044",ariaLabelTooltip:"\\u30C4\\u30FC\\u30EB\\u30C1\\u30C3\\u30D7",ariaLabelContextMenu:"\\u30B3\\u30F3\\u30C6\\u30AD\\u30B9\\u30C8\\u30E1\\u30CB\\u30E5\\u30FC",ariaLabelSubMenu:"\\u30B5\\u30D6\\u30E1\\u30CB\\u30E5\\u30FC",ariaLabelAggregationFunction:"\\u96C6\\u8A08\\u95A2\\u6570",ariaLabelAdvancedFilterAutocomplete:"\\u9AD8\\u5EA6\\u306A\\u30D5\\u30A3\\u30EB\\u30BF\\u30FC\\u30AA\\u30FC\\u30C8\\u30B3\\u30F3\\u30D7\\u30EA\\u30FC\\u30C8",ariaLabelAdvancedFilterBuilderAddField:"\\u9AD8\\u5EA6\\u306A\\u30D5\\u30A3\\u30EB\\u30BF\\u30FC\\u30D3\\u30EB\\u30C0\\u30FC\\u306B\\u30D5\\u30A3\\u30FC\\u30EB\\u30C9\\u3092\\u8FFD\\u52A0",ariaLabelAdvancedFilterBuilderColumnSelectField:"\\u9AD8\\u5EA6\\u306A\\u30D5\\u30A3\\u30EB\\u30BF\\u30FC\\u30D3\\u30EB\\u30C0\\u30FC\\u306E\\u5217\\u9078\\u629E\\u30D5\\u30A3\\u30FC\\u30EB\\u30C9",ariaLabelAdvancedFilterBuilderOptionSelectField:"\\u9AD8\\u5EA6\\u306A\\u30D5\\u30A3\\u30EB\\u30BF\\u30FC\\u30D3\\u30EB\\u30C0\\u30FC\\u306E\\u30AA\\u30D7\\u30B7\\u30E7\\u30F3\\u9078\\u629E\\u30D5\\u30A3\\u30FC\\u30EB\\u30C9",ariaLabelAdvancedFilterBuilderJoinSelectField:"\\u9AD8\\u5EA6\\u306A\\u30D5\\u30A3\\u30EB\\u30BF\\u30FC\\u30D3\\u30EB\\u30C0\\u30FC\\u306E\\u7D50\\u54';
      S = S + '08\\u6F14\\u7B97\\u5B50\\u9078\\u629E\\u30D5\\u30A3\\u30FC\\u30EB\\u30C9",ariaColumnPanelList:"\\u5217\\u30EA\\u30B9\\u30C8",ariaFilterPanelList:"\\u30D5\\u30A3\\u30EB\\u30BF\\u30FC\\u30EA\\u30B9\\u30C8",thousandSeparator:"\\u3001",decimalSeparator:"\\u3002",true:"\\u771F",false:"\\u507D",invalidDate:"\\u7121\\u52B9\\u306A\\u65E5\\u4ED8",invalidNumber:"\\u7121\\u52B9\\u306A\\u6570\\u5024",january:"1\\u6708",february:"2\\u6708",march:"3\\u6708",april:"4\\u6708",may:"5\\u6708",june:"6\\u6708",july:"7\\u6708",august:"8\\u6708",september:"9\\u6708",october:"10\\u6708",november:"11\\u6708",december:"12\\u6708",timeFormatSlashesDDMMYYYY:"DD/MM/YYYY",timeFormatSlashesMMDDYYYY:"MM/DD/YYYY",timeFormatSlashesDDMMYY:"DD/MM/YY",timeFormatSlashesMMDDYY:"MM/DD/YY",timeFormatDotsDDMYY:"DD.M.YY",timeFormatDotsMDDYY:"M.DD.YY",timeFormatDashesYYYYMMDD:"YYYY-MM-DD",timeFormatSpacesDDMMMMYYYY:"DD MMMM YYYY",timeFormatHHMMSS:"HH:MM:SS",timeFormatHHMMSSAmPm:"HH:MM:SS \\u5348\\u524D/\\u5348\\u5F8C"},M={selectAll:"(\\uC804\\uCCB4 \\uC120\\uD0DD)",selectAllSearchResults:"(\\uAC80\\uC0C9 \\uACB0\\uACFC \\uBAA8\\uB450 \\uC120\\uD0DD)",addCurrentSelectionToFilter:"\\uD604\\uC7AC \\uC120\\uD0DD\\uC744 \\uD544\\uD130\\uC5D0 \\uCD94\\uAC00",searchOoo:"\\uAC80\\uC0C9...",blanks:"(\\uBE48\\uCE78)",noMatches:"\\uC77C\\uCE58\\uD558\\uB294 \\uD56D\\uBAA9\\uC774 \\uC5C6\\uC2B5\\uB2C8\\uB2E4",filterOoo:"\\uD544\\uD130...",equals:"\\uAC19\\uC74C",notEqual:"\\uAC19\\uC9C0 \\uC54A\\uC74C",blank:"\\uBE48\\uCE78",notBlank:"\\uBE44\\uC5B4 \\uC788\\uC9C0 \\uC54A\\uC74C",empty:"\\uC120\\uD0DD\\uD558\\uC138\\uC694",lessThan:"\\uBCF4\\uB2E4 \\uC791\\uC74C",greaterThan:"\\uBCF4\\uB2E4 \\uD07C",lessThanOrEqual:"\\uC774\\uD558",greaterThanOrEqual:"\\uC774\\uC0C1",inRange:"\\uC0AC\\uC774",inRangeStart:"\\uBD80\\uD130",inRangeEnd:"\\uAE4C\\uC9C0",contains:"\\uD3EC\\uD568",notContains:"\\uD3EC\\uD568\\uD558\\uC9C0 \\uC54A\\uC74C",startsWith:"\\uC2DC\\uC791",endsWith:"\\uB05D",dateFormatOoo:"yyyy-mm-dd",before:"\\uC774\\uC804",after:"\\uC774\\uD6C4",andCondition:"AND",orCondition:"OR",applyFilter:"\\uC801\\uC6A9",resetFilter:"\\uC7AC\\uC124\\uC815",clearFilter:"\\u';
      S = S + 'C9C0\\uC6B0\\uAE30",cancelFilter:"\\uCDE8\\uC18C",textFilter:"\\uD14D\\uC2A4\\uD2B8 \\uD544\\uD130",numberFilter:"\\uC22B\\uC790 \\uD544\\uD130",dateFilter:"\\uB0A0\\uC9DC \\uD544\\uD130",setFilter:"\\uC138\\uD2B8 \\uD544\\uD130",groupFilterSelect:"\\uD544\\uB4DC\\uB97C \\uC120\\uD0DD\\uD558\\uC138\\uC694:",advancedFilterContains:"\\uD3EC\\uD568",advancedFilterNotContains:"\\uD3EC\\uD568\\uD558\\uC9C0 \\uC54A\\uC74C",advancedFilterTextEquals:"\\uAC19\\uC74C",advancedFilterTextNotEqual:"\\uAC19\\uC9C0 \\uC54A\\uC74C",advancedFilterStartsWith:"\\uC2DC\\uC791\\uC774",advancedFilterEndsWith:"\\uB05D\\uC774",advancedFilterBlank:"\\uBE44\\uC5B4 \\uC788\\uC74C",advancedFilterNotBlank:"\\uBE44\\uC5B4 \\uC788\\uC9C0 \\uC54A\\uC74C",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"\\uCC38\\uC784",advancedFilterFalse:"\\uAC70\\uC9D3\\uC784",advancedFilterAnd:"AND",advancedFilterOr:"OR",advancedFilterApply:"\\uC801\\uC6A9",advancedFilterBuilder:"\\uC0DD\\uC131\\uAE30",advancedFilterValidationMissingColumn:"\\uC5F4\\uC774 \\uB204\\uB77D\\uB418\\uC5C8\\uC2B5\\uB2C8\\uB2E4",advancedFilterValidationMissingOption:"\\uC635\\uC158\\uC774 \\uB204\\uB77D\\uB418\\uC5C8\\uC2B5\\uB2C8\\uB2E4",advancedFilterValidationMissingValue:"\\uAC12\\uC774 \\uB204\\uB77D\\uB418\\uC5C8\\uC2B5\\uB2C8\\uB2E4",advancedFilterValidationInvalidColumn:"\\uC5F4\\uC744 \\uCC3E\\uC744 \\uC218 \\uC5C6\\uC2B5\\uB2C8\\uB2E4",advancedFilterValidationInvalidOption:"\\uC635\\uC158\\uC744 \\uCC3E\\uC744 \\uC218 \\uC5C6\\uC2B5\\uB2C8\\uB2E4",advancedFilterValidationMissingQuote:"\\uAC12\\uC5D0 \\uB05D\\uB098\\uB294 \\uC778\\uC6A9\\uBD80\\uD638\\uAC00 \\uC5C6\\uC2B5\\uB2C8\\uB2E4",advancedFilterValidationNotANumber:"\\uAC12\\uC774 \\uC22B\\uC790\\uAC00 \\uC544\\uB2D9\\uB2C8\\uB2E4",advancedFilterValidationInvalidDate:"\\uAC12\\uC774 \\uC720\\uD6A8\\uD55C \\uB0A0\\uC9DC\\uAC00 \\uC544\\uB2D9\\uB2C8\\uB2E4",advancedFilterValidationMissingCondition:"\\uC870\\uAC74\\uC774 \\uB204\\uB77D\\uB418\\uC5C8\\uC2B5\\uB2C8\\uB2E4",advanced';
      S = S + 'FilterValidationJoinOperatorMismatch:"\\uC870\\uAC74 \\uB0B4\\uC758 \\uC5F0\\uACB0 \\uC5F0\\uC0B0\\uC790\\uB294 \\uB3D9\\uC77C\\uD574\\uC57C \\uD569\\uB2C8\\uB2E4",advancedFilterValidationInvalidJoinOperator:"\\uC5F0\\uACB0 \\uC5F0\\uC0B0\\uC790\\uB97C \\uCC3E\\uC744 \\uC218 \\uC5C6\\uC2B5\\uB2C8\\uB2E4",advancedFilterValidationMissingEndBracket:"\\uB05D \\uAD04\\uD638\\uAC00 \\uB204\\uB77D\\uB418\\uC5C8\\uC2B5\\uB2C8\\uB2E4",advancedFilterValidationExtraEndBracket:"\\uC885\\uACB0 \\uAD04\\uD638\\uAC00 \\uB108\\uBB34 \\uB9CE\\uC2B5\\uB2C8\\uB2E4",advancedFilterValidationMessage:"\\uC2DD\\uC5D0 \\uC624\\uB958\\uAC00 \\uC788\\uC2B5\\uB2C8\\uB2E4. ${variable} - ${variable}.",advancedFilterValidationMessageAtEnd:"\\uC2DD\\uC5D0 \\uC624\\uB958\\uAC00 \\uC788\\uC2B5\\uB2C8\\uB2E4. ${variable} \\uC2DD\\uC758 \\uB05D\\uC5D0 \\uC788\\uC2B5\\uB2C8\\uB2E4.",advancedFilterBuilderTitle:"\\uACE0\\uAE09 \\uD544\\uD130",advancedFilterBuilderApply:"\\uC801\\uC6A9",advancedFilterBuilderCancel:"\\uCDE8\\uC18C",advancedFilterBuilderAddButtonTooltip:"\\uD544\\uD130 \\uB610\\uB294 \\uADF8\\uB8F9 \\uCD94\\uAC00",advancedFilterBuilderRemoveButtonTooltip:"\\uC81C\\uAC70",advancedFilterBuilderMoveUpButtonTooltip:"\\uC704\\uB85C \\uC774\\uB3D9",advancedFilterBuilderMoveDownButtonTooltip:"\\uC544\\uB798\\uB85C \\uC774\\uB3D9",advancedFilterBuilderAddJoin:"\\uADF8\\uB8F9 \\uCD94\\uAC00",advancedFilterBuilderAddCondition:"\\uD544\\uD130 \\uCD94\\uAC00",advancedFilterBuilderSelectColumn:"\\uC5F4 \\uC120\\uD0DD",advancedFilterBuilderSelectOption:"\\uC635\\uC158 \\uC120\\uD0DD",advancedFilterBuilderEnterValue:"\\uAC12\\uC744 \\uC785\\uB825\\uD558\\uC138\\uC694...",advancedFilterBuilderValidationAlreadyApplied:"\\uD604\\uC7AC \\uD544\\uD130\\uAC00 \\uC774\\uBBF8 \\uC801\\uC6A9\\uB418\\uC5C8\\uC2B5\\uB2C8\\uB2E4.",advancedFilterBuilderValidationIncomplete:"\\uBAA8\\uB4E0 \\uC870\\uAC74\\uC774 \\uC644\\uB8CC\\uB418\\uC9C0 \\uC54A\\uC558\\uC2B5\\uB2C8\\uB2E4.",advancedFilterBuilderValidationSelectColumn:"\\uC5F4\\uC744 \\uC120\\uD0DD\\uD574\\uC57C \\uD569\\uB2C8\\uB2E4.",advancedFilterBuilderValidationSelectOption:"\\uC635\\uC158\\uC744 \\uC120\\uD0DD\\uD574\\uC57C \\uD5';
      S = S + '69\\uB2C8\\uB2E4.",advancedFilterBuilderValidationEnterValue:"\\uAC12\\uC744 \\uC785\\uB825\\uD574\\uC57C \\uD569\\uB2C8\\uB2E4.",columns:"\\uC5F4",filters:"\\uD544\\uD130",pivotMode:"\\uD53C\\uBC97 \\uBAA8\\uB4DC",groups:"\\uD589 \\uADF8\\uB8F9",rowGroupColumnsEmptyMessage:"\\uC5EC\\uAE30\\uB85C \\uB4DC\\uB798\\uADF8\\uD558\\uC5EC \\uD589 \\uADF8\\uB8F9 \\uC124\\uC815",values:"\\uAC12",valueColumnsEmptyMessage:"\\uC5EC\\uAE30\\uB85C \\uB4DC\\uB798\\uADF8\\uD558\\uC5EC \\uC9D1\\uACC4",pivots:"\\uC5F4 \\uB808\\uC774\\uBE14",pivotColumnsEmptyMessage:"\\uC5EC\\uAE30\\uB85C \\uB4DC\\uB798\\uADF8\\uD558\\uC5EC \\uC5F4 \\uB808\\uC774\\uBE14 \\uC124\\uC815",group:"\\uADF8\\uB8F9",rowDragRow:"\\uD589",rowDragRows:"\\uD589\\uB4E4",loadingOoo:"\\uB85C\\uB529 \\uC911...",loadingError:"\\uC624\\uB958",noRowsToShow:"\\uD45C\\uC2DC\\uD560 \\uD589\\uC774 \\uC5C6\\uC2B5\\uB2C8\\uB2E4",enabled:"\\uC0AC\\uC6A9 \\uC911",pinColumn:"\\uC5F4 \\uACE0\\uC815",pinLeft:"\\uC67C\\uCABD\\uC5D0 \\uACE0\\uC815",pinRight:"\\uC624\\uB978\\uCABD\\uC5D0 \\uACE0\\uC815",noPin:"\\uACE0\\uC815 \\uC5C6\\uC74C",valueAggregation:"\\uAC12 \\uC9D1\\uACC4",noAggregation:"\\uC5C6\\uC74C",autosizeThisColumn:"\\uC774 \\uC5F4 \\uC790\\uB3D9 \\uD06C\\uAE30 \\uC870\\uC815",autosizeAllColumns:"\\uBAA8\\uB4E0 \\uC5F4 \\uC790\\uB3D9 \\uD06C\\uAE30 \\uC870\\uC815",groupBy:"\\uADF8\\uB8F9\\uD654 \\uAE30\\uC900",ungroupBy:"\\uADF8\\uB8F9 \\uD574\\uC81C \\uAE30\\uC900",ungroupAll:"\\uBAA8\\uB4E0 \\uADF8\\uB8F9 \\uD574\\uC81C",addToValues:"${variable} \\uAC12\\uC744 \\uCD94\\uAC00",removeFromValues:"${variable} \\uAC12\\uC744 \\uC81C\\uAC70",addToLabels:"${variable} \\uB808\\uC774\\uBE14\\uC5D0 \\uCD94\\uAC00",removeFromLabels:"${variable} \\uB808\\uC774\\uBE14\\uC5D0\\uC11C \\uC81C\\uAC70",resetColumns:"\\uC5F4 \\uC7AC\\uC124\\uC815",expandAll:"\\uBAA8\\uB4E0 \\uD589 \\uADF8\\uB8F9 \\uD655\\uC7A5",collapseAll:"\\uBAA8\\uB4E0 \\uD589 \\uADF8\\uB8F9 \\uB2EB\\uAE30",copy:"\\uBCF5\\uC0AC",ctrlC:"Ctrl+C",ctrlX:"Ctrl+X",copyWithHeaders:"\\uBA38\\uB9AC\\uAE00\\uACFC \\uD568\\uAED8 \\uBCF5\\uC0AC",copyWithGroupHeaders:"\\uADF8\\uB8F9 \\uBA38\\uB9AC\\uAE00\\uACFC \\uD568\\uAED8 \\uBCF5\\uC0AC",cut:"\\uC798\\uB77C\\uB0B4\\uAE30",pa';
      S = S + 'ste:"\\uBD99\\uC5EC\\uB123\\uAE30",ctrlV:"Ctrl+V",export:"\\uB0B4\\uBCF4\\uB0B4\\uAE30",csvExport:"CSV \\uB0B4\\uBCF4\\uB0B4\\uAE30",excelExport:"Excel \\uB0B4\\uBCF4\\uB0B4\\uAE30",columnFilter:"\\uC5F4 \\uD544\\uD130",columnChooser:"\\uC5F4 \\uC120\\uD0DD",sortAscending:"\\uC624\\uB984\\uCC28\\uC21C \\uC815\\uB82C",sortDescending:"\\uB0B4\\uB9BC\\uCC28\\uC21C \\uC815\\uB82C",sortUnSort:"\\uC815\\uB82C \\uD574\\uC81C",sum:"\\uD569\\uACC4",first:"\\uCCAB \\uBC88\\uC9F8",last:"\\uB9C8\\uC9C0\\uB9C9",min:"\\uCD5C\\uC18C",max:"\\uCD5C\\uB300",none:"\\uC5C6\\uC74C",count:"\\uAC1C\\uC218",avg:"\\uD3C9\\uADE0",filteredRows:"\\uD544\\uD130\\uB41C \\uD589",selectedRows:"\\uC120\\uD0DD\\uB41C \\uD589",totalRows:"\\uCD1D \\uD589 \\uC218",totalAndFilteredRows:"\\uD589",more:"\\uB354 \\uBCF4\\uAE30",to:"\\uC5D0\\uC11C",of:"\\uC758",page:"\\uD398\\uC774\\uC9C0",pageLastRowUnknown:"?",nextPage:"\\uB2E4\\uC74C \\uD398\\uC774\\uC9C0",lastPage:"\\uB9C8\\uC9C0\\uB9C9 \\uD398\\uC774\\uC9C0",firstPage:"\\uCCAB \\uD398\\uC774\\uC9C0",previousPage:"\\uC774\\uC804 \\uD398\\uC774\\uC9C0",pageSizeSelectorLabel:"\\uD398\\uC774\\uC9C0 \\uD06C\\uAE30:",footerTotal:"\\uCD1D\\uACC4",pivotColumnGroupTotals:"\\uCD1D\\uD569\\uACC4",pivotChartAndPivotMode:"\\uD53C\\uBC97 \\uCC28\\uD2B8 & \\uD53C\\uBC97 \\uBAA8\\uB4DC",pivotChart:"\\uD53C\\uBC97 \\uCC28\\uD2B8",chartRange:"\\uCC28\\uD2B8 \\uBC94\\uC704",columnChart:"\\uCEEC\\uB7FC",groupedColumn:"\\uADF8\\uB8F9\\uD654",stackedColumn:"\\uC2A4\\uD0DD",normalizedColumn:"100% \\uC2A4\\uD0DD",barChart:"\\uB9C9\\uB300",groupedBar:"\\uADF8\\uB8F9\\uD654",stackedBar:"\\uC2A4\\uD0DD",normalizedBar:"100% \\uC2A4\\uD0DD",pieChart:"\\uD30C\\uC774",pie:"\\uD30C\\uC774",donut:"\\uB3C4\\uB11B",line:"\\uB77C\\uC778",xyChart:"X Y (\\uC0B0\\uC810\\uB3C4)",scatter:"\\uC0B0\\uC810\\uB3C4",bubble:"\\uBC84\\uBE14",areaChart:"\\uC601\\uC5ED",area:"\\uC601\\uC5ED",stackedArea:"\\uC2A4\\uD0DD \\uC601\\uC5ED",normalizedArea:"100% \\uC2A4\\uD0DD \\uC601\\uC5ED",histogramChart:"\\uD788\\uC2A4\\uD1A0\\uADF8\\uB7A8",polarChart:"\\uD3F4\\uB77C",radarLine:"\\uB808\\uC774\\uB354 \\uB77C\\uC778",radarArea:"\\uB808\\uC774\\uB354 \\uC601\\uC5ED",nightingale:"\\uB098\\uC';
      S = S + '774\\uD305\\uAC8C\\uC77C",radialColumn:"\\uBC29\\uC0AC\\uD615 \\uCEEC\\uB7FC",radialBar:"\\uBC29\\uC0AC\\uD615 \\uB9C9\\uB300",statisticalChart:"\\uD1B5\\uACC4",boxPlot:"\\uC0C1\\uC790 \\uADF8\\uB9BC",rangeBar:"\\uBC94\\uC704 \\uB9C9\\uB300",rangeArea:"\\uBC94\\uC704 \\uC601\\uC5ED",hierarchicalChart:"\\uACC4\\uCE35\\uC801",treemap:"\\uD2B8\\uB9AC\\uB9F5",sunburst:"\\uC120\\uBC84\\uC2A4\\uD2B8",specializedChart:"\\uD2B9\\uC218",waterfall:"\\uD3ED\\uD3EC",heatmap:"\\uD788\\uD2B8\\uB9F5",combinationChart:"\\uBCF5\\uD569",columnLineCombo:"\\uCEEC\\uB7FC & \\uB77C\\uC778",AreaColumnCombo:"\\uC601\\uC5ED & \\uCEEC\\uB7FC",pivotChartTitle:"\\uD53C\\uBC97 \\uCC28\\uD2B8",rangeChartTitle:"\\uBC94\\uC704 \\uCC28\\uD2B8",settings:"\\uCC28\\uD2B8",data:"\\uC124\\uC815",format:"\\uB9DE\\uCDA4 \\uC124\\uC815",categories:"\\uCE74\\uD14C\\uACE0\\uB9AC",defaultCategory:"(\\uC5C6\\uC74C)",series:"\\uC2DC\\uB9AC\\uC988",switchCategorySeries:"\\uCE74\\uD14C\\uACE0\\uB9AC / \\uC2DC\\uB9AC\\uC988 \\uC804\\uD658",categoryValues:"\\uCE74\\uD14C\\uACE0\\uB9AC \\uAC12",seriesLabels:"\\uC2DC\\uB9AC\\uC988 \\uB77C\\uBCA8",aggregate:"\\uD569\\uC0B0",xyValues:"X Y \\uAC12\\uB4E4",paired:"\\uC30D \\uBAA8\\uB4DC",axis:"\\uCD95",xAxis:"\\uC218\\uD3C9 \\uCD95",yAxis:"\\uC218\\uC9C1 \\uCD95",polarAxis:"\\uD3F4\\uB77C \\uCD95",radiusAxis:"\\uBC18\\uACBD \\uCD95",navigator:"\\uB124\\uBE44\\uAC8C\\uC774\\uD130",zoom:"\\uC90C",animation:"\\uC560\\uB2C8\\uBA54\\uC774\\uC158",crosshair:"\\uD06C\\uB85C\\uC2A4\\uD5E4\\uC5B4",color:"\\uC0C9\\uC0C1",thickness:"\\uB450\\uAED8",preferredLength:"\\uC120\\uD638 \\uAE38\\uC774",xType:"X \\uC720\\uD615",axisType:"\\uCD95 \\uC720\\uD615",automatic:"\\uC790\\uB3D9",category:"\\uCE74\\uD14C\\uACE0\\uB9AC",number:"\\uC22B\\uC790",time:"\\uC2DC\\uAC04",timeFormat:"\\uC2DC\\uAC04 \\uD615\\uC2DD",autoRotate:"\\uC790\\uB3D9 \\uD68C\\uC804",labelRotation:"\\uD68C\\uC804",circle:"\\uC6D0",polygon:"\\uB2E4\\uAC01\\uD615",square:"\\uC0AC\\uAC01\\uD615",cross:"\\uC2ED\\uC790",diamond:"\\uB2E4\\uC774\\uC544\\uBAAC\\uB4DC",plus:"\\uD50C\\uB7EC\\uC2A4",triangle:"\\uC0BC\\uAC01\\uD615",heart:"\\uD558\\uD2B8",orientation:"\\uBC29\\uD5A5",fixed:"\\uACE0\\uC815",parallel:"\\';
      S = S + 'uBCD1\\uB82C",perpendicular:"\\uC218\\uC9C1",radiusAxisPosition:"\\uC704\\uCE58",ticks:"\\uD2F1",gridLines:"\\uACA9\\uC790 \\uB77C\\uC778",width:"\\uB108\\uBE44",height:"\\uB192\\uC774",length:"\\uAE38\\uC774",padding:"\\uD328\\uB529",spacing:"\\uAC04\\uACA9",chartStyle:"\\uCC28\\uD2B8 \\uC2A4\\uD0C0\\uC77C",title:"\\uC81C\\uBAA9",chartTitles:"\\uC81C\\uBAA9\\uB4E4",chartTitle:"\\uCC28\\uD2B8 \\uC81C\\uBAA9",chartSubtitle:"\\uBD80\\uC81C\\uBAA9",horizontalAxisTitle:"\\uC218\\uD3C9 \\uCD95 \\uC81C\\uBAA9",verticalAxisTitle:"\\uC218\\uC9C1 \\uCD95 \\uC81C\\uBAA9",polarAxisTitle:"\\uD3F4\\uB77C \\uCD95 \\uC81C\\uBAA9",titlePlaceholder:"\\uCC28\\uD2B8 \\uC81C\\uBAA9",background:"\\uBC30\\uACBD",font:"\\uAE00\\uAF34",weight:"\\uAD75\\uAE30",top:"\\uC704",right:"\\uC624\\uB978\\uCABD",bottom:"\\uC544\\uB798",left:"\\uC67C\\uCABD",labels:"\\uB77C\\uBCA8",calloutLabels:"\\uCF5C\\uC544\\uC6C3 \\uB77C\\uBCA8",sectorLabels:"\\uC139\\uD130 \\uB77C\\uBCA8",positionRatio:"\\uC704\\uCE58 \\uBE44\\uC728",size:"\\uD06C\\uAE30",shape:"\\uD615\\uD0DC",minSize:"\\uCD5C\\uC18C \\uD06C\\uAE30",maxSize:"\\uCD5C\\uB300 \\uD06C\\uAE30",legend:"\\uBC94\\uB840",position:"\\uC704\\uCE58",markerSize:"\\uB9C8\\uCEE4 \\uD06C\\uAE30",markerStroke:"\\uB9C8\\uCEE4 \\uC2A4\\uD2B8\\uB85C\\uD06C",markerPadding:"\\uB9C8\\uCEE4 \\uD328\\uB529",itemSpacing:"\\uC544\\uC774\\uD15C \\uAC04\\uACA9",itemPaddingX:"\\uC544\\uC774\\uD15C \\uD328\\uB529 X",itemPaddingY:"\\uC544\\uC774\\uD15C \\uD328\\uB529 Y",layoutHorizontalSpacing:"\\uC218\\uD3C9 \\uAC04\\uACA9",layoutVerticalSpacing:"\\uC218\\uC9C1 \\uAC04\\uACA9",strokeWidth:"\\uC2A4\\uD2B8\\uB85C\\uD06C \\uB450\\uAED8",offset:"\\uC624\\uD504\\uC14B",offsets:"\\uC624\\uD504\\uC14B\\uB4E4",tooltips:"\\uD234\\uD301",callout:"\\uCF5C\\uC544\\uC6C3",markers:"\\uB9C8\\uCEE4",shadow:"\\uADF8\\uB9BC\\uC790",blur:"\\uBE14\\uB7EC",xOffset:"X \\uC624\\uD504\\uC14B",yOffset:"Y \\uC624\\uD504\\uC14B",lineWidth:"\\uB77C\\uC778 \\uB108\\uBE44",lineDash:"\\uB77C\\uC778 \\uB300\\uC2DC",lineDashOffset:"\\uB300\\uC2DC \\uC624\\uD504\\uC14B",scrollingZoom:"\\uC2A4\\uD06C\\uB864",scrollingStep:"\\uC2A4\\uD06C\\uB864 \\uC2A4\\uD15D",selectingZoom:"\\uC120\\uD0DD",durat';
      S = S + 'ionMillis:"\\uC9C0\\uC18D \\uC2DC\\uAC04 (ms)",crosshairLabel:"\\uB77C\\uBCA8",crosshairSnap:"\\uB178\\uB4DC\\uC5D0 \\uC2A4\\uB0C5",normal:"\\uBCF4\\uD1B5",bold:"\\uAD75\\uAC8C",italic:"\\uAE30\\uC6B8\\uC784\\uAF34",boldItalic:"\\uAD75\\uAC8C \\uAE30\\uC6B8\\uC784\\uAF34",predefined:"\\uC0AC\\uC804 \\uC815\\uC758\\uB41C",fillOpacity:"\\uCC44\\uC6B0\\uAE30 \\uBD88\\uD22C\\uBA85\\uB3C4",strokeColor:"\\uB77C\\uC778 \\uC0C9\\uC0C1",strokeOpacity:"\\uB77C\\uC778 \\uBD88\\uD22C\\uBA85\\uB3C4",miniChart:"\\uBBF8\\uB2C8 \\uCC28\\uD2B8",histogramBinCount:"\\uBE48 \\uC218",connectorLine:"\\uC5F0\\uACB0 \\uB77C\\uC778",seriesItems:"\\uC2DC\\uB9AC\\uC988 \\uD56D\\uBAA9",seriesItemType:"\\uD56D\\uBAA9 \\uC720\\uD615",seriesItemPositive:"\\uC591\\uC218",seriesItemNegative:"\\uC74C\\uC218",seriesItemLabels:"\\uD56D\\uBAA9 \\uB77C\\uBCA8",columnGroup:"\\uC5F4",barGroup:"\\uB9C9\\uB300",pieGroup:"\\uD30C\\uC774",lineGroup:"\\uB77C\\uC778",scatterGroup:"X Y (\\uC0B0\\uC810\\uB3C4)",areaGroup:"\\uBA74\\uC801",polarGroup:"\\uD3F4\\uB77C",statisticalGroup:"\\uD1B5\\uACC4",hierarchicalGroup:"\\uACC4\\uCE35",specializedGroup:"\\uC804\\uBB38",combinationGroup:"\\uACB0\\uD569",groupedColumnTooltip:"\\uADF8\\uB8F9\\uD654",stackedColumnTooltip:"\\uC2A4\\uD0DD",normalizedColumnTooltip:"100% \\uC2A4\\uD0DD",groupedBarTooltip:"\\uADF8\\uB8F9\\uD654",stackedBarTooltip:"\\uC2A4\\uD0DD",normalizedBarTooltip:"100% \\uC2A4\\uD0DD",pieTooltip:"\\uD30C\\uC774",donutTooltip:"\\uB3C4\\uB11B",lineTooltip:"\\uB77C\\uC778",groupedAreaTooltip:"\\uBA74\\uC801",stackedAreaTooltip:"\\uC2A4\\uD0DD",normalizedAreaTooltip:"100% \\uC2A4\\uD0DD",scatterTooltip:"\\uC0B0\\uC810\\uB3C4",bubbleTooltip:"\\uBC84\\uBE14",histogramTooltip:"\\uD788\\uC2A4\\uD1A0\\uADF8\\uB7A8",radialColumnTooltip:"\\uBC18\\uACBD \\uC5F4",radialBarTooltip:"\\uBC18\\uACBD \\uB9C9\\uB300",radarLineTooltip:"\\uB808\\uC774\\uB354 \\uB77C\\uC778",radarAreaTooltip:"\\uB808\\uC774\\uB354 \\uBA74\\uC801",nightingaleTooltip:"\\uB098\\uC774\\uD305\\uAC8C\\uC77C",rangeBarTooltip:"\\uBC94\\uC704 \\uB9C9\\uB300",rangeAreaTooltip:"\\uBC94\\uC704 \\uBA74\\uC801",boxPlotTooltip:"\\uBC15\\uC2A4 \\uD50C\\uB86F",treemapTool';
      S = S + 'tip:"\\uD2B8\\uB9AC\\uB9F5",sunburstTooltip:"\\uC120\\uBC84\\uC2A4\\uD2B8",waterfallTooltip:"\\uD3ED\\uD3EC",heatmapTooltip:"\\uD788\\uD2B8\\uB9F5",columnLineComboTooltip:"\\uC5F4 & \\uB77C\\uC778",areaColumnComboTooltip:"\\uBA74\\uC801 & \\uC5F4",customComboTooltip:"\\uC0AC\\uC6A9\\uC790 \\uC815\\uC758 \\uACB0\\uD569",innerRadius:"\\uB0B4\\uBD80 \\uBC18\\uACBD",startAngle:"\\uC2DC\\uC791 \\uAC01\\uB3C4",endAngle:"\\uB05D \\uAC01\\uB3C4",reverseDirection:"\\uBC18\\uB300 \\uBC29\\uD5A5",groupPadding:"\\uADF8\\uB8F9 \\uD328\\uB529",seriesPadding:"\\uC2DC\\uB9AC\\uC988 \\uD328\\uB529",tile:"\\uD0C0\\uC77C",whisker:"\\uC218\\uC5FC",cap:"\\uBAA8\\uC790",capLengthRatio:"\\uAE38\\uC774 \\uBE44\\uC728",labelPlacement:"\\uB77C\\uBCA8 \\uBC30\\uCE58",inside:"\\uB0B4\\uBD80",outside:"\\uC678\\uBD80",noDataToChart:"\\uCC28\\uD2B8\\uD654 \\uD560 \\uC218 \\uC788\\uB294 \\uB370\\uC774\\uD130\\uAC00 \\uC5C6\\uC2B5\\uB2C8\\uB2E4.",pivotChartRequiresPivotMode:"\\uD53C\\uBC97 \\uCC28\\uD2B8\\uB294 \\uD53C\\uBC97 \\uBAA8\\uB4DC\\uAC00 \\uD65C\\uC131\\uD654 \\uB418\\uC5B4\\uC57C \\uD569\\uB2C8\\uB2E4.",chartSettingsToolbarTooltip:"\\uBA54\\uB274",chartLinkToolbarTooltip:"\\uADF8\\uB9AC\\uB4DC\\uC5D0 \\uB9C1\\uD06C\\uB428",chartUnlinkToolbarTooltip:"\\uADF8\\uB9AC\\uB4DC\\uC5D0\\uC11C \\uB9C1\\uD06C \\uD574\\uC81C\\uB428",chartDownloadToolbarTooltip:"\\uCC28\\uD2B8 \\uB2E4\\uC6B4\\uB85C\\uB4DC",chartMenuToolbarTooltip:"\\uBA54\\uB274",chartEdit:"\\uCC28\\uD2B8 \\uD3B8\\uC9D1",chartAdvancedSettings:"\\uACE0\\uAE09 \\uC124\\uC815",chartLink:"\\uADF8\\uB9AC\\uB4DC\\uC5D0 \\uB9C1\\uD06C",chartUnlink:"\\uADF8\\uB9AC\\uB4DC\\uC5D0\\uC11C \\uB9C1\\uD06C \\uD574\\uC81C",chartDownload:"\\uCC28\\uD2B8 \\uB2E4\\uC6B4\\uB85C\\uB4DC",histogramFrequency:"\\uBE48\\uB3C4",seriesChartType:"\\uC2DC\\uB9AC\\uC988 \\uCC28\\uD2B8 \\uC720\\uD615",seriesType:"\\uC2DC\\uB9AC\\uC988 \\uC720\\uD615",secondaryAxis:"\\uBCF4\\uC870 \\uCD95",seriesAdd:"\\uC2DC\\uB9AC\\uC988 \\uCD94\\uAC00",categoryAdd:"\\uCE74\\uD14C\\uACE0\\uB9AC \\uCD94\\uAC00",bar:"\\uB9C9\\uB300",column:"\\uC5F4",histogram:"\\uD788\\uC2A4\\uD1A0\\uADF8\\uB7A8",advancedSettings:"\\uACE0\\uAE09 \\uC124\\uC815",direction:"\\uBC29\\uD5A5",horizo';
      S = S + 'ntal:"\\uC218\\uD3C9",vertical:"\\uC218\\uC9C1",seriesGroupType:"\\uADF8\\uB8F9 \\uC720\\uD615",groupedSeriesGroupType:"\\uADF8\\uB8F9\\uD654",stackedSeriesGroupType:"\\uC2A4\\uD0DD",normalizedSeriesGroupType:"100% \\uC2A4\\uD0DD",legendEnabled:"\\uD65C\\uC131\\uD654\\uB428",invalidColor:"\\uC0C9\\uC0C1 \\uAC12\\uC774 \\uC720\\uD6A8\\uD558\\uC9C0 \\uC54A\\uC2B5\\uB2C8\\uB2E4",groupedColumnFull:"\\uADF8\\uB8F9\\uD654\\uB41C \\uC5F4",stackedColumnFull:"\\uC2A4\\uD0DD\\uB41C \\uC5F4",normalizedColumnFull:"100% \\uC2A4\\uD0DD\\uB41C \\uC5F4",groupedBarFull:"\\uADF8\\uB8F9\\uD654\\uB41C \\uB9C9\\uB300",stackedBarFull:"\\uC2A4\\uD0DD\\uB41C \\uB9C9\\uB300",normalizedBarFull:"100% \\uC2A4\\uD0DD\\uB41C \\uB9C9\\uB300",stackedAreaFull:"\\uC2A4\\uD0DD\\uB41C \\uBA74\\uC801",normalizedAreaFull:"100% \\uC2A4\\uD0DD\\uB41C \\uBA74\\uC801",customCombo:"\\uC0AC\\uC6A9\\uC790 \\uC815\\uC758 \\uACB0\\uD569",ariaAdvancedFilterBuilderItem:"${variable}. \\uB808\\uBCA8 ${variable}. \\uD3B8\\uC9D1\\uD558\\uB824\\uBA74 ENTER\\uB97C \\uB204\\uB974\\uC138\\uC694",ariaAdvancedFilterBuilderItemValidation:"${variable}. \\uB808\\uBCA8 ${variable}. ${variable} \\uD3B8\\uC9D1\\uD558\\uB824\\uBA74 ENTER\\uB97C \\uB204\\uB974\\uC138\\uC694",ariaAdvancedFilterBuilderList:"\\uACE0\\uAE09 \\uD544\\uD130 \\uBE4C\\uB354 \\uBAA9\\uB85D",ariaAdvancedFilterBuilderFilterItem:"\\uD544\\uD130 \\uC870\\uAC74",ariaAdvancedFilterBuilderGroupItem:"\\uD544\\uD130 \\uADF8\\uB8F9",ariaAdvancedFilterBuilderColumn:"\\uC5F4",ariaAdvancedFilterBuilderOption:"\\uC635\\uC158",ariaAdvancedFilterBuilderValueP:"\\uAC12",ariaAdvancedFilterBuilderJoinOperator:"\\uC870\\uD569 \\uC5F0\\uC0B0\\uC790",ariaAdvancedFilterInput:"\\uACE0\\uAE09 \\uD544\\uD130 \\uC785\\uB825",ariaChecked:"\\uC120\\uD0DD\\uB428",ariaColumn:"\\uC5F4",ariaColumnGroup:"\\uC5F4 \\uADF8\\uB8F9",ariaColumnFiltered:"\\uC5F4 \\uD544\\uD130\\uB9C1\\uB428",ariaColumnSelectAll:"\\uBAA8\\uB4E0 \\uC5F4 \\uC120\\uD0DD \\uC804\\uD658",ariaDateFilterInput:"\\uB0A0\\uC9DC \\uD544\\uD130 \\uC785\\uB825",ariaDefaultListName:"\\uBAA9\\uB85D",ariaFilterColumnsInput:"\\uC5F4 \\uD544\\uD130 \\uC785\\uB825",ariaFilterFromValue:"\\uAC12\\u';
      S = S + 'C5D0\\uC11C \\uD544\\uD130",ariaFilterInput:"\\uD544\\uD130 \\uC785\\uB825",ariaFilterList:"\\uD544\\uD130 \\uBAA9\\uB85D",ariaFilterToValue:"\\uAC12\\uAE4C\\uC9C0 \\uD544\\uD130",ariaFilterValue:"\\uD544\\uD130 \\uAC12",ariaFilterMenuOpen:"\\uD544\\uD130 \\uBA54\\uB274 \\uC5F4\\uAE30",ariaFilteringOperator:"\\uD544\\uD130\\uB9C1 \\uC5F0\\uC0B0\\uC790",ariaHidden:"\\uC228\\uAE40",ariaIndeterminate:"\\uBD88\\uD655\\uC815",ariaInputEditor:"\\uC785\\uB825 \\uC5D0\\uB514\\uD130",ariaMenuColumn:"\\uC5F4 \\uBA54\\uB274\\uB97C \\uC5F4\\uB824\\uBA74 ALT \\uC544\\uB798\\uB97C \\uB204\\uB974\\uC138\\uC694",ariaFilterColumn:"\\uD544\\uD130\\uB97C \\uC5F4\\uB824\\uBA74 CTRL ENTER\\uB97C \\uB204\\uB974\\uC138\\uC694",ariaRowDeselect:"\\uC774 \\uD589\\uC744 \\uC120\\uD0DD \\uD574\\uC81C\\uD558\\uB824\\uBA74 SPACE\\uB97C \\uB204\\uB974\\uC138\\uC694",ariaRowSelectAll:"\\uBAA8\\uB4E0 \\uD589 \\uC120\\uD0DD \\uC804\\uD658\\uC744 \\uC704\\uD574 SPACE\\uB97C \\uB204\\uB974\\uC138\\uC694",ariaRowToggleSelection:"\\uD589 \\uC120\\uD0DD\\uC744 \\uC804\\uD658\\uD558\\uB824\\uBA74 SPACE\\uB97C \\uB204\\uB974\\uC138\\uC694",ariaRowSelect:"\\uC774 \\uD589\\uC744 \\uC120\\uD0DD\\uD558\\uB824\\uBA74 SPACE\\uB97C \\uB204\\uB974\\uC138\\uC694",ariaRowSelectionDisabled:"\\uC774 \\uD589\\uC758 \\uD589 \\uC120\\uD0DD\\uC774 \\uBE44\\uD65C\\uC131\\uD654\\uB418\\uC5C8\\uC2B5\\uB2C8\\uB2E4",ariaSearch:"\\uAC80\\uC0C9",ariaSortableColumn:"\\uC815\\uB82C\\uD558\\uB824\\uBA74 ENTER\\uB97C \\uB204\\uB974\\uC138\\uC694",ariaToggleVisibility:"\\uAC00\\uC2DC\\uC131\\uC744 \\uC804\\uD658\\uD558\\uB824\\uBA74 SPACE\\uB97C \\uB204\\uB974\\uC138\\uC694",ariaToggleCellValue:"\\uC140 \\uAC12\\uC744 \\uC804\\uD658\\uD558\\uB824\\uBA74 SPACE\\uB97C \\uB204\\uB974\\uC138\\uC694",ariaUnchecked:"\\uC120\\uD0DD \\uD574\\uC81C\\uB428",ariaVisible:"\\uBCF4\\uC774\\uB294",ariaSearchFilterValues:"\\uD544\\uD130 \\uAC12 \\uAC80\\uC0C9",ariaPageSizeSelectorLabel:"\\uD398\\uC774\\uC9C0 \\uD06C\\uAE30",ariaChartMenuClose:"\\uCC28\\uD2B8 \\uD3B8\\uC9D1 \\uBA54\\uB274 \\uB2EB\\uAE30",ariaChartSelected:"\\uC120\\uD0DD\\uB428",ariaSkeletonCellLoadingFailed:"\\uD589 \\uB85C\\uB4DC \\uC2E4\\uD328",ariaSkeletonCellLoading:"\\uD589 \\uB370\\uC774';
      S = S + '\\uD130 \\uB85C\\uB4DC \\uC911",ariaRowGroupDropZonePanelLabel:"\\uD589 \\uADF8\\uB8F9",ariaValuesDropZonePanelLabel:"\\uAC12",ariaPivotDropZonePanelLabel:"\\uC5F4 \\uB808\\uC774\\uBE14",ariaDropZoneColumnComponentDescription:"\\uC81C\\uAC70\\uD558\\uB824\\uBA74 DELETE\\uB97C \\uB204\\uB974\\uC138\\uC694",ariaDropZoneColumnValueItemDescription:"\\uC9D1\\uACC4 \\uC720\\uD615\\uC744 \\uBCC0\\uACBD\\uD558\\uB824\\uBA74 ENTER\\uB97C \\uB204\\uB974\\uC138\\uC694",ariaDropZoneColumnGroupItemDescription:"\\uC815\\uB82C\\uD558\\uB824\\uBA74 ENTER\\uB97C \\uB204\\uB974\\uC138\\uC694",ariaDropZoneColumnComponentAggFuncSeparator:" \\uC758 ",ariaDropZoneColumnComponentSortAscending:"\\uC624\\uB984\\uCC28\\uC21C",ariaDropZoneColumnComponentSortDescending:"\\uB0B4\\uB9BC\\uCC28\\uC21C",ariaLabelDialog:"\\uB300\\uD654\\uC0C1\\uC790",ariaLabelColumnMenu:"\\uCEEC\\uB7FC \\uBA54\\uB274",ariaLabelColumnFilter:"\\uCEEC\\uB7FC \\uD544\\uD130",ariaLabelCellEditor:"\\uC140 \\uD3B8\\uC9D1\\uAE30",ariaLabelSelectField:"\\uD544\\uB4DC \\uC120\\uD0DD",ariaLabelRichSelectField:"\\uB9AC\\uCE58 \\uC120\\uD0DD \\uD544\\uB4DC",ariaLabelRichSelectToggleSelection:"\\uC120\\uD0DD\\uC744 \\uD1A0\\uAE00\\uD558\\uB824\\uBA74 SPACE\\uB97C \\uB204\\uB974\\uC138\\uC694",ariaLabelRichSelectDeselectAllItems:"\\uBAA8\\uB4E0 \\uD56D\\uBAA9 \\uC120\\uD0DD \\uD574\\uC81C\\uB97C \\uC704\\uD574 DELETE\\uB97C \\uB204\\uB974\\uC138\\uC694",ariaLabelRichSelectDeleteSelection:"\\uD56D\\uBAA9 \\uC120\\uD0DD \\uD574\\uC81C\\uB97C \\uC704\\uD574 DELETE\\uB97C \\uB204\\uB974\\uC138\\uC694",ariaLabelTooltip:"\\uD234\\uD301",ariaLabelContextMenu:"\\uCEE8\\uD14D\\uC2A4\\uD2B8 \\uBA54\\uB274",ariaLabelSubMenu:"\\uD558\\uC704 \\uBA54\\uB274",ariaLabelAggregationFunction:"\\uC9D1\\uACC4 \\uD568\\uC218",ariaLabelAdvancedFilterAutocomplete:"\\uACE0\\uAE09 \\uD544\\uD130 \\uC790\\uB3D9 \\uC644\\uC131",ariaLabelAdvancedFilterBuilderAddField:"\\uACE0\\uAE09 \\uD544\\uD130 \\uBE4C\\uB354 \\uD544\\uB4DC \\uCD94\\uAC00",ariaLabelAdvancedFilterBuilderColumnSelectField:"\\uACE0\\uAE09 \\uD544\\uD130 \\uBE4C\\uB354 \\uCE7C\\uB7FC \\uC120\\uD0DD \\uD544\\uB4DC",ariaLabelAdvancedFilterBuilderOptionSelectFiel';
      S = S + 'd:"\\uACE0\\uAE09 \\uD544\\uD130 \\uBE4C\\uB354 \\uC635\\uC158 \\uC120\\uD0DD \\uD544\\uB4DC",ariaLabelAdvancedFilterBuilderJoinSelectField:"\\uACE0\\uAE09 \\uD544\\uD130 \\uBE4C\\uB354 \\uC870\\uC778 \\uC5F0\\uC0B0\\uC790 \\uC120\\uD0DD \\uD544\\uB4DC",ariaColumnPanelList:"\\uC5F4 \\uBAA9\\uB85D",ariaFilterPanelList:"\\uD544\\uD130 \\uBAA9\\uB85D",thousandSeparator:",",decimalSeparator:".",true:"True",false:"False",invalidDate:"\\uC720\\uD6A8\\uD558\\uC9C0 \\uC54A\\uC740 \\uB0A0\\uC9DC",invalidNumber:"\\uC720\\uD6A8\\uD558\\uC9C0 \\uC54A\\uC740 \\uC22B\\uC790",january:"1\\uC6D4",february:"2\\uC6D4",march:"3\\uC6D4",april:"4\\uC6D4",may:"5\\uC6D4",june:"6\\uC6D4",july:"7\\uC6D4",august:"8\\uC6D4",september:"9\\uC6D4",october:"10\\uC6D4",november:"11\\uC6D4",december:"12\\uC6D4",timeFormatSlashesDDMMYYYY:"DD/MM/YYYY",timeFormatSlashesMMDDYYYY:"MM/DD/YYYY",timeFormatSlashesDDMMYY:"DD/MM/YY",timeFormatSlashesMMDDYY:"MM/DD/YY",timeFormatDotsDDMYY:"DD.MM.YY",timeFormatDotsMDDYY:"M.DD.YY",timeFormatDashesYYYYMMDD:"YYYY-MM-DD",timeFormatSpacesDDMMMMYYYY:"DD MMMM YYYY",timeFormatHHMMSS:"HH:MM:SS",timeFormatHHMMSSAmPm:"HH:MM:SS \\uC624\\uC804/\\uC624\\uD6C4"},L={selectAll:"(Velg alle)",selectAllSearchResults:"(Velg alle s\\xF8keresultater)",addCurrentSelectionToFilter:"Legg n\\xE5v\\xE6rende valg til filter",searchOoo:"S\\xF8k...",blanks:"(Tomme)",noMatches:"Ingen treff",filterOoo:"Filter...",equals:"Er lik",notEqual:"Er ikke lik",blank:"Tom",notBlank:"Ikke tom",empty:"Velg en",lessThan:"Mindre enn",greaterThan:"St\\xF8rre enn",lessThanOrEqual:"Mindre enn eller lik",greaterThanOrEqual:"St\\xF8rre enn eller lik",inRange:"Mellom",inRangeStart:"Fra",inRangeEnd:"Til",contains:"Inneholder",notContains:"Inneholder ikke",startsWith:"Begynner med",endsWith:"Slutter med",dateFormatOoo:"yyyy-mm-dd",before:"F\\xF8r",after:"Etter",andCondition:"OG",orCondition:"ELLER",applyFilter:"Bruk",resetFilter:"Tilbakestill",clearFilter:"T\\xF8m",cancelFilter:"Avbryt",textFilter:"Tekstfilter",numberFilter:"Tallfilter",dateFilter:"Dato filter",setFilter:"Sett filter",grou';
      S = S + 'pFilterSelect:"Velg felt:",advancedFilterContains:"inneholder",advancedFilterNotContains:"inneholder ikke",advancedFilterTextEquals:"er lik",advancedFilterTextNotEqual:"er ikke lik",advancedFilterStartsWith:"begynner med",advancedFilterEndsWith:"slutter med",advancedFilterBlank:"er tom",advancedFilterNotBlank:"er ikke tom",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"er sann",advancedFilterFalse:"er falsk",advancedFilterAnd:"OG",advancedFilterOr:"ELLER",advancedFilterApply:"Bruk",advancedFilterBuilder:"Bygger",advancedFilterValidationMissingColumn:"Kolonne mangler",advancedFilterValidationMissingOption:"Alternativ mangler",advancedFilterValidationMissingValue:"Verdi mangler",advancedFilterValidationInvalidColumn:"Kolonne ikke funnet",advancedFilterValidationInvalidOption:"Alternativ ikke funnet",advancedFilterValidationMissingQuote:"Verdi mangler en avsluttende anf\\xF8rselstegn",advancedFilterValidationNotANumber:"Verdi er ikke et tall",advancedFilterValidationInvalidDate:"Verdi er ikke en gyldig dato",advancedFilterValidationMissingCondition:"Betingelse mangler",advancedFilterValidationJoinOperatorMismatch:"Sammenkoblingsoperatorer innen en betingelse m\\xE5 v\\xE6re de samme",advancedFilterValidationInvalidJoinOperator:"Sammenkoblingsoperator ikke funnet",advancedFilterValidationMissingEndBracket:"Mangler avsluttende parentes",advancedFilterValidationExtraEndBracket:"For mange avsluttende parenteser",advancedFilterValidationMessage:"Uttrykket har en feil. ${variable} - ${variable}.",advancedFilterValidationMessageAtEnd:"Uttrykket har en feil. ${variable} p\\xE5 slutten av uttrykket.",advancedFilterBuilderTitle:"Avansert Filter",advancedFilterBuilderApply:"Bruk",advancedFilterBuilderCancel:"Avbryt",advancedFilterBuilderAddButtonTooltip:"Legg til filter eller gruppe",advancedFilterBuilderRemoveButtonTooltip:"Fjern';
      S = S + '",advancedFilterBuilderMoveUpButtonTooltip:"Flytt opp",advancedFilterBuilderMoveDownButtonTooltip:"Flytt ned",advancedFilterBuilderAddJoin:"Legg til gruppe",advancedFilterBuilderAddCondition:"Legg til filter",advancedFilterBuilderSelectColumn:"Velg en kolonne",advancedFilterBuilderSelectOption:"Velg et alternativ",advancedFilterBuilderEnterValue:"Skriv inn en verdi...",advancedFilterBuilderValidationAlreadyApplied:"Gjeldende filter allerede brukt.",advancedFilterBuilderValidationIncomplete:"Ikke alle betingelser er komplette.",advancedFilterBuilderValidationSelectColumn:"M\\xE5 velge en kolonne.",advancedFilterBuilderValidationSelectOption:"M\\xE5 velge et alternativ.",advancedFilterBuilderValidationEnterValue:"M\\xE5 skrive inn en verdi.",columns:"Kolonner",filters:"Filtre",pivotMode:"Pivot modus",groups:"Radgrupper",rowGroupColumnsEmptyMessage:"Dra hit for \\xE5 sette radgrupper",values:"Verdier",valueColumnsEmptyMessage:"Dra hit for \\xE5 aggregere",pivots:"Kolonneetiketter",pivotColumnsEmptyMessage:"Dra hit for \\xE5 sette kolonneetiketter",group:"Gruppe",rowDragRow:"rad",rowDragRows:"rader",loadingOoo:"Laster...",loadingError:"FEIL",noRowsToShow:"Ingen rader \\xE5 vise",enabled:"Aktivert",pinColumn:"Fest Kolonne",pinLeft:"Fest til Venstre",pinRight:"Fest til H\\xF8yre",noPin:"Ingen Festing",valueAggregation:"Verdi Aggregering",noAggregation:"Ingen",autosizeThisColumn:"Tilpass Denne Kolonnen",autosizeAllColumns:"Tilpass Alle Kolonner",groupBy:"Grupper Etter",ungroupBy:"Fjern Gruppering Etter",ungroupAll:"Fjern All Gruppering",addToValues:"Legg til ${variable} til verdier",removeFromValues:"Fjern ${variable} fra verdier",addToLabels:"Legg til ${variable} til etiketter",removeFromLabels:"Fjern ${variable} fra etiketter",resetColumns:"Tilbakestill Kolonner",expandAll:"Utvid Alle Rad Grupper",collapseAll:"Lukk Alle Rad Grupper",copy:"Kopier",ctrlC:"Ctrl+C",ctrlX:"Ctrl+X",copyWithHeaders:"Kopier med Overskrifter",copyWithGroupHeaders:"Kopier med Gruppeoverskrifter",cut:"Klip';
      S = S + 'p",paste:"Lim inn",ctrlV:"Ctrl+V",export:"Eksporter",csvExport:"CSV Eksport",excelExport:"Excel Eksport",columnFilter:"Kolonnefilter",columnChooser:"Velg Kolonner",sortAscending:"Sorter Stigende",sortDescending:"Sorter Synkende",sortUnSort:"Fjern Sortering",sum:"Sum",first:"F\\xF8rste",last:"Siste",min:"Min",max:"Maks",none:"Ingen",count:"Antall",avg:"Gjennomsnitt",filteredRows:"Filtrert",selectedRows:"Valgt",totalRows:"Totale rader",totalAndFilteredRows:"Rader",more:"Mer",to:"til",of:"av",page:"Side",pageLastRowUnknown:"?",nextPage:"Neste side",lastPage:"Siste side",firstPage:"F\\xF8rste side",previousPage:"Forrige side",pageSizeSelectorLabel:"Sidest\\xF8rrelse:",footerTotal:"Total",pivotColumnGroupTotals:"Total",pivotChartAndPivotMode:"Pivotskjema og pivotmodus",pivotChart:"Pivotskjema",chartRange:"Skjemautvalg",columnChart:"Kolonne",groupedColumn:"Gruppert",stackedColumn:"Stablet",normalizedColumn:"100% stablet",barChart:"S\\xF8yle",groupedBar:"Gruppert",stackedBar:"Stablet",normalizedBar:"100% stablet",pieChart:"Kakestykke",pie:"Kakestykke",donut:"Smultring",line:"Linje",xyChart:"X Y (Spredning)",scatter:"Spredning",bubble:"Boble",areaChart:"Omr\\xE5de",area:"Omr\\xE5de",stackedArea:"Stablet",normalizedArea:"100% stablet",histogramChart:"Histogram",polarChart:"Polar",radarLine:"Radarlinje",radarArea:"Radaromr\\xE5de",nightingale:"Nightingale",radialColumn:"Radial kolonne",radialBar:"Radial s\\xF8yle",statisticalChart:"Statistisk",boxPlot:"Boksdiagram",rangeBar:"Rekke s\\xF8yle",rangeArea:"Rekke omr\\xE5de",hierarchicalChart:"Hierarkisk",treemap:"Treemap",sunburst:"Solstr\\xE5le",specializedChart:"Spesialisert",waterfall:"Vannfall",heatmap:"Varmekart",combinationChart:"Kombinasjon",columnLineCombo:"Kolonne og linje",AreaColumnCombo:"Omr\\xE5de og kolonne",pivotChartTitle:"Pivoteringsdiagram",rangeChartTitle:"Omr\\xE5dekart",settings:"Diagram",data:"Oppsett",format:"Tilpass",categories:"Kategorier",defaultCategory:"(Ingen)",series:"Serier",switchCategorySeries:"Bytt kategori /';
      S = S + ' serie",categoryValues:"Kategoriverdier",seriesLabels:"Seriemerker",aggregate:"Aggreger",xyValues:"X Y Verdier",paired:"Parret modus",axis:"Akse",xAxis:"Horisontal akse",yAxis:"Vertikal akse",polarAxis:"Polar akse",radiusAxis:"Radius akse",navigator:"Navigator",zoom:"Zoom",animation:"Animasjon",crosshair:"H\\xE5rkors",color:"Farge",thickness:"Tykkelse",preferredLength:"Foretrukket lengde",xType:"X Type",axisType:"Aksetype",automatic:"Automatisk",category:"Kategori",number:"Nummer",time:"Tid",timeFormat:"Tidsformat",autoRotate:"Auto rot\\xE9r",labelRotation:"Rotasjon",circle:"Sirkel",polygon:"Polygon",square:"Firkant",cross:"Kryss",diamond:"Diamant",plus:"Pluss",triangle:"Trekant",heart:"Hjerte",orientation:"Orientering",fixed:"Fast",parallel:"Parallell",perpendicular:"Vinkelrett",radiusAxisPosition:"Posisjon",ticks:"Merker",gridLines:"Rutenett",width:"Bredde",height:"H\\xF8yde",length:"Lengde",padding:"Polstring",spacing:"Avstand",chartStyle:"Diagramstil",title:"Tittel",chartTitles:"Titler",chartTitle:"Diagramtittel",chartSubtitle:"Undertekst",horizontalAxisTitle:"Horisontal aksetittel",verticalAxisTitle:"Vertikal aksetittel",polarAxisTitle:"Polar aksetittel",titlePlaceholder:"Diagramtittel",background:"Bakgrunn",font:"Skrift",weight:"Vekt",top:"Topp",right:"H\\xF8yre",bottom:"Bunn",left:"Venstre",labels:"Etiketter",calloutLabels:"Utkallingsetiketter",sectorLabels:"Sektoretiketter",positionRatio:"Posisjonsforhold",size:"St\\xF8rrelse",shape:"Form",minSize:"Minimumsst\\xF8rrelse",maxSize:"Maksimumsst\\xF8rrelse",legend:"Forklaring",position:"Posisjon",markerSize:"Mark\\xF8rst\\xF8rrelse",markerStroke:"Mark\\xF8rslag",markerPadding:"Mark\\xF8rpolstring",itemSpacing:"Gjenstandsavstand",itemPaddingX:"Gjenstand polstring X",itemPaddingY:"Gjenstand polstring Y",layoutHorizontalSpacing:"Horisontal avstand",layoutVerticalSpacing:"Vertikal avstand",strokeWidth:"Slagbredde",offset:"Forskyvning",offsets:"Forskyvninger",tooltips:"Verkt\\xF8ytips",callout:"Utkalling",markers:"Mark\\xF8rer",s';
      S = S + 'hadow:"Skygge",blur:"Uklart",xOffset:"X forskyvning",yOffset:"Y forskyvning",lineWidth:"Linje bredde",lineDash:"Linjem\\xF8nster",lineDashOffset:"M\\xF8nster forskyvning",scrollingZoom:"Rulling",scrollingStep:"Rulletrinn",selectingZoom:"Velger",durationMillis:"Varighet (ms)",crosshairLabel:"Etikett",crosshairSnap:"Fest til node",normal:"Normal",bold:"Fet",italic:"Kursiv",boldItalic:"Fet kursiv",predefined:"Forh\\xE5ndsdefinert",fillOpacity:"Fyll opasitet",strokeColor:"Linjefarge",strokeOpacity:"Linje opasitet",miniChart:"Mini-diagram",histogramBinCount:"BinkCount",connectorLine:"Koblingslinje",seriesItems:"Serieobjekter",seriesItemType:"Objekttype",seriesItemPositive:"Positiv",seriesItemNegative:"Negativ",seriesItemLabels:"Objektetiketter",columnGroup:"Kolonne",barGroup:"S\\xF8yle",pieGroup:"Kake",lineGroup:"Linje",scatterGroup:"X Y (Punkter)",areaGroup:"Omr\\xE5de",polarGroup:"Polar",statisticalGroup:"Statistisk",hierarchicalGroup:"Hierarkisk",specializedGroup:"Spesialisert",combinationGroup:"Kombinasjon",groupedColumnTooltip:"Gruppert",stackedColumnTooltip:"Stablet",normalizedColumnTooltip:"100% Stablet",groupedBarTooltip:"Gruppert",stackedBarTooltip:"Stablet",normalizedBarTooltip:"100% Stablet",pieTooltip:"Kake",donutTooltip:"Smultring",lineTooltip:"Linje",groupedAreaTooltip:"Omr\\xE5de",stackedAreaTooltip:"Stablet",normalizedAreaTooltip:"100% Stablet",scatterTooltip:"Punkter",bubbleTooltip:"Boble",histogramTooltip:"Histogram",radialColumnTooltip:"Radiell kolonne",radialBarTooltip:"Radiell s\\xF8yle",radarLineTooltip:"Radard linje",radarAreaTooltip:"Radard omr\\xE5de",nightingaleTooltip:"Nattergal",rangeBarTooltip:"Omr\\xE5des\\xF8yle",rangeAreaTooltip:"Omr\\xE5de",boxPlotTooltip:"Boksplott",treemapTooltip:"Trekart",sunburstTooltip:"Solglimt",waterfallTooltip:"Fossefall",heatmapTooltip:"Varmekart",columnLineComboTooltip:"Kolonne & Linje",areaColumnComboTooltip:"Omr\\xE5de & Kolonne",customComboTooltip:"Tilpasset kombinert",innerRadius:"Indre radius",startAngle:"Startvinkel",';
      S = S + 'endAngle:"Sluttvinkel",reverseDirection:"Omvendt retning",groupPadding:"Gruppolstring",seriesPadding:"Seriepolstring",tile:"Flis",whisker:"H\\xE5r",cap:"Kappe",capLengthRatio:"Lengdeforhold",labelPlacement:"Plassering",inside:"Innsiden",outside:"Utsiden",noDataToChart:"Ingen data tilgjengelig for \\xE5 lage diagram.",pivotChartRequiresPivotMode:"Pivoteringsdiagram krever Pivoteringsmodus aktivert.",chartSettingsToolbarTooltip:"Meny",chartLinkToolbarTooltip:"Knytet til rutenettet",chartUnlinkToolbarTooltip:"Frakoblet fra rutenettet",chartDownloadToolbarTooltip:"Last ned diagram",chartMenuToolbarTooltip:"Meny",chartEdit:"Rediger diagram",chartAdvancedSettings:"Avanserte innstillinger",chartLink:"Link til rutenettet",chartUnlink:"Frakoble fra rutenettet",chartDownload:"Last ned diagram",histogramFrequency:"Frekvens",seriesChartType:"Seriediagramtype",seriesType:"Serietype",secondaryAxis:"Sekund\\xE6r akse",seriesAdd:"Legg til en serie",categoryAdd:"Legg til en kategori",bar:"S\\xF8yle",column:"Kolonne",histogram:"Histogram",advancedSettings:"Avanserte innstillinger",direction:"Retning",horizontal:"Horisontal",vertical:"Vertikal",seriesGroupType:"Gruppetype",groupedSeriesGroupType:"Gruppert",stackedSeriesGroupType:"Stablet",normalizedSeriesGroupType:"100% Stablet",legendEnabled:"Aktivert",invalidColor:"Fargeverdi er ugyldig",groupedColumnFull:"Gruppert kolonne",stackedColumnFull:"Stablet kolonne",normalizedColumnFull:"100% stablet kolonne",groupedBarFull:"Gruppert s\\xF8yle",stackedBarFull:"Stablet s\\xF8yle",normalizedBarFull:"100% stablet s\\xF8yle",stackedAreaFull:"Stablet omr\\xE5de",normalizedAreaFull:"100% stablet omr\\xE5de",customCombo:"Tilpasset kombinasjon",ariaAdvancedFilterBuilderItem:"${variable}. Niv\\xE5 ${variable}. Trykk ENTER for \\xE5 redigere.",ariaAdvancedFilterBuilderItemValidation:"${variable}. Niv\\xE5 ${variable}. ${variable} Trykk ENTER for \\xE5 redigere.",ariaAdvancedFilterBuilderList:"Avansert filterbyggerliste",ariaAdvancedFilterBuilderFilterItem:"Filte';
      S = S + 'rbetingelse",ariaAdvancedFilterBuilderGroupItem:"Filtergruppe",ariaAdvancedFilterBuilderColumn:"Kolonne",ariaAdvancedFilterBuilderOption:"Alternativ",ariaAdvancedFilterBuilderValueP:"Verdi",ariaAdvancedFilterBuilderJoinOperator:"Koblingsoperator",ariaAdvancedFilterInput:"Inndata for avansert filter",ariaChecked:"avmerket",ariaColumn:"Kolonne",ariaColumnGroup:"Kolonnegruppe",ariaColumnFiltered:"Kolonne filtrert",ariaColumnSelectAll:"Aktiver/deaktiver valg av alle kolonner",ariaDateFilterInput:"Inndata for datofilter",ariaDefaultListName:"Liste",ariaFilterColumnsInput:"Filtrer kolonner inndata",ariaFilterFromValue:"Filtrer fra verdi",ariaFilterInput:"Filterinndata",ariaFilterList:"Filterliste",ariaFilterToValue:"Filtrer til verdi",ariaFilterValue:"Filterverdi",ariaFilterMenuOpen:"\\xC5pne filtermeny",ariaFilteringOperator:"Filtreringsoperator",ariaHidden:"skjult",ariaIndeterminate:"ubestemt",ariaInputEditor:"Inndataredigerer",ariaMenuColumn:"Trykk ALT NED for \\xE5 \\xE5pne kolonnemeny",ariaFilterColumn:"Trykk CTRL ENTER for \\xE5 \\xE5pne filter",ariaRowDeselect:"Trykk SPACE for \\xE5 fjerne markeringen av denne raden",ariaRowSelectAll:"Trykk SPACE for \\xE5 veksle alle radvalgene",ariaRowToggleSelection:"Trykk SPACE for \\xE5 veksle radvalg",ariaRowSelect:"Trykk SPACE for \\xE5 velge denne raden",ariaRowSelectionDisabled:"Radvalg er deaktivert for denne raden",ariaSearch:"S\\xF8k",ariaSortableColumn:"Trykk ENTER for \\xE5 sortere",ariaToggleVisibility:"Trykk SPACE for \\xE5 veksle synlighet",ariaToggleCellValue:"Trykk SPACE for \\xE5 veksle celleverdi",ariaUnchecked:"uavmerket",ariaVisible:"synlig",ariaSearchFilterValues:"S\\xF8k filterverdier",ariaPageSizeSelectorLabel:"Sidest\\xF8rrelse",ariaChartMenuClose:"Lukk diagramredigeringsmeny",ariaChartSelected:"Valgt",ariaSkeletonCellLoadingFailed:"Raden kunne ikke lastes",ariaSkeletonCellLoading:"Raddata lastes",ariaRowGroupDropZonePanelLabel:"Radgrupper",ariaValuesDropZonePanelLabel:"Verdier",ariaPivotDropZonePanelLabel:"Kolonneetike';
      S = S + 'tter",ariaDropZoneColumnComponentDescription:"Trykk DELETE for \\xE5 fjerne",ariaDropZoneColumnValueItemDescription:"Trykk ENTER for \\xE5 endre aggregeringstype",ariaDropZoneColumnGroupItemDescription:"Trykk ENTER for \\xE5 sortere",ariaDropZoneColumnComponentAggFuncSeparator:" av ",ariaDropZoneColumnComponentSortAscending:"stigende",ariaDropZoneColumnComponentSortDescending:"synkende",ariaLabelDialog:"Dialog",ariaLabelColumnMenu:"Kolonnemeny",ariaLabelColumnFilter:"Kolonnefilter",ariaLabelCellEditor:"Celleditor",ariaLabelSelectField:"Velg Felt",ariaLabelRichSelectField:"Rik velg felt",ariaLabelRichSelectToggleSelection:"Trykk SPACE for \\xE5 veksle valg",ariaLabelRichSelectDeselectAllItems:"Trykk DELETE for \\xE5 fjerne alle valg",ariaLabelRichSelectDeleteSelection:"Trykk DELETE for \\xE5 fjerne valget",ariaLabelTooltip:"Verkt\\xF8ytips",ariaLabelContextMenu:"Kontekstmeny",ariaLabelSubMenu:"Undermeny",ariaLabelAggregationFunction:"Aggregeringsfunksjon",ariaLabelAdvancedFilterAutocomplete:"Avansert filter autfullstendig",ariaLabelAdvancedFilterBuilderAddField:"Byggeverkt\\xF8y for avansert filter legg til felt",ariaLabelAdvancedFilterBuilderColumnSelectField:"Byggeverkt\\xF8y for avansert filter kolonnevelger felt",ariaLabelAdvancedFilterBuilderOptionSelectField:"Byggeverkt\\xF8y for avansert filter alternativvelger felt",ariaLabelAdvancedFilterBuilderJoinSelectField:"Byggeverkt\\xF8y for avansert filter sammenf\\xF8yingsoperator velger felt",ariaColumnPanelList:"Kolonneliste",ariaFilterPanelList:"Filterliste",thousandSeparator:".",decimalSeparator:",",true:"Sant",false:"Falsk",invalidDate:"Ugyldig dato",invalidNumber:"Ugyldig nummer",january:"Januar",february:"Februar",march:"Mars",april:"April",may:"Mai",june:"Juni",july:"Juli",august:"August",september:"September",october:"Oktober",november:"November",december:"Desember",timeFormatSlashesDDMMYYYY:"DD/MM/YYYY",timeFormatSlashesMMDDYYYY:"MM/DD/YYYY",timeFormatSlashesDDMMYY:"DD/MM/YY",timeFormatSlashesMMDDYY:"MM/DD/YY",timeFor';
      S = S + 'matDotsDDMYY:"DD.M.YY",timeFormatDotsMDDYY:"M.DD.YY",timeFormatDashesYYYYMMDD:"YYYY-MM-DD",timeFormatSpacesDDMMMMYYYY:"DD MMMM YYYY",timeFormatHHMMSS:"TT:MM:SS",timeFormatHHMMSSAmPm:"TT:MM:SS AM/PM"},z={selectAll:"(Alles selecteren)",selectAllSearchResults:"(Alle zoekresultaten selecteren)",addCurrentSelectionToFilter:"Huidige selectie toevoegen aan filter",searchOoo:"Zoeken...",blanks:"(Leegten)",noMatches:"Geen overeenkomsten",filterOoo:"Filter...",equals:"Gelijk aan",notEqual:"Niet gelijk aan",blank:"Leeg",notBlank:"Niet leeg",empty:"Kies een",lessThan:"Minder dan",greaterThan:"Groter dan",lessThanOrEqual:"Minder dan of gelijk aan",greaterThanOrEqual:"Groter dan of gelijk aan",inRange:"Tussen",inRangeStart:"Van",inRangeEnd:"Tot",contains:"Bevat",notContains:"Bevat niet",startsWith:"Begint met",endsWith:"Eindigt met",dateFormatOoo:"yyyy-mm-dd",before:"Voor",after:"Na",andCondition:"EN",orCondition:"OF",applyFilter:"Toepassen",resetFilter:"Resetten",clearFilter:"Wissen",cancelFilter:"Annuleren",textFilter:"Tekstfilter",numberFilter:"Getallenfilter",dateFilter:"Datumfilter",setFilter:"Setfilter",groupFilterSelect:"Selecteer veld:",advancedFilterContains:"bevat",advancedFilterNotContains:"bevat niet",advancedFilterTextEquals:"is gelijk aan",advancedFilterTextNotEqual:"is niet gelijk aan",advancedFilterStartsWith:"begint met",advancedFilterEndsWith:"eindigt met",advancedFilterBlank:"is leeg",advancedFilterNotBlank:"is niet leeg",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"is waar",advancedFilterFalse:"is niet waar",advancedFilterAnd:"EN",advancedFilterOr:"OF",advancedFilterApply:"Toepassen",advancedFilterBuilder:"Bouwer",advancedFilterValidationMissingColumn:"Kolom ontbreekt",advancedFilterValidationMissingOption:"Optie ontbreekt",advancedFilterValidationMissingValue:"Waarde ontbreekt",advancedFilterValidationIn';
      S = S + 'validColumn:"Kolom niet gevonden",advancedFilterValidationInvalidOption:"Optie niet gevonden",advancedFilterValidationMissingQuote:"Waarde mist een aanhalingsteken aan het einde",advancedFilterValidationNotANumber:"Waarde is geen getal",advancedFilterValidationInvalidDate:"Waarde is geen geldige datum",advancedFilterValidationMissingCondition:"Voorwaarde ontbreekt",advancedFilterValidationJoinOperatorMismatch:"Logische operatoren binnen een voorwaarde moeten gelijk zijn",advancedFilterValidationInvalidJoinOperator:"Logische operator niet gevonden",advancedFilterValidationMissingEndBracket:"Ontbrekende eindhaak",advancedFilterValidationExtraEndBracket:"Te veel eindhaken",advancedFilterValidationMessage:"Uitdrukking bevat een fout. ${variable} - ${variable}.",advancedFilterValidationMessageAtEnd:"Uitdrukking bevat een fout. ${variable} aan het einde van de uitdrukking.",advancedFilterBuilderTitle:"Geavanceerd filter",advancedFilterBuilderApply:"Toepassen",advancedFilterBuilderCancel:"Annuleren",advancedFilterBuilderAddButtonTooltip:"Filter of groep toevoegen",advancedFilterBuilderRemoveButtonTooltip:"Verwijderen",advancedFilterBuilderMoveUpButtonTooltip:"Omhoog verplaatsen",advancedFilterBuilderMoveDownButtonTooltip:"Omlaag verplaatsen",advancedFilterBuilderAddJoin:"Groep toevoegen",advancedFilterBuilderAddCondition:"Filter toevoegen",advancedFilterBuilderSelectColumn:"Selecteer een kolom",advancedFilterBuilderSelectOption:"Selecteer een optie",advancedFilterBuilderEnterValue:"Voer een waarde in...",advancedFilterBuilderValidationAlreadyApplied:"Huidige filter al toegepast.",advancedFilterBuilderValidationIncomplete:"Niet alle voorwaarden zijn voltooid.",advancedFilterBuilderValidationSelectColumn:"Moet een kolom selecteren.",advancedFilterBuilderValidationSelectOption:"Moet een optie selecteren.",advancedFilterBuilderValidationEnterValue:"Moet een waarde invoeren.",columns:"Kolommen",filters:"Filters",pivotMode:"Draaimodus",groups:"Rijgroepen",rowGroupColumnsEmptyMes';
      S = S + 'sage:"Sleep hierheen om rijen te groeperen",values:"Waarden",valueColumnsEmptyMessage:"Sleep hierheen om te aggregeren",pivots:"Kolomlabels",pivotColumnsEmptyMessage:"Sleep hierheen om kolomlabels te instellen",group:"Groep",rowDragRow:"rij",rowDragRows:"rijen",loadingOoo:"Laden...",loadingError:"FOUT",noRowsToShow:"Geen rijen om weer te geven",enabled:"Ingeschakeld",pinColumn:"Kolom vastzetten",pinLeft:"Links vastzetten",pinRight:"Rechts vastzetten",noPin:"Niet vastzetten",valueAggregation:"Waarde-aggregering",noAggregation:"Geen",autosizeThisColumn:"Deze kolom automatisch aanpassen",autosizeAllColumns:"Alle kolommen automatisch aanpassen",groupBy:"Groeperen op",ungroupBy:"Degroeperen op",ungroupAll:"Alle groepen opheffen",addToValues:"Voeg ${variable} toe aan waarden",removeFromValues:"Verwijder ${variable} van waarden",addToLabels:"Voeg ${variable} toe aan labels",removeFromLabels:"Verwijder ${variable} van labels",resetColumns:"Kolommen resetten",expandAll:"Alle rijen groepen uitvouwen",collapseAll:"Alle rijen groepen inklappen",copy:"Kopi\\xEBren",ctrlC:"Ctrl+C",ctrlX:"Ctrl+X",copyWithHeaders:"Kopi\\xEBren met kopteksten",copyWithGroupHeaders:"Kopi\\xEBren met groep kopteksten",cut:"Knippen",paste:"Plakken",ctrlV:"Ctrl+V",export:"Exporteren",csvExport:"CSV Export",excelExport:"Excel Export",columnFilter:"Kolomfilter",columnChooser:"Kolommen kiezen",sortAscending:"Oplopend sorteren",sortDescending:"Aflopend sorteren",sortUnSort:"Sortering wissen",sum:"Som",first:"Eerste",last:"Laatste",min:"Min",max:"Max",none:"Geen",count:"Aantal",avg:"Gemiddelde",filteredRows:"Gefilterd",selectedRows:"Geselecteerd",totalRows:"Totaal Aantal Rijen",totalAndFilteredRows:"Rijen",more:"Meer",to:"tot",of:"van",page:"Pagina",pageLastRowUnknown:"?",nextPage:"Volgende Pagina",lastPage:"Laatste Pagina",firstPage:"Eerste Pagina",previousPage:"Vorige Pagina",pageSizeSelectorLabel:"Pagina Grootte:",footerTotal:"Totaal",pivotColumnGroupTotals:"Totaal",pivotChartAndPivotMode:"Draaidiagram & Dra';
      S = S + 'aistand",pivotChart:"Draaidiagram",chartRange:"Diagrambereik",columnChart:"Kolom",groupedColumn:"Gegroepeerd",stackedColumn:"Gestapeld",normalizedColumn:"100% Gestapeld",barChart:"Staaf",groupedBar:"Gegroepeerd",stackedBar:"Gestapeld",normalizedBar:"100% Gestapeld",pieChart:"Taart",pie:"Taart",donut:"Donut",line:"Lijn",xyChart:"X Y (Spreiding)",scatter:"Spreiding",bubble:"Bubble",areaChart:"Gebied",area:"Gebied",stackedArea:"Gestapeld",normalizedArea:"100% Gestapeld",histogramChart:"Histogram",polarChart:"Polair",radarLine:"Radar Lijn",radarArea:"Radar Gebied",nightingale:"Nightingale",radialColumn:"Radiale Kolom",radialBar:"Radiale Staaf",statisticalChart:"Statistisch",boxPlot:"Boxplot",rangeBar:"Reeks Staaf",rangeArea:"Reeks Gebied",hierarchicalChart:"Hi\\xEBrarchisch",treemap:"Boomkaart",sunburst:"Zonnevlam",specializedChart:"Gespecialiseerd",waterfall:"Waterval",heatmap:"Warmtekaart",combinationChart:"Combinatie",columnLineCombo:"Kolom & Lijn",AreaColumnCombo:"Gebied & Kolom",pivotChartTitle:"Draai Grafiek",rangeChartTitle:"Bereik Grafiek",settings:"Grafiek",data:"Instellen",format:"Aanpassen",categories:"Categorie\\xEBn",defaultCategory:"(Geen)",series:"Reeksen",switchCategorySeries:"Wissel Categorie / Reeks",categoryValues:"Categorie Waarden",seriesLabels:"Reeks Labels",aggregate:"Aggregeren",xyValues:"X Y Waarden",paired:"Gekoppelde Modus",axis:"As",xAxis:"Horizontale As",yAxis:"Verticale As",polarAxis:"Polar As",radiusAxis:"Radius As",navigator:"Navigator",zoom:"Zoom",animation:"Animatie",crosshair:"Kruisdraad",color:"Kleur",thickness:"Dikte",preferredLength:"Voorkeurslengte",xType:"X Type",axisType:"As Type",automatic:"Automatisch",category:"Categorie",number:"Nummer",time:"Tijd",timeFormat:"Tijdformaat",autoRotate:"Auto Rotatie",labelRotation:"Rotatie",circle:"Cirkel",polygon:"Polygoon",square:"Vierkant",cross:"Kruis",diamond:"Diamant",plus:"Plus",triangle:"Driehoek",heart:"Hart",orientation:"Ori\\xEBntatie",fixed:"Vast",parallel:"Parallel",perpendicular:"Loo';
      S = S + 'drecht",radiusAxisPosition:"Positie",ticks:"Tikken",gridLines:"Rasterlijnen",width:"Breedte",height:"Hoogte",length:"Lengte",padding:"Opvulling",spacing:"Afstand",chartStyle:"Grafiekstijl",title:"Titel",chartTitles:"Titels",chartTitle:"Grafiektitel",chartSubtitle:"Ondertitel",horizontalAxisTitle:"Horizontale As Titel",verticalAxisTitle:"Verticale As Titel",polarAxisTitle:"Polar As Titel",titlePlaceholder:"Grafiektitel",background:"Achtergrond",font:"Lettertype",weight:"Gewicht",top:"Boven",right:"Rechts",bottom:"Onder",left:"Links",labels:"Labels",calloutLabels:"Uitroep Labels",sectorLabels:"Sector Labels",positionRatio:"Positie Verhouding",size:"Grootte",shape:"Vorm",minSize:"Minimale Grootte",maxSize:"Maximale Grootte",legend:"Legenda",position:"Positie",markerSize:"Markergrootte",markerStroke:"Markeromtrek",markerPadding:"Markeropvulling",itemSpacing:"Itemafstand",itemPaddingX:"Item Opvulling X",itemPaddingY:"Item Opvulling Y",layoutHorizontalSpacing:"Horizontale Afstand",layoutVerticalSpacing:"Verticale Afstand",strokeWidth:"Omtrekbreedte",offset:"Offset",offsets:"Offsets",tooltips:"Toelichtingen",callout:"Uitroep",markers:"Markeringen",shadow:"Schaduw",blur:"Vervagen",xOffset:"X Offset",yOffset:"Y Offset",lineWidth:"Lijnbreedte",lineDash:"Lijnstreep",lineDashOffset:"Streep Offset",scrollingZoom:"Scrollen",scrollingStep:"Scrollstap",selectingZoom:"Selecteren",durationMillis:"Duur (ms)",crosshairLabel:"Label",crosshairSnap:"Vastklikken op Knoop",normal:"Normaal",bold:"Vetgedrukt",italic:"Cursief",boldItalic:"Vet Cursief",predefined:"Voorgedefinieerd",fillOpacity:"Vuldoorzichtigheid",strokeColor:"Lijnkleur",strokeOpacity:"Lijndoorzichtigheid",miniChart:"Mini-Grafiek",histogramBinCount:"Bak aantal",connectorLine:"Connector Lijn",seriesItems:"Reeks Items",seriesItemType:"Item Type",seriesItemPositive:"Positief",seriesItemNegative:"Negatief",seriesItemLabels:"Item Labels",columnGroup:"Kolom",barGroup:"Staaf",pieGroup:"Taart",lineGroup:"Lijn",scatterGroup:"X Y (Spreid';
      S = S + 'ing)",areaGroup:"Gebied",polarGroup:"Polar",statisticalGroup:"Statistisch",hierarchicalGroup:"Hi\\xEBrarchisch",specializedGroup:"Gespecialiseerd",combinationGroup:"Combinatie",groupedColumnTooltip:"Gegroepeerd",stackedColumnTooltip:"Gestapeld",normalizedColumnTooltip:"100% Gestapeld",groupedBarTooltip:"Gegroepeerd",stackedBarTooltip:"Gestapeld",normalizedBarTooltip:"100% Gestapeld",pieTooltip:"Taart",donutTooltip:"Donut",lineTooltip:"Lijn",groupedAreaTooltip:"Gebied",stackedAreaTooltip:"Gestapeld",normalizedAreaTooltip:"100% Gestapeld",scatterTooltip:"Spreiding",bubbleTooltip:"Bel",histogramTooltip:"Histogram",radialColumnTooltip:"Radiale Kolom",radialBarTooltip:"Radiale Staaf",radarLineTooltip:"Radar Lijn",radarAreaTooltip:"Radar Gebied",nightingaleTooltip:"Nachtegaal",rangeBarTooltip:"Bereik Staaf",rangeAreaTooltip:"Bereik Gebied",boxPlotTooltip:"Box Plot",treemapTooltip:"Boomdiagram",sunburstTooltip:"Zonnestraal",waterfallTooltip:"Waterval",heatmapTooltip:"Warmtekaart",columnLineComboTooltip:"Kolom & Lijn",areaColumnComboTooltip:"Gebied & Kolom",customComboTooltip:"Aangepaste Combinatie",innerRadius:"Binnenstraal",startAngle:"Start Hoek",endAngle:"Eind Hoek",reverseDirection:"Omkeren",groupPadding:"Groep Opvulling",seriesPadding:"Reeks Opvulling",tile:"Tegel",whisker:"Snavel",cap:"Kap",capLengthRatio:"Lengte Verhouding",labelPlacement:"Label Plaatsing",inside:"Binnen",outside:"Buiten",noDataToChart:"Geen gegevens beschikbaar om in een grafiek weer te geven.",pivotChartRequiresPivotMode:"Draai Grafiek vereist Draai Modus ingeschakeld.",chartSettingsToolbarTooltip:"Menu",chartLinkToolbarTooltip:"Gekoppeld aan Raster",chartUnlinkToolbarTooltip:"Ontkoppeld van Raster",chartDownloadToolbarTooltip:"Download Grafiek",chartMenuToolbarTooltip:"Menu",chartEdit:"Bewerk Grafiek",chartAdvancedSettings:"Geavanceerde Instellingen",chartLink:"Koppelen aan Raster",chartUnlink:"Ontkoppelen van Raster",chartDownload:"Download Grafiek",histogramFrequency:"Frequentie",seriesChartType';
      S = S + ':"Reeks Grafiek Type",seriesType:"Reeks Type",secondaryAxis:"Secundaire As",seriesAdd:"Voeg een reeks toe",categoryAdd:"Voeg een categorie toe",bar:"Staaf",column:"Kolom",histogram:"Histogram",advancedSettings:"Geavanceerde Instellingen",direction:"Richting",horizontal:"Horizontaal",vertical:"Verticaal",seriesGroupType:"Groep Type",groupedSeriesGroupType:"Gegroepeerd",stackedSeriesGroupType:"Gestapeld",normalizedSeriesGroupType:"100% Gestapeld",legendEnabled:"Ingeschakeld",invalidColor:"Kleurwaarde is ongeldig",groupedColumnFull:"Gegroepeerde Kolom",stackedColumnFull:"Gestapelde Kolom",normalizedColumnFull:"100% Gestapelde Kolom",groupedBarFull:"Gegroepeerde Staaf",stackedBarFull:"Gestapelde Staaf",normalizedBarFull:"100% Gestapelde Staaf",stackedAreaFull:"Gestapeld Gebied",normalizedAreaFull:"100% Gestapeld Gebied",customCombo:"Aangepaste Combinatie",ariaAdvancedFilterBuilderItem:"${variable}. Niveau ${variable}. Druk op ENTER om te bewerken",ariaAdvancedFilterBuilderItemValidation:"${variable}. Niveau ${variable}. ${variable} Druk op ENTER om te bewerken.",ariaAdvancedFilterBuilderList:"Geavanceerde Filter Builder Lijst",ariaAdvancedFilterBuilderFilterItem:"Filter Voorwaarde",ariaAdvancedFilterBuilderGroupItem:"Filter Groep",ariaAdvancedFilterBuilderColumn:"Kolom",ariaAdvancedFilterBuilderOption:"Optie",ariaAdvancedFilterBuilderValueP:"Waarde",ariaAdvancedFilterBuilderJoinOperator:"Koppeloperator",ariaAdvancedFilterInput:"Geavanceerde Filter Invoer",ariaChecked:"geselecteerd",ariaColumn:"Kolom",ariaColumnGroup:"Kolom Groep",ariaColumnFiltered:"Kolom Gefilterd",ariaColumnSelectAll:"Selecteer Alle Kolommen",ariaDateFilterInput:"Datum Filter Invoer",ariaDefaultListName:"Lijst",ariaFilterColumnsInput:"Filter Kolommen Invoer",ariaFilterFromValue:"Filter vanuit waarde",ariaFilterInput:"Filter Invoer",ariaFilterList:"Filter Lijst",ariaFilterToValue:"Filter naar waarde",ariaFilterValue:"Filter Waarde",ariaFilterMenuOpen:"Open Filtermenu",ariaFilteringOperator:"Filter Oper';
      S = S + 'ator",ariaHidden:"verborgen",ariaIndeterminate:"onbepaald",ariaInputEditor:"Invoer Editor",ariaMenuColumn:"Druk op ALT DOWN om het kolommenmenu te openen",ariaFilterColumn:"Druk op CTRL ENTER om te filteren",ariaRowDeselect:"Druk op SPATIE om deze rij te deselecteren",ariaRowSelectAll:"Druk op SPATIE om alle rijen te selecteren/deselecteren",ariaRowToggleSelection:"Druk op SPATIE om rijselectie te schakelen",ariaRowSelect:"Druk op SPATIE om deze rij te selecteren",ariaRowSelectionDisabled:"Rijselectie is uitgeschakeld voor deze rij",ariaSearch:"Zoeken",ariaSortableColumn:"Druk op ENTER om te sorteren",ariaToggleVisibility:"Druk op SPATIE om zichtbaarheid te schakelen",ariaToggleCellValue:"Druk op SPATIE om celwaarde te schakelen",ariaUnchecked:"niet geselecteerd",ariaVisible:"zichtbaar",ariaSearchFilterValues:"Zoek filterwaarden",ariaPageSizeSelectorLabel:"Pagina Grootte",ariaChartMenuClose:"Sluit Grafiek Bewerkmenu",ariaChartSelected:"Geselecteerd",ariaSkeletonCellLoadingFailed:"Rij laden is mislukt",ariaSkeletonCellLoading:"Rijgegevens worden geladen",ariaRowGroupDropZonePanelLabel:"Rijgroepen",ariaValuesDropZonePanelLabel:"Waarden",ariaPivotDropZonePanelLabel:"Kolomlabels",ariaDropZoneColumnComponentDescription:"Druk op DELETE om te verwijderen",ariaDropZoneColumnValueItemDescription:"Druk op ENTER om het aggregatietype te wijzigen",ariaDropZoneColumnGroupItemDescription:"Druk op ENTER om te sorteren",ariaDropZoneColumnComponentAggFuncSeparator:" of ",ariaDropZoneColumnComponentSortAscending:"oplopend",ariaDropZoneColumnComponentSortDescending:"aflopend",ariaLabelDialog:"Dialoog",ariaLabelColumnMenu:"Kolommenu",ariaLabelColumnFilter:"Kolomfilter",ariaLabelCellEditor:"Celbewerker",ariaLabelSelectField:"Selectievak",ariaLabelRichSelectField:"Rijk Selectieveld",ariaLabelRichSelectToggleSelection:"Druk op SPATIE om selectie te wisselen",ariaLabelRichSelectDeselectAllItems:"Druk op VERWIJDEREN om alle items te deselecteren",ariaLabelRichSelectDeleteSelection:"Druk op ';
      S = S + 'VERWIJDEREN om item te deselecteren",ariaLabelTooltip:"Tooltip",ariaLabelContextMenu:"Contextmenu",ariaLabelSubMenu:"Submenu",ariaLabelAggregationFunction:"Aggregatiefunctie",ariaLabelAdvancedFilterAutocomplete:"Geavanceerde Filter Autocompleteren",ariaLabelAdvancedFilterBuilderAddField:"Geavanceerde Filter Builder Veld Toevoegen",ariaLabelAdvancedFilterBuilderColumnSelectField:"Geavanceerde Filter Builder Kolom Selecteer Veld",ariaLabelAdvancedFilterBuilderOptionSelectField:"Geavanceerde Filter Builder Optie Selecteer Veld",ariaLabelAdvancedFilterBuilderJoinSelectField:"Geavanceerde Filter Builder Koppeloperator Selecteer Veld",ariaColumnPanelList:"Kolom Lijst",ariaFilterPanelList:"Filterlijst",thousandSeparator:".",decimalSeparator:",",true:"Waar",false:"Onwaar",invalidDate:"Ongeldige Datum",invalidNumber:"Ongeldig Nummer",january:"Januari",february:"Februari",march:"Maart",april:"April",may:"Mei",june:"Juni",july:"Juli",august:"Augustus",september:"September",october:"Oktober",november:"November",december:"December",timeFormatSlashesDDMMYYYY:"DD/MM/JJJJ",timeFormatSlashesMMDDYYYY:"MM/DD/JJJJ",timeFormatSlashesDDMMYY:"DD/MM/JJ",timeFormatSlashesMMDDYY:"MM/DD/JJ",timeFormatDotsDDMYY:"DD.M.JJ",timeFormatDotsMDDYY:"M.DD.JJ",timeFormatDashesYYYYMMDD:"JJJJ-MM-DD",timeFormatSpacesDDMMMMYYYY:"DD MMMM JJJJ",timeFormatHHMMSS:"UU:MM:SS",timeFormatHHMMSSAmPm:"UU:MM:SS AM/PM"},P={selectAll:"(\\u5168\\u9009)",selectAllSearchResults:"(\\u5168\\u9009\\u641C\\u7D22\\u7ED3\\u679C)",addCurrentSelectionToFilter:"\\u5C06\\u5F53\\u524D\\u9009\\u62E9\\u6DFB\\u52A0\\u5230\\u7B5B\\u9009\\u5668",searchOoo:"\\u641C\\u7D22...",blanks:"(\\u7A7A\\u767D)",noMatches:"\\u65E0\\u5339\\u914D\\u9879",filterOoo:"\\u8FC7\\u6EE4...",equals:"\\u7B49\\u4E8E",notEqual:"\\u4E0D\\u7B49\\u4E8E",blank:"\\u7A7A\\u767D",notBlank:"\\u975E\\u7A7A",empty:"\\u9009\\u62E9\\u4E00\\u4E2A",lessThan:"\\u5C0F\\u4E8E",greaterThan:"\\u5927\\u4E8E",lessThanOrEqual:"\\u5C0F\\u4E8E\\u7B49\\u4E8E",greaterThanOrEqual:"\\u5927\\u4E8E\\u7B49\\u4E8E",inRange:"\\u4ECB\\u4E8E",inRangeSt';
      S = S + 'art:"\\u4ECE",inRangeEnd:"\\u5230",contains:"\\u5305\\u542B",notContains:"\\u4E0D\\u5305\\u542B",startsWith:"\\u5F00\\u59CB\\u4E8E",endsWith:"\\u7ED3\\u675F\\u4E8E",dateFormatOoo:"yyyy-mm-dd",before:"\\u4E4B\\u524D",after:"\\u4E4B\\u540E",andCondition:"\\u548C",orCondition:"\\u6216",applyFilter:"\\u5E94\\u7528",resetFilter:"\\u91CD\\u7F6E",clearFilter:"\\u6E05\\u9664",cancelFilter:"\\u53D6\\u6D88",textFilter:"\\u6587\\u672C\\u8FC7\\u6EE4\\u5668",numberFilter:"\\u6570\\u5B57\\u8FC7\\u6EE4\\u5668",dateFilter:"\\u65E5\\u671F\\u8FC7\\u6EE4\\u5668",setFilter:"\\u96C6\\u5408\\u8FC7\\u6EE4\\u5668",groupFilterSelect:"\\u9009\\u62E9\\u5B57\\u6BB5:",advancedFilterContains:"\\u5305\\u542B",advancedFilterNotContains:"\\u4E0D\\u5305\\u542B",advancedFilterTextEquals:"\\u7B49\\u4E8E",advancedFilterTextNotEqual:"\\u4E0D\\u7B49\\u4E8E",advancedFilterStartsWith:"\\u5F00\\u59CB\\u4E8E",advancedFilterEndsWith:"\\u7ED3\\u675F\\u4E8E",advancedFilterBlank:"\\u4E3A\\u7A7A",advancedFilterNotBlank:"\\u4E0D\\u4E3A\\u7A7A",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"\\u4E3A\\u771F",advancedFilterFalse:"\\u4E3A\\u5047",advancedFilterAnd:"\\u4E14",advancedFilterOr:"\\u6216",advancedFilterApply:"\\u5E94\\u7528",advancedFilterBuilder:"\\u6784\\u5EFA\\u5668",advancedFilterValidationMissingColumn:"\\u7F3A\\u5C11\\u5217",advancedFilterValidationMissingOption:"\\u7F3A\\u5C11\\u9009\\u9879",advancedFilterValidationMissingValue:"\\u7F3A\\u5C11\\u503C",advancedFilterValidationInvalidColumn:"\\u627E\\u4E0D\\u5230\\u5217",advancedFilterValidationInvalidOption:"\\u627E\\u4E0D\\u5230\\u9009\\u9879",advancedFilterValidationMissingQuote:"\\u503C\\u7F3A\\u5C11\\u7ED3\\u675F\\u5F15\\u53F7",advancedFilterValidationNotANumber:"\\u503C\\u4E0D\\u662F\\u4E00\\u4E2A\\u6570\\u5B57",advancedFilterValidationInvalidDate:"\\u503C\\u4E0D\\u662F\\u4E00\\u4E2A\\u6709\\u6548\\u65E5\\u671F",advancedFilterValidationMissingCondition:"\\u7F3A\\u5C11\\u6761\\u4EF6",advancedFilterValidationJoinOperatorM';
      S = S + 'ismatch:"\\u4E00\\u4E2A\\u6761\\u4EF6\\u5185\\u7684\\u8FDE\\u63A5\\u64CD\\u4F5C\\u7B26\\u5FC5\\u987B\\u76F8\\u540C",advancedFilterValidationInvalidJoinOperator:"\\u627E\\u4E0D\\u5230\\u8FDE\\u63A5\\u64CD\\u4F5C\\u7B26",advancedFilterValidationMissingEndBracket:"\\u7F3A\\u5C11\\u7ED3\\u675F\\u62EC\\u53F7",advancedFilterValidationExtraEndBracket:"\\u7ED3\\u675F\\u62EC\\u53F7\\u8FC7\\u591A",advancedFilterValidationMessage:"\\u8868\\u8FBE\\u5F0F\\u6709\\u9519\\u8BEF\\u3002${variable} - ${variable}\\u3002",advancedFilterValidationMessageAtEnd:"\\u8868\\u8FBE\\u5F0F\\u6709\\u9519\\u8BEF\\u3002\\u8868\\u8FBE\\u5F0F\\u672B\\u5C3E\\u7684${variable}\\u3002",advancedFilterBuilderTitle:"\\u9AD8\\u7EA7\\u7B5B\\u9009",advancedFilterBuilderApply:"\\u5E94\\u7528",advancedFilterBuilderCancel:"\\u53D6\\u6D88",advancedFilterBuilderAddButtonTooltip:"\\u6DFB\\u52A0\\u7B5B\\u9009\\u6216\\u7EC4",advancedFilterBuilderRemoveButtonTooltip:"\\u79FB\\u9664",advancedFilterBuilderMoveUpButtonTooltip:"\\u4E0A\\u79FB",advancedFilterBuilderMoveDownButtonTooltip:"\\u4E0B\\u79FB",advancedFilterBuilderAddJoin:"\\u6DFB\\u52A0\\u7EC4",advancedFilterBuilderAddCondition:"\\u6DFB\\u52A0\\u7B5B\\u9009",advancedFilterBuilderSelectColumn:"\\u9009\\u62E9\\u4E00\\u4E2A\\u5217",advancedFilterBuilderSelectOption:"\\u9009\\u62E9\\u4E00\\u4E2A\\u9009\\u9879",advancedFilterBuilderEnterValue:"\\u8F93\\u5165\\u4E00\\u4E2A\\u503C...",advancedFilterBuilderValidationAlreadyApplied:"\\u5F53\\u524D\\u7B5B\\u9009\\u5DF2\\u5E94\\u7528\\u3002",advancedFilterBuilderValidationIncomplete:"\\u5E76\\u975E\\u6240\\u6709\\u6761\\u4EF6\\u90FD\\u5DF2\\u5B8C\\u6210\\u3002",advancedFilterBuilderValidationSelectColumn:"\\u5FC5\\u987B\\u9009\\u62E9\\u4E00\\u4E2A\\u5217\\u3002",advancedFilterBuilderValidationSelectOption:"\\u5FC5\\u987B\\u9009\\u62E9\\u4E00\\u4E2A\\u9009\\u9879\\u3002",advancedFilterBuilderValidationEnterValue:"\\u5FC5\\u987B\\u8F93\\u5165\\u4E00\\u4E2A\\u503C\\u3002",columns:"\\u5217",filters:"\\u8FC7\\u6EE4\\u5668",pivotMode:"\\u900F\\u89C6\\u6A21\\u5F0F",groups:"\\u884C\\u7EC4",rowGroupColumnsEmptyMessage:"\\u62D6\\u52A8\\u5230\\u6B64\\u5904\\u8BBE\\u7F6E\\u884C\\u7EC4",values:"\\';
      S = S + 'u503C",valueColumnsEmptyMessage:"\\u62D6\\u52A8\\u5230\\u6B64\\u5904\\u805A\\u5408",pivots:"\\u5217\\u6807\\u7B7E",pivotColumnsEmptyMessage:"\\u62D6\\u52A8\\u5230\\u6B64\\u5904\\u8BBE\\u7F6E\\u5217\\u6807\\u7B7E",group:"\\u7EC4",rowDragRow:"\\u884C",rowDragRows:"\\u884C",loadingOoo:"\\u52A0\\u8F7D\\u4E2D...",loadingError:"\\u9519\\u8BEF",noRowsToShow:"\\u65E0\\u663E\\u793A\\u884C",enabled:"\\u542F\\u7528",pinColumn:"\\u56FA\\u5B9A\\u5217",pinLeft:"\\u56FA\\u5B9A\\u5728\\u5DE6\\u4FA7",pinRight:"\\u56FA\\u5B9A\\u5728\\u53F3\\u4FA7",noPin:"\\u53D6\\u6D88\\u56FA\\u5B9A",valueAggregation:"\\u503C\\u6C47\\u603B",noAggregation:"\\u65E0",autosizeThisColumn:"\\u81EA\\u52A8\\u8C03\\u6574\\u8BE5\\u5217",autosizeAllColumns:"\\u81EA\\u52A8\\u8C03\\u6574\\u6240\\u6709\\u5217",groupBy:"\\u6309\\u6B64\\u5206\\u7EC4",ungroupBy:"\\u53D6\\u6D88\\u6309\\u6B64\\u5206\\u7EC4",ungroupAll:"\\u53D6\\u6D88\\u5168\\u90E8\\u5206\\u7EC4",addToValues:"\\u5C06${variable}\\u6DFB\\u52A0\\u5230\\u503C",removeFromValues:"\\u5C06${variable}\\u4ECE\\u503C\\u4E2D\\u79FB\\u9664",addToLabels:"\\u5C06${variable}\\u6DFB\\u52A0\\u5230\\u6807\\u7B7E",removeFromLabels:"\\u5C06${variable}\\u4ECE\\u6807\\u7B7E\\u4E2D\\u79FB\\u9664",resetColumns:"\\u91CD\\u7F6E\\u5217",expandAll:"\\u5C55\\u5F00\\u6240\\u6709\\u884C\\u7EC4",collapseAll:"\\u5173\\u95ED\\u6240\\u6709\\u884C\\u7EC4",copy:"\\u590D\\u5236",ctrlC:"Ctrl+C",ctrlX:"Ctrl+X",copyWithHeaders:"\\u590D\\u5236\\u5305\\u542B\\u6807\\u9898",copyWithGroupHeaders:"\\u590D\\u5236\\u5305\\u542B\\u7EC4\\u6807\\u9898",cut:"\\u526A\\u5207",paste:"\\u7C98\\u8D34",ctrlV:"Ctrl+V",export:"\\u5BFC\\u51FA",csvExport:"\\u5BFC\\u51FA\\u4E3ACSV",excelExport:"\\u5BFC\\u51FA\\u4E3AExcel",columnFilter:"\\u5217\\u8FC7\\u6EE4",columnChooser:"\\u9009\\u62E9\\u5217",sortAscending:"\\u5347\\u5E8F\\u6392\\u5217",sortDescending:"\\u964D\\u5E8F\\u6392\\u5217",sortUnSort:"\\u6E05\\u9664\\u6392\\u5E8F",sum:"\\u603B\\u548C",first:"\\u7B2C\\u4E00\\u4E2A",last:"\\u6700\\u540E\\u4E00\\u4E2A",min:"\\u6700\\u5C0F\\u503C",max:"\\u6700\\u5927\\u503C",none:"\\u65E0",count:"\\u8BA1\\u6570",avg:"\\u5E73\\u5747",filteredRows:"\\u5DF2\\u7B5B\\u9009",selectedRows:"\\u5DF2\\u9009\\u4E2D",totalRows';
      S = S + ':"\\u603B\\u884C\\u6570",totalAndFilteredRows:"\\u884C",more:"\\u66F4\\u591A",to:"\\u81F3",of:"\\u7684",page:"\\u9875",pageLastRowUnknown:"?",nextPage:"\\u4E0B\\u4E00\\u9875",lastPage:"\\u6700\\u540E\\u4E00\\u9875",firstPage:"\\u7B2C\\u4E00\\u9875",previousPage:"\\u4E0A\\u4E00\\u9875",pageSizeSelectorLabel:"\\u6BCF\\u9875\\u5927\\u5C0F\\uFF1A",footerTotal:"\\u5408\\u8BA1",pivotColumnGroupTotals:"\\u603B\\u8BA1",pivotChartAndPivotMode:"\\u6570\\u636E\\u900F\\u89C6\\u56FE\\u548C\\u6570\\u636E\\u900F\\u89C6\\u6A21\\u5F0F",pivotChart:"\\u6570\\u636E\\u900F\\u89C6\\u56FE",chartRange:"\\u56FE\\u8868\\u8303\\u56F4",columnChart:"\\u67F1\\u72B6\\u56FE",groupedColumn:"\\u5206\\u7EC4",stackedColumn:"\\u5806\\u79EF",normalizedColumn:"100% \\u5806\\u79EF",barChart:"\\u6761\\u5F62\\u56FE",groupedBar:"\\u5206\\u7EC4",stackedBar:"\\u5806\\u79EF",normalizedBar:"100% \\u5806\\u79EF",pieChart:"\\u997C\\u56FE",pie:"\\u997C\\u56FE",donut:"\\u73AF\\u5F62\\u56FE",line:"\\u6298\\u7EBF\\u56FE",xyChart:"X Y (\\u6563\\u70B9\\u56FE)",scatter:"\\u6563\\u70B9\\u56FE",bubble:"\\u6C14\\u6CE1\\u56FE",areaChart:"\\u9762\\u79EF\\u56FE",area:"\\u9762\\u79EF",stackedArea:"\\u5806\\u79EF",normalizedArea:"100% \\u5806\\u79EF",histogramChart:"\\u76F4\\u65B9\\u56FE",polarChart:"\\u6781\\u5730\\u56FE",radarLine:"\\u96F7\\u8FBE\\u7EBF",radarArea:"\\u96F7\\u8FBE\\u9762\\u79EF",nightingale:"\\u591C\\u83BA\\u56FE",radialColumn:"\\u5F84\\u5411\\u67F1\\u72B6\\u56FE",radialBar:"\\u5F84\\u5411\\u6761\\u5F62\\u56FE",statisticalChart:"\\u7EDF\\u8BA1\\u56FE",boxPlot:"\\u7BB1\\u7EBF\\u56FE",rangeBar:"\\u533A\\u95F4\\u6761\\u5F62\\u56FE",rangeArea:"\\u533A\\u95F4\\u9762\\u79EF\\u56FE",hierarchicalChart:"\\u5C42\\u6B21\\u56FE",treemap:"\\u6811\\u56FE",sunburst:"\\u65ED\\u65E5\\u56FE",specializedChart:"\\u4E13\\u9879\\u56FE",waterfall:"\\u7011\\u5E03\\u56FE",heatmap:"\\u70ED\\u529B\\u56FE",combinationChart:"\\u7EC4\\u5408\\u56FE",columnLineCombo:"\\u67F1\\u72B6\\u56FE\\u548C\\u6298\\u7EBF\\u56FE\\u7EC4\\u5408",AreaColumnCombo:"\\u9762\\u79EF\\u56FE\\u548C\\u67F1\\u72B6\\u56FE\\u7EC4\\u5408",pivotChartTitle:"\\u6570\\u636E\\u900F\\u89C6\\u56FE",rangeChartTitle:"\\u8303\\u56F4\\u56FE",settings:"\\u56FE\\u886';
      S = S + '8",data:"\\u8BBE\\u7F6E",format:"\\u81EA\\u5B9A\\u4E49",categories:"\\u7C7B\\u522B",defaultCategory:"(\\u65E0)",series:"\\u7CFB\\u5217",switchCategorySeries:"\\u5207\\u6362\\u7C7B\\u522B / \\u7CFB\\u5217",categoryValues:"\\u7C7B\\u522B\\u503C",seriesLabels:"\\u7CFB\\u5217\\u6807\\u7B7E",aggregate:"\\u6C47\\u603B",xyValues:"XY \\u503C",paired:"\\u914D\\u5BF9\\u6A21\\u5F0F",axis:"\\u8F74",xAxis:"\\u6C34\\u5E73\\u8F74",yAxis:"\\u5782\\u76F4\\u8F74",polarAxis:"\\u6781\\u5750\\u6807\\u8F74",radiusAxis:"\\u534A\\u5F84\\u8F74",navigator:"\\u5BFC\\u822A\\u5668",zoom:"\\u7F29\\u653E",animation:"\\u52A8\\u753B",crosshair:"\\u51C6\\u661F",color:"\\u989C\\u8272",thickness:"\\u539A\\u5EA6",preferredLength:"\\u9996\\u9009\\u957F\\u5EA6",xType:"X \\u7C7B\\u578B",axisType:"\\u8F74\\u7C7B\\u578B",automatic:"\\u81EA\\u52A8",category:"\\u7C7B\\u522B",number:"\\u6570\\u503C",time:"\\u65F6\\u95F4",timeFormat:"\\u65F6\\u95F4\\u683C\\u5F0F",autoRotate:"\\u81EA\\u52A8\\u65CB\\u8F6C",labelRotation:"\\u65CB\\u8F6C",circle:"\\u5706\\u5F62",polygon:"\\u591A\\u8FB9\\u5F62",square:"\\u65B9\\u5F62",cross:"\\u5341\\u5B57\\u7B26",diamond:"\\u83F1\\u5F62",plus:"\\u52A0\\u53F7",triangle:"\\u4E09\\u89D2\\u5F62",heart:"\\u7231\\u5FC3",orientation:"\\u65B9\\u5411",fixed:"\\u56FA\\u5B9A",parallel:"\\u5E73\\u884C",perpendicular:"\\u5782\\u76F4",radiusAxisPosition:"\\u4F4D\\u7F6E",ticks:"\\u523B\\u5EA6",gridLines:"\\u7F51\\u683C\\u7EBF",width:"\\u5BBD\\u5EA6",height:"\\u9AD8\\u5EA6",length:"\\u957F\\u5EA6",padding:"\\u5185\\u8FB9\\u8DDD",spacing:"\\u95F4\\u8DDD",chartStyle:"\\u56FE\\u8868\\u6837\\u5F0F",title:"\\u6807\\u9898",chartTitles:"\\u6807\\u9898",chartTitle:"\\u56FE\\u8868\\u6807\\u9898",chartSubtitle:"\\u526F\\u6807\\u9898",horizontalAxisTitle:"\\u6C34\\u5E73\\u8F74\\u6807\\u9898",verticalAxisTitle:"\\u5782\\u76F4\\u8F74\\u6807\\u9898",polarAxisTitle:"\\u6781\\u5750\\u6807\\u8F74\\u6807\\u9898",titlePlaceholder:"\\u56FE\\u8868\\u6807\\u9898",background:"\\u80CC\\u666F",font:"\\u5B57\\u4F53",weight:"\\u7C97\\u7EC6",top:"\\u9876\\u90E8",right:"\\u53F3\\u8FB9",bottom:"\\u5E95\\u90E8",left:"\\u5DE6\\u8FB9",labels:"\\u6807\\u7B7E",calloutLabels:"\\u6807\\u6CE8\\u6807\\u7B7E",sectorL';
      S = S + 'abels:"\\u6247\\u533A\\u6807\\u7B7E",positionRatio:"\\u4F4D\\u7F6E\\u6BD4\\u4F8B",size:"\\u5927\\u5C0F",shape:"\\u5F62\\u72B6",minSize:"\\u6700\\u5C0F\\u5927\\u5C0F",maxSize:"\\u6700\\u5927\\u5927\\u5C0F",legend:"\\u56FE\\u4F8B",position:"\\u4F4D\\u7F6E",markerSize:"\\u6807\\u8BB0\\u5927\\u5C0F",markerStroke:"\\u6807\\u8BB0\\u63CF\\u8FB9",markerPadding:"\\u6807\\u8BB0\\u5185\\u8FB9\\u8DDD",itemSpacing:"\\u9879\\u76EE\\u95F4\\u8DDD",itemPaddingX:"\\u9879\\u76EE\\u5185\\u8FB9\\u8DDD X",itemPaddingY:"\\u9879\\u76EE\\u5185\\u8FB9\\u8DDD Y",layoutHorizontalSpacing:"\\u6A2A\\u5411\\u95F4\\u8DDD",layoutVerticalSpacing:"\\u7EB5\\u5411\\u95F4\\u8DDD",strokeWidth:"\\u63CF\\u8FB9\\u5BBD\\u5EA6",offset:"\\u504F\\u79FB",offsets:"\\u504F\\u79FB",tooltips:"\\u5DE5\\u5177\\u63D0\\u793A",callout:"\\u6807\\u6CE8",markers:"\\u6807\\u8BB0",shadow:"\\u9634\\u5F71",blur:"\\u6A21\\u7CCA",xOffset:"X \\u504F\\u79FB",yOffset:"Y \\u504F\\u79FB",lineWidth:"\\u7EBF\\u5BBD",lineDash:"\\u7EBF\\u6761\\u865A\\u7EBF",lineDashOffset:"\\u865A\\u7EBF\\u504F\\u79FB",scrollingZoom:"\\u6EDA\\u52A8",scrollingStep:"\\u6EDA\\u52A8\\u6B65\\u9AA4",selectingZoom:"\\u9009\\u62E9",durationMillis:"\\u6301\\u7EED\\u65F6\\u95F4 (\\u6BEB\\u79D2)",crosshairLabel:"\\u6807\\u7B7E",crosshairSnap:"\\u5BF9\\u8282\\u70B9\\u5BF9\\u9F50",normal:"\\u5E38\\u89C4",bold:"\\u52A0\\u7C97",italic:"\\u659C\\u4F53",boldItalic:"\\u52A0\\u7C97\\u659C\\u4F53",predefined:"\\u9884\\u5B9A\\u4E49",fillOpacity:"\\u586B\\u5145\\u4E0D\\u900F\\u660E\\u5EA6",strokeColor:"\\u7EBF\\u6761\\u989C\\u8272",strokeOpacity:"\\u7EBF\\u6761\\u4E0D\\u900F\\u660E\\u5EA6",miniChart:"\\u8FF7\\u4F60\\u56FE\\u8868",histogramBinCount:"\\u7BB1\\u6570",connectorLine:"\\u8FDE\\u63A5\\u7EBF",seriesItems:"\\u7CFB\\u5217\\u9879\\u76EE",seriesItemType:"\\u9879\\u76EE\\u7C7B\\u578B",seriesItemPositive:"\\u6B63\\u9762",seriesItemNegative:"\\u8D1F\\u9762",seriesItemLabels:"\\u9879\\u76EE\\u6807\\u7B7E",columnGroup:"\\u67F1\\u5F62\\u56FE",barGroup:"\\u6761\\u5F62\\u56FE",pieGroup:"\\u997C\\u56FE",lineGroup:"\\u6298\\u7EBF\\u56FE",scatterGroup:"\\u6563\\u70B9\\u56FE",areaGroup:"\\u9762\\u79EF\\u56FE",polarGroup:"\\u6781\\u5750\\u6807\\u56FE",statisticalGroup:"\\';
      S = S + 'u7EDF\\u8BA1\\u56FE",hierarchicalGroup:"\\u5C42\\u6B21\\u56FE",specializedGroup:"\\u4E13\\u7528\\u56FE",combinationGroup:"\\u7EC4\\u5408\\u56FE",groupedColumnTooltip:"\\u5206\\u7EC4",stackedColumnTooltip:"\\u5806\\u79EF",normalizedColumnTooltip:"100% \\u5806\\u79EF",groupedBarTooltip:"\\u5206\\u7EC4",stackedBarTooltip:"\\u5806\\u79EF",normalizedBarTooltip:"100% \\u5806\\u79EF",pieTooltip:"\\u997C\\u56FE",donutTooltip:"\\u73AF\\u5F62\\u56FE",lineTooltip:"\\u6298\\u7EBF\\u56FE",groupedAreaTooltip:"\\u9762\\u79EF\\u56FE",stackedAreaTooltip:"\\u5806\\u79EF",normalizedAreaTooltip:"100% \\u5806\\u79EF",scatterTooltip:"\\u6563\\u70B9\\u56FE",bubbleTooltip:"\\u6C14\\u6CE1\\u56FE",histogramTooltip:"\\u76F4\\u65B9\\u56FE",radialColumnTooltip:"\\u5F84\\u5411\\u67F1\\u56FE",radialBarTooltip:"\\u5F84\\u5411\\u6761\\u56FE",radarLineTooltip:"\\u96F7\\u8FBE\\u7EBF\\u56FE",radarAreaTooltip:"\\u96F7\\u8FBE\\u9762\\u79EF\\u56FE",nightingaleTooltip:"\\u73AB\\u7470\\u56FE",rangeBarTooltip:"\\u8303\\u56F4\\u6761\\u56FE",rangeAreaTooltip:"\\u8303\\u56F4\\u9762\\u79EF\\u56FE",boxPlotTooltip:"\\u7BB1\\u7EBF\\u56FE",treemapTooltip:"\\u6811\\u72B6\\u56FE",sunburstTooltip:"\\u65ED\\u65E5\\u56FE",waterfallTooltip:"\\u7011\\u5E03\\u56FE",heatmapTooltip:"\\u70ED\\u529B\\u56FE",columnLineComboTooltip:"\\u67F1\\u56FE\\u4E0E\\u6298\\u7EBF\\u56FE",areaColumnComboTooltip:"\\u9762\\u79EF\\u56FE\\u4E0E\\u67F1\\u56FE",customComboTooltip:"\\u81EA\\u5B9A\\u4E49\\u7EC4\\u5408",innerRadius:"\\u5185\\u534A\\u5F84",startAngle:"\\u8D77\\u59CB\\u89D2\\u5EA6",endAngle:"\\u7EC8\\u6B62\\u89D2\\u5EA6",reverseDirection:"\\u53CD\\u5411",groupPadding:"\\u7EC4\\u95F4\\u8DDD",seriesPadding:"\\u7CFB\\u5217\\u95F4\\u8DDD",tile:"\\u74E6\\u7247",whisker:"\\u987B",cap:"\\u9876\\u90E8",capLengthRatio:"\\u9876\\u90E8\\u957F\\u5EA6\\u6BD4",labelPlacement:"\\u6807\\u7B7E\\u4F4D\\u7F6E",inside:"\\u5185\\u90E8",outside:"\\u5916\\u90E8",noDataToChart:"\\u65E0\\u53EF\\u7ED8\\u5236\\u7684\\u6570\\u636E\\u3002",pivotChartRequiresPivotMode:"\\u6570\\u636E\\u900F\\u89C6\\u56FE\\u9700\\u8981\\u542F\\u7528\\u6570\\u636E\\u900F\\u89C6\\u6A21\\u5F0F\\u3002",chartSettingsToolbarTooltip:"\\u83DC\\u5355",chartLin';
      S = S + 'kToolbarTooltip:"\\u94FE\\u63A5\\u5230\\u7F51\\u683C",chartUnlinkToolbarTooltip:"\\u4ECE\\u7F51\\u683C\\u4E2D\\u53D6\\u6D88\\u94FE\\u63A5",chartDownloadToolbarTooltip:"\\u4E0B\\u8F7D\\u56FE\\u8868",chartMenuToolbarTooltip:"\\u83DC\\u5355",chartEdit:"\\u7F16\\u8F91\\u56FE\\u8868",chartAdvancedSettings:"\\u9AD8\\u7EA7\\u8BBE\\u7F6E",chartLink:"\\u94FE\\u63A5\\u5230\\u7F51\\u683C",chartUnlink:"\\u4ECE\\u7F51\\u683C\\u4E2D\\u53D6\\u6D88\\u94FE\\u63A5",chartDownload:"\\u4E0B\\u8F7D\\u56FE\\u8868",histogramFrequency:"\\u9891\\u7387",seriesChartType:"\\u7CFB\\u5217\\u56FE\\u8868\\u7C7B\\u578B",seriesType:"\\u7CFB\\u5217\\u7C7B\\u578B",secondaryAxis:"\\u6B21\\u8F74",seriesAdd:"\\u6DFB\\u52A0\\u7CFB\\u5217",categoryAdd:"\\u6DFB\\u52A0\\u7C7B\\u522B",bar:"\\u6761\\u5F62\\u56FE",column:"\\u67F1\\u5F62\\u56FE",histogram:"\\u76F4\\u65B9\\u56FE",advancedSettings:"\\u9AD8\\u7EA7\\u8BBE\\u7F6E",direction:"\\u65B9\\u5411",horizontal:"\\u6C34\\u5E73",vertical:"\\u5782\\u76F4",seriesGroupType:"\\u5206\\u7EC4\\u7C7B\\u578B",groupedSeriesGroupType:"\\u5206\\u7EC4",stackedSeriesGroupType:"\\u5806\\u79EF",normalizedSeriesGroupType:"100% \\u5806\\u79EF",legendEnabled:"\\u542F\\u7528",invalidColor:"\\u65E0\\u6548\\u7684\\u989C\\u8272\\u503C",groupedColumnFull:"\\u5206\\u7EC4\\u67F1\\u5F62\\u56FE",stackedColumnFull:"\\u5806\\u79EF\\u67F1\\u5F62\\u56FE",normalizedColumnFull:"100% \\u5806\\u79EF\\u67F1\\u5F62\\u56FE",groupedBarFull:"\\u5206\\u7EC4\\u6761\\u5F62\\u56FE",stackedBarFull:"\\u5806\\u79EF\\u6761\\u5F62\\u56FE",normalizedBarFull:"100% \\u5806\\u79EF\\u6761\\u5F62\\u56FE",stackedAreaFull:"\\u5806\\u79EF\\u9762\\u79EF\\u56FE",normalizedAreaFull:"100% \\u5806\\u79EF\\u9762\\u79EF\\u56FE",customCombo:"\\u81EA\\u5B9A\\u4E49\\u7EC4\\u5408",ariaAdvancedFilterBuilderItem:"${variable}. \\u7EA7\\u522B ${variable}. \\u6309 ENTER \\u8FDB\\u884C\\u7F16\\u8F91\\u3002",ariaAdvancedFilterBuilderItemValidation:"${variable}. \\u7EA7\\u522B ${variable}. ${variable} \\u6309 ENTER \\u8FDB\\u884C\\u7F16\\u8F91\\u3002",ariaAdvancedFilterBuilderList:"\\u9AD8\\u7EA7\\u8FC7\\u6EE4\\u5668\\u6784\\u5EFA\\u5668\\u5217\\u8868",ariaAdvancedFilterBuilderFilterItem:"\\u8FC7\\u6EE4\\u6761\\u';
      S = S + '4EF6",ariaAdvancedFilterBuilderGroupItem:"\\u8FC7\\u6EE4\\u7EC4",ariaAdvancedFilterBuilderColumn:"\\u5217",ariaAdvancedFilterBuilderOption:"\\u9009\\u9879",ariaAdvancedFilterBuilderValueP:"\\u503C",ariaAdvancedFilterBuilderJoinOperator:"\\u8FDE\\u63A5\\u8FD0\\u7B97\\u7B26",ariaAdvancedFilterInput:"\\u9AD8\\u7EA7\\u8FC7\\u6EE4\\u5668\\u8F93\\u5165",ariaChecked:"\\u5DF2\\u9009\\u4E2D",ariaColumn:"\\u5217",ariaColumnGroup:"\\u5217\\u7EC4",ariaColumnFiltered:"\\u5217\\u5DF2\\u8FC7\\u6EE4",ariaColumnSelectAll:"\\u5207\\u6362\\u9009\\u62E9\\u6240\\u6709\\u5217",ariaDateFilterInput:"\\u65E5\\u671F\\u8FC7\\u6EE4\\u5668\\u8F93\\u5165",ariaDefaultListName:"\\u5217\\u8868",ariaFilterColumnsInput:"\\u8FC7\\u6EE4\\u5217\\u8F93\\u5165",ariaFilterFromValue:"\\u8FC7\\u6EE4\\u4ECE\\u503C",ariaFilterInput:"\\u8FC7\\u6EE4\\u5668\\u8F93\\u5165",ariaFilterList:"\\u8FC7\\u6EE4\\u5668\\u5217\\u8868",ariaFilterToValue:"\\u8FC7\\u6EE4\\u81F3\\u503C",ariaFilterValue:"\\u8FC7\\u6EE4\\u503C",ariaFilterMenuOpen:"\\u6253\\u5F00\\u8FC7\\u6EE4\\u5668\\u83DC\\u5355",ariaFilteringOperator:"\\u8FC7\\u6EE4\\u8FD0\\u7B97\\u7B26",ariaHidden:"\\u9690\\u85CF",ariaIndeterminate:"\\u4E0D\\u786E\\u5B9A",ariaInputEditor:"\\u8F93\\u5165\\u7F16\\u8F91\\u5668",ariaMenuColumn:"\\u6309 ALT \\u5411\\u4E0B \\u6253\\u5F00\\u5217\\u83DC\\u5355",ariaFilterColumn:"\\u6309 CTRL ENTER \\u6253\\u5F00\\u8FC7\\u6EE4\\u5668",ariaRowDeselect:"\\u6309 SPACE \\u53D6\\u6D88\\u9009\\u62E9\\u6B64\\u884C",ariaRowSelectAll:"\\u6309 Space \\u5207\\u6362\\u6240\\u6709\\u884C\\u9009\\u62E9",ariaRowToggleSelection:"\\u6309 Space \\u5207\\u6362\\u884C\\u9009\\u62E9",ariaRowSelect:"\\u6309 SPACE \\u9009\\u62E9\\u6B64\\u884C",ariaRowSelectionDisabled:"\\u6B64\\u884C\\u7684\\u884C\\u9009\\u62E9\\u529F\\u80FD\\u88AB\\u7981\\u7528",ariaSearch:"\\u641C\\u7D22",ariaSortableColumn:"\\u6309 ENTER \\u6392\\u5E8F",ariaToggleVisibility:"\\u6309 Space \\u5207\\u6362\\u53EF\\u89C1\\u6027",ariaToggleCellValue:"\\u6309 Space \\u5207\\u6362\\u5355\\u5143\\u683C\\u503C",ariaUnchecked:"\\u672A\\u9009\\u4E2D",ariaVisible:"\\u53EF\\u89C1",ariaSearchFilterValues:"\\u641C\\u7D22\\u8FC7\\u6EE4\\u503C",ariaPageSizeSelectorLabel:"\\u';
      S = S + '9875\\u9762\\u5927\\u5C0F",ariaChartMenuClose:"\\u5173\\u95ED\\u56FE\\u8868\\u7F16\\u8F91\\u83DC\\u5355",ariaChartSelected:"\\u5DF2\\u9009\\u62E9",ariaSkeletonCellLoadingFailed:"\\u884C\\u52A0\\u8F7D\\u5931\\u8D25",ariaSkeletonCellLoading:"\\u884C\\u6570\\u636E\\u52A0\\u8F7D\\u4E2D",ariaRowGroupDropZonePanelLabel:"\\u884C\\u5206\\u7EC4",ariaValuesDropZonePanelLabel:"\\u503C",ariaPivotDropZonePanelLabel:"\\u5217\\u6807\\u7B7E",ariaDropZoneColumnComponentDescription:"\\u6309 DELETE \\u952E\\u79FB\\u9664",ariaDropZoneColumnValueItemDescription:"\\u6309 ENTER \\u952E\\u66F4\\u6539\\u805A\\u5408\\u7C7B\\u578B",ariaDropZoneColumnGroupItemDescription:"\\u6309 ENTER \\u952E\\u6392\\u5E8F",ariaDropZoneColumnComponentAggFuncSeparator:" \\u7684 ",ariaDropZoneColumnComponentSortAscending:"\\u5347\\u5E8F",ariaDropZoneColumnComponentSortDescending:"\\u964D\\u5E8F",ariaLabelDialog:"\\u5BF9\\u8BDD\\u6846",ariaLabelColumnMenu:"\\u5217\\u83DC\\u5355",ariaLabelColumnFilter:"\\u5217\\u8FC7\\u6EE4\\u5668",ariaLabelCellEditor:"\\u5355\\u5143\\u683C\\u7F16\\u8F91\\u5668",ariaLabelSelectField:"\\u9009\\u62E9\\u5B57\\u6BB5",ariaLabelRichSelectField:"\\u4E30\\u5BCC\\u9009\\u62E9\\u5B57\\u6BB5",ariaLabelRichSelectToggleSelection:"\\u6309\\u4E0B\\u7A7A\\u683C\\u952E\\u4EE5\\u5207\\u6362\\u9009\\u62E9",ariaLabelRichSelectDeselectAllItems:"\\u6309\\u4E0B\\u5220\\u9664\\u952E\\u6765\\u53D6\\u6D88\\u9009\\u62E9\\u6240\\u6709\\u9879\\u76EE",ariaLabelRichSelectDeleteSelection:"\\u6309\\u4E0B\\u5220\\u9664\\u952E\\u6765\\u53D6\\u6D88\\u9009\\u62E9\\u9879\\u76EE",ariaLabelTooltip:"\\u5DE5\\u5177\\u63D0\\u793A",ariaLabelContextMenu:"\\u4E0A\\u4E0B\\u6587\\u83DC\\u5355",ariaLabelSubMenu:"\\u5B50\\u83DC\\u5355",ariaLabelAggregationFunction:"\\u805A\\u5408\\u51FD\\u6570",ariaLabelAdvancedFilterAutocomplete:"\\u9AD8\\u7EA7\\u7B5B\\u9009\\u81EA\\u52A8\\u5B8C\\u6210",ariaLabelAdvancedFilterBuilderAddField:"\\u9AD8\\u7EA7\\u7B5B\\u9009\\u751F\\u6210\\u5668\\u6DFB\\u52A0\\u5B57\\u6BB5",ariaLabelAdvancedFilterBuilderColumnSelectField:"\\u9AD8\\u7EA7\\u7B5B\\u9009\\u751F\\u6210\\u5668\\u5217\\u9009\\u62E9\\u5B57\\u6BB5",ariaLabelAdvancedFilterBuilderOptionSelectField:"\\u';
      S = S + '9AD8\\u7EA7\\u7B5B\\u9009\\u751F\\u6210\\u5668\\u9009\\u9879\\u9009\\u62E9\\u5B57\\u6BB5",ariaLabelAdvancedFilterBuilderJoinSelectField:"\\u9AD8\\u7EA7\\u7B5B\\u9009\\u751F\\u6210\\u5668\\u8FDE\\u63A5\\u64CD\\u4F5C\\u7B26\\u9009\\u62E9\\u5B57\\u6BB5",ariaColumnPanelList:"\\u5217\\u5217\\u8868",ariaFilterPanelList:"\\u8FC7\\u6EE4\\u5217\\u8868",thousandSeparator:",",decimalSeparator:".",true:"\\u771F",false:"\\u5047",invalidDate:"\\u65E0\\u6548\\u65E5\\u671F",invalidNumber:"\\u65E0\\u6548\\u6570\\u5B57",january:"\\u4E00\\u6708",february:"\\u4E8C\\u6708",march:"\\u4E09\\u6708",april:"\\u56DB\\u6708",may:"\\u4E94\\u6708",june:"\\u516D\\u6708",july:"\\u4E03\\u6708",august:"\\u516B\\u6708",september:"\\u4E5D\\u6708",october:"\\u5341\\u6708",november:"\\u5341\\u4E00\\u6708",december:"\\u5341\\u4E8C\\u6708",timeFormatSlashesDDMMYYYY:"DD/MM/YYYY",timeFormatSlashesMMDDYYYY:"MM/DD/YYYY",timeFormatSlashesDDMMYY:"DD/MM/YY",timeFormatSlashesMMDDYY:"MM/DD/YY",timeFormatDotsDDMYY:"DD.M.YY",timeFormatDotsMDDYY:"M.DD.YY",timeFormatDashesYYYYMMDD:"YYYY-MM-DD",timeFormatSpacesDDMMMMYYYY:"DD MMMM YYYY",timeFormatHHMMSS:"HH:MM:SS",timeFormatHHMMSSAmPm:"HH:MM:SS \\u4E0A\\u5348/\\u4E0B\\u5348"},f={selectAll:"(\\u5168\\u9078)",selectAllSearchResults:"(\\u9078\\u64C7\\u6240\\u6709\\u641C\\u7D22\\u7D50\\u679C)",addCurrentSelectionToFilter:"\\u5C07\\u7576\\u524D\\u9078\\u64C7\\u6DFB\\u52A0\\u5230\\u904E\\u6FFE\\u5668",searchOoo:"\\u641C\\u7D22...",blanks:"(\\u7A7A\\u767D)",noMatches:"\\u672A\\u627E\\u5230\\u5339\\u914D\\u9805",filterOoo:"\\u7BE9\\u9078...",equals:"\\u7B49\\u65BC",notEqual:"\\u4E0D\\u7B49\\u65BC",blank:"\\u7A7A\\u767D",notBlank:"\\u975E\\u7A7A\\u767D",empty:"\\u9078\\u64C7\\u4E00\\u500B",lessThan:"\\u5C11\\u65BC",greaterThan:"\\u5927\\u65BC",lessThanOrEqual:"\\u5C11\\u65BC\\u6216\\u7B49\\u65BC",greaterThanOrEqual:"\\u5927\\u65BC\\u6216\\u7B49\\u65BC",inRange:"\\u4ECB\\u4E4E",inRangeStart:"\\u7531",inRangeEnd:"\\u81F3",contains:"\\u5305\\u542B",notContains:"\\u4E0D\\u5305\\u542B",startsWith:"\\u958B\\u59CB\\u65BC",endsWith:"\\u7D50\\u675F\\u65BC",dateFormatOoo:"yyyy-mm-dd",before:"\\u4E4B\\u524D",after:"\\u4E4B\\u5F8C",andConditi';
      S = S + 'on:"\\u548C",orCondition:"\\u6216",applyFilter:"\\u61C9\\u7528",resetFilter:"\\u91CD\\u7F6E",clearFilter:"\\u6E05\\u9664",cancelFilter:"\\u53D6\\u6D88",textFilter:"\\u6587\\u672C\\u7BE9\\u9078",numberFilter:"\\u6578\\u5B57\\u7BE9\\u9078",dateFilter:"\\u65E5\\u671F\\u7BE9\\u9078",setFilter:"\\u96C6\\u5408\\u7BE9\\u9078",groupFilterSelect:"\\u9078\\u64C7\\u5B57\\u6BB5\\uFF1A",advancedFilterContains:"\\u5305\\u542B",advancedFilterNotContains:"\\u4E0D\\u5305\\u542B",advancedFilterTextEquals:"\\u7B49\\u65BC",advancedFilterTextNotEqual:"\\u4E0D\\u7B49\\u65BC",advancedFilterStartsWith:"\\u958B\\u59CB\\u65BC",advancedFilterEndsWith:"\\u7D50\\u675F\\u65BC",advancedFilterBlank:"\\u70BA\\u7A7A",advancedFilterNotBlank:"\\u4E0D\\u70BA\\u7A7A",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"\\u70BA\\u771F",advancedFilterFalse:"\\u70BA\\u5047",advancedFilterAnd:"\\u548C",advancedFilterOr:"\\u6216",advancedFilterApply:"\\u61C9\\u7528",advancedFilterBuilder:"\\u5EFA\\u9020\\u8005",advancedFilterValidationMissingColumn:"\\u7F3A\\u5C11\\u5217",advancedFilterValidationMissingOption:"\\u7F3A\\u5C11\\u9078\\u9805",advancedFilterValidationMissingValue:"\\u7F3A\\u5C11\\u503C",advancedFilterValidationInvalidColumn:"\\u672A\\u627E\\u5230\\u5217",advancedFilterValidationInvalidOption:"\\u672A\\u627E\\u5230\\u9078\\u9805",advancedFilterValidationMissingQuote:"\\u503C\\u7F3A\\u5C11\\u7D50\\u5C3E\\u5F15\\u865F",advancedFilterValidationNotANumber:"\\u503C\\u4E0D\\u662F\\u4E00\\u500B\\u6578\\u5B57",advancedFilterValidationInvalidDate:"\\u503C\\u4E0D\\u662F\\u6709\\u6548\\u65E5\\u671F",advancedFilterValidationMissingCondition:"\\u7F3A\\u5C11\\u689D\\u4EF6",advancedFilterValidationJoinOperatorMismatch:"\\u689D\\u4EF6\\u5167\\u7684\\u9023\\u63A5\\u904B\\u7B97\\u7B26\\u5FC5\\u9808\\u76F8\\u540C",advancedFilterValidationInvalidJoinOperator:"\\u672A\\u627E\\u5230\\u9023\\u63A5\\u904B\\u7B97\\u7B26",advancedFilterValidationMissingEndBracket:"\\u7F3A\\u5C11\\u7D50\\u5C3E\\u62EC\\u865F';
      S = S + '",advancedFilterValidationExtraEndBracket:"\\u7D50\\u5C3E\\u62EC\\u865F\\u904E\\u591A",advancedFilterValidationMessage:"\\u8868\\u9054\\u5F0F\\u6709\\u932F\\u8AA4\\u3002${variable} - ${variable}\\u3002",advancedFilterValidationMessageAtEnd:"\\u8868\\u9054\\u5F0F\\u6709\\u932F\\u8AA4\\u3002${variable} \\u5728\\u8868\\u9054\\u5F0F\\u7684\\u7D50\\u5C3E\\u3002",advancedFilterBuilderTitle:"\\u9AD8\\u7D1A\\u904E\\u6FFE\\u5668",advancedFilterBuilderApply:"\\u61C9\\u7528",advancedFilterBuilderCancel:"\\u53D6\\u6D88",advancedFilterBuilderAddButtonTooltip:"\\u6DFB\\u52A0\\u904E\\u6FFE\\u5668\\u6216\\u5206\\u7D44",advancedFilterBuilderRemoveButtonTooltip:"\\u79FB\\u9664",advancedFilterBuilderMoveUpButtonTooltip:"\\u5411\\u4E0A\\u79FB\\u52D5",advancedFilterBuilderMoveDownButtonTooltip:"\\u5411\\u4E0B\\u79FB\\u52D5",advancedFilterBuilderAddJoin:"\\u6DFB\\u52A0\\u5206\\u7D44",advancedFilterBuilderAddCondition:"\\u6DFB\\u52A0\\u904E\\u6FFE\\u5668",advancedFilterBuilderSelectColumn:"\\u9078\\u64C7\\u4E00\\u5217",advancedFilterBuilderSelectOption:"\\u9078\\u64C7\\u4E00\\u500B\\u9078\\u9805",advancedFilterBuilderEnterValue:"\\u8F38\\u5165\\u4E00\\u500B\\u503C...",advancedFilterBuilderValidationAlreadyApplied:"\\u7576\\u524D\\u904E\\u6FFE\\u5668\\u5DF2\\u61C9\\u7528\\u3002",advancedFilterBuilderValidationIncomplete:"\\u689D\\u4EF6\\u672A\\u5B8C\\u5168\\u3002",advancedFilterBuilderValidationSelectColumn:"\\u5FC5\\u9808\\u9078\\u64C7\\u4E00\\u5217\\u3002",advancedFilterBuilderValidationSelectOption:"\\u5FC5\\u9808\\u9078\\u64C7\\u4E00\\u500B\\u9078\\u9805\\u3002",advancedFilterBuilderValidationEnterValue:"\\u5FC5\\u9808\\u8F38\\u5165\\u4E00\\u500B\\u503C\\u3002",columns:"\\u6B04",filters:"\\u7BE9\\u9078",pivotMode:"\\u6A1E\\u7D10\\u6A21\\u5F0F",groups:"\\u884C\\u7D44",rowGroupColumnsEmptyMessage:"\\u62D6\\u52D5\\u5230\\u9019\\u88E1\\u8A2D\\u7F6E\\u884C\\u7D44",values:"\\u503C",valueColumnsEmptyMessage:"\\u62D6\\u52D5\\u5230\\u9019\\u88E1\\u9032\\u884C\\u532F\\u7E3D",pivots:"\\u5217\\u6A19\\u7C64",pivotColumnsEmptyMessage:"\\u62D6\\u52D5\\u5230\\u9019\\u88E1\\u8A2D\\u7F6E\\u5217\\u6A19\\u7C64",group:"\\u7D44",rowDragRow:"\\u884C",rowDragRows:"\\u8';
      S = S + '84C",loadingOoo:"\\u8F09\\u5165\\u4E2D...",loadingError:"\\u932F\\u8AA4",noRowsToShow:"\\u6C92\\u6709\\u884C\\u986F\\u793A",enabled:"\\u5DF2\\u555F\\u7528",pinColumn:"\\u56FA\\u5B9A\\u5217",pinLeft:"\\u56FA\\u5B9A\\u5230\\u5DE6\\u908A",pinRight:"\\u56FA\\u5B9A\\u5230\\u53F3\\u908A",noPin:"\\u4E0D\\u56FA\\u5B9A",valueAggregation:"\\u503C\\u805A\\u5408",noAggregation:"\\u7121",autosizeThisColumn:"\\u81EA\\u52D5\\u8ABF\\u6574\\u6B64\\u5217\\u7684\\u5BEC\\u5EA6",autosizeAllColumns:"\\u81EA\\u52D5\\u8ABF\\u6574\\u6240\\u6709\\u5217\\u7684\\u5BEC\\u5EA6",groupBy:"\\u5206\\u7D44",ungroupBy:"\\u53D6\\u6D88\\u5206\\u7D44",ungroupAll:"\\u53D6\\u6D88\\u6240\\u6709\\u5206\\u7D44",addToValues:"\\u6DFB\\u52A0 ${variable} \\u5230\\u6578\\u503C",removeFromValues:"\\u5F9E\\u6578\\u503C\\u4E2D\\u79FB\\u9664 ${variable}",addToLabels:"\\u6DFB\\u52A0 ${variable} \\u5230\\u6A19\\u7C64",removeFromLabels:"\\u5F9E\\u6A19\\u7C64\\u4E2D\\u79FB\\u9664 ${variable}",resetColumns:"\\u91CD\\u7F6E\\u5217",expandAll:"\\u5C55\\u958B\\u6240\\u6709\\u884C\\u7D44",collapseAll:"\\u95DC\\u9589\\u6240\\u6709\\u884C\\u7D44",copy:"\\u8907\\u88FD",ctrlC:"Ctrl+C",ctrlX:"Ctrl+X",copyWithHeaders:"\\u9023\\u540C\\u6A19\\u982D\\u4E00\\u8D77\\u8907\\u88FD",copyWithGroupHeaders:"\\u9023\\u540C\\u5206\\u7D44\\u6A19\\u982D\\u4E00\\u8D77\\u8907\\u88FD",cut:"\\u526A\\u5207",paste:"\\u7C98\\u8CBC",ctrlV:"Ctrl+V",export:"\\u532F\\u51FA",csvExport:"\\u532F\\u51FA\\u70BA CSV",excelExport:"\\u532F\\u51FA\\u70BA Excel",columnFilter:"\\u5217\\u7BE9\\u9078\\u5668",columnChooser:"\\u9078\\u64C7\\u5217",sortAscending:"\\u5347\\u5E8F\\u6392\\u5E8F",sortDescending:"\\u964D\\u5E8F\\u6392\\u5E8F",sortUnSort:"\\u6E05\\u9664\\u6392\\u5E8F",sum:"\\u7E3D\\u548C",first:"\\u7B2C\\u4E00",last:"\\u6700\\u5F8C",min:"\\u6700\\u5C0F",max:"\\u6700\\u5927",none:"\\u7121",count:"\\u8A08\\u6578",avg:"\\u5E73\\u5747",filteredRows:"\\u5DF2\\u7BE9\\u9078",selectedRows:"\\u5DF2\\u9078\\u64C7",totalRows:"\\u7E3D\\u884C\\u6578",totalAndFilteredRows:"\\u884C\\u6578",more:"\\u66F4\\u591A",to:"\\u81F3",of:"\\u7684",page:"\\u9801",pageLastRowUnknown:"?",nextPage:"\\u4E0B\\u4E00\\u9801",lastPage:"\\u6700\\u5F8C\\u4E00\\u9801",firstPage:"\\u7B2C\\u';
      S = S + '4E00\\u9801",previousPage:"\\u4E0A\\u4E00\\u9801",pageSizeSelectorLabel:"\\u9801\\u9762\\u5927\\u5C0F:",footerTotal:"\\u7E3D\\u8A08",pivotColumnGroupTotals:"\\u7E3D\\u8A08",pivotChartAndPivotMode:"\\u6A1E\\u7D10\\u5716\\u8868\\u53CA\\u6A1E\\u7D10\\u6A21\\u5F0F",pivotChart:"\\u6A1E\\u7D10\\u5716\\u8868",chartRange:"\\u5716\\u8868\\u7BC4\\u570D",columnChart:"\\u67F1\\u72C0\\u5716",groupedColumn:"\\u5206\\u7D44",stackedColumn:"\\u5806\\u758A",normalizedColumn:"100% \\u5806\\u758A",barChart:"\\u6A6B\\u689D\\u5716",groupedBar:"\\u5206\\u7D44",stackedBar:"\\u5806\\u758A",normalizedBar:"100% \\u5806\\u758A",pieChart:"\\u9905\\u5716",pie:"\\u9905\\u5716",donut:"\\u5713\\u74B0\\u5716",line:"\\u6298\\u7DDA\\u5716",xyChart:"X Y (\\u6563\\u9EDE\\u5716)",scatter:"\\u6563\\u9EDE\\u5716",bubble:"\\u6C23\\u6CE1\\u5716",areaChart:"\\u5340\\u57DF\\u5716",area:"\\u5340\\u57DF",stackedArea:"\\u5806\\u758A",normalizedArea:"100% \\u5806\\u758A",histogramChart:"\\u76F4\\u65B9\\u5716",polarChart:"\\u6975\\u5EA7\\u6A19\\u5716",radarLine:"\\u96F7\\u9054\\u7DDA\\u5716",radarArea:"\\u96F7\\u9054\\u5340\\u57DF\\u5716",nightingale:"\\u591C\\u9DAF\\u5716",radialColumn:"\\u5F91\\u5411\\u67F1\\u72C0\\u5716",radialBar:"\\u5F91\\u5411\\u689D\\u5F62\\u5716",statisticalChart:"\\u7D71\\u8A08\\u5716",boxPlot:"\\u76D2\\u9B1A\\u5716",rangeBar:"\\u7BC4\\u570D\\u689D\\u5F62\\u5716",rangeArea:"\\u7BC4\\u570D\\u5340\\u57DF\\u5716",hierarchicalChart:"\\u968E\\u5C64\\u5716",treemap:"\\u6A39\\u72C0\\u5716",sunburst:"\\u65ED\\u65E5\\u5716",specializedChart:"\\u5C08\\u696D\\u5716\\u8868",waterfall:"\\u7011\\u5E03\\u5716",heatmap:"\\u71B1\\u5716",combinationChart:"\\u7D44\\u5408\\u5716",columnLineCombo:"\\u67F1\\u72C0\\u5716\\u548C\\u6298\\u7DDA\\u5716",AreaColumnCombo:"\\u5340\\u57DF\\u5716\\u548C\\u67F1\\u72C0\\u5716",pivotChartTitle:"\\u6A1E\\u7D10\\u5716",rangeChartTitle:"\\u7BC4\\u570D\\u5716",settings:"\\u5716\\u8868",data:"\\u8A2D\\u7F6E",format:"\\u81EA\\u8A02",categories:"\\u985E\\u5225",defaultCategory:"(\\u7121)",series:"\\u7CFB\\u5217",switchCategorySeries:"\\u5207\\u63DB\\u985E\\u5225 / \\u7CFB\\u5217",categoryValues:"\\u985E\\u5225\\u503C",seriesLabels:"\\u7CFB\\u5217\\u6A19\\u7C64",';
      S = S + 'aggregate:"\\u532F\\u7E3D",xyValues:"X Y \\u503C",paired:"\\u914D\\u5C0D\\u6A21\\u5F0F",axis:"\\u8EF8",xAxis:"\\u6C34\\u5E73\\u8EF8",yAxis:"\\u5782\\u76F4\\u8EF8",polarAxis:"\\u6975\\u5EA7\\u6A19\\u8EF8",radiusAxis:"\\u534A\\u5F91\\u8EF8",navigator:"\\u5C0E\\u822A\\u5668",zoom:"\\u7E2E\\u653E",animation:"\\u52D5\\u756B",crosshair:"\\u6E96\\u5FC3",color:"\\u984F\\u8272",thickness:"\\u539A\\u5EA6",preferredLength:"\\u9996\\u9078\\u9577\\u5EA6",xType:"X \\u985E\\u578B",axisType:"\\u8EF8\\u985E\\u578B",automatic:"\\u81EA\\u52D5",category:"\\u985E\\u5225",number:"\\u6578\\u5B57",time:"\\u6642\\u9593",timeFormat:"\\u6642\\u9593\\u683C\\u5F0F",autoRotate:"\\u81EA\\u52D5\\u65CB\\u8F49",labelRotation:"\\u65CB\\u8F49",circle:"\\u5713\\u5F62",polygon:"\\u591A\\u908A\\u5F62",square:"\\u6B63\\u65B9\\u5F62",cross:"\\u53C9\\u865F",diamond:"\\u83F1\\u5F62",plus:"\\u52A0\\u865F",triangle:"\\u4E09\\u89D2\\u5F62",heart:"\\u5FC3\\u5F62",orientation:"\\u65B9\\u5411",fixed:"\\u56FA\\u5B9A",parallel:"\\u5E73\\u884C",perpendicular:"\\u5782\\u76F4",radiusAxisPosition:"\\u4F4D\\u7F6E",ticks:"\\u523B\\u5EA6",gridLines:"\\u7DB2\\u683C\\u7DDA",width:"\\u5BEC\\u5EA6",height:"\\u9AD8\\u5EA6",length:"\\u9577\\u5EA6",padding:"\\u5167\\u8DDD",spacing:"\\u9593\\u8DDD",chartStyle:"\\u5716\\u8868\\u6A23\\u5F0F",title:"\\u6A19\\u984C",chartTitles:"\\u6A19\\u984C",chartTitle:"\\u5716\\u8868\\u6A19\\u984C",chartSubtitle:"\\u526F\\u6A19\\u984C",horizontalAxisTitle:"\\u6C34\\u5E73\\u8EF8\\u6A19\\u984C",verticalAxisTitle:"\\u5782\\u76F4\\u8EF8\\u6A19\\u984C",polarAxisTitle:"\\u6975\\u5EA7\\u6A19\\u8EF8\\u6A19\\u984C",titlePlaceholder:"\\u5716\\u8868\\u6A19\\u984C",background:"\\u80CC\\u666F",font:"\\u5B57\\u9AD4",weight:"\\u5B57\\u91CD",top:"\\u9802\\u90E8",right:"\\u53F3\\u908A",bottom:"\\u5E95\\u90E8",left:"\\u5DE6\\u908A",labels:"\\u6A19\\u7C64",calloutLabels:"\\u6A19\\u8A3B\\u6A19\\u7C64",sectorLabels:"\\u6247\\u5340\\u6A19\\u7C64",positionRatio:"\\u4F4D\\u7F6E\\u6BD4\\u4F8B",size:"\\u5927\\u5C0F",shape:"\\u5F62\\u72C0",minSize:"\\u6700\\u5C0F\\u5927\\u5C0F",maxSize:"\\u6700\\u5927\\u5927\\u5C0F",legend:"\\u5716\\u4F8B",position:"\\u4F4D\\u7F6E",markerSize:"\\u6A19\\u8A18\\u5927\\u5C0F",m';
      S = S + 'arkerStroke:"\\u6A19\\u8A18\\u908A\\u6846",markerPadding:"\\u6A19\\u8A18\\u5167\\u8DDD",itemSpacing:"\\u9805\\u76EE\\u9593\\u8DDD",itemPaddingX:"\\u9805\\u76EE\\u5167\\u8DDD X",itemPaddingY:"\\u9805\\u76EE\\u5167\\u8DDD Y",layoutHorizontalSpacing:"\\u6C34\\u5E73\\u9593\\u8DDD",layoutVerticalSpacing:"\\u5782\\u76F4\\u9593\\u8DDD",strokeWidth:"\\u908A\\u6846\\u5BEC\\u5EA6",offset:"\\u504F\\u79FB",offsets:"\\u504F\\u79FB\\u91CF",tooltips:"\\u5DE5\\u5177\\u63D0\\u793A",callout:"\\u6A19\\u8A3B",markers:"\\u6A19\\u8A18",shadow:"\\u9670\\u5F71",blur:"\\u6A21\\u7CCA",xOffset:"X \\u504F\\u79FB",yOffset:"Y \\u504F\\u79FB",lineWidth:"\\u7DDA\\u5BEC",lineDash:"\\u865B\\u7DDA",lineDashOffset:"\\u865B\\u7DDA\\u504F\\u79FB",scrollingZoom:"\\u6EFE\\u52D5",scrollingStep:"\\u6EFE\\u52D5\\u6B65\\u9A5F",selectingZoom:"\\u9078\\u64C7",durationMillis:"\\u6301\\u7E8C\\u6642\\u9593 (\\u6BEB\\u79D2)",crosshairLabel:"\\u6A19\\u7C64",crosshairSnap:"\\u5438\\u9644\\u5230\\u7BC0\\u9EDE",normal:"\\u6B63\\u5E38",bold:"\\u52A0\\u7C97",italic:"\\u659C\\u9AD4",boldItalic:"\\u7C97\\u659C\\u9AD4",predefined:"\\u9810\\u5B9A\\u7FA9",fillOpacity:"\\u586B\\u5145\\u4E0D\\u900F\\u660E\\u5EA6",strokeColor:"\\u7DDA\\u984F\\u8272",strokeOpacity:"\\u7DDA\\u4E0D\\u900F\\u660E\\u5EA6",miniChart:"\\u8FF7\\u4F60\\u5716\\u8868",histogramBinCount:"\\u76F4\\u65B9\\u5716\\u7BB1\\u6578\\u91CF",connectorLine:"\\u9023\\u63A5\\u7DDA",seriesItems:"\\u7CFB\\u5217\\u9805\\u76EE",seriesItemType:"\\u9805\\u76EE\\u985E\\u578B",seriesItemPositive:"\\u6B63\\u9762",seriesItemNegative:"\\u8CA0\\u9762",seriesItemLabels:"\\u9805\\u76EE\\u6A19\\u7C64",columnGroup:"\\u67F1\\u72C0\\u5716",barGroup:"\\u689D\\u5F62\\u5716",pieGroup:"\\u9905\\u5716",lineGroup:"\\u7DDA\\u5716",scatterGroup:"X Y (\\u6563\\u9EDE\\u5716)",areaGroup:"\\u5340\\u57DF\\u5716",polarGroup:"\\u6975\\u5730\\u5716",statisticalGroup:"\\u7D71\\u8A08\\u5716",hierarchicalGroup:"\\u5C64\\u6B21\\u7D50\\u69CB\\u5716",specializedGroup:"\\u5C08\\u9580\\u5716",combinationGroup:"\\u7D44\\u5408\\u5716",groupedColumnTooltip:"\\u5206\\u7D44",stackedColumnTooltip:"\\u5806\\u758A",normalizedColumnTooltip:"100% \\u5806\\u758A",groupedBarTooltip:"\\u5206\\u7D44"';
      S = S + ',stackedBarTooltip:"\\u5806\\u758A",normalizedBarTooltip:"100% \\u5806\\u758A",pieTooltip:"\\u9905\\u5716",donutTooltip:"\\u751C\\u751C\\u5708\\u5716",lineTooltip:"\\u7DDA\\u5716",groupedAreaTooltip:"\\u5340\\u57DF\\u5716",stackedAreaTooltip:"\\u5806\\u758A\\u5340\\u57DF\\u5716",normalizedAreaTooltip:"100% \\u5806\\u758A\\u5340\\u57DF\\u5716",scatterTooltip:"\\u6563\\u9EDE\\u5716",bubbleTooltip:"\\u6C23\\u6CE1\\u5716",histogramTooltip:"\\u76F4\\u65B9\\u5716",radialColumnTooltip:"\\u5F91\\u5411\\u67F1\\u72C0\\u5716",radialBarTooltip:"\\u5F91\\u5411\\u689D\\u5F62\\u5716",radarLineTooltip:"\\u96F7\\u9054\\u7DDA\\u5716",radarAreaTooltip:"\\u96F7\\u9054\\u5340\\u57DF\\u5716",nightingaleTooltip:"\\u591C\\u9DAF\\u5716",rangeBarTooltip:"\\u7BC4\\u570D\\u689D\\u5F62\\u5716",rangeAreaTooltip:"\\u7BC4\\u570D\\u5340\\u57DF\\u5716",boxPlotTooltip:"\\u7BB1\\u578B\\u5716",treemapTooltip:"\\u6A39\\u5716",sunburstTooltip:"\\u65ED\\u65E5\\u5716",waterfallTooltip:"\\u7011\\u5E03\\u5716",heatmapTooltip:"\\u71B1\\u5716",columnLineComboTooltip:"\\u67F1\\u72C0\\u5716\\u548C\\u6298\\u7DDA\\u5716",areaColumnComboTooltip:"\\u5340\\u57DF\\u5716\\u548C\\u67F1\\u72C0\\u5716",customComboTooltip:"\\u81EA\\u5B9A\\u7FA9\\u7D44\\u5408",innerRadius:"\\u5167\\u5F91",startAngle:"\\u958B\\u59CB\\u89D2\\u5EA6",endAngle:"\\u7D50\\u675F\\u89D2\\u5EA6",reverseDirection:"\\u53CD\\u65B9\\u5411",groupPadding:"\\u7D44\\u9593\\u8DDD",seriesPadding:"\\u7CFB\\u5217\\u9593\\u8DDD",tile:"\\u5716\\u584A",whisker:"\\u89F8\\u89D2",cap:"\\u5E3D\\u5B50",capLengthRatio:"\\u9577\\u5EA6\\u6BD4\\u4F8B",labelPlacement:"\\u6A19\\u7C64\\u653E\\u7F6E",inside:"\\u5167\\u90E8",outside:"\\u5916\\u90E8",noDataToChart:"\\u6C92\\u6709\\u53EF\\u7528\\u4F86\\u7E6A\\u88FD\\u7684\\u6578\\u64DA\\u3002",pivotChartRequiresPivotMode:"\\u6A1E\\u7D10\\u5716\\u9700\\u8981\\u555F\\u7528\\u6A1E\\u7D10\\u6A21\\u5F0F\\u3002",chartSettingsToolbarTooltip:"\\u83DC\\u55AE",chartLinkToolbarTooltip:"\\u8207\\u7DB2\\u683C\\u93C8\\u63A5",chartUnlinkToolbarTooltip:"\\u8207\\u7DB2\\u683C\\u89E3\\u93C8\\u63A5",chartDownloadToolbarTooltip:"\\u4E0B\\u8F09\\u5716\\u8868",chartMenuToolbarTooltip:"\\u83DC\\u55AE",chartEdit:"\\u7DE8\\u8F2F\\u5';
      S = S + '716\\u8868",chartAdvancedSettings:"\\u9AD8\\u7D1A\\u8A2D\\u7F6E",chartLink:"\\u93C8\\u63A5\\u5230\\u7DB2\\u683C",chartUnlink:"\\u8207\\u7DB2\\u683C\\u89E3\\u93C8\\u63A5",chartDownload:"\\u4E0B\\u8F09\\u5716\\u8868",histogramFrequency:"\\u983B\\u7387",seriesChartType:"\\u7CFB\\u5217\\u5716\\u8868\\u985E\\u578B",seriesType:"\\u7CFB\\u5217\\u985E\\u578B",secondaryAxis:"\\u6B21\\u8981\\u8EF8",seriesAdd:"\\u6DFB\\u52A0\\u7CFB\\u5217",categoryAdd:"\\u6DFB\\u52A0\\u985E\\u5225",bar:"\\u689D\\u5F62\\u5716",column:"\\u67F1\\u72C0\\u5716",histogram:"\\u76F4\\u65B9\\u5716",advancedSettings:"\\u9AD8\\u7D1A\\u8A2D\\u7F6E",direction:"\\u65B9\\u5411",horizontal:"\\u6C34\\u5E73",vertical:"\\u5782\\u76F4",seriesGroupType:"\\u7D44\\u985E\\u578B",groupedSeriesGroupType:"\\u5206\\u7D44",stackedSeriesGroupType:"\\u5806\\u758A",normalizedSeriesGroupType:"100% \\u5806\\u758A",legendEnabled:"\\u5DF2\\u555F\\u7528",invalidColor:"\\u984F\\u8272\\u503C\\u7121\\u6548",groupedColumnFull:"\\u5206\\u7D44\\u67F1\\u72C0\\u5716",stackedColumnFull:"\\u5806\\u758A\\u67F1\\u72C0\\u5716",normalizedColumnFull:"100% \\u5806\\u758A\\u67F1\\u72C0\\u5716",groupedBarFull:"\\u5206\\u7D44\\u689D\\u5F62\\u5716",stackedBarFull:"\\u5806\\u758A\\u689D\\u5F62\\u5716",normalizedBarFull:"100% \\u5806\\u758A\\u689D\\u5F62\\u5716",stackedAreaFull:"\\u5806\\u758A\\u5340\\u57DF\\u5716",normalizedAreaFull:"100% \\u5806\\u758A\\u5340\\u57DF\\u5716",customCombo:"\\u81EA\\u5B9A\\u7FA9\\u7D44\\u5408",ariaAdvancedFilterBuilderItem:"${variable}\\u3002\\u5C64\\u6B21 ${variable}\\u3002\\u6309 ENTER \\u9032\\u884C\\u7DE8\\u8F2F\\u3002",ariaAdvancedFilterBuilderItemValidation:"${variable}\\u3002\\u5C64\\u6B21 ${variable}\\u3002${variable} \\u6309 ENTER \\u9032\\u884C\\u7DE8\\u8F2F\\u3002",ariaAdvancedFilterBuilderList:"\\u9AD8\\u7D1A\\u7BE9\\u9078\\u5668\\u69CB\\u5EFA\\u5217\\u8868",ariaAdvancedFilterBuilderFilterItem:"\\u7BE9\\u9078\\u689D\\u4EF6",ariaAdvancedFilterBuilderGroupItem:"\\u7BE9\\u9078\\u7D44",ariaAdvancedFilterBuilderColumn:"\\u5217",ariaAdvancedFilterBuilderOption:"\\u9078\\u9805",ariaAdvancedFilterBuilderValueP:"\\u503C",ariaAdvancedFilterBuilderJoinOperator:"\\u9023\\u63A5\\u904B';
      S = S + '\\u7B97\\u7B26",ariaAdvancedFilterInput:"\\u9AD8\\u7D1A\\u7BE9\\u9078\\u5668\\u8F38\\u5165",ariaChecked:"\\u5DF2\\u9078\\u4E2D",ariaColumn:"\\u5217",ariaColumnGroup:"\\u5217\\u7D44",ariaColumnFiltered:"\\u5217\\u88AB\\u7BE9\\u9078",ariaColumnSelectAll:"\\u5207\\u63DB\\u9078\\u64C7\\u6240\\u6709\\u5217",ariaDateFilterInput:"\\u65E5\\u671F\\u7BE9\\u9078\\u5668\\u8F38\\u5165",ariaDefaultListName:"\\u5217\\u8868",ariaFilterColumnsInput:"\\u7BE9\\u9078\\u5217\\u8F38\\u5165",ariaFilterFromValue:"\\u5F9E\\u503C\\u7BE9\\u9078",ariaFilterInput:"\\u7BE9\\u9078\\u5668\\u8F38\\u5165",ariaFilterList:"\\u7BE9\\u9078\\u5217\\u8868",ariaFilterToValue:"\\u7BE9\\u9078\\u5230\\u503C",ariaFilterValue:"\\u7BE9\\u9078\\u503C",ariaFilterMenuOpen:"\\u6253\\u958B\\u7BE9\\u9078\\u83DC\\u55AE",ariaFilteringOperator:"\\u7BE9\\u9078\\u904B\\u7B97\\u7B26",ariaHidden:"\\u5DF2\\u96B1\\u85CF",ariaIndeterminate:"\\u4E0D\\u78BA\\u5B9A",ariaInputEditor:"\\u8F38\\u5165\\u7DE8\\u8F2F\\u5668",ariaMenuColumn:"\\u6309 ALT \\u4E0B\\u7BAD\\u982D \\u6253\\u958B\\u5217\\u83DC\\u55AE",ariaFilterColumn:"\\u6309 CTRL ENTER \\u6253\\u958B\\u7BE9\\u9078\\u5668",ariaRowDeselect:"\\u6309 SPACE \\u53D6\\u6D88\\u9078\\u64C7\\u6B64\\u884C",ariaRowSelectAll:"\\u6309\\u7A7A\\u683C\\u5207\\u63DB\\u6240\\u6709\\u884C\\u7684\\u9078\\u64C7",ariaRowToggleSelection:"\\u6309\\u7A7A\\u683C\\u5207\\u63DB\\u884C\\u9078\\u64C7",ariaRowSelect:"\\u6309 SPACE \\u9078\\u64C7\\u6B64\\u884C",ariaRowSelectionDisabled:"\\u6B64\\u884C\\u7684\\u884C\\u9078\\u64C7\\u5DF2\\u7981\\u7528",ariaSearch:"\\u641C\\u7D22",ariaSortableColumn:"\\u6309 ENTER \\u6392\\u5E8F",ariaToggleVisibility:"\\u6309 SPACE \\u5207\\u63DB\\u53EF\\u898B\\u6027",ariaToggleCellValue:"\\u6309 SPACE \\u5207\\u63DB\\u55AE\\u5143\\u683C\\u503C",ariaUnchecked:"\\u672A\\u9078\\u4E2D",ariaVisible:"\\u53EF\\u898B",ariaSearchFilterValues:"\\u641C\\u7D22\\u7BE9\\u9078\\u503C",ariaPageSizeSelectorLabel:"\\u9801\\u9762\\u5927\\u5C0F",ariaChartMenuClose:"\\u95DC\\u9589\\u5716\\u8868\\u7DE8\\u8F2F\\u83DC\\u55AE",ariaChartSelected:"\\u5DF2\\u9078\\u64C7",ariaSkeletonCellLoadingFailed:"\\u884C\\u52A0\\u8F09\\u5931\\u6557",ariaSkeletonCellLoading:"\\u884C\\u6578\\u64DA\\u52A';
      S = S + '0\\u8F09\\u4E2D",ariaRowGroupDropZonePanelLabel:"\\u884C\\u7FA4\\u7D44",ariaValuesDropZonePanelLabel:"\\u503C",ariaPivotDropZonePanelLabel:"\\u5217\\u6A19\\u7C64",ariaDropZoneColumnComponentDescription:"\\u6309 DELETE \\u4EE5\\u522A\\u9664",ariaDropZoneColumnValueItemDescription:"\\u6309 ENTER \\u4EE5\\u66F4\\u6539\\u805A\\u5408\\u985E\\u578B",ariaDropZoneColumnGroupItemDescription:"\\u6309 ENTER \\u4EE5\\u6392\\u5E8F",ariaDropZoneColumnComponentAggFuncSeparator:" \\u7684 ",ariaDropZoneColumnComponentSortAscending:"\\u5347\\u5E8F",ariaDropZoneColumnComponentSortDescending:"\\u964D\\u5E8F",ariaLabelDialog:"\\u5C0D\\u8A71\\u6846",ariaLabelColumnMenu:"\\u5217\\u9078\\u55AE",ariaLabelColumnFilter:"\\u5217\\u7BE9\\u9078",ariaLabelCellEditor:"\\u5132\\u5B58\\u683C\\u7DE8\\u8F2F\\u5668",ariaLabelSelectField:"\\u9078\\u64C7\\u6B04\\u4F4D",ariaLabelRichSelectField:"\\u8C50\\u5BCC\\u9078\\u64C7\\u6B04\\u4F4D",ariaLabelRichSelectToggleSelection:"\\u6309\\u7A7A\\u683C\\u5207\\u63DB\\u9078\\u64C7",ariaLabelRichSelectDeselectAllItems:"\\u6309Delete\\u9375\\u53D6\\u6D88\\u9078\\u64C7\\u6240\\u6709\\u9805\\u76EE",ariaLabelRichSelectDeleteSelection:"\\u6309Delete\\u9375\\u53D6\\u6D88\\u9078\\u64C7\\u9805\\u76EE",ariaLabelTooltip:"\\u5DE5\\u5177\\u63D0\\u793A",ariaLabelContextMenu:"\\u4E0A\\u4E0B\\u6587\\u9078\\u55AE",ariaLabelSubMenu:"\\u5B50\\u9078\\u55AE",ariaLabelAggregationFunction:"\\u805A\\u5408\\u51FD\\u6578",ariaLabelAdvancedFilterAutocomplete:"\\u9AD8\\u7D1A\\u904E\\u6FFE\\u81EA\\u52D5\\u5B8C\\u6210",ariaLabelAdvancedFilterBuilderAddField:"\\u9AD8\\u7D1A\\u904E\\u6FFE\\u69CB\\u5EFA\\u5668\\u6DFB\\u52A0\\u6B04\\u4F4D",ariaLabelAdvancedFilterBuilderColumnSelectField:"\\u9AD8\\u7D1A\\u904E\\u6FFE\\u69CB\\u5EFA\\u5668\\u5217\\u9078\\u64C7\\u6B04\\u4F4D",ariaLabelAdvancedFilterBuilderOptionSelectField:"\\u9AD8\\u7D1A\\u904E\\u6FFE\\u69CB\\u5EFA\\u5668\\u9078\\u9805\\u9078\\u64C7\\u6B04\\u4F4D",ariaLabelAdvancedFilterBuilderJoinSelectField:"\\u9AD8\\u7D1A\\u904E\\u6FFE\\u69CB\\u5EFA\\u5668\\u9023\\u63A5\\u64CD\\u4F5C\\u7B26\\u9078\\u64C7\\u6B04\\u4F4D",ariaColumnPanelList:"\\u6B04\\u4F4D\\u6E05\\u55AE",ariaFilterPanelList:"\\u7BE9\\u9078\\';
      S = S + 'u6E05\\u55AE",thousandSeparator:",",decimalSeparator:".",true:"\\u771F",false:"\\u5047",invalidDate:"\\u7121\\u6548\\u65E5\\u671F",invalidNumber:"\\u7121\\u6548\\u6578\\u5B57",january:"\\u4E00\\u6708",february:"\\u4E8C\\u6708",march:"\\u4E09\\u6708",april:"\\u56DB\\u6708",may:"\\u4E94\\u6708",june:"\\u516D\\u6708",july:"\\u4E03\\u6708",august:"\\u516B\\u6708",september:"\\u4E5D\\u6708",october:"\\u5341\\u6708",november:"\\u5341\\u4E00\\u6708",december:"\\u5341\\u4E8C\\u6708",timeFormatSlashesDDMMYYYY:"DD/MM/YYYY",timeFormatSlashesMMDDYYYY:"MM/DD/YYYY",timeFormatSlashesDDMMYY:"DD/MM/YY",timeFormatSlashesMMDDYY:"MM/DD/YY",timeFormatDotsDDMYY:"DD.M.YY",timeFormatDotsMDDYY:"M.DD.YY",timeFormatDashesYYYYMMDD:"YYYY-MM-DD",timeFormatSpacesDDMMMMYYYY:"DD MMMM YYYY",timeFormatHHMMSS:"HH:MM:SS",timeFormatHHMMSSAmPm:"HH:MM:SS \\u4E0A\\u5348/\\u4E0B\\u5348"},R={selectAll:"(\\u5168\\u9078)",selectAllSearchResults:"(\\u5168\\u9078\\u641C\\u5C0B\\u7D50\\u679C)",addCurrentSelectionToFilter:"\\u5C07\\u7576\\u524D\\u9078\\u64C7\\u65B0\\u589E\\u5230\\u7BE9\\u9078\\u689D\\u4EF6\\u4E2D",searchOoo:"\\u641C\\u5C0B...",blanks:"(\\u7A7A\\u767D)",noMatches:"\\u7121\\u5339\\u914D\\u9805",filterOoo:"\\u7BE9\\u9078...",equals:"\\u7B49\\u65BC",notEqual:"\\u4E0D\\u7B49\\u65BC",blank:"\\u7A7A\\u767D",notBlank:"\\u975E\\u7A7A\\u767D",empty:"\\u9078\\u64C7\\u4E00\\u500B",lessThan:"\\u5C0F\\u65BC",greaterThan:"\\u5927\\u65BC",lessThanOrEqual:"\\u5C0F\\u65BC\\u6216\\u7B49\\u65BC",greaterThanOrEqual:"\\u5927\\u65BC\\u6216\\u7B49\\u65BC",inRange:"\\u4ECB\\u65BC",inRangeStart:"\\u5F9E",inRangeEnd:"\\u5230",contains:"\\u5305\\u542B",notContains:"\\u4E0D\\u5305\\u542B",startsWith:"\\u958B\\u59CB\\u65BC",endsWith:"\\u7D50\\u675F\\u65BC",dateFormatOoo:"yyyy-mm-dd",before:"\\u4E4B\\u524D",after:"\\u4E4B\\u5F8C",andCondition:"\\u548C",orCondition:"\\u6216",applyFilter:"\\u61C9\\u7528",resetFilter:"\\u91CD\\u7F6E",clearFilter:"\\u6E05\\u9664",cancelFilter:"\\u53D6\\u6D88",textFilter:"\\u6587\\u5B57\\u7BE9\\u9078",numberFilter:"\\u6578\\u5B57\\u7BE9\\u9078",dateFilter:"\\u65E5\\u671F\\u7BE9\\u9078",setFilter:"\\u96C6\\u5408\\u7BE9\\u9078",groupFilterSele';
      S = S + 'ct:"\\u9078\\u64C7\\u5B57\\u6BB5\\uFF1A",advancedFilterContains:"\\u5305\\u542B",advancedFilterNotContains:"\\u4E0D\\u5305\\u542B",advancedFilterTextEquals:"\\u7B49\\u65BC",advancedFilterTextNotEqual:"\\u4E0D\\u7B49\\u65BC",advancedFilterStartsWith:"\\u958B\\u982D\\u662F",advancedFilterEndsWith:"\\u7D50\\u5C3E\\u662F",advancedFilterBlank:"\\u70BA\\u7A7A\\u767D",advancedFilterNotBlank:"\\u4E0D\\u70BA\\u7A7A\\u767D",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"\\u70BA\\u771F",advancedFilterFalse:"\\u70BA\\u5047",advancedFilterAnd:"\\u548C",advancedFilterOr:"\\u6216",advancedFilterApply:"\\u61C9\\u7528",advancedFilterBuilder:"\\u69CB\\u5EFA\\u5668",advancedFilterValidationMissingColumn:"\\u7F3A\\u5C11\\u6B04\\u4F4D",advancedFilterValidationMissingOption:"\\u7F3A\\u5C11\\u9078\\u9805",advancedFilterValidationMissingValue:"\\u7F3A\\u5C11\\u503C",advancedFilterValidationInvalidColumn:"\\u627E\\u4E0D\\u5230\\u6B04\\u4F4D",advancedFilterValidationInvalidOption:"\\u627E\\u4E0D\\u5230\\u9078\\u9805",advancedFilterValidationMissingQuote:"\\u503C\\u7F3A\\u5C11\\u7D50\\u5C3E\\u5F15\\u865F",advancedFilterValidationNotANumber:"\\u503C\\u4E0D\\u662F\\u6578\\u5B57",advancedFilterValidationInvalidDate:"\\u503C\\u4E0D\\u662F\\u6709\\u6548\\u7684\\u65E5\\u671F",advancedFilterValidationMissingCondition:"\\u7F3A\\u5C11\\u689D\\u4EF6",advancedFilterValidationJoinOperatorMismatch:"\\u689D\\u4EF6\\u5167\\u7684\\u9023\\u63A5\\u64CD\\u4F5C\\u7B26\\u5FC5\\u9808\\u4E00\\u81F4",advancedFilterValidationInvalidJoinOperator:"\\u627E\\u4E0D\\u5230\\u9023\\u63A5\\u64CD\\u4F5C\\u7B26",advancedFilterValidationMissingEndBracket:"\\u7F3A\\u5C11\\u7D50\\u5C3E\\u62EC\\u865F",advancedFilterValidationExtraEndBracket:"\\u7D50\\u5C3E\\u62EC\\u865F\\u904E\\u591A",advancedFilterValidationMessage:"\\u8868\\u9054\\u5F0F\\u6709\\u932F\\u8AA4\\u3002${variable} - ${variable}\\u3002",advancedFilterValidationMessageAtEnd:"\\u8868\\u9054\\u5F0F\\u6709\\u932F\\u8AA4\\u3002${variable} \\u5728\\u886';
      S = S + '8\\u9054\\u5F0F\\u7D50\\u5C3E\\u3002",advancedFilterBuilderTitle:"\\u9032\\u968E\\u7BE9\\u9078",advancedFilterBuilderApply:"\\u61C9\\u7528",advancedFilterBuilderCancel:"\\u53D6\\u6D88",advancedFilterBuilderAddButtonTooltip:"\\u6DFB\\u52A0\\u7BE9\\u9078\\u6216\\u7FA4\\u7D44",advancedFilterBuilderRemoveButtonTooltip:"\\u79FB\\u9664",advancedFilterBuilderMoveUpButtonTooltip:"\\u4E0A\\u79FB",advancedFilterBuilderMoveDownButtonTooltip:"\\u4E0B\\u79FB",advancedFilterBuilderAddJoin:"\\u6DFB\\u52A0\\u7FA4\\u7D44",advancedFilterBuilderAddCondition:"\\u6DFB\\u52A0\\u7BE9\\u9078",advancedFilterBuilderSelectColumn:"\\u9078\\u64C7\\u6B04\\u4F4D",advancedFilterBuilderSelectOption:"\\u9078\\u64C7\\u9078\\u9805",advancedFilterBuilderEnterValue:"\\u8F38\\u5165\\u503C...",advancedFilterBuilderValidationAlreadyApplied:"\\u7576\\u524D\\u7BE9\\u9078\\u5DF2\\u61C9\\u7528\\u3002",advancedFilterBuilderValidationIncomplete:"\\u4E26\\u975E\\u6240\\u6709\\u689D\\u4EF6\\u90FD\\u5DF2\\u5B8C\\u6210\\u3002",advancedFilterBuilderValidationSelectColumn:"\\u5FC5\\u9808\\u9078\\u64C7\\u4E00\\u500B\\u6B04\\u4F4D\\u3002",advancedFilterBuilderValidationSelectOption:"\\u5FC5\\u9808\\u9078\\u64C7\\u4E00\\u500B\\u9078\\u9805\\u3002",advancedFilterBuilderValidationEnterValue:"\\u5FC5\\u9808\\u8F38\\u5165\\u4E00\\u500B\\u503C\\u3002",columns:"\\u6B04\\u4F4D",filters:"\\u7BE9\\u9078\\u5668",pivotMode:"\\u6A1E\\u7D10\\u5206\\u6790\\u6A21\\u5F0F",groups:"\\u884C\\u5206\\u7D44",rowGroupColumnsEmptyMessage:"\\u62D6\\u52D5\\u5230\\u6B64\\u8655\\u8A2D\\u7F6E\\u884C\\u5206\\u7D44",values:"\\u6578\\u503C",valueColumnsEmptyMessage:"\\u62D6\\u52D5\\u5230\\u6B64\\u8655\\u805A\\u5408",pivots:"\\u6B04\\u4F4D\\u6A19\\u7C64",pivotColumnsEmptyMessage:"\\u62D6\\u52D5\\u5230\\u6B64\\u8655\\u8A2D\\u7F6E\\u6B04\\u4F4D\\u6A19\\u7C64",group:"\\u7FA4\\u7D44",rowDragRow:"\\u5217",rowDragRows:"\\u5217",loadingOoo:"\\u52A0\\u8F09\\u4E2D...",loadingError:"\\u932F\\u8AA4",noRowsToShow:"\\u7121\\u986F\\u793A\\u884C",enabled:"\\u5DF2\\u555F\\u7528",pinColumn:"\\u56FA\\u5B9A\\u6B04\\u4F4D",pinLeft:"\\u56FA\\u5B9A\\u5728\\u5DE6\\u5074",pinRight:"\\u56FA\\u5B9A\\u5728\\u53F3\\u5074",noPin:"\\u53D6\\u6D88\\u56';
      S = S + 'FA\\u5B9A",valueAggregation:"\\u503C\\u805A\\u5408",noAggregation:"\\u7121",autosizeThisColumn:"\\u81EA\\u9069\\u61C9\\u5217\\u5BEC",autosizeAllColumns:"\\u81EA\\u9069\\u61C9\\u6240\\u6709\\u5217\\u5BEC",groupBy:"\\u4F9D\\u6B64\\u5206\\u7D44",ungroupBy:"\\u53D6\\u6D88\\u5206\\u7D44",ungroupAll:"\\u53D6\\u6D88\\u6240\\u6709\\u5206\\u7D44",addToValues:"\\u6DFB\\u52A0 ${variable} \\u5230\\u503C",removeFromValues:"\\u5F9E\\u503C\\u4E2D\\u79FB\\u9664 ${variable}",addToLabels:"\\u6DFB\\u52A0 ${variable} \\u5230\\u6A19\\u7C64",removeFromLabels:"\\u5F9E\\u6A19\\u7C64\\u4E2D\\u79FB\\u9664 ${variable}",resetColumns:"\\u91CD\\u8A2D\\u5217",expandAll:"\\u5C55\\u958B\\u6240\\u6709\\u5206\\u7D44",collapseAll:"\\u95DC\\u9589\\u6240\\u6709\\u5206\\u7D44",copy:"\\u8907\\u88FD",ctrlC:"Ctrl+C",ctrlX:"Ctrl+X",copyWithHeaders:"\\u8907\\u88FD\\u5305\\u62EC\\u6A19\\u984C",copyWithGroupHeaders:"\\u8907\\u88FD\\u5305\\u62EC\\u5206\\u7D44\\u6A19\\u984C",cut:"\\u526A\\u4E0B",paste:"\\u8CBC\\u4E0A",ctrlV:"Ctrl+V",export:"\\u532F\\u51FA",csvExport:"\\u532F\\u51FA CSV",excelExport:"\\u532F\\u51FA Excel",columnFilter:"\\u5217\\u904E\\u6FFE\\u5668",columnChooser:"\\u9078\\u64C7\\u5217",sortAscending:"\\u5347\\u5E8F\\u6392\\u5217",sortDescending:"\\u964D\\u5E8F\\u6392\\u5217",sortUnSort:"\\u6E05\\u9664\\u6392\\u5217",sum:"\\u7E3D\\u548C",first:"\\u7B2C\\u4E00\\u500B",last:"\\u6700\\u5F8C\\u4E00\\u500B",min:"\\u6700\\u5C0F\\u503C",max:"\\u6700\\u5927\\u503C",none:"\\u7121",count:"\\u6578\\u91CF",avg:"\\u5E73\\u5747\\u503C",filteredRows:"\\u5DF2\\u7BE9\\u9078",selectedRows:"\\u5DF2\\u9078\\u64C7",totalRows:"\\u7E3D\\u884C\\u6578",totalAndFilteredRows:"\\u884C",more:"\\u66F4\\u591A",to:"\\u81F3",of:"\\u7684",page:"\\u9801",pageLastRowUnknown:"?",nextPage:"\\u4E0B\\u4E00\\u9801",lastPage:"\\u6700\\u5F8C\\u4E00\\u9801",firstPage:"\\u7B2C\\u4E00\\u9801",previousPage:"\\u4E0A\\u4E00\\u9801",pageSizeSelectorLabel:"\\u9801\\u5927\\u5C0F\\uFF1A",footerTotal:"\\u7E3D\\u6578",pivotColumnGroupTotals:"\\u7E3D\\u8A08",pivotChartAndPivotMode:"\\u6A1E\\u8EF8\\u5716\\u8207\\u6A1E\\u8EF8\\u6A21\\u5F0F",pivotChart:"\\u6A1E\\u8EF8\\u5716",chartRange:"\\u5716\\u8868\\u7BC4\\u570D",columnChart:"\\u521';
      S = S + '7",groupedColumn:"\\u5206\\u7D44",stackedColumn:"\\u5806\\u758A",normalizedColumn:"100% \\u5806\\u758A",barChart:"\\u689D\\u5F62",groupedBar:"\\u5206\\u7D44",stackedBar:"\\u5806\\u758A",normalizedBar:"100% \\u5806\\u758A",pieChart:"\\u5713\\u9905\\u5716",pie:"\\u5713\\u9905\\u5716",donut:"\\u751C\\u751C\\u5708\\u5716",line:"\\u6298\\u7DDA\\u5716",xyChart:"X Y (\\u6563\\u9EDE\\u5716)",scatter:"\\u6563\\u9EDE\\u5716",bubble:"\\u6C23\\u6CE1\\u5716",areaChart:"\\u5340\\u57DF\\u5716",area:"\\u5340\\u57DF\\u5716",stackedArea:"\\u5806\\u758A",normalizedArea:"100% \\u5806\\u758A",histogramChart:"\\u76F4\\u65B9\\u5716",polarChart:"\\u6975\\u5730\\u5716",radarLine:"\\u96F7\\u9054\\u7DDA",radarArea:"\\u96F7\\u9054\\u9762",nightingale:"\\u5357\\u4E01\\u683C\\u723E\\u73AB\\u7470\\u5716",radialColumn:"\\u8F3B\\u5C04\\u5217\\u67F1",radialBar:"\\u8F3B\\u5C04\\u689D\\u5F62",statisticalChart:"\\u7D71\\u8A08\\u5716",boxPlot:"\\u7BB1\\u578B\\u5716",rangeBar:"\\u7BC4\\u570D\\u689D\\u5F62\\u5716",rangeArea:"\\u7BC4\\u570D\\u5340\\u57DF\\u5716",hierarchicalChart:"\\u5C64\\u6B21\\u5716",treemap:"\\u6A39\\u72C0\\u5716",sunburst:"\\u65ED\\u65E5\\u5716",specializedChart:"\\u5C08\\u9580\\u5716\\u8868",waterfall:"\\u7011\\u5E03\\u5716",heatmap:"\\u71B1\\u5716",combinationChart:"\\u7D44\\u5408\\u5716",columnLineCombo:"\\u5217\\u8207\\u6298\\u7DDA",AreaColumnCombo:"\\u5340\\u57DF\\u8207\\u5217",pivotChartTitle:"\\u6A1E\\u7D10\\u5716",rangeChartTitle:"\\u7BC4\\u570D\\u5716",settings:"\\u5716\\u8868",data:"\\u8A2D\\u5B9A",format:"\\u81EA\\u8A02",categories:"\\u985E\\u5225",defaultCategory:"(\\u7121)",series:"\\u7CFB\\u5217",switchCategorySeries:"\\u5207\\u63DB\\u985E\\u5225/\\u7CFB\\u5217",categoryValues:"\\u985E\\u5225\\u503C",seriesLabels:"\\u7CFB\\u5217\\u6A19\\u7C64",aggregate:"\\u5F59\\u7E3D",xyValues:"X Y \\u503C",paired:"\\u914D\\u5C0D\\u6A21\\u5F0F",axis:"\\u8EF8",xAxis:"\\u6C34\\u5E73\\u8EF8",yAxis:"\\u5782\\u76F4\\u8EF8",polarAxis:"\\u6975\\u8EF8",radiusAxis:"\\u534A\\u5F91\\u8EF8",navigator:"\\u5C0E\\u89BD\\u5668",zoom:"\\u7E2E\\u653E",animation:"\\u52D5\\u756B",crosshair:"\\u6E96\\u661F",color:"\\u984F\\u8272",thickness:"\\u539A\\u5EA6",preferredLength:"\\u9996\\u9';
      S = S + '078\\u9577\\u5EA6",xType:"X \\u985E\\u578B",axisType:"\\u8EF8\\u985E\\u578B",automatic:"\\u81EA\\u52D5",category:"\\u985E\\u5225",number:"\\u6578\\u5B57",time:"\\u6642\\u9593",timeFormat:"\\u6642\\u9593\\u683C\\u5F0F",autoRotate:"\\u81EA\\u52D5\\u65CB\\u8F49",labelRotation:"\\u65CB\\u8F49",circle:"\\u5713\\u5F62",polygon:"\\u591A\\u908A\\u5F62",square:"\\u65B9\\u5F62",cross:"\\u5341\\u5B57\\u5F62",diamond:"\\u83F1\\u5F62",plus:"\\u52A0\\u865F",triangle:"\\u4E09\\u89D2\\u5F62",heart:"\\u5FC3\\u5F62",orientation:"\\u65B9\\u5411",fixed:"\\u56FA\\u5B9A",parallel:"\\u5E73\\u884C",perpendicular:"\\u5782\\u76F4",radiusAxisPosition:"\\u4F4D\\u7F6E",ticks:"\\u523B\\u5EA6",gridLines:"\\u7DB2\\u683C\\u7DDA",width:"\\u5BEC\\u5EA6",height:"\\u9AD8\\u5EA6",length:"\\u9577\\u5EA6",padding:"\\u586B\\u5145",spacing:"\\u9593\\u8DDD",chartStyle:"\\u5716\\u8868\\u6A23\\u5F0F",title:"\\u6A19\\u984C",chartTitles:"\\u6A19\\u984C",chartTitle:"\\u5716\\u8868\\u6A19\\u984C",chartSubtitle:"\\u526F\\u6A19\\u984C",horizontalAxisTitle:"\\u6C34\\u5E73\\u8EF8\\u6A19\\u984C",verticalAxisTitle:"\\u5782\\u76F4\\u8EF8\\u6A19\\u984C",polarAxisTitle:"\\u6975\\u8EF8\\u6A19\\u984C",titlePlaceholder:"\\u5716\\u8868\\u6A19\\u984C",background:"\\u80CC\\u666F",font:"\\u5B57\\u9AD4",weight:"\\u7C97\\u7D30",top:"\\u4E0A",right:"\\u53F3",bottom:"\\u4E0B",left:"\\u5DE6",labels:"\\u6A19\\u7C64",calloutLabels:"\\u7A81\\u986F\\u6A19\\u7C64",sectorLabels:"\\u5340\\u6BB5\\u6A19\\u7C64",positionRatio:"\\u4F4D\\u7F6E\\u6BD4\\u4F8B",size:"\\u5927\\u5C0F",shape:"\\u5F62\\u72C0",minSize:"\\u6700\\u5C0F\\u5927\\u5C0F",maxSize:"\\u6700\\u5927\\u5927\\u5C0F",legend:"\\u5716\\u4F8B",position:"\\u4F4D\\u7F6E",markerSize:"\\u6A19\\u8A18\\u5927\\u5C0F",markerStroke:"\\u6A19\\u8A18\\u63CF\\u908A",markerPadding:"\\u6A19\\u8A18\\u586B\\u5145",itemSpacing:"\\u9805\\u76EE\\u9593\\u8DDD",itemPaddingX:"\\u9805\\u76EE\\u586B\\u5145 X",itemPaddingY:"\\u9805\\u76EE\\u586B\\u5145 Y",layoutHorizontalSpacing:"\\u6C34\\u5E73\\u9593\\u8DDD",layoutVerticalSpacing:"\\u5782\\u76F4\\u9593\\u8DDD",strokeWidth:"\\u63CF\\u908A\\u5BEC\\u5EA6",offset:"\\u504F\\u79FB",offsets:"\\u504F\\u79FB\\u503C",tooltips:"\\u5DE5\\u5177\\u63D0\\u793A';
      S = S + '",callout:"\\u7A81\\u986F",markers:"\\u6A19\\u8A18",shadow:"\\u9670\\u5F71",blur:"\\u6A21\\u7CCA",xOffset:"X \\u504F\\u79FB",yOffset:"Y \\u504F\\u79FB",lineWidth:"\\u7DDA\\u5BEC",lineDash:"\\u865B\\u7DDA",lineDashOffset:"\\u865B\\u7DDA\\u504F\\u79FB",scrollingZoom:"\\u6EFE\\u52D5",scrollingStep:"\\u6EFE\\u52D5\\u6B65\\u4F10",selectingZoom:"\\u9078\\u64C7",durationMillis:"\\u6301\\u7E8C\\u6642\\u9593 (\\u6BEB\\u79D2)",crosshairLabel:"\\u6A19\\u7C64",crosshairSnap:"\\u5C0D\\u9F4A\\u7BC0\\u9EDE",normal:"\\u6B63\\u5E38",bold:"\\u7C97\\u9AD4",italic:"\\u659C\\u9AD4",boldItalic:"\\u7C97\\u659C\\u9AD4",predefined:"\\u9810\\u8A2D",fillOpacity:"\\u586B\\u5145\\u4E0D\\u900F\\u660E\\u5EA6",strokeColor:"\\u7DDA\\u689D\\u984F\\u8272",strokeOpacity:"\\u7DDA\\u689D\\u900F\\u660E\\u5EA6",miniChart:"\\u8FF7\\u4F60\\u5716\\u8868",histogramBinCount:"\\u67F1\\u6578",connectorLine:"\\u9023\\u63A5\\u7DDA",seriesItems:"\\u7CFB\\u5217\\u9805\\u76EE",seriesItemType:"\\u9805\\u76EE\\u985E\\u578B",seriesItemPositive:"\\u6B63\\u6578",seriesItemNegative:"\\u8CA0\\u6578",seriesItemLabels:"\\u9805\\u76EE\\u6A19\\u7C64",columnGroup:"\\u67F1\\u5F62\\u5716",barGroup:"\\u689D\\u5F62\\u5716",pieGroup:"\\u5713\\u9905\\u5716",lineGroup:"\\u6298\\u7DDA\\u5716",scatterGroup:"X Y (\\u6563\\u9EDE\\u5716)",areaGroup:"\\u5340\\u57DF\\u5716",polarGroup:"\\u6975\\u5730\\u5716",statisticalGroup:"\\u7D71\\u8A08\\u5716",hierarchicalGroup:"\\u5C64\\u6B21\\u5716",specializedGroup:"\\u5C08\\u696D\\u5716",combinationGroup:"\\u7D44\\u5408\\u5716",groupedColumnTooltip:"\\u5206\\u7D44",stackedColumnTooltip:"\\u5806\\u758A",normalizedColumnTooltip:"100% \\u5806\\u758A",groupedBarTooltip:"\\u5206\\u7D44",stackedBarTooltip:"\\u5806\\u758A",normalizedBarTooltip:"100% \\u5806\\u758A",pieTooltip:"\\u5713\\u9905\\u5716",donutTooltip:"\\u751C\\u751C\\u5708\\u5716",lineTooltip:"\\u6298\\u7DDA\\u5716",groupedAreaTooltip:"\\u9762\\u7A4D\\u5716",stackedAreaTooltip:"\\u5806\\u7A4D\\u9762\\u7A4D\\u5716",normalizedAreaTooltip:"100% \\u5806\\u7A4D\\u9762\\u7A4D\\u5716",scatterTooltip:"\\u6563\\u9EDE\\u5716",bubbleTooltip:"\\u6C23\\u6CE1\\u5716",histogramTooltip:"\\u76F4\\u65B9\\u5716",radialColumnTool';
      S = S + 'tip:"\\u96F7\\u9054\\u67F1\\u5F62\\u5716",radialBarTooltip:"\\u96F7\\u9054\\u689D\\u5F62\\u5716",radarLineTooltip:"\\u96F7\\u9054\\u6298\\u7DDA\\u5716",radarAreaTooltip:"\\u96F7\\u9054\\u9762\\u7A4D\\u5716",nightingaleTooltip:"\\u591C\\u9DAF\\u5716",rangeBarTooltip:"\\u7BC4\\u570D\\u689D\\u5F62\\u5716",rangeAreaTooltip:"\\u7BC4\\u570D\\u5340\\u57DF\\u5716",boxPlotTooltip:"\\u7BB1\\u7DDA\\u5716",treemapTooltip:"\\u6A39\\u72C0\\u5716",sunburstTooltip:"\\u65ED\\u65E5\\u5716",waterfallTooltip:"\\u7011\\u5E03\\u5716",heatmapTooltip:"\\u71B1\\u5716",columnLineComboTooltip:"\\u67F1\\u5F62 & \\u6298\\u7DDA\\u5716",areaColumnComboTooltip:"\\u5340\\u57DF & \\u67F1\\u5F62\\u5716",customComboTooltip:"\\u81EA\\u8A02\\u7D44\\u5408\\u5716",innerRadius:"\\u5167\\u534A\\u5F91",startAngle:"\\u8D77\\u59CB\\u89D2\\u5EA6",endAngle:"\\u7D42\\u6B62\\u89D2\\u5EA6",reverseDirection:"\\u9006\\u5411",groupPadding:"\\u7D44\\u586B\\u5145\\u91CF",seriesPadding:"\\u7CFB\\u5217\\u586B\\u5145\\u91CF",tile:"\\u5E73\\u92EA",whisker:"\\u9B1A\\u72C0\\u5716",cap:"\\u5E3D\\u7AEF",capLengthRatio:"\\u5E3D\\u7AEF\\u9577\\u5EA6\\u6BD4",labelPlacement:"\\u6A19\\u7C64\\u653E\\u7F6E",inside:"\\u5167\\u90E8",outside:"\\u5916\\u90E8",noDataToChart:"\\u6C92\\u6709\\u53EF\\u4F5C\\u5716\\u7684\\u6578\\u64DA\\u3002",pivotChartRequiresPivotMode:"\\u6A1E\\u7D10\\u5716\\u9700\\u8981\\u555F\\u7528\\u6A1E\\u7D10\\u6A21\\u5F0F\\u3002",chartSettingsToolbarTooltip:"\\u83DC\\u55AE",chartLinkToolbarTooltip:"\\u93C8\\u63A5\\u5230\\u683C\\u7DDA",chartUnlinkToolbarTooltip:"\\u5F9E\\u683C\\u7DDA\\u53D6\\u6D88\\u93C8\\u63A5",chartDownloadToolbarTooltip:"\\u4E0B\\u8F09\\u5716\\u8868",chartMenuToolbarTooltip:"\\u83DC\\u55AE",chartEdit:"\\u7DE8\\u8F2F\\u5716\\u8868",chartAdvancedSettings:"\\u9AD8\\u7D1A\\u8A2D\\u7F6E",chartLink:"\\u93C8\\u63A5\\u5230\\u683C\\u7DDA",chartUnlink:"\\u5F9E\\u683C\\u7DDA\\u53D6\\u6D88\\u93C8\\u63A5",chartDownload:"\\u4E0B\\u8F09\\u5716\\u8868",histogramFrequency:"\\u983B\\u7387",seriesChartType:"\\u7CFB\\u5217\\u5716\\u8868\\u985E\\u578B",seriesType:"\\u7CFB\\u5217\\u985E\\u578B",secondaryAxis:"\\u6B21\\u8EF8",seriesAdd:"\\u6DFB\\u52A0\\u7CFB\\u5217",categoryAdd:"\\u6DFB\\u52A0\\u985E\\u5225",';
      S = S + 'bar:"\\u689D\\u5F62\\u5716",column:"\\u67F1\\u5F62\\u5716",histogram:"\\u76F4\\u65B9\\u5716",advancedSettings:"\\u9AD8\\u7D1A\\u8A2D\\u7F6E",direction:"\\u65B9\\u5411",horizontal:"\\u6C34\\u5E73",vertical:"\\u5782\\u76F4",seriesGroupType:"\\u7D44\\u985E\\u578B",groupedSeriesGroupType:"\\u5206\\u7D44",stackedSeriesGroupType:"\\u5806\\u758A",normalizedSeriesGroupType:"100% \\u5806\\u758A",legendEnabled:"\\u555F\\u7528",invalidColor:"\\u984F\\u8272\\u503C\\u7121\\u6548",groupedColumnFull:"\\u5206\\u7D44\\u67F1\\u5F62\\u5716",stackedColumnFull:"\\u5806\\u758A\\u67F1\\u5F62\\u5716",normalizedColumnFull:"100% \\u5806\\u758A\\u67F1\\u5F62\\u5716",groupedBarFull:"\\u5206\\u7D44\\u689D\\u5F62\\u5716",stackedBarFull:"\\u5806\\u758A\\u689D\\u5F62\\u5716",normalizedBarFull:"100% \\u5806\\u758A\\u689D\\u5F62\\u5716",stackedAreaFull:"\\u5806\\u7A4D\\u9762\\u7A4D\\u5716",normalizedAreaFull:"100% \\u5806\\u7A4D\\u9762\\u7A4D\\u5716",customCombo:"\\u81EA\\u8A02\\u7D44\\u5408\\u5716",ariaAdvancedFilterBuilderItem:"${variable}\\u3002\\u7D1A\\u5225 ${variable}\\u3002\\u6309 ENTER \\u9375\\u7DE8\\u8F2F\\u3002",ariaAdvancedFilterBuilderItemValidation:"${variable}\\u3002\\u7D1A\\u5225 ${variable}\\u3002${variable} \\u6309 ENTER \\u9375\\u7DE8\\u8F2F\\u3002",ariaAdvancedFilterBuilderList:"\\u9032\\u968E\\u7BE9\\u9078\\u5668\\u69CB\\u5EFA\\u5668\\u5217\\u8868",ariaAdvancedFilterBuilderFilterItem:"\\u7BE9\\u9078\\u689D\\u4EF6",ariaAdvancedFilterBuilderGroupItem:"\\u7BE9\\u9078\\u7D44",ariaAdvancedFilterBuilderColumn:"\\u6B04",ariaAdvancedFilterBuilderOption:"\\u9078\\u9805",ariaAdvancedFilterBuilderValueP:"\\u503C",ariaAdvancedFilterBuilderJoinOperator:"\\u9023\\u63A5\\u904B\\u7B97\\u5B50",ariaAdvancedFilterInput:"\\u9032\\u968E\\u7BE9\\u9078\\u8F38\\u5165",ariaChecked:"\\u5DF2\\u52FE\\u9078",ariaColumn:"\\u6B04",ariaColumnGroup:"\\u6B04\\u7D44",ariaColumnFiltered:"\\u6B04\\u5DF2\\u7BE9\\u9078",ariaColumnSelectAll:"\\u5207\\u63DB\\u9078\\u53D6\\u6240\\u6709\\u6B04",ariaDateFilterInput:"\\u65E5\\u671F\\u7BE9\\u9078\\u8F38\\u5165",ariaDefaultListName:"\\u5217\\u8868",ariaFilterColumnsInput:"\\u7BE9\\u9078\\u6B04\\u8F38\\u5165",ariaFilterFromValue:"\\u';
      S = S + '5F9E\\u503C\\u7BE9\\u9078",ariaFilterInput:"\\u7BE9\\u9078\\u8F38\\u5165",ariaFilterList:"\\u7BE9\\u9078\\u5217\\u8868",ariaFilterToValue:"\\u7BE9\\u9078\\u5230\\u503C",ariaFilterValue:"\\u7BE9\\u9078\\u503C",ariaFilterMenuOpen:"\\u6253\\u958B\\u7BE9\\u9078\\u5668\\u9078\\u55AE",ariaFilteringOperator:"\\u7BE9\\u9078\\u904B\\u7B97\\u5B50",ariaHidden:"\\u96B1\\u85CF",ariaIndeterminate:"\\u4E0D\\u78BA\\u5B9A",ariaInputEditor:"\\u8F38\\u5165\\u7DE8\\u8F2F\\u5668",ariaMenuColumn:"\\u6309 ALT + DOWN \\u9375\\u6253\\u958B\\u6B04\\u9078\\u55AE",ariaFilterColumn:"\\u6309 CTRL + ENTER \\u9375\\u6253\\u958B\\u7BE9\\u9078",ariaRowDeselect:"\\u6309 SPACE \\u9375\\u53D6\\u6D88\\u9078\\u53D6\\u6B64\\u884C",ariaRowSelectAll:"\\u6309 SPACE \\u9375\\u5207\\u63DB\\u6240\\u6709\\u884C\\u7684\\u9078\\u64C7",ariaRowToggleSelection:"\\u6309 SPACE \\u9375\\u5207\\u63DB\\u884C\\u7684\\u9078\\u64C7",ariaRowSelect:"\\u6309 SPACE \\u9375\\u9078\\u53D6\\u6B64\\u884C",ariaRowSelectionDisabled:"\\u6B64\\u884C\\u5DF2\\u7981\\u7528\\u884C\\u9078\\u64C7",ariaSearch:"\\u641C\\u5C0B",ariaSortableColumn:"\\u6309 ENTER \\u9375\\u6392\\u5E8F",ariaToggleVisibility:"\\u6309 SPACE \\u9375\\u5207\\u63DB\\u53EF\\u898B\\u6027",ariaToggleCellValue:"\\u6309 SPACE \\u9375\\u5207\\u63DB\\u55AE\\u5143\\u683C\\u503C",ariaUnchecked:"\\u672A\\u52FE\\u9078",ariaVisible:"\\u53EF\\u898B",ariaSearchFilterValues:"\\u641C\\u5C0B\\u7BE9\\u9078\\u503C",ariaPageSizeSelectorLabel:"\\u6BCF\\u9801\\u5927\\u5C0F",ariaChartMenuClose:"\\u95DC\\u9589\\u5716\\u8868\\u7DE8\\u8F2F\\u9078\\u55AE",ariaChartSelected:"\\u5DF2\\u9078\\u64C7",ariaSkeletonCellLoadingFailed:"\\u884C\\u52A0\\u8F09\\u5931\\u6557",ariaSkeletonCellLoading:"\\u884C\\u6578\\u64DA\\u52A0\\u8F09\\u4E2D",ariaRowGroupDropZonePanelLabel:"\\u884C\\u7FA4\\u7D44",ariaValuesDropZonePanelLabel:"\\u6578\\u503C",ariaPivotDropZonePanelLabel:"\\u5217\\u6A19\\u7C64",ariaDropZoneColumnComponentDescription:"\\u6309 DELETE \\u522A\\u9664",ariaDropZoneColumnValueItemDescription:"\\u6309 ENTER \\u66F4\\u6539\\u805A\\u5408\\u985E\\u578B",ariaDropZoneColumnGroupItemDescription:"\\u6309 ENTER \\u6392\\u5E8F",ariaDropZoneColumnComponentAggFuncSeparator:" \\u7';
      S = S + '684 ",ariaDropZoneColumnComponentSortAscending:"\\u5347\\u5E8F",ariaDropZoneColumnComponentSortDescending:"\\u964D\\u5E8F",ariaLabelDialog:"\\u5C0D\\u8A71\\u6846",ariaLabelColumnMenu:"\\u6B04\\u4F4D\\u9078\\u55AE",ariaLabelColumnFilter:"\\u6B04\\u4F4D\\u7BE9\\u9078\\u5668",ariaLabelCellEditor:"\\u5132\\u5B58\\u683C\\u7DE8\\u8F2F\\u5668",ariaLabelSelectField:"\\u9078\\u64C7\\u6B04\\u4F4D",ariaLabelRichSelectField:"\\u8C50\\u5BCC\\u9078\\u64C7\\u5B57\\u6BB5",ariaLabelRichSelectToggleSelection:"\\u6309\\u4E0B\\u7A7A\\u683C\\u9375\\u4EE5\\u5207\\u63DB\\u9078\\u64C7",ariaLabelRichSelectDeselectAllItems:"\\u6309\\u4E0B\\u522A\\u9664\\u9375\\u4EE5\\u53D6\\u6D88\\u9078\\u64C7\\u6240\\u6709\\u9805\\u76EE",ariaLabelRichSelectDeleteSelection:"\\u6309\\u4E0B\\u522A\\u9664\\u9375\\u4EE5\\u53D6\\u6D88\\u9078\\u64C7\\u9805\\u76EE",ariaLabelTooltip:"\\u5DE5\\u5177\\u63D0\\u793A",ariaLabelContextMenu:"\\u4E0A\\u4E0B\\u6587\\u83DC\\u55AE",ariaLabelSubMenu:"\\u5B50\\u83DC\\u55AE",ariaLabelAggregationFunction:"\\u805A\\u5408\\u51FD\\u6578",ariaLabelAdvancedFilterAutocomplete:"\\u9AD8\\u7D1A\\u904E\\u6FFE\\u81EA\\u52D5\\u5B8C\\u6210",ariaLabelAdvancedFilterBuilderAddField:"\\u9AD8\\u7D1A\\u904E\\u6FFE\\u69CB\\u5EFA\\u5668\\u6DFB\\u52A0\\u5B57\\u6BB5",ariaLabelAdvancedFilterBuilderColumnSelectField:"\\u9AD8\\u7D1A\\u904E\\u6FFE\\u69CB\\u5EFA\\u5668\\u5217\\u9078\\u64C7\\u5B57\\u6BB5",ariaLabelAdvancedFilterBuilderOptionSelectField:"\\u9AD8\\u7D1A\\u904E\\u6FFE\\u69CB\\u5EFA\\u5668\\u9078\\u9805\\u9078\\u64C7\\u5B57\\u6BB5",ariaLabelAdvancedFilterBuilderJoinSelectField:"\\u9AD8\\u7D1A\\u904E\\u6FFE\\u69CB\\u5EFA\\u5668\\u806F\\u63A5\\u904B\\u7B97\\u7B26\\u9078\\u64C7\\u5B57\\u6BB5",ariaColumnPanelList:"\\u6B04\\u4F4D\\u5217\\u8868",ariaFilterPanelList:"\\u7BE9\\u9078\\u5217\\u8868",thousandSeparator:",",decimalSeparator:".",true:"\\u771F",false:"\\u5047",invalidDate:"\\u7121\\u6548\\u65E5\\u671F",invalidNumber:"\\u7121\\u6548\\u6578\\u5B57",january:"\\u4E00\\u6708",february:"\\u4E8C\\u6708",march:"\\u4E09\\u6708",april:"\\u56DB\\u6708",may:"\\u4E94\\u6708",june:"\\u516D\\u6708",july:"\\u4E03\\u6708",august:"\\u516B\\u6708",september:"\\u4E5D\\u6708",october:"\\u5341';
      S = S + '\\u6708",november:"\\u5341\\u4E00\\u6708",december:"\\u5341\\u4E8C\\u6708",timeFormatSlashesDDMMYYYY:"DD/MM/YYYY",timeFormatSlashesMMDDYYYY:"MM/DD/YYYY",timeFormatSlashesDDMMYY:"DD/MM/YY",timeFormatSlashesMMDDYY:"MM/DD/YY",timeFormatDotsDDMYY:"DD.M.YY",timeFormatDotsMDDYY:"M.DD.YY",timeFormatDashesYYYYMMDD:"YYYY-MM-DD",timeFormatSpacesDDMMMMYYYY:"DD MMMM YYYY",timeFormatHHMMSS:"HH:MM:SS",timeFormatHHMMSSAmPm:"HH:MM:SS AM/PM"},V={selectAll:"(Seleccionar todo)",selectAllSearchResults:"(Seleccionar todos los resultados de la b\\xFAsqueda)",addCurrentSelectionToFilter:"Agregar selecci\\xF3n actual al filtro",searchOoo:"Buscar...",blanks:"(Vac\\xEDos)",noMatches:"Sin coincidencias",filterOoo:"Filtro...",equals:"Igual a",notEqual:"No igual a",blank:"En blanco",notBlank:"No en blanco",empty:"Elige uno",lessThan:"Menos que",greaterThan:"M\\xE1s que",lessThanOrEqual:"Menos o igual que",greaterThanOrEqual:"M\\xE1s o igual que",inRange:"Entre",inRangeStart:"Desde",inRangeEnd:"Hasta",contains:"Contiene",notContains:"No contiene",startsWith:"Empieza con",endsWith:"Termina con",dateFormatOoo:"yyyy-mm-dd",before:"Antes",after:"Despu\\xE9s",andCondition:"Y",orCondition:"O",applyFilter:"Aplicar",resetFilter:"Reiniciar",clearFilter:"Borrar",cancelFilter:"Cancelar",textFilter:"Filtro de Texto",numberFilter:"Filtro de N\\xFAmeros",dateFilter:"Filtro de Fecha",setFilter:"Filtro de Conjunto",groupFilterSelect:"Seleccionar campo:",advancedFilterContains:"contiene",advancedFilterNotContains:"no contiene",advancedFilterTextEquals:"es igual a",advancedFilterTextNotEqual:"no es igual a",advancedFilterStartsWith:"comienza con",advancedFilterEndsWith:"termina con",advancedFilterBlank:"est\\xE1 en blanco",advancedFilterNotBlank:"no est\\xE1 en blanco",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"es verdadero",advancedFilterFalse:"es falso",advancedFilterAn';
      S = S + 'd:"Y",advancedFilterOr:"O",advancedFilterApply:"Aplicar",advancedFilterBuilder:"Constructor",advancedFilterValidationMissingColumn:"Falta la columna",advancedFilterValidationMissingOption:"Falta la opci\\xF3n",advancedFilterValidationMissingValue:"Falta el valor",advancedFilterValidationInvalidColumn:"Columna no encontrada",advancedFilterValidationInvalidOption:"Opci\\xF3n no encontrada",advancedFilterValidationMissingQuote:"Falta una comilla de cierre",advancedFilterValidationNotANumber:"El valor no es un n\\xFAmero",advancedFilterValidationInvalidDate:"El valor no es una fecha v\\xE1lida",advancedFilterValidationMissingCondition:"Falta la condici\\xF3n",advancedFilterValidationJoinOperatorMismatch:"Los operadores de uni\\xF3n dentro de una condici\\xF3n deben ser los mismos",advancedFilterValidationInvalidJoinOperator:"Operador de uni\\xF3n no encontrado",advancedFilterValidationMissingEndBracket:"Falta par\\xE9ntesis de cierre",advancedFilterValidationExtraEndBracket:"Demasiados par\\xE9ntesis de cierre",advancedFilterValidationMessage:"La expresi\\xF3n contiene un error. ${variable} - ${variable}.",advancedFilterValidationMessageAtEnd:"La expresi\\xF3n contiene un error. ${variable} al final de la expresi\\xF3n.",advancedFilterBuilderTitle:"Filtro Avanzado",advancedFilterBuilderApply:"Aplicar",advancedFilterBuilderCancel:"Cancelar",advancedFilterBuilderAddButtonTooltip:"A\\xF1adir filtro o grupo",advancedFilterBuilderRemoveButtonTooltip:"Eliminar",advancedFilterBuilderMoveUpButtonTooltip:"Mover arriba",advancedFilterBuilderMoveDownButtonTooltip:"Mover abajo",advancedFilterBuilderAddJoin:"A\\xF1adir Grupo",advancedFilterBuilderAddCondition:"A\\xF1adir Filtro",advancedFilterBuilderSelectColumn:"Selecciona una columna",advancedFilterBuilderSelectOption:"Selecciona una opci\\xF3n",advancedFilterBuilderEnterValue:"Introduce un valor...",advancedFilterBuilderValidationAlreadyApplied:"Filtro actual ya aplicado.",advancedFilterBuilderValidationIncomplete:"No todas las condiciones est\\xE';
      S = S + '1n completas.",advancedFilterBuilderValidationSelectColumn:"Debe seleccionar una columna.",advancedFilterBuilderValidationSelectOption:"Debe seleccionar una opci\\xF3n.",advancedFilterBuilderValidationEnterValue:"Debe introducir un valor.",columns:"Columnas",filters:"Filtros",pivotMode:"Modo Pivot",groups:"Grupos de Filas",rowGroupColumnsEmptyMessage:"Arrastre aqu\\xED para establecer los grupos de filas",values:"Valores",valueColumnsEmptyMessage:"Arrastre aqu\\xED para agregar",pivots:"Etiquetas de Columna",pivotColumnsEmptyMessage:"Arrastre aqu\\xED para establecer las etiquetas de columna",group:"Grupo",rowDragRow:"fila",rowDragRows:"filas",loadingOoo:"Cargando...",loadingError:"ERR",noRowsToShow:"No hay filas para mostrar",enabled:"Habilitado",pinColumn:"Fijar Columna",pinLeft:"Fijar a la Izquierda",pinRight:"Fijar a la Derecha",noPin:"No Fijar",valueAggregation:"Agregaci\\xF3n de Valores",noAggregation:"Ninguna",autosizeThisColumn:"Autoajustar Esta Columna",autosizeAllColumns:"Autoajustar Todas las Columnas",groupBy:"Agrupar por",ungroupBy:"Desagrupar por",ungroupAll:"Desagrupar Todo",addToValues:"A\\xF1adir ${variable} a valores",removeFromValues:"Quitar ${variable} de valores",addToLabels:"A\\xF1adir ${variable} a etiquetas",removeFromLabels:"Quitar ${variable} de etiquetas",resetColumns:"Restablecer Columnas",expandAll:"Expandir Todos los Grupos de Filas",collapseAll:"Cerrar Todos los Grupos de Filas",copy:"Copiar",ctrlC:"Ctrl+C",ctrlX:"Ctrl+X",copyWithHeaders:"Copiar Con Encabezados",copyWithGroupHeaders:"Copiar Con Encabezados de Grupo",cut:"Cortar",paste:"Pegar",ctrlV:"Ctrl+V",export:"Exportar",csvExport:"Exportar CSV",excelExport:"Exportar Excel",columnFilter:"Filtrar Columna",columnChooser:"Elegir Columnas",sortAscending:"Ordenar Ascendente",sortDescending:"Ordenar Descendente",sortUnSort:"Limpiar Orden",sum:"Suma",first:"Primero",last:"\\xDAltimo",min:"M\\xEDnimo",max:"M\\xE1ximo",none:"Ninguno",count:"Cuenta",avg:"Promedio",filteredRows:"Filtrados",selectedRows';
      S = S + ':"Seleccionados",totalRows:"Filas Totales",totalAndFilteredRows:"Filas",more:"M\\xE1s",to:"a",of:"de",page:"P\\xE1gina",pageLastRowUnknown:"?",nextPage:"Siguiente P\\xE1gina",lastPage:"\\xDAltima P\\xE1gina",firstPage:"Primera P\\xE1gina",previousPage:"P\\xE1gina Anterior",pageSizeSelectorLabel:"Tama\\xF1o de P\\xE1gina:",footerTotal:"Total",pivotColumnGroupTotals:"Total",pivotChartAndPivotMode:"Gr\\xE1fico din\\xE1mico y modo din\\xE1mico",pivotChart:"Gr\\xE1fico din\\xE1mico",chartRange:"Rango de gr\\xE1fico",columnChart:"Columna",groupedColumn:"Agrupada",stackedColumn:"Apilada",normalizedColumn:"100% Apilada",barChart:"Barra",groupedBar:"Agrupada",stackedBar:"Apilada",normalizedBar:"100% Apilada",pieChart:"Circular",pie:"Circular",donut:"Rosquilla",line:"L\\xEDnea",xyChart:"X Y (Dispersi\\xF3n)",scatter:"Dispersi\\xF3n",bubble:"Burbuja",areaChart:"\\xC1rea",area:"\\xC1rea",stackedArea:"Apilada",normalizedArea:"100% Apilada",histogramChart:"Histograma",polarChart:"Polar",radarLine:"L\\xEDnea de radar",radarArea:"\\xC1rea de radar",nightingale:"Nightingale",radialColumn:"Columna radial",radialBar:"Barra radial",statisticalChart:"Estad\\xEDstico",boxPlot:"Gr\\xE1fico de caja",rangeBar:"Barra de rango",rangeArea:"\\xC1rea de rango",hierarchicalChart:"Jer\\xE1rquico",treemap:"Mapa de \\xE1rbol",sunburst:"Explosi\\xF3n solar",specializedChart:"Especializado",waterfall:"Cascada",heatmap:"Mapa de calor",combinationChart:"Combinaci\\xF3n",columnLineCombo:"Columna y l\\xEDnea",AreaColumnCombo:"\\xC1rea y columna",pivotChartTitle:"Gr\\xE1fico de Pivote",rangeChartTitle:"Gr\\xE1fico de Intervalo",settings:"Gr\\xE1fico",data:"Configuraci\\xF3n",format:"Personalizar",categories:"Categor\\xEDas",defaultCategory:"(Ninguna)",series:"Series",switchCategorySeries:"Cambiar Categor\\xEDa / Series",categoryValues:"Valores de Categor\\xEDa",seriesLabels:"Etiquetas de Series",aggregate:"Agregado",xyValues:"Valores XY",paired:"Modo Pareado",axis:"Eje",xAxis:"Eje Horizontal",yAxis:"Eje Vertical",polarAxis:"Eje Polar",radiusAx';
      S = S + 'is:"Eje de Radio",navigator:"Navegador",zoom:"Zoom",animation:"Animaci\\xF3n",crosshair:"Ret\\xEDcula",color:"Color",thickness:"Espesor",preferredLength:"Longitud Preferida",xType:"Tipo X",axisType:"Tipo de Eje",automatic:"Autom\\xE1tico",category:"Categor\\xEDa",number:"N\\xFAmero",time:"Tiempo",timeFormat:"Formato de Tiempo",autoRotate:"Rotaci\\xF3n Autom\\xE1tica",labelRotation:"Rotaci\\xF3n",circle:"C\\xEDrculo",polygon:"Pol\\xEDgono",square:"Cuadrado",cross:"Cruz",diamond:"Diamante",plus:"M\\xE1s",triangle:"Tri\\xE1ngulo",heart:"Coraz\\xF3n",orientation:"Orientaci\\xF3n",fixed:"Fijo",parallel:"Paralelo",perpendicular:"Perpendicular",radiusAxisPosition:"Posici\\xF3n",ticks:"Marcas",gridLines:"L\\xEDneas de Cuadr\\xEDcula",width:"Ancho",height:"Altura",length:"Longitud",padding:"Relleno",spacing:"Espaciado",chartStyle:"Estilo de Gr\\xE1fico",title:"T\\xEDtulo",chartTitles:"T\\xEDtulos",chartTitle:"T\\xEDtulo del Gr\\xE1fico",chartSubtitle:"Subt\\xEDtulo",horizontalAxisTitle:"T\\xEDtulo del Eje Horizontal",verticalAxisTitle:"T\\xEDtulo del Eje Vertical",polarAxisTitle:"T\\xEDtulo del Eje Polar",titlePlaceholder:"T\\xEDtulo del Gr\\xE1fico",background:"Fondo",font:"Fuente",weight:"Peso",top:"Superior",right:"Derecha",bottom:"Inferior",left:"Izquierda",labels:"Etiquetas",calloutLabels:"Etiquetas de Llamada",sectorLabels:"Etiquetas de Sector",positionRatio:"Relaci\\xF3n de Posici\\xF3n",size:"Tama\\xF1o",shape:"Forma",minSize:"Tama\\xF1o M\\xEDnimo",maxSize:"Tama\\xF1o M\\xE1ximo",legend:"Leyenda",position:"Posici\\xF3n",markerSize:"Tama\\xF1o del Marcador",markerStroke:"Trazo del Marcador",markerPadding:"Relleno del Marcador",itemSpacing:"Espaciado de \\xCDtems",itemPaddingX:"Relleno X de \\xCDtems",itemPaddingY:"Relleno Y de \\xCDtems",layoutHorizontalSpacing:"Espaciado Horizontal",layoutVerticalSpacing:"Espaciado Vertical",strokeWidth:"Grosor del Trazo",offset:"Desplazamiento",offsets:"Desplazamientos",tooltips:"Informaci\\xF3n sobre herramientas",callout:"Llamada",markers:"Marcadores",shadow:"Sombra",bl';
      S = S + 'ur:"Desenfoque",xOffset:"Desplazamiento X",yOffset:"Desplazamiento Y",lineWidth:"Ancho de L\\xEDnea",lineDash:"L\\xEDnea Discontinua",lineDashOffset:"Desplazamiento de Discontinuidad",scrollingZoom:"Desplazamiento",scrollingStep:"Paso de Desplazamiento",selectingZoom:"Seleccionando",durationMillis:"Duraci\\xF3n (ms)",crosshairLabel:"Etiqueta",crosshairSnap:"Ajustar al Nodo",normal:"Normal",bold:"Negrita",italic:"It\\xE1lica",boldItalic:"Negrita It\\xE1lica",predefined:"Predefinido",fillOpacity:"Opacidad de Relleno",strokeColor:"Color de L\\xEDnea",strokeOpacity:"Opacidad de L\\xEDnea",miniChart:"Mini-Gr\\xE1fico",histogramBinCount:"Conteo de Intervalos",connectorLine:"L\\xEDnea Conectora",seriesItems:"\\xCDtems de Series",seriesItemType:"Tipo de \\xCDtem",seriesItemPositive:"Positivo",seriesItemNegative:"Negativo",seriesItemLabels:"Etiquetas de \\xCDtems",columnGroup:"Columna",barGroup:"Barra",pieGroup:"Torta",lineGroup:"L\\xEDnea",scatterGroup:"XY (Dispersi\\xF3n)",areaGroup:"\\xC1rea",polarGroup:"Polar",statisticalGroup:"Estad\\xEDstico",hierarchicalGroup:"Jer\\xE1rquico",specializedGroup:"Especializado",combinationGroup:"Combinaci\\xF3n",groupedColumnTooltip:"Agrupada",stackedColumnTooltip:"Apilada",normalizedColumnTooltip:"100% Apilada",groupedBarTooltip:"Agrupada",stackedBarTooltip:"Apilada",normalizedBarTooltip:"100% Apilada",pieTooltip:"Torta",donutTooltip:"Donut",lineTooltip:"L\\xEDnea",groupedAreaTooltip:"\\xC1rea",stackedAreaTooltip:"Apilada",normalizedAreaTooltip:"100% Apilada",scatterTooltip:"Dispersi\\xF3n",bubbleTooltip:"Burbuja",histogramTooltip:"Histograma",radialColumnTooltip:"Columna Radial",radialBarTooltip:"Barra Radial",radarLineTooltip:"L\\xEDnea de Radar",radarAreaTooltip:"\\xC1rea de Radar",nightingaleTooltip:"Nightingale",rangeBarTooltip:"Barra de Intervalo",rangeAreaTooltip:"\\xC1rea de Intervalo",boxPlotTooltip:"Diagrama de Cajas",treemapTooltip:"Mapa de \\xC1reas",sunburstTooltip:"Estallido Solar",waterfallTooltip:"Cascada",heatmapTooltip:"Mapa de Calor",columnLi';
      S = S + 'neComboTooltip:"Columna y L\\xEDnea",areaColumnComboTooltip:"\\xC1rea y Columna",customComboTooltip:"Combinaci\\xF3n Personalizada",innerRadius:"Radio Interno",startAngle:"\\xC1ngulo de Inicio",endAngle:"\\xC1ngulo Final",reverseDirection:"Direcci\\xF3n Inversa",groupPadding:"Relleno de Grupo",seriesPadding:"Relleno de Series",tile:"Mosaico",whisker:"Bigote",cap:"Tap\\xF3n",capLengthRatio:"Relaci\\xF3n de Longitud",labelPlacement:"Ubicaci\\xF3n de Etiqueta",inside:"Dentro",outside:"Fuera",noDataToChart:"No hay datos disponibles para graficar.",pivotChartRequiresPivotMode:"El Gr\\xE1fico de Pivote requiere el Modo de Pivote habilitado.",chartSettingsToolbarTooltip:"Men\\xFA",chartLinkToolbarTooltip:"Vinculado a la Cuadr\\xEDcula",chartUnlinkToolbarTooltip:"Desvinculado de la Cuadr\\xEDcula",chartDownloadToolbarTooltip:"Descargar Gr\\xE1fico",chartMenuToolbarTooltip:"Men\\xFA",chartEdit:"Editar Gr\\xE1fico",chartAdvancedSettings:"Configuraci\\xF3n Avanzada",chartLink:"Vincular a la Cuadr\\xEDcula",chartUnlink:"Desvincular de la Cuadr\\xEDcula",chartDownload:"Descargar Gr\\xE1fico",histogramFrequency:"Frecuencia",seriesChartType:"Tipo de Gr\\xE1fico de Series",seriesType:"Tipo de Series",secondaryAxis:"Eje Secundario",seriesAdd:"Agregar una serie",categoryAdd:"Agregar una categor\\xEDa",bar:"Barra",column:"Columna",histogram:"Histograma",advancedSettings:"Configuraci\\xF3n Avanzada",direction:"Direcci\\xF3n",horizontal:"Horizontal",vertical:"Vertical",seriesGroupType:"Tipo de Grupo",groupedSeriesGroupType:"Agrupadas",stackedSeriesGroupType:"Apiladas",normalizedSeriesGroupType:"100% Apiladas",legendEnabled:"Habilitado",invalidColor:"El valor del color es inv\\xE1lido",groupedColumnFull:"Columna Agrupada",stackedColumnFull:"Columna Apilada",normalizedColumnFull:"Columna 100% Apilada",groupedBarFull:"Barra Agrupada",stackedBarFull:"Barra Apilada",normalizedBarFull:"Barra 100% Apilada",stackedAreaFull:"\\xC1rea Apilada",normalizedAreaFull:"\\xC1rea 100% Apilada",customCombo:"Combinaci\\xF3n Personali';
      S = S + 'zada",ariaAdvancedFilterBuilderItem:"${variable}. Nivel ${variable}. Presiona ENTER para editar.",ariaAdvancedFilterBuilderItemValidation:"${variable}. Nivel ${variable}. ${variable} Presiona ENTER para editar.",ariaAdvancedFilterBuilderList:"Lista de Constructor de Filtros Avanzados",ariaAdvancedFilterBuilderFilterItem:"Condici\\xF3n del Filtro",ariaAdvancedFilterBuilderGroupItem:"Grupo de Filtros",ariaAdvancedFilterBuilderColumn:"Columna",ariaAdvancedFilterBuilderOption:"Opci\\xF3n",ariaAdvancedFilterBuilderValueP:"Valor",ariaAdvancedFilterBuilderJoinOperator:"Operador de Uni\\xF3n",ariaAdvancedFilterInput:"Entrada de Filtro Avanzado",ariaChecked:"seleccionado",ariaColumn:"Columna",ariaColumnGroup:"Grupo de Columnas",ariaColumnFiltered:"Columna Filtrada",ariaColumnSelectAll:"Alternar Selecci\\xF3n de Todas las Columnas",ariaDateFilterInput:"Entrada de Filtro de Fecha",ariaDefaultListName:"Lista",ariaFilterColumnsInput:"Entrada de Filtrado de Columnas",ariaFilterFromValue:"Filtrar desde valor",ariaFilterInput:"Entrada de Filtro",ariaFilterList:"Lista de Filtros",ariaFilterToValue:"Filtrar hasta valor",ariaFilterValue:"Valor del Filtro",ariaFilterMenuOpen:"Abrir Men\\xFA de Filtros",ariaFilteringOperator:"Operador de Filtrado",ariaHidden:"oculto",ariaIndeterminate:"indeterminado",ariaInputEditor:"Editor de Entrada",ariaMenuColumn:"Presiona ALT ABAJO para abrir el men\\xFA de la columna",ariaFilterColumn:"Presiona CTRL ENTER para abrir el filtro",ariaRowDeselect:"Presiona SPACE para anular la selecci\\xF3n de esta fila",ariaRowSelectAll:"Presiona SPACE para alternar la selecci\\xF3n de todas las filas",ariaRowToggleSelection:"Presiona SPACE para alternar la selecci\\xF3n de la fila",ariaRowSelect:"Presiona SPACE para seleccionar esta fila",ariaRowSelectionDisabled:"La selecci\\xF3n de filas est\\xE1 deshabilitada para esta fila",ariaSearch:"Buscar",ariaSortableColumn:"Presiona ENTER para ordenar",ariaToggleVisibility:"Presiona SPACE para alternar la visibilidad",ariaToggleCellV';
      S = S + 'alue:"Presiona SPACE para alternar el valor de la celda",ariaUnchecked:"no seleccionado",ariaVisible:"visible",ariaSearchFilterValues:"Buscar valores de filtro",ariaPageSizeSelectorLabel:"Tama\\xF1o de P\\xE1gina",ariaChartMenuClose:"Cerrar Men\\xFA de Edici\\xF3n de Gr\\xE1fica",ariaChartSelected:"Seleccionado",ariaSkeletonCellLoadingFailed:"Carga de fila fallida",ariaSkeletonCellLoading:"Cargando datos de la fila",ariaRowGroupDropZonePanelLabel:"Grupos de filas",ariaValuesDropZonePanelLabel:"Valores",ariaPivotDropZonePanelLabel:"Etiquetas de columna",ariaDropZoneColumnComponentDescription:"Presione DELETE para eliminar",ariaDropZoneColumnValueItemDescription:"Presione ENTER para cambiar el tipo de agregaci\\xF3n",ariaDropZoneColumnGroupItemDescription:"Presione ENTER para ordenar",ariaDropZoneColumnComponentAggFuncSeparator:" de ",ariaDropZoneColumnComponentSortAscending:"ascendente",ariaDropZoneColumnComponentSortDescending:"descendente",ariaLabelDialog:"Di\\xE1logo",ariaLabelColumnMenu:"Men\\xFA de Columna",ariaLabelColumnFilter:"Filtro de Columna",ariaLabelCellEditor:"Editor de Celda",ariaLabelSelectField:"Seleccionar Campo",ariaLabelRichSelectField:"Campo de selecci\\xF3n enriquecido",ariaLabelRichSelectToggleSelection:"Presiona ESPACIO para alternar la selecci\\xF3n",ariaLabelRichSelectDeselectAllItems:"Presiona SUPRIMIR para deseleccionar todos los elementos",ariaLabelRichSelectDeleteSelection:"Presiona SUPRIMIR para deseleccionar el elemento",ariaLabelTooltip:"Informaci\\xF3n sobre herramientas",ariaLabelContextMenu:"Men\\xFA contextual",ariaLabelSubMenu:"Submen\\xFA",ariaLabelAggregationFunction:"Funci\\xF3n de agregaci\\xF3n",ariaLabelAdvancedFilterAutocomplete:"Autocompletar filtro avanzado",ariaLabelAdvancedFilterBuilderAddField:"Agregar campo al generador de filtro avanzado",ariaLabelAdvancedFilterBuilderColumnSelectField:"Campo de selecci\\xF3n de columna del generador de filtro avanzado",ariaLabelAdvancedFilterBuilderOptionSelectField:"Campo de selecci\\xF3n de opci\\';
      S = S + 'xF3n del generador de filtro avanzado",ariaLabelAdvancedFilterBuilderJoinSelectField:"Campo de selecci\\xF3n de operador de uni\\xF3n del generador de filtro avanzado",ariaColumnPanelList:"Lista de columnas",ariaFilterPanelList:"Lista de filtros",thousandSeparator:",",decimalSeparator:".",true:"Verdadero",false:"Falso",invalidDate:"Fecha inv\\xE1lida",invalidNumber:"N\\xFAmero inv\\xE1lido",january:"Enero",february:"Febrero",march:"Marzo",april:"Abril",may:"Mayo",june:"Junio",july:"Julio",august:"Agosto",september:"Septiembre",october:"Octubre",november:"Noviembre",december:"Diciembre",timeFormatSlashesDDMMYYYY:"DD/MM/AAAA",timeFormatSlashesMMDDYYYY:"MM/DD/AAAA",timeFormatSlashesDDMMYY:"DD/MM/AA",timeFormatSlashesMMDDYY:"MM/DD/AA",timeFormatDotsDDMYY:"DD.M.AA",timeFormatDotsMDDYY:"M.DD.AA",timeFormatDashesYYYYMMDD:"AAAA-MM-DD",timeFormatSpacesDDMMMMYYYY:"DD MMMM AAAA",timeFormatHHMMSS:"HH:MM:SS",timeFormatHHMMSSAmPm:"HH:MM:SS AM/PM"},G={selectAll:"(\\u0627\\u0646\\u062A\\u062E\\u0627\\u0628 \\u0647\\u0645\\u0647)",selectAllSearchResults:"(\\u0627\\u0646\\u062A\\u062E\\u0627\\u0628 \\u0647\\u0645\\u0647 \\u0646\\u062A\\u0627\\u06CC\\u062C \\u062C\\u0633\\u062A\\u062C\\u0648)",addCurrentSelectionToFilter:"\\u0627\\u0641\\u0632\\u0648\\u062F\\u0646 \\u0627\\u0646\\u062A\\u062E\\u0627\\u0628 \\u0641\\u0639\\u0644\\u06CC \\u0628\\u0647 \\u0641\\u06CC\\u0644\\u062A\\u0631",searchOoo:"\\u062C\\u0633\\u062A\\u062C\\u0648...",blanks:"(\\u062E\\u0627\\u0644\\u06CC)",noMatches:"\\u0645\\u0648\\u0631\\u062F\\u06CC \\u06CC\\u0627\\u0641\\u062A \\u0646\\u0634\\u062F",filterOoo:"\\u0641\\u06CC\\u0644\\u062A\\u0631...",equals:"\\u0628\\u0631\\u0627\\u0628\\u0631 \\u0627\\u0633\\u062A \\u0628\\u0627",notEqual:"\\u0628\\u0631\\u0627\\u0628\\u0631 \\u0646\\u06CC\\u0633\\u062A \\u0628\\u0627",blank:"\\u062E\\u0627\\u0644\\u06CC",notBlank:"\\u062E\\u0627\\u0644\\u06CC \\u0646\\u06CC\\u0633\\u062A",empty:"\\u06CC\\u06A9\\u06CC \\u0631\\u0627 \\u0627\\u0646\\u062A\\u062E\\u0627\\u0628 \\u06A9\\u0646\\u06CC\\u062F",lessThan:"\\u06A9\\u0645\\u062A\\u0631 \\u0627\\u0632",greaterThan:"\\u0628\\u06CC\\u0634\\u062A\\u0631 \\u0627\\u06';
      S = S + '32",lessThanOrEqual:"\\u06A9\\u0645\\u062A\\u0631 \\u06CC\\u0627 \\u0645\\u0633\\u0627\\u0648\\u06CC \\u0628\\u0627",greaterThanOrEqual:"\\u0628\\u06CC\\u0634\\u062A\\u0631 \\u06CC\\u0627 \\u0645\\u0633\\u0627\\u0648\\u06CC \\u0628\\u0627",inRange:"\\u0628\\u06CC\\u0646",inRangeStart:"\\u0627\\u0632",inRangeEnd:"\\u062A\\u0627",contains:"\\u0634\\u0627\\u0645\\u0644 \\u0627\\u0633\\u062A",notContains:"\\u0634\\u0627\\u0645\\u0644 \\u0646\\u0645\\u06CC\\u200C\\u0634\\u0648\\u062F",startsWith:"\\u0634\\u0631\\u0648\\u0639 \\u0645\\u06CC\\u200C\\u0634\\u0648\\u062F \\u0628\\u0627",endsWith:"\\u067E\\u0627\\u06CC\\u0627\\u0646 \\u0645\\u06CC\\u200C\\u06CC\\u0627\\u0628\\u062F \\u0628\\u0627",dateFormatOoo:"yyyy-mm-dd",before:"\\u0642\\u0628\\u0644",after:"\\u0628\\u0639\\u062F",andCondition:"\\u0648",orCondition:"\\u06CC\\u0627",applyFilter:"\\u0627\\u0639\\u0645\\u0627\\u0644",resetFilter:"\\u0628\\u0627\\u0632\\u0646\\u0634\\u0627\\u0646\\u06CC",clearFilter:"\\u067E\\u0627\\u06A9 \\u06A9\\u0631\\u062F\\u0646",cancelFilter:"\\u0644\\u063A\\u0648",textFilter:"\\u0641\\u06CC\\u0644\\u062A\\u0631 \\u0645\\u062A\\u0646\\u06CC",numberFilter:"\\u0641\\u06CC\\u0644\\u062A\\u0631 \\u0639\\u062F\\u062F\\u06CC",dateFilter:"\\u0641\\u06CC\\u0644\\u062A\\u0631 \\u062A\\u0627\\u0631\\u06CC\\u062E",setFilter:"\\u0641\\u06CC\\u0644\\u062A\\u0631 \\u0645\\u062C\\u0645\\u0648\\u0639\\u0647",groupFilterSelect:"\\u0627\\u0646\\u062A\\u062E\\u0627\\u0628 \\u0641\\u06CC\\u0644\\u062F:",advancedFilterContains:"\\u0634\\u0627\\u0645\\u0644 \\u0645\\u06CC\\u200C\\u0634\\u0648\\u062F",advancedFilterNotContains:"\\u0634\\u0627\\u0645\\u0644 \\u0646\\u0645\\u06CC\\u200C\\u0634\\u0648\\u062F",advancedFilterTextEquals:"\\u0645\\u0633\\u0627\\u0648\\u06CC \\u0627\\u0633\\u062A \\u0628\\u0627",advancedFilterTextNotEqual:"\\u0645\\u0633\\u0627\\u0648\\u06CC \\u0646\\u06CC\\u0633\\u062A \\u0628\\u0627",advancedFilterStartsWith:"\\u0634\\u0631\\u0648\\u0639 \\u0645\\u06CC\\u200C\\u0634\\u0648\\u062F \\u0628\\u0627",advancedFilterEndsWith:"\\u067E\\u0627\\u06CC\\u0627\\u0646 \\u0645\\u06CC\\u200C\\u06CC\\u0627\\u0628\\u062F \\u0628\\u0627",advancedFilterBlank:"\\u062E\\u0627\\u0644\\u06CC \\u0627\\u0633\\u062A",advancedFilterNotBlan';
      S = S + 'k:"\\u062E\\u0627\\u0644\\u06CC \\u0646\\u06CC\\u0633\\u062A",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"\\u062F\\u0631\\u0633\\u062A \\u0627\\u0633\\u062A",advancedFilterFalse:"\\u0646\\u0627\\u062F\\u0631\\u0633\\u062A \\u0627\\u0633\\u062A",advancedFilterAnd:"\\u0648",advancedFilterOr:"\\u06CC\\u0627",advancedFilterApply:"\\u0627\\u0639\\u0645\\u0627\\u0644",advancedFilterBuilder:"\\u0633\\u0627\\u0632\\u0646\\u062F\\u0647",advancedFilterValidationMissingColumn:"\\u0633\\u062A\\u0648\\u0646 \\u06AF\\u0645\\u0634\\u062F\\u0647 \\u0627\\u0633\\u062A",advancedFilterValidationMissingOption:"\\u06AF\\u0632\\u06CC\\u0646\\u0647 \\u06AF\\u0645\\u0634\\u062F\\u0647 \\u0627\\u0633\\u062A",advancedFilterValidationMissingValue:"\\u0645\\u0642\\u062F\\u0627\\u0631 \\u06AF\\u0645\\u0634\\u062F\\u0647 \\u0627\\u0633\\u062A",advancedFilterValidationInvalidColumn:"\\u0633\\u062A\\u0648\\u0646 \\u06CC\\u0627\\u0641\\u062A \\u0646\\u0634\\u062F",advancedFilterValidationInvalidOption:"\\u06AF\\u0632\\u06CC\\u0646\\u0647 \\u06CC\\u0627\\u0641\\u062A \\u0646\\u0634\\u062F",advancedFilterValidationMissingQuote:"\\u0645\\u0642\\u062F\\u0627\\u0631 \\u0628\\u062F\\u0648\\u0646 \\u0646\\u0642\\u0644 \\u0642\\u0648\\u0644 \\u0627\\u0646\\u062A\\u0647\\u0627\\u06CC\\u06CC \\u0627\\u0633\\u062A",advancedFilterValidationNotANumber:"\\u0645\\u0642\\u062F\\u0627\\u0631 \\u0639\\u062F\\u062F\\u06CC \\u0646\\u06CC\\u0633\\u062A",advancedFilterValidationInvalidDate:"\\u0645\\u0642\\u062F\\u0627\\u0631 \\u062A\\u0627\\u0631\\u06CC\\u062E \\u0645\\u0639\\u062A\\u0628\\u0631 \\u0646\\u06CC\\u0633\\u062A",advancedFilterValidationMissingCondition:"\\u0634\\u0631\\u0637 \\u06AF\\u0645\\u0634\\u062F\\u0647 \\u0627\\u0633\\u062A",advancedFilterValidationJoinOperatorMismatch:"\\u0627\\u067E\\u0631\\u0627\\u062A\\u0648\\u0631\\u0647\\u0627\\u06CC \\u067E\\u06CC\\u0648\\u0633\\u062A\\u0647 \\u062F\\u0631 \\u06CC\\u06A9 \\u0634\\u0631\\u0637 \\u0628\\u0627\\u06CC\\u062F \\u06CC\\u06A9\\u0633\\u0627\\u0646 \\u0628\\u0627\\u0634\\u0646\\u062F",advancedF';
      S = S + 'ilterValidationInvalidJoinOperator:"\\u0627\\u067E\\u0631\\u0627\\u062A\\u0648\\u0631 \\u067E\\u06CC\\u0648\\u0633\\u062A \\u06CC\\u0627\\u0641\\u062A \\u0646\\u0634\\u062F",advancedFilterValidationMissingEndBracket:"\\u0628\\u0631\\u0627\\u06A9\\u062A \\u0627\\u0646\\u062A\\u0647\\u0627\\u06CC\\u06CC \\u06AF\\u0645\\u0634\\u062F\\u0647 \\u0627\\u0633\\u062A",advancedFilterValidationExtraEndBracket:"\\u0628\\u0631\\u0627\\u06A9\\u062A \\u0627\\u0646\\u062A\\u0647\\u0627\\u06CC\\u06CC \\u0632\\u06CC\\u0627\\u062F\\u06CC \\u0648\\u062C\\u0648\\u062F \\u062F\\u0627\\u0631\\u062F",advancedFilterValidationMessage:"\\u0639\\u0628\\u0627\\u0631\\u062A \\u062D\\u0627\\u0648\\u06CC \\u06CC\\u06A9 \\u062E\\u0637\\u0627\\u0633\\u062A. ${variable} - ${variable}.",advancedFilterValidationMessageAtEnd:"\\u0639\\u0628\\u0627\\u0631\\u062A \\u062D\\u0627\\u0648\\u06CC \\u06CC\\u06A9 \\u062E\\u0637\\u0627\\u0633\\u062A. ${variable} \\u062F\\u0631 \\u067E\\u0627\\u06CC\\u0627\\u0646 \\u0639\\u0628\\u0627\\u0631\\u062A.",advancedFilterBuilderTitle:"\\u0639\\u0646\\u0648\\u0627\\u0646",advancedFilterBuilderApply:"\\u0627\\u0639\\u0645\\u0627\\u0644",advancedFilterBuilderCancel:"\\u0644\\u063A\\u0648",advancedFilterBuilderAddButtonTooltip:"\\u0627\\u0641\\u0632\\u0648\\u062F\\u0646 \\u0641\\u06CC\\u0644\\u062A\\u0631 \\u06CC\\u0627 \\u06AF\\u0631\\u0648\\u0647",advancedFilterBuilderRemoveButtonTooltip:"\\u062D\\u0630\\u0641",advancedFilterBuilderMoveUpButtonTooltip:"\\u062D\\u0631\\u06A9\\u062A \\u0628\\u0647 \\u0628\\u0627\\u0644\\u0627",advancedFilterBuilderMoveDownButtonTooltip:"\\u062D\\u0631\\u06A9\\u062A \\u0628\\u0647 \\u067E\\u0627\\u06CC\\u06CC\\u0646",advancedFilterBuilderAddJoin:"\\u0627\\u0641\\u0632\\u0648\\u062F\\u0646 \\u06AF\\u0631\\u0648\\u0647",advancedFilterBuilderAddCondition:"\\u0627\\u0641\\u0632\\u0648\\u062F\\u0646 \\u0641\\u06CC\\u0644\\u062A\\u0631",advancedFilterBuilderSelectColumn:"\\u0627\\u0646\\u062A\\u062E\\u0627\\u0628 \\u06CC\\u06A9 \\u0633\\u062A\\u0648\\u0646",advancedFilterBuilderSelectOption:"\\u0627\\u0646\\u062A\\u062E\\u0627\\u0628 \\u06CC\\u06A9 \\u06AF\\u0632\\u06CC\\u0646\\u0647",advancedFilterBuilderEnterValue:"\\u0648\\u0627\\u0631\\u062F \\u06A9\\u06';
      S = S + '31\\u062F\\u0646 \\u0645\\u0642\\u062F\\u0627\\u0631...",advancedFilterBuilderValidationAlreadyApplied:"\\u0641\\u06CC\\u0644\\u062A\\u0631 \\u0641\\u0639\\u0644\\u06CC \\u0642\\u0628\\u0644\\u0627\\u064B \\u0627\\u0639\\u0645\\u0627\\u0644 \\u0634\\u062F\\u0647 \\u0627\\u0633\\u062A.",advancedFilterBuilderValidationIncomplete:"\\u0647\\u0645\\u0647 \\u0634\\u0631\\u0627\\u06CC\\u0637 \\u06A9\\u0627\\u0645\\u0644 \\u0646\\u06CC\\u0633\\u062A\\u0646\\u062F.",advancedFilterBuilderValidationSelectColumn:"\\u0628\\u0627\\u06CC\\u062F \\u06CC\\u06A9 \\u0633\\u062A\\u0648\\u0646 \\u0627\\u0646\\u062A\\u062E\\u0627\\u0628 \\u0634\\u0648\\u062F.",advancedFilterBuilderValidationSelectOption:"\\u0628\\u0627\\u06CC\\u062F \\u06CC\\u06A9 \\u06AF\\u0632\\u06CC\\u0646\\u0647 \\u0627\\u0646\\u062A\\u062E\\u0627\\u0628 \\u0634\\u0648\\u062F.",advancedFilterBuilderValidationEnterValue:"\\u0628\\u0627\\u06CC\\u062F \\u06CC\\u06A9 \\u0645\\u0642\\u062F\\u0627\\u0631 \\u0648\\u0627\\u0631\\u062F \\u0634\\u0648\\u062F.",columns:"\\u0633\\u062A\\u0648\\u0646\\u200C\\u0647\\u0627",filters:"\\u0641\\u06CC\\u0644\\u062A\\u0631\\u0647\\u0627",pivotMode:"\\u062D\\u0627\\u0644\\u062A Pivot",groups:"\\u06AF\\u0631\\u0648\\u0647\\u200C\\u0647\\u0627\\u06CC \\u0631\\u062F\\u06CC\\u0641",rowGroupColumnsEmptyMessage:"\\u0627\\u06CC\\u0646\\u062C\\u0627 \\u0628\\u06A9\\u0634\\u06CC\\u062F \\u062A\\u0627 \\u06AF\\u0631\\u0648\\u0647\\u200C\\u0647\\u0627\\u06CC \\u0631\\u062F\\u06CC\\u0641 \\u062A\\u0646\\u0638\\u06CC\\u0645 \\u0634\\u0648\\u062F",values:"\\u0645\\u0642\\u0627\\u062F\\u06CC\\u0631",valueColumnsEmptyMessage:"\\u0627\\u06CC\\u0646\\u062C\\u0627 \\u0628\\u06A9\\u0634\\u06CC\\u062F \\u062A\\u0627 \\u062C\\u0645\\u0639\\u200C\\u0622\\u0648\\u0631\\u06CC \\u0634\\u0648\\u062F",pivots:"\\u0628\\u0631\\u0686\\u0633\\u0628\\u200C\\u0647\\u0627\\u06CC \\u0633\\u062A\\u0648\\u0646",pivotColumnsEmptyMessage:"\\u0627\\u06CC\\u0646\\u062C\\u0627 \\u0628\\u06A9\\u0634\\u06CC\\u062F \\u062A\\u0627 \\u0628\\u0631\\u0686\\u0633\\u0628\\u200C\\u0647\\u0627\\u06CC \\u0633\\u062A\\u0648\\u0646 \\u062A\\u0646\\u0638\\u06CC\\u0645 \\u0634\\u0648\\u062F",group:"\\u06AF\\u0631\\u0648\\u0647",rowDragRow:"\\u0631\\u062F\\u06CC\\u0641",rowDragRows:"\\u0631\\u06';
      S = S + '2F\\u06CC\\u0641\\u200C\\u0647\\u0627",loadingOoo:"\\u062F\\u0631 \\u062D\\u0627\\u0644 \\u0628\\u0627\\u0631\\u06AF\\u0630\\u0627\\u0631\\u06CC...",loadingError:"\\u062E\\u0637\\u0627",noRowsToShow:"\\u0631\\u062F\\u06CC\\u0641\\u06CC \\u0628\\u0631\\u0627\\u06CC \\u0646\\u0645\\u0627\\u06CC\\u0634 \\u0648\\u062C\\u0648\\u062F \\u0646\\u062F\\u0627\\u0631\\u062F",enabled:"\\u0641\\u0639\\u0627\\u0644",pinColumn:"\\u0633\\u0646\\u062C\\u0627\\u0642 \\u06A9\\u0631\\u062F\\u0646 \\u0633\\u062A\\u0648\\u0646",pinLeft:"\\u0633\\u0646\\u062C\\u0627\\u0642 \\u06A9\\u0631\\u062F\\u0646 \\u0628\\u0647 \\u0686\\u067E",pinRight:"\\u0633\\u0646\\u062C\\u0627\\u0642 \\u06A9\\u0631\\u062F\\u0646 \\u0628\\u0647 \\u0631\\u0627\\u0633\\u062A",noPin:"\\u0628\\u062F\\u0648\\u0646 \\u0633\\u0646\\u062C\\u0627\\u0642",valueAggregation:"\\u062A\\u062C\\u0645\\u0639 \\u0627\\u0631\\u0632\\u0634",noAggregation:"\\u0647\\u06CC\\u0686",autosizeThisColumn:"\\u0627\\u0646\\u062F\\u0627\\u0632\\u0647 \\u062E\\u0648\\u062F\\u06A9\\u0627\\u0631 \\u0627\\u06CC\\u0646 \\u0633\\u062A\\u0648\\u0646",autosizeAllColumns:"\\u0627\\u0646\\u062F\\u0627\\u0632\\u0647 \\u062E\\u0648\\u062F\\u06A9\\u0627\\u0631 \\u0647\\u0645\\u0647 \\u0633\\u062A\\u0648\\u0646\\u200C\\u0647\\u0627",groupBy:"\\u06AF\\u0631\\u0648\\u0647\\u200C\\u0628\\u0646\\u062F\\u06CC \\u0628\\u0627",ungroupBy:"\\u062D\\u0630\\u0641 \\u06AF\\u0631\\u0648\\u0647\\u200C\\u0628\\u0646\\u062F\\u06CC \\u0628\\u0627",ungroupAll:"\\u062D\\u0630\\u0641 \\u0647\\u0645\\u0647 \\u06AF\\u0631\\u0648\\u0647\\u200C\\u0628\\u0646\\u062F\\u06CC\\u200C\\u0647\\u0627",addToValues:"${variable} \\u0631\\u0627 \\u0628\\u0647 \\u0645\\u0642\\u0627\\u062F\\u06CC\\u0631 \\u0627\\u0636\\u0627\\u0641\\u0647 \\u06A9\\u0646\\u06CC\\u062F",removeFromValues:"${variable} \\u0631\\u0627 \\u0627\\u0632 \\u0645\\u0642\\u0627\\u062F\\u06CC\\u0631 \\u062D\\u0630\\u0641 \\u06A9\\u0646\\u06CC\\u062F",addToLabels:"${variable} \\u0631\\u0627 \\u0628\\u0647 \\u0628\\u0631\\u0686\\u0633\\u0628\\u200C\\u0647\\u0627 \\u0627\\u0636\\u0627\\u0641\\u0647 \\u06A9\\u0646\\u06CC\\u062F",removeFromLabels:"${variable} \\u0631\\u0627 \\u0627\\u0632 \\u0628\\u0631\\u0686\\u0633\\u0628\\u200C\\u0647\\u0627 \\u062D\\u0630\\u0641 \\u06A9\\u0646\\u06CC\\u062';
      S = S + 'F",resetColumns:"\\u0628\\u0627\\u0632\\u0646\\u0634\\u0627\\u0646\\u06CC \\u0633\\u062A\\u0648\\u0646\\u200C\\u0647\\u0627",expandAll:"\\u0628\\u0627\\u0632 \\u06A9\\u0631\\u062F\\u0646 \\u0647\\u0645\\u0647 \\u06AF\\u0631\\u0648\\u0647\\u200C\\u0647\\u0627\\u06CC \\u0631\\u062F\\u06CC\\u0641",collapseAll:"\\u0628\\u0633\\u062A\\u0646 \\u0647\\u0645\\u0647 \\u06AF\\u0631\\u0648\\u0647\\u200C\\u0647\\u0627\\u06CC \\u0631\\u062F\\u06CC\\u0641",copy:"\\u06A9\\u067E\\u06CC",ctrlC:"Ctrl+C",ctrlX:"Ctrl+X",copyWithHeaders:"\\u06A9\\u067E\\u06CC \\u0628\\u0627 \\u0633\\u0631\\u0628\\u0631\\u06AF\\u200C\\u0647\\u0627",copyWithGroupHeaders:"\\u06A9\\u067E\\u06CC \\u0628\\u0627 \\u0633\\u0631\\u0628\\u0631\\u06AF\\u200C\\u0647\\u0627\\u06CC \\u06AF\\u0631\\u0648\\u0647",cut:"\\u0628\\u0631\\u06CC\\u062F\\u0646",paste:"\\u0686\\u0633\\u0628\\u0627\\u0646\\u062F\\u0646",ctrlV:"Ctrl+V",export:"\\u0635\\u0627\\u062F\\u0631\\u0627\\u062A",csvExport:"\\u0635\\u0627\\u062F\\u0631\\u0627\\u062A CSV",excelExport:"\\u0635\\u0627\\u062F\\u0631\\u0627\\u062A \\u0627\\u06A9\\u0633\\u0644",columnFilter:"\\u0641\\u06CC\\u0644\\u062A\\u0631 \\u0633\\u062A\\u0648\\u0646",columnChooser:"\\u0627\\u0646\\u062A\\u062E\\u0627\\u0628 \\u0633\\u062A\\u0648\\u0646\\u200C\\u0647\\u0627",sortAscending:"\\u0645\\u0631\\u062A\\u0628\\u200C\\u0633\\u0627\\u0632\\u06CC \\u0635\\u0639\\u0648\\u062F\\u06CC",sortDescending:"\\u0645\\u0631\\u062A\\u0628\\u200C\\u0633\\u0627\\u0632\\u06CC \\u0646\\u0632\\u0648\\u0644\\u06CC",sortUnSort:"\\u067E\\u0627\\u06A9 \\u06A9\\u0631\\u062F\\u0646 \\u0645\\u0631\\u062A\\u0628\\u200C\\u0633\\u0627\\u0632\\u06CC",sum:"\\u062C\\u0645\\u0639",first:"\\u0627\\u0648\\u0644",last:"\\u0622\\u062E\\u0631",min:"\\u062D\\u062F\\u0627\\u0642\\u0644",max:"\\u062D\\u062F\\u0627\\u06A9\\u062B\\u0631",none:"\\u0647\\u06CC\\u0686\\u200C\\u06A9\\u062F\\u0627\\u0645",count:"\\u062A\\u0639\\u062F\\u0627\\u062F",avg:"\\u0645\\u06CC\\u0627\\u0646\\u06AF\\u06CC\\u0646",filteredRows:"\\u0641\\u06CC\\u0644\\u062A\\u0631 \\u0634\\u062F\\u0647",selectedRows:"\\u0627\\u0646\\u062A\\u062E\\u0627\\u0628 \\u0634\\u062F\\u0647",totalRows:"\\u06A9\\u0644 \\u0631\\u062F\\u06CC\\u0641\\u200C\\u0647\\u0627",totalAndFilteredRows:"\\u0631\\u062F\\u06CC\\u0641\\u200';
      S = S + 'C\\u0647\\u0627",more:"\\u0628\\u06CC\\u0634\\u062A\\u0631",to:"\\u0628\\u0647",of:"\\u0627\\u0632",page:"\\u0635\\u0641\\u062D\\u0647",pageLastRowUnknown:"?",nextPage:"\\u0635\\u0641\\u062D\\u0647 \\u0628\\u0639\\u062F",lastPage:"\\u0622\\u062E\\u0631\\u06CC\\u0646 \\u0635\\u0641\\u062D\\u0647",firstPage:"\\u0627\\u0648\\u0644\\u06CC\\u0646 \\u0635\\u0641\\u062D\\u0647",previousPage:"\\u0635\\u0641\\u062D\\u0647 \\u0642\\u0628\\u0644\\u06CC",pageSizeSelectorLabel:"\\u0627\\u0646\\u062F\\u0627\\u0632\\u0647 \\u0635\\u0641\\u062D\\u0647:",footerTotal:"\\u06A9\\u0644",pivotColumnGroupTotals:"\\u0645\\u062C\\u0645\\u0648\\u0639",pivotChartAndPivotMode:"\\u0686\\u0627\\u0631\\u062A \\u0645\\u062D\\u0648\\u0631\\u06CC \\u0648 \\u062D\\u0627\\u0644\\u062A \\u0645\\u062D\\u0648\\u0631\\u06CC",pivotChart:"\\u0686\\u0627\\u0631\\u062A \\u0645\\u062D\\u0648\\u0631\\u06CC",chartRange:"\\u062F\\u0627\\u0645\\u0646\\u0647 \\u0686\\u0627\\u0631\\u062A",columnChart:"\\u0633\\u062A\\u0648\\u0646",groupedColumn:"\\u06AF\\u0631\\u0648\\u0647 \\u0628\\u0646\\u062F\\u06CC \\u0634\\u062F\\u0647",stackedColumn:"\\u067E\\u0634\\u062A\\u0647 \\u0627\\u06CC",normalizedColumn:"\\u06F1\\u06F0\\u06F0\\u066A \\u067E\\u0634\\u062A\\u0647 \\u0627\\u06CC",barChart:"\\u0645\\u06CC\\u0644\\u0647 \\u0627\\u06CC",groupedBar:"\\u06AF\\u0631\\u0648\\u0647 \\u0628\\u0646\\u062F\\u06CC \\u0634\\u062F\\u0647",stackedBar:"\\u067E\\u0634\\u062A\\u0647 \\u0627\\u06CC",normalizedBar:"\\u06F1\\u06F0\\u06F0\\u066A \\u067E\\u0634\\u062A\\u0647 \\u0627\\u06CC",pieChart:"\\u062F\\u0627\\u06CC\\u0631\\u0647 \\u0627\\u06CC",pie:"\\u062F\\u0627\\u06CC\\u0631\\u0647 \\u0627\\u06CC",donut:"\\u062F\\u0648\\u0646\\u0627\\u062A",line:"\\u062E\\u0637\\u06CC",xyChart:"\\u0627\\u06CC\\u06A9\\u0633 \\u0648\\u0627\\u06CC (\\u067E\\u0631\\u0627\\u06A9\\u0646\\u062F\\u0647)",scatter:"\\u067E\\u0631\\u0627\\u06A9\\u0646\\u062F\\u0647",bubble:"\\u062D\\u0628\\u0627\\u0628\\u06CC",areaChart:"\\u0645\\u0633\\u0627\\u062D\\u062A\\u06CC",area:"\\u0645\\u0633\\u0627\\u062D\\u062A\\u06CC",stackedArea:"\\u067E\\u0634\\u062A\\u0647 \\u0627\\u06CC",normalizedArea:"\\u06F1\\u06F0\\u06F0\\u066A \\u067E\\u0634\\u062A\\u0647 \\u0627\\u06CC",histogramChart:"\\u0647\\u06CC\\u0633\\u062A\\';
      S = S + 'u0648\\u06AF\\u0631\\u0627\\u0645",polarChart:"\\u0642\\u0637\\u0628\\u06CC",radarLine:"\\u0631\\u0627\\u062F\\u0627\\u0631\\u06CC \\u062E\\u0637\\u06CC",radarArea:"\\u0631\\u0627\\u062F\\u0627\\u0631\\u06CC \\u0645\\u0633\\u0627\\u062D\\u062A\\u06CC",nightingale:"\\u0646\\u0627\\u06CC\\u062A\\u06CC\\u0646\\u06AF\\u0644",radialColumn:"\\u0633\\u062A\\u0648\\u0646 \\u0634\\u0639\\u0627\\u0639\\u06CC",radialBar:"\\u0645\\u06CC\\u0644\\u0647 \\u0634\\u0639\\u0627\\u0639\\u06CC",statisticalChart:"\\u0622\\u0645\\u0627\\u0631\\u06CC",boxPlot:"\\u0628\\u0627\\u06A9\\u0633 \\u067E\\u0644\\u0627\\u062A",rangeBar:"\\u0645\\u06CC\\u0644\\u0647 \\u0628\\u0627\\u0632\\u0647 \\u0627\\u06CC",rangeArea:"\\u0645\\u0633\\u0627\\u062D\\u062A \\u0628\\u0627\\u0632\\u0647 \\u0627\\u06CC",hierarchicalChart:"\\u0633\\u0644\\u0633\\u0644\\u0647 \\u0645\\u0631\\u0627\\u062A\\u0628\\u06CC",treemap:"\\u062F\\u0631\\u062E\\u062A \\u0646\\u0642\\u0634\\u0647",sunburst:"\\u0627\\u0646\\u0641\\u062C\\u0627\\u0631 \\u062E\\u0648\\u0631\\u0634\\u06CC\\u062F\\u06CC",specializedChart:"\\u062A\\u062E\\u0635\\u0635\\u06CC",waterfall:"\\u0622\\u0628\\u0634\\u0627\\u0631",heatmap:"\\u0646\\u0642\\u0634\\u0647 \\u062D\\u0631\\u0627\\u0631\\u062A\\u06CC",combinationChart:"\\u062A\\u0631\\u06A9\\u06CC\\u0628\\u06CC",columnLineCombo:"\\u0633\\u062A\\u0648\\u0646 \\u0648 \\u062E\\u0637",AreaColumnCombo:"\\u0645\\u0633\\u0627\\u062D\\u062A \\u0648 \\u0633\\u062A\\u0648\\u0646",pivotChartTitle:"\\u0646\\u0645\\u0648\\u062F\\u0627\\u0631 \\u0645\\u062D\\u0648\\u0631\\u06CC",rangeChartTitle:"\\u0646\\u0645\\u0648\\u062F\\u0627\\u0631 \\u0645\\u062D\\u062F\\u0648\\u062F\\u0647",settings:"\\u0646\\u0645\\u0648\\u062F\\u0627\\u0631",data:"\\u0631\\u0627\\u0647 \\u0627\\u0646\\u062F\\u0627\\u0632\\u06CC",format:"\\u0633\\u0641\\u0627\\u0631\\u0634\\u06CC \\u0633\\u0627\\u0632\\u06CC",categories:"\\u062F\\u0633\\u062A\\u0647 \\u0628\\u0646\\u062F\\u06CC\\u200C\\u0647\\u0627",defaultCategory:"(\\u0647\\u06CC\\u0686)",series:"\\u0645\\u062C\\u0645\\u0648\\u0639\\u0647 \\u062F\\u0627\\u062F\\u0647\\u200C\\u0647\\u0627",switchCategorySeries:"\\u062A\\u063A\\u06CC\\u06CC\\u0631 \\u062F\\u0633\\u062A\\u0647 / \\u0645\\u062C\\u0645\\u0648\\u0639\\u0647 \\u062F\\u0627\\u062F\\u';
      S = S + '0647",categoryValues:"\\u0645\\u0642\\u0627\\u062F\\u06CC\\u0631 \\u062F\\u0633\\u062A\\u0647",seriesLabels:"\\u0628\\u0631\\u0686\\u0633\\u0628\\u200C\\u0647\\u0627\\u06CC \\u0645\\u062C\\u0645\\u0648\\u0639\\u0647 \\u062F\\u0627\\u062F\\u0647",aggregate:"\\u062A\\u062C\\u0645\\u0639",xyValues:"\\u0645\\u0642\\u0627\\u062F\\u06CC\\u0631 X Y",paired:"\\u062D\\u0627\\u0644\\u062A \\u062C\\u0641\\u062A",axis:"\\u0645\\u062D\\u0648\\u0631",xAxis:"\\u0645\\u062D\\u0648\\u0631 \\u0627\\u0641\\u0642\\u06CC",yAxis:"\\u0645\\u062D\\u0648\\u0631 \\u0639\\u0645\\u0648\\u062F\\u06CC",polarAxis:"\\u0645\\u062D\\u0648\\u0631 \\u0642\\u0637\\u0628\\u06CC",radiusAxis:"\\u0645\\u062D\\u0648\\u0631 \\u0634\\u0639\\u0627\\u0639\\u06CC",navigator:"\\u0631\\u0627\\u0647\\u0628\\u0631\\u062F",zoom:"\\u0628\\u0632\\u0631\\u06AF\\u0646\\u0645\\u0627\\u06CC\\u06CC",animation:"\\u0627\\u0646\\u06CC\\u0645\\u06CC\\u0634\\u0646",crosshair:"\\u0645\\u0648\\u0634\\u06A9\\u0627\\u0628",color:"\\u0631\\u0646\\u06AF",thickness:"\\u0636\\u062E\\u0627\\u0645\\u062A",preferredLength:"\\u0637\\u0648\\u0644 \\u0645\\u0648\\u0631\\u062F \\u0646\\u0638\\u0631",xType:"\\u0646\\u0648\\u0639 X",axisType:"\\u0646\\u0648\\u0639 \\u0645\\u062D\\u0648\\u0631",automatic:"\\u062E\\u0648\\u062F\\u06A9\\u0627\\u0631",category:"\\u062F\\u0633\\u062A\\u0647",number:"\\u0639\\u062F\\u062F",time:"\\u0632\\u0645\\u0627\\u0646",timeFormat:"\\u0641\\u0631\\u0645\\u062A \\u0632\\u0645\\u0627\\u0646",autoRotate:"\\u0686\\u0631\\u062E\\u0634 \\u062E\\u0648\\u062F\\u06A9\\u0627\\u0631",labelRotation:"\\u0686\\u0631\\u062E\\u0634 \\u0628\\u0631\\u0686\\u0633\\u0628",circle:"\\u062F\\u0627\\u06CC\\u0631\\u0647",polygon:"\\u0686\\u0646\\u062F \\u0636\\u0644\\u0639\\u06CC",square:"\\u0645\\u0631\\u0628\\u0639",cross:"\\u0686\\u0644\\u06CC\\u067E\\u0627",diamond:"\\u0644\\u0648\\u0632\\u06CC",plus:"\\u0627\\u0636\\u0627\\u0641\\u0647",triangle:"\\u0645\\u062B\\u0644\\u062B",heart:"\\u0642\\u0644\\u0628",orientation:"\\u062C\\u0647\\u062A",fixed:"\\u062B\\u0627\\u0628\\u062A",parallel:"\\u0645\\u0648\\u0627\\u0632\\u06CC",perpendicular:"\\u0639\\u0645\\u0648\\u062F",radiusAxisPosition:"\\u0645\\u0648\\u0642\\u0639\\u06CC\\u062A",ticks:"\\u0639\\u0644\\u0627\\u0645\\u062A\\u20';
      S = S + '0C\\u0647\\u0627",gridLines:"\\u062E\\u0637\\u0648\\u0637 \\u0634\\u0628\\u06A9\\u0647",width:"\\u0639\\u0631\\u0636",height:"\\u0627\\u0631\\u062A\\u0641\\u0627\\u0639",length:"\\u0637\\u0648\\u0644",padding:"\\u062D\\u0627\\u0634\\u06CC\\u0647 \\u062F\\u0627\\u062E\\u0644\\u06CC",spacing:"\\u0641\\u0627\\u0635\\u0644\\u0647",chartStyle:"\\u0633\\u0628\\u06A9 \\u0646\\u0645\\u0648\\u062F\\u0627\\u0631",title:"\\u0639\\u0646\\u0648\\u0627\\u0646",chartTitles:"\\u0639\\u0646\\u0627\\u0648\\u06CC\\u0646",chartTitle:"\\u0639\\u0646\\u0648\\u0627\\u0646 \\u0646\\u0645\\u0648\\u062F\\u0627\\u0631",chartSubtitle:"\\u0632\\u06CC\\u0631\\u0639\\u0646\\u0648\\u0627\\u0646",horizontalAxisTitle:"\\u0639\\u0646\\u0648\\u0627\\u0646 \\u0645\\u062D\\u0648\\u0631 \\u0627\\u0641\\u0642\\u06CC",verticalAxisTitle:"\\u0639\\u0646\\u0648\\u0627\\u0646 \\u0645\\u062D\\u0648\\u0631 \\u0639\\u0645\\u0648\\u062F\\u06CC",polarAxisTitle:"\\u0639\\u0646\\u0648\\u0627\\u0646 \\u0645\\u062D\\u0648\\u0631 \\u0642\\u0637\\u0628\\u06CC",titlePlaceholder:"\\u0639\\u0646\\u0648\\u0627\\u0646 \\u0646\\u0645\\u0648\\u062F\\u0627\\u0631",background:"\\u067E\\u0633\\u200C\\u0632\\u0645\\u06CC\\u0646\\u0647",font:"\\u0641\\u0648\\u0646\\u062A",weight:"\\u0648\\u0632\\u0646",top:"\\u0628\\u0627\\u0644\\u0627",right:"\\u0631\\u0627\\u0633\\u062A",bottom:"\\u067E\\u0627\\u06CC\\u06CC\\u0646",left:"\\u0686\\u067E",labels:"\\u0628\\u0631\\u0686\\u0633\\u0628\\u200C\\u0647\\u0627",calloutLabels:"\\u0628\\u0631\\u0686\\u0633\\u0628\\u200C\\u0647\\u0627\\u06CC \\u062A\\u0648\\u0636\\u06CC\\u062D\\u06CC",sectorLabels:"\\u0628\\u0631\\u0686\\u0633\\u0628\\u200C\\u0647\\u0627\\u06CC \\u0628\\u062E\\u0634",positionRatio:"\\u0646\\u0633\\u0628\\u062A \\u0645\\u0648\\u0642\\u0639\\u06CC\\u062A",size:"\\u0627\\u0646\\u062F\\u0627\\u0632\\u0647",shape:"\\u0634\\u06A9\\u0644",minSize:"\\u062D\\u062F\\u0627\\u0642\\u0644 \\u0627\\u0646\\u062F\\u0627\\u0632\\u0647",maxSize:"\\u062D\\u062F\\u0627\\u06A9\\u062B\\u0631 \\u0627\\u0646\\u062F\\u0627\\u0632\\u0647",legend:"\\u0639\\u0644\\u0627\\u0626\\u0645 \\u0631\\u0627\\u0647\\u0646\\u0645\\u0627",position:"\\u0645\\u0648\\u0642\\u0639\\u06CC\\u062A",markerSize:"\\u0627\\u0646\\u062F\\u0627\\u0632\\u0647 \\u0646\\u0634\\u0627\\u06';
      S = S + '46\\u06AF\\u0631",markerStroke:"\\u0636\\u0631\\u0628\\u0647 \\u0646\\u0634\\u0627\\u0646\\u06AF\\u0631",markerPadding:"\\u062D\\u0627\\u0634\\u06CC\\u0647 \\u062F\\u0627\\u062E\\u0644\\u06CC \\u0646\\u0634\\u0627\\u0646\\u06AF\\u0631",itemSpacing:"\\u0641\\u0627\\u0635\\u0644\\u0647 \\u0628\\u06CC\\u0646 \\u0645\\u0648\\u0627\\u0631\\u062F",itemPaddingX:"\\u062D\\u0627\\u0634\\u06CC\\u0647 \\u062F\\u0627\\u062E\\u0644\\u06CC \\u0627\\u0641\\u0642\\u06CC \\u0645\\u0648\\u0627\\u0631\\u062F",itemPaddingY:"\\u062D\\u0627\\u0634\\u06CC\\u0647 \\u062F\\u0627\\u062E\\u0644\\u06CC \\u0639\\u0645\\u0648\\u062F\\u06CC \\u0645\\u0648\\u0627\\u0631\\u062F",layoutHorizontalSpacing:"\\u0641\\u0627\\u0635\\u0644\\u0647 \\u0627\\u0641\\u0642\\u06CC",layoutVerticalSpacing:"\\u0641\\u0627\\u0635\\u0644\\u0647 \\u0639\\u0645\\u0648\\u062F\\u06CC",strokeWidth:"\\u0639\\u0631\\u0636 \\u062E\\u0637",offset:"\\u0627\\u0641\\u0633\\u062A",offsets:"\\u0627\\u0641\\u0633\\u062A\\u200C\\u0647\\u0627",tooltips:"\\u062A\\u0648\\u0636\\u06CC\\u062D\\u0627\\u062A",callout:"\\u062A\\u0648\\u0636\\u06CC\\u062D",markers:"\\u0646\\u0634\\u0627\\u0646\\u06AF\\u0631\\u0647\\u0627",shadow:"\\u0633\\u0627\\u06CC\\u0647",blur:"\\u062A\\u0627\\u0631\\u06CC",xOffset:"\\u0627\\u0641\\u0633\\u062A X",yOffset:"\\u0627\\u0641\\u0633\\u062A Y",lineWidth:"\\u0639\\u0631\\u0636 \\u062E\\u0637",lineDash:"\\u062E\\u0637 \\u062A\\u06CC\\u0631\\u0647",lineDashOffset:"\\u0627\\u0641\\u0633\\u062A \\u062E\\u0637 \\u062A\\u06CC\\u0631\\u0647",scrollingZoom:"\\u067E\\u06CC\\u0645\\u0627\\u06CC\\u0634",scrollingStep:"\\u0645\\u0631\\u062D\\u0644\\u0647 \\u067E\\u06CC\\u0645\\u0627\\u06CC\\u0634",selectingZoom:"\\u0627\\u0646\\u062A\\u062E\\u0627\\u0628",durationMillis:"\\u0645\\u062F\\u062A (\\u0645\\u06CC\\u0644\\u06CC\\u200C\\u062B\\u0627\\u0646\\u06CC\\u0647)",crosshairLabel:"\\u0628\\u0631\\u0686\\u0633\\u0628",crosshairSnap:"\\u0646\\u0642\\u0637\\u0647 \\u0686\\u0633\\u0628\\u0646\\u062F\\u0647",normal:"\\u0639\\u0627\\u062F\\u06CC",bold:"\\u067E\\u0631\\u0631\\u0646\\u06AF",italic:"\\u06A9\\u062C",boldItalic:"\\u067E\\u0631\\u0631\\u0646\\u06AF \\u06A9\\u062C",predefined:"\\u0627\\u0632 \\u067E\\u06CC\\u0634 \\u062A\\u0639\\u06CC\\u06CC\\u0646 \\u0634\\u062F\\u06';
      S = S + '47",fillOpacity:"\\u0634\\u0641\\u0627\\u0641\\u06CC\\u062A \\u067E\\u0631 \\u06A9\\u0631\\u062F\\u0646",strokeColor:"\\u0631\\u0646\\u06AF \\u062E\\u0637",strokeOpacity:"\\u0634\\u0641\\u0627\\u0641\\u06CC\\u062A \\u062E\\u0637",miniChart:"\\u0645\\u06CC\\u0646\\u06CC \\u0646\\u0645\\u0648\\u062F\\u0627\\u0631",histogramBinCount:"\\u062A\\u0639\\u062F\\u0627\\u062F \\u062F\\u0633\\u062A\\u0647\\u200C\\u0647\\u0627",connectorLine:"\\u062E\\u0637 \\u0627\\u062A\\u0635\\u0627\\u0644",seriesItems:"\\u0645\\u0648\\u0627\\u0631\\u062F \\u0645\\u062C\\u0645\\u0648\\u0639\\u0647 \\u062F\\u0627\\u062F\\u0647\\u200C\\u0647\\u0627",seriesItemType:"\\u0646\\u0648\\u0639 \\u0645\\u0648\\u0631\\u062F",seriesItemPositive:"\\u0645\\u062B\\u0628\\u062A",seriesItemNegative:"\\u0645\\u0646\\u0641\\u06CC",seriesItemLabels:"\\u0628\\u0631\\u0686\\u0633\\u0628\\u200C\\u0647\\u0627\\u06CC \\u0645\\u0648\\u0627\\u0631\\u062F",columnGroup:"\\u0633\\u062A\\u0648\\u0646",barGroup:"\\u0646\\u0648\\u0627\\u0631",pieGroup:"\\u062F\\u0627\\u06CC\\u0631\\u0647\\u200C\\u0627\\u06CC",lineGroup:"\\u062E\\u0637",scatterGroup:"X Y (\\u067E\\u0631\\u0627\\u06A9\\u0646\\u062F\\u0647)",areaGroup:"\\u0645\\u0646\\u0637\\u0642\\u0647",polarGroup:"\\u0642\\u0637\\u0628\\u06CC",statisticalGroup:"\\u0622\\u0645\\u0627\\u0631\\u06CC",hierarchicalGroup:"\\u0633\\u0644\\u0633\\u0644\\u0647 \\u0645\\u0631\\u0627\\u062A\\u0628\\u06CC",specializedGroup:"\\u062A\\u062E\\u0635\\u0635\\u06CC",combinationGroup:"\\u062A\\u0631\\u06A9\\u06CC\\u0628\\u06CC",groupedColumnTooltip:"\\u06AF\\u0631\\u0648\\u0647\\u06CC",stackedColumnTooltip:"\\u0627\\u0646\\u0628\\u0627\\u0634\\u062A\\u0647",normalizedColumnTooltip:"\\u06F1\\u06F0\\u06F0\\u066A \\u0627\\u0646\\u0628\\u0627\\u0634\\u062A\\u0647",groupedBarTooltip:"\\u06AF\\u0631\\u0648\\u0647\\u06CC",stackedBarTooltip:"\\u0627\\u0646\\u0628\\u0627\\u0634\\u062A\\u0647",normalizedBarTooltip:"\\u06F1\\u06F0\\u06F0\\u066A \\u0627\\u0646\\u0628\\u0627\\u0634\\u062A\\u0647",pieTooltip:"\\u062F\\u0627\\u06CC\\u0631\\u0647\\u200C\\u0627\\u06CC",donutTooltip:"\\u062F\\u0648\\u0646\\u0627\\u062A",lineTooltip:"\\u062E\\u0637",groupedAreaTooltip:"\\u0645\\u0646\\u0637\\u0642\\u0647 \\u06AF\\u0631\\u0648\\u0647\\u06CC';
      S = S + '",stackedAreaTooltip:"\\u0627\\u0646\\u0628\\u0627\\u0634\\u062A\\u0647",normalizedAreaTooltip:"\\u06F1\\u06F0\\u06F0\\u066A \\u0627\\u0646\\u0628\\u0627\\u0634\\u062A\\u0647",scatterTooltip:"\\u067E\\u0631\\u0627\\u06A9\\u0646\\u062F\\u0647",bubbleTooltip:"\\u062D\\u0628\\u0627\\u0628",histogramTooltip:"\\u0647\\u06CC\\u0633\\u062A\\u0648\\u06AF\\u0631\\u0627\\u0645",radialColumnTooltip:"\\u0633\\u062A\\u0648\\u0646 \\u0634\\u0639\\u0627\\u0639\\u06CC",radialBarTooltip:"\\u0646\\u0648\\u0627\\u0631 \\u0634\\u0639\\u0627\\u0639\\u06CC",radarLineTooltip:"\\u062E\\u0637 \\u0631\\u0627\\u062F\\u0627\\u0631\\u06CC",radarAreaTooltip:"\\u0645\\u0646\\u0637\\u0642\\u0647 \\u0631\\u0627\\u062F\\u0627\\u0631\\u06CC",nightingaleTooltip:"\\u0646\\u0627\\u06CC\\u062A\\u200C\\u0627\\u0646\\u06AF\\u0644",rangeBarTooltip:"\\u0646\\u0648\\u0627\\u0631 \\u0645\\u062D\\u062F\\u0648\\u062F\\u0647",rangeAreaTooltip:"\\u0645\\u0646\\u0637\\u0642\\u0647 \\u0645\\u062D\\u062F\\u0648\\u062F\\u0647",boxPlotTooltip:"\\u0646\\u0645\\u0648\\u062F\\u0627\\u0631 \\u062C\\u0639\\u0628\\u0647\\u200C\\u0627\\u06CC",treemapTooltip:"\\u0646\\u0642\\u0634\\u0647 \\u062F\\u0631\\u062E\\u062A\\u06CC",sunburstTooltip:"\\u062D\\u0644\\u0642\\u0647\\u200C\\u0647\\u0627\\u06CC \\u062E\\u0648\\u0631\\u0634\\u06CC\\u062F",waterfallTooltip:"\\u0622\\u0628\\u0634\\u0627\\u0631",heatmapTooltip:"\\u0646\\u0642\\u0634\\u0647 \\u062D\\u0631\\u0627\\u0631\\u062A\\u06CC",columnLineComboTooltip:"\\u0633\\u062A\\u0648\\u0646 \\u0648 \\u062E\\u0637",areaColumnComboTooltip:"\\u0645\\u0646\\u0637\\u0642\\u0647 \\u0648 \\u0633\\u062A\\u0648\\u0646",customComboTooltip:"\\u062A\\u0631\\u06A9\\u06CC\\u0628 \\u0633\\u0641\\u0627\\u0631\\u0634\\u06CC",innerRadius:"\\u0634\\u0639\\u0627\\u0639 \\u062F\\u0627\\u062E\\u0644\\u06CC",startAngle:"\\u0632\\u0627\\u0648\\u06CC\\u0647 \\u0634\\u0631\\u0648\\u0639",endAngle:"\\u0632\\u0627\\u0648\\u06CC\\u0647 \\u067E\\u0627\\u06CC\\u0627\\u0646",reverseDirection:"\\u0628\\u0631\\u06AF\\u0634\\u062A \\u062C\\u0647\\u062A",groupPadding:"\\u062D\\u0627\\u0634\\u06CC\\u0647 \\u06AF\\u0631\\u0648\\u0647",seriesPadding:"\\u062D\\u0627\\u0634\\u06CC\\u0647 \\u0645\\u062C\\u0645\\u0648\\u0639\\u0647 \\u062F\\u0627\\u062F\\u0647\\u200C';
      S = S + '\\u0647\\u0627",tile:"\\u06A9\\u0627\\u0634\\u06CC",whisker:"\\u0633\\u0628\\u06CC\\u0644",cap:"\\u067E\\u0648\\u0634\\u0634",capLengthRatio:"\\u0646\\u0633\\u0628\\u062A \\u0637\\u0648\\u0644 \\u067E\\u0648\\u0634\\u0634",labelPlacement:"\\u0645\\u062D\\u0644 \\u0642\\u0631\\u0627\\u0631\\u06AF\\u06CC\\u0631\\u06CC \\u0628\\u0631\\u0686\\u0633\\u0628",inside:"\\u062F\\u0627\\u062E\\u0644",outside:"\\u062E\\u0627\\u0631\\u062C",noDataToChart:"\\u062F\\u0627\\u062F\\u0647\\u200C\\u0647\\u0627\\u06CC \\u0645\\u0648\\u062C\\u0648\\u062F \\u0628\\u0631\\u0627\\u06CC \\u062A\\u0631\\u0633\\u06CC\\u0645 \\u0646\\u0645\\u0648\\u062F\\u0627\\u0631 \\u0646\\u06CC\\u0633\\u062A.",pivotChartRequiresPivotMode:"\\u0646\\u0645\\u0648\\u062F\\u0627\\u0631 \\u0645\\u062D\\u0648\\u0631 \\u0646\\u06CC\\u0627\\u0632 \\u0628\\u0647 \\u062D\\u0627\\u0644\\u062A \\u0645\\u062D\\u0648\\u0631\\u06CC \\u0641\\u0639\\u0627\\u0644 \\u062F\\u0627\\u0631\\u062F.",chartSettingsToolbarTooltip:"\\u0645\\u0646\\u0648",chartLinkToolbarTooltip:"\\u067E\\u06CC\\u0648\\u0646\\u062F \\u0628\\u0627 \\u0634\\u0628\\u06A9\\u0647",chartUnlinkToolbarTooltip:"\\u0628\\u062F\\u0648\\u0646 \\u067E\\u06CC\\u0648\\u0646\\u062F \\u0627\\u0632 \\u0634\\u0628\\u06A9\\u0647",chartDownloadToolbarTooltip:"\\u062F\\u0627\\u0646\\u0644\\u0648\\u062F \\u0646\\u0645\\u0648\\u062F\\u0627\\u0631",chartMenuToolbarTooltip:"\\u0645\\u0646\\u0648",chartEdit:"\\u0648\\u06CC\\u0631\\u0627\\u06CC\\u0634 \\u0646\\u0645\\u0648\\u062F\\u0627\\u0631",chartAdvancedSettings:"\\u062A\\u0646\\u0638\\u06CC\\u0645\\u0627\\u062A \\u067E\\u06CC\\u0634\\u0631\\u0641\\u062A\\u0647",chartLink:"\\u067E\\u06CC\\u0648\\u0646\\u062F \\u0628\\u0627 \\u0634\\u0628\\u06A9\\u0647",chartUnlink:"\\u0628\\u062F\\u0648\\u0646 \\u067E\\u06CC\\u0648\\u0646\\u062F \\u0627\\u0632 \\u0634\\u0628\\u06A9\\u0647",chartDownload:"\\u062F\\u0627\\u0646\\u0644\\u0648\\u062F \\u0646\\u0645\\u0648\\u062F\\u0627\\u0631",histogramFrequency:"\\u0641\\u0631\\u06A9\\u0627\\u0646\\u0633",seriesChartType:"\\u0646\\u0648\\u0639 \\u0646\\u0645\\u0648\\u062F\\u0627\\u0631 \\u0645\\u062C\\u0645\\u0648\\u0639\\u0647 \\u062F\\u0627\\u062F\\u0647\\u200C\\u0647\\u0627",seriesType:"\\u0646\\u0648\\u0639 \\u0645\\u062C\\u0645\\u0648\\u0639\\u';
      S = S + '0647 \\u062F\\u0627\\u062F\\u0647",secondaryAxis:"\\u0645\\u062D\\u0648\\u0631 \\u0641\\u0631\\u0639\\u06CC",seriesAdd:"\\u0627\\u0641\\u0632\\u0648\\u062F\\u0646 \\u06CC\\u06A9 \\u0645\\u062C\\u0645\\u0648\\u0639\\u0647 \\u062F\\u0627\\u062F\\u0647",categoryAdd:"\\u0627\\u0641\\u0632\\u0648\\u062F\\u0646 \\u06CC\\u06A9 \\u062F\\u0633\\u062A\\u0647",bar:"\\u0646\\u0648\\u0627\\u0631",column:"\\u0633\\u062A\\u0648\\u0646",histogram:"\\u0647\\u06CC\\u0633\\u062A\\u0648\\u06AF\\u0631\\u0627\\u0645",advancedSettings:"\\u062A\\u0646\\u0638\\u06CC\\u0645\\u0627\\u062A \\u067E\\u06CC\\u0634\\u0631\\u0641\\u062A\\u0647",direction:"\\u062C\\u0647\\u062A",horizontal:"\\u0627\\u0641\\u0642\\u06CC",vertical:"\\u0639\\u0645\\u0648\\u062F\\u06CC",seriesGroupType:"\\u0646\\u0648\\u0639 \\u06AF\\u0631\\u0648\\u0647",groupedSeriesGroupType:"\\u06AF\\u0631\\u0648\\u0647\\u200C\\u0628\\u0646\\u062F\\u06CC\\u200C\\u0634\\u062F\\u0647",stackedSeriesGroupType:"\\u0627\\u0646\\u0628\\u0627\\u0634\\u062A\\u0647",normalizedSeriesGroupType:"\\u06F1\\u06F0\\u06F0\\u066A \\u0627\\u0646\\u0628\\u0627\\u0634\\u062A\\u0647",legendEnabled:"\\u0641\\u0639\\u0627\\u0644",invalidColor:"\\u0645\\u0642\\u062F\\u0627\\u0631 \\u0631\\u0646\\u06AF \\u0646\\u0627\\u0645\\u0639\\u062A\\u0628\\u0631 \\u0627\\u0633\\u062A",groupedColumnFull:"\\u0633\\u062A\\u0648\\u0646 \\u06AF\\u0631\\u0648\\u0647\\u200C\\u0628\\u0646\\u062F\\u06CC\\u200C\\u0634\\u062F\\u0647",stackedColumnFull:"\\u0633\\u062A\\u0648\\u0646 \\u0627\\u0646\\u0628\\u0627\\u0634\\u062A\\u0647",normalizedColumnFull:"\\u06F1\\u06F0\\u06F0\\u066A \\u0633\\u062A\\u0648\\u0646 \\u0627\\u0646\\u0628\\u0627\\u0634\\u062A\\u0647",groupedBarFull:"\\u0646\\u0648\\u0627\\u0631 \\u06AF\\u0631\\u0648\\u0647\\u200C\\u0628\\u0646\\u062F\\u06CC\\u200C\\u0634\\u062F\\u0647",stackedBarFull:"\\u0646\\u0648\\u0627\\u0631 \\u0627\\u0646\\u0628\\u0627\\u0634\\u062A\\u0647",normalizedBarFull:"\\u06F1\\u06F0\\u06F0\\u066A \\u0646\\u0648\\u0627\\u0631 \\u0627\\u0646\\u0628\\u0627\\u0634\\u062A\\u0647",stackedAreaFull:"\\u0645\\u0646\\u0637\\u0642\\u0647 \\u0627\\u0646\\u0628\\u0627\\u0634\\u062A\\u0647",normalizedAreaFull:"\\u06F1\\u06F0\\u06F0\\u066A \\u0645\\u0646\\u0637\\u0642\\u0647 \\u0627\\u0646\\u0628\\u0627\\u063';
      S = S + '4\\u062A\\u0647",customCombo:"\\u062A\\u0631\\u06A9\\u06CC\\u0628 \\u0633\\u0641\\u0627\\u0631\\u0634\\u06CC",ariaAdvancedFilterBuilderItem:"${variable}. \\u0633\\u0637\\u062D ${variable}. \\u06A9\\u0644\\u06CC\\u062F ENTER \\u0631\\u0627 \\u0641\\u0634\\u0627\\u0631 \\u062F\\u0647\\u06CC\\u062F \\u062A\\u0627 \\u0648\\u06CC\\u0631\\u0627\\u06CC\\u0634 \\u0634\\u0648\\u062F.",ariaAdvancedFilterBuilderItemValidation:"${variable}. \\u0633\\u0637\\u062D ${variable}. ${variable} \\u06A9\\u0644\\u06CC\\u062F ENTER \\u0631\\u0627 \\u0641\\u0634\\u0627\\u0631 \\u062F\\u0647\\u06CC\\u062F \\u062A\\u0627 \\u0648\\u06CC\\u0631\\u0627\\u06CC\\u0634 \\u0634\\u0648\\u062F.",ariaAdvancedFilterBuilderList:"\\u0644\\u06CC\\u0633\\u062A \\u0633\\u0627\\u0632\\u0646\\u062F\\u0647 \\u0641\\u06CC\\u0644\\u062A\\u0631 \\u067E\\u06CC\\u0634\\u0631\\u0641\\u062A\\u0647",ariaAdvancedFilterBuilderFilterItem:"\\u0634\\u0631\\u0637 \\u0641\\u06CC\\u0644\\u062A\\u0631",ariaAdvancedFilterBuilderGroupItem:"\\u06AF\\u0631\\u0648\\u0647 \\u0641\\u06CC\\u0644\\u062A\\u0631",ariaAdvancedFilterBuilderColumn:"\\u0633\\u062A\\u0648\\u0646",ariaAdvancedFilterBuilderOption:"\\u06AF\\u0632\\u06CC\\u0646\\u0647",ariaAdvancedFilterBuilderValueP:"\\u0627\\u0631\\u0632\\u0634",ariaAdvancedFilterBuilderJoinOperator:"\\u0639\\u0645\\u0644\\u06AF\\u0631 \\u0627\\u062A\\u0635\\u0627\\u0644",ariaAdvancedFilterInput:"\\u0648\\u0631\\u0648\\u062F\\u06CC \\u0641\\u06CC\\u0644\\u062A\\u0631 \\u067E\\u06CC\\u0634\\u0631\\u0641\\u062A\\u0647",ariaChecked:"\\u0627\\u0646\\u062A\\u062E\\u0627\\u0628 \\u0634\\u062F\\u0647",ariaColumn:"\\u0633\\u062A\\u0648\\u0646",ariaColumnGroup:"\\u06AF\\u0631\\u0648\\u0647 \\u0633\\u062A\\u0648\\u0646",ariaColumnFiltered:"\\u0633\\u062A\\u0648\\u0646 \\u0641\\u06CC\\u0644\\u062A\\u0631 \\u0634\\u062F\\u0647",ariaColumnSelectAll:"\\u062A\\u063A\\u06CC\\u06CC\\u0631 \\u0627\\u0646\\u062A\\u062E\\u0627\\u0628 \\u0647\\u0645\\u0647 \\u0633\\u062A\\u0648\\u0646\\u200C\\u0647\\u0627",ariaDateFilterInput:"\\u0648\\u0631\\u0648\\u062F\\u06CC \\u0641\\u06CC\\u0644\\u062A\\u0631 \\u062A\\u0627\\u0631\\u06CC\\u062E",ariaDefaultListName:"\\u0644\\u06CC\\u0633\\u062A",ariaFilterColumnsInput:"\\u0648\\u0631\\u0648\\u062F';
      S = S + '\\u06CC \\u0641\\u06CC\\u0644\\u062A\\u0631 \\u0633\\u062A\\u0648\\u0646\\u200C\\u0647\\u0627",ariaFilterFromValue:"\\u0641\\u06CC\\u0644\\u062A\\u0631 \\u0627\\u0632 \\u0645\\u0642\\u062F\\u0627\\u0631",ariaFilterInput:"\\u0648\\u0631\\u0648\\u062F\\u06CC \\u0641\\u06CC\\u0644\\u062A\\u0631",ariaFilterList:"\\u0644\\u06CC\\u0633\\u062A \\u0641\\u06CC\\u0644\\u062A\\u0631",ariaFilterToValue:"\\u0641\\u06CC\\u0644\\u062A\\u0631 \\u062A\\u0627 \\u0645\\u0642\\u062F\\u0627\\u0631",ariaFilterValue:"\\u0645\\u0642\\u062F\\u0627\\u0631 \\u0641\\u06CC\\u0644\\u062A\\u0631",ariaFilterMenuOpen:"\\u0628\\u0627\\u0632 \\u06A9\\u0631\\u062F\\u0646 \\u0645\\u0646\\u0648\\u06CC \\u0641\\u06CC\\u0644\\u062A\\u0631",ariaFilteringOperator:"\\u0639\\u0645\\u0644\\u06AF\\u0631 \\u0641\\u06CC\\u0644\\u062A\\u0631 \\u06A9\\u0631\\u062F\\u0646",ariaHidden:"\\u0645\\u062E\\u0641\\u06CC",ariaIndeterminate:"\\u0646\\u0627\\u0645\\u0634\\u062E\\u0635",ariaInputEditor:"\\u0648\\u06CC\\u0631\\u0627\\u06CC\\u0634\\u06AF\\u0631 \\u0648\\u0631\\u0648\\u062F\\u06CC",ariaMenuColumn:"ALT+\\u067E\\u0627\\u06CC\\u06CC\\u0646 \\u0631\\u0627 \\u0641\\u0634\\u0627\\u0631 \\u062F\\u0647\\u06CC\\u062F \\u062A\\u0627 \\u0645\\u0646\\u0648\\u06CC \\u0633\\u062A\\u0648\\u0646 \\u0628\\u0627\\u0632 \\u0634\\u0648\\u062F",ariaFilterColumn:"CTRL+ENTER \\u0631\\u0627 \\u0641\\u0634\\u0627\\u0631 \\u062F\\u0647\\u06CC\\u062F \\u062A\\u0627 \\u0641\\u06CC\\u0644\\u062A\\u0631 \\u0631\\u0627 \\u0628\\u0627\\u0632 \\u06A9\\u0646\\u06CC\\u062F",ariaRowDeselect:"SPACE \\u0631\\u0627 \\u0641\\u0634\\u0627\\u0631 \\u062F\\u0647\\u06CC\\u062F \\u062A\\u0627 \\u0627\\u06CC\\u0646 \\u0633\\u0637\\u0631 \\u0627\\u0632 \\u0627\\u0646\\u062A\\u062E\\u0627\\u0628 \\u062E\\u0627\\u0631\\u062C \\u0634\\u0648\\u062F",ariaRowSelectAll:"SPACE \\u0631\\u0627 \\u0641\\u0634\\u0627\\u0631 \\u062F\\u0647\\u06CC\\u062F \\u062A\\u0627 \\u0647\\u0645\\u0647 \\u0633\\u0637\\u0631\\u0647\\u0627 \\u0627\\u0646\\u062A\\u062E\\u0627\\u0628/\\u063A\\u06CC\\u0631\\u0641\\u0639\\u0627\\u0644 \\u0634\\u0648\\u0646\\u062F",ariaRowToggleSelection:"SPACE \\u0631\\u0627 \\u0641\\u0634\\u0627\\u0631 \\u062F\\u0647\\u06CC\\u062F \\u062A\\u0627 \\u0627\\u0646\\u062A\\u062E\\u0627\\u0628 \\u0633\\u0637\\u0631 \\u062A\\u';
      S = S + '063A\\u06CC\\u06CC\\u0631 \\u06CC\\u0627\\u0628\\u062F",ariaRowSelect:"SPACE \\u0631\\u0627 \\u0641\\u0634\\u0627\\u0631 \\u062F\\u0647\\u06CC\\u062F \\u062A\\u0627 \\u0627\\u06CC\\u0646 \\u0633\\u0637\\u0631 \\u0627\\u0646\\u062A\\u062E\\u0627\\u0628 \\u0634\\u0648\\u062F",ariaRowSelectionDisabled:"\\u0627\\u0646\\u062A\\u062E\\u0627\\u0628 \\u0633\\u0637\\u0631 \\u0628\\u0631\\u0627\\u06CC \\u0627\\u06CC\\u0646 \\u0633\\u0637\\u0631 \\u063A\\u06CC\\u0631\\u0641\\u0639\\u0627\\u0644 \\u0627\\u0633\\u062A",ariaSearch:"\\u062C\\u0633\\u062A\\u062C\\u0648",ariaSortableColumn:"ENTER \\u0631\\u0627 \\u0641\\u0634\\u0627\\u0631 \\u062F\\u0647\\u06CC\\u062F \\u062A\\u0627 \\u0645\\u0631\\u062A\\u0628 \\u0634\\u0648\\u062F",ariaToggleVisibility:"SPACE \\u0631\\u0627 \\u0641\\u0634\\u0627\\u0631 \\u062F\\u0647\\u06CC\\u062F \\u062A\\u0627 \\u0642\\u0627\\u0628\\u0644\\u06CC\\u062A \\u0631\\u0648\\u06CC\\u062A \\u062A\\u063A\\u06CC\\u06CC\\u0631 \\u06CC\\u0627\\u0628\\u062F",ariaToggleCellValue:"SPACE \\u0631\\u0627 \\u0641\\u0634\\u0627\\u0631 \\u062F\\u0647\\u06CC\\u062F \\u062A\\u0627 \\u0645\\u0642\\u062F\\u0627\\u0631 \\u0633\\u0644\\u0648\\u0644 \\u062A\\u063A\\u06CC\\u06CC\\u0631 \\u06CC\\u0627\\u0628\\u062F",ariaUnchecked:"\\u0627\\u0646\\u062A\\u062E\\u0627\\u0628 \\u0646\\u0634\\u062F\\u0647",ariaVisible:"\\u0642\\u0627\\u0628\\u0644 \\u0645\\u0634\\u0627\\u0647\\u062F\\u0647",ariaSearchFilterValues:"\\u0645\\u0642\\u0627\\u062F\\u06CC\\u0631 \\u0641\\u06CC\\u0644\\u062A\\u0631 \\u062C\\u0633\\u062A\\u062C\\u0648",ariaPageSizeSelectorLabel:"\\u0627\\u0646\\u062F\\u0627\\u0632\\u0647 \\u0635\\u0641\\u062D\\u0647",ariaChartMenuClose:"\\u0628\\u0633\\u062A\\u0646 \\u0645\\u0646\\u0648\\u06CC \\u0648\\u06CC\\u0631\\u0627\\u06CC\\u0634 \\u0646\\u0645\\u0648\\u062F\\u0627\\u0631",ariaChartSelected:"\\u0627\\u0646\\u062A\\u062E\\u0627\\u0628 \\u0634\\u062F\\u0647",ariaSkeletonCellLoadingFailed:"\\u0628\\u0627\\u0631\\u06AF\\u06CC\\u0631\\u06CC \\u0631\\u062F\\u06CC\\u0641 \\u0646\\u0627\\u0645\\u0648\\u0641\\u0642 \\u0628\\u0648\\u062F",ariaSkeletonCellLoading:"\\u062F\\u0627\\u062F\\u0647\\u200C\\u0647\\u0627\\u06CC \\u0631\\u062F\\u06CC\\u0641 \\u062F\\u0631 \\u062D\\u0627\\u0644 \\u0628\\u0627\\u0631\\u06AF\\u06CC\\u0631\\u06CC \\u';
      S = S + '0627\\u0633\\u062A",ariaRowGroupDropZonePanelLabel:"\\u06AF\\u0631\\u0648\\u0647\\u200C\\u0647\\u0627\\u06CC \\u0631\\u062F\\u06CC\\u0641\\u06CC",ariaValuesDropZonePanelLabel:"\\u0645\\u0642\\u0627\\u062F\\u06CC\\u0631",ariaPivotDropZonePanelLabel:"\\u0628\\u0631\\u0686\\u0633\\u0628\\u200C\\u0647\\u0627\\u06CC \\u0633\\u062A\\u0648\\u0646",ariaDropZoneColumnComponentDescription:"\\u0628\\u0631\\u0627\\u06CC \\u062D\\u0630\\u0641 \\u06A9\\u0644\\u06CC\\u062F DELETE \\u0631\\u0627 \\u0641\\u0634\\u0627\\u0631 \\u062F\\u0647\\u06CC\\u062F",ariaDropZoneColumnValueItemDescription:"\\u0628\\u0631\\u0627\\u06CC \\u062A\\u063A\\u06CC\\u06CC\\u0631 \\u0646\\u0648\\u0639 \\u062A\\u062C\\u0645\\u0639 \\u06A9\\u0644\\u06CC\\u062F ENTER \\u0631\\u0627 \\u0641\\u0634\\u0627\\u0631 \\u062F\\u0647\\u06CC\\u062F",ariaDropZoneColumnGroupItemDescription:"\\u0628\\u0631\\u0627\\u06CC \\u0645\\u0631\\u062A\\u0628\\u200C\\u0633\\u0627\\u0632\\u06CC \\u06A9\\u0644\\u06CC\\u062F ENTER \\u0631\\u0627 \\u0641\\u0634\\u0627\\u0631 \\u062F\\u0647\\u06CC\\u062F",ariaDropZoneColumnComponentAggFuncSeparator:" \\u0627\\u0632 ",ariaDropZoneColumnComponentSortAscending:"\\u0635\\u0639\\u0648\\u062F\\u06CC",ariaDropZoneColumnComponentSortDescending:"\\u0646\\u0632\\u0648\\u0644\\u06CC",ariaLabelDialog:"\\u06AF\\u0641\\u062A\\u06AF\\u0648",ariaLabelColumnMenu:"\\u0645\\u0646\\u0648\\u06CC \\u0633\\u062A\\u0648\\u0646",ariaLabelColumnFilter:"\\u0641\\u06CC\\u0644\\u062A\\u0631 \\u0633\\u062A\\u0648\\u0646",ariaLabelCellEditor:"\\u0648\\u06CC\\u0631\\u0627\\u06CC\\u0634\\u06AF\\u0631 \\u0633\\u0644\\u0648\\u0644",ariaLabelSelectField:"\\u0627\\u0646\\u062A\\u062E\\u0627\\u0628 \\u0641\\u06CC\\u0644\\u062F",ariaLabelRichSelectField:"\\u0641\\u06CC\\u0644\\u062F \\u0627\\u0646\\u062A\\u062E\\u0627\\u0628 \\u063A\\u0646\\u06CC",ariaLabelRichSelectToggleSelection:"\\u0628\\u0631\\u0627\\u06CC \\u062A\\u063A\\u06CC\\u06CC\\u0631 \\u0627\\u0646\\u062A\\u062E\\u0627\\u0628 SPACE \\u0631\\u0627 \\u0641\\u0634\\u0627\\u0631 \\u062F\\u0647\\u06CC\\u062F",ariaLabelRichSelectDeselectAllItems:"\\u0628\\u0631\\u0627\\u06CC \\u0644\\u063A\\u0648 \\u0627\\u0646\\u062A\\u062E\\u0627\\u0628 \\u0647\\u0645\\u0647 \\u0645\\u0648\\u0627\\u0631\\';
      S = S + 'u062F DELETE \\u0631\\u0627 \\u0641\\u0634\\u0627\\u0631 \\u062F\\u0647\\u06CC\\u062F",ariaLabelRichSelectDeleteSelection:"\\u0628\\u0631\\u0627\\u06CC \\u0644\\u063A\\u0648 \\u0627\\u0646\\u062A\\u062E\\u0627\\u0628 \\u0645\\u0648\\u0631\\u062F DELETE \\u0631\\u0627 \\u0641\\u0634\\u0627\\u0631 \\u062F\\u0647\\u06CC\\u062F",ariaLabelTooltip:"\\u0627\\u0628\\u0632\\u0627\\u0631\\u06A9",ariaLabelContextMenu:"\\u0645\\u0646\\u0648\\u06CC \\u0632\\u0645\\u06CC\\u0646\\u0647\\u200C\\u0627\\u06CC",ariaLabelSubMenu:"\\u0632\\u06CC\\u0631\\u0645\\u0646\\u0648",ariaLabelAggregationFunction:"\\u062A\\u0627\\u0628\\u0639 \\u062A\\u062C\\u0645\\u0639",ariaLabelAdvancedFilterAutocomplete:"\\u062A\\u06A9\\u0645\\u06CC\\u0644 \\u062E\\u0648\\u062F\\u06A9\\u0627\\u0631 \\u0641\\u06CC\\u0644\\u062A\\u0631 \\u067E\\u06CC\\u0634\\u0631\\u0641\\u062A\\u0647",ariaLabelAdvancedFilterBuilderAddField:"\\u0627\\u0641\\u0632\\u0648\\u062F\\u0646 \\u0641\\u06CC\\u0644\\u062F \\u062C\\u062F\\u06CC\\u062F \\u0628\\u0647 \\u0633\\u0627\\u0632\\u0646\\u062F\\u0647 \\u0641\\u06CC\\u0644\\u062A\\u0631 \\u067E\\u06CC\\u0634\\u0631\\u0641\\u062A\\u0647",ariaLabelAdvancedFilterBuilderColumnSelectField:"\\u0641\\u06CC\\u0644\\u062F \\u0627\\u0646\\u062A\\u062E\\u0627\\u0628 \\u0633\\u062A\\u0648\\u0646 \\u0633\\u0627\\u0632\\u0646\\u062F\\u0647 \\u0641\\u06CC\\u0644\\u062A\\u0631 \\u067E\\u06CC\\u0634\\u0631\\u0641\\u062A\\u0647",ariaLabelAdvancedFilterBuilderOptionSelectField:"\\u0641\\u06CC\\u0644\\u062F \\u0627\\u0646\\u062A\\u062E\\u0627\\u0628 \\u06AF\\u0632\\u06CC\\u0646\\u0647 \\u0633\\u0627\\u0632\\u0646\\u062F\\u0647 \\u0641\\u06CC\\u0644\\u062A\\u0631 \\u067E\\u06CC\\u0634\\u0631\\u0641\\u062A\\u0647",ariaLabelAdvancedFilterBuilderJoinSelectField:"\\u0641\\u06CC\\u0644\\u062F \\u0627\\u0646\\u062A\\u062E\\u0627\\u0628 \\u0639\\u0645\\u0644\\u06AF\\u0631 \\u067E\\u06CC\\u0648\\u0633\\u062A\\u0646 \\u0633\\u0627\\u0632\\u0646\\u062F\\u0647 \\u0641\\u06CC\\u0644\\u062A\\u0631 \\u067E\\u06CC\\u0634\\u0631\\u0641\\u062A\\u0647",ariaColumnPanelList:"\\u0641\\u0647\\u0631\\u0633\\u062A \\u0633\\u062A\\u0648\\u0646\\u200C\\u0647\\u0627",ariaFilterPanelList:"\\u0641\\u0647\\u0631\\u0633\\u062A \\u0641\\u06CC\\u0644\\u062A\\u0631\\u0647\\u0627",thous';
      S = S + 'andSeparator:"\\u060C",decimalSeparator:".",true:"\\u062F\\u0631\\u0633\\u062A",false:"\\u0646\\u0627\\u062F\\u0631\\u0633\\u062A",invalidDate:"\\u062A\\u0627\\u0631\\u06CC\\u062E \\u0646\\u0627\\u0645\\u0639\\u062A\\u0628\\u0631",invalidNumber:"\\u0639\\u062F\\u062F \\u0646\\u0627\\u0645\\u0639\\u062A\\u0628\\u0631",january:"\\u0698\\u0627\\u0646\\u0648\\u06CC\\u0647",february:"\\u0641\\u0648\\u0631\\u06CC\\u0647",march:"\\u0645\\u0627\\u0631\\u0633",april:"\\u0622\\u0648\\u0631\\u06CC\\u0644",may:"\\u0645\\u0647",june:"\\u0698\\u0648\\u0626\\u0646",july:"\\u0698\\u0648\\u0626\\u06CC\\u0647",august:"\\u0627\\u0648\\u062A",september:"\\u0633\\u067E\\u062A\\u0627\\u0645\\u0628\\u0631",october:"\\u0627\\u06A9\\u062A\\u0628\\u0631",november:"\\u0646\\u0648\\u0627\\u0645\\u0628\\u0631",december:"\\u062F\\u0633\\u0627\\u0645\\u0628\\u0631",timeFormatSlashesDDMMYYYY:"\\u0631\\u0648\\u0632/\\u0645\\u0627\\u0647/\\u0633\\u0627\\u0644",timeFormatSlashesMMDDYYYY:"\\u0645\\u0627\\u0647/\\u0631\\u0648\\u0632/\\u0633\\u0627\\u0644",timeFormatSlashesDDMMYY:"\\u0631\\u0648\\u0632/\\u0645\\u0627\\u0647/\\u0633\\u0627\\u0644",timeFormatSlashesMMDDYY:"\\u0645\\u0627\\u0647/\\u0631\\u0648\\u0632/\\u0633\\u0627\\u0644",timeFormatDotsDDMYY:"\\u0631\\u0648\\u0632.\\u0645\\u0627\\u0647.\\u0633\\u0627\\u0644",timeFormatDotsMDDYY:"\\u0645\\u0627\\u0647.\\u0631\\u0648\\u0632.\\u0633\\u0627\\u0644",timeFormatDashesYYYYMMDD:"\\u0633\\u0627\\u0644-\\u0645\\u0627\\u0647-\\u0631\\u0648\\u0632",timeFormatSpacesDDMMMMYYYY:"\\u0631\\u0648\\u0632 \\u0645\\u0627\\u0647 \\u0633\\u0627\\u0644",timeFormatHHMMSS:"\\u0633\\u0627\\u0639\\u062A:\\u062F\\u0642\\u06CC\\u0642\\u0647:\\u062B\\u0627\\u0646\\u06CC\\u0647",timeFormatHHMMSSAmPm:"\\u0633\\u0627\\u0639\\u062A:\\u062F\\u0642\\u06CC\\u0642\\u0647:\\u062B\\u0627\\u0646\\u06CC\\u0647 \\u0642\\u0628\\u0644/\\u0628\\u0639\\u062F \\u0627\\u0632 \\u0638\\u0647\\u0631"},Y={selectAll:"(Zaznacz wszystko)",selectAllSearchResults:"(Zaznacz wszystkie wyniki wyszukiwania)",addCurrentSelectionToFilter:"Dodaj bie\\u017C\\u0105cy wyb\\xF3r do filtra",searchOoo:"Szukaj...",blanks:"(Puste)",noMatches:"Brak wynik\\xF3w",filterOoo:"Filtruj...",equals:"R\\xF3wna si\\u0119",notE';
      S = S + 'qual:"Nie r\\xF3wna si\\u0119",blank:"Puste",notBlank:"Niepuste",empty:"Wybierz jeden",lessThan:"Mniej ni\\u017C",greaterThan:"Wi\\u0119cej ni\\u017C",lessThanOrEqual:"Mniej lub r\\xF3wne",greaterThanOrEqual:"Wi\\u0119cej lub r\\xF3wne",inRange:"Pomi\\u0119dzy",inRangeStart:"Od",inRangeEnd:"Do",contains:"Zawiera",notContains:"Nie zawiera",startsWith:"Zaczyna si\\u0119 od",endsWith:"Ko\\u0144czy si\\u0119 na",dateFormatOoo:"yyyy-mm-dd",before:"Przed",after:"Po",andCondition:"I",orCondition:"LUB",applyFilter:"Zastosuj",resetFilter:"Resetuj",clearFilter:"Wyczy\\u015B\\u0107",cancelFilter:"Anuluj",textFilter:"Filtr tekstu",numberFilter:"Filtr liczb",dateFilter:"Filtr dat",setFilter:"Filtr zbioru",groupFilterSelect:"Wybierz pole:",advancedFilterContains:"zawiera",advancedFilterNotContains:"nie zawiera",advancedFilterTextEquals:"r\\xF3wna si\\u0119",advancedFilterTextNotEqual:"nie r\\xF3wna si\\u0119",advancedFilterStartsWith:"zaczyna si\\u0119 od",advancedFilterEndsWith:"ko\\u0144czy si\\u0119 na",advancedFilterBlank:"jest puste",advancedFilterNotBlank:"nie jest puste",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"jest prawd\\u0105",advancedFilterFalse:"jest fa\\u0142szem",advancedFilterAnd:"AND",advancedFilterOr:"OR",advancedFilterApply:"Zastosuj",advancedFilterBuilder:"Kreator",advancedFilterValidationMissingColumn:"Brak kolumny",advancedFilterValidationMissingOption:"Brak opcji",advancedFilterValidationMissingValue:"Brak warto\\u015Bci",advancedFilterValidationInvalidColumn:"Kolumna nie istnieje",advancedFilterValidationInvalidOption:"Opcja nie istnieje",advancedFilterValidationMissingQuote:"Brak ko\\u0144cowego cudzys\\u0142owu",advancedFilterValidationNotANumber:"Warto\\u015B\\u0107 nie jest liczb\\u0105",advancedFilterValidationInvalidDate:"Warto\\u015B\\u0107 nie jest prawid\\u0142ow\\u0105 dat\\u0105",advancedFilterValidationMissingCondition:';
      S = S + '"Brak warunku",advancedFilterValidationJoinOperatorMismatch:"Operatory \\u0142\\u0105czenia w ramach warunku musz\\u0105 by\\u0107 takie same",advancedFilterValidationInvalidJoinOperator:"Operator \\u0142\\u0105czenia nie istnieje",advancedFilterValidationMissingEndBracket:"Brak ko\\u0144cowego nawiasu",advancedFilterValidationExtraEndBracket:"Za du\\u017Co ko\\u0144cowych nawias\\xF3w",advancedFilterValidationMessage:"Wyra\\u017Cenie zawiera b\\u0142\\u0105d. ${variable} - ${variable}.",advancedFilterValidationMessageAtEnd:"Wyra\\u017Cenie zawiera b\\u0142\\u0105d. ${variable} na ko\\u0144cu wyra\\u017Cenia.",advancedFilterBuilderTitle:"Zaawansowany filtr",advancedFilterBuilderApply:"Zastosuj",advancedFilterBuilderCancel:"Anuluj",advancedFilterBuilderAddButtonTooltip:"Dodaj filtr lub grup\\u0119",advancedFilterBuilderRemoveButtonTooltip:"Usu\\u0144",advancedFilterBuilderMoveUpButtonTooltip:"Przenie\\u015B w g\\xF3r\\u0119",advancedFilterBuilderMoveDownButtonTooltip:"Przenie\\u015B w d\\xF3\\u0142",advancedFilterBuilderAddJoin:"Dodaj grup\\u0119",advancedFilterBuilderAddCondition:"Dodaj filtr",advancedFilterBuilderSelectColumn:"Wybierz kolumn\\u0119",advancedFilterBuilderSelectOption:"Wybierz opcj\\u0119",advancedFilterBuilderEnterValue:"Wpisz warto\\u015B\\u0107...",advancedFilterBuilderValidationAlreadyApplied:"Obecny filtr ju\\u017C zastosowany.",advancedFilterBuilderValidationIncomplete:"Nie wszystkie warunki s\\u0105 kompletne.",advancedFilterBuilderValidationSelectColumn:"Musisz wybra\\u0107 kolumn\\u0119.",advancedFilterBuilderValidationSelectOption:"Musisz wybra\\u0107 opcj\\u0119.",advancedFilterBuilderValidationEnterValue:"Musisz wpisa\\u0107 warto\\u015B\\u0107.",columns:"Kolumny",filters:"Filtry",pivotMode:"Tryb przestawny",groups:"Grupy wierszy",rowGroupColumnsEmptyMessage:"Przeci\\u0105gnij tutaj, aby ustawi\\u0107 grupy wierszy",values:"Warto\\u015Bci",valueColumnsEmptyMessage:"Przeci\\u0105gnij tutaj, aby agregowa\\u0107",pivots:"Etykiety kolumn",pivotColumnsEmptyMessage:"Przeci\\u0105gnij tutaj';
      S = S + ', aby ustawi\\u0107 etykiety kolumn",group:"Grupa",rowDragRow:"wiersz",rowDragRows:"wiersze",loadingOoo:"\\u0141adowanie...",loadingError:"B\\u0141\\u0104D",noRowsToShow:"Brak wierszy do wy\\u015Bwietlenia",enabled:"W\\u0142\\u0105czone",pinColumn:"Przypnij Kolumn\\u0119",pinLeft:"Przypnij z Lewa",pinRight:"Przypnij z Prawa",noPin:"Nie Przypinaj",valueAggregation:"Agregacja Warto\\u015Bci",noAggregation:"Brak",autosizeThisColumn:"Autozmiar tej Kolumny",autosizeAllColumns:"Autozmiar wszystkich Kolumn",groupBy:"Grupuj wed\\u0142ug",ungroupBy:"Rozgrupuj wed\\u0142ug",ungroupAll:"Rozgrupuj Wszystko",addToValues:"Dodaj ${variable} do warto\\u015Bci",removeFromValues:"Usu\\u0144 ${variable} z warto\\u015Bci",addToLabels:"Dodaj ${variable} do etykiet",removeFromLabels:"Usu\\u0144 ${variable} z etykiet",resetColumns:"Zresetuj Kolumny",expandAll:"Rozwi\\u0144 Wszystkie Grupy Wierszy",collapseAll:"Zwi\\u0144 Wszystkie Grupy Wierszy",copy:"Kopiuj",ctrlC:"Ctrl+C",ctrlX:"Ctrl+X",copyWithHeaders:"Kopiuj z Nag\\u0142\\xF3wkami",copyWithGroupHeaders:"Kopiuj z Nag\\u0142\\xF3wkami Grup",cut:"Wytnij",paste:"Wklej",ctrlV:"Ctrl+V",export:"Eksportuj",csvExport:"Eksport CSV",excelExport:"Eksport Excel",columnFilter:"Filtr Kolumny",columnChooser:"Wybierz Kolumny",sortAscending:"Sortuj Rosn\\u0105co",sortDescending:"Sortuj Malej\\u0105co",sortUnSort:"Usu\\u0144 Sortowanie",sum:"Suma",first:"Pierwszy",last:"Ostatni",min:"Min",max:"Maks",none:"Brak",count:"Liczba",avg:"\\u015Arednia",filteredRows:"Filtrowane",selectedRows:"Wybrane",totalRows:"Ca\\u0142kowita liczba wierszy",totalAndFilteredRows:"Wiersze",more:"Wi\\u0119cej",to:"do",of:"z",page:"Strona",pageLastRowUnknown:"?",nextPage:"Nast\\u0119pna Strona",lastPage:"Ostatnia Strona",firstPage:"Pierwsza Strona",previousPage:"Poprzednia Strona",pageSizeSelectorLabel:"Rozmiar strony:",footerTotal:"Razem",pivotColumnGroupTotals:"Suma",pivotChartAndPivotMode:"Pivotowy wykres i tryb przestawny",pivotChart:"Wykres przestawny",chartRange:"Zakres danych wykresu",columnChart:"K';
      S = S + 'olumnowy",groupedColumn:"Grupowany",stackedColumn:"Skumulowany",normalizedColumn:"100% Skumulowany",barChart:"S\\u0142upkowy",groupedBar:"Grupowany",stackedBar:"Skumulowany",normalizedBar:"100% Skumulowany",pieChart:"Ko\\u0142owy",pie:"Ko\\u0142owy",donut:"Pier\\u015Bcieniowy",line:"Liniowy",xyChart:"XY (Punktowy)",scatter:"Punktowy",bubble:"B\\u0105belkowy",areaChart:"Obszarowy",area:"Obszarowy",stackedArea:"Skumulowany",normalizedArea:"100% Skumulowany",histogramChart:"Histogram",polarChart:"Polarny",radarLine:"Liniowy radarowy",radarArea:"Obszarowy radarowy",nightingale:"Nightingale",radialColumn:"Kolumnowy radialny",radialBar:"S\\u0142upkowy radialny",statisticalChart:"Statystyczny",boxPlot:"Wykres ramkowy",rangeBar:"Zakres s\\u0142upkowy",rangeArea:"Zakres obszarowy",hierarchicalChart:"Hierarchiczny",treemap:"Mapa drzewa",sunburst:"S\\u0142oneczny",specializedChart:"Specjalizowany",waterfall:"Kaskadowy",heatmap:"Mapa cieplna",combinationChart:"Po\\u0142\\u0105czony",columnLineCombo:"Kolumna i linia",AreaColumnCombo:"Obszar i kolumna",pivotChartTitle:"Wykres przestawny",rangeChartTitle:"Wykres zakresu",settings:"Wykres",data:"Ustawienia",format:"Dostosuj",categories:"Kategorie",defaultCategory:"(Brak)",series:"Serie",switchCategorySeries:"Prze\\u0142\\u0105cz kategori\\u0119 / seri\\u0119",categoryValues:"Warto\\u015Bci kategorii",seriesLabels:"Etykiety serii",aggregate:"Agreguj",xyValues:"Warto\\u015Bci XY",paired:"Tryb parowania",axis:"O\\u015B",xAxis:"O\\u015B pozioma",yAxis:"O\\u015B pionowa",polarAxis:"O\\u015B polarna",radiusAxis:"O\\u015B promieniowa",navigator:"Nawigator",zoom:"Powi\\u0119kszenie",animation:"Animacja",crosshair:"Krzy\\u017Cyk",color:"Kolor",thickness:"Grubo\\u015B\\u0107",preferredLength:"Preferowana d\\u0142ugo\\u015B\\u0107",xType:"Typ X",axisType:"Typ osi",automatic:"Automatyczne",category:"Kategoria",number:"Liczba",time:"Czas",timeFormat:"Format czasu",autoRotate:"Auto obr\\xF3t",labelRotation:"Obr\\xF3t etykiety",circle:"Okr\\u0105g",polygon:"Wielok\\u0105t",squa';
      S = S + 're:"Kwadrat",cross:"Krzy\\u017Cyk",diamond:"Romb",plus:"Plus",triangle:"Tr\\xF3jk\\u0105t",heart:"Serce",orientation:"Orientacja",fixed:"Sta\\u0142a",parallel:"R\\xF3wnoleg\\u0142a",perpendicular:"Prostopad\\u0142a",radiusAxisPosition:"Pozycja",ticks:"Znaczniki",gridLines:"Linie siatki",width:"Szeroko\\u015B\\u0107",height:"Wysoko\\u015B\\u0107",length:"D\\u0142ugo\\u015B\\u0107",padding:"Margines",spacing:"Odst\\u0119py",chartStyle:"Styl wykresu",title:"Tytu\\u0142",chartTitles:"Tytu\\u0142y",chartTitle:"Tytu\\u0142 wykresu",chartSubtitle:"Podtytu\\u0142",horizontalAxisTitle:"Tytu\\u0142 osi poziomej",verticalAxisTitle:"Tytu\\u0142 osi pionowej",polarAxisTitle:"Tytu\\u0142 osi polarnej",titlePlaceholder:"Tytu\\u0142 wykresu",background:"T\\u0142o",font:"Czcionka",weight:"Waga",top:"G\\xF3ra",right:"Prawo",bottom:"D\\xF3\\u0142",left:"Lewo",labels:"Etykiety",calloutLabels:"Etykiety wywo\\u0142a\\u0144",sectorLabels:"Etykiety sektorowe",positionRatio:"Stosunek pozycji",size:"Rozmiar",shape:"Kszta\\u0142t",minSize:"Minimalny rozmiar",maxSize:"Maksymalny rozmiar",legend:"Legenda",position:"Pozycja",markerSize:"Rozmiar znacznika",markerStroke:"Obrys znacznika",markerPadding:"Margines znacznika",itemSpacing:"Odst\\u0119p przedmiotu",itemPaddingX:"Margines przedmiotu X",itemPaddingY:"Margines przedmiotu Y",layoutHorizontalSpacing:"Odst\\u0119p poziomy",layoutVerticalSpacing:"Odst\\u0119p pionowy",strokeWidth:"Szeroko\\u015B\\u0107 linii",offset:"Przesuni\\u0119cie",offsets:"Przesuni\\u0119cia",tooltips:"Podpowiedzi",callout:"Wywo\\u0142anie",markers:"Znaczniki",shadow:"Cie\\u0144",blur:"Rozmycie",xOffset:"Przesuni\\u0119cie X",yOffset:"Przesuni\\u0119cie Y",lineWidth:"Szeroko\\u015B\\u0107 linii",lineDash:"Kreskowanie",lineDashOffset:"Przesuni\\u0119cie kreskowania",scrollingZoom:"Powi\\u0119kszenie przewijania",scrollingStep:"Krok przewijania",selectingZoom:"Powi\\u0119kszenie wybrania",durationMillis:"Czas trwania (ms)",crosshairLabel:"Etykieta krzy\\u017Cyka",crosshairSnap:"Przyci\\u0105ganie do w\\u0119z\\u0142a",nor';
      S = S + 'mal:"Normalny",bold:"Pogrubiony",italic:"Kursywa",boldItalic:"Pogrubiona kursywa",predefined:"Zdefiniowane",fillOpacity:"Przezroczysto\\u015B\\u0107 wype\\u0142nienia",strokeColor:"Kolor linii",strokeOpacity:"Przezroczysto\\u015B\\u0107 linii",miniChart:"Mini-wykres",histogramBinCount:"Liczba koszy",connectorLine:"Linia \\u0142\\u0105cz\\u0105ca",seriesItems:"Elementy serii",seriesItemType:"Typ elementu",seriesItemPositive:"Pozytywne",seriesItemNegative:"Negatywne",seriesItemLabels:"Etykiety element\\xF3w",columnGroup:"Kolumna",barGroup:"S\\u0142upek",pieGroup:"Wykres ko\\u0142owy",lineGroup:"Linia",scatterGroup:"XY (Punktowy)",areaGroup:"Powierzchnia",polarGroup:"Polarny",statisticalGroup:"Statystyczny",hierarchicalGroup:"Hierarchiczny",specializedGroup:"Specjalistyczny",combinationGroup:"Kombinacja",groupedColumnTooltip:"Grupowane",stackedColumnTooltip:"Skumulowane",normalizedColumnTooltip:"100% skumulowane",groupedBarTooltip:"Grupowane",stackedBarTooltip:"Skumulowane",normalizedBarTooltip:"100% skumulowane",pieTooltip:"Wykres ko\\u0142owy",donutTooltip:"Pier\\u015Bcieniowy",lineTooltip:"Linia",groupedAreaTooltip:"Powierzchnia",stackedAreaTooltip:"Skumulowana",normalizedAreaTooltip:"100% skumulowana",scatterTooltip:"Punktowy",bubbleTooltip:"B\\u0105belkowy",histogramTooltip:"Histogram",radialColumnTooltip:"Kolumna radialna",radialBarTooltip:"S\\u0142upek radialny",radarLineTooltip:"Linia radarowa",radarAreaTooltip:"Powierzchnia radarowa",nightingaleTooltip:"Nightingale",rangeBarTooltip:"S\\u0142upek zakresu",rangeAreaTooltip:"Powierzchnia zakresu",boxPlotTooltip:"Wykres ramkowy",treemapTooltip:"Mapa drzewa",sunburstTooltip:"Sunburst",waterfallTooltip:"Kaskadowy",heatmapTooltip:"Mapa cieplna",columnLineComboTooltip:"Kolumna i linia",areaColumnComboTooltip:"Powierzchnia i kolumna",customComboTooltip:"W\\u0142asna kombinacja",innerRadius:"Promie\\u0144 wewn\\u0119trzny",startAngle:"K\\u0105t pocz\\u0105tkowy",endAngle:"K\\u0105t ko\\u0144cowy",reverseDirection:"Odwr\\xF3\\u0107 kierunek",gro';
      S = S + 'upPadding:"Margines grupy",seriesPadding:"Margines serii",tile:"Kafel",whisker:"W\\u0105s",cap:"Kapturek",capLengthRatio:"Stosunek d\\u0142ugo\\u015Bci",labelPlacement:"Umiejscowienie etykiety",inside:"Wewn\\u0105trz",outside:"Na zewn\\u0105trz",noDataToChart:"Brak danych do narysowania.",pivotChartRequiresPivotMode:"Wykres przestawny wymaga w\\u0142\\u0105czenia trybu przestawnego.",chartSettingsToolbarTooltip:"Menu",chartLinkToolbarTooltip:"Po\\u0142\\u0105czony z siatk\\u0105",chartUnlinkToolbarTooltip:"Od\\u0142\\u0105czony od siatki",chartDownloadToolbarTooltip:"Pobierz wykres",chartMenuToolbarTooltip:"Menu",chartEdit:"Edytuj wykres",chartAdvancedSettings:"Zaawansowane ustawienia",chartLink:"Po\\u0142\\u0105cz z siatk\\u0105",chartUnlink:"Od\\u0142\\u0105cz od siatki",chartDownload:"Pobierz wykres",histogramFrequency:"Cz\\u0119stotliwo\\u015B\\u0107",seriesChartType:"Typ wykresu serii",seriesType:"Typ serii",secondaryAxis:"Druga o\\u015B",seriesAdd:"Dodaj seri\\u0119",categoryAdd:"Dodaj kategori\\u0119",bar:"S\\u0142upek",column:"Kolumna",histogram:"Histogram",advancedSettings:"Zaawansowane ustawienia",direction:"Kierunek",horizontal:"Poziomy",vertical:"Pionowy",seriesGroupType:"Typ grupy",groupedSeriesGroupType:"Grupowane",stackedSeriesGroupType:"Skumulowane",normalizedSeriesGroupType:"100% skumulowane",legendEnabled:"W\\u0142\\u0105czone",invalidColor:"B\\u0142\\u0119dna warto\\u015B\\u0107 koloru",groupedColumnFull:"Grupowana kolumna",stackedColumnFull:"Skumulowana kolumna",normalizedColumnFull:"100% skumulowana kolumna",groupedBarFull:"Grupowany s\\u0142upek",stackedBarFull:"Skumulowany s\\u0142upek",normalizedBarFull:"100% skumulowany s\\u0142upek",stackedAreaFull:"Skumulowana powierzchnia",normalizedAreaFull:"100% skumulowana powierzchnia",customCombo:"W\\u0142asna kombinacja",ariaAdvancedFilterBuilderItem:"${variable}. Poziom ${variable}. Naci\\u015Bnij ENTER, aby edytowa\\u0107",ariaAdvancedFilterBuilderItemValidation:"${variable}. Poziom ${variable}. ${variable} Naci\\u015Bnij ENTER, aby ';
      S = S + 'edytowa\\u0107.",ariaAdvancedFilterBuilderList:"Zaawansowana Lista Kreatora Filtr\\xF3w",ariaAdvancedFilterBuilderFilterItem:"Warunek Filtra",ariaAdvancedFilterBuilderGroupItem:"Grupa Filtr\\xF3w",ariaAdvancedFilterBuilderColumn:"Kolumna",ariaAdvancedFilterBuilderOption:"Opcja",ariaAdvancedFilterBuilderValueP:"Warto\\u015B\\u0107",ariaAdvancedFilterBuilderJoinOperator:"Operator Po\\u0142\\u0105czenia",ariaAdvancedFilterInput:"Zaawansowane Wej\\u015Bcie Filtra",ariaChecked:"zaznaczone",ariaColumn:"Kolumna",ariaColumnGroup:"Grupa Kolumn",ariaColumnFiltered:"Kolumna Filtrowana",ariaColumnSelectAll:"Prze\\u0142\\u0105cz Zaznaczenie Wszystkich Kolumn",ariaDateFilterInput:"Wej\\u015Bcie Filtra Daty",ariaDefaultListName:"Lista",ariaFilterColumnsInput:"Wej\\u015Bcie Filtrowania Kolumn",ariaFilterFromValue:"Filtr od warto\\u015Bci",ariaFilterInput:"Wej\\u015Bcie Filtra",ariaFilterList:"Lista Filtrowania",ariaFilterToValue:"Filtr do warto\\u015Bci",ariaFilterValue:"Warto\\u015B\\u0107 Filtra",ariaFilterMenuOpen:"Otw\\xF3rz Menu Filtr\\xF3w",ariaFilteringOperator:"Operator Filtrowania",ariaHidden:"ukryte",ariaIndeterminate:"nieokre\\u015Blone",ariaInputEditor:"Edytor Wej\\u015Bcia",ariaMenuColumn:"Naci\\u015Bnij ALT w d\\xF3\\u0142, aby otworzy\\u0107 menu kolumny",ariaFilterColumn:"Naci\\u015Bnij CTRL ENTER, aby otworzy\\u0107 filtr",ariaRowDeselect:"Naci\\u015Bnij SPACJ\\u0118, aby odznaczy\\u0107 ten wiersz",ariaRowSelectAll:"Naci\\u015Bnij SPACJ\\u0118, aby prze\\u0142\\u0105czy\\u0107 zaznaczenie wszystkich wierszy",ariaRowToggleSelection:"Naci\\u015Bnij SPACJ\\u0118, aby prze\\u0142\\u0105czy\\u0107 zaznaczenie wiersza",ariaRowSelect:"Naci\\u015Bnij SPACJ\\u0118, aby zaznaczy\\u0107 ten wiersz",ariaRowSelectionDisabled:"Zaznaczenie wiersza jest wy\\u0142\\u0105czone dla tego wiersza",ariaSearch:"Szukaj",ariaSortableColumn:"Naci\\u015Bnij ENTER, aby sortowa\\u0107",ariaToggleVisibility:"Naci\\u015Bnij SPACJ\\u0118, aby prze\\u0142\\u0105czy\\u0107 widoczno\\u015B\\u0107",ariaToggleCellValue:"Naci\\u015Bnij SPACJ\\u0118, aby pr';
      S = S + 'ze\\u0142\\u0105czy\\u0107 warto\\u015B\\u0107 kom\\xF3rki",ariaUnchecked:"niezaznaczone",ariaVisible:"widoczny",ariaSearchFilterValues:"Szukaj warto\\u015Bci filtr\\xF3w",ariaPageSizeSelectorLabel:"Rozmiar Strony",ariaChartMenuClose:"Zamknij Menu Edycji Wykresu",ariaChartSelected:"Wybrane",ariaSkeletonCellLoadingFailed:"Wiersz nie uda\\u0142o si\\u0119 za\\u0142adowa\\u0107",ariaSkeletonCellLoading:"Dane wiersza \\u0142aduj\\u0105 si\\u0119",ariaRowGroupDropZonePanelLabel:"Grupy wierszy",ariaValuesDropZonePanelLabel:"Warto\\u015Bci",ariaPivotDropZonePanelLabel:"Etykiety kolumn",ariaDropZoneColumnComponentDescription:"Naci\\u015Bnij DELETE, aby usun\\u0105\\u0107",ariaDropZoneColumnValueItemDescription:"Naci\\u015Bnij ENTER, aby zmieni\\u0107 typ agregacji",ariaDropZoneColumnGroupItemDescription:"Naci\\u015Bnij ENTER, aby sortowa\\u0107",ariaDropZoneColumnComponentAggFuncSeparator:" z ",ariaDropZoneColumnComponentSortAscending:"rosn\\u0105co",ariaDropZoneColumnComponentSortDescending:"malej\\u0105co",ariaLabelDialog:"Dialog",ariaLabelColumnMenu:"Menu kolumny",ariaLabelColumnFilter:"Filtr kolumny",ariaLabelCellEditor:"Edytor kom\\xF3rek",ariaLabelSelectField:"Wybierz pole",ariaLabelRichSelectField:"Pole z wyborem zaawansowanym",ariaLabelRichSelectToggleSelection:"Naci\\u015Bnij SPACJ\\u0118, aby prze\\u0142\\u0105czy\\u0107 wyb\\xF3r",ariaLabelRichSelectDeselectAllItems:"Naci\\u015Bnij DELETE, aby odznaczy\\u0107 wszystkie elementy",ariaLabelRichSelectDeleteSelection:"Naci\\u015Bnij DELETE, aby odznaczy\\u0107 element",ariaLabelTooltip:"Etykieta",ariaLabelContextMenu:"Menu kontekstowe",ariaLabelSubMenu:"Podmenu",ariaLabelAggregationFunction:"Funkcja agregacji",ariaLabelAdvancedFilterAutocomplete:"Zaawansowane Autouzupe\\u0142nianie Filtr\\xF3w",ariaLabelAdvancedFilterBuilderAddField:"Zaawansowany Kreator Filtr\\xF3w Dodaj Pole",ariaLabelAdvancedFilterBuilderColumnSelectField:"Zaawansowany Kreator Filtr\\xF3w Wyb\\xF3r Kolumny",ariaLabelAdvancedFilterBuilderOptionSelectField:"Zaawansowany Kreator Filtr\\xF3w ';
      S = S + 'Wyb\\xF3r Opcji",ariaLabelAdvancedFilterBuilderJoinSelectField:"Zaawansowany Kreator Filtr\\xF3w Wyb\\xF3r Operatora \\u0141\\u0105czenia",ariaColumnPanelList:"Lista kolumn",ariaFilterPanelList:"Lista filtr\\xF3w",thousandSeparator:",",decimalSeparator:".",true:"Prawda",false:"Fa\\u0142sz",invalidDate:"Nieprawid\\u0142owa Data",invalidNumber:"Nieprawid\\u0142owy Numer",january:"Stycze\\u0144",february:"Luty",march:"Marzec",april:"Kwiecie\\u0144",may:"Maj",june:"Czerwiec",july:"Lipiec",august:"Sierpie\\u0144",september:"Wrzesie\\u0144",october:"Pa\\u017Adziernik",november:"Listopad",december:"Grudzie\\u0144",timeFormatSlashesDDMMYYYY:"DD/MM/RRRR",timeFormatSlashesMMDDYYYY:"MM/DD/RRRR",timeFormatSlashesDDMMYY:"DD/MM/RR",timeFormatSlashesMMDDYY:"MM/DD/RR",timeFormatDotsDDMYY:"DD.M.RR",timeFormatDotsMDDYY:"M.DD.RR",timeFormatDashesYYYYMMDD:"RRRR-MM-DD",timeFormatSpacesDDMMMMYYYY:"DD MMMM RRRR",timeFormatHHMMSS:"GG:MM:SS",timeFormatHHMMSSAmPm:"GG:MM:SS AM/PM"},O={selectAll:"(Selecionar Todos)",selectAllSearchResults:"(Selecionar Todos os Resultados da Pesquisa)",addCurrentSelectionToFilter:"Adicionar sele\\xE7\\xE3o atual ao filtro",searchOoo:"Pesquisar...",blanks:"(Em Branco)",noMatches:"Sem correspond\\xEAncias",filterOoo:"Filtrar...",equals:"Igual",notEqual:"Diferente de",blank:"Em branco",notBlank:"N\\xE3o est\\xE1 em branco",empty:"Escolha um",lessThan:"Menor que",greaterThan:"Maior que",lessThanOrEqual:"Menor ou igual a",greaterThanOrEqual:"Maior ou igual a",inRange:"Entre",inRangeStart:"De",inRangeEnd:"Para",contains:"Cont\\xE9m",notContains:"N\\xE3o cont\\xE9m",startsWith:"Come\\xE7a com",endsWith:"Termina com",dateFormatOoo:"yyyy-mm-dd",before:"Antes",after:"Depois",andCondition:"E",orCondition:"OU",applyFilter:"Aplicar",resetFilter:"Redefinir",clearFilter:"Limpar",cancelFilter:"Cancelar",textFilter:"Filtro de Texto",numberFilter:"Filtro Num\\xE9rico",dateFilter:"Filtro de Data",setFilter:"Filtro de Conjunto",groupFilterSelect:"Selecionar campo:",advancedFilterContains:"cont\\xE9m",advan';
      S = S + 'cedFilterNotContains:"n\\xE3o cont\\xE9m",advancedFilterTextEquals:"\\xE9 igual a",advancedFilterTextNotEqual:"n\\xE3o \\xE9 igual a",advancedFilterStartsWith:"come\\xE7a com",advancedFilterEndsWith:"termina com",advancedFilterBlank:"est\\xE1 em branco",advancedFilterNotBlank:"n\\xE3o est\\xE1 em branco",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"\\xE9 verdadeiro",advancedFilterFalse:"\\xE9 falso",advancedFilterAnd:"E",advancedFilterOr:"OU",advancedFilterApply:"Aplicar",advancedFilterBuilder:"Construtor",advancedFilterValidationMissingColumn:"Coluna est\\xE1 faltando",advancedFilterValidationMissingOption:"Op\\xE7\\xE3o est\\xE1 faltando",advancedFilterValidationMissingValue:"Valor est\\xE1 faltando",advancedFilterValidationInvalidColumn:"Coluna n\\xE3o encontrada",advancedFilterValidationInvalidOption:"Op\\xE7\\xE3o n\\xE3o encontrada",advancedFilterValidationMissingQuote:"Valor est\\xE1 faltando uma aspa final",advancedFilterValidationNotANumber:"Valor n\\xE3o \\xE9 um n\\xFAmero",advancedFilterValidationInvalidDate:"Valor n\\xE3o \\xE9 uma data v\\xE1lida",advancedFilterValidationMissingCondition:"Condi\\xE7\\xE3o est\\xE1 faltando",advancedFilterValidationJoinOperatorMismatch:"Operadores de jun\\xE7\\xE3o dentro de uma condi\\xE7\\xE3o devem ser os mesmos",advancedFilterValidationInvalidJoinOperator:"Operador de jun\\xE7\\xE3o n\\xE3o encontrado",advancedFilterValidationMissingEndBracket:"Faltando colchete final",advancedFilterValidationExtraEndBracket:"Colchetes finais em excesso",advancedFilterValidationMessage:"Express\\xE3o tem um erro. ${variable} - ${variable}.",advancedFilterValidationMessageAtEnd:"Express\\xE3o tem um erro. ${variable} no final da express\\xE3o.",advancedFilterBuilderTitle:"Filtro Avan\\xE7ado",advancedFilterBuilderApply:"Aplicar",advancedFilterBuilderCancel:"Cancelar",advancedFilterBuilderAddButtonTooltip:"Adicionar Fil';
      S = S + 'tro ou Grupo",advancedFilterBuilderRemoveButtonTooltip:"Remover",advancedFilterBuilderMoveUpButtonTooltip:"Mover para Cima",advancedFilterBuilderMoveDownButtonTooltip:"Mover para Baixo",advancedFilterBuilderAddJoin:"Adicionar Grupo",advancedFilterBuilderAddCondition:"Adicionar Filtro",advancedFilterBuilderSelectColumn:"Selecionar uma coluna",advancedFilterBuilderSelectOption:"Selecionar uma op\\xE7\\xE3o",advancedFilterBuilderEnterValue:"Digite um valor...",advancedFilterBuilderValidationAlreadyApplied:"Filtro atual j\\xE1 aplicado.",advancedFilterBuilderValidationIncomplete:"Nem todas as condi\\xE7\\xF5es est\\xE3o completas.",advancedFilterBuilderValidationSelectColumn:"Deve selecionar uma coluna.",advancedFilterBuilderValidationSelectOption:"Deve selecionar uma op\\xE7\\xE3o.",advancedFilterBuilderValidationEnterValue:"Deve digitar um valor.",columns:"Colunas",filters:"Filtros",pivotMode:"Modo Pivot",groups:"Agrupamentos de Linhas",rowGroupColumnsEmptyMessage:"Arraste aqui para definir os grupos de linhas",values:"Valores",valueColumnsEmptyMessage:"Arraste aqui para agregar",pivots:"R\\xF3tulos de Colunas",pivotColumnsEmptyMessage:"Arraste aqui para definir os r\\xF3tulos das colunas",group:"Grupo",rowDragRow:"linha",rowDragRows:"linhas",loadingOoo:"Carregando...",loadingError:"ERR",noRowsToShow:"Sem linhas para mostrar",enabled:"Ativado",pinColumn:"Fixar Coluna",pinLeft:"Fixar \\xE0 Esquerda",pinRight:"Fixar \\xE0 Direita",noPin:"Sem Fixa\\xE7\\xE3o",valueAggregation:"Agrega\\xE7\\xE3o de Valor",noAggregation:"Nenhum",autosizeThisColumn:"Autoajustar Esta Coluna",autosizeAllColumns:"Autoajustar Todas as Colunas",groupBy:"Agrupar por",ungroupBy:"Desagrupar por",ungroupAll:"Desagrupar Todos",addToValues:"Adicionar ${variable} aos valores",removeFromValues:"Remover ${variable} dos valores",addToLabels:"Adicionar ${variable} aos r\\xF3tulos",removeFromLabels:"Remover ${variable} dos r\\xF3tulos",resetColumns:"Redefinir Colunas",expandAll:"Expandir Todos os Grupos de Linhas",collapseAl';
      S = S + 'l:"Fechar Todos os Grupos de Linhas",copy:"Copiar",ctrlC:"Ctrl+C",ctrlX:"Ctrl+X",copyWithHeaders:"Copiar com Cabe\\xE7alhos",copyWithGroupHeaders:"Copiar com Cabe\\xE7alhos de Grupo",cut:"Cortar",paste:"Colar",ctrlV:"Ctrl+V",export:"Exportar",csvExport:"Exportar CSV",excelExport:"Exportar Excel",columnFilter:"Filtro de Coluna",columnChooser:"Escolher Colunas",sortAscending:"Ordenar Crescente",sortDescending:"Ordenar Decrescente",sortUnSort:"Limpar Ordena\\xE7\\xE3o",sum:"Soma",first:"Primeiro",last:"\\xDAltimo",min:"M\\xEDnimo",max:"M\\xE1ximo",none:"Nenhum",count:"Contar",avg:"M\\xE9dia",filteredRows:"Filtradas",selectedRows:"Selecionadas",totalRows:"Total de Linhas",totalAndFilteredRows:"Linhas",more:"Mais",to:"at\\xE9",of:"de",page:"P\\xE1gina",pageLastRowUnknown:"?",nextPage:"Pr\\xF3xima P\\xE1gina",lastPage:"\\xDAltima P\\xE1gina",firstPage:"Primeira P\\xE1gina",previousPage:"P\\xE1gina Anterior",pageSizeSelectorLabel:"Tamanho da P\\xE1gina:",footerTotal:"Total",pivotColumnGroupTotals:"Total",pivotChartAndPivotMode:"Gr\\xE1fico de Pivot e Modo Pivot",pivotChart:"Gr\\xE1fico de Pivot",chartRange:"Intervalo do Gr\\xE1fico",columnChart:"Coluna",groupedColumn:"Agrupada",stackedColumn:"Empilhada",normalizedColumn:"100% Empilhada",barChart:"Barra",groupedBar:"Agrupada",stackedBar:"Empilhada",normalizedBar:"100% Empilhada",pieChart:"Pizza",pie:"Pizza",donut:"Rosca",line:"Linha",xyChart:"X Y (Dispers\\xE3o)",scatter:"Dispers\\xE3o",bubble:"Bolha",areaChart:"\\xC1rea",area:"\\xC1rea",stackedArea:"Empilhada",normalizedArea:"100% Empilhada",histogramChart:"Histograma",polarChart:"Polar",radarLine:"Linha de Radar",radarArea:"\\xC1rea de Radar",nightingale:"Nightingale",radialColumn:"Coluna Radial",radialBar:"Barra Radial",statisticalChart:"Estat\\xEDstico",boxPlot:"Gr\\xE1fico de Caixa",rangeBar:"Barra de Intervalo",rangeArea:"\\xC1rea de Intervalo",hierarchicalChart:"Hier\\xE1rquico",treemap:"Mapa de \\xC1rvore",sunburst:"Explos\\xE3o Solar",specializedChart:"Especializado",waterfall:"Cascata",heatmap:';
      S = S + '"Mapa de Calor",combinationChart:"Combina\\xE7\\xE3o",columnLineCombo:"Coluna & Linha",AreaColumnCombo:"\\xC1rea & Coluna",pivotChartTitle:"Gr\\xE1fico Din\\xE2mico",rangeChartTitle:"Gr\\xE1fico de Intervalo",settings:"Gr\\xE1fico",data:"Configurar",format:"Personalizar",categories:"Categorias",defaultCategory:"(Nenhuma)",series:"S\\xE9ries",switchCategorySeries:"Trocar Categoria / S\\xE9rie",categoryValues:"Valores de Categoria",seriesLabels:"R\\xF3tulos das S\\xE9ries",aggregate:"Agregado",xyValues:"Valores XY",paired:"Modo Pareado",axis:"Eixo",xAxis:"Eixo Horizontal",yAxis:"Eixo Vertical",polarAxis:"Eixo Polar",radiusAxis:"Eixo do Raio",navigator:"Navegador",zoom:"Zoom",animation:"Anima\\xE7\\xE3o",crosshair:"Mira",color:"Cor",thickness:"Espessura",preferredLength:"Comprimento Preferido",xType:"Tipo X",axisType:"Tipo de Eixo",automatic:"Autom\\xE1tico",category:"Categoria",number:"N\\xFAmero",time:"Tempo",timeFormat:"Formato de Tempo",autoRotate:"Rota\\xE7\\xE3o Autom\\xE1tica",labelRotation:"Rota\\xE7\\xE3o",circle:"C\\xEDrculo",polygon:"Pol\\xEDgono",square:"Quadrado",cross:"Cruz",diamond:"Diamante",plus:"Mais",triangle:"Tri\\xE2ngulo",heart:"Cora\\xE7\\xE3o",orientation:"Orienta\\xE7\\xE3o",fixed:"Fixo",parallel:"Paralelo",perpendicular:"Perpendicular",radiusAxisPosition:"Posi\\xE7\\xE3o",ticks:"Marcas",gridLines:"Linhas de Grade",width:"Largura",height:"Altura",length:"Comprimento",padding:"Preenchimento",spacing:"Espa\\xE7amento",chartStyle:"Estilo do Gr\\xE1fico",title:"T\\xEDtulo",chartTitles:"T\\xEDtulos",chartTitle:"T\\xEDtulo do Gr\\xE1fico",chartSubtitle:"Subt\\xEDtulo",horizontalAxisTitle:"T\\xEDtulo do Eixo Horizontal",verticalAxisTitle:"T\\xEDtulo do Eixo Vertical",polarAxisTitle:"T\\xEDtulo do Eixo Polar",titlePlaceholder:"T\\xEDtulo do Gr\\xE1fico",background:"Fundo",font:"Fonte",weight:"Peso",top:"Topo",right:"Direita",bottom:"Fundo",left:"Esquerda",labels:"R\\xF3tulos",calloutLabels:"R\\xF3tulos de Chamada",sectorLabels:"R\\xF3tulos de Setor",positionRatio:"Raz\\xE3o de Posi\\xE7\\xE3o",size';
      S = S + ':"Tamanho",shape:"Forma",minSize:"Tamanho M\\xEDnimo",maxSize:"Tamanho M\\xE1ximo",legend:"Legenda",position:"Posi\\xE7\\xE3o",markerSize:"Tamanho do Marcador",markerStroke:"Contorno do Marcador",markerPadding:"Preenchimento do Marcador",itemSpacing:"Espa\\xE7amento do Item",itemPaddingX:"Preenchimento do Item X",itemPaddingY:"Preenchimento do Item Y",layoutHorizontalSpacing:"Espa\\xE7amento Horizontal",layoutVerticalSpacing:"Espa\\xE7amento Vertical",strokeWidth:"Largura do Tra\\xE7o",offset:"Deslocamento",offsets:"Deslocamentos",tooltips:"Dicas de Ferramenta",callout:"Chamada",markers:"Marcadores",shadow:"Sombra",blur:"Desfoque",xOffset:"Deslocamento X",yOffset:"Deslocamento Y",lineWidth:"Largura da Linha",lineDash:"Tracejado da Linha",lineDashOffset:"Deslocamento do Tracejado",scrollingZoom:"Rolagem",scrollingStep:"Passo da Rolagem",selectingZoom:"Selecionando",durationMillis:"Dura\\xE7\\xE3o (ms)",crosshairLabel:"R\\xF3tulo",crosshairSnap:"Ajustar ao N\\xF3",normal:"Normal",bold:"Negrito",italic:"It\\xE1lico",boldItalic:"Negrito It\\xE1lico",predefined:"Pr\\xE9-definido",fillOpacity:"Opacidade do Preenchimento",strokeColor:"Cor da Linha",strokeOpacity:"Opacidade da Linha",miniChart:"Mini-Gr\\xE1fico",histogramBinCount:"Contagem de Classes",connectorLine:"Linha de Conex\\xE3o",seriesItems:"Itens da S\\xE9rie",seriesItemType:"Tipo de Item",seriesItemPositive:"Positivo",seriesItemNegative:"Negativo",seriesItemLabels:"R\\xF3tulos dos Itens",columnGroup:"Coluna",barGroup:"Barra",pieGroup:"Pizza",lineGroup:"Linha",scatterGroup:"XY (Dispers\\xE3o)",areaGroup:"\\xC1rea",polarGroup:"Polar",statisticalGroup:"Estat\\xEDstico",hierarchicalGroup:"Hier\\xE1rquico",specializedGroup:"Especializado",combinationGroup:"Combina\\xE7\\xE3o",groupedColumnTooltip:"Agrupado",stackedColumnTooltip:"Empilhado",normalizedColumnTooltip:"Empilhado 100%",groupedBarTooltip:"Agrupado",stackedBarTooltip:"Empilhado",normalizedBarTooltip:"Empilhado 100%",pieTooltip:"Pizza",donutTooltip:"Rosquinha",lineTooltip:"Linha",grou';
      S = S + 'pedAreaTooltip:"\\xC1rea",stackedAreaTooltip:"Empilhado",normalizedAreaTooltip:"Empilhado 100%",scatterTooltip:"Dispers\\xE3o",bubbleTooltip:"Bolha",histogramTooltip:"Histograma",radialColumnTooltip:"Coluna Radial",radialBarTooltip:"Barra Radial",radarLineTooltip:"Linha de Radar",radarAreaTooltip:"\\xC1rea de Radar",nightingaleTooltip:"Nightingale",rangeBarTooltip:"Barra de Intervalo",rangeAreaTooltip:"\\xC1rea de Intervalo",boxPlotTooltip:"Box Plot",treemapTooltip:"Mapa de \\xC1rvore",sunburstTooltip:"Raios de Sol",waterfallTooltip:"Cascata",heatmapTooltip:"Mapa de Calor",columnLineComboTooltip:"Coluna & Linha",areaColumnComboTooltip:"\\xC1rea & Coluna",customComboTooltip:"Combina\\xE7\\xE3o Personalizada",innerRadius:"Raio Interno",startAngle:"\\xC2ngulo Inicial",endAngle:"\\xC2ngulo Final",reverseDirection:"Inverter Dire\\xE7\\xE3o",groupPadding:"Preenchimento do Grupo",seriesPadding:"Preenchimento da S\\xE9rie",tile:"Azulejo",whisker:"Bigode",cap:"Tampa",capLengthRatio:"Raz\\xE3o do Comprimento",labelPlacement:"Posicionamento",inside:"Dentro",outside:"Fora",noDataToChart:"N\\xE3o h\\xE1 dados dispon\\xEDveis para serem gr\\xE1ficos.",pivotChartRequiresPivotMode:"Gr\\xE1fico Din\\xE2mico requer o Modo Din\\xE2mico ativado.",chartSettingsToolbarTooltip:"Menu",chartLinkToolbarTooltip:"Vinculado \\xE0 Grade",chartUnlinkToolbarTooltip:"Desvinculado da Grade",chartDownloadToolbarTooltip:"Baixar Gr\\xE1fico",chartMenuToolbarTooltip:"Menu",chartEdit:"Editar Gr\\xE1fico",chartAdvancedSettings:"Configura\\xE7\\xF5es Avan\\xE7adas",chartLink:"Vincular \\xE0 Grade",chartUnlink:"Desvincular da Grade",chartDownload:"Baixar Gr\\xE1fico",histogramFrequency:"Frequ\\xEAncia",seriesChartType:"Tipo de Gr\\xE1fico da S\\xE9rie",seriesType:"Tipo de S\\xE9rie",secondaryAxis:"Eixo Secund\\xE1rio",seriesAdd:"Adicionar uma s\\xE9rie",categoryAdd:"Adicionar uma categoria",bar:"Barra",column:"Coluna",histogram:"Histograma",advancedSettings:"Configura\\xE7\\xF5es Avan\\xE7adas",direction:"Dire\\xE7\\xE3o",horizontal:"Horizontal",';
      S = S + 'vertical:"Vertical",seriesGroupType:"Tipo de Grupo",groupedSeriesGroupType:"Agrupado",stackedSeriesGroupType:"Empilhado",normalizedSeriesGroupType:"Empilhado 100%",legendEnabled:"Habilitado",invalidColor:"Valor de cor inv\\xE1lido",groupedColumnFull:"Coluna Agrupada",stackedColumnFull:"Coluna Empilhada",normalizedColumnFull:"Coluna Empilhada 100%",groupedBarFull:"Barra Agrupada",stackedBarFull:"Barra Empilhada",normalizedBarFull:"Barra Empilhada 100%",stackedAreaFull:"\\xC1rea Empilhada",normalizedAreaFull:"\\xC1rea Empilhada 100%",customCombo:"Combina\\xE7\\xE3o Personalizada",ariaAdvancedFilterBuilderItem:"${variable}. N\\xEDvel ${variable}. Pressione ENTER para editar.",ariaAdvancedFilterBuilderItemValidation:"${variable}. N\\xEDvel ${variable}. ${variable} Pressione ENTER para editar.",ariaAdvancedFilterBuilderList:"Lista de Construtores de Filtros Avan\\xE7ados",ariaAdvancedFilterBuilderFilterItem:"Condi\\xE7\\xE3o do Filtro",ariaAdvancedFilterBuilderGroupItem:"Grupo de Filtros",ariaAdvancedFilterBuilderColumn:"Coluna",ariaAdvancedFilterBuilderOption:"Op\\xE7\\xE3o",ariaAdvancedFilterBuilderValueP:"Valor",ariaAdvancedFilterBuilderJoinOperator:"Operador de Jun\\xE7\\xE3o",ariaAdvancedFilterInput:"Entrada de Filtro Avan\\xE7ado",ariaChecked:"marcado",ariaColumn:"Coluna",ariaColumnGroup:"Grupo de Colunas",ariaColumnFiltered:"Coluna Filtrada",ariaColumnSelectAll:"Alternar Selecionar Todas as Colunas",ariaDateFilterInput:"Entrada de Filtro de Data",ariaDefaultListName:"Lista",ariaFilterColumnsInput:"Entrada de Colunas de Filtro",ariaFilterFromValue:"Filtrar do valor",ariaFilterInput:"Entrada de Filtro",ariaFilterList:"Lista de Filtros",ariaFilterToValue:"Filtrar at\\xE9 o valor",ariaFilterValue:"Valor do Filtro",ariaFilterMenuOpen:"Abrir Menu de Filtro",ariaFilteringOperator:"Operador de Filtragem",ariaHidden:"oculto",ariaIndeterminate:"indeterminado",ariaInputEditor:"Editor de Entrada",ariaMenuColumn:"Pressione ALT PARA BAIXO para abrir o menu da coluna",ariaFilterColumn:"Pression';
      S = S + 'e CTRL ENTER para abrir o filtro",ariaRowDeselect:"Pressione SPACE para desselecionar esta linha",ariaRowSelectAll:"Pressione SPACE para alternar a sele\\xE7\\xE3o de todas as linhas",ariaRowToggleSelection:"Pressione SPACE para alternar a sele\\xE7\\xE3o da linha",ariaRowSelect:"Pressione SPACE para selecionar esta linha",ariaRowSelectionDisabled:"A sele\\xE7\\xE3o de linha est\\xE1 desativada para esta linha",ariaSearch:"Pesquisar",ariaSortableColumn:"Pressione ENTER para classificar",ariaToggleVisibility:"Pressione SPACE para alternar a visibilidade",ariaToggleCellValue:"Pressione SPACE para alternar o valor da c\\xE9lula",ariaUnchecked:"desmarcado",ariaVisible:"vis\\xEDvel",ariaSearchFilterValues:"Pesquisar valores de filtro",ariaPageSizeSelectorLabel:"Tamanho da P\\xE1gina",ariaChartMenuClose:"Fechar Menu de Edi\\xE7\\xE3o do Gr\\xE1fico",ariaChartSelected:"Selecionado",ariaSkeletonCellLoadingFailed:"Falha no carregamento da linha",ariaSkeletonCellLoading:"Carregando dados da linha",ariaRowGroupDropZonePanelLabel:"Agrupamento de Linhas",ariaValuesDropZonePanelLabel:"Valores",ariaPivotDropZonePanelLabel:"R\\xF3tulos de Colunas",ariaDropZoneColumnComponentDescription:"Pressione DELETE para remover",ariaDropZoneColumnValueItemDescription:"Pressione ENTER para alterar o tipo de agrega\\xE7\\xE3o",ariaDropZoneColumnGroupItemDescription:"Pressione ENTER para ordenar",ariaDropZoneColumnComponentAggFuncSeparator:" de ",ariaDropZoneColumnComponentSortAscending:"crescente",ariaDropZoneColumnComponentSortDescending:"decrescente",ariaLabelDialog:"Di\\xE1logo",ariaLabelColumnMenu:"Menu de Coluna",ariaLabelColumnFilter:"Filtro de Coluna",ariaLabelCellEditor:"Editor de C\\xE9lula",ariaLabelSelectField:"Selecionar Campo",ariaLabelRichSelectField:"Campo de Sele\\xE7\\xE3o Rica",ariaLabelRichSelectToggleSelection:"Pressione ESPA\\xC7O para alternar a sele\\xE7\\xE3o",ariaLabelRichSelectDeselectAllItems:"Pressione DELETE para desmarcar todos os itens",ariaLabelRichSelectDeleteSelection:"Pressione DELET';
      S = S + 'E para desmarcar o item",ariaLabelTooltip:"Dica de Ferramenta",ariaLabelContextMenu:"Menu Contextual",ariaLabelSubMenu:"Submenu",ariaLabelAggregationFunction:"Fun\\xE7\\xE3o de Agrega\\xE7\\xE3o",ariaLabelAdvancedFilterAutocomplete:"Autocompletar Filtro Avan\\xE7ado",ariaLabelAdvancedFilterBuilderAddField:"Adicionar Campo no Construtor de Filtro Avan\\xE7ado",ariaLabelAdvancedFilterBuilderColumnSelectField:"Selecionar Campo da Coluna no Construtor de Filtro Avan\\xE7ado",ariaLabelAdvancedFilterBuilderOptionSelectField:"Selecionar Campo de Op\\xE7\\xE3o no Construtor de Filtro Avan\\xE7ado",ariaLabelAdvancedFilterBuilderJoinSelectField:"Selecionar Campo do Operador de Jun\\xE7\\xE3o no Construtor de Filtro Avan\\xE7ado",ariaColumnPanelList:"Lista de Colunas",ariaFilterPanelList:"Lista de Filtros",thousandSeparator:".",decimalSeparator:",",true:"Verdadeiro",false:"Falso",invalidDate:"Data Inv\\xE1lida",invalidNumber:"N\\xFAmero Inv\\xE1lido",january:"Janeiro",february:"Fevereiro",march:"Mar\\xE7o",april:"Abril",may:"Maio",june:"Junho",july:"Julho",august:"Agosto",september:"Setembro",october:"Outubro",november:"Novembro",december:"Dezembro",timeFormatSlashesDDMMYYYY:"DD/MM/YYYY",timeFormatSlashesMMDDYYYY:"MM/DD/YYYY",timeFormatSlashesDDMMYY:"DD/MM/YY",timeFormatSlashesMMDDYY:"MM/DD/YY",timeFormatDotsDDMYY:"DD.M.AA",timeFormatDotsMDDYY:"M.DD.AA",timeFormatDashesYYYYMMDD:"AAAA-MM-DD",timeFormatSpacesDDMMMMYYYY:"DD MMMM AAAA",timeFormatHHMMSS:"HH:MM:SS",timeFormatHHMMSSAmPm:"HH:MM:SS AM/PM"},w={selectAll:"(Selecionar Todos)",selectAllSearchResults:"(Selecionar Todos os Resultados da Pesquisa)",addCurrentSelectionToFilter:"Adicionar sele\\xE7\\xE3o atual ao filtro",searchOoo:"Pesquisar...",blanks:"(Em Branco)",noMatches:"Sem correspond\\xEAncias",filterOoo:"Filtrar...",equals:"Igual",notEqual:"Diferente",blank:"Vazio",notBlank:"N\\xE3o vazio",empty:"Escolher um",lessThan:"Menor que",greaterThan:"Maior que",lessThanOrEqual:"Menor ou igual a",greaterThanOrEqual:"Maior ou igual a",inRange:"Entre';
      S = S + '",inRangeStart:"De",inRangeEnd:"At\\xE9",contains:"Cont\\xE9m",notContains:"N\\xE3o cont\\xE9m",startsWith:"Come\\xE7a com",endsWith:"Termina com",dateFormatOoo:"yyyy-mm-dd",before:"Antes",after:"Depois",andCondition:"E",orCondition:"OU",applyFilter:"Aplicar",resetFilter:"Redefinir",clearFilter:"Limpar",cancelFilter:"Cancelar",textFilter:"Filtro de Texto",numberFilter:"Filtro de N\\xFAmero",dateFilter:"Filtro de Data",setFilter:"Filtro de Conjunto",groupFilterSelect:"Selecionar campo:",advancedFilterContains:"cont\\xE9m",advancedFilterNotContains:"n\\xE3o cont\\xE9m",advancedFilterTextEquals:"igual a",advancedFilterTextNotEqual:"diferente de",advancedFilterStartsWith:"come\\xE7a com",advancedFilterEndsWith:"termina com",advancedFilterBlank:"est\\xE1 em branco",advancedFilterNotBlank:"n\\xE3o est\\xE1 em branco",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"\\xE9 verdadeiro",advancedFilterFalse:"\\xE9 falso",advancedFilterAnd:"E",advancedFilterOr:"OU",advancedFilterApply:"Aplicar",advancedFilterBuilder:"Construtor",advancedFilterValidationMissingColumn:"Coluna ausente",advancedFilterValidationMissingOption:"Op\\xE7\\xE3o ausente",advancedFilterValidationMissingValue:"Valor ausente",advancedFilterValidationInvalidColumn:"Coluna n\\xE3o encontrada",advancedFilterValidationInvalidOption:"Op\\xE7\\xE3o n\\xE3o encontrada",advancedFilterValidationMissingQuote:"Valor est\\xE1 sem a aspa final",advancedFilterValidationNotANumber:"Valor n\\xE3o \\xE9 um n\\xFAmero",advancedFilterValidationInvalidDate:"Valor n\\xE3o \\xE9 uma data v\\xE1lida",advancedFilterValidationMissingCondition:"Condi\\xE7\\xE3o ausente",advancedFilterValidationJoinOperatorMismatch:"Operadores de jun\\xE7\\xE3o dentro de uma condi\\xE7\\xE3o devem ser iguais",advancedFilterValidationInvalidJoinOperator:"Operador de jun\\xE7\\xE3o n\\xE3o encontrado",advancedFilterValidationMissingEndBra';
      S = S + 'cket:"Falta par\\xEAntese de fechamento",advancedFilterValidationExtraEndBracket:"Par\\xEAnteses de fechamento a mais",advancedFilterValidationMessage:"Express\\xE3o cont\\xE9m um erro. ${variable} - ${variable}.",advancedFilterValidationMessageAtEnd:"Express\\xE3o cont\\xE9m um erro. ${variable} no final da express\\xE3o.",advancedFilterBuilderTitle:"Filtro Avan\\xE7ado",advancedFilterBuilderApply:"Aplicar",advancedFilterBuilderCancel:"Cancelar",advancedFilterBuilderAddButtonTooltip:"Adicionar Filtro ou Grupo",advancedFilterBuilderRemoveButtonTooltip:"Remover",advancedFilterBuilderMoveUpButtonTooltip:"Mover para Cima",advancedFilterBuilderMoveDownButtonTooltip:"Mover para Baixo",advancedFilterBuilderAddJoin:"Adicionar Grupo",advancedFilterBuilderAddCondition:"Adicionar Filtro",advancedFilterBuilderSelectColumn:"Selecione uma coluna",advancedFilterBuilderSelectOption:"Selecione uma op\\xE7\\xE3o",advancedFilterBuilderEnterValue:"Insira um valor...",advancedFilterBuilderValidationAlreadyApplied:"Filtro atual j\\xE1 aplicado.",advancedFilterBuilderValidationIncomplete:"Nem todas as condi\\xE7\\xF5es est\\xE3o completas.",advancedFilterBuilderValidationSelectColumn:"Deve selecionar uma coluna.",advancedFilterBuilderValidationSelectOption:"Deve selecionar uma op\\xE7\\xE3o.",advancedFilterBuilderValidationEnterValue:"Deve inserir um valor.",columns:"Colunas",filters:"Filtros",pivotMode:"Modo de Pivot",groups:"Grupos de Linhas",rowGroupColumnsEmptyMessage:"Arraste aqui para definir grupos de linhas",values:"Valores",valueColumnsEmptyMessage:"Arraste aqui para agregar",pivots:"R\\xF3tulos de Coluna",pivotColumnsEmptyMessage:"Arraste aqui para definir r\\xF3tulos de coluna",group:"Grupo",rowDragRow:"linha",rowDragRows:"linhas",loadingOoo:"Carregando...",loadingError:"ERR",noRowsToShow:"Sem linhas para mostrar",enabled:"Ativado",pinColumn:"Fixar Coluna",pinLeft:"Fixar \\xE0 Esquerda",pinRight:"Fixar \\xE0 Direita",noPin:"N\\xE3o Fixar",valueAggregation:"Agrega\\xE7\\xE3o de Valores",noAggregation';
      S = S + ':"Nenhum",autosizeThisColumn:"Ajustar Tamanho desta Coluna",autosizeAllColumns:"Ajustar Tamanho de Todas as Colunas",groupBy:"Agrupar por",ungroupBy:"Desagrupar por",ungroupAll:"Desagrupar Tudo",addToValues:"Adicionar ${variable} aos valores",removeFromValues:"Remover ${variable} dos valores",addToLabels:"Adicionar ${variable} aos r\\xF3tulos",removeFromLabels:"Remover ${variable} dos r\\xF3tulos",resetColumns:"Redefinir Colunas",expandAll:"Expandir Todos os Grupos de Linhas",collapseAll:"Fechar Todos os Grupos de Linhas",copy:"Copiar",ctrlC:"Ctrl+C",ctrlX:"Ctrl+X",copyWithHeaders:"Copiar Com Cabe\\xE7alhos",copyWithGroupHeaders:"Copiar com Cabe\\xE7alhos de Grupo",cut:"Cortar",paste:"Colar",ctrlV:"Ctrl+V",export:"Exportar",csvExport:"Exporta\\xE7\\xE3o CSV",excelExport:"Exporta\\xE7\\xE3o Excel",columnFilter:"Filtro de Coluna",columnChooser:"Escolher Colunas",sortAscending:"Ordenar Ascendente",sortDescending:"Ordenar Descendente",sortUnSort:"Limpar Ordena\\xE7\\xE3o",sum:"Soma",first:"Primeiro",last:"\\xDAltimo",min:"Min",max:"M\\xE1x",none:"Nenhum",count:"Contagem",avg:"M\\xE9dia",filteredRows:"Filtrados",selectedRows:"Selecionados",totalRows:"Total de Linhas",totalAndFilteredRows:"Linhas",more:"Mais",to:"para",of:"de",page:"P\\xE1gina",pageLastRowUnknown:"?",nextPage:"Pr\\xF3xima P\\xE1gina",lastPage:"\\xDAltima P\\xE1gina",firstPage:"Primeira P\\xE1gina",previousPage:"P\\xE1gina Anterior",pageSizeSelectorLabel:"Tamanho da P\\xE1gina:",footerTotal:"Total",pivotColumnGroupTotals:"Total",pivotChartAndPivotMode:"Gr\\xE1fico de Piv\\xF4 e Modo Piv\\xF4",pivotChart:"Gr\\xE1fico de Piv\\xF4",chartRange:"Intervalo do Gr\\xE1fico",columnChart:"Coluna",groupedColumn:"Agrupadas",stackedColumn:"Empilhadas",normalizedColumn:"100% Empilhadas",barChart:"Barra",groupedBar:"Agrupadas",stackedBar:"Empilhadas",normalizedBar:"100% Empilhadas",pieChart:"Pizza",pie:"Pizza",donut:"Rosca",line:"Linha",xyChart:"X Y (Dispers\\xE3o)",scatter:"Dispers\\xE3o",bubble:"Bolhas",areaChart:"\\xC1rea",area:"\\xC1rea",stackedAr';
      S = S + 'ea:"Empilhadas",normalizedArea:"100% Empilhadas",histogramChart:"Histograma",polarChart:"Polar",radarLine:"Linha de Radar",radarArea:"\\xC1rea de Radar",nightingale:"Nightingale",radialColumn:"Coluna Radial",radialBar:"Barra Radial",statisticalChart:"Estat\\xEDstico",boxPlot:"Gr\\xE1fico de Caixa",rangeBar:"Barra de Intervalo",rangeArea:"\\xC1rea de Intervalo",hierarchicalChart:"Hier\\xE1rquico",treemap:"Mapa de \\xC1rvore",sunburst:"Explos\\xE3o Solar",specializedChart:"Especializado",waterfall:"Cascata",heatmap:"Mapa de Calor",combinationChart:"Combina\\xE7\\xE3o",columnLineCombo:"Coluna e Linha",AreaColumnCombo:"\\xC1rea e Coluna",pivotChartTitle:"Gr\\xE1fico Piv\\xF4",rangeChartTitle:"Gr\\xE1fico de Intervalo",settings:"Gr\\xE1fico",data:"Configura\\xE7\\xE3o",format:"Personalizar",categories:"Categorias",defaultCategory:"(Nenhum)",series:"S\\xE9ries",switchCategorySeries:"Alternar Categoria / S\\xE9rie",categoryValues:"Valores de Categoria",seriesLabels:"R\\xF3tulos de S\\xE9rie",aggregate:"Agrupar",xyValues:"Valores X Y",paired:"Modo Pareado",axis:"Eixo",xAxis:"Eixo Horizontal",yAxis:"Eixo Vertical",polarAxis:"Eixo Polar",radiusAxis:"Eixo de Raio",navigator:"Navegador",zoom:"Zoom",animation:"Anima\\xE7\\xE3o",crosshair:"Mira",color:"Cor",thickness:"Espessura",preferredLength:"Comprimento Preferido",xType:"Tipo X",axisType:"Tipo de Eixo",automatic:"Autom\\xE1tico",category:"Categoria",number:"N\\xFAmero",time:"Tempo",timeFormat:"Formato de Tempo",autoRotate:"Rota\\xE7\\xE3o Autom\\xE1tica",labelRotation:"Rota\\xE7\\xE3o",circle:"C\\xEDrculo",polygon:"Pol\\xEDgono",square:"Quadrado",cross:"Cruz",diamond:"Diamante",plus:"Mais",triangle:"Tri\\xE2ngulo",heart:"Cora\\xE7\\xE3o",orientation:"Orienta\\xE7\\xE3o",fixed:"Fixo",parallel:"Paralelo",perpendicular:"Perpendicular",radiusAxisPosition:"Posi\\xE7\\xE3o",ticks:"Marcas",gridLines:"Linhas de Grade",width:"Largura",height:"Altura",length:"Comprimento",padding:"Preenchimento",spacing:"Espa\\xE7amento",chartStyle:"Estilo do Gr\\xE1fico",title:"T\\xEDtulo",c';
      S = S + 'hartTitles:"T\\xEDtulos",chartTitle:"T\\xEDtulo do Gr\\xE1fico",chartSubtitle:"Subt\\xEDtulo",horizontalAxisTitle:"T\\xEDtulo do Eixo Horizontal",verticalAxisTitle:"T\\xEDtulo do Eixo Vertical",polarAxisTitle:"T\\xEDtulo do Eixo Polar",titlePlaceholder:"T\\xEDtulo do Gr\\xE1fico",background:"Fundo",font:"Fonte",weight:"Espessura",top:"Topo",right:"Direita",bottom:"Inferior",left:"Esquerda",labels:"R\\xF3tulos",calloutLabels:"R\\xF3tulos de Destaque",sectorLabels:"R\\xF3tulos de Setor",positionRatio:"Rela\\xE7\\xE3o de Posi\\xE7\\xE3o",size:"Tamanho",shape:"Forma",minSize:"Tamanho M\\xEDnimo",maxSize:"Tamanho M\\xE1ximo",legend:"Legenda",position:"Posi\\xE7\\xE3o",markerSize:"Tamanho do Marcador",markerStroke:"Contorno do Marcador",markerPadding:"Preenchimento do Marcador",itemSpacing:"Espa\\xE7amento de Itens",itemPaddingX:"Preenchimento do Item X",itemPaddingY:"Preenchimento do Item Y",layoutHorizontalSpacing:"Espa\\xE7amento Horizontal",layoutVerticalSpacing:"Espa\\xE7amento Vertical",strokeWidth:"Espessura da Linha",offset:"Deslocamento",offsets:"Deslocamentos",tooltips:"Dicas de Ferramenta",callout:"Destaque",markers:"Marcadores",shadow:"Sombra",blur:"Desfoque",xOffset:"Deslocamento X",yOffset:"Deslocamento Y",lineWidth:"Largura da Linha",lineDash:"Tracejado da Linha",lineDashOffset:"Deslocamento do Tracejado",scrollingZoom:"Rolagem",scrollingStep:"Passo da Rolagem",selectingZoom:"Selecionando",durationMillis:"Dura\\xE7\\xE3o (ms)",crosshairLabel:"R\\xF3tulo",crosshairSnap:"Ajustar ao N\\xF3",normal:"Normal",bold:"Negrito",italic:"It\\xE1lico",boldItalic:"Negrito It\\xE1lico",predefined:"Predefinido",fillOpacity:"Opacidade do Preenchimento",strokeColor:"Cor da Linha",strokeOpacity:"Opacidade da Linha",miniChart:"Mini Gr\\xE1fico",histogramBinCount:"Contagem de Blocos",connectorLine:"Linha Conectora",seriesItems:"Itens da S\\xE9rie",seriesItemType:"Tipo de Item",seriesItemPositive:"Positivo",seriesItemNegative:"Negativo",seriesItemLabels:"R\\xF3tulos de Itens",columnGroup:"Coluna",barGroup:"Bar';
      S = S + 'ra",pieGroup:"Pizza",lineGroup:"Linha",scatterGroup:"X Y (Dispers\\xE3o)",areaGroup:"\\xC1rea",polarGroup:"Polar",statisticalGroup:"Estat\\xEDstico",hierarchicalGroup:"Hier\\xE1rquico",specializedGroup:"Especializado",combinationGroup:"Combina\\xE7\\xE3o",groupedColumnTooltip:"Agrupado",stackedColumnTooltip:"Empilhado",normalizedColumnTooltip:"100% Empilhado",groupedBarTooltip:"Agrupado",stackedBarTooltip:"Empilhado",normalizedBarTooltip:"100% Empilhado",pieTooltip:"Pizza",donutTooltip:"Rosquinha",lineTooltip:"Linha",groupedAreaTooltip:"\\xC1rea",stackedAreaTooltip:"Empilhada",normalizedAreaTooltip:"100% Empilhada",scatterTooltip:"Dispers\\xE3o",bubbleTooltip:"Bolha",histogramTooltip:"Histograma",radialColumnTooltip:"Coluna Radial",radialBarTooltip:"Barra Radial",radarLineTooltip:"Linha de Radar",radarAreaTooltip:"\\xC1rea de Radar",nightingaleTooltip:"Nightingale",rangeBarTooltip:"Barra de Intervalo",rangeAreaTooltip:"\\xC1rea de Intervalo",boxPlotTooltip:"Diagrama de Caixa",treemapTooltip:"Mapa de \\xC1rvore",sunburstTooltip:"Explos\\xE3o Solar",waterfallTooltip:"Cascata",heatmapTooltip:"Mapa de Calor",columnLineComboTooltip:"Coluna & Linha",areaColumnComboTooltip:"\\xC1rea & Coluna",customComboTooltip:"Combina\\xE7\\xE3o Personalizada",innerRadius:"Raio Interno",startAngle:"\\xC2ngulo Inicial",endAngle:"\\xC2ngulo Final",reverseDirection:"Reverter Dire\\xE7\\xE3o",groupPadding:"Preenchimento do Grupo",seriesPadding:"Preenchimento da S\\xE9rie",tile:"Ladrilho",whisker:"Bigode",cap:"Tampa",capLengthRatio:"Rela\\xE7\\xE3o de Comprimento",labelPlacement:"Posicionamento",inside:"Dentro",outside:"Fora",noDataToChart:"Sem dados dispon\\xEDveis para gr\\xE1fico.",pivotChartRequiresPivotMode:"Gr\\xE1fico Piv\\xF4 requer o Modo Piv\\xF4 habilitado.",chartSettingsToolbarTooltip:"Menu",chartLinkToolbarTooltip:"Vinculado \\xE0 Grade",chartUnlinkToolbarTooltip:"Desvinculado da Grade",chartDownloadToolbarTooltip:"Baixar Gr\\xE1fico",chartMenuToolbarTooltip:"Menu",chartEdit:"Editar Gr\\xE1fico",chartAdvanced';
      S = S + 'Settings:"Configura\\xE7\\xF5es Avan\\xE7adas",chartLink:"Vincular \\xE0 Grade",chartUnlink:"Desvincular da Grade",chartDownload:"Baixar Gr\\xE1fico",histogramFrequency:"Frequ\\xEAncia",seriesChartType:"Tipo de Gr\\xE1fico da S\\xE9rie",seriesType:"Tipo de S\\xE9rie",secondaryAxis:"Eixo Secund\\xE1rio",seriesAdd:"Adicionar uma s\\xE9rie",categoryAdd:"Adicionar uma categoria",bar:"Barra",column:"Coluna",histogram:"Histograma",advancedSettings:"Configura\\xE7\\xF5es Avan\\xE7adas",direction:"Dire\\xE7\\xE3o",horizontal:"Horizontal",vertical:"Vertical",seriesGroupType:"Tipo de Grupo",groupedSeriesGroupType:"Agrupado",stackedSeriesGroupType:"Empilhado",normalizedSeriesGroupType:"100% Empilhado",legendEnabled:"Habilitado",invalidColor:"O valor da cor \\xE9 inv\\xE1lido",groupedColumnFull:"Coluna Agrupada",stackedColumnFull:"Coluna Empilhada",normalizedColumnFull:"Coluna 100% Empilhada",groupedBarFull:"Barra Agrupada",stackedBarFull:"Barra Empilhada",normalizedBarFull:"Barra 100% Empilhada",stackedAreaFull:"\\xC1rea Empilhada",normalizedAreaFull:"\\xC1rea 100% Empilhada",customCombo:"Combina\\xE7\\xE3o Personalizada",ariaAdvancedFilterBuilderItem:"${variable}. N\\xEDvel ${variable}. Pressione ENTER para editar.",ariaAdvancedFilterBuilderItemValidation:"${variable}. N\\xEDvel ${variable}. ${variable} Pressione ENTER para editar.",ariaAdvancedFilterBuilderList:"Lista de Construtores de Filtro Avan\\xE7ado",ariaAdvancedFilterBuilderFilterItem:"Condi\\xE7\\xE3o do Filtro",ariaAdvancedFilterBuilderGroupItem:"Grupo de Filtro",ariaAdvancedFilterBuilderColumn:"Coluna",ariaAdvancedFilterBuilderOption:"Op\\xE7\\xE3o",ariaAdvancedFilterBuilderValueP:"Valor",ariaAdvancedFilterBuilderJoinOperator:"Operador de Jun\\xE7\\xE3o",ariaAdvancedFilterInput:"Entrada de Filtro Avan\\xE7ado",ariaChecked:"marcado",ariaColumn:"Coluna",ariaColumnGroup:"Grupo de Colunas",ariaColumnFiltered:"Coluna Filtrada",ariaColumnSelectAll:"Alternar Sele\\xE7\\xE3o de Todas as Colunas",ariaDateFilterInput:"Entrada de Filtro de Data",ariaDefaultL';
      S = S + 'istName:"Lista",ariaFilterColumnsInput:"Entrada de Filtro de Colunas",ariaFilterFromValue:"Filtrar a partir do valor",ariaFilterInput:"Entrada de Filtro",ariaFilterList:"Lista de Filtros",ariaFilterToValue:"Filtrar at\\xE9 o valor",ariaFilterValue:"Valor do Filtro",ariaFilterMenuOpen:"Abrir Menu de Filtro",ariaFilteringOperator:"Operador de Filtragem",ariaHidden:"oculto",ariaIndeterminate:"indeterminado",ariaInputEditor:"Editor de Entrada",ariaMenuColumn:"Pressione ALT para baixo para abrir o menu da coluna",ariaFilterColumn:"Pressione CTRL ENTER para abrir o filtro",ariaRowDeselect:"Pressione ESPA\\xC7O para desmarcar esta linha",ariaRowSelectAll:"Pressione Espa\\xE7o para alternar a sele\\xE7\\xE3o de todas as linhas",ariaRowToggleSelection:"Pressione Espa\\xE7o para alternar a sele\\xE7\\xE3o da linha",ariaRowSelect:"Pressione ESPA\\xC7O para selecionar esta linha",ariaRowSelectionDisabled:"A sele\\xE7\\xE3o de linhas est\\xE1 desativada para esta linha",ariaSearch:"Buscar",ariaSortableColumn:"Pressione ENTER para ordenar",ariaToggleVisibility:"Pressione ESPA\\xC7O para alternar visibilidade",ariaToggleCellValue:"Pressione ESPA\\xC7O para alternar o valor da c\\xE9lula",ariaUnchecked:"desmarcado",ariaVisible:"vis\\xEDvel",ariaSearchFilterValues:"Buscar valores do filtro",ariaPageSizeSelectorLabel:"Tamanho da P\\xE1gina",ariaChartMenuClose:"Fechar Menu de Edi\\xE7\\xE3o de Gr\\xE1fico",ariaChartSelected:"Selecionado",ariaSkeletonCellLoadingFailed:"Falha ao carregar a linha",ariaSkeletonCellLoading:"Os dados da linha est\\xE3o carregando",ariaRowGroupDropZonePanelLabel:"Grupos de Linhas",ariaValuesDropZonePanelLabel:"Valores",ariaPivotDropZonePanelLabel:"R\\xF3tulos de Colunas",ariaDropZoneColumnComponentDescription:"Pressione DELETE para remover",ariaDropZoneColumnValueItemDescription:"Pressione ENTER para mudar o tipo de agrega\\xE7\\xE3o",ariaDropZoneColumnGroupItemDescription:"Pressione ENTER para classificar",ariaDropZoneColumnComponentAggFuncSeparator:" de ",ariaDropZoneColumnCompon';
      S = S + 'entSortAscending:"ascendente",ariaDropZoneColumnComponentSortDescending:"descendente",ariaLabelDialog:"Di\\xE1logo",ariaLabelColumnMenu:"Menu da Coluna",ariaLabelColumnFilter:"Filtro da Coluna",ariaLabelCellEditor:"Editor de C\\xE9lula",ariaLabelSelectField:"Selecionar Campo",ariaLabelRichSelectField:"Campo de Sele\\xE7\\xE3o Rico",ariaLabelRichSelectToggleSelection:"Pressione ESPA\\xC7O para alternar a sele\\xE7\\xE3o",ariaLabelRichSelectDeselectAllItems:"Pressione DELETE para desmarcar todos os itens",ariaLabelRichSelectDeleteSelection:"Pressione DELETE para desmarcar item",ariaLabelTooltip:"Dica",ariaLabelContextMenu:"Menu de Contexto",ariaLabelSubMenu:"Submenu",ariaLabelAggregationFunction:"Fun\\xE7\\xE3o de Agrega\\xE7\\xE3o",ariaLabelAdvancedFilterAutocomplete:"Autocompletar Filtro Avan\\xE7ado",ariaLabelAdvancedFilterBuilderAddField:"Construtor de Filtro Avan\\xE7ado Adicionar Campo",ariaLabelAdvancedFilterBuilderColumnSelectField:"Construtor de Filtro Avan\\xE7ado Selecionar Campo da Coluna",ariaLabelAdvancedFilterBuilderOptionSelectField:"Construtor de Filtro Avan\\xE7ado Selecionar Campo da Op\\xE7\\xE3o",ariaLabelAdvancedFilterBuilderJoinSelectField:"Construtor de Filtro Avan\\xE7ado Selecionar Operador de Jun\\xE7\\xE3o",ariaColumnPanelList:"Lista de Colunas",ariaFilterPanelList:"Lista de Filtros",thousandSeparator:",",decimalSeparator:".",true:"Verdadeiro",false:"Falso",invalidDate:"Data Inv\\xE1lida",invalidNumber:"N\\xFAmero Inv\\xE1lido",january:"Janeiro",february:"Fevereiro",march:"Mar\\xE7o",april:"Abril",may:"Maio",june:"Junho",july:"Julho",august:"Agosto",september:"Setembro",october:"Outubro",november:"Novembro",december:"Dezembro",timeFormatSlashesDDMMYYYY:"DD/MM/YYYY",timeFormatSlashesMMDDYYYY:"MM/DD/YYYY",timeFormatSlashesDDMMYY:"DD/MM/YY",timeFormatSlashesMMDDYY:"MM/DD/YY",timeFormatDotsDDMYY:"DD.M.AA",timeFormatDotsMDDYY:"M.DD.AA",timeFormatDashesYYYYMMDD:"AAAA-MM-DD",timeFormatSpacesDDMMMMYYYY:"DD MMMM AAAA",timeFormatHHMMSS:"HH:MM:SS",timeFormatHHMMSSAmPm:"HH:MM';
      S = S + ':SS AM/PM"},I={selectAll:"(Selecteaz\\u0103 tot)",selectAllSearchResults:"(Selecteaz\\u0103 toate rezultatele c\\u0103ut\\u0103rii)",addCurrentSelectionToFilter:"Adaug\\u0103 selec\\u021Bia curent\\u0103 la filtru",searchOoo:"C\\u0103utare...",blanks:"(Goluri)",noMatches:"F\\u0103r\\u0103 potriviri",filterOoo:"Filtreaz\\u0103...",equals:"Egal",notEqual:"Nu este egal",blank:"Gol",notBlank:"Nu este gol",empty:"Alege una",lessThan:"Mai pu\\u021Bin dec\\xE2t",greaterThan:"Mai mult dec\\xE2t",lessThanOrEqual:"Mai pu\\u021Bin sau egal cu",greaterThanOrEqual:"Mai mult sau egal cu",inRange:"\\xCEntre",inRangeStart:"De la",inRangeEnd:"P\\xE2n\\u0103 la",contains:"Con\\u021Bine",notContains:"Nu con\\u021Bine",startsWith:"\\xCEncepe cu",endsWith:"Se termin\\u0103 cu",dateFormatOoo:"yyyy-mm-dd",before:"\\xCEnainte",after:"Dup\\u0103",andCondition:"\\u0218I",orCondition:"SAU",applyFilter:"Aplic\\u0103",resetFilter:"Reseteaz\\u0103",clearFilter:"Cur\\u0103\\u021B\\u0103",cancelFilter:"Anuleaz\\u0103",textFilter:"Filtru text",numberFilter:"Filtru num\\u0103r",dateFilter:"Filtru dat\\u0103",setFilter:"Filtru set",groupFilterSelect:"Selecteaz\\u0103 c\\xE2mp:",advancedFilterContains:"con\\u021Bine",advancedFilterNotContains:"nu con\\u021Bine",advancedFilterTextEquals:"egal",advancedFilterTextNotEqual:"nu este egal",advancedFilterStartsWith:"\\xEEncepe cu",advancedFilterEndsWith:"se termin\\u0103 cu",advancedFilterBlank:"este gol",advancedFilterNotBlank:"nu este gol",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"este adev\\u0103rat",advancedFilterFalse:"este fals",advancedFilterAnd:"\\u0218I",advancedFilterOr:"SAU",advancedFilterApply:"Aplic\\u0103",advancedFilterBuilder:"Constructor",advancedFilterValidationMissingColumn:"Lips\\u0103 coloan\\u0103",advancedFilterValidationMissingOption:"Lips\\u0103 op\\u021Biune",advancedFilterValidationMissingValue:"Lips\\u0103 valoare",adv';
      S = S + 'ancedFilterValidationInvalidColumn:"Coloan\\u0103 neg\\u0103sit\\u0103",advancedFilterValidationInvalidOption:"Op\\u021Biune neg\\u0103sit\\u0103",advancedFilterValidationMissingQuote:"Valoarea nu are o ghilimele de \\xEEncheiere",advancedFilterValidationNotANumber:"Valoarea nu este un num\\u0103r",advancedFilterValidationInvalidDate:"Valoarea nu este o dat\\u0103 valid\\u0103",advancedFilterValidationMissingCondition:"Lips\\u0103 condi\\u021Bie",advancedFilterValidationJoinOperatorMismatch:"Operatorii de unire din cadrul unei condi\\u021Bii trebuie s\\u0103 fie aceea\\u0219i",advancedFilterValidationInvalidJoinOperator:"Operator de unire neg\\u0103sit",advancedFilterValidationMissingEndBracket:"Lips\\u0103 parantez\\u0103 de \\xEEncheiere",advancedFilterValidationExtraEndBracket:"Prea multe paranteze de \\xEEncheiere",advancedFilterValidationMessage:"Expresia are o eroare. ${variable} - ${variable}.",advancedFilterValidationMessageAtEnd:"Expresia are o eroare. ${variable} la sf\\xE2r\\u0219itul expresiei.",advancedFilterBuilderTitle:"Filtru Avansat",advancedFilterBuilderApply:"Aplic\\u0103",advancedFilterBuilderCancel:"Anuleaz\\u0103",advancedFilterBuilderAddButtonTooltip:"Adaug\\u0103 Filtru sau Grup",advancedFilterBuilderRemoveButtonTooltip:"Elimin\\u0103",advancedFilterBuilderMoveUpButtonTooltip:"Mut\\u0103 \\xCEn Sus",advancedFilterBuilderMoveDownButtonTooltip:"Mut\\u0103 \\xCEn Jos",advancedFilterBuilderAddJoin:"Adaug\\u0103 Grup",advancedFilterBuilderAddCondition:"Adaug\\u0103 Filtru",advancedFilterBuilderSelectColumn:"Selecteaz\\u0103 o coloan\\u0103",advancedFilterBuilderSelectOption:"Selecteaz\\u0103 o op\\u021Biune",advancedFilterBuilderEnterValue:"Introdu o valoare...",advancedFilterBuilderValidationAlreadyApplied:"Filtrul curent a fost deja aplicat.",advancedFilterBuilderValidationIncomplete:"Nu toate condi\\u021Biile sunt complete.",advancedFilterBuilderValidationSelectColumn:"Trebuie s\\u0103 selecta\\u021Bi o coloan\\u0103.",advancedFilterBuilderValidationSelectOption:"Trebuie s\\u0103 sele';
      S = S + 'cta\\u021Bi o op\\u021Biune.",advancedFilterBuilderValidationEnterValue:"Trebuie s\\u0103 introduce\\u021Bi o valoare.",columns:"Coloane",filters:"Filtre",pivotMode:"Mod Pivot",groups:"Grupuri de R\\xE2nduri",rowGroupColumnsEmptyMessage:"Trage\\u021Bi aici pentru a seta grupuri de r\\xE2nduri",values:"Valori",valueColumnsEmptyMessage:"Trage\\u021Bi aici pentru a agrega",pivots:"Etichete de Coloane",pivotColumnsEmptyMessage:"Trage\\u021Bi aici pentru a seta etichete de coloane",group:"Grup",rowDragRow:"r\\xE2nd",rowDragRows:"r\\xE2nduri",loadingOoo:"Se \\xEEncarc\\u0103...",loadingError:"EROARE",noRowsToShow:"Nicio r\\xE2nduri de afi\\u0219at",enabled:"Activat",pinColumn:"Fixeaz\\u0103 Coloana",pinLeft:"Fixeaz\\u0103 la St\\xE2nga",pinRight:"Fixeaz\\u0103 la Dreapta",noPin:"Nu Fixa",valueAggregation:"Agregare Valori",noAggregation:"Niciuna",autosizeThisColumn:"Auto redimensiona aceast\\u0103 coloan\\u0103",autosizeAllColumns:"Auto redimensiona toate coloanele",groupBy:"Grupare dup\\u0103",ungroupBy:"Degrupa dup\\u0103",ungroupAll:"Degrupa toate",addToValues:"Adaug\\u0103 ${variable} la valori",removeFromValues:"Elimin\\u0103 ${variable} din valori",addToLabels:"Adaug\\u0103 ${variable} la etichete",removeFromLabels:"Elimin\\u0103 ${variable} din etichete",resetColumns:"Reseteaz\\u0103 coloanele",expandAll:"Extinde toate grupurile de r\\xE2nduri",collapseAll:"\\xCEnchide toate grupurile de r\\xE2nduri",copy:"Copie",ctrlC:"Ctrl+C",ctrlX:"Ctrl+X",copyWithHeaders:"Copiaz\\u0103 cu Antete",copyWithGroupHeaders:"Copiaz\\u0103 cu Antete de Grup",cut:"Taie",paste:"Lipe\\u0219te",ctrlV:"Ctrl+V",export:"Export\\u0103",csvExport:"Export\\u0103 CSV",excelExport:"Export\\u0103 Excel",columnFilter:"Filtru de Coloan\\u0103",columnChooser:"Alege Coloane",sortAscending:"Sortare Ascendent\\u0103",sortDescending:"Sortare Descendent\\u0103",sortUnSort:"\\u0218terge Sortarea",sum:"Sum\\u0103",first:"Primul",last:"Ultimul",min:"Minim",max:"Maxim",none:"Niciunul",count:"Num\\u0103r\\u0103toare",avg:"Medie",filteredRows:"Filtrate",se';
      S = S + 'lectedRows:"Selectate",totalRows:"Total R\\xE2nduri",totalAndFilteredRows:"R\\xE2nduri",more:"Mai mult",to:"la",of:"din",page:"Pagin\\u0103",pageLastRowUnknown:"?",nextPage:"Pagina Urm\\u0103toare",lastPage:"Ultima Pagin\\u0103",firstPage:"Prima Pagin\\u0103",previousPage:"Pagina Anterioar\\u0103",pageSizeSelectorLabel:"M\\u0103rime Pagin\\u0103:",footerTotal:"Total",pivotColumnGroupTotals:"Total",pivotChartAndPivotMode:"Pivot Chart \\u0219i Modul Pivot",pivotChart:"Pivot Chart",chartRange:"Interval Diagram\\u0103",columnChart:"Coloan\\u0103",groupedColumn:"Grupat",stackedColumn:"Stacked",normalizedColumn:"100% Stacked",barChart:"Bar\\u0103",groupedBar:"Grupat",stackedBar:"Stacked",normalizedBar:"100% Stacked",pieChart:"Pl\\u0103cint\\u0103",pie:"Pl\\u0103cint\\u0103",donut:"Gogoa\\u0219\\u0103",line:"Linie",xyChart:"X Y (Puncte dispersate)",scatter:"Puncte dispersate",bubble:"Bule",areaChart:"Zon\\u0103",area:"Zon\\u0103",stackedArea:"Stacked",normalizedArea:"100% Stacked",histogramChart:"Histogram\\u0103",polarChart:"Polar",radarLine:"Linie Radar",radarArea:"Zon\\u0103 Radar",nightingale:"Nightingale",radialColumn:"Coloan\\u0103 Radial\\u0103",radialBar:"Bar\\u0103 Radial\\u0103",statisticalChart:"Statistic",boxPlot:"Grafic Box",rangeBar:"Bar\\u0103 Interval",rangeArea:"Zon\\u0103 Interval",hierarchicalChart:"Ierarhic",treemap:"Hart\\u0103 Arbore",sunburst:"Explozie Solar\\u0103",specializedChart:"Specializat",waterfall:"Cascad\\u0103",heatmap:"Hart\\u0103 Termic\\u0103",combinationChart:"Combinat\\u0103",columnLineCombo:"Coloan\\u0103 \\u0219i Linie",AreaColumnCombo:"Zon\\u0103 \\u0219i Coloan\\u0103",pivotChartTitle:"Grafic Pivot",rangeChartTitle:"Grafic Gama",settings:"Grafic",data:"Set\\u0103ri",format:"Personalizare",categories:"Categorii",defaultCategory:"(Nici unul)",series:"Serii",switchCategorySeries:"Schimbare Categorie / Serii",categoryValues:"Valori Categorie",seriesLabels:"Etichete Serii",aggregate:"Agregat",xyValues:"Valori X Y",paired:"Mod Pereche",axis:"Ax\\u0103",xAxis:"Ax\\u0103 Orizontal';
      S = S + '\\u0103",yAxis:"Ax\\u0103 Vertical\\u0103",polarAxis:"Ax\\u0103 Polar\\u0103",radiusAxis:"Ax\\u0103 Radius",navigator:"Navigator",zoom:"Zoom",animation:"Anima\\u021Bie",crosshair:"Cercetare",color:"Culoare",thickness:"Grosime",preferredLength:"Lungime preferat\\u0103",xType:"Tip X",axisType:"Tip Ax\\u0103",automatic:"Automat",category:"Categorie",number:"Num\\u0103r",time:"Timp",timeFormat:"Format Timp",autoRotate:"Rota\\u021Bie automat\\u0103",labelRotation:"Rota\\u021Bie",circle:"Cerc",polygon:"Poligon",square:"P\\u0103trat",cross:"Cruce",diamond:"Diamant",plus:"Plus",triangle:"Triunghi",heart:"Inim\\u0103",orientation:"Orientare",fixed:"Fix",parallel:"Paralel",perpendicular:"Perpendicular",radiusAxisPosition:"Pozi\\u021Bie",ticks:"Marcaje",gridLines:"Linii Gril\\u0103",width:"L\\u0103\\u021Bime",height:"\\xCEn\\u0103l\\u021Bime",length:"Lungime",padding:"Padding",spacing:"Spa\\u021Biere",chartStyle:"Stil Grafic",title:"Titlu",chartTitles:"Titluri",chartTitle:"Titlu Grafic",chartSubtitle:"Subtitlu",horizontalAxisTitle:"Titlu Ax\\u0103 Orizontal\\u0103",verticalAxisTitle:"Titlu Ax\\u0103 Vertical\\u0103",polarAxisTitle:"Titlu Ax\\u0103 Polar\\u0103",titlePlaceholder:"Titlu Grafic",background:"Fundal",font:"Font",weight:"Greutate",top:"Deasupra",right:"Dreapta",bottom:"Dedesubt",left:"St\\xE2nga",labels:"Etichete",calloutLabels:"Etichete Apel",sectorLabels:"Etichete Sector",positionRatio:"Raport Pozi\\u021Bie",size:"M\\u0103rime",shape:"Form\\u0103",minSize:"M\\u0103rime Minim\\u0103",maxSize:"M\\u0103rime Maxim\\u0103",legend:"Legend\\u0103",position:"Pozi\\u021Bie",markerSize:"M\\u0103rime Marcaj",markerStroke:"Tu\\u0219e Marcaj",markerPadding:"Padding Marcaj",itemSpacing:"Spa\\u021Biere Elemente",itemPaddingX:"Padding Element X",itemPaddingY:"Padding Element Y",layoutHorizontalSpacing:"Spa\\u021Biere Orizontal\\u0103",layoutVerticalSpacing:"Spa\\u021Biere Vertical\\u0103",strokeWidth:"Grosime Linie",offset:"Offset",offsets:"Offset-uri",tooltips:"Tooltip-uri",callout:"Apel",markers:"Marcaje",shadow:"Umbr\\u010';
      S = S + '3",blur:"Estompare",xOffset:"Offset X",yOffset:"Offset Y",lineWidth:"Grosime Linie",lineDash:"Linie Punctat\\u0103",lineDashOffset:"Offset Linie Punctat\\u0103",scrollingZoom:"Defilare",scrollingStep:"Pas Defilare",selectingZoom:"Selectare",durationMillis:"Durat\\u0103 (ms)",crosshairLabel:"Etichet\\u0103",crosshairSnap:"Fixare pe Nod",normal:"Normal",bold:"Aldin",italic:"Italic",boldItalic:"Aldin Italic",predefined:"Predefinit",fillOpacity:"Opacitate Umplere",strokeColor:"Culoare Linie",strokeOpacity:"Opacitate Linie",miniChart:"Mini-Grafic",histogramBinCount:"Num\\u0103r Benzi",connectorLine:"Linie Conectare",seriesItems:"Elemente Serii",seriesItemType:"Tip Element",seriesItemPositive:"Pozitiv",seriesItemNegative:"Negativ",seriesItemLabels:"Etichete Elemente",columnGroup:"Coloan\\u0103",barGroup:"Bar\\u0103",pieGroup:"Pl\\u0103cint\\u0103",lineGroup:"Linie",scatterGroup:"X Y (Dispersie)",areaGroup:"Zon\\u0103",polarGroup:"Polar",statisticalGroup:"Statistic",hierarchicalGroup:"Ierarhic",specializedGroup:"Specializat",combinationGroup:"Combina\\u021Bie",groupedColumnTooltip:"Grupat",stackedColumnTooltip:"Stivuit",normalizedColumnTooltip:"100% Stivuit",groupedBarTooltip:"Grupat",stackedBarTooltip:"Stivuit",normalizedBarTooltip:"100% Stivuit",pieTooltip:"Pl\\u0103cint\\u0103",donutTooltip:"Gogoas\\u0103",lineTooltip:"Linie",groupedAreaTooltip:"Ariat",stackedAreaTooltip:"Stivuit",normalizedAreaTooltip:"100% Stivuit",scatterTooltip:"Dispersie",bubbleTooltip:"Bul\\u0103",histogramTooltip:"Histogram\\u0103",radialColumnTooltip:"Coloan\\u0103 Radial\\u0103",radialBarTooltip:"Bar\\u0103 Radial\\u0103",radarLineTooltip:"Linie Radar",radarAreaTooltip:"Zon\\u0103 Radar",nightingaleTooltip:"Nightingale",rangeBarTooltip:"Bar\\u0103 Gama",rangeAreaTooltip:"Zon\\u0103 Gama",boxPlotTooltip:"Box Plot",treemapTooltip:"Hart\\u0103 Arbori",sunburstTooltip:"Sunburst",waterfallTooltip:"Cascad\\u0103",heatmapTooltip:"Hart\\u0103 C\\u0103ldur\\u0103",columnLineComboTooltip:"Coloan\\u0103 & Linie",areaColumnComboToolti';
      S = S + 'p:"Zon\\u0103 & Coloan\\u0103",customComboTooltip:"Combina\\u021Bie Personalizat\\u0103",innerRadius:"Raza Interioar\\u0103",startAngle:"Unghi de Start",endAngle:"Unghi de Sf\\xE2r\\u0219it",reverseDirection:"Direc\\u021Bie Invers\\u0103",groupPadding:"Padding Grup",seriesPadding:"Padding Serii",tile:"Plac\\u0103",whisker:"Codi\\u021B\\u0103",cap:"Capac",capLengthRatio:"Raport Lungime Capac",labelPlacement:"Plasament Etichet\\u0103",inside:"\\xCEn Interior",outside:"\\xCEn Exterior",noDataToChart:"Nu sunt date disponibile pentru grafic.",pivotChartRequiresPivotMode:"Graficul Pivot necesit\\u0103 activarea Modului Pivot.",chartSettingsToolbarTooltip:"Meniu",chartLinkToolbarTooltip:"Legat la Grila",chartUnlinkToolbarTooltip:"Nelegat de Gril\\u0103",chartDownloadToolbarTooltip:"Desc\\u0103rcare Grafic",chartMenuToolbarTooltip:"Meniu",chartEdit:"Editare Grafic",chartAdvancedSettings:"Set\\u0103ri Avansate",chartLink:"Legare la Gril\\u0103",chartUnlink:"Dezlegare de Gril\\u0103",chartDownload:"Desc\\u0103rcare Grafic",histogramFrequency:"Frecven\\u021B\\u0103",seriesChartType:"Tip Grafic Serii",seriesType:"Tip Serii",secondaryAxis:"Ax\\u0103 Secundar\\u0103",seriesAdd:"Ad\\u0103uga\\u021Bi o serie",categoryAdd:"Ad\\u0103uga\\u021Bi o categorie",bar:"Bar\\u0103",column:"Coloan\\u0103",histogram:"Histogram\\u0103",advancedSettings:"Set\\u0103ri Avansate",direction:"Direc\\u021Bie",horizontal:"Orizontal",vertical:"Vertical",seriesGroupType:"Tip Grup",groupedSeriesGroupType:"Grupat",stackedSeriesGroupType:"Stivuit",normalizedSeriesGroupType:"100% Stivuit",legendEnabled:"Activat",invalidColor:"Valoarea culorii este invalid\\u0103",groupedColumnFull:"Coloan\\u0103 Grupat\\u0103",stackedColumnFull:"Coloan\\u0103 Stivuit\\u0103",normalizedColumnFull:"Coloan\\u0103 100% Stivuit\\u0103",groupedBarFull:"Bar\\u0103 Grupat\\u0103",stackedBarFull:"Bar\\u0103 Stivuit\\u0103",normalizedBarFull:"Bar\\u0103 100% Stivuit\\u0103",stackedAreaFull:"Zon\\u0103 Stivuit\\u0103",normalizedAreaFull:"Zon\\u0103 100% Stivuit\\u0103",customCombo:"Comb';
      S = S + 'ina\\u021Bie Personalizat\\u0103",ariaAdvancedFilterBuilderItem:"${variable}. Nivel ${variable}. Ap\\u0103sa\\u021Bi ENTER pentru a edita.",ariaAdvancedFilterBuilderItemValidation:"${variable}. Nivel ${variable}. ${variable} Ap\\u0103sa\\u021Bi ENTER pentru a edita.",ariaAdvancedFilterBuilderList:"Lista Constructorului de Filtre Avansate",ariaAdvancedFilterBuilderFilterItem:"Condi\\u021Bie de Filtrare",ariaAdvancedFilterBuilderGroupItem:"Grup de Filtre",ariaAdvancedFilterBuilderColumn:"Coloan\\u0103",ariaAdvancedFilterBuilderOption:"Op\\u021Biune",ariaAdvancedFilterBuilderValueP:"Valoare",ariaAdvancedFilterBuilderJoinOperator:"Operator de \\xCEmbinare",ariaAdvancedFilterInput:"Intrare Filtru Avansat",ariaChecked:"bifat",ariaColumn:"Coloan\\u0103",ariaColumnGroup:"Grup de Coloane",ariaColumnFiltered:"Coloan\\u0103 Filtrat\\u0103",ariaColumnSelectAll:"Comut\\u0103 Selectarea Tuturor Coloanelor",ariaDateFilterInput:"Intrare Filtru de Dat\\u0103",ariaDefaultListName:"List\\u0103",ariaFilterColumnsInput:"Intrare Filtrare Coloane",ariaFilterFromValue:"Filtreaz\\u0103 de la valoare",ariaFilterInput:"Intrare Filtru",ariaFilterList:"List\\u0103 de Filtre",ariaFilterToValue:"Filtreaz\\u0103 p\\xE2n\\u0103 la valoare",ariaFilterValue:"Valoare Filtrat\\u0103",ariaFilterMenuOpen:"Deschide Meniul Filtrului",ariaFilteringOperator:"Operator de Filtrare",ariaHidden:"ascuns",ariaIndeterminate:"nedeterminat",ariaInputEditor:"Editor Intrare",ariaMenuColumn:"Ap\\u0103sa\\u021Bi ALT \\xEEn jos pentru a deschide meniul coloanei",ariaFilterColumn:"Ap\\u0103sa\\u021Bi CTRL ENTER pentru a deschide filtrul",ariaRowDeselect:"Ap\\u0103sa\\u021Bi SPACE pentru a deselecta acest r\\xE2nd",ariaRowSelectAll:"Ap\\u0103sa\\u021Bi Space pentru a comuta selec\\u021Bia tuturor r\\xE2ndurilor",ariaRowToggleSelection:"Ap\\u0103sa\\u021Bi Space pentru a comuta selec\\u021Bia r\\xE2ndului",ariaRowSelect:"Ap\\u0103sa\\u021Bi SPACE pentru a selecta acest r\\xE2nd",ariaRowSelectionDisabled:"Selec\\u021Bia r\\xE2ndului este dezactivat\\u0103 pentru acest ';
      S = S + 'r\\xE2nd",ariaSearch:"C\\u0103utare",ariaSortableColumn:"Ap\\u0103sa\\u021Bi ENTER pentru a sorta",ariaToggleVisibility:"Ap\\u0103sa\\u021Bi SPACE pentru a comuta vizibilitatea",ariaToggleCellValue:"Ap\\u0103sa\\u021Bi SPACE pentru a comuta valoarea celulei",ariaUnchecked:"nebifat",ariaVisible:"vizibil",ariaSearchFilterValues:"Caut\\u0103 valori ale filtrului",ariaPageSizeSelectorLabel:"Dimensiunea Paginii",ariaChartMenuClose:"\\xCEnchide meniul de editare a graficului",ariaChartSelected:"Selectat",ariaSkeletonCellLoadingFailed:"\\xCEnc\\u0103rcarea r\\xE2ndului a e\\u0219uat",ariaSkeletonCellLoading:"Datele r\\xE2ndului se \\xEEncarc\\u0103",ariaRowGroupDropZonePanelLabel:"Grupuri de r\\xE2nduri",ariaValuesDropZonePanelLabel:"Valori",ariaPivotDropZonePanelLabel:"Etichete de coloan\\u0103",ariaDropZoneColumnComponentDescription:"Ap\\u0103sa\\u021Bi DELETE pentru a elimina",ariaDropZoneColumnValueItemDescription:"Ap\\u0103sa\\u021Bi ENTER pentru a schimba tipul de agregare",ariaDropZoneColumnGroupItemDescription:"Ap\\u0103sa\\u021Bi ENTER pentru a sorta",ariaDropZoneColumnComponentAggFuncSeparator:" din ",ariaDropZoneColumnComponentSortAscending:"cresc\\u0103tor",ariaDropZoneColumnComponentSortDescending:"descresc\\u0103tor",ariaLabelDialog:"Dialog",ariaLabelColumnMenu:"Meniu Coloan\\u0103",ariaLabelColumnFilter:"Filtru Coloan\\u0103",ariaLabelCellEditor:"Editor de Celule",ariaLabelSelectField:"Selecteaz\\u0103 C\\xE2mp",ariaLabelRichSelectField:"C\\xE2mp Selectare Avansat\\u0103",ariaLabelRichSelectToggleSelection:"Ap\\u0103sa\\u021Bi SPACE pentru a comuta selec\\u021Bia",ariaLabelRichSelectDeselectAllItems:"Ap\\u0103sa\\u021Bi DELETE pentru a deselecta toate elementele",ariaLabelRichSelectDeleteSelection:"Ap\\u0103sa\\u021Bi DELETE pentru a deselecta elementul",ariaLabelTooltip:"Sugestie",ariaLabelContextMenu:"Meniu Contextual",ariaLabelSubMenu:"Submeniu",ariaLabelAggregationFunction:"Func\\u021Bia de Agregare",ariaLabelAdvancedFilterAutocomplete:"Autocompletare Filtru Avansat",ariaLabelAdvancedFilterBuil';
      S = S + 'derAddField:"Constructor Filtru Avansat - Ad\\u0103ugare C\\xE2mp",ariaLabelAdvancedFilterBuilderColumnSelectField:"Constructor Filtru Avansat - Selectare Coloan\\u0103 C\\xE2mp",ariaLabelAdvancedFilterBuilderOptionSelectField:"Constructor Filtru Avansat - Selectare Op\\u021Biune C\\xE2mp",ariaLabelAdvancedFilterBuilderJoinSelectField:"Constructor Filtru Avansat - Selectare Operator De Unire C\\xE2mp",ariaColumnPanelList:"List\\u0103 de coloane",ariaFilterPanelList:"List\\u0103 de filtre",thousandSeparator:",",decimalSeparator:".",true:"Adev\\u0103rat",false:"Fals",invalidDate:"Dat\\u0103 invalid\\u0103",invalidNumber:"Num\\u0103r invalid",january:"Ianuarie",february:"Februarie",march:"Martie",april:"Aprilie",may:"Mai",june:"Iunie",july:"Iulie",august:"August",september:"Septembrie",october:"Octombrie",november:"Noiembrie",december:"Decembrie",timeFormatSlashesDDMMYYYY:"DD/MM/YYYY",timeFormatSlashesMMDDYYYY:"MM/DD/YYYY",timeFormatSlashesDDMMYY:"DD/MM/YY",timeFormatSlashesMMDDYY:"MM/DD/YY",timeFormatDotsDDMYY:"DD.M.YY",timeFormatDotsMDDYY:"M.DD.YY",timeFormatDashesYYYYMMDD:"YYYY-MM-DD",timeFormatSpacesDDMMMMYYYY:"DD MMMM YYYY",timeFormatHHMMSS:"HH:MM:SS",timeFormatHHMMSSAmPm:"HH:MM:SS AM/PM"},N={selectAll:"(Vybra\\u0165 v\\u0161etko)",selectAllSearchResults:"(Vybra\\u0165 v\\u0161etky v\\xFDsledky vyh\\u013Ead\\xE1vania)",addCurrentSelectionToFilter:"Prida\\u0165 aktu\\xE1lny v\\xFDber do filtra",searchOoo:"Vyh\\u013Ead\\xE1vanie...",blanks:"(Pr\\xE1zdne)",noMatches:"\\u017Diadne zhody",filterOoo:"Filter...",equals:"Rovn\\xE1 sa",notEqual:"Nerovn\\xE1 sa",blank:"Pr\\xE1zdny",notBlank:"Nie je pr\\xE1zdny",empty:"Vyberte jednu mo\\u017Enos\\u0165",lessThan:"Menej ako",greaterThan:"Viac ako",lessThanOrEqual:"Menej alebo rovn\\xE9",greaterThanOrEqual:"Viac alebo rovn\\xE9",inRange:"Medzi",inRangeStart:"Od",inRangeEnd:"Do",contains:"Obsahuje",notContains:"Neobsahuje",startsWith:"Za\\u010D\\xEDna s",endsWith:"Kon\\u010D\\xED s",dateFormatOoo:"yyyy-mm-dd",before:"Pred",after:"Po",andCondition:"A",orCondition:"AL';
      S = S + 'EBO",applyFilter:"Pou\\u017Ei\\u0165",resetFilter:"Resetova\\u0165",clearFilter:"Vy\\u010Disti\\u0165",cancelFilter:"Zru\\u0161i\\u0165",textFilter:"Textov\\xFD filter",numberFilter:"\\u010C\\xEDseln\\xFD filter",dateFilter:"D\\xE1tumov\\xFD filter",setFilter:"Nastaven\\xFD filter",groupFilterSelect:"Vyberte pole:",advancedFilterContains:"obsahuje",advancedFilterNotContains:"neobsahuje",advancedFilterTextEquals:"rovn\\xE1 sa",advancedFilterTextNotEqual:"nerovn\\xE1 sa",advancedFilterStartsWith:"za\\u010D\\xEDna na",advancedFilterEndsWith:"kon\\u010D\\xED na",advancedFilterBlank:"je pr\\xE1zdne",advancedFilterNotBlank:"nie je pr\\xE1zdne",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"je pravdiv\\xE9",advancedFilterFalse:"je nepravdiv\\xE9",advancedFilterAnd:"A",advancedFilterOr:"ALEBO",advancedFilterApply:"Pou\\u017Ei\\u0165",advancedFilterBuilder:"Tvorca",advancedFilterValidationMissingColumn:"Ch\\xFDba st\\u013Apec",advancedFilterValidationMissingOption:"Ch\\xFDba mo\\u017Enos\\u0165",advancedFilterValidationMissingValue:"Ch\\xFDba hodnota",advancedFilterValidationInvalidColumn:"St\\u013Apec sa nena\\u0161iel",advancedFilterValidationInvalidOption:"Mo\\u017Enos\\u0165 sa nena\\u0161la",advancedFilterValidationMissingQuote:"Hodnota ch\\xFDba koncov\\xE1 \\xFAvodzovka",advancedFilterValidationNotANumber:"Hodnota nie je \\u010D\\xEDslo",advancedFilterValidationInvalidDate:"Hodnota nie je platn\\xFD d\\xE1tum",advancedFilterValidationMissingCondition:"Ch\\xFDba podmienka",advancedFilterValidationJoinOperatorMismatch:"Spojovacie oper\\xE1tory v r\\xE1mci podmienky musia by\\u0165 rovnak\\xE9",advancedFilterValidationInvalidJoinOperator:"Spojovac\\xED oper\\xE1tor sa nena\\u0161iel",advancedFilterValidationMissingEndBracket:"Ch\\xFDba koncov\\xE1 z\\xE1tvorka",advancedFilterValidationExtraEndBracket:"Pr\\xEDli\\u0161 ve\\u013Ea koncov\\xFDch z\\xE1tvoriek",advancedFilterValid';
      S = S + 'ationMessage:"V\\xFDraz obsahuje chybu. ${variable} - ${variable}.",advancedFilterValidationMessageAtEnd:"V\\xFDraz obsahuje chybu. ${variable} na konci v\\xFDrazu.",advancedFilterBuilderTitle:"Pokro\\u010Dil\\xFD filter",advancedFilterBuilderApply:"Pou\\u017Ei\\u0165",advancedFilterBuilderCancel:"Zru\\u0161i\\u0165",advancedFilterBuilderAddButtonTooltip:"Prida\\u0165 filter alebo skupinu",advancedFilterBuilderRemoveButtonTooltip:"Odstr\\xE1ni\\u0165",advancedFilterBuilderMoveUpButtonTooltip:"Presun\\xFA\\u0165 hore",advancedFilterBuilderMoveDownButtonTooltip:"Presun\\xFA\\u0165 dole",advancedFilterBuilderAddJoin:"Prida\\u0165 skupinu",advancedFilterBuilderAddCondition:"Prida\\u0165 filter",advancedFilterBuilderSelectColumn:"Vybra\\u0165 st\\u013Apec",advancedFilterBuilderSelectOption:"Vybra\\u0165 mo\\u017Enos\\u0165",advancedFilterBuilderEnterValue:"Zadajte hodnotu...",advancedFilterBuilderValidationAlreadyApplied:"Aktu\\xE1lny filter je u\\u017E pou\\u017Eit\\xFD.",advancedFilterBuilderValidationIncomplete:"Nie v\\u0161etky podmienky s\\xFA kompletn\\xE9.",advancedFilterBuilderValidationSelectColumn:"Mus\\xED by\\u0165 vybran\\xFD st\\u013Apec.",advancedFilterBuilderValidationSelectOption:"Mus\\xED by\\u0165 vybran\\xE1 mo\\u017Enos\\u0165.",advancedFilterBuilderValidationEnterValue:"Mus\\xED by\\u0165 zadan\\xE1 hodnota.",columns:"St\\u013Apce",filters:"Filtre",pivotMode:"Re\\u017Eim Pivot",groups:"Skupiny riadkov",rowGroupColumnsEmptyMessage:"Presu\\u0148te sem pre nastavenie skupinov\\xFDch riadkov",values:"Hodnoty",valueColumnsEmptyMessage:"Presu\\u0148te sem pre agreg\\xE1ciu",pivots:"Ozna\\u010Denia st\\u013Apcov",pivotColumnsEmptyMessage:"Presu\\u0148te sem pre nastavenie ozna\\u010Den\\xED st\\u013Apcov",group:"Skupina",rowDragRow:"riadok",rowDragRows:"riadky",loadingOoo:"Na\\u010D\\xEDtavam...",loadingError:"CHYBA",noRowsToShow:"\\u017Diadne riadky na zobrazenie",enabled:"Povolen\\xE9",pinColumn:"Pripn\\xFA\\u0165 st\\u013Apec",pinLeft:"Pripn\\xFA\\u0165 v\\u013Eavo",pinRight:"Pripn\\xFA\\u0165 vpravo",noPin:"Neprep\\xE';
      S = S + 'Dna\\u0165",valueAggregation:"S\\xFAhrn hodn\\xF4t",noAggregation:"\\u017Diadny",autosizeThisColumn:"Automaticky nastavi\\u0165 ve\\u013Ekos\\u0165 tohto st\\u013Apca",autosizeAllColumns:"Automaticky nastavi\\u0165 ve\\u013Ekos\\u0165 v\\u0161etk\\xFDch st\\u013Apcov",groupBy:"Zoskupi\\u0165 pod\\u013Ea",ungroupBy:"Odskupi\\u0165 pod\\u013Ea",ungroupAll:"Odskupi\\u0165 v\\u0161etko",addToValues:"Prida\\u0165 ${variable} do hodn\\xF4t",removeFromValues:"Odstr\\xE1ni\\u0165 ${variable} z hodn\\xF4t",addToLabels:"Prida\\u0165 ${variable} do ozna\\u010Den\\xED",removeFromLabels:"Odstr\\xE1ni\\u0165 ${variable} z ozna\\u010Den\\xED",resetColumns:"Resetova\\u0165 st\\u013Apce",expandAll:"Rozbali\\u0165 v\\u0161etky skupiny riadkov",collapseAll:"Zbali\\u0165 v\\u0161etky skupiny riadkov",copy:"Kop\\xEDrova\\u0165",ctrlC:"Ctrl+C",ctrlX:"Ctrl+X",copyWithHeaders:"Kop\\xEDrova\\u0165 s hlavi\\u010Dkami",copyWithGroupHeaders:"Kop\\xEDrova\\u0165 s hlavi\\u010Dkami skup\\xEDn",cut:"Vystrihn\\xFA\\u0165",paste:"Vlo\\u017Ei\\u0165",ctrlV:"Ctrl+V",export:"Export",csvExport:"Export do CSV",excelExport:"Export do Excelu",columnFilter:"Filter st\\u013Apca",columnChooser:"V\\xFDber st\\u013Apcov",sortAscending:"Zoradi\\u0165 vzostupne",sortDescending:"Zoradi\\u0165 zostupne",sortUnSort:"Zru\\u0161i\\u0165 zoradenie",sum:"S\\xFA\\u010Det",first:"Prv\\xFD",last:"Posledn\\xFD",min:"Minim\\xE1lny",max:"Maxim\\xE1lny",none:"\\u017Diadny",count:"Po\\u010Det",avg:"Priemer",filteredRows:"Filtrovan\\xE9",selectedRows:"Vybran\\xE9",totalRows:"Celkovo riadkov",totalAndFilteredRows:"Riadky",more:"Viac",to:"do",of:"z",page:"Strana",pageLastRowUnknown:"?",nextPage:"\\u010Eal\\u0161ia strana",lastPage:"Posledn\\xE1 strana",firstPage:"Prv\\xE1 strana",previousPage:"Predch\\xE1dzaj\\xFAca strana",pageSizeSelectorLabel:"Ve\\u013Ekos\\u0165 strany:",footerTotal:"Celkom",pivotColumnGroupTotals:"Celkom",pivotChartAndPivotMode:"Kontingen\\u010Dn\\xFD graf a kontingen\\u010Dn\\xFD re\\u017Eim",pivotChart:"Kontingen\\u010Dn\\xFD graf",chartRange:"Rozsah grafu",columnChart:"St\\u013Apcov\\xFD ';
      S = S + 'graf",groupedColumn:"Zoskupen\\xE9",stackedColumn:"Skladan\\xE9",normalizedColumn:"100% skladen\\xE9",barChart:"Pruhov\\xFD graf",groupedBar:"Zoskupen\\xE9",stackedBar:"Skladan\\xE9",normalizedBar:"100% skladen\\xE9",pieChart:"Kol\\xE1\\u010Dov\\xFD graf",pie:"Kol\\xE1\\u010D",donut:"Donut",line:"\\u010Ciara",xyChart:"X Y (Rozptylov\\xFD)",scatter:"Rozptyl",bubble:"Bublina",areaChart:"Oblas\\u0165ov\\xFD graf",area:"Oblas\\u0165",stackedArea:"Skladan\\xE9",normalizedArea:"100% skladen\\xE9",histogramChart:"Histogram",polarChart:"Pol\\xE1rny graf",radarLine:"Radarov\\xE1 \\u010Diara",radarArea:"Radarov\\xE1 oblas\\u0165",nightingale:"Nightingale",radialColumn:"Radi\\xE1lny st\\u013Apcov\\xFD",radialBar:"Radi\\xE1lny pruhov\\xFD",statisticalChart:"\\u0160tatistick\\xFD graf",boxPlot:"Krabicov\\xFD graf",rangeBar:"Pruhov\\xFD graf rozp\\xE4tia",rangeArea:"Graf rozp\\xE4tia oblasti",hierarchicalChart:"Hierarchick\\xFD graf",treemap:"Mapa stromov",sunburst:"Sunburst",specializedChart:"\\u0160pecializovan\\xFD graf",waterfall:"Vodop\\xE1d",heatmap:"Tepeln\\xE1 mapa",combinationChart:"Kombinovan\\xFD graf",columnLineCombo:"St\\u013Apcov\\xFD a \\u010Diarov\\xFD",AreaColumnCombo:"Oblas\\u0165ov\\xFD a st\\u013Apcov\\xFD",pivotChartTitle:"Kontingen\\u010Dn\\xFD graf",rangeChartTitle:"Rozsahov\\xFD graf",settings:"Graf",data:"Nastavenie",format:"Prisp\\xF4sobenie",categories:"Kateg\\xF3rie",defaultCategory:"(\\u017Diadna)",series:"S\\xE9rie",switchCategorySeries:"Prepn\\xFA\\u0165 kateg\\xF3riu / s\\xE9riu",categoryValues:"Hodnoty kateg\\xF3rie",seriesLabels:"\\u0160t\\xEDtky s\\xE9ri\\xED",aggregate:"Agreg\\xE1t",xyValues:"X Y hodnoty",paired:"P\\xE1rov\\xFD re\\u017Eim",axis:"Os",xAxis:"Horizont\\xE1lna os",yAxis:"Vertik\\xE1lna os",polarAxis:"Pol\\xE1rna os",radiusAxis:"Polomerov\\xE1 os",navigator:"Navig\\xE1tor",zoom:"Pribl\\xED\\u017Eenie",animation:"Anim\\xE1cia",crosshair:"Kr\\xED\\u017Eov\\xE9 vl\\xE1sko",color:"Farba",thickness:"Hr\\xFAbka",preferredLength:"Preferovan\\xE1 d\\u013A\\u017Eka",xType:"X typ",axisType:"Typ osy",automatic:"Automatick\\xFD';
      S = S + '",category:"Kateg\\xF3ria",number:"\\u010C\\xEDslo",time:"\\u010Cas",timeFormat:"Form\\xE1t \\u010Dasu",autoRotate:"Automatick\\xE9 oto\\u010Denie",labelRotation:"Oto\\u010Denie",circle:"Kruh",polygon:"Mnohouholn\\xEDk",square:"\\u0160tvorec",cross:"Kr\\xED\\u017E",diamond:"Diamant",plus:"Plus",triangle:"Trojuholn\\xEDk",heart:"Srdce",orientation:"Orient\\xE1cia",fixed:"Fixn\\xFD",parallel:"Paraleln\\xFD",perpendicular:"Kolm\\xFD",radiusAxisPosition:"Poz\\xEDcia",ticks:"Zna\\u010Dky",gridLines:"Mrie\\u017Ekov\\xE9 \\u010Diary",width:"\\u0160\\xEDrka",height:"V\\xFD\\u0161ka",length:"D\\u013A\\u017Eka",padding:"Odsadenie",spacing:"Rozostup",chartStyle:"\\u0160t\\xFDl grafu",title:"N\\xE1zov",chartTitles:"N\\xE1zvy",chartTitle:"N\\xE1zov grafu",chartSubtitle:"Podn\\xE1zov",horizontalAxisTitle:"N\\xE1zov horizont\\xE1lnej osi",verticalAxisTitle:"N\\xE1zov vertik\\xE1lnej osi",polarAxisTitle:"N\\xE1zov pol\\xE1rnej osi",titlePlaceholder:"N\\xE1zov grafu",background:"Pozadie",font:"P\\xEDsmo",weight:"Hmotnos\\u0165",top:"Hore",right:"Pravo",bottom:"Dole",left:"V\\u013Eavo",labels:"\\u0160t\\xEDtky",calloutLabels:"\\u0160t\\xEDtky v\\xFDzvy",sectorLabels:"\\u0160t\\xEDtky sektorov",positionRatio:"Pomer poz\\xEDcie",size:"Ve\\u013Ekos\\u0165",shape:"Tvar",minSize:"Minim\\xE1lna ve\\u013Ekos\\u0165",maxSize:"Maxim\\xE1lna ve\\u013Ekos\\u0165",legend:"Legenda",position:"Poz\\xEDcia",markerSize:"Ve\\u013Ekos\\u0165 zna\\u010Dky",markerStroke:"Obrys zna\\u010Dky",markerPadding:"Odsadenie zna\\u010Dky",itemSpacing:"Rozostup polo\\u017Eiek",itemPaddingX:"Odsadenie polo\\u017Eky X",itemPaddingY:"Odsadenie polo\\u017Eky Y",layoutHorizontalSpacing:"Horizont\\xE1lny rozostup",layoutVerticalSpacing:"Vertik\\xE1lny rozostup",strokeWidth:"\\u0160\\xEDrka obrysu",offset:"Offset",offsets:"Offsets",tooltips:"Tooltipy",callout:"V\\xFDzva",markers:"Zna\\u010Dky",shadow:"Tie\\u0148",blur:"Rozmazanie",xOffset:"X offset",yOffset:"Y offset",lineWidth:"\\u0160\\xEDrka l\\xEDnie",lineDash:"Preru\\u0161ovan\\xE1 \\u010Diara",lineDashOffset:"Offset preru\\u0161ovanej \\u010Diary",s';
      S = S + 'crollingZoom:"Rolovanie",scrollingStep:"Krok rolovania",selectingZoom:"V\\xFDber",durationMillis:"Doba trvania (ms)",crosshairLabel:"\\u0160t\\xEDtok",crosshairSnap:"Prichyti\\u0165 k uzlu",normal:"Norm\\xE1lny",bold:"Tu\\u010Dn\\xFD",italic:"Kurz\\xEDva",boldItalic:"Tu\\u010Dn\\xE1 kurz\\xEDva",predefined:"Preddefinovan\\xFD",fillOpacity:"Neprieh\\u013Eadnos\\u0165 v\\xFDplne",strokeColor:"Farba obrysu",strokeOpacity:"Neprieh\\u013Eadnos\\u0165 obrysu",miniChart:"Mini-graf",histogramBinCount:"Po\\u010Det ko\\u0161ov",connectorLine:"Spojovacia \\u010Diara",seriesItems:"Polo\\u017Eky s\\xE9ri\\xED",seriesItemType:"Typ polo\\u017Eky",seriesItemPositive:"Pozit\\xEDvne",seriesItemNegative:"Negat\\xEDvne",seriesItemLabels:"\\u0160t\\xEDtky polo\\u017Eiek",columnGroup:"St\\u013Apec",barGroup:"St\\u013Apec",pieGroup:"Kol\\xE1\\u010D",lineGroup:"L\\xEDnia",scatterGroup:"X Y (Rozptyl)",areaGroup:"Oblas\\u0165",polarGroup:"Pol\\xE1rny",statisticalGroup:"\\u0160tatistick\\xFD",hierarchicalGroup:"Hierarchick\\xFD",specializedGroup:"\\u0160pecializovan\\xFD",combinationGroup:"Kombinovan\\xFD",groupedColumnTooltip:"Zoskupen\\xE9",stackedColumnTooltip:"Na sebe",normalizedColumnTooltip:"100% na sebe",groupedBarTooltip:"Zoskupen\\xE9",stackedBarTooltip:"Na sebe",normalizedBarTooltip:"100% na sebe",pieTooltip:"Kol\\xE1\\u010D",donutTooltip:"Donut",lineTooltip:"L\\xEDnia",groupedAreaTooltip:"Oblas\\u0165",stackedAreaTooltip:"Na sebe",normalizedAreaTooltip:"100% na sebe",scatterTooltip:"Rozptyl",bubbleTooltip:"Bublina",histogramTooltip:"Histogram",radialColumnTooltip:"Radi\\xE1lny st\\u013Apec",radialBarTooltip:"Radi\\xE1lny st\\u013Apec",radarLineTooltip:"Radarov\\xE1 l\\xEDnia",radarAreaTooltip:"Radarov\\xE1 oblas\\u0165",nightingaleTooltip:"Nightingale",rangeBarTooltip:"Rozsahov\\xFD st\\u013Apec",rangeAreaTooltip:"Rozsahov\\xE1 oblas\\u0165",boxPlotTooltip:"Box Plot",treemapTooltip:"Treemap",sunburstTooltip:"Sunburst",waterfallTooltip:"Vodop\\xE1dov\\xFD graf",heatmapTooltip:"Heatmap",columnLineComboTooltip:"St\\u013Apec a l\\xEDnia",areaColumn';
      S = S + 'ComboTooltip:"Oblas\\u0165 a st\\u013Apec",customComboTooltip:"Vlastn\\xE1 kombin\\xE1cia",innerRadius:"Vn\\xFAtorn\\xFD polomer",startAngle:"Po\\u010Diato\\u010Dn\\xFD uhol",endAngle:"Koncov\\xFD uhol",reverseDirection:"Obr\\xE1ti\\u0165 smer",groupPadding:"Odsadenie skupiny",seriesPadding:"Odsadenie s\\xE9rie",tile:"Dla\\u017Edica",whisker:"F\\xFAz",cap:"\\u010Ciapka",capLengthRatio:"Pomer d\\u013A\\u017Eky",labelPlacement:"Umiestnenie",inside:"Vo vn\\xFAtri",outside:"Vonku",noDataToChart:"Nie s\\xFA k dispoz\\xEDcii \\u017Eiadne \\xFAdaje na graf.",pivotChartRequiresPivotMode:"Kontingen\\u010Dn\\xFD graf vy\\u017Eaduje zapnut\\xFD kontingen\\u010Dn\\xFD re\\u017Eim.",chartSettingsToolbarTooltip:"Menu",chartLinkToolbarTooltip:"Prepojen\\xE9 s mrie\\u017Ekou",chartUnlinkToolbarTooltip:"Odpojen\\xE9 od mrie\\u017Eky",chartDownloadToolbarTooltip:"Stiahnu\\u0165 graf",chartMenuToolbarTooltip:"Menu",chartEdit:"Upravi\\u0165 graf",chartAdvancedSettings:"Pokro\\u010Dil\\xE9 nastavenia",chartLink:"Prepoji\\u0165 s mrie\\u017Ekou",chartUnlink:"Odpoji\\u0165 od mrie\\u017Eky",chartDownload:"Stiahnu\\u0165 graf",histogramFrequency:"Frekvencia",seriesChartType:"Typ grafu s\\xE9rie",seriesType:"Typ s\\xE9rie",secondaryAxis:"Sekund\\xE1rna os",seriesAdd:"Prida\\u0165 s\\xE9riu",categoryAdd:"Prida\\u0165 kateg\\xF3riu",bar:"Bar",column:"St\\u013Apec",histogram:"Histogram",advancedSettings:"Pokro\\u010Dil\\xE9 nastavenia",direction:"Smer",horizontal:"Horizont\\xE1lny",vertical:"Vertik\\xE1lny",seriesGroupType:"Typ skupiny s\\xE9rie",groupedSeriesGroupType:"Zoskupen\\xE9",stackedSeriesGroupType:"Na sebe",normalizedSeriesGroupType:"100% na sebe",legendEnabled:"Povolen\\xE9",invalidColor:"Hodnota farby je neplatn\\xE1",groupedColumnFull:"Zoskupen\\xFD st\\u013Apec",stackedColumnFull:"Na sebe st\\u013Apec",normalizedColumnFull:"100% na sebe st\\u013Apec",groupedBarFull:"Zoskupen\\xFD bar",stackedBarFull:"Na sebe bar",normalizedBarFull:"100% na sebe bar",stackedAreaFull:"Na sebe oblas\\u0165",normalizedAreaFull:"100% na sebe oblas\\u0165",customComb';
      S = S + 'o:"Vlastn\\xE1 kombin\\xE1cia",ariaAdvancedFilterBuilderItem:"${variable}. \\xDArove\\u0148 ${variable}. Stla\\u010Dte ENTER na \\xFApravu.",ariaAdvancedFilterBuilderItemValidation:"${variable}. \\xDArove\\u0148 ${variable}. ${variable} Stla\\u010Dte ENTER na \\xFApravu.",ariaAdvancedFilterBuilderList:"Zoznam Pokro\\u010Dil\\xFDch Filtrov",ariaAdvancedFilterBuilderFilterItem:"Podmienka Filtra",ariaAdvancedFilterBuilderGroupItem:"Skupina Filtrov",ariaAdvancedFilterBuilderColumn:"St\\u013Apec",ariaAdvancedFilterBuilderOption:"Mo\\u017Enos\\u0165",ariaAdvancedFilterBuilderValueP:"Hodnota",ariaAdvancedFilterBuilderJoinOperator:"Spojovac\\xED Oper\\xE1tor",ariaAdvancedFilterInput:"Vstup Pokro\\u010Dil\\xE9ho Filtra",ariaChecked:"ozna\\u010Den\\xE9",ariaColumn:"St\\u013Apec",ariaColumnGroup:"Skupina St\\u013Apcov",ariaColumnFiltered:"St\\u013Apec Filtrovan\\xFD",ariaColumnSelectAll:"Prep\\xEDna\\u010D Ozna\\u010Denia V\\u0161etk\\xFDch St\\u013Apcov",ariaDateFilterInput:"Vstup D\\xE1tumov\\xE9ho Filtra",ariaDefaultListName:"Zoznam",ariaFilterColumnsInput:"Vstup Filtra pre St\\u013Apce",ariaFilterFromValue:"Filtrova\\u0165 od hodnoty",ariaFilterInput:"Vstup Filtra",ariaFilterList:"Zoznam Filtrov",ariaFilterToValue:"Filtrova\\u0165 do hodnoty",ariaFilterValue:"Hodnota Filtra",ariaFilterMenuOpen:"Otvori\\u0165 Menu Filtra",ariaFilteringOperator:"Filtra\\u010Dn\\xFD Oper\\xE1tor",ariaHidden:"skryt\\xE9",ariaIndeterminate:"neur\\u010Den\\xE9",ariaInputEditor:"Editor Vstupu",ariaMenuColumn:"Stla\\u010Dte ALT DOWN na otvorenie menu st\\u013Apcov",ariaFilterColumn:"Stla\\u010Dte CTRL ENTER na otvorenie filtra",ariaRowDeselect:"Stla\\u010Dte SPACE na zru\\u0161enie v\\xFDberu tohto riadku",ariaRowSelectAll:"Stla\\u010Dte SPACE na prep\\xEDnanie v\\xFDberu v\\u0161etk\\xFDch riadkov",ariaRowToggleSelection:"Stla\\u010Dte SPACE na prep\\xEDnanie v\\xFDberu riadku",ariaRowSelect:"Stla\\u010Dte SPACE na v\\xFDber tohto riadku",ariaRowSelectionDisabled:"V\\xFDber riadku je pre tento riadok zak\\xE1zan\\xFD",ariaSearch:"H\\u013Eada\\u0165",ariaSorta';
      S = S + 'bleColumn:"Stla\\u010Dte ENTER na zoradenie",ariaToggleVisibility:"Stla\\u010Dte SPACE na prep\\xEDnanie vidite\\u013Enosti",ariaToggleCellValue:"Stla\\u010Dte SPACE na prep\\xEDnanie hodnoty bunky",ariaUnchecked:"neozna\\u010Den\\xE9",ariaVisible:"vidite\\u013En\\xE9",ariaSearchFilterValues:"H\\u013Eada\\u0165 hodnoty filtra",ariaPageSizeSelectorLabel:"Ve\\u013Ekos\\u0165 Strany",ariaChartMenuClose:"Zatvori\\u0165 Menu \\xDApravy Grafu",ariaChartSelected:"Vybran\\xE9",ariaSkeletonCellLoadingFailed:"Nahr\\xE1vanie riadku zlyhalo",ariaSkeletonCellLoading:"\\xDAdaje riadku sa nahr\\xE1vaj\\xFA",ariaRowGroupDropZonePanelLabel:"Skupiny riadkov",ariaValuesDropZonePanelLabel:"Hodnoty",ariaPivotDropZonePanelLabel:"\\u0160t\\xEDtky st\\u013Apcov",ariaDropZoneColumnComponentDescription:"Stla\\u010Dte DELETE pre odstr\\xE1nenie",ariaDropZoneColumnValueItemDescription:"Stla\\u010Dte ENTER pre zmenu typu agreg\\xE1cie",ariaDropZoneColumnGroupItemDescription:"Stla\\u010Dte ENTER pre zoradenie",ariaDropZoneColumnComponentAggFuncSeparator:" z ",ariaDropZoneColumnComponentSortAscending:"vzostupne",ariaDropZoneColumnComponentSortDescending:"zostupne",ariaLabelDialog:"Dial\\xF3g",ariaLabelColumnMenu:"Ponuka st\\u013Apcov",ariaLabelColumnFilter:"Filter st\\u013Apcov",ariaLabelCellEditor:"Editor bunky",ariaLabelSelectField:"Vyberte pole",ariaLabelRichSelectField:"Pole Rich Select",ariaLabelRichSelectToggleSelection:"Stla\\u010Dte MEDZERN\\xCDK na prepnutie v\\xFDberu",ariaLabelRichSelectDeselectAllItems:"Stla\\u010Dte DELETE na odzna\\u010Denie v\\u0161etk\\xFDch polo\\u017Eiek",ariaLabelRichSelectDeleteSelection:"Stla\\u010Dte DELETE na odzna\\u010Denie polo\\u017Eky",ariaLabelTooltip:"Tooltip",ariaLabelContextMenu:"Kontextov\\xE9 menu",ariaLabelSubMenu:"SubMenu",ariaLabelAggregationFunction:"Funkcia agreg\\xE1cie",ariaLabelAdvancedFilterAutocomplete:"Pokro\\u010Dil\\xE9 filtrovanie Autocomplete",ariaLabelAdvancedFilterBuilderAddField:"Prida\\u0165 pole v Pokro\\u010Dilom filtrovan\\xED",ariaLabelAdvancedFilterBuilderColumnSelectFiel';
      S = S + 'd:"Vybra\\u0165 st\\u013Apec v Pokro\\u010Dilom filtrovan\\xED",ariaLabelAdvancedFilterBuilderOptionSelectField:"Vybra\\u0165 mo\\u017Enos\\u0165 v Pokro\\u010Dilom filtrovan\\xED",ariaLabelAdvancedFilterBuilderJoinSelectField:"Vybra\\u0165 oper\\xE1tor spojenia v Pokro\\u010Dilom filtrovan\\xED",ariaColumnPanelList:"Zoznam st\\u013Apcov",ariaFilterPanelList:"Zoznam filtrov",thousandSeparator:".",decimalSeparator:",",true:"Pravda",false:"Nepravda",invalidDate:"Neplatn\\xFD d\\xE1tum",invalidNumber:"Neplatn\\xE9 \\u010D\\xEDslo",january:"Janu\\xE1r",february:"Febru\\xE1r",march:"Marec",april:"Apr\\xEDl",may:"M\\xE1j",june:"J\\xFAn",july:"J\\xFAl",august:"August",september:"September",october:"Okt\\xF3ber",november:"November",december:"December",timeFormatSlashesDDMMYYYY:"DD/MM/YYYY",timeFormatSlashesMMDDYYYY:"MM/DD/YYYY",timeFormatSlashesDDMMYY:"DD/MM/YY",timeFormatSlashesMMDDYY:"MM/DD/YY",timeFormatDotsDDMYY:"DD.M.RR",timeFormatDotsMDDYY:"M.DD.RR",timeFormatDashesYYYYMMDD:"RRRR-MM-DD",timeFormatSpacesDDMMMMYYYY:"DD MMMM RRRR",timeFormatHHMMSS:"HH:MM:SS",timeFormatHHMMSSAmPm:"HH:MM:SS AM/PM"},j={selectAll:"(V\\xE4lj alla)",selectAllSearchResults:"(V\\xE4lj alla s\\xF6kresultat)",addCurrentSelectionToFilter:"L\\xE4gg till nuvarande val till filter",searchOoo:"S\\xF6k...",blanks:"(Tomma)",noMatches:"Inga matchningar",filterOoo:"Filter...",equals:"Lika med",notEqual:"Inte lika med",blank:"Tom",notBlank:"Inte tom",empty:"V\\xE4lj en",lessThan:"Mindre \\xE4n",greaterThan:"St\\xF6rre \\xE4n",lessThanOrEqual:"Mindre \\xE4n eller lika med",greaterThanOrEqual:"St\\xF6rre \\xE4n eller lika med",inRange:"Mellan",inRangeStart:"Fr\\xE5n",inRangeEnd:"Till",contains:"Inneh\\xE5ller",notContains:"Inneh\\xE5ller inte",startsWith:"B\\xF6rjar med",endsWith:"Slutar med",dateFormatOoo:"yyyy-mm-dd",before:"F\\xF6re",after:"Efter",andCondition:"OCH",orCondition:"ELLER",applyFilter:"Verkst\\xE4ll",resetFilter:"\\xC5terst\\xE4ll",clearFilter:"Rensa",cancelFilter:"Avbryt",textFilter:"Textfilter",numberFilter:"Nummerfilter",dateFilter:"Da';
      S = S + 'tumfilter",setFilter:"Setfilter",groupFilterSelect:"V\\xE4lj f\\xE4lt:",advancedFilterContains:"inneh\\xE5ller",advancedFilterNotContains:"inneh\\xE5ller inte",advancedFilterTextEquals:"\\xE4r lika med",advancedFilterTextNotEqual:"\\xE4r inte lika med",advancedFilterStartsWith:"b\\xF6rjar med",advancedFilterEndsWith:"slutar med",advancedFilterBlank:"\\xE4r tom",advancedFilterNotBlank:"\\xE4r inte tom",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"\\xE4r sann",advancedFilterFalse:"\\xE4r falsk",advancedFilterAnd:"OCH",advancedFilterOr:"ELLER",advancedFilterApply:"Till\\xE4mpa",advancedFilterBuilder:"Byggare",advancedFilterValidationMissingColumn:"Kolumn saknas",advancedFilterValidationMissingOption:"Alternativ saknas",advancedFilterValidationMissingValue:"V\\xE4rde saknas",advancedFilterValidationInvalidColumn:"Kolumn hittades inte",advancedFilterValidationInvalidOption:"Alternativ hittades inte",advancedFilterValidationMissingQuote:"V\\xE4rdet saknar slutcitat",advancedFilterValidationNotANumber:"V\\xE4rdet \\xE4r inte ett nummer",advancedFilterValidationInvalidDate:"V\\xE4rdet \\xE4r inte ett giltigt datum",advancedFilterValidationMissingCondition:"Villkor saknas",advancedFilterValidationJoinOperatorMismatch:"Kombinatorer inom ett villkor m\\xE5ste vara desamma",advancedFilterValidationInvalidJoinOperator:"Kombinator hittades inte",advancedFilterValidationMissingEndBracket:"Saknar slutparentes",advancedFilterValidationExtraEndBracket:"F\\xF6r m\\xE5nga slutparenteser",advancedFilterValidationMessage:"Uttrycket har ett fel. ${variable} - ${variable}.",advancedFilterValidationMessageAtEnd:"Uttrycket har ett fel. ${variable} i slutet av uttrycket.",advancedFilterBuilderTitle:"Avancerad Filter",advancedFilterBuilderApply:"Till\\xE4mpa",advancedFilterBuilderCancel:"Avbryt",advancedFilterBuilderAddButtonTooltip:"L\\xE4gg till Filter eller ';
      S = S + 'Grupp",advancedFilterBuilderRemoveButtonTooltip:"Ta bort",advancedFilterBuilderMoveUpButtonTooltip:"Flytta upp",advancedFilterBuilderMoveDownButtonTooltip:"Flytta ner",advancedFilterBuilderAddJoin:"L\\xE4gg till Grupp",advancedFilterBuilderAddCondition:"L\\xE4gg till Filter",advancedFilterBuilderSelectColumn:"V\\xE4lj en kolumn",advancedFilterBuilderSelectOption:"V\\xE4lj ett alternativ",advancedFilterBuilderEnterValue:"Ange ett v\\xE4rde...",advancedFilterBuilderValidationAlreadyApplied:"Nuvarande filter redan till\\xE4mpat.",advancedFilterBuilderValidationIncomplete:"Inte alla villkor \\xE4r fullst\\xE4ndiga.",advancedFilterBuilderValidationSelectColumn:"M\\xE5ste v\\xE4lja en kolumn.",advancedFilterBuilderValidationSelectOption:"M\\xE5ste v\\xE4lja ett alternativ.",advancedFilterBuilderValidationEnterValue:"M\\xE5ste ange ett v\\xE4rde.",columns:"Kolumner",filters:"Filter",pivotMode:"Pivotl\\xE4ge",groups:"Radgrupper",rowGroupColumnsEmptyMessage:"Dra hit f\\xF6r att st\\xE4lla in radgrupper",values:"V\\xE4rden",valueColumnsEmptyMessage:"Dra hit f\\xF6r att aggregera",pivots:"Kolumnetiketter",pivotColumnsEmptyMessage:"Dra hit f\\xF6r att st\\xE4lla in kolumnetiketter",group:"Grupp",rowDragRow:"raden",rowDragRows:"rader",loadingOoo:"Laddar...",loadingError:"FEL",noRowsToShow:"Inga rader att visa",enabled:"Aktiverad",pinColumn:"F\\xE4st Kolumn",pinLeft:"F\\xE4st V\\xE4nster",pinRight:"F\\xE4st H\\xF6ger",noPin:"Ingen F\\xE4stning",valueAggregation:"V\\xE4rdeaggregering",noAggregation:"Ingen",autosizeThisColumn:"Autosize Denna Kolumn",autosizeAllColumns:"Autosize Alla Kolumner",groupBy:"Gruppera efter",ungroupBy:"Avgruppera efter",ungroupAll:"Avgruppera Alla",addToValues:"L\\xE4gg till ${variable} till v\\xE4rden",removeFromValues:"Ta bort ${variable} fr\\xE5n v\\xE4rden",addToLabels:"L\\xE4gg till ${variable} till etiketter",removeFromLabels:"Ta bort ${variable} fr\\xE5n etiketter",resetColumns:"\\xC5terst\\xE4ll Kolumner",expandAll:"Expandera Alla Grupp-Rader",collapseAll:"St\\xE4ng Alla Grupp-Rader",';
      S = S + 'copy:"Kopiera",ctrlC:"Ctrl+C",ctrlX:"Ctrl+X",copyWithHeaders:"Kopiera Med Rubriker",copyWithGroupHeaders:"Kopiera med Grupp-Rubriker",cut:"Klipp ut",paste:"Klistra in",ctrlV:"Ctrl+V",export:"Exportera",csvExport:"CSV Export",excelExport:"Excel Export",columnFilter:"Kolumnfilter",columnChooser:"V\\xE4lj Kolumner",sortAscending:"Sortera Stigande",sortDescending:"Sortera Fallande",sortUnSort:"Rensa Sortering",sum:"Summa",first:"F\\xF6rsta",last:"Sista",min:"Min",max:"Max",none:"Ingen",count:"Antal",avg:"Genomsnitt",filteredRows:"Filtrerade",selectedRows:"Valda",totalRows:"Totala Rader",totalAndFilteredRows:"Rader",more:"Mer",to:"till",of:"av",page:"Sida",pageLastRowUnknown:"?",nextPage:"N\\xE4sta Sida",lastPage:"Sista Sida",firstPage:"F\\xF6rsta Sida",previousPage:"F\\xF6reg\\xE5ende Sida",pageSizeSelectorLabel:"Sidstorlek:",footerTotal:"Totalt",pivotColumnGroupTotals:"Summa",pivotChartAndPivotMode:"Pivot Diagram & Pivotl\\xE4ge",pivotChart:"Pivot Diagram",chartRange:"Diagramomr\\xE5de",columnChart:"Kolumn",groupedColumn:"Grupperad",stackedColumn:"Staplad",normalizedColumn:"100% Staplad",barChart:"Staplad",groupedBar:"Grupperad",stackedBar:"Staplad",normalizedBar:"100% Staplad",pieChart:"Cirkeldiagram",pie:"Cirkeldiagram",donut:"Ringdiagram",line:"Linjediagram",xyChart:"X Y (Spridning)",scatter:"Spridningsdiagram",bubble:"Bubbeldiagram",areaChart:"Ytdiagram",area:"Ytdiagram",stackedArea:"Staplad",normalizedArea:"100% Staplad",histogramChart:"Histogram",polarChart:"Polardiagram",radarLine:"Radarlinje",radarArea:"Radaryta",nightingale:"Nightingale",radialColumn:"Radiell Kolumn",radialBar:"Radiell Stapel",statisticalChart:"Statistisk",boxPlot:"L\\xE5ddiagram",rangeBar:"Omr\\xE5desstapel",rangeArea:"Omr\\xE5desyta",hierarchicalChart:"Hierarkisk",treemap:"Tr\\xE4ddiagram",sunburst:"Solburst Diagram",specializedChart:"Specialiserad",waterfall:"Vattenfall",heatmap:"V\\xE4rmekarta",combinationChart:"Kombinationsdiagram",columnLineCombo:"Kolumn & Linje",AreaColumnCombo:"Yta & Kolumn",pivotC';
      S = S + 'hartTitle:"Pivotdiagram",rangeChartTitle:"Omf\\xE5ngsdiagram",settings:"Diagram",data:"Inst\\xE4llningar",format:"Anpassa",categories:"Kategorier",defaultCategory:"(Ingen)",series:"Serier",switchCategorySeries:"V\\xE4xla Kategori / Serie",categoryValues:"Kategori V\\xE4rden",seriesLabels:"Serieetiketter",aggregate:"Sammanfoga",xyValues:"X Y V\\xE4rden",paired:"Parat L\\xE4ge",axis:"Axel",xAxis:"Horisontell Axel",yAxis:"Vertikal Axel",polarAxis:"Polar Axel",radiusAxis:"Radie Axel",navigator:"Navigering",zoom:"Zooma",animation:"Animation",crosshair:"H\\xE5rkors",color:"F\\xE4rg",thickness:"Tjocklek",preferredLength:"F\\xF6redragen L\\xE4ngd",xType:"X Typ",axisType:"Axel Typ",automatic:"Automatisk",category:"Kategori",number:"Nummer",time:"Tid",timeFormat:"Tidsformat",autoRotate:"Auto Rotera",labelRotation:"Rotation",circle:"Cirkel",polygon:"Polygon",square:"Fyrkant",cross:"Kors",diamond:"Diamant",plus:"Plus",triangle:"Triangel",heart:"Hj\\xE4rta",orientation:"Orientering",fixed:"Fast",parallel:"Parallell",perpendicular:"Vinkelr\\xE4t",radiusAxisPosition:"Position",ticks:"Tidsintervall",gridLines:"Rutn\\xE4t",width:"Bredd",height:"H\\xF6jd",length:"L\\xE4ngd",padding:"Utfyllnad",spacing:"Avst\\xE5nd",chartStyle:"Diagramstil",title:"Titel",chartTitles:"Titlar",chartTitle:"Diagramtitel",chartSubtitle:"Undertitel",horizontalAxisTitle:"Titel Horisontell Axel",verticalAxisTitle:"Titel Vertikal Axel",polarAxisTitle:"Polar Axel Titel",titlePlaceholder:"Diagramtitel",background:"Bakgrund",font:"Teckensnitt",weight:"Vikt",top:"Topp",right:"H\\xF6ger",bottom:"Botten",left:"V\\xE4nster",labels:"Etiketter",calloutLabels:"Upplysningsetiketter",sectorLabels:"Sektoretiketter",positionRatio:"Positionskvot",size:"Storlek",shape:"Form",minSize:"Minsta Storlek",maxSize:"St\\xF6rsta Storlek",legend:"F\\xF6rklaring",position:"Position",markerSize:"Mark\\xF6rstorlek",markerStroke:"Mark\\xF6rlinje",markerPadding:"Mark\\xF6rutfyllnad",itemSpacing:"Avst\\xE5nd mellan objekt",itemPaddingX:"Objektutfyllnad X",itemPaddi';
      S = S + 'ngY:"Objektutfyllnad Y",layoutHorizontalSpacing:"Horisontellt Avst\\xE5nd",layoutVerticalSpacing:"Vertikalt Avst\\xE5nd",strokeWidth:"Linjetjocklek",offset:"F\\xF6rskjutning",offsets:"F\\xF6rskjutningar",tooltips:"Verktygstips",callout:"Upplysning",markers:"Mark\\xF6rer",shadow:"Skugga",blur:"Osk\\xE4rpa",xOffset:"X F\\xF6rskjutning",yOffset:"Y F\\xF6rskjutning",lineWidth:"Linjebredd",lineDash:"Linjedasningar",lineDashOffset:"Das f\\xF6rskjutning",scrollingZoom:"Scrolla",scrollingStep:"Scrollsteg",selectingZoom:"Markera",durationMillis:"Varaktighet (ms)",crosshairLabel:"Etikett",crosshairSnap:"F\\xE4st vid Nod",normal:"Normal",bold:"Fet",italic:"Kursiv",boldItalic:"Fet Kursiv",predefined:"F\\xF6rdefinierad",fillOpacity:"Fyllnadsopacitet",strokeColor:"Linjef\\xE4rg",strokeOpacity:"Linjeopacitet",miniChart:"Mini-Diagram",histogramBinCount:"Binantal",connectorLine:"Kopplingslinje",seriesItems:"Serieobjekt",seriesItemType:"Objekttyp",seriesItemPositive:"Positiv",seriesItemNegative:"Negativ",seriesItemLabels:"Objektetiketter",columnGroup:"Kolumn",barGroup:"Stapeldiagram",pieGroup:"Cirkeldiagram",lineGroup:"Linjediagram",scatterGroup:"X Y (Spridning)",areaGroup:"Yta",polarGroup:"Pol\\xE4r",statisticalGroup:"Statistisk",hierarchicalGroup:"Hierarkisk",specializedGroup:"Specialiserad",combinationGroup:"Kombinerad",groupedColumnTooltip:"Grupperade",stackedColumnTooltip:"Staplade",normalizedColumnTooltip:"100% Staplade",groupedBarTooltip:"Grupperade",stackedBarTooltip:"Staplade",normalizedBarTooltip:"100% Staplade",pieTooltip:"Cirkeldiagram",donutTooltip:"Donut",lineTooltip:"Linjediagram",groupedAreaTooltip:"Yta",stackedAreaTooltip:"Staplad Yta",normalizedAreaTooltip:"100% Staplad Yta",scatterTooltip:"Spridning",bubbleTooltip:"Bubblor",histogramTooltip:"Histogram",radialColumnTooltip:"Radiell Kolumn",radialBarTooltip:"Radiell Stapel",radarLineTooltip:"Radardiagram",radarAreaTooltip:"Radardiagramyta",nightingaleTooltip:"N\\xE4ktergal",rangeBarTooltip:"Omf\\xE5ng Stapel",rangeAreaTooltip:"Omf\\';
      S = S + 'xE5ng Yta",boxPlotTooltip:"L\\xE5ddiagram",treemapTooltip:"Tr\\xE4ddiagram",sunburstTooltip:"Solstr\\xE5lediagram",waterfallTooltip:"Vattenfall",heatmapTooltip:"V\\xE4rmekarta",columnLineComboTooltip:"Kolumn & Linje",areaColumnComboTooltip:"Yta & Kolumn",customComboTooltip:"Anpassad Kombination",innerRadius:"Inre Radie",startAngle:"Startvinkel",endAngle:"Slutvinkel",reverseDirection:"Omv\\xE4nd Riktning",groupPadding:"Grupp Padding",seriesPadding:"Serie Padding",tile:"Platta",whisker:"Visp",cap:"Topp",capLengthRatio:"L\\xE4ngdf\\xF6rh\\xE5llande",labelPlacement:"Etikettplacering",inside:"Inuti",outside:"Utanf\\xF6r",noDataToChart:"Ingen data tillg\\xE4nglig f\\xF6r diagram.",pivotChartRequiresPivotMode:"Pivotdiagram kr\\xE4ver Piv\\xE5l\\xE4ge aktiverat.",chartSettingsToolbarTooltip:"Meny",chartLinkToolbarTooltip:"L\\xE4nkad till Rutn\\xE4t",chartUnlinkToolbarTooltip:"Olinkad fr\\xE5n Rutn\\xE4t",chartDownloadToolbarTooltip:"Ladda Ned Diagram",chartMenuToolbarTooltip:"Meny",chartEdit:"Redigera Diagram",chartAdvancedSettings:"Avancerade inst\\xE4llningar",chartLink:"L\\xE4nk till Rutn\\xE4t",chartUnlink:"Avl\\xE4nk fr\\xE5n Rutn\\xE4t",chartDownload:"Ladda Ned Diagram",histogramFrequency:"Frekvens",seriesChartType:"Seriediagram Typ",seriesType:"Serietyp",secondaryAxis:"Sekund\\xE4r Axel",seriesAdd:"L\\xE4gg till en serie",categoryAdd:"L\\xE4gg till en kategori",bar:"Stapeldiagram",column:"Kolumn",histogram:"Histogram",advancedSettings:"Avancerade inst\\xE4llningar",direction:"Riktning",horizontal:"Horisontell",vertical:"Vertikal",seriesGroupType:"Grupptyp",groupedSeriesGroupType:"Grupperad",stackedSeriesGroupType:"Staplad",normalizedSeriesGroupType:"100% Staplad",legendEnabled:"Aktiverad",invalidColor:"F\\xE4rgkoden \\xE4r ogiltig",groupedColumnFull:"Grupperad Kolumn",stackedColumnFull:"Staplad Kolumn",normalizedColumnFull:"100% Staplad Kolumn",groupedBarFull:"Grupperad Stapel",stackedBarFull:"Staplad Stapel",normalizedBarFull:"100% Staplad Stapel",stackedAreaFull:"Staplad Yta",normalizedAreaFull';
      S = S + ':"100% Staplad Yta",customCombo:"Anpassad Kombination",ariaAdvancedFilterBuilderItem:"${variable}. Niv\\xE5 ${variable}. Tryck ENTER f\\xF6r att redigera.",ariaAdvancedFilterBuilderItemValidation:"${variable}. Niv\\xE5 ${variable}. ${variable} Tryck ENTER f\\xF6r att redigera.",ariaAdvancedFilterBuilderList:"Avancerad filterbyggarlista",ariaAdvancedFilterBuilderFilterItem:"Filtervillkor",ariaAdvancedFilterBuilderGroupItem:"Filtergrupp",ariaAdvancedFilterBuilderColumn:"Kolumn",ariaAdvancedFilterBuilderOption:"Alternativ",ariaAdvancedFilterBuilderValueP:"V\\xE4rde",ariaAdvancedFilterBuilderJoinOperator:"Kombinationsoperator",ariaAdvancedFilterInput:"Avancerad filterinmatning",ariaChecked:"markerad",ariaColumn:"Kolumn",ariaColumnGroup:"Kolumngrupp",ariaColumnFiltered:"Kolumn filtrerad",ariaColumnSelectAll:"V\\xE4xla markering av alla kolumner",ariaDateFilterInput:"Datumfilterinmatning",ariaDefaultListName:"Lista",ariaFilterColumnsInput:"Filterkolumnsinmatning",ariaFilterFromValue:"Filtrera fr\\xE5n v\\xE4rde",ariaFilterInput:"Filterinmatning",ariaFilterList:"Filterlista",ariaFilterToValue:"Filtrera till v\\xE4rde",ariaFilterValue:"Filterv\\xE4rde",ariaFilterMenuOpen:"\\xD6ppna filtermeny",ariaFilteringOperator:"Filtreringsoperator",ariaHidden:"dold",ariaIndeterminate:"obest\\xE4md",ariaInputEditor:"Inmatningsredigerare",ariaMenuColumn:"Tryck ALT NED\\xC5T f\\xF6r att \\xF6ppna kolumnmeny",ariaFilterColumn:"Tryck CTRL ENTER f\\xF6r att \\xF6ppna filter",ariaRowDeselect:"Tryck SPACE f\\xF6r att avmarkera denna rad",ariaRowSelectAll:"Tryck SPACE f\\xF6r att v\\xE4xla markering av alla rader",ariaRowToggleSelection:"Tryck SPACE f\\xF6r att v\\xE4xla radmarkering",ariaRowSelect:"Tryck SPACE f\\xF6r att markera denna rad",ariaRowSelectionDisabled:"Radmarkering \\xE4r inaktiverad f\\xF6r denna rad",ariaSearch:"S\\xF6k",ariaSortableColumn:"Tryck ENTER f\\xF6r att sortera",ariaToggleVisibility:"Tryck SPACE f\\xF6r att v\\xE4xla synlighet",ariaToggleCellValue:"Tryck SPACE f\\xF6r att v\\xE4xla cellv\\xE4rde",a';
      S = S + 'riaUnchecked:"omarkerad",ariaVisible:"synlig",ariaSearchFilterValues:"S\\xF6k filterv\\xE4rden",ariaPageSizeSelectorLabel:"Sidstorlek",ariaChartMenuClose:"St\\xE4ng diagramredigeringsmeny",ariaChartSelected:"Vald",ariaSkeletonCellLoadingFailed:"Raden kunde inte laddas",ariaSkeletonCellLoading:"Raddata laddas",ariaRowGroupDropZonePanelLabel:"Radgrupper",ariaValuesDropZonePanelLabel:"V\\xE4rden",ariaPivotDropZonePanelLabel:"Kolumnetiketter",ariaDropZoneColumnComponentDescription:"Tryck p\\xE5 DELETE f\\xF6r att ta bort",ariaDropZoneColumnValueItemDescription:"Tryck p\\xE5 ENTER f\\xF6r att \\xE4ndra aggregeringstyp",ariaDropZoneColumnGroupItemDescription:"Tryck p\\xE5 ENTER f\\xF6r att sortera",ariaDropZoneColumnComponentAggFuncSeparator:" av ",ariaDropZoneColumnComponentSortAscending:"stigande",ariaDropZoneColumnComponentSortDescending:"fallande",ariaLabelDialog:"Dialogruta",ariaLabelColumnMenu:"Kolumnmeny",ariaLabelColumnFilter:"Kolumnfilter",ariaLabelCellEditor:"Celleditor",ariaLabelSelectField:"V\\xE4lj f\\xE4lt",ariaLabelRichSelectField:"Rich Selectf\\xE4lt",ariaLabelRichSelectToggleSelection:"Tryck p\\xE5 MELLANSLAG f\\xF6r att v\\xE4xla markering",ariaLabelRichSelectDeselectAllItems:"Tryck p\\xE5 DELETE f\\xF6r att avmarkera alla objekt",ariaLabelRichSelectDeleteSelection:"Tryck p\\xE5 DELETE f\\xF6r att avmarkera objekt",ariaLabelTooltip:"Verktygstips",ariaLabelContextMenu:"Kontekstmeny",ariaLabelSubMenu:"Undermeny",ariaLabelAggregationFunction:"Aggregeringsfunktion",ariaLabelAdvancedFilterAutocomplete:"Avancerad Filter Autocomplete",ariaLabelAdvancedFilterBuilderAddField:"Avancerad Filter Builder L\\xE4gg till f\\xE4lt",ariaLabelAdvancedFilterBuilderColumnSelectField:"Avancerad Filter Builder Kolumn V\\xE4lj f\\xE4lt",ariaLabelAdvancedFilterBuilderOptionSelectField:"Avancerad Filter Builder Alternativ V\\xE4lj f\\xE4lt",ariaLabelAdvancedFilterBuilderJoinSelectField:"Avancerad Filter Builder Join Operator V\\xE4lj f\\xE4lt",ariaColumnPanelList:"Kolumnlista",ariaFilterPanelList:"Filterlist';
      S = S + 'a",thousandSeparator:",",decimalSeparator:".",true:"Sann",false:"Falsk",invalidDate:"Ogiltigt datum",invalidNumber:"Ogiltigt nummer",january:"Januari",february:"Februari",march:"Mars",april:"April",may:"Maj",june:"Juni",july:"Juli",august:"Augusti",september:"September",october:"Oktober",november:"November",december:"December",timeFormatSlashesDDMMYYYY:"DD/MM/YYYY",timeFormatSlashesMMDDYYYY:"MM/DD/YYYY",timeFormatSlashesDDMMYY:"DD/MM/YY",timeFormatSlashesMMDDYY:"MM/DD/YY",timeFormatDotsDDMYY:"DD.M.YY",timeFormatDotsMDDYY:"M.DD.YY",timeFormatDashesYYYYMMDD:"YYYY-MM-DD",timeFormatSpacesDDMMMMYYYY:"DD MMMM YYYY",timeFormatHHMMSS:"HH:MM:SS",timeFormatHHMMSSAmPm:"HH:MM:SS FM/EM"},H={selectAll:"(T\\xFCm\\xFCn\\xFC Se\\xE7)",selectAllSearchResults:"(T\\xFCm Arama Sonu\\xE7lar\\u0131n\\u0131 Se\\xE7)",addCurrentSelectionToFilter:"Mevcut se\\xE7imi filtreye ekle",searchOoo:"Ara...",blanks:"(Bo\\u015F)",noMatches:"E\\u015Fle\\u015Fme yok",filterOoo:"Filtre...",equals:"E\\u015Fittir",notEqual:"E\\u015Fit de\\u011Fil",blank:"Bo\\u015F",notBlank:"Bo\\u015F de\\u011Fil",empty:"Birini se\\xE7in",lessThan:"Daha az",greaterThan:"Daha fazla",lessThanOrEqual:"K\\xFC\\xE7\\xFCk veya e\\u015Fit",greaterThanOrEqual:"B\\xFCy\\xFCk veya e\\u015Fit",inRange:"Aras\\u0131nda",inRangeStart:"Ba\\u015Flang\\u0131\\xE7",inRangeEnd:"Biti\\u015F",contains:"\\u0130\\xE7erir",notContains:"\\u0130\\xE7ermez",startsWith:"\\u0130le ba\\u015Flar",endsWith:"\\u0130le biter",dateFormatOoo:"yyyy-mm-dd",before:"\\xD6nce",after:"Sonra",andCondition:"VE",orCondition:"VEYA",applyFilter:"Uygula",resetFilter:"S\\u0131f\\u0131rla",clearFilter:"Temizle",cancelFilter:"\\u0130ptal",textFilter:"Metin Filtresi",numberFilter:"Say\\u0131 Filtresi",dateFilter:"Tarih Filtresi",setFilter:"Ayarlama Filtresi",groupFilterSelect:"Alan se\\xE7iniz:",advancedFilterContains:"i\\xE7erir",advancedFilterNotContains:"i\\xE7ermez",advancedFilterTextEquals:"e\\u015Fittir",advancedFilterTextNotEqual:"e\\u015Fit de\\u011Fildir",advancedFilterStartsWith:"ile ba\\u015Flar",advancedFilterEnd';
      S = S + 'sWith:"ile biter",advancedFilterBlank:"bo\\u015F",advancedFilterNotBlank:"bo\\u015F de\\u011Fil",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"do\\u011Fru",advancedFilterFalse:"yanl\\u0131\\u015F",advancedFilterAnd:"VE",advancedFilterOr:"VEYA",advancedFilterApply:"Uygula",advancedFilterBuilder:"Olu\\u015Fturucu",advancedFilterValidationMissingColumn:"S\\xFCtun eksik",advancedFilterValidationMissingOption:"Se\\xE7enek eksik",advancedFilterValidationMissingValue:"De\\u011Fer eksik",advancedFilterValidationInvalidColumn:"S\\xFCtun bulunamad\\u0131",advancedFilterValidationInvalidOption:"Se\\xE7enek bulunamad\\u0131",advancedFilterValidationMissingQuote:"De\\u011Ferin kapan\\u0131\\u015F t\\u0131rna\\u011F\\u0131 eksik",advancedFilterValidationNotANumber:"De\\u011Fer bir say\\u0131 de\\u011Fil",advancedFilterValidationInvalidDate:"De\\u011Fer ge\\xE7erli bir tarih de\\u011Fil",advancedFilterValidationMissingCondition:"Ko\\u015Ful eksik",advancedFilterValidationJoinOperatorMismatch:"Bir ko\\u015Ful i\\xE7indeki birle\\u015Ftirici operat\\xF6rlerin ayn\\u0131 olmas\\u0131 gerekir",advancedFilterValidationInvalidJoinOperator:"Birle\\u015Ftirici operat\\xF6r bulunamad\\u0131",advancedFilterValidationMissingEndBracket:"Kapan\\u0131\\u015F parantezi eksik",advancedFilterValidationExtraEndBracket:"Fazla kapan\\u0131\\u015F parantezi",advancedFilterValidationMessage:"\\u0130fade bir hata i\\xE7eriyor. ${variable} - ${variable}.",advancedFilterValidationMessageAtEnd:"\\u0130fade bir hata i\\xE7eriyor. ${variable} ifadenin sonunda.",advancedFilterBuilderTitle:"Geli\\u015Fmi\\u015F Filtre",advancedFilterBuilderApply:"Uygula",advancedFilterBuilderCancel:"\\u0130ptal",advancedFilterBuilderAddButtonTooltip:"Filtre veya Grup Ekle",advancedFilterBuilderRemoveButtonTooltip:"Kald\\u0131r",advancedFilterBuilderMoveUpButtonTooltip:"Yukar\\u0131 Ta\\u015F\\u0131",advancedFilterBuilderMo';
      S = S + 'veDownButtonTooltip:"A\\u015Fa\\u011F\\u0131 Ta\\u015F\\u0131",advancedFilterBuilderAddJoin:"Grup Ekle",advancedFilterBuilderAddCondition:"Filtre Ekle",advancedFilterBuilderSelectColumn:"Bir s\\xFCtun se\\xE7in",advancedFilterBuilderSelectOption:"Bir se\\xE7enek se\\xE7in",advancedFilterBuilderEnterValue:"Bir de\\u011Fer girin...",advancedFilterBuilderValidationAlreadyApplied:"Mevcut filtre zaten uygulanm\\u0131\\u015F.",advancedFilterBuilderValidationIncomplete:"T\\xFCm ko\\u015Fullar tamamlanmam\\u0131\\u015F.",advancedFilterBuilderValidationSelectColumn:"Bir s\\xFCtun se\\xE7melisiniz.",advancedFilterBuilderValidationSelectOption:"Bir se\\xE7enek se\\xE7melisiniz.",advancedFilterBuilderValidationEnterValue:"Bir de\\u011Fer girmelisiniz.",columns:"S\\xFCtunlar",filters:"Filtreler",pivotMode:"Pivot Modu",groups:"Sat\\u0131r Gruplar\\u0131",rowGroupColumnsEmptyMessage:"Sat\\u0131r gruplar\\u0131n\\u0131 ayarlamak i\\xE7in buraya s\\xFCr\\xFCkleyin",values:"De\\u011Ferler",valueColumnsEmptyMessage:"Toplamak i\\xE7in buraya s\\xFCr\\xFCkleyin",pivots:"S\\xFCtun Etiketleri",pivotColumnsEmptyMessage:"S\\xFCtun etiketlerini ayarlamak i\\xE7in buraya s\\xFCr\\xFCkleyin",group:"Grup",rowDragRow:"sat\\u0131r",rowDragRows:"sat\\u0131rlar",loadingOoo:"Y\\xFCkleniyor...",loadingError:"HATA",noRowsToShow:"G\\xF6sterilecek Sat\\u0131r Yok",enabled:"Etkin",pinColumn:"S\\xFCtunu Sabitle",pinLeft:"Sola Sabitle",pinRight:"Sa\\u011Fa Sabitle",noPin:"Sabitleme Yok",valueAggregation:"De\\u011Fer Toplama",noAggregation:"Hi\\xE7biri",autosizeThisColumn:"Bu S\\xFCtunu Otomatik Boyutland\\u0131r",autosizeAllColumns:"T\\xFCm S\\xFCtunlar\\u0131 Otomatik Boyutland\\u0131r",groupBy:"Grupla",ungroupBy:"Grubu \\xC7\\u0131kar",ungroupAll:"T\\xFCm Gruplar\\u0131 \\xC7\\u0131kar",addToValues:"${variable} de\\u011Ferlerine ekle",removeFromValues:"${variable} de\\u011Ferlerinden \\xE7\\u0131kar",addToLabels:"${variable} etiketlerine ekle",removeFromLabels:"${variable} etiketlerinden \\xE7\\u0131kar",resetColumns:"S\\xFCtunlar\\u0131 S\\u0131f\\u0131rla",expandAll:"T\\x';
      S = S + 'FCm Sat\\u0131r Gruplar\\u0131n\\u0131 Geni\\u015Flet",collapseAll:"T\\xFCm Sat\\u0131r Gruplar\\u0131n\\u0131 Daralt",copy:"Kopyala",ctrlC:"Ctrl+C",ctrlX:"Ctrl+X",copyWithHeaders:"Ba\\u015Fl\\u0131klarla Kopyala",copyWithGroupHeaders:"Grup Ba\\u015Fl\\u0131klar\\u0131yla Kopyala",cut:"Kes",paste:"Yap\\u0131\\u015Ft\\u0131r",ctrlV:"Ctrl+V",export:"D\\u0131\\u015Fa Aktar",csvExport:"CSV Olarak D\\u0131\\u015Fa Aktar",excelExport:"Excel Olarak D\\u0131\\u015Fa Aktar",columnFilter:"S\\xFCtun Filtresi",columnChooser:"S\\xFCtunlar\\u0131 Se\\xE7",sortAscending:"Artan S\\u0131ral\\u0131",sortDescending:"Azalan S\\u0131ral\\u0131",sortUnSort:"S\\u0131ralamay\\u0131 Temizle",sum:"Toplam",first:"\\u0130lk",last:"Son",min:"Min",max:"Maks",none:"Yok",count:"Say\\u0131m",avg:"Ortalama",filteredRows:"Filtrelenmi\\u015F",selectedRows:"Se\\xE7ili",totalRows:"Toplam Sat\\u0131rlar",totalAndFilteredRows:"Sat\\u0131rlar",more:"Daha fazla",to:"ile",of:"\\xFCzerinden",page:"Sayfa",pageLastRowUnknown:"?",nextPage:"Sonraki Sayfa",lastPage:"Son Sayfa",firstPage:"\\u0130lk Sayfa",previousPage:"\\xD6nceki Sayfa",pageSizeSelectorLabel:"Sayfa Boyutu:",footerTotal:"Toplam",pivotColumnGroupTotals:"Toplam",pivotChartAndPivotMode:"Pivot Grafi\\u011Fi ve Pivot Modu",pivotChart:"Pivot Grafi\\u011Fi",chartRange:"Grafik Aral\\u0131\\u011F\\u0131",columnChart:"S\\xFCtun",groupedColumn:"Gruplanm\\u0131\\u015F",stackedColumn:"Y\\u0131\\u011F\\u0131lm\\u0131\\u015F",normalizedColumn:"%100 Y\\u0131\\u011F\\u0131lm\\u0131\\u015F",barChart:"\\xC7ubuk",groupedBar:"Gruplanm\\u0131\\u015F",stackedBar:"Y\\u0131\\u011F\\u0131lm\\u0131\\u015F",normalizedBar:"%100 Y\\u0131\\u011F\\u0131lm\\u0131\\u015F",pieChart:"Pasta",pie:"Pasta",donut:"Halka",line:"\\xC7izgi",xyChart:"X Y (Serpme)",scatter:"Serpme",bubble:"Baloncuk",areaChart:"Alan",area:"Alan",stackedArea:"Y\\u0131\\u011F\\u0131lm\\u0131\\u015F",normalizedArea:"%100 Y\\u0131\\u011F\\u0131lm\\u0131\\u015F",histogramChart:"Histogram",polarChart:"Polar",radarLine:"Radar \\xC7izgisi",radarArea:"Radar Alan\\u0131",nightingale:"Nightingale",radialCo';
      S = S + 'lumn:"Radyal S\\xFCtun",radialBar:"Radyal \\xC7ubuk",statisticalChart:"\\u0130statistiksel",boxPlot:"Kutu Grafi\\u011Fi",rangeBar:"Aral\\u0131k \\xC7ubu\\u011Fu",rangeArea:"Aral\\u0131k Alan\\u0131",hierarchicalChart:"Hiyerar\\u015Fik",treemap:"A\\u011Fa\\xE7 Haritas\\u0131",sunburst:"G\\xFCne\\u015F\\u0131\\u015F\\u0131\\u011F\\u0131",specializedChart:"\\xD6zel",waterfall:"\\u015Eelale",heatmap:"Is\\u0131 Haritas\\u0131",combinationChart:"Kombinasyon",columnLineCombo:"S\\xFCtun ve \\xC7izgi",AreaColumnCombo:"Alan ve S\\xFCtun",pivotChartTitle:"\\xD6zet Grafik",rangeChartTitle:"Aral\\u0131k Grafi\\u011Fi",settings:"Grafik",data:"Kurulum",format:"\\xD6zelle\\u015Ftir",categories:"Kategoriler",defaultCategory:"(Hi\\xE7biri)",series:"Seriler",switchCategorySeries:"Kategori/Seri De\\u011Fi\\u015Ftir",categoryValues:"Kategori De\\u011Ferleri",seriesLabels:"Seri Etiketleri",aggregate:"Topla",xyValues:"X Y De\\u011Ferleri",paired:"E\\u015Fle\\u015Ftirilmi\\u015F Mod",axis:"Eksen",xAxis:"Yatay Eksen",yAxis:"Dikey Eksen",polarAxis:"Kutup Ekseni",radiusAxis:"Yar\\u0131\\xE7ap Ekseni",navigator:"Gezgin",zoom:"Yak\\u0131nla\\u015Ft\\u0131r",animation:"Animasyon",crosshair:"Kesi\\u015Fme Noktas\\u0131",color:"Renk",thickness:"Kal\\u0131nl\\u0131k",preferredLength:"Tercih Edilen Uzunluk",xType:"X Tipi",axisType:"Eksen Tipi",automatic:"Otomatik",category:"Kategori",number:"Say\\u0131",time:"Zaman",timeFormat:"Zaman Format\\u0131",autoRotate:"Otomatik D\\xF6nd\\xFCr",labelRotation:"D\\xF6nd\\xFCrme",circle:"Daire",polygon:"\\xC7okgen",square:"Kare",cross:"\\xC7arp\\u0131",diamond:"Elmas",plus:"Art\\u0131",triangle:"\\xDC\\xE7gen",heart:"Kalp",orientation:"Y\\xF6n",fixed:"Sabit",parallel:"Paralel",perpendicular:"Dik",radiusAxisPosition:"Pozisyon",ticks:"Kene",gridLines:"Izgara \\xC7izgileri",width:"Geni\\u015Flik",height:"Y\\xFCkseklik",length:"Uzunluk",padding:"Dolgu",spacing:"Aral\\u0131k",chartStyle:"Grafik Stili",title:"Ba\\u015Fl\\u0131k",chartTitles:"Ba\\u015Fl\\u0131klar",chartTitle:"Grafik Ba\\u015Fl\\u0131\\u011F\\u0131",chartSubtitle:"Alt Ba\\u01';
      S = S + '5Fl\\u0131k",horizontalAxisTitle:"Yatay Eksen Ba\\u015Fl\\u0131\\u011F\\u0131",verticalAxisTitle:"Dikey Eksen Ba\\u015Fl\\u0131\\u011F\\u0131",polarAxisTitle:"Kutup Ekseni Ba\\u015Fl\\u0131\\u011F\\u0131",titlePlaceholder:"Grafik Ba\\u015Fl\\u0131\\u011F\\u0131",background:"Arka Plan",font:"Yaz\\u0131 Tipi",weight:"A\\u011F\\u0131rl\\u0131k",top:"\\xDCst",right:"Sa\\u011F",bottom:"Alt",left:"Sol",labels:"Etiketler",calloutLabels:"\\xC7a\\u011Fr\\u0131 Etiketleri",sectorLabels:"Sekt\\xF6r Etiketleri",positionRatio:"Pozisyon Oran\\u0131",size:"Boyut",shape:"\\u015Eekil",minSize:"Minimum Boyut",maxSize:"Maksimum Boyut",legend:"A\\xE7\\u0131klama",position:"Pozisyon",markerSize:"\\u0130\\u015Faret\\xE7i Boyutu",markerStroke:"\\u0130\\u015Faret\\xE7i \\xC7izgisi",markerPadding:"\\u0130\\u015Faret\\xE7i Dolgusu",itemSpacing:"\\xD6\\u011Fe Aral\\u0131\\u011F\\u0131",itemPaddingX:"\\xD6\\u011Fe Yatay Doldurma",itemPaddingY:"\\xD6\\u011Fe Dikey Doldurma",layoutHorizontalSpacing:"Yatay Aral\\u0131k",layoutVerticalSpacing:"Dikey Aral\\u0131k",strokeWidth:"\\xC7izgi Kal\\u0131nl\\u0131\\u011F\\u0131",offset:"Sapma",offsets:"Sapmalar",tooltips:"Ara\\xE7 \\u0130pu\\xE7lar\\u0131",callout:"\\xC7a\\u011Fr\\u0131",markers:"\\u0130\\u015Faret\\xE7iler",shadow:"G\\xF6lge",blur:"Bulan\\u0131kl\\u0131k",xOffset:"X Sapma",yOffset:"Y Sapma",lineWidth:"\\xC7izgi Geni\\u015Fli\\u011Fi",lineDash:"\\xC7izgi Kesikli",lineDashOffset:"Kesik Sapma",scrollingZoom:"Kayd\\u0131rma",scrollingStep:"Kayd\\u0131rma Ad\\u0131m\\u0131",selectingZoom:"Se\\xE7im",durationMillis:"S\\xFCre (ms)",crosshairLabel:"Etiket",crosshairSnap:"D\\xFC\\u011F\\xFCm Noktas\\u0131na Yakla\\u015F",normal:"Normal",bold:"Kal\\u0131n",italic:"\\u0130talik",boldItalic:"Kal\\u0131n \\u0130talik",predefined:"\\xD6nceden Tan\\u0131mlanm\\u0131\\u015F",fillOpacity:"Doldurma Opakl\\u0131\\u011F\\u0131",strokeColor:"\\xC7izgi Rengi",strokeOpacity:"\\xC7izgi Opakl\\u0131\\u011F\\u0131",miniChart:"Mini Grafik",histogramBinCount:"Bin say\\u0131s\\u0131",connectorLine:"Ba\\u011Flay\\u0131c\\u0131 \\xC7izgi",seriesItems:"Seri \\xD6\\u011Feleri",';
      S = S + 'seriesItemType:"\\xD6\\u011Fe Tipi",seriesItemPositive:"Pozitif",seriesItemNegative:"Negatif",seriesItemLabels:"\\xD6\\u011Fe Etiketleri",columnGroup:"S\\xFCtun",barGroup:"\\xC7ubuk",pieGroup:"Pasta",lineGroup:"\\xC7izgi",scatterGroup:"X Y (Da\\u011F\\u0131l\\u0131m)",areaGroup:"Alan",polarGroup:"Kutup",statisticalGroup:"\\u0130statistiksel",hierarchicalGroup:"Hiyerar\\u015Fik",specializedGroup:"Uzmanla\\u015Fm\\u0131\\u015F",combinationGroup:"Kombinasyon",groupedColumnTooltip:"Grupland\\u0131r\\u0131lm\\u0131\\u015F",stackedColumnTooltip:"Y\\u0131\\u011F\\u0131lm\\u0131\\u015F",normalizedColumnTooltip:"100% Y\\u0131\\u011F\\u0131lm\\u0131\\u015F",groupedBarTooltip:"Grupland\\u0131r\\u0131lm\\u0131\\u015F",stackedBarTooltip:"Y\\u0131\\u011F\\u0131lm\\u0131\\u015F",normalizedBarTooltip:"100% Y\\u0131\\u011F\\u0131lm\\u0131\\u015F",pieTooltip:"Pasta",donutTooltip:"Donut",lineTooltip:"\\xC7izgi",groupedAreaTooltip:"Alan",stackedAreaTooltip:"Y\\u0131\\u011F\\u0131lm\\u0131\\u015F",normalizedAreaTooltip:"100% Y\\u0131\\u011F\\u0131lm\\u0131\\u015F",scatterTooltip:"Da\\u011F\\u0131l\\u0131m",bubbleTooltip:"Balon",histogramTooltip:"Histogram",radialColumnTooltip:"Radyal S\\xFCtun",radialBarTooltip:"Radyal \\xC7ubuk",radarLineTooltip:"Radar \\xC7izgisi",radarAreaTooltip:"Radar Alan\\u0131",nightingaleTooltip:"Nightingale",rangeBarTooltip:"Aral\\u0131k \\xC7ubu\\u011Fu",rangeAreaTooltip:"Aral\\u0131k Alan\\u0131",boxPlotTooltip:"Kutu Grafi\\u011Fi",treemapTooltip:"A\\u011Fa\\xE7 Haritas\\u0131",sunburstTooltip:"Patlama",waterfallTooltip:"\\u015Eelale",heatmapTooltip:"Is\\u0131 Haritas\\u0131",columnLineComboTooltip:"S\\xFCtun & \\xC7izgi",areaColumnComboTooltip:"Alan & S\\xFCtun",customComboTooltip:"\\xD6zel Kombinasyon",innerRadius:"\\u0130\\xE7 Yar\\u0131\\xE7ap",startAngle:"Ba\\u015Flang\\u0131\\xE7 A\\xE7\\u0131s\\u0131",endAngle:"Biti\\u015F A\\xE7\\u0131s\\u0131",reverseDirection:"Y\\xF6n\\xFC Ters \\xC7evir",groupPadding:"Grup Doldurma",seriesPadding:"Seri Doldurma",tile:"D\\xF6\\u015Feme",whisker:"B\\u0131y\\u0131k",cap:"\\u015Eapka",capLengthRatio:"Uzunluk Oran\\u';
      S = S + '0131",labelPlacement:"Etiket Yerle\\u015Fimi",inside:"\\u0130\\xE7inde",outside:"D\\u0131\\u015F\\u0131nda",noDataToChart:"Grafik i\\xE7in veri yok.",pivotChartRequiresPivotMode:"\\xD6zet Grafik, Pivot Modun etkin olmas\\u0131n\\u0131 gerektirir.",chartSettingsToolbarTooltip:"Men\\xFC",chartLinkToolbarTooltip:"Grida Ba\\u011Fl\\u0131",chartUnlinkToolbarTooltip:"Gridden Ayr\\u0131k",chartDownloadToolbarTooltip:"Grafi\\u011Fi \\u0130ndir",chartMenuToolbarTooltip:"Men\\xFC",chartEdit:"Grafi\\u011Fi D\\xFCzenle",chartAdvancedSettings:"Geli\\u015Fmi\\u015F Ayarlar",chartLink:"Grida Ba\\u011Fla",chartUnlink:"Gridden Ay\\u0131r",chartDownload:"Grafi\\u011Fi \\u0130ndir",histogramFrequency:"Frekans",seriesChartType:"Seri Grafik Tipi",seriesType:"Seri Tipi",secondaryAxis:"\\u0130kincil Eksen",seriesAdd:"Bir seri ekle",categoryAdd:"Bir kategori ekle",bar:"\\xC7ubuk",column:"S\\xFCtun",histogram:"Histogram",advancedSettings:"Geli\\u015Fmi\\u015F Ayarlar",direction:"Y\\xF6n",horizontal:"Yatay",vertical:"Dikey",seriesGroupType:"Grup Tipi",groupedSeriesGroupType:"Grupland\\u0131r\\u0131lm\\u0131\\u015F",stackedSeriesGroupType:"Y\\u0131\\u011F\\u0131lm\\u0131\\u015F",normalizedSeriesGroupType:"100% Y\\u0131\\u011F\\u0131lm\\u0131\\u015F",legendEnabled:"Etkin",invalidColor:"Renk de\\u011Feri ge\\xE7ersiz",groupedColumnFull:"Grupland\\u0131r\\u0131lm\\u0131\\u015F S\\xFCtun",stackedColumnFull:"Y\\u0131\\u011F\\u0131lm\\u0131\\u015F S\\xFCtun",normalizedColumnFull:"100% Y\\u0131\\u011F\\u0131lm\\u0131\\u015F S\\xFCtun",groupedBarFull:"Grupland\\u0131r\\u0131lm\\u0131\\u015F \\xC7ubuk",stackedBarFull:"Y\\u0131\\u011F\\u0131lm\\u0131\\u015F \\xC7ubuk",normalizedBarFull:"100% Y\\u0131\\u011F\\u0131lm\\u0131\\u015F \\xC7ubuk",stackedAreaFull:"Y\\u0131\\u011F\\u0131lm\\u0131\\u015F Alan",normalizedAreaFull:"100% Y\\u0131\\u011F\\u0131lm\\u0131\\u015F Alan",customCombo:"\\xD6zel Kombinasyon",ariaAdvancedFilterBuilderItem:"${variable}. Seviye ${variable}. D\\xFCzenlemek i\\xE7in ENTER tu\\u015Funa bas\\u0131n",ariaAdvancedFilterBuilderItemValidation:"${variable}. Seviye ${variable}. $';
      S = S + '{variable} D\\xFCzenlemek i\\xE7in ENTER tu\\u015Funa bas\\u0131n.",ariaAdvancedFilterBuilderList:"Geli\\u015Fmi\\u015F Filtre Olu\\u015Fturucu Listesi",ariaAdvancedFilterBuilderFilterItem:"Filtre Ko\\u015Fulu",ariaAdvancedFilterBuilderGroupItem:"Filtre Grubu",ariaAdvancedFilterBuilderColumn:"S\\xFCtun",ariaAdvancedFilterBuilderOption:"Se\\xE7enek",ariaAdvancedFilterBuilderValueP:"De\\u011Fer",ariaAdvancedFilterBuilderJoinOperator:"Ba\\u011Flant\\u0131 Operat\\xF6r\\xFC",ariaAdvancedFilterInput:"Geli\\u015Fmi\\u015F Filtre Giri\\u015Fi",ariaChecked:"i\\u015Faretli",ariaColumn:"S\\xFCtun",ariaColumnGroup:"S\\xFCtun Grubu",ariaColumnFiltered:"S\\xFCtun Filtrelendi",ariaColumnSelectAll:"T\\xFCm S\\xFCtunlar\\u0131 Se\\xE7meyi De\\u011Fi\\u015Ftir",ariaDateFilterInput:"Tarih Filtre Giri\\u015Fi",ariaDefaultListName:"Liste",ariaFilterColumnsInput:"S\\xFCtunlar\\u0131 Filtrele Giri\\u015Fi",ariaFilterFromValue:"De\\u011Ferden filtrele",ariaFilterInput:"Filtre Giri\\u015Fi",ariaFilterList:"Filtre Listesi",ariaFilterToValue:"De\\u011Fere filtrele",ariaFilterValue:"Filtre De\\u011Feri",ariaFilterMenuOpen:"Filtre Men\\xFCs\\xFCn\\xFC A\\xE7",ariaFilteringOperator:"Filtreleme Operat\\xF6r\\xFC",ariaHidden:"gizli",ariaIndeterminate:"belirsiz",ariaInputEditor:"Giri\\u015F D\\xFCzenleyicisi",ariaMenuColumn:"S\\xFCtun men\\xFCs\\xFCn\\xFC a\\xE7mak i\\xE7in ALT A\\u015EA\\u011EI tu\\u015Flar\\u0131na bas\\u0131n",ariaFilterColumn:"Filtreyi a\\xE7mak i\\xE7in CTRL ENTER tu\\u015Flar\\u0131na bas\\u0131n",ariaRowDeselect:"Bu sat\\u0131r\\u0131n se\\xE7imini kald\\u0131rmak i\\xE7in SPACE tu\\u015Funa bas\\u0131n",ariaRowSelectAll:"T\\xFCm sat\\u0131rlar\\u0131n se\\xE7imini de\\u011Fi\\u015Ftirmek i\\xE7in Bo\\u015Fluk tu\\u015Funa bas\\u0131n",ariaRowToggleSelection:"Sat\\u0131r se\\xE7imini de\\u011Fi\\u015Ftirmek i\\xE7in Bo\\u015Fluk tu\\u015Funa bas\\u0131n",ariaRowSelect:"Bu sat\\u0131r\\u0131 se\\xE7mek i\\xE7in SPACE tu\\u015Funa bas\\u0131n",ariaRowSelectionDisabled:"Bu sat\\u0131r i\\xE7in Sat\\u0131r Se\\xE7imi devre d\\u0131\\u015F\\u0131 b\\u0131rak\\u0131lm\\u0131\\u01';
      S = S + '5Ft\\u0131r",ariaSearch:"Ara",ariaSortableColumn:"S\\u0131ralamak i\\xE7in ENTER tu\\u015Funa bas\\u0131n",ariaToggleVisibility:"G\\xF6r\\xFCn\\xFCrl\\xFC\\u011F\\xFC de\\u011Fi\\u015Ftirmek i\\xE7in SPACE tu\\u015Funa bas\\u0131n",ariaToggleCellValue:"H\\xFCcre de\\u011Ferini de\\u011Fi\\u015Ftirmek i\\xE7in SPACE tu\\u015Funa bas\\u0131n",ariaUnchecked:"i\\u015Faretli de\\u011Fil",ariaVisible:"g\\xF6r\\xFCn\\xFCr",ariaSearchFilterValues:"Filtre de\\u011Ferlerini ara",ariaPageSizeSelectorLabel:"Sayfa Boyutu",ariaChartMenuClose:"Grafik D\\xFCzenleme Men\\xFCs\\xFCn\\xFC Kapat",ariaChartSelected:"Se\\xE7ildi",ariaSkeletonCellLoadingFailed:"Sat\\u0131r y\\xFCklenemedi",ariaSkeletonCellLoading:"Sat\\u0131r verisi y\\xFCkleniyor",ariaRowGroupDropZonePanelLabel:"Sat\\u0131r Gruplar\\u0131",ariaValuesDropZonePanelLabel:"De\\u011Ferler",ariaPivotDropZonePanelLabel:"S\\xFCtun Etiketleri",ariaDropZoneColumnComponentDescription:"Kald\\u0131rmak i\\xE7in DELETE tu\\u015Funa bas\\u0131n",ariaDropZoneColumnValueItemDescription:"Toplama t\\xFCr\\xFCn\\xFC de\\u011Fi\\u015Ftirmek i\\xE7in ENTER tu\\u015Funa bas\\u0131n",ariaDropZoneColumnGroupItemDescription:"S\\u0131ralamak i\\xE7in ENTER tu\\u015Funa bas\\u0131n",ariaDropZoneColumnComponentAggFuncSeparator:" of ",ariaDropZoneColumnComponentSortAscending:"artan",ariaDropZoneColumnComponentSortDescending:"azalan",ariaLabelDialog:"Diyalog",ariaLabelColumnMenu:"S\\xFCtun Men\\xFCs\\xFC",ariaLabelColumnFilter:"S\\xFCtun Filtresi",ariaLabelCellEditor:"H\\xFCcre D\\xFCzenleyici",ariaLabelSelectField:"Alan Se\\xE7",ariaLabelRichSelectField:"Zengin Se\\xE7im Alan\\u0131",ariaLabelRichSelectToggleSelection:"Se\\xE7imi de\\u011Fi\\u015Ftirmek i\\xE7in BO\\u015ELUK tu\\u015Funa bas\\u0131n",ariaLabelRichSelectDeselectAllItems:"T\\xFCm \\xF6\\u011Felerin se\\xE7imini kald\\u0131rmak i\\xE7in S\\u0130L tu\\u015Funa bas\\u0131n",ariaLabelRichSelectDeleteSelection:"\\xD6\\u011Fenin se\\xE7imini kald\\u0131rmak i\\xE7in S\\u0130L tu\\u015Funa bas\\u0131n",ariaLabelTooltip:"\\u0130pucu",ariaLabelContextMenu:"Ba\\u011Flam Men\\xFCs\\xFC",ar';
      S = S + 'iaLabelSubMenu:"Alt Men\\xFC",ariaLabelAggregationFunction:"Toplama Fonksiyonu",ariaLabelAdvancedFilterAutocomplete:"Geli\\u015Fmi\\u015F Filtre Otomatik Tamamlama",ariaLabelAdvancedFilterBuilderAddField:"Geli\\u015Fmi\\u015F Filtre Olu\\u015Fturucu Alan Ekle",ariaLabelAdvancedFilterBuilderColumnSelectField:"Geli\\u015Fmi\\u015F Filtre Olu\\u015Fturucu S\\xFCtun Se\\xE7im Alan\\u0131",ariaLabelAdvancedFilterBuilderOptionSelectField:"Geli\\u015Fmi\\u015F Filtre Olu\\u015Fturucu Se\\xE7enek Se\\xE7im Alan\\u0131",ariaLabelAdvancedFilterBuilderJoinSelectField:"Geli\\u015Fmi\\u015F Filtre Olu\\u015Fturucu Birle\\u015Ftirme Operat\\xF6r\\xFC Se\\xE7im Alan\\u0131",ariaColumnPanelList:"Kolon Listesi",ariaFilterPanelList:"Filtre Listesi",thousandSeparator:".",decimalSeparator:",",true:"Do\\u011Fru",false:"Yanl\\u0131\\u015F",invalidDate:"Ge\\xE7ersiz Tarih",invalidNumber:"Ge\\xE7ersiz Say\\u0131",january:"Ocak",february:"\\u015Eubat",march:"Mart",april:"Nisan",may:"May\\u0131s",june:"Haziran",july:"Temmuz",august:"A\\u011Fustos",september:"Eyl\\xFCl",october:"Ekim",november:"Kas\\u0131m",december:"Aral\\u0131k",timeFormatSlashesDDMMYYYY:"GG/AA/YYYY",timeFormatSlashesMMDDYYYY:"AA/GG/YYYY",timeFormatSlashesDDMMYY:"GG/AA/YY",timeFormatSlashesMMDDYY:"AA/GG/YY",timeFormatDotsDDMYY:"GG.A.YY",timeFormatDotsMDDYY:"A.GG.YY",timeFormatDashesYYYYMMDD:"YYYY-AA-GG",timeFormatSpacesDDMMMMYYYY:"GG AAAA YYYY",timeFormatHHMMSS:"SS:DD:SS",timeFormatHHMMSSAmPm:"SS:DD:SS \\xD6\\xD6/\\xD6S"},q={selectAll:"(\\u0412\\u0438\\u0431\\u0440\\u0430\\u0442\\u0438 \\u0432\\u0441\\u0435)",selectAllSearchResults:"(\\u0412\\u0438\\u0431\\u0440\\u0430\\u0442\\u0438 \\u0432\\u0441\\u0456 \\u0440\\u0435\\u0437\\u0443\\u043B\\u044C\\u0442\\u0430\\u0442\\u0438 \\u043F\\u043E\\u0448\\u0443\\u043A\\u0443)",addCurrentSelectionToFilter:"\\u0414\\u043E\\u0434\\u0430\\u0442\\u0438 \\u043F\\u043E\\u0442\\u043E\\u0447\\u043D\\u0438\\u0439 \\u0432\\u0438\\u0431\\u0456\\u0440 \\u0434\\u043E \\u0444\\u0456\\u043B\\u044C\\u0442\\u0440\\u0443",searchOoo:"\\u041F\\u043E\\u0448\\u0443\\u043A...",blanks:"(\\u041F\\u0443\\u0441\\u0442\\u04';
      S = S + '56)",noMatches:"\\u0421\\u043F\\u0456\\u0432\\u043F\\u0430\\u0434\\u0456\\u043D\\u044C \\u043D\\u0435 \\u0437\\u043D\\u0430\\u0439\\u0434\\u0435\\u043D\\u043E",filterOoo:"\\u0424\\u0456\\u043B\\u044C\\u0442\\u0440...",equals:"\\u0414\\u043E\\u0440\\u0456\\u0432\\u043D\\u044E\\u0454",notEqual:"\\u041D\\u0435 \\u0434\\u043E\\u0440\\u0456\\u0432\\u043D\\u044E\\u0454",blank:"\\u041F\\u043E\\u0440\\u043E\\u0436\\u043D\\u0456\\u0439",notBlank:"\\u041D\\u0435 \\u043F\\u043E\\u0440\\u043E\\u0436\\u043D\\u0456\\u0439",empty:"\\u0412\\u0438\\u0431\\u0435\\u0440\\u0456\\u0442\\u044C \\u043E\\u0434\\u0438\\u043D",lessThan:"\\u041C\\u0435\\u043D\\u0448\\u0435 \\u043D\\u0456\\u0436",greaterThan:"\\u0411\\u0456\\u043B\\u044C\\u0448\\u0435 \\u043D\\u0456\\u0436",lessThanOrEqual:"\\u041C\\u0435\\u043D\\u0448\\u0435 \\u0430\\u0431\\u043E \\u0434\\u043E\\u0440\\u0456\\u0432\\u043D\\u044E\\u0454",greaterThanOrEqual:"\\u0411\\u0456\\u043B\\u044C\\u0448\\u0435 \\u0430\\u0431\\u043E \\u0434\\u043E\\u0440\\u0456\\u0432\\u043D\\u044E\\u0454",inRange:"\\u041C\\u0456\\u0436",inRangeStart:"\\u0412\\u0456\\u0434",inRangeEnd:"\\u0414\\u043E",contains:"\\u041C\\u0456\\u0441\\u0442\\u0438\\u0442\\u044C",notContains:"\\u041D\\u0435 \\u043C\\u0456\\u0441\\u0442\\u0438\\u0442\\u044C",startsWith:"\\u041F\\u043E\\u0447\\u0438\\u043D\\u0430\\u0454\\u0442\\u044C\\u0441\\u044F \\u0437",endsWith:"\\u0417\\u0430\\u043A\\u0456\\u043D\\u0447\\u0443\\u0454\\u0442\\u044C\\u0441\\u044F \\u043D\\u0430",dateFormatOoo:"yyyy-mm-dd",before:"\\u0414\\u043E",after:"\\u041F\\u0456\\u0441\\u043B\\u044F",andCondition:"\\u0406",orCondition:"\\u0410\\u0411\\u041E",applyFilter:"\\u0417\\u0430\\u0441\\u0442\\u043E\\u0441\\u0443\\u0432\\u0430\\u0442\\u0438",resetFilter:"\\u0421\\u043A\\u0438\\u043D\\u0443\\u0442\\u0438",clearFilter:"\\u041E\\u0447\\u0438\\u0441\\u0442\\u0438\\u0442\\u0438",cancelFilter:"\\u0421\\u043A\\u0430\\u0441\\u0443\\u0432\\u0430\\u0442\\u0438",textFilter:"\\u0422\\u0435\\u043A\\u0441\\u0442\\u043E\\u0432\\u0438\\u0439 \\u0444\\u0456\\u043B\\u044C\\u0442\\u0440",numberFilter:"\\u0427\\u0438\\u0441\\u043B\\u043E\\u0432\\u0438\\u0439 \\u0444\\u0456\\u043B\\u044C\\u0442\\u0440",dateFilter:"\\u0424\\u0456\\u043B\\u044C\\u0442\\u0440 \\u0437\\u0430 \\u0434\\u0430';
      S = S + '\\u0442\\u043E\\u044E",setFilter:"\\u0424\\u0456\\u043B\\u044C\\u0442\\u0440 \\u0437\\u0430 \\u043C\\u043D\\u043E\\u0436\\u0438\\u043D\\u043E\\u044E",groupFilterSelect:"\\u0412\\u0438\\u0431\\u0435\\u0440\\u0456\\u0442\\u044C \\u043F\\u043E\\u043B\\u0435:",advancedFilterContains:"\\u043C\\u0456\\u0441\\u0442\\u0438\\u0442\\u044C",advancedFilterNotContains:"\\u043D\\u0435 \\u043C\\u0456\\u0441\\u0442\\u0438\\u0442\\u044C",advancedFilterTextEquals:"\\u0434\\u043E\\u0440\\u0456\\u0432\\u043D\\u044E\\u0454",advancedFilterTextNotEqual:"\\u043D\\u0435 \\u0434\\u043E\\u0440\\u0456\\u0432\\u043D\\u044E\\u0454",advancedFilterStartsWith:"\\u043F\\u043E\\u0447\\u0438\\u043D\\u0430\\u0454\\u0442\\u044C\\u0441\\u044F \\u0437",advancedFilterEndsWith:"\\u0437\\u0430\\u043A\\u0456\\u043D\\u0447\\u0443\\u0454\\u0442\\u044C\\u0441\\u044F \\u043D\\u0430",advancedFilterBlank:"\\u0454 \\u043F\\u0443\\u0441\\u0442\\u0438\\u043C",advancedFilterNotBlank:"\\u043D\\u0435 \\u0454 \\u043F\\u0443\\u0441\\u0442\\u0438\\u043C",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"\\u0454 \\u0456\\u0441\\u0442\\u0438\\u043D\\u043D\\u0438\\u043C",advancedFilterFalse:"\\u0454 \\u0445\\u0438\\u0431\\u043D\\u0438\\u043C",advancedFilterAnd:"\\u0406",advancedFilterOr:"\\u0410\\u0411\\u041E",advancedFilterApply:"\\u0417\\u0430\\u0441\\u0442\\u043E\\u0441\\u0443\\u0432\\u0430\\u0442\\u0438",advancedFilterBuilder:"\\u041F\\u043E\\u0431\\u0443\\u0434\\u043E\\u0432\\u0430",advancedFilterValidationMissingColumn:"\\u0412\\u0456\\u0434\\u0441\\u0443\\u0442\\u043D\\u044F \\u043A\\u043E\\u043B\\u043E\\u043D\\u043A\\u0430",advancedFilterValidationMissingOption:"\\u0412\\u0456\\u0434\\u0441\\u0443\\u0442\\u043D\\u0456\\u0439 \\u0432\\u0430\\u0440\\u0456\\u0430\\u043D\\u0442",advancedFilterValidationMissingValue:"\\u0412\\u0456\\u0434\\u0441\\u0443\\u0442\\u043D\\u0454 \\u0437\\u043D\\u0430\\u0447\\u0435\\u043D\\u043D\\u044F",advancedFilterValidationInvalidColumn:"\\u041A\\u043E\\u043B\\u043E\\u043D\\u043A\\u0443 \\u043D\\u0435 \\u0437\\u043D\\u0430\\u0439\\u0434\\u0435\\u04';
      S = S + '3D\\u043E",advancedFilterValidationInvalidOption:"\\u0412\\u0430\\u0440\\u0456\\u0430\\u043D\\u0442 \\u043D\\u0435 \\u0437\\u043D\\u0430\\u0439\\u0434\\u0435\\u043D\\u043E",advancedFilterValidationMissingQuote:"\\u0417\\u043D\\u0430\\u0447\\u0435\\u043D\\u043D\\u044F \\u0431\\u0435\\u0437 \\u043A\\u0456\\u043D\\u0446\\u0435\\u0432\\u043E\\u0457 \\u043B\\u0430\\u043F\\u043A\\u0438",advancedFilterValidationNotANumber:"\\u0417\\u043D\\u0430\\u0447\\u0435\\u043D\\u043D\\u044F \\u043D\\u0435 \\u0454 \\u0447\\u0438\\u0441\\u043B\\u043E\\u043C",advancedFilterValidationInvalidDate:"\\u0417\\u043D\\u0430\\u0447\\u0435\\u043D\\u043D\\u044F \\u043D\\u0435 \\u0454 \\u0434\\u0456\\u0439\\u0441\\u043D\\u043E\\u044E \\u0434\\u0430\\u0442\\u043E\\u044E",advancedFilterValidationMissingCondition:"\\u0412\\u0456\\u0434\\u0441\\u0443\\u0442\\u043D\\u044F \\u0443\\u043C\\u043E\\u0432\\u0430",advancedFilterValidationJoinOperatorMismatch:"\\u041E\\u043F\\u0435\\u0440\\u0430\\u0442\\u043E\\u0440\\u0438 \\u043E\\u0431\'\\u0454\\u0434\\u043D\\u0430\\u043D\\u043D\\u044F \\u0432 \\u043C\\u0435\\u0436\\u0430\\u0445 \\u0443\\u043C\\u043E\\u0432\\u0438 \\u043C\\u0430\\u044E\\u0442\\u044C \\u0431\\u0443\\u0442\\u0438 \\u043E\\u0434\\u043D\\u0430\\u043A\\u043E\\u0432\\u0438\\u043C\\u0438",advancedFilterValidationInvalidJoinOperator:"\\u041E\\u043F\\u0435\\u0440\\u0430\\u0442\\u043E\\u0440 \\u043E\\u0431\'\\u0454\\u0434\\u043D\\u0430\\u043D\\u043D\\u044F \\u043D\\u0435 \\u0437\\u043D\\u0430\\u0439\\u0434\\u0435\\u043D\\u043E",advancedFilterValidationMissingEndBracket:"\\u0412\\u0456\\u0434\\u0441\\u0443\\u0442\\u043D\\u044F \\u043A\\u0456\\u043D\\u0446\\u0435\\u0432\\u0430 \\u0434\\u0443\\u0436\\u043A\\u0430",advancedFilterValidationExtraEndBracket:"\\u0417\\u0430\\u0431\\u0430\\u0433\\u0430\\u0442\\u043E \\u043A\\u0456\\u043D\\u0446\\u0435\\u0432\\u0438\\u0445 \\u0434\\u0443\\u0436\\u043E\\u043A",advancedFilterValidationMessage:"\\u0423 \\u0432\\u0438\\u0440\\u0430\\u0437\\u0456 \\u0454 \\u043F\\u043E\\u043C\\u0438\\u043B\\u043A\\u0430. ${variable} - ${variable}.",advancedFilterValidationMessageAtEnd:"\\u0423 \\u0432\\u0438\\u0440\\u0430\\u0437\\u0456 \\u0454 \\u043F\\u043E\\u043C\\u0438\\u043B\\u043A\\u0430. ${variable} \\u0432 \\u043A\\u';
      S = S + '0456\\u043D\\u0446\\u0456 \\u0432\\u0438\\u0440\\u0430\\u0437\\u0443.",advancedFilterBuilderTitle:"\\u0420\\u043E\\u0437\\u0448\\u0438\\u0440\\u0435\\u043D\\u0438\\u0439 \\u0444\\u0456\\u043B\\u044C\\u0442\\u0440",advancedFilterBuilderApply:"\\u0417\\u0430\\u0441\\u0442\\u043E\\u0441\\u0443\\u0432\\u0430\\u0442\\u0438",advancedFilterBuilderCancel:"\\u0421\\u043A\\u0430\\u0441\\u0443\\u0432\\u0430\\u0442\\u0438",advancedFilterBuilderAddButtonTooltip:"\\u0414\\u043E\\u0434\\u0430\\u0442\\u0438 \\u0444\\u0456\\u043B\\u044C\\u0442\\u0440 \\u0430\\u0431\\u043E \\u0433\\u0440\\u0443\\u043F\\u0443",advancedFilterBuilderRemoveButtonTooltip:"\\u0412\\u0438\\u0434\\u0430\\u043B\\u0438\\u0442\\u0438",advancedFilterBuilderMoveUpButtonTooltip:"\\u041F\\u0435\\u0440\\u0435\\u043C\\u0456\\u0441\\u0442\\u0438\\u0442\\u0438 \\u0432\\u0433\\u043E\\u0440\\u0443",advancedFilterBuilderMoveDownButtonTooltip:"\\u041F\\u0435\\u0440\\u0435\\u043C\\u0456\\u0441\\u0442\\u0438\\u0442\\u0438 \\u0432\\u043D\\u0438\\u0437",advancedFilterBuilderAddJoin:"\\u0414\\u043E\\u0434\\u0430\\u0442\\u0438 \\u0433\\u0440\\u0443\\u043F\\u0443",advancedFilterBuilderAddCondition:"\\u0414\\u043E\\u0434\\u0430\\u0442\\u0438 \\u0444\\u0456\\u043B\\u044C\\u0442\\u0440",advancedFilterBuilderSelectColumn:"\\u041E\\u0431\\u0435\\u0440\\u0456\\u0442\\u044C \\u043A\\u043E\\u043B\\u043E\\u043D\\u043A\\u0443",advancedFilterBuilderSelectOption:"\\u041E\\u0431\\u0435\\u0440\\u0456\\u0442\\u044C \\u0432\\u0430\\u0440\\u0456\\u0430\\u043D\\u0442",advancedFilterBuilderEnterValue:"\\u0412\\u0432\\u0435\\u0434\\u0456\\u0442\\u044C \\u0437\\u043D\\u0430\\u0447\\u0435\\u043D\\u043D\\u044F...",advancedFilterBuilderValidationAlreadyApplied:"\\u041F\\u043E\\u0442\\u043E\\u0447\\u043D\\u0438\\u0439 \\u0444\\u0456\\u043B\\u044C\\u0442\\u0440 \\u0432\\u0436\\u0435 \\u0437\\u0430\\u0441\\u0442\\u043E\\u0441\\u043E\\u0432\\u0430\\u043D\\u0438\\u0439.",advancedFilterBuilderValidationIncomplete:"\\u041D\\u0435 \\u0432\\u0441\\u0456 \\u0443\\u043C\\u043E\\u0432\\u0438 \\u0437\\u0430\\u043F\\u043E\\u0432\\u043D\\u0435\\u043D\\u0456.",advancedFilterBuilderValidationSelectColumn:"\\u041F\\u043E\\u0442\\u0440\\u0456\\u0431\\u043D\\u043E \\u043E\\u0431\\u0440\\u0430\\u0442';
      S = S + '\\u0438 \\u043A\\u043E\\u043B\\u043E\\u043D\\u043A\\u0443.",advancedFilterBuilderValidationSelectOption:"\\u041F\\u043E\\u0442\\u0440\\u0456\\u0431\\u043D\\u043E \\u043E\\u0431\\u0440\\u0430\\u0442\\u0438 \\u0432\\u0430\\u0440\\u0456\\u0430\\u043D\\u0442.",advancedFilterBuilderValidationEnterValue:"\\u041F\\u043E\\u0442\\u0440\\u0456\\u0431\\u043D\\u043E \\u0432\\u0432\\u0435\\u0441\\u0442\\u0438 \\u0437\\u043D\\u0430\\u0447\\u0435\\u043D\\u043D\\u044F.",columns:"\\u0421\\u0442\\u043E\\u0432\\u043F\\u0446\\u0456",filters:"\\u0424\\u0456\\u043B\\u044C\\u0442\\u0440\\u0438",pivotMode:"\\u0420\\u0435\\u0436\\u0438\\u043C \\u0437\\u0432\\u0435\\u0434\\u0435\\u043D\\u043D\\u044F",groups:"\\u0413\\u0440\\u0443\\u043F\\u0438 \\u0440\\u044F\\u0434\\u043A\\u0456\\u0432",rowGroupColumnsEmptyMessage:"\\u041F\\u0435\\u0440\\u0435\\u0442\\u044F\\u0433\\u043D\\u0456\\u0442\\u044C \\u0441\\u044E\\u0434\\u0438 \\u0434\\u043B\\u044F \\u0432\\u0441\\u0442\\u0430\\u043D\\u043E\\u0432\\u043B\\u0435\\u043D\\u043D\\u044F \\u0433\\u0440\\u0443\\u043F \\u0440\\u044F\\u0434\\u043A\\u0456\\u0432",values:"\\u0417\\u043D\\u0430\\u0447\\u0435\\u043D\\u043D\\u044F",valueColumnsEmptyMessage:"\\u041F\\u0435\\u0440\\u0435\\u0442\\u044F\\u0433\\u043D\\u0456\\u0442\\u044C \\u0441\\u044E\\u0434\\u0438 \\u0434\\u043B\\u044F \\u0430\\u0433\\u0440\\u0435\\u0433\\u0443\\u0432\\u0430\\u043D\\u043D\\u044F",pivots:"\\u041C\\u0456\\u0442\\u043A\\u0438 \\u0441\\u0442\\u043E\\u0432\\u043F\\u0446\\u044F",pivotColumnsEmptyMessage:"\\u041F\\u0435\\u0440\\u0435\\u0442\\u044F\\u0433\\u043D\\u0456\\u0442\\u044C \\u0441\\u044E\\u0434\\u0438 \\u0434\\u043B\\u044F \\u0432\\u0441\\u0442\\u0430\\u043D\\u043E\\u0432\\u043B\\u0435\\u043D\\u043D\\u044F \\u043C\\u0456\\u0442\\u043E\\u043A \\u0441\\u0442\\u043E\\u0432\\u043F\\u0446\\u044F",group:"\\u0413\\u0440\\u0443\\u043F\\u0430",rowDragRow:"\\u0440\\u044F\\u0434\\u043E\\u043A",rowDragRows:"\\u0440\\u044F\\u0434\\u0438",loadingOoo:"\\u0417\\u0430\\u0432\\u0430\\u043D\\u0442\\u0430\\u0436\\u0435\\u043D\\u043D\\u044F...",loadingError:"\\u041F\\u041E\\u041C\\u0418\\u041B\\u041A\\u0410",noRowsToShow:"\\u041D\\u0435\\u043C\\u0430\\u0454 \\u0440\\u044F\\u0434\\u043A\\u0456\\u0432 \\u0434\\u043B\\u044F \\u0432\\u0456\\u0434\\u043E\\u0431\\u0440\\u04';
      S = S + '30\\u0436\\u0435\\u043D\\u043D\\u044F",enabled:"\\u0423\\u0432\\u0456\\u043C\\u043A\\u043D\\u0435\\u043D\\u043E",pinColumn:"\\u0417\\u0430\\u043A\\u0440\\u0456\\u043F\\u0438\\u0442\\u0438 \\u0421\\u0442\\u043E\\u0432\\u043F\\u0435\\u0446\\u044C",pinLeft:"\\u0417\\u0430\\u043A\\u0440\\u0456\\u043F\\u0438\\u0442\\u0438 \\u041B\\u0456\\u0432\\u043E\\u0440\\u0443\\u0447",pinRight:"\\u0417\\u0430\\u043A\\u0440\\u0456\\u043F\\u0438\\u0442\\u0438 \\u041F\\u0440\\u0430\\u0432\\u043E\\u0440\\u0443\\u0447",noPin:"\\u041D\\u0435 \\u0417\\u0430\\u043A\\u0440\\u0456\\u043F\\u043B\\u044F\\u0442\\u0438",valueAggregation:"\\u0410\\u0433\\u0440\\u0435\\u0433\\u0430\\u0446\\u0456\\u044F \\u0417\\u043D\\u0430\\u0447\\u0435\\u043D\\u044C",noAggregation:"\\u0416\\u043E\\u0434\\u043D\\u0430",autosizeThisColumn:"\\u0410\\u0432\\u0442\\u043E\\u043C\\u0430\\u0442\\u0438\\u0447\\u043D\\u043E \\u0417\\u043C\\u0456\\u043D\\u0438\\u0442\\u0438 \\u0420\\u043E\\u0437\\u043C\\u0456\\u0440 \\u0426\\u044C\\u043E\\u0433\\u043E \\u0421\\u0442\\u043E\\u0432\\u043F\\u0446\\u044F",autosizeAllColumns:"\\u0410\\u0432\\u0442\\u043E\\u043C\\u0430\\u0442\\u0438\\u0447\\u043D\\u043E \\u0417\\u043C\\u0456\\u043D\\u0438\\u0442\\u0438 \\u0420\\u043E\\u0437\\u043C\\u0456\\u0440 \\u0423\\u0441\\u0456\\u0445 \\u0421\\u0442\\u043E\\u0432\\u043F\\u0446\\u0456\\u0432",groupBy:"\\u0413\\u0440\\u0443\\u043F\\u0443\\u0432\\u0430\\u0442\\u0438 \\u0437\\u0430",ungroupBy:"\\u0420\\u043E\\u0437\\u0433\\u0440\\u0443\\u043F\\u0443\\u0432\\u0430\\u0442\\u0438 \\u0437\\u0430",ungroupAll:"\\u0420\\u043E\\u0437\\u0433\\u0440\\u0443\\u043F\\u0443\\u0432\\u0430\\u0442\\u0438 \\u0412\\u0441\\u0435",addToValues:"\\u0414\\u043E\\u0434\\u0430\\u0442\\u0438 ${variable} \\u0434\\u043E \\u0437\\u043D\\u0430\\u0447\\u0435\\u043D\\u044C",removeFromValues:"\\u0412\\u0438\\u0434\\u0430\\u043B\\u0438\\u0442\\u0438 ${variable} \\u0437\\u0456 \\u0437\\u043D\\u0430\\u0447\\u0435\\u043D\\u044C",addToLabels:"\\u0414\\u043E\\u0434\\u0430\\u0442\\u0438 ${variable} \\u0434\\u043E \\u043C\\u0456\\u0442\\u043E\\u043A",removeFromLabels:"\\u0412\\u0438\\u0434\\u0430\\u043B\\u0438\\u0442\\u0438 ${variable} \\u0437 \\u043C\\u0456\\u0442\\u043E\\u043A",resetColumns:"\\u0421\\u043A\\u0438\\u043D\\u0443\\u0442\\u0438 \\u041D\\u0430\\u';
      S = S + '043B\\u0430\\u0448\\u0442\\u0443\\u0432\\u0430\\u043D\\u043D\\u044F \\u0421\\u0442\\u043E\\u0432\\u043F\\u0446\\u0456\\u0432",expandAll:"\\u0420\\u043E\\u0437\\u0433\\u043E\\u0440\\u043D\\u0443\\u0442\\u0438 \\u0412\\u0441\\u0456 \\u0413\\u0440\\u0443\\u043F\\u0438 \\u0420\\u044F\\u0434\\u043A\\u0456\\u0432",collapseAll:"\\u0417\\u0433\\u043E\\u0440\\u043D\\u0443\\u0442\\u0438 \\u0412\\u0441\\u0456 \\u0413\\u0440\\u0443\\u043F\\u0438 \\u0420\\u044F\\u0434\\u043A\\u0456\\u0432",copy:"\\u041A\\u043E\\u043F\\u0456\\u044E\\u0432\\u0430\\u0442\\u0438",ctrlC:"Ctrl+C",ctrlX:"Ctrl+X",copyWithHeaders:"\\u041A\\u043E\\u043F\\u0456\\u044E\\u0432\\u0430\\u0442\\u0438 \\u0437 \\u0417\\u0430\\u0433\\u043E\\u043B\\u043E\\u0432\\u043A\\u0430\\u043C\\u0438",copyWithGroupHeaders:"\\u041A\\u043E\\u043F\\u0456\\u044E\\u0432\\u0430\\u0442\\u0438 \\u0437 \\u0413\\u0440\\u0443\\u043F\\u043E\\u0432\\u0438\\u043C\\u0438 \\u0417\\u0430\\u0433\\u043E\\u043B\\u043E\\u0432\\u043A\\u0430\\u043C\\u0438",cut:"\\u0412\\u0438\\u0440\\u0456\\u0437\\u0430\\u0442\\u0438",paste:"\\u0412\\u0441\\u0442\\u0430\\u0432\\u0438\\u0442\\u0438",ctrlV:"Ctrl+V",export:"\\u0415\\u043A\\u0441\\u043F\\u043E\\u0440\\u0442",csvExport:"\\u0415\\u043A\\u0441\\u043F\\u043E\\u0440\\u0442 CSV",excelExport:"\\u0415\\u043A\\u0441\\u043F\\u043E\\u0440\\u0442 Excel",columnFilter:"\\u0424\\u0456\\u043B\\u044C\\u0442\\u0440 \\u0421\\u0442\\u043E\\u0432\\u043F\\u0446\\u0456\\u0432",columnChooser:"\\u0412\\u0438\\u0431\\u0440\\u0430\\u0442\\u0438 \\u0421\\u0442\\u043E\\u0432\\u043F\\u0446\\u0456",sortAscending:"\\u0421\\u043E\\u0440\\u0442\\u0443\\u0432\\u0430\\u0442\\u0438 \\u0437\\u0430 \\u0417\\u0440\\u043E\\u0441\\u0442\\u0430\\u043D\\u043D\\u044F\\u043C",sortDescending:"\\u0421\\u043E\\u0440\\u0442\\u0443\\u0432\\u0430\\u0442\\u0438 \\u0437\\u0430 \\u0421\\u043F\\u0430\\u0434\\u0430\\u043D\\u043D\\u044F\\u043C",sortUnSort:"\\u041E\\u0447\\u0438\\u0441\\u0442\\u0438\\u0442\\u0438 \\u0421\\u043E\\u0440\\u0442\\u0443\\u0432\\u0430\\u043D\\u043D\\u044F",sum:"\\u0421\\u0443\\u043C\\u0430",first:"\\u041F\\u0435\\u0440\\u0448\\u0438\\u0439",last:"\\u041E\\u0441\\u0442\\u0430\\u043D\\u043D\\u0456\\u0439",min:"\\u041C\\u0456\\u043D",max:"\\u041C\\u0430\\u043A\\u0441",none:"\\u041D\\u0435\\u043C\\u0430\\u045';
      S = S + '4",count:"\\u041A\\u0456\\u043B\\u044C\\u043A\\u0456\\u0441\\u0442\\u044C",avg:"\\u0421\\u0435\\u0440\\u0435\\u0434\\u043D\\u0454",filteredRows:"\\u0412\\u0456\\u0434\\u0444\\u0456\\u043B\\u044C\\u0442\\u0440\\u043E\\u0432\\u0430\\u043D\\u043E",selectedRows:"\\u0412\\u0438\\u0431\\u0440\\u0430\\u043D\\u043E",totalRows:"\\u0423\\u0441\\u044C\\u043E\\u0433\\u043E \\u0440\\u044F\\u0434\\u043A\\u0456\\u0432",totalAndFilteredRows:"\\u0420\\u044F\\u0434\\u043A\\u0438",more:"\\u0411\\u0456\\u043B\\u044C\\u0448\\u0435",to:"\\u0434\\u043E",of:"\\u0437",page:"\\u0421\\u0442\\u043E\\u0440\\u0456\\u043D\\u043A\\u0430",pageLastRowUnknown:"?",nextPage:"\\u041D\\u0430\\u0441\\u0442\\u0443\\u043F\\u043D\\u0430 \\u0441\\u0442\\u043E\\u0440\\u0456\\u043D\\u043A\\u0430",lastPage:"\\u041E\\u0441\\u0442\\u0430\\u043D\\u043D\\u044F \\u0441\\u0442\\u043E\\u0440\\u0456\\u043D\\u043A\\u0430",firstPage:"\\u041F\\u0435\\u0440\\u0448\\u0430 \\u0441\\u0442\\u043E\\u0440\\u0456\\u043D\\u043A\\u0430",previousPage:"\\u041F\\u043E\\u043F\\u0435\\u0440\\u0435\\u0434\\u043D\\u044F \\u0441\\u0442\\u043E\\u0440\\u0456\\u043D\\u043A\\u0430",pageSizeSelectorLabel:"\\u0420\\u043E\\u0437\\u043C\\u0456\\u0440 \\u0441\\u0442\\u043E\\u0440\\u0456\\u043D\\u043A\\u0438:",footerTotal:"\\u0423\\u0441\\u044C\\u043E\\u0433\\u043E",pivotColumnGroupTotals:"\\u0417\\u0430\\u0433\\u0430\\u043B\\u044C\\u043D\\u0430 \\u0441\\u0443\\u043C\\u0430",pivotChartAndPivotMode:"\\u0417\\u0432\\u0435\\u0434\\u0435\\u043D\\u0430 \\u0434\\u0456\\u0430\\u0433\\u0440\\u0430\\u043C\\u0430 \\u0442\\u0430 \\u0440\\u0435\\u0436\\u0438\\u043C \\u0437\\u0432\\u0435\\u0434\\u0435\\u043D\\u043D\\u044F",pivotChart:"\\u0417\\u0432\\u0435\\u0434\\u0435\\u043D\\u0430 \\u0434\\u0456\\u0430\\u0433\\u0440\\u0430\\u043C\\u0430",chartRange:"\\u0414\\u0456\\u0430\\u043F\\u0430\\u0437\\u043E\\u043D \\u0434\\u0456\\u0430\\u0433\\u0440\\u0430\\u043C\\u0438",columnChart:"\\u0421\\u0442\\u043E\\u0432\\u043F\\u0447\\u0430\\u0441\\u0442\\u0430 \\u0434\\u0456\\u0430\\u0433\\u0440\\u0430\\u043C\\u0430",groupedColumn:"\\u0413\\u0440\\u0443\\u043F\\u043E\\u0432\\u0430\\u043D\\u0438\\u0439",stackedColumn:"\\u0428\\u0430\\u0440\\u0443\\u0432\\u0430\\u0442\\u0438\\u0439",normalizedColumn:"\\u0428\\u0430\\u0440\\u0443\\u0432\\u04';
      S = S + '30\\u0442\\u0438\\u0439 \\u043D\\u0430 100%",barChart:"\\u0413\\u0456\\u0441\\u0442\\u043E\\u0433\\u0440\\u0430\\u043C\\u0430",groupedBar:"\\u0413\\u0440\\u0443\\u043F\\u043E\\u0432\\u0430\\u043D\\u0438\\u0439",stackedBar:"\\u0428\\u0430\\u0440\\u0443\\u0432\\u0430\\u0442\\u0438\\u0439",normalizedBar:"\\u0428\\u0430\\u0440\\u0443\\u0432\\u0430\\u0442\\u0438\\u0439 \\u043D\\u0430 100%",pieChart:"\\u041A\\u0440\\u0443\\u0433\\u043E\\u0432\\u0430 \\u0434\\u0456\\u0430\\u0433\\u0440\\u0430\\u043C\\u0430",pie:"\\u041A\\u0440\\u0443\\u0433\\u043E\\u0432\\u0430 \\u0434\\u0456\\u0430\\u0433\\u0440\\u0430\\u043C\\u0430",donut:"\\u041A\\u0456\\u043B\\u044C\\u0446\\u0435\\u0432\\u0430 \\u0434\\u0456\\u0430\\u0433\\u0440\\u0430\\u043C\\u0430",line:"\\u041B\\u0456\\u043D\\u0456\\u044F",xyChart:"X Y (\\u0420\\u043E\\u0437\\u0441\\u0456\\u044F\\u043D\\u0430)",scatter:"\\u0420\\u043E\\u0437\\u0441\\u0456\\u044F\\u043D\\u0430",bubble:"\\u0411\\u0443\\u043B\\u044C\\u0431\\u0430\\u0448\\u043A\\u043E\\u0432\\u0430",areaChart:"\\u041F\\u043B\\u043E\\u0449\\u0430",area:"\\u041F\\u043B\\u043E\\u0449\\u0430",stackedArea:"\\u0428\\u0430\\u0440\\u0443\\u0432\\u0430\\u0442\\u0438\\u0439",normalizedArea:"\\u0428\\u0430\\u0440\\u0443\\u0432\\u0430\\u0442\\u0438\\u0439 \\u043D\\u0430 100%",histogramChart:"\\u0413\\u0456\\u0441\\u0442\\u043E\\u0433\\u0440\\u0430\\u043C\\u0430",polarChart:"\\u041F\\u043E\\u043B\\u044F\\u0440\\u043D\\u0430 \\u0434\\u0456\\u0430\\u0433\\u0440\\u0430\\u043C\\u0430",radarLine:"\\u0420\\u0430\\u0434\\u0430\\u0440\\u043D\\u0430 \\u043B\\u0456\\u043D\\u0456\\u044F",radarArea:"\\u0420\\u0430\\u0434\\u0430\\u0440\\u043D\\u0430 \\u043F\\u043B\\u043E\\u0449\\u0430",nightingale:"\\u0414\\u0456\\u0430\\u0433\\u0440\\u0430\\u043C\\u0430 \\u041D\\u0430\\u0439\\u0442\\u0456\\u043D\\u0433\\u0435\\u0439\\u043B\\u0430",radialColumn:"\\u0420\\u0430\\u0434\\u0456\\u0430\\u043B\\u044C\\u043D\\u0438\\u0439 \\u0441\\u0442\\u043E\\u0432\\u043F\\u0447\\u0438\\u043A",radialBar:"\\u0420\\u0430\\u0434\\u0456\\u0430\\u043B\\u044C\\u043D\\u0430 \\u0433\\u0456\\u0441\\u0442\\u043E\\u0433\\u0440\\u0430\\u043C\\u0430",statisticalChart:"\\u0421\\u0442\\u0430\\u0442\\u0438\\u0441\\u0442\\u0438\\u0447\\u043D\\u0430 \\u0434\\u0456\\u0430\\u0433\\u0440\\u0430\\u043C\\u0430"';
      S = S + ',boxPlot:"\\u0421\\u0445\\u0435\\u043C\\u0430 \\u043A\\u043E\\u0440\\u043E\\u0431\\u0447\\u0430\\u0442\\u043E\\u0433\\u043E \\u0432\\u0438\\u0433\\u043B\\u044F\\u0434\\u0443",rangeBar:"\\u0414\\u0456\\u0430\\u0433\\u0440\\u0430\\u043C\\u0430 \\u0456\\u043D\\u0442\\u0435\\u0440\\u0432\\u0430\\u043B\\u0456\\u0432",rangeArea:"\\u041E\\u0431\\u043B\\u0430\\u0441\\u0442\\u044C \\u0456\\u043D\\u0442\\u0435\\u0440\\u0432\\u0430\\u043B\\u0456\\u0432",hierarchicalChart:"\\u0406\\u0454\\u0440\\u0430\\u0440\\u0445\\u0456\\u0447\\u043D\\u0430 \\u0434\\u0456\\u0430\\u0433\\u0440\\u0430\\u043C\\u0430",treemap:"\\u0414\\u0435\\u0440\\u0435\\u0432\\u043E\\u043F\\u043E\\u0434\\u0456\\u0431\\u043D\\u0430 \\u0434\\u0456\\u0430\\u0433\\u0440\\u0430\\u043C\\u0430",sunburst:"\\u0421\\u043E\\u043D\\u044F\\u0447\\u043D\\u0438\\u0439 \\u0433\\u0440\\u0430\\u0444\\u0456\\u043A",specializedChart:"\\u0421\\u043F\\u0435\\u0446\\u0456\\u0430\\u043B\\u0456\\u0437\\u043E\\u0432\\u0430\\u043D\\u0430 \\u0434\\u0456\\u0430\\u0433\\u0440\\u0430\\u043C\\u0430",waterfall:"\\u0412\\u043E\\u0434\\u043E\\u0441\\u043F\\u0430\\u0434\\u043D\\u0430 \\u0434\\u0456\\u0430\\u0433\\u0440\\u0430\\u043C\\u0430",heatmap:"\\u0422\\u0435\\u043F\\u043B\\u043E\\u0432\\u0430 \\u043A\\u0430\\u0440\\u0442\\u0430",combinationChart:"\\u041A\\u043E\\u043C\\u0431\\u0456\\u043D\\u043E\\u0432\\u0430\\u043D\\u0430 \\u0434\\u0456\\u0430\\u0433\\u0440\\u0430\\u043C\\u0430",columnLineCombo:"\\u0421\\u0442\\u043E\\u0432\\u043F\\u0447\\u0438\\u043A \\u0442\\u0430 \\u043B\\u0456\\u043D\\u0456\\u044F",AreaColumnCombo:"\\u041F\\u043B\\u043E\\u0449\\u0430 \\u0442\\u0430 \\u0441\\u0442\\u043E\\u0432\\u043F\\u0447\\u0438\\u043A",pivotChartTitle:"\\u0417\\u0432\\u0435\\u0434\\u0435\\u043D\\u0430 \\u0434\\u0456\\u0430\\u0433\\u0440\\u0430\\u043C\\u0430",rangeChartTitle:"\\u0414\\u0456\\u0430\\u043F\\u0430\\u0437\\u043E\\u043D \\u0434\\u0456\\u0430\\u0433\\u0440\\u0430\\u043C",settings:"\\u0413\\u0440\\u0430\\u0444\\u0456\\u043A",data:"\\u041D\\u0430\\u043B\\u0430\\u0448\\u0442\\u0443\\u0432\\u0430\\u043D\\u043D\\u044F",format:"\\u041D\\u0430\\u043B\\u0430\\u0448\\u0442\\u0443\\u0432\\u0430\\u0442\\u0438",categories:"\\u041A\\u0430\\u0442\\u0435\\u0433\\u043E\\u0440\\u0456\\u0457",defaultCategory:"(\\u041D\\u0435\\u043C\\u';
      S = S + '0430\\u0454)",series:"\\u0420\\u044F\\u0434\\u0438",switchCategorySeries:"\\u041F\\u0435\\u0440\\u0435\\u043C\\u043A\\u043D\\u0443\\u0442\\u0438 \\u043A\\u0430\\u0442\\u0435\\u0433\\u043E\\u0440\\u0456\\u044E / \\u0441\\u0435\\u0440\\u0456\\u044E",categoryValues:"\\u0417\\u043D\\u0430\\u0447\\u0435\\u043D\\u043D\\u044F \\u043A\\u0430\\u0442\\u0435\\u0433\\u043E\\u0440\\u0456\\u0457",seriesLabels:"\\u041F\\u043E\\u0437\\u043D\\u0430\\u0447\\u043A\\u0438 \\u0441\\u0435\\u0440\\u0456\\u0439",aggregate:"\\u0410\\u0433\\u0440\\u0435\\u0433\\u0430\\u0442",xyValues:"\\u0417\\u043D\\u0430\\u0447\\u0435\\u043D\\u043D\\u044F X Y",paired:"\\u041F\\u0430\\u0440\\u043D\\u0438\\u0439 \\u0440\\u0435\\u0436\\u0438\\u043C",axis:"\\u0412\\u0456\\u0441\\u044C",xAxis:"\\u0413\\u043E\\u0440\\u0438\\u0437\\u043E\\u043D\\u0442\\u0430\\u043B\\u044C\\u043D\\u0430 \\u0432\\u0456\\u0441\\u044C",yAxis:"\\u0412\\u0435\\u0440\\u0442\\u0438\\u043A\\u0430\\u043B\\u044C\\u043D\\u0430 \\u0432\\u0456\\u0441\\u044C",polarAxis:"\\u041F\\u043E\\u043B\\u044F\\u0440\\u043D\\u0430 \\u0432\\u0456\\u0441\\u044C",radiusAxis:"\\u0412\\u0456\\u0441\\u044C \\u0440\\u0430\\u0434\\u0456\\u0443\\u0441\\u0430",navigator:"\\u041D\\u0430\\u0432\\u0456\\u0433\\u0430\\u0442\\u043E\\u0440",zoom:"\\u0417\\u0431\\u0456\\u043B\\u044C\\u0448\\u0438\\u0442\\u0438",animation:"\\u0410\\u043D\\u0456\\u043C\\u0430\\u0446\\u0456\\u044F",crosshair:"\\u041F\\u0435\\u0440\\u0435\\u0445\\u0440\\u0435\\u0441\\u0442\\u044F",color:"\\u041A\\u043E\\u043B\\u0456\\u0440",thickness:"\\u0422\\u043E\\u0432\\u0449\\u0438\\u043D\\u0430",preferredLength:"\\u0411\\u0430\\u0436\\u0430\\u043D\\u0430 \\u0434\\u043E\\u0432\\u0436\\u0438\\u043D\\u0430",xType:"\\u0422\\u0438\\u043F X",axisType:"\\u0422\\u0438\\u043F \\u043E\\u0441\\u0456",automatic:"\\u0410\\u0432\\u0442\\u043E\\u043C\\u0430\\u0442\\u0438\\u0447\\u043D\\u043E",category:"\\u041A\\u0430\\u0442\\u0435\\u0433\\u043E\\u0440\\u0456\\u044F",number:"\\u0427\\u0438\\u0441\\u043B\\u043E",time:"\\u0427\\u0430\\u0441",timeFormat:"\\u0424\\u043E\\u0440\\u043C\\u0430\\u0442 \\u0447\\u0430\\u0441\\u0443",autoRotate:"\\u0410\\u0432\\u0442\\u043E\\u043C\\u0430\\u0442\\u0438\\u0447\\u043D\\u0435 \\u043E\\u0431\\u0435\\u0440\\u0442\\u0430\\u043D\\u043D\\u044F",labelRotat';
      S = S + 'ion:"\\u041E\\u0431\\u0435\\u0440\\u0442\\u0430\\u043D\\u043D\\u044F \\u044F\\u0440\\u043B\\u0438\\u043A\\u0430",circle:"\\u041A\\u043E\\u043B\\u043E",polygon:"\\u0411\\u0430\\u0433\\u0430\\u0442\\u043E\\u043A\\u0443\\u0442\\u043D\\u0438\\u043A",square:"\\u041A\\u0432\\u0430\\u0434\\u0440\\u0430\\u0442",cross:"\\u0425\\u0440\\u0435\\u0441\\u0442",diamond:"\\u0420\\u043E\\u043C\\u0431",plus:"\\u041F\\u043B\\u044E\\u0441",triangle:"\\u0422\\u0440\\u0438\\u043A\\u0443\\u0442\\u043D\\u0438\\u043A",heart:"\\u0421\\u0435\\u0440\\u0446\\u0435",orientation:"\\u041E\\u0440\\u0456\\u0454\\u043D\\u0442\\u0430\\u0446\\u0456\\u044F",fixed:"\\u0424\\u0456\\u043A\\u0441\\u043E\\u0432\\u0430\\u043D\\u0438\\u0439",parallel:"\\u041F\\u0430\\u0440\\u0430\\u043B\\u0435\\u043B\\u044C\\u043D\\u043E",perpendicular:"\\u041F\\u0435\\u0440\\u043F\\u0435\\u043D\\u0434\\u0438\\u043A\\u0443\\u043B\\u044F\\u0440",radiusAxisPosition:"\\u041F\\u043E\\u0437\\u0438\\u0446\\u0456\\u044F",ticks:"\\u041C\\u0456\\u0442\\u043A\\u0438",gridLines:"\\u041B\\u0456\\u043D\\u0456\\u0457 \\u0441\\u0456\\u0442\\u043A\\u0438",width:"\\u0428\\u0438\\u0440\\u0438\\u043D\\u0430",height:"\\u0412\\u0438\\u0441\\u043E\\u0442\\u0430",length:"\\u0414\\u043E\\u0432\\u0436\\u0438\\u043D\\u0430",padding:"\\u0412\\u0456\\u0434\\u0441\\u0442\\u0443\\u043F",spacing:"\\u0412\\u0456\\u0434\\u0441\\u0442\\u0430\\u0432\\u0430\\u043D\\u043D\\u044F",chartStyle:"\\u0421\\u0442\\u0438\\u043B\\u044C \\u0434\\u0456\\u0430\\u0433\\u0440\\u0430\\u043C\\u0438",title:"\\u0417\\u0430\\u0433\\u043E\\u043B\\u043E\\u0432\\u043E\\u043A",chartTitles:"\\u0417\\u0430\\u0433\\u043E\\u043B\\u043E\\u0432\\u043A\\u0438",chartTitle:"\\u041D\\u0430\\u0437\\u0432\\u0430 \\u0434\\u0456\\u0430\\u0433\\u0440\\u0430\\u043C\\u0438",chartSubtitle:"\\u041F\\u0456\\u0434\\u0437\\u0430\\u0433\\u043E\\u043B\\u043E\\u0432\\u043E\\u043A",horizontalAxisTitle:"\\u041D\\u0430\\u0437\\u0432\\u0430 \\u0433\\u043E\\u0440\\u0438\\u0437\\u043E\\u043D\\u0442\\u0430\\u043B\\u044C\\u043D\\u043E\\u0457 \\u043E\\u0441\\u0456",verticalAxisTitle:"\\u041D\\u0430\\u0437\\u0432\\u0430 \\u0432\\u0435\\u0440\\u0442\\u0438\\u043A\\u0430\\u043B\\u044C\\u043D\\u043E\\u0457 \\u043E\\u0441\\u0456",polarAxisTitle:"\\u041D\\u0430\\u0437\\u0432\\u0430 \\u043F\\';
      S = S + 'u043E\\u043B\\u044F\\u0440\\u043D\\u043E\\u0457 \\u043E\\u0441\\u0456",titlePlaceholder:"\\u041D\\u0430\\u0437\\u0432\\u0430 \\u0434\\u0456\\u0430\\u0433\\u0440\\u0430\\u043C\\u0438",background:"\\u0424\\u043E\\u043D",font:"\\u0428\\u0440\\u0438\\u0444\\u0442",weight:"\\u0412\\u0430\\u0433\\u0430",top:"\\u0412\\u0435\\u0440\\u0445",right:"\\u041F\\u0440\\u0430\\u0432\\u043E\\u0440\\u0443\\u0447",bottom:"\\u041D\\u0438\\u0437",left:"\\u041B\\u0456\\u0432\\u043E\\u0440\\u0443\\u0447",labels:"\\u042F\\u0440\\u043B\\u0438\\u043A\\u0438",calloutLabels:"\\u042F\\u0440\\u043B\\u0438\\u043A\\u0438 \\u0432\\u0438\\u043D\\u043E\\u0441\\u043A\\u0438",sectorLabels:"\\u042F\\u0440\\u043B\\u0438\\u043A\\u0438 \\u0441\\u0435\\u043A\\u0442\\u043E\\u0440\\u0443",positionRatio:"\\u0421\\u043F\\u0456\\u0432\\u0432\\u0456\\u0434\\u043D\\u043E\\u0448\\u0435\\u043D\\u043D\\u044F \\u043F\\u043E\\u0437\\u0438\\u0446\\u0456\\u0457",size:"\\u0420\\u043E\\u0437\\u043C\\u0456\\u0440",shape:"\\u0424\\u043E\\u0440\\u043C\\u0430",minSize:"\\u041C\\u0456\\u043D\\u0456\\u043C\\u0430\\u043B\\u044C\\u043D\\u0438\\u0439 \\u0440\\u043E\\u0437\\u043C\\u0456\\u0440",maxSize:"\\u041C\\u0430\\u043A\\u0441\\u0438\\u043C\\u0430\\u043B\\u044C\\u043D\\u0438\\u0439 \\u0440\\u043E\\u0437\\u043C\\u0456\\u0440",legend:"\\u041B\\u0435\\u0433\\u0435\\u043D\\u0434\\u0430",position:"\\u041F\\u043E\\u0437\\u0438\\u0446\\u0456\\u044F",markerSize:"\\u0420\\u043E\\u0437\\u043C\\u0456\\u0440 \\u043C\\u0430\\u0440\\u043A\\u0435\\u0440\\u0430",markerStroke:"\\u041E\\u0431\\u0432\\u0435\\u0434\\u0435\\u043D\\u043D\\u044F \\u043C\\u0430\\u0440\\u043A\\u0435\\u0440\\u0430",markerPadding:"\\u0412\\u0456\\u0434\\u0441\\u0442\\u0443\\u043F \\u043C\\u0430\\u0440\\u043A\\u0435\\u0440\\u0430",itemSpacing:"\\u0412\\u0456\\u0434\\u0441\\u0442\\u0430\\u0432\\u0430\\u043D\\u043D\\u044F \\u0435\\u043B\\u0435\\u043C\\u0435\\u043D\\u0442\\u0430",itemPaddingX:"\\u0412\\u0456\\u0434\\u0441\\u0442\\u0443\\u043F \\u0435\\u043B\\u0435\\u043C\\u0435\\u043D\\u0442\\u0430 X",itemPaddingY:"\\u0412\\u0456\\u0434\\u0441\\u0442\\u0443\\u043F \\u0435\\u043B\\u0435\\u043C\\u0435\\u043D\\u0442\\u0430 Y",layoutHorizontalSpacing:"\\u0413\\u043E\\u0440\\u0438\\u0437\\u043E\\u043D\\u0442\\u0430\\u043B\\u044C\\u043D\\u0435 \\u043';
      S = S + '2\\u0456\\u0434\\u0441\\u0442\\u0430\\u0432\\u0430\\u043D\\u043D\\u044F",layoutVerticalSpacing:"\\u0412\\u0435\\u0440\\u0442\\u0438\\u043A\\u0430\\u043B\\u044C\\u043D\\u0435 \\u0432\\u0456\\u0434\\u0441\\u0442\\u0430\\u0432\\u0430\\u043D\\u043D\\u044F",strokeWidth:"\\u0422\\u043E\\u0432\\u0449\\u0438\\u043D\\u0430 \\u043B\\u0456\\u043D\\u0456\\u0457",offset:"\\u0417\\u0441\\u0443\\u0432",offsets:"\\u0417\\u0441\\u0443\\u0432\\u0438",tooltips:"\\u041F\\u0456\\u0434\\u043A\\u0430\\u0437\\u043A\\u0438",callout:"\\u0412\\u0438\\u043D\\u043E\\u0441\\u043A\\u0430",markers:"\\u041C\\u0430\\u0440\\u043A\\u0435\\u0440\\u0438",shadow:"\\u0422\\u0456\\u043D\\u044C",blur:"\\u0420\\u043E\\u0437\\u043C\\u0438\\u0442\\u0442\\u044F",xOffset:"\\u0417\\u0441\\u0443\\u0432 X",yOffset:"\\u0417\\u0441\\u0443\\u0432 Y",lineWidth:"\\u0422\\u043E\\u0432\\u0449\\u0438\\u043D\\u0430 \\u043B\\u0456\\u043D\\u0456\\u0457",lineDash:"\\u0428\\u0442\\u0440\\u0438\\u0445\\u0443\\u0432\\u0430\\u043D\\u043D\\u044F \\u043B\\u0456\\u043D\\u0456\\u0457",lineDashOffset:"\\u0417\\u0441\\u0443\\u0432 \\u0448\\u0442\\u0440\\u0438\\u0445\\u0443\\u0432\\u0430\\u043D\\u043D\\u044F",scrollingZoom:"\\u041F\\u0440\\u043E\\u043A\\u0440\\u0443\\u0442\\u043A\\u0430",scrollingStep:"\\u041A\\u0440\\u043E\\u043A \\u043F\\u0440\\u043E\\u043A\\u0440\\u0443\\u0442\\u043A\\u0438",selectingZoom:"\\u0412\\u0438\\u0431\\u0456\\u0440",durationMillis:"\\u0422\\u0440\\u0438\\u0432\\u0430\\u043B\\u0456\\u0441\\u0442\\u044C (\\u043C\\u0441)",crosshairLabel:"\\u042F\\u0440\\u043B\\u0438\\u043A",crosshairSnap:"\\u041F\\u0440\\u0438\\u0432\'\\u044F\\u0437\\u043A\\u0430 \\u0434\\u043E \\u0432\\u0443\\u0437\\u043B\\u0430",normal:"\\u0417\\u0432\\u0438\\u0447\\u0430\\u0439\\u043D\\u0438\\u0439",bold:"\\u041D\\u0430\\u043F\\u0456\\u0432\\u0436\\u0438\\u0440\\u043D\\u0438\\u0439",italic:"\\u041A\\u0443\\u0440\\u0441\\u0438\\u0432",boldItalic:"\\u041D\\u0430\\u043F\\u0456\\u0432\\u0436\\u0438\\u0440\\u043D\\u0438\\u0439 \\u043A\\u0443\\u0440\\u0441\\u0438\\u0432",predefined:"\\u0412\\u0438\\u0437\\u043D\\u0430\\u0447\\u0435\\u043D\\u043E \\u043D\\u0430\\u043F\\u0435\\u0440\\u0435\\u0434",fillOpacity:"\\u041D\\u0435\\u043F\\u0440\\u043E\\u0437\\u043E\\u0440\\u0456\\u0441\\u0442\\u044C \\u0437\\u0430\\u043B\\';
      S = S + 'u0438\\u0432\\u043A\\u0438",strokeColor:"\\u041A\\u043E\\u043B\\u0456\\u0440 \\u043B\\u0456\\u043D\\u0456\\u0457",strokeOpacity:"\\u041D\\u0435\\u043F\\u0440\\u043E\\u0437\\u043E\\u0440\\u0456\\u0441\\u0442\\u044C \\u043B\\u0456\\u043D\\u0456\\u0457",miniChart:"\\u041C\\u0456\\u043D\\u0456-\\u0434\\u0456\\u0430\\u0433\\u0440\\u0430\\u043C\\u0430",histogramBinCount:"\\u041A\\u0456\\u043B\\u044C\\u043A\\u0456\\u0441\\u0442\\u044C \\u0431\\u0456\\u043D\\u0456\\u0432",connectorLine:"\\u0417\'\\u0454\\u0434\\u043D\\u0443\\u0432\\u0430\\u043B\\u044C\\u043D\\u0430 \\u043B\\u0456\\u043D\\u0456\\u044F",seriesItems:"\\u0415\\u043B\\u0435\\u043C\\u0435\\u043D\\u0442\\u0438 \\u0441\\u0435\\u0440\\u0456\\u0439",seriesItemType:"\\u0422\\u0438\\u043F \\u0435\\u043B\\u0435\\u043C\\u0435\\u043D\\u0442\\u0430",seriesItemPositive:"\\u041F\\u043E\\u0437\\u0438\\u0442\\u0438\\u0432\\u043D\\u0438\\u0439",seriesItemNegative:"\\u041D\\u0435\\u0433\\u0430\\u0442\\u0438\\u0432\\u043D\\u0438\\u0439",seriesItemLabels:"\\u042F\\u0440\\u043B\\u0438\\u043A\\u0438 \\u0435\\u043B\\u0435\\u043C\\u0435\\u043D\\u0442\\u0456\\u0432",columnGroup:"\\u0421\\u0442\\u043E\\u0432\\u043F\\u0435\\u0446\\u044C",barGroup:"\\u0421\\u043C\\u0443\\u0433\\u0430",pieGroup:"\\u041A\\u0440\\u0443\\u0433\\u043E\\u0432\\u0430",lineGroup:"\\u041B\\u0456\\u043D\\u0456\\u044F",scatterGroup:"X Y (\\u0420\\u043E\\u0437\\u043A\\u0438\\u0434\\u0430\\u043D\\u043D\\u044F)",areaGroup:"\\u041E\\u0431\\u043B\\u0430\\u0441\\u0442\\u044C",polarGroup:"\\u041F\\u043E\\u043B\\u044F\\u0440\\u043D\\u0430",statisticalGroup:"\\u0421\\u0442\\u0430\\u0442\\u0438\\u0441\\u0442\\u0438\\u0447\\u043D\\u0430",hierarchicalGroup:"\\u0406\\u0454\\u0440\\u0430\\u0440\\u0445\\u0456\\u0447\\u043D\\u0430",specializedGroup:"\\u0421\\u043F\\u0435\\u0446\\u0456\\u0430\\u043B\\u0456\\u0437\\u043E\\u0432\\u0430\\u043D\\u0430",combinationGroup:"\\u041A\\u043E\\u043C\\u0431\\u0456\\u043D\\u0430\\u0446\\u0456\\u044F",groupedColumnTooltip:"\\u0413\\u0440\\u0443\\u043F\\u043E\\u0432\\u0430\\u043D\\u0430",stackedColumnTooltip:"\\u0428\\u0442\\u0430\\u0431\\u0435\\u043B\\u044C\\u043E\\u0432\\u0430\\u043D\\u0430",normalizedColumnTooltip:"100% \\u0448\\u0442\\u0430\\u0431\\u0435\\u043B\\u044C\\u043E\\u0432\\u0430\\u043D\\u';
      S = S + '0430",groupedBarTooltip:"\\u0413\\u0440\\u0443\\u043F\\u043E\\u0432\\u0430\\u043D\\u0430",stackedBarTooltip:"\\u0428\\u0442\\u0430\\u0431\\u0435\\u043B\\u044C\\u043E\\u0432\\u0430\\u043D\\u0430",normalizedBarTooltip:"100% \\u0448\\u0442\\u0430\\u0431\\u0435\\u043B\\u044C\\u043E\\u0432\\u0430\\u043D\\u0430",pieTooltip:"\\u041A\\u0440\\u0443\\u0433\\u043E\\u0432\\u0430",donutTooltip:"\\u041A\\u0456\\u043B\\u044C\\u0446\\u0435\\u0432\\u0430",lineTooltip:"\\u041B\\u0456\\u043D\\u0456\\u044F",groupedAreaTooltip:"\\u041E\\u0431\\u043B\\u0430\\u0441\\u0442\\u044C",stackedAreaTooltip:"\\u0428\\u0442\\u0430\\u0431\\u0435\\u043B\\u044C\\u043E\\u0432\\u0430\\u043D\\u0430",normalizedAreaTooltip:"100% \\u0448\\u0442\\u0430\\u0431\\u0435\\u043B\\u044C\\u043E\\u0432\\u0430\\u043D\\u0430",scatterTooltip:"\\u0420\\u043E\\u0437\\u043A\\u0438\\u0434\\u0430\\u043D\\u043D\\u044F",bubbleTooltip:"\\u0411\\u0443\\u043B\\u044C\\u0431\\u0430\\u0448\\u043A\\u0430",histogramTooltip:"\\u0413\\u0456\\u0441\\u0442\\u043E\\u0433\\u0440\\u0430\\u043C\\u0430",radialColumnTooltip:"\\u0420\\u0430\\u0434\\u0456\\u0430\\u043B\\u044C\\u043D\\u0438\\u0439 \\u0441\\u0442\\u043E\\u0432\\u043F\\u0435\\u0446\\u044C",radialBarTooltip:"\\u0420\\u0430\\u0434\\u0456\\u0430\\u043B\\u044C\\u043D\\u0430 \\u0441\\u043C\\u0443\\u0433\\u0430",radarLineTooltip:"\\u0420\\u0430\\u0434\\u0430\\u0440\\u043D\\u0430 \\u043B\\u0456\\u043D\\u0456\\u044F",radarAreaTooltip:"\\u0420\\u0430\\u0434\\u0430\\u0440\\u043D\\u0430 \\u043E\\u0431\\u043B\\u0430\\u0441\\u0442\\u044C",nightingaleTooltip:"\\u0414\\u0456\\u0430\\u0433\\u0440\\u0430\\u043C\\u0430 \\u041D\\u0430\\u0439\\u0442\\u0456\\u043D\\u0433\\u0435\\u0439\\u043B\\u0456\\u0432",rangeBarTooltip:"\\u0414\\u0456\\u0430\\u043F\\u0430\\u0437\\u043E\\u043D\\u043D\\u0430 \\u0441\\u043C\\u0443\\u0433\\u0430",rangeAreaTooltip:"\\u0414\\u0456\\u0430\\u043F\\u0430\\u0437\\u043E\\u043D\\u043D\\u0430 \\u043E\\u0431\\u043B\\u0430\\u0441\\u0442\\u044C",boxPlotTooltip:"\\u042F\\u0449\\u0438\\u043A\\u043E\\u0432\\u0438\\u0439 \\u0433\\u0440\\u0430\\u0444\\u0456\\u043A",treemapTooltip:"\\u0422\\u0440\\u0456\\u043C\\u0435\\u043F",sunburstTooltip:"\\u0421\\u043E\\u043D\\u044F\\u0447\\u043D\\u0438\\u0439 \\u0441\\u043F\\u043B\\u0435\\u0441\\u043A"';
      S = S + ',waterfallTooltip:"\\u0412\\u043E\\u0434\\u043E\\u0441\\u043F\\u0430\\u0434",heatmapTooltip:"\\u0422\\u0435\\u043F\\u043B\\u043E\\u0432\\u0430 \\u043A\\u0430\\u0440\\u0442\\u0430",columnLineComboTooltip:"\\u0421\\u0442\\u043E\\u0432\\u043F\\u0435\\u0446\\u044C \\u0456 \\u043B\\u0456\\u043D\\u0456\\u044F",areaColumnComboTooltip:"\\u041E\\u0431\\u043B\\u0430\\u0441\\u0442\\u044C \\u0456 \\u0441\\u0442\\u043E\\u0432\\u043F\\u0435\\u0446\\u044C",customComboTooltip:"\\u0421\\u043F\\u0435\\u0446\\u0456\\u0430\\u043B\\u044C\\u043D\\u0430 \\u043A\\u043E\\u043C\\u0431\\u0456\\u043D\\u0430\\u0446\\u0456\\u044F",innerRadius:"\\u0412\\u043D\\u0443\\u0442\\u0440\\u0456\\u0448\\u043D\\u0456\\u0439 \\u0440\\u0430\\u0434\\u0456\\u0443\\u0441",startAngle:"\\u041A\\u0443\\u0442 \\u043F\\u043E\\u0447\\u0430\\u0442\\u043A\\u0443",endAngle:"\\u041A\\u0443\\u0442 \\u0437\\u0430\\u043A\\u0456\\u043D\\u0447\\u0435\\u043D\\u043D\\u044F",reverseDirection:"\\u0417\\u0432\\u043E\\u0440\\u043E\\u0442\\u043D\\u0438\\u0439 \\u043D\\u0430\\u043F\\u0440\\u044F\\u043C\\u043E\\u043A",groupPadding:"\\u0412\\u0456\\u0434\\u0441\\u0442\\u0443\\u043F \\u0433\\u0440\\u0443\\u043F\\u0438",seriesPadding:"\\u0412\\u0456\\u0434\\u0441\\u0442\\u0443\\u043F \\u0441\\u0435\\u0440\\u0456\\u0439",tile:"\\u041F\\u043B\\u0438\\u0442\\u043A\\u0430",whisker:"\\u0412\\u0443\\u0441\\u0438\\u043A\\u0438",cap:"\\u041A\\u043E\\u0432\\u043F\\u0430\\u0447\\u043E\\u043A",capLengthRatio:"\\u0421\\u043F\\u0456\\u0432\\u0432\\u0456\\u0434\\u043D\\u043E\\u0448\\u0435\\u043D\\u043D\\u044F \\u0434\\u043E\\u0432\\u0436\\u0438\\u043D\\u0438 \\u043A\\u043E\\u0432\\u043F\\u0430\\u0447\\u043A\\u0430",labelPlacement:"\\u0420\\u043E\\u0437\\u0442\\u0430\\u0448\\u0443\\u0432\\u0430\\u043D\\u043D\\u044F \\u044F\\u0440\\u043B\\u0438\\u043A\\u0430",inside:"\\u0412\\u0441\\u0435\\u0440\\u0435\\u0434\\u0438\\u043D\\u0456",outside:"\\u0417\\u0437\\u043E\\u0432\\u043D\\u0456",noDataToChart:"\\u041D\\u0435\\u043C\\u0430\\u0454 \\u0434\\u0430\\u043D\\u0438\\u0445 \\u0434\\u043B\\u044F \\u043F\\u043E\\u0431\\u0443\\u0434\\u043E\\u0432\\u0438 \\u0433\\u0440\\u0430\\u0444\\u0456\\u043A\\u0430.",pivotChartRequiresPivotMode:"\\u0417\\u0432\\u0435\\u0434\\u0435\\u043D\\u0430 \\u0434\\u0456\\u0430\\u0433\\u0440\\u0430\\u043';
      S = S + 'C\\u0430 \\u0432\\u0438\\u043C\\u0430\\u0433\\u0430\\u0454 \\u0443\\u0432\\u0456\\u043C\\u043A\\u043D\\u0435\\u043D\\u043D\\u044F \\u0440\\u0435\\u0436\\u0438\\u043C\\u0443 \\u0437\\u0432\\u0435\\u0434\\u0435\\u043D\\u043D\\u044F.",chartSettingsToolbarTooltip:"\\u041C\\u0435\\u043D\\u044E",chartLinkToolbarTooltip:"\\u041F\\u043E\\u0432\'\\u044F\\u0437\\u0430\\u043D\\u043E \\u0437 \\u0441\\u0456\\u0442\\u043A\\u043E\\u044E",chartUnlinkToolbarTooltip:"\\u0412\\u0456\\u0434\\u043A\\u043B\\u044E\\u0447\\u0435\\u043D\\u043E \\u0432\\u0456\\u0434 \\u0441\\u0456\\u0442\\u043A\\u0438",chartDownloadToolbarTooltip:"\\u0417\\u0430\\u0432\\u0430\\u043D\\u0442\\u0430\\u0436\\u0438\\u0442\\u0438 \\u0434\\u0456\\u0430\\u0433\\u0440\\u0430\\u043C\\u0443",chartMenuToolbarTooltip:"\\u041C\\u0435\\u043D\\u044E",chartEdit:"\\u0420\\u0435\\u0434\\u0430\\u0433\\u0443\\u0432\\u0430\\u0442\\u0438 \\u0434\\u0456\\u0430\\u0433\\u0440\\u0430\\u043C\\u0443",chartAdvancedSettings:"\\u0420\\u043E\\u0437\\u0448\\u0438\\u0440\\u0435\\u043D\\u0456 \\u043D\\u0430\\u043B\\u0430\\u0448\\u0442\\u0443\\u0432\\u0430\\u043D\\u043D\\u044F",chartLink:"\\u0417\\u0432\'\\u044F\\u0437\\u0430\\u0442\\u0438 \\u0437 \\u0441\\u0456\\u0442\\u043A\\u043E\\u044E",chartUnlink:"\\u0412\\u0456\\u0434\\u043A\\u043B\\u044E\\u0447\\u0438\\u0442\\u0438 \\u0432\\u0456\\u0434 \\u0441\\u0456\\u0442\\u043A\\u0438",chartDownload:"\\u0417\\u0430\\u0432\\u0430\\u043D\\u0442\\u0430\\u0436\\u0438\\u0442\\u0438 \\u0434\\u0456\\u0430\\u0433\\u0440\\u0430\\u043C\\u0443",histogramFrequency:"\\u0427\\u0430\\u0441\\u0442\\u043E\\u0442\\u0430",seriesChartType:"\\u0422\\u0438\\u043F \\u0441\\u0435\\u0440\\u0456\\u0457 \\u0433\\u0440\\u0430\\u0444\\u0456\\u043A\\u0456\\u0432",seriesType:"\\u0422\\u0438\\u043F \\u0441\\u0435\\u0440\\u0456\\u0457",secondaryAxis:"\\u0412\\u0442\\u043E\\u0440\\u0438\\u043D\\u043D\\u0430 \\u0432\\u0456\\u0441\\u044C",seriesAdd:"\\u0414\\u043E\\u0434\\u0430\\u0442\\u0438 \\u0441\\u0435\\u0440\\u0456\\u044E",categoryAdd:"\\u0414\\u043E\\u0434\\u0430\\u0442\\u0438 \\u043A\\u0430\\u0442\\u0435\\u0433\\u043E\\u0440\\u0456\\u044E",bar:"\\u0421\\u043C\\u0443\\u0433\\u0430",column:"\\u0421\\u0442\\u043E\\u0432\\u043F\\u0435\\u0446\\u044C",histogram:"\\u0413\\u0456\\u0441\\u0442\\u043E\\u';
      S = S + '0433\\u0440\\u0430\\u043C\\u0430",advancedSettings:"\\u0420\\u043E\\u0437\\u0448\\u0438\\u0440\\u0435\\u043D\\u0456 \\u043D\\u0430\\u043B\\u0430\\u0448\\u0442\\u0443\\u0432\\u0430\\u043D\\u043D\\u044F",direction:"\\u041D\\u0430\\u043F\\u0440\\u044F\\u043C\\u043E\\u043A",horizontal:"\\u0413\\u043E\\u0440\\u0438\\u0437\\u043E\\u043D\\u0442\\u0430\\u043B\\u044C\\u043D\\u0438\\u0439",vertical:"\\u0412\\u0435\\u0440\\u0442\\u0438\\u043A\\u0430\\u043B\\u044C\\u043D\\u0438\\u0439",seriesGroupType:"\\u0422\\u0438\\u043F \\u0433\\u0440\\u0443\\u043F\\u0438 \\u0441\\u0435\\u0440\\u0456\\u0439",groupedSeriesGroupType:"\\u0413\\u0440\\u0443\\u043F\\u043E\\u0432\\u0430\\u043D\\u0430",stackedSeriesGroupType:"\\u0428\\u0442\\u0430\\u0431\\u0435\\u043B\\u044C\\u043E\\u0432\\u0430\\u043D\\u0430",normalizedSeriesGroupType:"100% \\u0448\\u0442\\u0430\\u0431\\u0435\\u043B\\u044C\\u043E\\u0432\\u0430\\u043D\\u0430",legendEnabled:"\\u0423\\u0432\\u0456\\u043C\\u043A\\u043D\\u0435\\u043D\\u043E",invalidColor:"\\u041D\\u0435\\u0434\\u0456\\u0439\\u0441\\u043D\\u0435 \\u0437\\u043D\\u0430\\u0447\\u0435\\u043D\\u043D\\u044F \\u043A\\u043E\\u043B\\u044C\\u043E\\u0440\\u0443",groupedColumnFull:"\\u0413\\u0440\\u0443\\u043F\\u043E\\u0432\\u0430\\u043D\\u0438\\u0439 \\u0441\\u0442\\u043E\\u0432\\u043F\\u0435\\u0446\\u044C",stackedColumnFull:"\\u0428\\u0442\\u0430\\u0431\\u0435\\u043B\\u044C\\u043E\\u0432\\u0430\\u043D\\u0438\\u0439 \\u0441\\u0442\\u043E\\u0432\\u043F\\u0435\\u0446\\u044C",normalizedColumnFull:"100% \\u0448\\u0442\\u0430\\u0431\\u0435\\u043B\\u044C\\u043E\\u0432\\u0430\\u043D\\u0438\\u0439 \\u0441\\u0442\\u043E\\u0432\\u043F\\u0435\\u0446\\u044C",groupedBarFull:"\\u0413\\u0440\\u0443\\u043F\\u043E\\u0432\\u0430\\u043D\\u0430 \\u0441\\u043C\\u0443\\u0433\\u0430",stackedBarFull:"\\u0428\\u0442\\u0430\\u0431\\u0435\\u043B\\u044C\\u043E\\u0432\\u0430\\u043D\\u0430 \\u0441\\u043C\\u0443\\u0433\\u0430",normalizedBarFull:"100% \\u0448\\u0442\\u0430\\u0431\\u0435\\u043B\\u044C\\u043E\\u0432\\u0430\\u043D\\u0430 \\u0441\\u043C\\u0443\\u0433\\u0430",stackedAreaFull:"\\u0428\\u0442\\u0430\\u0431\\u0435\\u043B\\u044C\\u043E\\u0432\\u0430\\u043D\\u0430 \\u043E\\u0431\\u043B\\u0430\\u0441\\u0442\\u044C",normalizedAreaFull:"100% \\u0448\\u0442\\u0430\\u0431';
      S = S + '\\u0435\\u043B\\u044C\\u043E\\u0432\\u0430\\u043D\\u0430 \\u043E\\u0431\\u043B\\u0430\\u0441\\u0442\\u044C",customCombo:"\\u0421\\u043F\\u0435\\u0446\\u0456\\u0430\\u043B\\u044C\\u043D\\u0430 \\u043A\\u043E\\u043C\\u0431\\u0456\\u043D\\u0430\\u0446\\u0456\\u044F",ariaAdvancedFilterBuilderItem:"${variable}. \\u0420\\u0456\\u0432\\u0435\\u043D\\u044C ${variable}. \\u041D\\u0430\\u0442\\u0438\\u0441\\u043D\\u0456\\u0442\\u044C ENTER \\u0434\\u043B\\u044F \\u0440\\u0435\\u0434\\u0430\\u0433\\u0443\\u0432\\u0430\\u043D\\u043D\\u044F.",ariaAdvancedFilterBuilderItemValidation:"${variable}. \\u0420\\u0456\\u0432\\u0435\\u043D\\u044C ${variable}. ${variable} \\u041D\\u0430\\u0442\\u0438\\u0441\\u043D\\u0456\\u0442\\u044C ENTER \\u0434\\u043B\\u044F \\u0440\\u0435\\u0434\\u0430\\u0433\\u0443\\u0432\\u0430\\u043D\\u043D\\u044F.",ariaAdvancedFilterBuilderList:"\\u0421\\u043F\\u0438\\u0441\\u043E\\u043A \\u0440\\u043E\\u0437\\u0448\\u0438\\u0440\\u0435\\u043D\\u043E\\u0433\\u043E \\u0444\\u0456\\u043B\\u044C\\u0442\\u0440\\u0443",ariaAdvancedFilterBuilderFilterItem:"\\u0423\\u043C\\u043E\\u0432\\u0430 \\u0444\\u0456\\u043B\\u044C\\u0442\\u0440\\u0443",ariaAdvancedFilterBuilderGroupItem:"\\u0413\\u0440\\u0443\\u043F\\u0430 \\u0444\\u0456\\u043B\\u044C\\u0442\\u0440\\u0456\\u0432",ariaAdvancedFilterBuilderColumn:"\\u041A\\u043E\\u043B\\u043E\\u043D\\u043A\\u0430",ariaAdvancedFilterBuilderOption:"\\u041E\\u043F\\u0446\\u0456\\u044F",ariaAdvancedFilterBuilderValueP:"\\u0417\\u043D\\u0430\\u0447\\u0435\\u043D\\u043D\\u044F",ariaAdvancedFilterBuilderJoinOperator:"\\u041E\\u043F\\u0435\\u0440\\u0430\\u0442\\u043E\\u0440 \\u0437\'\\u0454\\u0434\\u043D\\u0430\\u043D\\u043D\\u044F",ariaAdvancedFilterInput:"\\u0412\\u0432\\u0456\\u0434 \\u0440\\u043E\\u0437\\u0448\\u0438\\u0440\\u0435\\u043D\\u043E\\u0433\\u043E \\u0444\\u0456\\u043B\\u044C\\u0442\\u0440\\u0443",ariaChecked:"\\u0432\\u0456\\u0434\\u043C\\u0456\\u0447\\u0435\\u043D\\u043E",ariaColumn:"\\u041A\\u043E\\u043B\\u043E\\u043D\\u043A\\u0430",ariaColumnGroup:"\\u0413\\u0440\\u0443\\u043F\\u0430 \\u043A\\u043E\\u043B\\u043E\\u043D\\u043E\\u043A",ariaColumnFiltered:"\\u041A\\u043E\\u043B\\u043E\\u043D\\u043A\\u0430 \\u0432\\u0456\\u0434\\u0444\\u0456\\u043B\\u044C\\u0442\\u';
      S = S + '0440\\u043E\\u0432\\u0430\\u043D\\u0430",ariaColumnSelectAll:"\\u041F\\u0435\\u0440\\u0435\\u043A\\u043B\\u044E\\u0447\\u0438\\u0442\\u0438 \\u0432\\u0438\\u0431\\u0456\\u0440 \\u0443\\u0441\\u0456\\u0445 \\u043A\\u043E\\u043B\\u043E\\u043D\\u043E\\u043A",ariaDateFilterInput:"\\u0412\\u0432\\u0456\\u0434 \\u0444\\u0456\\u043B\\u044C\\u0442\\u0440\\u0443 \\u0437\\u0430 \\u0434\\u0430\\u0442\\u043E\\u044E",ariaDefaultListName:"\\u0421\\u043F\\u0438\\u0441\\u043E\\u043A",ariaFilterColumnsInput:"\\u0412\\u0432\\u0456\\u0434 \\u043A\\u043E\\u043B\\u043E\\u043D\\u043E\\u043A \\u0434\\u043B\\u044F \\u0444\\u0456\\u043B\\u044C\\u0442\\u0440\\u0443\\u0432\\u0430\\u043D\\u043D\\u044F",ariaFilterFromValue:"\\u0424\\u0456\\u043B\\u044C\\u0442\\u0440\\u0443\\u0432\\u0430\\u0442\\u0438 \\u0432\\u0456\\u0434 \\u0437\\u043D\\u0430\\u0447\\u0435\\u043D\\u043D\\u044F",ariaFilterInput:"\\u0412\\u0432\\u0456\\u0434 \\u0444\\u0456\\u043B\\u044C\\u0442\\u0440\\u0443",ariaFilterList:"\\u0421\\u043F\\u0438\\u0441\\u043E\\u043A \\u0444\\u0456\\u043B\\u044C\\u0442\\u0440\\u0456\\u0432",ariaFilterToValue:"\\u0424\\u0456\\u043B\\u044C\\u0442\\u0440\\u0443\\u0432\\u0430\\u0442\\u0438 \\u0434\\u043E \\u0437\\u043D\\u0430\\u0447\\u0435\\u043D\\u043D\\u044F",ariaFilterValue:"\\u0417\\u043D\\u0430\\u0447\\u0435\\u043D\\u043D\\u044F \\u0444\\u0456\\u043B\\u044C\\u0442\\u0440\\u0443",ariaFilterMenuOpen:"\\u0412\\u0456\\u0434\\u043A\\u0440\\u0438\\u0442\\u0438 \\u043C\\u0435\\u043D\\u044E \\u0444\\u0456\\u043B\\u044C\\u0442\\u0440\\u0443",ariaFilteringOperator:"\\u041E\\u043F\\u0435\\u0440\\u0430\\u0442\\u043E\\u0440 \\u0444\\u0456\\u043B\\u044C\\u0442\\u0440\\u0443\\u0432\\u0430\\u043D\\u043D\\u044F",ariaHidden:"\\u043F\\u0440\\u0438\\u0445\\u043E\\u0432\\u0430\\u043D\\u043E",ariaIndeterminate:"\\u043D\\u0435\\u0432\\u0438\\u0437\\u043D\\u0430\\u0447\\u0435\\u043D\\u043E",ariaInputEditor:"\\u0420\\u0435\\u0434\\u0430\\u043A\\u0442\\u043E\\u0440 \\u0432\\u0432\\u043E\\u0434\\u0443",ariaMenuColumn:"\\u041D\\u0430\\u0442\\u0438\\u0441\\u043D\\u0456\\u0442\\u044C ALT DOWN \\u0434\\u043B\\u044F \\u0432\\u0456\\u0434\\u043A\\u0440\\u0438\\u0442\\u0442\\u044F \\u043C\\u0435\\u043D\\u044E \\u043A\\u043E\\u043B\\u043E\\u043D\\u043E\\u043A",ariaFilterColumn:"\\u041D\\u0430\\u0';
      S = S + '442\\u0438\\u0441\\u043D\\u0456\\u0442\\u044C CTRL ENTER \\u0434\\u043B\\u044F \\u0432\\u0456\\u0434\\u043A\\u0440\\u0438\\u0442\\u0442\\u044F \\u0444\\u0456\\u043B\\u044C\\u0442\\u0440\\u0443",ariaRowDeselect:"\\u041D\\u0430\\u0442\\u0438\\u0441\\u043D\\u0456\\u0442\\u044C SPACE \\u0434\\u043B\\u044F \\u0437\\u043D\\u044F\\u0442\\u0442\\u044F \\u0432\\u0438\\u0434\\u0456\\u043B\\u0435\\u043D\\u043D\\u044F \\u0437 \\u0446\\u044C\\u043E\\u0433\\u043E \\u0440\\u044F\\u0434\\u043A\\u0430",ariaRowSelectAll:"\\u041D\\u0430\\u0442\\u0438\\u0441\\u043D\\u0456\\u0442\\u044C Space \\u0434\\u043B\\u044F \\u043F\\u0435\\u0440\\u0435\\u043C\\u0438\\u043A\\u0430\\u043D\\u043D\\u044F \\u0432\\u0438\\u0431\\u043E\\u0440\\u0443 \\u0432\\u0441\\u0456\\u0445 \\u0440\\u044F\\u0434\\u043A\\u0456\\u0432",ariaRowToggleSelection:"\\u041D\\u0430\\u0442\\u0438\\u0441\\u043D\\u0456\\u0442\\u044C Space \\u0434\\u043B\\u044F \\u043F\\u0435\\u0440\\u0435\\u043C\\u0438\\u043A\\u0430\\u043D\\u043D\\u044F \\u0432\\u0438\\u0431\\u043E\\u0440\\u0443 \\u0440\\u044F\\u0434\\u043A\\u0430",ariaRowSelect:"\\u041D\\u0430\\u0442\\u0438\\u0441\\u043D\\u0456\\u0442\\u044C SPACE \\u0434\\u043B\\u044F \\u0432\\u0438\\u0431\\u043E\\u0440\\u0443 \\u0446\\u044C\\u043E\\u0433\\u043E \\u0440\\u044F\\u0434\\u043A\\u0430",ariaRowSelectionDisabled:"\\u0412\\u0438\\u0431\\u0456\\u0440 \\u0440\\u044F\\u0434\\u043A\\u0430 \\u0432\\u0456\\u0434\\u043A\\u043B\\u044E\\u0447\\u0435\\u043D\\u043E \\u0434\\u043B\\u044F \\u0446\\u044C\\u043E\\u0433\\u043E \\u0440\\u044F\\u0434\\u043A\\u0430",ariaSearch:"\\u041F\\u043E\\u0448\\u0443\\u043A",ariaSortableColumn:"\\u041D\\u0430\\u0442\\u0438\\u0441\\u043D\\u0456\\u0442\\u044C ENTER \\u0434\\u043B\\u044F \\u0441\\u043E\\u0440\\u0442\\u0443\\u0432\\u0430\\u043D\\u043D\\u044F",ariaToggleVisibility:"\\u041D\\u0430\\u0442\\u0438\\u0441\\u043D\\u0456\\u0442\\u044C SPACE \\u0434\\u043B\\u044F \\u043F\\u0435\\u0440\\u0435\\u043C\\u0438\\u043A\\u0430\\u043D\\u043D\\u044F \\u0432\\u0438\\u0434\\u0438\\u043C\\u043E\\u0441\\u0442\\u0456",ariaToggleCellValue:"\\u041D\\u0430\\u0442\\u0438\\u0441\\u043D\\u0456\\u0442\\u044C SPACE \\u0434\\u043B\\u044F \\u043F\\u0435\\u0440\\u0435\\u043C\\u0438\\u043A\\u0430\\u043D\\u043D\\u044F \\u0437\\u043D\\u0430\\u0447\\u0435\\u043D\\u043D';
      S = S + '\\u044F \\u043A\\u043E\\u043C\\u0456\\u0440\\u043A\\u0438",ariaUnchecked:"\\u043D\\u0435 \\u0432\\u0456\\u0434\\u043C\\u0456\\u0447\\u0435\\u043D\\u043E",ariaVisible:"\\u0432\\u0438\\u0434\\u0438\\u043C\\u043E",ariaSearchFilterValues:"\\u041F\\u043E\\u0448\\u0443\\u043A \\u0437\\u043D\\u0430\\u0447\\u0435\\u043D\\u044C \\u0444\\u0456\\u043B\\u044C\\u0442\\u0440\\u0443",ariaPageSizeSelectorLabel:"\\u0420\\u043E\\u0437\\u043C\\u0456\\u0440 \\u0441\\u0442\\u043E\\u0440\\u0456\\u043D\\u043A\\u0438",ariaChartMenuClose:"\\u0417\\u0430\\u043A\\u0440\\u0438\\u0442\\u0438 \\u043C\\u0435\\u043D\\u044E \\u0440\\u0435\\u0434\\u0430\\u0433\\u0443\\u0432\\u0430\\u043D\\u043D\\u044F \\u0434\\u0456\\u0430\\u0433\\u0440\\u0430\\u043C\\u0438",ariaChartSelected:"\\u0412\\u0438\\u0431\\u0440\\u0430\\u043D\\u043E",ariaSkeletonCellLoadingFailed:"\\u041F\\u043E\\u043C\\u0438\\u043B\\u043A\\u0430 \\u0437\\u0430\\u0432\\u0430\\u043D\\u0442\\u0430\\u0436\\u0435\\u043D\\u043D\\u044F \\u0440\\u044F\\u0434\\u043A\\u0430",ariaSkeletonCellLoading:"\\u0414\\u0430\\u043D\\u0456 \\u0440\\u044F\\u0434\\u043A\\u0430 \\u0437\\u0430\\u0432\\u0430\\u043D\\u0442\\u0430\\u0436\\u0443\\u044E\\u0442\\u044C\\u0441\\u044F",ariaRowGroupDropZonePanelLabel:"\\u0413\\u0440\\u0443\\u043F\\u0438 \\u0440\\u044F\\u0434\\u043A\\u0456\\u0432",ariaValuesDropZonePanelLabel:"\\u0417\\u043D\\u0430\\u0447\\u0435\\u043D\\u043D\\u044F",ariaPivotDropZonePanelLabel:"\\u041C\\u0456\\u0442\\u043A\\u0438 \\u0441\\u0442\\u043E\\u0432\\u043F\\u0446\\u0456\\u0432",ariaDropZoneColumnComponentDescription:"\\u041D\\u0430\\u0442\\u0438\\u0441\\u043D\\u0456\\u0442\\u044C DELETE, \\u0449\\u043E\\u0431 \\u0432\\u0438\\u0434\\u0430\\u043B\\u0438\\u0442\\u0438",ariaDropZoneColumnValueItemDescription:"\\u041D\\u0430\\u0442\\u0438\\u0441\\u043D\\u0456\\u0442\\u044C ENTER, \\u0449\\u043E\\u0431 \\u0437\\u043C\\u0456\\u043D\\u0438\\u0442\\u0438 \\u0442\\u0438\\u043F \\u0430\\u0433\\u0440\\u0435\\u0433\\u0430\\u0446\\u0456\\u0457",ariaDropZoneColumnGroupItemDescription:"\\u041D\\u0430\\u0442\\u0438\\u0441\\u043D\\u0456\\u0442\\u044C ENTER, \\u0449\\u043E\\u0431 \\u0441\\u043E\\u0440\\u0442\\u0443\\u0432\\u0430\\u0442\\u0438",ariaDropZoneColumnComponentAggFuncSeparator:" \\u0437 ",ariaDropZo';
      S = S + 'neColumnComponentSortAscending:"\\u0441\\u043F\\u0430\\u0434\\u0430\\u043D\\u043D\\u044F",ariaDropZoneColumnComponentSortDescending:"\\u0437\\u0440\\u043E\\u0441\\u0442\\u0430\\u043D\\u043D\\u044F",ariaLabelDialog:"\\u0414\\u0456\\u0430\\u043B\\u043E\\u0433",ariaLabelColumnMenu:"\\u041C\\u0435\\u043D\\u044E \\u0441\\u0442\\u043E\\u0432\\u043F\\u0446\\u044F",ariaLabelColumnFilter:"\\u0424\\u0456\\u043B\\u044C\\u0442\\u0440 \\u0441\\u0442\\u043E\\u0432\\u043F\\u0446\\u044F",ariaLabelCellEditor:"\\u0420\\u0435\\u0434\\u0430\\u043A\\u0442\\u043E\\u0440 \\u043A\\u043B\\u0456\\u0442\\u0438\\u043D\\u043E\\u043A",ariaLabelSelectField:"\\u0412\\u0438\\u0431\\u0435\\u0440\\u0456\\u0442\\u044C \\u043F\\u043E\\u043B\\u0435",ariaLabelRichSelectField:"\\u041F\\u043E\\u043B\\u0435 \\u0432\\u0438\\u0431\\u043E\\u0440\\u0443",ariaLabelRichSelectToggleSelection:"\\u041D\\u0430\\u0442\\u0438\\u0441\\u043D\\u0456\\u0442\\u044C \\u041F\\u0420\\u041E\\u041F\\u0423\\u0421\\u041A \\u0434\\u043B\\u044F \\u043F\\u0435\\u0440\\u0435\\u043A\\u043B\\u044E\\u0447\\u0435\\u043D\\u043D\\u044F \\u0432\\u0438\\u0431\\u043E\\u0440\\u0443",ariaLabelRichSelectDeselectAllItems:"\\u041D\\u0430\\u0442\\u0438\\u0441\\u043D\\u0456\\u0442\\u044C DELETE \\u0434\\u043B\\u044F \\u0441\\u043A\\u0430\\u0441\\u0443\\u0432\\u0430\\u043D\\u043D\\u044F \\u0432\\u0438\\u0431\\u043E\\u0440\\u0443 \\u0432\\u0441\\u0456\\u0445 \\u0435\\u043B\\u0435\\u043C\\u0435\\u043D\\u0442\\u0456\\u0432",ariaLabelRichSelectDeleteSelection:"\\u041D\\u0430\\u0442\\u0438\\u0441\\u043D\\u0456\\u0442\\u044C DELETE \\u0434\\u043B\\u044F \\u0441\\u043A\\u0430\\u0441\\u0443\\u0432\\u0430\\u043D\\u043D\\u044F \\u0432\\u0438\\u0431\\u043E\\u0440\\u0443 \\u0435\\u043B\\u0435\\u043C\\u0435\\u043D\\u0442\\u0430",ariaLabelTooltip:"\\u041F\\u0456\\u0434\\u043A\\u0430\\u0437\\u043A\\u0430",ariaLabelContextMenu:"\\u041A\\u043E\\u043D\\u0442\\u0435\\u043A\\u0441\\u0442\\u043D\\u0435 \\u043C\\u0435\\u043D\\u044E",ariaLabelSubMenu:"\\u041F\\u0456\\u0434\\u043C\\u0435\\u043D\\u044E",ariaLabelAggregationFunction:"\\u0424\\u0443\\u043D\\u043A\\u0446\\u0456\\u044F \\u0430\\u0433\\u0440\\u0435\\u0433\\u0430\\u0446\\u0456\\u0457",ariaLabelAdvancedFilterAutocomplete:"\\u0410\\u0432\\u0442\\u043E\\u0437\\u0';
      S = S + '430\\u043F\\u043E\\u0432\\u043D\\u0435\\u043D\\u043D\\u044F \\u0440\\u043E\\u0437\\u0448\\u0438\\u0440\\u0435\\u043D\\u043E\\u0433\\u043E \\u0444\\u0456\\u043B\\u044C\\u0442\\u0440\\u0430",ariaLabelAdvancedFilterBuilderAddField:"\\u0414\\u043E\\u0434\\u0430\\u0442\\u0438 \\u043F\\u043E\\u043B\\u0435 \\u0432 \\u0440\\u043E\\u0437\\u0448\\u0438\\u0440\\u0435\\u043D\\u0438\\u0439 \\u0444\\u0456\\u043B\\u044C\\u0442\\u0440",ariaLabelAdvancedFilterBuilderColumnSelectField:"\\u0412\\u0438\\u0431\\u0456\\u0440 \\u043A\\u043E\\u043B\\u043E\\u043D\\u043A\\u0438 \\u0432 \\u0440\\u043E\\u0437\\u0448\\u0438\\u0440\\u0435\\u043D\\u043E\\u043C\\u0443 \\u0444\\u0456\\u043B\\u044C\\u0442\\u0440\\u0456",ariaLabelAdvancedFilterBuilderOptionSelectField:"\\u0412\\u0438\\u0431\\u0440\\u0430\\u0442\\u0438 \\u043E\\u043F\\u0446\\u0456\\u044E \\u0432 \\u0440\\u043E\\u0437\\u0448\\u0438\\u0440\\u0435\\u043D\\u043E\\u043C\\u0443 \\u0444\\u0456\\u043B\\u044C\\u0442\\u0440\\u0456",ariaLabelAdvancedFilterBuilderJoinSelectField:"\\u0412\\u0438\\u0431\\u0456\\u0440 \\u043E\\u043F\\u0435\\u0440\\u0430\\u0442\\u043E\\u0440\\u0430 \\u043F\\u0440\\u0438\\u0454\\u0434\\u043D\\u0430\\u043D\\u043D\\u044F \\u0432 \\u0440\\u043E\\u0437\\u0448\\u0438\\u0440\\u0435\\u043D\\u043E\\u043C\\u0443 \\u0444\\u0456\\u043B\\u044C\\u0442\\u0440\\u0456",ariaColumnPanelList:"\\u0421\\u043F\\u0438\\u0441\\u043E\\u043A \\u043A\\u043E\\u043B\\u043E\\u043D\\u043E\\u043A",ariaFilterPanelList:"\\u0421\\u043F\\u0438\\u0441\\u043E\\u043A \\u0444\\u0456\\u043B\\u044C\\u0442\\u0440\\u0456\\u0432",thousandSeparator:"\\xA0",decimalSeparator:",",true:"\\u041F\\u0440\\u0430\\u0432\\u0434\\u0430",false:"\\u041D\\u0435\\u043F\\u0440\\u0430\\u0432\\u0434\\u0430",invalidDate:"\\u041D\\u0435\\u0432\\u0456\\u0440\\u043D\\u0430 \\u0434\\u0430\\u0442\\u0430",invalidNumber:"\\u041D\\u0435\\u0432\\u0456\\u0440\\u043D\\u0438\\u0439 \\u043D\\u043E\\u043C\\u0435\\u0440",january:"\\u0421\\u0456\\u0447\\u0435\\u043D\\u044C",february:"\\u041B\\u044E\\u0442\\u0438\\u0439",march:"\\u0411\\u0435\\u0440\\u0435\\u0437\\u0435\\u043D\\u044C",april:"\\u041A\\u0432\\u0456\\u0442\\u0435\\u043D\\u044C",may:"\\u0422\\u0440\\u0430\\u0432\\u0435\\u043D\\u044C",june:"\\u0427\\u0435\\u0440\\u0432\\u0435\\u043D\\u044C",july';
      S = S + ':"\\u041B\\u0438\\u043F\\u0435\\u043D\\u044C",august:"\\u0421\\u0435\\u0440\\u043F\\u0435\\u043D\\u044C",september:"\\u0412\\u0435\\u0440\\u0435\\u0441\\u0435\\u043D\\u044C",october:"\\u0416\\u043E\\u0432\\u0442\\u0435\\u043D\\u044C",november:"\\u041B\\u0438\\u0441\\u0442\\u043E\\u043F\\u0430\\u0434",december:"\\u0413\\u0440\\u0443\\u0434\\u0435\\u043D\\u044C",timeFormatSlashesDDMMYYYY:"\\u0414\\u0414/\\u041C\\u041C/\\u0420\\u0420\\u0420\\u0420",timeFormatSlashesMMDDYYYY:"\\u041C\\u041C/\\u0414\\u0414/\\u0420\\u0420\\u0420\\u0420",timeFormatSlashesDDMMYY:"\\u0414\\u0414/\\u041C\\u041C/\\u0420\\u0420",timeFormatSlashesMMDDYY:"\\u041C\\u041C/\\u0414\\u0414/\\u0420\\u0420",timeFormatDotsDDMYY:"\\u0414\\u0414.\\u041C.\\u0420\\u0420",timeFormatDotsMDDYY:"\\u041C.\\u0414\\u0414.\\u0420\\u0420",timeFormatDashesYYYYMMDD:"\\u0420\\u0420\\u0420\\u0420-\\u041C\\u041C-\\u0414\\u0414",timeFormatSpacesDDMMMMYYYY:"\\u0414\\u0414 \\u041C\\u041C\\u041C\\u041C \\u0420\\u0420\\u0420\\u0420",timeFormatHHMMSS:"\\u0413\\u0413:\\u0425\\u0425:\\u0421\\u0421",timeFormatHHMMSSAmPm:"\\u0413\\u0413:\\u0425\\u0425:\\u0421\\u0421 \\u0414\\u041F/\\u041F\\u041F"},K={selectAll:"(\\u0633\\u0628 \\u0645\\u0646\\u062A\\u062E\\u0628 \\u06A9\\u0631\\u06CC\\u06BA)",selectAllSearchResults:"(\\u062A\\u0645\\u0627\\u0645 \\u062A\\u0644\\u0627\\u0634 \\u06A9\\u06D2 \\u0646\\u062A\\u0627\\u0626\\u062C \\u0645\\u0646\\u062A\\u062E\\u0628 \\u06A9\\u0631\\u06CC\\u06BA)",addCurrentSelectionToFilter:"\\u0645\\u0648\\u062C\\u0648\\u062F\\u06C1 \\u0627\\u0646\\u062A\\u062E\\u0627\\u0628 \\u06A9\\u0648 \\u0641\\u0644\\u0679\\u0631 \\u0645\\u06CC\\u06BA \\u0634\\u0627\\u0645\\u0644 \\u06A9\\u0631\\u06CC\\u06BA",searchOoo:"\\u062A\\u0644\\u0627\\u0634 \\u06A9\\u0631\\u06CC\\u06BA...",blanks:"(\\u062E\\u0627\\u0644\\u06CC)",noMatches:"\\u06A9\\u0648\\u0626\\u06CC \\u0645\\u0645\\u0627\\u062B\\u0644\\u062A \\u0646\\u06C1\\u06CC\\u06BA",filterOoo:"\\u0641\\u0644\\u0679\\u0631...",equals:"\\u0628\\u0631\\u0627\\u0628\\u0631",notEqual:"\\u0628\\u0631\\u0627\\u0628\\u0631 \\u0646\\u06C1\\u06CC\\u06BA",blank:"\\u062E\\u0627\\u0644\\u06CC",notBlank:"\\u062E\\u0627\\u0644\\u06CC \\u0646\\u06C1\\u06CC\\u06BA",empty:"\\u0627\\u06CC\\u06A9 \\u06A9\\u0648 \\u0645\\u064';
      S = S + '6\\u062A\\u062E\\u0628 \\u06A9\\u0631\\u06CC\\u06BA",lessThan:"\\u0633\\u06D2 \\u06A9\\u0645",greaterThan:"\\u0633\\u06D2 \\u0632\\u06CC\\u0627\\u062F\\u06C1",lessThanOrEqual:"\\u0633\\u06D2 \\u06A9\\u0645 \\u06CC\\u0627 \\u0628\\u0631\\u0627\\u0628\\u0631",greaterThanOrEqual:"\\u0633\\u06D2 \\u0632\\u06CC\\u0627\\u062F\\u06C1 \\u06CC\\u0627 \\u0628\\u0631\\u0627\\u0628\\u0631",inRange:"\\u062F\\u0631\\u0645\\u06CC\\u0627\\u0646",inRangeStart:"\\u0633\\u06D2",inRangeEnd:"\\u062A\\u06A9",contains:"\\u0634\\u0627\\u0645\\u0644 \\u06C1\\u06D2",notContains:"\\u0634\\u0627\\u0645\\u0644 \\u0646\\u06C1\\u06CC\\u06BA \\u06C1\\u06D2",startsWith:"\\u0634\\u0631\\u0648\\u0639 \\u06C1\\u0648\\u062A\\u0627 \\u06C1\\u06D2",endsWith:"\\u062E\\u062A\\u0645 \\u06C1\\u0648\\u062A\\u0627 \\u06C1\\u06D2",dateFormatOoo:"yyyy-mm-dd",before:"\\u067E\\u06C1\\u0644\\u06D2",after:"\\u0628\\u0639\\u062F",andCondition:"\\u0627\\u0648\\u0631",orCondition:"\\u06CC\\u0627",applyFilter:"\\u0644\\u0627\\u06AF\\u0648 \\u06A9\\u0631\\u06CC\\u06BA",resetFilter:"\\u0631\\u06CC \\u0633\\u06CC\\u0679 \\u06A9\\u0631\\u06CC\\u06BA",clearFilter:"\\u0635\\u0627\\u0641 \\u06A9\\u0631\\u06CC\\u06BA",cancelFilter:"\\u0645\\u0646\\u0633\\u0648\\u062E \\u06A9\\u0631\\u06CC\\u06BA",textFilter:"\\u0645\\u062A\\u0646 \\u0641\\u0644\\u0679\\u0631",numberFilter:"\\u0646\\u0645\\u0628\\u0631 \\u0641\\u0644\\u0679\\u0631",dateFilter:"\\u062A\\u0627\\u0631\\u06CC\\u062E \\u0641\\u0644\\u0679\\u0631",setFilter:"\\u0633\\u06CC\\u0679 \\u0641\\u0644\\u0679\\u0631",groupFilterSelect:"\\u0641\\u06CC\\u0644\\u0688 \\u0645\\u0646\\u062A\\u062E\\u0628 \\u06A9\\u0631\\u06CC\\u06BA:",advancedFilterContains:"\\u0634\\u0627\\u0645\\u0644 \\u06C1\\u06D2",advancedFilterNotContains:"\\u0634\\u0627\\u0645\\u0644 \\u0646\\u06C1\\u06CC\\u06BA \\u06C1\\u06D2",advancedFilterTextEquals:"\\u0628\\u0631\\u0627\\u0628\\u0631 \\u06C1\\u06D2",advancedFilterTextNotEqual:"\\u0628\\u0631\\u0627\\u0628\\u0631 \\u0646\\u06C1\\u06CC\\u06BA \\u06C1\\u06D2",advancedFilterStartsWith:"\\u0634\\u0631\\u0648\\u0639 \\u06C1\\u0648\\u062A\\u0627 \\u06C1\\u06D2",advancedFilterEndsWith:"\\u062E\\u062A\\u0645 \\u06C1\\u0648\\u062A\\u0627 \\u06C1\\u06D2",advancedFilterBlank:"\\u062E\\u0627\\';
      S = S + 'u0644\\u06CC \\u06C1\\u06D2",advancedFilterNotBlank:"\\u062E\\u0627\\u0644\\u06CC \\u0646\\u06C1\\u06CC\\u06BA \\u06C1\\u06D2",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"\\u062F\\u0631\\u0633\\u062A \\u06C1\\u06D2",advancedFilterFalse:"\\u063A\\u0644\\u0637 \\u06C1\\u06D2",advancedFilterAnd:"\\u0627\\u0648\\u0631",advancedFilterOr:"\\u06CC\\u0627",advancedFilterApply:"\\u0644\\u0627\\u06AF\\u0648 \\u06A9\\u0631\\u06CC\\u06BA",advancedFilterBuilder:"\\u0628\\u0644\\u0688\\u0631",advancedFilterValidationMissingColumn:"\\u06A9\\u0627\\u0644\\u0645 \\u063A\\u0627\\u0626\\u0628 \\u06C1\\u06D2",advancedFilterValidationMissingOption:"\\u0622\\u067E\\u0634\\u0646 \\u063A\\u0627\\u0626\\u0628 \\u06C1\\u06D2",advancedFilterValidationMissingValue:"\\u0642\\u062F\\u0631 \\u063A\\u0627\\u0626\\u0628 \\u06C1\\u06D2",advancedFilterValidationInvalidColumn:"\\u06A9\\u0627\\u0644\\u0645 \\u0646\\u06C1\\u06CC\\u06BA \\u0645\\u0644\\u0627",advancedFilterValidationInvalidOption:"\\u0622\\u067E\\u0634\\u0646 \\u0646\\u06C1\\u06CC\\u06BA \\u0645\\u0644\\u0627",advancedFilterValidationMissingQuote:"\\u0642\\u062F\\u0631 \\u06A9\\u06D2 \\u0622\\u062E\\u0631 \\u0645\\u06CC\\u06BA \\u0627\\u0642\\u062A\\u0628\\u0627\\u0633 \\u063A\\u0627\\u0626\\u0628 \\u06C1\\u06D2",advancedFilterValidationNotANumber:"\\u0642\\u062F\\u0631 \\u0627\\u06CC\\u06A9 \\u0646\\u0645\\u0628\\u0631 \\u0646\\u06C1\\u06CC\\u06BA \\u06C1\\u06D2",advancedFilterValidationInvalidDate:"\\u0642\\u062F\\u0631 \\u0627\\u06CC\\u06A9 \\u062C\\u0627\\u0626\\u0632 \\u062A\\u0627\\u0631\\u06CC\\u062E \\u0646\\u06C1\\u06CC\\u06BA \\u06C1\\u06D2",advancedFilterValidationMissingCondition:"\\u0634\\u0631\\u0637 \\u063A\\u0627\\u0626\\u0628 \\u06C1\\u06D2",advancedFilterValidationJoinOperatorMismatch:"\\u0627\\u06CC\\u06A9 \\u0634\\u0631\\u0637 \\u0645\\u06CC\\u06BA \\u062C\\u0648\\u0627\\u0626\\u0646 \\u0622\\u067E\\u0631\\u06CC\\u0679\\u0631\\u0632 \\u0627\\u06CC\\u06A9 \\u062C\\u06CC\\u0633\\u06D2 \\u06C1\\u0648\\u0646\\u06D2 \\u0686\\u0627\\u06C1\\u06CC\\u06D2",advanced';
      S = S + 'FilterValidationInvalidJoinOperator:"\\u062C\\u0648\\u0627\\u0626\\u0646 \\u0622\\u067E\\u0631\\u06CC\\u0679\\u0631 \\u0646\\u06C1\\u06CC\\u06BA \\u0645\\u0644\\u0627",advancedFilterValidationMissingEndBracket:"\\u0627\\u062E\\u062A\\u062A\\u0627\\u0645\\u06CC \\u0628\\u0631\\u06CC\\u06A9\\u0679 \\u063A\\u0627\\u0626\\u0628 \\u06C1\\u06D2",advancedFilterValidationExtraEndBracket:"\\u0632\\u06CC\\u0627\\u062F\\u06C1 \\u0627\\u062E\\u062A\\u062A\\u0627\\u0645\\u06CC \\u0628\\u0631\\u06CC\\u06A9\\u0679\\u0633",advancedFilterValidationMessage:"\\u0627\\u0638\\u06C1\\u0627\\u0631 \\u0645\\u06CC\\u06BA \\u0627\\u06CC\\u06A9 \\u0646\\u0642\\u0635 \\u06C1\\u06D2. ${variable} - ${variable}.",advancedFilterValidationMessageAtEnd:"\\u0627\\u0638\\u06C1\\u0627\\u0631 \\u0645\\u06CC\\u06BA \\u0627\\u06CC\\u06A9 \\u0646\\u0642\\u0635 \\u06C1\\u06D2. ${variable} \\u0627\\u0638\\u06C1\\u0627\\u0631 \\u06A9\\u06D2 \\u0622\\u062E\\u0631 \\u0645\\u06CC\\u06BA.",advancedFilterBuilderTitle:"\\u0627\\u06CC\\u0688\\u0648\\u0627\\u0646\\u0633\\u0688 \\u0641\\u0644\\u0679\\u0631",advancedFilterBuilderApply:"\\u0644\\u0627\\u06AF\\u0648 \\u06A9\\u0631\\u06CC\\u06BA",advancedFilterBuilderCancel:"\\u0645\\u0646\\u0633\\u0648\\u062E \\u06A9\\u0631\\u06CC\\u06BA",advancedFilterBuilderAddButtonTooltip:"\\u0641\\u0644\\u0679\\u0631 \\u06CC\\u0627 \\u06AF\\u0631\\u0648\\u067E \\u0634\\u0627\\u0645\\u0644 \\u06A9\\u0631\\u06CC\\u06BA",advancedFilterBuilderRemoveButtonTooltip:"\\u06C1\\u0679\\u0627 \\u062F\\u06CC\\u06BA",advancedFilterBuilderMoveUpButtonTooltip:"\\u0627\\u0648\\u067E\\u0631 \\u0645\\u0646\\u062A\\u0642\\u0644 \\u06A9\\u0631\\u06CC\\u06BA",advancedFilterBuilderMoveDownButtonTooltip:"\\u0646\\u06CC\\u0686\\u06D2 \\u0645\\u0646\\u062A\\u0642\\u0644 \\u06A9\\u0631\\u06CC\\u06BA",advancedFilterBuilderAddJoin:"\\u06AF\\u0631\\u0648\\u067E \\u0634\\u0627\\u0645\\u0644 \\u06A9\\u0631\\u06CC\\u06BA",advancedFilterBuilderAddCondition:"\\u0641\\u0644\\u0679\\u0631 \\u0634\\u0627\\u0645\\u0644 \\u06A9\\u0631\\u06CC\\u06BA",advancedFilterBuilderSelectColumn:"\\u0627\\u06CC\\u06A9 \\u06A9\\u0627\\u0644\\u0645 \\u0645\\u0646\\u062A\\u062E\\u0628 \\u06A9\\u0631\\u06CC\\u06BA",advancedFilterBuilderSelectOption:"\\u';
      S = S + '0627\\u06CC\\u06A9 \\u0622\\u067E\\u0634\\u0646 \\u0645\\u0646\\u062A\\u062E\\u0628 \\u06A9\\u0631\\u06CC\\u06BA",advancedFilterBuilderEnterValue:"\\u0627\\u06CC\\u06A9 \\u0642\\u062F\\u0631 \\u062F\\u0631\\u062C \\u06A9\\u0631\\u06CC\\u06BA...",advancedFilterBuilderValidationAlreadyApplied:"\\u0645\\u0648\\u062C\\u0648\\u062F\\u06C1 \\u0641\\u0644\\u0679\\u0631 \\u067E\\u06C1\\u0644\\u06D2 \\u0633\\u06D2 \\u0644\\u0627\\u06AF\\u0648 \\u06C1\\u06D2.",advancedFilterBuilderValidationIncomplete:"\\u062A\\u0645\\u0627\\u0645 \\u0634\\u0631\\u0627\\u0626\\u0637 \\u067E\\u0648\\u0631\\u06CC \\u0646\\u06C1\\u06CC\\u06BA \\u06C1\\u0648\\u0626\\u06CC\\u06BA.",advancedFilterBuilderValidationSelectColumn:"\\u0627\\u06CC\\u06A9 \\u06A9\\u0627\\u0644\\u0645 \\u0645\\u0646\\u062A\\u062E\\u0628 \\u06A9\\u0631\\u0646\\u0627 \\u0636\\u0631\\u0648\\u0631\\u06CC \\u06C1\\u06D2.",advancedFilterBuilderValidationSelectOption:"\\u0627\\u06CC\\u06A9 \\u0622\\u067E\\u0634\\u0646 \\u0645\\u0646\\u062A\\u062E\\u0628 \\u06A9\\u0631\\u0646\\u0627 \\u0636\\u0631\\u0648\\u0631\\u06CC \\u06C1\\u06D2.",advancedFilterBuilderValidationEnterValue:"\\u0627\\u06CC\\u06A9 \\u0642\\u062F\\u0631 \\u062F\\u0631\\u062C \\u06A9\\u0631\\u0646\\u0627 \\u0636\\u0631\\u0648\\u0631\\u06CC \\u06C1\\u06D2.",columns:"\\u06A9\\u0627\\u0644\\u0645\\u0632",filters:"\\u0641\\u0644\\u0679\\u0631\\u0632",pivotMode:"\\u067E\\u06CC\\u0648\\u06CC\\u0679 \\u0645\\u0648\\u0688",groups:"\\u0631\\u0648 \\u06AF\\u0631\\u0648\\u067E",rowGroupColumnsEmptyMessage:"\\u0631\\u0648 \\u06AF\\u0631\\u0648\\u067E \\u0633\\u06CC\\u0679 \\u06A9\\u0631\\u0646\\u06D2 \\u06A9\\u06D2 \\u0644\\u06CC\\u06D2 \\u06CC\\u06C1\\u0627\\u06BA \\u06AF\\u06BE\\u0633\\u06CC\\u0679\\u06CC\\u06BA",values:"\\u0642\\u062F\\u0631\\u06CC\\u06BA",valueColumnsEmptyMessage:"\\u062C\\u0645\\u0639 \\u06A9\\u0631\\u0646\\u06D2 \\u06A9\\u06D2 \\u0644\\u06CC\\u06D2 \\u06CC\\u06C1\\u0627\\u06BA \\u06AF\\u06BE\\u0633\\u06CC\\u0679\\u06CC\\u06BA",pivots:"\\u06A9\\u0627\\u0644\\u0645 \\u0644\\u06CC\\u0628\\u0644",pivotColumnsEmptyMessage:"\\u06A9\\u0627\\u0644\\u0645 \\u0644\\u06CC\\u0628\\u0644 \\u0633\\u06CC\\u0679 \\u06A9\\u0631\\u0646\\u06D2 \\u06A9\\u06D2 \\u0644\\u06CC\\u06D2 \\u06CC\\u06C1\\u0627\\u06BA \\u06AF\\u06';
      S = S + 'BE\\u0633\\u06CC\\u0679\\u06CC\\u06BA",group:"\\u06AF\\u0631\\u0648\\u067E",rowDragRow:"\\u0642\\u0637\\u0627\\u0631",rowDragRows:"\\u0642\\u0637\\u0627\\u0631\\u06CC\\u06BA",loadingOoo:"\\u0644\\u0648\\u0688 \\u06C1\\u0648 \\u0631\\u06C1\\u0627 \\u06C1\\u06D2 ...",loadingError:"\\u063A\\u0644\\u0637\\u06CC",noRowsToShow:"\\u062F\\u06A9\\u06BE\\u0627\\u0646\\u06D2 \\u06A9\\u06D2 \\u0644\\u06CC\\u06D2 \\u06A9\\u0648\\u0626\\u06CC \\u0642\\u0637\\u0627\\u0631 \\u0646\\u06C1\\u06CC\\u06BA",enabled:"\\u0641\\u0639\\u0627\\u0644",pinColumn:"\\u06A9\\u0627\\u0644\\u0645 \\u06A9\\u0648 \\u067E\\u0646 \\u06A9\\u0631\\u06CC\\u06BA",pinLeft:"\\u0628\\u0627\\u0626\\u06CC\\u06BA \\u067E\\u0646 \\u06A9\\u0631\\u06CC\\u06BA",pinRight:"\\u062F\\u0627\\u0626\\u06CC\\u06BA \\u067E\\u0646 \\u06A9\\u0631\\u06CC\\u06BA",noPin:"\\u06A9\\u0648\\u0626\\u06CC \\u067E\\u0646 \\u0646\\u06C1\\u06CC\\u06BA",valueAggregation:"\\u0648\\u06CC\\u0644\\u06CC\\u0648 \\u0627\\u06CC\\u06AF\\u0631\\u06CC\\u06AF\\u06CC\\u0634\\u0646",noAggregation:"\\u06A9\\u0648\\u0626\\u06CC \\u0646\\u06C1\\u06CC\\u06BA",autosizeThisColumn:"\\u0627\\u0633 \\u06A9\\u0627\\u0644\\u0645 \\u06A9\\u06D2 \\u0633\\u0627\\u0626\\u0632 \\u06A9\\u0648 \\u062E\\u0648\\u062F\\u06A9\\u0627\\u0631 \\u0628\\u0646\\u0627\\u0626\\u06CC\\u06BA",autosizeAllColumns:"\\u062A\\u0645\\u0627\\u0645 \\u06A9\\u0627\\u0644\\u0645 \\u06A9\\u06D2 \\u0633\\u0627\\u0626\\u0632 \\u06A9\\u0648 \\u062E\\u0648\\u062F\\u06A9\\u0627\\u0631 \\u0628\\u0646\\u0627\\u0626\\u06CC\\u06BA",groupBy:"\\u06AF\\u0631\\u0648\\u067E \\u0628\\u0646\\u062F\\u06CC \\u06A9\\u06D2 \\u0630\\u0631\\u06CC\\u0639\\u06D2",ungroupBy:"\\u06AF\\u0631\\u0648\\u067E \\u06A9\\u0648 \\u062E\\u062A\\u0645 \\u06A9\\u0631\\u06CC\\u06BA",ungroupAll:"\\u062A\\u0645\\u0627\\u0645 \\u06AF\\u0631\\u0648\\u067E \\u0628\\u0646\\u062F\\u06CC \\u06A9\\u0648 \\u062E\\u062A\\u0645 \\u06A9\\u0631\\u06CC\\u06BA",addToValues:"${variable} \\u06A9\\u0648 \\u0648\\u06CC\\u0644\\u06CC\\u0648\\u0632 \\u0645\\u06CC\\u06BA \\u0634\\u0627\\u0645\\u0644 \\u06A9\\u0631\\u06CC\\u06BA",removeFromValues:"${variable} \\u06A9\\u0648 \\u0648\\u06CC\\u0644\\u06CC\\u0648\\u0632 \\u0633\\u06D2 \\u06C1\\u0679\\u0627\\u0626\\u06CC\\u06BA",addToLabels:"${variable} \\u06A9\\u0648 \\u0';
      S = S + '644\\u06CC\\u0628\\u0644\\u0632 \\u0645\\u06CC\\u06BA \\u0634\\u0627\\u0645\\u0644 \\u06A9\\u0631\\u06CC\\u06BA",removeFromLabels:"${variable} \\u06A9\\u0648 \\u0644\\u06CC\\u0628\\u0644\\u0632 \\u0633\\u06D2 \\u06C1\\u0679\\u0627\\u0626\\u06CC\\u06BA",resetColumns:"\\u06A9\\u0627\\u0644\\u0645\\u0632 \\u06A9\\u0648 \\u0631\\u06CC \\u0633\\u06CC\\u0679 \\u06A9\\u0631\\u06CC\\u06BA",expandAll:"\\u062A\\u0645\\u0627\\u0645 \\u0642\\u0637\\u0627\\u0631\\u0648\\u06BA \\u06A9\\u06D2 \\u06AF\\u0631\\u0648\\u067E \\u06A9\\u0648 \\u067E\\u06BE\\u06CC\\u0644\\u0627\\u0626\\u06CC\\u06BA",collapseAll:"\\u062A\\u0645\\u0627\\u0645 \\u0642\\u0637\\u0627\\u0631\\u0648\\u06BA \\u06A9\\u06D2 \\u06AF\\u0631\\u0648\\u067E \\u06A9\\u0648 \\u0628\\u0646\\u062F \\u06A9\\u0631\\u06CC\\u06BA",copy:"\\u06A9\\u0627\\u067E\\u06CC",ctrlC:"Ctrl+C",ctrlX:"Ctrl+X",copyWithHeaders:"\\u06C1\\u06CC\\u0688\\u0631\\u0632 \\u06A9\\u06D2 \\u0633\\u0627\\u062A\\u06BE \\u06A9\\u0627\\u067E\\u06CC \\u06A9\\u0631\\u06CC\\u06BA",copyWithGroupHeaders:"\\u06AF\\u0631\\u0648\\u067E \\u06C1\\u06CC\\u0688\\u0631\\u0632 \\u06A9\\u06D2 \\u0633\\u0627\\u062A\\u06BE \\u06A9\\u0627\\u067E\\u06CC \\u06A9\\u0631\\u06CC\\u06BA",cut:"\\u06A9\\u0679",paste:"\\u067E\\u06CC\\u0633\\u0679",ctrlV:"Ctrl+V",export:"\\u0627\\u06CC\\u06A9\\u0633\\u067E\\u0648\\u0631\\u0679",csvExport:"CSV \\u0627\\u06CC\\u06A9\\u0633\\u067E\\u0648\\u0631\\u0679",excelExport:"Excel \\u0627\\u06CC\\u06A9\\u0633\\u067E\\u0648\\u0631\\u0679",columnFilter:"\\u06A9\\u0627\\u0644\\u0645 \\u0641\\u0644\\u0679\\u0631",columnChooser:"\\u06A9\\u0627\\u0644\\u0645\\u0632 \\u06A9\\u0627 \\u0627\\u0646\\u062A\\u062E\\u0627\\u0628 \\u06A9\\u0631\\u06CC\\u06BA",sortAscending:"\\u0627\\u0653\\u0631\\u0648\\u06C1\\u06CC\\u0628\\u06BE\\u06A9 \\u062A\\u0631\\u062A\\u06CC\\u0628",sortDescending:"\\u0632\\u0648\\u0627\\u0644 \\u067E\\u0630\\u06CC\\u0631 \\u062A\\u0631\\u062A\\u06CC\\u0628",sortUnSort:"\\u062A\\u0631\\u062A\\u06CC\\u0628 \\u0645\\u0679\\u0627\\u0626\\u06CC\\u06BA",sum:"\\u0645\\u062C\\u0645\\u0648\\u0639\\u06C1",first:"\\u067E\\u06C1\\u0644\\u0627",last:"\\u0622\\u062E\\u0631\\u06CC",min:"\\u06A9\\u0645 \\u0633\\u06D2 \\u06A9\\u0645",max:"\\u0632\\u06CC\\u0627\\u062F\\u06C1 \\u0633\\u06D2 \\u0632\\u06CC\\u0627\\u0';
      S = S + '62F\\u06C1",none:"\\u06A9\\u0648\\u0626\\u06CC \\u0646\\u06C1\\u06CC\\u06BA",count:"\\u0634\\u0645\\u0627\\u0631",avg:"\\u0627\\u0648\\u0633\\u0637",filteredRows:"\\u0641\\u0644\\u0679\\u0631\\u0688",selectedRows:"\\u0645\\u0646\\u062A\\u062E\\u0628",totalRows:"\\u06A9\\u0644 \\u0642\\u0637\\u0627\\u0631\\u06CC\\u06BA",totalAndFilteredRows:"\\u0642\\u0637\\u0627\\u0631\\u06CC\\u06BA",more:"\\u0645\\u0632\\u06CC\\u062F",to:"\\u06A9\\u0648",of:"\\u06A9\\u0627",page:"\\u0635\\u0641\\u062D\\u06C1",pageLastRowUnknown:"?",nextPage:"\\u0627\\u06AF\\u0644\\u0627 \\u0635\\u0641\\u062D\\u06C1",lastPage:"\\u0622\\u062E\\u0631\\u06CC \\u0635\\u0641\\u062D\\u06C1",firstPage:"\\u067E\\u06C1\\u0644\\u0627 \\u0635\\u0641\\u062D\\u06C1",previousPage:"\\u067E\\u0686\\u06BE\\u0644\\u0627 \\u0635\\u0641\\u062D\\u06C1",pageSizeSelectorLabel:"\\u0635\\u0641\\u062D\\u06C1 \\u06A9\\u0627 \\u0633\\u0627\\u0626\\u0632:",footerTotal:"\\u06A9\\u0644",pivotColumnGroupTotals:"\\u06A9\\u0644",pivotChartAndPivotMode:"\\u067E\\u06CC\\u0648\\u0679 \\u0686\\u0627\\u0631\\u0679 \\u0627\\u0648\\u0631 \\u067E\\u06CC\\u0648\\u0679 \\u0645\\u0648\\u0688",pivotChart:"\\u067E\\u06CC\\u0648\\u0679 \\u0686\\u0627\\u0631\\u0679",chartRange:"\\u0686\\u0627\\u0631\\u0679 \\u0631\\u06CC\\u0646\\u062C",columnChart:"\\u06A9\\u0627\\u0644\\u0645",groupedColumn:"\\u06AF\\u0631\\u0648\\u067E\\u0688",stackedColumn:"\\u0627\\u0633\\u0679\\u06CC\\u06A9\\u0688",normalizedColumn:"100% \\u0627\\u0633\\u0679\\u06CC\\u06A9\\u0688",barChart:"\\u0628\\u0627\\u0631",groupedBar:"\\u06AF\\u0631\\u0648\\u067E\\u0688",stackedBar:"\\u0627\\u0633\\u0679\\u06CC\\u06A9\\u0688",normalizedBar:"100% \\u0627\\u0633\\u0679\\u06CC\\u06A9\\u0688",pieChart:"\\u067E\\u0627\\u0626\\u06CC",pie:"\\u067E\\u0627\\u0626\\u06CC",donut:"\\u0688\\u0648\\u0646\\u0679",line:"\\u0644\\u0627\\u0626\\u0646",xyChart:"\\u0627\\u06CC\\u06A9\\u0633 \\u0648\\u0627\\u0626\\u06CC (\\u0633\\u06A9\\u06CC\\u0679\\u0631)",scatter:"\\u0633\\u06A9\\u06CC\\u0679\\u0631",bubble:"\\u0628\\u0628\\u0644",areaChart:"\\u0627\\u06CC\\u0631\\u06CC\\u0627",area:"\\u0627\\u06CC\\u0631\\u06CC\\u0627",stackedArea:"\\u0627\\u0633\\u0679\\u06CC\\u06A9\\u0688",normalizedArea:"100% \\u0627\\u0633\\u0679\\u06CC\\u06A9';
      S = S + '\\u0688",histogramChart:"\\u06C1\\u0633\\u0679\\u0648\\u06AF\\u0631\\u0627\\u0645",polarChart:"\\u067E\\u0648\\u0644\\u0631",radarLine:"\\u0631\\u0627\\u0688\\u0627\\u0631 \\u0644\\u0627\\u0626\\u0646",radarArea:"\\u0631\\u0627\\u0688\\u0627\\u0631 \\u0627\\u06CC\\u0631\\u06CC\\u0627",nightingale:"\\u0646\\u0627\\u0626\\u0679\\u06CC\\u0646\\u06AF\\u06CC\\u0644",radialColumn:"\\u0631\\u06CC\\u0688\\u06CC\\u0644 \\u06A9\\u0627\\u0644\\u0645",radialBar:"\\u0631\\u06CC\\u0688\\u06CC\\u0644 \\u0628\\u0627\\u0631",statisticalChart:"\\u0634\\u0645\\u0627\\u0631\\u06CC\\u0627\\u062A\\u06CC",boxPlot:"\\u0628\\u0627\\u06A9\\u0633 \\u067E\\u0644\\u0627\\u0679",rangeBar:"\\u0631\\u06CC\\u0646\\u062C \\u0628\\u0627\\u0631",rangeArea:"\\u0631\\u06CC\\u0646\\u062C \\u0627\\u06CC\\u0631\\u06CC\\u0627",hierarchicalChart:"\\u0645\\u0631\\u062A\\u0628",treemap:"\\u0679\\u0631\\u06CC \\u0645\\u06CC\\u067E",sunburst:"\\u0633\\u0646 \\u0628\\u0631\\u0633\\u0679",specializedChart:"\\u062E\\u0635\\u0648\\u0635\\u06CC",waterfall:"\\u0648\\u0627\\u0679\\u0631 \\u0641\\u0627\\u0644",heatmap:"\\u06C1\\u06CC\\u0679 \\u0645\\u06CC\\u067E",combinationChart:"\\u06A9\\u0645\\u0628\\u06CC\\u0646\\u06CC\\u0634\\u0646",columnLineCombo:"\\u06A9\\u0627\\u0644\\u0645 \\u0627\\u0648\\u0631 \\u0644\\u0627\\u0626\\u0646",AreaColumnCombo:"\\u0627\\u06CC\\u0631\\u06CC\\u0627 \\u0627\\u0648\\u0631 \\u06A9\\u0627\\u0644\\u0645",pivotChartTitle:"\\u067E\\u06CC\\u0648\\u0679 \\u0686\\u0627\\u0631\\u0679",rangeChartTitle:"\\u0631\\u06CC\\u0646\\u062C \\u0686\\u0627\\u0631\\u0679",settings:"\\u0686\\u0627\\u0631\\u0679",data:"\\u062A\\u0631\\u062A\\u06CC\\u0628",format:"\\u062D\\u0633\\u0628 \\u0636\\u0631\\u0648\\u0631\\u062A",categories:"\\u0632\\u0645\\u0631\\u06D2",defaultCategory:"(\\u06A9\\u0648\\u0626\\u06CC \\u0646\\u06C1\\u06CC\\u06BA)",series:"\\u0633\\u06CC\\u0631\\u06CC\\u0632",switchCategorySeries:"\\u0632\\u0645\\u0631\\u06C1 / \\u0633\\u06CC\\u0631\\u06CC\\u0632 \\u062A\\u0628\\u062F\\u06CC\\u0644\\u06CC \\u06A9\\u0631\\u06CC\\u06BA",categoryValues:"\\u0632\\u0645\\u0631\\u06C1 \\u06A9\\u06CC \\u0642\\u062F\\u0631\\u06CC\\u06BA",seriesLabels:"\\u0633\\u06CC\\u0631\\u06CC\\u0632 \\u0644\\u06CC\\u0628\\u0644\\u0632",aggregate:"\\u0645\\u062C\\u0';
      S = S + '645\\u0648\\u0639\\u06CC",xyValues:"\\u0627\\u06CC\\u06A9\\u0633 \\u0648\\u0627\\u0626\\u06CC \\u0642\\u062F\\u0631\\u06CC\\u06BA",paired:"\\u062C\\u0648\\u0691\\u0627 \\u0645\\u0648\\u0688",axis:"\\u0645\\u062D\\u0648\\u0631",xAxis:"\\u0627\\u0641\\u0642\\u06CC \\u0645\\u062D\\u0648\\u0631",yAxis:"\\u0639\\u0645\\u0648\\u062F\\u06CC \\u0645\\u062D\\u0648\\u0631",polarAxis:"\\u067E\\u0648\\u0644\\u0631 \\u0645\\u062D\\u0648\\u0631",radiusAxis:"\\u0631\\u06CC\\u0688\\u06CC\\u0626\\u0633 \\u0645\\u062D\\u0648\\u0631",navigator:"\\u0646\\u06CC\\u0648\\u06CC \\u06AF\\u06CC\\u0679\\u0631",zoom:"\\u0632\\u0648\\u0645",animation:"\\u062D\\u0631\\u06A9\\u062A",crosshair:"\\u06A9\\u0631\\u0627\\u0633 \\u06C1\\u0626\\u06CC\\u0631",color:"\\u0631\\u0646\\u06AF",thickness:"\\u0645\\u0648\\u0679\\u0627\\u0626\\u06CC",preferredLength:"\\u067E\\u0633\\u0646\\u062F\\u06CC\\u062F\\u06C1 \\u0644\\u0645\\u0628\\u0627\\u0626\\u06CC",xType:"\\u0627\\u06CC\\u06A9\\u0633 \\u0642\\u0633\\u0645",axisType:"\\u0645\\u062D\\u0648\\u0631 \\u06A9\\u06CC \\u0642\\u0633\\u0645",automatic:"\\u062E\\u0648\\u062F\\u06A9\\u0627\\u0631",category:"\\u0632\\u0645\\u0631\\u06C1",number:"\\u0646\\u0645\\u0628\\u0631",time:"\\u0648\\u0642\\u062A",timeFormat:"\\u0648\\u0642\\u062A \\u06A9\\u06CC \\u0634\\u06A9\\u0644",autoRotate:"\\u062E\\u0648\\u062F\\u06A9\\u0627\\u0631 \\u06AF\\u06BE\\u0645\\u0627\\u0624",labelRotation:"\\u06AF\\u06BE\\u0645\\u0627\\u0624",circle:"\\u06AF\\u0648\\u0644",polygon:"\\u06A9\\u062B\\u06CC\\u0631\\u0627\\u0644\\u0627\\u0636\\u0644\\u0627\\u0639",square:"\\u0686\\u0648\\u06A9\\u0648\\u0631",cross:"\\u06A9\\u0631\\u0627\\u0633",diamond:"\\u06C1\\u06CC\\u0631\\u06D2",plus:"\\u067E\\u0644\\u0633",triangle:"\\u062A\\u06A9\\u0648\\u0646",heart:"\\u062F\\u0644",orientation:"\\u062A\\u0631\\u062C\\u06CC\\u062D",fixed:"\\u0645\\u0633\\u062A\\u062D\\u06A9\\u0645",parallel:"\\u0645\\u062A\\u0648\\u0627\\u0632\\u06CC",perpendicular:"\\u0639\\u0645\\u0648\\u062F\\u06CC",radiusAxisPosition:"\\u0645\\u0642\\u0627\\u0645",ticks:"\\u0679\\u06A9\\u0633",gridLines:"\\u06AF\\u0631\\u0688 \\u0644\\u0627\\u0626\\u0646\\u0633",width:"\\u0686\\u0648\\u0691\\u0627\\u0626\\u06CC",height:"\\u0627\\u0648\\u0646\\u0686\\u0627\\u0626\\u06CC",length:"\\u';
      S = S + '0644\\u0645\\u0628\\u0627\\u0626\\u06CC",padding:"\\u067E\\u06CC\\u0688\\u0646\\u06AF",spacing:"\\u0641\\u0627\\u0635\\u0644\\u06C1",chartStyle:"\\u0686\\u0627\\u0631\\u0679 \\u0627\\u0646\\u062F\\u0627\\u0632",title:"\\u0639\\u0646\\u0648\\u0627\\u0646",chartTitles:"\\u0639\\u0646\\u0648\\u0627\\u0646\\u0627\\u062A",chartTitle:"\\u0686\\u0627\\u0631\\u0679 \\u0639\\u0646\\u0648\\u0627\\u0646",chartSubtitle:"\\u0630\\u06CC\\u0644\\u06CC \\u0639\\u0646\\u0648\\u0627\\u0646",horizontalAxisTitle:"\\u0627\\u0641\\u0642\\u06CC \\u0645\\u062D\\u0648\\u0631 \\u0639\\u0646\\u0648\\u0627\\u0646",verticalAxisTitle:"\\u0639\\u0645\\u0648\\u062F\\u06CC \\u0645\\u062D\\u0648\\u0631 \\u0639\\u0646\\u0648\\u0627\\u0646",polarAxisTitle:"\\u067E\\u0648\\u0644\\u0631 \\u0645\\u062D\\u0648\\u0631 \\u0639\\u0646\\u0648\\u0627\\u0646",titlePlaceholder:"\\u0686\\u0627\\u0631\\u0679 \\u0639\\u0646\\u0648\\u0627\\u0646",background:"\\u067E\\u0633 \\u0645\\u0646\\u0638\\u0631",font:"\\u0641\\u0648\\u0646\\u0679",weight:"\\u0648\\u0632\\u0646",top:"\\u0627\\u0648\\u067E\\u0631",right:"\\u062F\\u0627\\u0626\\u06CC\\u06BA",bottom:"\\u0646\\u06CC\\u0686\\u06D2",left:"\\u0628\\u0627\\u0626\\u06CC\\u06BA",labels:"\\u0644\\u06CC\\u0628\\u0644\\u0632",calloutLabels:"\\u06A9\\u0627\\u0644 \\u0622\\u0624\\u0679 \\u0644\\u06CC\\u0628\\u0644",sectorLabels:"\\u0633\\u06CC\\u06A9\\u0679\\u0631 \\u0644\\u06CC\\u0628\\u0644\\u0632",positionRatio:"\\u0645\\u0642\\u0627\\u0645 \\u062A\\u0646\\u0627\\u0633\\u0628",size:"\\u0633\\u0627\\u0626\\u0632",shape:"\\u0634\\u06A9\\u0644",minSize:"\\u06A9\\u0645 \\u0627\\u0632 \\u06A9\\u0645 \\u0633\\u0627\\u0626\\u0632",maxSize:"\\u0632\\u06CC\\u0627\\u062F\\u06C1 \\u0633\\u06D2 \\u0632\\u06CC\\u0627\\u062F\\u06C1 \\u0633\\u0627\\u0626\\u0632",legend:"\\u0644\\u06CC\\u062C\\u0646\\u0688",position:"\\u0645\\u0642\\u0627\\u0645",markerSize:"\\u0645\\u0627\\u0631\\u06A9\\u0631 \\u0633\\u0627\\u0626\\u0632",markerStroke:"\\u0645\\u0627\\u0631\\u06A9\\u0631 \\u0627\\u0633\\u0679\\u0631\\u0648\\u06A9",markerPadding:"\\u0645\\u0627\\u0631\\u06A9\\u0631 \\u067E\\u06CC\\u0688\\u0646\\u06AF",itemSpacing:"\\u0622\\u0626\\u0679\\u0645 \\u0641\\u0627\\u0635\\u0644\\u06C1",itemPaddingX:"\\u0622\\u0626\\u0679\\u0645 \\u067E\\u06CC\\u';
      S = S + '0688\\u0646\\u06AF \\u0627\\u06CC\\u06A9\\u0633",itemPaddingY:"\\u0622\\u0626\\u0679\\u0645 \\u067E\\u06CC\\u0688\\u0646\\u06AF \\u0648\\u0627\\u0626\\u06CC",layoutHorizontalSpacing:"\\u0627\\u0641\\u0642\\u06CC \\u0641\\u0627\\u0635\\u0644\\u06C1",layoutVerticalSpacing:"\\u0639\\u0645\\u0648\\u062F\\u06CC \\u0641\\u0627\\u0635\\u0644\\u06C1",strokeWidth:"\\u0627\\u0633\\u0679\\u0631\\u0648\\u06A9 \\u0686\\u0648\\u0691\\u0627\\u0626\\u06CC",offset:"\\u0622\\u0641\\u0633\\u06CC\\u0679",offsets:"\\u0622\\u0641\\u0633\\u06CC\\u0679\\u0633",tooltips:"\\u0679\\u0648\\u0644 \\u0679\\u067E\\u0633",callout:"\\u06A9\\u0627\\u0644 \\u0622\\u0624\\u0679",markers:"\\u0645\\u0627\\u0631\\u06A9\\u0631\\u0632",shadow:"\\u0633\\u0627\\u06CC\\u0627",blur:"\\u062F\\u06BE\\u0646\\u062F\\u0644\\u0627\\u06C1\\u0679",xOffset:"\\u0627\\u06CC\\u06A9\\u0633 \\u0622\\u0641\\u0633\\u06CC\\u0679",yOffset:"\\u0648\\u0627\\u0626\\u06CC \\u0622\\u0641\\u0633\\u06CC\\u0679",lineWidth:"\\u0644\\u0627\\u0626\\u0646 \\u0686\\u0648\\u0691\\u0627\\u0626\\u06CC",lineDash:"\\u0644\\u0627\\u0626\\u0646 \\u0688\\u06CC\\u0634",lineDashOffset:"\\u0688\\u06CC\\u0634 \\u0622\\u0641\\u0633\\u06CC\\u0679",scrollingZoom:"\\u0627\\u0633\\u06A9\\u0631\\u0648\\u0644\\u0646\\u06AF",scrollingStep:"\\u0627\\u0633\\u06A9\\u0631\\u0648\\u0644\\u0646\\u06AF \\u0642\\u062F\\u0645",selectingZoom:"\\u0645\\u0646\\u062A\\u062E\\u0628 \\u06A9\\u0631\\u0646\\u0627",durationMillis:"\\u062F\\u0648\\u0631\\u0627\\u0646\\u06CC\\u06C1 (\\u0645\\u0644\\u06CC \\u0633\\u06CC\\u06A9\\u0646\\u0688)",crosshairLabel:"\\u0644\\u06CC\\u0628\\u0644",crosshairSnap:"\\u0646\\u0648\\u0688 \\u067E\\u0631 \\u0627\\u0633\\u0646\\u06CC\\u067E",normal:"\\u0646\\u0627\\u0631\\u0645\\u0644",bold:"\\u0628\\u0648\\u0644\\u0688",italic:"\\u0645\\u0627\\u0626\\u0644",boldItalic:"\\u0628\\u0648\\u0644\\u0688 \\u0645\\u0627\\u0626\\u0644",predefined:"\\u067E\\u06C1\\u0644\\u06D2 \\u0633\\u06D2 \\u0637\\u06D2 \\u0634\\u062F\\u06C1",fillOpacity:"\\u0628\\u06BE\\u0631\\u0627\\u0624 \\u06A9\\u06CC \\u0634\\u0641\\u0627\\u0641\\u06CC\\u062A",strokeColor:"\\u0644\\u0627\\u0626\\u0646 \\u06A9\\u0627 \\u0631\\u0646\\u06AF",strokeOpacity:"\\u0644\\u0627\\u0626\\u0646 \\u06A9\\u06CC \\u0634\\u0641\\u0627\\u0641\\u06CC\\';
      S = S + 'u062A",miniChart:"\\u0645\\u0646\\u06CC \\u0686\\u0627\\u0631\\u0679",histogramBinCount:"\\u0628\\u06CC\\u0646 \\u0634\\u0645\\u0627\\u0631",connectorLine:"\\u06A9\\u0646\\u06CC\\u06A9\\u0679\\u0631 \\u0644\\u0627\\u0626\\u0646",seriesItems:"\\u0633\\u06CC\\u0631\\u06CC\\u0632 \\u0622\\u0626\\u0679\\u0645\\u0632",seriesItemType:"\\u0622\\u0626\\u0679\\u0645 \\u06A9\\u06CC \\u0642\\u0633\\u0645",seriesItemPositive:"\\u0645\\u062B\\u0628\\u062A",seriesItemNegative:"\\u0645\\u0646\\u0641\\u06CC",seriesItemLabels:"\\u0622\\u0626\\u0679\\u0645 \\u0644\\u06CC\\u0628\\u0644\\u0632",columnGroup:"\\u06A9\\u0627\\u0644\\u0645",barGroup:"\\u0628\\u0627\\u0631",pieGroup:"\\u067E\\u0627\\u0626",lineGroup:"\\u0644\\u0627\\u0626\\u0646",scatterGroup:"\\u0627\\u06CC\\u06A9\\u0633 \\u0648\\u0627\\u0626\\u06CC (\\u0627\\u0633\\u06A9\\u06CC\\u0679\\u0631)",areaGroup:"\\u0639\\u0644\\u0627\\u0642\\u06C1",polarGroup:"\\u067E\\u0648\\u0644\\u0631",statisticalGroup:"\\u0634\\u0645\\u0627\\u0631\\u06CC\\u0627\\u062A\\u06CC",hierarchicalGroup:"\\u062F\\u0631\\u062C\\u06C1 \\u0628\\u0646\\u062F\\u06CC",specializedGroup:"\\u0645\\u062A\\u062E\\u0635\\u0635",combinationGroup:"\\u0645\\u062C\\u0645\\u0648\\u0639\\u06C1",groupedColumnTooltip:"\\u06AF\\u0631\\u0648\\u067E",stackedColumnTooltip:"\\u0627\\u0633\\u0679\\u06CC\\u06A9",normalizedColumnTooltip:"100% \\u0627\\u0633\\u0679\\u06CC\\u06A9",groupedBarTooltip:"\\u06AF\\u0631\\u0648\\u067E",stackedBarTooltip:"\\u0627\\u0633\\u0679\\u06CC\\u06A9",normalizedBarTooltip:"100% \\u0627\\u0633\\u0679\\u06CC\\u06A9",pieTooltip:"\\u067E\\u0627\\u0626",donutTooltip:"\\u0688\\u0648\\u0646\\u0679",lineTooltip:"\\u0644\\u0627\\u0626\\u0646",groupedAreaTooltip:"\\u0639\\u0644\\u0627\\u0642\\u06C1",stackedAreaTooltip:"\\u0627\\u0633\\u0679\\u06CC\\u06A9",normalizedAreaTooltip:"100% \\u0627\\u0633\\u0679\\u06CC\\u06A9",scatterTooltip:"\\u0627\\u0633\\u06A9\\u06CC\\u0679\\u0631",bubbleTooltip:"\\u0628\\u0627\\u0628\\u0644",histogramTooltip:"\\u06C1\\u0633\\u0679\\u0648\\u0631\\u06AF\\u0631\\u0627\\u0645",radialColumnTooltip:"\\u0631\\u06CC\\u0688\\u06CC\\u0626\\u0644 \\u06A9\\u0627\\u0644\\u0645",radialBarTooltip:"\\u0631\\u06CC\\u0688\\u06CC\\u0626\\u0644 \\u0628\\u062';
      S = S + '7\\u0631",radarLineTooltip:"\\u0631\\u06CC\\u0688\\u0627\\u0631 \\u0644\\u0627\\u0626\\u0646",radarAreaTooltip:"\\u0631\\u06CC\\u0688\\u0627\\u0631 \\u0639\\u0644\\u0627\\u0642\\u06C1",nightingaleTooltip:"\\u0646\\u0627\\u0626\\u0679\\u06CC\\u0646\\u06AF\\u0644",rangeBarTooltip:"\\u0631\\u06CC\\u0646\\u062C \\u0628\\u0627\\u0631",rangeAreaTooltip:"\\u0631\\u06CC\\u0646\\u062C \\u0639\\u0644\\u0627\\u0642\\u06C1",boxPlotTooltip:"\\u0628\\u0627\\u06A9\\u0633 \\u067E\\u0644\\u0627\\u0679",treemapTooltip:"\\u0679\\u0631\\u06CC \\u0645\\u06CC\\u067E",sunburstTooltip:"\\u0633\\u0646 \\u0628\\u0631\\u0633\\u0679",waterfallTooltip:"\\u0648\\u0627\\u0679\\u0631\\u0641\\u0627\\u0644",heatmapTooltip:"\\u06C1\\u06CC\\u0679 \\u0645\\u06CC\\u067E",columnLineComboTooltip:"\\u06A9\\u0627\\u0644\\u0645 \\u0648 \\u0644\\u0627\\u0626\\u0646",areaColumnComboTooltip:"\\u0639\\u0644\\u0627\\u0642\\u06C1 \\u0648 \\u06A9\\u0627\\u0644\\u0645",customComboTooltip:"\\u062D\\u0633\\u0628 \\u0645\\u0646\\u0634\\u0627 \\u0645\\u062C\\u0645\\u0648\\u0639\\u06C1",innerRadius:"\\u0627\\u0646\\u062F\\u0631\\u0648\\u0646\\u06CC \\u0634\\u0639\\u0627\\u0639",startAngle:"\\u0622\\u063A\\u0627\\u0632 \\u0632\\u0627\\u0648\\u06CC\\u06C1",endAngle:"\\u0627\\u062E\\u062A\\u062A\\u0627\\u0645\\u06CC \\u0632\\u0627\\u0648\\u06CC\\u06C1",reverseDirection:"\\u0627\\u0644\\u0679\\u06CC \\u0633\\u0645\\u062A",groupPadding:"\\u06AF\\u0631\\u0648\\u067E \\u067E\\u06CC\\u0688\\u0646\\u06AF",seriesPadding:"\\u0633\\u06CC\\u0631\\u06CC\\u0632 \\u067E\\u06CC\\u0688\\u0646\\u06AF",tile:"\\u0679\\u0627\\u0626\\u0644",whisker:"\\u0648\\u0633\\u06A9\\u0631",cap:"\\u06A9\\u06CC\\u067E",capLengthRatio:"\\u0644\\u0645\\u0628\\u0627\\u0626\\u06CC \\u062A\\u0646\\u0627\\u0633\\u0628",labelPlacement:"\\u0644\\u06CC\\u0628\\u0644 \\u06A9\\u06CC \\u062C\\u06AF\\u06C1",inside:"\\u0627\\u0646\\u062F\\u0631",outside:"\\u0628\\u0627\\u06C1\\u0631",noDataToChart:"\\u06A9\\u0648\\u0626\\u06CC \\u062F\\u0633\\u062A\\u06CC\\u0627\\u0628 \\u0688\\u06CC\\u0679\\u0627 \\u0686\\u0627\\u0631\\u0679 \\u0628\\u0646\\u0627\\u0646\\u06D2 \\u06A9\\u06D2 \\u0644\\u06CC\\u06D2 \\u0646\\u06C1\\u06CC\\u06BA \\u06C1\\u06D2\\u06D4",pivotChartRequiresPivotMode:"\\u067E\\u06CC\\u0648\\u0679 \\u06';
      S = S + '86\\u0627\\u0631\\u0679 \\u06A9\\u06CC\\u0644\\u0626\\u06D2 \\u067E\\u06CC\\u0648\\u0679 \\u0645\\u0648\\u0688 \\u062C\\u0627\\u0631\\u06CC \\u06A9\\u0631\\u0646\\u0627 \\u0636\\u0631\\u0648\\u0631\\u06CC \\u06C1\\u06D2\\u06D4",chartSettingsToolbarTooltip:"\\u0645\\u06CC\\u0646\\u0648",chartLinkToolbarTooltip:"\\u06AF\\u0631\\u0688 \\u0633\\u06D2 \\u0645\\u0631\\u0628\\u0648\\u0637",chartUnlinkToolbarTooltip:"\\u06AF\\u0631\\u0688 \\u0633\\u06D2 \\u063A\\u06CC\\u0631 \\u0645\\u0631\\u0628\\u0648\\u0637",chartDownloadToolbarTooltip:"\\u0686\\u0627\\u0631\\u0679 \\u0688\\u0627\\u0624\\u0646 \\u0644\\u0648\\u0688 \\u06A9\\u0631\\u06CC\\u06BA",chartMenuToolbarTooltip:"\\u0645\\u06CC\\u0646\\u0648",chartEdit:"\\u0686\\u0627\\u0631\\u0679 \\u0645\\u06CC\\u06BA \\u062A\\u0631\\u0645\\u06CC\\u0645 \\u06A9\\u0631\\u06CC\\u06BA",chartAdvancedSettings:"\\u0627\\u0639\\u0644\\u06CC \\u062A\\u0631\\u062A\\u06CC\\u0628\\u0627\\u062A",chartLink:"\\u06AF\\u0631\\u0688 \\u0633\\u06D2 \\u0645\\u0631\\u0628\\u0648\\u0637 \\u06A9\\u0631\\u06CC\\u06BA",chartUnlink:"\\u06AF\\u0631\\u0688 \\u0633\\u06D2 \\u063A\\u06CC\\u0631 \\u0645\\u0631\\u0628\\u0648\\u0637 \\u06A9\\u0631\\u06CC\\u06BA",chartDownload:"\\u0686\\u0627\\u0631\\u0679 \\u0688\\u0627\\u0624\\u0646 \\u0644\\u0648\\u0688 \\u06A9\\u0631\\u06CC\\u06BA",histogramFrequency:"\\u062A\\u0648\\u0627\\u062A\\u0631",seriesChartType:"\\u0633\\u06CC\\u0631\\u06CC\\u0632 \\u0686\\u0627\\u0631\\u0679 \\u0642\\u0633\\u0645",seriesType:"\\u0633\\u06CC\\u0631\\u06CC\\u0632 \\u0642\\u0633\\u0645",secondaryAxis:"\\u062B\\u0627\\u0646\\u0648\\u06CC \\u0645\\u062D\\u0648\\u0631",seriesAdd:"\\u0633\\u06CC\\u0631\\u06CC\\u0632 \\u0634\\u0627\\u0645\\u0644 \\u06A9\\u0631\\u06CC\\u06BA",categoryAdd:"\\u0632\\u0645\\u0631\\u06C1 \\u0634\\u0627\\u0645\\u0644 \\u06A9\\u0631\\u06CC\\u06BA",bar:"\\u0628\\u0627\\u0631",column:"\\u06A9\\u0627\\u0644\\u0645",histogram:"\\u06C1\\u0633\\u0679\\u0648\\u0631\\u06AF\\u0631\\u0627\\u0645",advancedSettings:"\\u0627\\u0639\\u0644\\u06CC \\u062A\\u0631\\u062A\\u06CC\\u0628\\u0627\\u062A",direction:"\\u0633\\u0645\\u062A",horizontal:"\\u0627\\u0641\\u0642\\u06CC",vertical:"\\u0639\\u0645\\u0648\\u062F\\u06CC",seriesGroupType:"\\u06AF\\u0631\\u0648\\u067E \\u06A9\\u06C';
      S = S + 'C \\u0642\\u0633\\u0645",groupedSeriesGroupType:"\\u06AF\\u0631\\u0648\\u067E",stackedSeriesGroupType:"\\u0627\\u0633\\u0679\\u06CC\\u06A9",normalizedSeriesGroupType:"100% \\u0627\\u0633\\u0679\\u06CC\\u06A9",legendEnabled:"\\u0641\\u0639\\u0627\\u0644",invalidColor:"\\u0631\\u0646\\u06AF \\u06A9\\u06CC \\u0642\\u06CC\\u0645\\u062A \\u063A\\u0644\\u0637 \\u06C1\\u06D2",groupedColumnFull:"\\u06AF\\u0631\\u0648\\u067E \\u06A9\\u0627\\u0644\\u0645",stackedColumnFull:"\\u0627\\u0633\\u0679\\u06CC\\u06A9 \\u06A9\\u0627\\u0644\\u0645",normalizedColumnFull:"100% \\u0627\\u0633\\u0679\\u06CC\\u06A9 \\u06A9\\u0627\\u0644\\u0645",groupedBarFull:"\\u06AF\\u0631\\u0648\\u067E \\u0628\\u0627\\u0631",stackedBarFull:"\\u0627\\u0633\\u0679\\u06CC\\u06A9 \\u0628\\u0627\\u0631",normalizedBarFull:"100% \\u0627\\u0633\\u0679\\u06CC\\u06A9 \\u0628\\u0627\\u0631",stackedAreaFull:"\\u0627\\u0633\\u0679\\u06CC\\u06A9 \\u0639\\u0644\\u0627\\u0642\\u06C1",normalizedAreaFull:"100% \\u0627\\u0633\\u0679\\u06CC\\u06A9 \\u0639\\u0644\\u0627\\u0642\\u06C1",customCombo:"\\u062D\\u0633\\u0628 \\u0645\\u0646\\u0634\\u0627 \\u0645\\u062C\\u0645\\u0648\\u0639\\u06C1",ariaAdvancedFilterBuilderItem:"${variable}. \\u0633\\u0637\\u062D ${variable}. \\u062A\\u0631\\u0645\\u06CC\\u0645 \\u06A9\\u06D2 \\u0644\\u06CC\\u06D2 ENTER \\u062F\\u0628\\u0627\\u0626\\u06CC\\u06BA.",ariaAdvancedFilterBuilderItemValidation:"${variable}. \\u0633\\u0637\\u062D ${variable}. ${variable} \\u062A\\u0631\\u0645\\u06CC\\u0645 \\u06A9\\u06D2 \\u0644\\u06CC\\u06D2 ENTER \\u062F\\u0628\\u0627\\u0626\\u06CC\\u06BA.",ariaAdvancedFilterBuilderList:"\\u0627\\u06CC\\u0688\\u0648\\u0627\\u0646\\u0633\\u0688 \\u0641\\u0644\\u0679\\u0631 \\u0628\\u0644\\u0688\\u0631 \\u0641\\u06C1\\u0631\\u0633\\u062A",ariaAdvancedFilterBuilderFilterItem:"\\u0641\\u0644\\u0679\\u0631 \\u0634\\u0631\\u0637",ariaAdvancedFilterBuilderGroupItem:"\\u0641\\u0644\\u0679\\u0631 \\u06AF\\u0631\\u0648\\u067E",ariaAdvancedFilterBuilderColumn:"\\u06A9\\u0627\\u0644\\u0645",ariaAdvancedFilterBuilderOption:"\\u0627\\u062E\\u062A\\u06CC\\u0627\\u0631",ariaAdvancedFilterBuilderValueP:"\\u0642\\u062F\\u0631",ariaAdvancedFilterBuilderJoinOperator:"\\u062C\\u0648\\u0627\\u0626';
      S = S + '\\u0646 \\u0627\\u067E\\u0631\\u06CC\\u0679\\u0631",ariaAdvancedFilterInput:"\\u0627\\u06CC\\u0688\\u0648\\u0627\\u0646\\u0633\\u0688 \\u0641\\u0644\\u0679\\u0631 \\u0627\\u0646\\u067E\\u0679",ariaChecked:"\\u0686\\u06CC\\u06A9\\u0688",ariaColumn:"\\u06A9\\u0627\\u0644\\u0645",ariaColumnGroup:"\\u06A9\\u0627\\u0644\\u0645 \\u06AF\\u0631\\u0648\\u067E",ariaColumnFiltered:"\\u06A9\\u0627\\u0644\\u0645 \\u0641\\u0644\\u0679\\u0631\\u0688",ariaColumnSelectAll:"\\u062A\\u0645\\u0627\\u0645 \\u06A9\\u0627\\u0644\\u0645\\u0632 \\u06A9\\u0648 \\u0645\\u0646\\u062A\\u062E\\u0628 \\u06A9\\u0631\\u0646\\u06D2 \\u06A9\\u06CC \\u0679\\u0648\\u06AF\\u0644 \\u06A9\\u0631\\u06CC\\u06BA",ariaDateFilterInput:"\\u062A\\u0627\\u0631\\u06CC\\u062E \\u0641\\u0644\\u0679\\u0631 \\u0627\\u0646\\u067E\\u0679",ariaDefaultListName:"\\u0641\\u06C1\\u0631\\u0633\\u062A",ariaFilterColumnsInput:"\\u06A9\\u0627\\u0644\\u0645\\u0632 \\u0641\\u0644\\u0679\\u0631 \\u0627\\u0646\\u067E\\u0679",ariaFilterFromValue:"\\u0642\\u062F\\u0631 \\u0633\\u06D2 \\u0641\\u0644\\u0679\\u0631 \\u06A9\\u0631\\u06CC\\u06BA",ariaFilterInput:"\\u0641\\u0644\\u0679\\u0631 \\u0627\\u0646\\u067E\\u0679",ariaFilterList:"\\u0641\\u0644\\u0679\\u0631 \\u0641\\u06C1\\u0631\\u0633\\u062A",ariaFilterToValue:"\\u0642\\u062F\\u0631 \\u062A\\u06A9 \\u0641\\u0644\\u0679\\u0631 \\u06A9\\u0631\\u06CC\\u06BA",ariaFilterValue:"\\u0641\\u0644\\u0679\\u0631 \\u0642\\u062F\\u0631",ariaFilterMenuOpen:"\\u0641\\u0644\\u0679\\u0631 \\u0645\\u06CC\\u0646\\u0648 \\u06A9\\u06BE\\u0648\\u0644\\u06CC\\u06BA",ariaFilteringOperator:"\\u0641\\u0644\\u0679\\u0631\\u0646\\u06AF \\u0627\\u067E\\u0631\\u06CC\\u0679\\u0631",ariaHidden:"\\u0686\\u06BE\\u067E\\u0627 \\u06C1\\u0648\\u0627",ariaIndeterminate:"\\u063A\\u06CC\\u0631 \\u0645\\u0633\\u062A\\u062D\\u06A9\\u0645",ariaInputEditor:"\\u0627\\u0646\\u067E\\u0679 \\u0627\\u06CC\\u0688\\u06CC\\u0679\\u0631",ariaMenuColumn:"\\u06A9\\u0627\\u0644\\u0645 \\u0645\\u06CC\\u0646\\u0648 \\u06A9\\u06BE\\u0648\\u0644\\u0646\\u06D2 \\u06A9\\u06D2 \\u0644\\u06CC\\u06D2 ALT DOWN \\u062F\\u0628\\u0627\\u0626\\u06CC\\u06BA",ariaFilterColumn:"\\u0641\\u0644\\u0679\\u0631 \\u06A9\\u06BE\\u0648\\u0644\\u0646\\u06D2 \\u06A9\\u06D2 \\u0644\\u06CC\\u06D2 CTRL ENTER \\u0';
      S = S + '62F\\u0628\\u0627\\u0626\\u06CC\\u06BA",ariaRowDeselect:"\\u0627\\u0633 \\u0635\\u0641 \\u06A9\\u0648 \\u063A\\u06CC\\u0631 \\u0645\\u0646\\u062A\\u062E\\u0628 \\u06A9\\u0631\\u0646\\u06D2 \\u06A9\\u06D2 \\u0644\\u06CC\\u06D2 SPACE \\u062F\\u0628\\u0627\\u0626\\u06CC\\u06BA",ariaRowSelectAll:"\\u062A\\u0645\\u0627\\u0645 \\u0635\\u0641\\u0648\\u06BA \\u06A9\\u0627 \\u0627\\u0646\\u062A\\u062E\\u0627\\u0628 \\u0679\\u0648\\u06AF\\u0644 \\u06A9\\u0631\\u0646\\u06D2 \\u06A9\\u06D2 \\u0644\\u06CC\\u06D2 SPACE \\u062F\\u0628\\u0627\\u0626\\u06CC\\u06BA",ariaRowToggleSelection:"\\u0635\\u0641 \\u06A9\\u0627 \\u0627\\u0646\\u062A\\u062E\\u0627\\u0628 \\u0679\\u0648\\u06AF\\u0644 \\u06A9\\u0631\\u0646\\u06D2 \\u06A9\\u06D2 \\u0644\\u06CC\\u06D2 SPACE \\u062F\\u0628\\u0627\\u0626\\u06CC\\u06BA",ariaRowSelect:"\\u0627\\u0633 \\u0635\\u0641 \\u06A9\\u0648 \\u0645\\u0646\\u062A\\u062E\\u0628 \\u06A9\\u0631\\u0646\\u06D2 \\u06A9\\u06D2 \\u0644\\u06CC\\u06D2 SPACE \\u062F\\u0628\\u0627\\u0626\\u06CC\\u06BA",ariaRowSelectionDisabled:"\\u0627\\u0633 \\u0635\\u0641 \\u06A9\\u0627 \\u0627\\u0646\\u062A\\u062E\\u0627\\u0628 \\u063A\\u06CC\\u0631 \\u0641\\u0639\\u0627\\u0644 \\u06C1\\u06D2",ariaSearch:"\\u062A\\u0644\\u0627\\u0634",ariaSortableColumn:"\\u062A\\u0631\\u062A\\u06CC\\u0628 \\u062F\\u06CC\\u0646\\u06D2 \\u06A9\\u06D2 \\u0644\\u06CC\\u06D2 ENTER \\u062F\\u0628\\u0627\\u0626\\u06CC\\u06BA",ariaToggleVisibility:"\\u0645\\u0631\\u0626\\u06CC\\u062A \\u0679\\u0648\\u06AF\\u0644 \\u06A9\\u0631\\u0646\\u06D2 \\u06A9\\u06D2 \\u0644\\u06CC\\u06D2 SPACE \\u062F\\u0628\\u0627\\u0626\\u06CC\\u06BA",ariaToggleCellValue:"\\u0633\\u06CC\\u0644 \\u06A9\\u06CC \\u0642\\u062F\\u0631 \\u0679\\u0648\\u06AF\\u0644 \\u06A9\\u0631\\u0646\\u06D2 \\u06A9\\u06D2 \\u0644\\u06CC\\u06D2 SPACE \\u062F\\u0628\\u0627\\u0626\\u06CC\\u06BA",ariaUnchecked:"\\u063A\\u06CC\\u0631 \\u0686\\u06CC\\u06A9\\u0688",ariaVisible:"\\u0646\\u0638\\u0631 \\u0622\\u0646\\u06D2 \\u0648\\u0627\\u0644\\u0627",ariaSearchFilterValues:"\\u0641\\u0644\\u0679\\u0631 \\u0642\\u062F\\u0631\\u0648\\u06BA \\u06A9\\u06CC \\u062A\\u0644\\u0627\\u0634 \\u06A9\\u0631\\u06CC\\u06BA",ariaPageSizeSelectorLabel:"\\u0635\\u0641\\u06C1 \\u06A9\\u0627 \\u0633\\u0627\\u0626\\u0632",ariaChartMenuClose:"\\u';
      S = S + '0686\\u0627\\u0631\\u0679 \\u0627\\u06CC\\u0688\\u06CC\\u0679 \\u0645\\u06CC\\u0646\\u0648 \\u0628\\u0646\\u062F \\u06A9\\u0631\\u06CC\\u06BA",ariaChartSelected:"\\u0645\\u0646\\u062A\\u062E\\u0628 \\u0634\\u062F\\u06C1",ariaSkeletonCellLoadingFailed:"\\u0635\\u0641 \\u0644\\u0648\\u0688 \\u06A9\\u0631\\u0646\\u06D2 \\u0645\\u06CC\\u06BA \\u0646\\u0627\\u06A9\\u0627\\u0645",ariaSkeletonCellLoading:"\\u0635\\u0641 \\u06A9\\u0627 \\u0688\\u06CC\\u0679\\u0627 \\u0644\\u0648\\u0688 \\u06C1\\u0648 \\u0631\\u06C1\\u0627 \\u06C1\\u06D2",ariaRowGroupDropZonePanelLabel:"\\u0642\\u0637\\u0627\\u0631 \\u06AF\\u0631\\u0648\\u067E\\u0633",ariaValuesDropZonePanelLabel:"\\u0642\\u062F\\u0631\\u06CC\\u06BA",ariaPivotDropZonePanelLabel:"\\u06A9\\u0627\\u0644\\u0645 \\u0644\\u06CC\\u0628\\u0644\\u0632",ariaDropZoneColumnComponentDescription:"\\u06C1\\u0679\\u0627\\u0646\\u06D2 \\u06A9\\u06CC\\u0644\\u0626\\u06D2 DELETE \\u062F\\u0628\\u0627\\u0626\\u06CC\\u06BA",ariaDropZoneColumnValueItemDescription:"\\u062C\\u0645\\u0639 \\u06A9\\u06D2 \\u0627\\u0646\\u062F\\u0627\\u0632 \\u06A9\\u0648 \\u062A\\u0628\\u062F\\u06CC\\u0644 \\u06A9\\u0631\\u0646\\u06D2 \\u06A9\\u06CC\\u0644\\u0626\\u06D2 ENTER \\u062F\\u0628\\u0627\\u0626\\u06CC\\u06BA",ariaDropZoneColumnGroupItemDescription:"\\u062A\\u0631\\u062A\\u06CC\\u0628 \\u062F\\u06CC\\u0646\\u06D2 \\u06A9\\u06CC\\u0644\\u0626\\u06D2 ENTER \\u062F\\u0628\\u0627\\u0626\\u06CC\\u06BA",ariaDropZoneColumnComponentAggFuncSeparator:" \\u06A9\\u0627 ",ariaDropZoneColumnComponentSortAscending:"\\u0628\\u0691\\u06BE\\u062A\\u06D2 \\u06C1\\u0648\\u0626\\u06D2 \\u062A\\u0631\\u062A\\u06CC\\u0628",ariaDropZoneColumnComponentSortDescending:"\\u06AF\\u0631\\u062A\\u06D2 \\u06C1\\u0648\\u0626\\u06D2 \\u062A\\u0631\\u062A\\u06CC\\u0628",ariaLabelDialog:"\\u0688\\u0627\\u0626\\u06CC\\u0644\\u0627\\u06AF",ariaLabelColumnMenu:"\\u06A9\\u0627\\u0644\\u0645 \\u0645\\u06CC\\u0646\\u0648",ariaLabelColumnFilter:"\\u06A9\\u0627\\u0644\\u0645 \\u0641\\u0644\\u0679\\u0631",ariaLabelCellEditor:"\\u0633\\u06CC\\u0644 \\u0627\\u06CC\\u0688\\u06CC\\u0679\\u0631",ariaLabelSelectField:"\\u0641\\u06CC\\u0644\\u0688 \\u0645\\u0646\\u062A\\u062E\\u0628 \\u06A9\\u0631\\u06CC\\u06BA",ariaLabelRichSelect';
      S = S + 'Field:"\\u0627\\u0645\\u06CC\\u0631 \\u0645\\u0646\\u062A\\u062E\\u0628 \\u0641\\u06CC\\u0644\\u0688",ariaLabelRichSelectToggleSelection:"\\u0627\\u0646\\u062A\\u062E\\u0627\\u0628 \\u06A9\\u0648 \\u062A\\u0628\\u062F\\u06CC\\u0644 \\u06A9\\u0631\\u0646\\u06D2 \\u06A9\\u06D2 \\u0644\\u0626\\u06D2 SPACE \\u062F\\u0628\\u0627\\u0626\\u06CC\\u06BA",ariaLabelRichSelectDeselectAllItems:"\\u062A\\u0645\\u0627\\u0645 \\u0627\\u0634\\u06CC\\u0627\\u0621 \\u06A9\\u0648 \\u0627\\u0646\\u062A\\u062E\\u0627\\u0628 \\u0633\\u06D2 \\u06C1\\u0679\\u0627\\u0646\\u06D2 \\u06A9\\u06D2 \\u0644\\u06CC\\u06D2 DELETE \\u062F\\u0628\\u0627\\u0626\\u06CC\\u06BA",ariaLabelRichSelectDeleteSelection:"\\u0622\\u0626\\u0679\\u0645 \\u06A9\\u0648 \\u0627\\u0646\\u062A\\u062E\\u0627\\u0628 \\u0633\\u06D2 \\u06C1\\u0679\\u0627\\u0646\\u06D2 \\u06A9\\u06D2 \\u0644\\u06CC\\u06D2 DELETE \\u062F\\u0628\\u0627\\u0626\\u06CC\\u06BA",ariaLabelTooltip:"\\u0679\\u0648\\u0644 \\u0679\\u067E",ariaLabelContextMenu:"\\u0633\\u06CC\\u0627\\u0642 \\u0648 \\u0633\\u0628\\u0627\\u0642 \\u0645\\u06CC\\u0646\\u0648",ariaLabelSubMenu:"\\u0630\\u06CC\\u0644\\u06CC \\u0645\\u06CC\\u0646\\u0648",ariaLabelAggregationFunction:"\\u062A\\u062C\\u0645\\u0639 \\u06A9\\u0627 \\u0641\\u0646\\u06A9\\u0634\\u0646",ariaLabelAdvancedFilterAutocomplete:"\\u0627\\u0639\\u0644\\u06CC \\u0641\\u0644\\u0679\\u0631 \\u062E\\u0648\\u062F\\u06A9\\u0627\\u0631 \\u0645\\u06A9\\u0645\\u0644",ariaLabelAdvancedFilterBuilderAddField:"\\u0627\\u0639\\u0644\\u06CC \\u0641\\u0644\\u0679\\u0631 \\u0628\\u0644\\u0688\\u0631 \\u0641\\u06CC\\u0644\\u0688 \\u0634\\u0627\\u0645\\u0644 \\u06A9\\u0631\\u06CC\\u06BA",ariaLabelAdvancedFilterBuilderColumnSelectField:"\\u0627\\u0639\\u0644\\u06CC \\u0641\\u0644\\u0679\\u0631 \\u0628\\u0644\\u0688\\u0631 \\u06A9\\u0627\\u0644\\u0645 \\u0645\\u0646\\u062A\\u062E\\u0628 \\u0641\\u06CC\\u0644\\u0688",ariaLabelAdvancedFilterBuilderOptionSelectField:"\\u0627\\u0639\\u0644\\u06CC \\u0641\\u0644\\u0679\\u0631 \\u0628\\u0644\\u0688\\u0631 \\u0622\\u067E\\u0634\\u0646 \\u0645\\u0646\\u062A\\u062E\\u0628 \\u0641\\u06CC\\u0644\\u0688",ariaLabelAdvancedFilterBuilderJoinSelectField:"\\u0627\\u0639\\u0644\\u06CC \\u0641\\u0644\\u0679\\u0631 \\u0628\\u0644\\u0688\\u06';
      S = S + '31 \\u062C\\u0648\\u0627\\u0626\\u0646 \\u0622\\u067E\\u0631\\u06CC\\u0679\\u0631 \\u0645\\u0646\\u062A\\u062E\\u0628 \\u0641\\u06CC\\u0644\\u0688",ariaColumnPanelList:"\\u06A9\\u0627\\u0644\\u0645 \\u06A9\\u06CC \\u0641\\u06C1\\u0631\\u0633\\u062A",ariaFilterPanelList:"\\u0641\\u0644\\u0679\\u0631 \\u06A9\\u06CC \\u0641\\u06C1\\u0631\\u0633\\u062A",thousandSeparator:",",decimalSeparator:".",true:"\\u0633\\u0686",false:"\\u062C\\u06BE\\u0648\\u0679",invalidDate:"\\u063A\\u0644\\u0637 \\u062A\\u0627\\u0631\\u06CC\\u062E",invalidNumber:"\\u063A\\u0644\\u0637 \\u0646\\u0645\\u0628\\u0631",january:"\\u062C\\u0646\\u0648\\u0631\\u06CC",february:"\\u0641\\u0631\\u0648\\u0631\\u06CC",march:"\\u0645\\u0627\\u0631\\u0686",april:"\\u0627\\u067E\\u0631\\u06CC\\u0644",may:"\\u0645\\u0626\\u06CC",june:"\\u062C\\u0648\\u0646",july:"\\u062C\\u0648\\u0644\\u0627\\u0626\\u06CC",august:"\\u0627\\u06AF\\u0633\\u062A",september:"\\u0633\\u062A\\u0645\\u0628\\u0631",october:"\\u0627\\u06A9\\u062A\\u0648\\u0628\\u0631",november:"\\u0646\\u0648\\u0645\\u0628\\u0631",december:"\\u062F\\u0633\\u0645\\u0628\\u0631",timeFormatSlashesDDMMYYYY:"\\u0688\\u06CC \\u0688\\u06CC/\\u0627\\u06CC\\u0645 \\u0627\\u06CC\\u0645/\\u0648\\u0627\\u0626\\u06CC \\u0648\\u0627\\u0626\\u06CC \\u0648\\u0627\\u0626\\u06CC \\u0648\\u0627\\u0626\\u06CC",timeFormatSlashesMMDDYYYY:"\\u0627\\u06CC\\u0645 \\u0627\\u06CC\\u0645/\\u0688\\u06CC \\u0688\\u06CC/\\u0648\\u0627\\u0626\\u06CC \\u0648\\u0627\\u0626\\u06CC \\u0648\\u0627\\u0626\\u06CC \\u0648\\u0627\\u0626\\u06CC",timeFormatSlashesDDMMYY:"\\u0688\\u06CC \\u0688\\u06CC/\\u0627\\u06CC\\u0645 \\u0627\\u06CC\\u0645/\\u0648\\u0627\\u0626\\u06CC \\u0648\\u0627\\u0626\\u06CC",timeFormatSlashesMMDDYY:"\\u0627\\u06CC\\u0645 \\u0627\\u06CC\\u0645/\\u0688\\u06CC \\u0688\\u06CC/\\u0648\\u0627\\u0626\\u06CC \\u0648\\u0627\\u0626\\u06CC",timeFormatDotsDDMYY:"\\u0688\\u06CC \\u0688\\u06CC.\\u0627\\u06CC\\u0645.\\u0648\\u0627\\u0626\\u06CC \\u0648\\u0627\\u0626\\u06CC",timeFormatDotsMDDYY:"\\u0627\\u06CC\\u0645.\\u0688\\u06CC \\u0688\\u06CC.\\u0648\\u0627\\u0626\\u06CC \\u0648\\u0627\\u0626\\u06CC",timeFormatDashesYYYYMMDD:"\\u0648\\u0627\\u0626\\u06CC \\u0648\\u0627\\u0626\\u06CC \\u0648\\u0627\\u0626\\u06CC \\u0648\\u0627\\';
      S = S + 'u0626\\u06CC-\\u0627\\u06CC\\u0645 \\u0627\\u06CC\\u0645-\\u0688\\u06CC \\u0688\\u06CC",timeFormatSpacesDDMMMMYYYY:"\\u0688\\u06CC \\u0688\\u06CC \\u0627\\u06CC\\u0645 \\u0627\\u06CC\\u0645 \\u0627\\u06CC\\u0645 \\u0627\\u06CC\\u0645 \\u0648\\u0627\\u0626\\u06CC \\u0648\\u0627\\u0626\\u06CC \\u0648\\u0627\\u0626\\u06CC \\u0648\\u0627\\u0626\\u06CC",timeFormatHHMMSS:"\\u0627\\u06CC\\u0686 \\u0627\\u06CC\\u0686:\\u0627\\u06CC\\u0645 \\u0627\\u06CC\\u0645:\\u0627\\u06CC\\u0633 \\u0627\\u06CC\\u0633",timeFormatHHMMSSAmPm:"\\u0627\\u06CC\\u0686 \\u0627\\u06CC\\u0686:\\u0627\\u06CC\\u0645 \\u0627\\u06CC\\u0645:\\u0627\\u06CC\\u0633 \\u0627\\u06CC\\u0633 \\u0627\\u06D2 \\u0627\\u06CC\\u0645/\\u067E\\u06CC \\u0627\\u06CC\\u0645"},Z={selectAll:"(Ch\\u1ECDn T\\u1EA5t C\\u1EA3)",selectAllSearchResults:"(Ch\\u1ECDn T\\u1EA5t C\\u1EA3 C\\xE1c K\\u1EBFt Qu\\u1EA3 T\\xECm Ki\\u1EBFm)",addCurrentSelectionToFilter:"Th\\xEAm l\\u1EF1a ch\\u1ECDn hi\\u1EC7n t\\u1EA1i v\\xE0o b\\u1ED9 l\\u1ECDc",searchOoo:"T\\xECm ki\\u1EBFm...",blanks:"(Tr\\u1ED1ng)",noMatches:"Kh\\xF4ng c\\xF3 k\\u1EBFt qu\\u1EA3",filterOoo:"L\\u1ECDc...",equals:"B\\u1EB1ng",notEqual:"Kh\\xF4ng b\\u1EB1ng",blank:"Tr\\u1ED1ng",notBlank:"Kh\\xF4ng tr\\u1ED1ng",empty:"Ch\\u1ECDn m\\u1ED9t",lessThan:"Nh\\u1ECF h\\u01A1n",greaterThan:"L\\u1EDBn h\\u01A1n",lessThanOrEqual:"Nh\\u1ECF h\\u01A1n ho\\u1EB7c b\\u1EB1ng",greaterThanOrEqual:"L\\u1EDBn h\\u01A1n ho\\u1EB7c b\\u1EB1ng",inRange:"Trong kho\\u1EA3ng",inRangeStart:"T\\u1EEB",inRangeEnd:"\\u0110\\u1EBFn",contains:"Ch\\u1EE9a",notContains:"Kh\\xF4ng ch\\u1EE9a",startsWith:"B\\u1EAFt \\u0111\\u1EA7u v\\u1EDBi",endsWith:"K\\u1EBFt th\\xFAc v\\u1EDBi",dateFormatOoo:"yyyy-mm-dd",before:"Tr\\u01B0\\u1EDBc",after:"Sau",andCondition:"V\\xC0",orCondition:"HO\\u1EB6C",applyFilter:"\\xC1p d\\u1EE5ng",resetFilter:"\\u0110\\u1EB7t l\\u1EA1i",clearFilter:"X\\xF3a",cancelFilter:"H\\u1EE7y",textFilter:"B\\u1ED9 l\\u1ECDc v\\u0103n b\\u1EA3n",numberFilter:"B\\u1ED9 l\\u1ECDc s\\u1ED1",dateFilter:"B\\u1ED9 l\\u1ECDc ng\\xE0y th\\xE1ng",setFilter:"B\\u1ED9 l\\u1ECDc t\\u1EADp h\\u1EE3p",groupFilterSelect:"Ch\\u1ECDn tr\\u01B0\\u1EDDng:",advancedFilterContains:"ch\\';
      S = S + 'u1EE9a",advancedFilterNotContains:"kh\\xF4ng ch\\u1EE9a",advancedFilterTextEquals:"b\\u1EB1ng",advancedFilterTextNotEqual:"kh\\xF4ng b\\u1EB1ng",advancedFilterStartsWith:"b\\u1EAFt \\u0111\\u1EA7u v\\u1EDBi",advancedFilterEndsWith:"k\\u1EBFt th\\xFAc v\\u1EDBi",advancedFilterBlank:"tr\\u1ED1ng",advancedFilterNotBlank:"kh\\xF4ng tr\\u1ED1ng",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"\\u0111\\xFAng",advancedFilterFalse:"sai",advancedFilterAnd:"V\\xC0",advancedFilterOr:"HO\\u1EB6C",advancedFilterApply:"\\xC1p d\\u1EE5ng",advancedFilterBuilder:"Tr\\xECnh t\\u1EA1o",advancedFilterValidationMissingColumn:"Thi\\u1EBFu c\\u1ED9t",advancedFilterValidationMissingOption:"Thi\\u1EBFu t\\xF9y ch\\u1ECDn",advancedFilterValidationMissingValue:"Thi\\u1EBFu gi\\xE1 tr\\u1ECB",advancedFilterValidationInvalidColumn:"Kh\\xF4ng t\\xECm th\\u1EA5y c\\u1ED9t",advancedFilterValidationInvalidOption:"Kh\\xF4ng t\\xECm th\\u1EA5y t\\xF9y ch\\u1ECDn",advancedFilterValidationMissingQuote:"Gi\\xE1 tr\\u1ECB thi\\u1EBFu d\\u1EA5u ngo\\u1EB7c k\\xE9p",advancedFilterValidationNotANumber:"Gi\\xE1 tr\\u1ECB kh\\xF4ng ph\\u1EA3i l\\xE0 m\\u1ED9t s\\u1ED1",advancedFilterValidationInvalidDate:"Gi\\xE1 tr\\u1ECB kh\\xF4ng ph\\u1EA3i l\\xE0 ng\\xE0y h\\u1EE3p l\\u1EC7",advancedFilterValidationMissingCondition:"Thi\\u1EBFu \\u0111i\\u1EC1u ki\\u1EC7n",advancedFilterValidationJoinOperatorMismatch:"C\\xE1c to\\xE1n t\\u1EED k\\u1EBFt n\\u1ED1i trong m\\u1ED9t \\u0111i\\u1EC1u ki\\u1EC7n ph\\u1EA3i gi\\u1ED1ng nhau",advancedFilterValidationInvalidJoinOperator:"Kh\\xF4ng t\\xECm th\\u1EA5y to\\xE1n t\\u1EED k\\u1EBFt n\\u1ED1i",advancedFilterValidationMissingEndBracket:"Thi\\u1EBFu d\\u1EA5u ngo\\u1EB7c k\\u1EBFt th\\xFAc",advancedFilterValidationExtraEndBracket:"Qu\\xE1 nhi\\u1EC1u d\\u1EA5u ngo\\u1EB7c k\\u1EBFt th\\xFAc",advancedFilterValidationMessage:"Bi\\u1EC3u th\\u1EE9c c\\xF3 l\\u1ED7i. ${variable} - ${variable}.",advancedFilterValidationM';
      S = S + 'essageAtEnd:"Bi\\u1EC3u th\\u1EE9c c\\xF3 l\\u1ED7i. ${variable} \\u1EDF cu\\u1ED1i bi\\u1EC3u th\\u1EE9c.",advancedFilterBuilderTitle:"B\\u1ED9 l\\u1ECDc N\\xE2ng cao",advancedFilterBuilderApply:"\\xC1p d\\u1EE5ng",advancedFilterBuilderCancel:"H\\u1EE7y",advancedFilterBuilderAddButtonTooltip:"Th\\xEAm B\\u1ED9 l\\u1ECDc ho\\u1EB7c Nh\\xF3m",advancedFilterBuilderRemoveButtonTooltip:"X\\xF3a b\\u1ECF",advancedFilterBuilderMoveUpButtonTooltip:"Di chuy\\u1EC3n l\\xEAn",advancedFilterBuilderMoveDownButtonTooltip:"Di chuy\\u1EC3n xu\\u1ED1ng",advancedFilterBuilderAddJoin:"Th\\xEAm Nh\\xF3m",advancedFilterBuilderAddCondition:"Th\\xEAm B\\u1ED9 l\\u1ECDc",advancedFilterBuilderSelectColumn:"Ch\\u1ECDn m\\u1ED9t c\\u1ED9t",advancedFilterBuilderSelectOption:"Ch\\u1ECDn m\\u1ED9t t\\xF9y ch\\u1ECDn",advancedFilterBuilderEnterValue:"Nh\\u1EADp m\\u1ED9t gi\\xE1 tr\\u1ECB...",advancedFilterBuilderValidationAlreadyApplied:"B\\u1ED9 l\\u1ECDc hi\\u1EC7n t\\u1EA1i \\u0111\\xE3 \\u0111\\u01B0\\u1EE3c \\xE1p d\\u1EE5ng.",advancedFilterBuilderValidationIncomplete:"Kh\\xF4ng ph\\u1EA3i t\\u1EA5t c\\u1EA3 \\u0111i\\u1EC1u ki\\u1EC7n \\u0111\\u1EC1u \\u0111\\xE3 ho\\xE0n th\\xE0nh.",advancedFilterBuilderValidationSelectColumn:"Ph\\u1EA3i ch\\u1ECDn m\\u1ED9t c\\u1ED9t.",advancedFilterBuilderValidationSelectOption:"Ph\\u1EA3i ch\\u1ECDn m\\u1ED9t t\\xF9y ch\\u1ECDn.",advancedFilterBuilderValidationEnterValue:"Ph\\u1EA3i nh\\u1EADp m\\u1ED9t gi\\xE1 tr\\u1ECB.",columns:"C\\u1ED9t",filters:"B\\u1ED9 l\\u1ECDc",pivotMode:"Ch\\u1EBF \\u0111\\u1ED9 Pivot",groups:"Nh\\xF3m h\\xE0ng",rowGroupColumnsEmptyMessage:"K\\xE9o v\\xE0o \\u0111\\xE2y \\u0111\\u1EC3 thi\\u1EBFt l\\u1EADp c\\xE1c nh\\xF3m h\\xE0ng",values:"Gi\\xE1 tr\\u1ECB",valueColumnsEmptyMessage:"K\\xE9o v\\xE0o \\u0111\\xE2y \\u0111\\u1EC3 t\\u1ED5ng h\\u1EE3p",pivots:"Nh\\xE3n c\\u1ED9t",pivotColumnsEmptyMessage:"K\\xE9o v\\xE0o \\u0111\\xE2y \\u0111\\u1EC3 thi\\u1EBFt l\\u1EADp nh\\xE3n c\\u1ED9t",group:"Nh\\xF3m",rowDragRow:"h\\xE0ng",rowDragRows:"c\\xE1c h\\xE0ng",loadingOoo:"\\u0110ang t\\u1EA3i...",loadingError:"L\\u1ED6I",noRowsToShow:"Kh\\xF4ng c\\xF3 h';
      S = S + '\\xE0ng \\u0111\\u1EC3 hi\\u1EC3n th\\u1ECB",enabled:"\\u0110\\xE3 b\\u1EADt",pinColumn:"Ghim C\\u1ED9t",pinLeft:"Ghim Tr\\xE1i",pinRight:"Ghim Ph\\u1EA3i",noPin:"Kh\\xF4ng Ghim",valueAggregation:"T\\u1ED5ng H\\u1EE3p Gi\\xE1 Tr\\u1ECB",noAggregation:"Kh\\xF4ng",autosizeThisColumn:"T\\u1EF1 \\u0110i\\u1EC1u Ch\\u1EC9nh K\\xEDch Th\\u01B0\\u1EDBc C\\u1ED9t N\\xE0y",autosizeAllColumns:"T\\u1EF1 \\u0110i\\u1EC1u Ch\\u1EC9nh K\\xEDch Th\\u01B0\\u1EDBc T\\u1EA5t C\\u1EA3 C\\xE1c C\\u1ED9t",groupBy:"Nh\\xF3m Theo",ungroupBy:"B\\u1ECF Nh\\xF3m Theo",ungroupAll:"B\\u1ECF Nh\\xF3m T\\u1EA5t C\\u1EA3",addToValues:"Th\\xEAm ${variable} v\\xE0o gi\\xE1 tr\\u1ECB",removeFromValues:"X\\xF3a ${variable} kh\\u1ECFi gi\\xE1 tr\\u1ECB",addToLabels:"Th\\xEAm ${variable} v\\xE0o nh\\xE3n",removeFromLabels:"X\\xF3a ${variable} kh\\u1ECFi nh\\xE3n",resetColumns:"\\u0110\\u1EB7t L\\u1EA1i C\\u1ED9t",expandAll:"M\\u1EDF R\\u1ED9ng T\\u1EA5t C\\u1EA3 C\\xE1c Nh\\xF3m H\\xE0ng",collapseAll:"\\u0110\\xF3ng T\\u1EA5t C\\u1EA3 C\\xE1c Nh\\xF3m H\\xE0ng",copy:"Sao Ch\\xE9p",ctrlC:"Ctrl+C",ctrlX:"Ctrl+X",copyWithHeaders:"Sao Ch\\xE9p K\\xE8m Ti\\xEAu \\u0110\\u1EC1",copyWithGroupHeaders:"Sao Ch\\xE9p K\\xE8m Ti\\xEAu \\u0110\\u1EC1 Nh\\xF3m",cut:"C\\u1EAFt",paste:"D\\xE1n",ctrlV:"Ctrl+V",export:"Xu\\u1EA5t",csvExport:"Xu\\u1EA5t CSV",excelExport:"Xu\\u1EA5t Excel",columnFilter:"B\\u1ED9 L\\u1ECDc C\\u1ED9t",columnChooser:"Ch\\u1ECDn C\\u1ED9t",sortAscending:"S\\u1EAFp X\\u1EBFp T\\u0103ng D\\u1EA7n",sortDescending:"S\\u1EAFp X\\u1EBFp Gi\\u1EA3m D\\u1EA7n",sortUnSort:"X\\xF3a S\\u1EAFp X\\u1EBFp",sum:"T\\u1ED5ng",first:"\\u0110\\u1EA7u ti\\xEAn",last:"Cu\\u1ED1i c\\xF9ng",min:"Nh\\u1ECF nh\\u1EA5t",max:"L\\u1EDBn nh\\u1EA5t",none:"Kh\\xF4ng c\\xF3",count:"\\u0110\\u1EBFm",avg:"Trung b\\xECnh",filteredRows:"\\u0110\\xE3 l\\u1ECDc",selectedRows:"\\u0110\\xE3 ch\\u1ECDn",totalRows:"T\\u1ED5ng s\\u1ED1 h\\xE0ng",totalAndFilteredRows:"H\\xE0ng",more:"Th\\xEAm",to:"\\u0111\\u1EBFn",of:"trong",page:"Trang",pageLastRowUnknown:"?",nextPage:"Trang k\\u1EBF",lastPage:"Trang cu\\u1ED1i",firstPage:"Trang \\u0111\\u1EA7u",previousPage:"Trang tr\\u01';
      S = S + 'B0\\u1EDBc",pageSizeSelectorLabel:"K\\xEDch c\\u1EE1 trang:",footerTotal:"T\\u1ED5ng",pivotColumnGroupTotals:"T\\u1ED5ng c\\u1ED9ng",pivotChartAndPivotMode:"Bi\\u1EC3u \\u0111\\u1ED3 Pivot & Ch\\u1EBF \\u0111\\u1ED9 Pivot",pivotChart:"Bi\\u1EC3u \\u0111\\u1ED3 Pivot",chartRange:"Ph\\u1EA1m vi Bi\\u1EC3u \\u0111\\u1ED3",columnChart:"C\\u1ED9t",groupedColumn:"Nh\\xF3m",stackedColumn:"X\\u1EBFp ch\\u1ED3ng",normalizedColumn:"X\\u1EBFp ch\\u1ED3ng 100%",barChart:"Thanh",groupedBar:"Nh\\xF3m",stackedBar:"X\\u1EBFp ch\\u1ED3ng",normalizedBar:"X\\u1EBFp ch\\u1ED3ng 100%",pieChart:"Bi\\u1EC3u \\u0111\\u1ED3 Tr\\xF2n",pie:"Tr\\xF2n",donut:"V\\xF2ng",line:"\\u0110\\u01B0\\u1EDDng",xyChart:"X Y (Ph\\xE2n t\\xE1n)",scatter:"Ph\\xE2n t\\xE1n",bubble:"Bong b\\xF3ng",areaChart:"Khu v\\u1EF1c",area:"Khu v\\u1EF1c",stackedArea:"X\\u1EBFp ch\\u1ED3ng",normalizedArea:"X\\u1EBFp ch\\u1ED3ng 100%",histogramChart:"Bi\\u1EC3u \\u0111\\u1ED3 T\\u1EA7n s\\u1ED1",polarChart:"Bi\\u1EC3u \\u0111\\u1ED3 C\\u1EF1c",radarLine:"\\u0110\\u01B0\\u1EDDng Radar",radarArea:"Khu v\\u1EF1c Radar",nightingale:"Nightingale",radialColumn:"C\\u1ED9t Radial",radialBar:"Thanh Radial",statisticalChart:"Th\\u1ED1ng k\\xEA",boxPlot:"Bi\\u1EC3u \\u0111\\u1ED3 H\\u1ED9p",rangeBar:"Thanh Ph\\u1EA1m vi",rangeArea:"Khu v\\u1EF1c Ph\\u1EA1m vi",hierarchicalChart:"Ph\\xE2n c\\u1EA5p",treemap:"B\\u1EA3n \\u0111\\u1ED3 C\\xE2y",sunburst:"Sunburst",specializedChart:"Chuy\\xEAn bi\\u1EC7t",waterfall:"Th\\xE1c n\\u01B0\\u1EDBc",heatmap:"B\\u1EA3n \\u0111\\u1ED3 Nhi\\u1EC7t",combinationChart:"K\\u1EBFt h\\u1EE3p",columnLineCombo:"C\\u1ED9t & \\u0110\\u01B0\\u1EDDng",AreaColumnCombo:"Khu v\\u1EF1c & C\\u1ED9t",pivotChartTitle:"Bi\\u1EC3u \\u0111\\u1ED3 Pivot",rangeChartTitle:"Bi\\u1EC3u \\u0111\\u1ED3 Ph\\u1EA1m vi",settings:"Bi\\u1EC3u \\u0111\\u1ED3",data:"Thi\\u1EBFt l\\u1EADp",format:"T\\xF9y ch\\u1EC9nh",categories:"Danh m\\u1EE5c",defaultCategory:"(Kh\\xF4ng c\\xF3)",series:"Chu\\u1ED7i",switchCategorySeries:"Chuy\\u1EC3n \\u0111\\u1ED5i Danh m\\u1EE5c / Chu\\u1ED7i",categoryValues:"Gi\\xE1 tr\\u1ECB Danh m\\u1EE5c",seriesLabels:"Nh\\xE3n Ch';
      S = S + 'u\\u1ED7i",aggregate:"T\\u1ED5ng h\\u1EE3p",xyValues:"Gi\\xE1 tr\\u1ECB X Y",paired:"Ch\\u1EBF \\u0111\\u1ED9 Gh\\xE9p \\u0111\\xF4i",axis:"Tr\\u1EE5c",xAxis:"Tr\\u1EE5c Ngang",yAxis:"Tr\\u1EE5c D\\u1ECDc",polarAxis:"Tr\\u1EE5c C\\u1EF1c",radiusAxis:"Tr\\u1EE5c B\\xE1n k\\xEDnh",navigator:"\\u0110\\u1ECBnh h\\u01B0\\u1EDBng",zoom:"Thu ph\\xF3ng",animation:"Ho\\u1EA1t \\u1EA3nh",crosshair:"\\u0110\\u01B0\\u1EDDng c\\u1EAFt ch\\xE9o",color:"M\\xE0u s\\u1EAFc",thickness:"\\u0110\\u1ED9 d\\xE0y",preferredLength:"Chi\\u1EC1u d\\xE0i \\u01AFa th\\xEDch",xType:"Lo\\u1EA1i X",axisType:"Lo\\u1EA1i Tr\\u1EE5c",automatic:"T\\u1EF1 \\u0111\\u1ED9ng",category:"Danh m\\u1EE5c",number:"S\\u1ED1",time:"Th\\u1EDDi gian",timeFormat:"\\u0110\\u1ECBnh d\\u1EA1ng Th\\u1EDDi gian",autoRotate:"T\\u1EF1 \\u0111\\u1ED9ng Xoay",labelRotation:"Xoay nh\\xE3n",circle:"H\\xECnh tr\\xF2n",polygon:"H\\xECnh \\u0111a gi\\xE1c",square:"H\\xECnh vu\\xF4ng",cross:"H\\xECnh ch\\u1EEF th\\u1EADp",diamond:"H\\xECnh kim c\\u01B0\\u01A1ng",plus:"D\\u1EA5u c\\u1ED9ng",triangle:"H\\xECnh tam gi\\xE1c",heart:"H\\xECnh tr\\xE1i tim",orientation:"H\\u01B0\\u1EDBng",fixed:"C\\u1ED1 \\u0111\\u1ECBnh",parallel:"Song song",perpendicular:"Vu\\xF4ng g\\xF3c",radiusAxisPosition:"V\\u1ECB tr\\xED",ticks:"V\\u1EA1ch",gridLines:"\\u0110\\u01B0\\u1EDDng l\\u01B0\\u1EDBi",width:"Chi\\u1EC1u r\\u1ED9ng",height:"Chi\\u1EC1u cao",length:"Chi\\u1EC1u d\\xE0i",padding:"\\u0110\\u1EC7m",spacing:"Kho\\u1EA3ng c\\xE1ch",chartStyle:"Phong c\\xE1ch Bi\\u1EC3u \\u0111\\u1ED3",title:"Ti\\xEAu \\u0111\\u1EC1",chartTitles:"Ti\\xEAu \\u0111\\u1EC1 Bi\\u1EC3u \\u0111\\u1ED3",chartTitle:"Ti\\xEAu \\u0111\\u1EC1 Bi\\u1EC3u \\u0111\\u1ED3",chartSubtitle:"Ph\\u1EE5 \\u0111\\u1EC1",horizontalAxisTitle:"Ti\\xEAu \\u0111\\u1EC1 Tr\\u1EE5c Ngang",verticalAxisTitle:"Ti\\xEAu \\u0111\\u1EC1 Tr\\u1EE5c D\\u1ECDc",polarAxisTitle:"Ti\\xEAu \\u0111\\u1EC1 Tr\\u1EE5c C\\u1EF1c",titlePlaceholder:"Ti\\xEAu \\u0111\\u1EC1 Bi\\u1EC3u \\u0111\\u1ED3",background:"N\\u1EC1n",font:"Ph\\xF4ng ch\\u1EEF",weight:"Tr\\u1ECDng l\\u01B0\\u1EE3ng",top:"Tr\\xEAn",right:"Ph\\u1EA3i",bottom:"D\\u01B0\\u1EDBi",left:"Tr\\xE';
      S = S + '1i",labels:"Nh\\xE3n",calloutLabels:"Nh\\xE3n G\\u1ECDi ra",sectorLabels:"Nh\\xE3n Khu v\\u1EF1c",positionRatio:"T\\u1EF7 l\\u1EC7 V\\u1ECB tr\\xED",size:"K\\xEDch th\\u01B0\\u1EDBc",shape:"H\\xECnh d\\u1EA1ng",minSize:"K\\xEDch th\\u01B0\\u1EDBc T\\u1ED1i thi\\u1EC3u",maxSize:"K\\xEDch th\\u01B0\\u1EDBc T\\u1ED1i \\u0111a",legend:"Ch\\xFA gi\\u1EA3i",position:"V\\u1ECB tr\\xED",markerSize:"K\\xEDch th\\u01B0\\u1EDBc \\u0110\\xE1nh d\\u1EA5u",markerStroke:"\\u0110\\u01B0\\u1EDDng vi\\u1EC1n \\u0110\\xE1nh d\\u1EA5u",markerPadding:"\\u0110\\u1EC7m \\u0110\\xE1nh d\\u1EA5u",itemSpacing:"Kho\\u1EA3ng c\\xE1ch M\\u1EE5c",itemPaddingX:"\\u0110\\u1EC7m M\\u1EE5c X",itemPaddingY:"\\u0110\\u1EC7m M\\u1EE5c Y",layoutHorizontalSpacing:"Kho\\u1EA3ng c\\xE1ch Ngang",layoutVerticalSpacing:"Kho\\u1EA3ng c\\xE1ch D\\u1ECDc",strokeWidth:"\\u0110\\u1ED9 r\\u1ED9ng \\u0110\\u01B0\\u1EDDng",offset:"\\u0110\\u1ED9 l\\u1EC7ch",offsets:"\\u0110\\u1ED9 l\\u1EC7ch",tooltips:"Ch\\xFA th\\xEDch",callout:"G\\u1ECDi ra",markers:"\\u0110\\xE1nh d\\u1EA5u",shadow:"B\\xF3ng",blur:"M\\u1EDD",xOffset:"\\u0110\\u1ED9 l\\u1EC7ch X",yOffset:"\\u0110\\u1ED9 l\\u1EC7ch Y",lineWidth:"\\u0110\\u1ED9 r\\u1ED9ng \\u0110\\u01B0\\u1EDDng",lineDash:"\\u0110\\u01B0\\u1EDDng Dash",lineDashOffset:"\\u0110\\u1ED9 l\\u1EC7ch Dash",scrollingZoom:"Cu\\u1ED9n",scrollingStep:"B\\u01B0\\u1EDBc Cu\\u1ED9n",selectingZoom:"Ch\\u1ECDn",durationMillis:"Th\\u1EDDi l\\u01B0\\u1EE3ng (ms)",crosshairLabel:"Nh\\xE3n",crosshairSnap:"B\\u1EAFt \\u0111i\\u1EC3m",normal:"B\\xECnh th\\u01B0\\u1EDDng",bold:"\\u0110\\u1EADm",italic:"Nghi\\xEAng",boldItalic:"\\u0110\\u1EADm Nghi\\xEAng",predefined:"\\u0110\\u1ECBnh ngh\\u0129a tr\\u01B0\\u1EDBc",fillOpacity:"\\u0110\\u1ED9 m\\u1EDD \\u0110\\u1ED5",strokeColor:"M\\xE0u \\u0110\\u01B0\\u1EDDng",strokeOpacity:"\\u0110\\u1ED9 m\\u1EDD \\u0110\\u01B0\\u1EDDng",miniChart:"Bi\\u1EC3u \\u0111\\u1ED3 Nh\\u1ECF",histogramBinCount:"S\\u1ED1 l\\u01B0\\u1EE3ng Bin",connectorLine:"\\u0110\\u01B0\\u1EDDng K\\u1EBFt n\\u1ED1i",seriesItems:"M\\u1EE5c Chu\\u1ED7i",seriesItemType:"Lo\\u1EA1i M\\u1EE5c",seriesItemPositive:"T\\xEDch c\\u1EF1c",seriesItemNegative';
      S = S + ':"Ti\\xEAu c\\u1EF1c",seriesItemLabels:"Nh\\xE3n M\\u1EE5c",columnGroup:"C\\u1ED9t",barGroup:"Thanh",pieGroup:"Bi\\u1EC3u \\u0111\\u1ED3 Tr\\xF2n",lineGroup:"\\u0110\\u01B0\\u1EDDng",scatterGroup:"X Y (Ph\\xE2n t\\xE1n)",areaGroup:"Khu v\\u1EF1c",polarGroup:"C\\u1EF1c",statisticalGroup:"Th\\u1ED1ng k\\xEA",hierarchicalGroup:"Ph\\xE2n c\\u1EA5p",specializedGroup:"Chuy\\xEAn bi\\u1EC7t",combinationGroup:"K\\u1EBFt h\\u1EE3p",groupedColumnTooltip:"Nh\\xF3m",stackedColumnTooltip:"X\\u1EBFp ch\\u1ED3ng",normalizedColumnTooltip:"X\\u1EBFp ch\\u1ED3ng 100%",groupedBarTooltip:"Nh\\xF3m",stackedBarTooltip:"X\\u1EBFp ch\\u1ED3ng",normalizedBarTooltip:"X\\u1EBFp ch\\u1ED3ng 100%",pieTooltip:"Bi\\u1EC3u \\u0111\\u1ED3 Tr\\xF2n",donutTooltip:"Bi\\u1EC3u \\u0111\\u1ED3 V\\xF2ng",lineTooltip:"\\u0110\\u01B0\\u1EDDng",groupedAreaTooltip:"Khu v\\u1EF1c",stackedAreaTooltip:"X\\u1EBFp ch\\u1ED3ng",normalizedAreaTooltip:"X\\u1EBFp ch\\u1ED3ng 100%",scatterTooltip:"Ph\\xE2n t\\xE1n",bubbleTooltip:"Bong b\\xF3ng",histogramTooltip:"Histogram",radialColumnTooltip:"C\\u1ED9t Xuy\\xEAn t\\xE2m",radialBarTooltip:"Thanh Xuy\\xEAn t\\xE2m",radarLineTooltip:"\\u0110\\u01B0\\u1EDDng Radar",radarAreaTooltip:"Khu v\\u1EF1c Radar",nightingaleTooltip:"Bi\\u1EC3u \\u0111\\u1ED3 Nightingale",rangeBarTooltip:"Thanh Ph\\u1EA1m vi",rangeAreaTooltip:"Khu v\\u1EF1c Ph\\u1EA1m vi",boxPlotTooltip:"Bi\\u1EC3u \\u0111\\u1ED3 H\\u1ED9p",treemapTooltip:"Bi\\u1EC3u \\u0111\\u1ED3 C\\xE2y",sunburstTooltip:"Bi\\u1EC3u \\u0111\\u1ED3 Sunburst",waterfallTooltip:"Bi\\u1EC3u \\u0111\\u1ED3 Th\\xE1c n\\u01B0\\u1EDBc",heatmapTooltip:"Bi\\u1EC3u \\u0111\\u1ED3 Nhi\\u1EC7t",columnLineComboTooltip:"C\\u1ED9t & \\u0110\\u01B0\\u1EDDng",areaColumnComboTooltip:"Khu v\\u1EF1c & C\\u1ED9t",customComboTooltip:"K\\u1EBFt h\\u1EE3p T\\xF9y ch\\u1EC9nh",innerRadius:"B\\xE1n k\\xEDnh Trong",startAngle:"G\\xF3c B\\u1EAFt \\u0111\\u1EA7u",endAngle:"G\\xF3c K\\u1EBFt th\\xFAc",reverseDirection:"\\u0110\\u1EA3o ng\\u01B0\\u1EE3c H\\u01B0\\u1EDBng",groupPadding:"\\u0110\\u1EC7m Nh\\xF3m",seriesPadding:"\\u0110\\u1EC7m Chu\\u1ED7i",tile:"\\xD4",whisker:"R\\xE2';
      S = S + 'u",cap:"N\\u1EAFp",capLengthRatio:"T\\u1EF7 l\\u1EC7 Chi\\u1EC1u d\\xE0i",labelPlacement:"V\\u1ECB tr\\xED",inside:"B\\xEAn trong",outside:"B\\xEAn ngo\\xE0i",noDataToChart:"Kh\\xF4ng c\\xF3 d\\u1EEF li\\u1EC7u \\u0111\\u1EC3 t\\u1EA1o bi\\u1EC3u \\u0111\\u1ED3.",pivotChartRequiresPivotMode:"Bi\\u1EC3u \\u0111\\u1ED3 Pivot y\\xEAu c\\u1EA7u k\\xEDch ho\\u1EA1t Ch\\u1EBF \\u0111\\u1ED9 Pivot.",chartSettingsToolbarTooltip:"Menu",chartLinkToolbarTooltip:"Li\\xEAn k\\u1EBFt v\\u1EDBi L\\u01B0\\u1EDBi",chartUnlinkToolbarTooltip:"H\\u1EE7y li\\xEAn k\\u1EBFt t\\u1EEB L\\u01B0\\u1EDBi",chartDownloadToolbarTooltip:"T\\u1EA3i xu\\u1ED1ng Bi\\u1EC3u \\u0111\\u1ED3",chartMenuToolbarTooltip:"Menu",chartEdit:"Ch\\u1EC9nh s\\u1EEDa Bi\\u1EC3u \\u0111\\u1ED3",chartAdvancedSettings:"C\\xE0i \\u0111\\u1EB7t N\\xE2ng cao",chartLink:"Li\\xEAn k\\u1EBFt v\\u1EDBi L\\u01B0\\u1EDBi",chartUnlink:"H\\u1EE7y li\\xEAn k\\u1EBFt t\\u1EEB L\\u01B0\\u1EDBi",chartDownload:"T\\u1EA3i xu\\u1ED1ng Bi\\u1EC3u \\u0111\\u1ED3",histogramFrequency:"T\\u1EA7n s\\u1ED1",seriesChartType:"Lo\\u1EA1i Bi\\u1EC3u \\u0111\\u1ED3 Chu\\u1ED7i",seriesType:"Lo\\u1EA1i Chu\\u1ED7i",secondaryAxis:"Tr\\u1EE5c Ph\\u1EE5",seriesAdd:"Th\\xEAm m\\u1ED9t chu\\u1ED7i",categoryAdd:"Th\\xEAm m\\u1ED9t danh m\\u1EE5c",bar:"Thanh",column:"C\\u1ED9t",histogram:"Histogram",advancedSettings:"C\\xE0i \\u0111\\u1EB7t N\\xE2ng cao",direction:"H\\u01B0\\u1EDBng",horizontal:"Ngang",vertical:"D\\u1ECDc",seriesGroupType:"Lo\\u1EA1i Nh\\xF3m",groupedSeriesGroupType:"Nh\\xF3m",stackedSeriesGroupType:"X\\u1EBFp ch\\u1ED3ng",normalizedSeriesGroupType:"X\\u1EBFp ch\\u1ED3ng 100%",legendEnabled:"B\\u1EADt",invalidColor:"Gi\\xE1 tr\\u1ECB m\\xE0u s\\u1EAFc kh\\xF4ng h\\u1EE3p l\\u1EC7",groupedColumnFull:"C\\u1ED9t Nh\\xF3m",stackedColumnFull:"C\\u1ED9t X\\u1EBFp ch\\u1ED3ng",normalizedColumnFull:"C\\u1ED9t X\\u1EBFp ch\\u1ED3ng 100%",groupedBarFull:"Thanh Nh\\xF3m",stackedBarFull:"Thanh X\\u1EBFp ch\\u1ED3ng",normalizedBarFull:"Thanh X\\u1EBFp ch\\u1ED3ng 100%",stackedAreaFull:"Khu v\\u1EF1c X\\u1EBFp ch\\u1ED3ng",normalizedAreaFull:"Khu v\\u1EF1c X\\u1EBFp ch\\u1ED3ng 10';
      S = S + '0%",customCombo:"K\\u1EBFt h\\u1EE3p T\\xF9y ch\\u1EC9nh",ariaAdvancedFilterBuilderItem:"${variable}. M\\u1EE9c ${variable}. Nh\\u1EA5n ENTER \\u0111\\u1EC3 ch\\u1EC9nh s\\u1EEDa.",ariaAdvancedFilterBuilderItemValidation:"${variable}. M\\u1EE9c ${variable}. ${variable} Nh\\u1EA5n ENTER \\u0111\\u1EC3 ch\\u1EC9nh s\\u1EEDa.",ariaAdvancedFilterBuilderList:"Danh s\\xE1ch B\\u1ED9 l\\u1ECDc N\\xE2ng cao",ariaAdvancedFilterBuilderFilterItem:"\\u0110i\\u1EC1u ki\\u1EC7n L\\u1ECDc",ariaAdvancedFilterBuilderGroupItem:"Nh\\xF3m L\\u1ECDc",ariaAdvancedFilterBuilderColumn:"C\\u1ED9t",ariaAdvancedFilterBuilderOption:"T\\xF9y ch\\u1ECDn",ariaAdvancedFilterBuilderValueP:"Gi\\xE1 tr\\u1ECB",ariaAdvancedFilterBuilderJoinOperator:"To\\xE1n t\\u1EED K\\u1EBFt n\\u1ED1i",ariaAdvancedFilterInput:"\\u0110\\u1EA7u v\\xE0o B\\u1ED9 l\\u1ECDc N\\xE2ng cao",ariaChecked:"\\u0111\\xE3 \\u0111\\xE1nh d\\u1EA5u",ariaColumn:"C\\u1ED9t",ariaColumnGroup:"Nh\\xF3m c\\u1ED9t",ariaColumnFiltered:"C\\u1ED9t \\u0111\\xE3 l\\u1ECDc",ariaColumnSelectAll:"Chuy\\u1EC3n \\u0111\\u1ED5i Ch\\u1ECDn t\\u1EA5t c\\u1EA3 c\\xE1c c\\u1ED9t",ariaDateFilterInput:"\\u0110\\u1EA7u v\\xE0o B\\u1ED9 l\\u1ECDc Ng\\xE0y",ariaDefaultListName:"Danh s\\xE1ch",ariaFilterColumnsInput:"\\u0110\\u1EA7u v\\xE0o L\\u1ECDc C\\u1ED9t",ariaFilterFromValue:"L\\u1ECDc t\\u1EEB gi\\xE1 tr\\u1ECB",ariaFilterInput:"\\u0110\\u1EA7u v\\xE0o B\\u1ED9 l\\u1ECDc",ariaFilterList:"Danh s\\xE1ch L\\u1ECDc",ariaFilterToValue:"L\\u1ECDc \\u0111\\u1EBFn gi\\xE1 tr\\u1ECB",ariaFilterValue:"Gi\\xE1 tr\\u1ECB L\\u1ECDc",ariaFilterMenuOpen:"M\\u1EDF Menu B\\u1ED9 l\\u1ECDc",ariaFilteringOperator:"To\\xE1n t\\u1EED L\\u1ECDc",ariaHidden:"\\u1EA9n",ariaIndeterminate:"kh\\xF4ng x\\xE1c \\u0111\\u1ECBnh",ariaInputEditor:"Tr\\xECnh ch\\u1EC9nh s\\u1EEDa \\u0111\\u1EA7u v\\xE0o",ariaMenuColumn:"Nh\\u1EA5n ALT xu\\u1ED1ng \\u0111\\u1EC3 m\\u1EDF menu c\\u1ED9t",ariaFilterColumn:"Nh\\u1EA5n CTRL ENTER \\u0111\\u1EC3 m\\u1EDF b\\u1ED9 l\\u1ECDc",ariaRowDeselect:"Nh\\u1EA5n SPACE \\u0111\\u1EC3 b\\u1ECF ch\\u1ECDn h\\xE0ng n\\xE0y",ariaRowSelectAll:"Nh\\u1EA5n SPACE \\u0111\\u1EC3 chuy\\u1EC3';
      S = S + 'n \\u0111\\u1ED5i ch\\u1ECDn t\\u1EA5t c\\u1EA3 c\\xE1c h\\xE0ng",ariaRowToggleSelection:"Nh\\u1EA5n SPACE \\u0111\\u1EC3 chuy\\u1EC3n \\u0111\\u1ED5i ch\\u1ECDn h\\xE0ng",ariaRowSelect:"Nh\\u1EA5n SPACE \\u0111\\u1EC3 ch\\u1ECDn h\\xE0ng n\\xE0y",ariaRowSelectionDisabled:"Ch\\u1ECDn h\\xE0ng b\\u1ECB v\\xF4 hi\\u1EC7u ho\\xE1 cho h\\xE0ng n\\xE0y",ariaSearch:"T\\xECm ki\\u1EBFm",ariaSortableColumn:"Nh\\u1EA5n ENTER \\u0111\\u1EC3 s\\u1EAFp x\\u1EBFp",ariaToggleVisibility:"Nh\\u1EA5n SPACE \\u0111\\u1EC3 chuy\\u1EC3n \\u0111\\u1ED5i hi\\u1EC3n th\\u1ECB",ariaToggleCellValue:"Nh\\u1EA5n SPACE \\u0111\\u1EC3 chuy\\u1EC3n \\u0111\\u1ED5i gi\\xE1 tr\\u1ECB \\xF4",ariaUnchecked:"ch\\u01B0a \\u0111\\xE1nh d\\u1EA5u",ariaVisible:"hi\\u1EC3n th\\u1ECB",ariaSearchFilterValues:"T\\xECm ki\\u1EBFm gi\\xE1 tr\\u1ECB l\\u1ECDc",ariaPageSizeSelectorLabel:"K\\xEDch th\\u01B0\\u1EDBc Trang",ariaChartMenuClose:"\\u0110\\xF3ng Menu Ch\\u1EC9nh s\\u1EEDa Bi\\u1EC3u \\u0111\\u1ED3",ariaChartSelected:"\\u0110\\xE3 ch\\u1ECDn",ariaSkeletonCellLoadingFailed:"H\\xE0ng kh\\xF4ng t\\u1EA3i \\u0111\\u01B0\\u1EE3c",ariaSkeletonCellLoading:"D\\u1EEF li\\u1EC7u h\\xE0ng \\u0111ang t\\u1EA3i",ariaRowGroupDropZonePanelLabel:"Nh\\xF3m H\\xE0ng",ariaValuesDropZonePanelLabel:"Gi\\xE1 Tr\\u1ECB",ariaPivotDropZonePanelLabel:"Nh\\xE3n C\\u1ED9t",ariaDropZoneColumnComponentDescription:"Nh\\u1EA5n DELETE \\u0111\\u1EC3 x\\xF3a",ariaDropZoneColumnValueItemDescription:"Nh\\u1EA5n ENTER \\u0111\\u1EC3 thay \\u0111\\u1ED5i lo\\u1EA1i t\\u1ED5ng h\\u1EE3p",ariaDropZoneColumnGroupItemDescription:"Nh\\u1EA5n ENTER \\u0111\\u1EC3 s\\u1EAFp x\\u1EBFp",ariaDropZoneColumnComponentAggFuncSeparator:" c\\u1EE7a ",ariaDropZoneColumnComponentSortAscending:"t\\u0103ng d\\u1EA7n",ariaDropZoneColumnComponentSortDescending:"gi\\u1EA3m d\\u1EA7n",ariaLabelDialog:"H\\u1ED9p tho\\u1EA1i",ariaLabelColumnMenu:"Menu C\\u1ED9t",ariaLabelColumnFilter:"B\\u1ED9 L\\u1ECDc C\\u1ED9t",ariaLabelCellEditor:"Ch\\u1EC9nh S\\u1EEDa \\xD4",ariaLabelSelectField:"Ch\\u1ECDn Tr\\u01B0\\u1EDDng",ariaLabelRichSelectField:"Tr\\u01B0\\u1EDDng ch\\u1ECDn n\\xE2ng cao",ariaLabelRi';
      S = S + 'chSelectToggleSelection:"Nh\\u1EA5n SPACE \\u0111\\u1EC3 chuy\\u1EC3n \\u0111\\u1ED5i l\\u1EF1a ch\\u1ECDn",ariaLabelRichSelectDeselectAllItems:"Nh\\u1EA5n DELETE \\u0111\\u1EC3 b\\u1ECF ch\\u1ECDn t\\u1EA5t c\\u1EA3 c\\xE1c m\\u1EE5c",ariaLabelRichSelectDeleteSelection:"Nh\\u1EA5n DELETE \\u0111\\u1EC3 b\\u1ECF ch\\u1ECDn m\\u1EE5c",ariaLabelTooltip:"Ch\\xFA gi\\u1EA3i c\\xF4ng c\\u1EE5",ariaLabelContextMenu:"Tr\\xECnh \\u0111\\u01A1n ng\\u1EEF c\\u1EA3nh",ariaLabelSubMenu:"Tr\\xECnh \\u0111\\u01A1n ph\\u1EE5",ariaLabelAggregationFunction:"H\\xE0m t\\u1ED5ng h\\u1EE3p",ariaLabelAdvancedFilterAutocomplete:"T\\u1EF1 \\u0111\\u1ED9ng ho\\xE0n th\\xE0nh b\\u1ED9 l\\u1ECDc n\\xE2ng cao",ariaLabelAdvancedFilterBuilderAddField:"B\\u1ED9 l\\u1ECDc n\\xE2ng cao - Th\\xEAm tr\\u01B0\\u1EDDng",ariaLabelAdvancedFilterBuilderColumnSelectField:"B\\u1ED9 l\\u1ECDc n\\xE2ng cao - Ch\\u1ECDn c\\u1ED9t",ariaLabelAdvancedFilterBuilderOptionSelectField:"B\\u1ED9 l\\u1ECDc n\\xE2ng cao - Ch\\u1ECDn t\\xF9y ch\\u1ECDn",ariaLabelAdvancedFilterBuilderJoinSelectField:"B\\u1ED9 l\\u1ECDc n\\xE2ng cao - Ch\\u1ECDn to\\xE1n t\\u1EED n\\u1ED1i",ariaColumnPanelList:"Danh s\\xE1ch C\\u1ED9t",ariaFilterPanelList:"Danh s\\xE1ch B\\u1ED9 l\\u1ECDc",thousandSeparator:",",decimalSeparator:".",true:"\\u0110\\xFAng",false:"Sai",invalidDate:"Ng\\xE0y kh\\xF4ng h\\u1EE3p l\\u1EC7",invalidNumber:"S\\u1ED1 kh\\xF4ng h\\u1EE3p l\\u1EC7",january:"Th\\xE1ng M\\u1ED9t",february:"Th\\xE1ng Hai",march:"Th\\xE1ng Ba",april:"Th\\xE1ng T\\u01B0",may:"Th\\xE1ng N\\u0103m",june:"Th\\xE1ng S\\xE1u",july:"Th\\xE1ng B\\u1EA3y",august:"Th\\xE1ng T\\xE1m",september:"Th\\xE1ng Ch\\xEDn",october:"Th\\xE1ng M\\u01B0\\u1EDDi",november:"Th\\xE1ng M\\u01B0\\u1EDDi M\\u1ED9t",december:"Th\\xE1ng M\\u01B0\\u1EDDi Hai",timeFormatSlashesDDMMYYYY:"DD/MM/YYYY",timeFormatSlashesMMDDYYYY:"MM/DD/YYYY",timeFormatSlashesDDMMYY:"DD/MM/YY",timeFormatSlashesMMDDYY:"MM/DD/YY",timeFormatDotsDDMYY:"DD.M.YY",timeFormatDotsMDDYY:"M.DD.YY",timeFormatDashesYYYYMMDD:"YYYY-MM-DD",timeFormatSpacesDDMMMMYYYY:"DD MMMM YYYY",timeFormatHHMMSS:"HH:MM:SS",timeFormatH';
      S = S + 'HMMSSAmPm:"HH:MM:SS SA/CH"};if(typeof i.exports=="object"&&typeof o=="object"){var $=(e,u,t,l)=>{if(u&&typeof u=="object"||typeof u=="function")for(let a of Object.getOwnPropertyNames(u))!Object.prototype.hasOwnProperty.call(e,a)&&a!==t&&Object.defineProperty(e,a,{get:()=>u[a],enumerable:!(l=Object.getOwnPropertyDescriptor(u,a))||l.enumerable});return e};i.exports=$(i.exports,o)}return i.exports});' + "\r\n";
      S = S + "" + "\r\n";
      Result = S;
      return Result;
    };
    this.GlobalVariableName = function () {
      var Result = "";
      Result = "agGridLocale";
      return Result;
    };
  });
  $mod.$init = function () {
    pas["WEBLib.DataGrid.libjs"].TTMSModuleLoader.RegisterEmbeddedJavaScript($mod.TEmbeddedJSAgGridLocale.$create("Create"));
  };
});
rtl.module("WEBLib.RegularExpressions",["System","JS","Web","SysUtils","Types"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.TRegExOption = {"0": "roNone", roNone: 0, "1": "roIgnoreCase", roIgnoreCase: 1, "2": "roMultiLine", roMultiLine: 2, "3": "roSingleLine", roSingleLine: 3, "4": "roJSUnicode", roJSUnicode: 4};
  this.$rtti.$Enum("TRegExOption",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TRegExOption});
  this.$rtti.$Set("TRegExOptions",{comptype: this.$rtti["TRegExOption"]});
  rtl.recNewT(this,"TGroup",function () {
    this.FValue = "";
    this.FSuccess = false;
    this.$eq = function (b) {
      return (this.FValue === b.FValue) && (this.FSuccess === b.FSuccess);
    };
    this.$assign = function (s) {
      this.FValue = s.FValue;
      this.FSuccess = s.FSuccess;
      return this;
    };
    this.Create = function (AValue, ASuccess) {
      this.FValue = AValue;
      this.FSuccess = ASuccess;
      return this;
    };
    var $r = $mod.$rtti.$Record("TGroup",{},this);
    $r.addProperty("Value",0,rtl.string,"FValue","",2);
    $r.addProperty("Success",0,rtl.boolean,"FSuccess","",2);
  });
  this.$rtti.$Class("TGroupCollectionEnumerator");
  this.$rtti.$DynArray("TGroupArray",{eltype: this.$rtti["TGroup"]});
  rtl.recNewT(this,"TGroupCollection",function () {
    this.FNamedGroups = null;
    this.$new = function () {
      var r = Object.create(this);
      r.FList = [];
      return r;
    };
    this.$eq = function (b) {
      return (this.FList === b.FList) && (this.FNamedGroups === b.FNamedGroups);
    };
    this.$assign = function (s) {
      this.FList = rtl.arrayRef(s.FList);
      this.FNamedGroups = s.FNamedGroups;
      return this;
    };
    this.New = function (execResultArray) {
      var Result = $mod.TGroupCollection.$new();
      var arrayLength = 0;
      var i = 0;
      var resObject = null;
      var svalue = "";
      Result.FList = rtl.arraySetLength(Result.FList,$mod.TGroup,0);
      Result.FNamedGroups = new Object();
      if (rtl.length(execResultArray) === 0) return Result;
      resObject = execResultArray;
      arrayLength = rtl.trunc(resObject["length"]);
      Result.FList = rtl.arraySetLength(Result.FList,$mod.TGroup,arrayLength);
      for (var $l = 0, $end = arrayLength - 1; $l <= $end; $l++) {
        i = $l;
        if (!pas.JS.isUndefined(execResultArray[i])) {
          svalue = execResultArray[i]}
         else svalue = "";
        Result.FList[i].$assign($mod.TGroup.$new().Create(svalue,true));
      };
      if (!pas.JS.isUndefined(resObject["groups"])) {
        Result.FNamedGroups = resObject["groups"];
      };
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = rtl.length(this.FList);
      return Result;
    };
    this.GetItem = function (Index) {
      var Result = $mod.TGroup.$new();
      var LIndex = 0;
      var $tmp = pas.JS.GetValueType(Index);
      if ($tmp === pas.JS.TJSValueType.jvtString) {
        if (pas.JS.isUndefined(this.FNamedGroups["" + Index])) {
          Result.$assign($mod.TGroup.$new().Create("",false))}
         else Result.$assign($mod.TGroup.$new().Create("" + this.FNamedGroups["" + Index],true));
      } else if ($tmp === pas.JS.TJSValueType.jvtInteger) {
        LIndex = rtl.trunc(Index);
        Result.$assign(this.FList[LIndex]);
      } else {
        throw pas.SysUtils.Exception.$create("Create$1",["Invalid group index passed"]);
      };
      return Result;
    };
    this.GetEnumerator = function () {
      var Result = null;
      Result = $mod.TGroupCollectionEnumerator.$create("Create$1",[this]);
      return Result;
    };
    var $r = $mod.$rtti.$Record("TGroupCollection",{},this);
    $r.addMethod("GetEnumerator",1,[],2,$mod.$rtti["TGroupCollectionEnumerator"]);
    $r.addProperty("Count",1,rtl.longint,"GetCount","",2);
    $r.addProperty("Item",1,$mod.$rtti["TGroup"],"GetItem","",2);
  });
  rtl.createClass(this,"TGroupCollectionEnumerator",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FCollection = $mod.TGroupCollection.$new();
      this.FIndex = 0;
    };
    this.$final = function () {
      this.FCollection = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function (ACollection) {
      this.FCollection.$assign(ACollection);
      this.FIndex = -1;
      return this;
    };
    this.GetCurrent = function () {
      var Result = $mod.TGroup.$new();
      Result.$assign(this.FCollection.GetItem(this.FIndex));
      return Result;
    };
    this.MoveNext = function () {
      var Result = false;
      Result = this.FIndex < (this.FCollection.GetCount() - 1);
      if (Result) this.FIndex += 1;
      return Result;
    };
  });
  rtl.recNewT(this,"TMatch",function () {
    this.FIndex = 0;
    this.FLength = 0;
    this.FSuccess = false;
    this.FValue = "";
    this.FInput = "";
    this.FJSRegExp = null;
    this.$new = function () {
      var r = Object.create(this);
      r.FGroups = $mod.TGroupCollection.$new();
      return r;
    };
    this.$eq = function (b) {
      return (this.FIndex === b.FIndex) && (this.FLength === b.FLength) && (this.FSuccess === b.FSuccess) && this.FGroups.$eq(b.FGroups) && (this.FValue === b.FValue) && (this.FInput === b.FInput) && (this.FJSRegExp === b.FJSRegExp);
    };
    this.$assign = function (s) {
      this.FIndex = s.FIndex;
      this.FLength = s.FLength;
      this.FSuccess = s.FSuccess;
      this.FGroups.$assign(s.FGroups);
      this.FValue = s.FValue;
      this.FInput = s.FInput;
      this.FJSRegExp = s.FJSRegExp;
      return this;
    };
    this.Create = function (AJSRegExp, execResultArray) {
      var resObject = null;
      var str = "";
      this.FJSRegExp = AJSRegExp;
      if (rtl.length(execResultArray) === 0) {
        this.FValue = "";
        this.FIndex = 0;
        this.FLength = 0;
        this.FSuccess = false;
      } else {
        resObject = execResultArray;
        this.FInput = "" + resObject["input"];
        str = execResultArray[0];
        this.FValue = str;
        this.FIndex = rtl.trunc(resObject["index"]) + 1;
        this.FLength = str.length;
        this.FSuccess = true;
      };
      this.FGroups.$assign($mod.TGroupCollection.New(rtl.arrayRef(execResultArray)));
      return this;
    };
    this.New = function () {
      var Result = $mod.TMatch.$new();
      Result.FValue = "";
      Result.FIndex = 0;
      Result.FLength = 0;
      Result.FSuccess = false;
      return Result;
    };
    this.GetGroups = function () {
      var Result = $mod.TGroupCollection.$new();
      Result.$assign(this.FGroups);
      return Result;
    };
    this.NextMatch = function () {
      var Result = $mod.TMatch.$new();
      var execResultArray = [];
      if (this.FJSRegExp === null) {
        Result.$assign(this.New());
        return Result;
      };
      execResultArray = this.FJSRegExp.exec(this.FInput);
      Result.$assign($mod.TMatch.$new().Create(this.FJSRegExp,rtl.arrayRef(execResultArray)));
      return Result;
    };
    var $r = $mod.$rtti.$Record("TMatch",{},this);
    $r.addMethod("NextMatch",1,[],2,$r);
    $r.addProperty("Groups",1,$mod.$rtti["TGroupCollection"],"GetGroups","",2);
    $r.addProperty("Index",0,rtl.longint,"FIndex","",2);
    $r.addProperty("Length",0,rtl.longint,"FLength","",2);
    $r.addProperty("Success",0,rtl.boolean,"FSuccess","FSuccess",2);
    $r.addProperty("Value",0,rtl.string,"FValue","",2);
  });
  this.$rtti.$Class("TMatchCollectionEnumerator");
  this.$rtti.$DynArray("TMatchArray",{eltype: this.$rtti["TMatch"]});
  rtl.recNewT(this,"TMatchCollection",function () {
    this.$new = function () {
      var r = Object.create(this);
      r.FList = [];
      return r;
    };
    this.$eq = function (b) {
      return this.FList === b.FList;
    };
    this.$assign = function (s) {
      this.FList = rtl.arrayRef(s.FList);
      return this;
    };
    this.New = function (aMatch) {
      var Result = $mod.TMatchCollection.$new();
      var Count = 0;
      Count = 0;
      Result.FList = rtl.arraySetLength(Result.FList,$mod.TMatch,0);
      if (!aMatch.FSuccess) return Result;
      while (aMatch.FSuccess) {
        if ((Count % 10) === 0) Result.FList = rtl.arraySetLength(Result.FList,$mod.TMatch,rtl.length(Result.FList) + 10);
        Result.FList[Count].$assign(aMatch);
        aMatch.$assign(aMatch.NextMatch());
        Count += 1;
      };
      if (rtl.length(Result.FList) > Count) Result.FList = rtl.arraySetLength(Result.FList,$mod.TMatch,Count);
      return Result;
    };
    this.GetCount = function () {
      var Result = 0;
      Result = rtl.length(this.FList);
      return Result;
    };
    this.GetItem = function (Index) {
      var Result = $mod.TMatch.$new();
      if ((Index >= 0) && (Index < rtl.length(this.FList))) {
        Result.$assign(this.FList[Index])}
       else throw pas.SysUtils.Exception.$create("Create$1",["Invalid match collection index passed."]);
      return Result;
    };
    this.GetEnumerator = function () {
      var Result = null;
      Result = $mod.TMatchCollectionEnumerator.$create("Create$1",[this]);
      return Result;
    };
    var $r = $mod.$rtti.$Record("TMatchCollection",{},this);
    $r.addMethod("GetEnumerator",1,[],2,$mod.$rtti["TMatchCollectionEnumerator"]);
    $r.addProperty("Count",1,rtl.longint,"GetCount","",2);
    $r.addProperty("Item",1,$mod.$rtti["TMatch"],"GetItem","",2);
  });
  rtl.createClass(this,"TMatchCollectionEnumerator",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.FCollection = $mod.TMatchCollection.$new();
      this.FIndex = 0;
    };
    this.$final = function () {
      this.FCollection = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function (ACollection) {
      this.FCollection.$assign(ACollection);
      this.FIndex = -1;
      return this;
    };
    this.GetCurrent = function () {
      var Result = $mod.TMatch.$new();
      Result.$assign(this.FCollection.GetItem(this.FIndex));
      return Result;
    };
    this.MoveNext = function () {
      var Result = false;
      Result = this.FIndex < (this.FCollection.GetCount() - 1);
      if (Result) this.FIndex += 1;
      return Result;
    };
  });
  this.$rtti.$MethodVar("TMatchEvaluator",{procsig: rtl.newTIProcSig([["Match",this.$rtti["TMatch"],2]],rtl.string), methodkind: 1});
  rtl.recNewT(this,"TRegEx",function () {
    this.FJSRegExp = null;
    this.FPattern = "";
    this.FMatchEvaluator = null;
    this.$new = function () {
      var r = Object.create(this);
      r.FOptions = {};
      return r;
    };
    this.$eq = function (b) {
      return (this.FJSRegExp === b.FJSRegExp) && (this.FPattern === b.FPattern) && rtl.eqSet(this.FOptions,b.FOptions) && rtl.eqCallback(this.FMatchEvaluator,b.FMatchEvaluator);
    };
    this.$assign = function (s) {
      this.FJSRegExp = s.FJSRegExp;
      this.FPattern = s.FPattern;
      this.FOptions = rtl.refSet(s.FOptions);
      this.FMatchEvaluator = s.FMatchEvaluator;
      return this;
    };
    this.GetJSRegExFlags = function (AddJSFlags) {
      var Result = "";
      Result = "g" + AddJSFlags;
      if ($mod.TRegExOption.roIgnoreCase in this.FOptions) Result = Result + "i";
      if ($mod.TRegExOption.roMultiLine in this.FOptions) Result = Result + "m";
      if ($mod.TRegExOption.roSingleLine in this.FOptions) Result = Result + "s";
      if ($mod.TRegExOption.roJSUnicode in this.FOptions) Result = Result + "u";
      return Result;
    };
    this.DoOnReplace = function (match, offsetDontUse, InputDontUse) {
      var Result = "";
      var execResultArray = [];
      var i = 0;
      var numArgs = 0;
      var aMatch = $mod.TMatch.$new();
      numArgs = arguments.length;
      execResultArray = rtl.arraySetLength(execResultArray,"",numArgs - 2);
      for (var $l = 0, $end = rtl.length(execResultArray) - 1; $l <= $end; $l++) {
        i = $l;
        execResultArray[i] = "" + arguments[i];
      };
      execResultArray["index"] = rtl.trunc(arguments[numArgs - 2]);
      execResultArray["input"] = "" + arguments[numArgs - 1];
      aMatch.$assign($mod.TMatch.$new().Create(this.FJSRegExp,rtl.arrayRef(execResultArray)));
      Result = this.FMatchEvaluator(aMatch);
      return Result;
    };
    this.Create = function (Pattern) {
      this.Create$1(Pattern,{});
      return this;
    };
    this.Create$1 = function (Pattern, Options) {
      var exe = null;
      var excName = "";
      var excMsg = "";
      this.FPattern = $impl.RemoveLineEnding(Pattern);
      this.FOptions = rtl.refSet(Options);
      try {
        this.FJSRegExp = new RegExp(this.FPattern,this.GetJSRegExFlags(""));
      } catch ($e) {
        exe = $e;
        if (!$impl.GetJSExceptionDetails(exe,{get: function () {
            return excName;
          }, set: function (v) {
            excName = v;
          }},{get: function () {
            return excMsg;
          }, set: function (v) {
            excMsg = v;
          }})) throw exe;
        excMsg = $impl.FormatErrorMessage(excName,excMsg);
        throw pas.SysUtils.Exception.$create("Create$1",[excMsg]);
      };
      return this;
    };
    this.IsMatch = function (Input) {
      var Result = false;
      Result = this.IsMatch$1(Input,1);
      return Result;
    };
    this.IsMatch$1 = function (Input, StartPos) {
      var Result = false;
      var exe = null;
      var excName = "";
      var excMsg = "";
      try {
        this.FJSRegExp.lastIndex = StartPos - 1;
        Result = rtl.length(this.FJSRegExp.exec(Input)) > 0;
      } catch ($e) {
        exe = $e;
        if (!$impl.GetJSExceptionDetails(exe,{get: function () {
            return excName;
          }, set: function (v) {
            excName = v;
          }},{get: function () {
            return excMsg;
          }, set: function (v) {
            excMsg = v;
          }})) throw exe;
        excMsg = $impl.FormatErrorMessage(excName,excMsg);
        throw pas.SysUtils.Exception.$create("Create$1",[excMsg]);
      };
      return Result;
    };
    this.IsMatch$2 = function (Input, Pattern) {
      var Result = false;
      var aRegEx = $mod.TRegEx.$new();
      aRegEx.$assign($mod.TRegEx.$new().Create(Pattern));
      Result = aRegEx.IsMatch(Input);
      return Result;
    };
    this.IsMatch$3 = function (Input, Pattern, Options) {
      var Result = false;
      var aRegEx = $mod.TRegEx.$new();
      aRegEx.$assign($mod.TRegEx.$new().Create$1(Pattern,rtl.refSet(Options)));
      Result = aRegEx.IsMatch(Input);
      return Result;
    };
    var Special = ["\\","[","]","^","$",".","|","?","*","+","(",")","{","}"];
    this.Escape = function (Str, UseWildCards) {
      var Result = "";
      var I = 0;
      Result = Str;
      for (I = 1; I <= 14; I++) {
        Result = pas.SysUtils.StringReplace(Result,Special[I - 1],"\\" + Special[I - 1],rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
      };
      Result = pas.SysUtils.StringReplace(Result,"\r\n","\\r\\n",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
      Result = pas.SysUtils.StringReplace(Result,"\n","\\n",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
      if (UseWildCards) {
        Result = pas.SysUtils.StringReplace(Result,"\\*","(.*)",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
        Result = pas.SysUtils.StringReplace(Result,"\\?","(.)",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
        Result = pas.SysUtils.StringReplace(Result,"(.*)(.*)","\\*",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
        Result = pas.SysUtils.StringReplace(Result,"(.)(.)","\\?",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
      };
      return Result;
    };
    this.Match = function (Input) {
      var Result = $mod.TMatch.$new();
      Result.$assign(this.Match$1(Input,1));
      return Result;
    };
    this.Match$1 = function (Input, StartPos) {
      var Result = $mod.TMatch.$new();
      var execResultArray = [];
      this.FJSRegExp.lastIndex = StartPos - 1;
      execResultArray = this.FJSRegExp.exec(Input);
      Result.$assign($mod.TMatch.$new().Create(this.FJSRegExp,rtl.arrayRef(execResultArray)));
      return Result;
    };
    this.Match$2 = function (Input, StartPos, Length) {
      var Result = $mod.TMatch.$new();
      var substr = "";
      substr = pas.System.Copy(Input,1,(StartPos + Length) - 1);
      Result.$assign(this.Match$1(substr,StartPos));
      return Result;
    };
    this.Match$3 = function (Input, Pattern) {
      var Result = $mod.TMatch.$new();
      var aRegEx = $mod.TRegEx.$new();
      aRegEx.$assign($mod.TRegEx.$new().Create(Pattern));
      Result.$assign(aRegEx.Match(Input));
      return Result;
    };
    this.Match$4 = function (Input, Pattern, Options) {
      var Result = $mod.TMatch.$new();
      var aRegEx = $mod.TRegEx.$new();
      aRegEx.$assign($mod.TRegEx.$new().Create$1(Pattern,rtl.refSet(Options)));
      Result.$assign(aRegEx.Match(Input));
      return Result;
    };
    this.Matches = function (Input) {
      var Result = $mod.TMatchCollection.$new();
      Result.$assign(this.Matches$1(Input,1));
      return Result;
    };
    this.Matches$1 = function (Input, StartPos) {
      var Result = $mod.TMatchCollection.$new();
      var aMatch = $mod.TMatch.$new();
      aMatch.$assign(this.Match$1(Input,StartPos));
      Result.$assign($mod.TMatchCollection.New($mod.TMatch.$clone(aMatch)));
      return Result;
    };
    this.Matches$2 = function (Input, Pattern) {
      var Result = $mod.TMatchCollection.$new();
      var aRegEx = $mod.TRegEx.$new();
      aRegEx.$assign($mod.TRegEx.$new().Create(Pattern));
      Result.$assign(aRegEx.Matches(Input));
      return Result;
    };
    this.Matches$3 = function (Input, Pattern, Options) {
      var Result = $mod.TMatchCollection.$new();
      var aRegEx = $mod.TRegEx.$new();
      aRegEx.$assign($mod.TRegEx.$new().Create$1(Pattern,rtl.refSet(Options)));
      Result.$assign(aRegEx.Matches(Input));
      return Result;
    };
    this.Replace = function (Input, Replacement) {
      var Result = "";
      var anStr = null;
      anStr = new String(Input);
      Result = anStr.replace(this.FJSRegExp,Replacement);
      return Result;
    };
    this.Replace$1 = function (Input, Evaluator) {
      var Result = "";
      var anStr = null;
      anStr = new String(Input);
      this.FMatchEvaluator = Evaluator;
      try {
        Result = anStr.replace(this.FJSRegExp,rtl.createCallback(this,"DoOnReplace"));
      } finally {
        this.FMatchEvaluator = null;
      };
      return Result;
    };
    this.Replace$2 = function (Input, Pattern, Replacement) {
      var Result = "";
      var aRegEx = $mod.TRegEx.$new();
      aRegEx.$assign($mod.TRegEx.$new().Create(Pattern));
      Result = aRegEx.Replace(Input,Replacement);
      return Result;
    };
    this.Replace$3 = function (Input, Pattern, Evaluator) {
      var Result = "";
      var aRegEx = $mod.TRegEx.$new();
      aRegEx.$assign($mod.TRegEx.$new().Create(Pattern));
      Result = aRegEx.Replace$1(Input,Evaluator);
      return Result;
    };
    this.Replace$4 = function (Input, Pattern, Replacement, Options) {
      var Result = "";
      var aRegEx = $mod.TRegEx.$new();
      aRegEx.$assign($mod.TRegEx.$new().Create$1(Pattern,rtl.refSet(Options)));
      Result = aRegEx.Replace(Input,Replacement);
      return Result;
    };
    this.Replace$5 = function (Input, Pattern, Evaluator, Options) {
      var Result = "";
      var aRegEx = $mod.TRegEx.$new();
      aRegEx.$assign($mod.TRegEx.$new().Create$1(Pattern,rtl.refSet(Options)));
      Result = aRegEx.Replace$1(Input,Evaluator);
      return Result;
    };
    this.Split = function (Input) {
      var Result = [];
      var anStr = null;
      anStr = new String(Input);
      Result = anStr.split(this.FJSRegExp);
      return Result;
    };
    this.Split$1 = function (Input, Pattern) {
      var Result = [];
      var aRegEx = $mod.TRegEx.$new();
      aRegEx.$assign($mod.TRegEx.$new().Create(Pattern));
      Result = aRegEx.Split(Input);
      return Result;
    };
    this.Split$2 = function (Input, Pattern, Options) {
      var Result = [];
      var aRegEx = $mod.TRegEx.$new();
      aRegEx.$assign($mod.TRegEx.$new().Create$1(Pattern,rtl.refSet(Options)));
      Result = aRegEx.Split(Input);
      return Result;
    };
    var $r = $mod.$rtti.$Record("TRegEx",{},this);
    $r.addMethod("Create",2,[["Pattern",rtl.string,2]]);
    $r.addMethod("Create$1",2,[["Pattern",rtl.string,2],["Options",$mod.$rtti["TRegExOptions"]]]);
    $r.addMethod("IsMatch",1,[["Input",rtl.string,2]],2,rtl.boolean);
    $r.addMethod("IsMatch$1",1,[["Input",rtl.string,2],["StartPos",rtl.longint]],2,rtl.boolean);
    $r.addMethod("IsMatch$2",5,[["Input",rtl.string,2],["Pattern",rtl.string,2]],2,rtl.boolean,1);
    $r.addMethod("IsMatch$3",5,[["Input",rtl.string,2],["Pattern",rtl.string,2],["Options",$mod.$rtti["TRegExOptions"]]],2,rtl.boolean,1);
    $r.addMethod("Escape",5,[["Str",rtl.string,2],["UseWildCards",rtl.boolean]],2,rtl.string,1);
    $r.addMethod("Match",1,[["Input",rtl.string,2]],2,$mod.$rtti["TMatch"]);
    $r.addMethod("Match$1",1,[["Input",rtl.string,2],["StartPos",rtl.longint]],2,$mod.$rtti["TMatch"]);
    $r.addMethod("Match$2",1,[["Input",rtl.string,2],["StartPos",rtl.longint],["Length",rtl.longint]],2,$mod.$rtti["TMatch"]);
    $r.addMethod("Match$3",5,[["Input",rtl.string,2],["Pattern",rtl.string,2]],2,$mod.$rtti["TMatch"],1);
    $r.addMethod("Match$4",5,[["Input",rtl.string,2],["Pattern",rtl.string,2],["Options",$mod.$rtti["TRegExOptions"]]],2,$mod.$rtti["TMatch"],1);
    $r.addMethod("Matches",1,[["Input",rtl.string,2]],2,$mod.$rtti["TMatchCollection"]);
    $r.addMethod("Matches$1",1,[["Input",rtl.string,2],["StartPos",rtl.longint]],2,$mod.$rtti["TMatchCollection"]);
    $r.addMethod("Matches$2",5,[["Input",rtl.string,2],["Pattern",rtl.string,2]],2,$mod.$rtti["TMatchCollection"],1);
    $r.addMethod("Matches$3",5,[["Input",rtl.string,2],["Pattern",rtl.string,2],["Options",$mod.$rtti["TRegExOptions"]]],2,$mod.$rtti["TMatchCollection"],1);
    $r.addMethod("Replace",1,[["Input",rtl.string,2],["Replacement",rtl.string,2]],2,rtl.string);
    $r.addMethod("Replace$1",1,[["Input",rtl.string,2],["Evaluator",$mod.$rtti["TMatchEvaluator"]]],2,rtl.string);
    $r.addMethod("Replace$2",5,[["Input",rtl.string,2],["Pattern",rtl.string,2],["Replacement",rtl.string,2]],2,rtl.string,1);
    $r.addMethod("Replace$3",5,[["Input",rtl.string,2],["Pattern",rtl.string,2],["Evaluator",$mod.$rtti["TMatchEvaluator"]]],2,rtl.string,1);
    $r.addMethod("Replace$4",5,[["Input",rtl.string,2],["Pattern",rtl.string,2],["Replacement",rtl.string,2],["Options",$mod.$rtti["TRegExOptions"]]],2,rtl.string,1);
    $r.addMethod("Replace$5",5,[["Input",rtl.string,2],["Pattern",rtl.string,2],["Evaluator",$mod.$rtti["TMatchEvaluator"]],["Options",$mod.$rtti["TRegExOptions"]]],2,rtl.string,1);
    $r.addMethod("Split",1,[["Input",rtl.string,2]],2,pas.Types.$rtti["TStringDynArray"]);
    $r.addMethod("Split$1",5,[["Input",rtl.string,2],["Pattern",rtl.string,2]],2,pas.Types.$rtti["TStringDynArray"],1);
    $r.addMethod("Split$2",5,[["Input",rtl.string,2],["Pattern",rtl.string,2],["Options",$mod.$rtti["TRegExOptions"]]],2,pas.Types.$rtti["TStringDynArray"],1);
  });
  $mod.$implcode = function () {
    $impl.GetJSExceptionDetails = function (ExceptObject, errorName, errorMsg) {
      var Result = false;
      var erName = "";
      var erMsg = "";
      Result = false;
      if (pas.SysUtils.Exception.isPrototypeOf(ExceptObject)) return Result;
      Result = true;
      erName = ExceptObject.name;
      erMsg = ExceptObject.message;
      errorName.set(erName);
      errorMsg.set(erMsg);
      return Result;
    };
    $impl.FormatErrorMessage = function (errorName, errorMessage) {
      var Result = "";
      Result = pas.SysUtils.Format("%s: %s",pas.System.VarRecs(18,errorName,18,errorMessage));
      return Result;
    };
    $impl.RemoveLineEnding = function (aPattern) {
      var Result = "";
      Result = pas.StrUtils.TrimRightSet(aPattern,["\n","\r"]);
      Result = pas.StrUtils.TrimLeftSet(Result,["\n","\r"]);
      return Result;
    };
  };
},["StrUtils"]);
rtl.module("WEBLib.DataGrid.Formatting",["System","WEBLib.Dialogs","Classes","WEBLib.Controls","WEBLib.DataGrid.libjs","Types","JS","jsdelphisystem","Web","SysUtils"],function () {
  "use strict";
  var $mod = this;
  this.TDGFNCurrencyDisplay = {"0": "dgfnCD_Default", dgfnCD_Default: 0, "1": "dgfnCD_Symbol", dgfnCD_Symbol: 1, "2": "dgfnCD_Code", dgfnCD_Code: 2, "3": "dgfnCD_Name", dgfnCD_Name: 3};
  this.$rtti.$Enum("TDGFNCurrencyDisplay",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TDGFNCurrencyDisplay});
  this.TDGFNLocaleMatcher = {"0": "dgfnLM_Default", dgfnLM_Default: 0, "1": "dgfnLM_BestFit", dgfnLM_BestFit: 1, "2": "dgfnLM_Lookup", dgfnLM_Lookup: 2};
  this.$rtti.$Enum("TDGFNLocaleMatcher",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TDGFNLocaleMatcher});
  this.TDGFNStyle = {"0": "dgfnS_Default", dgfnS_Default: 0, "1": "dgfnS_Decimal", dgfnS_Decimal: 1, "2": "dgfnS_Currency", dgfnS_Currency: 2, "3": "dgfnS_Percent", dgfnS_Percent: 3};
  this.$rtti.$Enum("TDGFNStyle",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TDGFNStyle});
  this.TDGFNUseGrouping = {"0": "dgfnUG_Default", dgfnUG_Default: 0, "1": "dgfnUG_Always", dgfnUG_Always: 1, "2": "dgfnUG_Auto", dgfnUG_Auto: 2, "3": "dgfnUG_Min2", dgfnUG_Min2: 3, "4": "dgfnUG_True", dgfnUG_True: 4, "5": "dgfnUG_False", dgfnUG_False: 5};
  this.$rtti.$Enum("TDGFNUseGrouping",{minvalue: 0, maxvalue: 5, ordtype: 1, enumtype: this.TDGFNUseGrouping});
  this.TDGFDLocaleMatcher = {"0": "dgfdLM_Default", dgfdLM_Default: 0, "1": "dgfdLM_Lookup", dgfdLM_Lookup: 1, "2": "dgfdLM_BestFit", dgfdLM_BestFit: 2};
  this.$rtti.$Enum("TDGFDLocaleMatcher",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TDGFDLocaleMatcher});
  this.TDGFDHour12 = {"0": "dgfdH12_Default", dgfdH12_Default: 0, "1": "dgfdH12_True", dgfdH12_True: 1, "2": "dgfdH12_False", dgfdH12_False: 2};
  this.$rtti.$Enum("TDGFDHour12",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TDGFDHour12});
  this.TDGFDHourCycle = {"0": "dgfdHC_Default", dgfdHC_Default: 0, "1": "dgfdHC_H11", dgfdHC_H11: 1, "2": "dgfdHC_H12", dgfdHC_H12: 2, "3": "dgfdHC_H23", dgfdHC_H23: 3, "4": "dgfdHC_H24", dgfdHC_H24: 4};
  this.$rtti.$Enum("TDGFDHourCycle",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TDGFDHourCycle});
  this.TDGFDWeekday = {"0": "dgfdW_Default", dgfdW_Default: 0, "1": "dgfdW_Long", dgfdW_Long: 1, "2": "dgfdW_Short", dgfdW_Short: 2, "3": "dgfdW_Narrow", dgfdW_Narrow: 3};
  this.$rtti.$Enum("TDGFDWeekday",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TDGFDWeekday});
  this.TDGFDEra = {"0": "dgfdE_Default", dgfdE_Default: 0, "1": "dgfdE_Long", dgfdE_Long: 1, "2": "dgfdE_Short", dgfdE_Short: 2, "3": "dgfdE_Narrow", dgfdE_Narrow: 3};
  this.$rtti.$Enum("TDGFDEra",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TDGFDEra});
  this.TDGFDYear = {"0": "dgfdY_Default", dgfdY_Default: 0, "1": "dgfdY_Numeric", dgfdY_Numeric: 1, "2": "dgfdY_2Digit", dgfdY_2Digit: 2};
  this.$rtti.$Enum("TDGFDYear",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TDGFDYear});
  this.TDGFDMonth = {"0": "dgfdM_Default", dgfdM_Default: 0, "1": "dgfdM_Numeric", dgfdM_Numeric: 1, "2": "dgfdM_2Digit", dgfdM_2Digit: 2, "3": "dgfdM_Long", dgfdM_Long: 3, "4": "dgfdM_Short", dgfdM_Short: 4, "5": "dgfdM_Narrow", dgfdM_Narrow: 5};
  this.$rtti.$Enum("TDGFDMonth",{minvalue: 0, maxvalue: 5, ordtype: 1, enumtype: this.TDGFDMonth});
  this.TDGFDDay = {"0": "dgfdD_Default", dgfdD_Default: 0, "1": "dgfdD_Numeric", dgfdD_Numeric: 1, "2": "dgfdD_2Digit", dgfdD_2Digit: 2};
  this.$rtti.$Enum("TDGFDDay",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TDGFDDay});
  this.TDGFDDayPeriod = {"0": "dgfdDP_Default", dgfdDP_Default: 0, "1": "dgfdDP_Narrow", dgfdDP_Narrow: 1, "2": "dgfdDP_Short", dgfdDP_Short: 2, "3": "dgfdDP_Long", dgfdDP_Long: 3};
  this.$rtti.$Enum("TDGFDDayPeriod",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TDGFDDayPeriod});
  this.TDGFDHour = {"0": "dgfdH_Default", dgfdH_Default: 0, "1": "dgfdH_Numeric", dgfdH_Numeric: 1, "2": "dgfdH_2Digit", dgfdH_2Digit: 2};
  this.$rtti.$Enum("TDGFDHour",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TDGFDHour});
  this.TDGFDMinute = {"0": "dgfdMi_Default", dgfdMi_Default: 0, "1": "dgfdMi_Numeric", dgfdMi_Numeric: 1, "2": "dgfdMi_2Digit", dgfdMi_2Digit: 2};
  this.$rtti.$Enum("TDGFDMinute",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TDGFDMinute});
  this.TDGFDSecond = {"0": "dgfdS_Default", dgfdS_Default: 0, "1": "dgfdS_Numeric", dgfdS_Numeric: 1, "2": "dgfdS_2Digit", dgfdS_2Digit: 2};
  this.$rtti.$Enum("TDGFDSecond",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TDGFDSecond});
  this.TDGFDTimeZoneName = {"0": "dgfdTZN_Default", dgfdTZN_Default: 0, "1": "dgfdTZN_Long", dgfdTZN_Long: 1, "2": "dgfdTZN_Short", dgfdTZN_Short: 2, "3": "dgfdTZN_ShortOffset", dgfdTZN_ShortOffset: 3, "4": "dgfdTZN_LongOffset", dgfdTZN_LongOffset: 4, "5": "dgfdTZN_ShortGeneric", dgfdTZN_ShortGeneric: 5, "6": "dgfdTZN_LongGeneric", dgfdTZN_LongGeneric: 6};
  this.$rtti.$Enum("TDGFDTimeZoneName",{minvalue: 0, maxvalue: 6, ordtype: 1, enumtype: this.TDGFDTimeZoneName});
  this.TDGFDFormatMatcher = {"0": "dgfdFM_Default", dgfdFM_Default: 0, "1": "dgfdFM_Basic", dgfdFM_Basic: 1, "2": "dgfdFM_BestFit", dgfdFM_BestFit: 2};
  this.$rtti.$Enum("TDGFDFormatMatcher",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TDGFDFormatMatcher});
  this.TDGFDDateStyle = {"0": "dgfdDS_Default", dgfdDS_Default: 0, "1": "dgfdDS_Full", dgfdDS_Full: 1, "2": "dgfdDS_Long", dgfdDS_Long: 2, "3": "dgfdDS_Medium", dgfdDS_Medium: 3, "4": "dgfdDS_Short", dgfdDS_Short: 4};
  this.$rtti.$Enum("TDGFDDateStyle",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TDGFDDateStyle});
  this.TDGFDTimeStyle = {"0": "dgfdTS_Default", dgfdTS_Default: 0, "1": "dgfdTS_Full", dgfdTS_Full: 1, "2": "dgfdTS_Long", dgfdTS_Long: 2, "3": "dgfdTS_Medium", dgfdTS_Medium: 3, "4": "dgfdTS_Short", dgfdTS_Short: 4};
  this.$rtti.$Enum("TDGFDTimeStyle",{minvalue: 0, maxvalue: 4, ordtype: 1, enumtype: this.TDGFDTimeStyle});
  rtl.createClass(this,"TDGJsonConfigBaseComponent",pas.Classes.TComponent,function () {
    this.$init = function () {
      pas.Classes.TComponent.$init.call(this);
      this.FJsonConfig = "";
    };
    this._GetString = function (Name) {
      var Result = "";
      var JsonStr = "";
      var JSVal = undefined;
      var JsonObj = null;
      Result = "";
      JsonStr = this.FJsonConfig;
      JsonObj = null;
      try {
        JSVal = JSON.parse(JsonStr);
        if (typeof(JSVal) === "object") JsonObj = JSVal;
      } catch ($e) {
      };
      if (JsonObj !== null) {
        try {
          Result = "" + JsonObj[Name];
        } catch ($e) {
        };
      };
      return Result;
    };
    this._SetString = function (Name, Value) {
      var JsonStr = "";
      var JSVal = undefined;
      var JsonObj = null;
      JsonStr = this.FJsonConfig;
      JsonObj = null;
      try {
        JSVal = JSON.parse(JsonStr);
        if (typeof(JSVal) === "object") JsonObj = JSVal;
      } catch ($e) {
      };
      if (JsonObj === null) JsonObj = pas.JS.New([]);
      if (JsonObj !== null) {
        if (Value !== "") {
          if (pas.System.Copy(Value,1,2) === "''") {
            JsonObj[Name] = pas.System.Copy$1(Value,3)}
           else JsonObj[Name] = Value;
        } else pas.JS.JSDelete(JsonObj,Name);
        this.FJsonConfig = JSON.stringify(JsonObj);
      };
    };
    this._GetInteger = function (Name) {
      var Result = "";
      var JsonStr = "";
      var JSVal = undefined;
      var JsonObj = null;
      Result = "";
      JsonStr = this.FJsonConfig;
      JsonObj = null;
      try {
        JSVal = JSON.parse(JsonStr);
        if (typeof(JSVal) === "object") JsonObj = JSVal;
      } catch ($e) {
      };
      if (JsonObj !== null) {
        try {
          Result = "" + JsonObj[Name];
        } catch ($e) {
        };
      };
      return Result;
    };
    this._SetInteger = function (Name, Value) {
      var JsonStr = "";
      var JSVal = undefined;
      var JsonObj = null;
      var IntegerVal = 0;
      JsonStr = this.FJsonConfig;
      JsonObj = null;
      try {
        JSVal = JSON.parse(JsonStr);
        if (typeof(JSVal) === "object") JsonObj = JSVal;
      } catch ($e) {
      };
      if (JsonObj === null) JsonObj = pas.JS.New([]);
      if (JsonObj !== null) {
        if (Value !== "") {
          try {
            IntegerVal = parseInt(Value);
            JsonObj[Name] = IntegerVal;
          } catch ($e) {
          };
        } else pas.JS.JSDelete(JsonObj,Name);
        this.FJsonConfig = JSON.stringify(JsonObj);
      };
    };
    this._GetFloat = function (Name) {
      var Result = "";
      var JsonStr = "";
      var JSVal = undefined;
      var JsonObj = null;
      Result = "";
      JsonStr = this.FJsonConfig;
      JsonObj = null;
      try {
        JSVal = JSON.parse(JsonStr);
        if (typeof(JSVal) === "object") JsonObj = JSVal;
      } catch ($e) {
      };
      if (JsonObj !== null) {
        try {
          Result = "" + JsonObj[Name];
        } catch ($e) {
        };
      };
      return Result;
    };
    this._SetFloat = function (Name, Value) {
      var JsonStr = "";
      var JSVal = undefined;
      var JsonObj = null;
      var DoubleVal = 0.0;
      JsonStr = this.FJsonConfig;
      JsonObj = null;
      try {
        JSVal = JSON.parse(JsonStr);
        if (typeof(JSVal) === "object") JsonObj = JSVal;
      } catch ($e) {
      };
      if (JsonObj === null) JsonObj = pas.JS.New([]);
      if (JsonObj !== null) {
        if (Value !== "") {
          try {
            DoubleVal = parseFloat(Value);
            JsonObj[Name] = DoubleVal;
          } catch ($e) {
          };
        } else pas.JS.JSDelete(JsonObj,Name);
        this.FJsonConfig = JSON.stringify(JsonObj);
      };
    };
    this._GetBoolean = function (Name) {
      var Result = "";
      var JsonStr = "";
      var JSVal = undefined;
      var JsonObj = null;
      window.console.log("TDGJsonConfigBaseComponent._GetBoolean(" + Name + ")");
      Result = "";
      JsonStr = this.FJsonConfig;
      JsonObj = null;
      try {
        JSVal = JSON.parse(JsonStr);
        if (typeof(JSVal) === "object") JsonObj = JSVal;
      } catch ($e) {
      };
      if (JsonObj !== null) {
        try {
          if (JsonObj[Name] == true) {
            Result = "True"}
           else if (JsonObj[Name] == false) Result = "False";
        } catch ($e) {
        };
      };
      return Result;
    };
    this._SetBoolean = function (Name, Value) {
      var JsonStr = "";
      var JSVal = undefined;
      var JsonObj = null;
      JsonStr = this.FJsonConfig;
      JsonObj = null;
      try {
        JSVal = JSON.parse(JsonStr);
        if (typeof(JSVal) === "object") JsonObj = JSVal;
      } catch ($e) {
      };
      if (JsonObj === null) JsonObj = pas.JS.New([]);
      if (JsonObj !== null) {
        if (Value !== "") {
          if ((pas.SysUtils.LowerCase(pas.System.Copy(Value,1,1)) === "t") || (Value === "1")) {
            JsonObj[Name] = true;
          } else if ((pas.SysUtils.LowerCase(pas.System.Copy(Value,1,1)) === "f") || (Value === "0")) {
            JsonObj[Name] = false;
          };
        } else pas.JS.JSDelete(JsonObj,Name);
        this.FJsonConfig = JSON.stringify(JsonObj);
      };
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("_JsonConfig_",0,rtl.string,"FJsonConfig","FJsonConfig");
  });
  rtl.createClass(this,"TDGFormatBase",this.TDGJsonConfigBaseComponent,function () {
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TDGNumberFormatBase",this.TDGFormatBase,function () {
    this.SetMaximumFractionDigits = function (Value) {
      this._SetInteger("maximumFractionDigits",Value);
    };
    this.SetMaximumSignificantDigits = function (Value) {
      this._SetInteger("maximumSignificantDigits",Value);
    };
    this.SetMinimumFractionDigits = function (Value) {
      this._SetInteger("minimumFractionDigits",Value);
    };
    this.SetMinimumIntegerDigits = function (Value) {
      this._SetInteger("minimumIntegerDigits",Value);
    };
    this.SetMinimumSignificantDigits = function (Value) {
      this._SetInteger("minimumSignificantDigits",Value);
    };
    this.GetCurrency = function () {
      var Result = "";
      Result = this._GetString("currency");
      return Result;
    };
    this.SetCurrency = function (Value) {
      this._SetString("currency",Value);
      if ((Value !== "") && (this.GetStyle() === $mod.TDGFNStyle.dgfnS_Default)) {
        this.SetStyle($mod.TDGFNStyle.dgfnS_Currency)}
       else if ((Value === "") && (this.GetStyle() === $mod.TDGFNStyle.dgfnS_Currency)) this.SetStyle($mod.TDGFNStyle.dgfnS_Default);
    };
    this.GetCurrencyDisplay = function () {
      var Result = 0;
      var Value = "";
      Result = $mod.TDGFNCurrencyDisplay.dgfnCD_Default;
      Value = this._GetString("currencyDisplay");
      if (Value === "symbol") {
        Result = $mod.TDGFNCurrencyDisplay.dgfnCD_Symbol}
       else if (Value === "code") {
        Result = $mod.TDGFNCurrencyDisplay.dgfnCD_Code}
       else if (Value === "name") Result = $mod.TDGFNCurrencyDisplay.dgfnCD_Name;
      return Result;
    };
    this.GetLocaleMatcher = function () {
      var Result = 0;
      var Value = "";
      Result = $mod.TDGFNLocaleMatcher.dgfnLM_Default;
      Value = this._GetString("localeMatcher");
      if (Value === "best-fit") {
        Result = $mod.TDGFNLocaleMatcher.dgfnLM_BestFit}
       else if (Value === "lookup") Result = $mod.TDGFNLocaleMatcher.dgfnLM_Lookup;
      return Result;
    };
    this.GetMaximumFractionDigits = function () {
      var Result = "";
      Result = this._GetInteger("maximumFractionDigits");
      return Result;
    };
    this.GetMaximumSignificantDigits = function () {
      var Result = "";
      Result = this._GetInteger("maximumSignificantDigits");
      return Result;
    };
    this.GetMinimumFractionDigits = function () {
      var Result = "";
      Result = this._GetInteger("minimumFractionDigits");
      return Result;
    };
    this.GetMinimumIntegerDigits = function () {
      var Result = "";
      Result = this._GetInteger("minimumIntegerDigits");
      return Result;
    };
    this.GetMinimumSignificantDigits = function () {
      var Result = "";
      Result = this._GetInteger("minimumSignificantDigits");
      return Result;
    };
    this.GetStyle = function () {
      var Result = 0;
      var Value = "";
      Result = $mod.TDGFNStyle.dgfnS_Default;
      Value = this._GetString("style");
      if (Value === "decimal") {
        Result = $mod.TDGFNStyle.dgfnS_Decimal}
       else if (Value === "currency") {
        Result = $mod.TDGFNStyle.dgfnS_Currency}
       else if (Value === "percent") Result = $mod.TDGFNStyle.dgfnS_Percent;
      return Result;
    };
    this.GetUseGrouping = function () {
      var Result = 0;
      var Value = "";
      Result = $mod.TDGFNUseGrouping.dgfnUG_Default;
      Value = this._GetString("useGrouping");
      if (Value === "always") {
        Result = $mod.TDGFNUseGrouping.dgfnUG_Always}
       else if (Value === "auto") {
        Result = $mod.TDGFNUseGrouping.dgfnUG_Auto}
       else if (Value === "min2") {
        Result = $mod.TDGFNUseGrouping.dgfnUG_Min2}
       else if (Value === "true") {
        Result = $mod.TDGFNUseGrouping.dgfnUG_True}
       else if (Value === "false") Result = $mod.TDGFNUseGrouping.dgfnUG_False;
      return Result;
    };
    this.SetCurrencyDisplay = function (Value) {
      var $tmp = Value;
      if ($tmp === $mod.TDGFNCurrencyDisplay.dgfnCD_Default) {
        this._SetString("currencyDisplay","")}
       else if ($tmp === $mod.TDGFNCurrencyDisplay.dgfnCD_Symbol) {
        this._SetString("currencyDisplay","symbol")}
       else if ($tmp === $mod.TDGFNCurrencyDisplay.dgfnCD_Code) {
        this._SetString("currencyDisplay","code")}
       else if ($tmp === $mod.TDGFNCurrencyDisplay.dgfnCD_Name) this._SetString("currencyDisplay","name");
    };
    this.SetLocaleMatcher = function (Value) {
      var $tmp = Value;
      if ($tmp === $mod.TDGFNLocaleMatcher.dgfnLM_Default) {
        this._SetString("localeMatcher","")}
       else if ($tmp === $mod.TDGFNLocaleMatcher.dgfnLM_BestFit) {
        this._SetString("localeMatcher","best-fit")}
       else if ($tmp === $mod.TDGFNLocaleMatcher.dgfnLM_Lookup) this._SetString("localeMatcher","lookup");
    };
    this.SetStyle = function (Value) {
      var $tmp = Value;
      if ($tmp === $mod.TDGFNStyle.dgfnS_Default) {
        this._SetString("style","")}
       else if ($tmp === $mod.TDGFNStyle.dgfnS_Decimal) {
        this._SetString("style","decimal")}
       else if ($tmp === $mod.TDGFNStyle.dgfnS_Currency) {
        this._SetString("style","currency")}
       else if ($tmp === $mod.TDGFNStyle.dgfnS_Percent) this._SetString("style","percent");
    };
    this.SetUseGrouping = function (Value) {
      var $tmp = Value;
      if ($tmp === $mod.TDGFNUseGrouping.dgfnUG_Default) {
        this._SetString("useGrouping","")}
       else if ($tmp === $mod.TDGFNUseGrouping.dgfnUG_Always) {
        this._SetString("useGrouping","always")}
       else if ($tmp === $mod.TDGFNUseGrouping.dgfnUG_Auto) {
        this._SetString("useGrouping","auto")}
       else if ($tmp === $mod.TDGFNUseGrouping.dgfnUG_Min2) {
        this._SetString("useGrouping","min2")}
       else if ($tmp === $mod.TDGFNUseGrouping.dgfnUG_True) {
        this._SetBoolean("useGrouping","true")}
       else if ($tmp === $mod.TDGFNUseGrouping.dgfnUG_False) this._SetBoolean("useGrouping","false");
    };
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TDGNumberFormat",this.TDGNumberFormatBase,function () {
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Currency",7,rtl.string,"GetCurrency","SetCurrency");
    $r.addProperty("CurrencyDisplay",7,$mod.$rtti["TDGFNCurrencyDisplay"],"GetCurrencyDisplay","SetCurrencyDisplay");
    $r.addProperty("LocaleMatcher",7,$mod.$rtti["TDGFNLocaleMatcher"],"GetLocaleMatcher","SetLocaleMatcher");
    $r.addProperty("MaximumFractionDigits",7,rtl.string,"GetMaximumFractionDigits","SetMaximumFractionDigits");
    $r.addProperty("MaximumSignificantDigits",7,rtl.string,"GetMaximumSignificantDigits","SetMaximumSignificantDigits");
    $r.addProperty("MinimumFractionDigits",7,rtl.string,"GetMinimumFractionDigits","SetMinimumFractionDigits");
    $r.addProperty("MinimumIntegerDigits",7,rtl.string,"GetMinimumIntegerDigits","SetMinimumIntegerDigits");
    $r.addProperty("MinimumSignificantDigits",7,rtl.string,"GetMinimumSignificantDigits","SetMinimumSignificantDigits");
    $r.addProperty("Style",7,$mod.$rtti["TDGFNStyle"],"GetStyle","SetStyle");
    $r.addProperty("UseGrouping",7,$mod.$rtti["TDGFNUseGrouping"],"GetUseGrouping","SetUseGrouping");
  });
  rtl.createClass(this,"TDGDateTimeFormatBase",this.TDGFormatBase,function () {
    this.GetCalendar = function () {
      var Result = "";
      Result = this._GetString("calendar");
      return Result;
    };
    this.GetDateStyle = function () {
      var Result = 0;
      var Value = "";
      Result = $mod.TDGFDDateStyle.dgfdDS_Default;
      Value = this._GetString("dateStyle");
      if (Value === "full") {
        Result = $mod.TDGFDDateStyle.dgfdDS_Full}
       else if (Value === "long") {
        Result = $mod.TDGFDDateStyle.dgfdDS_Long}
       else if (Value === "medium") {
        Result = $mod.TDGFDDateStyle.dgfdDS_Medium}
       else if (Value === "short") Result = $mod.TDGFDDateStyle.dgfdDS_Short;
      return Result;
    };
    this.GetDay = function () {
      var Result = 0;
      var Value = "";
      Result = $mod.TDGFDDay.dgfdD_Default;
      Value = this._GetString("day");
      if (Value === "numeric") {
        Result = $mod.TDGFDDay.dgfdD_Numeric}
       else if (Value === "2-digit") Result = $mod.TDGFDDay.dgfdD_2Digit;
      return Result;
    };
    this.GetDayPeriod = function () {
      var Result = 0;
      var Value = "";
      Result = $mod.TDGFDDayPeriod.dgfdDP_Default;
      Value = this._GetString("dayPeriod");
      if (Value === "narrow") {
        Result = $mod.TDGFDDayPeriod.dgfdDP_Narrow}
       else if (Value === "short") {
        Result = $mod.TDGFDDayPeriod.dgfdDP_Short}
       else if (Value === "long") Result = $mod.TDGFDDayPeriod.dgfdDP_Long;
      return Result;
    };
    this.GetEra = function () {
      var Result = 0;
      var Value = "";
      Result = $mod.TDGFDEra.dgfdE_Default;
      Value = this._GetString("era");
      if (Value === "long") {
        Result = $mod.TDGFDEra.dgfdE_Long}
       else if (Value === "short") {
        Result = $mod.TDGFDEra.dgfdE_Short}
       else if (Value === "narrow") Result = $mod.TDGFDEra.dgfdE_Narrow;
      return Result;
    };
    this.GetFormatMatcher = function () {
      var Result = 0;
      var Value = "";
      Result = $mod.TDGFDFormatMatcher.dgfdFM_Default;
      Value = this._GetString("formatMatcher");
      if (Value === "basic") {
        Result = $mod.TDGFDFormatMatcher.dgfdFM_Basic}
       else if (Value === "best fit") Result = $mod.TDGFDFormatMatcher.dgfdFM_BestFit;
      return Result;
    };
    this.GetFractionalSecondDigits = function () {
      var Result = "";
      Result = this._GetString("fractionalSecondDigits");
      return Result;
    };
    this.GetHour = function () {
      var Result = 0;
      var Value = "";
      Result = $mod.TDGFDHour.dgfdH_Default;
      Value = this._GetString("hour");
      if (Value === "numeric") {
        Result = $mod.TDGFDHour.dgfdH_Numeric}
       else if (Value === "2-digit") Result = $mod.TDGFDHour.dgfdH_2Digit;
      return Result;
    };
    this.GetHour12 = function () {
      var Result = 0;
      var Value = "";
      Result = $mod.TDGFDHour12.dgfdH12_Default;
      Value = this._GetBoolean("hour12");
      if (Value === "True") {
        Result = $mod.TDGFDHour12.dgfdH12_True}
       else if (Value === "False") Result = $mod.TDGFDHour12.dgfdH12_False;
      return Result;
    };
    this.GetHourCycle = function () {
      var Result = 0;
      var Value = "";
      Result = $mod.TDGFDHourCycle.dgfdHC_Default;
      Value = this._GetString("hourCycle");
      if (Value === "h11") {
        Result = $mod.TDGFDHourCycle.dgfdHC_H11}
       else if (Value === "h12") {
        Result = $mod.TDGFDHourCycle.dgfdHC_H12}
       else if (Value === "h23") {
        Result = $mod.TDGFDHourCycle.dgfdHC_H23}
       else if (Value === "h24") Result = $mod.TDGFDHourCycle.dgfdHC_H24;
      return Result;
    };
    this.GetLocaleMatcher = function () {
      var Result = 0;
      var Value = "";
      Result = $mod.TDGFDLocaleMatcher.dgfdLM_Default;
      Value = this._GetString("localeMatcher");
      if (Value === "lookup") {
        Result = $mod.TDGFDLocaleMatcher.dgfdLM_Lookup}
       else if (Value === "best fit") Result = $mod.TDGFDLocaleMatcher.dgfdLM_BestFit;
      return Result;
    };
    this.GetMinute = function () {
      var Result = 0;
      var Value = "";
      Result = $mod.TDGFDMinute.dgfdMi_Default;
      Value = this._GetString("minute");
      if (Value === "numeric") {
        Result = $mod.TDGFDMinute.dgfdMi_Numeric}
       else if (Value === "2-digit") Result = $mod.TDGFDMinute.dgfdMi_2Digit;
      return Result;
    };
    this.GetMonth = function () {
      var Result = 0;
      var Value = "";
      Result = $mod.TDGFDMonth.dgfdM_Default;
      Value = this._GetString("month");
      if (Value === "numeric") {
        Result = $mod.TDGFDMonth.dgfdM_Numeric}
       else if (Value === "2-digit") {
        Result = $mod.TDGFDMonth.dgfdM_2Digit}
       else if (Value === "long") {
        Result = $mod.TDGFDMonth.dgfdM_Long}
       else if (Value === "short") {
        Result = $mod.TDGFDMonth.dgfdM_Short}
       else if (Value === "narrow") Result = $mod.TDGFDMonth.dgfdM_Narrow;
      return Result;
    };
    this.GetNumberingSystem = function () {
      var Result = "";
      Result = this._GetString("numberingSystem");
      return Result;
    };
    this.GetSecond = function () {
      var Result = 0;
      var Value = "";
      Result = $mod.TDGFDSecond.dgfdS_Default;
      Value = this._GetString("second");
      if (Value === "numeric") {
        Result = $mod.TDGFDSecond.dgfdS_Numeric}
       else if (Value === "2-digit") Result = $mod.TDGFDSecond.dgfdS_2Digit;
      return Result;
    };
    this.GetTimeStyle = function () {
      var Result = 0;
      var Value = "";
      Result = $mod.TDGFDTimeStyle.dgfdTS_Default;
      Value = this._GetString("timeStyle");
      if (Value === "full") {
        Result = $mod.TDGFDTimeStyle.dgfdTS_Full}
       else if (Value === "long") {
        Result = $mod.TDGFDTimeStyle.dgfdTS_Long}
       else if (Value === "medium") {
        Result = $mod.TDGFDTimeStyle.dgfdTS_Medium}
       else if (Value === "short") Result = $mod.TDGFDTimeStyle.dgfdTS_Short;
      return Result;
    };
    this.GetTimeZone = function () {
      var Result = "";
      Result = this._GetString("timeZone");
      return Result;
    };
    this.GetTimeZoneName = function () {
      var Result = 0;
      var Value = "";
      Result = $mod.TDGFDTimeZoneName.dgfdTZN_Default;
      Value = this._GetString("timeZoneName");
      if (Value === "long") {
        Result = $mod.TDGFDTimeZoneName.dgfdTZN_Long}
       else if (Value === "short") {
        Result = $mod.TDGFDTimeZoneName.dgfdTZN_Short}
       else if (Value === "shortOffset") {
        Result = $mod.TDGFDTimeZoneName.dgfdTZN_ShortOffset}
       else if (Value === "longOffset") {
        Result = $mod.TDGFDTimeZoneName.dgfdTZN_LongOffset}
       else if (Value === "shortGeneric") {
        Result = $mod.TDGFDTimeZoneName.dgfdTZN_ShortGeneric}
       else if (Value === "longGeneric") Result = $mod.TDGFDTimeZoneName.dgfdTZN_LongGeneric;
      return Result;
    };
    this.GetWeekday = function () {
      var Result = 0;
      var Value = "";
      Result = $mod.TDGFDWeekday.dgfdW_Default;
      Value = this._GetString("weekday");
      if (Value === "long") {
        Result = $mod.TDGFDWeekday.dgfdW_Long}
       else if (Value === "short") {
        Result = $mod.TDGFDWeekday.dgfdW_Short}
       else if (Value === "narrow") Result = $mod.TDGFDWeekday.dgfdW_Narrow;
      return Result;
    };
    this.GetYear = function () {
      var Result = 0;
      var Value = "";
      Result = $mod.TDGFDYear.dgfdY_Default;
      Value = this._GetString("year");
      if (Value === "numeric") {
        Result = $mod.TDGFDYear.dgfdY_Numeric}
       else if (Value === "2-digit") Result = $mod.TDGFDYear.dgfdY_2Digit;
      return Result;
    };
    this.SetCalendar = function (Value) {
      this._SetString("calendar",Value);
    };
    this.SetDateStyle = function (Value) {
      var $tmp = Value;
      if ($tmp === $mod.TDGFDDateStyle.dgfdDS_Default) {
        this._SetString("dateStyle","")}
       else if ($tmp === $mod.TDGFDDateStyle.dgfdDS_Full) {
        this._SetString("dateStyle","full")}
       else if ($tmp === $mod.TDGFDDateStyle.dgfdDS_Long) {
        this._SetString("dateStyle","long")}
       else if ($tmp === $mod.TDGFDDateStyle.dgfdDS_Medium) {
        this._SetString("dateStyle","medium")}
       else if ($tmp === $mod.TDGFDDateStyle.dgfdDS_Short) this._SetString("dateStyle","short");
      if (Value !== $mod.TDGFDDateStyle.dgfdDS_Default) this.ClearDateTimeComponentOptions();
    };
    this.SetDay = function (Value) {
      var $tmp = Value;
      if ($tmp === $mod.TDGFDDay.dgfdD_Default) {
        this._SetString("day","")}
       else if ($tmp === $mod.TDGFDDay.dgfdD_Numeric) {
        this._SetString("day","numeric")}
       else if ($tmp === $mod.TDGFDDay.dgfdD_2Digit) this._SetString("day","2-digit");
      if (Value !== $mod.TDGFDDay.dgfdD_Default) this.ClearDateTimeStyle();
    };
    this.SetDayPeriod = function (Value) {
      var $tmp = Value;
      if ($tmp === $mod.TDGFDDayPeriod.dgfdDP_Default) {
        this._SetString("dayPeriod","")}
       else if ($tmp === $mod.TDGFDDayPeriod.dgfdDP_Narrow) {
        this._SetString("dayPeriod","narrow")}
       else if ($tmp === $mod.TDGFDDayPeriod.dgfdDP_Short) {
        this._SetString("dayPeriod","short")}
       else if ($tmp === $mod.TDGFDDayPeriod.dgfdDP_Long) this._SetString("dayPeriod","long");
      if (Value !== $mod.TDGFDDayPeriod.dgfdDP_Default) this.ClearDateTimeStyle();
    };
    this.SetEra = function (Value) {
      var $tmp = Value;
      if ($tmp === $mod.TDGFDEra.dgfdE_Default) {
        this._SetString("era","")}
       else if ($tmp === $mod.TDGFDEra.dgfdE_Long) {
        this._SetString("era","long")}
       else if ($tmp === $mod.TDGFDEra.dgfdE_Short) {
        this._SetString("era","short")}
       else if ($tmp === $mod.TDGFDEra.dgfdE_Narrow) this._SetString("era","narrow");
      if (Value !== $mod.TDGFDEra.dgfdE_Default) this.ClearDateTimeStyle();
    };
    this.SetFormatMatcher = function (Value) {
      var $tmp = Value;
      if ($tmp === $mod.TDGFDFormatMatcher.dgfdFM_Default) {
        this._SetString("formatMatcher","")}
       else if ($tmp === $mod.TDGFDFormatMatcher.dgfdFM_Basic) {
        this._SetString("formatMatcher","basic")}
       else if ($tmp === $mod.TDGFDFormatMatcher.dgfdFM_BestFit) this._SetString("formatMatcher","best fit");
    };
    this.SetFractionalSecondDigits = function (Value) {
      this._SetString("fractionalSecondDigits",Value);
      if (Value !== "") this.ClearDateTimeStyle();
    };
    this.SetHour = function (Value) {
      var $tmp = Value;
      if ($tmp === $mod.TDGFDHour.dgfdH_Default) {
        this._SetString("hour","")}
       else if ($tmp === $mod.TDGFDHour.dgfdH_Numeric) {
        this._SetString("hour","numeric")}
       else if ($tmp === $mod.TDGFDHour.dgfdH_2Digit) this._SetString("hour","2-digit");
      if (Value !== $mod.TDGFDHour.dgfdH_Default) this.ClearDateTimeStyle();
    };
    this.SetHour12 = function (Value) {
      var $tmp = Value;
      if ($tmp === $mod.TDGFDHour12.dgfdH12_Default) {
        this._SetBoolean("hour12","")}
       else if ($tmp === $mod.TDGFDHour12.dgfdH12_True) {
        this._SetBoolean("hour12","True")}
       else if ($tmp === $mod.TDGFDHour12.dgfdH12_False) this._SetBoolean("hour12","False");
    };
    this.SetHourCycle = function (Value) {
      var $tmp = Value;
      if ($tmp === $mod.TDGFDHourCycle.dgfdHC_Default) {
        this._SetString("hourCycle","")}
       else if ($tmp === $mod.TDGFDHourCycle.dgfdHC_H11) {
        this._SetString("hourCycle","h11")}
       else if ($tmp === $mod.TDGFDHourCycle.dgfdHC_H12) {
        this._SetString("hourCycle","h12")}
       else if ($tmp === $mod.TDGFDHourCycle.dgfdHC_H23) {
        this._SetString("hourCycle","h23")}
       else if ($tmp === $mod.TDGFDHourCycle.dgfdHC_H24) this._SetString("hourCycle","h24");
    };
    this.SetLocaleMatcher = function (Value) {
      var $tmp = Value;
      if ($tmp === $mod.TDGFDLocaleMatcher.dgfdLM_Default) {
        this._SetString("localeMatcher","")}
       else if ($tmp === $mod.TDGFDLocaleMatcher.dgfdLM_Lookup) {
        this._SetString("localeMatcher","lookup")}
       else if ($tmp === $mod.TDGFDLocaleMatcher.dgfdLM_BestFit) this._SetString("localeMatcher","best fit");
    };
    this.SetMinute = function (Value) {
      var $tmp = Value;
      if ($tmp === $mod.TDGFDMinute.dgfdMi_Default) {
        this._SetString("minute","")}
       else if ($tmp === $mod.TDGFDMinute.dgfdMi_Numeric) {
        this._SetString("minute","numeric")}
       else if ($tmp === $mod.TDGFDMinute.dgfdMi_2Digit) this._SetString("minute","2-digit");
      if (Value !== $mod.TDGFDMinute.dgfdMi_Default) this.ClearDateTimeStyle();
    };
    this.SetMonth = function (Value) {
      var $tmp = Value;
      if ($tmp === $mod.TDGFDMonth.dgfdM_Default) {
        this._SetString("month","")}
       else if ($tmp === $mod.TDGFDMonth.dgfdM_Numeric) {
        this._SetString("month","numeric")}
       else if ($tmp === $mod.TDGFDMonth.dgfdM_2Digit) {
        this._SetString("month","2-digit")}
       else if ($tmp === $mod.TDGFDMonth.dgfdM_Long) {
        this._SetString("month","long")}
       else if ($tmp === $mod.TDGFDMonth.dgfdM_Short) {
        this._SetString("month","short")}
       else if ($tmp === $mod.TDGFDMonth.dgfdM_Narrow) this._SetString("month","narrow");
      if (Value !== $mod.TDGFDMonth.dgfdM_Default) this.ClearDateTimeStyle();
    };
    this.SetNumberingSystem = function (Value) {
      this._SetString("numberingSystem",Value);
    };
    this.SetSecond = function (Value) {
      var $tmp = Value;
      if ($tmp === $mod.TDGFDSecond.dgfdS_Default) {
        this._SetString("second","")}
       else if ($tmp === $mod.TDGFDSecond.dgfdS_Numeric) {
        this._SetString("second","numeric")}
       else if ($tmp === $mod.TDGFDSecond.dgfdS_2Digit) this._SetString("second","2-digit");
      if (Value !== $mod.TDGFDSecond.dgfdS_Default) this.ClearDateTimeStyle();
    };
    this.SetTimeStyle = function (Value) {
      var $tmp = Value;
      if ($tmp === $mod.TDGFDTimeStyle.dgfdTS_Default) {
        this._SetString("timeStyle","")}
       else if ($tmp === $mod.TDGFDTimeStyle.dgfdTS_Full) {
        this._SetString("timeStyle","full")}
       else if ($tmp === $mod.TDGFDTimeStyle.dgfdTS_Long) {
        this._SetString("timeStyle","long")}
       else if ($tmp === $mod.TDGFDTimeStyle.dgfdTS_Medium) {
        this._SetString("timeStyle","medium")}
       else if ($tmp === $mod.TDGFDTimeStyle.dgfdTS_Short) this._SetString("timeStyle","short");
      if (Value !== $mod.TDGFDTimeStyle.dgfdTS_Default) this.ClearDateTimeComponentOptions();
    };
    this.SetTimeZone = function (Value) {
      this._SetString("timeZone",Value);
    };
    this.SetTimeZoneName = function (Value) {
      var $tmp = Value;
      if ($tmp === $mod.TDGFDTimeZoneName.dgfdTZN_Default) {
        this._SetString("timeZoneName","")}
       else if ($tmp === $mod.TDGFDTimeZoneName.dgfdTZN_Long) {
        this._SetString("timeZoneName","long")}
       else if ($tmp === $mod.TDGFDTimeZoneName.dgfdTZN_Short) {
        this._SetString("timeZoneName","short")}
       else if ($tmp === $mod.TDGFDTimeZoneName.dgfdTZN_ShortOffset) {
        this._SetString("timeZoneName","shortOffset")}
       else if ($tmp === $mod.TDGFDTimeZoneName.dgfdTZN_LongOffset) {
        this._SetString("timeZoneName","longOffset")}
       else if ($tmp === $mod.TDGFDTimeZoneName.dgfdTZN_ShortGeneric) {
        this._SetString("timeZoneName","shortGeneric")}
       else if ($tmp === $mod.TDGFDTimeZoneName.dgfdTZN_LongGeneric) this._SetString("timeZoneName","longGeneric");
      if (Value !== $mod.TDGFDTimeZoneName.dgfdTZN_Default) this.ClearDateTimeStyle();
    };
    this.SetWeekday = function (Value) {
      var $tmp = Value;
      if ($tmp === $mod.TDGFDWeekday.dgfdW_Default) {
        this._SetString("weekday","")}
       else if ($tmp === $mod.TDGFDWeekday.dgfdW_Long) {
        this._SetString("weekday","long")}
       else if ($tmp === $mod.TDGFDWeekday.dgfdW_Short) {
        this._SetString("weekday","short")}
       else if ($tmp === $mod.TDGFDWeekday.dgfdW_Narrow) this._SetString("weekday","narrow");
      if (Value !== $mod.TDGFDWeekday.dgfdW_Default) this.ClearDateTimeStyle();
    };
    this.SetYear = function (Value) {
      var $tmp = Value;
      if ($tmp === $mod.TDGFDYear.dgfdY_Default) {
        this._SetString("year","")}
       else if ($tmp === $mod.TDGFDYear.dgfdY_Numeric) {
        this._SetString("year","numeric")}
       else if ($tmp === $mod.TDGFDYear.dgfdY_2Digit) this._SetString("year","2-digit");
      if (Value !== $mod.TDGFDYear.dgfdY_Default) this.ClearDateTimeStyle();
    };
    this.ClearDateTimeStyle = function () {
      this._SetString("dateStyle","");
      this._SetString("timeStyle","");
    };
    this.ClearDateTimeComponentOptions = function () {
      this._SetString("weekday","");
      this._SetString("era","");
      this._SetString("year","");
      this._SetString("month","");
      this._SetString("day","");
      this._SetString("dayPeriod","");
      this._SetString("hour","");
      this._SetString("minute","");
      this._SetString("second","");
      this._SetString("fractionalSecondDigits","");
      this._SetString("timeZoneName","");
    };
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TDGDateTimeFormat",this.TDGDateTimeFormatBase,function () {
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("LocaleMatcher",7,$mod.$rtti["TDGFDLocaleMatcher"],"GetLocaleMatcher","SetLocaleMatcher");
    $r.addProperty("Calendar",7,rtl.string,"GetCalendar","SetCalendar");
    $r.addProperty("NumberingSystem",7,rtl.string,"GetNumberingSystem","SetNumberingSystem");
    $r.addProperty("Hour12",7,$mod.$rtti["TDGFDHour12"],"GetHour12","SetHour12");
    $r.addProperty("HourCycle",7,$mod.$rtti["TDGFDHourCycle"],"GetHourCycle","SetHourCycle");
    $r.addProperty("TimeZone",7,rtl.string,"GetTimeZone","SetTimeZone");
    $r.addProperty("Weekday",7,$mod.$rtti["TDGFDWeekday"],"GetWeekday","SetWeekday");
    $r.addProperty("Era",7,$mod.$rtti["TDGFDEra"],"GetEra","SetEra");
    $r.addProperty("Year",7,$mod.$rtti["TDGFDYear"],"GetYear","SetYear");
    $r.addProperty("Month",7,$mod.$rtti["TDGFDMonth"],"GetMonth","SetMonth");
    $r.addProperty("Day",7,$mod.$rtti["TDGFDDay"],"GetDay","SetDay");
    $r.addProperty("DayPeriod",7,$mod.$rtti["TDGFDDayPeriod"],"GetDayPeriod","SetDayPeriod");
    $r.addProperty("Hour",7,$mod.$rtti["TDGFDHour"],"GetHour","SetHour");
    $r.addProperty("Minute",7,$mod.$rtti["TDGFDMinute"],"GetMinute","SetMinute");
    $r.addProperty("Second",7,$mod.$rtti["TDGFDSecond"],"GetSecond","SetSecond");
    $r.addProperty("FractionalSecondDigits",7,rtl.string,"GetFractionalSecondDigits","SetFractionalSecondDigits");
    $r.addProperty("TimeZoneName",7,$mod.$rtti["TDGFDTimeZoneName"],"GetTimeZoneName","SetTimeZoneName");
    $r.addProperty("FormatMatcher",7,$mod.$rtti["TDGFDFormatMatcher"],"GetFormatMatcher","SetFormatMatcher");
    $r.addProperty("DateStyle",7,$mod.$rtti["TDGFDDateStyle"],"GetDateStyle","SetDateStyle");
    $r.addProperty("TimeStyle",7,$mod.$rtti["TDGFDTimeStyle"],"GetTimeStyle","SetTimeStyle");
  });
});
rtl.module("WEBLib.DataGrid.CellComponents",["System","Classes","Web","JS","WEBLib.Controls","Types","SysUtils","jsdelphisystem","WEBLib.DataGrid.libjs"],function () {
  "use strict";
  var $mod = this;
  this.$rtti.$ExtClass("TEmbeddedJSCellComponents",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "document.agCellComp"});
  rtl.createClass(this,"TDGCellComponents",pas["WEBLib.DataGrid.libjs"].TEmbeddedJavaScript,function () {
    this.ModuleName = function () {
      var Result = "";
      Result = this.$classname;
      return Result;
    };
    this.Source = function () {
      var Result = "";
      var S = "";
      S = "";
      S = S + '"use strict";' + "\r\n";
      S = S + 'Object.defineProperty(exports, "__esModule", { value: true });' + "\r\n";
      S = S + "exports.TestEditorComponent = exports.TestRendererComponent = exports.TceCheckboxEditorComponent = exports.TceNoneEditorComponent = exports.TceMemoEditorComponent = exports.TceComboEditorComponent = exports.TceMaskEditorComponent = exports.TceTelEditorComponent = exports.TceEmailEditorComponent = exports.TceURLEditorComponent = exports.TceMonthEditorComponent = exports.TceWeekEditorComponent = exports.TceColorEditorComponent = exports.TceRangeEditorComponent = exports.TceTimeEditorComponent = exports.TceDateEditorComponent = exports.TceNumberEditorComponent = exports.TceTextEditorComponent = exports.EditorComponentTextAreaBase = exports.EditorComponentInputBase = exports.TcrLocaleNumberRendererComponent = exports.TcrLocaleDateStringRendererComponent = exports.TcrCheckboxRendererComponent = exports.TcrTelRendererComponent = exports.TcrEmailRendererComponent = exports.TcrURLRendererComponent = exports.TcrImageRendererComponent = exports.TcrTextRendererComponent = exports.RendererComponen";
      S = S + "tBase = void 0;" + "\r\n";
      S = S + "let Result = {};" + "\r\n";
      S = S + "class RendererComponentBase {" + "\r\n";
      S = S + "    init(params) {" + "\r\n";
      S = S + '        this.gui = document.createElement("div");' + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "    destroy() {" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "    getGui() {" + "\r\n";
      S = S + "        return this.gui;" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "    refresh(params) {" + "\r\n";
      S = S + "        return (false);" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "}" + "\r\n";
      S = S + "exports.RendererComponentBase = RendererComponentBase;" + "\r\n";
      S = S + "class TcrTextRendererComponent extends RendererComponentBase {" + "\r\n";
      S = S + "    init(params) {" + "\r\n";
      S = S + "        super.init(params);" + "\r\n";
      S = S + "        this.gui.innerHTML = TMSIntlUtils.getValue(params);" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "}" + "\r\n";
      S = S + "exports.TcrTextRendererComponent = TcrTextRendererComponent;" + "\r\n";
      S = S + "class TcrImageRendererComponent extends RendererComponentBase {" + "\r\n";
      S = S + "    init(params) {" + "\r\n";
      S = S + "        super.init(params);" + "\r\n";
      S = S + "        const value = TMSIntlUtils.getValue(params);" + "\r\n";
      S = S + '        if (typeof (value) == "string"' + "\r\n";
      S = S + "            && value.length > 0) {" + "\r\n";
      S = S + '            this.image = document.createElement("img");' + "\r\n";
      S = S + "            this.image.src = value;" + "\r\n";
      S = S + '            this.image.style.setProperty("width", "100%");' + "\r\n";
      S = S + '            this.image.style.setProperty("height", "100%");' + "\r\n";
      S = S + '            this.image.style.setProperty("object-fit", "contain");' + "\r\n";
      S = S + '            this.gui.classList.add("cr-image");' + "\r\n";
      S = S + "            this.gui.appendChild(this.image);" + "\r\n";
      S = S + "        }" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "}" + "\r\n";
      S = S + "exports.TcrImageRendererComponent = TcrImageRendererComponent;" + "\r\n";
      S = S + "class TcrURLRendererComponent extends RendererComponentBase {" + "\r\n";
      S = S + "    init(params) {" + "\r\n";
      S = S + "        super.init(params);" + "\r\n";
      S = S + "        const value = TMSIntlUtils.getValue(params);" + "\r\n";
      S = S + '        this.anchor = document.createElement("a");' + "\r\n";
      S = S + "        this.anchor.href = value;" + "\r\n";
      S = S + "        this.anchor.innerText = value;" + "\r\n";
      S = S + '        this.gui.classList.add("cr-url");' + "\r\n";
      S = S + "        this.gui.appendChild(this.anchor);" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "}" + "\r\n";
      S = S + "exports.TcrURLRendererComponent = TcrURLRendererComponent;" + "\r\n";
      S = S + "class TcrEmailRendererComponent extends RendererComponentBase {" + "\r\n";
      S = S + "    init(params) {" + "\r\n";
      S = S + "        super.init(params);" + "\r\n";
      S = S + "        const value = TMSIntlUtils.getValue(params);" + "\r\n";
      S = S + '        this.anchor = document.createElement("a");' + "\r\n";
      S = S + '        this.anchor.href = "mailto:" + value;' + "\r\n";
      S = S + "        this.anchor.innerText = value;" + "\r\n";
      S = S + '        this.gui.classList.add("cr-email");' + "\r\n";
      S = S + "        this.gui.appendChild(this.anchor);" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "}" + "\r\n";
      S = S + "exports.TcrEmailRendererComponent = TcrEmailRendererComponent;" + "\r\n";
      S = S + "class TcrTelRendererComponent extends RendererComponentBase {" + "\r\n";
      S = S + "    init(params) {" + "\r\n";
      S = S + "        super.init(params);" + "\r\n";
      S = S + "        const value = TMSIntlUtils.getValue(params);" + "\r\n";
      S = S + '        this.anchor = document.createElement("a");' + "\r\n";
      S = S + '        this.anchor.href = "tel:" + value;' + "\r\n";
      S = S + "        this.anchor.innerText = value;" + "\r\n";
      S = S + '        this.gui.classList.add("cr-tel");' + "\r\n";
      S = S + "        this.gui.appendChild(this.anchor);" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "}" + "\r\n";
      S = S + "exports.TcrTelRendererComponent = TcrTelRendererComponent;" + "\r\n";
      S = S + "class TcrCheckboxRendererComponent extends RendererComponentBase {" + "\r\n";
      S = S + "    init(params) {" + "\r\n";
      S = S + "        super.init(params);" + "\r\n";
      S = S + "        const value = TMSIntlUtils.getValue(params);" + "\r\n";
      S = S + '        this.gui.classList.add("cr-checkbox");' + "\r\n";
      S = S + "        this.gui.innerHTML = value;" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "}" + "\r\n";
      S = S + "exports.TcrCheckboxRendererComponent = TcrCheckboxRendererComponent;" + "\r\n";
      S = S + "class TcrLocaleDateStringRendererComponent extends RendererComponentBase {" + "\r\n";
      S = S + "    init(params) {" + "\r\n";
      S = S + "        var _a;" + "\r\n";
      S = S + "        super.init(params);" + "\r\n";
      S = S + '        console.log("TcrLocaleDateStringRendererComponent");' + "\r\n";
      S = S + '        this.gui.classList.add("cr-localedatestring");' + "\r\n";
      S = S + '        var result = "-";' + "\r\n";
      S = S + "        try {" + "\r\n";
      S = S + "            const date = new Date(TMSIntlUtils.getDate(TMSIntlUtils.getValue(params)));" + "\r\n";
      S = S + "            var options = TMSIntlUtils.getViewModeFormatOption(params.context, (_a = params.colDef) === null || _a === void 0 ? void 0 : _a.field);" + "\r\n";
      S = S + "            const formattedDate = (new Intl.DateTimeFormat(TMSIntlUtils.getLocale(params.context), options)).format(date);" + "\r\n";
      S = S + "            result = formattedDate;" + "\r\n";
      S = S + "        }" + "\r\n";
      S = S + "        catch (error) { }" + "\r\n";
      S = S + "        this.gui.innerHTML = result;" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "}" + "\r\n";
      S = S + "exports.TcrLocaleDateStringRendererComponent = TcrLocaleDateStringRendererComponent;" + "\r\n";
      S = S + "class TcrLocaleNumberRendererComponent extends RendererComponentBase {" + "\r\n";
      S = S + "    init(params) {" + "\r\n";
      S = S + "        var _a;" + "\r\n";
      S = S + "        super.init(params);" + "\r\n";
      S = S + '        console.log("TcrLocaleNumberRendererComponent");' + "\r\n";
      S = S + '        this.gui.classList.add("cr-localenumber");' + "\r\n";
      S = S + '        var result = "-";' + "\r\n";
      S = S + "        try {" + "\r\n";
      S = S + '            const value = TMSIntlUtils.getValue(params, "number");' + "\r\n";
      S = S + "            if (value) {" + "\r\n";
      S = S + "                var options = TMSIntlUtils.getViewModeFormatOption(params.context, (_a = params.colDef) === null || _a === void 0 ? void 0 : _a.field);" + "\r\n";
      S = S + "                result = TMSIntlUtils.getNumberString(value, TMSIntlUtils.getLocale(params.context), options);" + "\r\n";
      S = S + "            }" + "\r\n";
      S = S + "        }" + "\r\n";
      S = S + "        catch (error) { }" + "\r\n";
      S = S + "        this.gui.innerHTML = result;" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "}" + "\r\n";
      S = S + "exports.TcrLocaleNumberRendererComponent = TcrLocaleNumberRendererComponent;" + "\r\n";
      S = S + "class TMSIntlUtils {" + "\r\n";
      S = S + "    static getDate(ds) {" + "\r\n";
      S = S + '        if (typeof (ds) == "string") {' + "\r\n";
      S = S + "            if (ds.length == 10) {" + "\r\n";
      S = S + "                if ((ds.charCodeAt(4) >= 0x2D && ds.charCodeAt(7) <= 0x2D)" + "\r\n";
      S = S + "                    && (ds.charCodeAt(0) >= 0x30 && ds.charCodeAt(0) <= 0x39)" + "\r\n";
      S = S + "                    && (ds.charCodeAt(1) >= 0x30 && ds.charCodeAt(1) <= 0x39)" + "\r\n";
      S = S + "                    && (ds.charCodeAt(2) >= 0x30 && ds.charCodeAt(2) <= 0x39)" + "\r\n";
      S = S + "                    && (ds.charCodeAt(3) >= 0x30 && ds.charCodeAt(3) <= 0x39)" + "\r\n";
      S = S + "                    && (ds.charCodeAt(5) >= 0x30 && ds.charCodeAt(5) <= 0x39)" + "\r\n";
      S = S + "                    && (ds.charCodeAt(6) >= 0x30 && ds.charCodeAt(6) <= 0x39)" + "\r\n";
      S = S + "                    && (ds.charCodeAt(8) >= 0x30 && ds.charCodeAt(8) <= 0x39)" + "\r\n";
      S = S + "                    && (ds.charCodeAt(9) >= 0x30 && ds.charCodeAt(9) <= 0x39)) {" + "\r\n";
      S = S + '                    return (new Date(ds + "T00:00:00"));' + "\r\n";
      S = S + "                }" + "\r\n";
      S = S + "            }" + "\r\n";
      S = S + "        }" + "\r\n";
      S = S + "        return (new Date(ds));" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "    static getGridLocale(grid) {" + "\r\n";
      S = S + '        var result = "";' + "\r\n";
      S = S + '        if (typeof (grid) != "undefined") {' + "\r\n";
      S = S + '            if (typeof (grid.FBCP47Tag) == "string") {' + "\r\n";
      S = S + "                result = grid.FBCP47Tag;" + "\r\n";
      S = S + "            }" + "\r\n";
      S = S + "        }" + "\r\n";
      S = S + "        return (result);" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "    static getLocale(grid) {" + "\r\n";
      S = S + '        var useLocale = "";' + "\r\n";
      S = S + '        if (typeof (grid) != "undefined") {' + "\r\n";
      S = S + "            useLocale = TMSIntlUtils.getGridLocale(grid);" + "\r\n";
      S = S + '            if (useLocale == "") {' + "\r\n";
      S = S + "                useLocale = navigator.language;" + "\r\n";
      S = S + "            }" + "\r\n";
      S = S + "        }" + "\r\n";
      S = S + '        return ((typeof (useLocale) != "undefined"' + "\r\n";
      S = S + "            && useLocale != null" + "\r\n";
      S = S + '            && useLocale != "") ? useLocale : "en-US");' + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "    static getNumberString(value, locale, options = undefined) {" + "\r\n";
      S = S + '        var result = "-";' + "\r\n";
      S = S + "        try {" + "\r\n";
      S = S + "            var useValue = null;" + "\r\n";
      S = S + '            if (typeof (value) == "number")' + "\r\n";
      S = S + "                useValue = value;" + "\r\n";
      S = S + '            else if (typeof (value) == "bigint")' + "\r\n";
      S = S + "                useValue = value;" + "\r\n";
      S = S + '            else if (typeof (value) == "string")' + "\r\n";
      S = S + "                useValue = parseFloat(value);" + "\r\n";
      S = S + "            result = (new Intl.NumberFormat(locale, options)).format(useValue);" + "\r\n";
      S = S + "        }" + "\r\n";
      S = S + "        catch (error) {" + "\r\n";
      S = S + "            console.error(error);" + "\r\n";
      S = S + "        }" + "\r\n";
      S = S + "        return (result);" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "    static getValue(params, expectedType = null) {" + "\r\n";
      S = S + '        var result = "Invalid params";' + "\r\n";
      S = S + '        if (typeof (params) == "object") {' + "\r\n";
      S = S + "            const ft = typeof (params.valueFormatted);" + "\r\n";
      S = S + "            if (ft == expectedType ||" + "\r\n";
      S = S + "                (expectedType == null" + "\r\n";
      S = S + '                    && (ft == "number" || ft == "string" || ft == "bigint" || ft == "boolean"))) {' + "\r\n";
      S = S + "                result = params.valueFormatted;" + "\r\n";
      S = S + "            }" + "\r\n";
      S = S + "            else {" + "\r\n";
      S = S + "                result = params.value;" + "\r\n";
      S = S + "            }" + "\r\n";
      S = S + "        }" + "\r\n";
      S = S + "        return (result);" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "    static getGridColumn(grid, fieldName) {" + "\r\n";
      S = S + "        var _a;" + "\r\n";
      S = S + '        if (typeof (grid) == "object" && typeof (fieldName) == "string") {' + "\r\n";
      S = S + '            if (typeof ((_a = grid.FColumnDefs) === null || _a === void 0 ? void 0 : _a.FindColumn) == "function") {' + "\r\n";
      S = S + "                const column = grid.FColumnDefs.FindColumn(fieldName);" + "\r\n";
      S = S + '                if (column != null && typeof (column) == "object") {' + "\r\n";
      S = S + "                    return (column);" + "\r\n";
      S = S + "                }" + "\r\n";
      S = S + "            }" + "\r\n";
      S = S + "        }" + "\r\n";
      S = S + "        return (null);" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "    static getViewModeFormatOption(grid, fieldName) {" + "\r\n";
      S = S + "        var _a;" + "\r\n";
      S = S + '        if (typeof (grid) == "object" && typeof (fieldName) == "string") {' + "\r\n";
      S = S + "            const column = TMSIntlUtils.getGridColumn(grid, fieldName);" + "\r\n";
      S = S + '            if (column != null && typeof (column) == "object") {' + "\r\n";
      S = S + '                if (typeof ((_a = column.FViewModeFormat) === null || _a === void 0 ? void 0 : _a.FJsonConfig) == "string") {' + "\r\n";
      S = S + "                    try {" + "\r\n";
      S = S + "                        const result = JSON.parse(column.FViewModeFormat.FJsonConfig);" + "\r\n";
      S = S + "                        return (result);" + "\r\n";
      S = S + "                    }" + "\r\n";
      S = S + "                    catch (error) { }" + "\r\n";
      S = S + "                }" + "\r\n";
      S = S + "            }" + "\r\n";
      S = S + "        }" + "\r\n";
      S = S + "        return (undefined);" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "}" + "\r\n";
      S = S + "class EditorComponentInputBase {" + "\r\n";
      S = S + "    init(params) {" + "\r\n";
      S = S + '        this.gui = document.createElement("input");' + "\r\n";
      S = S + '        this.gui.type = "text";' + "\r\n";
      S = S + '        this.gui.style.fontSize = "calc(var(--ag-font-size) + 1px)";' + "\r\n";
      S = S + '        this.gui.style.fontFamily = "var(--ag-font-family)";' + "\r\n";
      S = S + '        this.gui.style.width = "calc(100% - var(--ag-cell-horizontal-padding) - 1px + var(--ag-row-group-indent-size) * var(--ag-indentation-level))";' + "\r\n";
      S = S + '        this.gui.style.height = "100%";' + "\r\n";
      S = S + '        this.gui.style.border = "none";' + "\r\n";
      S = S + '        this.gui.style.outline = "none";' + "\r\n";
      S = S + '        this.gui.style.fontWeight = "unset";' + "\r\n";
      S = S + "        this._paramsInit(params);" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "    postInit(params) {" + "\r\n";
      S = S + '        this.gui.classList.add("ag-cell");' + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "    _paramsInit(params) {" + "\r\n";
      S = S + "        this.params = params;" + "\r\n";
      S = S + "        let startValue = params.value;" + "\r\n";
      S = S + "        const eventKey = params.eventKey;" + "\r\n";
      S = S + '        const isBackspace = eventKey === "Backspace";' + "\r\n";
      S = S + "        if (isBackspace) {" + "\r\n";
      S = S + '            startValue = "";' + "\r\n";
      S = S + "        }" + "\r\n";
      S = S + "        else if (eventKey && eventKey.length === 1) {" + "\r\n";
      S = S + "            startValue = eventKey;" + "\r\n";
      S = S + "        }" + "\r\n";
      S = S + "        if (startValue !== null && startValue !== undefined) {" + "\r\n";
      S = S + "            this.gui.value = startValue;" + "\r\n";
      S = S + "        }" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "    destroy() {" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "    getGui() {" + "\r\n";
      S = S + "        return this.gui;" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "    getValue() {" + "\r\n";
      S = S + '        console.log("***** EditorComponentInputBase.getValue()");' + "\r\n";
      S = S + "        return (this.gui.value);" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "    afterGuiAttached() {" + "\r\n";
      S = S + "        this.gui.focus();" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "    isCancelBeforeStart() {" + "\r\n";
      S = S + '        console.log("***** EditorComponentInputBase.isCancelBeforeStart()");' + "\r\n";
      S = S + "        return (false);" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "}" + "\r\n";
      S = S + "exports.EditorComponentInputBase = EditorComponentInputBase;" + "\r\n";
      S = S + "class EditorComponentTextAreaBase {" + "\r\n";
      S = S + "    init(params) {" + "\r\n";
      S = S + '        this.gui = document.createElement("textarea");' + "\r\n";
      S = S + "        this._paramsInit(params);" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "    postInit(params) {" + "\r\n";
      S = S + '        this.gui.classList.add("ag-cell");' + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "    _paramsInit(params) {" + "\r\n";
      S = S + "        this.params = params;" + "\r\n";
      S = S + "        let startValue = params.value;" + "\r\n";
      S = S + "        const eventKey = params.eventKey;" + "\r\n";
      S = S + '        const isBackspace = eventKey === "Backspace";' + "\r\n";
      S = S + "        if (isBackspace) {" + "\r\n";
      S = S + '            startValue = "";' + "\r\n";
      S = S + "        }" + "\r\n";
      S = S + "        else if (eventKey && eventKey.length === 1) {" + "\r\n";
      S = S + "            startValue = eventKey;" + "\r\n";
      S = S + "        }" + "\r\n";
      S = S + "        if (startValue !== null && startValue !== undefined) {" + "\r\n";
      S = S + "            this.gui.value = startValue;" + "\r\n";
      S = S + "        }" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "    destroy() {" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "    getGui() {" + "\r\n";
      S = S + "        return this.gui;" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "    getValue() {" + "\r\n";
      S = S + "        this.gui.focus();" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "}" + "\r\n";
      S = S + "exports.EditorComponentTextAreaBase = EditorComponentTextAreaBase;" + "\r\n";
      S = S + "class TceTextEditorComponent extends EditorComponentInputBase {" + "\r\n";
      S = S + "    init(params) {" + "\r\n";
      S = S + "        super.init(params);" + "\r\n";
      S = S + '        this.gui.type = "text";' + "\r\n";
      S = S + '        this.gui.classList.add("ce-text");' + "\r\n";
      S = S + "        super.postInit(params);" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "}" + "\r\n";
      S = S + "exports.TceTextEditorComponent = TceTextEditorComponent;" + "\r\n";
      S = S + "class TceNumberEditorComponent extends EditorComponentInputBase {" + "\r\n";
      S = S + "    init(params) {" + "\r\n";
      S = S + "        super.init(params);" + "\r\n";
      S = S + '        this.gui.type = "number";' + "\r\n";
      S = S + '        this.gui.classList.add("ce-number");' + "\r\n";
      S = S + "        super.postInit(params);" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "    getValue() {" + "\r\n";
      S = S + '        console.log("***** TceNumberEditorComponent.getValue()");' + "\r\n";
      S = S + "        return (parseInt(this.gui.value));" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "}" + "\r\n";
      S = S + "exports.TceNumberEditorComponent = TceNumberEditorComponent;" + "\r\n";
      S = S + "class TceDateEditorComponent extends EditorComponentInputBase {" + "\r\n";
      S = S + "    init(params) {" + "\r\n";
      S = S + "        super.init(params);" + "\r\n";
      S = S + '        this.gui.type = "date";' + "\r\n";
      S = S + '        this.gui.classList.add("ce-date");' + "\r\n";
      S = S + "        super.postInit(params);" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "}" + "\r\n";
      S = S + "exports.TceDateEditorComponent = TceDateEditorComponent;" + "\r\n";
      S = S + "class TceTimeEditorComponent extends EditorComponentInputBase {" + "\r\n";
      S = S + "    init(params) {" + "\r\n";
      S = S + "        super.init(params);" + "\r\n";
      S = S + '        this.gui.type = "time";' + "\r\n";
      S = S + '        this.gui.classList.add("ce-time");' + "\r\n";
      S = S + "        super.postInit(params);" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "}" + "\r\n";
      S = S + "exports.TceTimeEditorComponent = TceTimeEditorComponent;" + "\r\n";
      S = S + "class TceRangeEditorComponent extends EditorComponentInputBase {" + "\r\n";
      S = S + "    init(params) {" + "\r\n";
      S = S + "        super.init(params);" + "\r\n";
      S = S + '        this.gui.type = "range";' + "\r\n";
      S = S + '        this.gui.classList.add("ce-range");' + "\r\n";
      S = S + '        this.gui.min = "0";' + "\r\n";
      S = S + '        this.gui.max = "100";' + "\r\n";
      S = S + '        this.gui.step = "1";' + "\r\n";
      S = S + "        super.postInit(params);" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "}" + "\r\n";
      S = S + "exports.TceRangeEditorComponent = TceRangeEditorComponent;" + "\r\n";
      S = S + "class TceColorEditorComponent extends EditorComponentInputBase {" + "\r\n";
      S = S + "    init(params) {" + "\r\n";
      S = S + "        super.init(params);" + "\r\n";
      S = S + '        this.gui.type = "color";' + "\r\n";
      S = S + '        this.gui.classList.add("ce-color");' + "\r\n";
      S = S + "        super.postInit(params);" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "}" + "\r\n";
      S = S + "exports.TceColorEditorComponent = TceColorEditorComponent;" + "\r\n";
      S = S + "class TceWeekEditorComponent extends EditorComponentInputBase {" + "\r\n";
      S = S + "    init(params) {" + "\r\n";
      S = S + "        super.init(params);" + "\r\n";
      S = S + '        this.gui.type = "week";' + "\r\n";
      S = S + '        this.gui.classList.add("ce-week");' + "\r\n";
      S = S + "        super.postInit(params);" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "}" + "\r\n";
      S = S + "exports.TceWeekEditorComponent = TceWeekEditorComponent;" + "\r\n";
      S = S + "class TceMonthEditorComponent extends EditorComponentInputBase {" + "\r\n";
      S = S + "    init(params) {" + "\r\n";
      S = S + "        super.init(params);" + "\r\n";
      S = S + '        this.gui.type = "month";' + "\r\n";
      S = S + '        this.gui.classList.add("ce-month");' + "\r\n";
      S = S + "        super.postInit(params);" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "}" + "\r\n";
      S = S + "exports.TceMonthEditorComponent = TceMonthEditorComponent;" + "\r\n";
      S = S + "class TceURLEditorComponent extends EditorComponentInputBase {" + "\r\n";
      S = S + "    init(params) {" + "\r\n";
      S = S + "        super.init(params);" + "\r\n";
      S = S + '        this.gui.type = "url";' + "\r\n";
      S = S + '        this.gui.classList.add("ce-url");' + "\r\n";
      S = S + "        super.postInit(params);" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "}" + "\r\n";
      S = S + "exports.TceURLEditorComponent = TceURLEditorComponent;" + "\r\n";
      S = S + "class TceEmailEditorComponent extends EditorComponentInputBase {" + "\r\n";
      S = S + "    init(params) {" + "\r\n";
      S = S + "        super.init(params);" + "\r\n";
      S = S + '        this.gui.type = "email";' + "\r\n";
      S = S + '        this.gui.classList.add("ce-email");' + "\r\n";
      S = S + "        super.postInit(params);" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "}" + "\r\n";
      S = S + "exports.TceEmailEditorComponent = TceEmailEditorComponent;" + "\r\n";
      S = S + "class TceTelEditorComponent extends EditorComponentInputBase {" + "\r\n";
      S = S + "    init(params) {" + "\r\n";
      S = S + "        super.init(params);" + "\r\n";
      S = S + '        this.gui.type = "tel";' + "\r\n";
      S = S + '        this.gui.classList.add("ce-tel");' + "\r\n";
      S = S + "        super.postInit(params);" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "}" + "\r\n";
      S = S + "exports.TceTelEditorComponent = TceTelEditorComponent;" + "\r\n";
      S = S + "class TceMaskEditorComponent extends EditorComponentInputBase {" + "\r\n";
      S = S + "    init(params) {" + "\r\n";
      S = S + "        super.init(params);" + "\r\n";
      S = S + '        this.gui.type = "text";' + "\r\n";
      S = S + '        this.gui.classList.add("ce-mask");' + "\r\n";
      S = S + "        super.postInit(params);" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "}" + "\r\n";
      S = S + "exports.TceMaskEditorComponent = TceMaskEditorComponent;" + "\r\n";
      S = S + "class TceComboEditorComponent extends EditorComponentInputBase {" + "\r\n";
      S = S + "    init(params) {" + "\r\n";
      S = S + "        super.init(params);" + "\r\n";
      S = S + '        this.gui.type = "text";' + "\r\n";
      S = S + '        this.gui.classList.add("ce-combo");' + "\r\n";
      S = S + "        super.postInit(params);" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "}" + "\r\n";
      S = S + "exports.TceComboEditorComponent = TceComboEditorComponent;" + "\r\n";
      S = S + "class TceMemoEditorComponent extends EditorComponentTextAreaBase {" + "\r\n";
      S = S + "    init(params) {" + "\r\n";
      S = S + "        super.init(params);" + "\r\n";
      S = S + '        this.gui.classList.add("ce-memo");' + "\r\n";
      S = S + "        super.postInit(params);" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "}" + "\r\n";
      S = S + "exports.TceMemoEditorComponent = TceMemoEditorComponent;" + "\r\n";
      S = S + "class TceNoneEditorComponent {" + "\r\n";
      S = S + "    init(params) {" + "\r\n";
      S = S + '        this.gui = document.createElement("div");' + "\r\n";
      S = S + '        this.gui.classList.add("ce-none");' + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "    getGui() {" + "\r\n";
      S = S + "        return this.gui;" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "    getValue() {" + "\r\n";
      S = S + "        this.gui.focus();" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "}" + "\r\n";
      S = S + "exports.TceNoneEditorComponent = TceNoneEditorComponent;" + "\r\n";
      S = S + "" + "\r\n";
      S = S + "class TceCheckboxEditorComponent extends EditorComponentInputBase {" + "\r\n";
      S = S + "    init(params) {" + "\r\n";
      S = S + "        super.init(params);" + "\r\n";
      S = S + '        this.gui.type = "checkbox";' + "\r\n";
      S = S + '        this.gui.classList.add("ce-checkbox");' + "\r\n";
      S = S + "        super.postInit(params);" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "}" + "\r\n";
      S = S + "exports.TceCheckboxEditorComponent = TceCheckboxEditorComponent;" + "\r\n";
      S = S + "" + "\r\n";
      S = S + "" + "\r\n";
      S = S + "/*" + "\r\n";
      S = S + "ceText," + "\r\n";
      S = S + "ceNumber," + "\r\n";
      S = S + "ceDate," + "\r\n";
      S = S + "ceTime," + "\r\n";
      S = S + "ceRange," + "\r\n";
      S = S + "ceColor," + "\r\n";
      S = S + "ceWeek," + "\r\n";
      S = S + "ceMonth," + "\r\n";
      S = S + "ceURL," + "\r\n";
      S = S + "ceEmail," + "\r\n";
      S = S + "ceTel," + "\r\n";
      S = S + "ceMask," + "\r\n";
      S = S + "ceCombo," + "\r\n";
      S = S + "ceMemo," + "\r\n";
      S = S + "ceNone," + "\r\n";
      S = S + "ceCustom," + "\r\n";
      S = S + "ceCheckbox," + "\r\n";
      S = S + "ceCombobox," + "\r\n";
      S = S + "ceDateTime," + "\r\n";
      S = S + "cePicker," + "\r\n";
      S = S + "ceColorPicker" + "\r\n";
      S = S + "*/" + "\r\n";
      S = S + "class TestRendererComponent extends TcrImageRendererComponent {" + "\r\n";
      S = S + "}" + "\r\n";
      S = S + "exports.TestRendererComponent = TestRendererComponent;" + "\r\n";
      S = S + "class TestEditorComponent extends TceNumberEditorComponent {" + "\r\n";
      S = S + "    init(params) {" + "\r\n";
      S = S + "        super.init(params);" + "\r\n";
      S = S + "        super.postInit(params);" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "}" + "\r\n";
      S = S + "exports.TestEditorComponent = TestEditorComponent;" + "\r\n";
      S = S + "" + "\r\n";
      Result = S;
      return Result;
    };
    this.GlobalVariableName = function () {
      var Result = "";
      Result = "agCellComp";
      return Result;
    };
    this.GetExports = function () {
      var Result = null;
      Result = null;
      if (typeof(document.agCellComp) != "undefined")
      this.Result = document.agCellComp;
      return Result;
    };
  });
  $mod.$init = function () {
    pas["WEBLib.DataGrid.libjs"].TTMSModuleLoader.RegisterEmbeddedJavaScript($mod.TDGCellComponents.$create("Create"));
  };
});
rtl.module("libdatagrid",["System","WEBLib.DataGrid.Common","Web","JS","Classes","jsdelphisystem","DB"],function () {
  "use strict";
  var $mod = this;
  rtl.createClass(this,"TJSConvert",pas.System.TObject,function () {
    this.FieldToJSValue = function (Field) {
      var Result = undefined;
      Result = null;
      if (Field != null) {
        var $tmp = Field.FDataType;
        if ($tmp === pas.DB.TFieldType.ftUnknown) {}
        else if ($tmp === pas.DB.TFieldType.ftString) {
          Result = Field.GetAsString()}
         else if ($tmp === pas.DB.TFieldType.ftInteger) {
          Result = Field.GetAsInteger()}
         else if ($tmp === pas.DB.TFieldType.ftLargeint) {
          Result = Field.GetAsInteger()}
         else if ($tmp === pas.DB.TFieldType.ftBoolean) {
          Result = Field.GetAsBoolean()}
         else if ($tmp === pas.DB.TFieldType.ftFloat) {
          Result = Field.GetAsFloat()}
         else if ($tmp === pas.DB.TFieldType.ftDate) {
          Result = Field.GetAsString()}
         else if ($tmp === pas.DB.TFieldType.ftTime) {
          Result = Field.GetAsString()}
         else if ($tmp === pas.DB.TFieldType.ftDateTime) {
          Result = Field.GetAsString()}
         else if ($tmp === pas.DB.TFieldType.ftAutoInc) {
          Result = Field.GetAsString()}
         else if ($tmp === pas.DB.TFieldType.ftBlob) {
          Result = Field.GetAsString()}
         else if ($tmp === pas.DB.TFieldType.ftMemo) {
          Result = Field.GetAsString()}
         else if ($tmp === pas.DB.TFieldType.ftFixedChar) {
          Result = Field.GetAsString()}
         else if ($tmp === pas.DB.TFieldType.ftVariant) {
          Result = Field.GetAsString()}
         else if ($tmp === pas.DB.TFieldType.ftDataSet) {}
        else if ($tmp === pas.DB.TFieldType.ftWideString) {
          Result = Field.GetAsString()}
         else if ($tmp === pas.DB.TFieldType.ftWord) Result = Field.GetAsInteger();
      };
      return Result;
    };
    this.JSValueToField = function (Value, Field) {
      var Result = false;
      Result = false;
      if (Field != null) {
        var $tmp = Field.FDataType;
        if ($tmp === pas.DB.TFieldType.ftUnknown) {}
        else if ($tmp === pas.DB.TFieldType.ftString) {
          if (Value == null) {
            Field.SetData(null)}
           else Field.SetAsString("" + Value);
          Result = true;
        } else if ($tmp === pas.DB.TFieldType.ftInteger) {
          Field.SetAsInteger(rtl.trunc(Value));
          Result = true;
        } else if ($tmp === pas.DB.TFieldType.ftLargeint) {
          Field.SetAsLargeInt(rtl.trunc(Value));
          Result = true;
        } else if ($tmp === pas.DB.TFieldType.ftBoolean) {
          if (Value == null) {
            Field.SetAsBoolean(false)}
           else Field.SetAsBoolean(!(Value == false));
          Result = true;
        } else if ($tmp === pas.DB.TFieldType.ftFloat) {
          Field.SetAsFloat(rtl.getNumber(Value));
          Result = true;
        } else if ($tmp === pas.DB.TFieldType.ftDate) {
          Field.SetAsString("" + Value);
          Result = true;
        } else if ($tmp === pas.DB.TFieldType.ftTime) {
          Field.SetAsString("" + Value);
          Result = true;
        } else if ($tmp === pas.DB.TFieldType.ftDateTime) {
          Field.SetAsString("" + Value);
          Result = true;
        } else if ($tmp === pas.DB.TFieldType.ftAutoInc) {
          Field.SetAsString("" + Value);
          Result = true;
        } else if ($tmp === pas.DB.TFieldType.ftBlob) {}
        else if ($tmp === pas.DB.TFieldType.ftMemo) {
          Field.SetAsString("" + Value);
          Result = true;
        } else if ($tmp === pas.DB.TFieldType.ftFixedChar) {
          Field.SetAsString("" + Value);
          Result = true;
        } else if ($tmp === pas.DB.TFieldType.ftVariant) {
          Field.SetAsString("" + Value);
          Result = true;
        } else if ($tmp === pas.DB.TFieldType.ftDataSet) {}
        else if ($tmp === pas.DB.TFieldType.ftWideString) {
          Field.SetAsString("" + Value);
          Result = true;
        } else if ($tmp === pas.DB.TFieldType.ftWord) {
          Field.SetAsInteger(rtl.trunc(Value));
          Result = true;
        };
      };
      return Result;
    };
  });
  this.$rtti.$MethodVar("TJSCallback",{procsig: rtl.newTIProcSig([],rtl.jsvalue), methodkind: 1});
  this.$rtti.$MethodVar("TResizeImageCallback",{procsig: rtl.newTIProcSig([["FileObject",rtl.jsvalue]],rtl.jsvalue), methodkind: 1});
  rtl.createClassExt(this,"TJSDataGridOptions",Object,"",function () {
    this.$init = function () {
    };
    this.$final = function () {
    };
  });
  rtl.createClass(this,"TJSRowNode",pas.System.TObject,function () {
  });
  this.$rtti.$DynArray("TJSRowNodes",{eltype: this.$rtti["TJSRowNode"]});
  rtl.createClass(this,"TJSGetCellValueParams",pas.System.TObject,function () {
    this.Create$1 = function (ARowNode, AColKey, AUseFormatter) {
      this.rowNode = ARowNode;
      this.colKey = AColKey;
      this.useFormatter = AUseFormatter;
      return this;
    };
  });
  rtl.createClass(this,"TJSValueGetterParam",pas.System.TObject,function () {
  });
  rtl.createClass(this,"TJSCellRendererParam",pas.System.TObject,function () {
  });
  rtl.createClass(this,"TJSCellEditingColumnDef",pas.System.TObject,function () {
  });
  rtl.createClass(this,"TJSCellEditingColumn",pas.System.TObject,function () {
  });
  rtl.createClass(this,"TJSCellEditingEvent",pas.System.TObject,function () {
  });
  rtl.createClass(this,"TJSRowEditingEvent",pas.System.TObject,function () {
  });
  rtl.createClass(this,"TJSPaginationChangedEvent",pas.System.TObject,function () {
  });
  rtl.createClass(this,"TJSSelectionChangedEvent",pas.System.TObject,function () {
  });
  rtl.createClass(this,"TJSSortChangedEvent",pas.System.TObject,function () {
  });
  rtl.createClass(this,"TJSFilterChangedEvent",pas.System.TObject,function () {
  });
  rtl.createClass(this,"TJSGetRowStyleParams",pas.System.TObject,function () {
  });
  rtl.createClass(this,"TJSGetRowClassParams",pas.System.TObject,function () {
  });
  rtl.createClass(this,"TJSStartEditingCellParams",pas.System.TObject,function () {
  });
  rtl.createClass(this,"TJSFocusedCell",pas.System.TObject,function () {
  });
  rtl.createClass(this,"TJSCellPosition",pas.System.TObject,function () {
  });
  this.$rtti.$DynArray("TJSCellPositions",{eltype: this.$rtti["TJSCellPosition"]});
  rtl.createClass(this,"TJSRowSelectedEvent",pas.System.TObject,function () {
  });
  rtl.createClass(this,"TJSTabToNextCellParams",pas.System.TObject,function () {
  });
  rtl.createClass(this,"TJSColumnStateParams",pas.System.TObject,function () {
  });
  rtl.createClass(this,"TJSColumnState",this.TJSColumnStateParams,function () {
  });
  this.$rtti.$DynArray("TJSColumnStates",{eltype: this.$rtti["TJSColumnState"]});
  rtl.createClass(this,"TJSApplyColumnStateParams",pas.System.TObject,function () {
  });
  rtl.createClass(this,"TJSRowNodeTransaction",pas.System.TObject,function () {
  });
  rtl.createClass(this,"TJSRowHeightParams",pas.System.TObject,function () {
  });
  this.$rtti.$MethodVar("TJSSuccessCallback",{procsig: rtl.newTIProcSig([["rowsThisBlock",pas.JS.$rtti["TJSArray"]],["lastRow",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TJSFailCallback",{procsig: rtl.newTIProcSig([]), methodkind: 0});
  rtl.createClass(this,"TJSSortModelItem",pas.System.TObject,function () {
  });
  this.$rtti.$DynArray("TJSSortModelItems",{eltype: this.$rtti["TJSSortModelItem"]});
  rtl.createClass(this,"TJSGetRowsParams",pas.System.TObject,function () {
  });
  this.$rtti.$MethodVar("TJSGetRowsCallback",{procsig: rtl.newTIProcSig([["Params",this.$rtti["TJSGetRowsParams"]]]), methodkind: 0});
  rtl.createClass(this,"TJSDataSource",pas.System.TObject,function () {
  });
  rtl.createClass(this,"TJSFilterCondition",pas.System.TObject,function () {
  });
  rtl.createClass(this,"TJSFilterConditions",pas.System.TObject,function () {
  });
  rtl.createClass(this,"TJSGetLocaleTextParams",pas.System.TObject,function () {
  });
  rtl.createClass(this,"TJSColDef",pas.System.TObject,function () {
  });
  rtl.createClass(this,"TJSCellClassParams",pas.System.TObject,function () {
  });
  this.$rtti.$ExtClass("TJSAgGrid");
  this.$rtti.$Class("TJSExpandOrCollapseAllEvent");
  rtl.createClass(this,"TJSAgGridCommon",pas.System.TObject,function () {
  });
  rtl.createClass(this,"TJSAgEvent",pas.System.TObject,function () {
  });
  rtl.createClass(this,"TJSAgGridEvent",this.TJSAgGridCommon,function () {
  });
  rtl.createClass(this,"TJSAgGlobalEvent",this.TJSAgGridEvent,function () {
  });
  rtl.createClass(this,"TJSModelUpdatedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSToolPanelSizeChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSColumnPivotModeChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSVirtualColumnsChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSColumnEverythingChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSNewColumnsLoadedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSGridColumnsChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSDisplayedColumnsChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSRowDataUpdatedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSRowDataUpdateStartedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSPinnedRowDataChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSPinnedHeightChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSFilterModifiedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSFilterOpenedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSFilterDestroyedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSGridReadyEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSGridPreDestroyedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSColumnContainerWidthChanged",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSDisplayedColumnsWidthChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSColumnHoverChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSBodyHeightChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSComponentStateChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSColumnPanelItemDragStartEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSColumnPanelItemDragEndEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSAgDragEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSDragStartedEvent",this.TJSAgDragEvent,function () {
  });
  rtl.createClass(this,"TJSDragStoppedEvent",this.TJSAgDragEvent,function () {
  });
  rtl.createClass(this,"TJSCheckboxChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSGridSizeChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSPivotMaxColumnsExceededEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSRowDragEvent",this.TJSAgGlobalEvent,function () {
    var $r = this.$rtti;
    $mod.$rtti.$DynArray("TJSRowDragEvent.Nodes$a",{eltype: $mod.$rtti["TJSRowNode"]});
  });
  rtl.createClass(this,"TJSRowDragEnterEvent",this.TJSRowDragEvent,function () {
  });
  rtl.createClass(this,"TJSRowDragEndEvent",this.TJSRowDragEvent,function () {
  });
  rtl.createClass(this,"TJSRowDragMoveEvent",this.TJSRowDragEvent,function () {
  });
  rtl.createClass(this,"TJSRowDragLeaveEvent",this.TJSRowDragEvent,function () {
  });
  rtl.createClass(this,"TJSCutStartEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSCutEndEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSPasteStartEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSPasteEndEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSFillStartEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSFillEndEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSRangeDeleteStartEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSRangeDeleteEndEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSUndoStartedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSUndoEndedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSRedoStartedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSRedoEndedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSViewportChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSFirstDataRenderedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSRangeSelectionChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSChartCreatedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSChartCreated",this.TJSChartCreatedEvent,function () {
  });
  rtl.createClass(this,"TJSChartRangeSelectionChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSChartRangeSelectionChanged",this.TJSChartRangeSelectionChangedEvent,function () {
  });
  rtl.createClass(this,"TJSChartOptionsChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSChartOptionsChanged",this.TJSChartOptionsChangedEvent,function () {
  });
  rtl.createClass(this,"TJSChartDestroyedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSChartDestroyed",this.TJSChartDestroyedEvent,function () {
  });
  rtl.createClass(this,"TJSColumnGroupOpenedEvent",this.TJSAgGlobalEvent,function () {
    var $r = this.$rtti;
    $mod.$rtti.$DynArray("TJSColumnGroupOpenedEvent.ColumnGroups$a",{eltype: rtl.jsvalue});
  });
  rtl.createClass(this,"TJSBaseBodyScrollEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSBodyScrollEvent",this.TJSBaseBodyScrollEvent,function () {
  });
  rtl.createClass(this,"TJSBodyScrollEndEvent",this.TJSBaseBodyScrollEvent,function () {
  });
  rtl.createClass(this,"TJSTooltipEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSTooltipShowEvent",this.TJSTooltipEvent,function () {
  });
  rtl.createClass(this,"TJSTooltipHideEvent",this.TJSTooltipEvent,function () {
  });
  rtl.createClass(this,"TJSPaginationPixelOffsetChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSStickyTopOffsetChangedEvent",this.TJSAgEvent,function () {
  });
  rtl.createClass(this,"TJSCommonCellFocusParams",pas.System.TObject,function () {
  });
  rtl.createClass(this,"TJSCellFocusClearedParams",this.TJSCommonCellFocusParams,function () {
  });
  rtl.createClass(this,"TJSCellFocusedParams",this.TJSCommonCellFocusParams,function () {
  });
  rtl.createClass(this,"TJSHeaderFocusedParams",pas.System.TObject,function () {
  });
  rtl.createClass(this,"TJSHeaderFocusedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSCellFocusClearedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSCellFocusedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSFullWidthRowFocusedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSExpandOrCollapseAllEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSExpandCollapseAllEvent",this.TJSExpandOrCollapseAllEvent,function () {
  });
  rtl.createClass(this,"TJSColumnEvent",this.TJSAgGridEvent,function () {
  });
  rtl.createClass(this,"TJSColumnResizedEvent",this.TJSColumnEvent,function () {
  });
  rtl.createClass(this,"TJSColumnPivotChangedEvent",this.TJSColumnEvent,function () {
  });
  rtl.createClass(this,"TJSColumnRowGroupChangedEvent",this.TJSColumnEvent,function () {
  });
  rtl.createClass(this,"TJSColumnValueChangedEvent",this.TJSColumnEvent,function () {
  });
  rtl.createClass(this,"TJSColumnMovedEvent",this.TJSColumnEvent,function () {
  });
  rtl.createClass(this,"TJSColumnVisibleEvent",this.TJSColumnEvent,function () {
  });
  rtl.createClass(this,"TJSColumnPinnedEvent",this.TJSColumnEvent,function () {
  });
  rtl.createClass(this,"TJSColumnHeaderMouseOverEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSColumnHeaderMouseLeaveEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSColumnHeaderClickedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSColumnHeaderContextMenuEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSContextMenuVisibleChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSAdvancedFilterBuilderVisibleChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSToolPanelVisibleChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSColumnMenuVisibleChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSBaseRowEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSRowEvent",this.TJSBaseRowEvent,function () {
  });
  rtl.createClass(this,"TJSRowWithDataEvent",this.TJSBaseRowEvent,function () {
  });
  rtl.createClass(this,"TJSRowGroupOpenedEvent",this.TJSRowEvent,function () {
  });
  rtl.createClass(this,"TJSRowValueChangedEvent",this.TJSRowEvent,function () {
  });
  rtl.createClass(this,"TJSVirtualRowRemovedEvent",this.TJSRowEvent,function () {
  });
  rtl.createClass(this,"TJSRowClickedEvent",this.TJSRowEvent,function () {
  });
  rtl.createClass(this,"TJSRowDoubleClickedEvent",this.TJSRowEvent,function () {
  });
  rtl.createClass(this,"TJSRowEditingStartedEvent",this.TJSRowEvent,function () {
  });
  rtl.createClass(this,"TJSRowEditingStoppedEvent",this.TJSRowEvent,function () {
  });
  rtl.createClass(this,"TJSFullWidthCellKeyDownEvent",this.TJSRowEvent,function () {
  });
  rtl.createClass(this,"TJSCellEvent",this.TJSRowEvent,function () {
  });
  rtl.createClass(this,"TJSCellWithDataEvent",this.TJSRowWithDataEvent,function () {
  });
  rtl.createClass(this,"TJSCellKeyDownEvent",this.TJSCellEvent,function () {
  });
  rtl.createClass(this,"TJSCellClickedEvent",this.TJSCellEvent,function () {
  });
  rtl.createClass(this,"TJSCellMouseDownEvent",this.TJSCellEvent,function () {
  });
  rtl.createClass(this,"TJSCellDoubleClickedEvent",this.TJSCellEvent,function () {
  });
  rtl.createClass(this,"TJSCellMouseOverEvent",this.TJSCellEvent,function () {
  });
  rtl.createClass(this,"TJSCellMouseOutEvent",this.TJSCellEvent,function () {
  });
  rtl.createClass(this,"TJSCellContextMenuEvent",this.TJSCellEvent,function () {
  });
  rtl.createClass(this,"TJSCellEditingStartedEvent",this.TJSCellEvent,function () {
  });
  rtl.createClass(this,"TJSCellEditingStoppedEvent",this.TJSCellEvent,function () {
  });
  rtl.createClass(this,"TJSCellValueChangedEvent",this.TJSCellWithDataEvent,function () {
  });
  rtl.createClass(this,"TJSCellEditRequestEvent",this.TJSCellWithDataEvent,function () {
  });
  rtl.createClass(this,"TJSAsyncTransactionsFlushedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSAsyncTransactionsFlushed",this.TJSAsyncTransactionsFlushedEvent,function () {
  });
  rtl.createClass(this,"TJSStoreRefreshedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSStateUpdatedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSScrollVisibilityChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSStoreUpdatedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSLeftPinnedWidthChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSRightPinnedWidthChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSRowContainerHeightChanged",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSFlashCellsEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSDisplayedRowsChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSCssVariablesChanged",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSAdvancedFilterEnabledChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSDataTypesInferredEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSFieldValueEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSFieldPickerValueSelectedEvent",this.TJSFieldValueEvent,function () {
  });
  rtl.createClass(this,"TJSRichSelectListRowSelectedEvent",this.TJSFieldValueEvent,function () {
  });
  rtl.createClass(this,"TJSAlignedGridColumnEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSAlignedGridScrollEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSGridOptionsChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSScrollbarWidthChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSKeyShortcutChangedCellStartEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSKeyShortcutChangedCellEndEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSHeightScaleChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSSuppressMovableColumnsEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSSuppressMenuHideEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSSuppressFieldDotNotationEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSColumnContainerWidthChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSRowContainerHeightChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSHeaderHeightChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSColumnHeaderHeightChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSGridStylesChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSRowCountReadyEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSFieldValueChangedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSSideBarUpdatedEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSChartTitleEditEvent",this.TJSAgGlobalEvent,function () {
  });
  rtl.createClass(this,"TJSRecalculateRowBoundsEvent",this.TJSAgGlobalEvent,function () {
  });
  this.$rtti.$ExtClass("TJSAgGrid",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "__agGrid__"});
  this.$rtti.$ExtClass("TJSAgGridLocale",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "__agGridLocale__"});
  this.getAgGridApi = function (InDesigner, ApiName) {
    var Result = null;
    Result = null;
    var theDoc = document;
      if (InDesigner) {
        let ele = document.getElementById("projecthtml");
        if (typeof(ele) == "object" && typeof(ele.ownerDocument) == "object") {
          theDoc = ele.ownerDocument;
        }
      }
    
      if (typeof(exports) === 'object' && typeof(module) === 'object' && typeof(module.exports) != "undefined") {
        Result = module.exports;
      } else if (typeof(define) === 'function' && define.amd) {
        if (typeof(theDoc[ApiName]) !== 'object') {
          console.error("Error: Unable to find document."+ApiName+" reference!\r\n"
            +"Please ensure that the AG-Grid JS file can be found and loaded\r\n"
            +"in manner similar to the following:\r\n"
            +"<script type=\"text/javascript\">\r\n"
            +"require([\"js/ag-grid-community\"], function("+ApiName+") {\r\n"
            +"  document."+ApiName+" = "+ApiName+";\r\n"
            +"  rtl.run();\r\n"
            +"});\r\n"
            +"</script>");
        }
        Result = theDoc[ApiName];
      } else if (typeof(exports) === 'object') {
        Result = exports[ApiName];
      } else {
        Result = theDoc[ApiName];
      };
    return Result;
  };
});
rtl.module("lib.propertyserializer",["System","WEBLib.DataGrid.Common","Classes","Web","JS","WEBLib.Controls","Types","SysUtils","jsdelphisystem"],function () {
  "use strict";
  var $mod = this;
  rtl.createClass(this,"TJSPropertySerializer",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.SL = null;
      this.Events = null;
    };
    this.$final = function () {
      this.SL = undefined;
      this.Events = undefined;
      pas.System.TObject.$final.call(this);
    };
    this.Create$1 = function () {
      this.SL = Array.of();
      this.Events = new Object();
      return this;
    };
    this.AsJsObject = function (IncludeEvents) {
      var Result = null;
      var I = 0;
      var Len = 0;
      var TypeName = "";
      var CurrentName = "";
      var Props = null;
      if (IncludeEvents) {
        Result = pas.JS.New(this.SL);
      } else {
        Len = this.SL.length;
        Props = Array.of();
        for (var $l = 0, $end = Len - 1; $l <= $end; $l++) {
          I = $l;
          if ((I % 2) === 0) {
            CurrentName = "" + this.SL[I];
          } else {
            TypeName = typeof(this.SL[I]);
            if (TypeName !== "function") {
              Props.push(CurrentName);
              Props.push(this.SL[I]);
            };
          };
        };
        Result = pas.JS.New(Props);
      };
      return Result;
    };
    this.AsJsonString = function (IncludeEvents, FunctionPrefix) {
      var Result = "";
      var I = 0;
      var Len = 0;
      var TypeName = "";
      var CurrentName = "";
      var PrefixString = "";
      var EventsString = "";
      Result = "null";
      PrefixString = "";
      EventsString = "";
      if (FunctionPrefix !== "") PrefixString = FunctionPrefix + ".";
      Len = this.SL.length;
      if (Len > 0) Result = "{";
      for (var $l = 0, $end = Len - 1; $l <= $end; $l++) {
        I = $l;
        if ((I % 2) === 0) {
          CurrentName = "" + this.SL[I];
        } else {
          TypeName = typeof(this.SL[I]);
          if (TypeName === "function") {
            if (CurrentName === "init") {
              EventsString = EventsString + PrefixString + ("" + this.Events[CurrentName]) + "();";
            } else {
              EventsString = EventsString + 'this.on("' + CurrentName + '", ' + PrefixString + ("" + this.Events[CurrentName]) + ");";
            };
          } else {
            Result = Result + '"' + CurrentName + '":' + JSON.stringify(this.SL[I]);
          };
        };
      };
      if (EventsString !== "") {
        Result = Result + '"init":function() {' + EventsString + "}";
      };
      if (Len > 0) Result = Result + "}";
      return Result;
    };
    this.AsJsArray = function () {
      var Result = null;
      Result = this.SL;
      return Result;
    };
    this.IterateEvents = function (Callback) {
      var I = 0;
      var Len = 0;
      var TypeName = "";
      var CurrentName = "";
      if (Callback != null) {
        Len = this.SL.length;
        for (var $l = 0, $end = Len - 1; $l <= $end; $l++) {
          I = $l;
          if ((I % 2) === 0) {
            CurrentName = "" + this.SL[I];
          } else {
            TypeName = typeof(this.SL[I]);
            if (TypeName === "function") {
              Callback(CurrentName,"" + this.Events[CurrentName],this.SL[I]);
            };
          };
        };
      };
    };
    this.Add = function (Name, Value, DefaultValue) {
      if (Value !== DefaultValue) {
        this.SL.push(Name);
        this.SL.push(Value);
      };
    };
    this.Add$1 = function (Name, Value, DefaultValue) {
      if (Value !== DefaultValue) {
        if (Value) {
          this.SL.push(Name);
          this.SL.push(true);
        } else {
          this.SL.push(Name);
          this.SL.push(false);
        };
      };
    };
    this.Add$2 = function (Name, Value, DefaultValue) {
      if (Value !== DefaultValue) {
        this.SL.push(Name);
        this.SL.push(Value);
      };
    };
    this.Add$3 = function (Name, Value, DefaultValue) {
      if (Value !== DefaultValue) {
        this.SL.push(Name);
        this.SL.push(Value);
      };
    };
    this.Add$4 = function (Name, Value, VarName) {
      if (Value != null) {
        this.SL.push(Name);
        this.SL.push(Value);
        this.Events[Name] = VarName;
      };
    };
    this.Add$5 = function (Name, Value, DefaultValue) {
      if (Value != DefaultValue) {
        this.SL.push(Name);
        this.SL.push(Value);
      };
    };
    this.AddCollectionAsArray$$$G$$lib$propertyserializer$$TDGCollectionItem = function (Name, Value, Assignment) {
      var Item = null;
      var CollectionItem = null;
      var Arr = null;
      if ((Value != null) && (Value.GetCount() > 0) && (Assignment != null)) {
        Arr = Array.of();
        var $in = Value.GetEnumerator();
        try {
          while ($in.MoveNext()) {
            Item = $in.GetCurrent();
            CollectionItem = rtl.as(Item,pas["WEBLib.DataGrid.Options"].TDGCollectionItem);
            if (CollectionItem !== null) {
              Assignment(CollectionItem,Arr);
            };
          }
        } finally {
          $in = rtl.freeLoc($in)
        };
        this.SL.push(Name);
        this.SL.push(Arr);
      };
    };
    this.AddType$$$G$$lib$propertyserializer$$TBiDiMode = function (Name, Value, GetValueCallback) {
      var ReturnValue = undefined;
      if (GetValueCallback != null) {
        ReturnValue = GetValueCallback(Value);
        if (ReturnValue != null) {
          this.SL.push(Name);
          this.SL.push(ReturnValue);
        };
      };
    };
    this.AddType$$$G$$lib$propertyserializer$$String = function (Name, Value, GetValueCallback) {
      var ReturnValue = undefined;
      if (GetValueCallback != null) {
        ReturnValue = GetValueCallback(Value);
        if (ReturnValue != null) {
          this.SL.push(Name);
          this.SL.push(ReturnValue);
        };
      };
    };
    this.AddType$$$G$$lib$propertyserializer$$TDGRowSelectionType = function (Name, Value, GetValueCallback) {
      var ReturnValue = undefined;
      if (GetValueCallback != null) {
        ReturnValue = GetValueCallback(Value);
        if (ReturnValue != null) {
          this.SL.push(Name);
          this.SL.push(ReturnValue);
        };
      };
    };
    this.AddType$$$G$$lib$propertyserializer$$TDGRowEditType = function (Name, Value, GetValueCallback) {
      var ReturnValue = undefined;
      if (GetValueCallback != null) {
        ReturnValue = GetValueCallback(Value);
        if (ReturnValue != null) {
          this.SL.push(Name);
          this.SL.push(ReturnValue);
        };
      };
    };
    this.AddType$$$G$$lib$propertyserializer$$TDGServerDataAdapter = function (Name, Value, GetValueCallback) {
      var ReturnValue = undefined;
      if (GetValueCallback != null) {
        ReturnValue = GetValueCallback(Value);
        if (ReturnValue != null) {
          this.SL.push(Name);
          this.SL.push(ReturnValue);
        };
      };
    };
    this.AddType$$$G$$lib$propertyserializer$$TDGCellDataType = function (Name, Value, GetValueCallback) {
      var ReturnValue = undefined;
      if (GetValueCallback != null) {
        ReturnValue = GetValueCallback(Value);
        if (ReturnValue != null) {
          this.SL.push(Name);
          this.SL.push(ReturnValue);
        };
      };
    };
    this.AddType$$$G$$lib$propertyserializer$$TDGSelectCellEditorCollection = function (Name, Value, GetValueCallback) {
      var ReturnValue = undefined;
      if (GetValueCallback != null) {
        ReturnValue = GetValueCallback(Value);
        if (ReturnValue != null) {
          this.SL.push(Name);
          this.SL.push(ReturnValue);
        };
      };
    };
  });
});
rtl.module("WEBLib.DataGrid.Options",["System","WEBLib.DataGrid.Common","WEBLib.DataGrid.Formatting","Classes","Web","JS","WEBLib.Controls","WEBLib.Graphics","SysUtils","WEBLib.StdCtrls","WEBLib.Menus","jsdelphisystem","WEBLib.DataGrid.CellComponents","WEBLib.RegularExpressions","libdatagrid","Types","lib.propertyserializer","WEBLib.DataGrid.libjs"],function () {
  "use strict";
  var $mod = this;
  this.$rtti.$MethodVar("TDataGridChangedEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TDGColumnValueGetter",{procsig: rtl.newTIProcSig([["Params",pas.libdatagrid.$rtti["TJSValueGetterParam"]]],rtl.jsvalue), methodkind: 1});
  this.$rtti.$MethodVar("TDGColumnValueFormatter",{procsig: rtl.newTIProcSig([["Value",rtl.jsvalue]],rtl.jsvalue), methodkind: 1});
  this.$rtti.$MethodVar("TDGColumnSortComparison",{procsig: rtl.newTIProcSig([["ValueA",rtl.jsvalue],["ValueB",rtl.jsvalue],["RowNodeA",pas.libdatagrid.$rtti["TJSRowNode"]],["RowNodeB",pas.libdatagrid.$rtti["TJSRowNode"]],["IsDescending",rtl.boolean]],rtl.longint), methodkind: 1});
  this.$rtti.$MethodVar("TDGCustomCellRender",{procsig: rtl.newTIProcSig([["Params",pas.libdatagrid.$rtti["TJSCellRendererParam"]]],rtl.jsvalue), methodkind: 1});
  this.$rtti.$MethodVar("TDGCellClassFunc",{procsig: rtl.newTIProcSig([["Params",pas.libdatagrid.$rtti["TJSCellClassParams"]]],rtl.jsvalue), methodkind: 1});
  this.$rtti.$MethodVar("TDGCellStyleFunc",{procsig: rtl.newTIProcSig([["Params",pas.libdatagrid.$rtti["TJSCellClassParams"]]],rtl.jsvalue), methodkind: 1});
  rtl.createClass(this,"ISGChange",pas.System.TObject,function () {
  });
  this.$rtti.$Class("TDGCollectionItem");
  this.$rtti.$MethodVar("TDGFreeNotifierEvent",{procsig: rtl.newTIProcSig([["AComponent",pas.Classes.$rtti["TComponent"]],["Operation",pas.Classes.$rtti["TOperation"]]]), methodkind: 0});
  rtl.createClass(this,"TDGFreeNotifier",pas.Classes.TComponent,function () {
    this.$init = function () {
      pas.Classes.TComponent.$init.call(this);
      this.FFreeNotifierHandler = null;
    };
    this.$final = function () {
      this.FFreeNotifierHandler = undefined;
      pas.Classes.TComponent.$final.call(this);
    };
    this.Create$2 = function (FreeNotifierHandler) {
      pas.Classes.TComponent.Create$1.call(this,null);
      this.FFreeNotifierHandler = FreeNotifierHandler;
      return this;
    };
    this.Destroy = function () {
      pas.Classes.TComponent.Destroy.call(this);
    };
    this.Notification = function (AComponent, Operation) {
      pas.Classes.TComponent.Notification.call(this,AComponent,Operation);
      if (this.FFreeNotifierHandler != null) this.FFreeNotifierHandler(AComponent,Operation);
    };
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TDGCollectionItem",pas.Classes.TCollectionItem,function () {
  });
  rtl.createClass(this,"TDGCollection",pas.Classes.TOwnedCollection,function () {
    this.$init = function () {
      pas.Classes.TOwnedCollection.$init.call(this);
      this.FCallback = null;
      this.FInChangeTransaction = false;
    };
    this.$final = function () {
      this.FCallback = undefined;
      pas.Classes.TOwnedCollection.$final.call(this);
    };
    this.DoChange = function () {
      if (!this.FInChangeTransaction && (this.FCallback != null)) this.FCallback(this);
    };
    this.BeginChanges = function () {
      this.FInChangeTransaction = true;
    };
    this.ApplyChanges = function () {
      this.FInChangeTransaction = false;
      this.DoChange();
    };
    this.RegisterCallback = function (Callback) {
      this.FCallback = Callback;
    };
  });
  rtl.createClass(this,"TDGPersistent",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FCallback = null;
      this.FInChangeTransaction = false;
    };
    this.$final = function () {
      this.FCallback = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.DoChange = function () {
      if (!this.FInChangeTransaction && (this.FCallback != null)) this.FCallback(this);
    };
    this.BeginChanges = function () {
      this.FInChangeTransaction = true;
    };
    this.ApplyChanges = function () {
      this.FInChangeTransaction = false;
      this.DoChange();
    };
    this.RegisterCallback = function (Callback) {
      this.FCallback = Callback;
    };
  });
  rtl.createClass(this,"TDGSelectCellEditorCollectionItem",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FText = "";
      this.FValue = "";
    };
    this.GetDisplayName = function () {
      var Result = "";
      Result = "(Empty String)";
      if (this.FText.length > 0) {
        Result = this.FText;
      };
      return Result;
    };
    this.Assign = function (Source) {
      var SourceItem = null;
      SourceItem = rtl.as(Source,$mod.TDGSelectCellEditorCollectionItem);
      if (SourceItem !== null) {
        this.FText = SourceItem.FText;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Text",0,rtl.string,"FText","FText");
    $r.addProperty("Value",0,rtl.string,"FValue","FValue");
  });
  rtl.createClass(this,"TDGSelectCellEditorCollection",pas.Classes.TOwnedCollection,function () {
    this.$init = function () {
      pas.Classes.TOwnedCollection.$init.call(this);
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      pas.Classes.TOwnedCollection.$final.call(this);
    };
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      this.SetItem(Index,Value);
    };
    this.DoChange = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Update = function (Item) {
      pas.Classes.TCollection.Update.apply(this,arguments);
      if ((this.Owner() != null) && !(pas.Classes.TComponentStateItem.csLoading in this.Owner().FComponentState)) this.DoChange();
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,$mod.TDGSelectCellEditorCollectionItem);
      return this;
    };
    this.Create$4 = function (AOwner, ItemClass) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,ItemClass);
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      return Result;
    };
  });
  this.$rtti.$Class("TDGMultilevelHeaderCollection");
  this.$rtti.$Class("TDGMultilevelHeaderCollectionItem");
  rtl.recNewT(this,"TDGMultilevelHeaderParams",function () {
    this.Item = null;
    this.Level = 0;
    this.PathName = "";
    this.$eq = function (b) {
      return (this.Item === b.Item) && (this.Level === b.Level) && (this.PathName === b.PathName);
    };
    this.$assign = function (s) {
      this.Item = s.Item;
      this.Level = s.Level;
      this.PathName = s.PathName;
      return this;
    };
    var $r = $mod.$rtti.$Record("TDGMultilevelHeaderParams",{},this);
    $r.addField("Item",$mod.$rtti["TDGMultilevelHeaderCollectionItem"]);
    $r.addField("Level",rtl.longint);
    $r.addField("PathName",rtl.string);
  });
  rtl.createClass(this,"TDGMultilevelHeaderCollectionItem",this.TDGCollectionItem,function () {
    this.$init = function () {
      $mod.TDGCollectionItem.$init.call(this);
      this.FHeaders = null;
      this.FName = "";
      this.FParent = null;
      this.FOnChange = null;
      this.FInternalParentObject = null;
    };
    this.$final = function () {
      this.FHeaders = undefined;
      this.FParent = undefined;
      this.FOnChange = undefined;
      this.FInternalParentObject = undefined;
      $mod.TDGCollectionItem.$final.call(this);
    };
    this.SetHeaders = function (Value) {
      if (this.FHeaders != null) {
        this.FHeaders.Assign(Value);
      };
    };
    this.GetPathName = function () {
      var Result = "";
      var Owner = null;
      var Grid = null;
      Result = "";
      Owner = this.GetOwner();
      if ((Owner != null) && Owner.$class.InheritsFrom($mod.TDGMultilevelHeaderCollection)) {
        Owner = Owner.Owner();
        if ((Owner != null) && Owner.$class.InheritsFrom(pas["WEBLib.DataGrid"].TDataGrid)) {
          Grid = Owner;
          if (Grid.FMultilevelHeaders != null) Result = Grid.FMultilevelHeaders.GetPathName(this);
        };
      };
      return Result;
    };
    this.SetName = function (Value) {
      this.FName = Value;
      this.DoChange();
    };
    this.GetDisplayName = function () {
      var Result = "";
      if (this.FName !== "") {
        Result = this.FName;
      } else {
        Result = "Requires a unique name!";
      };
      return Result;
    };
    this.DoChange = function () {
      var Owner = null;
      if (this.FOnChange != null) {
        this.FOnChange(this);
      };
      Owner = this.GetOwner();
      if ((Owner !== null) && Owner.$class.InheritsFrom($mod.TDGMultilevelHeaderCollection)) {
        Owner.DoChange();
      };
    };
    this.Create$1 = function (ACollection) {
      var Owner = null;
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      Owner = this.GetOwner();
      if ((Owner != null) && Owner.$class.InheritsFrom($mod.TDGMultilevelHeaderCollection)) {
        Owner = Owner.GetOwner();
        if ((Owner != null) && Owner.$class.InheritsFrom(pas.Classes.TComponent)) {
          this.FHeaders = $mod.TDGMultilevelHeaderCollection.$create("Create$3",[Owner]);
          this.FHeaders.FParentItem = this;
        };
      };
      if ((ACollection != null) && ACollection.$class.InheritsFrom($mod.TDGMultilevelHeaderCollection)) {
        this.FParent = ACollection;
      };
      return this;
    };
    this.Destroy = function () {
      if (this.FParent != null) this.FParent = null;
      if (this.FHeaders != null) {
        pas.SysUtils.FreeAndNil({p: this, get: function () {
            return this.p.FHeaders;
          }, set: function (v) {
            this.p.FHeaders = v;
          }});
      };
      pas.Classes.TCollectionItem.Destroy.call(this);
    };
    var $r = this.$rtti;
    $r.addProperty("HeaderName",2,rtl.string,"FName","SetName");
    $r.addProperty("Headers",2,$mod.$rtti["TDGMultilevelHeaderCollection"],"FHeaders","SetHeaders");
  });
  rtl.createClass(this,"TDGMultilevelHeaderCollection",this.TDGCollection,function () {
    this.$init = function () {
      $mod.TDGCollection.$init.call(this);
      this.FParentItem = null;
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FParentItem = undefined;
      this.FOnChange = undefined;
      $mod.TDGCollection.$final.call(this);
    };
    this.GetItem$1 = function (Index) {
      var Result = null;
      var ColItem = null;
      Result = null;
      ColItem = pas.Classes.TCollection.GetItem.call(this,Index);
      if ((ColItem != null) && ColItem.$class.InheritsFrom($mod.TDGMultilevelHeaderCollectionItem)) Result = ColItem;
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      pas.Classes.TCollection.SetItem.call(this,Index,Value);
    };
    this.TraverseGetPathDepth = function (Header, PathName, Level, PathPrefix) {
      var Result = 0;
      var I = 0;
      var CurrentItem = null;
      var CurrentPath = "";
      var NextPathPrefix = "";
      Result = 0;
      for (var $l = 0, $end = Header.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        CurrentItem = Header.GetItem$1(I);
        CurrentPath = PathPrefix + CurrentItem.FName;
        if (CurrentPath === PathName) {
          Result = Level;
          return Result;
        };
        if (CurrentItem.FHeaders != null) {
          NextPathPrefix = CurrentPath + " | ";
          Result = this.TraverseGetPathDepth(CurrentItem.FHeaders,PathName,Level + 1,NextPathPrefix);
          if (Result > 0) return Result;
        };
      };
      return Result;
    };
    this.Traverse = function (Header, Callback, Level, PathPrefix) {
      var Result = false;
      var Param = $mod.TDGMultilevelHeaderParams.$new();
      var I = 0;
      var NextPathPrefix = "";
      Result = false;
      for (var $l = 0, $end = Header.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        Param.Item = Header.GetItem$1(I);
        Param.PathName = PathPrefix + Param.Item.FName;
        Param.Level = Level;
        if (Callback($mod.TDGMultilevelHeaderParams.$clone(Param))) return Result;
        if (Param.Item.FHeaders != null) {
          NextPathPrefix = Param.PathName + " | ";
          Result = this.Traverse(Param.Item.FHeaders,Callback,Level + 1,NextPathPrefix);
          if (Result) return Result;
        };
      };
      return Result;
    };
    this.DoChange = function () {
      $mod.TDGCollection.DoChange.call(this);
      if (this.FOnChange != null) {
        this.FOnChange(this);
      };
    };
    this.Update = function (Item) {
      pas.Classes.TCollection.Update.apply(this,arguments);
      if ((this.Owner() != null) && !(pas.Classes.TComponentStateItem.csLoading in this.Owner().FComponentState)) this.DoChange();
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,$mod.TDGMultilevelHeaderCollectionItem);
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      return Result;
    };
    this.GetPathName = function (Item) {
      var $Self = this;
      var Result = "";
      var PathName = "";
      PathName = "";
      this.Traverse($Self,function (Params) {
        var Result = false;
        Result = false;
        if (Params.Item === Item) {
          PathName = Params.PathName;
          Result = true;
        };
        return Result;
      },1,"");
      Result = PathName;
      return Result;
    };
    this.GetPathItem = function (PathName) {
      var $Self = this;
      var Result = null;
      var PathItem = null;
      PathItem = null;
      this.Traverse$1(function (Params) {
        var Result = false;
        Result = false;
        if (Params.PathName === PathName) {
          PathItem = Params.Item;
          Result = true;
        };
        return Result;
      });
      Result = PathItem;
      return Result;
    };
    this.GetPathDepth = function (PathName) {
      var Result = 0;
      Result = this.TraverseGetPathDepth(this,PathName,1,"");
      return Result;
    };
    this.GetMaxDepth = function () {
      var Result = 0;
      var I = 0;
      var Depth = 0;
      Result = 0;
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        Depth = this.GetItem$1(I).FHeaders.GetMaxDepth() + 1;
        if (Result < Depth) {
          Result = Depth;
        };
      };
      return Result;
    };
    this.Traverse$1 = function (Callback) {
      var Result = false;
      Result = this.Traverse(this,Callback,1,"");
      return Result;
    };
  });
  this.$rtti.$Class("TDGColumnDefsCollection");
  rtl.createClass(this,"TDGColumnDefsCollectionItemBase",this.TDGCollectionItem,function () {
    this.$init = function () {
      $mod.TDGCollectionItem.$init.call(this);
      this.FHeaderName = "";
      this.FFilter = false;
      this.FCellRenderer = undefined;
      this.FCellEditor = undefined;
      this.FEditModeType = 0;
      this.FEditable = false;
      this.FEditable_Set = false;
      this.FViewModeType = 0;
      this.FValueFormatter = null;
      this.FCheckboxSelection = false;
      this.FOnChange = null;
      this.FWidth = 0;
      this.FFlex = 0;
      this.FLockPinned = false;
      this.FCellDataType = 0;
      this.FOnCustomRender = null;
      this.FVisible = false;
      this.FValueGetter = null;
      this.FSortable = false;
      this.FSelectOptions = null;
      this.FOnGetCellClass = null;
      this.FOnGetCellStyle = null;
      this.FResizable = false;
      this.FLockVisible = false;
      this.FSuppressMovable = false;
      this.FEnableCellChangeFlash = false;
      this.FFloatingFilter = false;
      this.FParentHeader = null;
      this.FParentHeaderStr = "";
      this.FParent = null;
      this.FFilter_Set = false;
      this.FAutoHeight = false;
      this.FAutoHeaderHeight = false;
      this.FWrapText = false;
      this.FWrapHeaderText = false;
      this.FViewModeFormat = null;
      this.FOnSortCompare = null;
      this.FField = "";
      this.FFreeNotifier = null;
    };
    this.$final = function () {
      this.FValueFormatter = undefined;
      this.FOnChange = undefined;
      this.FOnCustomRender = undefined;
      this.FValueGetter = undefined;
      this.FSelectOptions = undefined;
      this.FOnGetCellClass = undefined;
      this.FOnGetCellStyle = undefined;
      this.FParentHeader = undefined;
      this.FParent = undefined;
      this.FViewModeFormat = undefined;
      this.FOnSortCompare = undefined;
      this.FFreeNotifier = undefined;
      $mod.TDGCollectionItem.$final.call(this);
    };
    this.SetAutoHeaderHeight = function (Value) {
      this.FAutoHeaderHeight = Value;
      this.DoChange();
    };
    this.SetAutoHeight = function (Value) {
      this.FAutoHeight = Value;
      this.DoChange();
    };
    this.SetWrapHeaderText = function (Value) {
      this.FWrapHeaderText = Value;
      this.DoChange();
    };
    this.SetWrapText = function (Value) {
      this.FWrapText = Value;
      this.DoChange();
    };
    this.SetViewModeFormat = function (Value) {
      if (this.FFreeNotifier != null) {
        if (Value !== this.FViewModeFormat) {
          if (this.FViewModeFormat !== null) {
            this.FViewModeFormat.RemoveFreeNotification(this.FFreeNotifier);
          };
          this.FViewModeFormat = Value;
          if (Value !== null) {
            Value.FreeNotification(this.FFreeNotifier);
            if (Value.$class.InheritsFrom(pas["WEBLib.DataGrid.Formatting"].TDGNumberFormatBase)) {
              this.SetViewModeType(pas["WEBLib.DataGrid.Common"].TDGCellRendererType.crtLocaleNumber)}
             else if (Value.$class.InheritsFrom(pas["WEBLib.DataGrid.Formatting"].TDGDateTimeFormatBase)) this.SetViewModeType(pas["WEBLib.DataGrid.Common"].TDGCellRendererType.crtLocaleDateString);
          };
        };
      };
    };
    this.SetOnSortCompare = function (Value) {
      this.FOnSortCompare = Value;
      this.DoChange();
    };
    this.SetParentHeader = function (Value) {
      var Owner = null;
      var NewValue = null;
      var Grid = null;
      Owner = this.GetOwner();
      if ((Owner != null) && Owner.$class.InheritsFrom($mod.TDGColumnDefsCollection)) {
        Owner = Owner.Owner();
        if ((Owner != null) && Owner.$class.InheritsFrom(pas["WEBLib.DataGrid"].TDataGrid)) {
          Grid = Owner;
          if (Grid.IsLoading()) {
            this.FParentHeaderStr = Value;
            this.FParentHeader = null;
          } else if (Grid.FMultilevelHeaders != null) {
            NewValue = Grid.FMultilevelHeaders.GetPathItem(Value);
            if (this.FParentHeader !== NewValue) {
              this.FParentHeader = NewValue;
              this.DoChange();
            };
          };
        };
      };
    };
    this.SetField = function (Value) {
      this.FField = pas["WEBLib.RegularExpressions"].TRegEx.Replace$2(Value,'[\'"]',"");
      this.DoChange();
    };
    this._SetCellRenderer = function (Props, Value) {
      Props.Add$5("cellRenderer",Value,null);
    };
    this._SetCellEditor = function (Props, Value) {
      Props.Add$5("cellEditor",Value,null);
    };
    this.SetHeaderName = function (Value) {
      this.FHeaderName = Value;
      this.DoChange();
    };
    this.SetOnCustomRender = function (Value) {
      this.FOnCustomRender = Value;
      if (this.FOnCustomRender != null) this.SetViewModeType(pas["WEBLib.DataGrid.Common"].TDGCellRendererType.crtCustom);
      this.DoChange();
    };
    this.SetSelectOptions = function (Value) {
      if (this.FSelectOptions != null) {
        this.FSelectOptions.Assign(Value);
        this.DoChange();
      };
    };
    this.SetCellDataType = function (Value) {
      this.FCellDataType = Value;
      this.DoChange();
    };
    this.SetFilter = function (Value) {
      this.FFilter = Value;
      this.DoChange();
    };
    this.SetEditModeType = function (Value) {
      this.FEditModeType = Value;
      this.DoChange();
    };
    this.SetCheckboxSelection = function (Value) {
      this.FCheckboxSelection = Value;
      this.DoChange();
    };
    this.SetEditable = function (Value) {
      this.FEditable = Value;
      this.DoChange();
    };
    this.SetLockPinned = function (Value) {
      this.FLockPinned = Value;
      this.DoChange();
    };
    this.SetSortable = function (Value) {
      this.FSortable = Value;
      this.DoChange();
    };
    this.SetValueFormatter = function (Value) {
      this.FValueFormatter = Value;
      this.DoChange();
    };
    this.SetValueGetter = function (Value) {
      this.FValueGetter = Value;
      this.DoChange();
    };
    this.SetViewModeType = function (Value) {
      this.FViewModeType = Value;
      this.DoChange();
    };
    this.SetVisible = function (Value) {
      this.FVisible = Value;
      this.DoChange();
    };
    this.SetWidth = function (Value) {
      if ((this.FWidth !== Value) && (Value >= 0)) {
        if (Value > 0) this.FFlex = 0;
        this.FWidth = Value;
        this.DoChange();
      };
    };
    this.SetFlex = function (Value) {
      if ((this.FFlex !== Value) && (Value >= 0)) {
        if (Value > 0) this.FWidth = 0;
        this.FFlex = Value;
        this.DoChange();
      };
    };
    this.SetCellEditor = function (Value) {
      this.FCellEditor = Value;
      this.DoChange();
    };
    this.SetCellRenderer = function (Value) {
      this.FCellRenderer = Value;
      this.DoChange();
    };
    this.SetResizable = function (Value) {
      this.FResizable = Value;
      this.DoChange();
    };
    this.SetSuppressMovable = function (Value) {
      this.FSuppressMovable = Value;
      this.DoChange();
    };
    this.SetLockVisible = function (Value) {
      this.FLockVisible = Value;
      this.DoChange();
    };
    this.SetEnableCellChangeFlash = function (Value) {
      this.FEnableCellChangeFlash = Value;
      this.DoChange();
    };
    this.SetOnGetCellStyle = function (Value) {
      this.FOnGetCellStyle = Value;
      this.DoChange();
    };
    this.SetOnGetCellClass = function (Value) {
      this.FOnGetCellClass = Value;
      this.DoChange();
    };
    this.SetFloatingFilter = function (Value) {
      this.FFloatingFilter = Value;
      this.DoChange();
    };
    this.GetParentHeader = function () {
      var Result = "";
      var Owner = null;
      var Grid = null;
      Result = "";
      Owner = this.GetOwner();
      if ((Owner != null) && Owner.$class.InheritsFrom($mod.TDGColumnDefsCollection)) {
        Owner = Owner.Owner();
        if ((Owner != null) && Owner.$class.InheritsFrom(pas["WEBLib.DataGrid"].TDataGrid)) {
          Grid = Owner;
          if (Grid.IsLoading()) {
            Result = this.FParentHeaderStr}
           else if (this.FParentHeaderStr !== "") {
            this.FParentHeader = Grid.FMultilevelHeaders.GetPathItem(this.FParentHeaderStr);
            this.FParentHeaderStr = "";
            if (this.FParentHeader != null) {
              Result = this.FParentHeader.GetPathName();
            };
          } else if (this.FParentHeader != null) {
            Result = this.FParentHeader.GetPathName();
          };
        };
      };
      return Result;
    };
    this.GetDisplayName = function () {
      var Result = "";
      if (this.FField !== "") {
        Result = this.FField;
        if (this.FHeaderName !== "") {
          Result = Result + " (" + this.FHeaderName + ")";
        };
      } else {
        Result = "Requires Field Name!";
      };
      return Result;
    };
    this.DoChange = function () {
      var Owner = null;
      if (this.FOnChange != null) {
        this.FOnChange(this);
      };
      Owner = this.GetOwner();
      if ((Owner !== null) && Owner.$class.InheritsFrom($mod.TDGColumnDefsCollection)) {
        Owner.DoChange();
      };
    };
    this.NotificationHandler = function (AComponent, Operation) {
      if (Operation === pas.Classes.TOperation.opRemove) {
        if (AComponent === this.FViewModeFormat) this.FViewModeFormat = null;
      };
    };
    this.HandleSortComparator = function (ValueA, ValueB, RowNodeA, RowNodeB, IsDescending) {
      var Result = 0;
      var UseLocale = undefined;
      var Owner = null;
      var Grid = null;
      var UseValueA = 0.0;
      var UseValueB = 0.0;
      UseLocale = "en-US";
      Owner = this.GetOwner();
      if ((Owner != null) && Owner.$class.InheritsFrom($mod.TDGColumnDefsCollection)) {
        Owner = Owner.Owner();
        if ((Owner != null) && Owner.$class.InheritsFrom(pas["WEBLib.DataGrid"].TDataGrid)) {
          Grid = Owner;
          if (Grid != null) UseLocale = Grid.FLocalization.FLocale;
        };
      };
      Result = 0;
      var $tmp = this.FCellDataType;
      if ($tmp === pas["WEBLib.DataGrid.Common"].TDGCellDataType.cdtNumber) {
        UseValueA = 0;
        UseValueB = 0;
        if (typeof(ValueA) === "number") {
          UseValueA = rtl.getNumber(ValueA);
          UseValueB = rtl.getNumber(ValueB);
        } else if (typeof(ValueA) === "string") {
          try {
            UseValueA = parseFloat("" + ValueA);
            UseValueB = parseFloat("" + ValueB);
          } catch ($e) {
          };
        };
        if (UseValueA > UseValueB) {
          Result = 1}
         else if (UseValueA < UseValueB) Result = -1;
      } else if ($tmp === pas["WEBLib.DataGrid.Common"].TDGCellDataType.cdtObject) {}
      else {
        return(new Intl.Collator(UseLocale)).compare(ValueA, ValueB);
      };
      typeof({get: function () {
          return UseLocale;
        }, set: function (v) {
          UseLocale = v;
        }});
      return Result;
    };
    this.Create$1 = function (ACollection) {
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      this.FVisible = true;
      this.FSortable = true;
      this.FResizable = true;
      this.FSuppressMovable = false;
      this.FLockVisible = true;
      this.FEnableCellChangeFlash = false;
      this.FSelectOptions = $mod.TDGSelectCellEditorCollection.$create("Create$3",[ACollection.Owner()]);
      if ((ACollection != null) && ACollection.$class.InheritsFrom($mod.TDGColumnDefsCollection)) {
        this.FParent = ACollection;
      };
      this.FEditable_Set = false;
      this.FFilter_Set = false;
      this.FFreeNotifier = $mod.TDGFreeNotifier.$create("Create$2",[rtl.createCallback(this,"NotificationHandler")]);
      return this;
    };
    this.Destroy = function () {
      if (this.FFreeNotifier != null) pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FFreeNotifier;
        }, set: function (v) {
          this.p.FFreeNotifier = v;
        }});
      if (this.FSelectOptions != null) pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FSelectOptions;
        }, set: function (v) {
          this.p.FSelectOptions = v;
        }});
      pas.Classes.TCollectionItem.Destroy.call(this);
    };
    this.Assign = function (Source) {
      var SourceItem = null;
      SourceItem = rtl.as(Source,$mod.TDGColumnDefsCollectionItemBase);
      if (SourceItem !== null) {
        this.FField = SourceItem.FField;
        this.FHeaderName = SourceItem.FHeaderName;
      };
    };
    this.GetAsJSObject = function () {
      var $Self = this;
      var Result = null;
      var Props = null;
      var callback = null;
      var Owner = null;
      var Grid = null;
      var SortComparator = null;
      Owner = this.GetOwner();
      Grid = null;
      if ((Owner != null) && Owner.$class.InheritsFrom($mod.TDGColumnDefsCollection)) {
        Owner = Owner.Owner();
        if ((Owner != null) && Owner.$class.InheritsFrom(pas["WEBLib.DataGrid"].TDataGrid)) Grid = Owner;
      };
      Props = pas["lib.propertyserializer"].TJSPropertySerializer.$create("Create$1");
      try {
        if (this.FField.length > 0) Props.Add$2("field",this.FField,"");
        if (this.FHeaderName.length > 0) Props.Add$2("headerName",this.FHeaderName,"");
        if (this.FFilter || this.FFilter_Set) Props.Add$1("filter",this.FFilter,!this.FFilter);
        if (this.FFloatingFilter) Props.Add$1("floatingFilter",this.FFloatingFilter,false);
        if (this.FWidth > 0) Props.Add$3("width",this.FWidth,0);
        if (this.FLockPinned) Props.Add$1("lockPinned",this.FLockPinned,false);
        Props.Add$1("hide",!this.FVisible,this.FVisible);
        Props.Add$1("sortable",this.FSortable,true);
        Props.Add$1("resizable",this.FResizable,true);
        Props.Add$1("suppressMovable",this.FSuppressMovable,false);
        Props.Add$1("lockVisible",this.FLockVisible,false);
        Props.Add$1("enableCellChangeFlash",this.FEnableCellChangeFlash,false);
        Props.AddType$$$G$$lib$propertyserializer$$TDGCellDataType("cellDataType",this.FCellDataType,function (Value) {
          var Result = undefined;
          Result = null;
          var $tmp = Value;
          if ($tmp === pas["WEBLib.DataGrid.Common"].TDGCellDataType.cdtText) {
            Result = "text"}
           else if ($tmp === pas["WEBLib.DataGrid.Common"].TDGCellDataType.cdtNumber) {
            Result = "number"}
           else if ($tmp === pas["WEBLib.DataGrid.Common"].TDGCellDataType.cdtBoolean) {
            Result = "boolean"}
           else if ($tmp === pas["WEBLib.DataGrid.Common"].TDGCellDataType.cdtDate) {
            Result = "date"}
           else if ($tmp === pas["WEBLib.DataGrid.Common"].TDGCellDataType.cdtDateString) {
            Result = "dateString"}
           else if ($tmp === pas["WEBLib.DataGrid.Common"].TDGCellDataType.cdtObject) Result = "object";
          return Result;
        });
        if (this.FCellRenderer != null) {
          this._SetCellRenderer(Props,this.FCellRenderer);
        } else {
          var $tmp = this.FViewModeType;
          if ($tmp === pas["WEBLib.DataGrid.Common"].TDGCellRendererType.crtText) {
            this._SetCellRenderer(Props,document.agCellComp.TcrTextRendererComponent)}
           else if ($tmp === pas["WEBLib.DataGrid.Common"].TDGCellRendererType.crtImage) {
            this._SetCellRenderer(Props,document.agCellComp.TcrImageRendererComponent)}
           else if ($tmp === pas["WEBLib.DataGrid.Common"].TDGCellRendererType.crtURL) {
            this._SetCellRenderer(Props,document.agCellComp.TcrURLRendererComponent)}
           else if ($tmp === pas["WEBLib.DataGrid.Common"].TDGCellRendererType.crtEmail) {
            this._SetCellRenderer(Props,document.agCellComp.TcrEmailRendererComponent)}
           else if ($tmp === pas["WEBLib.DataGrid.Common"].TDGCellRendererType.crtTel) {
            this._SetCellRenderer(Props,document.agCellComp.TcrTelRendererComponent)}
           else if ($tmp === pas["WEBLib.DataGrid.Common"].TDGCellRendererType.crtLocaleDateString) {
            this._SetCellRenderer(Props,document.agCellComp.TcrLocaleDateStringRendererComponent)}
           else if ($tmp === pas["WEBLib.DataGrid.Common"].TDGCellRendererType.crtLocaleNumber) {
            this._SetCellRenderer(Props,document.agCellComp.TcrLocaleNumberRendererComponent)}
           else if ($tmp === pas["WEBLib.DataGrid.Common"].TDGCellRendererType.crtCustom) {
            if (this.FOnCustomRender != null) {
              this._SetCellRenderer(Props,this.FOnCustomRender);
            };
          } else if ($tmp === pas["WEBLib.DataGrid.Common"].TDGCellRendererType.crtCheckbox) this._SetCellRenderer(Props,"agCheckboxCellRenderer");
        };
        if (this.FCellEditor != null) {
          this._SetCellEditor(Props,this.FCellEditor);
        } else {
          var $tmp1 = this.FEditModeType;
          if ($tmp1 === pas["WEBLib.DataGrid.Common"].TDGCellEditorType.cetText) {
            this._SetCellEditor(Props,document.agCellComp.TceTextEditorComponent)}
           else if ($tmp1 === pas["WEBLib.DataGrid.Common"].TDGCellEditorType.cetNumber) {
            this._SetCellEditor(Props,document.agCellComp.TceNumberEditorComponent)}
           else if ($tmp1 === pas["WEBLib.DataGrid.Common"].TDGCellEditorType.cetDate) {
            this._SetCellEditor(Props,document.agCellComp.TceDateEditorComponent)}
           else if ($tmp1 === pas["WEBLib.DataGrid.Common"].TDGCellEditorType.cetTime) {
            this._SetCellEditor(Props,document.agCellComp.TceTimeEditorComponent)}
           else if ($tmp1 === pas["WEBLib.DataGrid.Common"].TDGCellEditorType.cetRange) {
            this._SetCellEditor(Props,document.agCellComp.TceRangeEditorComponent)}
           else if ($tmp1 === pas["WEBLib.DataGrid.Common"].TDGCellEditorType.cetColor) {
            this._SetCellEditor(Props,document.agCellComp.TceColorEditorComponent)}
           else if ($tmp1 === pas["WEBLib.DataGrid.Common"].TDGCellEditorType.cetWeek) {
            this._SetCellEditor(Props,document.agCellComp.TceWeekEditorComponent)}
           else if ($tmp1 === pas["WEBLib.DataGrid.Common"].TDGCellEditorType.cetMonth) {
            this._SetCellEditor(Props,document.agCellComp.TceMonthEditorComponent)}
           else if ($tmp1 === pas["WEBLib.DataGrid.Common"].TDGCellEditorType.cetURL) {
            this._SetCellEditor(Props,document.agCellComp.TceURLEditorComponent)}
           else if ($tmp1 === pas["WEBLib.DataGrid.Common"].TDGCellEditorType.cetEmail) {
            this._SetCellEditor(Props,document.agCellComp.TceEmailEditorComponent)}
           else if ($tmp1 === pas["WEBLib.DataGrid.Common"].TDGCellEditorType.cetTel) {
            this._SetCellEditor(Props,document.agCellComp.TceTelEditorComponent)}
           else if ($tmp1 === pas["WEBLib.DataGrid.Common"].TDGCellEditorType.cetNone) {
            this._SetCellEditor(Props,document.agCellComp.TceNoneEditorComponent)}
           else if ($tmp1 === pas["WEBLib.DataGrid.Common"].TDGCellEditorType.cetCustom) {}
          else if ($tmp1 === pas["WEBLib.DataGrid.Common"].TDGCellEditorType.cetCheckbox) {
            this._SetCellEditor(Props,"agCheckboxCellEditor")}
           else if ($tmp1 === pas["WEBLib.DataGrid.Common"].TDGCellEditorType.cetCombobox) {
            this._SetCellEditor(Props,"agSelectCellEditor");
            if (this.FSelectOptions != null) {
              Props.AddType$$$G$$lib$propertyserializer$$TDGSelectCellEditorCollection("cellEditorParams",this.FSelectOptions,function (Items) {
                var Result = undefined;
                var I = 0;
                var Arr = null;
                Result = null;
                if ((Items !== null) && (Items.GetCount() > 0)) {
                  Arr = Array.of();
                  for (var $l = 0, $end = Items.GetCount() - 1; $l <= $end; $l++) {
                    I = $l;
                    Arr.push(Items.GetItem$1(I).FText);
                  };
                  Result = pas.JS.New(["values",Arr]);
                };
                return Result;
              });
            };
          } else if ($tmp1 === pas["WEBLib.DataGrid.Common"].TDGCellEditorType.cetDateTime) this._SetCellEditor(Props,document.agCellComp.TceDateEditorComponent);
        };
        if (this.FEditable || this.FEditable_Set) Props.Add$1("editable",this.FEditable,!this.FEditable);
        if (this.FValueFormatter != null) {
          callback = null;
          var formatter = this.FValueFormatter;
                callback = (function(params) {
                  let value = params.value;
                  if (typeof(value) == "undefined") {
                    value = null;
          //        } else if (value == null) {
          //          value = null;
          //        } else if (typeof(value) != "string") {
          //          value = value.toString();
                  }
                  return(formatter(value));
                });
          Props.Add$5("valueFormatter",callback,null);
        };
        if (this.FOnSortCompare != null) {
          Props.Add$5("comparator",this.FOnSortCompare,null);
        } else if ((Grid != null) && Grid.FLocalization.FSortByCollator) {
          SortComparator = rtl.createCallback($Self,"HandleSortComparator");
          Props.Add$5("comparator",SortComparator,"SortComparator");
        };
        if (this.FValueGetter != null) Props.Add$5("valueGetter",this.FValueGetter,"FValueGetter");
        if (this.FCheckboxSelection) Props.Add$1("checkboxSelection",this.FCheckboxSelection,false);
        if (this.FEnableCellChangeFlash) Props.Add$1("enableCellChangeFlash",this.FEnableCellChangeFlash,false);
        Props.Add$5("cellStyle",this.FOnGetCellStyle,null);
        Props.Add$5("cellClass",this.FOnGetCellClass,null);
        if (this.FFlex > 0) Props.Add$3("flex",this.FFlex,0);
        if (this.FWrapText) Props.Add$1("wrapText",this.FWrapText,false);
        if (this.FAutoHeight) Props.Add$1("autoHeight",this.FAutoHeight,false);
        if (this.FWrapHeaderText) Props.Add$1("wrapHeaderText",this.FWrapHeaderText,false);
        if (this.FAutoHeaderHeight) Props.Add$1("autoHeaderHeight",this.FAutoHeaderHeight,false);
        Result = Props.AsJsObject(true);
      } finally {
        Props = rtl.freeLoc(Props);
      };
      return Result;
    };
    this.GetNamePath = function () {
      var Result = "";
      if ((this.FCollection !== null) && (this.FCollection.Owner() !== null) && (this.FField.length > 0)) {
        Result = pas.SysUtils.Format("%s.Column_%s",pas.System.VarRecs(18,this.FCollection.Owner().GetNamePath(),18,this.FField))}
       else Result = pas.Classes.TCollectionItem.GetNamePath.call(this);
      return Result;
    };
    var $r = this.$rtti;
    $r.addProperty("Field",2,rtl.string,"FField","SetField");
    $r.addProperty("CellDataType",2,pas["WEBLib.DataGrid.Common"].$rtti["TDGCellDataType"],"FCellDataType","SetCellDataType");
    $r.addProperty("HeaderName",2,rtl.string,"FHeaderName","SetHeaderName");
    $r.addProperty("ParentHeader",3,rtl.string,"GetParentHeader","SetParentHeader");
    $r.addProperty("Filter",2,rtl.boolean,"FFilter","SetFilter");
    $r.addProperty("SearchFilter",2,rtl.boolean,"FFloatingFilter","SetFloatingFilter",4,{Default: false});
    $r.addProperty("EditModeType",2,pas["WEBLib.DataGrid.Common"].$rtti["TDGCellEditorType"],"FEditModeType","SetEditModeType",4,{Default: pas["WEBLib.DataGrid.Common"].TDGCellEditorType.cetDefault});
    $r.addProperty("Editable",2,rtl.boolean,"FEditable","SetEditable");
    $r.addProperty("ViewModeType",2,pas["WEBLib.DataGrid.Common"].$rtti["TDGCellRendererType"],"FViewModeType","SetViewModeType",4,{Default: pas["WEBLib.DataGrid.Common"].TDGCellRendererType.crtDefault});
    $r.addProperty("ViewModeFormat",2,pas["WEBLib.DataGrid.Formatting"].$rtti["TDGFormatBase"],"FViewModeFormat","SetViewModeFormat");
    $r.addProperty("ValueGetter",2,$mod.$rtti["TDGColumnValueGetter"],"FValueGetter","SetValueGetter");
    $r.addProperty("ValueFormatter",2,$mod.$rtti["TDGColumnValueFormatter"],"FValueFormatter","SetValueFormatter");
    $r.addProperty("CheckboxSelection",2,rtl.boolean,"FCheckboxSelection","SetCheckboxSelection");
    $r.addProperty("Resizable",2,rtl.boolean,"FResizable","SetResizable",4,{Default: true});
    $r.addProperty("Sortable",2,rtl.boolean,"FSortable","SetSortable",4,{Default: true});
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",2,rtl.longint,"FWidth","SetWidth",4,{Default: 0});
    $r.addProperty("Flex",2,rtl.longint,"FFlex","SetFlex",4,{Default: 0});
    $r.addProperty("WrapText",2,rtl.boolean,"FWrapText","SetWrapText",4,{Default: false});
    $r.addProperty("AutoHeight",2,rtl.boolean,"FAutoHeight","SetAutoHeight",4,{Default: false});
    $r.addProperty("WrapHeaderText",2,rtl.boolean,"FWrapHeaderText","SetWrapHeaderText",4,{Default: false});
    $r.addProperty("AutoHeaderHeight",2,rtl.boolean,"FAutoHeaderHeight","SetAutoHeaderHeight",4,{Default: false});
    $r.addProperty("LockPinned",2,rtl.boolean,"FLockPinned","SetLockPinned");
    $r.addProperty("SelectOptions",2,$mod.$rtti["TDGSelectCellEditorCollection"],"FSelectOptions","SetSelectOptions");
    $r.addProperty("SuppressMovable",2,rtl.boolean,"FSuppressMovable","SetSuppressMovable",4,{Default: false});
    $r.addProperty("LockVisible",2,rtl.boolean,"FLockVisible","SetLockVisible",4,{Default: true});
    $r.addProperty("EnableCellChangeFlash",2,rtl.boolean,"FEnableCellChangeFlash","SetEnableCellChangeFlash",4,{Default: false});
    $r.addProperty("OnCustomRender",2,$mod.$rtti["TDGCustomCellRender"],"FOnCustomRender","SetOnCustomRender");
    $r.addProperty("OnGetCellStyle",2,$mod.$rtti["TDGCellStyleFunc"],"FOnGetCellStyle","SetOnGetCellStyle");
    $r.addProperty("OnGetCellClass",2,$mod.$rtti["TDGCellClassFunc"],"FOnGetCellClass","SetOnGetCellClass");
    $r.addProperty("OnSortCompare",2,$mod.$rtti["TDGColumnSortComparison"],"FOnSortCompare","SetOnSortCompare");
  });
  rtl.createClass(this,"TDGColumnDefsCollectionItem",this.TDGColumnDefsCollectionItemBase,function () {
  });
  rtl.createClass(this,"TDGColumnDefsCollectionItemBaseInternal",this.TDGColumnDefsCollectionItem,function () {
  });
  rtl.createClass(this,"TDGColumnDefsCollection",this.TDGCollection,function () {
    this.$init = function () {
      $mod.TDGCollection.$init.call(this);
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      $mod.TDGCollection.$final.call(this);
    };
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      this.SetItem(Index,Value);
    };
    this.DoChange = function () {
      $mod.TDGCollection.DoChange.call(this);
      if (this.FOnChange != null) {
        this.FOnChange(this);
      };
    };
    this.Update = function (Item) {
      pas.Classes.TCollection.Update.apply(this,arguments);
      if ((this.Owner() != null) && !(pas.Classes.TComponentStateItem.csLoading in this.Owner().FComponentState)) this.DoChange();
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,$mod.TDGColumnDefsCollectionItem);
      return this;
    };
    this.Create$4 = function (AOwner, ItemClass) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,ItemClass);
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      return Result;
    };
    this.FindColumnIndex = function (FieldName) {
      var Result = 0;
      var I = 0;
      var CurrentItem = null;
      Result = -1;
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        CurrentItem = this.GetItem$1(I);
        if (CurrentItem.FField === FieldName) {
          Result = I;
          return Result;
        };
      };
      return Result;
    };
    this.FindColumn = function (FieldName) {
      var Result = null;
      var ColumnIndex = 0;
      Result = null;
      ColumnIndex = this.FindColumnIndex(FieldName);
      if (ColumnIndex >= 0) Result = this.GetItem$1(ColumnIndex);
      return Result;
    };
  });
  rtl.createClass(this,"TDGDefaultColDef",this.TDGPersistent,function () {
    this.$init = function () {
      $mod.TDGPersistent.$init.call(this);
      this.FLockVisible = false;
      this.FFloatingFilter = false;
      this.FSuppressMovable = false;
      this.FWidth = "";
      this.FLockPinned = false;
      this.FResizable = false;
      this.FSortable = false;
      this.FFilter = false;
      this.FEditable = false;
      this.FEnabled = false;
    };
    this.SetEditable = function (Value) {
      this.FEditable = Value;
      this.DoChange();
    };
    this.SetFilter = function (Value) {
      this.FFilter = Value;
      this.DoChange();
    };
    this.SetFloatingFilter = function (Value) {
      this.FFloatingFilter = Value;
      this.DoChange();
    };
    this.SetLockPinned = function (Value) {
      this.FLockPinned = Value;
      this.DoChange();
    };
    this.SetLockVisible = function (Value) {
      this.FLockVisible = Value;
      this.DoChange();
    };
    this.SetResizable = function (Value) {
      this.FResizable = Value;
      this.DoChange();
    };
    this.SetSortable = function (Value) {
      this.FSortable = Value;
      this.DoChange();
    };
    this.SetSuppressMovable = function (Value) {
      this.FSuppressMovable = Value;
      this.DoChange();
    };
    this.SetWidth = function (Value) {
      this.FWidth = Value;
      this.DoChange();
    };
    this.SetEnabled = function (Value) {
      this.FEnabled = Value;
      this.DoChange();
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FLockVisible = false;
      this.FFloatingFilter = false;
      this.FSuppressMovable = false;
      this.FWidth = "";
      this.FLockPinned = false;
      this.FResizable = true;
      this.FSortable = false;
      this.FFilter = false;
      this.FEditable = false;
      this.FEnabled = false;
      return this;
    };
    this.GetAsJSObject = function () {
      var Result = null;
      var Props = null;
      Props = pas["lib.propertyserializer"].TJSPropertySerializer.$create("Create$1");
      try {
        if (this.FFilter) Props.Add$1("filter",this.FFilter,false);
        if (this.FFloatingFilter) Props.Add$1("floatingFilter",this.FFloatingFilter,false);
        if (this.FWidth !== "") Props.Add$3("width",pas.SysUtils.StrToInt(this.FWidth),0);
        if (this.FLockPinned) Props.Add$1("lockPinned",this.FLockPinned,false);
        Props.Add$1("sortable",this.FSortable,true);
        Props.Add$1("resizable",this.FResizable,true);
        Props.Add$1("suppressMovable",this.FSuppressMovable,false);
        Props.Add$1("lockVisible",this.FLockVisible,false);
        if (this.FEditable) Props.Add$1("editable",this.FEditable,false);
        Result = Props.AsJsObject(true);
      } finally {
        Props = rtl.freeLoc(Props);
      };
      return Result;
    };
    var $r = this.$rtti;
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: false});
    $r.addProperty("Filter",2,rtl.boolean,"FFilter","SetFilter",4,{Default: false});
    $r.addProperty("SearchFilter",2,rtl.boolean,"FFloatingFilter","SetFloatingFilter",4,{Default: false});
    $r.addProperty("Editable",2,rtl.boolean,"FEditable","SetEditable",4,{Default: false});
    $r.addProperty("Resizable",2,rtl.boolean,"FResizable","SetResizable",4,{Default: true});
    $r.addProperty("Sortable",2,rtl.boolean,"FSortable","SetSortable",4,{Default: true});
    $r.addProperty("Width",2,rtl.string,"FWidth","SetWidth");
    $r.addProperty("LockPinned",2,rtl.boolean,"FLockPinned","SetLockPinned",4,{Default: false});
    $r.addProperty("SuppressMovable",2,rtl.boolean,"FSuppressMovable","SetSuppressMovable",4,{Default: false});
    $r.addProperty("LockVisible",2,rtl.boolean,"FLockVisible","SetLockVisible",4,{Default: false});
  });
  rtl.createClass(this,"TDGBanding",this.TDGPersistent,function () {
    this.$init = function () {
      $mod.TDGPersistent.$init.call(this);
      this.FOddRowsColor = 0;
      this.FEvenRowsColor = 0;
      this.FEnabled = false;
    };
    this.SetEvenRowsColor = function (Value) {
      this.FEvenRowsColor = Value;
      this.DoChange();
    };
    this.SetOddRowsColor = function (Value) {
      this.FOddRowsColor = Value;
      this.DoChange();
    };
    this.SetEnabled = function (Value) {
      this.FEnabled = Value;
      this.DoChange();
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FEnabled = false;
      this.FOddRowsColor = 16777215;
      this.FEvenRowsColor = 16777215;
      return this;
    };
    var $r = this.$rtti;
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled");
    $r.addProperty("OddRowsColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FOddRowsColor","SetOddRowsColor");
    $r.addProperty("EvenRowsColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FEvenRowsColor","SetEvenRowsColor");
  });
  rtl.createClass(this,"TDGTheming",this.TDGPersistent,function () {
    this.$init = function () {
      $mod.TDGPersistent.$init.call(this);
      this.FEnabled = false;
      this.FBuiltInTheme = 0;
      this.FThemeMode = 0;
    };
    this.SetBuiltInTheme = function (Value) {
      this.FBuiltInTheme = Value;
      this.DoChange();
    };
    this.SetEnabled = function (Value) {
      this.FEnabled = Value;
      this.DoChange();
    };
    this.SetThemeMode = function (Value) {
      this.FThemeMode = Value;
      this.DoChange();
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FEnabled = true;
      this.FBuiltInTheme = pas["WEBLib.DataGrid.Common"].TDGBuiltInThemes.agThemeAlpine;
      this.FThemeMode = pas["WEBLib.DataGrid.Common"].TDGBuiltInThemeMode.agLightMode;
      return this;
    };
    this.GetThemeClass = function () {
      var Result = "";
      Result = "";
      if (this.FEnabled) {
        var $tmp = this.FBuiltInTheme;
        if ($tmp === pas["WEBLib.DataGrid.Common"].TDGBuiltInThemes.agThemeAlpine) {
          Result = "ag-theme-alpine"}
         else if ($tmp === pas["WEBLib.DataGrid.Common"].TDGBuiltInThemes.agThemeBalham) {
          Result = "ag-theme-balham"}
         else if ($tmp === pas["WEBLib.DataGrid.Common"].TDGBuiltInThemes.agThemeMaterial) {
          Result = "ag-theme-material"}
         else if ($tmp === pas["WEBLib.DataGrid.Common"].TDGBuiltInThemes.agThemeQuartz) {
          Result = "ag-theme-quartz"}
         else if ($tmp === pas["WEBLib.DataGrid.Common"].TDGBuiltInThemes.agThemeCustom) Result = "ag-theme-custom";
        var $tmp1 = this.FThemeMode;
        if ($tmp1 === pas["WEBLib.DataGrid.Common"].TDGBuiltInThemeMode.agDarkMode) {
          Result = Result + "-dark"}
         else if ($tmp1 === pas["WEBLib.DataGrid.Common"].TDGBuiltInThemeMode.agAutoDarkMode) Result = Result + "-auto-dark";
      };
      return Result;
    };
    var $r = this.$rtti;
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("BuiltInTheme",2,pas["WEBLib.DataGrid.Common"].$rtti["TDGBuiltInThemes"],"FBuiltInTheme","SetBuiltInTheme",4,{Default: pas["WEBLib.DataGrid.Common"].TDGBuiltInThemes.agThemeAlpine});
    $r.addProperty("ThemeMode",2,pas["WEBLib.DataGrid.Common"].$rtti["TDGBuiltInThemeMode"],"FThemeMode","SetThemeMode",4,{Default: pas["WEBLib.DataGrid.Common"].TDGBuiltInThemeMode.agLightMode});
  });
  rtl.createClass(this,"TDGLocalization",this.TDGPersistent,function () {
    this.$init = function () {
      $mod.TDGPersistent.$init.call(this);
      this.FLocale = "";
      this.FSortByCollator = false;
    };
    this.SetSortCollator = function (Value) {
      if (this.FSortByCollator !== Value) {
        this.FSortByCollator = Value;
        this.DoChange();
      };
    };
    this.UpdateLocale = function (Locale) {
      var NewLocale = "";
      NewLocale = "";
      if (typeof(Locale) == "string" && Locale != "") {
        NewLocale = Locale;
      } else {
        NewLocale = navigator.language;
      };
      this.FLocale = NewLocale;
    };
    this.Create$1 = function () {
      this.FSortByCollator = false;
      this.UpdateLocale("");
      return this;
    };
    var $r = this.$rtti;
    $r.addProperty("SortByCollator",2,rtl.boolean,"FSortByCollator","SetSortCollator",4,{Default: false});
  });
  rtl.createClass(this,"TDGUtils",pas.System.TObject,function () {
    this.TColorToHex = function (Value) {
      var Result = "";
      var N = 0;
      var R = 0;
      var G = 0;
      var B = 0;
      N = pas["WEBLib.Graphics"].ColorToRGB(Value);
      R = N & 0xFF;
      G = (N & 0xFF00) >>> 8;
      B = (N & 0xFF0000) >>> 16;
      Result = pas.SysUtils.IntToHex(R,2) + pas.SysUtils.IntToHex(G,2) + pas.SysUtils.IntToHex(B,2);
      return Result;
    };
    this.AsType$$$G$$WEBLib$DataGrid$Options$$TDGDefaultColDef = function (Value) {
      var Result = null;
      Result = null;
      if (Value != null) {
        if ($mod.TDGDefaultColDef.isPrototypeOf(Value)) {
          Result = Value;
        };
      };
      return Result;
    };
    this.AsType$$$G$$WEBLib$DataGrid$Options$$TDGBanding = function (Value) {
      var Result = null;
      Result = null;
      if (Value != null) {
        if ($mod.TDGBanding.isPrototypeOf(Value)) {
          Result = Value;
        };
      };
      return Result;
    };
    this.AsType$$$G$$WEBLib$DataGrid$Options$$TDGTheming = function (Value) {
      var Result = null;
      Result = null;
      if (Value != null) {
        if ($mod.TDGTheming.isPrototypeOf(Value)) {
          Result = Value;
        };
      };
      return Result;
    };
    this.AsType$$$G$$WEBLib$DataGrid$Options$$TDGColumnDefsCollection = function (Value) {
      var Result = null;
      Result = null;
      if (Value != null) {
        if ($mod.TDGColumnDefsCollection.isPrototypeOf(Value)) {
          Result = Value;
        };
      };
      return Result;
    };
  });
},["WEBLib.DataGrid"]);
rtl.module("WEBLib.DataGrid.DataAdapter.Base",["System","WEBLib.DataGrid.Common","Classes","libdatagrid","WEBLib.Controls","WEBLib.DataGrid.libjs","WEBLib.DataGrid.Options","DB","Types","JS","jsdelphisystem","Web","SysUtils"],function () {
  "use strict";
  var $mod = this;
  this.$rtti.$Class("TJSFetchErrorResponse");
  this.$rtti.$RefToProcVar("TDGServerDSCompletionCallback",{procsig: rtl.newTIProcSig([])});
  this.$rtti.$RefToProcVar("TDGServerDSErrorCompletionCallback",{procsig: rtl.newTIProcSig([])});
  this.$rtti.$RefToProcVar("TDGServerDSCallback",{procsig: rtl.newTIProcSig([["Response",pas.JS.$rtti["TJSObject"]]])});
  this.$rtti.$RefToProcVar("TDGServerDSErrorCallback",{procsig: rtl.newTIProcSig([["Response",this.$rtti["TJSFetchErrorResponse"]]])});
  this.$rtti.$RefToProcVar("TDGServerDSRefreshed",{procsig: rtl.newTIProcSig([])});
  this.$rtti.$Class("TDGServerDataAdapter");
  this.$rtti.$MethodVar("TDGServerDSPaginationChanged",{procsig: rtl.newTIProcSig([["Sender",pas.Classes.$rtti["TComponent"]],["CurrentPage",rtl.longint],["PaginationSize",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TDGServerDSDataChanged",{procsig: rtl.newTIProcSig([["Sender",pas.Classes.$rtti["TComponent"]]]), methodkind: 0});
  rtl.createClass(this,"TJSFetchErrorResponse",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.Response = null;
      this.Error = null;
      this.Type_ = "";
      this.StatusCode = 0;
      this.StatusText = "";
      this.ResponseText = "";
    };
    this.$final = function () {
      this.Response = undefined;
      this.Error = undefined;
      pas.System.TObject.$final.call(this);
    };
  });
  rtl.createClass(this,"TDGGetRowsQueueItem",pas.System.TObject,function () {
    this.$init = function () {
      pas.System.TObject.$init.call(this);
      this.Params = null;
      this.SavedAfterOpen = null;
    };
    this.$final = function () {
      this.Params = undefined;
      this.SavedAfterOpen = undefined;
      pas.System.TObject.$final.call(this);
    };
  });
  rtl.createClass(this,"TDGServerDataAdapter",pas.Classes.TComponent,function () {
    this.$init = function () {
      pas.Classes.TComponent.$init.call(this);
      this.FRefreshedCallback = null;
      this.FDebug = false;
      this.FDataCache = null;
      this.FPaginationSize = 0;
      this.FCurrentPage = 0;
      this.FPaginationChangeCallbacks = null;
      this.FSortModel = undefined;
      this.FFilterModel = undefined;
      this.FDataChangeCallbacks = null;
    };
    this.$final = function () {
      this.FRefreshedCallback = undefined;
      this.FDataCache = undefined;
      this.FPaginationChangeCallbacks = undefined;
      this.FDataChangeCallbacks = undefined;
      pas.Classes.TComponent.$final.call(this);
    };
    this.CallDataChangeHandlers = function () {
      var Result = false;
      var I = 0;
      var Len = 0;
      var Callback = null;
      Result = false;
      Len = this.FDataChangeCallbacks.GetCount();
      for (var $l = 0, $end = Len - 1; $l <= $end; $l++) {
        I = $l;
        Callback = this.FDataChangeCallbacks.Get(I);
        Callback(this);
        Result = true;
      };
      return Result;
    };
    this.SetPaginationSize = function (Value) {
      if (this.FPaginationSize !== Value) {
        this.FPaginationSize = Value;
        this.CallPaginationChangeHandlers();
      };
    };
    this.SetCurrentPage = function (Value) {
      if (this.FCurrentPage !== Value) {
        this.FCurrentPage = Value;
        this.CallPaginationChangeHandlers();
      };
    };
    this.CallPaginationChangeHandlers = function () {
      var Result = false;
      var I = 0;
      var Len = 0;
      var Callback = null;
      Result = false;
      Len = this.FPaginationChangeCallbacks.GetCount();
      for (var $l = 0, $end = Len - 1; $l <= $end; $l++) {
        I = $l;
        Callback = this.FPaginationChangeCallbacks.Get(I);
        Callback(this,this.FCurrentPage,this.FPaginationSize);
        Result = true;
      };
      return Result;
    };
    this.SetSortModel = function (Value) {
      if (this.FSortModel != Value) {
        this.FSortModel = Value;
        this.CallPaginationChangeHandlers();
      };
    };
    this.SetFilterModel = function (Value) {
      if (this.FFilterModel != Value) {
        this.FFilterModel = Value;
        this.CallPaginationChangeHandlers();
      };
    };
    this.TriggerRefreshCallback = function () {
      if (this.FRefreshedCallback != null) {
        this.FRefreshedCallback();
        this.FRefreshedCallback = null;
      };
    };
    this.UpdateRow = async function (DataGrid, RowData, Callback, ErrorCallBack) {
      this.UpdateRow$1(RowData,Callback,ErrorCallBack);
    };
    this.Create$1 = function (AOwner) {
      pas.Classes.TComponent.Create$1.apply(this,arguments);
      this.FCurrentPage = -1;
      this.FPaginationSize = -1;
      this.FPaginationChangeCallbacks = pas.Classes.TList.$create("Create$1");
      return this;
    };
    this.Destroy = function () {
      if (this.FPaginationChangeCallbacks != null) pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FPaginationChangeCallbacks;
        }, set: function (v) {
          this.p.FPaginationChangeCallbacks = v;
        }});
      pas.Classes.TComponent.Destroy.call(this);
    };
    this.RegisterPaginationChangeHandler = function (Callback) {
      var Result = false;
      var I = 0;
      var Len = 0;
      var Found = false;
      Result = false;
      Found = false;
      if (Callback != null) {
        if ((typeof(this.FPaginationChangeCallbacks) === "undefined") || (this.FPaginationChangeCallbacks === null)) {
          this.FPaginationChangeCallbacks = pas.Classes.TList.$create("Create$1");
        };
        Len = this.FPaginationChangeCallbacks.GetCount();
        for (var $l = 0, $end = Len - 1; $l <= $end; $l++) {
          I = $l;
          if (rtl.eqCallback(Callback,this.FPaginationChangeCallbacks.Get(I))) {
            Found = true;
            break;
          };
        };
        if (!Found) this.FPaginationChangeCallbacks.Add(Callback);
      };
      return Result;
    };
    this.UnregisterPaginationChangeHandler = function (Callback) {
      var Result = false;
      var I = 0;
      var Len = 0;
      Result = false;
      if (this.FPaginationChangeCallbacks != null) {
        Len = this.FPaginationChangeCallbacks.GetCount();
        for (var $l = Len - 1; $l >= 0; $l--) {
          I = $l;
          if (rtl.eqCallback(Callback,this.FPaginationChangeCallbacks.Get(I))) {
            this.FPaginationChangeCallbacks.Delete(I);
            Result = true;
            break;
          };
        };
      };
      return Result;
    };
    this.RegisterDataChangeHandler = function (Callback) {
      var Result = false;
      var I = 0;
      var Len = 0;
      var Found = false;
      Result = false;
      Found = false;
      if (Callback != null) {
        if ((typeof(this.FDataChangeCallbacks) === "undefined") || (this.FDataChangeCallbacks === null)) {
          this.FDataChangeCallbacks = pas.Classes.TList.$create("Create$1");
        };
        Len = this.FDataChangeCallbacks.GetCount();
        for (var $l = 0, $end = Len - 1; $l <= $end; $l++) {
          I = $l;
          if (rtl.eqCallback(Callback,this.FDataChangeCallbacks.Get(I))) {
            Found = true;
            break;
          };
        };
        if (!Found) this.FDataChangeCallbacks.Add(Callback);
      };
      return Result;
    };
    this.UnregisterDataChangeHandler = function (Callback) {
      var Result = false;
      var I = 0;
      var Len = 0;
      Result = false;
      if (this.FDataChangeCallbacks != null) {
        Len = this.FDataChangeCallbacks.GetCount();
        for (var $l = Len - 1; $l >= 0; $l--) {
          I = $l;
          if (rtl.eqCallback(Callback,this.FDataChangeCallbacks.Get(I))) {
            this.FDataChangeCallbacks.Delete(I);
            Result = true;
            break;
          };
        };
      };
      return Result;
    };
    this.LoadSchema = async function (ColumnDefs, Callback, ErrorCallBack) {
      if (Callback != null) Callback();
    };
    this.Fetch = async function (RequestUrl, RequestConfig, SuccessCallback, ErrorCallBack) {
      var Result = false;
      var Response = null;
      var JsonObject = null;
      var ErrorResponse = null;
      Result = false;
      try {
        Response = await(window.fetch(RequestUrl,RequestConfig));
        if (Response.ok) {
          if (SuccessCallback != null) {
            try {
              JsonObject = await Response.json();
            } catch ($e) {
              if (rtl.isExt($e,SyntaxError)) {
                var Err = $e;
                JsonObject = null;
              } else throw $e
            };
            SuccessCallback(JsonObject);
            Result = true;
          };
        } else {
          if (ErrorCallBack != null) {
            try {
              ErrorResponse = $mod.TJSFetchErrorResponse.$create("Create");
              ErrorResponse.Response = Response;
              ErrorResponse.Error = null;
              ErrorResponse.Type_ = Response.type;
              ErrorResponse.StatusCode = Response.status;
              ErrorResponse.StatusText = Response.statusText;
              ErrorResponse.ResponseText = await Response.text();
              ErrorCallBack(ErrorResponse);
            } finally {
              pas.SysUtils.FreeAndNil({get: function () {
                  return ErrorResponse;
                }, set: function (v) {
                  ErrorResponse = v;
                }});
            };
          };
        };
      } catch ($e) {
        if (rtl.isExt($e,Error)) {
          var E = $e;
          if (ErrorCallBack != null) {
            try {
              ErrorResponse = $mod.TJSFetchErrorResponse.$create("Create");
              ErrorResponse.Error = E;
              ErrorResponse.Type_ = "Error";
              ErrorResponse.StatusText = E.message;
              ErrorCallBack(ErrorResponse);
            } finally {
              pas.SysUtils.FreeAndNil({get: function () {
                  return ErrorResponse;
                }, set: function (v) {
                  ErrorResponse = v;
                }});
            };
          } else throw E;
        } else throw $e
      };
      return Result;
    };
    this.GetServerRowCount = function () {
      var Result = 0;
      Result = -1;
      return Result;
    };
    this.GetCacheCount = function () {
      var Result = 0;
      Result = -1;
      return Result;
    };
    this.GetOffset = function () {
      var Result = 0;
      Result = -1;
      return Result;
    };
    this.WhenGridRefreshed = function (Callback) {
      this.FRefreshedCallback = Callback;
    };
    this.UpdatePaginationParameters = function (Sender, CurrentPage, PaginationSize) {
      var Changed = false;
      Changed = false;
      if (this.FCurrentPage !== CurrentPage) {
        this.FCurrentPage = CurrentPage;
        Changed = true;
      };
      if (this.FPaginationSize !== PaginationSize) {
        this.FPaginationSize = PaginationSize;
        Changed = true;
      };
      if (Changed) this.CallPaginationChangeHandlers();
    };
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TDGServerDataAdapterWithPaging",this.TDGServerDataAdapter,function () {
    rtl.addIntf(this,pas.System.IUnknown);
  });
});
rtl.module("WEBLib.DataGrid.Injections",["System","Classes","Web","JS","WEBLib.Controls","Types","SysUtils","libdatagrid","jsdelphisystem","WEBLib.DataGrid.libjs"],function () {
  "use strict";
  var $mod = this;
  this.$rtti.$ExtClass("TEmbeddedJSInjections",{ancestor: pas.JS.$rtti["TJSObject"], jsclass: "document.agGridInjections"});
  rtl.createClass(this,"TDGGridInjections",pas["WEBLib.DataGrid.libjs"].TEmbeddedJavaScript,function () {
    this.ModuleName = function () {
      var Result = "";
      Result = this.$classname;
      return Result;
    };
    this.Source = function () {
      var Result = "";
      var S = "";
      S = "";
      S = S + "class TMSInjectionFactory extends document.agGrid.BeanStub {" + "\r\n";
      S = S + "    constructor() {" + "\r\n";
      S = S + "        super(...arguments)," + "\r\n";
      S = S + "            this.beanName = 'customTMSInjectionFactory';" + "\r\n";
      S = S + "        this.useOverride = true;" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "    postConstruct() {" + "\r\n";
      S = S + "        var _a, _b, _c, _d;" + "\r\n";
      S = S + "        const dragService = this.getDragService();" + "\r\n";
      S = S + "        if (dragService) {" + "\r\n";
      S = S + "            this.orig_onMouseDown = dragService.onMouseDown.bind(dragService);" + "\r\n";
      S = S + "            dragService.onMouseDown = this.override_onMouseDown.bind(this);" + "\r\n";
      S = S + "        }" + "\r\n";
      S = S + "        const popupService = this.getPopupService();" + "\r\n";
      S = S + "        if (popupService) {" + "\r\n";
      S = S + "            popupService.addEventListenersToPopup = this.override_addEventListenersToPopup.bind(this);" + "\r\n";
      S = S + "            this.popupEventTarget = (_d = (_c = (_b = (_a = this.beans) === null || _a === void 0 ? void 0 : _a.eGridDiv) === null || _b === void 0 ? void 0 : _b.parentElement) === null || _c === void 0 ? void 0 : _c.parentElement) === null || _d === void 0 ? void 0 : _d.parentElement;" + "\r\n";
      S = S + "        }" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "    preWireBeans(beans) {" + "\r\n";
      S = S + "        super.preWireBeans(beans);" + "\r\n";
      S = S + '        if (typeof (this.beans) == "undefined")' + "\r\n";
      S = S + "            this.beans = beans;" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "    getDragService() {" + "\r\n";
      S = S + "        var _a, _b;" + "\r\n";
      S = S + '        if (typeof ((_a = this.beans) === null || _a === void 0 ? void 0 : _a.dragSvc) == "object")' + "\r\n";
      S = S + "            return (this.beans.dragSvc);" + "\r\n";
      S = S + '        else if (typeof ((_b = this.beans) === null || _b === void 0 ? void 0 : _b.dragService) == "object")' + "\r\n";
      S = S + "            return (this.beans.dragService);" + "\r\n";
      S = S + "        return (null);" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "    getPopupService() {" + "\r\n";
      S = S + "        var _a, _b;" + "\r\n";
      S = S + '        if (typeof ((_a = this.beans) === null || _a === void 0 ? void 0 : _a.popupSvc) == "object")' + "\r\n";
      S = S + "            return (this.beans.popupSvc);" + "\r\n";
      S = S + '        else if (typeof ((_b = this.beans) === null || _b === void 0 ? void 0 : _b.popupService) == "object")' + "\r\n";
      S = S + "            return (this.beans.popupService);" + "\r\n";
      S = S + "        return (null);" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "    override_addEventListenersToPopup(popupParams) {" + "\r\n";
      S = S + "        var _a, _b, _c, _d;" + "\r\n";
      S = S + "        const that = this.getPopupService();" + "\r\n";
      S = S + "        var eDocument = that.gos.getDocument();" + "\r\n";
      S = S + "        const ePopupParent = that.getPopupParent();" + "\r\n";
      S = S + '        if (typeof ((_d = (_c = (_b = (_a = this.gos) === null || _a === void 0 ? void 0 : _a.gridOptions) === null || _b === void 0 ? void 0 : _b.context) === null || _c === void 0 ? void 0 : _c.FParent) === null || _d === void 0 ? void 0 : _d.FElement) == "object"' + "\r\n";
      S = S + "            && this.gos.gridOptions.context.FParent.FElement != null) {" + "\r\n";
      S = S + "            eDocument = this.gos.gridOptions.context.FParent.FElement;" + "\r\n";
      S = S + "            if (eDocument == document.body" + "\r\n";
      S = S + '                && typeof (eDocument.parentElement) != "undefined") {' + "\r\n";
      S = S + "                eDocument = eDocument.parentElement;" + "\r\n";
      S = S + "            }" + "\r\n";
      S = S + "        }" + "\r\n";
      S = S + "        const { wrapperEl, eChild: popupEl, closedCallback, afterGuiAttached, closeOnEsc, modal } = popupParams;" + "\r\n";
      S = S + "        let popupHidden = false;" + "\r\n";
      S = S + "        const hidePopupOnKeyboardEvent = (event) => {" + "\r\n";
      S = S + "            const AG_GRID_STOP_PROPAGATION = '__ag_Grid_Stop_Propagation';" + "\r\n";
      S = S + "            if (!wrapperEl.contains(that.gos.getActiveDomElement())) {" + "\r\n";
      S = S + "                return;" + "\r\n";
      S = S + "            }" + "\r\n";
      S = S + "            const key = event.key;" + "\r\n";
      S = S + '            if (key === "Escape" && !(event[AG_GRID_STOP_PROPAGATION] === true)) {' + "\r\n";
      S = S + "                removeListeners({ keyboardEvent: event });" + "\r\n";
      S = S + "            }" + "\r\n";
      S = S + "        };" + "\r\n";
      S = S + "        const hidePopupOnMouseEvent = (event) => removeListeners({ mouseEvent: event });" + "\r\n";
      S = S + "        const hidePopupOnTouchEvent = (event) => removeListeners({ touchEvent: event });" + "\r\n";
      S = S + "        const removeListeners = (popupParams = {}) => {" + "\r\n";
      S = S + "            var _a;" + "\r\n";
      S = S + "            const { mouseEvent, touchEvent, keyboardEvent, forceHide } = popupParams;" + "\r\n";
      S = S + "            if (!forceHide &&" + "\r\n";
      S = S + "                (that.isEventFromCurrentPopup({ mouseEvent, touchEvent }, popupEl) ||" + "\r\n";
      S = S + "                    popupHidden)) {" + "\r\n";
      S = S + "                var event = (touchEvent) ? touchEvent : mouseEvent;" + "\r\n";
      S = S + "                if (event && event.currentTarget == ((_a = document === null || document === void 0 ? void 0 : document.body) === null || _a === void 0 ? void 0 : _a.parentElement)) {" + "\r\n";
      S = S + '                    if (typeof (event.clientX) == "number" && typeof (event.clientY) == "number"' + "\r\n";
      S = S + '                        && typeof (popupEl.getBoundingClientRect) == "function") {' + "\r\n";
      S = S + "                        var rect = popupEl.getBoundingClientRect();" + "\r\n";
      S = S + "                        if (rect) {" + "\r\n";
      S = S + "                            if ((event.clientX >= rect.left && event.clientX <= rect.right)" + "\r\n";
      S = S + "                                && (event.clientY >= rect.top && event.clientY <= rect.bottom)) {" + "\r\n";
      S = S + "                                return;" + "\r\n";
      S = S + "                            }" + "\r\n";
      S = S + "                        }" + "\r\n";
      S = S + "                        else {" + "\r\n";
      S = S + "                            return;" + "\r\n";
      S = S + "                        }" + "\r\n";
      S = S + "                    }" + "\r\n";
      S = S + "                    else {" + "\r\n";
      S = S + "                        return;" + "\r\n";
      S = S + "                    }" + "\r\n";
      S = S + "                }" + "\r\n";
      S = S + "                else {" + "\r\n";
      S = S + "                    return;" + "\r\n";
      S = S + "                }" + "\r\n";
      S = S + "            }" + "\r\n";
      S = S + "            popupHidden = true;" + "\r\n";
      S = S + "            ePopupParent.removeChild(wrapperEl);" + "\r\n";
      S = S + "            eDocument.removeEventListener('keydown', hidePopupOnKeyboardEvent);" + "\r\n";
      S = S + "            eDocument.removeEventListener('mousedown', hidePopupOnMouseEvent);" + "\r\n";
      S = S + "            eDocument.removeEventListener('touchstart', hidePopupOnTouchEvent);" + "\r\n";
      S = S + "            eDocument.removeEventListener('contextmenu', hidePopupOnMouseEvent);" + "\r\n";
      S = S + "            that.eventService.removeEventListener('dragStarted', hidePopupOnMouseEvent);" + "\r\n";
      S = S + "            if (closedCallback) {" + "\r\n";
      S = S + "                closedCallback(mouseEvent || touchEvent || keyboardEvent);" + "\r\n";
      S = S + "            }" + "\r\n";
      S = S + "            that.removePopupFromPopupList(popupEl);" + "\r\n";
      S = S + "        };" + "\r\n";
      S = S + "        if (afterGuiAttached) {" + "\r\n";
      S = S + "            afterGuiAttached({ hidePopup: removeListeners });" + "\r\n";
      S = S + "        }" + "\r\n";
      S = S + "        window.setTimeout(() => {" + "\r\n";
      S = S + "            if (closeOnEsc) {" + "\r\n";
      S = S + '                if (typeof (wrapperEl) != "undefined")' + "\r\n";
      S = S + "                    wrapperEl.addEventListener('keydown', hidePopupOnKeyboardEvent);" + "\r\n";
      S = S + "                else" + "\r\n";
      S = S + "                    eDocument.addEventListener('keydown', hidePopupOnKeyboardEvent);" + "\r\n";
      S = S + "            }" + "\r\n";
      S = S + "            if (modal) {" + "\r\n";
      S = S + "                eDocument.addEventListener('mousedown', hidePopupOnMouseEvent);" + "\r\n";
      S = S + "                that.eventService.addEventListener('dragStarted', hidePopupOnMouseEvent);" + "\r\n";
      S = S + "                eDocument.addEventListener('touchstart', hidePopupOnTouchEvent);" + "\r\n";
      S = S + "                eDocument.addEventListener('contextmenu', hidePopupOnMouseEvent);" + "\r\n";
      S = S + "            }" + "\r\n";
      S = S + "        }, 0);" + "\r\n";
      S = S + "        return removeListeners;" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "    override_onMouseDown(params, mouseEvent) {" + "\r\n";
      S = S + "        var _a, _b;" + "\r\n";
      S = S + '        console.log("override_onMouseDown(" + mouseEvent.x + ", " + mouseEvent.y + ")");' + "\r\n";
      S = S + "        if (!this.useOverride) {" + "\r\n";
      S = S + "            return (this.orig_onMouseDown(params, mouseEvent));" + "\r\n";
      S = S + "        }" + "\r\n";
      S = S + "        const that = this.getDragService();" + "\r\n";
      S = S + "        if (!that)" + "\r\n";
      S = S + '            throw new Error("override_onMouseDown() - Unable to get dragService!");' + "\r\n";
      S = S + "        const a = mouseEvent;" + "\r\n";
      S = S + "        if (params.skipMouseEvent && params.skipMouseEvent(mouseEvent))" + "\r\n";
      S = S + "            return;" + "\r\n";
      S = S + "        if (a._alreadyProcessedByDragService)" + "\r\n";
      S = S + "            return;" + "\r\n";
      S = S + "        if (a._alreadyProcessedByDragService = !0," + "\r\n";
      S = S + "            0 !== mouseEvent.button)" + "\r\n";
      S = S + "            return;" + "\r\n";
      S = S + "        that.shouldPreventMouseEvent(mouseEvent) && mouseEvent.preventDefault();" + "\r\n";
      S = S + "        that.currentDragParams = params;" + "\r\n";
      S = S + "        that.dragging = false;" + "\r\n";
      S = S + "        that.mouseStartEvent = mouseEvent;" + "\r\n";
      S = S + "        that.startTarget = mouseEvent.target;" + "\r\n";
      S = S + "        var target = this.beans.eGridDiv.getRootNode();" + "\r\n";
      S = S + '        if (typeof ((_a = this.beans.eGridDiv.parentElement) === null || _a === void 0 ? void 0 : _a.parentElement) != "undefined") {' + "\r\n";
      S = S + "            var element = (_b = this.beans.eGridDiv.parentElement) === null || _b === void 0 ? void 0 : _b.parentElement;" + "\r\n";
      S = S + "            if (element != document.body) {" + "\r\n";
      S = S + "                target = element;" + "\r\n";
      S = S + "            }" + "\r\n";
      S = S + '            else if (typeof (element.parentElement) != "undefined") {' + "\r\n";
      S = S + "                target = element.parentElement;" + "\r\n";
      S = S + "            }" + "\r\n";
      S = S + "        }" + "\r\n";
      S = S + "        else {" + "\r\n";
      S = S + '            console.error("Error: Unable to locate the parent element of the grid\'s parent!  Using root node instead.");' + "\r\n";
      S = S + "        }" + "\r\n";
      S = S + "        var dragOverlayDiv = null;" + "\r\n";
      S = S + '        dragOverlayDiv = document.createElement("div");' + "\r\n";
      S = S + "        dragOverlayDiv.style.top = 0;" + "\r\n";
      S = S + "        dragOverlayDiv.style.left = 0;" + "\r\n";
      S = S + '        dragOverlayDiv.style.height = "100vh";' + "\r\n";
      S = S + '        dragOverlayDiv.style.width = "100vw";' + "\r\n";
      S = S + '        dragOverlayDiv.style.zIndex = "9999999";' + "\r\n";
      S = S + '        dragOverlayDiv.style.position = "absolute";' + "\r\n";
      S = S + '        dragOverlayDiv.style.pointerEvents = "none";' + "\r\n";
      S = S + "        document.body.appendChild(dragOverlayDiv);" + "\r\n";
      S = S + "        const _mouseMove = (mouseEvent) => {" + "\r\n";
      S = S + '            console.log("override_onMouseMove(" + mouseEvent.x + ", " + mouseEvent.y + ")");' + "\r\n";
      S = S + "            if ((mouseEvent.buttons & 0x00000001) != 1) {" + "\r\n";
      S = S + "                that.onMouseUp(mouseEvent, params.eElement);" + "\r\n";
      S = S + "                if (dragOverlayDiv) {" + "\r\n";
      S = S + "                    dragOverlayDiv.remove();" + "\r\n";
      S = S + "                    dragOverlayDiv = null;" + "\r\n";
      S = S + "                }" + "\r\n";
      S = S + "            }" + "\r\n";
      S = S + "            else {" + "\r\n";
      S = S + '                dragOverlayDiv.style.pointerEvents = "auto";' + "\r\n";
      S = S + "                that.onMouseMove(mouseEvent, params.eElement);" + "\r\n";
      S = S + "            }" + "\r\n";
      S = S + "        };" + "\r\n";
      S = S + "        const _mouseUp = (mouseEvent) => {" + "\r\n";
      S = S + '            console.log("override_onMouseUp(" + mouseEvent.x + ", " + mouseEvent.y + ")");' + "\r\n";
      S = S + "            if (dragOverlayDiv) {" + "\r\n";
      S = S + "                dragOverlayDiv.remove();" + "\r\n";
      S = S + "                dragOverlayDiv = null;" + "\r\n";
      S = S + "            }" + "\r\n";
      S = S + "            that.onMouseUp(mouseEvent, params.eElement);" + "\r\n";
      S = S + "        };" + "\r\n";
      S = S + "        const _contextMenu = mouseEvent => mouseEvent.preventDefault();" + "\r\n";
      S = S + "        const _keyUp = mouseEvent => {" + "\r\n";
      S = S + '            mouseEvent.key === "Escape" && that.cancelDrag(params.eElement);' + "\r\n";
      S = S + "        };" + "\r\n";
      S = S + "        if (true) {" + "\r\n";
      S = S + "            const tempEvents = [{" + "\r\n";
      S = S + "                    target: target," + "\r\n";
      S = S + '                    type: "mousemove",' + "\r\n";
      S = S + "                    listener: _mouseMove" + "\r\n";
      S = S + "                }, {" + "\r\n";
      S = S + "                    target: target," + "\r\n";
      S = S + '                    type: "mouseup",' + "\r\n";
      S = S + "                    listener: _mouseUp" + "\r\n";
      S = S + "                }, {" + "\r\n";
      S = S + "                    target: target," + "\r\n";
      S = S + '                    type: "contextmenu",' + "\r\n";
      S = S + "                    listener: _contextMenu" + "\r\n";
      S = S + "                }, {" + "\r\n";
      S = S + "                    target: target," + "\r\n";
      S = S + '                    type: "keydown",' + "\r\n";
      S = S + "                    listener: _keyUp" + "\r\n";
      S = S + "                }, {" + "\r\n";
      S = S + "                    target: dragOverlayDiv," + "\r\n";
      S = S + '                    type: "mousemove",' + "\r\n";
      S = S + "                    listener: _mouseMove" + "\r\n";
      S = S + "                }, {" + "\r\n";
      S = S + "                    target: dragOverlayDiv," + "\r\n";
      S = S + '                    type: "mouseup",' + "\r\n";
      S = S + "                    listener: _mouseUp" + "\r\n";
      S = S + "                }, {" + "\r\n";
      S = S + "                    target: dragOverlayDiv," + "\r\n";
      S = S + '                    type: "contextmenu",' + "\r\n";
      S = S + "                    listener: _contextMenu" + "\r\n";
      S = S + "                }, {" + "\r\n";
      S = S + "                    target: dragOverlayDiv," + "\r\n";
      S = S + '                    type: "keydown",' + "\r\n";
      S = S + "                    listener: _keyUp" + "\r\n";
      S = S + "                }];" + "\r\n";
      S = S + "            that.addTemporaryEvents(tempEvents);" + "\r\n";
      S = S + "        }" + "\r\n";
      S = S + "        if (params.dragStartPixels === 0)" + "\r\n";
      S = S + "            that.onMouseMove(mouseEvent, params.eElement);" + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "}" + "\r\n";
      S = S + "exports.TMSInjectionFactory = TMSInjectionFactory;" + "\r\n";
      S = S + "function LoadInjectionModule(api) {" + "\r\n";
      S = S + "    var version = null;" + "\r\n";
      S = S + '    if (typeof (api.ModuleRegistry.currentModuleVersion) != "undefined")' + "\r\n";
      S = S + "        version = api.ModuleRegistry.currentModuleVersion;" + "\r\n";
      S = S + '    else if (typeof (api.AllCommunityModule.version) != "undefined")' + "\r\n";
      S = S + "        version = api.AllCommunityModule.version;" + "\r\n";
      S = S + "    var TMSInjectionModule = {" + "\r\n";
      S = S + '        moduleName: "TMSInjectionModule",' + "\r\n";
      S = S + "        version: version," + "\r\n";
      S = S + "        beans: [TMSInjectionFactory]," + "\r\n";
      S = S + "        validate: () => { return ({ isValid: true }); }" + "\r\n";
      S = S + "    };" + "\r\n";
      S = S + '    if (typeof (api.ModuleRegistry.__register) == "function")' + "\r\n";
      S = S + "        api.ModuleRegistry.__register(TMSInjectionModule, false, void 0);" + "\r\n";
      S = S + "    else" + "\r\n";
      S = S + "        api.ModuleRegistry.registerModules([TMSInjectionModule]);" + "\r\n";
      S = S + "}" + "\r\n";
      S = S + "exports.LoadInjectionModule = LoadInjectionModule;" + "\r\n";
      S = S + "function InitInjectionModule(tmsGrid, agGrid) {" + "\r\n";
      S = S + '    if (typeof (agGrid.setGridOption) != "undefined") {' + "\r\n";
      S = S + '        agGrid.setGridOption("context", tmsGrid);' + "\r\n";
      S = S + "    }" + "\r\n";
      S = S + "}" + "\r\n";
      S = S + "exports.InitInjectionModule = InitInjectionModule;" + "\r\n";
      Result = S;
      return Result;
    };
    this.GlobalVariableName = function () {
      var Result = "";
      Result = "agGridInjections";
      return Result;
    };
    this.GetExports = function () {
      var Result = null;
      Result = null;
      if (typeof(document.agGridInjections) != "undefined")
      this.Result = document.agGridInjections;
      return Result;
    };
  });
  $mod.$init = function () {
    pas["WEBLib.DataGrid.libjs"].TTMSModuleLoader.RegisterEmbeddedJavaScript($mod.TDGGridInjections.$create("Create"));
  };
});
rtl.module("WEBLib.DataGrid",["System","WEBLib.DataGrid.Common","Classes","Web","JS","WEBLib.Controls","WEBLib.Graphics","SysUtils","libaggrid","WEBLib.DataGrid.liblocale","WEBLib.RegularExpressions","Generics.Collections","Generics.Defaults","WEBLib.StdCtrls","WEBLib.Menus","WEBLib.DataGrid.Options","WEBLib.DataGrid.DataAdapter.Base","WEBLib.DataGrid.Injections","jsdelphisystem","Math","libdatagrid","Types","lib.propertyserializer","WEBLib.DataGrid.libjs"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.$rtti.$MethodVar("TDataGridRequestEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ARequest",pas["WEBLib.Controls"].$rtti["TJSXMLHttpRequestRecord"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TDGRowSelectedCallBack",{procsig: rtl.newTIProcSig([["Event",pas.libdatagrid.$rtti["TJSRowSelectedEvent"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TDGCellEditingEvent",{procsig: rtl.newTIProcSig([["Params",pas.libdatagrid.$rtti["TJSCellEditingEvent"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TDGRowEditingEvent",{procsig: rtl.newTIProcSig([["Params",pas.libdatagrid.$rtti["TJSRowEditingEvent"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TDGTabToNextCellEvent",{procsig: rtl.newTIProcSig([["Params",pas.libdatagrid.$rtti["TJSTabToNextCellParams"]]],rtl.jsvalue), methodkind: 1});
  this.$rtti.$MethodVar("TDGPaginationChangedEvent",{procsig: rtl.newTIProcSig([["Event",pas.libdatagrid.$rtti["TJSPaginationChangedEvent"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TDGSelectionChangedEvent",{procsig: rtl.newTIProcSig([["Event",pas.libdatagrid.$rtti["TJSSelectionChangedEvent"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TDGSortChangedEvent",{procsig: rtl.newTIProcSig([["Event",pas.libdatagrid.$rtti["TJSSortChangedEvent"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TDGFilterChangedEvent",{procsig: rtl.newTIProcSig([["Event",pas.libdatagrid.$rtti["TJSFilterChangedEvent"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TDGGetRowStyleCallback",{procsig: rtl.newTIProcSig([["Params",pas.libdatagrid.$rtti["TJSGetRowStyleParams"]]],pas.JS.$rtti["TJSObject"]), methodkind: 1});
  this.$rtti.$MethodVar("TDGGetRowClassCallback",{procsig: rtl.newTIProcSig([["Params",pas.libdatagrid.$rtti["TJSGetRowClassParams"]]],rtl.jsvalue), methodkind: 1});
  this.$rtti.$MethodVar("TDGGetRowHeightCallback",{procsig: rtl.newTIProcSig([["Params",pas.libdatagrid.$rtti["TJSRowHeightParams"]]],pas.JS.$rtti["TJSObject"]), methodkind: 1});
  this.$rtti.$MethodVar("TDGCellClickedEvent",{procsig: rtl.newTIProcSig([["Event",pas.libdatagrid.$rtti["TJSCellClickedEvent"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TDGCellDoubleClickedEvent",{procsig: rtl.newTIProcSig([["Event",pas.libdatagrid.$rtti["TJSCellDoubleClickedEvent"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TDGCellFocusedEvent",{procsig: rtl.newTIProcSig([["Event",pas.libdatagrid.$rtti["TJSCellFocusedEvent"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TDGCellMouseOverEvent",{procsig: rtl.newTIProcSig([["Event",pas.libdatagrid.$rtti["TJSCellMouseDownEvent"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TDGCellMouseDown",{procsig: rtl.newTIProcSig([["Event",pas.libdatagrid.$rtti["TJSCellMouseDownEvent"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TDGGetLocaleTextCallBack",{procsig: rtl.newTIProcSig([["Params",pas.libdatagrid.$rtti["TJSGetLocaleTextParams"]]],rtl.string), methodkind: 1});
  this.TDGRowSelectionType = {"0": "rsSingle", rsSingle: 0, "1": "rsMultiple", rsMultiple: 1};
  this.$rtti.$Enum("TDGRowSelectionType",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TDGRowSelectionType});
  this.TDGRowEditType = {"0": "retCell", retCell: 0, "1": "retFullRow", retFullRow: 1};
  this.$rtti.$Enum("TDGRowEditType",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TDGRowEditType});
  this.TDGLocale = {"0": "localeNone", localeNone: 0, "1": "localeBG", localeBG: 1, "2": "localeBR", localeBR: 2, "3": "localeCN", localeCN: 3, "4": "localeCZ", localeCZ: 4, "5": "localeDE", localeDE: 5, "6": "localeDK", localeDK: 6, "7": "localeEG", localeEG: 7, "8": "localeEN", localeEN: 8, "9": "localeES", localeES: 9, "10": "localeFI", localeFI: 10, "11": "localeFR", localeFR: 11, "12": "localeGR", localeGR: 12, "13": "localeHK", localeHK: 13, "14": "localeHR", localeHR: 14, "15": "localeHU", localeHU: 15, "16": "localeIL", localeIL: 16, "17": "localeIR", localeIR: 17, "18": "localeIT", localeIT: 18, "19": "localeJP", localeJP: 19, "20": "localeKR", localeKR: 20, "21": "localeNL", localeNL: 21, "22": "localeNO", localeNO: 22, "23": "localePK", localePK: 23, "24": "localePL", localePL: 24, "25": "localePT", localePT: 25, "26": "localeRO", localeRO: 26, "27": "localeSE", localeSE: 27, "28": "localeSK", localeSK: 28, "29": "localeTR", localeTR: 29, "30": "localeTW", localeTW: 30, "31": "localeUA", localeUA: 31, "32": "localeVN", localeVN: 32};
  this.$rtti.$Enum("TDGLocale",{minvalue: 0, maxvalue: 32, ordtype: 1, enumtype: this.TDGLocale});
  this.BCP47Tags = ["","bg-BG","pt-BR","zh-CN","cs-CZ","de-DE","da-DK","ar-EG","en","es-ES","fi-FI","fr-FR","el-GR","zh-HK","hr-HR","hu-HU","he-IL","fa-IR","it-IT","ja-JP","ko-KR","nl-NL","nb-NO","ur-PK","pl-PL","pt-PT","ro-RO","sv-SE","sk-SK","tr-TR","zh-TW","uk-UA","vi-VN"];
  rtl.createClass(this,"TDGDesignerGridBase",pas["WEBLib.Menus"].TWebCustomControl,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TDataGridBase",this.TDGDesignerGridBase,function () {
    this.$init = function () {
      $mod.TDGDesignerGridBase.$init.call(this);
      this.FIsLoaded = false;
      this.FIsSchemaAttempted = false;
      this.FMultilevelHeaders = null;
      this.FBanding = null;
      this.FTheming = null;
      this.FDefaultColDef = null;
      this.FLocalization = null;
      this.FPagination = false;
      this.FPaginationAutoPageSize = false;
      this.FPaginationPageSize = 0;
      this.FRowSelection = 0;
      this.FRowMultiSelectWithClick = false;
      this.FEditType = 0;
      this.FLocale = 0;
      this.FBCP47Tag = "";
      this.FServerDataAdapter = null;
      this.FOnRowSelected = null;
      this.FOnRowUnselected = null;
      this.FOnCellEditingStarted = null;
      this.FOnCellEditingEnded = null;
      this.FOnRowEditingStarted = null;
      this.FOnRowEditingEnded = null;
      this.FOnTabToNextCell = null;
      this.FOnSelectionChanged = null;
      this.FOnCellValueChanged = null;
      this.FOnPaginationChanged = null;
      this.FOnSortChanged = null;
      this.FOnFilterChanged = null;
      this.FOnCellMouseDown = null;
      this.FOnCellFocusedEvent = null;
      this.FOnCellMouseOverEvent = null;
      this.FOnCellClickedEvent = null;
      this.FOnCellDoubleClickedEvent = null;
      this.FOnGetLocaleText = null;
      this.FPaginationPageSizeSelector = "";
      this.FCacheBlockSize = 0;
      this.FMaxBlocksInCache = 0;
      this.FBidiMode$1 = 0;
      this.FOnGetRowStyle = null;
      this.FOnGetRowClass = null;
      this.FOnGetRowHeight = null;
      this.FEnableClickSelection = false;
      this.FSuppressMoveWhenColumnDragging = false;
      this.FRowHeight = 0;
      this.FPropertySerializer = null;
      this.FAGGrid = null;
      this.FAGGridLocale = null;
      this.FColumnDefs = null;
      this.FGridId = "";
      this.FInChangeTransaction = false;
      this.FCreateInitialized = false;
    };
    this.$final = function () {
      this.FMultilevelHeaders = undefined;
      this.FBanding = undefined;
      this.FTheming = undefined;
      this.FDefaultColDef = undefined;
      this.FLocalization = undefined;
      this.FServerDataAdapter = undefined;
      this.FOnRowSelected = undefined;
      this.FOnRowUnselected = undefined;
      this.FOnCellEditingStarted = undefined;
      this.FOnCellEditingEnded = undefined;
      this.FOnRowEditingStarted = undefined;
      this.FOnRowEditingEnded = undefined;
      this.FOnTabToNextCell = undefined;
      this.FOnSelectionChanged = undefined;
      this.FOnCellValueChanged = undefined;
      this.FOnPaginationChanged = undefined;
      this.FOnSortChanged = undefined;
      this.FOnFilterChanged = undefined;
      this.FOnCellMouseDown = undefined;
      this.FOnCellFocusedEvent = undefined;
      this.FOnCellMouseOverEvent = undefined;
      this.FOnCellClickedEvent = undefined;
      this.FOnCellDoubleClickedEvent = undefined;
      this.FOnGetLocaleText = undefined;
      this.FOnGetRowStyle = undefined;
      this.FOnGetRowClass = undefined;
      this.FOnGetRowHeight = undefined;
      this.FPropertySerializer = undefined;
      this.FAGGrid = undefined;
      this.FAGGridLocale = undefined;
      this.FColumnDefs = undefined;
      $mod.TDGDesignerGridBase.$final.call(this);
    };
    this.IsFontStored = function () {
      var Result = false;
      Result = false;
      if (this.FFont.FName !== "Segoe UI") Result = true;
      if (this.FFont.FColor !== 0) Result = true;
      if (rtl.neSet(this.FFont.FStyle,rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsBold))) Result = true;
      if (this.FFont.FHeight !== 18) Result = true;
      return Result;
    };
    this.InitFont = function (Value) {
      Value.SetName("Segoe UI");
      Value.SetColor(0);
      Value.SetStyle(rtl.createSet(pas["WEBLib.Graphics"].TFontStyle.fsBold));
      Value.SetHeight(18);
    };
    this.SetPaginationPageSizeSelector = function (Value) {
      var $Self = this;
      var NewValue = "";
      var PrevValue = "";
      var IntStr = "";
      var StrArr = [];
      var IntArr = null;
      var I = 0;
      var L = 0;
      var R = 0;
      var $ir = rtl.createIntfRefs();
      try {
        if (Value !== this.FPaginationPageSizeSelector) {
          NewValue = pas["WEBLib.RegularExpressions"].TRegEx.Replace$2(Value,"[^0-9,]","");
          StrArr = pas.SysUtils.TStringHelper.Split$1.call({get: function () {
              return NewValue;
            }, set: function (v) {
              NewValue = v;
            }},[","]);
          pas["Generics.Collections"].TArrayHelper$$$G$$generics$collections$$String.Sort({get: function () {
              return StrArr;
            }, set: function (v) {
              StrArr = v;
            }},$ir.ref(1,pas["Generics.Defaults"].TComparer$$$G$$generics$defaults$$String.Construct(function (Left, Right) {
            var Result = 0;
            Result = 0;
            if (pas.SysUtils.TryStrToInt(Left,{get: function () {
                return L;
              }, set: function (v) {
                L = v;
              }}) && pas.SysUtils.TryStrToInt(Right,{get: function () {
                return R;
              }, set: function (v) {
                R = v;
              }})) {
              if (L > R) {
                Result = 1}
               else if (L < R) Result = -1;
            };
            return Result;
          })));
          PrevValue = "";
          NewValue = "";
          for (var $l = 0, $end = rtl.length(StrArr) - 1; $l <= $end; $l++) {
            I = $l;
            if (pas.SysUtils.TryStrToInt(StrArr[I],{get: function () {
                return L;
              }, set: function (v) {
                L = v;
              }})) {
              IntStr = pas.SysUtils.IntToStr(L);
              if (PrevValue !== IntStr) {
                if (PrevValue === "0") NewValue = "";
                if (NewValue.length > 0) NewValue = NewValue + ",";
                NewValue = NewValue + IntStr;
              };
              PrevValue = IntStr;
            };
          };
          this.FPaginationPageSizeSelector = NewValue;
        };
        if (this.FPaginationPageSizeSelector === "0") {
          this.DoOptionsChange("paginationPageSizeSelector",false)}
         else {
          StrArr = pas.SysUtils.TStringHelper.Split$1.call({p: this, get: function () {
              return this.p.FPaginationPageSizeSelector;
            }, set: function (v) {
              this.p.FPaginationPageSizeSelector = v;
            }},[","]);
          IntArr = Array.of();
          for (var $l1 = 0, $end1 = rtl.length(StrArr) - 1; $l1 <= $end1; $l1++) {
            I = $l1;
            if (pas.SysUtils.TryStrToInt(StrArr[I],{get: function () {
                return L;
              }, set: function (v) {
                L = v;
              }})) {
              IntArr.push(L);
            };
          };
          this.DoOptionsChange("paginationPageSizeSelector",IntArr);
        };
      } finally {
        $ir.free();
      };
    };
    this.GetElementID = function () {
      var Result = "";
      Result = this.GetID();
      if (pas.SysUtils.Trim(Result) === "") {
        Result = this.FName;
        if (pas.SysUtils.Trim(Result) === "") {
          Result = "DataGridId-" + pas.SysUtils.IntToStr(pas.System.Random(10000));
        };
      };
      return Result;
    };
    this.SetCacheBlockSize = function (Value) {
      this.FCacheBlockSize = Value;
      this.DoOptionsChange("cacheBlockSize",this.FCacheBlockSize);
    };
    this.SetEditType = function (Value) {
      if (this.FEditType !== Value) {
        this.FEditType = Value;
        var $tmp = this.FEditType;
        if ($tmp === $mod.TDGRowEditType.retCell) {
          this.DoOptionsChange("editType",null)}
         else if ($tmp === $mod.TDGRowEditType.retFullRow) this.DoOptionsChange("editType","fullRow");
      };
    };
    this.SetBidiMode$1 = function (Value) {
      if (this.FBidiMode$1 !== Value) {
        var $tmp = Value;
        if ($tmp === pas["WEBLib.Controls"].TBiDiMode.bdLeftToRight) {
          this.FBidiMode$1 = Value;
          this.DoOptionsChange("enableRtl",false);
        } else if ($tmp === pas["WEBLib.Controls"].TBiDiMode.bdRightToLeft) {
          this.FBidiMode$1 = Value;
          this.DoOptionsChange("enableRtl",true);
        } else if (($tmp === pas["WEBLib.Controls"].TBiDiMode.bdRightToLeftNoAlign) || ($tmp === pas["WEBLib.Controls"].TBiDiMode.bdRightToLeftReadingOnly)) {
          this.FBidiMode$1 = pas["WEBLib.Controls"].TBiDiMode.bdRightToLeft;
          this.DoOptionsChange("enableRtl",true);
        };
      };
    };
    this.SetMaxBlocksInCache = function (Value) {
      this.FMaxBlocksInCache = Value;
      this.DoOptionsChange("maxBlocksInCache",this.FMaxBlocksInCache);
    };
    this.SetPagination = function (Value) {
      this.FPagination = Value;
      this.DoOptionsChange("pagination",this.FPagination);
    };
    this.SetPaginationAutoPageSize = function (Value) {
      this.FPaginationAutoPageSize = Value;
      this.DoOptionsChange("paginationAutoPageSize",this.FPaginationAutoPageSize);
    };
    this.SetPaginationPageSize = function (Value) {
      this.FPaginationPageSize = Value;
      this.DoOptionsChange("paginationPageSize",this.FPaginationPageSize);
    };
    this.SetRowMultiSelectWithClick = function (Value) {
      this.FRowMultiSelectWithClick = Value;
      this.DoOptionsChange("rowMultiSelectWithClick",this.FRowMultiSelectWithClick);
    };
    this.SetRowSelection = function (Value) {
      if (this.FRowSelection !== Value) {
        this.FRowSelection = Value;
        var $tmp = this.FRowSelection;
        if ($tmp === $mod.TDGRowSelectionType.rsSingle) {
          this.DoOptionsChange("rowSelection","single")}
         else if ($tmp === $mod.TDGRowSelectionType.rsMultiple) this.DoOptionsChange("rowSelection","multiple");
      };
    };
    this.GetRowDataByFieldName = function (RowID, FieldName) {
      var Result = undefined;
      var RowNode = null;
      Result = "";
      if (this.FAGGrid != null) {
        if (FieldName.length > 0) {
          RowNode = this.FAGGrid.getRowNode(RowID);
          if (pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(RowNode) && pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(RowNode.data)) {
            if (pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(RowNode.data[FieldName])) {
              Result = RowNode.data[FieldName]}
             else throw pas.SysUtils.Exception.$create("Create$1",["Error: Invalid FieldName provided."]);
          } else throw pas.SysUtils.Exception.$create("Create$1",["Error: Invalid RowID!"]);
        } else throw pas.SysUtils.Exception.$create("Create$1",["Error: Invalid FieldName provided."]);
      };
      return Result;
    };
    this.SetRowDataByFieldName = function (RowID, FieldName, Value) {
      var RowNode = null;
      if (this.FAGGrid != null) {
        if (FieldName.length > 0) {
          if (this.FColumnDefs.FindColumnIndex(FieldName) === -1) throw pas.SysUtils.Exception.$create("Create$1",["Error: Invalid FieldName!"]);
          RowNode = this.FAGGrid.getRowNode(RowID);
          if (pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(RowNode) && pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(RowNode.data)) {
            RowNode.setDataValue(FieldName,Value);
          } else throw pas.SysUtils.Exception.$create("Create$1",["Error: Invalid RowID!"]);
        } else throw pas.SysUtils.Exception.$create("Create$1",["Error: Invalid FieldName provided."]);
      };
    };
    this.GetRowDataById = function (RowID, ColumnIndex) {
      var Result = undefined;
      Result = "";
      if ((ColumnIndex >= 0) && (ColumnIndex < this.FColumnDefs.GetCount())) {
        Result = this.GetRowDataByFieldName(RowID,this.FColumnDefs.GetItem$1(ColumnIndex).FField);
      } else throw pas.SysUtils.Exception.$create("Create$1",["Error: Invalid ColumnIndex provided."]);
      return Result;
    };
    this.SetRowDataById = function (RowID, ColumnIndex, Value) {
      if ((ColumnIndex >= 0) && (ColumnIndex < this.FColumnDefs.GetCount())) {
        this.SetRowDataByFieldName(RowID,this.FColumnDefs.GetItem$1(ColumnIndex).FField,Value);
      } else throw pas.SysUtils.Exception.$create("Create$1",["Error: Invalid ColumnIndex provided."]);
    };
    this.GetCellByFieldName = function (DisplayedRowIndex, FieldName) {
      var Result = undefined;
      var RowNode = null;
      Result = "";
      if (this.FAGGrid != null) {
        if (FieldName.length > 0) {
          if (typeof(DisplayedRowIndex) !== "number") throw pas.SysUtils.Exception.$create("Create$1",["Error: DisplayedRowIndex must be numeric."]);
          RowNode = this.FAGGrid.getDisplayedRowAtIndex(rtl.trunc(DisplayedRowIndex));
          if (pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(RowNode) && pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(RowNode.data)) {
            if (pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(RowNode.data[FieldName])) {
              Result = RowNode.data[FieldName]}
             else throw pas.SysUtils.Exception.$create("Create$1",["Error: Invalid FieldName provided."]);
          } else throw pas.SysUtils.Exception.$create("Create$1",["Error: Invalid DisplayedRowIndex!"]);
        } else throw pas.SysUtils.Exception.$create("Create$1",["Error: Invalid FieldName provided."]);
      };
      return Result;
    };
    this.SetCellByFieldName = function (DisplayedRowIndex, FieldName, Value) {
      var RowNode = null;
      if (this.FAGGrid != null) {
        if (FieldName.length > 0) {
          if (this.FColumnDefs.FindColumnIndex(FieldName) === -1) throw pas.SysUtils.Exception.$create("Create$1",["Error: Invalid FieldName!"]);
          if (typeof(DisplayedRowIndex) !== "number") throw pas.SysUtils.Exception.$create("Create$1",["Error: DisplayedRowIndex must be numeric."]);
          RowNode = this.FAGGrid.getDisplayedRowAtIndex(rtl.trunc(DisplayedRowIndex));
          if (pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(RowNode) && pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(RowNode.data)) {
            RowNode.setDataValue(FieldName,Value);
          } else throw pas.SysUtils.Exception.$create("Create$1",["Error: Invalid DisplayedRowIndex!"]);
        } else throw pas.SysUtils.Exception.$create("Create$1",["Error: Invalid FieldName provided."]);
      };
    };
    this.GetCellById = function (RowID, ColumnIndex) {
      var Result = undefined;
      Result = "";
      if ((ColumnIndex >= 0) && (ColumnIndex < this.FColumnDefs.GetCount())) {
        Result = this.GetRowDataByFieldName(RowID,this.FColumnDefs.GetItem$1(ColumnIndex).FField);
      } else throw pas.SysUtils.Exception.$create("Create$1",["Error: Invalid ColumnIndex provided."]);
      return Result;
    };
    this.SetCellById = function (RowID, ColumnIndex, Value) {
      if ((ColumnIndex >= 0) && (ColumnIndex < this.FColumnDefs.GetCount())) {
        this.SetRowDataByFieldName(RowID,this.FColumnDefs.GetItem$1(ColumnIndex).FField,Value);
      } else throw pas.SysUtils.Exception.$create("Create$1",["Error: Invalid ColumnIndex provided."]);
    };
    this.GetCellByIndex = function (AbsoluteRowIndex, ColumnIndex) {
      var Result = undefined;
      if (this.FServerDataAdapter != null) {
        Result = this.GetCellById(pas.SysUtils.IntToStr(AbsoluteRowIndex),ColumnIndex)}
       else Result = this.GetCellById(AbsoluteRowIndex,ColumnIndex);
      return Result;
    };
    this.SetCellByIndex = function (AbsoluteRowIndex, ColumnIndex, Value) {
      if (this.FServerDataAdapter != null) {
        this.SetCellById(pas.SysUtils.IntToStr(AbsoluteRowIndex),ColumnIndex,Value)}
       else this.SetCellById(AbsoluteRowIndex,ColumnIndex,Value);
    };
    this.GetCellByDisplayedRowIndex = function (DisplayedRowIndex, ColumnIndex) {
      var Result = undefined;
      Result = "";
      if ((ColumnIndex >= 0) && (ColumnIndex < this.FColumnDefs.GetCount())) {
        Result = this.GetCellByFieldName(DisplayedRowIndex,this.FColumnDefs.GetItem$1(ColumnIndex).FField);
      } else throw pas.SysUtils.Exception.$create("Create$1",["Error: Invalid ColumnIndex provided."]);
      return Result;
    };
    this.SetCellByDisplayedRowIndex = function (DisplayedRowIndex, ColumnIndex, Value) {
      if ((ColumnIndex >= 0) && (ColumnIndex < this.FColumnDefs.GetCount())) {
        this.SetCellByFieldName(DisplayedRowIndex,this.FColumnDefs.GetItem$1(ColumnIndex).FField,Value);
      } else throw pas.SysUtils.Exception.$create("Create$1",["Error: Invalid ColumnIndex provided."]);
    };
    this.SetSuppressMoveWhenColumnDragging = function (Value) {
      this.FSuppressMoveWhenColumnDragging = Value;
      this.DoOptionsChange("suppressMoveWhenColumnDragging",this.FSuppressMoveWhenColumnDragging);
    };
    this.SetRowHeight = function (Value) {
      if (this.FAGGrid != null) {
        if (this.FRowHeight !== Value) {
          this.FRowHeight = Value;
          if (this.FRowHeight > 0) {
            this.DoOptionsChange("rowHeight",this.FRowHeight)}
           else this.DoOptionsChange("rowHeight",null);
        };
      };
    };
    this.SetEnableClickSelection = function (Value) {
      this.FEnableClickSelection = Value;
      this.DoOptionsChange("suppressRowClickSelection",!this.FEnableClickSelection);
      this.DoOptionsChange("suppressRowDeselection",!this.FEnableClickSelection);
      this.DoOptionsChange("enableClickSelection",this.FEnableClickSelection);
    };
    this.GetRowSelected = function (RowIndex) {
      var Result = false;
      var RowNode = null;
      Result = false;
      if (this.FAGGrid != null) {
        if (this.FServerDataAdapter != null) {
          RowNode = this.FAGGrid.getRowNode(pas.SysUtils.IntToStr(RowIndex))}
         else RowNode = this.FAGGrid.getRowNode(RowIndex);
        if (pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(RowNode)) {
          Result = RowNode.isSelected();
        };
      };
      return Result;
    };
    this.SetRowSelected = function (RowIndex, Value) {
      var RowNode = null;
      if (this.FAGGrid != null) {
        if (this.FServerDataAdapter != null) {
          RowNode = this.FAGGrid.getRowNode(pas.SysUtils.IntToStr(RowIndex))}
         else RowNode = this.FAGGrid.getRowNode(RowIndex);
        if (pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(RowNode)) {
          RowNode.setSelected(Value);
        };
      };
    };
    this.GetDisplayedRowSelected = function (DisplayedRowIndex) {
      var Result = false;
      var RowNode = null;
      Result = false;
      if (this.FAGGrid != null) {
        RowNode = this.FAGGrid.getDisplayedRowAtIndex(DisplayedRowIndex);
        if (pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(RowNode)) {
          Result = RowNode.isSelected();
        };
      };
      return Result;
    };
    this.SetDisplayedRowSelected = function (DisplayedRowIndex, Value) {
      var RowNode = null;
      if (this.FAGGrid != null) {
        RowNode = this.FAGGrid.getDisplayedRowAtIndex(DisplayedRowIndex);
        if (pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(RowNode)) {
          RowNode.setSelected(Value);
        };
      };
    };
    this.GetRowCount = function () {
      var Result = 0;
      Result = -1;
      if (this.FAGGrid != null) Result = this.FAGGrid.getDisplayedRowCount();
      return Result;
    };
    this.GetAllCells = function (RowIndex, ColumnIndex) {
      var Result = "";
      var CellValue = undefined;
      Result = "";
      CellValue = this.GetCellByIndex(RowIndex,ColumnIndex);
      if (pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(CellValue)) Result = "" + CellValue;
      return Result;
    };
    this.SetAllCells = function (RowIndex, ColumnIndex, Value) {
      this.SetCellByIndex(RowIndex,ColumnIndex,Value);
    };
    this.GetCells = function (DisplayedRowIndex, ColumnIndex) {
      var Result = "";
      var CellValue = undefined;
      Result = "";
      CellValue = this.GetCellByDisplayedRowIndex(DisplayedRowIndex,ColumnIndex);
      if (pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(CellValue)) Result = "" + CellValue;
      return Result;
    };
    this.SetCells = function (DisplayedRowIndex, ColumnIndex, Value) {
      this.SetCellByDisplayedRowIndex(DisplayedRowIndex,ColumnIndex,Value);
    };
    this.GetAllFloats = function (RowIndex, ColumnIndex) {
      var Result = 0.0;
      var CellValue = undefined;
      Result = 0;
      CellValue = this.GetCellByIndex(RowIndex,ColumnIndex);
      if (pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(CellValue)) Result = rtl.getNumber(CellValue);
      return Result;
    };
    this.GetFloats = function (DisplayedRowIndex, ColumnIndex) {
      var Result = 0.0;
      var CellValue = undefined;
      Result = 0;
      CellValue = this.GetCellByDisplayedRowIndex(DisplayedRowIndex,ColumnIndex);
      if (pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(CellValue)) Result = rtl.getNumber(CellValue);
      return Result;
    };
    this.SetAllFloats = function (RowIndex, ColumnIndex, Value) {
      this.SetCellByIndex(RowIndex,ColumnIndex,Value);
    };
    this.SetFloats = function (DisplayedRowIndex, ColumnIndex, Value) {
      this.SetCellByDisplayedRowIndex(DisplayedRowIndex,ColumnIndex,Value);
    };
    this.AddRootHeaderObject = function (ToArr, RootHeader) {
      var Result = false;
      var I = 0;
      var Found = false;
      Result = false;
      if (Array.isArray(ToArr) && pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(RootHeader)) {
        Found = false;
        for (var $l = 0, $end = ToArr.length - 1; $l <= $end; $l++) {
          I = $l;
          if (ToArr[I] == RootHeader) {
            Found = true;
          };
        };
        if (Found) {
          Result = true}
         else ToArr.push(RootHeader);
      };
      return Result;
    };
    this.SetLocale = function (Value) {
      if (Value !== this.FLocale) {
        this.FLocale = Value;
        this.FBCP47Tag = this.ConvertLocaleToBCP47Tag(this.FLocale);
        this.FLocalization.UpdateLocale(this.FBCP47Tag);
        if (!(pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) {
          this.RecreateGrid();
        };
      };
    };
    this.SetOnGetLocaleText = function (Value) {
      if (!rtl.eqCallback(Value,this.FOnGetLocaleText)) {
        this.FOnGetLocaleText = Value;
        if (!(pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) {
          this.RecreateGrid();
        };
      };
    };
    this.GetFilterModel = function () {
      var Result = undefined;
      Result = null;
      if (this.FAGGrid != null) Result = this.FAGGrid.getFilterModel();
      return Result;
    };
    this.SetFilterModel = function (Value) {
      if (this.FAGGrid != null) {
        this.FAGGrid.setFilterModel(Value);
      };
    };
    this.SetServerDataAdapter = function (Value) {
      if (Value !== this.FServerDataAdapter) {
        if (this.FServerDataAdapter !== null) {
          this.FServerDataAdapter.UnregisterPaginationChangeHandler(rtl.createCallback(this,"HandleDSPaginationChanged"));
          this.FServerDataAdapter.UnregisterDataChangeHandler(rtl.createCallback(this,"HandleDSDataChanged"));
          this.FServerDataAdapter.RemoveFreeNotification(this);
        };
        this.FServerDataAdapter = Value;
        if (Value !== null) {
          Value.FreeNotification(this);
          this.FServerDataAdapter.RegisterPaginationChangeHandler(rtl.createCallback(this,"HandleDSPaginationChanged"));
          this.FServerDataAdapter.RegisterDataChangeHandler(rtl.createCallback(this,"HandleDSDataChanged"));
        };
      };
    };
    this.OnCreateInitialize = function () {
      var __agGridLocale__ = null;
      typeof({get: function () {
          return __agGridLocale__;
        }, set: function (v) {
          __agGridLocale__ = v;
        }});
      if (!this.FCreateInitialized) {
        this.FCreateInitialized = true;
        this.FEventStopPropagation = rtl.diffSet(this.FEventStopPropagation,rtl.createSet(pas["WEBLib.Controls"].TElementEvent.eeMouseDown,pas["WEBLib.Controls"].TElementEvent.eeMouseUp,pas["WEBLib.Controls"].TElementEvent.eeMouseMove));
        pas["WEBLib.DataGrid.libjs"].TTMSModuleLoader.AddModule("TEmbeddedJSAgGrid","js/aggrid.js","",false);
        pas["WEBLib.DataGrid.libjs"].TTMSModuleLoader.AddModule("TDGCellComponents","js/tms-cell-components.js","",false);
        pas["WEBLib.DataGrid.libjs"].TTMSModuleLoader.AddModule("TEmbeddedJSAgGridLocale","js/locale.js","",false);
        pas["WEBLib.DataGrid.libjs"].TTMSModuleLoader.AddModule("TDGGridInjections","js/tms-grid-injections.js","",false);
        pas["WEBLib.DataGrid.libjs"].TTMSModuleLoader.LoadModules(pas.Classes.TComponentStateItem.csDesigning in this.FComponentState);
        __agGridLocale__ = pas.libdatagrid.getAgGridApi(pas.Classes.TComponentStateItem.csDesigning in this.FComponentState,"agGridLocale");
        if (typeof(__agGridLocale__) === "undefined") throw pas.SysUtils.Exception.$create("Create$1",["Error: Unable to get AG-Grid Locale API!"]);
        { this.FAGGridLocale = __agGridLocale__ };
        this.CreateColumnDefs();
        this.FMultilevelHeaders = pas["WEBLib.DataGrid.Options"].TDGMultilevelHeaderCollection.$create("Create$3",[this]);
        this.FInChangeTransaction = false;
        this.FBanding = pas["WEBLib.DataGrid.Options"].TDGBanding.$create("Create$1");
        this.FBanding.RegisterCallback(rtl.createCallback(this,"OnBandingChanged"));
        this.FTheming = pas["WEBLib.DataGrid.Options"].TDGTheming.$create("Create$1");
        this.FTheming.RegisterCallback(rtl.createCallback(this,"OnThemingChanged"));
        this.FDefaultColDef = pas["WEBLib.DataGrid.Options"].TDGDefaultColDef.$create("Create$1");
        this.FDefaultColDef.RegisterCallback(rtl.createCallback(this,"OnDefaultColDefChanged"));
        this.FLocalization = pas["WEBLib.DataGrid.Options"].TDGLocalization.$create("Create$1");
        this.FLocalization.RegisterCallback(rtl.createCallback(this,"OnLocalizatonChanged"));
        this.FPagination = false;
        this.FPaginationAutoPageSize = true;
        this.FPaginationPageSize = 20;
        this.FCacheBlockSize = 100;
        this.FMaxBlocksInCache = 0;
        this.FRowSelection = $mod.TDGRowSelectionType.rsSingle;
        this.FRowMultiSelectWithClick = false;
        this.FEnableClickSelection = true;
        this.FEditType = $mod.TDGRowEditType.retCell;
        this.InitFont(this.FFont);
        this.SetWidth(400);
        this.SetHeight(200);
        this.FLocale = $mod.TDGLocale.localeNone;
        this.FBCP47Tag = "";
        typeof({p: this, get: function () {
            return this.p.FBCP47Tag;
          }, set: function (v) {
            this.p.FBCP47Tag = v;
          }});
      };
    };
    this.CreateColumnDefs = function () {
      this.FColumnDefs = pas["WEBLib.DataGrid.Options"].TDGColumnDefsCollection.$create("Create$3",[this]);
      this.FColumnDefs.RegisterCallback(rtl.createCallback(this,"OnColumnDefsChanged"));
    };
    this.FreeColumnDefs = function () {
      if (this.FColumnDefs != null) pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FColumnDefs;
        }, set: function (v) {
          this.p.FColumnDefs = v;
        }});
    };
    this.GetJsonPropertiesString = function (IncludeUrl) {
      var Result = "";
      var Props = null;
      var Prefix = "";
      Result = "";
      try {
        Props = pas["lib.propertyserializer"].TJSPropertySerializer.$create("Create$1");
        this.FillProperties(Props,IncludeUrl);
        Prefix = this.GetFullName(this);
        Result = Props.AsJsonString(true,Prefix);
      } finally {
        pas.SysUtils.FreeAndNil({get: function () {
            return Props;
          }, set: function (v) {
            Props = v;
          }});
      };
      return Result;
    };
    this.GetGridOptions = function () {
      var Result = null;
      var PS = null;
      PS = pas["lib.propertyserializer"].TJSPropertySerializer.$create("Create$1");
      this.FillProperties(PS,true);
      Result = PS.AsJsObject(true);
      return Result;
    };
    this.FillProperties = function (Props, IncludeUrl) {
      var $Self = this;
      if (this.FServerDataAdapter != null) {
        this.FMaxBlocksInCache = 1;
        if (this.FPagination) {
          this.FCacheBlockSize = this.FPaginationPageSize;
        };
      };
      Props.Add$5("context",$Self,null);
      Props.AddCollectionAsArray$$$G$$lib$propertyserializer$$TDGCollectionItem("columnDefs",this.FColumnDefs,rtl.createCallback($Self,"AddColumn"));
      if (this.FDefaultColDef.FEnabled) Props.Add$5("defaultColDef",this.FDefaultColDef.GetAsJSObject(),null);
      Props.Add$1("pagination",this.FPagination,false);
      Props.Add$1("paginationAutoPageSize",this.FPaginationAutoPageSize,true);
      Props.Add$3("paginationPageSize",this.FPaginationPageSize,0);
      Props.Add$3("cacheBlockSize",this.FCacheBlockSize,100);
      Props.Add$3("maxBlocksInCache",this.FMaxBlocksInCache,0);
      Props.AddType$$$G$$lib$propertyserializer$$TBiDiMode("enableRtl",this.FBidiMode$1,function (Value) {
        var Result = undefined;
        Result = null;
        var $tmp = $Self.FBidiMode$1;
        if ($tmp === pas["WEBLib.Controls"].TBiDiMode.bdLeftToRight) {
          Result = false}
         else if ($tmp === pas["WEBLib.Controls"].TBiDiMode.bdRightToLeft) {
          Result = true}
         else if ($tmp === pas["WEBLib.Controls"].TBiDiMode.bdRightToLeftNoAlign) {
          Result = true}
         else if ($tmp === pas["WEBLib.Controls"].TBiDiMode.bdRightToLeftReadingOnly) Result = true;
        return Result;
      });
      Props.Add$1("suppressMoveWhenColumnDragging",this.FSuppressMoveWhenColumnDragging,false);
      if (this.FPaginationPageSizeSelector === "0") {
        Props.Add$1("paginationPageSizeSelector",false,true)}
       else {
        Props.AddType$$$G$$lib$propertyserializer$$String("paginationPageSizeSelector",this.FPaginationPageSizeSelector,function (Value) {
          var Result = undefined;
          var Arr = null;
          var StrArr = [];
          var I = 0;
          var PageSize = 0;
          Result = null;
          if (Value !== "") {
            StrArr = pas.SysUtils.TStringHelper.Split$1.call({get: function () {
                return Value;
              }, set: function (v) {
                Value = v;
              }},[","]);
            Arr = Array.of();
            for (var $l = 0, $end = rtl.length(StrArr) - 1; $l <= $end; $l++) {
              I = $l;
              if (pas.SysUtils.TryStrToInt(StrArr[I],{get: function () {
                  return PageSize;
                }, set: function (v) {
                  PageSize = v;
                }})) Arr.push(PageSize);
            };
            Result = Arr;
          };
          return Result;
        });
      };
      Props.AddType$$$G$$lib$propertyserializer$$TDGRowSelectionType("rowSelection",this.FRowSelection,function (Value) {
        var Result = undefined;
        Result = null;
        var $tmp = Value;
        if ($tmp === $mod.TDGRowSelectionType.rsSingle) {
          Result = "single"}
         else if ($tmp === $mod.TDGRowSelectionType.rsMultiple) Result = "multiple";
        return Result;
      });
      Props.Add$1("rowMultiSelectWithClick",this.FRowMultiSelectWithClick,false);
      Props.Add$1("suppressRowDeselection",!this.FEnableClickSelection,false);
      Props.Add$1("suppressRowClickSelection",!this.FEnableClickSelection,false);
      Props.Add$1("enableClickSelection",this.FEnableClickSelection,true);
      Props.AddType$$$G$$lib$propertyserializer$$TDGRowEditType("editType",this.FEditType,function (Value) {
        var Result = undefined;
        Result = null;
        var $tmp = Value;
        if ($tmp === $mod.TDGRowEditType.retCell) {
          Result = "single"}
         else if ($tmp === $mod.TDGRowEditType.retFullRow) Result = "fullRow";
        return Result;
      });
      Props.AddType$$$G$$lib$propertyserializer$$TDGServerDataAdapter("datasource",this.FServerDataAdapter,function (ServerDS) {
        var Result = undefined;
        var DataSource = null;
        Result = null;
        if (ServerDS != null) {
          DataSource = pas.libdatagrid.TJSDataSource.$create("Create");
          DataSource.getRows = rtl.createCallback(ServerDS,"HandleGetRows");
          Result = DataSource;
        };
        return Result;
      });
      Props.AddType$$$G$$lib$propertyserializer$$TDGServerDataAdapter("rowModelType",this.FServerDataAdapter,function (ServerDS) {
        var Result = undefined;
        Result = "clientSide";
        if (ServerDS != null) {
          Result = "infinite";
        };
        return Result;
      });
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) Props.Add$1("suppressNoRowsOverlay",true,false);
      Props.Add$3("rowHeight",this.FRowHeight,0);
      Props.Add$5("localeText",this.GetLocaleText(),null);
      this.FillEvents(Props,IncludeUrl);
    };
    this.FillEvents = function (Props, IncludeUrl) {
      var AOnRowSelected = null;
      var AOnCellValueChanged = null;
      var AOnCellEditingStarted = null;
      var AOnCellEditingStopped = null;
      var AOnRowEditingStarted = null;
      var AOnRowEditingStopped = null;
      var ATabToNextCell = null;
      var AOnPaginationChanged = null;
      var AOnSelectionChanged = null;
      var AOnSortChanged = null;
      var AOnFilterChanged = null;
      var AOnGetLocaleText = null;
      var AOnGetRowStyle = null;
      var AOnGetRowClass = null;
      var AOnGetRowHeight = null;
      var AOnCellMouseDown = null;
      var AOnCellFocusedEvent = null;
      var AOnCellMouseOverEvent = null;
      var AOnCellClickedEvent = null;
      var AOnCellDoubleClickedEvent = null;
      AOnRowSelected = rtl.createCallback(this,"HandleOnRowSelectedEvent");
      AOnCellValueChanged = rtl.createCallback(this,"HandleOnCellValueChanged");
      AOnCellEditingStarted = rtl.createCallback(this,"HandleOnCellEditingStarted");
      AOnCellEditingStopped = rtl.createCallback(this,"HandleOnCellEditingStopped");
      AOnRowEditingStarted = rtl.createCallback(this,"HandleOnRowEditingStarted");
      AOnRowEditingStopped = rtl.createCallback(this,"HandleOnRowEditingStopped");
      ATabToNextCell = rtl.createCallback(this,"HandleTabToNextCell");
      AOnPaginationChanged = rtl.createCallback(this,"HandleOnPaginationChanged");
      AOnSelectionChanged = rtl.createCallback(this,"HandleOnSelectionChanged");
      AOnSortChanged = rtl.createCallback(this,"HandleOnSortChanged");
      AOnFilterChanged = rtl.createCallback(this,"HandleOnFilterChanged");
      AOnGetLocaleText = rtl.createCallback(this,"HandleOnGetLocaleText");
      AOnGetRowStyle = rtl.createCallback(this,"HandleOnGetRowStyleCallback");
      AOnGetRowClass = rtl.createCallback(this,"HandleOnGetRowClassCallback");
      AOnGetRowHeight = rtl.createCallback(this,"HandleOnGetRowHeightCallback");
      AOnCellMouseDown = rtl.createCallback(this,"HandleOnCellMouseDown");
      AOnCellFocusedEvent = rtl.createCallback(this,"HandleOnCellFocusedEvent");
      AOnCellMouseOverEvent = rtl.createCallback(this,"HandleOnCellMouseOverEvent");
      AOnCellClickedEvent = rtl.createCallback(this,"HandleOnCellClickedEvent");
      AOnCellDoubleClickedEvent = rtl.createCallback(this,"HandleOnCellDoubleClickedEvent");
      Props.Add$5("onRowSelected",AOnRowSelected,"AOnRowSelected");
      Props.Add$5("onCellValueChanged",AOnCellValueChanged,"AOnCellValueChanged");
      Props.Add$5("onCellEditingStarted",AOnCellEditingStarted,"AOnCellEditingStarted");
      Props.Add$5("onCellEditingStopped",AOnCellEditingStopped,"AOnCellEditingStopped");
      Props.Add$5("onRowEditingStarted",AOnRowEditingStarted,"AOnRowEditingStarted");
      Props.Add$5("onRowEditingStopped",AOnRowEditingStopped,"AOnRowEditingStopped");
      Props.Add$5("tabToNextCell",ATabToNextCell,"ATabToNextCell");
      Props.Add$5("onPaginationChanged",AOnPaginationChanged,"AOnPaginationChanged");
      Props.Add$5("onSelectionChanged",AOnSelectionChanged,"AOnSelectionChanged");
      Props.Add$5("onSortChanged",AOnSortChanged,"AOnSortChanged");
      Props.Add$5("onFilterChanged",AOnFilterChanged,"AOnFilterChanged");
      Props.Add$5("getRowStyle",AOnGetRowStyle,"FOnGetRowStyle");
      Props.Add$5("getRowClass",AOnGetRowClass,"FOnGetRowClass");
      Props.Add$5("getRowHeight",AOnGetRowHeight,"FOnGetRowClass");
      if (this.FOnGetLocaleText != null) Props.Add$5("getLocaleText",AOnGetLocaleText,"AOnGetLocaleText");
      Props.Add$5("onCellMouseDown",AOnCellMouseDown,"FOnCellMouseDown");
      Props.Add$5("onCellFocused",AOnCellFocusedEvent,"FOnCellFocusedEvent");
      Props.Add$5("onCellMouseOver",AOnCellMouseOverEvent,"FOnCellMouseOverEvent");
      Props.Add$5("onCellClicked",AOnCellClickedEvent,"FOnCellClickedEvent");
      Props.Add$5("onCellDoubleClicked",AOnCellDoubleClickedEvent,"FOnCellDoubleClickedEvent");
    };
    this.GetJsonProperties = function (IncludeUrl) {
      var Result = null;
      var Props = null;
      try {
        Props = pas["lib.propertyserializer"].TJSPropertySerializer.$create("Create$1");
        this.FillProperties(Props,IncludeUrl);
        Result = Props.AsJsObject(false);
      } finally {
        pas.SysUtils.FreeAndNil({get: function () {
            return Props;
          }, set: function (v) {
            Props = v;
          }});
      };
      return Result;
    };
    this.GetFullName = function (Component) {
      var Result = "";
      var OwnerName = "";
      Result = "";
      if (Component !== null) {
        OwnerName = this.GetFullName(Component.FOwner);
        if (OwnerName !== "") {
          Result = Result + OwnerName + ".";
        } else {
          {
            if (typeof(Component.$module) != 'undefined' && typeof(Component.$module.$name) != 'undefined')
              Result = Result + 'pas.' + Component.$module.$name + '.';
          };
        };
        Result = Result + Component.FName;
      };
      return Result;
    };
    this.GetLocaleText = function () {
      var Result = null;
      Result = null;
      var $tmp = this.FLocale;
      if ($tmp === $mod.TDGLocale.localeNone) {
        Result = null}
       else if ($tmp === $mod.TDGLocale.localeBG) {
        Result = this.FAGGridLocale.AG_GRID_LOCALE_BG}
       else if ($tmp === $mod.TDGLocale.localeBR) {
        Result = this.FAGGridLocale.AG_GRID_LOCALE_BR}
       else if ($tmp === $mod.TDGLocale.localeCN) {
        Result = this.FAGGridLocale.AG_GRID_LOCALE_CN}
       else if ($tmp === $mod.TDGLocale.localeCZ) {
        Result = this.FAGGridLocale.AG_GRID_LOCALE_CZ}
       else if ($tmp === $mod.TDGLocale.localeDE) {
        Result = this.FAGGridLocale.AG_GRID_LOCALE_DE}
       else if ($tmp === $mod.TDGLocale.localeDK) {
        Result = this.FAGGridLocale.AG_GRID_LOCALE_DK}
       else if ($tmp === $mod.TDGLocale.localeEG) {
        Result = this.FAGGridLocale.AG_GRID_LOCALE_EG}
       else if ($tmp === $mod.TDGLocale.localeEN) {
        Result = this.FAGGridLocale.AG_GRID_LOCALE_EN}
       else if ($tmp === $mod.TDGLocale.localeES) {
        Result = this.FAGGridLocale.AG_GRID_LOCALE_ES}
       else if ($tmp === $mod.TDGLocale.localeFI) {
        Result = this.FAGGridLocale.AG_GRID_LOCALE_FI}
       else if ($tmp === $mod.TDGLocale.localeFR) {
        Result = this.FAGGridLocale.AG_GRID_LOCALE_FR}
       else if ($tmp === $mod.TDGLocale.localeGR) {
        Result = this.FAGGridLocale.AG_GRID_LOCALE_GR}
       else if ($tmp === $mod.TDGLocale.localeHK) {
        Result = this.FAGGridLocale.AG_GRID_LOCALE_HK}
       else if ($tmp === $mod.TDGLocale.localeHR) {
        Result = this.FAGGridLocale.AG_GRID_LOCALE_HR}
       else if ($tmp === $mod.TDGLocale.localeHU) {
        Result = this.FAGGridLocale.AG_GRID_LOCALE_HU}
       else if ($tmp === $mod.TDGLocale.localeIL) {
        Result = this.FAGGridLocale.AG_GRID_LOCALE_IL}
       else if ($tmp === $mod.TDGLocale.localeIR) {
        Result = this.FAGGridLocale.AG_GRID_LOCALE_IR}
       else if ($tmp === $mod.TDGLocale.localeIT) {
        Result = this.FAGGridLocale.AG_GRID_LOCALE_IT}
       else if ($tmp === $mod.TDGLocale.localeJP) {
        Result = this.FAGGridLocale.AG_GRID_LOCALE_JP}
       else if ($tmp === $mod.TDGLocale.localeKR) {
        Result = this.FAGGridLocale.AG_GRID_LOCALE_KR}
       else if ($tmp === $mod.TDGLocale.localeNL) {
        Result = this.FAGGridLocale.AG_GRID_LOCALE_NL}
       else if ($tmp === $mod.TDGLocale.localeNO) {
        Result = this.FAGGridLocale.AG_GRID_LOCALE_NO}
       else if ($tmp === $mod.TDGLocale.localePK) {
        Result = this.FAGGridLocale.AG_GRID_LOCALE_PK}
       else if ($tmp === $mod.TDGLocale.localePL) {
        Result = this.FAGGridLocale.AG_GRID_LOCALE_PL}
       else if ($tmp === $mod.TDGLocale.localePT) {
        Result = this.FAGGridLocale.AG_GRID_LOCALE_PT}
       else if ($tmp === $mod.TDGLocale.localeRO) {
        Result = this.FAGGridLocale.AG_GRID_LOCALE_RO}
       else if ($tmp === $mod.TDGLocale.localeSE) {
        Result = this.FAGGridLocale.AG_GRID_LOCALE_SE}
       else if ($tmp === $mod.TDGLocale.localeSK) {
        Result = this.FAGGridLocale.AG_GRID_LOCALE_SK}
       else if ($tmp === $mod.TDGLocale.localeTR) {
        Result = this.FAGGridLocale.AG_GRID_LOCALE_TR}
       else if ($tmp === $mod.TDGLocale.localeTW) {
        Result = this.FAGGridLocale.AG_GRID_LOCALE_TW}
       else if ($tmp === $mod.TDGLocale.localeUA) {
        Result = this.FAGGridLocale.AG_GRID_LOCALE_UA}
       else if ($tmp === $mod.TDGLocale.localeVN) Result = this.FAGGridLocale.AG_GRID_LOCALE_VN;
      return Result;
    };
    this.GetRowData = function () {
      var Result = null;
      Result = null;
      if (this.FAGGrid != null) {
        Result = this.FAGGrid.getGridOption("rowData");
      };
      return Result;
    };
    this.SetRowData = function (Value) {
      if ((this.FAGGrid != null) && (Value != null)) this.FAGGrid.setGridOption("rowData",Value);
    };
    this.OnPaginationChanged = function (Event) {
      var pageSize = 0;
      var currentPage = 0;
      if ((this.FAGGrid != null) && (this.FServerDataAdapter !== null)) {
        if ((Event.newPageSize == true) || Event.newPage) {
          pageSize = this.FAGGrid.paginationGetPageSize();
          currentPage = this.FAGGrid.paginationGetCurrentPage();
          this.FServerDataAdapter.UpdatePaginationParameters(this,currentPage,pageSize);
        };
      };
    };
    this.OnBandingChanged = function (Sender) {
      var Banding = null;
      if ((this.FAGGrid != null) && (Sender != null)) {
        Banding = pas["WEBLib.DataGrid.Options"].TDGUtils.AsType$$$G$$WEBLib$DataGrid$Options$$TDGBanding(Sender);
        if (Banding != null) {
          this.UpdateElement();
        };
      };
    };
    this.OnThemingChanged = function (Sender) {
      var DivElement = null;
      var SubDivElement = null;
      var StyleClass = "";
      var Theming = null;
      if ((this.FAGGrid != null) && (Sender != null) && (this.GetElementHandle() != null)) {
        Theming = pas["WEBLib.DataGrid.Options"].TDGUtils.AsType$$$G$$WEBLib$DataGrid$Options$$TDGTheming(Sender);
        if (Theming != null) {
          DivElement = this.GetElementHandle();
          if (DivElement != null) {
            SubDivElement = this.FindFirstChildElement("DIV",DivElement);
            if (SubDivElement != null) {
              StyleClass = "";
              if (this.FTheming.FEnabled) StyleClass = this.FTheming.GetThemeClass();
              if (StyleClass !== "") SubDivElement.setAttribute("class",StyleClass);
            };
          };
        };
      };
    };
    this.OnDefaultColDefChanged = function (Sender) {
      var DefaultColDef = null;
      if ((this.FAGGrid != null) && (Sender != null)) {
        DefaultColDef = pas["WEBLib.DataGrid.Options"].TDGUtils.AsType$$$G$$WEBLib$DataGrid$Options$$TDGDefaultColDef(Sender);
        if (DefaultColDef != null) ;
      };
    };
    this.OnLocalizatonChanged = function (Sender) {
      if ((this.FAGGrid != null) && (Sender != null)) {
        if (this.FServerDataAdapter != null) {
          this.RefreshGrid()}
         else this.RecreateGrid();
      };
    };
    this.HandleOnRowSelectedEvent = function (Event) {
      if ((typeof(Event) === "object") && (typeof(Event.node) === "object") && (typeof(Event.node["isSelected"]) === "function")) {
        if (Event.node.isSelected()) {
          if (this.FOnRowSelected != null) this.FOnRowSelected(Event);
        } else {
          if (this.FOnRowUnselected != null) this.FOnRowUnselected(Event);
        };
      } else {
        window.console.error("HandleOnRowSelectedEvent() event did not get called with a valid Event parameter!");
        window.console.log(Event);
      };
    };
    this.HandleOnCellValueChanged = function (Params) {
      if (this.FOnCellValueChanged != null) this.FOnCellValueChanged(Params);
    };
    this.HandleOnCellEditingStarted = function (Params) {
      if (this.FOnCellEditingStarted != null) this.FOnCellEditingStarted(Params);
    };
    this.HandleOnCellEditingStopped = function (Params) {
      var $Self = this;
      if (this.FOnCellEditingEnded != null) this.FOnCellEditingEnded(Params);
      if ((this.FEditType === $mod.TDGRowEditType.retCell) && (this.FServerDataAdapter != null) && (Params.data != null)) {
        if (typeof(Params.newValue) === "undefined") {}
        else if (Params.oldValue !== Params.newValue) {
          this.FServerDataAdapter.UpdateRow($Self,Params.data,function (RowData) {
            if ($Self.FAGGrid != null) $Self.FAGGrid.refreshInfiniteCache();
          },null);
        };
      };
    };
    this.HandleOnRowEditingStarted = function (Params) {
      if (this.FOnRowEditingStarted != null) this.FOnRowEditingStarted(Params);
    };
    this.HandleOnRowEditingStopped = function (Params) {
      var $Self = this;
      if (this.FOnRowEditingEnded != null) this.FOnRowEditingEnded(Params);
      if ((this.FEditType === $mod.TDGRowEditType.retCell) && (this.FServerDataAdapter != null) && (Params.data != null)) {
        this.FServerDataAdapter.UpdateRow($Self,Params.data,function (RowData) {
          if ($Self.FAGGrid != null) $Self.FAGGrid.refreshInfiniteCache();
        },null);
      };
    };
    this.HandleTabToNextCell = function (Params) {
      var Result = undefined;
      var NewCellPos = null;
      if (this.FOnTabToNextCell != null) {
        Result = this.FOnTabToNextCell(Params)}
       else {
        Result = false;
        if ((typeof(Params) !== "undefined") && (typeof(Params.nextCellPosition) !== "undefined") && (Params.nextCellPosition !== null)) {
          NewCellPos = pas.libdatagrid.TJSCellPosition.$create("Create");
          NewCellPos.column = Params.nextCellPosition.column;
          NewCellPos.rowIndex = Params.nextCellPosition.rowIndex;
          NewCellPos.rowPinned = Params.nextCellPosition.rowPinned;
          Result = NewCellPos;
        };
      };
      return Result;
    };
    this.HandleOnPaginationChanged = function (Event) {
      this.OnPaginationChanged(Event);
      if (this.FOnPaginationChanged != null) this.FOnPaginationChanged(Event);
    };
    this.HandleOnSelectionChanged = function (Event) {
      if (this.FOnSelectionChanged != null) this.FOnSelectionChanged(Event);
    };
    this.HandleOnSortChanged = function (Event) {
      if (this.FOnSortChanged != null) this.FOnSortChanged(Event);
    };
    this.HandleOnFilterChanged = function (Event) {
      if (this.FOnFilterChanged != null) this.FOnFilterChanged(Event);
    };
    this.HandleOnCellClickedEvent = function (Event) {
      if (this.FOnCellClickedEvent != null) this.FOnCellClickedEvent(Event);
    };
    this.HandleOnCellDoubleClickedEvent = function (Event) {
      if (this.FOnCellDoubleClickedEvent != null) this.FOnCellDoubleClickedEvent(Event);
    };
    this.HandleOnCellFocusedEvent = function (Event) {
      if (this.FOnCellFocusedEvent != null) this.FOnCellFocusedEvent(Event);
    };
    this.HandleOnCellMouseOverEvent = function (Event) {
      if (this.FOnCellMouseOverEvent != null) this.FOnCellMouseOverEvent(Event);
    };
    this.HandleOnCellMouseDown = function (Event) {
      if (this.FOnCellMouseDown != null) this.FOnCellMouseDown(Event);
    };
    this.HandleOnGetRowStyleCallback = function (Params) {
      var Result = null;
      Result = null;
      if (this.FOnGetRowStyle != null) Result = this.FOnGetRowStyle(Params);
      return Result;
    };
    this.HandleOnGetRowClassCallback = function (Params) {
      var Result = undefined;
      Result = null;
      if (this.FOnGetRowClass != null) Result = this.FOnGetRowClass(Params);
      return Result;
    };
    this.HandleOnGetRowHeightCallback = function (Params) {
      var Result = null;
      Result = null;
      if (this.FOnGetRowHeight != null) Result = this.FOnGetRowHeight(Params);
      return Result;
    };
    this.HandleOnGetLocaleText = function (Params) {
      var Result = "";
      if ((typeof(Params) === "object") && (typeof(Params.defaultValue) === "string")) Result = Params.defaultValue;
      if (this.FOnGetLocaleText != null) Result = this.FOnGetLocaleText(Params);
      return Result;
    };
    this.HandleDSPaginationChanged = function (Sender, CurrentPage, PaginationSize) {
      var pageSize = 0;
      var page = 0;
      var rowCount = 0;
      if (this.FAGGrid != null) {
        pageSize = this.FAGGrid.paginationGetPageSize();
        page = this.FAGGrid.paginationGetCurrentPage();
        rowCount = this.FAGGrid.paginationGetRowCount();
        if ((PaginationSize > 0) && (PaginationSize !== pageSize)) {
          this.SetCacheBlockSize(PaginationSize);
          this.FAGGrid.setGridOption("cacheBlockSize",PaginationSize);
          this.FAGGrid.setGridOption("paginationPageSize",PaginationSize);
        };
        if ((CurrentPage >= 0) && (CurrentPage !== page) && (rowCount > 0)) {
          this.FAGGrid.paginationGoToPage(CurrentPage);
        };
      };
    };
    this.HandleDSDataChanged = function (Sender) {
      if (this.FAGGrid != null) {
        this.FAGGrid.refreshInfiniteCache();
      };
    };
    this.Notification = function (AComponent, Operation) {
      pas["WEBLib.Menus"].TWebCustomControl.Notification.call(this,AComponent,Operation);
      if (Operation === pas.Classes.TOperation.opRemove) {
        if (AComponent === this.FServerDataAdapter) this.FServerDataAdapter = null;
      };
    };
    this.CreateElement = function () {
      var Result = null;
      var InnerElement = null;
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        Result = document.createElement("DIV");
        InnerElement = document.createElement("DIV");
        InnerElement.innerHTML = this.FName;
        InnerElement.setAttribute("align","center");
        InnerElement.style.setProperty("border","1px solid gray");
        InnerElement.style.setProperty("vertical-align","middle");
        InnerElement.style.setProperty("height","100%");
        InnerElement.style.setProperty("width","100%");
        Result.style.setProperty("background-color","red");
        Result.appendChild(InnerElement);
      } else {
        Result = document.createElement("DIV");
        Result.style.setProperty("width",pas.SysUtils.IntToStr(this.GetWidth()) + "px");
        Result.style.setProperty("height",pas.SysUtils.IntToStr(this.GetHeight()) + "px");
      };
      return Result;
    };
    this.Loaded = function () {
      pas["WEBLib.Controls"].TCustomControl.Loaded.call(this);
      if (!(pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) {
        if (!(this.GetElementHandle() != null)) return;
        this.LoadGrid();
      };
    };
    this.UpdateElement = function () {
      var DivElement = null;
      var StyleElement = null;
      var Style = "";
      pas["WEBLib.Controls"].TControl.UpdateElement.call(this);
      if (this.IsUpdating()) return;
      if (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState) return;
      if (!(this.GetElementHandle() != null)) return;
      if (this.GetElementHandle() != null) {
        this.GetElementHandle().style.setProperty("overflow","");
        DivElement = this.GetElementHandle();
        if (DivElement != null) {
          StyleElement = this.FindFirstChildElement("STYLE",DivElement);
          if (StyleElement === null) {
            StyleElement = document.createElement("STYLE");
            DivElement.appendChild(StyleElement);
          };
          Style = "";
          if ((this.FBanding != null) && this.FBanding.FEnabled) {
            Style = Style + ".ag-row-odd { background-color: #" + pas["WEBLib.DataGrid.Options"].TDGUtils.TColorToHex(this.FBanding.FOddRowsColor) + "; }" + "\r\n" + ".ag-row-even { background-color: #" + pas["WEBLib.DataGrid.Options"].TDGUtils.TColorToHex(this.FBanding.FEvenRowsColor) + "; } " + "\r\n";
          };
          if ((this.FTheming != null) && this.FTheming.FEnabled) {
            Style = Style + "." + this.FTheming.GetThemeClass() + " {" + "\r\n" + "  --ag-font-family: " + this.FFont.FName + "\r\n" + "}" + "\r\n";
          };
          StyleElement.innerHTML = Style;
        };
      };
    };
    this.FindFirstChildElement = function (TagName, CurrentElement) {
      var Result = null;
      var Count = 0;
      var I = 0;
      var ChildElement = null;
      var UTagName = "";
      Result = null;
      UTagName = pas.SysUtils.UpperCase(TagName);
      Count = CurrentElement.childElementCount;
      for (var $l = 0, $end = Count - 1; $l <= $end; $l++) {
        I = $l;
        ChildElement = CurrentElement.children.item(I);
        if (pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(ChildElement.tagName) && (pas.SysUtils.UpperCase(ChildElement.tagName) === UTagName)) {
          Result = ChildElement;
          break;
        };
      };
      return Result;
    };
    this.OnColumnDefsChanged = function (Sender) {
      var $Self = this;
      var Arr = null;
      var I = 0;
      var Collection = null;
      var Handled = false;
      var Children = null;
      var Columns = null;
      var Found = false;
      var ReorderNeeded = false;
      var PathName = "";
      var HeaderItem = null;
      var CurrentHeaderItem = null;
      var PrevHeaderItem = null;
      var LastRootHeader = null;
      var NewTemp = null;
      var J = 0;
      if (pas.Classes.TComponentStateItem.csLoading in this.FComponentState) return;
      Collection = pas["WEBLib.DataGrid.Options"].TDGUtils.AsType$$$G$$WEBLib$DataGrid$Options$$TDGColumnDefsCollection(Sender);
      if (Collection != null) {
        ReorderNeeded = false;
        this.FMultilevelHeaders.Traverse$1(function (Param) {
          var Result = false;
          Result = false;
          if ((Param.Item != null) && (Param.Item.FInternalParentObject != null)) {
            Param.Item.FInternalParentObject = null;
          };
          return Result;
        });
        LastRootHeader = null;
        Arr = Array.of();
        for (var $l = 0, $end = Collection.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          PathName = Collection.GetItem$1(I).GetParentHeader();
          if (PathName !== "") {
            HeaderItem = this.FMultilevelHeaders.GetPathItem(PathName);
            if (HeaderItem != null) {
              CurrentHeaderItem = HeaderItem;
              PrevHeaderItem = null;
              while (true) {
                if (!pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(CurrentHeaderItem.FInternalParentObject)) {
                  CurrentHeaderItem.FInternalParentObject = pas.JS.New(["headerName",CurrentHeaderItem.FName,"children",Array.of()]);
                };
                if (pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(CurrentHeaderItem.FInternalParentObject) && Array.isArray(CurrentHeaderItem.FInternalParentObject["children"])) {
                  Children = CurrentHeaderItem.FInternalParentObject["children"];
                  if (CurrentHeaderItem === HeaderItem) {
                    Children.push(Collection.GetItem$1(I).GetAsJSObject());
                  } else {
                    if (pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(PrevHeaderItem) && pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(PrevHeaderItem.FInternalParentObject)) {
                      Found = false;
                      for (var $l1 = 0, $end1 = Children.length - 1; $l1 <= $end1; $l1++) {
                        J = $l1;
                        if (Children[J] == PrevHeaderItem.FInternalParentObject) {
                          Found = true;
                          break;
                        };
                      };
                      if (!Found) Children.push(PrevHeaderItem.FInternalParentObject);
                    };
                  };
                };
                if (CurrentHeaderItem.FParent === null) throw pas.SysUtils.Exception.$create("Create$1",["Error: CurrentHeaderItem does not have a Parent!"]);
                if (CurrentHeaderItem.FParent.FParentItem === null) break;
                PrevHeaderItem = CurrentHeaderItem;
                CurrentHeaderItem = CurrentHeaderItem.FParent.FParentItem;
              };
              if ((LastRootHeader !== null) && (LastRootHeader !== CurrentHeaderItem)) {
                if (this.AddRootHeaderObject(Arr,LastRootHeader.FInternalParentObject)) ReorderNeeded = true;
              };
              LastRootHeader = CurrentHeaderItem;
            };
          } else {
            if (LastRootHeader !== null) {
              if (this.AddRootHeaderObject(Arr,LastRootHeader.FInternalParentObject)) ReorderNeeded = true;
              LastRootHeader = null;
            };
            Arr.push(Collection.GetItem$1(I).GetAsJSObject());
          };
        };
        if (LastRootHeader !== null) {
          if (this.AddRootHeaderObject(Arr,LastRootHeader.FInternalParentObject)) ReorderNeeded = true;
          LastRootHeader = null;
        };
        Handled = false;
        this.OnBeforeColumnDefsUpdate(Arr,{get: function () {
            return Handled;
          }, set: function (v) {
            Handled = v;
          }});
        if (!Handled) {
          if (this.FAGGrid != null) {
            if (ReorderNeeded) this.FAGGrid.setGridOption("suppressColumnMoveAnimation",true);
            this.FAGGrid.setGridOption("columnDefs",Arr);
            if (ReorderNeeded) {
              Columns = Array.of();
              for (var $l2 = 0, $end2 = this.FColumnDefs.GetCount() - 1; $l2 <= $end2; $l2++) {
                I = $l2;
                NewTemp = pas.JS.New(["colId",this.FColumnDefs.GetItem$1(I).FField]);
                Columns.push(NewTemp);
              };
              this.FAGGrid.applyColumnState(pas.JS.New(["state",Columns,"applyOrder",true]));
              this.FAGGrid.setGridOption("suppressColumnMoveAnimation",false);
            };
          };
        };
      };
    };
    this.OnBeforeColumnDefsUpdate = function (ColumnDefs, Handled) {
    };
    this.EnsureLastRowVisible = function () {
      var PageSize = 0;
      var CurrentPage = 0;
      var SelectPage = 0;
      var RowCount = 0;
      if (this.FAGGrid != null) {
        PageSize = this.FAGGrid.paginationGetPageSize();
        CurrentPage = this.FAGGrid.paginationGetCurrentPage();
        RowCount = this.FAGGrid.getInfiniteRowCount();
        SelectPage = pas.Math.Floor(RowCount / PageSize);
        if (SelectPage !== CurrentPage) this.FAGGrid.paginationGoToPage(SelectPage);
        this.FAGGrid.ensureIndexVisible(RowCount - 1);
      };
    };
    this.DeleteSelectedRows = function () {
      var $Self = this;
      var Result = false;
      var SelectedNodes = [];
      var SelectedLen = 0;
      var DeleteIndex = 0;
      var CurrentNode = null;
      var NewRowData = null;
      var I = 0;
      Result = false;
      if (this.FAGGrid != null) {
        if (this.FServerDataAdapter != null) {
          SelectedNodes = this.FAGGrid.getSelectedNodes();
          SelectedLen = rtl.length(SelectedNodes);
          this.FAGGrid.deselectAll();
          if (SelectedLen > 0) {
            for (var $l = 0, $end = SelectedLen - 1; $l <= $end; $l++) {
              I = $l;
              CurrentNode = SelectedNodes[I];
              this.FServerDataAdapter.DeleteRow(CurrentNode.data,function (Response) {
                if (I === (SelectedLen - 1)) {
                  $Self.FAGGrid.refreshInfiniteCache();
                };
              },null);
              Result = true;
            };
          };
        } else {
          SelectedNodes = this.FAGGrid.getSelectedNodes();
          SelectedLen = rtl.length(SelectedNodes);
          this.FAGGrid.deselectAll();
          if (SelectedLen > 0) {
            NewRowData = this.GetRowData();
            for (var $l1 = 0, $end1 = SelectedLen - 1; $l1 <= $end1; $l1++) {
              I = $l1;
              CurrentNode = SelectedNodes[I];
              if (typeof(CurrentNode.data) !== "undefined") {
                DeleteIndex = NewRowData.indexOf(CurrentNode.data);
                if (DeleteIndex > -1) {
                  NewRowData.splice(DeleteIndex,1);
                };
                Result = true;
              };
            };
            if (Result) this.SetRowData(NewRowData);
          };
        };
      };
      return Result;
    };
    this.InsertNewRow = function () {
      var $Self = this;
      var Result = false;
      var LastIndex = 0;
      var TimerId = 0;
      var Row = null;
      var NewRowData = null;
      Result = false;
      if (this.FAGGrid != null) {
        if (this.FServerDataAdapter != null) {
          this.FServerDataAdapter.InsertRow(pas.JS.New([]),function (RowData) {
            $Self.FServerDataAdapter.WhenGridRefreshed(function () {
              $Self.EnsureLastRowVisible();
              TimerId = setTimeout(function () {
                clearTimeout(TimerId);
                LastIndex = $Self.FAGGrid.getLastDisplayedRowIndex();
                Row = $Self.FAGGrid.getDisplayedRowAtIndex(LastIndex);
                if (typeof(Row) !== "undefined") {
                  Row.setSelected(true);
                  $Self.FAGGrid.startEditingCell(pas.JS.New(["rowIndex",LastIndex,"colKey",$Self.FColumnDefs.GetItem$1(1).FField]));
                };
              },500);
            });
            if ($Self.FAGGrid != null) $Self.FAGGrid.refreshInfiniteCache();
          },null);
        } else {
          if (Array.isArray(this.GetRowData())) {
            NewRowData = this.GetRowData();
            NewRowData.push(pas.JS.New([]));
            this.SetRowData(NewRowData);
          } else {
            this.SetRowData(new Array(pas.JS.New([])));
          };
        };
      };
      return Result;
    };
    this.DoOptionsChange = function (OptionName, OptionValue) {
      if (!this.FInChangeTransaction && (this.FAGGrid != null)) this.FAGGrid.setGridOption(OptionName,OptionValue);
    };
    this.AddColumn = function (Item, Arr) {
      var ColumnDef = null;
      ColumnDef = rtl.as(Item,pas["WEBLib.DataGrid.Options"].TDGColumnDefsCollectionItem);
      if (ColumnDef != null) {
        Arr.push(ColumnDef.GetAsJSObject());
      };
    };
    this.ConvertLocaleToBCP47Tag = function (Locale) {
      var Result = "";
      Result = "";
      if ((Locale >= 0) && (Locale <= (rtl.length($mod.BCP47Tags) - 1))) Result = $mod.BCP47Tags[Locale];
      return Result;
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.OnCreateInitialize();
    };
    this.Create$1 = function (AOwner) {
      var I = 0;
      pas["WEBLib.Controls"].TControl.Create$1.call(this,AOwner);
      this.OnCreateInitialize();
      if ((pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) && !((pas.Classes.TComponentStateItem.csReading in AOwner.FComponentState) || (pas.Classes.TComponentStateItem.csLoading in AOwner.FComponentState))) {
        for (I = 0; I <= 1; I++) {
          var $with = this.FColumnDefs.Add$1();
          $with.SetField("column" + pas.SysUtils.IntToStr(I + 1));
        };
      };
      return this;
    };
    this.Destroy = function () {
      if (this.FBanding != null) pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FBanding;
        }, set: function (v) {
          this.p.FBanding = v;
        }});
      if (this.FTheming != null) pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FTheming;
        }, set: function (v) {
          this.p.FTheming = v;
        }});
      if (this.FDefaultColDef != null) pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FDefaultColDef;
        }, set: function (v) {
          this.p.FDefaultColDef = v;
        }});
      if (this.FLocalization != null) pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FLocalization;
        }, set: function (v) {
          this.p.FLocalization = v;
        }});
      this.FreeColumnDefs();
      if (this.FServerDataAdapter != null) {
        this.FServerDataAdapter.UnregisterPaginationChangeHandler(rtl.createCallback(this,"HandleDSPaginationChanged"));
        this.FServerDataAdapter.UnregisterDataChangeHandler(rtl.createCallback(this,"HandleDSDataChanged"));
        this.FServerDataAdapter = null;
      };
      if (this.FAGGrid != null) {
        this.FAGGrid.destroy();
        this.FAGGrid = null;
      };
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.LoadGrid = function () {
      var $Self = this;
      var DivElement = null;
      var NewElement = null;
      var FirstChildElement = null;
      var GridElement = null;
      var GridSelector = "";
      var WrapperId = "";
      var GridClass = "";
      var GridOptions = null;
      var PS = null;
      var __agGrid__ = null;
      if (this.FIsLoaded) {
        return}
       else {
        if ((this.FServerDataAdapter != null) && (this.FColumnDefs.GetCount() === 0) && !this.FIsSchemaAttempted) {
          this.FIsSchemaAttempted = true;
          this.FServerDataAdapter.LoadSchema(this.FColumnDefs,function () {
            $Self.LoadGrid();
          },function () {
            $Self.LoadGrid();
          });
          return;
        };
        this.FIsLoaded = true;
      };
      this.FGridId = "myGrid";
      GridClass = "";
      if (this.FTheming.FEnabled) {
        GridClass = this.FTheming.GetThemeClass();
      };
      DivElement = this.GetElementHandle();
      if (DivElement != null) {
        try {
          WrapperId = this.GetElementID();
          if (pas.SysUtils.Trim(DivElement.id) === "") DivElement.id = WrapperId;
          FirstChildElement = this.FindFirstChildElement("DIV",DivElement);
          if (pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(FirstChildElement)) DivElement = DivElement.firstElementChild;
          NewElement = document.createElement("DIV");
          DivElement.appendChild(NewElement);
          PS = pas["lib.propertyserializer"].TJSPropertySerializer.$create("Create$1");
          this.FillProperties(PS,true);
          this.FGridId = WrapperId + "-grid";
          GridSelector = "#" + this.FGridId;
          NewElement.setAttribute("id",this.FGridId);
          if (GridClass !== "") NewElement.setAttribute("class",GridClass);
          NewElement.style.setProperty("height","100%");
          GridElement = document.querySelector(GridSelector);
          GridOptions = PS.AsJsObject(true);
          __agGrid__ = pas.libdatagrid.getAgGridApi(pas.Classes.TComponentStateItem.csDesigning in this.FComponentState,"agGrid");
          if (typeof(__agGrid__) === "undefined") throw pas.SysUtils.Exception.$create("Create$1",["Error: Unable to get AG-Grid API!"]);
          document.agGridInjections.LoadInjectionModule(__agGrid__);
          this.FAGGrid = __agGrid__.createGrid(GridElement,GridOptions);
          document.agGridInjections.InitInjectionModule($Self,this.FAGGrid);
          this.FColumnDefs.ApplyChanges();
          this.FTheming.ApplyChanges();
          if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) this.FAGGrid.hideOverlay();
        } finally {
          pas.SysUtils.FreeAndNil({get: function () {
              return PS;
            }, set: function (v) {
              PS = v;
            }});
        };
      };
    };
    this.RecreateGrid = function () {
      var GridElement = null;
      var GridOptions = null;
      var __agGrid__ = null;
      var ReloadData = null;
      var CurrentPageSize = 0;
      var CurrentPage = 0;
      if (this.FAGGrid != null) {
        ReloadData = Array.of();
        if (!(this.FServerDataAdapter != null)) ReloadData = this.GetRowData();
        CurrentPageSize = this.FAGGrid.paginationGetPageSize();
        CurrentPage = this.FAGGrid.paginationGetCurrentPage();
        this.FAGGrid.destroy();
        { delete this.FAGGrid; this.FAGGrid = undefined; };
        GridElement = document.querySelector("#" + this.FGridId);
        GridOptions = this.GetGridOptions();
        __agGrid__ = pas.libdatagrid.getAgGridApi(pas.Classes.TComponentStateItem.csDesigning in this.FComponentState,"agGrid");
        if (typeof(__agGrid__) === "undefined") throw pas.SysUtils.Exception.$create("Create$1",["Error: Unable to get AG-Grid API!"]);
        this.FAGGrid = __agGrid__.createGrid(GridElement,GridOptions);
        if (this.FServerDataAdapter != null) {
          this.RefreshGrid();
          this.FServerDataAdapter.UpdatePaginationParameters(this,CurrentPage,CurrentPageSize);
        } else {
          this.SetRowData(ReloadData);
          this.FAGGrid.setGridOption("paginationPageSize",CurrentPageSize);
          this.FAGGrid.paginationGoToPage(CurrentPage);
        };
      };
    };
    this.IsLoading = function () {
      var Result = false;
      Result = pas.Classes.TComponentStateItem.csLoading in this.FComponentState;
      return Result;
    };
    this.Clear = function () {
      if (this.FAGGrid != null) {
        if (this.FServerDataAdapter != null) throw pas.SysUtils.Exception.$create("Create$1",["Error: The Clear method can not be called when the ServerDataAdapter has been assigned!"]);
        this.SetRowData(Array.of());
      };
    };
    this.RefreshGrid = function () {
      var $Self = this;
      if (this.FAGGrid != null) {
        if (this.FServerDataAdapter != null) {
          if (this.FColumnDefs.GetCount() === 0) {
            this.FServerDataAdapter.LoadSchema(this.FColumnDefs,function () {
              $Self.FAGGrid.refreshInfiniteCache();
            },null);
            return;
          };
          this.FAGGrid.refreshInfiniteCache();
        } else throw pas.SysUtils.Exception.$create("Create$1",["Error: RefreshGrid can only be called when the ServerDataAdapter has been assigned!"]);
      };
    };
    this.SetSelectedRow = function (RowIndex, Selected) {
      var Result = false;
      var RowNode = null;
      Result = false;
      if (this.FAGGrid != null) {
        if (this.FServerDataAdapter != null) {
          RowNode = this.FAGGrid.getRowNode(pas.SysUtils.IntToStr(RowIndex))}
         else RowNode = this.FAGGrid.getRowNode(RowIndex);
        if (pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(RowNode)) {
          RowNode.setSelected(Selected);
          Result = true;
        };
      };
      return Result;
    };
    this.FindFirstSelectedRowNode = function () {
      var Result = null;
      var SelectedNodes = [];
      var RowNode = null;
      Result = null;
      if (this.FAGGrid != null) {
        SelectedNodes = this.FAGGrid.getSelectedNodes();
        if (rtl.length(SelectedNodes) > 0) {
          RowNode = SelectedNodes[0];
          if (pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(RowNode)) Result = RowNode;
        };
      };
      return Result;
    };
    this.FindFirstSelectedRowIndex = function () {
      var Result = 0;
      var RowNode = null;
      Result = -1;
      RowNode = this.FindFirstSelectedRowNode();
      if (RowNode !== null) {
        Result = parseInt(RowNode.id);
        if (Number.isNaN(Result)) Result = -1;
      };
      return Result;
    };
    this.FindFirstSelectedDisplayedRowIndex = function () {
      var Result = 0;
      var RowNode = null;
      Result = -1;
      RowNode = this.FindFirstSelectedRowNode();
      if (RowNode !== null) Result = RowNode.rowIndex;
      return Result;
    };
    this.FindFirstSelectedRowId = function () {
      var Result = "";
      var RowNode = null;
      Result = "";
      RowNode = this.FindFirstSelectedRowNode();
      if (RowNode !== null) Result = RowNode.id;
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Banding",0,pas["WEBLib.DataGrid.Options"].$rtti["TDGBanding"],"FBanding","FBanding");
    $r.addProperty("Theming",0,pas["WEBLib.DataGrid.Options"].$rtti["TDGTheming"],"FTheming","FTheming");
    $r.addProperty("DefaultColDef",0,pas["WEBLib.DataGrid.Options"].$rtti["TDGDefaultColDef"],"FDefaultColDef","FDefaultColDef");
    $r.addProperty("Localization",0,pas["WEBLib.DataGrid.Options"].$rtti["TDGLocalization"],"FLocalization","FLocalization");
    $r.addProperty("Pagination",2,rtl.boolean,"FPagination","SetPagination",4,{Default: false});
    $r.addProperty("PaginationAutoPageSize",2,rtl.boolean,"FPaginationAutoPageSize","SetPaginationAutoPageSize",4,{Default: true});
    $r.addProperty("PaginationPageSize",2,rtl.longint,"FPaginationPageSize","SetPaginationPageSize",4,{Default: 20});
    $r.addProperty("PaginationPageSizeSelector",2,rtl.string,"FPaginationPageSizeSelector","SetPaginationPageSizeSelector");
    $r.addProperty("CacheBlockSize",2,rtl.longint,"FCacheBlockSize","SetCacheBlockSize",4,{Default: 100});
    $r.addProperty("MaxBlocksInCache",2,rtl.longint,"FMaxBlocksInCache","SetMaxBlocksInCache");
    $r.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder");
    $r.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",4,{Default: true});
    $r.addProperty("RowSelection",2,$mod.$rtti["TDGRowSelectionType"],"FRowSelection","SetRowSelection",4,{Default: $mod.TDGRowSelectionType.rsSingle});
    $r.addProperty("RowMultiSelectWithClick",2,rtl.boolean,"FRowMultiSelectWithClick","SetRowMultiSelectWithClick");
    $r.addProperty("EnableClickSelection",2,rtl.boolean,"FEnableClickSelection","SetEnableClickSelection");
    $r.addProperty("EditType",2,$mod.$rtti["TDGRowEditType"],"FEditType","SetEditType",4,{Default: $mod.TDGRowEditType.retCell});
    $r.addProperty("BiDiMode",2,pas["WEBLib.Controls"].$rtti["TBiDiMode"],"FBidiMode$1","SetBidiMode$1");
    $r.addProperty("SuppressMoveWhenColumnDragging",2,rtl.boolean,"FSuppressMoveWhenColumnDragging","SetSuppressMoveWhenColumnDragging");
    $r.addProperty("RowHeight",2,rtl.longint,"FRowHeight","SetRowHeight",4,{Default: 0});
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("Font",14,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont",4,{stored: "IsFontStored"});
    $r.addProperty("OnSelectionChanged",0,$mod.$rtti["TDGSelectionChangedEvent"],"FOnSelectionChanged","FOnSelectionChanged");
    $r.addProperty("OnGetRowStyle",0,$mod.$rtti["TDGGetRowStyleCallback"],"FOnGetRowStyle","FOnGetRowStyle");
    $r.addProperty("OnGetRowClass",0,$mod.$rtti["TDGGetRowClassCallback"],"FOnGetRowClass","FOnGetRowClass");
    $r.addProperty("OnGetRowHeight",0,$mod.$rtti["TDGGetRowHeightCallback"],"FOnGetRowHeight","FOnGetRowHeight");
    $r.addProperty("Center",0,pas["WEBLib.Controls"].$rtti["TCenter"],"FCenter","");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
  });
  rtl.createClass(this,"TDataGridCustom",this.TDataGridBase,function () {
    this.$init = function () {
      $mod.TDataGridBase.$init.call(this);
      this.FReq = null;
      this.FDataNode = "";
      this.FOnHttpRequestError = null;
      this.FOnHttpRequest = null;
      this.FOnHttpRequestSuccess = null;
      this.FDelimiter = "\x00";
      this.FQuoteChar = "\x00";
      this.FFirstRowColumnLabels = false;
    };
    this.$final = function () {
      this.FReq = undefined;
      this.FOnHttpRequestError = undefined;
      this.FOnHttpRequest = undefined;
      this.FOnHttpRequestSuccess = undefined;
      $mod.TDataGridBase.$final.call(this);
    };
    this.DoHttpLoadJson = function (Event) {
      var Result = false;
      var J = null;
      var req = null;
      req = Event.target;
      if ((req.status >= 200) && (req.status <= 208)) {
        J = JSON.parse(req.responseText);
        this.LoadFromJSON$1(J,this.FDataNode);
        if (this.FOnHttpRequestSuccess != null) this.FOnHttpRequestSuccess(this);
      } else {
        if (this.FOnHttpRequestError != null) this.FOnHttpRequestError(this);
      };
      Result = true;
      return Result;
    };
    this.DoHttpLoadCsv = function (Event) {
      var Result = false;
      var sl = null;
      var req = null;
      req = Event.target;
      if ((req.status >= 200) && (req.status <= 208)) {
        sl = pas.Classes.TStringList.$create("Create$1");
        sl.SetTextStr(req.responseText);
        try {
          this.LoadFromStringList(sl);
        } finally {
          sl = rtl.freeLoc(sl);
        };
        if (this.FOnHttpRequestSuccess != null) this.FOnHttpRequestSuccess(this);
      };
      Result = true;
      return Result;
    };
    this.DoHttpAbort = function (Event) {
      var Result = false;
      if (this.FOnHttpRequestError != null) this.FOnHttpRequestError(this);
      Result = true;
      return Result;
    };
    this.DoHttpRequest = function (ARequest) {
      var LRequestRec = pas["WEBLib.Controls"].TJSXMLHttpRequestRecord.$new();
      if (this.FOnHttpRequest != null) {
        LRequestRec.req = ARequest;
        this.FOnHttpRequest(this,pas["WEBLib.Controls"].TJSXMLHttpRequestRecord.$clone(LRequestRec));
      };
    };
    this.LoadFromStringList = function (AStrings) {
      var r = 0;
      var c = 0;
      var MaxCol = 0;
      var ColCount = 0;
      var RowArr = null;
      var ColArr = null;
      var ColDef = null;
      var Value = "";
      var Line = "";
      var Buffer = "";
      var CH = "\x00";
      var I = 0;
      var LineCount = 0;
      var EndQuotePos = 0;
      var InQuote = false;
      var ContainsQuotes = false;
      var LineArr = null;
      var JSBuffer = null;
      RowArr = Array.of();
      ColCount = this.FColumnDefs.GetCount();
      for (var $l = 0, $end = AStrings.GetCount() - 1; $l <= $end; $l++) {
        r = $l;
        LineArr = Array.of();
        Line = AStrings.Get(r);
        LineCount = Line.length;
        InQuote = false;
        Buffer = "";
        if (LineCount > 0) {
          for (var $l1 = 1, $end1 = LineCount; $l1 <= $end1; $l1++) {
            I = $l1;
            CH = Line.charAt(I - 1);
            if (CH === this.FQuoteChar) {
              InQuote = !InQuote;
              Buffer = Buffer + CH;
            } else if (!InQuote && (CH === this.FDelimiter)) {
              LineArr.push(Buffer);
              Buffer = "";
            } else {
              Buffer = Buffer + CH;
            };
          };
          LineArr.push(Buffer);
        };
        for (var $l2 = 0, $end2 = LineArr.length - 1; $l2 <= $end2; $l2++) {
          I = $l2;
          ContainsQuotes = pas.System.Pos("" + LineArr[I],Line) > 0;
          if (ContainsQuotes) {
            JSBuffer = pas.SysUtils.Trim("" + LineArr[I]);
            if (JSBuffer.startsWith(this.FQuoteChar) && JSBuffer.endsWith(this.FQuoteChar)) {
              EndQuotePos = JSBuffer.indexOf(this.FQuoteChar,1);
              if (EndQuotePos === (JSBuffer.length - 1)) {
                JSBuffer = JSBuffer.substring(1,EndQuotePos);
              };
            };
            LineArr[I] = JSBuffer;
          };
        };
        if (this.FFirstRowColumnLabels && (r === 0)) {
          this.FColumnDefs.Clear();
          MaxCol = LineArr.length;
          for (var $l3 = 0, $end3 = MaxCol - 1; $l3 <= $end3; $l3++) {
            c = $l3;
            ColDef = this.FColumnDefs.Add$1();
            ColDef.SetField("" + LineArr[c]);
          };
          ColCount = this.FColumnDefs.GetCount();
          continue;
        };
        if (LineArr.length < ColCount) {
          MaxCol = LineArr.length}
         else MaxCol = ColCount;
        if (MaxCol > 0) {
          ColArr = Array.of();
          for (var $l4 = 0, $end4 = MaxCol - 1; $l4 <= $end4; $l4++) {
            c = $l4;
            if (c < this.FColumnDefs.GetCount()) {
              ColArr.push(this.FColumnDefs.GetItem$1(c).FField);
              Value = "" + LineArr[c];
              try {
                var $tmp = this.FColumnDefs.GetItem$1(c).FCellDataType;
                if ($tmp === pas["WEBLib.DataGrid.Common"].TDGCellDataType.cdtNumber) {
                  if (pas.SysUtils.TStringHelper.Contains.call({get: function () {
                      return Value;
                    }, set: function (v) {
                      Value = v;
                    }},".") && pas.SysUtils.TStringHelper.Contains.call({get: function () {
                      return Value;
                    }, set: function (v) {
                      Value = v;
                    }},",")) {
                    ColArr.push(pas.SysUtils.StrToFloat(Value))}
                   else if (pas.SysUtils.TStringHelper.Contains.call({get: function () {
                      return Value;
                    }, set: function (v) {
                      Value = v;
                    }},".")) {
                    ColArr.push(parseFloat(Value))}
                   else if (pas.SysUtils.TStringHelper.Contains.call({get: function () {
                      return Value;
                    }, set: function (v) {
                      Value = v;
                    }},",")) {
                    ColArr.push(pas.SysUtils.StrToFloat(Value))}
                   else ColArr.push(parseInt(Value));
                } else if ($tmp === pas["WEBLib.DataGrid.Common"].TDGCellDataType.cdtBoolean) {
                  if (Value !== "") {
                    if ((pas.SysUtils.LowerCase(Value) === "true") || (pas.SysUtils.LowerCase(Value) === "t") || (pas.SysUtils.LowerCase(Value) === "y") || (Value === "1")) {
                      ColArr.push(true)}
                     else if ((pas.SysUtils.LowerCase(Value) === "false") || (pas.SysUtils.LowerCase(Value) === "f") || (pas.SysUtils.LowerCase(Value) === "n") || (Value === "0")) {
                      ColArr.push(false)}
                     else ColArr.push(null);
                  } else {
                    ColArr.push(null);
                  };
                } else {
                  ColArr.push(Value);
                };
              } catch ($e) {
                if (pas.SysUtils.Exception.isPrototypeOf($e)) {
                  var E = $e;
                  { debugger; };
                } else throw $e
              };
            };
          };
          RowArr.push(pas.JS.New(ColArr));
        };
      };
      this.SetRowData(RowArr);
    };
    this.LoadFromJSON = function (AURL, ADataNode) {
      this.FDataNode = ADataNode;
      this.FReq = new XMLHttpRequest();
      this.FReq.addEventListener("load",rtl.createSafeCallback(this,"DoHttpLoadJson"));
      this.FReq.addEventListener("abort",rtl.createSafeCallback(this,"DoHttpAbort"));
      this.FReq.open("GET",AURL);
      this.DoHttpRequest(this.FReq);
      this.FReq.send();
    };
    this.LoadFromJSON$1 = function (AJSON, ADataNode) {
      if (Array.isArray(AJSON)) {
        this.SetRowData(AJSON);
      };
    };
    this.LoadFromJSONAsync = function (AURL, ADataNode) {
      var $Self = this;
      var Result = null;
      Result = new Promise(function (ASuccess, AFailed) {
        function DoLoad(Event) {
          var Result = false;
          if ($Self.DoHttpLoadJson(Event)) {
            ASuccess(Event.target)}
           else AFailed(Event.target);
          Result = true;
          return Result;
        };
        function DoError(Event) {
          var Result = false;
          AFailed(Event.target);
          Result = true;
          return Result;
        };
        $Self.FDataNode = ADataNode;
        $Self.FReq = new XMLHttpRequest();
        $Self.FReq.addEventListener("load",rtl.createSafeCallback(null,DoLoad));
        $Self.FReq.addEventListener("abort",rtl.createSafeCallback(null,DoError));
        $Self.FReq.addEventListener("timeout",rtl.createSafeCallback(null,DoError));
        $Self.FReq.addEventListener("error",rtl.createSafeCallback(null,DoError));
        $Self.FReq.open("GET",AURL);
        $Self.DoHttpRequest($Self.FReq);
        $Self.FReq.send();
      });
      return Result;
    };
    this.LoadFromCSV = function (AURL, Delimiter, FirstRowColumnLabels) {
      this.FDelimiter = Delimiter;
      this.FFirstRowColumnLabels = FirstRowColumnLabels;
      this.FReq = new XMLHttpRequest();
      this.FReq.addEventListener("load",rtl.createSafeCallback(this,"DoHttpLoadCsv"));
      this.FReq.addEventListener("abort",rtl.createSafeCallback(this,"DoHttpAbort"));
      this.FReq.open("GET",AURL);
      this.DoHttpRequest(this.FReq);
      this.FReq.send();
    };
    this.LoadFromCSVAsync = function (AURL, Delimiter, FirstRowColumnLabels) {
      var $Self = this;
      var Result = null;
      Result = new Promise(function (ASuccess, AFailed) {
        function DoLoad(Event) {
          var Result = false;
          if ($Self.DoHttpLoadCsv(Event)) {
            ASuccess(Event.target)}
           else AFailed(Event.target);
          Result = true;
          return Result;
        };
        function DoError(Event) {
          var Result = false;
          AFailed(Event.target);
          Result = true;
          return Result;
        };
        $Self.FDelimiter = Delimiter;
        $Self.FFirstRowColumnLabels = FirstRowColumnLabels;
        $Self.FReq = new XMLHttpRequest();
        $Self.FReq.addEventListener("load",rtl.createSafeCallback(null,DoLoad));
        $Self.FReq.addEventListener("abort",rtl.createSafeCallback(null,DoError));
        $Self.FReq.addEventListener("timeout",rtl.createSafeCallback(null,DoError));
        $Self.FReq.addEventListener("error",rtl.createSafeCallback(null,DoError));
        $Self.FReq.open("GET",AURL);
        $Self.DoHttpRequest($Self.FReq);
        $Self.FReq.send();
      });
      return Result;
    };
    this.LoadFromCSVString = function (CSVString, Delimiter, Quote, FirstRowColumnLabels) {
      var sl = null;
      try {
        sl = pas.Classes.TStringList.$create("Create$1");
        sl.SetTextStr(CSVString);
        this.LoadFromStrings(sl,Delimiter,Quote,FirstRowColumnLabels);
      } finally {
        pas.SysUtils.FreeAndNil({get: function () {
            return sl;
          }, set: function (v) {
            sl = v;
          }});
      };
    };
    this.LoadFromStrings = function (AStrings, Delimiter, Quote, FirstRowColumnLabels) {
      this.FDelimiter = Delimiter;
      this.FQuoteChar = Quote;
      this.FFirstRowColumnLabels = FirstRowColumnLabels;
      this.LoadFromStringList(AStrings);
    };
    this.SaveToCSV = function (AFileName, Delimiter, Quote, FirstRowColumnLabels) {
      var sl = null;
      sl = pas.Classes.TStringList.$create("Create$1");
      try {
        this.SaveToStrings(sl,Delimiter,Quote,FirstRowColumnLabels);
        sl.SaveToFile(AFileName);
      } finally {
        sl = rtl.freeLoc(sl);
      };
    };
    this.SaveAsCSVToString = function (Delimiter, Quote, FirstRowColumnLabels) {
      var Result = "";
      var sl = null;
      Result = "";
      try {
        sl = pas.Classes.TStringList.$create("Create$1");
        this.SaveToStrings(sl,Delimiter,Quote,FirstRowColumnLabels);
        Result = sl.GetTextStr();
      } finally {
        pas.SysUtils.FreeAndNil({get: function () {
            return sl;
          }, set: function (v) {
            sl = v;
          }});
      };
      return Result;
    };
    this.SaveToStrings = function (AStrings, Delimiter, Quote, FirstRowColumnLabels) {
      var CSV = "";
      var sl = null;
      var I = 0;
      if (this.FAGGrid != null) {
        CSV = this.FAGGrid.getDataAsCsv();
        AStrings.SetTextStr(CSV);
        if (Delimiter !== ",") {
          sl = pas.Classes.TStringList.$create("Create$1");
          try {
            for (var $l = 0, $end = AStrings.GetCount() - 1; $l <= $end; $l++) {
              I = $l;
              sl.FStrictDelimiter = true;
              sl.SetCommaText(AStrings.Get(I));
              sl.SetDelimiter(Delimiter);
              sl.SetQuoteChar(Quote);
              if (Quote !== "\x00") {
                { sl.FAlwaysQuote = true; };
              };
              AStrings.Put(I,sl.GetDelimitedText());
            };
          } finally {
            sl = rtl.freeLoc(sl);
          };
        };
        if (!FirstRowColumnLabels) {
          if (AStrings.GetCount() > 1) AStrings.Delete(0);
        };
      };
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TDataGrid",this.TDataGridCustom,function () {
    this.EnsureLastRowVisible = function () {
      $mod.TDataGridBase.EnsureLastRowVisible.call(this);
    };
    this.DeleteSelectedRows = function () {
      var Result = false;
      Result = $mod.TDataGridBase.DeleteSelectedRows.call(this);
      return Result;
    };
    this.InsertNewRow = function () {
      var Result = false;
      Result = $mod.TDataGridBase.InsertNewRow.call(this);
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("MultilevelHeaders",0,pas["WEBLib.DataGrid.Options"].$rtti["TDGMultilevelHeaderCollection"],"FMultilevelHeaders","FMultilevelHeaders");
    $r.addProperty("ColumnDefs",0,pas["WEBLib.DataGrid.Options"].$rtti["TDGColumnDefsCollection"],"FColumnDefs","FColumnDefs");
    $r.addProperty("ServerDataAdapter",2,pas["WEBLib.DataGrid.DataAdapter.Base"].$rtti["TDGServerDataAdapter"],"FServerDataAdapter","SetServerDataAdapter");
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("OnRowSelected",0,$mod.$rtti["TDGRowSelectedCallBack"],"FOnRowSelected","FOnRowSelected");
    $r.addProperty("OnRowUnselected",0,$mod.$rtti["TDGRowSelectedCallBack"],"FOnRowUnselected","FOnRowUnselected");
    $r.addProperty("OnCellEditingStarted",0,$mod.$rtti["TDGCellEditingEvent"],"FOnCellEditingStarted","FOnCellEditingStarted");
    $r.addProperty("OnCellEditingEnded",0,$mod.$rtti["TDGCellEditingEvent"],"FOnCellEditingEnded","FOnCellEditingEnded");
    $r.addProperty("OnRowEditingStarted",0,$mod.$rtti["TDGRowEditingEvent"],"FOnRowEditingStarted","FOnRowEditingStarted");
    $r.addProperty("OnRowEditingEnded",0,$mod.$rtti["TDGRowEditingEvent"],"FOnRowEditingEnded","FOnRowEditingEnded");
    $r.addProperty("OnCellClickedEvent",0,$mod.$rtti["TDGCellClickedEvent"],"FOnCellClickedEvent","FOnCellClickedEvent");
    $r.addProperty("OnCellDoubleClickedEvent",0,$mod.$rtti["TDGCellDoubleClickedEvent"],"FOnCellDoubleClickedEvent","FOnCellDoubleClickedEvent");
    $r.addProperty("OnCellFocusedEvent",0,$mod.$rtti["TDGCellFocusedEvent"],"FOnCellFocusedEvent","FOnCellFocusedEvent");
    $r.addProperty("OnCellMouseOverEvent",0,$mod.$rtti["TDGCellMouseOverEvent"],"FOnCellMouseOverEvent","FOnCellMouseOverEvent");
    $r.addProperty("OnCellMouseDown",0,$mod.$rtti["TDGCellMouseDown"],"FOnCellMouseDown","FOnCellMouseDown");
    $r.addProperty("OnGetLocaleText",2,$mod.$rtti["TDGGetLocaleTextCallBack"],"FOnGetLocaleText","SetOnGetLocaleText");
    $r.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti["TPopupMenu"],"FPopupMenu","FPopupMenu");
    $r.addProperty("Locale",2,$mod.$rtti["TDGLocale"],"FLocale","SetLocale",4,{Default: $mod.TDGLocale.localeNone});
  });
  rtl.createClass(this,"TWebDataGrid",this.TDataGrid,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TDataGridSearch",pas["WEBLib.StdCtrls"].TCustomEdit,function () {
    this.$init = function () {
      pas["WEBLib.StdCtrls"].TCustomEdit.$init.call(this);
      this.FSearchGrid = null;
      this.FPlaceHolder = "";
      this.FIsLoaded = false;
    };
    this.$final = function () {
      this.FSearchGrid = undefined;
      pas["WEBLib.StdCtrls"].TCustomEdit.$final.call(this);
    };
    this.SetSearchGrid = function (Value) {
      if (Value !== this.FSearchGrid) {
        if (this.FSearchGrid !== null) this.FSearchGrid.RemoveFreeNotification(this);
        this.FSearchGrid = Value;
        if (Value !== null) Value.FreeNotification(this);
      };
    };
    this.DoHandleChange = function (Event) {
      var Result = false;
      Result = pas["WEBLib.StdCtrls"].TCustomEdit.DoHandleChange.apply(this,arguments);
      this.ApplyQuickFilter();
      return Result;
    };
    this.ApplyQuickFilter = function () {
      var AGGrid = null;
      var SearchString = "";
      if (this.FSearchGrid != null) {
        AGGrid = this.FSearchGrid.FAGGrid;
        if (AGGrid != null) {
          SearchString = this.GetText();
          AGGrid.setGridOption("quickFilterText",SearchString);
        };
      };
    };
    this.Notification = function (AComponent, Operation) {
      pas["WEBLib.Menus"].TWebCustomControl.Notification.call(this,AComponent,Operation);
      if (Operation === pas.Classes.TOperation.opRemove) {
        if (AComponent === this.FSearchGrid) this.FSearchGrid = null;
      };
    };
    this.Loaded = function () {
      pas["WEBLib.Controls"].TCustomControl.Loaded.call(this);
      this.Load();
    };
    this.Load = function () {
      if (this.FIsLoaded) {
        return}
       else this.FIsLoaded = true;
      if ((this.GetElementHandle() != null) && (this.FPlaceHolder !== "")) this.GetElementHandle().setAttribute("placeholder",this.FPlaceHolder);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("SearchGrid",2,$mod.$rtti["TDataGridBase"],"FSearchGrid","SetSearchGrid");
    $r.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChange","FOnChange");
    $r.addProperty("PlaceHolder",0,rtl.string,"FPlaceHolder","FPlaceHolder");
    $r.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder");
  });
  rtl.createClass(this,"TWebDataGridSearch",this.TDataGridSearch,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  $mod.$implcode = function () {
    rtl.createClass($impl,"TDGLocalizationInternal",pas["WEBLib.DataGrid.Options"].TDGLocalization,function () {
    });
    rtl.createClass($impl,"TDGServerDataAdapterInternal",pas["WEBLib.DataGrid.DataAdapter.Base"].TDGServerDataAdapter,function () {
      rtl.addIntf(this,pas.System.IUnknown);
    });
  };
},[]);
rtl.module("WEBLib.Mask",["System","Classes","SysUtils","StrUtils","WEBLib.Controls","WEBLib.StdCtrls","Web"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.TMaskedState$a = {"0": "mStateMasked", mStateMasked: 0, "1": "mStateReEnter", mStateReEnter: 1, "2": "mStateDBSetText", mStateDBSetText: 2};
  this.$rtti.$Enum("TMaskedState$a",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TMaskedState$a});
  this.$rtti.$Set("TMaskedState",{comptype: this.$rtti["TMaskedState$a"]});
  this.$rtti.$inherited("TMaskedText",rtl.string,{});
  this.$rtti.$inherited("TEditMask",rtl.string,{});
  rtl.createClass(this,"TCustomMaskEdit",pas["WEBLib.StdCtrls"].TEdit,function () {
    this.$init = function () {
      pas["WEBLib.StdCtrls"].TEdit.$init.call(this);
      this.FEditMask = "";
      this.FMaskBlank = "\x00";
      this.FMaxChars = 0;
      this.FMaskState = {};
      this.FCaretPos = 0;
      this.FOldValue = "";
      this.FEditText = "";
    };
    this.$final = function () {
      this.FMaskState = undefined;
      pas["WEBLib.StdCtrls"].TEdit.$final.call(this);
    };
    this.GetEditText = function () {
      var Result = "";
      Result = this.RemoveEditFormat(this.GetText());
      return Result;
    };
    this.SetEditText = function (Value) {
      this.FEditText = this.AddEditFormat(Value,true);
      this.SetText(this.FEditText);
    };
    this.AddEditFormat = function (Value, Active) {
      var Result = "";
      if (!Active) {
        Result = $impl.FormatMaskedText(this.FEditMask,Value," ")}
       else Result = $impl.FormatMaskedText(this.FEditMask,Value,this.FMaskBlank);
      return Result;
    };
    this.RemoveEditFormat = function (Value) {
      var Result = "";
      var I = 0;
      var OldLen = 0;
      var Offset = 0;
      var MaskOffset = 0;
      var CType = 0;
      var Dir = {};
      Offset = 1;
      Result = Value;
      for (var $l = 1, $end = this.FEditMask.length; $l <= $end; $l++) {
        MaskOffset = $l;
        CType = $impl.GetMaskCharType(this.FEditMask,MaskOffset);
        if (CType in rtl.createSet($impl.TMaskCharType.mcLiteral,$impl.TMaskCharType.mcIntlLiteral)) Result = pas.System.Copy(Result,1,Offset - 1) + pas.System.Copy(Result,Offset + 1,Result.length - Offset);
        if (CType in rtl.createSet($impl.TMaskCharType.mcMask,$impl.TMaskCharType.mcMaskOpt)) Offset += 1;
      };
      Dir = rtl.refSet($impl.GetMaskInstructions(this.FEditMask,1));
      if ($impl.TMaskInstructions$a.miReverseDir in Dir) {
        Offset = 1;
        for (var $l1 = 1, $end1 = Result.length; $l1 <= $end1; $l1++) {
          I = $l1;
          if (Result.charAt(I - 1) === this.FMaskBlank) {
            Offset += 1}
           else break;
        };
        if (Offset !== 1) Result = pas.System.Copy(Result,Offset,(Result.length - Offset) + 1);
      } else {
        OldLen = Result.length;
        for (var $l2 = 1, $end2 = OldLen; $l2 <= $end2; $l2++) {
          I = $l2;
          if (Result.charAt(((OldLen - I) + 1) - 1) === this.FMaskBlank) {
            Result = rtl.strSetLength(Result,Result.length - 1)}
           else break;
        };
      };
      if (this.FMaskBlank !== " ") {
        OldLen = Result.length;
        for (var $l3 = 1, $end3 = OldLen; $l3 <= $end3; $l3++) {
          I = $l3;
          if (Result.charAt(I - 1) === this.FMaskBlank) Result = rtl.setCharAt(Result,I - 1," ");
          if (I > OldLen) break;
        };
      };
      return Result;
    };
    this.ArrowKeys = function (CharCode, Shift) {
      var ASelStart = 0;
      var ASelStop = 0;
      if (pas.Classes.TShiftState$a.ssCtrl in Shift) return;
      this.GetSel({get: function () {
          return ASelStart;
        }, set: function (v) {
          ASelStart = v;
        }},{get: function () {
          return ASelStop;
        }, set: function (v) {
          ASelStop = v;
        }});
      if (pas.Classes.TShiftState$a.ssShift in Shift) {
        if (CharCode === 39) {
          this.FCaretPos += 1;
          if (ASelStop === (ASelStart + 1)) {
            this.SetSel(ASelStart,ASelStop);
            this.FCaretPos += 1;
          };
          if (this.FCaretPos > this.FMaxChars) this.FCaretPos = this.FMaxChars;
        } else {
          this.FCaretPos -= 1;
          if ((ASelStop === (ASelStart + 2)) && (this.FCaretPos > ASelStart)) {
            this.SetSel(ASelStart + 1,ASelStart + 1);
            this.FCaretPos -= 1;
          };
          if (this.FCaretPos < 0) this.FCaretPos = 0;
        };
      } else {
        if ((ASelStop - ASelStart) > 1) {
          if (ASelStop === this.FCaretPos) this.FCaretPos -= 1;
          this.SetCursor(this.FCaretPos);
        } else if (CharCode === 37) {
          this.CursorDec(ASelStart)}
         else {
          if (ASelStop === ASelStart) {
            this.SetCursor(ASelStart)}
           else this.CursorInc(ASelStart,1);
        };
      };
    };
    this.CursorInc = function (CursorPos, Incr) {
      var NuPos = 0;
      if (CursorPos < this.GetText().length) {
        NuPos = CursorPos + Incr;
        NuPos = this.GetNextEditChar(NuPos);
        if ($impl.IsLiteralChar(this.FEditMask,NuPos)) NuPos = CursorPos;
        this.SetCursor(NuPos);
      };
    };
    this.CursorDec = function (CursorPos) {
      var Result = 0;
      var nuPos = 0;
      Result = 0;
      if (CursorPos > 0) {
        nuPos = CursorPos;
        nuPos -= 1;
        nuPos = this.GetPriorEditChar(nuPos);
        this.SetCursor(nuPos);
        Result = nuPos;
      };
      return Result;
    };
    this.DeleteKeys = function (CharCode) {
      var ASelStart = 0;
      var ASelStop = 0;
      var Str = "";
      var Orig = "";
      this.GetSel({get: function () {
          return ASelStart;
        }, set: function (v) {
          ASelStart = v;
        }},{get: function () {
          return ASelStop;
        }, set: function (v) {
          ASelStop = v;
        }});
      if ((ASelStop - ASelStart) < 1) return;
      Str = this.GetText();
      Orig = this.GetText();
      this.DeleteSelection({get: function () {
          return Str;
        }, set: function (v) {
          Str = v;
        }},ASelStart,ASelStop - ASelStart);
      Str = pas.System.Copy(Str,ASelStart + 1,ASelStop - ASelStart);
      Str = pas.System.Copy(Orig,1,ASelStart) + Str + pas.System.Copy(Orig,ASelStop + 1,Orig.length);
      this.SetText(Str);
      this.SetCursor(ASelStart);
      this.Change();
    };
    this.DeleteSelection = function (Value, Offset, Len) {
      var Result = false;
      var EndDel = 0;
      var StrOffset = 0;
      var MaskOffset = 0;
      var Temp = 0;
      var CType = 0;
      Result = true;
      if (Len === 0) return Result;
      StrOffset = Offset + 1;
      EndDel = StrOffset + Len;
      Temp = $impl.OffsetToMaskOffset(this.FEditMask,Offset);
      if (Temp < 0) return Result;
      for (var $l = Temp, $end = this.FEditMask.length; $l <= $end; $l++) {
        MaskOffset = $l;
        CType = $impl.GetMaskCharType(this.FEditMask,MaskOffset);
        if (CType in rtl.createSet($impl.TMaskCharType.mcLiteral,$impl.TMaskCharType.mcIntlLiteral)) {
          StrOffset += 1}
         else if (CType in rtl.createSet($impl.TMaskCharType.mcMask,$impl.TMaskCharType.mcMaskOpt)) {
          Value.set(rtl.setCharAt(Value.get(),StrOffset - 1,this.FMaskBlank));
          StrOffset += 1;
        };
        if (StrOffset >= EndDel) break;
      };
      return Result;
    };
    this.HomeEndKeys = function (CharCode, Shift) {
      var ASelStart = 0;
      var ASelStop = 0;
      this.GetSel({get: function () {
          return ASelStart;
        }, set: function (v) {
          ASelStart = v;
        }},{get: function () {
          return ASelStop;
        }, set: function (v) {
          ASelStop = v;
        }});
      if (CharCode === 36) {
        if (pas.Classes.TShiftState$a.ssShift in Shift) {
          if ((ASelStart !== this.FCaretPos) && (ASelStop !== (ASelStart + 1))) ASelStop = ASelStart + 1;
          this.SetSel(0,ASelStop);
          this.CheckCursor();
        } else this.SetCursor(0);
        this.FCaretPos = 0;
      } else {
        if (pas.Classes.TShiftState$a.ssShift in Shift) {
          if ((ASelStop !== this.FCaretPos) && (ASelStop !== (ASelStart + 1))) ASelStart = ASelStop - 1;
          this.SetSel(ASelStart,this.FMaxChars);
          this.CheckCursor();
        } else this.SetCursor(this.FMaxChars - 1);
        this.FCaretPos = this.FMaxChars;
      };
    };
    this.CharKeys = function (CharCode) {
      var Result = false;
      var ASelStart = 0;
      var ASelStop = 0;
      var Txt = "";
      Result = false;
      this.GetSel({get: function () {
          return ASelStart;
        }, set: function (v) {
          ASelStart = v;
        }},{get: function () {
          return ASelStop;
        }, set: function (v) {
          ASelStop = v;
        }});
      if ((ASelStop - ASelStart) > 1) {
        this.DeleteKeys(46);
        ASelStart = this.GetNextEditChar(ASelStart);
        this.SetCursor(ASelStart);
      };
      Result = this.InputChar(CharCode,ASelStart);
      if (Result) {
        Txt = CharCode.get();
        this.SetText(pas.System.Copy(this.GetText(),1,ASelStart) + Txt + pas.System.Copy(this.GetText(),ASelStop + 1,this.GetText().length));
        this.CursorInc(ASelStart,1);
      };
      return Result;
    };
    this.InputChar = function (NewChar, Offset) {
      var Result = false;
      var MaskOffset = 0;
      var CType = 0;
      var InChar = "\x00";
      Result = true;
      if (this.FEditMask !== "") {
        Result = false;
        if (Offset < this.FMaxChars) {
          MaskOffset = $impl.OffsetToMaskOffset(this.FEditMask,Offset);
          if (MaskOffset >= 0) {
            CType = $impl.GetMaskCharType(this.FEditMask,MaskOffset);
            InChar = NewChar.get();
            Result = this.DoInputChar(NewChar,MaskOffset);
            if (!Result && (CType in rtl.createSet($impl.TMaskCharType.mcMask,$impl.TMaskCharType.mcMaskOpt))) {
              MaskOffset = this.FindLiteralChar(MaskOffset,InChar);
              if (MaskOffset > 0) {
                MaskOffset = $impl.MaskOffsetToOffset(this.FEditMask,MaskOffset);
                this.SetCursor(MaskOffset);
                return Result;
              };
            };
          };
        };
      };
      if (!Result && (NewChar.get() !== "\r") && (NewChar.get() !== "\x1B")) {
        pas["WEBLib.WebTools"].MessageBeep(0);
      } else this.Change();
      return Result;
    };
    this.DoInputChar = function (NewChar, MaskOffset) {
      var Result = false;
      var Instr = {};
      var Str = "";
      var CType = 0;
      Result = true;
      CType = $impl.GetMaskCharType(this.FEditMask,MaskOffset);
      if (CType in rtl.createSet($impl.TMaskCharType.mcLiteral,$impl.TMaskCharType.mcIntlLiteral)) {
        NewChar.set($impl.GetFormatSettingsChar(this.FEditMask.charAt(MaskOffset - 1)))}
       else {
        Instr = rtl.refSet($impl.GetMaskInstructions(this.FEditMask,MaskOffset));
        var $tmp = this.FEditMask.charAt(MaskOffset - 1);
        if (($tmp === $impl.cMaskNumeric) || ($tmp === $impl.cMaskNumericOpt)) {
          if (!((NewChar.get() >= "0") && (NewChar.get() <= "9"))) Result = false;
        } else if ($tmp === $impl.cMaskNumSymOpt) {
          if (!(((NewChar.get() >= "0") && (NewChar.get() <= "9")) || (NewChar.get() === " ") || (NewChar.get() === "+") || (NewChar.get() === "-"))) Result = false;
        } else if (($tmp === $impl.cMaskAscii) || ($tmp === $impl.cMaskAsciiOpt)) {
          if ($impl.IsCharAlpha(NewChar.get())) {
            Str = " ";
            Str = rtl.setCharAt(Str,0,NewChar.get());
            if ($impl.TMaskInstructions$a.miUpperCase in Instr) {
              Str = pas.SysUtils.UpperCase(Str)}
             else if ($impl.TMaskInstructions$a.miLowerCase in Instr) Str = pas.SysUtils.LowerCase(Str);
            NewChar.set(Str.charAt(0));
          };
        } else if (($tmp === $impl.cMaskAlpha) || ($tmp === $impl.cMaskAlphaOpt) || ($tmp === $impl.cMaskAlphaNum) || ($tmp === $impl.cMaskAlphaNumOpt)) {
          Str = " ";
          Str = rtl.setCharAt(Str,0,NewChar.get());
          if (!$impl.IsCharAlpha(NewChar.get())) {
            Result = false;
            if (((this.FEditMask.charAt(MaskOffset - 1) === $impl.cMaskAlphaNum) || (this.FEditMask.charAt(MaskOffset - 1) === $impl.cMaskAlphaNumOpt)) && $impl.IsCharAlphaNumeric(NewChar.get())) Result = true;
          } else if ($impl.TMaskInstructions$a.miUpperCase in Instr) {
            Str = pas.SysUtils.UpperCase(Str)}
           else if ($impl.TMaskInstructions$a.miLowerCase in Instr) Str = pas.SysUtils.LowerCase(Str);
          NewChar.set(Str.charAt(0));
        };
      };
      return Result;
    };
    this.FindLiteralChar = function (MaskOffset, InChar) {
      var Result = 0;
      var CType = 0;
      var LitChar = "\x00";
      Result = -1;
      while (MaskOffset < this.FEditMask.length) {
        MaskOffset += 1;
        CType = $impl.GetMaskCharType(this.FEditMask,MaskOffset);
        if (CType in rtl.createSet($impl.TMaskCharType.mcLiteral,$impl.TMaskCharType.mcIntlLiteral)) {
          LitChar = this.FEditMask.charAt(MaskOffset - 1);
          if (CType === $impl.TMaskCharType.mcIntlLiteral) LitChar = $impl.GetFormatSettingsChar(LitChar);
          if (LitChar === InChar) Result = MaskOffset;
          return Result;
        };
      };
      return Result;
    };
    this.SetEditMask = function (Value) {
      var SelStart = 0;
      var SelStop = 0;
      if (Value !== this.FEditMask) {
        if ((pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) && (Value !== "") && !(pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) this.SetEditText("");
        if (this.HandleAllocated()) this.GetSel({get: function () {
            return SelStart;
          }, set: function (v) {
            SelStart = v;
          }},{get: function () {
            return SelStop;
          }, set: function (v) {
            SelStop = v;
          }});
        this.ReformatText(Value);
        this.FMaskState = rtl.excludeSet(this.FMaskState,$mod.TMaskedState$a.mStateMasked);
        if (this.FEditMask !== "") this.FMaskState = rtl.includeSet(this.FMaskState,$mod.TMaskedState$a.mStateMasked);
        this.SetMaxLength(0);
        if (this.GetMasked() && (this.FMaxChars > 0)) {
          this.SetMaxLength(this.FMaxChars);
        };
        if (this.HandleAllocated() && this.Focused() && !(pas.Classes.TComponentStateItem.csDesigning in this.FComponentState)) this.SetCursor(SelStart);
      };
    };
    this.GetMasked = function () {
      var Result = false;
      Result = this.FEditMask !== "";
      return Result;
    };
    this.GetTextLen = function () {
      var Result = 0;
      Result = this.GetText().length;
      return Result;
    };
    this.EditCanModify = function () {
      var Result = false;
      Result = !this.FReadOnly;
      return Result;
    };
    this.ReformatText = function (NewMask) {
      var OldText = "";
      OldText = this.RemoveEditFormat(this.GetEditText());
      this.FEditMask = NewMask;
      this.FMaxChars = $impl.MaskOffsetToOffset(this.FEditMask,NewMask.length);
      this.FMaskBlank = $impl.GetMaskBlank(NewMask);
      this.SetEditText(OldText);
    };
    this.KeyDown = function (Key, Shift) {
      pas["WEBLib.Controls"].TControl.KeyDown.call(this,Key,rtl.refSet(Shift));
      if (Key.get() in rtl.createSet(37,39,36,35)) {
        this.PreventDefault();
        this.StopPropagation();
      };
      if (this.GetMasked() && (Key.get() !== 0) && !(pas.Classes.TShiftState$a.ssAlt in Shift)) {
        if (!(Key.get() in rtl.createSet(37,39,36,35))) {
          if (this.GetSelLength() > 1) {
            this.SetSelStart(0);
            this.SetSelLength(1);
          };
        };
        if ((Key.get() === 37) || (Key.get() === 39)) {
          this.ArrowKeys(Key.get(),rtl.refSet(Shift));
          if (!((pas.Classes.TShiftState$a.ssShift in Shift) || (pas.Classes.TShiftState$a.ssCtrl in Shift))) Key.set(0);
          return;
        } else if ((Key.get() === 38) || (Key.get() === 40)) {
          Key.set(0);
          return;
        } else if ((Key.get() === 36) || (Key.get() === 35)) {
          this.HomeEndKeys(Key.get(),rtl.refSet(Shift));
          Key.set(0);
          return;
        } else if (((Key.get() === 46) && !(pas.Classes.TShiftState$a.ssShift in Shift)) || (Key.get() === 8)) {
          if (this.EditCanModify()) this.DeleteKeys(Key.get());
          if (!(Key.get() === 8)) {
            Key.set(0);
            this.PreventDefault();
            this.StopPropagation();
          };
          return;
        };
        this.CheckCursor();
      };
    };
    this.KeyUp = function (Key, Shift) {
      pas["WEBLib.Controls"].TControl.KeyUp.call(this,Key,rtl.refSet(Shift));
      if (this.GetMasked() && (Key.get() !== 0)) {
        if (((Key.get() === 37) || (Key.get() === 39)) && (pas.Classes.TShiftState$a.ssCtrl in Shift)) this.CheckCursor();
      };
    };
    this.KeyPress = function (Key) {
      pas["WEBLib.StdCtrls"].TCustomEdit.KeyPress.call(this,Key);
      if (this.GetMasked() && (Key.get() !== "\x00") && !pas.SysUtils.CharInSet(Key.get(),["\x16","\x18","\x03","\b"])) {
        this.CharKeys(Key);
        Key.set("\x00");
        this.PreventDefault();
        this.StopPropagation();
      };
    };
    this.MouseUp = function (Button, Shift, X, Y) {
      pas["WEBLib.Controls"].TControl.MouseUp.apply(this,arguments);
    };
    this.CheckCursor = function () {
      var ASelStart = 0;
      var ASelStop = 0;
      if (!this.HandleAllocated()) return;
      if (this.GetMasked()) {
        this.GetSel({get: function () {
            return ASelStart;
          }, set: function (v) {
            ASelStart = v;
          }},{get: function () {
            return ASelStop;
          }, set: function (v) {
            ASelStop = v;
          }});
        if (ASelStart === ASelStop) this.SetCursor(ASelStart);
      };
    };
    this.Reset = function () {
      this.SetEditText(this.FOldValue);
    };
    this.Loaded = function () {
      pas["WEBLib.Controls"].TCustomControl.Loaded.call(this);
    };
    this.DoEnter = function () {
      pas["WEBLib.StdCtrls"].TCustomEdit.DoEnter.call(this);
      this.SetSelStart(0);
      this.SetSelLength(1);
    };
    this.InitCSSLibrary = function (ALibrary) {
      if (ALibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap) {
        this.SetElementClassName("form-control");
        this.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
        this.SetHeightStyle(pas["WEBLib.Controls"].TSizeStyle.ssAuto);
      };
    };
    this.CreateInitialize = function () {
      pas["WEBLib.StdCtrls"].TCustomEdit.CreateInitialize.call(this);
      this.SetHeight(25);
    };
    this.GetSel = function (ASelStart, ASelStop) {
      ASelStart.set(this.GetSelStart());
      ASelStop.set(this.GetSelStart() + this.GetSelLength());
    };
    this.SetSel = function (ASelStart, ASelStop) {
      this.SetSelStart(ASelStart);
      this.SetSelLength(Math.max(1,ASelStop - ASelStart));
    };
    this.SetCursor = function (Pos) {
      this.SetSel(Pos,Pos + 1);
    };
    this.GetFirstEditChar = function () {
      var Result = 0;
      Result = 0;
      if (this.GetMasked()) Result = this.GetNextEditChar(0);
      return Result;
    };
    this.GetLastEditChar = function () {
      var Result = 0;
      Result = this.GetMaxChars();
      if (this.GetMasked()) Result = this.GetPriorEditChar(Result - 1);
      return Result;
    };
    this.GetNextEditChar = function (Offset) {
      var Result = 0;
      Result = Offset;
      while ((Result < this.FMaxChars) && $impl.IsLiteralChar(this.FEditMask,Result)) Result += 1;
      return Result;
    };
    this.GetPriorEditChar = function (Offset) {
      var Result = 0;
      Result = Offset;
      while ((Result >= 0) && $impl.IsLiteralChar(this.FEditMask,Result)) Result -= 1;
      if (Result < 0) Result = this.GetNextEditChar(Result);
      return Result;
    };
    this.GetMaxChars = function () {
      var Result = 0;
      if (this.GetMasked()) {
        Result = this.FMaxChars}
       else Result = this.GetTextLen();
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TMaskEdit",this.TCustomMaskEdit,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("EditMask",2,$mod.$rtti["TEditMask"],"FEditMask","SetEditMask");
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
  });
  rtl.createClass(this,"TWebMaskEdit",this.TMaskEdit,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  $mod.$implcode = function () {
    $impl.TMaskCharType = {"0": "mcNone", mcNone: 0, "1": "mcLiteral", mcLiteral: 1, "2": "mcIntlLiteral", mcIntlLiteral: 2, "3": "mcDirective", mcDirective: 3, "4": "mcMask", mcMask: 4, "5": "mcMaskOpt", mcMaskOpt: 5, "6": "mcFieldSeparator", mcFieldSeparator: 6, "7": "mcField", mcField: 7, "8": "mcDigitSeparator", mcDigitSeparator: 8};
    $mod.$rtti.$Enum("TMaskCharType",{minvalue: 0, maxvalue: 8, ordtype: 1, enumtype: $impl.TMaskCharType});
    $impl.TMaskInstructions$a = {"0": "miReverseDir", miReverseDir: 0, "1": "miUpperCase", miUpperCase: 1, "2": "miLowerCase", miLowerCase: 2, "3": "miLiteralChar", miLiteralChar: 3};
    $mod.$rtti.$Enum("TMaskInstructions$a",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: $impl.TMaskInstructions$a});
    $mod.$rtti.$Set("TMaskInstructions",{comptype: $mod.$rtti["TMaskInstructions$a"]});
    $impl.dMaskReverse = "!";
    $impl.dMaskUpperCase = ">";
    $impl.dMaskLowerCase = "<";
    $impl.dMaskLiteral = "\\";
    $impl.cMaskAlpha = "L";
    $impl.cMaskAlphaOpt = "l";
    $impl.cMaskAlphaNum = "A";
    $impl.cMaskAlphaNumOpt = "a";
    $impl.cMaskAscii = "C";
    $impl.cMaskAsciiOpt = "c";
    $impl.cMaskNumeric = "0";
    $impl.cMaskNumericOpt = "9";
    $impl.cMaskNumSymOpt = "#";
    $impl.cMaskTimeSeparator = ":";
    $impl.cMaskDateSeparator = "/";
    $impl.cMaskComma = ",";
    $impl.cMaskDot = ".";
    $impl.cMaskDash = "-";
    $impl.mskSeparator = ";";
    $impl.mskBlank = "_";
    $impl.IsCharAlpha = function (IChar) {
      var Result = false;
      Result = ((IChar >= "a") && (IChar <= "z")) || ((IChar >= "A") && (IChar <= "Z"));
      return Result;
    };
    $impl.IsCharAlphaNumeric = function (IChar) {
      var Result = false;
      Result = ((IChar >= "a") && (IChar <= "z")) || ((IChar >= "A") && (IChar <= "Z")) || ((IChar >= "0") && (IChar <= "9"));
      return Result;
    };
    $impl.GetMaskCharType = function (EditMask, MaskOffset) {
      var Result = 0;
      var MaskChar = "\x00";
      Result = $impl.TMaskCharType.mcLiteral;
      MaskChar = "\x00";
      if (MaskOffset <= EditMask.length) MaskChar = EditMask.charAt(MaskOffset - 1);
      if (MaskOffset > EditMask.length) {
        Result = $impl.TMaskCharType.mcNone}
       else if ((MaskOffset > 1) && (EditMask.charAt(MaskOffset - 1 - 1) === $impl.dMaskLiteral) && !((MaskOffset > 2) && (EditMask.charAt(MaskOffset - 2 - 1) === $impl.dMaskLiteral))) {
        Result = $impl.TMaskCharType.mcLiteral}
       else if ((MaskChar === $impl.mskSeparator) && (EditMask.length >= 4) && (MaskOffset > (EditMask.length - 4))) {
        Result = $impl.TMaskCharType.mcFieldSeparator}
       else if ((EditMask.length >= 4) && (MaskOffset > (EditMask.length - 4)) && (EditMask.charAt(MaskOffset - 1 - 1) === $impl.mskSeparator) && !((MaskOffset > 2) && (EditMask.charAt(MaskOffset - 2 - 1) === $impl.dMaskLiteral))) {
        Result = $impl.TMaskCharType.mcField}
       else if (MaskChar.charCodeAt() in rtl.createSet($impl.cMaskTimeSeparator.charCodeAt(),$impl.cMaskDateSeparator.charCodeAt())) {
        Result = $impl.TMaskCharType.mcIntlLiteral}
       else if (MaskChar.charCodeAt() in rtl.createSet($impl.cMaskDash.charCodeAt(),$impl.cMaskDot.charCodeAt(),$impl.cMaskComma.charCodeAt())) {
        Result = $impl.TMaskCharType.mcDigitSeparator}
       else if (MaskChar.charCodeAt() in rtl.createSet($impl.dMaskReverse.charCodeAt(),$impl.dMaskUpperCase.charCodeAt(),$impl.dMaskLowerCase.charCodeAt(),$impl.dMaskLiteral.charCodeAt())) {
        Result = $impl.TMaskCharType.mcDirective}
       else if (MaskChar.charCodeAt() in rtl.createSet($impl.cMaskAlphaOpt.charCodeAt(),$impl.cMaskAlphaNumOpt.charCodeAt(),$impl.cMaskAsciiOpt.charCodeAt(),$impl.cMaskNumSymOpt.charCodeAt(),$impl.cMaskNumericOpt.charCodeAt())) {
        Result = $impl.TMaskCharType.mcMaskOpt}
       else if (MaskChar.charCodeAt() in rtl.createSet($impl.cMaskAlpha.charCodeAt(),$impl.cMaskAlphaNum.charCodeAt(),$impl.cMaskAscii.charCodeAt(),$impl.cMaskNumeric.charCodeAt())) Result = $impl.TMaskCharType.mcMask;
      return Result;
    };
    $impl.GetMaskInstructions = function (EditMask, MaskOffset) {
      var Result = {};
      var I = 0;
      var MaskChar = "\x00";
      Result = {};
      for (var $l = 0, $end = EditMask.length - 1; $l <= $end; $l++) {
        I = $l;
        MaskChar = EditMask.charAt((I + 1) - 1);
        if (MaskChar === $impl.dMaskReverse) {
          Result = rtl.unionSet(Result,rtl.createSet($impl.TMaskInstructions$a.miReverseDir))}
         else if ((MaskChar === $impl.dMaskLowerCase) && (I < (MaskOffset - 1))) {
          Result = rtl.unionSet(rtl.diffSet(Result,rtl.createSet($impl.TMaskInstructions$a.miUpperCase)),rtl.createSet($impl.TMaskInstructions$a.miLowerCase));
        } else if ((MaskChar === $impl.dMaskUpperCase) && (I < (MaskOffset - 1))) {
          Result = rtl.diffSet(Result,rtl.createSet($impl.TMaskInstructions$a.miLowerCase));
          if (!((I > 0) && (EditMask.charAt(I - 1) === $impl.dMaskLowerCase))) Result = rtl.unionSet(Result,rtl.createSet($impl.TMaskInstructions$a.miUpperCase));
        };
      };
      if ($impl.GetMaskCharType(EditMask,MaskOffset) === $impl.TMaskCharType.mcLiteral) Result = rtl.unionSet(Result,rtl.createSet($impl.TMaskInstructions$a.miLiteralChar));
      return Result;
    };
    $impl.GetFormatSettingsChar = function (IChar) {
      var Result = "\x00";
      Result = IChar;
      var $tmp = IChar;
      if ($tmp === $impl.cMaskTimeSeparator) {
        Result = pas.SysUtils.FormatSettings.TimeSeparator}
       else if ($tmp === $impl.cMaskDateSeparator) Result = pas.SysUtils.FormatSettings.DateSeparator;
      return Result;
    };
    $impl.MaskOffsetToString = function (EditMask, MaskOffset) {
      var Result = "";
      var I = 0;
      var CType = 0;
      Result = "";
      for (var $l = 1, $end = MaskOffset; $l <= $end; $l++) {
        I = $l;
        CType = $impl.GetMaskCharType(EditMask,I);
        if (!(CType in rtl.createSet($impl.TMaskCharType.mcDirective,$impl.TMaskCharType.mcField,$impl.TMaskCharType.mcFieldSeparator))) Result = Result + EditMask.charAt(I - 1);
      };
      return Result;
    };
    $impl.MaskOffsetToOffset = function (EditMask, MaskOffset) {
      var Result = 0;
      Result = $impl.MaskOffsetToString(EditMask,MaskOffset).length;
      return Result;
    };
    $impl.OffsetToMaskOffset = function (EditMask, Offset) {
      var Result = 0;
      var I = 0;
      var Count = 0;
      var MaxChars = 0;
      MaxChars = $impl.MaskOffsetToOffset(EditMask,EditMask.length);
      if (Offset > MaxChars) {
        Result = -1;
        return Result;
      };
      Result = 0;
      Count = Offset;
      for (var $l = 1, $end = EditMask.length; $l <= $end; $l++) {
        I = $l;
        Result += 1;
        if (!($impl.TMaskCharType.mcDirective === $impl.GetMaskCharType(EditMask,I))) {
          Count -= 1;
          if (Count < 0) return Result;
        };
      };
      return Result;
    };
    $impl.FormatMaskedText = function (EditMask, Value, Blank) {
      var Result = "";
      var I = 0;
      var Dig = 0;
      var Offset = 0;
      var MaskOffset = 0;
      var CType = 0;
      var Dir = {};
      Result = Value;
      Dir = rtl.refSet($impl.GetMaskInstructions(EditMask,1));
      if (!($impl.TMaskInstructions$a.miReverseDir in Dir)) {
        Offset = 1;
        for (var $l = 1, $end = EditMask.length; $l <= $end; $l++) {
          MaskOffset = $l;
          CType = $impl.GetMaskCharType(EditMask,MaskOffset);
          if (CType in rtl.createSet($impl.TMaskCharType.mcLiteral,$impl.TMaskCharType.mcIntlLiteral,$impl.TMaskCharType.mcDigitSeparator)) {
            Dig = 0;
            if (CType === $impl.TMaskCharType.mcDigitSeparator) Dig = 1;
            Result = pas.System.Copy(Result,1,Offset - 1) + $impl.GetFormatSettingsChar(EditMask.charAt(MaskOffset - 1)) + pas.System.Copy(Result,Offset + Dig,(Result.length - Offset) + 1);
            Offset += 1;
          } else if (CType in rtl.createSet($impl.TMaskCharType.mcMask,$impl.TMaskCharType.mcMaskOpt)) {
            if (Offset > Result.length) Result = Result + Blank;
            Offset += 1;
          };
        };
      } else {
        Offset = Result.length;
        for (var $l1 = 0, $end1 = EditMask.length - 1; $l1 <= $end1; $l1++) {
          I = $l1;
          MaskOffset = EditMask.length - I;
          CType = $impl.GetMaskCharType(EditMask,MaskOffset);
          if (CType in rtl.createSet($impl.TMaskCharType.mcLiteral,$impl.TMaskCharType.mcIntlLiteral)) {
            Result = pas.System.Copy(Result,1,Offset) + $impl.GetFormatSettingsChar(EditMask.charAt(MaskOffset - 1)) + pas.System.Copy(Result,Offset + 1,Result.length - Offset);
          } else if (CType in rtl.createSet($impl.TMaskCharType.mcMask,$impl.TMaskCharType.mcMaskOpt)) {
            if (Offset < 1) {
              Result = Blank + Result}
             else Offset -= 1;
          };
        };
      };
      return Result;
    };
    $impl.IsLiteralChar = function (EditMask, Offset) {
      var Result = false;
      var MaskOffset = 0;
      var CType = 0;
      Result = false;
      MaskOffset = $impl.OffsetToMaskOffset(EditMask,Offset);
      if (MaskOffset >= 0) {
        CType = $impl.GetMaskCharType(EditMask,MaskOffset);
        Result = CType in rtl.createSet($impl.TMaskCharType.mcLiteral,$impl.TMaskCharType.mcIntlLiteral);
      };
      return Result;
    };
    $impl.GetMaskBlank = function (EditMask) {
      var Result = "\x00";
      Result = $impl.mskBlank;
      if (EditMask.length >= 4) {
        if ($impl.GetMaskCharType(EditMask,EditMask.length - 1) === $impl.TMaskCharType.mcFieldSeparator) {
          if (($impl.GetMaskCharType(EditMask,EditMask.length - 2) === $impl.TMaskCharType.mcFieldSeparator) || ($impl.GetMaskCharType(EditMask,EditMask.length - 3) === $impl.TMaskCharType.mcFieldSeparator)) {
            Result = EditMask.charAt(EditMask.length - 1);
          };
        };
      };
      return Result;
    };
  };
},["Math","WEBLib.WebTools"]);
rtl.module("WEBLib.Ctrls.SVG",["System"],function () {
  "use strict";
  var $mod = this;
  this.ICON_SEARCH = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAPJJREFUOE+l0i0sR1EUAPDfv0ka0UemEhUzhU0yjea" + "j0YxJiCrDRqFoPpqPbjRTbHRVQLO73bfd//Mue3s3nt3zO+eee1oanlbDfFXAJFYwFPF77OCyqlgZ2MYqXnEdE8bQjy2sl5EUCJXPcYQlfMXLHdjFHMKdtk5S4A49GEiSi4IBecYbRtMu" + "UuADJ1jIDHYfM+j8CzjFfAY4wBS6csAtev95wgvGc8AELnCMxdIQ9zCLaZzlgBDfxFocVvqNfTHpKQ7xvUCqFil0soxhfOMRh9jAINqQOqvcjZuIPBSbWgcIXQfkCp8YCYG6wK8fbgz8A" + "H9+LhG4lkRRAAAAAElFTkSuQmCC";
  this.ICON_SEARCH_SVG = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMzIgMzIiIGlkPSJHbHlwaCIgdmV" + "yc2lvbj0iMS4xIiB2aWV3Qm94PSIwIDAgMzIgMzIiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6" + "Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxwYXRoIGQ9Ik0yNy40MTQsMjQuNTg2bC01LjA3Ny01LjA3N0MyMy4zODYsMTcuOTI4LDI0LDE2LjAzNSwyNCwxNGMwLTUuNTE0LTQuNDg2L" + "TEwLTEwLTEwUzQsOC40ODYsNCwxNCAgczQuNDg2LDEwLDEwLDEwYzIuMDM1LDAsMy45MjgtMC42MTQsNS41MDktMS42NjNsNS4wNzcsNS4wNzdjMC43OCwwLjc4MSwyLjA0OCwwLjc4MS" + "wyLjgyOCwwICBDMjguMTk1LDI2LjYzMywyOC4xOTUsMjUuMzY3LDI3LjQxNCwyNC41ODZ6IE03LDE0YzAtMy44NiwzLjE0LTcsNy03czcsMy4xNCw3LDdzLTMuMTQsNy03LDdTNywxNy4" + "4Niw3LDE0eiIgaWQ9IlhNTElEXzIyM18iLz48L3N2Zz4=";
  this.ICON_FILTER = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAPhJREFUOE/N078rxWEUx/HXpYz+ABN2A4q6ZTBZkCy" + "3rMomm7qDukWxir9BpKRYLW7Rne5kpvwHRj+io+dbt2/fr68fi7M9z/mcd+d8zvPU/DFqGMYu+n/IekMzAKPoYgAX34Qs4BnjAYiYwyW2sFcBaWIbS1GTAaJmHftYwXEJZBmn2MBhaHoB" + "cT7AKmbRyUEmcI0jrGW5PCCMPMckpvGYhEMJeId5vJYB4n4QN8mkmSRsJ5PreOrtLN9BlovV3iNmjjjDCB7y3pQBQveORio4KfDrM/W/AS+4wi1avxlhETsYSz4UjvuVB1HXlzYxhc2i1" + "1kFqPxbH57RKFOftCADAAAAAElFTkSuQmCC";
  this.ICON_FILTER_SVG = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgaWQ9IkxheWVyXzEiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDI0" + "IDI0OyIgdmVyc2lvbj0iMS4xIiB2aWV3Qm94PSIwIDAgMjQgMjQiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpb" + "ms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGw6bm9uZTtzdHJva2U6IzAwMDAwMDtzdHJva2Utd2lkdGg6MS42Nz" + "I0O3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9Cgkuc3Qxe2ZpbGw6bm9uZTtzdHJva2U6IzAwMDAwMDtzdHJva2U" + "td2lkdGg6MS41O3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9Cgkuc3Qye2ZpbGw6bm9uZTtzdHJva2U6IzAwMDAw" + "MDtzdHJva2Utd2lkdGg6MS41O3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9Cjwvc3R5bGU+PGc+PGc+PGc+PHBhdGggZD0iTTIyLjIsMS41bC04LjUsM" + "TEuMmMtMC4yLDAuMy0wLjMsMC42LTAuMywwLjl2Ny44bC0yLjcsMC44di04LjZjMC0wLjMtMC4xLTAuNi0wLjMtMC45TDEuOCwxLjVIMjIuMiBNMjIuOCwwSDEuMiAgICAgYy0xLDAtMS" + "41LDEuMS0wLjksMS45bDguOSwxMS44djkuNmMwLDAuNCwwLjMsMC43LDAuNywwLjdjMC4xLDAsMC4xLDAsMC4yLDBsNC4zLTEuM2MwLjMtMC4xLDAuNS0wLjQsMC41LTAuN3YtOC4zbDg" + "uOS0xMS44ICAgICBDMjQuMywxLjEsMjMuOCwwLDIyLjgsMEwyMi44LDB6Ii8+PC9nPjwvZz48L2c+PC9zdmc+";
  this.ICON_EYE = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAQJJREFUOE+1080qxVEUBfDfnZABGWNCyUDJSDyCJ2BiJu" + "V7aoKYMJCirq8p5QV4CMxkyIjyBsiEto7a3e4tt5sz+f/P3uuss9Y651S0OCotrvcvBN1YwBQG8YUnXOEYz1l1rYJZ7KOzgbU3rBfMDyQTbGCrLPwswIsyn8E22sr8EKuZYBqXadc1POC" + "0WJjDCHYTZhFHoWAIt+hKzZ5S6yu18D2G14T5wHgQDOMOHanZixtkggm81COI2goOaizc4yxZGMVOwiyh+htifE8QXmNEiBHqeYMQq1gO8nwK8R/hbaK9wTG+l/5eUVb3JvZjHpMYKESP" + "uP7LRWr6afzLW2hKxTf9UTFvsYQFoAAAAABJRU5ErkJggg==";
  this.ICON_EYE_SVG = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cD" + "ovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDI0IDI0IiBoZWlnaHQ9IjI0cHgiIGlkPSJMYXl" + "lcl8xIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0cHgiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2" + "ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxnPjxnPjxwYXRoIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEyLDRDNC4wNjMsNC0wLjAxMiwxMi0wL" + "jAxMiwxMlMzLjA2MywyMCwxMiwyMCAgICBjOC4wOTMsMCwxMi4wMTEtNy45NjksMTIuMDExLTcuOTY5UzIwLjA2Miw0LDEyLDR6IE0xMi4wMTgsMTdjLTIuOTAyLDAtNS0yLjE4OC01LT" + "VjMC0yLjgxMywyLjA5OC01LDUtNWMyLjkwMiwwLDUsMi4xODcsNSw1ICAgIEMxNy4wMTgsMTQuODEyLDE0LjkyLDE3LDEyLjAxOCwxN3ogTTEyLjAxOCw5Yy0xLjY1OCwwLjAwMy0zLDE" + "uMzkzLTMsM2MwLDEuNjA2LDEuMzQyLDMsMywzYzEuNjU4LDAsMy0xLjM5NSwzLTMgICAgQzE1LjAxOCwxMC4zOTIsMTMuNjc2LDguOTk3LDEyLjAxOCw5eiIgZmlsbC1ydWxlPSJldmVu" + "b2RkIi8+PC9nPjwvZz48L3N2Zz4=";
});
rtl.module("WEBLib.Grids",["System","Classes","JS","WEBLib.Controls","WEBLib.Graphics","Web","DB","jsdelphisystem","WEBLib.Menus","WEBLib.StdCtrls","WEBLib.Mask","WEBLib.Ctrls.SVG","Types"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.TInitMethod = {"0": "imRandom", imRandom: 0, "1": "imLinear", imLinear: 1};
  this.$rtti.$Enum("TInitMethod",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TInitMethod});
  rtl.recNewT(this,"TGridRect",function () {
    this.Left = 0;
    this.Top = 0;
    this.Right = 0;
    this.Bottom = 0;
    this.$eq = function (b) {
      return (this.Left === b.Left) && (this.Top === b.Top) && (this.Right === b.Right) && (this.Bottom === b.Bottom);
    };
    this.$assign = function (s) {
      this.Left = s.Left;
      this.Top = s.Top;
      this.Right = s.Right;
      this.Bottom = s.Bottom;
      return this;
    };
    var $r = $mod.$rtti.$Record("TGridRect",{},this);
    $r.addField("Left",rtl.longint);
    $r.addField("Top",rtl.longint);
    $r.addField("Right",rtl.longint);
    $r.addField("Bottom",rtl.longint);
  });
  rtl.recNewT(this,"TGridCoord",function () {
    this.X = 0;
    this.Y = 0;
    this.$eq = function (b) {
      return (this.X === b.X) && (this.Y === b.Y);
    };
    this.$assign = function (s) {
      this.X = s.X;
      this.Y = s.Y;
      return this;
    };
    var $r = $mod.$rtti.$Record("TGridCoord",{},this);
    $r.addField("X",rtl.longint);
    $r.addField("Y",rtl.longint);
  });
  this.TGridOption = {"0": "goFixedVertLine", goFixedVertLine: 0, "1": "goFixedHorzLine", goFixedHorzLine: 1, "2": "goVertLine", goVertLine: 2, "3": "goHorzLine", goHorzLine: 3, "4": "goRangeSelect", goRangeSelect: 4, "5": "goDrawFocusSelected", goDrawFocusSelected: 5, "6": "goRowSizing", goRowSizing: 6, "7": "goColSizing", goColSizing: 7, "8": "goRowMoving", goRowMoving: 8, "9": "goColMoving", goColMoving: 9, "10": "goEditing", goEditing: 10, "11": "goTabs", goTabs: 11, "12": "goRowSelect", goRowSelect: 12, "13": "goAlwaysShowEditor", goAlwaysShowEditor: 13, "14": "goThumbTracking", goThumbTracking: 14, "15": "goFixedColClick", goFixedColClick: 15, "16": "goFixedRowClick", goFixedRowClick: 16, "17": "goFixedHotTrack", goFixedHotTrack: 17, "18": "goFixedRowDefAlign", goFixedRowDefAlign: 18};
  this.$rtti.$Enum("TGridOption",{minvalue: 0, maxvalue: 18, ordtype: 1, enumtype: this.TGridOption});
  this.TGridDrawState$a = {"0": "gdSelected", gdSelected: 0, "1": "gdFocused", gdFocused: 1, "2": "gdFixed", gdFixed: 2, "3": "gdRowSelected", gdRowSelected: 3, "4": "gdHotTrack", gdHotTrack: 4, "5": "gdPressed", gdPressed: 5};
  this.$rtti.$Enum("TGridDrawState$a",{minvalue: 0, maxvalue: 5, ordtype: 1, enumtype: this.TGridDrawState$a});
  this.$rtti.$Set("TGridDrawState",{comptype: this.$rtti["TGridDrawState$a"]});
  this.TGridSortIndicator = {"0": "siNone", siNone: 0, "1": "siAscending", siAscending: 1, "2": "siDescending", siDescending: 2};
  this.$rtti.$Enum("TGridSortIndicator",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TGridSortIndicator});
  this.TGridCellEditor = {"0": "geText", geText: 0, "1": "geNumber", geNumber: 1, "2": "geDate", geDate: 2, "3": "geTime", geTime: 3, "4": "geRange", geRange: 4, "5": "geColor", geColor: 5, "6": "geWeek", geWeek: 6, "7": "geMonth", geMonth: 7, "8": "geURL", geURL: 8, "9": "geEmail", geEmail: 9, "10": "geTel", geTel: 10, "11": "geMask", geMask: 11, "12": "geCombo", geCombo: 12, "13": "geMemo", geMemo: 13, "14": "geNone", geNone: 14, "15": "geCustom", geCustom: 15};
  this.$rtti.$Enum("TGridCellEditor",{minvalue: 0, maxvalue: 15, ordtype: 1, enumtype: this.TGridCellEditor});
  this.$rtti.$Set("TGridOptions",{comptype: this.$rtti["TGridOption"]});
  this.$rtti.$MethodVar("TGridGetCellDataEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["AField",pas.DB.$rtti["TField"]],["AValue",rtl.string,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TGridGetCellClassEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["AField",pas.DB.$rtti["TField"]],["AValue",rtl.string],["AClassName",rtl.string,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TGridGetCellChildrenEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["AField",pas.DB.$rtti["TField"]],["AValue",rtl.string],["AElement",pas["WEBLib.Controls"].$rtti["TJSHTMLElementRecord"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TGridGetCellEditorEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["AEditor",this.$rtti["TGridCellEditor"],1]]), methodkind: 0});
  this.$rtti.$MethodVar("TGridRequestEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ARequest",pas["WEBLib.Controls"].$rtti["TJSXMLHttpRequestRecord"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TGridSortClickEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["ASortIndicator",this.$rtti["TGridSortIndicator"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TDrawCellEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["Rect",pas.Types.$rtti["TRect"]],["State",this.$rtti["TGridDrawState"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TGetEditEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["Value",rtl.string,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TSetEditEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["Value",rtl.string,2]]), methodkind: 0});
  this.$rtti.$MethodVar("TSetEditControlValueEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["AControl",pas["WEBLib.Controls"].$rtti["TControl"]],["Value",rtl.string,2]]), methodkind: 0});
  this.$rtti.$MethodVar("TGetEditControlValueEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["AControl",pas["WEBLib.Controls"].$rtti["TControl"]],["Value",rtl.string,1]]), methodkind: 0});
  rtl.createClass(this,"TCustomGrid",pas["WEBLib.Menus"].TWebCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Menus"].TWebCustomControl.$init.call(this);
      this.FRowCount = 0;
      this.FColCount = 0;
    };
    this.GetCells = function (ACol, ARow) {
      var Result = "";
      Result = "";
      return Result;
    };
    this.SetCells = function (ACol, ARow, Value) {
    };
    this.GetCellsArray = function () {
      var Result = null;
      var i = 0;
      var j = 0;
      var row = null;
      var s = "";
      Result = new Array();
      for (var $l = this.RowOffset(), $end = this.FRowCount - 1; $l <= $end; $l++) {
        i = $l;
        row = new Array();
        for (var $l1 = this.ColOffset(), $end1 = this.FColCount - 1; $l1 <= $end1; $l1++) {
          j = $l1;
          s = this.GetCells(j,i);
          row.push(s);
        };
        Result.push(row);
      };
      return Result;
    };
    this.SetCellsArray = function (Value) {
      var i = 0;
      var j = 0;
      var ja = null;
      var jv = undefined;
      if ((Value.length + this.RowOffset()) > this.FRowCount) this.SetRowCount(Value.length + this.RowOffset());
      for (var $l = 0, $end = Value.length - 1; $l <= $end; $l++) {
        i = $l;
        ja = Value[i];
        if (rtl.isExt(ja,Array)) {
          if ((ja.length + this.ColOffset()) > this.FColCount) this.SetColCount(ja.length + this.ColOffset());
          for (var $l1 = 0, $end1 = ja.length - 1; $l1 <= $end1; $l1++) {
            j = $l1;
            jv = ja[j];
            this.SetCells(j + this.ColOffset(),i + this.RowOffset(),pas.JS.ToString(jv));
          };
        };
      };
    };
    this.ColOffset = function () {
      var Result = 0;
      Result = 0;
      return Result;
    };
    this.RowOffset = function () {
      var Result = 0;
      Result = 0;
      return Result;
    };
    this.SetColCount = function (Value) {
      var delta = 0;
      if ((this.FColCount !== Value) && (Value >= 0)) {
        delta = Value - this.FColCount;
        this.FColCount = Value;
        if (this.GetElementHandle() != null) {
          this.ColCountChanged(delta);
          this.GridChanged();
        };
      };
    };
    this.SetRowCount = function (Value) {
      var delta = 0;
      if ((this.FRowCount !== Value) && (Value >= 0)) {
        delta = Value - this.FRowCount;
        this.FRowCount = Value;
        if (this.GetElementHandle() != null) {
          this.RowCountChanged(delta);
          this.GridChanged();
        };
      };
    };
    this.GridChanged = function () {
    };
    this.RowCountChanged = function (delta) {
    };
    this.ColCountChanged = function (delta) {
    };
    this.Clear = function () {
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.TGridDrawingStyle = {"0": "gdsClassic", gdsClassic: 0, "1": "gdsThemed", gdsThemed: 1, "2": "gdsGradient", gdsGradient: 2};
  this.$rtti.$Enum("TGridDrawingStyle",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TGridDrawingStyle});
  this.$rtti.$MethodVar("TCellEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TCellCheckEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["Checked",rtl.boolean]]), methodkind: 0});
  this.$rtti.$MethodVar("TCellCanEditEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["CanEdit",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TSelectCellEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["ARow",rtl.longint],["CanSelect",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TColumnSizedEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint]]), methodkind: 0});
  rtl.createClass(this,"TGridRange",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FMax = 0.0;
      this.FMin = 0.0;
      this.FStep = 0.0;
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FMin = 0;
      this.FMax = 100;
      this.FStep = 1;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TGridRange.isPrototypeOf(Source)) {
        this.FMax = rtl.as(Source,$mod.TGridRange).FMax;
        this.FMin = rtl.as(Source,$mod.TGridRange).FMin;
        this.FStep = rtl.as(Source,$mod.TGridRange).FStep;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Min",0,rtl.double,"FMin","FMin",4,{Default: 0});
    $r.addProperty("Max",0,rtl.double,"FMax","FMax",4,{Default: 100});
    $r.addProperty("Step",0,rtl.double,"FStep","FStep",4,{Default: 1});
  });
  rtl.createClass(this,"TCustomStringGrid",this.TCustomGrid,function () {
    this.$init = function () {
      $mod.TCustomGrid.$init.call(this);
      this.FReq = null;
      this.FDataNode = "";
      this.FOrigVal = "";
      this.FGrid = null;
      this.FFixedColor = 0;
      this.FFixedColRow = null;
      this.FFixedRow = null;
      this.FFixedCol = null;
      this.FNormalCells = null;
      this.FDefaultColAlignment = 0;
      this.FDefaultRowHeight = 0;
      this.FDefaultColWidth = 0;
      this.FColWidths = null;
      this.FRowHeights = null;
      this.FColAlignments = null;
      this.FSelectedCell = null;
      this.FEdit = null;
      this.FFixedCols = 0;
      this.FFixedRows = 0;
      this.FEditMode = false;
      this.FBlockFocus = false;
      this.FOnSelectCell = null;
      this.FOnTopLeftChanged = null;
      this.FOptions = {};
      this.FDelimiter = "\x00";
      this.FLoadFixed = false;
      this.FSelection = $mod.TGridRect.$new();
      this.FStartCell = $mod.TGridCoord.$new();
      this.FOnHttpRequestError = null;
      this.FOnHttpRequestSuccess = null;
      this.FOnGetCellClass = null;
      this.FOnGetCellData = null;
      this.FOnGetCellChildren = null;
      this.FScrollBars = 0;
      this.FSelMouseDown = false;
      this.FStyleElements = {};
      this.FDefaultDrawing = false;
      this.FDragCursor = 0;
      this.FDragKind = 0;
      this.FGradientStartColor = 0;
      this.FGradientEndColor = 0;
      this.FEditCol = 0;
      this.FEditRow = 0;
      this.FEditType = 0;
      this.FFixedFont = null;
      this.FCtl3D$1 = false;
      this.FParentCtl3D$1 = false;
      this.FOnGetEditText = null;
      this.FOnSetEditText = null;
      this.FOnHttpRequest = null;
      this.FOnCheckClick = null;
      this.FOnFixedCellClick = null;
      this.FOnValidateEdit = null;
      this.FHandleEditBlurPtr = null;
      this.FHandleEditKeypressPtr = null;
      this.FHandleCheckClickPtr = null;
      this.FHandleButtonClickPtr = null;
      this.FHandleMouseDownPtr = null;
      this.FHandleMouseMovePtr = null;
      this.FHandleMouseUpPtr = null;
      this.FHandleFocusPtr = null;
      this.FHandleBlurPtr = null;
      this.FHandleFixedClickPtr = null;
      this.FHandleClickPtr = null;
      this.FDrawingStyle = 0;
      this.FOnCanEditCell = null;
      this.FOnColumnSized = null;
      this.FRows = null;
      this.FRowsIndex = 0;
      this.FOnGetCellEditor = null;
      this.FCombo = null;
      this.FMemo = null;
      this.FMask = null;
      this.FEditMask = "";
      this.FComboBoxItems = null;
      this.FRange = null;
      this.FShowSelection = false;
      this.FOnClickCell = null;
      this.FElementTableClassName = "";
      this.FGridLineColor = 0;
      this.FSelectionTextColor = 0;
      this.FSelectionColor = 0;
      this.FWordWrap = false;
      this.FOnButtonClick = null;
      this.FSortIndex = 0;
      this.FSortDirection = 0;
      this.FOnSortClick = null;
      this.FHasMergedCells = false;
      this.FObjectRows = null;
      this.FEditAdvance = false;
      this.FEditControl = null;
      this.FOrigID = "";
      this.FOnSetEditControlValue = null;
      this.FOnGetEditControlValue = null;
      this.FOnDblClickCell = null;
      this.FEditorMode = false;
    };
    this.$final = function () {
      this.FReq = undefined;
      this.FGrid = undefined;
      this.FFixedColRow = undefined;
      this.FFixedRow = undefined;
      this.FFixedCol = undefined;
      this.FNormalCells = undefined;
      this.FColWidths = undefined;
      this.FRowHeights = undefined;
      this.FColAlignments = undefined;
      this.FSelectedCell = undefined;
      this.FEdit = undefined;
      this.FOnSelectCell = undefined;
      this.FOnTopLeftChanged = undefined;
      this.FOptions = undefined;
      this.FSelection = undefined;
      this.FStartCell = undefined;
      this.FOnHttpRequestError = undefined;
      this.FOnHttpRequestSuccess = undefined;
      this.FOnGetCellClass = undefined;
      this.FOnGetCellData = undefined;
      this.FOnGetCellChildren = undefined;
      this.FStyleElements = undefined;
      this.FFixedFont = undefined;
      this.FOnGetEditText = undefined;
      this.FOnSetEditText = undefined;
      this.FOnHttpRequest = undefined;
      this.FOnCheckClick = undefined;
      this.FOnFixedCellClick = undefined;
      this.FOnValidateEdit = undefined;
      this.FOnCanEditCell = undefined;
      this.FOnColumnSized = undefined;
      this.FRows = undefined;
      this.FOnGetCellEditor = undefined;
      this.FCombo = undefined;
      this.FMemo = undefined;
      this.FMask = undefined;
      this.FComboBoxItems = undefined;
      this.FRange = undefined;
      this.FOnClickCell = undefined;
      this.FOnButtonClick = undefined;
      this.FOnSortClick = undefined;
      this.FObjectRows = undefined;
      this.FEditControl = undefined;
      this.FOnSetEditControlValue = undefined;
      this.FOnGetEditControlValue = undefined;
      this.FOnDblClickCell = undefined;
      $mod.TCustomGrid.$final.call(this);
    };
    this.GetCells = function (ACol, ARow) {
      var Result = "";
      var td = null;
      td = this.CellRealElement(ACol,ARow);
      if (!(td != null)) {
        Result = "";
        return Result;
      };
      if (this.FWordWrap) {
        if (td.firstChild != null) td = td.firstChild;
      };
      Result = td.textContent;
      return Result;
    };
    this.SetCells = function (ACol, ARow, Value) {
      var rc = 0;
      var rr = 0;
      var rh = 0;
      var StrVal = "";
      var cn = "";
      var el = null;
      if ((ARow < 0) || (ACol < 0)) return;
      StrVal = Value;
      if (pas.System.Pos("\r",Value) > 0) {
        StrVal = pas.SysUtils.StringReplace(StrVal,"\r","<BR>",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
        StrVal = pas.SysUtils.StringReplace(StrVal,"\n","<BR>",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
      } else if (pas.System.Pos("\n",Value) > 0) {
        StrVal = pas.SysUtils.StringReplace(StrVal,"\n","<BR>",rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
      };
      if (this.FWordWrap) {
        rh = this.GetRowHeights(ARow) - 2;
        StrVal = '<DIV class="cell" style="height:' + pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
            return rh;
          }, set: function (v) {
            rh = v;
          }}) + "px;max-height:" + pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
            return rh;
          }, set: function (v) {
            rh = v;
          }}) + 'px">' + StrVal + "</DIV>";
      };
      el = this.CellRealElement(ACol,ARow);
      if (el != null) {
        el.innerHTML = StrVal;
        cn = "";
        this.GetCellClassName(ACol,ARow,null,StrVal,{get: function () {
            return cn;
          }, set: function (v) {
            cn = v;
          }});
        if (cn !== "") el.setAttribute("class",cn);
      };
      if (ARow === 0) this.EnableColResize();
    };
    this.SetFixedCols = function (Value) {
      if (this.FFixedCols !== Value) {
        this.FFixedCols = Value;
        if (!this.IsUpdating()) this.ReRenderGrid();
      };
    };
    this.SetFixedRows = function (Value) {
      if (this.FFixedRows !== Value) {
        this.FFixedRows = Value;
        if (!this.IsUpdating()) this.ReRenderGrid();
      };
    };
    this.SetColor = function (AValue) {
      if (this.FColor !== AValue) {
        this.FColor = AValue;
        this.UpdateElement();
      };
    };
    this.GetColWidths = function (ACol) {
      var Result = 0;
      if (ACol < this.FColWidths.GetCount()) {
        Result = rtl.trunc(this.FColWidths.Get(ACol))}
       else Result = this.FDefaultColWidth;
      return Result;
    };
    this.GetRowHeights = function (ARow) {
      var Result = 0;
      if (ARow < this.FRowHeights.GetCount()) {
        Result = rtl.trunc(this.FRowHeights.Get(ARow))}
       else Result = this.FDefaultRowHeight;
      return Result;
    };
    this.SetColWidths = function (ACol, Value) {
      var fcw = 0;
      var nw = 0;
      var nwvis = 0;
      var nwvisnoscroll = 0;
      var LAutoSizeW = false;
      while (this.FColWidths.GetCount() <= ACol) this.FColWidths.Add(this.FDefaultColWidth);
      this.FColWidths.Put(ACol,Value);
      if (this.IsUpdating()) return;
      if (!(this.FGrid != null)) return;
      LAutoSizeW = this.FWidthStyle === pas["WEBLib.Controls"].TSizeStyle.ssAuto;
      nw = this.NormalColWidth();
      nwvis = this.GetWidth() - this.FixedColWidth();
      nwvisnoscroll = nwvis - pas["WEBLib.Controls"].GetScrollBarWidth();
      if (ACol < this.FFixedCols) {
        fcw = this.FixedColWidth();
        var tr = this.FGrid.rows[0];
              if (tr != undefined) {
              var td = tr.cells[0];
              if (td != undefined) {
                td.style.width = fcw + "px";
                if (td.firstChild != undefined) {
                td.firstChild.style.width = fcw + "px"; }
                }
              }
        
              tr = this.FGrid.rows[1];
              if (tr != undefined) {
              td = tr.cells[0];
              if (td != undefined) {
                td.style.width = fcw + "px";
                if (td.firstChild != undefined) {
                td.firstChild.style.width = fcw + "px"; }
                }
        
              tr = this.FFixedColRow.rows[0];
              if (tr != undefined) {
        
              td = tr.cells[0];
              if (td != undefined) {
                td.style.width = fcw + "px";
                }
                }
              }
              tr = this.FFixedCol.rows[0];
              if (tr != undefined) {
        
              td = tr.cells[0];
              if (td != undefined) {
                td.style.width = fcw + "px";
                }
              };
      };
      if (ACol >= this.FFixedCols) {
        ACol = ACol - this.FFixedCols;
        var tr = this.FFixedRow.rows[0];
              if (tr != undefined) {
                var td = tr.cells[ACol];
                td.style.width = Value + "px";
                td.style.maxwidth = Value + "px";
        
                if (this.FNormalCells.rows.length > 0)
                {
                var td = this.FNormalCells.rows[0].cells[ACol];
                td.style.width = Value + "px";
                td.style.maxwidth = Value + "px";
                }
              };
      };
      var tr = this.FGrid.rows[0];
      if (tr != undefined) {
        var td = tr.cells[1];
        if ((td.firstChild != undefined) && (!LAutoSizeW)) {
        td.firstChild.style.width = nwvisnoscroll + "px";
        td.firstChild.firstChild.style.width = nw + "px";
        }
      }
      tr = this.FGrid.rows[1];
      if (tr != undefined) {
        td = tr.cells[1];
        if ((td.firstChild != undefined) && (!LAutoSizeW)) {
        td.firstChild.style.width = nwvis + "px";
        td.firstChild.firstChild.style.width = nw + "px";
        }
      };
      this.UpdateGridSize();
    };
    this.SetRowHeights = function (ARow, Value) {
      var frh = 0;
      var rh = 0;
      var fh = 0;
      var nh = 0;
      var nhvis = 0;
      var nhvisnoscroll = 0;
      while (this.FRowHeights.GetCount() <= ARow) this.FRowHeights.Add(this.FDefaultRowHeight);
      this.FRowHeights.Put(ARow,Value);
      if (this.IsUpdating()) return;
      if (!(this.FGrid != null)) return;
      fh = this.FixedRowHeight();
      nh = this.NormalRowHeight();
      nhvis = this.GetHeight() - this.FixedRowHeight();
      if ((this.FixedColWidth() + this.NormalColWidth()) < this.GetWidth()) {
        nhvisnoscroll = nhvis}
       else nhvisnoscroll = nhvis - pas["WEBLib.Controls"].GetScrollBarHeight();
      if (ARow < this.FFixedRows) {
        frh = this.FixedRowHeight();
        var tr = this.FGrid.rows[0];
              if (tr != undefined) {
                tr.style.height = frh + "px";
                var td = tr.cells[0];
                if (td != undefined) {
                  var fc = td.firstChild;
                  if (fc != undefined) {
                    fc.style.height = frh + "px";
                  }
                  td = tr.cells[1];
                  fc = td.firstChild;
                  if (fc != undefined) {
                    fc.style.height = frh + "px";
                  }
                  }
                }
        
              tr = this.FFixedColRow.rows[0];
              if (tr != undefined) {
                 tr = tr.cells[0];
                 if (tr != undefined) {
                 tr.style.height = Value + "px";
                 tr = this.FFixedRow.rows[ARow].cells[0];
                 if (tr != undefined) {
                 tr.style.height = Value + "px"; }
                 }
              };
      };
      if (ARow >= this.FFixedRows) {
        ARow = ARow - this.FFixedRows;
        rh = Value;
        if (this.HasHorzScrollBar() && this.HasVertScrollBar() && (ARow === (this.FRowCount - 1))) rh = Value + this.FNormalCells.parentElement.scrollHeight;
        var tr = this.FFixedCol.rows[ARow];
              if (tr != undefined) {
              tr.style.height = Value + "px";
              var tr = this.FNormalCells.rows[ARow];
        
              if (tr != undefined) {
              tr.style.height = rh + "px"; }
              };
      };
      var td = this.FGrid.rows[1].cells[0];
          if (td.firstChild) {
          td.firstChild.style.height = nhvisnoscroll + "px";
          td.firstChild.firstChild.style.height = nh + "px";
          }
      
          td = this.FGrid.rows[1].cells[1];
          if (td.firstChild) {
          td.firstChild.style.height = nhvis + "px";
          td.firstChild.firstChild.style.height = nh + "px";
          };
    };
    this.SetDefaultColWidth = function (Value) {
      var i = 0;
      this.FDefaultColWidth = Value;
      for (var $l = 0, $end = this.FColCount - 1; $l <= $end; $l++) {
        i = $l;
        this.SetColWidths(i,Value);
      };
    };
    this.SetDefaultRowHeight = function (Value) {
      var i = 0;
      this.FDefaultRowHeight = Value;
      for (var $l = 0, $end = this.FRowCount - 1; $l <= $end; $l++) {
        i = $l;
        this.SetRowHeights(i,Value);
      };
    };
    this.GetCol = function () {
      var Result = 0;
      var res = 0;
      res = -1;
      if (this.FSelectedCell != null) {
        res = this.FSelectedCell.cellIndex;
        res = res + this.FFixedCols;
      };
      Result = res;
      return Result;
    };
    this.GetRow = function () {
      var Result = 0;
      var res = 0;
      res = -1;
      if (this.FSelectedCell != null) {
        res = this.FSelectedCell.parentElement.rowIndex;
        res = res + this.FFixedRows;
      };
      Result = res;
      return Result;
    };
    this.SetCol = function (Value) {
      var r = 0;
      var c = 0;
      var td = null;
      if ((Value < this.FColCount) && (Value >= this.FFixedCols)) {
        if (this.FSelectedCell != null) {
          this.RemoveSelection(this.FSelectedCell);
        };
        c = Value - this.FFixedCols;
        r = this.GetRow() - this.FFixedRows;
        if (r < 0) r = 0;
        var tr = this.FNormalCells.rows[r];
        td = tr.cells[c];
        this.AddSelection(td);
        this.FSelectedCell = td;
        var pardiv = this.FNormalCells.parentElement.parentElement;
        
               if (td.offsetLeft < pardiv.scrollLeft) {
                 pardiv.scrollLeft = td.offsetLeft;
               }
        
               if (td.offsetLeft + td.offsetWidth - pardiv.scrollLeft > pardiv.offsetWidth) {
                 pardiv.scrollLeft = pardiv.scrollLeft + td.offsetWidth;
               };
      };
    };
    this.SetRow = function (Value) {
      var r = 0;
      var c = 0;
      var sh = 0;
      var rselect = false;
      var tr = null;
      var td = null;
      if ((Value < this.FRowCount) && (Value >= this.FFixedRows)) {
        rselect = $mod.TGridOption.goRowSelect in this.FOptions;
        if ((this.FSelectedCell != null) && rselect) {
          tr = this.FSelectedCell.parentElement;
          this.RemoveSelection(tr);
        };
        if (this.FSelectedCell != null) {
          this.RemoveSelection(this.FSelectedCell);
        };
        c = this.GetCol() - this.FFixedCols;
        if (c < 0) c = 0;
        r = Value - this.FFixedRows;
        if ((this.FixedColWidth() + this.NormalColWidth()) < this.GetWidth()) {
          sh = 0}
         else sh = pas["WEBLib.Controls"].GetScrollBarHeight();
        tr = this.FNormalCells.rows[r];
        td = tr.cells[c];
        if (rselect) {
          if (!pas.JS.isUndefined(this.FSelectedCell)) this.RemoveSelection(this.FSelectedCell);
          this.AddSelection(tr);
          this.FSelectedCell = td;
        } else {
          this.FSelectedCell = td;
          this.AddSelection(this.FSelectedCell);
        };
        var pardiv = this.FNormalCells.parentElement.parentElement;
              var st = 0;
              if (td.offsetTop < pardiv.scrollTop) {
                pardiv.scrollTop = td.offsetTop;
              }
        
              if (td.offsetHeight > 0) {
                while (td.offsetTop + td.offsetHeight - pardiv.scrollTop > pardiv.offsetHeight - sh)  {
                  st = pardiv.scrollTop;
                  pardiv.scrollTop = pardiv.scrollTop + td.offsetHeight;
                  if (pardiv.scrollTop === st) {
                    break; }
                }
              };
      };
    };
    this.GetCellElements = function (ACol, ARow) {
      var Result = null;
      Result = this.CellRealElement(ACol,ARow);
      return Result;
    };
    this.GetCheckElement = function (ACol, ARow) {
      var Result = null;
      var el = null;
      Result = null;
      if ((ACol < this.FColCount) && (ARow < this.FRowCount)) {
        el = this.GetCellElements(ACol,ARow).firstChild;
        if ((el != null) && rtl.isExt(el,Element)) {
          if (el.hasAttribute("type") && (pas.SysUtils.UpperCase(el.getAttribute("type")) === "CHECKBOX")) {
            Result = el;
          };
        };
      };
      return Result;
    };
    this.GetCanvasElement = function (ACol, ARow) {
      var Result = null;
      var el = null;
      Result = null;
      if ((ACol < this.FColCount) && (ARow < this.FRowCount)) {
        el = this.GetCellElements(ACol,ARow).firstChild;
        if ((el != null) && rtl.isExt(el,Element)) {
          if (pas.SysUtils.UpperCase(el.tagName) === "CANVAS") {
            Result = el;
          };
        };
      };
      return Result;
    };
    this.GetButtonElement = function (ACol, ARow) {
      var Result = null;
      var el = null;
      Result = null;
      if ((ACol < this.FColCount) && (ARow < this.FRowCount)) {
        el = this.GetCellElements(ACol,ARow).firstChild;
        if ((el != null) && rtl.isExt(el,Element)) {
          if (pas.SysUtils.UpperCase(el.tagName) === "BUTTON") {
            Result = el;
          };
        };
      };
      return Result;
    };
    this.GetProgressElement = function (ACol, ARow) {
      var Result = null;
      var el = null;
      Result = null;
      if ((ACol < this.FColCount) && (ARow < this.FRowCount)) {
        el = this.GetCellElements(ACol,ARow).firstChild;
        if ((el != null) && rtl.isExt(el,Element)) {
          if (pas.SysUtils.UpperCase(el.tagName) === "PROGRESS") {
            Result = el;
          };
        };
      };
      return Result;
    };
    this.GetSelection = function () {
      var Result = $mod.TGridRect.$new();
      Result.$assign(this.FSelection);
      return Result;
    };
    this.SetSelection = function (Value) {
      var c = 0;
      var r = 0;
      var rc = 0;
      var rr = 0;
      var sel = false;
      var left = 0;
      var right = 0;
      var top = 0;
      var bottom = 0;
      var tr = null;
      var td = null;
      this.FSelection.$assign(Value);
      left = Value.Left;
      right = Value.Right;
      if (Value.Left > Value.Right) {
        left = Value.Right;
        right = Value.Left;
      };
      top = Value.Top;
      bottom = Value.Bottom;
      if (Value.Top > Value.Bottom) {
        top = Value.Bottom;
        bottom = Value.Top;
      };
      for (var $l = this.FFixedRows, $end = this.FRowCount - 1; $l <= $end; $l++) {
        r = $l;
        if ($mod.TGridOption.goRowSelect in this.FOptions) {
          rr = r - this.FFixedRows;
          sel = (r >= top) && (r <= bottom);
          if (sel) {
            tr = this.FNormalCells.rows[rr];
            this.AddSelection(tr);
          } else {
            tr = this.FNormalCells.rows[rr];
            this.RemoveSelection(tr);
          };
        } else for (var $l1 = this.FFixedCols, $end1 = this.FColCount - 1; $l1 <= $end1; $l1++) {
          c = $l1;
          rc = c - this.FFixedCols;
          rr = r - this.FFixedRows;
          sel = (c >= left) && (c <= right) && (r >= top) && (r <= bottom);
          if (sel) {
            td = this.FNormalCells.rows[rr].cells[rc];
            if (td != null) this.AddSelection(td);
          } else {
            td = this.FNormalCells.rows[rr].cells[rc];
            if (td != null) this.RemoveSelection(td);
          };
        };
      };
    };
    this.GetLeftCol = function () {
      var Result = 0;
      var i = 0;
      var w = 0;
      var l = 0;
      Result = this.FFixedCols;
      if (this.FNormalCells != null) {
        l = this.FNormalCells.parentElement.parentElement.scrollLeft;
        w = 0;
        for (var $l = this.FFixedCols, $end = this.FColCount - 1; $l <= $end; $l++) {
          i = $l;
          if (l <= w) {
            Result = i;
            break;
          };
          w = (w + this.GetColWidths(i) + 1) - 0;
        };
      };
      return Result;
    };
    this.GetTopRow = function () {
      var Result = 0;
      var pixVal = 0;
      Result = this.FFixedRows;
      if ((this.FNormalCells != null) && (pixVal >= 0)) {
        pixVal = this.FNormalCells.parentElement.parentElement.scrollTop;
        Result = this.FFixedRows + rtl.trunc(pixVal / this.FDefaultRowHeight);
      };
      return Result;
    };
    this.SetLeftCol = function (Value) {
      var i = 0;
      var w = 0;
      w = 0;
      for (var $l = this.FFixedCols, $end = Value - 1; $l <= $end; $l++) {
        i = $l;
        w = (w + this.GetColWidths(i) + 1) - 0;
      };
      if (this.FNormalCells != null) {
        this.FNormalCells.parentElement.parentElement.scrollLeft = w;
        if (this.FFixedCols > 0) this.FFixedCol.parentElement.parentElement.scrollLeft = w;
      };
    };
    this.SetTopRow = function (Value) {
      var pixVal = 0;
      pixVal = (Value - this.FFixedRows) * this.FDefaultRowHeight;
      if ((this.FNormalCells != null) && (pixVal >= 0)) {
        this.FNormalCells.parentElement.parentElement.scrollTop = pixVal;
        if (this.FFixedCols > 0) this.FFixedCol.parentElement.parentElement.scrollTop = pixVal;
      };
    };
    this.SetFixedColor = function (Value) {
      if (this.FFixedColor !== Value) {
        this.FFixedColor = Value;
        this.UpdateElementVisual();
      };
    };
    this.SetFixedTextColor = function (Value) {
      if (this.FFixedFont.FColor !== Value) {
        this.FFixedFont.SetColor(Value);
        this.UpdateElementVisual();
      };
    };
    this.GetFixedTextColor = function () {
      var Result = 0;
      Result = this.FFixedFont.FColor;
      return Result;
    };
    this.GetVisibleColCount = function () {
      var Result = 0;
      var i = 0;
      var el = null;
      var cr = null;
      var gr = null;
      i = this.GetLeftCol();
      gr = this.GetElementHandle().getBoundingClientRect();
      while (i < this.FColCount) {
        el = this.GetCellElements(i,this.FFixedRows);
        cr = el.getBoundingClientRect();
        if (cr.right > gr.right) break;
        i += 1;
      };
      Result = i - this.GetLeftCol();
      return Result;
    };
    this.GetVisibleRowCount = function () {
      var Result = 0;
      var i = 0;
      var el = null;
      var cr = null;
      var gr = null;
      i = this.GetTopRow();
      gr = this.GetElementHandle().getBoundingClientRect();
      while (i < this.FRowCount) {
        el = this.GetCellElements(this.FFixedCols,i);
        cr = el.getBoundingClientRect();
        if (cr.bottom > gr.bottom) break;
        i += 1;
      };
      Result = i - this.GetTopRow();
      return Result;
    };
    this.GetRows = function (Index) {
      var Result = null;
      var i = 0;
      if ((Index >= 0) && (Index < this.FRowCount)) {
        this.FRowsIndex = Index;
        this.FRows.Clear();
        for (var $l = 0, $end = this.FColCount - 1; $l <= $end; $l++) {
          i = $l;
          this.FRows.Add(this.GetCells(i,Index));
        };
        Result = this.FRows;
      } else throw pas.SysUtils.Exception.$create("Create$1",["Invalid row index"]);
      return Result;
    };
    this.SetRows = function (Index, Value) {
      var i = 0;
      if ((Index >= 0) && (Index < this.FRowCount)) {
        for (var $l = 0, $end = this.FColCount - 1; $l <= $end; $l++) {
          i = $l;
          if (i < Value.GetCount()) this.SetCells(i,Index,Value.Get(i));
        };
      } else throw pas.SysUtils.Exception.$create("Create$1",["Invalid row index"]);
    };
    this.RowsChanged = function (Sender) {
      this.SetRows(this.FRowsIndex,this.FRows);
    };
    this.GetCheckState = function (ACol, ARow) {
      var Result = false;
      var el = null;
      var res = false;
      Result = false;
      if ((ACol < this.FColCount) && (ARow < this.FRowCount)) {
        el = this.GetCheckElement(ACol,ARow);
        if (el != null) {
          res = el.checked;
          Result = res;
        };
      };
      return Result;
    };
    this.SetCheckState = function (ACol, ARow, Value) {
      var el = null;
      if ((ACol < this.FColCount) && (ARow < this.FRowCount)) {
        el = this.GetCheckElement(ACol,ARow);
        el.checked = Value;
      };
    };
    this.GetCheckEnabled = function (ACol, ARow) {
      var Result = false;
      var el = null;
      var res = false;
      Result = false;
      if ((ACol < this.FColCount) && (ARow < this.FRowCount)) {
        el = this.GetCheckElement(ACol,ARow);
        if (el != null) {
          res = el.disabled;
          Result = !res;
        };
      };
      return Result;
    };
    this.SetCheckEnabled = function (ACol, ARow, Value) {
      var el = null;
      var v = false;
      if ((ACol < this.FColCount) && (ARow < this.FRowCount)) {
        v = !Value;
        el = this.GetCheckElement(ACol,ARow);
        el.disabled = v;
      };
    };
    this.SetRange = function (Value) {
      this.FRange.Assign(Value);
    };
    this.SetElementTableClassName = function (Value) {
      if (this.FElementTableClassName !== Value) {
        this.FElementTableClassName = Value;
        if (!this.IsUpdating()) this.ReRenderGrid();
      };
    };
    this.SetGridLineColor = function (Value) {
      if (this.FGridLineColor !== Value) {
        this.FGridLineColor = Value;
        this.UpdateElement();
      };
    };
    this.SetSelectionColor = function (Value) {
      if (this.FSelectionColor !== Value) {
        this.FSelectionColor = Value;
        this.UpdateElement();
      };
    };
    this.SetSelectionTextColor = function (Value) {
      if (this.FSelectionTextColor !== Value) {
        this.FSelectionTextColor = Value;
        this.UpdateElement();
      };
    };
    this.GetColAlignments = function (ACol) {
      var Result = 0;
      if (ACol < this.FColAlignments.GetCount()) {
        Result = this.FColAlignments.Get(ACol)}
       else Result = this.FDefaultColAlignment;
      return Result;
    };
    this.SetColAlignments = function (ACol, Value) {
      while (this.FColAlignments.GetCount() <= ACol) this.FColAlignments.Add(pas.Classes.TAlignment.taLeftJustify);
      this.FColAlignments.Put(ACol,Value);
      this.UpdateGridAlignment();
    };
    this.SetAlignAttr = function (AAlign, AElement) {
      var $tmp = AAlign;
      if ($tmp === pas.Classes.TAlignment.taLeftJustify) {
        AElement.removeAttribute("align")}
       else if ($tmp === pas.Classes.TAlignment.taCenter) {
        AElement.setAttribute("align","center")}
       else if ($tmp === pas.Classes.TAlignment.taRightJustify) AElement.setAttribute("align","right");
    };
    this.SetSortIndex = function (Value) {
      var i = 0;
      this.FSortIndex = Value;
      for (var $l = 0, $end = this.FColCount - 1; $l <= $end; $l++) {
        i = $l;
        this.SelectSortIndicator(i,0,i === this.FSortIndex);
      };
    };
    this.SetDefaultColAlignment = function (Value) {
      if (this.FDefaultColAlignment !== Value) {
        this.FDefaultColAlignment = Value;
        if (!(pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) this.ReRenderGrid();
      };
    };
    this.GetObjects = function (ACol, ARow) {
      var Result = null;
      var LObjr = null;
      Result = null;
      if (this.FObjectRows.GetCount() > ARow) {
        LObjr = rtl.getObject(this.FObjectRows.Get(ARow));
        if (LObjr.GetCount() > ACol) Result = rtl.getObject(LObjr.Get(ACol));
      };
      return Result;
    };
    this.SetObjects = function (ACol, ARow, Value) {
      var LObjr = null;
      while (this.FObjectRows.GetCount() <= ARow) {
        LObjr = pas.Classes.TList.$create("Create$1");
        this.FObjectRows.Add(LObjr);
      };
      LObjr = rtl.getObject(this.FObjectRows.Get(ARow));
      while (LObjr.GetCount() <= ACol) {
        LObjr.Add(null);
      };
      LObjr.Put(ACol,Value);
    };
    this.SetFixedFont = function (Value) {
      this.FFixedFont.Assign(Value);
    };
    this.GetDataRowCount = function () {
      var Result = 0;
      Result = this.FRowCount - this.FFixedRows;
      return Result;
    };
    this.ClearData = function () {
      this.Clear();
      this.SetRowCount(this.FFixedRows + 5);
      this.SetColCount(this.FFixedCols + 5);
    };
    this.SetDataColumnCount = function (AValue) {
      this.SetColCount(this.FFixedCols + AValue);
    };
    this.SetDataRowCount = function (AValue) {
      this.SetRowCount(this.FFixedRows + AValue);
    };
    this.SetDataValue = function (AColumn, ARow, AValue) {
      this.SetCells(AColumn + this.FFixedCols,ARow + this.FFixedRows,AValue);
    };
    this.SetDataHeader = function (AColumn, AValue) {
      if (this.FFixedRows > 0) this.SetCells(AColumn + this.FFixedCols,this.FFixedRows - 1,AValue);
    };
    this.DataBeginUpdate = function () {
    };
    this.DataEndUpdate = function () {
    };
    this.DataInsertRow = function (AInsertPosition) {
      this.InsertRow(AInsertPosition);
    };
    this.FontChanged = function () {
      pas["WEBLib.Controls"].TControl.FontChanged.call(this);
      this.UpdateElement();
    };
    this.UnbindEvents = function () {
      pas["WEBLib.Controls"].TControl.UnbindEvents.call(this);
      if (this.FNormalCells != null) {
        this.FNormalCells.removeEventListener("mousedown",this.FHandleMouseDownPtr);
        this.FNormalCells.removeEventListener("mouseup",this.FHandleMouseUpPtr);
        this.FNormalCells.removeEventListener("mousemove",this.FHandleMouseMovePtr);
        this.FNormalCells.removeEventListener("click",this.FHandleClickPtr);
      };
      if (this.FFixedCol != null) this.FFixedCol.removeEventListener("click",this.FHandleFixedClickPtr);
      if (this.FFixedRow != null) this.FFixedRow.removeEventListener("click",this.FHandleFixedClickPtr);
      if (this.FFixedColRow != null) this.FFixedColRow.removeEventListener("click",this.FHandleFixedClickPtr);
    };
    this.FixedFontChanged = function (Sender) {
      this.$class.AddInstanceStyle$1(this.StylePrefix() + this.FOrigID,this.GetGridCSS(this.FOrigID + "tbl"));
      this.UpdateElementVisual();
    };
    this.StylePrefix = function () {
      var Result = "";
      var frm = null;
      Result = "";
      frm = pas["WEBLib.Forms"].GetParentForm(this);
      if (frm != null) Result = frm.$classname;
      return Result;
    };
    this.ColOffset = function () {
      var Result = 0;
      Result = this.FFixedCols;
      return Result;
    };
    this.RowOffset = function () {
      var Result = 0;
      Result = this.FFixedRows;
      return Result;
    };
    this.CellColSpan = function (ACol, ARow) {
      var Result = 0;
      var el = null;
      var s = "";
      var e = 0;
      Result = 0;
      el = this.CellRealElement(ACol,ARow);
      if (el != null) {
        s = el.getAttribute("colspan");
        pas.System.val$6(s,{get: function () {
            return Result;
          }, set: function (v) {
            Result = v;
          }},{get: function () {
            return e;
          }, set: function (v) {
            e = v;
          }});
      };
      return Result;
    };
    this.CellRowSpan = function (ACol, ARow) {
      var Result = 0;
      var el = null;
      var s = "";
      var e = 0;
      Result = 0;
      el = this.CellRealElement(ACol,ARow);
      if (el != null) {
        s = el.getAttribute("rowspan");
        pas.System.val$6(s,{get: function () {
            return Result;
          }, set: function (v) {
            Result = v;
          }},{get: function () {
            return e;
          }, set: function (v) {
            e = v;
          }});
      };
      return Result;
    };
    this.CellRealElement = function (ACol, ARow) {
      var Result = null;
      var el = null;
      var t = null;
      var c = 0;
      var r = 0;
      Result = null;
      if ((ARow >= this.FRowCount) || (ACol >= this.FColCount)) return Result;
      if ((ACol < this.FFixedCols) && (ARow < this.FFixedRows)) {
        t = this.FFixedColRow;
        c = ACol;
        r = ARow;
      } else if ((ACol < this.FFixedCols) && (ARow >= this.FFixedRows)) {
        t = this.FFixedCol;
        c = ACol;
        r = ARow - this.FFixedRows;
      } else if ((ACol >= this.FFixedCols) && (ARow < this.FFixedRows)) {
        t = this.FFixedRow;
        c = ACol - this.FFixedCols;
        r = ARow;
      } else {
        t = this.FNormalCells;
        c = ACol - this.FFixedCols;
        r = ARow - this.FFixedRows;
      };
      el = null;
      if (this.FHasMergedCells) {
        var getTableCell = function (table, x, y) {
        var m = [], row, cell, xx, tx, ty, xxx, yyy;
        for(yyy = 0; yyy < table.rows.length; yyy++) {
            row = table.rows[yyy];
            for(xxx = 0; xxx < row.cells.length; xxx++) {
                cell = row.cells[xxx];
                xx = xxx;
                for(; m[yyy] && m[yyy][xx]; ++xx) {}
                for(tx = xx; tx < xx + cell.colSpan; ++tx) {
                    for(ty = yyy; ty < yyy + cell.rowSpan; ++ty) {
                        if (!m[ty])
                            m[ty] = [];
                        m[ty][tx] = true;
                    }
                }
                if (xx <= x && x < xx + cell.colSpan && yyy <= y && y < yyy + cell.rowSpan)
                    return cell;
            }
          }
        return null;
        };
        el = getTableCell(t, c, r);
      } else {
        el = t.rows[r].cells[c];
      };
      Result = el;
      return Result;
    };
    this.CellRealCoords = function (AElement, ACol, ARow) {
      var allcells = [];
      var el = null;
      var i = 0;
      var j = 0;
      ACol.set(-1);
      ARow.set(-1);
      allcells = rtl.arraySetLength(allcells,null,this.FColCount,this.FRowCount);
      for (var $l = 0, $end = this.FColCount - 1; $l <= $end; $l++) {
        i = $l;
        for (var $l1 = 0, $end1 = this.FRowCount - 1; $l1 <= $end1; $l1++) {
          j = $l1;
          allcells[i][j] = this.CellRealElement(i,j);
        };
      };
      for (var $l2 = 0, $end2 = this.FColCount - 1; $l2 <= $end2; $l2++) {
        i = $l2;
        for (var $l3 = 0, $end3 = this.FRowCount - 1; $l3 <= $end3; $l3++) {
          j = $l3;
          if (allcells[i][j] === AElement) {
            ACol.set(i - this.FFixedCols);
            ARow.set(j - this.FFixedRows);
            break;
          };
        };
      };
    };
    this.GetDirectCellElements = function (ACol, ARow) {
      var Result = null;
      var rc = 0;
      var rr = 0;
      var res = null;
      res = null;
      if ((ACol < this.FFixedCols) && (ARow >= this.FFixedRows)) {
        rr = ARow - this.FFixedRows;
        rc = ACol;
        res = this.FFixedCol.rows[rr].cells[rc];
      };
      if ((ARow < this.FFixedRows) && (ACol >= this.FFixedCols)) {
        rc = ACol - this.FFixedCols;
        rr = ARow;
        res = this.FFixedRow.rows[rr].cells[rc];
      };
      if ((ACol < this.FFixedCols) && (ARow < this.FFixedRows)) {
        rr = ARow;
        rc = ACol;
        res = this.FFixedColRow.rows[rr].cells[rc];
      };
      if ((ACol >= this.FFixedCols) && (ARow >= this.FFixedRows) && (ARow < this.FRowCount) && (ACol < this.FColCount)) {
        rc = ACol - this.FFixedCols;
        rr = ARow - this.FFixedRows;
        res = this.FNormalCells.rows[rr].cells[rc];
      };
      Result = res;
      return Result;
    };
    this.MouseMove = function (Shift, X, Y) {
      pas["WEBLib.Controls"].TControl.MouseMove.apply(this,arguments);
      if ((this.FStartCell.X !== -1) && (this.FStartCell.Y !== -1)) {
        if (Y > (this.GetHeight() - 10)) {
          this.SetTopRow(this.GetTopRow() + 1);
          this.SetSelection($mod.GridRect(this.GetSelection().Left,Math.min(this.GetSelection().Top,this.GetSelection().Bottom),this.GetSelection().Right,Math.max(this.GetSelection().Top,this.GetSelection().Bottom) + 1));
        };
        if ((this.FFixedRows > 0) && (Y < this.GetRowHeights(0)) && (this.GetTopRow() > this.FFixedRows)) {
          this.SetTopRow(this.GetTopRow() - 1);
          this.SetSelection($mod.GridRect(this.GetSelection().Left,Math.min(this.GetSelection().Top,this.GetSelection().Bottom) - 1,this.GetSelection().Right,Math.max(this.GetSelection().Top,this.GetSelection().Bottom)));
        };
        if (X > (this.GetWidth() - 10)) {
          this.SetLeftCol(this.GetLeftCol() + 1);
          this.SetSelection($mod.GridRect(Math.min(this.GetSelection().Left,this.GetSelection().Right),this.GetSelection().Top,Math.max(this.GetSelection().Left,this.GetSelection().Right) + 1,this.GetSelection().Bottom));
        };
        if ((this.FFixedCols > 0) && (X < this.GetColWidths(0)) && (this.GetLeftCol() > this.FFixedCols)) {
          this.SetLeftCol(this.GetLeftCol() - 1);
          this.SetSelection($mod.GridRect(Math.min(this.GetSelection().Left,this.GetSelection().Right) - 1,this.GetSelection().Top,Math.max(this.GetSelection().Left,this.GetSelection().Right),this.GetSelection().Bottom));
        };
      };
    };
    this.HandleClick = function (Event) {
      var Result = false;
      var rindex = 0;
      var cindex = 0;
      var rselect = false;
      var tr = null;
      var tgt = null;
      var tag = "";
      var starttag = "";
      Result = true;
      if (!this.FEnabled) return Result;
      rselect = $mod.TGridOption.goRowSelect in this.FOptions;
      rindex = -1;
      cindex = -1;
      tgt = Event.target;
      starttag = tgt.tagName.toLowerCase();
      if ((starttag === "tr") || (starttag === "tbody")) return Result;
      do {
        tag = tgt.tagName.toLowerCase();
        if (tag != 'td')
        {
          tgt = tgt.parentElement;
        };
      } while (!((tag === "td") || (tgt === null)));
      if (tag == 'td')
      {
        cindex = tgt.cellIndex;
        var tr = tgt.parentElement;
        rindex = tr.rowIndex;
      };
      if ((tag === "td") && this.FHasMergedCells) {
        this.CellRealCoords(tgt,{get: function () {
            return cindex;
          }, set: function (v) {
            cindex = v;
          }},{get: function () {
            return rindex;
          }, set: function (v) {
            rindex = v;
          }});
      };
      if ((cindex === -1) || (rindex === -1)) return Result;
      if (!this.CanSelect(cindex + this.FFixedCols,rindex + this.FFixedRows)) {
        return Result;
      };
      this.SelectCell(cindex + this.FFixedCols,rindex + this.FFixedRows);
      if ((this.FOnClickCell != null) && this.FEnabled) {
        this.FOnClickCell(this,cindex + this.FFixedCols,rindex + this.FFixedRows);
      };
      if (this.FSelectedCell != null) {
        if (this.FSelMouseDown) {
          if (($mod.TGridOption.goEditing in this.FOptions) && this.CanEditCell(this.GetCol(),this.GetRow())) {
            this.ShowEdit();
            return Result;
          };
        } else {
          if (rselect) {
            tr = this.FSelectedCell.parentElement;
            this.RemoveSelection(tr);
          } else this.RemoveSelection(this.FSelectedCell);
        };
      };
      if (tag === "td") {
        tr = tgt.parentElement;
        this.FSelectedCell = tgt;
        if (rselect) {
          this.AddSelection(tr)}
         else this.AddSelection(tgt);
      };
      return Result;
    };
    this.HandleFixedClick = function (Event) {
      var Result = false;
      var rindex = 0;
      var cindex = 0;
      var rselect = false;
      var tbl = null;
      var ACol = 0;
      var ARow = 0;
      var tgt = null;
      var tag = "";
      var sd = 0;
      Result = true;
      rselect = $mod.TGridOption.goRowSelect in this.FOptions;
      rindex = -1;
      cindex = -1;
      sd = $mod.TGridSortIndicator.siNone;
      tgt = Event.target;
      if (tgt.tagName === "SPAN") {
        if (tgt.getAttribute("sort") === "up") {
          sd = $mod.TGridSortIndicator.siAscending;
        } else if (tgt.getAttribute("sort") === "dn") {
          sd = $mod.TGridSortIndicator.siDescending;
        };
      };
      do {
        tag = tgt.tagName.toLowerCase();
        if (tag != 'td')
        {
          tgt = tgt.parentElement;
        };
      } while (!((tag === "td") || (tgt === null)));
      if (tag == 'td')
      {
        cindex = tgt.cellIndex;
        var tr = tgt.parentElement;
        rindex = tr.rowIndex;
        tbl = tr.parentElement;
        tbl = tbl.parentElement;
      };
      if ((cindex === -1) || (rindex === -1)) return Result;
      ACol = cindex;
      ARow = rindex;
      if (tbl === this.FFixedCol) {
        ARow = rindex + this.FFixedRows;
      };
      if (tbl === this.FFixedRow) {
        ACol = cindex + this.FFixedCols;
      };
      if (sd === $mod.TGridSortIndicator.siAscending) {
        this.DoSortClick(ACol,ARow,$mod.TGridSortIndicator.siDescending);
        this.SetSortIndicator(ACol,ARow,$mod.TGridSortIndicator.siDescending);
      } else if (sd === $mod.TGridSortIndicator.siDescending) {
        this.DoSortClick(ACol,ARow,$mod.TGridSortIndicator.siAscending);
        this.SetSortIndicator(ACol,ARow,$mod.TGridSortIndicator.siAscending);
      };
      if (this.FOnFixedCellClick != null) this.FOnFixedCellClick(this,ACol,ARow);
      return Result;
    };
    this.HandleMouseDown = function (Event) {
      var Result = false;
      var rindex = 0;
      var cindex = 0;
      var l = 0.0;
      var t = 0.0;
      var ss = {};
      var mb = 0;
      var el = null;
      var ww = false;
      Result = true;
      if (!this.FEnabled) return Result;
      mb = this.GetMouseEventButton(Event);
      if (mb !== pas["WEBLib.Controls"].TMouseButton.mbLeft) return Result;
      rindex = -1;
      cindex = -1;
      el = Event.target;
      ww = this.FWordWrap;
      if (ww && (pas.SysUtils.LowerCase(el.tagName) === "div")) {
        el = el.parentElement;
      };
      if (el.tagName.toLowerCase() == 'td')
      {
        cindex = el.cellIndex;
        var tr = el.parentElement;
        rindex = tr.rowIndex;
      };
      this.FSelMouseDown = el === this.FSelectedCell;
      if ((this.FSelectedCell != null) && !this.FSelMouseDown && (cindex !== -1) && (rindex !== -1)) {
        this.HideEdit(false);
      };
      if (!this.CanSelect(cindex + this.FFixedCols,rindex + this.FFixedRows)) return Result;
      if ((cindex >= 0) && (rindex >= 0)) {
        if ($mod.TGridOption.goRowSelect in this.FOptions) {
          this.SetSelection($mod.GridRect(this.FFixedCols,rindex + this.FFixedRows,this.FColCount - 1,rindex + this.FFixedRows))}
         else this.SetSelection($mod.GridRect(cindex + this.FFixedCols,rindex + this.FFixedRows,cindex + this.FFixedCols,rindex + this.FFixedRows));
        if ($mod.TGridOption.goRangeSelect in this.FOptions) {
          this.FStartCell.X = cindex + this.FFixedCols;
          this.FStartCell.Y = rindex + this.FFixedRows;
        } else {
          this.FStartCell.X = -1;
          this.FStartCell.Y = -1;
        };
      };
      this.XYToClient(Event.clientX,Event.clientY,{get: function () {
          return l;
        }, set: function (v) {
          l = v;
        }},{get: function () {
          return t;
        }, set: function (v) {
          t = v;
        }});
      ss = rtl.refSet(this.GetMouseEventShiftState(Event));
      this.MouseDown(mb,rtl.refSet(ss),pas.System.Trunc(l),pas.System.Trunc(t));
      return Result;
    };
    this.HandleMouseMove = function (Event) {
      var Result = false;
      var rindex = 0;
      var cindex = 0;
      var l = 0.0;
      var t = 0.0;
      var ss = {};
      rindex = -1;
      cindex = -1;
      if (Event.target.tagName.toLowerCase() == 'td')
      {
        cindex = Event.target.cellIndex;
        var tr = Event.target.parentElement;
        rindex = tr.rowIndex;
      };
      if ((cindex >= 0) && (rindex >= 0) && (this.FStartCell.X >= 0) && (this.FStartCell.Y >= 0)) this.SetSelection($mod.GridRect(this.FStartCell.X,this.FStartCell.Y,cindex + this.FFixedCols,rindex + this.FFixedRows));
      Result = true;
      this.XYToClient(Event.clientX,Event.clientY,{get: function () {
          return l;
        }, set: function (v) {
          l = v;
        }},{get: function () {
          return t;
        }, set: function (v) {
          t = v;
        }});
      ss = rtl.refSet(this.GetMouseEventShiftState(Event));
      this.MouseMove(rtl.refSet(ss),pas.System.Trunc(l),pas.System.Trunc(t));
      return Result;
    };
    this.HandleMouseUp = function (Event) {
      var Result = false;
      var l = 0.0;
      var t = 0.0;
      var ss = {};
      var mb = 0;
      TMSStringGridresetResize();
      this.FStartCell.X = -1;
      this.FStartCell.Y = -1;
      Result = false;
      Event.stopPropagation();
      Event.cancelBubble = true;
      this.XYToClient(Event.clientX,Event.clientY,{get: function () {
          return l;
        }, set: function (v) {
          l = v;
        }},{get: function () {
          return t;
        }, set: function (v) {
          t = v;
        }});
      ss = rtl.refSet(this.GetMouseEventShiftState(Event));
      mb = this.GetMouseEventButton(Event);
      this.MouseUp(mb,rtl.refSet(ss),pas.System.Trunc(l),pas.System.Trunc(t));
      return Result;
    };
    this.HandleKeyDown = function (Event) {
      var Result = false;
      var k = 0;
      var newcol = 0;
      var newrow = 0;
      var ss = {};
      var undef = false;
      var ischar = false;
      Result = true;
      if (!this.FEnabled) return Result;
      Event.cancelBubble = true;
      Event.stopPropagation();
      k = 0;
      ischar = false;
      undef = (Event.key == undefined);
      if (pas.SysUtils.UpperCase(Event.key) === "UNIDENTIFIED") return Result;
      if (!undef) {
        k = this.GetKeyCode(Event.key,true);
        ischar = Event.key.length === 1;
        ss = rtl.refSet(this.GetKeyBoardEventShiftState(Event));
        if (this.FOnKeyDown != null) this.FOnKeyDown(this,{get: function () {
            return k;
          }, set: function (v) {
            k = v;
          }},rtl.refSet(ss));
      };
      newrow = this.GetRow();
      newcol = this.GetCol();
      if ((newrow === -1) && (newcol === -1) && (this.FColCount > this.FFixedCols) && (this.FRowCount > this.FFixedRows)) {
        newcol = this.FFixedCols;
        newrow = this.FFixedRows;
        this.SetCol(this.FFixedCols);
        this.SetRow(this.FFixedRows);
        this.FNormalCells.focus();
      };
      if ((k in rtl.createSet(38,40,33,34)) && !ischar) {
        Event.preventDefault();
        this.HideEdit(false);
        this.ChangeRow();
      };
      if (!this.FEditMode && (k in rtl.createSet(35,36,37,39)) && !ischar) {
        Event.preventDefault();
        this.HideEdit(false);
      };
      if ((k === 27) && !ischar) {
        this.CancelEdit();
      };
      if (!this.FEditMode && !ischar && Event.shiftKey && !((k >= 48) && (k <= 122)) && ($mod.TGridOption.goRangeSelect in this.FOptions)) {
        if (k === 35) {
          this.SetRow(this.FRowCount - 1);
          this.SetSelection($mod.GridRect(this.GetCol(),newrow,this.GetCol(),this.GetRow()));
          if (this.GetRow() >= (this.GetTopRow() + this.GetVisibleRowCount())) this.SetTopRow(this.GetRow() - this.GetVisibleRowCount());
        };
        if (k === 36) {
          this.SetRow(this.FFixedRows);
          this.SetSelection($mod.GridRect(this.GetCol(),newrow,this.GetCol(),this.GetRow()));
          if (this.GetRow() < this.GetTopRow()) this.SetTopRow(this.FFixedRows);
        };
        if ((k === 38) && (this.GetRow() > this.FFixedRows)) {
          if (this.GetRow() === Math.min(this.GetSelection().Top,this.GetSelection().Bottom)) {
            newrow = Math.max(this.GetSelection().Top,this.GetSelection().Bottom)}
           else newrow = Math.min(this.GetSelection().Top,this.GetSelection().Bottom);
          this.SetRow(this.GetRow() - 1);
          this.SetSelection($mod.GridRect(this.GetSelection().Left,newrow,this.GetSelection().Right,this.GetRow()));
          if (this.GetRow() < this.GetTopRow()) this.SetTopRow(this.GetTopRow() - 1);
        };
        if ((k === 40) && (this.GetRow() < (this.FRowCount - 1))) {
          if (this.GetRow() === Math.max(this.GetSelection().Top,this.GetSelection().Bottom)) {
            newrow = Math.min(this.GetSelection().Top,this.GetSelection().Bottom)}
           else newrow = Math.max(this.GetSelection().Top,this.GetSelection().Bottom);
          this.SetRow(this.GetRow() + 1);
          this.SetSelection($mod.GridRect(this.GetSelection().Left,newrow,this.GetSelection().Right,this.GetRow()));
          if (this.GetRow() > (this.GetTopRow() + this.GetVisibleRowCount())) this.SetTopRow(this.GetTopRow() + 1);
        };
        if ((k === 37) && (this.GetCol() > this.FFixedCols)) {
          if (this.GetCol() === Math.min(this.GetSelection().Left,this.GetSelection().Right)) {
            newcol = Math.max(this.GetSelection().Left,this.GetSelection().Right)}
           else newcol = Math.min(this.GetSelection().Left,this.GetSelection().Right);
          this.SetCol(this.GetCol() - 1);
          this.SetSelection($mod.GridRect(newcol,this.GetSelection().Top,this.GetCol(),this.GetSelection().Bottom));
          if (this.GetCol() < this.GetLeftCol()) this.SetLeftCol(this.GetLeftCol() - 1);
        };
        if ((k === 39) && (this.GetCol() < (this.FColCount - 1))) {
          if (this.GetCol() === Math.max(this.GetSelection().Left,this.GetSelection().Right)) {
            newcol = Math.min(this.GetSelection().Left,this.GetSelection().Right)}
           else newcol = Math.max(this.GetSelection().Left,this.GetSelection().Right);
          this.SetCol(this.GetCol() + 1);
          this.SetSelection($mod.GridRect(newcol,this.GetSelection().Top,this.GetCol(),this.GetSelection().Bottom));
          if (this.GetCol() >= (this.GetLeftCol() + this.GetVisibleColCount())) this.SetLeftCol(this.GetLeftCol() + 1);
        };
      } else {
        if ((k === 35) && !ischar) {
          newrow = this.FRowCount - 1;
        };
        if ((k === 36) && !ischar) {
          newrow = this.FFixedRows;
        };
        if ((k === 34) && !ischar) {
          if ((this.GetRow() + 4) <= (this.FRowCount - 1)) {
            newrow = this.GetRow() + 4;
          } else {
            newrow = this.FRowCount - 1;
          };
        };
        if ((k === 33) && !ischar) {
          if ((this.GetRow() - 4) > this.FFixedRows) {
            newrow = this.GetRow() - 4;
          } else {
            newrow = this.FFixedRows;
          };
        };
        if (!this.FEditMode && (k === 38) && (this.GetRow() > this.FFixedRows) && !ischar) {
          newrow = this.GetRow() - 1;
        };
        if (!this.FEditMode && (k === 40) && (this.GetRow() < (this.FRowCount - 1)) && !ischar) {
          newrow = this.GetRow() + 1;
        };
        if (!this.FEditMode && (k === 37) && (this.GetCol() > this.FFixedCols) && !ischar) {
          newcol = this.GetCol() - 1;
        };
        if (!this.FEditMode && (k === 39) && (this.GetCol() < (this.FColCount - 1)) && !ischar) {
          newcol = this.GetCol() + 1;
        };
        if (!this.FEditMode && this.CanSelect(newcol,newrow) && !ischar) {
          this.SelectCell(newcol,newrow);
          if ((k === 38) && (this.GetRow() < this.GetTopRow())) this.SetTopRow(this.GetTopRow() - 1);
          if ((k === 33) && (this.GetRow() < this.GetTopRow())) this.SetTopRow(this.GetRow());
          if ((k === 34) && (this.GetRow() >= (this.GetTopRow() + this.GetVisibleRowCount()))) this.SetTopRow(this.GetRow());
          if ((k === 40) && (this.GetRow() >= (this.GetTopRow() + this.GetVisibleRowCount()))) this.SetTopRow(this.GetTopRow() + 1);
          if ((k === 37) && (this.GetCol() < this.GetLeftCol())) this.SetLeftCol(this.GetLeftCol() - 1);
          if ((k === 39) && (this.GetCol() >= (this.GetLeftCol() + this.GetVisibleColCount()))) this.SetLeftCol(this.GetLeftCol() + 1);
          if (k === 35) this.SetTopRow(this.GetRow() - this.GetVisibleRowCount());
          if (k === 36) this.SetTopRow(this.FFixedRows);
        };
        if ((k === 113) && !this.FEditMode && ($mod.TGridOption.goEditing in this.FOptions) && this.CanEditCell(this.GetCol(),this.GetRow())) {
          this.ShowEdit();
        };
        if ((k >= 32) && (k <= 112) && ischar && !this.FEditMode && ($mod.TGridOption.goEditing in this.FOptions) && this.CanEditCell(this.GetCol(),this.GetRow())) {
          this.StartEdit(Event.key);
        };
        if ((k === 13) && ($mod.TGridOption.goEditing in this.FOptions) && this.CanEditCell(this.GetCol(),this.GetRow())) {
          if (this.FEditMode) {
            this.HideEdit(this.FEditAdvance);
          } else this.ShowEdit();
        };
      };
      return Result;
    };
    this.HandleTableFocus = function (Event) {
      var Result = false;
      Result = true;
      if (!this.FEnabled) return Result;
      if ((this.FOnEnter != null) && !this.FBlockFocus) this.FOnEnter(this);
      this.FBlockFocus = false;
      if ((this.GetCol() === -1) && (this.GetRow() === -1) && !this.HasSelection() && (this.FFixedCols < this.FColCount) && (this.FFixedRows < this.FRowCount) && this.CanSelect(this.FFixedCols,this.FFixedRows)) {
        this.SelectCell(this.FFixedCols,this.FFixedRows);
      };
      return Result;
    };
    this.HandleTableBlur = function (Event) {
      var Result = false;
      Result = true;
      if ((this.FOnExit != null) && !this.FEditMode) this.FOnExit(this);
      return Result;
    };
    this.HandleScroll = function (Event) {
      var Result = false;
      if (this.FFixedCols > 0) {
        this.FFixedCol.parentElement.scrollTop = this.FNormalCells.parentElement.parentElement.scrollTop;
      };
      if (this.FFixedRows > 0) this.FFixedRow.parentElement.parentElement.scrollLeft = this.FNormalCells.parentElement.parentElement.scrollLeft;
      this.TopLeftChanged();
      Result = true;
      return Result;
    };
    this.HandleEditBlur = function (Event) {
      var Result = false;
      if (this.FEditMode) {
        this.HideEdit(false);
      };
      Result = true;
      return Result;
    };
    this.HandleEditKeyPress = function (Event) {
      var Result = false;
      var c = "\x00";
      Event.cancelBubble = true;
      Event.stopPropagation();
      Result = true;
      if (this.IsKeyCharacter(Event.key)) {
        c = String.fromCharCode(this.GetKeyCode(Event.key,false));
        if (this.FOnKeyPress != null) this.FOnKeyPress(this,{get: function () {
            return c;
          }, set: function (v) {
            c = v;
          }});
        if (c === "\x00") {
          Event.stopPropagation();
          Event.preventDefault();
        };
      };
      return Result;
    };
    this.HandleComboExit = function (Sender) {
      if (this.FEditMode) this.HideEdit(false);
    };
    this.HandleComboKeyPress = function (Sender, Key) {
      if (this.FOnKeyPress != null) this.FOnKeyPress(this,Key);
      if (Key.get().charCodeAt() === 27) this.CancelEdit();
      if (Key.get().charCodeAt() === 13) this.HideEdit(this.FEditAdvance);
    };
    this.HandleMaskExit = function (Sender) {
      if (this.FEditMode) this.HideEdit(false);
    };
    this.HandleMaskKeyPress = function (Sender, Key) {
      if (this.FOnKeyPress != null) this.FOnKeyPress(this,Key);
      if (Key.get().charCodeAt() === 27) this.CancelEdit();
      if (Key.get().charCodeAt() === 13) this.HideEdit(this.FEditAdvance);
    };
    this.HandleMemoExit = function (Sender) {
      if (this.FEditMode) this.HideEdit(false);
    };
    this.HandleMemoKeyPress = function (Sender, Key) {
      if (this.FOnKeyPress != null) this.FOnKeyPress(this,Key);
      if (Key.get().charCodeAt() === 27) this.CancelEdit();
    };
    this.HandleCheckBoxClick = function (Event) {
      var Result = false;
      var rindex = 0;
      var cindex = 0;
      var chk = false;
      rindex = -1;
      cindex = -1;
      var el = Event.target;
      chk = el.checked;
      var d = el.parentElement;
      if (d.tagName.toLowerCase() == 'td')
      {
        cindex = d.cellIndex;
        var tr = d.parentElement;
        rindex = tr.rowIndex;
      };
      if ((rindex !== -1) && (cindex !== -1)) {
        if (!this.CanEditCell(cindex + this.FFixedCols,rindex + this.FFixedRows)) {
          var el = Event.target;
          el.checked = (!el.checked);
        } else this.DoCheckClick(cindex + this.FFixedCols,rindex + this.FFixedRows,chk);
      };
      return Result;
    };
    this.HandleButtonClick = function (Event) {
      var Result = false;
      var rindex = 0;
      var cindex = 0;
      var chk = false;
      rindex = -1;
      cindex = -1;
      var el = Event.target;
      var d = el.parentElement;
      if (d.tagName.toLowerCase() == 'td')
      {
        cindex = d.cellIndex;
        var tr = d.parentElement;
        rindex = tr.rowIndex;
      };
      if ((rindex !== -1) && (cindex !== -1)) {
        this.DoButtonClick(cindex + this.FFixedCols,rindex + this.FFixedRows);
      };
      return Result;
    };
    this.HandleDoMouseUp = function (Event) {
      var Result = false;
      var res = 0;
      pas["WEBLib.Controls"].TControl.HandleDoMouseUp.apply(this,arguments);
      res = TMSGridLastColSize;
      if (!res) {
        res = TMSStringGridisSizing(); }
      TMSStringGridresetResize();
      if (res >= 0) this.DoColumnSized(res);
      Result = true;
      return Result;
    };
    this.HandleDoMouseMove = function (Event) {
      var Result = false;
      var CtrlName = "";
      var IsAutoWidth = false;
      pas["WEBLib.Controls"].TControl.HandleDoMouseMove.apply(this,arguments);
      CtrlName = this.GetID() + "tbl";
      IsAutoWidth = this.FWidthStyle in rtl.createSet(pas["WEBLib.Controls"].TSizeStyle.ssAuto);
      TMSStringGridID = CtrlName;
      TMSStringGridautoWidth = IsAutoWidth;
      GridNormalCells = this.FNormalCells;
      GridFixedCells = this.FFixedRow;
      GridFixedColCells = this.FFixedCol;
      GridFixedColRows = this.FFixedColRow;
      GridColWidths = this.FColWidths;
      GridFixedCols = this.FFixedCols;
      TMSStringGridresizeColumn(Event);
      Result = true;
      return Result;
    };
    this.HandleDoClick = function (Event) {
      var Result = false;
      Result = pas["WEBLib.Controls"].TControl.HandleDoClick.apply(this,arguments);
      if (!this.FEditMode && (this.FNormalCells != null)) this.FNormalCells.focus();
      return Result;
    };
    this.HandleDoDblClick = function (Event) {
      var Result = false;
      var c = 0;
      var r = 0;
      var fc = 0;
      var fr = 0;
      var el = null;
      var pel = null;
      pas["WEBLib.Controls"].TControl.HandleDoDblClick.apply(this,arguments);
      el = Event.target;
      while ((el != null) && (el !== this.GetElementHandle()) && !((el.tagName === "TD") || (el.tagName === "TH"))) el = el.parentElement;
      if ((el != null) && ((el.tagName === "TD") || (el.tagName === "TH"))) {
        c = el.cellIndex;
        var tr = el.parentElement;
        r = tr.rowIndex;
        pel = el.parentElement;
        if (pel) {
          pel = pel.parentElement; }
        if (pel) {
          pel = pel.parentElement; };
        if (!el.classList.contains("fixed")) {
          fc = this.FFixedCols;
          fr = this.FFixedRows;
        };
        if (pel != null) {
          if (pas.System.Pos("ResizeRowTable",pel.id) > 0) fc = this.FFixedCols;
          if (pas.System.Pos("FixedColTable",pel.id) > 0) fr = this.FFixedRows;
        };
        if (this.FOnDblClickCell != null) this.FOnDblClickCell(this,c + fc,r + fr);
      };
      Result = true;
      return Result;
    };
    this.DoHttpLoadJson = function (Event) {
      var Result = false;
      var J = null;
      var req = null;
      req = Event.target;
      if ((req.status >= 200) && (req.status <= 208)) {
        J = JSON.parse(req.responseText);
        this.LoadFromJSON$1(J,this.FDataNode);
        if (this.FOnHttpRequestSuccess != null) this.FOnHttpRequestSuccess(this);
      };
      Result = true;
      return Result;
    };
    this.DoHttpLoadCsv = function (Event) {
      var Result = false;
      var sl = null;
      var req = null;
      req = Event.target;
      if ((req.status >= 200) && (req.status <= 208)) {
        sl = pas.Classes.TStringList.$create("Create$1");
        sl.SetTextStr(req.responseText);
        try {
          this.LoadFromStringList(sl);
        } finally {
          sl = rtl.freeLoc(sl);
        };
        if (this.FOnHttpRequestSuccess != null) this.FOnHttpRequestSuccess(this);
      };
      Result = true;
      return Result;
    };
    this.DoHttpAbort = function (Event) {
      var Result = false;
      if (this.FOnHttpRequestError != null) this.FOnHttpRequestError(this);
      Result = true;
      return Result;
    };
    this.DoHttpRequest = function (ARequest) {
      var LRequestRec = pas["WEBLib.Controls"].TJSXMLHttpRequestRecord.$new();
      if (this.FOnHttpRequest != null) {
        LRequestRec.req = ARequest;
        this.FOnHttpRequest(this,pas["WEBLib.Controls"].TJSXMLHttpRequestRecord.$clone(LRequestRec));
      };
    };
    this.DoCheckClick = function (ACol, ARow, Checked) {
      if (this.FOnCheckClick != null) this.FOnCheckClick(this,ACol,ARow,Checked);
    };
    this.DoButtonClick = function (ACol, ARow) {
      if (this.FOnButtonClick != null) this.FOnButtonClick(this,ACol,ARow);
    };
    this.DoSortClick = function (ACol, ARow, ASortIndicator) {
      var i = 0;
      this.FSortIndex = ACol;
      for (var $l = 0, $end = this.FColCount - 1; $l <= $end; $l++) {
        i = $l;
        this.SelectSortIndicator(i,ARow,i === ACol);
      };
      this.FSortDirection = ASortIndicator;
      if (this.FOnSortClick != null) this.FOnSortClick(this,ACol,ARow,ASortIndicator);
      this.Sort(ACol,ASortIndicator);
    };
    this.GetEditText = function (ACol, ARow) {
      var Result = "";
      Result = this.GetCells(ACol,ARow);
      if (this.FOnGetEditText != null) this.FOnGetEditText(this,ACol,ARow,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.SetEditText = function (ACol, ARow, AValue) {
      if (this.FOnSetEditText != null) this.FOnSetEditText(this,ACol,ARow,AValue);
    };
    this.SetEditControlValue = function (ACol, ARow, AControl, AValue) {
      if (this.FOnSetEditControlValue != null) this.FOnSetEditControlValue(this,ACol,ARow,AControl,AValue);
    };
    this.GetEditControlValue = function (ACol, ARow, AControl, AValue) {
      if (this.FOnGetEditControlValue != null) this.FOnGetEditControlValue(this,ACol,ARow,AControl,AValue);
    };
    this.DoEditControlExit = function (Sender) {
      this.HideEdit(false);
    };
    this.GetCellData = function (ACol, ARow, AField, AValue) {
      if (this.FOnGetCellData != null) this.FOnGetCellData(this,ACol,ARow,AField,AValue);
    };
    this.GetCellClassName = function (ACol, ARow, AField, AValue, AClassName) {
      if (this.FOnGetCellClass != null) this.FOnGetCellClass(this,ACol,ARow,AField,AValue,AClassName);
    };
    this.GetCellChildren = function (ACol, ARow, AField, AValue, AElement) {
      var LElementRec = pas["WEBLib.Controls"].TJSHTMLElementRecord.$new();
      if (this.FOnGetCellChildren != null) {
        LElementRec.element = AElement;
        this.FOnGetCellChildren(this,ACol,ARow,AField,AValue,pas["WEBLib.Controls"].TJSHTMLElementRecord.$clone(LElementRec));
      };
    };
    this.GetCellEditor = function (ACol, ARow, AEditor) {
      if (this.FOnGetCellEditor != null) this.FOnGetCellEditor(this,ACol,ARow,AEditor);
    };
    this.AddSelection = function (ACell) {
      if (this.FShowSelection) {
        ACell.classList.add("selected");
      };
    };
    this.RemoveSelection = function (ACell) {
      if (this.FShowSelection) ACell.classList.remove("selected");
    };
    this.BindCellChildren = function (ACol, ARow, AElement) {
      var el = null;
      el = AElement.firstChild;
      if ((el != null) && (el.tagName === "INPUT")) {
        if (el.hasAttribute("type") && (pas.SysUtils.LowerCase(el.getAttribute("TYPE")) === "checkbox")) {
          el.addEventListener("click",this.FHandleCheckClickPtr);
        };
      };
    };
    this.UnBindCellChildren = function (ACol, ARow, AElement) {
      var el = null;
      el = AElement.firstChild;
      if ((el != null) && (el.tagName === "INPUT")) {
        if (el.hasAttribute("type") && (pas.SysUtils.LowerCase(el.getAttribute("TYPE")) === "checkbox")) {
          el.removeEventListener("click",this.FHandleCheckClickPtr);
        };
      };
    };
    this.DoBoundsChange = function () {
      var fw = 0;
      var fh = 0;
      var nwvis = 0;
      var nhvis = 0;
      pas["WEBLib.Controls"].TControl.DoBoundsChange.call(this);
      if (this.GetElementHandle() != null) {
        this.UpdateGridSize();
        fw = this.FixedColWidth();
        fh = this.FixedRowHeight();
        nwvis = this.GetWidth() - fw;
        nhvis = this.GetHeight() - fh;
        if (this.FNormalCells != null) {
          this.FNormalCells.parentElement.parentElement.style.setProperty("width",pas.SysUtils.IntToStr(nwvis) + "px");
          this.FNormalCells.parentElement.parentElement.style.setProperty("height",pas.SysUtils.IntToStr(nhvis) + "px");
        };
      };
    };
    this.DoColumnSized = function (AColumn) {
      if (this.FOnColumnSized != null) this.FOnColumnSized(this,AColumn);
    };
    this.LoadFromStringList = function (AStrings) {
      var arow = null;
      var i = 0;
      var j = 0;
      var maxcol = 0;
      var sr = 0;
      var sc = 0;
      var cd = "";
      var cn = "";
      var ce = null;
      if (this.FLoadFixed) {
        this.SetRowCount(AStrings.GetCount())}
       else this.SetRowCount(AStrings.GetCount() + this.FFixedRows);
      arow = pas.Classes.TStringList.$create("Create$1");
      sc = this.FFixedCols;
      sr = this.FFixedRows;
      if (this.FLoadFixed) {
        sr = 0;
        sc = 0;
      };
      maxcol = 0;
      try {
        for (var $l = 0, $end = AStrings.GetCount() - 1; $l <= $end; $l++) {
          i = $l;
          arow.FStrictDelimiter = true;
          arow.SetDelimiter(this.FDelimiter);
          arow.SetDelimitedText(AStrings.Get(i));
          if (arow.GetCount() > maxcol) maxcol = arow.GetCount();
          if (arow.GetCount() > (this.FColCount - sc)) this.SetColCount(arow.GetCount() + sc);
          for (var $l1 = 0, $end1 = arow.GetCount() - 1; $l1 <= $end1; $l1++) {
            j = $l1;
            cd = arow.Get(j);
            this.GetCellData(j + sc,i + sr,null,{get: function () {
                return cd;
              }, set: function (v) {
                cd = v;
              }});
            this.SetCells(j + sc,i + sr,cd);
            ce = this.GetCellElements(j + sc,i + sr);
            this.GetCellChildren(j + sc,i + sr,null,cd,ce);
            cn = "";
            this.GetCellClassName(j + sc,i + sr,null,cd,{get: function () {
                return cn;
              }, set: function (v) {
                cn = v;
              }});
            if (cn !== "") ce.setAttribute("class",cn);
          };
        };
      } finally {
        arow = rtl.freeLoc(arow);
      };
      if (maxcol < (this.FColCount - sc)) this.SetColCount(maxcol + sc);
    };
    this.GetGridCSS = function (id) {
      var Result = "";
      var ff = "";
      Result = "";
      if (this.FElementTableClassName !== "") return Result;
      if (!($mod.TGridOption.goVertLine in this.FOptions)) Result = "border-left: 0px; border-right: 0px;";
      if (!($mod.TGridOption.goHorzLine in this.FOptions)) Result = Result + "border-top: 0px; border-bottom: 0px;";
      if (this.FElementFont === pas["WEBLib.Controls"].TElementFont.efProperty) {
        Result = Result + pas["WEBLib.Graphics"].CSSFont(this.FFont);
        ff = pas["WEBLib.Graphics"].CSSFont(this.FFixedFont);
      };
      Result = "table#" + id + " td { overflow: hidden; text-overflow: ellipsis; white-space:nowrap; border: solid 1px " + pas["WEBLib.Graphics"].ColorToHTML(this.FGridLineColor) + "; padding: 0px;" + Result + "} " + "\r" + "table#" + id + " td.fixed {" + ff + "} " + "\r" + "table#" + id + " td.selected { background-color: " + pas["WEBLib.Graphics"].ColorToHTML(this.FSelectionColor) + "; color: " + pas["WEBLib.Graphics"].ColorToHTML(this.FSelectionTextColor) + ";} " + "\r" + "table#" + id + " tr.selected { background-color: " + pas["WEBLib.Graphics"].ColorToHTML(this.FSelectionColor) + "; color: " + pas["WEBLib.Graphics"].ColorToHTML(this.FSelectionTextColor) + ";} " + "\r" + "table#" + id + " DIV.cell {word-wrap: normal; white-space: normal; text-overflow: clip; } ";
      return Result;
    };
    this.RenderGrid = function () {
      var res = null;
      var i = 0;
      var j = 0;
      var k = 0;
      var fw = 0;
      var fh = 0;
      var nw = 0;
      var nh = 0;
      var nwvis = 0;
      var nhvis = 0;
      var nwvisnoscroll = 0;
      var nhvisnoscroll = 0;
      var tr = null;
      var td = null;
      var span = null;
      var cellspan = null;
      var fixcol = "";
      var fixtxtcol = "";
      var dynstyle = "";
      var vscroll = false;
      var hscroll = false;
      var LAutoSizeW = false;
      var LAutoSizeH = false;
      var ControlName = "";
      while (this.FColWidths.GetCount() <= this.FColCount) this.FColWidths.Add(this.FDefaultColWidth);
      if (this.FOrigID === "") {
        this.FOrigID = this.GetID();
        if (this.FOrigID === "") this.FOrigID = this.FName;
      };
      if (!(this.FGrid != null)) {
        if (this.GetIsLinked() && (this.GetElementHandle().firstElementChild != null)) {
          res = this.GetElementHandle().firstElementChild;
        } else res = document.createElement("TABLE");
        res.setAttribute("id",this.FOrigID + "tbl");
        if (this.FElementTableClassName === "") {
          res.setAttribute("class","table." + this.StylePrefix() + this.FName);
          res.style.setProperty("border-collapse","collapse");
          res.style.setProperty("border-spacing","0px");
          res.style.setProperty("border","0px");
        } else res.setAttribute("class",this.FElementTableClassName);
        this.FGrid = res;
        pas["WEBLib.Controls"].SetHTMLElementFont(res,this.FFont,!((this.FElementClassName === "") && (this.FElementFont === pas["WEBLib.Controls"].TElementFont.efProperty)));
        this.$class.AddInstanceStyle$1(this.StylePrefix() + this.FOrigID,this.GetGridCSS(this.FOrigID + "tbl"));
      } else return;
      LAutoSizeW = this.FWidthStyle === pas["WEBLib.Controls"].TSizeStyle.ssAuto;
      LAutoSizeH = this.FHeightStyle === pas["WEBLib.Controls"].TSizeStyle.ssAuto;
      ControlName = this.FOrigID + "tbl";
      var td = undefined;
          var tr = undefined;
          var span = undefined;
          var cellspan = undefined;
          this.FFixedColRow = document.createElement('TABLE');
          this.FFixedColRow.setAttribute('id', ControlName + 'ResizeFixedRowTable');
          this.FFixedColRow.style.setProperty('border-collapse','collapse');
          this.FFixedColRow.style.setProperty('border-spacing','0px');
      
          this.FFixedCol = document.createElement('TABLE');
          this.FFixedCol.setAttribute('id', ControlName + 'ResizeFixedColTable');
          this.FFixedCol.style.setProperty('border-collapse','collapse');
          this.FFixedCol.style.setProperty('border-spacing','0px');
      
          this.FFixedRow = document.createElement('TABLE');
          this.FFixedRow.setAttribute('id', ControlName + 'ResizeRowTable');
          this.FFixedRow.style.setProperty('border-collapse','collapse');
          this.FFixedRow.style.setProperty('border-spacing','0px');
          this.FFixedRow.style.setProperty('border','0px');
      
          this.FNormalCells = document.createElement('TABLE');
          this.FNormalCells.setAttribute('id', ControlName + 'NormalCellTable');
          this.FNormalCells.style.setProperty('border-collapse','collapse');
          this.FNormalCells.style.setProperty('border-spacing','0px');
      this.FNormalCells.setAttribute("tabindex",pas.SysUtils.IntToStr(this.FTabOrder));
      this.FNormalCells.style.setProperty("outline","none");
      this.FNormalCells.addEventListener("click",this.FHandleClickPtr);
      this.FNormalCells.addEventListener("mousedown",this.FHandleMouseDownPtr);
      this.FNormalCells.addEventListener("mousemove",this.FHandleMouseMovePtr);
      this.FNormalCells.addEventListener("mouseup",this.FHandleMouseUpPtr);
      this.FFixedCol.addEventListener("click",this.FHandleFixedClickPtr);
      this.FFixedRow.addEventListener("click",this.FHandleFixedClickPtr);
      this.FFixedColRow.addEventListener("click",this.FHandleFixedClickPtr);
      this.GetElementHandle().appendChild(res);
      fw = this.FixedColWidth();
      fh = this.FixedRowHeight();
      nw = this.NormalColWidth();
      nh = this.NormalRowHeight();
      nwvis = this.GetWidth() - this.FixedColWidth();
      nhvis = this.GetHeight() - this.FixedRowHeight();
      if (this.FBorderStyle === pas["WEBLib.Controls"].TBorderStyle.bsSingle) {
        nwvis = nwvis - 2;
        nhvis = nhvis - 2;
      };
      nwvisnoscroll = nwvis - pas["WEBLib.Controls"].GetScrollBarWidth();
      if ((this.FixedColWidth() + this.NormalColWidth()) < this.GetWidth()) {
        nhvisnoscroll = nhvis}
       else nhvisnoscroll = nhvis - pas["WEBLib.Controls"].GetScrollBarHeight();
      if (this.FFixedColor !== -1) fixcol = pas["WEBLib.Graphics"].ColorToHTML(this.FFixedColor);
      if (this.GetFixedTextColor() !== -1) fixtxtcol = pas["WEBLib.Graphics"].ColorToHTML(this.GetFixedTextColor());
      tr = res.insertRow(0);
      td = tr.insertCell(0);
      td.style.border = "0px";
      td = tr.insertCell(1);
      td.style.border = "0px";
      tr = res.insertRow(1);
      td = tr.insertCell(0);
      td.style.border = "0px";
      td = tr.insertCell(1);
      td.style.border = "0px";
      if (this.FFixedRows > 0) {
        k = 0;
        if (this.FFixedCols > 0) {
          k = 1;
          td = res.rows[0].cells[0];
                  span = document.createElement('DIV');
          //        span.style.width = fw + "px";
                  span.style.height = fh + "px";
                  span.style.overflow = "hidden";
                  span.style.backgroundColor = fixcol;
                  span.style.color = fixtxtcol;
                  td.appendChild(span);
                  span.appendChild(this.FFixedColRow);
        } else {
          td = res.rows[0].cells[0];
          td.style.border = "0px";
          td = res.rows[1].cells[0];
          td.style.border = "0px";
        };
        td = res.rows[0].cells[1];
              td.style.backgroundColor = fixcol;
              td.style.color = fixtxtcol;
        
              span = document.createElement('DIV');
              span.style.height = fh + "px";
              if (!LAutoSizeW) {
                span.style.width = nwvis + "px";
              }
        
              span.style.overflow = "hidden";
              span.style.backgroundColor = fixcol;
              span.style.color = fixtxtcol;
        
              td.appendChild(span);
        
              cellspan = document.createElement('DIV');
              cellspan.style.height = fh + "px";
              if (!LAutoSizeW) {
                cellspan.style.width = nw + "px";
              }
        
              span.appendChild(cellspan);
              cellspan.appendChild(this.FFixedRow);
        if (this.FFixedCols > 0) {
          for (var $l = 0, $end = this.FFixedRows - 1; $l <= $end; $l++) {
            i = $l;
            tr = this.FFixedColRow.insertRow(i);
            for (var $l1 = 0, $end1 = this.FFixedCols - 1; $l1 <= $end1; $l1++) {
              j = $l1;
              td = tr.insertCell(j);
              td.setAttribute('class','fixed');
              this.SetAlignAttr(this.GetColAlignments(j),td);
            };
          };
        };
        for (var $l2 = 0, $end2 = this.FFixedRows - 1; $l2 <= $end2; $l2++) {
          i = $l2;
          tr = this.FFixedRow.insertRow(i);
          for (var $l3 = this.FFixedCols, $end3 = this.FColCount - 1; $l3 <= $end3; $l3++) {
            j = $l3;
            k = j - this.FFixedCols;
            td = tr.insertCell(k);
            td.setAttribute('class','fixed');
            this.SetAlignAttr(this.GetColAlignments(j),td);
          };
        };
      };
      k = 0;
      if (this.FFixedCols > 0) {
        k = 1;
        //tr = res.insertRow(res.rows.length);
              //td = tr.insertCell(0);
        
              td = res.rows[1].cells[0];
        
              td.style.backgroundColor = fixcol;
              td.style.color = fixtxtcol;
              td.setAttribute('class','fixed');
        
              span = document.createElement('DIV');
              if (!LAutoSizeW) {
              //span.style.width = fw + "px";
              }
              span.style.height = nhvisnoscroll + "px";
              span.style.overflow = "hidden";
              span.style.backgroundColor = fixcol;
              span.style.color = fixtxtcol;
        
              td.setAttribute('valign','top');
        
              td.appendChild(span);
              span.appendChild(this.FFixedCol);
        this.SetAlignAttr(this.GetColAlignments(0),td);
        for (var $l4 = this.FFixedRows, $end4 = this.FRowCount - 1; $l4 <= $end4; $l4++) {
          i = $l4;
          j = i - this.FFixedRows;
          tr = this.FFixedCol.insertRow(j);
          for (var $l5 = 0, $end5 = this.FFixedCols - 1; $l5 <= $end5; $l5++) {
            j = $l5;
            td = tr.insertCell(j);
            td.setAttribute('class','fixed');
            this.SetAlignAttr(this.GetColAlignments(j),td);
          };
        };
      };
      if (this.FFixedCols === 0) {
        //tr = res.insertRow(res.rows.length);
        //td = tr.insertCell(0);
        td = res.rows[1].cells[1];
      } else {
        //tr = res.rows[1];
        //td = tr.insertCell(1);
        td = res.rows[1].cells[1];
      };
      vscroll = (pas["WEBLib.Controls"].TScrollStyle.ssVertical === this.FScrollBars) || (pas["WEBLib.Controls"].TScrollStyle.ssBoth === this.FScrollBars);
      hscroll = (pas["WEBLib.Controls"].TScrollStyle.ssHorizontal === this.FScrollBars) || (pas["WEBLib.Controls"].TScrollStyle.ssBoth === this.FScrollBars);
      span = document.createElement('DIV');
          // span.style.backgroundColor = "#FFFFFF";
      
          if (vscroll) {
            span.style.overflowY = "auto";
          }
          else
          {
            span.style.overflowY = "hidden";
          }
      
          if (hscroll) {
            span.style.overflowX = "auto";
          }
          else {
            span.style.overflowX = "hidden";
          }
      
          if (!LAutoSizeW) {
            span.style.width = nwvis + "px";
          }
      
          if (LAutoSizeH) {
            span.style.overflow = "";
          }
      
          span.style.height = nhvis + "px";
          td.appendChild(span);
      
          cellspan = document.createElement('DIV');
            if (!LAutoSizeW) {
              cellspan.style.width = nw + "px"; }
          cellspan.style.height = nh + "px";
          span.parentElement.style.verticalAlign = "top";
          span.appendChild(cellspan);
          cellspan.appendChild(this.FNormalCells);
      span.addEventListener("scroll",rtl.createSafeCallback(this,"HandleScroll"));
      for (var $l6 = this.FFixedRows, $end6 = this.FRowCount - 1; $l6 <= $end6; $l6++) {
        i = $l6;
        k = i - this.FFixedRows;
        tr = this.FNormalCells.insertRow(k);
        for (var $l7 = this.FFixedCols, $end7 = this.FColCount - 1; $l7 <= $end7; $l7++) {
          j = $l7;
          k = j - this.FFixedCols;
          td = tr.insertCell(k);
          this.SetAlignAttr(this.GetColAlignments(j),td);
        };
      };
      this.FNormalCells.parentElement.parentElement.addEventListener("keydown",rtl.createCallback(this,"HandleKeyDown"));
      this.FNormalCells.addEventListener("focus",this.FHandleFocusPtr);
      this.FNormalCells.addEventListener("blur",this.FHandleBlurPtr);
      this.EnableColResize();
      if (this.FDragMode === pas["WEBLib.Controls"].TDragMode.dmAutomatic) this.EnableDrag();
    };
    this.ReRenderGrid = function () {
      if (!this.GetIsLinked() && (this.FGrid != null) && (this.FGrid.firstElementChild != null)) {
        this.FGrid.removeChild(this.FGrid.firstChild);
      };
      this.FGrid = null;
      this.RenderGrid();
      this.UpdateGridSize();
      this.UpdateGridAlignment();
    };
    this.RenderGridSize = function () {
      var fw = 0;
      var fh = 0;
      var nw = 0;
      var nh = 0;
      var nwvis = 0;
      var nhvis = 0;
      var nwvisnoscroll = 0;
      var nhvisnoscroll = 0;
      if (!(this.FGrid != null)) return;
      fw = this.FixedColWidth();
      fh = this.FixedRowHeight();
      nw = this.NormalColWidth();
      nh = this.NormalRowHeight();
      nwvis = this.GetWidth() - this.FixedColWidth();
      nhvis = this.GetHeight() - this.FixedRowHeight();
      if (this.FBorderStyle === pas["WEBLib.Controls"].TBorderStyle.bsSingle) {
        nwvis = nwvis - 2;
        nhvis = nhvis - 2;
      };
      nwvisnoscroll = nwvis - pas["WEBLib.Controls"].GetScrollBarWidth();
      if ((this.FixedColWidth() + this.NormalColWidth()) < this.GetWidth()) {
        nhvisnoscroll = nhvis}
       else nhvisnoscroll = nhvis - pas["WEBLib.Controls"].GetScrollBarHeight();
      if ((this.FFixedRows > 0) && (this.FWidthStyle === pas["WEBLib.Controls"].TSizeStyle.ssAbsolute)) {
        var td = this.FGrid.rows[0].cells[1];
        if (td!=null) {
        var span = td.firstChild;
        span.style.width = nwvisnoscroll + "px";
        span.style.overflow = "hidden";
        };
      };
      if ((this.FFixedCols > 0) && (this.FHeightStyle === pas["WEBLib.Controls"].TSizeStyle.ssAbsolute)) {
        var td = this.FGrid.rows[1].cells[0];
        if (td!=null) {
        var span = td.firstChild;
        span.style.height = nhvisnoscroll + "px";
        span.style.overflow = "hidden";
        };
      };
    };
    this.RenderGridScript = function () {
      this.AddControlScriptSource("var TMSStringGridpageX,TMSStringGridcurCol,TMSStringGridnxtCol,TMSStringGridcurColWidth,TMSStringGridnxtColWidth,TMSStringGridautoWidth,GridNormalCells,GridFixedCells,GridFixedColCells,GridFixedColRows,GridColWidths,GridFixedCols,TMSStringGridCurID;" + "var TMSStringGridTable,TMSStringGridcurTableWidth,TMSStringGridID,TMSStringGridFullWidth,TMSGridLastColSize;" + "TMSStringGridautoWidth = false;" + 'TMSStringGridCurID = "";' + "ResizeMainGrid = true;" + "function TMSStringGridupdateColSize(Cells, Col) {" + "    if (Cells){" + "     for (i = 0; i < Cells.rows.length; i++){" + "       td = Cells.rows[i].cells[Col.cellIndex];" + '       td.style.position = "relative";' + "       td.style.width = Col.style.width;" + "       td.style.maxWidth = Col.style.width;" + "      }" + "    }" + "}" + "function TMSStringGridresizeColumn(e) {" + "   if ((TMSStringGridcurCol) && (TMSStringGridCurID.indexOf(TMSStringGridID) == 0)) {" + "    var diffX = e.pageX - TMSStringGridpageX;" + "    newColWidth = (TMSStringGridcurColWidth + diffX);" + "    if (newColWidth < 10)" + "      newColWidth = 10;" + '    if (TMSStringGridCurID.indexOf("ResizeRow") > 0) {' + '\t    TMSStringGridcurCol.style.width = newColWidth + "px";' + "\t    TMSStringGridcurCol.style.maxWidth = TMSStringGridcurCol.style.width;" + "     GridColWidths.Put(TMSStringGridcurCol.cellIndex + GridFixedCols, parseInt(TMSStringGridcurCol.style.width));" + "     TMSStringGridupdateColSize(GridFixedCells, TMSStringGridcurCol);" + "     TMSStringGridupdateColSize(GridNormalCells, TMSStringGridcurCol);" + '     TMSStringGridcurTable.style.width = (TMSStringGridcurTableWidth + diffX) + "px";' + '     GridNormalCells.style.width = (TMSStringGridcurTableWidth + diffX) + "px";' + "    } else {" + "     TMSStringGridfullWidth = document.getElementById(TMSStringGridID).offsetWidth;" + "     newCellsWidth = (TMSStringGridfullWidth - (TMSStringGridcurTableWidth + diffX));" + "     if ((newCellsWidth > 10) && (newColWidth > 10)) {" + '\t     TMSStringGridcurCol.style.width = newColWidth + "px";' + "\t     TMSStringGridcurCol.style.maxWidth = TMSStringGridcurCol.style.width;" + "      TMSStringGridupdateColSize(GridFixedColRows, TMSStringGridcurCol);" + "      TMSStringGridupdateColSize(GridFixedColCells, TMSStringGridcurCol);" + "      GridColWidths.Put(TMSStringGridcurCol.cellIndex, parseInt(TMSStringGridcurCol.style.width));" + '      TMSStringGridcurTable.style.width = (TMSStringGridcurTableWidth + diffX) + "px";' + '      GridFixedColCells.style.width = (TMSStringGridcurTableWidth + diffX) + "px";' + "      if ((!TMSStringGridautoWidth) && (newColWidth > 10)){" + '       GridFixedCells.parentElement.style.width = newCellsWidth + "px";' + '       GridFixedCells.parentElement.parentElement.style.width = newCellsWidth + "px";' + '       GridNormalCells.parentElement.style.width = newCellsWidth + "px";' + '       GridNormalCells.parentElement.parentElement.style.width = newCellsWidth + "px";' + "      }" + "     }" + "    }" + "   }" + " }" + "function TMSStringGridisSizing() {" + "   if ((TMSStringGridcurCol) && (TMSStringGridCurID.indexOf(TMSStringGridID) == 0))" + "   {" + '     if (TMSStringGridCurID.indexOf("ResizeRow") > 0)' + "     {" + "       return(TMSStringGridcurCol.cellIndex + GridFixedCols)" + "     }" + "     else" + "     {" + "      return(TMSStringGridcurCol.cellIndex)" + "     }" + "   }" + "  else  { return -1; }" + "   }" + "function TMSStringGridresetResize() {" + '   TMSStringGridID = "";' + "   TMSStringGridFullWidth = undefined;" + '   TMSStringGridCurID = "";' + "   TMSStringGridcurCol = undefined;" + "   TMSStringGridnxtCol = undefined;" + "   TMSStringGridpageX = undefined;" + "   TMSStringGridnxtColWidth = undefined;" + "   TMSStringGridcurColWidth = undefined;" + "   TMSStringGridautoWidth = false;" + "   GridFixedCells = undefined;" + "   GridFixedColCells = undefined;" + "   GridFixedColRows = undefined;" + "   GridNormalCells = undefined;" + "   GridColWidths = undefined;" + "   GridFixedCols = undefined;" + " }" + " function divmousedown(e) {" + "   TMSStringGridCurID = e.target.id;" + "   TMSStringGridcurCol = e.target.parentElement;" + "   TMSStringGridnxtCol = TMSStringGridcurCol.nextElementSibling;" + "   TMSStringGridpageX = e.pageX;" + "   TMSStringGridcurTable = TMSStringGridcurCol.parentElement.parentElement.parentElement;" + "   TMSStringGridcurTableWidth = TMSStringGridcurTable.offsetWidth;" + "   TMSStringGridcurColWidth = TMSStringGridcurCol.offsetWidth;" + "   if (TMSStringGridnxtCol)" + "    TMSStringGridnxtColWidth = TMSStringGridnxtCol.offsetWidth;" + " }" + "\r\n" + " function divmouseover(e) {" + '   e.target.style.borderRight = "2px solid #0000ff";}' + "\r\n" + " function divmouseout(e) {" + '   e.target.style.borderRight = "";}' + "\r\n" + " function divmouseup(e) {" + "   TMSGridLastColSize = TMSStringGridisSizing();" + "\r\n" + "   TMSStringGridresetResize();}" + "\r\n" + "function TMSStringGridresizableGrid(tablename, enabled) {" + ' var table = document.getElementById(tablename + "Table");' + " if (!table) return;" + ' var row = table.getElementsByTagName("tr")[0],' + " cols = row ? row.children : undefined;" + " if (!cols) return;" + " for (var i=0;i<cols.length;i++){" + '  var coldiv = document.getElementById(tablename + "Div" + i);' + "  if (coldiv) {" + '    coldiv.removeEventListener("mousedown",divmousedown);' + '    coldiv.removeEventListener("mouseover",divmouseover);' + '    coldiv.removeEventListener("mouseout",divmouseout);' + '    coldiv.removeEventListener("mouseup",divmouseup);' + "    coldiv.remove(); coldiv = null; }" + "  if (enabled) {" + "    var div = createDiv();" + "    cols[i].appendChild(div);" + '    cols[i].style.position = "relative";' + '    div.id = tablename + "Div" + i;' + "    setListeners(div);" + "  }" + " }" + " function setListeners(div){" + '  div.addEventListener("mousedown", divmousedown);' + '  div.addEventListener("mouseover", divmouseover);' + '  div.addEventListener("mouseout", divmouseout);' + '  div.addEventListener("mouseup", divmouseup);' + " }" + " function createDiv(){" + '  var div = document.createElement("div");' + "  div.style.top = 0;" + "  div.style.right = 0;" + '  div.style.width = "10px";' + '  div.style.position = "absolute";' + '  div.style.cursor = "col-resize";' + '  div.style.userSelect = "none";' + '  div.style.height = "100%";' + '  div.innerHTML = "&nbsp;";' + "  return div;" + " }" + "};");
    };
    this.UpdateGridSize = function () {
      var i = 0;
      var j = 0;
      var k = 0;
      var l = 0;
      var cw = 0;
      var rh = 0;
      var frh = 0;
      if (!(this.GetElementHandle() != null)) return;
      if (!(this.FParent != null)) return;
      if (this.IsUpdating()) return;
      if ((this.FRowCount === 0) || (this.FColCount === 0)) return;
      for (var $l = 0, $end = this.FFixedCols - 1; $l <= $end; $l++) {
        i = $l;
        cw = this.GetColWidths(i) - 0;
        if ((this.FFixedRows > 0) && (this.FFixedCols > 0)) {
          for (j = 0; j < this.FFixedColRow.rows.length; j ++){
           var tr = this.FFixedColRow.rows[j];
           if (tr) {
           var td = tr.cells[i];
           if (td) {
           td.style.width = cw + "px";
           td.style.maxWidth = cw + "px";
           }
           }
          };
        };
        if (this.FFixedCols > 0) {
          for (j = 0; j < this.FFixedCol.rows.length; j ++){
           var tr = this.FFixedCol.rows[j];
           if (tr) {
           var td = tr.cells[i];
           if (td) {
           td.style.width = cw + "px";
           td.style.maxWidth = cw + "px";
           }
           }
          };
        };
      };
      for (var $l1 = 0, $end1 = this.FFixedRows - 1; $l1 <= $end1; $l1++) {
        i = $l1;
        rh = this.GetRowHeights(i);
        if (this.FFixedCols > 0) {
          var tr = this.FFixedColRow.rows[i];
          if (tr) {
            tr.style.height = rh + "px";
          };
        };
        var tr = this.FFixedRow.rows[i];
        if (tr) {
          tr.style.height = rh + "px";
        };
      };
      for (var $l2 = this.FFixedCols, $end2 = this.FColCount - 1; $l2 <= $end2; $l2++) {
        i = $l2;
        cw = this.GetColWidths(i) - 0;
        k = i - this.FFixedCols;
        if (this.FFixedRows > 0) {
          //if (this.FFixedRow.rows.length > 0) {
          for (i = 0; i < this.FFixedRow.rows.length; i++) {
            var tr = this.FFixedRow.rows[i];
            if (tr) {
            var td = tr.cells[k];
            if (td) {
            td.style.width = cw + "px";
            td.style.maxWidth = cw + "px";
            }
            }
          };
        };
        if (this.FNormalCells.rows.length > 0) {
          var tr = this.FNormalCells.rows[0];
          if (tr) {
          var td = tr.cells[k];
          if (td) {
          td.style.width = cw + "px";
          td.style.maxWidth = cw + "px";
          }
          }
        };
      };
      for (var $l3 = this.FFixedRows, $end3 = this.FRowCount - 1; $l3 <= $end3; $l3++) {
        i = $l3;
        k = i - this.FFixedRows;
        rh = this.GetRowHeights(i);
        for (var $l4 = this.FFixedCols, $end4 = this.FColCount - 1; $l4 <= $end4; $l4++) {
          j = $l4;
          l = j - this.FFixedCols;
          cw = this.GetColWidths(j) - 0;
          frh = rh;
          if ((i === (this.FRowCount - 1)) && this.HasHorzScrollBar() && this.HasVertScrollBar()) {
            frh = rh + 20;
          };
          if (this.FFixedCols > 0) {
            var tr = this.FFixedCol.rows[k];
            if (tr) {
              tr.style.height = frh + "px";
            };
            if ((i === (this.FRowCount - 1)) && this.HasHorzScrollBar() && this.HasVertScrollBar()) {
              var td = this.FFixedCol.rows[k].cells[0];
              if (td) {
                td.style.setProperty("vertical-align","top");
              };
            };
          };
          var tr = this.FNormalCells.rows[k];
                  if (tr) {
                  tr.style.height = rh + "px";
          
                  td = tr.cells[l];
                  if (td) {
                  td.style.maxWidth = cw + "px";
                  }
                  };
        };
      };
    };
    this.UpdateGridAlignment = function () {
      var i = 0;
      var j = 0;
      var k = 0;
      var l = 0;
      var cw = 0;
      var rh = 0;
      var al = 0;
      if (!(this.GetElementHandle() != null)) return;
      if (this.IsUpdating()) return;
      if ((this.FRowCount === 0) || (this.FColCount === 0)) return;
      if (this.FColAlignments.GetCount() === 0) return;
      for (var $l = 0, $end = this.FFixedCols - 1; $l <= $end; $l++) {
        i = $l;
        al = this.GetColAlignments(i);
        j = i;
        if ((this.FFixedRows > 0) && (this.FFixedCols > 0)) {
          for (j = 0; j < this.FFixedColRow.rows.length; j ++){
           var tr = this.FFixedColRow.rows[j];
           if (tr) {
           var td = tr.cells[i];
           if (td) {
             this.SetAlignAttr(al, td);
             }
          }
          };
        };
        if (this.FFixedCols > 0) {
          for (j = 0; j < this.FFixedCol.rows.length; j ++){
           var tr = this.FFixedCol.rows[j];
           if (tr) {
             var td = tr.cells[i];
             if (td) {
             this.SetAlignAttr(al, td);
             }
           }
          };
        };
      };
      for (var $l1 = this.FFixedCols, $end1 = this.FColCount - 1; $l1 <= $end1; $l1++) {
        i = $l1;
        al = this.GetColAlignments(i);
        k = i - this.FFixedCols;
        j = i;
        if (this.FFixedRows > 0) {
          //if (this.FFixedRow.rows.length > 0) {
          for (j = 0; j < this.FFixedRow.rows.length; j++) {
            var tr = this.FFixedRow.rows[j];
            if (tr) {
            var td = tr.cells[k];
            if (td) {
              this.SetAlignAttr(al, td);
             }
            }
          };
        };
        for (j = 0; j < this.FNormalCells.rows.length; j++) {
          var tr = this.FNormalCells.rows[j];
          if (tr) {
            var td = tr.cells[k];
            if (td) {
            this.SetAlignAttr(al, td);
            }
          }
        };
      };
    };
    this.BindEvents = function () {
      pas["WEBLib.Controls"].TCustomControl.BindEvents.call(this);
      this.RenderGridScript();
    };
    this.Resize = function () {
      pas["WEBLib.Controls"].TCustomControl.Resize.call(this);
      this.RenderGridSize();
    };
    this.DoEnter = function () {
    };
    this.DoExit = function () {
    };
    this.GridChanged = function () {
      $mod.TCustomGrid.GridChanged.call(this);
      if (this.FSelectedCell != null) this.RemoveSelection(this.FSelectedCell);
      if ((this.GetCol() >= 0) && (this.GetRow() >= 0)) {
        this.FSelectedCell = this.GetCellElements(this.GetCol(),this.GetRow())}
       else this.FSelectedCell = null;
      this.UpdateGridSize();
      this.UpdateGridAlignment();
    };
    this.CreateElement = function () {
      var Result = null;
      Result = document.createElement("SPAN");
      this.FGrid = null;
      return Result;
    };
    this.UpdateElement = function () {
      var clr = "";
      pas["WEBLib.Controls"].TControl.UpdateElement.call(this);
      if (this.IsUpdating()) return;
      if (this.GetElementHandle() != null) {
        if ((this.FColor !== 16711422) && (this.FColor !== -1)) this.GetElementHandle().style.setProperty("background-color",pas["WEBLib.Graphics"].ColorToHTML(this.FColor));
        if (this.FGrid != null) {
          pas["WEBLib.Controls"].SetHTMLElementFont(this.FGrid,this.FFont,!((this.FElementClassName === "") && (this.FElementFont === pas["WEBLib.Controls"].TElementFont.efProperty)));
        };
        this.GetElementHandle().style.setProperty("overflow","hidden");
        if ((this.FBorderStyle === pas["WEBLib.Controls"].TBorderStyle.bsSingle) && !(this.FBorderColor === -1) && (this.FElementClassName === "") && !this.GetIsLinked()) {
          this.GetElementHandle().style.setProperty("border","1px solid " + pas["WEBLib.Graphics"].ColorToHTML(this.FBorderColor));
        } else {
          this.GetElementHandle().style.setProperty("border","");
        };
        this.RenderGrid();
        clr = pas["WEBLib.Graphics"].ColorToHTML(this.FColor);
        if (this.FColor !== 16711422) {
          var bd = this.FNormalCells.tBodies[0];
          if (bd != undefined) {
            this.FNormalCells.tBodies[0].style.setProperty('background-color', clr);
            }
          this.FNormalCells.parentElement.parentElement.style.setProperty('background-color', clr);
        };
        if (this.FOrigID === "") {
          this.FOrigID = this.GetID();
          if (this.FOrigID === "") this.FOrigID = this.FName;
        };
        this.$class.AddInstanceStyle$1(this.StylePrefix() + this.FOrigID,this.GetGridCSS(this.FOrigID + "tbl"));
        this.UpdateGridSize();
        this.UpdateGridAlignment();
      };
    };
    this.UpdateElementVisual = function () {
      var fixcol = "";
      var fixtxtcol = "";
      pas["WEBLib.Controls"].TCustomControl.UpdateElementVisual.call(this);
      if (this.IsUpdating()) return;
      if ((this.GetElementHandle() != null) && (this.FGrid != null)) {
        fixcol = pas["WEBLib.Graphics"].ColorToHTML(this.FFixedColor);
        fixtxtcol = pas["WEBLib.Graphics"].ColorToHTML(this.GetFixedTextColor());
        if ((this.FFixedCols > 0) && (this.FFixedRows > 0)) {
          this.FFixedColRow.parentElement.style.setProperty('background-color',fixcol);
          this.FFixedColRow.parentElement.style.setProperty('color',fixtxtcol);
        };
        if (this.FFixedCols > 0) {
          this.FFixedCol.parentElement.style.setProperty('background-color',fixcol);
                  this.FFixedCol.parentElement.style.setProperty('color',fixtxtcol);
          
                  if (this.FFixedCol.parentElement.parentElement) {
                    this.FFixedCol.parentElement.parentElement.style.setProperty('background-color',fixcol);
                    this.FFixedCol.parentElement.parentElement.style.setProperty('color',fixtxtcol);
                  };
        };
        if (this.FFixedRows > 0) {
          this.FFixedRow.parentElement.style.setProperty('background-color',fixcol);
          this.FFixedRow.parentElement.style.setProperty('color',fixtxtcol);
          this.FFixedRow.parentElement.parentElement.style.setProperty('background-color',fixcol);
          this.FFixedRow.parentElement.parentElement.style.setProperty('color',fixtxtcol);
          if (this.FFixedRow.parentElement.parentElement.parentElement) {
            this.FFixedRow.parentElement.parentElement.parentElement.style.setProperty('background-color',fixcol);
            this.FFixedRow.parentElement.parentElement.parentElement.style.setProperty('color',fixtxtcol);
          };
        };
      };
    };
    this.FixedColWidth = function () {
      var Result = 0;
      var i = 0;
      Result = 0;
      for (var $l = 0, $end = this.FFixedCols - 1; $l <= $end; $l++) {
        i = $l;
        Result = (Result + this.GetColWidths(i)) - 0;
      };
      return Result;
    };
    this.FixedRowHeight = function () {
      var Result = 0;
      var i = 0;
      Result = 0;
      for (var $l = 0, $end = this.FFixedRows - 1; $l <= $end; $l++) {
        i = $l;
        Result = Result + this.GetRowHeights(i);
      };
      return Result;
    };
    this.NormalColWidth = function () {
      var Result = 0;
      var i = 0;
      Result = 1;
      for (var $l = this.FFixedCols, $end = this.FColCount - 1; $l <= $end; $l++) {
        i = $l;
        Result = (Result + this.GetColWidths(i) + 1) - 0;
      };
      return Result;
    };
    this.NormalRowHeight = function () {
      var Result = 0;
      var i = 0;
      Result = 0;
      for (var $l = this.FFixedRows, $end = this.FRowCount - 1; $l <= $end; $l++) {
        i = $l;
        Result = Result + this.GetRowHeights(i);
      };
      return Result;
    };
    this.FocusedCell = function () {
      var Result = null;
      Result = this.FSelectedCell;
      return Result;
    };
    this.CanSelect = function (ACol, ARow) {
      var Result = false;
      Result = true;
      if (this.FOnSelectCell != null) this.FOnSelectCell(this,ACol,ARow,{get: function () {
          return Result;
        }, set: function (v) {
          Result = v;
        }});
      return Result;
    };
    this.CanRowAdvance = function () {
      var Result = false;
      Result = true;
      return Result;
    };
    this.HasSelection = function () {
      var Result = false;
      Result = !((this.GetSelection().Left === 0) && (this.GetSelection().Top === 0) && (this.GetSelection().Right === 0) && (this.GetSelection().Bottom === 0));
      return Result;
    };
    this.UpdateCell = function (ACol, ARow, AValue) {
    };
    this.ValidateCell = function (ACol, ARow, AValue) {
      if (this.FOnValidateEdit != null) this.FOnValidateEdit(this,ACol,ARow,AValue);
    };
    this.TopLeftChanged = function () {
      if (this.FOnTopLeftChanged != null) this.FOnTopLeftChanged(this);
    };
    this.RowCountChanged = function (delta) {
      var $Self = this;
      var r = 0;
      var fr = 0;
      var fc = 0;
      var nh = 0;
      function SetColAlign(column, td) {
        $Self.SetAlignAttr($Self.GetColAlignments(column),td);
      };
      if (this.IsUpdating() && (pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) return;
      if (!(this.FNormalCells != null)) return;
      fr = this.FFixedRows;
      fc = this.FFixedCols;
      nh = this.NormalRowHeight();
      if (1 < 0) SetColAlign(0,null);
      if (delta > 0) {
        var i = 0;
              var j = 0;
              var tr = undefined;
              var td = undefined;
              var l = this.FNormalCells.rows.length;
        
              this.FNormalCells.parentElement.style.setProperty('height', nh + 'px');
        
              for(i = 0;i < delta; i++)
              {
                 tr = this.FNormalCells.insertRow(l);
                 for(j = this.FFixedCols; j < this.FColCount; j++)
                 {
                    td = tr.insertCell(0);
                    SetColAlign(j, td);
                 }
        
                 if (fc > 0) {
                   tr = this.FFixedCol.insertRow(l);
                   for(j = 0; j < this.FFixedCols; j++)
                   {
                     td = tr.insertCell(0);
                     td.setAttribute('class','fixed');
                     SetColAlign(j, td);
                   }
                 }
              };
        this.BeginUpdate();
        for (var $l = 1, $end = delta; $l <= $end; $l++) {
          r = $l;
          this.SetRowHeights(this.FRowCount - r,this.FDefaultRowHeight);
        };
        if (this.FDragMode === pas["WEBLib.Controls"].TDragMode.dmAutomatic) this.EnableDrag();
        this.EndUpdate();
      };
      if (delta < 0) {
        var i = 0;
              var l = this.FNormalCells.rows.length;
        
              if (l > 0) {
        
              for(i = 0;i < -delta; i++)
              {
                this.FNormalCells.deleteRow(l - i - 1);
        
                if (fc > 0) {
                  this.FFixedCol.deleteRow(l - i - 1);
                }
              }
              };
        if (this.FRowCount > 0) this.SetRowHeights(this.FRowCount - 1,this.GetRowHeights(this.FRowCount - 1));
      };
    };
    this.ColCountChanged = function (delta) {
      var c = 0;
      if (this.IsUpdating() && (pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) return;
      if (!(this.FNormalCells != null)) return;
      if (delta > 0) {
        var i = 0;
              var j = 0;
              var k = 0;
              var tr = undefined;
              var td = undefined;
              var sizediv,div = undefined;
        
              var l = this.FNormalCells.rows.length;
        
              for(j = 0; j < l; j++)
              {
                tr = this.FNormalCells.rows[j];
        
                k = tr.cells.length;
        
                 for(i = 0; i < delta; i++)
                 {
                   tr.insertCell(k);
                 }
              }
        
              for(j = 0; j < this.FFixedRows; j++)
              {
                k = this.FFixedRow.rows[j].cells.length;
        
                for(i = 0; i < delta; i++)
                {
                  td = this.FFixedRow.rows[j].insertCell(k);
                  td.setAttribute('class','fixed');
                  div = document.createElement("DIV");
                  div.style = 'position:relative;height:100%;width:100%';
                  td.appendChild(div);
                  sizediv = document.createElement("DIV");
                  sizediv.style = 'position:absolute;height:100%;width:5px;margin-right:-5px;left:100%;top:0px;cursor:w-resize;z-index:999;';
                  div.appendChild(sizediv);
                }
              };
        for (var $l = 1, $end = delta; $l <= $end; $l++) {
          c = $l;
          this.SetColWidths(this.FColCount - c,this.FDefaultColWidth);
        };
        if (this.FDragMode === pas["WEBLib.Controls"].TDragMode.dmAutomatic) this.EnableDrag();
      };
      if (delta < 0) {
        var i = 0;
              var j = 0;
              var k = 0;
              var tr = undefined;
        
              var l = this.FNormalCells.rows.length;
        
              for(j = 0; j < l; j++)
              {
                tr = this.FNormalCells.rows[j];
        
                k = tr.cells.length;
        
                 for(i = 0; i < -delta; i++)
                 {
                   tr.deleteCell(k - i - 1);
                 }
              }
        
              if (this.FFixedRows > 0) {
        
              k = this.FFixedRow.rows[0].cells.length;
        
              for(i = 0; i < -delta; i++)
              {
                this.FFixedRow.rows[0].deleteCell(k- i - 1);
              }
              };
        if (this.FColCount > 0) this.SetColWidths(this.FColCount - 1,this.GetColWidths(this.FColCount - 1));
      };
    };
    this.ClearMethodPointers = function () {
      pas["WEBLib.Controls"].TControl.ClearMethodPointers.call(this);
      this.FHandleEditBlurPtr = null;
      this.FHandleEditKeypressPtr = null;
      this.FHandleCheckClickPtr = null;
      this.FHandleButtonClickPtr = null;
      this.FHandleMouseDownPtr = null;
      this.FHandleMouseUpPtr = null;
      this.FHandleMouseMovePtr = null;
      this.FHandleFixedClickPtr = null;
      this.FHandleBlurPtr = null;
      this.FHandleFocusPtr = null;
      this.FHandleClickPtr = null;
    };
    this.GetMethodPointers = function () {
      pas["WEBLib.Controls"].TControl.GetMethodPointers.call(this);
      this.FHandleEditBlurPtr = rtl.createCallback(this,"HandleEditBlur");
      this.FHandleEditKeypressPtr = rtl.createCallback(this,"HandleEditKeyPress");
      this.FHandleCheckClickPtr = rtl.createCallback(this,"HandleCheckBoxClick");
      this.FHandleButtonClickPtr = rtl.createCallback(this,"HandleButtonClick");
      this.FHandleMouseDownPtr = rtl.createCallback(this,"HandleMouseDown");
      this.FHandleMouseUpPtr = rtl.createCallback(this,"HandleMouseUp");
      this.FHandleMouseMovePtr = rtl.createCallback(this,"HandleMouseMove");
      this.FHandleFixedClickPtr = rtl.createCallback(this,"HandleFixedClick");
      this.FHandleFocusPtr = rtl.createCallback(this,"HandleTableFocus");
      this.FHandleBlurPtr = rtl.createCallback(this,"HandleTableBlur");
      this.FHandleClickPtr = rtl.createCallback(this,"HandleClick");
    };
    this.StartEdit = function (ch) {
      var created = false;
      var eh = null;
      var s = "";
      var dorange = false;
      this.FEditorMode = true;
      if (this.FWordWrap) {
        this.FEditType = $mod.TGridCellEditor.geMemo}
       else this.FEditType = $mod.TGridCellEditor.geText;
      this.GetCellEditor(this.GetCol(),this.GetRow(),{p: this, get: function () {
          return this.p.FEditType;
        }, set: function (v) {
          this.p.FEditType = v;
        }});
      if (this.FEditType === $mod.TGridCellEditor.geNone) return;
      eh = this.GetElementHandle();
      this.FEditRow = this.GetRow();
      this.FEditCol = this.GetCol();
      this.FEditMode = true;
      s = this.GetEditText(this.GetCol(),this.GetRow());
      this.FOrigVal = s;
      if (this.FEditType === $mod.TGridCellEditor.geCombo) {
        if (!(this.FCombo != null)) {
          this.FCombo = pas["WEBLib.StdCtrls"].TWebComboBox.$create("Create$1",[this]);
          this.FCombo.SetElementPosition(pas["WEBLib.Controls"].TElementPosition.epRelative);
          this.FCombo.SetWidthStyle(pas["WEBLib.Controls"].TSizeStyle.ssPercent);
          this.FCombo.SetWidthPercent(100);
          this.FCombo.SetHeightStyle(pas["WEBLib.Controls"].TSizeStyle.ssPercent);
          this.FCombo.SetHeightPercent(100);
          this.FCombo.SetParent(this);
          this.FCombo.FOnExit = rtl.createCallback(this,"HandleComboExit");
          this.FCombo.FOnKeyPress = rtl.createCallback(this,"HandleComboKeyPress");
        };
        this.FCombo.FItems.Assign(this.FComboBoxItems);
        this.FCombo.SetText(s);
        this.FSelectedCell.innerHTML = "";
        this.FSelectedCell.appendChild(this.FCombo.GetElementHandle());
        this.FCombo.SetFocus();
        this.RemoveSelection(this.FSelectedCell);
        return;
      };
      if (this.FEditType === $mod.TGridCellEditor.geMemo) {
        if (!(this.FMemo != null)) {
          this.FMemo = pas["WEBLib.StdCtrls"].TWebMemo.$create("Create$1",[this]);
          this.FMemo.SetElementPosition(pas["WEBLib.Controls"].TElementPosition.epRelative);
          this.FMemo.SetWidthStyle(pas["WEBLib.Controls"].TSizeStyle.ssPercent);
          this.FMemo.SetWidthPercent(100);
          this.FMemo.SetBorderStyle(pas["WEBLib.Controls"].TBorderStyle.bsNone);
          this.FMemo.SetParent(this);
          this.FMemo.GetElementHandle().style.setProperty("outline","none");
          this.FMemo.FOnExit = rtl.createCallback(this,"HandleMemoExit");
          this.FMemo.FOnKeyPress = rtl.createCallback(this,"HandleMemoKeyPress");
        };
        this.FMemo.SetHeight(this.GetRowHeights(this.FEditRow) - 3);
        this.FMemo.FLines.SetTextStr(s);
        this.FSelectedCell.innerHTML = "";
        this.FSelectedCell.style.setProperty("justify-content","top");
        this.FSelectedCell.style.setProperty("vertical-align","top");
        this.FSelectedCell.appendChild(this.FMemo.GetElementHandle());
        this.FMemo.SetFocus();
        this.RemoveSelection(this.FSelectedCell);
        return;
      };
      if (this.FEditType === $mod.TGridCellEditor.geCustom) {
        this.FEditControl.SetElementPosition(pas["WEBLib.Controls"].TElementPosition.epRelative);
        this.FEditControl.SetWidthStyle(pas["WEBLib.Controls"].TSizeStyle.ssPercent);
        this.FEditControl.SetWidthPercent(100);
        this.FEditControl.SetParent(this);
        this.FEditControl.FOnExit = rtl.createCallback(this,"DoEditControlExit");
        this.SetEditControlValue(this.FEditCol,this.FEditRow,this.FEditControl,s);
        this.FSelectedCell.innerHTML = "";
        this.FSelectedCell.style.setProperty("justify-content","top");
        this.FSelectedCell.style.setProperty("vertical-align","top");
        this.FSelectedCell.appendChild(this.FEditControl.GetElementHandle());
        this.RemoveSelection(this.FSelectedCell);
        return;
      };
      if (this.FEditType === $mod.TGridCellEditor.geMask) {
        if (!(this.FMask != null)) {
          this.FMask = pas["WEBLib.Mask"].TWebMaskEdit.$create("Create$1",[this]);
          this.FMask.SetElementPosition(pas["WEBLib.Controls"].TElementPosition.epRelative);
          this.FMask.SetWidthStyle(pas["WEBLib.Controls"].TSizeStyle.ssPercent);
          this.FMask.SetWidthPercent(100);
          this.FMask.SetHeightStyle(pas["WEBLib.Controls"].TSizeStyle.ssPercent);
          this.FMask.SetHeightPercent(100);
          this.FMask.SetParent(this);
          this.FMask.FOnExit = rtl.createCallback(this,"HandleMaskExit");
          this.FMask.FOnKeyPress = rtl.createCallback(this,"HandleMaskKeyPress");
        };
        this.FMask.SetEditMask(this.FEditMask);
        this.FMask.SetText(s);
        this.FSelectedCell.innerHTML = "";
        this.FSelectedCell.appendChild(this.FMask.GetElementHandle());
        this.FMask.SetFocus();
        this.FMask.SetSelection(0,s.length);
        this.RemoveSelection(this.FSelectedCell);
        return;
      };
      created = false;
      if (this.FEdit == undefined) {
            this.FEdit = document.createElement('INPUT');
            this.FEdit.style.setProperty('box-sizing','border-box');
            this.FEdit.style.setProperty('-webkit-box-sizing','border-box');
            this.FEdit.style.setProperty('-moz-box-sizing','border-box');
            this.FEdit.style.setProperty('outline', 'none');
            this.FEdit.style.setProperty('border-style', 'none');
      
            created = true;
          }
          this.FEdit.removeAttribute("type");
      var $tmp = this.FEditType;
      if ($tmp === $mod.TGridCellEditor.geURL) {
        this.FEdit.setAttribute("type","URL")}
       else if ($tmp === $mod.TGridCellEditor.geDate) {
        this.FEdit.setAttribute("type","DATE")}
       else if ($tmp === $mod.TGridCellEditor.geTime) {
        this.FEdit.setAttribute("type","TIME")}
       else if ($tmp === $mod.TGridCellEditor.geRange) {
        this.FEdit.setAttribute("type","RANGE");
        this.FEdit.setAttribute("min",pas["WEBLib.WebTools"].NumAttribute(this.FRange.FMin));
        this.FEdit.setAttribute("max",pas["WEBLib.WebTools"].NumAttribute(this.FRange.FMax));
        this.FEdit.setAttribute("step",pas["WEBLib.WebTools"].NumAttribute(this.FRange.FStep));
      } else if ($tmp === $mod.TGridCellEditor.geEmail) {
        this.FEdit.setAttribute("type","EMAIL")}
       else if ($tmp === $mod.TGridCellEditor.geNumber) {
        this.FEdit.setAttribute("type","NUMBER")}
       else if ($tmp === $mod.TGridCellEditor.geTel) {
        this.FEdit.setAttribute("type","TEL")}
       else if ($tmp === $mod.TGridCellEditor.geColor) this.FEdit.setAttribute("type","COLOR");
      dorange = this.FEditType === $mod.TGridCellEditor.geText;
      this.FEdit.removeAttribute("min");
          this.FEdit.removeAttribute("max");
          this.FEdit.removeAttribute("step");
      
          if (ch != '') {
            this.FEdit.value = "";
            }
          else {
            this.FEdit.value = s;
          }
      
          this.FEdit.style.width = "100%";
          this.FEdit.style.height = "100%";
          this.FEdit.style.fontFamily = eh.style.fontFamily;
          this.FEdit.style.fontSize = eh.style.fontSize;
      
          if (dorange) {
          this.FEdit.setSelectionRange(0, this.FEdit.value.length)
          }
      
          this.FSelectedCell.innerHTML = "";
          this.FSelectedCell.appendChild(this.FEdit);
      this.FEdit.focus();
      this.RemoveSelection(this.FSelectedCell);
      if (created) {
        this.FEdit.addEventListener("blur",this.FHandleEditBlurPtr);
        this.FEdit.addEventListener("keypress",this.FHandleEditKeypressPtr);
      };
    };
    this.StopEdit = function () {
      var Result = "";
      var val = "";
      var eh = null;
      this.FEditorMode = false;
      Result = "";
      if (this.FEditMode) {
        this.FEditMode = false;
        if (this.FEditType === $mod.TGridCellEditor.geCombo) {
          val = this.FCombo.GetText();
          eh = this.FCombo.GetElementHandle();
        } else if (this.FEditType === $mod.TGridCellEditor.geMask) {
          val = this.FMask.GetText();
          eh = this.FMask.GetElementHandle();
        } else {
          val = rtl.asExt(this.FEdit,HTMLInputElement).value;
          eh = this.FEdit;
        };
        this.ValidateCell(this.FEditCol,this.FEditRow,{get: function () {
            return val;
          }, set: function (v) {
            val = v;
          }});
        if (this.FSelectedCell.contains(eh)) this.FSelectedCell.removeChild(eh);
        this.FSelectedCell.innerHTML = val;
        Result = val;
        this.UpdateCell(this.FEditCol,this.FEditRow,{get: function () {
            return val;
          }, set: function (v) {
            val = v;
          }});
        if (!($mod.TGridOption.goRowSelect in this.FOptions)) {
          this.AddSelection(this.FSelectedCell);
        };
      };
      return Result;
    };
    this.CanEditCell = function (ACol, ARow) {
      var Result = false;
      var CanEdit = false;
      CanEdit = true;
      if (this.FOnCanEditCell != null) this.FOnCanEditCell(this,ACol,ARow,{get: function () {
          return CanEdit;
        }, set: function (v) {
          CanEdit = v;
        }});
      Result = CanEdit;
      return Result;
    };
    this.ChangeRow = function () {
    };
    this.EnableColResize = function () {
      var TableName = "";
      var ResizeEnabled = false;
      if (!(pas.Classes.TComponentStateItem.csDesigning in this.FComponentState)) {
        TableName = this.GetID() + "tblResizeRow";
        ResizeEnabled = $mod.TGridOption.goColSizing in this.FOptions;
        TMSStringGridresizableGrid(TableName, ResizeEnabled);
        TableName = this.GetID() + "tblResizeFixedRow";
        ResizeEnabled = $mod.TGridOption.goColSizing in this.FOptions;
        TMSStringGridresizableGrid(TableName, ResizeEnabled);
      };
    };
    this.EnableDrag = function () {
      var $Self = this;
      function AddDraggableAttribute(AElement) {
        var I = 0;
        for (var $l = 0, $end = AElement.children.length - 1; $l <= $end; $l++) {
          I = $l;
          if (AElement.children.item(I).tagName === "TD") {
            AElement.children.item(I).setAttribute("draggable","true");
            AddDraggableAttribute(AElement.children.item(I));
          } else AddDraggableAttribute(AElement.children.item(I));
        };
      };
      if (!(this.GetContainer() != null)) return;
      AddDraggableAttribute(this.GetContainer());
    };
    this.DisableDrag = function () {
      var $Self = this;
      function RemoveDraggableAttribute(AElement) {
        var I = 0;
        for (var $l = 0, $end = AElement.children.length - 1; $l <= $end; $l++) {
          I = $l;
          if (AElement.children.item(I).tagName === "TD") {
            AElement.children.item(I).removeAttribute("draggable");
            RemoveDraggableAttribute(AElement.children.item(I));
          } else RemoveDraggableAttribute(AElement.children.item(I));
        };
      };
      if (!(this.GetContainer() != null)) return;
      RemoveDraggableAttribute(this.GetContainer());
    };
    this.BindCellButton = function (ACol, ARow, AElement) {
      var el = null;
      el = AElement.firstChild;
      if ((el != null) && (el.tagName === "BUTTON")) {
        el.addEventListener("click",this.FHandleButtonClickPtr);
      };
    };
    this.InitCSSLibrary = function (ALibrary) {
      if (ALibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap) {
        this.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
      };
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.Controls"].TControl.Create$1.apply(this,arguments);
      this.FDrawingStyle = $mod.TGridDrawingStyle.gdsThemed;
      return this;
    };
    this.Destroy = function () {
      var i = 0;
      var LObjr = null;
      rtl.free(this,"FRange");
      rtl.free(this,"FColWidths");
      rtl.free(this,"FColAlignments");
      rtl.free(this,"FRowHeights");
      rtl.free(this,"FRows");
      rtl.free(this,"FFixedFont");
      for (var $l = 0, $end = this.FObjectRows.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        LObjr = rtl.getObject(this.FObjectRows.Get(i));
        LObjr = rtl.freeLoc(LObjr);
      };
      this.FObjectRows.Clear();
      rtl.free(this,"FObjectRows");
      rtl.free(this,"FComboBoxItems");
      if (this.FCombo != null) rtl.free(this,"FCombo");
      if (this.FMask != null) rtl.free(this,"FMask");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.FEditAdvance = false;
      this.FColWidths = pas.Classes.TList.$create("Create$1");
      this.FRowHeights = pas.Classes.TList.$create("Create$1");
      this.FColAlignments = pas.Classes.TList.$create("Create$1");
      this.FObjectRows = pas.Classes.TList.$create("Create$1");
      this.FRows = pas.Classes.TStringList.$create("Create$1");
      this.FRows.FOnChange = rtl.createCallback(this,"RowsChanged");
      this.FComboBoxItems = pas.Classes.TStringList.$create("Create$1");
      this.FRange = $mod.TGridRange.$create("Create$1");
      this.FHasMergedCells = false;
      this.FDefaultColAlignment = pas.Classes.TAlignment.taLeftJustify;
      this.FStartCell.X = -1;
      this.FStartCell.Y = -1;
      this.FFixedColor = 15790320;
      this.FRowCount = 5;
      this.FColCount = 5;
      this.FColor = 16711422;
      this.FFixedCols = 1;
      this.FFixedRows = 1;
      this.FDefaultColWidth = 64;
      this.FDefaultRowHeight = 22;
      this.FShowSelection = true;
      this.SetElementFont(pas["WEBLib.Controls"].TElementFont.efProperty);
      this.SetElementPosition(pas["WEBLib.Controls"].TElementPosition.epAbsolute);
      this.FScrollBars = pas["WEBLib.Controls"].TScrollStyle.ssBoth;
      this.FGridLineColor = 12632256;
      this.FSelectionColor = 0xFF8F5B;
      this.FSelectionTextColor = 0xFFFFFF;
      this.FOptions = rtl.createSet($mod.TGridOption.goHorzLine,$mod.TGridOption.goVertLine,$mod.TGridOption.goRangeSelect);
      this.FFixedFont = pas["WEBLib.Graphics"].TFont.$create("Create$1");
      this.FFixedFont.FOnChange = rtl.createCallback(this,"FixedFontChanged");
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        this.SetWidth(400);
        this.SetHeight(300);
      };
    };
    this.SetFocus = function () {
      if (this.FNormalCells != null) this.FNormalCells.focus();
    };
    this.ShowEdit = function () {
      this.StartEdit("");
    };
    this.HideEdit = function (Advance) {
      var val = "";
      var cval = "";
      var eh = null;
      var rh = 0;
      if (this.FEditMode) {
        this.FEditMode = false;
        if (this.FEditType === $mod.TGridCellEditor.geCombo) {
          val = this.FCombo.GetText();
          eh = this.FCombo.GetElementHandle();
        } else if (this.FEditType === $mod.TGridCellEditor.geMemo) {
          val = this.FMemo.FLines.GetTextStr();
          eh = this.FMemo.GetElementHandle();
        } else if (this.FEditType === $mod.TGridCellEditor.geMask) {
          val = this.FMask.GetText();
          eh = this.FMask.GetElementHandle();
        } else if (this.FEditType === $mod.TGridCellEditor.geCustom) {
          this.GetEditControlValue(this.FEditCol,this.FEditRow,this.FEditControl,{get: function () {
              return val;
            }, set: function (v) {
              val = v;
            }});
          eh = this.FEditControl.GetElementHandle();
          this.FSelectedCell.style.removeProperty("vertical-align");
        } else {
          val = rtl.asExt(this.FEdit,HTMLInputElement).value;
          eh = this.FEdit;
        };
        this.ValidateCell(this.FEditCol,this.FEditRow,{get: function () {
            return val;
          }, set: function (v) {
            val = v;
          }});
        if (this.FSelectedCell.contains(eh)) this.FSelectedCell.removeChild(eh);
        cval = val;
        if (this.FWordWrap) {
          rh = this.GetRowHeights(this.FEditRow) - 2;
          cval = '<DIV class="cell" style="height:' + pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
              return rh;
            }, set: function (v) {
              rh = v;
            }}) + "px;max-height:" + pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
              return rh;
            }, set: function (v) {
              rh = v;
            }}) + 'px">' + cval + "</DIV>";
        };
        this.FSelectedCell.innerHTML = cval;
        this.UpdateCell(this.FEditCol,this.FEditRow,{get: function () {
            return val;
          }, set: function (v) {
            val = v;
          }});
        if (!($mod.TGridOption.goRowSelect in this.FOptions)) this.AddSelection(this.FSelectedCell);
        this.SetEditText(this.FEditCol,this.FEditRow,val);
        this.FBlockFocus = true;
        this.FNormalCells.focus();
        if (Advance) {
          this.RemoveSelection(this.FSelectedCell);
          if (this.GetCol() < (this.FColCount - 1)) {
            this.SetCol(this.GetCol() + 1)}
           else {
            if (this.CanRowAdvance()) {
              if (this.GetRow() < (this.FRowCount - 1)) {
                this.SetCol(this.FFixedCols);
                this.SetRow(this.GetRow() + 1);
              } else {
                this.SetCol(this.FFixedCols);
                this.SetRow(this.FFixedRows);
              };
            } else return;
          };
          if (this.CanEditCell(this.GetCol(),this.GetRow())) this.StartEdit("");
        };
      };
    };
    this.CancelEdit = function () {
      var eh = null;
      if (this.FEditMode) {
        if (this.FEditType === $mod.TGridCellEditor.geCombo) {
          eh = this.FCombo.GetElementHandle();
        } else if (this.FEditType === $mod.TGridCellEditor.geMemo) {
          eh = this.FMemo.GetElementHandle();
        } else if (this.FEditType === $mod.TGridCellEditor.geMask) {
          eh = this.FMask.GetElementHandle();
        } else {
          eh = this.FEdit;
        };
        this.FEditMode = false;
        this.ValidateCell(this.FEditCol,this.FEditRow,{p: this, get: function () {
            return this.p.FOrigVal;
          }, set: function (v) {
            this.p.FOrigVal = v;
          }});
        if (this.FSelectedCell.contains(eh)) this.FSelectedCell.removeChild(eh);
        this.FSelectedCell.innerHTML = this.FOrigVal;
        this.UpdateCell(this.FEditCol,this.FEditRow,{p: this, get: function () {
            return this.p.FOrigVal;
          }, set: function (v) {
            this.p.FOrigVal = v;
          }});
        if (!($mod.TGridOption.goRowSelect in this.FOptions)) {
          this.AddSelection(this.FSelectedCell);
        };
        this.SetEditText(this.FEditCol,this.FEditRow,this.FOrigVal);
        this.FBlockFocus = true;
        this.FNormalCells.focus();
      };
    };
    this.Clear = function () {
      var c = 0;
      var r = 0;
      for (var $l = 0, $end = this.FColCount - 1; $l <= $end; $l++) {
        c = $l;
        for (var $l1 = 0, $end1 = this.FRowCount - 1; $l1 <= $end1; $l1++) {
          r = $l1;
          if (this.HasButton(c,r)) this.RemoveButton(c,r);
          if (this.HasCheckBox(c,r)) this.RemoveCheckBox(c,r);
          this.SetCells(c,r,"");
        };
      };
    };
    this.ClearSelection = function () {
      var rselect = false;
      var tr = null;
      rselect = $mod.TGridOption.goRowSelect in this.FOptions;
      if ((this.FSelectedCell != null) && rselect) {
        tr = this.FSelectedCell.parentElement;
        this.RemoveSelection(tr);
      };
      this.SetSelection($mod.GridRect(0,0,0,0));
      if (this.FSelectedCell != null) {
        this.RemoveSelection(this.FSelectedCell);
      };
    };
    this.Invalidate = function () {
      pas["WEBLib.Controls"].TCustomControl.Invalidate.call(this);
    };
    this.InitSample = function (AInitMethod) {
      var i = 0;
      var j = 0;
      for (var $l = 0, $end = this.FRowCount - 1; $l <= $end; $l++) {
        i = $l;
        for (var $l1 = 0, $end1 = this.FColCount - 1; $l1 <= $end1; $l1++) {
          j = $l1;
          var $tmp = AInitMethod;
          if ($tmp === $mod.TInitMethod.imRandom) {
            this.SetCells(j,i,pas.SysUtils.IntToStr(pas.System.Random(100)))}
           else if ($tmp === $mod.TInitMethod.imLinear) this.SetCells(j,i,pas.SysUtils.IntToStr(j) + ":" + pas.SysUtils.IntToStr(i));
        };
      };
    };
    this.Sort = function (AColumn, ADirection) {
      var colidx = 0;
      var grid = null;
      var asc = false;
      grid = this.FNormalCells;
      asc = ADirection === $mod.TGridSortIndicator.siAscending;
      colidx = AColumn - this.FFixedCols;
      if (colidx < 0) return;
      const getCellValue = (tr, idx) => tr.children[idx].innerText || tr.children[idx].textContent;
          const comparer = (idx, asc) => (a, b) => ((v1, v2) =>
            v1 !== '' && v2 !== '' && !isNaN(v1) && !isNaN(v2) ? v1 - v2 : v1.toString().localeCompare(v2)
            )(getCellValue(asc ? a : b, idx), getCellValue(asc ? b : a, idx));
      
          const table = grid;
          Array.from(table.querySelectorAll('tr:nth-child(n+1)'))
              .sort(comparer(colidx, asc))
              .forEach(tr => table.appendChild(tr) );
    };
    this.MouseToCell = function (X, Y, C, R) {
      var DocX = 0.0;
      var DocY = 0.0;
      var el = null;
      var cindex = 0;
      var rindex = 0;
      var frm = null;
      cindex = -1;
      rindex = -1;
      this.ClientToXY(X,Y,{get: function () {
          return DocX;
        }, set: function (v) {
          DocX = v;
        }},{get: function () {
          return DocY;
        }, set: function (v) {
          DocY = v;
        }});
      frm = pas["WEBLib.Forms"].GetParentForm(this);
      if (frm.FPopup) {
        DocX = DocX - frm.GetLeft();
        DocY = DocY - frm.GetTop();
      };
      el = document.elementFromPoint(Math.round(DocX),Math.round(DocY));
      if (el != null) {
        if (el.tagName.toLowerCase() == 'td')
              {
                cindex = el.cellIndex;
                var tr = el.parentElement;
                rindex = tr.rowIndex;
        
                if (tr.parentElement.parentElement == this.FNormalCells)
                {
                  rindex = rindex + this.FFixedRows;
                  cindex = cindex + this.FFixedCols;
                }
                if (tr.parentElement.parentElement == this.FFixedCol)
                {
                  rindex = rindex + this.FFixedRows;
                }
                if (tr.parentElement.parentElement == this.FFixedRow)
                {
                  cindex = cindex + this.FFixedCols;
                }
              };
      };
      R.set(rindex);
      C.set(cindex);
    };
    this.LoadFromJSON = function (AURL, ADataNode) {
      this.FDataNode = ADataNode;
      this.FReq = new XMLHttpRequest();
      this.FReq.addEventListener("load",rtl.createSafeCallback(this,"DoHttpLoadJson"));
      this.FReq.addEventListener("abort",rtl.createSafeCallback(this,"DoHttpAbort"));
      this.FReq.open("GET",AURL);
      this.DoHttpRequest(this.FReq);
      this.FReq.send();
    };
    this.LoadFromJSON$1 = function (AJSON, ADataNode) {
      var JO = undefined;
      var JA = null;
      var r = 0;
      var c = 0;
      var arow = "";
      var sl = null;
      var ce = null;
      var cd = "";
      var cn = "";
      if (ADataNode !== "") {
        JA = AJSON[ADataNode]}
       else JA = AJSON;
      if (JA != null) {
        sl = pas.Classes.TStringList.$create("Create$1");
        this.Clear();
        this.SetRowCount(JA.length + this.FFixedRows);
        for (var $l = 0, $end = JA.length - 1; $l <= $end; $l++) {
          r = $l;
          JO = JA[r];
          c = 0;
          arow = "";
          var x = undefined;
          for (x in JO) {
            arow += "|" + JO[x];
            c++;
          };
          pas.System.Delete({get: function () {
              return arow;
            }, set: function (v) {
              arow = v;
            }},1,1);
          sl.FStrictDelimiter = true;
          sl.SetDelimiter("|");
          sl.SetDelimitedText(arow);
          if (this.FColCount < sl.GetCount()) this.SetColCount(sl.GetCount() + this.FFixedCols);
          for (var $l1 = 0, $end1 = sl.GetCount() - 1; $l1 <= $end1; $l1++) {
            c = $l1;
            cd = sl.Get(c);
            this.GetCellData(this.FFixedCols + c,this.FFixedRows + r,null,{get: function () {
                return cd;
              }, set: function (v) {
                cd = v;
              }});
            this.SetCells(this.FFixedCols + c,this.FFixedRows + r,cd);
            cn = "";
            ce = this.GetCellElements(this.FFixedCols + c,this.FFixedRows + r);
            this.GetCellChildren(this.FFixedCols + c,this.FFixedRows + r,null,cd,ce);
            this.GetCellClassName(this.FFixedCols + c,this.FFixedRows + r,null,cd,{get: function () {
                return cn;
              }, set: function (v) {
                cn = v;
              }});
            if (cn !== "") ce.setAttribute("class",cn);
          };
        };
        sl = rtl.freeLoc(sl);
      };
      this.UpdateGridSize();
      this.UpdateGridAlignment();
    };
    this.LoadFromJSONAsync = function (AURL, ADataNode) {
      var $Self = this;
      var Result = null;
      Result = new Promise(function (ASuccess, AFailed) {
        function DoLoad(Event) {
          var Result = false;
          if ($Self.DoHttpLoadJson(Event)) {
            ASuccess(Event.target)}
           else AFailed(Event.target);
          Result = true;
          return Result;
        };
        function DoError(Event) {
          var Result = false;
          AFailed(Event.target);
          Result = true;
          return Result;
        };
        $Self.FDataNode = ADataNode;
        $Self.FReq = new XMLHttpRequest();
        $Self.FReq.addEventListener("load",rtl.createSafeCallback(null,DoLoad));
        $Self.FReq.addEventListener("abort",rtl.createSafeCallback(null,DoError));
        $Self.FReq.addEventListener("timeout",rtl.createSafeCallback(null,DoError));
        $Self.FReq.addEventListener("error",rtl.createSafeCallback(null,DoError));
        $Self.FReq.open("GET",AURL);
        $Self.DoHttpRequest($Self.FReq);
        $Self.FReq.send();
      });
      return Result;
    };
    this.LoadFromCSV = function (AURL, Delimiter, LoadFixed) {
      this.FDelimiter = Delimiter;
      this.FLoadFixed = LoadFixed;
      this.FReq = new XMLHttpRequest();
      this.FReq.addEventListener("load",rtl.createSafeCallback(this,"DoHttpLoadCsv"));
      this.FReq.addEventListener("abort",rtl.createSafeCallback(this,"DoHttpAbort"));
      this.FReq.open("GET",AURL);
      this.DoHttpRequest(this.FReq);
      this.FReq.send();
    };
    this.LoadFromCSVAsync = function (AURL, Delimiter, LoadFixed) {
      var $Self = this;
      var Result = null;
      Result = new Promise(function (ASuccess, AFailed) {
        function DoLoad(Event) {
          var Result = false;
          if ($Self.DoHttpLoadCsv(Event)) {
            ASuccess(Event.target)}
           else AFailed(Event.target);
          Result = true;
          return Result;
        };
        function DoError(Event) {
          var Result = false;
          AFailed(Event.target);
          Result = true;
          return Result;
        };
        $Self.FDelimiter = Delimiter;
        $Self.FLoadFixed = LoadFixed;
        $Self.FReq = new XMLHttpRequest();
        $Self.FReq.addEventListener("load",rtl.createSafeCallback(null,DoLoad));
        $Self.FReq.addEventListener("abort",rtl.createSafeCallback(null,DoError));
        $Self.FReq.addEventListener("timeout",rtl.createSafeCallback(null,DoError));
        $Self.FReq.addEventListener("error",rtl.createSafeCallback(null,DoError));
        $Self.FReq.open("GET",AURL);
        $Self.DoHttpRequest($Self.FReq);
        $Self.FReq.send();
      });
      return Result;
    };
    this.LoadFromStrings = function (AStrings, Delimiter, LoadFixed) {
      this.FDelimiter = Delimiter;
      this.FLoadFixed = LoadFixed;
      this.LoadFromStringList(AStrings);
    };
    this.SaveToCSV = function (AFileName, Delimiter, SaveFixed) {
      var sl = null;
      sl = pas.Classes.TStringList.$create("Create$1");
      try {
        this.SaveToStrings(sl,Delimiter,SaveFixed);
        sl.SaveToFile(AFileName);
      } finally {
        sl = rtl.freeLoc(sl);
      };
    };
    this.SaveToStrings = function (AStrings, Delimiter, SaveFixed) {
      var r = 0;
      var c = 0;
      var fr = 0;
      var fc = 0;
      var s = "";
      var rowstr = "";
      fr = 0;
      fc = 0;
      if (!SaveFixed) fc = this.FFixedCols;
      if (!SaveFixed) fr = this.FFixedRows;
      for (var $l = fr, $end = this.FRowCount - 1; $l <= $end; $l++) {
        r = $l;
        rowstr = "";
        for (var $l1 = fc, $end1 = this.FColCount - 1; $l1 <= $end1; $l1++) {
          c = $l1;
          s = this.GetCells(c,r);
          s = pas.SysUtils.StringReplace(s,'"','""',rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
          if ((pas.System.Pos(Delimiter,s) > 0) || (pas.System.Pos("\r",s) > 0)) {
            s = '"' + s + '"';
          };
          if (s === "") s = '""';
          if (rowstr === "") {
            rowstr = s}
           else rowstr = rowstr + Delimiter + s;
        };
        AStrings.Add(rowstr);
      };
    };
    this.SelectCell = function (ACol, ARow) {
      var rc = 0;
      var rr = 0;
      this.SetSelection($mod.GridRect(ACol,ARow,ACol,ARow));
      rc = ACol - this.FFixedCols;
      rr = ARow - this.FFixedRows;
      if ((rc >= 0) && (rr >= 0)) {
        //if all rows are deleted then no indicator is displayed
        if (this.FNormalCells.rows.length <= 0)
        {
          this.FSelectedCell = null;
          this.UpdateIndicator(this.FFixedRows);
          return;
        }
        this.FSelectedCell = this.FNormalCells.rows[rr].cells[rc];
      } else {
        this.FSelectedCell = null;
      };
    };
    this.InsertRow = function (Index) {
      var i = 0;
      var fr = 0;
      fr = this.FFixedRows;
      var tr;
      var td;
      if (Index < this.FFixedRows) {
        if (this.FFixedCols > 0) {
          tr = this.FFixedColRow.insertRow(Index-fr);
          td = tr.insertCell(i-1);
          for (var $l = 0, $end = this.FFixedCols - 1; $l <= $end; $l++) {
            i = $l;
            td = tr.insertCell(i-1);
          };
        };
        tr = this.FFixedRow.insertRow(Index);
        for (var $l1 = this.FFixedCols, $end1 = this.FColCount - 1; $l1 <= $end1; $l1++) {
          i = $l1;
          tr.insertCell(i-1);
        };
        this.FFixedRows = this.FFixedRows + 1;
      } else if (Index >= this.FFixedRows) {
        if (this.FFixedCols > 0) {
          tr = this.FFixedCol.insertRow(Index-fr);
          for (var $l2 = 0, $end2 = this.FFixedCols - 1; $l2 <= $end2; $l2++) {
            i = $l2;
            td = tr.insertCell(i-1);
          };
        };
        tr = this.FNormalCells.insertRow(Index-fr);
        for (var $l3 = this.FFixedCols, $end3 = this.FColCount - 1; $l3 <= $end3; $l3++) {
          i = $l3;
          tr.insertCell(i-1);
        };
      };
      this.FRowCount = this.FRowCount + 1;
      this.SetRowHeights(Index,this.FDefaultRowHeight);
      this.UpdateGridSize();
      this.UpdateGridAlignment();
    };
    this.RemoveRow = function (Index) {
      var td = null;
      var tr = null;
      var fr = 0;
      var i = 0;
      if (Index >= this.FRowCount) throw pas.SysUtils.Exception.$create("Create$1",["Invalid row index"]);
      fr = this.FFixedRows;
      if (Index < this.FFixedRows) {
        if (this.FFixedCols > 0) {
          this.FFixedColRow.deleteRow(Index);
        };
        this.FFixedRow.deleteRow(Index);
      } else {
        if (this.FFixedCols > 0) {
          this.FFixedCol.deleteRow(Index -fr);
        };
        this.FNormalCells.deleteRow(Index - fr);
      };
      if (this.FRowHeights.GetCount() === this.FRowCount) this.FRowHeights.Delete(Index);
      this.FRowCount = this.FRowCount - 1;
      this.SetRowHeights(0,this.GetRowHeights(0));
      this.UpdateGridSize();
      this.UpdateGridAlignment();
    };
    this.InsertColumn = function (Index) {
      var i = 0;
      var fc = 0;
      fc = this.FFixedCols;
      var tr;
      var td;
      if (Index < this.FFixedCols) {
        if (this.FFixedRows > 0) {
          for (var $l = 0, $end = this.FFixedRows - 1; $l <= $end; $l++) {
            i = $l;
            tr = this.FFixedColRow.rows[i];
            td = tr.insertCell(Index);
          };
        };
        for (var $l1 = 0, $end1 = this.FRowCount - 1 - this.FFixedRows; $l1 <= $end1; $l1++) {
          i = $l1;
          tr = this.FFixedCol.rows[i];
          td = tr.insertCell(Index);
        };
        this.FFixedCols = this.FFixedCols + 1;
      } else {
        if (this.FFixedRows > 0) {
          for (var $l2 = 0, $end2 = this.FFixedRows - 1; $l2 <= $end2; $l2++) {
            i = $l2;
            tr = this.FFixedRow.rows[i];
            td = tr.insertCell(Index - fc);
          };
        };
        for (var $l3 = 0, $end3 = this.FRowCount - 1 - this.FFixedRows; $l3 <= $end3; $l3++) {
          i = $l3;
          tr = this.FNormalCells.rows[i];
          td = tr.insertCell(Index - fc);
        };
      };
      this.FColCount = this.FColCount + 1;
      for (var $l4 = this.FColCount - 1, $end4 = Index; $l4 >= $end4; $l4--) {
        i = $l4;
        if (Index > 0) this.SetColWidths(i,this.GetColWidths(i - 1));
      };
      this.SetColWidths(Index,this.FDefaultColWidth);
    };
    this.RemoveColumn = function (Index) {
      var i = 0;
      var fc = 0;
      fc = this.FFixedCols;
      var tr;
      var td;
      if (Index < this.FFixedCols) {
        if (this.FFixedRows > 0) {
          for (var $l = 0, $end = this.FFixedRows - 1; $l <= $end; $l++) {
            i = $l;
            tr = this.FFixedColRow.rows[i];
            td = tr.deleteCell(Index);
          };
        };
        for (var $l1 = 0, $end1 = this.FRowCount - 1 - this.FFixedRows; $l1 <= $end1; $l1++) {
          i = $l1;
          tr = this.FFixedCol.rows[i];
          td = tr.deleteCell(Index);
        };
        this.FFixedCols = this.FFixedCols - 1;
      } else {
        if (this.FFixedRows > 0) {
          for (var $l2 = 0, $end2 = this.FFixedRows - 1; $l2 <= $end2; $l2++) {
            i = $l2;
            tr = this.FFixedRow.rows[i];
            td = tr.deleteCell(Index - fc);
          };
        };
        for (var $l3 = 0, $end3 = this.FRowCount - 1 - this.FFixedRows; $l3 <= $end3; $l3++) {
          i = $l3;
          tr = this.FNormalCells.rows[i];
          td = tr.deleteCell(Index - fc);
        };
      };
      this.FColCount = this.FColCount - 1;
      for (var $l4 = Index, $end4 = this.FColCount - 1; $l4 <= $end4; $l4++) {
        i = $l4;
        this.SetColWidths(i,this.GetColWidths(i + 1));
      };
    };
    this.AddCheckBox = function (ACol, ARow, AState) {
      var chk = null;
      if ((ACol < this.FColCount) && (ARow < this.FRowCount)) {
        if (!this.HasCheckBox(ACol,ARow)) {
          chk = document.createElement("INPUT");
          chk.setAttribute("type","checkbox");
          chk.checked = AState;
          this.GetCellElements(ACol,ARow).insertBefore(chk,this.GetCellElements(ACol,ARow).firstChild);
          chk.addEventListener("click",this.FHandleCheckClickPtr);
        };
      };
    };
    this.RemoveCheckBox = function (ACol, ARow) {
      var el = null;
      if ((ACol < this.FColCount) && (ARow < this.FRowCount)) {
        el = this.GetCheckElement(ACol,ARow);
        if (el != null) {
          el.removeEventListener("click",this.FHandleCheckClickPtr);
          el.remove();
        };
      };
    };
    this.HasCheckBox = function (ACol, ARow) {
      var Result = false;
      var el = null;
      Result = false;
      if ((ACol < this.FColCount) && (ARow < this.FRowCount)) {
        el = this.GetCheckElement(ACol,ARow);
        Result = el != null;
      };
      return Result;
    };
    this.AddButton = function (ACol, ARow, AText, AStyle) {
      var s = "";
      var ct = "";
      var el = null;
      if ((ARow >= 0) && (ACol >= 0) && !this.HasCheckBox(ACol,ARow)) {
        ct = this.GetCells(ACol,ARow);
        if (ct !== "") ct = "&nbsp;" + ct;
        s = '<BUTTON type="button" style="vertical-align:middle"';
        if (AStyle !== "") s = s + ' class="' + AStyle + '"';
        s = s + ">" + AText + "</BUTTON>";
        this.SetCells(ACol,ARow,s + ct);
        el = this.GetCellElements(ACol,ARow);
        this.BindCellButton(ACol,ARow,el);
      };
    };
    this.RemoveButton = function (ACol, ARow) {
      var el = null;
      if ((ACol < this.FColCount) && (ARow < this.FRowCount)) {
        el = this.GetButtonElement(ACol,ARow);
        if (el != null) {
          el.removeEventListener("click",this.FHandleCheckClickPtr);
          el.remove();
        };
      };
    };
    this.HasButton = function (ACol, ARow) {
      var Result = false;
      var el = null;
      Result = false;
      if ((ACol < this.FColCount) && (ARow < this.FRowCount)) {
        el = this.GetButtonElement(ACol,ARow);
        Result = el != null;
      };
      return Result;
    };
    this.AddCanvas = function (ACol, ARow) {
      var el = null;
      var w = 0;
      var h = 0;
      if ((ACol < this.FColCount) && (ARow < this.FRowCount)) {
        if (!this.HasCanvas(ACol,ARow)) {
          w = this.GetColWidths(ACol);
          h = this.GetRowHeights(ARow);
          el = document.createElement("CANVAS");
          el.setAttribute("width",pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
              return w;
            }, set: function (v) {
              w = v;
            }}) + "px");
          el.setAttribute("height",pas["WEBLib.Utils"].TLongIntHelper.ToString.call({a: h - 1, get: function () {
              return this.a;
            }, set: function (v) {
              rtl.raiseE("EPropReadOnly");
            }}) + "px");
          el.style.setProperty("display","block");
          this.GetCellElements(ACol,ARow).insertBefore(el,this.GetCellElements(ACol,ARow).firstChild);
        };
      };
    };
    this.RemoveCanvas = function (ACol, ARow) {
      var el = null;
      if ((ACol < this.FColCount) && (ARow < this.FRowCount)) {
        el = this.GetCanvasElement(ACol,ARow);
        if (el != null) {
          el.remove();
        };
      };
    };
    this.HasCanvas = function (ACol, ARow) {
      var Result = false;
      var el = null;
      Result = false;
      if ((ACol < this.FColCount) && (ARow < this.FRowCount)) {
        el = this.GetCanvasElement(ACol,ARow);
        Result = el != null;
      };
      return Result;
    };
    this.GetCanvas$1 = function (ACol, ARow) {
      var Result = null;
      var el = null;
      Result = null;
      if ((ACol < this.FColCount) && (ARow < this.FRowCount)) {
        el = this.GetCanvasElement(ACol,ARow);
        if (el != null) Result = el;
      };
      return Result;
    };
    this.AddSortIndicator = function (ACol, ARow, AIndicator) {
      var s = "";
      var sid = "";
      var sp = 0;
      s = this.GetCells(ACol,ARow);
      sp = pas.System.Pos("<span",s);
      if (sp > 0) s = pas.System.Copy(s,1,sp - 1);
      sid = this.FName + "si" + pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
          return ACol;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }}) + "_" + pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
          return ARow;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }});
      var $tmp = AIndicator;
      if ($tmp === $mod.TGridSortIndicator.siNone) {
        this.SetCells(ACol,ARow,s)}
       else if ($tmp === $mod.TGridSortIndicator.siAscending) {
        this.SetCells(ACol,ARow,s + '<span style="cursor:pointer;float:right" id="' + sid + '" sort="up">' + $impl.GlyphAscending + "</span>")}
       else if ($tmp === $mod.TGridSortIndicator.siDescending) this.SetCells(ACol,ARow,s + '<span style="cursor:pointer;float:right" id="' + sid + '" sort="dn">' + $impl.GlyphDescending + "</span>");
    };
    this.SelectSortIndicator = function (ACol, ARow, ASelect) {
      var el = null;
      var sid = "";
      sid = this.FName + "si" + pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
          return ACol;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }}) + "_" + pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
          return ARow;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }});
      el = document.getElementById(sid);
      if (el != null) {
        if (ASelect) {
          el.style.setProperty("color",pas["WEBLib.Graphics"].ColorToHTML(this.FSelectionColor))}
         else el.style.removeProperty("color");
      };
    };
    this.SetSortIndicator = function (ACol, ARow, AIndicator) {
      var el = null;
      var sid = "";
      sid = this.FName + "si" + pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
          return ACol;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }}) + "_" + pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
          return ARow;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }});
      el = document.getElementById(sid);
      if (el != null) {
        if (AIndicator === $mod.TGridSortIndicator.siAscending) {
          el.innerHTML = $impl.GlyphAscending;
          el.setAttribute("sort","up");
        } else {
          el.innerHTML = $impl.GlyphDescending;
          el.setAttribute("sort","dn");
        };
      };
    };
    this.HasSortIndicator = function (ACol, ARow) {
      var Result = false;
      var el = null;
      var sid = "";
      sid = this.FName + "si" + pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
          return ACol;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }}) + "_" + pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
          return ARow;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }});
      el = document.getElementById(sid);
      Result = el != null;
      return Result;
    };
    this.RemoveSortIndicator = function (ACol, ARow) {
      var el = null;
      var sid = "";
      sid = this.FName + "si" + pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
          return ACol;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }}) + "_" + pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
          return ARow;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }});
      el = document.getElementById(sid);
      if (el != null) el.parentElement.removeChild(el);
    };
    this.AddProgress = function (ACol, ARow, APosition, AStyle) {
      var prog = null;
      if ((ACol < this.FColCount) && (ARow < this.FRowCount)) {
        if (!this.HasProgress(ACol,ARow)) {
          prog = document.createElement("PROGRESS");
          prog.setAttribute("max","100");
          prog.setAttribute("value",pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
              return APosition;
            }, set: function (v) {
              APosition = v;
            }}));
          prog.style.setProperty("width","100%");
          if (AStyle !== "") prog.setAttribute("class",AStyle);
          this.GetCellElements(ACol,ARow).insertBefore(prog,this.GetCellElements(ACol,ARow).firstChild);
        };
      };
    };
    this.SetProgress = function (ACol, ARow, APosition) {
      var el = null;
      if ((ACol < this.FColCount) && (ARow < this.FRowCount)) {
        el = this.GetProgressElement(ACol,ARow);
        if (el != null) {
          el.setAttribute("value",pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
              return APosition;
            }, set: function (v) {
              APosition = v;
            }}));
        };
      };
    };
    this.RemoveProgress = function (ACol, ARow) {
      var el = null;
      if ((ACol < this.FColCount) && (ARow < this.FRowCount)) {
        el = this.GetProgressElement(ACol,ARow);
        el.remove();
      };
    };
    this.HasProgress = function (ACol, ARow) {
      var Result = false;
      var el = null;
      Result = false;
      if ((ACol < this.FColCount) && (ARow < this.FRowCount)) {
        el = this.GetProgressElement(ACol,ARow);
        Result = el != null;
      };
      return Result;
    };
    this.HasVertScrollBar = function () {
      var Result = false;
      Result = false;
      if (this.FNormalCells.parentElement != null) {
        Result = this.FNormalCells.parentElement.parentElement.clientHeight < this.FNormalCells.parentElement.scrollHeight;
      };
      return Result;
    };
    this.HasHorzScrollBar = function () {
      var Result = false;
      Result = false;
      if (this.FNormalCells.parentElement != null) {
        Result = this.FNormalCells.parentElement.parentElement.clientWidth < this.FNormalCells.parentElement.scrollWidth;
      };
      return Result;
    };
    this.MergeCells = function (ACol, ARow, NumCol, NumRow) {
      var i = 0;
      var j = 0;
      var el = null;
      var mel = null;
      var cw = 0;
      this.FHasMergedCells = true;
      mel = this.CellRealElement(ACol,ARow);
      for (var $l = NumCol; $l >= 1; $l--) {
        i = $l;
        for (var $l1 = NumRow; $l1 >= 1; $l1--) {
          j = $l1;
          if ((i > 1) || (j > 1)) {
            el = this.CellRealElement((ACol + i) - 1,(ARow + j) - 1);
            el.remove();
          };
        };
      };
      if (NumCol > 1) mel.setAttribute("colspan",pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
          return NumCol;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }}));
      if (NumRow > 1) mel.setAttribute("rowspan",pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
          return NumRow;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }}));
      if (ARow in rtl.createSet(0,1)) {
        cw = 0;
        for (var $l2 = ACol, $end = (ACol + NumCol) - 1; $l2 <= $end; $l2++) {
          i = $l2;
          cw = (cw + this.GetColWidths(i)) - 0;
          if (((ARow === 0) && ($mod.TGridOption.goFixedVertLine in this.FOptions)) || ((ARow === 1) && ($mod.TGridOption.goVertLine in this.FOptions))) if (NumCol > 1) cw += 1;
        };
        mel.style.setProperty("width",pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
            return cw;
          }, set: function (v) {
            cw = v;
          }}) + "px");
        mel.style.setProperty("max-width",pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
            return cw;
          }, set: function (v) {
            cw = v;
          }}) + "px");
      };
    };
    this.SplitCells = function (ACol, ARow) {
      var el = null;
      var td = null;
      var split = null;
      var i = 0;
      var j = 0;
      var NumRow = 0;
      var NumCol = 0;
      if (this.IsMergedCell(ACol,ARow,{get: function () {
          return NumCol;
        }, set: function (v) {
          NumCol = v;
        }},{get: function () {
          return NumRow;
        }, set: function (v) {
          NumRow = v;
        }})) {
        split = this.CellRealElement(ACol,ARow);
        for (var $l = 1, $end = Math.max(1,NumRow); $l <= $end; $l++) {
          i = $l;
          el = this.CellRealElement(ACol + NumCol,(ARow + i) - 1);
          for (var $l1 = 1, $end1 = Math.max(1,NumCol); $l1 <= $end1; $l1++) {
            j = $l1;
            if ((j === 1) && (i === 1)) continue;
            td = document.createElement("TD");
            el.parentNode.insertBefore(td,el);
          };
        };
        split.setAttribute("colspan","");
        split.setAttribute("rowspan","");
        if (ARow === 0) {
          for (var $l2 = ACol, $end2 = (ACol + NumCol) - 1; $l2 <= $end2; $l2++) {
            i = $l2;
            this.SetColWidths(i,this.GetColWidths(i));
          };
        };
      };
    };
    this.IsMergedCell = function (ACol, ARow, NumCol, NumRow) {
      var Result = false;
      NumCol.set(this.CellColSpan(ACol,ARow));
      NumRow.set(this.CellRowSpan(ACol,ARow));
      Result = (NumCol.get() > 1) || (NumRow.get() > 1);
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].ITMSFNCDataBinderGrid);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("BiDiMode",2,pas["WEBLib.Controls"].$rtti["TBiDiMode"],"FBiDiMode","SetBiDiMode",4,{Default: pas["WEBLib.Controls"].TBiDiMode.bdLeftToRight});
    $r.addProperty("BorderColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FBorderColor","SetBorderColor",4,{Default: 12632256});
    $r.addProperty("BorderStyle",2,pas["WEBLib.Controls"].$rtti["TBorderStyle"],"FBorderStyle","SetBorderStyle",4,{Default: pas["WEBLib.Controls"].TBorderStyle.bsSingle});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor",4,{Default: 16711422});
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("DefaultColAlignment",2,pas.Classes.$rtti["TAlignment"],"FDefaultColAlignment","SetDefaultColAlignment",4,{Default: pas.Classes.TAlignment.taLeftJustify});
    $r.addProperty("DefaultColWidth",2,rtl.longint,"FDefaultColWidth","SetDefaultColWidth",4,{Default: 64});
    $r.addProperty("DefaultRowHeight",2,rtl.longint,"FDefaultRowHeight","SetDefaultRowHeight",4,{Default: 24});
    $r.addProperty("EditAdvance",0,rtl.boolean,"FEditAdvance","FEditAdvance",4,{Default: false});
    $r.addProperty("EditMask",0,pas["WEBLib.Mask"].$rtti["TEditMask"],"FEditMask","FEditMask");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("ElementTableClassName",2,rtl.string,"FElementTableClassName","SetElementTableClassName");
    $r.addProperty("FixedRows",2,rtl.longint,"FFixedRows","SetFixedRows",4,{Default: 1});
    $r.addProperty("FixedCols",2,rtl.longint,"FFixedCols","SetFixedCols",4,{Default: 1});
    $r.addProperty("FixedColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FFixedColor","SetFixedColor",4,{Default: 15790320});
    $r.addProperty("FixedFont",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFixedFont","SetFixedFont");
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("GridLineColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FGridLineColor","SetGridLineColor",4,{Default: 12632256});
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("Options",0,$mod.$rtti["TGridOptions"],"FOptions","FOptions");
    $r.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",4,{Default: true});
    $r.addProperty("ParentBiDiMode",0,rtl.boolean,"FParentBiDiMode","FParentBiDiMode",4,{Default: true});
    $r.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti["TPopupMenu"],"FPopupMenu","FPopupMenu");
    $r.addProperty("RangeEdit",2,$mod.$rtti["TGridRange"],"FRange","SetRange");
    $r.addProperty("Scrollbars",0,pas["WEBLib.Controls"].$rtti["TScrollStyle"],"FScrollBars","FScrollBars",4,{Default: pas["WEBLib.Controls"].TScrollStyle.ssBoth});
    $r.addProperty("SelectionColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FSelectionColor","SetSelectionColor",4,{Default: 16748379});
    $r.addProperty("SelectionTextColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FSelectionTextColor","SetSelectionTextColor",4,{Default: 16777215});
    $r.addProperty("ShowSelection",0,rtl.boolean,"FShowSelection","FShowSelection",4,{Default: true});
    $r.addProperty("StyleElements",0,pas["WEBLib.Controls"].$rtti["TStyleElements"],"FStyleElements","FStyleElements");
    $r.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder");
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("WordWrap",0,rtl.boolean,"FWordWrap","FWordWrap",4,{Default: false});
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnClickCell",0,$mod.$rtti["TCellEvent"],"FOnClickCell","FOnClickCell");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnDblClickCell",0,$mod.$rtti["TCellEvent"],"FOnDblClickCell","FOnDblClickCell");
    $r.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnEnter","FOnEnter");
    $r.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnExit","FOnExit");
    $r.addProperty("OnMouseWheelDown",0,pas["WEBLib.Controls"].$rtti["TMouseWheelUpDownEvent"],"FOnMouseWheelDown","FOnMouseWheelDown");
    $r.addProperty("OnMouseWheelUp",0,pas["WEBLib.Controls"].$rtti["TMouseWheelUpDownEvent"],"FOnMouseWheelUp","FOnMouseWheelUp");
    $r.addProperty("OnCanEditCell",0,$mod.$rtti["TCellCanEditEvent"],"FOnCanEditCell","FOnCanEditCell");
    $r.addProperty("OnColumnSized",0,$mod.$rtti["TColumnSizedEvent"],"FOnColumnSized","FOnColumnSized");
    $r.addProperty("OnGetCellData",0,$mod.$rtti["TGridGetCellDataEvent"],"FOnGetCellData","FOnGetCellData");
    $r.addProperty("OnGetCellChildren",0,$mod.$rtti["TGridGetCellChildrenEvent"],"FOnGetCellChildren","FOnGetCellChildren");
    $r.addProperty("OnGetCellClass",0,$mod.$rtti["TGridGetCellClassEvent"],"FOnGetCellClass","FOnGetCellClass");
    $r.addProperty("OnGetCellEditor",0,$mod.$rtti["TGridGetCellEditorEvent"],"FOnGetCellEditor","FOnGetCellEditor");
    $r.addProperty("OnButtonClick",0,$mod.$rtti["TCellEvent"],"FOnButtonClick","FOnButtonClick");
    $r.addProperty("OnCheckClick",0,$mod.$rtti["TCellCheckEvent"],"FOnCheckClick","FOnCheckClick");
    $r.addProperty("OnFixedCellClick",0,$mod.$rtti["TCellEvent"],"FOnFixedCellClick","FOnFixedCellClick");
    $r.addProperty("OnGetEditText",0,$mod.$rtti["TGetEditEvent"],"FOnGetEditText","FOnGetEditText");
    $r.addProperty("OnSetEditText",0,$mod.$rtti["TSetEditEvent"],"FOnSetEditText","FOnSetEditText");
    $r.addProperty("OnSetEditControlValue",0,$mod.$rtti["TSetEditControlValueEvent"],"FOnSetEditControlValue","FOnSetEditControlValue");
    $r.addProperty("OnGetEditControlValue",0,$mod.$rtti["TGetEditControlValueEvent"],"FOnGetEditControlValue","FOnGetEditControlValue");
    $r.addProperty("OnResize",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnResize","FOnResize");
    $r.addProperty("OnSelectCell",0,$mod.$rtti["TSelectCellEvent"],"FOnSelectCell","FOnSelectCell");
    $r.addProperty("OnSortClick",0,$mod.$rtti["TGridSortClickEvent"],"FOnSortClick","FOnSortClick");
    $r.addProperty("OnTopLeftChanged",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnTopLeftChanged","FOnTopLeftChanged");
    $r.addProperty("OnValidateEdit",0,$mod.$rtti["TGetEditEvent"],"FOnValidateEdit","FOnValidateEdit");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
  });
  rtl.createClass(this,"TStringGrid",this.TCustomStringGrid,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].ITMSFNCDataBinderGrid);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("ColCount",2,rtl.longint,"FColCount","SetColCount");
    $r.addProperty("RowCount",2,rtl.longint,"FRowCount","SetRowCount");
    $r.addProperty("OnHttpRequestError",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnHttpRequestError","FOnHttpRequestError");
    $r.addProperty("OnHttpRequestSuccess",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnHttpRequestSuccess","FOnHttpRequestSuccess");
  });
  rtl.createClass(this,"TWebStringGrid",this.TStringGrid,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].ITMSFNCDataBinderGrid);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.$rtti.$Class("TCustomTableControl");
  this.TTablePager = {"0": "tpNone", tpNone: 0, "1": "tpDropDown", tpDropDown: 1, "2": "tpLink", tpLink: 2, "3": "tpButton", tpButton: 3, "4": "tpList", tpList: 4, "5": "tpPrevNext", tpPrevNext: 5};
  this.$rtti.$Enum("TTablePager",{minvalue: 0, maxvalue: 5, ordtype: 1, enumtype: this.TTablePager});
  this.TTablePagerAlign = {"0": "paRight", paRight: 0, "1": "paCenter", paCenter: 1, "2": "paLeft", paLeft: 2};
  this.$rtti.$Enum("TTablePagerAlign",{minvalue: 0, maxvalue: 2, ordtype: 1, enumtype: this.TTablePagerAlign});
  rtl.createClass(this,"TTableControlHeader",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FPageEventPtr = null;
      this.FFilterEventPtr = null;
      this.FSearchEventPtr = null;
      this.FOwner = null;
      this.FElement = null;
      this.FPagerElement = null;
      this.FSearchElement = null;
      this.FFilterElement = null;
      this.FSearchInput = null;
      this.FFilterInput = null;
      this.FVisible = false;
      this.FCaption = "";
      this.FSearchValue = "";
      this.FFilterValue = "";
      this.FOnChange = null;
      this.FPager = 0;
      this.FButtonElementClassName = "";
      this.FLinkElementClassName = "";
      this.FDropDownElementClassName = "";
      this.FListElementClassName = "";
      this.FListItemElementClassName = "";
      this.FInputElementClassName = "";
      this.FFilterColumn = 0;
      this.FSearch = false;
      this.FFilter = false;
      this.FButtonActiveElementClassName = "";
      this.FLinkActiveElementClassName = "";
      this.FListLinkElementClassName = "";
      this.FPagerAlign = 0;
    };
    this.$final = function () {
      this.FOwner = undefined;
      this.FElement = undefined;
      this.FPagerElement = undefined;
      this.FSearchElement = undefined;
      this.FFilterElement = undefined;
      this.FSearchInput = undefined;
      this.FFilterInput = undefined;
      this.FOnChange = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetCaption = function (Value) {
      if (this.FCaption !== Value) {
        this.FCaption = Value;
        this.FOwner.RenderGrid();
      };
    };
    this.SetVisible = function (Value) {
      if (this.FVisible !== Value) {
        this.FVisible = Value;
        this.FOwner.ReRenderGrid();
      };
    };
    this.SetPager = function (Value) {
      if (this.FPager !== Value) {
        this.FPager = Value;
        this.Update(this.FOwner.FPaging.FSize,this.FOwner.FRowCount,this.FOwner.FPaging.FActivePage);
      };
    };
    this.SetPagerAlign = function (Value) {
      if (this.FPagerAlign !== Value) {
        this.FPagerAlign = Value;
        this.FOwner.ReRenderGrid();
      };
    };
    this.Changed = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Update = function (PageSize, RowCount, ActivePage) {
      var opt = null;
      var lnk = null;
      var itm = null;
      var btn = null;
      var i = 0;
      var numpages = 0;
      var trc = 0;
      if (!(this.FElement != null)) return;
      if (this.FSearchElement != null) {
        this.FSearchElement.parentElement.removeChild(this.FSearchElement);
        this.FSearchElement = null;
      };
      if (this.FFilterElement != null) {
        this.FFilterElement.parentElement.removeChild(this.FFilterElement);
        this.FFilterElement = null;
      };
      if (this.FSearch) {
        this.FSearchElement = document.createElement("DIV");
        this.FSearchElement.style.setProperty("float","left");
        this.FSearchInput = document.createElement("INPUT");
        if (this.FInputElementClassName !== "") this.FSearchInput.setAttribute("class",this.FInputElementClassName);
        this.FSearchInput.style.setProperty("display","inline");
        this.FSearchInput.style.setProperty("width","auto");
        btn = document.createElement("IMG");
        btn.setAttribute("src",pas["WEBLib.Ctrls.SVG"].ICON_SEARCH);
        btn.style.setProperty("vertical-align","middle");
        btn.style.setProperty("margin-right","10px");
        this.FSearchElement.appendChild(this.FSearchInput);
        this.FSearchElement.appendChild(btn);
        this.FElement.appendChild(this.FSearchElement);
        btn.addEventListener("click",this.FSearchEventPtr);
        this.FSearchInput.value = this.FSearchValue;
      };
      if (this.FFilter) {
        this.FFilterElement = document.createElement("DIV");
        this.FFilterElement.style.setProperty("float","left");
        this.FFilterInput = document.createElement("INPUT");
        if (this.FInputElementClassName !== "") this.FFilterInput.setAttribute("class",this.FInputElementClassName);
        this.FFilterInput.style.setProperty("display","inline");
        this.FFilterInput.style.setProperty("width","auto");
        btn = document.createElement("IMG");
        btn.setAttribute("src",pas["WEBLib.Ctrls.SVG"].ICON_FILTER);
        btn.style.setProperty("vertical-align","middle");
        btn.style.setProperty("margin-right","10px");
        this.FFilterElement.appendChild(this.FFilterInput);
        this.FFilterElement.appendChild(btn);
        this.FElement.appendChild(this.FFilterElement);
        btn.addEventListener("click",this.FFilterEventPtr);
        this.FFilterInput.value = this.FFilterValue;
      };
      trc = 0;
      if (this.FOwner.FRowHeader) trc += 1;
      numpages = rtl.trunc((RowCount - trc) / PageSize);
      if (((RowCount - trc) % PageSize) > 0) numpages += 1;
      this.FOwner.FPaging.FPageCount = numpages;
      if (this.FPagerElement != null) {
        this.FPagerElement.parentElement.removeChild(this.FPagerElement);
        this.FPagerElement = null;
      };
      if (!this.FOwner.FPaging.FEnabled) return;
      if (this.FPager === $mod.TTablePager.tpDropDown) {
        this.FPagerElement = document.createElement("SELECT");
        if (this.FDropDownElementClassName !== "") this.FPagerElement.setAttribute("class",this.FDropDownElementClassName);
        this.FPagerElement.addEventListener("change",this.FPageEventPtr);
        for (var $l = 0, $end = numpages - 1; $l <= $end; $l++) {
          i = $l;
          opt = document.createElement("option");
          opt.text = pas["WEBLib.Utils"].TLongIntHelper.ToString.call({a: i + 1, get: function () {
              return this.a;
            }, set: function (v) {
              rtl.raiseE("EPropReadOnly");
            }});
          opt.setAttribute("data",pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
              return i;
            }, set: function (v) {
              i = v;
            }}));
          if (i === ActivePage) opt.setAttribute("selected","selected");
          this.FPagerElement.add(opt);
        };
        var $tmp = this.FPagerAlign;
        if ($tmp === $mod.TTablePagerAlign.paRight) {
          this.FPagerElement.style.setProperty("float","right")}
         else if ($tmp === $mod.TTablePagerAlign.paLeft) {
          this.FPagerElement.style.setProperty("float","left")}
         else if ($tmp === $mod.TTablePagerAlign.paCenter) {
          this.FPagerElement.style.removeProperty("float");
          this.FPagerElement.style.setProperty("max-width","content");
          this.FPagerElement.style.setProperty("margin-left","auto");
          this.FPagerElement.style.setProperty("margin-right","auto");
        };
        this.FPagerElement.style.setProperty("display","inline");
        this.FPagerElement.style.setProperty("width","auto");
        this.FElement.appendChild(this.FPagerElement);
      };
      if (this.FPager === $mod.TTablePager.tpLink) {
        this.FPagerElement = document.createElement("DIV");
        for (var $l1 = 0, $end1 = numpages - 1; $l1 <= $end1; $l1++) {
          i = $l1;
          lnk = document.createElement("A");
          lnk.innerHTML = pas["WEBLib.Utils"].TLongIntHelper.ToString.call({a: i + 1, get: function () {
              return this.a;
            }, set: function (v) {
              rtl.raiseE("EPropReadOnly");
            }});
          lnk.setAttribute("href","#");
          if (this.FLinkElementClassName !== "") {
            if ((i === ActivePage) && (this.FLinkActiveElementClassName !== "")) {
              lnk.setAttribute("class",this.FLinkActiveElementClassName)}
             else lnk.setAttribute("class",this.FLinkElementClassName);
          };
          lnk.style.setProperty("margin-right","4px");
          lnk.style.setProperty("display","inline");
          lnk.setAttribute("data",pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
              return i;
            }, set: function (v) {
              i = v;
            }}));
          lnk.addEventListener("click",this.FPageEventPtr);
          this.FPagerElement.appendChild(lnk);
        };
        var $tmp1 = this.FPagerAlign;
        if ($tmp1 === $mod.TTablePagerAlign.paRight) {
          this.FPagerElement.style.setProperty("float","right")}
         else if ($tmp1 === $mod.TTablePagerAlign.paLeft) {
          this.FPagerElement.style.setProperty("float","left")}
         else if ($tmp1 === $mod.TTablePagerAlign.paCenter) {
          this.FPagerElement.style.removeProperty("float");
          this.FPagerElement.style.setProperty("max-width","content");
          this.FPagerElement.style.setProperty("margin-left","auto");
          this.FPagerElement.style.setProperty("margin-right","auto");
        };
        this.FElement.appendChild(this.FPagerElement);
      };
      if (this.FPager === $mod.TTablePager.tpButton) {
        this.FPagerElement = document.createElement("DIV");
        for (var $l2 = 0, $end2 = numpages - 1; $l2 <= $end2; $l2++) {
          i = $l2;
          lnk = document.createElement("BUTTON");
          lnk.innerHTML = pas["WEBLib.Utils"].TLongIntHelper.ToString.call({a: i + 1, get: function () {
              return this.a;
            }, set: function (v) {
              rtl.raiseE("EPropReadOnly");
            }});
          if (this.FButtonElementClassName !== "") {
            if ((i === ActivePage) && (this.FButtonActiveElementClassName !== "")) {
              lnk.setAttribute("class",this.FButtonActiveElementClassName)}
             else lnk.setAttribute("class",this.FButtonElementClassName);
          };
          lnk.setAttribute("data",pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
              return i;
            }, set: function (v) {
              i = v;
            }}));
          lnk.addEventListener("click",this.FPageEventPtr);
          lnk.style.setProperty("margin-right","4px");
          this.FPagerElement.appendChild(lnk);
        };
        var $tmp2 = this.FPagerAlign;
        if ($tmp2 === $mod.TTablePagerAlign.paRight) {
          this.FPagerElement.style.setProperty("float","right")}
         else if ($tmp2 === $mod.TTablePagerAlign.paLeft) {
          this.FPagerElement.style.setProperty("float","left")}
         else if ($tmp2 === $mod.TTablePagerAlign.paCenter) {
          this.FPagerElement.style.removeProperty("float");
          this.FPagerElement.style.setProperty("max-width","content");
          this.FPagerElement.style.setProperty("margin-left","auto");
          this.FPagerElement.style.setProperty("margin-right","auto");
        };
        this.FElement.appendChild(this.FPagerElement);
      };
      if (this.FPager === $mod.TTablePager.tpPrevNext) {
        this.FPagerElement = document.createElement("DIV");
        lnk = document.createElement("BUTTON");
        lnk.innerHTML = "&#xab;";
        lnk.setAttribute("data","0");
        if (this.FButtonElementClassName !== "") lnk.setAttribute("class",this.FButtonElementClassName);
        lnk.addEventListener("click",this.FPageEventPtr);
        lnk.style.setProperty("margin-right","4px");
        if (this.FOwner.FPaging.FActivePage === 0) lnk.setAttribute("disabled","");
        this.FPagerElement.appendChild(lnk);
        lnk = document.createElement("BUTTON");
        lnk.innerHTML = "&#x2039";
        lnk.setAttribute("data","1");
        if (this.FButtonElementClassName !== "") lnk.setAttribute("class",this.FButtonElementClassName);
        lnk.addEventListener("click",this.FPageEventPtr);
        lnk.style.setProperty("margin-right","4px");
        if (this.FOwner.FPaging.FActivePage === 0) lnk.setAttribute("disabled","");
        this.FPagerElement.appendChild(lnk);
        lnk = document.createElement("BUTTON");
        lnk.innerHTML = "&#x203A;";
        lnk.setAttribute("data","2");
        if (this.FButtonElementClassName !== "") lnk.setAttribute("class",this.FButtonElementClassName);
        lnk.addEventListener("click",this.FPageEventPtr);
        lnk.style.setProperty("margin-right","4px");
        if (this.FOwner.FPaging.FActivePage === this.FOwner.FPaging.FPageCount) lnk.setAttribute("disabled","");
        this.FPagerElement.appendChild(lnk);
        lnk = document.createElement("BUTTON");
        lnk.innerHTML = "&#xbb;";
        lnk.setAttribute("data","3");
        lnk.addEventListener("click",this.FPageEventPtr);
        if (this.FButtonElementClassName !== "") lnk.setAttribute("class",this.FButtonElementClassName);
        lnk.style.setProperty("margin-right","4px");
        this.FPagerElement.appendChild(lnk);
        var $tmp3 = this.FPagerAlign;
        if ($tmp3 === $mod.TTablePagerAlign.paRight) {
          this.FPagerElement.style.setProperty("float","right")}
         else if ($tmp3 === $mod.TTablePagerAlign.paLeft) {
          this.FPagerElement.style.setProperty("float","left")}
         else if ($tmp3 === $mod.TTablePagerAlign.paCenter) {
          this.FPagerElement.style.removeProperty("float");
          this.FPagerElement.style.setProperty("max-width","content");
          this.FPagerElement.style.setProperty("margin-left","auto");
          this.FPagerElement.style.setProperty("margin-right","auto");
        };
        if (this.FOwner.FPaging.FActivePage === this.FOwner.FPaging.FPageCount) lnk.setAttribute("disabled","");
        this.FElement.appendChild(this.FPagerElement);
      };
      if (this.FPager === $mod.TTablePager.tpList) {
        this.FPagerElement = document.createElement("UL");
        if (this.FListElementClassName !== "") this.FPagerElement.setAttribute("class",this.FListElementClassName);
        this.FPagerElement.style.setProperty("margin","0px");
        for (var $l3 = 0, $end3 = numpages - 1; $l3 <= $end3; $l3++) {
          i = $l3;
          itm = document.createElement("LI");
          if (this.FListItemElementClassName !== "") {
            if (i === ActivePage) {
              itm.setAttribute("class",this.FListItemElementClassName + " active")}
             else itm.setAttribute("class",this.FListItemElementClassName);
          };
          lnk = document.createElement("A");
          lnk.innerHTML = pas["WEBLib.Utils"].TLongIntHelper.ToString.call({a: i + 1, get: function () {
              return this.a;
            }, set: function (v) {
              rtl.raiseE("EPropReadOnly");
            }});
          lnk.setAttribute("href","#");
          lnk.setAttribute("data",pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
              return i;
            }, set: function (v) {
              i = v;
            }}));
          lnk.addEventListener("click",this.FPageEventPtr);
          if (this.FListLinkElementClassName !== "") lnk.setAttribute("class",this.FListLinkElementClassName);
          itm.appendChild(lnk);
          this.FPagerElement.appendChild(itm);
        };
        var $tmp4 = this.FPagerAlign;
        if ($tmp4 === $mod.TTablePagerAlign.paRight) {
          this.FPagerElement.style.setProperty("float","right")}
         else if ($tmp4 === $mod.TTablePagerAlign.paLeft) {
          this.FPagerElement.style.setProperty("float","left")}
         else if ($tmp4 === $mod.TTablePagerAlign.paCenter) {
          this.FPagerElement.style.removeProperty("float");
          this.FPagerElement.style.setProperty("max-width","content");
          this.FPagerElement.style.setProperty("margin-left","auto");
          this.FPagerElement.style.setProperty("margin-right","auto");
        };
        this.FElement.appendChild(this.FPagerElement);
      };
    };
    this.HandlePagerClick = function (Event) {
      var Result = false;
      var idx = 0;
      var s = "";
      Event.preventDefault();
      Event.stopPropagation();
      Result = true;
      if (this.FPager === $mod.TTablePager.tpDropDown) {
        idx = this.FPagerElement.selectedIndex;
      } else if (this.FPager === $mod.TTablePager.tpPrevNext) {
        s = Event.target.getAttribute("data");
        idx = pas.SysUtils.StrToInt(s);
        var $tmp = idx;
        if ($tmp === 0) {
          if (this.FOwner.FPaging.FActivePage > 0) {
            idx = 0}
           else return Result}
         else if ($tmp === 1) {
          if (this.FOwner.FPaging.FActivePage > 0) {
            idx = this.FOwner.FPaging.FActivePage - 1}
           else return Result}
         else if ($tmp === 2) {
          if (this.FOwner.FPaging.FActivePage < (this.FOwner.FPaging.FPageCount - 1)) {
            idx = this.FOwner.FPaging.FActivePage + 1}
           else return Result}
         else if ($tmp === 3) if (this.FOwner.FPaging.FActivePage < (this.FOwner.FPaging.FPageCount - 1)) {
          idx = this.FOwner.FPaging.FPageCount - 1}
         else return Result;
      } else {
        s = Event.target.getAttribute("data");
        idx = pas.SysUtils.StrToInt(s);
      };
      this.FOwner.DoSelectPage(idx);
      return Result;
    };
    this.HandleSearchClick = function (Event) {
      var Result = false;
      var cond = "";
      cond = this.FSearchInput.value;
      if ((cond !== "") && (cond !== this.FSearchValue)) {
        this.FSearchValue = cond;
        this.FOwner.FindCell(this.FSearchValue,true,false);
      } else this.FOwner.FindNext();
      Result = true;
      return Result;
    };
    this.HandleFilterClick = function (Event) {
      var Result = false;
      var cond = "";
      cond = this.FFilterInput.value;
      if ((cond === "") || (cond !== this.FFilterValue)) this.FOwner.RemoveFilter();
      if (cond !== "") {
        this.FFilterValue = cond;
        this.FOwner.SetFilter(this.FFilterColumn,this.FFilterValue,true);
      };
      Result = true;
      return Result;
    };
    this.Create$1 = function (AOwner) {
      pas.System.TObject.Create.call(this);
      this.FOwner = AOwner;
      this.FPagerElement = null;
      this.FPagerAlign = $mod.TTablePagerAlign.paRight;
      this.FPageEventPtr = rtl.createCallback(this,"HandlePagerClick");
      this.FSearchEventPtr = rtl.createCallback(this,"HandleSearchClick");
      this.FFilterEventPtr = rtl.createCallback(this,"HandleFilterClick");
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTableControlHeader.isPrototypeOf(Source)) {
        this.FCaption = rtl.as(Source,$mod.TTableControlHeader).FCaption;
        this.FVisible = rtl.as(Source,$mod.TTableControlHeader).FVisible;
        this.FPager = rtl.as(Source,$mod.TTableControlHeader).FPager;
        this.FPagerAlign = rtl.as(Source,$mod.TTableControlHeader).FPagerAlign;
        this.FButtonActiveElementClassName = rtl.as(Source,$mod.TTableControlHeader).FButtonActiveElementClassName;
        this.FButtonElementClassName = rtl.as(Source,$mod.TTableControlHeader).FButtonElementClassName;
        this.FLinkActiveElementClassName = rtl.as(Source,$mod.TTableControlHeader).FLinkActiveElementClassName;
        this.FLinkElementClassName = rtl.as(Source,$mod.TTableControlHeader).FLinkElementClassName;
        this.FDropDownElementClassName = rtl.as(Source,$mod.TTableControlHeader).FDropDownElementClassName;
        this.FInputElementClassName = rtl.as(Source,$mod.TTableControlHeader).FInputElementClassName;
        this.FFilterColumn = rtl.as(Source,$mod.TTableControlHeader).FFilterColumn;
        this.FFilter = rtl.as(Source,$mod.TTableControlHeader).FFilter;
        this.FSearch = rtl.as(Source,$mod.TTableControlHeader).FSearch;
        this.FListElementClassName = rtl.as(Source,$mod.TTableControlHeader).FListElementClassName;
        this.FListItemElementClassName = rtl.as(Source,$mod.TTableControlHeader).FListItemElementClassName;
        this.FListLinkElementClassName = rtl.as(Source,$mod.TTableControlHeader).FListLinkElementClassName;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("FilterColumn",0,rtl.longint,"FFilterColumn","FFilterColumn",4,{Default: 0});
    $r.addProperty("Filter",0,rtl.boolean,"FFilter","FFilter",4,{Default: false});
    $r.addProperty("Search",0,rtl.boolean,"FSearch","FSearch",4,{Default: false});
    $r.addProperty("ButtonActiveElementClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FButtonActiveElementClassName","FButtonActiveElementClassName");
    $r.addProperty("ButtonElementClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FButtonElementClassName","FButtonElementClassName");
    $r.addProperty("DropDownElementClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FDropDownElementClassName","FDropDownElementClassName");
    $r.addProperty("InputElementClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FInputElementClassName","FInputElementClassName");
    $r.addProperty("LinkActiveElementClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FLinkActiveElementClassName","FLinkActiveElementClassName");
    $r.addProperty("LinkElementClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FLinkElementClassName","FLinkElementClassName");
    $r.addProperty("ListElementClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FListElementClassName","FListElementClassName");
    $r.addProperty("ListLinkElementClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FListLinkElementClassName","FListLinkElementClassName");
    $r.addProperty("ListItemElementClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FListItemElementClassName","FListItemElementClassName");
    $r.addProperty("Caption",2,rtl.string,"FCaption","SetCaption");
    $r.addProperty("Pager",2,$mod.$rtti["TTablePager"],"FPager","SetPager");
    $r.addProperty("PagerAlign",2,$mod.$rtti["TTablePagerAlign"],"FPagerAlign","SetPagerAlign",4,{Default: $mod.TTablePagerAlign.paRight});
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: false});
  });
  rtl.createClass(this,"TTableControlPaging",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FOwner = null;
      this.FSize = 0;
      this.FIndex = 0;
      this.FEnabled = false;
      this.FActivePage = 0;
      this.FPageCount = 0;
    };
    this.$final = function () {
      this.FOwner = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetIndex = function (Value) {
      if ((this.FIndex !== Value) && (Value >= 0)) {
        if (this.FOwner.FPaging.FSize !== 0) if (!(Value < rtl.trunc(this.FOwner.FRowCount / this.FOwner.FPaging.FSize))) return;
        this.FActivePage = Value;
        this.FIndex = Value;
        this.FOwner.DoSelectPage(this.FIndex);
      };
    };
    this.SetSize = function (Value) {
      var FOldSize = 0;
      if (this.FSize !== Value) {
        FOldSize = this.FSize;
        this.FSize = Value;
        this.FOwner.RowCountChanged(this.FSize - FOldSize);
        this.FOwner.GridChanged();
      };
    };
    this.SetEnabled = function (Value) {
      var rh = 0;
      if (this.FEnabled !== Value) {
        this.FEnabled = Value;
        rh = 0;
        if (this.FOwner.FRowHeader) rh = 1;
        if (this.FEnabled) {
          this.FOwner.RowCountChanged((this.FSize + rh) - this.FOwner.FRowCount)}
         else this.FOwner.RowCountChanged(this.FOwner.FRowCount - this.FSize - rh);
        this.FOwner.ReRenderGrid();
      };
    };
    this.Create$1 = function (AOwner) {
      pas.System.TObject.Create.call(this);
      this.FOwner = AOwner;
      this.FSize = 10;
      this.FIndex = 0;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTableControlPaging.isPrototypeOf(Source)) {
        this.FEnabled = rtl.as(Source,$mod.TTableControlPaging).FEnabled;
        this.FSize = rtl.as(Source,$mod.TTableControlPaging).FSize;
        this.FIndex = rtl.as(Source,$mod.TTableControlPaging).FActivePage;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: false});
    $r.addProperty("Index",2,rtl.longint,"FActivePage","SetIndex",4,{Default: 0});
    $r.addProperty("Size",2,rtl.longint,"FSize","SetSize",4,{Default: 10});
  });
  rtl.createClass(this,"TTableControlOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FOwner = null;
      this.FScrollVertical = false;
      this.FResizeColumns = false;
      this.FAutoCellURL = false;
      this.FAutoCellEmail = false;
      this.FAutoCellImage = false;
      this.FCellBorderColor = 0;
      this.FCellBorders = false;
      this.FAutoNumAlign = false;
      this.FImageAlign = 0;
      this.FImageWidth = 0;
    };
    this.$final = function () {
      this.FOwner = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetResizeColumns = function (Value) {
      this.FResizeColumns = Value;
      this.FOwner.EnableColResize();
    };
    this.SetCellBorderColor = function (Value) {
      this.FCellBorderColor = Value;
      this.FOwner.RenderGridBorders();
    };
    this.SetCellBorders = function (Value) {
      this.FCellBorders = Value;
      this.FOwner.RenderGridBorders();
    };
    this.SetScrollVertical = function (Value) {
      this.FScrollVertical = Value;
      this.FOwner.UpdateElement();
    };
    this.Create$1 = function (AOwner) {
      this.FOwner = AOwner;
      this.FCellBorderColor = 12632256;
      this.FImageAlign = pas.Classes.TAlignment.taLeftJustify;
      this.FImageWidth = 0;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TTableControlOptions.isPrototypeOf(Source)) {
        this.FScrollVertical = rtl.as(Source,$mod.TTableControlOptions).FScrollVertical;
        this.FResizeColumns = rtl.as(Source,$mod.TTableControlOptions).FResizeColumns;
        this.FAutoCellURL = rtl.as(Source,$mod.TTableControlOptions).FAutoCellURL;
        this.FAutoCellEmail = rtl.as(Source,$mod.TTableControlOptions).FAutoCellEmail;
        this.FAutoCellImage = rtl.as(Source,$mod.TTableControlOptions).FAutoCellImage;
        this.FAutoNumAlign = rtl.as(Source,$mod.TTableControlOptions).FAutoNumAlign;
        this.FCellBorders = rtl.as(Source,$mod.TTableControlOptions).FCellBorders;
        this.FCellBorderColor = rtl.as(Source,$mod.TTableControlOptions).FCellBorderColor;
        this.FImageWidth = rtl.as(Source,$mod.TTableControlOptions).FImageWidth;
        this.FImageAlign = rtl.as(Source,$mod.TTableControlOptions).FImageAlign;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("AutoCellEmail",0,rtl.boolean,"FAutoCellEmail","FAutoCellEmail",4,{Default: false});
    $r.addProperty("AutoCellURL",0,rtl.boolean,"FAutoCellURL","FAutoCellURL",4,{Default: false});
    $r.addProperty("AutoCellImage",0,rtl.boolean,"FAutoCellImage","FAutoCellImage",4,{Default: false});
    $r.addProperty("AutoNumAlign",0,rtl.boolean,"FAutoNumAlign","FAutoNumAlign",4,{Default: false});
    $r.addProperty("CellBorders",2,rtl.boolean,"FCellBorders","SetCellBorders",4,{Default: false});
    $r.addProperty("CellBorderColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FCellBorderColor","SetCellBorderColor",4,{Default: 12632256});
    $r.addProperty("ImageAlign",0,pas.Classes.$rtti["TAlignment"],"FImageAlign","FImageAlign",4,{Default: pas.Classes.TAlignment.taLeftJustify});
    $r.addProperty("ImageWidth",0,rtl.longint,"FImageWidth","FImageWidth",4,{Default: 0});
    $r.addProperty("ScrollVertical",2,rtl.boolean,"FScrollVertical","SetScrollVertical",4,{Default: false});
    $r.addProperty("ResizeColumns",2,rtl.boolean,"FResizeColumns","SetResizeColumns",4,{Default: false});
  });
  this.$rtti.$MethodVar("TPageSelectEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["NewPage",rtl.longint],["Allow",rtl.boolean,1],["DefaultSelect",rtl.boolean,1]]), methodkind: 0});
  rtl.createClass(this,"TCustomTableControl",this.TCustomGrid,function () {
    this.$init = function () {
      $mod.TCustomGrid.$init.call(this);
      this.FReq = null;
      this.FDataNode = "";
      this.FData = undefined;
      this.FUnfiltered = undefined;
      this.FTable = null;
      this.FBody = null;
      this.FRowHeader = false;
      this.FColHeader = false;
      this.FDelimiter = "\x00";
      this.FLoadFixed = false;
      this.FFindCol = 0;
      this.FFindRow = 0;
      this.FFindCase = false;
      this.FFindCondition = "";
      this.FElementHeaderClassName = "";
      this.FElementTableClassName = "";
      this.FOnHttpRequestError = null;
      this.FOnHttpRequestSuccess = null;
      this.FOnDblClickCell = null;
      this.FOnClickCell = null;
      this.FOptions = null;
      this.FOnGetCellClass = null;
      this.FOnGetCellData = null;
      this.FOnGetCellChildren = null;
      this.FOnHttpRequest = null;
      this.FOnCheckClick = null;
      this.FOnButtonClick = null;
      this.FHandleCheckClickPtr = null;
      this.FHandleButtonClickPtr = null;
      this.FOnSortClick = null;
      this.FSortIndex = 0;
      this.FSortDirection = 0;
      this.FElementSelectionClassName = "";
      this.FElementRowSelectClassName = "";
      this.FRowIndex = 0;
      this.FSelectionTextColor = 0;
      this.FSelectionColor = 0;
      this.FHeader = null;
      this.FFooter = null;
      this.FPaging = null;
      this.FOnSelectPage = null;
      this.FHiddenCols = null;
      this.FWordWrap = false;
    };
    this.$final = function () {
      this.FReq = undefined;
      this.FTable = undefined;
      this.FBody = undefined;
      this.FOnHttpRequestError = undefined;
      this.FOnHttpRequestSuccess = undefined;
      this.FOnDblClickCell = undefined;
      this.FOnClickCell = undefined;
      this.FOptions = undefined;
      this.FOnGetCellClass = undefined;
      this.FOnGetCellData = undefined;
      this.FOnGetCellChildren = undefined;
      this.FOnHttpRequest = undefined;
      this.FOnCheckClick = undefined;
      this.FOnButtonClick = undefined;
      this.FOnSortClick = undefined;
      this.FHeader = undefined;
      this.FFooter = undefined;
      this.FPaging = undefined;
      this.FOnSelectPage = undefined;
      this.FHiddenCols = undefined;
      $mod.TCustomGrid.$final.call(this);
    };
    this.GetCells = function (col, row) {
      var Result = "";
      var res = "";
      var hdr = 0;
      var trc = 0;
      Result = "";
      hdr = 0;
      if (this.FHeader.FVisible) hdr = 1;
      trc = this.RenderRowCount();
      if (this.FRowHeader) trc += 1;
      if ((col >= 0) && (row >= 0) && (col < this.FColCount) && (hdr < 2)) {
        //      res = this.FData[row][col];
        //      if (res == undefined) {
                var td = this.FTable.rows[row + hdr].cells[col];
                //res = td.innerHTML;
        
                res = td.textContent;
                if (td.childElementCount > 0) {
                  if (td.firstChild.tagName == 'DIV')
                    res = td.firstChild.textContent;
                }
        //      };
        Result = res;
      };
      return Result;
    };
    this.SetCells = function (col, row, Value) {
      var trc = 0;
      var org = 0;
      var td = null;
      if (!(this.FTable != null)) return;
      trc = this.FRowCount;
      org = row;
      if (this.FRowHeader) trc += 1;
      if ((col >= 0) && (row >= 0) && (col < this.FColCount) && (row <= trc)) {
        if (row === 0) this.EnableColResize();
        if (row < this.FData.length) {
          this.FData[row][col] = Value;
        };
        if (this.FRowHeader) row = row - 1;
        if (this.InVisiblePage({get: function () {
            return row;
          }, set: function (v) {
            row = v;
          }}) || ((row === -1) && this.FRowHeader && (org < 1))) {
          if (this.FHeader.FVisible) row += 1;
          if (this.FRowHeader) row = row + 1;
          td = this.FTable.rows[row].cells[col];
          this.SetTableCell(col,row,td,Value);
        };
      };
    };
    this.GetRowClassName = function (row) {
      var Result = "";
      var res = "";
      res = "";
      if ((row >= 0) && (row < this.FRowCount)) {
        var tr = this.FTable.rows[row];
        res = tr.getAttribute('class');
      };
      Result = res;
      return Result;
    };
    this.SetRowClassName = function (row, Value) {
      if ((row >= 0) && (row < this.FRowCount)) {
        var tr = this.FTable.rows[row];
        tr.setAttribute('class',Value);
      };
    };
    this.GetCellElement = function (col, row) {
      var Result = null;
      var res = null;
      var rh = 0;
      var fr = 0;
      res = null;
      rh = 0;
      if (this.FHeader.FVisible) rh = 1;
      fr = 0;
      if (this.FColHeader) fr = 1;
      if ((col >= 0) && (row >= 0) && (col < this.FColCount) && (row <= (this.RenderRowCount() + rh + fr)) && (this.FTable != null)) {
        if ((this.FTable.rows.length > row + rh) && (this.FTable.rows[row + rh].cells.length > col)) {
          res = this.FTable.rows[row + rh].cells[col];
        };
      };
      Result = res;
      return Result;
    };
    this.GetCheckElement = function (ACol, ARow) {
      var Result = null;
      var el = null;
      var s = "";
      Result = null;
      if ((ACol < this.FColCount) && (ARow < this.FRowCount)) {
        el = this.GetCellElement(ACol,ARow).firstChild;
        if ((el != null) && rtl.isExt(el,Element) && (pas.SysUtils.UpperCase(el.tagName) === "DIV")) el = el.firstChild;
        if ((el != null) && rtl.isExt(el,Element)) {
          s = "";
          if (el.hasAttribute("type")) s = el.getAttribute("type");
          if ((s !== "") && (pas.SysUtils.UpperCase(s) === "CHECKBOX")) {
            Result = el;
          };
        };
      };
      return Result;
    };
    this.GetButtonElement = function (ACol, ARow) {
      var Result = null;
      var el = null;
      Result = null;
      if ((ACol < this.FColCount) && (ARow < this.FRowCount)) {
        el = this.GetCellElement(ACol,ARow);
        el = el.firstChild;
        if ((el != null) && (el.tagName === "DIV")) el = el.firstChild;
        if ((el != null) && (el.tagName === "BUTTON")) {
          Result = el;
        };
      };
      return Result;
    };
    this.GetProgressElement = function (ACol, ARow) {
      var Result = null;
      var el = null;
      Result = null;
      if ((ACol < this.FColCount) && (ARow < this.FRowCount)) {
        el = this.GetCellElement(ACol,ARow).firstChild;
        if ((el != null) && rtl.isExt(el,Element)) {
          if (pas.SysUtils.UpperCase(el.tagName) === "PROGRESS") {
            Result = el;
          };
        };
      };
      return Result;
    };
    this.SetOptions = function (Value) {
      this.FOptions.Assign(Value);
    };
    this.SetElementHeaderClassName = function (Value) {
      var head = null;
      if (this.FElementHeaderClassName !== Value) {
        this.FElementHeaderClassName = Value;
        if (this.FTable != null) {
          head = this.FTable.firstChild;
          if ((head != null) && (head.tagName === "THEAD")) head.setAttribute("class",this.FElementHeaderClassName);
        };
      };
    };
    this.SetElementTableClassName = function (Value) {
      if (this.FElementTableClassName !== Value) {
        this.FElementTableClassName = Value;
        if (this.FTable != null) this.FTable.setAttribute("class",this.FElementTableClassName);
      };
    };
    this.SetColHeader = function (Value) {
      if (this.FColHeader !== Value) {
        this.FColHeader = Value;
        if (this.FTable != null) {
          if (!(pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) this.ReRenderGrid();
        };
      };
    };
    this.SetRowHeader = function (Value) {
      if (this.FRowHeader !== Value) {
        this.FRowHeader = Value;
        if (this.FTable != null) {
          if (!(pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) this.ReRenderGrid();
        };
      };
    };
    this.SetSortIndex = function (Value) {
      this.FSortIndex = Value;
    };
    this.SetRowIndex = function (Value) {
      var el = null;
      if (this.FRowIndex !== -1) {
        el = this.GetCellElement(0,this.FRowIndex);
        if (el != null) {
          if (this.FElementRowSelectClassName === "") {
            el.parentElement.style.removeProperty("color");
            el.parentElement.style.removeProperty("background-color");
          } else el.parentElement.className = "";
        };
      };
      this.FRowIndex = Value;
      if (this.FRowIndex !== -1) {
        el = this.GetCellElement(0,this.FRowIndex);
        if (el != null) {
          if (this.FElementRowSelectClassName === "") {
            if (this.FSelectionTextColor !== -1) el.parentElement.style.setProperty("color",pas["WEBLib.Graphics"].ColorToHTML(this.FSelectionTextColor));
            if (this.FSelectionColor !== -1) el.parentElement.style.setProperty("background-color",pas["WEBLib.Graphics"].ColorToHTML(this.FSelectionColor));
          } else el.parentElement.classList.add(this.FElementRowSelectClassName);
        };
      };
    };
    this.SetSelectionColor = function (Value) {
      if (this.FSelectionColor !== Value) {
        this.FSelectionColor = Value;
        this.UpdateElement();
      };
    };
    this.SetSelectionTextColor = function (Value) {
      if (this.FSelectionTextColor !== Value) {
        this.FSelectionTextColor = Value;
        this.UpdateElement();
      };
    };
    this.SetFooter = function (Value) {
      this.FFooter.Assign(Value);
    };
    this.SetHeader = function (Value) {
      this.FHeader.Assign(Value);
    };
    this.SetPaging = function (Value) {
      this.FPaging.Assign(Value);
    };
    this.SetTableCell = function (ACol, ARow, ACell, Value) {
      var $Self = this;
      var clr = "";
      var td = "";
      var cn = "";
      var topcell = null;
      function IsEmail(s) {
        var Result = false;
        var res = false;
        var re = /\S+@\S+\.\S+/;
        res = re.test(s);
        Result = res;
        return Result;
      };
      function IsImgUrl(url) {
        var Result = false;
        var res = false;
        res = /\.(jpg|jpeg|png|webp|avif|gif)$/.test(url);
        Result = res;
        return Result;
      };
      function IsValidHttpUrl(s) {
        var Result = false;
        try {
          url = new URL(s);
        } catch (_) {
          return false;
        }
        return url.protocol === "http:" || url.protocol === "https:";
        return Result;
      };
      function IsNum(str) {
        var Result = false;
        if (typeof str != "string") return false // we only process strings!
        return !isNaN(str) && // use type coercion to parse the _entirety_ of the string (`parseFloat` alone does not do this)...
          !isNaN(parseFloat(str)) // ...and ensure strings of whitespace fail;
        return Result;
      };
      if ((pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) && (this.FElementTableClassName === "") && !this.FOptions.FCellBorders) {
        ACell.style.borderRight = "1px dashed gray";
        ACell.style.borderBottom = "1px dashed gray";
        ACell.innerHTML = "&nbsp;";
        return;
      };
      if (this.FOptions.FAutoCellEmail && IsEmail(Value)) {
        td = '<a href="mailto:' + Value + '">' + Value + "</a>"}
       else if (this.FOptions.FAutoCellImage && IsImgUrl(Value)) {
        if (this.FOptions.FImageWidth > 0) {
          td = '<img src="' + Value + '" width="' + pas["WEBLib.Utils"].TLongIntHelper.ToString.call({p: this.FOptions, get: function () {
              return this.p.FImageWidth;
            }, set: function (v) {
              this.p.FImageWidth = v;
            }}) + 'px">'}
         else td = '<img src="' + Value + '">';
        var $tmp = this.FOptions.FImageAlign;
        if ($tmp === pas.Classes.TAlignment.taCenter) {
          ACell.setAttribute("align","center")}
         else if ($tmp === pas.Classes.TAlignment.taRightJustify) ACell.setAttribute("align","right");
      } else if (this.FOptions.FAutoCellURL && IsValidHttpUrl(Value)) {
        td = '<a href="' + Value + '">' + Value + "</a>"}
       else {
        td = Value;
        if (this.FOptions.FAutoNumAlign && IsNum(Value)) ACell.setAttribute("align","right");
      };
      if (this.FWordWrap) {
        ACell.innerHTML = td}
       else ACell.innerHTML = '<div style="overflow: hidden; text-overflow: ellipsis; white-space:nowrap;">' + td + "</div>";
      if ((this.FElementTableClassName === "") && this.FOptions.FCellBorders) {
        clr = pas["WEBLib.Graphics"].ColorToHTML(this.FOptions.FCellBorderColor);
        ACell.style.borderRight = "1px solid " + clr;
        ACell.style.borderBottom = "1px solid " + clr;
      };
      cn = "";
      this.GetCellClassName(ACol,ARow,null,Value,{get: function () {
          return cn;
        }, set: function (v) {
          cn = v;
        }});
      if (cn !== "") ACell.setAttribute("class",cn);
    };
    this.GetColWidth = function (ACol) {
      var Result = 0;
      var td = null;
      var w = 0;
      Result = 0;
      if ((ACol < this.FColCount) && (ACol >= 0)) {
        td = this.GetCellElement(ACol,0);
        w = td.offsetWidth;
        Result = w;
      };
      return Result;
    };
    this.SetColWidth = function (ACol, AWidth) {
      var td = null;
      var el = null;
      var i = 0;
      if ((ACol < this.FColCount) && (ACol >= 0)) {
        if (AWidth > 0) {
          for (var $l = 0, $end = this.RenderRowCount(); $l <= $end; $l++) {
            i = $l;
            td = null;
            td = this.GetCellElement(ACol,i);
            if (td != null) {
              td.style.setProperty("width",pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
                  return AWidth;
                }, set: function (v) {
                  AWidth = v;
                }}) + "px");
              td.style.setProperty("max-width",pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
                  return AWidth;
                }, set: function (v) {
                  AWidth = v;
                }}) + "px");
              el = td.firstChild;
              if ((el != null) && (el.tagName === "DIV")) {
                el.style.setProperty("width",pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
                    return AWidth;
                  }, set: function (v) {
                    AWidth = v;
                  }}) + "px");
                el.style.setProperty("max-width",pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
                    return AWidth;
                  }, set: function (v) {
                    AWidth = v;
                  }}) + "px");
              };
            };
          };
        };
      };
    };
    this.SetWordWrap = function (AValue) {
      if (this.FWordWrap !== AValue) {
        this.FWordWrap = AValue;
        if (this.FTable != null) {
          if (!(pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) this.ReRenderGrid();
        };
      };
    };
    this.GetDataRowCount = function () {
      var Result = 0;
      if (this.FRowHeader || (this.FPaging.FEnabled === false)) {
        Result = this.FRowCount - 1}
       else Result = this.FRowCount;
      return Result;
    };
    this.ClearData = function () {
      this.Clear();
    };
    this.SetDataColumnCount = function (AValue) {
      if (this.FRowHeader) {
        this.SetColCount(AValue + 1)}
       else this.SetColCount(AValue);
    };
    this.SetDataRowCount = function (AValue) {
      if (this.FColHeader) {
        this.SetRowCount(AValue + 1)}
       else this.SetRowCount(AValue);
    };
    this.SetDataValue = function (AColumn, ARow, AValue) {
      var dc = 0;
      var dr = 0;
      dc = 0;
      dr = 0;
      if (this.FRowHeader) dc = 1;
      if (this.FColHeader) dr = 1;
      this.SetCells(AColumn + dc,ARow + dr,AValue);
    };
    this.SetDataHeader = function (AColumn, AValue) {
      var d = 0;
      if (!this.FColHeader) return;
      d = 0;
      if (this.FRowHeader) d = 1;
      this.SetCells(AColumn + d,0,AValue);
    };
    this.DataBeginUpdate = function () {
    };
    this.DataEndUpdate = function () {
    };
    this.DataInsertRow = function (AInsertPosition) {
      this.InsertRow(AInsertPosition);
    };
    this.ClearMethodPointers = function () {
      pas["WEBLib.Controls"].TControl.ClearMethodPointers.call(this);
      this.FHandleCheckClickPtr = null;
      this.FHandleButtonClickPtr = null;
    };
    this.GetMethodPointers = function () {
      pas["WEBLib.Controls"].TControl.GetMethodPointers.call(this);
      this.FHandleCheckClickPtr = rtl.createCallback(this,"HandleCheckBoxClick");
      this.FHandleButtonClickPtr = rtl.createCallback(this,"HandleButtonClick");
    };
    this.HandleDoKeyPress = function (Event) {
      var Result = false;
      pas["WEBLib.Controls"].TControl.HandleDoKeyPress.apply(this,arguments);
      Result = true;
      return Result;
    };
    this.ColOffset = function () {
      var Result = 0;
      if (this.FColHeader) {
        Result = 1}
       else Result = 0;
      return Result;
    };
    this.RowOffset = function () {
      var Result = 0;
      if (this.FRowHeader) {
        Result = 1}
       else Result = 0;
      return Result;
    };
    this.HandleDoClick = function (Event) {
      var Result = false;
      var c = 0;
      var r = 0;
      var tgt = null;
      var sd = 0;
      var tag = "";
      var s = "";
      tgt = Event.target;
      if (pas.SysUtils.UpperCase(tgt.tagName) === "BUTTON") {
        return Result;
      };
      if (pas.SysUtils.UpperCase(tgt.tagName) === "INPUT") {
        s = tgt.getAttribute("type");
        if (pas.System.Assigned(s) && (pas.SysUtils.UpperCase(s) === "CHECKBOX")) {
          return Result;
        };
      };
      sd = $mod.TGridSortIndicator.siNone;
      if (tgt.tagName === "SPAN") {
        if (tgt.getAttribute("sort") === "up") {
          sd = $mod.TGridSortIndicator.siAscending;
        } else if (tgt.getAttribute("sort") === "dn") {
          sd = $mod.TGridSortIndicator.siDescending;
        };
      };
      do {
        tag = tgt.tagName.toLowerCase();
        if ((tag !== "td") && (tag !== "th")) tgt = tgt.parentElement;
      } while (!((tag === "td") || (tag === "th") || (tgt === null)));
      if ((tag === "td") || (tag === "th")) {
        c = tgt.cellIndex;
        var tr = tgt.parentElement;
        r = tr.rowIndex;
        if (this.FHeader.FVisible) r -= 1;
        if (this.FPaging.FEnabled) {
          r = r + (this.FPaging.FActivePage * this.FPaging.FSize);
        };
        if ((this.FOnClickCell != null) && (sd === $mod.TGridSortIndicator.siNone) && this.FEnabled) this.FOnClickCell(this,c,r);
      };
      if (sd === $mod.TGridSortIndicator.siAscending) {
        this.DoSortClick(c,r,$mod.TGridSortIndicator.siDescending);
        this.SetSortIndicator(c,r,$mod.TGridSortIndicator.siDescending);
      } else if (sd === $mod.TGridSortIndicator.siDescending) {
        this.DoSortClick(c,r,$mod.TGridSortIndicator.siAscending);
        this.SetSortIndicator(c,r,$mod.TGridSortIndicator.siAscending);
      };
      if (this.FOnClick != null) this.FOnClick(this);
      Result = true;
      return Result;
    };
    this.HandleDoDblClick = function (Event) {
      var Result = false;
      var c = 0;
      var r = 0;
      var el = null;
      el = Event.target;
      if (el.tagName === "DIV") el = el.parentElement;
      if ((el.tagName === "TD") || (el.tagName === "TH")) {
        c = el.cellIndex;
        var tr = el.parentElement;
        r = tr.rowIndex;
        if (this.FPaging.FEnabled) {
          r = r + (this.FPaging.FActivePage * this.FPaging.FSize);
        };
        if (this.FOnDblClickCell != null) this.FOnDblClickCell(this,c,r);
      };
      Result = true;
      return Result;
    };
    this.HandleCheckBoxClick = function (Event) {
      var Result = false;
      var rindex = 0;
      var cindex = 0;
      var chk = false;
      Result = true;
      rindex = -1;
      cindex = -1;
      var el = Event.target;
      chk = el.checked;
      var d = el.parentElement;
      if (d.tagName.toLowerCase() == 'div')
      {
        d = d.parentElement;
      }
      if (d.tagName.toLowerCase() == 'td')
      {
        cindex = d.cellIndex;
        var tr = d.parentElement;
        rindex = tr.rowIndex;
      }
      if (d.tagName.toLowerCase() == 'th')
      {
        cindex = d.cellIndex;
        var tr = d.parentElement;
        rindex = tr.rowIndex;
      };
      if (this.FPaging.FEnabled) {
        rindex = rindex + (this.FPaging.FActivePage * this.FPaging.FSize);
      };
      if ((rindex !== -1) && (cindex !== -1)) {
        this.DoCheckClick(cindex,rindex,chk);
      };
      return Result;
    };
    this.HandleButtonClick = function (Event) {
      var Result = false;
      var rindex = 0;
      var cindex = 0;
      Result = true;
      rindex = -1;
      cindex = -1;
      var el = Event.target;
          var d = el.parentElement;
          if (d.tagName.toLowerCase() == 'div') {
            d = d.parentElement;
          }
      
          if (d.tagName.toLowerCase() == 'td') {
            cindex = d.cellIndex;
            var tr = d.parentElement;
            rindex = tr.rowIndex;
          };
      if (this.FPaging.FEnabled) {
        rindex = rindex + (this.FPaging.FActivePage * this.FPaging.FSize);
      };
      if ((rindex !== -1) && (cindex !== -1)) {
        this.DoButtonClick(cindex,rindex);
      };
      return Result;
    };
    this.HandleDoMouseUp = function (Event) {
      var Result = false;
      pas["WEBLib.Controls"].TControl.HandleDoMouseUp.apply(this,arguments);
      resetResize();
      Result = true;
      return Result;
    };
    this.HandleDoMouseMove = function (Event) {
      var Result = false;
      var IsAutoWidth = false;
      pas["WEBLib.Controls"].TControl.HandleDoMouseMove.apply(this,arguments);
      IsAutoWidth = this.FWidthStyle in rtl.createSet(pas["WEBLib.Controls"].TSizeStyle.ssAuto);
      autoWidth = IsAutoWidth;
      resizeColumn(Event);
      Result = true;
      return Result;
    };
    this.HandleDoMouseDown = function (Event) {
      var Result = false;
      var r = 0;
      var maxr = 0;
      var tgt = null;
      var tr = null;
      var sd = 0;
      var tag = "";
      Result = true;
      if (!this.FEnabled) return Result;
      tgt = Event.target;
      tag = "";
      sd = $mod.TGridSortIndicator.siNone;
      tr = null;
      do {
        tag = tgt.tagName.toLowerCase();
        if ((tag !== "td") && (tag !== "th")) tgt = tgt.parentElement;
      } while (!((tag === "td") || (tag === "th") || (tgt === null)));
      if ((tag === "td") || (tag === "th")) {
        tr = tgt.parentElement;
        r = tr.rowIndex;
        if (this.FHeader.FVisible) r -= 1;
        if (this.FPaging.FEnabled) {
          maxr = this.FPaging.FSize}
         else maxr = this.FRowCount;
        if (r > maxr) return Result;
        if ((tag === "td") || ((tag === "th") && this.FEnabled)) {
          tag = tr.parentElement.tagName.toLowerCase();
          if (tag !== "thead") this.SetRowIndex(r);
        };
      };
      return Result;
    };
    this.DoCheckClick = function (ACol, ARow, Checked) {
      if (this.FOnCheckClick != null) this.FOnCheckClick(this,ACol,ARow,Checked);
    };
    this.DoButtonClick = function (ACol, ARow) {
      if (this.FOnButtonClick != null) this.FOnButtonClick(this,ACol,ARow);
    };
    this.DoSortClick = function (ACol, ARow, ASortIndicator) {
      var i = 0;
      this.FSortIndex = ACol;
      for (var $l = 0, $end = this.FColCount - 1; $l <= $end; $l++) {
        i = $l;
        this.SelectSortIndicator(i,ARow,i === ACol);
      };
      this.FSortDirection = ASortIndicator;
      if (this.FOnSortClick != null) this.FOnSortClick(this,ACol,ARow,ASortIndicator);
      this.Sort(ACol,ASortIndicator);
    };
    this.DoHttpLoadJson = function (Event) {
      var Result = false;
      var J = null;
      var req = null;
      req = Event.target;
      if ((req.status >= 200) && (req.status <= 208)) {
        J = JSON.parse(req.responseText);
        this.LoadFromJSON$1(J,this.FDataNode);
        if (this.FOnHttpRequestSuccess != null) this.FOnHttpRequestSuccess(this);
      };
      Result = true;
      return Result;
    };
    this.DoHttpLoadPageJson = function (Event) {
      var Result = false;
      var J = null;
      var req = null;
      req = Event.target;
      if ((req.status >= 200) && (req.status <= 208)) {
        J = JSON.parse(req.responseText);
        this.LoadPageFromJSON$1(J,this.FDataNode);
        if (this.FOnHttpRequestSuccess != null) this.FOnHttpRequestSuccess(this);
      };
      Result = true;
      return Result;
    };
    this.DoHttpLoadCsv = function (Event) {
      var Result = false;
      var sl = null;
      var req = null;
      req = Event.target;
      if ((req.status >= 200) && (req.status <= 208)) {
        sl = pas.Classes.TStringList.$create("Create$1");
        sl.SetTextStr(req.responseText);
        try {
          this.LoadFromStringList(sl);
        } finally {
          sl = rtl.freeLoc(sl);
        };
        if (this.FOnHttpRequestSuccess != null) this.FOnHttpRequestSuccess(this);
      };
      Result = true;
      return Result;
    };
    this.DoHttpAbort = function (Event) {
      var Result = false;
      if (this.FOnHttpRequestError != null) this.FOnHttpRequestError(this);
      Result = true;
      return Result;
    };
    this.DoHttpRequest = function (ARequest) {
      var LRequestRec = pas["WEBLib.Controls"].TJSXMLHttpRequestRecord.$new();
      if (this.FOnHttpRequest != null) {
        LRequestRec.req = ARequest;
        this.FOnHttpRequest(this,pas["WEBLib.Controls"].TJSXMLHttpRequestRecord.$clone(LRequestRec));
      };
    };
    this.GetCellData = function (ACol, ARow, AField, AValue) {
      if (this.FOnGetCellData != null) this.FOnGetCellData(this,ACol,ARow,AField,AValue);
    };
    this.GetCellClassName = function (ACol, ARow, AField, AValue, AClassName) {
      if (this.FOnGetCellClass != null) this.FOnGetCellClass(this,ACol,ARow,AField,AValue,AClassName);
    };
    this.GetCellChildren = function (ACol, ARow, AField, AValue, AElement) {
      var LElementRec = pas["WEBLib.Controls"].TJSHTMLElementRecord.$new();
      if (this.FOnGetCellChildren != null) {
        LElementRec.element = AElement;
        this.FOnGetCellChildren(this,ACol,ARow,AField,AValue,pas["WEBLib.Controls"].TJSHTMLElementRecord.$clone(LElementRec));
      };
    };
    this.BindCellCheckBox = function (ACol, ARow, AElement) {
      var el = null;
      el = AElement.firstChild;
      if ((el != null) && (el.tagName === "DIV")) el = el.firstChild;
      if ((el != null) && (el.tagName === "INPUT")) {
        if (pas.SysUtils.LowerCase(el.getAttribute("TYPE")) === "checkbox") {
          el.addEventListener("click",this.FHandleCheckClickPtr);
        };
      };
    };
    this.BindCellButton = function (ACol, ARow, AElement) {
      var el = null;
      el = AElement.firstChild;
      if ((el != null) && (el.tagName === "DIV")) el = el.firstChild;
      if ((el != null) && (el.tagName === "BUTTON")) {
        el.addEventListener("click",this.FHandleButtonClickPtr);
      };
    };
    this.RenderGrid = function () {
      var i = 0;
      var table = null;
      var tbody = null;
      var th = null;
      var frows = 0;
      var fcols = 0;
      var fhc = 0;
      var rc = 0;
      var rh = false;
      var ch = false;
      var headclass = "";
      var cc = "";
      var headcaption = "";
      var ridx = 0;
      if (!(this.FTable != null)) {
        this.FTable = document.createElement("TABLE");
        this.GetElementHandle().appendChild(this.FTable);
        pas["WEBLib.Controls"].SetHTMLElementFont(this.FTable,this.FFont,!((this.FElementClassName === "") && (this.FElementFont === pas["WEBLib.Controls"].TElementFont.efProperty)));
        table = this.FTable;
        table.setAttribute("id",this.FName + "Table");
        table.style.setProperty("vertical-align","middle");
        frows = this.RenderRowCount();
        fcols = this.FColCount;
        rh = this.FRowHeader;
        ch = this.FColHeader;
        rc = this.FRowCount;
        cc = "";
        ridx = 0;
        fhc = 0;
        if (this.FElementTableClassName === "") {
          table.style.setProperty("border-collapse","collapse");
          table.setAttribute("border","0");
          table.setAttribute("cellpadding","0");
          table.setAttribute("cellspacing","0");
          table.setAttribute("width","100%");
          table.setAttribute("table-layout","fixed");
          table.setAttribute("height","100%");
        } else {
          table.setAttribute("class",this.FElementTableClassName);
        };
        headclass = this.FElementHeaderClassName;
        while (table.firstChild) {
          table.removeChild(table.firstChild);
        };
        this.FHeader.FElement = null;
        if (this.FHeader.FVisible) {
          ridx += 1;
          headcaption = this.FHeader.FCaption;
          var theader = table.createTHead();
          
                  if (headclass != "")
                  {
                    theader.setAttribute("class", headclass);
                  }
          
                  var tr = theader.insertRow(0);
                  th = document.createElement('th');
                  tr.appendChild(th);
                  th.setAttribute('colspan',fcols);
                  th.setAttribute('vertical-align','middle');
                  if (headcaption != '') {
                    th.innerHTML = '<div style="float:left;margin-right:10px;vertical-align:middle">'+headcaption+'</div>'; };
          this.FHeader.FElement = th;
        };
        var i = 0;
              var j = 0;
        
              if (rh)
              {
                fhc++;
        
                var theader = table.createTHead();
        
                if (headclass != "")
                {
                  theader.setAttribute("class", headclass);
                }
        
                var tr = theader.insertRow(ridx);
        
                for(i=0; i < fcols; i++)
                {
                  if (rc > 0) {
                  cc = this.FData[0][i];
                  if (cc == undefined) { cc = "";}
                  }
                  else
                  {
                    cc = "";
                  }
                  var th = document.createElement('th');
                  th.setAttribute('scope','col');
                  this.SetTableCell(i,0, th, cc);
                  tr.appendChild(th);
                }
              }
        
              tbody = table.appendChild(document.createElement('tbody'));
        
              for(i=0; i < frows; i++)
              {
                if (i + fhc >= this.FData.length) { break; }
        
                var tr = tbody.insertRow(tbody.length);
        
                for(j=0; j < fcols; j++)
                {
                  cc = this.FData[i+fhc][j];
                  if (cc == undefined) { cc = "";}
        
                  if ((j == 0) && (ch))
                  {
                    var th = document.createElement('th');
                    th.setAttribute('scope','row');
                    tr.appendChild(th);
                    this.SetTableCell(j,i + fhc,th, cc);
                  }
                  else
                  {
                    tr.insertCell();
                    var td = tr.cells[j];
                    this.SetTableCell(j,i + fhc,td, cc);
                  }
                }
              };
        this.FBody = tbody;
        this.FFooter.FElement = null;
        if (this.FFooter.FVisible) {
          ridx += 1;
          headcaption = this.FFooter.FCaption;
          var theader = table.createTFoot();
          
                  if (headclass != "")
                  {
                    theader.setAttribute("class", headclass);
                  }
          
                  var tr = theader.insertRow(0);
                  th = document.createElement('th');
                  tr.appendChild(th);
                  th.setAttribute('colspan',fcols);
          //        th['colspan'] = fcols;
                  th.innerHTML = headcaption;
          this.FFooter.FElement = th;
        };
        if (this.FDragMode === pas["WEBLib.Controls"].TDragMode.dmAutomatic) this.EnableDrag();
      };
      if (!this.FOptions.FResizeColumns) ;
      this.EnableColResize();
      if (this.FHiddenCols.GetCount() > 0) {
        for (var $l = 0, $end = this.FColCount - 1; $l <= $end; $l++) {
          i = $l;
          if (this.IsHiddenColumn(i)) this.HideColumn(i);
        };
      };
    };
    this.ReRenderGrid = function () {
      if (!(this.GetElementHandle() != null) || this.IsUpdating()) return;
      if (this.FTable != null) this.FTable.parentElement.removeChild(this.FTable);
      this.FTable = null;
      this.RenderGrid();
      this.RenderHeaderFooter();
    };
    this.RenderGridBorders = function () {
      var i = 0;
      var j = 0;
      var td = null;
      var clr = "";
      for (var $l = 0, $end = this.FColCount - 1; $l <= $end; $l++) {
        i = $l;
        for (var $l1 = 0, $end1 = this.RenderRowCount(); $l1 <= $end1; $l1++) {
          j = $l1;
          td = this.GetCellElement(i,j);
          if (td != null) {
            if (this.FOptions.FCellBorders) {
              clr = pas["WEBLib.Graphics"].ColorToHTML(this.FOptions.FCellBorderColor);
              td.style.borderRight = "1px solid " + clr;
              td.style.borderBottom = "1px solid " + clr;
            } else {
              td.style.borderRight = "";
              td.style.borderBottom = "";
            };
          };
        };
      };
    };
    this.RenderGridData = function () {
      var i = 0;
      var j = 0;
      for (var $l = 0, $end = this.FColCount - 1; $l <= $end; $l++) {
        i = $l;
        for (var $l1 = 0, $end1 = this.FRowCount - 1; $l1 <= $end1; $l1++) {
          j = $l1;
          this.SetCells(i,j,this.GetCells(i,j));
        };
      };
    };
    this.RenderGridScript = function () {
      this.AddControlScriptSource("var pageX,curCol,nxtCol,curColWidth,nxtColWidth,autoWidth,curTable,curTableWidth;" + "autoWidth = false;" + "function resizeColumn(e) {" + "   if (curCol) {" + "    var diffX = e.pageX - pageX;" + "\t\tif ((nxtCol) && (!autoWidth)){" + '\t\t nxtCol.style.width = (nxtColWidth - diffX)+"px";' + "   } else {" + "   }" + "   newColWidth = (curColWidth + diffX);" + "   if (newColWidth < 10)" + "    newColWidth = 10;" + '\t  curCol.style.width = newColWidth + "px";' + "   }" + " }" + "function resetResize() {" + "   curCol = undefined;" + "   nxtCol = undefined;" + "   pageX = undefined;" + "   nxtColWidth = undefined;" + "   curColWidth = undefined;" + "   curTable = undefined;" + "   curTableWidth = undefined;" + " }" + "function resizableGrid(tablename, enabled,ridx) {" + ' var table = document.getElementById(tablename + "Table");' + " if (!table) return;" + ' var row = table.getElementsByTagName("tr")[ridx],' + " cols = row ? row.children : undefined;" + " if (!cols) return;" + " for (var i=0;i<cols.length;i++){" + '  var coldiv = document.getElementById(tablename + "Div" + i);' + "  if (coldiv)" + "    coldiv.remove();" + "  if (enabled) {" + "    var div = createDiv();" + "    cols[i].appendChild(div);" + '    cols[i].style.position = "relative";' + '    div.id = tablename + "Div" + i;' + "    setListeners(div);" + "  }" + " }" + " function setListeners(div){" + '  div.addEventListener("mousedown", function (e) {' + "   curCol = e.target.parentElement;" + "   nxtCol = curCol.nextElementSibling;" + "   pageX = e.pageX;" + "   curColWidth = curCol.offsetWidth;" + "   curTable = curCol.parentElement.parentElement.parentElement;" + "   curTableWidth = curTable.offsetWidth;" + "   if (nxtCol)" + "    nxtColWidth = nxtCol.offsetWidth;" + "  });" + '  div.addEventListener("mouseover", function (e) {' + '   e.target.style.borderRight = "2px solid #0000ff";' + "  });" + '  div.addEventListener("mouseout", function (e) {' + '   e.target.style.borderRight = "";' + "  });" + '  document.addEventListener("mousemove", function (e) {' + "   resizeColumn(e);" + "  });" + '  document.addEventListener("mouseup", function (e) {' + "   resetResize(e);" + "  });" + " }" + " function createDiv(){" + '  var div = document.createElement("div");' + "  div.style.top = 0;" + "  div.style.right = 0;" + '  div.style.width = "10px";' + '  div.style.position = "absolute";' + '  div.style.cursor = "col-resize";' + '  div.style.userSelect = "none";' + '  div.style.height = "100%";' + '  div.innerHTML = "&nbsp;";' + "  return div;" + " }" + "};");
    };
    this.RenderHeaderFooter = function () {
      if (this.FHeader.FVisible) this.FHeader.Update(this.FPaging.FSize,this.FRowCount,this.FPaging.FActivePage);
      if (this.FFooter.FVisible) this.FFooter.Update(this.FPaging.FSize,this.FRowCount,this.FPaging.FActivePage);
    };
    this.BindEvents = function () {
      pas["WEBLib.Controls"].TCustomControl.BindEvents.call(this);
      this.RenderGridScript();
    };
    this.KeyDown = function (Key, Shift) {
      var fr = 0;
      pas["WEBLib.Controls"].TControl.KeyDown.apply(this,arguments);
      if (!this.FEnabled) return;
      fr = 0;
      if (this.FRowHeader) fr = 1;
      if (Key.get() === 38) this.SetRowIndex(Math.max(fr,this.FRowIndex - 1));
      if (Key.get() === 40) this.SetRowIndex(Math.min(this.FRowCount - 1,this.FRowIndex + 1));
      if (Key.get() === 36) this.SetRowIndex(fr);
      if (Key.get() === 35) this.SetRowIndex(this.FRowCount - 1);
      if (Key.get() === 34) this.SetRowIndex(Math.min(this.FRowCount - 1,this.FRowIndex + 4));
      if (Key.get() === 33) this.SetRowIndex(Math.max(fr,this.FRowIndex - 4));
    };
    this.CreateElement = function () {
      var Result = null;
      Result = document.createElement("DIV");
      this.FTable = null;
      return Result;
    };
    this.UpdateElement = function () {
      pas["WEBLib.Controls"].TControl.UpdateElement.call(this);
      if (this.IsUpdating()) return;
      if (this.GetElementHandle() != null) {
        if (this.FOptions.FScrollVertical) {
          this.GetElementHandle().style.setProperty("overflow-y","scroll")}
         else this.GetElementHandle().style.setProperty("height","");
        if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
          this.GetElementHandle().style.setProperty("width",pas.SysUtils.IntToStr(this.GetWidth()) + "px");
          this.GetElementHandle().style.setProperty("height",pas.SysUtils.IntToStr(this.GetHeight()) + "px");
        };
        this.GetElementHandle().style.setProperty("user-select","");
        if (this.FCursor === 0) this.GetElementHandle().style.setProperty("cursor","");
        if ((this.FBorderStyle === pas["WEBLib.Controls"].TBorderStyle.bsSingle) && (this.FBorderColor !== -1) && (this.FElementClassName === "") && (this.FElementTableClassName === "") && !this.GetIsLinked()) {
          this.GetElementHandle().style.setProperty("border","1px " + pas["WEBLib.Graphics"].ColorToHTML(this.FBorderColor) + " solid")}
         else this.GetElementHandle().style.setProperty("border","");
        if ((this.FColor !== -1) && (this.FColor !== 16711422)) {
          this.GetElementHandle().style.setProperty("background-color",pas["WEBLib.Graphics"].ColorToHTML(this.FColor))}
         else this.GetElementHandle().style.setProperty("background-color","");
        this.RenderGrid();
      };
    };
    this.SetRowCount = function (Value) {
      var delta = 0;
      var trc = 0;
      var trh = 0;
      var i = 0;
      if ((this.FRowCount !== Value) && (Value >= 0)) {
        trc = Value;
        this.FData.length = trc;
              var i;
        
              for(i = 0; i < this.FData.length; i++) {
                if (this.FData[i] == null) {
                  this.FData[i] = [];
                  this.FData[i].length = this.FColCount;
                }
              };
        delta = Value - this.FRowCount;
        if ((this.FRowCount === 0) && this.FRowHeader) delta = Value - 1;
        this.FRowCount = Value;
        this.RowCountChanged(delta);
        this.GridChanged();
        if (this.FPaging.FEnabled) {
          trc = 0;
          trh = 0;
          if (this.FRowHeader) trc += 1;
          if (this.FHeader.FVisible) trh += 1;
          for (var $l = this.FPaging.FSize + trc + trh, $end = (this.FRowCount - 1) + trh; $l <= $end; $l++) {
            i = $l;
            this.HideRow(i);
          };
        };
        if (this.FHeader.FPager !== $mod.TTablePager.tpNone) this.FHeader.Update(this.FPaging.FSize,this.FRowCount,this.FPaging.FActivePage);
        if (this.FFooter.FPager !== $mod.TTablePager.tpNone) this.FFooter.Update(this.FPaging.FSize,this.FRowCount,this.FPaging.FActivePage);
      };
    };
    this.SetColCount = function (Value) {
      $mod.TCustomGrid.SetColCount.apply(this,arguments);
      var i;
          for(i=0; i < this.FData.length; i++)
          {
            if (this.FData[i] == null) this.FData[i] = [];
      
            this.FData[i].length = Value;
          };
    };
    this.RowCountChanged = function (delta) {
      var r = 0;
      var tbody = null;
      if (!(this.FTable != null)) return;
      tbody = this.FBody;
      if (delta > 0) {
        var i = 0;
              var j = 0;
              var tr = undefined;
              var l = tbody.rows.length;
        
              for(i = 0;i < delta; i++)
              {
                 tr = tbody.insertRow(l);
                 for(j = 0; j < this.FColCount; j++)
                 {
        
                  if ((j == 0) && (this.FColHeader))
                  {
                    var th = document.createElement('th');
                    th.setAttribute('scope','row');
                    tr.appendChild(th);
                  }
                  else
                  {
                    tr.insertCell();
                  }
                 }
              };
        if (this.FDragMode === pas["WEBLib.Controls"].TDragMode.dmAutomatic) this.EnableDrag();
      };
      if (delta < 0) {
        var i = 0;
        var l = this.FBody.rows.length;
        if (l < -delta) return;
        for(i = 0;i < -delta; i++) {
          this.FBody.deleteRow(l - i - 1);
        };
      };
    };
    this.ColCountChanged = function (delta) {
      var c = 0;
      var fromrow = 0;
      var torow = 0;
      var dtb = "";
      var cc = "";
      if (this.IsUpdating() || !(this.FTable != null)) return;
      cc = "";
      dtb = "";
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        dtb = "1px dashed gray";
        cc = "&nbsp;";
      };
      fromrow = 0;
      torow = this.RenderRowCount();
      if (this.FRowHeader) torow = torow + 1;
      if (this.FHeader.FVisible) {
        this.FHeader.FElement.setAttribute("colspan",pas["WEBLib.Utils"].TLongIntHelper.ToString.call({p: this, get: function () {
            return this.p.FColCount;
          }, set: function (v) {
            this.p.FColCount = v;
          }}));
        fromrow = 1;
        torow = torow + 1;
      };
      if (this.FFooter.FVisible) {
        this.FFooter.FElement.setAttribute("colspan",pas["WEBLib.Utils"].TLongIntHelper.ToString.call({p: this, get: function () {
            return this.p.FColCount;
          }, set: function (v) {
            this.p.FColCount = v;
          }}));
      };
      if (delta > 0) {
        var i = 0;
              var j = 0;
              var k = 0;
              var tr = undefined;
              var td = undefined;
        
              for(j = fromrow; j < torow; j++)
              {
                tr = this.FTable.rows[j];
        
                if (tr == undefined) { continue; }
        
                k = tr.cells.length;
        
                 for(i = 0; i < delta; i++)
                 {
                   if ((j == fromrow) && (this.FRowHeader))
                   {
                     var th = document.createElement('th');
                     th.setAttribute('scope','col');
                     tr.appendChild(th);
                     this.SetTableCell(i,j,th,cc);
                   }
                   else
                   {
                     if ((tr.cells.length == 0) && (this.FColHeader))
                     {
                       var th = document.createElement('th');
                       th.setAttribute('scope','row');
                       this.SetTableCell(i,j,th, cc);
                       tr.appendChild(th);
                     }
                     else
                     {
                       td = tr.insertCell();
                       td = tr.cells[k];
                       this.SetTableCell(i,j,td, cc);
                     }
                   }
                 }
              };
        if (this.FDragMode === pas["WEBLib.Controls"].TDragMode.dmAutomatic) this.EnableDrag();
      };
      if (delta < 0) {
        var i = 0;
              var j = 0;
              var k = 0;
              var tr = undefined;
        
              for(j = fromrow; j < torow; j++)
              {
                tr = this.FTable.rows[j];
        
                if (tr == undefined) { continue; }
        
                k = tr.cells.length;
        
                for(i = 0; i < -delta; i++)
                {
                  if ((k - i - 1 < k) && (k - i - 1 >= 0))  {
                    tr.deleteCell(k - i - 1);
                }
               }
              };
      };
    };
    this.LoadFromStringList = function (AStrings) {
      var firstrow = 0;
      var arow = null;
      var i = 0;
      var j = 0;
      var cr = 0;
      var cd = "";
      var cn = "";
      var ce = null;
      if (this.FRowHeader && !this.FLoadFixed) {
        firstrow = 1}
       else firstrow = 0;
      this.SetRowCount(AStrings.GetCount() + firstrow);
      arow = pas.Classes.TStringList.$create("Create$1");
      try {
        for (var $l = 0, $end = AStrings.GetCount() - 1; $l <= $end; $l++) {
          i = $l;
          arow.FStrictDelimiter = true;
          arow.SetDelimiter(this.FDelimiter);
          arow.SetDelimitedText(AStrings.Get(i));
          if (arow.GetCount() > this.FColCount) this.SetColCount(arow.GetCount());
          for (var $l1 = 0, $end1 = arow.GetCount() - 1; $l1 <= $end1; $l1++) {
            j = $l1;
            cd = arow.Get(j);
            this.GetCellData(j,i + firstrow,null,{get: function () {
                return cd;
              }, set: function (v) {
                cd = v;
              }});
            this.SetCells(j,i + firstrow,cd);
            cr = i + firstrow;
            if (this.InVisiblePage({get: function () {
                return cr;
              }, set: function (v) {
                cr = v;
              }})) {
              ce = this.GetCellElement(j,cr);
              this.GetCellChildren(j,cr,null,cd,ce);
              cn = "";
              this.GetCellClassName(j,cr,null,cd,{get: function () {
                  return cn;
                }, set: function (v) {
                  cn = v;
                }});
              if (cn !== "") ce.setAttribute("class",cn);
            };
          };
        };
      } finally {
        arow = rtl.freeLoc(arow);
      };
    };
    this.EnableColResize = function () {
      var TableName = "";
      var ResizeEnabled = false;
      var ridx = 0;
      TableName = this.FName;
      ResizeEnabled = this.FOptions.FResizeColumns;
      if (!(pas.Classes.TComponentStateItem.csDesigning in this.FComponentState)) {
        if (this.FHeader.FVisible) {
          ridx = 1}
         else ridx = 0;
        resizableGrid(TableName, ResizeEnabled, ridx);
      };
    };
    this.EnableDrag = function () {
      var $Self = this;
      function AddDraggableAttribute(AElement) {
        var I = 0;
        for (var $l = 0, $end = AElement.children.length - 1; $l <= $end; $l++) {
          I = $l;
          if (AElement.children.item(I).tagName === "TD") {
            AElement.children.item(I).setAttribute("draggable","true");
            AddDraggableAttribute(AElement.children.item(I));
          } else AddDraggableAttribute(AElement.children.item(I));
        };
      };
      if (!(this.GetContainer() != null)) return;
      AddDraggableAttribute(this.GetContainer());
    };
    this.DisableDrag = function () {
      var $Self = this;
      function RemoveDraggableAttribute(AElement) {
        var I = 0;
        for (var $l = 0, $end = AElement.children.length - 1; $l <= $end; $l++) {
          I = $l;
          if (AElement.children.item(I).tagName === "TD") {
            AElement.children.item(I).removeAttribute("draggable");
            RemoveDraggableAttribute(AElement.children.item(I));
          } else RemoveDraggableAttribute(AElement.children.item(I));
        };
      };
      if (!(this.GetContainer() != null)) return;
      RemoveDraggableAttribute(this.GetContainer());
    };
    this.FindFrom = function (ACol, ARow, Condition, CaseSensitive, AllCells) {
      var Result = $mod.TGridCoord.$new();
      var i = 0;
      var j = 0;
      var r = 0;
      var pg = 0;
      var sr = 0;
      var sc = 0;
      var cd = "";
      var found = false;
      sc = ACol;
      Result.X = -1;
      Result.Y = -1;
      for (var $l = ARow, $end = this.FRowCount - 1; $l <= $end; $l++) {
        i = $l;
        for (var $l1 = sc, $end1 = this.FColCount - 1; $l1 <= $end1; $l1++) {
          j = $l1;
          cd = this.FData[i][j];
          found = (cd != undefined);
          if (found && pas["WEBLib.Utils"].MatchStr("*" + Condition + "*",cd,CaseSensitive)) {
            Result.X = j;
            Result.Y = i;
            this.FFindCol = j;
            this.FFindRow = i;
            if (this.FPaging.FEnabled) {
              pg = rtl.trunc((i - ARow) / this.FPaging.FSize);
              this.SelectPage(pg,true);
              this.FFindRow = i % this.FPaging.FSize;
              if (this.FFindRow < ARow) this.FFindRow = this.FPaging.FSize;
              Result.Y = this.FFindRow;
            };
            this.ScrollRowInView(this.FFindRow);
            this.SelectCell(j,this.FFindRow);
            return Result;
          };
        };
        if (this.FColHeader && !AllCells) {
          sc = 1}
         else sc = 0;
      };
      return Result;
    };
    this.RenderRowCount = function () {
      var Result = 0;
      if (this.FPaging.FEnabled && (this.FPaging.FSize > 0)) {
        Result = this.FPaging.FSize}
       else {
        if (this.FRowHeader) {
          Result = this.FRowCount - 1}
         else Result = this.FRowCount;
      };
      return Result;
    };
    this.InVisiblePage = function (ARow) {
      var Result = false;
      if (this.FPaging.FEnabled) {
        Result = (ARow.get() >= (this.FPaging.FSize * this.FPaging.FActivePage)) && (ARow.get() < (this.FPaging.FSize * (this.FPaging.FActivePage + 1)));
        ARow.set(ARow.get() - (this.FPaging.FSize * this.FPaging.FActivePage));
      } else Result = ARow.get() <= this.FRowCount;
      return Result;
    };
    this.DoSelectPage = function (AIndex) {
      var Allow = false;
      var DoDefault = false;
      Allow = true;
      DoDefault = true;
      if (this.FOnSelectPage != null) this.FOnSelectPage(this,AIndex,{get: function () {
          return Allow;
        }, set: function (v) {
          Allow = v;
        }},{get: function () {
          return DoDefault;
        }, set: function (v) {
          DoDefault = v;
        }});
      if (Allow) this.SelectPage(AIndex,DoDefault);
    };
    this.SelectPage = function (AIndex, DoDefault) {
      var i = 0;
      var j = 0;
      var delta = 0;
      var offset = 0;
      var hdr = 0;
      var tr = null;
      var td = null;
      var s = "";
      if (this.FPaging.FEnabled) {
        this.FPaging.FActivePage = AIndex;
        td = null;
        this.RenderHeaderFooter();
        if (DoDefault) {
          if (this.FRowHeader) {
            delta = 1}
           else delta = 0;
          if (this.FHeader.FVisible) {
            hdr = 1}
           else hdr = 0;
          offset = AIndex * this.FPaging.FSize;
          for (var $l = 0, $end = this.FPaging.FSize - 1; $l <= $end; $l++) {
            i = $l;
            tr = this.FTable.rows[i + delta + hdr];
            if (tr != null) {
              if ((offset + i + delta) >= this.FRowCount) {
                tr.style.setProperty('display','none');
                continue;
              };
              s = "";
              for (var $l1 = 0, $end1 = this.FColCount - 1; $l1 <= $end1; $l1++) {
                j = $l1;
                s = this.FData[offset + i + delta][j];
                if (s != undefined) {
                  td = tr.cells[j];
                  this.SetTableCell(j,i+delta,td,s);
                }
                tr.style.removeProperty('display');
              };
            };
          };
        };
      };
    };
    this.Loaded = function () {
      pas["WEBLib.Controls"].TCustomControl.Loaded.call(this);
    };
    this.InitCSSLibrary = function (ALibrary) {
      if (ALibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap) {
        this.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
        this.SetElementHeaderClassName("thead-light");
        this.SetElementTableClassName("table table-striped table-bordered  table-hover");
        if (!(this.FHeader != null)) this.FHeader = $mod.TTableControlHeader.$create("Create$1",[this]);
        this.FHeader.FButtonActiveElementClassName = "btn btn-primary";
        this.FHeader.FButtonElementClassName = "btn btn-light";
        this.FHeader.FLinkActiveElementClassName = "link-primary";
        this.FHeader.FLinkElementClassName = "link-secondary";
        this.FHeader.FListElementClassName = "pagination";
        this.FHeader.FListLinkElementClassName = "page-link";
        this.FHeader.FListItemElementClassName = "page-item";
        this.FHeader.FDropDownElementClassName = "form-control";
        this.FHeader.FInputElementClassName = "form-control";
        if (!(this.FFooter != null)) this.FFooter = $mod.TTableControlHeader.$create("Create$1",[this]);
        this.FFooter.FButtonActiveElementClassName = "btn btn-primary";
        this.FFooter.FButtonElementClassName = "btn btn-light";
        this.FFooter.FLinkActiveElementClassName = "link-primary";
        this.FFooter.FLinkElementClassName = "link-secondary";
        this.FFooter.FListElementClassName = "pagination";
        this.FFooter.FListLinkElementClassName = "page-link";
        this.FFooter.FListItemElementClassName = "page-item";
        this.FFooter.FDropDownElementClassName = "form-control";
        this.FFooter.FInputElementClassName = "form-control";
      };
    };
    this.Create$1 = function (AOwner) {
      this.FHeader = null;
      this.FFooter = null;
      pas["WEBLib.Controls"].TControl.Create$1.apply(this,arguments);
      this.SetTabStop(false);
      return this;
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.FOptions = $mod.TTableControlOptions.$create("Create$1",[this]);
      this.FData = null;
      this.FUnfiltered = null;
      if (this.FData == null) {
        if (!(this.FHeader != null)) this.FHeader = $mod.TTableControlHeader.$create("Create$1",[this]);
        if (!(this.FFooter != null)) this.FFooter = $mod.TTableControlHeader.$create("Create$1",[this]);
        this.FPaging = $mod.TTableControlPaging.$create("Create$1",[this]);
        this.FHiddenCols = pas.Classes.TStringList.$create("Create$1");
        this.FHiddenCols.FDuplicates = pas.Types.TDuplicates.dupIgnore;
      };
      this.FData = [];
          this.FData.length = 11;
          var i;
          for(i=0;i<11;i++) {
            if (this.FData[i] == null) this.FData[i] = [];
      
            this.FData[i].length = 5;
          };
      this.FColCount = 5;
      this.FRowCount = 10;
      this.FRowHeader = true;
      this.FColHeader = true;
      this.FRowIndex = -1;
      this.FSelectionColor = 0xFF8F5B;
      this.FSelectionTextColor = 0xFFFFFF;
      this.SetEnabled(true);
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        this.SetWidth(400);
        this.SetHeight(300);
      };
    };
    this.Destroy = function () {
      rtl.free(this,"FHiddenCols");
      rtl.free(this,"FOptions");
      rtl.free(this,"FHeader");
      rtl.free(this,"FFooter");
      rtl.free(this,"FPaging");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.Invalidate = function () {
      pas["WEBLib.Controls"].TCustomControl.Invalidate.call(this);
      if (!(pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) return;
      this.ReRenderGrid();
      if (this.FHeader.FVisible) this.FHeader.Update(this.FPaging.FSize,this.FRowCount,this.FPaging.FActivePage);
      if (this.FFooter.FVisible) this.FFooter.Update(this.FPaging.FSize,this.FRowCount,this.FPaging.FActivePage);
    };
    this.LogData = function () {
      window.console.log(this.FData);
    };
    this.InitSample = function (AInitMethod) {
      var i = 0;
      var j = 0;
      var trc = 0;
      trc = this.RenderRowCount();
      if (this.FRowHeader) trc += 1;
      for (var $l = 0, $end = trc - 1; $l <= $end; $l++) {
        i = $l;
        for (var $l1 = 0, $end1 = this.FColCount - 1; $l1 <= $end1; $l1++) {
          j = $l1;
          var $tmp = AInitMethod;
          if ($tmp === $mod.TInitMethod.imRandom) {
            this.SetCells(j,i,pas.SysUtils.IntToStr(pas.System.Random(100)))}
           else if ($tmp === $mod.TInitMethod.imLinear) this.SetCells(j,i,pas.SysUtils.IntToStr(j) + ":" + pas.SysUtils.IntToStr(i));
        };
      };
    };
    this.LoadFromJSON = function (AURL, ADataNode) {
      this.FDataNode = ADataNode;
      this.FReq = new XMLHttpRequest();
      this.FReq.addEventListener("load",rtl.createSafeCallback(this,"DoHttpLoadJson"));
      this.FReq.addEventListener("abort",rtl.createSafeCallback(this,"DoHttpAbort"));
      this.FReq.open("GET",AURL);
      this.DoHttpRequest(this.FReq);
      this.FReq.send();
    };
    this.LoadFromJSON$1 = function (AJSON, ADataNode) {
      var JO = undefined;
      var JA = null;
      var r = 0;
      var c = 0;
      var cr = 0;
      var firstrow = 0;
      var arow = "";
      var sl = null;
      var cd = "";
      var cn = "";
      var ce = null;
      var p = false;
      if (ADataNode !== "") {
        JA = AJSON[ADataNode]}
       else JA = AJSON;
      if (JA != null) {
        p = this.FPaging.FEnabled;
        this.FPaging.SetEnabled(false);
        sl = pas.Classes.TStringList.$create("Create$1");
        firstrow = 0;
        if (this.FRowHeader) firstrow = 1;
        this.SetRowCount(JA.length + firstrow);
        for (var $l = 0, $end = JA.length - 1; $l <= $end; $l++) {
          r = $l;
          JO = JA[r];
          c = 0;
          arow = "";
          var x = undefined;
          for (x in JO) {
            arow += "|" + JO[x];
            c++;
          };
          pas.System.Delete({get: function () {
              return arow;
            }, set: function (v) {
              arow = v;
            }},1,1);
          sl.FStrictDelimiter = true;
          sl.SetDelimiter("|");
          sl.SetDelimitedText(arow);
          if (this.FColCount < sl.GetCount()) this.SetColCount(sl.GetCount());
          for (var $l1 = 0, $end1 = sl.GetCount() - 1; $l1 <= $end1; $l1++) {
            c = $l1;
            cd = sl.Get(c);
            this.GetCellData(c,r + firstrow,null,{get: function () {
                return cd;
              }, set: function (v) {
                cd = v;
              }});
            this.SetCells(c,r + firstrow,cd);
            cr = r;
            if (this.InVisiblePage({get: function () {
                return cr;
              }, set: function (v) {
                cr = v;
              }})) {
              cr = cr + firstrow;
              ce = this.GetCellElement(c,cr);
              this.GetCellChildren(c,cr,null,cd,ce);
              cn = "";
              this.GetCellClassName(c,cr,null,cd,{get: function () {
                  return cn;
                }, set: function (v) {
                  cn = v;
                }});
              if (cn !== "") ce.setAttribute("class",cn);
            };
          };
          this.FPaging.SetEnabled(p);
        };
        sl = rtl.freeLoc(sl);
      };
    };
    this.LoadFromJSONAsync = function (AURL, ADataNode) {
      var $Self = this;
      var Result = null;
      Result = new Promise(function (ASuccess, AFailed) {
        function DoLoad(Event) {
          var Result = false;
          if ($Self.DoHttpLoadJson(Event)) {
            ASuccess(Event.target)}
           else AFailed(Event.target);
          Result = true;
          return Result;
        };
        function DoError(Event) {
          var Result = false;
          AFailed(Event.target);
          Result = true;
          return Result;
        };
        $Self.FDataNode = ADataNode;
        $Self.FReq = new XMLHttpRequest();
        $Self.FReq.addEventListener("load",rtl.createSafeCallback(null,DoLoad));
        $Self.FReq.addEventListener("abort",rtl.createSafeCallback(null,DoError));
        $Self.FReq.addEventListener("timeout",rtl.createSafeCallback(null,DoError));
        $Self.FReq.addEventListener("error",rtl.createSafeCallback(null,DoError));
        $Self.FReq.open("GET",AURL);
        $Self.DoHttpRequest($Self.FReq);
        $Self.FReq.send();
      });
      return Result;
    };
    this.LoadPageFromJSON = function (AURL, ADataNode) {
      this.FDataNode = ADataNode;
      this.FReq = new XMLHttpRequest();
      this.FReq.addEventListener("load",rtl.createSafeCallback(this,"DoHttpLoadPageJson"));
      this.FReq.addEventListener("abort",rtl.createSafeCallback(this,"DoHttpAbort"));
      this.FReq.open("GET",AURL);
      this.DoHttpRequest(this.FReq);
      this.FReq.send();
    };
    this.LoadPageFromJSON$1 = function (AJSON, ADataNode) {
      var JO = undefined;
      var JA = null;
      var r = 0;
      var c = 0;
      var cr = 0;
      var firstrow = 0;
      var arow = "";
      var sl = null;
      var cd = "";
      var cn = "";
      var ce = null;
      var p = false;
      if (ADataNode !== "") {
        JA = AJSON[ADataNode]}
       else JA = AJSON;
      if (JA != null) {
        sl = pas.Classes.TStringList.$create("Create$1");
        firstrow = this.FPaging.FActivePage * this.FPaging.FSize;
        if (this.FRowHeader) firstrow = firstrow + 1;
        for (var $l = 0, $end = JA.length - 1; $l <= $end; $l++) {
          r = $l;
          JO = JA[r];
          c = 0;
          arow = "";
          var x = undefined;
          for (x in JO) {
            arow += "|" + JO[x];
            c++;
          };
          pas.System.Delete({get: function () {
              return arow;
            }, set: function (v) {
              arow = v;
            }},1,1);
          sl.FStrictDelimiter = true;
          sl.SetDelimiter("|");
          sl.SetDelimitedText(arow);
          if (this.FColCount < sl.GetCount()) this.SetColCount(sl.GetCount());
          for (var $l1 = 0, $end1 = sl.GetCount() - 1; $l1 <= $end1; $l1++) {
            c = $l1;
            cd = sl.Get(c);
            this.GetCellData(c,r + firstrow,null,{get: function () {
                return cd;
              }, set: function (v) {
                cd = v;
              }});
            this.SetCells(c,r + firstrow,cd);
            cr = r;
            if (this.InVisiblePage({get: function () {
                return cr;
              }, set: function (v) {
                cr = v;
              }})) {
              cr = cr + firstrow;
              ce = this.GetCellElement(c,cr);
              this.GetCellChildren(c,cr,null,cd,ce);
              cn = "";
              this.GetCellClassName(c,cr,null,cd,{get: function () {
                  return cn;
                }, set: function (v) {
                  cn = v;
                }});
              if (cn !== "") ce.setAttribute("class",cn);
            };
          };
        };
        sl = rtl.freeLoc(sl);
      };
    };
    this.LoadPageFromJSONAsync = function (AURL, ADataNode) {
      var $Self = this;
      var Result = null;
      Result = new Promise(function (ASuccess, AFailed) {
        function DoLoad(Event) {
          var Result = false;
          if ($Self.DoHttpLoadPageJson(Event)) {
            ASuccess(Event.target)}
           else AFailed(Event.target);
          Result = true;
          return Result;
        };
        function DoError(Event) {
          var Result = false;
          AFailed(Event.target);
          Result = true;
          return Result;
        };
        $Self.FDataNode = ADataNode;
        $Self.FReq = new XMLHttpRequest();
        $Self.FReq.addEventListener("load",rtl.createSafeCallback(null,DoLoad));
        $Self.FReq.addEventListener("abort",rtl.createSafeCallback(null,DoError));
        $Self.FReq.addEventListener("timeout",rtl.createSafeCallback(null,DoError));
        $Self.FReq.addEventListener("error",rtl.createSafeCallback(null,DoError));
        $Self.FReq.open("GET",AURL);
        $Self.DoHttpRequest($Self.FReq);
        $Self.FReq.send();
      });
      return Result;
    };
    this.LoadFromCSV = function (AURL, Delimiter, LoadFixed) {
      this.FDelimiter = Delimiter;
      this.FLoadFixed = LoadFixed;
      this.FReq = new XMLHttpRequest();
      this.FReq.addEventListener("load",rtl.createSafeCallback(this,"DoHttpLoadCsv"));
      this.FReq.addEventListener("abort",rtl.createSafeCallback(this,"DoHttpAbort"));
      this.FReq.open("GET",AURL);
      this.DoHttpRequest(this.FReq);
      this.FReq.send();
    };
    this.LoadFromCSVAsync = function (AURL, Delimiter, LoadFixed) {
      var $Self = this;
      var Result = null;
      Result = new Promise(function (ASuccess, AFailed) {
        function DoLoad(Event) {
          var Result = false;
          if ($Self.DoHttpLoadCsv(Event)) {
            ASuccess(Event.target)}
           else AFailed(Event.target);
          Result = true;
          return Result;
        };
        function DoError(Event) {
          var Result = false;
          AFailed(Event.target);
          Result = true;
          return Result;
        };
        $Self.FDelimiter = Delimiter;
        $Self.FLoadFixed = LoadFixed;
        $Self.FReq = new XMLHttpRequest();
        $Self.FReq.addEventListener("load",rtl.createSafeCallback(null,DoLoad));
        $Self.FReq.addEventListener("abort",rtl.createSafeCallback(null,DoError));
        $Self.FReq.addEventListener("timeout",rtl.createSafeCallback(null,DoError));
        $Self.FReq.addEventListener("error",rtl.createSafeCallback(null,DoError));
        $Self.FReq.open("GET",AURL);
        $Self.DoHttpRequest($Self.FReq);
        $Self.FReq.send();
      });
      return Result;
    };
    this.LoadFromStrings = function (AStrings, Delimiter, LoadFixed) {
      this.FDelimiter = Delimiter;
      this.FLoadFixed = LoadFixed;
      this.LoadFromStringList(AStrings);
    };
    this.SaveToCSV = function (AFileName, Delimiter, SaveFixed) {
      var sl = null;
      sl = pas.Classes.TStringList.$create("Create$1");
      try {
        this.SaveToStrings(sl,Delimiter,SaveFixed);
        sl.SaveToFile(AFileName);
      } finally {
        sl = rtl.freeLoc(sl);
      };
    };
    this.SaveToStrings = function (AStrings, Delimiter, SaveFixed) {
      var r = 0;
      var c = 0;
      var fr = 0;
      var fc = 0;
      var s = "";
      var rowstr = "";
      fr = 0;
      fc = 0;
      if (!SaveFixed && this.FColHeader) fc = 1;
      if (!SaveFixed && this.FRowHeader) fr = 1;
      for (var $l = fr, $end = this.FRowCount - 1; $l <= $end; $l++) {
        r = $l;
        rowstr = "";
        for (var $l1 = fc, $end1 = this.FColCount - 1; $l1 <= $end1; $l1++) {
          c = $l1;
          s = this.GetCells(c,r);
          s = pas.SysUtils.StringReplace(s,'"','""',rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
          if ((pas.System.Pos(Delimiter,s) > 0) || (pas.System.Pos("\r",s) > 0)) {
            s = '"' + s + '"';
          };
          if (s === "") s = '""';
          if (rowstr === "") {
            rowstr = s}
           else rowstr = rowstr + Delimiter + s;
        };
        AStrings.Add(rowstr);
      };
    };
    this.AddCheckBox = function (ACol, ARow, Checked) {
      var s = "";
      var ct = "";
      var el = null;
      if ((ARow >= 0) && (ACol >= 0) && !this.HasCheckBox(ACol,ARow)) {
        ct = this.GetCells(ACol,ARow);
        if (ct !== "") ct = "&nbsp;" + ct;
        s = '<INPUT TYPE="CHECKBOX" style="vertical-align:middle"';
        if (Checked) s = s + " CHECKED";
        s = s + ">";
        this.SetCells(ACol,ARow,s + ct);
        el = this.GetCellElement(ACol,ARow);
        this.BindCellCheckBox(ACol,ARow,el);
      };
    };
    this.RemoveCheckBox = function (ACol, ARow) {
      var el = null;
      if ((ACol < this.FColCount) && (ARow < this.FRowCount)) {
        el = this.GetCheckElement(ACol,ARow);
        if (el != null) {
          el.removeEventListener("click",this.FHandleCheckClickPtr);
          el.remove();
        };
      };
    };
    this.AddCheckBoxColumn = function (ACol, Checked) {
      var i = 0;
      var s = 0;
      s = 0;
      if (this.FRowHeader) s = 1;
      for (var $l = s, $end = this.FRowCount - 1; $l <= $end; $l++) {
        i = $l;
        this.AddCheckBox(ACol,i,Checked);
      };
    };
    this.HasCheckBox = function (ACol, ARow) {
      var Result = false;
      var el = null;
      Result = false;
      if ((ACol < this.FColCount) && (ARow < this.FRowCount)) {
        el = this.GetCheckElement(ACol,ARow);
        Result = el != null;
      };
      return Result;
    };
    this.AddButton = function (ACol, ARow, AText, AStyle) {
      var s = "";
      var ct = "";
      var el = null;
      if ((ARow >= 0) && (ACol >= 0) && !this.HasCheckBox(ACol,ARow)) {
        ct = this.GetCells(ACol,ARow);
        if (ct !== "") ct = "&nbsp;" + ct;
        s = '<BUTTON type="button" style="vertical-align:middle"';
        if (AStyle !== "") s = s + ' class="' + AStyle + '"';
        s = s + ">" + AText + "</BUTTON>";
        this.SetCells(ACol,ARow,s + ct);
        el = this.GetCellElement(ACol,ARow);
        this.BindCellButton(ACol,ARow,el);
      };
    };
    this.AddButtonColumn = function (ACol, AText, AStyle) {
      var i = 0;
      var s = 0;
      s = 0;
      if (this.FRowHeader) s = 1;
      for (var $l = s, $end = this.FRowCount - 1; $l <= $end; $l++) {
        i = $l;
        this.AddButton(ACol,i,AText,AStyle);
      };
    };
    this.RemoveButton = function (ACol, ARow) {
      var el = null;
      if ((ACol < this.FColCount) && (ARow < this.FRowCount)) {
        el = this.GetButtonElement(ACol,ARow);
        if (el != null) {
          el.removeEventListener("click",this.FHandleCheckClickPtr);
          el.remove();
        };
      };
    };
    this.HasButton = function (ACol, ARow) {
      var Result = false;
      var el = null;
      Result = false;
      if ((ACol < this.FColCount) && (ARow < this.FRowCount)) {
        el = this.GetButtonElement(ACol,ARow);
        if (el != null) {
          Result = true;
        };
      };
      return Result;
    };
    this.AddSortIndicator = function (ACol, ARow, AIndicator) {
      var s = "";
      var sid = "";
      var sp = 0;
      s = this.GetCells(ACol,ARow);
      sp = pas.System.Pos("<span",s);
      if (sp > 0) s = pas.System.Copy(s,1,sp - 1);
      sid = this.FName + "si" + pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
          return ACol;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }}) + "_" + pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
          return ARow;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }});
      var $tmp = AIndicator;
      if ($tmp === $mod.TGridSortIndicator.siNone) {
        this.SetCells(ACol,ARow,s)}
       else if ($tmp === $mod.TGridSortIndicator.siAscending) {
        this.SetCells(ACol,ARow,s + '<span style="cursor:pointer;float:right" id="' + sid + '" sort="up">' + $impl.GlyphAscending + "</span>")}
       else if ($tmp === $mod.TGridSortIndicator.siDescending) this.SetCells(ACol,ARow,s + '<span style="cursor:pointer;float:right" id="' + sid + '" sort="dn">' + $impl.GlyphDescending + "</span>");
    };
    this.SelectSortIndicator = function (ACol, ARow, ASelect) {
      var el = null;
      var sid = "";
      sid = this.FName + "si" + pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
          return ACol;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }}) + "_" + pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
          return ARow;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }});
      el = document.getElementById(sid);
      if (el != null) {
        if (this.FElementSelectionClassName === "") {
          if (ASelect) {
            el.style.setProperty("color",pas["WEBLib.Graphics"].ColorToHTML(0xFF8F5B))}
           else el.style.removeProperty("color");
        } else {
          if (ASelect) {
            el.classList.add(this.FElementSelectionClassName)}
           else el.classList.remove(this.FElementSelectionClassName);
        };
      };
    };
    this.SetSortIndicator = function (ACol, ARow, AIndicator) {
      var el = null;
      var sid = "";
      sid = this.FName + "si" + pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
          return ACol;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }}) + "_" + pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
          return ARow;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }});
      el = document.getElementById(sid);
      if (el != null) {
        if (AIndicator === $mod.TGridSortIndicator.siAscending) {
          el.innerHTML = $impl.GlyphAscending;
          el.setAttribute("sort","up");
        } else {
          el.innerHTML = $impl.GlyphDescending;
          el.setAttribute("sort","dn");
        };
      };
    };
    this.HasSortIndicator = function (ACol, ARow) {
      var Result = false;
      var el = null;
      var sid = "";
      sid = this.FName + "si" + pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
          return ACol;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }}) + "_" + pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
          return ARow;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }});
      el = document.getElementById(sid);
      Result = el != null;
      return Result;
    };
    this.RemoveSortIndicator = function (ACol, ARow) {
      var el = null;
      var sid = "";
      sid = this.FName + "si" + pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
          return ACol;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }}) + "_" + pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
          return ARow;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }});
      el = document.getElementById(sid);
      if (el != null) el.parentElement.removeChild(el);
    };
    this.AddProgress = function (ACol, ARow, APosition, AStyle) {
      var prog = null;
      if ((ACol < this.FColCount) && (ARow < this.FRowCount)) {
        if (!this.HasProgress(ACol,ARow)) {
          prog = document.createElement("PROGRESS");
          prog.setAttribute("max","100");
          prog.setAttribute("value",pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
              return APosition;
            }, set: function (v) {
              APosition = v;
            }}));
          prog.style.setProperty("width","100%");
          if (AStyle !== "") prog.setAttribute("class",AStyle);
          this.GetCellElement(ACol,ARow).insertBefore(prog,this.GetCellElement(ACol,ARow).firstChild);
        };
      };
    };
    this.SetProgress = function (ACol, ARow, APosition) {
      var el = null;
      if ((ACol < this.FColCount) && (ARow < this.FRowCount)) {
        el = this.GetProgressElement(ACol,ARow);
        if (el != null) {
          el.setAttribute("value",pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
              return APosition;
            }, set: function (v) {
              APosition = v;
            }}));
        };
      };
    };
    this.RemoveProgress = function (ACol, ARow) {
      var el = null;
      if ((ACol < this.FColCount) && (ARow < this.FRowCount)) {
        el = this.GetProgressElement(ACol,ARow);
        el.remove();
      };
    };
    this.HasProgress = function (ACol, ARow) {
      var Result = false;
      var el = null;
      Result = false;
      if ((ACol < this.FColCount) && (ARow < this.FRowCount)) {
        el = this.GetProgressElement(ACol,ARow);
        Result = el != null;
      };
      return Result;
    };
    this.Clear = function () {
      var i = 0;
      var j = 0;
      for (var $l = 0, $end = this.FRowCount - 1; $l <= $end; $l++) {
        i = $l;
        for (var $l1 = 0, $end1 = this.FColCount - 1; $l1 <= $end1; $l1++) {
          j = $l1;
          this.SetCells(j,i,"");
        };
      };
    };
    this.InsertRow = function (Index) {
      var i = 0;
      var cnt = 0;
      var ch = false;
      if ((Index < 0) || (Index > this.FRowCount)) return;
      cnt = this.FColCount;
      ch = this.FColHeader;
      var tr = this.FTable.insertRow(Index);
      
          for(i = 0; i < cnt; i++)
          {
            if ((i == 0) && (ch)) {
              var th = document.createElement('th');
              th.setAttribute('scope','row');
              tr.appendChild(th);
              }
            else
            {
              tr.insertCell();
            }
          };
    };
    this.RemoveRow = function (Index) {
      if ((Index < 0) || (Index >= this.FRowCount)) return;
      var tr = this.FTable.deleteRow(Index);
    };
    this.SetFilter = function (Column, Condition, CaseSensitive) {
      var r = 0;
      var rs = 0;
      var hdr = 0;
      var l = 0;
      var tr = null;
      var s = "";
      if (this.FTable != null) {
        if (Condition === "") {
          this.RemoveFilter();
          return;
        };
        hdr = 0;
        rs = 0;
        if (this.FRowHeader) rs = 1;
        if (this.FHeader.FVisible) hdr = 1;
        if (this.FPaging.FEnabled) {
          if (!pas.System.Assigned(this.FUnfiltered)) {
            this.FUnfiltered  = Array.from(this.FData);
          };
          for (var $l = this.FRowCount - 1, $end = rs; $l >= $end; $l--) {
            r = $l;
            s = this.FData[r][Column];
            if (!pas["WEBLib.Utils"].MatchStr(Condition,s,CaseSensitive) && (hdr < 2)) {
              this.FData.splice(r,1);
            };
          };
          l = this.FData.length;
          this.SetRowCount(l);
          this.SelectPage(this.FPaging.FActivePage,true);
        } else {
          for (var $l1 = rs, $end1 = this.FRowCount - 1; $l1 <= $end1; $l1++) {
            r = $l1;
            if (!pas["WEBLib.Utils"].MatchStr(Condition,this.GetCells(Column,r),CaseSensitive) && (hdr < 2)) {
              tr = this.FTable.rows[r + hdr];
              tr.style.setProperty("display","none");
            };
          };
        };
      };
    };
    this.RemoveFilter = function () {
      var r = 0;
      var rs = 0;
      var l = 0;
      var tr = null;
      if (this.FTable != null) {
        if (this.FColHeader) {
          rs = 1}
         else rs = 0;
        if (this.FPaging.FEnabled) {
          if (pas.System.Assigned(this.FUnfiltered)) {
            this.FData = Array.from(this.FUnfiltered);
            this.FUnfiltered = null;
          };
          l = this.FData.length;
          this.SetRowCount(l);
          this.SelectPage(this.FPaging.FActivePage,true);
        } else {
          for (var $l = rs, $end = this.FRowCount - 1; $l <= $end; $l++) {
            r = $l;
            tr = this.FTable.rows[r];
            tr.style.removeProperty("display");
          };
        };
      };
    };
    this.ScrollRowInView = function (ARow) {
      if ((ARow < this.FRowCount) && (this.FTable != null)) {
        this.FTable.rows[ARow].scrollIntoView({
        behavior: 'smooth',
        block: 'center'
        });
      };
    };
    this.SelectCell = function (ACol, ARow) {
      var el = null;
      if ((ARow < this.FRowCount) && (ACol < this.FColCount)) {
        el = this.GetCellElement(ACol,ARow);
        if (el != null) pas["WEBLib.Utils"].SelectElementContents(el);
      };
    };
    this.FindCell = function (Condition, CaseSensitive, AllCells) {
      var Result = $mod.TGridCoord.$new();
      var i = 0;
      var j = 0;
      if (this.FColHeader && !AllCells) {
        i = 1}
       else i = 0;
      if (this.FRowHeader) {
        j = 1}
       else j = 0;
      this.FFindCase = CaseSensitive;
      this.FFindCondition = Condition;
      Result.$assign(this.FindFrom(i,j,Condition,CaseSensitive,AllCells));
      return Result;
    };
    this.FindNext = function () {
      var Result = $mod.TGridCoord.$new();
      if ((this.FFindCol + 1) === this.FRowCount) {
        if (this.FColHeader) {
          this.FFindCol = 1}
         else this.FFindCol = 0;
        this.FFindRow = this.FFindRow + 1;
      } else this.FFindCol = this.FFindCol + 1;
      Result.$assign(this.FindFrom(this.FFindCol,this.FFindRow,this.FFindCondition,this.FFindCase,false));
      return Result;
    };
    this.HideColumn = function (Index) {
      var i = 0;
      var fr = 0;
      var tr = null;
      var td = null;
      if ((Index < 0) || (Index > this.FColCount)) return;
      if (this.FFooter.FVisible) {
        fr = 1}
       else fr = 0;
      for(i=0; i < this.FTable.rows.length - fr; i++)
      {
        tr = this.FTable.rows[i];
        td = tr.cells[Index];
        td.style.setProperty('display','none');
      };
      this.FHiddenCols.Add(pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
          return Index;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }}));
    };
    this.UnHideColumn = function (Index) {
      var i = 0;
      var idx = 0;
      var tr = null;
      var td = null;
      if ((Index < 0) || (Index > this.FColCount)) return;
      idx = this.FHiddenCols.IndexOf(pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
          return Index;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }}));
      if (idx === -1) return;
      this.FHiddenCols.Delete(idx);
      for(i=0; i<this.FTable.rows.length;i++)
      {
        tr = this.FTable.rows[i];
        td = tr.cells[Index];
        td.style.removeProperty('display');
      };
    };
    this.IsHiddenColumn = function (Index) {
      var Result = false;
      Result = this.FHiddenCols.IndexOf(pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get: function () {
          return Index;
        }, set: function (v) {
          rtl.raiseE("EPropReadOnly");
        }})) !== -1;
      return Result;
    };
    this.HideRow = function (Index) {
      if ((Index < 0) || (Index > this.FRowCount)) return;
      if (!(this.FTable != null)) return;
      var tr = this.FTable.rows[Index];
      tr.style.setProperty('display','none');
    };
    this.UnHideRow = function (Index) {
      if ((Index < 0) || (Index > this.FRowCount)) return;
      var tr = this.FTable.rows[Index];
      tr.style.removeProperty('display');
    };
    this.Sort = function (AColumn, ADirection) {
      var colidx = 0;
      var grid = null;
      var asc = false;
      var rh = false;
      var fixrow = undefined;
      if (!(this.FTable != null)) return;
      grid = this.FTable.children.item(1);
      asc = ADirection === $mod.TGridSortIndicator.siAscending;
      colidx = AColumn;
      if (this.FPaging.FEnabled) {
        rh = this.FRowHeader;
        if (rh) fixrow = this.FData[0];
        
              const getCellValue = (tr, idx) => tr[idx];
              const comparer = (idx, asc) => (a, b) => ((v1, v2) =>
                v1 !== '' && v2 !== '' && !isNaN(v1) && !isNaN(v2) ? v1 - v2 : v1.toString().localeCompare(v2)
                )(getCellValue(asc ? a : b, idx), getCellValue(asc ? b : a, idx));
        
              var arr = Array.from(this.FData);
              if (rh) arr.shift();
              arr.sort(comparer(colidx, asc));
              if (rh) arr.splice(0,0,fixrow);
              this.FData = arr;
        this.SelectPage(this.FPaging.FActivePage,true);
      } else {
        const getCellValue = (tr, idx) => tr.children[idx].innerText || tr.children[idx].textContent;
              const comparer = (idx, asc) => (a, b) => ((v1, v2) =>
                v1 !== '' && v2 !== '' && !isNaN(v1) && !isNaN(v2) ? v1 - v2 : v1.toString().localeCompare(v2)
                )(getCellValue(asc ? a : b, idx), getCellValue(asc ? b : a, idx));
        
              const table = grid;
        
              Array.from(table.querySelectorAll('tr'))
                  .sort(comparer(colidx, asc))
                  .forEach(tr => table.appendChild(tr) );
      };
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].ITMSFNCDataBinderGrid);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("BorderColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FBorderColor","SetBorderColor",4,{Default: 12632256});
    $r.addProperty("BorderStyle",2,pas["WEBLib.Controls"].$rtti["TBorderStyle"],"FBorderStyle","SetBorderStyle",4,{Default: pas["WEBLib.Controls"].TBorderStyle.bsSingle});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor");
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("ElementHeaderClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementHeaderClassName","SetElementHeaderClassName");
    $r.addProperty("ElementRowSelectClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementRowSelectClassName","FElementRowSelectClassName");
    $r.addProperty("ElementSelectionClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementSelectionClassName","FElementSelectionClassName");
    $r.addProperty("ElementTableClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementTableClassName","SetElementTableClassName");
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: false});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("Footer",2,$mod.$rtti["TTableControlHeader"],"FFooter","SetFooter");
    $r.addProperty("Header",2,$mod.$rtti["TTableControlHeader"],"FHeader","SetHeader");
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("RowHeader",2,rtl.boolean,"FRowHeader","SetRowHeader",4,{Default: true});
    $r.addProperty("ColHeader",2,rtl.boolean,"FColHeader","SetColHeader",4,{Default: true});
    $r.addProperty("Options",2,$mod.$rtti["TTableControlOptions"],"FOptions","SetOptions");
    $r.addProperty("Paging",2,$mod.$rtti["TTableControlPaging"],"FPaging","SetPaging");
    $r.addProperty("ParentBiDiMode",0,rtl.boolean,"FParentBiDiMode","FParentBiDiMode",4,{Default: true});
    $r.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti["TPopupMenu"],"FPopupMenu","FPopupMenu");
    $r.addProperty("SelectionColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FSelectionColor","SetSelectionColor",4,{Default: 16748379});
    $r.addProperty("SelectionTextColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FSelectionTextColor","SetSelectionTextColor",4,{Default: 16777215});
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("WordWrap",2,rtl.boolean,"FWordWrap","SetWordWrap",4,{Default: false});
    $r.addProperty("OnButtonClick",0,$mod.$rtti["TCellEvent"],"FOnButtonClick","FOnButtonClick");
    $r.addProperty("OnCheckClick",0,$mod.$rtti["TCellCheckEvent"],"FOnCheckClick","FOnCheckClick");
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnClickCell",0,$mod.$rtti["TCellEvent"],"FOnClickCell","FOnClickCell");
    $r.addProperty("OnDblClickCell",0,$mod.$rtti["TCellEvent"],"FOnDblClickCell","FOnDblClickCell");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnGetCellData",0,$mod.$rtti["TGridGetCellDataEvent"],"FOnGetCellData","FOnGetCellData");
    $r.addProperty("OnGetCellChildren",0,$mod.$rtti["TGridGetCellChildrenEvent"],"FOnGetCellChildren","FOnGetCellChildren");
    $r.addProperty("OnGetCellClass",0,$mod.$rtti["TGridGetCellClassEvent"],"FOnGetCellClass","FOnGetCellClass");
    $r.addProperty("OnSortClick",0,$mod.$rtti["TGridSortClickEvent"],"FOnSortClick","FOnSortClick");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnResize",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnResize","FOnResize");
    $r.addProperty("OnSelectPage",0,$mod.$rtti["TPageSelectEvent"],"FOnSelectPage","FOnSelectPage");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
  });
  rtl.createClass(this,"TTableControl",this.TCustomTableControl,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].ITMSFNCDataBinderGrid);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("RowCount",2,rtl.longint,"FRowCount","SetRowCount");
    $r.addProperty("ColCount",2,rtl.longint,"FColCount","SetColCount");
    $r.addProperty("OnHttpRequestError",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnHttpRequestError","FOnHttpRequestError");
    $r.addProperty("OnHttpRequestSuccess",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnHttpRequestSuccess","FOnHttpRequestSuccess");
  });
  rtl.createClass(this,"TWebTableControl",this.TTableControl,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].ITMSFNCDataBinderGrid);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TResponsiveGridItem",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FHTML = "";
      this.FElementHandle = null;
      this.FTag = 0;
      this.FItemObject = null;
      this.FVisible = false;
      this.FJSONObject = undefined;
      this.FSelected = false;
      this.FRecNo = 0;
    };
    this.$final = function () {
      this.FElementHandle = undefined;
      this.FItemObject = undefined;
      pas.Classes.TCollectionItem.$final.call(this);
    };
    this.SetHTML = function (Value) {
      this.FHTML = Value;
      this.Changed(false);
    };
    this.SetVisible = function (Value) {
      if (this.FVisible !== Value) {
        this.FVisible = Value;
        if (this.FElementHandle != null) {
          if (this.FVisible) {
            this.FElementHandle.style.removeProperty("display")}
           else this.FElementHandle.style.setProperty("display","none");
        };
      };
    };
    this.GetJSONElementValue = function (id) {
      var Result = "";
      var res = "";
      var JO = undefined;
      JO = this.FJSONObject;
      res = JO[id];
      Result = res;
      return Result;
    };
    this.SetSelected = function (Value) {
      var LStyleName = "";
      this.FSelected = Value;
      LStyleName = rtl.as(this.FCollection,$mod.TResponsiveGridItems).FGrid.GetStyleName();
      if (this.FSelected) {
        this.FElementHandle.classList.add(LStyleName + "_Selected")}
       else this.FElementHandle.classList.remove(LStyleName + "_Selected");
    };
    this.Create$1 = function (ACollection) {
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      this.FVisible = true;
      return this;
    };
    this.Destroy = function () {
      rtl.as(this.FCollection,$mod.TResponsiveGridItems).DoItemDelete(this.GetIndex());
      pas.Classes.TCollectionItem.Destroy.call(this);
    };
    var $r = this.$rtti;
    $r.addProperty("HTML",2,rtl.string,"FHTML","SetHTML");
    $r.addProperty("Tag",0,rtl.longint,"FTag","FTag",4,{Default: 0});
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
  });
  this.$rtti.$MethodVar("TResponsiveGridItemEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Index",rtl.longint]]), methodkind: 0});
  this.$rtti.$MethodVar("TResponsiveGridItemAllowEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Index",rtl.longint],["Allow",rtl.boolean,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TResponsiveGridItemTemplateEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Index",rtl.longint],["ItemData",rtl.string],["ATemplate",rtl.string,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TResponsiveGridItemFieldValueEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Index",rtl.longint],["AFieldName",rtl.string],["AValue",rtl.string,1]]), methodkind: 0});
  this.$rtti.$Class("TResponsiveGrid");
  rtl.createClass(this,"TResponsiveGridItems",pas.Classes.TOwnedCollection,function () {
    this.$init = function () {
      pas.Classes.TOwnedCollection.$init.call(this);
      this.FOnItemDelete = null;
      this.FOnItemUpdate = null;
      this.FOnItemInsert = null;
      this.FOnItemAdd = null;
      this.FOnItemClear = null;
      this.FGrid = null;
    };
    this.$final = function () {
      this.FOnItemDelete = undefined;
      this.FOnItemUpdate = undefined;
      this.FOnItemInsert = undefined;
      this.FOnItemAdd = undefined;
      this.FOnItemClear = undefined;
      this.FGrid = undefined;
      pas.Classes.TOwnedCollection.$final.call(this);
    };
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      this.SetItem(Index,Value);
    };
    this.DoItemClear = function () {
      if (this.FOnItemClear != null) this.FOnItemClear(this);
    };
    this.DoItemAdd = function (Index) {
      if (this.FOnItemAdd != null) this.FOnItemAdd(this,Index);
    };
    this.DoItemDelete = function (Index) {
      if (this.FOnItemDelete != null) this.FOnItemDelete(this,Index);
    };
    this.DoItemInsert = function (Index) {
      if (this.FOnItemInsert != null) this.FOnItemInsert(this,Index);
    };
    this.DoItemUpdate = function (Index) {
      if (this.FOnItemUpdate != null) this.FOnItemUpdate(this,Index);
    };
    this.Update = function (Item) {
      pas.Classes.TCollection.Update.apply(this,arguments);
      if (Item != null) this.DoItemUpdate(Item.GetIndex());
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,$mod.TResponsiveGridItem);
      this.FGrid = AOwner;
      return this;
    };
    this.Clear$1 = function () {
      pas.Classes.TCollection.Clear.call(this);
      this.DoItemClear();
    };
    this.Delete$1 = function (Index) {
      pas.Classes.TCollection.Delete.call(this,Index);
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      this.DoItemAdd(Result.GetIndex());
      return Result;
    };
    this.Add$2 = function (HTML) {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      Result.FHTML = HTML;
      this.DoItemAdd(Result.GetIndex());
      return Result;
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      this.DoItemInsert(Result.GetIndex());
      return Result;
    };
  });
  this.TResponsiveGridTemplateOrder = {"0": "toColumn", toColumn: 0, "1": "toRow", toRow: 1};
  this.$rtti.$Enum("TResponsiveGridTemplateOrder",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TResponsiveGridTemplateOrder});
  rtl.createClass(this,"TResponsiveGridOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FItemWidthMin = 0;
      this.FItemHeight = 0;
      this.FItemGap = 0;
      this.FScrollVertical = false;
      this.FItemClassName = "";
      this.FItemColor = 0;
      this.FItemBorderColor = 0;
      this.FItemHoverColor = 0;
      this.FItemHoverBorderColor = 0;
      this.FOnChange = null;
      this.FItemPadding = 0;
      this.FItemTemplate = "";
      this.FItemSelectedBorderColor = 0;
      this.FItemSelectedTextColor = 0;
      this.FItemSelectedColor = 0;
      this.FMultiSelect = false;
      this.FOrder = 0;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetItemBorderColor = function (Value) {
      if (this.FItemBorderColor !== Value) {
        this.FItemBorderColor = Value;
        this.Changed();
      };
    };
    this.SetItemColor = function (Value) {
      if (this.FItemColor !== Value) {
        this.FItemColor = Value;
        this.Changed();
      };
    };
    this.SetItemGap = function (Value) {
      if (this.FItemGap !== Value) {
        this.FItemGap = Value;
        this.Changed();
      };
    };
    this.SetItemHeight = function (Value) {
      if (this.FItemHeight !== Value) {
        this.FItemHeight = Value;
        this.Changed();
      };
    };
    this.SetItemHoverBorderColor = function (Value) {
      if (this.FItemHoverBorderColor !== Value) {
        this.FItemHoverBorderColor = Value;
        this.Changed();
      };
    };
    this.SetItemHoverColor = function (Value) {
      if (this.FItemHoverColor !== Value) {
        this.FItemHoverColor = Value;
        this.Changed();
      };
    };
    this.SetItemWidthMin = function (Value) {
      if (this.FItemWidthMin !== Value) {
        this.FItemWidthMin = Value;
        this.Changed();
      };
    };
    this.SetScrollVertical = function (Value) {
      if (this.FScrollVertical !== Value) {
        this.FScrollVertical = Value;
        this.Changed();
      };
    };
    this.SetItemPadding = function (Value) {
      if (this.FItemPadding !== Value) {
        this.FItemPadding = Value;
        this.Changed();
      };
    };
    this.SetItemTemplate = function (Value) {
      if (this.FItemTemplate !== Value) {
        this.FItemTemplate = Value;
        this.Changed();
      };
    };
    this.SetItemSelectedBorderColor = function (Value) {
      if (this.FItemSelectedBorderColor !== Value) {
        this.FItemSelectedBorderColor = Value;
        this.Changed();
      };
    };
    this.SetItemSelectedColor = function (Value) {
      if (this.FItemSelectedColor !== Value) {
        this.FItemSelectedColor = Value;
        this.Changed();
      };
    };
    this.SetItemSelectedTextColor = function (Value) {
      if (this.FItemSelectedTextColor !== Value) {
        this.FItemSelectedTextColor = Value;
        this.Changed();
      };
    };
    this.Changed = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Create$1 = function () {
      pas.System.TObject.Create.call(this);
      this.FItemWidthMin = 100;
      this.FItemHeight = 100;
      this.FItemGap = 10;
      this.FScrollVertical = true;
      this.FItemColor = -1;
      this.FItemBorderColor = -1;
      this.FItemHoverColor = -1;
      this.FItemHoverBorderColor = -1;
      this.FItemSelectedColor = -1;
      this.FItemSelectedBorderColor = -1;
      this.FItemSelectedTextColor = -1;
      this.FOrder = $mod.TResponsiveGridTemplateOrder.toColumn;
      return this;
    };
    this.Assign = function (Source) {
      if ($mod.TResponsiveGridOptions.isPrototypeOf(Source)) {
        this.FItemWidthMin = rtl.as(Source,$mod.TResponsiveGridOptions).FItemWidthMin;
        this.FItemHeight = rtl.as(Source,$mod.TResponsiveGridOptions).FItemHeight;
        this.FMultiSelect = rtl.as(Source,$mod.TResponsiveGridOptions).FMultiSelect;
        this.FOrder = rtl.as(Source,$mod.TResponsiveGridOptions).FOrder;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("ItemClassName",0,rtl.string,"FItemClassName","FItemClassName");
    $r.addProperty("ItemColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FItemColor","SetItemColor",4,{Default: -1});
    $r.addProperty("ItemBorderColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FItemBorderColor","SetItemBorderColor",4,{Default: -1});
    $r.addProperty("ItemGap",2,rtl.longint,"FItemGap","SetItemGap",4,{Default: 10});
    $r.addProperty("ItemHeight",2,rtl.longint,"FItemHeight","SetItemHeight",4,{Default: 100});
    $r.addProperty("ItemHoverColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FItemHoverColor","SetItemHoverColor",4,{Default: -1});
    $r.addProperty("ItemHoverBorderColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FItemHoverBorderColor","SetItemHoverBorderColor",4,{Default: -1});
    $r.addProperty("ItemSelectedColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FItemSelectedColor","SetItemSelectedColor",4,{Default: -1});
    $r.addProperty("ItemSelectedBorderColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FItemSelectedBorderColor","SetItemSelectedBorderColor",4,{Default: -1});
    $r.addProperty("ItemSelectedTextColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FItemSelectedTextColor","SetItemSelectedTextColor",4,{Default: -1});
    $r.addProperty("ItemPadding",2,rtl.longint,"FItemPadding","SetItemPadding",4,{Default: 0});
    $r.addProperty("ItemTemplate",2,rtl.string,"FItemTemplate","SetItemTemplate");
    $r.addProperty("ItemWidthMin",2,rtl.longint,"FItemWidthMin","SetItemWidthMin",4,{Default: 100});
    $r.addProperty("MultiSelect",0,rtl.boolean,"FMultiSelect","FMultiSelect",4,{Default: false});
    $r.addProperty("Order",0,$mod.$rtti["TResponsiveGridTemplateOrder"],"FOrder","FOrder",4,{Default: $mod.TResponsiveGridTemplateOrder.toColumn});
    $r.addProperty("ScrollVertical",2,rtl.boolean,"FScrollVertical","SetScrollVertical",4,{Default: true});
    $r.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChange","FOnChange");
  });
  rtl.createClass(this,"TResponsiveGrid",pas["WEBLib.Menus"].TWebCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Menus"].TWebCustomControl.$init.call(this);
      this.FDesignTime$1 = false;
      this.FReq = null;
      this.FDataNode = "";
      this.FOptions = null;
      this.FItems = null;
      this.FOnItemDblClick = null;
      this.FOnItemClick = null;
      this.FOnBeforeItemClick = null;
      this.FOnHttpRequestError = null;
      this.FOnHttpRequestSuccess = null;
      this.FOnItemCreated = null;
      this.FOnItemGetFieldValue = null;
      this.FItemIndex = 0;
      this.FDelimiter = "\x00";
      this.FOnHttpRequest = null;
      this.FListElement = null;
      this.FOnItemGetTemplate = null;
    };
    this.$final = function () {
      this.FReq = undefined;
      this.FOptions = undefined;
      this.FItems = undefined;
      this.FOnItemDblClick = undefined;
      this.FOnItemClick = undefined;
      this.FOnBeforeItemClick = undefined;
      this.FOnHttpRequestError = undefined;
      this.FOnHttpRequestSuccess = undefined;
      this.FOnItemCreated = undefined;
      this.FOnItemGetFieldValue = undefined;
      this.FOnHttpRequest = undefined;
      this.FListElement = undefined;
      this.FOnItemGetTemplate = undefined;
      pas["WEBLib.Menus"].TWebCustomControl.$final.call(this);
    };
    this.SetOptions = function (Value) {
      this.FOptions.Assign(Value);
    };
    this.SetItems = function (Value) {
      this.FItems.Assign(Value);
    };
    this.SetItemIndex = function (Value) {
      var el = null;
      var i = 0;
      var LStyleName = "";
      this.FItemIndex = Value;
      if (pas.Classes.TComponentStateItem.csLoading in this.FComponentState) return;
      LStyleName = this.GetStyleName();
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        el = this.ListElementHandle().children.item(i);
        if (i === this.FItemIndex) {
          el.setAttribute("class",this.FOptions.FItemClassName + " " + LStyleName + "_Selected");
        } else el.setAttribute("class",this.FOptions.FItemClassName);
      };
    };
    this.DoHttpLoadJson = function (Event) {
      var Result = false;
      var J = null;
      var req = null;
      req = Event.target;
      if ((req.status >= 200) && (req.status <= 208)) {
        this.FItems.Clear$1();
        J = JSON.parse(req.responseText);
        this.LoadFromJSON$1(J,this.FDataNode);
        if (this.FOnHttpRequestSuccess != null) this.FOnHttpRequestSuccess(this);
      };
      Result = true;
      return Result;
    };
    this.DoHttpLoadCsv = function (Event) {
      var Result = false;
      var sl = null;
      var arow = null;
      var columns = null;
      var i = 0;
      var c = 0;
      var itm = null;
      var ident = "";
      var html = "";
      var htmlvalue = "";
      var req = null;
      req = Event.target;
      if ((req.status >= 200) && (req.status <= 208)) {
        sl = pas.Classes.TStringList.$create("Create$1");
        sl.SetTextStr(req.responseText);
        arow = pas.Classes.TStringList.$create("Create$1");
        arow.FStrictDelimiter = true;
        arow.SetDelimiter(this.FDelimiter);
        if (sl.GetCount() > 0) {
          columns = pas.Classes.TStringList.$create("Create$1");
          columns.FStrictDelimiter = true;
          columns.SetDelimiter(this.FDelimiter);
          columns.SetDelimitedText(sl.Get(0));
          for (var $l = 0, $end = sl.GetCount() - 1; $l <= $end; $l++) {
            i = $l;
            arow.SetDelimitedText(sl.Get(i));
            if (this.FOptions.FItemTemplate === "") {
              this.FItems.Add$1().SetHTML(arow.GetCommaText());
            } else {
              itm = this.FItems.Add$2("&nbsp;");
              html = this.FOptions.FItemTemplate;
              this.DoItemGetTemplate(i,arow.GetCommaText(),{get: function () {
                  return html;
                }, set: function (v) {
                  html = v;
                }});
              ident = "(%ITEMINDEX%)";
              if (pas.System.Pos(ident,html) > 0) {
                html = pas.SysUtils.StringReplace(html,ident,pas.SysUtils.IntToStr(itm.GetIndex()),rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
              };
              for (var $l1 = 0, $end1 = arow.GetCount() - 1; $l1 <= $end1; $l1++) {
                c = $l1;
                ident = "(%" + columns.Get(c) + "%)";
                if (pas.System.Pos(ident,html) > 0) {
                  htmlvalue = "";
                  if (c < arow.GetCount()) htmlvalue = arow.Get(c);
                  this.DoItemGetFieldValue(itm.GetIndex(),columns.Get(c),{get: function () {
                      return htmlvalue;
                    }, set: function (v) {
                      htmlvalue = v;
                    }});
                  html = pas.SysUtils.StringReplace(html,ident,htmlvalue,rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
                };
              };
              itm.SetHTML(html);
              this.DoItemCreated(itm.GetIndex());
            };
          };
          columns = rtl.freeLoc(columns);
        };
        arow = rtl.freeLoc(arow);
        sl = rtl.freeLoc(sl);
      };
      Result = true;
      return Result;
    };
    this.DoHttpAbort = function (Event) {
      var Result = false;
      if (this.FOnHttpRequestError != null) this.FOnHttpRequestError(this);
      Result = true;
      return Result;
    };
    this.DoHttpRequest = function (ARequest) {
      var LRequestRec = pas["WEBLib.Controls"].TJSXMLHttpRequestRecord.$new();
      if (this.FOnHttpRequest != null) {
        LRequestRec.req = ARequest;
        this.FOnHttpRequest(this,pas["WEBLib.Controls"].TJSXMLHttpRequestRecord.$clone(LRequestRec));
      };
    };
    this.DoItemCreated = function (Index) {
      if (this.FOnItemCreated != null) this.FOnItemCreated(this,Index);
    };
    this.DoItemGetFieldValue = function (Index, AFieldName, AValue) {
      if (this.FOnItemGetFieldValue != null) this.FOnItemGetFieldValue(this,Index,AFieldName,AValue);
    };
    this.DoItemGetTemplate = function (Index, ItemData, ATemplate) {
      if (this.FOnItemGetTemplate != null) this.FOnItemGetTemplate(this,Index,ItemData,ATemplate);
    };
    this.HandleDoItemClick = function (Index) {
      if (this.FOnItemClick != null) this.FOnItemClick(this,Index);
    };
    this.HandleDoBeforeItemClick = function (Index, Allow) {
      if (this.FOnBeforeItemClick != null) this.FOnBeforeItemClick(this,Index,Allow);
    };
    this.HandleDoItemDblClick = function (Index) {
      if (this.FOnItemDblClick != null) this.FOnItemDblClick(this,Index);
    };
    this.TargetIsParent = function (tgt, el) {
      var Result = false;
      var pe = null;
      Result = false;
      pe = tgt;
      do {
        if (el === pe) {
          Result = true;
          break;
        };
        pe = pe.parentElement;
      } while (pe != null);
      return Result;
    };
    this.HandleDoMouseEnter = function (Event) {
      var Result = false;
      Result = pas["WEBLib.Controls"].TControl.HandleDoMouseEnter.call(this,Event);
      return Result;
    };
    this.HandleDoClick = function (Event) {
      var Result = false;
      var i = 0;
      var el = null;
      var LStyleName = "";
      var Allow = false;
      Result = pas["WEBLib.Controls"].TControl.HandleDoClick.call(this,Event);
      LStyleName = this.GetStyleName();
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        el = this.ListElementHandle().children.item(i);
        if (el != null) {
          if (this.TargetIsParent(Event.target,el)) {
            Allow = true;
            this.HandleDoBeforeItemClick(i,{get: function () {
                return Allow;
              }, set: function (v) {
                Allow = v;
              }});
            if (!Allow) continue;
            if (this.FOptions.FMultiSelect) {
              if (this.FItems.GetItem$1(i).FSelected) {
                el.classList.remove(LStyleName + "_Selected");
              } else {
                el.classList.add(LStyleName + "_Selected");
              };
              this.FItems.GetItem$1(i).FSelected = !this.FItems.GetItem$1(i).FSelected;
            } else {
              this.FItemIndex = i;
              el.classList.add(LStyleName + "_Selected");
            };
            this.HandleDoItemClick(i);
          } else if (!this.FOptions.FMultiSelect) el.classList.remove(LStyleName + "_Selected");
        };
      };
      return Result;
    };
    this.HandleDoDblClick = function (Event) {
      var Result = false;
      var i = 0;
      var el = null;
      Result = pas["WEBLib.Controls"].TControl.HandleDoClick.call(this,Event);
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        el = this.ListElementHandle().children.item(i);
        if (this.TargetIsParent(Event.target,el)) {
          this.HandleDoItemDblClick(i);
        };
      };
      return Result;
    };
    this.HandleItemAdd = function (Sender, Index) {
      var el = null;
      if (this.FItems.GetItem$1(Index).FHTML === "") this.FItems.GetItem$1(Index).FHTML = this.FOptions.FItemTemplate;
      el = document.createElement("DIV");
      this.FItems.GetItem$1(Index).FElementHandle = el;
      this.ListElementHandle().appendChild(el);
      if (pas.System.Pos("(%",this.FItems.GetItem$1(Index).FHTML) === 0) el.innerHTML = this.FItems.GetItem$1(Index).FHTML;
      if (this.FOptions.FItemClassName !== "") el.setAttribute("class",this.FOptions.FItemClassName);
    };
    this.HandleItemUpdate = function (Sender, Index) {
      var el = null;
      if (this.ListElementHandle() != null) {
        el = this.ListElementHandle().children.item(Index);
        if (!(el != null)) {
          this.HandleItemInsert(this,Index);
        } else el.innerHTML = this.FItems.GetItem$1(Index).FHTML;
      };
    };
    this.HandleItemDelete = function (Sender, Index) {
      if (this.ListElementHandle() != null) {
        this.ListElementHandle().removeChild(this.ListElementHandle().children.item(Index));
      };
    };
    this.HandleItemInsert = function (Sender, Index) {
      var el = null;
      this.FItems.GetItem$1(Index).FHTML = this.FOptions.FItemTemplate;
      el = document.createElement("DIV");
      this.FItems.GetItem$1(Index).FElementHandle = el;
      if (this.FItems.GetCount() <= 1) {
        this.ListElementHandle().appendChild(el)}
       else this.ListElementHandle().insertBefore(el,this.ListElementHandle().children.item(Index));
      el.innerHTML = this.FItems.GetItem$1(Index).FHTML;
      if (this.FOptions.FItemClassName !== "") el.setAttribute("class",this.FOptions.FItemClassName);
    };
    this.HandleItemClear = function (Sender) {
      var i = 0;
      for (var $l = this.ListElementHandle().childElementCount - 1; $l >= 0; $l--) {
        i = $l;
        this.ListElementHandle().removeChild(this.ListElementHandle().children.item(0));
      };
    };
    this.OptionsChanged = function (Sender) {
      this.UpdateElement();
    };
    this.FontChanged = function () {
      pas["WEBLib.Controls"].TControl.FontChanged.call(this);
      this.UpdateElement();
    };
    this.CreateElement = function () {
      var Result = null;
      Result = document.createElement("DIV");
      return Result;
    };
    this.CreateControl = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateControl.call(this);
    };
    this.BindElement = function () {
      pas["WEBLib.Controls"].TCustomControl.BindElement.call(this);
    };
    var cssimportant = " !important; ";
    this.UpdateElement = function () {
      var s = "";
      var fs = "";
      var ITMWIDTHMIN = "";
      var ITMGAP = "";
      var ITMHEIGHT = "";
      var itemstyle = "";
      var itemstylehover = "";
      var itemstyleselected = "";
      var LStyleName = "";
      var LTemplate = "";
      pas["WEBLib.Controls"].TControl.UpdateElement.call(this);
      if (this.IsUpdating()) return;
      if (pas.Classes.TComponentStateItem.csLoading in this.FComponentState) return;
      if (this.GetElementHandle() != null) {
        ITMWIDTHMIN = pas.SysUtils.IntToStr(this.FOptions.FItemWidthMin);
        ITMHEIGHT = pas.SysUtils.IntToStr(this.FOptions.FItemHeight);
        ITMGAP = pas.SysUtils.IntToStr(this.FOptions.FItemGap);
        LStyleName = this.GetStyleName();
        this.ListElementHandle().setAttribute("class",LStyleName);
        fs = "";
        if ((this.FElementClassName === "") && (this.FElementFont === pas["WEBLib.Controls"].TElementFont.efProperty)) fs = pas["WEBLib.Graphics"].CSSFont(this.FFont);
        itemstyle = "";
        itemstylehover = "";
        itemstyleselected = "";
        if (this.FOptions.FItemColor !== -1) {
          itemstyle = "background-color:" + pas["WEBLib.Graphics"].ColorToHTML(this.FOptions.FItemColor) + ";";
        };
        if ((pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) && (this.FOptions.FItemBorderColor === -1)) {
          itemstyle = itemstyle + "border: 1px dotted silver;"}
         else if (this.FOptions.FItemBorderColor !== -1) itemstyle = itemstyle + "border: 1px solid " + pas["WEBLib.Graphics"].ColorToHTML(this.FOptions.FItemBorderColor) + ";";
        if (this.FOptions.FItemPadding !== 0) itemstyle = itemstyle + "padding:" + pas.SysUtils.IntToStr(this.FOptions.FItemPadding) + "px;";
        if (this.FOptions.FItemHoverColor !== -1) itemstylehover = "background-color:" + pas["WEBLib.Graphics"].ColorToHTML(this.FOptions.FItemHoverColor) + cssimportant;
        if (this.FOptions.FItemHoverBorderColor !== -1) itemstylehover = itemstylehover + "border: 1px solid " + pas["WEBLib.Graphics"].ColorToHTML(this.FOptions.FItemHoverBorderColor) + cssimportant;
        if (this.FOptions.FItemSelectedColor !== -1) itemstyleselected = "background-color:" + pas["WEBLib.Graphics"].ColorToHTML(this.FOptions.FItemSelectedColor) + cssimportant;
        if (this.FOptions.FItemSelectedBorderColor !== -1) itemstyleselected = itemstyleselected + "border: 1px solid " + pas["WEBLib.Graphics"].ColorToHTML(this.FOptions.FItemSelectedBorderColor) + ";";
        if (this.FOptions.FItemSelectedTextColor !== -1) itemstyleselected = itemstyleselected + "color:" + pas["WEBLib.Graphics"].ColorToHTML(this.FOptions.FItemSelectedTextColor) + ";";
        if (this.FOptions.FScrollVertical) {
          this.GetElementHandle().style.removeProperty("overflow-y")}
         else this.GetElementHandle().style.setProperty("overflow-y","hidden");
        if (this.FOptions.FOrder === $mod.TResponsiveGridTemplateOrder.toColumn) {
          LTemplate = "grid-template-columns"}
         else {
          LTemplate = "grid-auto-flow: column; height: " + pas["WEBLib.Utils"].TLongIntHelper.ToString.call({p: this.GetHeight(), get: function () {
              return this.p;
            }, set: function (v) {
              this.p = v;
            }}) + "px; grid-template-rows";
          ITMWIDTHMIN = pas.SysUtils.IntToStr(this.FOptions.FItemHeight);
          this.GetElementHandle().style.setProperty("overflow-x","auto");
        };
        s = "." + LStyleName + " {" + "display: grid; " + LTemplate + ": repeat(auto-fill, minmax(" + ITMWIDTHMIN + "px, 1fr));" + " grid-gap: " + ITMGAP + "px;" + "}" + "\r" + "." + LStyleName + " > div { " + itemstyle + "height: " + ITMHEIGHT + "px; " + fs + " }" + "\r" + "." + LStyleName + " > div:hover {" + itemstylehover + " " + fs + " }" + "\r" + "." + LStyleName + "_Selected {" + itemstyleselected + "height: " + ITMHEIGHT + "px;" + fs + "}" + "\r";
        this.$class.AddInstanceStyle$1(LStyleName + "_style",s);
      };
      this.RenderGrid();
    };
    this.RenderGrid = function () {
      var i = 0;
      var el = null;
      if (pas.Classes.TComponentStateItem.csDestroying in this.FComponentState) return;
      if (!(this.GetElementHandle() != null)) return;
      if (!(this.ListElementHandle() != null)) return;
      while (this.ListElementHandle().childElementCount > 0) {
        this.ListElementHandle().removeChild(this.ListElementHandle().firstChild);
      };
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        el = document.createElement("DIV");
        el.style.setProperty("position","relative");
        this.FItems.GetItem$1(i).FElementHandle = el;
        this.ListElementHandle().appendChild(el);
        el.innerHTML = this.FItems.GetItem$1(i).FHTML;
        if (this.FOptions.FItemClassName !== "") el.setAttribute("class",this.FOptions.FItemClassName);
      };
    };
    this.Loaded = function () {
      pas["WEBLib.Controls"].TCustomControl.Loaded.call(this);
      this.RenderGrid();
    };
    this.GetStyleName = function () {
      var Result = "";
      if (this.FParent != null) {
        Result = this.FParent.FName + "_" + this.FName}
       else Result = this.FName;
      return Result;
    };
    this.InitCSSLibrary = function (ALibrary) {
      if (ALibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap) {
        this.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
      };
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.Controls"].TControl.Create$1.apply(this,arguments);
      return this;
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.FDesignTime$1 = (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) && !((pas.Classes.TComponentStateItem.csReading in this.FOwner.FComponentState) || (pas.Classes.TComponentStateItem.csLoading in this.FOwner.FComponentState));
      this.FListElement = null;
      this.FItemIndex = -1;
      this.FOptions = $mod.TResponsiveGridOptions.$create("Create$1");
      this.FOptions.FOnChange = rtl.createCallback(this,"OptionsChanged");
      this.FItems = $mod.TResponsiveGridItems.$create("Create$3",[this]);
      this.FItems.FPropName = "Items";
      if (this.FDesignTime$1) {
        this.FItems.Clear$1();
        this.FItems.Add$1();
        this.FItems.Add$1();
        this.FItems.Add$1();
      };
      this.FItems.FOnItemAdd = rtl.createCallback(this,"HandleItemAdd");
      this.FItems.FOnItemUpdate = rtl.createCallback(this,"HandleItemUpdate");
      this.FItems.FOnItemDelete = rtl.createCallback(this,"HandleItemDelete");
      this.FItems.FOnItemInsert = rtl.createCallback(this,"HandleItemInsert");
      this.FItems.FOnItemClear = rtl.createCallback(this,"HandleItemClear");
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        this.SetWidth(400);
        this.SetHeight(300);
      };
    };
    this.Destroy = function () {
      rtl.free(this,"FOptions");
      rtl.free(this,"FItems");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.LoadFromJSON = function (AURL, ADataNode) {
      this.FDataNode = ADataNode;
      this.FReq = new XMLHttpRequest();
      this.FReq.addEventListener("load",rtl.createSafeCallback(this,"DoHttpLoadJson"));
      this.FReq.addEventListener("abort",rtl.createSafeCallback(this,"DoHttpAbort"));
      this.FReq.open("GET",AURL);
      this.DoHttpRequest(this.FReq);
      this.FReq.send();
    };
    this.LoadFromJSON$1 = function (ASJON, ADataNode) {
      var JO = undefined;
      var JA = null;
      var r = 0;
      var c = 0;
      var arow = "";
      var ident = "";
      var html = "";
      var htmlvalue = "";
      var sl = null;
      var itm = null;
      if (ADataNode !== "") {
        JA = ASJON[ADataNode]}
       else JA = ASJON;
      if (JA != null) {
        sl = pas.Classes.TStringList.$create("Create$1");
        for (var $l = 0, $end = JA.length - 1; $l <= $end; $l++) {
          r = $l;
          JO = JA[r];
          c = 0;
          arow = "";
          var x = undefined;
          for (x in JO) {
            arow += "|" + x + "=" + JO[x];
            c++;
          };
          pas.System.Delete({get: function () {
              return arow;
            }, set: function (v) {
              arow = v;
            }},1,1);
          sl.FStrictDelimiter = true;
          sl.SetDelimiter("|");
          sl.SetDelimitedText(arow);
          itm = this.FItems.Add$1();
          itm.FJSONObject = JO;
          if (this.FOptions.FItemTemplate === "") {
            itm.SetHTML(sl.GetCommaText());
          } else {
            html = this.FOptions.FItemTemplate;
            this.DoItemGetTemplate(r,sl.GetCommaText(),{get: function () {
                return html;
              }, set: function (v) {
                html = v;
              }});
            ident = "(%ITEMINDEX%)";
            if (pas.System.Pos(ident,html) > 0) {
              html = pas.SysUtils.StringReplace(html,ident,pas.SysUtils.IntToStr(itm.GetIndex()),rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
            };
            for (var $l1 = 0, $end1 = sl.GetCount() - 1; $l1 <= $end1; $l1++) {
              c = $l1;
              ident = "(%" + sl.GetName(c) + "%)";
              if (pas.System.Pos(ident,html) > 0) {
                htmlvalue = sl.GetValue(sl.GetName(c));
                this.DoItemGetFieldValue(itm.GetIndex(),sl.GetName(c),{get: function () {
                    return htmlvalue;
                  }, set: function (v) {
                    htmlvalue = v;
                  }});
                html = pas.SysUtils.StringReplace(html,ident,htmlvalue,rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
              };
            };
            itm.SetHTML(html);
            this.DoItemCreated(itm.GetIndex());
          };
        };
        sl = rtl.freeLoc(sl);
      };
    };
    this.LoadFromCSV = function (AURL, Delimiter) {
      this.FDelimiter = Delimiter;
      this.FReq = new XMLHttpRequest();
      this.FReq.addEventListener("load",rtl.createSafeCallback(this,"DoHttpLoadCsv"));
      this.FReq.addEventListener("abort",rtl.createSafeCallback(this,"DoHttpAbort"));
      this.FReq.open("GET",AURL);
      this.DoHttpRequest(this.FReq);
      this.FReq.send();
    };
    this.ListElementHandle = function () {
      var Result = null;
      if (!(this.FListElement != null)) {
        this.FListElement = document.createElement("DIV");
        this.FListElement.setAttribute("width","100%");
        this.GetElementHandle().appendChild(this.FListElement);
        Result = this.FListElement;
      } else Result = this.FListElement;
      return Result;
    };
    this.ItemByTag = function (ATag) {
      var Result = null;
      var i = 0;
      Result = null;
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.FItems.GetItem$1(i).FTag === ATag) {
          Result = this.FItems.GetItem$1(i);
          break;
        };
      };
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("ItemIndex",2,rtl.longint,"FItemIndex","SetItemIndex",4,{Default: -1});
    $r.addProperty("Items",2,$mod.$rtti["TResponsiveGridItems"],"FItems","SetItems");
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("Options",2,$mod.$rtti["TResponsiveGridOptions"],"FOptions","SetOptions");
    $r.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",4,{Default: true});
    $r.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti["TPopupMenu"],"FPopupMenu","FPopupMenu");
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseDown","FOnMouseDown");
    $r.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseUp","FOnMouseUp");
    $r.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti["TMouseMoveEvent"],"FOnMouseMove","FOnMouseMove");
    $r.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseLeave","FOnMouseLeave");
    $r.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseEnter","FOnMouseEnter");
    $r.addProperty("OnBeforeItemClick",0,$mod.$rtti["TResponsiveGridItemAllowEvent"],"FOnBeforeItemClick","FOnBeforeItemClick");
    $r.addProperty("OnItemCreated",0,$mod.$rtti["TResponsiveGridItemEvent"],"FOnItemCreated","FOnItemCreated");
    $r.addProperty("OnItemGetFieldValue",0,$mod.$rtti["TResponsiveGridItemFieldValueEvent"],"FOnItemGetFieldValue","FOnItemGetFieldValue");
    $r.addProperty("OnItemGetTemplate",0,$mod.$rtti["TResponsiveGridItemTemplateEvent"],"FOnItemGetTemplate","FOnItemGetTemplate");
    $r.addProperty("OnItemClick",0,$mod.$rtti["TResponsiveGridItemEvent"],"FOnItemClick","FOnItemClick");
    $r.addProperty("OnItemDblClick",0,$mod.$rtti["TResponsiveGridItemEvent"],"FOnItemDblClick","FOnItemDblClick");
    $r.addProperty("OnResize",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnResize","FOnResize");
    $r.addProperty("OnHttpRequestError",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnHttpRequestError","FOnHttpRequestError");
    $r.addProperty("OnHttpRequestSuccess",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnHttpRequestSuccess","FOnHttpRequestSuccess");
    $r.addProperty("OnHttpRequest",0,$mod.$rtti["TGridRequestEvent"],"FOnHttpRequest","FOnHttpRequest");
  });
  rtl.createClass(this,"TWebResponsiveGrid",this.TResponsiveGrid,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.GridRect = function (Left, Top, Right, Bottom) {
    var Result = $mod.TGridRect.$new();
    Result.Left = Left;
    Result.Top = Top;
    Result.Right = Right;
    Result.Bottom = Bottom;
    return Result;
  };
  $mod.$implcode = function () {
    $impl.GlyphAscending = "&#x25B2;";
    $impl.GlyphDescending = "&#x25BC;";
    $impl.CELLPADDING = 0;
  };
},["SysUtils","Math","WEBLib.Utils","WEBLib.WebTools","WEBLib.Forms"]);
rtl.module("WEBLib.DataGrid.DataAdapter.XData",["System","WEBLib.DataGrid.Common","WEBLib.DataGrid.libjs","Classes","libdatagrid","WEBLib.Controls","WEBLib.DataGrid.Options","Types","WEBLib.RegularExpressions","WEBLib.DataGrid.DataAdapter.Base","JS","jsdelphisystem","Web","SysUtils"],function () {
  "use strict";
  var $mod = this;
  this.$rtti.$MethodVar("TDGBeforeLoadSchemaEvent",{procsig: rtl.newTIProcSig([["Sender",pas.Classes.$rtti["TComponent"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TDGAfterLoadSchemaEvent",{procsig: rtl.newTIProcSig([["Sender",pas.Classes.$rtti["TComponent"]],["Successful",rtl.boolean]]), methodkind: 0});
  this.$rtti.$MethodVar("TDGOnLoadSchemaColumnEvent",{procsig: rtl.newTIProcSig([["Sender",pas.Classes.$rtti["TComponent"]],["SourceGrid",pas.Classes.$rtti["TComponent"]],["Column",pas["WEBLib.DataGrid.Options"].$rtti["TDGColumnDefsCollectionItemBase"]],["ColumnName",rtl.string],["ColumnType",rtl.string],["IsRequired",rtl.boolean],["IsReference",rtl.boolean]]), methodkind: 0});
  this.$rtti.$MethodVar("TDGOnTransformGetRowDataEvent",{procsig: rtl.newTIProcSig([["Sender",pas.Classes.$rtti["TComponent"]],["RowObject",pas.JS.$rtti["TJSObject"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TDGOnTransformUpdateEvent",{procsig: rtl.newTIProcSig([["Sender",pas.Classes.$rtti["TComponent"]],["RowObject",pas.JS.$rtti["TJSObject"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TDGOnTransformInsertEvent",{procsig: rtl.newTIProcSig([["Sender",pas.Classes.$rtti["TComponent"]],["RowObject",pas.JS.$rtti["TJSObject"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TDGOnTransformDeleteEvent",{procsig: rtl.newTIProcSig([["Sender",pas.Classes.$rtti["TComponent"]],["RowObject",pas.JS.$rtti["TJSObject"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TDGOnGetDefaultDisplayTextEvent",{procsig: rtl.newTIProcSig([["Sender",pas.Classes.$rtti["TComponent"]],["RowObject",pas.JS.$rtti["TJSObject"]]],rtl.string), methodkind: 1});
  rtl.createClass(this,"TDGXDataDataAdapterBase",pas["WEBLib.DataGrid.DataAdapter.Base"].TDGServerDataAdapter,function () {
    this.$init = function () {
      pas["WEBLib.DataGrid.DataAdapter.Base"].TDGServerDataAdapter.$init.call(this);
      this.FOnBeforeLoadSchema = null;
      this.FOnAfterLoadSchema = null;
    };
    this.$final = function () {
      this.FOnBeforeLoadSchema = undefined;
      this.FOnAfterLoadSchema = undefined;
      pas["WEBLib.DataGrid.DataAdapter.Base"].TDGServerDataAdapter.$final.call(this);
    };
    this.ProcessFilter = function (FilterModel, KeyMap) {
      var Result = "";
      var keys = [];
      var key = "";
      var FieldName = "";
      var FilterStr = "";
      var Count = 0;
      var I = 0;
      var Condition = null;
      var Conditions = null;
      Result = "";
      if ((typeof(FilterModel) !== "undefined") && (FilterModel !== null)) {
        keys = Object.keys(FilterModel);
        for (var $in = keys, $l = 0, $end = rtl.length($in) - 1; $l <= $end; $l++) {
          key = $in[$l];
          if (FilterModel.hasOwnProperty(key)) {
            if ((typeof(KeyMap) === "object") && (KeyMap !== null) && (typeof(KeyMap[key]) === "string")) {
              FieldName = "" + KeyMap[key]}
             else FieldName = key;
            Conditions = FilterModel[key];
            if (typeof(Conditions) !== "undefined") {
              if ((typeof(Conditions.conditions) !== "undefined") && Array.isArray(Conditions.conditions)) {
                Count = Conditions.conditions.length;
                for (var $l1 = 0, $end1 = Count - 1; $l1 <= $end1; $l1++) {
                  I = $l1;
                  Condition = Conditions.conditions[I];
                  if (FilterStr !== "") {
                    if (Conditions.operator.length > 0) {
                      FilterStr = FilterStr + "%20" + pas.SysUtils.TStringHelper.ToLower.call({p: Conditions, get: function () {
                          return this.p.operator;
                        }, set: function (v) {
                          this.p.operator = v;
                        }}) + "%20"}
                     else FilterStr = FilterStr + "%20and%20";
                  };
                  FilterStr = FilterStr + this.ProcessCondition(FieldName,Condition);
                };
              } else {
                Condition = Conditions;
                FilterStr = this.ProcessCondition(FieldName,Condition);
              };
            };
            if (FilterStr !== "") {
              if (Result !== "") Result = Result + "%20and%20";
              Result = Result + "(" + FilterStr + ")";
            };
          };
        };
      };
      return Result;
    };
    this.ProcessCondition = function (FieldName, FilterCondition) {
      var $Self = this;
      var Result = "";
      var Condition = null;
      function DateTimeStringToDateString(Value) {
        var Result = "";
        Result = "";
        if (typeof(Value) === "string") {
          Result = pas.SysUtils.TStringHelper.Replace.call({get: function () {
              return Value;
            }, set: function (v) {
              Value = v;
            }}," ","T") + "Z";
        };
        return Result;
      };
      Result = "";
      Condition = FilterCondition;
      if (typeof(Condition) === "object") {
        if ((Condition.filterType === "text") || (Condition.filterType === "object")) {
          if (Condition.type === "contains") {
            Result = Result + "contains(" + FieldName + ",%20'" + Condition.filter + "')";
          } else if (Condition.type === "notContains") {
            Result = Result + "(not%20contains(" + FieldName + ",%20'" + Condition.filter + "'))";
          } else if (Condition.type === "equals") {
            Result = Result + "(" + FieldName + "%20eq%20'" + Condition.filter + "')";
          } else if (Condition.type === "notEqual") {
            Result = Result + "(" + FieldName + "%20ne%20'" + Condition.filter + "')";
          } else if (Condition.type === "startsWith") {
            Result = Result + "startswith(" + FieldName + ",%20'" + Condition.filter + "')";
          } else if (Condition.type === "endsWith") {
            Result = Result + "endswith(" + FieldName + ",%20'" + Condition.filter + "')";
          } else if (Condition.type === "blank") {
            Result = Result + "(" + FieldName + "%20eq%20'')";
          } else if (Condition.type === "notBlank") {
            Result = Result + "(not%20(" + FieldName + "%20eq%20''))";
          } else if (Condition.type === "true") {
            Result = Result + "(" + FieldName + "%20eq%20true)";
          } else if (Condition.type === "false") {
            Result = Result + "(" + FieldName + "%20eq%20false)";
          } else {
            throw pas.SysUtils.Exception.$create("Create$1",["Condition type [" + Condition.type + "] is not supported for FilterType [" + Condition.filterType + "]!"]);
          };
        } else if (Condition.filterType === "number") {
          if (Condition.type === "equals") {
            Result = Result + "(" + FieldName + "%20eq%20'" + Condition.filter + "')";
          } else if (Condition.type === "notEqual") {
            Result = Result + "(" + FieldName + "%20ne%20'" + Condition.filter + "')";
          } else if (Condition.type === "lessThan") {
            Result = Result + "(" + FieldName + "%20lt%20'" + Condition.filter + "')";
          } else if (Condition.type === "lessThanOrEqual") {
            Result = Result + "(" + FieldName + "%20le%20'" + Condition.filter + "')";
          } else if (Condition.type === "greaterThan") {
            Result = Result + "(" + FieldName + "%20gt%20'" + Condition.filter + "')";
          } else if (Condition.type === "greaterThanOrEqual") {
            Result = Result + "(" + FieldName + "%20ge%20'" + Condition.filter + "')";
          } else if (Condition.type === "blank") {
            Result = Result + "(" + FieldName + "%20eq%20'')";
          } else if (Condition.type === "notBlank") {
            Result = Result + "(" + FieldName + "%20ne%20'')";
          } else {
            throw pas.SysUtils.Exception.$create("Create$1",["Condition type [" + Condition.type + "] is not supported for FilterType [" + Condition.filterType + "]!"]);
          };
        } else if ((Condition.filterType === "date") || (Condition.filterType === "dateString")) {
          if (Condition.type === "equals") {
            Result = Result + "(" + FieldName + "%20eq%20'" + DateTimeStringToDateString(Condition.dateFrom) + "')";
          } else if (Condition.type === "notEqual") {
            Result = Result + "(" + FieldName + "%20ne%20'" + DateTimeStringToDateString(Condition.dateFrom) + "')";
          } else if (Condition.type === "lessThan") {
            Result = Result + "(" + FieldName + "%20lt%20'" + DateTimeStringToDateString(Condition.dateFrom) + "')";
          } else if (Condition.type === "lessThanOrEqual") {
            Result = Result + "(" + FieldName + "%20le%20'" + DateTimeStringToDateString(Condition.dateFrom) + "')";
          } else if (Condition.type === "greaterThan") {
            Result = Result + "(" + FieldName + "%20gt%20'" + DateTimeStringToDateString(Condition.dateFrom) + "')";
          } else if (Condition.type === "greaterThanOrEqual") {
            Result = Result + "(" + FieldName + "%20ge%20'" + DateTimeStringToDateString(Condition.dateFrom) + "')";
          } else if (Condition.type === "inRange") {
            Result = Result + "(" + FieldName + "%20ge%20'" + DateTimeStringToDateString(Condition.dateFrom) + "' and " + FieldName + "%20le%20'" + DateTimeStringToDateString(Condition.dateTo) + "')";
          } else if (Condition.type === "blank") {
            Result = Result + "(" + FieldName + "%20eq%20'')";
          } else if (Condition.type === "notBlank") {
            Result = Result + "(" + FieldName + "%20ne%20'')";
          } else {
            throw pas.SysUtils.Exception.$create("Create$1",["Condition type [" + Condition.type + "] is not supported for FilterType [" + Condition.filterType + "]!"]);
          };
        } else if (Condition.filterType === "boolean") {
          if (Condition.type === "true") {
            Result = Result + "(" + FieldName + "%20eq%20'true')";
          } else if (Condition.type === "false") {
            Result = Result + "(" + FieldName + "%20eq%20'false')";
          } else {
            throw pas.SysUtils.Exception.$create("Create$1",["Condition type [" + Condition.type + "] is not supported for FilterType [" + Condition.filterType + "]!"]);
          };
        };
      };
      return Result;
    };
    this.BuildQueryString = function (Params, KeyMap) {
      var Result = "";
      var SortStr = "";
      var FilterStr = "";
      var SortColumnName = "";
      var I = 0;
      var Count = 0;
      var SortModel = null;
      Result = "";
      SortStr = "";
      if ((rtl.length(Params.sortModel) > 0) && Array.isArray(Params.sortModel)) {
        Count = rtl.length(Params.sortModel);
        for (var $l = 0, $end = Count - 1; $l <= $end; $l++) {
          I = $l;
          if (I > 0) SortStr = SortStr + ",";
          SortModel = Params.sortModel[I];
          SortColumnName = SortModel.colId;
          if ((typeof(KeyMap) === "object") && (KeyMap !== null)) {
            if (typeof(KeyMap[SortColumnName]) === "string") {
              SortColumnName = "" + KeyMap[SortColumnName];
            };
          };
          SortStr = SortStr + SortColumnName + "%20" + SortModel.sort;
        };
        if (SortStr !== "") SortStr = "$orderby=" + SortStr;
      };
      FilterStr = "";
      if ((Params.filterModel != null) && (typeof(Params.filterModel) === "object")) {
        FilterStr = this.ProcessFilter(Params.filterModel,KeyMap);
        if (FilterStr !== "") FilterStr = "$filter=" + FilterStr;
      };
      Result = Result + "$top=" + pas.SysUtils.IntToStr(Params.endRow - Params.startRow) + "&$skip=" + pas.SysUtils.IntToStr(Params.startRow) + "&$inlinecount=allpages";
      if (SortStr !== "") Result = Result + "&" + SortStr;
      if (FilterStr !== "") Result = Result + "&" + FilterStr;
      return Result;
    };
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TDGXDataHeaderCollectionItem",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FName = "";
      this.FValue = "";
    };
    this.GetDisplayName = function () {
      var Result = "";
      Result = "(Empty String)";
      if (this.FName.length > 0) {
        Result = this.FName;
      };
      return Result;
    };
    this.Assign = function (Source) {
      var SourceItem = null;
      SourceItem = rtl.as(Source,$mod.TDGXDataHeaderCollectionItem);
      if (SourceItem !== null) {
        this.FName = SourceItem.FName;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Name",0,rtl.string,"FName","FName");
    $r.addProperty("Value",0,rtl.string,"FValue","FValue");
  });
  rtl.createClass(this,"TDGXDataHeaderCollection",pas.Classes.TOwnedCollection,function () {
    this.$init = function () {
      pas.Classes.TOwnedCollection.$init.call(this);
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      pas.Classes.TOwnedCollection.$final.call(this);
    };
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      this.SetItem(Index,Value);
    };
    this.DoChange = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Update = function (Item) {
      pas.Classes.TCollection.Update.apply(this,arguments);
      if ((this.Owner() != null) && !(pas.Classes.TComponentStateItem.csLoading in this.Owner().FComponentState)) this.DoChange();
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,$mod.TDGXDataHeaderCollectionItem);
      return this;
    };
    this.Create$4 = function (AOwner, ItemClass) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,ItemClass);
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      return Result;
    };
  });
  rtl.createClass(this,"TDGXDataEntityKeysCollectionItem",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FName = "";
    };
    this.GetDisplayName = function () {
      var Result = "";
      Result = "(Key Field Name Required)";
      if (this.FName.length > 0) {
        Result = this.FName;
      };
      return Result;
    };
    this.Assign = function (Source) {
      var SourceItem = null;
      SourceItem = rtl.as(Source,$mod.TDGXDataHeaderCollectionItem);
      if (SourceItem !== null) {
        this.FName = SourceItem.FName;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Name",0,rtl.string,"FName","FName");
  });
  rtl.createClass(this,"TDGXDataEntityKeysCollection",pas.Classes.TOwnedCollection,function () {
    this.$init = function () {
      pas.Classes.TOwnedCollection.$init.call(this);
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      pas.Classes.TOwnedCollection.$final.call(this);
    };
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      this.SetItem(Index,Value);
    };
    this.DoChange = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Update = function (Item) {
      pas.Classes.TCollection.Update.apply(this,arguments);
      if ((this.Owner() != null) && !(pas.Classes.TComponentStateItem.csLoading in this.Owner().FComponentState)) this.DoChange();
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,$mod.TDGXDataEntityKeysCollectionItem);
      return this;
    };
    this.Create$4 = function (AOwner, ItemClass) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,ItemClass);
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      return Result;
    };
    this.FindKey = function (KeyName) {
      var Result = null;
      var I = 0;
      Result = null;
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (this.GetItem$1(I).FName === KeyName) {
          Result = this.GetItem$1(I);
          return Result;
        };
      };
      return Result;
    };
    this.FindOrCreateKey = function (KeyName) {
      var Result = null;
      Result = this.FindKey(KeyName);
      if (Result === null) {
        Result = this.Add$1();
        Result.FName = KeyName;
      };
      return Result;
    };
    this.FirstKeyName = function () {
      var Result = "";
      Result = "";
      if (this.GetCount() > 0) Result = this.GetItem$1(0).FName;
      return Result;
    };
  });
  rtl.createClass(this,"TDGXDataEntityPropertiesCollectionItem",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FName = "";
      this.FSize = 0;
      this.FRequired = false;
      this.FDataType = "";
      this.FIsReference = false;
      this.FDisplayName = "";
    };
    this.GetIsValidReference = function () {
      var Result = false;
      Result = false;
      if (this.FIsReference && (typeof(this.FDataType) === "string") && (pas.SysUtils.TStringHelper.GetLength.call({p: this, get: function () {
          return this.p.FDataType;
        }, set: function (v) {
          this.p.FDataType = v;
        }}) > 0)) Result = true;
      return Result;
    };
    this.GetDisplayName = function () {
      var Result = "";
      Result = "(Property Name Required)";
      if (this.FName.length > 0) {
        Result = this.FName;
      };
      return Result;
    };
    this.Assign = function (Source) {
      var SourceItem = null;
      SourceItem = rtl.as(Source,$mod.TDGXDataHeaderCollectionItem);
      if (SourceItem !== null) {
        this.FName = SourceItem.FName;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Name",0,rtl.string,"FName","FName");
    $r.addProperty("DisplayName",0,rtl.string,"FDisplayName","FDisplayName");
    $r.addProperty("Required",0,rtl.boolean,"FRequired","FRequired");
    $r.addProperty("Size",0,rtl.longint,"FSize","FSize");
    $r.addProperty("DataType",0,rtl.string,"FDataType","FDataType");
    $r.addProperty("IsReference",0,rtl.boolean,"FIsReference","FIsReference");
  });
  rtl.createClass(this,"TDGXDataEntityPropertiesCollection",pas.Classes.TOwnedCollection,function () {
    this.$init = function () {
      pas.Classes.TOwnedCollection.$init.call(this);
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      pas.Classes.TOwnedCollection.$final.call(this);
    };
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      this.SetItem(Index,Value);
    };
    this.DoChange = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Update = function (Item) {
      pas.Classes.TCollection.Update.apply(this,arguments);
      if ((this.Owner() != null) && !(pas.Classes.TComponentStateItem.csLoading in this.Owner().FComponentState)) this.DoChange();
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,$mod.TDGXDataEntityPropertiesCollectionItem);
      return this;
    };
    this.Create$4 = function (AOwner, ItemClass) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,ItemClass);
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      return Result;
    };
    this.FindProperty = function (PropertyName) {
      var Result = null;
      var I = 0;
      Result = null;
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (this.GetItem$1(I).FName === PropertyName) {
          Result = this.GetItem$1(I);
          return Result;
        };
      };
      return Result;
    };
    this.FindOrCreateProperty = function (PropertyName) {
      var Result = null;
      Result = this.FindProperty(PropertyName);
      if (Result === null) {
        Result = this.Add$1();
        Result.FName = PropertyName;
      };
      return Result;
    };
  });
  this.$rtti.$Class("TDGXDataEntityDefinitionCollection");
  rtl.createClass(this,"TDGXDataEntityDefinitionCollectionItem",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FEntityName = "";
      this.FDefaultProperty = "";
      this.FKeys = null;
      this.FOnGetDefaultDisplayText = null;
      this.FProperties = null;
      this.FOwnerCollection = null;
    };
    this.$final = function () {
      this.FKeys = undefined;
      this.FOnGetDefaultDisplayText = undefined;
      this.FProperties = undefined;
      this.FOwnerCollection = undefined;
      pas.Classes.TCollectionItem.$final.call(this);
    };
    this.SetKeys = function (Value) {
      this.FKeys.Assign(Value);
    };
    this.SetProperties = function (Value) {
      if (this.FProperties != null) this.FProperties.Assign(Value);
    };
    this.GetDisplayName = function () {
      var Result = "";
      Result = "(EntityName Required)";
      if (this.FEntityName.length > 0) {
        Result = this.FEntityName;
      };
      return Result;
    };
    this.FindReferenceItem = function (RefFieldName) {
      var Result = null;
      var PropertyItem = null;
      Result = null;
      if (this.FOwnerCollection !== null) {
        PropertyItem = this.FProperties.FindProperty(RefFieldName);
        if ((PropertyItem !== null) && PropertyItem.GetIsValidReference()) {
          Result = this.FOwnerCollection.FindEntity(PropertyItem.FDataType);
        };
      };
      return Result;
    };
    this.FindReferenceInfo = function (RefFieldName, DefaultProperty, FirstKey, OnGetDefaultDisplayText) {
      var RefEntityItem = null;
      DefaultProperty.set("");
      FirstKey.set("");
      OnGetDefaultDisplayText.set(null);
      RefEntityItem = this.FindReferenceItem(RefFieldName);
      if (RefEntityItem !== null) {
        DefaultProperty.set(RefEntityItem.FDefaultProperty);
        FirstKey.set(RefEntityItem.FKeys.FirstKeyName());
        OnGetDefaultDisplayText.set(RefEntityItem.FOnGetDefaultDisplayText);
        if (DefaultProperty.get() === "") DefaultProperty.set(FirstKey.get());
      };
    };
    this.Create$1 = function (Collection) {
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      this.FOwnerCollection = Collection;
      this.FKeys = $mod.TDGXDataEntityKeysCollection.$create("Create$3",[Collection.Owner()]);
      this.FProperties = $mod.TDGXDataEntityPropertiesCollection.$create("Create$3",[Collection.Owner()]);
      return this;
    };
    this.Destroy = function () {
      if (this.FKeys != null) pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FKeys;
        }, set: function (v) {
          this.p.FKeys = v;
        }});
      if (this.FProperties != null) pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FProperties;
        }, set: function (v) {
          this.p.FProperties = v;
        }});
      pas.Classes.TCollectionItem.Destroy.call(this);
    };
    this.Assign = function (Source) {
      var SourceItem = null;
      SourceItem = rtl.as(Source,$mod.TDGXDataEntityDefinitionCollectionItem);
      if (SourceItem !== null) {
        this.FEntityName = SourceItem.FEntityName;
        this.FDefaultProperty = SourceItem.FDefaultProperty;
        if (this.FKeys != null) this.FKeys.Assign(SourceItem.FKeys);
      };
    };
    var $r = this.$rtti;
    $r.addProperty("EntityName",0,rtl.string,"FEntityName","FEntityName");
    $r.addProperty("DefaultProperty",0,rtl.string,"FDefaultProperty","FDefaultProperty");
    $r.addProperty("Keys",2,$mod.$rtti["TDGXDataEntityKeysCollection"],"FKeys","SetKeys");
    $r.addProperty("Properties",2,$mod.$rtti["TDGXDataEntityPropertiesCollection"],"FProperties","SetProperties");
    $r.addProperty("OnGetDefaultDisplayText",0,$mod.$rtti["TDGOnGetDefaultDisplayTextEvent"],"FOnGetDefaultDisplayText","FOnGetDefaultDisplayText");
  });
  rtl.createClass(this,"TDGXDataEntityDefinitionCollection",pas.Classes.TOwnedCollection,function () {
    this.$init = function () {
      pas.Classes.TOwnedCollection.$init.call(this);
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      pas.Classes.TOwnedCollection.$final.call(this);
    };
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      this.SetItem(Index,Value);
    };
    this.DoChange = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Update = function (Item) {
      pas.Classes.TCollection.Update.apply(this,arguments);
      if ((this.Owner() != null) && !(pas.Classes.TComponentStateItem.csLoading in this.Owner().FComponentState)) this.DoChange();
    };
    this.BuildKeyMap = function (EntityName) {
      var Result = null;
      var EntityItem = null;
      var RefEntityItem = null;
      var PropertyItem = null;
      var I = 0;
      Result = new Object();
      EntityItem = this.FindEntity(EntityName);
      if (EntityItem !== null) {
        for (var $l = 0, $end = EntityItem.FProperties.GetCount() - 1; $l <= $end; $l++) {
          I = $l;
          PropertyItem = EntityItem.FProperties.GetItem$1(I);
          if (PropertyItem.FIsReference && (PropertyItem.FDataType !== "")) {
            RefEntityItem = this.FindEntity(PropertyItem.FDataType);
            if ((RefEntityItem !== null) && (RefEntityItem.FDefaultProperty !== "")) {
              Result[PropertyItem.FName] = PropertyItem.FName + "/" + RefEntityItem.FDefaultProperty;
            };
          };
        };
      };
      return Result;
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,$mod.TDGXDataEntityDefinitionCollectionItem);
      return this;
    };
    this.Create$4 = function (AOwner, ItemClass) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,ItemClass);
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      return Result;
    };
    this.FindEntity = function (EntityName) {
      var Result = null;
      var I = 0;
      Result = null;
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        if (this.GetItem$1(I).FEntityName === EntityName) {
          Result = this.GetItem$1(I);
          return Result;
        };
      };
      return Result;
    };
    this.FindOrCreateEntity = function (EntityName) {
      var Result = null;
      Result = this.FindEntity(EntityName);
      if (Result === null) {
        Result = this.Add$1();
        Result.FEntityName = EntityName;
      };
      return Result;
    };
    this.IsEntity = function (EntityName) {
      var Result = false;
      var EntityItem = null;
      EntityItem = this.FindEntity(EntityName);
      Result = EntityItem !== null;
      return Result;
    };
  });
  rtl.createClass(this,"TDGXDataDefaultPropertyMatchRule",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FMatchName = "";
    };
    this.GetDisplayName = function () {
      var Result = "";
      Result = "(Not Used)";
      if (this.FMatchName.length > 0) {
        Result = "Field name contains '" + this.FMatchName + "'";
      };
      return Result;
    };
    this.Assign = function (Source) {
      var SourceItem = null;
      SourceItem = rtl.as(Source,$mod.TDGXDataDefaultPropertyMatchRule);
      if (SourceItem !== null) {
        this.FMatchName = SourceItem.FMatchName;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("MatchName",0,rtl.string,"FMatchName","FMatchName");
  });
  rtl.createClass(this,"TDGXDataDefaultPropertyMatchRules",pas.Classes.TOwnedCollection,function () {
    this.$init = function () {
      pas.Classes.TOwnedCollection.$init.call(this);
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      pas.Classes.TOwnedCollection.$final.call(this);
    };
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      this.SetItem(Index,Value);
    };
    this.DoChange = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Update = function (Item) {
      pas.Classes.TCollection.Update.apply(this,arguments);
      if ((this.Owner() != null) && !(pas.Classes.TComponentStateItem.csLoading in this.Owner().FComponentState)) this.DoChange();
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,$mod.TDGXDataDefaultPropertyMatchRule);
      return this;
    };
    this.Create$4 = function (AOwner, ItemClass) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,ItemClass);
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      return Result;
    };
  });
  rtl.createClass(this,"TDGXDataEntities",pas["WEBLib.DataGrid.Options"].TDGPersistent,function () {
    this.$init = function () {
      pas["WEBLib.DataGrid.Options"].TDGPersistent.$init.call(this);
      this.FOwner = null;
      this.FEntityDefs = null;
      this.FDefaultPropertyMatchRules = null;
    };
    this.$final = function () {
      this.FOwner = undefined;
      this.FEntityDefs = undefined;
      this.FDefaultPropertyMatchRules = undefined;
      pas["WEBLib.DataGrid.Options"].TDGPersistent.$final.call(this);
    };
    this.SetDefaultPropertyMatchRules = function (Value) {
      if (this.FDefaultPropertyMatchRules != null) this.FDefaultPropertyMatchRules.Assign(Value);
    };
    this.SetEntityDefs = function (Value) {
      if (this.FEntityDefs != null) this.FEntityDefs.Assign(Value);
    };
    this.Create$1 = function (AOwner) {
      pas.System.TObject.Create.call(this);
      this.FOwner = AOwner;
      this.FEntityDefs = $mod.TDGXDataEntityDefinitionCollection.$create("Create$3",[AOwner]);
      this.FDefaultPropertyMatchRules = $mod.TDGXDataDefaultPropertyMatchRules.$create("Create$3",[AOwner]);
      return this;
    };
    this.Destroy = function () {
      if (this.FEntityDefs != null) pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FEntityDefs;
        }, set: function (v) {
          this.p.FEntityDefs = v;
        }});
      if (this.FDefaultPropertyMatchRules != null) pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FDefaultPropertyMatchRules;
        }, set: function (v) {
          this.p.FDefaultPropertyMatchRules = v;
        }});
      pas.System.TObject.Destroy.call(this);
    };
    this.GetOwner = function () {
      var Result = null;
      Result = this.FOwner;
      return Result;
    };
    var $r = this.$rtti;
    $r.addProperty("EntityDefs",2,$mod.$rtti["TDGXDataEntityDefinitionCollection"],"FEntityDefs","SetEntityDefs");
    $r.addProperty("DefaultPropertyMatchRules",2,$mod.$rtti["TDGXDataDefaultPropertyMatchRules"],"FDefaultPropertyMatchRules","SetDefaultPropertyMatchRules");
  });
  rtl.createClass(this,"TDGXDataRestDataAdapter",this.TDGXDataDataAdapterBase,function () {
    this.$init = function () {
      $mod.TDGXDataDataAdapterBase.$init.call(this);
      this.FURL = "";
      this.FKeyField = "";
      this.FEntityName = "";
      this.FUseSwaggerForSchema = false;
      this.FRequestHeaders = null;
      this.FExpandFields = "";
      this.FOnLoadSchemaColumn = null;
      this.FOnTransformGetRowData = null;
      this.FOnTransformInsert = null;
      this.FOnTransformUpdate = null;
      this.FOnTransformDelete = null;
      this.FEntities = null;
    };
    this.$final = function () {
      this.FRequestHeaders = undefined;
      this.FOnLoadSchemaColumn = undefined;
      this.FOnTransformGetRowData = undefined;
      this.FOnTransformInsert = undefined;
      this.FOnTransformUpdate = undefined;
      this.FOnTransformDelete = undefined;
      this.FEntities = undefined;
      $mod.TDGXDataDataAdapterBase.$final.call(this);
    };
    this.ConvertToCellDataType = function (LCFieldType) {
      var Result = 0;
      Result = pas["WEBLib.DataGrid.Common"].TDGCellDataType.cdtText;
      if (LCFieldType === "int32") {
        Result = pas["WEBLib.DataGrid.Common"].TDGCellDataType.cdtNumber;
      } else if (LCFieldType === "int64") {
        Result = pas["WEBLib.DataGrid.Common"].TDGCellDataType.cdtNumber;
      } else if (LCFieldType === "double") {
        Result = pas["WEBLib.DataGrid.Common"].TDGCellDataType.cdtNumber;
      } else if (LCFieldType === "datetime") {
        Result = pas["WEBLib.DataGrid.Common"].TDGCellDataType.cdtDateString;
      } else if (LCFieldType === "boolean") {
        Result = pas["WEBLib.DataGrid.Common"].TDGCellDataType.cdtBoolean;
      } else if (LCFieldType === "integer") {
        Result = pas["WEBLib.DataGrid.Common"].TDGCellDataType.cdtNumber;
      };
      return Result;
    };
    this.CheckRequiredProperties = function (IncludeKeyField) {
      if (this.FURL === "") throw pas.SysUtils.Exception.$create("Create$1",["Error: URL can not be blank!"]);
      if (this.FEntityName === "") throw pas.SysUtils.Exception.$create("Create$1",["Error: EntityName can not be blank!"]);
      if (IncludeKeyField && (this.FKeyField === "")) throw pas.SysUtils.Exception.$create("Create$1",["Error KeyField can not be blank!"]);
    };
    this.IsFieldRequired = function (FieldName, RequiredList) {
      var Result = false;
      var J = 0;
      Result = false;
      if (Array.isArray(RequiredList)) {
        for (var $l = 0, $end = RequiredList.length - 1; $l <= $end; $l++) {
          J = $l;
          if (FieldName === ("" + RequiredList[J])) {
            Result = true;
            break;
          };
        };
      };
      return Result;
    };
    this.IsFieldRequired$1 = function (RequiredValue) {
      var Result = false;
      Result = false;
      if (typeof(RequiredValue) === "boolean") Result = !(RequiredValue == false);
      return Result;
    };
    this.AddExpandField = function (FieldName) {
      if (this.FExpandFields !== "") this.FExpandFields = this.FExpandFields + ",";
      this.FExpandFields = this.FExpandFields + FieldName;
    };
    this.ClearExpandFields = function () {
      this.FExpandFields = "";
    };
    this.Load_ReferenceColumn = function (EntityItem, SourceGrid, Column, ColumnName, ColumnType) {
      var $Self = this;
      var RequestConfig = null;
      var OrderBy = "";
      var DefaultProperty = "";
      var FirstKey = "";
      var OnGetDefaultDisplayText = null;
      function Success(Response) {
        var JsonArray = null;
        var CurrentObjectKeys = [];
        var CurrentObject = null;
        var CurrentKey = "";
        var FieldName = "";
        var FieldText = "";
        var FieldValue = "";
        var RowIndex = 0;
        var ColumnIndex = 0;
        var AtIndex = 0;
        if (Response !== null) {
          JsonArray = Response["value"];
          if (Array.isArray(JsonArray)) {
            Column.FSelectOptions.Clear();
            for (var $l = 0, $end = JsonArray.length - 1; $l <= $end; $l++) {
              RowIndex = $l;
              CurrentObject = JsonArray[RowIndex];
              FieldText = "";
              FieldValue = "";
              if (typeof(CurrentObject) === "object") {
                CurrentObjectKeys = Object.keys(CurrentObject);
                for (var $l1 = 0, $end1 = rtl.length(CurrentObjectKeys) - 1; $l1 <= $end1; $l1++) {
                  ColumnIndex = $l1;
                  CurrentKey = CurrentObjectKeys[ColumnIndex];
                  AtIndex = pas.SysUtils.TStringHelper.IndexOf.call({get: function () {
                      return CurrentKey;
                    }, set: function (v) {
                      CurrentKey = v;
                    }},"@");
                  if (AtIndex < 0) {
                    FieldName = CurrentKey;
                  } else {
                    FieldName = pas.SysUtils.TStringHelper.Substring$1.call({get: function () {
                        return CurrentKey;
                      }, set: function (v) {
                        CurrentKey = v;
                      }},0,AtIndex);
                  };
                  if ((DefaultProperty !== "") && (FirstKey !== "")) {
                    if (CurrentKey === DefaultProperty) FieldText = "" + CurrentObject[FieldName];
                    if (CurrentKey === FirstKey) FieldValue = "" + CurrentObject[FieldName];
                  } else {
                    if (pas.SysUtils.TStringHelper.Contains.call({get: function () {
                        return CurrentKey;
                      }, set: function (v) {
                        CurrentKey = v;
                      }},"Name")) {
                      FieldText = "" + CurrentObject[FieldName]}
                     else if (pas.SysUtils.TStringHelper.Contains.call({get: function () {
                        return CurrentKey;
                      }, set: function (v) {
                        CurrentKey = v;
                      }},"ID")) FieldValue = "" + CurrentObject[FieldName];
                  };
                  if ((FieldValue !== "") && (FieldText !== "")) break;
                };
              };
              if ((FieldValue !== "") && (FieldText !== "")) {
                if (OnGetDefaultDisplayText != null) {
                  var $with = Column.FSelectOptions.Add$1();
                  $with.FText = OnGetDefaultDisplayText($Self,CurrentObject);
                  $with.FValue = FieldValue;
                } else {
                  var $with1 = Column.FSelectOptions.Add$1();
                  $with1.FText = FieldText;
                  $with1.FValue = FieldValue;
                };
              };
            };
            Column.FParent.ApplyChanges();
          };
        };
      };
      function Failed(Response) {
        window.console.log("*** Request Failed!");
      };
      if (Column !== null) {
        if ((typeof(ColumnType) === "string") && (pas.SysUtils.TStringHelper.GetLength.call({get: function () {
            return ColumnType;
          }, set: function (v) {
            ColumnType = v;
          }}) > 0)) {
          Column.SetField(ColumnName);
          Column.SetEditModeType(pas["WEBLib.DataGrid.Common"].TDGCellEditorType.cetCombobox);
          RequestConfig = new Object();
          OrderBy = "";
          EntityItem.FindReferenceInfo(ColumnName,{get: function () {
              return DefaultProperty;
            }, set: function (v) {
              DefaultProperty = v;
            }},{get: function () {
              return FirstKey;
            }, set: function (v) {
              FirstKey = v;
            }},{get: function () {
              return OnGetDefaultDisplayText;
            }, set: function (v) {
              OnGetDefaultDisplayText = v;
            }});
          if (DefaultProperty !== "") OrderBy = "?$orderby=" + DefaultProperty;
          this.Fetch(this.FURL + "/" + ColumnType + OrderBy,RequestConfig,Success,Failed);
        };
      };
    };
    this.SetEntityName = function (Value) {
      if (this.FEntityName !== Value) {
        this.FEntityName = Value;
        this.FExpandFields = "";
      };
    };
    this.InitColumnType = function (FromFieldType, Column) {
      if (typeof(FromFieldType) === "string") {
        FromFieldType = pas.SysUtils.TStringHelper.ToLower.call({get: function () {
            return FromFieldType;
          }, set: function (v) {
            FromFieldType = v;
          }});
        Column.SetCellDataType(this.ConvertToCellDataType(FromFieldType));
        if (FromFieldType === "stream") {
          Column.SetEditable(false);
          Column.FEditable_Set = true;
        } else if (FromFieldType === "datetime") {
          Column.SetViewModeType(pas["WEBLib.DataGrid.Common"].TDGCellRendererType.crtLocaleDateString);
        } else if ((pas.System.Copy(FromFieldType,1,3) === "int") || (FromFieldType === "double")) {
          Column.SetViewModeType(pas["WEBLib.DataGrid.Common"].TDGCellRendererType.crtLocaleNumber);
        };
      };
    };
    this.InitColumnHeader = function (EntityItem, Column) {
      var PropertyItem = null;
      if (EntityItem !== null) {
        PropertyItem = EntityItem.FProperties.FindProperty(Column.FField);
        if ((PropertyItem !== null) && pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(PropertyItem.FDisplayName) && (typeof(PropertyItem.FDisplayName) === "string") && (PropertyItem.FDisplayName !== "")) {
          Column.SetHeaderName(PropertyItem.FDisplayName);
        };
      };
    };
    this.LoadSchema_Swagger = async function (ColumnDefs, Callback, ErrorCallBack) {
      var $Self = this;
      var RequestUrl = "";
      var RequestConfig = null;
      var DotTIndex = 0;
      var Grid = null;
      var NewColumn = null;
      Grid = null;
      if ((typeof(ColumnDefs) === "object") && (typeof(ColumnDefs.Owner()) === "object")) {
        if (ColumnDefs.Owner().$class.ClassType().InheritsFrom(pas.Classes.TComponent)) Grid = ColumnDefs.Owner();
      };
      if (this.FOnBeforeLoadSchema != null) this.FOnBeforeLoadSchema(Grid);
      if ((this.FURL !== "") && (this.FEntityName !== "")) {
        RequestUrl = this.FURL + "/openapi/swagger.json";
        RequestConfig = new Object();
        RequestConfig["method"] = "get";
        RequestConfig["headers"] = pas.JS.New(["Content-type","application/json"]);
        this.InitRequestConfig(RequestConfig);
        this.Fetch(RequestUrl,RequestConfig,function (Response) {
          var FieldName = "";
          var FieldType = "";
          var XDataType = "";
          var RefStr = "";
          var EntityName = "";
          var FieldRequired = false;
          var KeyName = "";
          var Prefix = "";
          var CurrentDefinitionKey = "";
          var Properties = null;
          var Definitions = null;
          var Entity = null;
          var Entry = null;
          var Keys = null;
          var XRequired = null;
          var Ref = undefined;
          var I = 0;
          var J = 0;
          var M = 0;
          var DefinitionsKeys = [];
          var DefinitionPropertyKeys = [];
          var Matcher = null;
          var MatchingNames = null;
          var MatchingName = "";
          var LCEntryName = "";
          var EntityItem = null;
          var CurrentEntityItem = null;
          var KeyItem = null;
          var PropertyItem = null;
          var PropertyName = "";
          var EntityNamePrefix = "";
          var EntityDefinitionPrefix = "";
          if (pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(Response)) {
            if (pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(Response["swagger"]) && (Response["swagger"] == "2.0")) {
              MatchingNames = Array.of();
              if ($Self.FEntities.FDefaultPropertyMatchRules.GetCount() > 0) {
                for (var $l = 0, $end = $Self.FEntities.FDefaultPropertyMatchRules.GetCount() - 1; $l <= $end; $l++) {
                  M = $l;
                  if ($Self.FEntities.FDefaultPropertyMatchRules.GetItem$1(M).FMatchName !== "") {
                    MatchingNames.push($Self.FEntities.FDefaultPropertyMatchRules.GetItem$1(M).FMatchName);
                  };
                };
              } else {
                MatchingNames = Array.of("name","desc","id");
              };
              if (pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(Response["definitions"]) && (typeof(Response["definitions"]) === "object")) {
                Definitions = Response["definitions"];
                DefinitionsKeys = Object.keys(Definitions);
                EntityNamePrefix = "Entities.T";
                if (Array.isArray(DefinitionsKeys) && (rtl.length(DefinitionsKeys) > 0)) {
                  DotTIndex = pas.SysUtils.TStringHelper.IndexOf$1.call({a: 0, p: DefinitionsKeys, get: function () {
                      return this.p[this.a];
                    }, set: function (v) {
                      this.p[this.a] = v;
                    }},".T");
                  if (DotTIndex >= 0) {
                    EntityNamePrefix = pas.SysUtils.TStringHelper.Substring$1.call({a: 0, p: DefinitionsKeys, get: function () {
                        return this.p[this.a];
                      }, set: function (v) {
                        this.p[this.a] = v;
                      }},0,DotTIndex + 2);
                  };
                };
                EntityDefinitionPrefix = "#/definitions/" + EntityNamePrefix;
                CurrentEntityItem = null;
                for (var $l1 = 0, $end1 = rtl.length(DefinitionsKeys) - 1; $l1 <= $end1; $l1++) {
                  I = $l1;
                  CurrentDefinitionKey = DefinitionsKeys[I];
                  Entity = Definitions[CurrentDefinitionKey];
                  EntityName = pas.SysUtils.TStringHelper.Substring.call({get: function () {
                      return CurrentDefinitionKey;
                    }, set: function (v) {
                      CurrentDefinitionKey = v;
                    }},EntityNamePrefix.length);
                  EntityItem = $Self.FEntities.FEntityDefs.FindOrCreateEntity(EntityName);
                  if (EntityItem !== null) {
                    if (EntityName === $Self.FEntityName) CurrentEntityItem = EntityItem;
                    if (Array.isArray(Entity["x-keys"])) {
                      Keys = Entity["x-keys"];
                      for (var $l2 = 0, $end2 = Keys.length; $l2 <= $end2; $l2++) {
                        J = $l2;
                        if (typeof(Keys[J]) === "string") {
                          EntityItem.FKeys.FindOrCreateKey("" + Keys[J]);
                        };
                      };
                    };
                    if (typeof(Entity["properties"]) === "object") {
                      Properties = Entity["properties"];
                      DefinitionPropertyKeys = Object.keys(Properties);
                      if (EntityItem.FDefaultProperty === "") {
                        Matcher = new Object();
                        for (var $l3 = 0, $end3 = MatchingNames.length - 1; $l3 <= $end3; $l3++) {
                          M = $l3;
                          Matcher["" + MatchingNames[M]] = "";
                        };
                        for (var $l4 = 0, $end4 = rtl.length(DefinitionPropertyKeys) - 1; $l4 <= $end4; $l4++) {
                          J = $l4;
                          PropertyName = DefinitionPropertyKeys[J];
                          Entry = Properties[PropertyName];
                          if ((typeof(Entry) === "object") && (typeof(Entry["$ref"]) === "undefined")) {
                            LCEntryName = pas.SysUtils.TStringHelper.ToLower.call({get: function () {
                                return PropertyName;
                              }, set: function (v) {
                                PropertyName = v;
                              }});
                            for (var $l5 = 0, $end5 = MatchingNames.length - 1; $l5 <= $end5; $l5++) {
                              M = $l5;
                              MatchingName = "" + MatchingNames[M];
                              if (pas.SysUtils.TStringHelper.Contains.call({get: function () {
                                  return LCEntryName;
                                }, set: function (v) {
                                  LCEntryName = v;
                                }},MatchingName) && (Matcher[MatchingName] == "")) Matcher[MatchingName] = PropertyName;
                            };
                          };
                        };
                        for (var $l6 = 0, $end6 = MatchingNames.length - 1; $l6 <= $end6; $l6++) {
                          M = $l6;
                          MatchingName = "" + MatchingNames[M];
                          if (Matcher[MatchingName] != "") {
                            EntityItem.FDefaultProperty = "" + Matcher[MatchingName];
                            break;
                          };
                        };
                      };
                      for (var $l7 = 0, $end7 = rtl.length(DefinitionPropertyKeys) - 1; $l7 <= $end7; $l7++) {
                        J = $l7;
                        PropertyName = DefinitionPropertyKeys[J];
                        PropertyItem = EntityItem.FProperties.FindOrCreateProperty(PropertyName);
                        if ((PropertyItem !== null) && (typeof(Properties[PropertyName]) === "object")) {
                          Entry = Properties[PropertyName];
                          if (typeof(Entry["$ref"]) === "undefined") {
                            if (PropertyItem.FSize === 0) {
                              if (typeof(Entry["x-length"]) === "number") {
                                PropertyItem.FSize = rtl.trunc(Entry["x-length"])}
                               else PropertyItem.FSize = 0;
                            };
                            if (PropertyItem.FDataType === "") {
                              if (typeof(Entry["x-data-type"]) === "string") {
                                PropertyItem.FDataType = "" + Entry["x-data-type"]}
                               else PropertyItem.FDataType = "";
                            };
                            PropertyItem.FIsReference = false;
                          } else {
                            if (PropertyItem.FDataType === "") {
                              Ref = Entry["$ref"];
                              if ((typeof(Ref) === "string") && pas.SysUtils.TStringHelper.StartsWith.call({a: "" + Ref, get: function () {
                                  return this.a;
                                }, set: function (v) {
                                  rtl.raiseE("EPropReadOnly");
                                }},EntityDefinitionPrefix)) {
                                PropertyItem.FDataType = pas.SysUtils.TStringHelper.Substring.call({a: "" + Ref, get: function () {
                                    return this.a;
                                  }, set: function (v) {
                                    rtl.raiseE("EPropReadOnly");
                                  }},pas.SysUtils.TStringHelper.GetLength.call({get: function () {
                                    return EntityDefinitionPrefix;
                                  }, set: function (v) {
                                    EntityDefinitionPrefix = v;
                                  }}));
                              } else PropertyItem.FDataType = "";
                            };
                            PropertyItem.FIsReference = true;
                          };
                        };
                      };
                    };
                  };
                };
                EntityItem = CurrentEntityItem;
                EntityName = EntityNamePrefix + $Self.FEntityName;
                if ((EntityItem !== null) && (typeof(Definitions[EntityName]) === "object") && (typeof(Definitions[EntityName]["properties"]) === "object")) {
                  Entity = Definitions[EntityName];
                  Properties = Entity["properties"];
                  XRequired = Entity["x-required"];
                  KeyName = "";
                  if (Array.isArray(Entity["x-keys"])) {
                    Keys = Entity["x-keys"];
                    for (var $l8 = 0, $end8 = Keys.length; $l8 <= $end8; $l8++) {
                      I = $l8;
                      if (typeof(Keys[I]) === "string") {
                        KeyName = "" + Keys[I];
                        break;
                      };
                    };
                  };
                  if (KeyName !== "") {
                    if ($Self.FKeyField !== KeyName) $Self.FKeyField = KeyName;
                  };
                  Keys = Object.keys(Properties);
                  if (Keys.length > 0) {
                    if ((Grid != null) && Grid.$class.ClassType().InheritsFrom(pas["WEBLib.DataGrid"].TDataGridBase)) {
                      if (Grid.FAGGrid != null) {
                        Grid.FAGGrid.setRowCount(0);
                      };
                    };
                    try {
                      ColumnDefs.BeginChanges();
                      ColumnDefs.Clear();
                      $Self.ClearExpandFields();
                      for (var $l9 = 0, $end9 = Keys.length - 1; $l9 <= $end9; $l9++) {
                        I = $l9;
                        Entry = Properties["" + Keys[I]];
                        if ((typeof(Keys[I]) === "string") && (typeof(Entry) === "object")) {
                          FieldName = "" + Keys[I];
                          FieldType = "" + Entry["type"];
                          XDataType = "" + Entry["x-data-type"];
                          Ref = Entry["$ref"];
                          FieldRequired = $Self.IsFieldRequired(FieldName,XRequired);
                          if (typeof(Ref) === "undefined") {
                            NewColumn = ColumnDefs.Add$1();
                            NewColumn.SetField(FieldName);
                            if ((typeof(XDataType) === "string") && (pas.SysUtils.TStringHelper.GetLength.call({get: function () {
                                return XDataType;
                              }, set: function (v) {
                                XDataType = v;
                              }}) > 0)) {
                              $Self.InitColumnType(XDataType,NewColumn)}
                             else $Self.InitColumnType(FieldType,NewColumn);
                            $Self.InitColumnHeader(EntityItem,NewColumn);
                            if (FieldName === KeyName) {
                              NewColumn.SetEditable(false);
                              NewColumn.FEditable_Set = true;
                            };
                            if ($Self.FOnLoadSchemaColumn != null) {
                              $Self.FOnLoadSchemaColumn($Self,Grid,NewColumn,FieldName,FieldType,FieldRequired,false);
                            };
                          } else {
                            NewColumn = ColumnDefs.Add$1();
                            if (FieldName !== "") {
                              $Self.AddExpandField(FieldName);
                              if ((typeof(Ref) === "string") && (pas.SysUtils.TStringHelper.GetLength.call({a: "" + Ref, get: function () {
                                  return this.a;
                                }, set: function (v) {
                                  rtl.raiseE("EPropReadOnly");
                                }}) > 0)) {
                                RefStr = "" + Ref;
                                Prefix = "#/definitions/" + EntityNamePrefix;
                                if (pas.SysUtils.TStringHelper.StartsWith.call({get: function () {
                                    return RefStr;
                                  }, set: function (v) {
                                    RefStr = v;
                                  }},Prefix)) {
                                  FieldType = pas.SysUtils.TStringHelper.Substring.call({get: function () {
                                      return RefStr;
                                    }, set: function (v) {
                                      RefStr = v;
                                    }},pas.SysUtils.TStringHelper.GetLength.call({get: function () {
                                      return Prefix;
                                    }, set: function (v) {
                                      Prefix = v;
                                    }}));
                                };
                              };
                              $Self.Load_ReferenceColumn(EntityItem,Grid,NewColumn,FieldName,FieldType);
                              if ($Self.FOnLoadSchemaColumn != null) {
                                $Self.FOnLoadSchemaColumn($Self,Grid,NewColumn,FieldName,FieldType,FieldRequired,true);
                              };
                            };
                          };
                        };
                      };
                    } finally {
                      ColumnDefs.ApplyChanges();
                    };
                    if (Callback != null) Callback();
                    if ($Self.FOnAfterLoadSchema != null) $Self.FOnAfterLoadSchema(Grid,true);
                    return;
                  };
                };
              };
            };
          };
          if (ErrorCallBack != null) ErrorCallBack();
          if ($Self.FOnAfterLoadSchema != null) $Self.FOnAfterLoadSchema(Grid,false);
        },function (Response) {
          if (ErrorCallBack != null) ErrorCallBack();
          if ($Self.FOnAfterLoadSchema != null) $Self.FOnAfterLoadSchema(Grid,false);
        });
      } else {
        if (ErrorCallBack != null) ErrorCallBack();
        if (this.FOnAfterLoadSchema != null) this.FOnAfterLoadSchema(Grid,false);
      };
    };
    this.LoadSchema_Model = async function (ColumnDefs, Callback, ErrorCallBack) {
      var $Self = this;
      var RequestUrl = "";
      var RequestConfig = null;
      var Grid = null;
      var NewColumn = null;
      Grid = null;
      if ((typeof(ColumnDefs) === "object") && (typeof(ColumnDefs.Owner()) === "object")) {
        if (ColumnDefs.Owner().$class.ClassType().InheritsFrom(pas.Classes.TComponent)) Grid = ColumnDefs.Owner();
      };
      if (this.FOnBeforeLoadSchema != null) this.FOnBeforeLoadSchema(Grid);
      if ((this.FURL !== "") && (this.FEntityName !== "")) {
        RequestUrl = this.FURL + "/$model";
        RequestConfig = new Object();
        RequestConfig["method"] = "get";
        RequestConfig["headers"] = pas.JS.New(["Content-type","application/json"]);
        this.InitRequestConfig(RequestConfig);
        this.Fetch(RequestUrl,RequestConfig,function (Response) {
          var I = 0;
          var J = 0;
          var K = 0;
          var M = 0;
          var FieldName = "";
          var FieldType = "";
          var Matcher = null;
          var MatchingNames = null;
          var MatchingName = "";
          var FieldRequired = false;
          var KeyName = "";
          var EntryName = "";
          var LCEntryName = "";
          var CurrentEntityName = "";
          var Schema = null;
          var Entity = null;
          var Entry = null;
          var Schemas = null;
          var EntityTypes = null;
          var Keys = null;
          var Properties = null;
          var NavigationProperties = null;
          var EntityItem = null;
          var KeyItem = null;
          var PropertyItem = null;
          var SchemaIndex = 0;
          var EntityIndex = 0;
          EntityIndex = -1;
          SchemaIndex = -1;
          if (pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(Response)) {
            if (pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(Response["Version"]) && (Response["Version"] == "3")) {
              MatchingNames = Array.of();
              if ($Self.FEntities.FDefaultPropertyMatchRules.GetCount() > 0) {
                for (var $l = 0, $end = $Self.FEntities.FDefaultPropertyMatchRules.GetCount() - 1; $l <= $end; $l++) {
                  M = $l;
                  if ($Self.FEntities.FDefaultPropertyMatchRules.GetItem$1(M).FMatchName !== "") {
                    MatchingNames.push($Self.FEntities.FDefaultPropertyMatchRules.GetItem$1(M).FMatchName);
                  };
                };
              } else {
                MatchingNames = Array.of("name","desc","id");
              };
              if (pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(Response["Schemas"]) && Array.isArray(Response["Schemas"])) {
                Schemas = Response["Schemas"];
                for (var $l1 = 0, $end1 = Schemas.length - 1; $l1 <= $end1; $l1++) {
                  I = $l1;
                  Schema = Schemas[I];
                  if (pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(Schema["EntityTypes"]) && Array.isArray(Schema["EntityTypes"])) {
                    EntityTypes = Schema["EntityTypes"];
                    for (var $l2 = 0, $end2 = EntityTypes.length - 1; $l2 <= $end2; $l2++) {
                      J = $l2;
                      Entity = EntityTypes[J];
                      if (pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(Entity["Name"]) && pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(Entity["Properties"])) {
                        CurrentEntityName = "" + Entity["Name"];
                        if (CurrentEntityName === $Self.FEntityName) {
                          SchemaIndex = I;
                          EntityIndex = J;
                        };
                        EntityItem = $Self.FEntities.FEntityDefs.FindOrCreateEntity(CurrentEntityName);
                        if (EntityItem !== null) {
                          if (Array.isArray(Entity["Key"])) {
                            Keys = Entity["Key"];
                            for (var $l3 = 0, $end3 = Keys.length - 1; $l3 <= $end3; $l3++) {
                              K = $l3;
                              if (typeof(Keys[K]) === "string") {
                                KeyName = "" + Keys[K];
                                KeyItem = EntityItem.FKeys.FindOrCreateKey(KeyName);
                                typeof({get: function () {
                                    return KeyItem;
                                  }, set: function (v) {
                                    KeyItem = v;
                                  }});
                              };
                            };
                          };
                          if (Array.isArray(Entity["Properties"])) {
                            Properties = Entity["Properties"];
                            if (EntityItem.FDefaultProperty === "") {
                              Matcher = new Object();
                              for (var $l4 = 0, $end4 = MatchingNames.length - 1; $l4 <= $end4; $l4++) {
                                M = $l4;
                                Matcher["" + MatchingNames[M]] = "";
                              };
                              for (var $l5 = 0, $end5 = Properties.length - 1; $l5 <= $end5; $l5++) {
                                K = $l5;
                                Entry = Properties[K];
                                if ((Entry !== null) && (typeof(Entry) === "object") && (typeof(Entry["Name"]) === "string")) {
                                  EntryName = "" + Entry["Name"];
                                  LCEntryName = pas.SysUtils.TStringHelper.ToLower.call({get: function () {
                                      return EntryName;
                                    }, set: function (v) {
                                      EntryName = v;
                                    }});
                                  for (var $l6 = 0, $end6 = MatchingNames.length - 1; $l6 <= $end6; $l6++) {
                                    M = $l6;
                                    MatchingName = "" + MatchingNames[M];
                                    if (pas.SysUtils.TStringHelper.Contains.call({get: function () {
                                        return LCEntryName;
                                      }, set: function (v) {
                                        LCEntryName = v;
                                      }},MatchingName) && (Matcher[MatchingName] == "")) Matcher[MatchingName] = EntryName;
                                  };
                                };
                              };
                              for (var $l7 = 0, $end7 = MatchingNames.length - 1; $l7 <= $end7; $l7++) {
                                M = $l7;
                                MatchingName = "" + MatchingNames[M];
                                if (Matcher[MatchingName] != "") {
                                  EntityItem.FDefaultProperty = "" + Matcher[MatchingName];
                                  break;
                                };
                              };
                            };
                            for (var $l8 = 0, $end8 = Properties.length - 1; $l8 <= $end8; $l8++) {
                              K = $l8;
                              Entry = Properties[K];
                              if ((Entry !== null) && (typeof(Entry) === "object")) {
                                if (typeof(Entry["Name"]) === "string") {
                                  EntryName = "" + Entry["Name"];
                                  PropertyItem = EntityItem.FProperties.FindOrCreateProperty(EntryName);
                                  if (PropertyItem !== null) {
                                    if (PropertyItem.FRequired === false) {
                                      if ((typeof(Entry["Required"]) === "boolean") && (Entry["Required"] == true)) {
                                        PropertyItem.FRequired = true}
                                       else PropertyItem.FRequired = false;
                                    };
                                    if (PropertyItem.FSize === 0) {
                                      if (typeof(Entry["Length"]) === "number") {
                                        PropertyItem.FSize = rtl.trunc(Entry["Length"])}
                                       else PropertyItem.FSize = 0;
                                    };
                                    if (PropertyItem.FDataType === "") {
                                      if (typeof(Entry["Type"]) === "string") {
                                        PropertyItem.FDataType = "" + Entry["Type"]}
                                       else PropertyItem.FDataType = "";
                                    };
                                    PropertyItem.FIsReference = false;
                                  };
                                };
                              };
                            };
                          };
                          if (Array.isArray(Entity["NavigationProperties"])) {
                            NavigationProperties = Entity["NavigationProperties"];
                            for (var $l9 = 0, $end9 = NavigationProperties.length - 1; $l9 <= $end9; $l9++) {
                              K = $l9;
                              Entry = NavigationProperties[K];
                              if ((Entry !== null) && (typeof(Entry) === "object")) {
                                if (typeof(Entry["Name"]) === "string") {
                                  EntryName = "" + Entry["Name"];
                                  PropertyItem = EntityItem.FProperties.FindOrCreateProperty(EntryName);
                                  if (PropertyItem !== null) {
                                    if (PropertyItem.FDataType === "") {
                                      if (typeof(Entry["Target"]) === "string") {
                                        PropertyItem.FDataType = "" + Entry["Target"]}
                                       else PropertyItem.FDataType = "";
                                    };
                                    PropertyItem.FIsReference = true;
                                  };
                                };
                              };
                            };
                          };
                        };
                      };
                    };
                  };
                };
                if ((SchemaIndex >= 0) && (EntityIndex >= 0)) {
                  Schema = Schemas[SchemaIndex];
                  if (pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(Schema["EntityTypes"]) && Array.isArray(Schema["EntityTypes"])) {
                    EntityTypes = Schema["EntityTypes"];
                    Entity = EntityTypes[EntityIndex];
                    if (pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(Entity["Name"]) && pas["WEBLib.DataGrid.libjs"]._NotNullOrUndefined(Entity["Properties"])) {
                      CurrentEntityName = "" + Entity["Name"];
                      if (CurrentEntityName === $Self.FEntityName) {
                        if ((Grid != null) && Grid.$class.ClassType().InheritsFrom(pas["WEBLib.DataGrid"].TDataGridBase)) {
                          if (Grid.FAGGrid != null) {
                            Grid.FAGGrid.setRowCount(0);
                          };
                        };
                        try {
                          ColumnDefs.BeginChanges();
                          ColumnDefs.Clear();
                          $Self.ClearExpandFields();
                          Properties = Entity["Properties"];
                          NavigationProperties = Entity["NavigationProperties"];
                          EntityItem = $Self.FEntities.FEntityDefs.FindEntity($Self.FEntityName);
                          KeyName = "";
                          if (Array.isArray(Entity["Key"])) {
                            Keys = Entity["Key"];
                            for (var $l10 = 0, $end10 = Keys.length; $l10 <= $end10; $l10++) {
                              K = $l10;
                              if (typeof(Keys[K]) === "string") {
                                KeyName = "" + Keys[K];
                                break;
                              };
                            };
                          };
                          if (KeyName !== "") {
                            if ($Self.FKeyField !== KeyName) $Self.FKeyField = KeyName;
                          };
                          if (Array.isArray(Properties) && (Properties.length > 0)) {
                            for (var $l11 = 0, $end11 = Properties.length - 1; $l11 <= $end11; $l11++) {
                              K = $l11;
                              Entry = Properties[K];
                              if ((typeof(Entry) === "object") && (typeof(Entry["Name"]) === "string") && (typeof(Entry["Type"]) === "string")) {
                                FieldName = "" + Entry["Name"];
                                FieldType = "" + Entry["Type"];
                                FieldRequired = $Self.IsFieldRequired$1(Entry["Required"]);
                                NewColumn = ColumnDefs.Add$1();
                                NewColumn.SetField(FieldName);
                                $Self.InitColumnType(FieldType,NewColumn);
                                $Self.InitColumnHeader(EntityItem,NewColumn);
                                if (FieldName === KeyName) {
                                  NewColumn.SetEditable(false);
                                  NewColumn.FEditable_Set = true;
                                };
                                if ($Self.FOnLoadSchemaColumn != null) {
                                  $Self.FOnLoadSchemaColumn($Self,Grid,NewColumn,FieldName,FieldType,FieldRequired,false);
                                };
                              };
                            };
                          };
                          if (Array.isArray(NavigationProperties) && (NavigationProperties.length > 0)) {
                            if (EntityItem !== null) {
                              for (var $l12 = 0, $end12 = NavigationProperties.length - 1; $l12 <= $end12; $l12++) {
                                K = $l12;
                                Entry = NavigationProperties[K];
                                if ((typeof(Entry) === "object") && (typeof(Entry["Name"]) === "string") && (typeof(Entry["Target"]) === "string")) {
                                  FieldName = "" + Entry["Name"];
                                  FieldType = "" + Entry["Target"];
                                  FieldRequired = $Self.IsFieldRequired$1(Entry["Required"]);
                                  $Self.AddExpandField(FieldName);
                                  NewColumn = ColumnDefs.Add$1();
                                  NewColumn.SetField(FieldName);
                                  NewColumn.SetCellDataType(pas["WEBLib.DataGrid.Common"].TDGCellDataType.cdtText);
                                  NewColumn.SetEditModeType(pas["WEBLib.DataGrid.Common"].TDGCellEditorType.cetCombobox);
                                  $Self.InitColumnHeader(EntityItem,NewColumn);
                                  $Self.Load_ReferenceColumn(EntityItem,Grid,NewColumn,FieldName,FieldType);
                                  if ($Self.FOnLoadSchemaColumn != null) {
                                    $Self.FOnLoadSchemaColumn($Self,Grid,NewColumn,FieldName,FieldType,FieldRequired,true);
                                  };
                                };
                              };
                            };
                          };
                        } finally {
                          ColumnDefs.ApplyChanges();
                        };
                        if (Callback != null) Callback();
                        if ($Self.FOnAfterLoadSchema != null) $Self.FOnAfterLoadSchema(Grid,true);
                      };
                    };
                  };
                };
              };
            };
          };
          if (ErrorCallBack != null) ErrorCallBack();
          if ($Self.FOnAfterLoadSchema != null) $Self.FOnAfterLoadSchema(Grid,false);
        },function (Response) {
          if (ErrorCallBack != null) ErrorCallBack();
          if ($Self.FOnAfterLoadSchema != null) $Self.FOnAfterLoadSchema(Grid,false);
        });
      } else {
        if (ErrorCallBack != null) ErrorCallBack();
        if (this.FOnAfterLoadSchema != null) this.FOnAfterLoadSchema(Grid,false);
      };
    };
    this.InitRequestConfig = function (RequestConfig) {
      var Count = 0;
      var I = 0;
      var Name = "";
      var Value = "";
      var Headers = null;
      var RCHeaders = null;
      var Keys = [];
      var Key = "";
      var J = 0;
      if ((this.FRequestHeaders != null) && (RequestConfig != null)) {
        Count = this.FRequestHeaders.GetCount();
        if (Count > 0) {
          Headers = new Object();
          for (var $l = 0, $end = Count - 1; $l <= $end; $l++) {
            I = $l;
            Name = this.FRequestHeaders.GetItem$1(I).FName;
            Value = this.FRequestHeaders.GetItem$1(I).FValue;
            if ((Name !== "") && (Value !== "")) {
              Name = pas["WEBLib.RegularExpressions"].TRegEx.Replace$2(Name,"[^a-zA-Z0-9!#$%&'*+\\-.^_`|~]","");
              Headers[Name] = Value;
            };
          };
          if (typeof(RequestConfig["headers"]) === "object") {
            RCHeaders = RequestConfig["headers"];
            Keys = Object.keys(RCHeaders);
            for (var $l1 = 0, $end1 = rtl.length(Keys) - 1; $l1 <= $end1; $l1++) {
              J = $l1;
              Key = Keys[J];
              Headers[Key] = RCHeaders[Key];
            };
          };
          RequestConfig["headers"] = Headers;
        };
      };
    };
    this.UpdateRow = async function (DataGrid, RowData, Callback, ErrorCallBack) {
      var WebDataGrid = null;
      var Keys = [];
      var I = 0;
      var J = 0;
      var Index = 0;
      var Key = "";
      var Value = undefined;
      var EntityItem = null;
      var PropertyItem = null;
      var TargetColumn = null;
      var SelectionItem = null;
      if ((DataGrid != null) && DataGrid.$class.ClassType().InheritsFrom(pas["WEBLib.DataGrid"].TWebDataGrid)) {
        WebDataGrid = DataGrid;
        EntityItem = this.FEntities.FEntityDefs.FindEntity(this.FEntityName);
        if (EntityItem !== null) {
          Keys = Object.keys(RowData);
          for (var $l = 0, $end = rtl.length(Keys) - 1; $l <= $end; $l++) {
            I = $l;
            Key = Keys[I];
            Value = RowData[Key];
            PropertyItem = EntityItem.FProperties.FindProperty(Key);
            if ((PropertyItem !== null) && PropertyItem.GetIsValidReference()) {
              if ((Value == null) || (Value == "")) {
                RowData[Key] = null;
              } else {
                pas.JS.JSDelete(RowData,Key);
                Index = WebDataGrid.FColumnDefs.FindColumnIndex(Key);
                if (Index >= 0) {
                  TargetColumn = WebDataGrid.FColumnDefs.GetItem$1(Index);
                  if ((TargetColumn.FEditModeType === pas["WEBLib.DataGrid.Common"].TDGCellEditorType.cetCombobox) && (TargetColumn.FSelectOptions.GetCount() > 0)) {
                    for (var $l1 = 0, $end1 = TargetColumn.FSelectOptions.GetCount() - 1; $l1 <= $end1; $l1++) {
                      J = $l1;
                      SelectionItem = TargetColumn.FSelectOptions.GetItem$1(J);
                      if (SelectionItem.FText === ("" + Value)) {
                        RowData[Key + "@xdata.ref"] = PropertyItem.FDataType + "(" + SelectionItem.FValue + ")";
                        break;
                      };
                    };
                  };
                };
              };
            };
          };
        };
      };
      this.UpdateRow$1(RowData,Callback,ErrorCallBack);
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.DataGrid.DataAdapter.Base"].TDGServerDataAdapter.Create$1.apply(this,arguments);
      this.FRequestHeaders = $mod.TDGXDataHeaderCollection.$create("Create$3",[this]);
      this.FEntities = $mod.TDGXDataEntities.$create("Create$1",[this]);
      return this;
    };
    this.Destroy = function () {
      if (this.FRequestHeaders != null) pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FRequestHeaders;
        }, set: function (v) {
          this.p.FRequestHeaders = v;
        }});
      if (this.FEntities != null) pas.SysUtils.FreeAndNil({p: this, get: function () {
          return this.p.FEntities;
        }, set: function (v) {
          this.p.FEntities = v;
        }});
      pas["WEBLib.DataGrid.DataAdapter.Base"].TDGServerDataAdapter.Destroy.call(this);
    };
    this.HandleGetRows = function (Params) {
      this.HandleGetRowsAsync(Params);
    };
    this.HandleGetRowsAsync = async function (Params) {
      var $Self = this;
      var RequestUrl = "";
      var JsonArray = null;
      var ReturnArray = null;
      var CurrentObject = null;
      var ReturnObject = null;
      var Entry = null;
      var CurrentObjectKeys = [];
      var CurrentKey = "";
      var DefaultProperty = "";
      var KeyName = "";
      var AtIndex = 0;
      var RowCount = 0;
      var RequestConfig = null;
      var KeyMap = null;
      var EntityItem = null;
      var OnGetDefaultDisplayText = null;
      if ((this.FURL !== "") && (this.FEntityName !== "")) {
        EntityItem = this.FEntities.FEntityDefs.FindEntity(this.FEntityName);
        KeyMap = this.FEntities.FEntityDefs.BuildKeyMap(this.FEntityName);
        RequestUrl = this.FURL + "/" + this.FEntityName + "?" + this.$class.BuildQueryString(Params,KeyMap);
        if (this.FExpandFields !== "") RequestUrl = RequestUrl + "&$expand=" + this.FExpandFields;
        RequestConfig = new Object();
        this.InitRequestConfig(RequestConfig);
        this.Fetch(RequestUrl,RequestConfig,function (Response) {
          var I = 0;
          var J = 0;
          if (Response !== null) {
            if (typeof(Response["@xdata.count"]) !== "undefined") RowCount = rtl.trunc(Response["@xdata.count"]);
            JsonArray = Response["value"];
            if (Array.isArray(JsonArray)) {
              ReturnArray = Array.of();
              for (var $l = 0, $end = JsonArray.length; $l <= $end; $l++) {
                I = $l;
                CurrentObject = JsonArray[I];
                if (typeof(CurrentObject) === "object") {
                  if ($Self.FOnTransformGetRowData != null) $Self.FOnTransformGetRowData($Self,CurrentObject);
                  ReturnObject = pas.JS.New([]);
                  CurrentObjectKeys = Object.keys(CurrentObject);
                  for (var $l1 = 0, $end1 = rtl.length(CurrentObjectKeys) - 1; $l1 <= $end1; $l1++) {
                    J = $l1;
                    CurrentKey = CurrentObjectKeys[J];
                    AtIndex = pas.SysUtils.TStringHelper.IndexOf.call({get: function () {
                        return CurrentKey;
                      }, set: function (v) {
                        CurrentKey = v;
                      }},"@");
                    if (AtIndex < 0) {
                      ReturnObject[CurrentKey] = CurrentObject[CurrentKey];
                      if ((typeof(CurrentObject[CurrentKey]) === "object") && (CurrentObject[CurrentKey] != null)) {
                        Entry = CurrentObject[CurrentKey];
                        if (EntityItem !== null) {
                          EntityItem.FindReferenceInfo(CurrentKey,{get: function () {
                              return DefaultProperty;
                            }, set: function (v) {
                              DefaultProperty = v;
                            }},{get: function () {
                              return KeyName;
                            }, set: function (v) {
                              KeyName = v;
                            }},{get: function () {
                              return OnGetDefaultDisplayText;
                            }, set: function (v) {
                              OnGetDefaultDisplayText = v;
                            }});
                          if (OnGetDefaultDisplayText != null) {
                            ReturnObject[CurrentKey] = OnGetDefaultDisplayText($Self,Entry);
                          } else {
                            if ((DefaultProperty !== "") && (KeyName !== "")) {
                              if ((typeof(Entry[DefaultProperty]) !== "undefined") && (typeof(Entry[KeyName]) !== "undefined")) ReturnObject[CurrentKey] = "" + Entry[DefaultProperty];
                            };
                          };
                        };
                      };
                    };
                  };
                  ReturnArray.push(ReturnObject);
                };
              };
              Params.successCallback(ReturnArray,RowCount);
              $Self.TriggerRefreshCallback();
            };
          } else {
            JsonArray = Array.of();
            Params.successCallback(JsonArray,0);
          };
        },function (Response) {
          Params.failCallback();
        });
      };
    };
    this.UpdateRow$1 = async function (RowData, Callback, ErrorCallBack) {
      var RequestUrl = "";
      var RequestConfig = null;
      var RequestRowData = null;
      var Id = undefined;
      this.CheckRequiredProperties(true);
      if ((this.FURL !== "") && (this.FEntityName !== "") && (this.FKeyField !== "") && (typeof(RowData) === "object")) {
        RequestRowData = Object.assign(new Object(),RowData);
        if (this.FOnTransformUpdate != null) this.FOnTransformUpdate(this,RequestRowData);
        Id = RequestRowData[this.FKeyField];
        if (typeof(Id) === "number") {
          RequestUrl = this.FURL + "/" + this.FEntityName + "(" + ("" + Id) + ")";
          RequestConfig = new Object();
          RequestConfig["method"] = "PATCH";
          RequestConfig["headers"] = pas.JS.New(["accept","application/json","Content-type","application/json"]);
          RequestConfig["body"] = JSON.stringify(RequestRowData);
          this.InitRequestConfig(RequestConfig);
          this.Fetch(RequestUrl,RequestConfig,Callback,ErrorCallBack);
        };
      };
    };
    this.DeleteRow = async function (RowData, Callback, ErrorCallBack) {
      var RequestUrl = "";
      var RequestConfig = null;
      var RequestRowData = null;
      var Id = undefined;
      this.CheckRequiredProperties(true);
      if ((this.FURL !== "") && (this.FEntityName !== "") && (this.FKeyField !== "") && (typeof(RowData) === "object")) {
        RequestRowData = Object.assign(new Object(),RowData);
        if (this.FOnTransformDelete != null) this.FOnTransformDelete(this,RequestRowData);
        Id = RequestRowData[this.FKeyField];
        if (typeof(Id) === "number") {
          RequestUrl = this.FURL + "/" + this.FEntityName + "(" + ("" + Id) + ")";
          RequestConfig = new Object();
          RequestConfig["method"] = "delete";
          this.InitRequestConfig(RequestConfig);
          this.Fetch(RequestUrl,RequestConfig,Callback,ErrorCallBack);
        };
      };
    };
    this.InsertRow = async function (RowData, Callback, ErrorCallBack) {
      var RequestUrl = "";
      var RequestConfig = null;
      var RequestRowData = null;
      this.CheckRequiredProperties(true);
      if ((this.FURL !== "") && (this.FEntityName !== "") && (this.FKeyField !== "") && (typeof(RowData) === "object")) {
        RequestRowData = Object.assign(new Object(),RowData);
        if (this.FOnTransformInsert != null) this.FOnTransformInsert(this,RequestRowData);
        RequestUrl = this.FURL + "/" + this.FEntityName;
        RequestConfig = new Object();
        RequestConfig["method"] = "post";
        RequestConfig["headers"] = pas.JS.New(["Content-type","application/json"]);
        RequestConfig["body"] = JSON.stringify(RequestRowData);
        this.InitRequestConfig(RequestConfig);
        this.Fetch(RequestUrl,RequestConfig,Callback,ErrorCallBack);
      };
    };
    this.LoadSchema = async function (ColumnDefs, Callback, ErrorCallBack) {
      if (this.FUseSwaggerForSchema) {
        await this.LoadSchema_Swagger(ColumnDefs,Callback,ErrorCallBack)}
       else await this.LoadSchema_Model(ColumnDefs,Callback,ErrorCallBack);
    };
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("URL",0,rtl.string,"FURL","FURL");
    $r.addProperty("EntityName",2,rtl.string,"FEntityName","SetEntityName");
    $r.addProperty("KeyField",0,rtl.string,"FKeyField","FKeyField");
    $r.addProperty("UseSwaggerForSchema",0,rtl.boolean,"FUseSwaggerForSchema","FUseSwaggerForSchema");
    $r.addProperty("RequestHeaders",0,$mod.$rtti["TDGXDataHeaderCollection"],"FRequestHeaders","FRequestHeaders");
    $r.addProperty("OnBeforeLoadSchema",0,$mod.$rtti["TDGBeforeLoadSchemaEvent"],"FOnBeforeLoadSchema","FOnBeforeLoadSchema");
    $r.addProperty("OnAfterLoadSchema",0,$mod.$rtti["TDGAfterLoadSchemaEvent"],"FOnAfterLoadSchema","FOnAfterLoadSchema");
    $r.addProperty("OnLoadSchemaColumn",0,$mod.$rtti["TDGOnLoadSchemaColumnEvent"],"FOnLoadSchemaColumn","FOnLoadSchemaColumn");
    $r.addProperty("OnTransformGetRowData",0,$mod.$rtti["TDGOnTransformGetRowDataEvent"],"FOnTransformGetRowData","FOnTransformGetRowData");
    $r.addProperty("OnTransformInsert",0,$mod.$rtti["TDGOnTransformInsertEvent"],"FOnTransformInsert","FOnTransformInsert");
    $r.addProperty("OnTransformUpdate",0,$mod.$rtti["TDGOnTransformUpdateEvent"],"FOnTransformUpdate","FOnTransformUpdate");
    $r.addProperty("OnTransformDelete",0,$mod.$rtti["TDGOnTransformDeleteEvent"],"FOnTransformDelete","FOnTransformDelete");
    $r.addProperty("Entities",0,$mod.$rtti["TDGXDataEntities"],"FEntities","FEntities");
  });
},["WEBLib.DataGrid"]);
rtl.module("View.TasksDataGrid",["System","SysUtils","Classes","JS","Web","WEBLib.Forms","WEBLib.Dialogs","WEBLib.StdCtrls","XData.Web.Client","WEBLib.DataGrid","Utils","WEBLib.DataGrid.Common","WEBLib.StdCtrls","WEBLib.Controls","WEBLib.Grids","WEBLib.DataGrid.DataAdapter.Base","WEBLib.DataGrid.DataAdapter.XData","libdatagrid"],function () {
  "use strict";
  var $mod = this;
  rtl.createClass(this,"TFTasksDataGrid",pas["WEBLib.Forms"].TForm,function () {
    this.$init = function () {
      pas["WEBLib.Forms"].TForm.$init.call(this);
      this.xdwcTasks = null;
      this.dataGridTasks = null;
      this.btnReload = null;
      this.btnAddRow = null;
      this.FProjectId = "";
    };
    this.$final = function () {
      this.xdwcTasks = undefined;
      this.dataGridTasks = undefined;
      this.btnReload = undefined;
      this.btnAddRow = undefined;
      pas["WEBLib.Forms"].TForm.$final.call(this);
    };
    this.WebFormCreate = function (Sender) {
      this.xdwcTasks.SetConnection(pas.ConnectionModule.DMConnection.ApiConnection);
      this.FProjectId = "WPR0001";
      this.SetProjectTitle(this.FProjectId);
      this.LoadTasks(this.FProjectId);
    };
    this.btnReloadClick = function (Sender) {
      this.LoadTasks(this.FProjectId);
    };
    this.btnAddRowClick = function (Sender) {
      this.dataGridTasks.InsertNewRow();
      this.dataGridTasks.EnsureLastRowVisible();
    };
    this.SetProjectTitle = function (AProjectId) {
      document.getElementById("lbl_project_name").innerText = AProjectId;
    };
    this.LoadTasks = async function (AProjectId) {
      var response = null;
      var resultObj = null;
      var taskObj = null;
      var tasksArray = null;
      var itemsArray = null;
      var flatItems = null;
      var taskIndex = 0;
      var itemIndex = 0;
      response = await this.xdwcTasks.RawInvokeAsync("IApiService.GetProjectTasks",[AProjectId]);
      resultObj = response.FResult;
      tasksArray = resultObj["data"];
      flatItems = new Array();
      for (var $l = 0, $end = tasksArray.length - 1; $l <= $end; $l++) {
        taskIndex = $l;
        taskObj = tasksArray[taskIndex];
        itemsArray = taskObj["items"];
        for (var $l1 = 0, $end1 = itemsArray.length - 1; $l1 <= $end1; $l1++) {
          itemIndex = $l1;
          flatItems.push(itemsArray[itemIndex]);
        };
      };
      this.dataGridTasks.LoadFromJSON$1(flatItems,"");
    };
    this.LoadDFMValues = function () {
      pas["WEBLib.Forms"].TCustomForm.LoadDFMValues.call(this);
      this.dataGridTasks = pas["WEBLib.DataGrid"].TDataGrid.$create("Create$2",["data_grid_tasks"]);
      this.btnReload = pas["WEBLib.StdCtrls"].TButton.$create("Create$2",["btn_reload"]);
      this.btnAddRow = pas["WEBLib.StdCtrls"].TButton.$create("Create$2",["btn_add_row"]);
      this.xdwcTasks = pas["XData.Web.Client"].TXDataWebClient.$create("Create$1",[this]);
      this.dataGridTasks.BeforeLoadDFMValues();
      this.btnReload.BeforeLoadDFMValues();
      this.btnAddRow.BeforeLoadDFMValues();
      this.xdwcTasks.BeforeLoadDFMValues();
      try {
        this.SetName("FTasksDataGrid");
        this.SetWidth(1274);
        this.SetHeight(792);
        this.SetCSSLibrary(pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap);
        this.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
        this.SetEvent(this,"OnCreate","WebFormCreate");
        this.dataGridTasks.SetParentComponent(this);
        this.dataGridTasks.SetName("dataGridTasks");
        this.dataGridTasks.SetLeft(22);
        this.dataGridTasks.SetTop(96);
        this.dataGridTasks.SetWidth(1223);
        this.dataGridTasks.SetHeight(357);
        this.dataGridTasks.FBanding.SetEnabled(false);
        this.dataGridTasks.FBanding.SetOddRowsColor(16777215);
        this.dataGridTasks.FBanding.SetEvenRowsColor(16777215);
        this.dataGridTasks.SetMaxBlocksInCache(0);
        this.dataGridTasks.SetTabOrder(0);
        this.dataGridTasks.SetRowMultiSelectWithClick(false);
        this.dataGridTasks.SetEnableClickSelection(true);
        this.dataGridTasks.SetBidiMode$1(pas["WEBLib.Controls"].TBiDiMode.bdLeftToRight);
        this.dataGridTasks.SetSuppressMoveWhenColumnDragging(false);
        this.dataGridTasks.FColumnDefs.Clear();
        var $with = this.dataGridTasks.FColumnDefs.Add$1();
        $with.SetField("taskId");
        $with.SetCellDataType(pas["WEBLib.DataGrid.Common"].TDGCellDataType.cdtText);
        $with.SetHeaderName("Task");
        $with.SetEditable(true);
        $with.SetCheckboxSelection(false);
        $with.SetResizable(true);
        $with.SetWidth(95);
        $with.SetLockPinned(true);
        var $with1 = this.dataGridTasks.FColumnDefs.Add$1();
        $with1.SetField("application");
        $with1.SetCellDataType(pas["WEBLib.DataGrid.Common"].TDGCellDataType.cdtText);
        $with1.SetHeaderName("App");
        $with1.SetEditModeType(pas["WEBLib.DataGrid.Common"].TDGCellEditorType.cetCombobox);
        $with1.SetEditable(true);
        $with1.SetCheckboxSelection(false);
        $with1.SetLockPinned(true);
        $with1.FSelectOptions.Clear();
        var $with2 = $with1.FSelectOptions.Add$1();
        $with2.FValue = "null";
        var $with3 = $with1.FSelectOptions.Add$1();
        $with3.FText = "WebPoliceReport - Client";
        $with3.FValue = "WebPoliceReport - Client";
        var $with4 = $with1.FSelectOptions.Add$1();
        $with4.FText = "WebPoliceReport - Server";
        $with4.FValue = "WebPoliceReport - Server";
        var $with5 = this.dataGridTasks.FColumnDefs.Add$1();
        $with5.SetField("version");
        $with5.SetCellDataType(pas["WEBLib.DataGrid.Common"].TDGCellDataType.cdtText);
        $with5.SetHeaderName("Version");
        $with5.SetEditable(true);
        $with5.SetCheckboxSelection(false);
        $with5.SetWidth(95);
        $with5.SetLockPinned(true);
        var $with6 = this.dataGridTasks.FColumnDefs.Add$1();
        $with6.SetField("taskDate");
        $with6.SetCellDataType(pas["WEBLib.DataGrid.Common"].TDGCellDataType.cdtDateString);
        $with6.SetHeaderName("Date");
        $with6.SetEditModeType(pas["WEBLib.DataGrid.Common"].TDGCellEditorType.cetDate);
        $with6.SetEditable(true);
        $with6.SetCheckboxSelection(false);
        $with6.SetWidth(110);
        $with6.SetLockPinned(true);
        var $with7 = this.dataGridTasks.FColumnDefs.Add$1();
        $with7.SetField("reportedBy");
        $with7.SetCellDataType(pas["WEBLib.DataGrid.Common"].TDGCellDataType.cdtText);
        $with7.SetHeaderName("Reported By");
        $with7.SetEditModeType(pas["WEBLib.DataGrid.Common"].TDGCellEditorType.cetCombobox);
        $with7.SetEditable(true);
        $with7.SetCheckboxSelection(false);
        $with7.SetWidth(150);
        $with7.SetLockPinned(true);
        $with7.FSelectOptions.Clear();
        var $with8 = $with7.FSelectOptions.Add$1();
        $with8.FValue = "Null";
        var $with9 = $with7.FSelectOptions.Add$1();
        $with9.FText = "Elias";
        $with9.FValue = "Elias";
        var $with10 = $with7.FSelectOptions.Add$1();
        $with10.FText = "Mark";
        $with10.FValue = "Mark";
        var $with11 = $with7.FSelectOptions.Add$1();
        $with11.FText = "Mac";
        $with11.FValue = "Mac";
        var $with12 = this.dataGridTasks.FColumnDefs.Add$1();
        $with12.SetField("assignedTo");
        $with12.SetCellDataType(pas["WEBLib.DataGrid.Common"].TDGCellDataType.cdtText);
        $with12.SetHeaderName("Assigned To");
        $with12.SetEditModeType(pas["WEBLib.DataGrid.Common"].TDGCellEditorType.cetCombobox);
        $with12.SetEditable(true);
        $with12.SetCheckboxSelection(false);
        $with12.SetWidth(150);
        $with12.SetLockPinned(true);
        $with12.FSelectOptions.Clear();
        var $with13 = $with12.FSelectOptions.Add$1();
        $with13.FValue = "Null";
        var $with14 = $with12.FSelectOptions.Add$1();
        $with14.FText = "Elias";
        $with14.FValue = "Elias";
        var $with15 = $with12.FSelectOptions.Add$1();
        $with15.FText = "Mark";
        $with15.FValue = "Mark";
        var $with16 = $with12.FSelectOptions.Add$1();
        $with16.FText = "Mac";
        $with16.FValue = "Mac";
        var $with17 = this.dataGridTasks.FColumnDefs.Add$1();
        $with17.SetField("status");
        $with17.SetCellDataType(pas["WEBLib.DataGrid.Common"].TDGCellDataType.cdtText);
        $with17.SetHeaderName("Status");
        $with17.SetEditable(true);
        $with17.SetCheckboxSelection(false);
        $with17.SetWidth(95);
        $with17.SetLockPinned(true);
        $with17.FSelectOptions.Clear();
        var $with18 = $with17.FSelectOptions.Add$1();
        $with18.FValue = "Null";
        var $with19 = $with17.FSelectOptions.Add$1();
        $with19.FText = "Fixed";
        $with19.FValue = "Fixed";
        var $with20 = $with17.FSelectOptions.Add$1();
        $with20.FText = "Fixed - Verified";
        $with20.FValue = "Fixed - Verified";
        var $with21 = $with17.FSelectOptions.Add$1();
        $with21.FText = "Not Fixed";
        $with21.FValue = "Not Fixed";
        var $with22 = this.dataGridTasks.FColumnDefs.Add$1();
        $with22.SetField("statusDate");
        $with22.SetCellDataType(pas["WEBLib.DataGrid.Common"].TDGCellDataType.cdtDateString);
        $with22.SetHeaderName("Status Date");
        $with22.SetEditModeType(pas["WEBLib.DataGrid.Common"].TDGCellEditorType.cetDate);
        $with22.SetEditable(true);
        $with22.SetCheckboxSelection(false);
        $with22.SetWidth(110);
        $with22.SetLockPinned(true);
        var $with23 = this.dataGridTasks.FColumnDefs.Add$1();
        $with23.SetField("formSection");
        $with23.SetCellDataType(pas["WEBLib.DataGrid.Common"].TDGCellDataType.cdtText);
        $with23.SetHeaderName("Form/Section");
        $with23.SetEditable(true);
        $with23.SetCheckboxSelection(false);
        $with23.SetLockPinned(true);
        var $with24 = this.dataGridTasks.FColumnDefs.Add$1();
        $with24.SetField("issue");
        $with24.SetCellDataType(pas["WEBLib.DataGrid.Common"].TDGCellDataType.cdtText);
        $with24.SetHeaderName("Issue");
        $with24.SetEditModeType(pas["WEBLib.DataGrid.Common"].TDGCellEditorType.cetMemo);
        $with24.SetEditable(true);
        $with24.SetCheckboxSelection(false);
        $with24.SetWidth(300);
        $with24.SetWrapText(true);
        $with24.SetAutoHeight(true);
        $with24.SetLockPinned(true);
        var $with25 = this.dataGridTasks.FColumnDefs.Add$1();
        $with25.SetField("notes");
        $with25.SetCellDataType(pas["WEBLib.DataGrid.Common"].TDGCellDataType.cdtText);
        $with25.SetHeaderName("Notes");
        $with25.SetEditModeType(pas["WEBLib.DataGrid.Common"].TDGCellEditorType.cetMemo);
        $with25.SetEditable(true);
        $with25.SetCheckboxSelection(false);
        $with25.SetWidth(300);
        $with25.SetWrapText(true);
        $with25.SetAutoHeight(true);
        $with25.SetLockPinned(true);
        this.btnReload.SetParentComponent(this);
        this.btnReload.SetName("btnReload");
        this.btnReload.SetLeft(356);
        this.btnReload.SetTop(30);
        this.btnReload.SetWidth(96);
        this.btnReload.SetHeight(25);
        this.btnReload.SetCaption("Reload");
        this.btnReload.SetChildOrderEx(1);
        this.btnReload.SetHeightPercent(100.000000000000000000);
        this.btnReload.SetWidthPercent(100.000000000000000000);
        this.btnAddRow.SetParentComponent(this);
        this.btnAddRow.SetName("btnAddRow");
        this.btnAddRow.SetLeft(356);
        this.btnAddRow.SetTop(61);
        this.btnAddRow.SetWidth(96);
        this.btnAddRow.SetHeight(25);
        this.btnAddRow.SetCaption("Add Row");
        this.btnAddRow.SetChildOrderEx(1);
        this.btnAddRow.SetHeightPercent(100.000000000000000000);
        this.btnAddRow.SetWidthPercent(100.000000000000000000);
        this.xdwcTasks.SetParentComponent(this);
        this.xdwcTasks.SetName("xdwcTasks");
        this.xdwcTasks.SetConnection(pas.ConnectionModule.DMConnection.ApiConnection);
        this.xdwcTasks.SetLeft(150);
        this.xdwcTasks.SetTop(534);
      } finally {
        this.dataGridTasks.AfterLoadDFMValues();
        this.btnReload.AfterLoadDFMValues();
        this.btnAddRow.AfterLoadDFMValues();
        this.xdwcTasks.AfterLoadDFMValues();
      };
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addField("xdwcTasks",pas["XData.Web.Client"].$rtti["TXDataWebClient"],4);
    $r.addField("dataGridTasks",pas["WEBLib.DataGrid"].$rtti["TDataGrid"],4);
    $r.addField("btnReload",pas["WEBLib.StdCtrls"].$rtti["TButton"],4);
    $r.addField("btnAddRow",pas["WEBLib.StdCtrls"].$rtti["TButton"],4);
    $r.addMethod("WebFormCreate",0,[["Sender",pas.System.$rtti["TObject"]]],4);
    $r.addMethod("btnReloadClick",0,[["Sender",pas.System.$rtti["TObject"]]],4);
    $r.addMethod("btnAddRowClick",0,[["Sender",pas.System.$rtti["TObject"]]],4);
  });
  this.FTasksDataGrid = null;
},["ConnectionModule"]);
rtl.module("WEBLib.EditAutocomplete",["System","Classes","SysUtils","Types","WEBLib.Controls","WEBLib.StdCtrls","WEBLib.Graphics","Web","JS"],function () {
  "use strict";
  var $mod = this;
  this.TEditAutoCompleteLookupType = {"0": "ltFirstCharacter", ltFirstCharacter: 0, "1": "ltAnywhere", ltAnywhere: 1};
  this.$rtti.$Enum("TEditAutoCompleteLookupType",{minvalue: 0, maxvalue: 1, ordtype: 1, enumtype: this.TEditAutoCompleteLookupType});
  rtl.createClass(this,"TEditAutoCompleteRenderItemEventArgs",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FItemElement = null;
      this.FItemIndex = 0;
    };
    this.$final = function () {
      this.FItemElement = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
  });
  this.$rtti.$MethodVar("TEditAutoCompleteRenderItemEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Args",this.$rtti["TEditAutoCompleteRenderItemEventArgs"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TEditAutoCompleteLookupUpdateEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Items",pas.JS.$rtti["TJSArray"]],["Lookup",rtl.string]]), methodkind: 0});
  rtl.createClass(this,"TEditAutoCompleteSelectEventArgs",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FItemIndex = 0;
    };
  });
  this.$rtti.$MethodVar("TEditAutoCompleteSelectEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Args",this.$rtti["TEditAutoCompleteSelectEventArgs"]]]), methodkind: 0});
  rtl.createClass(this,"TEditAutoComplete",pas["WEBLib.StdCtrls"].TCustomInput,function () {
    this.$init = function () {
      pas["WEBLib.StdCtrls"].TCustomInput.$init.call(this);
      this.FText = "";
      this.FItemIndex = 0;
      this.FItems = null;
      this.FPopupHeight = 0;
      this.FActiveItemClassName = "";
      this.FPopupClassName = "";
      this.FItemClassName = "";
      this.FOnRenderItem = null;
      this.FOnSelect = null;
      this.FTextHint = "";
      this.FReadOnly = false;
      this.FCharCase = 0;
      this.FOnChange = null;
      this.FLookupCaseSensitive = false;
      this.FlookupMinLength = 0;
      this.FLookupType = 0;
      this.FInputElement = null;
      this.FAutoSelect = false;
      this.FOnLookupUpdate = null;
    };
    this.$final = function () {
      this.FItems = undefined;
      this.FOnRenderItem = undefined;
      this.FOnSelect = undefined;
      this.FOnChange = undefined;
      this.FInputElement = undefined;
      this.FOnLookupUpdate = undefined;
      pas["WEBLib.StdCtrls"].TCustomInput.$final.call(this);
    };
    this.AddScript = function (Script) {
      var scrObj = document.createElement('script');
      scrObj.innerHTML = Script;
      document.head.appendChild(scrObj);
    };
    this.GetText = function () {
      var Result = "";
      var input = null;
      Result = this.FText;
      if (!(this.GetElementHandle() != null)) return Result;
      input = this.GetElementHandle().childNodes.item(0);
      if (input != null) Result = input.value;
      return Result;
    };
    this.SetText = function (Value) {
      if (this.FText !== Value) {
        this.FText = Value;
        this.UpdateElement();
      };
    };
    this.SetItems = function (Value) {
      this.FItems.Assign(Value);
    };
    this.GetItemIndex = function () {
      var Result = 0;
      Result = this.FItemIndex;
      if (!(this.GetElementHandle() != null)) return Result;
      Result = this.FItems.IndexOf(this.GetText());
      return Result;
    };
    this.SetItemIndex = function (Value) {
      if ((this.FItemIndex !== Value) && (Value < this.FItems.GetCount())) {
        this.FItemIndex = Value;
        if (this.FItemIndex >= 0) {
          this.SetText(this.FItems.Get(this.FItemIndex))}
         else this.SetText("");
        this.UpdateElement();
      };
      if (Value === -100) {
        this.HandleRenderItem(null,-100);
        this.HandleSelect(-100);
      };
    };
    this.SetPopupHeight = function (Value) {
      if (this.FPopupHeight !== Value) {
        this.FPopupHeight = Value;
        this.UpdateElement();
      };
    };
    this.SetActiveItemClassName = function (Value) {
      if (this.FActiveItemClassName !== Value) {
        this.FActiveItemClassName = Value;
        this.UpdateElement();
      };
    };
    this.SetItemClassName = function (Value) {
      if (this.FItemClassName !== Value) {
        this.FItemClassName = Value;
        this.UpdateElement();
      };
    };
    this.SetPopupClassName = function (Value) {
      if (this.FPopupClassName !== Value) {
        this.FPopupClassName = Value;
        this.UpdateElement();
      };
    };
    this.SetTextHint = function (Value) {
      if (this.FTextHint !== Value) {
        this.FTextHint = Value;
        this.UpdateElement();
      };
    };
    this.SetReadOnly = function (Value) {
      if (this.FReadOnly !== Value) {
        this.FReadOnly = Value;
        this.UpdateElement();
      };
    };
    this.SetCharcase = function (Value) {
      if (this.FCharCase !== Value) {
        this.FCharCase = Value;
        this.UpdateElement();
      };
    };
    this.GetElementInputHandle = function () {
      var Result = null;
      Result = this.GetElementHandle().childNodes.item(0);
      return Result;
    };
    this.SetLookupCaseSensitive = function (Value) {
      if (this.FLookupCaseSensitive !== Value) {
        this.FLookupCaseSensitive = Value;
        this.UpdateElement();
      };
    };
    this.SetLookupMinLength = function (Value) {
      if ((this.FlookupMinLength !== Value) && (Value > 0)) {
        this.FlookupMinLength = Value;
        this.UpdateElement();
      };
    };
    this.SetLookupType = function (Value) {
      if (this.FLookupType !== Value) {
        this.FLookupType = Value;
        this.UpdateElement();
      };
    };
    this.CreateElement = function () {
      var Result = null;
      Result = document.createElement("DIV");
      return Result;
    };
    this.UpdateElement = function () {
      var elid = "";
      var sstyle = "";
      var classpopup = "";
      var classitem = "";
      var classactive = "";
      var newel = null;
      var itemdata = null;
      var I = 0;
      var spopup = "";
      var tabindex = "";
      var cl = null;
      pas["WEBLib.Controls"].TControl.UpdateElement.call(this);
      if (this.IsUpdating()) return;
      if (!(this.GetElementHandle() != null)) return;
      elid = this.GetID() + "_input";
      if (this.FPopupClassName === "") {
        classpopup = this.GetID() + "_autocomplete-items"}
       else classpopup = this.FPopupClassName;
      if (this.FItemClassName === "") {
        classitem = this.GetID() + "_autocomplete-item"}
       else classitem = this.FItemClassName;
      if (this.FActiveItemClassName === "") {
        classactive = this.GetID() + "_active-item"}
       else classactive = this.FActiveItemClassName;
      this.GetElementHandle().style.setProperty("overflow","visible");
      this.GetElementHandle().setAttribute("tabindex","-1");
      this.GetElementHandle().removeAttribute("class");
      while (this.GetElementHandle().hasChildNodes()) this.GetElementHandle().removeChild(this.GetElementHandle().firstChild);
      newel = document.createElement("input");
      this.FInputElement = newel;
      if (this.FElementClassName !== "") newel.setAttribute("class",this.FElementClassName);
      newel.setAttribute("type","text");
      newel.setAttribute("id",elid);
      newel.setAttribute("autocomplete","off");
      newel.style.setProperty("width","100%");
      newel.style.setProperty("height","100%");
      if (this.FEnabled) {
        newel.removeAttribute("disabled")}
       else newel.setAttribute("disabled","true");
      if (this.FReadOnly) {
        newel.setAttribute("readonly","true")}
       else newel.removeAttribute("readonly");
      if (this.FTabStop) {
        tabindex = pas.SysUtils.IntToStr(this.FTabOrder)}
       else tabindex = "-1";
      newel.setAttribute("tabindex",tabindex);
      newel.setAttribute("placeholder",this.FTextHint);
      newel.style.setProperty("background-color",pas["WEBLib.Graphics"].ColorToHTML(this.FColor));
      if (this.FElementClassName === "") {
        if (this.FEnabled && (this.FElementFont === pas["WEBLib.Controls"].TElementFont.efProperty)) newel.style.setProperty("color",pas["WEBLib.Graphics"].ColorToHTML(this.FFont.FColor));
      };
      pas["WEBLib.Controls"].SetHTMLElementFont(newel,this.FFont,!((this.FElementClassName === "") && (this.FElementFont === pas["WEBLib.Controls"].TElementFont.efProperty)));
      var $tmp = this.FCharCase;
      if ($tmp === pas["WEBLib.StdCtrls"].TEditCharCase.wecUpperCase) {
        newel.style.setProperty("text-transform","uppercase")}
       else if ($tmp === pas["WEBLib.StdCtrls"].TEditCharCase.wecLowerCase) {
        newel.style.setProperty("text-transform","lowercase")}
       else if ($tmp === pas["WEBLib.StdCtrls"].TEditCharCase.wecMixedCase) {
        newel.style.setProperty("text-transform","capitalize")}
       else if ($tmp === pas["WEBLib.StdCtrls"].TEditCharCase.wecNormal) newel.style.setProperty("text-transform","initial");
      newel.style.setProperty("box-sizing","border-box");
      newel.setAttribute("value",this.GetText());
      this.GetElementHandle().appendChild(newel);
      newel = document.createElement("input");
      newel.setAttribute("type","hidden");
      newel.setAttribute("id",elid + "index");
      this.GetElementHandle().appendChild(newel);
      this.BindEvents();
      if (this.FPopupHeight > 0) {
        spopup = "  max-height: " + pas.SysUtils.IntToStr(this.FPopupHeight) + "px;" + "\r" + "  overflow: auto;" + "\r";
      };
      sstyle = "#" + this.GetID() + " input[type=text] {" + "\r" + "  width: 100%;" + "\r" + "}" + "\r" + "." + classpopup + " {" + "\r" + "  position: absolute;" + "\r" + "  z-index: 99;" + "\r" + "  top: 100%;" + "\r" + "  min-width: 100%;" + "\r" + "  left: 0;" + "\r" + spopup;
      if (this.FPopupClassName === "") {
        sstyle = sstyle + "  background-color: #fff;" + "\r" + "  border: 1px solid #d4d4d4;";
      };
      sstyle = sstyle + "}" + "\r";
      if (this.FItemClassName === "") {
        sstyle = sstyle + "." + classitem + " {" + "\r" + "  padding: 10px;" + "\r" + "  cursor: pointer;" + "\r" + "  border-bottom: 1px solid #d4d4d4;" + "\r" + "}" + "\r" + "." + classitem + ":hover {" + "\r" + "  background-color: #e9e9e9 !important;" + "\r" + "}" + "\r";
      };
      if (this.FActiveItemClassName === "") {
        sstyle = sstyle + "." + classactive + " {" + "\r" + "  background-color: #e9e9e9 !important;" + "\r" + "  color: #000;" + "\r" + "}";
      };
      this.AddInstanceStyle(sstyle);
      this.AddScript("function doautocomplete(obj, inp, hinp, arr, myclass) {" + "\r" + "  var currentFocus;" + "\r" + '  inp.addEventListener("input", function(e) {' + "\r" + "      var a, b, i, h, lookup, minlength, cs, found, val = this.value;" + "\r" + "      lookup = " + pas.SysUtils.IntToStr(this.FLookupType) + ";" + "\r" + "      minlength = " + pas.SysUtils.IntToStr(this.FlookupMinLength) + ";" + "\r" + "      cs = " + pas.SysUtils.BoolToStr(this.FLookupCaseSensitive,false) + ";" + "\r" + "      " + elid + "closeAllLists();" + "\r" + "      if (!val) { return false;}" + "\r" + "      if (val.length < minlength) { return false;}" + "\r" + "      currentFocus = -1;" + "\r" + '      a = document.createElement("DIV");' + "\r" + '      a.setAttribute("id", this.id + "autocomplete-list");' + "\r" + '      a.setAttribute("class", "' + classpopup + '");' + "\r" + '      a.addEventListener("mousedown", function (e) {' + "\r" + "           e.preventDefault();" + "\r" + "      });" + "\r" + "      this.parentNode.appendChild(a);" + "\r" + "      obj.GetValuesUpdate(arr, val);" + "\r" + "      for (i = 0; i < arr.length; i++) {" + "\r" + "        var q = val;" + "\r" + "        var l = arr[i];" + "\r" + "        var s = l;" + "\r" + "        if (!cs) {" + "\r" + "          q = q.toUpperCase();" + "\r" + "          l = l.toUpperCase();" + "\r" + "        }" + "\r" + "        found = false;" + "\r" + "        if ((lookup == 0) && (l.substr(0, q.length) == q)) {" + "\r" + "          found = true;" + "\r" + '          s = "<strong>" + arr[i].substr(0, val.length) + "</strong>";' + "\r" + "          s += arr[i].substr(val.length);" + "\r" + "        }" + "\r" + "        else if ((lookup == 1) && (l.indexOf(q) >= 0)) {" + "\r" + "          found = true;" + "\r" + "          s = arr[i].substr(0, l.indexOf(q));" + "\r" + '          s += "<strong>" + arr[i].substr(l.indexOf(q), val.length) + "</strong>";' + "\r" + "          s += arr[i].substr(l.indexOf(q) + val.length);" + "\r" + "        }" + "\r" + "        if (found) {" + "\r" + '          b = document.createElement("DIV");' + "\r" + '          b.setAttribute("id", this.id + "|" + i);' + "\r" + '          b.setAttribute("class", "' + classitem + '");' + "\r" + "          b.innerHTML = s;" + "\r" + "          b = myclass.HandleRenderItem(b, i);" + '          b.addEventListener("click", function(e) {' + "\r" + '              var selindex = this.id.substring(this.id.indexOf("|") + 1, this.id.length);' + "\r" + "              inp.value = arr[selindex]" + "\r" + "              inp.focus();" + "\r" + "              hinp.value = selindex;" + "\r" + "              myclass.HandleSelect(selindex);" + "              " + elid + "closeAllLists();" + "\r" + "          });" + "\r" + "          a.appendChild(b);" + "\r" + "        }" + "\r" + "      }" + "\r" + "      if (a.childNodes.length <= 0) " + elid + "closeAllLists();" + "  });" + "\r" + '  inp.addEventListener("blur", function(e) {' + "\r" + "       " + elid + "closeAllLists(e.target, true);" + "\r" + "  });" + "\r" + '  inp.addEventListener("keydown", function(e) {' + "\r" + '      var popup = document.getElementById(this.id + "autocomplete-list");' + "\r" + "      var x;" + "\r" + '      if (popup) x = popup.getElementsByTagName("div");' + "\r" + "      if (x) {" + "\r" + "        if (e.keyCode == 27) {" + "\r" + "         " + elid + "closeAllLists(e.target, true);" + "\r" + "        } else if (e.keyCode == 40) {" + "\r" + "          currentFocus++;" + "\r" + "          " + elid + "addActive(x);" + "\r" + "          if ((x[currentFocus].offsetTop + x[currentFocus].offsetHeight) > (popup.offsetHeight + popup.scrollTop))" + "            popup.scrollTop = ((x[currentFocus].offsetTop + x[currentFocus].offsetHeight) - popup.offsetHeight);" + "\r" + "        } else if (e.keyCode == 38) { " + "\r" + "          currentFocus--;" + "\r" + "          " + elid + "addActive(x);" + "\r" + "          if ((x[currentFocus].offsetTop) < (popup.scrollTop))" + "            popup.scrollTop = (x[currentFocus].offsetTop);" + "\r" + "        } else if (e.keyCode == 13) {" + "\r" + "          e.preventDefault();" + "\r" + "          if (currentFocus > -1) {" + "\r" + "            if (x) x[currentFocus].click();" + "\r" + "          } else { " + elid + "closeAllLists(e.target,true);}" + "\r" + "        }" + "\r" + "      }" + "\r" + "  });" + "\r" + "  function " + elid + "addActive(x) {" + "\r" + "    if (!x) return false;" + "\r" + "    " + elid + "removeActive(x);" + "\r" + "    if (currentFocus >= x.length) currentFocus = x.length - 1;" + "\r" + "    if (currentFocus < 0) currentFocus = 0;" + "\r" + '    x[currentFocus].classList.add("' + classactive + '");' + "\r" + "  }" + "\r" + "  function " + elid + "removeActive(x) {" + "\r" + "    for (var i = 0; i < x.length; i++) {" + "\r" + '      x[i].classList.remove("' + classactive + '");' + "\r" + "    }" + "\r" + "  }" + "\r" + "  function " + elid + "closeAllLists(elmnt, doblur) {" + "\r" + '    var x = document.getElementsByClassName("' + classpopup + '");' + "\r" + "    var isinput = (elmnt != inp);" + "\r" + "    if (doblur) isinput = (elmnt == inp);" + "\r" + "    for (var i = 0; i < x.length; i++) {" + "\r" + "      if (elmnt != x[i] && isinput) {" + "\r" + "        x[i].parentNode.removeChild(x[i]);" + "\r" + "      }" + "\r" + "    }" + "\r" + "  }" + "\r" + '  document.addEventListener("click", function (e) {' + "\r" + "       " + elid + "closeAllLists(e.target);" + "\r" + "  });" + "\r" + "}");
      itemdata = new Array();
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        I = $l;
        itemdata.push(this.FItems.Get(I));
      };
      cl = this;
      //cl = this;
      var el = document.getElementById(elid);
      var elindex = document.getElementById(elid + 'index');
      if (el && elindex)
        doautocomplete(this, el, elindex, itemdata, cl);
    };
    this.GetValuesUpdate = function (Items, Lookup) {
      if (this.FOnLookupUpdate != null) this.FOnLookupUpdate(this,Items,Lookup);
    };
    this.BindEvents = function () {
      var eh = null;
      if (this.GetElementInputHandle() != null) {
        eh = this.GetElementInputHandle();
        eh.addEventListener("input",rtl.createSafeCallback(this,"HandleDoChange"));
        eh.addEventListener("click",rtl.createSafeCallback(this,"HandleDoClick"));
        eh.addEventListener("dblclick",rtl.createSafeCallback(this,"HandleDoDblClick"));
        eh.addEventListener("mousedown",rtl.createSafeCallback(this,"HandleDoMouseDown"));
        eh.addEventListener("mouseup",rtl.createSafeCallback(this,"HandleDoMouseUp"));
        eh.addEventListener("mousemove",rtl.createSafeCallback(this,"HandleDoMouseMove"));
        eh.addEventListener("mouseleave",rtl.createSafeCallback(this,"HandleDoMouseLeave"));
        eh.addEventListener("mouseenter",rtl.createSafeCallback(this,"HandleDoMouseEnter"));
        eh.addEventListener("keydown",rtl.createSafeCallback(this,"HandleDoKeyDown"));
        eh.addEventListener("keyup",rtl.createSafeCallback(this,"HandleDoKeyUp"));
        eh.addEventListener("keypress",rtl.createSafeCallback(this,"HandleDoKeyPress"));
        eh.addEventListener("focus",rtl.createCallback(this,"HandleDoEnter"));
        eh.addEventListener("blur",rtl.createSafeCallback(this,"HandleDoExit"));
      };
    };
    this.HandleRenderItem = function (Item, Index) {
      var Result = null;
      var Args = null;
      if (this.FOnRenderItem != null) {
        Args = $mod.TEditAutoCompleteRenderItemEventArgs.$create("Create");
        Args.FItemElement = Item;
        Args.FItemIndex = Index;
        this.FOnRenderItem(this,Args);
        Args = rtl.freeLoc(Args);
      };
      Result = Item;
      return Result;
    };
    this.HandleSelect = function (Index) {
      var Result = false;
      var Args = null;
      if (this.FOnSelect != null) {
        Args = $mod.TEditAutoCompleteSelectEventArgs.$create("Create");
        Args.FItemIndex = Index;
        this.FOnSelect(this,Args);
        Args = rtl.freeLoc(Args);
      };
      if (this.FAutoSelect) this.FInputElement.select();
      Result = true;
      return Result;
    };
    this.HandleDoChange = function (Event) {
      var Result = false;
      this.Change();
      Result = true;
      return Result;
    };
    this.InitCSSLibrary = function (ALibrary) {
      if (ALibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap) {
        this.SetElementClassName("form-control");
        this.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
        this.SetHeightStyle(pas["WEBLib.Controls"].TSizeStyle.ssAuto);
      };
    };
    this.CreateInitialize = function () {
      this.FItems = pas.Classes.TStringList.$create("Create$1");
      this.FText = "";
      this.FItemIndex = -1;
      this.FPopupHeight = 0;
      this.FPopupClassName = "";
      this.FItemClassName = "";
      this.FActiveItemClassName = "";
      this.FLookupType = $mod.TEditAutoCompleteLookupType.ltFirstCharacter;
      this.FlookupMinLength = 1;
      this.FLookupCaseSensitive = false;
      this.FAutoSelect = false;
      pas["WEBLib.StdCtrls"].TCustomInput.CreateInitialize.call(this);
      this.SetTabStop(true);
      this.SetReadOnly(false);
      this.SetElementFont(pas["WEBLib.Controls"].TElementFont.efProperty);
      this.SetCharcase(pas["WEBLib.StdCtrls"].TEditCharCase.wecNormal);
      this.SetWidth(121);
      this.SetHeight(25);
      if (1 < 0) this.GetValuesUpdate(null,"");
    };
    this.Destroy = function () {
      rtl.free(this,"FItems");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.SetFocus = function () {
      var input = null;
      input = this.GetElementHandle().childNodes.item(0);
      if (input != null) {
        input.focus();
      } else pas["WEBLib.Controls"].TCustomControl.SetFocus.call(this);
    };
    this.Change = function () {
      if (this.GetElementHandle() != null) this.FText = this.GetElementInputHandle().value;
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Refresh = function () {
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("AutoSelect",0,rtl.boolean,"FAutoSelect","FAutoSelect",4,{Default: false});
    $r.addProperty("BorderStyle",2,pas["WEBLib.Controls"].$rtti["TBorderStyle"],"FBorderStyle","SetBorderStyle",4,{Default: pas["WEBLib.Controls"].TBorderStyle.bsSingle});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor");
    $r.addProperty("CharCase",2,pas["WEBLib.StdCtrls"].$rtti["TEditCharCase"],"FCharCase","SetCharcase",4,{Default: pas["WEBLib.StdCtrls"].TEditCharCase.wecNormal});
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Hint",2,rtl.string,"FHint","SetHint");
    $r.addProperty("Left",3,rtl.longint,"GetLeft","SetLeft");
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("ReadOnly",2,rtl.boolean,"FReadOnly","SetReadOnly",4,{Default: false});
    $r.addProperty("ShowFocus",2,rtl.boolean,"FShowFocus","SetShowFocus",4,{Default: false});
    $r.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",4,{Default: false});
    $r.addProperty("TextHint",2,rtl.string,"FTextHint","SetTextHint");
    $r.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",4,{Default: true});
    $r.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder");
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChange","FOnChange");
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnKeyDown",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyDown","FOnKeyDown");
    $r.addProperty("OnKeyPress",0,pas["WEBLib.Controls"].$rtti["TKeyPressEvent"],"FOnKeyPress","FOnKeyPress");
    $r.addProperty("OnKeyUp",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyUp","FOnKeyUp");
    $r.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseDown","FOnMouseDown");
    $r.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseUp","FOnMouseUp");
    $r.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti["TMouseMoveEvent"],"FOnMouseMove","FOnMouseMove");
    $r.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseLeave","FOnMouseLeave");
    $r.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseEnter","FOnMouseEnter");
    $r.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnEnter","FOnEnter");
    $r.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnExit","FOnExit");
    $r.addProperty("Items",2,pas.Classes.$rtti["TStringList"],"FItems","SetItems");
    $r.addProperty("ItemIndex",3,rtl.longint,"GetItemIndex","SetItemIndex",4,{Default: -1});
    $r.addProperty("Text",3,rtl.string,"GetText","SetText");
    $r.addProperty("PopupHeight",2,rtl.longint,"FPopupHeight","SetPopupHeight",4,{Default: 0});
    $r.addProperty("PopupClassName",2,rtl.string,"FPopupClassName","SetPopupClassName");
    $r.addProperty("ItemClassName",2,rtl.string,"FItemClassName","SetItemClassName");
    $r.addProperty("ActiveItemClassName",2,rtl.string,"FActiveItemClassName","SetActiveItemClassName");
    $r.addProperty("LookupType",2,$mod.$rtti["TEditAutoCompleteLookupType"],"FLookupType","SetLookupType",4,{Default: $mod.TEditAutoCompleteLookupType.ltFirstCharacter});
    $r.addProperty("LookupCaseSensitive",2,rtl.boolean,"FLookupCaseSensitive","SetLookupCaseSensitive",4,{Default: false});
    $r.addProperty("LookupMinLength",2,rtl.longint,"FlookupMinLength","SetLookupMinLength",4,{Default: 1});
    $r.addProperty("OnRenderItem",0,$mod.$rtti["TEditAutoCompleteRenderItemEvent"],"FOnRenderItem","FOnRenderItem");
    $r.addProperty("OnSelect",0,$mod.$rtti["TEditAutoCompleteSelectEvent"],"FOnSelect","FOnSelect");
    $r.addProperty("OnLookupUpdate",0,$mod.$rtti["TEditAutoCompleteLookupUpdateEvent"],"FOnLookupUpdate","FOnLookupUpdate");
  });
  rtl.createClass(this,"TWebEditAutoComplete",this.TEditAutoComplete,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
});
rtl.module("WEBLib.Lists",["System","Classes","Web","WEBLib.Controls","WEBLib.Dialogs","WEBLib.Menus"],function () {
  "use strict";
  var $mod = this;
  this.$rtti.$Class("TListItem");
  this.$rtti.$Class("TListItems");
  this.$rtti.$Class("TListControl");
  this.TListStyle = {"0": "lsNone", lsNone: 0, "1": "lsPagination", lsPagination: 1, "2": "lsTabs", lsTabs: 2, "3": "lsBreadcrumb", lsBreadcrumb: 3, "4": "lsListGroup", lsListGroup: 4, "5": "lsListGroupHorizontal", lsListGroupHorizontal: 5, "6": "lsNavPills", lsNavPills: 6, "7": "lsNavPillsHorizontal", lsNavPillsHorizontal: 7, "8": "lsDropDown", lsDropDown: 8};
  this.$rtti.$Enum("TListStyle",{minvalue: 0, maxvalue: 8, ordtype: 1, enumtype: this.TListStyle});
  this.$rtti.$MethodVar("TListGetItemClassEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AItem",this.$rtti["TListItem"]],["AClassName",rtl.string,1]]), methodkind: 0});
  this.$rtti.$MethodVar("TListGetItemChildrenEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AItem",this.$rtti["TListItem"]],["AElement",pas["WEBLib.Controls"].$rtti["TJSHTMLElementRecord"]]]), methodkind: 0});
  this.$rtti.$MethodVar("TListItemEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AListItem",this.$rtti["TListItem"]]]), methodkind: 0});
  rtl.createClass(this,"TListItem",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FItems = null;
      this.FLink = "";
      this.FLinkTarget = "";
      this.FText = "";
      this.FItemClassName = "";
      this.FLinkClassName = "";
      this.FTag = 0;
      this.FListElement = null;
      this.FEnabled = false;
      this.FActive = false;
      this.FAutoCollaps = false;
      this.FHint = "";
      this.FHTMLChilds = 0;
      this.FBackupElement = null;
      this.FBackupCollapse = false;
      this.FLinkElement = null;
      this.FData = "";
      this.FAbsIndex = 0;
    };
    this.$final = function () {
      this.FItems = undefined;
      this.FListElement = undefined;
      this.FBackupElement = undefined;
      this.FLinkElement = undefined;
      pas.Classes.TCollectionItem.$final.call(this);
    };
    this.SetItems = function (Value) {
      this.FItems.Assign(Value);
    };
    this.SetLink = function (Value) {
      this.FLink = Value;
      this.Changed(false);
    };
    this.SetText = function (Value) {
      this.FText = Value;
      this.Changed(false);
    };
    this.SetActive = function (Value) {
      this.FActive = Value;
      this.Changed(false);
    };
    this.SetEnabled = function (Value) {
      this.FEnabled = Value;
      this.Changed(false);
    };
    this.SetAutoCollaps = function (Value) {
      this.FAutoCollaps = Value;
      this.Changed(false);
    };
    this.SetHint = function (Value) {
      this.FHint = Value;
      this.Changed(false);
    };
    this.SubItemsChanged = function (Sender) {
      this.Changed(false);
    };
    this.Create$1 = function (Collection) {
      var ctrl = null;
      this.FItems = $mod.TListItems.$create("Create$3",[this]);
      this.FItems.FPropName = "Items";
      this.FItems.FOnChange = rtl.createCallback(this,"SubItemsChanged");
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      this.FActive = false;
      this.FEnabled = true;
      this.FBackupElement = null;
      ctrl = rtl.as(Collection,$mod.TListItems).GetListControl();
      if (ctrl != null) {
        this.FItemClassName = ctrl.FDefaultItemClassName;
        this.FLinkClassName = ctrl.FDefaultItemLinkClassName;
      };
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FItems");
      pas.Classes.TCollectionItem.Destroy.call(this);
    };
    this.Assign = function (Source) {
      if ($mod.TListItem.isPrototypeOf(Source)) {
        this.FItemClassName = rtl.as(Source,$mod.TListItem).FItemClassName;
        this.FText = rtl.as(Source,$mod.TListItem).FText;
        this.FLink = rtl.as(Source,$mod.TListItem).FLink;
        this.FLinkClassName = rtl.as(Source,$mod.TListItem).FLinkClassName;
        this.FLinkTarget = rtl.as(Source,$mod.TListItem).FLinkTarget;
        this.FItems.Assign(rtl.as(Source,$mod.TListItem).FItems);
        this.FTag = rtl.as(Source,$mod.TListItem).FTag;
        this.FEnabled = rtl.as(Source,$mod.TListItem).FEnabled;
        this.FActive = rtl.as(Source,$mod.TListItem).FActive;
        this.FHint = rtl.as(Source,$mod.TListItem).FHint;
      };
    };
    this.ItemId = function () {
      var $Self = this;
      var Result = "";
      var itm = null;
      function IsSubItem(AItem) {
        var Result = false;
        Result = false;
        if ((AItem.FCollection != null) && (AItem.FCollection.Owner() != null)) {
          Result = $mod.TListItem.isPrototypeOf(AItem.FCollection.Owner());
        };
        return Result;
      };
      Result = pas.SysUtils.IntToStr(this.GetIndex());
      itm = $Self;
      while (IsSubItem(itm)) {
        itm = rtl.as(itm.FCollection.Owner(),$mod.TListItem);
        Result = Result + "_" + pas.SysUtils.IntToStr(this.GetIndex());
      };
      return Result;
    };
    this.Store = function () {
      if (!(this.FBackupElement != null)) this.FBackupElement = document.createElement("SPAN");
      this.FBackupCollapse = this.IsCollapsed();
      if (this.FListElement != null) while (this.FListElement.childElementCount > 0) {
        this.FBackupElement.appendChild(this.FListElement.firstElementChild);
      };
      this.FItems.Store();
    };
    this.Restore = function () {
      var i = 0;
      if ((this.FListElement != null) && (this.FBackupElement != null)) {
        i = 0;
        while (this.FBackupElement.childElementCount > 0) {
          if (i >= this.FHTMLChilds) {
            this.FListElement.appendChild(this.FBackupElement.firstElementChild)}
           else this.FBackupElement.removeChild(this.FBackupElement.firstElementChild);
        };
      };
      if (!this.FBackupCollapse) this.Expand();
      this.FItems.Restore();
    };
    this.AddLink = function (AURL, ATarget) {
      this.AddLink$1(AURL,ATarget,"");
    };
    this.AddLink$1 = function (AURL, ATarget, AClass) {
      this.FLink = AURL;
      this.FLinkTarget = ATarget;
      this.FLinkClassName = AClass;
      this.Changed(false);
    };
    this.IsLink = function () {
      var Result = false;
      Result = this.FLink !== "";
      return Result;
    };
    this.IsCollapsed = function () {
      var Result = false;
      var el = null;
      Result = true;
      if (this.FListElement != null) {
        el = this.FListElement.nextElementSibling;
        if ((el != null) && (el.tagName === "DIV")) {
          Result = !el.classList.contains("show");
        };
      };
      return Result;
    };
    this.Expand = function () {
      var el = null;
      if (this.FListElement != null) {
        el = this.FListElement.nextElementSibling;
        if ((el != null) && (el.tagName === "DIV")) {
          if (!el.classList.contains("show")) el.classList.add("show");
        };
      };
    };
    this.Collapse = function () {
      var el = null;
      if (this.FListElement != null) {
        el = this.FListElement.nextElementSibling;
        if ((el != null) && (el.tagName === "DIV")) {
          if (el.classList.contains("show")) el.classList.remove("show");
        };
      };
    };
    var $r = this.$rtti;
    $r.addProperty("Active",2,rtl.boolean,"FActive","SetActive");
    $r.addProperty("AutoCollaps",2,rtl.boolean,"FAutoCollaps","SetAutoCollaps");
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled");
    $r.addProperty("Hint",2,rtl.string,"FHint","SetHint");
    $r.addProperty("ItemClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FItemClassName","FItemClassName");
    $r.addProperty("Items",2,$mod.$rtti["TListItems"],"FItems","SetItems");
    $r.addProperty("Link",2,rtl.string,"FLink","SetLink");
    $r.addProperty("LinkClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FLinkClassName","FLinkClassName");
    $r.addProperty("LinkTarget",0,rtl.string,"FLinkTarget","FLinkTarget");
    $r.addProperty("Tag",0,rtl.longint,"FTag","FTag");
    $r.addProperty("Text",2,rtl.string,"FText","SetText");
  });
  rtl.createClass(this,"TListItems",pas.Classes.TOwnedCollection,function () {
    this.$init = function () {
      pas.Classes.TOwnedCollection.$init.call(this);
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      pas.Classes.TOwnedCollection.$final.call(this);
    };
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      this.SetItem(Index,Value);
    };
    this.GetListControl = function () {
      var $Self = this;
      var Result = null;
      function FindListControl(AOwner) {
        var Result = null;
        Result = null;
        if ($mod.TListControl.isPrototypeOf(AOwner)) {
          Result = rtl.as(AOwner,$mod.TListControl)}
         else {
          if ((AOwner != null) && $mod.TListItem.isPrototypeOf(AOwner)) {
            Result = FindListControl(rtl.as(AOwner,$mod.TListItem).FCollection.Owner());
          };
        };
        return Result;
      };
      Result = FindListControl($Self.Owner());
      return Result;
    };
    this.Update = function (Item) {
      pas.Classes.TCollection.Update.apply(this,arguments);
      this.DoChanged();
    };
    this.DoChanged = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Store = function () {
      var i = 0;
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        this.GetItem$1(i).Store();
      };
    };
    this.Restore = function () {
      var i = 0;
      for (var $l = 0, $end = this.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        this.GetItem$1(i).Restore();
      };
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,$mod.TListItem);
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      return Result;
    };
  });
  rtl.createClass(this,"TListControl",pas["WEBLib.Menus"].TWebCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Menus"].TWebCustomControl.$init.call(this);
      this.FItems = null;
      this.FElementListClassName = "";
      this.FOnGetItemChildren = null;
      this.FOnGetItemClass = null;
      this.FOnItemDblClick = null;
      this.FOnItemClick = null;
      this.FDefaultItemClassName = "";
      this.FDefaultItemLinkClassName = "";
      this.FListStyle = 0;
      this.FMultiSelect = false;
      this.FAutoSelect = false;
    };
    this.$final = function () {
      this.FItems = undefined;
      this.FOnGetItemChildren = undefined;
      this.FOnGetItemClass = undefined;
      this.FOnItemDblClick = undefined;
      this.FOnItemClick = undefined;
      pas["WEBLib.Menus"].TWebCustomControl.$final.call(this);
    };
    this.SetItems = function (Value) {
      this.FItems = Value;
    };
    this.SetListStyle = function (Value) {
      this.FListStyle = Value;
      if (this.IsUpdating()) return;
      var $tmp = this.FListStyle;
      if ($tmp === $mod.TListStyle.lsPagination) {
        this.FDefaultItemClassName = "page-item";
        this.FDefaultItemLinkClassName = "page-link";
        this.SetElementListClassName("pagination");
      } else if ($tmp === $mod.TListStyle.lsTabs) {
        this.FDefaultItemClassName = "nav-item";
        this.FDefaultItemLinkClassName = "nav-link";
        this.SetElementListClassName("nav nav-tabs");
      } else if ($tmp === $mod.TListStyle.lsBreadcrumb) {
        this.FDefaultItemClassName = "breadcrumb-item";
        this.FDefaultItemLinkClassName = "breadcrumb-link";
        this.SetElementListClassName("breadcrumb");
      } else if ($tmp === $mod.TListStyle.lsListGroup) {
        this.FDefaultItemClassName = "list-group-item";
        this.FDefaultItemLinkClassName = "list-group-link";
        this.SetElementListClassName("list-group");
      } else if ($tmp === $mod.TListStyle.lsListGroupHorizontal) {
        this.FDefaultItemClassName = "list-group-item";
        this.FDefaultItemLinkClassName = "list-group-link";
        this.SetElementListClassName("list-group list-group-horizontal");
      } else if ($tmp === $mod.TListStyle.lsNavPills) {
        this.FDefaultItemClassName = "nav-item";
        this.FDefaultItemLinkClassName = "nav-link";
        this.SetElementListClassName("nav nav-pills flex-column");
      } else if ($tmp === $mod.TListStyle.lsNavPillsHorizontal) {
        this.FDefaultItemClassName = "nav-item";
        this.FDefaultItemLinkClassName = "nav-link";
        this.SetElementListClassName("nav nav-pills");
      };
    };
    this.SetElementListClassName = function (Value) {
      this.FElementListClassName = Value;
      this.UpdateElement();
    };
    this.GetItemIndex = function () {
      var Result = 0;
      var i = 0;
      Result = -1;
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.FItems.GetItem$1(i).FActive) {
          Result = i;
          break;
        };
      };
      return Result;
    };
    this.SetItemIndex = function (Value) {
      var i = 0;
      var j = 0;
      var v = 0;
      this.BeginUpdate();
      v = 0;
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        this.FItems.GetItem$1(i).SetActive(Value === v);
        v += 1;
        if (this.FItems.GetItem$1(i).FItems.GetCount() > 0) {
          for (var $l1 = 0, $end1 = this.FItems.GetItem$1(i).FItems.GetCount() - 1; $l1 <= $end1; $l1++) {
            j = $l1;
            this.FItems.GetItem$1(i).FItems.GetItem$1(j).SetActive(Value === v);
            v += 1;
          };
        };
      };
      this.EndUpdate();
    };
    this.HandleDoClick = function (Event) {
      var Result = false;
      var li = null;
      if (this.FOnItemClick != null) {
        Event.preventDefault();
        Event.stopPropagation();
      };
      li = this.ListItemByElement(Event.target);
      if (li != null) {
        if (this.FAutoSelect) {
          if (this.FMultiSelect) {
            li.SetActive(!li.FActive)}
           else {
            this.SetItemIndex(li.FAbsIndex);
          };
        };
        if (li != null) this.ItemClick(li);
      };
      Result = false;
      return Result;
    };
    this.HandleDoDblClick = function (Event) {
      var Result = false;
      var li = null;
      li = this.ListItemByElement(Event.target);
      if (li != null) this.ItemDblClick(li);
      Result = false;
      return Result;
    };
    this.HandleDoAnchorClick = function (Event) {
      var Result = false;
      var li = null;
      li = this.ListItemByElement(Event.target.parentNode);
      if (li != null) this.ItemClick(li);
      Result = false;
      return Result;
    };
    this.ItemsChanged = function (Sender) {
      var ul = null;
      var idx = 0;
      if (this.IsUpdating()) return;
      if (this.GetElementHandle() != null) {
        ul = this.ListElement();
        if (ul != null) {
          if (this.FListStyle === $mod.TListStyle.lsListGroup) this.FItems.Store();
          while (ul.firstChild != null) ul.removeChild(ul.firstChild);
          if (this.FElementListClassName !== "") ul.setAttribute("class",this.FElementListClassName);
          idx = 0;
          this.RenderList(ul,this.FItems,{get: function () {
              return idx;
            }, set: function (v) {
              idx = v;
            }});
          if (this.FListStyle === $mod.TListStyle.lsListGroup) this.FItems.Restore();
        };
        if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) this.UpdateElement();
      };
    };
    this.ItemClick = function (AItem) {
      if (this.FOnItemClick != null) this.FOnItemClick(this,AItem);
    };
    this.ItemDblClick = function (AItem) {
      if (this.FOnItemDblClick != null) this.FOnItemDblClick(this,AItem);
    };
    this.GetItemClass = function (Item, AClass) {
      if (this.FOnGetItemClass != null) this.FOnGetItemClass(this,Item,AClass);
    };
    this.GetItemChildren = function (Item, AElement) {
      var LElementRec = pas["WEBLib.Controls"].TJSHTMLElementRecord.$new();
      LElementRec.element = AElement;
      if (this.FOnGetItemChildren != null) this.FOnGetItemChildren(this,Item,pas["WEBLib.Controls"].TJSHTMLElementRecord.$clone(LElementRec));
    };
    this.CreateElement = function () {
      var Result = null;
      if (this.FListStyle === $mod.TListStyle.lsDropDown) {
        Result = document.createElement("UL")}
       else {
        Result = document.createElement("DIV");
        Result.appendChild(document.createElement("UL"));
      };
      return Result;
    };
    this.UpdateElement = function () {
      var ul = null;
      var LLabel = null;
      var LHasLabel = false;
      var idx = 0;
      pas["WEBLib.Controls"].TControl.UpdateElement.call(this);
      if (this.IsUpdating()) return;
      if (this.GetElementHandle() != null) {
        if (this.FItems.GetCount() > 0) {
          this.GetElementHandle().style.removeProperty(pas["WEBLib.Controls"].CSSBackground);
          LLabel = this.GetElementHandle().firstChild;
          LHasLabel = (LLabel != null) && (LLabel.tagName === "DIV") && (LLabel.getAttribute("data-design") === "1");
          if (LHasLabel) {
            this.GetElementHandle().removeChild(LLabel);
          };
          ul = this.ListElement();
          if (ul != null) {
            if (this.FListStyle === $mod.TListStyle.lsListGroup) this.FItems.Store();
            while (ul.firstChild != null) ul.removeChild(ul.firstChild);
            if (this.FElementListClassName !== "") ul.setAttribute("class",this.FElementListClassName);
            this.GetElementHandle().style.removeProperty("overflow");
            idx = 0;
            this.RenderList(ul,this.FItems,{get: function () {
                return idx;
              }, set: function (v) {
                idx = v;
              }});
            if (this.FListStyle === $mod.TListStyle.lsListGroup) this.FItems.Restore();
          };
        } else {
          if (!this.GetIsLinked() && (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState)) {
            this.RenderDesigning("TWebListControl",this.GetContainer(),this,true,"");
          } else {
            ul = this.ListElement();
            if (ul != null) while (ul.firstChild != null) ul.removeChild(ul.firstChild);
          };
        };
        if (this.FListStyle in rtl.createSet($mod.TListStyle.lsListGroup)) this.GetElementHandle().style.setProperty("overflow","auto");
      };
    };
    this.RenderList = function (AElement, Items, AIndex) {
      var i = 0;
      var ul = null;
      var li = null;
      var a = null;
      var dv = null;
      var aclass = "";
      var datatoggle = "";
      var datatarget = "";
      var doins = false;
      var el = null;
      if (!(AElement != null)) return;
      if (pas["WEBLib.Forms"].Application.GetBootstrapVersion() !== pas["WEBLib.Forms"].TBootstrapVersion.bv5) {
        datatoggle = "data-toggle";
        datatarget = "data-target";
      } else {
        datatoggle = "data-bs-toggle";
        datatarget = "data-bs-target";
      };
      for (var $l = 0, $end = Items.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        li = document.createElement("li");
        if (this.FDragMode === pas["WEBLib.Controls"].TDragMode.dmAutomatic) li.setAttribute("draggable","true");
        Items.GetItem$1(i).FListElement = li;
        Items.GetItem$1(i).FHTMLChilds = 0;
        aclass = Items.GetItem$1(i).FItemClassName;
        this.GetItemClass(Items.GetItem$1(i),{get: function () {
            return aclass;
          }, set: function (v) {
            aclass = v;
          }});
        if (Items.GetItem$1(i).FActive && (this.FListStyle !== $mod.TListStyle.lsNavPills)) aclass = aclass + " active";
        if (!Items.GetItem$1(i).FEnabled) aclass = aclass + " disabled";
        if (aclass !== "") li.setAttribute("class",aclass);
        if (Items.GetItem$1(i).FHint !== "") li.setAttribute("title",Items.GetItem$1(i).FHint);
        if (Items.GetItem$1(i).IsLink() || (this.FListStyle === $mod.TListStyle.lsPagination)) {
          doins = !(Items.GetItem$1(i).FLinkElement != null);
          if (doins || !Items.GetItem$1(i).IsLink()) Items.GetItem$1(i).FLinkElement = document.createElement("a");
          a = Items.GetItem$1(i).FLinkElement;
          a.innerHTML = Items.GetItem$1(i).FText;
          aclass = Items.GetItem$1(i).FLinkClassName;
          if (Items.GetItem$1(i).FActive) aclass = aclass + " active";
          if (Items.GetItem$1(i).FLinkClassName !== "") a.setAttribute("class",aclass);
          if (Items.GetItem$1(i).FLink === "") {
            a.setAttribute("href","#")}
           else a.setAttribute("href",Items.GetItem$1(i).FLink);
          if (Items.GetItem$1(i).FLinkTarget !== "") a.setAttribute("target",Items.GetItem$1(i).FLinkTarget);
          a.addEventListener("click",rtl.createSafeCallback(this,"HandleDoAnchorClick"));
          if (doins || !Items.GetItem$1(i).IsLink()) li.appendChild(a);
        } else {
          li.innerHTML = Items.GetItem$1(i).FText;
          Items.GetItem$1(i).FHTMLChilds = li.childElementCount;
        };
        el = li;
        this.GetItemChildren(Items.GetItem$1(i),el);
        AElement.appendChild(li);
        Items.GetItem$1(i).FAbsIndex = AIndex.get();
        AIndex.set(AIndex.get() + 1);
        if (this.FListStyle !== $mod.TListStyle.lsTabs) {
          if (Items.GetItem$1(i).FItems.GetCount() > 0) {
            dv = document.createElement("div");
            if (Items.GetItem$1(i).FAutoCollaps) dv.setAttribute("class","collapse");
            dv.setAttribute("id",this.GetID() + Items.GetItem$1(i).ItemId());
            AElement.appendChild(dv);
            if (Items.GetItem$1(i).FAutoCollaps) {
              li.setAttribute(datatoggle,"collapse");
              li.setAttribute(datatarget,"#" + this.GetID() + Items.GetItem$1(i).ItemId());
            };
            ul = document.createElement("ul");
            dv.appendChild(ul);
            this.RenderList(ul,Items.GetItem$1(i).FItems,AIndex);
          };
        };
      };
    };
    this.ListItemByElement = function (AElement) {
      var $Self = this;
      var Result = null;
      function SearchElement(AItems) {
        var Result = null;
        var i = 0;
        Result = null;
        for (var $l = 0, $end = AItems.GetCount() - 1; $l <= $end; $l++) {
          i = $l;
          if (AItems.GetItem$1(i).FListElement === AElement) {
            Result = AItems.GetItem$1(i);
            break;
          };
          if (AItems.GetItem$1(i).FItems.GetCount() > 0) {
            Result = SearchElement(AItems.GetItem$1(i).FItems);
            if (Result != null) break;
          };
        };
        return Result;
      };
      Result = SearchElement(this.FItems);
      return Result;
    };
    this.EnableDrag = function () {
      var $Self = this;
      function AddDraggableAttribute(AElement) {
        var I = 0;
        for (var $l = 0, $end = AElement.children.length - 1; $l <= $end; $l++) {
          I = $l;
          if (AElement.children.item(I).tagName === "LI") {
            AElement.children.item(I).setAttribute("draggable","true");
            AddDraggableAttribute(AElement.children.item(I));
          } else AddDraggableAttribute(AElement.children.item(I));
        };
      };
      if (!(this.GetContainer() != null)) return;
      AddDraggableAttribute(this.GetContainer());
    };
    this.DisableDrag = function () {
      var $Self = this;
      function RemoveDraggableAttribute(AElement) {
        var I = 0;
        for (var $l = 0, $end = AElement.children.length - 1; $l <= $end; $l++) {
          I = $l;
          if (AElement.children.item(I).tagName === "LI") {
            AElement.children.item(I).removeAttribute("draggable");
            RemoveDraggableAttribute(AElement.children.item(I));
          } else RemoveDraggableAttribute(AElement.children.item(I));
        };
      };
      if (!(this.GetContainer() != null)) return;
      RemoveDraggableAttribute(this.GetContainer());
    };
    this.InitCSSLibrary = function (ALibrary) {
      if (ALibrary === pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap) {
        this.FDefaultItemClassName = "list-group-item";
        this.SetElementListClassName("list-group");
        this.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
        this.SetHeightStyle(pas["WEBLib.Controls"].TSizeStyle.ssAuto);
        this.SetListStyle($mod.TListStyle.lsListGroup);
      };
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.Controls"].TControl.Create$1.apply(this,arguments);
      this.SetTabStop(false);
      this.SetWidthStyle(pas["WEBLib.Controls"].TSizeStyle.ssAbsolute);
      this.SetHeightStyle(pas["WEBLib.Controls"].TSizeStyle.ssAbsolute);
      this.SetWidthPercent(100);
      this.SetHeightPercent(100);
      this.SetElementPosition(pas["WEBLib.Controls"].TElementPosition.epAbsolute);
      this.SetListStyle($mod.TListStyle.lsNone);
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FItems");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.FItems = $mod.TListItems.$create("Create$3",[this]);
      this.SetWidth(280);
      this.SetHeight(240);
      if (this.FDesignTime) {
        this.FItems.Add$1().SetText("Item 1");
        this.FItems.Add$1().SetText("Item 2");
        this.FItems.Add$1().SetText("Item 3");
      };
      this.FItems.FOnChange = rtl.createCallback(this,"ItemsChanged");
    };
    this.ListElement = function () {
      var Result = null;
      Result = null;
      if (this.GetElementHandle() != null) {
        if (this.GetElementHandle().tagName === "UL") {
          Result = this.GetElementHandle();
          return Result;
        };
        if (this.GetIsLinked()) {
          if (this.GetElementHandle().tagName === "UL") {
            Result = this.GetElementHandle();
            return Result;
          };
        };
        if (this.GetElementHandle().childElementCount > 0) {
          Result = this.GetElementHandle().firstChild;
        } else {
          Result = document.createElement("UL");
          this.GetElementHandle().insertAdjacentElement("afterbegin",Result);
        };
      };
      return Result;
    };
    this.SetFilter = function (Condition, CaseSensitive) {
      var i = 0;
      var el = null;
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        el = this.FItems.GetItem$1(i).FListElement;
        if (!pas["WEBLib.Utils"].MatchStr(Condition,this.FItems.GetItem$1(i).FText,CaseSensitive)) el.style.setProperty("display","none");
      };
    };
    this.RemoveFilter = function () {
      var i = 0;
      var el = null;
      for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        el = this.FItems.GetItem$1(i).FListElement;
        el.style.removeProperty("display");
      };
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("AutoSelect",0,rtl.boolean,"FAutoSelect","FAutoSelect",4,{Default: false});
    $r.addProperty("ChildOrder",2,rtl.longint,"FChildOrder","SetChildOrderEx",4,{Default: 0});
    $r.addProperty("DefaultItemClassName",0,rtl.string,"FDefaultItemClassName","FDefaultItemClassName");
    $r.addProperty("DefaultItemLinkClassName",0,rtl.string,"FDefaultItemLinkClassName","FDefaultItemLinkClassName");
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("ElementListClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementListClassName","SetElementListClassName");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Items",2,$mod.$rtti["TListItems"],"FItems","SetItems");
    $r.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti["TMargins"],"FMargins","SetMargins");
    $r.addProperty("MultiSelect",0,rtl.boolean,"FMultiSelect","FMultiSelect",4,{Default: false});
    $r.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti["TPopupMenu"],"FPopupMenu","FPopupMenu");
    $r.addProperty("Style",2,$mod.$rtti["TListStyle"],"FListStyle","SetListStyle");
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnGetItemChildren",0,$mod.$rtti["TListGetItemChildrenEvent"],"FOnGetItemChildren","FOnGetItemChildren");
    $r.addProperty("OnGetItemClass",0,$mod.$rtti["TListGetItemClassEvent"],"FOnGetItemClass","FOnGetItemClass");
    $r.addProperty("OnItemClick",0,$mod.$rtti["TListItemEvent"],"FOnItemClick","FOnItemClick");
    $r.addProperty("OnItemDblClick",0,$mod.$rtti["TListItemEvent"],"FOnItemDblClick","FOnItemDblClick");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
  });
  rtl.createClass(this,"TWebListControl",this.TListControl,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
},["SysUtils","WEBLib.Utils","WEBLib.Forms"]);
rtl.module("WEBLib.DropDown",["System","Classes","WEBLib.Controls","WEBLib.Forms","Web","JS","WEBLib.Menus","WEBLib.Graphics","WEBLib.Grids"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  rtl.createClass(this,"TCustomDropDownControl",pas["WEBLib.Menus"].TWebCustomControl,function () {
    this.$init = function () {
      pas["WEBLib.Menus"].TWebCustomControl.$init.call(this);
      this.FDoClickLayer = null;
      this.FDoBtnClick = null;
      this.FLayer$1 = null;
      this.FControl = null;
      this.FDropDown = null;
      this.FTextElement = null;
      this.FButton = null;
      this.FOnCloseUp = null;
      this.FOnDropDown = null;
      this.FText = "";
      this.FAutoDropDown = false;
      this.FElementInputClassName = "";
      this.FButtonImageURL = "";
      this.FDropDownHeight = 0;
      this.FDropDownWidth = 0;
      this.FDropDownColor = 0;
      this.FDropDownShadow = false;
      this.FReadOnly = false;
      this.FElementButtonClassName = "";
    };
    this.$final = function () {
      this.FLayer$1 = undefined;
      this.FControl = undefined;
      this.FDropDown = undefined;
      this.FTextElement = undefined;
      this.FButton = undefined;
      this.FOnCloseUp = undefined;
      this.FOnDropDown = undefined;
      pas["WEBLib.Menus"].TWebCustomControl.$final.call(this);
    };
    this.SetText = function (Value) {
      this.FText = Value;
      if (this.HasEdit()) {
        this.FTextElement.value = Value;
      } else {
        if (Value !== "") {
          this.FTextElement.innerHTML = Value}
         else this.FTextElement.innerHTML = "&nbsp;";
      };
    };
    this.GetText = function () {
      var Result = "";
      Result = this.FText;
      if (this.HasEdit()) {
        Result = this.FTextElement.value;
      };
      return Result;
    };
    this.GetDroppedDown = function () {
      var Result = false;
      Result = this.FDropDown.style.getPropertyValue("display") !== "none";
      return Result;
    };
    this.SetButtonImageURL = function (Value) {
      if (this.FButtonImageURL !== Value) {
        this.FButtonImageURL = Value;
        this.UpdateElement();
      };
    };
    this.SetReadOnly = function (Value) {
      if (this.FReadOnly !== Value) {
        this.FReadOnly = Value;
        this.UpdateElement();
      };
    };
    this.SetControl = function (Value) {
      this.FControl = Value;
      if ((this.FControl != null) && !(pas.Classes.TComponentStateItem.csDesigning in this.FComponentState)) this.FControl.SetVisible(false);
    };
    this.UpdateElementVisual = function () {
      var h = 0;
      var ro = false;
      pas["WEBLib.Controls"].TCustomControl.UpdateElementVisual.call(this);
      if (!this.HasEdit() && (this.FBorderStyle === pas["WEBLib.Controls"].TBorderStyle.bsSingle)) this.GetElementHandle().style.setProperty("border","1px solid silver");
      if (this.HasEdit()) {
        ro = this.FReadOnly;
        this.FTextElement.readOnly = ro;
      };
      this.GetElementHandle().style.removeProperty("overflow");
      h = this.GetHeight() - 1;
      pas["WEBLib.Controls"].SetHTMLElementFont(this.FTextElement,this.FFont,this.FElementFont === pas["WEBLib.Controls"].TElementFont.efCSS);
      this.FTextElement.style.setProperty("line-height",pas.SysUtils.TIntegerHelper.ToString$1.call({get: function () {
          return h;
        }, set: function (v) {
          h = v;
        }}) + "px");
      this.FTextElement.style.setProperty("height",pas.SysUtils.TIntegerHelper.ToString$1.call({get: function () {
          return h;
        }, set: function (v) {
          h = v;
        }}) + "px");
      this.FButton.style.setProperty("height",pas.SysUtils.TIntegerHelper.ToString$1.call({get: function () {
          return h;
        }, set: function (v) {
          h = v;
        }}) + "px");
      this.FButton.style.setProperty("line-height",pas.SysUtils.TIntegerHelper.ToString$1.call({get: function () {
          return h;
        }, set: function (v) {
          h = v;
        }}) + "px");
      this.FButton.setAttribute("class",this.FElementButtonClassName);
      this.FButton.style.setProperty("padding","0px");
      if (this.FElementButtonClassName !== "") this.FButton.style.removeProperty("background-color");
      if (this.FButtonImageURL !== "") {
        this.FButton.innerHTML = '<img src="' + this.FButtonImageURL + '">'}
       else this.FButton.innerHTML = '<i class="arrow down"></i>';
      if (this.FElementInputClassName !== "") {
        this.FTextElement.classList.add(this.FElementInputClassName)}
       else if (this.FTextElement.classList.contains(this.FElementInputClassName)) this.FTextElement.classList.remove(this.FElementInputClassName);
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this);
      this.FAutoDropDown = false;
      this.FDropDownColor = 16777215;
      this.FDropDownWidth = 0;
      this.FDropDownHeight = 0;
      this.FDropDownShadow = true;
    };
    this.HandleDoClickLayer = function (Event) {
      var Result = false;
      this.HideDropDown();
      Result = true;
      return Result;
    };
    this.HandleDoBtnClick = function (Event) {
      var Result = false;
      this.ToggleDropDown();
      Result = true;
      return Result;
    };
    this.Click = function () {
      pas["WEBLib.Controls"].TControl.Click.call(this);
      if ((this.GetElementEvent().target === this.FButton) || (this.GetElementEvent().target.parentElement === this.FButton)) {
        this.ToggleDropDown();
      } else if (this.FAutoDropDown) this.ToggleDropDown();
    };
    this.HasEdit = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    this.CreateChildElements = function (AContainer) {
      var r = null;
      if (this.HasEdit()) {
        this.FTextElement = document.createElement("INPUT");
        this.FTextElement.setAttribute("type","TEXT");
        if (this.FElementFont === pas["WEBLib.Controls"].TElementFont.efProperty) pas["WEBLib.Controls"].SetHTMLElementFont(this.FTextElement,this.FFont,this.FElementFont === pas["WEBLib.Controls"].TElementFont.efCSS);
      } else {
        this.FTextElement = document.createElement("DIV");
        this.FTextElement.setAttribute("type","TEXT");
        this.FTextElement.style.setProperty("padding-left","2px");
        this.FTextElement.style.setProperty("padding-right","2px");
        this.FTextElement.style.setProperty("text-overflow","ellipsis");
        if (this.FElementFont === pas["WEBLib.Controls"].TElementFont.efProperty) pas["WEBLib.Controls"].SetHTMLElementFont(this.FTextElement,this.FFont,this.FElementFont === pas["WEBLib.Controls"].TElementFont.efCSS);
      };
      this.FButton = document.createElement("DIV");
      this.FTextElement.style.setProperty("display","inline-block");
      this.FTextElement.style.setProperty("width","calc(100% - 26px)");
      r = AContainer.getBoundingClientRect();
      if (r.height === 0) r.height = 26;
      this.FTextElement.style.setProperty("height",pas.SysUtils.TDoubleHelper.ToString$3.call({p: r, get: function () {
          return this.p.height;
        }, set: function (v) {
          this.p.height = v;
        }}) + "px");
      this.FTextElement.style.setProperty("box-sizing","border-box");
      this.FTextElement.style.setProperty("line-height",pas.SysUtils.TDoubleHelper.ToString$3.call({p: r, get: function () {
          return this.p.height;
        }, set: function (v) {
          this.p.height = v;
        }}) + "px");
      this.FTextElement.style.setProperty("vertical-align","middle");
      this.FButton.style.setProperty("background-color","silver");
      this.FButton.style.setProperty("display","inline-block");
      this.FButton.style.setProperty("width","25px");
      this.FButton.style.setProperty("height",pas.SysUtils.TDoubleHelper.ToString$3.call({p: r, get: function () {
          return this.p.height;
        }, set: function (v) {
          this.p.height = v;
        }}) + "px");
      this.FButton.style.setProperty("line-height",pas.SysUtils.TDoubleHelper.ToString$3.call({p: r, get: function () {
          return this.p.height;
        }, set: function (v) {
          this.p.height = v;
        }}) + "px");
      this.FButton.style.setProperty("text-align","center");
      this.FButton.style.setProperty("vertical-align","middle");
      this.FButton.style.setProperty("padding","0px!important");
      this.FDropDown = document.createElement("DIV");
      this.FDropDown.style.setProperty("position","absolute");
      this.FDropDown.style.setProperty("display","none");
      this.FDropDown.style.setProperty("background-color","#f1f1f1");
      this.FDropDown.style.setProperty("box-shadow","0px 8px 8px 0px rgba(0,0,0,0.2)");
      this.FDropDown.style.setProperty("z-index","1");
      this.FTextElement.innerHTML = "&nbsp;";
      AContainer.appendChild(this.FTextElement);
      AContainer.appendChild(this.FButton);
      this.FLayer$1 = document.createElement("SPAN");
      this.FLayer$1.style.setProperty("top","0");
      this.FLayer$1.style.setProperty("left","0");
      this.FLayer$1.style.setProperty("right","0");
      this.FLayer$1.style.setProperty("bottom","0");
      this.FLayer$1.style.setProperty("webkit-user-select","none");
      this.FLayer$1.style.setProperty("moz-user-select","none");
      this.FLayer$1.style.setProperty("khtml-user-select","none");
      this.FLayer$1.style.setProperty("ms-user-select","none");
      this.FLayer$1.style.setProperty("user-select","none");
      this.FLayer$1.style.setProperty("position","absolute");
      this.AddInstanceStyle(".arrow { border: solid black; border-width: 0 2px 2px 0;  display: inline-block;  padding: 2px;}" + "\r\n" + ".down { transform: rotate(45deg); -webkit-transform: rotate(45deg);};");
      this.FButton.innerHTML = '<i class="arrow down"></i>';
    };
    this.CreateElement = function () {
      var Result = null;
      Result = document.createElement("DIV");
      return Result;
    };
    this.ClearMethodPointers = function () {
      pas["WEBLib.Controls"].TControl.ClearMethodPointers.call(this);
      this.FDoClickLayer = null;
      this.FDoBtnClick = null;
    };
    this.GetMethodPointers = function () {
      pas["WEBLib.Controls"].TControl.GetMethodPointers.call(this);
      if (this.FDoClickLayer === null) {
        this.FDoClickLayer = rtl.createCallback(this,"HandleDoClickLayer");
        this.FDoBtnClick = rtl.createCallback(this,"HandleDoBtnClick");
      };
    };
    this.DoDropDown = function () {
      if (this.FOnDropDown != null) this.FOnDropDown(this);
    };
    this.DoCloseUp = function () {
      if (this.FOnCloseUp != null) this.FOnCloseUp(this);
    };
    this.BindEvents = function () {
      pas["WEBLib.Controls"].TCustomControl.BindEvents.call(this);
      if (this.HasEdit() && (this.FButton != null)) this.FButton.addEventListener("click",this.FDoBtnClick);
    };
    this.UnbindEvents = function () {
      pas["WEBLib.Controls"].TControl.UnbindEvents.call(this);
      if (this.HasEdit() && (this.FButton != null)) this.FButton.removeEventListener("click",this.FDoBtnClick);
    };
    this.ShowDropDown = function () {
      var dr = null;
      var w = 0.0;
      var h = 0.0;
      if (!(this.GetElementHandle() != null)) return;
      this.FLayer$1.style.setProperty("z-index",pas["WEBLib.Forms"].Application.MaxZIndexStr());
      document.body.appendChild(this.FLayer$1);
      this.FLayer$1.addEventListener("click",this.FDoClickLayer);
      this.FLayer$1.appendChild(this.FDropDown);
      this.FDropDown.style.setProperty("display","table");
      if (this.FControl != null) {
        this.FControl.SetLeft(0);
        this.FControl.SetTop(0);
        this.FControl.SetElementPosition(pas["WEBLib.Controls"].TElementPosition.epRelative);
        this.FControl.SetElementFont(this.FElementFont);
        this.FControl.SetVisible(true);
        dr = this.GetElementHandle().getBoundingClientRect();
        this.FDropDown.style.setProperty("left",pas.SysUtils.TDoubleHelper.ToString$3.call({p: dr, get: function () {
            return this.p.left;
          }, set: function (v) {
            this.p.left = v;
          }}) + "px");
        this.FDropDown.style.setProperty("top",pas.SysUtils.TDoubleHelper.ToString$3.call({p: dr, get: function () {
            return this.p.bottom;
          }, set: function (v) {
            this.p.bottom = v;
          }}) + "px");
        dr = this.FControl.GetElementHandle().getBoundingClientRect();
        if (this.FDropDownWidth > 0) {
          w = this.FDropDownWidth}
         else {
          if (this.FControl != null) {
            w = Math.max(dr.width,this.FControl.GetWidth());
          } else w = dr.width;
        };
        if (this.FDropDownWidth > 0) this.FDropDown.style.setProperty("width",pas.SysUtils.TDoubleHelper.ToString$3.call({get: function () {
            return w;
          }, set: function (v) {
            w = v;
          }}) + "px");
        if (this.FDropDownHeight > 0) {
          h = this.FDropDownHeight}
         else h = Math.max(dr.height,this.FControl.GetHeight());
        this.FDropDown.style.setProperty("height",pas.SysUtils.TDoubleHelper.ToString$3.call({get: function () {
            return h;
          }, set: function (v) {
            h = v;
          }}) + "px");
        if (this.FDropDownColor !== -1) this.FDropDown.style.setProperty("background-color",pas["WEBLib.Graphics"].ColorToHTML(this.FDropDownColor));
        this.FDropDown.appendChild(this.FControl.GetElementHandle());
      };
      if (this.FDropDownShadow) this.FDropDown.style.setProperty("box-shadow","0px 8px 8px 0px rgba(0,0,0,0.2)");
      this.DoDropDown();
    };
    this.HideDropDown = function () {
      this.DoCloseUp();
      this.FLayer$1.removeEventListener("click",this.FDoClickLayer);
      this.FLayer$1.parentElement.removeChild(this.FLayer$1);
      this.FDropDown.style.setProperty("display","none");
      this.FDropDown.parentElement.removeChild(this.FDropDown);
    };
    this.ToggleDropDown = function () {
      if (this.FDropDown.style.getPropertyValue("display") === "none") {
        this.ShowDropDown()}
       else this.HideDropDown();
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("AutoDropDown",0,rtl.boolean,"FAutoDropDown","FAutoDropDown",4,{Default: false});
    $r.addProperty("DropDownColor",0,pas["WEBLib.Graphics"].$rtti["TColor"],"FDropDownColor","FDropDownColor",4,{Default: 16777215});
    $r.addProperty("DropDownWidth",0,rtl.longint,"FDropDownWidth","FDropDownWidth",4,{Default: 0});
    $r.addProperty("DropDownHeight",0,rtl.longint,"FDropDownHeight","FDropDownHeight",4,{Default: 0});
    $r.addProperty("DropDownShadow",0,rtl.boolean,"FDropDownShadow","FDropDownShadow",4,{Default: true});
    $r.addProperty("ReadOnly",2,rtl.boolean,"FReadOnly","SetReadOnly",4,{Default: false});
    $r.addProperty("OnDropDown",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDropDown","FOnDropDown");
    $r.addProperty("OnCloseUp",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnCloseUp","FOnCloseUp");
  });
  rtl.createClass(this,"TDropDownControl",this.TCustomDropDownControl,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("BiDiMode",2,pas["WEBLib.Controls"].$rtti["TBiDiMode"],"FBiDiMode","SetBiDiMode",4,{Default: pas["WEBLib.Controls"].TBiDiMode.bdLeftToRight});
    $r.addProperty("BorderStyle",2,pas["WEBLib.Controls"].$rtti["TBorderStyle"],"FBorderStyle","SetBorderStyle",4,{Default: pas["WEBLib.Controls"].TBorderStyle.bsSingle});
    $r.addProperty("ButtonImageURL",2,rtl.string,"FButtonImageURL","SetButtonImageURL");
    $r.addProperty("ChildOrder",2,rtl.longint,"FChildOrder","SetChildOrderEx",4,{Default: 0});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor");
    $r.addProperty("Control",2,pas["WEBLib.Controls"].$rtti["TCustomControl"],"FControl","SetControl");
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("ElementButtonClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementButtonClassName","FElementButtonClassName");
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Hint",2,rtl.string,"FHint","SetHint");
    $r.addProperty("Left",3,rtl.longint,"GetLeft","SetLeft");
    $r.addProperty("ParentColor",2,rtl.boolean,"FParentColor","SetParentColor",4,{Default: false});
    $r.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",4,{Default: true});
    $r.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti["TPopupMenu"],"FPopupMenu","FPopupMenu");
    $r.addProperty("ReadOnly",2,rtl.boolean,"FReadOnly","SetReadOnly",4,{Default: false});
    $r.addProperty("Role",3,rtl.string,"GetRole","SetRole");
    $r.addProperty("ShowFocus",2,rtl.boolean,"FShowFocus","SetShowFocus",4,{Default: false});
    $r.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",4,{Default: false});
    $r.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder");
    $r.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",4,{Default: true});
    $r.addProperty("Text",3,rtl.string,"GetText","SetText");
    $r.addProperty("TextDirection",0,pas["WEBLib.Controls"].$rtti["TTextDirection"],"FTextDirection","FTextDirection",4,{Default: pas["WEBLib.Controls"].TTextDirection.tdDefault});
    $r.addProperty("Top",3,rtl.longint,"GetTop","SetTop");
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnCloseUp",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnCloseUp","FOnCloseUp");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnDropDown",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDropDown","FOnDropDown");
    $r.addProperty("OnKeyDown",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyDown","FOnKeyDown");
    $r.addProperty("OnKeyPress",0,pas["WEBLib.Controls"].$rtti["TKeyPressEvent"],"FOnKeyPress","FOnKeyPress");
    $r.addProperty("OnKeyUp",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyUp","FOnKeyUp");
    $r.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseDown","FOnMouseDown");
    $r.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseUp","FOnMouseUp");
    $r.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti["TMouseMoveEvent"],"FOnMouseMove","FOnMouseMove");
    $r.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseLeave","FOnMouseLeave");
    $r.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseEnter","FOnMouseEnter");
    $r.addProperty("OnMouseWheel",0,pas["WEBLib.Controls"].$rtti["TMouseWheelEvent"],"FOnMouseWheel","FOnMouseWheel");
    $r.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnEnter","FOnEnter");
    $r.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnExit","FOnExit");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
  });
  rtl.createClass(this,"TWebDropDownControl",this.TDropDownControl,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TEditDropDownControl",this.TCustomDropDownControl,function () {
    this.GetEditElement = function () {
      var Result = null;
      Result = this.FTextElement;
      return Result;
    };
    this.KeyDown = function (Key, Shift) {
      pas["WEBLib.Controls"].TControl.KeyDown.apply(this,arguments);
      if (Key.get() === 115) this.ToggleDropDown();
    };
    this.GetElementBindHandle = function () {
      var Result = null;
      Result = this.FTextElement;
      return Result;
    };
    this.HasEdit = function () {
      var Result = false;
      Result = true;
      return Result;
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Align",2,pas["WEBLib.Controls"].$rtti["TAlign"],"FAlign","SetAlign",4,{Default: pas["WEBLib.Controls"].TAlign.alNone});
    $r.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",4,{Default: false});
    $r.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti["TAnchors"],"FAnchors","SetAnchors",4,{Default: rtl.createSet(pas["WEBLib.Controls"].TAnchorKind.akLeft,pas["WEBLib.Controls"].TAnchorKind.akTop)});
    $r.addProperty("BiDiMode",2,pas["WEBLib.Controls"].$rtti["TBiDiMode"],"FBiDiMode","SetBiDiMode",4,{Default: pas["WEBLib.Controls"].TBiDiMode.bdLeftToRight});
    $r.addProperty("BorderStyle",2,pas["WEBLib.Controls"].$rtti["TBorderStyle"],"FBorderStyle","SetBorderStyle",4,{Default: pas["WEBLib.Controls"].TBorderStyle.bsSingle});
    $r.addProperty("ButtonImageURL",2,rtl.string,"FButtonImageURL","SetButtonImageURL");
    $r.addProperty("ChildOrder",2,rtl.longint,"FChildOrder","SetChildOrderEx",4,{Default: 0});
    $r.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FColor","SetColor");
    $r.addProperty("Control",2,pas["WEBLib.Controls"].$rtti["TCustomControl"],"FControl","SetControl");
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("ElementButtonClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementButtonClassName","FElementButtonClassName");
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementInputClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementInputClassName","FElementInputClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight");
    $r.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",4,{Default: 100});
    $r.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FHeightStyle","SetHeightStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("Hint",2,rtl.string,"FHint","SetHint");
    $r.addProperty("Left",3,rtl.longint,"GetLeft","SetLeft");
    $r.addProperty("ParentColor",2,rtl.boolean,"FParentColor","SetParentColor",4,{Default: false});
    $r.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",4,{Default: true});
    $r.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti["TPopupMenu"],"FPopupMenu","FPopupMenu");
    $r.addProperty("Role",3,rtl.string,"GetRole","SetRole");
    $r.addProperty("ShowFocus",2,rtl.boolean,"FShowFocus","SetShowFocus",4,{Default: false});
    $r.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",4,{Default: false});
    $r.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder");
    $r.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",4,{Default: true});
    $r.addProperty("Text",3,rtl.string,"GetText","SetText");
    $r.addProperty("TextDirection",0,pas["WEBLib.Controls"].$rtti["TTextDirection"],"FTextDirection","FTextDirection",4,{Default: pas["WEBLib.Controls"].TTextDirection.tdDefault});
    $r.addProperty("Top",3,rtl.longint,"GetTop","SetTop");
    $r.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",4,{Default: true});
    $r.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth");
    $r.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",4,{Default: 100});
    $r.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti["TSizeStyle"],"FWidthStyle","SetWidthStyle",4,{Default: pas["WEBLib.Controls"].TSizeStyle.ssAbsolute});
    $r.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnClick","FOnClick");
    $r.addProperty("OnCloseUp",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnCloseUp","FOnCloseUp");
    $r.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDblClick","FOnDblClick");
    $r.addProperty("OnDropDown",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDropDown","FOnDropDown");
    $r.addProperty("OnKeyDown",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyDown","FOnKeyDown");
    $r.addProperty("OnKeyPress",0,pas["WEBLib.Controls"].$rtti["TKeyPressEvent"],"FOnKeyPress","FOnKeyPress");
    $r.addProperty("OnKeyUp",0,pas["WEBLib.Controls"].$rtti["TKeyEvent"],"FOnKeyUp","FOnKeyUp");
    $r.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseDown","FOnMouseDown");
    $r.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti["TMouseEvent"],"FOnMouseUp","FOnMouseUp");
    $r.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti["TMouseMoveEvent"],"FOnMouseMove","FOnMouseMove");
    $r.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseLeave","FOnMouseLeave");
    $r.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnMouseEnter","FOnMouseEnter");
    $r.addProperty("OnMouseWheel",0,pas["WEBLib.Controls"].$rtti["TMouseWheelEvent"],"FOnMouseWheel","FOnMouseWheel");
    $r.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnEnter","FOnEnter");
    $r.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnExit","FOnExit");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
  });
  rtl.createClass(this,"TWebEditDropDownControl",this.TEditDropDownControl,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TTableOptions",pas.Classes.TPersistent,function () {
    this.$init = function () {
      pas.Classes.TPersistent.$init.call(this);
      this.FOwner = null;
      this.FElementSelectionClassName = "";
      this.FElementFont = 0;
      this.FElementHeaderClassName = "";
      this.FElementRowSelectClassName = "";
      this.FElementClassName = "";
      this.FElementTableClassName = "";
      this.FHeader = null;
      this.FFooter = null;
      this.FPaging = null;
      this.FRowHeader = false;
      this.FSelectionTextColor = 0;
      this.FSelectionColor = 0;
      this.FColHeader = false;
      this.FScrollVertical = false;
      this.FResizeColumns = false;
      this.FAutoCellURL = false;
      this.FAutoCellEmail = false;
      this.FAutoCellImage = false;
      this.FCellBorderColor = 0;
      this.FCellBorders = false;
      this.FImageAlign = 0;
      this.FImageWidth = 0;
    };
    this.$final = function () {
      this.FOwner = undefined;
      this.FHeader = undefined;
      this.FFooter = undefined;
      this.FPaging = undefined;
      pas.Classes.TPersistent.$final.call(this);
    };
    this.SetFooter = function (Value) {
      this.FFooter.Assign(Value);
    };
    this.SetHeader = function (Value) {
      this.FHeader.Assign(Value);
    };
    this.SetPaging = function (Value) {
      this.FPaging.Assign(Value);
    };
    this.Assign = function (Source) {
      if ($mod.TTableOptions.isPrototypeOf(Source)) {
        this.FAutoCellURL = rtl.as(Source,$mod.TTableOptions).FAutoCellURL;
        this.FAutoCellImage = rtl.as(Source,$mod.TTableOptions).FAutoCellImage;
        this.FAutoCellEmail = rtl.as(Source,$mod.TTableOptions).FAutoCellEmail;
        this.FElementClassName = rtl.as(Source,$mod.TTableOptions).FElementClassName;
        this.FElementFont = rtl.as(Source,$mod.TTableOptions).FElementFont;
        this.FElementHeaderClassName = rtl.as(Source,$mod.TTableOptions).FElementHeaderClassName;
        this.FElementRowSelectClassName = rtl.as(Source,$mod.TTableOptions).FElementRowSelectClassName;
        this.FElementSelectionClassName = rtl.as(Source,$mod.TTableOptions).FElementSelectionClassName;
        this.FElementTableClassName = rtl.as(Source,$mod.TTableOptions).FElementTableClassName;
        this.FHeader.Assign(rtl.as(Source,$mod.TTableOptions).FHeader);
        this.FFooter.Assign(rtl.as(Source,$mod.TTableOptions).FFooter);
        this.FPaging.Assign(rtl.as(Source,$mod.TTableOptions).FPaging);
        this.FResizeColumns = rtl.as(Source,$mod.TTableOptions).FResizeColumns;
        this.FColHeader = rtl.as(Source,$mod.TTableOptions).FColHeader;
        this.FRowHeader = rtl.as(Source,$mod.TTableOptions).FRowHeader;
        this.FScrollVertical = rtl.as(Source,$mod.TTableOptions).FScrollVertical;
        this.FSelectionColor = rtl.as(Source,$mod.TTableOptions).FSelectionColor;
        this.FSelectionTextColor = rtl.as(Source,$mod.TTableOptions).FSelectionTextColor;
        this.FCellBorders = rtl.as(Source,$mod.TTableOptions).FCellBorders;
        this.FCellBorderColor = rtl.as(Source,$mod.TTableOptions).FCellBorderColor;
        this.FImageWidth = rtl.as(Source,$mod.TTableOptions).FImageWidth;
        this.FImageAlign = rtl.as(Source,$mod.TTableOptions).FImageAlign;
      };
    };
    this.Create$1 = function (AOwner) {
      this.FOwner = AOwner;
      this.FHeader = pas["WEBLib.Grids"].TTableControlHeader.$create("Create$1",[rtl.as(AOwner,pas["WEBLib.Grids"].TCustomTableControl)]);
      this.FFooter = pas["WEBLib.Grids"].TTableControlHeader.$create("Create$1",[rtl.as(AOwner,pas["WEBLib.Grids"].TCustomTableControl)]);
      this.FPaging = pas["WEBLib.Grids"].TTableControlPaging.$create("Create$1",[rtl.as(AOwner,pas["WEBLib.Grids"].TCustomTableControl)]);
      this.FRowHeader = true;
      this.FColHeader = true;
      this.FSelectionTextColor = 16777215;
      this.FSelectionColor = 0xFF8F5B;
      this.FCellBorderColor = 12632256;
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FPaging");
      rtl.free(this,"FHeader");
      rtl.free(this,"FFooter");
      pas.System.TObject.Destroy.call(this);
    };
    var $r = this.$rtti;
    $r.addProperty("AutoCellEmail",0,rtl.boolean,"FAutoCellEmail","FAutoCellEmail",4,{Default: false});
    $r.addProperty("AutoCellURL",0,rtl.boolean,"FAutoCellURL","FAutoCellURL",4,{Default: false});
    $r.addProperty("AutoCellImage",0,rtl.boolean,"FAutoCellImage","FAutoCellImage",4,{Default: false});
    $r.addProperty("CellBorders",0,rtl.boolean,"FCellBorders","FCellBorders",4,{Default: false});
    $r.addProperty("CellBorderColor",0,pas["WEBLib.Graphics"].$rtti["TColor"],"FCellBorderColor","FCellBorderColor",4,{Default: 12632256});
    $r.addProperty("ColHeader",0,rtl.boolean,"FColHeader","FColHeader",4,{Default: true});
    $r.addProperty("ElementClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","FElementClassName");
    $r.addProperty("ElementFont",0,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","FElementFont");
    $r.addProperty("ElementHeaderClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementHeaderClassName","FElementHeaderClassName");
    $r.addProperty("ElementRowSelectClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementRowSelectClassName","FElementRowSelectClassName");
    $r.addProperty("ElementSelectionClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementSelectionClassName","FElementSelectionClassName");
    $r.addProperty("ElementTableClassName",0,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementTableClassName","FElementTableClassName");
    $r.addProperty("ImageAlign",0,pas.Classes.$rtti["TAlignment"],"FImageAlign","FImageAlign",4,{Default: pas.Classes.TAlignment.taLeftJustify});
    $r.addProperty("ImageWidth",0,rtl.longint,"FImageWidth","FImageWidth",4,{Default: 0});
    $r.addProperty("Header",2,pas["WEBLib.Grids"].$rtti["TTableControlHeader"],"FHeader","SetHeader");
    $r.addProperty("Footer",2,pas["WEBLib.Grids"].$rtti["TTableControlHeader"],"FFooter","SetFooter");
    $r.addProperty("Paging",2,pas["WEBLib.Grids"].$rtti["TTableControlPaging"],"FPaging","SetPaging");
    $r.addProperty("ResizeColumns",0,rtl.boolean,"FResizeColumns","FResizeColumns",4,{Default: false});
    $r.addProperty("RowHeader",0,rtl.boolean,"FRowHeader","FRowHeader",4,{Default: true});
    $r.addProperty("ScrollVertical",0,rtl.boolean,"FScrollVertical","FScrollVertical",4,{Default: false});
    $r.addProperty("SelectionColor",0,pas["WEBLib.Graphics"].$rtti["TColor"],"FSelectionColor","FSelectionColor",4,{Default: 16748379});
    $r.addProperty("SelectionTextColor",0,pas["WEBLib.Graphics"].$rtti["TColor"],"FSelectionTextColor","FSelectionTextColor",4,{Default: 16777215});
  });
  rtl.createClass(this,"TEditDropDownTableControl",this.TEditDropDownControl,function () {
    this.$init = function () {
      $mod.TEditDropDownControl.$init.call(this);
      this.FTableControl = null;
      this.FEditColumn = 0;
      this.FTableOptions = null;
    };
    this.$final = function () {
      this.FTableControl = undefined;
      this.FTableOptions = undefined;
      $mod.TEditDropDownControl.$final.call(this);
    };
    this.SetTableOptions = function (Value) {
      this.FTableOptions.Assign(Value);
    };
    this.CreateTable = function (AOwner) {
      var Result = null;
      Result = pas["WEBLib.Grids"].TWebTableControl.$create("Create$1",[this.FOwner]);
      return Result;
    };
    this.GetTableControl = function () {
      var Result = null;
      Result = this.FTableControl;
      return Result;
    };
    this.CreateInitialize = function () {
      $mod.TCustomDropDownControl.CreateInitialize.call(this);
      this.FTableControl = this.CreateTable(this.FOwner);
      this.FTableControl.SetVisible(false);
      this.FTableControl.FOptions.SetScrollVertical(true);
      this.FTableControl.FOnClickCell = rtl.createCallback(this,"TableClickCell");
      this.FTableControl.FOnKeyPress = rtl.createCallback(this,"TableKeyPress");
      this.FTableControl.FOnKeyDown = rtl.createCallback(this,"TableKeyDown");
      this.FTableControl.SetWidthStyle(pas["WEBLib.Controls"].TSizeStyle.ssAuto);
      this.SetControl(this.FTableControl);
      this.FTableOptions = $mod.TTableOptions.$create("Create$1",[this.FTableControl]);
    };
    this.SetParent = function (AValue) {
      pas["WEBLib.Controls"].TControl.SetParent.apply(this,arguments);
      if ((this.FTableControl != null) && !(pas.Classes.TComponentStateItem.csDestroying in this.FComponentState)) {
        this.FTableControl.SetParent(AValue);
        this.FTableControl.InitSample(pas["WEBLib.Grids"].TInitMethod.imLinear);
      };
    };
    this.TableClickCell = function (Sender, ACol, ARow) {
      this.SetText(this.FTableControl.GetCells(this.FEditColumn,ARow));
      this.HideDropDown();
      this.GetEditElement().focus();
    };
    this.TableKeyPress = function (Sender, AChar) {
      if (AChar.get() === "\r") {
        this.TableClickCell(this.FTableControl,this.FEditColumn,this.FTableControl.FRowIndex);
      };
    };
    this.TableKeyDown = function (Sender, AKey, Shift) {
      if (AKey.get() === 115) {
        this.HideDropDown();
        this.GetEditElement().focus();
      };
    };
    this.Create$1 = function (AOwner) {
      pas["WEBLib.Controls"].TControl.Create$1.apply(this,arguments);
      return this;
    };
    this.ShowDropDown = function () {
      var gc = pas["WEBLib.Grids"].TGridCoord.$new();
      $mod.TCustomDropDownControl.ShowDropDown.call(this);
      if (this.FDropDownWidth === 0) {
        this.FTableControl.SetWidthStyle(pas["WEBLib.Controls"].TSizeStyle.ssAuto)}
       else this.FTableControl.SetWidth(this.FDropDownWidth);
      if (this.FDropDownHeight === 0) {
        this.FTableControl.SetHeightStyle(pas["WEBLib.Controls"].TSizeStyle.ssAuto)}
       else this.FTableControl.SetHeight(this.FDropDownHeight);
      this.FTableControl.FOptions.FAutoCellEmail = this.FTableOptions.FAutoCellEmail;
      this.FTableControl.FOptions.FAutoCellURL = this.FTableOptions.FAutoCellURL;
      this.FTableControl.FOptions.FAutoCellImage = this.FTableOptions.FAutoCellImage;
      this.FTableControl.FOptions.SetScrollVertical(this.FTableOptions.FScrollVertical);
      this.FTableControl.FOptions.SetResizeColumns(this.FTableOptions.FResizeColumns);
      this.FTableControl.FOptions.SetCellBorders(this.FTableOptions.FCellBorders);
      this.FTableControl.FOptions.SetCellBorderColor(this.FTableOptions.FCellBorderColor);
      this.FTableControl.FOptions.FImageAlign = this.FTableOptions.FImageAlign;
      this.FTableControl.FOptions.FImageWidth = this.FTableOptions.FImageWidth;
      this.FTableControl.SetElementClassName(this.FTableOptions.FElementClassName);
      this.FTableControl.SetElementFont(this.FTableOptions.FElementFont);
      this.FTableControl.SetElementTableClassName(this.FTableOptions.FElementTableClassName);
      this.FTableControl.FElementRowSelectClassName = this.FTableOptions.FElementRowSelectClassName;
      this.FTableControl.SetElementHeaderClassName(this.FTableOptions.FElementHeaderClassName);
      this.FTableControl.FElementSelectionClassName = this.FTableOptions.FElementSelectionClassName;
      this.FTableControl.FPaging.Assign(this.FTableOptions.FPaging);
      this.FTableControl.FHeader.Assign(this.FTableOptions.FHeader);
      this.FTableControl.FFooter.Assign(this.FTableOptions.FFooter);
      this.FTableControl.Invalidate();
      gc.$assign(this.FTableControl.FindCell(this.GetText(),false,true));
      if ((gc.X !== -1) && (gc.Y !== -1)) {
        this.FTableControl.SetRowIndex(gc.Y);
      };
      this.FTableControl.SetFocus();
      this.FTableControl.ReRenderGrid();
    };
    this.Destroy = function () {
      rtl.free(this,"FTableControl");
      rtl.free(this,"FTableOptions");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("EditColumn",0,rtl.longint,"FEditColumn","FEditColumn",4,{Default: 0});
    $r.addProperty("TableOptions",2,$mod.$rtti["TTableOptions"],"FTableOptions","SetTableOptions");
  });
  rtl.createClass(this,"TWebEditDropDownTableControl",this.TEditDropDownTableControl,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  $mod.$implcode = function () {
    rtl.createClass($impl,"TCrackedTableControl",pas["WEBLib.Grids"].TCustomTableControl,function () {
      rtl.addIntf(this,pas["WEBLib.Controls"].ITMSFNCDataBinderGrid);
      rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
      rtl.addIntf(this,pas.System.IUnknown);
    });
  };
},["SysUtils","Math"]);
rtl.module("WEBLib.DBCtrls",["System","Classes","DB","SysUtils","WEBLib.Controls","WEBLib.StdCtrls","WEBLib.ExtCtrls","WEBLib.Buttons","WEBLib.Grids","WEBLib.Mask","WEBLib.EditAutocomplete","Web","WEBLib.REST","WEBLib.Lists","WEBLib.DropDown","WEBLib.Graphics"],function () {
  "use strict";
  var $mod = this;
  var $impl = $mod.$impl;
  this.TWebLinkType = {"0": "wlHttp", wlHttp: 0, "1": "wlMail", wlMail: 1, "2": "wlHttps", wlHttps: 2, "3": "wlFTP", wlFTP: 3};
  this.$rtti.$Enum("TWebLinkType",{minvalue: 0, maxvalue: 3, ordtype: 1, enumtype: this.TWebLinkType});
  this.TNavigateBtn = {"0": "nbFirst", nbFirst: 0, "1": "nbPrior", nbPrior: 1, "2": "nbNext", nbNext: 2, "3": "nbLast", nbLast: 3, "4": "nbInsert", nbInsert: 4, "5": "nbDelete", nbDelete: 5, "6": "nbEdit", nbEdit: 6, "7": "nbPost", nbPost: 7, "8": "nbCancel", nbCancel: 8};
  this.$rtti.$Enum("TNavigateBtn",{minvalue: 0, maxvalue: 8, ordtype: 1, enumtype: this.TNavigateBtn});
  this.$rtti.$Set("TNavButtonSet",{comptype: this.$rtti["TNavigateBtn"]});
  this.$rtti.$inherited("TDataField",rtl.string,{});
  rtl.createClass(this,"TFieldDataLink",pas.DB.TDataLink,function () {
    this.$init = function () {
      pas.DB.TDataLink.$init.call(this);
      this.FOnDataChange = null;
      this.FOnUpdateData = null;
      this.FOnActiveChange = null;
      this.FField = null;
      this.FFieldName = "";
      this.FModified = false;
      this.FOnEditingChanged = null;
    };
    this.$final = function () {
      this.FOnDataChange = undefined;
      this.FOnUpdateData = undefined;
      this.FOnActiveChange = undefined;
      this.FField = undefined;
      this.FOnEditingChanged = undefined;
      pas.DB.TDataLink.$final.call(this);
    };
    this.UpdateField = function () {
      this.FField = null;
      if ((this.FDataSource != null) && (this.FDataSource.FDataSet != null) && (this.FFieldName !== "")) {
        if (this.FDataSource.FDataSet.GetActive()) {
          try {
            this.FField = this.FDataSource.FDataSet.FieldByName(this.FFieldName);
          } catch ($e) {
            this.FField = null;
          };
        };
      };
    };
    this.ActiveChanged = function () {
      if (!this.FActive) {
        this.FField = null}
       else this.UpdateField();
      if (this.FOnActiveChange != null) this.FOnActiveChange(this);
    };
    this.EditingChanged = function () {
      pas.DB.TDataLink.EditingChanged.call(this);
      if (this.FOnEditingChanged != null) this.FOnEditingChanged(this);
    };
    this.RecordChanged = function (Field) {
      if ((Field === null) || (Field === this.FField)) {
        if (this.FOnDataChange != null) this.FOnDataChange(this);
      };
    };
    this.UpdateData = function () {
      if (this.FModified) {
        if ((this.FField !== null) && (this.FOnUpdateData != null)) this.FOnUpdateData(this);
        this.FModified = false;
      };
    };
    this.Modified = function () {
      this.FModified = true;
    };
    var $r = this.$rtti;
    $r.addProperty("FieldName",0,rtl.string,"FFieldName","FFieldName");
    $r.addProperty("OnDataChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDataChange","FOnDataChange");
    $r.addProperty("OnUpdateData",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnUpdateData","FOnUpdateData");
    $r.addProperty("OnActiveChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnActiveChange","FOnActiveChange");
    $r.addProperty("OnEditingChanged",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnEditingChanged","FOnEditingChanged");
  });
  this.$rtti.$MethodVar("TDataScrollEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Distance",rtl.longint]]), methodkind: 0});
  rtl.createClass(this,"TDBDataLink",pas.DB.TDataLink,function () {
    this.$init = function () {
      pas.DB.TDataLink.$init.call(this);
      this.FOnActiveChange = null;
      this.FOnDataChange = null;
      this.FOnRecordChange = null;
      this.FOnUpdateData = null;
      this.FOnDataScroll = null;
      this.FFieldName = "";
    };
    this.$final = function () {
      this.FOnActiveChange = undefined;
      this.FOnDataChange = undefined;
      this.FOnRecordChange = undefined;
      this.FOnUpdateData = undefined;
      this.FOnDataScroll = undefined;
      pas.DB.TDataLink.$final.call(this);
    };
    this.DataSetChanged = function () {
      pas.DB.TDataLink.DataSetChanged.call(this);
      if (this.FOnDataChange != null) this.FOnDataChange(this);
    };
    this.ActiveChanged = function () {
      pas.DB.TDataLink.ActiveChanged.call(this);
      if (this.FOnActiveChange != null) this.FOnActiveChange(this);
    };
    this.RecordChanged = function (Field) {
      pas.DB.TDataLink.RecordChanged.apply(this,arguments);
      if (this.FOnRecordChange != null) this.FOnRecordChange(this);
    };
    this.DataSetScrolled = function (Distance) {
      pas.DB.TDataLink.DataSetScrolled.apply(this,arguments);
      if (this.FOnDataScroll != null) this.FOnDataScroll(this,Distance);
    };
    this.UpdateData = function () {
      pas.DB.TDataLink.UpdateData.call(this);
      if (this.FOnUpdateData != null) this.FOnUpdateData(this);
    };
    var $r = this.$rtti;
    $r.addProperty("OnRecordChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnRecordChange","FOnRecordChange");
    $r.addProperty("OnDataChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDataChange","FOnDataChange");
    $r.addProperty("OnDataScroll",0,$mod.$rtti["TDataScrollEvent"],"FOnDataScroll","FOnDataScroll");
    $r.addProperty("OnActiveChange",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnActiveChange","FOnActiveChange");
    $r.addProperty("OnUpdateData",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnUpdateData","FOnUpdateData");
  });
  this.$rtti.$MethodVar("TDBEditValidateEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AValue",rtl.string,1],["Valid",rtl.boolean,1]]), methodkind: 0});
  rtl.createClass(this,"TDBEdit",pas["WEBLib.StdCtrls"].TEdit,function () {
    this.$init = function () {
      pas["WEBLib.StdCtrls"].TEdit.$init.call(this);
      this.FDataLink = null;
      this.FEditChange = false;
      this.FOnValidate = null;
    };
    this.$final = function () {
      this.FDataLink = undefined;
      this.FOnValidate = undefined;
      pas["WEBLib.StdCtrls"].TEdit.$final.call(this);
    };
    this.SetDataField = function (Value) {
      this.FDataLink.FFieldName = Value;
      this.FDataLink.UpdateField();
      this.ActiveChange(this);
    };
    this.SetDataSource = function (Value) {
      this.FDataLink.SetDataSource(Value);
    };
    this.GetDataSource = function () {
      var Result = null;
      Result = this.FDataLink.FDataSource;
      return Result;
    };
    this.GetDataField = function () {
      var Result = "";
      Result = this.FDataLink.FFieldName;
      return Result;
    };
    this.DataUpdate = function (Sender) {
      var AValue = "";
      var AValid = false;
      AValue = this.GetText();
      AValid = true;
      if (this.FOnValidate != null) this.FOnValidate(this,{get: function () {
          return AValue;
        }, set: function (v) {
          AValue = v;
        }},{get: function () {
          return AValid;
        }, set: function (v) {
          AValid = v;
        }});
      if (AValid) {
        if (this.FDataLink.FField != null) {
          if (!(this.FDataLink.FField != null)) this.FDataLink.UpdateField();
          this.FDataLink.FField.SetAsString(AValue);
        };
      };
    };
    this.DataChange = function (Sender) {
      if (this.FEditChange) return;
      this.UpdateSelection();
      this.UpdateElement();
      if (!(this.FDataLink.GetDataset() != null)) return;
      if (!(this.FDataLink.FField != null)) this.FDataLink.UpdateField();
      if ((this.FDataLink.FField != null) && !this.FDataLink.GetDataset().IsEmpty()) {
        this.SetText(this.FDataLink.FField.GetDisplayText())}
       else this.SetText("");
    };
    this.ActiveChange = function (Sender) {
      this.UpdateElement();
      if (this.FDataLink.GetDataset() != null) {
        if (!this.FDataLink.GetDataset().GetActive() || !this.GetDataSource().FEnabled) {
          this.SetText("")}
         else this.DataChange(this);
      };
    };
    this.CheckDataSet = function () {
      var Result = false;
      Result = $impl.CheckDB(this.GetDataSource(),this.GetDataField(),this.FDataLink);
      return Result;
    };
    this.EditCanModify = function () {
      var Result = false;
      if (this.GetDataSource() != null) {
        Result = !this.FDataLink.GetDataset().ControlsDisabled() && (this.GetDataSource().FAutoEdit || (this.GetDataSource().FDataSet.FState in rtl.createSet(pas.DB.TDataSetState.dsEdit,pas.DB.TDataSetState.dsInsert))) && this.FDataLink.Edit()}
       else Result = true;
      return Result;
    };
    this.IsReadOnly = function () {
      var Result = false;
      Result = this.FReadOnly || !this.CheckDataSet();
      return Result;
    };
    this.IsEnabled = function () {
      var Result = false;
      Result = this.FEnabled && this.CheckDataSet();
      return Result;
    };
    this.GetDisplayText = function () {
      var Result = "";
      if (!this.CheckDataSet()) {
        Result = ""}
       else {
        if ((pas.DB.TDataSetState.dsEdit === this.FDataLink.GetDataset().FState) && this.Focused()) {
          Result = this.FDataLink.GetDataset().FieldByName(this.GetDataField()).GetEditText();
        } else {
          Result = this.FDataLink.GetDataset().FieldByName(this.GetDataField()).GetDisplayText();
        };
      };
      return Result;
    };
    this.KeyDown = function (Key, Shift) {
      var canedit = false;
      if (!this.CheckDataSet()) return;
      if ((Key.get() === 46) || (Key.get() === 8) || ((Key.get() === 45) && (pas.Classes.TShiftState$a.ssShift in Shift))) {
        this.FEditChange = true;
        canedit = this.EditCanModify();
        this.FEditChange = false;
        if (!canedit) {
          Key.set(0);
          pas["WEBLib.Controls"].TControl.KeyDown.apply(this,arguments);
          return;
        } else {
          pas["WEBLib.Controls"].TControl.KeyDown.apply(this,arguments);
          this.FDataLink.Edit();
        };
      } else pas["WEBLib.Controls"].TControl.KeyDown.apply(this,arguments);
    };
    this.KeyPress = function (Key) {
      var canedit = false;
      if (!this.CheckDataSet() || this.FReadOnly) {
        pas["WEBLib.StdCtrls"].TCustomEdit.KeyPress.apply(this,arguments);
        return;
      };
      if (this.FDataLink.GetDataset().ControlsDisabled()) {
        this.PreventDefault();
        this.StopPropagation();
        return;
      };
      this.FEditChange = true;
      canedit = this.EditCanModify();
      this.FEditChange = false;
      if (!canedit) {
        Key.set("\x00");
        return;
      };
      if (this.FDataLink.FReadOnly) {
        Key.set("\x00");
      };
      pas["WEBLib.StdCtrls"].TCustomEdit.KeyPress.call(this,Key);
    };
    this.DoExit = function () {
      if (!this.FDataLink.FReadOnly) {
        this.FEditChange = true;
        this.FDataLink.UpdateRecord();
      };
      pas["WEBLib.Controls"].TControl.DoExit.call(this);
      this.FEditChange = false;
      if (!this.FDataLink.FReadOnly) {
        if ($impl.HasSpecialEditFormat(this.FDataLink,this.GetDataField())) this.UpdateElementData();
      };
    };
    this.DoEnter = function () {
      pas["WEBLib.StdCtrls"].TCustomEdit.DoEnter.call(this);
      if (!this.FDataLink.FReadOnly) {
        if (this.CheckDataSet() && (pas.DB.TDataSetState.dsEdit === this.FDataLink.GetDataset().FState)) {
          if ($impl.HasSpecialEditFormat(this.FDataLink,this.GetDataField())) this.UpdateElementData();
        };
      };
    };
    this.CanPaste = function (AValue) {
      var Result = false;
      Result = this.CanCut();
      return Result;
    };
    this.CanCut = function () {
      var Result = false;
      var canedit = false;
      if (!this.CheckDataSet()) return Result;
      if (this.FReadOnly) {
        Result = false;
        return Result;
      };
      this.FEditChange = true;
      canedit = this.EditCanModify();
      this.FEditChange = false;
      if (!canedit) {
        Result = false;
        return Result;
      } else {
        Result = pas["WEBLib.StdCtrls"].TCustomEdit.CanCut.call(this);
        this.FDataLink.Edit();
      };
      return Result;
    };
    this.CreateInitialize = function () {
      if (!(this.FDataLink != null)) {
        this.FDataLink = $mod.TFieldDataLink.$create("Create$1");
        this.FDataLink.FOnUpdateData = rtl.createCallback(this,"DataUpdate");
        this.FDataLink.FOnDataChange = rtl.createCallback(this,"DataChange");
        this.FDataLink.FOnActiveChange = rtl.createCallback(this,"ActiveChange");
        this.FEditChange = false;
      };
      pas["WEBLib.StdCtrls"].TCustomEdit.CreateInitialize.call(this);
    };
    this.Destroy = function () {
      rtl.free(this,"FDataLink");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.Change = function () {
      pas["WEBLib.StdCtrls"].TCustomEdit.Change.call(this);
      if (!this.CheckDataSet()) return;
      if (this.GetDataSource().FAutoEdit || (this.GetDataSource().FDataSet.FState in rtl.createSet(pas.DB.TDataSetState.dsEdit,pas.DB.TDataSetState.dsInsert))) this.FDataLink.Modified();
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("DataField",3,$mod.$rtti["TDataField"],"GetDataField","SetDataField");
    $r.addProperty("DataSource",3,pas.DB.$rtti["TDataSource"],"GetDataSource","SetDataSource");
    $r.addProperty("OnValidate",0,$mod.$rtti["TDBEditValidateEvent"],"FOnValidate","FOnValidate");
  });
  rtl.createClass(this,"TWebDBEdit",this.TDBEdit,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TDBEditBtn",pas["WEBLib.ExtCtrls"].TEditBtn,function () {
    this.$init = function () {
      pas["WEBLib.ExtCtrls"].TEditBtn.$init.call(this);
      this.FDataLink = null;
      this.FEditChange = false;
    };
    this.$final = function () {
      this.FDataLink = undefined;
      pas["WEBLib.ExtCtrls"].TEditBtn.$final.call(this);
    };
    this.SetDataField = function (Value) {
      this.FDataLink.FFieldName = Value;
      this.FDataLink.UpdateField();
      this.ActiveChange(this);
    };
    this.SetDataSource = function (Value) {
      this.FDataLink.SetDataSource(Value);
    };
    this.GetDataSource = function () {
      var Result = null;
      Result = this.FDataLink.FDataSource;
      return Result;
    };
    this.GetDataField = function () {
      var Result = "";
      Result = this.FDataLink.FFieldName;
      return Result;
    };
    this.DataUpdate = function (Sender) {
      if (this.FDataLink.FField != null) {
        if (!(this.FDataLink.FField != null)) this.FDataLink.UpdateField();
        this.FDataLink.FField.SetAsString(this.GetText());
      };
    };
    this.DataChange = function (Sender) {
      if (this.FEditChange) return;
      this.UpdateElement();
      if (!(this.FDataLink.GetDataset() != null)) return;
      if (!(this.FDataLink.FField != null)) this.FDataLink.UpdateField();
      if ((this.FDataLink.FField != null) && !this.FDataLink.GetDataset().IsEmpty()) {
        this.SetText(this.FDataLink.FField.GetDisplayText())}
       else this.SetText("");
    };
    this.ActiveChange = function (Sender) {
      this.UpdateElement();
      if (this.FDataLink.GetDataset() != null) {
        if (!this.FDataLink.GetDataset().GetActive() || !this.GetDataSource().FEnabled) {
          this.SetText("")}
         else this.DataChange(this);
      };
    };
    this.CheckDataSet = function () {
      var Result = false;
      Result = $impl.CheckDB(this.GetDataSource(),this.GetDataField(),this.FDataLink);
      return Result;
    };
    this.EditCanModify = function () {
      var Result = false;
      if (this.GetDataSource() != null) {
        Result = !this.FDataLink.GetDataset().ControlsDisabled() && (this.GetDataSource().FAutoEdit || (this.GetDataSource().FDataSet.FState in rtl.createSet(pas.DB.TDataSetState.dsEdit,pas.DB.TDataSetState.dsInsert))) && this.FDataLink.Edit()}
       else Result = true;
      return Result;
    };
    this.IsReadOnly = function () {
      var Result = false;
      Result = this.FReadOnly || !this.CheckDataSet();
      return Result;
    };
    this.IsEnabled = function () {
      var Result = false;
      Result = this.FEnabled && this.CheckDataSet();
      return Result;
    };
    this.GetDisplayText = function () {
      var Result = "";
      if (!this.CheckDataSet()) {
        Result = ""}
       else {
        if ((pas.DB.TDataSetState.dsEdit === this.FDataLink.GetDataset().FState) && this.Focused()) {
          Result = this.FDataLink.GetDataset().FieldByName(this.GetDataField()).GetEditText();
        } else {
          Result = this.FDataLink.GetDataset().FieldByName(this.GetDataField()).GetDisplayText();
        };
      };
      return Result;
    };
    this.KeyDown = function (Key, Shift) {
      var canedit = false;
      if (!this.CheckDataSet()) return;
      if ((Key.get() === 46) || (Key.get() === 8) || ((Key.get() === 45) && (pas.Classes.TShiftState$a.ssShift in Shift))) {
        this.FEditChange = true;
        canedit = this.EditCanModify();
        this.FEditChange = false;
        if (!canedit) {
          Key.set(0);
          pas["WEBLib.Controls"].TControl.KeyDown.apply(this,arguments);
          return;
        } else {
          pas["WEBLib.Controls"].TControl.KeyDown.apply(this,arguments);
          this.FDataLink.Edit();
        };
      } else pas["WEBLib.Controls"].TControl.KeyDown.apply(this,arguments);
    };
    this.KeyPress = function (Key) {
      var canedit = false;
      if (!this.CheckDataSet() || this.FReadOnly) {
        pas["WEBLib.StdCtrls"].TCustomEdit.KeyPress.apply(this,arguments);
        return;
      };
      if (this.FDataLink.GetDataset().ControlsDisabled()) {
        this.PreventDefault();
        this.StopPropagation();
        return;
      };
      this.FEditChange = true;
      canedit = this.EditCanModify();
      this.FEditChange = false;
      if (!canedit) {
        Key.set("\x00");
        return;
      };
      if (this.FDataLink.FReadOnly) {
        Key.set("\x00");
      };
      pas["WEBLib.StdCtrls"].TCustomEdit.KeyPress.call(this,Key);
    };
    this.DoExit = function () {
      if (!this.FDataLink.FReadOnly) {
        this.FEditChange = true;
        this.FDataLink.UpdateRecord();
      };
      pas["WEBLib.Controls"].TControl.DoExit.call(this);
      this.FEditChange = false;
      if (!this.FDataLink.FReadOnly) {
        if ($impl.HasSpecialEditFormat(this.FDataLink,this.GetDataField())) this.UpdateElementData();
      };
    };
    this.DoEnter = function () {
      pas["WEBLib.StdCtrls"].TCustomEdit.DoEnter.call(this);
      if (!this.FDataLink.FReadOnly) {
        if (this.CheckDataSet() && (pas.DB.TDataSetState.dsEdit === this.FDataLink.GetDataset().FState)) {
          if ($impl.HasSpecialEditFormat(this.FDataLink,this.GetDataField())) this.UpdateElementData();
        };
      };
    };
    this.CanPaste = function (AValue) {
      var Result = false;
      Result = this.CanCut();
      return Result;
    };
    this.CanCut = function () {
      var Result = false;
      var canedit = false;
      if (!this.CheckDataSet()) return Result;
      if (this.FReadOnly) {
        Result = false;
        return Result;
      };
      this.FEditChange = true;
      canedit = this.EditCanModify();
      this.FEditChange = false;
      if (!canedit) {
        Result = false;
        return Result;
      } else {
        Result = pas["WEBLib.StdCtrls"].TCustomEdit.CanCut.call(this);
        this.FDataLink.Edit();
      };
      return Result;
    };
    this.CreateInitialize = function () {
      if (!(this.FDataLink != null)) {
        this.FDataLink = $mod.TFieldDataLink.$create("Create$1");
        this.FDataLink.FOnUpdateData = rtl.createCallback(this,"DataUpdate");
        this.FDataLink.FOnDataChange = rtl.createCallback(this,"DataChange");
        this.FDataLink.FOnActiveChange = rtl.createCallback(this,"ActiveChange");
        this.FEditChange = false;
      };
      pas["WEBLib.StdCtrls"].TCustomEdit.CreateInitialize.call(this);
    };
    this.Destroy = function () {
      rtl.free(this,"FDataLink");
      pas["WEBLib.ExtCtrls"].TEditBtn.Destroy.call(this);
    };
    this.Change = function () {
      pas["WEBLib.StdCtrls"].TCustomEdit.Change.call(this);
      if (!this.CheckDataSet()) return;
      if (this.GetDataSource().FAutoEdit || (this.GetDataSource().FDataSet.FState in rtl.createSet(pas.DB.TDataSetState.dsEdit,pas.DB.TDataSetState.dsInsert))) this.FDataLink.Modified();
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("DataField",3,$mod.$rtti["TDataField"],"GetDataField","SetDataField");
    $r.addProperty("DataSource",3,pas.DB.$rtti["TDataSource"],"GetDataSource","SetDataSource");
  });
  rtl.createClass(this,"TWebDBEditBtn",this.TDBEditBtn,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TDBMaskEdit",pas["WEBLib.Mask"].TMaskEdit,function () {
    this.$init = function () {
      pas["WEBLib.Mask"].TMaskEdit.$init.call(this);
      this.FDataLink = null;
      this.FEditChange = false;
      this.FFieldText = "";
    };
    this.$final = function () {
      this.FDataLink = undefined;
      pas["WEBLib.Mask"].TMaskEdit.$final.call(this);
    };
    this.GetDataField = function () {
      var Result = "";
      Result = this.FDataLink.FFieldName;
      return Result;
    };
    this.GetDataSource = function () {
      var Result = null;
      Result = this.FDataLink.FDataSource;
      return Result;
    };
    this.SetDataField = function (Value) {
      this.FDataLink.FFieldName = Value;
      this.FDataLink.UpdateField();
      this.ActiveChange(this);
    };
    this.SetDataSource = function (Value) {
      this.FDataLink.SetDataSource(Value);
      this.FDataLink.UpdateField();
    };
    this.DataUpdate = function (Sender) {
      if (this.FDataLink.FField != null) {
        if (!(this.FDataLink.FField != null)) this.FDataLink.UpdateField();
        this.FDataLink.FField.SetAsString(this.GetEditText());
      };
    };
    this.DataChange = function (Sender) {
      if (this.FEditChange) return;
      if (!(this.FDataLink.GetDataset() != null)) return;
      this.UpdateElement();
      if (!(this.FDataLink.FField != null)) this.FDataLink.UpdateField();
      if ((this.FDataLink.FField != null) && !this.FDataLink.GetDataset().IsEmpty()) {
        this.FFieldText = this.FDataLink.FField.GetDisplayText()}
       else this.FFieldText = "";
      this.SetEditText(this.FFieldText);
    };
    this.ActiveChange = function (Sender) {
      this.UpdateElement();
      if (this.FDataLink.GetDataset() != null) {
        if (!this.FDataLink.GetDataset().GetActive() || !this.GetDataSource().FEnabled) {
          this.SetEditText("")}
         else this.DataChange(this);
      };
    };
    this.CheckDataSet = function () {
      var Result = false;
      Result = $impl.CheckDB(this.GetDataSource(),this.GetDataField(),this.FDataLink);
      return Result;
    };
    this.EditCanModify = function () {
      var Result = false;
      if (this.GetDataSource() != null) {
        Result = !this.FDataLink.GetDataset().ControlsDisabled() && (this.GetDataSource().FAutoEdit || (this.FDataLink.GetDataset().FState in rtl.createSet(pas.DB.TDataSetState.dsEdit,pas.DB.TDataSetState.dsInsert))) && this.FDataLink.Edit()}
       else Result = true;
      return Result;
    };
    this.IsReadOnly = function () {
      var Result = false;
      Result = this.FReadOnly || !this.CheckDataSet();
      return Result;
    };
    this.IsEnabled = function () {
      var Result = false;
      Result = this.FEnabled && this.CheckDataSet();
      return Result;
    };
    this.GetDisplayText = function () {
      var Result = "";
      if (!this.CheckDataSet()) {
        Result = "";
      } else Result = pas["WEBLib.StdCtrls"].TCustomEdit.GetDisplayText.call(this);
      return Result;
    };
    this.KeyDown = function (Key, Shift) {
      var canedit = false;
      if (!this.CheckDataSet()) return;
      if ((Key.get() === 46) || (Key.get() === 8) || ((Key.get() === 45) && (pas.Classes.TShiftState$a.ssShift in Shift))) {
        this.FEditChange = true;
        canedit = this.EditCanModify();
        this.FEditChange = false;
        if (!canedit) {
          Key.set(0);
          pas["WEBLib.Mask"].TCustomMaskEdit.KeyDown.apply(this,arguments);
          return;
        } else {
          pas["WEBLib.Mask"].TCustomMaskEdit.KeyDown.apply(this,arguments);
          this.FDataLink.Edit();
        };
      } else pas["WEBLib.Mask"].TCustomMaskEdit.KeyDown.apply(this,arguments);
    };
    this.KeyPress = function (Key) {
      var canedit = false;
      if (!this.CheckDataSet() || this.FReadOnly) {
        pas["WEBLib.Mask"].TCustomMaskEdit.KeyPress.apply(this,arguments);
        return;
      };
      if (this.FDataLink.GetDataset().ControlsDisabled()) {
        this.PreventDefault();
        this.StopPropagation();
        return;
      };
      this.FEditChange = true;
      canedit = this.EditCanModify();
      this.FEditChange = false;
      if (!canedit) return;
      if (this.FDataLink.FReadOnly) {
        Key.set("\x00");
      };
      pas["WEBLib.Mask"].TCustomMaskEdit.KeyPress.call(this,Key);
    };
    this.DoExit = function () {
      if (!this.FDataLink.FReadOnly) {
        this.FEditChange = true;
        this.FDataLink.UpdateRecord();
      };
      pas["WEBLib.Controls"].TControl.DoExit.call(this);
      this.FEditChange = false;
    };
    this.CanPaste = function (AValue) {
      var Result = false;
      Result = this.CanCut();
      return Result;
    };
    this.CanCut = function () {
      var Result = false;
      var canedit = false;
      if (!this.CheckDataSet()) return Result;
      if (this.FReadOnly) {
        Result = false;
        return Result;
      };
      this.FEditChange = true;
      canedit = this.EditCanModify();
      this.FEditChange = false;
      if (!canedit) {
        Result = false;
        return Result;
      } else {
        Result = pas["WEBLib.StdCtrls"].TCustomEdit.CanCut.call(this);
        this.FDataLink.Edit();
      };
      return Result;
    };
    this.CreateInitialize = function () {
      if (!(this.FDataLink != null)) {
        this.FDataLink = $mod.TFieldDataLink.$create("Create$1");
        this.FDataLink.FOnUpdateData = rtl.createCallback(this,"DataUpdate");
        this.FDataLink.FOnDataChange = rtl.createCallback(this,"DataChange");
        this.FDataLink.FOnActiveChange = rtl.createCallback(this,"ActiveChange");
        this.FEditChange = false;
      };
      pas["WEBLib.Mask"].TCustomMaskEdit.CreateInitialize.call(this);
    };
    this.Destroy = function () {
      rtl.free(this,"FDataLink");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    this.Change = function () {
      pas["WEBLib.StdCtrls"].TCustomEdit.Change.call(this);
      if (!this.CheckDataSet()) return;
      if (this.GetDataSource().FAutoEdit || (this.GetDataSource().FDataSet.FState in rtl.createSet(pas.DB.TDataSetState.dsInsert,pas.DB.TDataSetState.dsEdit))) {
        this.FDataLink.Modified();
      };
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("DataField",3,$mod.$rtti["TDataField"],"GetDataField","SetDataField");
    $r.addProperty("DataSource",3,pas.DB.$rtti["TDataSource"],"GetDataSource","SetDataSource");
  });
  rtl.createClass(this,"TWebDBMaskEdit",this.TDBMaskEdit,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TDBLabel",pas["WEBLib.StdCtrls"].TLabel,function () {
    this.$init = function () {
      pas["WEBLib.StdCtrls"].TLabel.$init.call(this);
      this.FDataLink = null;
    };
    this.$final = function () {
      this.FDataLink = undefined;
      pas["WEBLib.StdCtrls"].TLabel.$final.call(this);
    };
    this.SetDataField = function (Value) {
      this.FDataLink.FFieldName = Value;
      this.FDataLink.UpdateField();
      this.ActiveChange(this);
    };
    this.SetDataSource = function (Value) {
      this.FDataLink.SetDataSource(Value);
    };
    this.GetDataSource = function () {
      var Result = null;
      Result = this.FDataLink.FDataSource;
      return Result;
    };
    this.GetDataField = function () {
      var Result = "";
      Result = this.FDataLink.FFieldName;
      return Result;
    };
    this.CheckDataSet = function () {
      var Result = false;
      Result = $impl.CheckDB(this.GetDataSource(),this.GetDataField(),this.FDataLink);
      return Result;
    };
    this.GetDisplayText = function () {
      var Result = "";
      if (this.CheckDataSet()) {
        Result = pas["WEBLib.StdCtrls"].TCustomLabel.GetDisplayText.call(this)}
       else {
        if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
          Result = this.FName}
         else Result = this.FCaption;
      };
      return Result;
    };
    this.DataUpdate = function (Sender) {
    };
    this.DataChange = function (Sender) {
      if (!(this.FDataLink.GetDataset() != null)) return;
      if (!(this.FDataLink.FField != null)) this.FDataLink.UpdateField();
      if ((this.FDataLink.FField != null) && !this.FDataLink.GetDataset().IsEmpty()) {
        this.SetCaption(this.FDataLink.FField.GetDisplayText());
      } else {
        this.SetCaption("");
      };
    };
    this.ActiveChange = function (Sender) {
      if (this.FDataLink.GetDataset() != null) {
        if (!this.FDataLink.GetDataset().GetActive() || !this.GetDataSource().FEnabled) {
          this.SetCaption("");
        } else this.DataChange(this);
      };
    };
    this.CreateInitialize = function () {
      if (!(this.FDataLink != null)) {
        this.FDataLink = $mod.TFieldDataLink.$create("Create$1");
        this.FDataLink.FOnUpdateData = rtl.createCallback(this,"DataUpdate");
        this.FDataLink.FOnDataChange = rtl.createCallback(this,"DataChange");
        this.FDataLink.FOnActiveChange = rtl.createCallback(this,"ActiveChange");
      };
      pas["WEBLib.StdCtrls"].TCustomLabel.CreateInitialize.call(this);
    };
    this.Destroy = function () {
      rtl.free(this,"FDataLink");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("DataField",3,$mod.$rtti["TDataField"],"GetDataField","SetDataField");
    $r.addProperty("DataSource",3,pas.DB.$rtti["TDataSource"],"GetDataSource","SetDataSource");
  });
  rtl.createClass(this,"TWebDBLabel",this.TDBLabel,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TDBSpinEdit",pas["WEBLib.StdCtrls"].TSpinEdit,function () {
    this.$init = function () {
      pas["WEBLib.StdCtrls"].TSpinEdit.$init.call(this);
      this.FDataLink = null;
      this.FEditChange = false;
    };
    this.$final = function () {
      this.FDataLink = undefined;
      pas["WEBLib.StdCtrls"].TSpinEdit.$final.call(this);
    };
    this.SetDataField = function (Value) {
      this.FDataLink.FFieldName = Value;
      this.FDataLink.UpdateField();
      this.ActiveChange(this);
    };
    this.SetDataSource = function (Value) {
      this.FDataLink.SetDataSource(Value);
    };
    this.GetDataSource = function () {
      var Result = null;
      Result = this.FDataLink.FDataSource;
      return Result;
    };
    this.GetDataField = function () {
      var Result = "";
      Result = this.FDataLink.FFieldName;
      return Result;
    };
    this.DataUpdate = function (Sender) {
      if (this.FDataLink.FField != null) {
        if (!(this.FDataLink.FField != null)) this.FDataLink.UpdateField();
        this.FDataLink.FField.SetAsInteger(this.GetValue());
      };
    };
    this.DataChange = function (Sender) {
      if (this.FEditChange) return;
      if (!(this.FDataLink.GetDataset() != null)) return;
      this.UpdateElement();
      if (!(this.FDataLink.FField != null)) this.FDataLink.UpdateField();
      if ((this.FDataLink.FField != null) && !this.FDataLink.GetDataset().IsEmpty()) {
        this.SetValue(this.FDataLink.FField.GetAsInteger())}
       else this.SetValue(0);
    };
    this.ActiveChange = function (Sender) {
      if (this.FDataLink.GetDataset() != null) {
        if (!this.FDataLink.GetDataset().GetActive() || !this.GetDataSource().FEnabled) {
          this.SetText("");
          this.SetValue(0);
        } else this.DataChange(this);
      };
    };
    this.EditCanModify = function () {
      var Result = false;
      if (this.GetDataSource() != null) {
        Result = !this.FDataLink.GetDataset().ControlsDisabled() && (this.GetDataSource().FAutoEdit || (this.FDataLink.GetDataset().FState in rtl.createSet(pas.DB.TDataSetState.dsInsert,pas.DB.TDataSetState.dsEdit))) && this.FDataLink.Edit()}
       else Result = true;
      return Result;
    };
    this.IsReadOnly = function () {
      var Result = false;
      Result = this.FReadOnly || !this.CheckDataSet();
      return Result;
    };
    this.IsEnabled = function () {
      var Result = false;
      Result = this.FEnabled && this.CheckDataSet() && (this.GetDataSource().FAutoEdit || (this.GetDataSource().FDataSet.FState in rtl.createSet(pas.DB.TDataSetState.dsEdit,pas.DB.TDataSetState.dsInsert)));
      return Result;
    };
    this.CheckDataSet = function () {
      var Result = false;
      Result = $impl.CheckDB(this.GetDataSource(),this.GetDataField(),this.FDataLink);
      return Result;
    };
    this.GetDisplayText = function () {
      var Result = "";
      if (!this.CheckDataSet()) {
        Result = ""}
       else {
        if ((pas.DB.TDataSetState.dsEdit === this.FDataLink.GetDataset().FState) && this.Focused()) {
          Result = this.FDataLink.GetDataset().FieldByName(this.GetDataField()).GetEditText();
        } else {
          Result = this.FDataLink.GetDataset().FieldByName(this.GetDataField()).GetDisplayText();
        };
      };
      return Result;
    };
    this.KeyDown = function (Key, Shift) {
      var canedit = false;
      if (!(this.GetDataSource() != null)) {
        pas["WEBLib.Controls"].TControl.KeyDown.apply(this,arguments);
        return;
      };
      if (!this.FDataLink.GetDataset().GetActive() || !this.GetDataSource().FEnabled) {
        pas["WEBLib.Controls"].TControl.KeyDown.apply(this,arguments);
        return;
      };
      if ((Key.get() === 46) || (Key.get() === 8) || ((Key.get() === 45) && (pas.Classes.TShiftState$a.ssShift in Shift))) {
        this.FEditChange = true;
        canedit = this.EditCanModify();
        this.FEditChange = false;
        if (!canedit) {
          Key.set(0);
          pas["WEBLib.Controls"].TControl.KeyDown.apply(this,arguments);
          return;
        } else {
          pas["WEBLib.Controls"].TControl.KeyDown.apply(this,arguments);
          this.FDataLink.Edit();
        };
      };
    };
    this.KeyPress = function (Key) {
      var canedit = false;
      if (!this.CheckDataSet() || this.FReadOnly) {
        pas["WEBLib.StdCtrls"].TSpinEdit.KeyPress.apply(this,arguments);
        return;
      };
      if (this.FDataLink.GetDataset().ControlsDisabled()) {
        this.PreventDefault();
        this.StopPropagation();
        return;
      };
      if (!this.FDataLink.GetDataset().GetActive() || !this.GetDataSource().FEnabled) {
        pas["WEBLib.StdCtrls"].TSpinEdit.KeyPress.apply(this,arguments);
        return;
      };
      this.FEditChange = true;
      canedit = this.EditCanModify();
      this.FEditChange = false;
      if (!canedit) return;
      if (this.FDataLink.FReadOnly) {
        Key.set("\x00");
      };
      pas["WEBLib.StdCtrls"].TSpinEdit.KeyPress.call(this,Key);
    };
    this.Change = function () {
      var canedit = false;
      pas["WEBLib.StdCtrls"].TSpinEdit.Change.call(this);
      if (!this.CheckDataSet()) return;
      this.FEditChange = true;
      canedit = this.EditCanModify();
      this.FEditChange = false;
      if (canedit) {
        this.FDataLink.Edit();
        this.FDataLink.Modified();
      };
    };
    this.DoExit = function () {
      if (!this.FDataLink.FReadOnly) {
        this.FEditChange = true;
        this.FDataLink.UpdateRecord();
      };
      pas["WEBLib.Controls"].TControl.DoExit.call(this);
      this.FEditChange = false;
      if (!this.FDataLink.FReadOnly) {
        if ($impl.HasSpecialEditFormat(this.FDataLink,this.GetDataField())) this.UpdateElementData();
      };
    };
    this.DoEnter = function () {
      pas["WEBLib.Controls"].TControl.DoEnter.call(this);
      if (!this.FDataLink.FReadOnly) {
        if (this.CheckDataSet() && (pas.DB.TDataSetState.dsEdit === this.FDataLink.GetDataset().FState)) {
          if ($impl.HasSpecialEditFormat(this.FDataLink,this.GetDataField())) this.UpdateElementData();
        };
      };
    };
    this.CreateInitialize = function () {
      if (!(this.FDataLink != null)) {
        this.FDataLink = $mod.TFieldDataLink.$create("Create$1");
        this.FDataLink.FOnUpdateData = rtl.createCallback(this,"DataUpdate");
        this.FDataLink.FOnDataChange = rtl.createCallback(this,"DataChange");
        this.FDataLink.FOnActiveChange = rtl.createCallback(this,"ActiveChange");
        this.FEditChange = false;
      };
      pas["WEBLib.StdCtrls"].TSpinEdit.CreateInitialize.call(this);
    };
    this.Destroy = function () {
      rtl.free(this,"FDataLink");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("DataField",3,$mod.$rtti["TDataField"],"GetDataField","SetDataField");
    $r.addProperty("DataSource",3,pas.DB.$rtti["TDataSource"],"GetDataSource","SetDataSource");
  });
  rtl.createClass(this,"TWebDBSpinEdit",this.TDBSpinEdit,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TDBCheckBox",pas["WEBLib.StdCtrls"].TCheckBox,function () {
    this.$init = function () {
      pas["WEBLib.StdCtrls"].TCheckBox.$init.call(this);
      this.FDataLink = null;
      this.FEditChange = false;
      this.FValueChecked = "";
      this.FValueUnChecked = "";
    };
    this.$final = function () {
      this.FDataLink = undefined;
      pas["WEBLib.StdCtrls"].TCheckBox.$final.call(this);
    };
    this.SetDataField = function (Value) {
      this.FDataLink.FFieldName = Value;
      this.FDataLink.UpdateField();
      this.ActiveChange(this);
    };
    this.SetDataSource = function (Value) {
      this.FDataLink.SetDataSource(Value);
    };
    this.GetDataSource = function () {
      var Result = null;
      Result = this.FDataLink.FDataSource;
      return Result;
    };
    this.GetDataField = function () {
      var Result = "";
      Result = this.FDataLink.FFieldName;
      return Result;
    };
    this.CheckDataSet = function () {
      var Result = false;
      Result = $impl.CheckDB(this.GetDataSource(),this.GetDataField(),this.FDataLink);
      return Result;
    };
    this.EditCanModify = function () {
      var Result = false;
      if (this.GetDataSource() != null) {
        Result = !this.FDataLink.GetDataset().ControlsDisabled() && (this.GetDataSource().FAutoEdit || (this.FDataLink.GetDataset().FState in rtl.createSet(pas.DB.TDataSetState.dsEdit,pas.DB.TDataSetState.dsInsert))) && this.FDataLink.Edit()}
       else Result = true;
      return Result;
    };
    this.DataUpdate = function (Sender) {
      if (this.FDataLink.FField != null) {
        if (!(this.FDataLink.FField != null)) this.FDataLink.UpdateField();
        if (this.FDataLink.FField.FDataType === pas.DB.TFieldType.ftString) {
          if (this.GetChecked()) {
            this.FDataLink.FField.SetAsString(this.FValueChecked)}
           else this.FDataLink.FField.SetAsString(this.FValueUnChecked);
        } else this.FDataLink.FField.SetAsBoolean(this.GetChecked());
      };
    };
    this.DataChange = function (Sender) {
      this.UpdateElement();
      if (this.FEditChange) return;
      if (!(this.FDataLink.GetDataset() != null)) return;
      if (!(this.FDataLink.FField != null)) this.FDataLink.UpdateField();
      if ((this.FDataLink.FField != null) && !this.FDataLink.GetDataset().IsEmpty()) {
        if (this.FDataLink.FField.FDataType === pas.DB.TFieldType.ftString) {
          this.SetChecked(this.FDataLink.FField.GetAsString() === this.FValueChecked)}
         else this.SetChecked(this.FDataLink.FField.GetAsBoolean());
      } else this.SetChecked(false);
    };
    this.ActiveChange = function (Sender) {
      this.UpdateElement();
      if (this.FDataLink.GetDataset() != null) {
        if (!this.FDataLink.GetDataset().GetActive() || !this.GetDataSource().FEnabled) {
          this.SetChecked(false)}
         else this.DataChange(this);
      };
    };
    this.EditingChanged = function (Sender) {
      if ((this.FDataLink.FField != null) && !this.FDataLink.GetDataset().IsEmpty()) {
        if ((this.FDataLink.FField.FDataType === pas.DB.TFieldType.ftString) && (this.FValueChecked !== "") && (this.FValueUnChecked !== "")) {
          if (this.FDataLink.FField.GetAsString() === "") {
            if (this.GetChecked()) {
              this.FDataLink.FField.SetAsString(this.FValueChecked)}
             else this.FDataLink.FField.SetAsString(this.FValueUnChecked);
          };
        };
      };
    };
    this.IsEnabled = function () {
      var Result = false;
      Result = this.FEnabled && this.CheckDataSet() && (this.GetDataSource().FAutoEdit || (this.GetDataSource().FDataSet.FState in rtl.createSet(pas.DB.TDataSetState.dsEdit,pas.DB.TDataSetState.dsInsert)));
      return Result;
    };
    this.Click = function () {
      var canedit = false;
      pas["WEBLib.StdCtrls"].TCheckBox.Click.call(this);
      if (!(this.GetDataSource() != null)) return;
      if (!this.FDataLink.GetDataset().GetActive() || !this.GetDataSource().FEnabled) return;
      this.FEditChange = true;
      canedit = this.EditCanModify();
      this.FEditChange = false;
      if (canedit) {
        this.FDataLink.Edit();
        this.FDataLink.Modified();
      };
    };
    this.CreateInitialize = function () {
      if (!(this.FDataLink != null)) {
        this.FDataLink = $mod.TFieldDataLink.$create("Create$1");
        this.FDataLink.FOnUpdateData = rtl.createCallback(this,"DataUpdate");
        this.FDataLink.FOnDataChange = rtl.createCallback(this,"DataChange");
        this.FDataLink.FOnActiveChange = rtl.createCallback(this,"ActiveChange");
        this.FDataLink.FOnEditingChanged = rtl.createCallback(this,"EditingChanged");
        this.FEditChange = false;
        this.FValueChecked = "True";
        this.FValueUnChecked = "False";
      };
      pas["WEBLib.StdCtrls"].TCheckBox.CreateInitialize.call(this);
    };
    this.Destroy = function () {
      rtl.free(this,"FDataLink");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("DataField",3,$mod.$rtti["TDataField"],"GetDataField","SetDataField");
    $r.addProperty("DataSource",3,pas.DB.$rtti["TDataSource"],"GetDataSource","SetDataSource");
    $r.addProperty("ValueChecked",0,rtl.string,"FValueChecked","FValueChecked");
    $r.addProperty("ValueUnChecked",0,rtl.string,"FValueUnChecked","FValueUnChecked");
  });
  rtl.createClass(this,"TWebDBCheckBox",this.TDBCheckBox,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TDBDateTimePicker",pas["WEBLib.StdCtrls"].TDateTimePicker,function () {
    this.$init = function () {
      pas["WEBLib.StdCtrls"].TDateTimePicker.$init.call(this);
      this.FDataLink = null;
      this.FEditChange = false;
    };
    this.$final = function () {
      this.FDataLink = undefined;
      pas["WEBLib.StdCtrls"].TDateTimePicker.$final.call(this);
    };
    this.SetDataField = function (Value) {
      this.FDataLink.FFieldName = Value;
      this.FDataLink.UpdateField();
      this.ActiveChange(this);
    };
    this.SetDataSource = function (Value) {
      this.FDataLink.SetDataSource(Value);
    };
    this.GetDataSource = function () {
      var Result = null;
      Result = this.FDataLink.FDataSource;
      return Result;
    };
    this.GetDataField = function () {
      var Result = "";
      Result = this.FDataLink.FFieldName;
      return Result;
    };
    this.CheckDataSet = function () {
      var Result = false;
      Result = $impl.CheckDB(this.GetDataSource(),this.GetDataField(),this.FDataLink);
      return Result;
    };
    this.EditCanModify = function () {
      var Result = false;
      if (this.GetDataSource() != null) {
        Result = !this.FDataLink.GetDataset().ControlsDisabled() && (this.GetDataSource().FAutoEdit || (this.FDataLink.GetDataset().FState in rtl.createSet(pas.DB.TDataSetState.dsEdit,pas.DB.TDataSetState.dsInsert))) && this.FDataLink.Edit()}
       else Result = true;
      return Result;
    };
    this.KeyDown = function (Key, Shift) {
      var canedit = false;
      if (!this.CheckDataSet()) {
        pas["WEBLib.Controls"].TControl.KeyDown.apply(this,arguments);
        return;
      };
      if (!this.FDataLink.GetDataset().GetActive() || !this.GetDataSource().FEnabled) {
        pas["WEBLib.Controls"].TControl.KeyDown.apply(this,arguments);
        return;
      };
      if ((Key.get() === 46) || (Key.get() === 8) || ((Key.get() === 45) && (pas.Classes.TShiftState$a.ssShift in Shift))) {
        this.FEditChange = true;
        canedit = this.EditCanModify();
        this.FEditChange = false;
        if (!canedit) {
          Key.set(0);
          pas["WEBLib.Controls"].TControl.KeyDown.apply(this,arguments);
          return;
        } else {
          pas["WEBLib.Controls"].TControl.KeyDown.apply(this,arguments);
          this.FDataLink.Edit();
        };
      };
    };
    this.KeyPress = function (Key) {
      if (!this.CheckDataSet() || this.FReadOnly) {
        pas["WEBLib.Controls"].TControl.KeyPress.apply(this,arguments);
        return;
      };
      if (this.FDataLink.GetDataset().ControlsDisabled()) {
        this.PreventDefault();
        this.StopPropagation();
        return;
      };
      pas["WEBLib.Controls"].TControl.KeyPress.apply(this,arguments);
    };
    this.DataUpdate = function (Sender) {
      if (this.FDataLink.FField != null) {
        if (!(this.FDataLink.FField != null)) this.FDataLink.UpdateField();
        this.FEditChange = true;
        this.FDataLink.FField.SetAsDateTime(this.GetDateTime());
      };
      this.FEditChange = false;
    };
    this.DataChange = function (Sender) {
      var dt = 0.0;
      this.UpdateElement();
      if (this.FEditChange) return;
      if (!(this.FDataLink.GetDataset() != null)) return;
      if (!(this.FDataLink.FField != null)) this.FDataLink.UpdateField();
      if ((this.FDataLink.FField != null) && !this.FDataLink.GetDataset().IsEmpty()) {
        if (this.FDataLink.FField.GetAsString() === "") {
          this.Clear()}
         else if (pas["WEBLib.REST"].TRESTClient.IsIsoDateTime(this.FDataLink.FField.GetAsString())) {
          this.SetDateTime(pas["WEBLib.REST"].TRESTClient.IsoToDateTime(this.FDataLink.FField.GetAsString()))}
         else if (pas.SysUtils.TryStrToDateTime(this.FDataLink.FField.GetAsString(),{get: function () {
            return dt;
          }, set: function (v) {
            dt = v;
          }})) {
          this.SetDateTime(dt)}
         else this.Clear();
      } else {
        this.SetDate(0);
        this.SetTime(0);
      };
    };
    this.ActiveChange = function (Sender) {
      this.UpdateElement();
      if (this.FDataLink.GetDataset() != null) {
        if (!this.FDataLink.GetDataset().GetActive() || !this.GetDataSource().FEnabled) {
          this.SetDate(pas.SysUtils.Now());
        } else this.DataChange(this);
      };
    };
    this.Change = function () {
      pas["WEBLib.StdCtrls"].TDateTimePicker.Change.call(this);
      if (!this.CheckDataSet()) return;
      if (this.GetDataSource().FAutoEdit || (this.GetDataSource().FDataSet.FState in rtl.createSet(pas.DB.TDataSetState.dsEdit,pas.DB.TDataSetState.dsInsert))) {
        this.FEditChange = true;
        this.FDataLink.Edit();
        this.FDataLink.Modified();
        this.FEditChange = false;
      };
    };
    this.IsReadOnly = function () {
      var Result = false;
      Result = this.FReadOnly || !this.CheckDataSet();
      return Result;
    };
    this.IsEnabled = function () {
      var Result = false;
      Result = this.FEnabled && this.CheckDataSet() && (this.GetDataSource().FAutoEdit || (this.GetDataSource().FDataSet.FState in rtl.createSet(pas.DB.TDataSetState.dsEdit,pas.DB.TDataSetState.dsInsert)));
      return Result;
    };
    this.DoExit = function () {
      if (!this.FDataLink.FReadOnly) {
        this.FEditChange = true;
        this.FDataLink.UpdateRecord();
      };
      pas["WEBLib.Controls"].TControl.DoExit.call(this);
      this.FEditChange = false;
    };
    this.CreateInitialize = function () {
      if (!(this.FDataLink != null)) {
        this.FDataLink = $mod.TFieldDataLink.$create("Create$1");
        this.FDataLink.FOnUpdateData = rtl.createCallback(this,"DataUpdate");
        this.FDataLink.FOnDataChange = rtl.createCallback(this,"DataChange");
        this.FDataLink.FOnActiveChange = rtl.createCallback(this,"ActiveChange");
        this.FEditChange = false;
      };
      pas["WEBLib.StdCtrls"].TDateTimePicker.CreateInitialize.call(this);
    };
    this.Destroy = function () {
      rtl.free(this,"FDataLink");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("DataField",3,$mod.$rtti["TDataField"],"GetDataField","SetDataField");
    $r.addProperty("DataSource",3,pas.DB.$rtti["TDataSource"],"GetDataSource","SetDataSource");
  });
  rtl.createClass(this,"TWebDBDateTimePicker",this.TDBDateTimePicker,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TDBEditDropDownControl",pas["WEBLib.DropDown"].TEditDropDownControl,function () {
    this.$init = function () {
      pas["WEBLib.DropDown"].TEditDropDownControl.$init.call(this);
      this.FDataLink = null;
      this.FEditChange = false;
    };
    this.$final = function () {
      this.FDataLink = undefined;
      pas["WEBLib.DropDown"].TEditDropDownControl.$final.call(this);
    };
    this.SetDataField = function (Value) {
      this.FDataLink.FFieldName = Value;
      this.FDataLink.UpdateField();
      this.ActiveChange(this);
    };
    this.SetDataSource = function (Value) {
      this.FDataLink.SetDataSource(Value);
    };
    this.GetDataSource = function () {
      var Result = null;
      Result = this.FDataLink.FDataSource;
      return Result;
    };
    this.GetDataField = function () {
      var Result = "";
      Result = this.FDataLink.FFieldName;
      return Result;
    };
    this.DataUpdate = function (Sender) {
      if (this.FDataLink.FField != null) {
        if (!(this.FDataLink.FField != null)) this.FDataLink.UpdateField();
        this.FDataLink.FField.SetAsString(this.GetText());
      };
    };
    this.DataChange = function (Sender) {
      if (this.FEditChange) return;
      this.UpdateElement();
      if (!(this.FDataLink.GetDataset() != null)) return;
      if (!(this.FDataLink.FField != null)) this.FDataLink.UpdateField();
      if ((this.FDataLink.FField != null) && !this.FDataLink.GetDataset().IsEmpty()) {
        this.SetText(this.FDataLink.FField.GetDisplayText())}
       else this.SetText("");
    };
    this.ActiveChange = function (Sender) {
      this.UpdateElement();
      if (this.FDataLink.GetDataset() != null) {
        if (!this.FDataLink.GetDataset().GetActive() || !this.GetDataSource().FEnabled) {
          this.SetText("")}
         else this.DataChange(this);
      };
    };
    this.CheckDataSet = function () {
      var Result = false;
      Result = $impl.CheckDB(this.GetDataSource(),this.GetDataField(),this.FDataLink);
      return Result;
    };
    this.EditCanModify = function () {
      var Result = false;
      if (this.GetDataSource() != null) {
        Result = !this.FDataLink.GetDataset().ControlsDisabled() && (this.GetDataSource().FAutoEdit || (this.GetDataSource().FDataSet.FState in rtl.createSet(pas.DB.TDataSetState.dsEdit,pas.DB.TDataSetState.dsInsert))) && this.FDataLink.Edit()}
       else Result = true;
      return Result;
    };
    this.IsReadOnly = function () {
      var Result = false;
      Result = this.FReadOnly || !this.CheckDataSet();
      return Result;
    };
    this.IsEnabled = function () {
      var Result = false;
      Result = this.FEnabled && this.CheckDataSet();
      return Result;
    };
    this.KeyDown = function (Key, Shift) {
      var canedit = false;
      if (!this.CheckDataSet()) return;
      if ((Key.get() === 46) || (Key.get() === 8) || ((Key.get() === 45) && (pas.Classes.TShiftState$a.ssShift in Shift))) {
        this.FEditChange = true;
        canedit = this.EditCanModify();
        this.FEditChange = false;
        if (!canedit) {
          Key.set(0);
          pas["WEBLib.DropDown"].TEditDropDownControl.KeyDown.apply(this,arguments);
          return;
        } else {
          pas["WEBLib.DropDown"].TEditDropDownControl.KeyDown.apply(this,arguments);
          this.FDataLink.Edit();
        };
      } else pas["WEBLib.DropDown"].TEditDropDownControl.KeyDown.apply(this,arguments);
    };
    this.KeyPress = function (Key) {
      var canedit = false;
      if (!this.CheckDataSet()) {
        pas["WEBLib.Controls"].TControl.KeyPress.apply(this,arguments);
        return;
      };
      if (this.FDataLink.GetDataset().ControlsDisabled()) {
        this.PreventDefault();
        this.StopPropagation();
        return;
      };
      this.FEditChange = true;
      canedit = this.EditCanModify();
      this.FEditChange = false;
      if (!canedit) {
        Key.set("\x00");
        return;
      };
      if (this.FDataLink.FReadOnly) {
        Key.set("\x00");
      };
      pas["WEBLib.Controls"].TControl.KeyPress.call(this,Key);
    };
    this.DoExit = function () {
      if (!this.FDataLink.FReadOnly) {
        this.FEditChange = true;
        this.FDataLink.UpdateRecord();
      };
      pas["WEBLib.Controls"].TControl.DoExit.call(this);
      this.FEditChange = false;
    };
    this.CreateInitialize = function () {
      if (!(this.FDataLink != null)) {
        this.FDataLink = $mod.TFieldDataLink.$create("Create$1");
        this.FDataLink.FOnUpdateData = rtl.createCallback(this,"DataUpdate");
        this.FDataLink.FOnDataChange = rtl.createCallback(this,"DataChange");
        this.FDataLink.FOnActiveChange = rtl.createCallback(this,"ActiveChange");
        this.FEditChange = false;
      };
      pas["WEBLib.DropDown"].TCustomDropDownControl.CreateInitialize.call(this);
    };
    this.Destroy = function () {
      rtl.free(this,"FDataLink");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("DataField",3,$mod.$rtti["TDataField"],"GetDataField","SetDataField");
    $r.addProperty("DataSource",3,pas.DB.$rtti["TDataSource"],"GetDataSource","SetDataSource");
  });
  rtl.createClass(this,"TWebDBEditDropDownControl",this.TDBEditDropDownControl,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TDBComboBox",pas["WEBLib.StdCtrls"].TComboBox,function () {
    this.$init = function () {
      pas["WEBLib.StdCtrls"].TComboBox.$init.call(this);
      this.FDataLink = null;
      this.FListLink = null;
      this.FEditChange = false;
      this.FListChange = false;
      this.FListSync = false;
      this.FOnChanged = null;
    };
    this.$final = function () {
      this.FDataLink = undefined;
      this.FListLink = undefined;
      this.FOnChanged = undefined;
      pas["WEBLib.StdCtrls"].TComboBox.$final.call(this);
    };
    this.SetListField = function (Value) {
      this.FListLink.FFieldName = Value;
      this.ListActiveChange(this);
    };
    this.SetListSource = function (Value) {
      this.FListLink.SetDataSource(Value);
    };
    this.GetListField = function () {
      var Result = "";
      Result = this.FListLink.FFieldName;
      return Result;
    };
    this.GetListSource = function () {
      var Result = null;
      Result = this.FListLink.FDataSource;
      return Result;
    };
    this.SetDataField = function (Value) {
      this.FDataLink.FFieldName = Value;
      this.FDataLink.UpdateField();
      this.ActiveChange(this);
    };
    this.SetDataSource = function (Value) {
      this.FDataLink.SetDataSource(Value);
    };
    this.GetDataSource = function () {
      var Result = null;
      Result = this.FDataLink.FDataSource;
      return Result;
    };
    this.GetDataField = function () {
      var Result = "";
      Result = this.FDataLink.FFieldName;
      return Result;
    };
    this.EditCanModify = function () {
      var Result = false;
      if (this.GetDataSource() != null) {
        Result = !this.FDataLink.GetDataset().ControlsDisabled() && (this.GetDataSource().FAutoEdit || (this.FDataLink.GetDataset().FState in rtl.createSet(pas.DB.TDataSetState.dsEdit,pas.DB.TDataSetState.dsInsert))) && this.FDataLink.Edit()}
       else Result = true;
      return Result;
    };
    this.CheckDataSet = function () {
      var Result = false;
      Result = $impl.CheckDB(this.GetDataSource(),this.GetDataField(),this.FDataLink);
      return Result;
    };
    this.DataUpdate = function (Sender) {
      var s = "";
      if (this.FDataLink.FField != null) {
        if (!(this.FDataLink.FField != null)) this.FDataLink.UpdateField();
        s = this.GetText();
        if ((this.FItems.GetCount() > 0) && (pas.System.Pos(this.FItems.GetNameValueSeparator(),this.FItems.Get(0)) > 0) && !(this.GetListSource() != null) && (this.FStyle === pas["WEBLib.StdCtrls"].TComboBoxStyle.csDropDownList) && (this.GetItemIndex() >= 0)) {
          s = this.FItems.GetName(this.GetItemIndex());
          if (s !== "") s = this.FItems.GetValue(s);
        };
        this.FDataLink.FField.SetAsString(s);
      };
    };
    this.DataChange = function (Sender) {
      this.UpdateElement();
      if (this.FEditChange) return;
      if (!(this.GetDataSource() != null)) return;
      if (!(this.FDataLink.GetDataset() != null)) return;
      if (!(this.FDataLink.FField != null)) this.FDataLink.UpdateField();
      if ((this.FDataLink.FField != null) && !this.FDataLink.GetDataset().IsEmpty()) {
        if (this.FStyle === pas["WEBLib.StdCtrls"].TComboBoxStyle.csDropDown) {
          this.SetText(this.FDataLink.FField.GetDisplayText());
        } else {
          if ((this.FItems.GetCount() > 0) && (pas.System.Pos(this.FItems.GetNameValueSeparator(),this.FItems.Get(0)) > 0) && !(this.GetListSource() != null)) {
            this.SetItemIndex(pas.Classes.TStringsHelper.IndexOfValue.call(this.FItems,this.FDataLink.FField.GetDisplayText()));
          } else {
            this.SetItemIndex(this.FItems.IndexOf(this.FDataLink.FField.GetDisplayText()));
          };
        };
      } else {
        this.SetItemIndex(-1);
      };
    };
    this.ActiveChange = function (Sender) {
      this.UpdateElement();
      if (this.FDataLink.GetDataset() != null) {
        if (!this.FDataLink.GetDataset().GetActive() || !this.GetDataSource().FEnabled) {
          this.SetText("");
        } else this.DataChange(this);
      };
    };
    this.ListActiveChange = function (Sender) {
      var fld = null;
      var bk = pas.DB.TBookmark.$new();
      if (!(this.GetListSource() != null)) return;
      if (this.FEditChange) return;
      if ((this.FListLink.FField != null) && (this.FListLink.GetDataset() != null) && this.FListLink.GetDataset().GetActive() && !this.FListLink.GetDataset().IsEmpty()) {
        fld = this.FListLink.GetDataset().FieldByName(this.FListLink.FFieldName);
        if (fld != null) {
          this.FListLink.GetDataset().DisableControls();
          bk.$assign(this.FListLink.GetDataset().GetBookmark());
          this.FItems.Clear();
          this.FListLink.GetDataset().First();
          while (!this.FListLink.GetDataset().GetEOF()) {
            this.FItems.Add(fld.GetDisplayText());
            this.FListLink.GetDataset().Next();
          };
          this.FListLink.GetDataset().GotoBookmark(bk);
          this.DataChange(this);
          this.FListLink.GetDataset().EnableControls();
        };
      };
    };
    this.ListDataChange = function (Sender) {
      if ((this.FListLink.FField != null) && (this.FListLink.GetDataset() != null) && this.FListLink.GetDataset().GetActive() && !(this.FListLink.GetDataset().FState === pas.DB.TDataSetState.dsInsert) && !this.FListChange) {
        this.FListChange = true;
        this.ListActiveChange(this);
        this.FListChange = false;
      };
    };
    this.Change = function () {
      pas["WEBLib.StdCtrls"].TCustomComboBox.Change.call(this);
      if (this.FEditChange) return;
      if (!this.CheckDataSet()) return;
      if (this.GetDataSource().FAutoEdit || (this.GetDataSource().FDataSet.FState in rtl.createSet(pas.DB.TDataSetState.dsEdit,pas.DB.TDataSetState.dsInsert))) {
        this.FEditChange = true;
        if (this.FDataLink.GetDataset() !== this.FListLink.GetDataset()) {
          this.FDataLink.Edit();
          this.FDataLink.Modified();
        };
        if ((this.GetItemIndex() !== -1) && (this.FStyle === pas["WEBLib.StdCtrls"].TComboBoxStyle.csDropDownList) && (this.FListLink != null) && (this.FListLink.GetDataset() != null) && this.FListLink.GetDataset().GetActive() && this.FListSync) {
          this.FListLink.GetDataset().First();
          this.FListLink.GetDataset().MoveBy(this.GetItemIndex());
        };
        this.FEditChange = false;
      };
      if (this.FOnChanged != null) this.FOnChanged(this);
    };
    this.IsEnabled = function () {
      var Result = false;
      Result = this.FEnabled && this.CheckDataSet() && (this.GetDataSource().FAutoEdit || (this.GetDataSource().FDataSet.FState in rtl.createSet(pas.DB.TDataSetState.dsEdit,pas.DB.TDataSetState.dsInsert)));
      return Result;
    };
    this.DoExit = function () {
      if (!this.FDataLink.FReadOnly) {
        this.FEditChange = true;
        this.FDataLink.UpdateRecord();
      };
      pas["WEBLib.Controls"].TControl.DoExit.call(this);
      this.FEditChange = false;
    };
    this.CreateInitialize = function () {
      if (!(this.FDataLink != null)) {
        this.FDataLink = $mod.TFieldDataLink.$create("Create$1");
        this.FDataLink.FOnUpdateData = rtl.createCallback(this,"DataUpdate");
        this.FDataLink.FOnDataChange = rtl.createCallback(this,"DataChange");
        this.FDataLink.FOnActiveChange = rtl.createCallback(this,"ActiveChange");
        this.FListLink = $mod.TFieldDataLink.$create("Create$1");
        this.FListLink.FOnActiveChange = rtl.createCallback(this,"ListActiveChange");
        this.FListLink.FOnDataChange = rtl.createCallback(this,"ListDataChange");
        this.FEditChange = false;
      };
      pas["WEBLib.StdCtrls"].TCustomComboBox.CreateInitialize.call(this);
    };
    this.Destroy = function () {
      rtl.free(this,"FDataLink");
      rtl.free(this,"FListLink");
      pas["WEBLib.StdCtrls"].TCustomComboBox.Destroy.call(this);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("DataField",3,$mod.$rtti["TDataField"],"GetDataField","SetDataField");
    $r.addProperty("DataSource",3,pas.DB.$rtti["TDataSource"],"GetDataSource","SetDataSource");
    $r.addProperty("ListField",3,rtl.string,"GetListField","SetListField");
    $r.addProperty("ListSource",3,pas.DB.$rtti["TDataSource"],"GetListSource","SetListSource");
    $r.addProperty("ListSync",0,rtl.boolean,"FListSync","FListSync",4,{Default: false});
    $r.addProperty("OnChanged",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnChanged","FOnChanged");
  });
  rtl.createClass(this,"TWebDBComboBox",this.TDBComboBox,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TDBLookupComboBox",pas["WEBLib.ExtCtrls"].TCustomLookupComboBox,function () {
    this.$init = function () {
      pas["WEBLib.ExtCtrls"].TCustomLookupComboBox.$init.call(this);
      this.FDataLink = null;
      this.FListLink = null;
      this.FEditChange = false;
      this.FKeyField = "";
      this.FListChanging = false;
      this.FFieldValue = "";
      this.FBlockChange = false;
    };
    this.$final = function () {
      this.FDataLink = undefined;
      this.FListLink = undefined;
      pas["WEBLib.ExtCtrls"].TCustomLookupComboBox.$final.call(this);
    };
    this.GetListField = function () {
      var Result = "";
      Result = this.FListLink.FFieldName;
      return Result;
    };
    this.GetListSource = function () {
      var Result = null;
      Result = this.FListLink.FDataSource;
      return Result;
    };
    this.SetListField = function (Value) {
      this.FListLink.FFieldName = Value;
    };
    this.SetListSource = function (Value) {
      this.FListLink.SetDataSource(Value);
    };
    this.SetDataField = function (Value) {
      this.FDataLink.FFieldName = Value;
      this.FDataLink.UpdateField();
      this.ActiveChange(this);
    };
    this.SetDataSource = function (Value) {
      if (this.FDataLink.FDataSource !== Value) {
        this.FDataLink.SetDataSource(Value);
        this.LoadListSource();
      };
    };
    this.GetDataSource = function () {
      var Result = null;
      Result = this.FDataLink.FDataSource;
      return Result;
    };
    this.GetDataField = function () {
      var Result = "";
      Result = this.FDataLink.FFieldName;
      return Result;
    };
    this.SetKeyField = function (Value) {
      this.FKeyField = Value;
    };
    this.SetValue = function (Value) {
      pas["WEBLib.ExtCtrls"].TCustomLookupComboBox.SetValue.apply(this,arguments);
      this.FFieldValue = Value;
    };
    this.LoadListSource = function () {
      var kfld = null;
      var lfld = null;
      var isBOF = false;
      var isEOF = false;
      var bk = pas.DB.TBookmark.$new();
      var ne = null;
      if ((this.GetListSource() != null) && (this.GetListSource().FDataSet != null) && this.GetListSource().FDataSet.GetActive() && (this.FKeyField !== "") && (this.GetListField() !== "") && !this.FListChanging) {
        this.FListChanging = true;
        try {
          kfld = this.GetListSource().FDataSet.FieldByName(this.FKeyField);
          lfld = this.GetListSource().FDataSet.FieldByName(this.GetListField());
        } catch ($e) {
          kfld = null;
          lfld = null;
        };
        if ((kfld != null) && (lfld != null)) {
          isBOF = this.GetListSource().FDataSet.GetBOF();
          isEOF = this.GetListSource().FDataSet.GetEOF();
          this.GetListSource().FDataSet.DisableControls();
          bk.$assign(this.GetListSource().FDataSet.GetBookmark());
          this.FLookupValues.BeginUpdate();
          this.FLookupValues.Clear();
          this.GetListSource().FDataSet.First();
          while (!this.GetListSource().FDataSet.GetEOF()) {
            this.FLookupValues.AddPair(kfld.GetDisplayText(),lfld.GetDisplayText());
            this.GetListSource().FDataSet.Next();
          };
          this.FLookupValues.EndUpdate();
          if (this.GetListSource().FDataSet.BookmarkValid(pas.DB.TBookmark.$clone(bk))) this.GetListSource().FDataSet.GotoBookmark(bk);
          ne = this.GetListSource().FDataSet.FAfterScroll;
          this.GetListSource().FDataSet.FAfterScroll = null;
          if (isBOF) this.GetListSource().FDataSet.First();
          if (isEOF) this.GetListSource().FDataSet.Last();
          this.DoUpdateList();
          this.GetListSource().FDataSet.FAfterScroll = ne;
          this.GetListSource().FDataSet.EnableControls();
        };
        this.FListChanging = false;
      };
      if (this.FFieldValue !== "") this.SetValue(this.FFieldValue);
    };
    this.CheckDataSet = function () {
      var Result = false;
      Result = $impl.CheckDB(this.GetDataSource(),this.GetDataField(),this.FDataLink) || (this.GetListSource() != null);
      return Result;
    };
    this.CheckListDataSet = function () {
      var Result = false;
      Result = (this.FListLink.FField != null) && (this.FListLink.GetDataset() != null) && this.FListLink.GetDataset().GetActive();
      return Result;
    };
    this.EditCanModify = function () {
      var Result = false;
      if (this.GetDataSource() != null) {
        Result = !this.FDataLink.GetDataset().ControlsDisabled() && (this.GetDataSource().FAutoEdit || (this.FDataLink.GetDataset().FState in rtl.createSet(pas.DB.TDataSetState.dsEdit,pas.DB.TDataSetState.dsInsert))) && this.FDataLink.Edit()}
       else Result = true;
      return Result;
    };
    this.DataUpdate = function (Sender) {
      if (this.FDataLink.FField != null) {
        if (!(this.FDataLink.FField != null)) this.FDataLink.UpdateField();
        this.FDataLink.FField.SetAsString(this.GetValue());
      };
    };
    this.DataChange = function (Sender) {
      this.UpdateElement();
      if (this.FEditChange) return;
      if (!(this.GetDataSource() != null)) return;
      if (!(this.FDataLink.GetDataset() != null)) return;
      if (!(this.FDataLink.FField != null)) this.FDataLink.UpdateField();
      if ((this.FDataLink.FField != null) && !this.FDataLink.GetDataset().IsEmpty()) {
        this.SetValue(this.FDataLink.FField.GetDisplayText());
      } else this.SetItemIndex(-1);
      this.SyncListSource();
    };
    this.ActiveChange = function (Sender) {
      this.UpdateElement();
      if (this.FDataLink.GetDataset() != null) {
        if (!this.FDataLink.GetDataset().GetActive() || !this.GetDataSource().FEnabled) {
          this.SetItemIndex(-1);
        } else this.DataChange(this);
      };
    };
    this.ListDataChange = function (Sender) {
      if (this.FBlockChange) return;
      if (!(pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) this.LoadListSource();
    };
    this.ListActiveChange = function (Sender) {
      if (!(pas.Classes.TComponentStateItem.csLoading in this.FComponentState)) this.LoadListSource();
    };
    this.Change = function () {
      var fld = null;
      var chg = null;
      var idx = 0;
      idx = this.GetItemIndex();
      if (!this.CheckDataSet()) {
        pas["WEBLib.StdCtrls"].TCustomComboBox.Change.call(this);
        return;
      };
      chg = this.FOnChange;
      this.FOnChange = null;
      pas["WEBLib.StdCtrls"].TCustomComboBox.Change.call(this);
      if (this.CheckListDataSet()) this.FListLink.GetDataset().DisableControls();
      if (this.GetDataSource().FAutoEdit || (this.GetDataSource().FDataSet.FState in rtl.createSet(pas.DB.TDataSetState.dsEdit,pas.DB.TDataSetState.dsInsert))) {
        this.FEditChange = true;
        this.FDataLink.Edit();
        fld = null;
        try {
          fld = this.FDataLink.GetDataset().FieldByName(this.GetDataField());
          fld.SetAsString(this.GetValue());
          this.FDataLink.Modified();
        } catch ($e) {
        };
        this.FEditChange = false;
      };
      this.SyncListSource();
      this.FOnChange = chg;
      if (this.CheckListDataSet()) this.FListLink.GetDataset().EnableControls();
      this.SetItemIndex(idx);
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.IsEnabled = function () {
      var Result = false;
      Result = this.FEnabled && this.CheckDataSet();
      return Result;
    };
    this.DoExit = function () {
      if (!this.FDataLink.FReadOnly) {
        this.FEditChange = true;
        this.FDataLink.UpdateRecord();
      };
      pas["WEBLib.Controls"].TControl.DoExit.call(this);
      this.FEditChange = false;
    };
    this.SyncListSource = function () {
      if ((this.FListLink.FField != null) && (this.FListLink.GetDataset() != null) && this.FListLink.GetDataset().GetActive() && !this.FListLink.GetDataset().IsEmpty() && (this.GetItemIndex() >= 0)) {
        this.FBlockChange = true;
        this.FListLink.GetDataset().First();
        this.FListLink.GetDataset().MoveBy(this.GetItemIndex());
        this.FBlockChange = false;
      };
    };
    this.CreateInitialize = function () {
      if (!(this.FDataLink != null)) {
        this.FDataLink = $mod.TFieldDataLink.$create("Create$1");
        this.FDataLink.FOnUpdateData = rtl.createCallback(this,"DataUpdate");
        this.FDataLink.FOnDataChange = rtl.createCallback(this,"DataChange");
        this.FDataLink.FOnActiveChange = rtl.createCallback(this,"ActiveChange");
        this.FListLink = $mod.TFieldDataLink.$create("Create$1");
        this.FListLink.FOnActiveChange = rtl.createCallback(this,"ListActiveChange");
        this.FListLink.FOnDataChange = rtl.createCallback(this,"ListDataChange");
        this.FListChanging = false;
        this.FEditChange = false;
        this.FBlockChange = false;
      };
      pas["WEBLib.ExtCtrls"].TCustomLookupComboBox.CreateInitialize.call(this);
    };
    this.Destroy = function () {
      rtl.free(this,"FDataLink");
      rtl.free(this,"FListLink");
      pas["WEBLib.ExtCtrls"].TCustomLookupComboBox.Destroy.call(this);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("DataField",3,$mod.$rtti["TDataField"],"GetDataField","SetDataField");
    $r.addProperty("DataSource",3,pas.DB.$rtti["TDataSource"],"GetDataSource","SetDataSource");
    $r.addProperty("KeyField",2,$mod.$rtti["TDataField"],"FKeyField","SetKeyField");
    $r.addProperty("ListField",3,$mod.$rtti["TDataField"],"GetListField","SetListField");
    $r.addProperty("ListSource",3,pas.DB.$rtti["TDataSource"],"GetListSource","SetListSource");
  });
  rtl.createClass(this,"TWebDBLookupComboBox",this.TDBLookupComboBox,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TDBEditAutoComplete",pas["WEBLib.EditAutocomplete"].TEditAutoComplete,function () {
    this.$init = function () {
      pas["WEBLib.EditAutocomplete"].TEditAutoComplete.$init.call(this);
      this.FDataLink = null;
      this.FEditChange = false;
    };
    this.$final = function () {
      this.FDataLink = undefined;
      pas["WEBLib.EditAutocomplete"].TEditAutoComplete.$final.call(this);
    };
    this.SetDataField = function (Value) {
      this.FDataLink.FFieldName = Value;
      this.FDataLink.UpdateField();
      this.ActiveChange(this);
    };
    this.SetDataSource = function (Value) {
      this.FDataLink.SetDataSource(Value);
    };
    this.GetDataSource = function () {
      var Result = null;
      Result = this.FDataLink.FDataSource;
      return Result;
    };
    this.GetDataField = function () {
      var Result = "";
      Result = this.FDataLink.FFieldName;
      return Result;
    };
    this.EditCanModify = function () {
      var Result = false;
      if (this.GetDataSource() != null) {
        Result = !this.FDataLink.GetDataset().ControlsDisabled() && (this.GetDataSource().FAutoEdit || (this.FDataLink.GetDataset().FState in rtl.createSet(pas.DB.TDataSetState.dsEdit,pas.DB.TDataSetState.dsInsert))) && this.FDataLink.Edit()}
       else Result = true;
      return Result;
    };
    this.CheckDataSet = function () {
      var Result = false;
      Result = $impl.CheckDB(this.GetDataSource(),this.GetDataField(),this.FDataLink);
      return Result;
    };
    this.DataUpdate = function (Sender) {
      if (this.FDataLink.FField != null) {
        if (!(this.FDataLink.FField != null)) this.FDataLink.UpdateField();
        this.FDataLink.FField.SetAsString(this.GetText());
      };
    };
    this.DataChange = function (Sender) {
      this.UpdateElement();
      if (this.FEditChange) return;
      if (!(this.GetDataSource() != null)) return;
      if (!(this.FDataLink.GetDataset() != null)) return;
      if (!(this.FDataLink.FField != null)) this.FDataLink.UpdateField();
      if ((this.FDataLink.FField != null) && !this.FDataLink.GetDataset().IsEmpty()) {
        this.SetText(this.FDataLink.FField.GetDisplayText())}
       else this.SetText("");
    };
    this.ActiveChange = function (Sender) {
      this.UpdateElement();
      if (this.FDataLink.GetDataset() != null) {
        if (!this.FDataLink.GetDataset().GetActive() || !this.GetDataSource().FEnabled) {
          this.SetText("");
        } else this.DataChange(this);
      };
    };
    this.KeyDown = function (Key, Shift) {
      var canedit = false;
      if (!this.CheckDataSet()) return;
      if ((Key.get() === 46) || (Key.get() === 8) || ((Key.get() === 45) && (pas.Classes.TShiftState$a.ssShift in Shift))) {
        this.FEditChange = true;
        canedit = this.EditCanModify();
        this.FEditChange = false;
        if (!canedit) {
          Key.set(0);
          pas["WEBLib.Controls"].TControl.KeyDown.apply(this,arguments);
          return;
        } else {
          pas["WEBLib.Controls"].TControl.KeyDown.apply(this,arguments);
          this.FDataLink.Edit();
        };
      } else pas["WEBLib.Controls"].TControl.KeyDown.apply(this,arguments);
    };
    this.KeyPress = function (Key) {
      var canedit = false;
      if (!this.CheckDataSet() || this.FReadOnly) {
        pas["WEBLib.Controls"].TControl.KeyPress.apply(this,arguments);
        return;
      };
      if (this.FDataLink.GetDataset().ControlsDisabled()) {
        this.PreventDefault();
        this.StopPropagation();
        return;
      };
      this.FEditChange = true;
      canedit = this.EditCanModify();
      this.FEditChange = false;
      if (!canedit) return;
      if (this.FDataLink.FReadOnly) {
        Key.set("\x00");
      };
      pas["WEBLib.Controls"].TControl.KeyPress.call(this,Key);
    };
    this.DoExit = function () {
      if (!this.FDataLink.FReadOnly) {
        this.FEditChange = true;
        this.FDataLink.UpdateRecord();
      };
      pas["WEBLib.Controls"].TControl.DoExit.call(this);
      this.FEditChange = false;
    };
    this.CreateInitialize = function () {
      if (!(this.FDataLink != null)) {
        this.FDataLink = $mod.TFieldDataLink.$create("Create$1");
        this.FDataLink.FOnUpdateData = rtl.createCallback(this,"DataUpdate");
        this.FDataLink.FOnDataChange = rtl.createCallback(this,"DataChange");
        this.FDataLink.FOnActiveChange = rtl.createCallback(this,"ActiveChange");
        this.FEditChange = false;
      };
      pas["WEBLib.EditAutocomplete"].TEditAutoComplete.CreateInitialize.call(this);
    };
    this.Destroy = function () {
      rtl.free(this,"FDataLink");
      pas["WEBLib.EditAutocomplete"].TEditAutoComplete.Destroy.call(this);
    };
    this.Change = function () {
      pas["WEBLib.EditAutocomplete"].TEditAutoComplete.Change.call(this);
      if (!this.CheckDataSet()) return;
      if (this.GetDataSource().FAutoEdit || (this.GetDataSource().FDataSet.FState in rtl.createSet(pas.DB.TDataSetState.dsEdit,pas.DB.TDataSetState.dsInsert))) {
        this.FDataLink.Edit();
        this.FDataLink.Modified();
      };
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("DataField",3,$mod.$rtti["TDataField"],"GetDataField","SetDataField");
    $r.addProperty("DataSource",3,pas.DB.$rtti["TDataSource"],"GetDataSource","SetDataSource");
  });
  rtl.createClass(this,"TWebDBEditAutoComplete",this.TDBEditAutoComplete,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TDBRadioGroup",pas["WEBLib.StdCtrls"].TRadioGroup,function () {
    this.$init = function () {
      pas["WEBLib.StdCtrls"].TRadioGroup.$init.call(this);
      this.FDataLink = null;
      this.FEditChange = false;
      this.FValues = null;
    };
    this.$final = function () {
      this.FDataLink = undefined;
      this.FValues = undefined;
      pas["WEBLib.StdCtrls"].TRadioGroup.$final.call(this);
    };
    this.SetValues = function (Value) {
      this.FValues.Assign(Value);
    };
    this.SetDataField = function (Value) {
      this.FDataLink.FFieldName = Value;
      this.FDataLink.UpdateField();
      this.ActiveChange(this);
    };
    this.SetDataSource = function (Value) {
      this.FDataLink.SetDataSource(Value);
    };
    this.GetDataSource = function () {
      var Result = null;
      Result = this.FDataLink.FDataSource;
      return Result;
    };
    this.GetDataField = function () {
      var Result = "";
      Result = this.FDataLink.FFieldName;
      return Result;
    };
    this.CheckDataSet = function () {
      var Result = false;
      Result = $impl.CheckDB(this.GetDataSource(),this.GetDataField(),this.FDataLink);
      return Result;
    };
    this.EditCanModify = function () {
      var Result = false;
      if (this.GetDataSource() != null) {
        Result = !this.FDataLink.GetDataset().ControlsDisabled() && (this.GetDataSource().FAutoEdit || (this.FDataLink.GetDataset().FState in rtl.createSet(pas.DB.TDataSetState.dsEdit,pas.DB.TDataSetState.dsInsert))) && this.FDataLink.Edit()}
       else Result = true;
      return Result;
    };
    this.DataUpdate = function (Sender) {
      if (this.FDataLink.FField != null) {
        if (!(this.FDataLink.FField != null)) this.FDataLink.UpdateField();
        if (this.FDataLink.FField.FDataType === pas.DB.TFieldType.ftString) {
          if (this.FValues.GetCount() > this.GetItemIndex()) this.FDataLink.FField.SetAsString(this.FValues.Get(this.GetItemIndex()));
        } else this.FDataLink.FField.SetAsInteger(this.GetItemIndex() + 1);
      };
    };
    this.DataChange = function (Sender) {
      this.UpdateElement();
      if (this.FEditChange) return;
      if (!(this.FDataLink.GetDataset() != null)) return;
      if (!(this.FDataLink.FField != null)) this.FDataLink.UpdateField();
      if ((this.FDataLink.FField != null) && !this.FDataLink.GetDataset().IsEmpty()) {
        if (this.FDataLink.FField.FDataType === pas.DB.TFieldType.ftString) {
          this.SetItemIndex(this.FValues.IndexOf(this.FDataLink.FField.GetAsString()));
        } else {
          this.SetItemIndex(this.FDataLink.FField.GetAsInteger() - 1);
        };
      } else {
        this.SetItemIndex(-1);
      };
    };
    this.ActiveChange = function (Sender) {
      this.UpdateElement();
      if (this.FDataLink.GetDataset() != null) {
        if (!this.FDataLink.GetDataset().GetActive() || !this.GetDataSource().FEnabled) {
          this.SetItemIndex(-1);
        } else this.DataChange(this);
      };
    };
    this.Click = function () {
      pas["WEBLib.Controls"].TControl.Click.call(this);
      if (!this.CheckDataSet()) return;
      if (this.GetDataSource().FAutoEdit || (this.GetDataSource().FDataSet.FState in rtl.createSet(pas.DB.TDataSetState.dsEdit,pas.DB.TDataSetState.dsInsert))) {
        this.FEditChange = true;
        this.FDataLink.Edit();
        this.FDataLink.Modified();
        this.FEditChange = false;
      };
    };
    this.IsEnabled = function () {
      var Result = false;
      Result = this.FEnabled && this.CheckDataSet() && (this.GetDataSource().FAutoEdit || (this.FDataLink.GetDataset().FState in rtl.createSet(pas.DB.TDataSetState.dsEdit,pas.DB.TDataSetState.dsInsert)));
      return Result;
    };
    this.CreateInitialize = function () {
      if (!(this.FDataLink != null)) {
        this.FDataLink = $mod.TFieldDataLink.$create("Create$1");
        this.FDataLink.FOnUpdateData = rtl.createCallback(this,"DataUpdate");
        this.FDataLink.FOnDataChange = rtl.createCallback(this,"DataChange");
        this.FDataLink.FOnActiveChange = rtl.createCallback(this,"ActiveChange");
        this.FEditChange = false;
      };
      if (!(this.FValues != null)) {
        this.FValues = pas.Classes.TStringList.$create("Create$1");
        this.FValues.SetSkipLastLineBreak(true);
      };
      pas["WEBLib.StdCtrls"].TRadioGroup.CreateInitialize.call(this);
    };
    this.Destroy = function () {
      rtl.free(this,"FValues");
      rtl.free(this,"FDataLink");
      pas["WEBLib.StdCtrls"].TControlGroup.Destroy.call(this);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("DataField",3,$mod.$rtti["TDataField"],"GetDataField","SetDataField");
    $r.addProperty("DataSource",3,pas.DB.$rtti["TDataSource"],"GetDataSource","SetDataSource");
    $r.addProperty("Values",2,pas.Classes.$rtti["TStringList"],"FValues","SetValues");
  });
  rtl.createClass(this,"TWebDBRadioGroup",this.TDBRadioGroup,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TDBLinkLabel",pas["WEBLib.ExtCtrls"].TCustomLinkLabel,function () {
    this.$init = function () {
      pas["WEBLib.ExtCtrls"].TCustomLinkLabel.$init.call(this);
      this.FDataLink = null;
      this.FEditChange = false;
      this.FLinkType = 0;
    };
    this.$final = function () {
      this.FDataLink = undefined;
      pas["WEBLib.ExtCtrls"].TCustomLinkLabel.$final.call(this);
    };
    this.SetDataField = function (Value) {
      this.FDataLink.FFieldName = Value;
      this.FDataLink.UpdateField();
      this.ActiveChange(this);
    };
    this.SetDataSource = function (Value) {
      this.FDataLink.SetDataSource(Value);
    };
    this.GetDataSource = function () {
      var Result = null;
      Result = this.FDataLink.FDataSource;
      return Result;
    };
    this.GetDataField = function () {
      var Result = "";
      Result = this.FDataLink.FFieldName;
      return Result;
    };
    this.CheckDataSet = function () {
      var Result = false;
      Result = $impl.CheckDB(this.GetDataSource(),this.GetDataField(),this.FDataLink);
      return Result;
    };
    this.GetDisplayText = function () {
      var Result = "";
      if (this.CheckDataSet()) {
        Result = pas["WEBLib.ExtCtrls"].TCustomLinkLabel.GetDisplayText.call(this)}
       else {
        if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) Result = this.FName;
      };
      return Result;
    };
    this.EditCanModify = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    this.DataUpdate = function (Sender) {
      if (this.FDataLink.FField != null) {
        if (!(this.FDataLink.FField != null)) this.FDataLink.UpdateField();
      };
    };
    this.DataChange = function (Sender) {
      var url = "";
      var protocol = "";
      var tgt = "";
      if (this.FEditChange) return;
      if (!(this.FDataLink.GetDataset() != null)) return;
      if (!(this.FDataLink.FField != null)) this.FDataLink.UpdateField();
      if ((this.FDataLink.FField != null) && !this.FDataLink.GetDataset().IsEmpty()) {
        var $tmp = this.FLinkType;
        if ($tmp === $mod.TWebLinkType.wlHttp) {
          protocol = "http://"}
         else if ($tmp === $mod.TWebLinkType.wlHttps) {
          protocol = "https://"}
         else if ($tmp === $mod.TWebLinkType.wlMail) {
          protocol = "mailto:"}
         else if ($tmp === $mod.TWebLinkType.wlFTP) protocol = "ftp://";
        tgt = "";
        if (this.FTarget === pas["WEBLib.ExtCtrls"].TLinkTarget.ltNewTab) tgt = ' target="_blank"';
        url = '<a href="' + protocol + this.FDataLink.FField.GetDisplayText() + '"' + tgt + ">" + this.FDataLink.FField.GetDisplayText() + "</a>";
        this.SetCaption(url);
      } else this.SetCaption("");
    };
    this.ActiveChange = function (Sender) {
      if (this.FDataLink.GetDataset() != null) {
        if (!this.FDataLink.GetDataset().GetActive() || !this.GetDataSource().FEnabled) {
          this.SetCaption("");
        } else this.DataChange(this);
      };
    };
    this.Click = function () {
      pas["WEBLib.Controls"].TControl.Click.call(this);
    };
    this.CreateInitialize = function () {
      if (!(this.FDataLink != null)) {
        this.FDataLink = $mod.TFieldDataLink.$create("Create$1");
        this.FDataLink.FOnUpdateData = rtl.createCallback(this,"DataUpdate");
        this.FDataLink.FOnDataChange = rtl.createCallback(this,"DataChange");
        this.FDataLink.FOnActiveChange = rtl.createCallback(this,"ActiveChange");
        this.FEditChange = false;
        this.FLinkType = $mod.TWebLinkType.wlHttp;
      };
      pas["WEBLib.StdCtrls"].TCustomLabel.CreateInitialize.call(this);
    };
    this.Destroy = function () {
      rtl.free(this,"FDataLink");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("DataField",3,$mod.$rtti["TDataField"],"GetDataField","SetDataField");
    $r.addProperty("DataSource",3,pas.DB.$rtti["TDataSource"],"GetDataSource","SetDataSource");
    $r.addProperty("LinkType",0,$mod.$rtti["TWebLinkType"],"FLinkType","FLinkType");
    $r.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",4,{Default: true});
  });
  rtl.createClass(this,"TWebDBLinkLabel",this.TDBLinkLabel,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TDBMemo",pas["WEBLib.StdCtrls"].TMemo,function () {
    this.$init = function () {
      pas["WEBLib.StdCtrls"].TMemo.$init.call(this);
      this.FDataLink = null;
      this.FEditChange = false;
    };
    this.$final = function () {
      this.FDataLink = undefined;
      pas["WEBLib.StdCtrls"].TMemo.$final.call(this);
    };
    this.SetDataField = function (Value) {
      this.FDataLink.FFieldName = Value;
      this.FDataLink.UpdateField();
      this.ActiveChange(this);
    };
    this.SetDataSource = function (Value) {
      this.FDataLink.SetDataSource(Value);
    };
    this.GetDataSource = function () {
      var Result = null;
      Result = this.FDataLink.FDataSource;
      return Result;
    };
    this.GetDataField = function () {
      var Result = "";
      Result = this.FDataLink.FFieldName;
      return Result;
    };
    this.EditCanModify = function () {
      var Result = false;
      if (this.GetDataSource() != null) {
        Result = !this.FDataLink.GetDataset().ControlsDisabled() && (this.GetDataSource().FAutoEdit || (this.FDataLink.GetDataset().FState in rtl.createSet(pas.DB.TDataSetState.dsEdit,pas.DB.TDataSetState.dsInsert))) && this.FDataLink.Edit()}
       else Result = true;
      return Result;
    };
    this.IsReadOnly = function () {
      var Result = false;
      Result = this.FReadOnly || !this.CheckDataSet();
      return Result;
    };
    this.IsEnabled = function () {
      var Result = false;
      Result = this.FEnabled && this.CheckDataSet();
      return Result;
    };
    this.CheckDataSet = function () {
      var Result = false;
      Result = $impl.CheckDB(this.GetDataSource(),this.GetDataField(),this.FDataLink);
      return Result;
    };
    this.GetDisplayText = function () {
      var Result = "";
      if (!this.CheckDataSet()) {
        Result = ""}
       else Result = pas["WEBLib.StdCtrls"].TCustomMemo.GetDisplayText.call(this);
      return Result;
    };
    this.DataUpdate = function (Sender) {
      if (this.FDataLink.FField != null) {
        if (!(this.FDataLink.FField != null)) this.FDataLink.UpdateField();
        if (pas.DB.TBlobField.isPrototypeOf(this.FDataLink.FField) && !pas.DB.TMemoField.isPrototypeOf(this.FDataLink.FField)) {
          this.FDataLink.FField.SetAsJSValue(window.btoa(this.FLines.GetTextStr()));
        } else {
          this.FLines.SetLBS(pas.System.TTextLineBreakStyle.tlbsCR);
          this.FDataLink.FField.SetAsString(this.FLines.GetTextStr());
        };
      };
    };
    this.DataChange = function (Sender) {
      if (this.FEditChange) return;
      this.UpdateSelection();
      this.UpdateElement();
      if (!(this.FDataLink.GetDataset() != null)) return;
      if (!(this.FDataLink.FField != null)) this.FDataLink.UpdateField();
      if ((this.FDataLink.FField != null) && !this.FDataLink.GetDataset().IsEmpty()) {
        if (pas.DB.TBlobField.isPrototypeOf(this.FDataLink.FField) && !pas.DB.TMemoField.isPrototypeOf(this.FDataLink.FField)) {
          try {
            this.FLines.SetTextStr(window.atob("" + this.FDataLink.FField.GetAsJSValue()));
          } catch ($e) {
            this.FLines.SetTextStr(this.FDataLink.FField.GetDisplayText());
          };
        } else {
          this.FLines.SetTextStr(this.FDataLink.FField.GetDisplayText());
        };
      } else this.FLines.SetTextStr("");
    };
    this.ActiveChange = function (Sender) {
      this.UpdateElement();
      if (this.FDataLink.GetDataset() != null) {
        if (!this.FDataLink.GetDataset().GetActive() || !this.GetDataSource().FEnabled) {
          this.FLines.SetTextStr("")}
         else this.DataChange(this);
      };
    };
    this.KeyDown = function (Key, Shift) {
      var canedit = false;
      if (!this.CheckDataSet()) return;
      if ((Key.get() === 46) || (Key.get() === 8) || ((Key.get() === 45) && (pas.Classes.TShiftState$a.ssShift in Shift))) {
        this.FEditChange = true;
        canedit = this.EditCanModify();
        this.FEditChange = false;
        if (!canedit) {
          Key.set(0);
          pas["WEBLib.Controls"].TControl.KeyDown.apply(this,arguments);
          return;
        } else {
          pas["WEBLib.Controls"].TControl.KeyDown.apply(this,arguments);
          this.FDataLink.Edit();
        };
      };
    };
    this.KeyPress = function (Key) {
      var canedit = false;
      if (!this.CheckDataSet() || this.FReadOnly) return;
      if (this.FDataLink.GetDataset().ControlsDisabled()) {
        this.PreventDefault();
        this.StopPropagation();
        return;
      };
      this.FEditChange = true;
      canedit = this.EditCanModify();
      this.FEditChange = false;
      if (!canedit) return;
      if (this.FDataLink.FReadOnly) {
        Key.set("\x00");
      };
      pas["WEBLib.Controls"].TControl.KeyPress.call(this,Key);
    };
    this.CanPaste = function (AValue) {
      var Result = false;
      Result = this.CanCut();
      return Result;
    };
    this.CanCut = function () {
      var Result = false;
      var canedit = false;
      if (!this.CheckDataSet()) return Result;
      if (this.FReadOnly) {
        Result = false;
        return Result;
      };
      this.FEditChange = true;
      canedit = this.EditCanModify();
      this.FEditChange = false;
      if (!canedit) {
        Result = false;
        return Result;
      } else {
        Result = pas["WEBLib.StdCtrls"].TCustomMemo.CanCut.call(this);
        this.FDataLink.Edit();
      };
      return Result;
    };
    this.DoExit = function () {
      if (!this.FDataLink.FReadOnly) {
        this.FEditChange = true;
        this.FDataLink.UpdateRecord();
      };
      pas["WEBLib.Controls"].TControl.DoExit.call(this);
      this.FEditChange = false;
    };
    this.Change = function () {
      pas["WEBLib.StdCtrls"].TCustomMemo.Change.call(this);
      if (!this.CheckDataSet()) return;
      if (this.GetDataSource().FAutoEdit || (this.GetDataSource().FDataSet.FState in rtl.createSet(pas.DB.TDataSetState.dsEdit,pas.DB.TDataSetState.dsInsert))) {
        this.FEditChange = true;
        this.FDataLink.Edit();
        this.FDataLink.Modified();
        this.FEditChange = false;
      };
    };
    this.CreateInitialize = function () {
      if (!(this.FDataLink != null)) {
        this.FDataLink = $mod.TFieldDataLink.$create("Create$1");
        this.FDataLink.FOnUpdateData = rtl.createCallback(this,"DataUpdate");
        this.FDataLink.FOnDataChange = rtl.createCallback(this,"DataChange");
        this.FDataLink.FOnActiveChange = rtl.createCallback(this,"ActiveChange");
        this.FEditChange = false;
      };
      pas["WEBLib.StdCtrls"].TCustomMemo.CreateInitialize.call(this);
    };
    this.Destroy = function () {
      rtl.free(this,"FDataLink");
      pas["WEBLib.StdCtrls"].TCustomMemo.Destroy.call(this);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("DataField",3,$mod.$rtti["TDataField"],"GetDataField","SetDataField");
    $r.addProperty("DataSource",3,pas.DB.$rtti["TDataSource"],"GetDataSource","SetDataSource");
  });
  rtl.createClass(this,"TWebDBMemo",this.TDBMemo,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.$rtti.$MethodVar("TSetURLEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["AURL",rtl.string,1]]), methodkind: 0});
  rtl.createClass(this,"TDBImageControl",pas["WEBLib.ExtCtrls"].TCustomImageControl,function () {
    this.$init = function () {
      pas["WEBLib.ExtCtrls"].TCustomImageControl.$init.call(this);
      this.FDataLink = null;
      this.FOnSetURL = null;
      this.FBaseURL = "";
    };
    this.$final = function () {
      this.FDataLink = undefined;
      this.FOnSetURL = undefined;
      pas["WEBLib.ExtCtrls"].TCustomImageControl.$final.call(this);
    };
    this.GetDataField = function () {
      var Result = "";
      Result = this.FDataLink.FFieldName;
      return Result;
    };
    this.GetDataSource = function () {
      var Result = null;
      Result = this.FDataLink.FDataSource;
      return Result;
    };
    this.SetDataField = function (Value) {
      this.FDataLink.FFieldName = Value;
      this.FDataLink.UpdateField();
      this.ActiveChange(this);
    };
    this.SetDataSource = function (Value) {
      this.FDataLink.SetDataSource(Value);
    };
    this.DataChange = function (Sender) {
      var AURL = "";
      var LContents = "";
      if (!(this.FDataLink.GetDataset() != null)) return;
      if (!(this.FDataLink.FField != null)) this.FDataLink.UpdateField();
      if ((this.FDataLink.FField != null) && !this.FDataLink.GetDataset().IsEmpty()) {
        if (pas.DB.TBlobField.isPrototypeOf(this.FDataLink.FField)) {
          LContents = "" + this.FDataLink.FField.GetAsJSValue();
          if ((LContents.length > 0) && (LContents !== "null")) {
            AURL = "data:image/jpeg;base64," + LContents;
          } else {
            AURL = pas["WEBLib.WebTools"].EmptyImage();
          };
        } else {
          AURL = this.FBaseURL + this.FDataLink.FField.GetDisplayText();
        };
        if (this.FOnSetURL != null) this.FOnSetURL(this,{get: function () {
            return AURL;
          }, set: function (v) {
            AURL = v;
          }});
        this.SetURL(AURL);
      };
    };
    this.ActiveChange = function (Sender) {
      if (this.FDataLink.GetDataset() != null) {
        if (!this.FDataLink.GetDataset().GetActive() || !this.GetDataSource().FEnabled) {
          this.SetURL("")}
         else this.DataChange(this);
      };
    };
    this.CreateInitialize = function () {
      if (!(this.FDataLink != null)) {
        this.FDataLink = $mod.TFieldDataLink.$create("Create$1");
        this.FDataLink.FOnDataChange = rtl.createCallback(this,"DataChange");
        this.FDataLink.FOnActiveChange = rtl.createCallback(this,"ActiveChange");
      };
      pas["WEBLib.ExtCtrls"].TCustomImageControl.CreateInitialize.call(this);
    };
    this.Destroy = function () {
      rtl.free(this,"FDataLink");
      pas["WEBLib.ExtCtrls"].TCustomImageControl.Destroy.call(this);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("BaseURL",0,rtl.string,"FBaseURL","FBaseURL");
    $r.addProperty("DataField",3,$mod.$rtti["TDataField"],"GetDataField","SetDataField");
    $r.addProperty("DataSource",3,pas.DB.$rtti["TDataSource"],"GetDataSource","SetDataSource");
    $r.addProperty("OnSetURL",0,$mod.$rtti["TSetURLEvent"],"FOnSetURL","FOnSetURL");
  });
  rtl.createClass(this,"TWebDBImageControl",this.TDBImageControl,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TDBNavigator",pas["WEBLib.Buttons"].TToolBar,function () {
    this.$init = function () {
      pas["WEBLib.Buttons"].TToolBar.$init.call(this);
      this.FDataLink = null;
      this.FFirstBtn = null;
      this.FPriorBtn = null;
      this.FNextBtn = null;
      this.FLastBtn = null;
      this.FEditBtn = null;
      this.FPostBtn = null;
      this.FInsertBtn = null;
      this.FDeleteBtn = null;
      this.FCancelBtn = null;
      this.FVisibleButtons = {};
      this.FHints = null;
      this.FImages = null;
      this.FBtnID = "";
      this.FOnDelete = null;
      this.FOnInsert = null;
      this.FOnPost = null;
      this.FOnFirst = null;
      this.FOnEdit = null;
      this.FOnNext = null;
      this.FOnLast = null;
      this.FOnPrior = null;
      this.FMaterialGlyphColor = 0;
    };
    this.$final = function () {
      this.FDataLink = undefined;
      this.FFirstBtn = undefined;
      this.FPriorBtn = undefined;
      this.FNextBtn = undefined;
      this.FLastBtn = undefined;
      this.FEditBtn = undefined;
      this.FPostBtn = undefined;
      this.FInsertBtn = undefined;
      this.FDeleteBtn = undefined;
      this.FCancelBtn = undefined;
      this.FVisibleButtons = undefined;
      this.FHints = undefined;
      this.FImages = undefined;
      this.FOnDelete = undefined;
      this.FOnInsert = undefined;
      this.FOnPost = undefined;
      this.FOnFirst = undefined;
      this.FOnEdit = undefined;
      this.FOnNext = undefined;
      this.FOnLast = undefined;
      this.FOnPrior = undefined;
      pas["WEBLib.Buttons"].TToolBar.$final.call(this);
    };
    this.SetVisibleButtons = function (Value) {
      this.FVisibleButtons = rtl.refSet(Value);
      this.UpdateButtons();
    };
    this.SetHints = function (Value) {
      this.FHints.Assign(Value);
      this.UpdateButtons();
    };
    this.SetImages = function (Value) {
      this.FImages.Assign(Value);
      this.UpdateButtons();
    };
    this.SetMaterialGlyphColor = function (Value) {
      if (this.FMaterialGlyphColor !== Value) {
        this.FMaterialGlyphColor = Value;
        this.UpdateButtons();
      };
    };
    this.UpdateButtons = function () {
      if ((this.FDataLink != null) && (this.FDataLink.FDataSource != null) && (this.FDataLink.FDataSource.FDataSet != null) && pas.System.Assigned(this.FDataLink.FDataSource.FDataSet.GetActive())) {
        this.FFirstBtn.SetEnabled(this.FEnabled && this.FDataLink.GetDataset().GetActive() && !this.FDataLink.GetDataset().GetBOF());
        this.FPriorBtn.SetEnabled(this.FEnabled && this.FDataLink.GetDataset().GetActive() && !this.FDataLink.GetDataset().GetBOF());
        this.FNextBtn.SetEnabled(this.FEnabled && this.FDataLink.GetDataset().GetActive() && !this.FDataLink.GetDataset().GetEOF());
        this.FLastBtn.SetEnabled(this.FEnabled && this.FDataLink.GetDataset().GetActive() && !this.FDataLink.GetDataset().GetEOF());
        this.FPostBtn.SetEnabled(this.FEnabled && this.FDataLink.GetDataset().GetActive() && (this.FDataLink.GetDataset().FState in rtl.createSet(pas.DB.TDataSetState.dsEdit,pas.DB.TDataSetState.dsInsert)));
        this.FEditBtn.SetEnabled(this.FEnabled && this.FDataLink.GetDataset().GetActive() && (this.FDataLink.GetDataset().FState === pas.DB.TDataSetState.dsBrowse) && !this.FDataLink.GetDataset().IsEmpty());
        this.FInsertBtn.SetEnabled(this.FEnabled && this.FDataLink.GetDataset().GetActive() && !(this.FDataLink.GetDataset().FState === pas.DB.TDataSetState.dsInsert));
        this.FDeleteBtn.SetEnabled(this.FEnabled && this.FDataLink.GetDataset().GetActive() && !this.FDataLink.GetDataset().IsEmpty());
        this.FCancelBtn.SetEnabled(this.FEnabled && this.FDataLink.GetDataset().GetActive() && (this.FDataLink.GetDataset().FState in rtl.createSet(pas.DB.TDataSetState.dsInsert,pas.DB.TDataSetState.dsEdit)));
      } else {
        this.FFirstBtn.SetEnabled(false);
        this.FPriorBtn.SetEnabled(false);
        this.FNextBtn.SetEnabled(false);
        this.FLastBtn.SetEnabled(false);
        this.FEditBtn.SetEnabled(false);
        this.FPostBtn.SetEnabled(false);
        this.FInsertBtn.SetEnabled(false);
        this.FDeleteBtn.SetEnabled(false);
        this.FCancelBtn.SetEnabled(false);
      };
      this.FFirstBtn.SetVisible($mod.TNavigateBtn.nbFirst in this.FVisibleButtons);
      this.FPriorBtn.SetVisible($mod.TNavigateBtn.nbPrior in this.FVisibleButtons);
      this.FNextBtn.SetVisible($mod.TNavigateBtn.nbNext in this.FVisibleButtons);
      this.FLastBtn.SetVisible($mod.TNavigateBtn.nbLast in this.FVisibleButtons);
      this.FEditBtn.SetVisible($mod.TNavigateBtn.nbEdit in this.FVisibleButtons);
      this.FPostBtn.SetVisible($mod.TNavigateBtn.nbPost in this.FVisibleButtons);
      this.FInsertBtn.SetVisible($mod.TNavigateBtn.nbInsert in this.FVisibleButtons);
      this.FDeleteBtn.SetVisible($mod.TNavigateBtn.nbDelete in this.FVisibleButtons);
      this.FCancelBtn.SetVisible($mod.TNavigateBtn.nbCancel in this.FVisibleButtons);
      this.FFirstBtn.SetMaterialGyphColor(this.FMaterialGlyphColor);
      this.FPriorBtn.SetMaterialGyphColor(this.FMaterialGlyphColor);
      this.FNextBtn.SetMaterialGyphColor(this.FMaterialGlyphColor);
      this.FLastBtn.SetMaterialGyphColor(this.FMaterialGlyphColor);
      this.FEditBtn.SetMaterialGyphColor(this.FMaterialGlyphColor);
      this.FPostBtn.SetMaterialGyphColor(this.FMaterialGlyphColor);
      this.FInsertBtn.SetMaterialGyphColor(this.FMaterialGlyphColor);
      this.FDeleteBtn.SetMaterialGyphColor(this.FMaterialGlyphColor);
      this.FCancelBtn.SetMaterialGyphColor(this.FMaterialGlyphColor);
      while (this.FHints.GetCount() < 9) this.FHints.Add("");
      this.FFirstBtn.SetHint(this.FHints.Get(0));
      this.FPriorBtn.SetHint(this.FHints.Get(1));
      this.FNextBtn.SetHint(this.FHints.Get(2));
      this.FLastBtn.SetHint(this.FHints.Get(3));
      this.FEditBtn.SetHint(this.FHints.Get(4));
      this.FPostBtn.SetHint(this.FHints.Get(5));
      this.FInsertBtn.SetHint(this.FHints.Get(6));
      this.FDeleteBtn.SetHint(this.FHints.Get(7));
      this.FCancelBtn.SetHint(this.FHints.Get(8));
      this.UpdateImage(this.FFirstBtn,"&#xE5DC;",0);
      this.UpdateImage(this.FPriorBtn,"&#xE5CB;",1);
      this.UpdateImage(this.FNextBtn,"&#xE5CC;",2);
      this.UpdateImage(this.FLastBtn,"&#xE5DD;",3);
      this.UpdateImage(this.FEditBtn,"&#xE5C7;",4);
      this.UpdateImage(this.FPostBtn,"&#xE5CA;",5);
      this.UpdateImage(this.FInsertBtn,"&#xE145;",6);
      this.UpdateImage(this.FDeleteBtn,"&#xE15B;",7);
      this.UpdateImage(this.FCancelBtn,"&#xE14C;",8);
    };
    this.DataChange = function (Sender) {
      this.UpdateButtons();
    };
    this.ActiveChange = function (Sender) {
      this.UpdateButtons();
    };
    this.SetDataSource = function (Value) {
      this.FDataLink.SetDataSource(Value);
    };
    this.GetDataSource = function () {
      var Result = null;
      Result = this.FDataLink.FDataSource;
      return Result;
    };
    this.CreateButton = function (btn, BtnID, Glyph, Index) {
      btn.set(pas["WEBLib.Buttons"].TSpeedButton.$create("Create$2",[BtnID]));
      btn.get().SetFlat(true);
      btn.get().SetParent(this);
      if ((this.FImages.GetCount() > Index) && (this.FImages.Get(Index) !== "")) {
        btn.get().SetGlyphURL(this.FImages.Get(Index))}
       else btn.get().SetMaterialGlyph(Glyph);
      btn.get().SetWidth(32);
      btn.get().SetHeight(24);
      btn.get().SetAlign(pas["WEBLib.Controls"].TAlign.alLeft);
      if (this.FHints.GetCount() > Index) {
        btn.get().SetHint(this.FHints.Get(Index));
      };
      btn.get().SetShowHint((this.FHints.GetCount() > Index) && (btn.get().FHint !== ""));
      btn.get().FOnClick = rtl.createCallback(this,"HandleSpeedButtonClick");
      btn.get().FOnMouseDown = rtl.createCallback(this,"HandleSpeedButtonMouseDown");
      btn.get().SetMaterialGyphColor(this.FMaterialGlyphColor);
    };
    this.UpdateImage = function (btn, Glyph, Index) {
      if ((this.FImages.GetCount() > Index) && (this.FImages.Get(Index) !== "")) {
        btn.SetMaterialGlyph("");
        btn.SetGlyphURL(this.FImages.Get(Index));
      } else {
        btn.SetMaterialGlyph(Glyph);
        btn.SetGlyphURL("");
      };
    };
    this.HandleSpeedButtonClick = function (Sender) {
      var BID = "";
      if ((this.GetDataSource() != null) && (this.GetDataSource().FDataSet != null)) {
        BID = Sender.GetID();
        if (BID === (this.FBtnID + "_first")) {
          this.DoFirst();
          this.FDataLink.GetDataset().First();
        };
        if (BID === (this.FBtnID + "_prior")) {
          this.DoPrior();
          this.FDataLink.GetDataset().Prior();
        };
        if (BID === (this.FBtnID + "_next")) {
          this.DoNext();
          this.FDataLink.GetDataset().Next();
        };
        if (BID === (this.FBtnID + "_last")) {
          this.DoLast();
          this.FDataLink.GetDataset().Last();
        };
        if (BID === (this.FBtnID + "_edit")) {
          this.DoEdit();
          this.FDataLink.GetDataset().Edit();
        };
        if (BID === (this.FBtnID + "_insert")) {
          this.DoInsert();
          this.FDataLink.GetDataset().Insert$1();
        };
        if (BID === (this.FBtnID + "_delete")) {
          this.DoDelete();
          this.FDataLink.GetDataset().Delete();
        };
        if (BID === (this.FBtnID + "_post")) {
          this.DoPost();
          this.FDataLink.GetDataset().Post();
        };
        if (BID === (this.FBtnID + "_cancel")) this.FDataLink.GetDataset().Cancel();
      };
    };
    this.HandleSpeedButtonMouseDown = function (Sender, Button, Shift, X, Y) {
      this.SetFocus();
    };
    this.UpdateElement = function () {
      pas["WEBLib.Buttons"].TCustomToolBar.UpdateElement.call(this);
      if (!this.IsUpdating()) this.AddControlLink("googlematerial","https://fonts.googleapis.com/icon?family=Material+Icons");
    };
    this.Loaded = function () {
      pas["WEBLib.Controls"].TCustomControl.Loaded.call(this);
      this.UpdateButtons();
    };
    this.GetChildren = function (Proc, Root) {
    };
    this.SetEnabled = function (Value) {
      pas["WEBLib.Controls"].TControl.SetEnabled.apply(this,arguments);
      this.UpdateButtons();
    };
    this.DoPost = function () {
      if (this.FOnPost != null) this.FOnPost(this);
    };
    this.DoDelete = function () {
      if (this.FOnDelete != null) this.FOnDelete(this);
    };
    this.DoInsert = function () {
      if (this.FOnInsert != null) this.FOnInsert(this);
    };
    this.DoFirst = function () {
      if (this.FOnFirst != null) this.FOnFirst(this);
    };
    this.DoLast = function () {
      if (this.FOnLast != null) this.FOnLast(this);
    };
    this.DoEdit = function () {
      if (this.FOnEdit != null) this.FOnEdit(this);
    };
    this.DoNext = function () {
      if (this.FOnNext != null) this.FOnNext(this);
    };
    this.DoPrior = function () {
      if (this.FOnPrior != null) this.FOnPrior(this);
    };
    this.CreateInitialize = function () {
      var css = "";
      pas["WEBLib.Buttons"].TCustomToolBar.CreateInitialize.call(this);
      this.FControlStyle = rtl.diffSet(this.FControlStyle,rtl.createSet(pas["WEBLib.Controls"].TControlStyleValue.csAcceptsControls));
      css = ".material-icons.md-18 { font-size: 18px; }" + ".material-icons.md-24 { font-size: 24px; }" + ".material-icons.md-36 { font-size: 36px; }" + ".material-icons.md-48 { font-size: 48px; }" + ".material-icons.md-dark { color: rgba(0, 0, 0, 0.54); }" + ".material-icons.md-dark.md-inactive { color: rgba(255, 0, 0, 1); }" + ".material-icons.md-light { color: rgba(255, 255, 255, 1); }" + ".material-icons.md-light.md-inactive { color: rgba(128, 128, 128, 1); }";
      this.AddControlStyle(css);
      this.SetWidth(32 * 9);
      this.FMaterialGlyphColor = -1;
      this.FImages = pas.Classes.TStringList.$create("Create$1");
      this.FHints = pas.Classes.TStringList.$create("Create$1");
      this.FHints.Add("First");
      this.FHints.Add("Prior");
      this.FHints.Add("Next");
      this.FHints.Add("Last");
      this.FHints.Add("Edit");
      this.FHints.Add("Post");
      this.FHints.Add("Insert");
      this.FHints.Add("Delete");
      this.FHints.Add("Cancel");
      if (!(this.FDataLink != null)) {
        this.FDataLink = $mod.TFieldDataLink.$create("Create$1");
        this.FDataLink.FOnDataChange = rtl.createCallback(this,"DataChange");
        this.FDataLink.FOnActiveChange = rtl.createCallback(this,"ActiveChange");
      };
      this.FBtnID = pas["WEBLib.Controls"].FindUniqueName("DBNavBtn");
      this.CreateButton({p: this, get: function () {
          return this.p.FFirstBtn;
        }, set: function (v) {
          this.p.FFirstBtn = v;
        }},this.FBtnID + "_first","&#xE5DC;",0);
      this.CreateButton({p: this, get: function () {
          return this.p.FPriorBtn;
        }, set: function (v) {
          this.p.FPriorBtn = v;
        }},this.FBtnID + "_prior","&#xE5CB;",1);
      this.CreateButton({p: this, get: function () {
          return this.p.FNextBtn;
        }, set: function (v) {
          this.p.FNextBtn = v;
        }},this.FBtnID + "_next","&#xE5CC;",2);
      this.CreateButton({p: this, get: function () {
          return this.p.FLastBtn;
        }, set: function (v) {
          this.p.FLastBtn = v;
        }},this.FBtnID + "_last","&#xE5DD;",3);
      this.CreateButton({p: this, get: function () {
          return this.p.FEditBtn;
        }, set: function (v) {
          this.p.FEditBtn = v;
        }},this.FBtnID + "_edit","&#xE5C7;",4);
      this.CreateButton({p: this, get: function () {
          return this.p.FPostBtn;
        }, set: function (v) {
          this.p.FPostBtn = v;
        }},this.FBtnID + "_post","&#xE5CA;",5);
      this.CreateButton({p: this, get: function () {
          return this.p.FInsertBtn;
        }, set: function (v) {
          this.p.FInsertBtn = v;
        }},this.FBtnID + "_insert","&#xE145;",6);
      this.CreateButton({p: this, get: function () {
          return this.p.FDeleteBtn;
        }, set: function (v) {
          this.p.FDeleteBtn = v;
        }},this.FBtnID + "_delete","&#xE15B;",7);
      this.CreateButton({p: this, get: function () {
          return this.p.FCancelBtn;
        }, set: function (v) {
          this.p.FCancelBtn = v;
        }},this.FBtnID + "_cancel","&#xE14C;",8);
      this.FVisibleButtons = rtl.createSet($mod.TNavigateBtn.nbFirst,$mod.TNavigateBtn.nbPrior,$mod.TNavigateBtn.nbNext,$mod.TNavigateBtn.nbLast,$mod.TNavigateBtn.nbInsert,$mod.TNavigateBtn.nbDelete,$mod.TNavigateBtn.nbEdit,$mod.TNavigateBtn.nbPost,$mod.TNavigateBtn.nbCancel);
      this.UpdateButtons();
    };
    this.Destroy = function () {
      rtl.free(this,"FDataLink");
      rtl.free(this,"FHints");
      rtl.free(this,"FImages");
      pas["WEBLib.Controls"].TCustomControl.Destroy.call(this);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",4,{Default: true});
    $r.addProperty("Hints",2,pas.Classes.$rtti["TStringList"],"FHints","SetHints");
    $r.addProperty("Images",2,pas.Classes.$rtti["TStringList"],"FImages","SetImages");
    $r.addProperty("MaterialGlyphColor",2,pas["WEBLib.Graphics"].$rtti["TColor"],"FMaterialGlyphColor","SetMaterialGlyphColor",4,{Default: -1});
    $r.addProperty("DataSource",3,pas.DB.$rtti["TDataSource"],"GetDataSource","SetDataSource");
    $r.addProperty("VisibleButtons",2,$mod.$rtti["TNavButtonSet"],"FVisibleButtons","SetVisibleButtons");
    $r.addProperty("OnDelete",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnDelete","FOnDelete");
    $r.addProperty("OnEdit",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnEdit","FOnEdit");
    $r.addProperty("OnFirst",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnFirst","FOnFirst");
    $r.addProperty("OnInsert",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnInsert","FOnInsert");
    $r.addProperty("OnLast",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnLast","FOnLast");
    $r.addProperty("OnNext",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnNext","FOnNext");
    $r.addProperty("OnPost",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnPost","FOnPost");
    $r.addProperty("OnPrior",0,pas["WEBLib.Controls"].$rtti["TNotifyEvent"],"FOnPrior","FOnPrior");
  });
  rtl.createClass(this,"TWebDBNavigator",this.TDBNavigator,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.$rtti.$MethodVar("TListItemFieldValueEvent",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["Index",rtl.longint],["AFieldName",rtl.string],["AValue",rtl.string,1]]), methodkind: 0});
  rtl.createClass(this,"TDBListControl",pas["WEBLib.Lists"].TListControl,function () {
    this.$init = function () {
      pas["WEBLib.Lists"].TListControl.$init.call(this);
      this.FDataLink = null;
      this.FListLink = null;
      this.FItemTemplate = "";
      this.FOnListItemGetFieldValue = null;
    };
    this.$final = function () {
      this.FDataLink = undefined;
      this.FListLink = undefined;
      this.FOnListItemGetFieldValue = undefined;
      pas["WEBLib.Lists"].TListControl.$final.call(this);
    };
    this.GetDataSource = function () {
      var Result = null;
      Result = this.FDataLink.FDataSource;
      return Result;
    };
    this.GetListSource = function () {
      var Result = null;
      Result = this.FListLink.FDataSource;
      return Result;
    };
    this.SetDataField = function (Value) {
      this.FDataLink.FFieldName = Value;
      this.ActiveChange(this);
    };
    this.SetDataSource = function (Value) {
      this.FDataLink.SetDataSource(Value);
    };
    this.SetListField = function (Value) {
      this.FListLink.FFieldName = Value;
      this.ActiveChange(this);
    };
    this.SetListSource = function (Value) {
      this.FListLink.SetDataSource(Value);
    };
    this.SetItemTemplate = function (Value) {
      this.FItemTemplate = Value;
    };
    this.GetDataField = function () {
      var Result = "";
      Result = this.FDataLink.FFieldName;
      return Result;
    };
    this.GetListField = function () {
      var Result = "";
      Result = this.FListLink.FFieldName;
      return Result;
    };
    this.RecordChange = function (Sender) {
      var i = 0;
      var dt = "";
      if (this.FAutoSelect) {
        if ((this.FDataLink.GetDataset() != null) && this.FDataLink.GetDataset().GetActive() && !this.FDataLink.GetDataset().IsEmpty()) {
          if (this.GetListSource() === this.GetDataSource()) {
            this.SetItemIndex(this.FDataLink.GetDataset().GetRecNo() - 1)}
           else if (this.GetDataField() !== "") {
            dt = this.FDataLink.GetDataset().FieldByName(this.GetDataField()).GetDisplayText();
            for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
              i = $l;
              if (this.FItems.GetItem$1(i).FData === dt) {
                this.SetItemIndex(i);
                break;
              } else if (this.FItems.GetItem$1(i).FText === dt) {
                this.SetItemIndex(i);
                break;
              };
            };
          };
        };
      };
    };
    this.DataUpdate = function (Sender) {
    };
    this.DataChange = function (Sender) {
    };
    this.ActiveChange = function (Sender) {
    };
    this.ListActiveChange = function (Sender) {
      var fld = null;
      var bk = pas.DB.TBookmark.$new();
      var itemtext = "";
      var ident = "";
      var html = "";
      var htmlvalue = "";
      var c = 0;
      var itm = null;
      var ne = null;
      if (!(this.GetListSource() != null)) return;
      if ((this.FListLink.GetDataset() != null) && this.FListLink.GetDataset().GetActive() && !this.FListLink.GetDataset().IsEmpty()) {
        fld = null;
        if (this.FListLink.FFieldName !== "") fld = this.FListLink.GetDataset().FieldByName(this.FListLink.FFieldName);
        if ((fld != null) || (this.FItemTemplate !== "")) {
          this.FListLink.GetDataset().DisableControls();
          bk.$assign(this.FListLink.GetDataset().GetBookmark());
          this.FItems.Clear();
          ne = this.FListLink.GetDataset().FAfterScroll;
          this.FListLink.GetDataset().FAfterScroll = null;
          this.FListLink.GetDataset().First();
          while (!this.FListLink.GetDataset().GetEOF()) {
            itm = this.FItems.Add$1();
            if (this.FItemTemplate !== "") {
              html = this.FItemTemplate;
              if (fld != null) {
                itm.FData = fld.GetDisplayText();
              };
              for (var $l = 0, $end = this.FListLink.FDataSource.FDataSet.FFieldList.GetCount() - 1; $l <= $end; $l++) {
                c = $l;
                ident = "(%" + this.FListLink.FDataSource.FDataSet.FFieldList.GetField(c).FFieldName + "%)";
                if (pas.System.Pos(pas.SysUtils.UpperCase(ident),pas.SysUtils.UpperCase(html)) > 0) {
                  htmlvalue = this.FListLink.FDataSource.FDataSet.FFieldList.GetField(c).GetDisplayText();
                  this.DoItemGetFieldValue(itm.GetIndex(),this.FListLink.FDataSource.FDataSet.FFieldList.GetField(c).FFieldName,{get: function () {
                      return htmlvalue;
                    }, set: function (v) {
                      htmlvalue = v;
                    }});
                  html = pas.SysUtils.StringReplace(html,ident,htmlvalue,rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll,pas.SysUtils.TStringReplaceFlag.rfIgnoreCase));
                };
              };
              itemtext = html;
            } else {
              itemtext = fld.GetDisplayText();
            };
            itm.SetText(itemtext);
            this.FListLink.GetDataset().Next();
          };
          this.FListLink.GetDataset().GotoBookmark(bk);
          this.FListLink.GetDataset().FAfterScroll = ne;
          this.FListLink.GetDataset().EnableControls();
        };
      };
    };
    this.DoItemGetFieldValue = function (Index, AFieldName, AValue) {
      if (this.FOnListItemGetFieldValue != null) this.FOnListItemGetFieldValue(this,Index,AFieldName,AValue);
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Lists"].TListControl.CreateInitialize.call(this);
      if (!(this.FDataLink != null)) {
        this.FDataLink = $mod.TDBDataLink.$create("Create$1");
        this.FDataLink.FOnUpdateData = rtl.createCallback(this,"DataUpdate");
        this.FDataLink.FOnDataChange = rtl.createCallback(this,"DataChange");
        this.FDataLink.FOnActiveChange = rtl.createCallback(this,"ActiveChange");
        this.FDataLink.FOnRecordChange = rtl.createCallback(this,"RecordChange");
        this.FListLink = $mod.TDBDataLink.$create("Create$1");
        this.FListLink.FOnActiveChange = rtl.createCallback(this,"ListActiveChange");
      };
    };
    this.Destroy = function () {
      rtl.free(this,"FDataLink");
      rtl.free(this,"FListLink");
      pas["WEBLib.Lists"].TListControl.Destroy.call(this);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TWebDBListControl",this.TDBListControl,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  this.TColumnDataType = {"0": "cdText", cdText: 0, "1": "cdImage", cdImage: 1, "2": "cdLink", cdLink: 2, "3": "cdCheck", cdCheck: 3, "4": "cdRadio", cdRadio: 4, "5": "cdExternalLink", cdExternalLink: 5, "6": "cdMemo", cdMemo: 6};
  this.$rtti.$Enum("TColumnDataType",{minvalue: 0, maxvalue: 6, ordtype: 1, enumtype: this.TColumnDataType});
  this.$rtti.$Class("TDBTableControl");
  rtl.createClass(this,"TTableControlColumn",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FDataField = "";
      this.FTitle = "";
      this.FDataType = 0;
      this.FClassName$1 = "";
      this.FTitleClassName = "";
      this.FTag = 0;
      this.FWidth = 0;
    };
    this.SetDataField = function (Value) {
      if (this.FDataField !== Value) {
        this.FDataField = Value;
        rtl.as(this.FCollection,$mod.TTableControlColumns).Update(this);
      };
    };
    this.SetTitle = function (Value) {
      if (this.FTitle !== Value) {
        this.FTitle = Value;
        rtl.as(this.FCollection,$mod.TTableControlColumns).Update(this);
      };
    };
    this.SetWidth = function (Value) {
      this.FWidth = Value;
      rtl.as(rtl.as(this.FCollection,$mod.TTableControlColumns).Owner(),$mod.TDBTableControl).SetColWidth(this.GetIndex(),this.FWidth);
    };
    this.Assign = function (Source) {
      if ($mod.TTableControlColumn.isPrototypeOf(Source)) {
        this.FClassName$1 = rtl.as(Source,$mod.TTableControlColumn).FClassName$1;
        this.FDataField = rtl.as(Source,$mod.TTableControlColumn).FDataField;
        this.FTitle = rtl.as(Source,$mod.TTableControlColumn).FTitle;
        this.FTitleClassName = rtl.as(Source,$mod.TTableControlColumn).FTitleClassName;
        this.FDataType = rtl.as(Source,$mod.TTableControlColumn).FDataType;
        this.FTag = rtl.as(Source,$mod.TTableControlColumn).FTag;
        this.FWidth = rtl.as(Source,$mod.TTableControlColumn).FWidth;
      };
    };
    var $r = this.$rtti;
    $r.addProperty("ElementClassName",0,rtl.string,"FClassName$1","FClassName$1");
    $r.addProperty("DataField",2,$mod.$rtti["TDataField"],"FDataField","SetDataField");
    $r.addProperty("Title",2,rtl.string,"FTitle","SetTitle");
    $r.addProperty("TitleElementClassName",0,rtl.string,"FTitleClassName","FTitleClassName");
    $r.addProperty("DataType",0,$mod.$rtti["TColumnDataType"],"FDataType","FDataType");
    $r.addProperty("Tag",0,rtl.longint,"FTag","FTag",4,{Default: 0});
    $r.addProperty("Width",2,rtl.longint,"FWidth","SetWidth",4,{Default: 0});
  });
  rtl.createClass(this,"TTableControlColumns",pas.Classes.TOwnedCollection,function () {
    this.$init = function () {
      pas.Classes.TOwnedCollection.$init.call(this);
      this.FOnChange = null;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      pas.Classes.TOwnedCollection.$final.call(this);
    };
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      this.SetItem(Index,Value);
    };
    this.Changed$1 = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Update = function (Item) {
      pas.Classes.TCollection.Update.apply(this,arguments);
      this.Changed$1();
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,$mod.TTableControlColumn);
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      return Result;
    };
  });
  rtl.createClass(this,"TDBTableControl",pas["WEBLib.Grids"].TCustomTableControl,function () {
    this.$init = function () {
      pas["WEBLib.Grids"].TCustomTableControl.$init.call(this);
      this.FDefaultFields = false;
      this.FDataLink = null;
      this.FColumns = null;
      this.FDataChanging = false;
    };
    this.$final = function () {
      this.FDataLink = undefined;
      this.FColumns = undefined;
      pas["WEBLib.Grids"].TCustomTableControl.$final.call(this);
    };
    this.SetColumns = function (Value) {
      this.FColumns.Assign(Value);
    };
    this.LoadData = function () {
      var c = 0;
      var r = 0;
      var i = 0;
      var lField = null;
      var noflds = false;
      var cd = "";
      var cn = "";
      var ce = null;
      var bk = pas.DB.TBookmark.$new();
      var isBOF = false;
      var isEOF = false;
      var scrollevent = null;
      var column = null;
      isBOF = this.GetDataSource().FDataSet.GetBOF();
      isEOF = this.GetDataSource().FDataSet.GetEOF();
      bk.$assign(this.GetDataSource().FDataSet.GetBookmark());
      this.GetDataSource().FDataSet.DisableControls();
      scrollevent = this.GetDataSource().FDataSet.FAfterScroll;
      this.GetDataSource().FDataSet.FAfterScroll = null;
      this.GetDataSource().FDataSet.First();
      if (this.FRowHeader) {
        r = 1}
       else r = 0;
      noflds = true;
      for (var $l = 0, $end = this.FColumns.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.FColumns.GetItem$1(i).FDataField !== "") noflds = false;
      };
      this.FDefaultFields = noflds;
      if (noflds && (this.FColumns.GetCount() > 0)) {
        for (var $l1 = 0, $end1 = this.GetDataSource().FDataSet.GetfieldCount() - 1; $l1 <= $end1; $l1++) {
          i = $l1;
          if (!this.GetDataSource().FDataSet.FFieldList.GetField(i).FVisible) continue;
          if (i >= this.FColumns.GetCount()) this.FColumns.Add$1();
          if (this.FColumns.GetItem$1(i).FDataField === "") this.FColumns.GetItem$1(i).SetDataField(this.GetDataSource().FDataSet.FFieldList.GetField(i).FFieldName);
          if (this.FColumns.GetItem$1(i).FTitle === "") this.FColumns.GetItem$1(i).SetTitle(this.GetDataSource().FDataSet.FFieldList.GetField(i).GetDisplayName());
        };
      };
      if (this.FColumns.GetCount() === 0) {
        for (var $l2 = 0, $end2 = this.GetDataSource().FDataSet.GetfieldCount() - 1; $l2 <= $end2; $l2++) {
          c = $l2;
          if (!this.GetDataSource().FDataSet.FFieldList.GetField(c).FVisible) continue;
          column = this.FColumns.Add$1();
          lField = this.GetDataSource().FDataSet.FFieldList.GetField(c);
          column.SetDataField(lField.FFieldName);
          column.SetTitle(column.FDataField);
          if (pas.DB.TBlobField.isPrototypeOf(lField) && !pas.DB.TMemoField.isPrototypeOf(lField)) {
            column.FDataType = $mod.TColumnDataType.cdMemo;
          };
        };
      };
      this.SetColCount(this.FColumns.GetCount());
      this.SetRowCount(this.GetDataSource().FDataSet.GetRecordCount() + r);
      if (this.FRowHeader) {
        for (var $l3 = 0, $end3 = this.FColCount - 1; $l3 <= $end3; $l3++) {
          c = $l3;
          lField = null;
          if (this.FColumns.GetItem$1(c).FDataField !== "") {
            try {
              lField = this.GetDataSource().FDataSet.FieldByName(this.FColumns.GetItem$1(c).FDataField);
            } catch ($e) {
              lField = null;
            };
          };
          cd = this.FColumns.GetItem$1(c).FTitle;
          this.GetCellData(c,0,null,{get: function () {
              return cd;
            }, set: function (v) {
              cd = v;
            }});
          this.SetCells(c,0,cd);
          cn = this.FColumns.GetItem$1(c).FTitleClassName;
          ce = this.GetCellElement(c,0);
          this.GetCellChildren(c,0,lField,cd,ce);
          this.GetCellClassName(c,0,lField,cd,{get: function () {
              return cn;
            }, set: function (v) {
              cn = v;
            }});
          if ((ce != null) && (cn !== "")) {
            ce.setAttribute("class",cn);
          };
        };
      };
      while (!this.GetDataSource().FDataSet.GetEOF()) {
        this.LoadRow(r);
        r += 1;
        this.GetDataSource().FDataSet.Next();
      };
      if (this.GetDataSource().FDataSet.FFiltered) this.SetRowCount(r);
      if (this.GetDataSource().FDataSet.BookmarkValid(pas.DB.TBookmark.$clone(bk))) this.GetDataSource().FDataSet.GotoBookmark(bk);
      if (isBOF) this.GetDataSource().FDataSet.First();
      if (isEOF) this.GetDataSource().FDataSet.Last();
      this.GetDataSource().FDataSet.EnableControls();
      this.GetDataSource().FDataSet.FAfterScroll = scrollevent;
    };
    this.LoadRow = function (ARow) {
      var c = 0;
      var r = 0;
      var cr = 0;
      var lField = null;
      var cd = "";
      var cn = "";
      var wcss = "";
      var ce = null;
      c = 0;
      r = ARow;
      for (var $l = 0, $end = this.FColCount - 1; $l <= $end; $l++) {
        c = $l;
        lField = null;
        cd = "";
        wcss = "";
        cr = r;
        if (this.FColumns.GetItem$1(c).FWidth > 0) wcss = "width:" + pas.SysUtils.TIntegerHelper.ToString$1.call({p: this.FColumns.GetItem$1(c), get: function () {
            return this.p.FWidth;
          }, set: function (v) {
            this.p.FWidth = v;
          }}) + "px;overflow:hidden;text-overflow:ellipsis;max-width:" + pas.SysUtils.TIntegerHelper.ToString$1.call({p: this.FColumns.GetItem$1(c), get: function () {
            return this.p.FWidth;
          }, set: function (v) {
            this.p.FWidth = v;
          }}) + "px;white-space:nowrap";
        if (this.FColumns.GetItem$1(c).FDataField !== "") {
          try {
            lField = this.GetDataSource().FDataSet.FieldByName(this.FColumns.GetItem$1(c).FDataField);
          } catch ($e) {
            lField = null;
          };
          if (lField != null) cd = $impl.TableFieldToCellData(ce,lField,this.FColumns.GetItem$1(c).FDataType,false,true,0);
        };
        this.GetCellData(c,r,lField,{get: function () {
            return cd;
          }, set: function (v) {
            cd = v;
          }});
        this.SetCells(c,r,cd);
        cn = this.FColumns.GetItem$1(c).FClassName$1;
        if (this.InVisiblePage({get: function () {
            return cr;
          }, set: function (v) {
            cr = v;
          }})) {
          ce = this.GetCellElement(c,cr);
          if (ce != null) {
            if (wcss !== "") ce.setAttribute("style",wcss);
            this.GetCellChildren(c,r,lField,cd,ce);
            this.GetCellClassName(c,r,lField,cd,{get: function () {
                return cn;
              }, set: function (v) {
                cn = v;
              }});
            if ((ce != null) && (cn !== "")) ce.setAttribute("class",cn);
          };
        };
      };
    };
    this.DataChange = function (Sender) {
      if (this.FDataChanging) return;
      this.FDataChanging = true;
      if ((this.FDataLink.FDataSource != null) && (this.FDataLink.FDataSource.FDataSet != null) && this.FDataLink.FDataSource.FDataSet.GetActive() && (this.FDataLink.FDataSource.FDataSet.FState === pas.DB.TDataSetState.dsBrowse)) {
        this.LoadData();
      };
      this.FDataChanging = false;
    };
    this.RecordChange = function (Sender) {
      var r = 0;
      if ((this.FDataLink.FDataSource != null) && (this.FDataLink.FDataSource.FDataSet != null) && this.FDataLink.FDataSource.FDataSet.GetActive() && (this.FDataLink.FDataSource.FDataSet.FState === pas.DB.TDataSetState.dsBrowse)) {
        r = this.FDataLink.FDataSource.FDataSet.GetRecNo() - 1;
        if (r === -1) return;
        if (this.FRowHeader) r += 1;
        if (r < this.FRowCount) this.LoadRow(r);
      };
    };
    this.ActiveChange = function (Sender) {
      if (!(this.GetDataSource() != null)) return;
      if (!(this.GetDataSource().FDataSet != null)) return;
      if (this.GetDataSource().FDataSet.ControlsDisabled()) return;
      if (this.GetDataSource().FDataSet.GetActive()) {
        this.FDataChanging = true;
        this.LoadData();
        this.FDataChanging = false;
      } else {
        this.SetRowCount(2);
        this.Clear();
        if (this.FDefaultFields) this.FColumns.Clear();
      };
    };
    this.SetDataSource = function (Value) {
      this.FDataLink.SetDataSource(Value);
    };
    this.GetDataSource = function () {
      var Result = null;
      Result = this.FDataLink.FDataSource;
      return Result;
    };
    this.Loaded = function () {
      pas["WEBLib.Grids"].TCustomTableControl.Loaded.call(this);
      this.SetColCount(this.FColumns.GetCount());
      if ((this.GetDataSource() != null) && (this.GetDataSource().FDataSet != null) && this.GetDataSource().FDataSet.GetActive()) {
        this.FDataChanging = true;
        this.LoadData();
        this.FDataChanging = false;
      };
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Grids"].TCustomTableControl.CreateInitialize.call(this);
      this.SetRowCount(2);
      if (!(this.FDataLink != null)) {
        this.FDataLink = $mod.TDBDataLink.$create("Create$1");
        this.FDataLink.FOnActiveChange = rtl.createCallback(this,"ActiveChange");
        this.FDataLink.FOnRecordChange = rtl.createCallback(this,"RecordChange");
        this.FDataLink.FOnDataChange = rtl.createCallback(this,"DataChange");
      };
      if (!(this.FColumns != null)) {
        this.FColumns = $mod.TTableControlColumns.$create("Create$3",[this]);
        this.FColumns.FPropName = "Columns";
      };
      this.FDefaultFields = false;
      this.FDataChanging = false;
    };
    this.Destroy = function () {
      rtl.free(this,"FDataLink");
      rtl.free(this,"FColumns");
      pas["WEBLib.Grids"].TCustomTableControl.Destroy.call(this);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].ITMSFNCDataBinderGrid);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("Columns",2,$mod.$rtti["TTableControlColumns"],"FColumns","SetColumns");
    $r.addProperty("DataSource",3,pas.DB.$rtti["TDataSource"],"GetDataSource","SetDataSource");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
  });
  rtl.createClass(this,"TWebDBTableControl",this.TDBTableControl,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].ITMSFNCDataBinderGrid);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TDBEditDropDownTableControl",pas["WEBLib.DropDown"].TEditDropDownTableControl,function () {
    this.$init = function () {
      pas["WEBLib.DropDown"].TEditDropDownTableControl.$init.call(this);
      this.FDataLink = null;
      this.FEditChange = false;
    };
    this.$final = function () {
      this.FDataLink = undefined;
      pas["WEBLib.DropDown"].TEditDropDownTableControl.$final.call(this);
    };
    this.GetTableSource = function () {
      var Result = null;
      Result = this.GetDBTableControl().GetDataSource();
      return Result;
    };
    this.SetTableSource = function (Value) {
      this.GetDBTableControl().SetDataSource(Value);
      this.UpdateElement();
    };
    this.GetDBTableControl = function () {
      var Result = null;
      Result = this.FTableControl;
      return Result;
    };
    this.GetDataField = function () {
      var Result = "";
      Result = this.FDataLink.FFieldName;
      return Result;
    };
    this.GetDataSource = function () {
      var Result = null;
      Result = this.FDataLink.FDataSource;
      return Result;
    };
    this.SetDataField = function (Value) {
      this.FDataLink.FFieldName = Value;
      this.FDataLink.UpdateField();
      this.ActiveChange(this);
    };
    this.SetDataSource = function (Value) {
      this.FDataLink.SetDataSource(Value);
      this.UpdateElement();
    };
    this.CreateTable = function (Aowner) {
      var Result = null;
      Result = $mod.TWebDBTableControl.$create("Create$1",[Aowner]);
      return Result;
    };
    this.DataUpdate = function (Sender) {
      if (this.FDataLink.FField != null) {
        if (!(this.FDataLink.FField != null)) this.FDataLink.UpdateField();
        this.FDataLink.FField.SetAsString(this.GetText());
      };
    };
    this.DataChange = function (Sender) {
      if (this.FEditChange) return;
      this.UpdateElement();
      if (!(this.FDataLink.GetDataset() != null)) return;
      if (!(this.FDataLink.FField != null)) this.FDataLink.UpdateField();
      if ((this.FDataLink.FField != null) && !this.FDataLink.GetDataset().IsEmpty()) {
        this.SetText(this.FDataLink.FField.GetDisplayText())}
       else this.SetText("");
    };
    this.ActiveChange = function (Sender) {
      this.UpdateElement();
      if (this.FDataLink.GetDataset() != null) {
        if (!this.FDataLink.GetDataset().GetActive() || !this.GetDataSource().FEnabled) {
          this.SetText("")}
         else this.DataChange(this);
      };
    };
    this.CheckDataSet = function () {
      var Result = false;
      Result = $impl.CheckDB(this.GetDataSource(),this.GetDataField(),this.FDataLink) || (this.GetTableSource() != null);
      return Result;
    };
    this.EditCanModify = function () {
      var Result = false;
      if (this.GetDataSource() != null) {
        Result = !this.FDataLink.GetDataset().ControlsDisabled() && (this.GetDataSource().FAutoEdit || (this.GetDataSource().FDataSet.FState in rtl.createSet(pas.DB.TDataSetState.dsEdit,pas.DB.TDataSetState.dsInsert))) && this.FDataLink.Edit()}
       else Result = true;
      return Result;
    };
    this.IsReadOnly = function () {
      var Result = false;
      Result = this.FReadOnly || !this.CheckDataSet();
      return Result;
    };
    this.IsEnabled = function () {
      var Result = false;
      Result = this.FEnabled && this.CheckDataSet();
      return Result;
    };
    this.KeyDown = function (Key, Shift) {
      pas["WEBLib.DropDown"].TEditDropDownControl.KeyDown.apply(this,arguments);
    };
    this.KeyPress = function (Key) {
      var canedit = false;
      if (!this.CheckDataSet()) {
        pas["WEBLib.Controls"].TControl.KeyPress.apply(this,arguments);
        return;
      };
      if (this.FDataLink.GetDataset().ControlsDisabled()) {
        this.PreventDefault();
        this.StopPropagation();
        return;
      };
      this.FEditChange = true;
      canedit = this.EditCanModify();
      this.FEditChange = false;
      if (!canedit) {
        Key.set("\x00");
        return;
      };
      if (this.FDataLink.FReadOnly) {
        Key.set("\x00");
      };
      pas["WEBLib.Controls"].TControl.KeyPress.call(this,Key);
    };
    this.DoExit = function () {
      if (!this.FDataLink.FReadOnly) {
        this.FEditChange = true;
        this.FDataLink.UpdateRecord();
      };
      pas["WEBLib.Controls"].TControl.DoExit.call(this);
      this.FEditChange = false;
    };
    this.CreateInitialize = function () {
      if (!(this.FDataLink != null)) {
        this.FDataLink = $mod.TFieldDataLink.$create("Create$1");
        this.FDataLink.FOnUpdateData = rtl.createCallback(this,"DataUpdate");
        this.FDataLink.FOnDataChange = rtl.createCallback(this,"DataChange");
        this.FDataLink.FOnActiveChange = rtl.createCallback(this,"ActiveChange");
        this.FEditChange = false;
      };
      pas["WEBLib.DropDown"].TEditDropDownTableControl.CreateInitialize.call(this);
    };
    this.Destroy = function () {
      rtl.free(this,"FDataLink");
      pas["WEBLib.DropDown"].TEditDropDownTableControl.Destroy.call(this);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("TableSource",3,pas.DB.$rtti["TDataSource"],"GetTableSource","SetTableSource");
    $r.addProperty("DataField",3,$mod.$rtti["TDataField"],"GetDataField","SetDataField");
    $r.addProperty("DataSource",3,pas.DB.$rtti["TDataSource"],"GetDataSource","SetDataSource");
  });
  rtl.createClass(this,"TWebDBEditDropDownTableControl",this.TDBEditDropDownTableControl,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TDBResponsiveGrid",pas["WEBLib.Grids"].TResponsiveGrid,function () {
    this.$init = function () {
      pas["WEBLib.Grids"].TResponsiveGrid.$init.call(this);
      this.FDataLink = null;
      this.FModifying = false;
      this.FRecordCount = 0;
      this.FOldState = 0;
      this.FDataChanging = false;
    };
    this.$final = function () {
      this.FDataLink = undefined;
      pas["WEBLib.Grids"].TResponsiveGrid.$final.call(this);
    };
    this.DataChange = function (Sender) {
      var nstate = 0;
      var i = 0;
      if ((this.FDataLink.FDataSource != null) && (this.FDataLink.FDataSource.FDataSet != null) && this.FDataLink.FDataSource.FDataSet.GetActive() && !this.FModifying) {
        nstate = this.FOldState;
        this.FOldState = this.FDataLink.GetDataset().FState;
        if (!this.FDataChanging && (this.FRecordCount !== this.FDataLink.GetDataset().GetRecordCount())) {
          this.FDataChanging = true;
          this.LoadData();
          this.FDataChanging = false;
        } else if (!this.FDataChanging && (nstate === pas.DB.TDataSetState.dsEdit) && (this.FDataLink.GetDataset().FState === pas.DB.TDataSetState.dsBrowse)) {
          this.FDataChanging = true;
          this.LoadData();
          this.FDataChanging = false;
        };
        for (var $l = 0, $end = this.FItems.GetCount() - 1; $l <= $end; $l++) {
          i = $l;
          if (this.FItems.GetItem$1(i).FRecNo === this.FDataLink.FDataSource.FDataSet.GetRecNo()) {
            this.SetItemIndex(i);
            break;
          };
        };
      };
    };
    this.ActiveChange = function (Sender) {
      if ((this.FDataLink.FDataSource != null) && (this.FDataLink.FDataSource.FDataSet != null) && this.FDataLink.FDataSource.FDataSet.GetActive()) {
        this.FDataChanging = true;
        this.LoadData();
        this.FDataChanging = false;
      } else this.FItems.Clear$1();
    };
    this.SetDataSource = function (Value) {
      if (this.FDataLink.FDataSource !== Value) {
        this.FDataLink.SetDataSource(Value);
      };
    };
    this.GetDataSource = function () {
      var Result = null;
      Result = this.FDataLink.FDataSource;
      return Result;
    };
    this.HandleDoItemClick = function (Index) {
      if ((this.FDataLink.FDataSource != null) && (this.FDataLink.FDataSource.FDataSet != null) && this.FDataLink.FDataSource.FDataSet.GetActive()) {
        this.FModifying = true;
        if ((Index >= 0) && (Index < this.FItems.GetCount())) this.FDataLink.FDataSource.FDataSet.SetRecNo(this.FItems.GetItem$1(Index).FRecNo);
        this.FModifying = false;
      };
      pas["WEBLib.Grids"].TResponsiveGrid.HandleDoItemClick.apply(this,arguments);
    };
    this.LoadData = function () {
      var html = "";
      var ident = "";
      var htmlvalue = "";
      var data = "";
      var c = 0;
      var itm = null;
      var bk = pas.DB.TBookmark.$new();
      var scrollevent = null;
      if ((this.FDataLink.FDataSource != null) && (this.FDataLink.FDataSource.FDataSet != null) && this.FDataLink.FDataSource.FDataSet.GetActive()) {
        this.FDataLink.FDataSource.FDataSet.DisableControls();
        scrollevent = this.GetDataSource().FDataSet.FAfterScroll;
        this.GetDataSource().FDataSet.FAfterScroll = null;
        bk.$assign(this.FDataLink.GetDataset().GetBookmark());
        this.FItems.Clear$1();
        this.FDataLink.FDataSource.FDataSet.First();
        while (!this.FDataLink.FDataSource.FDataSet.GetEOF()) {
          itm = this.FItems.Add$1();
          itm.FRecNo = this.FDataLink.FDataSource.FDataSet.GetRecNo();
          html = this.FOptions.FItemTemplate;
          data = "";
          for (var $l = 0, $end = this.FDataLink.FDataSource.FDataSet.FFieldList.GetCount() - 1; $l <= $end; $l++) {
            c = $l;
            if (c === 0) {
              data = '"' + this.FDataLink.FDataSource.FDataSet.FFieldList.GetField(c).GetDisplayText() + '"'}
             else data = data + ',"' + this.FDataLink.FDataSource.FDataSet.FFieldList.GetField(c).GetDisplayText() + '"';
          };
          this.DoItemGetTemplate(itm.GetIndex(),data,{get: function () {
              return html;
            }, set: function (v) {
              html = v;
            }});
          ident = "(%ITEMINDEX%)";
          if (pas.System.Pos(ident,html) > 0) {
            html = pas.SysUtils.StringReplace(html,ident,pas.SysUtils.IntToStr(itm.GetIndex()),rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll));
          };
          for (var $l1 = 0, $end1 = this.FDataLink.FDataSource.FDataSet.FFieldList.GetCount() - 1; $l1 <= $end1; $l1++) {
            c = $l1;
            ident = "(%" + this.FDataLink.FDataSource.FDataSet.FFieldList.GetField(c).FFieldName + "%)";
            if (pas.System.Pos(pas.SysUtils.UpperCase(ident),pas.SysUtils.UpperCase(html)) > 0) {
              htmlvalue = this.FDataLink.FDataSource.FDataSet.FFieldList.GetField(c).GetDisplayText();
              this.DoItemGetFieldValue(itm.GetIndex(),this.FDataLink.FDataSource.FDataSet.FFieldList.GetField(c).FFieldName,{get: function () {
                  return htmlvalue;
                }, set: function (v) {
                  htmlvalue = v;
                }});
              html = pas.SysUtils.StringReplace(html,ident,htmlvalue,rtl.createSet(pas.SysUtils.TStringReplaceFlag.rfReplaceAll,pas.SysUtils.TStringReplaceFlag.rfIgnoreCase));
            };
          };
          itm.SetHTML(html);
          this.DoItemCreated(itm.GetIndex());
          this.FDataLink.FDataSource.FDataSet.Next();
        };
        this.FRecordCount = this.FDataLink.GetDataset().GetRecordCount();
        if (this.GetDataSource().FDataSet.BookmarkValid(pas.DB.TBookmark.$clone(bk))) this.FDataLink.GetDataset().GotoBookmark(bk);
        this.FDataLink.FDataSource.FDataSet.EnableControls();
        this.GetDataSource().FDataSet.FAfterScroll = scrollevent;
      } else this.FItems.Clear$1();
    };
    this.OptionsChanged = function (Sender) {
      pas["WEBLib.Grids"].TResponsiveGrid.OptionsChanged.apply(this,arguments);
      this.LoadData();
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Grids"].TResponsiveGrid.CreateInitialize.call(this);
      this.FDataChanging = false;
      if (!(this.FDataLink != null)) {
        this.FDataLink = $mod.TDBDataLink.$create("Create$1");
        this.FDataLink.FOnActiveChange = rtl.createCallback(this,"ActiveChange");
        this.FDataLink.FOnRecordChange = rtl.createCallback(this,"DataChange");
      };
      this.FModifying = false;
    };
    this.Destroy = function () {
      rtl.free(this,"FDataLink");
      pas["WEBLib.Grids"].TResponsiveGrid.Destroy.call(this);
    };
    this.Refresh = function () {
      this.LoadData();
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("DataSource",3,pas.DB.$rtti["TDataSource"],"GetDataSource","SetDataSource");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
  });
  rtl.createClass(this,"TWebDBResponsiveGrid",this.TDBResponsiveGrid,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  rtl.createClass(this,"TGridColumn",pas.Classes.TCollectionItem,function () {
    this.$init = function () {
      pas.Classes.TCollectionItem.$init.call(this);
      this.FDataField = "";
      this.FTitle = "";
      this.FWidth = 0;
      this.FDataType = 0;
      this.FClassName$1 = "";
      this.FTitleClassName = "";
      this.FSortIndicator = 0;
      this.FEditor = 0;
      this.FEditMask = "";
      this.FComboBoxItems = null;
      this.FTag = 0;
      this.FDBField = null;
      this.FImageWidth = 0;
      this.FAlignment = 0;
      this.FAutoFormatDateTime = false;
    };
    this.$final = function () {
      this.FComboBoxItems = undefined;
      this.FDBField = undefined;
      pas.Classes.TCollectionItem.$final.call(this);
    };
    this.SetDataField = function (Value) {
      if (this.FDataField !== Value) {
        this.FDataField = Value;
        rtl.as(this.FCollection,$mod.TGridColumns).Update(this);
        this.FDBField = null;
      };
    };
    this.SetTitle = function (Value) {
      if (this.FTitle !== Value) {
        this.FTitle = Value;
        rtl.as(this.FCollection,$mod.TGridColumns).Update(this);
      };
    };
    this.SetWidth = function (Value) {
      if (this.FWidth !== Value) {
        this.FWidth = Value;
        rtl.as(this.FCollection,$mod.TGridColumns).Update(this);
      };
    };
    this.SetSortIndicator = function (Value) {
      var i = 0;
      for (var $l = 0, $end = rtl.as(this.FCollection,$mod.TGridColumns).GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (rtl.as(this.FCollection,$mod.TGridColumns).GetItem$1(i).FSortIndicator !== pas["WEBLib.Grids"].TGridSortIndicator.siNone) {
          rtl.as(this.FCollection,$mod.TGridColumns).GetItem$1(i).FSortIndicator = pas["WEBLib.Grids"].TGridSortIndicator.siNone;
          if (rtl.as(this.FCollection,$mod.TGridColumns).FOnSortIndicatorChange != null) rtl.as(this.FCollection,$mod.TGridColumns).FOnSortIndicatorChange(rtl.as(this.FCollection,$mod.TGridColumns),i,pas["WEBLib.Grids"].TGridSortIndicator.siNone);
        };
      };
      this.FSortIndicator = Value;
      if (rtl.as(this.FCollection,$mod.TGridColumns).FOnSortIndicatorChange != null) rtl.as(this.FCollection,$mod.TGridColumns).FOnSortIndicatorChange(rtl.as(this.FCollection,$mod.TGridColumns),this.GetIndex(),this.FSortIndicator);
    };
    this.SetComboBoxItems = function (Value) {
      this.FComboBoxItems = Value;
    };
    this.SetAlignment = function (Value) {
      var grd = null;
      this.FAlignment = Value;
      grd = rtl.as(this.FCollection,$mod.TGridColumns).Owner();
      grd.SetColAlignments(this.GetIndex() + grd.FFixedCols,this.FAlignment);
    };
    this.GetDBField = function () {
      var Result = null;
      var grd = null;
      if ((this.FDataField !== "") && (this.FDBField === null)) {
        grd = rtl.as(this.FCollection,$mod.TGridColumns).Owner();
        if ((grd != null) && (grd.GetDataSource() != null) && (grd.GetDataSource().FDataSet != null)) try {
          this.FDBField = grd.GetDataSource().FDataSet.FieldByName(this.FDataField);
        } catch ($e) {
          this.FDBField = null;
        };
      };
      Result = this.FDBField;
      return Result;
    };
    this.Assign = function (Source) {
      if ($mod.TGridColumn.isPrototypeOf(Source)) {
        this.FClassName$1 = rtl.as(Source,$mod.TGridColumn).FClassName$1;
        this.FDataField = rtl.as(Source,$mod.TGridColumn).FDataField;
        this.FTitle = rtl.as(Source,$mod.TGridColumn).FTitle;
        this.FTitleClassName = rtl.as(Source,$mod.TGridColumn).FTitleClassName;
        this.FDataType = rtl.as(Source,$mod.TGridColumn).FDataType;
        this.FWidth = rtl.as(Source,$mod.TGridColumn).FWidth;
        this.FEditor = rtl.as(Source,$mod.TGridColumn).FEditor;
        this.FEditMask = rtl.as(Source,$mod.TGridColumn).FEditMask;
        this.FComboBoxItems.Assign(rtl.as(Source,$mod.TGridColumn).FComboBoxItems);
        this.FTag = rtl.as(Source,$mod.TGridColumn).FTag;
        this.FDBField = rtl.as(Source,$mod.TGridColumn).FDBField;
        this.FImageWidth = rtl.as(Source,$mod.TGridColumn).FImageWidth;
        this.FAlignment = rtl.as(Source,$mod.TGridColumn).FAlignment;
        this.FAutoFormatDateTime = rtl.as(Source,$mod.TGridColumn).FAutoFormatDateTime;
      };
    };
    this.Create$1 = function (Collection) {
      pas.Classes.TCollectionItem.Create$1.apply(this,arguments);
      this.FWidth = 64;
      this.FDataType = $mod.TColumnDataType.cdText;
      this.FComboBoxItems = pas.Classes.TStringList.$create("Create$1");
      this.FAutoFormatDateTime = true;
      return this;
    };
    this.Destroy = function () {
      rtl.free(this,"FComboBoxItems");
      pas.Classes.TCollectionItem.Destroy.call(this);
    };
    var $r = this.$rtti;
    $r.addProperty("Alignment",2,pas.Classes.$rtti["TAlignment"],"FAlignment","SetAlignment",4,{Default: pas.Classes.TAlignment.taLeftJustify});
    $r.addProperty("AutoFormatDateTime",0,rtl.boolean,"FAutoFormatDateTime","FAutoFormatDateTime",4,{Default: true});
    $r.addProperty("ComboBoxItems",2,pas.Classes.$rtti["TStrings"],"FComboBoxItems","SetComboBoxItems");
    $r.addProperty("DataField",2,$mod.$rtti["TDataField"],"FDataField","SetDataField");
    $r.addProperty("DataType",0,$mod.$rtti["TColumnDataType"],"FDataType","FDataType");
    $r.addProperty("EditMask",0,pas["WEBLib.Mask"].$rtti["TEditMask"],"FEditMask","FEditMask");
    $r.addProperty("Editor",0,pas["WEBLib.Grids"].$rtti["TGridCellEditor"],"FEditor","FEditor",4,{Default: pas["WEBLib.Grids"].TGridCellEditor.geText});
    $r.addProperty("ElementClassName",0,rtl.string,"FClassName$1","FClassName$1");
    $r.addProperty("ImageWidth",0,rtl.longint,"FImageWidth","FImageWidth",4,{Default: 0});
    $r.addProperty("Tag",0,rtl.longint,"FTag","FTag",4,{Default: 0});
    $r.addProperty("Title",2,rtl.string,"FTitle","SetTitle");
    $r.addProperty("TitleElementClassName",0,rtl.string,"FTitleClassName","FTitleClassName");
    $r.addProperty("Width",2,rtl.longint,"FWidth","SetWidth",4,{Default: 64});
  });
  this.$rtti.$MethodVar("TSortIndicatorChanged",{procsig: rtl.newTIProcSig([["Sender",pas.System.$rtti["TObject"]],["ACol",rtl.longint],["AIndicator",pas["WEBLib.Grids"].$rtti["TGridSortIndicator"]]]), methodkind: 0});
  rtl.createClass(this,"TGridColumns",pas.Classes.TOwnedCollection,function () {
    this.$init = function () {
      pas.Classes.TOwnedCollection.$init.call(this);
      this.FOnChange = null;
      this.FOnSortIndicatorChange = null;
    };
    this.$final = function () {
      this.FOnChange = undefined;
      this.FOnSortIndicatorChange = undefined;
      pas.Classes.TOwnedCollection.$final.call(this);
    };
    this.GetItem$1 = function (Index) {
      var Result = null;
      Result = this.GetItem(Index);
      return Result;
    };
    this.SetItem$1 = function (Index, Value) {
      this.SetItem(Index,Value);
    };
    this.Changed$1 = function () {
      if (this.FOnChange != null) this.FOnChange(this);
    };
    this.Update = function (Item) {
      pas.Classes.TCollection.Update.apply(this,arguments);
      this.Changed$1();
    };
    this.Create$3 = function (AOwner) {
      pas.Classes.TOwnedCollection.Create$2.call(this,AOwner,$mod.TGridColumn);
      return this;
    };
    this.Add$1 = function () {
      var Result = null;
      Result = pas.Classes.TCollection.Add.call(this);
      return Result;
    };
    this.Insert$1 = function (Index) {
      var Result = null;
      Result = pas.Classes.TCollection.Insert.call(this,Index);
      return Result;
    };
  });
  rtl.createClass(this,"TDBGrid",pas["WEBLib.Grids"].TCustomStringGrid,function () {
    this.$init = function () {
      pas["WEBLib.Grids"].TCustomStringGrid.$init.call(this);
      this.FDefaultFields = false;
      this.FModifying = false;
      this.FDataLink = null;
      this.FColumns = null;
      this.FDataChanging = false;
      this.FOldState = 0;
      this.FOldFiltered = false;
      this.FOldIndicator = 0;
      this.FShowIndicator = false;
    };
    this.$final = function () {
      this.FDataLink = undefined;
      this.FColumns = undefined;
      pas["WEBLib.Grids"].TCustomStringGrid.$final.call(this);
    };
    this.GetDataSource = function () {
      var Result = null;
      Result = this.FDataLink.FDataSource;
      return Result;
    };
    this.SetColumns = function (Value) {
      this.FColumns.Assign(Value);
    };
    this.SetDataSource = function (Value) {
      this.FDataLink.SetDataSource(Value);
    };
    this.SetShowIndicator = function (Value) {
      this.FShowIndicator = Value;
      this.UpdateIndicator(this.GetRow());
    };
    this.ReadStubProp = function (AReader) {
    };
    this.WriteStubProp = function (AWriter) {
    };
    this.DefineProperties = function (AFiler) {
      pas.Classes.TComponent.DefineProperties.call(this,AFiler);
      AFiler.DefineProperty("ColWidths",rtl.createCallback(this,"ReadStubProp"),rtl.createCallback(this,"WriteStubProp"),false);
      AFiler.DefineProperty("RowHeights",rtl.createCallback(this,"ReadStubProp"),rtl.createCallback(this,"WriteStubProp"),false);
      AFiler.DefineProperty("ColAligments",rtl.createCallback(this,"ReadStubProp"),rtl.createCallback(this,"WriteStubProp"),false);
    };
    this.LoadData = function () {
      var c = 0;
      var r = 0;
      var i = 0;
      var subp = 0;
      var bk = pas.DB.TBookmark.$new();
      var noflds = false;
      var isBOF = false;
      var isEOF = false;
      var LTitle = "";
      var cn = "";
      var subclass = "";
      var fld = null;
      var ce = null;
      var ne = null;
      var AColumn = null;
      noflds = true;
      r = 0;
      for (var $l = 0, $end = this.FColumns.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        if (this.FColumns.GetItem$1(i).FDataField !== "") noflds = false;
      };
      this.FDefaultFields = noflds;
      if (noflds && (this.FColumns.GetCount() > 0)) {
        this.FColumns.BeginUpdate();
        for (var $l1 = 0, $end1 = this.FDataLink.GetDataset().GetfieldCount() - 1; $l1 <= $end1; $l1++) {
          i = $l1;
          if ((this.FDataLink.GetDataset().FFieldList.GetField(i).FFieldKind === pas.DB.TFieldKind.fkData) && (pas.DB.TFieldAttribute.faHiddenCol in this.FDataLink.GetDataset().FFieldList.GetField(i).FFieldDef.FAttributes)) {
            continue;
          };
          if (!this.FDataLink.GetDataset().FFieldList.GetField(i).FVisible) {
            continue;
          };
          if (i >= this.FColumns.GetCount()) this.FColumns.Add$1();
          this.FColumns.GetItem$1(i).FDataField = this.FDataLink.GetDataset().FFieldList.GetField(i).FFieldName;
          this.FColumns.GetItem$1(i).FTitle = this.FDataLink.GetDataset().FFieldList.GetField(i).GetDisplayName();
          if (this.FDataLink.GetDataset().FFieldList.GetField(i).FFieldKind === pas.DB.TFieldKind.fkLookup) {
            this.FColumns.GetItem$1(i).FEditor = pas["WEBLib.Grids"].TGridCellEditor.geCombo;
            this.LoadComboItems(i,this.FDataLink.GetDataset().FFieldList.GetField(i));
          };
          if (this.FDataLink.GetDataset().FFieldList.GetField(i).FDataType in rtl.createSet(pas.DB.TFieldType.ftDate,pas.DB.TFieldType.ftDateTime)) this.FColumns.GetItem$1(i).FEditor = pas["WEBLib.Grids"].TGridCellEditor.geDate;
          if (this.FDataLink.GetDataset().FFieldList.GetField(i).FDataType in rtl.createSet(pas.DB.TFieldType.ftMemo)) this.FColumns.GetItem$1(i).FEditor = pas["WEBLib.Grids"].TGridCellEditor.geMemo;
          if (this.FDataLink.GetDataset().FFieldList.GetField(i).FDataType in rtl.createSet(pas.DB.TFieldType.ftBoolean)) {
            this.FColumns.GetItem$1(i).FDataType = $mod.TColumnDataType.cdCheck;
          };
        };
        while (this.FColumns.GetCount() > this.FDataLink.GetDataset().GetfieldCount()) {
          this.FColumns.Delete(this.FColumns.GetCount() - 1);
        };
      };
      if (this.FColumns.GetCount() === 0) {
        for (var $l2 = 0, $end2 = this.FDataLink.GetDataset().GetfieldCount() - 1; $l2 <= $end2; $l2++) {
          i = $l2;
          if (pas.DB.TFieldAttribute.faHiddenCol in this.FDataLink.GetDataset().FFieldList.GetField(i).FFieldDef.FAttributes) {
            continue;
          };
          AColumn = this.FColumns.Add$1();
          AColumn.FDataField = this.FDataLink.GetDataset().FFieldList.GetField(i).FFieldName;
          AColumn.FTitle = this.FDataLink.GetDataset().FFieldList.GetField(i).GetDisplayName();
        };
        this.FColumns.EndUpdate();
      };
      this.SetColCount(this.FColumns.GetCount() + this.FFixedCols);
      this.SetRowCount(this.FDataLink.FDataSource.FDataSet.GetRecordCount() + this.FFixedRows);
      this.RenderGrid();
      isBOF = this.FDataLink.GetDataset().GetBOF();
      isEOF = this.FDataLink.GetDataset().GetEOF();
      this.FDataLink.FDataSource.FDataSet.DisableControls();
      bk.$assign(this.FDataLink.GetDataset().GetBookmark());
      ne = this.FDataLink.GetDataset().FAfterScroll;
      this.FDataLink.GetDataset().FAfterScroll = null;
      this.FDataLink.FDataSource.FDataSet.First();
      if (this.FFixedRows > 0) {
        for (var $l3 = 0, $end3 = this.FColumns.GetCount() - 1; $l3 <= $end3; $l3++) {
          c = $l3;
          LTitle = this.FColumns.GetItem$1(c).FTitle;
          var $tmp = this.FColumns.GetItem$1(c).FSortIndicator;
          if ($tmp === pas["WEBLib.Grids"].TGridSortIndicator.siAscending) {
            LTitle = LTitle + "&nbsp;&#x25B2;"}
           else if ($tmp === pas["WEBLib.Grids"].TGridSortIndicator.siDescending) LTitle = LTitle + "&nbsp;&#x25BC";
          this.SetCells(c + this.FFixedCols,r,LTitle);
          if (this.FColumns.GetItem$1(c).FTitleClassName !== "") {
            ce = this.GetDirectCellElements(c + this.FFixedCols,0);
            if (ce != null) {
              subclass = this.FColumns.GetItem$1(c).FTitleClassName;
              do {
                subp = pas.System.Pos(" ",subclass);
                if (subp > 0) {
                  ce.classList.add(pas.System.Copy(subclass,1,subp - 1));
                  pas.System.Delete({get: function () {
                      return subclass;
                    }, set: function (v) {
                      subclass = v;
                    }},1,subp);
                } else ce.classList.add(subclass);
              } while (!(subp === 0));
            };
          };
          fld = this.FColumns.GetItem$1(c).GetDBField();
          ce = this.GetDirectCellElements(c + this.FFixedCols,0);
          this.GetCellChildren(c + this.FFixedCols,0,fld,LTitle,ce);
          this.BindCellChildren(c + this.FFixedCols,0,ce);
          cn = this.FColumns.GetItem$1(c).FTitleClassName;
          this.GetCellClassName(c + this.FFixedCols,0,fld,LTitle,{get: function () {
              return cn;
            }, set: function (v) {
              cn = v;
            }});
          if ((ce != null) && (cn !== "")) ce.setAttribute("class",cn);
        };
      };
      r = this.FFixedRows;
      while (!this.FDataLink.FDataSource.FDataSet.GetEOF()) {
        this.LoadRow(r);
        r += 1;
        this.FDataLink.FDataSource.FDataSet.Next();
      };
      if (this.FDataLink.FDataSource.FDataSet.FFiltered) this.SetRowCount(r);
      if (this.GetDataSource().FDataSet.BookmarkValid(pas.DB.TBookmark.$clone(bk))) this.FDataLink.FDataSource.FDataSet.GotoBookmark(bk);
      if (isBOF) this.FDataLink.FDataSource.FDataSet.First();
      if (isEOF) this.FDataLink.FDataSource.FDataSet.Last();
      this.FDataLink.GetDataset().FAfterScroll = ne;
      this.FDataLink.FDataSource.FDataSet.EnableControls();
    };
    this.LoadRow = function (ARow) {
      var c = 0;
      var r = 0;
      var fld = null;
      var cd = "";
      var cn = "";
      var ce = null;
      if (ARow < this.FFixedRows) return;
      r = ARow;
      for (var $l = 0, $end = this.FColumns.GetCount() - 1; $l <= $end; $l++) {
        c = $l;
        if (this.FEditMode && (c === (this.GetCol() - this.FFixedCols)) && (ARow === this.GetRow())) continue;
        cd = "";
        ce = this.GetDirectCellElements(c + this.FFixedCols,r);
        this.UnBindCellChildren(c,r,ce);
        fld = this.FColumns.GetItem$1(c).GetDBField();
        if (fld != null) {
          cd = $impl.FieldToCellData(ce,fld,this.FColumns.GetItem$1(c),pas["WEBLib.Grids"].TGridOption.goEditing in this.FOptions);
        };
        this.GetCellData(c,r,fld,{get: function () {
            return cd;
          }, set: function (v) {
            cd = v;
          }});
        this.SetCells(c + this.FFixedCols,r,cd);
        cn = this.FColumns.GetItem$1(c).FClassName$1;
        this.GetCellChildren(c,r,fld,cd,ce);
        this.BindCellChildren(c,r,ce);
        this.GetCellClassName(c,r,fld,cd,{get: function () {
            return cn;
          }, set: function (v) {
            cn = v;
          }});
        if (cn !== "") ce.setAttribute("class",cn);
      };
    };
    this.InsertData = function (ARow) {
      var R = 0;
      var C = 0;
      for (var $l = this.FRowCount - 1, $end = ARow + 1; $l >= $end; $l--) {
        R = $l;
        for (var $l1 = 0, $end1 = this.FColCount - 1; $l1 <= $end1; $l1++) {
          C = $l1;
          if ((C === 0) && (this.FFixedCols > 0)) {
            this.SetCells(C,R,"&nbsp;")}
           else this.SetCells(C,R,this.GetCells(C,R - 1));
        };
      };
      this.LoadRow(ARow);
    };
    this.DataChange = function (Sender) {
      var r = 0;
      var LOldRow = 0;
      var LOldCol = 0;
      var filterchange = false;
      var appendmode = false;
      if (this.FDataChanging) return;
      if ((this.FOldState !== this.FDataLink.FDataSource.FDataSet.FState) && !this.FModifying) {
        if (this.FEditMode && (this.FOldState in rtl.createSet(pas.DB.TDataSetState.dsEdit,pas.DB.TDataSetState.dsInsert))) {
          this.StopEdit();
        };
        if ((this.FOldState in rtl.createSet(pas.DB.TDataSetState.dsInactive)) && (this.FDataLink.FDataSource.FDataSet.FState === pas.DB.TDataSetState.dsBrowse)) {
          this.FDataChanging = true;
          this.LoadData();
          this.FDataChanging = false;
          this.FOldState = this.FDataLink.FDataSource.FDataSet.FState;
          this.FOldIndicator = 0;
          return;
        };
        if (this.FOldState in rtl.createSet(pas.DB.TDataSetState.dsInsert)) {
          this.FDataChanging = true;
          this.LoadData();
          this.FDataChanging = false;
          this.FOldState = this.FDataLink.FDataSource.FDataSet.FState;
          this.FOldIndicator = 0;
          return;
        };
      };
      if ((this.FOldState in rtl.createSet(pas.DB.TDataSetState.dsBrowse)) && (this.FDataLink.FDataSource.FDataSet.FState === pas.DB.TDataSetState.dsBrowse)) {
        this.FDataChanging = true;
        this.LoadData();
        this.FDataChanging = false;
        this.FOldState = this.FDataLink.FDataSource.FDataSet.FState;
        return;
      };
      this.FOldState = this.FDataLink.FDataSource.FDataSet.FState;
      if (this.FOldState in rtl.createSet(pas.DB.TDataSetState.dsEdit)) return;
      this.FDataChanging = true;
      if ((this.FDataLink.FDataSource != null) && (this.FDataLink.FDataSource.FDataSet != null) && this.FDataLink.FDataSource.FDataSet.GetActive() && !this.FModifying && !this.FEditMode) {
        filterchange = this.FOldFiltered !== this.FDataLink.FDataSource.FDataSet.FFiltered;
        if ((this.FRowCount !== (this.FDataLink.FDataSource.FDataSet.GetRecordCount() + this.FFixedRows)) || filterchange) {
          this.FOldFiltered = this.FDataLink.FDataSource.FDataSet.FFiltered;
          this.FModifying = true;
          LOldRow = this.GetRow();
          LOldCol = this.GetCol();
          this.FDataChanging = true;
          this.LoadData();
          this.FDataChanging = false;
          if (filterchange) {
            this.FDataLink.FDataSource.FDataSet.First();
            if (this.FRowCount > this.FFixedRows) this.SetRow(this.FFixedRows);
          };
          this.FModifying = false;
          this.SelectCell(LOldCol,LOldRow);
        } else {
          r = (this.FFixedRows + this.FDataLink.FDataSource.FDataSet.GetRecNo()) - 1;
          if (this.FOldState === pas.DB.TDataSetState.dsInsert) {
            LOldCol = this.GetCol();
            this.SetRowCount(this.FRowCount + 1);
            this.SetRow(Math.max(r,this.FFixedRows));
            this.SetCol(LOldCol);
            appendmode = !this.FDataLink.GetBOF() && this.FDataLink.GetEOF();
            if (!appendmode) this.InsertData(this.GetRow());
          } else {
            if ((this.FOldState !== pas.DB.TDataSetState.dsBrowse) || (this.FDataLink.FDataSource.FDataSet.FState !== pas.DB.TDataSetState.dsBrowse)) {
              this.LoadData();
            };
            this.SetRow(r);
          };
          this.UpdateIndicator(r);
        };
      };
      this.FDataChanging = false;
    };
    this.DataScroll = function (Sender, Distance) {
      if ((this.FDataLink.FDataSource != null) && (this.FDataLink.FDataSource.FDataSet != null) && this.FDataLink.FDataSource.FDataSet.FFiltered) {
        this.SetRow(this.GetRow() + Distance);
        this.UpdateIndicator(this.GetRow());
      };
    };
    this.RecordChange = function (Sender) {
      var r = 0;
      if ((this.FDataLink.FDataSource != null) && (this.FDataLink.FDataSource.FDataSet != null) && this.FDataLink.FDataSource.FDataSet.GetActive()) {
        if (!this.FModifying && !this.FEditMode) {
          if (!this.FDataLink.FDataSource.FDataSet.FFiltered) r = (this.FFixedRows + this.FDataLink.FDataSource.FDataSet.GetRecNo()) - 1;
          this.FOldState = pas.DB.TDataSetState.dsOldValue;
          if (this.FDataLink.FDataSource.FDataSet.FState === pas.DB.TDataSetState.dsInsert) {}
          else if ((r <= (this.FRowCount - 1)) && !this.FDataLink.FDataSource.FDataSet.FFiltered) {
            this.SetRow(r);
            this.LoadRow(r);
          } else {
            this.FModifying = true;
            this.LoadData();
            if (!this.FDataLink.FDataSource.FDataSet.FFiltered) this.SetRow(r);
            this.FModifying = false;
          };
          if (!this.FDataLink.FDataSource.FDataSet.FFiltered) {
            this.UpdateIndicator(r);
          };
        } else {
          if (this.FEditMode) this.LoadRow(this.GetRow());
        };
      };
    };
    this.ActiveChange = function (Sender) {
      var c = 0;
      if ((this.FDataLink.FDataSource != null) && (this.FDataLink.FDataSource.FDataSet != null) && this.FDataLink.FDataSource.FDataSet.GetActive()) {
        this.FDataChanging = true;
        this.LoadData();
        this.FDataChanging = false;
      } else {
        this.Clear();
        this.SetRowCount(this.FFixedRows);
        if (this.FDefaultFields) this.FColumns.Clear();
        for (var $l = 0, $end = this.FColumns.GetCount() - 1; $l <= $end; $l++) {
          c = $l;
          this.FColumns.GetItem$1(c).FDBField = null;
        };
        this.FOldIndicator = -1;
      };
    };
    this.ColumnsChanged = function (Sender) {
      var c = 0;
      if (!(this.GetElementHandle() != null) || this.IsUpdating()) return;
      this.SetColCount(this.FColumns.GetCount() + this.FFixedCols);
      if ((this.FFixedRows > 0) && (this.FRowCount > 0)) {
        for (var $l = 0, $end = this.FColumns.GetCount() - 1; $l <= $end; $l++) {
          c = $l;
          this.SetCells(c + this.FFixedCols,0,this.FColumns.GetItem$1(c).FTitle);
          this.SetColWidths(c + this.FFixedCols,this.FColumns.GetItem$1(c).FWidth);
          this.SetColAlignments(c + this.FFixedCols,this.FColumns.GetItem$1(c).FAlignment);
        };
      };
    };
    this.UpdateData = function (Sender) {
      if (this.FDataLink.FDataSource.FDataSet.FState === pas.DB.TDataSetState.dsInsert) {
        this.HideEdit(false);
      };
    };
    this.UpdateCell = function (ACol, ARow, AValue) {
      var fldName = "";
      var fldValue = "";
      var insupdate = false;
      var fld = null;
      pas["WEBLib.Grids"].TCustomStringGrid.UpdateCell.apply(this,arguments);
      if ((this.FDataLink.FDataSource != null) && (this.FDataLink.FDataSource.FDataSet != null) && this.FDataLink.FDataSource.FDataSet.GetActive()) {
        insupdate = this.FDataLink.FDataSource.FDataSet.FState in pas.DB.dsEditModes;
        fldName = this.FColumns.GetItem$1(ACol - this.FFixedCols).FDataField;
        if (fldName !== "") {
          if (!insupdate) {
            this.FDataLink.FDataSource.FDataSet.Edit();
          };
          fld = null;
          try {
            fld = this.FDataLink.FDataSource.FDataSet.FieldByName(fldName);
            if (fld != null) {
              if (fld.FFieldKind === pas.DB.TFieldKind.fkLookup) {
                fldValue = this.GetLookupKey(ACol - this.FFixedCols,AValue.get());
                this.FDataLink.FDataSource.FDataSet.FieldByName(fld.FKeyFields).SetAsString(fldValue);
              } else if (fld.FFieldKind !== pas.DB.TFieldKind.fkCalculated) {
                if (fld.FDataType in rtl.createSet(pas.DB.TFieldType.ftDate,pas.DB.TFieldType.ftDateTime)) {
                  fld.SetAsDateTime(pas["WEBLib.WebTools"].PickerDateToDate(AValue.get()));
                } else {
                  if (fld.GetAsString() !== AValue.get()) {
                    fld.SetAsString(AValue.get());
                  };
                };
              };
            };
          } catch ($e) {
            fld = null;
          };
        };
      };
    };
    this.SelectCell = function (ACol, ARow) {
      var LOldrow = 0;
      var d = 0;
      LOldrow = this.GetRow();
      pas["WEBLib.Grids"].TCustomStringGrid.SelectCell.apply(this,arguments);
      if ((this.FDataLink.FDataSource != null) && (this.FDataLink.FDataSource.FDataSet != null) && this.FDataLink.FDataSource.FDataSet.GetActive()) {
        if ((ARow === LOldrow) || (LOldrow < 0)) return;
        this.FModifying = true;
        d = this.FDataLink.MoveBy(ARow - LOldrow);
        if (d !== 0) {
          this.UpdateIndicator(ARow);
        } else {
          this.LoadRow(LOldrow);
          this.UpdateIndicator(LOldrow);
          this.SetRow(LOldrow);
        };
        this.FModifying = false;
      };
    };
    this.ChangeRow = function () {
      pas["WEBLib.Grids"].TCustomStringGrid.ChangeRow.call(this);
    };
    this.UpdateIndicator = function (ARow) {
      var LSym = "";
      if (this.FFixedCols === 0) return;
      if ((this.FOldIndicator !== ARow) || !this.FShowIndicator) {
        if ((this.FOldIndicator >= 0) && (this.FOldIndicator < this.FRowCount)) this.SetCells(0,this.FOldIndicator,"");
      };
      if (this.FShowIndicator) {
        if ((this.FDataLink.FDataSource != null) && (this.FDataLink.FDataSource.FDataSet != null) && this.FDataLink.FDataSource.FDataSet.GetActive() && (ARow >= this.FFixedRows)) {
          if (this.FEditMode || (this.FDataLink.FDataSource.FDataSet.FState === pas.DB.TDataSetState.dsEdit)) {
            LSym = "&#x270E;";
          } else {
            if (this.FDataLink.FDataSource.FDataSet.FState === pas.DB.TDataSetState.dsInsert) {
              LSym = "&brvbar"}
             else LSym = "&#x25B6;";
          };
          this.SetCells(0,ARow,"&nbsp;" + LSym);
        };
      };
      this.FOldIndicator = ARow;
    };
    this.DoCheckClick = function (ACol, ARow, Checked) {
      var insUpdate = false;
      var fldName = "";
      var fld = null;
      pas["WEBLib.Grids"].TCustomStringGrid.DoCheckClick.apply(this,arguments);
      this.SelectCell(ACol,ARow);
      if ((this.FDataLink.FDataSource != null) && (this.FDataLink.FDataSource.FDataSet != null) && this.FDataLink.FDataSource.FDataSet.GetActive() && (pas["WEBLib.Grids"].TGridOption.goEditing in this.FOptions)) {
        insUpdate = this.FDataLink.FDataSource.FDataSet.FState in pas.DB.dsEditModes;
        fldName = this.FColumns.GetItem$1(ACol - this.FFixedCols).FDataField;
        if (fldName !== "") {
          fld = null;
          try {
            fld = this.FDataLink.FDataSource.FDataSet.FieldByName(fldName);
            if (!fld.FReadOnly) {
              if (!insUpdate) this.FDataLink.FDataSource.FDataSet.Edit();
              fld.SetAsBoolean(Checked);
            };
          } catch ($e) {
            fld = null;
          };
        };
      };
    };
    this.DoSortIndicatorChange = function (Sender, ACol, AIndicator) {
      var s = "";
      s = this.FColumns.GetItem$1(ACol).FTitle;
      var $tmp = AIndicator;
      if ($tmp === pas["WEBLib.Grids"].TGridSortIndicator.siAscending) {
        s = s + "&nbsp;&#x25B2;"}
       else if ($tmp === pas["WEBLib.Grids"].TGridSortIndicator.siDescending) s = s + "&nbsp;&#x25BC;";
      this.SetCells(ACol + this.FFixedCols,0,s);
    };
    this.StopEdit = function () {
      var Result = "";
      Result = pas["WEBLib.Grids"].TCustomStringGrid.StopEdit.call(this);
      this.UpdateIndicator(this.GetRow());
      return Result;
    };
    this.CancelEdit = function () {
      pas["WEBLib.Grids"].TCustomStringGrid.CancelEdit.call(this);
      if ((this.FDataLink.FDataSource != null) && (this.FDataLink.FDataSource.FDataSet != null) && this.FDataLink.FDataSource.FDataSet.GetActive()) {
        this.FDataLink.FDataSource.FDataSet.Cancel();
      };
    };
    this.StartEdit = function (ch) {
      var lField = null;
      if ((this.GetCol() > 0) && (this.GetCol() <= this.FColumns.GetCount())) if (this.FColumns.GetItem$1(this.GetCol() - 1).FDataType in rtl.createSet($mod.TColumnDataType.cdCheck,$mod.TColumnDataType.cdRadio)) return;
      if (this.FColumns.GetItem$1(this.GetCol() - this.FFixedCols).FEditor === pas["WEBLib.Grids"].TGridCellEditor.geCombo) {
        if ((this.GetDataSource() != null) && (this.GetDataSource().FDataSet != null) && this.GetDataSource().FDataSet.GetActive() && (this.FColumns.GetItem$1(this.GetCol() - this.FFixedCols).FDataField !== "")) {
          try {
            lField = this.GetDataSource().FDataSet.FieldByName(this.FColumns.GetItem$1(this.GetCol() - this.FFixedCols).FDataField);
          } catch ($e) {
            lField = null;
          };
          if (lField != null) this.LoadComboItems(this.GetCol() - this.FFixedCols,lField);
        };
      };
      pas["WEBLib.Grids"].TCustomStringGrid.StartEdit.call(this,ch);
      this.UpdateIndicator(this.GetRow());
    };
    this.Loaded = function () {
      pas["WEBLib.Controls"].TCustomControl.Loaded.call(this);
      this.ColumnsChanged(this);
    };
    this.CanEditCell = function (ACol, ARow) {
      var Result = false;
      var fld = null;
      Result = pas["WEBLib.Grids"].TCustomStringGrid.CanEditCell.apply(this,arguments);
      if (Result && ((ACol - this.FFixedCols) < this.FColumns.GetCount()) && (ACol >= this.FFixedCols)) {
        fld = this.FColumns.GetItem$1(ACol - this.FFixedCols).FDBField;
        if ((fld != null) && fld.FReadOnly) {
          Result = false;
        };
      };
      return Result;
    };
    this.CanRowAdvance = function () {
      var Result = false;
      Result = false;
      return Result;
    };
    this.GetCellEditor = function (ACol, ARow, AEditor) {
      if (((ACol - this.FFixedCols) < this.FColumns.GetCount()) && (ACol >= this.FFixedCols)) {
        AEditor.set(this.FColumns.GetItem$1(ACol - this.FFixedCols).FEditor);
        this.FComboBoxItems.Assign(this.FColumns.GetItem$1(ACol - this.FFixedCols).FComboBoxItems);
        this.FEditMask = this.FColumns.GetItem$1(ACol - this.FFixedCols).FEditMask;
      };
      pas["WEBLib.Grids"].TCustomStringGrid.GetCellEditor.apply(this,arguments);
    };
    this.LoadComboItems = function (ColIndex, AField) {
      var s = "";
      var k = "";
      var bk = pas.DB.TBookmark.$new();
      if (AField.FFieldKind === pas.DB.TFieldKind.fkLookup) {
        bk.$assign(AField.FLookupDataSet.GetBookmark());
        AField.FLookupDataSet.DisableControls();
        AField.FLookupDataSet.First();
        this.FColumns.GetItem$1(ColIndex).FComboBoxItems.Clear();
        while (!AField.FLookupDataSet.GetEOF()) {
          s = AField.FLookupDataSet.FieldByName(AField.FLookupresultField).GetAsString();
          k = AField.FLookupDataSet.FieldByName(AField.FLookupKeyfields).GetAsString();
          this.FColumns.GetItem$1(ColIndex).FComboBoxItems.AddPair(s,k);
          AField.FLookupDataSet.Next();
        };
        AField.FLookupDataSet.GotoBookmark(bk);
        AField.FLookupDataSet.EnableControls();
      };
    };
    this.GetLookupKey = function (ColIndex, AValue) {
      var Result = "";
      var i = 0;
      var LName = "";
      var LValue = "";
      Result = "";
      for (var $l = 0, $end = this.FColumns.GetItem$1(ColIndex).FComboBoxItems.GetCount() - 1; $l <= $end; $l++) {
        i = $l;
        this.FColumns.GetItem$1(ColIndex).FComboBoxItems.GetNameValue(i,{get: function () {
            return LName;
          }, set: function (v) {
            LName = v;
          }},{get: function () {
            return LValue;
          }, set: function (v) {
            LValue = v;
          }});
        if (LName === AValue) {
          Result = LValue;
          break;
        };
      };
      return Result;
    };
    this.GetEditText = function (ACol, ARow) {
      var Result = "";
      var c = 0;
      var dt = 0.0;
      var fs = "";
      Result = pas["WEBLib.Grids"].TCustomStringGrid.GetEditText.call(this,ACol,ARow);
      c = ACol - this.FFixedCols;
      if (c < this.FColumns.GetCount()) {
        if ((this.FColumns.GetItem$1(c).FDBField != null) && pas.DB.TDateField.isPrototypeOf(this.FColumns.GetItem$1(c).FDBField) && (rtl.as(this.FColumns.GetItem$1(c).FDBField,pas.DB.TDateField).FDisplayFormat !== "")) {
          fs = pas.SysUtils.FormatSettings.ShortDateFormat;
          pas.SysUtils.FormatSettings.ShortDateFormat = rtl.as(this.FColumns.GetItem$1(c).FDBField,pas.DB.TDateField).FDisplayFormat;
          pas.SysUtils.TryStrToDate(Result,{get: function () {
              return dt;
            }, set: function (v) {
              dt = v;
            }});
          if (dt === 0) dt = pas.SysUtils.Now();
          pas.SysUtils.FormatSettings.ShortDateFormat = fs;
          Result = pas.SysUtils.FormatDateTime("yyyy-mm-dd",dt);
        };
      };
      return Result;
    };
    this.SetEditText = function (ACol, ARow, AValue) {
      pas["WEBLib.Grids"].TCustomStringGrid.SetEditText.apply(this,arguments);
    };
    this.CreateInitialize = function () {
      pas["WEBLib.Grids"].TCustomStringGrid.CreateInitialize.call(this);
      if (!(this.FDataLink != null)) {
        this.FDataLink = $mod.TDBDataLink.$create("Create$1");
        this.FDataLink.FOnActiveChange = rtl.createCallback(this,"ActiveChange");
        this.FDataLink.FOnRecordChange = rtl.createCallback(this,"RecordChange");
        this.FDataLink.FOnDataChange = rtl.createCallback(this,"DataChange");
        this.FDataLink.FOnUpdateData = rtl.createCallback(this,"UpdateData");
        this.FDataLink.FOnDataScroll = rtl.createCallback(this,"DataScroll");
      };
      if (!(this.FColumns != null)) {
        this.FColumns = $mod.TGridColumns.$create("Create$3",[this]);
        this.FColumns.FOnChange = rtl.createCallback(this,"ColumnsChanged");
        this.FColumns.FOnSortIndicatorChange = rtl.createCallback(this,"DoSortIndicatorChange");
        this.FColumns.FPropName = "Columns";
      };
      this.FModifying = false;
      this.FDefaultFields = false;
      this.FDataChanging = false;
      this.FOldIndicator = -1;
      this.FShowIndicator = true;
    };
    this.Destroy = function () {
      rtl.free(this,"FDataLink");
      rtl.free(this,"FColumns");
      pas["WEBLib.Grids"].TCustomStringGrid.Destroy.call(this);
    };
    this.Refresh = function () {
      this.LoadData();
    };
    this.HideEdit = function (Advance) {
      pas["WEBLib.Grids"].TCustomStringGrid.HideEdit.apply(this,arguments);
      this.UpdateIndicator(this.GetRow());
    };
    this.ShowEdit = function () {
      var fldName = "";
      var fld = null;
      if ((this.FDataLink.FDataSource != null) && (this.FDataLink.FDataSource.FDataSet != null) && this.FDataLink.FDataSource.FDataSet.GetActive()) {
        fldName = this.FColumns.GetItem$1(this.GetCol() - this.FFixedCols).FDataField;
        if (fldName !== "") {
          fld = null;
          try {
            fld = this.FDataLink.FDataSource.FDataSet.FieldByName(fldName);
          } catch ($e) {
            fld = null;
          };
          if ((fld != null) && !fld.FReadOnly) {
            this.FDataLink.FDataSource.FDataSet.Edit();
            pas["WEBLib.Grids"].TCustomStringGrid.ShowEdit.call(this);
          };
        } else pas["WEBLib.Grids"].TCustomStringGrid.ShowEdit.call(this);
      };
    };
    this.EndUpdate = function () {
      this.ColumnsChanged(this);
      pas["WEBLib.Controls"].TCustomControl.EndUpdate.call(this);
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].ITMSFNCDataBinderGrid);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti["TDragMode"],"FDragMode","SetDragMode",4,{Default: pas["WEBLib.Controls"].TDragMode.dmManual});
    $r.addProperty("Columns",2,$mod.$rtti["TGridColumns"],"FColumns","SetColumns");
    $r.addProperty("DataSource",3,pas.DB.$rtti["TDataSource"],"GetDataSource","SetDataSource");
    $r.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti["TElementFont"],"FElementFont","SetElementFont",4,{Default: pas["WEBLib.Controls"].TElementFont.efProperty});
    $r.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti["TElementClassName"],"FElementClassName","SetElementClassName");
    $r.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti["TElementID"],"GetID","SetID");
    $r.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti["TElementPosition"],"FElementPosition","SetElementPosition",4,{Default: pas["WEBLib.Controls"].TElementPosition.epAbsolute});
    $r.addProperty("FixedFont",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFixedFont","SetFixedFont");
    $r.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti["TFont"],"FFont","SetFont");
    $r.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",4,{Default: true});
    $r.addProperty("ShowIndicator",2,rtl.boolean,"FShowIndicator","SetShowIndicator");
    $r.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti["TDragDropEvent"],"FOnDragDrop","FOnDragDrop");
    $r.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti["TDragOverEvent"],"FOnDragOver","FOnDragOver");
    $r.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti["TEndDragEvent"],"FonEndDrag","FonEndDrag");
    $r.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti["TStartDragEvent"],"FOnStartDrag","FOnStartDrag");
  });
  rtl.createClass(this,"TWebDBGrid",this.TDBGrid,function () {
    rtl.addIntf(this,pas["WEBLib.Controls"].ITMSFNCDataBinderGrid);
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
  });
  $mod.$implcode = function () {
    rtl.createClass($impl,"TResponsiveGridItemEx",pas["WEBLib.Grids"].TResponsiveGridItem,function () {
    });
    $impl.CheckDB = function (ADataSource, ADataField, ADataLink) {
      var Result = false;
      Result = false;
      if ((ADataSource != null) && ADataSource.FEnabled && (ADataField !== "")) {
        Result = (ADataLink.GetDataset() != null) && ADataLink.GetDataset().GetActive() && ((ADataLink.GetDataset().GetRecordCount() > 0) || (ADataLink.GetDataset().FState === pas.DB.TDataSetState.dsInsert));
      };
      return Result;
    };
    $impl.HasSpecialEditFormat = function (ADataLink, ADataField) {
      var Result = false;
      var fld = null;
      Result = false;
      fld = ADataLink.GetDataset().FieldByName(ADataField);
      if ((fld != null) && pas.DB.TNumericField.isPrototypeOf(fld)) {
        Result = (rtl.as(fld,pas.DB.TNumericField).FEditFormat !== "") && (rtl.as(fld,pas.DB.TNumericField).FEditFormat !== rtl.as(fld,pas.DB.TNumericField).FDisplayFormat);
      };
      return Result;
    };
    $impl.TableFieldToCellData = function (AElement, AField, ColumnDataType, Enabled, AutoFormatDateTime, ImgWidth) {
      var Result = "";
      var b = false;
      var fs = "";
      var t = "";
      var d = "";
      var imgv = "";
      var dt = 0.0;
      Result = "";
      var $tmp = ColumnDataType;
      if (($tmp === $mod.TColumnDataType.cdText) || ($tmp === $mod.TColumnDataType.cdMemo)) {
        if ((AField.FDataType !== pas.DB.TFieldType.ftBlob) && pas["WEBLib.REST"].TRESTClient.IsIsoDateTime(AField.GetAsString()) && AutoFormatDateTime) {
          dt = pas["WEBLib.REST"].TRESTClient.IsoToDateTime(AField.GetAsString());
          if (pas.System.Frac(dt) === 0) {
            Result = pas.SysUtils.DateToStr(dt)}
           else if (pas.System.Int(dt) === 0) {
            Result = pas.SysUtils.TimeToStr(dt)}
           else Result = pas.SysUtils.DateToStr(dt) + "  " + pas.SysUtils.TimeToStr(dt);
        } else {
          if (ColumnDataType === $mod.TColumnDataType.cdMemo) {
            try {
              Result = window.atob("" + AField.GetAsJSValue());
            } catch ($e) {
              Result = AField.GetDisplayText();
            };
          } else {
            if ((AField.FDataType in rtl.createSet(pas.DB.TFieldType.ftDate,pas.DB.TFieldType.ftDateTime)) && (rtl.as(AField,pas.DB.TDateTimeField).FDisplayFormat === "")) {
              dt = AField.GetAsDateTime();
              if (pas.System.Frac(dt) === 0) {
                Result = pas.SysUtils.FormatDateTime("YYYY-MM-dd",dt)}
               else Result = pas.SysUtils.FormatDateTime("YYYY-MM-dd hh:mm:ss",dt);
            } else Result = AField.GetDisplayText();
          };
        };
      } else if ($tmp === $mod.TColumnDataType.cdImage) {
        imgv = AField.GetDisplayText();
        if (imgv !== "") {
          if (ImgWidth > 0) {
            Result = '<IMG src="' + imgv + '" width="' + pas.SysUtils.TIntegerHelper.ToString$1.call({get: function () {
                return ImgWidth;
              }, set: function (v) {
                ImgWidth = v;
              }}) + '">'}
           else Result = '<IMG src="' + imgv + '">';
        };
      } else if ($tmp === $mod.TColumnDataType.cdLink) {
        Result = '<A href="' + AField.GetDisplayText() + '">' + AField.GetDisplayText() + "</A>"}
       else if ($tmp === $mod.TColumnDataType.cdExternalLink) {
        Result = '<A href="' + AField.GetDisplayText() + '" target="_blank">' + AField.GetDisplayText() + "</A>"}
       else if (($tmp === $mod.TColumnDataType.cdCheck) || ($tmp === $mod.TColumnDataType.cdRadio)) {
        if (AField.FDataType === pas.DB.TFieldType.ftBoolean) {
          b = AField.GetAsBoolean()}
         else {
          fs = pas.SysUtils.LowerCase(AField.GetAsString());
          b = (fs === "y") || (fs === "true") || (fs === "1");
        };
        if (ColumnDataType === $mod.TColumnDataType.cdCheck) {
          t = "CHECKBOX"}
         else t = "RADIO";
        if (!Enabled) {
          d = " DISABLED"}
         else d = "";
        if (b) {
          Result = '<INPUT TYPE="' + t + '" CHECKED' + d + ">"}
         else Result = '<INPUT TYPE="' + t + '"' + d + ">";
      };
      return Result;
    };
    $impl.FieldToCellData = function (AElement, AField, Column, Enabled) {
      var Result = "";
      Result = $impl.TableFieldToCellData(AElement,AField,Column.FDataType,Enabled,Column.FAutoFormatDateTime,Column.FImageWidth);
      return Result;
    };
  };
},["WEBLib.WebTools","Math"]);
rtl.module("View.TasksDBGrid",["System","SysUtils","Classes","JS","Web","WEBLib.Graphics","WEBLib.Controls","WEBLib.Forms","WEBLib.Dialogs","WEBLib.Grids","WEBLib.Controls","WEBLib.Grids","WEBLib.DBCtrls","DB","WEBLib.DB","XData.Web.JsonDataset","XData.Web.Dataset","XData.Web.Client","ConnectionModule","WEBLib.StdCtrls","WEBLib.StdCtrls"],function () {
  "use strict";
  var $mod = this;
  rtl.createClass(this,"TFTasksDBGrid",pas["WEBLib.Forms"].TForm,function () {
    this.$init = function () {
      pas["WEBLib.Forms"].TForm.$init.call(this);
      this.xdwcTasks = null;
      this.wdsTasks = null;
      this.xdwdsTasks = null;
      this.xdwdsTaskstaskID = null;
      this.xdwdsTasksapplication = null;
      this.xdwdsTasksversion = null;
      this.xdwdsTaskstaskDate = null;
      this.xdwdsTasksreportedBy = null;
      this.xdwdsTasksassignedTo = null;
      this.xdwdsTasksstatus = null;
      this.xdwdsTasksstatusDate = null;
      this.xdwdsTasksformSection = null;
      this.xdwdsTasksissue = null;
      this.xdwdsTasksnotes = null;
      this.btnReload = null;
      this.btnAddRow = null;
      this.dbGridTasks = null;
      this.FProjectId = "";
    };
    this.$final = function () {
      this.xdwcTasks = undefined;
      this.wdsTasks = undefined;
      this.xdwdsTasks = undefined;
      this.xdwdsTaskstaskID = undefined;
      this.xdwdsTasksapplication = undefined;
      this.xdwdsTasksversion = undefined;
      this.xdwdsTaskstaskDate = undefined;
      this.xdwdsTasksreportedBy = undefined;
      this.xdwdsTasksassignedTo = undefined;
      this.xdwdsTasksstatus = undefined;
      this.xdwdsTasksstatusDate = undefined;
      this.xdwdsTasksformSection = undefined;
      this.xdwdsTasksissue = undefined;
      this.xdwdsTasksnotes = undefined;
      this.btnReload = undefined;
      this.btnAddRow = undefined;
      this.dbGridTasks = undefined;
      pas["WEBLib.Forms"].TForm.$final.call(this);
    };
    this.btnAddRowClick = function (Sender) {
      this.xdwdsTasks.Append();
      this.xdwdsTaskstaskID.SetAsString(this.FProjectId);
      this.xdwdsTasks.Post();
    };
    this.btnReloadClick = function (Sender) {
      this.LoadTasks(this.FProjectId);
    };
    this.WebFormCreate = function (Sender) {
      this.wdsTasks.SetDataSet(this.xdwdsTasks);
      this.dbGridTasks.SetDataSource(this.wdsTasks);
      this.FProjectId = "WPR0001";
      this.SetProjectTitle(this.FProjectId);
      this.LoadTasks(this.FProjectId);
    };
    this.LoadTasks = async function (AProjectId) {
      var response = null;
      var resultObj = null;
      var taskObj = null;
      var tasksArray = null;
      var itemsArray = null;
      var flatItems = null;
      var taskIndex = 0;
      var itemIndex = 0;
      response = await this.xdwcTasks.RawInvokeAsync("IApiService.GetProjectTasks",[AProjectId]);
      resultObj = response.FResult;
      tasksArray = resultObj["data"];
      flatItems = new Array();
      for (var $l = 0, $end = tasksArray.length - 1; $l <= $end; $l++) {
        taskIndex = $l;
        taskObj = tasksArray[taskIndex];
        itemsArray = taskObj["items"];
        for (var $l1 = 0, $end1 = itemsArray.length - 1; $l1 <= $end1; $l1++) {
          itemIndex = $l1;
          flatItems.push(itemsArray[itemIndex]);
        };
      };
      this.xdwdsTasks.Close();
      this.xdwdsTasks.SetJsonData(flatItems);
      this.xdwdsTasks.Open();
    };
    this.SetProjectTitle = function (AProjectId) {
      document.getElementById("lbl_project_name").innerText = AProjectId;
    };
    this.LoadDFMValues = function () {
      pas["WEBLib.Forms"].TCustomForm.LoadDFMValues.call(this);
      this.dbGridTasks = pas["WEBLib.DBCtrls"].TDBGrid.$create("Create$2",["db_grid_tasks"]);
      this.btnReload = pas["WEBLib.StdCtrls"].TButton.$create("Create$2",["btn_reload"]);
      this.btnAddRow = pas["WEBLib.StdCtrls"].TButton.$create("Create$2",["btn_add_row"]);
      this.xdwcTasks = pas["XData.Web.Client"].TXDataWebClient.$create("Create$1",[this]);
      this.wdsTasks = pas.DB.TDataSource.$create("Create$1",[this]);
      this.xdwdsTasks = pas["XData.Web.Dataset"].TXDataWebDataSet.$create("Create$1",[this]);
      this.xdwdsTaskstaskID = pas.DB.TStringField.$create("Create$1",[this]);
      this.xdwdsTasksapplication = pas.DB.TStringField.$create("Create$1",[this]);
      this.xdwdsTasksversion = pas.DB.TStringField.$create("Create$1",[this]);
      this.xdwdsTaskstaskDate = pas.DB.TStringField.$create("Create$1",[this]);
      this.xdwdsTasksreportedBy = pas.DB.TStringField.$create("Create$1",[this]);
      this.xdwdsTasksassignedTo = pas.DB.TStringField.$create("Create$1",[this]);
      this.xdwdsTasksstatus = pas.DB.TStringField.$create("Create$1",[this]);
      this.xdwdsTasksstatusDate = pas.DB.TStringField.$create("Create$1",[this]);
      this.xdwdsTasksformSection = pas.DB.TStringField.$create("Create$1",[this]);
      this.xdwdsTasksissue = pas.DB.TStringField.$create("Create$1",[this]);
      this.xdwdsTasksnotes = pas.DB.TStringField.$create("Create$1",[this]);
      this.dbGridTasks.BeforeLoadDFMValues();
      this.btnReload.BeforeLoadDFMValues();
      this.btnAddRow.BeforeLoadDFMValues();
      this.xdwcTasks.BeforeLoadDFMValues();
      this.wdsTasks.BeforeLoadDFMValues();
      this.xdwdsTasks.BeforeLoadDFMValues();
      this.xdwdsTaskstaskID.BeforeLoadDFMValues();
      this.xdwdsTasksapplication.BeforeLoadDFMValues();
      this.xdwdsTasksversion.BeforeLoadDFMValues();
      this.xdwdsTaskstaskDate.BeforeLoadDFMValues();
      this.xdwdsTasksreportedBy.BeforeLoadDFMValues();
      this.xdwdsTasksassignedTo.BeforeLoadDFMValues();
      this.xdwdsTasksstatus.BeforeLoadDFMValues();
      this.xdwdsTasksstatusDate.BeforeLoadDFMValues();
      this.xdwdsTasksformSection.BeforeLoadDFMValues();
      this.xdwdsTasksissue.BeforeLoadDFMValues();
      this.xdwdsTasksnotes.BeforeLoadDFMValues();
      try {
        this.SetName("FTasksDBGrid");
        this.SetWidth(1161);
        this.SetHeight(725);
        this.SetCSSLibrary(pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap);
        this.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
        this.SetEvent(this,"OnCreate","WebFormCreate");
        this.dbGridTasks.SetParentComponent(this);
        this.dbGridTasks.SetName("dbGridTasks");
        this.dbGridTasks.SetLeft(0);
        this.dbGridTasks.SetTop(0);
        this.dbGridTasks.SetWidth(1161);
        this.dbGridTasks.SetHeight(725);
        this.dbGridTasks.SetTabStop(false);
        this.dbGridTasks.SetAlign(pas["WEBLib.Controls"].TAlign.alClient);
        this.dbGridTasks.FColumns.Clear();
        var $with = this.dbGridTasks.FColumns.Add$1();
        $with.FClassName$1 = "text-nowrap tasks-nowrap";
        $with.SetDataField("taskId");
        $with.SetTitle("Task Id");
        $with.SetWidth(95);
        var $with1 = this.dbGridTasks.FColumns.Add$1();
        $with1.SetDataField("application");
        $with1.FEditor = pas["WEBLib.Grids"].TGridCellEditor.geCombo;
        $with1.SetTitle("Application");
        $with1.SetWidth(150);
        var $with2 = this.dbGridTasks.FColumns.Add$1();
        $with2.FClassName$1 = "text-nowrap tasks-nowrap";
        $with2.SetDataField("version");
        $with2.SetTitle("Version");
        $with2.SetWidth(95);
        var $with3 = this.dbGridTasks.FColumns.Add$1();
        $with3.SetDataField("taskDate");
        $with3.FEditor = pas["WEBLib.Grids"].TGridCellEditor.geDate;
        $with3.SetTitle("Date");
        $with3.SetWidth(120);
        var $with4 = this.dbGridTasks.FColumns.Add$1();
        $with4.FComboBoxItems.BeginUpdate();
        try {
          $with4.FComboBoxItems.Clear();
          $with4.FComboBoxItems.Add("\x0B");
          $with4.FComboBoxItems.Add("");
          $with4.FComboBoxItems.Add("Elias");
          $with4.FComboBoxItems.Add("Mark");
          $with4.FComboBoxItems.Add("Mac");
        } finally {
          $with4.FComboBoxItems.EndUpdate();
        };
        $with4.SetDataField("reportedBy");
        $with4.FEditor = pas["WEBLib.Grids"].TGridCellEditor.geCombo;
        $with4.SetTitle("Reported By");
        $with4.SetWidth(95);
        var $with5 = this.dbGridTasks.FColumns.Add$1();
        $with5.FComboBoxItems.BeginUpdate();
        try {
          $with5.FComboBoxItems.Clear();
          $with5.FComboBoxItems.Add("");
          $with5.FComboBoxItems.Add("Elias");
          $with5.FComboBoxItems.Add("Mark");
          $with5.FComboBoxItems.Add("Mac");
        } finally {
          $with5.FComboBoxItems.EndUpdate();
        };
        $with5.SetDataField("assignedTo");
        $with5.FEditor = pas["WEBLib.Grids"].TGridCellEditor.geCombo;
        $with5.SetTitle("Assigned To");
        $with5.SetWidth(95);
        var $with6 = this.dbGridTasks.FColumns.Add$1();
        $with6.FClassName$1 = "text-nowrap";
        $with6.SetDataField("status");
        $with6.SetTitle("Status");
        $with6.SetWidth(120);
        var $with7 = this.dbGridTasks.FColumns.Add$1();
        $with7.SetDataField("statusDate");
        $with7.FEditor = pas["WEBLib.Grids"].TGridCellEditor.geDate;
        $with7.SetTitle("Status Date");
        $with7.SetWidth(120);
        var $with8 = this.dbGridTasks.FColumns.Add$1();
        $with8.FClassName$1 = "text-nowrap tasks-nowrap";
        $with8.SetDataField("formSection");
        $with8.SetTitle("Form/Section");
        $with8.SetWidth(150);
        var $with9 = this.dbGridTasks.FColumns.Add$1();
        $with9.FClassName$1 = "text-wrap";
        $with9.SetDataField("issue");
        $with9.SetTitle("Issue");
        $with9.SetWidth(350);
        var $with10 = this.dbGridTasks.FColumns.Add$1();
        $with10.FClassName$1 = "text-wrap";
        $with10.SetDataField("notes");
        $with10.FEditor = pas["WEBLib.Grids"].TGridCellEditor.geMemo;
        $with10.SetTitle("Notes");
        $with10.SetWidth(350);
        this.dbGridTasks.SetDataSource(this.wdsTasks);
        this.dbGridTasks.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
        this.dbGridTasks.FFixedFont.FCharset = 1;
        this.dbGridTasks.FFixedFont.SetColor(65793);
        this.dbGridTasks.FFixedFont.SetHeight(-12);
        this.dbGridTasks.FFixedFont.SetName("Segoe UI");
        this.dbGridTasks.FFixedFont.SetStyle({});
        this.dbGridTasks.SetFixedCols(0);
        this.dbGridTasks.FOptions = rtl.createSet(pas["WEBLib.Grids"].TGridOption.goFixedVertLine,pas["WEBLib.Grids"].TGridOption.goFixedHorzLine,pas["WEBLib.Grids"].TGridOption.goVertLine,pas["WEBLib.Grids"].TGridOption.goHorzLine,pas["WEBLib.Grids"].TGridOption.goRangeSelect,pas["WEBLib.Grids"].TGridOption.goColSizing,pas["WEBLib.Grids"].TGridOption.goRowMoving,pas["WEBLib.Grids"].TGridOption.goEditing,pas["WEBLib.Grids"].TGridOption.goFixedRowDefAlign);
        this.dbGridTasks.SetTabOrder(0);
        this.dbGridTasks.SetHeightPercent(100.000000000000000000);
        this.dbGridTasks.SetWidthStyle(pas["WEBLib.Controls"].TSizeStyle.ssAuto);
        this.dbGridTasks.SetWidthPercent(100.000000000000000000);
        this.dbGridTasks.SetColWidths(0,95);
        this.dbGridTasks.SetColWidths(1,150);
        this.dbGridTasks.SetColWidths(2,95);
        this.dbGridTasks.SetColWidths(3,120);
        this.dbGridTasks.SetColWidths(4,95);
        this.dbGridTasks.SetColWidths(5,95);
        this.dbGridTasks.SetColWidths(6,120);
        this.dbGridTasks.SetColWidths(7,120);
        this.dbGridTasks.SetColWidths(8,150);
        this.dbGridTasks.SetColWidths(9,350);
        this.dbGridTasks.SetColWidths(10,350);
        this.btnReload.SetParentComponent(this);
        this.btnReload.SetName("btnReload");
        this.btnReload.SetLeft(864);
        this.btnReload.SetTop(259);
        this.btnReload.SetWidth(96);
        this.btnReload.SetHeight(25);
        this.btnReload.SetCaption("Reload");
        this.btnReload.SetChildOrderEx(1);
        this.btnReload.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
        this.btnReload.SetHeightStyle(pas["WEBLib.Controls"].TSizeStyle.ssAuto);
        this.btnReload.SetHeightPercent(100.000000000000000000);
        this.btnReload.SetWidthPercent(100.000000000000000000);
        this.SetEvent$1(this.btnReload,this,"OnClick","btnReloadClick");
        this.btnAddRow.SetParentComponent(this);
        this.btnAddRow.SetName("btnAddRow");
        this.btnAddRow.SetLeft(980);
        this.btnAddRow.SetTop(259);
        this.btnAddRow.SetWidth(96);
        this.btnAddRow.SetHeight(25);
        this.btnAddRow.SetCaption("Add Row");
        this.btnAddRow.SetChildOrderEx(1);
        this.btnAddRow.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
        this.btnAddRow.SetHeightStyle(pas["WEBLib.Controls"].TSizeStyle.ssAuto);
        this.btnAddRow.SetHeightPercent(100.000000000000000000);
        this.btnAddRow.SetWidthPercent(100.000000000000000000);
        this.SetEvent$1(this.btnAddRow,this,"OnClick","btnAddRowClick");
        this.xdwcTasks.SetParentComponent(this);
        this.xdwcTasks.SetName("xdwcTasks");
        this.xdwcTasks.SetConnection(pas.ConnectionModule.DMConnection.ApiConnection);
        this.xdwcTasks.SetLeft(1010);
        this.xdwcTasks.SetTop(430);
        this.wdsTasks.SetParentComponent(this);
        this.wdsTasks.SetName("wdsTasks");
        this.wdsTasks.SetDataSet(this.xdwdsTasks);
        this.wdsTasks.SetLeft(1014);
        this.wdsTasks.SetTop(574);
        this.xdwdsTasks.SetParentComponent(this);
        this.xdwdsTasks.SetName("xdwdsTasks");
        this.xdwdsTasks.SetLeft(1010);
        this.xdwdsTasks.SetTop(504);
        this.xdwdsTaskstaskID.SetParentComponent(this.xdwdsTasks);
        this.xdwdsTaskstaskID.SetName("xdwdsTaskstaskID");
        this.xdwdsTaskstaskID.FFieldName = "taskId";
        this.xdwdsTasksapplication.SetParentComponent(this.xdwdsTasks);
        this.xdwdsTasksapplication.SetName("xdwdsTasksapplication");
        this.xdwdsTasksapplication.FFieldName = "application";
        this.xdwdsTasksversion.SetParentComponent(this.xdwdsTasks);
        this.xdwdsTasksversion.SetName("xdwdsTasksversion");
        this.xdwdsTasksversion.FFieldName = "version";
        this.xdwdsTaskstaskDate.SetParentComponent(this.xdwdsTasks);
        this.xdwdsTaskstaskDate.SetName("xdwdsTaskstaskDate");
        this.xdwdsTaskstaskDate.FFieldName = "taskDate";
        this.xdwdsTasksreportedBy.SetParentComponent(this.xdwdsTasks);
        this.xdwdsTasksreportedBy.SetName("xdwdsTasksreportedBy");
        this.xdwdsTasksreportedBy.FFieldName = "reportedBy";
        this.xdwdsTasksassignedTo.SetParentComponent(this.xdwdsTasks);
        this.xdwdsTasksassignedTo.SetName("xdwdsTasksassignedTo");
        this.xdwdsTasksassignedTo.FFieldName = "assignedTo";
        this.xdwdsTasksstatus.SetParentComponent(this.xdwdsTasks);
        this.xdwdsTasksstatus.SetName("xdwdsTasksstatus");
        this.xdwdsTasksstatus.FFieldName = "status";
        this.xdwdsTasksstatusDate.SetParentComponent(this.xdwdsTasks);
        this.xdwdsTasksstatusDate.SetName("xdwdsTasksstatusDate");
        this.xdwdsTasksstatusDate.FFieldName = "statusDate";
        this.xdwdsTasksformSection.SetParentComponent(this.xdwdsTasks);
        this.xdwdsTasksformSection.SetName("xdwdsTasksformSection");
        this.xdwdsTasksformSection.FFieldName = "formSection";
        this.xdwdsTasksissue.SetParentComponent(this.xdwdsTasks);
        this.xdwdsTasksissue.SetName("xdwdsTasksissue");
        this.xdwdsTasksissue.FFieldName = "issue";
        this.xdwdsTasksnotes.SetParentComponent(this.xdwdsTasks);
        this.xdwdsTasksnotes.SetName("xdwdsTasksnotes");
        this.xdwdsTasksnotes.FFieldName = "notes";
      } finally {
        this.dbGridTasks.AfterLoadDFMValues();
        this.btnReload.AfterLoadDFMValues();
        this.btnAddRow.AfterLoadDFMValues();
        this.xdwcTasks.AfterLoadDFMValues();
        this.wdsTasks.AfterLoadDFMValues();
        this.xdwdsTasks.AfterLoadDFMValues();
        this.xdwdsTaskstaskID.AfterLoadDFMValues();
        this.xdwdsTasksapplication.AfterLoadDFMValues();
        this.xdwdsTasksversion.AfterLoadDFMValues();
        this.xdwdsTaskstaskDate.AfterLoadDFMValues();
        this.xdwdsTasksreportedBy.AfterLoadDFMValues();
        this.xdwdsTasksassignedTo.AfterLoadDFMValues();
        this.xdwdsTasksstatus.AfterLoadDFMValues();
        this.xdwdsTasksstatusDate.AfterLoadDFMValues();
        this.xdwdsTasksformSection.AfterLoadDFMValues();
        this.xdwdsTasksissue.AfterLoadDFMValues();
        this.xdwdsTasksnotes.AfterLoadDFMValues();
      };
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addField("xdwcTasks",pas["XData.Web.Client"].$rtti["TXDataWebClient"],4);
    $r.addField("wdsTasks",pas.DB.$rtti["TDataSource"],4);
    $r.addField("xdwdsTasks",pas["XData.Web.Dataset"].$rtti["TXDataWebDataSet"],4);
    $r.addField("xdwdsTaskstaskID",pas.DB.$rtti["TStringField"],4);
    $r.addField("xdwdsTasksapplication",pas.DB.$rtti["TStringField"],4);
    $r.addField("xdwdsTasksversion",pas.DB.$rtti["TStringField"],4);
    $r.addField("xdwdsTaskstaskDate",pas.DB.$rtti["TStringField"],4);
    $r.addField("xdwdsTasksreportedBy",pas.DB.$rtti["TStringField"],4);
    $r.addField("xdwdsTasksassignedTo",pas.DB.$rtti["TStringField"],4);
    $r.addField("xdwdsTasksstatus",pas.DB.$rtti["TStringField"],4);
    $r.addField("xdwdsTasksstatusDate",pas.DB.$rtti["TStringField"],4);
    $r.addField("xdwdsTasksformSection",pas.DB.$rtti["TStringField"],4);
    $r.addField("xdwdsTasksissue",pas.DB.$rtti["TStringField"],4);
    $r.addField("xdwdsTasksnotes",pas.DB.$rtti["TStringField"],4);
    $r.addField("btnReload",pas["WEBLib.StdCtrls"].$rtti["TButton"],4);
    $r.addField("btnAddRow",pas["WEBLib.StdCtrls"].$rtti["TButton"],4);
    $r.addField("dbGridTasks",pas["WEBLib.DBCtrls"].$rtti["TDBGrid"],4);
    $r.addMethod("btnAddRowClick",0,[["Sender",pas.System.$rtti["TObject"]]],4);
    $r.addMethod("btnReloadClick",0,[["Sender",pas.System.$rtti["TObject"]]],4);
    $r.addMethod("WebFormCreate",0,[["Sender",pas.System.$rtti["TObject"]]],4);
  });
  this.FTasksDBGrid = null;
});
rtl.module("View.Main",["System","SysUtils","Classes","JS","Web","WEBLib.Graphics","WEBLib.Controls","WEBLib.Forms","WEBLib.Dialogs","WEBLib.ExtCtrls","WEBLib.Controls","WEBLib.StdCtrls","WEBLib.StdCtrls","DB","XData.Web.JsonDataset","XData.Web.Dataset","App.Types","ConnectionModule","XData.Web.Client","WEBLib.Menus","Utils"],function () {
  "use strict";
  var $mod = this;
  rtl.createClass(this,"TFViewMain",pas["WEBLib.Forms"].TForm,function () {
    this.$init = function () {
      pas["WEBLib.Forms"].TForm.$init.call(this);
      this.wllblLogout = null;
      this.WebPanel1 = null;
      this.WebMessageDlg1 = null;
      this.WebMemo1 = null;
      this.XDataWebClient = null;
      this.lblVersion = null;
      this.lblAppTitle = null;
      this.FUserInfo = "";
      this.FSearchSettings = "";
      this.FChildForm = null;
      this.FLogoutProc = null;
      this.FSearchProc = null;
      this.search = "";
      this.change = false;
    };
    this.$final = function () {
      this.wllblLogout = undefined;
      this.WebPanel1 = undefined;
      this.WebMessageDlg1 = undefined;
      this.WebMemo1 = undefined;
      this.XDataWebClient = undefined;
      this.lblVersion = undefined;
      this.lblAppTitle = undefined;
      this.FChildForm = undefined;
      this.FLogoutProc = undefined;
      this.FSearchProc = undefined;
      pas["WEBLib.Forms"].TForm.$final.call(this);
    };
    this.WebFormCreate = function (Sender) {
      window.console.log("TFViewMain.WebFormCreate fired");
      window.console.log("About to ShowForm(TFTasksHTML), host=" + this.WebPanel1.GetID());
      this.ShowForm(pas["View.TasksHTML"].TFTasksHTML);
      this.lblAppTitle.SetCaption("emT3web");
      this.lblVersion.SetCaption("v" + pas.ConnectionModule.DMConnection.clientVersion);
    };
    this.mnuLogoutClick = function (Sender) {
      this.ConfirmLogout();
    };
    this.wllblLogoutClick = function (Sender) {
      this.ConfirmLogout();
    };
    this.ShowCrudForm = function (AFormClass) {
      this.ShowForm(AFormClass);
    };
    this.ConfirmLogout = function () {
      var $Self = this;
      pas.Utils.ShowConfirmationModal("End this session?.","Yes","No",function (confirmed) {
        if (confirmed && ($Self.FLogoutProc != null)) $Self.FLogoutProc("");
      });
    };
    this.Display = function (LogoutProc) {
      if ($mod.FViewMain != null) rtl.free($mod,"FViewMain");
      $mod.FViewMain = $mod.TFViewMain.$create("CreateNew$2");
      $mod.FViewMain.FLogoutProc = LogoutProc;
    };
    this.ShowForm = function (AFormClass) {
      if (this.FChildForm != null) rtl.free(this,"FChildForm");
      pas["WEBLib.Forms"].Application.CreateForm$1(AFormClass,this.WebPanel1.GetID(),{p: this, get: function () {
          return this.p.FChildForm;
        }, set: function (v) {
          this.p.FChildForm = v;
        }});
      window.console.log("CreateForm called, FChildForm assigned: " + pas.SysUtils.BoolToStr(this.FChildForm != null,false));
    };
    this.LoadDFMValues = function () {
      pas["WEBLib.Forms"].TCustomForm.LoadDFMValues.call(this);
      this.wllblLogout = pas["WEBLib.ExtCtrls"].TLinkLabel.$create("Create$2",["dropdown.menu.logout"]);
      this.lblVersion = pas["WEBLib.StdCtrls"].TLabel.$create("Create$2",["view.main.version"]);
      this.lblAppTitle = pas["WEBLib.StdCtrls"].TLabel.$create("Create$2",["view.main.apptitle"]);
      this.WebPanel1 = pas["WEBLib.ExtCtrls"].TPanel.$create("Create$2",["main.webpanel"]);
      this.WebMemo1 = pas["WEBLib.StdCtrls"].TMemo.$create("Create$2",["main.debugmemo"]);
      this.WebMessageDlg1 = pas["WEBLib.Dialogs"].TMessageDlg.$create("Create$1",[this]);
      this.XDataWebClient = pas["XData.Web.Client"].TXDataWebClient.$create("Create$1",[this]);
      this.wllblLogout.BeforeLoadDFMValues();
      this.lblVersion.BeforeLoadDFMValues();
      this.lblAppTitle.BeforeLoadDFMValues();
      this.WebPanel1.BeforeLoadDFMValues();
      this.WebMemo1.BeforeLoadDFMValues();
      this.WebMessageDlg1.BeforeLoadDFMValues();
      this.XDataWebClient.BeforeLoadDFMValues();
      try {
        this.SetName("FViewMain");
        this.SetWidth(1322);
        this.SetHeight(764);
        this.SetCSSLibrary(pas["WEBLib.Controls"].TCSSLibrary.cssBootstrap);
        this.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
        this.FFont.FCharset = 0;
        this.FFont.SetColor(0);
        this.FFont.SetHeight(-11);
        this.FFont.SetName("Arial");
        this.FFont.SetStyle({});
        this.SetParentFont(false);
        this.SetEvent(this,"OnCreate","WebFormCreate");
        this.wllblLogout.SetParentComponent(this);
        this.wllblLogout.SetName("wllblLogout");
        this.wllblLogout.SetLeft(501);
        this.wllblLogout.SetTop(33);
        this.wllblLogout.SetWidth(36);
        this.wllblLogout.SetHeight(14);
        this.wllblLogout.SetHeightPercent$1(100.000000000000000000);
        this.wllblLogout.SetWidthPercent$1(100.000000000000000000);
        this.SetEvent$1(this.wllblLogout,this,"OnClick","wllblLogoutClick");
        this.wllblLogout.SetCaption(" Logout");
        this.lblVersion.SetParentComponent(this);
        this.lblVersion.SetName("lblVersion");
        this.lblVersion.SetLeft(396);
        this.lblVersion.SetTop(33);
        this.lblVersion.SetWidth(47);
        this.lblVersion.SetHeight(14);
        this.lblVersion.SetCaption("lblVersion");
        this.lblVersion.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
        this.lblVersion.SetElementPosition(pas["WEBLib.Controls"].TElementPosition.epRelative);
        this.lblVersion.SetHeightStyle(pas["WEBLib.Controls"].TSizeStyle.ssAuto);
        this.lblVersion.SetHeightPercent(100.000000000000000000);
        this.lblVersion.SetWidthPercent(100.000000000000000000);
        this.lblAppTitle.SetParentComponent(this);
        this.lblAppTitle.SetName("lblAppTitle");
        this.lblAppTitle.SetLeft(57);
        this.lblAppTitle.SetTop(33);
        this.lblAppTitle.SetWidth(48);
        this.lblAppTitle.SetHeight(14);
        this.lblAppTitle.SetCaption("emT3web");
        this.lblAppTitle.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
        this.lblAppTitle.SetElementPosition(pas["WEBLib.Controls"].TElementPosition.epRelative);
        this.lblAppTitle.SetHeightStyle(pas["WEBLib.Controls"].TSizeStyle.ssAuto);
        this.lblAppTitle.SetHeightPercent(100.000000000000000000);
        this.lblAppTitle.SetTransparent(false);
        this.lblAppTitle.SetWidthPercent(100.000000000000000000);
        this.WebPanel1.SetParentComponent(this);
        this.WebPanel1.SetName("WebPanel1");
        this.WebPanel1.SetLeft(77);
        this.WebPanel1.SetTop(112);
        this.WebPanel1.SetWidth(1322);
        this.WebPanel1.SetHeight(0);
        this.WebPanel1.SetHeightStyle(pas["WEBLib.Controls"].TSizeStyle.ssAuto);
        this.WebPanel1.SetWidthStyle(pas["WEBLib.Controls"].TSizeStyle.ssAuto);
        this.WebPanel1.SetChildOrderEx(3);
        this.WebPanel1.SetElementFont(pas["WEBLib.Controls"].TElementFont.efCSS);
        this.WebPanel1.SetElementPosition(pas["WEBLib.Controls"].TElementPosition.epIgnore);
        this.WebPanel1.FFont.FCharset = 0;
        this.WebPanel1.FFont.SetColor(0);
        this.WebPanel1.FFont.SetHeight(-11);
        this.WebPanel1.FFont.SetName("Arial");
        this.WebPanel1.FFont.SetStyle({});
        this.WebPanel1.SetParentFont(false);
        this.WebPanel1.SetRole("null");
        this.WebPanel1.SetTabOrder(0);
        this.WebMemo1.SetParentComponent(this);
        this.WebMemo1.SetName("WebMemo1");
        this.WebMemo1.SetLeft(77);
        this.WebMemo1.SetTop(479);
        this.WebMemo1.SetWidth(471);
        this.WebMemo1.SetHeight(83);
        this.WebMemo1.SetElementPosition(pas["WEBLib.Controls"].TElementPosition.epRelative);
        this.WebMemo1.SetEnabled(false);
        this.WebMemo1.SetHeightPercent(100.000000000000000000);
        this.WebMemo1.FLines.BeginUpdate();
        try {
          this.WebMemo1.FLines.Clear();
          this.WebMemo1.FLines.Add("WebMemo1");
        } finally {
          this.WebMemo1.FLines.EndUpdate();
        };
        this.WebMemo1.SetRole("null");
        this.WebMemo1.SetSelLength(0);
        this.WebMemo1.SetSelStart(0);
        this.WebMemo1.SetShowFocus(false);
        this.WebMemo1.SetVisible(false);
        this.WebMemo1.SetWidthPercent(100.000000000000000000);
        this.WebMessageDlg1.SetParentComponent(this);
        this.WebMessageDlg1.SetName("WebMessageDlg1");
        this.WebMessageDlg1.SetLeft(47);
        this.WebMessageDlg1.SetTop(232);
        this.WebMessageDlg1.SetWidth(24);
        this.WebMessageDlg1.SetHeight(24);
        this.WebMessageDlg1.FButtons = {};
        this.WebMessageDlg1.FDialogText.BeginUpdate();
        try {
          this.WebMessageDlg1.FDialogText.Clear();
          this.WebMessageDlg1.FDialogText.Add("Warning");
          this.WebMessageDlg1.FDialogText.Add("Error");
          this.WebMessageDlg1.FDialogText.Add("Information");
          this.WebMessageDlg1.FDialogText.Add("Confirm");
          this.WebMessageDlg1.FDialogText.Add("Custom");
          this.WebMessageDlg1.FDialogText.Add("OK");
          this.WebMessageDlg1.FDialogText.Add("Cancel");
          this.WebMessageDlg1.FDialogText.Add("Yes");
          this.WebMessageDlg1.FDialogText.Add("No");
          this.WebMessageDlg1.FDialogText.Add("Abort");
          this.WebMessageDlg1.FDialogText.Add("Retry");
          this.WebMessageDlg1.FDialogText.Add("Ignore");
          this.WebMessageDlg1.FDialogText.Add("All");
          this.WebMessageDlg1.FDialogText.Add("Yes to all");
          this.WebMessageDlg1.FDialogText.Add("No to all");
          this.WebMessageDlg1.FDialogText.Add("Help");
          this.WebMessageDlg1.FDialogText.Add("Close");
        } finally {
          this.WebMessageDlg1.FDialogText.EndUpdate();
        };
        this.WebMessageDlg1.FOpacity = 0.200000000000000000;
        this.XDataWebClient.SetParentComponent(this);
        this.XDataWebClient.SetName("XDataWebClient");
        this.XDataWebClient.SetConnection(pas.ConnectionModule.DMConnection.ApiConnection);
        this.XDataWebClient.SetLeft(44);
        this.XDataWebClient.SetTop(280);
      } finally {
        this.wllblLogout.AfterLoadDFMValues();
        this.lblVersion.AfterLoadDFMValues();
        this.lblAppTitle.AfterLoadDFMValues();
        this.WebPanel1.AfterLoadDFMValues();
        this.WebMemo1.AfterLoadDFMValues();
        this.WebMessageDlg1.AfterLoadDFMValues();
        this.XDataWebClient.AfterLoadDFMValues();
      };
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addField("wllblLogout",pas["WEBLib.ExtCtrls"].$rtti["TLinkLabel"],4);
    $r.addField("WebPanel1",pas["WEBLib.ExtCtrls"].$rtti["TPanel"],4);
    $r.addField("WebMessageDlg1",pas["WEBLib.Dialogs"].$rtti["TMessageDlg"],4);
    $r.addField("WebMemo1",pas["WEBLib.StdCtrls"].$rtti["TMemo"],4);
    $r.addField("XDataWebClient",pas["XData.Web.Client"].$rtti["TXDataWebClient"],4);
    $r.addField("lblVersion",pas["WEBLib.StdCtrls"].$rtti["TLabel"],4);
    $r.addField("lblAppTitle",pas["WEBLib.StdCtrls"].$rtti["TLabel"],4);
    $r.addMethod("WebFormCreate",0,[["Sender",pas.System.$rtti["TObject"]]],4);
    $r.addMethod("mnuLogoutClick",0,[["Sender",pas.System.$rtti["TObject"]]],4);
    $r.addMethod("wllblLogoutClick",0,[["Sender",pas.System.$rtti["TObject"]]],4);
  });
  this.FViewMain = null;
},["Auth.Service","View.Tasks","View.TasksHTML","View.TasksDataGrid","View.TasksDBGrid"]);
rtl.module("View.TasksTabulator",["System","SysUtils","Classes","JS","Web","WEBLib.Graphics","WEBLib.Controls","WEBLib.Forms","WEBLib.Dialogs","DB","XData.Web.JsonDataset","XData.Web.Dataset","XData.Web.Client","ConnectionModule"],function () {
  "use strict";
  var $mod = this;
  rtl.createClass(this,"TFTasksTabulator",pas["WEBLib.Forms"].TForm,function () {
    this.$init = function () {
      pas["WEBLib.Forms"].TForm.$init.call(this);
      this.xdwcTasks = null;
      this.xdwdsTasks = null;
      this.xdwdsTaskstaskID = null;
      this.xdwdsTasksapplication = null;
      this.xdwdsTasksversion = null;
      this.xdwdsTaskstaskDate = null;
      this.xdwdsTasksreportedBy = null;
      this.xdwdsTasksassignedTo = null;
      this.xdwdsTasksstatus = null;
      this.xdwdsTasksstatusDate = null;
      this.xdwdsTasksformSection = null;
      this.xdwdsTasksissue = null;
      this.xdwdsTasksnotes = null;
    };
    this.$final = function () {
      this.xdwcTasks = undefined;
      this.xdwdsTasks = undefined;
      this.xdwdsTaskstaskID = undefined;
      this.xdwdsTasksapplication = undefined;
      this.xdwdsTasksversion = undefined;
      this.xdwdsTaskstaskDate = undefined;
      this.xdwdsTasksreportedBy = undefined;
      this.xdwdsTasksassignedTo = undefined;
      this.xdwdsTasksstatus = undefined;
      this.xdwdsTasksstatusDate = undefined;
      this.xdwdsTasksformSection = undefined;
      this.xdwdsTasksissue = undefined;
      this.xdwdsTasksnotes = undefined;
      pas["WEBLib.Forms"].TForm.$final.call(this);
    };
    this.LoadDFMValues = function () {
      pas["WEBLib.Forms"].TCustomForm.LoadDFMValues.call(this);
      this.xdwcTasks = pas["XData.Web.Client"].TXDataWebClient.$create("Create$1",[this]);
      this.xdwdsTasks = pas["XData.Web.Dataset"].TXDataWebDataSet.$create("Create$1",[this]);
      this.xdwdsTaskstaskID = pas.DB.TStringField.$create("Create$1",[this]);
      this.xdwdsTasksapplication = pas.DB.TStringField.$create("Create$1",[this]);
      this.xdwdsTasksversion = pas.DB.TStringField.$create("Create$1",[this]);
      this.xdwdsTaskstaskDate = pas.DB.TStringField.$create("Create$1",[this]);
      this.xdwdsTasksreportedBy = pas.DB.TStringField.$create("Create$1",[this]);
      this.xdwdsTasksassignedTo = pas.DB.TStringField.$create("Create$1",[this]);
      this.xdwdsTasksstatus = pas.DB.TStringField.$create("Create$1",[this]);
      this.xdwdsTasksstatusDate = pas.DB.TStringField.$create("Create$1",[this]);
      this.xdwdsTasksformSection = pas.DB.TStringField.$create("Create$1",[this]);
      this.xdwdsTasksissue = pas.DB.TStringField.$create("Create$1",[this]);
      this.xdwdsTasksnotes = pas.DB.TStringField.$create("Create$1",[this]);
      this.xdwcTasks.BeforeLoadDFMValues();
      this.xdwdsTasks.BeforeLoadDFMValues();
      this.xdwdsTaskstaskID.BeforeLoadDFMValues();
      this.xdwdsTasksapplication.BeforeLoadDFMValues();
      this.xdwdsTasksversion.BeforeLoadDFMValues();
      this.xdwdsTaskstaskDate.BeforeLoadDFMValues();
      this.xdwdsTasksreportedBy.BeforeLoadDFMValues();
      this.xdwdsTasksassignedTo.BeforeLoadDFMValues();
      this.xdwdsTasksstatus.BeforeLoadDFMValues();
      this.xdwdsTasksstatusDate.BeforeLoadDFMValues();
      this.xdwdsTasksformSection.BeforeLoadDFMValues();
      this.xdwdsTasksissue.BeforeLoadDFMValues();
      this.xdwdsTasksnotes.BeforeLoadDFMValues();
      try {
        this.SetName("FTasksTabulator");
        this.SetWidth(640);
        this.SetHeight(480);
        this.xdwcTasks.SetParentComponent(this);
        this.xdwcTasks.SetName("xdwcTasks");
        this.xdwcTasks.SetConnection(pas.ConnectionModule.DMConnection.ApiConnection);
        this.xdwcTasks.SetLeft(506);
        this.xdwcTasks.SetTop(92);
        this.xdwdsTasks.SetParentComponent(this);
        this.xdwdsTasks.SetName("xdwdsTasks");
        this.xdwdsTasks.SetLeft(468);
        this.xdwdsTasks.SetTop(182);
        this.xdwdsTaskstaskID.SetParentComponent(this.xdwdsTasks);
        this.xdwdsTaskstaskID.SetName("xdwdsTaskstaskID");
        this.xdwdsTaskstaskID.FFieldName = "taskId";
        this.xdwdsTasksapplication.SetParentComponent(this.xdwdsTasks);
        this.xdwdsTasksapplication.SetName("xdwdsTasksapplication");
        this.xdwdsTasksapplication.FFieldName = "application";
        this.xdwdsTasksversion.SetParentComponent(this.xdwdsTasks);
        this.xdwdsTasksversion.SetName("xdwdsTasksversion");
        this.xdwdsTasksversion.FFieldName = "version";
        this.xdwdsTaskstaskDate.SetParentComponent(this.xdwdsTasks);
        this.xdwdsTaskstaskDate.SetName("xdwdsTaskstaskDate");
        this.xdwdsTaskstaskDate.FFieldName = "taskDate";
        this.xdwdsTasksreportedBy.SetParentComponent(this.xdwdsTasks);
        this.xdwdsTasksreportedBy.SetName("xdwdsTasksreportedBy");
        this.xdwdsTasksreportedBy.FFieldName = "reportedBy";
        this.xdwdsTasksassignedTo.SetParentComponent(this.xdwdsTasks);
        this.xdwdsTasksassignedTo.SetName("xdwdsTasksassignedTo");
        this.xdwdsTasksassignedTo.FFieldName = "assignedTo";
        this.xdwdsTasksstatus.SetParentComponent(this.xdwdsTasks);
        this.xdwdsTasksstatus.SetName("xdwdsTasksstatus");
        this.xdwdsTasksstatus.FFieldName = "status";
        this.xdwdsTasksstatusDate.SetParentComponent(this.xdwdsTasks);
        this.xdwdsTasksstatusDate.SetName("xdwdsTasksstatusDate");
        this.xdwdsTasksstatusDate.FFieldName = "statusDate";
        this.xdwdsTasksformSection.SetParentComponent(this.xdwdsTasks);
        this.xdwdsTasksformSection.SetName("xdwdsTasksformSection");
        this.xdwdsTasksformSection.FFieldName = "formSection";
        this.xdwdsTasksissue.SetParentComponent(this.xdwdsTasks);
        this.xdwdsTasksissue.SetName("xdwdsTasksissue");
        this.xdwdsTasksissue.FFieldName = "issue";
        this.xdwdsTasksnotes.SetParentComponent(this.xdwdsTasks);
        this.xdwdsTasksnotes.SetName("xdwdsTasksnotes");
        this.xdwdsTasksnotes.FFieldName = "notes";
      } finally {
        this.xdwcTasks.AfterLoadDFMValues();
        this.xdwdsTasks.AfterLoadDFMValues();
        this.xdwdsTaskstaskID.AfterLoadDFMValues();
        this.xdwdsTasksapplication.AfterLoadDFMValues();
        this.xdwdsTasksversion.AfterLoadDFMValues();
        this.xdwdsTaskstaskDate.AfterLoadDFMValues();
        this.xdwdsTasksreportedBy.AfterLoadDFMValues();
        this.xdwdsTasksassignedTo.AfterLoadDFMValues();
        this.xdwdsTasksstatus.AfterLoadDFMValues();
        this.xdwdsTasksstatusDate.AfterLoadDFMValues();
        this.xdwdsTasksformSection.AfterLoadDFMValues();
        this.xdwdsTasksissue.AfterLoadDFMValues();
        this.xdwdsTasksnotes.AfterLoadDFMValues();
      };
    };
    rtl.addIntf(this,pas["WEBLib.Controls"].IControl);
    rtl.addIntf(this,pas.System.IUnknown);
    var $r = this.$rtti;
    $r.addField("xdwcTasks",pas["XData.Web.Client"].$rtti["TXDataWebClient"],4);
    $r.addField("xdwdsTasks",pas["XData.Web.Dataset"].$rtti["TXDataWebDataSet"],4);
    $r.addField("xdwdsTaskstaskID",pas.DB.$rtti["TStringField"],4);
    $r.addField("xdwdsTasksapplication",pas.DB.$rtti["TStringField"],4);
    $r.addField("xdwdsTasksversion",pas.DB.$rtti["TStringField"],4);
    $r.addField("xdwdsTaskstaskDate",pas.DB.$rtti["TStringField"],4);
    $r.addField("xdwdsTasksreportedBy",pas.DB.$rtti["TStringField"],4);
    $r.addField("xdwdsTasksassignedTo",pas.DB.$rtti["TStringField"],4);
    $r.addField("xdwdsTasksstatus",pas.DB.$rtti["TStringField"],4);
    $r.addField("xdwdsTasksstatusDate",pas.DB.$rtti["TStringField"],4);
    $r.addField("xdwdsTasksformSection",pas.DB.$rtti["TStringField"],4);
    $r.addField("xdwdsTasksissue",pas.DB.$rtti["TStringField"],4);
    $r.addField("xdwdsTasksnotes",pas.DB.$rtti["TStringField"],4);
  });
  this.FTasksTabulator = null;
});
rtl.module("program",["System","WEBLib.Forms","SysUtils","JS","Web","XData.Web.Connection","WEBLib.Dialogs","Auth.Service","App.Types","ConnectionModule","View.Login","App.Config","View.Main","Utils","View.Tasks","View.TasksHTML","View.TasksDataGrid","View.TasksTabulator","View.TasksDBGrid"],function () {
  "use strict";
  var $mod = this;
  this.DisplayAccessDeniedModal = function (ErrorMessage) {
    var dlg = document.createElement("dialog");
        dlg.classList.add("shadow", "rounded", "border", "p-4");
        dlg.style.maxWidth = "500px";
        dlg.style.width = "90%";
        dlg.style.fontFamily = "system-ui, sans-serif";
    
        dlg.innerHTML =
          "<h5 class='fw-bold mb-3 text-danger'>emT3web</h5>" +
          "<p class='mb-3' style='white-space: pre-wrap;'>" + ErrorMessage + "</p>" +
          "<div class='text-end'>" +
          "<button id='actionBtn' class='btn btn-primary'></button></div>";
    
        document.body.appendChild(dlg);
        dlg.showModal();
    
        var btn = document.getElementById("actionBtn");
    
        if (
          (ErrorMessage.indexOf("Version mismatch") >= 0) ||
          (ErrorMessage.indexOf("old version") >= 0)
        ) {
          btn.textContent = "Reload";
          btn.addEventListener("click", function () {
            location.reload(true);
          });
        } else {
          btn.textContent = "Close";
          btn.addEventListener("click", function () {
            dlg.close();
            dlg.remove();
          });
        };
  };
  this.DisplayLoginView = function (AMessage) {
    pas["Auth.Service"].AuthService().Logout();
    pas.ConnectionModule.DMConnection.ApiConnection.SetConnected(false);
    if (pas["View.Main"].FViewMain != null) rtl.free(pas["View.Main"],"FViewMain");
    if (AMessage === "") {
      $mod.DisplayAccessDeniedModal("Access requires a valid emt3 link. Please reopen from emt3.")}
     else $mod.DisplayAccessDeniedModal(AMessage);
  };
  this.DisplayMainView = function () {
    if (pas["View.Login"].FViewLogin != null) rtl.free(pas["View.Login"],"FViewLogin");
    pas["View.Main"].TFViewMain.Display($mod.DisplayLoginView);
  };
  this.UnauthorizedAccessProc = function (AMessage) {
    $mod.DisplayLoginView(AMessage);
  };
  this.SaveUrlParamsToStorage = function (userId, taskId, code) {
    if (userId !== "") window.localStorage.setItem("EMT3_USER_ID",userId);
    if (taskId !== "") window.localStorage.setItem("EMT3_TASK_ID",taskId);
    if (code !== "") window.localStorage.setItem("EMT3_CODE",code);
  };
  this.StartApplication = function () {
    var UserIdParam = "";
    var TaskIdParam = "";
    var CodeParam = "";
    UserIdParam = pas["WEBLib.Forms"].Application.FParameters.GetValue("user_id");
    TaskIdParam = pas["WEBLib.Forms"].Application.FParameters.GetValue("task_id");
    CodeParam = pas["WEBLib.Forms"].Application.FParameters.GetValue("code");
    $mod.SaveUrlParamsToStorage(UserIdParam,TaskIdParam,CodeParam);
    pas.ConnectionModule.DMConnection.InitApp(function () {
      pas.ConnectionModule.DMConnection.SetClientConfig(function (Success, ErrorMessage) {
        if (Success) {
          if ((UserIdParam !== "") && (TaskIdParam !== "") && (CodeParam !== "")) {
            pas["Auth.Service"].AuthService().Login(UserIdParam,TaskIdParam,CodeParam,function () {
              $mod.DisplayMainView();
            },function (LoginError) {
              $mod.DisplayLoginView("Invalid or expired link." + pas.System.sLineBreak + LoginError);
            });
            return;
          };
          if (pas["Auth.Service"].AuthService().Authenticated() && !pas["Auth.Service"].AuthService().TokenExpired()) {
            $mod.DisplayMainView()}
           else $mod.DisplayLoginView("");
        } else {
          $mod.DisplayAccessDeniedModal(ErrorMessage);
        };
      });
    },$mod.UnauthorizedAccessProc);
  };
  $mod.$implcode = function () {
    pas.System.$rtti["TArray<RTTI.TValue>"].eltype = pas.RTTI.$rtti["TValue"];
    pas.System.$rtti["TArray<RTTI.TRttiType>"].eltype = pas.RTTI.$rtti["TRttiType"];
    pas.System.$rtti["TArray<RTTI.TRttiField>"].eltype = pas.RTTI.$rtti["TRttiField"];
    pas.System.$rtti["TArray<RTTI.TRttiParameter>"].eltype = pas.RTTI.$rtti["TRttiParameter"];
    pas.System.$rtti["TArray<RTTI.TRttiMethod>"].eltype = pas.RTTI.$rtti["TRttiMethod"];
    pas.System.$rtti["TArray<RTTI.TRttiProperty>"].eltype = pas.RTTI.$rtti["TRttiProperty"];
    pas.System.$rtti["TArray<Classes.TPersistentClass>"].eltype = pas.Classes.$rtti["TPersistentClass"];
    pas.System.$rtti["TArray<Generics.Collections.TPair<Generics.Collections.TDictionary.TKey,Generics.Collections.TDictionary.TValue>>"].eltype = pas["Generics.Collections"].$rtti["TPair<Generics.Collections.TDictionary.TKey,Generics.Collections.TDictionary.TValue>"];
    pas.System.$rtti["TArray<Generics.Collections.TPair<Generics.Collections.TObjectDictionary.TKey,Generics.Collections.TObjectDictionary.TValue>>"].eltype = pas["Generics.Collections"].$rtti["TPair<Generics.Collections.TObjectDictionary.TKey,Generics.Collections.TObjectDictionary.TValue>"];
    pas["Generics.Collections"].TEnumerator$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn.$initSpec();
    pas.System.$rtti["TArray<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderColumn>"].eltype = pas["TMS.TMSFNCFilterBuilder"].$rtti["TTMSFNCFilterBuilderColumn"];
    pas["Generics.Collections"].TEnumerable$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn.$initSpec();
    pas["Generics.Collections"].$rtti["TCollectionNotifyEvent<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderColumn>"].init();
    pas["Generics.Defaults"].IComparer$$$G$$generics$defaults$$TTMSFNCFilterBuilderColumn.$initSpec();
    pas["Generics.Collections"].TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn.$initSpec();
    pas["Generics.Collections"].TArrayHelper$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn.$initSpec();
    pas["Generics.Collections"].TCustomList$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn.$initSpec();
    pas["Generics.Collections"].TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn.$initSpec();
    pas["Generics.Defaults"].IEnumerator$$$G$$generics$defaults$$TTMSFNCFilterBuilderColumn.$initSpec();
    pas["Generics.Defaults"].IEnumerable$$$G$$generics$defaults$$TTMSFNCFilterBuilderColumn.$initSpec();
    pas["Generics.Collections"].TList$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn.$initSpec();
    pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCFilterBuilderColumn.$initSpec();
    pas["Generics.Collections"].TEnumerator$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression.$initSpec();
    pas.System.$rtti["TArray<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderExpression>"].eltype = pas["TMS.TMSFNCFilterBuilder"].$rtti["TTMSFNCFilterBuilderExpression"];
    pas["Generics.Collections"].TEnumerable$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression.$initSpec();
    pas["Generics.Collections"].$rtti["TCollectionNotifyEvent<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderExpression>"].init();
    pas["Generics.Defaults"].IComparer$$$G$$generics$defaults$$TTMSFNCFilterBuilderExpression.$initSpec();
    pas["Generics.Collections"].TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression.$initSpec();
    pas["Generics.Collections"].TArrayHelper$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression.$initSpec();
    pas["Generics.Collections"].TCustomList$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression.$initSpec();
    pas["Generics.Collections"].TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression.$initSpec();
    pas["Generics.Defaults"].IEnumerator$$$G$$generics$defaults$$TTMSFNCFilterBuilderExpression.$initSpec();
    pas["Generics.Defaults"].IEnumerable$$$G$$generics$defaults$$TTMSFNCFilterBuilderExpression.$initSpec();
    pas["Generics.Collections"].TList$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression.$initSpec();
    pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCFilterBuilderExpression.$initSpec();
    pas.System.$rtti["TArray<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroup>"].eltype = pas["TMS.TMSFNCFilterBuilder"].$rtti["TTMSFNCFilterBuilderGroup"];
    pas["Generics.Collections"].TEnumerator$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup.$initSpec();
    pas["Generics.Collections"].TEnumerable$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup.$initSpec();
    pas["Generics.Collections"].$rtti["TCollectionNotifyEvent<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroup>"].init();
    pas["Generics.Defaults"].IComparer$$$G$$generics$defaults$$TTMSFNCFilterBuilderGroup.$initSpec();
    pas["Generics.Collections"].TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup.$initSpec();
    pas["Generics.Collections"].TArrayHelper$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup.$initSpec();
    pas["Generics.Collections"].TCustomList$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup.$initSpec();
    pas["Generics.Collections"].TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup.$initSpec();
    pas["Generics.Defaults"].IEnumerator$$$G$$generics$defaults$$TTMSFNCFilterBuilderGroup.$initSpec();
    pas["Generics.Defaults"].IEnumerable$$$G$$generics$defaults$$TTMSFNCFilterBuilderGroup.$initSpec();
    pas["Generics.Collections"].TList$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup.$initSpec();
    pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCFilterBuilderGroup.$initSpec();
    pas.System.$rtti["TArray<Generics.Collections.TPair<System.Longint,Generics.Collections.TPair<System.Double,System.Double>>>"].eltype = pas["Generics.Collections"].$rtti["TPair<System.Longint,Generics.Collections.TPair<System.Double,System.Double>>"];
    pas.System.$rtti["TArray<Generics.Collections.TPair<System.Double,System.Double>>"].eltype = pas["Generics.Collections"].$rtti["TPair<System.Double,System.Double>"];
    pas["Generics.Collections"].TEnumerator$$$G$$generics$collections$$TTMSFNCFilterBuilderGroupOperator.$initSpec();
    pas.System.$rtti["TArray<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroupOperator>"].eltype = pas["TMS.TMSFNCFilterBuilder"].$rtti["TTMSFNCFilterBuilderGroupOperator"];
    pas["Generics.Collections"].TEnumerable$$$G$$generics$collections$$TTMSFNCFilterBuilderGroupOperator.$initSpec();
    pas["Generics.Collections"].$rtti["TCollectionNotifyEvent<TMS.TMSFNCFilterBuilder.TTMSFNCFilterBuilderGroupOperator>"].init();
    pas["Generics.Defaults"].IComparer$$$G$$generics$defaults$$TTMSFNCFilterBuilderGroupOperator.$initSpec();
    pas["Generics.Collections"].TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCFilterBuilderGroupOperator.$initSpec();
    pas["Generics.Collections"].TArrayHelper$$$G$$generics$collections$$TTMSFNCFilterBuilderGroupOperator.$initSpec();
    pas["Generics.Collections"].TCustomList$$$G$$generics$collections$$TTMSFNCFilterBuilderGroupOperator.$initSpec();
    pas["Generics.Collections"].TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCFilterBuilderGroupOperator.$initSpec();
    pas["Generics.Collections"].TStack$$$G$$generics$collections$$TTMSFNCFilterBuilderGroupOperator.$initSpec();
    pas["Generics.Collections"].TEnumerator$$$G$$generics$collections$$TXDataPrimitiveType.$initSpec();
    pas.System.$rtti["TArray<XData.Model.Types.TXDataPrimitiveType>"].eltype = pas["XData.Model.Types"].$rtti["TXDataPrimitiveType"];
    pas["Generics.Collections"].TEnumerable$$$G$$generics$collections$$TXDataPrimitiveType.$initSpec();
    pas["Generics.Collections"].$rtti["TCollectionNotifyEvent<XData.Model.Types.TXDataPrimitiveType>"].init();
    pas["Generics.Defaults"].IComparer$$$G$$generics$defaults$$TXDataPrimitiveType.$initSpec();
    pas["Generics.Collections"].TCustomArrayHelper$$$G$$generics$collections$$TXDataPrimitiveType.$initSpec();
    pas["Generics.Collections"].TArrayHelper$$$G$$generics$collections$$TXDataPrimitiveType.$initSpec();
    pas["Generics.Collections"].TCustomList$$$G$$generics$collections$$TXDataPrimitiveType.$initSpec();
    pas["Generics.Collections"].TCustomListEnumerator$$$G$$generics$collections$$TXDataPrimitiveType.$initSpec();
    pas["Generics.Defaults"].IEnumerator$$$G$$generics$defaults$$TXDataPrimitiveType.$initSpec();
    pas["Generics.Defaults"].IEnumerable$$$G$$generics$defaults$$TXDataPrimitiveType.$initSpec();
    pas["Generics.Collections"].TList$$$G$$generics$collections$$TXDataPrimitiveType.$initSpec();
    pas.System.$rtti["TArray<Generics.Collections.TPair<System.String,System.TObject>>"].eltype = pas["Generics.Collections"].$rtti["TPair<System.String,System.TObject>"];
    pas.System.$rtti["TArray<Generics.Collections.TPair<System.Longint,System.TObject>>"].eltype = pas["Generics.Collections"].$rtti["TPair<System.Longint,System.TObject>"];
    pas.System.$rtti["TArray<Generics.Collections.TPair<System.Longint,System.Longint>>"].eltype = pas["Generics.Collections"].$rtti["TPair<System.Longint,System.Longint>"];
    pas.System.$rtti["TArray<Generics.Collections.TPair<System.Longint,System.Boolean>>"].eltype = pas["Generics.Collections"].$rtti["TPair<System.Longint,System.Boolean>"];
    pas.System.$rtti["TArray<Generics.Collections.TPair<System.Longint,System.Double>>"].eltype = pas["Generics.Collections"].$rtti["TPair<System.Longint,System.Double>"];
    pas["Generics.Collections"].TEnumerator$$$G$$generics$collections$$TTMSFNCObjectReference.$initSpec();
    pas.System.$rtti["TArray<WEBLib.TMSFNCPersistence.TTMSFNCObjectReference>"].eltype = pas["WEBLib.TMSFNCPersistence"].$rtti["TTMSFNCObjectReference"];
    pas["Generics.Collections"].TEnumerable$$$G$$generics$collections$$TTMSFNCObjectReference.$initSpec();
    pas["Generics.Collections"].$rtti["TCollectionNotifyEvent<WEBLib.TMSFNCPersistence.TTMSFNCObjectReference>"].init();
    pas["Generics.Defaults"].IComparer$$$G$$generics$defaults$$TTMSFNCObjectReference.$initSpec();
    pas["Generics.Collections"].TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCObjectReference.$initSpec();
    pas["Generics.Collections"].TArrayHelper$$$G$$generics$collections$$TTMSFNCObjectReference.$initSpec();
    pas["Generics.Collections"].TCustomList$$$G$$generics$collections$$TTMSFNCObjectReference.$initSpec();
    pas["Generics.Collections"].TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCObjectReference.$initSpec();
    pas["Generics.Defaults"].IEnumerator$$$G$$generics$defaults$$TTMSFNCObjectReference.$initSpec();
    pas["Generics.Defaults"].IEnumerable$$$G$$generics$defaults$$TTMSFNCObjectReference.$initSpec();
    pas["Generics.Collections"].TList$$$G$$generics$collections$$TTMSFNCObjectReference.$initSpec();
    pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCObjectReference.$initSpec();
    pas["Generics.Collections"].TEnumerator$$$G$$generics$collections$$TTMSFNCJSONToClassProperty.$initSpec();
    pas.System.$rtti["TArray<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>"].eltype = pas["WEBLib.TMSFNCPersistence"].$rtti["TTMSFNCJSONToClassProperty"];
    pas["Generics.Collections"].TEnumerable$$$G$$generics$collections$$TTMSFNCJSONToClassProperty.$initSpec();
    pas["Generics.Collections"].$rtti["TCollectionNotifyEvent<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>"].init();
    pas["Generics.Defaults"].IComparer$$$G$$generics$defaults$$TTMSFNCJSONToClassProperty.$initSpec();
    pas["Generics.Collections"].TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCJSONToClassProperty.$initSpec();
    pas["Generics.Collections"].TArrayHelper$$$G$$generics$collections$$TTMSFNCJSONToClassProperty.$initSpec();
    pas["Generics.Collections"].TCustomList$$$G$$generics$collections$$TTMSFNCJSONToClassProperty.$initSpec();
    pas["Generics.Collections"].TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCJSONToClassProperty.$initSpec();
    pas["Generics.Defaults"].IEnumerator$$$G$$generics$defaults$$TTMSFNCJSONToClassProperty.$initSpec();
    pas["Generics.Defaults"].IEnumerable$$$G$$generics$defaults$$TTMSFNCJSONToClassProperty.$initSpec();
    pas["Generics.Collections"].TList$$$G$$generics$collections$$TTMSFNCJSONToClassProperty.$initSpec();
    pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCJSONToClassProperty.$initSpec();
    pas["Generics.Collections"].TEnumerator$$$G$$generics$collections$$TTMSFNCJSONToClassItem.$initSpec();
    pas.System.$rtti["TArray<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassItem>"].eltype = pas["WEBLib.TMSFNCPersistence"].$rtti["TTMSFNCJSONToClassItem"];
    pas["Generics.Collections"].TEnumerable$$$G$$generics$collections$$TTMSFNCJSONToClassItem.$initSpec();
    pas["Generics.Collections"].$rtti["TCollectionNotifyEvent<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassItem>"].init();
    pas["Generics.Defaults"].IComparer$$$G$$generics$defaults$$TTMSFNCJSONToClassItem.$initSpec();
    pas["Generics.Collections"].TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCJSONToClassItem.$initSpec();
    pas["Generics.Collections"].TArrayHelper$$$G$$generics$collections$$TTMSFNCJSONToClassItem.$initSpec();
    pas["Generics.Collections"].TCustomList$$$G$$generics$collections$$TTMSFNCJSONToClassItem.$initSpec();
    pas["Generics.Collections"].TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCJSONToClassItem.$initSpec();
    pas["Generics.Defaults"].IEnumerator$$$G$$generics$defaults$$TTMSFNCJSONToClassItem.$initSpec();
    pas["Generics.Defaults"].IEnumerable$$$G$$generics$defaults$$TTMSFNCJSONToClassItem.$initSpec();
    pas["Generics.Collections"].TList$$$G$$generics$collections$$TTMSFNCJSONToClassItem.$initSpec();
    pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCJSONToClassItem.$initSpec();
    pas["Generics.Collections"].TPair$$$G$$generics$collections$$String$$TIconData.$initSpec();
    pas.System.$rtti["TArray<Generics.Collections.TPair<System.String,WEBLib.DesignIntf.TIconData>>"].eltype = pas["Generics.Collections"].$rtti["TPair<System.String,WEBLib.DesignIntf.TIconData>"];
    pas["Generics.Collections"].TEnumerator$$$G$$generics$collections$$TIconData.$initSpec();
    pas.System.$rtti["TArray<WEBLib.DesignIntf.TIconData>"].eltype = pas["WEBLib.DesignIntf"].$rtti["TIconData"];
    pas["Generics.Collections"].TEnumerable$$$G$$generics$collections$$TIconData.$initSpec();
    pas["Generics.Collections"].$rtti["TCollectionNotifyEvent<WEBLib.DesignIntf.TIconData>"].init();
    pas["Generics.Collections"].TDictionary$$$G$$generics$collections$$String$$TIconData.$initSpec();
    pas["Generics.Collections"].TObjectDictionary$$$G$$generics$collections$$String$$TIconData.$initSpec();
    pas["Generics.Defaults"].$rtti["TOnComparison<WEBLib.TMSFNCPersistence.TTMSFNCJSONToClassProperty>"].init();
    pas["Generics.Defaults"].TComparer$$$G$$generics$defaults$$TTMSFNCJSONToClassProperty.$initSpec();
    pas["Generics.Defaults"].TDefaultComparer$$$G$$generics$defaults$$TTMSFNCJSONToClassProperty.$initSpec();
    pas["Generics.Defaults"].TDelegatedComparerEvents$$$G$$generics$defaults$$TTMSFNCJSONToClassProperty.$initSpec();
    pas.SysUtils.$rtti["TFunc<WEBLib.DataGrid.Options.TDGMultilevelHeaderParams,System.Boolean>"].init();
    pas.SysUtils.$rtti["TProc<WEBLib.DataGrid.Options.TDGCollectionItem,JS.TJSArray>"].init();
    pas.SysUtils.$rtti["TFunc<WEBLib.Controls.TBiDiMode,System.JSValue>"].init();
    pas.SysUtils.$rtti["TFunc<WEBLib.DataGrid.TDGRowSelectionType,System.JSValue>"].init();
    pas.SysUtils.$rtti["TFunc<WEBLib.DataGrid.TDGRowEditType,System.JSValue>"].init();
    pas.SysUtils.$rtti["TFunc<WEBLib.DataGrid.DataAdapter.Base.TDGServerDataAdapter,System.JSValue>"].init();
    pas.SysUtils.$rtti["TFunc<WEBLib.DataGrid.Common.TDGCellDataType,System.JSValue>"].init();
    pas.SysUtils.$rtti["TFunc<WEBLib.DataGrid.Options.TDGSelectCellEditorCollection,System.JSValue>"].init();
    pas["Generics.Collections"].TEnumerator$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem.$initSpec();
    pas.System.$rtti["TArray<WEBLib.TMSFNCFilterDialog.TTMSFNCFilterDialogDrawItem>"].eltype = pas["WEBLib.TMSFNCFilterDialog"].$rtti["TTMSFNCFilterDialogDrawItem"];
    pas["Generics.Collections"].TEnumerable$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem.$initSpec();
    pas["Generics.Collections"].$rtti["TCollectionNotifyEvent<WEBLib.TMSFNCFilterDialog.TTMSFNCFilterDialogDrawItem>"].init();
    pas["Generics.Defaults"].IComparer$$$G$$generics$defaults$$TTMSFNCFilterDialogDrawItem.$initSpec();
    pas["Generics.Collections"].TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem.$initSpec();
    pas["Generics.Collections"].TArrayHelper$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem.$initSpec();
    pas["Generics.Collections"].TCustomList$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem.$initSpec();
    pas["Generics.Collections"].TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem.$initSpec();
    pas["Generics.Defaults"].IEnumerator$$$G$$generics$defaults$$TTMSFNCFilterDialogDrawItem.$initSpec();
    pas["Generics.Defaults"].IEnumerable$$$G$$generics$defaults$$TTMSFNCFilterDialogDrawItem.$initSpec();
    pas["Generics.Collections"].TList$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem.$initSpec();
    pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCFilterDialogDrawItem.$initSpec();
    pas["Generics.Collections"].TPair$$$G$$generics$collections$$Longint$$TTMSFNCDataGridCellItem.$initSpec();
    pas.System.$rtti["TArray<Generics.Collections.TPair<System.Longint,WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellItem>>"].eltype = pas["Generics.Collections"].$rtti["TPair<System.Longint,WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellItem>"];
    pas["Generics.Collections"].TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCellItem.$initSpec();
    pas.System.$rtti["TArray<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellItem>"].eltype = pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCellItem"];
    pas["Generics.Collections"].TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridCellItem.$initSpec();
    pas["Generics.Collections"].$rtti["TCollectionNotifyEvent<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellItem>"].init();
    pas["Generics.Collections"].TDictionary$$$G$$generics$collections$$Longint$$TTMSFNCDataGridCellItem.$initSpec();
    pas["Generics.Collections"].TObjectDictionary$$$G$$generics$collections$$Longint$$TTMSFNCDataGridCellItem.$initSpec();
    pas["Generics.Collections"].TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache.$initSpec();
    pas.System.$rtti["TArray<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellControlCache>"].eltype = pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCellControlCache"];
    pas["Generics.Collections"].TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache.$initSpec();
    pas["Generics.Collections"].$rtti["TCollectionNotifyEvent<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCellControlCache>"].init();
    pas["Generics.Defaults"].IComparer$$$G$$generics$defaults$$TTMSFNCDataGridCellControlCache.$initSpec();
    pas["Generics.Collections"].TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache.$initSpec();
    pas["Generics.Collections"].TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache.$initSpec();
    pas["Generics.Collections"].TCustomList$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache.$initSpec();
    pas["Generics.Collections"].TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache.$initSpec();
    pas["Generics.Defaults"].IEnumerator$$$G$$generics$defaults$$TTMSFNCDataGridCellControlCache.$initSpec();
    pas["Generics.Defaults"].IEnumerable$$$G$$generics$defaults$$TTMSFNCDataGridCellControlCache.$initSpec();
    pas["Generics.Collections"].TList$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache.$initSpec();
    pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCDataGridCellControlCache.$initSpec();
    pas["Generics.Collections"].TPair$$$G$$generics$collections$$Longint$$TTMSFNCDataGridRowItem.$initSpec();
    pas.System.$rtti["TArray<Generics.Collections.TPair<System.Longint,WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridRowItem>>"].eltype = pas["Generics.Collections"].$rtti["TPair<System.Longint,WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridRowItem>"];
    pas["Generics.Collections"].TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridRowItem.$initSpec();
    pas.System.$rtti["TArray<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridRowItem>"].eltype = pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridRowItem"];
    pas["Generics.Collections"].TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridRowItem.$initSpec();
    pas["Generics.Collections"].$rtti["TCollectionNotifyEvent<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridRowItem>"].init();
    pas["Generics.Collections"].TDictionary$$$G$$generics$collections$$Longint$$TTMSFNCDataGridRowItem.$initSpec();
    pas["Generics.Collections"].TObjectDictionary$$$G$$generics$collections$$Longint$$TTMSFNCDataGridRowItem.$initSpec();
    pas["Generics.Collections"].TPair$$$G$$generics$collections$$String$$TTMSFNCDataGridDataGroup.$initSpec();
    pas.System.$rtti["TArray<Generics.Collections.TPair<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataGroup>>"].eltype = pas["Generics.Collections"].$rtti["TPair<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataGroup>"];
    pas["Generics.Collections"].TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridDataGroup.$initSpec();
    pas.System.$rtti["TArray<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataGroup>"].eltype = pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataGroup"];
    pas["Generics.Collections"].TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridDataGroup.$initSpec();
    pas["Generics.Collections"].$rtti["TCollectionNotifyEvent<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataGroup>"].init();
    pas["Generics.Collections"].TDictionary$$$G$$generics$collections$$String$$TTMSFNCDataGridDataGroup.$initSpec();
    pas["Generics.Collections"].TObjectDictionary$$$G$$generics$collections$$String$$TTMSFNCDataGridDataGroup.$initSpec();
    pas["Generics.Collections"].TPair$$$G$$generics$collections$$String$$TTMSFNCDataGridDataColumnCalculationArray.$initSpec();
    pas.System.$rtti["TArray<Generics.Collections.TPair<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>>"].eltype = pas["Generics.Collections"].$rtti["TPair<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>"];
    pas["Generics.Collections"].TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridDataColumnCalculationArray.$initSpec();
    pas.System.$rtti["TArray<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>"].eltype = pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataColumnCalculationArray"];
    pas["Generics.Collections"].TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridDataColumnCalculationArray.$initSpec();
    pas["Generics.Collections"].$rtti["TCollectionNotifyEvent<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>"].init();
    pas["Generics.Collections"].TDictionary$$$G$$generics$collections$$String$$TTMSFNCDataGridDataColumnCalculationArray.$initSpec();
    pas.System.$rtti["TArray<Generics.Collections.TPair<System.Longint,Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>>>"].eltype = pas["Generics.Collections"].$rtti["TPair<System.Longint,Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>>"];
    pas.System.$rtti["TArray<Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>>"].eltype = pas["Generics.Collections"].$rtti["TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataColumnCalculationArray>"];
    pas["Generics.Collections"].TPair$$$G$$generics$collections$$String$$TTMSFNCDataGridDataRowCalculationArray.$initSpec();
    pas.System.$rtti["TArray<Generics.Collections.TPair<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>>"].eltype = pas["Generics.Collections"].$rtti["TPair<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>"];
    pas["Generics.Collections"].TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridDataRowCalculationArray.$initSpec();
    pas.System.$rtti["TArray<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>"].eltype = pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataRowCalculationArray"];
    pas["Generics.Collections"].TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridDataRowCalculationArray.$initSpec();
    pas["Generics.Collections"].$rtti["TCollectionNotifyEvent<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>"].init();
    pas["Generics.Collections"].TDictionary$$$G$$generics$collections$$String$$TTMSFNCDataGridDataRowCalculationArray.$initSpec();
    pas.System.$rtti["TArray<Generics.Collections.TPair<System.Longint,Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>>>"].eltype = pas["Generics.Collections"].$rtti["TPair<System.Longint,Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>>"];
    pas.System.$rtti["TArray<Generics.Collections.TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>>"].eltype = pas["Generics.Collections"].$rtti["TDictionary<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataRowCalculationArray>"];
    pas.System.$rtti["TArray<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataSortCellInfo>"].eltype = pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataSortCellInfo"];
    pas.System.$rtti["TArray<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataGroupInfo>"].eltype = pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataGroupInfo"];
    pas.System.$rtti["TArray<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridSortDirection>"].eltype = pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridSortDirection"];
    pas["Generics.Collections"].TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridSortIndex.$initSpec();
    pas.System.$rtti["TArray<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>"].eltype = pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridSortIndex"];
    pas["Generics.Collections"].TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridSortIndex.$initSpec();
    pas["Generics.Collections"].$rtti["TCollectionNotifyEvent<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>"].init();
    pas["Generics.Defaults"].IComparer$$$G$$generics$defaults$$TTMSFNCDataGridSortIndex.$initSpec();
    pas["Generics.Collections"].TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridSortIndex.$initSpec();
    pas["Generics.Collections"].TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridSortIndex.$initSpec();
    pas["Generics.Collections"].TCustomList$$$G$$generics$collections$$TTMSFNCDataGridSortIndex.$initSpec();
    pas["Generics.Collections"].TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCDataGridSortIndex.$initSpec();
    pas["Generics.Defaults"].IEnumerator$$$G$$generics$defaults$$TTMSFNCDataGridSortIndex.$initSpec();
    pas["Generics.Defaults"].IEnumerable$$$G$$generics$defaults$$TTMSFNCDataGridSortIndex.$initSpec();
    pas["Generics.Collections"].TList$$$G$$generics$collections$$TTMSFNCDataGridSortIndex.$initSpec();
    pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCDataGridSortIndex.$initSpec();
    pas["Generics.Collections"].TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridDataTempData.$initSpec();
    pas.System.$rtti["TArray<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataTempData>"].eltype = pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataTempData"];
    pas["Generics.Collections"].TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridDataTempData.$initSpec();
    pas["Generics.Collections"].$rtti["TCollectionNotifyEvent<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataTempData>"].init();
    pas["Generics.Defaults"].IComparer$$$G$$generics$defaults$$TTMSFNCDataGridDataTempData.$initSpec();
    pas["Generics.Collections"].TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridDataTempData.$initSpec();
    pas["Generics.Collections"].TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridDataTempData.$initSpec();
    pas["Generics.Collections"].TCustomList$$$G$$generics$collections$$TTMSFNCDataGridDataTempData.$initSpec();
    pas["Generics.Collections"].TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCDataGridDataTempData.$initSpec();
    pas["Generics.Defaults"].IEnumerator$$$G$$generics$defaults$$TTMSFNCDataGridDataTempData.$initSpec();
    pas["Generics.Defaults"].IEnumerable$$$G$$generics$defaults$$TTMSFNCDataGridDataTempData.$initSpec();
    pas["Generics.Collections"].TList$$$G$$generics$collections$$TTMSFNCDataGridDataTempData.$initSpec();
    pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCDataGridDataTempData.$initSpec();
    pas.System.$rtti["TArray<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataAutoFillLaneModel>"].eltype = pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataAutoFillLaneModel"];
    pas.System.$rtti["TArray<Generics.Collections.TPair<System.String,System.TArray<System.String>>>"].eltype = pas["Generics.Collections"].$rtti["TPair<System.String,System.TArray<System.String>>"];
    pas["Generics.Collections"].TPair$$$G$$generics$collections$$String$$TTMSFNCDataGridDataCustomListIndexEntry.$initSpec();
    pas.System.$rtti["TArray<Generics.Collections.TPair<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataCustomListIndexEntry>>"].eltype = pas["Generics.Collections"].$rtti["TPair<System.String,WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataCustomListIndexEntry>"];
    pas["Generics.Collections"].TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridDataCustomListIndexEntry.$initSpec();
    pas.System.$rtti["TArray<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataCustomListIndexEntry>"].eltype = pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataCustomListIndexEntry"];
    pas["Generics.Collections"].TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridDataCustomListIndexEntry.$initSpec();
    pas["Generics.Collections"].$rtti["TCollectionNotifyEvent<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataCustomListIndexEntry>"].init();
    pas["Generics.Collections"].TDictionary$$$G$$generics$collections$$String$$TTMSFNCDataGridDataCustomListIndexEntry.$initSpec();
    pas["Generics.Collections"].TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCell.$initSpec();
    pas.System.$rtti["TArray<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCell>"].eltype = pas["WEBLib.TMSFNCDataGridCell"].$rtti["TTMSFNCDataGridCell"];
    pas["Generics.Collections"].TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridCell.$initSpec();
    pas["Generics.Collections"].$rtti["TCollectionNotifyEvent<WEBLib.TMSFNCDataGridCell.TTMSFNCDataGridCell>"].init();
    pas["Generics.Defaults"].IComparer$$$G$$generics$defaults$$TTMSFNCDataGridCell.$initSpec();
    pas["Generics.Collections"].TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridCell.$initSpec();
    pas["Generics.Collections"].TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridCell.$initSpec();
    pas["Generics.Collections"].TCustomList$$$G$$generics$collections$$TTMSFNCDataGridCell.$initSpec();
    pas["Generics.Collections"].TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCell.$initSpec();
    pas["Generics.Defaults"].IEnumerator$$$G$$generics$defaults$$TTMSFNCDataGridCell.$initSpec();
    pas["Generics.Defaults"].IEnumerable$$$G$$generics$defaults$$TTMSFNCDataGridCell.$initSpec();
    pas["Generics.Collections"].TList$$$G$$generics$collections$$TTMSFNCDataGridCell.$initSpec();
    pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCDataGridCell.$initSpec();
    pas["Generics.Collections"].TPair$$$G$$generics$collections$$TTMSFNCDataGridCellCoord$$Boolean.$initSpec();
    pas.System.$rtti["TArray<Generics.Collections.TPair<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord,System.Boolean>>"].eltype = pas["Generics.Collections"].$rtti["TPair<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord,System.Boolean>"];
    pas["Generics.Defaults"].IComparer$$$G$$generics$defaults$$TTMSFNCDataGridCellCoord.$initSpec();
    pas["Generics.Collections"].TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCellCoord.$initSpec();
    pas.System.$rtti["TArray<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord>"].eltype = pas["WEBLib.TMSFNCDataGridCore"].$rtti["TTMSFNCDataGridCellCoord"];
    pas["Generics.Collections"].TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridCellCoord.$initSpec();
    pas["Generics.Collections"].$rtti["TCollectionNotifyEvent<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord>"].init();
    pas["Generics.Collections"].TDictionary$$$G$$generics$collections$$TTMSFNCDataGridCellCoord$$Boolean.$initSpec();
    pas["Generics.Collections"].TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridCellCoord.$initSpec();
    pas["Generics.Collections"].TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridCellCoord.$initSpec();
    pas["Generics.Collections"].TCustomList$$$G$$generics$collections$$TTMSFNCDataGridCellCoord.$initSpec();
    pas["Generics.Collections"].TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCellCoord.$initSpec();
    pas["Generics.Defaults"].IEnumerator$$$G$$generics$defaults$$TTMSFNCDataGridCellCoord.$initSpec();
    pas["Generics.Defaults"].IEnumerable$$$G$$generics$defaults$$TTMSFNCDataGridCellCoord.$initSpec();
    pas["Generics.Collections"].TList$$$G$$generics$collections$$TTMSFNCDataGridCellCoord.$initSpec();
    pas["Generics.Collections"].TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem.$initSpec();
    pas.System.$rtti["TArray<WEBLib.TMSFNCDataGridRenderer.TTMSFNCDataGridCellControlWrapperListItem>"].eltype = pas["WEBLib.TMSFNCDataGridRenderer"].$rtti["TTMSFNCDataGridCellControlWrapperListItem"];
    pas["Generics.Collections"].TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem.$initSpec();
    pas["Generics.Collections"].$rtti["TCollectionNotifyEvent<WEBLib.TMSFNCDataGridRenderer.TTMSFNCDataGridCellControlWrapperListItem>"].init();
    pas["Generics.Defaults"].IComparer$$$G$$generics$defaults$$TTMSFNCDataGridCellControlWrapperListItem.$initSpec();
    pas["Generics.Collections"].TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem.$initSpec();
    pas["Generics.Collections"].TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem.$initSpec();
    pas["Generics.Collections"].TCustomList$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem.$initSpec();
    pas["Generics.Collections"].TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem.$initSpec();
    pas["Generics.Defaults"].IEnumerator$$$G$$generics$defaults$$TTMSFNCDataGridCellControlWrapperListItem.$initSpec();
    pas["Generics.Defaults"].IEnumerable$$$G$$generics$defaults$$TTMSFNCDataGridCellControlWrapperListItem.$initSpec();
    pas["Generics.Collections"].TList$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem.$initSpec();
    pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCDataGridCellControlWrapperListItem.$initSpec();
    pas["Generics.Collections"].TEnumerator$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup.$initSpec();
    pas.System.$rtti["TArray<WEBLib.TMSFNCDataGrid.TTMSFNCDataGridHeaderGroup>"].eltype = pas["WEBLib.TMSFNCDataGrid"].$rtti["TTMSFNCDataGridHeaderGroup"];
    pas["Generics.Collections"].TEnumerable$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup.$initSpec();
    pas["Generics.Collections"].$rtti["TCollectionNotifyEvent<WEBLib.TMSFNCDataGrid.TTMSFNCDataGridHeaderGroup>"].init();
    pas["Generics.Defaults"].IComparer$$$G$$generics$defaults$$TTMSFNCDataGridHeaderGroup.$initSpec();
    pas["Generics.Collections"].TCustomArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup.$initSpec();
    pas["Generics.Collections"].TArrayHelper$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup.$initSpec();
    pas["Generics.Collections"].TCustomList$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup.$initSpec();
    pas["Generics.Collections"].TCustomListEnumerator$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup.$initSpec();
    pas["Generics.Defaults"].IEnumerator$$$G$$generics$defaults$$TTMSFNCDataGridHeaderGroup.$initSpec();
    pas["Generics.Defaults"].IEnumerable$$$G$$generics$defaults$$TTMSFNCDataGridHeaderGroup.$initSpec();
    pas["Generics.Collections"].TList$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup.$initSpec();
    pas["Generics.Collections"].TObjectList$$$G$$generics$collections$$TTMSFNCDataGridHeaderGroup.$initSpec();
    pas.System.$rtti["TArray<WEBLib.TMSFNCTypes.TRectF>"].eltype = pas["WEBLib.TMSFNCTypes"].$rtti["TRectF"];
    pas.System.$rtti["TArray<Generics.Collections.TPair<System.Longint,Generics.Collections.TObjectList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>>>"].eltype = pas["Generics.Collections"].$rtti["TPair<System.Longint,Generics.Collections.TObjectList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>>"];
    pas.System.$rtti["TArray<Generics.Collections.TObjectList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>>"].eltype = pas["Generics.Collections"].$rtti["TObjectList<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridSortIndex>"];
    pas["Generics.Collections"].TPair$$$G$$generics$collections$$TTMSFNCDataGridCellCoord$$Longint.$initSpec();
    pas.System.$rtti["TArray<Generics.Collections.TPair<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord,System.Longint>>"].eltype = pas["Generics.Collections"].$rtti["TPair<WEBLib.TMSFNCDataGridCore.TTMSFNCDataGridCellCoord,System.Longint>"];
    pas["Generics.Collections"].TDictionary$$$G$$generics$collections$$TTMSFNCDataGridCellCoord$$Longint.$initSpec();
    pas.System.$rtti["TArray<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataSortInfo>"].eltype = pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataSortInfo"];
    pas.System.$rtti["TArray<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataSortOptions>"].eltype = pas["WEBLib.TMSFNCDataGridData"].$rtti["TTMSFNCDataGridDataSortOptions"];
    pas["Generics.Defaults"].IComparer$$$G$$generics$defaults$$TTMSFNCDataGridDataSortInfo.$initSpec();
    pas["Generics.Defaults"].$rtti["TOnComparison<WEBLib.TMSFNCDataGridData.TTMSFNCDataGridDataSortInfo>"].init();
    pas["Generics.Defaults"].TComparer$$$G$$generics$defaults$$TTMSFNCDataGridDataSortInfo.$initSpec();
    pas["Generics.Defaults"].TDefaultComparer$$$G$$generics$defaults$$TTMSFNCDataGridDataSortInfo.$initSpec();
    pas["Generics.Defaults"].TDelegatedComparerEvents$$$G$$generics$defaults$$TTMSFNCDataGridDataSortInfo.$initSpec();
  };
  $mod.$main = function () {
    pas["WEBLib.Forms"].Application.Initialize();
    pas["WEBLib.Forms"].Application.FMainFormOnTaskBar = true;
    pas["WEBLib.Forms"].Application.CreateFormDirect$2(pas.ConnectionModule.TDMConnection,{p: pas.ConnectionModule, get: function () {
        return this.p.DMConnection;
      }, set: function (v) {
        this.p.DMConnection = v;
      }});
    $mod.StartApplication();
    pas["WEBLib.Forms"].Application.Run();
  };
});
//# sourceMappingURL=emT3web.js.map
